commit d20f21db8807bddb59739bee534495a56cd532c1 Author: nickxia <577208907@qq.com> Date: Thu May 30 18:03:35 2024 +0800 first diff --git a/QR205_170_ST_GD_86/.vscode/settings.json b/QR205_170_ST_GD_86/.vscode/settings.json new file mode 100644 index 0000000..80aee6b --- /dev/null +++ b/QR205_170_ST_GD_86/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "gd32f10x.h": "c", + "systick.h": "c" + } +} \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/Schematic/GD32107C-EVAL-V1.3.pdf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/Schematic/GD32107C-EVAL-V1.3.pdf new file mode 100644 index 0000000..dffd986 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/Schematic/GD32107C-EVAL-V1.3.pdf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_Firmware_Library_User_Guide_Rev2.2.pdf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_Firmware_Library_User_Guide_Rev2.2.pdf new file mode 100644 index 0000000..b4846c6 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_Firmware_Library_User_Guide_Rev2.2.pdf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_固件库使用指南_Rev2.2.pdf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_固件库使用指南_Rev2.2.pdf new file mode 100644 index 0000000..293ecb4 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Docs/User Guide/GD32F10x_固件库使用指南_Rev2.2.pdf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.c new file mode 100644 index 0000000..5320a58 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/main.c new file mode 100644 index 0000000..d7a0e93 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/main.c @@ -0,0 +1,223 @@ +/*! + \file main.c + \brief ADC0_ADC1_regular_parallel + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +uint32_t adc_value[2]; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void timer_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* TIMER configuration */ + timer_config(); + /* DMA configuration */ + dma_config(); + /* ADC configuration */ + adc_config(); + + /* enable TIMER1 */ + timer_enable(TIMER1); + + while(1){ + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable ADC0 clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable ADC1 clock */ + rcu_periph_clock_enable(RCU_ADC1); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* enable timer1 clock */ + rcu_periph_clock_enable(RCU_TIMER1); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_0|GPIO_PIN_3); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + /* ADC_DMA_channel configuration */ + dma_parameter_struct dma_data_parameter; + + /* ADC DMA_channel configuration */ + dma_deinit(DMA0, DMA_CH0); + + /* initialize DMA data mode */ + dma_data_parameter.periph_addr = (uint32_t)(&ADC_RDATA(ADC0)); + dma_data_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_data_parameter.memory_addr = (uint32_t)(&adc_value); + dma_data_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_data_parameter.periph_width = DMA_PERIPHERAL_WIDTH_32BIT; + dma_data_parameter.memory_width = DMA_MEMORY_WIDTH_32BIT; + dma_data_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_data_parameter.number = 2; + dma_data_parameter.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH0, &dma_data_parameter); + + dma_circulation_enable(DMA0, DMA_CH0); + + /* enable DMA channel */ + dma_channel_enable(DMA0, DMA_CH0); +} + +/*! + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer_config(void) +{ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + /* TIMER1 configuration */ + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 9999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH0 configuration in PWM mode1 */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_channel_output_config(TIMER1, TIMER_CH_1, &timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_1, 3999); + timer_channel_output_mode_config(TIMER1, TIMER_CH_1, TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_1, TIMER_OC_SHADOW_DISABLE); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + adc_deinit(ADC1); + /* ADC mode config */ + adc_mode_config(ADC_DAUL_REGULAL_PARALLEL); + /* ADC continous function enable */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + adc_special_function_config(ADC1, ADC_SCAN_MODE, ENABLE); + + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + adc_data_alignment_config(ADC1, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 2); + adc_channel_length_config(ADC1, ADC_REGULAR_CHANNEL, 2); + + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 1, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC1, 0, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC1, 1, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_EXTTRIG_REGULAR_T1_CH1); + adc_external_trigger_source_config(ADC1, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + /* ADC external trigger enable */ + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + adc_external_trigger_config(ADC1, ADC_REGULAR_CHANNEL, ENABLE); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); + /* enable ADC interface */ + adc_enable(ADC1); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC1); + + /* ADC DMA function enable */ + adc_dma_mode_enable(ADC0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/readme.txt new file mode 100644 index 0000000..65695c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of the ADC0_ADC1_regular_parallel example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use ADC0 and ADC1 +regular_parallel convert function. PA3 and PA0 are configured in AIN mode. TIMER1_CH1 +is the trigger source of ADC0. ADC1 external trigger chooses none. When the rising edge +of TIMER1_CH1 coming, ADC0 and ADC1 regular channels are triggered at the same time. The +values of ADC0 and ADC1 are transmit to array adc_value[] by DMA. + + We can watch array adc_value[] in debug mode. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_ADC1_regular_parallel/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.c new file mode 100644 index 0000000..dcf918f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.c @@ -0,0 +1,172 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +extern uint16_t inserted_data[4]; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles ADC0 and ADC1 interrupt + \param[in] none + \param[out] none + \retval none +*/ +void ADC0_1_IRQHandler(void) +{ + /* clear the ADC flag */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOIC); + /* read ADC inserted group data register */ + inserted_data[0] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_0); + inserted_data[1] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_1); + inserted_data[2] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_2); + inserted_data[3] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_3); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.h new file mode 100644 index 0000000..ca2c6b0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles ADC0 and ADC1 interrupt */ +void ADC0_1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/main.c new file mode 100644 index 0000000..f8edb3d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/main.c @@ -0,0 +1,252 @@ +/*! + \file main.c + \brief ADC0 EXTI trigger regular and inserted channel + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +uint16_t adc_value[4]; +uint16_t inserted_data[4]; + +void rcu_config(void); +void gpio_config(void); +void nvic_config(void); +void dma_config(void); +void adc_config(void); +void exti_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* GPIO configuration */ + gpio_config(); + /* configure the EXTI peripheral */ + exti_config(); + /* systick configuration */ + systick_config(); + /* NVIC configuration */ + nvic_config(); + /* configure COM port */ + gd_eval_com_init(EVAL_COM1); + /* DMA configuration */ + dma_config(); + /* ADC configuration */ + adc_config(); + + while(1){ + delay_1ms(1000); + printf("\r\n ADC0 regular channel 0 data = %d \r\n",adc_value[0]); + printf("\r\n ADC0 regular channel 1 data = %d \r\n",adc_value[1]); + printf("\r\n ADC0 regular channel 2 data = %d \r\n",adc_value[2]); + printf("\r\n ADC0 regular channel 3 data = %d \r\n",adc_value[3]); + printf("\r\n ADC0 inserted channel 0 data = %d \r\n",inserted_data[0]); + printf("\r\n ADC0 inserted channel 1 data = %d \r\n",inserted_data[1]); + printf("\r\n ADC0 inserted channel 2 data = %d \r\n",inserted_data[2]); + printf("\r\n ADC0 inserted channel 3 data = %d \r\n",inserted_data[3]); + printf("\r\n ***********************************\r\n"); + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable ADC0 clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV4); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* enable alternate function clock */ + rcu_periph_clock_enable(RCU_AF); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode, for ADC */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7); + /* config the GPIO as floating input mode, for EXTI */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_11); + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_15); +} + +/** + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none + */ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(ADC0_1_IRQn, 1, 1); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + /* ADC_DMA_channel configuration */ + dma_parameter_struct dma_data_parameter; + + /* ADC DMA_channel configuration */ + dma_deinit(DMA0, DMA_CH0); + + /* initialize DMA single data mode */ + dma_data_parameter.periph_addr = (uint32_t)(&ADC_RDATA(ADC0)); + dma_data_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_data_parameter.memory_addr = (uint32_t)(&adc_value); + dma_data_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_data_parameter.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_data_parameter.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_data_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_data_parameter.number = 4; + dma_data_parameter.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH0, &dma_data_parameter); + + /* enable DMA circulation mode */ + dma_circulation_enable(DMA0, DMA_CH0); + + /* enable DMA channel */ + dma_channel_enable(DMA0, DMA_CH0); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC continous function enable */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_INSERTED_CHANNEL, 4); + /* ADC inserted channel config */ + adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_1, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 2, ADC_CHANNEL_2, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 3, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_EXTTRIG_INSERTED_EXTI_15); + /* ADC external trigger enable */ + adc_external_trigger_config(ADC0, ADC_INSERTED_CHANNEL, ENABLE); + /* clear the ADC flag */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOC); + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOIC); + /* enable ADC interrupt */ + adc_interrupt_enable(ADC0, ADC_INT_EOIC); + + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 4); + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_4, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 1, ADC_CHANNEL_5, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 2, ADC_CHANNEL_6, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 3, ADC_CHANNEL_7, ADC_SAMPLETIME_55POINT5); + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_EXTTRIG_REGULAR_EXTI_11); + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + /* ADC DMA function enable */ + adc_dma_mode_enable(ADC0); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); +} + +/*! + \brief configure the EXTI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void exti_config(void) +{ + /* connect EXTI line to GPIO pin for inserted group */ + gpio_exti_source_select(GPIO_PORT_SOURCE_GPIOB, GPIO_PIN_SOURCE_15); + /* configure EXTI line for inserted group */ + exti_init(EXTI_15, EXTI_EVENT, EXTI_TRIG_RISING); + + /* connect EXTI line to GPIO pin for inserted group */ + gpio_exti_source_select(GPIO_PORT_SOURCE_GPIOA, GPIO_PIN_SOURCE_11); + /* configure EXTI line for inserted group */ + exti_init(EXTI_11, EXTI_EVENT, EXTI_TRIG_RISING); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM1, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/readme.txt new file mode 100644 index 0000000..9b530be --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of the ADC0 EXTI trigger regular and inserted channel + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to convert ADC +regular and inserted group channels using EXTI external trigger. + + The inserted group length is 4, the scan mode is set, every rising edge event of +EXTI15(PB15) will trigger ADC to convert all the channels in the inserted group. +When all inserted group channels are converted, EOIC interrupt will be generated. +The inserted datas are print by USART. + + The regular group length is 4. Every rising edge event of EXTI11(PA11) converts 4 +channels and DMA can be used to transfer the converted data. + + We can watch array adc_value[]/inserted_data[] in debug mode or by COM1 and jump + JP4 to Usart1. + Connect PB15 to KEY2(PA0) and connect PA11 to KEY3(PC13). + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_EXTI_trigger_regular_inserted_channel/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.c new file mode 100644 index 0000000..98f6d1f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.c @@ -0,0 +1,170 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +extern uint16_t inserted_data[4]; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles ADC0 and ADC1 interrupt + \param[in] none + \param[out] none + \retval none +*/ +void ADC0_1_IRQHandler(void) +{ + /* clear the ADC flag */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOIC); + /* read ADC inserted group data register */ + inserted_data[0] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_0); + inserted_data[1] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_1); + inserted_data[2] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_2); + inserted_data[3] = adc_inserted_data_read(ADC0, ADC_INSERTED_CHANNEL_3); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.h new file mode 100644 index 0000000..ca2c6b0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles ADC0 and ADC1 interrupt */ +void ADC0_1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/main.c new file mode 100644 index 0000000..9ccaaa6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/main.c @@ -0,0 +1,211 @@ +/*! + \file main.c + \brief TIMER trigger injected channel of ADC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +uint16_t inserted_data[4]; + +void rcu_config(void); +void gpio_config(void); +void nvic_config(void); +void timer_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* NVIC configuration */ + nvic_config(); + /* TIMER configuration */ + timer_config(); + /* ADC configuration */ + adc_config(); + /* configure COM port */ + gd_eval_com_init(EVAL_COM1); + + /* enable TIMER1 */ + timer_enable(TIMER1); + + while(1){ + delay_1ms(1000); + printf("\r\n ADC0 inserted channel 0 data = %d \r\n", inserted_data[0]); + printf("\r\n ADC0 inserted channel 1 data = %d \r\n", inserted_data[1]); + printf("\r\n ADC0 inserted channel 2 data = %d \r\n", inserted_data[2]); + printf("\r\n ADC0 inserted channel 3 data = %d \r\n", inserted_data[3]); + printf("\r\n ***********************************\r\n"); + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable ADC0 clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable timer1 clock */ + rcu_periph_clock_enable(RCU_TIMER1); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); +} + + +/*! + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer_config(void) +{ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + /* deinit a timer */ + timer_deinit(TIMER1); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + /* TIMER1 configuration */ + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 9999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH0 configuration in PWM mode1 */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_channel_output_config(TIMER1, TIMER_CH_0, &timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_0, 3999); + timer_channel_output_mode_config(TIMER1, TIMER_CH_0, TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC continous function enable */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_INSERTED_CHANNEL, 4); + + /* ADC inserted channel config */ + adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_1, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 2, ADC_CHANNEL_2, ADC_SAMPLETIME_55POINT5); + adc_inserted_channel_config(ADC0, 3, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_EXTTRIG_INSERTED_T1_CH0); + + /* ADC external trigger enable */ + adc_external_trigger_config(ADC0, ADC_INSERTED_CHANNEL, ENABLE); + /* clear the ADC flag */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOC); + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOIC); + /* enable ADC interrupt */ + adc_interrupt_enable(ADC0, ADC_INT_EOIC); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); +} + +/** + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none + */ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(ADC0_1_IRQn, 1, 1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM1,USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/readme.txt new file mode 100644 index 0000000..438f10a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of the ADC TIMER trigger injected channel + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to convert ADC inserted +group channels continuously using TIMER1 external trigger. + + The inserted group length is 4, the scan mode is set, every compare event will trigger ADC +to convert all the channels in the inserted group. + + We can watch adc_value in debug mode or by COM1. + Jump JP4 to Usart1. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_TIMER1_trigger_inserted_channel/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.c new file mode 100644 index 0000000..67cba98 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/main.c new file mode 100644 index 0000000..a1d1c96 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/main.c @@ -0,0 +1,203 @@ +/*! + \file main.c + \brief ADC discontinuous mode for regular channel + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +uint16_t adc_value[8]; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* configure COM port */ + gd_eval_com_init(EVAL_COM1); + /* DMA configuration */ + dma_config(); + /* ADC configuration */ + adc_config(); + + while(1){ + /* delay 1s */ + delay_1ms(1000); + /* ADC software trigger enable */ + adc_software_trigger_enable(ADC0, ADC_REGULAR_CHANNEL); + + printf("\r\n ADC0 regular channel discontinuous mode 1st data: \r\n"); + printf("\r\n ADC0 regular channel 0 data = %d \r\n",adc_value[0]); + printf("\r\n ADC0 regular channel 1 data = %d \r\n",adc_value[1]); + printf("\r\n ADC0 regular channel 2 data = %d \r\n",adc_value[2]); + printf("\r\n ADC0 regular channel discontinuous mode 2st data: \r\n"); + printf("\r\n ADC0 regular channel 3 data = %d \r\n",adc_value[3]); + printf("\r\n ADC0 regular channel 4 data = %d \r\n",adc_value[4]); + printf("\r\n ADC0 regular channel 5 data = %d \r\n",adc_value[5]); + printf("\r\n ADC0 regular channel discontinuous mode 3st data: \r\n"); + printf("\r\n ADC0 regular channel 6 data = %d \r\n",adc_value[6]); + printf("\r\n ADC0 regular channel 7 data = %d \r\n",adc_value[7]); + printf("\r\n ***********************************\r\n"); + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable ADC0 clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + /* ADC_DMA_channel configuration */ + dma_parameter_struct dma_data_parameter; + + /* ADC DMA_channel configuration */ + dma_deinit(DMA0, DMA_CH0); + + /* initialize DMA single data mode */ + dma_data_parameter.periph_addr = (uint32_t)(&ADC_RDATA(ADC0)); + dma_data_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_data_parameter.memory_addr = (uint32_t)(adc_value); + dma_data_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_data_parameter.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_data_parameter.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_data_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_data_parameter.number = 8; + dma_data_parameter.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH0, &dma_data_parameter); + + dma_circulation_enable(DMA0, DMA_CH0); + + /* enable DMA channel */ + dma_channel_enable(DMA0, DMA_CH0); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 8); + + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 1, ADC_CHANNEL_1, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 2, ADC_CHANNEL_2, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 3, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 4, ADC_CHANNEL_4, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 5, ADC_CHANNEL_5, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 6, ADC_CHANNEL_6, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 7, ADC_CHANNEL_7, ADC_SAMPLETIME_55POINT5); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + + /* ADC discontinuous mode */ + adc_discontinuous_mode_config(ADC0, ADC_REGULAR_CHANNEL, 3); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); + + /* ADC DMA function enable */ + adc_dma_mode_enable(ADC0); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM1, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/readme.txt new file mode 100644 index 0000000..a80848f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of the ADC discontinuous mode example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use the ADC discontinuous +mode. The ADC is configured in discontinuous mode, group length is 8, conversion length is 3, +using software trigger. Every trigger converts 3 channels. + + We can watch array adc_value[] in debug mode or by COM1. + Jump JP4 to Usart1. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_discontinuous_mode/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.c new file mode 100644 index 0000000..cbd8e88 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.c @@ -0,0 +1,152 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/main.c new file mode 100644 index 0000000..6274a4e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/main.c @@ -0,0 +1,188 @@ +/*! + \file main.c + \brief ADC_regular_channel_with_DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +uint16_t adc_value[4]; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* configure COM port */ + gd_eval_com_init(EVAL_COM0); + /* DMA configuration */ + dma_config(); + /* ADC configuration */ + adc_config(); + + while(1){ + delay_1ms(1000); + printf("\r\n //*******************************//"); + printf("\r\n ADC regular channel data = %04X", adc_value[0]); + printf("\r\n ADC regular channel data = %04X", adc_value[1]); + printf("\r\n ADC regular channel data = %04X", adc_value[2]); + printf("\r\n ADC regular channel data = %04X\r\n", adc_value[3]); + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable ADC clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + /* ADC_DMA_channel configuration */ + dma_parameter_struct dma_data_parameter; + + /* ADC DMA_channel configuration */ + dma_deinit(DMA0, DMA_CH0); + + /* initialize DMA single data mode */ + dma_data_parameter.periph_addr = (uint32_t)(&ADC_RDATA(ADC0)); + dma_data_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_data_parameter.memory_addr = (uint32_t)(&adc_value); + dma_data_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_data_parameter.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_data_parameter.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_data_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_data_parameter.number = 4U; + dma_data_parameter.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH0, &dma_data_parameter); + dma_circulation_enable(DMA0, DMA_CH0); + + /* enable DMA channel */ + dma_channel_enable(DMA0, DMA_CH0); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC contineous function enable */ + adc_special_function_config(ADC0, ADC_CONTINUOUS_MODE, ENABLE); + /* ADC scan mode disable */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 4); + + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_0, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 1, ADC_CHANNEL_1, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 2, ADC_CHANNEL_2, ADC_SAMPLETIME_55POINT5); + adc_regular_channel_config(ADC0, 3, ADC_CHANNEL_3, ADC_SAMPLETIME_55POINT5); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); + + /* ADC DMA function enable */ + adc_dma_mode_enable(ADC0); + /* ADC software trigger enable */ + adc_software_trigger_enable(ADC0, ADC_REGULAR_CHANNEL); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/readme.txt new file mode 100644 index 0000000..5470bfa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of the ADC regular channel with DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use the ADC to +convert analog signal to digital data through DMA. The ADC is configured in continuous +mode, PA0~PA3 is chosen as analog input pin. + + As the ADC conversion begins by software, the converted data from ADC_RDATA register +to SRAM begins continuously. Users can change the voltage on the pins, and check if the +values match the converted data through the watch window. + + The analog input pin should configured to AIN mode. We can watch array adc_value[] in +debug mode or COM. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_regular_channel_with_DMA/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.c new file mode 100644 index 0000000..c12cbc6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.c @@ -0,0 +1,152 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.h new file mode 100644 index 0000000..d8da237 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_libopt.h new file mode 100644 index 0000000..1727d82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/main.c new file mode 100644 index 0000000..442d495 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/main.c @@ -0,0 +1,148 @@ +/*! + \file main.c + \brief ADC software trigger regular channel polling + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +__IO uint16_t adc_value[4]; + +void rcu_config(void); +void gpio_config(void); +void adc_config(void); +uint16_t adc_channel_sample(uint8_t channel); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* ADC configuration */ + adc_config(); + + while(1){ + adc_value[0] = adc_channel_sample(ADC_CHANNEL_1); + adc_value[1] = adc_channel_sample(ADC_CHANNEL_2); + adc_value[2] = adc_channel_sample(ADC_CHANNEL_3); + adc_value[3] = adc_channel_sample(ADC_CHANNEL_4); + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable ADC clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config the GPIO as analog mode */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 1U); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + /* ADC external trigger config */ + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1U); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); +} + +/*! + \brief ADC channel sample + \param[in] none + \param[out] none + \retval none +*/ +uint16_t adc_channel_sample(uint8_t channel) +{ + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0U, channel, ADC_SAMPLETIME_7POINT5); + /* ADC software trigger enable */ + adc_software_trigger_enable(ADC0, ADC_REGULAR_CHANNEL); + + /* wait the end of conversion flag */ + while(!adc_flag_get(ADC0, ADC_FLAG_EOC)); + /* clear the end of conversion flag */ + adc_flag_clear(ADC0, ADC_FLAG_EOC); + /* return regular channel sample value */ + return (adc_regular_data_read(ADC0)); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/readme.txt new file mode 100644 index 0000000..d4f3821 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of the ADC software trigger regular channel polling + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use the ADC to +convert analog signal to digital data, four channel analog signals are collected in a +certain sequence. PA1~PA4 are chosen as analog input pin(AIN mode). + + As the ADC conversion begins by software, the conversion data will read with checking +the EOC flag. + + Users can change the input signal on the GD32107C-EVAL-V1.3 board, and check if its +value matches the converted data through the watch window. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.c new file mode 100644 index 0000000..7b7622a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.h new file mode 100644 index 0000000..3b483d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_software_trigger_regular_channel_polling/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.c new file mode 100644 index 0000000..cbd8e88 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.c @@ -0,0 +1,152 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/main.c new file mode 100644 index 0000000..7c58ca3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/main.c @@ -0,0 +1,141 @@ +/*! + \file main.c + \brief ADC channel of temperature and Vref + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +float temperature; +float vref_value; + +void rcu_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* configure systick */ + systick_config(); + /* system clocks configuration */ + rcu_config(); + /* ADC configuration */ + adc_config(); + /* USART configuration */ + gd_eval_com_init(EVAL_COM1); + + while(1){ + /* ADC software trigger enable */ + adc_software_trigger_enable(ADC0, ADC_INSERTED_CHANNEL); + /* delay a time in milliseconds */ + delay_1ms(2000); + + /* value convert */ + temperature = (1.42 - ADC_IDATA0(ADC0)*3.3/4096) * 1000 / 4.3 + 25; + vref_value = (ADC_IDATA1(ADC0) * 3.3 / 4096); + + /* value print */ + printf(" the temperature data is %2.0f degrees Celsius\r\n", temperature); + printf(" the reference voltage data is %5.3fV \r\n", vref_value); + printf(" \r\n"); + } + +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable ADC clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC0); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC scan function enable */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC temperature and Vrefint enable */ + adc_tempsensor_vrefint_enable(); + + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_INSERTED_CHANNEL, 2); + + /* ADC temperature sensor channel config */ + adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_16, ADC_SAMPLETIME_239POINT5); + /* ADC internal reference voltage channel config */ + adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_17, ADC_SAMPLETIME_239POINT5); + + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_2_EXTTRIG_INSERTED_NONE); + + adc_external_trigger_config(ADC0, ADC_INSERTED_CHANNEL, ENABLE); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM1, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/readme.txt new file mode 100644 index 0000000..d894aeb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of ADC channel of temperature and vref + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use the ADC to +convert analog signal to digital data. The ADC is configured in dependent mode, inner +channel16(temperature sensor channel) and channel17(Vref channel) are chosen as analog +input pin. + + As the ADC convertion begins by software, the converted data in the ADC_IDATAx register, + where the x is 0 to 1. + + We can watch temperature and vref_value in debug mode or by COM1. + Jump JP4 to Usart1. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC0_temperature_Vref/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.c new file mode 100644 index 0000000..75e6453 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.c @@ -0,0 +1,169 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +extern int data; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles ADC0_1 exception + \param[in] none + \param[out] none + \retval none +*/ +void ADC0_1_IRQHandler(void) +{ + /* clear the ADC interrupt or status flag */ + adc_interrupt_flag_clear(ADC1, ADC_INT_FLAG_WDE); + /* turn on LED2 */ + gd_eval_led_on(LED2); + data = 1; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.h new file mode 100644 index 0000000..03bf7ad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles ADC0_1 exception */ +void ADC0_1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/main.c new file mode 100644 index 0000000..3b89756 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/main.c @@ -0,0 +1,165 @@ +/*! + \file main.c + \brief ADC analog watchdog + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + + +#define BOARD_ADC_CHANNEL ADC_CHANNEL_13 +#define ADC_GPIO_PORT GPIOC +#define ADC_GPIO_PIN GPIO_PIN_3 + +uint16_t adc_value; +int data; + +void rcu_config(void); +void gpio_config(void); +void nvic_config(void); +void adc_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + /* systick configuration */ + systick_config(); + /* GPIO configuration */ + gpio_config(); + /* NVIC configuration */ + nvic_config(); + /* ADC configuration */ + adc_config(); + + while(1){ + if(1 == data){ + /* turn off LED2 */ + data = 0; + delay_1ms(3000); + gd_eval_led_off(LED2); + } + } +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOC clock */ + rcu_periph_clock_enable(RCU_GPIOC); + /* enable ADC1 clock */ + rcu_periph_clock_enable(RCU_ADC1); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV8); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure led GPIO */ + gd_eval_led_init(LED2); + /* config the GPIO as analog mode */ + gpio_init(ADC_GPIO_PORT, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, ADC_GPIO_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable(ADC0_1_IRQn, 0, 0); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* reset ADC */ + adc_deinit(ADC1); + /* ADC mode config */ + adc_mode_config(ADC_MODE_FREE); + /* ADC contineous function enable */ + adc_special_function_config(ADC1, ADC_CONTINUOUS_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC1, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC1, ADC_REGULAR_CHANNEL, 1); + + /* ADC regular channel config */ + adc_regular_channel_config(ADC1, 0, BOARD_ADC_CHANNEL, ADC_SAMPLETIME_55POINT5); + /* ADC trigger config */ + adc_external_trigger_source_config(ADC1, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + adc_external_trigger_config(ADC1, ADC_REGULAR_CHANNEL, ENABLE); + + /* ADC analog watchdog threshold config */ + adc_watchdog_threshold_config(ADC1, 0x0400, 0x0A00); + /* ADC analog watchdog single channel config */ + adc_watchdog_single_channel_enable(ADC1, BOARD_ADC_CHANNEL); + /* ADC interrupt config */ + adc_interrupt_enable(ADC1, ADC_INT_WDE); + + /* enable ADC interface */ + adc_enable(ADC1); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC1); + + /* ADC software trigger enable */ + adc_software_trigger_enable(ADC1, ADC_REGULAR_CHANNEL); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/readme.txt new file mode 100644 index 0000000..03930ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of the ADC analog watchdog example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use the ADC analog +watchdog to guard continuously an ADC channel. The ADC is configured in continuous mode, +the ADC1 clock is configured to 27MHz. PC3 is chosen as analog input pin. + + Change the VR1 on the board, and measure TP2 pad, when the channe13 converted value is +over the programmed analog watchdog high threshold (value 0x0A00) or below the analog +watchdog low threshold(value 0x0400), an WDE interrupt will occur, and LED2 will be on. +When the channe13 converted value is in safe range(among 0x0400 and 0x0A00), the LED2 +will be off. + + The analog input pin should be configured to AIN mode. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ADC/ADC1_analog_watchdog/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/main.c new file mode 100644 index 0000000..251b97a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/main.c @@ -0,0 +1,148 @@ +/*! + \file main.c + \brief backup data register + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define BKP_DATA_REG_NUM 42 + +void led_config(void); +void write_backup_register(uint16_t data); +uint32_t check_backup_register(uint16_t data); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* led configuration and turn on all led */ + led_config(); + /* PMU lock enable */ + rcu_periph_clock_enable(RCU_PMU); + /* BKP clock enable */ + rcu_periph_clock_enable(RCU_BKPI); + /* enable write access to the registers in backup domain */ + pmu_backup_write_enable(); + /* clear the bit flag of tamper event */ + bkp_flag_clear(); + + /* check if the POR/PDR reset flag is set */ + if(RESET != rcu_flag_get(RCU_FLAG_PORRST)){ + /* clear the RCU all reset flags */ + rcu_all_reset_flag_clear(); + /* turn on LED4 */ + gd_eval_led_on(LED4); + + /* check if backup data registers has been written */ + if(0x00 == check_backup_register(0x1226)){ + /* Backup data registers values are correct */ + /* turn on LED2 */ + gd_eval_led_on(LED2); + }else{ + /* backup data registers values are not correct or they are not written*/ + /* write data to backup data registers */ + write_backup_register(0x1226); + /* turn on LED3 */ + gd_eval_led_on(LED3); + } + } + /* turn on LED5 */ + gd_eval_led_on(LED5);; + while(1){ + } +} + +/*! + \brief write data to backup DATAx registers + \param[in] data: the data to be written to backup data registers + \arg 0x0000-0xFFFF + \param[out] none + \retval none +*/ +void write_backup_register(uint16_t data) +{ + uint32_t temp = 0; + /* write data to backup registers */ + for (temp = 0; temp < BKP_DATA_REG_NUM; temp++){ + if(temp < 10){ + BKP_DATA0_9(temp) = data + (temp * 0x50); + }else{ + BKP_DATA10_41(temp) = data + (temp * 0x50); + } + } +} + +/*! + \brief check if the backup DATAx registers values are correct or not + \param[in] data: the data to be written to backup data registers + \arg 0x0000-0xFFFF + \param[out] none + \retval the number of data register +*/ +uint32_t check_backup_register(uint16_t data) +{ + uint32_t temp = 0; + /* check the data of backup registers */ + for(temp = 0; temp < BKP_DATA_REG_NUM; temp++){ + if(temp < 10){ + /* get data from data register 0-9 */ + if(data + (temp * 0x50) != BKP_DATA_GET(BKP_DATA0_9(temp))){ + return temp+1; + } + }else{ + /* get data from data register 10-41 */ + if(data + (temp * 0x50) != BKP_DATA_GET(BKP_DATA10_41(temp))){ + return temp+1; + } + } + } + return 0; +} + +/*! + \brief configure led + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/readme.txt new file mode 100644 index 0000000..4a3e1ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Backup_Data/readme.txt @@ -0,0 +1,62 @@ +/*! + \file readme.txt + \brief description of the Backup_Data demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to store user data +in the Backup data registers. + As the Backup domain still powered by VBAT when VDD is switched off, its contents +are not lost if a battery is connected to VBAT pin. When JP0 is connected to Vmcu, +the board is powered up, LED3, LED4 and LED5 are on. After an external reset, LED3 +and LED4 are off, LED5 is on. Change JP0 connected to external battery, the board is +executed a power-down and power-up operation, LED2, LED4 and LED5 are on. + + The program behaves as follows: + 1. After startup the program checks if the board has been powered up. If yes, the + values in the BKP data registers are checked: + - if a battery is connected to the VBAT pin, the values in the BKP data registers + are retained + - if no battery is connected to the VBAT pin, the values in the BKP data registers + are lost + 2. After an external reset, the BKP data registers contents are not checked. + + Four LEDs are used to show the system state as follows: + 1. LED4 on / LED2 on: a POR/PDR reset occurred and the values in the BKP data + registers are correct + 2. LED4 on / LED3 on: a POR/PDR reset occurred and the values in the BKP data + registers are not correct or they have not yet been programmed (if it is the + first time the program is executed) + 3. LED4 off / LED2 off / LED3 off: no POR/PDR reset occurred + 4. LED5 on: program running + + BT1 should have a 3.3V battery, JP0 can change the VBAT source. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.c new file mode 100644 index 0000000..d6ceb50 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.c @@ -0,0 +1,181 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" + +extern uint32_t is_backup_register_clear(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/** + * @brief This function handles Tamper interrupt request. + * @param None + * @retval None + */ +void TAMPER_IRQHandler(void) +{ + if(RESET != bkp_interrupt_flag_get()) + { + /* a tamper detection event occurred */ + /* check if backup data registers are cleared */ + if(0 == is_backup_register_clear()){ + /* backup data registers are cleared */ + /* turn on LED4 */ + gd_eval_led_on(LED4); + }else{ + /* backup data registers are not cleared */ + /* turn on LED5 */ + gd_eval_led_on(LED5); + } + /* clear the interrupt bit flag of tamper interrupt */ + bkp_interrupt_flag_clear(); + /* clear the bit flag of tamper event */ + bkp_flag_clear(); + /* disable the tamper pin */ + bkp_interrupt_disable(); + /* enable the tamper pin */ + bkp_interrupt_enable(); + /* tamper pin active level set */ + bkp_tamper_active_level_set(TAMPER_PIN_ACTIVE_LOW); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.h new file mode 100644 index 0000000..9f33dcc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); +/* TAMPER handle function */ +void TAMPER_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/main.c new file mode 100644 index 0000000..7496fd7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/main.c @@ -0,0 +1,187 @@ +/*! + \file main.c + \brief tamper demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define BKP_DATA_REG_NUM 42 + +void led_config(void); +void nvic_config(void); +void write_backup_register(uint16_t data); +uint32_t check_backup_register(uint16_t data); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* led configuration and turn on all led */ + led_config(); + /* NVIC configuration */ + nvic_config(); + /* PMU lock enable */ + rcu_periph_clock_enable(RCU_PMU); + /* BKP clock enable */ + rcu_periph_clock_enable(RCU_BKPI); + + /* enable write access to the registers in backup domain */ + pmu_backup_write_enable(); + /* tamper pin active level set */ + bkp_tamper_active_level_set(TAMPER_PIN_ACTIVE_LOW); + /* tamper detection disable */ + bkp_tamper_detection_disable(); + /* disable the tamper interrupt */ + bkp_interrupt_disable(); + /* clear the bit flag of tamper event */ + bkp_flag_clear(); + /* configure the tamper pin active on low level, and enable the tamper pin */ + bkp_interrupt_enable(); + /* tamper detection enable */ + bkp_tamper_detection_enable(); + /* write data to backup DATAx registers */ + write_backup_register(0x1226); + + /* check if the written data are correct */ + if(0x00 == check_backup_register(0x1226)){ + /* turn on LED2 */ + gd_eval_led_on(LED2); + }else{ + /* turn on LED3 */ + gd_eval_led_on(LED3); + } + while(1){ + } +} + +/*! + \brief write data to backup DATAx registers + \param[in] data: the data to be written to backup data registers + \arg 0x0000-0xFFFF + \param[out] none + \retval none +*/ +void write_backup_register(uint16_t data) +{ + uint32_t temp = 0; + /* write data to backup data registers */ + for (temp = 0; temp < BKP_DATA_REG_NUM; temp++){ + if(temp < 10){ + BKP_DATA0_9(temp) = data + (temp * 0x50); + }else{ + BKP_DATA10_41(temp) = data + (temp * 0x50); + } + } +} + +/*! + \brief check if the backup DATAx registers values are correct or not + \param[in] data: the data to be written to backup data registers + \arg 0x0000-0xFFFF + \param[out] none + \retval the number of data register +*/ +uint32_t check_backup_register(uint16_t data) +{ + uint32_t temp = 0; + /* check the data of backup data registers */ + for(temp = 0; temp < BKP_DATA_REG_NUM; temp++){ + if(temp < 10){ + /* get data from data register 0-9 */ + if(data + (temp * 0x50) != BKP_DATA_GET(BKP_DATA0_9(temp))){ + return temp+1; + } + }else{ + /* get data from data register 10-41 */ + if(data + (temp * 0x50) != BKP_DATA_GET(BKP_DATA10_41(temp))){ + return temp+1; + } + } + } + return 0; +} + +/*! + \brief configure led + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief check if the backup data registers are clear or not + \param[in] none + \param[out] none + \retval the number of data register +*/ +uint32_t is_backup_register_clear(void) +{ + uint32_t temp = 0; + + for(temp = 0; temp < BKP_DATA_REG_NUM; temp++){ + if(temp < 10){ + /* check if the data of data register 0-9 is 0x0000 */ + if(0x0000 != BKP_DATA_GET(BKP_DATA0_9(temp))){ + return temp+1; + } + }else{ + /* check if the data of data register 10-41 is 0x0000 */ + if(0x0000 != BKP_DATA_GET(BKP_DATA10_41(temp))){ + return temp+1; + } + } + } + return 0; +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(TAMPER_IRQn,0,0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/readme.txt new file mode 100644 index 0000000..d92af28 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/BKP/Tamper/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of tamper demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to write/read data +to/from backup data registers and demonstrates the tamper detection function. In +this demo, the TAMPER pin is configured active on low level. + After system start-up, it writes the data to all backup data registers, then check +whether the data were correctly written. If yes, LED2 is on, otherwise LED3 is on. +When the tamper key(TAMPER pin) is pressed, the backup data registers are reset and +the tamper interrupt is generated. In the corresponding ISR, it checks whether the +backup data registers are cleared or not. If yes, LED4 is on, otherwise LED5 is on. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.c new file mode 100644 index 0000000..2daf124 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.c @@ -0,0 +1,197 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern ErrStatus test_flag_interrupt; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles CAN0 RX1 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN0_RX1_IRQHandler(void) +{ + can_receive_message_struct g_receive_message; + /* initialize receive message */ + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &g_receive_message); + + /* check the receive message */ + can_message_receive(CAN0, CAN_FIFO1, &g_receive_message); + + if((0x1234 == g_receive_message.rx_efid) && (CAN_FF_EXTENDED == g_receive_message.rx_ff) + && (2 == g_receive_message.rx_dlen) && (0xCADE == (g_receive_message.rx_data[1]<<8|g_receive_message.rx_data[0]))){ + test_flag_interrupt = SUCCESS; + }else{ + test_flag_interrupt = ERROR; + } +} + +/*! + \brief this function handles CAN1 RX0 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN1_RX1_IRQHandler(void) +{ + can_receive_message_struct g_receive_message; + /* initialize receive message */ + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &g_receive_message); + + /* check the receive message */ + can_message_receive(CAN1, CAN_FIFO1, &g_receive_message); + + if((0x1234 == g_receive_message.rx_efid) && (CAN_FF_EXTENDED == g_receive_message.rx_ff) + && (2 == g_receive_message.rx_dlen) && (0xCADE == (g_receive_message.rx_data[1]<<8|g_receive_message.rx_data[0]))){ + test_flag_interrupt = SUCCESS; + }else{ + test_flag_interrupt = ERROR; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.h new file mode 100644 index 0000000..4fe834d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_it.h @@ -0,0 +1,64 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* CAN0 RX0 handle function */ +void CAN0_RX0_IRQHandler(void); +/* CAN1 RX0 handle function */ +void CAN1_RX0_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/main.c new file mode 100644 index 0000000..c9c3279 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/main.c @@ -0,0 +1,310 @@ +/*! + \file main.c + \brief communication_Loopback in normal mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* select CAN */ +#define CAN0_USED +//#define CAN1_USED + +#ifdef CAN0_USED + #define CANX CAN0 +#else + #define CANX CAN1 +#endif + +#define DEV_CAN_POLLING_ID 0x0AA +#define DEV_CAN_INTERRUPT_ID 0x1234 + +volatile ErrStatus test_flag; +volatile ErrStatus test_flag_interrupt; + +void nvic_config(void); +void led_config(void); +ErrStatus can_loopback(void); +ErrStatus can_loopback_interrupt(void); +void can_loopback_init(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* enable CAN clock */ + rcu_periph_clock_enable(RCU_CAN0); + rcu_periph_clock_enable(RCU_CAN1); + + /* configure NVIC */ + nvic_config(); + + /* configure leds */ + led_config(); + /* set all the leds off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + /* loopback of polling */ + test_flag = can_loopback(); + + if(SUCCESS == test_flag){ + /* loopback test is success */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + }else{ + /* loopback test is failed */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + /* loopback of interrupt */ + test_flag_interrupt = can_loopback_interrupt(); + + if(SUCCESS == test_flag_interrupt){ + /* interrupt loopback test is success */ + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + }else{ + /* interrupt loopback test is failed */ + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + } + while (1); +} + +/*! + \brief function for CAN loopback communication + \param[in] none + \param[out] none + \retval ErrStatus +*/ +ErrStatus can_loopback(void) +{ + can_trasnmit_message_struct g_transmit_message; + can_receive_message_struct g_receive_message; + uint32_t timeout = 0xFFFF; + uint8_t transmit_mailbox = 0; + /* initialize CAN */ + can_loopback_init(); + + /* initialize transmit message */ + can_struct_para_init(CAN_TX_MESSAGE_STRUCT, &g_transmit_message); + g_transmit_message.tx_sfid = DEV_CAN_POLLING_ID; + g_transmit_message.tx_ft = CAN_FT_DATA; + g_transmit_message.tx_ff = CAN_FF_STANDARD; + g_transmit_message.tx_dlen = 2; + g_transmit_message.tx_data[0] = 0xAB; + g_transmit_message.tx_data[1] = 0xCD; + + /* initialize receive message */ + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &g_receive_message); + + /* transmit message */ + transmit_mailbox = can_message_transmit(CANX, &g_transmit_message); + /* waiting for transmit completed */ + while((CAN_TRANSMIT_OK != can_transmit_states(CANX, transmit_mailbox)) && (0 != timeout)){ + timeout--; + } + timeout = 0xFFFF; + /* waiting for receive completed */ + while((can_receive_message_length_get(CANX, CAN_FIFO1) < 1) && (0 != timeout)){ + timeout--; + } + + /* initialize receive message*/ + g_receive_message.rx_sfid = 0x00; + g_receive_message.rx_ff = 0; + g_receive_message.rx_dlen = 0; + g_receive_message.rx_data[0] = 0x00; + g_receive_message.rx_data[1] = 0x00; + can_message_receive(CANX, CAN_FIFO1, &g_receive_message); + + /* check the receive message */ + if((DEV_CAN_POLLING_ID == g_receive_message.rx_sfid) && (CAN_FF_STANDARD == g_receive_message.rx_ff) + && (2 == g_receive_message.rx_dlen) && (0xCDAB == (g_receive_message.rx_data[1]<<8|g_receive_message.rx_data[0]))){ + return SUCCESS; + }else{ + return ERROR; + } +} + +/*! + \brief function for CAN loopback interrupt communication + \param[in] none + \param[out] none + \retval ErrStatus +*/ +ErrStatus can_loopback_interrupt(void) +{ + can_trasnmit_message_struct g_transmit_message; + uint32_t timeout = 0x0000FFFF; + + /* initialize CAN and filter */ + can_loopback_init(); + + /* enable CAN receive FIFO1 not empty interrupt */ + can_interrupt_enable(CANX, CAN_INT_RFNE1); + + /* initialize transmit message */ + g_transmit_message.tx_sfid = 0; + g_transmit_message.tx_efid = DEV_CAN_INTERRUPT_ID; + g_transmit_message.tx_ff = CAN_FF_EXTENDED; + g_transmit_message.tx_ft = CAN_FT_DATA; + g_transmit_message.tx_dlen = 2; + g_transmit_message.tx_data[0] = 0xDE; + g_transmit_message.tx_data[1] = 0xCA; + /* transmit a message */ + can_message_transmit(CANX, &g_transmit_message); + + /* waiting for receive completed */ + while((SUCCESS != test_flag_interrupt) && (0 != timeout)){ + timeout--; + } + if(0 == timeout){ + test_flag_interrupt = ERROR; + } + + /* disable CAN receive FIFO1 not empty interrupt */ + can_interrupt_disable(CANX, CAN_INTEN_RFNEIE1); + + return test_flag_interrupt; +} + +/*! + \brief initialize CAN and filter + \param[in] can_parameter + \arg can_parameter_struct + \param[in] can_filter + \arg can_filter_parameter_struct + \param[out] none + \retval none +*/ +void can_loopback_init(void) +{ + can_parameter_struct can_parameter; + can_filter_parameter_struct can_filter; + + can_struct_para_init(CAN_INIT_STRUCT, &can_parameter); + can_struct_para_init(CAN_FILTER_STRUCT, &can_filter); + + /* initialize CAN register */ + can_deinit(CANX); + + /* initialize CAN */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = DISABLE; + can_parameter.rec_fifo_overwrite = DISABLE; + can_parameter.trans_fifo_order = DISABLE; + can_parameter.working_mode = CAN_LOOPBACK_MODE; + /* configure baudrate to 125kbps */ + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_5TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_3TQ; + can_parameter.prescaler = 48; + can_init(CANX, &can_parameter); + + /* initialize filter */ +#ifdef CAN0_USED + /* CAN0 filter number */ + can_filter.filter_number = 0; +#else + /* CAN1 filter number */ + can_filter.filter_number = 14; +#endif + /* initialize filter */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + can_filter.filter_list_high = (uint16_t)(DEV_CAN_POLLING_ID << 5); + can_filter.filter_list_low = 0x0000U; + /* ID and standard frame matched */ + can_filter.filter_mask_high = (uint16_t)(0x7FF << 5); + can_filter.filter_mask_low = (uint16_t)(1U << 2); + can_filter.filter_fifo_number = CAN_FIFO1; + can_filter.filter_enable=ENABLE; + can_filter_init(&can_filter); + + /* initialize filter */ +#ifdef CAN0_USED + /* CAN0 filter number */ + can_filter.filter_number = 1; +#else + /* CAN1 filter number */ + can_filter.filter_number = 15; +#endif + /* initialize filter */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + /* ID and extend frame matched */ + can_filter.filter_list_high = (uint16_t)(DEV_CAN_INTERRUPT_ID >> 13); + can_filter.filter_list_low = (uint16_t)(((uint16_t)DEV_CAN_INTERRUPT_ID << 3) | (1U << 2)); + can_filter.filter_mask_high = (uint16_t)(0x1FFFFFFF >> 13); + can_filter.filter_mask_low = (uint16_t)(((uint16_t)0x1FFFFFFF << 3) | (1U << 2)); + can_filter.filter_fifo_number = CAN_FIFO1; + can_filter.filter_enable=ENABLE; + can_filter_init(&can_filter); +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* configure CAN0 NVIC */ + nvic_irq_enable(CAN0_RX1_IRQn,0,0); + /* configure CAN1 NVIC */ + nvic_irq_enable(CAN1_RX1_IRQn,0,0); +} + +/*! + \brief configure the leds + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/readme.txt new file mode 100644 index 0000000..751f98c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_Loopback/readme.txt @@ -0,0 +1,47 @@ +/*! + \file readme.txt + \brief description of the communication_Loopback demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to set a communication +with the CAN in loopback mode. + + The example first performs a transmission and a reception of a standard data frame +by polling at 125 Kbps.If the received frame is successful, the LED2 and LED3 are on. +Otherwise,the LED2 and LED3 are off. Then, an extended data frame is transmitted at +125 Kbps. Reception is done in the interrupt handler when the message becomes pending +in the FIFO1. If the received frame is successful, the LED4 and LED5 are on. Otherwise, +the LED4 and LED5 are off. + + User can select CAN0 or CAN1 cell using the private defines in main.c. + + P2,P3 and P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.c new file mode 100644 index 0000000..becc0aa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.c @@ -0,0 +1,190 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern can_receive_message_struct g_receive_message; +extern FlagStatus can0_receive_flag; +extern FlagStatus can1_receive_flag; +extern FlagStatus can0_error_flag; +extern FlagStatus can1_error_flag; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles CAN0 RX0 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN0_RX0_IRQHandler(void) +{ + /* check the receive message */ + can_message_receive(CAN0, CAN_FIFO0, &g_receive_message); + + if((0x7ab == g_receive_message.rx_sfid)&&(CAN_FF_STANDARD == g_receive_message.rx_ff)&&(8 == g_receive_message.rx_dlen)){ + can0_receive_flag = SET; + }else{ + can0_error_flag = SET; + } +} +/*! + \brief this function handles CAN1 RX0 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN1_RX0_IRQHandler(void) +{ + /* check the receive message */ + can_message_receive(CAN1, CAN_FIFO0, &g_receive_message); + + if((0x7ab == g_receive_message.rx_sfid)&&(CAN_FF_STANDARD == g_receive_message.rx_ff)&&(8 == g_receive_message.rx_dlen)){ + can1_receive_flag = SET; + }else{ + can1_error_flag = SET; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.h new file mode 100644 index 0000000..4fe834d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_it.h @@ -0,0 +1,64 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* CAN0 RX0 handle function */ +void CAN0_RX0_IRQHandler(void); +/* CAN1 RX0 handle function */ +void CAN1_RX0_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/main.c new file mode 100644 index 0000000..b31b5a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/main.c @@ -0,0 +1,323 @@ +/*! + \file main.c + \brief communication_among_CANS in normal mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* select CAN baudrate */ +/* 1MBps */ +#define CAN_BAUDRATE 1000 +/* 500kBps */ +/* #define CAN_BAUDRATE 500 */ +/* 250kBps */ +/* #define CAN_BAUDRATE 250 */ +/* 125kBps */ +/* #define CAN_BAUDRATE 125 */ +/* 100kBps */ +/* #define CAN_BAUDRATE 100 */ +/* 50kBps */ +/* #define CAN_BAUDRATE 50 */ +/* 20kBps */ +/* #define CAN_BAUDRATE 20 */ + +FlagStatus can0_receive_flag; +FlagStatus can1_receive_flag; +FlagStatus can0_error_flag; +FlagStatus can1_error_flag; +can_parameter_struct can_init_parameter; +can_filter_parameter_struct can_filter_parameter; +can_trasnmit_message_struct g_transmit_message; +can_receive_message_struct g_receive_message; + +void nvic_config(void); +void led_config(void); +void can_gpio_config(void); +void can_config(can_parameter_struct can_parameter, can_filter_parameter_struct can_filter); + +/*! + \brief initialize CAN and filter + \param[in] can_parameter + \arg can_parameter_struct + \param[in] can_filter + \arg can_filter_parameter_struct + \param[out] none + \retval none +*/ +void can_config(can_parameter_struct can_parameter, can_filter_parameter_struct can_filter) +{ + can_struct_para_init(CAN_INIT_STRUCT, &can_parameter); + can_struct_para_init(CAN_INIT_STRUCT, &can_filter); + /* initialize CAN register */ + can_deinit(CAN0); + can_deinit(CAN1); + + /* initialize CAN parameters */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = DISABLE; + can_parameter.rec_fifo_overwrite = DISABLE; + can_parameter.trans_fifo_order = DISABLE; + can_parameter.working_mode = CAN_NORMAL_MODE; + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_5TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_3TQ; + + /* 1MBps */ +#if CAN_BAUDRATE == 1000 + can_parameter.prescaler = 6; + /* 500KBps */ +#elif CAN_BAUDRATE == 500 + can_parameter.prescaler = 12; + /* 250KBps */ +#elif CAN_BAUDRATE == 250 + can_parameter.prescaler = 24; + /* 125KBps */ +#elif CAN_BAUDRATE == 125 + can_parameter.prescaler = 48; + /* 100KBps */ +#elif CAN_BAUDRATE == 100 + can_parameter.prescaler = 60; + /* 50KBps */ +#elif CAN_BAUDRATE == 50 + can_parameter.prescaler = 120; + /* 20KBps */ +#elif CAN_BAUDRATE == 20 + can_parameter.prescaler = 300; +#else + #error "please select list can baudrate in private defines in main.c " +#endif + /* initialize CAN */ + can_init(CAN0, &can_parameter); + can_init(CAN1, &can_parameter); + + /* initialize filter */ + can_filter.filter_number=0; + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + can_filter.filter_list_high = 0x3000; + can_filter.filter_list_low = 0x0000; + can_filter.filter_mask_high = 0x3000; + can_filter.filter_mask_low = 0x0000; + can_filter.filter_fifo_number = CAN_FIFO0; + can_filter.filter_enable = ENABLE; + + can_filter_init(&can_filter); + + /* CAN1 filter number */ + can_filter.filter_number = 15; + can_filter_init(&can_filter); +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* configure CAN0 NVIC */ + nvic_irq_enable(CAN0_RX0_IRQn,0,0); + + /* configure CAN1 NVIC */ + nvic_irq_enable(CAN1_RX0_IRQn,1,1); +} + +/*! + \brief configure the leds + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief configure GPIO + \param[in] none + \param[out] none + \retval none +*/ +void can_gpio_config(void) +{ + /* enable CAN clock */ + rcu_periph_clock_enable(RCU_CAN0); + rcu_periph_clock_enable(RCU_CAN1); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_AF); + + /* configure CAN0 GPIO */ + gpio_init(GPIOD,GPIO_MODE_IPU,GPIO_OSPEED_50MHZ,GPIO_PIN_0); + gpio_init(GPIOD,GPIO_MODE_AF_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_1); + gpio_pin_remap_config(GPIO_CAN0_FULL_REMAP,ENABLE); + + /* configure CAN1 GPIO */ + gpio_init(GPIOB,GPIO_MODE_IPU,GPIO_OSPEED_50MHZ,GPIO_PIN_5); + gpio_init(GPIOB,GPIO_MODE_AF_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_6); + gpio_pin_remap_config(GPIO_CAN1_REMAP,ENABLE); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i = 0U; + + can0_receive_flag = RESET; + can1_receive_flag = RESET; + can0_error_flag = RESET; + can1_error_flag = RESET; + + /* configure GPIO */ + can_gpio_config(); + + /* configure NVIC */ + nvic_config(); + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + /* configure Wakeup key or Tamper key */ + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO); + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + printf("\r\nGD32F10x dual CAN test, please press Wakeup key or Tamper key to start communication!\r\n"); + /* configure leds */ + led_config(); + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + + /* initialize CAN and filter */ + can_config(can_init_parameter, can_filter_parameter); + /* enable can receive FIFO0 not empty interrupt */ + can_interrupt_enable(CAN0, CAN_INT_RFNE0); + can_interrupt_enable(CAN1, CAN_INT_RFNE0); + + /* initialize transmit message */ + g_transmit_message.tx_sfid = 0x7ab; + g_transmit_message.tx_efid = 0x00; + g_transmit_message.tx_ft = CAN_FT_DATA; + g_transmit_message.tx_ff = CAN_FF_STANDARD; + g_transmit_message.tx_dlen = 8; + + g_transmit_message.tx_data[0] = 0xA0U; + g_transmit_message.tx_data[1] = 0xA1U; + g_transmit_message.tx_data[2] = 0xA2U; + g_transmit_message.tx_data[3] = 0xA3U; + g_transmit_message.tx_data[4] = 0xA4U; + g_transmit_message.tx_data[5] = 0xA5U; + g_transmit_message.tx_data[6] = 0xA6U; + g_transmit_message.tx_data[7] = 0xA7U; + + while(1){ + /* test whether the Tamper key is pressed */ + if(0 == gd_eval_key_state_get(KEY_TAMPER)){ + g_transmit_message.tx_data[0] = 0x55; + g_transmit_message.tx_data[1] = 0xAA; + + printf("\r\n can0 transmit data:"); + for(i = 0; i < g_transmit_message.tx_dlen; i++){ + printf(" %02x", g_transmit_message.tx_data[i]); + } + /* transmit message */ + can_message_transmit(CAN0, &g_transmit_message); + /* waiting for the Tamper key up */ + while(0 == gd_eval_key_state_get(KEY_TAMPER)); + } + /* test whether the Wakeup key is pressed */ + if(0 == gd_eval_key_state_get(KEY_WAKEUP)){ + g_transmit_message.tx_data[0] = 0xAA; + g_transmit_message.tx_data[1] = 0x55; + printf("\r\n can1 transmit data:"); + for(i = 0; i < g_transmit_message.tx_dlen; i++){ + printf(" %02x", g_transmit_message.tx_data[i]); + } + /* transmit message */ + can_message_transmit(CAN1, &g_transmit_message); + /* waiting for the Wakeup key up */ + while(0 == gd_eval_key_state_get(KEY_WAKEUP)); + } + /* CAN0 receive data correctly, the received data is printed */ + if(SET == can0_receive_flag){ + can0_receive_flag = RESET; + printf("\r\n can0 receive data:"); + for(i = 0; i < g_receive_message.rx_dlen; i++){ + printf(" %02x", g_receive_message.rx_data[i]); + } + + gd_eval_led_toggle(LED4); + } + /* CAN1 receive data correctly, the received data is printed */ + if(SET == can1_receive_flag){ + can1_receive_flag = RESET; + gd_eval_led_toggle(LED5); + printf("\r\n can1 receive data:"); + for(i = 0; i < g_receive_message.rx_dlen; i++){ + printf(" %02x", g_receive_message.rx_data[i]); + } + } + /* CAN0 error */ + if(SET == can0_error_flag){ + can0_error_flag = RESET; + printf("\r\n can0 communication error"); + } + /* CAN1 error */ + if(SET == can1_error_flag){ + can1_error_flag = RESET; + printf("\r\n can1 communication error"); + } + } +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/readme.txt new file mode 100644 index 0000000..b94e733 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_CANs/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief description of the communication_among_CANS demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +CAN0 and CAN1 peripherals to send and receive CAN frames in normal mode. Pressing +Wakeup key or Tamper key: + + When Tamper key is pressed, CAN0 sends a message to CAN1 and print it.when CAN1 +receives correctly this message,the receive data will be printedand LED5 toggles +one time. + + When Wakeup key is pressed, CAN1 sends a message to CAN0 and print it. When CAN0 +receives correctly this message,the receive data will be printed and LED4 toggles +one time. + + User can select one from the preconfigured CAN baud rates from the private +defines in main.c. These baudrates is correct only when the system clock frequency +is 108M. + + P2,P3 and P4 must be fitted. + Connect JP14 CAN_L to JP15 CAN_L + Connect JP14 CAN_H to JP15 CAN_H diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.c new file mode 100644 index 0000000..7d45318 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.c @@ -0,0 +1,182 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern FlagStatus receive_flag; +extern can_receive_message_struct g_receive_message; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles CAN0 RX0 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN0_RX1_IRQHandler(void) +{ + /* check the receive message */ + can_message_receive(CAN0, CAN_FIFO1, &g_receive_message); + if((0xaabb == g_receive_message.rx_efid)&&(CAN_FF_EXTENDED == g_receive_message.rx_ff) && (8 == g_receive_message.rx_dlen)){ + receive_flag = SET; + } +} + +/*! + \brief this function handles CAN1 RX0 exception + \param[in] none + \param[out] none + \retval none +*/ +void CAN1_RX1_IRQHandler(void) +{ + /* check the receive message */ + can_message_receive(CAN1, CAN_FIFO1, &g_receive_message); + if((0xaabb == g_receive_message.rx_efid)&&(CAN_FF_EXTENDED == g_receive_message.rx_ff) && (8 == g_receive_message.rx_dlen)){ + receive_flag = SET; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.h new file mode 100644 index 0000000..4fe834d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_it.h @@ -0,0 +1,64 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* CAN0 RX0 handle function */ +void CAN0_RX0_IRQHandler(void); +/* CAN1 RX0 handle function */ +void CAN1_RX0_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/main.c new file mode 100644 index 0000000..7829ab7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/main.c @@ -0,0 +1,291 @@ +/*! + \file main.c + \brief communication_among_Devices in normal mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* select can */ +#define CAN0_USED +//#define CAN1_USED + +#ifdef CAN0_USED + #define CANX CAN0 +#else + #define CANX CAN1 +#endif + +FlagStatus receive_flag; +uint8_t transmit_number = 0x0; +can_trasnmit_message_struct g_transmit_message; +can_receive_message_struct g_receive_message; + +void nvic_config(void); +void led_config(void); +void gpio_config(void); +ErrStatus can_networking(void); +void can_networking_init(void); +void delay(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i = 0; + uint32_t timeout = 0xFFFF; + uint8_t transmit_mailbox = 0; + + receive_flag = RESET; + /* configure Tamper key */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + /* configure GPIO */ + gpio_config(); + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + /* configure NVIC */ + nvic_config(); + /* configure leds */ + led_config(); + /* set all leds off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + /* initialize CAN */ + can_networking_init(); + + /* enable CAN receive FIFO1 not empty interrupt */ + can_interrupt_enable(CANX, CAN_INT_RFNE1); + + /* initialize transmit message */ + can_struct_para_init(CAN_TX_MESSAGE_STRUCT, &g_transmit_message); + g_transmit_message.tx_sfid = 0x00; + g_transmit_message.tx_efid = 0xaabb; + g_transmit_message.tx_ft = CAN_FT_DATA; + g_transmit_message.tx_ff = CAN_FF_EXTENDED; + g_transmit_message.tx_dlen = 8; + + g_transmit_message.tx_data[0] = 0xA0U; + g_transmit_message.tx_data[1] = 0xA1U; + g_transmit_message.tx_data[2] = 0xA2U; + g_transmit_message.tx_data[3] = 0xA3U; + g_transmit_message.tx_data[4] = 0xA4U; + g_transmit_message.tx_data[5] = 0xA5U; + g_transmit_message.tx_data[6] = 0xA6U; + g_transmit_message.tx_data[7] = 0xA7U; + + printf("please press the Tamper key to transmit data!\r\n"); + + /* initialize receive message */ + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &g_receive_message); + + while(1) { + /* waiting for the Tamper key pressed */ + while(0 == gd_eval_key_state_get(KEY_TAMPER)){ + /* if transmit_number is 0x10, set it to 0x00 */ + if(transmit_number == 0x10){ + transmit_number = 0x00; + }else{ + g_transmit_message.tx_data[0] = transmit_number++; + printf("\r\n can transmit data:"); + for(i = 0; i < g_transmit_message.tx_dlen; i++){ + printf(" %02x", g_transmit_message.tx_data[i]); + } + /* transmit message */ + transmit_mailbox = can_message_transmit(CANX, &g_transmit_message); + /* waiting for transmit completed */ + timeout = 0xFFFF; + while((CAN_TRANSMIT_OK != can_transmit_states(CANX, transmit_mailbox)) && (0 != timeout)){ + timeout--; + } + /* waiting for Tamper key up */ + while(0 == gd_eval_key_state_get(KEY_TAMPER)); + } + } + if(SET == receive_flag) { + gd_eval_led_toggle(LED2); + receive_flag = RESET; + printf("\r\n receive data:"); + for(i = 0; i < g_receive_message.rx_dlen; i++){ + printf(" %02x", g_receive_message.rx_data[i]); + } + } + } +} + +/*! + \brief initialize CAN and filter + \param[in] can_parameter + \arg can_parameter_struct + \param[in] can_filter + \arg can_filter_parameter_struct + \param[out] none + \retval none +*/ +void can_networking_init(void) +{ + can_parameter_struct can_parameter; + can_filter_parameter_struct can_filter; + + can_struct_para_init(CAN_INIT_STRUCT, &can_parameter); + can_struct_para_init(CAN_FILTER_STRUCT, &can_filter); + + /* initialize CAN register */ + can_deinit(CANX); + + /* initialize CAN */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = DISABLE; + can_parameter.rec_fifo_overwrite = DISABLE; + can_parameter.trans_fifo_order = DISABLE; + can_parameter.working_mode = CAN_NORMAL_MODE; + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_5TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_3TQ; + /* baudrate 1Mbps */ + can_parameter.prescaler = 6; + can_init(CANX, &can_parameter); + + /* initialize filter */ +#ifdef CAN0_USED + /* CAN0 filter number */ + can_filter.filter_number = 0; +#else + /* CAN1 filter number */ + can_filter.filter_number = 15; +#endif + /* initialize filter */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + can_filter.filter_list_high = 0x0000U; + can_filter.filter_list_low = 0x0000U; + can_filter.filter_mask_high = 0x0000U; + can_filter.filter_mask_low = 0x0000U; + can_filter.filter_fifo_number = CAN_FIFO1; + can_filter.filter_enable = ENABLE; + can_filter_init(&can_filter); +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ +#ifdef CAN0_USED + /* configure CAN0 NVIC */ + nvic_irq_enable(CAN0_RX1_IRQn,0,0); +#else + /* configure CAN1 NVIC */ + nvic_irq_enable(CAN1_RX1_IRQn,0,0); +#endif + +} + +/*! + \brief delay + \param[in] none + \param[out] none + \retval none +*/ +void delay(void) +{ + uint16_t nTime = 0x0000; + + for(nTime = 0; nTime < 0xFFFF; nTime++){ + } +} + +/*! + \brief configure the leds + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief configure GPIO + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* enable CAN clock */ + rcu_periph_clock_enable(RCU_CAN0); + +#ifdef GD32F10X_CL + rcu_periph_clock_enable(RCU_CAN1); + rcu_periph_clock_enable(RCU_GPIOB); +#endif + + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_AF); + + /* configure CAN0 GPIO */ + gpio_init(GPIOD,GPIO_MODE_IPU,GPIO_OSPEED_50MHZ,GPIO_PIN_0); + gpio_init(GPIOD,GPIO_MODE_AF_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_1); + gpio_pin_remap_config(GPIO_CAN0_FULL_REMAP,ENABLE); + +#ifdef GD32F10X_CL + /* configure CAN1 GPIO */ + gpio_init(GPIOB,GPIO_MODE_IPU,GPIO_OSPEED_50MHZ,GPIO_PIN_5); + gpio_init(GPIOB,GPIO_MODE_AF_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_6); + gpio_pin_remap_config(GPIO_CAN1_REMAP,ENABLE); +#endif +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)) { + } + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/readme.txt new file mode 100644 index 0000000..2504aad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CAN/communication_among_Devices/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of the communication_among_Devices demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the CAN +peripheral to send and receive CAN frames in normal mode.The frames are sent and print +transmit data by pressing Tamper Key. When the frames are received, the receive data +will be printed and the LED2 will toggle. + + This example is tested with at least two GD32107C-EVAL boards. The same program example +is loaded in all boards and connect CAN_L and CAN_H pin of CAN0 or CAN1 to bus for sending +and receiving frames. + + User can select CAN0 or CAN1 cell using the private defines in main.c. + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/main.c new file mode 100644 index 0000000..b14f4ce --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/main.c @@ -0,0 +1,73 @@ +/*! + \file main.c + \brief CRC calculate demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +uint32_t val = 0, valcrc1 = 0, valcrc2 = 0; +uint32_t val_data[] = {0x11223344, 0x55667788, 0x99aabbcc, 0xddeeffff}; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + val = (uint32_t)0xabcd1234; + + /* initialize the LED2 and LED3, turn off them */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + rcu_periph_clock_enable(RCU_CRC); + + /* reset the CRC data register and calculate the CRC of the value */ + crc_data_register_reset(); + valcrc1 = crc_single_data_calculate(val); + + /* reset the CRC data register and calculate the CRC of the value group */ + crc_data_register_reset(); + valcrc2 = crc_block_data_calculate(val_data, sizeof(val_data)/sizeof(val_data[0])); + + if(0xf7018a40 == valcrc1 && 0x85A317CB == valcrc2){ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/readme.txt new file mode 100644 index 0000000..49ef21f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/CRC/CRC_calculate/readme.txt @@ -0,0 +1,38 @@ +/*! + \file readme.txt + \brief description of CRC example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C board, it shows how to use CRC to +calculate the CRC value. + In this demo, 1 CRC value and a value group are calculated for a 32-bit data, If +the result is success, turn on the LED2 and LED3. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/main.c new file mode 100644 index 0000000..154fd26 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/main.c @@ -0,0 +1,187 @@ +/*! + \file main.c + \brief DAC concurrent mode independent trigger with different LFSR demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure TIMER peripheral */ +void timer5_config(void); +void timer6_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure TIMER peripheral */ + timer5_config(); + timer6_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable TIMER clock */ + rcu_periph_clock_enable(RCU_TIMER5); + rcu_periph_clock_enable(RCU_TIMER6); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 and PA5 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_T5_TRGO); + dac_trigger_source_config(DAC0, DAC_OUT1, DAC_TRIGGER_T6_TRGO); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + dac_trigger_enable(DAC0, DAC_OUT1); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT0, DAC_LFSR_BITS9_0); + dac_wave_mode_config(DAC0, DAC_OUT1, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT1, DAC_LFSR_BITS10_0); + + /* DAC enable */ + dac_concurrent_enable(DAC0); + dac_concurrent_data_set(DAC0, DAC_ALIGN_12B_R, 0x7F0, 0x7F0); +} + +/*! + \brief configure TIMER5 peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer5_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER5); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER5, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER5, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER5); +} + +/*! + \brief configure TIMER6 peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer6_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER6); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER6, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER6, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER6); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/readme.txt new file mode 100644 index 0000000..9c594e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_independent_trigger_LFSR_noise/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of DACC_independent_trigger_LFSR_noise example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC concurrent +mode to generate LFSR noise wave with different trigger signal TIMER5 and TIMER6. + + TIMER5 and TIMER6 are configured as following: + - Up counting mode. + - System clock devide into 1Mhz. + - Update event per millisecond. + - Update event as TRGO to trigger DAC0_OUT0/DAC0_OUT1. + DAC is configured as following: + - Data 12-bit right alligned. + - TIMER5/TIMER6 TRGO signal trigger DAC0_OUT0/DAC0_OUT1. + - DAC0_OUT0/DAC0_OUT1 is configured as PA4/PA5. + - LFSR mode, with 0-9/0-10 bit masking and offset value 0x7f0. + + After system start-up, the LFSR noise wave can be observed through the scilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/main.c new file mode 100644 index 0000000..9e9e33c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/main.c @@ -0,0 +1,109 @@ +/*! + \file main.c + \brief DAC concurrent mode output voltage demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 and PA5 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger disable */ + dac_trigger_disable(DAC0, DAC_OUT0); + dac_trigger_disable(DAC0, DAC_OUT1); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_DISABLE); + dac_wave_mode_config(DAC0, DAC_OUT1, DAC_WAVE_DISABLE); + + /* DAC enable */ + dac_concurrent_enable(DAC0); + dac_concurrent_data_set(DAC0, DAC_ALIGN_12B_L, 0x7FF0, 0x1FF0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/readme.txt new file mode 100644 index 0000000..a414a21 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_output_voltage/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of DACC_output_voltage example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC concurrent +mode to output voltage. + + DAC is configured as following: + - Data 12-bit left alligned. + - DAC0_OUT0/DAC0_OUT1 is configured as PA4/PA5. + + After system start-up, VREF/2(PA4) and VREF/8(PA5) can be observed through the scilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/main.c new file mode 100644 index 0000000..5c0c478 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/main.c @@ -0,0 +1,152 @@ +/*! + \file main.c + \brief DAC concurrent mode simultaneous trigger with same triangle wave demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure TIMER peripheral */ +void timer5_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure TIMER peripheral */ + timer5_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable TIMER clock */ + rcu_periph_clock_enable(RCU_TIMER5); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 and PA5 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_T5_TRGO); + dac_trigger_source_config(DAC0, DAC_OUT1, DAC_TRIGGER_T5_TRGO); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + dac_trigger_enable(DAC0, DAC_OUT1); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_MODE_TRIANGLE); + dac_triangle_noise_config(DAC0, DAC_OUT0, DAC_TRIANGLE_AMPLITUDE_1023); + dac_wave_mode_config(DAC0, DAC_OUT1, DAC_WAVE_MODE_TRIANGLE); + dac_triangle_noise_config(DAC0, DAC_OUT1, DAC_TRIANGLE_AMPLITUDE_1023); + + /* DAC enable */ + dac_concurrent_enable(DAC0); + dac_concurrent_data_set(DAC0, DAC_ALIGN_12B_R, 0x7F0, 0x1F0); +} + +/*! + \brief configure TIMER5 peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer5_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER5); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER5, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER5, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/readme.txt new file mode 100644 index 0000000..7758d2e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_simultaneous_trigger_triangle_noise/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of DACC_simultaneous_trigger_triangle_noise example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC concurrent +mode simultaneous trigger to generate triangle noise wave with same amplitude. + + TIMER5 is configured as following: + - Up counting mode. + - System clock devide into 1Mhz. + - Update event per millisecond. + - Update event as TRGO to trigger DAC0_OUT0 and DAC0_OUT1. + DAC is configured as following: + - Data 12-bit right alligned. + - TIMER5 TRGO signal trigger DAC0_OUT0 and DAC0_OUT1. + - DAC0_OUT0/DAC0_OUT1 is configured as PA4/PA5. + - Triangle mode, with amplitude 1023. + + After system start-up, the triangle noise wave can be observed through the scilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/main.c new file mode 100644 index 0000000..0a0588a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/main.c @@ -0,0 +1,115 @@ +/*! + \file main.c + \brief DAC concurrent mode software trigger LFSR noise wave demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + + while(1) { + /* DAC software trigger enable */ + dac_concurrent_software_trigger_enable(DAC0); + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable the clock of peripherals */ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_DAC); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 and PA5 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_SOFTWARE); + dac_trigger_source_config(DAC0, DAC_OUT1, DAC_TRIGGER_SOFTWARE); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + dac_trigger_enable(DAC0, DAC_OUT1); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT0, DAC_LFSR_BITS9_0); + dac_wave_mode_config(DAC0, DAC_OUT1, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT1, DAC_LFSR_BITS10_0); + + /* DAC enable */ + dac_concurrent_enable(DAC0); + dac_concurrent_data_set(DAC0, DAC_ALIGN_12B_R, 0x7F0, 0x7F0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/readme.txt new file mode 100644 index 0000000..4c73e25 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DACC_software_trigger_LFSR_noise/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of DACC_software_trigger_LFSR_noise example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC concurrent +mode software trigger to generate LFSR noise wave with different configurations. + + DAC is configured as following: + - Data 12-bit right alligned. + - Software trigger DAC0_OUT0 and DAC0_OUT1. + - DAC0_OUT0/DAC0_OUT1 is configured as PA4/PA5. + - LFSR mode, with 0-9/0-10 bit masking and offset value 0x7f0. + + After system start-up, the LFSR noise wave can be observed through the scilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.c new file mode 100644 index 0000000..b200446 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.c @@ -0,0 +1,173 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles ADC exception + \param[in] none + \param[out] none + \retval none +*/ +void ADC0_1_IRQHandler(void) +{ + uint16_t adc_value; + + if(adc_interrupt_flag_get(ADC0, ADC_INT_FLAG_EOC)) { + /* clear ADC interrupt flag */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOC); + /* read the ADC data */ + adc_value = adc_regular_data_read(ADC0); + /* set DAC output data */ + dac_data_set(DAC0, DAC_OUT0, DAC_ALIGN_12B_R, adc_value); + /* enable DAC software trigger */ + dac_software_trigger_enable(DAC0, DAC_OUT0); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.h new file mode 100644 index 0000000..97904a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles ADC exception */ +void ADC0_1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/main.c new file mode 100644 index 0000000..eacf86a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/main.c @@ -0,0 +1,176 @@ +/*! + \file main.c + \brief DAC ADC convert demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure NVIC peripheral */ +void nvic_config(void); +/* configure ADC peripheral */ +void adc_config(void); +/* configure DAC peripheral */ +void dac_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure NVIC peripheral */ + nvic_config(); + /* configure ADC peripheral */ + adc_config(); + /* configure DAC peripheral */ + dac_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable GPIOC clock */ + rcu_periph_clock_enable(RCU_GPIOC); + /* enable ADC clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); +} + +/*! + \brief configure GPIO periphera + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PC3 as ADC input */ + gpio_init(GPIOC, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_3); + + /* configure PA4 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4); +} + +/*! + \brief configure NVIC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable(ADC0_1_IRQn, 0, 0); +} + +/*! + \brief configure ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) +{ + /* ADC continuous function enable */ + adc_special_function_config(ADC0, ADC_CONTINUOUS_MODE, ENABLE); + /* ADC data alignment config */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* ADC channel length config */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 1); + /* ADC regular channel config */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_13, ADC_SAMPLETIME_55POINT5); + /* ADC external trigger enable */ + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + /* ADC trigger config */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, ADC0_1_2_EXTTRIG_REGULAR_NONE); + + /* enable ADC interface */ + adc_enable(ADC0); + delay_1ms(1); + /* ADC calibration and reset calibration */ + adc_calibration_enable(ADC0); + + /* ADC interrupt enable */ + adc_interrupt_flag_clear(ADC0, ADC_INT_FLAG_EOC); + adc_interrupt_enable(ADC0, ADC_INT_EOC); + + /* enable ADC software trigger */ + adc_software_trigger_enable(ADC0, ADC_REGULAR_CHANNEL); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_SOFTWARE); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_DISABLE); + /* DAC output buffer config */ + dac_output_buffer_enable(DAC0, DAC_OUT0); + + /* DAC enable */ + dac_enable(DAC0, DAC_OUT0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/readme.txt new file mode 100644 index 0000000..9de0c9e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of DAC_ADC_convert example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC0_OUT0 to generate +a signal from ADC. In the ADC interrupt, ADC data transfer from ADC_RDATA to DAC_OUT0_R12DH. + + ADC is configured as following: + - Continuous mode. + - Data right alligned. + - Software trigger. + - Regular group/Rountine sequence converts channel 13(PC3). + DAC is configured as following: + - Data 12-bit right alligned. + - Output buffer enabled. + - Software trigger. + - DAC0_OUT0 is configured as PA4. + + After system start-up, the signal can be observed through the oscilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.h new file mode 100644 index 0000000..c8d57db --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_ADC_convert/systick.h @@ -0,0 +1,48 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* function declarations */ +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/main.c new file mode 100644 index 0000000..4ef9fc5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/main.c @@ -0,0 +1,189 @@ +/*! + \file main.c + \brief DAC DMA convert demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#define CONVERT_NUM (10) +#define DAC0_R8DH_ADDRESS (0x40007410) +const uint8_t convertarr[CONVERT_NUM] = {0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF, 0xCC, 0x99, 0x66, 0x33}; + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DMA peripheral */ +void dma_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure TIMER peripheral */ +void timer5_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DMA peripheral */ + dma_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure TIMER peripheral */ + timer5_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA1); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable TIMER clock */ + rcu_periph_clock_enable(RCU_TIMER5); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4); +} + +/*! + \brief configure DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + dma_parameter_struct dma_struct; + /* clear all the interrupt flags */ + dma_flag_clear(DMA1, DMA_CH2, DMA_INTF_GIF); + dma_flag_clear(DMA1, DMA_CH2, DMA_INTF_FTFIF); + dma_flag_clear(DMA1, DMA_CH2, DMA_INTF_HTFIF); + dma_flag_clear(DMA1, DMA_CH2, DMA_INTF_ERRIF); + + /* configure the DMA1 channel 2 */ + dma_struct.periph_addr = DAC0_R8DH_ADDRESS; + dma_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_struct.memory_addr = (uint32_t)convertarr; + dma_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_struct.number = CONVERT_NUM; + dma_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init(DMA1, DMA_CH2, &dma_struct); + + dma_circulation_enable(DMA1, DMA_CH2); + dma_channel_enable(DMA1, DMA_CH2); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_T5_TRGO); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_DISABLE); + + /* DAC enable */ + dac_enable(DAC0, DAC_OUT0); + /* DAC DMA function enable */ + dac_dma_enable(DAC0, DAC_OUT0); +} + +/*! + \brief configure TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer5_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER5); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER5, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER5, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/readme.txt new file mode 100644 index 0000000..fce992e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_DMA_convert/readme.txt @@ -0,0 +1,54 @@ +/*! + \file readme.txt + \brief description of DAC_DMA_convert example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC0 to generate +a staircase-shaped signal. + + TIMER5 is configured as following: + - Up counting mode. + - System clock devide into 1Mhz. + - Update event per millisecond. + - Update event as TRGO to trigger DAC. + DMA is configured as following: + - Data from memory to peripheral. + - Memory address increase enable. + - 8-bit data width, 10 data length. + - Circular mode enable. + DAC is configured as following: + - Data 8-bit right alligned. + - TIMER5 TRGO signal trigger. + - DMA function enable. + - DAC0_OUT0 is configured as PA4. + + After system start-up, the signal can be observed through the oscilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/main.c new file mode 100644 index 0000000..d1bc340 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/main.c @@ -0,0 +1,135 @@ +/*! + \file main.c + \brief DAC EXTI trigger demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure EXTI line */ +void exti_line9_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure EXTI line */ + exti_line9_config(); + + while (1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable AFIO clock */ + rcu_periph_clock_enable(RCU_AF); +} + +/*! + \brief configure GPIO periphera + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4); + + /* configure PA9 as EXTI input */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_9); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_EXTI_9); + /* DAC trigger enable */ + dac_trigger_enable(DAC0,DAC_OUT0); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT0, DAC_LFSR_BITS11_0); + + /* DAC enable */ + dac_enable(DAC0,DAC_OUT0); + dac_data_set(DAC0, DAC_OUT0, DAC_ALIGN_12B_R, 0); +} + +/*! + \brief configure EXTI line + \param[in] none + \param[out] none + \retval none +*/ +void exti_line9_config(void) +{ + /* connect key EXTI line to key GPIO pin */ + gpio_exti_source_select(GPIO_PORT_SOURCE_GPIOA, GPIO_PIN_SOURCE_9); + + /* configure key EXTI line */ + exti_init(EXTI_9, EXTI_EVENT, EXTI_TRIG_RISING); + exti_flag_clear(EXTI_9); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/readme.txt new file mode 100644 index 0000000..9552265 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_EXTI_trigger/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of DAC_EXTI_trigger example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use EXTI line 9 +to trigger DAC. + + EXTI is configured as following: + - EXTI9 line connecting to PA9. + - Event mode. + - Rising edge trigger. + DAC is configured as following: + - Data 12-bit right alligned. + - EXTI9 trigger. + - LFSR mode with unmask bits 0-11. + - DAC0_OUT0 is configured as PA4. + + After system start-up, Connect Wakeup key (PA0) and PA9 with Dupont line. Press the key, +the variations of the wave can be observed through the oscilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/main.c new file mode 100644 index 0000000..133b917 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/main.c @@ -0,0 +1,148 @@ +/*! + \file main.c + \brief DAC LFSR noise mode demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure TIMER peripheral */ +void timer5_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure TIMER peripheral */ + timer5_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable TIMER clock */ + rcu_periph_clock_enable(RCU_TIMER5); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA4 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_4); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT0, DAC_TRIGGER_T5_TRGO); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT0); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT0, DAC_WAVE_MODE_LFSR); + dac_lfsr_noise_config(DAC0, DAC_OUT0, DAC_LFSR_BITS10_0); + + /* DAC enable */ + dac_enable(DAC0, DAC_OUT0); + dac_data_set(DAC0, DAC_OUT0, DAC_ALIGN_12B_R, 0x7F0); +} + +/*! + \brief configure TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer5_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER5); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER5, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER5, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/readme.txt new file mode 100644 index 0000000..2a6303a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_LFSR_noise_mode/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of DAC_LFSR_noise_mode example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC to generate +LFSR noise wave. + + TIMER5 is configured as following: + - Up counting mode. + - System clock devide into 1Mhz. + - Update event per millisecond. + - Update event as TRGO to trigger DAC. + DAC is configured as following: + - Data 12-bit right alligned. + - TIMER5 TRGO signal trigger DAC0_OUT0. + - DAC0_OUT0 is configured as PA4. + - LFSR mode, with 0-11 bit masking and offset value 0x7f0. + + After system start-up, the LFSR noise wave can be observed through the oscilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/main.c new file mode 100644 index 0000000..b3c9a68 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/main.c @@ -0,0 +1,148 @@ +/*! + \file main.c + \brief DAC triangle noise mode demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* configure RCU peripheral */ +void rcu_config(void); +/* configure GPIO peripheral */ +void gpio_config(void); +/* configure DAC peripheral */ +void dac_config(void); +/* configure TIMER peripheral */ +void timer5_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure RCU peripheral */ + rcu_config(); + /* configure GPIO peripheral */ + gpio_config(); + /* configure DAC peripheral */ + dac_config(); + /* configure TIMER peripheral */ + timer5_config(); + + while(1) { + } +} + +/*! + \brief configure RCU peripheral + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable DAC clock */ + rcu_periph_clock_enable(RCU_DAC); + /* enable TIMER clock */ + rcu_periph_clock_enable(RCU_TIMER5); +} + +/*! + \brief configure GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure PA5 as DAC output */ + gpio_init(GPIOA, GPIO_MODE_AIN, GPIO_OSPEED_50MHZ, GPIO_PIN_5); +} + +/*! + \brief configure DAC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dac_config(void) +{ + /* initialize DAC */ + dac_deinit(DAC0); + /* DAC trigger config */ + dac_trigger_source_config(DAC0, DAC_OUT1, DAC_TRIGGER_T5_TRGO); + /* DAC trigger enable */ + dac_trigger_enable(DAC0, DAC_OUT1); + /* DAC wave mode config */ + dac_wave_mode_config(DAC0, DAC_OUT1, DAC_WAVE_MODE_TRIANGLE); + dac_triangle_noise_config(DAC0, DAC_OUT1, DAC_TRIANGLE_AMPLITUDE_2047); + + /* DAC enable */ + dac_enable(DAC0, DAC_OUT1); + dac_data_set(DAC0, DAC_OUT1, DAC_ALIGN_12B_R, 0x7F0); +} + +/*! + \brief configure TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer5_config(void) +{ + timer_parameter_struct timer_initpara; + + /* TIMER deinitialize */ + timer_deinit(TIMER5); + + /* TIMER configuration */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + + /* initialize TIMER init parameter struct */ + timer_init(TIMER5, &timer_initpara); + + /* TIMER master mode output trigger source: Update event */ + timer_master_output_trigger_source_select(TIMER5, TIMER_TRI_OUT_SRC_UPDATE); + + /* enable TIMER */ + timer_enable(TIMER5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/readme.txt new file mode 100644 index 0000000..fce9f36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DAC/DAC_triangle_noise_mode/readme.txt @@ -0,0 +1,50 @@ +/*! + \file readme.txt + \brief description of DAC_triangle_noise_mode example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use DAC to generate +triangle noise wave. + + TIMER5 is configured as following: + - Up counting mode. + - System clock devide into 1Mhz. + - Update event per millisecond. + - Update event as TRGO to trigger DAC. + DAC is configured as following: + - Data 12-bit right alligned. + - TIMER5 TRGO signal trigger. + - DAC0_OUT1 is configured as PA5. + - Triangle mode with offset value 0x7f0 and amplitude 2047. + + After system start-up, the triangle noise wave can be observed through the oscilloscope. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.c new file mode 100644 index 0000000..5320a58 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/main.c new file mode 100644 index 0000000..abeb530 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/main.c @@ -0,0 +1,138 @@ +/*! + \file main.c + \brief debug timer1 when the mcu is in debug mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +void gpio_configuration(void); +void timer_configuration(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + dbg_periph_disable(DBG_TIMER1_HOLD); + + gpio_configuration(); + gd_eval_led_init(LED2); + systick_config(); + timer_configuration(); + + /* keep TIMER1 counter when the mcu is in debug mode */ + dbg_periph_enable(DBG_TIMER1_HOLD); + + while (1){ + /* toggle LED2 output status every second */ + gd_eval_led_toggle(LED2); + /* you can set breakpoint here, then look over the register in TIMER1 */ + delay_1ms(1000); + } +} + +/*! + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_configuration(void) +{ + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(RCU_GPIOB); + gpio_pin_remap_config(GPIO_TIMER1_FULL_REMAP, ENABLE); + /* configure PB3/PB10/PB11(TIMER1 CH1/CH2/CH3) as alternate function */ + gpio_init(GPIOB,GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3| GPIO_PIN_10| GPIO_PIN_11); +} + +/*! + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer_configuration(void) +{ + + /* TIMER1 configuration: generate 3 PWM signals with 3 different duty cycles: + TIMER1CLK = SystemCoreClock / 108 = 1MHz + TIMER1 channel 1 duty cycle = 4000/ 16000 = 25% + TIMER1 channel 2 duty cycle = 8000/ 16000 = 50% + TIMER1 channel 3 duty cycle = 12000/ 16000 = 75% */ + + timer_parameter_struct timer_initpara; + timer_oc_parameter_struct timer_ocintpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + /* TIMER1 configuration */ + timer_deinit(TIMER1); + /* TIMER1 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 15999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH1, CH2 and CH3 configuration in PWM mode */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_channel_output_config(TIMER1,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_2,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_3,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_1,4000); + timer_channel_output_mode_config(TIMER1,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_2,8000); + timer_channel_output_mode_config(TIMER1,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_3,12000); + timer_channel_output_mode_config(TIMER1,TIMER_CH_3,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_3,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); + timer_enable(TIMER1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/readme.txt new file mode 100644 index 0000000..170c11d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/readme.txt @@ -0,0 +1,54 @@ +/*! + \file readme.txt + \brief description of the DBG demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows that, when the +TIMER1_HOLD bit in DBG control register(DBG_CTL) is set and the core halted, the TIMER1 +counter stop counting and the PWM outputs of all channels are stopped as well. It's benefit +for debuging. + + The TIMER1 counter clock used is 1MHz. +The Three Duty cycles are computed as the following description: +The channel 1 duty cycle is set to 25%. +The channel 2 duty cycle is set to 50%. +The channel 3 duty cycle is set to 75%. + + Connect the TIMER1 pins to an oscilloscope and monitor the different waveforms: +- TIMER1_CH1 pin (PB3) +- TIMER1_CH2 pin (PB10) +- TIMER1_CH3 pin (PB11) + + For Keil or IAR, in debug mode, when the core is stopped, update the register window for TIMER1, +you will see that the count value will not change. And at the same time, the PWM outputs of +all the channels of TIMER1 will be stopped. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DBG/Timer1_stop/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.c new file mode 100644 index 0000000..4d9063a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.c @@ -0,0 +1,166 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" + +extern __IO uint32_t g_dmacomplete_flag; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles DMA0_Channel0_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void DMA0_Channel0_IRQHandler(void) +{ + if(dma_interrupt_flag_get(DMA0, DMA_CH0, DMA_INT_FLAG_FTF)){ + g_dmacomplete_flag = 1; + dma_interrupt_flag_clear(DMA0, DMA_CH0, DMA_INT_FLAG_G); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.h new file mode 100644 index 0000000..940318b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* DMA0_Channel0 handle function */ +void DMA0_Channel0_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/main.c new file mode 100644 index 0000000..8fdf5ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/main.c @@ -0,0 +1,228 @@ +/*! + \file main.c + \brief transfer data from FLASH to RAM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define TRANSFER_NUM 0x400 /* configuration value in bytes */ +#define FMC_PAGE_SIZE ((uint16_t)0x800) +#define BANK0_WRITE_START_ADDR ((uint32_t)0x08004000) + +void rcu_config(void); +void nvic_config(void); +void led_config(void); + +__IO uint32_t g_dmacomplete_flag = 0; +uint8_t g_destbuf[TRANSFER_NUM]; +const uint32_t transdata = 0x3210ABCD; +fmc_state_enum fmcstatus = FMC_READY; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint32_t i, count; + uint32_t *ptrd; + uint32_t address = 0x00; + ErrStatus access_flag = SUCCESS; + dma_parameter_struct dma_init_struct; + uint32_t wperror = 0; + + /* system clocks configuration */ + rcu_config(); + /* NVIC configuration */ + nvic_config(); + /* LED configuration */ + led_config() ; + /* unlock the flash bank1 program erase controller */ + fmc_unlock(); + + /* define the number of page to be erased */ + count = TRANSFER_NUM / FMC_PAGE_SIZE; + /* clear all pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + /* erase the flash pages */ + for(i = 0; i <= count; i++){ + fmcstatus = fmc_page_erase(BANK0_WRITE_START_ADDR + (FMC_PAGE_SIZE * i)); + wperror += (fmcstatus == FMC_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + } + + if(wperror != 0){ + while(1); + } + + /* unlock the flash bank1 program erase controller */ + fmc_lock(); + + ptrd = (uint32_t*)BANK0_WRITE_START_ADDR; + count = TRANSFER_NUM / sizeof(*ptrd); + + for(i = 0; i < count; i++){ + if(0xFFFFFFFF != *ptrd){ + access_flag = ERROR; + break; + } + ptrd++; + } + + if(ERROR == access_flag){ + while(1); + } + + /* unlock the flash bank1 program erase controller */ + fmc_unlock(); + /* clear all pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + /* program flash bank1 */ + address = BANK0_WRITE_START_ADDR; + wperror = 0; + count = BANK0_WRITE_START_ADDR + TRANSFER_NUM; + + while(address < count){ + fmcstatus = fmc_word_program(address, transdata); + address = address + 4; + wperror += (FMC_WPERR == fmcstatus); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + } + + if(wperror != 0){ + while(1); + } + + fmc_lock(); + + memset(g_destbuf ,0 ,TRANSFER_NUM); + + /* DMA0 channel0 initialize */ + dma_deinit(DMA0, DMA_CH0); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)g_destbuf; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = TRANSFER_NUM; + dma_init_struct.periph_addr = (uint32_t)BANK0_WRITE_START_ADDR; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_ENABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH0, &dma_init_struct); + /* DMA0 channel0 mode configuration */ + dma_circulation_disable(DMA0, DMA_CH0); + dma_memory_to_memory_enable(DMA0, DMA_CH0); + /* DMA0 channel0 interrupt configuration */ + dma_interrupt_enable(DMA0, DMA_CH0, DMA_INT_FTF); + /* enable DMA0 transfer */ + dma_channel_enable(DMA0, DMA_CH0); + + /* wait DMA interrupt */ + while(0 == g_dmacomplete_flag); + + /* compare destdata with transdata */ + ptrd = (uint32_t *)g_destbuf; + count = TRANSFER_NUM / sizeof(*ptrd); + + for(i = 0; i < count; i++){ + if(transdata != *ptrd){ + access_flag = ERROR; + break; + } + ptrd++; + } + + /* transfer sucess */ + if(access_flag != ERROR){ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + }else{ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + } + + while(1){ + } +} + +/*! + \brief configure LED + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + /* LED off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); +} + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(DMA0_Channel0_IRQn,0,0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/readme.txt new file mode 100644 index 0000000..b99d7a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Flash_to_ram/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the DMA flash to ram example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it provides a description of how to +use DMA0 channel0 to transfer data buffer from FLASH memory to embedded SRAM memory. + + Before programming the flash addresses, an erase operation is performed firstly. +After the erase operation, a comparison between FLASH memory and 0xFFFFFFFF(Reset value) +is done to check that the FLASH memory has been correctly erased. + + Once the erase operation is finished correctly, the programming operation will be +performed by using the fmc_word_program function. The written data is transfered to +embedded SRAM memory by DMA0 Channel0. The transfer is started by enabling the DMA0 Channel0. +At the end of the transfer, a Transfer Complete interrupt is generated since it +is enabled. A comparison between the FLASH memory and embedded SRAM memory is done to +check that all data have been correctly transferred.If the result of comparison is passed, +LED2 to LED5 light up. Otherwise LED2 and LED4 light up. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/main.c new file mode 100644 index 0000000..dbb460f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/main.c @@ -0,0 +1,199 @@ +/*! + \file main.c + \brief transfer data from RAM to RAM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include + +#define DATANUM 16 + +__IO ErrStatus transferflag1 = ERROR; +__IO ErrStatus transferflag2 = ERROR; +__IO ErrStatus transferflag3 = ERROR; +__IO ErrStatus transferflag4 = ERROR; +uint8_t source_address[DATANUM]= {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, + 0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10}; +uint8_t destination_address1[DATANUM]; +uint8_t destination_address2[DATANUM]; +uint8_t destination_address3[DATANUM]; +uint8_t destination_address4[DATANUM]; + +void destbuf_init(void); +void led_config(void); +ErrStatus uc_data_compare(uint8_t* src, uint8_t* dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + int i = 0; + dma_parameter_struct dma_init_struct; + + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* initialize LED */ + led_config(); + /* all LED off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + + destbuf_init(); + /* initialize DMA channel1 */ + dma_deinit(DMA0, DMA_CH1); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)destination_address1; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = DATANUM; + dma_init_struct.periph_addr = (uint32_t)source_address; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_ENABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH1, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH1); + dma_memory_to_memory_enable(DMA0, DMA_CH1); + + /* initialize DMA channel2 */ + dma_deinit(DMA0, DMA_CH2); + dma_init_struct.memory_addr = (uint32_t)destination_address2; + dma_init(DMA0, DMA_CH2, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH2); + dma_memory_to_memory_enable(DMA0, DMA_CH2); + + /* initialize DMA channel3 */ + dma_deinit(DMA0, DMA_CH3); + dma_init_struct.memory_addr = (uint32_t)destination_address3; + dma_init(DMA0, DMA_CH3, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH3); + dma_memory_to_memory_enable(DMA0, DMA_CH3); + + /* initialize DMA channel4 */ + dma_deinit(DMA0, DMA_CH4); + dma_init_struct.memory_addr = (uint32_t)destination_address4; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH4); + dma_memory_to_memory_enable(DMA0, DMA_CH4); + + /* enable DMA channel1~channel4 */ + dma_channel_enable(DMA0, DMA_CH1); + dma_channel_enable(DMA0, DMA_CH2); + dma_channel_enable(DMA0, DMA_CH3); + dma_channel_enable(DMA0, DMA_CH4); + + /* wait for DMA transfer complete */ + for(i = 0; i < 200; i++){ + } + /* compare the data of source_address with data of destination_address */ + transferflag1 = uc_data_compare(source_address, destination_address1, DATANUM); + transferflag2 = uc_data_compare(source_address, destination_address2, DATANUM); + transferflag3 = uc_data_compare(source_address, destination_address3, DATANUM); + transferflag4 = uc_data_compare(source_address, destination_address4, DATANUM); + + /* if DMA channel1 transfer success,light LED2 */ + if(SUCCESS == transferflag1){ + gd_eval_led_on(LED2); + } + /* if DMA channel2 transfer success,light LED3 */ + if(SUCCESS == transferflag2){ + gd_eval_led_on(LED3); + } + /* if DMA channel3 transfer success,light LED4 */ + if(SUCCESS == transferflag3){ + gd_eval_led_on(LED4); + } + /* if DMA channel4 transfer success,light LED5 */ + if(SUCCESS == transferflag4){ + gd_eval_led_on(LED5); + } + + while (1); +} + +/*! + \brief initialize destination buffer + \param[in] none + \param[out] none + \retval none +*/ +void destbuf_init(void) +{ + memset(destination_address1, 0, DATANUM); + memset(destination_address2, 0, DATANUM); + memset(destination_address3, 0, DATANUM); + memset(destination_address4, 0, DATANUM); +} + +/*! + \brief LEDs configure + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief data compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus uc_data_compare(uint8_t* src, uint8_t* dst, uint16_t length) +{ + while (length--){ + if (*src++ != *dst++){ + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/readme.txt new file mode 100644 index 0000000..29c5e94 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_ram/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of DMA ram to ram + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it provides a description +of how to use DMA channel(1 to 4) to transfer data from RAM to RAM.DMA Channel(1 to 4) is +configured to transfer the contents of data buffer stored in "source_address" to the +reception buffer declared in RAM(destination_address1~destination_address4). + + The start of transfer is triggered by software. At the end of the transfer, a comparison +between the source and destination buffers is done to check that all data have been correctly +transferred.If transfer correctly the corresponding LED light.If transfer not correctly,the +corresponding LED is off. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.c new file mode 100644 index 0000000..d706f8b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.c @@ -0,0 +1,165 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern volatile FlagStatus g_transfer_complete; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles DMA_Channel3_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void DMA0_Channel3_IRQHandler(void) +{ + if(dma_interrupt_flag_get(DMA0, DMA_CH3, DMA_INT_FLAG_FTF)){ + dma_interrupt_flag_clear(DMA0, DMA_CH3, DMA_INT_FLAG_G); + g_transfer_complete = SET; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.h new file mode 100644 index 0000000..940318b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* DMA0_Channel0 handle function */ +void DMA0_Channel0_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/main.c new file mode 100644 index 0000000..934cdc4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/main.c @@ -0,0 +1,124 @@ +/*! + \file main.c + \brief transfer data from RAM to USART + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define ARRAYNUM(arr_name) (uint32_t)(sizeof(arr_name) / sizeof(*(arr_name))) + +uint8_t welcome[]="hi,this is a example: RAM_TO_USART by DMA !\n"; +volatile FlagStatus g_transfer_complete = RESET; + +void led_config(void); +void nvic_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + dma_parameter_struct dma_init_struct; + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* USART configure */ + gd_eval_com_init(EVAL_COM0); + /*configure DMA interrupt*/ + nvic_config(); + /* initialize LED */ + led_config(); + /* turn LED2 off */ + gd_eval_led_off(LED2); + + /* initialize DMA channel3 */ + dma_deinit(DMA0, DMA_CH3); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)welcome; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = ARRAYNUM(welcome); + dma_init_struct.periph_addr = (uint32_t)(&USART_DATA(USART0)); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH3, &dma_init_struct); + + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH3); + dma_memory_to_memory_disable(DMA0, DMA_CH3); + + /* USART DMA enable for transmission */ + usart_dma_transmit_config(USART0, USART_TRANSMIT_DMA_ENABLE); + + /* enable DMA transfer complete interrupt */ + dma_interrupt_enable(DMA0, DMA_CH3, DMA_INT_FTF); + + /* enable DMA channel3 */ + dma_channel_enable(DMA0, DMA_CH3); + + /* waiting for the transfer to complete*/ + while(RESET == g_transfer_complete){ + } + + /* light LED2 */ + gd_eval_led_on(LED2); + + while (1); +} + +/*! + \brief LED2 configuration + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init (LED2); +} + +/*! + \brief configure DMA interrupt + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(DMA0_Channel3_IRQn, 0, 0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/readme.txt new file mode 100644 index 0000000..51c9c38 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Ram_to_usart/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of DMA ram to usart + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it provides a description +of how to use DMA channel3 to transfer data from RAM memory to USART0 transmit data +register.The start of transfer is triggered by software. At the end of the transfer, a +transfer complete interrupt is generated since it is enabled. If the DMA transfer +operation is finished correctly, data stored array welcome[] will be transfered +to a serial port tool by USART0 and LED2 light up. + JP5 must be jumpped to USART0. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.c new file mode 100644 index 0000000..9f44867 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.c @@ -0,0 +1,176 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "main.h" +#include "gd32f10x_eval.h" + +extern uint8_t welcome[50]; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DMA_Channel3_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void DMA0_Channel3_IRQHandler(void) +{ + if(dma_interrupt_flag_get(DMA0, DMA_CH3, DMA_INT_FLAG_FTF)){ + dma_interrupt_flag_clear(DMA0, DMA_CH3, DMA_INT_FLAG_G); + gd_eval_led_toggle(LED2); + } +} + +/*! + \brief this function handles EXTI10_15_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler(void) +{ + if(RESET != exti_interrupt_flag_get(EXTI_14)){ + /* disable DMA channel3 */ + dma_channel_disable(DMA0, DMA_CH3); + /* reconfigure transfer number for the next DMA transfer */ + dma_transfer_number_config(DMA0, DMA_CH3, ARRAYNUM(welcome)); + /* enable DMA channel3 */ + dma_channel_enable(DMA0, DMA_CH3); + exti_interrupt_flag_clear(EXTI_14); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.h new file mode 100644 index 0000000..6802e98 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles DMA_Channel3_IRQHandler interrupt */ +void DMA0_Channel3_IRQHandler(void); +/* this function handles EXTI10_15_IRQHandler interrupt */ +void EXTI10_15_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_libopt.h new file mode 100644 index 0000000..1727d82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.c new file mode 100644 index 0000000..4b3811e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.c @@ -0,0 +1,118 @@ +/*! + \file main.c + \brief DMA reload transfer number by EXTI interrupt in discontinuous mode demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "main.h" + +uint8_t welcome[50]="hi, this is a example: RAM_TO_USART by DMA!\n"; + +void led_config(void); +void nvic_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + dma_parameter_struct dma_init_struct; + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* USART configure */ + gd_eval_com_init(EVAL_COM0); + /* configure DMA interrupt */ + nvic_config(); + /* initialize LED */ + led_config(); + /* turn LED2 off */ + gd_eval_led_off(LED2); + /* configure USER key */ + gd_eval_key_init(KEY_USER, KEY_MODE_EXTI); + + /* initialize DMA channel3 */ + dma_deinit(DMA0, DMA_CH3); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)welcome; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = ARRAYNUM(welcome); + dma_init_struct.periph_addr = (uint32_t)(&USART_DATA(USART0)); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH3, &dma_init_struct); + + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH3); + dma_memory_to_memory_disable(DMA0, DMA_CH3); + + /* USART DMA enable for transmission */ + usart_dma_transmit_config(USART0, USART_TRANSMIT_DMA_ENABLE); + + /* enable DMA transfer complete interrupt */ + dma_interrupt_enable(DMA0, DMA_CH3, DMA_INT_FTF); + + /* enable DMA channel3 */ + dma_channel_enable(DMA0, DMA_CH3); + + while(1){ + } +} + +/*! + \brief LED2 configuration + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); +} + +/*! + \brief configure DMA interrupt + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(DMA0_Channel3_IRQn, 0, 0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.h new file mode 100644 index 0000000..e7a69f2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/main.h @@ -0,0 +1,42 @@ +/*! + \file main.h + \brief the header file of the main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +#include "gd32f10x.h" + +#define ARRAYNUM(arr_name) (uint32_t)(sizeof(arr_name) / sizeof(*(arr_name))) + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/readme.txt new file mode 100644 index 0000000..0e664a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/DMA/Reload_exti/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of DMA reload transfer number by EXTI interrupt in discontinuous mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it provides a description +of how to reconfigure the DMA transfer number in discontinuous mode, when use DMA +channel3 to transfer data from RAM memory to USART0 transmit data register.The start +of transfer is triggered by software. If the DMA transfer operation is finished +correctly, data stored array welcome[] will be transfered to a serial port tool +by USART0 and LED2 toggles. When the USER key is pressed, the DMA transfer number is +reconfigured and DMA transmission is restarted. + JP5 must be jumped to USART0. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvopt new file mode 100644 index 0000000..d2c379d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvopt @@ -0,0 +1,1057 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + GD32F10X_CL + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + JL2CM3 + -U20080643 -O2127 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC5000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0100000 + + + 0 + DLGTARM + (1010=77,100,443,650,0)(1007=105,140,282,408,0)(1008=105,727,471,956,0)(1009=120,156,354,697,0) + + + 0 + ARMDBGFLAGS + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + + 0 + 1 + aa + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + + + 0 + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_enet_eval.c + gd32f10x_enet_eval.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\hello_gigadevice.c + hello_gigadevice.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\netconf.c + netconf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + Peripherals + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + gd32f10x_wwdgt.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + gd32f10x_sdio.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + gd32f10x_rtc.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + gd32f10x_fwdgt.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + gd32f10x_enet.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + gd32f10x_dbg.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + gd32f10x_dac.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + gd32f10x_crc.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + gd32f10x_can.c + 0 + 0 + + + 3 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + gd32f10x_bkp.c + 0 + 0 + + + 3 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + gd32f10x_adc.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 4 + 30 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + LwIP-Port + 0 + 0 + 0 + 0 + + 5 + 31 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\port\GD32F10x\Basic\ethernetif.c + ethernetif.c + 0 + 0 + + + + + LwIP + 0 + 0 + 0 + 0 + + 6 + 32 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\api_lib.c + api_lib.c + 0 + 0 + + + 6 + 33 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\api_msg.c + api_msg.c + 0 + 0 + + + 6 + 34 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\err.c + err.c + 0 + 0 + + + 6 + 35 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\netbuf.c + netbuf.c + 0 + 0 + + + 6 + 36 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\netdb.c + netdb.c + 0 + 0 + + + 6 + 37 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\netifapi.c + netifapi.c + 0 + 0 + + + 6 + 38 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\sockets.c + sockets.c + 0 + 0 + + + 6 + 39 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\api\tcpip.c + tcpip.c + 0 + 0 + + + 6 + 40 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\def.c + def.c + 0 + 0 + + + 6 + 41 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\dns.c + dns.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\inet_chksum.c + inet_chksum.c + 0 + 0 + + + 6 + 43 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\init.c + init.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ip.c + ip.c + 0 + 0 + + + 6 + 45 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\mem.c + mem.c + 0 + 0 + + + 6 + 46 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\memp.c + memp.c + 0 + 0 + + + 6 + 47 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\netif.c + netif.c + 0 + 0 + + + 6 + 48 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\pbuf.c + pbuf.c + 0 + 0 + + + 6 + 49 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\raw.c + raw.c + 0 + 0 + + + 6 + 50 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\stats.c + stats.c + 0 + 0 + + + 6 + 51 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\sys.c + sys.c + 0 + 0 + + + 6 + 52 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\tcp.c + tcp.c + 0 + 0 + + + 6 + 53 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\tcp_in.c + tcp_in.c + 0 + 0 + + + 6 + 54 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\tcp_out.c + tcp_out.c + 0 + 0 + + + 6 + 55 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\timeouts.c + timeouts.c + 0 + 0 + + + 6 + 56 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\udp.c + udp.c + 0 + 0 + + + 6 + 57 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\autoip.c + autoip.c + 0 + 0 + + + 6 + 58 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\dhcp.c + dhcp.c + 0 + 0 + + + 6 + 59 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\etharp.c + etharp.c + 0 + 0 + + + 6 + 60 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\icmp.c + icmp.c + 0 + 0 + + + 6 + 61 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\igmp.c + igmp.c + 0 + 0 + + + 6 + 62 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\ip4.c + ip4.c + 0 + 0 + + + 6 + 63 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\ip4_addr.c + ip4_addr.c + 0 + 0 + + + 6 + 64 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\core\ipv4\ip4_frag.c + ip4_frag.c + 0 + 0 + + + 6 + 65 + 1 + 0 + 0 + 0 + ..\lwip-2.0.2\src\netif\ethernet.c + ethernet.c + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + doc + 0 + 0 + 0 + 0 + + 8 + 67 + 5 + 0 + 0 + 0 + ..\src\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvproj new file mode 100644 index 0000000..21f3b38 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/MDK-ARM/Project.uvproj @@ -0,0 +1,793 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + GD32F10X_CL + 0x4 + ARM-ADS + 5060061::V5.06 update 1 (build 61)::ARMCC + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\output\ + Project + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + CMSIS + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + + + USE_STDPERIPH_DRIVER,GD32F10X_CL + + ..\inc;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\CMSIS;..\..\..\..\Utilities;..\lwip-2.0.2\src\include;..\lwip-2.0.2\port\GD32F10x\Basic;..\lwip-2.0.2\port\GD32F10x + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application + + + gd32f10x_enet_eval.c + 1 + ..\src\gd32f10x_enet_eval.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + hello_gigadevice.c + 1 + ..\src\hello_gigadevice.c + + + main.c + 1 + ..\src\main.c + + + netconf.c + 1 + ..\src\netconf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\system_gd32f10x.c + + + + + Peripherals + + + gd32f10x_wwdgt.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + gd32f10x_sdio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + + + gd32f10x_rtc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_fwdgt.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_enet.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_dbg.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + + + gd32f10x_dac.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + + + gd32f10x_crc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + + + gd32f10x_can.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + + + gd32f10x_bkp.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + + + gd32f10x_adc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + LwIP-Port + + + ethernetif.c + 1 + ..\lwip-2.0.2\port\GD32F10x\Basic\ethernetif.c + + + + + LwIP + + + api_lib.c + 1 + ..\lwip-2.0.2\src\api\api_lib.c + + + api_msg.c + 1 + ..\lwip-2.0.2\src\api\api_msg.c + + + err.c + 1 + ..\lwip-2.0.2\src\api\err.c + + + netbuf.c + 1 + ..\lwip-2.0.2\src\api\netbuf.c + + + netdb.c + 1 + ..\lwip-2.0.2\src\api\netdb.c + + + netifapi.c + 1 + ..\lwip-2.0.2\src\api\netifapi.c + + + sockets.c + 1 + ..\lwip-2.0.2\src\api\sockets.c + + + tcpip.c + 1 + ..\lwip-2.0.2\src\api\tcpip.c + + + def.c + 1 + ..\lwip-2.0.2\src\core\def.c + + + dns.c + 1 + ..\lwip-2.0.2\src\core\dns.c + + + inet_chksum.c + 1 + ..\lwip-2.0.2\src\core\inet_chksum.c + + + init.c + 1 + ..\lwip-2.0.2\src\core\init.c + + + ip.c + 1 + ..\lwip-2.0.2\src\core\ip.c + + + mem.c + 1 + ..\lwip-2.0.2\src\core\mem.c + + + memp.c + 1 + ..\lwip-2.0.2\src\core\memp.c + + + netif.c + 1 + ..\lwip-2.0.2\src\core\netif.c + + + pbuf.c + 1 + ..\lwip-2.0.2\src\core\pbuf.c + + + raw.c + 1 + ..\lwip-2.0.2\src\core\raw.c + + + stats.c + 1 + ..\lwip-2.0.2\src\core\stats.c + + + sys.c + 1 + ..\lwip-2.0.2\src\core\sys.c + + + tcp.c + 1 + ..\lwip-2.0.2\src\core\tcp.c + + + tcp_in.c + 1 + ..\lwip-2.0.2\src\core\tcp_in.c + + + tcp_out.c + 1 + ..\lwip-2.0.2\src\core\tcp_out.c + + + timeouts.c + 1 + ..\lwip-2.0.2\src\core\timeouts.c + + + udp.c + 1 + ..\lwip-2.0.2\src\core\udp.c + + + autoip.c + 1 + ..\lwip-2.0.2\src\core\ipv4\autoip.c + + + dhcp.c + 1 + ..\lwip-2.0.2\src\core\ipv4\dhcp.c + + + etharp.c + 1 + ..\lwip-2.0.2\src\core\ipv4\etharp.c + + + icmp.c + 1 + ..\lwip-2.0.2\src\core\ipv4\icmp.c + + + igmp.c + 1 + ..\lwip-2.0.2\src\core\ipv4\igmp.c + + + ip4.c + 1 + ..\lwip-2.0.2\src\core\ipv4\ip4.c + + + ip4_addr.c + 1 + ..\lwip-2.0.2\src\core\ipv4\ip4_addr.c + + + ip4_frag.c + 1 + ..\lwip-2.0.2\src\core\ipv4\ip4_frag.c + + + ethernet.c + 1 + ..\lwip-2.0.2\src\netif\ethernet.c + + + + + Utilities + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + doc + + + readme.txt + 5 + ..\src\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_enet_eval.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_enet_eval.h new file mode 100644 index 0000000..5219e72 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_enet_eval.h @@ -0,0 +1,44 @@ +/*! + \file gd32f10x_enet_eval.h + \brief the header file of gd32f20x_enet_eval + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10x_ENET_EVAL_H +#define GD32F10x_ENET_EVAL_H + +#include "lwip/netif.h" + +/* function declarations */ +/* setup ethernet system(GPIOs, clocks, MAC, DMA, systick) */ +void enet_system_setup(void); + +#endif /* GD32F10x_ENET_EVAL_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_it.h new file mode 100644 index 0000000..cc65cd6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles ethernet exception */ +void ENET_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..ace9cfe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/hello_gigadevice.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/hello_gigadevice.h new file mode 100644 index 0000000..94649de --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/hello_gigadevice.h @@ -0,0 +1,42 @@ +/*! + \file hello_gigadevice.h + \brief the header file of hello_gigadevice + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef HELLO_GIGADEVICE_H +#define HELLO_GIGADEVICE_H + +/* function declarations */ +/* initialize the hello application */ +void hello_gigadevice_init(void); + +#endif /* HELLO_GIGADEVICE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/lwipopts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/lwipopts.h new file mode 100644 index 0000000..6617290 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/lwipopts.h @@ -0,0 +1,156 @@ +/*! + \file lwipopts.h + \brief LwIP options configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef LWIPOPTS_H +#define LWIPOPTS_H + + +#define SYS_LIGHTWEIGHT_PROT 0 /* SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection + for certain critical regions during buffer allocation, + deallocation and memory allocation and deallocation */ + +#define NO_SYS 1 /* NO_SYS==1: provides VERY minimal functionality. + Otherwise, use lwIP facilities */ + +/* memory options */ +#define MEM_ALIGNMENT 4 /* should be set to the alignment of the CPU for which lwIP + is compiled. 4 byte alignment -> define MEM_ALIGNMENT + to 4, 2 byte alignment -> define MEM_ALIGNMENT to 2 */ + +#define MEM_SIZE (20*1024) /* the size of the heap memory, if the application will + send a lot of data that needs to be copied, this should + be set high */ + +#define MEMP_NUM_PBUF 10 /* the number of memp struct pbufs. If the application + sends a lot of data out of ROM (or other static memory), + this should be set high */ + +#define MEMP_NUM_UDP_PCB 6 /* the number of UDP protocol control blocks, one + per active UDP "connection" */ + +#define MEMP_NUM_TCP_PCB 10 /* the number of simulatenously active TCP connections */ + +#define MEMP_NUM_TCP_PCB_LISTEN 6 /* the number of listening TCP connections */ + +#define MEMP_NUM_TCP_SEG 12 /* the number of simultaneously queued TCP segments */ + +#define MEMP_NUM_SYS_TIMEOUT 10 /* the number of simulateously active timeouts */ + + +/* Pbuf options */ +#define PBUF_POOL_SIZE 10 /* the number of buffers in the pbuf pool */ +#define PBUF_POOL_BUFSIZE 1500 /* the size of each pbuf in the pbuf pool */ + +/* TCP options */ +#define LWIP_TCP 1 +#define TCP_TTL 255 + +#define TCP_QUEUE_OOSEQ 0 /* controls if TCP should queue segments that arrive out of + order, Define to 0 if your device is low on memory. */ + +#define TCP_MSS (1500 - 40) /* TCP Maximum segment size, + TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ + +#define TCP_SND_BUF (2*TCP_MSS) /* TCP sender buffer space (bytes) */ + +#define TCP_SND_QUEUELEN ((6* TCP_SND_BUF)/TCP_MSS) /* TCP sender buffer space (pbufs), this must be at least + as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work */ + +#define TCP_WND (2*TCP_MSS) /* TCP receive window */ + + +/* ICMP options */ +#define LWIP_ICMP 1 + + +/* DHCP options */ +#define LWIP_DHCP 1 /* define to 1 if you want DHCP configuration of interfaces, + DHCP is not implemented in lwIP 0.5.1, however, so + turning this on does currently not work. */ + +/* UDP options */ +#define LWIP_UDP 1 +#define UDP_TTL 255 + + +/* statistics options */ +#define LWIP_STATS 0 +#define LWIP_PROVIDE_ERRNO 1 + +/* checksum options */ +#define CHECKSUM_BY_HARDWARE /* computing and verifying the IP, UDP, TCP and ICMP + checksums by hardware */ + +/* sequential layer options */ +#define LWIP_NETCONN 0 /* set to 1 to enable netconn API (require to use api_lib.c) */ + +/* socket options */ +#define LWIP_SOCKET 0 /* set to 1 to enable socket API (require to use sockets.c) */ + +/* Lwip debug options */ +//#define LWIP_DEBUG 1 + + + +#ifdef CHECKSUM_BY_HARDWARE + /* CHECKSUM_GEN_IP==0: generate checksums by hardware for outgoing IP packets.*/ + #define CHECKSUM_GEN_IP 0 + /* CHECKSUM_GEN_UDP==0: generate checksums by hardware for outgoing UDP packets.*/ + #define CHECKSUM_GEN_UDP 0 + /* CHECKSUM_GEN_TCP==0: generate checksums by hardware for outgoing TCP packets.*/ + #define CHECKSUM_GEN_TCP 0 + /* CHECKSUM_CHECK_IP==0: check checksums by hardware for incoming IP packets.*/ + #define CHECKSUM_CHECK_IP 0 + /* CHECKSUM_CHECK_UDP==0: check checksums by hardware for incoming UDP packets.*/ + #define CHECKSUM_CHECK_UDP 0 + /* CHECKSUM_CHECK_TCP==0: check checksums by hardware for incoming TCP packets.*/ + #define CHECKSUM_CHECK_TCP 0 + #define CHECKSUM_GEN_ICMP 0 +#else + /* CHECKSUM_GEN_IP==1: generate checksums in software for outgoing IP packets.*/ + #define CHECKSUM_GEN_IP 1 + /* CHECKSUM_GEN_UDP==1: generate checksums in software for outgoing UDP packets.*/ + #define CHECKSUM_GEN_UDP 1 + /* CHECKSUM_GEN_TCP==1: generate checksums in software for outgoing TCP packets.*/ + #define CHECKSUM_GEN_TCP 1 + /* CHECKSUM_CHECK_IP==1: check checksums in software for incoming IP packets.*/ + #define CHECKSUM_CHECK_IP 1 + /* CHECKSUM_CHECK_UDP==1: check checksums in software for incoming UDP packets.*/ + #define CHECKSUM_CHECK_UDP 1 + /* CHECKSUM_CHECK_TCP==1: check checksums in software for incoming TCP packets.*/ + #define CHECKSUM_CHECK_TCP 1 + #define CHECKSUM_GEN_ICMP 1 +#endif + +#endif /* LWIPOPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/main.h new file mode 100644 index 0000000..0801997 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/main.h @@ -0,0 +1,88 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __MAIN_H +#define __MAIN_H + +#include "gd32f10x.h" +#include "stdint.h" +#include "gd32f10x_enet_eval.h" + +//#define USE_DHCP /* enable DHCP, if disabled static address is used */ + +//#define USE_ENET_INTERRUPT +//#define TIMEOUT_CHECK_USE_LWIP + +/* MAC address: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2 +#define MAC_ADDR1 0xA +#define MAC_ADDR2 0xF +#define MAC_ADDR3 0xE +#define MAC_ADDR4 0xD +#define MAC_ADDR5 6 + +/* static IP address: IP_ADDR0.IP_ADDR1.IP_ADDR2.IP_ADDR3 */ +#define IP_ADDR0 192 +#define IP_ADDR1 168 +#define IP_ADDR2 57 +#define IP_ADDR3 152 + +/* net mask */ +#define NETMASK_ADDR0 255 +#define NETMASK_ADDR1 255 +#define NETMASK_ADDR2 255 +#define NETMASK_ADDR3 0 + +/* gateway address */ +#define GW_ADDR0 192 +#define GW_ADDR1 168 +#define GW_ADDR2 57 +#define GW_ADDR3 1 + +/* MII and RMII mode selection */ +#define RMII_MODE // user have to provide the 50 MHz clock by soldering a 50 MHz oscillator +//#define MII_MODE + +/* clock the PHY from external 25MHz crystal (only for MII mode) */ +#ifdef MII_MODE +#define PHY_CLOCK_MCO +#endif + +/* function declarations */ +/* updates the system local time */ +void time_update(void); +/* insert a delay time */ +void delay_10ms(uint32_t ncount); + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/netconf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/netconf.h new file mode 100644 index 0000000..25f7fd1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/inc/netconf.h @@ -0,0 +1,48 @@ +/*! + \file netconf.h + \brief the header file of netconf + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef NETCONF_H +#define NETCONF_H + +#include "main.h" + +#ifdef USE_DHCP +void lwip_dhcp_process_handle(void); +#endif /* USE_DHCP */ + +void lwip_stack_init(void); +void lwip_pkt_handle(void); +void lwip_periodic_handle(__IO uint32_t localtime); + +#endif /* NETCONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/CHANGELOG b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/CHANGELOG new file mode 100644 index 0000000..3a27719 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/CHANGELOG @@ -0,0 +1,4276 @@ +HISTORY + +(git master) + + * [Enter new changes just after this line - do not remove this line] + +(STABLE-2.0.2) + + ++ New features: + + 2017-02-10: Dirk Ziegelmeier + * Implement task #14367: Hooks need a better place to be defined: + We now have a #define for a header file name that is #included in every .c + file that provides hooks. + + ++ Bugfixes: + + 2017-03-08 + * tcp: do not keep sending SYNs when getting ACKs + + 2017-03-08: Joel Cunningham + * tcp: Initialize ssthresh to TCP_SND_BUF (bug #50476) + + 2017-03-01: Simon Goldschmidt + * httpd: LWIP_HTTPD_POST_MANUAL_WND: fixed double-free when httpd_post_data_recved + is called nested from httpd_post_receive_data() (bug #50424) + + 2017-02-28: David van Moolenbroek/Simon Goldschmidt + * tcp: fixed bug #50418: LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb + + 2017-02-17: Simon Goldschmidt + * dns: Improved DNS_LOCAL_HOSTLIST interface (bug #50325) + + 2017-02-16: Simon Goldschmidt + * LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274) + + 2017-02-13: Simon Goldschmidt/Dirk Ziegelmeier + * For tiny targtes, LWIP_RAND is optional (fix compile time checks) + + 2017-02-10: Simon Goldschmidt + * tcp: Fixed bug #47485 (tcp_close() should not fail on memory error) by retrying + to send FIN from tcp_fasttmr + + 2017-02-09: Simon Goldschmidt + * sockets: Fixed bug #44032 (LWIP_NETCONN_FULLDUPLEX: select might work on + invalid/reused socket) by not allowing to reallocate a socket that has + "select_waiting != 0" + + 2017-02-09: Simon Goldschmidt + * httpd: Fixed bug #50059 (httpd LWIP_HTTPD_SUPPORT_11_KEEPALIVE vs. + LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED) + + 2017-02-08: Dirk Ziegelmeier + * Rename "IPv6 mapped IPv4 addresses" to their correct name from RFC4191: + "IPv4-mapped IPv6 address" + + 2017-02-08: Luc Revardel + * mld6.c: Fix bug #50220 (mld6_leavegroup does not send ICMP6_TYPE_MLD, even + if last reporter) + + 2017-02-08: David van Moolenbroek + * ip6.c: Patch #9250: fix source substitution in ip6_output_if() + + 2017-02-08: Simon Goldschmidt + * tcp_out.c: Fixed bug #50090 (last_unsent->oversize_left can become wrong value + in tcp_write error path) + + 2017-02-02: Dirk Ziegelmeier + * Fix bug #50206: UDP Netconn bind to IP6_ADDR_ANY fails + + 2017-01-18: Dirk Ziegelmeier + * Fix zero-copy RX, see bug bug #50064. PBUF_REFs were not supported as ARP requests. + + 2017-01-15: Axel Lin, Dirk Ziegelmeier + * minor bug fixes in mqtt + + 2017-01-11: Knut Andre Tidemann + * sockets/netconn: fix broken default ICMPv6 handling of checksums + +(STABLE-2.0.1) + + ++ New features: + + 2016-12-31: Simon Goldschmidt + * tcp.h/.c: added function tcp_listen_with_backlog_and_err() to get the error + reason when listening fails (bug #49861) + + 2016-12-20: Erik Andersen + * Add MQTT client + + 2016-12-14: Jan Breuer: + * opt.h, ndc.h/.c: add support for RDNSS option (as per RFC 6106) + + 2016-12-14: David van Moolenbroek + * opt.h, nd6.c: Added LWIP_HOOK_ND6_GET_GW() + + 2016-12-09: Dirk Ziegelmeier + * ip6_frag.c: Implemented support for LWIP_NETIF_TX_SINGLE_PBUF + + 2016-12-09: Simon Goldschmidt + * dns.c: added one-shot multicast DNS queries + + 2016-11-24: Ambroz Bizjak, David van Moolenbroek + * tcp_out.c: Optimize passing contiguous nocopy buffers to tcp_write (bug #46290) + + 2016-11-16: Dirk Ziegelmeier + * sockets.c: added support for IPv6 mapped IPv4 addresses + + ++ Bugfixes: + + 2016-12-16: Thomas Mueller + * api_lib.c: fixed race condition in return value of netconn_gethostbyname() + (and thus also lwip_gethostbyname/_r() and lwip_getaddrinfo()) + + 2016-12-15: David van Moolenbroek + * opt.h, tcp: added LWIP_HOOK_TCP_ISN() to implement less predictable initial + sequence numbers (see contrib/addons/tcp_isn for an example implementation) + + 2016-12-05: Dirk Ziegelmeier + * fixed compiling with IPv4 disabled (IPv6 only case) + + 2016-11-28: Simon Goldschmidt + * api_lib.c: fixed bug #49725 (send-timeout: netconn_write() can return + ERR_OK without all bytes being written) + + 2016-11-28: Ambroz Bizjak + * tcpi_in.c: fixed bug #49717 (window size in received SYN and SYN-ACK + assumed scaled) + + 2016-11-25: Simon Goldschmidt + * dhcp.c: fixed bug #49676 (Possible endless loop when parsing dhcp options) + + 2016-11-23: Dirk Ziegelmeier + * udp.c: fixed bug #49662: multicast traffic is now only received on a UDP PCB + (and therefore on a UDP socket/netconn) when the PCB is bound to IP_ADDR_ANY + + 2016-11-16: Dirk Ziegelmeier + * *: Fixed dual-stack behaviour, IPv6 mapped IPv4 support in socket API + + 2016-11-14: Joel Cunningham + * tcp_out.c: fixed bug #49533 (start persist timer when unsent seg can't fit + in window) + + 2016-11-16: Roberto Barbieri Carrera + * autoip.c: fixed bug #49610 (sometimes AutoIP fails to reuse the same address) + + 2016-11-11: Dirk Ziegelmeier + * sockets.c: fixed bug #49578 (dropping multicast membership does not work + with LWIP_SOCKET_OFFSET) + +(STABLE-2.0.0) + + ++ New features: + + 2016-07-27: Simon Goldschmidt + * opt.h, timeouts.h/.c: added LWIP_TIMERS_CUSTOM to override the default + implementation of timeouts + + 2016-07-xx: Dirk Ziegelmeier + * Large overhaul of doxygen documentation + + 2016-04-05: Simon Goldschmidt + * timers.h/.c: prepare for overriding current timeout implementation: all + stack-internal caclic timers are avaliable in the lwip_cyclic_timers array + + 2016-03-23: Simon Goldschmidt + * tcp: call accept-callback with ERR_MEM when allocating a pcb fails on + passive open to inform the application about this error + ATTENTION: applications have to handle NULL pcb in accept callback! + + 2016-02-22: Ivan Delamer + * Initial 6LoWPAN support + + 2016-02-XX to 2016-03-XX: Dirk Ziegelmeier + * Cleanup TCPIP thread sync methods in a way that it is possibe to use them + in arbitrary code that needs things to be done in TCPIP thread. Used to + decouple netconn, netif, ppp and 6LoWPAN from LWIP core. + + 2016-02-XX: Dirk Ziegelmeier + * Implement dual-stack support in RAW, UDP and TCP. Add new IP address + type IPADDR_ANY_TYPE for this. Netconn/Socket API: Dual-stack is + automatically supported when an IPv6 netconn/socket is created. + + 2015-12-26: Martin Hentschel and Dirk Ziegelmeier + * Rewrite SNMP agent. SNMPv2c + MIB compiler. + + 2015-11-12: Dirk Ziegelmeier + * Decouple SNMP stack from lwIP core and move stack to apps/ directory. + Breaking change: Users have to call snmp_init() now! + + 2015-11-12: Dirk Ziegelmeier + * Implement possibility to declare private memory pools. This is useful to + decouple some apps from the core (SNMP stack) or make contrib app usage + simpler (httpserver_raw) + + 2015-10-09: Simon Goldschmidt + * started to move "private" header files containing implementation details to + "lwip/priv/" include directory to seperate the API from the implementation. + + 2015-10-07: Simon Goldschmidt + * added sntp client as first "supported" application layer protocol implementation + added 'apps' folder + + 2015-09-30: Dirk Ziegelmeier + * snmp_structs.h, mib_structs.c, mib2.c: snmp: fixed ugly inheritance + implementation by aggregating the "base class" (struct mib_node) in all + derived node classes to get more type-safe code + + 2015-09-23: Simon Goldschmidt + * netif.h/.c, nd6.c: task #13729: Convert netif addresses (IPv4 & IPv6) to + ip_addr_t (so they can be used without conversion/temporary storage) + + 2015-09-08: Dirk Ziegelmeier + * snmp: Separate mib2 counter/table callbacks from snmp agent. This both cleans + up the code and should allow integration of a 3rd party agent/mib2. Simple + counters are kept in MIB2_STATS, tree/table change function prototypes moved to + snmp_mib2.h. + + 2015-09-03: Simon Goldschmidt + * opt.h, dns.h/.c: DNS/IPv6: added support for AAAA records + + 2015-09-01: Simon Goldschmidt + * task #12178: hardware checksum capabilities can be configured per netif + (use NETIF_SET_CHECKSUM_CTRL() in your netif's init function) + + 2015-08-30: Simon Goldschmidt + * PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in + contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required) + + 2015-08-30: Simon Goldschmidt + * support IPv4 source based routing: define LWIP_HOOK_IP4_ROUTE_SRC to point + to a routing function + + 2015-08-05: Simon Goldschmidt + * many files: allow multicast socket options IP_MULTICAST_TTL, IP_MULTICAST_IF + and IP_MULTICAST_LOOP to be used without IGMP + + 2015-04-24: Simon Goldschmidt + * dhcp.h/c, autoip.h/.c: added functions dhcp/autoip_supplied_address() to + check for the source of address assignment (replacement for NETIF_FLAG_DHCP) + + 2015-04-10: Simon Goldschmidt + * many files: task #13480: added LWIP_IPV4 define - IPv4 can be disabled, + leaving an IPv6-only stack + + 2015-04-09: Simon Goldschmidt + * nearly all files: task #12722 (improve IPv4/v6 address handling): renamed + ip_addr_t to ip4_addr_t, renamed ipX_addr_t to ip_addr_t and added IP + version; ip_addr_t is used for all generic IP addresses for the API, + ip(4/6)_addr_t are only used internally or when initializing netifs or when + calling version-related functions + + 2015-03-24: Simon Goldschmidt + * opt.h, ip4_addr.h, ip4.c, ip6.c: loopif is not required for loopback traffic + any more but passed through any netif (ENABLE_LOOPBACK has to be enabled) + + 2015-03-23: Simon Goldschmidt + * opt.h, etharp.c: with ETHARP_TABLE_MATCH_NETIF== 1, duplicate (Auto)-IP + addresses on multiple netifs should now be working correctly (if correctly + addressed by routing, that is) + + 2015-03-23: Simon Goldschmidt + * etharp.c: Stable etharp entries that are about to expire are now refreshed + using unicast to prevent unnecessary broadcast. Only if no answer is received + after 15 seconds, broadcast is used. + + 2015-03-06: Philip Gladstone + * netif.h/.c: patch #8359 (Provide utility function to add an IPv6 address to + an interface) + + 2015-03-05: Simon Goldschmidt + * netif.c, ip4.c, dhcp.c, autoip.c: fixed bug #37068 (netif up/down handling + is unclear): correclty separated administrative status of a netif (up/down) + from 'valid address' status + ATTENTION: netif_set_up() now always has to be called, even when dhcp/autoip + is used! + + 2015-02-26: patch by TabascoEye + * netif.c, udp.h/.c: fixed bug #40753 (re-bind UDP pcbs on change of IP address) + + 2015-02-22: chrysn, Simon Goldschmidt + * *.*: Changed nearly all functions taking 'ip(X)_addr_t' pointer to take + const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed + port callbacks: netif_output_fn, netif_igmp_mac_filter_fn) + + 2015-02-19: Ivan Delamer + * netif.h, dhcp.c: Removed unused netif flag for DHCP. The preferred way to evaluate + if DHCP is active is through netif->dhcp field. + + 2015-02-19: Ivan Delamer + * netif.h, slipif.c, ppp.c: Removed unused netif flag for point to point connections + + 2015-02-18: Simon Goldschmidt + * api_lib.c: fixed bug #37958 "netconn API doesn't handle correctly + connections half-closed by peer" + + 2015-02-18: Simon Goldschmidt + * tcp.c: tcp_alloc() prefers killing CLOSING/LAST_ACK over active connections + (see bug #39565) + + 2015-02-16: Claudius Zingerli, Sergio Caprile + * opt.h, dhcp.h/.c: patch #8361 "Add support for NTP option in DHCP" + + 2015-02-14: Simon Goldschmidt + * opt.h, snmp*: added support for write-access community and dedicated + community for sending traps + + 2015-02-13: Simon Goldschmidt + * opt.h, memp.c: added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when + a memp pool was empty and an item is now available + + 2015-02-13: Simon Goldschmidt + * opt.h, pbuf.h/.c, etharp.c: Added the option PBUF_LINK_ENCAPSULATION_HLEN to + allocate additional header space for TX on netifs requiring additional headers + + 2015-02-12: chrysn + * timers.h/.c: introduce sys_timeouts_sleeptime (returns the time left before + the next timeout is due, for NO_SYS==1) + + 2015-02-11: Nick van Ijzendoorn + * opt.h, sockets.h/c: patch #7702 "Include ability to increase the socket number + with defined offset" + + 2015-02-11: Frederick Baksik + * opt.h, def.h, others: patch #8423 "arch/perf.h" should be made an optional item + + 2015-02-11: Simon Goldschmidt + * api_msg.c, opt.h: started to implement fullduplex sockets/netconns + (note that this is highly unstable yet!) + + 2015-01-17: Simon Goldschmidt + * api: allow enabling socket API without (public) netconn API - netconn API is + still used by sockets, but keeping it private (static) should allow better + compiler optimizations + + 2015-01-16: Simon Goldschmidt + * tcp_in.c: fixed bug #20506 "Initial congestion window is very small" again + by implementing the calculation formula from RFC3390 + + 2014-12-10: Simon Goldschmidt + * api: added option LWIP_NETCONN_SEM_PER_THREAD to use a semaphore per thread + instead of using one per netconn and per select call + + 2014-12-08: Simon Goldschmidt + * ip6.h: fixed bug #43778: IPv6 header version not set on 16-bit platform + (macro IP6H_VTCFL_SET()) + + 2014-12-08: Simon Goldschmidt + * icmp.c, ip4.c, pbuf.c, udp.c, pbuf.h: task #11472 Support PBUF_REF for RX + (IPv6 and IPv4/v6 reassembly might not work yet) + + 2014-11-06: Simon Goldschmidt + * sockets.c/.h, init.c: lwip_socket_init() is not needed any more + -> compatibility define + + 2014-09-16: Simon Goldschmidt + * dns.c, opt.h: reduced ram usage by parsing DNS responses in place + + 2014-09-16: Simon Goldschmidt + * pbuf.h/.c: added pbuf_take_at() and pbuf_put_at() + + 2014-09-15: Simon Goldschmidt + * dns.c: added source port randomization to make the DNS client more robust + (see bug #43144) + + 2013-09-02: Simon Goldschmidt + * arch.h and many other files: added optional macros PACK_STRUCT_FLD_8() and + PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that + do not need packing + + 2013-08-19: Simon Goldschmidt + * netif.h: bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special + networks + + 2013-03-17: Simon Goldschmidt (patch by Ghobad Emadi) + * opt.h, etharp.c: Added LWIP_HOOK_ETHARP_GET_GW to implement IPv4 routing with + multiple gateways + + 2013-04-20: Fatih Asici + * opt.h, etharp.h/.c: patch #7993: Added support for transmitting packets + with VLAN headers via hook function LWIP_HOOK_VLAN_SET and to check them + via hook function LWIP_HOOK_VLAN_CHECK + + 2014-02-20: Simon Goldschmidt (based on patch by Artem Pisarenko) + * patch #7885: modification of api modules to support FreeRTOS-MPU + (don't pass stack-pointers to other threads) + + 2014-02-05: Simon Goldschmidt (patch by "xtian" and "alex_ab") + * patch #6537/#7858: TCP window scaling support + + 2014-01-17: Jiri Engelthaler + * icmp, icmp6, opt.h: patch #8027: Completed HW checksuming for IPv4 and + IPv6 ICMP's + + 2012-08-22: Sylvain Rochet + * New PPP stack for lwIP, developed in ppp-new branch. + Based from pppd 2.4.5, released 2009-11-17, with huge changes to match + code size and memory requirements for embedded devices, including: + - Gluing together the previous low-level PPP code in lwIP to pppd 2.4.5, which + is more or less what pppd sys-* files are, so that we get something working + using the unix port. + - Merged some patchs from lwIP Git repository which add interesting features + or fix bugs. + - Merged some patchs from Debian pppd package which add interesting features + or fix bugs. + - Ported PPP timeout handling to the lwIP timers system + - Disabled all the PPP code using filesystem access, replaced in necessary cases + to configuration variables. + - Disabled all the PPP code forking processes. + - Removed IPX support, lwIP does not support IPX. + - Ported and improved random module from the previous PPP port. + - Removed samba TDB (file-driven database) usage, because it needs a filesystem. + - MS-CHAP required a DES implementation, we added the latest PolarSSL DES + implementation which is under a BSD-ish license. + - Also switched to PolarSSL MD4,MD5,SHA1 implementations, which are meant to be + used in embedded devices with reduced memory footprint. + - Removed PPP configuration file parsing support. + - Added macro definition EAP_SUPPORT to make EAP support optional. + - Added macro definition CHAP_SUPPORT to make CHAP support optional. + - Added macro definition MSCHAP_SUPPORT to make MSCHAP support optional. + - Added macro definition PAP_SUPPORT to make PAP support optional. + - Cleared all Linux syscall calls. + - Disabled demand support using a macro, so that it can be ported later. + - Disabled ECP support using a macro, so that it can be ported later. + - Disabled CCP support using a macro, so that it can be ported later. + - Disabled CBCP support using a macro, so that it can be ported later. + - Disabled LQR support using a macro, so that it can be ported later. + - Print packet debug feature optional, through PRINTPKT_SUPPORT + - Removed POSIX signal usage. + - Fully ported PPPoS code from the previous port. + - Fully ported PPPoE code from the previous port. + - Fully ported VJ compression protocol code from the previous port. + - Removed all malloc()/free() use from PPP, replaced by stack usage or PBUF. + - Disabled PPP server support using a macro, so that it can be ported later. + - Switched all PPP debug to lwIP debug system. + - Created PPP Control Block (PPP PCB), removed PPP unit integer everywhere, + removed all global variables everywhere, did everything necessary for + the PPP stack to support more than one PPP session (pppd only support + one session per process). + - Removed the statically allocated output buffer, now using PBUF. + - Improved structure size of all PPP modules, deep analyze of code to reduce + variables size to the bare minimum. Switched all boolean type (char type in + most architecture) to compiler generated bitfields. + - Added PPP IPv6 support, glued lwIP IPv6 support to PPP. + - Now using a persistent netif interface which can then be used in lwIP + functions requiring a netif. + - Now initializing PPP in lwip_init() function. + - Reworked completely the PPP state machine, so that we don't end up in + anymore in inconsistent state, especially with PPPoE. + - Improved the way we handle PPP reconnection after disconnect, cleaning + everything required so that we start the PPP connection again from a + clean state. + - Added PPP holdoff support, allow the lwIP user to wait a little bit before + reconnecting, prevents connection flood, especially when using PPPoL2TP. + - Added PPPoL2TP LAC support (a.k.a. UDP tunnels), adding a VPN client + feature to lwIP, L2TP being a widely used tunnel protocol. + - Switched all used PPP types to lwIP types (u8t, u16t, u32t, ...) + - Added PPP API "sequential" thread-safe API, based from NETIFAPI. + + 2011-07-21: Simon Goldschmidt + * sockets.c, opt.h: (bug #30185): added LWIP_FIONREAD_LINUXMODE that makes + ioctl/FIONREAD return the size of the next pending datagram. + + 2011-05-25: Simon Goldschmidt + * again nearly the whole stack, renamed ip.c to ip4.c, ip_addr.c to ip4_addr.c, + combined ipv4/ipv6 inet_chksum.c, added ip.h, ip_addr.h: Combined IPv4 + and IPv6 code where possible, added defines to access IPv4/IPv6 in non-IP + code so that the code is more readable. + + 2011-05-17: Patch by Ivan Delamer (only checked in by Simon Goldschmidt) + * nearly the whole stack: Finally, we got decent IPv6 support, big thanks to + Ivan! (this is work in progress: we're just post release anyway :-) + + + ++ Bugfixes: + + 2016-08-23: Simon Goldschmidt + * etharp: removed ETHARP_TRUST_IP_MAC since it is insecure and we don't need + it any more after implementing unicast ARP renewal towards arp entry timeout + + 2016-07-20: Simon Goldschmidt + * memp.h/.c: fixed bug #48442 (memp stats don't work for MEMP_MEM_MALLOC) + + 2016-07-21: Simon Goldschmidt (patch by Ambroz Bizjak) + * tcp_in.c, tcp_out.c: fixed bug #48543 (TCP sent callback may prematurely + report sent data when only part of a segment is acked) and don't include + SYN/FIN in snd_buf counter + + 2016-07-19: Simon Goldschmidt + * etharp.c: fixed bug #48477 (ARP input packet might update static entry) + + 2016-07-11: Simon Goldschmidt + * tcp_in.c: fixed bug #48476 (TCP sent callback called wrongly due to picking + up old pcb->acked + + 2016-06-30: Simon Goldschmidt (original patch by Fabian Koch) + * tcp_in.c: fixed bug #48170 (Vulnerable to TCP RST spoofing) + + 2016-05-20: Dirk Ziegelmeier + * sntp.h/.c: Fix return value of sntp_getserver() call to return a pointer + + 2016-04-05: Simon Goldschmidt (patch by Philip Gladstone) + * udp.c: patch #8358: allow more combinations of listening PCB for IPv6 + + 2016-04-05: Simon Goldschmidt + * netconn/socket API: fixed bug# 43739 (Accept not reporting errors about + aborted connections): netconn_accept() returns ERR_ABRT (sockets: ECONNABORTED) + for aborted connections, ERR_CLSD (sockets: EINVAL) if the listening netconn + is closed, which better seems to follow the standard. + + 2016-03-23: Florent Matignon + * dhcp.c: fixed bug #38203: DHCP options are not recorded in all DHCP ack messages + + 2016-03-22: Simon Goldschmidt + * tcp: changed accept handling to be done internally: the application does not + have to call tcp_accepted() any more. Instead, when delaying accept (e.g. sockets + do), call tcp_backlog_delayed()/tcp_backlog_accepted() (fixes bug #46696) + + 2016-03-22: Simon Goldschmidt + * dns.c: ignore dns response parsing errors, only abort resolving for correct + responses or error responses from correct server (bug #47459) + + 2016-03-17: Simon Goldschmidt + * api_msg.c: fixed bug #47448 (netconn/socket leak if RST is received during close) + + 2016-03-17: Joel Cunningham + * api_msg.c: don't fail closing a socket/netconn when failing to allocate the + FIN segment; blocking the calling thread for a while is better than risking + leaking a netconn/socket (see bug #46701) + + 2016-03-16: Joel Cunningham + * tcp_out.c: reset rto timer on fast retransmission + + 2016-03-16: Deomid Ryabkov + * tcp_out.c: fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS + + 2016-03-05: Simon Goldschmidt + * err.h/.c, sockets.c: ERR_IF is not necessarily a fatal error + + 2015-11-19: fix by Kerem Hadimli + * sockets.c: fixed bug #46471: lwip_accept() leaks socket descriptors if new + netconn was already closed because of peer behavior + + 2015-11-12: fix by Valery Ushakov + * tcp_in.c: fixed bug #46365 tcp_accept_null() should call tcp_abort() + + 2015-10-02: Dirk Ziegelmeier/Simon Goldschmidt + * snmp: cleaned up snmp structs API (fixed race conditions from bug #46089, + reduce ram/rom usage of tables): incompatible change for private MIBs + + 2015-09-30: Simon Goldschmidt + * ip4_addr.c: fixed bug #46072: ip4addr_aton() does not check the number range + of all address parts + + 2015-08-28: Simon Goldschmidt + * tcp.c, tcp_in.c: fixed bug #44023: TCP ssthresh value is unclear: ssthresh + is set to the full send window for active open, too, and is updated once + after SYN to ensure the correct send window is used + + 2015-08-28: Simon Goldschmidt + * tcp: fixed bug #45559: Window scaling casts u32_t to u16_t without checks + + 2015-08-26: Simon Goldschmidt + * ip6_frag.h/.c: fixed bug bug #41009: IPv6 reassembly broken on 64-bit platforms: + define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header + instead of referencing it, which gives more room for struct ip6_reass_helper + + 2015-08-25: Simon Goldschmidt + * sockets.c: fixed bug #45827: recvfrom: TCP window is updated with MSG_PEEK + + 2015-08-20: Manoj Kumar + * snmp_msg.h, msg_in.c: fixed bug #43790: Sending octet string of Length >255 + from SNMP agent + + 2015-08-19: Jens Nielsen + * icmp.c, ip4.c, tcp_in.c, udp.c, raw.c: fixed bug #45120: Broadcast & multiple + interfaces handling + + 2015-08-19: Simon Goldschmidt (patch by "Sandra") + * dns.c: fixed bug #45004: dns response without answer might be discarded + + 2015-08-18: Chrysn + * timers.c: patch #8704 fix sys_timeouts_sleeptime function + + 2015-07-01: Erik Ekman + * puf.c: fixed bug #45454 (pbuf_take_at() skips write and returns OK if offset + is at start of pbuf in chain) + + 2015-05-19: Simon Goldschmidt + * dhcp.h/.c: fixed bugs #45140 and #45141 (dhcp was not stopped correctly after + fixing bug #38204) + + 2015-03-21: Simon Goldschmidt (patch by Homyak) + * tcp_in.c: fixed bug #44766 (LWIP_WND_SCALE: tcphdr->wnd was not scaled in + two places) + + 2015-03-21: Simon Goldschmidt + * tcp_impl.h, tcp.c, tcp_in.c: fixed bug #41318 (Bad memory ref in tcp_input() + after tcp_close()) + + 2015-03-21: Simon Goldschmidt + * tcp_in.c: fixed bug #38468 (tcp_sent() not called on half-open connection for + data ACKed with the same ack as FIN) + + 2015-03-21: Simon Goldschmidt (patch by Christoffer Lind) + * dhcp.h/.c: fixed bug #38204 (DHCP lease time not handled correctly) + + 2015-03-20: Simon Goldschmidt + * dhcp.c: fixed bug #38714 (Missing option and client address in DHCPRELEASE message) + + 2015-03-19: Simon Goldschmidt + * api.h, tcpip.h, api_lib.c, api_msg.c: fixed race conditions in assigning + netconn->last_err (fixed bugs #38121 and #37676) + + 2015-03-09: Simon Goldschmidt + * ip4.c: fixed the IPv4 part of bug #43904 (ip_route() must detect linkup status) + + 2015-03-04: Simon Goldschmidt + * nd6.c: fixed bug #43784 (a host should send at least one Router Solicitation) + + 2015-03-04: Valery Ushakov + * ip6.c: fixed bug #41094 (Byte-order bug in IPv6 fragmentation header test) + + 2015-03-04: Zach Smith + * nd6.c: fixed bug #38153 (nd6_input() byte order issues) + + 2015-02-26: Simon Goldschmidt + * netif.c, tcp.h/.c: fixed bug #44378 (TCP connections are not aborted on netif + remove) + + 2015-02-25: Simon Goldschmidt + * ip4.c, etharp.c: fixed bug #40177 (System hangs when dealing with corrupted + packets), implemented task #12357 (Ensure that malicious packets don't + assert-fail): improved some pbuf_header calls to not assert-fail. + + 2015-02-25: patch by Joel Cunningham + * udp.h/.c, sockets.c: fixed bug #43028 (IP_MULTICAST_TTL affects unicast + datagrams) + + 2015-02-25: patch by Greg Renda + * ip4_frag.c: fixed bug #38210 (ip reassembly while remove oldest datagram) + + 2015-02-25: Simon Goldschmidt + * sockets.c: fixed bug #38165 (socket with mulicast): ensure igmp membership + are dropped when socket (not netconn!) is closed. + + 2015-02-25: Simon Goldschmidt + * ip4.h/.c, udp.c: fixed bug #38061 (wrong multicast routing in IPv4) by + adding an optional default netif for multicast routing + + 2015-02-25: Simon Goldschmidt + * netconn API: fixed that netconn_connect still used message passing for + LWIP_TCPIP_CORE_LOCKING==1 + + 2015-02-22: patch by Jens Nielsen + * icmp.c: fixed bug #38803 (Source address in broadcast ping reply) + + 2015-02-22: Simon Goldschmidt + * udp.h, sockets.c: added proper accessor functions for pcb->multicast_ip + (previously used by get/setsockopt only) + + 2015-02-18: Simon Goldschmidt + * sockets.c: Fixed select not reporting received FIN as 'readable' in certain + rare cases (bug #43779: select(), close(), and TCP retransmission error) + + 2015-02-17: Simon Goldschmidt + * err.h, sockets.c, api_msg.c: fixed bug #38853 "connect() use a wrong errno": + return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already + connected + + 2015-02-17: Simon Goldschmidt + * tcp_impl.h, tcp_out.c, tcp.c, api_msg.c: fixed bug #37614 "Errors from + ipX_output are not processed". Now tcp_output(_segment) checks for the return + value of ipX_output and does not try to send more on error. A netif driver + can call tcp_txnow() (from tcpip_thread!) to try to send again if TX buffers + are available again. + + 2015-02-14: patches by Freddie Chopin + * snmp*: made community writable, fixed some const pointers + + 2015-02-13: Simon Goldschmidt + * msg_in.c: fixed bug #22070 "MIB_OBJECT_WRITE_ONLY not implemented in SNMP" + + 2015-02-12: Simon Goldschmidt + * ip.h, ip4.c, ip6.c: fixed bug #36403 "ip4_input() and ip6_input() always pass + inp to higher layers": now the accepting netif is passed up, but the input + netif is available through ip_current_input_netif() if required. + + 2015-02-11: patch by hichard + * tcpip.c: fixed bug #43094 "The function tcpip_input() forget to handle IPv6" + + 2015-02-10: Simon Goldschmidt + * netconn API: fixed that netconn_close/netconn_delete still used message passing + for LWIP_TCPIP_CORE_LOCKING==1 + + 2015-02-10: Simon Goldschmidt + * netconn/socket api: fixed bug #44225 "closing TCP socket should time out + eventually", implemented task #6930 "Implement SO_LINGER": closing TCP sockets + times out after 20 seconds or after the configured SND_TIMEOUT or depending + on the linger settings. + + 2015-01-27: Simon Goldschmidt + * api_msg.c: fixed that SHUT_RD followed by SHUT_WR was different to SHUT_RDWR, + fixed return value of lwip_netconn_do_close on unconnected netconns + + 2015-01-17: Simon Goldschmidt + * sockets.c: fixed bug #43361 select() crashes with stale FDs + + 2015-01-17: Simon Goldschmidt + * sockets.c/.h, memp_std.h: fixed bug #40788 "lwip_setsockopt_internal() crashes" + by rewriting set/getsockopt functions to combine checks with the actual code + and add more NULL checks; this also fixes that CORE_LOCKING used message + passing for set/getsockopt. + + 2014-12-19: Simon Goldschmidt + * opt.h, dhcp.h/.c: prevent dhcp from starting when netif link is down (only + when LWIP_DHCP_CHECK_LINK_UP==1, which is disabled by default for + compatibility reasons) + + 2014-12-17: Simon Goldschmidt + * tcp_out.c: fixed bug #43840 Checksum error for TCP_CHECKSUM_ON_COPY==1 for + no-copy data with odd length + + 2014-12-10: Simon Goldschmidt + * sockets.c, tcp.c, others: fixed bug #43797 set/getsockopt: SO_SNDTIMEO/SO_RCVTIMEO + take int as option but should take timeval (LWIP_SO_SNDRCVTIMEO_STANDARD==0 can + be used to revert to the old 'winsock' style behaviour) + Fixed implementation of SO_ACCEPTCONN to just look at the pcb state + + 2014-12-09: Simon Goldschmidt + * ip4.c: fixed bug #43596 IGMP queries from 0.0.0.0 are discarded + + 2014-10-21: Simon Goldschmidt (patch by Joel Cunningham and Albert Huitsing) + * sockts.c: fixed bugs #41495 Possible threading issue in select() and #43278 + event_callback() handle context switch when calling sys_sem_signal() + + 2014-10-21: Simon Goldschmidt + * api_msg.c: fixed bug #38219 Assert on TCP netconn_write with sndtimeout set + + 2014-09-16: Kevin Cernekee + * dns.c: patch #8480 Fix handling of dns_seqno wraparound + + 2014-09-16: Simon Goldschmidt + * tcp_out.c: fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN + when sending FIN + + 2014-09-03: Simon Goldschmidt + * msg_in.c: fixed bug #39355 SNMP Memory Leak in case of error + + 2014-09-02: Simon Goldschmidt + * err.h/.c, sockets.c, api_msg.c: fixed bug #43110 call getpeername() before + listen() will cause a error + + 2014-09-02: Simon Goldschmidt + * sockets.c: fixed bug #42117 lwip_fcntl does not set errno + + 2014-09-02: Simon Goldschmidt + * tcp.c: fixed bug #42299 tcp_abort() leaves freed pcb on tcp_bound_pcbs list + + 2014-08-20: Simon Goldschmidt + * dns.c: fixed bug #42987 lwIP is vulnerable to DNS cache poisoning due to + non-randomized TXIDs + + 2014-06-03: Simon Goldschmidt + * tcp_impl.h, tcp_in.c: fixed bug #37969 SYN packet dropped as short packet in + tcp_input function + + 2014-05-20: Simon Goldschmidt + * tcp_out.c: fixed bug #37184 tcp_write problem for pcbs in the SYN_SENT state + + 2014-05-19: Simon Goldschmidt + * *.h: Fixed bug #35874 reserved identifier violation (removed leading underscores + from header include guards) + + 2014-04-08: Simon Goldschmidt + * tcp.c: Fixed bug #36167 tcp server crash when client closes (maximum window) + + 2014-04-06: Simon Goldschmidt + * tcp_in.c: Fixed bug #36210 lwIP does not elicit an empty ACK when received + unacceptable ACK + + 2014-04-06: Simon Goldschmidt + * dhcp.c, ip4.c/.h, ip6.c/.h, udp.c/.h, ip.h: Fixed bug #41787 DHCP Discovery + is invalid when an IP is set to thet netif. + + 2014-03-14: Simon Goldschmidt + * tcp_out.c: Fixed bug #36153 TCP Cheksum error if LWIP_CHECKSUM_ON_COPY=1 + + 2014-03-11: Simon Goldschmidt (patch by Mason) + * opt.h, sockets.c: fixed bug #35928 BSD sockets functions must set errno for + POSIX-compliance + + 2014-02-27: Simon Goldschmidt + * dhcp.c: fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST + + 2014-02-27: Simon Goldschmidt + * raw.c: fixed bug #41680 raw socket can not receive IPv6 packet when + IP_SOF_BROADCAST_RECV==1 + + 2014-02-27: Simon Goldschmidt + * api_msg.c, sockets.c: fixed bug #38404 getpeeraddr returns success on + unconnected/listening TCP sockets + + 2014-02-27: Simon Goldschmidt + * sockets.c: fixed bug #41729 Some socket functions return Exyz instead of -1 + + 2014-02-25: Simon Goldschmidt + * ip4.c: fixed bug #39514 ip_route() may return an IPv6-only interface + + 2014-02-25: Simon Goldschmidt, patch by Fatih Asici + * pbuf.c: fixed bug #39356 Wrong increment in pbuf_memfind() + + 2014-02-25: Simon Goldschmidt + * netif.c/.h, udp.c: fixed bug #39225 udp.c uses netif_matches_ip6_addr() incorrectly; + renamed function netif_matches_ip6_addr() to netif_get_ip6_addr_match() + + 2014-02-25: Simon Goldschmidt + * igmp.c: fixed bug #39145 IGMP membership report for 224.0.0.1 + + 2014-02-22: Simon Goldschmidt (patch by Amir Shalem) + * etharp.c, opt.h: fixed bug #34681 Limit ARP queue length by ARP_QUEUE_LEN (=3) + + 2014-02-22: Simon Goldschmidt (patch by Amir Shalem) + * etharp.h/.c: fixed bug #34682 Limit ARP request flood for unresolved entry + + 2014-02-20: Simon Goldschmidt + * tcp_out.c: fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with + MEM_ALIGNMENT = 8 + + 2014-02-20: Simon Goldschmidt + * sockets.c: fixed bug #39882 No function shall set errno to 0 + + 2014-02-20: Simon Goldschmidt + * mib_structs.c: fixed bug #40050 SNMP problem with MIB arrays > 255 + + 2014-02-20: Simon Goldschmidt + * api.h, sockets.c: fixed bug #41499 netconn::recv_avail can overflow + + 2014-01-08: Stathis Voukelatos + * memp_std.h: patch #7928 Fixed size calculation in MALLOC memory pool + creation macro + + 2014-01-18: Brian Fahs + * tcp_out.c: patch #8237: tcp_rexmit_rto fails to update pcb->unsent_oversize + when necessary + + 2014-01-17: Grant Erickson, Jay Logue, Simon Goldschmidt + * ipv6.c, netif.c: patch #7913 Enable Support for IPv6 Loopback + + 2014-01-16: Stathis Voukelatos + * netif.c: patch #7902 Fixed netif_poll() operation when LWIP_LOOPBACK_MAX_PBUFS > 0 + + 2014-01-14: "Freddie Chopin" + * snmp.h, mib2.c: fixed constness and spelling of sysdescr + + 2014-01-14: Simon Goldschmidt (patch by Thomas Faber) + * tcpip.c: patch #8241: Fix implicit declaration of ip_input with + LWIP_TCPIP_CORE_LOCKING_INPUT disabled + + 2014-01-14: chrysn + * timers.c: patch #8244 make timeouts usable reliably from outside of the + timeout routine + + 2014-01-10: Simon Goldschmidt + * ip_frag.c, ip6_frag.c: fixed bug #41041 Potential use-after-free in IPv6 reassembly + + 2014-01-10: Simon Goldschmidt + * memp.c: fixed bug #41188 Alignment error in memp_init() when MEMP_SEPARATE_POOLS==1 + + 2014-01-10: Simon Goldschmidt + * tcp.c: fixed bug #39898 tcp_fasttmr() possible lock due to infinte queue process loop + + 2013-06-29: Simon Goldschmidt + * inet.h, sockets.h: partially fixed bug #37585: IPv6 compatibility (in socket structs) + + 2013-06-29: Simon Goldschmidt + * inet6.h: bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec + + 2013-04-24: patch by Liam + * api_msg.c: patch #8008 Fix a potential null pointer dereference in assert + + 2013-04-24: Simon Goldschmidt + * igmp.c: fixed possible division by zero + + 2013-04-24: Simon Goldschmidt + * ip6.h, some ipv6 C files: fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h + + 2013-04-24: Simon Goldschmidt (patch by Emil Ljungdahl): + * netif.c: fixed bug #38586 netif_loop_output() "deadlocks" + + 2013-01-15: Simon Goldschmidt + * ip4.c: fixed bug #37665 ip_canforward operates on address in wrong byte order + + 2013-01-15: Simon Goldschmidt + * pbuf.h: fixed bug #38097 pbuf_free_ooseq() warning + + 2013-01-14: Simon Goldschmidt + * dns.c: fixed bug #37705 Possible memory corruption in DNS query + + 2013-01-11: Simon Goldschmidt + * raw.c: fixed bug #38066 Raw pcbs can alter packet without eating it + + 2012-08-22: Simon Goldschmidt + * memp.c: fixed bug #37166: memp_sanity check loops itself + + 2012-08-13: Simon Goldschmidt + * dhcp.c: fixed bug #36645: Calling dhcp_release before dhcp_start + dereferences NULL + + 2012-08-13: Simon Goldschmidt + * msg_out.c: fixed bug #36840 snmp_send_trap() NULL de-reference if traps + configured but no interfaces available + + 2012-08-13: Simon Goldschmidt + * dns.c: fixed bug #36899 DNS TTL 0 is cached for a long time + + 2012-05-11: Simon Goldschmidt (patch by Marty) + * memp.c: fixed bug #36412: memp.c does not compile when + MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1 + + 2012-05-03: Simon Goldschmidt (patch by Sylvain Rochet) + * ppp.c: fixed bug #36283 (PPP struct used on header size computation and + not packed) + + 2012-05-03: Simon Goldschmidt (patch by David Empson) + * ppp.c: fixed bug #36388 (PPP: checksum-only in last pbuf leads to pbuf with + zero length) + + 2012-03-25: Simon Goldschmidt + * api_msg.c: Fixed bug #35817: do_connect() invalidly signals op_completed + for UDP/RAW with LWIP_TCPIP_CORE_LOCKING==1 + + 2012-03-25: Simon Goldschmidt + * api_msg.h, api_lib.c, api_msg.c, netifapi.c: fixed bug #35931: Name space + pollution in api_msg.c and netifapi.c + + 2011-08-24: Simon Goldschmidt + * inet6.h: fixed bug #34124 struct in6_addr does not conform to the standard + + + +(STABLE-1.4.1) + + ++ New features: + + 2012-03-25: Simon Goldschmidt (idea by Mason) + * posix/*: added posix-compatibility include files posix/netdb.h and posix/sys/socket.h + which are a simple wrapper to the correct lwIP include files. + + 2012-01-16: Simon Goldschmidt + * opt.h, icmp.c: Added option CHECKSUM_GEN_ICMP + + 2011-12-17: Simon Goldschmidt + * ip.h: implemented API functions to access so_options of IP pcbs (UDP, TCP, RAW) + (fixes bug #35061) + + 2011-09-27: Simon Goldschmidt + * opt.h, tcp.c, tcp_in.c: Implemented limiting data on ooseq queue (task #9989) + (define TCP_OOSEQ_MAX_BYTES / TCP_OOSEQ_MAX_PBUFS in lwipopts.h) + + 2011-09-21: Simon Goldschmidt + * opt.h, api.h, api_lib.c, api_msg.h/.c, sockets.c: Implemented timeout on + send (TCP only, bug #33820) + + 2011-09-21: Simon Goldschmidt + * init.c: Converted runtime-sanity-checks into compile-time checks that can + be disabled (since runtime checks can often not be seen on embedded targets) + + 2011-09-11: Simon Goldschmidt + * ppp.h, ppp_impl.h: splitted ppp.h to an internal and external header file + to get a clear separation of which functions an application or port may use + (task #11281) + + 2011-09-11: Simon Goldschmidt + * opt.h, tcp_impl.h, tcp.c, udp.h/.c: Added a config option to randomize + initial local TCP/UDP ports (so that different port ranges are used after + a reboot; bug #33818; this one added tcp_init/udp_init functions again) + + 2011-09-03: Simon Goldschmidt + * dhcp.c: DHCP uses LWIP_RAND() for xid's (bug #30302) + + 2011-08-24: Simon Goldschmidt + * opt.h, netif.h/.c: added netif remove callback (bug #32397) + + 2011-07-26: Simon Goldschmidt + * etharp.c: ETHARP_SUPPORT_VLAN: add support for an external VLAN filter + function instead of only checking for one VLAN (define ETHARP_VLAN_CHECK_FN) + + 2011-07-21: Simon Goldschmidt (patch by hanhui) + * ip4.c, etharp.c, pbuf.h: bug #33634 ip_forward() have a faulty behaviour: + Added pbuf flags to mark incoming packets as link-layer broadcast/multicast. + Also added code to allow ip_forward() to forward non-broadcast packets to + the input netif (set IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1). + + 2011-06-26: Simon Goldschmidt (patch by Cameron Gutman) + * tcp.c, tcp_out.c: bug #33604: added some more asserts to check that + pcb->state != LISTEN + + 2011-05-14: Simon Goldschmidt (patch by Stéphane Lesage) + * tcpip.c/.h: patch #7449 allow tcpip callback from interrupt with static + memory message + + + ++ Bugfixes: + + 2012-09-26: Simon Goldschmidt + * api_msg.c: fixed bug #37405 'err_tcp()' uses already freed 'netconn' object + + 2012-09-26: patch by Henrik Persson + * dhcp.c: patch #7843 Fix corner case with dhcp timeouts + + 2012-09-26: patch by Henrik Persson + * dhcp.c: patch #7840 Segfault in dhcp_parse_reply if no end marker in dhcp packet + + 2012-08-22: Simon Goldschmidt + * memp.c: fixed bug #37166: memp_sanity check loops itself + + 2012-05-08: Simon Goldschmidt + * tcp_out.c: fixed bug: #36380 unsent_oversize mismatch in 1.4.1RC1 (this was + a debug-check issue only) + + 2012-03-27: Simon Goldschmidt + * vj.c: fixed bug #35756 header length calculation problem in ppp/vj.c + + 2012-03-27: Simon Goldschmidt (patch by Mason) + * tcp_out.c: fixed bug #35945: SYN packet should provide the recv MSS not the + send MSS + + 2012-03-22: Simon Goldschmidt + * ip4.c: fixed bug #35927: missing refragmentaion in ip_forward + + 2012-03-20: Simon Goldschmidt (patch by Mason) + * netdb.c: fixed bug #35907: lwip_gethostbyname_r returns an invalid h_addr_list + + 2012-03-12: Simon Goldschmidt (patch by Bostjan Meglic) + * ppp.c: fixed bug #35809: PPP GetMask(): Compiler warning on big endian, + possible bug on little endian system + + 2012-02-23: Simon Goldschmidt + * etharp.c: fixed bug #35595: Impossible to send broadcast without a gateway + (introduced when fixing bug# 33551) + + 2012-02-16: Simon Goldschmidt + * ppp.c: fixed pbuf leak when PPP session is aborted through pppSigHUP() + (bug #35541: PPP Memory Leak) + + 2012-02-16: Simon Goldschmidt + * etharp.c: fixed bug #35531: Impossible to send multicast without a gateway + (introduced when fixing bug# 33551) + + 2012-02-16: Simon Goldschmidt (patch by Stéphane Lesage) + * msg_in.c, msg_out.c: fixed bug #35536 SNMP: error too big response is malformed + + 2012-02-15: Simon Goldschmidt + * init.c: fixed bug #35537: MEMP_NUM_* sanity checks should be disabled with + MEMP_MEM_MALLOC==1 + + 2012-02-12: Simon Goldschmidt + * tcp.h, tcp_in.c, tcp_out.c: partly fixed bug #25882: TCP hangs on + MSS > pcb->snd_wnd (by not creating segments bigger than half the window) + + 2012-02-11: Simon Goldschmidt + * tcp.c: fixed bug #35435: No pcb state check before adding it to time-wait + queue while closing + + 2012-01-22: Simon Goldschmidt + * tcp.c, tcp_in.c: fixed bug #35305: pcb may be freed too early on shutdown(WR) + + 2012-01-21: Simon Goldschmidt + * tcp.c: fixed bug #34636: FIN_WAIT_2 - Incorrect shutdown of TCP pcb + + 2012-01-20: Simon Goldschmidt + * dhcp.c: fixed bug #35151: DHCP asserts on incoming option lengths + + 2012-01-20: Simon Goldschmidt + * pbuf.c: fixed bug #35291: NULL pointer in pbuf_copy + + 2011-11-25: Simon Goldschmidt + * tcp.h/.c, tcp_impl.h, tcp_in.c: fixed bug #31177: tcp timers can corrupt + tcp_active_pcbs in some cases + + 2011-11-23: Simon Goldschmidt + * sys.c: fixed bug #34884: sys_msleep() body needs to be surrounded with + '#ifndef sys_msleep' + + 2011-11-22: Simon Goldschmidt + * netif.c, etharp.h/.c: fixed bug #34684: Clear the arp table cache when + netif is brought down + + 2011-10-28: Simon Goldschmidt + * tcp_in.c: fixed bug #34638: Dead code in tcp_receive - pcb->dupacks + + 2011-10-23: Simon Goldschmidt + * mem.c: fixed bug #34429: possible memory corruption with + LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT set to 1 + + 2011-10-18: Simon Goldschmidt + * arch.h, netdb.c: fixed bug #34592: lwip_gethostbyname_r uses nonstandard + error value + + 2011-10-18: Simon Goldschmidt + * opt.h: fixed default values of TCP_SNDLOWAT and TCP_SNDQUEUELOWAT for small + windows (bug #34176 select after non-blocking send times out) + + 2011-10-18: Simon Goldschmidt + * tcp_impl.h, tcp_out.c: fixed bug #34587: TCP_BUILD_MSS_OPTION doesn't + consider netif->mtu, causes slow network + + 2011-10-18: Simon Goldschmidt + * sockets.c: fixed bug #34581 missing parentheses in udplite sockets code + + 2011-10-18: Simon Goldschmidt + * sockets.h: fixed bug #34580 fcntl() is missing in LWIP_COMPAT_SOCKETS + + 2011-10-17: Simon Goldschmidt + * api_msg.c: fixed bug #34569: shutdown(SHUT_WR) crashes netconn/socket api + + 2011-10-13: Simon Goldschmidt + * tcp_in.c, tcp_out.c: fixed bug #34517 (persist timer is started although no + zero window is received) by starting the persist timer when a zero window is + received, not when we have more data queued for sending than fits into the + window + + 2011-10-13: Simon Goldschmidt + * def.h, timers.c: fixed bug #34541: LWIP_U32_DIFF is unnecessarily complex + + 2011-10-13: Simon Goldschmidt + * sockets.c, api_lib.c: fixed bug #34540: compiler error when CORE_LOCKING is + used and not all protocols are enabled + + 2011-10-12: Simon Goldschmidt + * pbuf.c: fixed bug #34534: Error in sending fragmented IP if MEM_ALIGNMENT > 4 + + 2011-10-09: Simon Goldschmidt + * tcp_out.c: fixed bug #34426: tcp_zero_window_probe() transmits incorrect + byte value when pcb->unacked != NULL + + 2011-10-09: Simon Goldschmidt + * ip4.c: fixed bug #34447 LWIP_IP_ACCEPT_UDP_PORT(dst_port) wrong + + 2011-09-27: Simon Goldschmidt + * tcp_in.c, tcp_out.c: Reset pcb->unsent_oversize in 2 more places... + + 2011-09-27: Simon Goldschmidt + * tcp_in.c: fixed bug #28288: Data after FIN in oos queue + + 2011-09-27: Simon Goldschmidt + * dhcp.c: fixed bug #34406 dhcp_option_hostname() can overflow the pbuf + + 2011-09-24: Simon Goldschmidt + * mem.h: fixed bug #34377 MEM_SIZE_F is not defined if MEM_LIBC_MALLOC==1 + + 2011-09-23: Simon Goldschmidt + * pbuf.h, tcp.c, tcp_in.c: fixed bug #33871: rejecting TCP_EVENT_RECV() for + the last packet including FIN can lose data + + 2011-09-22: Simon Goldschmidt + * tcp_impl.h: fixed bug #34355: nagle does not take snd_buf/snd_queuelen into + account + + 2011-09-21: Simon Goldschmidt + * opt.h: fixed default value of TCP_SND_BUF to not violate the sanity checks + in init.c + + 2011-09-20: Simon Goldschmidt + * timers.c: fixed bug #34337 (possible NULL pointer in sys_check_timeouts) + + 2011-09-11: Simon Goldschmidt + * tcp_out.c: use pcb->mss instead of TCP_MSS for preallocate mss-sized pbufs + (bug #34019) + + 2011-09-09: Simon Goldschmidt + * udp.c: fixed bug #34072: UDP broadcast is received from wrong UDP pcb if + udp port matches + + 2011-09-03: Simon Goldschmidt + * tcp_in.c: fixed bug #33952 PUSH flag in incoming packet is lost when packet + is aggregated and sent to application + + 2011-09-01: Simon Goldschmidt + * opt.h: fixed bug #31809 LWIP_EVENT_API in opts.h is inconsistent compared + to other options + + 2011-09-01: Simon Goldschmidt + * tcp_in.c: fixed bug #34111 RST for ACK to listening pcb has wrong seqno + + 2011-08-24: Simon Goldschmidt + * api_msg.c, sockets.c: fixed bug #33956 Wrong error returned when calling + accept() on UDP connections + + 2011-08-24: Simon Goldschmidt + * sockets.h: fixed bug #34057 socklen_t should be a typedef + + 2011-08-24: Simon Goldschmidt + * pbuf.c: fixed bug #34112 Odd check in pbuf_alloced_custom (typo) + + 2011-08-24: Simon Goldschmidt + * dhcp.c: fixed bug #34122 dhcp: hostname can overflow + + 2011-08-24: Simon Goldschmidt + * netif.c: fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr + + 2011-08-22: Simon Goldschmidt + * tcp_out.c: fixed bug #33962 TF_FIN not always set after FIN is sent. (This + merely prevents nagle from not transmitting fast after closing.) + + 2011-07-22: Simon Goldschmidt + * api_lib.c, api_msg.c, sockets.c, api.h: fixed bug #31084 (socket API returns + always EMSGSIZE on non-blocking sockets if data size > send buffers) -> now + lwip_send() sends as much as possible for non-blocking sockets + + 2011-07-22: Simon Goldschmidt + * pbuf.c/.h, timers.c: freeing ooseq pbufs when the pbuf pool is empty implemented + for NO_SYS==1: when not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() + at regular intervals from main level. + + 2011-07-21: Simon Goldschmidt + * etharp.c: fixed bug #33551 (ARP entries may time out although in use) by + sending an ARP request when an ARP entry is used in the last minute before + it would time out. + + 2011-07-04: Simon Goldschmidt + * sys_arch.txt: Fixed documentation after changing sys arch prototypes for 1.4.0. + + 2011-06-26: Simon Goldschmidt + * tcp.c: fixed bug #31723 (tcp_kill_prio() kills pcbs with the same prio) by + updating its documentation only. + + 2011-06-26: Simon Goldschmidt + * mem.c: fixed bug #33545: With MEM_USE_POOLS==1, mem_malloc can return an + unaligned pointer. + + 2011-06-26: Simon Goldschmidt + * mem.c: fixed bug #33544 "warning in mem.c in lwip 1.4.0 with NO_SYS=1" + + 2011-05-25: Simon Goldschmidt + * tcp.c: fixed bug #33398 (pointless conversion when checking TCP port range) + + + +(STABLE-1.4.0) + + ++ New features: + + 2011-03-27: Simon Goldschmidt + * tcp_impl.h, tcp_in.c, tcp_out.c: Removed 'dataptr' from 'struct tcp_seg' and + calculate it in tcp_zero_window_probe (the only place where it was used). + + 2010-11-21: Simon Goldschmidt + * dhcp.c/.h: Added a function to deallocate the struct dhcp from a netif + (fixes bug #31525). + + 2010-07-12: Simon Goldschmidt (patch by Stephane Lesage) + * ip.c, udp.c/.h, pbuf.h, sockets.c: task #10495: Added support for + IP_MULTICAST_LOOP at socket- and raw-API level. + + 2010-06-16: Simon Goldschmidt + * ip.c: Added an optional define (LWIP_IP_ACCEPT_UDP_PORT) that can allow + link-layer-addressed UDP traffic to be received while a netif is down (just + like DHCP during configuration) + + 2010-05-22: Simon Goldschmidt + * many many files: bug #27352: removed packing from ip_addr_t, the packed + version is now only used in protocol headers. Added global storage for + current src/dest IP address while in input functions. + + 2010-05-16: Simon Goldschmidt + * def.h: task #10391: Add preprocessor-macros for compile-time htonl + calculation (and use them throughout the stack where applicable) + + 2010-05-16: Simon Goldschmidt + * opt.h, memp_std.h, memp.c, ppp_oe.h/.c: PPPoE now uses its own MEMP pool + instead of the heap (moved struct pppoe_softc from ppp_oe.c to ppp_oe.h) + + 2010-05-16: Simon Goldschmidt + * opt.h, memp_std.h, dns.h/.c: DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses its own + MEMP pool instead of the heap + + 2010-05-13: Simon Goldschmidt + * tcp.c, udp.c: task #6995: Implement SO_REUSEADDR (correctly), added + new option SO_REUSE_RXTOALL to pass received UDP broadcast/multicast + packets to more than one pcb. + + 2010-05-02: Simon Goldschmidt + * netbuf.h/.c, sockets.c, api_msg.c: use checksum-on-copy for sending + UDP data for LWIP_NETIF_TX_SINGLE_PBUF==1 + + 2010-04-30: Simon Goldschmidt + * udp.h/.c, pbuf.h/.c: task #6849: added udp_send(_to/_if) functions that + take a precalculated checksum, added pbuf_fill_chksum() to copy data + into a pbuf and at the same time calculating the checksum for that data + + 2010-04-29: Simon Goldschmidt + * ip_addr.h, etharp.h/.c, autoip.c: Create overridable macros for copying + 2-byte-aligned IP addresses and MAC addresses + + 2010-04-28: Patch by Bill Auerbach + * ip.c: Inline generating IP checksum to save a function call + + 2010-04-14: Simon Goldschmidt + * tcpip.h/.c, timers.c: Added an overridable define to get informed when the + tcpip_thread processes messages or timeouts to implement a watchdog. + + 2010-03-28: Simon Goldschmidt + * ip_frag.c: create a new (contiguous) PBUF_RAM for every outgoing + fragment if LWIP_NETIF_TX_SINGLE_PBUF==1 + + 2010-03-27: Simon Goldschmidt + * etharp.c: Speedup TX by moving code from find_entry to etharp_output/ + etharp_query to prevent unnecessary function calls (inspired by + patch #7135). + + 2010-03-20: Simon Goldschmidt + * opt.h, tcpip.c/.h: Added an option to disable tcpip_(un)timeout code + since the linker cannot do this automatically to save space. + + 2010-03-20: Simon Goldschmidt + * opt.h, etharp.c/.h: Added support for static ARP table entries + + 2010-03-14: Simon Goldschmidt + * tcp_impl.h, tcp_out.c, inet_chksum.h/.c: task #6849: Calculate checksum + when creating TCP segments, not when (re-)transmitting them. + + 2010-03-07: Simon Goldschmidt + * sockets.c: bug #28775 (select/event_callback: only check select_cb_list + on change) plus use SYS_LIGHTWEIGHT_PROT to protect the select code. + This should speed up receiving data on sockets as the select code in + event_callback is only executed when select is waiting. + + 2010-03-06: Simon Goldschmidt + * tcp_out.c: task #7013 (Create option to have all packets delivered to + netif->output in one piece): Always copy to try to create single pbufs + in tcp_write. + + 2010-03-06: Simon Goldschmidt + * api.h, api_lib.c, sockets.c: task #10167 (sockets: speed up TCP recv + by not allocating a netbuf): added function netconn_recv_tcp_pbuf() + for tcp netconns to receive pbufs, not netbufs; use that function + for tcp sockets. + + 2010-03-05: Jakob Ole Stoklundsen / Simon Goldschmidt + * opt.h, tcp.h, tcp_impl.h, tcp.c, tcp_in.c, tcp_out.c: task #7040: + Work on tcp_enqueue: Don't waste memory when chaining segments, + added option TCP_OVERSIZE to prevent creating many small pbufs when + calling tcp_write with many small blocks of data. Instead, pbufs are + allocated larger than needed and the space is used for later calls to + tcp_write. + + 2010-02-21: Simon Goldschmidt + * stats.c/.h: Added const char* name to mem- and memp-stats for easier + debugging. + + 2010-02-21: Simon Goldschmidt + * tcp.h (and usages), added tcp_impl.h: Splitted API and internal + implementation of tcp to make API usage cleare to application programmers + + 2010-02-14: Simon Goldschmidt/Stephane Lesage + * ip_addr.h: Improved some defines working on ip addresses, added faster + macro to copy addresses that cannot be NULL + + 2010-02-13: Simon Goldschmidt + * api.h, api_lib.c, api_msg.c, sockets.c: task #7865 (implement non- + blocking send operation) + + 2010-02-12: Simon Goldschmidt + * sockets.c/.h: Added a minimal version of posix fctl() to have a + standardised way to set O_NONBLOCK for nonblocking sockets. + + 2010-02-12: Simon Goldschmidt + * dhcp.c/.h, autoip.c/.h: task #10139 (Prefer statically allocated + memory): added autoip_set_struct() and dhcp_set_struct() to let autoip + and dhcp work with user-allocated structs instead of callin mem_malloc + + 2010-02-12: Simon Goldschmidt/Jeff Barber + * tcp.c/h: patch #6865 (SO_REUSEADDR for TCP): if pcb.so_options has + SOF_REUSEADDR set, allow binding to endpoint in TIME_WAIT + + 2010-02-12: Simon Goldschmidt + * sys layer: task #10139 (Prefer statically allocated memory): converted + mbox and semaphore functions to take pointers to sys_mbox_t/sys_sem_t; + converted sys_mbox_new/sys_sem_new to take pointers and return err_t; + task #7212: Add Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX + to let sys.h use binary semaphores instead of mutexes - as before) + + 2010-02-09: Simon Goldschmidt (Simon Kallweit) + * timers.c/.h: Added function sys_restart_timeouts() from patch #7085 + (Restart system timeout handling) + + 2010-02-09: Simon Goldschmidt + * netif.c/.h, removed loopif.c/.h: task #10153 (Integrate loopif into + netif.c) - loopif does not have to be created by the port any more, + just define LWIP_HAVE_LOOPIF to 1. + + 2010-02-08: Simon Goldschmidt + * inet.h, ip_addr.c/.h: Added reentrant versions of inet_ntoa/ipaddr_ntoa + inet_ntoa_r/ipaddr_ntoa_r + + 2010-02-08: Simon Goldschmidt + * netif.h: Added netif_s/get_igmp_mac_filter() macros + + 2010-02-05: Simon Goldschmidt + * netif.h: Added function-like macros to get/set the hostname on a netif + + 2010-02-04: Simon Goldschmidt + * nearly every file: Replaced struct ip_addr by typedef ip_addr_t to + make changing the actual implementation behind the typedef easier. + + 2010-02-01: Simon Goldschmidt + * opt.h, memp_std.h, dns.h, netdb.c, memp.c: Let netdb use a memp pool + for allocating memory when getaddrinfo() is called. + + 2010-01-31: Simon Goldschmidt + * dhcp.h, dhcp.c: Reworked the code that parses DHCP options: parse + them once instead of parsing for every option. This also removes + the need for mem_malloc from dhcp_recv and makes it possible to + correctly retrieve the BOOTP file. + + 2010-01-30: simon Goldschmidt + * sockets.c: Use SYS_LIGHTWEIGHT_PROT instead of a semaphore to protect + the sockets array. + + 2010-01-29: Simon Goldschmidt (patch by Laura Garrett) + * api.h, api_msg.c, sockets.c: Added except set support in select + (patch #6860) + + 2010-01-29: Simon Goldschmidt (patch by Laura Garrett) + * api.h, sockets.h, err.h, api_lib.c, api_msg.c, sockets.c, err.c: + Add non-blocking support for connect (partly from patch #6860), + plus many cleanups in socket & netconn API. + + 2010-01-27: Simon Goldschmidt + * opt.h, tcp.h, init.c, api_msg.c: Added TCP_SNDQUEUELOWAT corresponding + to TCP_SNDLOWAT and added tcp_sndqueuelen() - this fixes bug #28605 + + 2010-01-26: Simon Goldschmidt + * snmp: Use memp pools for snmp instead of the heap; added 4 new pools. + + 2010-01-14: Simon Goldschmidt + * ppp.c/.h: Fixed bug #27856: PPP: Set netif link- and status-callback + by adding ppp_set_netif_statuscallback()/ppp_set_netif_linkcallback() + + 2010-01-13: Simon Goldschmidt + * mem.c: The heap now may be moved to user-defined memory by defining + LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address + (patch #6966 and bug #26133) + + 2010-01-10: Simon Goldschmidt (Bill Auerbach) + * opt.h, memp.c: patch #6822 (Add option to place memory pools in + separate arrays) + + 2010-01-10: Simon Goldschmidt + * init.c, igmp.c: patch #6463 (IGMP - Adding Random Delay): added define + LWIP_RAND() for lwip-wide randomization (to be defined in cc.h) + + 2009-12-31: Simon Goldschmidt + * tcpip.c, init.c, memp.c, sys.c, memp_std.h, sys.h, tcpip.h + added timers.c/.h: Separated timer implementation from semaphore/mbox + implementation, moved timer implementation to timers.c/.h, timers are + now only called from tcpip_thread or by explicitly checking them. + (TASK#7235) + + 2009-12-27: Simon Goldschmidt + * opt.h, etharp.h/.c, init.c, tcpip.c: Added an additional option + LWIP_ETHERNET to support ethernet without ARP (necessary for pure PPPoE) + + + ++ Bugfixes: + + 2011-04-20: Simon Goldschmidt + * sys_arch.txt: sys_arch_timeouts() is not needed any more. + + 2011-04-13: Simon Goldschmidt + * tcp.c, udp.c: Fixed bug #33048 (Bad range for IP source port numbers) by + using ports in the IANA private/dynamic range (49152 through 65535). + + 2011-03-29: Simon Goldschmidt, patch by Emil Lhungdahl: + * etharp.h/.c: Fixed broken VLAN support. + + 2011-03-27: Simon Goldschmidt + * tcp.c: Fixed bug #32926 (TCP_RMV(&tcp_bound_pcbs) is called on unbound tcp + pcbs) by checking if the pcb was bound (local_port != 0). + + 2011-03-27: Simon Goldschmidt + * ppp.c: Fixed bug #32280 (ppp: a pbuf is freed twice) + + 2011-03-27: Simon Goldschmidt + * sockets.c: Fixed bug #32906: lwip_connect+lwip_send did not work for udp and + raw pcbs with LWIP_TCPIP_CORE_LOCKING==1. + + 2011-03-27: Simon Goldschmidt + * tcp_out.c: Fixed bug #32820 (Outgoing TCP connections created before route + is present never times out) by starting retransmission timer before checking + route. + + 2011-03-22: Simon Goldschmidt + * ppp.c: Fixed bug #32648 (PPP code crashes when terminating a link) by only + calling sio_read_abort() if the file descriptor is valid. + + 2011-03-14: Simon Goldschmidt + * err.h/.c, sockets.c, api_msg.c: fixed bug #31748 (Calling non-blocking connect + more than once can render a socket useless) since it mainly involves changing + "FATAL" classification of error codes: ERR_USE and ERR_ISCONN just aren't fatal. + + 2011-03-13: Simon Goldschmidt + * sockets.c: fixed bug #32769 (ESHUTDOWN is linux-specific) by fixing + err_to_errno_table (ERR_CLSD: ENOTCONN instead of ESHUTDOWN), ERR_ISCONN: + use EALRADY instead of -1 + + 2011-03-13: Simon Goldschmidt + * api_lib.c: netconn_accept: return ERR_ABRT instead of ERR_CLSD if the + connection has been aborted by err_tcp (since this is not a normal closing + procedure). + + 2011-03-13: Simon Goldschmidt + * tcp.c: tcp_bind: return ERR_VAL instead of ERR_ISCONN when trying to bind + with pcb->state != CLOSED + + 2011-02-17: Simon Goldschmidt + * rawapi.txt: Fixed bug #32561 tcp_poll argument definition out-of-order in + documentation + + 2011-02-17: Simon Goldschmidt + * many files: Added missing U/UL modifiers to fix 16-bit-arch portability. + + 2011-01-24: Simon Goldschmidt + * sockets.c: Fixed bug #31741: lwip_select seems to have threading problems + + 2010-12-02: Simon Goldschmidt + * err.h: Fixed ERR_IS_FATAL so that ERR_WOULDBLOCK is not fatal. + + 2010-11-23: Simon Goldschmidt + * api.h, api_lib.c, api_msg.c, sockets.c: netconn.recv_avail is only used for + LWIP_SO_RCVBUF and ioctl/FIONREAD. + + 2010-11-23: Simon Goldschmidt + * etharp.c: Fixed bug #31720: ARP-queueing: RFC 1122 recommends to queue at + least 1 packet -> ARP_QUEUEING==0 now queues the most recent packet. + + 2010-11-23: Simon Goldschmidt + * tcp_in.c: Fixed bug #30577: tcp_input: don't discard ACK-only packets after + refusing 'refused_data' again. + + 2010-11-22: Simon Goldschmidt + * sockets.c: Fixed bug #31590: getsockopt(... SO_ERROR ...) gives EINPROGRESS + after a successful nonblocking connection. + + 2010-11-22: Simon Goldschmidt + * etharp.c: Fixed bug #31722: IP packets sent with an AutoIP source addr + must be sent link-local + + 2010-11-22: Simon Goldschmidt + * timers.c: patch #7329: tcp_timer_needed prototype was ifdef'ed out for + LWIP_TIMERS==0 + + 2010-11-20: Simon Goldschmidt + * sockets.c: Fixed bug #31170: lwip_setsockopt() does not set socket number + + 2010-11-20: Simon Goldschmidt + * sockets.h: Fixed bug #31304: Changed SHUT_RD, SHUT_WR and SHUT_RDWR to + resemble other stacks. + + 2010-11-20: Simon Goldschmidt + * dns.c: Fixed bug #31535: TCP_SND_QUEUELEN must be at least 2 or else + no-copy TCP writes will never succeed. + + 2010-11-20: Simon Goldschmidt + * dns.c: Fixed bug #31701: Error return value from dns_gethostbyname() does + not match documentation: return ERR_ARG instead of ERR_VAL if not + initialized or wrong argument. + + 2010-10-20: Simon Goldschmidt + * sockets.h: Fixed bug #31385: sizeof(struct sockaddr) is 30 but should be 16 + + 2010-10-05: Simon Goldschmidt + * dhcp.c: Once again fixed #30038: DHCP/AutoIP cooperation failed when + replugging the network cable after an AutoIP address was assigned. + + 2010-08-10: Simon Goldschmidt + * tcp.c: Fixed bug #30728: tcp_new_port() did not check listen pcbs + + 2010-08-03: Simon Goldschmidt + * udp.c, raw.c: Don't chain empty pbufs when sending them (fixes bug #30625) + + 2010-08-01: Simon Goldschmidt (patch by Greg Renda) + * ppp.c: Applied patch #7264 (PPP protocols are rejected incorrectly on big + endian architectures) + + 2010-07-28: Simon Goldschmidt + * api_lib.c, api_msg.c, sockets.c, mib2.c: Fixed compilation with TCP or UDP + disabled. + + 2010-07-27: Simon Goldschmidt + * tcp.c: Fixed bug #30565 (tcp_connect() check bound list): that check did no + harm but never did anything + + 2010-07-21: Simon Goldschmidt + * ip.c: Fixed invalid fix for bug #30402 (CHECKSUM_GEN_IP_INLINE does not + add IP options) + + 2010-07-16: Kieran Mansley + * msg_in.c: Fixed SNMP ASN constant defines to not use ! operator + + 2010-07-10: Simon Goldschmidt + * ip.c: Fixed bug #30402: CHECKSUM_GEN_IP_INLINE does not add IP options + + 2010-06-30: Simon Goldschmidt + * api_msg.c: fixed bug #30300 (shutdown parameter was not initialized in + netconn_delete) + + 2010-06-28: Kieran Mansley + * timers.c remove unportable printing of C function pointers + + 2010-06-24: Simon Goldschmidt + * init.c, timers.c/.h, opt.h, memp_std.h: From patch #7221: added flag + NO_SYS_NO_TIMERS to drop timer support for NO_SYS==1 for easier upgrading + + 2010-06-24: Simon Goldschmidt + * api(_lib).c/.h, api_msg.c/.h, sockets.c/.h: Fixed bug #10088: Correctly + implemented shutdown at socket level. + + 2010-06-21: Simon Goldschmidt + * pbuf.c/.h, ip_frag.c/.h, opt.h, memp_std.h: Fixed bug #29361 (ip_frag has + problems with zero-copy DMA MACs) by adding custom pbufs and implementing + custom pbufs that reference other (original) pbufs. Additionally set + IP_FRAG_USES_STATIC_BUF=0 as default to be on the safe side. + + 2010-06-15: Simon Goldschmidt + * dhcp.c: Fixed bug #29970: DHCP endian issue parsing option responses + + 2010-06-14: Simon Goldschmidt + * autoip.c: Fixed bug #30039: AutoIP does not reuse previous addresses + + 2010-06-12: Simon Goldschmidt + * dhcp.c: Fixed bug #30038: dhcp_network_changed doesn't reset AUTOIP coop + state + + 2010-05-17: Simon Goldschmidt + * netdb.c: Correctly NULL-terminate h_addr_list + + 2010-05-16: Simon Goldschmidt + * def.h/.c: changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent + "symbol already defined" i.e. when linking to winsock + + 2010-05-05: Simon Goldschmidt + * def.h, timers.c: Fixed bug #29769 (sys_check_timeouts: sys_now() may + overflow) + + 2010-04-21: Simon Goldschmidt + * api_msg.c: Fixed bug #29617 (sometime cause stall on delete listening + connection) + + 2010-03-28: Luca Ceresoli + * ip_addr.c/.h: patch #7143: Add a few missing const qualifiers + + 2010-03-27: Luca Ceresoli + * mib2.c: patch #7130: remove meaningless const qualifiers + + 2010-03-26: Simon Goldschmidt + * tcp_out.c: Make LWIP_NETIF_TX_SINGLE_PBUF work for TCP, too + + 2010-03-26: Simon Goldschmidt + * various files: Fixed compiling with different options disabled (TCP/UDP), + triggered by bug #29345; don't allocate acceptmbox if LWIP_TCP is disabled + + 2010-03-25: Simon Goldschmidt + * sockets.c: Fixed bug #29332: lwip_select() processes readset incorrectly + + 2010-03-25: Simon Goldschmidt + * tcp_in.c, test_tcp_oos.c: Fixed bug #29080: Correctly handle remote side + overrunning our rcv_wnd in ooseq case. + + 2010-03-22: Simon Goldschmidt + * tcp.c: tcp_listen() did not copy the pcb's prio. + + 2010-03-19: Simon Goldschmidt + * snmp_msg.c: Fixed bug #29256: SNMP Trap address was not correctly set + + 2010-03-14: Simon Goldschmidt + * opt.h, etharp.h: Fixed bug #29148 (Incorrect PBUF_POOL_BUFSIZE for ports + where ETH_PAD_SIZE > 0) by moving definition of ETH_PAD_SIZE to opt.h + and basing PBUF_LINK_HLEN on it. + + 2010-03-08: Simon Goldschmidt + * netif.c, ipv4/ip.c: task #10241 (AutoIP: don't break existing connections + when assiging routable address): when checking incoming packets and + aborting existing connection on address change, filter out link-local + addresses. + + 2010-03-06: Simon Goldschmidt + * sockets.c: Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING + + 2010-03-06: Simon Goldschmidt + * ipv4/ip.c: Don't try to forward link-local addresses + + 2010-03-06: Simon Goldschmidt + * etharp.c: Fixed bug #29087: etharp: don't send packets for LinkLocal- + addresses to gw + + 2010-03-05: Simon Goldschmidt + * dhcp.c: Fixed bug #29072: Correctly set ciaddr based on message-type + and state. + + 2010-03-05: Simon Goldschmidt + * api_msg.c: Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split + into multiple calls to tcp_write. + + 2010-02-21: Simon Goldschmidt + * opt.h, mem.h, dns.c: task #10140: Remove DNS_USES_STATIC_BUF (keep + the implementation of DNS_USES_STATIC_BUF==1) + + 2010-02-20: Simon Goldschmidt + * tcp.h, tcp.c, tcp_in.c, tcp_out.c: Task #10088: Correctly implement + close() vs. shutdown(). Now the application does not get any more + recv callbacks after calling tcp_close(). Added tcp_shutdown(). + + 2010-02-19: Simon Goldschmidt + * mem.c/.h, pbuf.c: Renamed mem_realloc() to mem_trim() to prevent + confusion with realloc() + + 2010-02-15: Simon Goldschmidt/Stephane Lesage + * netif.c/.h: Link status does not depend on LWIP_NETIF_LINK_CALLBACK + (fixes bug #28899) + + 2010-02-14: Simon Goldschmidt + * netif.c: Fixed bug #28877 (Duplicate ARP gratuitous packet with + LWIP_NETIF_LINK_CALLBACK set on) by only sending if both link- and + admin-status of a netif are up + + 2010-02-14: Simon Goldschmidt + * opt.h: Disable ETHARP_TRUST_IP_MAC by default since it slows down packet + reception and is not really necessary + + 2010-02-14: Simon Goldschmidt + * etharp.c/.h: Fixed ARP input processing: only add a new entry if a + request was directed as us (RFC 826, Packet Reception), otherwise + only update existing entries; internalized some functions + + 2010-02-14: Simon Goldschmidt + * netif.h, etharp.c, tcpip.c: Fixed bug #28183 (ARP and TCP/IP cannot be + disabled on netif used for PPPoE) by adding a new netif flag + (NETIF_FLAG_ETHERNET) that tells the stack the device is an ethernet + device but prevents usage of ARP (so that ethernet_input can be used + for PPPoE). + + 2010-02-12: Simon Goldschmidt + * netif.c: netif_set_link_up/down: only do something if the link state + actually changes + + 2010-02-12: Simon Goldschmidt/Stephane Lesage + * api_msg.c: Fixed bug #28865 (Cannot close socket/netconn in non-blocking + connect) + + 2010-02-12: Simon Goldschmidt + * mem.h: Fixed bug #28866 (mem_realloc function defined in mem.h) + + 2010-02-09: Simon Goldschmidt + * api_lib.c, api_msg.c, sockets.c, api.h, api_msg.h: Fixed bug #22110 + (recv() makes receive window update for data that wasn't received by + application) + + 2010-02-09: Simon Goldschmidt/Stephane Lesage + * sockets.c: Fixed bug #28853 (lwip_recvfrom() returns 0 on receive time-out + or any netconn_recv() error) + + 2010-02-09: Simon Goldschmidt + * ppp.c: task #10154 (PPP: Update snmp in/out counters for tx/rx packets) + + 2010-02-09: Simon Goldschmidt + * netif.c: For loopback packets, adjust the stats- and snmp-counters + for the loopback netif. + + 2010-02-08: Simon Goldschmidt + * igmp.c/.h, ip.h: Moved most defines from igmp.h to igmp.c for clarity + since they are not used anywhere else. + + 2010-02-08: Simon Goldschmidt (Stéphane Lesage) + * igmp.c, igmp.h, stats.c, stats.h: Improved IGMP stats + (patch from bug #28798) + + 2010-02-08: Simon Goldschmidt (Stéphane Lesage) + * igmp.c: Fixed bug #28798 (Error in "Max Response Time" processing) and + another bug when LWIP_RAND() returns zero. + + 2010-02-04: Simon Goldschmidt + * nearly every file: Use macros defined in ip_addr.h (some of them new) + to work with IP addresses (preparation for bug #27352 - Change ip_addr + from struct to typedef (u32_t) - and better code). + + 2010-01-31: Simon Goldschmidt + * netif.c: Don't call the link-callback from netif_set_up/down() since + this invalidly retriggers DHCP. + + 2010-01-29: Simon Goldschmidt + * ip_addr.h, inet.h, def.h, inet.c, def.c, more: Cleanly separate the + portability file inet.h and its contents from the stack: moved htonX- + functions to def.h (and the new def.c - they are not ipv4 dependent), + let inet.h depend on ip_addr.h and not the other way round. + This fixes bug #28732. + + 2010-01-28: Kieran Mansley + * tcp.c: Ensure ssthresh >= 2*MSS + + 2010-01-27: Simon Goldschmidt + * tcp.h, tcp.c, tcp_in.c: Fixed bug #27871: Calling tcp_abort() in recv + callback can lead to accessing unallocated memory. As a consequence, + ERR_ABRT means the application has called tcp_abort()! + + 2010-01-25: Simon Goldschmidt + * snmp_structs.h, msg_in.c: Partly fixed bug #22070 (MIB_OBJECT_WRITE_ONLY + not implemented in SNMP): write-only or not-accessible are still + returned by getnext (though not by get) + + 2010-01-24: Simon Goldschmidt + * snmp: Renamed the private mib node from 'private' to 'mib_private' to + not use reserved C/C++ keywords + + 2010-01-23: Simon Goldschmidt + * sockets.c: Fixed bug #28716: select() returns 0 after waiting for less + than 1 ms + + 2010-01-21: Simon Goldschmidt + * tcp.c, api_msg.c: Fixed bug #28651 (tcp_connect: no callbacks called + if tcp_enqueue fails) both in raw- and netconn-API + + 2010-01-19: Simon Goldschmidt + * api_msg.c: Fixed bug #27316: netconn: Possible deadlock in err_tcp + + 2010-01-18: Iordan Neshev/Simon Goldschmidt + * src/netif/ppp: reorganised PPP sourcecode to 2.3.11 including some + bugfix backports from 2.4.x. + + 2010-01-18: Simon Goldschmidt + * mem.c: Fixed bug #28679: mem_realloc calculates mem_stats wrong + + 2010-01-17: Simon Goldschmidt + * api_lib.c, api_msg.c, (api_msg.h, api.h, sockets.c, tcpip.c): + task #10102: "netconn: clean up conn->err threading issues" by adding + error return value to struct api_msg_msg + + 2010-01-17: Simon Goldschmidt + * api.h, api_lib.c, sockets.c: Changed netconn_recv() and netconn_accept() + to return err_t (bugs #27709 and #28087) + + 2010-01-14: Simon Goldschmidt + * ...: Use typedef for function prototypes throughout the stack. + + 2010-01-13: Simon Goldschmidt + * api_msg.h/.c, api_lib.c: Fixed bug #26672 (close connection when receive + window = 0) by correctly draining recvmbox/acceptmbox + + 2010-01-11: Simon Goldschmidt + * pap.c: Fixed bug #13315 (PPP PAP authentication can result in + erroneous callbacks) by copying the code from recent pppd + + 2010-01-10: Simon Goldschmidt + * raw.c: Fixed bug #28506 (raw_bind should filter received packets) + + 2010-01-10: Simon Goldschmidt + * tcp.h/.c: bug #28127 (remove call to tcp_output() from tcp_ack(_now)()) + + 2010-01-08: Simon Goldschmidt + * sockets.c: Fixed bug #28519 (lwip_recvfrom bug with len > 65535) + + 2010-01-08: Simon Goldschmidt + * dns.c: Copy hostname for DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1 since string + passed to dns_local_addhost() might be volatile + + 2010-01-07: Simon Goldschmidt + * timers.c, tcp.h: Call tcp_timer_needed() with NO_SYS==1, too + + 2010-01-06: Simon Goldschmidt + * netdb.h: Fixed bug #28496: missing include guards in netdb.h + + 2009-12-31: Simon Goldschmidt + * many ppp files: Reorganised PPP source code from ucip structure to pppd + structure to easily compare our code against the pppd code (around v2.3.1) + + 2009-12-27: Simon Goldschmidt + * tcp_in.c: Another fix for bug #28241 (ooseq processing) and adapted + unit test + + +(STABLE-1.3.2) + + ++ New features: + + 2009-10-27 Simon Goldschmidt/Stephan Lesage + * netifapi.c/.h: Added netifapi_netif_set_addr() + + 2009-10-07 Simon Goldschmidt/Fabian Koch + * api_msg.c, netbuf.c/.h, opt.h: patch #6888: Patch for UDP Netbufs to + support dest-addr and dest-port (optional: LWIP_NETBUF_RECVINFO) + + 2009-08-26 Simon Goldschmidt/Simon Kallweit + * slipif.c/.h: bug #26397: SLIP polling support + + 2009-08-25 Simon Goldschmidt + * opt.h, etharp.h/.c: task #9033: Support IEEE 802.1q tagged frame (VLAN), + New configuration options ETHARP_SUPPORT_VLAN and ETHARP_VLAN_CHECK. + + 2009-08-25 Simon Goldschmidt + * ip_addr.h, netdb.c: patch #6900: added define ip_ntoa(struct ip_addr*) + + 2009-08-24 Jakob Stoklund Olesen + * autoip.c, dhcp.c, netif.c: patch #6725: Teach AutoIP and DHCP to respond + to netif_set_link_up(). + + 2009-08-23 Simon Goldschmidt + * tcp.h/.c: Added function tcp_debug_state_str() to convert a tcp state + to a human-readable string. + + ++ Bugfixes: + + 2009-12-24: Kieran Mansley + * tcp_in.c Apply patches from Oleg Tyshev to improve OOS processing + (BUG#28241) + + 2009-12-06: Simon Goldschmidt + * ppp.h/.c: Fixed bug #27079 (Yet another leak in PPP): outpacket_buf can + be statically allocated (like in ucip) + + 2009-12-04: Simon Goldschmidt (patch by Ioardan Neshev) + * pap.c: patch #6969: PPP: missing PAP authentication UNTIMEOUT + + 2009-12-03: Simon Goldschmidt + * tcp.h, tcp_in.c, tcp_out.c: Fixed bug #28106: dup ack for fast retransmit + could have non-zero length + + 2009-12-02: Simon Goldschmidt + * tcp_in.c: Fixed bug #27904: TCP sends too many ACKs: delay resetting + tcp_input_pcb until after calling the pcb's callbacks + + 2009-11-29: Simon Goldschmidt + * tcp_in.c: Fixed bug #28054: Two segments with FIN flag on the out-of- + sequence queue, also fixed PBUF_POOL leak in the out-of-sequence code + + 2009-11-29: Simon Goldschmidt + * pbuf.c: Fixed bug #28064: pbuf_alloc(PBUF_POOL) is not thread-safe by + queueing a call into tcpip_thread to free ooseq-bufs if the pool is empty + + 2009-11-26: Simon Goldschmidt + * tcp.h: Fixed bug #28098: Nagle can prevent fast retransmit from sending + segment + + 2009-11-26: Simon Goldschmidt + * tcp.h, sockets.c: Fixed bug #28099: API required to disable Nagle + algorithm at PCB level + + 2009-11-22: Simon Goldschmidt + * tcp_out.c: Fixed bug #27905: FIN isn't combined with data on unsent + + 2009-11-22: Simon Goldschmidt (suggested by Bill Auerbach) + * tcp.c: tcp_alloc: prevent increasing stats.err for MEMP_TCP_PCB when + reusing time-wait pcb + + 2009-11-20: Simon Goldschmidt (patch by Albert Bartel) + * sockets.c: Fixed bug #28062: Data received directly after accepting + does not wake up select + + 2009-11-11: Simon Goldschmidt + * netdb.h: Fixed bug #27994: incorrect define for freeaddrinfo(addrinfo) + + 2009-10-30: Simon Goldschmidt + * opt.h: Increased default value for TCP_MSS to 536, updated default + value for TCP_WND to 4*TCP_MSS to keep delayed ACK working. + + 2009-10-28: Kieran Mansley + * tcp_in.c, tcp_out.c, tcp.h: re-work the fast retransmission code + to follow algorithm from TCP/IP Illustrated + + 2009-10-27: Kieran Mansley + * tcp_in.c: fix BUG#27445: grow cwnd with every duplicate ACK + + 2009-10-25: Simon Goldschmidt + * tcp.h: bug-fix in the TCP_EVENT_RECV macro (has to call tcp_recved if + pcb->recv is NULL to keep rcv_wnd correct) + + 2009-10-25: Simon Goldschmidt + * tcp_in.c: Fixed bug #26251: RST process in TIME_WAIT TCP state + + 2009-10-23: Simon Goldschmidt (David Empson) + * tcp.c: Fixed bug #27783: Silly window avoidance for small window sizes + + 2009-10-21: Simon Goldschmidt + * tcp_in.c: Fixed bug #27215: TCP sent() callback gives leading and + trailing 1 byte len (SYN/FIN) + + 2009-10-21: Simon Goldschmidt + * tcp_out.c: Fixed bug #27315: zero window probe and FIN + + 2009-10-19: Simon Goldschmidt + * dhcp.c/.h: Minor code simplification (don't store received pbuf, change + conditional code to assert where applicable), check pbuf length before + testing for valid reply + + 2009-10-19: Simon Goldschmidt + * dhcp.c: Removed most calls to udp_connect since they aren't necessary + when using udp_sendto_if() - always stay connected to IP_ADDR_ANY. + + 2009-10-16: Simon Goldschmidt + * ip.c: Fixed bug #27390: Source IP check in ip_input() causes it to drop + valid DHCP packets -> allow 0.0.0.0 as source address when LWIP_DHCP is + enabled + + 2009-10-15: Simon Goldschmidt (Oleg Tyshev) + * tcp_in.c: Fixed bug #27329: dupacks by unidirectional data transmit + + 2009-10-15: Simon Goldschmidt + * api_lib.c: Fixed bug #27709: conn->err race condition on netconn_recv() + timeout + + 2009-10-15: Simon Goldschmidt + * autoip.c: Fixed bug #27704: autoip starts with wrong address + LWIP_AUTOIP_CREATE_SEED_ADDR() returned address in host byte order instead + of network byte order + + 2009-10-11 Simon Goldschmidt (Jörg Kesten) + * tcp_out.c: Fixed bug #27504: tcp_enqueue wrongly concatenates segments + which are not consecutive when retransmitting unacked segments + + 2009-10-09 Simon Goldschmidt + * opt.h: Fixed default values of some stats to only be enabled if used + Fixes bug #27338: sys_stats is defined when NO_SYS = 1 + + 2009-08-30 Simon Goldschmidt + * ip.c: Fixed bug bug #27345: "ip_frag() does not use the LWIP_NETIF_LOOPBACK + function" by checking for loopback before calling ip_frag + + 2009-08-25 Simon Goldschmidt + * dhcp.c: fixed invalid dependency to etharp_query if DHCP_DOES_ARP_CHECK==0 + + 2009-08-23 Simon Goldschmidt + * ppp.c: bug #27078: Possible memory leak in pppInit() + + 2009-08-23 Simon Goldschmidt + * netdb.c, dns.c: bug #26657: DNS, if host name is "localhost", result + is error. + + 2009-08-23 Simon Goldschmidt + * opt.h, init.c: bug #26649: TCP fails when TCP_MSS > TCP_SND_BUF + Fixed wrong parenthesis, added check in init.c + + 2009-08-23 Simon Goldschmidt + * ppp.c: bug #27266: wait-state debug message in pppMain occurs every ms + + 2009-08-23 Simon Goldschmidt + * many ppp files: bug #27267: Added include to string.h where needed + + 2009-08-23 Simon Goldschmidt + * tcp.h: patch #6843: tcp.h macro optimization patch (for little endian) + + +(STABLE-1.3.1) + + ++ New features: + + 2009-05-10 Simon Goldschmidt + * opt.h, sockets.c, pbuf.c, netbuf.h, pbuf.h: task #7013: Added option + LWIP_NETIF_TX_SINGLE_PBUF to try to create transmit packets from only + one pbuf to help MACs that don't support scatter-gather DMA. + + 2009-05-09 Simon Goldschmidt + * icmp.h, icmp.c: Shrinked ICMP code, added option to NOT check icoming + ECHO pbuf for size (just use it): LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN + + 2009-05-05 Simon Goldschmidt, Jakob Stoklund Olesen + * ip.h, ip.c: Added ip_current_netif() & ip_current_header() to receive + extended info about the currently received packet. + + 2009-04-27 Simon Goldschmidt + * sys.h: Made SYS_LIGHTWEIGHT_PROT and sys_now() work with NO_SYS=1 + + 2009-04-25 Simon Goldschmidt + * mem.c, opt.h: Added option MEM_USE_POOLS_TRY_BIGGER_POOL to try the next + bigger malloc pool if one is empty (only usable with MEM_USE_POOLS). + + 2009-04-21 Simon Goldschmidt + * dns.c, init.c, dns.h, opt.h: task #7507, patch #6786: DNS supports static + hosts table. New configuration options DNS_LOCAL_HOSTLIST and + DNS_LOCAL_HOSTLIST_IS_DYNAMIC. Also, DNS_LOOKUP_LOCAL_EXTERN() can be defined + as an external function for lookup. + + 2009-04-15 Simon Goldschmidt + * dhcp.c: patch #6763: Global DHCP XID can be redefined to something more unique + + 2009-03-31 Kieran Mansley + * tcp.c, tcp_out.c, tcp_in.c, sys.h, tcp.h, opts.h: add support for + TCP timestamp options, off by default. Rework tcp_enqueue() to + take option flags rather than specified option data + + 2009-02-18 Simon Goldschmidt + * cc.h: Added printf formatter for size_t: SZT_F + + 2009-02-16 Simon Goldschmidt (patch by Rishi Khan) + * icmp.c, opt.h: patch #6539: (configurable) response to broadcast- and multicast + pings + + 2009-02-12 Simon Goldschmidt + * init.h: Added LWIP_VERSION to get the current version of the stack + + 2009-02-11 Simon Goldschmidt (suggested by Gottfried Spitaler) + * opt.h, memp.h/.c: added MEMP_MEM_MALLOC to use mem_malloc/mem_free instead + of the pool allocator (can save code size with MEM_LIBC_MALLOC if libc-malloc + is otherwise used) + + 2009-01-28 Jonathan Larmour (suggested by Bill Bauerbach) + * ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial() + is only used by UDPLITE at present, so conditionalise it. + + 2008-12-03 Simon Goldschmidt (base on patch from Luca Ceresoli) + * autoip.c: checked in (slightly modified) patch #6683: Customizable AUTOIP + "seed" address. This should reduce AUTOIP conflicts if + LWIP_AUTOIP_CREATE_SEED_ADDR is overridden. + + 2008-10-02 Jonathan Larmour and Rishi Khan + * sockets.c (lwip_accept): Return EWOULDBLOCK if would block on non-blocking + socket. + + 2008-06-30 Simon Goldschmidt + * mem.c, opt.h, stats.h: fixed bug #21433: Calling mem_free/pbuf_free from + interrupt context isn't safe: LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT allows + mem_free to run between mem_malloc iterations. Added illegal counter for + mem stats. + + 2008-06-27 Simon Goldschmidt + * stats.h/.c, some other files: patch #6483: stats module improvement: + Added defines to display each module's statistic individually, added stats + defines for MEM, MEMP and SYS modules, removed (unused) rexmit counter. + + 2008-06-17 Simon Goldschmidt + * err.h: patch #6459: Made err_t overridable to use a more efficient type + (define LWIP_ERR_T in cc.h) + + 2008-06-17 Simon Goldschmidt + * slipif.c: patch #6480: Added a configuration option for slipif for symmetry + to loopif + + 2008-06-17 Simon Goldschmidt (patch by Luca Ceresoli) + * netif.c, loopif.c, ip.c, netif.h, loopif.h, opt.h: Checked in slightly + modified version of patch # 6370: Moved loopif code to netif.c so that + loopback traffic is supported on all netifs (all local IPs). + Added option to limit loopback packets for each netifs. + + + ++ Bugfixes: + 2009-08-12 Kieran Mansley + * tcp_in.c, tcp.c: Fix bug #27209: handle trimming of segments when + out of window or out of order properly + + 2009-08-12 Kieran Mansley + * tcp_in.c: Fix bug #27199: use snd_wl2 instead of snd_wl1 + + 2009-07-28 Simon Goldschmidt + * mem.h: Fixed bug #27105: "realloc() cannot replace mem_realloc()"s + + 2009-07-27 Kieran Mansley + * api.h api_msg.h netdb.h sockets.h: add missing #include directives + + 2009-07-09 Kieran Mansley + * api_msg.c, sockets.c, api.h: BUG23240 use signed counters for + recv_avail and don't increment counters until message successfully + sent to mbox + + 2009-06-25 Kieran Mansley + * api_msg.c api.h: BUG26722: initialise netconn write variables + in netconn_alloc + + 2009-06-25 Kieran Mansley + * tcp.h: BUG26879: set ret value in TCP_EVENT macros when function is not set + + 2009-06-25 Kieran Mansley + * tcp.c, tcp_in.c, tcp_out.c, tcp.h: BUG26301 and BUG26267: correct + simultaneous close behaviour, and make snd_nxt have the same meaning + as in the RFCs. + + 2009-05-12 Simon Goldschmidt + * etharp.h, etharp.c, netif.c: fixed bug #26507: "Gratuitous ARP depends on + arp_table / uses etharp_query" by adding etharp_gratuitous() + + 2009-05-12 Simon Goldschmidt + * ip.h, ip.c, igmp.c: bug #26487: Added ip_output_if_opt that can add IP options + to the IP header (used by igmp_ip_output_if) + + 2009-05-06 Simon Goldschmidt + * inet_chksum.c: On little endian architectures, use LWIP_PLATFORM_HTONS (if + defined) for SWAP_BYTES_IN_WORD to speed up checksumming. + + 2009-05-05 Simon Goldschmidt + * sockets.c: bug #26405: Prematurely released semaphore causes lwip_select() + to crash + + 2009-05-04 Simon Goldschmidt + * init.c: snmp was not initialized in lwip_init() + + 2009-05-04 Frédéric Bernon + * dhcp.c, netbios.c: Changes if IP_SOF_BROADCAST is enabled. + + 2009-05-03 Simon Goldschmidt + * tcp.h: bug #26349: Nagle algorithm doesn't send although segment is full + (and unsent->next == NULL) + + 2009-05-02 Simon Goldschmidt + * tcpip.h, tcpip.c: fixed tcpip_untimeout (does not need the time, broken after + 1.3.0 in CVS only) - fixes compilation of ppp_oe.c + + 2009-05-02 Simon Goldschmidt + * msg_in.c: fixed bug #25636: SNMPSET value is ignored for integer fields + + 2009-05-01 Simon Goldschmidt + * pap.c: bug #21680: PPP upap_rauthnak() drops legal NAK packets + + 2009-05-01 Simon Goldschmidt + * ppp.c: bug #24228: Memory corruption with PPP and DHCP + + 2009-04-29 Frédéric Bernon + * raw.c, udp.c, init.c, opt.h, ip.h, sockets.h: bug #26309: Implement the + SO(F)_BROADCAST filter for all API layers. Avoid the unindented reception + of broadcast packets even when this option wasn't set. Port maintainers + which want to enable this filter have to set IP_SOF_BROADCAST=1 in opt.h. + If you want this option also filter broadcast on recv operations, you also + have to set IP_SOF_BROADCAST_RECV=1 in opt.h. + + 2009-04-28 Simon Goldschmidt, Jakob Stoklund Olesen + * dhcp.c: patch #6721, bugs #25575, #25576: Some small fixes to DHCP and + DHCP/AUTOIP cooperation + + 2009-04-25 Simon Goldschmidt, Oleg Tyshev + * tcp_out.c: bug #24212: Deadlocked tcp_retransmit due to exceeded pcb->cwnd + Fixed by sorting the unsent and unacked queues (segments are inserted at the + right place in tcp_output and tcp_rexmit). + + 2009-04-25 Simon Goldschmidt + * memp.c, mem.c, memp.h, mem_std.h: bug #26213 "Problem with memory allocation + when debugging": memp_sizes contained the wrong sizes (including sanity + regions); memp pools for MEM_USE_POOLS were too small + + 2009-04-24 Simon Goldschmidt, Frédéric Bernon + * inet.c: patch #6765: Fix a small problem with the last changes (incorrect + behavior, with with ip address string not ended by a '\0', a space or a + end of line) + + 2009-04-19 Simon Goldschmidt + * rawapi.txt: Fixed bug #26069: Corrected documentation: if tcp_connect fails, + pcb->err is called, not pcb->connected (with an error code). + + 2009-04-19 Simon Goldschmidt + * tcp_out.c: Fixed bug #26236: "TCP options (timestamp) don't work with + no-copy-tcpwrite": deallocate option data, only concat segments with same flags + + 2009-04-19 Simon Goldschmidt + * tcp_out.c: Fixed bug #25094: "Zero-length pbuf" (options are now allocated + in the header pbuf, not the data pbuf) + + 2009-04-18 Simon Goldschmidt + * api_msg.c: fixed bug #25695: Segmentation fault in do_writemore() + + 2009-04-15 Simon Goldschmidt + * sockets.c: tried to fix bug #23559: lwip_recvfrom problem with tcp + + 2009-04-15 Simon Goldschmidt + * dhcp.c: task #9192: mem_free of dhcp->options_in and dhcp->msg_in + + 2009-04-15 Simon Goldschmidt + * ip.c, ip6.c, tcp_out.c, ip.h: patch #6808: Add a utility function + ip_hinted_output() (for smaller code mainly) + + 2009-04-15 Simon Goldschmidt + * inet.c: patch #6765: Supporting new line characters in inet_aton() + + 2009-04-15 Simon Goldschmidt + * dhcp.c: patch #6764: DHCP rebind and renew did not send hostnam option; + Converted constant OPTION_MAX_MSG_SIZE to netif->mtu, check if netif->mtu + is big enough in dhcp_start + + 2009-04-15 Simon Goldschmidt + * netbuf.c: bug #26027: netbuf_chain resulted in pbuf memory leak + + 2009-04-15 Simon Goldschmidt + * sockets.c, ppp.c: bug #25763: corrected 4 occurrences of SMEMCPY to MEMCPY + + 2009-04-15 Simon Goldschmidt + * sockets.c: bug #26121: set_errno can be overridden + + 2009-04-09 Kieran Mansley (patch from Luca Ceresoli ) + * init.c, opt.h: Patch#6774 TCP_QUEUE_OOSEQ breaks compilation when + LWIP_TCP==0 + + 2009-04-09 Kieran Mansley (patch from Roy Lee ) + * tcp.h: Patch#6802 Add do-while-clauses to those function like + macros in tcp.h + + 2009-03-31 Kieran Mansley + * tcp.c, tcp_in.c, tcp_out.c, tcp.h, opt.h: Rework the way window + updates are calculated and sent (BUG20515) + + * tcp_in.c: cope with SYN packets received during established states, + and retransmission of initial SYN. + + * tcp_out.c: set push bit correctly when tcp segments are merged + + 2009-03-27 Kieran Mansley + * tcp_out.c set window correctly on probes (correcting change made + yesterday) + + 2009-03-26 Kieran Mansley + * tcp.c, tcp_in.c, tcp.h: add tcp_abandon() to cope with dropping + connections where no reset required (bug #25622) + + * tcp_out.c: set TCP_ACK flag on keepalive and zero window probes + (bug #20779) + + 2009-02-18 Simon Goldschmidt (Jonathan Larmour and Bill Auerbach) + * ip_frag.c: patch #6528: the buffer used for IP_FRAG_USES_STATIC_BUF could be + too small depending on MEM_ALIGNMENT + + 2009-02-16 Simon Goldschmidt + * sockets.h/.c, api_*.h/.c: fixed arguments of socket functions to match the standard; + converted size argument of netconn_write to 'size_t' + + 2009-02-16 Simon Goldschmidt + * tcp.h, tcp.c: fixed bug #24440: TCP connection close problem on 64-bit host + by moving accept callback function pointer to TCP_PCB_COMMON + + 2009-02-12 Simon Goldschmidt + * dhcp.c: fixed bug #25345 (DHCPDECLINE is sent with "Maximum message size" + option) + + 2009-02-11 Simon Goldschmidt + * dhcp.c: fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start) + + 2009-02-11 Simon Goldschmidt + * opt.h, api_msg.c: added configurable default valud for netconn->recv_bufsize: + RECV_BUFSIZE_DEFAULT (fixes bug #23726: pbuf pool exhaustion on slow recv()) + + 2009-02-10 Simon Goldschmidt + * tcp.c: fixed bug #25467: Listen backlog is not reset on timeout in SYN_RCVD: + Accepts_pending is decrease on a corresponding listen pcb when a connection + in state SYN_RCVD is close. + + 2009-01-28 Jonathan Larmour + * pbuf.c: reclaim pbufs from TCP out-of-sequence segments if we run + out of pool pbufs. + + 2008-12-19 Simon Goldschmidt + * many files: patch #6699: fixed some warnings on platform where sizeof(int) == 2 + + 2008-12-10 Tamas Somogyi, Frédéric Bernon + * sockets.c: fixed bug #25051: lwip_recvfrom problem with udp: fromaddr and + port uses deleted netbuf. + + 2008-10-18 Simon Goldschmidt + * tcp_in.c: fixed bug ##24596: Vulnerability on faulty TCP options length + in tcp_parseopt + + 2008-10-15 Simon Goldschmidt + * ip_frag.c: fixed bug #24517: IP reassembly crashes on unaligned IP headers + by packing the struct ip_reass_helper. + + 2008-10-03 David Woodhouse, Jonathan Larmour + * etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address. + + 2008-10-02 Jonathan Larmour + * dns.c: Hard-code structure sizes, to avoid issues on some compilers where + padding is included. + + 2008-09-30 Jonathan Larmour + * sockets.c (lwip_accept): check addr isn't NULL. If it's valid, do an + assertion check that addrlen isn't NULL. + + 2008-09-30 Jonathan Larmour + * tcp.c: Fix bug #24227, wrong error message in tcp_bind. + + 2008-08-26 Simon Goldschmidt + * inet.h, ip_addr.h: fixed bug #24132: Cross-dependency between ip_addr.h and + inet.h -> moved declaration of struct in_addr from ip_addr.h to inet.h + + 2008-08-14 Simon Goldschmidt + * api_msg.c: fixed bug #23847: do_close_internal references freed memory (when + tcp_close returns != ERR_OK) + + 2008-07-08 Frédéric Bernon + * stats.h: Fix some build bugs introduced with patch #6483 (missing some parameters + in macros, mainly if MEM_STATS=0 and MEMP_STATS=0). + + 2008-06-24 Jonathan Larmour + * tcp_in.c: Fix for bug #23693 as suggested by Art R. Ensure cseg is unused + if tcp_seg_copy fails. + + 2008-06-17 Simon Goldschmidt + * inet_chksum.c: Checked in some ideas of patch #6460 (loop optimizations) + and created defines for swapping bytes and folding u32 to u16. + + 2008-05-30 Kieran Mansley + * tcp_in.c Remove redundant "if" statement, and use real rcv_wnd + rather than rcv_ann_wnd when deciding if packets are in-window. + Contributed by + + 2008-05-30 Kieran Mansley + * mem.h: Fix BUG#23254. Change macro definition of mem_* to allow + passing as function pointers when MEM_LIBC_MALLOC is defined. + + 2008-05-09 Jonathan Larmour + * err.h, err.c, sockets.c: Fix bug #23119: Reorder timeout error code to + stop it being treated as a fatal error. + + 2008-04-15 Simon Goldschmidt + * dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP + (flag now cleared) + + 2008-03-27 Simon Goldschmidt + * mem.c, tcpip.c, tcpip.h, opt.h: fixed bug #21433 (Calling mem_free/pbuf_free + from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1 + in lwipopts.h or use pbuf_free_callback(p)/mem_free_callback(m) to free pbufs + or heap memory from interrupt context + + 2008-03-26 Simon Goldschmidt + * tcp_in.c, tcp.c: fixed bug #22249: division by zero could occur if a remote + host sent a zero mss as TCP option. + + +(STABLE-1.3.0) + + ++ New features: + + 2008-03-10 Jonathan Larmour + * inet_chksum.c: Allow choice of one of the sample algorithms to be + made from lwipopts.h. Fix comment on how to override LWIP_CHKSUM. + + 2008-01-22 Frédéric Bernon + * tcp.c, tcp_in.c, tcp.h, opt.h: Rename LWIP_CALCULATE_EFF_SEND_MSS in + TCP_CALCULATE_EFF_SEND_MSS to have coherent TCP options names. + + 2008-01-14 Frédéric Bernon + * rawapi.txt, api_msg.c, tcp.c, tcp_in.c, tcp.h: changes for task #7675 "Enable + to refuse data on a TCP_EVENT_RECV call". Important, behavior changes for the + tcp_recv callback (see rawapi.txt). + + 2008-01-14 Frédéric Bernon, Marc Chaland + * ip.c: Integrate patch #6369" ip_input : checking before realloc". + + 2008-01-12 Frédéric Bernon + * tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field + netconn::sem per netconn::op_completed like suggested for the task #7490 + "Add return value to sys_mbox_post". + + 2008-01-12 Frédéric Bernon + * api_msg.c, opt.h: replace DEFAULT_RECVMBOX_SIZE per DEFAULT_TCP_RECVMBOX_SIZE, + DEFAULT_UDP_RECVMBOX_SIZE and DEFAULT_RAW_RECVMBOX_SIZE (to optimize queues + sizes), like suggested for the task #7490 "Add return value to sys_mbox_post". + + 2008-01-10 Frédéric Bernon + * tcpip.h, tcpip.c: add tcpip_callback_with_block function for the task #7490 + "Add return value to sys_mbox_post". tcpip_callback is always defined as + "blocking" ("block" parameter = 1). + + 2008-01-10 Frédéric Bernon + * tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field + netconn::mbox (sys_mbox_t) per netconn::sem (sys_sem_t) for the task #7490 + "Add return value to sys_mbox_post". + + 2008-01-05 Frédéric Bernon + * sys_arch.txt, api.h, api_lib.c, api_msg.h, api_msg.c, tcpip.c, sys.h, opt.h: + Introduce changes for task #7490 "Add return value to sys_mbox_post" with some + modifications in the sys_mbox api: sys_mbox_new take a "size" parameters which + indicate the number of pointers query by the mailbox. There is three defines + in opt.h to indicate sizes for tcpip::mbox, netconn::recvmbox, and for the + netconn::acceptmbox. Port maintainers, you can decide to just add this new + parameter in your implementation, but to ignore it to keep the previous behavior. + The new sys_mbox_trypost function return a value to know if the mailbox is + full or if the message is posted. Take a look to sys_arch.txt for more details. + This new function is used in tcpip_input (so, can be called in an interrupt + context since the function is not blocking), and in recv_udp and recv_raw. + + 2008-01-04 Frédéric Bernon, Simon Goldschmidt, Jonathan Larmour + * rawapi.txt, api.h, api_lib.c, api_msg.h, api_msg.c, sockets.c, tcp.h, tcp.c, + tcp_in.c, init.c, opt.h: rename backlog options with TCP_ prefix, limit the + "backlog" parameter in an u8_t, 0 is interpreted as "smallest queue", add + documentation in the rawapi.txt file. + + 2007-12-31 Kieran Mansley (based on patch from Per-Henrik Lundbolm) + * tcp.c, tcp_in.c, tcp_out.c, tcp.h: Add TCP persist timer + + 2007-12-31 Frédéric Bernon, Luca Ceresoli + * autoip.c, etharp.c: ip_addr.h: Integrate patch #6348: "Broadcast ARP packets + in autoip". The change in etharp_raw could be removed, since all calls to + etharp_raw use ethbroadcast for the "ethdst_addr" parameter. But it could be + wrong in the future. + + 2007-12-30 Frédéric Bernon, Tom Evans + * ip.c: Fix bug #21846 "LwIP doesn't appear to perform any IP Source Address + Filtering" reported by Tom Evans. + + 2007-12-21 Frédéric Bernon, Simon Goldschmidt, Jonathan Larmour + * tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, + sockets.c, init.c: task #7252: Implement TCP listen backlog: Warning: raw API + applications have to call 'tcp_accepted(pcb)' in their accept callback to + keep accepting new connections. + + 2007-12-13 Frédéric Bernon + * api_msg.c, err.h, err.c, sockets.c, dns.c, dns.h: replace "enum dns_result" + by err_t type. Add a new err_t code "ERR_INPROGRESS". + + 2007-12-12 Frédéric Bernon + * dns.h, dns.c, opt.h: move DNS options to the "right" place. Most visibles + are the one which have ram usage. + + 2007-12-05 Frédéric Bernon + * netdb.c: add a LWIP_DNS_API_HOSTENT_STORAGE option to decide to use a static + set of variables (=0) or a local one (=1). In this last case, your port should + provide a function "struct hostent* sys_thread_hostent( struct hostent* h)" + which have to do a copy of "h" and return a pointer ont the "per-thread" copy. + + 2007-12-03 Simon Goldschmidt + * ip.c: ip_input: check if a packet is for inp first before checking all other + netifs on netif_list (speeds up packet receiving in most cases) + + 2007-11-30 Simon Goldschmidt + * udp.c, raw.c: task #7497: Sort lists (pcb, netif, ...) for faster access + UDP: move a (connected) pcb selected for input to the front of the list of + pcbs so that it is found faster next time. Same for RAW pcbs that have eaten + a packet. + + 2007-11-28 Simon Goldschmidt + * etharp.c, stats.c, stats.h, opt.h: Introduced ETHARP_STATS + + 2007-11-25 Simon Goldschmidt + * dhcp.c: dhcp_unfold_reply() uses pbuf_copy_partial instead of its own copy + algorithm. + + 2007-11-24 Simon Goldschmidt + * netdb.h, netdb.c, sockets.h/.c: Moved lwip_gethostbyname from sockets.c + to the new file netdb.c; included lwip_getaddrinfo. + + 2007-11-21 Simon Goldschmidt + * tcp.h, opt.h, tcp.c, tcp_in.c: implemented calculating the effective send-mss + based on the MTU of the netif used to send. Enabled by default. Disable by + setting LWIP_CALCULATE_EFF_SEND_MSS to 0. This fixes bug #21492. + + 2007-11-19 Frédéric Bernon + * api_msg.c, dns.h, dns.c: Implement DNS_DOES_NAME_CHECK option (check if name + received match the name query), implement DNS_USES_STATIC_BUF (the place where + copy dns payload to parse the response), return an error if there is no place + for a new query, and fix some minor problems. + + 2007-11-16 Simon Goldschmidt + * new files: ipv4/inet.c, ipv4/inet_chksum.c, ipv6/inet6.c + removed files: core/inet.c, core/inet6.c + Moved inet files into ipv4/ipv6 directory; splitted inet.c/inet.h into + inet and chksum part; changed includes in all lwIP files as appropriate + + 2007-11-16 Simon Goldschmidt + * api.h, api_msg.h, api_lib.c, api_msg.c, socket.h, socket.c: Added sequential + dns resolver function for netconn api (netconn_gethostbyname) and socket api + (gethostbyname/gethostbyname_r). + + 2007-11-15 Jim Pettinato, Frédéric Bernon + * opt.h, init.c, tcpip.c, dhcp.c, dns.h, dns.c: add DNS client for simple name + requests with RAW api interface. Initialization is done in lwip_init() with + build time options. DNS timer is added in tcpip_thread context. DHCP can set + DNS server ip addresses when options are received. You need to set LWIP_DNS=1 + in your lwipopts.h file (LWIP_DNS=0 in opt.h). DNS_DEBUG can be set to get + some traces with LWIP_DEBUGF. Sanity check have been added. There is a "todo" + list with points to improve. + + 2007-11-06 Simon Goldschmidt + * opt.h, mib2.c: Patch #6215: added ifAdminStatus write support (if explicitly + enabled by defining SNMP_SAFE_REQUESTS to 0); added code to check link status + for ifOperStatus if LWIP_NETIF_LINK_CALLBACK is defined. + + 2007-11-06 Simon Goldschmidt + * api.h, api_msg.h and dependent files: Task #7410: Removed the need to include + core header files in api.h (ip/tcp/udp/raw.h) to hide the internal + implementation from netconn api applications. + + 2007-11-03 Frédéric Bernon + * api.h, api_lib.c, api_msg.c, sockets.c, opt.h: add SO_RCVBUF option for UDP & + RAW netconn. You need to set LWIP_SO_RCVBUF=1 in your lwipopts.h (it's disabled + by default). Netconn API users can use the netconn_recv_bufsize macro to access + it. This is a first release which have to be improve for TCP. Note it used the + netconn::recv_avail which need to be more "thread-safe" (note there is already + the problem for FIONREAD with lwip_ioctl/ioctlsocket). + + 2007-11-01 Frédéric Bernon, Marc Chaland + * sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, tcp.h, tcp_out.c: + Integrate "patch #6250 : MSG_MORE flag for send". MSG_MORE is used at socket api + layer, NETCONN_MORE at netconn api layer, and TCP_WRITE_FLAG_MORE at raw api + layer. This option enable to delayed TCP PUSH flag on multiple "write" calls. + Note that previous "copy" parameter for "write" APIs is now called "apiflags". + + 2007-10-24 Frédéric Bernon + * api.h, api_lib.c, api_msg.c: Add macro API_EVENT in the same spirit than + TCP_EVENT_xxx macros to get a code more readable. It could also help to remove + some code (like we have talk in "patch #5919 : Create compile switch to remove + select code"), but it could be done later. + + 2007-10-08 Simon Goldschmidt + * many files: Changed initialization: many init functions are not needed any + more since we now rely on the compiler initializing global and static + variables to zero! + + 2007-10-06 Simon Goldschmidt + * ip_frag.c, memp.c, mib2.c, ip_frag.h, memp_std.h, opt.h: Changed IP_REASSEMBLY + to enqueue the received pbufs so that multiple packets can be reassembled + simultaneously and no static reassembly buffer is needed. + + 2007-10-05 Simon Goldschmidt + * tcpip.c, etharp.h, etharp.c: moved ethernet_input from tcpip.c to etharp.c so + all netifs (or ports) can use it. + + 2007-10-05 Frédéric Bernon + * netifapi.h, netifapi.c: add function netifapi_netif_set_default. Change the + common function to reduce a little bit the footprint (for all functions using + only the "netif" parameter). + + 2007-10-03 Frédéric Bernon + * netifapi.h, netifapi.c: add functions netifapi_netif_set_up, netifapi_netif_set_down, + netifapi_autoip_start and netifapi_autoip_stop. Use a common function to reduce + a little bit the footprint (for all functions using only the "netif" parameter). + + 2007-09-15 Frédéric Bernon + * udp.h, udp.c, sockets.c: Changes for "#20503 IGMP Improvement". Add IP_MULTICAST_IF + option in socket API, and a new field "multicast_ip" in "struct udp_pcb" (for + netconn and raw API users), only if LWIP_IGMP=1. Add getsockopt processing for + IP_MULTICAST_TTL and IP_MULTICAST_IF. + + 2007-09-10 Frédéric Bernon + * snmp.h, mib2.c: enable to remove SNMP timer (which consumne several cycles + even when it's not necessary). snmp_agent.txt tell to call snmp_inc_sysuptime() + each 10ms (but, it's intrusive if you use sys_timeout feature). Now, you can + decide to call snmp_add_sysuptime(100) each 1000ms (which is bigger "step", but + call to a lower frequency). Or, you can decide to not call snmp_inc_sysuptime() + or snmp_add_sysuptime(), and to define the SNMP_GET_SYSUPTIME(sysuptime) macro. + This one is undefined by default in mib2.c. SNMP_GET_SYSUPTIME is called inside + snmp_get_sysuptime(u32_t *value), and enable to change "sysuptime" value only + when it's queried (any direct call to "sysuptime" is changed by a call to + snmp_get_sysuptime). + + 2007-09-09 Frédéric Bernon, Bill Florac + * igmp.h, igmp.c, netif.h, netif.c, ip.c: To enable to have interfaces with IGMP, + and others without it, there is a new NETIF_FLAG_IGMP flag to set in netif->flags + if you want IGMP on an interface. igmp_stop() is now called inside netif_remove(). + igmp_report_groups() is now called inside netif_set_link_up() (need to have + LWIP_NETIF_LINK_CALLBACK=1) to resend reports once the link is up (avoid to wait + the next query message to receive the matching multicast streams). + + 2007-09-08 Frédéric Bernon + * sockets.c, ip.h, api.h, tcp.h: declare a "struct ip_pcb" which only contains + IP_PCB. Add in the netconn's "pcb" union a "struct ip_pcb *ip;" (no size change). + Use this new field to access to common pcb fields (ttl, tos, so_options, etc...). + Enable to access to these fields with LWIP_TCP=0. + + 2007-09-05 Frédéric Bernon + * udp.c, ipv4/icmp.c, ipv4/ip.c, ipv6/icmp.c, ipv6/ip6.c, ipv4/icmp.h, + ipv6/icmp.h, opt.h: Integrate "task #7272 : LWIP_ICMP option". The new option + LWIP_ICMP enable/disable ICMP module inside the IP stack (enable per default). + Be careful, disabling ICMP make your product non-compliant to RFC1122, but + help to reduce footprint, and to reduce "visibility" on the Internet. + + 2007-09-05 Frédéric Bernon, Bill Florac + * opt.h, sys.h, tcpip.c, slipif.c, ppp.c, sys_arch.txt: Change parameters list + for sys_thread_new (see "task #7252 : Create sys_thread_new_ex()"). Two new + parameters have to be provided: a task name, and a task stack size. For this + one, since it's platform dependant, you could define the best one for you in + your lwipopts.h. For port maintainers, you can just add these new parameters + in your sys_arch.c file, and but it's not mandatory, use them in your OS + specific functions. + + 2007-09-05 Frédéric Bernon + * inet.c, autoip.c, msg_in.c, msg_out.c, init.c: Move some build time checkings + inside init.c for task #7142 "Sanity check user-configurable values". + + 2007-09-04 Frédéric Bernon, Bill Florac + * igmp.h, igmp.c, memp_std.h, memp.c, init.c, opt.h: Replace mem_malloc call by + memp_malloc, and use a new MEMP_NUM_IGMP_GROUP option (see opt.h to define the + value). It will avoid potential fragmentation problems, use a counter to know + how many times a group is used on an netif, and free it when all applications + leave it. MEMP_NUM_IGMP_GROUP got 8 as default value (and init.c got a sanity + check if LWIP_IGMP!=0). + + 2007-09-03 Frédéric Bernon + * igmp.h, igmp.c, sockets.c, api_msg.c: Changes for "#20503 IGMP Improvement". + Initialize igmp_mac_filter to NULL in netif_add (this field should be set in + the netif's "init" function). Use the "imr_interface" field (for socket layer) + and/or the "interface" field (for netconn layer), for join/leave operations. + The igmp_join/leavegroup first parameter change from a netif to an ipaddr. + This field could be a netif's ipaddr, or "any" (same meaning than ip_addr_isany). + + 2007-08-30 Frédéric Bernon + * Add netbuf.h, netbuf.c, Change api.h, api_lib.c: #7249 "Split netbuf functions + from api/api_lib". Now netbuf API is independant of netconn, and can be used + with other API (application based on raw API, or future "socket2" API). Ports + maintainers just have to add src/api/netbuf.c in their makefile/projects. + + 2007-08-30 Frédéric Bernon, Jonathan Larmour + * init.c: Add first version of lwip_sanity_check for task #7142 "Sanity check + user-configurable values". + + 2007-08-29 Frédéric Bernon + * igmp.h, igmp.c, tcpip.c, init.c, netif.c: change igmp_init and add igmp_start. + igmp_start is call inside netif_add. Now, igmp initialization is in the same + spirit than the others modules. Modify some IGMP debug traces. + + 2007-08-29 Frédéric Bernon + * Add init.h, init.c, Change opt.h, tcpip.c: Task #7213 "Add a lwip_init function" + Add lwip_init function to regroup all modules initializations, and to provide + a place to add code for task #7142 "Sanity check user-configurable values". + Ports maintainers should remove direct initializations calls from their code, + and add init.c in their makefiles. Note that lwip_init() function is called + inside tcpip_init, but can also be used by raw api users since all calls are + disabled when matching options are disabled. Also note that their is new options + in opt.h, you should configure in your lwipopts.h (they are enabled per default). + + 2007-08-26 Marc Boucher + * api_msg.c: do_close_internal(): Reset the callbacks and arg (conn) to NULL + since they can under certain circumstances be called with an invalid conn + pointer after the connection has been closed (and conn has been freed). + + 2007-08-25 Frédéric Bernon (Artem Migaev's Patch) + * netif.h, netif.c: Integrate "patch #6163 : Function to check if link layer is up". + Add a netif_is_link_up() function if LWIP_NETIF_LINK_CALLBACK option is set. + + 2007-08-22 Frédéric Bernon + * netif.h, netif.c, opt.h: Rename LWIP_NETIF_CALLBACK in LWIP_NETIF_STATUS_CALLBACK + to be coherent with new LWIP_NETIF_LINK_CALLBACK option before next release. + + 2007-08-22 Frédéric Bernon + * tcpip.h, tcpip.c, ethernetif.c, opt.h: remove options ETHARP_TCPIP_INPUT & + ETHARP_TCPIP_ETHINPUT, now, only "ethinput" code is supported, even if the + name is tcpip_input (we keep the name of 1.2.0 function). + + 2007-08-17 Jared Grubb + * memp_std.h, memp.h, memp.c, mem.c, stats.c: (Task #7136) Centralize mempool + settings into new memp_std.h and optional user file lwippools.h. This adds + more dynamic mempools, and allows the user to create an arbitrary number of + mempools for mem_malloc. + + 2007-08-16 Marc Boucher + * api_msg.c: Initialize newconn->state to NETCONN_NONE in accept_function; + otherwise it was left to NETCONN_CLOSE and sent_tcp() could prematurely + close the connection. + + 2007-08-16 Marc Boucher + * sockets.c: lwip_accept(): check netconn_peer() error return. + + 2007-08-16 Marc Boucher + * mem.c, mem.h: Added mem_calloc(). + + 2007-08-16 Marc Boucher + * tcpip.c, tcpip.h memp.c, memp.h: Added distinct memp (MEMP_TCPIP_MSG_INPKT) + for input packets to prevent floods from consuming all of MEMP_TCPIP_MSG + and starving other message types. + Renamed MEMP_TCPIP_MSG to MEMP_TCPIP_MSG_API + + 2007-08-16 Marc Boucher + * pbuf.c, pbuf.h, etharp.c, tcp_in.c, sockets.c: Split pbuf flags in pbuf + type and flgs (later renamed to flags). + Use enum pbuf_flag as pbuf_type. Renumber PBUF_FLAG_*. + Improved lwip_recvfrom(). TCP push now propagated. + + 2007-08-16 Marc Boucher + * ethernetif.c, contrib/ports/various: ethbroadcast now a shared global + provided by etharp. + + 2007-08-16 Marc Boucher + * ppp_oe.c ppp_oe.h, auth.c chap.c fsm.c lcp.c ppp.c ppp.h, + etharp.c ethernetif.c, etharp.h, opt.h tcpip.h, tcpip.c: + Added PPPoE support and various PPP improvements. + + 2007-07-25 Simon Goldschmidt + * api_lib.c, ip_frag.c, pbuf.c, api.h, pbuf.h: Introduced pbuf_copy_partial, + making netbuf_copy_partial use this function. + + 2007-07-25 Simon Goldschmidt + * tcp_in.c: Fix bug #20506: Slow start / initial congestion window starts with + 2 * mss (instead of 1 * mss previously) to comply with some newer RFCs and + other stacks. + + 2007-07-13 Jared Grubb (integrated by Frédéric Bernon) + * opt.h, netif.h, netif.c, ethernetif.c: Add new configuration option to add + a link callback in the netif struct, and functions to handle it. Be carefull + for port maintainers to add the NETIF_FLAG_LINK_UP flag (like in ethernetif.c) + if you want to be sure to be compatible with future changes... + + 2007-06-30 Frédéric Bernon + * sockets.h, sockets.c: Implement MSG_PEEK flag for recv/recvfrom functions. + + 2007-06-21 Simon Goldschmidt + * etharp.h, etharp.c: Combined etharp_request with etharp_raw for both + LWIP_AUTOIP =0 and =1 to remove redundant code. + + 2007-06-21 Simon Goldschmidt + * mem.c, memp.c, mem.h, memp.h, opt.h: task #6863: Introduced the option + MEM_USE_POOLS to use 4 pools with different sized elements instead of a + heap. This both prevents memory fragmentation and gives a higher speed + at the cost of more memory consumption. Turned off by default. + + 2007-06-21 Simon Goldschmidt + * api_lib.c, api_msg.c, api.h, api_msg.h: Converted the length argument of + netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into + int to be able to send a bigger buffer than 64K with one time (mainly + used from lwip_send). + + 2007-06-21 Simon Goldschmidt + * tcp.h, api_msg.c: Moved the nagle algorithm from netconn_write/do_write + into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too. + + 2007-06-21 Simon Goldschmidt + * api.h, api_lib.c, api_msg.c: Fixed bug #20021: Moved sendbuf-processing in + netconn_write from api_lib.c to api_msg.c to also prevent multiple context- + changes on low memory or empty send-buffer. + + 2007-06-18 Simon Goldschmidt + * etharp.c, etharp.h: Changed etharp to use a defined hardware address length + of 6 to avoid loading netif->hwaddr_len every time (since this file is only + used for ethernet and struct eth_addr already had a defined length of 6). + + 2007-06-17 Simon Goldschmidt + * sockets.c, sockets.h: Implemented socket options SO_NO_CHECK for UDP sockets + to disable UDP checksum generation on transmit. + + 2007-06-13 Frédéric Bernon, Simon Goldschmidt + * debug.h, api_msg.c: change LWIP_ERROR to use it to check errors like invalid + pointers or parameters, and let the possibility to redefined it in cc.h. Use + this macro to check "conn" parameter in api_msg.c functions. + + 2007-06-11 Simon Goldschmidt + * sockets.c, sockets.h: Added UDP lite support for sockets + + 2007-06-10 Simon Goldschmidt + * udp.h, opt.h, api_msg.c, ip.c, udp.c: Included switch LWIP_UDPLITE (enabled + by default) to switch off UDP-Lite support if not needed (reduces udp.c code + size) + + 2007-06-09 Dominik Spies (integrated by Frédéric Bernon) + * autoip.h, autoip.c, dhcp.h, dhcp.c, netif.h, netif.c, etharp.h, etharp.c, opt.h: + AutoIP implementation available for IPv4, with new options LWIP_AUTOIP and + LWIP_DHCP_AUTOIP_COOP if you want to cooperate with DHCP. Some tips to adapt + (see TODO mark in the source code). + + 2007-06-09 Simon Goldschmidt + * etharp.h, etharp.c, ethernetif.c: Modified order of parameters for + etharp_output() to match netif->output so etharp_output() can be used + directly as netif->output to save one function call. + + 2007-06-08 Simon Goldschmidt + * netif.h, ethernetif.c, slipif.c, loopif.c: Added define + NETIF_INIT_SNMP(netif, type, speed) to initialize per-netif snmp variables, + added initialization of those to ethernetif, slipif and loopif. + + 2007-05-18 Simon Goldschmidt + * opt.h, ip_frag.c, ip_frag.h, ip.c: Added option IP_FRAG_USES_STATIC_BUF + (defaulting to off for now) that can be set to 0 to send fragmented + packets by passing PBUF_REFs down the stack. + + 2007-05-23 Frédéric Bernon + * api_lib.c: Implement SO_RCVTIMEO for accept and recv on TCP + connections, such present in patch #5959. + + 2007-05-23 Frédéric Bernon + * api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx + code in only one part... + + 2007-05-18 Simon Goldschmidt + * opt.h, memp.h, memp.c: Added option MEMP_OVERFLOW_CHECK to check for memp + elements to overflow. This is achieved by adding some bytes before and after + each pool element (increasing their size, of course), filling them with a + prominent value and checking them on freeing the element. + Set it to 2 to also check every element in every pool each time memp_malloc() + or memp_free() is called (slower but more helpful). + + 2007-05-10 Simon Goldschmidt + * opt.h, memp.h, memp.c, pbuf.c (see task #6831): use a new memp pool for + PBUF_POOL pbufs instead of the old pool implementation in pbuf.c to reduce + code size. + + 2007-05-11 Frédéric Bernon + * sockets.c, api_lib.c, api_msg.h, api_msg.c, netifapi.h, netifapi.c, tcpip.c: + Include a function pointer instead of a table index in the message to reduce + footprint. Disable some part of lwip_send and lwip_sendto if some options are + not set (LWIP_TCP, LWIP_UDP, LWIP_RAW). + + 2007-05-10 Simon Goldschmidt + * *.h (except netif/ppp/*.h): Included patch #5448: include '#ifdef __cplusplus + \ extern "C" {' in all header files. Now you can write your application using + the lwIP stack in C++ and simply #include the core files. Note I have left + out the netif/ppp/*h header files for now, since I don't know which files are + included by applications and which are for internal use only. + + 2007-05-09 Simon Goldschmidt + * opt.h, *.c/*.h: Included patch #5920: Create define to override C-library + memcpy. 2 Defines are created: MEMCPY() for normal memcpy, SMEMCPY() for + situations where some compilers might inline the copy and save a function + call. Also replaced all calls to memcpy() with calls to (S)MEMCPY(). + + 2007-05-08 Simon Goldschmidt + * mem.h: If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc()) + to be overriden in case the C-library malloc implementation is not protected + against concurrent access. + + 2007-05-04 Simon Goldschmidt (Atte Kojo) + * etharp.c: Introduced fast one-entry-cache to speed up ARP lookup when sending + multiple packets to the same host. + + 2007-05-04 Frédéric Bernon, Jonathan Larmour + * sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fix bug #19162 "lwip_sento: a possible + to corrupt remote addr/port connection state". Reduce problems "not enought memory" with + netbuf (if we receive lot of datagrams). Improve lwip_sendto (only one exchange between + sockets api and api_msg which run in tcpip_thread context). Add netconn_sento function. + Warning, if you directly access to "fromaddr" & "fromport" field from netbuf struct, + these fields are now renamed "addr" & "port". + + 2007-04-11 Jonathan Larmour + * sys.h, api_lib.c: Provide new sys_mbox_tryfetch function. Require ports to provide new + sys_arch_mbox_tryfetch function to get a message if one is there, otherwise return + with SYS_MBOX_EMPTY. sys_arch_mbox_tryfetch can be implemented as a function-like macro + by the port in sys_arch.h if desired. + + 2007-04-06 Frédéric Bernon, Simon Goldschmidt + * opt.h, tcpip.h, tcpip.c, netifapi.h, netifapi.c: New configuration option LWIP_NETIF_API + allow to use thread-safe functions to add/remove netif in list, and to start/stop dhcp + clients, using new functions from netifapi.h. Disable as default (no port change to do). + + 2007-04-05 Frédéric Bernon + * sockets.c: remplace ENOBUFS errors on alloc_socket by ENFILE to be more BSD compliant. + + 2007-04-04 Simon Goldschmidt + * arch.h, api_msg.c, dhcp.c, msg_in.c, sockets.c: Introduced #define LWIP_UNUSED_ARG(x) + use this for and architecture-independent form to tell the compiler you intentionally + are not using this variable. Can be overriden in cc.h. + + 2007-03-28 Frédéric Bernon + * opt.h, netif.h, dhcp.h, dhcp.c: New configuration option LWIP_NETIF_HOSTNAME allow to + define a hostname in netif struct (this is just a pointer, so, you can use a hardcoded + string, point on one of your's ethernetif field, or alloc a string you will free yourself). + It will be used by DHCP to register a client hostname, but can also be use when you call + snmp_set_sysname. + + 2007-03-28 Frédéric Bernon + * netif.h, netif.c: A new NETIF_FLAG_ETHARP flag is defined in netif.h, to allow to + initialize a network interface's flag with. It tell this interface is an ethernet + device, and we can use ARP with it to do a "gratuitous ARP" (RFC 3220 "IP Mobility + Support for IPv4" section 4.6) when interface is "up" with netif_set_up(). + + 2007-03-26 Frédéric Bernon, Jonathan Larmour + * opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build + time if you only use PPP or SLIP. The default is enable. Note we don't have to call + etharp_init in your port's initilization sequence if you use tcpip.c, because this call + is done in tcpip_init function. + + 2007-03-22 Frédéric Bernon + * stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the + new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in + your lwipopts.h. More, unused counters are not defined in the stats structs, and not + display by stats_display(). Note that some options (SYS_STATS and RAW_STATS) are defined + but never used. Fix msg_in.c with the correct #if test for a stat display. + + 2007-03-21 Kieran Mansley + * netif.c, netif.h: Apply patch#4197 with some changes (originator: rireland@hmgsl.com). + Provides callback on netif up/down state change. + + 2007-03-11 Frédéric Bernon, Mace Gael, Steve Reynolds + * sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, igmp.h, igmp.c, + ip.c, netif.h, tcpip.c, opt.h: + New configuration option LWIP_IGMP to enable IGMP processing. Based on only one + filter per all network interfaces. Declare a new function in netif to enable to + control the MAC filter (to reduce lwIP traffic processing). + + 2007-03-11 Frédéric Bernon + * tcp.h, tcp.c, sockets.c, tcp_out.c, tcp_in.c, opt.h: Keepalive values can + be configured at run time with LWIP_TCP_KEEPALIVE, but don't change this + unless you know what you're doing (default are RFC1122 compliant). Note + that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set in seconds. + + 2007-03-08 Frédéric Bernon + * tcp.h: Keepalive values can be configured at compile time, but don't change + this unless you know what you're doing (default are RFC1122 compliant). + + 2007-03-08 Frédéric Bernon + * sockets.c, api.h, api_lib.c, tcpip.c, sys.h, sys.c, err.c, opt.h: + Implement LWIP_SO_RCVTIMEO configuration option to enable/disable SO_RCVTIMEO + on UDP sockets/netconn. + + 2007-03-08 Simon Goldschmidt + * snmp_msg.h, msg_in.c: SNMP UDP ports can be configured at compile time. + + 2007-03-06 Frédéric Bernon + * api.h, api_lib.c, sockets.h, sockets.c, tcpip.c, sys.h, sys.c, err.h: + Implement SO_RCVTIMEO on UDP sockets/netconn. + + 2007-02-28 Kieran Mansley (based on patch from Simon Goldschmidt) + * api_lib.c, tcpip.c, memp.c, memp.h: make API msg structs allocated + on the stack and remove the API msg type from memp + + 2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt) + * sockets.h, sockets.c: Move socket initialization to new + lwip_socket_init() function. + NOTE: this changes the API with ports. Ports will have to be + updated to call lwip_socket_init() now. + + 2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt) + * api_lib.c: Use memcpy in netbuf_copy_partial. + + + ++ Bug fixes: + + 2008-03-17 Frédéric Bernon, Ed Kerekes + * igmp.h, igmp.c: Fix bug #22613 "IGMP iphdr problem" (could have + some problems to fill the IP header on some targets, use now the + ip.h macros to do it). + + 2008-03-13 Frédéric Bernon + * sockets.c: Fix bug #22435 "lwip_recvfrom with TCP break;". Using + (lwip_)recvfrom with valid "from" and "fromlen" parameters, on a + TCP connection caused a crash. Note that using (lwip_)recvfrom + like this is a bit slow and that using (lwip)getpeername is the + good lwip way to do it (so, using recv is faster on tcp sockets). + + 2008-03-12 Frédéric Bernon, Jonathan Larmour + * api_msg.c, contrib/apps/ping.c: Fix bug #22530 "api_msg.c's + recv_raw() does not consume data", and the ping sample (with + LWIP_SOCKET=1, the code did the wrong supposition that lwip_recvfrom + returned the IP payload, without the IP header). + + 2008-03-04 Jonathan Larmour + * mem.c, stats.c, mem.h: apply patch #6414 to avoid compiler errors + and/or warnings on some systems where mem_size_t and size_t differ. + * pbuf.c, ppp.c: Fix warnings on some systems with mem_malloc. + + 2008-03-04 Kieran Mansley (contributions by others) + * Numerous small compiler error/warning fixes from contributions to + mailing list after 1.3.0 release candidate made. + + 2008-01-25 Cui hengbin (integrated by Frédéric Bernon) + * dns.c: Fix bug #22108 "DNS problem" caused by unaligned structures. + + 2008-01-15 Kieran Mansley + * tcp_out.c: BUG20511. Modify persist timer to start when we are + prevented from sending by a small send window, not just a zero + send window. + + 2008-01-09 Jonathan Larmour + * opt.h, ip.c: Rename IP_OPTIONS define to IP_OPTIONS_ALLOWED to avoid + conflict with Linux system headers. + + 2008-01-06 Jonathan Larmour + * dhcp.c: fix bug #19927: "DHCP NACK problem" by clearing any existing set IP + address entirely on receiving a DHCPNAK, and restarting discovery. + + 2007-12-21 Simon Goldschmidt + * sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698: "netconn->recv_avail + is not protected" by using new macros for interlocked access to modify/test + netconn->recv_avail. + + 2007-12-20 Kieran Mansley (based on patch from Oleg Tyshev) + * tcp_in.c: fix bug# 21535 (nrtx not reset correctly in SYN_SENT state) + + 2007-12-20 Kieran Mansley (based on patch from Per-Henrik Lundbolm) + * tcp.c, tcp_in.c, tcp_out.c, tcp.h: fix bug #20199 (better handling + of silly window avoidance and prevent lwIP from shrinking the window) + + 2007-12-04 Simon Goldschmidt + * tcp.c, tcp_in.c: fix bug #21699 (segment leak in ooseq processing when last + data packet was lost): add assert that all segment lists are empty in + tcp_pcb_remove before setting pcb to CLOSED state; don't directly set CLOSED + state from LAST_ACK in tcp_process + + 2007-12-02 Simon Goldschmidt + * sockets.h: fix bug #21654: exclude definition of struct timeval from #ifndef FD_SET + If including for system-struct timeval, LWIP_TIMEVAL_PRIVATE now + has to be set to 0 in lwipopts.h + + 2007-12-02 Simon Goldschmidt + * api_msg.c, api_lib.c: fix bug #21656 (recvmbox problem in netconn API): always + allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen + netconn, this recvmbox is later freed and a new mbox is allocated for acceptmbox. + This is a fix for thread-safety and allocates all items needed for a netconn + when the netconn is created. + + 2007-11-30 Simon Goldschmidt + * udp.c: first attempt to fix bug #21655 (DHCP doesn't work reliably with multiple + netifs): if LWIP_DHCP is enabled, UDP packets to DHCP_CLIENT_PORT are passed + to netif->dhcp->pcb only (if that exists) and not to any other pcb for the same + port (only solution to let UDP pcbs 'bind' to a netif instead of an IP address) + + 2007-11-27 Simon Goldschmidt + * ip.c: fixed bug #21643 (udp_send/raw_send don't fail if netif is down) by + letting ip_route only use netifs that are up. + + 2007-11-27 Simon Goldschmidt + * err.h, api_lib.c, api_msg.c, sockets.c: Changed error handling: ERR_MEM, ERR_BUF + and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and + sockets block most operations once they have seen a fatal error. + + 2007-11-27 Simon Goldschmidt + * udp.h, udp.c, dhcp.c: Implemented new function udp_sendto_if which takes the + netif to send as an argument (to be able to send on netifs that are down). + + 2007-11-26 Simon Goldschmidt + * tcp_in.c: Fixed bug #21582: pcb->acked accounting can be wrong when ACKs + arrive out-of-order + + 2007-11-21 Simon Goldschmidt + * tcp.h, tcp_out.c, api_msg.c: Fixed bug #20287: tcp_output_nagle sends too early + Fixed the nagle algorithm; nagle now also works for all raw API applications + and has to be explicitly disabled with 'tcp_pcb->flags |= TF_NODELAY' + + 2007-11-12 Frédéric Bernon + * sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fixed bug #20900. Now, most + of the netconn_peer and netconn_addr processing is done inside tcpip_thread + context in do_getaddr. + + 2007-11-10 Simon Goldschmidt + * etharp.c: Fixed bug: assert fired when MEMP_ARP_QUEUE was empty (which can + happen any time). Now the packet simply isn't enqueued when out of memory. + + 2007-11-01 Simon Goldschmidt + * tcp.c, tcp_in.c: Fixed bug #21494: The send mss (pcb->mss) is set to 536 (or + TCP_MSS if that is smaller) as long as no MSS option is received from the + remote host. + + 2007-11-01 Simon Goldschmidt + * tcp.h, tcp.c, tcp_in.c: Fixed bug #21491: The MSS option sent (with SYN) + is now based on TCP_MSS instead of pcb->mss (on passive open now effectively + sending our configured TCP_MSS instead of the one received). + + 2007-11-01 Simon Goldschmidt + * tcp_in.c: Fixed bug #21181: On active open, the initial congestion window was + calculated based on the configured TCP_MSS, not on the MSS option received + with SYN+ACK. + + 2007-10-09 Simon Goldschmidt + * udp.c, inet.c, inet.h: Fixed UDPLite: send: Checksum was always generated too + short and also was generated wrong if checksum coverage != tot_len; + receive: checksum was calculated wrong if checksum coverage != tot_len + + 2007-10-08 Simon Goldschmidt + * mem.c: lfree was not updated in mem_realloc! + + 2007-10-07 Frédéric Bernon + * sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential + crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT: + this change cause an API breakage for netconn_addr, since a parameter + type change. Any compiler should cause an error without any changes in + yours netconn_peer calls (so, it can't be a "silent change"). It also + reduce a little bit the footprint for socket layer (lwip_getpeername & + lwip_getsockname use now a common lwip_getaddrname function since + netconn_peer & netconn_addr have the same parameters). + + 2007-09-20 Simon Goldschmidt + * tcp.c: Fixed bug #21080 (tcp_bind without check pcbs in TIME_WAIT state) + by checking tcp_tw_pcbs also + + 2007-09-19 Simon Goldschmidt + * icmp.c: Fixed bug #21107 (didn't reset IP TTL in ICMP echo replies) + + 2007-09-15 Mike Kleshov + * mem.c: Fixed bug #21077 (inaccuracy in calculation of lwip_stat.mem.used) + + 2007-09-06 Frédéric Bernon + * several-files: replace some #include "arch/cc.h" by "lwip/arch.h", or simply remove + it as long as "lwip/opt.h" is included before (this one include "lwip/debug.h" which + already include "lwip/arch.h"). Like that, default defines are provided by "lwip/arch.h" + if they are not defined in cc.h, in the same spirit than "lwip/opt.h" for lwipopts.h. + + 2007-08-30 Frédéric Bernon + * igmp.h, igmp.c: Some changes to remove some redundant code, add some traces, + and fix some coding style. + + 2007-08-28 Frédéric Bernon + * tcpip.c: Fix TCPIP_MSG_INPKT processing: now, tcpip_input can be used for any + kind of packets. These packets are considered like Ethernet packets (payload + pointing to ethhdr) if the netif got the NETIF_FLAG_ETHARP flag. Else, packets + are considered like IP packets (payload pointing to iphdr). + + 2007-08-27 Frédéric Bernon + * api.h, api_lib.c, api_msg.c: First fix for "bug #20900 : Potential crash error + problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state + and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT). + + 2007-08-24 Kieran Mansley + * inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy + compiler (Paradigm C++) + + 2007-08-09 Frédéric Bernon, Bill Florac + * stats.h, stats.c, igmp.h, igmp.c, opt.h: Fix for bug #20503 : IGMP Improvement. + Introduce IGMP_STATS to centralize statistics management. + + 2007-08-09 Frédéric Bernon, Bill Florac + * udp.c: Fix for bug #20503 : IGMP Improvement. Enable to receive a multicast + packet on a udp pcb binded on an netif's IP address, and not on "any". + + 2007-08-09 Frédéric Bernon, Bill Florac + * igmp.h, igmp.c, ip.c: Fix minor changes from bug #20503 : IGMP Improvement. + This is mainly on using lookup/lookfor, and some coding styles... + + 2007-07-26 Frédéric Bernon (and "thedoctor") + * igmp.c: Fix bug #20595 to accept IGMPv3 "Query" messages. + + 2007-07-25 Simon Goldschmidt + * api_msg.c, tcp.c: Another fix for bug #20021: by not returning an error if + tcp_output fails in tcp_close, the code in do_close_internal gets simpler + (tcp_output is called again later from tcp timers). + + 2007-07-25 Simon Goldschmidt + * ip_frag.c: Fixed bug #20429: use the new pbuf_copy_partial instead of the old + copy_from_pbuf, which illegally modified the given pbuf. + + 2007-07-25 Simon Goldschmidt + * tcp_out.c: tcp_enqueue: pcb->snd_queuelen didn't work for chaine PBUF_RAMs: + changed snd_queuelen++ to snd_queuelen += pbuf_clen(p). + + 2007-07-24 Simon Goldschmidt + * api_msg.c, tcp.c: Fix bug #20480: Check the pcb passed to tcp_listen() for the + correct state (must be CLOSED). + + 2007-07-13 Thomas Taranowski (commited by Jared Grubb) + * memp.c: Fix bug #20478: memp_malloc returned NULL+MEMP_SIZE on failed + allocation. It now returns NULL. + + 2007-07-13 Frédéric Bernon + * api_msg.c: Fix bug #20318: api_msg "recv" callbacks don't call pbuf_free in + all error cases. + + 2007-07-13 Frédéric Bernon + * api_msg.c: Fix bug #20315: possible memory leak problem if tcp_listen failed, + because current code doesn't follow rawapi.txt documentation. + + 2007-07-13 Kieran Mansley + * src/core/tcp_in.c Apply patch#5741 from Oleg Tyshev to fix bug in + out of sequence processing of received packets + + 2007-07-03 Simon Goldschmidt + * nearly-all-files: Added assertions where PBUF_RAM pbufs are used and an + assumption is made that this pbuf is in one piece (i.e. not chained). These + assumptions clash with the possibility of converting to fully pool-based + pbuf implementations, where PBUF_RAM pbufs might be chained. + + 2007-07-03 Simon Goldschmidt + * api.h, api_lib.c, api_msg.c: Final fix for bug #20021 and some other problems + when closing tcp netconns: removed conn->sem, less context switches when + closing, both netconn_close and netconn_delete should safely close tcp + connections. + + 2007-07-02 Simon Goldschmidt + * ipv4/ip.h, ipv6/ip.h, opt.h, netif.h, etharp.h, ipv4/ip.c, netif.c, raw.c, + tcp_out.c, udp.c, etharp.c: Added option LWIP_NETIF_HWADDRHINT (default=off) + to cache ARP table indices with each pcb instead of single-entry cache for + the complete stack. + + 2007-07-02 Simon Goldschmidt + * tcp.h, tcp.c, tcp_in.c, tcp_out.c: Added some ASSERTS and casts to prevent + warnings when assigning to smaller types. + + 2007-06-28 Simon Goldschmidt + * tcp_out.c: Added check to prevent tcp_pcb->snd_queuelen from overflowing. + + 2007-06-28 Simon Goldschmidt + * tcp.h: Fixed bug #20287: Fixed nagle algorithm (sending was done too early if + a segment contained chained pbufs) + + 2007-06-28 Frédéric Bernon + * autoip.c: replace most of rand() calls by a macro LWIP_AUTOIP_RAND which compute + a "pseudo-random" value based on netif's MAC and some autoip fields. It's always + possible to define this macro in your own lwipopts.h to always use C library's + rand(). Note that autoip_create_rand_addr doesn't use this macro. + + 2007-06-28 Frédéric Bernon + * netifapi.h, netifapi.c, tcpip.h, tcpip.c: Update code to handle the option + LWIP_TCPIP_CORE_LOCKING, and do some changes to be coherent with last modifications + in api_lib/api_msg (use pointers and not type with table, etc...) + + 2007-06-26 Simon Goldschmidt + * udp.h: Fixed bug #20259: struct udp_hdr was lacking the packin defines. + + 2007-06-25 Simon Goldschmidt + * udp.c: Fixed bug #20253: icmp_dest_unreach was called with a wrong p->payload + for udp packets with no matching pcb. + + 2007-06-25 Simon Goldschmidt + * udp.c: Fixed bug #20220: UDP PCB search in udp_input(): a non-local match + could get udp input packets if the remote side matched. + + 2007-06-13 Simon Goldschmidt + * netif.c: Fixed bug #20180 (TCP pcbs listening on IP_ADDR_ANY could get + changed in netif_set_ipaddr if previous netif->ip_addr.addr was 0. + + 2007-06-13 Simon Goldschmidt + * api_msg.c: pcb_new sets conn->err if protocol is not implemented + -> netconn_new_..() does not allocate a new connection for unsupported + protocols. + + 2007-06-13 Frédéric Bernon, Simon Goldschmidt + * api_lib.c: change return expression in netconn_addr and netconn_peer, because + conn->err was reset to ERR_OK without any reasons (and error was lost)... + + 2007-06-13 Frédéric Bernon, Matthias Weisser + * opt.h, mem.h, mem.c, memp.c, pbuf.c, ip_frag.c, vj.c: Fix bug #20162. Rename + MEM_ALIGN in LWIP_MEM_ALIGN and MEM_ALIGN_SIZE in LWIP_MEM_ALIGN_SIZE to avoid + some macro names collision with some OS macros. + + 2007-06-11 Simon Goldschmidt + * udp.c: UDP Lite: corrected the use of chksum_len (based on RFC3828: if it's 0, + create checksum over the complete packet. On RX, if it's < 8 (and not 0), + discard the packet. Also removed the duplicate 'udphdr->chksum = 0' for both + UDP & UDP Lite. + + 2007-06-11 Srinivas Gollakota & Oleg Tyshev + * tcp_out.c: Fix for bug #20075 : "A problem with keep-alive timer and TCP flags" + where TCP flags wasn't initialized in tcp_keepalive. + + 2007-06-03 Simon Goldschmidt + * udp.c: udp_input(): Input pbuf was not freed if pcb had no recv function + registered, p->payload was modified without modifying p->len if sending + icmp_dest_unreach() (had no negative effect but was definitively wrong). + + 2007-06-03 Simon Goldschmidt + * icmp.c: Corrected bug #19937: For responding to an icmp echo request, icmp + re-used the input pbuf even if that didn't have enough space to include the + link headers. Now the space is tested and a new pbuf is allocated for the + echo response packet if the echo request pbuf isn't big enough. + + 2007-06-01 Simon Goldschmidt + * sockets.c: Checked in patch #5914: Moved sockopt processing into tcpip_thread. + + 2007-05-23 Frédéric Bernon + * api_lib.c, sockets.c: Fixed bug #5958 for netconn_listen (acceptmbox only + allocated by do_listen if success) and netconn_accept errors handling. In + most of api_lib functions, we replace some errors checkings like "if (conn==NULL)" + by ASSERT, except for netconn_delete. + + 2007-05-23 Frédéric Bernon + * api_lib.c: Fixed bug #5957 "Safe-thread problem inside netconn_recv" to return + an error code if it's impossible to fetch a pbuf on a TCP connection (and not + directly close the recvmbox). + + 2007-05-22 Simon Goldschmidt + * tcp.c: Fixed bug #1895 (tcp_bind not correct) by introducing a list of + bound but unconnected (and non-listening) tcp_pcbs. + + 2007-05-22 Frédéric Bernon + * sys.h, sys.c, api_lib.c, tcpip.c: remove sys_mbox_fetch_timeout() (was only + used for LWIP_SO_RCVTIMEO option) and use sys_arch_mbox_fetch() instead of + sys_mbox_fetch() in api files. Now, users SHOULD NOT use internal lwIP features + like "sys_timeout" in their application threads. + + 2007-05-22 Frédéric Bernon + * api.h, api_lib.c, api_msg.h, api_msg.c: change the struct api_msg_msg to see + which parameters are used by which do_xxx function, and to avoid "misusing" + parameters (patch #5938). + + 2007-05-22 Simon Goldschmidt + * api_lib.c, api_msg.c, raw.c, api.h, api_msg.h, raw.h: Included patch #5938: + changed raw_pcb.protocol from u16_t to u8_t since for IPv4 and IPv6, proto + is only 8 bits wide. This affects the api, as there, the protocol was + u16_t, too. + + 2007-05-18 Simon Goldschmidt + * memp.c: addition to patch #5913: smaller pointer was returned but + memp_memory was the same size -> did not save memory. + + 2007-05-16 Simon Goldschmidt + * loopif.c, slipif.c: Fix bug #19729: free pbuf if netif->input() returns + != ERR_OK. + + 2007-05-16 Simon Goldschmidt + * api_msg.c, udp.c: If a udp_pcb has a local_ip set, check if it is the same + as the one of the netif used for sending to prevent sending from old + addresses after a netif address gets changed (partly fixes bug #3168). + + 2007-05-16 Frédéric Bernon + * tcpip.c, igmp.h, igmp.c: Fixed bug "#19800 : IGMP: igmp_tick() will not work + with NO_SYS=1". Note that igmp_init is always in tcpip_thread (and not in + tcpip_init) because we have to be sure that network interfaces are already + added (mac filter is updated only in igmp_init for the moment). + + 2007-05-16 Simon Goldschmidt + * mem.c, memp.c: Removed semaphores from memp, changed sys_sem_wait calls + into sys_arch_sem_wait calls to prevent timers from running while waiting + for the heap. This fixes bug #19167. + + 2007-05-13 Simon Goldschmidt + * tcp.h, sockets.h, sockets.c: Fixed bug from patch #5865 by moving the defines + for socket options (lwip_set/-getsockopt) used with level IPPROTO_TCP from + tcp.h to sockets.h. + + 2007-05-07 Simon Goldschmidt + * mem.c: Another attempt to fix bug #17922. + + 2007-05-04 Simon Goldschmidt + * pbuf.c, pbuf.h, etharp.c: Further update to ARP queueing: Changed pbuf_copy() + implementation so that it can be reused (don't allocate the target + pbuf inside pbuf_copy()). + + 2007-05-04 Simon Goldschmidt + * memp.c: checked in patch #5913: in memp_malloc() we can return memp as mem + to save a little RAM (next pointer of memp is not used while not in pool). + + 2007-05-03 "maq" + * sockets.c: Fix ioctl FIONREAD when some data remains from last recv. + (patch #3574). + + 2007-04-23 Simon Goldschmidt + * loopif.c, loopif.h, opt.h, src/netif/FILES: fix bug #2595: "loopif results + in NULL reference for incoming TCP packets". Loopif has to be configured + (using LWIP_LOOPIF_MULTITHREADING) to directly call netif->input() + (multithreading environments, e.g. netif->input() = tcpip_input()) or + putting packets on a list that is fed to the stack by calling loopif_poll() + (single-thread / NO_SYS / polling environment where e.g. + netif->input() = ip_input). + + 2007-04-17 Jonathan Larmour + * pbuf.c: Use s32_t in pbuf_realloc(), as an s16_t can't reliably hold + the difference between two u16_t's. + * sockets.h: FD_SETSIZE needs to match number of sockets, which is + MEMP_NUM_NETCONN in sockets.c right now. + + 2007-04-12 Jonathan Larmour + * icmp.c: Reset IP header TTL in ICMP ECHO responses (bug #19580). + + 2007-04-12 Kieran Mansley + * tcp.c, tcp_in.c, tcp_out.c, tcp.h: Modify way the retransmission + timer is reset to fix bug#19434, with help from Oleg Tyshev. + + 2007-04-11 Simon Goldschmidt + * etharp.c, pbuf.c, pbuf.h: 3rd fix for bug #11400 (arp-queuing): More pbufs than + previously thought need to be copied (everything but PBUF_ROM!). Cleaned up + pbuf.c: removed functions no needed any more (by etharp). + + 2007-04-11 Kieran Mansley + * inet.c, ip_addr.h, sockets.h, sys.h, tcp.h: Apply patch #5745: Fix + "Constant is long" warnings with 16bit compilers. Contributed by + avatar@mmlab.cse.yzu.edu.tw + + 2007-04-05 Frédéric Bernon, Jonathan Larmour + * api_msg.c: Fix bug #16830: "err_tcp() posts to connection mailbox when no pend on + the mailbox is active". Now, the post is only done during a connect, and do_send, + do_write and do_join_leave_group don't do anything if a previous error was signaled. + + 2007-04-03 Frédéric Bernon + * ip.c: Don't set the IP_DF ("Don't fragment") flag in the IP header in IP output + packets. See patch #5834. + + 2007-03-30 Frédéric Bernon + * api_msg.c: add a "pcb_new" helper function to avoid redundant code, and to add + missing pcb allocations checking (in do_bind, and for each raw_new). Fix style. + + 2007-03-30 Frédéric Bernon + * most of files: prefix all debug.h define with "LWIP_" to avoid any conflict with + others environment defines (these were too "generic"). + + 2007-03-28 Frédéric Bernon + * api.h, api_lib.c, sockets.c: netbuf_ref doesn't check its internal pbuf_alloc call + result and can cause a crash. lwip_send now check netbuf_ref result. + + 2007-03-28 Simon Goldschmidt + * sockets.c Remove "#include " from sockets.c to avoid multiple + definition of macros (in errno.h and lwip/arch.h) if LWIP_PROVIDE_ERRNO is + defined. This is the way it should have been already (looking at + doc/sys_arch.txt) + + 2007-03-28 Kieran Mansley + * opt.h Change default PBUF_POOL_BUFSIZE (again) to accomodate default MSS + + IP and TCP headers *and* physical link headers + + 2007-03-26 Frédéric Bernon (based on patch from Dmitry Potapov) + * api_lib.c: patch for netconn_write(), fixes a possible race condition which cause + to send some garbage. It is not a definitive solution, but the patch does solve + the problem for most cases. + + 2007-03-22 Frédéric Bernon + * api_msg.h, api_msg.c: Remove obsolete API_MSG_ACCEPT and do_accept (never used). + + 2007-03-22 Frédéric Bernon + * api_lib.c: somes resources couldn't be freed if there was errors during + netconn_new_with_proto_and_callback. + + 2007-03-22 Frédéric Bernon + * ethernetif.c: update netif->input calls to check return value. In older ports, + it's a good idea to upgrade them, even if before, there could be another problem + (access to an uninitialized mailbox). + + 2007-03-21 Simon Goldschmidt + * sockets.c: fixed bug #5067 (essentialy a signed/unsigned warning fixed + by casting to unsigned). + + 2007-03-21 Frédéric Bernon + * api_lib.c, api_msg.c, tcpip.c: integrate sys_mbox_fetch(conn->mbox, NULL) calls from + api_lib.c to tcpip.c's tcpip_apimsg(). Now, use a local variable and not a + dynamic one from memp to send tcpip_msg to tcpip_thread in a synchrone call. + Free tcpip_msg from tcpip_apimsg is not done in tcpip_thread. This give a + faster and more reliable communication between api_lib and tcpip. + + 2007-03-21 Frédéric Bernon + * opt.h: Add LWIP_NETIF_CALLBACK (to avoid compiler warning) and set it to 0. + + 2007-03-21 Frédéric Bernon + * api_msg.c, igmp.c, igmp.h: Fix C++ style comments + + 2007-03-21 Kieran Mansley + * opt.h Change default PBUF_POOL_BUFSIZE to accomodate default MSS + + IP and TCP headers + + 2007-03-21 Kieran Mansley + * Fix all uses of pbuf_header to check the return value. In some + cases just assert if it fails as I'm not sure how to fix them, but + this is no worse than before when they would carry on regardless + of the failure. + + 2007-03-21 Kieran Mansley + * sockets.c, igmp.c, igmp.h, memp.h: Fix C++ style comments and + comment out missing header include in icmp.c + + 2007-03-20 Frédéric Bernon + * memp.h, stats.c: Fix stats_display function where memp_names table wasn't + synchronized with memp.h. + + 2007-03-20 Frédéric Bernon + * tcpip.c: Initialize tcpip's mbox, and verify if initialized in tcpip_input, + tcpip_ethinput, tcpip_callback, tcpip_apimsg, to fix a init problem with + network interfaces. Also fix a compiler warning. + + 2007-03-20 Kieran Mansley + * udp.c: Only try and use pbuf_header() to make space for headers if + not a ROM or REF pbuf. + + 2007-03-19 Frédéric Bernon + * api_msg.h, api_msg.c, tcpip.h, tcpip.c: Add return types to tcpip_apimsg() + and api_msg_post(). + + 2007-03-19 Frédéric Bernon + * Remove unimplemented "memp_realloc" function from memp.h. + + 2007-03-11 Simon Goldschmidt + * pbuf.c: checked in patch #5796: pbuf_alloc: len field claculation caused + memory corruption. + + 2007-03-11 Simon Goldschmidt (based on patch from Dmitry Potapov) + * api_lib.c, sockets.c, api.h, api_msg.h, sockets.h: Fixed bug #19251 + (missing `const' qualifier in socket functions), to get more compatible to + standard POSIX sockets. + + 2007-03-11 Frédéric Bernon (based on patch from Dmitry Potapov) + * sockets.c: Add asserts inside bind, connect and sendto to check input + parameters. Remove excessive set_errno() calls after get_socket(), because + errno is set inside of get_socket(). Move last sock_set_errno() inside + lwip_close. + + 2007-03-09 Simon Goldschmidt + * memp.c: Fixed bug #11400: New etharp queueing introduced bug: memp_memory + was allocated too small. + + 2007-03-06 Simon Goldschmidt + * tcpip.c: Initialize dhcp timers in tcpip_thread (if LWIP_DHCP) to protect + the stack from concurrent access. + + 2007-03-06 Frédéric Bernon, Dmitry Potapov + * tcpip.c, ip_frag.c, ethernetif.c: Fix some build problems, and a redundancy + call to "lwip_stats.link.recv++;" in low_level_input() & ethernetif_input(). + + 2007-03-06 Simon Goldschmidt + * ip_frag.c, ip_frag.h: Reduce code size: don't include code in those files + if IP_FRAG == 0 and IP_REASSEMBLY == 0 + + 2007-03-06 Frédéric Bernon, Simon Goldschmidt + * opt.h, ip_frag.h, tcpip.h, tcpip.c, ethernetif.c: add new configuration + option named ETHARP_TCPIP_ETHINPUT, which enable the new tcpip_ethinput. + Allow to do ARP processing for incoming packets inside tcpip_thread + (protecting ARP layer against concurrent access). You can also disable + old code using tcp_input with new define ETHARP_TCPIP_INPUT set to 0. + Older ports have to use tcpip_ethinput. + + 2007-03-06 Simon Goldschmidt (based on patch from Dmitry Potapov) + * err.h, err.c: fixed compiler warning "initialization dircards qualifiers + from pointer target type" + + 2007-03-05 Frédéric Bernon + * opt.h, sockets.h: add new configuration options (LWIP_POSIX_SOCKETS_IO_NAMES, + ETHARP_TRUST_IP_MAC, review SO_REUSE) + + 2007-03-04 Frédéric Bernon + * api_msg.c: Remove some compiler warnings : parameter "pcb" was never + referenced. + + 2007-03-04 Frédéric Bernon + * api_lib.c: Fix "[patch #5764] api_lib.c cleanup: after patch #5687" (from + Dmitry Potapov). + The api_msg struct stay on the stack (not moved to netconn struct). + + 2007-03-04 Simon Goldschmidt (based on patch from Dmitry Potapov) + * pbuf.c: Fix BUG#19168 - pbuf_free can cause deadlock (if + SYS_LIGHTWEIGHT_PROT=1 & freeing PBUF_RAM when mem_sem is not available) + Also fixed cast warning in pbuf_alloc() + + 2007-03-04 Simon Goldschmidt + * etharp.c, etharp.h, memp.c, memp.h, opt.h: Fix BUG#11400 - don't corrupt + existing pbuf chain when enqueuing multiple pbufs to a pending ARP request + + 2007-03-03 Frédéric Bernon + * udp.c: remove obsolete line "static struct udp_pcb *pcb_cache = NULL;" + It is static, and never used in udp.c except udp_init(). + + 2007-03-02 Simon Goldschmidt + * tcpip.c: Moved call to ip_init(), udp_init() and tcp_init() from + tcpip_thread() to tcpip_init(). This way, raw API connections can be + initialized before tcpip_thread is running (e.g. before OS is started) + + 2007-03-02 Frédéric Bernon + * rawapi.txt: Fix documentation mismatch with etharp.h about etharp_tmr's call + interval. + + 2007-02-28 Kieran Mansley + * pbuf.c: Fix BUG#17645 - ensure pbuf payload pointer is not moved + outside the region of the pbuf by pbuf_header() + + 2007-02-28 Kieran Mansley + * sockets.c: Fix BUG#19161 - ensure milliseconds timeout is non-zero + when supplied timeout is also non-zero + +(STABLE-1.2.0) + + 2006-12-05 Leon Woestenberg + * CHANGELOG: Mention STABLE-1.2.0 release. + + ++ New features: + + 2006-12-01 Christiaan Simons + * mem.h, opt.h: Added MEM_LIBC_MALLOC option. + Note this is a workaround. Currently I have no other options left. + + 2006-10-26 Christiaan Simons (accepted patch by Jonathan Larmour) + * ipv4/ip_frag.c: rename MAX_MTU to IP_FRAG_MAX_MTU and move define + to include/lwip/opt.h. + * ipv4/lwip/ip_frag.h: Remove unused IP_REASS_INTERVAL. + Move IP_REASS_MAXAGE and IP_REASS_BUFSIZE to include/lwip/opt.h. + * opt.h: Add above new options. + + 2006-08-18 Christiaan Simons + * tcp_{in,out}.c: added SNMP counters. + * ipv4/ip.c: added SNMP counters. + * ipv4/ip_frag.c: added SNMP counters. + + 2006-08-08 Christiaan Simons + * etharp.{c,h}: added etharp_find_addr() to read + (stable) ethernet/IP address pair from ARP table + + 2006-07-14 Christiaan Simons + * mib_structs.c: added + * include/lwip/snmp_structs.h: added + * netif.{c,h}, netif/ethernetif.c: added SNMP statistics to netif struct + + 2006-07-06 Christiaan Simons + * snmp/asn1_{enc,dec}.c added + * snmp/mib2.c added + * snmp/msg_{in,out}.c added + * include/lwip/snmp_asn1.h added + * include/lwip/snmp_msg.h added + * doc/snmp_agent.txt added + + 2006-03-29 Christiaan Simons + * inet.c, inet.h: Added platform byteswap support. + Added LWIP_PLATFORM_BYTESWAP define (defaults to 0) and + optional LWIP_PLATFORM_HTONS(), LWIP_PLATFORM_HTONL() macros. + + ++ Bug fixes: + + 2006-11-30 Christiaan Simons + * dhcp.c: Fixed false triggers of request_timeout. + + 2006-11-28 Christiaan Simons + * netif.c: In netif_add() fixed missing clear of ip_addr, netmask, gw and flags. + + 2006-10-11 Christiaan Simons + * api_lib.c etharp.c, ip.c, memp.c, stats.c, sys.{c,h} tcp.h: + Partially accepted patch #5449 for ANSI C compatibility / build fixes. + * ipv4/lwip/ip.h ipv6/lwip/ip.h: Corrected UDP-Lite protocol + identifier from 170 to 136 (bug #17574). + + 2006-10-10 Christiaan Simons + * api_msg.c: Fixed Nagle algorithm as reported by Bob Grice. + + 2006-08-17 Christiaan Simons + * udp.c: Fixed bug #17200, added check for broadcast + destinations for PCBs bound to a unicast address. + + 2006-08-07 Christiaan Simons + * api_msg.c: Flushing TCP output in do_close() (bug #15926). + + 2006-06-27 Christiaan Simons + * api_msg.c: Applied patch for cold case (bug #11135). + In accept_function() ensure newconn->callback is always initialized. + + 2006-06-15 Christiaan Simons + * mem.h: added MEM_SIZE_F alias to fix an ancient cold case (bug #1748), + facilitate printing of mem_size_t and u16_t statistics. + + 2006-06-14 Christiaan Simons + * api_msg.c: Applied patch #5146 to handle allocation failures + in accept() by Kevin Lawson. + + 2006-05-26 Christiaan Simons + * api_lib.c: Removed conn->sem creation and destruction + from netconn_write() and added sys_sem_new to netconn_new_*. + +(STABLE-1_1_1) + + 2006-03-03 Christiaan Simons + * ipv4/ip_frag.c: Added bound-checking assertions on ip_reassbitmap + access and added pbuf_alloc() return value checks. + + 2006-01-01 Leon Woestenberg + * tcp_{in,out}.c, tcp_out.c: Removed 'even sndbuf' fix in TCP, which is + now handled by the checksum routine properly. + + 2006-02-27 Leon Woestenberg + * pbuf.c: Fix alignment; pbuf_init() would not work unless + pbuf_pool_memory[] was properly aligned. (Patch by Curt McDowell.) + + 2005-12-20 Leon Woestenberg + * tcp.c: Remove PCBs which stay in LAST_ACK state too long. Patch + submitted by Mitrani Hiroshi. + + 2005-12-15 Christiaan Simons + * inet.c: Disabled the added summing routine to preserve code space. + + 2005-12-14 Leon Woestenberg + * tcp_in.c: Duplicate FIN ACK race condition fix by Kelvin Lawson. + Added Curt McDowell's optimized checksumming routine for future + inclusion. Need to create test case for unaliged, aligned, odd, + even length combination of cases on various endianess machines. + + 2005-12-09 Christiaan Simons + * inet.c: Rewrote standard checksum routine in proper portable C. + + 2005-11-25 Christiaan Simons + * udp.c tcp.c: Removed SO_REUSE hack. Should reside in socket code only. + * *.c: introduced cc.h LWIP_DEBUG formatters matching the u16_t, s16_t, + u32_t, s32_t typedefs. This solves most debug word-length assumes. + + 2005-07-17 Leon Woestenberg + * inet.c: Fixed unaligned 16-bit access in the standard checksum + routine by Peter Jolasson. + * slipif.c: Fixed implementation assumption of single-pbuf datagrams. + + 2005-02-04 Leon Woestenberg + * tcp_out.c: Fixed uninitialized 'queue' referenced in memerr branch. + * tcp_{out|in}.c: Applied patch fixing unaligned access. + + 2005-01-04 Leon Woestenberg + * pbuf.c: Fixed missing semicolon after LWIP_DEBUG statement. + + 2005-01-03 Leon Woestenberg + * udp.c: UDP pcb->recv() was called even when it was NULL. + +(STABLE-1_1_0) + + 2004-12-28 Leon Woestenberg + * etharp.*: Disabled multiple packets on the ARP queue. + This clashes with TCP queueing. + + 2004-11-28 Leon Woestenberg + * etharp.*: Fixed race condition from ARP request to ARP timeout. + Halved the ARP period, doubled the period counts. + ETHARP_MAX_PENDING now should be at least 2. This prevents + the counter from reaching 0 right away (which would allow + too little time for ARP responses to be received). + + 2004-11-25 Leon Woestenberg + * dhcp.c: Decline messages were not multicast but unicast. + * etharp.c: ETHARP_CREATE is renamed to ETHARP_TRY_HARD. + Do not try hard to insert arbitrary packet's source address, + etharp_ip_input() now calls etharp_update() without ETHARP_TRY_HARD. + etharp_query() now always DOES call ETHARP_TRY_HARD so that users + querying an address will see it appear in the cache (DHCP could + suffer from this when a server invalidly gave an in-use address.) + * ipv4/ip_addr.h: Renamed ip_addr_maskcmp() to _netcmp() as we are + comparing network addresses (identifiers), not the network masks + themselves. + * ipv4/ip_addr.c: ip_addr_isbroadcast() now checks that the given + IP address actually belongs to the network of the given interface. + + 2004-11-24 Kieran Mansley + * tcp.c: Increment pcb->snd_buf when ACK is received in SYN_SENT state. + +(STABLE-1_1_0-RC1) + + 2004-10-16 Kieran Mansley + * tcp.c: Add code to tcp_recved() to send an ACK (window update) immediately, + even if one is already pending, if the rcv_wnd is above a threshold + (currently TCP_WND/2). This avoids waiting for a timer to expire to send a + delayed ACK in order to open the window if the stack is only receiving data. + + 2004-09-12 Kieran Mansley + * tcp*.*: Retransmit time-out handling improvement by Sam Jansen. + + 2004-08-20 Tony Mountifield + * etharp.c: Make sure the first pbuf queued on an ARP entry + is properly ref counted. + + 2004-07-27 Tony Mountifield + * debug.h: Added (int) cast in LWIP_DEBUGF() to avoid compiler + warnings about comparison. + * pbuf.c: Stopped compiler complaining of empty if statement + when LWIP_DEBUGF() empty. Closed an unclosed comment. + * tcp.c: Stopped compiler complaining of empty if statement + when LWIP_DEBUGF() empty. + * ip.h Corrected IPH_TOS() macro: returns a byte, so doesn't need htons(). + * inet.c: Added a couple of casts to quiet the compiler. + No need to test isascii(c) before isdigit(c) or isxdigit(c). + + 2004-07-22 Tony Mountifield + * inet.c: Made data types consistent in inet_ntoa(). + Added casts for return values of checksum routines, to pacify compiler. + * ip_frag.c, tcp_out.c, sockets.c, pbuf.c + Small corrections to some debugging statements, to pacify compiler. + + 2004-07-21 Tony Mountifield + * etharp.c: Removed spurious semicolon and added missing end-of-comment. + * ethernetif.c Updated low_level_output() to match prototype for + netif->linkoutput and changed low_level_input() similarly for consistency. + * api_msg.c: Changed recv_raw() from int to u8_t, to match prototype + of raw_recv() in raw.h and so avoid compiler error. + * sockets.c: Added trivial (int) cast to keep compiler happier. + * ip.c, netif.c Changed debug statements to use the tidier ip4_addrN() macros. + +(STABLE-1_0_0) + + ++ Changes: + + 2004-07-05 Leon Woestenberg + * sockets.*: Restructured LWIP_PRIVATE_TIMEVAL. Make sure + your cc.h file defines this either 1 or 0. If non-defined, + defaults to 1. + * .c: Added and includes where used. + * etharp.c: Made some array indices unsigned. + + 2004-06-27 Leon Woestenberg + * netif.*: Added netif_set_up()/down(). + * dhcp.c: Changes to restart program flow. + + 2004-05-07 Leon Woestenberg + * etharp.c: In find_entry(), instead of a list traversal per candidate, do a + single-pass lookup for different candidates. Should exploit locality. + + 2004-04-29 Leon Woestenberg + * tcp*.c: Cleaned up source comment documentation for Doxygen processing. + * opt.h: ETHARP_ALWAYS_INSERT option removed to comply with ARP RFC. + * etharp.c: update_arp_entry() only adds new ARP entries when adviced to by + the caller. This deprecates the ETHARP_ALWAYS_INSERT overrule option. + + ++ Bug fixes: + + 2004-04-27 Leon Woestenberg + * etharp.c: Applied patch of bug #8708 by Toni Mountifield with a solution + suggested by Timmy Brolin. Fix for 32-bit processors that cannot access + non-aligned 32-bit words, such as soms 32-bit TCP/IP header fields. Fix + is to prefix the 14-bit Ethernet headers with two padding bytes. + + 2004-04-23 Leon Woestenberg + * ip_addr.c: Fix in the ip_addr_isbroadcast() check. + * etharp.c: Fixed the case where the packet that initiates the ARP request + is not queued, and gets lost. Fixed the case where the packets destination + address is already known; we now always queue the packet and perform an ARP + request. + +(STABLE-0_7_0) + + ++ Bug fixes: + + * Fixed TCP bug for SYN_SENT to ESTABLISHED state transition. + * Fixed TCP bug in dequeueing of FIN from out of order segment queue. + * Fixed two possible NULL references in rare cases. + +(STABLE-0_6_6) + + ++ Bug fixes: + + * Fixed DHCP which did not include the IP address in DECLINE messages. + + ++ Changes: + + * etharp.c has been hauled over a bit. + +(STABLE-0_6_5) + + ++ Bug fixes: + + * Fixed TCP bug induced by bad window resizing with unidirectional TCP traffic. + * Packets sent from ARP queue had invalid source hardware address. + + ++ Changes: + + * Pass-by ARP requests do now update the cache. + + ++ New features: + + * No longer dependent on ctype.h. + * New socket options. + * Raw IP pcb support. + +(STABLE-0_6_4) + + ++ Bug fixes: + + * Some debug formatters and casts fixed. + * Numereous fixes in PPP. + + ++ Changes: + + * DEBUGF now is LWIP_DEBUGF + * pbuf_dechain() has been re-enabled. + * Mentioned the changed use of CVS branches in README. + +(STABLE-0_6_3) + + ++ Bug fixes: + + * Fixed pool pbuf memory leak in pbuf_alloc(). + Occured if not enough PBUF_POOL pbufs for a packet pbuf chain. + Reported by Savin Zlobec. + + * PBUF_POOL chains had their tot_len field not set for non-first + pbufs. Fixed in pbuf_alloc(). + + ++ New features: + + * Added PPP stack contributed by Marc Boucher + + ++ Changes: + + * Now drops short packets for ICMP/UDP/TCP protocols. More robust. + + * ARP queueuing now queues the latest packet instead of the first. + This is the RFC recommended behaviour, but can be overridden in + lwipopts.h. + +(0.6.2) + + ++ Bugfixes: + + * TCP has been fixed to deal with the new use of the pbuf->ref + counter. + + * DHCP dhcp_inform() crash bug fixed. + + ++ Changes: + + * Removed pbuf_pool_free_cache and pbuf_pool_alloc_cache. Also removed + pbuf_refresh(). This has sped up pbuf pool operations considerably. + Implemented by David Haas. + +(0.6.1) + + ++ New features: + + * The packet buffer implementation has been enhanced to support + zero-copy and copy-on-demand for packet buffers which have their + payloads in application-managed memory. + Implemented by David Haas. + + Use PBUF_REF to make a pbuf refer to RAM. lwIP will use zero-copy + if an outgoing packet can be directly sent on the link, or perform + a copy-on-demand when necessary. + + The application can safely assume the packet is sent, and the RAM + is available to the application directly after calling udp_send() + or similar function. + + ++ Bugfixes: + + * ARP_QUEUEING should now correctly work for all cases, including + PBUF_REF. + Implemented by Leon Woestenberg. + + ++ Changes: + + * IP_ADDR_ANY is no longer a NULL pointer. Instead, it is a pointer + to a '0.0.0.0' IP address. + + * The packet buffer implementation is changed. The pbuf->ref counter + meaning has changed, and several pbuf functions have been + adapted accordingly. + + * netif drivers have to be changed to set the hardware address length field + that must be initialized correctly by the driver (hint: 6 for Ethernet MAC). + See the contrib/ports/c16x cs8900 driver as a driver example. + + * netif's have a dhcp field that must be initialized to NULL by the driver. + See the contrib/ports/c16x cs8900 driver as a driver example. + +(0.5.x) This file has been unmaintained up to 0.6.1. All changes are + logged in CVS but have not been explained here. + +(0.5.3) Changes since version 0.5.2 + + ++ Bugfixes: + + * memp_malloc(MEMP_API_MSG) could fail with multiple application + threads because it wasn't protected by semaphores. + + ++ Other changes: + + * struct ip_addr now packed. + + * The name of the time variable in arp.c has been changed to ctime + to avoid conflicts with the time() function. + +(0.5.2) Changes since version 0.5.1 + + ++ New features: + + * A new TCP function, tcp_tmr(), now handles both TCP timers. + + ++ Bugfixes: + + * A bug in tcp_parseopt() could cause the stack to hang because of a + malformed TCP option. + + * The address of new connections in the accept() function in the BSD + socket library was not handled correctly. + + * pbuf_dechain() did not update the ->tot_len field of the tail. + + * Aborted TCP connections were not handled correctly in all + situations. + + ++ Other changes: + + * All protocol header structs are now packed. + + * The ->len field in the tcp_seg structure now counts the actual + amount of data, and does not add one for SYN and FIN segments. + +(0.5.1) Changes since version 0.5.0 + + ++ New features: + + * Possible to run as a user process under Linux. + + * Preliminary support for cross platform packed structs. + + * ARP timer now implemented. + + ++ Bugfixes: + + * TCP output queue length was badly initialized when opening + connections. + + * TCP delayed ACKs were not sent correctly. + + * Explicit initialization of BSS segment variables. + + * read() in BSD socket library could drop data. + + * Problems with memory alignment. + + * Situations when all TCP buffers were used could lead to + starvation. + + * TCP MSS option wasn't parsed correctly. + + * Problems with UDP checksum calculation. + + * IP multicast address tests had endianess problems. + + * ARP requests had wrong destination hardware address. + + ++ Other changes: + + * struct eth_addr changed from u16_t[3] array to u8_t[6]. + + * A ->linkoutput() member was added to struct netif. + + * TCP and UDP ->dest_* struct members where changed to ->remote_*. + + * ntoh* macros are now null definitions for big endian CPUs. + +(0.5.0) Changes since version 0.4.2 + + ++ New features: + + * Redesigned operating system emulation layer to make porting easier. + + * Better control over TCP output buffers. + + * Documenation added. + + ++ Bugfixes: + + * Locking issues in buffer management. + + * Bugfixes in the sequential API. + + * IP forwarding could cause memory leakage. This has been fixed. + + ++ Other changes: + + * Directory structure somewhat changed; the core/ tree has been + collapsed. + +(0.4.2) Changes since version 0.4.1 + + ++ New features: + + * Experimental ARP implementation added. + + * Skeleton Ethernet driver added. + + * Experimental BSD socket API library added. + + ++ Bugfixes: + + * In very intense situations, memory leakage could occur. This has + been fixed. + + ++ Other changes: + + * Variables named "data" and "code" have been renamed in order to + avoid name conflicts in certain compilers. + + * Variable++ have in appliciable cases been translated to ++variable + since some compilers generate better code in the latter case. + +(0.4.1) Changes since version 0.4 + + ++ New features: + + * TCP: Connection attempts time out earlier than data + transmissions. Nagle algorithm implemented. Push flag set on the + last segment in a burst. + + * UDP: experimental support for UDP-Lite extensions. + + ++ Bugfixes: + + * TCP: out of order segments were in some cases handled incorrectly, + and this has now been fixed. Delayed acknowledgements was broken + in 0.4, has now been fixed. Binding to an address that is in use + now results in an error. Reset connections sometimes hung an + application; this has been fixed. + + * Checksum calculation sometimes failed for chained pbufs with odd + lengths. This has been fixed. + + * API: a lot of bug fixes in the API. The UDP API has been improved + and tested. Error reporting and handling has been + improved. Logical flaws and race conditions for incoming TCP + connections has been found and removed. + + * Memory manager: alignment issues. Reallocating memory sometimes + failed, this has been fixed. + + * Generic library: bcopy was flawed and has been fixed. + + ++ Other changes: + + * API: all datatypes has been changed from generic ones such as + ints, to specified ones such as u16_t. Functions that return + errors now have the correct type (err_t). + + * General: A lot of code cleaned up and debugging code removed. Many + portability issues have been fixed. + + * The license was changed; the advertising clause was removed. + + * C64 port added. + + * Thanks: Huge thanks go to Dagan Galarneau, Horst Garnetzke, Petri + Kosunen, Mikael Caleres, and Frits Wilmink for reporting and + fixing bugs! + +(0.4) Changes since version 0.3.1 + + * Memory management has been radically changed; instead of + allocating memory from a shared heap, memory for objects that are + rapidly allocated and deallocated is now kept in pools. Allocation + and deallocation from those memory pools is very fast. The shared + heap is still present but is used less frequently. + + * The memory, memory pool, and packet buffer subsystems now support + 4-, 2-, or 1-byte alignment. + + * "Out of memory" situations are handled in a more robust way. + + * Stack usage has been reduced. + + * Easier configuration of lwIP parameters such as memory usage, + TTLs, statistics gathering, etc. All configuration parameters are + now kept in a single header file "lwipopts.h". + + * The directory structure has been changed slightly so that all + architecture specific files are kept under the src/arch + hierarchy. + + * Error propagation has been improved, both in the protocol modules + and in the API. + + * The code for the RTXC architecture has been implemented, tested + and put to use. + + * Bugs have been found and corrected in the TCP, UDP, IP, API, and + the Internet checksum modules. + + * Bugs related to porting between a 32-bit and a 16-bit architecture + have been found and corrected. + + * The license has been changed slightly to conform more with the + original BSD license, including the advertisement clause. + +(0.3.1) Changes since version 0.3 + + * Fix of a fatal bug in the buffer management. Pbufs with allocated + RAM never returned the RAM when the pbuf was deallocated. + + * TCP congestion control, window updates and retransmissions did not + work correctly. This has now been fixed. + + * Bugfixes in the API. + +(0.3) Changes since version 0.2 + + * New and improved directory structure. All include files are now + kept in a dedicated include/ directory. + + * The API now has proper error handling. A new function, + netconn_err(), now returns an error code for the connection in + case of errors. + + * Improvements in the memory management subsystem. The system now + keeps a pointer to the lowest free memory block. A new function, + mem_malloc2() tries to allocate memory once, and if it fails tries + to free some memory and retry the allocation. + + * Much testing has been done with limited memory + configurations. lwIP now does a better job when overloaded. + + * Some bugfixes and improvements to the buffer (pbuf) subsystem. + + * Many bugfixes in the TCP code: + + - Fixed a bug in tcp_close(). + + - The TCP receive window was incorrectly closed when out of + sequence segments was received. This has been fixed. + + - Connections are now timed-out of the FIN-WAIT-2 state. + + - The initial congestion window could in some cases be too + large. This has been fixed. + + - The retransmission queue could in some cases be screwed up. This + has been fixed. + + - TCP RST flag now handled correctly. + + - Out of sequence data was in some cases never delivered to the + application. This has been fixed. + + - Retransmitted segments now contain the correct acknowledgment + number and advertised window. + + - TCP retransmission timeout backoffs are not correctly computed + (ala BSD). After a number of retransmissions, TCP now gives up + the connection. + + * TCP connections now are kept on three lists, one for active + connections, one for listening connections, and one for + connections that are in TIME-WAIT. This greatly speeds up the fast + timeout processing for sending delayed ACKs. + + * TCP now provides proper feedback to the application when a + connection has been successfully set up. + + * More comments have been added to the code. The code has also been + somewhat cleaned up. + +(0.2) Initial public release. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/COPYING b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/COPYING new file mode 100644 index 0000000..e23898b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/COPYING @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/FILES b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/FILES new file mode 100644 index 0000000..e6e0998 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/FILES @@ -0,0 +1,5 @@ +src/ - The source code for the lwIP TCP/IP stack. +doc/ - The documentation for lwIP. +test/ - Some code to test whether the sources do what they should. + +See also the FILES file in each subdirectory. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/README b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/README new file mode 100644 index 0000000..0884d27 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/README @@ -0,0 +1,100 @@ +INTRODUCTION + +lwIP is a small independent implementation of the TCP/IP protocol +suite that has been developed by Adam Dunkels at the Computer and +Networks Architectures (CNA) lab at the Swedish Institute of Computer +Science (SICS). + +The focus of the lwIP TCP/IP implementation is to reduce the RAM usage +while still having a full scale TCP. This making lwIP suitable for use +in embedded systems with tens of kilobytes of free RAM and room for +around 40 kilobytes of code ROM. + + +FEATURES + + * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over + multiple network interfaces + * ICMP (Internet Control Message Protocol) for network maintenance and debugging + * IGMP (Internet Group Management Protocol) for multicast traffic management + * MLD (Multicast listener discovery for IPv6). Aims to be compliant with + RFC 2710. No support for MLDv2 + * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). + Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 + (Address autoconfiguration) + * UDP (User Datagram Protocol) including experimental UDP-lite extensions + * TCP (Transmission Control Protocol) with congestion control, RTT estimation + and fast recovery/fast retransmit + * raw/native API for enhanced performance + * Optional Berkeley-like socket API + * DNS (Domain names resolver) + + +APPLICATIONS + + * HTTP server with SSI and CGI + * SNMPv2c agent with MIB compiler (Simple Network Management Protocol) + * SNTP (Simple network time protocol) + * NetBIOS name service responder + * MDNS (Multicast DNS) responder + * iPerf server implementation + + +LICENSE + +lwIP is freely available under a BSD license. + + +DEVELOPMENT + +lwIP has grown into an excellent TCP/IP stack for embedded devices, +and developers using the stack often submit bug fixes, improvements, +and additions to the stack to further increase its usefulness. + +Development of lwIP is hosted on Savannah, a central point for +software development, maintenance and distribution. Everyone can +help improve lwIP by use of Savannah's interface, Git and the +mailing list. A core team of developers will commit changes to the +Git source tree. + +The lwIP TCP/IP stack is maintained in the 'lwip' Git module and +contributions (such as platform ports) are in the 'contrib' Git module. + +See doc/savannah.txt for details on Git server access for users and +developers. + +The current Git trees are web-browsable: + http://git.savannah.gnu.org/cgit/lwip.git + http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git + +Submit patches and bugs via the lwIP project page: + http://savannah.nongnu.org/projects/lwip/ + +Continuous integration builds (GCC, clang): + https://travis-ci.org/yarrick/lwip-merged + + +DOCUMENTATION + +Self documentation of the source code is regularly extracted from the current +Git sources and is available from this web page: + http://www.nongnu.org/lwip/ + +There is now a constantly growing wiki about lwIP at + http://lwip.wikia.com/wiki/LwIP_Wiki + +Also, there are mailing lists you can subscribe at + http://savannah.nongnu.org/mail/?group=lwip +plus searchable archives: + http://lists.nongnu.org/archive/html/lwip-users/ + http://lists.nongnu.org/archive/html/lwip-devel/ + +lwIP was originally written by Adam Dunkels: + http://dunkels.com/adam/ + +Reading Adam's papers, the files in docs/, browsing the source code +documentation and browsing the mailing list archives is a good way to +become familiar with the design of lwIP. + +Adam Dunkels +Leon Woestenberg diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/UPGRADING b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/UPGRADING new file mode 100644 index 0000000..3a984c9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/UPGRADING @@ -0,0 +1,235 @@ +This file lists major changes between release versions that require +ports or applications to be changed. Use it to update a port or an +application written for an older version of lwIP to correctly work +with newer versions. + + +(git master) + + * [Enter new changes just after this line - do not remove this line] + +(2.0.1) + + ++ Application changes: + + * UDP does NOT receive multicast traffic from ALL netifs on an UDP PCB bound to a specific + netif any more. Users need to bind to IP_ADDR_ANY to receive multicast traffic and compare + ip_current_netif() to the desired netif for every packet. + See bug #49662 for an explanation. + +(2.0.0) + + ++ Application changes: + + * Changed netif "up" flag handling to be an administrative flag (as opposed to the previous meaning of + "ip4-address-valid", a netif will now not be used for transmission if not up) -> even a DHCP netif + has to be set "up" before starting the DHCP client + * Added IPv6 support (dual-stack or IPv4/IPv6 only) + * Changed ip_addr_t to be a union in dual-stack mode (use ip4_addr_t where referring to IPv4 only). + * Major rewrite of SNMP (added MIB parser that creates code stubs for custom MIBs); + supports SNMPv2c (experimental v3 support) + * Moved some core applications from contrib repository to src/apps (and include/lwip/apps) + + +++ Raw API: + * Changed TCP listen backlog: removed tcp_accepted(), added the function pair tcp_backlog_delayed()/ + tcp_backlog_accepted() to explicitly delay backlog handling on a connection pcb + + +++ Socket API: + * Added an implementation for posix sendmsg() + * Added LWIP_FIONREAD_LINUXMODE that makes ioctl/FIONREAD return the size of the next pending datagram + + ++ Port changes + + +++ new files: + * MANY new and moved files! + * Added src/Filelists.mk for use in Makefile projects + * Continued moving stack-internal parts from abc.h to abc_priv.h in sub-folder "priv" + to let abc.h only contain the actual application programmer's API + + +++ sys layer: + * Made LWIP_TCPIP_CORE_LOCKING==1 the default as it usually performs better than + the traditional message passing (although with LWIP_COMPAT_MUTEX you are still + open to priority inversion, so this is not recommended any more) + * Added LWIP_NETCONN_SEM_PER_THREAD to use one "op_completed" semaphore per thread + instead of using one per netconn (these semaphores are used even with core locking + enabled as some longer lasting functions like big writes still need to delay) + * Added generalized abstraction for itoa(), strnicmp(), stricmp() and strnstr() + in def.h (to be overridden in cc.h) instead of config + options for netbiosns, httpd, dns, etc. ... + * New abstraction for hton* and ntoh* functions in def.h. + To override them, use the following in cc.h: + #define lwip_htons(x) + #define lwip_htonl(x) + + +++ new options: + * TODO + + +++ new pools: + * Added LWIP_MEMPOOL_* (declare/init/alloc/free) to declare private memp pools + that share memp.c code but do not have to be made global via lwippools.h + * Added pools for IPv6, MPU_COMPATIBLE, dns-api, netif-api, etc. + * added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when a memp pool was empty and an item + is now available + + * Signature of LWIP_HOOK_VLAN_SET macro was changed + + * LWIP_DECLARE_MEMORY_ALIGNED() may be used to declare aligned memory buffers (mem/memp) + or to move buffers to dedicated memory using compiler attributes + + * Standard C headers are used to define sized types and printf formatters + (disable by setting LWIP_NO_STDINT_H=1 or LWIP_NO_INTTYPES_H=1 if your compiler + does not support these) + + + ++ Major bugfixes/improvements + + * Added IPv6 support (dual-stack or IPv4/IPv6 only) + * Major rewrite of PPP (incl. keep-up with apache pppd) + see doc/ppp.txt for an upgrading how-to + * Major rewrite of SNMP (incl. MIB parser) + * Fixed timing issues that might have lead to losing a DHCP lease + * Made rx processing path more robust against crafted errors + * TCP window scaling support + * modification of api modules to support FreeRTOS-MPU (don't pass stack-pointers to other threads) + * made DNS client more robust + * support PBUF_REF for RX packets + * LWIP_NETCONN_FULLDUPLEX allows netconn/sockets to be used for reading/writing from separate + threads each (needs LWIP_NETCONN_SEM_PER_THREAD) + * Moved and reordered stats (mainly memp/mib2) + +(1.4.0) + + ++ Application changes: + + * Replaced struct ip_addr by typedef ip_addr_t (struct ip_addr is kept for + compatibility to old applications, but will be removed in the future). + + * Renamed mem_realloc() to mem_trim() to prevent confusion with realloc() + + +++ Raw API: + * Changed the semantics of tcp_close() (since it was rather a + shutdown before): Now the application does *NOT* get any calls to the recv + callback (aside from NULL/closed) after calling tcp_close() + + * When calling tcp_abort() from a raw API TCP callback function, + make sure you return ERR_ABRT to prevent accessing unallocated memory. + (ERR_ABRT now means the applicaiton has called tcp_abort!) + + +++ Netconn API: + * Changed netconn_receive() and netconn_accept() to return + err_t, not a pointer to new data/netconn. + + +++ Socket API: + * LWIP_SO_RCVTIMEO: when accept() or recv() time out, they + now set errno to EWOULDBLOCK/EAGAIN, not ETIMEDOUT. + + * Added a minimal version of posix fctl() to have a + standardised way to set O_NONBLOCK for nonblocking sockets. + + +++ all APIs: + * correctly implemented SO(F)_REUSEADDR + + ++ Port changes + + +++ new files: + + * Added 4 new files: def.c, timers.c, timers.h, tcp_impl.h: + + * Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains + the actual application programmer's API + + * Separated timer implementation from sys.h/.c, moved to timers.h/.c; + Added timer implementation for NO_SYS==1, set NO_SYS_NO_TIMERS==1 if you + still want to use your own timer implementation for NO_SYS==0 (as before). + + +++ sys layer: + + * Converted mbox- and semaphore-functions to take pointers to sys_mbox_t/ + sys_sem_t; + + * Converted sys_mbox_new/sys_sem_new to take pointers and return err_t; + + * Added Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX to let sys.h use + binary semaphores instead of mutexes - as before) + + +++ new options: + + * Don't waste memory when chaining segments, added option TCP_OVERSIZE to + prevent creating many small pbufs when calling tcp_write with many small + blocks of data. Instead, pbufs are allocated larger than needed and the + space is used for later calls to tcp_write. + + * Added LWIP_NETIF_TX_SINGLE_PBUF to always copy to try to create single pbufs + in tcp_write/udp_send. + + * Added an additional option LWIP_ETHERNET to support ethernet without ARP + (necessary for pure PPPoE) + + * Add MEMP_SEPARATE_POOLS to place memory pools in separate arrays. This may + be used to place these pools into user-defined memory by using external + declaration. + + * Added TCP_SNDQUEUELOWAT corresponding to TCP_SNDLOWAT + + +++ new pools: + + * Netdb uses a memp pool for allocating memory when getaddrinfo() is called, + so MEMP_NUM_NETDB has to be set accordingly. + + * DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses a memp pool instead of the heap, so + MEMP_NUM_LOCALHOSTLIST has to be set accordingly. + + * Snmp-agent uses a memp pools instead of the heap, so MEMP_NUM_SNMP_* have + to be set accordingly. + + * PPPoE uses a MEMP pool instead of the heap, so MEMP_NUM_PPPOE_INTERFACES + has to be set accordingly + + * Integrated loopif into netif.c - loopif does not have to be created by the + port any more, just define LWIP_HAVE_LOOPIF to 1. + + * Added define LWIP_RAND() for lwip-wide randomization (needs to be defined + in cc.h, e.g. used by igmp) + + * Added printf-formatter X8_F to printf u8_t as hex + + * The heap now may be moved to user-defined memory by defining + LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address + + * added autoip_set_struct() and dhcp_set_struct() to let autoip and dhcp work + with user-allocated structs instead of calling mem_malloc + + * Added const char* name to mem- and memp-stats for easier debugging. + + * Calculate the TCP/UDP checksum while copying to only fetch data once: + Define LWIP_CHKSUM_COPY to a memcpy-like function that returns the checksum + + * Added SO_REUSE_RXTOALL to pass received UDP broadcast/multicast packets to + more than one pcb. + + * Changed the semantics of ARP_QUEUEING==0: ARP_QUEUEING now cannot be turned + off any more, if this is set to 0, only one packet (the most recent one) is + queued (like demanded by RFC 1122). + + + ++ Major bugfixes/improvements + + * Implemented tcp_shutdown() to only shut down one end of a connection + * Implemented shutdown() at socket- and netconn-level + * Added errorset support to select() + improved select speed overhead + * Merged pppd to v2.3.11 (including some backported bugfixes from 2.4.x) + * Added timer implementation for NO_SYS==1 (may be disabled with NO_SYS_NO_TIMERS==1 + * Use macros defined in ip_addr.h to work with IP addresses + * Implemented many nonblocking socket/netconn functions + * Fixed ARP input processing: only add a new entry if a request was directed as us + * mem_realloc() to mem_trim() to prevent confusion with realloc() + * Some improvements for AutoIP (don't route/forward link-local addresses, don't break + existing connections when assigning a routable address) + * Correctly handle remote side overrunning our rcv_wnd in ooseq case + * Removed packing from ip_addr_t, the packed version is now only used in protocol headers + * Corrected PBUF_POOL_BUFSIZE for ports where ETH_PAD_SIZE > 0 + * Added support for static ARP table entries + +(STABLE-1.3.2) + + * initial version of this file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/FILES b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/FILES new file mode 100644 index 0000000..e588575 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/FILES @@ -0,0 +1,9 @@ +doxygen/ - Configuration files and scripts to create the lwIP doxygen source + documentation (found at http://www.nongnu.org/lwip/) + +savannah.txt - How to obtain the current development source code. +contrib.txt - How to contribute to lwIP as a developer. +rawapi.txt - The documentation for the core API of lwIP. + Also provides an overview about the other APIs and multithreading. +sys_arch.txt - The documentation for a system abstraction layer of lwIP. +ppp.txt - Documentation of the PPP interface for lwIP. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/NO_SYS_SampleCode.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/NO_SYS_SampleCode.c new file mode 100644 index 0000000..f5c6c10 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/NO_SYS_SampleCode.c @@ -0,0 +1,117 @@ +void eth_mac_irq() +{ + /* Service MAC IRQ here */ + + /* Allocate pbuf from pool (avoid using heap in interrupts) */ + struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL); + + if(p != NULL) { + /* Copy ethernet frame into pbuf */ + pbuf_take(p, eth_data, eth_data_count); + + /* Put in a queue which is processed in main loop */ + if(!queue_try_put(&queue, p)) { + /* queue is full -> packet loss */ + pbuf_free(p); + } + } +} + +static err_t netif_output(struct netif *netif, struct pbuf *p) +{ + LINK_STATS_INC(link.xmit); + + /* Update SNMP stats (only if you use SNMP) */ + MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p->tot_len); + int unicast = ((p->payload[0] & 0x01) == 0); + if (unicast) { + MIB2_STATS_NETIF_INC(netif, ifoutucastpkts); + } else { + MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts); + } + + lock_interrupts(); + pbuf_copy_partial(p, mac_send_buffer, p->tot_len, 0); + /* Start MAC transmit here */ + unlock_interrupts(); + + return ERR_OK; +} + +static void netif_status_callback(struct netif *netif) +{ + printf("netif status changed %s\n", ip4addr_ntoa(netif_ip4_addr(netif))); +} + +static err_t netif_init(struct netif *netif) +{ + netif->linkoutput = netif_output; + netif->output = etharp_output; + netif->output_ip6 = ethip6_output; + netif->mtu = ETHERNET_MTU; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET | NETIF_FLAG_IGMP | NETIF_FLAG_MLD6; + MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, 100000000); + + SMEMCPY(netif->hwaddr, your_mac_address_goes_here, sizeof(netif->hwaddr)); + netif->hwaddr_len = sizeof(netif->hwaddr); + + return ERR_OK; +} + +void main(void) +{ + struct netif netif; + + lwip_init(); + + netif_add(&netif, IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY, NULL, netif_init, netif_input); + netif.name[0] = 'e'; + netif.name[1] = '0'; + netif_create_ip6_linklocal_address(&netif, 1); + netif.ip6_autoconfig_enabled = 1; + netif_set_status_callback(&netif, netif_status_callback); + netif_set_default(&netif); + netif_set_up(&netif); + + /* Start DHCP and HTTPD */ + dhcp_init(); + httpd_init(); + + while(1) { + /* Check link state, e.g. via MDIO communication with PHY */ + if(link_state_changed()) { + if(link_is_up()) { + netif_set_link_up(&netif); + } else { + netif_set_link_down(&netif); + } + } + + /* Check for received frames, feed them to lwIP */ + lock_interrupts(); + struct pbuf* p = queue_try_get(&queue); + unlock_interrupts(); + + if(p != NULL) { + LINK_STATS_INC(link.recv); + + /* Update SNMP stats (only if you use SNMP) */ + MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); + int unicast = ((p->payload[0] & 0x01) == 0); + if (unicast) { + MIB2_STATS_NETIF_INC(netif, ifinucastpkts); + } else { + MIB2_STATS_NETIF_INC(netif, ifinnucastpkts); + } + + if(netif.input(p, &netif) != ERR_OK) { + pbuf_free(p); + } + } + + /* Cyclic lwIP timers check */ + sys_check_timeouts(); + + /* your application goes here */ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/contrib.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/contrib.txt new file mode 100644 index 0000000..6f0d7bc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/contrib.txt @@ -0,0 +1,58 @@ +1 Introduction + +This document describes some guidelines for people participating +in lwIP development. + +2 How to contribute to lwIP + +Here is a short list of suggestions to anybody working with lwIP and +trying to contribute bug reports, fixes, enhancements, platform ports etc. +First of all as you may already know lwIP is a volunteer project so feedback +to fixes or questions might often come late. Hopefully the bug and patch tracking +features of Savannah help us not lose users' input. + +2.1 Source code style: + +1. do not use tabs. +2. indentation is two spaces per level (i.e. per tab). +3. end debug messages with a trailing newline (\n). +4. one space between keyword and opening bracket. +5. no space between function and opening bracket. +6. one space and no newline before opening curly braces of a block. +7. closing curly brace on a single line. +8. spaces surrounding assignment and comparisons. +9. don't initialize static and/or global variables to zero, the compiler takes care of that. +10. use current source code style as further reference. + +2.2 Source code documentation style: + +1. JavaDoc compliant and Doxygen compatible. +2. Function documentation above functions in .c files, not .h files. + (This forces you to synchronize documentation and implementation.) +3. Use current documentation style as further reference. + +2.3 Bug reports and patches: + +1. Make sure you are reporting bugs or send patches against the latest + sources. (From the latest release and/or the current Git sources.) +2. If you think you found a bug make sure it's not already filed in the + bugtracker at Savannah. +3. If you have a fix put the patch on Savannah. If it is a patch that affects + both core and arch specific stuff please separate them so that the core can + be applied separately while leaving the other patch 'open'. The preferred way + is to NOT touch archs you can't test and let maintainers take care of them. + This is a good way to see if they are used at all - the same goes for unix + netifs except tapif. +4. Do not file a bug and post a fix to it to the patch area. Either a bug report + or a patch will be enough. + If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area. +5. Patches should be specific to a single change or to related changes. Do not mix bugfixes with spelling and other + trivial fixes unless the bugfix is trivial too. Do not reorganize code and rename identifiers in the same patch you + change behaviour if not necessary. A patch is easier to read and understand if it's to the point and short than + if it's not to the point and long :) so the chances for it to be applied are greater. + +2.4 Platform porters: + +1. If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and + you think it could benefit others[1] you might want discuss this on the mailing list. You + can also ask for Git access to submit and maintain your port in the contrib Git module. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mdns.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mdns.txt new file mode 100644 index 0000000..c322843 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mdns.txt @@ -0,0 +1,113 @@ +Multicast DNS for lwIP + +Author: Erik Ekman + + +Note! The MDNS responder does not have all features required by the standards. +See notes in src/apps/mdns/mdns.c for what is left. It is however usable in normal +cases - but watch out if many devices on the same network try to use the same +host/service instance names. + + +How to enable: +============== + +MDNS support does not depend on DNS. +MDNS supports using IPv4 only, v6 only, or v4+v6. + +To enable MDNS responder, set + LWIP_MDNS_RESPONDER = 1 +in lwipopts.h and add src/apps/mdns/mdns.c to your list of files to build. + +The max number of services supported per netif is defined by MDNS_MAX_SERVICES, +default is 1. + +Increase MEMP_NUM_UDP_PCB by 1. MDNS needs one PCB. +Increase LWIP_NUM_NETIF_CLIENT_DATA by 1 (MDNS needs one entry on netif). + +MDNS with IPv4 requires LWIP_IGMP = 1, and preferably LWIP_AUTOIP = 1. +MDNS with IPv6 requires LWIP_IPV6_MLD = 1, and that a link-local address is +generated. + +The MDNS code puts its structs on the stack where suitable to reduce dynamic +memory allocation. It may use up to 1kB of stack. + +MDNS needs a strncasecmp() implementation. If you have one, define +LWIP_MDNS_STRNCASECMP to it. Otherwise the code will provide an implementation +for you. + + +How to use: +=========== + +Call mdns_resp_init() during system initialization. +This opens UDP sockets on port 5353 for IPv4 and IPv6. + + +To start responding on a netif, run + mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl) + +The hostname will be copied. If this returns successfully, the netif will join +the multicast groups and any MDNS/legacy DNS requests sent unicast or multicast +to port 5353 will be handled: +- .local type A, AAAA or ANY returns relevant IP addresses +- Reverse lookups (PTR in-addr.arpa, ip6.arpa) of netif addresses + returns .local +Answers will use the supplied TTL (in seconds) +MDNS allows UTF-8 names, but it is recommended to stay within ASCII, +since the default case-insensitive comparison assumes this. + +It is recommended to call this function after an IPv4 address has been set, +since there is currently no check if the v4 address is valid. + +Call mdns_resp_netif_settings_changed() every time the IP address +on the netif has changed. + +To stop responding on a netif, run + mdns_resp_remove_netif(struct netif *netif) + + +Adding services: +================ + +The netif first needs to be registered. Then run + mdns_resp_add_service(struct netif *netif, char *name, char *service, + u16_t proto, u16_t port, u32_t dns_ttl, + service_get_txt_fn_t txt_fn, void *txt_userdata); + +The name and service pointers will be copied. Name refers to the name of the +service instance, and service is the type of service, like _http +proto can be DNSSD_PROTO_UDP or DNSSD_PROTO_TCP which represent _udp and _tcp. +If this call returns successfully, the following queries will be answered: +- _services._dns-sd._udp.local type PTR returns ..local +- ..local type PTR returns ...local +- ...local type SRV returns hostname and port of service +- ...local type TXT builds text strings by calling txt_fn + with the supplied userdata. The callback adds strings to the reply by calling + mdns_resp_add_service_txtitem(struct mdns_service *service, char *txt, + int txt_len). Example callback method: + + static void srv_txt(struct mdns_service *service, void *txt_userdata) + { + res = mdns_resp_add_service_txtitem(service, "path=/", 6); + LWIP_ERROR("mdns add service txt failed\n", (res == ERR_OK), return); + } + + Since a hostname struct is used for TXT storage each single item can be max + 63 bytes long, and the total max length (including length bytes for each + item) is 255 bytes. + +If your device runs a webserver on port 80, an example call might be: + + mdns_resp_add_service(netif, "myweb", "_http" + DNSSD_PROTO_TCP, 80, 3600, srv_txt, NULL); + +which will publish myweb._http._tcp.local for any hosts looking for web servers, +and point them to .local:80 + +Relevant information will be sent as additional records to reduce number of +requests required from a client. + +Removing services is currently not supported. Services are removed when the +netif is removed. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mqtt_client.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mqtt_client.txt new file mode 100644 index 0000000..3e67def --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/mqtt_client.txt @@ -0,0 +1,162 @@ +MQTT client for lwIP + +Author: Erik Andersson + +Details of the MQTT protocol can be found at: +http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html + +----------------------------------------------------------------- +1. Initial steps, reserve memory and make connection to server: + +1.1: Provide storage + +Static allocation: + mqtt_client_t static_client; + example_do_connect(&static_client); + +Dynamic allocation: + mqtt_client_t *client = mqtt_client_new(); + if(client != NULL) { + example_do_connect(&client); + } + +1.2: Establish Connection with server + +void example_do_connect(mqtt_client_t *client) +{ + struct mqtt_connect_client_info_t ci; + err_t err; + + /* Setup an empty client info structure */ + memset(&ci, 0, sizeof(ci)); + + /* Minimal amount of information required is client identifier, so set it here */ + ci.client_id = "lwip_test"; + + /* Initiate client and connect to server, if this fails immediately an error code is returned + otherwise mqtt_connection_cb will be called with connection result after attempting + to establish a connection with the server. + For now MQTT version 3.1.1 is always used */ + + err = mqtt_client_connect(client, ip_addr, MQTT_PORT, mqtt_connection_cb, 0, &ci); + + /* For now just print the result code if something goes wrong + if(err != ERR_OK) { + printf("mqtt_connect return %d\n", err); + } +} + +Connection to server can also be probed by calling mqtt_client_is_connected(client) + +----------------------------------------------------------------- +2. Implementing the connection status callback + + +static void mqtt_connection_cb(mqtt_client_t *client, void *arg, mqtt_connection_status_t status) +{ + err_t err; + if(status == MQTT_CONNECT_ACCEPTED) { + printf("mqtt_connection_cb: Successfully connected\n"); + + /* Setup callback for incoming publish requests */ + mqtt_set_inpub_callback(client, mqtt_incoming_publish_cb, mqtt_incoming_data_cb, arg); + + /* Subscribe to a topic named "subtopic" with QoS level 1, call mqtt_sub_request_cb with result */ + err = mqtt_subscribe(client, "subtopic", 1, mqtt_sub_request_cb, arg); + + if(err != ERR_OK) { + printf("mqtt_subscribe return: %d\n", err); + } + } else { + printf("mqtt_connection_cb: Disconnected, reason: %d\n", status); + + /* Its more nice to be connected, so try to reconnect */ + example_do_connect(client); + } +} + +static void mqtt_sub_request_cb(void *arg, err_t result) +{ + /* Just print the result code here for simplicity, + normal behaviour would be to take some action if subscribe fails like + notifying user, retry subscribe or disconnect from server */ + printf("Subscribe result: %d\n", result); +} + +----------------------------------------------------------------- +3. Implementing callbacks for incoming publish and data + +/* The idea is to demultiplex topic and create some reference to be used in data callbacks + Example here uses a global variable, better would be to use a member in arg + If RAM and CPU budget allows it, the easiest implementation might be to just take a copy of + the topic string and use it in mqtt_incoming_data_cb +*/ +static int inpub_id; +static void mqtt_incoming_publish_cb(void *arg, const char *topic, u32_t tot_len) +{ + printf("Incoming publish at topic %s with total length %u\n", topic, (unsigned int)tot_len); + + /* Decode topic string into a user defined reference */ + if(strcmp(topic, "print_payload") == 0) { + inpub_id = 0; + } else if(topic[0] == 'A') { + /* All topics starting with 'A' might be handled at the same way */ + inpub_id = 1; + } else { + /* For all other topics */ + inpub_id = 2; + } +} + +static void mqtt_incoming_data_cb(void *arg, const u8_t *data, u16_t len, u8_t flags) +{ + printf("Incoming publish payload with length %d, flags %u\n", len, (unsigned int)flags); + + if(flags & MQTT_DATA_FLAG_LAST) { + /* Last fragment of payload received (or whole part if payload fits receive buffer + See MQTT_VAR_HEADER_BUFFER_LEN) */ + + /* Call function or do action depending on reference, in this case inpub_id */ + if(inpub_id == 0) { + /* Don't trust the publisher, check zero termination */ + if(data[len-1] == 0) { + printf("mqtt_incoming_data_cb: %s\n", (const char *)data); + } + } else if(inpub_id == 1) { + /* Call an 'A' function... */ + } else { + printf("mqtt_incoming_data_cb: Ignoring payload...\n"); + } + } else { + /* Handle fragmented payload, store in buffer, write to file or whatever */ + } +} + +----------------------------------------------------------------- +4. Using outgoing publish + + +void example_publish(mqtt_client_t *client, void *arg) +{ + const char *pub_payload= "PubSubHubLubJub"; + err_t err; + u8_t qos = 2; /* 0 1 or 2, see MQTT specification */ + u8_t retain = 0; /* No don't retain such crappy payload... */ + err = mqtt_publish(client, "pub_topic", pub_payload, strlen(pub_payload), qos, retain, mqtt_pub_request_cb, arg); + if(err != ERR_OK) { + printf("Publish err: %d\n", err); + } +} + +/* Called when publish is complete either with sucess or failure */ +static void mqtt_pub_request_cb(void *arg, err_t result) +{ + if(result != ERR_OK) { + printf("Publish result: %d\n", result); + } +} + +----------------------------------------------------------------- +5. Disconnecting + +Simply call mqtt_disconnect(client) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/ppp.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/ppp.txt new file mode 100644 index 0000000..8b88b3a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/ppp.txt @@ -0,0 +1,529 @@ +PPP interface for lwIP + +Author: Sylvain Rochet + +Table of Contents: + +1 - Supported PPP protocols and features +2 - Raw API PPP example for all protocols +3 - PPPoS input path (raw API, IRQ safe API, TCPIP API) +4 - Thread safe PPP API (PPPAPI) +5 - Notify phase callback (PPP_NOTIFY_PHASE) +6 - Upgrading from lwIP <= 1.4.x to lwIP >= 2.0.x + + + +1 Supported PPP protocols and features +====================================== + +Supported Low level protocols: +* PPP over serial using HDLC-like framing, such as wired dialup modems + or mobile telecommunications GPRS/EDGE/UMTS/HSPA+/LTE modems +* PPP over Ethernet, such as xDSL modems +* PPP over L2TP (Layer 2 Tunneling Protocol) LAC (L2TP Access Concentrator), + IP tunnel over UDP, such as VPN access + +Supported auth protocols: +* PAP, Password Authentication Protocol +* CHAP, Challenge-Handshake Authentication Protocol, also known as CHAP-MD5 +* MSCHAPv1, Microsoft version of CHAP, version 1 +* MSCHAPv2, Microsoft version of CHAP, version 2 +* EAP, Extensible Authentication Protocol + +Supported address protocols: +* IPCP, IP Control Protocol, IPv4 addresses negotiation +* IP6CP, IPv6 Control Protocol, IPv6 link-local addresses negotiation + +Supported encryption protocols: +* MPPE, Microsoft Point-to-Point Encryption + +Supported compression or miscellaneous protocols, for serial links only: +* PFC, Protocol Field Compression +* ACFC, Address-and-Control-Field-Compression +* ACCM, Asynchronous-Control-Character-Map +* VJ, Van Jacobson TCP/IP Header Compression + + + +2 Raw API PPP example for all protocols +======================================= + +As usual, raw API for lwIP means the lightweight API which *MUST* only be used +for NO_SYS=1 systems or called inside lwIP core thread for NO_SYS=0 systems. + +/* + * Globals + * ======= + */ + +/* The PPP control block */ +ppp_pcb *ppp; + +/* The PPP IP interface */ +struct netif ppp_netif; + + +/* + * PPP status callback + * =================== + * + * PPP status callback is called on PPP status change (up, down, …) from lwIP + * core thread + */ + +/* PPP status callback example */ +static void status_cb(ppp_pcb *pcb, int err_code, void *ctx) { + struct netif *pppif = ppp_netif(pcb); + LWIP_UNUSED_ARG(ctx); + + switch(err_code) { + case PPPERR_NONE: { +#if LWIP_DNS + const ip_addr_t *ns; +#endif /* LWIP_DNS */ + printf("status_cb: Connected\n"); +#if PPP_IPV4_SUPPORT + printf(" our_ipaddr = %s\n", ipaddr_ntoa(&pppif->ip_addr)); + printf(" his_ipaddr = %s\n", ipaddr_ntoa(&pppif->gw)); + printf(" netmask = %s\n", ipaddr_ntoa(&pppif->netmask)); +#if LWIP_DNS + ns = dns_getserver(0); + printf(" dns1 = %s\n", ipaddr_ntoa(ns)); + ns = dns_getserver(1); + printf(" dns2 = %s\n", ipaddr_ntoa(ns)); +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + printf(" our6_ipaddr = %s\n", ip6addr_ntoa(netif_ip6_addr(pppif, 0))); +#endif /* PPP_IPV6_SUPPORT */ + break; + } + case PPPERR_PARAM: { + printf("status_cb: Invalid parameter\n"); + break; + } + case PPPERR_OPEN: { + printf("status_cb: Unable to open PPP session\n"); + break; + } + case PPPERR_DEVICE: { + printf("status_cb: Invalid I/O device for PPP\n"); + break; + } + case PPPERR_ALLOC: { + printf("status_cb: Unable to allocate resources\n"); + break; + } + case PPPERR_USER: { + printf("status_cb: User interrupt\n"); + break; + } + case PPPERR_CONNECT: { + printf("status_cb: Connection lost\n"); + break; + } + case PPPERR_AUTHFAIL: { + printf("status_cb: Failed authentication challenge\n"); + break; + } + case PPPERR_PROTOCOL: { + printf("status_cb: Failed to meet protocol\n"); + break; + } + case PPPERR_PEERDEAD: { + printf("status_cb: Connection timeout\n"); + break; + } + case PPPERR_IDLETIMEOUT: { + printf("status_cb: Idle Timeout\n"); + break; + } + case PPPERR_CONNECTTIME: { + printf("status_cb: Max connect time reached\n"); + break; + } + case PPPERR_LOOPBACK: { + printf("status_cb: Loopback detected\n"); + break; + } + default: { + printf("status_cb: Unknown error code %d\n", err_code); + break; + } + } + +/* + * This should be in the switch case, this is put outside of the switch + * case for example readability. + */ + + if (err_code == PPPERR_NONE) { + return; + } + + /* ppp_close() was previously called, don't reconnect */ + if (err_code == PPPERR_USER) { + /* ppp_free(); -- can be called here */ + return; + } + + /* + * Try to reconnect in 30 seconds, if you need a modem chatscript you have + * to do a much better signaling here ;-) + */ + ppp_connect(pcb, 30); + /* OR ppp_listen(pcb); */ +} + + +/* + * Creating a new PPPoS session + * ============================ + * + * In lwIP, PPPoS is not PPPoSONET, in lwIP PPPoS is PPPoSerial. + */ + +#include "netif/ppp/pppos.h" + +/* + * PPPoS serial output callback + * + * ppp_pcb, PPP control block + * data, buffer to write to serial port + * len, length of the data buffer + * ctx, optional user-provided callback context pointer + * + * Return value: len if write succeed + */ +static u32_t output_cb(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) { + return uart_write(UART, data, len); +} + +/* + * Create a new PPPoS interface + * + * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface + * output_cb, PPPoS serial output callback + * status_cb, PPP status callback, called on PPP status change (up, down, …) + * ctx_cb, optional user-provided callback context pointer + */ +ppp = pppos_create(&ppp_netif, + output_cb, status_cb, ctx_cb); + + +/* + * Creating a new PPPoE session + * ============================ + */ + +#include "netif/ppp/pppoe.h" + +/* + * Create a new PPPoE interface + * + * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface + * ethif, already existing and setup Ethernet interface to use + * service_name, PPPoE service name discriminator (not supported yet) + * concentrator_name, PPPoE concentrator name discriminator (not supported yet) + * status_cb, PPP status callback, called on PPP status change (up, down, …) + * ctx_cb, optional user-provided callback context pointer + */ +ppp = pppoe_create(&ppp_netif, + ðif, + service_name, concentrator_name, + status_cb, ctx_cb); + + +/* + * Creating a new PPPoL2TP session + * =============================== + */ + +#include "netif/ppp/pppol2tp.h" + +/* + * Create a new PPPoL2TP interface + * + * ppp_netif, netif to use for this PPP link, i.e. PPP IP interface + * netif, optional already existing and setup output netif, necessary if you + * want to set this interface as default route to settle the chicken + * and egg problem with VPN links + * ipaddr, IP to connect to + * port, UDP port to connect to (usually 1701) + * secret, L2TP secret to use + * secret_len, size in bytes of the L2TP secret + * status_cb, PPP status callback, called on PPP status change (up, down, …) + * ctx_cb, optional user-provided callback context pointer + */ +ppp = pppol2tp_create(&ppp_netif, + struct netif *netif, ip_addr_t *ipaddr, u16_t port, + u8_t *secret, u8_t secret_len, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + + +/* + * Initiate PPP client connection + * ============================== + */ + +/* Set this interface as default route */ +ppp_set_default(ppp); + +/* + * Basic PPP client configuration. Can only be set if PPP session is in the + * dead state (i.e. disconnected). We don't need to provide thread-safe + * equivalents through PPPAPI because those helpers are only changing + * structure members while session is inactive for lwIP core. Configuration + * only need to be done once. + */ + +/* Ask the peer for up to 2 DNS server addresses. */ +ppp_set_usepeerdns(ppp, 1); + +/* Auth configuration, this is pretty self-explanatory */ +ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); + +/* + * Initiate PPP negotiation, without waiting (holdoff=0), can only be called + * if PPP session is in the dead state (i.e. disconnected). + */ +u16_t holdoff = 0; +ppp_connect(ppp, holdoff); + + +/* + * Initiate PPP server listener + * ============================ + */ + +/* + * Basic PPP server configuration. Can only be set if PPP session is in the + * dead state (i.e. disconnected). We don't need to provide thread-safe + * equivalents through PPPAPI because those helpers are only changing + * structure members while session is inactive for lwIP core. Configuration + * only need to be done once. + */ +ip4_addr_t addr; + +/* Set our address */ +IP4_ADDR(&addr, 192,168,0,1); +ppp_set_ipcp_ouraddr(ppp, &addr); + +/* Set peer(his) address */ +IP4_ADDR(&addr, 192,168,0,2); +ppp_set_ipcp_hisaddr(ppp, &addr); + +/* Set primary DNS server */ +IP4_ADDR(&addr, 192,168,10,20); +ppp_set_ipcp_dnsaddr(ppp, 0, &addr); + +/* Set secondary DNS server */ +IP4_ADDR(&addr, 192,168,10,21); +ppp_set_ipcp_dnsaddr(ppp, 1, &addr); + +/* Auth configuration, this is pretty self-explanatory */ +ppp_set_auth(ppp, PPPAUTHTYPE_ANY, "login", "password"); + +/* Require peer to authenticate */ +ppp_set_auth_required(ppp, 1); + +/* + * Only for PPPoS, the PPP session should be up and waiting for input. + * + * Note: for PPPoS, ppp_connect() and ppp_listen() are actually the same thing. + * The listen call is meant for future support of PPPoE and PPPoL2TP server + * mode, where we will need to negotiate the incoming PPPoE session or L2TP + * session before initiating PPP itself. We need this call because there is + * two passive modes for PPPoS, ppp_set_passive and ppp_set_silent. + */ +ppp_set_silent(pppos, 1); + +/* + * Initiate PPP listener (i.e. wait for an incoming connection), can only + * be called if PPP session is in the dead state (i.e. disconnected). + */ +ppp_listen(ppp); + + +/* + * Closing PPP connection + * ====================== + */ + +/* + * Initiate the end of the PPP session, without carrier lost signal + * (nocarrier=0), meaning a clean shutdown of PPP protocols. + * You can call this function at anytime. + */ +u8_t nocarrier = 0; +ppp_close(ppp, nocarrier); +/* + * Then you must wait your status_cb() to be called, it may takes from a few + * seconds to several tens of seconds depending on the current PPP state. + */ + +/* + * Freeing a PPP connection + * ======================== + */ + +/* + * Free the PPP control block, can only be called if PPP session is in the + * dead state (i.e. disconnected). You need to call ppp_close() before. + */ +ppp_free(ppp); + + + +3 PPPoS input path (raw API, IRQ safe API, TCPIP API) +===================================================== + +Received data on serial port should be sent to lwIP using the pppos_input() +function or the pppos_input_tcpip() function. + +If NO_SYS is 1 and if PPP_INPROC_IRQ_SAFE is 0 (the default), pppos_input() +is not IRQ safe and then *MUST* only be called inside your main loop. + +Whatever the NO_SYS value, if PPP_INPROC_IRQ_SAFE is 1, pppos_input() is IRQ +safe and can be safely called from an interrupt context, using that is going +to reduce your need of buffer if pppos_input() is called byte after byte in +your rx serial interrupt. + +if NO_SYS is 0, the thread safe way outside an interrupt context is to use +the pppos_input_tcpip() function to pass input data to the lwIP core thread +using the TCPIP API. This is thread safe in all cases but you should avoid +passing data byte after byte because it uses heavy locking (mailbox) and it +allocates pbuf, better fill them ! + +if NO_SYS is 0 and if PPP_INPROC_IRQ_SAFE is 1, you may also use pppos_input() +from an RX thread, however pppos_input() is not thread safe by itself. You can +do that *BUT* you should NEVER call pppos_connect(), pppos_listen() and +ppp_free() if pppos_input() can still be running, doing this is NOT thread safe +at all. Using PPP_INPROC_IRQ_SAFE from an RX thread is discouraged unless you +really know what you are doing, your move ;-) + + +/* + * Fonction to call for received data + * + * ppp, PPP control block + * buffer, input buffer + * buffer_len, buffer length in bytes + */ +void pppos_input(ppp, buffer, buffer_len); + +or + +void pppos_input_tcpip(ppp, buffer, buffer_len); + + + +4 Thread safe PPP API (PPPAPI) +============================== + +There is a thread safe API for all corresponding ppp_* functions, you have to +enable LWIP_PPP_API in your lwipopts.h file, then see +include/netif/ppp/pppapi.h, this is actually pretty obvious. + + + +5 Notify phase callback (PPP_NOTIFY_PHASE) +========================================== + +Notify phase callback, enabled using the PPP_NOTIFY_PHASE config option, let +you configure a callback that is called on each PPP internal state change. +This is different from the status callback which only warns you about +up(running) and down(dead) events. + +Notify phase callback can be used, for example, to set a LED pattern depending +on the current phase of the PPP session. Here is a callback example which +tries to mimic what we usually see on xDSL modems while they are negotiating +the link, which should be self-explanatory: + +static void ppp_notify_phase_cb(ppp_pcb *pcb, u8_t phase, void *ctx) { + switch (phase) { + + /* Session is down (either permanently or briefly) */ + case PPP_PHASE_DEAD: + led_set(PPP_LED, LED_OFF); + break; + + /* We are between two sessions */ + case PPP_PHASE_HOLDOFF: + led_set(PPP_LED, LED_SLOW_BLINK); + break; + + /* Session just started */ + case PPP_PHASE_INITIALIZE: + led_set(PPP_LED, LED_FAST_BLINK); + break; + + /* Session is running */ + case PPP_PHASE_RUNNING: + led_set(PPP_LED, LED_ON); + break; + + default: + break; + } +} + + + +6 Upgrading from lwIP <= 1.4.x to lwIP >= 2.0.x +=============================================== + +PPP API was fully reworked between 1.4.x and 2.0.x releases. However porting +from previous lwIP version is pretty easy: + +* Previous PPP API used an integer to identify PPP sessions, we are now + using ppp_pcb* control block, therefore all functions changed from "int ppp" + to "ppp_pcb *ppp" + +* struct netif was moved outside the PPP structure, you have to provide a netif + for PPP interface in pppoX_create() functions + +* PPP session are not started automatically after you created them anymore, + you have to call ppp_connect(), this way you can configure the session before + starting it. + +* Previous PPP API used CamelCase, we are now using snake_case. + +* Previous PPP API mixed PPPoS and PPPoE calls, this isn't the case anymore, + PPPoS functions are now prefixed pppos_ and PPPoE functions are now prefixed + pppoe_, common functions are now prefixed ppp_. + +* New PPPERR_ error codes added, check you have all of them in your status + callback function + +* Only the following include files should now be used in user application: + #include "netif/ppp/pppapi.h" + #include "netif/ppp/pppos.h" + #include "netif/ppp/pppoe.h" + #include "netif/ppp/pppol2tp.h" + + Functions from ppp.h can be used, but you don't need to include this header + file as it is already included by above header files. + +* PPP_INPROC_OWNTHREAD was broken by design and was removed, you have to create + your own serial rx thread + +* PPP_INPROC_MULTITHREADED option was misnamed and confusing and was renamed + PPP_INPROC_IRQ_SAFE, please read the "PPPoS input path" documentation above + because you might have been fooled by that + +* If you used tcpip_callback_with_block() on ppp_ functions you may wish to use + the PPPAPI API instead. + +* ppp_sighup and ppp_close functions were merged using an optional argument + "nocarrier" on ppp_close. + +* DNS servers are now only remotely asked if LWIP_DNS is set and if + ppp_set_usepeerdns() is set to true, they are now automatically registered + using the dns_setserver() function so you don't need to do that in the PPP + callback anymore. + +* PPPoS does not use the SIO API anymore, as such it now requires a serial + output callback in place of sio_write + +* PPP_MAXIDLEFLAG is now in ms instead of jiffies diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/rawapi.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/rawapi.txt new file mode 100644 index 0000000..0cdfdce --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/rawapi.txt @@ -0,0 +1,499 @@ +Raw TCP/IP interface for lwIP + +Authors: Adam Dunkels, Leon Woestenberg, Christiaan Simons + +lwIP provides three Application Program's Interfaces (APIs) for programs +to use for communication with the TCP/IP code: +* low-level "core" / "callback" or "raw" API. +* higher-level "sequential" API. +* BSD-style socket API. + +The raw API (sometimes called native API) is an event-driven API designed +to be used without an operating system that implements zero-copy send and +receive. This API is also used by the core stack for interaction between +the various protocols. It is the only API available when running lwIP +without an operating system. + +The sequential API provides a way for ordinary, sequential, programs +to use the lwIP stack. It is quite similar to the BSD socket API. The +model of execution is based on the blocking open-read-write-close +paradigm. Since the TCP/IP stack is event based by nature, the TCP/IP +code and the application program must reside in different execution +contexts (threads). + +The socket API is a compatibility API for existing applications, +currently it is built on top of the sequential API. It is meant to +provide all functions needed to run socket API applications running +on other platforms (e.g. unix / windows etc.). However, due to limitations +in the specification of this API, there might be incompatibilities +that require small modifications of existing programs. + +** Multithreading + +lwIP started targeting single-threaded environments. When adding multi- +threading support, instead of making the core thread-safe, another +approach was chosen: there is one main thread running the lwIP core +(also known as the "tcpip_thread"). When running in a multithreaded +environment, raw API functions MUST only be called from the core thread +since raw API functions are not protected from concurrent access (aside +from pbuf- and memory management functions). Application threads using +the sequential- or socket API communicate with this main thread through +message passing. + + As such, the list of functions that may be called from + other threads or an ISR is very limited! Only functions + from these API header files are thread-safe: + - api.h + - netbuf.h + - netdb.h + - netifapi.h + - pppapi.h + - sockets.h + - sys.h + + Additionaly, memory (de-)allocation functions may be + called from multiple threads (not ISR!) with NO_SYS=0 + since they are protected by SYS_LIGHTWEIGHT_PROT and/or + semaphores. + + Netconn or Socket API functions are thread safe against the + core thread but they are not reentrant at the control block + granularity level. That is, a UDP or TCP control block must + not be shared among multiple threads without proper locking. + + If SYS_LIGHTWEIGHT_PROT is set to 1 and + LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is set to 1, + pbuf_free() may also be called from another thread or + an ISR (since only then, mem_free - for PBUF_RAM - may + be called from an ISR: otherwise, the HEAP is only + protected by semaphores). + + +** The remainder of this document discusses the "raw" API. ** + +The raw TCP/IP interface allows the application program to integrate +better with the TCP/IP code. Program execution is event based by +having callback functions being called from within the TCP/IP +code. The TCP/IP code and the application program both run in the same +thread. The sequential API has a much higher overhead and is not very +well suited for small systems since it forces a multithreaded paradigm +on the application. + +The raw TCP/IP interface is not only faster in terms of code execution +time but is also less memory intensive. The drawback is that program +development is somewhat harder and application programs written for +the raw TCP/IP interface are more difficult to understand. Still, this +is the preferred way of writing applications that should be small in +code size and memory usage. + +All APIs can be used simultaneously by different application +programs. In fact, the sequential API is implemented as an application +program using the raw TCP/IP interface. + +Do not confuse the lwIP raw API with raw Ethernet or IP sockets. +The former is a way of interfacing the lwIP network stack (including +TCP and UDP), the later refers to processing raw Ethernet or IP data +instead of TCP connections or UDP packets. + +Raw API applications may never block since all packet processing +(input and output) as well as timer processing (TCP mainly) is done +in a single execution context. + +--- Callbacks + +Program execution is driven by callbacks functions, which are then +invoked by the lwIP core when activity related to that application +occurs. A particular application may register to be notified via a +callback function for events such as incoming data available, outgoing +data sent, error notifications, poll timer expiration, connection +closed, etc. An application can provide a callback function to perform +processing for any or all of these events. Each callback is an ordinary +C function that is called from within the TCP/IP code. Every callback +function is passed the current TCP or UDP connection state as an +argument. Also, in order to be able to keep program specific state, +the callback functions are called with a program specified argument +that is independent of the TCP/IP state. + +The function for setting the application connection state is: + +- void tcp_arg(struct tcp_pcb *pcb, void *arg) + + Specifies the program specific state that should be passed to all + other callback functions. The "pcb" argument is the current TCP + connection control block, and the "arg" argument is the argument + that will be passed to the callbacks. + + +--- TCP connection setup + +The functions used for setting up connections is similar to that of +the sequential API and of the BSD socket API. A new TCP connection +identifier (i.e., a protocol control block - PCB) is created with the +tcp_new() function. This PCB can then be either set to listen for new +incoming connections or be explicitly connected to another host. + +- struct tcp_pcb *tcp_new(void) + + Creates a new connection identifier (PCB). If memory is not + available for creating the new pcb, NULL is returned. + +- err_t tcp_bind(struct tcp_pcb *pcb, ip_addr_t *ipaddr, + u16_t port) + + Binds the pcb to a local IP address and port number. The IP address + can be specified as IP_ADDR_ANY in order to bind the connection to + all local IP addresses. + + If another connection is bound to the same port, the function will + return ERR_USE, otherwise ERR_OK is returned. + +- struct tcp_pcb *tcp_listen(struct tcp_pcb *pcb) + + Commands a pcb to start listening for incoming connections. When an + incoming connection is accepted, the function specified with the + tcp_accept() function will be called. The pcb will have to be bound + to a local port with the tcp_bind() function. + + The tcp_listen() function returns a new connection identifier, and + the one passed as an argument to the function will be + deallocated. The reason for this behavior is that less memory is + needed for a connection that is listening, so tcp_listen() will + reclaim the memory needed for the original connection and allocate a + new smaller memory block for the listening connection. + + tcp_listen() may return NULL if no memory was available for the + listening connection. If so, the memory associated with the pcb + passed as an argument to tcp_listen() will not be deallocated. + +- struct tcp_pcb *tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog) + + Same as tcp_listen, but limits the number of outstanding connections + in the listen queue to the value specified by the backlog argument. + To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h. + +- void tcp_accept(struct tcp_pcb *pcb, + err_t (* accept)(void *arg, struct tcp_pcb *newpcb, + err_t err)) + + Specified the callback function that should be called when a new + connection arrives on a listening connection. + +- err_t tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, + u16_t port, err_t (* connected)(void *arg, + struct tcp_pcb *tpcb, + err_t err)); + + Sets up the pcb to connect to the remote host and sends the + initial SYN segment which opens the connection. + + The tcp_connect() function returns immediately; it does not wait for + the connection to be properly setup. Instead, it will call the + function specified as the fourth argument (the "connected" argument) + when the connection is established. If the connection could not be + properly established, either because the other host refused the + connection or because the other host didn't answer, the "err" + callback function of this pcb (registered with tcp_err, see below) + will be called. + + The tcp_connect() function can return ERR_MEM if no memory is + available for enqueueing the SYN segment. If the SYN indeed was + enqueued successfully, the tcp_connect() function returns ERR_OK. + + +--- Sending TCP data + +TCP data is sent by enqueueing the data with a call to +tcp_write(). When the data is successfully transmitted to the remote +host, the application will be notified with a call to a specified +callback function. + +- err_t tcp_write(struct tcp_pcb *pcb, const void *dataptr, u16_t len, + u8_t apiflags) + + Enqueues the data pointed to by the argument dataptr. The length of + the data is passed as the len parameter. The apiflags can be one or more of: + - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated + for the data to be copied into. If this flag is not given, no new memory + should be allocated and the data should only be referenced by pointer. This + also means that the memory behind dataptr must not change until the data is + ACKed by the remote host + - TCP_WRITE_FLAG_MORE: indicates that more data follows. If this is omitted, + the PSH flag is set in the last segment created by this call to tcp_write. + If this flag is given, the PSH flag is not set. + + The tcp_write() function will fail and return ERR_MEM if the length + of the data exceeds the current send buffer size or if the length of + the queue of outgoing segment is larger than the upper limit defined + in lwipopts.h. The number of bytes available in the output queue can + be retrieved with the tcp_sndbuf() function. + + The proper way to use this function is to call the function with at + most tcp_sndbuf() bytes of data. If the function returns ERR_MEM, + the application should wait until some of the currently enqueued + data has been successfully received by the other host and try again. + +- void tcp_sent(struct tcp_pcb *pcb, + err_t (* sent)(void *arg, struct tcp_pcb *tpcb, + u16_t len)) + + Specifies the callback function that should be called when data has + successfully been received (i.e., acknowledged) by the remote + host. The len argument passed to the callback function gives the + amount bytes that was acknowledged by the last acknowledgment. + + +--- Receiving TCP data + +TCP data reception is callback based - an application specified +callback function is called when new data arrives. When the +application has taken the data, it has to call the tcp_recved() +function to indicate that TCP can advertise increase the receive +window. + +- void tcp_recv(struct tcp_pcb *pcb, + err_t (* recv)(void *arg, struct tcp_pcb *tpcb, + struct pbuf *p, err_t err)) + + Sets the callback function that will be called when new data + arrives. The callback function will be passed a NULL pbuf to + indicate that the remote host has closed the connection. If + there are no errors and the callback function is to return + ERR_OK, then it must free the pbuf. Otherwise, it must not + free the pbuf so that lwIP core code can store it. + +- void tcp_recved(struct tcp_pcb *pcb, u16_t len) + + Must be called when the application has received the data. The len + argument indicates the length of the received data. + + +--- Application polling + +When a connection is idle (i.e., no data is either transmitted or +received), lwIP will repeatedly poll the application by calling a +specified callback function. This can be used either as a watchdog +timer for killing connections that have stayed idle for too long, or +as a method of waiting for memory to become available. For instance, +if a call to tcp_write() has failed because memory wasn't available, +the application may use the polling functionality to call tcp_write() +again when the connection has been idle for a while. + +- void tcp_poll(struct tcp_pcb *pcb, + err_t (* poll)(void *arg, struct tcp_pcb *tpcb), + u8_t interval) + + Specifies the polling interval and the callback function that should + be called to poll the application. The interval is specified in + number of TCP coarse grained timer shots, which typically occurs + twice a second. An interval of 10 means that the application would + be polled every 5 seconds. + + +--- Closing and aborting connections + +- err_t tcp_close(struct tcp_pcb *pcb) + + Closes the connection. The function may return ERR_MEM if no memory + was available for closing the connection. If so, the application + should wait and try again either by using the acknowledgment + callback or the polling functionality. If the close succeeds, the + function returns ERR_OK. + + The pcb is deallocated by the TCP code after a call to tcp_close(). + +- void tcp_abort(struct tcp_pcb *pcb) + + Aborts the connection by sending a RST (reset) segment to the remote + host. The pcb is deallocated. This function never fails. + + ATTENTION: When calling this from one of the TCP callbacks, make + sure you always return ERR_ABRT (and never return ERR_ABRT otherwise + or you will risk accessing deallocated memory or memory leaks! + + +If a connection is aborted because of an error, the application is +alerted of this event by the err callback. Errors that might abort a +connection are when there is a shortage of memory. The callback +function to be called is set using the tcp_err() function. + +- void tcp_err(struct tcp_pcb *pcb, void (* err)(void *arg, + err_t err)) + + The error callback function does not get the pcb passed to it as a + parameter since the pcb may already have been deallocated. + + +--- UDP interface + +The UDP interface is similar to that of TCP, but due to the lower +level of complexity of UDP, the interface is significantly simpler. + +- struct udp_pcb *udp_new(void) + + Creates a new UDP pcb which can be used for UDP communication. The + pcb is not active until it has either been bound to a local address + or connected to a remote address. + +- void udp_remove(struct udp_pcb *pcb) + + Removes and deallocates the pcb. + +- err_t udp_bind(struct udp_pcb *pcb, ip_addr_t *ipaddr, + u16_t port) + + Binds the pcb to a local address. The IP-address argument "ipaddr" + can be IP_ADDR_ANY to indicate that it should listen to any local IP + address. The function currently always return ERR_OK. + +- err_t udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, + u16_t port) + + Sets the remote end of the pcb. This function does not generate any + network traffic, but only set the remote address of the pcb. + +- err_t udp_disconnect(struct udp_pcb *pcb) + + Remove the remote end of the pcb. This function does not generate + any network traffic, but only removes the remote address of the pcb. + +- err_t udp_send(struct udp_pcb *pcb, struct pbuf *p) + + Sends the pbuf p. The pbuf is not deallocated. + +- void udp_recv(struct udp_pcb *pcb, + void (* recv)(void *arg, struct udp_pcb *upcb, + struct pbuf *p, + ip_addr_t *addr, + u16_t port), + void *recv_arg) + + Specifies a callback function that should be called when a UDP + datagram is received. + + +--- System initalization + +A truly complete and generic sequence for initializing the lwIP stack +cannot be given because it depends on additional initializations for +your runtime environment (e.g. timers). + +We can give you some idea on how to proceed when using the raw API. +We assume a configuration using a single Ethernet netif and the +UDP and TCP transport layers, IPv4 and the DHCP client. + +Call these functions in the order of appearance: + +- lwip_init() + + Initialize the lwIP stack and all of its subsystems. + +- netif_add(struct netif *netif, const ip4_addr_t *ipaddr, + const ip4_addr_t *netmask, const ip4_addr_t *gw, + void *state, netif_init_fn init, netif_input_fn input) + + Adds your network interface to the netif_list. Allocate a struct + netif and pass a pointer to this structure as the first argument. + Give pointers to cleared ip_addr structures when using DHCP, + or fill them with sane numbers otherwise. The state pointer may be NULL. + + The init function pointer must point to a initialization function for + your Ethernet netif interface. The following code illustrates its use. + + err_t netif_if_init(struct netif *netif) + { + u8_t i; + + for (i = 0; i < ETHARP_HWADDR_LEN; i++) { + netif->hwaddr[i] = some_eth_addr[i]; + } + init_my_eth_device(); + return ERR_OK; + } + + For Ethernet drivers, the input function pointer must point to the lwIP + function ethernet_input() declared in "netif/etharp.h". Other drivers + must use ip_input() declared in "lwip/ip.h". + +- netif_set_default(struct netif *netif) + + Registers the default network interface. + +- netif_set_link_up(struct netif *netif) + + This is the hardware link state; e.g. whether cable is plugged for wired + Ethernet interface. This function must be called even if you don't know + the current state. Having link up and link down events is optional but + DHCP and IPv6 discover benefit well from those events. + +- netif_set_up(struct netif *netif) + + This is the administrative (= software) state of the netif, when the + netif is fully configured this function must be called. + +- dhcp_start(struct netif *netif) + + Creates a new DHCP client for this interface on the first call. + + You can peek in the netif->dhcp struct for the actual DHCP status. + +- sys_check_timeouts() + + When the system is running, you have to periodically call + sys_check_timeouts() which will handle all timers for all protocols in + the stack; add this to your main loop or equivalent. + + +--- Optimalization hints + +The first thing you want to optimize is the lwip_standard_checksum() +routine from src/core/inet.c. You can override this standard +function with the #define LWIP_CHKSUM . + +There are C examples given in inet.c or you might want to +craft an assembly function for this. RFC1071 is a good +introduction to this subject. + +Other significant improvements can be made by supplying +assembly or inline replacements for htons() and htonl() +if you're using a little-endian architecture. +#define lwip_htons(x) +#define lwip_htonl(x) +If you #define them to htons() and htonl(), you should +#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS to prevent lwIP from +defining hton*/ntoh* compatibility macros. + +Check your network interface driver if it reads at +a higher speed than the maximum wire-speed. If the +hardware isn't serviced frequently and fast enough +buffer overflows are likely to occur. + +E.g. when using the cs8900 driver, call cs8900if_service(ethif) +as frequently as possible. When using an RTOS let the cs8900 interrupt +wake a high priority task that services your driver using a binary +semaphore or event flag. Some drivers might allow additional tuning +to match your application and network. + +For a production release it is recommended to set LWIP_STATS to 0. +Note that speed performance isn't influenced much by simply setting +high values to the memory options. + +For more optimization hints take a look at the lwIP wiki. + +--- Zero-copy MACs + +To achieve zero-copy on transmit, the data passed to the raw API must +remain unchanged until sent. Because the send- (or write-)functions return +when the packets have been enqueued for sending, data must be kept stable +after that, too. + +This implies that PBUF_RAM/PBUF_POOL pbufs passed to raw-API send functions +must *not* be reused by the application unless their ref-count is 1. + +For no-copy pbufs (PBUF_ROM/PBUF_REF), data must be kept unchanged, too, +but the stack/driver will/must copy PBUF_REF'ed data when enqueueing, while +PBUF_ROM-pbufs are just enqueued (as ROM-data is expected to never change). + +Also, data passed to tcp_write without the copy-flag must not be changed! + +Therefore, be careful which type of PBUF you use and if you copy TCP data +or not! diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/savannah.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/savannah.txt new file mode 100644 index 0000000..d7d19eb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/savannah.txt @@ -0,0 +1,120 @@ +Daily Use Guide for using Savannah for lwIP + +Table of Contents: + +1 - Obtaining lwIP from the Git repository +2 - Committers/developers Git access using SSH +3 - Merging a development branch to master branch +4 - How to release lwIP + + + +1 Obtaining lwIP from the Git repository +---------------------------------------- + +To perform an anonymous Git clone of the master branch (this is where +bug fixes and incremental enhancements occur), do this: + git clone git://git.savannah.nongnu.org/lwip.git + +Or, obtain a stable branch (updated with bug fixes only) as follows: + git clone --branch DEVEL-1_4_1 git://git.savannah.nongnu.org/lwip.git + +Or, obtain a specific (fixed) release as follows: + git clone --branch STABLE-1_4_1 git://git.savannah.nongnu.org/lwip.git + + +2 Committers/developers Git access using SSH +-------------------------------------------- + +The Savannah server uses SSH (Secure Shell) protocol 2 authentication and encryption. +As such, Git commits to the server occur through a SSH tunnel for project members. +To create a SSH2 key pair in UNIX-like environments, do this: + ssh-keygen -t dsa + +Under Windows, a recommended SSH client is "PuTTY", freely available with good +documentation and a graphic user interface. Use its key generator. + +Now paste the id_dsa.pub contents into your Savannah account public key list. Wait +a while so that Savannah can update its configuration (This can take minutes). + +Try to login using SSH: + ssh -v your_login@git.sv.gnu.org + +If it tells you: + Linux vcs.savannah.gnu.org 2.6.32-5-xen-686 #1 SMP Wed Jun 17 17:10:03 UTC 2015 i686 + + Interactive shell login is not possible for security reasons. + VCS commands are allowed. + Last login: Tue May 15 23:10:12 2012 from 82.245.102.129 + You tried to execute: + Sorry, you are not allowed to execute that command. + Shared connection to git.sv.gnu.org closed. + +then you could login; Savannah refuses to give you a shell - which is OK, as we +are allowed to use SSH for Git only. Now, you should be able to do this: + git clone your_login@git.sv.gnu.org:/srv/git/lwip.git + +After which you can edit your local files with bug fixes or new features and +commit them. Make sure you know what you are doing when using Git to make +changes on the repository. If in doubt, ask on the lwip-members mailing list. + +(If SSH asks about authenticity of the host, you can check the key +fingerprint against https://savannah.nongnu.org/git/?group=lwip + + +3 - Merging a development branch to master branch +------------------------------------------------- + +Merging is a straightforward process in Git. How to merge all changes in a +development branch since our last merge from main: + +Checkout the master branch: + git checkout master + +Merge the development branch to master: + git merge your-development-branch + +Resolve any conflict. + +Commit the merge result. + git commit -a + +Push your commits: + git push + + +4 How to release lwIP +--------------------- + +First, tag the release using Git: (I use release number 1.4.1 throughout +this example). + git tag -a STABLE-1_4_1 + +Share the tag reference by pushing it to remote: + git push origin STABLE-1_4_1 + +Prepare the release: + cp -r lwip lwip-1.4.1 + rm -rf lwip-1.4.1/.git lwip-1.4.1/.gitattributes + +Archive the current directory using tar, gzip'd, bzip2'd and zip'd. + tar czvf lwip-1.4.1.tar.gz lwip-1.4.1 + tar cjvf lwip-1.4.1.tar.bz2 lwip-1.4.1 + zip -r lwip-1.4.1.zip lwip-1.4.1 + +Now, sign the archives with a detached GPG binary signature as follows: + gpg -b lwip-1.4.1.tar.gz + gpg -b lwip-1.4.1.tar.bz2 + gpg -b lwip-1.4.1.zip + +Upload these files using anonymous FTP: + ncftp ftp://savannah.gnu.org/incoming/savannah/lwip + ncftp> mput *1.4.1.* + +Additionally, you may post a news item on Savannah, like this: + +A new 1.4.1 release is now available here: +http://savannah.nongnu.org/files/?group=lwip&highlight=1.4.1 + +You will have to submit this via the user News interface, then approve +this via the Administrator News interface. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/sys_arch.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/sys_arch.txt new file mode 100644 index 0000000..4dc727b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/doc/sys_arch.txt @@ -0,0 +1,303 @@ +sys_arch interface for lwIP + +Author: Adam Dunkels + Simon Goldschmidt + +The operating system emulation layer provides a common interface +between the lwIP code and the underlying operating system kernel. The +general idea is that porting lwIP to new architectures requires only +small changes to a few header files and a new sys_arch +implementation. It is also possible to do a sys_arch implementation +that does not rely on any underlying operating system. + +The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full +lwIP functionality, multiple threads support can be implemented in the +sys_arch, but this is not required for the basic lwIP +functionality. Timer scheduling is implemented in lwIP, but can be implemented +by the sys_arch port (LWIP_TIMERS_CUSTOM==1). + +In addition to the source file providing the functionality of sys_arch, +the OS emulation layer must provide several header files defining +macros used throughout lwip. The files required and the macros they +must define are listed below the sys_arch description. + +Semaphores can be either counting or binary - lwIP works with both +kinds. Mailboxes should be implemented as a queue which allows multiple messages +to be posted (implementing as a rendez-vous point where only one message can be +posted at a time can have a highly negative impact on performance). A message +in a mailbox is just a pointer, nothing more. + +Semaphores are represented by the type "sys_sem_t" which is typedef'd +in the sys_arch.h file. Mailboxes are equivalently represented by the +type "sys_mbox_t". Mutexes are represented by the type "sys_mutex_t". +lwIP does not place any restrictions on how these types are represented +internally. + +Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that +allows both using pointers or actual OS structures to be used. This way, memory +required for such types can be either allocated in place (globally or on the +stack) or on the heap (allocated internally in the "*_new()" functions). + +The following functions must be implemented by the sys_arch: + +- void sys_init(void) + + Is called to initialize the sys_arch layer. + +- err_t sys_sem_new(sys_sem_t *sem, u8_t count) + + Creates a new semaphore. The semaphore is allocated to the memory that 'sem' + points to (which can be both a pointer or the actual OS structure). + The "count" argument specifies the initial state of the semaphore (which is + either 0 or 1). + If the semaphore has been created, ERR_OK should be returned. Returning any + other error will provide a hint what went wrong, but except for assertions, + no real error handling is implemented. + +- void sys_sem_free(sys_sem_t *sem) + + Deallocates a semaphore. + +- void sys_sem_signal(sys_sem_t *sem) + + Signals a semaphore. + +- u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) + + Blocks the thread while waiting for the semaphore to be + signaled. If the "timeout" argument is non-zero, the thread should + only be blocked for the specified time (measured in + milliseconds). If the "timeout" argument is zero, the thread should be + blocked until the semaphore is signalled. + + If the timeout argument is non-zero, the return value is the number of + milliseconds spent waiting for the semaphore to be signaled. If the + semaphore wasn't signaled within the specified time, the return value is + SYS_ARCH_TIMEOUT. If the thread didn't have to wait for the semaphore + (i.e., it was already signaled), the function may return zero. + + Notice that lwIP implements a function with a similar name, + sys_sem_wait(), that uses the sys_arch_sem_wait() function. + +- int sys_sem_valid(sys_sem_t *sem) + + Returns 1 if the semaphore is valid, 0 if it is not valid. + When using pointers, a simple way is to check the pointer for != NULL. + When directly using OS structures, implementing this may be more complex. + This may also be a define, in which case the function is not prototyped. + +- void sys_sem_set_invalid(sys_sem_t *sem) + + Invalidate a semaphore so that sys_sem_valid() returns 0. + ATTENTION: This does NOT mean that the semaphore shall be deallocated: + sys_sem_free() is always called before calling this function! + This may also be a define, in which case the function is not prototyped. + +- void sys_mutex_new(sys_mutex_t *mutex) + + Creates a new mutex. The mutex is allocated to the memory that 'mutex' + points to (which can be both a pointer or the actual OS structure). + If the mutex has been created, ERR_OK should be returned. Returning any + other error will provide a hint what went wrong, but except for assertions, + no real error handling is implemented. + +- void sys_mutex_free(sys_mutex_t *mutex) + + Deallocates a mutex. + +- void sys_mutex_lock(sys_mutex_t *mutex) + + Blocks the thread until the mutex can be grabbed. + +- void sys_mutex_unlock(sys_mutex_t *mutex) + + Releases the mutex previously locked through 'sys_mutex_lock()'. + +- void sys_mutex_valid(sys_mutex_t *mutex) + + Returns 1 if the mutes is valid, 0 if it is not valid. + When using pointers, a simple way is to check the pointer for != NULL. + When directly using OS structures, implementing this may be more complex. + This may also be a define, in which case the function is not prototyped. + +- void sys_mutex_set_invalid(sys_mutex_t *mutex) + + Invalidate a mutex so that sys_mutex_valid() returns 0. + ATTENTION: This does NOT mean that the mutex shall be deallocated: + sys_mutex_free() is always called before calling this function! + This may also be a define, in which case the function is not prototyped. + +- err_t sys_mbox_new(sys_mbox_t *mbox, int size) + + Creates an empty mailbox for maximum "size" elements. Elements stored + in mailboxes are pointers. You have to define macros "_MBOX_SIZE" + in your lwipopts.h, or ignore this parameter in your implementation + and use a default size. + If the mailbox has been created, ERR_OK should be returned. Returning any + other error will provide a hint what went wrong, but except for assertions, + no real error handling is implemented. + +- void sys_mbox_free(sys_mbox_t *mbox) + + Deallocates a mailbox. If there are messages still present in the + mailbox when the mailbox is deallocated, it is an indication of a + programming error in lwIP and the developer should be notified. + +- void sys_mbox_post(sys_mbox_t *mbox, void *msg) + + Posts the "msg" to the mailbox. This function have to block until + the "msg" is really posted. + +- err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg) + + Try to post the "msg" to the mailbox. Returns ERR_MEM if this one + is full, else, ERR_OK if the "msg" is posted. + +- u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) + + Blocks the thread until a message arrives in the mailbox, but does + not block the thread longer than "timeout" milliseconds (similar to + the sys_arch_sem_wait() function). If "timeout" is 0, the thread should + be blocked until a message arrives. The "msg" argument is a result + parameter that is set by the function (i.e., by doing "*msg = + ptr"). The "msg" parameter maybe NULL to indicate that the message + should be dropped. + + The return values are the same as for the sys_arch_sem_wait() function: + Number of milliseconds spent waiting or SYS_ARCH_TIMEOUT if there was a + timeout. + + Note that a function with a similar name, sys_mbox_fetch(), is + implemented by lwIP. + +- u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) + + This is similar to sys_arch_mbox_fetch, however if a message is not + present in the mailbox, it immediately returns with the code + SYS_MBOX_EMPTY. On success 0 is returned. + + To allow for efficient implementations, this can be defined as a + function-like macro in sys_arch.h instead of a normal function. For + example, a naive implementation could be: + #define sys_arch_mbox_tryfetch(mbox,msg) \ + sys_arch_mbox_fetch(mbox,msg,1) + although this would introduce unnecessary delays. + +- int sys_mbox_valid(sys_mbox_t *mbox) + + Returns 1 if the mailbox is valid, 0 if it is not valid. + When using pointers, a simple way is to check the pointer for != NULL. + When directly using OS structures, implementing this may be more complex. + This may also be a define, in which case the function is not prototyped. + +- void sys_mbox_set_invalid(sys_mbox_t *mbox) + + Invalidate a mailbox so that sys_mbox_valid() returns 0. + ATTENTION: This does NOT mean that the mailbox shall be deallocated: + sys_mbox_free() is always called before calling this function! + This may also be a define, in which case the function is not prototyped. + +If threads are supported by the underlying operating system and if +such functionality is needed in lwIP, the following function will have +to be implemented as well: + +- sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio) + + Starts a new thread named "name" with priority "prio" that will begin its + execution in the function "thread()". The "arg" argument will be passed as an + argument to the thread() function. The stack size to used for this thread is + the "stacksize" parameter. The id of the new thread is returned. Both the id + and the priority are system dependent. + +When lwIP is used from more than one context (e.g. from multiple threads OR from +main-loop and from interrupts), the SYS_LIGHTWEIGHT_PROT protection SHOULD be enabled! + +- sys_prot_t sys_arch_protect(void) + + This optional function does a "fast" critical region protection and returns + the previous protection level. This function is only called during very short + critical regions. An embedded system which supports ISR-based drivers might + want to implement this function by disabling interrupts. Task-based systems + might want to implement this by using a mutex or disabling tasking. This + function should support recursive calls from the same task or interrupt. In + other words, sys_arch_protect() could be called while already protected. In + that case the return value indicates that it is already protected. + + sys_arch_protect() is only required if your port is supporting an operating + system. + +- void sys_arch_unprotect(sys_prot_t pval) + + This optional function does a "fast" set of critical region protection to the + value specified by pval. See the documentation for sys_arch_protect() for + more information. This function is only required if your port is supporting + an operating system. + +For some configurations, you also need: + +- u32_t sys_now(void) + + This optional function returns the current time in milliseconds (don't care + for wraparound, this is only used for time diffs). + Not implementing this function means you cannot use some modules (e.g. TCP + timestamps, internal timeouts for NO_SYS==1). + + +Note: + +Be careful with using mem_malloc() in sys_arch. When malloc() refers to +mem_malloc() you can run into a circular function call problem. In mem.c +mem_init() tries to allcate a semaphore using mem_malloc, which of course +can't be performed when sys_arch uses mem_malloc. + +------------------------------------------------------------------------------- +Additional files required for the "OS support" emulation layer: +------------------------------------------------------------------------------- + +cc.h - Architecture environment, some compiler specific, some + environment specific (probably should move env stuff + to sys_arch.h.) + + Typedefs for the types used by lwip - + u8_t, s8_t, u16_t, s16_t, u32_t, s32_t, mem_ptr_t + + Compiler hints for packing lwip's structures - + PACK_STRUCT_FIELD(x) + PACK_STRUCT_STRUCT + PACK_STRUCT_BEGIN + PACK_STRUCT_END + + Platform specific diagnostic output - + LWIP_PLATFORM_DIAG(x) - non-fatal, print a message. + LWIP_PLATFORM_ASSERT(x) - fatal, print message and abandon execution. + Portability defines for printf formatters: + U16_F, S16_F, X16_F, U32_F, S32_F, X32_F, SZT_F + + "lightweight" synchronization mechanisms - + SYS_ARCH_DECL_PROTECT(x) - declare a protection state variable. + SYS_ARCH_PROTECT(x) - enter protection mode. + SYS_ARCH_UNPROTECT(x) - leave protection mode. + + If the compiler does not provide memset() this file must include a + definition of it, or include a file which defines it. + + This file must either include a system-local which defines + the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO + to make lwip/arch.h define the codes which are used throughout. + + +perf.h - Architecture specific performance measurement. + Measurement calls made throughout lwip, these can be defined to nothing. + PERF_START - start measuring something. + PERF_STOP(x) - stop measuring something, and record the result. + +sys_arch.h - Tied to sys_arch.c + + Arch dependent types for the following objects: + sys_sem_t, sys_mbox_t, sys_thread_t, + And, optionally: + sys_prot_t + + Defines to set vars of sys_mbox_t and sys_sem_t to NULL. + SYS_MBOX_NULL NULL + SYS_SEM_NULL NULL diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.c new file mode 100644 index 0000000..c0245a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.c @@ -0,0 +1,269 @@ +/** + * @file + * Ethernet Interface for standalone applications (without RTOS) + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/mem.h" +#include "netif/etharp.h" +#include "ethernetif.h" +#include "gd32f10x_enet.h" +#include "main.h" +#include + + +/* network interface name */ +#define IFNAME0 'G' +#define IFNAME1 'D' + +/* ENET RxDMA/TxDMA descriptor */ +extern enet_descriptors_struct rxdesc_tab[ENET_RXBUF_NUM], txdesc_tab[ENET_TXBUF_NUM]; + +/* ENET receive buffer */ +extern uint8_t rx_buff[ENET_RXBUF_NUM][ENET_RXBUF_SIZE]; + +/* ENET transmit buffer */ +extern uint8_t tx_buff[ENET_TXBUF_NUM][ENET_TXBUF_SIZE]; + +/*global transmit and receive descriptors pointers */ +extern enet_descriptors_struct *dma_current_txdesc; +extern enet_descriptors_struct *dma_current_rxdesc; + +/* preserve another ENET RxDMA/TxDMA ptp descriptor for normal mode */ +enet_descriptors_struct ptp_txstructure[ENET_TXBUF_NUM]; +enet_descriptors_struct ptp_rxstructure[ENET_RXBUF_NUM]; + +/** + * In this function, the hardware should be initialized. + * Called from ethernetif_init(). + * + * @param netif the already initialized lwip network interface structure + * for this ethernetif + */ +static void low_level_init(struct netif *netif) +{ +#ifdef CHECKSUM_BY_HARDWARE + int i; +#endif + /* set MAC hardware address length */ + netif->hwaddr_len = ETHARP_HWADDR_LEN; + + /* set MAC hardware address */ + netif->hwaddr[0] = MAC_ADDR0; + netif->hwaddr[1] = MAC_ADDR1; + netif->hwaddr[2] = MAC_ADDR2; + netif->hwaddr[3] = MAC_ADDR3; + netif->hwaddr[4] = MAC_ADDR4; + netif->hwaddr[5] = MAC_ADDR5; + + /* initialize MAC address in ethernet MAC */ + enet_mac_address_set(ENET_MAC_ADDRESS0, netif->hwaddr); + + /* maximum transfer unit */ + netif->mtu = 1500; + + /* device capabilities */ + /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + + /* initialize descriptors list: chain/ring mode */ + enet_descriptors_chain_init(ENET_DMA_TX); + enet_descriptors_chain_init(ENET_DMA_RX); + + /* enable ethernet Rx interrrupt */ + { int i; + for(i=0; istatus & ENET_TDES0_DAV)){ + } + + buffer = (uint8_t *)(enet_desc_information_get(dma_current_txdesc, TXDESC_BUFFER_1_ADDR)); + + /* copy frame from pbufs to driver buffers */ + for(q = p; q != NULL; q = q->next){ + memcpy((uint8_t *)&buffer[framelength], q->payload, q->len); + framelength = framelength + q->len; + } + + /* note: padding and CRC for transmitted frame + are automatically inserted by DMA */ + + /* transmit descriptors to give to DMA */ + ENET_NOCOPY_FRAME_TRANSMIT(framelength); + + return ERR_OK; +} + +/** + * Should allocate a pbuf and transfer the bytes of the incoming + * packet from the interface into the pbuf. + * + * @param netif the lwip network interface structure for this ethernetif + * @return a pbuf filled with the received packet (including MAC header) + * NULL on memory error + */ +static struct pbuf * low_level_input(struct netif *netif) +{ + struct pbuf *p, *q; + u16_t len; + int l =0; + uint8_t *buffer; + + p = NULL; + + /* obtain the size of the packet and put it into the "len" variable. */ + len = enet_desc_information_get(dma_current_rxdesc, RXDESC_FRAME_LENGTH); + buffer = (uint8_t *)(enet_desc_information_get(dma_current_rxdesc, RXDESC_BUFFER_1_ADDR)); + + /* we allocate a pbuf chain of pbufs from the Lwip buffer pool */ + p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); + + /* copy received frame to pbuf chain */ + if (p != NULL){ + for (q = p; q != NULL; q = q->next){ + memcpy((uint8_t *)q->payload, (u8_t*)&buffer[l], q->len); + l = l + q->len; + } + } + + ENET_NOCOPY_FRAME_RECEIVE(); + + return p; +} + +/** + * This function should be called when a packet is ready to be read + * from the interface. It uses the function low_level_input() that + * should handle the actual reception of bytes from the network + * interface. Then the type of the received packet is determined and + * the appropriate input function is called. + * + * @param netif the lwip network interface structure for this ethernetif + */ +err_t ethernetif_input(struct netif *netif) +{ + err_t err; + struct pbuf *p; + + /* move received packet into a new pbuf */ + p = low_level_input(netif); + + /* no packet could be read, silently ignore this */ + if (p == NULL) return ERR_MEM; + + /* entry point to the LwIP stack */ + err = netif->input(p, netif); + + if (err != ERR_OK){ + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); + pbuf_free(p); + p = NULL; + } + return err; +} + +/** + * Should be called at the beginning of the program to set up the + * network interface. It calls the function low_level_init() to do the + * actual setup of the hardware. + * + * This function should be passed as a parameter to netif_add(). + * + * @param netif the lwip network interface structure for this ethernetif + * @return ERR_OK if the loopif is initialized + * ERR_MEM if private data couldn't be allocated + * any other err_t on error + */ +err_t ethernetif_init(struct netif *netif) +{ + LWIP_ASSERT("netif != NULL", (netif != NULL)); + +#if LWIP_NETIF_HOSTNAME + /* Initialize interface hostname */ + netif->hostname = "Gigadevice.COM_lwip"; +#endif /* LWIP_NETIF_HOSTNAME */ + + netif->name[0] = IFNAME0; + netif->name[1] = IFNAME1; + /* We directly use etharp_output() here to save a function call. + * You can instead declare your own function an call etharp_output() + * from it if you have to do some checks before sending (e.g. if link + * is available...) */ + netif->output = etharp_output; + netif->linkoutput = low_level_output; + + /* initialize the hardware */ + low_level_init(netif); + + return ERR_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.h new file mode 100644 index 0000000..9ff1408 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/Basic/ethernetif.h @@ -0,0 +1,11 @@ +#ifndef __ETHERNETIF_H__ +#define __ETHERNETIF_H__ + + +#include "lwip/err.h" +#include "lwip/netif.h" + +err_t ethernetif_init(struct netif *netif); +err_t ethernetif_input(struct netif *netif); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/bpstruct.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/bpstruct.h new file mode 100644 index 0000000..177758c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/bpstruct.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#if defined(__IAR_SYSTEMS_ICC__) +#pragma pack(1) +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cc.h new file mode 100644 index 0000000..e9dafa3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cc.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __CC_H__ +#define __CC_H__ + +#include "cpu.h" + +#define U16_F "hu" +#define S16_F "d" +#define X16_F "hx" +#define U32_F "u" +#define S32_F "d" +#define X32_F "x" +#define SZT_F "uz" + + + + + +/* define compiler specific symbols */ +#if defined (__ICCARM__) + +#define PACK_STRUCT_BEGIN +#define PACK_STRUCT_STRUCT +#define PACK_STRUCT_END +#define PACK_STRUCT_FIELD(x) x +#define PACK_STRUCT_USE_INCLUDES + +#elif defined (__CC_ARM) + +#define PACK_STRUCT_BEGIN __packed +#define PACK_STRUCT_STRUCT +#define PACK_STRUCT_END +#define PACK_STRUCT_FIELD(x) x + +#elif defined (__GNUC__) + +#define PACK_STRUCT_BEGIN +#define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) +#define PACK_STRUCT_END +#define PACK_STRUCT_FIELD(x) x + +#elif defined (__TASKING__) + +#define PACK_STRUCT_BEGIN +#define PACK_STRUCT_STRUCT +#define PACK_STRUCT_END +#define PACK_STRUCT_FIELD(x) x + +#endif + +#define LWIP_PLATFORM_ASSERT(x) //do { if(!(x)) while(1); } while(0) + +#endif /* __CC_H__ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cpu.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cpu.h new file mode 100644 index 0000000..a02f86d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/cpu.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __CPU_H__ +#define __CPU_H__ + +#define BYTE_ORDER LITTLE_ENDIAN + +#endif /* __CPU_H__ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/epstruct.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/epstruct.h new file mode 100644 index 0000000..1e1a049 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/epstruct.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#if defined(__IAR_SYSTEMS_ICC__) +#pragma pack() +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/init.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/init.h new file mode 100644 index 0000000..e622c73 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/init.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __ARCH_INIT_H__ +#define __ARCH_INIT_H__ + +#define TCPIP_INIT_DONE(arg) tcpip_init_done(arg) + +void tcpip_init_done(void *); +int wait_for_tcpip_init(void); + +#endif /* __ARCH_INIT_H__ */ + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/lib.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/lib.h new file mode 100644 index 0000000..378f25b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/lib.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __LIB_H__ +#define __LIB_H__ + +#include + + +#endif /* __LIB_H__ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/perf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/perf.h new file mode 100644 index 0000000..334d42a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/perf.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __PERF_H__ +#define __PERF_H__ + +#define PERF_START /* null definition */ +#define PERF_STOP(x) /* null definition */ + +#endif /* __PERF_H__ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/sys_arch.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/sys_arch.h new file mode 100644 index 0000000..2e841bd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/port/GD32F10x/arch/sys_arch.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __SYS_RTXC_H__ +#define __SYS_RTXC_H__ + +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "semphr.h" + +#define SYS_MBOX_NULL (xQueueHandle)0 +#define SYS_SEM_NULL (xSemaphoreHandle)0 +#define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE + +typedef xSemaphoreHandle sys_sem_t; +typedef xSemaphoreHandle sys_mutex_t; +typedef xQueueHandle sys_mbox_t; +typedef xTaskHandle sys_thread_t; + +typedef struct _sys_arch_state_t +{ + // Task creation data. + char cTaskName[configMAX_TASK_NAME_LEN]; + unsigned short nStackDepth; + unsigned short nTaskCount; +} sys_arch_state_t; + + + +//extern sys_arch_state_t s_sys_arch_state; + +//void sys_set_default_state(); +//void sys_set_state(signed char *pTaskName, unsigned short nStackSize); + +/* Message queue constants. */ +#define archMESG_QUEUE_LENGTH ( 6 ) +#endif /* __SYS_RTXC_H__ */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/FILES b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/FILES new file mode 100644 index 0000000..0be0741 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/FILES @@ -0,0 +1,15 @@ +api/ - The code for the high-level wrapper API. Not needed if + you use the lowel-level call-back/raw API. + +apps/ - Higher layer applications that are specifically programmed + with the lwIP low-level raw API. + +core/ - The core of the TPC/IP stack; protocol implementations, + memory and buffer management, and the low-level raw API. + +include/ - lwIP include files. + +netif/ - Generic network interface device drivers are kept here. + +For more information on the various subdirectories, check the FILES +file in each directory. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/Filelists.mk b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/Filelists.mk new file mode 100644 index 0000000..7d30bb8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/Filelists.mk @@ -0,0 +1,181 @@ +# +# Copyright (c) 2001, 2002 Swedish Institute of Computer Science. +# 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. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +# SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +# +# This file is part of the lwIP TCP/IP stack. +# +# Author: Adam Dunkels +# + +# COREFILES, CORE4FILES: The minimum set of files needed for lwIP. +COREFILES=$(LWIPDIR)/core/init.c \ + $(LWIPDIR)/core/def.c \ + $(LWIPDIR)/core/dns.c \ + $(LWIPDIR)/core/inet_chksum.c \ + $(LWIPDIR)/core/ip.c \ + $(LWIPDIR)/core/mem.c \ + $(LWIPDIR)/core/memp.c \ + $(LWIPDIR)/core/netif.c \ + $(LWIPDIR)/core/pbuf.c \ + $(LWIPDIR)/core/raw.c \ + $(LWIPDIR)/core/stats.c \ + $(LWIPDIR)/core/sys.c \ + $(LWIPDIR)/core/tcp.c \ + $(LWIPDIR)/core/tcp_in.c \ + $(LWIPDIR)/core/tcp_out.c \ + $(LWIPDIR)/core/timeouts.c \ + $(LWIPDIR)/core/udp.c + +CORE4FILES=$(LWIPDIR)/core/ipv4/autoip.c \ + $(LWIPDIR)/core/ipv4/dhcp.c \ + $(LWIPDIR)/core/ipv4/etharp.c \ + $(LWIPDIR)/core/ipv4/icmp.c \ + $(LWIPDIR)/core/ipv4/igmp.c \ + $(LWIPDIR)/core/ipv4/ip4_frag.c \ + $(LWIPDIR)/core/ipv4/ip4.c \ + $(LWIPDIR)/core/ipv4/ip4_addr.c + +CORE6FILES=$(LWIPDIR)/core/ipv6/dhcp6.c \ + $(LWIPDIR)/core/ipv6/ethip6.c \ + $(LWIPDIR)/core/ipv6/icmp6.c \ + $(LWIPDIR)/core/ipv6/inet6.c \ + $(LWIPDIR)/core/ipv6/ip6.c \ + $(LWIPDIR)/core/ipv6/ip6_addr.c \ + $(LWIPDIR)/core/ipv6/ip6_frag.c \ + $(LWIPDIR)/core/ipv6/mld6.c \ + $(LWIPDIR)/core/ipv6/nd6.c + +# APIFILES: The files which implement the sequential and socket APIs. +APIFILES=$(LWIPDIR)/api/api_lib.c \ + $(LWIPDIR)/api/api_msg.c \ + $(LWIPDIR)/api/err.c \ + $(LWIPDIR)/api/netbuf.c \ + $(LWIPDIR)/api/netdb.c \ + $(LWIPDIR)/api/netifapi.c \ + $(LWIPDIR)/api/sockets.c \ + $(LWIPDIR)/api/tcpip.c + +# NETIFFILES: Files implementing various generic network interface functions +NETIFFILES=$(LWIPDIR)/netif/ethernet.c \ + $(LWIPDIR)/netif/slipif.c + +# SIXLOWPAN: 6LoWPAN +SIXLOWPAN=$(LWIPDIR)/netif/lowpan6.c \ + +# PPPFILES: PPP +PPPFILES=$(LWIPDIR)/netif/ppp/auth.c \ + $(LWIPDIR)/netif/ppp/ccp.c \ + $(LWIPDIR)/netif/ppp/chap-md5.c \ + $(LWIPDIR)/netif/ppp/chap_ms.c \ + $(LWIPDIR)/netif/ppp/chap-new.c \ + $(LWIPDIR)/netif/ppp/demand.c \ + $(LWIPDIR)/netif/ppp/eap.c \ + $(LWIPDIR)/netif/ppp/ecp.c \ + $(LWIPDIR)/netif/ppp/eui64.c \ + $(LWIPDIR)/netif/ppp/fsm.c \ + $(LWIPDIR)/netif/ppp/ipcp.c \ + $(LWIPDIR)/netif/ppp/ipv6cp.c \ + $(LWIPDIR)/netif/ppp/lcp.c \ + $(LWIPDIR)/netif/ppp/magic.c \ + $(LWIPDIR)/netif/ppp/mppe.c \ + $(LWIPDIR)/netif/ppp/multilink.c \ + $(LWIPDIR)/netif/ppp/ppp.c \ + $(LWIPDIR)/netif/ppp/pppapi.c \ + $(LWIPDIR)/netif/ppp/pppcrypt.c \ + $(LWIPDIR)/netif/ppp/pppoe.c \ + $(LWIPDIR)/netif/ppp/pppol2tp.c \ + $(LWIPDIR)/netif/ppp/pppos.c \ + $(LWIPDIR)/netif/ppp/upap.c \ + $(LWIPDIR)/netif/ppp/utils.c \ + $(LWIPDIR)/netif/ppp/vj.c \ + $(LWIPDIR)/netif/ppp/polarssl/arc4.c \ + $(LWIPDIR)/netif/ppp/polarssl/des.c \ + $(LWIPDIR)/netif/ppp/polarssl/md4.c \ + $(LWIPDIR)/netif/ppp/polarssl/md5.c \ + $(LWIPDIR)/netif/ppp/polarssl/sha1.c + +# LWIPNOAPPSFILES: All LWIP files without apps +LWIPNOAPPSFILES=$(COREFILES) \ + $(CORE4FILES) \ + $(CORE6FILES) \ + $(APIFILES) \ + $(NETIFFILES) \ + $(PPPFILES) \ + $(SIXLOWPAN) + +# SNMPFILES: SNMPv2c agent +SNMPFILES=$(LWIPDIR)/apps/snmp/snmp_asn1.c \ + $(LWIPDIR)/apps/snmp/snmp_core.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_icmp.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_interfaces.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_ip.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_snmp.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_system.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_tcp.c \ + $(LWIPDIR)/apps/snmp/snmp_mib2_udp.c \ + $(LWIPDIR)/apps/snmp/snmp_msg.c \ + $(LWIPDIR)/apps/snmp/snmpv3.c \ + $(LWIPDIR)/apps/snmp/snmp_netconn.c \ + $(LWIPDIR)/apps/snmp/snmp_pbuf_stream.c \ + $(LWIPDIR)/apps/snmp/snmp_raw.c \ + $(LWIPDIR)/apps/snmp/snmp_scalar.c \ + $(LWIPDIR)/apps/snmp/snmp_table.c \ + $(LWIPDIR)/apps/snmp/snmp_threadsync.c \ + $(LWIPDIR)/apps/snmp/snmp_traps.c \ + $(LWIPDIR)/apps/snmp/snmpv3_mbedtls.c \ + $(LWIPDIR)/apps/snmp/snmpv3_dummy.c + +# HTTPDFILES: HTTP server +HTTPDFILES=$(LWIPDIR)/apps/httpd/fs.c \ + $(LWIPDIR)/apps/httpd/httpd.c + +# LWIPERFFILES: IPERF server +LWIPERFFILES=$(LWIPDIR)/apps/lwiperf/lwiperf.c + +# SNTPFILES: SNTP client +SNTPFILES=$(LWIPDIR)/apps/sntp/sntp.c + +# MDNSFILES: MDNS responder +MDNSFILES=$(LWIPDIR)/apps/mdns/mdns.c + +# NETBIOSNSFILES: NetBIOS name server +NETBIOSNSFILES=$(LWIPDIR)/apps/netbiosns/netbiosns.c + +# TFTPFILES: TFTP server files +TFTPFILES=$(LWIPDIR)/apps/tftp/tftp_server.c + +# MQTTFILES: MQTT client files +MQTTFILES=$(LWIPDIR)/apps/mqtt/mqtt.c + +# LWIPAPPFILES: All LWIP APPs +LWIPAPPFILES=$(SNMPFILES) \ + $(HTTPDFILES) \ + $(LWIPERFFILES) \ + $(SNTPFILES) \ + $(MDNSFILES) \ + $(NETBIOSNSFILES) \ + $(TFTPFILES) \ + $(MQTTFILES) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_lib.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_lib.c new file mode 100644 index 0000000..3c1d6a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_lib.c @@ -0,0 +1,1010 @@ +/** + * @file + * Sequential API External module + * + * @defgroup netconn Netconn API + * @ingroup sequential_api + * Thread-safe, to be called from non-TCPIP threads only. + * TX/RX handling based on @ref netbuf (containing @ref pbuf) + * to avoid copying data around. + * + * @defgroup netconn_common Common functions + * @ingroup netconn + * For use with TCP and UDP + * + * @defgroup netconn_tcp TCP only + * @ingroup netconn + * TCP only functions + * + * @defgroup netconn_udp UDP only + * @ingroup netconn + * UDP only functions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + */ + +/* This is the part of the API that is linked with + the application */ + +#include "lwip/opt.h" + +#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/api.h" +#include "lwip/memp.h" + +#include "lwip/ip.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/priv/api_msg.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/priv/tcpip_priv.h" + +#include + +#define API_MSG_VAR_REF(name) API_VAR_REF(name) +#define API_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct api_msg, name) +#define API_MSG_VAR_ALLOC(name) API_VAR_ALLOC(struct api_msg, MEMP_API_MSG, name, ERR_MEM) +#define API_MSG_VAR_ALLOC_RETURN_NULL(name) API_VAR_ALLOC(struct api_msg, MEMP_API_MSG, name, NULL) +#define API_MSG_VAR_FREE(name) API_VAR_FREE(MEMP_API_MSG, name) + +static err_t netconn_close_shutdown(struct netconn *conn, u8_t how); + +/** + * Call the lower part of a netconn_* function + * This function is then running in the thread context + * of tcpip_thread and has exclusive access to lwIP core code. + * + * @param fn function to call + * @param apimsg a struct containing the function to call and its parameters + * @return ERR_OK if the function was called, another err_t if not + */ +static err_t +netconn_apimsg(tcpip_callback_fn fn, struct api_msg *apimsg) +{ + err_t err; + +#ifdef LWIP_DEBUG + /* catch functions that don't set err */ + apimsg->err = ERR_VAL; +#endif /* LWIP_DEBUG */ + +#if LWIP_NETCONN_SEM_PER_THREAD + apimsg->op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET(); +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + err = tcpip_send_msg_wait_sem(fn, apimsg, LWIP_API_MSG_SEM(apimsg)); + if (err == ERR_OK) { + return apimsg->err; + } + return err; +} + +/** + * Create a new netconn (of a specific type) that has a callback function. + * The corresponding pcb is also created. + * + * @param t the type of 'connection' to create (@see enum netconn_type) + * @param proto the IP protocol for RAW IP pcbs + * @param callback a function to call on status changes (RX available, TX'ed) + * @return a newly allocated struct netconn or + * NULL on memory error + */ +struct netconn* +netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_callback callback) +{ + struct netconn *conn; + API_MSG_VAR_DECLARE(msg); + API_MSG_VAR_ALLOC_RETURN_NULL(msg); + + conn = netconn_alloc(t, callback); + if (conn != NULL) { + err_t err; + + API_MSG_VAR_REF(msg).msg.n.proto = proto; + API_MSG_VAR_REF(msg).conn = conn; + err = netconn_apimsg(lwip_netconn_do_newconn, &API_MSG_VAR_REF(msg)); + if (err != ERR_OK) { + LWIP_ASSERT("freeing conn without freeing pcb", conn->pcb.tcp == NULL); + LWIP_ASSERT("conn has no recvmbox", sys_mbox_valid(&conn->recvmbox)); +#if LWIP_TCP + LWIP_ASSERT("conn->acceptmbox shouldn't exist", !sys_mbox_valid(&conn->acceptmbox)); +#endif /* LWIP_TCP */ +#if !LWIP_NETCONN_SEM_PER_THREAD + LWIP_ASSERT("conn has no op_completed", sys_sem_valid(&conn->op_completed)); + sys_sem_free(&conn->op_completed); +#endif /* !LWIP_NETCONN_SEM_PER_THREAD */ + sys_mbox_free(&conn->recvmbox); + memp_free(MEMP_NETCONN, conn); + API_MSG_VAR_FREE(msg); + return NULL; + } + } + API_MSG_VAR_FREE(msg); + return conn; +} + +/** + * @ingroup netconn_common + * Close a netconn 'connection' and free its resources. + * UDP and RAW connection are completely closed, TCP pcbs might still be in a waitstate + * after this returns. + * + * @param conn the netconn to delete + * @return ERR_OK if the connection was deleted + */ +err_t +netconn_delete(struct netconn *conn) +{ + err_t err; + API_MSG_VAR_DECLARE(msg); + + /* No ASSERT here because possible to get a (conn == NULL) if we got an accept error */ + if (conn == NULL) { + return ERR_OK; + } + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; +#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER + /* get the time we started, which is later compared to + sys_now() + conn->send_timeout */ + API_MSG_VAR_REF(msg).msg.sd.time_started = sys_now(); +#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ +#if LWIP_TCP + API_MSG_VAR_REF(msg).msg.sd.polls_left = + ((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1; +#endif /* LWIP_TCP */ +#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + err = netconn_apimsg(lwip_netconn_do_delconn, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + if (err != ERR_OK) { + return err; + } + + netconn_free(conn); + + return ERR_OK; +} + +/** + * Get the local or remote IP address and port of a netconn. + * For RAW netconns, this returns the protocol instead of a port! + * + * @param conn the netconn to query + * @param addr a pointer to which to save the IP address + * @param port a pointer to which to save the port (or protocol for RAW) + * @param local 1 to get the local IP address, 0 to get the remote one + * @return ERR_CONN for invalid connections + * ERR_OK if the information was retrieved + */ +err_t +netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_getaddr: invalid conn", (conn != NULL), return ERR_ARG;); + LWIP_ERROR("netconn_getaddr: invalid addr", (addr != NULL), return ERR_ARG;); + LWIP_ERROR("netconn_getaddr: invalid port", (port != NULL), return ERR_ARG;); + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.ad.local = local; +#if LWIP_MPU_COMPATIBLE + err = netconn_apimsg(lwip_netconn_do_getaddr, &API_MSG_VAR_REF(msg)); + *addr = msg->msg.ad.ipaddr; + *port = msg->msg.ad.port; +#else /* LWIP_MPU_COMPATIBLE */ + msg.msg.ad.ipaddr = addr; + msg.msg.ad.port = port; + err = netconn_apimsg(lwip_netconn_do_getaddr, &msg); +#endif /* LWIP_MPU_COMPATIBLE */ + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_common + * Bind a netconn to a specific local IP address and port. + * Binding one netconn twice might not always be checked correctly! + * + * @param conn the netconn to bind + * @param addr the local IP address to bind the netconn to + * (use IP4_ADDR_ANY/IP6_ADDR_ANY to bind to all addresses) + * @param port the local port to bind the netconn to (not used for RAW) + * @return ERR_OK if bound, any other err_t on failure + */ +err_t +netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;); + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ + if (addr == NULL) { + addr = IP4_ADDR_ANY; + } +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV4 && LWIP_IPV6 + /* "Socket API like" dual-stack support: If IP to bind to is IP6_ADDR_ANY, + * and NETCONN_FLAG_IPV6_V6ONLY is 0, use IP_ANY_TYPE to bind + */ + if ((netconn_get_ipv6only(conn) == 0) && + ip_addr_cmp(addr, IP6_ADDR_ANY)) { + addr = IP_ANY_TYPE; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.bc.ipaddr = API_MSG_VAR_REF(addr); + API_MSG_VAR_REF(msg).msg.bc.port = port; + err = netconn_apimsg(lwip_netconn_do_bind, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_common + * Connect a netconn to a specific remote IP address and port. + * + * @param conn the netconn to connect + * @param addr the remote IP address to connect to + * @param port the remote port to connect to (no used for RAW) + * @return ERR_OK if connected, return value of tcp_/udp_/raw_connect otherwise + */ +err_t +netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;); + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ + if (addr == NULL) { + addr = IP4_ADDR_ANY; + } +#endif /* LWIP_IPV4 */ + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.bc.ipaddr = API_MSG_VAR_REF(addr); + API_MSG_VAR_REF(msg).msg.bc.port = port; + err = netconn_apimsg(lwip_netconn_do_connect, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_udp + * Disconnect a netconn from its current peer (only valid for UDP netconns). + * + * @param conn the netconn to disconnect + * @return See @ref err_t + */ +err_t +netconn_disconnect(struct netconn *conn) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;); + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; + err = netconn_apimsg(lwip_netconn_do_disconnect, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_tcp + * Set a TCP netconn into listen mode + * + * @param conn the tcp netconn to set to listen mode + * @param backlog the listen backlog, only used if TCP_LISTEN_BACKLOG==1 + * @return ERR_OK if the netconn was set to listen (UDP and RAW netconns + * don't return any error (yet?)) + */ +err_t +netconn_listen_with_backlog(struct netconn *conn, u8_t backlog) +{ +#if LWIP_TCP + API_MSG_VAR_DECLARE(msg); + err_t err; + + /* This does no harm. If TCP_LISTEN_BACKLOG is off, backlog is unused. */ + LWIP_UNUSED_ARG(backlog); + + LWIP_ERROR("netconn_listen: invalid conn", (conn != NULL), return ERR_ARG;); + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_REF(msg).msg.lb.backlog = backlog; +#endif /* TCP_LISTEN_BACKLOG */ + err = netconn_apimsg(lwip_netconn_do_listen, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +#else /* LWIP_TCP */ + LWIP_UNUSED_ARG(conn); + LWIP_UNUSED_ARG(backlog); + return ERR_ARG; +#endif /* LWIP_TCP */ +} + +/** + * @ingroup netconn_tcp + * Accept a new connection on a TCP listening netconn. + * + * @param conn the TCP listen netconn + * @param new_conn pointer where the new connection is stored + * @return ERR_OK if a new connection has been received or an error + * code otherwise + */ +err_t +netconn_accept(struct netconn *conn, struct netconn **new_conn) +{ +#if LWIP_TCP + void *accept_ptr; + struct netconn *newconn; +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_DECLARE(msg); +#endif /* TCP_LISTEN_BACKLOG */ + + LWIP_ERROR("netconn_accept: invalid pointer", (new_conn != NULL), return ERR_ARG;); + *new_conn = NULL; + LWIP_ERROR("netconn_accept: invalid conn", (conn != NULL), return ERR_ARG;); + + if (ERR_IS_FATAL(conn->last_err)) { + /* don't recv on fatal errors: this might block the application task + waiting on acceptmbox forever! */ + return conn->last_err; + } + if (!sys_mbox_valid(&conn->acceptmbox)) { + return ERR_CLSD; + } + +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_ALLOC(msg); +#endif /* TCP_LISTEN_BACKLOG */ + +#if LWIP_SO_RCVTIMEO + if (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, conn->recv_timeout) == SYS_ARCH_TIMEOUT) { +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_FREE(msg); +#endif /* TCP_LISTEN_BACKLOG */ + return ERR_TIMEOUT; + } +#else + sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); +#endif /* LWIP_SO_RCVTIMEO*/ + newconn = (struct netconn *)accept_ptr; + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0); + + if (accept_ptr == &netconn_aborted) { + /* a connection has been aborted: out of pcbs or out of netconns during accept */ + /* @todo: set netconn error, but this would be fatal and thus block further accepts */ +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_FREE(msg); +#endif /* TCP_LISTEN_BACKLOG */ + return ERR_ABRT; + } + if (newconn == NULL) { + /* connection has been aborted */ + /* in this special case, we set the netconn error from application thread, as + on a ready-to-accept listening netconn, there should not be anything running + in tcpip_thread */ + NETCONN_SET_SAFE_ERR(conn, ERR_CLSD); +#if TCP_LISTEN_BACKLOG + API_MSG_VAR_FREE(msg); +#endif /* TCP_LISTEN_BACKLOG */ + return ERR_CLSD; + } +#if TCP_LISTEN_BACKLOG + /* Let the stack know that we have accepted the connection. */ + API_MSG_VAR_REF(msg).conn = newconn; + /* don't care for the return value of lwip_netconn_do_recv */ + netconn_apimsg(lwip_netconn_do_accepted, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); +#endif /* TCP_LISTEN_BACKLOG */ + + *new_conn = newconn; + /* don't set conn->last_err: it's only ERR_OK, anyway */ + return ERR_OK; +#else /* LWIP_TCP */ + LWIP_UNUSED_ARG(conn); + LWIP_UNUSED_ARG(new_conn); + return ERR_ARG; +#endif /* LWIP_TCP */ +} + +/** + * @ingroup netconn_common + * Receive data: actual implementation that doesn't care whether pbuf or netbuf + * is received + * + * @param conn the netconn from which to receive data + * @param new_buf pointer where a new pbuf/netbuf is stored when received data + * @return ERR_OK if data has been received, an error code otherwise (timeout, + * memory error or another error) + */ +static err_t +netconn_recv_data(struct netconn *conn, void **new_buf) +{ + void *buf = NULL; + u16_t len; +#if LWIP_TCP + API_MSG_VAR_DECLARE(msg); +#if LWIP_MPU_COMPATIBLE + msg = NULL; +#endif +#endif /* LWIP_TCP */ + + LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;); + *new_buf = NULL; + LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;); +#if LWIP_TCP +#if (LWIP_UDP || LWIP_RAW) + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) +#endif /* (LWIP_UDP || LWIP_RAW) */ + { + if (!sys_mbox_valid(&conn->recvmbox)) { + /* This happens when calling this function after receiving FIN */ + return sys_mbox_valid(&conn->acceptmbox) ? ERR_CONN : ERR_CLSD; + } + } +#endif /* LWIP_TCP */ + LWIP_ERROR("netconn_recv: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;); + + if (ERR_IS_FATAL(conn->last_err)) { + /* don't recv on fatal errors: this might block the application task + waiting on recvmbox forever! */ + /* @todo: this does not allow us to fetch data that has been put into recvmbox + before the fatal error occurred - is that a problem? */ + return conn->last_err; + } +#if LWIP_TCP +#if (LWIP_UDP || LWIP_RAW) + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) +#endif /* (LWIP_UDP || LWIP_RAW) */ + { + API_MSG_VAR_ALLOC(msg); + } +#endif /* LWIP_TCP */ + +#if LWIP_SO_RCVTIMEO + if (sys_arch_mbox_fetch(&conn->recvmbox, &buf, conn->recv_timeout) == SYS_ARCH_TIMEOUT) { +#if LWIP_TCP +#if (LWIP_UDP || LWIP_RAW) + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) +#endif /* (LWIP_UDP || LWIP_RAW) */ + { + API_MSG_VAR_FREE(msg); + } +#endif /* LWIP_TCP */ + return ERR_TIMEOUT; + } +#else + sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); +#endif /* LWIP_SO_RCVTIMEO*/ + +#if LWIP_TCP +#if (LWIP_UDP || LWIP_RAW) + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) +#endif /* (LWIP_UDP || LWIP_RAW) */ + { + /* Let the stack know that we have taken the data. */ + /* @todo: Speedup: Don't block and wait for the answer here + (to prevent multiple thread-switches). */ + API_MSG_VAR_REF(msg).conn = conn; + if (buf != NULL) { + API_MSG_VAR_REF(msg).msg.r.len = ((struct pbuf *)buf)->tot_len; + } else { + API_MSG_VAR_REF(msg).msg.r.len = 1; + } + + /* don't care for the return value of lwip_netconn_do_recv */ + netconn_apimsg(lwip_netconn_do_recv, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + /* If we are closed, we indicate that we no longer wish to use the socket */ + if (buf == NULL) { + API_EVENT(conn, NETCONN_EVT_RCVMINUS, 0); + if (conn->pcb.ip == NULL) { + /* race condition: RST during recv */ + return conn->last_err == ERR_OK ? ERR_RST : conn->last_err; + } + /* RX side is closed, so deallocate the recvmbox */ + netconn_close_shutdown(conn, NETCONN_SHUT_RD); + /* Don' store ERR_CLSD as conn->err since we are only half-closed */ + return ERR_CLSD; + } + len = ((struct pbuf *)buf)->tot_len; + } +#endif /* LWIP_TCP */ +#if LWIP_TCP && (LWIP_UDP || LWIP_RAW) + else +#endif /* LWIP_TCP && (LWIP_UDP || LWIP_RAW) */ +#if (LWIP_UDP || LWIP_RAW) + { + LWIP_ASSERT("buf != NULL", buf != NULL); + len = netbuf_len((struct netbuf*)buf); + } +#endif /* (LWIP_UDP || LWIP_RAW) */ + +#if LWIP_SO_RCVBUF + SYS_ARCH_DEC(conn->recv_avail, len); +#endif /* LWIP_SO_RCVBUF */ + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVMINUS, len); + + LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_recv_data: received %p, len=%"U16_F"\n", buf, len)); + + *new_buf = buf; + /* don't set conn->last_err: it's only ERR_OK, anyway */ + return ERR_OK; +} + +/** + * @ingroup netconn_tcp + * Receive data (in form of a pbuf) from a TCP netconn + * + * @param conn the netconn from which to receive data + * @param new_buf pointer where a new pbuf is stored when received data + * @return ERR_OK if data has been received, an error code otherwise (timeout, + * memory error or another error) + * ERR_ARG if conn is not a TCP netconn + */ +err_t +netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf) +{ + LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL) && + NETCONNTYPE_GROUP(netconn_type(conn)) == NETCONN_TCP, return ERR_ARG;); + + return netconn_recv_data(conn, (void **)new_buf); +} + +/** + * @ingroup netconn_common + * Receive data (in form of a netbuf containing a packet buffer) from a netconn + * + * @param conn the netconn from which to receive data + * @param new_buf pointer where a new netbuf is stored when received data + * @return ERR_OK if data has been received, an error code otherwise (timeout, + * memory error or another error) + */ +err_t +netconn_recv(struct netconn *conn, struct netbuf **new_buf) +{ +#if LWIP_TCP + struct netbuf *buf = NULL; + err_t err; +#endif /* LWIP_TCP */ + + LWIP_ERROR("netconn_recv: invalid pointer", (new_buf != NULL), return ERR_ARG;); + *new_buf = NULL; + LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return ERR_ARG;); + +#if LWIP_TCP +#if (LWIP_UDP || LWIP_RAW) + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) +#endif /* (LWIP_UDP || LWIP_RAW) */ + { + struct pbuf *p = NULL; + /* This is not a listening netconn, since recvmbox is set */ + + buf = (struct netbuf *)memp_malloc(MEMP_NETBUF); + if (buf == NULL) { + return ERR_MEM; + } + + err = netconn_recv_data(conn, (void **)&p); + if (err != ERR_OK) { + memp_free(MEMP_NETBUF, buf); + return err; + } + LWIP_ASSERT("p != NULL", p != NULL); + + buf->p = p; + buf->ptr = p; + buf->port = 0; + ip_addr_set_zero(&buf->addr); + *new_buf = buf; + /* don't set conn->last_err: it's only ERR_OK, anyway */ + return ERR_OK; + } +#endif /* LWIP_TCP */ +#if LWIP_TCP && (LWIP_UDP || LWIP_RAW) + else +#endif /* LWIP_TCP && (LWIP_UDP || LWIP_RAW) */ + { +#if (LWIP_UDP || LWIP_RAW) + return netconn_recv_data(conn, (void **)new_buf); +#endif /* (LWIP_UDP || LWIP_RAW) */ + } +} + +/** + * @ingroup netconn_udp + * Send data (in form of a netbuf) to a specific remote IP address and port. + * Only to be used for UDP and RAW netconns (not TCP). + * + * @param conn the netconn over which to send data + * @param buf a netbuf containing the data to send + * @param addr the remote IP address to which to send the data + * @param port the remote port to which to send the data + * @return ERR_OK if data was sent, any other err_t on error + */ +err_t +netconn_sendto(struct netconn *conn, struct netbuf *buf, const ip_addr_t *addr, u16_t port) +{ + if (buf != NULL) { + ip_addr_set(&buf->addr, addr); + buf->port = port; + return netconn_send(conn, buf); + } + return ERR_VAL; +} + +/** + * @ingroup netconn_udp + * Send data over a UDP or RAW netconn (that is already connected). + * + * @param conn the UDP or RAW netconn over which to send data + * @param buf a netbuf containing the data to send + * @return ERR_OK if data was sent, any other err_t on error + */ +err_t +netconn_send(struct netconn *conn, struct netbuf *buf) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_send: invalid conn", (conn != NULL), return ERR_ARG;); + + LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %"U16_F" bytes\n", buf->p->tot_len)); + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.b = buf; + err = netconn_apimsg(lwip_netconn_do_send, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_tcp + * Send data over a TCP netconn. + * + * @param conn the TCP netconn over which to send data + * @param dataptr pointer to the application buffer that contains the data to send + * @param size size of the application data to send + * @param apiflags combination of following flags : + * - NETCONN_COPY: data will be copied into memory belonging to the stack + * - NETCONN_MORE: for TCP connection, PSH flag will be set on last segment sent + * - NETCONN_DONTBLOCK: only write the data if all data can be written at once + * @param bytes_written pointer to a location that receives the number of written bytes + * @return ERR_OK if data was sent, any other err_t on error + */ +err_t +netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size, + u8_t apiflags, size_t *bytes_written) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + u8_t dontblock; + + LWIP_ERROR("netconn_write: invalid conn", (conn != NULL), return ERR_ARG;); + LWIP_ERROR("netconn_write: invalid conn->type", (NETCONNTYPE_GROUP(conn->type)== NETCONN_TCP), return ERR_VAL;); + if (size == 0) { + return ERR_OK; + } + dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK); +#if LWIP_SO_SNDTIMEO + if (conn->send_timeout != 0) { + dontblock = 1; + } +#endif /* LWIP_SO_SNDTIMEO */ + if (dontblock && !bytes_written) { + /* This implies netconn_write() cannot be used for non-blocking send, since + it has no way to return the number of bytes written. */ + return ERR_VAL; + } + + API_MSG_VAR_ALLOC(msg); + /* non-blocking write sends as much */ + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.w.dataptr = dataptr; + API_MSG_VAR_REF(msg).msg.w.apiflags = apiflags; + API_MSG_VAR_REF(msg).msg.w.len = size; +#if LWIP_SO_SNDTIMEO + if (conn->send_timeout != 0) { + /* get the time we started, which is later compared to + sys_now() + conn->send_timeout */ + API_MSG_VAR_REF(msg).msg.w.time_started = sys_now(); + } else { + API_MSG_VAR_REF(msg).msg.w.time_started = 0; + } +#endif /* LWIP_SO_SNDTIMEO */ + + /* For locking the core: this _can_ be delayed on low memory/low send buffer, + but if it is, this is done inside api_msg.c:do_write(), so we can use the + non-blocking version here. */ + err = netconn_apimsg(lwip_netconn_do_write, &API_MSG_VAR_REF(msg)); + if ((err == ERR_OK) && (bytes_written != NULL)) { + if (dontblock) { + /* nonblocking write: maybe the data has been sent partly */ + *bytes_written = API_MSG_VAR_REF(msg).msg.w.len; + } else { + /* blocking call succeeded: all data has been sent if it */ + *bytes_written = size; + } + } + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_tcp + * Close or shutdown a TCP netconn (doesn't delete it). + * + * @param conn the TCP netconn to close or shutdown + * @param how fully close or only shutdown one side? + * @return ERR_OK if the netconn was closed, any other err_t on error + */ +static err_t +netconn_close_shutdown(struct netconn *conn, u8_t how) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + LWIP_UNUSED_ARG(how); + + LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;); + + API_MSG_VAR_ALLOC(msg); + API_MSG_VAR_REF(msg).conn = conn; +#if LWIP_TCP + /* shutting down both ends is the same as closing */ + API_MSG_VAR_REF(msg).msg.sd.shut = how; +#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER + /* get the time we started, which is later compared to + sys_now() + conn->send_timeout */ + API_MSG_VAR_REF(msg).msg.sd.time_started = sys_now(); +#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + API_MSG_VAR_REF(msg).msg.sd.polls_left = + ((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1; +#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ +#endif /* LWIP_TCP */ + err = netconn_apimsg(lwip_netconn_do_close, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} + +/** + * @ingroup netconn_tcp + * Close a TCP netconn (doesn't delete it). + * + * @param conn the TCP netconn to close + * @return ERR_OK if the netconn was closed, any other err_t on error + */ +err_t +netconn_close(struct netconn *conn) +{ + /* shutting down both ends is the same as closing */ + return netconn_close_shutdown(conn, NETCONN_SHUT_RDWR); +} + +/** + * @ingroup netconn_tcp + * Shut down one or both sides of a TCP netconn (doesn't delete it). + * + * @param conn the TCP netconn to shut down + * @param shut_rx shut down the RX side (no more read possible after this) + * @param shut_tx shut down the TX side (no more write possible after this) + * @return ERR_OK if the netconn was closed, any other err_t on error + */ +err_t +netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx) +{ + return netconn_close_shutdown(conn, (shut_rx ? NETCONN_SHUT_RD : 0) | (shut_tx ? NETCONN_SHUT_WR : 0)); +} + +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) +/** + * @ingroup netconn_udp + * Join multicast groups for UDP netconns. + * + * @param conn the UDP netconn for which to change multicast addresses + * @param multiaddr IP address of the multicast group to join or leave + * @param netif_addr the IP address of the network interface on which to send + * the igmp message + * @param join_or_leave flag whether to send a join- or leave-message + * @return ERR_OK if the action was taken, any err_t on error + */ +err_t +netconn_join_leave_group(struct netconn *conn, + const ip_addr_t *multiaddr, + const ip_addr_t *netif_addr, + enum netconn_igmp join_or_leave) +{ + API_MSG_VAR_DECLARE(msg); + err_t err; + + LWIP_ERROR("netconn_join_leave_group: invalid conn", (conn != NULL), return ERR_ARG;); + + API_MSG_VAR_ALLOC(msg); + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IP_ADDR_ANY alias) to subsequent functions */ + if (multiaddr == NULL) { + multiaddr = IP4_ADDR_ANY; + } + if (netif_addr == NULL) { + netif_addr = IP4_ADDR_ANY; + } +#endif /* LWIP_IPV4 */ + + API_MSG_VAR_REF(msg).conn = conn; + API_MSG_VAR_REF(msg).msg.jl.multiaddr = API_MSG_VAR_REF(multiaddr); + API_MSG_VAR_REF(msg).msg.jl.netif_addr = API_MSG_VAR_REF(netif_addr); + API_MSG_VAR_REF(msg).msg.jl.join_or_leave = join_or_leave; + err = netconn_apimsg(lwip_netconn_do_join_leave_group, &API_MSG_VAR_REF(msg)); + API_MSG_VAR_FREE(msg); + + return err; +} +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ + +#if LWIP_DNS +/** + * @ingroup netconn_common + * Execute a DNS query, only one IP address is returned + * + * @param name a string representation of the DNS host name to query + * @param addr a preallocated ip_addr_t where to store the resolved IP address + * @param dns_addrtype IP address type (IPv4 / IPv6) + * @return ERR_OK: resolving succeeded + * ERR_MEM: memory error, try again later + * ERR_ARG: dns client not initialized or invalid hostname + * ERR_VAL: dns server response was invalid + */ +#if LWIP_IPV4 && LWIP_IPV6 +err_t +netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype) +#else +err_t +netconn_gethostbyname(const char *name, ip_addr_t *addr) +#endif +{ + API_VAR_DECLARE(struct dns_api_msg, msg); +#if !LWIP_MPU_COMPATIBLE + sys_sem_t sem; +#endif /* LWIP_MPU_COMPATIBLE */ + err_t err; + err_t cberr; + + LWIP_ERROR("netconn_gethostbyname: invalid name", (name != NULL), return ERR_ARG;); + LWIP_ERROR("netconn_gethostbyname: invalid addr", (addr != NULL), return ERR_ARG;); +#if LWIP_MPU_COMPATIBLE + if (strlen(name) >= DNS_MAX_NAME_LENGTH) { + return ERR_ARG; + } +#endif + + API_VAR_ALLOC(struct dns_api_msg, MEMP_DNS_API_MSG, msg, ERR_MEM); +#if LWIP_MPU_COMPATIBLE + strncpy(API_VAR_REF(msg).name, name, DNS_MAX_NAME_LENGTH-1); + API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH-1] = 0; +#else /* LWIP_MPU_COMPATIBLE */ + msg.err = &err; + msg.sem = &sem; + API_VAR_REF(msg).addr = API_VAR_REF(addr); + API_VAR_REF(msg).name = name; +#endif /* LWIP_MPU_COMPATIBLE */ +#if LWIP_IPV4 && LWIP_IPV6 + API_VAR_REF(msg).dns_addrtype = dns_addrtype; +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_NETCONN_SEM_PER_THREAD + API_VAR_REF(msg).sem = LWIP_NETCONN_THREAD_SEM_GET(); +#else /* LWIP_NETCONN_SEM_PER_THREAD*/ + err = sys_sem_new(API_EXPR_REF(API_VAR_REF(msg).sem), 0); + if (err != ERR_OK) { + API_VAR_FREE(MEMP_DNS_API_MSG, msg); + return err; + } +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + cberr = tcpip_callback(lwip_netconn_do_gethostbyname, &API_VAR_REF(msg)); + if (cberr != ERR_OK) { +#if !LWIP_NETCONN_SEM_PER_THREAD + sys_sem_free(API_EXPR_REF(API_VAR_REF(msg).sem)); +#endif /* !LWIP_NETCONN_SEM_PER_THREAD */ + API_VAR_FREE(MEMP_DNS_API_MSG, msg); + return cberr; + } + sys_sem_wait(API_EXPR_REF_SEM(API_VAR_REF(msg).sem)); +#if !LWIP_NETCONN_SEM_PER_THREAD + sys_sem_free(API_EXPR_REF(API_VAR_REF(msg).sem)); +#endif /* !LWIP_NETCONN_SEM_PER_THREAD */ + +#if LWIP_MPU_COMPATIBLE + *addr = msg->addr; + err = msg->err; +#endif /* LWIP_MPU_COMPATIBLE */ + + API_VAR_FREE(MEMP_DNS_API_MSG, msg); + return err; +} +#endif /* LWIP_DNS*/ + +#if LWIP_NETCONN_SEM_PER_THREAD +void +netconn_thread_init(void) +{ + sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET(); + if ((sem == NULL) || !sys_sem_valid(sem)) { + /* call alloc only once */ + LWIP_NETCONN_THREAD_SEM_ALLOC(); + LWIP_ASSERT("LWIP_NETCONN_THREAD_SEM_ALLOC() failed", sys_sem_valid(LWIP_NETCONN_THREAD_SEM_GET())); + } +} + +void +netconn_thread_cleanup(void) +{ + sys_sem_t *sem = LWIP_NETCONN_THREAD_SEM_GET(); + if ((sem != NULL) && sys_sem_valid(sem)) { + /* call free only once */ + LWIP_NETCONN_THREAD_SEM_FREE(); + } +} +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + +#endif /* LWIP_NETCONN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_msg.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_msg.c new file mode 100644 index 0000000..dd99c1e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/api_msg.c @@ -0,0 +1,1947 @@ +/** + * @file + * Sequential API Internal module + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/priv/api_msg.h" + +#include "lwip/ip.h" +#include "lwip/ip_addr.h" +#include "lwip/udp.h" +#include "lwip/tcp.h" +#include "lwip/raw.h" + +#include "lwip/memp.h" +#include "lwip/igmp.h" +#include "lwip/dns.h" +#include "lwip/mld6.h" +#include "lwip/priv/tcpip_priv.h" + +#include + +/* netconns are polled once per second (e.g. continue write on memory error) */ +#define NETCONN_TCP_POLL_INTERVAL 2 + +#define SET_NONBLOCKING_CONNECT(conn, val) do { if (val) { \ + (conn)->flags |= NETCONN_FLAG_IN_NONBLOCKING_CONNECT; \ +} else { \ + (conn)->flags &= ~ NETCONN_FLAG_IN_NONBLOCKING_CONNECT; }} while(0) +#define IN_NONBLOCKING_CONNECT(conn) (((conn)->flags & NETCONN_FLAG_IN_NONBLOCKING_CONNECT) != 0) + +/* forward declarations */ +#if LWIP_TCP +#if LWIP_TCPIP_CORE_LOCKING +#define WRITE_DELAYED , 1 +#define WRITE_DELAYED_PARAM , u8_t delayed +#else /* LWIP_TCPIP_CORE_LOCKING */ +#define WRITE_DELAYED +#define WRITE_DELAYED_PARAM +#endif /* LWIP_TCPIP_CORE_LOCKING */ +static err_t lwip_netconn_do_writemore(struct netconn *conn WRITE_DELAYED_PARAM); +static err_t lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM); +#endif + +#if LWIP_TCPIP_CORE_LOCKING +#define TCPIP_APIMSG_ACK(m) NETCONN_SET_SAFE_ERR((m)->conn, (m)->err) +#else /* LWIP_TCPIP_CORE_LOCKING */ +#define TCPIP_APIMSG_ACK(m) do { NETCONN_SET_SAFE_ERR((m)->conn, (m)->err); sys_sem_signal(LWIP_API_MSG_SEM(m)); } while(0) +#endif /* LWIP_TCPIP_CORE_LOCKING */ + +#if LWIP_TCP +u8_t netconn_aborted; +#endif /* LWIP_TCP */ + +#if LWIP_RAW +/** + * Receive callback function for RAW netconns. + * Doesn't 'eat' the packet, only copies it and sends it to + * conn->recvmbox + * + * @see raw.h (struct raw_pcb.recv) for parameters and return value + */ +static u8_t +recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr) +{ + struct pbuf *q; + struct netbuf *buf; + struct netconn *conn; + + LWIP_UNUSED_ARG(addr); + conn = (struct netconn *)arg; + + if ((conn != NULL) && sys_mbox_valid(&conn->recvmbox)) { +#if LWIP_SO_RCVBUF + int recv_avail; + SYS_ARCH_GET(conn->recv_avail, recv_avail); + if ((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize) { + return 0; + } +#endif /* LWIP_SO_RCVBUF */ + /* copy the whole packet into new pbufs */ + q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); + if (q != NULL) { + if (pbuf_copy(q, p) != ERR_OK) { + pbuf_free(q); + q = NULL; + } + } + + if (q != NULL) { + u16_t len; + buf = (struct netbuf *)memp_malloc(MEMP_NETBUF); + if (buf == NULL) { + pbuf_free(q); + return 0; + } + + buf->p = q; + buf->ptr = q; + ip_addr_copy(buf->addr, *ip_current_src_addr()); + buf->port = pcb->protocol; + + len = q->tot_len; + if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) { + netbuf_delete(buf); + return 0; + } else { +#if LWIP_SO_RCVBUF + SYS_ARCH_INC(conn->recv_avail, len); +#endif /* LWIP_SO_RCVBUF */ + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, len); + } + } + } + + return 0; /* do not eat the packet */ +} +#endif /* LWIP_RAW*/ + +#if LWIP_UDP +/** + * Receive callback function for UDP netconns. + * Posts the packet to conn->recvmbox or deletes it on memory error. + * + * @see udp.h (struct udp_pcb.recv) for parameters + */ +static void +recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr, u16_t port) +{ + struct netbuf *buf; + struct netconn *conn; + u16_t len; +#if LWIP_SO_RCVBUF + int recv_avail; +#endif /* LWIP_SO_RCVBUF */ + + LWIP_UNUSED_ARG(pcb); /* only used for asserts... */ + LWIP_ASSERT("recv_udp must have a pcb argument", pcb != NULL); + LWIP_ASSERT("recv_udp must have an argument", arg != NULL); + conn = (struct netconn *)arg; + LWIP_ASSERT("recv_udp: recv for wrong pcb!", conn->pcb.udp == pcb); + +#if LWIP_SO_RCVBUF + SYS_ARCH_GET(conn->recv_avail, recv_avail); + if ((conn == NULL) || !sys_mbox_valid(&conn->recvmbox) || + ((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize)) { +#else /* LWIP_SO_RCVBUF */ + if ((conn == NULL) || !sys_mbox_valid(&conn->recvmbox)) { +#endif /* LWIP_SO_RCVBUF */ + pbuf_free(p); + return; + } + + buf = (struct netbuf *)memp_malloc(MEMP_NETBUF); + if (buf == NULL) { + pbuf_free(p); + return; + } else { + buf->p = p; + buf->ptr = p; + ip_addr_set(&buf->addr, addr); + buf->port = port; +#if LWIP_NETBUF_RECVINFO + { + /* get the UDP header - always in the first pbuf, ensured by udp_input */ + const struct udp_hdr* udphdr = (const struct udp_hdr*)ip_next_header_ptr(); +#if LWIP_CHECKSUM_ON_COPY + buf->flags = NETBUF_FLAG_DESTADDR; +#endif /* LWIP_CHECKSUM_ON_COPY */ + ip_addr_set(&buf->toaddr, ip_current_dest_addr()); + buf->toport_chksum = udphdr->dest; + } +#endif /* LWIP_NETBUF_RECVINFO */ + } + + len = p->tot_len; + if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) { + netbuf_delete(buf); + return; + } else { +#if LWIP_SO_RCVBUF + SYS_ARCH_INC(conn->recv_avail, len); +#endif /* LWIP_SO_RCVBUF */ + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, len); + } +} +#endif /* LWIP_UDP */ + +#if LWIP_TCP +/** + * Receive callback function for TCP netconns. + * Posts the packet to conn->recvmbox, but doesn't delete it on errors. + * + * @see tcp.h (struct tcp_pcb.recv) for parameters and return value + */ +static err_t +recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + struct netconn *conn; + u16_t len; + + LWIP_UNUSED_ARG(pcb); + LWIP_ASSERT("recv_tcp must have a pcb argument", pcb != NULL); + LWIP_ASSERT("recv_tcp must have an argument", arg != NULL); + conn = (struct netconn *)arg; + + if (conn == NULL) { + return ERR_VAL; + } + LWIP_ASSERT("recv_tcp: recv for wrong pcb!", conn->pcb.tcp == pcb); + + if (!sys_mbox_valid(&conn->recvmbox)) { + /* recvmbox already deleted */ + if (p != NULL) { + tcp_recved(pcb, p->tot_len); + pbuf_free(p); + } + return ERR_OK; + } + /* Unlike for UDP or RAW pcbs, don't check for available space + using recv_avail since that could break the connection + (data is already ACKed) */ + + /* don't overwrite fatal errors! */ + if (err != ERR_OK) { + NETCONN_SET_SAFE_ERR(conn, err); + } + + if (p != NULL) { + len = p->tot_len; + } else { + len = 0; + } + + if (sys_mbox_trypost(&conn->recvmbox, p) != ERR_OK) { + /* don't deallocate p: it is presented to us later again from tcp_fasttmr! */ + return ERR_MEM; + } else { +#if LWIP_SO_RCVBUF + SYS_ARCH_INC(conn->recv_avail, len); +#endif /* LWIP_SO_RCVBUF */ + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, len); + } + + return ERR_OK; +} + +/** + * Poll callback function for TCP netconns. + * Wakes up an application thread that waits for a connection to close + * or data to be sent. The application thread then takes the + * appropriate action to go on. + * + * Signals the conn->sem. + * netconn_close waits for conn->sem if closing failed. + * + * @see tcp.h (struct tcp_pcb.poll) for parameters and return value + */ +static err_t +poll_tcp(void *arg, struct tcp_pcb *pcb) +{ + struct netconn *conn = (struct netconn *)arg; + + LWIP_UNUSED_ARG(pcb); + LWIP_ASSERT("conn != NULL", (conn != NULL)); + + if (conn->state == NETCONN_WRITE) { + lwip_netconn_do_writemore(conn WRITE_DELAYED); + } else if (conn->state == NETCONN_CLOSE) { +#if !LWIP_SO_SNDTIMEO && !LWIP_SO_LINGER + if (conn->current_msg && conn->current_msg->msg.sd.polls_left) { + conn->current_msg->msg.sd.polls_left--; + } +#endif /* !LWIP_SO_SNDTIMEO && !LWIP_SO_LINGER */ + lwip_netconn_do_close_internal(conn WRITE_DELAYED); + } + /* @todo: implement connect timeout here? */ + + /* Did a nonblocking write fail before? Then check available write-space. */ + if (conn->flags & NETCONN_FLAG_CHECK_WRITESPACE) { + /* If the queued byte- or pbuf-count drops below the configured low-water limit, + let select mark this pcb as writable again. */ + if ((conn->pcb.tcp != NULL) && (tcp_sndbuf(conn->pcb.tcp) > TCP_SNDLOWAT) && + (tcp_sndqueuelen(conn->pcb.tcp) < TCP_SNDQUEUELOWAT)) { + conn->flags &= ~NETCONN_FLAG_CHECK_WRITESPACE; + API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0); + } + } + + return ERR_OK; +} + +/** + * Sent callback function for TCP netconns. + * Signals the conn->sem and calls API_EVENT. + * netconn_write waits for conn->sem if send buffer is low. + * + * @see tcp.h (struct tcp_pcb.sent) for parameters and return value + */ +static err_t +sent_tcp(void *arg, struct tcp_pcb *pcb, u16_t len) +{ + struct netconn *conn = (struct netconn *)arg; + + LWIP_UNUSED_ARG(pcb); + LWIP_ASSERT("conn != NULL", (conn != NULL)); + + if (conn) { + if (conn->state == NETCONN_WRITE) { + lwip_netconn_do_writemore(conn WRITE_DELAYED); + } else if (conn->state == NETCONN_CLOSE) { + lwip_netconn_do_close_internal(conn WRITE_DELAYED); + } + + /* If the queued byte- or pbuf-count drops below the configured low-water limit, + let select mark this pcb as writable again. */ + if ((conn->pcb.tcp != NULL) && (tcp_sndbuf(conn->pcb.tcp) > TCP_SNDLOWAT) && + (tcp_sndqueuelen(conn->pcb.tcp) < TCP_SNDQUEUELOWAT)) { + conn->flags &= ~NETCONN_FLAG_CHECK_WRITESPACE; + API_EVENT(conn, NETCONN_EVT_SENDPLUS, len); + } + } + + return ERR_OK; +} + +/** + * Error callback function for TCP netconns. + * Signals conn->sem, posts to all conn mboxes and calls API_EVENT. + * The application thread has then to decide what to do. + * + * @see tcp.h (struct tcp_pcb.err) for parameters + */ +static void +err_tcp(void *arg, err_t err) +{ + struct netconn *conn; + enum netconn_state old_state; + + conn = (struct netconn *)arg; + LWIP_ASSERT("conn != NULL", (conn != NULL)); + + conn->pcb.tcp = NULL; + + /* reset conn->state now before waking up other threads */ + old_state = conn->state; + conn->state = NETCONN_NONE; + + if (old_state == NETCONN_CLOSE) { + /* RST during close: let close return success & dealloc the netconn */ + err = ERR_OK; + NETCONN_SET_SAFE_ERR(conn, ERR_OK); + } else { + /* no check since this is always fatal! */ + SYS_ARCH_SET(conn->last_err, err); + } + + /* @todo: the type of NETCONN_EVT created should depend on 'old_state' */ + + /* Notify the user layer about a connection error. Used to signal select. */ + API_EVENT(conn, NETCONN_EVT_ERROR, 0); + /* Try to release selects pending on 'read' or 'write', too. + They will get an error if they actually try to read or write. */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0); + API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0); + + /* pass NULL-message to recvmbox to wake up pending recv */ + if (sys_mbox_valid(&conn->recvmbox)) { + /* use trypost to prevent deadlock */ + sys_mbox_trypost(&conn->recvmbox, NULL); + } + /* pass NULL-message to acceptmbox to wake up pending accept */ + if (sys_mbox_valid(&conn->acceptmbox)) { + /* use trypost to preven deadlock */ + sys_mbox_trypost(&conn->acceptmbox, NULL); + } + + if ((old_state == NETCONN_WRITE) || (old_state == NETCONN_CLOSE) || + (old_state == NETCONN_CONNECT)) { + /* calling lwip_netconn_do_writemore/lwip_netconn_do_close_internal is not necessary + since the pcb has already been deleted! */ + int was_nonblocking_connect = IN_NONBLOCKING_CONNECT(conn); + SET_NONBLOCKING_CONNECT(conn, 0); + + if (!was_nonblocking_connect) { + sys_sem_t* op_completed_sem; + /* set error return code */ + LWIP_ASSERT("conn->current_msg != NULL", conn->current_msg != NULL); + conn->current_msg->err = err; + op_completed_sem = LWIP_API_MSG_SEM(conn->current_msg); + LWIP_ASSERT("inavlid op_completed_sem", sys_sem_valid(op_completed_sem)); + conn->current_msg = NULL; + /* wake up the waiting task */ + NETCONN_SET_SAFE_ERR(conn, err); + sys_sem_signal(op_completed_sem); + } + } else { + LWIP_ASSERT("conn->current_msg == NULL", conn->current_msg == NULL); + } +} + +/** + * Setup a tcp_pcb with the correct callback function pointers + * and their arguments. + * + * @param conn the TCP netconn to setup + */ +static void +setup_tcp(struct netconn *conn) +{ + struct tcp_pcb *pcb; + + pcb = conn->pcb.tcp; + tcp_arg(pcb, conn); + tcp_recv(pcb, recv_tcp); + tcp_sent(pcb, sent_tcp); + tcp_poll(pcb, poll_tcp, NETCONN_TCP_POLL_INTERVAL); + tcp_err(pcb, err_tcp); +} + +/** + * Accept callback function for TCP netconns. + * Allocates a new netconn and posts that to conn->acceptmbox. + * + * @see tcp.h (struct tcp_pcb_listen.accept) for parameters and return value + */ +static err_t +accept_function(void *arg, struct tcp_pcb *newpcb, err_t err) +{ + struct netconn *newconn; + struct netconn *conn = (struct netconn *)arg; + + LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: newpcb->tate: %s\n", tcp_debug_state_str(newpcb->state))); + + if (conn == NULL) { + return ERR_VAL; + } + if (!sys_mbox_valid(&conn->acceptmbox)) { + LWIP_DEBUGF(API_MSG_DEBUG, ("accept_function: acceptmbox already deleted\n")); + return ERR_VAL; + } + + if (newpcb == NULL) { + /* out-of-pcbs during connect: pass on this error to the application */ + if (sys_mbox_trypost(&conn->acceptmbox, &netconn_aborted) == ERR_OK) { + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0); + } + return ERR_VAL; + } + + /* We have to set the callback here even though + * the new socket is unknown. newconn->socket is marked as -1. */ + newconn = netconn_alloc(conn->type, conn->callback); + if (newconn == NULL) { + /* outof netconns: pass on this error to the application */ + if (sys_mbox_trypost(&conn->acceptmbox, &netconn_aborted) == ERR_OK) { + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0); + } + return ERR_MEM; + } + newconn->pcb.tcp = newpcb; + setup_tcp(newconn); + /* no protection: when creating the pcb, the netconn is not yet known + to the application thread */ + newconn->last_err = err; + + /* handle backlog counter */ + tcp_backlog_delayed(newpcb); + + if (sys_mbox_trypost(&conn->acceptmbox, newconn) != ERR_OK) { + /* When returning != ERR_OK, the pcb is aborted in tcp_process(), + so do nothing here! */ + /* remove all references to this netconn from the pcb */ + struct tcp_pcb* pcb = newconn->pcb.tcp; + tcp_arg(pcb, NULL); + tcp_recv(pcb, NULL); + tcp_sent(pcb, NULL); + tcp_poll(pcb, NULL, 0); + tcp_err(pcb, NULL); + /* remove reference from to the pcb from this netconn */ + newconn->pcb.tcp = NULL; + /* no need to drain since we know the recvmbox is empty. */ + sys_mbox_free(&newconn->recvmbox); + sys_mbox_set_invalid(&newconn->recvmbox); + netconn_free(newconn); + return ERR_MEM; + } else { + /* Register event with callback */ + API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0); + } + + return ERR_OK; +} +#endif /* LWIP_TCP */ + +/** + * Create a new pcb of a specific type. + * Called from lwip_netconn_do_newconn(). + * + * @param msg the api_msg_msg describing the connection type + */ +static void +pcb_new(struct api_msg *msg) +{ + enum lwip_ip_addr_type iptype = IPADDR_TYPE_V4; + + LWIP_ASSERT("pcb_new: pcb already allocated", msg->conn->pcb.tcp == NULL); + +#if LWIP_IPV6 && LWIP_IPV4 + /* IPv6: Dual-stack by default, unless netconn_set_ipv6only() is called */ + if(NETCONNTYPE_ISIPV6(netconn_type(msg->conn))) { + iptype = IPADDR_TYPE_ANY; + } +#endif + + /* Allocate a PCB for this connection */ + switch(NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + msg->conn->pcb.raw = raw_new_ip_type(iptype, msg->msg.n.proto); + if (msg->conn->pcb.raw != NULL) { +#if LWIP_IPV6 + /* ICMPv6 packets should always have checksum calculated by the stack as per RFC 3542 chapter 3.1 */ + if (NETCONNTYPE_ISIPV6(msg->conn->type) && msg->conn->pcb.raw->protocol == IP6_NEXTH_ICMP6) { + msg->conn->pcb.raw->chksum_reqd = 1; + msg->conn->pcb.raw->chksum_offset = 2; + } +#endif /* LWIP_IPV6 */ + raw_recv(msg->conn->pcb.raw, recv_raw, msg->conn); + } + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + msg->conn->pcb.udp = udp_new_ip_type(iptype); + if (msg->conn->pcb.udp != NULL) { +#if LWIP_UDPLITE + if (NETCONNTYPE_ISUDPLITE(msg->conn->type)) { + udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_UDPLITE); + } +#endif /* LWIP_UDPLITE */ + if (NETCONNTYPE_ISUDPNOCHKSUM(msg->conn->type)) { + udp_setflags(msg->conn->pcb.udp, UDP_FLAGS_NOCHKSUM); + } + udp_recv(msg->conn->pcb.udp, recv_udp, msg->conn); + } + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + msg->conn->pcb.tcp = tcp_new_ip_type(iptype); + if (msg->conn->pcb.tcp != NULL) { + setup_tcp(msg->conn); + } + break; +#endif /* LWIP_TCP */ + default: + /* Unsupported netconn type, e.g. protocol disabled */ + msg->err = ERR_VAL; + return; + } + if (msg->conn->pcb.ip == NULL) { + msg->err = ERR_MEM; + } +} + +/** + * Create a new pcb of a specific type inside a netconn. + * Called from netconn_new_with_proto_and_callback. + * + * @param m the api_msg_msg describing the connection type + */ +void +lwip_netconn_do_newconn(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + msg->err = ERR_OK; + if (msg->conn->pcb.tcp == NULL) { + pcb_new(msg); + } + /* Else? This "new" connection already has a PCB allocated. */ + /* Is this an error condition? Should it be deleted? */ + /* We currently just are happy and return. */ + + TCPIP_APIMSG_ACK(msg); +} + +/** + * Create a new netconn (of a specific type) that has a callback function. + * The corresponding pcb is NOT created! + * + * @param t the type of 'connection' to create (@see enum netconn_type) + * @param callback a function to call on status changes (RX available, TX'ed) + * @return a newly allocated struct netconn or + * NULL on memory error + */ +struct netconn* +netconn_alloc(enum netconn_type t, netconn_callback callback) +{ + struct netconn *conn; + int size; + + conn = (struct netconn *)memp_malloc(MEMP_NETCONN); + if (conn == NULL) { + return NULL; + } + + conn->last_err = ERR_OK; + conn->type = t; + conn->pcb.tcp = NULL; + + /* If all sizes are the same, every compiler should optimize this switch to nothing */ + switch(NETCONNTYPE_GROUP(t)) { +#if LWIP_RAW + case NETCONN_RAW: + size = DEFAULT_RAW_RECVMBOX_SIZE; + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + size = DEFAULT_UDP_RECVMBOX_SIZE; + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + size = DEFAULT_TCP_RECVMBOX_SIZE; + break; +#endif /* LWIP_TCP */ + default: + LWIP_ASSERT("netconn_alloc: undefined netconn_type", 0); + goto free_and_return; + } + + if (sys_mbox_new(&conn->recvmbox, size) != ERR_OK) { + goto free_and_return; + } +#if !LWIP_NETCONN_SEM_PER_THREAD + if (sys_sem_new(&conn->op_completed, 0) != ERR_OK) { + sys_mbox_free(&conn->recvmbox); + goto free_and_return; + } +#endif + +#if LWIP_TCP + sys_mbox_set_invalid(&conn->acceptmbox); +#endif + conn->state = NETCONN_NONE; +#if LWIP_SOCKET + /* initialize socket to -1 since 0 is a valid socket */ + conn->socket = -1; +#endif /* LWIP_SOCKET */ + conn->callback = callback; +#if LWIP_TCP + conn->current_msg = NULL; + conn->write_offset = 0; +#endif /* LWIP_TCP */ +#if LWIP_SO_SNDTIMEO + conn->send_timeout = 0; +#endif /* LWIP_SO_SNDTIMEO */ +#if LWIP_SO_RCVTIMEO + conn->recv_timeout = 0; +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVBUF + conn->recv_bufsize = RECV_BUFSIZE_DEFAULT; + conn->recv_avail = 0; +#endif /* LWIP_SO_RCVBUF */ +#if LWIP_SO_LINGER + conn->linger = -1; +#endif /* LWIP_SO_LINGER */ + conn->flags = 0; + return conn; +free_and_return: + memp_free(MEMP_NETCONN, conn); + return NULL; +} + +/** + * Delete a netconn and all its resources. + * The pcb is NOT freed (since we might not be in the right thread context do this). + * + * @param conn the netconn to free + */ +void +netconn_free(struct netconn *conn) +{ + LWIP_ASSERT("PCB must be deallocated outside this function", conn->pcb.tcp == NULL); + LWIP_ASSERT("recvmbox must be deallocated before calling this function", + !sys_mbox_valid(&conn->recvmbox)); +#if LWIP_TCP + LWIP_ASSERT("acceptmbox must be deallocated before calling this function", + !sys_mbox_valid(&conn->acceptmbox)); +#endif /* LWIP_TCP */ + +#if !LWIP_NETCONN_SEM_PER_THREAD + sys_sem_free(&conn->op_completed); + sys_sem_set_invalid(&conn->op_completed); +#endif + + memp_free(MEMP_NETCONN, conn); +} + +/** + * Delete rcvmbox and acceptmbox of a netconn and free the left-over data in + * these mboxes + * + * @param conn the netconn to free + * @bytes_drained bytes drained from recvmbox + * @accepts_drained pending connections drained from acceptmbox + */ +static void +netconn_drain(struct netconn *conn) +{ + void *mem; +#if LWIP_TCP + struct pbuf *p; +#endif /* LWIP_TCP */ + + /* This runs in tcpip_thread, so we don't need to lock against rx packets */ + + /* Delete and drain the recvmbox. */ + if (sys_mbox_valid(&conn->recvmbox)) { + while (sys_mbox_tryfetch(&conn->recvmbox, &mem) != SYS_MBOX_EMPTY) { +#if LWIP_TCP + if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) { + if (mem != NULL) { + p = (struct pbuf*)mem; + /* pcb might be set to NULL already by err_tcp() */ + if (conn->pcb.tcp != NULL) { + tcp_recved(conn->pcb.tcp, p->tot_len); + } + pbuf_free(p); + } + } else +#endif /* LWIP_TCP */ + { + netbuf_delete((struct netbuf *)mem); + } + } + sys_mbox_free(&conn->recvmbox); + sys_mbox_set_invalid(&conn->recvmbox); + } + + /* Delete and drain the acceptmbox. */ +#if LWIP_TCP + if (sys_mbox_valid(&conn->acceptmbox)) { + while (sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) { + if (mem != &netconn_aborted) { + struct netconn *newconn = (struct netconn *)mem; + /* Only tcp pcbs have an acceptmbox, so no need to check conn->type */ + /* pcb might be set to NULL already by err_tcp() */ + /* drain recvmbox */ + netconn_drain(newconn); + if (newconn->pcb.tcp != NULL) { + tcp_abort(newconn->pcb.tcp); + newconn->pcb.tcp = NULL; + } + netconn_free(newconn); + } + } + sys_mbox_free(&conn->acceptmbox); + sys_mbox_set_invalid(&conn->acceptmbox); + } +#endif /* LWIP_TCP */ +} + +#if LWIP_TCP +/** + * Internal helper function to close a TCP netconn: since this sometimes + * doesn't work at the first attempt, this function is called from multiple + * places. + * + * @param conn the TCP netconn to close + */ +static err_t +lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM) +{ + err_t err; + u8_t shut, shut_rx, shut_tx, close; + u8_t close_finished = 0; + struct tcp_pcb* tpcb; +#if LWIP_SO_LINGER + u8_t linger_wait_required = 0; +#endif /* LWIP_SO_LINGER */ + + LWIP_ASSERT("invalid conn", (conn != NULL)); + LWIP_ASSERT("this is for tcp netconns only", (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)); + LWIP_ASSERT("conn must be in state NETCONN_CLOSE", (conn->state == NETCONN_CLOSE)); + LWIP_ASSERT("pcb already closed", (conn->pcb.tcp != NULL)); + LWIP_ASSERT("conn->current_msg != NULL", conn->current_msg != NULL); + + tpcb = conn->pcb.tcp; + shut = conn->current_msg->msg.sd.shut; + shut_rx = shut & NETCONN_SHUT_RD; + shut_tx = shut & NETCONN_SHUT_WR; + /* shutting down both ends is the same as closing + (also if RD or WR side was shut down before already) */ + if (shut == NETCONN_SHUT_RDWR) { + close = 1; + } else if (shut_rx && + ((tpcb->state == FIN_WAIT_1) || + (tpcb->state == FIN_WAIT_2) || + (tpcb->state == CLOSING))) { + close = 1; + } else if (shut_tx && ((tpcb->flags & TF_RXCLOSED) != 0)) { + close = 1; + } else { + close = 0; + } + + /* Set back some callback pointers */ + if (close) { + tcp_arg(tpcb, NULL); + } + if (tpcb->state == LISTEN) { + tcp_accept(tpcb, NULL); + } else { + /* some callbacks have to be reset if tcp_close is not successful */ + if (shut_rx) { + tcp_recv(tpcb, NULL); + tcp_accept(tpcb, NULL); + } + if (shut_tx) { + tcp_sent(tpcb, NULL); + } + if (close) { + tcp_poll(tpcb, NULL, 0); + tcp_err(tpcb, NULL); + } + } + /* Try to close the connection */ + if (close) { +#if LWIP_SO_LINGER + /* check linger possibilites before calling tcp_close */ + err = ERR_OK; + /* linger enabled/required at all? (i.e. is there untransmitted data left?) */ + if ((conn->linger >= 0) && (conn->pcb.tcp->unsent || conn->pcb.tcp->unacked)) { + if ((conn->linger == 0)) { + /* data left but linger prevents waiting */ + tcp_abort(tpcb); + tpcb = NULL; + } else if (conn->linger > 0) { + /* data left and linger says we should wait */ + if (netconn_is_nonblocking(conn)) { + /* data left on a nonblocking netconn -> cannot linger */ + err = ERR_WOULDBLOCK; + } else if ((s32_t)(sys_now() - conn->current_msg->msg.sd.time_started) >= + (conn->linger * 1000)) { + /* data left but linger timeout has expired (this happens on further + calls to this function through poll_tcp */ + tcp_abort(tpcb); + tpcb = NULL; + } else { + /* data left -> need to wait for ACK after successful close */ + linger_wait_required = 1; + } + } + } + if ((err == ERR_OK) && (tpcb != NULL)) +#endif /* LWIP_SO_LINGER */ + { + err = tcp_close(tpcb); + } + } else { + err = tcp_shutdown(tpcb, shut_rx, shut_tx); + } + if (err == ERR_OK) { + close_finished = 1; +#if LWIP_SO_LINGER + if (linger_wait_required) { + /* wait for ACK of all unsent/unacked data by just getting called again */ + close_finished = 0; + err = ERR_INPROGRESS; + } +#endif /* LWIP_SO_LINGER */ + } else { + if (err == ERR_MEM) { + /* Closing failed because of memory shortage, try again later. Even for + nonblocking netconns, we have to wait since no standard socket application + is prepared for close failing because of resource shortage. + Check the timeout: this is kind of an lwip addition to the standard sockets: + we wait for some time when failing to allocate a segment for the FIN */ +#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER + s32_t close_timeout = LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT; +#if LWIP_SO_SNDTIMEO + if (conn->send_timeout > 0) { + close_timeout = conn->send_timeout; + } +#endif /* LWIP_SO_SNDTIMEO */ +#if LWIP_SO_LINGER + if (conn->linger >= 0) { + /* use linger timeout (seconds) */ + close_timeout = conn->linger * 1000U; + } +#endif + if ((s32_t)(sys_now() - conn->current_msg->msg.sd.time_started) >= close_timeout) { +#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + if (conn->current_msg->msg.sd.polls_left == 0) { +#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + close_finished = 1; + if (close) { + /* in this case, we want to RST the connection */ + tcp_abort(tpcb); + err = ERR_OK; + } + } + } else { + /* Closing failed for a non-memory error: give up */ + close_finished = 1; + } + } + if (close_finished) { + /* Closing done (succeeded, non-memory error, nonblocking error or timeout) */ + sys_sem_t* op_completed_sem = LWIP_API_MSG_SEM(conn->current_msg); + conn->current_msg->err = err; + conn->current_msg = NULL; + conn->state = NETCONN_NONE; + if (err == ERR_OK) { + if (close) { + /* Set back some callback pointers as conn is going away */ + conn->pcb.tcp = NULL; + /* Trigger select() in socket layer. Make sure everybody notices activity + on the connection, error first! */ + API_EVENT(conn, NETCONN_EVT_ERROR, 0); + } + if (shut_rx) { + API_EVENT(conn, NETCONN_EVT_RCVPLUS, 0); + } + if (shut_tx) { + API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0); + } + } + NETCONN_SET_SAFE_ERR(conn, err); +#if LWIP_TCPIP_CORE_LOCKING + if (delayed) +#endif + { + /* wake up the application task */ + sys_sem_signal(op_completed_sem); + } + return ERR_OK; + } + if (!close_finished) { + /* Closing failed and we want to wait: restore some of the callbacks */ + /* Closing of listen pcb will never fail! */ + LWIP_ASSERT("Closing a listen pcb may not fail!", (tpcb->state != LISTEN)); + if (shut_tx) { + tcp_sent(tpcb, sent_tcp); + } + /* when waiting for close, set up poll interval to 500ms */ + tcp_poll(tpcb, poll_tcp, 1); + tcp_err(tpcb, err_tcp); + tcp_arg(tpcb, conn); + /* don't restore recv callback: we don't want to receive any more data */ + } + /* If closing didn't succeed, we get called again either + from poll_tcp or from sent_tcp */ + LWIP_ASSERT("err != ERR_OK", err != ERR_OK); + return err; +} +#endif /* LWIP_TCP */ + +/** + * Delete the pcb inside a netconn. + * Called from netconn_delete. + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_delconn(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + enum netconn_state state = msg->conn->state; + LWIP_ASSERT("netconn state error", /* this only happens for TCP netconns */ + (state == NETCONN_NONE) || (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP)); +#if LWIP_NETCONN_FULLDUPLEX + /* In full duplex mode, blocking write/connect is aborted with ERR_CLSD */ + if (state != NETCONN_NONE) { + if ((state == NETCONN_WRITE) || + ((state == NETCONN_CONNECT) && !IN_NONBLOCKING_CONNECT(msg->conn))) { + /* close requested, abort running write/connect */ + sys_sem_t* op_completed_sem; + LWIP_ASSERT("msg->conn->current_msg != NULL", msg->conn->current_msg != NULL); + op_completed_sem = LWIP_API_MSG_SEM(msg->conn->current_msg); + msg->conn->current_msg->err = ERR_CLSD; + msg->conn->current_msg = NULL; + msg->conn->write_offset = 0; + msg->conn->state = NETCONN_NONE; + NETCONN_SET_SAFE_ERR(msg->conn, ERR_CLSD); + sys_sem_signal(op_completed_sem); + } + } +#else /* LWIP_NETCONN_FULLDUPLEX */ + if (((state != NETCONN_NONE) && + (state != NETCONN_LISTEN) && + (state != NETCONN_CONNECT)) || + ((state == NETCONN_CONNECT) && !IN_NONBLOCKING_CONNECT(msg->conn))) { + /* This means either a blocking write or blocking connect is running + (nonblocking write returns and sets state to NONE) */ + msg->err = ERR_INPROGRESS; + } else +#endif /* LWIP_NETCONN_FULLDUPLEX */ + { + LWIP_ASSERT("blocking connect in progress", + (state != NETCONN_CONNECT) || IN_NONBLOCKING_CONNECT(msg->conn)); + msg->err = ERR_OK; + /* Drain and delete mboxes */ + netconn_drain(msg->conn); + + if (msg->conn->pcb.tcp != NULL) { + + switch (NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + raw_remove(msg->conn->pcb.raw); + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + msg->conn->pcb.udp->recv_arg = NULL; + udp_remove(msg->conn->pcb.udp); + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + LWIP_ASSERT("already writing or closing", msg->conn->current_msg == NULL && + msg->conn->write_offset == 0); + msg->conn->state = NETCONN_CLOSE; + msg->msg.sd.shut = NETCONN_SHUT_RDWR; + msg->conn->current_msg = msg; +#if LWIP_TCPIP_CORE_LOCKING + if (lwip_netconn_do_close_internal(msg->conn, 0) != ERR_OK) { + LWIP_ASSERT("state!", msg->conn->state == NETCONN_CLOSE); + UNLOCK_TCPIP_CORE(); + sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); + LOCK_TCPIP_CORE(); + LWIP_ASSERT("state!", msg->conn->state == NETCONN_NONE); + } +#else /* LWIP_TCPIP_CORE_LOCKING */ + lwip_netconn_do_close_internal(msg->conn); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + /* API_EVENT is called inside lwip_netconn_do_close_internal, before releasing + the application thread, so we can return at this point! */ + return; +#endif /* LWIP_TCP */ + default: + break; + } + msg->conn->pcb.tcp = NULL; + } + /* tcp netconns don't come here! */ + + /* @todo: this lets select make the socket readable and writable, + which is wrong! errfd instead? */ + API_EVENT(msg->conn, NETCONN_EVT_RCVPLUS, 0); + API_EVENT(msg->conn, NETCONN_EVT_SENDPLUS, 0); + } + if (sys_sem_valid(LWIP_API_MSG_SEM(msg))) { + TCPIP_APIMSG_ACK(msg); + } +} + +/** + * Bind a pcb contained in a netconn + * Called from netconn_bind. + * + * @param m the api_msg_msg pointing to the connection and containing + * the IP address and port to bind to + */ +void +lwip_netconn_do_bind(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (ERR_IS_FATAL(msg->conn->last_err)) { + msg->err = msg->conn->last_err; + } else { + msg->err = ERR_VAL; + if (msg->conn->pcb.tcp != NULL) { + switch (NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + msg->err = raw_bind(msg->conn->pcb.raw, API_EXPR_REF(msg->msg.bc.ipaddr)); + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + msg->err = udp_bind(msg->conn->pcb.udp, API_EXPR_REF(msg->msg.bc.ipaddr), msg->msg.bc.port); + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + msg->err = tcp_bind(msg->conn->pcb.tcp, API_EXPR_REF(msg->msg.bc.ipaddr), msg->msg.bc.port); + break; +#endif /* LWIP_TCP */ + default: + break; + } + } + } + TCPIP_APIMSG_ACK(msg); +} + +#if LWIP_TCP +/** + * TCP callback function if a connection (opened by tcp_connect/lwip_netconn_do_connect) has + * been established (or reset by the remote host). + * + * @see tcp.h (struct tcp_pcb.connected) for parameters and return values + */ +static err_t +lwip_netconn_do_connected(void *arg, struct tcp_pcb *pcb, err_t err) +{ + struct netconn *conn; + int was_blocking; + sys_sem_t* op_completed_sem = NULL; + + LWIP_UNUSED_ARG(pcb); + + conn = (struct netconn *)arg; + + if (conn == NULL) { + return ERR_VAL; + } + + LWIP_ASSERT("conn->state == NETCONN_CONNECT", conn->state == NETCONN_CONNECT); + LWIP_ASSERT("(conn->current_msg != NULL) || conn->in_non_blocking_connect", + (conn->current_msg != NULL) || IN_NONBLOCKING_CONNECT(conn)); + + if (conn->current_msg != NULL) { + conn->current_msg->err = err; + op_completed_sem = LWIP_API_MSG_SEM(conn->current_msg); + } + if ((NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) && (err == ERR_OK)) { + setup_tcp(conn); + } + was_blocking = !IN_NONBLOCKING_CONNECT(conn); + SET_NONBLOCKING_CONNECT(conn, 0); + LWIP_ASSERT("blocking connect state error", + (was_blocking && op_completed_sem != NULL) || + (!was_blocking && op_completed_sem == NULL)); + conn->current_msg = NULL; + conn->state = NETCONN_NONE; + NETCONN_SET_SAFE_ERR(conn, ERR_OK); + API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0); + + if (was_blocking) { + sys_sem_signal(op_completed_sem); + } + return ERR_OK; +} +#endif /* LWIP_TCP */ + +/** + * Connect a pcb contained inside a netconn + * Called from netconn_connect. + * + * @param m the api_msg_msg pointing to the connection and containing + * the IP address and port to connect to + */ +void +lwip_netconn_do_connect(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (msg->conn->pcb.tcp == NULL) { + /* This may happen when calling netconn_connect() a second time */ + msg->err = ERR_CLSD; + } else { + switch (NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + msg->err = raw_connect(msg->conn->pcb.raw, API_EXPR_REF(msg->msg.bc.ipaddr)); + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + msg->err = udp_connect(msg->conn->pcb.udp, API_EXPR_REF(msg->msg.bc.ipaddr), msg->msg.bc.port); + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + /* Prevent connect while doing any other action. */ + if (msg->conn->state == NETCONN_CONNECT) { + msg->err = ERR_ALREADY; + } else if (msg->conn->state != NETCONN_NONE) { + msg->err = ERR_ISCONN; + } else { + setup_tcp(msg->conn); + msg->err = tcp_connect(msg->conn->pcb.tcp, API_EXPR_REF(msg->msg.bc.ipaddr), + msg->msg.bc.port, lwip_netconn_do_connected); + if (msg->err == ERR_OK) { + u8_t non_blocking = netconn_is_nonblocking(msg->conn); + msg->conn->state = NETCONN_CONNECT; + SET_NONBLOCKING_CONNECT(msg->conn, non_blocking); + if (non_blocking) { + msg->err = ERR_INPROGRESS; + } else { + msg->conn->current_msg = msg; + /* sys_sem_signal() is called from lwip_netconn_do_connected (or err_tcp()), + when the connection is established! */ +#if LWIP_TCPIP_CORE_LOCKING + LWIP_ASSERT("state!", msg->conn->state == NETCONN_CONNECT); + UNLOCK_TCPIP_CORE(); + sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); + LOCK_TCPIP_CORE(); + LWIP_ASSERT("state!", msg->conn->state != NETCONN_CONNECT); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + return; + } + } + } + break; +#endif /* LWIP_TCP */ + default: + LWIP_ERROR("Invalid netconn type", 0, do{ msg->err = ERR_VAL; }while(0)); + break; + } + } + /* For all other protocols, netconn_connect() calls TCPIP_APIMSG(), + so use TCPIP_APIMSG_ACK() here. */ + TCPIP_APIMSG_ACK(msg); +} + +/** + * Disconnect a pcb contained inside a netconn + * Only used for UDP netconns. + * Called from netconn_disconnect. + * + * @param m the api_msg_msg pointing to the connection to disconnect + */ +void +lwip_netconn_do_disconnect(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + +#if LWIP_UDP + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) { + udp_disconnect(msg->conn->pcb.udp); + msg->err = ERR_OK; + } else +#endif /* LWIP_UDP */ + { + msg->err = ERR_VAL; + } + TCPIP_APIMSG_ACK(msg); +} + +#if LWIP_TCP +/** + * Set a TCP pcb contained in a netconn into listen mode + * Called from netconn_listen. + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_listen(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (ERR_IS_FATAL(msg->conn->last_err)) { + msg->err = msg->conn->last_err; + } else { + msg->err = ERR_CONN; + if (msg->conn->pcb.tcp != NULL) { + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) { + if (msg->conn->state == NETCONN_NONE) { + struct tcp_pcb* lpcb; + if (msg->conn->pcb.tcp->state != CLOSED) { + /* connection is not closed, cannot listen */ + msg->err = ERR_VAL; + } else { + err_t err; + u8_t backlog; +#if TCP_LISTEN_BACKLOG + backlog = msg->msg.lb.backlog; +#else /* TCP_LISTEN_BACKLOG */ + backlog = TCP_DEFAULT_LISTEN_BACKLOG; +#endif /* TCP_LISTEN_BACKLOG */ +#if LWIP_IPV4 && LWIP_IPV6 + /* "Socket API like" dual-stack support: If IP to listen to is IP6_ADDR_ANY, + * and NETCONN_FLAG_IPV6_V6ONLY is NOT set, use IP_ANY_TYPE to listen + */ + if (ip_addr_cmp(&msg->conn->pcb.ip->local_ip, IP6_ADDR_ANY) && + (netconn_get_ipv6only(msg->conn) == 0)) { + /* change PCB type to IPADDR_TYPE_ANY */ + IP_SET_TYPE_VAL(msg->conn->pcb.tcp->local_ip, IPADDR_TYPE_ANY); + IP_SET_TYPE_VAL(msg->conn->pcb.tcp->remote_ip, IPADDR_TYPE_ANY); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + lpcb = tcp_listen_with_backlog_and_err(msg->conn->pcb.tcp, backlog, &err); + + if (lpcb == NULL) { + /* in this case, the old pcb is still allocated */ + msg->err = err; + } else { + /* delete the recvmbox and allocate the acceptmbox */ + if (sys_mbox_valid(&msg->conn->recvmbox)) { + /** @todo: should we drain the recvmbox here? */ + sys_mbox_free(&msg->conn->recvmbox); + sys_mbox_set_invalid(&msg->conn->recvmbox); + } + msg->err = ERR_OK; + if (!sys_mbox_valid(&msg->conn->acceptmbox)) { + msg->err = sys_mbox_new(&msg->conn->acceptmbox, DEFAULT_ACCEPTMBOX_SIZE); + } + if (msg->err == ERR_OK) { + msg->conn->state = NETCONN_LISTEN; + msg->conn->pcb.tcp = lpcb; + tcp_arg(msg->conn->pcb.tcp, msg->conn); + tcp_accept(msg->conn->pcb.tcp, accept_function); + } else { + /* since the old pcb is already deallocated, free lpcb now */ + tcp_close(lpcb); + msg->conn->pcb.tcp = NULL; + } + } + } + } else if (msg->conn->state == NETCONN_LISTEN) { + /* already listening, allow updating of the backlog */ + msg->err = ERR_OK; + tcp_backlog_set(msg->conn->pcb.tcp, msg->msg.lb.backlog); + } + } else { + msg->err = ERR_ARG; + } + } + } + TCPIP_APIMSG_ACK(msg); +} +#endif /* LWIP_TCP */ + +/** + * Send some data on a RAW or UDP pcb contained in a netconn + * Called from netconn_send + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_send(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (ERR_IS_FATAL(msg->conn->last_err)) { + msg->err = msg->conn->last_err; + } else { + msg->err = ERR_CONN; + if (msg->conn->pcb.tcp != NULL) { + switch (NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + if (ip_addr_isany(&msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) { + msg->err = raw_send(msg->conn->pcb.raw, msg->msg.b->p); + } else { + msg->err = raw_sendto(msg->conn->pcb.raw, msg->msg.b->p, &msg->msg.b->addr); + } + break; +#endif +#if LWIP_UDP + case NETCONN_UDP: +#if LWIP_CHECKSUM_ON_COPY + if (ip_addr_isany(&msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) { + msg->err = udp_send_chksum(msg->conn->pcb.udp, msg->msg.b->p, + msg->msg.b->flags & NETBUF_FLAG_CHKSUM, msg->msg.b->toport_chksum); + } else { + msg->err = udp_sendto_chksum(msg->conn->pcb.udp, msg->msg.b->p, + &msg->msg.b->addr, msg->msg.b->port, + msg->msg.b->flags & NETBUF_FLAG_CHKSUM, msg->msg.b->toport_chksum); + } +#else /* LWIP_CHECKSUM_ON_COPY */ + if (ip_addr_isany_val(msg->msg.b->addr) || IP_IS_ANY_TYPE_VAL(msg->msg.b->addr)) { + msg->err = udp_send(msg->conn->pcb.udp, msg->msg.b->p); + } else { + msg->err = udp_sendto(msg->conn->pcb.udp, msg->msg.b->p, &msg->msg.b->addr, msg->msg.b->port); + } +#endif /* LWIP_CHECKSUM_ON_COPY */ + break; +#endif /* LWIP_UDP */ + default: + break; + } + } + } + TCPIP_APIMSG_ACK(msg); +} + +#if LWIP_TCP +/** + * Indicate data has been received from a TCP pcb contained in a netconn + * Called from netconn_recv + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_recv(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + msg->err = ERR_OK; + if (msg->conn->pcb.tcp != NULL) { + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) { + u32_t remaining = msg->msg.r.len; + do { + u16_t recved = (remaining > 0xffff) ? 0xffff : (u16_t)remaining; + tcp_recved(msg->conn->pcb.tcp, recved); + remaining -= recved; + } while (remaining != 0); + } + } + TCPIP_APIMSG_ACK(msg); +} + +#if TCP_LISTEN_BACKLOG +/** Indicate that a TCP pcb has been accepted + * Called from netconn_accept + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_accepted(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + msg->err = ERR_OK; + if (msg->conn->pcb.tcp != NULL) { + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) { + tcp_backlog_accepted(msg->conn->pcb.tcp); + } + } + TCPIP_APIMSG_ACK(msg); +} +#endif /* TCP_LISTEN_BACKLOG */ + +/** + * See if more data needs to be written from a previous call to netconn_write. + * Called initially from lwip_netconn_do_write. If the first call can't send all data + * (because of low memory or empty send-buffer), this function is called again + * from sent_tcp() or poll_tcp() to send more data. If all data is sent, the + * blocking application thread (waiting in netconn_write) is released. + * + * @param conn netconn (that is currently in state NETCONN_WRITE) to process + * @return ERR_OK + * ERR_MEM if LWIP_TCPIP_CORE_LOCKING=1 and sending hasn't yet finished + */ +static err_t +lwip_netconn_do_writemore(struct netconn *conn WRITE_DELAYED_PARAM) +{ + err_t err; + const void *dataptr; + u16_t len, available; + u8_t write_finished = 0; + size_t diff; + u8_t dontblock; + u8_t apiflags; + + LWIP_ASSERT("conn != NULL", conn != NULL); + LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE)); + LWIP_ASSERT("conn->current_msg != NULL", conn->current_msg != NULL); + LWIP_ASSERT("conn->pcb.tcp != NULL", conn->pcb.tcp != NULL); + LWIP_ASSERT("conn->write_offset < conn->current_msg->msg.w.len", + conn->write_offset < conn->current_msg->msg.w.len); + + apiflags = conn->current_msg->msg.w.apiflags; + dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK); + +#if LWIP_SO_SNDTIMEO + if ((conn->send_timeout != 0) && + ((s32_t)(sys_now() - conn->current_msg->msg.w.time_started) >= conn->send_timeout)) { + write_finished = 1; + if (conn->write_offset == 0) { + /* nothing has been written */ + err = ERR_WOULDBLOCK; + conn->current_msg->msg.w.len = 0; + } else { + /* partial write */ + err = ERR_OK; + conn->current_msg->msg.w.len = conn->write_offset; + conn->write_offset = 0; + } + } else +#endif /* LWIP_SO_SNDTIMEO */ + { + dataptr = (const u8_t*)conn->current_msg->msg.w.dataptr + conn->write_offset; + diff = conn->current_msg->msg.w.len - conn->write_offset; + if (diff > 0xffffUL) { /* max_u16_t */ + len = 0xffff; + apiflags |= TCP_WRITE_FLAG_MORE; + } else { + len = (u16_t)diff; + } + available = tcp_sndbuf(conn->pcb.tcp); + if (available < len) { + /* don't try to write more than sendbuf */ + len = available; + if (dontblock) { + if (!len) { + err = ERR_WOULDBLOCK; + goto err_mem; + } + } else { + apiflags |= TCP_WRITE_FLAG_MORE; + } + } + LWIP_ASSERT("lwip_netconn_do_writemore: invalid length!", ((conn->write_offset + len) <= conn->current_msg->msg.w.len)); + err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags); + /* if OK or memory error, check available space */ + if ((err == ERR_OK) || (err == ERR_MEM)) { +err_mem: + if (dontblock && (len < conn->current_msg->msg.w.len)) { + /* non-blocking write did not write everything: mark the pcb non-writable + and let poll_tcp check writable space to mark the pcb writable again */ + API_EVENT(conn, NETCONN_EVT_SENDMINUS, len); + conn->flags |= NETCONN_FLAG_CHECK_WRITESPACE; + } else if ((tcp_sndbuf(conn->pcb.tcp) <= TCP_SNDLOWAT) || + (tcp_sndqueuelen(conn->pcb.tcp) >= TCP_SNDQUEUELOWAT)) { + /* The queued byte- or pbuf-count exceeds the configured low-water limit, + let select mark this pcb as non-writable. */ + API_EVENT(conn, NETCONN_EVT_SENDMINUS, len); + } + } + + if (err == ERR_OK) { + err_t out_err; + conn->write_offset += len; + if ((conn->write_offset == conn->current_msg->msg.w.len) || dontblock) { + /* return sent length */ + conn->current_msg->msg.w.len = conn->write_offset; + /* everything was written */ + write_finished = 1; + } + out_err = tcp_output(conn->pcb.tcp); + if (ERR_IS_FATAL(out_err) || (out_err == ERR_RTE)) { + /* If tcp_output fails with fatal error or no route is found, + don't try writing any more but return the error + to the application thread. */ + err = out_err; + write_finished = 1; + conn->current_msg->msg.w.len = 0; + } + } else if (err == ERR_MEM) { + /* If ERR_MEM, we wait for sent_tcp or poll_tcp to be called. + For blocking sockets, we do NOT return to the application + thread, since ERR_MEM is only a temporary error! Non-blocking + will remain non-writable until sent_tcp/poll_tcp is called */ + + /* tcp_write returned ERR_MEM, try tcp_output anyway */ + err_t out_err = tcp_output(conn->pcb.tcp); + if (ERR_IS_FATAL(out_err) || (out_err == ERR_RTE)) { + /* If tcp_output fails with fatal error or no route is found, + don't try writing any more but return the error + to the application thread. */ + err = out_err; + write_finished = 1; + conn->current_msg->msg.w.len = 0; + } else if (dontblock) { + /* non-blocking write is done on ERR_MEM */ + err = ERR_WOULDBLOCK; + write_finished = 1; + conn->current_msg->msg.w.len = 0; + } + } else { + /* On errors != ERR_MEM, we don't try writing any more but return + the error to the application thread. */ + write_finished = 1; + conn->current_msg->msg.w.len = 0; + } + } + if (write_finished) { + /* everything was written: set back connection state + and back to application task */ + sys_sem_t* op_completed_sem = LWIP_API_MSG_SEM(conn->current_msg); + conn->current_msg->err = err; + conn->current_msg = NULL; + conn->write_offset = 0; + conn->state = NETCONN_NONE; + NETCONN_SET_SAFE_ERR(conn, err); +#if LWIP_TCPIP_CORE_LOCKING + if (delayed) +#endif + { + sys_sem_signal(op_completed_sem); + } + } +#if LWIP_TCPIP_CORE_LOCKING + else { + return ERR_MEM; + } +#endif + return ERR_OK; +} +#endif /* LWIP_TCP */ + +/** + * Send some data on a TCP pcb contained in a netconn + * Called from netconn_write + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_write(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (ERR_IS_FATAL(msg->conn->last_err)) { + msg->err = msg->conn->last_err; + } else { + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) { +#if LWIP_TCP + if (msg->conn->state != NETCONN_NONE) { + /* netconn is connecting, closing or in blocking write */ + msg->err = ERR_INPROGRESS; + } else if (msg->conn->pcb.tcp != NULL) { + msg->conn->state = NETCONN_WRITE; + /* set all the variables used by lwip_netconn_do_writemore */ + LWIP_ASSERT("already writing or closing", msg->conn->current_msg == NULL && + msg->conn->write_offset == 0); + LWIP_ASSERT("msg->msg.w.len != 0", msg->msg.w.len != 0); + msg->conn->current_msg = msg; + msg->conn->write_offset = 0; +#if LWIP_TCPIP_CORE_LOCKING + if (lwip_netconn_do_writemore(msg->conn, 0) != ERR_OK) { + LWIP_ASSERT("state!", msg->conn->state == NETCONN_WRITE); + UNLOCK_TCPIP_CORE(); + sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); + LOCK_TCPIP_CORE(); + LWIP_ASSERT("state!", msg->conn->state != NETCONN_WRITE); + } +#else /* LWIP_TCPIP_CORE_LOCKING */ + lwip_netconn_do_writemore(msg->conn); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + /* for both cases: if lwip_netconn_do_writemore was called, don't ACK the APIMSG + since lwip_netconn_do_writemore ACKs it! */ + return; + } else { + msg->err = ERR_CONN; + } +#else /* LWIP_TCP */ + msg->err = ERR_VAL; +#endif /* LWIP_TCP */ +#if (LWIP_UDP || LWIP_RAW) + } else { + msg->err = ERR_VAL; +#endif /* (LWIP_UDP || LWIP_RAW) */ + } + } + TCPIP_APIMSG_ACK(msg); +} + +/** + * Return a connection's local or remote address + * Called from netconn_getaddr + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_getaddr(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (msg->conn->pcb.ip != NULL) { + if (msg->msg.ad.local) { + ip_addr_copy(API_EXPR_DEREF(msg->msg.ad.ipaddr), + msg->conn->pcb.ip->local_ip); + } else { + ip_addr_copy(API_EXPR_DEREF(msg->msg.ad.ipaddr), + msg->conn->pcb.ip->remote_ip); + } + + msg->err = ERR_OK; + switch (NETCONNTYPE_GROUP(msg->conn->type)) { +#if LWIP_RAW + case NETCONN_RAW: + if (msg->msg.ad.local) { + API_EXPR_DEREF(msg->msg.ad.port) = msg->conn->pcb.raw->protocol; + } else { + /* return an error as connecting is only a helper for upper layers */ + msg->err = ERR_CONN; + } + break; +#endif /* LWIP_RAW */ +#if LWIP_UDP + case NETCONN_UDP: + if (msg->msg.ad.local) { + API_EXPR_DEREF(msg->msg.ad.port) = msg->conn->pcb.udp->local_port; + } else { + if ((msg->conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0) { + msg->err = ERR_CONN; + } else { + API_EXPR_DEREF(msg->msg.ad.port) = msg->conn->pcb.udp->remote_port; + } + } + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case NETCONN_TCP: + if ((msg->msg.ad.local == 0) && + ((msg->conn->pcb.tcp->state == CLOSED) || (msg->conn->pcb.tcp->state == LISTEN))) { + /* pcb is not connected and remote name is requested */ + msg->err = ERR_CONN; + } else { + API_EXPR_DEREF(msg->msg.ad.port) = (msg->msg.ad.local ? msg->conn->pcb.tcp->local_port : msg->conn->pcb.tcp->remote_port); + } + break; +#endif /* LWIP_TCP */ + default: + LWIP_ASSERT("invalid netconn_type", 0); + break; + } + } else { + msg->err = ERR_CONN; + } + TCPIP_APIMSG_ACK(msg); +} + +/** + * Close or half-shutdown a TCP pcb contained in a netconn + * Called from netconn_close + * In contrast to closing sockets, the netconn is not deallocated. + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_close(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + +#if LWIP_TCP + enum netconn_state state = msg->conn->state; + /* First check if this is a TCP netconn and if it is in a correct state + (LISTEN doesn't support half shutdown) */ + if ((msg->conn->pcb.tcp != NULL) && + (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_TCP) && + ((msg->msg.sd.shut == NETCONN_SHUT_RDWR) || (state != NETCONN_LISTEN))) { + /* Check if we are in a connected state */ + if (state == NETCONN_CONNECT) { + /* TCP connect in progress: cannot shutdown */ + msg->err = ERR_CONN; + } else if (state == NETCONN_WRITE) { +#if LWIP_NETCONN_FULLDUPLEX + if (msg->msg.sd.shut & NETCONN_SHUT_WR) { + /* close requested, abort running write */ + sys_sem_t* write_completed_sem; + LWIP_ASSERT("msg->conn->current_msg != NULL", msg->conn->current_msg != NULL); + write_completed_sem = LWIP_API_MSG_SEM(msg->conn->current_msg); + msg->conn->current_msg->err = ERR_CLSD; + msg->conn->current_msg = NULL; + msg->conn->write_offset = 0; + msg->conn->state = NETCONN_NONE; + state = NETCONN_NONE; + NETCONN_SET_SAFE_ERR(msg->conn, ERR_CLSD); + sys_sem_signal(write_completed_sem); + } else { + LWIP_ASSERT("msg->msg.sd.shut == NETCONN_SHUT_RD", msg->msg.sd.shut == NETCONN_SHUT_RD); + /* In this case, let the write continue and do not interfere with + conn->current_msg or conn->state! */ + msg->err = tcp_shutdown(msg->conn->pcb.tcp, 1, 0); + } + } + if (state == NETCONN_NONE) { +#else /* LWIP_NETCONN_FULLDUPLEX */ + msg->err = ERR_INPROGRESS; + } else { +#endif /* LWIP_NETCONN_FULLDUPLEX */ + if (msg->msg.sd.shut & NETCONN_SHUT_RD) { + /* Drain and delete mboxes */ + netconn_drain(msg->conn); + } + LWIP_ASSERT("already writing or closing", msg->conn->current_msg == NULL && + msg->conn->write_offset == 0); + msg->conn->state = NETCONN_CLOSE; + msg->conn->current_msg = msg; +#if LWIP_TCPIP_CORE_LOCKING + if (lwip_netconn_do_close_internal(msg->conn, 0) != ERR_OK) { + LWIP_ASSERT("state!", msg->conn->state == NETCONN_CLOSE); + UNLOCK_TCPIP_CORE(); + sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); + LOCK_TCPIP_CORE(); + LWIP_ASSERT("state!", msg->conn->state == NETCONN_NONE); + } +#else /* LWIP_TCPIP_CORE_LOCKING */ + lwip_netconn_do_close_internal(msg->conn); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + /* for tcp netconns, lwip_netconn_do_close_internal ACKs the message */ + return; + } + } else +#endif /* LWIP_TCP */ + { + msg->err = ERR_CONN; + } + TCPIP_APIMSG_ACK(msg); +} + +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) +/** + * Join multicast groups for UDP netconns. + * Called from netconn_join_leave_group + * + * @param m the api_msg_msg pointing to the connection + */ +void +lwip_netconn_do_join_leave_group(void *m) +{ + struct api_msg *msg = (struct api_msg*)m; + + if (ERR_IS_FATAL(msg->conn->last_err)) { + msg->err = msg->conn->last_err; + } else { + if (msg->conn->pcb.tcp != NULL) { + if (NETCONNTYPE_GROUP(msg->conn->type) == NETCONN_UDP) { +#if LWIP_UDP +#if LWIP_IPV6 && LWIP_IPV6_MLD + if (NETCONNTYPE_ISIPV6(msg->conn->type)) { + if (msg->msg.jl.join_or_leave == NETCONN_JOIN) { + msg->err = mld6_joingroup(ip_2_ip6(API_EXPR_REF(msg->msg.jl.netif_addr)), + ip_2_ip6(API_EXPR_REF(msg->msg.jl.multiaddr))); + } else { + msg->err = mld6_leavegroup(ip_2_ip6(API_EXPR_REF(msg->msg.jl.netif_addr)), + ip_2_ip6(API_EXPR_REF(msg->msg.jl.multiaddr))); + } + } + else +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ + { +#if LWIP_IGMP + if (msg->msg.jl.join_or_leave == NETCONN_JOIN) { + msg->err = igmp_joingroup(ip_2_ip4(API_EXPR_REF(msg->msg.jl.netif_addr)), + ip_2_ip4(API_EXPR_REF(msg->msg.jl.multiaddr))); + } else { + msg->err = igmp_leavegroup(ip_2_ip4(API_EXPR_REF(msg->msg.jl.netif_addr)), + ip_2_ip4(API_EXPR_REF(msg->msg.jl.multiaddr))); + } +#endif /* LWIP_IGMP */ + } +#endif /* LWIP_UDP */ +#if (LWIP_TCP || LWIP_RAW) + } else { + msg->err = ERR_VAL; +#endif /* (LWIP_TCP || LWIP_RAW) */ + } + } else { + msg->err = ERR_CONN; + } + } + TCPIP_APIMSG_ACK(msg); +} +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ + +#if LWIP_DNS +/** + * Callback function that is called when DNS name is resolved + * (or on timeout). A waiting application thread is waked up by + * signaling the semaphore. + */ +static void +lwip_netconn_do_dns_found(const char *name, const ip_addr_t *ipaddr, void *arg) +{ + struct dns_api_msg *msg = (struct dns_api_msg*)arg; + + /* we trust the internal implementation to be correct :-) */ + LWIP_UNUSED_ARG(name); + + if (ipaddr == NULL) { + /* timeout or memory error */ + API_EXPR_DEREF(msg->err) = ERR_VAL; + } else { + /* address was resolved */ + API_EXPR_DEREF(msg->err) = ERR_OK; + API_EXPR_DEREF(msg->addr) = *ipaddr; + } + /* wake up the application task waiting in netconn_gethostbyname */ + sys_sem_signal(API_EXPR_REF_SEM(msg->sem)); +} + +/** + * Execute a DNS query + * Called from netconn_gethostbyname + * + * @param arg the dns_api_msg pointing to the query + */ +void +lwip_netconn_do_gethostbyname(void *arg) +{ + struct dns_api_msg *msg = (struct dns_api_msg*)arg; + u8_t addrtype = +#if LWIP_IPV4 && LWIP_IPV6 + msg->dns_addrtype; +#else + LWIP_DNS_ADDRTYPE_DEFAULT; +#endif + + API_EXPR_DEREF(msg->err) = dns_gethostbyname_addrtype(msg->name, + API_EXPR_REF(msg->addr), lwip_netconn_do_dns_found, msg, addrtype); + if (API_EXPR_DEREF(msg->err) != ERR_INPROGRESS) { + /* on error or immediate success, wake up the application + * task waiting in netconn_gethostbyname */ + sys_sem_signal(API_EXPR_REF_SEM(msg->sem)); + } +} +#endif /* LWIP_DNS */ + +#endif /* LWIP_NETCONN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/err.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/err.c new file mode 100644 index 0000000..35e9c02 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/err.c @@ -0,0 +1,115 @@ +/** + * @file + * Error Management module + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/err.h" +#include "lwip/def.h" +#include "lwip/sys.h" + +#include "lwip/errno.h" + +#if !NO_SYS +/** Table to quickly map an lwIP error (err_t) to a socket error + * by using -err as an index */ +static const int err_to_errno_table[] = { + 0, /* ERR_OK 0 No error, everything OK. */ + ENOMEM, /* ERR_MEM -1 Out of memory error. */ + ENOBUFS, /* ERR_BUF -2 Buffer error. */ + EWOULDBLOCK, /* ERR_TIMEOUT -3 Timeout */ + EHOSTUNREACH, /* ERR_RTE -4 Routing problem. */ + EINPROGRESS, /* ERR_INPROGRESS -5 Operation in progress */ + EINVAL, /* ERR_VAL -6 Illegal value. */ + EWOULDBLOCK, /* ERR_WOULDBLOCK -7 Operation would block. */ + EADDRINUSE, /* ERR_USE -8 Address in use. */ + EALREADY, /* ERR_ALREADY -9 Already connecting. */ + EISCONN, /* ERR_ISCONN -10 Conn already established.*/ + ENOTCONN, /* ERR_CONN -11 Not connected. */ + -1, /* ERR_IF -12 Low-level netif error */ + ECONNABORTED, /* ERR_ABRT -13 Connection aborted. */ + ECONNRESET, /* ERR_RST -14 Connection reset. */ + ENOTCONN, /* ERR_CLSD -15 Connection closed. */ + EIO /* ERR_ARG -16 Illegal argument. */ +}; + +int +err_to_errno(err_t err) +{ + if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_to_errno_table))) { + return EIO; + } + return err_to_errno_table[-err]; +} +#endif /* !NO_SYS */ + +#ifdef LWIP_DEBUG + +static const char *err_strerr[] = { + "Ok.", /* ERR_OK 0 */ + "Out of memory error.", /* ERR_MEM -1 */ + "Buffer error.", /* ERR_BUF -2 */ + "Timeout.", /* ERR_TIMEOUT -3 */ + "Routing problem.", /* ERR_RTE -4 */ + "Operation in progress.", /* ERR_INPROGRESS -5 */ + "Illegal value.", /* ERR_VAL -6 */ + "Operation would block.", /* ERR_WOULDBLOCK -7 */ + "Address in use.", /* ERR_USE -8 */ + "Already connecting.", /* ERR_ALREADY -9 */ + "Already connected.", /* ERR_ISCONN -10 */ + "Not connected.", /* ERR_CONN -11 */ + "Low-level netif error.", /* ERR_IF -12 */ + "Connection aborted.", /* ERR_ABRT -13 */ + "Connection reset.", /* ERR_RST -14 */ + "Connection closed.", /* ERR_CLSD -15 */ + "Illegal argument." /* ERR_ARG -16 */ +}; + +/** + * Convert an lwip internal error to a string representation. + * + * @param err an lwip internal err_t + * @return a string representation for err + */ +const char * +lwip_strerr(err_t err) +{ + if ((err > 0) || (-err >= (err_t)LWIP_ARRAYSIZE(err_strerr))) { + return "Unknown error."; + } + return err_strerr[-err]; +} + +#endif /* LWIP_DEBUG */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netbuf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netbuf.c new file mode 100644 index 0000000..eb25011 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netbuf.c @@ -0,0 +1,246 @@ +/** + * @file + * Network buffer management + * + * @defgroup netbuf Network buffers + * @ingroup netconn + * Network buffer descriptor for @ref netconn. Based on @ref pbuf internally + * to avoid copying data around.\n + * Buffers must not be shared accross multiple threads, all functions except + * netbuf_new() and netbuf_delete() are not thread-safe. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/netbuf.h" +#include "lwip/memp.h" + +#include + +/** + * @ingroup netbuf + * Create (allocate) and initialize a new netbuf. + * The netbuf doesn't yet contain a packet buffer! + * + * @return a pointer to a new netbuf + * NULL on lack of memory + */ +struct +netbuf *netbuf_new(void) +{ + struct netbuf *buf; + + buf = (struct netbuf *)memp_malloc(MEMP_NETBUF); + if (buf != NULL) { + memset(buf, 0, sizeof(struct netbuf)); + } + return buf; +} + +/** + * @ingroup netbuf + * Deallocate a netbuf allocated by netbuf_new(). + * + * @param buf pointer to a netbuf allocated by netbuf_new() + */ +void +netbuf_delete(struct netbuf *buf) +{ + if (buf != NULL) { + if (buf->p != NULL) { + pbuf_free(buf->p); + buf->p = buf->ptr = NULL; + } + memp_free(MEMP_NETBUF, buf); + } +} + +/** + * @ingroup netbuf + * Allocate memory for a packet buffer for a given netbuf. + * + * @param buf the netbuf for which to allocate a packet buffer + * @param size the size of the packet buffer to allocate + * @return pointer to the allocated memory + * NULL if no memory could be allocated + */ +void * +netbuf_alloc(struct netbuf *buf, u16_t size) +{ + LWIP_ERROR("netbuf_alloc: invalid buf", (buf != NULL), return NULL;); + + /* Deallocate any previously allocated memory. */ + if (buf->p != NULL) { + pbuf_free(buf->p); + } + buf->p = pbuf_alloc(PBUF_TRANSPORT, size, PBUF_RAM); + if (buf->p == NULL) { + return NULL; + } + LWIP_ASSERT("check that first pbuf can hold size", + (buf->p->len >= size)); + buf->ptr = buf->p; + return buf->p->payload; +} + +/** + * @ingroup netbuf + * Free the packet buffer included in a netbuf + * + * @param buf pointer to the netbuf which contains the packet buffer to free + */ +void +netbuf_free(struct netbuf *buf) +{ + LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;); + if (buf->p != NULL) { + pbuf_free(buf->p); + } + buf->p = buf->ptr = NULL; +} + +/** + * @ingroup netbuf + * Let a netbuf reference existing (non-volatile) data. + * + * @param buf netbuf which should reference the data + * @param dataptr pointer to the data to reference + * @param size size of the data + * @return ERR_OK if data is referenced + * ERR_MEM if data couldn't be referenced due to lack of memory + */ +err_t +netbuf_ref(struct netbuf *buf, const void *dataptr, u16_t size) +{ + LWIP_ERROR("netbuf_ref: invalid buf", (buf != NULL), return ERR_ARG;); + if (buf->p != NULL) { + pbuf_free(buf->p); + } + buf->p = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF); + if (buf->p == NULL) { + buf->ptr = NULL; + return ERR_MEM; + } + ((struct pbuf_rom*)buf->p)->payload = dataptr; + buf->p->len = buf->p->tot_len = size; + buf->ptr = buf->p; + return ERR_OK; +} + +/** + * @ingroup netbuf + * Chain one netbuf to another (@see pbuf_chain) + * + * @param head the first netbuf + * @param tail netbuf to chain after head, freed by this function, may not be reference after returning + */ +void +netbuf_chain(struct netbuf *head, struct netbuf *tail) +{ + LWIP_ERROR("netbuf_chain: invalid head", (head != NULL), return;); + LWIP_ERROR("netbuf_chain: invalid tail", (tail != NULL), return;); + pbuf_cat(head->p, tail->p); + head->ptr = head->p; + memp_free(MEMP_NETBUF, tail); +} + +/** + * @ingroup netbuf + * Get the data pointer and length of the data inside a netbuf. + * + * @param buf netbuf to get the data from + * @param dataptr pointer to a void pointer where to store the data pointer + * @param len pointer to an u16_t where the length of the data is stored + * @return ERR_OK if the information was retrieved, + * ERR_BUF on error. + */ +err_t +netbuf_data(struct netbuf *buf, void **dataptr, u16_t *len) +{ + LWIP_ERROR("netbuf_data: invalid buf", (buf != NULL), return ERR_ARG;); + LWIP_ERROR("netbuf_data: invalid dataptr", (dataptr != NULL), return ERR_ARG;); + LWIP_ERROR("netbuf_data: invalid len", (len != NULL), return ERR_ARG;); + + if (buf->ptr == NULL) { + return ERR_BUF; + } + *dataptr = buf->ptr->payload; + *len = buf->ptr->len; + return ERR_OK; +} + +/** + * @ingroup netbuf + * Move the current data pointer of a packet buffer contained in a netbuf + * to the next part. + * The packet buffer itself is not modified. + * + * @param buf the netbuf to modify + * @return -1 if there is no next part + * 1 if moved to the next part but now there is no next part + * 0 if moved to the next part and there are still more parts + */ +s8_t +netbuf_next(struct netbuf *buf) +{ + LWIP_ERROR("netbuf_next: invalid buf", (buf != NULL), return -1;); + if (buf->ptr->next == NULL) { + return -1; + } + buf->ptr = buf->ptr->next; + if (buf->ptr->next == NULL) { + return 1; + } + return 0; +} + +/** + * @ingroup netbuf + * Move the current data pointer of a packet buffer contained in a netbuf + * to the beginning of the packet. + * The packet buffer itself is not modified. + * + * @param buf the netbuf to modify + */ +void +netbuf_first(struct netbuf *buf) +{ + LWIP_ERROR("netbuf_first: invalid buf", (buf != NULL), return;); + buf->ptr = buf->p; +} + +#endif /* LWIP_NETCONN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netdb.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netdb.c new file mode 100644 index 0000000..ccd9586 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netdb.c @@ -0,0 +1,413 @@ +/** + * @file + * API functions for name resolving + * + * @defgroup netdbapi NETDB API + * @ingroup socket + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ + +#include "lwip/netdb.h" + +#if LWIP_DNS && LWIP_SOCKET + +#include "lwip/err.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/ip_addr.h" +#include "lwip/api.h" +#include "lwip/dns.h" + +#include /* memset */ +#include /* atoi */ + +/** helper struct for gethostbyname_r to access the char* buffer */ +struct gethostbyname_r_helper { + ip_addr_t *addr_list[2]; + ip_addr_t addr; + char *aliases; +}; + +/** h_errno is exported in netdb.h for access by applications. */ +#if LWIP_DNS_API_DECLARE_H_ERRNO +int h_errno; +#endif /* LWIP_DNS_API_DECLARE_H_ERRNO */ + +/** define "hostent" variables storage: 0 if we use a static (but unprotected) + * set of variables for lwip_gethostbyname, 1 if we use a local storage */ +#ifndef LWIP_DNS_API_HOSTENT_STORAGE +#define LWIP_DNS_API_HOSTENT_STORAGE 0 +#endif + +/** define "hostent" variables storage */ +#if LWIP_DNS_API_HOSTENT_STORAGE +#define HOSTENT_STORAGE +#else +#define HOSTENT_STORAGE static +#endif /* LWIP_DNS_API_STATIC_HOSTENT */ + +/** + * Returns an entry containing addresses of address family AF_INET + * for the host with name name. + * Due to dns_gethostbyname limitations, only one address is returned. + * + * @param name the hostname to resolve + * @return an entry containing addresses of address family AF_INET + * for the host with name name + */ +struct hostent* +lwip_gethostbyname(const char *name) +{ + err_t err; + ip_addr_t addr; + + /* buffer variables for lwip_gethostbyname() */ + HOSTENT_STORAGE struct hostent s_hostent; + HOSTENT_STORAGE char *s_aliases; + HOSTENT_STORAGE ip_addr_t s_hostent_addr; + HOSTENT_STORAGE ip_addr_t *s_phostent_addr[2]; + HOSTENT_STORAGE char s_hostname[DNS_MAX_NAME_LENGTH + 1]; + + /* query host IP address */ + err = netconn_gethostbyname(name, &addr); + if (err != ERR_OK) { + LWIP_DEBUGF(DNS_DEBUG, ("lwip_gethostbyname(%s) failed, err=%d\n", name, err)); + h_errno = HOST_NOT_FOUND; + return NULL; + } + + /* fill hostent */ + s_hostent_addr = addr; + s_phostent_addr[0] = &s_hostent_addr; + s_phostent_addr[1] = NULL; + strncpy(s_hostname, name, DNS_MAX_NAME_LENGTH); + s_hostname[DNS_MAX_NAME_LENGTH] = 0; + s_hostent.h_name = s_hostname; + s_aliases = NULL; + s_hostent.h_aliases = &s_aliases; + s_hostent.h_addrtype = AF_INET; + s_hostent.h_length = sizeof(ip_addr_t); + s_hostent.h_addr_list = (char**)&s_phostent_addr; + +#if DNS_DEBUG + /* dump hostent */ + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_name == %s\n", s_hostent.h_name)); + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_aliases == %p\n", (void*)s_hostent.h_aliases)); + /* h_aliases are always empty */ + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addrtype == %d\n", s_hostent.h_addrtype)); + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_length == %d\n", s_hostent.h_length)); + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list == %p\n", (void*)s_hostent.h_addr_list)); + if (s_hostent.h_addr_list != NULL) { + u8_t idx; + for (idx=0; s_hostent.h_addr_list[idx]; idx++) { + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i] == %p\n", idx, s_hostent.h_addr_list[idx])); + LWIP_DEBUGF(DNS_DEBUG, ("hostent.h_addr_list[%i]-> == %s\n", idx, ipaddr_ntoa((ip_addr_t*)s_hostent.h_addr_list[idx]))); + } + } +#endif /* DNS_DEBUG */ + +#if LWIP_DNS_API_HOSTENT_STORAGE + /* this function should return the "per-thread" hostent after copy from s_hostent */ + return sys_thread_hostent(&s_hostent); +#else + return &s_hostent; +#endif /* LWIP_DNS_API_HOSTENT_STORAGE */ +} + +/** + * Thread-safe variant of lwip_gethostbyname: instead of using a static + * buffer, this function takes buffer and errno pointers as arguments + * and uses these for the result. + * + * @param name the hostname to resolve + * @param ret pre-allocated struct where to store the result + * @param buf pre-allocated buffer where to store additional data + * @param buflen the size of buf + * @param result pointer to a hostent pointer that is set to ret on success + * and set to zero on error + * @param h_errnop pointer to an int where to store errors (instead of modifying + * the global h_errno) + * @return 0 on success, non-zero on error, additional error information + * is stored in *h_errnop instead of h_errno to be thread-safe + */ +int +lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, + size_t buflen, struct hostent **result, int *h_errnop) +{ + err_t err; + struct gethostbyname_r_helper *h; + char *hostname; + size_t namelen; + int lh_errno; + + if (h_errnop == NULL) { + /* ensure h_errnop is never NULL */ + h_errnop = &lh_errno; + } + + if (result == NULL) { + /* not all arguments given */ + *h_errnop = EINVAL; + return -1; + } + /* first thing to do: set *result to nothing */ + *result = NULL; + if ((name == NULL) || (ret == NULL) || (buf == NULL)) { + /* not all arguments given */ + *h_errnop = EINVAL; + return -1; + } + + namelen = strlen(name); + if (buflen < (sizeof(struct gethostbyname_r_helper) + namelen + 1 + (MEM_ALIGNMENT - 1))) { + /* buf can't hold the data needed + a copy of name */ + *h_errnop = ERANGE; + return -1; + } + + h = (struct gethostbyname_r_helper*)LWIP_MEM_ALIGN(buf); + hostname = ((char*)h) + sizeof(struct gethostbyname_r_helper); + + /* query host IP address */ + err = netconn_gethostbyname(name, &h->addr); + if (err != ERR_OK) { + LWIP_DEBUGF(DNS_DEBUG, ("lwip_gethostbyname(%s) failed, err=%d\n", name, err)); + *h_errnop = HOST_NOT_FOUND; + return -1; + } + + /* copy the hostname into buf */ + MEMCPY(hostname, name, namelen); + hostname[namelen] = 0; + + /* fill hostent */ + h->addr_list[0] = &h->addr; + h->addr_list[1] = NULL; + h->aliases = NULL; + ret->h_name = hostname; + ret->h_aliases = &h->aliases; + ret->h_addrtype = AF_INET; + ret->h_length = sizeof(ip_addr_t); + ret->h_addr_list = (char**)&h->addr_list; + + /* set result != NULL */ + *result = ret; + + /* return success */ + return 0; +} + +/** + * Frees one or more addrinfo structures returned by getaddrinfo(), along with + * any additional storage associated with those structures. If the ai_next field + * of the structure is not null, the entire list of structures is freed. + * + * @param ai struct addrinfo to free + */ +void +lwip_freeaddrinfo(struct addrinfo *ai) +{ + struct addrinfo *next; + + while (ai != NULL) { + next = ai->ai_next; + memp_free(MEMP_NETDB, ai); + ai = next; + } +} + +/** + * Translates the name of a service location (for example, a host name) and/or + * a service name and returns a set of socket addresses and associated + * information to be used in creating a socket with which to address the + * specified service. + * Memory for the result is allocated internally and must be freed by calling + * lwip_freeaddrinfo()! + * + * Due to a limitation in dns_gethostbyname, only the first address of a + * host is returned. + * Also, service names are not supported (only port numbers)! + * + * @param nodename descriptive name or address string of the host + * (may be NULL -> local address) + * @param servname port number as string of NULL + * @param hints structure containing input values that set socktype and protocol + * @param res pointer to a pointer where to store the result (set to NULL on failure) + * @return 0 on success, non-zero on failure + * + * @todo: implement AI_V4MAPPED, AI_ADDRCONFIG + */ +int +lwip_getaddrinfo(const char *nodename, const char *servname, + const struct addrinfo *hints, struct addrinfo **res) +{ + err_t err; + ip_addr_t addr; + struct addrinfo *ai; + struct sockaddr_storage *sa = NULL; + int port_nr = 0; + size_t total_size; + size_t namelen = 0; + int ai_family; + + if (res == NULL) { + return EAI_FAIL; + } + *res = NULL; + if ((nodename == NULL) && (servname == NULL)) { + return EAI_NONAME; + } + + if (hints != NULL) { + ai_family = hints->ai_family; + if ((ai_family != AF_UNSPEC) +#if LWIP_IPV4 + && (ai_family != AF_INET) +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + && (ai_family != AF_INET6) +#endif /* LWIP_IPV6 */ + ) { + return EAI_FAMILY; + } + } else { + ai_family = AF_UNSPEC; + } + + if (servname != NULL) { + /* service name specified: convert to port number + * @todo?: currently, only ASCII integers (port numbers) are supported (AI_NUMERICSERV)! */ + port_nr = atoi(servname); + if ((port_nr <= 0) || (port_nr > 0xffff)) { + return EAI_SERVICE; + } + } + + if (nodename != NULL) { + /* service location specified, try to resolve */ + if ((hints != NULL) && (hints->ai_flags & AI_NUMERICHOST)) { + /* no DNS lookup, just parse for an address string */ + if (!ipaddr_aton(nodename, &addr)) { + return EAI_NONAME; + } +#if LWIP_IPV4 && LWIP_IPV6 + if ((IP_IS_V6_VAL(addr) && ai_family == AF_INET) || + (IP_IS_V4_VAL(addr) && ai_family == AF_INET6)) { + return EAI_NONAME; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + } else { +#if LWIP_IPV4 && LWIP_IPV6 + /* AF_UNSPEC: prefer IPv4 */ + u8_t type = NETCONN_DNS_IPV4_IPV6; + if (ai_family == AF_INET) { + type = NETCONN_DNS_IPV4; + } else if (ai_family == AF_INET6) { + type = NETCONN_DNS_IPV6; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + err = netconn_gethostbyname_addrtype(nodename, &addr, type); + if (err != ERR_OK) { + return EAI_FAIL; + } + } + } else { + /* service location specified, use loopback address */ + if ((hints != NULL) && (hints->ai_flags & AI_PASSIVE)) { + ip_addr_set_any(ai_family == AF_INET6, &addr); + } else { + ip_addr_set_loopback(ai_family == AF_INET6, &addr); + } + } + + total_size = sizeof(struct addrinfo) + sizeof(struct sockaddr_storage); + if (nodename != NULL) { + namelen = strlen(nodename); + if (namelen > DNS_MAX_NAME_LENGTH) { + /* invalid name length */ + return EAI_FAIL; + } + LWIP_ASSERT("namelen is too long", total_size + namelen + 1 > total_size); + total_size += namelen + 1; + } + /* If this fails, please report to lwip-devel! :-) */ + LWIP_ASSERT("total_size <= NETDB_ELEM_SIZE: please report this!", + total_size <= NETDB_ELEM_SIZE); + ai = (struct addrinfo *)memp_malloc(MEMP_NETDB); + if (ai == NULL) { + return EAI_MEMORY; + } + memset(ai, 0, total_size); + /* cast through void* to get rid of alignment warnings */ + sa = (struct sockaddr_storage *)(void*)((u8_t*)ai + sizeof(struct addrinfo)); + if (IP_IS_V6_VAL(addr)) { +#if LWIP_IPV6 + struct sockaddr_in6 *sa6 = (struct sockaddr_in6*)sa; + /* set up sockaddr */ + inet6_addr_from_ip6addr(&sa6->sin6_addr, ip_2_ip6(&addr)); + sa6->sin6_family = AF_INET6; + sa6->sin6_len = sizeof(struct sockaddr_in6); + sa6->sin6_port = lwip_htons((u16_t)port_nr); + ai->ai_family = AF_INET6; +#endif /* LWIP_IPV6 */ + } else { +#if LWIP_IPV4 + struct sockaddr_in *sa4 = (struct sockaddr_in*)sa; + /* set up sockaddr */ + inet_addr_from_ip4addr(&sa4->sin_addr, ip_2_ip4(&addr)); + sa4->sin_family = AF_INET; + sa4->sin_len = sizeof(struct sockaddr_in); + sa4->sin_port = lwip_htons((u16_t)port_nr); + ai->ai_family = AF_INET; +#endif /* LWIP_IPV4 */ + } + + /* set up addrinfo */ + if (hints != NULL) { + /* copy socktype & protocol from hints if specified */ + ai->ai_socktype = hints->ai_socktype; + ai->ai_protocol = hints->ai_protocol; + } + if (nodename != NULL) { + /* copy nodename to canonname if specified */ + ai->ai_canonname = ((char*)ai + sizeof(struct addrinfo) + sizeof(struct sockaddr_storage)); + MEMCPY(ai->ai_canonname, nodename, namelen); + ai->ai_canonname[namelen] = 0; + } + ai->ai_addrlen = sizeof(struct sockaddr_storage); + ai->ai_addr = (struct sockaddr*)sa; + + *res = ai; + + return 0; +} + +#endif /* LWIP_DNS && LWIP_SOCKET */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netifapi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netifapi.c new file mode 100644 index 0000000..fef05a3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/netifapi.c @@ -0,0 +1,221 @@ +/** + * @file + * Network Interface Sequential API module + * + * @defgroup netifapi NETIF API + * @ingroup sequential_api + * Thread-safe functions to be called from non-TCPIP threads + * + * @defgroup netifapi_netif NETIF related + * @ingroup netifapi + * To be called from non-TCPIP threads + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/opt.h" + +#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/netifapi.h" +#include "lwip/memp.h" +#include "lwip/priv/tcpip_priv.h" + +#define NETIFAPI_VAR_REF(name) API_VAR_REF(name) +#define NETIFAPI_VAR_DECLARE(name) API_VAR_DECLARE(struct netifapi_msg, name) +#define NETIFAPI_VAR_ALLOC(name) API_VAR_ALLOC(struct netifapi_msg, MEMP_NETIFAPI_MSG, name, ERR_MEM) +#define NETIFAPI_VAR_FREE(name) API_VAR_FREE(MEMP_NETIFAPI_MSG, name) + +/** + * Call netif_add() inside the tcpip_thread context. + */ +static err_t +netifapi_do_netif_add(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct netifapi_msg */ + struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; + + if (!netif_add( msg->netif, +#if LWIP_IPV4 + API_EXPR_REF(msg->msg.add.ipaddr), + API_EXPR_REF(msg->msg.add.netmask), + API_EXPR_REF(msg->msg.add.gw), +#endif /* LWIP_IPV4 */ + msg->msg.add.state, + msg->msg.add.init, + msg->msg.add.input)) { + return ERR_IF; + } else { + return ERR_OK; + } +} + +#if LWIP_IPV4 +/** + * Call netif_set_addr() inside the tcpip_thread context. + */ +static err_t +netifapi_do_netif_set_addr(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct netifapi_msg */ + struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; + + netif_set_addr( msg->netif, + API_EXPR_REF(msg->msg.add.ipaddr), + API_EXPR_REF(msg->msg.add.netmask), + API_EXPR_REF(msg->msg.add.gw)); + return ERR_OK; +} +#endif /* LWIP_IPV4 */ + +/** + * Call the "errtfunc" (or the "voidfunc" if "errtfunc" is NULL) inside the + * tcpip_thread context. + */ +static err_t +netifapi_do_netif_common(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct netifapi_msg */ + struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; + + if (msg->msg.common.errtfunc != NULL) { + return msg->msg.common.errtfunc(msg->netif); + } else { + msg->msg.common.voidfunc(msg->netif); + return ERR_OK; + } +} + +/** + * @ingroup netifapi_netif + * Call netif_add() in a thread-safe way by running that function inside the + * tcpip_thread context. + * + * @note for params @see netif_add() + */ +err_t +netifapi_netif_add(struct netif *netif, +#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, +#endif /* LWIP_IPV4 */ + void *state, netif_init_fn init, netif_input_fn input) +{ + err_t err; + NETIFAPI_VAR_DECLARE(msg); + NETIFAPI_VAR_ALLOC(msg); + +#if LWIP_IPV4 + if (ipaddr == NULL) { + ipaddr = IP4_ADDR_ANY4; + } + if (netmask == NULL) { + netmask = IP4_ADDR_ANY4; + } + if (gw == NULL) { + gw = IP4_ADDR_ANY4; + } +#endif /* LWIP_IPV4 */ + + NETIFAPI_VAR_REF(msg).netif = netif; +#if LWIP_IPV4 + NETIFAPI_VAR_REF(msg).msg.add.ipaddr = NETIFAPI_VAR_REF(ipaddr); + NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask); + NETIFAPI_VAR_REF(msg).msg.add.gw = NETIFAPI_VAR_REF(gw); +#endif /* LWIP_IPV4 */ + NETIFAPI_VAR_REF(msg).msg.add.state = state; + NETIFAPI_VAR_REF(msg).msg.add.init = init; + NETIFAPI_VAR_REF(msg).msg.add.input = input; + err = tcpip_api_call(netifapi_do_netif_add, &API_VAR_REF(msg).call); + NETIFAPI_VAR_FREE(msg); + return err; +} + +#if LWIP_IPV4 +/** + * @ingroup netifapi_netif + * Call netif_set_addr() in a thread-safe way by running that function inside the + * tcpip_thread context. + * + * @note for params @see netif_set_addr() + */ +err_t +netifapi_netif_set_addr(struct netif *netif, + const ip4_addr_t *ipaddr, + const ip4_addr_t *netmask, + const ip4_addr_t *gw) +{ + err_t err; + NETIFAPI_VAR_DECLARE(msg); + NETIFAPI_VAR_ALLOC(msg); + + if (ipaddr == NULL) { + ipaddr = IP4_ADDR_ANY4; + } + if (netmask == NULL) { + netmask = IP4_ADDR_ANY4; + } + if (gw == NULL) { + gw = IP4_ADDR_ANY4; + } + + NETIFAPI_VAR_REF(msg).netif = netif; + NETIFAPI_VAR_REF(msg).msg.add.ipaddr = NETIFAPI_VAR_REF(ipaddr); + NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask); + NETIFAPI_VAR_REF(msg).msg.add.gw = NETIFAPI_VAR_REF(gw); + err = tcpip_api_call(netifapi_do_netif_set_addr, &API_VAR_REF(msg).call); + NETIFAPI_VAR_FREE(msg); + return err; +} +#endif /* LWIP_IPV4 */ + +/** + * call the "errtfunc" (or the "voidfunc" if "errtfunc" is NULL) in a thread-safe + * way by running that function inside the tcpip_thread context. + * + * @note use only for functions where there is only "netif" parameter. + */ +err_t +netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc, + netifapi_errt_fn errtfunc) +{ + err_t err; + NETIFAPI_VAR_DECLARE(msg); + NETIFAPI_VAR_ALLOC(msg); + + NETIFAPI_VAR_REF(msg).netif = netif; + NETIFAPI_VAR_REF(msg).msg.common.voidfunc = voidfunc; + NETIFAPI_VAR_REF(msg).msg.common.errtfunc = errtfunc; + err = tcpip_api_call(netifapi_do_netif_common, &API_VAR_REF(msg).call); + NETIFAPI_VAR_FREE(msg); + return err; +} + +#endif /* LWIP_NETIF_API */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/sockets.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/sockets.c new file mode 100644 index 0000000..b763248 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/sockets.c @@ -0,0 +1,2827 @@ +/** + * @file + * Sockets BSD-Like API module + * + * @defgroup socket Socket API + * @ingroup sequential_api + * BSD-style socket API.\n + * Thread-safe, to be called from non-TCPIP threads only.\n + * Can be activated by defining @ref LWIP_SOCKET to 1.\n + * Header is in posix/sys/socket.h\b + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + * Improved by Marc Boucher and David Haas + * + */ + +#include "lwip/opt.h" + +#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/sockets.h" +#include "lwip/api.h" +#include "lwip/sys.h" +#include "lwip/igmp.h" +#include "lwip/inet.h" +#include "lwip/tcp.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/memp.h" +#include "lwip/pbuf.h" +#include "lwip/priv/tcpip_priv.h" +#if LWIP_CHECKSUM_ON_COPY +#include "lwip/inet_chksum.h" +#endif + +#include + +/* If the netconn API is not required publicly, then we include the necessary + files here to get the implementation */ +#if !LWIP_NETCONN +#undef LWIP_NETCONN +#define LWIP_NETCONN 1 +#include "api_msg.c" +#include "api_lib.c" +#include "netbuf.c" +#undef LWIP_NETCONN +#define LWIP_NETCONN 0 +#endif + +#if LWIP_IPV4 +#define IP4ADDR_PORT_TO_SOCKADDR(sin, ipaddr, port) do { \ + (sin)->sin_len = sizeof(struct sockaddr_in); \ + (sin)->sin_family = AF_INET; \ + (sin)->sin_port = lwip_htons((port)); \ + inet_addr_from_ip4addr(&(sin)->sin_addr, ipaddr); \ + memset((sin)->sin_zero, 0, SIN_ZERO_LEN); }while(0) +#define SOCKADDR4_TO_IP4ADDR_PORT(sin, ipaddr, port) do { \ + inet_addr_to_ip4addr(ip_2_ip4(ipaddr), &((sin)->sin_addr)); \ + (port) = lwip_ntohs((sin)->sin_port); }while(0) +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +#define IP6ADDR_PORT_TO_SOCKADDR(sin6, ipaddr, port) do { \ + (sin6)->sin6_len = sizeof(struct sockaddr_in6); \ + (sin6)->sin6_family = AF_INET6; \ + (sin6)->sin6_port = lwip_htons((port)); \ + (sin6)->sin6_flowinfo = 0; \ + inet6_addr_from_ip6addr(&(sin6)->sin6_addr, ipaddr); \ + (sin6)->sin6_scope_id = 0; }while(0) +#define SOCKADDR6_TO_IP6ADDR_PORT(sin6, ipaddr, port) do { \ + inet6_addr_to_ip6addr(ip_2_ip6(ipaddr), &((sin6)->sin6_addr)); \ + (port) = lwip_ntohs((sin6)->sin6_port); }while(0) +#endif /* LWIP_IPV6 */ + +#if LWIP_IPV4 && LWIP_IPV6 +static void sockaddr_to_ipaddr_port(const struct sockaddr* sockaddr, ip_addr_t* ipaddr, u16_t* port); + +#define IS_SOCK_ADDR_LEN_VALID(namelen) (((namelen) == sizeof(struct sockaddr_in)) || \ + ((namelen) == sizeof(struct sockaddr_in6))) +#define IS_SOCK_ADDR_TYPE_VALID(name) (((name)->sa_family == AF_INET) || \ + ((name)->sa_family == AF_INET6)) +#define SOCK_ADDR_TYPE_MATCH(name, sock) \ + ((((name)->sa_family == AF_INET) && !(NETCONNTYPE_ISIPV6((sock)->conn->type))) || \ + (((name)->sa_family == AF_INET6) && (NETCONNTYPE_ISIPV6((sock)->conn->type)))) +#define IPADDR_PORT_TO_SOCKADDR(sockaddr, ipaddr, port) do { \ + if (IP_IS_V6(ipaddr)) { \ + IP6ADDR_PORT_TO_SOCKADDR((struct sockaddr_in6*)(void*)(sockaddr), ip_2_ip6(ipaddr), port); \ + } else { \ + IP4ADDR_PORT_TO_SOCKADDR((struct sockaddr_in*)(void*)(sockaddr), ip_2_ip4(ipaddr), port); \ + } } while(0) +#define SOCKADDR_TO_IPADDR_PORT(sockaddr, ipaddr, port) sockaddr_to_ipaddr_port(sockaddr, ipaddr, &(port)) +#define DOMAIN_TO_NETCONN_TYPE(domain, type) (((domain) == AF_INET) ? \ + (type) : (enum netconn_type)((type) | NETCONN_TYPE_IPV6)) +#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ +#define IS_SOCK_ADDR_LEN_VALID(namelen) ((namelen) == sizeof(struct sockaddr_in6)) +#define IS_SOCK_ADDR_TYPE_VALID(name) ((name)->sa_family == AF_INET6) +#define SOCK_ADDR_TYPE_MATCH(name, sock) 1 +#define IPADDR_PORT_TO_SOCKADDR(sockaddr, ipaddr, port) \ + IP6ADDR_PORT_TO_SOCKADDR((struct sockaddr_in6*)(void*)(sockaddr), ip_2_ip6(ipaddr), port) +#define SOCKADDR_TO_IPADDR_PORT(sockaddr, ipaddr, port) \ + SOCKADDR6_TO_IP6ADDR_PORT((const struct sockaddr_in6*)(const void*)(sockaddr), ipaddr, port) +#define DOMAIN_TO_NETCONN_TYPE(domain, netconn_type) (netconn_type) +#else /*-> LWIP_IPV4: LWIP_IPV4 && LWIP_IPV6 */ +#define IS_SOCK_ADDR_LEN_VALID(namelen) ((namelen) == sizeof(struct sockaddr_in)) +#define IS_SOCK_ADDR_TYPE_VALID(name) ((name)->sa_family == AF_INET) +#define SOCK_ADDR_TYPE_MATCH(name, sock) 1 +#define IPADDR_PORT_TO_SOCKADDR(sockaddr, ipaddr, port) \ + IP4ADDR_PORT_TO_SOCKADDR((struct sockaddr_in*)(void*)(sockaddr), ip_2_ip4(ipaddr), port) +#define SOCKADDR_TO_IPADDR_PORT(sockaddr, ipaddr, port) \ + SOCKADDR4_TO_IP4ADDR_PORT((const struct sockaddr_in*)(const void*)(sockaddr), ipaddr, port) +#define DOMAIN_TO_NETCONN_TYPE(domain, netconn_type) (netconn_type) +#endif /* LWIP_IPV6 */ + +#define IS_SOCK_ADDR_TYPE_VALID_OR_UNSPEC(name) (((name)->sa_family == AF_UNSPEC) || \ + IS_SOCK_ADDR_TYPE_VALID(name)) +#define SOCK_ADDR_TYPE_MATCH_OR_UNSPEC(name, sock) (((name)->sa_family == AF_UNSPEC) || \ + SOCK_ADDR_TYPE_MATCH(name, sock)) +#define IS_SOCK_ADDR_ALIGNED(name) ((((mem_ptr_t)(name)) % 4) == 0) + + +#define LWIP_SOCKOPT_CHECK_OPTLEN(optlen, opttype) do { if ((optlen) < sizeof(opttype)) { return EINVAL; }}while(0) +#define LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, opttype) do { \ + LWIP_SOCKOPT_CHECK_OPTLEN(optlen, opttype); \ + if ((sock)->conn == NULL) { return EINVAL; } }while(0) +#define LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, opttype) do { \ + LWIP_SOCKOPT_CHECK_OPTLEN(optlen, opttype); \ + if (((sock)->conn == NULL) || ((sock)->conn->pcb.tcp == NULL)) { return EINVAL; } }while(0) +#define LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, opttype, netconntype) do { \ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, opttype); \ + if (NETCONNTYPE_GROUP(netconn_type((sock)->conn)) != netconntype) { return ENOPROTOOPT; } }while(0) + + +#define LWIP_SETGETSOCKOPT_DATA_VAR_REF(name) API_VAR_REF(name) +#define LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(name) API_VAR_DECLARE(struct lwip_setgetsockopt_data, name) +#define LWIP_SETGETSOCKOPT_DATA_VAR_FREE(name) API_VAR_FREE(MEMP_SOCKET_SETGETSOCKOPT_DATA, name) +#if LWIP_MPU_COMPATIBLE +#define LWIP_SETGETSOCKOPT_DATA_VAR_ALLOC(name, sock) do { \ + name = (struct lwip_setgetsockopt_data *)memp_malloc(MEMP_SOCKET_SETGETSOCKOPT_DATA); \ + if (name == NULL) { \ + sock_set_errno(sock, ENOMEM); \ + return -1; \ + } }while(0) +#else /* LWIP_MPU_COMPATIBLE */ +#define LWIP_SETGETSOCKOPT_DATA_VAR_ALLOC(name, sock) +#endif /* LWIP_MPU_COMPATIBLE */ + +#if LWIP_SO_SNDRCVTIMEO_NONSTANDARD +#define LWIP_SO_SNDRCVTIMEO_OPTTYPE int +#define LWIP_SO_SNDRCVTIMEO_SET(optval, val) (*(int *)(optval) = (val)) +#define LWIP_SO_SNDRCVTIMEO_GET_MS(optval) ((s32_t)*(const int*)(optval)) +#else +#define LWIP_SO_SNDRCVTIMEO_OPTTYPE struct timeval +#define LWIP_SO_SNDRCVTIMEO_SET(optval, val) do { \ + s32_t loc = (val); \ + ((struct timeval *)(optval))->tv_sec = (loc) / 1000U; \ + ((struct timeval *)(optval))->tv_usec = ((loc) % 1000U) * 1000U; }while(0) +#define LWIP_SO_SNDRCVTIMEO_GET_MS(optval) ((((const struct timeval *)(optval))->tv_sec * 1000U) + (((const struct timeval *)(optval))->tv_usec / 1000U)) +#endif + +#define NUM_SOCKETS MEMP_NUM_NETCONN + +/** This is overridable for the rare case where more than 255 threads + * select on the same socket... + */ +#ifndef SELWAIT_T +#define SELWAIT_T u8_t +#endif + +/** Contains all internal pointers and states used for a socket */ +struct lwip_sock { + /** sockets currently are built on netconns, each socket has one netconn */ + struct netconn *conn; + /** data that was left from the previous read */ + void *lastdata; + /** offset in the data that was left from the previous read */ + u16_t lastoffset; + /** number of times data was received, set by event_callback(), + tested by the receive and select functions */ + s16_t rcvevent; + /** number of times data was ACKed (free send buffer), set by event_callback(), + tested by select */ + u16_t sendevent; + /** error happened for this socket, set by event_callback(), tested by select */ + u16_t errevent; + /** last error that occurred on this socket (in fact, all our errnos fit into an u8_t) */ + u8_t err; + /** counter of how many threads are waiting for this socket using select */ + SELWAIT_T select_waiting; +}; + +#if LWIP_NETCONN_SEM_PER_THREAD +#define SELECT_SEM_T sys_sem_t* +#define SELECT_SEM_PTR(sem) (sem) +#else /* LWIP_NETCONN_SEM_PER_THREAD */ +#define SELECT_SEM_T sys_sem_t +#define SELECT_SEM_PTR(sem) (&(sem)) +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + +/** Description for a task waiting in select */ +struct lwip_select_cb { + /** Pointer to the next waiting task */ + struct lwip_select_cb *next; + /** Pointer to the previous waiting task */ + struct lwip_select_cb *prev; + /** readset passed to select */ + fd_set *readset; + /** writeset passed to select */ + fd_set *writeset; + /** unimplemented: exceptset passed to select */ + fd_set *exceptset; + /** don't signal the same semaphore twice: set to 1 when signalled */ + int sem_signalled; + /** semaphore to wake up a task waiting for select */ + SELECT_SEM_T sem; +}; + +/** A struct sockaddr replacement that has the same alignment as sockaddr_in/ + * sockaddr_in6 if instantiated. + */ +union sockaddr_aligned { + struct sockaddr sa; +#if LWIP_IPV6 + struct sockaddr_in6 sin6; +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + struct sockaddr_in sin; +#endif /* LWIP_IPV4 */ +}; + +#if LWIP_IGMP +/* Define the number of IPv4 multicast memberships, default is one per socket */ +#ifndef LWIP_SOCKET_MAX_MEMBERSHIPS +#define LWIP_SOCKET_MAX_MEMBERSHIPS NUM_SOCKETS +#endif + +/* This is to keep track of IP_ADD_MEMBERSHIP calls to drop the membership when + a socket is closed */ +struct lwip_socket_multicast_pair { + /** the socket */ + struct lwip_sock* sock; + /** the interface address */ + ip4_addr_t if_addr; + /** the group address */ + ip4_addr_t multi_addr; +}; + +struct lwip_socket_multicast_pair socket_ipv4_multicast_memberships[LWIP_SOCKET_MAX_MEMBERSHIPS]; + +static int lwip_socket_register_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr); +static void lwip_socket_unregister_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr); +static void lwip_socket_drop_registered_memberships(int s); +#endif /* LWIP_IGMP */ + +/** The global array of available sockets */ +static struct lwip_sock sockets[NUM_SOCKETS]; +/** The global list of tasks waiting for select */ +static struct lwip_select_cb *select_cb_list; +/** This counter is increased from lwip_select when the list is changed + and checked in event_callback to see if it has changed. */ +static volatile int select_cb_ctr; + +#if LWIP_SOCKET_SET_ERRNO +#ifndef set_errno +#define set_errno(err) do { if (err) { errno = (err); } } while(0) +#endif +#else /* LWIP_SOCKET_SET_ERRNO */ +#define set_errno(err) +#endif /* LWIP_SOCKET_SET_ERRNO */ + +#define sock_set_errno(sk, e) do { \ + const int sockerr = (e); \ + sk->err = (u8_t)sockerr; \ + set_errno(sockerr); \ +} while (0) + +/* Forward declaration of some functions */ +static void event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len); +#if !LWIP_TCPIP_CORE_LOCKING +static void lwip_getsockopt_callback(void *arg); +static void lwip_setsockopt_callback(void *arg); +#endif +static u8_t lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen); +static u8_t lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen); + +#if LWIP_IPV4 && LWIP_IPV6 +static void +sockaddr_to_ipaddr_port(const struct sockaddr* sockaddr, ip_addr_t* ipaddr, u16_t* port) +{ + if ((sockaddr->sa_family) == AF_INET6) { + SOCKADDR6_TO_IP6ADDR_PORT((const struct sockaddr_in6*)(const void*)(sockaddr), ipaddr, *port); + ipaddr->type = IPADDR_TYPE_V6; + } else { + SOCKADDR4_TO_IP4ADDR_PORT((const struct sockaddr_in*)(const void*)(sockaddr), ipaddr, *port); + ipaddr->type = IPADDR_TYPE_V4; + } +} +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +/** LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */ +void +lwip_socket_thread_init(void) +{ + netconn_thread_init(); +} + +/** LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore */ +void +lwip_socket_thread_cleanup(void) +{ + netconn_thread_cleanup(); +} + +/** + * Map a externally used socket index to the internal socket representation. + * + * @param s externally used socket index + * @return struct lwip_sock for the socket or NULL if not found + */ +static struct lwip_sock * +get_socket(int s) +{ + struct lwip_sock *sock; + + s -= LWIP_SOCKET_OFFSET; + + if ((s < 0) || (s >= NUM_SOCKETS)) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): invalid\n", s + LWIP_SOCKET_OFFSET)); + set_errno(EBADF); + return NULL; + } + + sock = &sockets[s]; + + if (!sock->conn) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): not active\n", s + LWIP_SOCKET_OFFSET)); + set_errno(EBADF); + return NULL; + } + + return sock; +} + +/** + * Same as get_socket but doesn't set errno + * + * @param s externally used socket index + * @return struct lwip_sock for the socket or NULL if not found + */ +static struct lwip_sock * +tryget_socket(int s) +{ + s -= LWIP_SOCKET_OFFSET; + if ((s < 0) || (s >= NUM_SOCKETS)) { + return NULL; + } + if (!sockets[s].conn) { + return NULL; + } + return &sockets[s]; +} + +/** + * Allocate a new socket for a given netconn. + * + * @param newconn the netconn for which to allocate a socket + * @param accepted 1 if socket has been created by accept(), + * 0 if socket has been created by socket() + * @return the index of the new socket; -1 on error + */ +static int +alloc_socket(struct netconn *newconn, int accepted) +{ + int i; + SYS_ARCH_DECL_PROTECT(lev); + + /* allocate a new socket identifier */ + for (i = 0; i < NUM_SOCKETS; ++i) { + /* Protect socket array */ + SYS_ARCH_PROTECT(lev); + if (!sockets[i].conn && (sockets[i].select_waiting == 0)) { + sockets[i].conn = newconn; + /* The socket is not yet known to anyone, so no need to protect + after having marked it as used. */ + SYS_ARCH_UNPROTECT(lev); + sockets[i].lastdata = NULL; + sockets[i].lastoffset = 0; + sockets[i].rcvevent = 0; + /* TCP sendbuf is empty, but the socket is not yet writable until connected + * (unless it has been created by accept()). */ + sockets[i].sendevent = (NETCONNTYPE_GROUP(newconn->type) == NETCONN_TCP ? (accepted != 0) : 1); + sockets[i].errevent = 0; + sockets[i].err = 0; + return i + LWIP_SOCKET_OFFSET; + } + SYS_ARCH_UNPROTECT(lev); + } + return -1; +} + +/** Free a socket. The socket's netconn must have been + * delete before! + * + * @param sock the socket to free + * @param is_tcp != 0 for TCP sockets, used to free lastdata + */ +static void +free_socket(struct lwip_sock *sock, int is_tcp) +{ + void *lastdata; + + lastdata = sock->lastdata; + sock->lastdata = NULL; + sock->lastoffset = 0; + sock->err = 0; + + /* Protect socket array */ + SYS_ARCH_SET(sock->conn, NULL); + /* don't use 'sock' after this line, as another task might have allocated it */ + + if (lastdata != NULL) { + if (is_tcp) { + pbuf_free((struct pbuf *)lastdata); + } else { + netbuf_delete((struct netbuf *)lastdata); + } + } +} + +/* Below this, the well-known socket functions are implemented. + * Use google.com or opengroup.org to get a good description :-) + * + * Exceptions are documented! + */ + +int +lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen) +{ + struct lwip_sock *sock, *nsock; + struct netconn *newconn; + ip_addr_t naddr; + u16_t port = 0; + int newsock; + err_t err; + SYS_ARCH_DECL_PROTECT(lev); + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d)...\n", s)); + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (netconn_is_nonblocking(sock->conn) && (sock->rcvevent <= 0)) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): returning EWOULDBLOCK\n", s)); + set_errno(EWOULDBLOCK); + return -1; + } + + /* wait for a new connection */ + err = netconn_accept(sock->conn, &newconn); + if (err != ERR_OK) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err)); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + sock_set_errno(sock, EOPNOTSUPP); + } else if (err == ERR_CLSD) { + sock_set_errno(sock, EINVAL); + } else { + sock_set_errno(sock, err_to_errno(err)); + } + return -1; + } + LWIP_ASSERT("newconn != NULL", newconn != NULL); + + newsock = alloc_socket(newconn, 1); + if (newsock == -1) { + netconn_delete(newconn); + sock_set_errno(sock, ENFILE); + return -1; + } + LWIP_ASSERT("invalid socket index", (newsock >= LWIP_SOCKET_OFFSET) && (newsock < NUM_SOCKETS + LWIP_SOCKET_OFFSET)); + LWIP_ASSERT("newconn->callback == event_callback", newconn->callback == event_callback); + nsock = &sockets[newsock - LWIP_SOCKET_OFFSET]; + + /* See event_callback: If data comes in right away after an accept, even + * though the server task might not have created a new socket yet. + * In that case, newconn->socket is counted down (newconn->socket--), + * so nsock->rcvevent is >= 1 here! + */ + SYS_ARCH_PROTECT(lev); + nsock->rcvevent += (s16_t)(-1 - newconn->socket); + newconn->socket = newsock; + SYS_ARCH_UNPROTECT(lev); + + /* Note that POSIX only requires us to check addr is non-NULL. addrlen must + * not be NULL if addr is valid. + */ + if (addr != NULL) { + union sockaddr_aligned tempaddr; + /* get the IP address and port of the remote host */ + err = netconn_peer(newconn, &naddr, &port); + if (err != ERR_OK) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err)); + netconn_delete(newconn); + free_socket(nsock, 1); + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + LWIP_ASSERT("addr valid but addrlen NULL", addrlen != NULL); + + IPADDR_PORT_TO_SOCKADDR(&tempaddr, &naddr, port); + if (*addrlen > tempaddr.sa.sa_len) { + *addrlen = tempaddr.sa.sa_len; + } + MEMCPY(addr, &tempaddr, *addrlen); + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d) returning new sock=%d addr=", s, newsock)); + ip_addr_debug_print_val(SOCKETS_DEBUG, naddr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F"\n", port)); + } else { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d) returning new sock=%d", s, newsock)); + } + + sock_set_errno(sock, 0); + return newsock; +} + +int +lwip_bind(int s, const struct sockaddr *name, socklen_t namelen) +{ + struct lwip_sock *sock; + ip_addr_t local_addr; + u16_t local_port; + err_t err; + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (!SOCK_ADDR_TYPE_MATCH(name, sock)) { + /* sockaddr does not match socket type (IPv4/IPv6) */ + sock_set_errno(sock, err_to_errno(ERR_VAL)); + return -1; + } + + /* check size, family and alignment of 'name' */ + LWIP_ERROR("lwip_bind: invalid address", (IS_SOCK_ADDR_LEN_VALID(namelen) && + IS_SOCK_ADDR_TYPE_VALID(name) && IS_SOCK_ADDR_ALIGNED(name)), + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + LWIP_UNUSED_ARG(namelen); + + SOCKADDR_TO_IPADDR_PORT(name, &local_addr, local_port); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d, addr=", s)); + ip_addr_debug_print_val(SOCKETS_DEBUG, local_addr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", local_port)); + +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Unmap IPv4 mapped IPv6 addresses */ + if (IP_IS_V6_VAL(local_addr) && ip6_addr_isipv4mappedipv6(ip_2_ip6(&local_addr))) { + unmap_ipv4_mapped_ipv6(ip_2_ip4(&local_addr), ip_2_ip6(&local_addr)); + IP_SET_TYPE_VAL(local_addr, IPADDR_TYPE_V4); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + err = netconn_bind(sock->conn, &local_addr, local_port); + + if (err != ERR_OK) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) failed, err=%d\n", s, err)); + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_bind(%d) succeeded\n", s)); + sock_set_errno(sock, 0); + return 0; +} + +int +lwip_close(int s) +{ + struct lwip_sock *sock; + int is_tcp = 0; + err_t err; + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_close(%d)\n", s)); + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (sock->conn != NULL) { + is_tcp = NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP; + } else { + LWIP_ASSERT("sock->lastdata == NULL", sock->lastdata == NULL); + } + +#if LWIP_IGMP + /* drop all possibly joined IGMP memberships */ + lwip_socket_drop_registered_memberships(s); +#endif /* LWIP_IGMP */ + + err = netconn_delete(sock->conn); + if (err != ERR_OK) { + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + + free_socket(sock, is_tcp); + set_errno(0); + return 0; +} + +int +lwip_connect(int s, const struct sockaddr *name, socklen_t namelen) +{ + struct lwip_sock *sock; + err_t err; + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (!SOCK_ADDR_TYPE_MATCH_OR_UNSPEC(name, sock)) { + /* sockaddr does not match socket type (IPv4/IPv6) */ + sock_set_errno(sock, err_to_errno(ERR_VAL)); + return -1; + } + + LWIP_UNUSED_ARG(namelen); + if (name->sa_family == AF_UNSPEC) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d, AF_UNSPEC)\n", s)); + err = netconn_disconnect(sock->conn); + } else { + ip_addr_t remote_addr; + u16_t remote_port; + + /* check size, family and alignment of 'name' */ + LWIP_ERROR("lwip_connect: invalid address", IS_SOCK_ADDR_LEN_VALID(namelen) && + IS_SOCK_ADDR_TYPE_VALID_OR_UNSPEC(name) && IS_SOCK_ADDR_ALIGNED(name), + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + + SOCKADDR_TO_IPADDR_PORT(name, &remote_addr, remote_port); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d, addr=", s)); + ip_addr_debug_print_val(SOCKETS_DEBUG, remote_addr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", remote_port)); + +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Unmap IPv4 mapped IPv6 addresses */ + if (IP_IS_V6_VAL(remote_addr) && ip6_addr_isipv4mappedipv6(ip_2_ip6(&remote_addr))) { + unmap_ipv4_mapped_ipv6(ip_2_ip4(&remote_addr), ip_2_ip6(&remote_addr)); + IP_SET_TYPE_VAL(remote_addr, IPADDR_TYPE_V4); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + err = netconn_connect(sock->conn, &remote_addr, remote_port); + } + + if (err != ERR_OK) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d) failed, err=%d\n", s, err)); + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_connect(%d) succeeded\n", s)); + sock_set_errno(sock, 0); + return 0; +} + +/** + * Set a socket into listen mode. + * The socket may not have been used for another connection previously. + * + * @param s the socket to set to listening mode + * @param backlog (ATTENTION: needs TCP_LISTEN_BACKLOG=1) + * @return 0 on success, non-zero on failure + */ +int +lwip_listen(int s, int backlog) +{ + struct lwip_sock *sock; + err_t err; + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d, backlog=%d)\n", s, backlog)); + + sock = get_socket(s); + if (!sock) { + return -1; + } + + /* limit the "backlog" parameter to fit in an u8_t */ + backlog = LWIP_MIN(LWIP_MAX(backlog, 0), 0xff); + + err = netconn_listen_with_backlog(sock->conn, (u8_t)backlog); + + if (err != ERR_OK) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_listen(%d) failed, err=%d\n", s, err)); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + sock_set_errno(sock, EOPNOTSUPP); + return -1; + } + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + + sock_set_errno(sock, 0); + return 0; +} + +int +lwip_recvfrom(int s, void *mem, size_t len, int flags, + struct sockaddr *from, socklen_t *fromlen) +{ + struct lwip_sock *sock; + void *buf = NULL; + struct pbuf *p; + u16_t buflen, copylen; + int off = 0; + u8_t done = 0; + err_t err; + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d, %p, %"SZT_F", 0x%x, ..)\n", s, mem, len, flags)); + sock = get_socket(s); + if (!sock) { + return -1; + } + + do { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: top while sock->lastdata=%p\n", sock->lastdata)); + /* Check if there is data left from the last recv operation. */ + if (sock->lastdata) { + buf = sock->lastdata; + } else { + /* If this is non-blocking call, then check first */ + if (((flags & MSG_DONTWAIT) || netconn_is_nonblocking(sock->conn)) && + (sock->rcvevent <= 0)) { + if (off > 0) { + /* already received data, return that */ + sock_set_errno(sock, 0); + return off; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): returning EWOULDBLOCK\n", s)); + set_errno(EWOULDBLOCK); + return -1; + } + + /* No data was left from the previous operation, so we try to get + some from the network. */ + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { + err = netconn_recv_tcp_pbuf(sock->conn, (struct pbuf **)&buf); + } else { + err = netconn_recv(sock->conn, (struct netbuf **)&buf); + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: netconn_recv err=%d, netbuf=%p\n", + err, buf)); + + if (err != ERR_OK) { + if (off > 0) { + if (err == ERR_CLSD) { + /* closed but already received data, ensure select gets the FIN, too */ + event_callback(sock->conn, NETCONN_EVT_RCVPLUS, 0); + } + /* already received data, return that */ + sock_set_errno(sock, 0); + return off; + } + /* We should really do some error checking here. */ + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): buf == NULL, error is \"%s\"!\n", + s, lwip_strerr(err))); + sock_set_errno(sock, err_to_errno(err)); + if (err == ERR_CLSD) { + return 0; + } else { + return -1; + } + } + LWIP_ASSERT("buf != NULL", buf != NULL); + sock->lastdata = buf; + } + + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { + p = (struct pbuf *)buf; + } else { + p = ((struct netbuf *)buf)->p; + } + buflen = p->tot_len; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: buflen=%"U16_F" len=%"SZT_F" off=%d sock->lastoffset=%"U16_F"\n", + buflen, len, off, sock->lastoffset)); + + buflen -= sock->lastoffset; + + if (len > buflen) { + copylen = buflen; + } else { + copylen = (u16_t)len; + } + + /* copy the contents of the received buffer into + the supplied memory pointer mem */ + pbuf_copy_partial(p, (u8_t*)mem + off, copylen, sock->lastoffset); + + off += copylen; + + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { + LWIP_ASSERT("invalid copylen, len would underflow", len >= copylen); + len -= copylen; + if ((len <= 0) || + (p->flags & PBUF_FLAG_PUSH) || + (sock->rcvevent <= 0) || + ((flags & MSG_PEEK) != 0)) { + done = 1; + } + } else { + done = 1; + } + + /* Check to see from where the data was.*/ + if (done) { +#if !SOCKETS_DEBUG + if (from && fromlen) +#endif /* !SOCKETS_DEBUG */ + { + u16_t port; + ip_addr_t tmpaddr; + ip_addr_t *fromaddr; + union sockaddr_aligned saddr; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): addr=", s)); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { + fromaddr = &tmpaddr; + netconn_getaddr(sock->conn, fromaddr, &port, 0); + } else { + port = netbuf_fromport((struct netbuf *)buf); + fromaddr = netbuf_fromaddr((struct netbuf *)buf); + } + +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Map IPv4 addresses to IPv4 mapped IPv6 */ + if (NETCONNTYPE_ISIPV6(netconn_type(sock->conn)) && IP_IS_V4(fromaddr)) { + ip4_2_ipv4_mapped_ipv6(ip_2_ip6(fromaddr), ip_2_ip4(fromaddr)); + IP_SET_TYPE(fromaddr, IPADDR_TYPE_V6); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + IPADDR_PORT_TO_SOCKADDR(&saddr, fromaddr, port); + ip_addr_debug_print(SOCKETS_DEBUG, fromaddr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F" len=%d\n", port, off)); +#if SOCKETS_DEBUG + if (from && fromlen) +#endif /* SOCKETS_DEBUG */ + { + if (*fromlen > saddr.sa.sa_len) { + *fromlen = saddr.sa.sa_len; + } + MEMCPY(from, &saddr, *fromlen); + } + } + } + + /* If we don't peek the incoming message... */ + if ((flags & MSG_PEEK) == 0) { + /* If this is a TCP socket, check if there is data left in the + buffer. If so, it should be saved in the sock structure for next + time around. */ + if ((NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) && (buflen - copylen > 0)) { + sock->lastdata = buf; + sock->lastoffset += copylen; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: lastdata now netbuf=%p\n", buf)); + } else { + sock->lastdata = NULL; + sock->lastoffset = 0; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: deleting netbuf=%p\n", buf)); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { + pbuf_free((struct pbuf *)buf); + } else { + netbuf_delete((struct netbuf *)buf); + } + buf = NULL; + } + } + } while (!done); + + sock_set_errno(sock, 0); + return off; +} + +int +lwip_read(int s, void *mem, size_t len) +{ + return lwip_recvfrom(s, mem, len, 0, NULL, NULL); +} + +int +lwip_recv(int s, void *mem, size_t len, int flags) +{ + return lwip_recvfrom(s, mem, len, flags, NULL, NULL); +} + +int +lwip_send(int s, const void *data, size_t size, int flags) +{ + struct lwip_sock *sock; + err_t err; + u8_t write_flags; + size_t written; + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d, data=%p, size=%"SZT_F", flags=0x%x)\n", + s, data, size, flags)); + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { +#if (LWIP_UDP || LWIP_RAW) + return lwip_sendto(s, data, size, flags, NULL, 0); +#else /* (LWIP_UDP || LWIP_RAW) */ + sock_set_errno(sock, err_to_errno(ERR_ARG)); + return -1; +#endif /* (LWIP_UDP || LWIP_RAW) */ + } + + write_flags = NETCONN_COPY | + ((flags & MSG_MORE) ? NETCONN_MORE : 0) | + ((flags & MSG_DONTWAIT) ? NETCONN_DONTBLOCK : 0); + written = 0; + err = netconn_write_partly(sock->conn, data, size, write_flags, &written); + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_send(%d) err=%d written=%"SZT_F"\n", s, err, written)); + sock_set_errno(sock, err_to_errno(err)); + return (err == ERR_OK ? (int)written : -1); +} + +int +lwip_sendmsg(int s, const struct msghdr *msg, int flags) +{ + struct lwip_sock *sock; + int i; +#if LWIP_TCP + u8_t write_flags; + size_t written; +#endif + int size = 0; + err_t err = ERR_OK; + + sock = get_socket(s); + if (!sock) { + return -1; + } + + LWIP_ERROR("lwip_sendmsg: invalid msghdr", msg != NULL, + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + + LWIP_UNUSED_ARG(msg->msg_control); + LWIP_UNUSED_ARG(msg->msg_controllen); + LWIP_UNUSED_ARG(msg->msg_flags); + LWIP_ERROR("lwip_sendmsg: invalid msghdr iov", (msg->msg_iov != NULL && msg->msg_iovlen != 0), + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { +#if LWIP_TCP + write_flags = NETCONN_COPY | + ((flags & MSG_MORE) ? NETCONN_MORE : 0) | + ((flags & MSG_DONTWAIT) ? NETCONN_DONTBLOCK : 0); + + for (i = 0; i < msg->msg_iovlen; i++) { + u8_t apiflags = write_flags; + if (i + 1 < msg->msg_iovlen) { + apiflags |= NETCONN_MORE; + } + written = 0; + err = netconn_write_partly(sock->conn, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len, write_flags, &written); + if (err == ERR_OK) { + size += written; + /* check that the entire IO vector was accepected, if not return a partial write */ + if (written != msg->msg_iov[i].iov_len) + break; + } + /* none of this IO vector was accepted, but previous was, return partial write and conceal ERR_WOULDBLOCK */ + else if (err == ERR_WOULDBLOCK && size > 0) { + err = ERR_OK; + /* let ERR_WOULDBLOCK persist on the netconn since we are returning ERR_OK */ + break; + } else { + size = -1; + break; + } + } + sock_set_errno(sock, err_to_errno(err)); + return size; +#else /* LWIP_TCP */ + sock_set_errno(sock, err_to_errno(ERR_ARG)); + return -1; +#endif /* LWIP_TCP */ + } + /* else, UDP and RAW NETCONNs */ +#if LWIP_UDP || LWIP_RAW + { + struct netbuf *chain_buf; + + LWIP_UNUSED_ARG(flags); + LWIP_ERROR("lwip_sendmsg: invalid msghdr name", (((msg->msg_name == NULL) && (msg->msg_namelen == 0)) || + IS_SOCK_ADDR_LEN_VALID(msg->msg_namelen)) , + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + + /* initialize chain buffer with destination */ + chain_buf = netbuf_new(); + if (!chain_buf) { + sock_set_errno(sock, err_to_errno(ERR_MEM)); + return -1; + } + if (msg->msg_name) { + u16_t remote_port; + SOCKADDR_TO_IPADDR_PORT((const struct sockaddr *)msg->msg_name, &chain_buf->addr, remote_port); + netbuf_fromport(chain_buf) = remote_port; + } +#if LWIP_NETIF_TX_SINGLE_PBUF + for (i = 0; i < msg->msg_iovlen; i++) { + size += msg->msg_iov[i].iov_len; + } + /* Allocate a new netbuf and copy the data into it. */ + if (netbuf_alloc(chain_buf, (u16_t)size) == NULL) { + err = ERR_MEM; + } else { + /* flatten the IO vectors */ + size_t offset = 0; + for (i = 0; i < msg->msg_iovlen; i++) { + MEMCPY(&((u8_t*)chain_buf->p->payload)[offset], msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len); + offset += msg->msg_iov[i].iov_len; + } +#if LWIP_CHECKSUM_ON_COPY + { + /* This can be improved by using LWIP_CHKSUM_COPY() and aggregating the checksum for each IO vector */ + u16_t chksum = ~inet_chksum_pbuf(chain_buf->p); + netbuf_set_chksum(chain_buf, chksum); + } +#endif /* LWIP_CHECKSUM_ON_COPY */ + err = ERR_OK; + } +#else /* LWIP_NETIF_TX_SINGLE_PBUF */ + /* create a chained netbuf from the IO vectors. NOTE: we assemble a pbuf chain + manually to avoid having to allocate, chain, and delete a netbuf for each iov */ + for (i = 0; i < msg->msg_iovlen; i++) { + struct pbuf *p = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF); + if (p == NULL) { + err = ERR_MEM; /* let netbuf_delete() cleanup chain_buf */ + break; + } + p->payload = msg->msg_iov[i].iov_base; + LWIP_ASSERT("iov_len < u16_t", msg->msg_iov[i].iov_len <= 0xFFFF); + p->len = p->tot_len = (u16_t)msg->msg_iov[i].iov_len; + /* netbuf empty, add new pbuf */ + if (chain_buf->p == NULL) { + chain_buf->p = chain_buf->ptr = p; + /* add pbuf to existing pbuf chain */ + } else { + pbuf_cat(chain_buf->p, p); + } + } + /* save size of total chain */ + if (err == ERR_OK) { + size = netbuf_len(chain_buf); + } +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + + if (err == ERR_OK) { +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Unmap IPv4 mapped IPv6 addresses */ + if (IP_IS_V6_VAL(chain_buf->addr) && ip6_addr_isipv4mappedipv6(ip_2_ip6(&chain_buf->addr))) { + unmap_ipv4_mapped_ipv6(ip_2_ip4(&chain_buf->addr), ip_2_ip6(&chain_buf->addr)); + IP_SET_TYPE_VAL(chain_buf->addr, IPADDR_TYPE_V4); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + /* send the data */ + err = netconn_send(sock->conn, chain_buf); + } + + /* deallocated the buffer */ + netbuf_delete(chain_buf); + + sock_set_errno(sock, err_to_errno(err)); + return (err == ERR_OK ? size : -1); + } +#else /* LWIP_UDP || LWIP_RAW */ + sock_set_errno(sock, err_to_errno(ERR_ARG)); + return -1; +#endif /* LWIP_UDP || LWIP_RAW */ +} + +int +lwip_sendto(int s, const void *data, size_t size, int flags, + const struct sockaddr *to, socklen_t tolen) +{ + struct lwip_sock *sock; + err_t err; + u16_t short_size; + u16_t remote_port; + struct netbuf buf; + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) == NETCONN_TCP) { +#if LWIP_TCP + return lwip_send(s, data, size, flags); +#else /* LWIP_TCP */ + LWIP_UNUSED_ARG(flags); + sock_set_errno(sock, err_to_errno(ERR_ARG)); + return -1; +#endif /* LWIP_TCP */ + } + + /* @todo: split into multiple sendto's? */ + LWIP_ASSERT("lwip_sendto: size must fit in u16_t", size <= 0xffff); + short_size = (u16_t)size; + LWIP_ERROR("lwip_sendto: invalid address", (((to == NULL) && (tolen == 0)) || + (IS_SOCK_ADDR_LEN_VALID(tolen) && + IS_SOCK_ADDR_TYPE_VALID(to) && IS_SOCK_ADDR_ALIGNED(to))), + sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;); + LWIP_UNUSED_ARG(tolen); + + /* initialize a buffer */ + buf.p = buf.ptr = NULL; +#if LWIP_CHECKSUM_ON_COPY + buf.flags = 0; +#endif /* LWIP_CHECKSUM_ON_COPY */ + if (to) { + SOCKADDR_TO_IPADDR_PORT(to, &buf.addr, remote_port); + } else { + remote_port = 0; + ip_addr_set_any(NETCONNTYPE_ISIPV6(netconn_type(sock->conn)), &buf.addr); + } + netbuf_fromport(&buf) = remote_port; + + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_sendto(%d, data=%p, short_size=%"U16_F", flags=0x%x to=", + s, data, short_size, flags)); + ip_addr_debug_print(SOCKETS_DEBUG, &buf.addr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F"\n", remote_port)); + + /* make the buffer point to the data that should be sent */ +#if LWIP_NETIF_TX_SINGLE_PBUF + /* Allocate a new netbuf and copy the data into it. */ + if (netbuf_alloc(&buf, short_size) == NULL) { + err = ERR_MEM; + } else { +#if LWIP_CHECKSUM_ON_COPY + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_RAW) { + u16_t chksum = LWIP_CHKSUM_COPY(buf.p->payload, data, short_size); + netbuf_set_chksum(&buf, chksum); + } else +#endif /* LWIP_CHECKSUM_ON_COPY */ + { + MEMCPY(buf.p->payload, data, short_size); + } + err = ERR_OK; + } +#else /* LWIP_NETIF_TX_SINGLE_PBUF */ + err = netbuf_ref(&buf, data, short_size); +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + if (err == ERR_OK) { +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Unmap IPv4 mapped IPv6 addresses */ + if (IP_IS_V6_VAL(buf.addr) && ip6_addr_isipv4mappedipv6(ip_2_ip6(&buf.addr))) { + unmap_ipv4_mapped_ipv6(ip_2_ip4(&buf.addr), ip_2_ip6(&buf.addr)); + IP_SET_TYPE_VAL(buf.addr, IPADDR_TYPE_V4); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + /* send the data */ + err = netconn_send(sock->conn, &buf); + } + + /* deallocated the buffer */ + netbuf_free(&buf); + + sock_set_errno(sock, err_to_errno(err)); + return (err == ERR_OK ? short_size : -1); +} + +int +lwip_socket(int domain, int type, int protocol) +{ + struct netconn *conn; + int i; + + LWIP_UNUSED_ARG(domain); /* @todo: check this */ + + /* create a netconn */ + switch (type) { + case SOCK_RAW: + conn = netconn_new_with_proto_and_callback(DOMAIN_TO_NETCONN_TYPE(domain, NETCONN_RAW), + (u8_t)protocol, event_callback); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_RAW, %d) = ", + domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); + break; + case SOCK_DGRAM: + conn = netconn_new_with_callback(DOMAIN_TO_NETCONN_TYPE(domain, + ((protocol == IPPROTO_UDPLITE) ? NETCONN_UDPLITE : NETCONN_UDP)) , + event_callback); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_DGRAM, %d) = ", + domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); + break; + case SOCK_STREAM: + conn = netconn_new_with_callback(DOMAIN_TO_NETCONN_TYPE(domain, NETCONN_TCP), event_callback); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%s, SOCK_STREAM, %d) = ", + domain == PF_INET ? "PF_INET" : "UNKNOWN", protocol)); + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_socket(%d, %d/UNKNOWN, %d) = -1\n", + domain, type, protocol)); + set_errno(EINVAL); + return -1; + } + + if (!conn) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("-1 / ENOBUFS (could not create netconn)\n")); + set_errno(ENOBUFS); + return -1; + } + + i = alloc_socket(conn, 0); + + if (i == -1) { + netconn_delete(conn); + set_errno(ENFILE); + return -1; + } + conn->socket = i; + LWIP_DEBUGF(SOCKETS_DEBUG, ("%d\n", i)); + set_errno(0); + return i; +} + +int +lwip_write(int s, const void *data, size_t size) +{ + return lwip_send(s, data, size, 0); +} + +int +lwip_writev(int s, const struct iovec *iov, int iovcnt) +{ + struct msghdr msg; + + msg.msg_name = NULL; + msg.msg_namelen = 0; + /* Hack: we have to cast via number to cast from 'const' pointer to non-const. + Blame the opengroup standard for this inconsistency. */ + msg.msg_iov = LWIP_CONST_CAST(struct iovec *, iov); + msg.msg_iovlen = iovcnt; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + return lwip_sendmsg(s, &msg, 0); +} + +/** + * Go through the readset and writeset lists and see which socket of the sockets + * set in the sets has events. On return, readset, writeset and exceptset have + * the sockets enabled that had events. + * + * @param maxfdp1 the highest socket index in the sets + * @param readset_in set of sockets to check for read events + * @param writeset_in set of sockets to check for write events + * @param exceptset_in set of sockets to check for error events + * @param readset_out set of sockets that had read events + * @param writeset_out set of sockets that had write events + * @param exceptset_out set os sockets that had error events + * @return number of sockets that had events (read/write/exception) (>= 0) + */ +static int +lwip_selscan(int maxfdp1, fd_set *readset_in, fd_set *writeset_in, fd_set *exceptset_in, + fd_set *readset_out, fd_set *writeset_out, fd_set *exceptset_out) +{ + int i, nready = 0; + fd_set lreadset, lwriteset, lexceptset; + struct lwip_sock *sock; + SYS_ARCH_DECL_PROTECT(lev); + + FD_ZERO(&lreadset); + FD_ZERO(&lwriteset); + FD_ZERO(&lexceptset); + + /* Go through each socket in each list to count number of sockets which + currently match */ + for (i = LWIP_SOCKET_OFFSET; i < maxfdp1; i++) { + /* if this FD is not in the set, continue */ + if (!(readset_in && FD_ISSET(i, readset_in)) && + !(writeset_in && FD_ISSET(i, writeset_in)) && + !(exceptset_in && FD_ISSET(i, exceptset_in))) { + continue; + } + /* First get the socket's status (protected)... */ + SYS_ARCH_PROTECT(lev); + sock = tryget_socket(i); + if (sock != NULL) { + void* lastdata = sock->lastdata; + s16_t rcvevent = sock->rcvevent; + u16_t sendevent = sock->sendevent; + u16_t errevent = sock->errevent; + SYS_ARCH_UNPROTECT(lev); + + /* ... then examine it: */ + /* See if netconn of this socket is ready for read */ + if (readset_in && FD_ISSET(i, readset_in) && ((lastdata != NULL) || (rcvevent > 0))) { + FD_SET(i, &lreadset); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for reading\n", i)); + nready++; + } + /* See if netconn of this socket is ready for write */ + if (writeset_in && FD_ISSET(i, writeset_in) && (sendevent != 0)) { + FD_SET(i, &lwriteset); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for writing\n", i)); + nready++; + } + /* See if netconn of this socket had an error */ + if (exceptset_in && FD_ISSET(i, exceptset_in) && (errevent != 0)) { + FD_SET(i, &lexceptset); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_selscan: fd=%d ready for exception\n", i)); + nready++; + } + } else { + SYS_ARCH_UNPROTECT(lev); + /* continue on to next FD in list */ + } + } + /* copy local sets to the ones provided as arguments */ + *readset_out = lreadset; + *writeset_out = lwriteset; + *exceptset_out = lexceptset; + + LWIP_ASSERT("nready >= 0", nready >= 0); + return nready; +} + +int +lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, + struct timeval *timeout) +{ + u32_t waitres = 0; + int nready; + fd_set lreadset, lwriteset, lexceptset; + u32_t msectimeout; + struct lwip_select_cb select_cb; + int i; + int maxfdp2; +#if LWIP_NETCONN_SEM_PER_THREAD + int waited = 0; +#endif + SYS_ARCH_DECL_PROTECT(lev); + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select(%d, %p, %p, %p, tvsec=%"S32_F" tvusec=%"S32_F")\n", + maxfdp1, (void *)readset, (void *) writeset, (void *) exceptset, + timeout ? (s32_t)timeout->tv_sec : (s32_t)-1, + timeout ? (s32_t)timeout->tv_usec : (s32_t)-1)); + + /* Go through each socket in each list to count number of sockets which + currently match */ + nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset); + + /* If we don't have any current events, then suspend if we are supposed to */ + if (!nready) { + if (timeout && timeout->tv_sec == 0 && timeout->tv_usec == 0) { + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: no timeout, returning 0\n")); + /* This is OK as the local fdsets are empty and nready is zero, + or we would have returned earlier. */ + goto return_copy_fdsets; + } + + /* None ready: add our semaphore to list: + We don't actually need any dynamic memory. Our entry on the + list is only valid while we are in this function, so it's ok + to use local variables. */ + + select_cb.next = NULL; + select_cb.prev = NULL; + select_cb.readset = readset; + select_cb.writeset = writeset; + select_cb.exceptset = exceptset; + select_cb.sem_signalled = 0; +#if LWIP_NETCONN_SEM_PER_THREAD + select_cb.sem = LWIP_NETCONN_THREAD_SEM_GET(); +#else /* LWIP_NETCONN_SEM_PER_THREAD */ + if (sys_sem_new(&select_cb.sem, 0) != ERR_OK) { + /* failed to create semaphore */ + set_errno(ENOMEM); + return -1; + } +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + /* Protect the select_cb_list */ + SYS_ARCH_PROTECT(lev); + + /* Put this select_cb on top of list */ + select_cb.next = select_cb_list; + if (select_cb_list != NULL) { + select_cb_list->prev = &select_cb; + } + select_cb_list = &select_cb; + /* Increasing this counter tells event_callback that the list has changed. */ + select_cb_ctr++; + + /* Now we can safely unprotect */ + SYS_ARCH_UNPROTECT(lev); + + /* Increase select_waiting for each socket we are interested in */ + maxfdp2 = maxfdp1; + for (i = LWIP_SOCKET_OFFSET; i < maxfdp1; i++) { + if ((readset && FD_ISSET(i, readset)) || + (writeset && FD_ISSET(i, writeset)) || + (exceptset && FD_ISSET(i, exceptset))) { + struct lwip_sock *sock; + SYS_ARCH_PROTECT(lev); + sock = tryget_socket(i); + if (sock != NULL) { + sock->select_waiting++; + LWIP_ASSERT("sock->select_waiting > 0", sock->select_waiting > 0); + } else { + /* Not a valid socket */ + nready = -1; + maxfdp2 = i; + SYS_ARCH_UNPROTECT(lev); + break; + } + SYS_ARCH_UNPROTECT(lev); + } + } + + if (nready >= 0) { + /* Call lwip_selscan again: there could have been events between + the last scan (without us on the list) and putting us on the list! */ + nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset); + if (!nready) { + /* Still none ready, just wait to be woken */ + if (timeout == 0) { + /* Wait forever */ + msectimeout = 0; + } else { + msectimeout = ((timeout->tv_sec * 1000) + ((timeout->tv_usec + 500)/1000)); + if (msectimeout == 0) { + /* Wait 1ms at least (0 means wait forever) */ + msectimeout = 1; + } + } + + waitres = sys_arch_sem_wait(SELECT_SEM_PTR(select_cb.sem), msectimeout); +#if LWIP_NETCONN_SEM_PER_THREAD + waited = 1; +#endif + } + } + + /* Decrease select_waiting for each socket we are interested in */ + for (i = LWIP_SOCKET_OFFSET; i < maxfdp2; i++) { + if ((readset && FD_ISSET(i, readset)) || + (writeset && FD_ISSET(i, writeset)) || + (exceptset && FD_ISSET(i, exceptset))) { + struct lwip_sock *sock; + SYS_ARCH_PROTECT(lev); + sock = tryget_socket(i); + if (sock != NULL) { + /* for now, handle select_waiting==0... */ + LWIP_ASSERT("sock->select_waiting > 0", sock->select_waiting > 0); + if (sock->select_waiting > 0) { + sock->select_waiting--; + } + } else { + /* Not a valid socket */ + nready = -1; + } + SYS_ARCH_UNPROTECT(lev); + } + } + /* Take us off the list */ + SYS_ARCH_PROTECT(lev); + if (select_cb.next != NULL) { + select_cb.next->prev = select_cb.prev; + } + if (select_cb_list == &select_cb) { + LWIP_ASSERT("select_cb.prev == NULL", select_cb.prev == NULL); + select_cb_list = select_cb.next; + } else { + LWIP_ASSERT("select_cb.prev != NULL", select_cb.prev != NULL); + select_cb.prev->next = select_cb.next; + } + /* Increasing this counter tells event_callback that the list has changed. */ + select_cb_ctr++; + SYS_ARCH_UNPROTECT(lev); + +#if LWIP_NETCONN_SEM_PER_THREAD + if (select_cb.sem_signalled && (!waited || (waitres == SYS_ARCH_TIMEOUT))) { + /* don't leave the thread-local semaphore signalled */ + sys_arch_sem_wait(select_cb.sem, 1); + } +#else /* LWIP_NETCONN_SEM_PER_THREAD */ + sys_sem_free(&select_cb.sem); +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + if (nready < 0) { + /* This happens when a socket got closed while waiting */ + set_errno(EBADF); + return -1; + } + + if (waitres == SYS_ARCH_TIMEOUT) { + /* Timeout */ + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: timeout expired\n")); + /* This is OK as the local fdsets are empty and nready is zero, + or we would have returned earlier. */ + goto return_copy_fdsets; + } + + /* See what's set */ + nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset); + } + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: nready=%d\n", nready)); +return_copy_fdsets: + set_errno(0); + if (readset) { + *readset = lreadset; + } + if (writeset) { + *writeset = lwriteset; + } + if (exceptset) { + *exceptset = lexceptset; + } + return nready; +} + +/** + * Callback registered in the netconn layer for each socket-netconn. + * Processes recvevent (data available) and wakes up tasks waiting for select. + */ +static void +event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len) +{ + int s; + struct lwip_sock *sock; + struct lwip_select_cb *scb; + int last_select_cb_ctr; + SYS_ARCH_DECL_PROTECT(lev); + + LWIP_UNUSED_ARG(len); + + /* Get socket */ + if (conn) { + s = conn->socket; + if (s < 0) { + /* Data comes in right away after an accept, even though + * the server task might not have created a new socket yet. + * Just count down (or up) if that's the case and we + * will use the data later. Note that only receive events + * can happen before the new socket is set up. */ + SYS_ARCH_PROTECT(lev); + if (conn->socket < 0) { + if (evt == NETCONN_EVT_RCVPLUS) { + conn->socket--; + } + SYS_ARCH_UNPROTECT(lev); + return; + } + s = conn->socket; + SYS_ARCH_UNPROTECT(lev); + } + + sock = get_socket(s); + if (!sock) { + return; + } + } else { + return; + } + + SYS_ARCH_PROTECT(lev); + /* Set event as required */ + switch (evt) { + case NETCONN_EVT_RCVPLUS: + sock->rcvevent++; + break; + case NETCONN_EVT_RCVMINUS: + sock->rcvevent--; + break; + case NETCONN_EVT_SENDPLUS: + sock->sendevent = 1; + break; + case NETCONN_EVT_SENDMINUS: + sock->sendevent = 0; + break; + case NETCONN_EVT_ERROR: + sock->errevent = 1; + break; + default: + LWIP_ASSERT("unknown event", 0); + break; + } + + if (sock->select_waiting == 0) { + /* noone is waiting for this socket, no need to check select_cb_list */ + SYS_ARCH_UNPROTECT(lev); + return; + } + + /* Now decide if anyone is waiting for this socket */ + /* NOTE: This code goes through the select_cb_list list multiple times + ONLY IF a select was actually waiting. We go through the list the number + of waiting select calls + 1. This list is expected to be small. */ + + /* At this point, SYS_ARCH is still protected! */ +again: + for (scb = select_cb_list; scb != NULL; scb = scb->next) { + /* remember the state of select_cb_list to detect changes */ + last_select_cb_ctr = select_cb_ctr; + if (scb->sem_signalled == 0) { + /* semaphore not signalled yet */ + int do_signal = 0; + /* Test this select call for our socket */ + if (sock->rcvevent > 0) { + if (scb->readset && FD_ISSET(s, scb->readset)) { + do_signal = 1; + } + } + if (sock->sendevent != 0) { + if (!do_signal && scb->writeset && FD_ISSET(s, scb->writeset)) { + do_signal = 1; + } + } + if (sock->errevent != 0) { + if (!do_signal && scb->exceptset && FD_ISSET(s, scb->exceptset)) { + do_signal = 1; + } + } + if (do_signal) { + scb->sem_signalled = 1; + /* Don't call SYS_ARCH_UNPROTECT() before signaling the semaphore, as this might + lead to the select thread taking itself off the list, invalidating the semaphore. */ + sys_sem_signal(SELECT_SEM_PTR(scb->sem)); + } + } + /* unlock interrupts with each step */ + SYS_ARCH_UNPROTECT(lev); + /* this makes sure interrupt protection time is short */ + SYS_ARCH_PROTECT(lev); + if (last_select_cb_ctr != select_cb_ctr) { + /* someone has changed select_cb_list, restart at the beginning */ + goto again; + } + } + SYS_ARCH_UNPROTECT(lev); +} + +/** + * Close one end of a full-duplex connection. + */ +int +lwip_shutdown(int s, int how) +{ + struct lwip_sock *sock; + err_t err; + u8_t shut_rx = 0, shut_tx = 0; + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_shutdown(%d, how=%d)\n", s, how)); + + sock = get_socket(s); + if (!sock) { + return -1; + } + + if (sock->conn != NULL) { + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + sock_set_errno(sock, EOPNOTSUPP); + return -1; + } + } else { + sock_set_errno(sock, ENOTCONN); + return -1; + } + + if (how == SHUT_RD) { + shut_rx = 1; + } else if (how == SHUT_WR) { + shut_tx = 1; + } else if (how == SHUT_RDWR) { + shut_rx = 1; + shut_tx = 1; + } else { + sock_set_errno(sock, EINVAL); + return -1; + } + err = netconn_shutdown(sock->conn, shut_rx, shut_tx); + + sock_set_errno(sock, err_to_errno(err)); + return (err == ERR_OK ? 0 : -1); +} + +static int +lwip_getaddrname(int s, struct sockaddr *name, socklen_t *namelen, u8_t local) +{ + struct lwip_sock *sock; + union sockaddr_aligned saddr; + ip_addr_t naddr; + u16_t port; + err_t err; + + sock = get_socket(s); + if (!sock) { + return -1; + } + + /* get the IP address and port */ + err = netconn_getaddr(sock->conn, &naddr, &port, local); + if (err != ERR_OK) { + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: Map IPv4 addresses to IPv4 mapped IPv6 */ + if (NETCONNTYPE_ISIPV6(netconn_type(sock->conn)) && + IP_IS_V4_VAL(naddr)) { + ip4_2_ipv4_mapped_ipv6(ip_2_ip6(&naddr), ip_2_ip4(&naddr)); + IP_SET_TYPE_VAL(naddr, IPADDR_TYPE_V6); + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + IPADDR_PORT_TO_SOCKADDR(&saddr, &naddr, port); + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getaddrname(%d, addr=", s)); + ip_addr_debug_print_val(SOCKETS_DEBUG, naddr); + LWIP_DEBUGF(SOCKETS_DEBUG, (" port=%"U16_F")\n", port)); + + if (*namelen > saddr.sa.sa_len) { + *namelen = saddr.sa.sa_len; + } + MEMCPY(name, &saddr, *namelen); + + sock_set_errno(sock, 0); + return 0; +} + +int +lwip_getpeername(int s, struct sockaddr *name, socklen_t *namelen) +{ + return lwip_getaddrname(s, name, namelen, 0); +} + +int +lwip_getsockname(int s, struct sockaddr *name, socklen_t *namelen) +{ + return lwip_getaddrname(s, name, namelen, 1); +} + +int +lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) +{ + u8_t err; + struct lwip_sock *sock = get_socket(s); +#if !LWIP_TCPIP_CORE_LOCKING + LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data); +#endif /* !LWIP_TCPIP_CORE_LOCKING */ + + if (!sock) { + return -1; + } + + if ((NULL == optval) || (NULL == optlen)) { + sock_set_errno(sock, EFAULT); + return -1; + } + +#if LWIP_TCPIP_CORE_LOCKING + /* core-locking can just call the -impl function */ + LOCK_TCPIP_CORE(); + err = lwip_getsockopt_impl(s, level, optname, optval, optlen); + UNLOCK_TCPIP_CORE(); + +#else /* LWIP_TCPIP_CORE_LOCKING */ + +#if LWIP_MPU_COMPATIBLE + /* MPU_COMPATIBLE copies the optval data, so check for max size here */ + if (*optlen > LWIP_SETGETSOCKOPT_MAXOPTLEN) { + sock_set_errno(sock, ENOBUFS); + return -1; + } +#endif /* LWIP_MPU_COMPATIBLE */ + + LWIP_SETGETSOCKOPT_DATA_VAR_ALLOC(data, sock); + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).s = s; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).level = level; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optname = optname; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optlen = *optlen; +#if !LWIP_MPU_COMPATIBLE + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval.p = optval; +#endif /* !LWIP_MPU_COMPATIBLE */ + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).err = 0; +#if LWIP_NETCONN_SEM_PER_THREAD + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem = LWIP_NETCONN_THREAD_SEM_GET(); +#else + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem = &sock->conn->op_completed; +#endif + err = tcpip_callback(lwip_getsockopt_callback, &LWIP_SETGETSOCKOPT_DATA_VAR_REF(data)); + if (err != ERR_OK) { + LWIP_SETGETSOCKOPT_DATA_VAR_FREE(data); + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + sys_arch_sem_wait((sys_sem_t*)(LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem), 0); + + /* write back optlen and optval */ + *optlen = LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optlen; +#if LWIP_MPU_COMPATIBLE + MEMCPY(optval, LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval, + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optlen); +#endif /* LWIP_MPU_COMPATIBLE */ + + /* maybe lwip_getsockopt_internal has changed err */ + err = LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).err; + LWIP_SETGETSOCKOPT_DATA_VAR_FREE(data); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + + sock_set_errno(sock, err); + return err ? -1 : 0; +} + +#if !LWIP_TCPIP_CORE_LOCKING +/** lwip_getsockopt_callback: only used without CORE_LOCKING + * to get into the tcpip_thread + */ +static void +lwip_getsockopt_callback(void *arg) +{ + struct lwip_setgetsockopt_data *data; + LWIP_ASSERT("arg != NULL", arg != NULL); + data = (struct lwip_setgetsockopt_data*)arg; + + data->err = lwip_getsockopt_impl(data->s, data->level, data->optname, +#if LWIP_MPU_COMPATIBLE + data->optval, +#else /* LWIP_MPU_COMPATIBLE */ + data->optval.p, +#endif /* LWIP_MPU_COMPATIBLE */ + &data->optlen); + + sys_sem_signal((sys_sem_t*)(data->completed_sem)); +} +#endif /* LWIP_TCPIP_CORE_LOCKING */ + +/** lwip_getsockopt_impl: the actual implementation of getsockopt: + * same argument as lwip_getsockopt, either called directly or through callback + */ +static u8_t +lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *optlen) +{ + u8_t err = 0; + struct lwip_sock *sock = tryget_socket(s); + if (!sock) { + return EBADF; + } + + switch (level) { + +/* Level: SOL_SOCKET */ + case SOL_SOCKET: + switch (optname) { + +#if LWIP_TCP + case SO_ACCEPTCONN: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); + if (NETCONNTYPE_GROUP(sock->conn->type) != NETCONN_TCP) { + return ENOPROTOOPT; + } + if ((sock->conn->pcb.tcp != NULL) && (sock->conn->pcb.tcp->state == LISTEN)) { + *(int*)optval = 1; + } else { + *(int*)optval = 0; + } + break; +#endif /* LWIP_TCP */ + + /* The option flags */ + case SO_BROADCAST: + case SO_KEEPALIVE: +#if SO_REUSE + case SO_REUSEADDR: +#endif /* SO_REUSE */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); + *(int*)optval = ip_get_option(sock->conn->pcb.ip, optname); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, optname=0x%x, ..) = %s\n", + s, optname, (*(int*)optval?"on":"off"))); + break; + + case SO_TYPE: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, int); + switch (NETCONNTYPE_GROUP(netconn_type(sock->conn))) { + case NETCONN_RAW: + *(int*)optval = SOCK_RAW; + break; + case NETCONN_TCP: + *(int*)optval = SOCK_STREAM; + break; + case NETCONN_UDP: + *(int*)optval = SOCK_DGRAM; + break; + default: /* unrecognized socket type */ + *(int*)optval = netconn_type(sock->conn); + LWIP_DEBUGF(SOCKETS_DEBUG, + ("lwip_getsockopt(%d, SOL_SOCKET, SO_TYPE): unrecognized socket type %d\n", + s, *(int *)optval)); + } /* switch (netconn_type(sock->conn)) */ + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_TYPE) = %d\n", + s, *(int *)optval)); + break; + + case SO_ERROR: + LWIP_SOCKOPT_CHECK_OPTLEN(*optlen, int); + /* only overwrite ERR_OK or temporary errors */ + if (((sock->err == 0) || (sock->err == EINPROGRESS)) && (sock->conn != NULL)) { + sock_set_errno(sock, err_to_errno(sock->conn->last_err)); + } + *(int *)optval = (sock->err == 0xFF ? (int)-1 : (int)sock->err); + sock->err = 0; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_ERROR) = %d\n", + s, *(int *)optval)); + break; + +#if LWIP_SO_SNDTIMEO + case SO_SNDTIMEO: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE); + LWIP_SO_SNDRCVTIMEO_SET(optval, netconn_get_sendtimeout(sock->conn)); + break; +#endif /* LWIP_SO_SNDTIMEO */ +#if LWIP_SO_RCVTIMEO + case SO_RCVTIMEO: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE); + LWIP_SO_SNDRCVTIMEO_SET(optval, netconn_get_recvtimeout(sock->conn)); + break; +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVBUF + case SO_RCVBUF: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, int); + *(int *)optval = netconn_get_recvbufsize(sock->conn); + break; +#endif /* LWIP_SO_RCVBUF */ +#if LWIP_SO_LINGER + case SO_LINGER: + { + s16_t conn_linger; + struct linger* linger = (struct linger*)optval; + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, struct linger); + conn_linger = sock->conn->linger; + if (conn_linger >= 0) { + linger->l_onoff = 1; + linger->l_linger = (int)conn_linger; + } else { + linger->l_onoff = 0; + linger->l_linger = 0; + } + } + break; +#endif /* LWIP_SO_LINGER */ +#if LWIP_UDP + case SO_NO_CHECK: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, *optlen, int, NETCONN_UDP); +#if LWIP_UDPLITE + if ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0) { + /* this flag is only available for UDP, not for UDP lite */ + return EAFNOSUPPORT; + } +#endif /* LWIP_UDPLITE */ + *(int*)optval = (udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_NOCHKSUM) ? 1 : 0; + break; +#endif /* LWIP_UDP*/ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + +/* Level: IPPROTO_IP */ + case IPPROTO_IP: + switch (optname) { + case IP_TTL: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); + *(int*)optval = sock->conn->pcb.ip->ttl; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_TTL) = %d\n", + s, *(int *)optval)); + break; + case IP_TOS: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); + *(int*)optval = sock->conn->pcb.ip->tos; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_TOS) = %d\n", + s, *(int *)optval)); + break; +#if LWIP_MULTICAST_TX_OPTIONS + case IP_MULTICAST_TTL: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, u8_t); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) { + return ENOPROTOOPT; + } + *(u8_t*)optval = udp_get_multicast_ttl(sock->conn->pcb.udp); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_TTL) = %d\n", + s, *(int *)optval)); + break; + case IP_MULTICAST_IF: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, struct in_addr); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) { + return ENOPROTOOPT; + } + inet_addr_from_ip4addr((struct in_addr*)optval, udp_get_multicast_netif_addr(sock->conn->pcb.udp)); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_IF) = 0x%"X32_F"\n", + s, *(u32_t *)optval)); + break; + case IP_MULTICAST_LOOP: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, u8_t); + if ((sock->conn->pcb.udp->flags & UDP_FLAGS_MULTICAST_LOOP) != 0) { + *(u8_t*)optval = 1; + } else { + *(u8_t*)optval = 0; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_LOOP) = %d\n", + s, *(int *)optval)); + break; +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + +#if LWIP_TCP +/* Level: IPPROTO_TCP */ + case IPPROTO_TCP: + /* Special case: all IPPROTO_TCP option take an int */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, *optlen, int, NETCONN_TCP); + if (sock->conn->pcb.tcp->state == LISTEN) { + return EINVAL; + } + switch (optname) { + case TCP_NODELAY: + *(int*)optval = tcp_nagle_disabled(sock->conn->pcb.tcp); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_NODELAY) = %s\n", + s, (*(int*)optval)?"on":"off") ); + break; + case TCP_KEEPALIVE: + *(int*)optval = (int)sock->conn->pcb.tcp->keep_idle; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_KEEPALIVE) = %d\n", + s, *(int *)optval)); + break; + +#if LWIP_TCP_KEEPALIVE + case TCP_KEEPIDLE: + *(int*)optval = (int)(sock->conn->pcb.tcp->keep_idle/1000); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_KEEPIDLE) = %d\n", + s, *(int *)optval)); + break; + case TCP_KEEPINTVL: + *(int*)optval = (int)(sock->conn->pcb.tcp->keep_intvl/1000); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_KEEPINTVL) = %d\n", + s, *(int *)optval)); + break; + case TCP_KEEPCNT: + *(int*)optval = (int)sock->conn->pcb.tcp->keep_cnt; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, TCP_KEEPCNT) = %d\n", + s, *(int *)optval)); + break; +#endif /* LWIP_TCP_KEEPALIVE */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_TCP */ + +#if LWIP_IPV6 +/* Level: IPPROTO_IPV6 */ + case IPPROTO_IPV6: + switch (optname) { + case IPV6_V6ONLY: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, int); + *(int*)optval = (netconn_get_ipv6only(sock->conn) ? 1 : 0); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IPV6, IPV6_V6ONLY) = %d\n", + s, *(int *)optval)); + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_IPV6 */ + +#if LWIP_UDP && LWIP_UDPLITE + /* Level: IPPROTO_UDPLITE */ + case IPPROTO_UDPLITE: + /* Special case: all IPPROTO_UDPLITE option take an int */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); + /* If this is no UDP lite socket, ignore any options. */ + if (!NETCONNTYPE_ISUDPLITE(netconn_type(sock->conn))) { + return ENOPROTOOPT; + } + switch (optname) { + case UDPLITE_SEND_CSCOV: + *(int*)optval = sock->conn->pcb.udp->chksum_len_tx; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_UDPLITE, UDPLITE_SEND_CSCOV) = %d\n", + s, (*(int*)optval)) ); + break; + case UDPLITE_RECV_CSCOV: + *(int*)optval = sock->conn->pcb.udp->chksum_len_rx; + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_UDPLITE, UDPLITE_RECV_CSCOV) = %d\n", + s, (*(int*)optval)) ); + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_UDPLITE, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_UDP */ + /* Level: IPPROTO_RAW */ + case IPPROTO_RAW: + switch (optname) { +#if LWIP_IPV6 && LWIP_RAW + case IPV6_CHECKSUM: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, *optlen, int, NETCONN_RAW); + if (sock->conn->pcb.raw->chksum_reqd == 0) { + *(int *)optval = -1; + } else { + *(int *)optval = sock->conn->pcb.raw->chksum_offset; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_RAW, IPV6_CHECKSUM) = %d\n", + s, (*(int*)optval)) ); + break; +#endif /* LWIP_IPV6 && LWIP_RAW */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_RAW, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, level=0x%x, UNIMPL: optname=0x%x, ..)\n", + s, level, optname)); + err = ENOPROTOOPT; + break; + } /* switch (level) */ + + return err; +} + +int +lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) +{ + u8_t err = 0; + struct lwip_sock *sock = get_socket(s); +#if !LWIP_TCPIP_CORE_LOCKING + LWIP_SETGETSOCKOPT_DATA_VAR_DECLARE(data); +#endif /* !LWIP_TCPIP_CORE_LOCKING */ + + if (!sock) { + return -1; + } + + if (NULL == optval) { + sock_set_errno(sock, EFAULT); + return -1; + } + +#if LWIP_TCPIP_CORE_LOCKING + /* core-locking can just call the -impl function */ + LOCK_TCPIP_CORE(); + err = lwip_setsockopt_impl(s, level, optname, optval, optlen); + UNLOCK_TCPIP_CORE(); + +#else /* LWIP_TCPIP_CORE_LOCKING */ + +#if LWIP_MPU_COMPATIBLE + /* MPU_COMPATIBLE copies the optval data, so check for max size here */ + if (optlen > LWIP_SETGETSOCKOPT_MAXOPTLEN) { + sock_set_errno(sock, ENOBUFS); + return -1; + } +#endif /* LWIP_MPU_COMPATIBLE */ + + LWIP_SETGETSOCKOPT_DATA_VAR_ALLOC(data, sock); + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).s = s; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).level = level; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optname = optname; + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optlen = optlen; +#if LWIP_MPU_COMPATIBLE + MEMCPY(LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval, optval, optlen); +#else /* LWIP_MPU_COMPATIBLE */ + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).optval.pc = (const void*)optval; +#endif /* LWIP_MPU_COMPATIBLE */ + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).err = 0; +#if LWIP_NETCONN_SEM_PER_THREAD + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem = LWIP_NETCONN_THREAD_SEM_GET(); +#else + LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem = &sock->conn->op_completed; +#endif + err = tcpip_callback(lwip_setsockopt_callback, &LWIP_SETGETSOCKOPT_DATA_VAR_REF(data)); + if (err != ERR_OK) { + LWIP_SETGETSOCKOPT_DATA_VAR_FREE(data); + sock_set_errno(sock, err_to_errno(err)); + return -1; + } + sys_arch_sem_wait((sys_sem_t*)(LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).completed_sem), 0); + + /* maybe lwip_getsockopt_internal has changed err */ + err = LWIP_SETGETSOCKOPT_DATA_VAR_REF(data).err; + LWIP_SETGETSOCKOPT_DATA_VAR_FREE(data); +#endif /* LWIP_TCPIP_CORE_LOCKING */ + + sock_set_errno(sock, err); + return err ? -1 : 0; +} + +#if !LWIP_TCPIP_CORE_LOCKING +/** lwip_setsockopt_callback: only used without CORE_LOCKING + * to get into the tcpip_thread + */ +static void +lwip_setsockopt_callback(void *arg) +{ + struct lwip_setgetsockopt_data *data; + LWIP_ASSERT("arg != NULL", arg != NULL); + data = (struct lwip_setgetsockopt_data*)arg; + + data->err = lwip_setsockopt_impl(data->s, data->level, data->optname, +#if LWIP_MPU_COMPATIBLE + data->optval, +#else /* LWIP_MPU_COMPATIBLE */ + data->optval.pc, +#endif /* LWIP_MPU_COMPATIBLE */ + data->optlen); + + sys_sem_signal((sys_sem_t*)(data->completed_sem)); +} +#endif /* LWIP_TCPIP_CORE_LOCKING */ + +/** lwip_setsockopt_impl: the actual implementation of setsockopt: + * same argument as lwip_setsockopt, either called directly or through callback + */ +static u8_t +lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_t optlen) +{ + u8_t err = 0; + struct lwip_sock *sock = tryget_socket(s); + if (!sock) { + return EBADF; + } + + switch (level) { + +/* Level: SOL_SOCKET */ + case SOL_SOCKET: + switch (optname) { + + /* SO_ACCEPTCONN is get-only */ + + /* The option flags */ + case SO_BROADCAST: + case SO_KEEPALIVE: +#if SO_REUSE + case SO_REUSEADDR: +#endif /* SO_REUSE */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, int); + if (*(const int*)optval) { + ip_set_option(sock->conn->pcb.ip, optname); + } else { + ip_reset_option(sock->conn->pcb.ip, optname); + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, SOL_SOCKET, optname=0x%x, ..) -> %s\n", + s, optname, (*(const int*)optval?"on":"off"))); + break; + + /* SO_TYPE is get-only */ + /* SO_ERROR is get-only */ + +#if LWIP_SO_SNDTIMEO + case SO_SNDTIMEO: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE); + netconn_set_sendtimeout(sock->conn, LWIP_SO_SNDRCVTIMEO_GET_MS(optval)); + break; +#endif /* LWIP_SO_SNDTIMEO */ +#if LWIP_SO_RCVTIMEO + case SO_RCVTIMEO: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE); + netconn_set_recvtimeout(sock->conn, (int)LWIP_SO_SNDRCVTIMEO_GET_MS(optval)); + break; +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVBUF + case SO_RCVBUF: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, int); + netconn_set_recvbufsize(sock->conn, *(const int*)optval); + break; +#endif /* LWIP_SO_RCVBUF */ +#if LWIP_SO_LINGER + case SO_LINGER: + { + const struct linger* linger = (const struct linger*)optval; + LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, struct linger); + if (linger->l_onoff) { + int lingersec = linger->l_linger; + if (lingersec < 0) { + return EINVAL; + } + if (lingersec > 0xFFFF) { + lingersec = 0xFFFF; + } + sock->conn->linger = (s16_t)lingersec; + } else { + sock->conn->linger = -1; + } + } + break; +#endif /* LWIP_SO_LINGER */ +#if LWIP_UDP + case SO_NO_CHECK: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_UDP); +#if LWIP_UDPLITE + if ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0) { + /* this flag is only available for UDP, not for UDP lite */ + return EAFNOSUPPORT; + } +#endif /* LWIP_UDPLITE */ + if (*(const int*)optval) { + udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) | UDP_FLAGS_NOCHKSUM); + } else { + udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_NOCHKSUM); + } + break; +#endif /* LWIP_UDP */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, SOL_SOCKET, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + +/* Level: IPPROTO_IP */ + case IPPROTO_IP: + switch (optname) { + case IP_TTL: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, int); + sock->conn->pcb.ip->ttl = (u8_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, IP_TTL, ..) -> %d\n", + s, sock->conn->pcb.ip->ttl)); + break; + case IP_TOS: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, int); + sock->conn->pcb.ip->tos = (u8_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, IP_TOS, ..)-> %d\n", + s, sock->conn->pcb.ip->tos)); + break; +#if LWIP_MULTICAST_TX_OPTIONS + case IP_MULTICAST_TTL: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP); + udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t*)optval)); + break; + case IP_MULTICAST_IF: + { + ip4_addr_t if_addr; + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP); + inet_addr_to_ip4addr(&if_addr, (const struct in_addr*)optval); + udp_set_multicast_netif_addr(sock->conn->pcb.udp, &if_addr); + } + break; + case IP_MULTICAST_LOOP: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP); + if (*(const u8_t*)optval) { + udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) | UDP_FLAGS_MULTICAST_LOOP); + } else { + udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_MULTICAST_LOOP); + } + break; +#endif /* LWIP_MULTICAST_TX_OPTIONS */ +#if LWIP_IGMP + case IP_ADD_MEMBERSHIP: + case IP_DROP_MEMBERSHIP: + { + /* If this is a TCP or a RAW socket, ignore these options. */ + /* @todo: assign membership to this socket so that it is dropped when closing the socket */ + err_t igmp_err; + const struct ip_mreq *imr = (const struct ip_mreq *)optval; + ip4_addr_t if_addr; + ip4_addr_t multi_addr; + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct ip_mreq, NETCONN_UDP); + inet_addr_to_ip4addr(&if_addr, &imr->imr_interface); + inet_addr_to_ip4addr(&multi_addr, &imr->imr_multiaddr); + if (optname == IP_ADD_MEMBERSHIP) { + if (!lwip_socket_register_membership(s, &if_addr, &multi_addr)) { + /* cannot track membership (out of memory) */ + err = ENOMEM; + igmp_err = ERR_OK; + } else { + igmp_err = igmp_joingroup(&if_addr, &multi_addr); + } + } else { + igmp_err = igmp_leavegroup(&if_addr, &multi_addr); + lwip_socket_unregister_membership(s, &if_addr, &multi_addr); + } + if (igmp_err != ERR_OK) { + err = EADDRNOTAVAIL; + } + } + break; +#endif /* LWIP_IGMP */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IP, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + +#if LWIP_TCP +/* Level: IPPROTO_TCP */ + case IPPROTO_TCP: + /* Special case: all IPPROTO_TCP option take an int */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_TCP); + if (sock->conn->pcb.tcp->state == LISTEN) { + return EINVAL; + } + switch (optname) { + case TCP_NODELAY: + if (*(const int*)optval) { + tcp_nagle_disable(sock->conn->pcb.tcp); + } else { + tcp_nagle_enable(sock->conn->pcb.tcp); + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_NODELAY) -> %s\n", + s, (*(const int *)optval)?"on":"off") ); + break; + case TCP_KEEPALIVE: + sock->conn->pcb.tcp->keep_idle = (u32_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_KEEPALIVE) -> %"U32_F"\n", + s, sock->conn->pcb.tcp->keep_idle)); + break; + +#if LWIP_TCP_KEEPALIVE + case TCP_KEEPIDLE: + sock->conn->pcb.tcp->keep_idle = 1000*(u32_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_KEEPIDLE) -> %"U32_F"\n", + s, sock->conn->pcb.tcp->keep_idle)); + break; + case TCP_KEEPINTVL: + sock->conn->pcb.tcp->keep_intvl = 1000*(u32_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_KEEPINTVL) -> %"U32_F"\n", + s, sock->conn->pcb.tcp->keep_intvl)); + break; + case TCP_KEEPCNT: + sock->conn->pcb.tcp->keep_cnt = (u32_t)(*(const int*)optval); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_KEEPCNT) -> %"U32_F"\n", + s, sock->conn->pcb.tcp->keep_cnt)); + break; +#endif /* LWIP_TCP_KEEPALIVE */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_TCP*/ + +#if LWIP_IPV6 +/* Level: IPPROTO_IPV6 */ + case IPPROTO_IPV6: + switch (optname) { + case IPV6_V6ONLY: + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_TCP); + if (*(const int*)optval) { + netconn_set_ipv6only(sock->conn, 1); + } else { + netconn_set_ipv6only(sock->conn, 0); + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IPV6, IPV6_V6ONLY, ..) -> %d\n", + s, (netconn_get_ipv6only(sock->conn) ? 1 : 0))); + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_IPV6, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_IPV6 */ + +#if LWIP_UDP && LWIP_UDPLITE + /* Level: IPPROTO_UDPLITE */ + case IPPROTO_UDPLITE: + /* Special case: all IPPROTO_UDPLITE option take an int */ + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, optlen, int); + /* If this is no UDP lite socket, ignore any options. */ + if (!NETCONNTYPE_ISUDPLITE(netconn_type(sock->conn))) { + return ENOPROTOOPT; + } + switch (optname) { + case UDPLITE_SEND_CSCOV: + if ((*(const int*)optval != 0) && ((*(const int*)optval < 8) || (*(const int*)optval > 0xffff))) { + /* don't allow illegal values! */ + sock->conn->pcb.udp->chksum_len_tx = 8; + } else { + sock->conn->pcb.udp->chksum_len_tx = (u16_t)*(const int*)optval; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_UDPLITE, UDPLITE_SEND_CSCOV) -> %d\n", + s, (*(const int*)optval)) ); + break; + case UDPLITE_RECV_CSCOV: + if ((*(const int*)optval != 0) && ((*(const int*)optval < 8) || (*(const int*)optval > 0xffff))) { + /* don't allow illegal values! */ + sock->conn->pcb.udp->chksum_len_rx = 8; + } else { + sock->conn->pcb.udp->chksum_len_rx = (u16_t)*(const int*)optval; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_UDPLITE, UDPLITE_RECV_CSCOV) -> %d\n", + s, (*(const int*)optval)) ); + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_UDPLITE, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; +#endif /* LWIP_UDP */ + /* Level: IPPROTO_RAW */ + case IPPROTO_RAW: + switch (optname) { +#if LWIP_IPV6 && LWIP_RAW + case IPV6_CHECKSUM: + /* It should not be possible to disable the checksum generation with ICMPv6 + * as per RFC 3542 chapter 3.1 */ + if(sock->conn->pcb.raw->protocol == IPPROTO_ICMPV6) { + return EINVAL; + } + + LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_RAW); + if (*(const int *)optval < 0) { + sock->conn->pcb.raw->chksum_reqd = 0; + } else if (*(const int *)optval & 1) { + /* Per RFC3542, odd offsets are not allowed */ + return EINVAL; + } else { + sock->conn->pcb.raw->chksum_reqd = 1; + sock->conn->pcb.raw->chksum_offset = (u16_t)*(const int *)optval; + } + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_RAW, IPV6_CHECKSUM, ..) -> %d\n", + s, sock->conn->pcb.raw->chksum_reqd)); + break; +#endif /* LWIP_IPV6 && LWIP_RAW */ + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_RAW, UNIMPL: optname=0x%x, ..)\n", + s, optname)); + err = ENOPROTOOPT; + break; + } /* switch (optname) */ + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, level=0x%x, UNIMPL: optname=0x%x, ..)\n", + s, level, optname)); + err = ENOPROTOOPT; + break; + } /* switch (level) */ + + return err; +} + +int +lwip_ioctl(int s, long cmd, void *argp) +{ + struct lwip_sock *sock = get_socket(s); + u8_t val; +#if LWIP_SO_RCVBUF + u16_t buflen = 0; + int recv_avail; +#endif /* LWIP_SO_RCVBUF */ + + if (!sock) { + return -1; + } + + switch (cmd) { +#if LWIP_SO_RCVBUF || LWIP_FIONREAD_LINUXMODE + case FIONREAD: + if (!argp) { + sock_set_errno(sock, EINVAL); + return -1; + } +#if LWIP_FIONREAD_LINUXMODE + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + struct pbuf *p; + if (sock->lastdata) { + p = ((struct netbuf *)sock->lastdata)->p; + *((int*)argp) = p->tot_len - sock->lastoffset; + } else { + struct netbuf *rxbuf; + err_t err; + if (sock->rcvevent <= 0) { + *((int*)argp) = 0; + } else { + err = netconn_recv(sock->conn, &rxbuf); + if (err != ERR_OK) { + *((int*)argp) = 0; + } else { + sock->lastdata = rxbuf; + sock->lastoffset = 0; + *((int*)argp) = rxbuf->p->tot_len; + } + } + } + return 0; + } +#endif /* LWIP_FIONREAD_LINUXMODE */ + +#if LWIP_SO_RCVBUF + /* we come here if either LWIP_FIONREAD_LINUXMODE==0 or this is a TCP socket */ + SYS_ARCH_GET(sock->conn->recv_avail, recv_avail); + if (recv_avail < 0) { + recv_avail = 0; + } + *((int*)argp) = recv_avail; + + /* Check if there is data left from the last recv operation. /maq 041215 */ + if (sock->lastdata) { + struct pbuf *p = (struct pbuf *)sock->lastdata; + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + p = ((struct netbuf *)p)->p; + } + buflen = p->tot_len; + buflen -= sock->lastoffset; + + *((int*)argp) += buflen; + } + + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONREAD, %p) = %"U16_F"\n", s, argp, *((u16_t*)argp))); + sock_set_errno(sock, 0); + return 0; +#else /* LWIP_SO_RCVBUF */ + break; +#endif /* LWIP_SO_RCVBUF */ +#endif /* LWIP_SO_RCVBUF || LWIP_FIONREAD_LINUXMODE */ + + case (long)FIONBIO: + val = 0; + if (argp && *(u32_t*)argp) { + val = 1; + } + netconn_set_nonblocking(sock->conn, val); + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, FIONBIO, %d)\n", s, val)); + sock_set_errno(sock, 0); + return 0; + + default: + break; + } /* switch (cmd) */ + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_ioctl(%d, UNIMPL: 0x%lx, %p)\n", s, cmd, argp)); + sock_set_errno(sock, ENOSYS); /* not yet implemented */ + return -1; +} + +/** A minimal implementation of fcntl. + * Currently only the commands F_GETFL and F_SETFL are implemented. + * Only the flag O_NONBLOCK is implemented. + */ +int +lwip_fcntl(int s, int cmd, int val) +{ + struct lwip_sock *sock = get_socket(s); + int ret = -1; + + if (!sock) { + return -1; + } + + switch (cmd) { + case F_GETFL: + ret = netconn_is_nonblocking(sock->conn) ? O_NONBLOCK : 0; + sock_set_errno(sock, 0); + break; + case F_SETFL: + if ((val & ~O_NONBLOCK) == 0) { + /* only O_NONBLOCK, all other bits are zero */ + netconn_set_nonblocking(sock->conn, val & O_NONBLOCK); + ret = 0; + sock_set_errno(sock, 0); + } else { + sock_set_errno(sock, ENOSYS); /* not yet implemented */ + } + break; + default: + LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_fcntl(%d, UNIMPL: %d, %d)\n", s, cmd, val)); + sock_set_errno(sock, ENOSYS); /* not yet implemented */ + break; + } + return ret; +} + +#if LWIP_IGMP +/** Register a new IGMP membership. On socket close, the membership is dropped automatically. + * + * ATTENTION: this function is called from tcpip_thread (or under CORE_LOCK). + * + * @return 1 on success, 0 on failure + */ +static int +lwip_socket_register_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr) +{ + struct lwip_sock *sock = get_socket(s); + int i; + + if (!sock) { + return 0; + } + + for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) { + if (socket_ipv4_multicast_memberships[i].sock == NULL) { + socket_ipv4_multicast_memberships[i].sock = sock; + ip4_addr_copy(socket_ipv4_multicast_memberships[i].if_addr, *if_addr); + ip4_addr_copy(socket_ipv4_multicast_memberships[i].multi_addr, *multi_addr); + return 1; + } + } + return 0; +} + +/** Unregister a previously registered membership. This prevents dropping the membership + * on socket close. + * + * ATTENTION: this function is called from tcpip_thread (or under CORE_LOCK). + */ +static void +lwip_socket_unregister_membership(int s, const ip4_addr_t *if_addr, const ip4_addr_t *multi_addr) +{ + struct lwip_sock *sock = get_socket(s); + int i; + + if (!sock) { + return; + } + + for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) { + if ((socket_ipv4_multicast_memberships[i].sock == sock) && + ip4_addr_cmp(&socket_ipv4_multicast_memberships[i].if_addr, if_addr) && + ip4_addr_cmp(&socket_ipv4_multicast_memberships[i].multi_addr, multi_addr)) { + socket_ipv4_multicast_memberships[i].sock = NULL; + ip4_addr_set_zero(&socket_ipv4_multicast_memberships[i].if_addr); + ip4_addr_set_zero(&socket_ipv4_multicast_memberships[i].multi_addr); + return; + } + } +} + +/** Drop all memberships of a socket that were not dropped explicitly via setsockopt. + * + * ATTENTION: this function is NOT called from tcpip_thread (or under CORE_LOCK). + */ +static void +lwip_socket_drop_registered_memberships(int s) +{ + struct lwip_sock *sock = get_socket(s); + int i; + + if (!sock) { + return; + } + + for (i = 0; i < LWIP_SOCKET_MAX_MEMBERSHIPS; i++) { + if (socket_ipv4_multicast_memberships[i].sock == sock) { + ip_addr_t multi_addr, if_addr; + ip_addr_copy_from_ip4(multi_addr, socket_ipv4_multicast_memberships[i].multi_addr); + ip_addr_copy_from_ip4(if_addr, socket_ipv4_multicast_memberships[i].if_addr); + socket_ipv4_multicast_memberships[i].sock = NULL; + ip4_addr_set_zero(&socket_ipv4_multicast_memberships[i].if_addr); + ip4_addr_set_zero(&socket_ipv4_multicast_memberships[i].multi_addr); + + netconn_join_leave_group(sock->conn, &multi_addr, &if_addr, NETCONN_LEAVE); + } + } +} +#endif /* LWIP_IGMP */ +#endif /* LWIP_SOCKET */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/tcpip.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/tcpip.c new file mode 100644 index 0000000..07b2f98 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/api/tcpip.c @@ -0,0 +1,518 @@ +/** + * @file + * Sequential API Main thread module + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/priv/tcpip_priv.h" +#include "lwip/sys.h" +#include "lwip/memp.h" +#include "lwip/mem.h" +#include "lwip/init.h" +#include "lwip/ip.h" +#include "lwip/pbuf.h" +#include "lwip/etharp.h" +#include "netif/ethernet.h" + +#define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name) +#define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name) +#define TCPIP_MSG_VAR_ALLOC(name) API_VAR_ALLOC(struct tcpip_msg, MEMP_TCPIP_MSG_API, name, ERR_MEM) +#define TCPIP_MSG_VAR_FREE(name) API_VAR_FREE(MEMP_TCPIP_MSG_API, name) + +/* global variables */ +static tcpip_init_done_fn tcpip_init_done; +static void *tcpip_init_done_arg; +static sys_mbox_t mbox; + +#if LWIP_TCPIP_CORE_LOCKING +/** The global semaphore to lock the stack. */ +sys_mutex_t lock_tcpip_core; +#endif /* LWIP_TCPIP_CORE_LOCKING */ + +#if LWIP_TIMERS +/* wait for a message, timeouts are processed while waiting */ +#define TCPIP_MBOX_FETCH(mbox, msg) sys_timeouts_mbox_fetch(mbox, msg) +#else /* LWIP_TIMERS */ +/* wait for a message with timers disabled (e.g. pass a timer-check trigger into tcpip_thread) */ +#define TCPIP_MBOX_FETCH(mbox, msg) sys_mbox_fetch(mbox, msg) +#endif /* LWIP_TIMERS */ + +/** + * The main lwIP thread. This thread has exclusive access to lwIP core functions + * (unless access to them is not locked). Other threads communicate with this + * thread using message boxes. + * + * It also starts all the timers to make sure they are running in the right + * thread context. + * + * @param arg unused argument + */ +static void +tcpip_thread(void *arg) +{ + struct tcpip_msg *msg; + LWIP_UNUSED_ARG(arg); + + if (tcpip_init_done != NULL) { + tcpip_init_done(tcpip_init_done_arg); + } + + LOCK_TCPIP_CORE(); + while (1) { /* MAIN Loop */ + UNLOCK_TCPIP_CORE(); + LWIP_TCPIP_THREAD_ALIVE(); + /* wait for a message, timeouts are processed while waiting */ + TCPIP_MBOX_FETCH(&mbox, (void **)&msg); + LOCK_TCPIP_CORE(); + if (msg == NULL) { + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: invalid message: NULL\n")); + LWIP_ASSERT("tcpip_thread: invalid message", 0); + continue; + } + switch (msg->type) { +#if !LWIP_TCPIP_CORE_LOCKING + case TCPIP_MSG_API: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg)); + msg->msg.api_msg.function(msg->msg.api_msg.msg); + break; + case TCPIP_MSG_API_CALL: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API CALL message %p\n", (void *)msg)); + msg->msg.api_call.arg->err = msg->msg.api_call.function(msg->msg.api_call.arg); + sys_sem_signal(msg->msg.api_call.sem); + break; +#endif /* !LWIP_TCPIP_CORE_LOCKING */ + +#if !LWIP_TCPIP_CORE_LOCKING_INPUT + case TCPIP_MSG_INPKT: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg)); + msg->msg.inp.input_fn(msg->msg.inp.p, msg->msg.inp.netif); + memp_free(MEMP_TCPIP_MSG_INPKT, msg); + break; +#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ + +#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS + case TCPIP_MSG_TIMEOUT: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: TIMEOUT %p\n", (void *)msg)); + sys_timeout(msg->msg.tmo.msecs, msg->msg.tmo.h, msg->msg.tmo.arg); + memp_free(MEMP_TCPIP_MSG_API, msg); + break; + case TCPIP_MSG_UNTIMEOUT: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: UNTIMEOUT %p\n", (void *)msg)); + sys_untimeout(msg->msg.tmo.h, msg->msg.tmo.arg); + memp_free(MEMP_TCPIP_MSG_API, msg); + break; +#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ + + case TCPIP_MSG_CALLBACK: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: CALLBACK %p\n", (void *)msg)); + msg->msg.cb.function(msg->msg.cb.ctx); + memp_free(MEMP_TCPIP_MSG_API, msg); + break; + + case TCPIP_MSG_CALLBACK_STATIC: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: CALLBACK_STATIC %p\n", (void *)msg)); + msg->msg.cb.function(msg->msg.cb.ctx); + break; + + default: + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: invalid message: %d\n", msg->type)); + LWIP_ASSERT("tcpip_thread: invalid message", 0); + break; + } + } +} + +/** + * Pass a received packet to tcpip_thread for input processing + * + * @param p the received packet + * @param inp the network interface on which the packet was received + * @param input_fn input function to call + */ +err_t +tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn) +{ +#if LWIP_TCPIP_CORE_LOCKING_INPUT + err_t ret; + LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_inpkt: PACKET %p/%p\n", (void *)p, (void *)inp)); + LOCK_TCPIP_CORE(); + ret = input_fn(p, inp); + UNLOCK_TCPIP_CORE(); + return ret; +#else /* LWIP_TCPIP_CORE_LOCKING_INPUT */ + struct tcpip_msg *msg; + + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_INPKT); + if (msg == NULL) { + return ERR_MEM; + } + + msg->type = TCPIP_MSG_INPKT; + msg->msg.inp.p = p; + msg->msg.inp.netif = inp; + msg->msg.inp.input_fn = input_fn; + if (sys_mbox_trypost(&mbox, msg) != ERR_OK) { + memp_free(MEMP_TCPIP_MSG_INPKT, msg); + return ERR_MEM; + } + return ERR_OK; +#endif /* LWIP_TCPIP_CORE_LOCKING_INPUT */ +} + +/** + * @ingroup lwip_os + * Pass a received packet to tcpip_thread for input processing with + * ethernet_input or ip_input. Don't call directly, pass to netif_add() + * and call netif->input(). + * + * @param p the received packet, p->payload pointing to the Ethernet header or + * to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or + * NETIF_FLAG_ETHERNET flags) + * @param inp the network interface on which the packet was received + */ +err_t +tcpip_input(struct pbuf *p, struct netif *inp) +{ +#if LWIP_ETHERNET + if (inp->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET)) { + return tcpip_inpkt(p, inp, ethernet_input); + } else +#endif /* LWIP_ETHERNET */ + return tcpip_inpkt(p, inp, ip_input); +} + +/** + * Call a specific function in the thread context of + * tcpip_thread for easy access synchronization. + * A function called in that way may access lwIP core code + * without fearing concurrent access. + * + * @param function the function to call + * @param ctx parameter passed to f + * @param block 1 to block until the request is posted, 0 to non-blocking mode + * @return ERR_OK if the function was called, another err_t if not + */ +err_t +tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block) +{ + struct tcpip_msg *msg; + + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API); + if (msg == NULL) { + return ERR_MEM; + } + + msg->type = TCPIP_MSG_CALLBACK; + msg->msg.cb.function = function; + msg->msg.cb.ctx = ctx; + if (block) { + sys_mbox_post(&mbox, msg); + } else { + if (sys_mbox_trypost(&mbox, msg) != ERR_OK) { + memp_free(MEMP_TCPIP_MSG_API, msg); + return ERR_MEM; + } + } + return ERR_OK; +} + +#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS +/** + * call sys_timeout in tcpip_thread + * + * @param msecs time in milliseconds for timeout + * @param h function to be called on timeout + * @param arg argument to pass to timeout function h + * @return ERR_MEM on memory error, ERR_OK otherwise + */ +err_t +tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg) +{ + struct tcpip_msg *msg; + + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API); + if (msg == NULL) { + return ERR_MEM; + } + + msg->type = TCPIP_MSG_TIMEOUT; + msg->msg.tmo.msecs = msecs; + msg->msg.tmo.h = h; + msg->msg.tmo.arg = arg; + sys_mbox_post(&mbox, msg); + return ERR_OK; +} + +/** + * call sys_untimeout in tcpip_thread + * + * @param h function to be called on timeout + * @param arg argument to pass to timeout function h + * @return ERR_MEM on memory error, ERR_OK otherwise + */ +err_t +tcpip_untimeout(sys_timeout_handler h, void *arg) +{ + struct tcpip_msg *msg; + + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API); + if (msg == NULL) { + return ERR_MEM; + } + + msg->type = TCPIP_MSG_UNTIMEOUT; + msg->msg.tmo.h = h; + msg->msg.tmo.arg = arg; + sys_mbox_post(&mbox, msg); + return ERR_OK; +} +#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ + + +/** + * Sends a message to TCPIP thread to call a function. Caller thread blocks on + * on a provided semaphore, which ist NOT automatically signalled by TCPIP thread, + * this has to be done by the user. + * It is recommended to use LWIP_TCPIP_CORE_LOCKING since this is the way + * with least runtime overhead. + * + * @param fn function to be called from TCPIP thread + * @param apimsg argument to API function + * @param sem semaphore to wait on + * @return ERR_OK if the function was called, another err_t if not + */ +err_t +tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem) +{ +#if LWIP_TCPIP_CORE_LOCKING + LWIP_UNUSED_ARG(sem); + LOCK_TCPIP_CORE(); + fn(apimsg); + UNLOCK_TCPIP_CORE(); + return ERR_OK; +#else /* LWIP_TCPIP_CORE_LOCKING */ + TCPIP_MSG_VAR_DECLARE(msg); + + LWIP_ASSERT("semaphore not initialized", sys_sem_valid(sem)); + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + TCPIP_MSG_VAR_ALLOC(msg); + TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API; + TCPIP_MSG_VAR_REF(msg).msg.api_msg.function = fn; + TCPIP_MSG_VAR_REF(msg).msg.api_msg.msg = apimsg; + sys_mbox_post(&mbox, &TCPIP_MSG_VAR_REF(msg)); + sys_arch_sem_wait(sem, 0); + TCPIP_MSG_VAR_FREE(msg); + return ERR_OK; +#endif /* LWIP_TCPIP_CORE_LOCKING */ +} + +/** + * Synchronously calls function in TCPIP thread and waits for its completion. + * It is recommended to use LWIP_TCPIP_CORE_LOCKING (preferred) or + * LWIP_NETCONN_SEM_PER_THREAD. + * If not, a semaphore is created and destroyed on every call which is usually + * an expensive/slow operation. + * @param fn Function to call + * @param call Call parameters + * @return Return value from tcpip_api_call_fn + */ +err_t +tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call) +{ +#if LWIP_TCPIP_CORE_LOCKING + err_t err; + LOCK_TCPIP_CORE(); + err = fn(call); + UNLOCK_TCPIP_CORE(); + return err; +#else /* LWIP_TCPIP_CORE_LOCKING */ + TCPIP_MSG_VAR_DECLARE(msg); + +#if !LWIP_NETCONN_SEM_PER_THREAD + err_t err = sys_sem_new(&call->sem, 0); + if (err != ERR_OK) { + return err; + } +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + + TCPIP_MSG_VAR_ALLOC(msg); + TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API_CALL; + TCPIP_MSG_VAR_REF(msg).msg.api_call.arg = call; + TCPIP_MSG_VAR_REF(msg).msg.api_call.function = fn; +#if LWIP_NETCONN_SEM_PER_THREAD + TCPIP_MSG_VAR_REF(msg).msg.api_call.sem = LWIP_NETCONN_THREAD_SEM_GET(); +#else /* LWIP_NETCONN_SEM_PER_THREAD */ + TCPIP_MSG_VAR_REF(msg).msg.api_call.sem = &call->sem; +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + sys_mbox_post(&mbox, &TCPIP_MSG_VAR_REF(msg)); + sys_arch_sem_wait(TCPIP_MSG_VAR_REF(msg).msg.api_call.sem, 0); + TCPIP_MSG_VAR_FREE(msg); + +#if !LWIP_NETCONN_SEM_PER_THREAD + sys_sem_free(&call->sem); +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + return call->err; +#endif /* LWIP_TCPIP_CORE_LOCKING */ +} + +/** + * Allocate a structure for a static callback message and initialize it. + * This is intended to be used to send "static" messages from interrupt context. + * + * @param function the function to call + * @param ctx parameter passed to function + * @return a struct pointer to pass to tcpip_trycallback(). + */ +struct tcpip_callback_msg* +tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx) +{ + struct tcpip_msg *msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API); + if (msg == NULL) { + return NULL; + } + msg->type = TCPIP_MSG_CALLBACK_STATIC; + msg->msg.cb.function = function; + msg->msg.cb.ctx = ctx; + return (struct tcpip_callback_msg*)msg; +} + +/** + * Free a callback message allocated by tcpip_callbackmsg_new(). + * + * @param msg the message to free + */ +void +tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg) +{ + memp_free(MEMP_TCPIP_MSG_API, msg); +} + +/** + * Try to post a callback-message to the tcpip_thread mbox + * This is intended to be used to send "static" messages from interrupt context. + * + * @param msg pointer to the message to post + * @return sys_mbox_trypost() return code + */ +err_t +tcpip_trycallback(struct tcpip_callback_msg* msg) +{ + LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox)); + return sys_mbox_trypost(&mbox, msg); +} + +/** + * @ingroup lwip_os + * Initialize this module: + * - initialize all sub modules + * - start the tcpip_thread + * + * @param initfunc a function to call when tcpip_thread is running and finished initializing + * @param arg argument to pass to initfunc + */ +void +tcpip_init(tcpip_init_done_fn initfunc, void *arg) +{ + lwip_init(); + + tcpip_init_done = initfunc; + tcpip_init_done_arg = arg; + if (sys_mbox_new(&mbox, TCPIP_MBOX_SIZE) != ERR_OK) { + LWIP_ASSERT("failed to create tcpip_thread mbox", 0); + } +#if LWIP_TCPIP_CORE_LOCKING + if (sys_mutex_new(&lock_tcpip_core) != ERR_OK) { + LWIP_ASSERT("failed to create lock_tcpip_core", 0); + } +#endif /* LWIP_TCPIP_CORE_LOCKING */ + + sys_thread_new(TCPIP_THREAD_NAME, tcpip_thread, NULL, TCPIP_THREAD_STACKSIZE, TCPIP_THREAD_PRIO); +} + +/** + * Simple callback function used with tcpip_callback to free a pbuf + * (pbuf_free has a wrong signature for tcpip_callback) + * + * @param p The pbuf (chain) to be dereferenced. + */ +static void +pbuf_free_int(void *p) +{ + struct pbuf *q = (struct pbuf *)p; + pbuf_free(q); +} + +/** + * A simple wrapper function that allows you to free a pbuf from interrupt context. + * + * @param p The pbuf (chain) to be dereferenced. + * @return ERR_OK if callback could be enqueued, an err_t if not + */ +err_t +pbuf_free_callback(struct pbuf *p) +{ + return tcpip_callback_with_block(pbuf_free_int, p, 0); +} + +/** + * A simple wrapper function that allows you to free heap memory from + * interrupt context. + * + * @param m the heap memory to free + * @return ERR_OK if callback could be enqueued, an err_t if not + */ +err_t +mem_free_callback(void *m) +{ + return tcpip_callback_with_block(mem_free, m, 0); +} + +#endif /* !NO_SYS */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs.c new file mode 100644 index 0000000..35b5e31 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs.c @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/apps/httpd_opts.h" +#include "lwip/def.h" +#include "lwip/apps/fs.h" +#include "fsdata.h" +#include + + +#if HTTPD_USE_CUSTOM_FSDATA +#include "fsdata_custom.c" +#else /* HTTPD_USE_CUSTOM_FSDATA */ +#include "fsdata.c" +#endif /* HTTPD_USE_CUSTOM_FSDATA */ + +/*-----------------------------------------------------------------------------------*/ + +#if LWIP_HTTPD_CUSTOM_FILES +int fs_open_custom(struct fs_file *file, const char *name); +void fs_close_custom(struct fs_file *file); +#if LWIP_HTTPD_FS_ASYNC_READ +u8_t fs_canread_custom(struct fs_file *file); +u8_t fs_wait_read_custom(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg); +int fs_read_async_custom(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg); +#else /* LWIP_HTTPD_FS_ASYNC_READ */ +int fs_read_custom(struct fs_file *file, char *buffer, int count); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +#endif /* LWIP_HTTPD_CUSTOM_FILES */ + +/*-----------------------------------------------------------------------------------*/ +err_t +fs_open(struct fs_file *file, const char *name) +{ + const struct fsdata_file *f; + + if ((file == NULL) || (name == NULL)) { + return ERR_ARG; + } + +#if LWIP_HTTPD_CUSTOM_FILES + if (fs_open_custom(file, name)) { + file->is_custom_file = 1; + return ERR_OK; + } + file->is_custom_file = 0; +#endif /* LWIP_HTTPD_CUSTOM_FILES */ + + for (f = FS_ROOT; f != NULL; f = f->next) { + if (!strcmp(name, (const char *)f->name)) { + file->data = (const char *)f->data; + file->len = f->len; + file->index = f->len; + file->pextension = NULL; + file->flags = f->flags; +#if HTTPD_PRECALCULATED_CHECKSUM + file->chksum_count = f->chksum_count; + file->chksum = f->chksum; +#endif /* HTTPD_PRECALCULATED_CHECKSUM */ +#if LWIP_HTTPD_FILE_STATE + file->state = fs_state_init(file, name); +#endif /* #if LWIP_HTTPD_FILE_STATE */ + return ERR_OK; + } + } + /* file not found */ + return ERR_VAL; +} + +/*-----------------------------------------------------------------------------------*/ +void +fs_close(struct fs_file *file) +{ +#if LWIP_HTTPD_CUSTOM_FILES + if (file->is_custom_file) { + fs_close_custom(file); + } +#endif /* LWIP_HTTPD_CUSTOM_FILES */ +#if LWIP_HTTPD_FILE_STATE + fs_state_free(file, file->state); +#endif /* #if LWIP_HTTPD_FILE_STATE */ + LWIP_UNUSED_ARG(file); +} +/*-----------------------------------------------------------------------------------*/ +#if LWIP_HTTPD_DYNAMIC_FILE_READ +#if LWIP_HTTPD_FS_ASYNC_READ +int +fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg) +#else /* LWIP_HTTPD_FS_ASYNC_READ */ +int +fs_read(struct fs_file *file, char *buffer, int count) +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +{ + int read; + if(file->index == file->len) { + return FS_READ_EOF; + } +#if LWIP_HTTPD_FS_ASYNC_READ + LWIP_UNUSED_ARG(callback_fn); + LWIP_UNUSED_ARG(callback_arg); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +#if LWIP_HTTPD_CUSTOM_FILES + if (file->is_custom_file) { +#if LWIP_HTTPD_FS_ASYNC_READ + return fs_read_async_custom(file, buffer, count, callback_fn, callback_arg); +#else /* LWIP_HTTPD_FS_ASYNC_READ */ + return fs_read_custom(file, buffer, count); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + } +#endif /* LWIP_HTTPD_CUSTOM_FILES */ + + read = file->len - file->index; + if(read > count) { + read = count; + } + + MEMCPY(buffer, (file->data + file->index), read); + file->index += read; + + return(read); +} +#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ +/*-----------------------------------------------------------------------------------*/ +#if LWIP_HTTPD_FS_ASYNC_READ +int +fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg) +{ + if (file != NULL) { +#if LWIP_HTTPD_FS_ASYNC_READ +#if LWIP_HTTPD_CUSTOM_FILES + if (!fs_canread_custom(file)) { + if (fs_wait_read_custom(file, callback_fn, callback_arg)) { + return 0; + } + } +#else /* LWIP_HTTPD_CUSTOM_FILES */ + LWIP_UNUSED_ARG(callback_fn); + LWIP_UNUSED_ARG(callback_arg); +#endif /* LWIP_HTTPD_CUSTOM_FILES */ +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + } + return 1; +} +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +/*-----------------------------------------------------------------------------------*/ +int +fs_bytes_left(struct fs_file *file) +{ + return file->len - file->index; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs/img/sics.gif b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs/img/sics.gif new file mode 100644 index 0000000..0a4fc7b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fs/img/sics.gif differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.c new file mode 100644 index 0000000..6170ce6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.c @@ -0,0 +1,298 @@ +#include "lwip/apps/fs.h" +#include "lwip/def.h" +#include "fsdata.h" + + +#define file_NULL (struct fsdata_file *) NULL + + +static const unsigned int dummy_align__img_sics_gif = 0; +static const unsigned char data__img_sics_gif[] = { +/* /img/sics.gif (14 chars) */ +0x2f,0x69,0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x00,0x00,0x00, + +/* HTTP header */ +/* "HTTP/1.0 200 OK +" (17 bytes) */ +0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d, +0x0a, +/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip) +" (63 bytes) */ +0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33, +0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e, +0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70, +0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a, +/* "Content-type: image/gif + +" (27 bytes) */ +0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x69,0x6d, +0x61,0x67,0x65,0x2f,0x67,0x69,0x66,0x0d,0x0a,0x0d,0x0a, +/* raw file data (724 bytes) */ +0x47,0x49,0x46,0x38,0x39,0x61,0x46,0x00,0x22,0x00,0xa5,0x00,0x00,0xd9,0x2b,0x39, +0x6a,0x6a,0x6a,0xbf,0xbf,0xbf,0x93,0x93,0x93,0x0f,0x0f,0x0f,0xb0,0xb0,0xb0,0xa6, +0xa6,0xa6,0x80,0x80,0x80,0x76,0x76,0x76,0x1e,0x1e,0x1e,0x9d,0x9d,0x9d,0x2e,0x2e, +0x2e,0x49,0x49,0x49,0x54,0x54,0x54,0x8a,0x8a,0x8a,0x60,0x60,0x60,0xc6,0xa6,0x99, +0xbd,0xb5,0xb2,0xc2,0xab,0xa1,0xd9,0x41,0x40,0xd5,0x67,0x55,0xc0,0xb0,0xaa,0xd5, +0x5e,0x4e,0xd6,0x50,0x45,0xcc,0x93,0x7d,0xc8,0xa1,0x90,0xce,0x8b,0x76,0xd2,0x7b, +0x65,0xd1,0x84,0x6d,0xc9,0x99,0x86,0x3a,0x3a,0x3a,0x00,0x00,0x00,0xb8,0xb8,0xb8, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2c,0x00,0x00, +0x00,0x00,0x46,0x00,0x22,0x00,0x00,0x06,0xfe,0x40,0x90,0x70,0x48,0x2c,0x1a,0x8f, +0xc8,0xa4,0x72,0xc9,0x6c,0x3a,0x9f,0xd0,0xa8,0x74,0x4a,0xad,0x5a,0xaf,0xd8,0xac, +0x76,0xa9,0x40,0x04,0xbe,0x83,0xe2,0x60,0x3c,0x50,0x20,0x0d,0x8e,0x6f,0x00,0x31, +0x28,0x1c,0x0d,0x07,0xb5,0xc3,0x60,0x75,0x24,0x3e,0xf8,0xfc,0x87,0x11,0x06,0xe9, +0x3d,0x46,0x07,0x0b,0x7a,0x7a,0x7c,0x43,0x06,0x1e,0x84,0x78,0x0b,0x07,0x6e,0x51, +0x01,0x8a,0x84,0x08,0x7e,0x79,0x80,0x87,0x89,0x91,0x7a,0x93,0x0a,0x04,0x99,0x78, +0x96,0x4f,0x03,0x9e,0x79,0x01,0x94,0x9f,0x43,0x9c,0xa3,0xa4,0x05,0x77,0xa3,0xa0, +0x4e,0x98,0x79,0x0b,0x1e,0x83,0xa4,0xa6,0x1f,0x96,0x05,0x9d,0xaa,0x78,0x01,0x07, +0x84,0x04,0x1e,0x1e,0xbb,0xb8,0x51,0x84,0x0e,0x43,0x05,0x07,0x77,0xa5,0x7f,0x42, +0xb1,0xb2,0x01,0x63,0x08,0x0d,0xbb,0x01,0x0c,0x7a,0x0d,0x44,0x0e,0xd8,0xaf,0x4c, +0x05,0x7a,0x04,0x47,0x07,0x07,0xb7,0x80,0xa2,0xe1,0x7d,0x44,0x05,0x01,0x04,0x01, +0xd0,0xea,0x87,0x93,0x4f,0xe0,0x9a,0x49,0xce,0xd8,0x79,0x04,0x66,0x20,0x15,0x10, +0x10,0x11,0x92,0x29,0x80,0xb6,0xc0,0x91,0x15,0x45,0x1e,0x90,0x19,0x71,0x46,0xa8, +0x5c,0x04,0x0e,0x00,0x22,0x4e,0xe8,0x40,0x24,0x9f,0x3e,0x04,0x06,0xa7,0x58,0xd4, +0x93,0xa0,0x1c,0x91,0x3f,0xe8,0xf0,0x88,0x03,0xb1,0x21,0xa2,0x49,0x00,0x19,0x86, +0xfc,0x52,0x44,0xe0,0x01,0x9d,0x29,0x21,0x15,0x25,0x50,0xf7,0x67,0x25,0x1e,0x06, +0xfd,0x4e,0x9a,0xb4,0x90,0xac,0x15,0xfa,0xcb,0x52,0x53,0x1e,0x8c,0xf2,0xf8,0x07, +0x92,0x2d,0x08,0x3a,0x4d,0x12,0x49,0x95,0x49,0xdb,0x14,0x04,0xc4,0x14,0x85,0x29, +0xaa,0xe7,0x01,0x08,0xa4,0x49,0x01,0x14,0x51,0xe0,0x53,0x91,0xd5,0x29,0x06,0x1a, +0x64,0x02,0xf4,0xc7,0x81,0x9e,0x05,0x20,0x22,0x64,0xa5,0x30,0xae,0xab,0x9e,0x97, +0x53,0xd8,0xb9,0xfd,0x50,0xef,0x93,0x02,0x42,0x74,0x34,0xe8,0x9c,0x20,0x21,0xc9, +0x01,0x68,0x78,0xe6,0x55,0x29,0x20,0x56,0x4f,0x4c,0x40,0x51,0x71,0x82,0xc0,0x70, +0x21,0x22,0x85,0xbe,0x4b,0x1c,0x44,0x05,0xea,0xa4,0x01,0xbf,0x22,0xb5,0xf0,0x1c, +0x06,0x51,0x38,0x8f,0xe0,0x22,0xec,0x18,0xac,0x39,0x22,0xd4,0xd6,0x93,0x44,0x01, +0x32,0x82,0xc8,0xfc,0x61,0xb3,0x01,0x45,0x0c,0x2e,0x83,0x30,0xd0,0x0e,0x17,0x24, +0x0f,0x70,0x85,0x94,0xee,0x05,0x05,0x53,0x4b,0x32,0x1b,0x3f,0x98,0xd3,0x1d,0x29, +0x81,0xb0,0xae,0x1e,0x8c,0x7e,0x68,0xe0,0x60,0x5a,0x54,0x8f,0xb0,0x78,0x69,0x73, +0x06,0xa2,0x00,0x6b,0x57,0xca,0x3d,0x11,0x50,0xbd,0x04,0x30,0x4b,0x3a,0xd4,0xab, +0x5f,0x1f,0x9b,0x3d,0x13,0x74,0x27,0x88,0x3c,0x25,0xe0,0x17,0xbe,0x7a,0x79,0x45, +0x0d,0x0c,0xb0,0x8b,0xda,0x90,0xca,0x80,0x06,0x5d,0x17,0x60,0x1c,0x22,0x4c,0xd8, +0x57,0x22,0x06,0x20,0x00,0x98,0x07,0x08,0xe4,0x56,0x80,0x80,0x1c,0xc5,0xb7,0xc5, +0x82,0x0c,0x36,0xe8,0xe0,0x83,0x10,0x46,0x28,0xe1,0x84,0x14,0x56,0x68,0xa1,0x10, +0x41,0x00,0x00,0x3b,}; + +static const unsigned int dummy_align__404_html = 1; +static const unsigned char data__404_html[] = { +/* /404.html (10 chars) */ +0x2f,0x34,0x30,0x34,0x2e,0x68,0x74,0x6d,0x6c,0x00,0x00,0x00, + +/* HTTP header */ +/* "HTTP/1.0 404 File not found +" (29 bytes) */ +0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x34,0x30,0x34,0x20,0x46,0x69,0x6c, +0x65,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x0d,0x0a, +/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip) +" (63 bytes) */ +0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33, +0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e, +0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70, +0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a, +/* "Content-type: text/html + +" (27 bytes) */ +0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65, +0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a, +/* raw file data (565 bytes) */ +0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x3c,0x74, +0x69,0x74,0x6c,0x65,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,0x69, +0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50, +0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0x3c,0x2f, +0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x62,0x6f,0x64,0x79,0x20,0x62,0x67,0x63, +0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x74,0x65,0x78, +0x74,0x3d,0x22,0x62,0x6c,0x61,0x63,0x6b,0x22,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x20, +0x20,0x20,0x3c,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22, +0x31,0x30,0x30,0x25,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74, +0x72,0x20,0x76,0x61,0x6c,0x69,0x67,0x6e,0x3d,0x22,0x74,0x6f,0x70,0x22,0x3e,0x3c, +0x74,0x64,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x30,0x22,0x3e,0x09,0x20, +0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68, +0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73, +0x65,0x2f,0x22,0x3e,0x3c,0x69,0x6d,0x67,0x20,0x73,0x72,0x63,0x3d,0x22,0x2f,0x69, +0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x22,0x0d,0x0a,0x09,0x20, +0x20,0x62,0x6f,0x72,0x64,0x65,0x72,0x3d,0x22,0x30,0x22,0x20,0x61,0x6c,0x74,0x3d, +0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x20,0x74,0x69,0x74,0x6c, +0x65,0x3d,0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x3e,0x3c,0x2f, +0x61,0x3e,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x20,0x77,0x69, +0x64,0x74,0x68,0x3d,0x22,0x35,0x30,0x30,0x22,0x3e,0x09,0x20,0x20,0x0d,0x0a,0x09, +0x20,0x20,0x3c,0x68,0x31,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c, +0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49, +0x50,0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x68,0x31,0x3e,0x0d,0x0a,0x09,0x20, +0x20,0x3c,0x68,0x32,0x3e,0x34,0x30,0x34,0x20,0x2d,0x20,0x50,0x61,0x67,0x65,0x20, +0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x3c,0x2f,0x68,0x32,0x3e,0x0d,0x0a, +0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x53,0x6f,0x72, +0x72,0x79,0x2c,0x20,0x74,0x68,0x65,0x20,0x70,0x61,0x67,0x65,0x20,0x79,0x6f,0x75, +0x20,0x61,0x72,0x65,0x20,0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x69,0x6e,0x67,0x20, +0x77,0x61,0x73,0x20,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x20,0x6f,0x6e, +0x20,0x74,0x68,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x65,0x72,0x76, +0x65,0x72,0x2e,0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09, +0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x26,0x6e, +0x62,0x73,0x70,0x3b,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x2f,0x74,0x72, +0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65, +0x3e,0x0d,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x74, +0x6d,0x6c,0x3e,0x0d,0x0a,}; + +static const unsigned int dummy_align__index_html = 2; +static const unsigned char data__index_html[] = { +/* /index.html (12 chars) */ +0x2f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x68,0x74,0x6d,0x6c,0x00, + +/* HTTP header */ +/* "HTTP/1.0 200 OK +" (17 bytes) */ +0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d, +0x0a, +/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip) +" (63 bytes) */ +0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33, +0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e, +0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70, +0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a, +/* "Content-type: text/html + +" (27 bytes) */ +0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65, +0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x0d,0x0a, +/* raw file data (1751 bytes) */ +0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x3c,0x74, +0x69,0x74,0x6c,0x65,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c,0x69, +0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50, +0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0x3c,0x2f, +0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x62,0x6f,0x64,0x79,0x20,0x62,0x67,0x63, +0x6f,0x6c,0x6f,0x72,0x3d,0x22,0x77,0x68,0x69,0x74,0x65,0x22,0x20,0x74,0x65,0x78, +0x74,0x3d,0x22,0x62,0x6c,0x61,0x63,0x6b,0x22,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x20, +0x20,0x20,0x3c,0x74,0x61,0x62,0x6c,0x65,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22, +0x31,0x30,0x30,0x25,0x22,0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x74, +0x72,0x20,0x76,0x61,0x6c,0x69,0x67,0x6e,0x3d,0x22,0x74,0x6f,0x70,0x22,0x3e,0x3c, +0x74,0x64,0x20,0x77,0x69,0x64,0x74,0x68,0x3d,0x22,0x38,0x30,0x22,0x3e,0x09,0x20, +0x20,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x61,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68, +0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73, +0x65,0x2f,0x22,0x3e,0x3c,0x69,0x6d,0x67,0x20,0x73,0x72,0x63,0x3d,0x22,0x2f,0x69, +0x6d,0x67,0x2f,0x73,0x69,0x63,0x73,0x2e,0x67,0x69,0x66,0x22,0x0d,0x0a,0x09,0x20, +0x20,0x62,0x6f,0x72,0x64,0x65,0x72,0x3d,0x22,0x30,0x22,0x20,0x61,0x6c,0x74,0x3d, +0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x20,0x74,0x69,0x74,0x6c, +0x65,0x3d,0x22,0x53,0x49,0x43,0x53,0x20,0x6c,0x6f,0x67,0x6f,0x22,0x3e,0x3c,0x2f, +0x61,0x3e,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x20,0x77,0x69, +0x64,0x74,0x68,0x3d,0x22,0x35,0x30,0x30,0x22,0x3e,0x09,0x20,0x20,0x0d,0x0a,0x09, +0x20,0x20,0x3c,0x68,0x31,0x3e,0x6c,0x77,0x49,0x50,0x20,0x2d,0x20,0x41,0x20,0x4c, +0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67,0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49, +0x50,0x20,0x53,0x74,0x61,0x63,0x6b,0x3c,0x2f,0x68,0x31,0x3e,0x0d,0x0a,0x09,0x20, +0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x54,0x68,0x65,0x20,0x77, +0x65,0x62,0x20,0x70,0x61,0x67,0x65,0x20,0x79,0x6f,0x75,0x20,0x61,0x72,0x65,0x20, +0x77,0x61,0x74,0x63,0x68,0x69,0x6e,0x67,0x20,0x77,0x61,0x73,0x20,0x73,0x65,0x72, +0x76,0x65,0x64,0x20,0x62,0x79,0x20,0x61,0x20,0x73,0x69,0x6d,0x70,0x6c,0x65,0x20, +0x77,0x65,0x62,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x65,0x72,0x76,0x65,0x72, +0x20,0x72,0x75,0x6e,0x6e,0x69,0x6e,0x67,0x20,0x6f,0x6e,0x20,0x74,0x6f,0x70,0x20, +0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x69,0x67,0x68,0x74,0x77,0x65,0x69,0x67, +0x68,0x74,0x20,0x54,0x43,0x50,0x2f,0x49,0x50,0x20,0x73,0x74,0x61,0x63,0x6b,0x20, +0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68, +0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73, +0x65,0x2f,0x7e,0x61,0x64,0x61,0x6d,0x2f,0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x6c, +0x77,0x49,0x50,0x3c,0x2f,0x61,0x3e,0x2e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70, +0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20, +0x6c,0x77,0x49,0x50,0x20,0x69,0x73,0x20,0x61,0x6e,0x20,0x6f,0x70,0x65,0x6e,0x20, +0x73,0x6f,0x75,0x72,0x63,0x65,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, +0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x54,0x43,0x50, +0x2f,0x49,0x50,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x74,0x6f,0x63, +0x6f,0x6c,0x20,0x73,0x75,0x69,0x74,0x65,0x20,0x74,0x68,0x61,0x74,0x20,0x77,0x61, +0x73,0x20,0x6f,0x72,0x69,0x67,0x69,0x6e,0x61,0x6c,0x6c,0x79,0x20,0x77,0x72,0x69, +0x74,0x74,0x65,0x6e,0x20,0x62,0x79,0x20,0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20, +0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77, +0x77,0x2e,0x73,0x69,0x63,0x73,0x2e,0x73,0x65,0x2f,0x7e,0x61,0x64,0x61,0x6d,0x2f, +0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x41,0x64,0x61,0x6d,0x20,0x44,0x75,0x6e,0x6b, +0x65,0x6c,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x6f,0x66,0x20,0x74,0x68,0x65, +0x20,0x53,0x77,0x65,0x64,0x69,0x73,0x68,0x20,0x49,0x6e,0x73,0x74,0x69,0x74,0x75, +0x74,0x65,0x20,0x6f,0x66,0x20,0x43,0x6f,0x6d,0x70,0x75,0x74,0x65,0x72,0x20,0x53, +0x63,0x69,0x65,0x6e,0x63,0x65,0x3c,0x2f,0x61,0x3e,0x20,0x62,0x75,0x74,0x20,0x6e, +0x6f,0x77,0x20,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x62,0x65,0x69,0x6e, +0x67,0x20,0x61,0x63,0x74,0x69,0x76,0x65,0x6c,0x79,0x20,0x64,0x65,0x76,0x65,0x6c, +0x6f,0x70,0x65,0x64,0x20,0x62,0x79,0x20,0x61,0x20,0x74,0x65,0x61,0x6d,0x20,0x6f, +0x66,0x20,0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x65,0x72,0x73,0x0d,0x0a,0x09,0x20, +0x20,0x20,0x20,0x64,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x64,0x20,0x77, +0x6f,0x72,0x6c,0x64,0x2d,0x77,0x69,0x64,0x65,0x2e,0x20,0x53,0x69,0x6e,0x63,0x65, +0x20,0x69,0x74,0x27,0x73,0x20,0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x2c,0x20,0x6c, +0x77,0x49,0x50,0x20,0x68,0x61,0x73,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x73,0x70, +0x75,0x72,0x72,0x65,0x64,0x20,0x61,0x20,0x6c,0x6f,0x74,0x20,0x6f,0x66,0x20,0x69, +0x6e,0x74,0x65,0x72,0x65,0x73,0x74,0x20,0x61,0x6e,0x64,0x20,0x68,0x61,0x73,0x20, +0x62,0x65,0x65,0x6e,0x20,0x70,0x6f,0x72,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x73, +0x65,0x76,0x65,0x72,0x61,0x6c,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x70,0x6c,0x61, +0x74,0x66,0x6f,0x72,0x6d,0x73,0x20,0x61,0x6e,0x64,0x20,0x6f,0x70,0x65,0x72,0x61, +0x74,0x69,0x6e,0x67,0x20,0x73,0x79,0x73,0x74,0x65,0x6d,0x73,0x2e,0x20,0x6c,0x77, +0x49,0x50,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x75,0x73,0x65,0x64,0x20,0x65, +0x69,0x74,0x68,0x65,0x72,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x77,0x69,0x74,0x68, +0x20,0x6f,0x72,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x61,0x6e,0x20,0x75, +0x6e,0x64,0x65,0x72,0x6c,0x79,0x69,0x6e,0x67,0x20,0x4f,0x53,0x2e,0x0d,0x0a,0x09, +0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d,0x0a, +0x09,0x20,0x20,0x20,0x20,0x54,0x68,0x65,0x20,0x66,0x6f,0x63,0x75,0x73,0x20,0x6f, +0x66,0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x20,0x54,0x43,0x50,0x2f,0x49, +0x50,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e, +0x20,0x69,0x73,0x20,0x74,0x6f,0x20,0x72,0x65,0x64,0x75,0x63,0x65,0x0d,0x0a,0x09, +0x20,0x20,0x20,0x20,0x74,0x68,0x65,0x20,0x52,0x41,0x4d,0x20,0x75,0x73,0x61,0x67, +0x65,0x20,0x77,0x68,0x69,0x6c,0x65,0x20,0x73,0x74,0x69,0x6c,0x6c,0x20,0x68,0x61, +0x76,0x69,0x6e,0x67,0x20,0x61,0x20,0x66,0x75,0x6c,0x6c,0x20,0x73,0x63,0x61,0x6c, +0x65,0x20,0x54,0x43,0x50,0x2e,0x20,0x54,0x68,0x69,0x73,0x0d,0x0a,0x09,0x20,0x20, +0x20,0x20,0x6d,0x61,0x6b,0x65,0x73,0x20,0x6c,0x77,0x49,0x50,0x20,0x73,0x75,0x69, +0x74,0x61,0x62,0x6c,0x65,0x20,0x66,0x6f,0x72,0x20,0x75,0x73,0x65,0x20,0x69,0x6e, +0x20,0x65,0x6d,0x62,0x65,0x64,0x64,0x65,0x64,0x20,0x73,0x79,0x73,0x74,0x65,0x6d, +0x73,0x20,0x77,0x69,0x74,0x68,0x20,0x74,0x65,0x6e,0x73,0x0d,0x0a,0x09,0x20,0x20, +0x20,0x20,0x6f,0x66,0x20,0x6b,0x69,0x6c,0x6f,0x62,0x79,0x74,0x65,0x73,0x20,0x6f, +0x66,0x20,0x66,0x72,0x65,0x65,0x20,0x52,0x41,0x4d,0x20,0x61,0x6e,0x64,0x20,0x72, +0x6f,0x6f,0x6d,0x20,0x66,0x6f,0x72,0x20,0x61,0x72,0x6f,0x75,0x6e,0x64,0x20,0x34, +0x30,0x20,0x6b,0x69,0x6c,0x6f,0x62,0x79,0x74,0x65,0x73,0x0d,0x0a,0x09,0x20,0x20, +0x20,0x20,0x6f,0x66,0x20,0x63,0x6f,0x64,0x65,0x20,0x52,0x4f,0x4d,0x2e,0x0d,0x0a, +0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x70,0x3e,0x0d, +0x0a,0x09,0x20,0x20,0x20,0x20,0x4d,0x6f,0x72,0x65,0x20,0x69,0x6e,0x66,0x6f,0x72, +0x6d,0x61,0x74,0x69,0x6f,0x6e,0x20,0x61,0x62,0x6f,0x75,0x74,0x20,0x6c,0x77,0x49, +0x50,0x20,0x63,0x61,0x6e,0x20,0x62,0x65,0x20,0x66,0x6f,0x75,0x6e,0x64,0x20,0x61, +0x74,0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x0d,0x0a,0x09,0x20,0x20,0x20, +0x20,0x68,0x6f,0x6d,0x65,0x70,0x61,0x67,0x65,0x20,0x61,0x74,0x20,0x3c,0x61,0x0d, +0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x68,0x74,0x74,0x70, +0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67, +0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f, +0x6c,0x77,0x69,0x70,0x2f,0x22,0x3e,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61, +0x76,0x61,0x6e,0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72, +0x67,0x2f,0x70,0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x2f, +0x3c,0x2f,0x61,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x6f,0x72,0x20,0x61,0x74, +0x20,0x74,0x68,0x65,0x20,0x6c,0x77,0x49,0x50,0x20,0x77,0x69,0x6b,0x69,0x20,0x61, +0x74,0x20,0x3c,0x61,0x0d,0x0a,0x09,0x20,0x20,0x20,0x20,0x68,0x72,0x65,0x66,0x3d, +0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6c,0x77,0x69,0x70,0x2e,0x77,0x69,0x6b, +0x69,0x61,0x2e,0x63,0x6f,0x6d,0x2f,0x22,0x3e,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f, +0x6c,0x77,0x69,0x70,0x2e,0x77,0x69,0x6b,0x69,0x61,0x2e,0x63,0x6f,0x6d,0x2f,0x3c, +0x2f,0x61,0x3e,0x2e,0x0d,0x0a,0x09,0x20,0x20,0x3c,0x2f,0x70,0x3e,0x0d,0x0a,0x09, +0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x74,0x64,0x3e,0x0d,0x0a,0x09,0x20,0x20,0x26,0x6e, +0x62,0x73,0x70,0x3b,0x0d,0x0a,0x09,0x3c,0x2f,0x74,0x64,0x3e,0x3c,0x2f,0x74,0x72, +0x3e,0x0d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x2f,0x74,0x61,0x62,0x6c,0x65, +0x3e,0x0d,0x0a,0x3c,0x2f,0x62,0x6f,0x64,0x79,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x74, +0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,}; + + + +const struct fsdata_file file__img_sics_gif[] = { { +file_NULL, +data__img_sics_gif, +data__img_sics_gif + 16, +sizeof(data__img_sics_gif) - 16, +1, +}}; + +const struct fsdata_file file__404_html[] = { { +file__img_sics_gif, +data__404_html, +data__404_html + 12, +sizeof(data__404_html) - 12, +1, +}}; + +const struct fsdata_file file__index_html[] = { { +file__404_html, +data__index_html, +data__index_html + 12, +sizeof(data__index_html) - 12, +1, +}}; + +#define FS_ROOT file__index_html +#define FS_NUMFILES 3 + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.h new file mode 100644 index 0000000..ac4548c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/fsdata.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_FSDATA_H +#define LWIP_FSDATA_H + +#include "lwip/apps/httpd_opts.h" +#include "lwip/apps/fs.h" + +struct fsdata_file { + const struct fsdata_file *next; + const unsigned char *name; + const unsigned char *data; + int len; + u8_t flags; +#if HTTPD_PRECALCULATED_CHECKSUM + u16_t chksum_count; + const struct fsdata_chksum *chksum; +#endif /* HTTPD_PRECALCULATED_CHECKSUM */ +}; + +#endif /* LWIP_FSDATA_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd.c new file mode 100644 index 0000000..43195d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd.c @@ -0,0 +1,2629 @@ +/** + * @file + * LWIP HTTP server implementation + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * Simon Goldschmidt + * + */ + +/** + * @defgroup httpd HTTP server + * @ingroup apps + * + * This httpd supports for a + * rudimentary server-side-include facility which will replace tags of the form + * in any file whose extension is .shtml, .shtm or .ssi with + * strings provided by an include handler whose pointer is provided to the + * module via function http_set_ssi_handler(). + * Additionally, a simple common + * gateway interface (CGI) handling mechanism has been added to allow clients + * to hook functions to particular request URIs. + * + * To enable SSI support, define label LWIP_HTTPD_SSI in lwipopts.h. + * To enable CGI support, define label LWIP_HTTPD_CGI in lwipopts.h. + * + * By default, the server assumes that HTTP headers are already present in + * each file stored in the file system. By defining LWIP_HTTPD_DYNAMIC_HEADERS in + * lwipopts.h, this behavior can be changed such that the server inserts the + * headers automatically based on the extension of the file being served. If + * this mode is used, be careful to ensure that the file system image used + * does not already contain the header information. + * + * File system images without headers can be created using the makefsfile + * tool with the -h command line option. + * + * + * Notes about valid SSI tags + * -------------------------- + * + * The following assumptions are made about tags used in SSI markers: + * + * 1. No tag may contain '-' or whitespace characters within the tag name. + * 2. Whitespace is allowed between the tag leadin "". + * 3. The maximum tag name length is LWIP_HTTPD_MAX_TAG_NAME_LEN, currently 8 characters. + * + * Notes on CGI usage + * ------------------ + * + * The simple CGI support offered here works with GET method requests only + * and can handle up to 16 parameters encoded into the URI. The handler + * function may not write directly to the HTTP output but must return a + * filename that the HTTP server will send to the browser as a response to + * the incoming CGI request. + * + * + * + * The list of supported file types is quite short, so if makefsdata complains + * about an unknown extension, make sure to add it (and its doctype) to + * the 'g_psHTTPHeaders' list. + */ +#include "lwip/init.h" +#include "lwip/apps/httpd.h" +#include "lwip/debug.h" +#include "lwip/stats.h" +#include "lwip/apps/fs.h" +#include "httpd_structs.h" +#include "lwip/def.h" +#include "lwip/ip.h" +#include "lwip/tcp.h" + +#include /* memset */ +#include /* atoi */ +#include + +#if LWIP_TCP && LWIP_CALLBACK_API + +/** Minimum length for a valid HTTP/0.9 request: "GET /\r\n" -> 7 bytes */ +#define MIN_REQ_LEN 7 + +#define CRLF "\r\n" +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE +#define HTTP11_CONNECTIONKEEPALIVE "Connection: keep-alive" +#define HTTP11_CONNECTIONKEEPALIVE2 "Connection: Keep-Alive" +#endif + +/** These defines check whether tcp_write has to copy data or not */ + +/** This was TI's check whether to let TCP copy data or not + * \#define HTTP_IS_DATA_VOLATILE(hs) ((hs->file < (char *)0x20000000) ? 0 : TCP_WRITE_FLAG_COPY) + */ +#ifndef HTTP_IS_DATA_VOLATILE +#if LWIP_HTTPD_SSI +/* Copy for SSI files, no copy for non-SSI files */ +#define HTTP_IS_DATA_VOLATILE(hs) ((hs)->ssi ? TCP_WRITE_FLAG_COPY : 0) +#else /* LWIP_HTTPD_SSI */ +/** Default: don't copy if the data is sent from file-system directly */ +#define HTTP_IS_DATA_VOLATILE(hs) (((hs->file != NULL) && (hs->handle != NULL) && (hs->file == \ + (const char*)hs->handle->data + hs->handle->len - hs->left)) \ + ? 0 : TCP_WRITE_FLAG_COPY) +#endif /* LWIP_HTTPD_SSI */ +#endif + +/** Default: headers are sent from ROM */ +#ifndef HTTP_IS_HDR_VOLATILE +#define HTTP_IS_HDR_VOLATILE(hs, ptr) 0 +#endif + +/* Return values for http_send_*() */ +#define HTTP_DATA_TO_SEND_BREAK 2 +#define HTTP_DATA_TO_SEND_CONTINUE 1 +#define HTTP_NO_DATA_TO_SEND 0 + +typedef struct +{ + const char *name; + u8_t shtml; +} default_filename; + +const default_filename g_psDefaultFilenames[] = { + {"/index.shtml", 1 }, + {"/index.ssi", 1 }, + {"/index.shtm", 1 }, + {"/index.html", 0 }, + {"/index.htm", 0 } +}; + +#define NUM_DEFAULT_FILENAMES (sizeof(g_psDefaultFilenames) / \ + sizeof(default_filename)) + +#if LWIP_HTTPD_SUPPORT_REQUESTLIST +/** HTTP request is copied here from pbufs for simple parsing */ +static char httpd_req_buf[LWIP_HTTPD_MAX_REQ_LENGTH+1]; +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + +#if LWIP_HTTPD_SUPPORT_POST +#if LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN > LWIP_HTTPD_MAX_REQUEST_URI_LEN +#define LWIP_HTTPD_URI_BUF_LEN LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN +#endif +#endif +#ifndef LWIP_HTTPD_URI_BUF_LEN +#define LWIP_HTTPD_URI_BUF_LEN LWIP_HTTPD_MAX_REQUEST_URI_LEN +#endif +#if LWIP_HTTPD_URI_BUF_LEN +/* Filename for response file to send when POST is finished or + * search for default files when a directory is requested. */ +static char http_uri_buf[LWIP_HTTPD_URI_BUF_LEN+1]; +#endif + +#if LWIP_HTTPD_DYNAMIC_HEADERS +/* The number of individual strings that comprise the headers sent before each + * requested file. + */ +#define NUM_FILE_HDR_STRINGS 5 +#define HDR_STRINGS_IDX_HTTP_STATUS 0 /* e.g. "HTTP/1.0 200 OK\r\n" */ +#define HDR_STRINGS_IDX_SERVER_NAME 1 /* e.g. "Server: "HTTPD_SERVER_AGENT"\r\n" */ +#define HDR_STRINGS_IDX_CONTENT_LEN_KEPALIVE 2 /* e.g. "Content-Length: xy\r\n" and/or "Connection: keep-alive\r\n" */ +#define HDR_STRINGS_IDX_CONTENT_LEN_NR 3 /* the byte count, when content-length is used */ +#define HDR_STRINGS_IDX_CONTENT_TYPE 4 /* the content type (or default answer content type including default document) */ + +/* The dynamically generated Content-Length buffer needs space for CRLF + NULL */ +#define LWIP_HTTPD_MAX_CONTENT_LEN_OFFSET 3 +#ifndef LWIP_HTTPD_MAX_CONTENT_LEN_SIZE +/* The dynamically generated Content-Length buffer shall be able to work with + ~953 MB (9 digits) */ +#define LWIP_HTTPD_MAX_CONTENT_LEN_SIZE (9 + LWIP_HTTPD_MAX_CONTENT_LEN_OFFSET) +#endif +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ + +#if LWIP_HTTPD_SSI + +#define HTTPD_LAST_TAG_PART 0xFFFF + +enum tag_check_state { + TAG_NONE, /* Not processing an SSI tag */ + TAG_LEADIN, /* Tag lead in "" being processed */ + TAG_SENDING /* Sending tag replacement string */ +}; + +struct http_ssi_state { + const char *parsed; /* Pointer to the first unparsed byte in buf. */ +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + const char *tag_started;/* Pointer to the first opening '<' of the tag. */ +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG */ + const char *tag_end; /* Pointer to char after the closing '>' of the tag. */ + u32_t parse_left; /* Number of unparsed bytes in buf. */ + u16_t tag_index; /* Counter used by tag parsing state machine */ + u16_t tag_insert_len; /* Length of insert in string tag_insert */ +#if LWIP_HTTPD_SSI_MULTIPART + u16_t tag_part; /* Counter passed to and changed by tag insertion function to insert multiple times */ +#endif /* LWIP_HTTPD_SSI_MULTIPART */ + u8_t tag_name_len; /* Length of the tag name in string tag_name */ + char tag_name[LWIP_HTTPD_MAX_TAG_NAME_LEN + 1]; /* Last tag name extracted */ + char tag_insert[LWIP_HTTPD_MAX_TAG_INSERT_LEN + 1]; /* Insert string for tag_name */ + enum tag_check_state tag_state; /* State of the tag processor */ +}; +#endif /* LWIP_HTTPD_SSI */ + +struct http_state { +#if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED + struct http_state *next; +#endif /* LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED */ + struct fs_file file_handle; + struct fs_file *handle; + const char *file; /* Pointer to first unsent byte in buf. */ + + struct tcp_pcb *pcb; +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + struct pbuf *req; +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + +#if LWIP_HTTPD_DYNAMIC_FILE_READ + char *buf; /* File read buffer. */ + int buf_len; /* Size of file read buffer, buf. */ +#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ + u32_t left; /* Number of unsent bytes in buf. */ + u8_t retries; +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + u8_t keepalive; +#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ +#if LWIP_HTTPD_SSI + struct http_ssi_state *ssi; +#endif /* LWIP_HTTPD_SSI */ +#if LWIP_HTTPD_CGI + char *params[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Params extracted from the request URI */ + char *param_vals[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Values for each extracted param */ +#endif /* LWIP_HTTPD_CGI */ +#if LWIP_HTTPD_DYNAMIC_HEADERS + const char *hdrs[NUM_FILE_HDR_STRINGS]; /* HTTP headers to be sent. */ + char hdr_content_len[LWIP_HTTPD_MAX_CONTENT_LEN_SIZE]; + u16_t hdr_pos; /* The position of the first unsent header byte in the + current string */ + u16_t hdr_index; /* The index of the hdr string currently being sent. */ +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ +#if LWIP_HTTPD_TIMING + u32_t time_started; +#endif /* LWIP_HTTPD_TIMING */ +#if LWIP_HTTPD_SUPPORT_POST + u32_t post_content_len_left; +#if LWIP_HTTPD_POST_MANUAL_WND + u32_t unrecved_bytes; + u8_t no_auto_wnd; + u8_t post_finished; +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ +#endif /* LWIP_HTTPD_SUPPORT_POST*/ +}; + +#if HTTPD_USE_MEM_POOL +LWIP_MEMPOOL_DECLARE(HTTPD_STATE, MEMP_NUM_PARALLEL_HTTPD_CONNS, sizeof(struct http_state), "HTTPD_STATE") +#if LWIP_HTTPD_SSI +LWIP_MEMPOOL_DECLARE(HTTPD_SSI_STATE, MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS, sizeof(struct http_ssi_state), "HTTPD_SSI_STATE") +#define HTTP_FREE_SSI_STATE(x) LWIP_MEMPOOL_FREE(HTTPD_SSI_STATE, (x)) +#define HTTP_ALLOC_SSI_STATE() (struct http_ssi_state *)LWIP_MEMPOOL_ALLOC(HTTPD_SSI_STATE) +#endif /* LWIP_HTTPD_SSI */ +#define HTTP_ALLOC_HTTP_STATE() (struct http_state *)LWIP_MEMPOOL_ALLOC(HTTPD_STATE) +#define HTTP_FREE_HTTP_STATE(x) LWIP_MEMPOOL_FREE(HTTPD_STATE, (x)) +#else /* HTTPD_USE_MEM_POOL */ +#define HTTP_ALLOC_HTTP_STATE() (struct http_state *)mem_malloc(sizeof(struct http_state)) +#define HTTP_FREE_HTTP_STATE(x) mem_free(x) +#if LWIP_HTTPD_SSI +#define HTTP_ALLOC_SSI_STATE() (struct http_ssi_state *)mem_malloc(sizeof(struct http_ssi_state)) +#define HTTP_FREE_SSI_STATE(x) mem_free(x) +#endif /* LWIP_HTTPD_SSI */ +#endif /* HTTPD_USE_MEM_POOL */ + +static err_t http_close_conn(struct tcp_pcb *pcb, struct http_state *hs); +static err_t http_close_or_abort_conn(struct tcp_pcb *pcb, struct http_state *hs, u8_t abort_conn); +static err_t http_find_file(struct http_state *hs, const char *uri, int is_09); +static err_t http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const char *uri, u8_t tag_check, char* params); +static err_t http_poll(void *arg, struct tcp_pcb *pcb); +static u8_t http_check_eof(struct tcp_pcb *pcb, struct http_state *hs); +#if LWIP_HTTPD_FS_ASYNC_READ +static void http_continue(void *connection); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + +#if LWIP_HTTPD_SSI +/* SSI insert handler function pointer. */ +tSSIHandler g_pfnSSIHandler; +#if !LWIP_HTTPD_SSI_RAW +int g_iNumTags; +const char **g_ppcTags; +#endif /* !LWIP_HTTPD_SSI_RAW */ + +#define LEN_TAG_LEAD_IN 5 +const char * const g_pcTagLeadIn = ""; +#endif /* LWIP_HTTPD_SSI */ + +#if LWIP_HTTPD_CGI +/* CGI handler information */ +const tCGI *g_pCGIs; +int g_iNumCGIs; +int http_cgi_paramcount; +#define http_cgi_params hs->params +#define http_cgi_param_vals hs->param_vals +#elif LWIP_HTTPD_CGI_SSI +char *http_cgi_params[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Params extracted from the request URI */ +char *http_cgi_param_vals[LWIP_HTTPD_MAX_CGI_PARAMETERS]; /* Values for each extracted param */ +#endif /* LWIP_HTTPD_CGI */ + +#if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED +/** global list of active HTTP connections, use to kill the oldest when + running out of memory */ +static struct http_state *http_connections; + +static void +http_add_connection(struct http_state *hs) +{ + /* add the connection to the list */ + hs->next = http_connections; + http_connections = hs; +} + +static void +http_remove_connection(struct http_state *hs) +{ + /* take the connection off the list */ + if (http_connections) { + if (http_connections == hs) { + http_connections = hs->next; + } else { + struct http_state *last; + for(last = http_connections; last->next != NULL; last = last->next) { + if (last->next == hs) { + last->next = hs->next; + break; + } + } + } + } +} + +static void +http_kill_oldest_connection(u8_t ssi_required) +{ + struct http_state *hs = http_connections; + struct http_state *hs_free_next = NULL; + while(hs && hs->next) { +#if LWIP_HTTPD_SSI + if (ssi_required) { + if (hs->next->ssi != NULL) { + hs_free_next = hs; + } + } else +#else /* LWIP_HTTPD_SSI */ + LWIP_UNUSED_ARG(ssi_required); +#endif /* LWIP_HTTPD_SSI */ + { + hs_free_next = hs; + } + LWIP_ASSERT("broken list", hs != hs->next); + hs = hs->next; + } + if (hs_free_next != NULL) { + LWIP_ASSERT("hs_free_next->next != NULL", hs_free_next->next != NULL); + LWIP_ASSERT("hs_free_next->next->pcb != NULL", hs_free_next->next->pcb != NULL); + /* send RST when killing a connection because of memory shortage */ + http_close_or_abort_conn(hs_free_next->next->pcb, hs_free_next->next, 1); /* this also unlinks the http_state from the list */ + } +} +#else /* LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED */ + +#define http_add_connection(hs) +#define http_remove_connection(hs) + +#endif /* LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED */ + +#if LWIP_HTTPD_SSI +/** Allocate as struct http_ssi_state. */ +static struct http_ssi_state* +http_ssi_state_alloc(void) +{ + struct http_ssi_state *ret = HTTP_ALLOC_SSI_STATE(); +#if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED + if (ret == NULL) { + http_kill_oldest_connection(1); + ret = HTTP_ALLOC_SSI_STATE(); + } +#endif /* LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED */ + if (ret != NULL) { + memset(ret, 0, sizeof(struct http_ssi_state)); + } + return ret; +} + +/** Free a struct http_ssi_state. */ +static void +http_ssi_state_free(struct http_ssi_state *ssi) +{ + if (ssi != NULL) { + HTTP_FREE_SSI_STATE(ssi); + } +} +#endif /* LWIP_HTTPD_SSI */ + +/** Initialize a struct http_state. + */ +static void +http_state_init(struct http_state* hs) +{ + /* Initialize the structure. */ + memset(hs, 0, sizeof(struct http_state)); +#if LWIP_HTTPD_DYNAMIC_HEADERS + /* Indicate that the headers are not yet valid */ + hs->hdr_index = NUM_FILE_HDR_STRINGS; +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ +} + +/** Allocate a struct http_state. */ +static struct http_state* +http_state_alloc(void) +{ + struct http_state *ret = HTTP_ALLOC_HTTP_STATE(); +#if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED + if (ret == NULL) { + http_kill_oldest_connection(0); + ret = HTTP_ALLOC_HTTP_STATE(); + } +#endif /* LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED */ + if (ret != NULL) { + http_state_init(ret); + http_add_connection(ret); + } + return ret; +} + +/** Free a struct http_state. + * Also frees the file data if dynamic. + */ +static void +http_state_eof(struct http_state *hs) +{ + if(hs->handle) { +#if LWIP_HTTPD_TIMING + u32_t ms_needed = sys_now() - hs->time_started; + u32_t needed = LWIP_MAX(1, (ms_needed/100)); + LWIP_DEBUGF(HTTPD_DEBUG_TIMING, ("httpd: needed %"U32_F" ms to send file of %d bytes -> %"U32_F" bytes/sec\n", + ms_needed, hs->handle->len, ((((u32_t)hs->handle->len) * 10) / needed))); +#endif /* LWIP_HTTPD_TIMING */ + fs_close(hs->handle); + hs->handle = NULL; + } +#if LWIP_HTTPD_DYNAMIC_FILE_READ + if (hs->buf != NULL) { + mem_free(hs->buf); + hs->buf = NULL; + } +#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ +#if LWIP_HTTPD_SSI + if (hs->ssi) { + http_ssi_state_free(hs->ssi); + hs->ssi = NULL; + } +#endif /* LWIP_HTTPD_SSI */ +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + if (hs->req) { + pbuf_free(hs->req); + hs->req = NULL; + } +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ +} + +/** Free a struct http_state. + * Also frees the file data if dynamic. + */ +static void +http_state_free(struct http_state *hs) +{ + if (hs != NULL) { + http_state_eof(hs); + http_remove_connection(hs); + HTTP_FREE_HTTP_STATE(hs); + } +} + +/** Call tcp_write() in a loop trying smaller and smaller length + * + * @param pcb tcp_pcb to send + * @param ptr Data to send + * @param length Length of data to send (in/out: on return, contains the + * amount of data sent) + * @param apiflags directly passed to tcp_write + * @return the return value of tcp_write + */ +static err_t +http_write(struct tcp_pcb *pcb, const void* ptr, u16_t *length, u8_t apiflags) +{ + u16_t len, max_len; + err_t err; + LWIP_ASSERT("length != NULL", length != NULL); + len = *length; + if (len == 0) { + return ERR_OK; + } + /* We cannot send more data than space available in the send buffer. */ + max_len = tcp_sndbuf(pcb); + if (max_len < len) { + len = max_len; + } +#ifdef HTTPD_MAX_WRITE_LEN + /* Additional limitation: e.g. don't enqueue more than 2*mss at once */ + max_len = HTTPD_MAX_WRITE_LEN(pcb); + if(len > max_len) { + len = max_len; + } +#endif /* HTTPD_MAX_WRITE_LEN */ + do { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Trying go send %d bytes\n", len)); + err = tcp_write(pcb, ptr, len, apiflags); + if (err == ERR_MEM) { + if ((tcp_sndbuf(pcb) == 0) || + (tcp_sndqueuelen(pcb) >= TCP_SND_QUEUELEN)) { + /* no need to try smaller sizes */ + len = 1; + } else { + len /= 2; + } + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, + ("Send failed, trying less (%d bytes)\n", len)); + } + } while ((err == ERR_MEM) && (len > 1)); + + if (err == ERR_OK) { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Sent %d bytes\n", len)); + *length = len; + } else { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Send failed with err %d (\"%s\")\n", err, lwip_strerr(err))); + *length = 0; + } + +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + /* ensure nagle is normally enabled (only disabled for persistent connections + when all data has been enqueued but the connection stays open for the next + request */ + tcp_nagle_enable(pcb); +#endif + + return err; +} + +/** + * The connection shall be actively closed (using RST to close from fault states). + * Reset the sent- and recv-callbacks. + * + * @param pcb the tcp pcb to reset callbacks + * @param hs connection state to free + */ +static err_t +http_close_or_abort_conn(struct tcp_pcb *pcb, struct http_state *hs, u8_t abort_conn) +{ + err_t err; + LWIP_DEBUGF(HTTPD_DEBUG, ("Closing connection %p\n", (void*)pcb)); + +#if LWIP_HTTPD_SUPPORT_POST + if (hs != NULL) { + if ((hs->post_content_len_left != 0) +#if LWIP_HTTPD_POST_MANUAL_WND + || ((hs->no_auto_wnd != 0) && (hs->unrecved_bytes != 0)) +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + ) { + /* make sure the post code knows that the connection is closed */ + http_uri_buf[0] = 0; + httpd_post_finished(hs, http_uri_buf, LWIP_HTTPD_URI_BUF_LEN); + } + } +#endif /* LWIP_HTTPD_SUPPORT_POST*/ + + + tcp_arg(pcb, NULL); + tcp_recv(pcb, NULL); + tcp_err(pcb, NULL); + tcp_poll(pcb, NULL, 0); + tcp_sent(pcb, NULL); + if (hs != NULL) { + http_state_free(hs); + } + + if (abort_conn) { + tcp_abort(pcb); + return ERR_OK; + } + err = tcp_close(pcb); + if (err != ERR_OK) { + LWIP_DEBUGF(HTTPD_DEBUG, ("Error %d closing %p\n", err, (void*)pcb)); + /* error closing, try again later in poll */ + tcp_poll(pcb, http_poll, HTTPD_POLL_INTERVAL); + } + return err; +} + +/** + * The connection shall be actively closed. + * Reset the sent- and recv-callbacks. + * + * @param pcb the tcp pcb to reset callbacks + * @param hs connection state to free + */ +static err_t +http_close_conn(struct tcp_pcb *pcb, struct http_state *hs) +{ + return http_close_or_abort_conn(pcb, hs, 0); +} + +/** End of file: either close the connection (Connection: close) or + * close the file (Connection: keep-alive) + */ +static void +http_eof(struct tcp_pcb *pcb, struct http_state *hs) +{ + /* HTTP/1.1 persistent connection? (Not supported for SSI) */ +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + if (hs->keepalive) { + http_remove_connection(hs); + + http_state_eof(hs); + http_state_init(hs); + /* restore state: */ + hs->pcb = pcb; + hs->keepalive = 1; + http_add_connection(hs); + /* ensure nagle doesn't interfere with sending all data as fast as possible: */ + tcp_nagle_disable(pcb); + } else +#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ + { + http_close_conn(pcb, hs); + } +} + +#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI +/** + * Extract URI parameters from the parameter-part of an URI in the form + * "test.cgi?x=y" @todo: better explanation! + * Pointers to the parameters are stored in hs->param_vals. + * + * @param hs http connection state + * @param params pointer to the NULL-terminated parameter string from the URI + * @return number of parameters extracted + */ +static int +extract_uri_parameters(struct http_state *hs, char *params) +{ + char *pair; + char *equals; + int loop; + + LWIP_UNUSED_ARG(hs); + + /* If we have no parameters at all, return immediately. */ + if(!params || (params[0] == '\0')) { + return(0); + } + + /* Get a pointer to our first parameter */ + pair = params; + + /* Parse up to LWIP_HTTPD_MAX_CGI_PARAMETERS from the passed string and ignore the + * remainder (if any) */ + for(loop = 0; (loop < LWIP_HTTPD_MAX_CGI_PARAMETERS) && pair; loop++) { + + /* Save the name of the parameter */ + http_cgi_params[loop] = pair; + + /* Remember the start of this name=value pair */ + equals = pair; + + /* Find the start of the next name=value pair and replace the delimiter + * with a 0 to terminate the previous pair string. */ + pair = strchr(pair, '&'); + if(pair) { + *pair = '\0'; + pair++; + } else { + /* We didn't find a new parameter so find the end of the URI and + * replace the space with a '\0' */ + pair = strchr(equals, ' '); + if(pair) { + *pair = '\0'; + } + + /* Revert to NULL so that we exit the loop as expected. */ + pair = NULL; + } + + /* Now find the '=' in the previous pair, replace it with '\0' and save + * the parameter value string. */ + equals = strchr(equals, '='); + if(equals) { + *equals = '\0'; + http_cgi_param_vals[loop] = equals + 1; + } else { + http_cgi_param_vals[loop] = NULL; + } + } + + return loop; +} +#endif /* LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI */ + +#if LWIP_HTTPD_SSI +/** + * Insert a tag (found in an shtml in the form of "" into the file. + * The tag's name is stored in ssi->tag_name (NULL-terminated), the replacement + * should be written to hs->tag_insert (up to a length of LWIP_HTTPD_MAX_TAG_INSERT_LEN). + * The amount of data written is stored to ssi->tag_insert_len. + * + * @todo: return tag_insert_len - maybe it can be removed from struct http_state? + * + * @param hs http connection state + */ +static void +get_tag_insert(struct http_state *hs) +{ +#if LWIP_HTTPD_SSI_RAW + const char* tag; +#else /* LWIP_HTTPD_SSI_RAW */ + int tag; +#endif /* LWIP_HTTPD_SSI_RAW */ + size_t len; + struct http_ssi_state *ssi; +#if LWIP_HTTPD_SSI_MULTIPART + u16_t current_tag_part; +#endif /* LWIP_HTTPD_SSI_MULTIPART */ + + LWIP_ASSERT("hs != NULL", hs != NULL); + ssi = hs->ssi; + LWIP_ASSERT("ssi != NULL", ssi != NULL); +#if LWIP_HTTPD_SSI_MULTIPART + current_tag_part = ssi->tag_part; + ssi->tag_part = HTTPD_LAST_TAG_PART; +#endif /* LWIP_HTTPD_SSI_MULTIPART */ +#if LWIP_HTTPD_SSI_RAW + tag = ssi->tag_name; +#endif + + if(g_pfnSSIHandler +#if !LWIP_HTTPD_SSI_RAW + && g_ppcTags && g_iNumTags +#endif /* !LWIP_HTTPD_SSI_RAW */ + ) { + + /* Find this tag in the list we have been provided. */ +#if LWIP_HTTPD_SSI_RAW + { +#else /* LWIP_HTTPD_SSI_RAW */ + for(tag = 0; tag < g_iNumTags; tag++) { + if(strcmp(ssi->tag_name, g_ppcTags[tag]) == 0) +#endif /* LWIP_HTTPD_SSI_RAW */ + { + ssi->tag_insert_len = g_pfnSSIHandler(tag, ssi->tag_insert, + LWIP_HTTPD_MAX_TAG_INSERT_LEN +#if LWIP_HTTPD_SSI_MULTIPART + , current_tag_part, &ssi->tag_part +#endif /* LWIP_HTTPD_SSI_MULTIPART */ +#if LWIP_HTTPD_FILE_STATE + , (hs->handle ? hs->handle->state : NULL) +#endif /* LWIP_HTTPD_FILE_STATE */ + ); +#if LWIP_HTTPD_SSI_RAW + if (ssi->tag_insert_len != HTTPD_SSI_TAG_UNKNOWN) +#endif /* LWIP_HTTPD_SSI_RAW */ + { + return; + } + } + } + } + + /* If we drop out, we were asked to serve a page which contains tags that + * we don't have a handler for. Merely echo back the tags with an error + * marker. */ +#define UNKNOWN_TAG1_TEXT "***UNKNOWN TAG " +#define UNKNOWN_TAG1_LEN 18 +#define UNKNOWN_TAG2_TEXT "***" +#define UNKNOWN_TAG2_LEN 7 + len = LWIP_MIN(sizeof(ssi->tag_name), LWIP_MIN(strlen(ssi->tag_name), + LWIP_HTTPD_MAX_TAG_INSERT_LEN - (UNKNOWN_TAG1_LEN + UNKNOWN_TAG2_LEN))); + MEMCPY(ssi->tag_insert, UNKNOWN_TAG1_TEXT, UNKNOWN_TAG1_LEN); + MEMCPY(&ssi->tag_insert[UNKNOWN_TAG1_LEN], ssi->tag_name, len); + MEMCPY(&ssi->tag_insert[UNKNOWN_TAG1_LEN + len], UNKNOWN_TAG2_TEXT, UNKNOWN_TAG2_LEN); + ssi->tag_insert[UNKNOWN_TAG1_LEN + len + UNKNOWN_TAG2_LEN] = 0; + + len = strlen(ssi->tag_insert); + LWIP_ASSERT("len <= 0xffff", len <= 0xffff); + ssi->tag_insert_len = (u16_t)len; +} +#endif /* LWIP_HTTPD_SSI */ + +#if LWIP_HTTPD_DYNAMIC_HEADERS +/** + * Generate the relevant HTTP headers for the given filename and write + * them into the supplied buffer. + */ +static void +get_http_headers(struct http_state *hs, const char *uri) +{ + size_t content_type; + char *tmp; + char *ext; + char *vars; + u8_t add_content_len; + + /* In all cases, the second header we send is the server identification + so set it here. */ + hs->hdrs[HDR_STRINGS_IDX_SERVER_NAME] = g_psHTTPHeaderStrings[HTTP_HDR_SERVER]; + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEPALIVE] = NULL; + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_NR] = NULL; + + /* Is this a normal file or the special case we use to send back the + default "404: Page not found" response? */ + if (uri == NULL) { + hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_NOT_FOUND]; +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + if (hs->keepalive) { + hs->hdrs[HDR_STRINGS_IDX_CONTENT_TYPE] = g_psHTTPHeaderStrings[DEFAULT_404_HTML_PERSISTENT]; + } else +#endif + { + hs->hdrs[HDR_STRINGS_IDX_CONTENT_TYPE] = g_psHTTPHeaderStrings[DEFAULT_404_HTML]; + } + + /* Set up to send the first header string. */ + hs->hdr_index = 0; + hs->hdr_pos = 0; + return; + } + /* We are dealing with a particular filename. Look for one other + special case. We assume that any filename with "404" in it must be + indicative of a 404 server error whereas all other files require + the 200 OK header. */ + if (strstr(uri, "404")) { + hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_NOT_FOUND]; + } else if (strstr(uri, "400")) { + hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_BAD_REQUEST]; + } else if (strstr(uri, "501")) { + hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_NOT_IMPL]; + } else { + hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_OK]; + } + + /* Determine if the URI has any variables and, if so, temporarily remove + them. */ + vars = strchr(uri, '?'); + if(vars) { + *vars = '\0'; + } + + /* Get a pointer to the file extension. We find this by looking for the + last occurrence of "." in the filename passed. */ + ext = NULL; + tmp = strchr(uri, '.'); + while (tmp) { + ext = tmp + 1; + tmp = strchr(ext, '.'); + } + if (ext != NULL) { + /* Now determine the content type and add the relevant header for that. */ + for (content_type = 0; content_type < NUM_HTTP_HEADERS; content_type++) { + /* Have we found a matching extension? */ + if(!lwip_stricmp(g_psHTTPHeaders[content_type].extension, ext)) { + break; + } + } + } else { + content_type = NUM_HTTP_HEADERS; + } + + /* Reinstate the parameter marker if there was one in the original URI. */ + if (vars) { + *vars = '?'; + } + +#if LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI + /* Does the URL passed have any file extension? If not, we assume it + is a special-case URL used for control state notification and we do + not send any HTTP headers with the response. */ + if (!ext) { + /* Force the header index to a value indicating that all headers + have already been sent. */ + hs->hdr_index = NUM_FILE_HDR_STRINGS; + return; + } +#endif /* LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI */ + add_content_len = 1; + /* Did we find a matching extension? */ + if(content_type < NUM_HTTP_HEADERS) { + /* yes, store it */ + hs->hdrs[HDR_STRINGS_IDX_CONTENT_TYPE] = g_psHTTPHeaders[content_type].content_type; + } else if (!ext) { + /* no, no extension found -> use binary transfer to prevent the browser adding '.txt' on save */ + hs->hdrs[HDR_STRINGS_IDX_CONTENT_TYPE] = HTTP_HDR_APP; + } else { + /* No - use the default, plain text file type. */ + hs->hdrs[HDR_STRINGS_IDX_CONTENT_TYPE] = HTTP_HDR_DEFAULT_TYPE; + } + /* Add content-length header? */ +#if LWIP_HTTPD_SSI + if (hs->ssi != NULL) { + add_content_len = 0; /* @todo: get maximum file length from SSI */ + } else +#endif /* LWIP_HTTPD_SSI */ + if ((hs->handle == NULL) || + ((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED|FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) { + add_content_len = 0; + } + if (add_content_len) { + size_t len; + lwip_itoa(hs->hdr_content_len, (size_t)LWIP_HTTPD_MAX_CONTENT_LEN_SIZE, + hs->handle->len); + len = strlen(hs->hdr_content_len); + if (len <= LWIP_HTTPD_MAX_CONTENT_LEN_SIZE - LWIP_HTTPD_MAX_CONTENT_LEN_OFFSET) { + SMEMCPY(&hs->hdr_content_len[len], CRLF "\0", 3); + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_NR] = hs->hdr_content_len; + } else { + add_content_len = 0; + } + } +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + if (add_content_len) { + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEPALIVE] = g_psHTTPHeaderStrings[HTTP_HDR_KEEPALIVE_LEN]; + } else { + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEPALIVE] = g_psHTTPHeaderStrings[HTTP_HDR_CONN_CLOSE]; + } +#else /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ + if (add_content_len) { + hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEPALIVE] = g_psHTTPHeaderStrings[HTTP_HDR_CONTENT_LENGTH]; + } +#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ + + /* Set up to send the first header string. */ + hs->hdr_index = 0; + hs->hdr_pos = 0; +} + +/** Sub-function of http_send(): send dynamic headers + * + * @returns: - HTTP_NO_DATA_TO_SEND: no new data has been enqueued + * - HTTP_DATA_TO_SEND_CONTINUE: continue with sending HTTP body + * - HTTP_DATA_TO_SEND_BREAK: data has been enqueued, headers pending, + * so don't send HTTP body yet + */ +static u8_t +http_send_headers(struct tcp_pcb *pcb, struct http_state *hs) +{ + err_t err; + u16_t len; + u8_t data_to_send = HTTP_NO_DATA_TO_SEND; + u16_t hdrlen, sendlen; + + /* How much data can we send? */ + len = tcp_sndbuf(pcb); + sendlen = len; + + while(len && (hs->hdr_index < NUM_FILE_HDR_STRINGS) && sendlen) { + const void *ptr; + u16_t old_sendlen; + u8_t apiflags; + /* How much do we have to send from the current header? */ + hdrlen = (u16_t)strlen(hs->hdrs[hs->hdr_index]); + + /* How much of this can we send? */ + sendlen = (len < (hdrlen - hs->hdr_pos)) ? len : (hdrlen - hs->hdr_pos); + + /* Send this amount of data or as much as we can given memory + * constraints. */ + ptr = (const void *)(hs->hdrs[hs->hdr_index] + hs->hdr_pos); + old_sendlen = sendlen; + apiflags = HTTP_IS_HDR_VOLATILE(hs, ptr); + if (hs->hdr_index == HDR_STRINGS_IDX_CONTENT_LEN_NR) { + /* content-length is always volatile */ + apiflags |= TCP_WRITE_FLAG_COPY; + } + if (hs->hdr_index < NUM_FILE_HDR_STRINGS - 1) { + apiflags |= TCP_WRITE_FLAG_MORE; + } + err = http_write(pcb, ptr, &sendlen, apiflags); + if ((err == ERR_OK) && (old_sendlen != sendlen)) { + /* Remember that we added some more data to be transmitted. */ + data_to_send = HTTP_DATA_TO_SEND_CONTINUE; + } else if (err != ERR_OK) { + /* special case: http_write does not try to send 1 byte */ + sendlen = 0; + } + + /* Fix up the header position for the next time round. */ + hs->hdr_pos += sendlen; + len -= sendlen; + + /* Have we finished sending this string? */ + if(hs->hdr_pos == hdrlen) { + /* Yes - move on to the next one */ + hs->hdr_index++; + /* skip headers that are NULL (not all headers are required) */ + while ((hs->hdr_index < NUM_FILE_HDR_STRINGS) && + (hs->hdrs[hs->hdr_index] == NULL)) { + hs->hdr_index++; + } + hs->hdr_pos = 0; + } + } + + if ((hs->hdr_index >= NUM_FILE_HDR_STRINGS) && (hs->file == NULL)) { + /* When we are at the end of the headers, check for data to send + * instead of waiting for ACK from remote side to continue + * (which would happen when sending files from async read). */ + if(http_check_eof(pcb, hs)) { + data_to_send = HTTP_DATA_TO_SEND_CONTINUE; + } + } + /* If we get here and there are still header bytes to send, we send + * the header information we just wrote immediately. If there are no + * more headers to send, but we do have file data to send, drop through + * to try to send some file data too. */ + if((hs->hdr_index < NUM_FILE_HDR_STRINGS) || !hs->file) { + LWIP_DEBUGF(HTTPD_DEBUG, ("tcp_output\n")); + return HTTP_DATA_TO_SEND_BREAK; + } + return data_to_send; +} +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ + +/** Sub-function of http_send(): end-of-file (or block) is reached, + * either close the file or read the next block (if supported). + * + * @returns: 0 if the file is finished or no data has been read + * 1 if the file is not finished and data has been read + */ +static u8_t +http_check_eof(struct tcp_pcb *pcb, struct http_state *hs) +{ + int bytes_left; +#if LWIP_HTTPD_DYNAMIC_FILE_READ + int count; +#ifdef HTTPD_MAX_WRITE_LEN + int max_write_len; +#endif /* HTTPD_MAX_WRITE_LEN */ +#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ + + /* Do we have a valid file handle? */ + if (hs->handle == NULL) { + /* No - close the connection. */ + http_eof(pcb, hs); + return 0; + } + bytes_left = fs_bytes_left(hs->handle); + if (bytes_left <= 0) { + /* We reached the end of the file so this request is done. */ + LWIP_DEBUGF(HTTPD_DEBUG, ("End of file.\n")); + http_eof(pcb, hs); + return 0; + } +#if LWIP_HTTPD_DYNAMIC_FILE_READ + /* Do we already have a send buffer allocated? */ + if(hs->buf) { + /* Yes - get the length of the buffer */ + count = LWIP_MIN(hs->buf_len, bytes_left); + } else { + /* We don't have a send buffer so allocate one now */ + count = tcp_sndbuf(pcb); + if(bytes_left < count) { + count = bytes_left; + } +#ifdef HTTPD_MAX_WRITE_LEN + /* Additional limitation: e.g. don't enqueue more than 2*mss at once */ + max_write_len = HTTPD_MAX_WRITE_LEN(pcb); + if (count > max_write_len) { + count = max_write_len; + } +#endif /* HTTPD_MAX_WRITE_LEN */ + do { + hs->buf = (char*)mem_malloc((mem_size_t)count); + if (hs->buf != NULL) { + hs->buf_len = count; + break; + } + count = count / 2; + } while (count > 100); + + /* Did we get a send buffer? If not, return immediately. */ + if (hs->buf == NULL) { + LWIP_DEBUGF(HTTPD_DEBUG, ("No buff\n")); + return 0; + } + } + + /* Read a block of data from the file. */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Trying to read %d bytes.\n", count)); + +#if LWIP_HTTPD_FS_ASYNC_READ + count = fs_read_async(hs->handle, hs->buf, count, http_continue, hs); +#else /* LWIP_HTTPD_FS_ASYNC_READ */ + count = fs_read(hs->handle, hs->buf, count); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + if (count < 0) { + if (count == FS_READ_DELAYED) { + /* Delayed read, wait for FS to unblock us */ + return 0; + } + /* We reached the end of the file so this request is done. + * @todo: close here for HTTP/1.1 when reading file fails */ + LWIP_DEBUGF(HTTPD_DEBUG, ("End of file.\n")); + http_eof(pcb, hs); + return 0; + } + + /* Set up to send the block of data we just read */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Read %d bytes.\n", count)); + hs->left = count; + hs->file = hs->buf; +#if LWIP_HTTPD_SSI + if (hs->ssi) { + hs->ssi->parse_left = count; + hs->ssi->parsed = hs->buf; + } +#endif /* LWIP_HTTPD_SSI */ +#else /* LWIP_HTTPD_DYNAMIC_FILE_READ */ + LWIP_ASSERT("SSI and DYNAMIC_HEADERS turned off but eof not reached", 0); +#endif /* LWIP_HTTPD_SSI || LWIP_HTTPD_DYNAMIC_HEADERS */ + return 1; +} + +/** Sub-function of http_send(): This is the normal send-routine for non-ssi files + * + * @returns: - 1: data has been written (so call tcp_ouput) + * - 0: no data has been written (no need to call tcp_output) + */ +static u8_t +http_send_data_nonssi(struct tcp_pcb *pcb, struct http_state *hs) +{ + err_t err; + u16_t len; + u8_t data_to_send = 0; + + /* We are not processing an SHTML file so no tag checking is necessary. + * Just send the data as we received it from the file. */ + len = (u16_t)LWIP_MIN(hs->left, 0xffff); + + err = http_write(pcb, hs->file, &len, HTTP_IS_DATA_VOLATILE(hs)); + if (err == ERR_OK) { + data_to_send = 1; + hs->file += len; + hs->left -= len; + } + + return data_to_send; +} + +#if LWIP_HTTPD_SSI +/** Sub-function of http_send(): This is the send-routine for ssi files + * + * @returns: - 1: data has been written (so call tcp_ouput) + * - 0: no data has been written (no need to call tcp_output) + */ +static u8_t +http_send_data_ssi(struct tcp_pcb *pcb, struct http_state *hs) +{ + err_t err = ERR_OK; + u16_t len; + u8_t data_to_send = 0; + + struct http_ssi_state *ssi = hs->ssi; + LWIP_ASSERT("ssi != NULL", ssi != NULL); + /* We are processing an SHTML file so need to scan for tags and replace + * them with insert strings. We need to be careful here since a tag may + * straddle the boundary of two blocks read from the file and we may also + * have to split the insert string between two tcp_write operations. */ + + /* How much data could we send? */ + len = tcp_sndbuf(pcb); + + /* Do we have remaining data to send before parsing more? */ + if(ssi->parsed > hs->file) { + len = (u16_t)LWIP_MIN(ssi->parsed - hs->file, 0xffff); + + err = http_write(pcb, hs->file, &len, HTTP_IS_DATA_VOLATILE(hs)); + if (err == ERR_OK) { + data_to_send = 1; + hs->file += len; + hs->left -= len; + } + + /* If the send buffer is full, return now. */ + if(tcp_sndbuf(pcb) == 0) { + return data_to_send; + } + } + + LWIP_DEBUGF(HTTPD_DEBUG, ("State %d, %d left\n", ssi->tag_state, (int)ssi->parse_left)); + + /* We have sent all the data that was already parsed so continue parsing + * the buffer contents looking for SSI tags. */ + while((ssi->parse_left) && (err == ERR_OK)) { + if (len == 0) { + return data_to_send; + } + switch(ssi->tag_state) { + case TAG_NONE: + /* We are not currently processing an SSI tag so scan for the + * start of the lead-in marker. */ + if(*ssi->parsed == g_pcTagLeadIn[0]) { + /* We found what could be the lead-in for a new tag so change + * state appropriately. */ + ssi->tag_state = TAG_LEADIN; + ssi->tag_index = 1; +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + ssi->tag_started = ssi->parsed; +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG */ + } + + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + break; + + case TAG_LEADIN: + /* We are processing the lead-in marker, looking for the start of + * the tag name. */ + + /* Have we reached the end of the leadin? */ + if(ssi->tag_index == LEN_TAG_LEAD_IN) { + ssi->tag_index = 0; + ssi->tag_state = TAG_FOUND; + } else { + /* Have we found the next character we expect for the tag leadin? */ + if(*ssi->parsed == g_pcTagLeadIn[ssi->tag_index]) { + /* Yes - move to the next one unless we have found the complete + * leadin, in which case we start looking for the tag itself */ + ssi->tag_index++; + } else { + /* We found an unexpected character so this is not a tag. Move + * back to idle state. */ + ssi->tag_state = TAG_NONE; + } + + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + } + break; + + case TAG_FOUND: + /* We are reading the tag name, looking for the start of the + * lead-out marker and removing any whitespace found. */ + + /* Remove leading whitespace between the tag leading and the first + * tag name character. */ + if((ssi->tag_index == 0) && ((*ssi->parsed == ' ') || + (*ssi->parsed == '\t') || (*ssi->parsed == '\n') || + (*ssi->parsed == '\r'))) { + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + break; + } + + /* Have we found the end of the tag name? This is signalled by + * us finding the first leadout character or whitespace */ + if((*ssi->parsed == g_pcTagLeadOut[0]) || + (*ssi->parsed == ' ') || (*ssi->parsed == '\t') || + (*ssi->parsed == '\n') || (*ssi->parsed == '\r')) { + + if(ssi->tag_index == 0) { + /* We read a zero length tag so ignore it. */ + ssi->tag_state = TAG_NONE; + } else { + /* We read a non-empty tag so go ahead and look for the + * leadout string. */ + ssi->tag_state = TAG_LEADOUT; + LWIP_ASSERT("ssi->tag_index <= 0xff", ssi->tag_index <= 0xff); + ssi->tag_name_len = (u8_t)ssi->tag_index; + ssi->tag_name[ssi->tag_index] = '\0'; + if(*ssi->parsed == g_pcTagLeadOut[0]) { + ssi->tag_index = 1; + } else { + ssi->tag_index = 0; + } + } + } else { + /* This character is part of the tag name so save it */ + if(ssi->tag_index < LWIP_HTTPD_MAX_TAG_NAME_LEN) { + ssi->tag_name[ssi->tag_index++] = *ssi->parsed; + } else { + /* The tag was too long so ignore it. */ + ssi->tag_state = TAG_NONE; + } + } + + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + + break; + + /* We are looking for the end of the lead-out marker. */ + case TAG_LEADOUT: + /* Remove leading whitespace between the tag leading and the first + * tag leadout character. */ + if((ssi->tag_index == 0) && ((*ssi->parsed == ' ') || + (*ssi->parsed == '\t') || (*ssi->parsed == '\n') || + (*ssi->parsed == '\r'))) { + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + break; + } + + /* Have we found the next character we expect for the tag leadout? */ + if(*ssi->parsed == g_pcTagLeadOut[ssi->tag_index]) { + /* Yes - move to the next one unless we have found the complete + * leadout, in which case we need to call the client to process + * the tag. */ + + /* Move on to the next character in the buffer */ + ssi->parse_left--; + ssi->parsed++; + + if(ssi->tag_index == (LEN_TAG_LEAD_OUT - 1)) { + /* Call the client to ask for the insert string for the + * tag we just found. */ +#if LWIP_HTTPD_SSI_MULTIPART + ssi->tag_part = 0; /* start with tag part 0 */ +#endif /* LWIP_HTTPD_SSI_MULTIPART */ + get_tag_insert(hs); + + /* Next time through, we are going to be sending data + * immediately, either the end of the block we start + * sending here or the insert string. */ + ssi->tag_index = 0; + ssi->tag_state = TAG_SENDING; + ssi->tag_end = ssi->parsed; +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + ssi->parsed = ssi->tag_started; +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG*/ + + /* If there is any unsent data in the buffer prior to the + * tag, we need to send it now. */ + if (ssi->tag_end > hs->file) { + /* How much of the data can we send? */ +#if LWIP_HTTPD_SSI_INCLUDE_TAG + len = (u16_t)LWIP_MIN(ssi->tag_end - hs->file, 0xffff); +#else /* LWIP_HTTPD_SSI_INCLUDE_TAG*/ + /* we would include the tag in sending */ + len = (u16_t)LWIP_MIN(ssi->tag_started - hs->file, 0xffff); +#endif /* LWIP_HTTPD_SSI_INCLUDE_TAG*/ + + err = http_write(pcb, hs->file, &len, HTTP_IS_DATA_VOLATILE(hs)); + if (err == ERR_OK) { + data_to_send = 1; +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + if(ssi->tag_started <= hs->file) { + /* pretend to have sent the tag, too */ + len += ssi->tag_end - ssi->tag_started; + } +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG*/ + hs->file += len; + hs->left -= len; + } + } + } else { + ssi->tag_index++; + } + } else { + /* We found an unexpected character so this is not a tag. Move + * back to idle state. */ + ssi->parse_left--; + ssi->parsed++; + ssi->tag_state = TAG_NONE; + } + break; + + /* + * We have found a valid tag and are in the process of sending + * data as a result of that discovery. We send either remaining data + * from the file prior to the insert point or the insert string itself. + */ + case TAG_SENDING: + /* Do we have any remaining file data to send from the buffer prior + * to the tag? */ + if(ssi->tag_end > hs->file) { + /* How much of the data can we send? */ +#if LWIP_HTTPD_SSI_INCLUDE_TAG + len = (u16_t)LWIP_MIN(ssi->tag_end - hs->file, 0xffff); +#else /* LWIP_HTTPD_SSI_INCLUDE_TAG*/ + LWIP_ASSERT("hs->started >= hs->file", ssi->tag_started >= hs->file); + /* we would include the tag in sending */ + len = (u16_t)LWIP_MIN(ssi->tag_started - hs->file, 0xffff); +#endif /* LWIP_HTTPD_SSI_INCLUDE_TAG*/ + if (len != 0) { + err = http_write(pcb, hs->file, &len, HTTP_IS_DATA_VOLATILE(hs)); + } else { + err = ERR_OK; + } + if (err == ERR_OK) { + data_to_send = 1; +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + if(ssi->tag_started <= hs->file) { + /* pretend to have sent the tag, too */ + len += ssi->tag_end - ssi->tag_started; + } +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG*/ + hs->file += len; + hs->left -= len; + } + } else { +#if LWIP_HTTPD_SSI_MULTIPART + if(ssi->tag_index >= ssi->tag_insert_len) { + /* Did the last SSIHandler have more to send? */ + if (ssi->tag_part != HTTPD_LAST_TAG_PART) { + /* If so, call it again */ + ssi->tag_index = 0; + get_tag_insert(hs); + } + } +#endif /* LWIP_HTTPD_SSI_MULTIPART */ + + /* Do we still have insert data left to send? */ + if(ssi->tag_index < ssi->tag_insert_len) { + /* We are sending the insert string itself. How much of the + * insert can we send? */ + len = (ssi->tag_insert_len - ssi->tag_index); + + /* Note that we set the copy flag here since we only have a + * single tag insert buffer per connection. If we don't do + * this, insert corruption can occur if more than one insert + * is processed before we call tcp_output. */ + err = http_write(pcb, &(ssi->tag_insert[ssi->tag_index]), &len, + HTTP_IS_TAG_VOLATILE(hs)); + if (err == ERR_OK) { + data_to_send = 1; + ssi->tag_index += len; + /* Don't return here: keep on sending data */ + } + } else { +#if LWIP_HTTPD_SSI_MULTIPART + if (ssi->tag_part == HTTPD_LAST_TAG_PART) +#endif /* LWIP_HTTPD_SSI_MULTIPART */ + { + /* We have sent all the insert data so go back to looking for + * a new tag. */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Everything sent.\n")); + ssi->tag_index = 0; + ssi->tag_state = TAG_NONE; +#if !LWIP_HTTPD_SSI_INCLUDE_TAG + ssi->parsed = ssi->tag_end; +#endif /* !LWIP_HTTPD_SSI_INCLUDE_TAG*/ + } + } + break; + default: + break; + } + } + } + + /* If we drop out of the end of the for loop, this implies we must have + * file data to send so send it now. In TAG_SENDING state, we've already + * handled this so skip the send if that's the case. */ + if((ssi->tag_state != TAG_SENDING) && (ssi->parsed > hs->file)) { + len = (u16_t)LWIP_MIN(ssi->parsed - hs->file, 0xffff); + + err = http_write(pcb, hs->file, &len, HTTP_IS_DATA_VOLATILE(hs)); + if (err == ERR_OK) { + data_to_send = 1; + hs->file += len; + hs->left -= len; + } + } + return data_to_send; +} +#endif /* LWIP_HTTPD_SSI */ + +/** + * Try to send more data on this pcb. + * + * @param pcb the pcb to send data + * @param hs connection state + */ +static u8_t +http_send(struct tcp_pcb *pcb, struct http_state *hs) +{ + u8_t data_to_send = HTTP_NO_DATA_TO_SEND; + + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_send: pcb=%p hs=%p left=%d\n", (void*)pcb, + (void*)hs, hs != NULL ? (int)hs->left : 0)); + +#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND + if (hs->unrecved_bytes != 0) { + return 0; + } +#endif /* LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND */ + + /* If we were passed a NULL state structure pointer, ignore the call. */ + if (hs == NULL) { + return 0; + } + +#if LWIP_HTTPD_FS_ASYNC_READ + /* Check if we are allowed to read from this file. + (e.g. SSI might want to delay sending until data is available) */ + if (!fs_is_file_ready(hs->handle, http_continue, hs)) { + return 0; + } +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + +#if LWIP_HTTPD_DYNAMIC_HEADERS + /* Do we have any more header data to send for this file? */ + if (hs->hdr_index < NUM_FILE_HDR_STRINGS) { + data_to_send = http_send_headers(pcb, hs); + if ((data_to_send != HTTP_DATA_TO_SEND_CONTINUE) && + (hs->hdr_index < NUM_FILE_HDR_STRINGS)) { + return data_to_send; + } + } +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ + + /* Have we run out of file data to send? If so, we need to read the next + * block from the file. */ + if (hs->left == 0) { + if (!http_check_eof(pcb, hs)) { + return 0; + } + } + +#if LWIP_HTTPD_SSI + if(hs->ssi) { + data_to_send = http_send_data_ssi(pcb, hs); + } else +#endif /* LWIP_HTTPD_SSI */ + { + data_to_send = http_send_data_nonssi(pcb, hs); + } + + if((hs->left == 0) && (fs_bytes_left(hs->handle) <= 0)) { + /* We reached the end of the file so this request is done. + * This adds the FIN flag right into the last data segment. */ + LWIP_DEBUGF(HTTPD_DEBUG, ("End of file.\n")); + http_eof(pcb, hs); + return 0; + } + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("send_data end.\n")); + return data_to_send; +} + +#if LWIP_HTTPD_SUPPORT_EXTSTATUS +/** Initialize a http connection with a file to send for an error message + * + * @param hs http connection state + * @param error_nr HTTP error number + * @return ERR_OK if file was found and hs has been initialized correctly + * another err_t otherwise + */ +static err_t +http_find_error_file(struct http_state *hs, u16_t error_nr) +{ + const char *uri1, *uri2, *uri3; + err_t err; + + if (error_nr == 501) { + uri1 = "/501.html"; + uri2 = "/501.htm"; + uri3 = "/501.shtml"; + } else { + /* 400 (bad request is the default) */ + uri1 = "/400.html"; + uri2 = "/400.htm"; + uri3 = "/400.shtml"; + } + err = fs_open(&hs->file_handle, uri1); + if (err != ERR_OK) { + err = fs_open(&hs->file_handle, uri2); + if (err != ERR_OK) { + err = fs_open(&hs->file_handle, uri3); + if (err != ERR_OK) { + LWIP_DEBUGF(HTTPD_DEBUG, ("Error page for error %"U16_F" not found\n", + error_nr)); + return ERR_ARG; + } + } + } + return http_init_file(hs, &hs->file_handle, 0, NULL, 0, NULL); +} +#else /* LWIP_HTTPD_SUPPORT_EXTSTATUS */ +#define http_find_error_file(hs, error_nr) ERR_ARG +#endif /* LWIP_HTTPD_SUPPORT_EXTSTATUS */ + +/** + * Get the file struct for a 404 error page. + * Tries some file names and returns NULL if none found. + * + * @param uri pointer that receives the actual file name URI + * @return file struct for the error page or NULL no matching file was found + */ +static struct fs_file * +http_get_404_file(struct http_state *hs, const char **uri) +{ + err_t err; + + *uri = "/404.html"; + err = fs_open(&hs->file_handle, *uri); + if (err != ERR_OK) { + /* 404.html doesn't exist. Try 404.htm instead. */ + *uri = "/404.htm"; + err = fs_open(&hs->file_handle, *uri); + if (err != ERR_OK) { + /* 404.htm doesn't exist either. Try 404.shtml instead. */ + *uri = "/404.shtml"; + err = fs_open(&hs->file_handle, *uri); + if (err != ERR_OK) { + /* 404.htm doesn't exist either. Indicate to the caller that it should + * send back a default 404 page. + */ + *uri = NULL; + return NULL; + } + } + } + + return &hs->file_handle; +} + +#if LWIP_HTTPD_SUPPORT_POST +static err_t +http_handle_post_finished(struct http_state *hs) +{ +#if LWIP_HTTPD_POST_MANUAL_WND + /* Prevent multiple calls to httpd_post_finished, since it might have already + been called before from httpd_post_data_recved(). */ + if (hs->post_finished) { + return ERR_OK; + } + hs->post_finished = 1; +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + /* application error or POST finished */ + /* NULL-terminate the buffer */ + http_uri_buf[0] = 0; + httpd_post_finished(hs, http_uri_buf, LWIP_HTTPD_URI_BUF_LEN); + return http_find_file(hs, http_uri_buf, 0); +} + +/** Pass received POST body data to the application and correctly handle + * returning a response document or closing the connection. + * ATTENTION: The application is responsible for the pbuf now, so don't free it! + * + * @param hs http connection state + * @param p pbuf to pass to the application + * @return ERR_OK if passed successfully, another err_t if the response file + * hasn't been found (after POST finished) + */ +static err_t +http_post_rxpbuf(struct http_state *hs, struct pbuf *p) +{ + err_t err; + + if (p != NULL) { + /* adjust remaining Content-Length */ + if (hs->post_content_len_left < p->tot_len) { + hs->post_content_len_left = 0; + } else { + hs->post_content_len_left -= p->tot_len; + } + } +#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND + /* prevent connection being closed if httpd_post_data_recved() is called nested */ + hs->unrecved_bytes++; +#endif + err = httpd_post_receive_data(hs, p); +#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND + hs->unrecved_bytes--; +#endif + if (err != ERR_OK) { + /* Ignore remaining content in case of application error */ + hs->post_content_len_left = 0; + } + if (hs->post_content_len_left == 0) { +#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND + if (hs->unrecved_bytes != 0) { + return ERR_OK; + } +#endif /* LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND */ + /* application error or POST finished */ + return http_handle_post_finished(hs); + } + + return ERR_OK; +} + +/** Handle a post request. Called from http_parse_request when method 'POST' + * is found. + * + * @param p The input pbuf (containing the POST header and body). + * @param hs The http connection state. + * @param data HTTP request (header and part of body) from input pbuf(s). + * @param data_len Size of 'data'. + * @param uri The HTTP URI parsed from input pbuf(s). + * @param uri_end Pointer to the end of 'uri' (here, the rest of the HTTP + * header starts). + * @return ERR_OK: POST correctly parsed and accepted by the application. + * ERR_INPROGRESS: POST not completely parsed (no error yet) + * another err_t: Error parsing POST or denied by the application + */ +static err_t +http_post_request(struct pbuf *inp, struct http_state *hs, + char *data, u16_t data_len, char *uri, char *uri_end) +{ + err_t err; + /* search for end-of-header (first double-CRLF) */ + char* crlfcrlf = lwip_strnstr(uri_end + 1, CRLF CRLF, data_len - (uri_end + 1 - data)); + + if (crlfcrlf != NULL) { + /* search for "Content-Length: " */ +#define HTTP_HDR_CONTENT_LEN "Content-Length: " +#define HTTP_HDR_CONTENT_LEN_LEN 16 +#define HTTP_HDR_CONTENT_LEN_DIGIT_MAX_LEN 10 + char *scontent_len = lwip_strnstr(uri_end + 1, HTTP_HDR_CONTENT_LEN, crlfcrlf - (uri_end + 1)); + if (scontent_len != NULL) { + char *scontent_len_end = lwip_strnstr(scontent_len + HTTP_HDR_CONTENT_LEN_LEN, CRLF, HTTP_HDR_CONTENT_LEN_DIGIT_MAX_LEN); + if (scontent_len_end != NULL) { + int content_len; + char *content_len_num = scontent_len + HTTP_HDR_CONTENT_LEN_LEN; + content_len = atoi(content_len_num); + if (content_len == 0) { + /* if atoi returns 0 on error, fix this */ + if ((content_len_num[0] != '0') || (content_len_num[1] != '\r')) { + content_len = -1; + } + } + if (content_len >= 0) { + /* adjust length of HTTP header passed to application */ + const char *hdr_start_after_uri = uri_end + 1; + u16_t hdr_len = (u16_t)LWIP_MIN(data_len, crlfcrlf + 4 - data); + u16_t hdr_data_len = (u16_t)LWIP_MIN(data_len, crlfcrlf + 4 - hdr_start_after_uri); + u8_t post_auto_wnd = 1; + http_uri_buf[0] = 0; + /* trim http header */ + *crlfcrlf = 0; + err = httpd_post_begin(hs, uri, hdr_start_after_uri, hdr_data_len, content_len, + http_uri_buf, LWIP_HTTPD_URI_BUF_LEN, &post_auto_wnd); + if (err == ERR_OK) { + /* try to pass in data of the first pbuf(s) */ + struct pbuf *q = inp; + u16_t start_offset = hdr_len; +#if LWIP_HTTPD_POST_MANUAL_WND + hs->no_auto_wnd = !post_auto_wnd; +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + /* set the Content-Length to be received for this POST */ + hs->post_content_len_left = (u32_t)content_len; + + /* get to the pbuf where the body starts */ + while((q != NULL) && (q->len <= start_offset)) { + start_offset -= q->len; + q = q->next; + } + if (q != NULL) { + /* hide the remaining HTTP header */ + pbuf_header(q, -(s16_t)start_offset); +#if LWIP_HTTPD_POST_MANUAL_WND + if (!post_auto_wnd) { + /* already tcp_recved() this data... */ + hs->unrecved_bytes = q->tot_len; + } +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + pbuf_ref(q); + return http_post_rxpbuf(hs, q); + } else if (hs->post_content_len_left == 0) { + q = pbuf_alloc(PBUF_RAW, 0, PBUF_REF); + return http_post_rxpbuf(hs, q); + } else { + return ERR_OK; + } + } else { + /* return file passed from application */ + return http_find_file(hs, http_uri_buf, 0); + } + } else { + LWIP_DEBUGF(HTTPD_DEBUG, ("POST received invalid Content-Length: %s\n", + content_len_num)); + return ERR_ARG; + } + } + } + /* If we come here, headers are fully received (double-crlf), but Content-Length + was not included. Since this is currently the only supported method, we have + to fail in this case! */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Error when parsing Content-Length\n")); + return ERR_ARG; + } + /* if we come here, the POST is incomplete */ +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + return ERR_INPROGRESS; +#else /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + return ERR_ARG; +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ +} + +#if LWIP_HTTPD_POST_MANUAL_WND +/** A POST implementation can call this function to update the TCP window. + * This can be used to throttle data reception (e.g. when received data is + * programmed to flash and data is received faster than programmed). + * + * @param connection A connection handle passed to httpd_post_begin for which + * httpd_post_finished has *NOT* been called yet! + * @param recved_len Length of data received (for window update) + */ +void httpd_post_data_recved(void *connection, u16_t recved_len) +{ + struct http_state *hs = (struct http_state*)connection; + if (hs != NULL) { + if (hs->no_auto_wnd) { + u16_t len = recved_len; + if (hs->unrecved_bytes >= recved_len) { + hs->unrecved_bytes -= recved_len; + } else { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_LEVEL_WARNING, ("httpd_post_data_recved: recved_len too big\n")); + len = (u16_t)hs->unrecved_bytes; + hs->unrecved_bytes = 0; + } + if (hs->pcb != NULL) { + if (len != 0) { + tcp_recved(hs->pcb, len); + } + if ((hs->post_content_len_left == 0) && (hs->unrecved_bytes == 0)) { + /* finished handling POST */ + http_handle_post_finished(hs); + http_send(hs->pcb, hs); + } + } + } + } +} +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + +#endif /* LWIP_HTTPD_SUPPORT_POST */ + +#if LWIP_HTTPD_FS_ASYNC_READ +/** Try to send more data if file has been blocked before + * This is a callback function passed to fs_read_async(). + */ +static void +http_continue(void *connection) +{ + struct http_state *hs = (struct http_state*)connection; + if (hs && (hs->pcb) && (hs->handle)) { + LWIP_ASSERT("hs->pcb != NULL", hs->pcb != NULL); + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("httpd_continue: try to send more data\n")); + if (http_send(hs->pcb, hs)) { + /* If we wrote anything to be sent, go ahead and send it now. */ + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("tcp_output\n")); + tcp_output(hs->pcb); + } + } +} +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + +/** + * When data has been received in the correct state, try to parse it + * as a HTTP request. + * + * @param inp the received pbuf + * @param hs the connection state + * @param pcb the tcp_pcb which received this packet + * @return ERR_OK if request was OK and hs has been initialized correctly + * ERR_INPROGRESS if request was OK so far but not fully received + * another err_t otherwise + */ +static err_t +http_parse_request(struct pbuf *inp, struct http_state *hs, struct tcp_pcb *pcb) +{ + char *data; + char *crlf; + u16_t data_len; + struct pbuf *p = inp; +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + u16_t clen; +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ +#if LWIP_HTTPD_SUPPORT_POST + err_t err; +#endif /* LWIP_HTTPD_SUPPORT_POST */ + + LWIP_UNUSED_ARG(pcb); /* only used for post */ + LWIP_ASSERT("p != NULL", p != NULL); + LWIP_ASSERT("hs != NULL", hs != NULL); + + if ((hs->handle != NULL) || (hs->file != NULL)) { + LWIP_DEBUGF(HTTPD_DEBUG, ("Received data while sending a file\n")); + /* already sending a file */ + /* @todo: abort? */ + return ERR_USE; + } + +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + + LWIP_DEBUGF(HTTPD_DEBUG, ("Received %"U16_F" bytes\n", p->tot_len)); + + /* first check allowed characters in this pbuf? */ + + /* enqueue the pbuf */ + if (hs->req == NULL) { + LWIP_DEBUGF(HTTPD_DEBUG, ("First pbuf\n")); + hs->req = p; + } else { + LWIP_DEBUGF(HTTPD_DEBUG, ("pbuf enqueued\n")); + pbuf_cat(hs->req, p); + } + /* increase pbuf ref counter as it is freed when we return but we want to + keep it on the req list */ + pbuf_ref(p); + + if (hs->req->next != NULL) { + data_len = LWIP_MIN(hs->req->tot_len, LWIP_HTTPD_MAX_REQ_LENGTH); + pbuf_copy_partial(hs->req, httpd_req_buf, data_len, 0); + data = httpd_req_buf; + } else +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + { + data = (char *)p->payload; + data_len = p->len; + if (p->len != p->tot_len) { + LWIP_DEBUGF(HTTPD_DEBUG, ("Warning: incomplete header due to chained pbufs\n")); + } + } + + /* received enough data for minimal request? */ + if (data_len >= MIN_REQ_LEN) { + /* wait for CRLF before parsing anything */ + crlf = lwip_strnstr(data, CRLF, data_len); + if (crlf != NULL) { +#if LWIP_HTTPD_SUPPORT_POST + int is_post = 0; +#endif /* LWIP_HTTPD_SUPPORT_POST */ + int is_09 = 0; + char *sp1, *sp2; + u16_t left_len, uri_len; + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("CRLF received, parsing request\n")); + /* parse method */ + if (!strncmp(data, "GET ", 4)) { + sp1 = data + 3; + /* received GET request */ + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Received GET request\"\n")); +#if LWIP_HTTPD_SUPPORT_POST + } else if (!strncmp(data, "POST ", 5)) { + /* store request type */ + is_post = 1; + sp1 = data + 4; + /* received GET request */ + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Received POST request\n")); +#endif /* LWIP_HTTPD_SUPPORT_POST */ + } else { + /* null-terminate the METHOD (pbuf is freed anyway wen returning) */ + data[4] = 0; + /* unsupported method! */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Unsupported request method (not implemented): \"%s\"\n", + data)); + return http_find_error_file(hs, 501); + } + /* if we come here, method is OK, parse URI */ + left_len = (u16_t)(data_len - ((sp1 +1) - data)); + sp2 = lwip_strnstr(sp1 + 1, " ", left_len); +#if LWIP_HTTPD_SUPPORT_V09 + if (sp2 == NULL) { + /* HTTP 0.9: respond with correct protocol version */ + sp2 = lwip_strnstr(sp1 + 1, CRLF, left_len); + is_09 = 1; +#if LWIP_HTTPD_SUPPORT_POST + if (is_post) { + /* HTTP/0.9 does not support POST */ + goto badrequest; + } +#endif /* LWIP_HTTPD_SUPPORT_POST */ + } +#endif /* LWIP_HTTPD_SUPPORT_V09 */ + uri_len = (u16_t)(sp2 - (sp1 + 1)); + if ((sp2 != 0) && (sp2 > sp1)) { + /* wait for CRLFCRLF (indicating end of HTTP headers) before parsing anything */ + if (lwip_strnstr(data, CRLF CRLF, data_len) != NULL) { + char *uri = sp1 + 1; +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + /* This is HTTP/1.0 compatible: for strict 1.1, a connection + would always be persistent unless "close" was specified. */ + if (!is_09 && (lwip_strnstr(data, HTTP11_CONNECTIONKEEPALIVE, data_len) || + lwip_strnstr(data, HTTP11_CONNECTIONKEEPALIVE2, data_len))) { + hs->keepalive = 1; + } else { + hs->keepalive = 0; + } +#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ + /* null-terminate the METHOD (pbuf is freed anyway wen returning) */ + *sp1 = 0; + uri[uri_len] = 0; + LWIP_DEBUGF(HTTPD_DEBUG, ("Received \"%s\" request for URI: \"%s\"\n", + data, uri)); +#if LWIP_HTTPD_SUPPORT_POST + if (is_post) { +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + struct pbuf *q = hs->req; +#else /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + struct pbuf *q = inp; +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + err = http_post_request(q, hs, data, data_len, uri, sp2); + if (err != ERR_OK) { + /* restore header for next try */ + *sp1 = ' '; + *sp2 = ' '; + uri[uri_len] = ' '; + } + if (err == ERR_ARG) { + goto badrequest; + } + return err; + } else +#endif /* LWIP_HTTPD_SUPPORT_POST */ + { + return http_find_file(hs, uri, is_09); + } + } + } else { + LWIP_DEBUGF(HTTPD_DEBUG, ("invalid URI\n")); + } + } + } + +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + clen = pbuf_clen(hs->req); + if ((hs->req->tot_len <= LWIP_HTTPD_REQ_BUFSIZE) && + (clen <= LWIP_HTTPD_REQ_QUEUELEN)) { + /* request not fully received (too short or CRLF is missing) */ + return ERR_INPROGRESS; + } else +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + { +#if LWIP_HTTPD_SUPPORT_POST +badrequest: +#endif /* LWIP_HTTPD_SUPPORT_POST */ + LWIP_DEBUGF(HTTPD_DEBUG, ("bad request\n")); + /* could not parse request */ + return http_find_error_file(hs, 400); + } +} + +/** Try to find the file specified by uri and, if found, initialize hs + * accordingly. + * + * @param hs the connection state + * @param uri the HTTP header URI + * @param is_09 1 if the request is HTTP/0.9 (no HTTP headers in response) + * @return ERR_OK if file was found and hs has been initialized correctly + * another err_t otherwise + */ +static err_t +http_find_file(struct http_state *hs, const char *uri, int is_09) +{ + size_t loop; + struct fs_file *file = NULL; + char *params = NULL; + err_t err; +#if LWIP_HTTPD_CGI + int i; +#endif /* LWIP_HTTPD_CGI */ +#if !LWIP_HTTPD_SSI + const +#endif /* !LWIP_HTTPD_SSI */ + /* By default, assume we will not be processing server-side-includes tags */ + u8_t tag_check = 0; + + /* Have we been asked for the default file (in root or a directory) ? */ +#if LWIP_HTTPD_MAX_REQUEST_URI_LEN + size_t uri_len = strlen(uri); + if ((uri_len > 0) && (uri[uri_len-1] == '/') && + ((uri != http_uri_buf) || (uri_len == 1))) { + size_t copy_len = LWIP_MIN(sizeof(http_uri_buf) - 1, uri_len - 1); + if (copy_len > 0) { + MEMCPY(http_uri_buf, uri, copy_len); + http_uri_buf[copy_len] = 0; + } +#else /* LWIP_HTTPD_MAX_REQUEST_URI_LEN */ + if ((uri[0] == '/') && (uri[1] == 0)) { +#endif /* LWIP_HTTPD_MAX_REQUEST_URI_LEN */ + /* Try each of the configured default filenames until we find one + that exists. */ + for (loop = 0; loop < NUM_DEFAULT_FILENAMES; loop++) { + const char* file_name; +#if LWIP_HTTPD_MAX_REQUEST_URI_LEN + if (copy_len > 0) { + size_t len_left = sizeof(http_uri_buf) - copy_len - 1; + if (len_left > 0) { + size_t name_len = strlen(g_psDefaultFilenames[loop].name); + size_t name_copy_len = LWIP_MIN(len_left, name_len); + MEMCPY(&http_uri_buf[copy_len], g_psDefaultFilenames[loop].name, name_copy_len); + } + file_name = http_uri_buf; + } else +#endif /* LWIP_HTTPD_MAX_REQUEST_URI_LEN */ + { + file_name = g_psDefaultFilenames[loop].name; + } + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Looking for %s...\n", file_name)); + err = fs_open(&hs->file_handle, file_name); + if(err == ERR_OK) { + uri = file_name; + file = &hs->file_handle; + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Opened.\n")); +#if LWIP_HTTPD_SSI + tag_check = g_psDefaultFilenames[loop].shtml; +#endif /* LWIP_HTTPD_SSI */ + break; + } + } + } + if (file == NULL) { + /* No - we've been asked for a specific file. */ + /* First, isolate the base URI (without any parameters) */ + params = (char *)strchr(uri, '?'); + if (params != NULL) { + /* URI contains parameters. NULL-terminate the base URI */ + *params = '\0'; + params++; + } + +#if LWIP_HTTPD_CGI + http_cgi_paramcount = -1; + /* Does the base URI we have isolated correspond to a CGI handler? */ + if (g_iNumCGIs && g_pCGIs) { + for (i = 0; i < g_iNumCGIs; i++) { + if (strcmp(uri, g_pCGIs[i].pcCGIName) == 0) { + /* + * We found a CGI that handles this URI so extract the + * parameters and call the handler. + */ + http_cgi_paramcount = extract_uri_parameters(hs, params); + uri = g_pCGIs[i].pfnCGIHandler(i, http_cgi_paramcount, hs->params, + hs->param_vals); + break; + } + } + } +#endif /* LWIP_HTTPD_CGI */ + + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Opening %s\n", uri)); + + err = fs_open(&hs->file_handle, uri); + if (err == ERR_OK) { + file = &hs->file_handle; + } else { + file = http_get_404_file(hs, &uri); + } +#if LWIP_HTTPD_SSI + if (file != NULL) { + /* See if we have been asked for an shtml file and, if so, + enable tag checking. */ + const char* ext = NULL, *sub; + char* param = (char*)strstr(uri, "?"); + if (param != NULL) { + /* separate uri from parameters for now, set back later */ + *param = 0; + } + sub = uri; + ext = uri; + for (sub = strstr(sub, "."); sub != NULL; sub = strstr(sub, ".")) + { + ext = sub; + sub++; + } + tag_check = 0; + for (loop = 0; loop < NUM_SHTML_EXTENSIONS; loop++) { + if (!lwip_stricmp(ext, g_pcSSIExtensions[loop])) { + tag_check = 1; + break; + } + } + if (param != NULL) { + *param = '?'; + } + } +#endif /* LWIP_HTTPD_SSI */ + } + if (file == NULL) { + /* None of the default filenames exist so send back a 404 page */ + file = http_get_404_file(hs, &uri); + } + return http_init_file(hs, file, is_09, uri, tag_check, params); +} + +/** Initialize a http connection with a file to send (if found). + * Called by http_find_file and http_find_error_file. + * + * @param hs http connection state + * @param file file structure to send (or NULL if not found) + * @param is_09 1 if the request is HTTP/0.9 (no HTTP headers in response) + * @param uri the HTTP header URI + * @param tag_check enable SSI tag checking + * @param params != NULL if URI has parameters (separated by '?') + * @return ERR_OK if file was found and hs has been initialized correctly + * another err_t otherwise + */ +static err_t +http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const char *uri, + u8_t tag_check, char* params) +{ + if (file != NULL) { + /* file opened, initialise struct http_state */ +#if LWIP_HTTPD_SSI + if (tag_check) { + struct http_ssi_state *ssi = http_ssi_state_alloc(); + if (ssi != NULL) { + ssi->tag_index = 0; + ssi->tag_state = TAG_NONE; + ssi->parsed = file->data; + ssi->parse_left = file->len; + ssi->tag_end = file->data; + hs->ssi = ssi; + } + } +#else /* LWIP_HTTPD_SSI */ + LWIP_UNUSED_ARG(tag_check); +#endif /* LWIP_HTTPD_SSI */ + hs->handle = file; + hs->file = file->data; + LWIP_ASSERT("File length must be positive!", (file->len >= 0)); +#if LWIP_HTTPD_CUSTOM_FILES + if (file->is_custom_file && (file->data == NULL)) { + /* custom file, need to read data first (via fs_read_custom) */ + hs->left = 0; + } else +#endif /* LWIP_HTTPD_CUSTOM_FILES */ + { + hs->left = file->len; + } + hs->retries = 0; +#if LWIP_HTTPD_TIMING + hs->time_started = sys_now(); +#endif /* LWIP_HTTPD_TIMING */ +#if !LWIP_HTTPD_DYNAMIC_HEADERS + LWIP_ASSERT("HTTP headers not included in file system", + (hs->handle->flags & FS_FILE_FLAGS_HEADER_INCLUDED) != 0); +#endif /* !LWIP_HTTPD_DYNAMIC_HEADERS */ +#if LWIP_HTTPD_SUPPORT_V09 + if (is_09 && ((hs->handle->flags & FS_FILE_FLAGS_HEADER_INCLUDED) != 0)) { + /* HTTP/0.9 responses are sent without HTTP header, + search for the end of the header. */ + char *file_start = lwip_strnstr(hs->file, CRLF CRLF, hs->left); + if (file_start != NULL) { + size_t diff = file_start + 4 - hs->file; + hs->file += diff; + hs->left -= (u32_t)diff; + } + } +#endif /* LWIP_HTTPD_SUPPORT_V09*/ +#if LWIP_HTTPD_CGI_SSI + if (params != NULL) { + /* URI contains parameters, call generic CGI handler */ + int count; +#if LWIP_HTTPD_CGI + if (http_cgi_paramcount >= 0) { + count = http_cgi_paramcount; + } else +#endif + { + count = extract_uri_parameters(hs, params); + } + httpd_cgi_handler(uri, count, http_cgi_params, http_cgi_param_vals +#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE + , hs->handle->state +#endif /* LWIP_HTTPD_FILE_STATE */ + ); + } +#else /* LWIP_HTTPD_CGI_SSI */ + LWIP_UNUSED_ARG(params); +#endif /* LWIP_HTTPD_CGI_SSI */ + } else { + hs->handle = NULL; + hs->file = NULL; + hs->left = 0; + hs->retries = 0; + } +#if LWIP_HTTPD_DYNAMIC_HEADERS + /* Determine the HTTP headers to send based on the file extension of + * the requested URI. */ + if ((hs->handle == NULL) || ((hs->handle->flags & FS_FILE_FLAGS_HEADER_INCLUDED) == 0)) { + get_http_headers(hs, uri); + } +#else /* LWIP_HTTPD_DYNAMIC_HEADERS */ + LWIP_UNUSED_ARG(uri); +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + if (hs->keepalive) { +#if LWIP_HTTPD_SSI + if (hs->ssi != NULL) { + hs->keepalive = 0; + } else +#endif /* LWIP_HTTPD_SSI */ + { + if ((hs->handle != NULL) && + ((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED|FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) { + hs->keepalive = 0; + } + } + } +#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ + return ERR_OK; +} + +/** + * The pcb had an error and is already deallocated. + * The argument might still be valid (if != NULL). + */ +static void +http_err(void *arg, err_t err) +{ + struct http_state *hs = (struct http_state *)arg; + LWIP_UNUSED_ARG(err); + + LWIP_DEBUGF(HTTPD_DEBUG, ("http_err: %s", lwip_strerr(err))); + + if (hs != NULL) { + http_state_free(hs); + } +} + +/** + * Data has been sent and acknowledged by the remote host. + * This means that more data can be sent. + */ +static err_t +http_sent(void *arg, struct tcp_pcb *pcb, u16_t len) +{ + struct http_state *hs = (struct http_state *)arg; + + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_sent %p\n", (void*)pcb)); + + LWIP_UNUSED_ARG(len); + + if (hs == NULL) { + return ERR_OK; + } + + hs->retries = 0; + + http_send(pcb, hs); + + return ERR_OK; +} + +/** + * The poll function is called every 2nd second. + * If there has been no data sent (which resets the retries) in 8 seconds, close. + * If the last portion of a file has not been sent in 2 seconds, close. + * + * This could be increased, but we don't want to waste resources for bad connections. + */ +static err_t +http_poll(void *arg, struct tcp_pcb *pcb) +{ + struct http_state *hs = (struct http_state *)arg; + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_poll: pcb=%p hs=%p pcb_state=%s\n", + (void*)pcb, (void*)hs, tcp_debug_state_str(pcb->state))); + + if (hs == NULL) { + err_t closed; + /* arg is null, close. */ + LWIP_DEBUGF(HTTPD_DEBUG, ("http_poll: arg is NULL, close\n")); + closed = http_close_conn(pcb, NULL); + LWIP_UNUSED_ARG(closed); +#if LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR + if (closed == ERR_MEM) { + tcp_abort(pcb); + return ERR_ABRT; + } +#endif /* LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR */ + return ERR_OK; + } else { + hs->retries++; + if (hs->retries == HTTPD_MAX_RETRIES) { + LWIP_DEBUGF(HTTPD_DEBUG, ("http_poll: too many retries, close\n")); + http_close_conn(pcb, hs); + return ERR_OK; + } + + /* If this connection has a file open, try to send some more data. If + * it has not yet received a GET request, don't do this since it will + * cause the connection to close immediately. */ + if(hs && (hs->handle)) { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_poll: try to send more data\n")); + if(http_send(pcb, hs)) { + /* If we wrote anything to be sent, go ahead and send it now. */ + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("tcp_output\n")); + tcp_output(pcb); + } + } + } + + return ERR_OK; +} + +/** + * Data has been received on this pcb. + * For HTTP 1.0, this should normally only happen once (if the request fits in one packet). + */ +static err_t +http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + struct http_state *hs = (struct http_state *)arg; + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_recv: pcb=%p pbuf=%p err=%s\n", (void*)pcb, + (void*)p, lwip_strerr(err))); + + if ((err != ERR_OK) || (p == NULL) || (hs == NULL)) { + /* error or closed by other side? */ + if (p != NULL) { + /* Inform TCP that we have taken the data. */ + tcp_recved(pcb, p->tot_len); + pbuf_free(p); + } + if (hs == NULL) { + /* this should not happen, only to be robust */ + LWIP_DEBUGF(HTTPD_DEBUG, ("Error, http_recv: hs is NULL, close\n")); + } + http_close_conn(pcb, hs); + return ERR_OK; + } + +#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND + if (hs->no_auto_wnd) { + hs->unrecved_bytes += p->tot_len; + } else +#endif /* LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND */ + { + /* Inform TCP that we have taken the data. */ + tcp_recved(pcb, p->tot_len); + } + +#if LWIP_HTTPD_SUPPORT_POST + if (hs->post_content_len_left > 0) { + /* reset idle counter when POST data is received */ + hs->retries = 0; + /* this is data for a POST, pass the complete pbuf to the application */ + http_post_rxpbuf(hs, p); + /* pbuf is passed to the application, don't free it! */ + if (hs->post_content_len_left == 0) { + /* all data received, send response or close connection */ + http_send(pcb, hs); + } + return ERR_OK; + } else +#endif /* LWIP_HTTPD_SUPPORT_POST */ + { + if (hs->handle == NULL) { + err_t parsed = http_parse_request(p, hs, pcb); + LWIP_ASSERT("http_parse_request: unexpected return value", parsed == ERR_OK + || parsed == ERR_INPROGRESS ||parsed == ERR_ARG || parsed == ERR_USE); +#if LWIP_HTTPD_SUPPORT_REQUESTLIST + if (parsed != ERR_INPROGRESS) { + /* request fully parsed or error */ + if (hs->req != NULL) { + pbuf_free(hs->req); + hs->req = NULL; + } + } +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + pbuf_free(p); + if (parsed == ERR_OK) { +#if LWIP_HTTPD_SUPPORT_POST + if (hs->post_content_len_left == 0) +#endif /* LWIP_HTTPD_SUPPORT_POST */ + { + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("http_recv: data %p len %"S32_F"\n", (const void*)hs->file, hs->left)); + http_send(pcb, hs); + } + } else if (parsed == ERR_ARG) { + /* @todo: close on ERR_USE? */ + http_close_conn(pcb, hs); + } + } else { + LWIP_DEBUGF(HTTPD_DEBUG, ("http_recv: already sending data\n")); + /* already sending but still receiving data, we might want to RST here? */ + pbuf_free(p); + } + } + return ERR_OK; +} + +/** + * A new incoming connection has been accepted. + */ +static err_t +http_accept(void *arg, struct tcp_pcb *pcb, err_t err) +{ + struct http_state *hs; + LWIP_UNUSED_ARG(err); + LWIP_UNUSED_ARG(arg); + LWIP_DEBUGF(HTTPD_DEBUG, ("http_accept %p / %p\n", (void*)pcb, arg)); + + if ((err != ERR_OK) || (pcb == NULL)) { + return ERR_VAL; + } + + /* Set priority */ + tcp_setprio(pcb, HTTPD_TCP_PRIO); + + /* Allocate memory for the structure that holds the state of the + connection - initialized by that function. */ + hs = http_state_alloc(); + if (hs == NULL) { + LWIP_DEBUGF(HTTPD_DEBUG, ("http_accept: Out of memory, RST\n")); + return ERR_MEM; + } + hs->pcb = pcb; + + /* Tell TCP that this is the structure we wish to be passed for our + callbacks. */ + tcp_arg(pcb, hs); + + /* Set up the various callback functions */ + tcp_recv(pcb, http_recv); + tcp_err(pcb, http_err); + tcp_poll(pcb, http_poll, HTTPD_POLL_INTERVAL); + tcp_sent(pcb, http_sent); + + return ERR_OK; +} + +/** + * @ingroup httpd + * Initialize the httpd: set up a listening PCB and bind it to the defined port + */ +void +httpd_init(void) +{ + struct tcp_pcb *pcb; + err_t err; + +#if HTTPD_USE_MEM_POOL + LWIP_MEMPOOL_INIT(HTTPD_STATE); +#if LWIP_HTTPD_SSI + LWIP_MEMPOOL_INIT(HTTPD_SSI_STATE); +#endif +#endif + LWIP_DEBUGF(HTTPD_DEBUG, ("httpd_init\n")); + + pcb = tcp_new_ip_type(IPADDR_TYPE_ANY); + LWIP_ASSERT("httpd_init: tcp_new failed", pcb != NULL); + tcp_setprio(pcb, HTTPD_TCP_PRIO); + /* set SOF_REUSEADDR here to explicitly bind httpd to multiple interfaces */ + err = tcp_bind(pcb, IP_ANY_TYPE, HTTPD_SERVER_PORT); + LWIP_UNUSED_ARG(err); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("httpd_init: tcp_bind failed", err == ERR_OK); + pcb = tcp_listen(pcb); + LWIP_ASSERT("httpd_init: tcp_listen failed", pcb != NULL); + tcp_accept(pcb, http_accept); +} + +#if LWIP_HTTPD_SSI +/** + * Set the SSI handler function. + * + * @param ssi_handler the SSI handler function + * @param tags an array of SSI tag strings to search for in SSI-enabled files + * @param num_tags number of tags in the 'tags' array + */ +void +http_set_ssi_handler(tSSIHandler ssi_handler, const char **tags, int num_tags) +{ + LWIP_DEBUGF(HTTPD_DEBUG, ("http_set_ssi_handler\n")); + + LWIP_ASSERT("no ssi_handler given", ssi_handler != NULL); + g_pfnSSIHandler = ssi_handler; + +#if LWIP_HTTPD_SSI_RAW + LWIP_UNUSED_ARG(tags); + LWIP_UNUSED_ARG(num_tags); +#else /* LWIP_HTTPD_SSI_RAW */ + LWIP_ASSERT("no tags given", tags != NULL); + LWIP_ASSERT("invalid number of tags", num_tags > 0); + + g_ppcTags = tags; + g_iNumTags = num_tags; +#endif /* !LWIP_HTTPD_SSI_RAW */ +} +#endif /* LWIP_HTTPD_SSI */ + +#if LWIP_HTTPD_CGI +/** + * Set an array of CGI filenames/handler functions + * + * @param cgis an array of CGI filenames/handler functions + * @param num_handlers number of elements in the 'cgis' array + */ +void +http_set_cgi_handlers(const tCGI *cgis, int num_handlers) +{ + LWIP_ASSERT("no cgis given", cgis != NULL); + LWIP_ASSERT("invalid number of handlers", num_handlers > 0); + + g_pCGIs = cgis; + g_iNumCGIs = num_handlers; +} +#endif /* LWIP_HTTPD_CGI */ + +#endif /* LWIP_TCP && LWIP_CALLBACK_API */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd_structs.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd_structs.h new file mode 100644 index 0000000..fbd135a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/httpd_structs.h @@ -0,0 +1,114 @@ +#ifndef LWIP_HTTPD_STRUCTS_H +#define LWIP_HTTPD_STRUCTS_H + +#include "lwip/apps/httpd.h" + +#if LWIP_HTTPD_DYNAMIC_HEADERS +/** This struct is used for a list of HTTP header strings for various + * filename extensions. */ +typedef struct +{ + const char *extension; + const char *content_type; +} tHTTPHeader; + +/** A list of strings used in HTTP headers (see RFC 1945 HTTP/1.0 and + * RFC 2616 HTTP/1.1 for header field definitions) */ +static const char * const g_psHTTPHeaderStrings[] = +{ + "HTTP/1.0 200 OK\r\n", + "HTTP/1.0 404 File not found\r\n", + "HTTP/1.0 400 Bad Request\r\n", + "HTTP/1.0 501 Not Implemented\r\n", + "HTTP/1.1 200 OK\r\n", + "HTTP/1.1 404 File not found\r\n", + "HTTP/1.1 400 Bad Request\r\n", + "HTTP/1.1 501 Not Implemented\r\n", + "Content-Length: ", + "Connection: Close\r\n", + "Connection: keep-alive\r\n", + "Connection: keep-alive\r\nContent-Length: ", + "Server: "HTTPD_SERVER_AGENT"\r\n", + "\r\n

404: The requested file cannot be found.

\r\n" +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE + ,"Connection: keep-alive\r\nContent-Length: 77\r\n\r\n

404: The requested file cannot be found.

\r\n" +#endif +}; + +/* Indexes into the g_psHTTPHeaderStrings array */ +#define HTTP_HDR_OK 0 /* 200 OK */ +#define HTTP_HDR_NOT_FOUND 1 /* 404 File not found */ +#define HTTP_HDR_BAD_REQUEST 2 /* 400 Bad request */ +#define HTTP_HDR_NOT_IMPL 3 /* 501 Not Implemented */ +#define HTTP_HDR_OK_11 4 /* 200 OK */ +#define HTTP_HDR_NOT_FOUND_11 5 /* 404 File not found */ +#define HTTP_HDR_BAD_REQUEST_11 6 /* 400 Bad request */ +#define HTTP_HDR_NOT_IMPL_11 7 /* 501 Not Implemented */ +#define HTTP_HDR_CONTENT_LENGTH 8 /* Content-Length: (HTTP 1.0)*/ +#define HTTP_HDR_CONN_CLOSE 9 /* Connection: Close (HTTP 1.1) */ +#define HTTP_HDR_CONN_KEEPALIVE 10 /* Connection: keep-alive (HTTP 1.1) */ +#define HTTP_HDR_KEEPALIVE_LEN 11 /* Connection: keep-alive + Content-Length: (HTTP 1.1)*/ +#define HTTP_HDR_SERVER 12 /* Server: HTTPD_SERVER_AGENT */ +#define DEFAULT_404_HTML 13 /* default 404 body */ +#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE +#define DEFAULT_404_HTML_PERSISTENT 14 /* default 404 body, but including Connection: keep-alive */ +#endif + + +#define HTTP_HDR_HTML "Content-type: text/html\r\n\r\n" +#define HTTP_HDR_SSI "Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n\r\n" +#define HTTP_HDR_GIF "Content-type: image/gif\r\n\r\n" +#define HTTP_HDR_PNG "Content-type: image/png\r\n\r\n" +#define HTTP_HDR_JPG "Content-type: image/jpeg\r\n\r\n" +#define HTTP_HDR_BMP "Content-type: image/bmp\r\n\r\n" +#define HTTP_HDR_ICO "Content-type: image/x-icon\r\n\r\n" +#define HTTP_HDR_APP "Content-type: application/octet-stream\r\n\r\n" +#define HTTP_HDR_JS "Content-type: application/javascript\r\n\r\n" +#define HTTP_HDR_RA "Content-type: application/javascript\r\n\r\n" +#define HTTP_HDR_CSS "Content-type: text/css\r\n\r\n" +#define HTTP_HDR_SWF "Content-type: application/x-shockwave-flash\r\n\r\n" +#define HTTP_HDR_XML "Content-type: text/xml\r\n\r\n" +#define HTTP_HDR_PDF "Content-type: application/pdf\r\n\r\n" +#define HTTP_HDR_JSON "Content-type: application/json\r\n\r\n" + +#define HTTP_HDR_DEFAULT_TYPE "Content-type: text/plain\r\n\r\n" + +/** A list of extension-to-HTTP header strings (see outdated RFC 1700 MEDIA TYPES + * and http://www.iana.org/assignments/media-types for registered content types + * and subtypes) */ +static const tHTTPHeader g_psHTTPHeaders[] = +{ + { "html", HTTP_HDR_HTML}, + { "htm", HTTP_HDR_HTML}, + { "shtml",HTTP_HDR_SSI}, + { "shtm", HTTP_HDR_SSI}, + { "ssi", HTTP_HDR_SSI}, + { "gif", HTTP_HDR_GIF}, + { "png", HTTP_HDR_PNG}, + { "jpg", HTTP_HDR_JPG}, + { "bmp", HTTP_HDR_BMP}, + { "ico", HTTP_HDR_ICO}, + { "class",HTTP_HDR_APP}, + { "cls", HTTP_HDR_APP}, + { "js", HTTP_HDR_JS}, + { "ram", HTTP_HDR_RA}, + { "css", HTTP_HDR_CSS}, + { "swf", HTTP_HDR_SWF}, + { "xml", HTTP_HDR_XML}, + { "xsl", HTTP_HDR_XML}, + { "pdf", HTTP_HDR_PDF}, + { "json", HTTP_HDR_JSON} +}; + +#define NUM_HTTP_HEADERS (sizeof(g_psHTTPHeaders) / sizeof(tHTTPHeader)) + +#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */ + +#if LWIP_HTTPD_SSI +static const char * const g_pcSSIExtensions[] = { + ".shtml", ".shtm", ".ssi", ".xml" +}; +#define NUM_SHTML_EXTENSIONS (sizeof(g_pcSSIExtensions) / sizeof(const char *)) +#endif /* LWIP_HTTPD_SSI */ + +#endif /* LWIP_HTTPD_STRUCTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata new file mode 100644 index 0000000..37b4203 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata @@ -0,0 +1,97 @@ +#!/usr/bin/perl + +open(OUTPUT, "> fsdata.c"); + +chdir("fs"); +open(FILES, "find . -type f |"); + +while($file = ) { + + # Do not include files in CVS directories nor backup files. + if($file =~ /(CVS|~)/) { + next; + } + + chop($file); + + open(HEADER, "> /tmp/header") || die $!; + if($file =~ /404/) { + print(HEADER "HTTP/1.0 404 File not found\r\n"); + } else { + print(HEADER "HTTP/1.0 200 OK\r\n"); + } + print(HEADER "Server: lwIP/pre-0.6 (http://www.sics.se/~adam/lwip/)\r\n"); + if($file =~ /\.html$/) { + print(HEADER "Content-type: text/html\r\n"); + } elsif($file =~ /\.gif$/) { + print(HEADER "Content-type: image/gif\r\n"); + } elsif($file =~ /\.png$/) { + print(HEADER "Content-type: image/png\r\n"); + } elsif($file =~ /\.jpg$/) { + print(HEADER "Content-type: image/jpeg\r\n"); + } elsif($file =~ /\.class$/) { + print(HEADER "Content-type: application/octet-stream\r\n"); + } elsif($file =~ /\.ram$/) { + print(HEADER "Content-type: audio/x-pn-realaudio\r\n"); + } else { + print(HEADER "Content-type: text/plain\r\n"); + } + print(HEADER "\r\n"); + close(HEADER); + + unless($file =~ /\.plain$/ || $file =~ /cgi/) { + system("cat /tmp/header $file > /tmp/file"); + } else { + system("cp $file /tmp/file"); + } + + open(FILE, "/tmp/file"); + unlink("/tmp/file"); + unlink("/tmp/header"); + + $file =~ s/\.//; + $fvar = $file; + $fvar =~ s-/-_-g; + $fvar =~ s-\.-_-g; + print(OUTPUT "static const unsigned char data".$fvar."[] = {\n"); + print(OUTPUT "\t/* $file */\n\t"); + for($j = 0; $j < length($file); $j++) { + printf(OUTPUT "%#02x, ", unpack("C", substr($file, $j, 1))); + } + printf(OUTPUT "0,\n"); + + + $i = 0; + while(read(FILE, $data, 1)) { + if($i == 0) { + print(OUTPUT "\t"); + } + printf(OUTPUT "%#02x, ", unpack("C", $data)); + $i++; + if($i == 10) { + print(OUTPUT "\n"); + $i = 0; + } + } + print(OUTPUT "};\n\n"); + close(FILE); + push(@fvars, $fvar); + push(@files, $file); +} + +for($i = 0; $i < @fvars; $i++) { + $file = $files[$i]; + $fvar = $fvars[$i]; + + if($i == 0) { + $prevfile = "NULL"; + } else { + $prevfile = "file" . $fvars[$i - 1]; + } + print(OUTPUT "const struct fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, "); + print(OUTPUT "data$fvar + ". (length($file) + 1) .", "); + print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n"); +} + +print(OUTPUT "#define FS_ROOT file$fvars[$i - 1]\n\n"); +print(OUTPUT "#define FS_NUMFILES $i\n"); diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata.c new file mode 100644 index 0000000..934e721 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/makefsdata.c @@ -0,0 +1,1033 @@ +/** + * makefsdata: Converts a directory structure for use with the lwIP httpd. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Jim Pettinato + * Simon Goldschmidt + * + * @todo: + * - take TCP_MSS, LWIP_TCP_TIMESTAMPS and + * PAYLOAD_ALIGN_TYPE/PAYLOAD_ALIGNMENT as arguments + */ + +#include +#include +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include "windows.h" +#else +#include +#endif +#include +#include +#include +#include + +/** Makefsdata can generate *all* files deflate-compressed (where file size shrinks). + * Since nearly all browsers support this, this is a good way to reduce ROM size. + * To compress the files, "miniz.c" must be downloaded seperately. + */ +#ifndef MAKEFS_SUPPORT_DEFLATE +#define MAKEFS_SUPPORT_DEFLATE 0 +#endif + +#define COPY_BUFSIZE (1024*1024) /* 1 MByte */ + +#if MAKEFS_SUPPORT_DEFLATE +#include "../miniz.c" + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint; + +#define my_max(a,b) (((a) > (b)) ? (a) : (b)) +#define my_min(a,b) (((a) < (b)) ? (a) : (b)) + +/* COMP_OUT_BUF_SIZE is the size of the output buffer used during compression. + COMP_OUT_BUF_SIZE must be >= 1 and <= OUT_BUF_SIZE */ +#define COMP_OUT_BUF_SIZE COPY_BUFSIZE + +/* OUT_BUF_SIZE is the size of the output buffer used during decompression. + OUT_BUF_SIZE must be a power of 2 >= TINFL_LZ_DICT_SIZE (because the low-level decompressor not only writes, but reads from the output buffer as it decompresses) */ +#define OUT_BUF_SIZE COPY_BUFSIZE +static uint8 s_outbuf[OUT_BUF_SIZE]; +static uint8 s_checkbuf[OUT_BUF_SIZE]; + +/* tdefl_compressor contains all the state needed by the low-level compressor so it's a pretty big struct (~300k). + This example makes it a global vs. putting it on the stack, of course in real-world usage you'll probably malloc() or new it. */ +tdefl_compressor g_deflator; +tinfl_decompressor g_inflator; + +int deflate_level = 10; /* default compression level, can be changed via command line */ +#define USAGE_ARG_DEFLATE " [-defl<:compr_level>]" +#else /* MAKEFS_SUPPORT_DEFLATE */ +#define USAGE_ARG_DEFLATE "" +#endif /* MAKEFS_SUPPORT_DEFLATE */ + +/* Compatibility defines Win32 vs. DOS */ +#ifdef WIN32 + +#define FIND_T WIN32_FIND_DATAA +#define FIND_T_FILENAME(fInfo) (fInfo.cFileName) +#define FIND_T_IS_DIR(fInfo) ((fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) +#define FIND_T_IS_FILE(fInfo) ((fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) +#define FIND_RET_T HANDLE +#define FINDFIRST_FILE(path, result) FindFirstFileA(path, result) +#define FINDFIRST_DIR(path, result) FindFirstFileA(path, result) +#define FINDNEXT(ff_res, result) FindNextFileA(ff_res, result) +#define FINDFIRST_SUCCEEDED(ret) (ret != INVALID_HANDLE_VALUE) +#define FINDNEXT_SUCCEEDED(ret) (ret == TRUE) + +#define GETCWD(path, len) GetCurrentDirectoryA(len, path) +#define CHDIR(path) SetCurrentDirectoryA(path) +#define CHDIR_SUCCEEDED(ret) (ret == TRUE) + +#else + +#define FIND_T struct ffblk +#define FIND_T_FILENAME(fInfo) (fInfo.ff_name) +#define FIND_T_IS_DIR(fInfo) ((fInfo.ff_attrib & FA_DIREC) == FA_DIREC) +#define FIND_T_IS_FILE(fInfo) (1) +#define FIND_RET_T int +#define FINDFIRST_FILE(path, result) findfirst(path, result, FA_ARCH) +#define FINDFIRST_DIR(path, result) findfirst(path, result, FA_DIREC) +#define FINDNEXT(ff_res, result) FindNextFileA(ff_res, result) +#define FINDFIRST_SUCCEEDED(ret) (ret == 0) +#define FINDNEXT_SUCCEEDED(ret) (ret == 0) + +#define GETCWD(path, len) getcwd(path, len) +#define CHDIR(path) chdir(path) +#define CHDIR_SUCCEEDED(ret) (ret == 0) + +#endif + +#define NEWLINE "\r\n" +#define NEWLINE_LEN 2 + +/* define this to get the header variables we use to build HTTP headers */ +#define LWIP_HTTPD_DYNAMIC_HEADERS 1 +#define LWIP_HTTPD_SSI 1 +#include "lwip/init.h" +#include "../httpd_structs.h" +#include "lwip/apps/fs.h" + +#include "../core/inet_chksum.c" +#include "../core/def.c" + +/** (Your server name here) */ +const char *serverID = "Server: "HTTPD_SERVER_AGENT"\r\n"; +char serverIDBuffer[1024]; + +/* change this to suit your MEM_ALIGNMENT */ +#define PAYLOAD_ALIGNMENT 4 +/* set this to 0 to prevent aligning payload */ +#define ALIGN_PAYLOAD 1 +/* define this to a type that has the required alignment */ +#define PAYLOAD_ALIGN_TYPE "unsigned int" +static int payload_alingment_dummy_counter = 0; + +#define HEX_BYTES_PER_LINE 16 + +#define MAX_PATH_LEN 256 + +struct file_entry +{ + struct file_entry* next; + const char* filename_c; +}; + +int process_sub(FILE *data_file, FILE *struct_file); +int process_file(FILE *data_file, FILE *struct_file, const char *filename); +int file_write_http_header(FILE *data_file, const char *filename, int file_size, u16_t *http_hdr_len, + u16_t *http_hdr_chksum, u8_t provide_content_len, int is_compressed); +int file_put_ascii(FILE *file, const char *ascii_string, int len, int *i); +int s_put_ascii(char *buf, const char *ascii_string, int len, int *i); +void concat_files(const char *file1, const char *file2, const char *targetfile); +int check_path(char* path, size_t size); + +/* 5 bytes per char + 3 bytes per line */ +static char file_buffer_c[COPY_BUFSIZE * 5 + ((COPY_BUFSIZE / HEX_BYTES_PER_LINE) * 3)]; + +char curSubdir[MAX_PATH_LEN]; +char lastFileVar[MAX_PATH_LEN]; +char hdr_buf[4096]; + +unsigned char processSubs = 1; +unsigned char includeHttpHeader = 1; +unsigned char useHttp11 = 0; +unsigned char supportSsi = 1; +unsigned char precalcChksum = 0; +unsigned char includeLastModified = 0; +#if MAKEFS_SUPPORT_DEFLATE +unsigned char deflateNonSsiFiles = 0; +size_t deflatedBytesReduced = 0; +size_t overallDataBytes = 0; +#endif + +struct file_entry* first_file = NULL; +struct file_entry* last_file = NULL; + +static void print_usage(void) +{ + printf(" Usage: htmlgen [targetdir] [-s] [-e] [-i] [-11] [-nossi] [-c] [-f:] [-m] [-svr:]" USAGE_ARG_DEFLATE NEWLINE NEWLINE); + printf(" targetdir: relative or absolute path to files to convert" NEWLINE); + printf(" switch -s: toggle processing of subdirectories (default is on)" NEWLINE); + printf(" switch -e: exclude HTTP header from file (header is created at runtime, default is off)" NEWLINE); + printf(" switch -11: include HTTP 1.1 header (1.0 is default)" NEWLINE); + printf(" switch -nossi: no support for SSI (cannot calculate Content-Length for SSI)" NEWLINE); + printf(" switch -c: precalculate checksums for all pages (default is off)" NEWLINE); + printf(" switch -f: target filename (default is \"fsdata.c\")" NEWLINE); + printf(" switch -m: include \"Last-Modified\" header based on file time" NEWLINE); + printf(" switch -svr: server identifier sent in HTTP response header ('Server' field)" NEWLINE); +#if MAKEFS_SUPPORT_DEFLATE + printf(" switch -defl: deflate-compress all non-SSI files (with opt. compr.-level, default=10)" NEWLINE); + printf(" ATTENTION: browser has to support \"Content-Encoding: deflate\"!" NEWLINE); +#endif + printf(" if targetdir not specified, htmlgen will attempt to" NEWLINE); + printf(" process files in subdirectory 'fs'" NEWLINE); +} + +int main(int argc, char *argv[]) +{ + char path[MAX_PATH_LEN]; + char appPath[MAX_PATH_LEN]; + FILE *data_file; + FILE *struct_file; + int filesProcessed; + int i; + char targetfile[MAX_PATH_LEN]; + strcpy(targetfile, "fsdata.c"); + + memset(path, 0, sizeof(path)); + memset(appPath, 0, sizeof(appPath)); + + printf(NEWLINE " makefsdata - HTML to C source converter" NEWLINE); + printf(" by Jim Pettinato - circa 2003 " NEWLINE); + printf(" extended by Simon Goldschmidt - 2009 " NEWLINE NEWLINE); + + strcpy(path, "fs"); + for (i = 1; i < argc; i++) { + if (argv[i] == NULL) { + continue; + } + if (argv[i][0] == '-') { + if (strstr(argv[i], "-svr:") == argv[i]) { + snprintf(serverIDBuffer, sizeof(serverIDBuffer), "Server: %s\r\n", &argv[i][5]); + serverID = serverIDBuffer; + printf("Using Server-ID: \"%s\"\n", serverID); + } else if (strstr(argv[i], "-s") == argv[i]) { + processSubs = 0; + } else if (strstr(argv[i], "-e") == argv[i]) { + includeHttpHeader = 0; + } else if (strstr(argv[i], "-11") == argv[i]) { + useHttp11 = 1; + } else if (strstr(argv[i], "-nossi") == argv[i]) { + supportSsi = 0; + } else if (strstr(argv[i], "-c") == argv[i]) { + precalcChksum = 1; + } else if (strstr(argv[i], "-f:") == argv[i]) { + strncpy(targetfile, &argv[i][3], sizeof(targetfile) - 1); + targetfile[sizeof(targetfile) - 1] = 0; + printf("Writing to file \"%s\"\n", targetfile); + } else if (strstr(argv[i], "-m") == argv[i]) { + includeLastModified = 1; + } else if (strstr(argv[i], "-defl") == argv[i]) { +#if MAKEFS_SUPPORT_DEFLATE + char* colon = strstr(argv[i], ":"); + if (colon) { + if (colon[1] != 0) { + int defl_level = atoi(&colon[1]); + if ((defl_level >= 0) && (defl_level <= 10)) { + deflate_level = defl_level; + } else { + printf("ERROR: deflate level must be [0..10]" NEWLINE); + exit(0); + } + } + } + deflateNonSsiFiles = 1; + printf("Deflating all non-SSI files with level %d (but only if size is reduced)" NEWLINE, deflate_level); +#else + printf("WARNING: Deflate support is disabled\n"); +#endif + } else if ((strstr(argv[i], "-?")) || (strstr(argv[i], "-h"))) { + print_usage(); + exit(0); + } + } else if ((argv[i][0] == '/') && (argv[i][1] == '?') && (argv[i][2] == 0)) { + print_usage(); + exit(0); + } else { + strncpy(path, argv[i], sizeof(path)-1); + path[sizeof(path)-1] = 0; + } + } + + if (!check_path(path, sizeof(path))) { + printf("Invalid path: \"%s\"." NEWLINE, path); + exit(-1); + } + + GETCWD(appPath, MAX_PATH_LEN); + /* if command line param or subdir named 'fs' not found spout usage verbiage */ + if (!CHDIR_SUCCEEDED(CHDIR(path))) { + /* if no subdir named 'fs' (or the one which was given) exists, spout usage verbiage */ + printf(" Failed to open directory \"%s\"." NEWLINE NEWLINE, path); + print_usage(); + exit(-1); + } + CHDIR(appPath); + + printf("HTTP %sheader will %s statically included." NEWLINE, + (includeHttpHeader ? (useHttp11 ? "1.1 " : "1.0 ") : ""), + (includeHttpHeader ? "be" : "not be")); + + sprintf(curSubdir, ""); /* start off in web page's root directory - relative paths */ + printf(" Processing all files in directory %s", path); + if (processSubs) { + printf(" and subdirectories..." NEWLINE NEWLINE); + } else { + printf("..." NEWLINE NEWLINE); + } + + data_file = fopen("fsdata.tmp", "wb"); + if (data_file == NULL) { + printf("Failed to create file \"fsdata.tmp\"\n"); + exit(-1); + } + struct_file = fopen("fshdr.tmp", "wb"); + if (struct_file == NULL) { + printf("Failed to create file \"fshdr.tmp\"\n"); + fclose(data_file); + exit(-1); + } + + CHDIR(path); + + fprintf(data_file, "#include \"lwip/apps/fs.h\"" NEWLINE); + fprintf(data_file, "#include \"lwip/def.h\"" NEWLINE); + fprintf(data_file, "#include \"fsdata.h\"" NEWLINE NEWLINE NEWLINE); + + fprintf(data_file, "#define file_NULL (struct fsdata_file *) NULL" NEWLINE NEWLINE NEWLINE); + /* define FS_FILE_FLAGS_HEADER_INCLUDED to 1 if not defined (compatibility with older httpd/fs) */ + fprintf(data_file, "#ifndef FS_FILE_FLAGS_HEADER_INCLUDED" NEWLINE "#define FS_FILE_FLAGS_HEADER_INCLUDED 1" NEWLINE "#endif" NEWLINE); + /* define FS_FILE_FLAGS_HEADER_PERSISTENT to 0 if not defined (compatibility with older httpd/fs: wasn't supported back then) */ + fprintf(data_file, "#ifndef FS_FILE_FLAGS_HEADER_PERSISTENT" NEWLINE "#define FS_FILE_FLAGS_HEADER_PERSISTENT 0" NEWLINE "#endif" NEWLINE); + + /* define alignment defines */ +#if ALIGN_PAYLOAD + fprintf(data_file, "/* FSDATA_FILE_ALIGNMENT: 0=off, 1=by variable, 2=by include */" NEWLINE "#ifndef FSDATA_FILE_ALIGNMENT" NEWLINE "#define FSDATA_FILE_ALIGNMENT 0" NEWLINE "#endif" NEWLINE); +#endif + fprintf(data_file, "#ifndef FSDATA_ALIGN_PRE" NEWLINE "#define FSDATA_ALIGN_PRE" NEWLINE "#endif" NEWLINE); + fprintf(data_file, "#ifndef FSDATA_ALIGN_POST" NEWLINE "#define FSDATA_ALIGN_POST" NEWLINE "#endif" NEWLINE); +#if ALIGN_PAYLOAD + fprintf(data_file, "#if FSDATA_FILE_ALIGNMENT==2" NEWLINE "#include \"fsdata_alignment.h\"" NEWLINE "#endif" NEWLINE); +#endif + + sprintf(lastFileVar, "NULL"); + + filesProcessed = process_sub(data_file, struct_file); + + /* data_file now contains all of the raw data.. now append linked list of + * file header structs to allow embedded app to search for a file name */ + fprintf(data_file, NEWLINE NEWLINE); + fprintf(struct_file, "#define FS_ROOT file_%s" NEWLINE, lastFileVar); + fprintf(struct_file, "#define FS_NUMFILES %d" NEWLINE NEWLINE, filesProcessed); + + fclose(data_file); + fclose(struct_file); + + CHDIR(appPath); + /* append struct_file to data_file */ + printf(NEWLINE "Creating target file..." NEWLINE NEWLINE); + concat_files("fsdata.tmp", "fshdr.tmp", targetfile); + + /* if succeeded, delete the temporary files */ + if (remove("fsdata.tmp") != 0) { + printf("Warning: failed to delete fsdata.tmp\n"); + } + if (remove("fshdr.tmp") != 0) { + printf("Warning: failed to delete fshdr.tmp\n"); + } + + printf(NEWLINE "Processed %d files - done." NEWLINE, filesProcessed); +#if MAKEFS_SUPPORT_DEFLATE + if (deflateNonSsiFiles) { + printf("(Deflated total byte reduction: %d bytes -> %d bytes (%.02f%%)" NEWLINE, + (int)overallDataBytes, (int)deflatedBytesReduced, (float)((deflatedBytesReduced*100.0)/overallDataBytes)); + } +#endif + printf(NEWLINE); + + while (first_file != NULL) { + struct file_entry* fe = first_file; + first_file = fe->next; + free(fe); + } + + return 0; +} + +int check_path(char* path, size_t size) +{ + size_t slen; + if (path[0] == 0) { + /* empty */ + return 0; + } + slen = strlen(path); + if (slen >= size) { + /* not NULL-terminated */ + return 0; + } + while ((slen > 0) && ((path[slen] == '\\') || (path[slen] == '/'))) { + /* path should not end with trailing backslash */ + path[slen] = 0; + slen--; + } + if (slen == 0) { + return 0; + } + return 1; +} + +static void copy_file(const char *filename_in, FILE *fout) +{ + FILE *fin; + size_t len; + void* buf; + fin = fopen(filename_in, "rb"); + if (fin == NULL) { + printf("Failed to open file \"%s\"\n", filename_in); + exit(-1); + } + buf = malloc(COPY_BUFSIZE); + while ((len = fread(buf, 1, COPY_BUFSIZE, fin)) > 0) { + fwrite(buf, 1, len, fout); + } + free(buf); + fclose(fin); +} + +void concat_files(const char *file1, const char *file2, const char *targetfile) +{ + FILE *fout; + fout = fopen(targetfile, "wb"); + if (fout == NULL) { + printf("Failed to open file \"%s\"\n", targetfile); + exit(-1); + } + copy_file(file1, fout); + copy_file(file2, fout); + fclose(fout); +} + +int process_sub(FILE *data_file, FILE *struct_file) +{ + FIND_T fInfo; + FIND_RET_T fret; + int filesProcessed = 0; + + if (processSubs) { + /* process subs recursively */ + size_t sublen = strlen(curSubdir); + size_t freelen = sizeof(curSubdir) - sublen - 1; + LWIP_ASSERT("sublen < sizeof(curSubdir)", sublen < sizeof(curSubdir)); + fret = FINDFIRST_DIR("*", &fInfo); + if (FINDFIRST_SUCCEEDED(fret)) { + do { + const char *curName = FIND_T_FILENAME(fInfo); + if ((curName[0] == '.') || (strcmp(curName, "CVS") == 0)) { + continue; + } + if (!FIND_T_IS_DIR(fInfo)) { + continue; + } + if (freelen > 0) { + CHDIR(curName); + strncat(curSubdir, "/", freelen); + strncat(curSubdir, curName, freelen - 1); + curSubdir[sizeof(curSubdir) - 1] = 0; + printf("processing subdirectory %s/..." NEWLINE, curSubdir); + filesProcessed += process_sub(data_file, struct_file); + CHDIR(".."); + curSubdir[sublen] = 0; + } else { + printf("WARNING: cannot process sub due to path length restrictions: \"%s/%s\"\n", curSubdir, curName); + } + } while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo))); + } + } + + fret = FINDFIRST_FILE("*.*", &fInfo); + if (FINDFIRST_SUCCEEDED(fret)) { + /* at least one file in directory */ + do { + if (FIND_T_IS_FILE(fInfo)) { + const char *curName = FIND_T_FILENAME(fInfo); + printf("processing %s/%s..." NEWLINE, curSubdir, curName); + if (process_file(data_file, struct_file, curName) < 0) { + printf(NEWLINE "Error... aborting" NEWLINE); + return -1; + } + filesProcessed++; + } + } while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo))); + } + return filesProcessed; +} + +u8_t* get_file_data(const char* filename, int* file_size, int can_be_compressed, int* is_compressed) +{ + FILE *inFile; + size_t fsize = 0; + u8_t* buf; + size_t r; + int rs; + inFile = fopen(filename, "rb"); + if (inFile == NULL) { + printf("Failed to open file \"%s\"\n", filename); + exit(-1); + } + fseek(inFile, 0, SEEK_END); + rs = ftell(inFile); + if (rs < 0) { + printf("ftell failed with %d\n", errno); + exit(-1); + } + fsize = (size_t)rs; + fseek(inFile, 0, SEEK_SET); + buf = (u8_t*)malloc(fsize); + LWIP_ASSERT("buf != NULL", buf != NULL); + r = fread(buf, 1, fsize, inFile); + *file_size = fsize; + *is_compressed = 0; +#if MAKEFS_SUPPORT_DEFLATE + overallDataBytes += fsize; + if (deflateNonSsiFiles) { + if (can_be_compressed) { + if (fsize < OUT_BUF_SIZE) { + u8_t* ret_buf; + tdefl_status status; + size_t in_bytes = fsize; + size_t out_bytes = OUT_BUF_SIZE; + const void *next_in = buf; + void *next_out = s_outbuf; + /* create tdefl() compatible flags (we have to compose the low-level flags ourselves, or use tdefl_create_comp_flags_from_zip_params() but that means MINIZ_NO_ZLIB_APIS can't be defined). */ + mz_uint comp_flags = s_tdefl_num_probes[MZ_MIN(10, deflate_level)] | ((deflate_level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0); + if (!deflate_level) { + comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS; + } + status = tdefl_init(&g_deflator, NULL, NULL, comp_flags); + if (status != TDEFL_STATUS_OKAY) { + printf("tdefl_init() failed!\n"); + exit(-1); + } + memset(s_outbuf, 0, sizeof(s_outbuf)); + status = tdefl_compress(&g_deflator, next_in, &in_bytes, next_out, &out_bytes, TDEFL_FINISH); + if (status != TDEFL_STATUS_DONE) { + printf("deflate failed: %d\n", status); + exit(-1); + } + LWIP_ASSERT("out_bytes <= COPY_BUFSIZE", out_bytes <= OUT_BUF_SIZE); + if (out_bytes < fsize) { + ret_buf = (u8_t*)malloc(out_bytes); + LWIP_ASSERT("ret_buf != NULL", ret_buf != NULL); + memcpy(ret_buf, s_outbuf, out_bytes); + { + /* sanity-check compression be inflating and comparing to the original */ + tinfl_status dec_status; + tinfl_decompressor inflator; + size_t dec_in_bytes = out_bytes; + size_t dec_out_bytes = OUT_BUF_SIZE; + next_out = s_checkbuf; + + tinfl_init(&inflator); + memset(s_checkbuf, 0, sizeof(s_checkbuf)); + dec_status = tinfl_decompress(&inflator, (const mz_uint8 *)ret_buf, &dec_in_bytes, s_checkbuf, (mz_uint8 *)next_out, &dec_out_bytes, 0); + LWIP_ASSERT("tinfl_decompress failed", dec_status == TINFL_STATUS_DONE); + LWIP_ASSERT("tinfl_decompress size mismatch", fsize == dec_out_bytes); + LWIP_ASSERT("decompressed memcmp failed", !memcmp(s_checkbuf, buf, fsize)); + } + /* free original buffer, use compressed data + size */ + free(buf); + buf = ret_buf; + *file_size = out_bytes; + printf(" - deflate: %d bytes -> %d bytes (%.02f%%)" NEWLINE, (int)fsize, (int)out_bytes, (float)((out_bytes*100.0)/fsize)); + deflatedBytesReduced += (size_t)(fsize - out_bytes); + *is_compressed = 1; + } else { + printf(" - uncompressed: (would be %d bytes larger using deflate)" NEWLINE, (int)(out_bytes - fsize)); + } + } else { + printf(" - uncompressed: (file is larger than deflate bufer)" NEWLINE); + } + } else { + printf(" - SSI file, cannot be compressed" NEWLINE); + } + } +#else + LWIP_UNUSED_ARG(can_be_compressed); +#endif + fclose(inFile); + return buf; +} + +void process_file_data(FILE* data_file, u8_t* file_data, size_t file_size) +{ + size_t written, i, src_off=0; + + size_t off = 0; + for (i = 0; i < file_size; i++) { + LWIP_ASSERT("file_buffer_c overflow", off < sizeof(file_buffer_c) - 5); + sprintf(&file_buffer_c[off], "0x%02.2x,", file_data[i]); + off += 5; + if ((++src_off % HEX_BYTES_PER_LINE) == 0) { + LWIP_ASSERT("file_buffer_c overflow", off < sizeof(file_buffer_c) - NEWLINE_LEN); + memcpy(&file_buffer_c[off], NEWLINE, NEWLINE_LEN); + off += NEWLINE_LEN; + } + if (off + 20 >= sizeof(file_buffer_c)) { + written = fwrite(file_buffer_c, 1, off, data_file); + LWIP_ASSERT("written == off", written == off); + off = 0; + } + } + written = fwrite(file_buffer_c, 1, off, data_file); + LWIP_ASSERT("written == off", written == off); +} + +int write_checksums(FILE *struct_file, const char *varname, + u16_t hdr_len, u16_t hdr_chksum, const u8_t* file_data, size_t file_size) +{ + int chunk_size = TCP_MSS; + int offset, src_offset; + size_t len; + int i = 0; +#if LWIP_TCP_TIMESTAMPS + /* when timestamps are used, usable space is 12 bytes less per segment */ + chunk_size -= 12; +#endif + + fprintf(struct_file, "#if HTTPD_PRECALCULATED_CHECKSUM" NEWLINE); + fprintf(struct_file, "const struct fsdata_chksum chksums_%s[] = {" NEWLINE, varname); + + if (hdr_len > 0) { + /* add checksum for HTTP header */ + fprintf(struct_file, "{%d, 0x%04x, %d}," NEWLINE, 0, hdr_chksum, hdr_len); + i++; + } + src_offset = 0; + for (offset = hdr_len; ; offset += len) { + unsigned short chksum; + void* data = (void*)&file_data[src_offset]; + len = LWIP_MIN(chunk_size, (int)file_size - src_offset); + if (len == 0) { + break; + } + chksum = ~inet_chksum(data, (u16_t)len); + /* add checksum for data */ + fprintf(struct_file, "{%d, 0x%04x, %d}," NEWLINE, offset, chksum, len); + i++; + } + fprintf(struct_file, "};" NEWLINE); + fprintf(struct_file, "#endif /* HTTPD_PRECALCULATED_CHECKSUM */" NEWLINE); + return i; +} + +static int is_valid_char_for_c_var(char x) +{ + if (((x >= 'A') && (x <= 'Z')) || + ((x >= 'a') && (x <= 'z')) || + ((x >= '0') && (x <= '9')) || + (x == '_')) { + return 1; + } + return 0; +} + +static void fix_filename_for_c(char* qualifiedName, size_t max_len) +{ + struct file_entry* f; + size_t len = strlen(qualifiedName); + char *new_name = (char*)malloc(len + 2); + int filename_ok; + int cnt = 0; + size_t i; + if (len + 3 == max_len) { + printf("File name too long: \"%s\"\n", qualifiedName); + exit(-1); + } + strcpy(new_name, qualifiedName); + for (i = 0; i < len; i++) { + if (!is_valid_char_for_c_var(new_name[i])) { + new_name[i] = '_'; + } + } + do { + filename_ok = 1; + for (f = first_file; f != NULL; f = f->next) { + if (!strcmp(f->filename_c, new_name)) { + filename_ok = 0; + cnt++; + /* try next unique file name */ + sprintf(&new_name[len], "%d", cnt); + break; + } + } + } while (!filename_ok && (cnt < 999)); + if (!filename_ok) { + printf("Failed to get unique file name: \"%s\"\n", qualifiedName); + exit(-1); + } + strcpy(qualifiedName, new_name); + free(new_name); +} + +static void register_filename(const char* qualifiedName) +{ + struct file_entry* fe = (struct file_entry*)malloc(sizeof(struct file_entry)); + fe->filename_c = strdup(qualifiedName); + fe->next = NULL; + if (first_file == NULL) { + first_file = last_file = fe; + } else { + last_file->next = fe; + last_file = fe; + } +} + +int is_ssi_file(const char* filename) +{ + size_t loop; + for (loop = 0; loop < NUM_SHTML_EXTENSIONS; loop++) { + if (strstr(filename, g_pcSSIExtensions[loop])) { + return 1; + } + } + return 0; +} + +int process_file(FILE *data_file, FILE *struct_file, const char *filename) +{ + char varname[MAX_PATH_LEN]; + int i = 0; + char qualifiedName[MAX_PATH_LEN]; + int file_size; + u16_t http_hdr_chksum = 0; + u16_t http_hdr_len = 0; + int chksum_count = 0; + u8_t flags = 0; + const char* flags_str; + u8_t has_content_len; + u8_t* file_data; + int is_compressed = 0; + + /* create qualified name (@todo: prepend slash or not?) */ + sprintf(qualifiedName,"%s/%s", curSubdir, filename); + /* create C variable name */ + strcpy(varname, qualifiedName); + /* convert slashes & dots to underscores */ + fix_filename_for_c(varname, MAX_PATH_LEN); + register_filename(varname); +#if ALIGN_PAYLOAD + /* to force even alignment of array, type 1 */ + fprintf(data_file, "#if FSDATA_FILE_ALIGNMENT==1" NEWLINE); + fprintf(data_file, "static const " PAYLOAD_ALIGN_TYPE " dummy_align_%s = %d;" NEWLINE, varname, payload_alingment_dummy_counter++); + fprintf(data_file, "#endif" NEWLINE); +#endif /* ALIGN_PAYLOAD */ + fprintf(data_file, "static const unsigned char FSDATA_ALIGN_PRE data_%s[] FSDATA_ALIGN_POST = {" NEWLINE, varname); + /* encode source file name (used by file system, not returned to browser) */ + fprintf(data_file, "/* %s (%d chars) */" NEWLINE, qualifiedName, strlen(qualifiedName)+1); + file_put_ascii(data_file, qualifiedName, strlen(qualifiedName)+1, &i); +#if ALIGN_PAYLOAD + /* pad to even number of bytes to assure payload is on aligned boundary */ + while(i % PAYLOAD_ALIGNMENT != 0) { + fprintf(data_file, "0x%02.2x,", 0); + i++; + } +#endif /* ALIGN_PAYLOAD */ + fprintf(data_file, NEWLINE); + + has_content_len = !is_ssi_file(filename); + file_data = get_file_data(filename, &file_size, includeHttpHeader && has_content_len, &is_compressed); + if (includeHttpHeader) { + file_write_http_header(data_file, filename, file_size, &http_hdr_len, &http_hdr_chksum, has_content_len, is_compressed); + flags = FS_FILE_FLAGS_HEADER_INCLUDED; + if (has_content_len) { + flags |= FS_FILE_FLAGS_HEADER_PERSISTENT; + } + } + if (precalcChksum) { + chksum_count = write_checksums(struct_file, varname, http_hdr_len, http_hdr_chksum, file_data, file_size); + } + + /* build declaration of struct fsdata_file in temp file */ + fprintf(struct_file, "const struct fsdata_file file_%s[] = { {" NEWLINE, varname); + fprintf(struct_file, "file_%s," NEWLINE, lastFileVar); + fprintf(struct_file, "data_%s," NEWLINE, varname); + fprintf(struct_file, "data_%s + %d," NEWLINE, varname, i); + fprintf(struct_file, "sizeof(data_%s) - %d," NEWLINE, varname, i); + switch(flags) + { + case(FS_FILE_FLAGS_HEADER_INCLUDED): + flags_str = "FS_FILE_FLAGS_HEADER_INCLUDED"; + break; + case(FS_FILE_FLAGS_HEADER_PERSISTENT): + flags_str = "FS_FILE_FLAGS_HEADER_PERSISTENT"; + break; + case(FS_FILE_FLAGS_HEADER_INCLUDED | FS_FILE_FLAGS_HEADER_PERSISTENT): + flags_str = "FS_FILE_FLAGS_HEADER_INCLUDED | FS_FILE_FLAGS_HEADER_PERSISTENT"; + break; + default: + flags_str = "0"; + break; + } + fprintf(struct_file, "%s," NEWLINE, flags_str); + if (precalcChksum) { + fprintf(struct_file, "#if HTTPD_PRECALCULATED_CHECKSUM" NEWLINE); + fprintf(struct_file, "%d, chksums_%s," NEWLINE, chksum_count, varname); + fprintf(struct_file, "#endif /* HTTPD_PRECALCULATED_CHECKSUM */" NEWLINE); + } + fprintf(struct_file, "}};" NEWLINE NEWLINE); + strcpy(lastFileVar, varname); + + /* write actual file contents */ + i = 0; + fprintf(data_file, NEWLINE "/* raw file data (%d bytes) */" NEWLINE, file_size); + process_file_data(data_file, file_data, file_size); + fprintf(data_file, "};" NEWLINE NEWLINE); + free(file_data); + return 0; +} + +int file_write_http_header(FILE *data_file, const char *filename, int file_size, u16_t *http_hdr_len, + u16_t *http_hdr_chksum, u8_t provide_content_len, int is_compressed) +{ + int i = 0; + int response_type = HTTP_HDR_OK; + const char* file_type; + const char *cur_string; + size_t cur_len; + int written = 0; + size_t hdr_len = 0; + u16_t acc; + const char *file_ext; + int j; + u8_t provide_last_modified = includeLastModified; + + memset(hdr_buf, 0, sizeof(hdr_buf)); + + if (useHttp11) { + response_type = HTTP_HDR_OK_11; + } + + fprintf(data_file, NEWLINE "/* HTTP header */"); + if (strstr(filename, "404") == filename) { + response_type = HTTP_HDR_NOT_FOUND; + if (useHttp11) { + response_type = HTTP_HDR_NOT_FOUND_11; + } + } else if (strstr(filename, "400") == filename) { + response_type = HTTP_HDR_BAD_REQUEST; + if (useHttp11) { + response_type = HTTP_HDR_BAD_REQUEST_11; + } + } else if (strstr(filename, "501") == filename) { + response_type = HTTP_HDR_NOT_IMPL; + if (useHttp11) { + response_type = HTTP_HDR_NOT_IMPL_11; + } + } + cur_string = g_psHTTPHeaderStrings[response_type]; + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\" (%d bytes) */" NEWLINE, cur_string, cur_len); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + i = 0; + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + } + + cur_string = serverID; + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\" (%d bytes) */" NEWLINE, cur_string, cur_len); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + i = 0; + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + } + + file_ext = filename; + if (file_ext != NULL) { + while(strstr(file_ext, ".") != NULL) { + file_ext = strstr(file_ext, "."); + file_ext++; + } + } + if ((file_ext == NULL) || (*file_ext == 0)) { + printf("failed to get extension for file \"%s\", using default.\n", filename); + file_type = HTTP_HDR_DEFAULT_TYPE; + } else { + file_type = NULL; + for (j = 0; j < NUM_HTTP_HEADERS; j++) { + if (!strcmp(file_ext, g_psHTTPHeaders[j].extension)) { + file_type = g_psHTTPHeaders[j].content_type; + break; + } + } + if (file_type == NULL) { + printf("failed to get file type for extension \"%s\", using default.\n", file_ext); + file_type = HTTP_HDR_DEFAULT_TYPE; + } + } + + /* Content-Length is used for persistent connections in HTTP/1.1 but also for + download progress in older versions + @todo: just use a big-enough buffer and let the HTTPD send spaces? */ + if (provide_content_len) { + char intbuf[MAX_PATH_LEN]; + int content_len = file_size; + memset(intbuf, 0, sizeof(intbuf)); + cur_string = g_psHTTPHeaderStrings[HTTP_HDR_CONTENT_LENGTH]; + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s%d\r\n\" (%d+ bytes) */" NEWLINE, cur_string, content_len, cur_len+2); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + } + + _itoa(content_len, intbuf, 10); + strcat(intbuf, "\r\n"); + cur_len = strlen(intbuf); + written += file_put_ascii(data_file, intbuf, cur_len, &i); + i = 0; + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], intbuf, cur_len); + hdr_len += cur_len; + } + } + if (provide_last_modified) { + char modbuf[256]; + struct stat stat_data; + struct tm* t; + memset(modbuf, 0, sizeof(modbuf)); + memset(&stat_data, 0, sizeof(stat_data)); + cur_string = modbuf; + strcpy(modbuf, "Last-Modified: "); + if (stat(filename, &stat_data) != 0) { + printf("stat(%s) failed with error %d\n", filename, errno); + exit(-1); + } + t = gmtime(&stat_data.st_mtime); + if (t == NULL) { + printf("gmtime() failed with error %d\n", errno); + exit(-1); + } + strftime(&modbuf[15], sizeof(modbuf)-15, "%a, %d %b %Y %H:%M:%S GMT", t); + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\"\r\n\" (%d+ bytes) */" NEWLINE, cur_string, cur_len+2); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + } + + modbuf[0] = 0; + strcat(modbuf, "\r\n"); + cur_len = strlen(modbuf); + written += file_put_ascii(data_file, modbuf, cur_len, &i); + i = 0; + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], modbuf, cur_len); + hdr_len += cur_len; + } + } + + /* HTTP/1.1 implements persistent connections */ + if (useHttp11) { + if (provide_content_len) { + cur_string = g_psHTTPHeaderStrings[HTTP_HDR_CONN_KEEPALIVE]; + } else { + /* no Content-Length available, so a persistent connection is no possible + because the client does not know the data length */ + cur_string = g_psHTTPHeaderStrings[HTTP_HDR_CONN_CLOSE]; + } + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\" (%d bytes) */" NEWLINE, cur_string, cur_len); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + i = 0; + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + } + } + +#if MAKEFS_SUPPORT_DEFLATE + if (is_compressed) { + /* tell the client about the deflate encoding */ + LWIP_ASSERT("error", deflateNonSsiFiles); + cur_string = "Content-Encoding: deflate\r\n"; + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\" (%d bytes) */" NEWLINE, cur_string, cur_len); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + i = 0; + } +#else + LWIP_UNUSED_ARG(is_compressed); +#endif + + /* write content-type, ATTENTION: this includes the double-CRLF! */ + cur_string = file_type; + cur_len = strlen(cur_string); + fprintf(data_file, NEWLINE "/* \"%s\" (%d bytes) */" NEWLINE, cur_string, cur_len); + written += file_put_ascii(data_file, cur_string, cur_len, &i); + i = 0; + + /* ATTENTION: headers are done now (double-CRLF has been written!) */ + + if (precalcChksum) { + memcpy(&hdr_buf[hdr_len], cur_string, cur_len); + hdr_len += cur_len; + + LWIP_ASSERT("hdr_len <= 0xffff", hdr_len <= 0xffff); + LWIP_ASSERT("strlen(hdr_buf) == hdr_len", strlen(hdr_buf) == hdr_len); + acc = ~inet_chksum(hdr_buf, (u16_t)hdr_len); + *http_hdr_len = (u16_t)hdr_len; + *http_hdr_chksum = acc; + } + + return written; +} + +int file_put_ascii(FILE *file, const char* ascii_string, int len, int *i) +{ + int x; + for (x = 0; x < len; x++) { + unsigned char cur = ascii_string[x]; + fprintf(file, "0x%02.2x,", cur); + if ((++(*i) % HEX_BYTES_PER_LINE) == 0) { + fprintf(file, NEWLINE); + } + } + return len; +} + +int s_put_ascii(char *buf, const char *ascii_string, int len, int *i) +{ + int x; + int idx = 0; + for (x = 0; x < len; x++) { + unsigned char cur = ascii_string[x]; + sprintf(&buf[idx], "0x%02.2x,", cur); + idx += 5; + if ((++(*i) % HEX_BYTES_PER_LINE) == 0) { + sprintf(&buf[idx], NEWLINE); + idx += NEWLINE_LEN; + } + } + return len; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/readme.txt new file mode 100644 index 0000000..3768585 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/httpd/makefsdata/readme.txt @@ -0,0 +1,13 @@ +This directory contains a script ('makefsdata') to create C code suitable for +httpd for given html pages (or other files) in a directory. + +There is also a plain C console application doing the same and extended a bit. + +Usage: htmlgen [targetdir] [-s] [-i]s + targetdir: relative or absolute path to files to convert + switch -s: toggle processing of subdirectories (default is on) + switch -e: exclude HTTP header from file (header is created at runtime, default is on) + switch -11: include HTTP 1.1 header (1.0 is default) + + if targetdir not specified, makefsdata will attempt to + process files in subdirectory 'fs'. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/lwiperf/lwiperf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/lwiperf/lwiperf.c new file mode 100644 index 0000000..efabe47 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/lwiperf/lwiperf.c @@ -0,0 +1,661 @@ +/** + * @file + * lwIP iPerf server implementation + */ + +/** + * @defgroup iperf Iperf server + * @ingroup apps + * + * This is a simple performance measuring server to check your bandwith using + * iPerf2 on a PC as client. + * It is currently a minimal implementation providing an IPv4 TCP server only. + * + * @todo: implement UDP mode and IPv6 + */ + +/* + * Copyright (c) 2014 Simon Goldschmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + */ + +#include "lwip/apps/lwiperf.h" + +#include "lwip/tcp.h" +#include "lwip/sys.h" + +#include + +/* Currently, only TCP-over-IPv4 is implemented (does iperf support IPv6 anyway?) */ +#if LWIP_IPV4 && LWIP_TCP && LWIP_CALLBACK_API + +/** Specify the idle timeout (in seconds) after that the test fails */ +#ifndef LWIPERF_TCP_MAX_IDLE_SEC +#define LWIPERF_TCP_MAX_IDLE_SEC 10U +#endif +#if LWIPERF_TCP_MAX_IDLE_SEC > 255 +#error LWIPERF_TCP_MAX_IDLE_SEC must fit into an u8_t +#endif + +/* File internal memory allocation (struct lwiperf_*): this defaults to + the heap */ +#ifndef LWIPERF_ALLOC +#define LWIPERF_ALLOC(type) mem_malloc(sizeof(type)) +#define LWIPERF_FREE(type, item) mem_free(item) +#endif + +/** If this is 1, check that received data has the correct format */ +#ifndef LWIPERF_CHECK_RX_DATA +#define LWIPERF_CHECK_RX_DATA 0 +#endif + +/** This is the Iperf settings struct sent from the client */ +typedef struct _lwiperf_settings { +#define LWIPERF_FLAGS_ANSWER_TEST 0x80000000 +#define LWIPERF_FLAGS_ANSWER_NOW 0x00000001 + u32_t flags; + u32_t num_threads; /* unused for now */ + u32_t remote_port; + u32_t buffer_len; /* unused for now */ + u32_t win_band; /* TCP window / UDP rate: unused for now */ + u32_t amount; /* pos. value: bytes?; neg. values: time (unit is 10ms: 1/100 second) */ +} lwiperf_settings_t; + +/** Basic connection handle */ +struct _lwiperf_state_base; +typedef struct _lwiperf_state_base lwiperf_state_base_t; +struct _lwiperf_state_base { + /* 1=tcp, 0=udp */ + u8_t tcp; + /* 1=server, 0=client */ + u8_t server; + lwiperf_state_base_t* next; + lwiperf_state_base_t* related_server_state; +}; + +/** Connection handle for a TCP iperf session */ +typedef struct _lwiperf_state_tcp { + lwiperf_state_base_t base; + struct tcp_pcb* server_pcb; + struct tcp_pcb* conn_pcb; + u32_t time_started; + lwiperf_report_fn report_fn; + void* report_arg; + u8_t poll_count; + u8_t next_num; + u32_t bytes_transferred; + lwiperf_settings_t settings; + u8_t have_settings_buf; +} lwiperf_state_tcp_t; + +/** List of active iperf sessions */ +static lwiperf_state_base_t* lwiperf_all_connections; +/** A const buffer to send from: we want to measure sending, not copying! */ +static const u8_t lwiperf_txbuf_const[1600] = { + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', + '0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9', +}; + +static err_t lwiperf_tcp_poll(void *arg, struct tcp_pcb *tpcb); +static void lwiperf_tcp_err(void *arg, err_t err); + +/** Add an iperf session to the 'active' list */ +static void +lwiperf_list_add(lwiperf_state_base_t* item) +{ + if (lwiperf_all_connections == NULL) { + lwiperf_all_connections = item; + } else { + item = lwiperf_all_connections; + } +} + +/** Remove an iperf session from the 'active' list */ +static void +lwiperf_list_remove(lwiperf_state_base_t* item) +{ + lwiperf_state_base_t* prev = NULL; + lwiperf_state_base_t* iter; + for (iter = lwiperf_all_connections; iter != NULL; prev = iter, iter = iter->next) { + if (iter == item) { + if (prev == NULL) { + lwiperf_all_connections = iter->next; + } else { + prev->next = item; + } + /* @debug: ensure this item is listed only once */ + for (iter = iter->next; iter != NULL; iter = iter->next) { + LWIP_ASSERT("duplicate entry", iter != item); + } + break; + } + } +} + +/** Call the report function of an iperf tcp session */ +static void +lwip_tcp_conn_report(lwiperf_state_tcp_t* conn, enum lwiperf_report_type report_type) +{ + if ((conn != NULL) && (conn->report_fn != NULL)) { + u32_t now, duration_ms, bandwidth_kbitpsec; + now = sys_now(); + duration_ms = now - conn->time_started; + if (duration_ms == 0) { + bandwidth_kbitpsec = 0; + } else { + bandwidth_kbitpsec = (conn->bytes_transferred / duration_ms) * 8U; + } + conn->report_fn(conn->report_arg, report_type, + &conn->conn_pcb->local_ip, conn->conn_pcb->local_port, + &conn->conn_pcb->remote_ip, conn->conn_pcb->remote_port, + conn->bytes_transferred, duration_ms, bandwidth_kbitpsec); + } +} + +/** Close an iperf tcp session */ +static void +lwiperf_tcp_close(lwiperf_state_tcp_t* conn, enum lwiperf_report_type report_type) +{ + err_t err; + + lwip_tcp_conn_report(conn, report_type); + lwiperf_list_remove(&conn->base); + if (conn->conn_pcb != NULL) { + tcp_arg(conn->conn_pcb, NULL); + tcp_poll(conn->conn_pcb, NULL, 0); + tcp_sent(conn->conn_pcb, NULL); + tcp_recv(conn->conn_pcb, NULL); + tcp_err(conn->conn_pcb, NULL); + err = tcp_close(conn->conn_pcb); + if (err != ERR_OK) { + /* don't want to wait for free memory here... */ + tcp_abort(conn->conn_pcb); + } + } else { + /* no conn pcb, this is the server pcb */ + err = tcp_close(conn->server_pcb); + LWIP_ASSERT("error", err != ERR_OK); + } + LWIPERF_FREE(lwiperf_state_tcp_t, conn); +} + +/** Try to send more data on an iperf tcp session */ +static err_t +lwiperf_tcp_client_send_more(lwiperf_state_tcp_t* conn) +{ + int send_more; + err_t err; + u16_t txlen; + u16_t txlen_max; + void* txptr; + u8_t apiflags; + + LWIP_ASSERT("conn invalid", (conn != NULL) && conn->base.tcp && (conn->base.server == 0)); + + do { + send_more = 0; + if (conn->settings.amount & PP_HTONL(0x80000000)) { + /* this session is time-limited */ + u32_t now = sys_now(); + u32_t diff_ms = now - conn->time_started; + u32_t time = (u32_t)-(s32_t)lwip_htonl(conn->settings.amount); + u32_t time_ms = time * 10; + if (diff_ms >= time_ms) { + /* time specified by the client is over -> close the connection */ + lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_CLIENT); + return ERR_OK; + } + } else { + /* this session is byte-limited */ + u32_t amount_bytes = lwip_htonl(conn->settings.amount); + /* @todo: this can send up to 1*MSS more than requested... */ + if (amount_bytes >= conn->bytes_transferred) { + /* all requested bytes transferred -> close the connection */ + lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_CLIENT); + return ERR_OK; + } + } + + if (conn->bytes_transferred < 24) { + /* transmit the settings a first time */ + txptr = &((u8_t*)&conn->settings)[conn->bytes_transferred]; + txlen_max = (u16_t)(24 - conn->bytes_transferred); + apiflags = TCP_WRITE_FLAG_COPY; + } else if (conn->bytes_transferred < 48) { + /* transmit the settings a second time */ + txptr = &((u8_t*)&conn->settings)[conn->bytes_transferred - 24]; + txlen_max = (u16_t)(48 - conn->bytes_transferred); + apiflags = TCP_WRITE_FLAG_COPY | TCP_WRITE_FLAG_MORE; + send_more = 1; + } else { + /* transmit data */ + /* @todo: every x bytes, transmit the settings again */ + txptr = LWIP_CONST_CAST(void*, &lwiperf_txbuf_const[conn->bytes_transferred % 10]); + txlen_max = TCP_MSS; + if (conn->bytes_transferred == 48) { /* @todo: fix this for intermediate settings, too */ + txlen_max = TCP_MSS - 24; + } + apiflags = 0; /* no copying needed */ + send_more = 1; + } + txlen = txlen_max; + do { + err = tcp_write(conn->conn_pcb, txptr, txlen, apiflags); + if (err == ERR_MEM) { + txlen /= 2; + } + } while ((err == ERR_MEM) && (txlen >= (TCP_MSS/2))); + + if (err == ERR_OK) { + conn->bytes_transferred += txlen; + } else { + send_more = 0; + } + } while(send_more); + + tcp_output(conn->conn_pcb); + return ERR_OK; +} + +/** TCP sent callback, try to send more data */ +static err_t +lwiperf_tcp_client_sent(void *arg, struct tcp_pcb *tpcb, u16_t len) +{ + lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg; + /* @todo: check 'len' (e.g. to time ACK of all data)? for now, we just send more... */ + LWIP_ASSERT("invalid conn", conn->conn_pcb == tpcb); + LWIP_UNUSED_ARG(tpcb); + LWIP_UNUSED_ARG(len); + + conn->poll_count = 0; + + return lwiperf_tcp_client_send_more(conn); +} + +/** TCP connected callback (active connection), send data now */ +static err_t +lwiperf_tcp_client_connected(void *arg, struct tcp_pcb *tpcb, err_t err) +{ + lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg; + LWIP_ASSERT("invalid conn", conn->conn_pcb == tpcb); + LWIP_UNUSED_ARG(tpcb); + if (err != ERR_OK) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE); + return ERR_OK; + } + conn->poll_count = 0; + conn->time_started = sys_now(); + return lwiperf_tcp_client_send_more(conn); +} + +/** Start TCP connection back to the client (either parallel or after the + * receive test has finished. + */ +static err_t +lwiperf_tx_start(lwiperf_state_tcp_t* conn) +{ + err_t err; + lwiperf_state_tcp_t* client_conn; + struct tcp_pcb* newpcb; + ip_addr_t remote_addr; + u16_t remote_port; + + client_conn = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t); + if (client_conn == NULL) { + return ERR_MEM; + } + newpcb = tcp_new(); + if (newpcb == NULL) { + LWIPERF_FREE(lwiperf_state_tcp_t, client_conn); + return ERR_MEM; + } + + MEMCPY(client_conn, conn, sizeof(lwiperf_state_tcp_t)); + client_conn->base.server = 0; + client_conn->server_pcb = NULL; + client_conn->conn_pcb = newpcb; + client_conn->time_started = sys_now(); /* @todo: set this again on 'connected' */ + client_conn->poll_count = 0; + client_conn->next_num = 4; /* initial nr is '4' since the header has 24 byte */ + client_conn->bytes_transferred = 0; + client_conn->settings.flags = 0; /* prevent the remote side starting back as client again */ + + tcp_arg(newpcb, client_conn); + tcp_sent(newpcb, lwiperf_tcp_client_sent); + tcp_poll(newpcb, lwiperf_tcp_poll, 2U); + tcp_err(newpcb, lwiperf_tcp_err); + + ip_addr_copy(remote_addr, conn->conn_pcb->remote_ip); + remote_port = (u16_t)lwip_htonl(client_conn->settings.remote_port); + + err = tcp_connect(newpcb, &remote_addr, remote_port, lwiperf_tcp_client_connected); + if (err != ERR_OK) { + lwiperf_tcp_close(client_conn, LWIPERF_TCP_ABORTED_LOCAL); + return err; + } + lwiperf_list_add(&client_conn->base); + return ERR_OK; +} + +/** Receive data on an iperf tcp session */ +static err_t +lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) +{ + u8_t tmp; + u16_t tot_len; + u32_t packet_idx; + struct pbuf* q; + lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg; + + LWIP_ASSERT("pcb mismatch", conn->conn_pcb == tpcb); + LWIP_UNUSED_ARG(tpcb); + + if (err != ERR_OK) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE); + return ERR_OK; + } + if (p == NULL) { + /* connection closed -> test done */ + if ((conn->settings.flags & PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) == + PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST)) { + /* client requested transmission after end of test */ + lwiperf_tx_start(conn); + } + lwiperf_tcp_close(conn, LWIPERF_TCP_DONE_SERVER); + return ERR_OK; + } + tot_len = p->tot_len; + + conn->poll_count = 0; + + if ((!conn->have_settings_buf) || ((conn->bytes_transferred -24) % (1024*128) == 0)) { + /* wait for 24-byte header */ + if (p->tot_len < sizeof(lwiperf_settings_t)) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR); + pbuf_free(p); + return ERR_VAL; + } + if (!conn->have_settings_buf) { + if (pbuf_copy_partial(p, &conn->settings, sizeof(lwiperf_settings_t), 0) != sizeof(lwiperf_settings_t)) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL); + pbuf_free(p); + return ERR_VAL; + } + conn->have_settings_buf = 1; + if ((conn->settings.flags & PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) == + PP_HTONL(LWIPERF_FLAGS_ANSWER_TEST|LWIPERF_FLAGS_ANSWER_NOW)) { + /* client requested parallel transmission test */ + err_t err2 = lwiperf_tx_start(conn); + if (err2 != ERR_OK) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_TXERROR); + pbuf_free(p); + return err2; + } + } + } else { + if (pbuf_memcmp(p, 0, &conn->settings, sizeof(lwiperf_settings_t)) != 0) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR); + pbuf_free(p); + return ERR_VAL; + } + } + conn->bytes_transferred += sizeof(lwiperf_settings_t); + if (conn->bytes_transferred <= 24) { + conn->time_started = sys_now(); + tcp_recved(tpcb, p->tot_len); + pbuf_free(p); + return ERR_OK; + } + conn->next_num = 4; /* 24 bytes received... */ + tmp = pbuf_header(p, -24); + LWIP_ASSERT("pbuf_header failed", tmp == 0); + } + + packet_idx = 0; + for (q = p; q != NULL; q = q->next) { +#if LWIPERF_CHECK_RX_DATA + const u8_t* payload = (const u8_t*)q->payload; + u16_t i; + for (i = 0; i < q->len; i++) { + u8_t val = payload[i]; + u8_t num = val - '0'; + if (num == conn->next_num) { + conn->next_num++; + if (conn->next_num == 10) { + conn->next_num = 0; + } + } else { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL_DATAERROR); + pbuf_free(p); + return ERR_VAL; + } + } +#endif + packet_idx += q->len; + } + LWIP_ASSERT("count mismatch", packet_idx == p->tot_len); + conn->bytes_transferred += packet_idx; + tcp_recved(tpcb, tot_len); + pbuf_free(p); + return ERR_OK; +} + +/** Error callback, iperf tcp session aborted */ +static void +lwiperf_tcp_err(void *arg, err_t err) +{ + lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg; + LWIP_UNUSED_ARG(err); + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_REMOTE); +} + +/** TCP poll callback, try to send more data */ +static err_t +lwiperf_tcp_poll(void *arg, struct tcp_pcb *tpcb) +{ + lwiperf_state_tcp_t* conn = (lwiperf_state_tcp_t*)arg; + LWIP_ASSERT("pcb mismatch", conn->conn_pcb == tpcb); + LWIP_UNUSED_ARG(tpcb); + if (++conn->poll_count >= LWIPERF_TCP_MAX_IDLE_SEC) { + lwiperf_tcp_close(conn, LWIPERF_TCP_ABORTED_LOCAL); + return ERR_OK; /* lwiperf_tcp_close frees conn */ + } + + if (!conn->base.server) { + lwiperf_tcp_client_send_more(conn); + } + + return ERR_OK; +} + +/** This is called when a new client connects for an iperf tcp session */ +static err_t +lwiperf_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err) +{ + lwiperf_state_tcp_t *s, *conn; + if ((err != ERR_OK) || (newpcb == NULL) || (arg == NULL)) { + return ERR_VAL; + } + + s = (lwiperf_state_tcp_t*)arg; + conn = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t); + if (conn == NULL) { + return ERR_MEM; + } + memset(conn, 0, sizeof(lwiperf_state_tcp_t)); + conn->base.tcp = 1; + conn->base.server = 1; + conn->base.related_server_state = &s->base; + conn->server_pcb = s->server_pcb; + conn->conn_pcb = newpcb; + conn->time_started = sys_now(); + conn->report_fn = s->report_fn; + conn->report_arg = s->report_arg; + + /* setup the tcp rx connection */ + tcp_arg(newpcb, conn); + tcp_recv(newpcb, lwiperf_tcp_recv); + tcp_poll(newpcb, lwiperf_tcp_poll, 2U); + tcp_err(conn->conn_pcb, lwiperf_tcp_err); + + lwiperf_list_add(&conn->base); + return ERR_OK; +} + +/** + * @ingroup iperf + * Start a TCP iperf server on the default TCP port (5001) and listen for + * incoming connections from iperf clients. + * + * @returns a connection handle that can be used to abort the server + * by calling @ref lwiperf_abort() + */ +void* +lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg) +{ + return lwiperf_start_tcp_server(IP_ADDR_ANY, LWIPERF_TCP_PORT_DEFAULT, + report_fn, report_arg); +} + +/** + * @ingroup iperf + * Start a TCP iperf server on a specific IP address and port and listen for + * incoming connections from iperf clients. + * + * @returns a connection handle that can be used to abort the server + * by calling @ref lwiperf_abort() + */ +void* +lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port, + lwiperf_report_fn report_fn, void* report_arg) +{ + err_t err; + struct tcp_pcb* pcb; + lwiperf_state_tcp_t* s; + + if (local_addr == NULL) { + return NULL; + } + + s = (lwiperf_state_tcp_t*)LWIPERF_ALLOC(lwiperf_state_tcp_t); + if (s == NULL) { + return NULL; + } + memset(s, 0, sizeof(lwiperf_state_tcp_t)); + s->base.tcp = 1; + s->base.server = 1; + s->report_fn = report_fn; + s->report_arg = report_arg; + + pcb = tcp_new(); + if (pcb != NULL) { + err = tcp_bind(pcb, local_addr, local_port); + if (err == ERR_OK) { + s->server_pcb = tcp_listen_with_backlog(pcb, 1); + } + } + if (s->server_pcb == NULL) { + if (pcb != NULL) { + tcp_close(pcb); + } + LWIPERF_FREE(lwiperf_state_tcp_t, s); + return NULL; + } + pcb = NULL; + + tcp_arg(s->server_pcb, s); + tcp_accept(s->server_pcb, lwiperf_tcp_accept); + + lwiperf_list_add(&s->base); + return s; +} + +/** + * @ingroup iperf + * Abort an iperf session (handle returned by lwiperf_start_tcp_server*()) + */ +void +lwiperf_abort(void* lwiperf_session) +{ + lwiperf_state_base_t* i, *dealloc, *last = NULL; + + for (i = lwiperf_all_connections; i != NULL; ) { + if ((i == lwiperf_session) || (i->related_server_state == lwiperf_session)) { + dealloc = i; + i = i->next; + if (last != NULL) { + last->next = i; + } + LWIPERF_FREE(lwiperf_state_tcp_t, dealloc); /* @todo: type? */ + } else { + last = i; + i = i->next; + } + } +} + +#endif /* LWIP_IPV4 && LWIP_TCP && LWIP_CALLBACK_API */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mdns/mdns.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mdns/mdns.c new file mode 100644 index 0000000..14334fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mdns/mdns.c @@ -0,0 +1,2028 @@ +/** + * @file + * MDNS responder implementation + * + * @defgroup mdns MDNS + * @ingroup apps + * + * RFC 6762 - Multicast DNS\n + * RFC 6763 - DNS-Based Service Discovery\n + * + * @verbinclude mdns.txt + * + * Things left to implement: + * ------------------------- + * + * - Probing/conflict resolution + * - Sending goodbye messages (zero ttl) - shutdown, DHCP lease about to expire, DHCP turned off... + * - Checking that source address of unicast requests are on the same network + * - Limiting multicast responses to 1 per second per resource record + * - Fragmenting replies if required + * - Subscribe to netif address/link change events and act on them (currently needs to be done manually) + * - Handling multi-packet known answers + * - Individual known answer detection for all local IPv6 addresses + * - Dynamic size of outgoing packet + */ + +/* + * Copyright (c) 2015 Verisure Innovation AB + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ + +#include "lwip/apps/mdns.h" +#include "lwip/apps/mdns_priv.h" +#include "lwip/netif.h" +#include "lwip/udp.h" +#include "lwip/ip_addr.h" +#include "lwip/mem.h" +#include "lwip/prot/dns.h" + +#include + +#if LWIP_MDNS_RESPONDER + +#if (LWIP_IPV4 && !LWIP_IGMP) + #error "If you want to use MDNS with IPv4, you have to define LWIP_IGMP=1 in your lwipopts.h" +#endif +#if (LWIP_IPV6 && !LWIP_IPV6_MLD) +#error "If you want to use MDNS with IPv6, you have to define LWIP_IPV6_MLD=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP) + #error "If you want to use MDNS, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif + +#if LWIP_IPV4 +#include "lwip/igmp.h" +/* IPv4 multicast group 224.0.0.251 */ +static const ip_addr_t v4group = DNS_MQUERY_IPV4_GROUP_INIT; +#endif + +#if LWIP_IPV6 +#include "lwip/mld6.h" +/* IPv6 multicast group FF02::FB */ +static const ip_addr_t v6group = DNS_MQUERY_IPV6_GROUP_INIT; +#endif + +#define MDNS_PORT 5353 +#define MDNS_TTL 255 + +/* Stored offsets to beginning of domain names + * Used for compression. + */ +#define NUM_DOMAIN_OFFSETS 10 +#define DOMAIN_JUMP_SIZE 2 +#define DOMAIN_JUMP 0xc000 + +static u8_t mdns_netif_client_id; +static struct udp_pcb *mdns_pcb; + +#define NETIF_TO_HOST(netif) (struct mdns_host*)(netif_get_client_data(netif, mdns_netif_client_id)) + +#define TOPDOMAIN_LOCAL "local" + +#define REVERSE_PTR_TOPDOMAIN "arpa" +#define REVERSE_PTR_V4_DOMAIN "in-addr" +#define REVERSE_PTR_V6_DOMAIN "ip6" + +#define SRV_PRIORITY 0 +#define SRV_WEIGHT 0 + +/* Payload size allocated for each outgoing UDP packet */ +#define OUTPACKET_SIZE 500 + +/* Lookup from hostname -> IPv4 */ +#define REPLY_HOST_A 0x01 +/* Lookup from IPv4/v6 -> hostname */ +#define REPLY_HOST_PTR_V4 0x02 +/* Lookup from hostname -> IPv6 */ +#define REPLY_HOST_AAAA 0x04 +/* Lookup from hostname -> IPv6 */ +#define REPLY_HOST_PTR_V6 0x08 + +/* Lookup for service types */ +#define REPLY_SERVICE_TYPE_PTR 0x10 +/* Lookup for instances of service */ +#define REPLY_SERVICE_NAME_PTR 0x20 +/* Lookup for location of service instance */ +#define REPLY_SERVICE_SRV 0x40 +/* Lookup for text info on service instance */ +#define REPLY_SERVICE_TXT 0x80 + +static const char *dnssd_protos[] = { + "_udp", /* DNSSD_PROTO_UDP */ + "_tcp", /* DNSSD_PROTO_TCP */ +}; + +/** Description of a service */ +struct mdns_service { + /** TXT record to answer with */ + struct mdns_domain txtdata; + /** Name of service, like 'myweb' */ + char name[MDNS_LABEL_MAXLEN + 1]; + /** Type of service, like '_http' */ + char service[MDNS_LABEL_MAXLEN + 1]; + /** Callback function and userdata + * to update txtdata buffer */ + service_get_txt_fn_t txt_fn; + void *txt_userdata; + /** TTL in seconds of SRV/TXT replies */ + u32_t dns_ttl; + /** Protocol, TCP or UDP */ + u16_t proto; + /** Port of the service */ + u16_t port; +}; + +/** Description of a host/netif */ +struct mdns_host { + /** Hostname */ + char name[MDNS_LABEL_MAXLEN + 1]; + /** Pointer to services */ + struct mdns_service *services[MDNS_MAX_SERVICES]; + /** TTL in seconds of A/AAAA/PTR replies */ + u32_t dns_ttl; +}; + +/** Information about received packet */ +struct mdns_packet { + /** Sender IP/port */ + ip_addr_t source_addr; + u16_t source_port; + /** If packet was received unicast */ + u16_t recv_unicast; + /** Netif that received the packet */ + struct netif *netif; + /** Packet data */ + struct pbuf *pbuf; + /** Current parsing offset in packet */ + u16_t parse_offset; + /** Identifier. Used in legacy queries */ + u16_t tx_id; + /** Number of questions in packet, + * read from packet header */ + u16_t questions; + /** Number of unparsed questions */ + u16_t questions_left; + /** Number of answers in packet, + * (sum of normal, authorative and additional answers) + * read from packet header */ + u16_t answers; + /** Number of unparsed answers */ + u16_t answers_left; +}; + +/** Information about outgoing packet */ +struct mdns_outpacket { + /** Netif to send the packet on */ + struct netif *netif; + /** Packet data */ + struct pbuf *pbuf; + /** Current write offset in packet */ + u16_t write_offset; + /** Identifier. Used in legacy queries */ + u16_t tx_id; + /** Destination IP/port if sent unicast */ + ip_addr_t dest_addr; + u16_t dest_port; + /** Number of questions written */ + u16_t questions; + /** Number of normal answers written */ + u16_t answers; + /** Number of additional answers written */ + u16_t additional; + /** Offsets for written domain names in packet. + * Used for compression */ + u16_t domain_offsets[NUM_DOMAIN_OFFSETS]; + /** If all answers in packet should set cache_flush bit */ + u8_t cache_flush; + /** If reply should be sent unicast */ + u8_t unicast_reply; + /** If legacy query. (tx_id needed, and write + * question again in reply before answer) */ + u8_t legacy_query; + /* Reply bitmask for host information */ + u8_t host_replies; + /* Bitmask for which reverse IPv6 hosts to answer */ + u8_t host_reverse_v6_replies; + /* Reply bitmask per service */ + u8_t serv_replies[MDNS_MAX_SERVICES]; +}; + +/** Domain, type and class. + * Shared between questions and answers */ +struct mdns_rr_info { + struct mdns_domain domain; + u16_t type; + u16_t klass; +}; + +struct mdns_question { + struct mdns_rr_info info; + /** unicast reply requested */ + u16_t unicast; +}; + +struct mdns_answer { + struct mdns_rr_info info; + /** cache flush command bit */ + u16_t cache_flush; + /* Validity time in seconds */ + u32_t ttl; + /** Length of variable answer */ + u16_t rd_length; + /** Offset of start of variable answer in packet */ + u16_t rd_offset; +}; + +/** + * Add a label part to a domain + * @param domain The domain to add a label to + * @param label The label to add, like <hostname>, 'local', 'com' or '' + * @param len The length of the label + * @return ERR_OK on success, an err_t otherwise if label too long + */ +err_t +mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len) +{ + if (len > MDNS_LABEL_MAXLEN) { + return ERR_VAL; + } + if (len > 0 && (1 + len + domain->length >= MDNS_DOMAIN_MAXLEN)) { + return ERR_VAL; + } + /* Allow only zero marker on last byte */ + if (len == 0 && (1 + domain->length > MDNS_DOMAIN_MAXLEN)) { + return ERR_VAL; + } + domain->name[domain->length] = len; + domain->length++; + if (len) { + MEMCPY(&domain->name[domain->length], label, len); + domain->length += len; + } + return ERR_OK; +} + +/** + * Internal readname function with max 6 levels of recursion following jumps + * while decompressing name + */ +static u16_t +mdns_readname_loop(struct pbuf *p, u16_t offset, struct mdns_domain *domain, unsigned depth) +{ + u8_t c; + + do { + if (depth > 5) { + /* Too many jumps */ + return MDNS_READNAME_ERROR; + } + + c = pbuf_get_at(p, offset); + offset++; + + /* is this a compressed label? */ + if((c & 0xc0) == 0xc0) { + u16_t jumpaddr; + if (offset >= p->tot_len) { + /* Make sure both jump bytes fit in the packet */ + return MDNS_READNAME_ERROR; + } + jumpaddr = (((c & 0x3f) << 8) | (pbuf_get_at(p, offset) & 0xff)); + offset++; + if (jumpaddr >= SIZEOF_DNS_HDR && jumpaddr < p->tot_len) { + u16_t res; + /* Recursive call, maximum depth will be checked */ + res = mdns_readname_loop(p, jumpaddr, domain, depth + 1); + /* Dont return offset since new bytes were not read (jumped to somewhere in packet) */ + if (res == MDNS_READNAME_ERROR) { + return res; + } + } else { + return MDNS_READNAME_ERROR; + } + break; + } + + /* normal label */ + if (c <= MDNS_LABEL_MAXLEN) { + u8_t label[MDNS_LABEL_MAXLEN]; + err_t res; + + if (c + domain->length >= MDNS_DOMAIN_MAXLEN) { + return MDNS_READNAME_ERROR; + } + if (c != 0) { + if (pbuf_copy_partial(p, label, c, offset) != c) { + return MDNS_READNAME_ERROR; + } + offset += c; + } + res = mdns_domain_add_label(domain, (char *) label, c); + if (res != ERR_OK) { + return MDNS_READNAME_ERROR; + } + } else { + /* bad length byte */ + return MDNS_READNAME_ERROR; + } + } while (c != 0); + + return offset; +} + +/** + * Read possibly compressed domain name from packet buffer + * @param p The packet + * @param offset start position of domain name in packet + * @param domain The domain name destination + * @return The new offset after the domain, or MDNS_READNAME_ERROR + * if reading failed + */ +u16_t +mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain) +{ + memset(domain, 0, sizeof(struct mdns_domain)); + return mdns_readname_loop(p, offset, domain, 0); +} + +/** + * Print domain name to debug output + * @param domain The domain name + */ +static void +mdns_domain_debug_print(struct mdns_domain *domain) +{ + u8_t *src = domain->name; + u8_t i; + + while (*src) { + u8_t label_len = *src; + src++; + for (i = 0; i < label_len; i++) { + LWIP_DEBUGF(MDNS_DEBUG, ("%c", src[i])); + } + src += label_len; + LWIP_DEBUGF(MDNS_DEBUG, (".")); + } +} + +/** + * Return 1 if contents of domains match (case-insensitive) + * @param a Domain name to compare 1 + * @param b Domain name to compare 2 + * @return 1 if domains are equal ignoring case, 0 otherwise + */ +int +mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b) +{ + u8_t *ptra, *ptrb; + u8_t len; + int res; + + if (a->length != b->length) { + return 0; + } + + ptra = a->name; + ptrb = b->name; + while (*ptra && *ptrb && ptra < &a->name[a->length]) { + if (*ptra != *ptrb) { + return 0; + } + len = *ptra; + ptra++; + ptrb++; + res = lwip_strnicmp((char *) ptra, (char *) ptrb, len); + if (res != 0) { + return 0; + } + ptra += len; + ptrb += len; + } + if (*ptra != *ptrb && ptra < &a->name[a->length]) { + return 0; + } + return 1; +} + +/** + * Call user supplied function to setup TXT data + * @param service The service to build TXT record for + */ +static void +mdns_prepare_txtdata(struct mdns_service *service) +{ + memset(&service->txtdata, 0, sizeof(struct mdns_domain)); + if (service->txt_fn) { + service->txt_fn(service, service->txt_userdata); + } +} + +#if LWIP_IPV4 +/** + * Build domain for reverse lookup of IPv4 address + * like 12.0.168.192.in-addr.arpa. for 192.168.0.12 + * @param domain Where to write the domain name + * @param addr Pointer to an IPv4 address to encode + * @return ERR_OK if domain was written, an err_t otherwise + */ +static err_t +mdns_build_reverse_v4_domain(struct mdns_domain *domain, const ip4_addr_t *addr) +{ + int i; + err_t res; + const u8_t *ptr; + if (!domain || !addr) { + return ERR_ARG; + } + memset(domain, 0, sizeof(struct mdns_domain)); + ptr = (const u8_t *) addr; + for (i = sizeof(ip4_addr_t) - 1; i >= 0; i--) { + char buf[4]; + u8_t val = ptr[i]; + + lwip_itoa(buf, sizeof(buf), val); + res = mdns_domain_add_label(domain, buf, (u8_t)strlen(buf)); + LWIP_ERROR("mdns_build_reverse_v4_domain: Failed to add label", (res == ERR_OK), return res); + } + res = mdns_domain_add_label(domain, REVERSE_PTR_V4_DOMAIN, (u8_t)(sizeof(REVERSE_PTR_V4_DOMAIN)-1)); + LWIP_ERROR("mdns_build_reverse_v4_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, REVERSE_PTR_TOPDOMAIN, (u8_t)(sizeof(REVERSE_PTR_TOPDOMAIN)-1)); + LWIP_ERROR("mdns_build_reverse_v4_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, NULL, 0); + LWIP_ERROR("mdns_build_reverse_v4_domain: Failed to add label", (res == ERR_OK), return res); + + return ERR_OK; +} +#endif + +#if LWIP_IPV6 +/** + * Build domain for reverse lookup of IP address + * like b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. for 2001:db8::567:89ab + * @param domain Where to write the domain name + * @param addr Pointer to an IPv6 address to encode + * @return ERR_OK if domain was written, an err_t otherwise + */ +static err_t +mdns_build_reverse_v6_domain(struct mdns_domain *domain, const ip6_addr_t *addr) +{ + int i; + err_t res; + const u8_t *ptr; + if (!domain || !addr) { + return ERR_ARG; + } + memset(domain, 0, sizeof(struct mdns_domain)); + ptr = (const u8_t *) addr; + for (i = sizeof(ip6_addr_t) - 1; i >= 0; i--) { + char buf; + u8_t byte = ptr[i]; + int j; + for (j = 0; j < 2; j++) { + if ((byte & 0x0F) < 0xA) { + buf = '0' + (byte & 0x0F); + } else { + buf = 'a' + (byte & 0x0F) - 0xA; + } + res = mdns_domain_add_label(domain, &buf, sizeof(buf)); + LWIP_ERROR("mdns_build_reverse_v6_domain: Failed to add label", (res == ERR_OK), return res); + byte >>= 4; + } + } + res = mdns_domain_add_label(domain, REVERSE_PTR_V6_DOMAIN, (u8_t)(sizeof(REVERSE_PTR_V6_DOMAIN)-1)); + LWIP_ERROR("mdns_build_reverse_v6_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, REVERSE_PTR_TOPDOMAIN, (u8_t)(sizeof(REVERSE_PTR_TOPDOMAIN)-1)); + LWIP_ERROR("mdns_build_reverse_v6_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, NULL, 0); + LWIP_ERROR("mdns_build_reverse_v6_domain: Failed to add label", (res == ERR_OK), return res); + + return ERR_OK; +} +#endif + +/* Add .local. to domain */ +static err_t +mdns_add_dotlocal(struct mdns_domain *domain) +{ + err_t res = mdns_domain_add_label(domain, TOPDOMAIN_LOCAL, (u8_t)(sizeof(TOPDOMAIN_LOCAL)-1)); + LWIP_ERROR("mdns_add_dotlocal: Failed to add label", (res == ERR_OK), return res); + return mdns_domain_add_label(domain, NULL, 0); +} + +/** + * Build the .local. domain name + * @param domain Where to write the domain name + * @param mdns TMDNS netif descriptor. + * @return ERR_OK if domain .local. was written, an err_t otherwise + */ +static err_t +mdns_build_host_domain(struct mdns_domain *domain, struct mdns_host *mdns) +{ + err_t res; + memset(domain, 0, sizeof(struct mdns_domain)); + LWIP_ERROR("mdns_build_host_domain: mdns != NULL", (mdns != NULL), return ERR_VAL); + res = mdns_domain_add_label(domain, mdns->name, (u8_t)strlen(mdns->name)); + LWIP_ERROR("mdns_build_host_domain: Failed to add label", (res == ERR_OK), return res); + return mdns_add_dotlocal(domain); +} + +/** + * Build the lookup-all-services special DNS-SD domain name + * @param domain Where to write the domain name + * @return ERR_OK if domain _services._dns-sd._udp.local. was written, an err_t otherwise + */ +static err_t +mdns_build_dnssd_domain(struct mdns_domain *domain) +{ + err_t res; + memset(domain, 0, sizeof(struct mdns_domain)); + res = mdns_domain_add_label(domain, "_services", (u8_t)(sizeof("_services")-1)); + LWIP_ERROR("mdns_build_dnssd_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, "_dns-sd", (u8_t)(sizeof("_dns-sd")-1)); + LWIP_ERROR("mdns_build_dnssd_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, dnssd_protos[DNSSD_PROTO_UDP], (u8_t)strlen(dnssd_protos[DNSSD_PROTO_UDP])); + LWIP_ERROR("mdns_build_dnssd_domain: Failed to add label", (res == ERR_OK), return res); + return mdns_add_dotlocal(domain); +} + +/** + * Build domain name for a service + * @param domain Where to write the domain name + * @param service The service struct, containing service name, type and protocol + * @param include_name Whether to include the service name in the domain + * @return ERR_OK if domain was written. If service name is included, + * ...local. will be written, otherwise ..local. + * An err_t is returned on error. + */ +static err_t +mdns_build_service_domain(struct mdns_domain *domain, struct mdns_service *service, int include_name) +{ + err_t res; + memset(domain, 0, sizeof(struct mdns_domain)); + if (include_name) { + res = mdns_domain_add_label(domain, service->name, (u8_t)strlen(service->name)); + LWIP_ERROR("mdns_build_service_domain: Failed to add label", (res == ERR_OK), return res); + } + res = mdns_domain_add_label(domain, service->service, (u8_t)strlen(service->service)); + LWIP_ERROR("mdns_build_service_domain: Failed to add label", (res == ERR_OK), return res); + res = mdns_domain_add_label(domain, dnssd_protos[service->proto], (u8_t)strlen(dnssd_protos[service->proto])); + LWIP_ERROR("mdns_build_service_domain: Failed to add label", (res == ERR_OK), return res); + return mdns_add_dotlocal(domain); +} + +/** + * Check which replies we should send for a host/netif based on question + * @param netif The network interface that received the question + * @param rr Domain/type/class from a question + * @param reverse_v6_reply Bitmask of which IPv6 addresses to send reverse PTRs for + * if reply bit has REPLY_HOST_PTR_V6 set + * @return Bitmask of which replies to send + */ +static int +check_host(struct netif *netif, struct mdns_rr_info *rr, u8_t *reverse_v6_reply) +{ + err_t res; + int replies = 0; + struct mdns_domain mydomain; + + LWIP_UNUSED_ARG(reverse_v6_reply); /* if ipv6 is disabled */ + + if (rr->klass != DNS_RRCLASS_IN && rr->klass != DNS_RRCLASS_ANY) { + /* Invalid class */ + return replies; + } + + /* Handle PTR for our addresses */ + if (rr->type == DNS_RRTYPE_PTR || rr->type == DNS_RRTYPE_ANY) { +#if LWIP_IPV6 + int i; + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) { + res = mdns_build_reverse_v6_domain(&mydomain, netif_ip6_addr(netif, i)); + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain)) { + replies |= REPLY_HOST_PTR_V6; + /* Mark which addresses where requested */ + if (reverse_v6_reply) { + *reverse_v6_reply |= (1 << i); + } + } + } + } +#endif +#if LWIP_IPV4 + if (!ip4_addr_isany_val(*netif_ip4_addr(netif))) { + res = mdns_build_reverse_v4_domain(&mydomain, netif_ip4_addr(netif)); + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain)) { + replies |= REPLY_HOST_PTR_V4; + } + } +#endif + } + + res = mdns_build_host_domain(&mydomain, NETIF_TO_HOST(netif)); + /* Handle requests for our hostname */ + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain)) { + /* TODO return NSEC if unsupported protocol requested */ +#if LWIP_IPV4 + if (!ip4_addr_isany_val(*netif_ip4_addr(netif)) + && (rr->type == DNS_RRTYPE_A || rr->type == DNS_RRTYPE_ANY)) { + replies |= REPLY_HOST_A; + } +#endif +#if LWIP_IPV6 + if (rr->type == DNS_RRTYPE_AAAA || rr->type == DNS_RRTYPE_ANY) { + replies |= REPLY_HOST_AAAA; + } +#endif + } + + return replies; +} + +/** + * Check which replies we should send for a service based on question + * @param service A registered MDNS service + * @param rr Domain/type/class from a question + * @return Bitmask of which replies to send + */ +static int +check_service(struct mdns_service *service, struct mdns_rr_info *rr) +{ + err_t res; + int replies = 0; + struct mdns_domain mydomain; + + if (rr->klass != DNS_RRCLASS_IN && rr->klass != DNS_RRCLASS_ANY) { + /* Invalid class */ + return 0; + } + + res = mdns_build_dnssd_domain(&mydomain); + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain) && + (rr->type == DNS_RRTYPE_PTR || rr->type == DNS_RRTYPE_ANY)) { + /* Request for all service types */ + replies |= REPLY_SERVICE_TYPE_PTR; + } + + res = mdns_build_service_domain(&mydomain, service, 0); + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain) && + (rr->type == DNS_RRTYPE_PTR || rr->type == DNS_RRTYPE_ANY)) { + /* Request for the instance of my service */ + replies |= REPLY_SERVICE_NAME_PTR; + } + + res = mdns_build_service_domain(&mydomain, service, 1); + if (res == ERR_OK && mdns_domain_eq(&rr->domain, &mydomain)) { + /* Request for info about my service */ + if (rr->type == DNS_RRTYPE_SRV || rr->type == DNS_RRTYPE_ANY) { + replies |= REPLY_SERVICE_SRV; + } + if (rr->type == DNS_RRTYPE_TXT || rr->type == DNS_RRTYPE_ANY) { + replies |= REPLY_SERVICE_TXT; + } + } + + return replies; +} + +/** + * Return bytes needed to write before jump for best result of compressing supplied domain + * against domain in outpacket starting at specified offset. + * If a match is found, offset is updated to where to jump to + * @param pbuf Pointer to pbuf with the partially constructed DNS packet + * @param offset Start position of a domain written earlier. If this location is suitable + * for compression, the pointer is updated to where in the domain to jump to. + * @param domain The domain to write + * @return Number of bytes to write of the new domain before writing a jump to the offset. + * If compression can not be done against this previous domain name, the full new + * domain length is returned. + */ +u16_t +mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain) +{ + struct mdns_domain target; + u16_t target_end; + u8_t target_len; + u8_t writelen = 0; + u8_t *ptr; + if (pbuf == NULL) { + return domain->length; + } + target_end = mdns_readname(pbuf, *offset, &target); + if (target_end == MDNS_READNAME_ERROR) { + return domain->length; + } + target_len = (u8_t)(target_end - *offset); + ptr = domain->name; + while (writelen < domain->length) { + u8_t domainlen = (u8_t)(domain->length - writelen); + u8_t labellen; + if (domainlen <= target.length && domainlen > DOMAIN_JUMP_SIZE) { + /* Compare domains if target is long enough, and we have enough left of the domain */ + u8_t targetpos = (u8_t)(target.length - domainlen); + if ((targetpos + DOMAIN_JUMP_SIZE) >= target_len) { + /* We are checking at or beyond a jump in the original, stop looking */ + break; + } + if (target.length >= domainlen && + memcmp(&domain->name[writelen], &target.name[targetpos], domainlen) == 0) { + *offset += targetpos; + return writelen; + } + } + /* Skip to next label in domain */ + labellen = *ptr; + writelen += 1 + labellen; + ptr += 1 + labellen; + } + /* Nothing found */ + return domain->length; +} + +/** + * Write domain to outpacket. Compression will be attempted, + * unless domain->skip_compression is set. + * @param outpkt The outpacket to write to + * @param domain The domain name to write + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_write_domain(struct mdns_outpacket *outpkt, struct mdns_domain *domain) +{ + int i; + err_t res; + u16_t writelen = domain->length; + u16_t jump_offset = 0; + u16_t jump; + + if (!domain->skip_compression) { + for (i = 0; i < NUM_DOMAIN_OFFSETS; ++i) { + u16_t offset = outpkt->domain_offsets[i]; + if (offset) { + u16_t len = mdns_compress_domain(outpkt->pbuf, &offset, domain); + if (len < writelen) { + writelen = len; + jump_offset = offset; + } + } + } + } + + if (writelen) { + /* Write uncompressed part of name */ + res = pbuf_take_at(outpkt->pbuf, domain->name, writelen, outpkt->write_offset); + if (res != ERR_OK) { + return res; + } + + /* Store offset of this new domain */ + for (i = 0; i < NUM_DOMAIN_OFFSETS; ++i) { + if (outpkt->domain_offsets[i] == 0) { + outpkt->domain_offsets[i] = outpkt->write_offset; + break; + } + } + + outpkt->write_offset += writelen; + } + if (jump_offset) { + /* Write jump */ + jump = lwip_htons(DOMAIN_JUMP | jump_offset); + res = pbuf_take_at(outpkt->pbuf, &jump, DOMAIN_JUMP_SIZE, outpkt->write_offset); + if (res != ERR_OK) { + return res; + } + outpkt->write_offset += DOMAIN_JUMP_SIZE; + } + return ERR_OK; +} + +/** + * Write a question to an outpacket + * A question contains domain, type and class. Since an answer also starts with these fields this function is also + * called from mdns_add_answer(). + * @param outpkt The outpacket to write to + * @param domain The domain name the answer is for + * @param type The DNS type of the answer (like 'AAAA', 'SRV') + * @param klass The DNS type of the answer (like 'IN') + * @param unicast If highest bit in class should be set, to instruct the responder to + * reply with a unicast packet + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_add_question(struct mdns_outpacket *outpkt, struct mdns_domain *domain, u16_t type, u16_t klass, u16_t unicast) +{ + u16_t question_len; + u16_t field16; + err_t res; + + if (!outpkt->pbuf) { + /* If no pbuf is active, allocate one */ + outpkt->pbuf = pbuf_alloc(PBUF_TRANSPORT, OUTPACKET_SIZE, PBUF_RAM); + if (!outpkt->pbuf) { + return ERR_MEM; + } + outpkt->write_offset = SIZEOF_DNS_HDR; + } + + /* Worst case calculation. Domain string might be compressed */ + question_len = domain->length + sizeof(type) + sizeof(klass); + if (outpkt->write_offset + question_len > outpkt->pbuf->tot_len) { + /* No space */ + return ERR_MEM; + } + + /* Write name */ + res = mdns_write_domain(outpkt, domain); + if (res != ERR_OK) { + return res; + } + + /* Write type */ + field16 = lwip_htons(type); + res = pbuf_take_at(outpkt->pbuf, &field16, sizeof(field16), outpkt->write_offset); + if (res != ERR_OK) { + return res; + } + outpkt->write_offset += sizeof(field16); + + /* Write class */ + if (unicast) { + klass |= 0x8000; + } + field16 = lwip_htons(klass); + res = pbuf_take_at(outpkt->pbuf, &field16, sizeof(field16), outpkt->write_offset); + if (res != ERR_OK) { + return res; + } + outpkt->write_offset += sizeof(field16); + + return ERR_OK; +} + +/** + * Write answer to reply packet. + * buf or answer_domain can be null. The rd_length written will be buf_length + + * size of (compressed) domain. Most uses will need either buf or answer_domain, + * special case is SRV that starts with 3 u16 and then a domain name. + * @param reply The outpacket to write to + * @param domain The domain name the answer is for + * @param type The DNS type of the answer (like 'AAAA', 'SRV') + * @param klass The DNS type of the answer (like 'IN') + * @param cache_flush If highest bit in class should be set, to instruct receiver that + * this reply replaces any earlier answer for this domain/type/class + * @param ttl Validity time in seconds to send out for IP address data in DNS replies + * @param buf Pointer to buffer of answer data + * @param buf_length Length of variable data + * @param answer_domain A domain to write after any buffer data as answer + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_add_answer(struct mdns_outpacket *reply, struct mdns_domain *domain, u16_t type, u16_t klass, u16_t cache_flush, + u32_t ttl, const u8_t *buf, size_t buf_length, struct mdns_domain *answer_domain) +{ + u16_t answer_len; + u16_t field16; + u16_t rdlen_offset; + u16_t answer_offset; + u32_t field32; + err_t res; + + if (!reply->pbuf) { + /* If no pbuf is active, allocate one */ + reply->pbuf = pbuf_alloc(PBUF_TRANSPORT, OUTPACKET_SIZE, PBUF_RAM); + if (!reply->pbuf) { + return ERR_MEM; + } + reply->write_offset = SIZEOF_DNS_HDR; + } + + /* Worst case calculation. Domain strings might be compressed */ + answer_len = domain->length + sizeof(type) + sizeof(klass) + sizeof(ttl) + sizeof(field16)/*rd_length*/; + if (buf) { + answer_len += (u16_t)buf_length; + } + if (answer_domain) { + answer_len += answer_domain->length; + } + if (reply->write_offset + answer_len > reply->pbuf->tot_len) { + /* No space */ + return ERR_MEM; + } + + /* Answer starts with same data as question, then more fields */ + mdns_add_question(reply, domain, type, klass, cache_flush); + + /* Write TTL */ + field32 = lwip_htonl(ttl); + res = pbuf_take_at(reply->pbuf, &field32, sizeof(field32), reply->write_offset); + if (res != ERR_OK) { + return res; + } + reply->write_offset += sizeof(field32); + + /* Store offsets and skip forward to the data */ + rdlen_offset = reply->write_offset; + reply->write_offset += sizeof(field16); + answer_offset = reply->write_offset; + + if (buf) { + /* Write static data */ + res = pbuf_take_at(reply->pbuf, buf, (u16_t)buf_length, reply->write_offset); + if (res != ERR_OK) { + return res; + } + reply->write_offset += (u16_t)buf_length; + } + + if (answer_domain) { + /* Write name answer (compressed if possible) */ + res = mdns_write_domain(reply, answer_domain); + if (res != ERR_OK) { + return res; + } + } + + /* Write rd_length after when we know the answer size */ + field16 = lwip_htons(reply->write_offset - answer_offset); + res = pbuf_take_at(reply->pbuf, &field16, sizeof(field16), rdlen_offset); + + return res; +} + +/** + * Helper function for mdns_read_question/mdns_read_answer + * Reads a domain, type and class from the packet + * @param pkt The MDNS packet to read from. The parse_offset field will be + * incremented to point to the next unparsed byte. + * @param info The struct to fill with domain, type and class + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_read_rr_info(struct mdns_packet *pkt, struct mdns_rr_info *info) +{ + u16_t field16, copied; + pkt->parse_offset = mdns_readname(pkt->pbuf, pkt->parse_offset, &info->domain); + if (pkt->parse_offset == MDNS_READNAME_ERROR) { + return ERR_VAL; + } + + copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset); + if (copied != sizeof(field16)) { + return ERR_VAL; + } + pkt->parse_offset += copied; + info->type = lwip_ntohs(field16); + + copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset); + if (copied != sizeof(field16)) { + return ERR_VAL; + } + pkt->parse_offset += copied; + info->klass = lwip_ntohs(field16); + + return ERR_OK; +} + +/** + * Read a question from the packet. + * All questions have to be read before the answers. + * @param pkt The MDNS packet to read from. The questions_left field will be decremented + * and the parse_offset will be updated. + * @param question The struct to fill with question data + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_read_question(struct mdns_packet *pkt, struct mdns_question *question) +{ + /* Safety check */ + if (pkt->pbuf->tot_len < pkt->parse_offset) { + return ERR_VAL; + } + + if (pkt->questions_left) { + err_t res; + pkt->questions_left--; + + memset(question, 0, sizeof(struct mdns_question)); + res = mdns_read_rr_info(pkt, &question->info); + if (res != ERR_OK) { + return res; + } + + /* Extract unicast flag from class field */ + question->unicast = question->info.klass & 0x8000; + question->info.klass &= 0x7FFF; + + return ERR_OK; + } + return ERR_VAL; +} + +/** + * Read an answer from the packet + * The variable length reply is not copied, its pbuf offset and length is stored instead. + * @param pkt The MDNS packet to read. The answers_left field will be decremented and + * the parse_offset will be updated. + * @param answer The struct to fill with answer data + * @return ERR_OK on success, an err_t otherwise + */ +static err_t +mdns_read_answer(struct mdns_packet *pkt, struct mdns_answer *answer) +{ + /* Read questions first */ + if (pkt->questions_left) { + return ERR_VAL; + } + + /* Safety check */ + if (pkt->pbuf->tot_len < pkt->parse_offset) { + return ERR_VAL; + } + + if (pkt->answers_left) { + u16_t copied, field16; + u32_t ttl; + err_t res; + pkt->answers_left--; + + memset(answer, 0, sizeof(struct mdns_answer)); + res = mdns_read_rr_info(pkt, &answer->info); + if (res != ERR_OK) { + return res; + } + + /* Extract cache_flush flag from class field */ + answer->cache_flush = answer->info.klass & 0x8000; + answer->info.klass &= 0x7FFF; + + copied = pbuf_copy_partial(pkt->pbuf, &ttl, sizeof(ttl), pkt->parse_offset); + if (copied != sizeof(ttl)) { + return ERR_VAL; + } + pkt->parse_offset += copied; + answer->ttl = lwip_ntohl(ttl); + + copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset); + if (copied != sizeof(field16)) { + return ERR_VAL; + } + pkt->parse_offset += copied; + answer->rd_length = lwip_ntohs(field16); + + answer->rd_offset = pkt->parse_offset; + pkt->parse_offset += answer->rd_length; + + return ERR_OK; + } + return ERR_VAL; +} + +#if LWIP_IPV4 +/** Write an IPv4 address (A) RR to outpacket */ +static err_t +mdns_add_a_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif) +{ + struct mdns_domain host; + mdns_build_host_domain(&host, NETIF_TO_HOST(netif)); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with A record\n")); + return mdns_add_answer(reply, &host, DNS_RRTYPE_A, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, (const u8_t *) netif_ip4_addr(netif), sizeof(ip4_addr_t), NULL); +} + +/** Write a 4.3.2.1.in-addr.arpa -> hostname.local PTR RR to outpacket */ +static err_t +mdns_add_hostv4_ptr_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif) +{ + struct mdns_domain host, revhost; + mdns_build_host_domain(&host, NETIF_TO_HOST(netif)); + mdns_build_reverse_v4_domain(&revhost, netif_ip4_addr(netif)); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with v4 PTR record\n")); + return mdns_add_answer(reply, &revhost, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, NULL, 0, &host); +} +#endif + +#if LWIP_IPV6 +/** Write an IPv6 address (AAAA) RR to outpacket */ +static err_t +mdns_add_aaaa_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif, int addrindex) +{ + struct mdns_domain host; + mdns_build_host_domain(&host, NETIF_TO_HOST(netif)); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with AAAA record\n")); + return mdns_add_answer(reply, &host, DNS_RRTYPE_AAAA, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, (const u8_t *) netif_ip6_addr(netif, addrindex), sizeof(ip6_addr_t), NULL); +} + +/** Write a x.y.z.ip6.arpa -> hostname.local PTR RR to outpacket */ +static err_t +mdns_add_hostv6_ptr_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif, int addrindex) +{ + struct mdns_domain host, revhost; + mdns_build_host_domain(&host, NETIF_TO_HOST(netif)); + mdns_build_reverse_v6_domain(&revhost, netif_ip6_addr(netif, addrindex)); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with v6 PTR record\n")); + return mdns_add_answer(reply, &revhost, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, NULL, 0, &host); +} +#endif + +/** Write an all-services -> servicetype PTR RR to outpacket */ +static err_t +mdns_add_servicetype_ptr_answer(struct mdns_outpacket *reply, struct mdns_service *service) +{ + struct mdns_domain service_type, service_dnssd; + mdns_build_service_domain(&service_type, service, 0); + mdns_build_dnssd_domain(&service_dnssd); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with service type PTR record\n")); + return mdns_add_answer(reply, &service_dnssd, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, 0, service->dns_ttl, NULL, 0, &service_type); +} + +/** Write a servicetype -> servicename PTR RR to outpacket */ +static err_t +mdns_add_servicename_ptr_answer(struct mdns_outpacket *reply, struct mdns_service *service) +{ + struct mdns_domain service_type, service_instance; + mdns_build_service_domain(&service_type, service, 0); + mdns_build_service_domain(&service_instance, service, 1); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with service name PTR record\n")); + return mdns_add_answer(reply, &service_type, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, 0, service->dns_ttl, NULL, 0, &service_instance); +} + +/** Write a SRV RR to outpacket */ +static err_t +mdns_add_srv_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct mdns_host *mdns, struct mdns_service *service) +{ + struct mdns_domain service_instance, srvhost; + u16_t srvdata[3]; + mdns_build_service_domain(&service_instance, service, 1); + mdns_build_host_domain(&srvhost, mdns); + if (reply->legacy_query) { + /* RFC 6762 section 18.14: + * In legacy unicast responses generated to answer legacy queries, + * name compression MUST NOT be performed on SRV records. + */ + srvhost.skip_compression = 1; + } + srvdata[0] = lwip_htons(SRV_PRIORITY); + srvdata[1] = lwip_htons(SRV_WEIGHT); + srvdata[2] = lwip_htons(service->port); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with SRV record\n")); + return mdns_add_answer(reply, &service_instance, DNS_RRTYPE_SRV, DNS_RRCLASS_IN, cache_flush, service->dns_ttl, + (const u8_t *) &srvdata, sizeof(srvdata), &srvhost); +} + +/** Write a TXT RR to outpacket */ +static err_t +mdns_add_txt_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct mdns_service *service) +{ + struct mdns_domain service_instance; + mdns_build_service_domain(&service_instance, service, 1); + mdns_prepare_txtdata(service); + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Responding with TXT record\n")); + return mdns_add_answer(reply, &service_instance, DNS_RRTYPE_TXT, DNS_RRCLASS_IN, cache_flush, service->dns_ttl, + (u8_t *) &service->txtdata.name, service->txtdata.length, NULL); +} + +/** + * Setup outpacket as a reply to the incoming packet + */ +static void +mdns_init_outpacket(struct mdns_outpacket *out, struct mdns_packet *in) +{ + memset(out, 0, sizeof(struct mdns_outpacket)); + out->cache_flush = 1; + out->netif = in->netif; + + /* Copy source IP/port to use when responding unicast, or to choose + * which pcb to use for multicast (IPv4/IPv6) + */ + SMEMCPY(&out->dest_addr, &in->source_addr, sizeof(ip_addr_t)); + out->dest_port = in->source_port; + + if (in->source_port != MDNS_PORT) { + out->unicast_reply = 1; + out->cache_flush = 0; + if (in->questions == 1) { + out->legacy_query = 1; + out->tx_id = in->tx_id; + } + } + + if (in->recv_unicast) { + out->unicast_reply = 1; + } +} + +/** + * Send chosen answers as a reply + * + * Add all selected answers (first write will allocate pbuf) + * Add additional answers based on the selected answers + * Send the packet + */ +static void +mdns_send_outpacket(struct mdns_outpacket *outpkt) +{ + struct mdns_service *service; + err_t res; + int i; + struct mdns_host* mdns = NETIF_TO_HOST(outpkt->netif); + + /* Write answers to host questions */ +#if LWIP_IPV4 + if (outpkt->host_replies & REPLY_HOST_A) { + res = mdns_add_a_answer(outpkt, outpkt->cache_flush, outpkt->netif); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + if (outpkt->host_replies & REPLY_HOST_PTR_V4) { + res = mdns_add_hostv4_ptr_answer(outpkt, outpkt->cache_flush, outpkt->netif); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } +#endif +#if LWIP_IPV6 + if (outpkt->host_replies & REPLY_HOST_AAAA) { + int addrindex; + for (addrindex = 0; addrindex < LWIP_IPV6_NUM_ADDRESSES; ++addrindex) { + if (ip6_addr_isvalid(netif_ip6_addr_state(outpkt->netif, addrindex))) { + res = mdns_add_aaaa_answer(outpkt, outpkt->cache_flush, outpkt->netif, addrindex); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + } + } + if (outpkt->host_replies & REPLY_HOST_PTR_V6) { + u8_t rev_addrs = outpkt->host_reverse_v6_replies; + int addrindex = 0; + while (rev_addrs) { + if (rev_addrs & 1) { + res = mdns_add_hostv6_ptr_answer(outpkt, outpkt->cache_flush, outpkt->netif, addrindex); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + addrindex++; + rev_addrs >>= 1; + } + } +#endif + + /* Write answers to service questions */ + for (i = 0; i < MDNS_MAX_SERVICES; ++i) { + service = mdns->services[i]; + if (!service) { + continue; + } + + if (outpkt->serv_replies[i] & REPLY_SERVICE_TYPE_PTR) { + res = mdns_add_servicetype_ptr_answer(outpkt, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + + if (outpkt->serv_replies[i] & REPLY_SERVICE_NAME_PTR) { + res = mdns_add_servicename_ptr_answer(outpkt, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + + if (outpkt->serv_replies[i] & REPLY_SERVICE_SRV) { + res = mdns_add_srv_answer(outpkt, outpkt->cache_flush, mdns, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + + if (outpkt->serv_replies[i] & REPLY_SERVICE_TXT) { + res = mdns_add_txt_answer(outpkt, outpkt->cache_flush, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->answers++; + } + } + + /* All answers written, add additional RRs */ + for (i = 0; i < MDNS_MAX_SERVICES; ++i) { + service = mdns->services[i]; + if (!service) { + continue; + } + + if (outpkt->serv_replies[i] & REPLY_SERVICE_NAME_PTR) { + /* Our service instance requested, include SRV & TXT + * if they are already not requested. */ + if (!(outpkt->serv_replies[i] & REPLY_SERVICE_SRV)) { + res = mdns_add_srv_answer(outpkt, outpkt->cache_flush, mdns, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->additional++; + } + + if (!(outpkt->serv_replies[i] & REPLY_SERVICE_TXT)) { + res = mdns_add_txt_answer(outpkt, outpkt->cache_flush, service); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->additional++; + } + } + + /* If service instance, SRV, record or an IP address is requested, + * supply all addresses for the host + */ + if ((outpkt->serv_replies[i] & (REPLY_SERVICE_NAME_PTR | REPLY_SERVICE_SRV)) || + (outpkt->host_replies & (REPLY_HOST_A | REPLY_HOST_AAAA))) { +#if LWIP_IPV6 + if (!(outpkt->host_replies & REPLY_HOST_AAAA)) { + int addrindex; + for (addrindex = 0; addrindex < LWIP_IPV6_NUM_ADDRESSES; ++addrindex) { + if (ip6_addr_isvalid(netif_ip6_addr_state(outpkt->netif, addrindex))) { + res = mdns_add_aaaa_answer(outpkt, outpkt->cache_flush, outpkt->netif, addrindex); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->additional++; + } + } + } +#endif +#if LWIP_IPV4 + if (!(outpkt->host_replies & REPLY_HOST_A)) { + res = mdns_add_a_answer(outpkt, outpkt->cache_flush, outpkt->netif); + if (res != ERR_OK) { + goto cleanup; + } + outpkt->additional++; + } +#endif + } + } + + if (outpkt->pbuf) { + const ip_addr_t *mcast_destaddr; + struct dns_hdr hdr; + + /* Write header */ + memset(&hdr, 0, sizeof(hdr)); + hdr.flags1 = DNS_FLAG1_RESPONSE | DNS_FLAG1_AUTHORATIVE; + hdr.numanswers = lwip_htons(outpkt->answers); + hdr.numextrarr = lwip_htons(outpkt->additional); + if (outpkt->legacy_query) { + hdr.numquestions = lwip_htons(1); + hdr.id = lwip_htons(outpkt->tx_id); + } + pbuf_take(outpkt->pbuf, &hdr, sizeof(hdr)); + + /* Shrink packet */ + pbuf_realloc(outpkt->pbuf, outpkt->write_offset); + + if (IP_IS_V6_VAL(outpkt->dest_addr)) { +#if LWIP_IPV6 + mcast_destaddr = &v6group; +#endif + } else { +#if LWIP_IPV4 + mcast_destaddr = &v4group; +#endif + } + /* Send created packet */ + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Sending packet, len=%d, unicast=%d\n", outpkt->write_offset, outpkt->unicast_reply)); + if (outpkt->unicast_reply) { + udp_sendto_if(mdns_pcb, outpkt->pbuf, &outpkt->dest_addr, outpkt->dest_port, outpkt->netif); + } else { + udp_sendto_if(mdns_pcb, outpkt->pbuf, mcast_destaddr, MDNS_PORT, outpkt->netif); + } + } + +cleanup: + if (outpkt->pbuf) { + pbuf_free(outpkt->pbuf); + outpkt->pbuf = NULL; + } +} + +/** + * Send unsolicited answer containing all our known data + * @param netif The network interface to send on + * @param destination The target address to send to (usually multicast address) + */ +static void +mdns_announce(struct netif *netif, const ip_addr_t *destination) +{ + struct mdns_outpacket announce; + int i; + struct mdns_host* mdns = NETIF_TO_HOST(netif); + + memset(&announce, 0, sizeof(announce)); + announce.netif = netif; + announce.cache_flush = 1; +#if LWIP_IPV4 + if (!ip4_addr_isany_val(*netif_ip4_addr(netif))) + announce.host_replies = REPLY_HOST_A | REPLY_HOST_PTR_V4; +#endif +#if LWIP_IPV6 + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) { + announce.host_replies |= REPLY_HOST_AAAA | REPLY_HOST_PTR_V6; + announce.host_reverse_v6_replies |= (1 << i); + } + } +#endif + + for (i = 0; i < MDNS_MAX_SERVICES; i++) { + struct mdns_service *serv = mdns->services[i]; + if (serv) { + announce.serv_replies[i] = REPLY_SERVICE_TYPE_PTR | REPLY_SERVICE_NAME_PTR | + REPLY_SERVICE_SRV | REPLY_SERVICE_TXT; + } + } + + announce.dest_port = MDNS_PORT; + SMEMCPY(&announce.dest_addr, destination, sizeof(announce.dest_addr)); + mdns_send_outpacket(&announce); +} + +/** + * Handle question MDNS packet + * 1. Parse all questions and set bits what answers to send + * 2. Clear pending answers if known answers are supplied + * 3. Put chosen answers in new packet and send as reply + */ +static void +mdns_handle_question(struct mdns_packet *pkt) +{ + struct mdns_service *service; + struct mdns_outpacket reply; + int replies = 0; + int i; + err_t res; + struct mdns_host* mdns = NETIF_TO_HOST(pkt->netif); + + mdns_init_outpacket(&reply, pkt); + + while (pkt->questions_left) { + struct mdns_question q; + + res = mdns_read_question(pkt, &q); + if (res != ERR_OK) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Failed to parse question, skipping query packet\n")); + return; + } + + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Query for domain ")); + mdns_domain_debug_print(&q.info.domain); + LWIP_DEBUGF(MDNS_DEBUG, (" type %d class %d\n", q.info.type, q.info.klass)); + + if (q.unicast) { + /* Reply unicast if any question is unicast */ + reply.unicast_reply = 1; + } + + reply.host_replies |= check_host(pkt->netif, &q.info, &reply.host_reverse_v6_replies); + replies |= reply.host_replies; + + for (i = 0; i < MDNS_MAX_SERVICES; ++i) { + service = mdns->services[i]; + if (!service) { + continue; + } + reply.serv_replies[i] |= check_service(service, &q.info); + replies |= reply.serv_replies[i]; + } + + if (replies && reply.legacy_query) { + /* Add question to reply packet (legacy packet only has 1 question) */ + res = mdns_add_question(&reply, &q.info.domain, q.info.type, q.info.klass, 0); + if (res != ERR_OK) { + goto cleanup; + } + } + } + + /* Handle known answers */ + while (pkt->answers_left) { + struct mdns_answer ans; + u8_t rev_v6; + int match; + + res = mdns_read_answer(pkt, &ans); + if (res != ERR_OK) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Failed to parse answer, skipping query packet\n")); + goto cleanup; + } + + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Known answer for domain ")); + mdns_domain_debug_print(&ans.info.domain); + LWIP_DEBUGF(MDNS_DEBUG, (" type %d class %d\n", ans.info.type, ans.info.klass)); + + + if (ans.info.type == DNS_RRTYPE_ANY || ans.info.klass == DNS_RRCLASS_ANY) { + /* Skip known answers for ANY type & class */ + continue; + } + + rev_v6 = 0; + match = reply.host_replies & check_host(pkt->netif, &ans.info, &rev_v6); + if (match && (ans.ttl > (mdns->dns_ttl / 2))) { + /* The RR in the known answer matches an RR we are planning to send, + * and the TTL is less than half gone. + * If the payload matches we should not send that answer. + */ + if (ans.info.type == DNS_RRTYPE_PTR) { + /* Read domain and compare */ + struct mdns_domain known_ans, my_ans; + u16_t len; + len = mdns_readname(pkt->pbuf, ans.rd_offset, &known_ans); + res = mdns_build_host_domain(&my_ans, mdns); + if (len != MDNS_READNAME_ERROR && res == ERR_OK && mdns_domain_eq(&known_ans, &my_ans)) { +#if LWIP_IPV4 + if (match & REPLY_HOST_PTR_V4) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: v4 PTR\n")); + reply.host_replies &= ~REPLY_HOST_PTR_V4; + } +#endif +#if LWIP_IPV6 + if (match & REPLY_HOST_PTR_V6) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: v6 PTR\n")); + reply.host_reverse_v6_replies &= ~rev_v6; + if (reply.host_reverse_v6_replies == 0) { + reply.host_replies &= ~REPLY_HOST_PTR_V6; + } + } +#endif + } + } else if (match & REPLY_HOST_A) { +#if LWIP_IPV4 + if (ans.rd_length == sizeof(ip4_addr_t) && + pbuf_memcmp(pkt->pbuf, ans.rd_offset, netif_ip4_addr(pkt->netif), ans.rd_length) == 0) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: A\n")); + reply.host_replies &= ~REPLY_HOST_A; + } +#endif + } else if (match & REPLY_HOST_AAAA) { +#if LWIP_IPV6 + if (ans.rd_length == sizeof(ip6_addr_t) && + /* TODO this clears all AAAA responses if first addr is set as known */ + pbuf_memcmp(pkt->pbuf, ans.rd_offset, netif_ip6_addr(pkt->netif, 0), ans.rd_length) == 0) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: AAAA\n")); + reply.host_replies &= ~REPLY_HOST_AAAA; + } +#endif + } + } + + for (i = 0; i < MDNS_MAX_SERVICES; ++i) { + service = mdns->services[i]; + if (!service) { + continue; + } + match = reply.serv_replies[i] & check_service(service, &ans.info); + if (match && (ans.ttl > (service->dns_ttl / 2))) { + /* The RR in the known answer matches an RR we are planning to send, + * and the TTL is less than half gone. + * If the payload matches we should not send that answer. + */ + if (ans.info.type == DNS_RRTYPE_PTR) { + /* Read domain and compare */ + struct mdns_domain known_ans, my_ans; + u16_t len; + len = mdns_readname(pkt->pbuf, ans.rd_offset, &known_ans); + if (len != MDNS_READNAME_ERROR) { + if (match & REPLY_SERVICE_TYPE_PTR) { + res = mdns_build_service_domain(&my_ans, service, 0); + if (res == ERR_OK && mdns_domain_eq(&known_ans, &my_ans)) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: service type PTR\n")); + reply.serv_replies[i] &= ~REPLY_SERVICE_TYPE_PTR; + } + } + if (match & REPLY_SERVICE_NAME_PTR) { + res = mdns_build_service_domain(&my_ans, service, 1); + if (res == ERR_OK && mdns_domain_eq(&known_ans, &my_ans)) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: service name PTR\n")); + reply.serv_replies[i] &= ~REPLY_SERVICE_NAME_PTR; + } + } + } + } else if (match & REPLY_SERVICE_SRV) { + /* Read and compare to my SRV record */ + u16_t field16, len, read_pos; + struct mdns_domain known_ans, my_ans; + read_pos = ans.rd_offset; + do { + /* Check priority field */ + len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos); + if (len != sizeof(field16) || lwip_ntohs(field16) != SRV_PRIORITY) { + break; + } + read_pos += len; + /* Check weight field */ + len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos); + if (len != sizeof(field16) || lwip_ntohs(field16) != SRV_WEIGHT) { + break; + } + read_pos += len; + /* Check port field */ + len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos); + if (len != sizeof(field16) || lwip_ntohs(field16) != service->port) { + break; + } + read_pos += len; + /* Check host field */ + len = mdns_readname(pkt->pbuf, read_pos, &known_ans); + mdns_build_host_domain(&my_ans, mdns); + if (len == MDNS_READNAME_ERROR || !mdns_domain_eq(&known_ans, &my_ans)) { + break; + } + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: SRV\n")); + reply.serv_replies[i] &= ~REPLY_SERVICE_SRV; + } while (0); + } else if (match & REPLY_SERVICE_TXT) { + mdns_prepare_txtdata(service); + if (service->txtdata.length == ans.rd_length && + pbuf_memcmp(pkt->pbuf, ans.rd_offset, service->txtdata.name, ans.rd_length) == 0) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Skipping known answer: TXT\n")); + reply.serv_replies[i] &= ~REPLY_SERVICE_TXT; + } + } + } + } + } + + mdns_send_outpacket(&reply); + +cleanup: + if (reply.pbuf) { + /* This should only happen if we fail to alloc/write question for legacy query */ + pbuf_free(reply.pbuf); + reply.pbuf = NULL; + } +} + +/** + * Handle response MDNS packet + * Only prints debug for now. Will need more code to do conflict resolution. + */ +static void +mdns_handle_response(struct mdns_packet *pkt) +{ + /* Ignore all questions */ + while (pkt->questions_left) { + struct mdns_question q; + err_t res; + + res = mdns_read_question(pkt, &q); + if (res != ERR_OK) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Failed to parse question, skipping response packet\n")); + return; + } + } + + while (pkt->answers_left) { + struct mdns_answer ans; + err_t res; + + res = mdns_read_answer(pkt, &ans); + if (res != ERR_OK) { + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Failed to parse answer, skipping response packet\n")); + return; + } + + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Answer for domain ")); + mdns_domain_debug_print(&ans.info.domain); + LWIP_DEBUGF(MDNS_DEBUG, (" type %d class %d\n", ans.info.type, ans.info.klass)); + } +} + +/** + * Receive input function for MDNS packets. + * Handles both IPv4 and IPv6 UDP pcbs. + */ +static void +mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + struct dns_hdr hdr; + struct mdns_packet packet; + struct netif *recv_netif = ip_current_input_netif(); + u16_t offset = 0; + + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(pcb); + + LWIP_DEBUGF(MDNS_DEBUG, ("MDNS: Received IPv%d MDNS packet, len %d\n", IP_IS_V6(addr)? 6 : 4, p->tot_len)); + + if (NETIF_TO_HOST(recv_netif) == NULL) { + /* From netif not configured for MDNS */ + goto dealloc; + } + + if (pbuf_copy_partial(p, &hdr, SIZEOF_DNS_HDR, offset) < SIZEOF_DNS_HDR) { + /* Too small */ + goto dealloc; + } + offset += SIZEOF_DNS_HDR; + + if (DNS_HDR_GET_OPCODE(&hdr)) { + /* Ignore non-standard queries in multicast packets (RFC 6762, section 18.3) */ + goto dealloc; + } + + memset(&packet, 0, sizeof(packet)); + SMEMCPY(&packet.source_addr, addr, sizeof(packet.source_addr)); + packet.source_port = port; + packet.netif = recv_netif; + packet.pbuf = p; + packet.parse_offset = offset; + packet.tx_id = lwip_ntohs(hdr.id); + packet.questions = packet.questions_left = lwip_ntohs(hdr.numquestions); + packet.answers = packet.answers_left = lwip_ntohs(hdr.numanswers) + lwip_ntohs(hdr.numauthrr) + lwip_ntohs(hdr.numextrarr); + +#if LWIP_IPV6 + if (IP_IS_V6(ip_current_dest_addr())) { + if (!ip_addr_cmp(ip_current_dest_addr(), &v6group)) { + packet.recv_unicast = 1; + } + } +#endif +#if LWIP_IPV4 + if (!IP_IS_V6(ip_current_dest_addr())) { + if (!ip_addr_cmp(ip_current_dest_addr(), &v4group)) { + packet.recv_unicast = 1; + } + } +#endif + + if (hdr.flags1 & DNS_FLAG1_RESPONSE) { + mdns_handle_response(&packet); + } else { + mdns_handle_question(&packet); + } + +dealloc: + pbuf_free(p); +} + +/** + * @ingroup mdns + * Initiate MDNS responder. Will open UDP sockets on port 5353 + */ +void +mdns_resp_init(void) +{ + err_t res; + + mdns_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); + LWIP_ASSERT("Failed to allocate pcb", mdns_pcb != NULL); +#if LWIP_MULTICAST_TX_OPTIONS + udp_set_multicast_ttl(mdns_pcb, MDNS_TTL); +#else + mdns_pcb->ttl = MDNS_TTL; +#endif + res = udp_bind(mdns_pcb, IP_ANY_TYPE, MDNS_PORT); + LWIP_UNUSED_ARG(res); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("Failed to bind pcb", res == ERR_OK); + udp_recv(mdns_pcb, mdns_recv, NULL); + + mdns_netif_client_id = netif_alloc_client_data_id(); +} + +/** + * @ingroup mdns + * Announce IP settings have changed on netif. + * Call this in your callback registered by netif_set_status_callback(). + * This function may go away in the future when netif supports registering + * multiple callback functions. + * @param netif The network interface where settings have changed. + */ +void +mdns_resp_netif_settings_changed(struct netif *netif) +{ + LWIP_ERROR("mdns_resp_netif_ip_changed: netif != NULL", (netif != NULL), return); + + if (NETIF_TO_HOST(netif) == NULL) { + return; + } + + /* Announce on IPv6 and IPv4 */ +#if LWIP_IPV6 + mdns_announce(netif, IP6_ADDR_ANY); +#endif +#if LWIP_IPV4 + mdns_announce(netif, IP4_ADDR_ANY); +#endif +} + +/** + * @ingroup mdns + * Activate MDNS responder for a network interface and send announce packets. + * @param netif The network interface to activate. + * @param hostname Name to use. Queries for <hostname>.local will be answered + * with the IP addresses of the netif. The hostname will be copied, the + * given pointer can be on the stack. + * @param dns_ttl Validity time in seconds to send out for IP address data in DNS replies + * @return ERR_OK if netif was added, an err_t otherwise + */ +err_t +mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl) +{ + err_t res; + struct mdns_host* mdns; + + LWIP_ERROR("mdns_resp_add_netif: netif != NULL", (netif != NULL), return ERR_VAL); + LWIP_ERROR("mdns_resp_add_netif: Hostname too long", (strlen(hostname) <= MDNS_LABEL_MAXLEN), return ERR_VAL); + + LWIP_ASSERT("mdns_resp_add_netif: Double add", NETIF_TO_HOST(netif) == NULL); + mdns = (struct mdns_host *) mem_malloc(sizeof(struct mdns_host)); + LWIP_ERROR("mdns_resp_add_netif: Alloc failed", (mdns != NULL), return ERR_MEM); + + netif_set_client_data(netif, mdns_netif_client_id, mdns); + + memset(mdns, 0, sizeof(struct mdns_host)); + MEMCPY(&mdns->name, hostname, LWIP_MIN(MDNS_LABEL_MAXLEN, strlen(hostname))); + mdns->dns_ttl = dns_ttl; + + /* Join multicast groups */ +#if LWIP_IPV4 + res = igmp_joingroup_netif(netif, ip_2_ip4(&v4group)); + if (res != ERR_OK) { + goto cleanup; + } +#endif +#if LWIP_IPV6 + res = mld6_joingroup_netif(netif, ip_2_ip6(&v6group)); + if (res != ERR_OK) { + goto cleanup; + } +#endif + + mdns_resp_netif_settings_changed(netif); + return ERR_OK; + +cleanup: + mem_free(mdns); + netif_set_client_data(netif, mdns_netif_client_id, NULL); + return res; +} + +/** + * @ingroup mdns + * Stop responding to MDNS queries on this interface, leave multicast groups, + * and free the helper structure and any of its services. + * @param netif The network interface to remove. + * @return ERR_OK if netif was removed, an err_t otherwise + */ +err_t +mdns_resp_remove_netif(struct netif *netif) +{ + int i; + struct mdns_host* mdns; + + LWIP_ASSERT("mdns_resp_remove_netif: Null pointer", netif); + mdns = NETIF_TO_HOST(netif); + LWIP_ERROR("mdns_resp_remove_netif: Not an active netif", (mdns != NULL), return ERR_VAL); + + for (i = 0; i < MDNS_MAX_SERVICES; i++) { + struct mdns_service *service = mdns->services[i]; + if (service) { + mem_free(service); + } + } + + /* Leave multicast groups */ +#if LWIP_IPV4 + igmp_leavegroup_netif(netif, ip_2_ip4(&v4group)); +#endif +#if LWIP_IPV6 + mld6_leavegroup_netif(netif, ip_2_ip6(&v6group)); +#endif + + mem_free(mdns); + netif_set_client_data(netif, mdns_netif_client_id, NULL); + return ERR_OK; +} + +/** + * @ingroup mdns + * Add a service to the selected network interface. + * @param netif The network interface to publish this service on + * @param name The name of the service + * @param service The service type, like "_http" + * @param proto The service protocol, DNSSD_PROTO_TCP for TCP ("_tcp") and DNSSD_PROTO_UDP + * for others ("_udp") + * @param port The port the service listens to + * @param dns_ttl Validity time in seconds to send out for service data in DNS replies + * @param txt_fn Callback to get TXT data. Will be called each time a TXT reply is created to + * allow dynamic replies. + * @param txt_data Userdata pointer for txt_fn + * @return ERR_OK if the service was added to the netif, an err_t otherwise + */ +err_t +mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_data) +{ + int i; + int slot = -1; + struct mdns_service *srv; + struct mdns_host* mdns; + + LWIP_ASSERT("mdns_resp_add_service: netif != NULL", netif); + mdns = NETIF_TO_HOST(netif); + LWIP_ERROR("mdns_resp_add_service: Not an mdns netif", (mdns != NULL), return ERR_VAL); + + LWIP_ERROR("mdns_resp_add_service: Name too long", (strlen(name) <= MDNS_LABEL_MAXLEN), return ERR_VAL); + LWIP_ERROR("mdns_resp_add_service: Service too long", (strlen(service) <= MDNS_LABEL_MAXLEN), return ERR_VAL); + LWIP_ERROR("mdns_resp_add_service: Bad proto (need TCP or UDP)", (proto == DNSSD_PROTO_TCP || proto == DNSSD_PROTO_UDP), return ERR_VAL); + + for (i = 0; i < MDNS_MAX_SERVICES; i++) { + if (mdns->services[i] == NULL) { + slot = i; + break; + } + } + LWIP_ERROR("mdns_resp_add_service: Service list full (increase MDNS_MAX_SERVICES)", (slot >= 0), return ERR_MEM); + + srv = (struct mdns_service*)mem_malloc(sizeof(struct mdns_service)); + LWIP_ERROR("mdns_resp_add_service: Alloc failed", (srv != NULL), return ERR_MEM); + + memset(srv, 0, sizeof(struct mdns_service)); + + MEMCPY(&srv->name, name, LWIP_MIN(MDNS_LABEL_MAXLEN, strlen(name))); + MEMCPY(&srv->service, service, LWIP_MIN(MDNS_LABEL_MAXLEN, strlen(service))); + srv->txt_fn = txt_fn; + srv->txt_userdata = txt_data; + srv->proto = (u16_t)proto; + srv->port = port; + srv->dns_ttl = dns_ttl; + + mdns->services[slot] = srv; + + /* Announce on IPv6 and IPv4 */ +#if LWIP_IPV6 + mdns_announce(netif, IP6_ADDR_ANY); +#endif +#if LWIP_IPV4 + mdns_announce(netif, IP4_ADDR_ANY); +#endif + + return ERR_OK; +} + +/** + * @ingroup mdns + * Call this function from inside the service_get_txt_fn_t callback to add text data. + * Buffer for TXT data is 256 bytes, and each field is prefixed with a length byte. + * @param service The service provided to the get_txt callback + * @param txt String to add to the TXT field. + * @param txt_len Length of string + * @return ERR_OK if the string was added to the reply, an err_t otherwise + */ +err_t +mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len) +{ + LWIP_ASSERT("mdns_resp_add_service_txtitem: service != NULL", service); + + /* Use a mdns_domain struct to store txt chunks since it is the same encoding */ + return mdns_domain_add_label(&service->txtdata, txt, txt_len); +} + +#endif /* LWIP_MDNS_RESPONDER */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mqtt/mqtt.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mqtt/mqtt.c new file mode 100644 index 0000000..a0e77b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/mqtt/mqtt.c @@ -0,0 +1,1341 @@ +/** + * @file + * MQTT client + * + * @defgroup mqtt MQTT client + * @ingroup apps + * @verbinclude mqtt_client.txt + */ + +/* + * Copyright (c) 2016 Erik Andersson + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack + * + * Author: Erik Andersson + * + * + * @todo: + * - Handle large outgoing payloads for PUBLISH messages + * - Fix restriction of a single topic in each (UN)SUBSCRIBE message (protocol has support for multiple topics) + * - Add support for legacy MQTT protocol version + * + * Please coordinate changes and requests with Erik Andersson + * Erik Andersson + * + */ +#include "lwip/apps/mqtt.h" +#include "lwip/timeouts.h" +#include "lwip/ip_addr.h" +#include "lwip/mem.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" +#include "lwip/tcp.h" +#include + +#if LWIP_TCP && LWIP_CALLBACK_API + +/** + * MQTT_DEBUG: Default is off. + */ +#if !defined MQTT_DEBUG || defined __DOXYGEN__ +#define MQTT_DEBUG LWIP_DBG_OFF +#endif + +#define MQTT_DEBUG_TRACE (MQTT_DEBUG | LWIP_DBG_TRACE) +#define MQTT_DEBUG_STATE (MQTT_DEBUG | LWIP_DBG_STATE) +#define MQTT_DEBUG_WARN (MQTT_DEBUG | LWIP_DBG_LEVEL_WARNING) +#define MQTT_DEBUG_WARN_STATE (MQTT_DEBUG | LWIP_DBG_LEVEL_WARNING | LWIP_DBG_STATE) +#define MQTT_DEBUG_SERIOUS (MQTT_DEBUG | LWIP_DBG_LEVEL_SERIOUS) + +static void mqtt_cyclic_timer(void *arg); + +/** + * MQTT client connection states + */ +enum { + TCP_DISCONNECTED, + TCP_CONNECTING, + MQTT_CONNECTING, + MQTT_CONNECTED +}; + +/** + * MQTT control message types + */ +enum mqtt_message_type { + MQTT_MSG_TYPE_CONNECT = 1, + MQTT_MSG_TYPE_CONNACK = 2, + MQTT_MSG_TYPE_PUBLISH = 3, + MQTT_MSG_TYPE_PUBACK = 4, + MQTT_MSG_TYPE_PUBREC = 5, + MQTT_MSG_TYPE_PUBREL = 6, + MQTT_MSG_TYPE_PUBCOMP = 7, + MQTT_MSG_TYPE_SUBSCRIBE = 8, + MQTT_MSG_TYPE_SUBACK = 9, + MQTT_MSG_TYPE_UNSUBSCRIBE = 10, + MQTT_MSG_TYPE_UNSUBACK = 11, + MQTT_MSG_TYPE_PINGREQ = 12, + MQTT_MSG_TYPE_PINGRESP = 13, + MQTT_MSG_TYPE_DISCONNECT = 14 +}; + +/** Helpers to extract control packet type and qos from first byte in fixed header */ +#define MQTT_CTL_PACKET_TYPE(fixed_hdr_byte0) ((fixed_hdr_byte0 & 0xf0) >> 4) +#define MQTT_CTL_PACKET_QOS(fixed_hdr_byte0) ((fixed_hdr_byte0 & 0x6) >> 1) + +/** + * MQTT connect flags, only used in CONNECT message + */ +enum mqtt_connect_flag { + MQTT_CONNECT_FLAG_USERNAME = 1 << 7, + MQTT_CONNECT_FLAG_PASSWORD = 1 << 6, + MQTT_CONNECT_FLAG_WILL_RETAIN = 1 << 5, + MQTT_CONNECT_FLAG_WILL = 1 << 2, + MQTT_CONNECT_FLAG_CLEAN_SESSION = 1 << 1 +}; + + +#if defined(LWIP_DEBUG) +static const char * const mqtt_message_type_str[15] = +{ + "UNDEFINED", + "CONNECT", + "CONNACK", + "PUBLISH", + "PUBACK", + "PUBREC", + "PUBREL", + "PUBCOMP", + "SUBSCRIBE", + "SUBACK", + "UNSUBSCRIBE", + "UNSUBACK", + "PINGREQ", + "PINGRESP", + "DISCONNECT" +}; + +/** + * Message type value to string + * @param msg_type see enum mqtt_message_type + * + * @return Control message type text string + */ +static const char * +mqtt_msg_type_to_str(u8_t msg_type) +{ + if (msg_type >= LWIP_ARRAYSIZE(mqtt_message_type_str)) { + msg_type = 0; + } + return mqtt_message_type_str[msg_type]; +} + +#endif + + +/** + * Generate MQTT packet identifier + * @param client MQTT client + * @return New packet identifier, range 1 to 65535 + */ +static u16_t +msg_generate_packet_id(mqtt_client_t *client) +{ + client->pkt_id_seq++; + if (client->pkt_id_seq == 0) { + client->pkt_id_seq++; + } + return client->pkt_id_seq; +} + +/*--------------------------------------------------------------------------------------------------------------------- */ +/* Output ring buffer */ + + +#define MQTT_RINGBUF_IDX_MASK ((MQTT_OUTPUT_RINGBUF_SIZE) - 1) + +/** Add single item to ring buffer */ +#define mqtt_ringbuf_put(rb, item) ((rb)->buf)[(rb)->put++ & MQTT_RINGBUF_IDX_MASK] = (item) + +/** Return number of bytes in ring buffer */ +#define mqtt_ringbuf_len(rb) ((u16_t)((rb)->put - (rb)->get)) + +/** Return number of bytes free in ring buffer */ +#define mqtt_ringbuf_free(rb) (MQTT_OUTPUT_RINGBUF_SIZE - mqtt_ringbuf_len(rb)) + +/** Return number of bytes possible to read without wrapping around */ +#define mqtt_ringbuf_linear_read_length(rb) LWIP_MIN(mqtt_ringbuf_len(rb), (MQTT_OUTPUT_RINGBUF_SIZE - ((rb)->get & MQTT_RINGBUF_IDX_MASK))) + +/** Return pointer to ring buffer get position */ +#define mqtt_ringbuf_get_ptr(rb) (&(rb)->buf[(rb)->get & MQTT_RINGBUF_IDX_MASK]) + +#define mqtt_ringbuf_advance_get_idx(rb, len) ((rb)->get += (len)) + + +/** + * Try send as many bytes as possible from output ring buffer + * @param rb Output ring buffer + * @param tpcb TCP connection handle + */ +static void +mqtt_output_send(struct mqtt_ringbuf_t *rb, struct tcp_pcb *tpcb) +{ + err_t err; + u8_t wrap = 0; + u16_t ringbuf_lin_len = mqtt_ringbuf_linear_read_length(rb); + u16_t send_len = tcp_sndbuf(tpcb); + LWIP_ASSERT("mqtt_output_send: tpcb != NULL", tpcb != NULL); + + if (send_len == 0 || ringbuf_lin_len == 0) { + return; + } + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_output_send: tcp_sndbuf: %d bytes, ringbuf_linear_available: %d, get %d, put %d\n", + send_len, ringbuf_lin_len, ((rb)->get & MQTT_RINGBUF_IDX_MASK), ((rb)->put & MQTT_RINGBUF_IDX_MASK))); + + if (send_len > ringbuf_lin_len) { + /* Space in TCP output buffer is larger than available in ring buffer linear portion */ + send_len = ringbuf_lin_len; + /* Wrap around if more data in ring buffer after linear portion */ + wrap = (mqtt_ringbuf_len(rb) > ringbuf_lin_len); + } + err = tcp_write(tpcb, mqtt_ringbuf_get_ptr(rb), send_len, TCP_WRITE_FLAG_COPY | (wrap ? TCP_WRITE_FLAG_MORE : 0)); + if ((err == ERR_OK) && wrap) { + mqtt_ringbuf_advance_get_idx(rb, send_len); + /* Use the lesser one of ring buffer linear length and TCP send buffer size */ + send_len = LWIP_MIN(tcp_sndbuf(tpcb), mqtt_ringbuf_linear_read_length(rb)); + err = tcp_write(tpcb, mqtt_ringbuf_get_ptr(rb), send_len, TCP_WRITE_FLAG_COPY); + } + + if (err == ERR_OK) { + mqtt_ringbuf_advance_get_idx(rb, send_len); + /* Flush */ + tcp_output(tpcb); + } else { + LWIP_DEBUGF(MQTT_DEBUG_WARN, ("mqtt_output_send: Send failed with err %d (\"%s\")\n", err, lwip_strerr(err))); + } +} + + + +/*--------------------------------------------------------------------------------------------------------------------- */ +/* Request queue */ + +/** + * Create request item + * @param r_objs Pointer to request objects + * @param pkt_id Packet identifier of request + * @param cb Packet callback to call when requests lifetime ends + * @param arg Parameter following callback + * @return Request or NULL if failed to create + */ +static struct mqtt_request_t * +mqtt_create_request(struct mqtt_request_t *r_objs, u16_t pkt_id, mqtt_request_cb_t cb, void *arg) +{ + struct mqtt_request_t *r = NULL; + u8_t n; + LWIP_ASSERT("mqtt_create_request: r_objs != NULL", r_objs != NULL); + for (n = 0; n < MQTT_REQ_MAX_IN_FLIGHT; n++) { + /* Item point to itself if not in use */ + if (r_objs[n].next == &r_objs[n]) { + r = &r_objs[n]; + r->next = NULL; + r->cb = cb; + r->arg = arg; + r->pkt_id = pkt_id; + break; + } + } + return r; +} + + +/** + * Append request to pending request queue + * @param tail Pointer to request queue tail pointer + * @param r Request to append + */ +static void +mqtt_append_request(struct mqtt_request_t **tail, struct mqtt_request_t *r) +{ + struct mqtt_request_t *head = NULL; + s16_t time_before = 0; + struct mqtt_request_t *iter; + + LWIP_ASSERT("mqtt_append_request: tail != NULL", tail != NULL); + + /* Iterate trough queue to find head, and count total timeout time */ + for (iter = *tail; iter != NULL; iter = iter->next) { + time_before += iter->timeout_diff; + head = iter; + } + + LWIP_ASSERT("mqtt_append_request: time_before <= MQTT_REQ_TIMEOUT", time_before <= MQTT_REQ_TIMEOUT); + r->timeout_diff = MQTT_REQ_TIMEOUT - time_before; + if (head == NULL) { + *tail = r; + } else { + head->next = r; + } +} + + +/** + * Delete request item + * @param r Request item to delete + */ +static void +mqtt_delete_request(struct mqtt_request_t *r) +{ + if (r != NULL) { + r->next = r; + } +} + +/** + * Remove a request item with a specific packet identifier from request queue + * @param tail Pointer to request queue tail pointer + * @param pkt_id Packet identifier of request to take + * @return Request item if found, NULL if not + */ +static struct mqtt_request_t * +mqtt_take_request(struct mqtt_request_t **tail, u16_t pkt_id) +{ + struct mqtt_request_t *iter = NULL, *prev = NULL; + LWIP_ASSERT("mqtt_take_request: tail != NULL", tail != NULL); + /* Search all request for pkt_id */ + for (iter = *tail; iter != NULL; iter = iter->next) { + if (iter->pkt_id == pkt_id) { + break; + } + prev = iter; + } + + /* If request was found */ + if (iter != NULL) { + /* unchain */ + if (prev == NULL) { + *tail= iter->next; + } else { + prev->next = iter->next; + } + /* If exists, add remaining timeout time for the request to next */ + if (iter->next != NULL) { + iter->next->timeout_diff += iter->timeout_diff; + } + iter->next = NULL; + } + return iter; +} + +/** + * Handle requests timeout + * @param tail Pointer to request queue tail pointer + * @param t Time since last call in seconds + */ +static void +mqtt_request_time_elapsed(struct mqtt_request_t **tail, u8_t t) +{ + struct mqtt_request_t *r = *tail; + LWIP_ASSERT("mqtt_request_time_elapsed: tail != NULL", tail != NULL); + while (t > 0 && r != NULL) { + if (t >= r->timeout_diff) { + t -= (u8_t)r->timeout_diff; + /* Unchain */ + *tail = r->next; + /* Notify upper layer about timeout */ + if (r->cb != NULL) { + r->cb(r->arg, ERR_TIMEOUT); + } + mqtt_delete_request(r); + /* Tail might be be modified in callback, so re-read it in every iteration */ + r = *(struct mqtt_request_t * const volatile *)tail; + } else { + r->timeout_diff -= t; + t = 0; + } + } +} + +/** + * Free all request items + * @param tail Pointer to request queue tail pointer + */ +static void +mqtt_clear_requests(struct mqtt_request_t **tail) +{ + struct mqtt_request_t *iter, *next; + LWIP_ASSERT("mqtt_clear_requests: tail != NULL", tail != NULL); + for (iter = *tail; iter != NULL; iter = next) { + next = iter->next; + mqtt_delete_request(iter); + } + *tail = NULL; +} +/** + * Initialize all request items + * @param r_objs Pointer to request objects + */ +static void +mqtt_init_requests(struct mqtt_request_t *r_objs) +{ + u8_t n; + LWIP_ASSERT("mqtt_init_requests: r_objs != NULL", r_objs != NULL); + for (n = 0; n < MQTT_REQ_MAX_IN_FLIGHT; n++) { + /* Item pointing to itself indicates unused */ + r_objs[n].next = &r_objs[n]; + } +} + +/*--------------------------------------------------------------------------------------------------------------------- */ +/* Output message build helpers */ + + +static void +mqtt_output_append_u8(struct mqtt_ringbuf_t *rb, u8_t value) +{ + mqtt_ringbuf_put(rb, value); +} + +static +void mqtt_output_append_u16(struct mqtt_ringbuf_t *rb, u16_t value) +{ + mqtt_ringbuf_put(rb, value >> 8); + mqtt_ringbuf_put(rb, value & 0xff); +} + +static void +mqtt_output_append_buf(struct mqtt_ringbuf_t *rb, const void *data, u16_t length) +{ + u16_t n; + for (n = 0; n < length; n++) { + mqtt_ringbuf_put(rb, ((const u8_t *)data)[n]); + } +} + +static void +mqtt_output_append_string(struct mqtt_ringbuf_t *rb, const char *str, u16_t length) +{ + u16_t n; + mqtt_ringbuf_put(rb, length >> 8); + mqtt_ringbuf_put(rb, length & 0xff); + for (n = 0; n < length; n++) { + mqtt_ringbuf_put(rb, str[n]); + } +} + +/** + * Append fixed header + * @param rb Output ring buffer + * @param msg_type see enum mqtt_message_type + * @param dup MQTT DUP flag + * @param qos MQTT QoS field + * @param retain MQTT retain flag + * @param r_length Remaining length after fixed header + */ + +static void +mqtt_output_append_fixed_header(struct mqtt_ringbuf_t *rb, u8_t msg_type, u8_t dup, + u8_t qos, u8_t retain, u16_t r_length) +{ + /* Start with control byte */ + mqtt_output_append_u8(rb, (((msg_type & 0x0f) << 4) | ((dup & 1) << 3) | ((qos & 3) << 1) | (retain & 1))); + /* Encode remaining length field */ + do { + mqtt_output_append_u8(rb, (r_length & 0x7f) | (r_length >= 128 ? 0x80 : 0)); + r_length >>= 7; + } while (r_length > 0); +} + + +/** + * Check output buffer space + * @param rb Output ring buffer + * @param r_length Remaining length after fixed header + * @return 1 if message will fit, 0 if not enough buffer space + */ +static u8_t +mqtt_output_check_space(struct mqtt_ringbuf_t *rb, u16_t r_length) +{ + /* Start with length of type byte + remaining length */ + u16_t total_len = 1 + r_length; + + LWIP_ASSERT("mqtt_output_check_space: rb != NULL", rb != NULL); + + /* Calculate number of required bytes to contain the remaining bytes field and add to total*/ + do { + total_len++; + r_length >>= 7; + } while (r_length > 0); + + return (total_len <= mqtt_ringbuf_free(rb)); +} + + +/** + * Close connection to server + * @param client MQTT client + * @param reason Reason for disconnection + */ +static void +mqtt_close(mqtt_client_t *client, mqtt_connection_status_t reason) +{ + LWIP_ASSERT("mqtt_close: client != NULL", client != NULL); + + /* Bring down TCP connection if not already done */ + if (client->conn != NULL) { + err_t res; + tcp_recv(client->conn, NULL); + tcp_err(client->conn, NULL); + tcp_sent(client->conn, NULL); + res = tcp_close(client->conn); + if (res != ERR_OK) { + tcp_abort(client->conn); + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_close: Close err=%s\n", lwip_strerr(res))); + } + client->conn = NULL; + } + + /* Remove all pending requests */ + mqtt_clear_requests(&client->pend_req_queue); + /* Stop cyclic timer */ + sys_untimeout(mqtt_cyclic_timer, client); + + /* Notify upper layer of disconnection if changed state */ + if (client->conn_state != TCP_DISCONNECTED) { + + client->conn_state = TCP_DISCONNECTED; + if (client->connect_cb != NULL) { + client->connect_cb(client, client->connect_arg, reason); + } + } +} + + +/** + * Interval timer, called every MQTT_CYCLIC_TIMER_INTERVAL seconds in MQTT_CONNECTING and MQTT_CONNECTED states + * @param arg MQTT client + */ +static void +mqtt_cyclic_timer(void *arg) +{ + u8_t restart_timer = 1; + mqtt_client_t *client = (mqtt_client_t *)arg; + LWIP_ASSERT("mqtt_cyclic_timer: client != NULL", client != NULL); + + if (client->conn_state == MQTT_CONNECTING) { + client->cyclic_tick++; + if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= MQTT_CONNECT_TIMOUT) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_cyclic_timer: CONNECT attempt to server timed out\n")); + /* Disconnect TCP */ + mqtt_close(client, MQTT_CONNECT_TIMEOUT); + restart_timer = 0; + } + } else if (client->conn_state == MQTT_CONNECTED) { + /* Handle timeout for pending requests */ + mqtt_request_time_elapsed(&client->pend_req_queue, MQTT_CYCLIC_TIMER_INTERVAL); + + /* keep_alive > 0 means keep alive functionality shall be used */ + if (client->keep_alive > 0) { + + client->server_watchdog++; + /* If reception from server has been idle for 1.5*keep_alive time, server is considered unresponsive */ + if ((client->server_watchdog * MQTT_CYCLIC_TIMER_INTERVAL) > (client->keep_alive + client->keep_alive/2)) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_cyclic_timer: Server incoming keep-alive timeout\n")); + mqtt_close(client, MQTT_CONNECT_TIMEOUT); + restart_timer = 0; + } + + /* If time for a keep alive message to be sent, transmission has been idle for keep_alive time */ + if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= client->keep_alive) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_cyclic_timer: Sending keep-alive message to server\n")); + if (mqtt_output_check_space(&client->output, 0) != 0) { + mqtt_output_append_fixed_header(&client->output, MQTT_MSG_TYPE_PINGREQ, 0, 0, 0, 0); + client->cyclic_tick = 0; + } + } else { + client->cyclic_tick++; + } + } + } else { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_cyclic_timer: Timer should not be running in state %d\n", client->conn_state)); + restart_timer = 0; + } + if (restart_timer) { + sys_timeout(MQTT_CYCLIC_TIMER_INTERVAL*1000, mqtt_cyclic_timer, arg); + } +} + + +/** + * Send PUBACK, PUBREC or PUBREL response message + * @param client MQTT client + * @param msg PUBACK, PUBREC or PUBREL + * @param pkt_id Packet identifier + * @param qos QoS value + * @return ERR_OK if successful, ERR_MEM if out of memory + */ +static err_t +pub_ack_rec_rel_response(mqtt_client_t *client, u8_t msg, u16_t pkt_id, u8_t qos) +{ + err_t err = ERR_OK; + if (mqtt_output_check_space(&client->output, 2)) { + mqtt_output_append_fixed_header(&client->output, msg, 0, qos, 0, 2); + mqtt_output_append_u16(&client->output, pkt_id); + mqtt_output_send(&client->output, client->conn); + } else { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("pub_ack_rec_rel_response: OOM creating response: %s with pkt_id: %d\n", + mqtt_msg_type_to_str(msg), pkt_id)); + err = ERR_MEM; + } + return err; +} + +/** + * Subscribe response from server + * @param r Matching request + * @param result Result code from server + */ +static void +mqtt_incomming_suback(struct mqtt_request_t *r, u8_t result) +{ + if (r->cb != NULL) { + r->cb(r->arg, result < 3 ? ERR_OK : ERR_ABRT); + } +} + + +/** + * Complete MQTT message received or buffer full + * @param client MQTT client + * @param fixed_hdr_idx header index + * @param length length received part + * @param remaining_length Remaining length of complete message + */ +static mqtt_connection_status_t + mqtt_message_received(mqtt_client_t *client, u8_t fixed_hdr_idx, u16_t length, u32_t remaining_length) +{ + mqtt_connection_status_t res = MQTT_CONNECT_ACCEPTED; + + u8_t *var_hdr_payload = client->rx_buffer + fixed_hdr_idx; + + /* Control packet type */ + u8_t pkt_type = MQTT_CTL_PACKET_TYPE(client->rx_buffer[0]); + u16_t pkt_id = 0; + + if (pkt_type == MQTT_MSG_TYPE_CONNACK) { + if (client->conn_state == MQTT_CONNECTING) { + /* Get result code from CONNACK */ + res = (mqtt_connection_status_t)var_hdr_payload[1]; + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_message_received: Connect response code %d\n", res)); + if (res == MQTT_CONNECT_ACCEPTED) { + /* Reset cyclic_tick when changing to connected state */ + client->cyclic_tick = 0; + client->conn_state = MQTT_CONNECTED; + /* Notify upper layer */ + if (client->connect_cb != 0) { + client->connect_cb(client, client->connect_arg, res); + } + } + } else { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_message_received: Received CONNACK in connected state\n")); + } + } else if (pkt_type == MQTT_MSG_TYPE_PINGRESP) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,( "mqtt_message_received: Received PINGRESP from server\n")); + + } else if (pkt_type == MQTT_MSG_TYPE_PUBLISH) { + u16_t payload_offset = 0; + u16_t payload_length = length; + u8_t qos = MQTT_CTL_PACKET_QOS(client->rx_buffer[0]); + + if (client->msg_idx <= MQTT_VAR_HEADER_BUFFER_LEN) { + /* Should have topic and pkt id*/ + uint8_t *topic; + uint16_t after_topic; + u8_t bkp; + u16_t topic_len = var_hdr_payload[0]; + topic_len = (topic_len << 8) + (u16_t)(var_hdr_payload[1]); + + topic = var_hdr_payload + 2; + after_topic = 2 + topic_len; + /* Check length, add one byte even for QoS 0 so that zero termination will fit */ + if ((after_topic + (qos? 2 : 1)) > length) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_message_received: Receive buffer can not fit topic + pkt_id\n")); + goto out_disconnect; + } + + /* id for QoS 1 and 2 */ + if (qos > 0) { + client->inpub_pkt_id = ((u16_t)var_hdr_payload[after_topic] << 8) + (u16_t)var_hdr_payload[after_topic + 1]; + after_topic += 2; + } else { + client->inpub_pkt_id = 0; + } + /* Take backup of byte after topic */ + bkp = topic[topic_len]; + /* Zero terminate string */ + topic[topic_len] = 0; + /* Payload data remaining in receive buffer */ + payload_length = length - after_topic; + payload_offset = after_topic; + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_incomming_publish: Received message with QoS %d at topic: %s, payload length %d\n", + qos, topic, remaining_length + payload_length)); + if (client->pub_cb != NULL) { + client->pub_cb(client->inpub_arg, (const char *)topic, remaining_length + payload_length); + } + /* Restore byte after topic */ + topic[topic_len] = bkp; + } + if (payload_length > 0 || remaining_length == 0) { + client->data_cb(client->inpub_arg, var_hdr_payload + payload_offset, payload_length, remaining_length == 0 ? MQTT_DATA_FLAG_LAST : 0); + /* Reply if QoS > 0 */ + if (remaining_length == 0 && qos > 0) { + /* Send PUBACK for QoS 1 or PUBREC for QoS 2 */ + u8_t resp_msg = (qos == 1) ? MQTT_MSG_TYPE_PUBACK : MQTT_MSG_TYPE_PUBREC; + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_incomming_publish: Sending publish response: %s with pkt_id: %d\n", + mqtt_msg_type_to_str(resp_msg), client->inpub_pkt_id)); + pub_ack_rec_rel_response(client, resp_msg, client->inpub_pkt_id, 0); + } + } + } else { + /* Get packet identifier */ + pkt_id = (u16_t)var_hdr_payload[0] << 8; + pkt_id |= (u16_t)var_hdr_payload[1]; + if (pkt_id == 0) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_message_received: Got message with illegal packet identifier: 0\n")); + goto out_disconnect; + } + if (pkt_type == MQTT_MSG_TYPE_PUBREC) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_message_received: PUBREC, sending PUBREL with pkt_id: %d\n",pkt_id)); + pub_ack_rec_rel_response(client, MQTT_MSG_TYPE_PUBREL, pkt_id, 1); + + } else if (pkt_type == MQTT_MSG_TYPE_PUBREL) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_message_received: PUBREL, sending PUBCOMP response with pkt_id: %d\n",pkt_id)); + pub_ack_rec_rel_response(client, MQTT_MSG_TYPE_PUBCOMP, pkt_id, 0); + + } else if (pkt_type == MQTT_MSG_TYPE_SUBACK || pkt_type == MQTT_MSG_TYPE_UNSUBACK || + pkt_type == MQTT_MSG_TYPE_PUBCOMP || pkt_type == MQTT_MSG_TYPE_PUBACK) { + struct mqtt_request_t *r = mqtt_take_request(&client->pend_req_queue, pkt_id); + if (r != NULL) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_message_received: %s response with id %d\n", mqtt_msg_type_to_str(pkt_type), pkt_id)); + if (pkt_type == MQTT_MSG_TYPE_SUBACK) { + if (length < 3) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_message_received: To small SUBACK packet\n")); + goto out_disconnect; + } else { + mqtt_incomming_suback(r, var_hdr_payload[2]); + } + } else if (r->cb != NULL) { + r->cb(r->arg, ERR_OK); + } + mqtt_delete_request(r); + } else { + LWIP_DEBUGF(MQTT_DEBUG_WARN,( "mqtt_message_received: Received %s reply, with wrong pkt_id: %d\n", mqtt_msg_type_to_str(pkt_type), pkt_id)); + } + } else { + LWIP_DEBUGF(MQTT_DEBUG_WARN,( "mqtt_message_received: Received unknown message type: %d\n", pkt_type)); + goto out_disconnect; + } + } + return res; +out_disconnect: + return MQTT_CONNECT_DISCONNECTED; +} + + +/** + * MQTT incoming message parser + * @param client MQTT client + * @param p PBUF chain of received data + * @return Connection status + */ +static mqtt_connection_status_t +mqtt_parse_incoming(mqtt_client_t *client, struct pbuf *p) +{ + u16_t in_offset = 0; + u32_t msg_rem_len = 0; + u8_t fixed_hdr_idx = 0; + u8_t b = 0; + + while (p->tot_len > in_offset) { + if ((fixed_hdr_idx < 2) || ((b & 0x80) != 0)) { + + if (fixed_hdr_idx < client->msg_idx) { + b = client->rx_buffer[fixed_hdr_idx]; + } else { + b = pbuf_get_at(p, in_offset++); + client->rx_buffer[client->msg_idx++] = b; + } + fixed_hdr_idx++; + + if (fixed_hdr_idx >= 2) { + msg_rem_len |= (u32_t)(b & 0x7f) << ((fixed_hdr_idx - 2) * 7); + if ((b & 0x80) == 0) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_parse_incoming: Remaining length after fixed header: %d\n", msg_rem_len)); + if (msg_rem_len == 0) { + /* Complete message with no extra headers of payload received */ + mqtt_message_received(client, fixed_hdr_idx, 0, 0); + client->msg_idx = 0; + fixed_hdr_idx = 0; + } else { + /* Bytes remaining in message */ + msg_rem_len = (msg_rem_len + fixed_hdr_idx) - client->msg_idx; + } + } + } + } else { + u16_t cpy_len, cpy_start, buffer_space; + + cpy_start = (client->msg_idx - fixed_hdr_idx) % (MQTT_VAR_HEADER_BUFFER_LEN - fixed_hdr_idx) + fixed_hdr_idx; + + /* Allow to copy the lesser one of available length in input data or bytes remaining in message */ + cpy_len = (u16_t)LWIP_MIN((u16_t)(p->tot_len - in_offset), msg_rem_len); + + /* Limit to available space in buffer */ + buffer_space = MQTT_VAR_HEADER_BUFFER_LEN - cpy_start; + if (cpy_len > buffer_space) { + cpy_len = buffer_space; + } + pbuf_copy_partial(p, client->rx_buffer+cpy_start, cpy_len, in_offset); + + /* Advance get and put indexes */ + client->msg_idx += cpy_len; + in_offset += cpy_len; + msg_rem_len -= cpy_len; + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_parse_incoming: msg_idx: %d, cpy_len: %d, remaining %d\n", client->msg_idx, cpy_len, msg_rem_len)); + if (msg_rem_len == 0 || cpy_len == buffer_space) { + /* Whole message received or buffer is full */ + mqtt_connection_status_t res = mqtt_message_received(client, fixed_hdr_idx, (cpy_start + cpy_len) - fixed_hdr_idx, msg_rem_len); + if (res != MQTT_CONNECT_ACCEPTED) { + return res; + } + if (msg_rem_len == 0) { + /* Reset parser state */ + client->msg_idx = 0; + /* msg_tot_len = 0; */ + fixed_hdr_idx = 0; + } + } + } + } + return MQTT_CONNECT_ACCEPTED; +} + + +/** + * TCP received callback function. @see tcp_recv_fn + * @param arg MQTT client + * @param p PBUF chain of received data + * @param err Passed as return value if not ERR_OK + * @return ERR_OK or err passed into callback + */ +static err_t +mqtt_tcp_recv_cb(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + mqtt_client_t *client = (mqtt_client_t *)arg; + LWIP_ASSERT("mqtt_tcp_recv_cb: client != NULL", client != NULL); + LWIP_ASSERT("mqtt_tcp_recv_cb: client->conn == pcb", client->conn == pcb); + + if (p == NULL) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_tcp_recv_cb: Recv pbuf=NULL, remote has closed connection\n")); + mqtt_close(client, MQTT_CONNECT_DISCONNECTED); + } else { + mqtt_connection_status_t res; + if (err != ERR_OK) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_tcp_recv_cb: Recv err=%d\n", err)); + pbuf_free(p); + return err; + } + + /* Tell remote that data has been received */ + tcp_recved(pcb, p->tot_len); + res = mqtt_parse_incoming(client, p); + pbuf_free(p); + + if (res != MQTT_CONNECT_ACCEPTED) { + mqtt_close(client, res); + } + /* If keep alive functionality is used */ + if (client->keep_alive != 0) { + /* Reset server alive watchdog */ + client->server_watchdog = 0; + } + + } + return ERR_OK; +} + + +/** + * TCP data sent callback function. @see tcp_sent_fn + * @param arg MQTT client + * @param tpcb TCP connection handle + * @param len Number of bytes sent + * @return ERR_OK + */ +static err_t +mqtt_tcp_sent_cb(void *arg, struct tcp_pcb *tpcb, u16_t len) +{ + mqtt_client_t *client = (mqtt_client_t *)arg; + + LWIP_UNUSED_ARG(tpcb); + LWIP_UNUSED_ARG(len); + + if (client->conn_state == MQTT_CONNECTED) { + struct mqtt_request_t *r; + + /* Reset keep-alive send timer and server watchdog */ + client->cyclic_tick = 0; + client->server_watchdog = 0; + /* QoS 0 publish has no response from server, so call its callbacks here */ + while ((r = mqtt_take_request(&client->pend_req_queue, 0)) != NULL) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_tcp_sent_cb: Calling QoS 0 publish complete callback\n")); + if (r->cb != NULL) { + r->cb(r->arg, ERR_OK); + } + mqtt_delete_request(r); + } + /* Try send any remaining buffers from output queue */ + mqtt_output_send(&client->output, client->conn); + } + return ERR_OK; +} + +/** + * TCP error callback function. @see tcp_err_fn + * @param arg MQTT client + * @param err Error encountered + */ +static void +mqtt_tcp_err_cb(void *arg, err_t err) +{ + mqtt_client_t *client = (mqtt_client_t *)arg; + LWIP_UNUSED_ARG(err); /* only used for debug output */ + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_tcp_err_cb: TCP error callback: error %d, arg: %p\n", err, arg)); + LWIP_ASSERT("mqtt_tcp_err_cb: client != NULL", client != NULL); + /* Set conn to null before calling close as pcb is already deallocated*/ + client->conn = 0; + mqtt_close(client, MQTT_CONNECT_DISCONNECTED); +} + +/** + * TCP poll callback function. @see tcp_poll_fn + * @param arg MQTT client + * @param tpcb TCP connection handle + * @return err ERR_OK + */ +static err_t +mqtt_tcp_poll_cb(void *arg, struct tcp_pcb *tpcb) +{ + mqtt_client_t *client = (mqtt_client_t *)arg; + if (client->conn_state == MQTT_CONNECTED) { + /* Try send any remaining buffers from output queue */ + mqtt_output_send(&client->output, tpcb); + } + return ERR_OK; +} + +/** + * TCP connect callback function. @see tcp_connected_fn + * @param arg MQTT client + * @param err Always ERR_OK, mqtt_tcp_err_cb is called in case of error + * @return ERR_OK + */ +static err_t +mqtt_tcp_connect_cb(void *arg, struct tcp_pcb *tpcb, err_t err) +{ + mqtt_client_t* client = (mqtt_client_t *)arg; + + if (err != ERR_OK) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_tcp_connect_cb: TCP connect error %d\n", err)); + return err; + } + + /* Initiate receiver state */ + client->msg_idx = 0; + + /* Setup TCP callbacks */ + tcp_recv(tpcb, mqtt_tcp_recv_cb); + tcp_sent(tpcb, mqtt_tcp_sent_cb); + tcp_poll(tpcb, mqtt_tcp_poll_cb, 2); + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_tcp_connect_cb: TCP connection established to server\n")); + /* Enter MQTT connect state */ + client->conn_state = MQTT_CONNECTING; + + /* Start cyclic timer */ + sys_timeout(MQTT_CYCLIC_TIMER_INTERVAL*1000, mqtt_cyclic_timer, client); + client->cyclic_tick = 0; + + /* Start transmission from output queue, connect message is the first one out*/ + mqtt_output_send(&client->output, client->conn); + + return ERR_OK; +} + + + +/*---------------------------------------------------------------------------------------------------- */ +/* Public API */ + + +/** + * @ingroup mqtt + * MQTT publish function. + * @param client MQTT client + * @param topic Publish topic string + * @param payload Data to publish (NULL is allowed) + * @param payload_length: Length of payload (0 is allowed) + * @param qos Quality of service, 0 1 or 2 + * @param retain MQTT retain flag + * @param cb Callback to call when publish is complete or has timed out + * @param arg User supplied argument to publish callback + * @return ERR_OK if successful + * ERR_CONN if client is disconnected + * ERR_MEM if short on memory + */ +err_t +mqtt_publish(mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain, + mqtt_request_cb_t cb, void *arg) +{ + struct mqtt_request_t *r; + u16_t pkt_id; + size_t topic_strlen; + size_t total_len; + u16_t topic_len; + u16_t remaining_length; + + LWIP_ASSERT("mqtt_publish: client != NULL", client); + LWIP_ASSERT("mqtt_publish: topic != NULL", topic); + LWIP_ERROR("mqtt_publish: TCP disconnected", (client->conn_state != TCP_DISCONNECTED), return ERR_CONN); + + topic_strlen = strlen(topic); + LWIP_ERROR("mqtt_publish: topic length overflow", (topic_strlen <= (0xFFFF - 2)), return ERR_ARG); + topic_len = (u16_t)topic_strlen; + total_len = 2 + topic_len + payload_length; + LWIP_ERROR("mqtt_publish: total length overflow", (total_len <= 0xFFFF), return ERR_ARG); + remaining_length = (u16_t)total_len; + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_publish: Publish with payload length %d to topic \"%s\"\n", payload_length, topic)); + + if (qos > 0) { + remaining_length += 2; + /* Generate pkt_id id for QoS1 and 2 */ + pkt_id = msg_generate_packet_id(client); + } else { + /* Use reserved value pkt_id 0 for QoS 0 in request handle */ + pkt_id = 0; + } + + r = mqtt_create_request(client->req_list, pkt_id, cb, arg); + if (r == NULL) { + return ERR_MEM; + } + + if (mqtt_output_check_space(&client->output, remaining_length) == 0) { + mqtt_delete_request(r); + return ERR_MEM; + } + /* Append fixed header */ + mqtt_output_append_fixed_header(&client->output, MQTT_MSG_TYPE_PUBLISH, 0, qos, retain, remaining_length); + + /* Append Topic */ + mqtt_output_append_string(&client->output, topic, topic_len); + + /* Append packet if for QoS 1 and 2*/ + if (qos > 0) { + mqtt_output_append_u16(&client->output, pkt_id); + } + + /* Append optional publish payload */ + if ((payload != NULL) && (payload_length > 0)) { + mqtt_output_append_buf(&client->output, payload, payload_length); + } + + mqtt_append_request(&client->pend_req_queue, r); + mqtt_output_send(&client->output, client->conn); + return ERR_OK; +} + + +/** + * @ingroup mqtt + * MQTT subscribe/unsubscribe function. + * @param client MQTT client + * @param topic topic to subscribe to + * @param qos Quality of service, 0 1 or 2 (only used for subscribe) + * @param cb Callback to call when subscribe/unsubscribe reponse is received + * @param arg User supplied argument to publish callback + * @param sub 1 for subscribe, 0 for unsubscribe + * @return ERR_OK if successful, @see err_t enum for other results + */ +err_t +mqtt_sub_unsub(mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub) +{ + size_t topic_strlen; + size_t total_len; + u16_t topic_len; + u16_t remaining_length; + u16_t pkt_id; + struct mqtt_request_t *r; + + LWIP_ASSERT("mqtt_sub_unsub: client != NULL", client); + LWIP_ASSERT("mqtt_sub_unsub: topic != NULL", topic); + + topic_strlen = strlen(topic); + LWIP_ERROR("mqtt_sub_unsub: topic length overflow", (topic_strlen <= (0xFFFF - 2)), return ERR_ARG); + topic_len = (u16_t)topic_strlen; + /* Topic string, pkt_id, qos for subscribe */ + total_len = topic_len + 2 + 2 + (sub != 0); + LWIP_ERROR("mqtt_sub_unsub: total length overflow", (total_len <= 0xFFFF), return ERR_ARG); + remaining_length = (u16_t)total_len; + + LWIP_ASSERT("mqtt_sub_unsub: qos < 3", qos < 3); + if (client->conn_state == TCP_DISCONNECTED) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_sub_unsub: Can not (un)subscribe in disconnected state\n")); + return ERR_CONN; + } + + pkt_id = msg_generate_packet_id(client); + r = mqtt_create_request(client->req_list, pkt_id, cb, arg); + if (r == NULL) { + return ERR_MEM; + } + + if (mqtt_output_check_space(&client->output, remaining_length) == 0) { + mqtt_delete_request(r); + return ERR_MEM; + } + + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_sub_unsub: Client (un)subscribe to topic \"%s\", id: %d\n", topic, pkt_id)); + + mqtt_output_append_fixed_header(&client->output, sub ? MQTT_MSG_TYPE_SUBSCRIBE : MQTT_MSG_TYPE_UNSUBSCRIBE, 0, 1, 0, remaining_length); + /* Packet id */ + mqtt_output_append_u16(&client->output, pkt_id); + /* Topic */ + mqtt_output_append_string(&client->output, topic, topic_len); + /* QoS */ + if (sub != 0) { + mqtt_output_append_u8(&client->output, LWIP_MIN(qos, 2)); + } + + mqtt_append_request(&client->pend_req_queue, r); + mqtt_output_send(&client->output, client->conn); + return ERR_OK; +} + + +/** + * @ingroup mqtt + * Set callback to handle incoming publish requests from server + * @param client MQTT client + * @param pub_cb Callback invoked when publish starts, contain topic and total length of payload + * @param data_cb Callback for each fragment of payload that arrives + * @param arg User supplied argument to both callbacks + */ +void +mqtt_set_inpub_callback(mqtt_client_t *client, mqtt_incoming_publish_cb_t pub_cb, + mqtt_incoming_data_cb_t data_cb, void *arg) +{ + LWIP_ASSERT("mqtt_set_inpub_callback: client != NULL", client != NULL); + client->data_cb = data_cb; + client->pub_cb = pub_cb; + client->inpub_arg = arg; +} + +/** + * @ingroup mqtt + * Create a new MQTT client instance + * @return Pointer to instance on success, NULL otherwise + */ +mqtt_client_t * +mqtt_client_new(void) +{ + mqtt_client_t *client = (mqtt_client_t *)mem_malloc(sizeof(mqtt_client_t)); + if (client != NULL) { + memset(client, 0, sizeof(mqtt_client_t)); + } + return client; +} + + +/** + * @ingroup mqtt + * Connect to MQTT server + * @param client MQTT client + * @param ip_addr Server IP + * @param port Server port + * @param cb Connection state change callback + * @param arg User supplied argument to connection callback + * @param client_info Client identification and connection options + * @return ERR_OK if successful, @see err_t enum for other results + */ +err_t +mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ip_addr, u16_t port, mqtt_connection_cb_t cb, void *arg, + const struct mqtt_connect_client_info_t *client_info) +{ + err_t err; + size_t len; + u16_t client_id_length; + /* Length is the sum of 2+"MQTT", protocol level, flags and keep alive */ + u16_t remaining_length = 2 + 4 + 1 + 1 + 2; + u8_t flags = 0, will_topic_len = 0, will_msg_len = 0; + + LWIP_ASSERT("mqtt_client_connect: client != NULL", client != NULL); + LWIP_ASSERT("mqtt_client_connect: ip_addr != NULL", ip_addr != NULL); + LWIP_ASSERT("mqtt_client_connect: client_info != NULL", client_info != NULL); + LWIP_ASSERT("mqtt_client_connect: client_info->client_id != NULL", client_info->client_id != NULL); + + if (client->conn_state != TCP_DISCONNECTED) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_client_connect: Already connected\n")); + return ERR_ISCONN; + } + + /* Wipe clean */ + memset(client, 0, sizeof(mqtt_client_t)); + client->connect_arg = arg; + client->connect_cb = cb; + client->keep_alive = client_info->keep_alive; + mqtt_init_requests(client->req_list); + + /* Build connect message */ + if (client_info->will_topic != NULL && client_info->will_msg != NULL) { + flags |= MQTT_CONNECT_FLAG_WILL; + flags |= (client_info->will_qos & 3) << 3; + if (client_info->will_retain) { + flags |= MQTT_CONNECT_FLAG_WILL_RETAIN; + } + len = strlen(client_info->will_topic); + LWIP_ERROR("mqtt_client_connect: client_info->will_topic length overflow", len <= 0xFF, return ERR_VAL); + LWIP_ERROR("mqtt_client_connect: client_info->will_topic length must be > 0", len > 0, return ERR_VAL); + will_topic_len = (u8_t)len; + len = strlen(client_info->will_msg); + LWIP_ERROR("mqtt_client_connect: client_info->will_msg length overflow", len <= 0xFF, return ERR_VAL); + will_msg_len = (u8_t)len; + len = remaining_length + 2 + will_topic_len + 2 + will_msg_len; + LWIP_ERROR("mqtt_client_connect: remaining_length overflow", len <= 0xFFFF, return ERR_VAL); + remaining_length = (u16_t)len; + } + + /* Don't complicate things, always connect using clean session */ + flags |= MQTT_CONNECT_FLAG_CLEAN_SESSION; + + len = strlen(client_info->client_id); + LWIP_ERROR("mqtt_client_connect: client_info->client_id length overflow", len <= 0xFFFF, return ERR_VAL); + client_id_length = (u16_t)len; + len = remaining_length + 2 + client_id_length; + LWIP_ERROR("mqtt_client_connect: remaining_length overflow", len <= 0xFFFF, return ERR_VAL); + remaining_length = (u16_t)len; + + if (mqtt_output_check_space(&client->output, remaining_length) == 0) { + return ERR_MEM; + } + + client->conn = tcp_new(); + if (client->conn == NULL) { + return ERR_MEM; + } + + /* Set arg pointer for callbacks */ + tcp_arg(client->conn, client); + /* Any local address, pick random local port number */ + err = tcp_bind(client->conn, IP_ADDR_ANY, 0); + if (err != ERR_OK) { + LWIP_DEBUGF(MQTT_DEBUG_WARN,("mqtt_client_connect: Error binding to local ip/port, %d\n", err)); + goto tcp_fail; + } + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_client_connect: Connecting to host: %s at port:%"U16_F"\n", ipaddr_ntoa(ip_addr), port)); + + /* Connect to server */ + err = tcp_connect(client->conn, ip_addr, port, mqtt_tcp_connect_cb); + if (err != ERR_OK) { + LWIP_DEBUGF(MQTT_DEBUG_TRACE,("mqtt_client_connect: Error connecting to remote ip/port, %d\n", err)); + goto tcp_fail; + } + /* Set error callback */ + tcp_err(client->conn, mqtt_tcp_err_cb); + client->conn_state = TCP_CONNECTING; + + /* Append fixed header */ + mqtt_output_append_fixed_header(&client->output, MQTT_MSG_TYPE_CONNECT, 0, 0, 0, remaining_length); + /* Append Protocol string */ + mqtt_output_append_string(&client->output, "MQTT", 4); + /* Append Protocol level */ + mqtt_output_append_u8(&client->output, 4); + /* Append connect flags */ + mqtt_output_append_u8(&client->output, flags); + /* Append keep-alive */ + mqtt_output_append_u16(&client->output, client_info->keep_alive); + /* Append client id */ + mqtt_output_append_string(&client->output, client_info->client_id, client_id_length); + /* Append will message if used */ + if ((flags & MQTT_CONNECT_FLAG_WILL) != 0) { + mqtt_output_append_string(&client->output, client_info->will_topic, will_topic_len); + mqtt_output_append_string(&client->output, client_info->will_msg, will_msg_len); + } + return ERR_OK; + +tcp_fail: + tcp_abort(client->conn); + client->conn = NULL; + return err; +} + + +/** + * @ingroup mqtt + * Disconnect from MQTT server + * @param client MQTT client + */ +void +mqtt_disconnect(mqtt_client_t *client) +{ + LWIP_ASSERT("mqtt_disconnect: client != NULL", client); + /* If connection in not already closed */ + if (client->conn_state != TCP_DISCONNECTED) { + /* Set conn_state before calling mqtt_close to prevent callback from being called */ + client->conn_state = TCP_DISCONNECTED; + mqtt_close(client, (mqtt_connection_status_t)0); + } +} + +/** + * @ingroup mqtt + * Check connection with server + * @param client MQTT client + * @return 1 if connected to server, 0 otherwise + */ +u8_t +mqtt_client_is_connected(mqtt_client_t *client) +{ + LWIP_ASSERT("mqtt_client_is_connected: client != NULL", client); + return client->conn_state == MQTT_CONNECTED; +} + +#endif /* LWIP_TCP && LWIP_CALLBACK_API */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/netbiosns/netbiosns.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/netbiosns/netbiosns.c new file mode 100644 index 0000000..2dfbe65 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/netbiosns/netbiosns.c @@ -0,0 +1,367 @@ +/** + * @file + * NetBIOS name service responder + */ + +/** + * @defgroup netbiosns NETBIOS responder + * @ingroup apps + * + * This is an example implementation of a NetBIOS name server. + * It responds to name queries for a configurable name. + * Name resolving is not supported. + * + * Note that the device doesn't broadcast it's own name so can't + * detect duplicate names! + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/apps/netbiosns.h" + +#if LWIP_IPV4 && LWIP_UDP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/udp.h" +#include "lwip/netif.h" + +#include + +/** default port number for "NetBIOS Name service */ +#define NETBIOS_PORT 137 + +/** size of a NetBIOS name */ +#define NETBIOS_NAME_LEN 16 + +/** The Time-To-Live for NetBIOS name responds (in seconds) + * Default is 300000 seconds (3 days, 11 hours, 20 minutes) */ +#define NETBIOS_NAME_TTL 300000u + +/** NetBIOS header flags */ +#define NETB_HFLAG_RESPONSE 0x8000U +#define NETB_HFLAG_OPCODE 0x7800U +#define NETB_HFLAG_OPCODE_NAME_QUERY 0x0000U +#define NETB_HFLAG_AUTHORATIVE 0x0400U +#define NETB_HFLAG_TRUNCATED 0x0200U +#define NETB_HFLAG_RECURS_DESIRED 0x0100U +#define NETB_HFLAG_RECURS_AVAILABLE 0x0080U +#define NETB_HFLAG_BROADCAST 0x0010U +#define NETB_HFLAG_REPLYCODE 0x0008U +#define NETB_HFLAG_REPLYCODE_NOERROR 0x0000U + +/** NetBIOS name flags */ +#define NETB_NFLAG_UNIQUE 0x8000U +#define NETB_NFLAG_NODETYPE 0x6000U +#define NETB_NFLAG_NODETYPE_HNODE 0x6000U +#define NETB_NFLAG_NODETYPE_MNODE 0x4000U +#define NETB_NFLAG_NODETYPE_PNODE 0x2000U +#define NETB_NFLAG_NODETYPE_BNODE 0x0000U + +/** NetBIOS message header */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct netbios_hdr { + PACK_STRUCT_FIELD(u16_t trans_id); + PACK_STRUCT_FIELD(u16_t flags); + PACK_STRUCT_FIELD(u16_t questions); + PACK_STRUCT_FIELD(u16_t answerRRs); + PACK_STRUCT_FIELD(u16_t authorityRRs); + PACK_STRUCT_FIELD(u16_t additionalRRs); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** NetBIOS message name part */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct netbios_name_hdr { + PACK_STRUCT_FLD_8(u8_t nametype); + PACK_STRUCT_FLD_8(u8_t encname[(NETBIOS_NAME_LEN*2)+1]); + PACK_STRUCT_FIELD(u16_t type); + PACK_STRUCT_FIELD(u16_t cls); + PACK_STRUCT_FIELD(u32_t ttl); + PACK_STRUCT_FIELD(u16_t datalen); + PACK_STRUCT_FIELD(u16_t flags); + PACK_STRUCT_FLD_S(ip4_addr_p_t addr); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** NetBIOS message */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct netbios_resp +{ + struct netbios_hdr resp_hdr; + struct netbios_name_hdr resp_name; +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef NETBIOS_LWIP_NAME +#define NETBIOS_LOCAL_NAME NETBIOS_LWIP_NAME +#else +static char netbiosns_local_name[NETBIOS_NAME_LEN]; +#define NETBIOS_LOCAL_NAME netbiosns_local_name +#endif + +struct udp_pcb *netbiosns_pcb; + +/** Decode a NetBIOS name (from packet to string) */ +static int +netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len) +{ + char *pname; + char cname; + char cnbname; + int idx = 0; + + LWIP_UNUSED_ARG(name_dec_len); + + /* Start decoding netbios name. */ + pname = name_enc; + for (;;) { + /* Every two characters of the first level-encoded name + * turn into one character in the decoded name. */ + cname = *pname; + if (cname == '\0') + break; /* no more characters */ + if (cname == '.') + break; /* scope ID follows */ + if (cname < 'A' || cname > 'Z') { + /* Not legal. */ + return -1; + } + cname -= 'A'; + cnbname = cname << 4; + pname++; + + cname = *pname; + if (cname == '\0' || cname == '.') { + /* No more characters in the name - but we're in + * the middle of a pair. Not legal. */ + return -1; + } + if (cname < 'A' || cname > 'Z') { + /* Not legal. */ + return -1; + } + cname -= 'A'; + cnbname |= cname; + pname++; + + /* Do we have room to store the character? */ + if (idx < NETBIOS_NAME_LEN) { + /* Yes - store the character. */ + name_dec[idx++] = (cnbname!=' '?cnbname:'\0'); + } + } + + return 0; +} + +#if 0 /* function currently unused */ +/** Encode a NetBIOS name (from string to packet) - currently unused because + we don't ask for names. */ +static int +netbiosns_name_encode(char *name_enc, char *name_dec, int name_dec_len) +{ + char *pname; + char cname; + unsigned char ucname; + int idx = 0; + + /* Start encoding netbios name. */ + pname = name_enc; + + for (;;) { + /* Every two characters of the first level-encoded name + * turn into one character in the decoded name. */ + cname = *pname; + if (cname == '\0') + break; /* no more characters */ + if (cname == '.') + break; /* scope ID follows */ + if ((cname < 'A' || cname > 'Z') && (cname < '0' || cname > '9')) { + /* Not legal. */ + return -1; + } + + /* Do we have room to store the character? */ + if (idx >= name_dec_len) { + return -1; + } + + /* Yes - store the character. */ + ucname = cname; + name_dec[idx++] = ('A'+((ucname>>4) & 0x0F)); + name_dec[idx++] = ('A'+( ucname & 0x0F)); + pname++; + } + + /* Fill with "space" coding */ + for (;idx < name_dec_len - 1;) { + name_dec[idx++] = 'C'; + name_dec[idx++] = 'A'; + } + + /* Terminate string */ + name_dec[idx] = '\0'; + + return 0; +} +#endif /* 0 */ + +/** NetBIOS Name service recv callback */ +static void +netbiosns_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + LWIP_UNUSED_ARG(arg); + + /* if packet is valid */ + if (p != NULL) { + char netbios_name[NETBIOS_NAME_LEN+1]; + struct netbios_hdr* netbios_hdr = (struct netbios_hdr*)p->payload; + struct netbios_name_hdr* netbios_name_hdr = (struct netbios_name_hdr*)(netbios_hdr+1); + + /* we only answer if we got a default interface */ + if (netif_default != NULL) { + /* @todo: do we need to check answerRRs/authorityRRs/additionalRRs? */ + /* if the packet is a NetBIOS name query question */ + if (((netbios_hdr->flags & PP_NTOHS(NETB_HFLAG_OPCODE)) == PP_NTOHS(NETB_HFLAG_OPCODE_NAME_QUERY)) && + ((netbios_hdr->flags & PP_NTOHS(NETB_HFLAG_RESPONSE)) == 0) && + (netbios_hdr->questions == PP_NTOHS(1))) { + /* decode the NetBIOS name */ + netbiosns_name_decode((char*)(netbios_name_hdr->encname), netbios_name, sizeof(netbios_name)); + /* if the packet is for us */ + if (lwip_strnicmp(netbios_name, NETBIOS_LOCAL_NAME, sizeof(NETBIOS_LOCAL_NAME)) == 0) { + struct pbuf *q; + struct netbios_resp *resp; + + q = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct netbios_resp), PBUF_RAM); + if (q != NULL) { + resp = (struct netbios_resp*)q->payload; + + /* prepare NetBIOS header response */ + resp->resp_hdr.trans_id = netbios_hdr->trans_id; + resp->resp_hdr.flags = PP_HTONS(NETB_HFLAG_RESPONSE | + NETB_HFLAG_OPCODE_NAME_QUERY | + NETB_HFLAG_AUTHORATIVE | + NETB_HFLAG_RECURS_DESIRED); + resp->resp_hdr.questions = 0; + resp->resp_hdr.answerRRs = PP_HTONS(1); + resp->resp_hdr.authorityRRs = 0; + resp->resp_hdr.additionalRRs = 0; + + /* prepare NetBIOS header datas */ + MEMCPY( resp->resp_name.encname, netbios_name_hdr->encname, sizeof(netbios_name_hdr->encname)); + resp->resp_name.nametype = netbios_name_hdr->nametype; + resp->resp_name.type = netbios_name_hdr->type; + resp->resp_name.cls = netbios_name_hdr->cls; + resp->resp_name.ttl = PP_HTONL(NETBIOS_NAME_TTL); + resp->resp_name.datalen = PP_HTONS(sizeof(resp->resp_name.flags)+sizeof(resp->resp_name.addr)); + resp->resp_name.flags = PP_HTONS(NETB_NFLAG_NODETYPE_BNODE); + ip4_addr_copy(resp->resp_name.addr, *netif_ip4_addr(netif_default)); + + /* send the NetBIOS response */ + udp_sendto(upcb, q, addr, port); + + /* free the "reference" pbuf */ + pbuf_free(q); + } + } + } + } + /* free the pbuf */ + pbuf_free(p); + } +} + +/** + * @ingroup netbiosns + * Init netbios responder + */ +void +netbiosns_init(void) +{ +#ifdef NETBIOS_LWIP_NAME + LWIP_ASSERT("NetBIOS name is too long!", strlen(NETBIOS_LWIP_NAME) < NETBIOS_NAME_LEN); +#endif + + netbiosns_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); + if (netbiosns_pcb != NULL) { + /* we have to be allowed to send broadcast packets! */ + ip_set_option(netbiosns_pcb, SOF_BROADCAST); + udp_bind(netbiosns_pcb, IP_ANY_TYPE, NETBIOS_PORT); + udp_recv(netbiosns_pcb, netbiosns_recv, netbiosns_pcb); + } +} + +#ifndef NETBIOS_LWIP_NAME +/** + * @ingroup netbiosns + * Set netbios name. ATTENTION: the hostname must be less than 15 characters! + */ +void +netbiosns_set_name(const char* hostname) +{ + size_t copy_len = strlen(hostname); + LWIP_ASSERT("NetBIOS name is too long!", copy_len < NETBIOS_NAME_LEN); + if (copy_len >= NETBIOS_NAME_LEN) { + copy_len = NETBIOS_NAME_LEN - 1; + } + MEMCPY(netbiosns_local_name, hostname, copy_len + 1); +} +#endif + +/** + * @ingroup netbiosns + * Stop netbios responder + */ +void +netbiosns_stop(void) +{ + if (netbiosns_pcb != NULL) { + udp_remove(netbiosns_pcb); + netbiosns_pcb = NULL; + } +} + +#endif /* LWIP_IPV4 && LWIP_UDP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.c new file mode 100644 index 0000000..f35b760 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.c @@ -0,0 +1,749 @@ +/** + * @file + * Abstract Syntax Notation One (ISO 8824, 8825) encoding + * + * @todo not optimised (yet), favor correctness over speed, favor speed over size + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "snmp_asn1.h" + +#define PBUF_OP_EXEC(code) \ + if ((code) != ERR_OK) { \ + return ERR_BUF; \ + } + +/** + * Encodes a TLV into a pbuf stream. + * + * @param pbuf_stream points to a pbuf stream + * @param tlv TLV to encode + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + */ +err_t +snmp_ans1_enc_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tlv) +{ + u8_t data; + u8_t length_bytes_required; + + /* write type */ + if ((tlv->type & SNMP_ASN1_DATATYPE_MASK) == SNMP_ASN1_DATATYPE_EXTENDED) { + /* extended format is not used by SNMP so we do not accept those values */ + return ERR_ARG; + } + if (tlv->type_len != 0) { + /* any other value as auto is not accepted for type (we always use one byte because extended syntax is prohibited) */ + return ERR_ARG; + } + + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, tlv->type)); + tlv->type_len = 1; + + /* write length */ + if (tlv->value_len <= 127) { + length_bytes_required = 1; + } else if (tlv->value_len <= 255) { + length_bytes_required = 2; + } else { + length_bytes_required = 3; + } + + /* check for forced min length */ + if (tlv->length_len > 0) { + if (tlv->length_len < length_bytes_required) { + /* unable to code requested length in requested number of bytes */ + return ERR_ARG; + } + + length_bytes_required = tlv->length_len; + } else { + tlv->length_len = length_bytes_required; + } + + if (length_bytes_required > 1) { + /* multi byte representation required */ + length_bytes_required--; + data = 0x80 | length_bytes_required; /* extended length definition, 1 length byte follows */ + + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, data)); + + while (length_bytes_required > 1) { + if (length_bytes_required == 2) { + /* append high byte */ + data = (u8_t)(tlv->value_len >> 8); + } else { + /* append leading 0x00 */ + data = 0x00; + } + + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, data)); + length_bytes_required--; + } + } + + /* append low byte */ + data = (u8_t)(tlv->value_len & 0xFF); + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, data)); + + return ERR_OK; +} + +/** + * Encodes raw data (octet string, opaque) into a pbuf chained ASN1 msg. + * + * @param pbuf_stream points to a pbuf stream + * @param raw_len raw data length + * @param raw points raw data + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + */ +err_t +snmp_asn1_enc_raw(struct snmp_pbuf_stream* pbuf_stream, const u8_t *raw, u16_t raw_len) +{ + PBUF_OP_EXEC(snmp_pbuf_stream_writebuf(pbuf_stream, raw, raw_len)); + + return ERR_OK; +} + +/** + * Encodes u32_t (counter, gauge, timeticks) into a pbuf chained ASN1 msg. + * + * @param pbuf_stream points to a pbuf stream + * @param octets_needed encoding length (from snmp_asn1_enc_u32t_cnt()) + * @param value is the host order u32_t value to be encoded + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + * + * @see snmp_asn1_enc_u32t_cnt() + */ +err_t +snmp_asn1_enc_u32t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, u32_t value) +{ + if (octets_needed > 5) { + return ERR_ARG; + } + if (octets_needed == 5) { + /* not enough bits in 'value' add leading 0x00 */ + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, 0x00)); + octets_needed--; + } + + while (octets_needed > 1) { + octets_needed--; + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(value >> (octets_needed << 3)))); + } + + /* (only) one least significant octet */ + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)value)); + + return ERR_OK; +} + +/** + * Encodes u64_t (counter64) into a pbuf chained ASN1 msg. + * + * @param pbuf_stream points to a pbuf stream + * @param octets_needed encoding length (from snmp_asn1_enc_u32t_cnt()) + * @param value is the host order u32_t value to be encoded + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + * + * @see snmp_asn1_enc_u64t_cnt() + */ +err_t +snmp_asn1_enc_u64t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, const u32_t* value) +{ + if (octets_needed > 9) { + return ERR_ARG; + } + if (octets_needed == 9) { + /* not enough bits in 'value' add leading 0x00 */ + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, 0x00)); + octets_needed--; + } + + while (octets_needed > 4) { + octets_needed--; + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> ((octets_needed-4) << 3)))); + } + + /* skip to low u32 */ + value++; + + while (octets_needed > 1) { + octets_needed--; + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> (octets_needed << 3)))); + } + + /* always write at least one octet (also in case of value == 0) */ + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value))); + + return ERR_OK; +} + +/** + * Encodes s32_t integer into a pbuf chained ASN1 msg. + * + * @param pbuf_stream points to a pbuf stream + * @param octets_needed encoding length (from snmp_asn1_enc_s32t_cnt()) + * @param value is the host order s32_t value to be encoded + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + * + * @see snmp_asn1_enc_s32t_cnt() + */ +err_t +snmp_asn1_enc_s32t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, s32_t value) +{ + while (octets_needed > 1) { + octets_needed--; + + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(value >> (octets_needed << 3)))); + } + + /* (only) one least significant octet */ + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)value)); + + return ERR_OK; +} + +/** + * Encodes object identifier into a pbuf chained ASN1 msg. + * + * @param pbuf_stream points to a pbuf stream + * @param oid points to object identifier array + * @param oid_len object identifier array length + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode + */ +err_t +snmp_asn1_enc_oid(struct snmp_pbuf_stream* pbuf_stream, const u32_t *oid, u16_t oid_len) +{ + if (oid_len > 1) { + /* write compressed first two sub id's */ + u32_t compressed_byte = ((oid[0] * 40) + oid[1]); + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)compressed_byte)); + oid_len -= 2; + oid += 2; + } else { + /* @bug: allow empty varbinds for symmetry (we must decode them for getnext), allow partial compression?? */ + /* ident_len <= 1, at least we need zeroDotZero (0.0) (ident_len == 2) */ + return ERR_ARG; + } + + while (oid_len > 0) { + u32_t sub_id; + u8_t shift, tail; + + oid_len--; + sub_id = *oid; + tail = 0; + shift = 28; + while (shift > 0) { + u8_t code; + + code = (u8_t)(sub_id >> shift); + if ((code != 0) || (tail != 0)) { + tail = 1; + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, code | 0x80)); + } + shift -= 7; + } + PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)sub_id & 0x7F)); + + /* proceed to next sub-identifier */ + oid++; + } + return ERR_OK; +} + +/** + * Returns octet count for length. + * + * @param length parameter length + * @param octets_needed points to the return value + */ +void +snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed) +{ + if (length < 0x80U) { + *octets_needed = 1; + } else if (length < 0x100U) { + *octets_needed = 2; + } else { + *octets_needed = 3; + } +} + +/** + * Returns octet count for an u32_t. + * + * @param value value to be encoded + * @param octets_needed points to the return value + * + * @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded + * as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value + * of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! + */ +void +snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed) +{ + if (value < 0x80UL) { + *octets_needed = 1; + } else if (value < 0x8000UL) { + *octets_needed = 2; + } else if (value < 0x800000UL) { + *octets_needed = 3; + } else if (value < 0x80000000UL) { + *octets_needed = 4; + } else { + *octets_needed = 5; + } +} + +/** + * Returns octet count for an u64_t. + * + * @param value value to be encoded + * @param octets_needed points to the return value + * + * @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded + * as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value + * of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! + */ +void +snmp_asn1_enc_u64t_cnt(const u32_t *value, u16_t *octets_needed) +{ + /* check if high u32 is 0 */ + if (*value == 0x00) { + /* only low u32 is important */ + value++; + snmp_asn1_enc_u32t_cnt(*value, octets_needed); + } else { + /* low u32 does not matter for length determination */ + snmp_asn1_enc_u32t_cnt(*value, octets_needed); + *octets_needed = *octets_needed + 4; /* add the 4 bytes of low u32 */ + } +} + +/** + * Returns octet count for an s32_t. + * + * @param value value to be encoded + * @param octets_needed points to the return value + * + * @note ASN coded integers are _always_ signed. + */ +void +snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed) +{ + if (value < 0) { + value = ~value; + } + if (value < 0x80L) { + *octets_needed = 1; + } else if (value < 0x8000L) { + *octets_needed = 2; + } else if (value < 0x800000L) { + *octets_needed = 3; + } else { + *octets_needed = 4; + } +} + +/** + * Returns octet count for an object identifier. + * + * @param oid points to object identifier array + * @param oid_len object identifier array length + * @param octets_needed points to the return value + */ +void +snmp_asn1_enc_oid_cnt(const u32_t *oid, u16_t oid_len, u16_t *octets_needed) +{ + u32_t sub_id; + + *octets_needed = 0; + if (oid_len > 1) { + /* compressed prefix in one octet */ + (*octets_needed)++; + oid_len -= 2; + oid += 2; + } + while (oid_len > 0) { + oid_len--; + sub_id = *oid; + + sub_id >>= 7; + (*octets_needed)++; + while (sub_id > 0) { + sub_id >>= 7; + (*octets_needed)++; + } + oid++; + } +} + +/** + * Decodes a TLV from a pbuf stream. + * + * @param pbuf_stream points to a pbuf stream + * @param tlv returns decoded TLV + * @return ERR_OK if successful, ERR_VAL if we can't decode + */ +err_t +snmp_asn1_dec_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tlv) +{ + u8_t data; + + /* decode type first */ + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + tlv->type = data; + + if ((tlv->type & SNMP_ASN1_DATATYPE_MASK) == SNMP_ASN1_DATATYPE_EXTENDED) { + /* extended format is not used by SNMP so we do not accept those values */ + return ERR_VAL; + } + tlv->type_len = 1; + + /* now, decode length */ + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + + if (data < 0x80) { /* short form */ + tlv->length_len = 1; + tlv->value_len = data; + } else if (data > 0x80) { /* long form */ + u8_t length_bytes = data - 0x80; + tlv->length_len = length_bytes + 1; /* this byte + defined number of length bytes following */ + tlv->value_len = 0; + + while (length_bytes > 0) { + /* we only support up to u16.maxvalue-1 (2 bytes) but have to accept leading zero bytes */ + if (tlv->value_len > 0xFF) { + return ERR_VAL; + } + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + tlv->value_len <<= 8; + tlv->value_len |= data; + + /* take care for special value used for indefinite length */ + if (tlv->value_len == 0xFFFF) { + return ERR_VAL; + } + + length_bytes--; + } + } else { /* data == 0x80 indefinite length form */ + /* (not allowed for SNMP; RFC 1157, 3.2.2) */ + return ERR_VAL; + } + + return ERR_OK; +} + +/** + * Decodes positive integer (counter, gauge, timeticks) into u32_t. + * + * @param pbuf_stream points to a pbuf stream + * @param len length of the coded integer field + * @param value return host order integer + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) decode + * + * @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded + * as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value + * of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! + */ +err_t +snmp_asn1_dec_u32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value) +{ + u8_t data; + + if ((len > 0) && (len <= 5)) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + + /* expecting sign bit to be zero, only unsigned please! */ + if (((len == 5) && (data == 0x00)) || ((len < 5) && ((data & 0x80) == 0))) { + *value = data; + len--; + + while (len > 0) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + + *value <<= 8; + *value |= data; + } + + return ERR_OK; + } + } + + return ERR_VAL; +} + +/** + * Decodes large positive integer (counter64) into 2x u32_t. + * + * @param pbuf_stream points to a pbuf stream + * @param len length of the coded integer field + * @param value return host order integer + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) decode + * + * @note ASN coded integers are _always_ signed. E.g. +0xFFFF is coded + * as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value + * of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!! + */ +err_t +snmp_asn1_dec_u64t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value) +{ + u8_t data; + + if (len <= 4) { + /* high u32 is 0 */ + *value = 0; + /* directly skip to low u32 */ + value++; + } + + if ((len > 0) && (len <= 9)) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + + /* expecting sign bit to be zero, only unsigned please! */ + if (((len == 9) && (data == 0x00)) || ((len < 9) && ((data & 0x80) == 0))) { + *value = data; + len--; + + while (len > 0) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + + if (len == 4) { + /* skip to low u32 */ + value++; + *value = 0; + } else { + *value <<= 8; + } + + *value |= data; + len--; + } + + return ERR_OK; + } + } + + return ERR_VAL; +} + +/** + * Decodes integer into s32_t. + * + * @param pbuf_stream points to a pbuf stream + * @param len length of the coded integer field + * @param value return host order integer + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) decode + * + * @note ASN coded integers are _always_ signed! + */ +err_t +snmp_asn1_dec_s32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, s32_t *value) +{ +#if BYTE_ORDER == LITTLE_ENDIAN + u8_t *lsb_ptr = (u8_t*)value; +#endif +#if BYTE_ORDER == BIG_ENDIAN + u8_t *lsb_ptr = (u8_t*)value + sizeof(s32_t) - 1; +#endif + u8_t sign; + u8_t data; + + if ((len > 0) && (len < 5)) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + + if (data & 0x80) { + /* negative, start from -1 */ + *value = -1; + sign = 1; + *lsb_ptr &= data; + } else { + /* positive, start from 0 */ + *value = 0; + sign = 0; + *lsb_ptr |= data; + } + + /* OR/AND octets with value */ + while (len > 0) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + +#if BYTE_ORDER == LITTLE_ENDIAN + *value <<= 8; +#endif +#if BYTE_ORDER == BIG_ENDIAN + *value >>= 8; +#endif + + if (sign) { + *lsb_ptr |= 255; + *lsb_ptr &= data; + } else { + *lsb_ptr |= data; + } + } + + return ERR_OK; + } + + return ERR_VAL; +} + +/** + * Decodes object identifier from incoming message into array of u32_t. + * + * @param pbuf_stream points to a pbuf stream + * @param len length of the coded object identifier + * @param oid return decoded object identifier + * @param oid_len return decoded object identifier length + * @param oid_max_len size of oid buffer + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) decode + */ +err_t +snmp_asn1_dec_oid(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t* oid, u8_t* oid_len, u8_t oid_max_len) +{ + u32_t *oid_ptr; + u8_t data; + + *oid_len = 0; + oid_ptr = oid; + if (len > 0) { + if (oid_max_len < 2) { + return ERR_MEM; + } + + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + + /* first compressed octet */ + if (data == 0x2B) { + /* (most) common case 1.3 (iso.org) */ + *oid_ptr = 1; + oid_ptr++; + *oid_ptr = 3; + oid_ptr++; + } else if (data < 40) { + *oid_ptr = 0; + oid_ptr++; + *oid_ptr = data; + oid_ptr++; + } else if (data < 80) { + *oid_ptr = 1; + oid_ptr++; + *oid_ptr = data - 40; + oid_ptr++; + } else { + *oid_ptr = 2; + oid_ptr++; + *oid_ptr = data - 80; + oid_ptr++; + } + *oid_len = 2; + } else { + /* accepting zero length identifiers e.g. for getnext operation. uncommon but valid */ + return ERR_OK; + } + + while ((len > 0) && (*oid_len < oid_max_len)) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + + if ((data & 0x80) == 0x00) { + /* sub-identifier uses single octet */ + *oid_ptr = data; + } else { + /* sub-identifier uses multiple octets */ + u32_t sub_id = (data & ~0x80); + while ((len > 0) && ((data & 0x80) != 0)) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data)); + len--; + + sub_id = (sub_id << 7) + (data & ~0x80); + } + + if ((data & 0x80) != 0) { + /* "more bytes following" bit still set at end of len */ + return ERR_VAL; + } + *oid_ptr = sub_id; + } + oid_ptr++; + (*oid_len)++; + } + + if (len > 0) { + /* OID to long to fit in our buffer */ + return ERR_MEM; + } + + return ERR_OK; +} + +/** + * Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) + * from incoming message into array. + * + * @param pbuf_stream points to a pbuf stream + * @param len length of the coded raw data (zero is valid, e.g. empty string!) + * @param buf return raw bytes + * @param buf_len returns length of the raw return value + * @param buf_max_len buffer size + * @return ERR_OK if successful, ERR_ARG if we can't (or won't) decode + */ +err_t +snmp_asn1_dec_raw(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u8_t *buf, u16_t* buf_len, u16_t buf_max_len) +{ + if (len > buf_max_len) { + /* not enough dst space */ + return ERR_MEM; + } + *buf_len = len; + + while (len > 0) { + PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, buf)); + buf++; + len--; + } + + return ERR_OK; +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.h new file mode 100644 index 0000000..ec50d8c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_asn1.h @@ -0,0 +1,108 @@ +/** + * @file + * Abstract Syntax Notation One (ISO 8824, 8825) codec. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel + * Elias Oenal + */ + +#ifndef LWIP_HDR_APPS_SNMP_ASN1_H +#define LWIP_HDR_APPS_SNMP_ASN1_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP + +#include "lwip/err.h" +#include "lwip/apps/snmp_core.h" +#include "snmp_pbuf_stream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define SNMP_ASN1_TLV_INDEFINITE_LENGTH 0x80 + +#define SNMP_ASN1_CLASS_MASK 0xC0 +#define SNMP_ASN1_CONTENTTYPE_MASK 0x20 +#define SNMP_ASN1_DATATYPE_MASK 0x1F +#define SNMP_ASN1_DATATYPE_EXTENDED 0x1F /* DataType indicating that datatype is encoded in following bytes */ + +/* context specific (SNMP) tags (from SNMP spec. RFC1157) */ +#define SNMP_ASN1_CONTEXT_PDU_GET_REQ 0 +#define SNMP_ASN1_CONTEXT_PDU_GET_NEXT_REQ 1 +#define SNMP_ASN1_CONTEXT_PDU_GET_RESP 2 +#define SNMP_ASN1_CONTEXT_PDU_SET_REQ 3 +#define SNMP_ASN1_CONTEXT_PDU_TRAP 4 +#define SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ 5 + +#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_OBJECT 0 +#define SNMP_ASN1_CONTEXT_VARBIND_END_OF_MIB_VIEW 2 + +struct snmp_asn1_tlv +{ + u8_t type; /* only U8 because extended types are not specified by SNMP */ + u8_t type_len; /* encoded length of 'type' field (normally 1) */ + u8_t length_len; /* indicates how many bytes are required to encode the 'value_len' field */ + u16_t value_len; /* encoded length of the value */ +}; +#define SNMP_ASN1_TLV_HDR_LENGTH(tlv) ((tlv).type_len + (tlv).length_len) +#define SNMP_ASN1_TLV_LENGTH(tlv) ((tlv).type_len + (tlv).length_len + (tlv).value_len) +#define SNMP_ASN1_SET_TLV_PARAMS(tlv, type_, length_len_, value_len_) do { (tlv).type = (type_); (tlv).type_len = 0; (tlv).length_len = (length_len_); (tlv).value_len = (value_len_); } while (0); + +err_t snmp_asn1_dec_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tlv); +err_t snmp_asn1_dec_u32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value); +err_t snmp_asn1_dec_u64t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value); +err_t snmp_asn1_dec_s32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, s32_t *value); +err_t snmp_asn1_dec_oid(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t* oid, u8_t* oid_len, u8_t oid_max_len); +err_t snmp_asn1_dec_raw(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u8_t *buf, u16_t* buf_len, u16_t buf_max_len); + +err_t snmp_ans1_enc_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tlv); + +void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed); +void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed); +void snmp_asn1_enc_u64t_cnt(const u32_t *value, u16_t *octets_needed); +void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed); +void snmp_asn1_enc_oid_cnt(const u32_t *oid, u16_t oid_len, u16_t *octets_needed); +err_t snmp_asn1_enc_oid(struct snmp_pbuf_stream* pbuf_stream, const u32_t *oid, u16_t oid_len); +err_t snmp_asn1_enc_s32t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, s32_t value); +err_t snmp_asn1_enc_u32t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, u32_t value); +err_t snmp_asn1_enc_u64t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, const u32_t* value); +err_t snmp_asn1_enc_raw(struct snmp_pbuf_stream* pbuf_stream, const u8_t *raw, u16_t raw_len); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SNMP */ + +#endif /* LWIP_HDR_APPS_SNMP_ASN1_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core.c new file mode 100644 index 0000000..c041833 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core.c @@ -0,0 +1,1349 @@ +/** + * @file + * MIB tree access/construction functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel +*/ + +/** + * @defgroup snmp SNMPv2c agent + * @ingroup apps + * SNMPv2c compatible agent\n + * There is also a MIB compiler and a MIB viewer in lwIP contrib repository + * (lwip-contrib/apps/LwipMibCompiler).\n + * The agent implements the most important MIB2 MIBs including IPv6 support + * (interfaces, UDP, TCP, SNMP, ICMP, SYSTEM). IP MIB is an older version + * whithout IPv6 statistics (TODO).\n + * Rewritten by Martin Hentschel and + * Dirk Ziegelmeier \n + * Work on SNMPv3 has started, but is not finished.\n + * + * 0 Agent Capabilities + * ==================== + * + * Features: + * --------- + * - SNMPv2c support. + * - Low RAM usage - no memory pools, stack only. + * - MIB2 implementation is separated from SNMP stack. + * - Support for multiple MIBs (snmp_set_mibs() call) - e.g. for private MIB. + * - Simple and generic API for MIB implementation. + * - Comfortable node types and helper functions for scalar arrays and tables. + * - Counter64, bit and truthvalue datatype support. + * - Callbacks for SNMP writes e.g. to implement persistency. + * - Runs on two APIs: RAW and netconn. + * - Async API is gone - the stack now supports netconn API instead, + * so blocking operations can be done in MIB calls. + * SNMP runs in a worker thread when netconn API is used. + * - Simplified thread sync support for MIBs - useful when MIBs + * need to access variables shared with other threads where no locking is + * possible. Used in MIB2 to access lwIP stats from lwIP thread. + * + * MIB compiler (code generator): + * ------------------------------ + * - Provided in lwIP contrib repository. + * - Written in C#. MIB viewer used Windows Forms. + * - Developed on Windows with Visual Studio 2010. + * - Can be compiled and used on all platforms with http://www.monodevelop.com/. + * - Based on a heavily modified version of of SharpSnmpLib (a4bd05c6afb4) + * (https://sharpsnmplib.codeplex.com/SourceControl/network/forks/Nemo157/MIBParserUpdate). + * - MIB parser, C file generation framework and LWIP code generation are cleanly + * separated, which means the code may be useful as a base for code generation + * of other SNMP agents. + * + * Notes: + * ------ + * - Stack and MIB compiler were used to implement a Profinet device. + * Compiled/implemented MIBs: LLDP-MIB, LLDP-EXT-DOT3-MIB, LLDP-EXT-PNO-MIB. + * + * SNMPv1 per RFC1157 and SNMPv2c per RFC 3416 + * ------------------------------------------- + * Note the S in SNMP stands for "Simple". Note that "Simple" is + * relative. SNMP is simple compared to the complex ISO network + * management protocols CMIP (Common Management Information Protocol) + * and CMOT (CMip Over Tcp). + * + * MIB II + * ------ + * The standard lwIP stack management information base. + * This is a required MIB, so this is always enabled. + * The groups EGP, CMOT and transmission are disabled by default. + * + * Most mib-2 objects are not writable except: + * sysName, sysLocation, sysContact, snmpEnableAuthenTraps. + * Writing to or changing the ARP and IP address and route + * tables is not possible. + * + * Note lwIP has a very limited notion of IP routing. It currently + * doen't have a route table and doesn't have a notion of the U,G,H flags. + * Instead lwIP uses the interface list with only one default interface + * acting as a single gateway interface (G) for the default route. + * + * The agent returns a "virtual table" with the default route 0.0.0.0 + * for the default interface and network routes (no H) for each + * network interface in the netif_list. + * All routes are considered to be up (U). + * + * Loading additional MIBs + * ----------------------- + * MIBs can only be added in compile-time, not in run-time. + * + * + * 1 Building the Agent + * ==================== + * First of all you'll need to add the following define + * to your local lwipopts.h: + * \#define LWIP_SNMP 1 + * + * and add the source files your makefile. + * + * Note you'll might need to adapt you network driver to update + * the mib2 variables for your interface. + * + * 2 Running the Agent + * =================== + * The following function calls must be made in your program to + * actually get the SNMP agent running. + * + * Before starting the agent you should supply pointers + * for sysContact, sysLocation, and snmpEnableAuthenTraps. + * You can do this by calling + * + * - snmp_mib2_set_syscontact() + * - snmp_mib2_set_syslocation() + * - snmp_set_auth_traps_enabled() + * + * You can register a callback which is called on successful write access: + * snmp_set_write_callback(). + * + * Additionally you may want to set + * + * - snmp_mib2_set_sysdescr() + * - snmp_set_device_enterprise_oid() + * - snmp_mib2_set_sysname() + * + * Also before starting the agent you need to setup + * one or more trap destinations using these calls: + * + * - snmp_trap_dst_enable() + * - snmp_trap_dst_ip_set() + * + * If you need more than MIB2, set the MIBs you want to use + * by snmp_set_mibs(). + * + * Finally, enable the agent by calling snmp_init() + * + * @defgroup snmp_core Core + * @ingroup snmp + * + * @defgroup snmp_traps Traps + * @ingroup snmp + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "snmp_core_priv.h" +#include "lwip/netif.h" +#include + + +#if (LWIP_SNMP && (SNMP_TRAP_DESTINATIONS<=0)) + #error "If you want to use SNMP, you have to define SNMP_TRAP_DESTINATIONS>=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP && LWIP_SNMP) + #error "If you want to use SNMP, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif + +struct snmp_statistics snmp_stats; +static const struct snmp_obj_id snmp_device_enterprise_oid_default = {SNMP_DEVICE_ENTERPRISE_OID_LEN, SNMP_DEVICE_ENTERPRISE_OID}; +static const struct snmp_obj_id* snmp_device_enterprise_oid = &snmp_device_enterprise_oid_default; + +const u32_t snmp_zero_dot_zero_values[] = { 0, 0 }; +const struct snmp_obj_id_const_ref snmp_zero_dot_zero = { LWIP_ARRAYSIZE(snmp_zero_dot_zero_values), snmp_zero_dot_zero_values }; + + +#if SNMP_LWIP_MIB2 +#include "lwip/apps/snmp_mib2.h" +static const struct snmp_mib* const default_mibs[] = { &mib2 }; +static u8_t snmp_num_mibs = 1; +#else +static const struct snmp_mib* const default_mibs[] = { NULL }; +static u8_t snmp_num_mibs = 0; +#endif + +/* List of known mibs */ +static struct snmp_mib const * const *snmp_mibs = default_mibs; + +/** + * @ingroup snmp_core + * Sets the MIBs to use. + * Example: call snmp_set_mibs() as follows: + * static const struct snmp_mib *my_snmp_mibs[] = { + * &mib2, + * &private_mib + * }; + * snmp_set_mibs(my_snmp_mibs, LWIP_ARRAYSIZE(my_snmp_mibs)); + */ +void +snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs) +{ + LWIP_ASSERT("mibs pointer must be != NULL", (mibs != NULL)); + LWIP_ASSERT("num_mibs pointer must be != 0", (num_mibs != 0)); + snmp_mibs = mibs; + snmp_num_mibs = num_mibs; +} + +/** + * @ingroup snmp_core + * 'device enterprise oid' is used for 'device OID' field in trap PDU's (for identification of generating device) + * as well as for value returned by MIB-2 'sysObjectID' field (if internal MIB2 implementation is used). + * The 'device enterprise oid' shall point to an OID located under 'private-enterprises' branch (1.3.6.1.4.1.XXX). If a vendor + * wants to provide a custom object there, he has to get its own enterprise oid from IANA (http://www.iana.org). It + * is not allowed to use LWIP enterprise ID! + * In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own + * enterprise oid. + * e.g. + * device a > 1.3.6.1.4.1.XXX(ent-oid).1(devices).1(device a) + * device b > 1.3.6.1.4.1.XXX(ent-oid).1(devices).2(device b) + * for more details see description of 'sysObjectID' field in RFC1213-MIB + */ +void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid) +{ + if (device_enterprise_oid == NULL) { + snmp_device_enterprise_oid = &snmp_device_enterprise_oid_default; + } else { + snmp_device_enterprise_oid = device_enterprise_oid; + } +} + +/** + * @ingroup snmp_core + * Get 'device enterprise oid' + */ +const struct snmp_obj_id* snmp_get_device_enterprise_oid(void) +{ + return snmp_device_enterprise_oid; +} + +#if LWIP_IPV4 +/** + * Conversion from InetAddressIPv4 oid to lwIP ip4_addr + * @param oid points to u32_t ident[4] input + * @param ip points to output struct + */ +u8_t +snmp_oid_to_ip4(const u32_t *oid, ip4_addr_t *ip) +{ + if ((oid[0] > 0xFF) || + (oid[1] > 0xFF) || + (oid[2] > 0xFF) || + (oid[3] > 0xFF)) { + ip4_addr_copy(*ip, *IP4_ADDR_ANY4); + return 0; + } + + IP4_ADDR(ip, oid[0], oid[1], oid[2], oid[3]); + return 1; +} + +/** + * Convert ip4_addr to InetAddressIPv4 (no InetAddressType) + * @param ip points to input struct + * @param oid points to u32_t ident[4] output + */ +void +snmp_ip4_to_oid(const ip4_addr_t *ip, u32_t *oid) +{ + oid[0] = ip4_addr1(ip); + oid[1] = ip4_addr2(ip); + oid[2] = ip4_addr3(ip); + oid[3] = ip4_addr4(ip); +} +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +/** + * Conversion from InetAddressIPv6 oid to lwIP ip6_addr + * @param oid points to u32_t oid[16] input + * @param ip points to output struct + */ +u8_t +snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip) +{ + if ((oid[0] > 0xFF) || + (oid[1] > 0xFF) || + (oid[2] > 0xFF) || + (oid[3] > 0xFF) || + (oid[4] > 0xFF) || + (oid[5] > 0xFF) || + (oid[6] > 0xFF) || + (oid[7] > 0xFF) || + (oid[8] > 0xFF) || + (oid[9] > 0xFF) || + (oid[10] > 0xFF) || + (oid[11] > 0xFF) || + (oid[12] > 0xFF) || + (oid[13] > 0xFF) || + (oid[14] > 0xFF) || + (oid[15] > 0xFF)) { + ip6_addr_set_any(ip); + return 0; + } + + ip->addr[0] = (oid[0] << 24) | (oid[1] << 16) | (oid[2] << 8) | (oid[3] << 0); + ip->addr[1] = (oid[4] << 24) | (oid[5] << 16) | (oid[6] << 8) | (oid[7] << 0); + ip->addr[2] = (oid[8] << 24) | (oid[9] << 16) | (oid[10] << 8) | (oid[11] << 0); + ip->addr[3] = (oid[12] << 24) | (oid[13] << 16) | (oid[14] << 8) | (oid[15] << 0); + return 1; +} + +/** + * Convert ip6_addr to InetAddressIPv6 (no InetAddressType) + * @param ip points to input struct + * @param oid points to u32_t ident[16] output + */ +void +snmp_ip6_to_oid(const ip6_addr_t *ip, u32_t *oid) +{ + oid[0] = (ip->addr[0] & 0xFF000000) >> 24; + oid[1] = (ip->addr[0] & 0x00FF0000) >> 16; + oid[2] = (ip->addr[0] & 0x0000FF00) >> 8; + oid[3] = (ip->addr[0] & 0x000000FF) >> 0; + oid[4] = (ip->addr[1] & 0xFF000000) >> 24; + oid[5] = (ip->addr[1] & 0x00FF0000) >> 16; + oid[6] = (ip->addr[1] & 0x0000FF00) >> 8; + oid[7] = (ip->addr[1] & 0x000000FF) >> 0; + oid[8] = (ip->addr[2] & 0xFF000000) >> 24; + oid[9] = (ip->addr[2] & 0x00FF0000) >> 16; + oid[10] = (ip->addr[2] & 0x0000FF00) >> 8; + oid[11] = (ip->addr[2] & 0x000000FF) >> 0; + oid[12] = (ip->addr[3] & 0xFF000000) >> 24; + oid[13] = (ip->addr[3] & 0x00FF0000) >> 16; + oid[14] = (ip->addr[3] & 0x0000FF00) >> 8; + oid[15] = (ip->addr[3] & 0x000000FF) >> 0; +} +#endif /* LWIP_IPV6 */ + +#if LWIP_IPV4 || LWIP_IPV6 +/** + * Convert to InetAddressType+InetAddress+InetPortNumber + * @param ip IP address + * @param port Port + * @param oid OID + * @return OID length + */ +u8_t +snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid) +{ + u8_t idx; + + idx = snmp_ip_to_oid(ip, oid); + oid[idx] = port; + idx++; + + return idx; +} + +/** + * Convert to InetAddressType+InetAddress + * @param ip IP address + * @param oid OID + * @return OID length + */ +u8_t +snmp_ip_to_oid(const ip_addr_t *ip, u32_t *oid) +{ + if (IP_IS_ANY_TYPE_VAL(*ip)) { + oid[0] = 0; /* any */ + oid[1] = 0; /* no IP OIDs follow */ + return 2; + } else if (IP_IS_V6(ip)) { +#if LWIP_IPV6 + oid[0] = 2; /* ipv6 */ + oid[1] = 16; /* 16 InetAddressIPv6 OIDs follow */ + snmp_ip6_to_oid(ip_2_ip6(ip), &oid[2]); + return 18; +#else /* LWIP_IPV6 */ + return 0; +#endif /* LWIP_IPV6 */ + } else { +#if LWIP_IPV4 + oid[0] = 1; /* ipv4 */ + oid[1] = 4; /* 4 InetAddressIPv4 OIDs follow */ + snmp_ip4_to_oid(ip_2_ip4(ip), &oid[2]); + return 6; +#else /* LWIP_IPV4 */ + return 0; +#endif /* LWIP_IPV4 */ + } +} + +/** + * Convert from InetAddressType+InetAddress to ip_addr_t + * @param oid OID + * @param oid_len OID length + * @param ip IP address + * @return Parsed OID length + */ +u8_t +snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip) +{ + /* InetAddressType */ + if (oid_len < 1) { + return 0; + } + + if (oid[0] == 0) { /* any */ + /* 1x InetAddressType, 1x OID len */ + if (oid_len < 2) { + return 0; + } + if (oid[1] != 0) { + return 0; + } + + memset(ip, 0, sizeof(*ip)); + IP_SET_TYPE(ip, IPADDR_TYPE_ANY); + + return 2; + } else if (oid[0] == 1) { /* ipv4 */ +#if LWIP_IPV4 + /* 1x InetAddressType, 1x OID len, 4x InetAddressIPv4 */ + if (oid_len < 6) { + return 0; + } + + /* 4x ipv4 OID */ + if (oid[1] != 4) { + return 0; + } + + IP_SET_TYPE(ip, IPADDR_TYPE_V4); + if (!snmp_oid_to_ip4(&oid[2], ip_2_ip4(ip))) { + return 0; + } + + return 6; +#else /* LWIP_IPV4 */ + return 0; +#endif /* LWIP_IPV4 */ + } else if (oid[0] == 2) { /* ipv6 */ +#if LWIP_IPV6 + /* 1x InetAddressType, 1x OID len, 16x InetAddressIPv6 */ + if (oid_len < 18) { + return 0; + } + + /* 16x ipv6 OID */ + if (oid[1] != 16) { + return 0; + } + + IP_SET_TYPE(ip, IPADDR_TYPE_V6); + if (!snmp_oid_to_ip6(&oid[2], ip_2_ip6(ip))) { + return 0; + } + + return 18; +#else /* LWIP_IPV6 */ + return 0; +#endif /* LWIP_IPV6 */ + } else { /* unsupported InetAddressType */ + return 0; + } +} + +/** + * Convert from InetAddressType+InetAddress+InetPortNumber to ip_addr_t and u16_t + * @param oid OID + * @param oid_len OID length + * @param ip IP address + * @param port Port + * @return Parsed OID length + */ +u8_t +snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port) +{ + u8_t idx = 0; + + /* InetAddressType + InetAddress */ + idx += snmp_oid_to_ip(&oid[idx], oid_len-idx, ip); + if (idx == 0) { + return 0; + } + + /* InetPortNumber */ + if (oid_len < (idx+1)) { + return 0; + } + if (oid[idx] > 0xffff) { + return 0; + } + *port = (u16_t)oid[idx]; + idx++; + + return idx; +} + +#endif /* LWIP_IPV4 || LWIP_IPV6 */ + +/** + * Assign an OID to struct snmp_obj_id + * @param target Assignment target + * @param oid OID + * @param oid_len OID length + */ +void +snmp_oid_assign(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len) +{ + LWIP_ASSERT("oid_len <= LWIP_SNMP_OBJ_ID_LEN", oid_len <= SNMP_MAX_OBJ_ID_LEN); + + target->len = oid_len; + + if (oid_len > 0) { + MEMCPY(target->id, oid, oid_len * sizeof(u32_t)); + } +} + +/** + * Prefix an OID to OID in struct snmp_obj_id + * @param target Assignment target to prefix + * @param oid OID + * @param oid_len OID length + */ +void +snmp_oid_prefix(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len) +{ + LWIP_ASSERT("target->len + oid_len <= LWIP_SNMP_OBJ_ID_LEN", (target->len + oid_len) <= SNMP_MAX_OBJ_ID_LEN); + + if (oid_len > 0) { + /* move existing OID to make room at the beginning for OID to insert */ + int i; + for (i = target->len-1; i>=0; i--) { + target->id[i + oid_len] = target->id[i]; + } + + /* paste oid at the beginning */ + MEMCPY(target->id, oid, oid_len * sizeof(u32_t)); + } +} + +/** + * Combine two OIDs into struct snmp_obj_id + * @param target Assignmet target + * @param oid1 OID 1 + * @param oid1_len OID 1 length + * @param oid2 OID 2 + * @param oid2_len OID 2 length + */ +void +snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) +{ + snmp_oid_assign(target, oid1, oid1_len); + snmp_oid_append(target, oid2, oid2_len); +} + +/** + * Append OIDs to struct snmp_obj_id + * @param target Assignment target to append to + * @param oid OID + * @param oid_len OID length + */ +void +snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len) +{ + LWIP_ASSERT("offset + oid_len <= LWIP_SNMP_OBJ_ID_LEN", (target->len + oid_len) <= SNMP_MAX_OBJ_ID_LEN); + + if (oid_len > 0) { + MEMCPY(&target->id[target->len], oid, oid_len * sizeof(u32_t)); + target->len += oid_len; + } +} + +/** + * Compare two OIDs + * @param oid1 OID 1 + * @param oid1_len OID 1 length + * @param oid2 OID 2 + * @param oid2_len OID 2 length + * @return -1: OID1<OID2 1: OID1 >OID2 0: equal + */ +s8_t +snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) +{ + u8_t level = 0; + LWIP_ASSERT("'oid1' param must not be NULL or 'oid1_len' param be 0!", (oid1 != NULL) || (oid1_len == 0)); + LWIP_ASSERT("'oid2' param must not be NULL or 'oid2_len' param be 0!", (oid2 != NULL) || (oid2_len == 0)); + + while ((level < oid1_len) && (level < oid2_len)) { + if (*oid1 < *oid2) { + return -1; + } + if (*oid1 > *oid2) { + return 1; + } + + level++; + oid1++; + oid2++; + } + + /* common part of both OID's is equal, compare length */ + if (oid1_len < oid2_len) { + return -1; + } + if (oid1_len > oid2_len) { + return 1; + } + + /* they are equal */ + return 0; +} + + +/** + * Check of two OIDs are equal + * @param oid1 OID 1 + * @param oid1_len OID 1 length + * @param oid2 OID 2 + * @param oid2_len OID 2 length + * @return 1: equal 0: non-equal + */ +u8_t +snmp_oid_equal(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) +{ + return (snmp_oid_compare(oid1, oid1_len, oid2, oid2_len) == 0)? 1 : 0; +} + +/** + * Convert netif to interface index + * @param netif netif + * @return index + */ +u8_t +netif_to_num(const struct netif *netif) +{ + u8_t result = 0; + struct netif *netif_iterator = netif_list; + + while (netif_iterator != NULL) { + result++; + + if (netif_iterator == netif) { + return result; + } + + netif_iterator = netif_iterator->next; + } + + LWIP_ASSERT("netif not found in netif_list", 0); + return 0; +} + +static const struct snmp_mib* +snmp_get_mib_from_oid(const u32_t *oid, u8_t oid_len) +{ + const u32_t* list_oid; + const u32_t* searched_oid; + u8_t i, l; + + u8_t max_match_len = 0; + const struct snmp_mib* matched_mib = NULL; + + LWIP_ASSERT("'oid' param must not be NULL!", (oid != NULL)); + + if (oid_len == 0) { + return NULL; + } + + for (i = 0; i < snmp_num_mibs; i++) { + LWIP_ASSERT("MIB array not initialized correctly", (snmp_mibs[i] != NULL)); + LWIP_ASSERT("MIB array not initialized correctly - base OID is NULL", (snmp_mibs[i]->base_oid != NULL)); + + if (oid_len >= snmp_mibs[i]->base_oid_len) { + l = snmp_mibs[i]->base_oid_len; + list_oid = snmp_mibs[i]->base_oid; + searched_oid = oid; + + while (l > 0) { + if (*list_oid != *searched_oid) { + break; + } + + l--; + list_oid++; + searched_oid++; + } + + if ((l == 0) && (snmp_mibs[i]->base_oid_len > max_match_len)) { + max_match_len = snmp_mibs[i]->base_oid_len; + matched_mib = snmp_mibs[i]; + } + } + } + + return matched_mib; +} + +static const struct snmp_mib* +snmp_get_next_mib(const u32_t *oid, u8_t oid_len) +{ + u8_t i; + const struct snmp_mib* next_mib = NULL; + + LWIP_ASSERT("'oid' param must not be NULL!", (oid != NULL)); + + if (oid_len == 0) { + return NULL; + } + + for (i = 0; i < snmp_num_mibs; i++) { + if (snmp_mibs[i]->base_oid != NULL) { + /* check if mib is located behind starting point */ + if (snmp_oid_compare(snmp_mibs[i]->base_oid, snmp_mibs[i]->base_oid_len, oid, oid_len) > 0) { + if ((next_mib == NULL) || + (snmp_oid_compare(snmp_mibs[i]->base_oid, snmp_mibs[i]->base_oid_len, + next_mib->base_oid, next_mib->base_oid_len) < 0)) { + next_mib = snmp_mibs[i]; + } + } + } + } + + return next_mib; +} + +static const struct snmp_mib* +snmp_get_mib_between(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) +{ + const struct snmp_mib* next_mib = snmp_get_next_mib(oid1, oid1_len); + + LWIP_ASSERT("'oid2' param must not be NULL!", (oid2 != NULL)); + LWIP_ASSERT("'oid2_len' param must be greater than 0!", (oid2_len > 0)); + + if (next_mib != NULL) { + if (snmp_oid_compare(next_mib->base_oid, next_mib->base_oid_len, oid2, oid2_len) < 0) { + return next_mib; + } + } + + return NULL; +} + +u8_t +snmp_get_node_instance_from_oid(const u32_t *oid, u8_t oid_len, struct snmp_node_instance* node_instance) +{ + u8_t result = SNMP_ERR_NOSUCHOBJECT; + const struct snmp_mib *mib; + const struct snmp_node *mn = NULL; + + mib = snmp_get_mib_from_oid(oid, oid_len); + if (mib != NULL) { + u8_t oid_instance_len; + + mn = snmp_mib_tree_resolve_exact(mib, oid, oid_len, &oid_instance_len); + if ((mn != NULL) && (mn->node_type != SNMP_NODE_TREE)) { + /* get instance */ + const struct snmp_leaf_node* leaf_node = (const struct snmp_leaf_node*)(const void*)mn; + + node_instance->node = mn; + snmp_oid_assign(&node_instance->instance_oid, oid + (oid_len - oid_instance_len), oid_instance_len); + + result = leaf_node->get_instance( + oid, + oid_len - oid_instance_len, + node_instance); + +#ifdef LWIP_DEBUG + if (result == SNMP_ERR_NOERROR) { + if (((node_instance->access & SNMP_NODE_INSTANCE_ACCESS_READ) != 0) && (node_instance->get_value == NULL)) { + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP inconsistent access: node is readable but no get_value function is specified\n")); + } + if (((node_instance->access & SNMP_NODE_INSTANCE_ACCESS_WRITE) != 0) && (node_instance->set_value == NULL)) { + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP inconsistent access: node is writable but no set_value and/or set_test function is specified\n")); + } + } +#endif + } + } + + return result; +} + +u8_t +snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_validate_node_instance_method validate_node_instance_method, void* validate_node_instance_arg, struct snmp_obj_id* node_oid, struct snmp_node_instance* node_instance) +{ + const struct snmp_mib *mib; + const struct snmp_node *mn = NULL; + const u32_t* start_oid = NULL; + u8_t start_oid_len = 0; + + /* resolve target MIB from passed OID */ + mib = snmp_get_mib_from_oid(oid, oid_len); + if (mib == NULL) { + /* passed OID does not reference any known MIB, start at the next closest MIB */ + mib = snmp_get_next_mib(oid, oid_len); + + if (mib != NULL) { + start_oid = mib->base_oid; + start_oid_len = mib->base_oid_len; + } + } else { + start_oid = oid; + start_oid_len = oid_len; + } + + /* resolve target node from MIB, skip to next MIB if no suitable node is found in current MIB */ + while ((mib != NULL) && (mn == NULL)) { + u8_t oid_instance_len; + + /* check if OID directly references a node inside current MIB, in this case we have to ask this node for the next instance */ + mn = snmp_mib_tree_resolve_exact(mib, start_oid, start_oid_len, &oid_instance_len); + if (mn != NULL) { + snmp_oid_assign(node_oid, start_oid, start_oid_len - oid_instance_len); /* set oid to node */ + snmp_oid_assign(&node_instance->instance_oid, start_oid + (start_oid_len - oid_instance_len), oid_instance_len); /* set (relative) instance oid */ + } else { + /* OID does not reference a node, search for the next closest node inside MIB; set instance_oid.len to zero because we want the first instance of this node */ + mn = snmp_mib_tree_resolve_next(mib, start_oid, start_oid_len, node_oid); + node_instance->instance_oid.len = 0; + } + + /* validate the node; if the node has no further instance or the returned instance is invalid, search for the next in MIB and validate again */ + node_instance->node = mn; + while (mn != NULL) { + u8_t result; + + /* clear fields which may have values from previous loops */ + node_instance->asn1_type = 0; + node_instance->access = SNMP_NODE_INSTANCE_NOT_ACCESSIBLE; + node_instance->get_value = NULL; + node_instance->set_test = NULL; + node_instance->set_value = NULL; + node_instance->release_instance = NULL; + node_instance->reference.ptr = NULL; + node_instance->reference_len = 0; + + result = ((const struct snmp_leaf_node*)(const void*)mn)->get_next_instance( + node_oid->id, + node_oid->len, + node_instance); + + if (result == SNMP_ERR_NOERROR) { +#ifdef LWIP_DEBUG + if (((node_instance->access & SNMP_NODE_INSTANCE_ACCESS_READ) != 0) && (node_instance->get_value == NULL)) { + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP inconsistent access: node is readable but no get_value function is specified\n")); + } + if (((node_instance->access & SNMP_NODE_INSTANCE_ACCESS_WRITE) != 0) && (node_instance->set_value == NULL)) { + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP inconsistent access: node is writable but no set_value function is specified\n")); + } +#endif + + /* validate node because the node may be not accessible for example (but let the caller decide what is valid */ + if ((validate_node_instance_method == NULL) || + (validate_node_instance_method(node_instance, validate_node_instance_arg) == SNMP_ERR_NOERROR)) { + /* node_oid "returns" the full result OID (including the instance part) */ + snmp_oid_append(node_oid, node_instance->instance_oid.id, node_instance->instance_oid.len); + break; + } + + if (node_instance->release_instance != NULL) { + node_instance->release_instance(node_instance); + } + /* + the instance itself is not valid, ask for next instance from same node. + we don't have to change any variables because node_instance->instance_oid is used as input (starting point) + as well as output (resulting next OID), so we have to simply call get_next_instance method again + */ + } else { + if (node_instance->release_instance != NULL) { + node_instance->release_instance(node_instance); + } + + /* the node has no further instance, skip to next node */ + mn = snmp_mib_tree_resolve_next(mib, node_oid->id, node_oid->len, &node_instance->instance_oid); /* misuse node_instance->instance_oid as tmp buffer */ + if (mn != NULL) { + /* prepare for next loop */ + snmp_oid_assign(node_oid, node_instance->instance_oid.id, node_instance->instance_oid.len); + node_instance->instance_oid.len = 0; + node_instance->node = mn; + } + } + } + + if (mn != NULL) { + /* + we found a suitable next node, + now we have to check if a inner MIB is located between the searched OID and the resulting OID. + this is possible because MIB's may be located anywhere in the global tree, that means also in + the subtree of another MIB (e.g. if searched OID is .2 and resulting OID is .4, then another + MIB having .3 as root node may exist) + */ + const struct snmp_mib *intermediate_mib; + intermediate_mib = snmp_get_mib_between(start_oid, start_oid_len, node_oid->id, node_oid->len); + + if (intermediate_mib != NULL) { + /* search for first node inside intermediate mib in next loop */ + if (node_instance->release_instance != NULL) { + node_instance->release_instance(node_instance); + } + + mn = NULL; + mib = intermediate_mib; + start_oid = mib->base_oid; + start_oid_len = mib->base_oid_len; + } + /* else { we found out target node } */ + } else { + /* + there is no further (suitable) node inside this MIB, search for the next MIB with following priority + 1. search for inner MIB's (whose root is located inside tree of current MIB) + 2. search for surrouding MIB's (where the current MIB is the inner MIB) and continue there if any + 3. take the next closest MIB (not being related to the current MIB) + */ + const struct snmp_mib *next_mib; + next_mib = snmp_get_next_mib(start_oid, start_oid_len); /* returns MIB's related to point 1 and 3 */ + + /* is the found MIB an inner MIB? (point 1) */ + if ((next_mib != NULL) && (next_mib->base_oid_len > mib->base_oid_len) && + (snmp_oid_compare(next_mib->base_oid, mib->base_oid_len, mib->base_oid, mib->base_oid_len) == 0)) { + /* yes it is -> continue at inner MIB */ + mib = next_mib; + start_oid = mib->base_oid; + start_oid_len = mib->base_oid_len; + } else { + /* check if there is a surrounding mib where to continue (point 2) (only possible if OID length > 1) */ + if (mib->base_oid_len > 1) { + mib = snmp_get_mib_from_oid(mib->base_oid, mib->base_oid_len - 1); + + if (mib == NULL) { + /* no surrounding mib, use next mib encountered above (point 3) */ + mib = next_mib; + + if (mib != NULL) { + start_oid = mib->base_oid; + start_oid_len = mib->base_oid_len; + } + } + /* else { start_oid stays the same because we want to continue from current offset in surrounding mib (point 2) } */ + } + } + } + } + + if (mib == NULL) { + /* loop is only left when mib == null (error) or mib_node != NULL (success) */ + return SNMP_ERR_ENDOFMIBVIEW; + } + + return SNMP_ERR_NOERROR; +} + +/** + * Searches tree for the supplied object identifier. + * + */ +const struct snmp_node * +snmp_mib_tree_resolve_exact(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, u8_t* oid_instance_len) +{ + const struct snmp_node* const* node = &mib->root_node; + u8_t oid_offset = mib->base_oid_len; + + while ((oid_offset < oid_len) && ((*node)->node_type == SNMP_NODE_TREE)) { + /* search for matching sub node */ + u32_t subnode_oid = *(oid + oid_offset); + + u32_t i = (*(const struct snmp_tree_node* const*)node)->subnode_count; + node = (*(const struct snmp_tree_node* const*)node)->subnodes; + while ((i > 0) && ((*node)->oid != subnode_oid)) { + node++; + i--; + } + + if (i == 0) { + /* no matching subnode found */ + return NULL; + } + + oid_offset++; + } + + if ((*node)->node_type != SNMP_NODE_TREE) { + /* we found a leaf node */ + *oid_instance_len = oid_len - oid_offset; + return (*node); + } + + return NULL; +} + +const struct snmp_node* +snmp_mib_tree_resolve_next(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, struct snmp_obj_id* oidret) +{ + u8_t oid_offset = mib->base_oid_len; + const struct snmp_node* const* node; + const struct snmp_tree_node* node_stack[SNMP_MAX_OBJ_ID_LEN]; + s32_t nsi = 0; /* NodeStackIndex */ + u32_t subnode_oid; + + if (mib->root_node->node_type != SNMP_NODE_TREE) { + /* a next operation on a mib with only a leaf node will always return NULL because there is no other node */ + return NULL; + } + + /* first build node stack related to passed oid (as far as possible), then go backwards to determine the next node */ + node_stack[nsi] = (const struct snmp_tree_node*)(const void*)mib->root_node; + while (oid_offset < oid_len) { + /* search for matching sub node */ + u32_t i = node_stack[nsi]->subnode_count; + node = node_stack[nsi]->subnodes; + + subnode_oid = *(oid + oid_offset); + + while ((i > 0) && ((*node)->oid != subnode_oid)) { + node++; + i--; + } + + if ((i == 0) || ((*node)->node_type != SNMP_NODE_TREE)) { + /* no (matching) tree-subnode found */ + break; + } + nsi++; + node_stack[nsi] = (const struct snmp_tree_node*)(const void*)(*node); + + oid_offset++; + } + + + if (oid_offset >= oid_len) { + /* passed oid references a tree node -> return first useable sub node of it */ + subnode_oid = 0; + } else { + subnode_oid = *(oid + oid_offset) + 1; + } + + while (nsi >= 0) { + const struct snmp_node* subnode = NULL; + + /* find next node on current level */ + s32_t i = node_stack[nsi]->subnode_count; + node = node_stack[nsi]->subnodes; + while (i > 0) { + if ((*node)->oid == subnode_oid) { + subnode = *node; + break; + } else if (((*node)->oid > subnode_oid) && ((subnode == NULL) || ((*node)->oid < subnode->oid))) { + subnode = *node; + } + + node++; + i--; + } + + if (subnode == NULL) { + /* no further node found on this level, go one level up and start searching with index of current node*/ + subnode_oid = node_stack[nsi]->node.oid + 1; + nsi--; + } else { + if (subnode->node_type == SNMP_NODE_TREE) { + /* next is a tree node, go into it and start searching */ + nsi++; + node_stack[nsi] = (const struct snmp_tree_node*)(const void*)subnode; + subnode_oid = 0; + } else { + /* we found a leaf node -> fill oidret and return it */ + snmp_oid_assign(oidret, mib->base_oid, mib->base_oid_len); + i = 1; + while (i <= nsi) { + oidret->id[oidret->len] = node_stack[i]->node.oid; + oidret->len++; + i++; + } + + oidret->id[oidret->len] = subnode->oid; + oidret->len++; + + return subnode; + } + } + } + + return NULL; +} + +/** initialize struct next_oid_state using this function before passing it to next_oid_check */ +void +snmp_next_oid_init(struct snmp_next_oid_state *state, + const u32_t *start_oid, u8_t start_oid_len, + u32_t *next_oid_buf, u8_t next_oid_max_len) +{ + state->start_oid = start_oid; + state->start_oid_len = start_oid_len; + state->next_oid = next_oid_buf; + state->next_oid_len = 0; + state->next_oid_max_len = next_oid_max_len; + state->status = SNMP_NEXT_OID_STATUS_NO_MATCH; +} + +/** checks if the passed incomplete OID may be a possible candidate for snmp_next_oid_check(); +this methid is intended if the complete OID is not yet known but it is very expensive to build it up, +so it is possible to test the starting part before building up the complete oid and pass it to snmp_next_oid_check()*/ +u8_t +snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len) +{ + if (state->status != SNMP_NEXT_OID_STATUS_BUF_TO_SMALL) { + u8_t start_oid_len = (oid_len < state->start_oid_len) ? oid_len : state->start_oid_len; + + /* check passed OID is located behind start offset */ + if (snmp_oid_compare(oid, oid_len, state->start_oid, start_oid_len) >= 0) { + /* check if new oid is located closer to start oid than current closest oid */ + if ((state->status == SNMP_NEXT_OID_STATUS_NO_MATCH) || + (snmp_oid_compare(oid, oid_len, state->next_oid, state->next_oid_len) < 0)) { + return 1; + } + } + } + + return 0; +} + +/** checks the passed OID if it is a candidate to be the next one (get_next); returns !=0 if passed oid is currently closest, otherwise 0 */ +u8_t +snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len, void* reference) +{ + /* do not overwrite a fail result */ + if (state->status != SNMP_NEXT_OID_STATUS_BUF_TO_SMALL) { + /* check passed OID is located behind start offset */ + if (snmp_oid_compare(oid, oid_len, state->start_oid, state->start_oid_len) > 0) { + /* check if new oid is located closer to start oid than current closest oid */ + if ((state->status == SNMP_NEXT_OID_STATUS_NO_MATCH) || + (snmp_oid_compare(oid, oid_len, state->next_oid, state->next_oid_len) < 0)) { + if (oid_len <= state->next_oid_max_len) { + MEMCPY(state->next_oid, oid, oid_len * sizeof(u32_t)); + state->next_oid_len = oid_len; + state->status = SNMP_NEXT_OID_STATUS_SUCCESS; + state->reference = reference; + return 1; + } else { + state->status = SNMP_NEXT_OID_STATUS_BUF_TO_SMALL; + } + } + } + } + + return 0; +} + +u8_t +snmp_oid_in_range(const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len) +{ + u8_t i; + + if (oid_len != oid_ranges_len) { + return 0; + } + + for (i = 0; i < oid_ranges_len; i++) { + if ((oid_in[i] < oid_ranges[i].min) || (oid_in[i] > oid_ranges[i].max)) { + return 0; + } + } + + return 1; +} + +snmp_err_t +snmp_set_test_ok(struct snmp_node_instance* instance, u16_t value_len, void* value) +{ + LWIP_UNUSED_ARG(instance); + LWIP_UNUSED_ARG(value_len); + LWIP_UNUSED_ARG(value); + + return SNMP_ERR_NOERROR; +} + +/** + * Decodes BITS pseudotype value from ASN.1 OctetString. + * + * @note Because BITS pseudo type is encoded as OCTET STRING, it cannot directly + * be encoded/decoded by the agent. Instead call this function as required from + * get/test/set methods. + * + * @param buf points to a buffer holding the ASN1 octet string + * @param buf_len length of octet string + * @param bit_value decoded Bit value with Bit0 == LSB + * @return ERR_OK if successful, ERR_ARG if bit value contains more than 32 bit + */ +err_t +snmp_decode_bits(const u8_t *buf, u32_t buf_len, u32_t *bit_value) +{ + u8_t b; + u8_t bits_processed = 0; + *bit_value = 0; + + while (buf_len > 0) { + /* any bit set in this byte? */ + if (*buf != 0x00) { + if (bits_processed >= 32) { + /* accept more than 4 bytes, but only when no bits are set */ + return ERR_VAL; + } + + b = *buf; + do { + if (b & 0x80) { + *bit_value |= (1 << bits_processed); + } + bits_processed++; + b <<= 1; + } + while ((bits_processed & 0x07) != 0); /* &0x07 -> % 8 */ + } else { + bits_processed += 8; + } + + buf_len--; + buf++; + } + + return ERR_OK; +} + +err_t +snmp_decode_truthvalue(const s32_t *asn1_value, u8_t *bool_value) +{ + /* defined by RFC1443: + TruthValue ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "Represents a boolean value." + SYNTAX INTEGER { true(1), false(2) } + */ + + if ((asn1_value == NULL) || (bool_value == NULL)) { + return ERR_ARG; + } + + if (*asn1_value == 1) { + *bool_value = 1; + } else if (*asn1_value == 2) { + *bool_value = 0; + } else { + return ERR_VAL; + } + + return ERR_OK; +} + +/** + * Encodes BITS pseudotype value into ASN.1 OctetString. + * + * @note Because BITS pseudo type is encoded as OCTET STRING, it cannot directly + * be encoded/decoded by the agent. Instead call this function as required from + * get/test/set methods. + * + * @param buf points to a buffer where the resulting ASN1 octet string is stored to + * @param buf_len max length of the bufffer + * @param bit_value Bit value to encode with Bit0 == LSB + * @param bit_count Number of possible bits for the bit value (according to rfc we have to send all bits independant from their truth value) + * @return number of bytes used from buffer to store the resulting OctetString + */ +u8_t +snmp_encode_bits(u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count) +{ + u8_t len = 0; + u8_t min_bytes = (bit_count + 7) >> 3; /* >>3 -> / 8 */ + + while ((buf_len > 0) && (bit_value != 0x00)) { + s8_t i = 7; + *buf = 0x00; + while (i >= 0) { + if (bit_value & 0x01) { + *buf |= 0x01; + } + + if (i > 0) { + *buf <<= 1; + } + + bit_value >>= 1; + i--; + } + + buf++; + buf_len--; + len++; + } + + if (len < min_bytes) { + buf += len; + buf_len -= len; + + while ((len < min_bytes) && (buf_len > 0)) { + *buf = 0x00; + buf++; + buf_len--; + len++; + } + } + + return len; +} + +u8_t +snmp_encode_truthvalue(s32_t *asn1_value, u32_t bool_value) +{ + /* defined by RFC1443: + TruthValue ::= TEXTUAL-CONVENTION + STATUS current + DESCRIPTION + "Represents a boolean value." + SYNTAX INTEGER { true(1), false(2) } + */ + + if (asn1_value == NULL) { + return 0; + } + + if (bool_value) { + *asn1_value = 1; /* defined by RFC1443 */ + } else { + *asn1_value = 2; /* defined by RFC1443 */ + } + + return sizeof(s32_t); +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core_priv.h new file mode 100644 index 0000000..5552177 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_core_priv.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#ifndef LWIP_HDR_APPS_SNMP_CORE_PRIV_H +#define LWIP_HDR_APPS_SNMP_CORE_PRIV_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp_core.h" +#include "snmp_asn1.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* (outdated) SNMPv1 error codes + * shall not be used by MIBS anymore, nevertheless required from core for properly answering a v1 request + */ +#define SNMP_ERR_NOSUCHNAME 2 +#define SNMP_ERR_BADVALUE 3 +#define SNMP_ERR_READONLY 4 +/* error codes which are internal and shall not be used by MIBS + * shall not be used by MIBS anymore, nevertheless required from core for properly answering a v1 request + */ +#define SNMP_ERR_TOOBIG 1 +#define SNMP_ERR_AUTHORIZATIONERROR 16 +#define SNMP_ERR_NOSUCHOBJECT SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_OBJECT +#define SNMP_ERR_ENDOFMIBVIEW SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_END_OF_MIB_VIEW + + +const struct snmp_node* snmp_mib_tree_resolve_exact(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, u8_t* oid_instance_len); +const struct snmp_node* snmp_mib_tree_resolve_next(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, struct snmp_obj_id* oidret); + +typedef u8_t (*snmp_validate_node_instance_method)(struct snmp_node_instance*, void*); + +u8_t snmp_get_node_instance_from_oid(const u32_t *oid, u8_t oid_len, struct snmp_node_instance* node_instance); +u8_t snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_validate_node_instance_method validate_node_instance_method, void* validate_node_instance_arg, struct snmp_obj_id* node_oid, struct snmp_node_instance* node_instance); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SNMP */ + +#endif /* LWIP_HDR_APPS_SNMP_CORE_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2.c new file mode 100644 index 0000000..9d8c43c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2.c @@ -0,0 +1,116 @@ +/** + * @file + * Management Information Base II (RFC1213) objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +/** + * @defgroup snmp_mib2 MIB2 + * @ingroup snmp + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP && SNMP_LWIP_MIB2 /* don't build if not configured for use in lwipopts.h */ + +#if !LWIP_STATS +#error LWIP_SNMP MIB2 needs LWIP_STATS (for MIB2) +#endif +#if !MIB2_STATS +#error LWIP_SNMP MIB2 needs MIB2_STATS (for MIB2) +#endif + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_scalar.h" + +#if SNMP_USE_NETCONN +#include "lwip/tcpip.h" +#include "lwip/priv/tcpip_priv.h" +void +snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg) +{ +#if LWIP_TCPIP_CORE_LOCKING + LOCK_TCPIP_CORE(); + fn(arg); + UNLOCK_TCPIP_CORE(); +#else + tcpip_callback(fn, arg); +#endif +} + +struct snmp_threadsync_instance snmp_mib2_lwip_locks; +#endif + +/* dot3 and EtherLike MIB not planned. (transmission .1.3.6.1.2.1.10) */ +/* historical (some say hysterical). (cmot .1.3.6.1.2.1.9) */ +/* lwIP has no EGP, thus may not implement it. (egp .1.3.6.1.2.1.8) */ + +/* --- mib-2 .1.3.6.1.2.1 ----------------------------------------------------- */ +extern const struct snmp_scalar_array_node snmp_mib2_snmp_root; +extern const struct snmp_tree_node snmp_mib2_udp_root; +extern const struct snmp_tree_node snmp_mib2_tcp_root; +extern const struct snmp_scalar_array_node snmp_mib2_icmp_root; +extern const struct snmp_tree_node snmp_mib2_interface_root; +extern const struct snmp_scalar_array_node snmp_mib2_system_node; +extern const struct snmp_tree_node snmp_mib2_at_root; +extern const struct snmp_tree_node snmp_mib2_ip_root; + +static const struct snmp_node* const mib2_nodes[] = { + &snmp_mib2_system_node.node.node, + &snmp_mib2_interface_root.node, +#if LWIP_ARP && LWIP_IPV4 + &snmp_mib2_at_root.node, +#endif /* LWIP_ARP && LWIP_IPV4 */ +#if LWIP_IPV4 + &snmp_mib2_ip_root.node, +#endif /* LWIP_IPV4 */ +#if LWIP_ICMP + &snmp_mib2_icmp_root.node.node, +#endif /* LWIP_ICMP */ +#if LWIP_TCP + &snmp_mib2_tcp_root.node, +#endif /* LWIP_TCP */ +#if LWIP_UDP + &snmp_mib2_udp_root.node, +#endif /* LWIP_UDP */ + &snmp_mib2_snmp_root.node.node +}; + +static const struct snmp_tree_node mib2_root = SNMP_CREATE_TREE_NODE(1, mib2_nodes); + +static const u32_t mib2_base_oid_arr[] = { 1,3,6,1,2,1 }; +const struct snmp_mib mib2 = SNMP_MIB_CREATE(mib2_base_oid_arr, &mib2_root.node); + +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_icmp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_icmp.c new file mode 100644 index 0000000..995bd32 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_icmp.c @@ -0,0 +1,182 @@ +/** + * @file + * Management Information Base II (RFC1213) ICMP objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/icmp.h" +#include "lwip/stats.h" + +#if LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_ICMP + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + +/* --- icmp .1.3.6.1.2.1.5 ----------------------------------------------------- */ + +static s16_t +icmp_get_value(const struct snmp_scalar_array_node_def *node, void *value) +{ + u32_t *uint_ptr = (u32_t*)value; + + switch (node->oid) { + case 1: /* icmpInMsgs */ + *uint_ptr = STATS_GET(mib2.icmpinmsgs); + return sizeof(*uint_ptr); + case 2: /* icmpInErrors */ + *uint_ptr = STATS_GET(mib2.icmpinerrors); + return sizeof(*uint_ptr); + case 3: /* icmpInDestUnreachs */ + *uint_ptr = STATS_GET(mib2.icmpindestunreachs); + return sizeof(*uint_ptr); + case 4: /* icmpInTimeExcds */ + *uint_ptr = STATS_GET(mib2.icmpintimeexcds); + return sizeof(*uint_ptr); + case 5: /* icmpInParmProbs */ + *uint_ptr = STATS_GET(mib2.icmpinparmprobs); + return sizeof(*uint_ptr); + case 6: /* icmpInSrcQuenchs */ + *uint_ptr = STATS_GET(mib2.icmpinsrcquenchs); + return sizeof(*uint_ptr); + case 7: /* icmpInRedirects */ + *uint_ptr = STATS_GET(mib2.icmpinredirects); + return sizeof(*uint_ptr); + case 8: /* icmpInEchos */ + *uint_ptr = STATS_GET(mib2.icmpinechos); + return sizeof(*uint_ptr); + case 9: /* icmpInEchoReps */ + *uint_ptr = STATS_GET(mib2.icmpinechoreps); + return sizeof(*uint_ptr); + case 10: /* icmpInTimestamps */ + *uint_ptr = STATS_GET(mib2.icmpintimestamps); + return sizeof(*uint_ptr); + case 11: /* icmpInTimestampReps */ + *uint_ptr = STATS_GET(mib2.icmpintimestampreps); + return sizeof(*uint_ptr); + case 12: /* icmpInAddrMasks */ + *uint_ptr = STATS_GET(mib2.icmpinaddrmasks); + return sizeof(*uint_ptr); + case 13: /* icmpInAddrMaskReps */ + *uint_ptr = STATS_GET(mib2.icmpinaddrmaskreps); + return sizeof(*uint_ptr); + case 14: /* icmpOutMsgs */ + *uint_ptr = STATS_GET(mib2.icmpoutmsgs); + return sizeof(*uint_ptr); + case 15: /* icmpOutErrors */ + *uint_ptr = STATS_GET(mib2.icmpouterrors); + return sizeof(*uint_ptr); + case 16: /* icmpOutDestUnreachs */ + *uint_ptr = STATS_GET(mib2.icmpoutdestunreachs); + return sizeof(*uint_ptr); + case 17: /* icmpOutTimeExcds */ + *uint_ptr = STATS_GET(mib2.icmpouttimeexcds); + return sizeof(*uint_ptr); + case 18: /* icmpOutParmProbs: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 19: /* icmpOutSrcQuenchs: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 20: /* icmpOutRedirects: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 21: /* icmpOutEchos */ + *uint_ptr = STATS_GET(mib2.icmpoutechos); + return sizeof(*uint_ptr); + case 22: /* icmpOutEchoReps */ + *uint_ptr = STATS_GET(mib2.icmpoutechoreps); + return sizeof(*uint_ptr); + case 23: /* icmpOutTimestamps: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 24: /* icmpOutTimestampReps: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 25: /* icmpOutAddrMasks: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + case 26: /* icmpOutAddrMaskReps: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("icmp_get_value(): unknown id: %"S32_F"\n", node->oid)); + break; + } + + return 0; +} + + +static const struct snmp_scalar_array_node_def icmp_nodes[] = { + { 1, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 2, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 3, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 4, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 5, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 6, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 7, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 8, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + { 9, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {10, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {11, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {12, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {13, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {14, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {15, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {16, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {17, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {18, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {19, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {20, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {21, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {22, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {23, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {24, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {25, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, + {26, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY} +}; + +const struct snmp_scalar_array_node snmp_mib2_icmp_root = SNMP_SCALAR_CREATE_ARRAY_NODE(5, icmp_nodes, icmp_get_value, NULL, NULL); + +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_ICMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_interfaces.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_interfaces.c new file mode 100644 index 0000000..979b507 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_interfaces.c @@ -0,0 +1,375 @@ +/** + * @file + * Management Information Base II (RFC1213) INTERFACES objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/netif.h" +#include "lwip/stats.h" + +#include + +#if LWIP_SNMP && SNMP_LWIP_MIB2 + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + + +/* --- interfaces .1.3.6.1.2.1.2 ----------------------------------------------------- */ + +static s16_t +interfaces_get_value(struct snmp_node_instance* instance, void* value) +{ + if (instance->node->oid == 1) { + s32_t *sint_ptr = (s32_t*)value; + s32_t num_netifs = 0; + + struct netif *netif = netif_list; + while (netif != NULL) { + num_netifs++; + netif = netif->next; + } + + *sint_ptr = num_netifs; + return sizeof(*sint_ptr); + } + + return 0; +} + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range interfaces_Table_oid_ranges[] = { + { 1, 0xff } /* netif->num is u8_t */ +}; + +static const u8_t iftable_ifOutQLen = 0; + +static const u8_t iftable_ifOperStatus_up = 1; +static const u8_t iftable_ifOperStatus_down = 2; + +static const u8_t iftable_ifAdminStatus_up = 1; +static const u8_t iftable_ifAdminStatus_lowerLayerDown = 7; +static const u8_t iftable_ifAdminStatus_down = 2; + +static snmp_err_t +interfaces_Table_get_cell_instance(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, struct snmp_node_instance* cell_instance) +{ + u32_t ifIndex; + struct netif *netif; + + LWIP_UNUSED_ARG(column); + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, interfaces_Table_oid_ranges, LWIP_ARRAYSIZE(interfaces_Table_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get netif index from incoming OID */ + ifIndex = row_oid[0]; + + /* find netif with index */ + netif = netif_list; + while (netif != NULL) { + if (netif_to_num(netif) == ifIndex) { + /* store netif pointer for subsequent operations (get/test/set) */ + cell_instance->reference.ptr = netif; + return SNMP_ERR_NOERROR; + } + netif = netif->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +interfaces_Table_get_next_cell_instance(const u32_t* column, struct snmp_obj_id* row_oid, struct snmp_node_instance* cell_instance) +{ + struct netif *netif; + struct snmp_next_oid_state state; + u32_t result_temp[LWIP_ARRAYSIZE(interfaces_Table_oid_ranges)]; + + LWIP_UNUSED_ARG(column); + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(interfaces_Table_oid_ranges)); + + /* iterate over all possible OIDs to find the next one */ + netif = netif_list; + while (netif != NULL) { + u32_t test_oid[LWIP_ARRAYSIZE(interfaces_Table_oid_ranges)]; + test_oid[0] = netif_to_num(netif); + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(interfaces_Table_oid_ranges), netif); + + netif = netif->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* store netif pointer for subsequent operations (get/test/set) */ + cell_instance->reference.ptr = /* (struct netif*) */state.reference; + return SNMP_ERR_NOERROR; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static s16_t +interfaces_Table_get_value(struct snmp_node_instance* instance, void* value) +{ + struct netif *netif = (struct netif*)instance->reference.ptr; + u32_t* value_u32 = (u32_t*)value; + s32_t* value_s32 = (s32_t*)value; + u16_t value_len; + + switch (SNMP_TABLE_GET_COLUMN_FROM_OID(instance->instance_oid.id)) + { + case 1: /* ifIndex */ + *value_s32 = netif_to_num(netif); + value_len = sizeof(*value_s32); + break; + case 2: /* ifDescr */ + value_len = sizeof(netif->name); + MEMCPY(value, netif->name, value_len); + break; + case 3: /* ifType */ + *value_s32 = netif->link_type; + value_len = sizeof(*value_s32); + break; + case 4: /* ifMtu */ + *value_s32 = netif->mtu; + value_len = sizeof(*value_s32); + break; + case 5: /* ifSpeed */ + *value_u32 = netif->link_speed; + value_len = sizeof(*value_u32); + break; + case 6: /* ifPhysAddress */ + value_len = sizeof(netif->hwaddr); + MEMCPY(value, &netif->hwaddr, value_len); + break; + case 7: /* ifAdminStatus */ + if (netif_is_up(netif)) { + *value_s32 = iftable_ifOperStatus_up; + } else { + *value_s32 = iftable_ifOperStatus_down; + } + value_len = sizeof(*value_s32); + break; + case 8: /* ifOperStatus */ + if (netif_is_up(netif)) { + if (netif_is_link_up(netif)) { + *value_s32 = iftable_ifAdminStatus_up; + } else { + *value_s32 = iftable_ifAdminStatus_lowerLayerDown; + } + } else { + *value_s32 = iftable_ifAdminStatus_down; + } + value_len = sizeof(*value_s32); + break; + case 9: /* ifLastChange */ + *value_u32 = netif->ts; + value_len = sizeof(*value_u32); + break; + case 10: /* ifInOctets */ + *value_u32 = netif->mib2_counters.ifinoctets; + value_len = sizeof(*value_u32); + break; + case 11: /* ifInUcastPkts */ + *value_u32 = netif->mib2_counters.ifinucastpkts; + value_len = sizeof(*value_u32); + break; + case 12: /* ifInNUcastPkts */ + *value_u32 = netif->mib2_counters.ifinnucastpkts; + value_len = sizeof(*value_u32); + break; + case 13: /* ifInDiscards */ + *value_u32 = netif->mib2_counters.ifindiscards; + value_len = sizeof(*value_u32); + break; + case 14: /* ifInErrors */ + *value_u32 = netif->mib2_counters.ifinerrors; + value_len = sizeof(*value_u32); + break; + case 15: /* ifInUnkownProtos */ + *value_u32 = netif->mib2_counters.ifinunknownprotos; + value_len = sizeof(*value_u32); + break; + case 16: /* ifOutOctets */ + *value_u32 = netif->mib2_counters.ifoutoctets; + value_len = sizeof(*value_u32); + break; + case 17: /* ifOutUcastPkts */ + *value_u32 = netif->mib2_counters.ifoutucastpkts; + value_len = sizeof(*value_u32); + break; + case 18: /* ifOutNUcastPkts */ + *value_u32 = netif->mib2_counters.ifoutnucastpkts; + value_len = sizeof(*value_u32); + break; + case 19: /* ifOutDiscarts */ + *value_u32 = netif->mib2_counters.ifoutdiscards; + value_len = sizeof(*value_u32); + break; + case 20: /* ifOutErrors */ + *value_u32 = netif->mib2_counters.ifouterrors; + value_len = sizeof(*value_u32); + break; + case 21: /* ifOutQLen */ + *value_u32 = iftable_ifOutQLen; + value_len = sizeof(*value_u32); + break; + /** @note returning zeroDotZero (0.0) no media specific MIB support */ + case 22: /* ifSpecific */ + value_len = snmp_zero_dot_zero.len * sizeof(u32_t); + MEMCPY(value, snmp_zero_dot_zero.id, value_len); + break; + default: + return 0; + } + + return value_len; +} + +#if !SNMP_SAFE_REQUESTS + +static snmp_err_t +interfaces_Table_set_test(struct snmp_node_instance* instance, u16_t len, void *value) +{ + s32_t *sint_ptr = (s32_t*)value; + + /* stack should never call this method for another column, + because all other columns are set to readonly */ + LWIP_ASSERT("Invalid column", (SNMP_TABLE_GET_COLUMN_FROM_OID(instance->instance_oid.id) == 7)); + LWIP_UNUSED_ARG(len); + + if (*sint_ptr == 1 || *sint_ptr == 2) { + return SNMP_ERR_NOERROR; + } + + return SNMP_ERR_WRONGVALUE; +} + +static snmp_err_t +interfaces_Table_set_value(struct snmp_node_instance* instance, u16_t len, void *value) +{ + struct netif *netif = (struct netif*)instance->reference.ptr; + s32_t *sint_ptr = (s32_t*)value; + + /* stack should never call this method for another column, + because all other columns are set to readonly */ + LWIP_ASSERT("Invalid column", (SNMP_TABLE_GET_COLUMN_FROM_OID(instance->instance_oid.id) == 7)); + LWIP_UNUSED_ARG(len); + + if (*sint_ptr == 1) { + netif_set_up(netif); + } else if (*sint_ptr == 2) { + netif_set_down(netif); + } + + return SNMP_ERR_NOERROR; +} + +#endif /* SNMP_SAFE_REQUESTS */ + +static const struct snmp_scalar_node interfaces_Number = SNMP_SCALAR_CREATE_NODE_READONLY(1, SNMP_ASN1_TYPE_INTEGER, interfaces_get_value); + +static const struct snmp_table_col_def interfaces_Table_columns[] = { + { 1, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifIndex */ + { 2, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifDescr */ + { 3, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifType */ + { 4, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifMtu */ + { 5, SNMP_ASN1_TYPE_GAUGE, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifSpeed */ + { 6, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifPhysAddress */ +#if !SNMP_SAFE_REQUESTS + { 7, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_WRITE }, /* ifAdminStatus */ +#else + { 7, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifAdminStatus */ +#endif + { 8, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOperStatus */ + { 9, SNMP_ASN1_TYPE_TIMETICKS, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifLastChange */ + { 10, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInOctets */ + { 11, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInUcastPkts */ + { 12, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInNUcastPkts */ + { 13, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInDiscarts */ + { 14, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInErrors */ + { 15, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifInUnkownProtos */ + { 16, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutOctets */ + { 17, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutUcastPkts */ + { 18, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutNUcastPkts */ + { 19, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutDiscarts */ + { 20, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutErrors */ + { 21, SNMP_ASN1_TYPE_GAUGE, SNMP_NODE_INSTANCE_READ_ONLY }, /* ifOutQLen */ + { 22, SNMP_ASN1_TYPE_OBJECT_ID, SNMP_NODE_INSTANCE_READ_ONLY } /* ifSpecific */ +}; + +#if !SNMP_SAFE_REQUESTS +static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE( + 2, interfaces_Table_columns, + interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance, + interfaces_Table_get_value, interfaces_Table_set_test, interfaces_Table_set_value); +#else +static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE( + 2, interfaces_Table_columns, + interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance, + interfaces_Table_get_value, NULL, NULL); +#endif + +/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ +CREATE_LWIP_SYNC_NODE(1, interfaces_Number) +CREATE_LWIP_SYNC_NODE(2, interfaces_Table) + +static const struct snmp_node* const interface_nodes[] = { + &SYNC_NODE_NAME(interfaces_Number).node.node, + &SYNC_NODE_NAME(interfaces_Table).node.node +}; + +const struct snmp_tree_node snmp_mib2_interface_root = SNMP_CREATE_TREE_NODE(2, interface_nodes); + +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_ip.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_ip.c new file mode 100644 index 0000000..4f05180 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_ip.c @@ -0,0 +1,743 @@ +/** + * @file + * Management Information Base II (RFC1213) IP objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/stats.h" +#include "lwip/netif.h" +#include "lwip/ip.h" +#include "lwip/etharp.h" + +#if LWIP_SNMP && SNMP_LWIP_MIB2 + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + +#if LWIP_IPV4 +/* --- ip .1.3.6.1.2.1.4 ----------------------------------------------------- */ + +static s16_t +ip_get_value(struct snmp_node_instance* instance, void* value) +{ + s32_t* sint_ptr = (s32_t*)value; + u32_t* uint_ptr = (u32_t*)value; + + switch (instance->node->oid) { + case 1: /* ipForwarding */ +#if IP_FORWARD + /* forwarding */ + *sint_ptr = 1; +#else + /* not-forwarding */ + *sint_ptr = 2; +#endif + return sizeof(*sint_ptr); + case 2: /* ipDefaultTTL */ + *sint_ptr = IP_DEFAULT_TTL; + return sizeof(*sint_ptr); + case 3: /* ipInReceives */ + *uint_ptr = STATS_GET(mib2.ipinreceives); + return sizeof(*uint_ptr); + case 4: /* ipInHdrErrors */ + *uint_ptr = STATS_GET(mib2.ipinhdrerrors); + return sizeof(*uint_ptr); + case 5: /* ipInAddrErrors */ + *uint_ptr = STATS_GET(mib2.ipinaddrerrors); + return sizeof(*uint_ptr); + case 6: /* ipForwDatagrams */ + *uint_ptr = STATS_GET(mib2.ipforwdatagrams); + return sizeof(*uint_ptr); + case 7: /* ipInUnknownProtos */ + *uint_ptr = STATS_GET(mib2.ipinunknownprotos); + return sizeof(*uint_ptr); + case 8: /* ipInDiscards */ + *uint_ptr = STATS_GET(mib2.ipindiscards); + return sizeof(*uint_ptr); + case 9: /* ipInDelivers */ + *uint_ptr = STATS_GET(mib2.ipindelivers); + return sizeof(*uint_ptr); + case 10: /* ipOutRequests */ + *uint_ptr = STATS_GET(mib2.ipoutrequests); + return sizeof(*uint_ptr); + case 11: /* ipOutDiscards */ + *uint_ptr = STATS_GET(mib2.ipoutdiscards); + return sizeof(*uint_ptr); + case 12: /* ipOutNoRoutes */ + *uint_ptr = STATS_GET(mib2.ipoutnoroutes); + return sizeof(*uint_ptr); + case 13: /* ipReasmTimeout */ +#if IP_REASSEMBLY + *sint_ptr = IP_REASS_MAXAGE; +#else + *sint_ptr = 0; +#endif + return sizeof(*sint_ptr); + case 14: /* ipReasmReqds */ + *uint_ptr = STATS_GET(mib2.ipreasmreqds); + return sizeof(*uint_ptr); + case 15: /* ipReasmOKs */ + *uint_ptr = STATS_GET(mib2.ipreasmoks); + return sizeof(*uint_ptr); + case 16: /* ipReasmFails */ + *uint_ptr = STATS_GET(mib2.ipreasmfails); + return sizeof(*uint_ptr); + case 17: /* ipFragOKs */ + *uint_ptr = STATS_GET(mib2.ipfragoks); + return sizeof(*uint_ptr); + case 18: /* ipFragFails */ + *uint_ptr = STATS_GET(mib2.ipfragfails); + return sizeof(*uint_ptr); + case 19: /* ipFragCreates */ + *uint_ptr = STATS_GET(mib2.ipfragcreates); + return sizeof(*uint_ptr); + case 23: /* ipRoutingDiscards: not supported -> always 0 */ + *uint_ptr = 0; + return sizeof(*uint_ptr); + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("ip_get_value(): unknown id: %"S32_F"\n", instance->node->oid)); + break; + } + + return 0; +} + +/** + * Test ip object value before setting. + * + * @param instance node instance + * @param len return value space (in bytes) + * @param value points to (varbind) space to copy value from. + * + * @note we allow set if the value matches the hardwired value, + * otherwise return badvalue. + */ +static snmp_err_t +ip_set_test(struct snmp_node_instance* instance, u16_t len, void *value) +{ + snmp_err_t ret = SNMP_ERR_WRONGVALUE; + s32_t *sint_ptr = (s32_t*)value; + + LWIP_UNUSED_ARG(len); + switch (instance->node->oid) { + case 1: /* ipForwarding */ +#if IP_FORWARD + /* forwarding */ + if (*sint_ptr == 1) +#else + /* not-forwarding */ + if (*sint_ptr == 2) +#endif + { + ret = SNMP_ERR_NOERROR; + } + break; + case 2: /* ipDefaultTTL */ + if (*sint_ptr == IP_DEFAULT_TTL) { + ret = SNMP_ERR_NOERROR; + } + break; + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("ip_set_test(): unknown id: %"S32_F"\n", instance->node->oid)); + break; + } + + return ret; +} + +static snmp_err_t +ip_set_value(struct snmp_node_instance* instance, u16_t len, void *value) +{ + LWIP_UNUSED_ARG(instance); + LWIP_UNUSED_ARG(len); + LWIP_UNUSED_ARG(value); + /* nothing to do here because in set_test we only accept values being the same as our own stored value -> no need to store anything */ + return SNMP_ERR_NOERROR; +} + +/* --- ipAddrTable --- */ + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range ip_AddrTable_oid_ranges[] = { + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff } /* IP D */ +}; + +static snmp_err_t +ip_AddrTable_get_cell_value_core(struct netif *netif, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) +{ + LWIP_UNUSED_ARG(value_len); + + switch (*column) { + case 1: /* ipAdEntAddr */ + value->u32 = netif_ip4_addr(netif)->addr; + break; + case 2: /* ipAdEntIfIndex */ + value->u32 = netif_to_num(netif); + break; + case 3: /* ipAdEntNetMask */ + value->u32 = netif_ip4_netmask(netif)->addr; + break; + case 4: /* ipAdEntBcastAddr */ + /* lwIP oddity, there's no broadcast + address in the netif we can rely on */ + value->u32 = IPADDR_BROADCAST & 1; + break; + case 5: /* ipAdEntReasmMaxSize */ +#if IP_REASSEMBLY + /* @todo The theoretical maximum is IP_REASS_MAX_PBUFS * size of the pbufs, + * but only if receiving one fragmented packet at a time. + * The current solution is to calculate for 2 simultaneous packets... + */ + value->u32 = (IP_HLEN + ((IP_REASS_MAX_PBUFS/2) * + (PBUF_POOL_BUFSIZE - PBUF_LINK_ENCAPSULATION_HLEN - PBUF_LINK_HLEN - IP_HLEN))); +#else + /** @todo returning MTU would be a bad thing and + returning a wild guess like '576' isn't good either */ + value->u32 = 0; +#endif + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +ip_AddrTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip4_addr_t ip; + struct netif *netif; + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, ip_AddrTable_oid_ranges, LWIP_ARRAYSIZE(ip_AddrTable_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get IP from incoming OID */ + snmp_oid_to_ip4(&row_oid[0], &ip); /* we know it succeeds because of oid_in_range check above */ + + /* find netif with requested ip */ + netif = netif_list; + while (netif != NULL) { + if (ip4_addr_cmp(&ip, netif_ip4_addr(netif))) { + /* fill in object properties */ + return ip_AddrTable_get_cell_value_core(netif, column, value, value_len); + } + + netif = netif->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +ip_AddrTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct netif *netif; + struct snmp_next_oid_state state; + u32_t result_temp[LWIP_ARRAYSIZE(ip_AddrTable_oid_ranges)]; + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(ip_AddrTable_oid_ranges)); + + /* iterate over all possible OIDs to find the next one */ + netif = netif_list; + while (netif != NULL) { + u32_t test_oid[LWIP_ARRAYSIZE(ip_AddrTable_oid_ranges)]; + snmp_ip4_to_oid(netif_ip4_addr(netif), &test_oid[0]); + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(ip_AddrTable_oid_ranges), netif); + + netif = netif->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return ip_AddrTable_get_cell_value_core((struct netif*)state.reference, column, value, value_len); + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +/* --- ipRouteTable --- */ + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range ip_RouteTable_oid_ranges[] = { + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff }, /* IP D */ +}; + +static snmp_err_t +ip_RouteTable_get_cell_value_core(struct netif *netif, u8_t default_route, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) +{ + switch (*column) { + case 1: /* ipRouteDest */ + if (default_route) { + /* default rte has 0.0.0.0 dest */ + value->u32 = IP4_ADDR_ANY4->addr; + } else { + /* netifs have netaddress dest */ + ip4_addr_t tmp; + ip4_addr_get_network(&tmp, netif_ip4_addr(netif), netif_ip4_netmask(netif)); + value->u32 = tmp.addr; + } + break; + case 2: /* ipRouteIfIndex */ + value->u32 = netif_to_num(netif); + break; + case 3: /* ipRouteMetric1 */ + if (default_route) { + value->s32 = 1; /* default */ + } else { + value->s32 = 0; /* normal */ + } + break; + case 4: /* ipRouteMetric2 */ + case 5: /* ipRouteMetric3 */ + case 6: /* ipRouteMetric4 */ + value->s32 = -1; /* none */ + break; + case 7: /* ipRouteNextHop */ + if (default_route) { + /* default rte: gateway */ + value->u32 = netif_ip4_gw(netif)->addr; + } else { + /* other rtes: netif ip_addr */ + value->u32 = netif_ip4_addr(netif)->addr; + } + break; + case 8: /* ipRouteType */ + if (default_route) { + /* default rte is indirect */ + value->u32 = 4; /* indirect */ + } else { + /* other rtes are direct */ + value->u32 = 3; /* direct */ + } + break; + case 9: /* ipRouteProto */ + /* locally defined routes */ + value->u32 = 2; /* local */ + break; + case 10: /* ipRouteAge */ + /* @todo (sysuptime - timestamp last change) / 100 */ + value->u32 = 0; + break; + case 11: /* ipRouteMask */ + if (default_route) { + /* default rte use 0.0.0.0 mask */ + value->u32 = IP4_ADDR_ANY4->addr; + } else { + /* other rtes use netmask */ + value->u32 = netif_ip4_netmask(netif)->addr; + } + break; + case 12: /* ipRouteMetric5 */ + value->s32 = -1; /* none */ + break; + case 13: /* ipRouteInfo */ + value->const_ptr = snmp_zero_dot_zero.id; + *value_len = snmp_zero_dot_zero.len * sizeof(u32_t); + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +ip_RouteTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip4_addr_t test_ip; + struct netif *netif; + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, ip_RouteTable_oid_ranges, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get IP and port from incoming OID */ + snmp_oid_to_ip4(&row_oid[0], &test_ip); /* we know it succeeds because of oid_in_range check above */ + + /* default route is on default netif */ + if (ip4_addr_isany_val(test_ip) && (netif_default != NULL)) { + /* fill in object properties */ + return ip_RouteTable_get_cell_value_core(netif_default, 1, column, value, value_len); + } + + /* find netif with requested route */ + netif = netif_list; + while (netif != NULL) { + ip4_addr_t dst; + ip4_addr_get_network(&dst, netif_ip4_addr(netif), netif_ip4_netmask(netif)); + + if (ip4_addr_cmp(&dst, &test_ip)) { + /* fill in object properties */ + return ip_RouteTable_get_cell_value_core(netif, 0, column, value, value_len); + } + + netif = netif->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +ip_RouteTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct netif *netif; + struct snmp_next_oid_state state; + u32_t result_temp[LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges)]; + u32_t test_oid[LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges)]; + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges)); + + /* check default route */ + if (netif_default != NULL) { + snmp_ip4_to_oid(IP4_ADDR_ANY4, &test_oid[0]); + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges), netif_default); + } + + /* iterate over all possible OIDs to find the next one */ + netif = netif_list; + while (netif != NULL) { + ip4_addr_t dst; + ip4_addr_get_network(&dst, netif_ip4_addr(netif), netif_ip4_netmask(netif)); + + /* check generated OID: is it a candidate for the next one? */ + if (!ip4_addr_isany_val(dst)) { + snmp_ip4_to_oid(&dst, &test_oid[0]); + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges), netif); + } + + netif = netif->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + ip4_addr_t dst; + snmp_oid_to_ip4(&result_temp[0], &dst); + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return ip_RouteTable_get_cell_value_core((struct netif*)state.reference, ip4_addr_isany_val(dst), column, value, value_len); + } else { + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; + } +} + +#if LWIP_ARP && LWIP_IPV4 +/* --- ipNetToMediaTable --- */ + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range ip_NetToMediaTable_oid_ranges[] = { + { 1, 0xff }, /* IfIndex */ + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff } /* IP D */ +}; + +static snmp_err_t +ip_NetToMediaTable_get_cell_value_core(u8_t arp_table_index, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) +{ + ip4_addr_t *ip; + struct netif *netif; + struct eth_addr *ethaddr; + + etharp_get_entry(arp_table_index, &ip, &netif, ðaddr); + + /* value */ + switch (*column) { + case 1: /* atIfIndex / ipNetToMediaIfIndex */ + value->u32 = netif_to_num(netif); + break; + case 2: /* atPhysAddress / ipNetToMediaPhysAddress */ + value->ptr = ethaddr; + *value_len = sizeof(*ethaddr); + break; + case 3: /* atNetAddress / ipNetToMediaNetAddress */ + value->u32 = ip->addr; + break; + case 4: /* ipNetToMediaType */ + value->u32 = 3; /* dynamic*/ + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +ip_NetToMediaTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip4_addr_t ip_in; + u8_t netif_index; + u8_t i; + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, ip_NetToMediaTable_oid_ranges, LWIP_ARRAYSIZE(ip_NetToMediaTable_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get IP from incoming OID */ + netif_index = (u8_t)row_oid[0]; + snmp_oid_to_ip4(&row_oid[1], &ip_in); /* we know it succeeds because of oid_in_range check above */ + + /* find requested entry */ + for (i=0; iid, row_oid->len, result_temp, LWIP_ARRAYSIZE(ip_NetToMediaTable_oid_ranges)); + + /* iterate over all possible OIDs to find the next one */ + for (i=0; i + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_scalar.h" + +#if LWIP_SNMP && SNMP_LWIP_MIB2 + +#define MIB2_AUTH_TRAPS_ENABLED 1 +#define MIB2_AUTH_TRAPS_DISABLED 2 + +/* --- snmp .1.3.6.1.2.1.11 ----------------------------------------------------- */ +static s16_t +snmp_get_value(const struct snmp_scalar_array_node_def *node, void *value) +{ + u32_t *uint_ptr = (u32_t*)value; + switch (node->oid) { + case 1: /* snmpInPkts */ + *uint_ptr = snmp_stats.inpkts; + break; + case 2: /* snmpOutPkts */ + *uint_ptr = snmp_stats.outpkts; + break; + case 3: /* snmpInBadVersions */ + *uint_ptr = snmp_stats.inbadversions; + break; + case 4: /* snmpInBadCommunityNames */ + *uint_ptr = snmp_stats.inbadcommunitynames; + break; + case 5: /* snmpInBadCommunityUses */ + *uint_ptr = snmp_stats.inbadcommunityuses; + break; + case 6: /* snmpInASNParseErrs */ + *uint_ptr = snmp_stats.inasnparseerrs; + break; + case 8: /* snmpInTooBigs */ + *uint_ptr = snmp_stats.intoobigs; + break; + case 9: /* snmpInNoSuchNames */ + *uint_ptr = snmp_stats.innosuchnames; + break; + case 10: /* snmpInBadValues */ + *uint_ptr = snmp_stats.inbadvalues; + break; + case 11: /* snmpInReadOnlys */ + *uint_ptr = snmp_stats.inreadonlys; + break; + case 12: /* snmpInGenErrs */ + *uint_ptr = snmp_stats.ingenerrs; + break; + case 13: /* snmpInTotalReqVars */ + *uint_ptr = snmp_stats.intotalreqvars; + break; + case 14: /* snmpInTotalSetVars */ + *uint_ptr = snmp_stats.intotalsetvars; + break; + case 15: /* snmpInGetRequests */ + *uint_ptr = snmp_stats.ingetrequests; + break; + case 16: /* snmpInGetNexts */ + *uint_ptr = snmp_stats.ingetnexts; + break; + case 17: /* snmpInSetRequests */ + *uint_ptr = snmp_stats.insetrequests; + break; + case 18: /* snmpInGetResponses */ + *uint_ptr = snmp_stats.ingetresponses; + break; + case 19: /* snmpInTraps */ + *uint_ptr = snmp_stats.intraps; + break; + case 20: /* snmpOutTooBigs */ + *uint_ptr = snmp_stats.outtoobigs; + break; + case 21: /* snmpOutNoSuchNames */ + *uint_ptr = snmp_stats.outnosuchnames; + break; + case 22: /* snmpOutBadValues */ + *uint_ptr = snmp_stats.outbadvalues; + break; + case 24: /* snmpOutGenErrs */ + *uint_ptr = snmp_stats.outgenerrs; + break; + case 25: /* snmpOutGetRequests */ + *uint_ptr = snmp_stats.outgetrequests; + break; + case 26: /* snmpOutGetNexts */ + *uint_ptr = snmp_stats.outgetnexts; + break; + case 27: /* snmpOutSetRequests */ + *uint_ptr = snmp_stats.outsetrequests; + break; + case 28: /* snmpOutGetResponses */ + *uint_ptr = snmp_stats.outgetresponses; + break; + case 29: /* snmpOutTraps */ + *uint_ptr = snmp_stats.outtraps; + break; + case 30: /* snmpEnableAuthenTraps */ + if (snmp_get_auth_traps_enabled() == SNMP_AUTH_TRAPS_DISABLED) { + *uint_ptr = MIB2_AUTH_TRAPS_DISABLED; + } else { + *uint_ptr = MIB2_AUTH_TRAPS_ENABLED; + } + break; + case 31: /* snmpSilentDrops */ + *uint_ptr = 0; /* not supported */ + break; + case 32: /* snmpProxyDrops */ + *uint_ptr = 0; /* not supported */ + break; + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("snmp_get_value(): unknown id: %"S32_F"\n", node->oid)); + return 0; + } + + return sizeof(*uint_ptr); +} + +static snmp_err_t +snmp_set_test(const struct snmp_scalar_array_node_def *node, u16_t len, void *value) +{ + snmp_err_t ret = SNMP_ERR_WRONGVALUE; + LWIP_UNUSED_ARG(len); + + if (node->oid == 30) { + /* snmpEnableAuthenTraps */ + s32_t *sint_ptr = (s32_t*)value; + + /* we should have writable non-volatile mem here */ + if ((*sint_ptr == MIB2_AUTH_TRAPS_DISABLED) || (*sint_ptr == MIB2_AUTH_TRAPS_ENABLED)) { + ret = SNMP_ERR_NOERROR; + } + } + return ret; +} + +static snmp_err_t +snmp_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void *value) +{ + LWIP_UNUSED_ARG(len); + + if (node->oid == 30) { + /* snmpEnableAuthenTraps */ + s32_t *sint_ptr = (s32_t*)value; + if (*sint_ptr == MIB2_AUTH_TRAPS_DISABLED) { + snmp_set_auth_traps_enabled(SNMP_AUTH_TRAPS_DISABLED); + } else { + snmp_set_auth_traps_enabled(SNMP_AUTH_TRAPS_ENABLED); + } + } + + return SNMP_ERR_NOERROR; +} + +/* the following nodes access variables in SNMP stack (snmp_stats) from SNMP worker thread -> OK, no sync needed */ +static const struct snmp_scalar_array_node_def snmp_nodes[] = { + { 1, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInPkts */ + { 2, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutPkts */ + { 3, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInBadVersions */ + { 4, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInBadCommunityNames */ + { 5, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInBadCommunityUses */ + { 6, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInASNParseErrs */ + { 8, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInTooBigs */ + { 9, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInNoSuchNames */ + {10, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInBadValues */ + {11, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInReadOnlys */ + {12, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInGenErrs */ + {13, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInTotalReqVars */ + {14, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInTotalSetVars */ + {15, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInGetRequests */ + {16, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInGetNexts */ + {17, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInSetRequests */ + {18, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInGetResponses */ + {19, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInTraps */ + {20, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutTooBigs */ + {21, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutNoSuchNames */ + {22, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutBadValues */ + {24, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutGenErrs */ + {25, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutGetRequests */ + {26, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutGetNexts */ + {27, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutSetRequests */ + {28, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutGetResponses */ + {29, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutTraps */ + {30, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_WRITE}, /* snmpEnableAuthenTraps */ + {31, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpSilentDrops */ + {32, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY} /* snmpProxyDrops */ +}; + +const struct snmp_scalar_array_node snmp_mib2_snmp_root = SNMP_SCALAR_CREATE_ARRAY_NODE(11, snmp_nodes, snmp_get_value, snmp_set_test, snmp_set_value); + +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c new file mode 100644 index 0000000..90e5780 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c @@ -0,0 +1,377 @@ +/** + * @file + * Management Information Base II (RFC1213) SYSTEM objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/sys.h" + +#include + +#if LWIP_SNMP && SNMP_LWIP_MIB2 + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + +/* --- system .1.3.6.1.2.1.1 ----------------------------------------------------- */ + +/** mib-2.system.sysDescr */ +static const u8_t sysdescr_default[] = SNMP_LWIP_MIB2_SYSDESC; +static const u8_t* sysdescr = sysdescr_default; +static const u16_t* sysdescr_len = NULL; /* use strlen for determining len */ + +/** mib-2.system.sysContact */ +static const u8_t syscontact_default[] = SNMP_LWIP_MIB2_SYSCONTACT; +static const u8_t* syscontact = syscontact_default; +static const u16_t* syscontact_len = NULL; /* use strlen for determining len */ +static u8_t* syscontact_wr = NULL; /* if writable, points to the same buffer as syscontact (required for correct constness) */ +static u16_t* syscontact_wr_len = NULL; /* if writable, points to the same buffer as syscontact_len (required for correct constness) */ +static u16_t syscontact_bufsize = 0; /* 0=not writable */ + +/** mib-2.system.sysName */ +static const u8_t sysname_default[] = SNMP_LWIP_MIB2_SYSNAME; +static const u8_t* sysname = sysname_default; +static const u16_t* sysname_len = NULL; /* use strlen for determining len */ +static u8_t* sysname_wr = NULL; /* if writable, points to the same buffer as sysname (required for correct constness) */ +static u16_t* sysname_wr_len = NULL; /* if writable, points to the same buffer as sysname_len (required for correct constness) */ +static u16_t sysname_bufsize = 0; /* 0=not writable */ + +/** mib-2.system.sysLocation */ +static const u8_t syslocation_default[] = SNMP_LWIP_MIB2_SYSLOCATION; +static const u8_t* syslocation = syslocation_default; +static const u16_t* syslocation_len = NULL; /* use strlen for determining len */ +static u8_t* syslocation_wr = NULL; /* if writable, points to the same buffer as syslocation (required for correct constness) */ +static u16_t* syslocation_wr_len = NULL; /* if writable, points to the same buffer as syslocation_len (required for correct constness) */ +static u16_t syslocation_bufsize = 0; /* 0=not writable */ + +/** + * @ingroup snmp_mib2 + * Initializes sysDescr pointers. + * + * @param str if non-NULL then copy str pointer + * @param len points to string length, excluding zero terminator + */ +void +snmp_mib2_set_sysdescr(const u8_t *str, const u16_t *len) +{ + if (str != NULL) { + sysdescr = str; + sysdescr_len = len; + } +} + +/** + * @ingroup snmp_mib2 + * Initializes sysContact pointers + * + * @param ocstr if non-NULL then copy str pointer + * @param ocstrlen points to string length, excluding zero terminator. + * if set to NULL it is assumed that ocstr is NULL-terminated. + * @param bufsize size of the buffer in bytes. + * (this is required because the buffer can be overwritten by snmp-set) + * if ocstrlen is NULL buffer needs space for terminating 0 byte. + * otherwise complete buffer is used for string. + * if bufsize is set to 0, the value is regarded as read-only. + */ +void +snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) +{ + if (ocstr != NULL) { + syscontact = ocstr; + syscontact_wr = ocstr; + syscontact_len = ocstrlen; + syscontact_wr_len = ocstrlen; + syscontact_bufsize = bufsize; + } +} + +/** + * @ingroup snmp_mib2 + * see \ref snmp_mib2_set_syscontact but set pointer to readonly memory + */ +void +snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen) +{ + if (ocstr != NULL) { + syscontact = ocstr; + syscontact_len = ocstrlen; + syscontact_wr = NULL; + syscontact_wr_len = NULL; + syscontact_bufsize = 0; + } +} + + +/** + * @ingroup snmp_mib2 + * Initializes sysName pointers + * + * @param ocstr if non-NULL then copy str pointer + * @param ocstrlen points to string length, excluding zero terminator. + * if set to NULL it is assumed that ocstr is NULL-terminated. + * @param bufsize size of the buffer in bytes. + * (this is required because the buffer can be overwritten by snmp-set) + * if ocstrlen is NULL buffer needs space for terminating 0 byte. + * otherwise complete buffer is used for string. + * if bufsize is set to 0, the value is regarded as read-only. + */ +void +snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) +{ + if (ocstr != NULL) { + sysname = ocstr; + sysname_wr = ocstr; + sysname_len = ocstrlen; + sysname_wr_len = ocstrlen; + sysname_bufsize = bufsize; + } +} + +/** + * @ingroup snmp_mib2 + * see \ref snmp_mib2_set_sysname but set pointer to readonly memory + */ +void +snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen) +{ + if (ocstr != NULL) { + sysname = ocstr; + sysname_len = ocstrlen; + sysname_wr = NULL; + sysname_wr_len = NULL; + sysname_bufsize = 0; + } +} + +/** + * @ingroup snmp_mib2 + * Initializes sysLocation pointers + * + * @param ocstr if non-NULL then copy str pointer + * @param ocstrlen points to string length, excluding zero terminator. + * if set to NULL it is assumed that ocstr is NULL-terminated. + * @param bufsize size of the buffer in bytes. + * (this is required because the buffer can be overwritten by snmp-set) + * if ocstrlen is NULL buffer needs space for terminating 0 byte. + * otherwise complete buffer is used for string. + * if bufsize is set to 0, the value is regarded as read-only. + */ +void +snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize) +{ + if (ocstr != NULL) { + syslocation = ocstr; + syslocation_wr = ocstr; + syslocation_len = ocstrlen; + syslocation_wr_len = ocstrlen; + syslocation_bufsize = bufsize; + } +} + +/** + * @ingroup snmp_mib2 + * see \ref snmp_mib2_set_syslocation but set pointer to readonly memory + */ +void +snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen) +{ + if (ocstr != NULL) { + syslocation = ocstr; + syslocation_len = ocstrlen; + syslocation_wr = NULL; + syslocation_wr_len = NULL; + syslocation_bufsize = 0; + } +} + + +static s16_t +system_get_value(const struct snmp_scalar_array_node_def *node, void *value) +{ + const u8_t* var = NULL; + const s16_t* var_len; + u16_t result; + + switch (node->oid) { + case 1: /* sysDescr */ + var = sysdescr; + var_len = (const s16_t*)sysdescr_len; + break; + case 2: /* sysObjectID */ + { + const struct snmp_obj_id* dev_enterprise_oid = snmp_get_device_enterprise_oid(); + MEMCPY(value, dev_enterprise_oid->id, dev_enterprise_oid->len * sizeof(u32_t)); + return dev_enterprise_oid->len * sizeof(u32_t); + } + case 3: /* sysUpTime */ + MIB2_COPY_SYSUPTIME_TO((u32_t*)value); + return sizeof(u32_t); + case 4: /* sysContact */ + var = syscontact; + var_len = (const s16_t*)syscontact_len; + break; + case 5: /* sysName */ + var = sysname; + var_len = (const s16_t*)sysname_len; + break; + case 6: /* sysLocation */ + var = syslocation; + var_len = (const s16_t*)syslocation_len; + break; + case 7: /* sysServices */ + *(s32_t*)value = SNMP_SYSSERVICES; + return sizeof(s32_t); + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("system_get_value(): unknown id: %"S32_F"\n", node->oid)); + return 0; + } + + /* handle string values (OID 1,4,5 and 6) */ + LWIP_ASSERT("", (value != NULL)); + if (var_len == NULL) { + result = (s16_t)strlen((const char*)var); + } else { + result = *var_len; + } + MEMCPY(value, var, result); + return result; +} + +static snmp_err_t +system_set_test(const struct snmp_scalar_array_node_def *node, u16_t len, void *value) +{ + snmp_err_t ret = SNMP_ERR_WRONGVALUE; + const u16_t* var_bufsize = NULL; + const u16_t* var_wr_len; + + LWIP_UNUSED_ARG(value); + + switch (node->oid) { + case 4: /* sysContact */ + var_bufsize = &syscontact_bufsize; + var_wr_len = syscontact_wr_len; + break; + case 5: /* sysName */ + var_bufsize = &sysname_bufsize; + var_wr_len = sysname_wr_len; + break; + case 6: /* sysLocation */ + var_bufsize = &syslocation_bufsize; + var_wr_len = syslocation_wr_len; + break; + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("system_set_test(): unknown id: %"S32_F"\n", node->oid)); + return ret; + } + + /* check if value is writable at all */ + if (*var_bufsize > 0) { + if (var_wr_len == NULL) { + /* we have to take the terminating 0 into account */ + if (len < *var_bufsize) { + ret = SNMP_ERR_NOERROR; + } + } else { + if (len <= *var_bufsize) { + ret = SNMP_ERR_NOERROR; + } + } + } else { + ret = SNMP_ERR_NOTWRITABLE; + } + + return ret; +} + +static snmp_err_t +system_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void *value) +{ + u8_t* var_wr = NULL; + u16_t* var_wr_len; + + switch (node->oid) { + case 4: /* sysContact */ + var_wr = syscontact_wr; + var_wr_len = syscontact_wr_len; + break; + case 5: /* sysName */ + var_wr = sysname_wr; + var_wr_len = sysname_wr_len; + break; + case 6: /* sysLocation */ + var_wr = syslocation_wr; + var_wr_len = syslocation_wr_len; + break; + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("system_set_value(): unknown id: %"S32_F"\n", node->oid)); + return SNMP_ERR_GENERROR; + } + + /* no need to check size of target buffer, this was already done in set_test method */ + LWIP_ASSERT("", var_wr != NULL); + MEMCPY(var_wr, value, len); + + if (var_wr_len == NULL) { + /* add terminating 0 */ + var_wr[len] = 0; + } else { + *var_wr_len = len; + } + + return SNMP_ERR_NOERROR; +} + +static const struct snmp_scalar_array_node_def system_nodes[] = { + {1, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_ONLY}, /* sysDescr */ + {2, SNMP_ASN1_TYPE_OBJECT_ID, SNMP_NODE_INSTANCE_READ_ONLY}, /* sysObjectID */ + {3, SNMP_ASN1_TYPE_TIMETICKS, SNMP_NODE_INSTANCE_READ_ONLY}, /* sysUpTime */ + {4, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_WRITE}, /* sysContact */ + {5, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_WRITE}, /* sysName */ + {6, SNMP_ASN1_TYPE_OCTET_STRING, SNMP_NODE_INSTANCE_READ_WRITE}, /* sysLocation */ + {7, SNMP_ASN1_TYPE_INTEGER, SNMP_NODE_INSTANCE_READ_ONLY} /* sysServices */ +}; + +const struct snmp_scalar_array_node snmp_mib2_system_node = SNMP_SCALAR_CREATE_ARRAY_NODE(1, system_nodes, system_get_value, system_set_test, system_set_value); + +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_tcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_tcp.c new file mode 100644 index 0000000..21f6965 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_tcp.c @@ -0,0 +1,594 @@ +/** + * @file + * Management Information Base II (RFC1213) TCP objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/tcp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/stats.h" + +#include + +#if LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_TCP + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + +/* --- tcp .1.3.6.1.2.1.6 ----------------------------------------------------- */ + +static s16_t +tcp_get_value(struct snmp_node_instance* instance, void* value) +{ + u32_t *uint_ptr = (u32_t*)value; + s32_t *sint_ptr = (s32_t*)value; + + switch (instance->node->oid) { + case 1: /* tcpRtoAlgorithm, vanj(4) */ + *sint_ptr = 4; + return sizeof(*sint_ptr); + case 2: /* tcpRtoMin */ + /* @todo not the actual value, a guess, + needs to be calculated */ + *sint_ptr = 1000; + return sizeof(*sint_ptr); + case 3: /* tcpRtoMax */ + /* @todo not the actual value, a guess, + needs to be calculated */ + *sint_ptr = 60000; + return sizeof(*sint_ptr); + case 4: /* tcpMaxConn */ + *sint_ptr = MEMP_NUM_TCP_PCB; + return sizeof(*sint_ptr); + case 5: /* tcpActiveOpens */ + *uint_ptr = STATS_GET(mib2.tcpactiveopens); + return sizeof(*uint_ptr); + case 6: /* tcpPassiveOpens */ + *uint_ptr = STATS_GET(mib2.tcppassiveopens); + return sizeof(*uint_ptr); + case 7: /* tcpAttemptFails */ + *uint_ptr = STATS_GET(mib2.tcpattemptfails); + return sizeof(*uint_ptr); + case 8: /* tcpEstabResets */ + *uint_ptr = STATS_GET(mib2.tcpestabresets); + return sizeof(*uint_ptr); + case 9: /* tcpCurrEstab */ + { + u16_t tcpcurrestab = 0; + struct tcp_pcb *pcb = tcp_active_pcbs; + while (pcb != NULL) { + if ((pcb->state == ESTABLISHED) || + (pcb->state == CLOSE_WAIT)) { + tcpcurrestab++; + } + pcb = pcb->next; + } + *uint_ptr = tcpcurrestab; + } + return sizeof(*uint_ptr); + case 10: /* tcpInSegs */ + *uint_ptr = STATS_GET(mib2.tcpinsegs); + return sizeof(*uint_ptr); + case 11: /* tcpOutSegs */ + *uint_ptr = STATS_GET(mib2.tcpoutsegs); + return sizeof(*uint_ptr); + case 12: /* tcpRetransSegs */ + *uint_ptr = STATS_GET(mib2.tcpretranssegs); + return sizeof(*uint_ptr); + case 14: /* tcpInErrs */ + *uint_ptr = STATS_GET(mib2.tcpinerrs); + return sizeof(*uint_ptr); + case 15: /* tcpOutRsts */ + *uint_ptr = STATS_GET(mib2.tcpoutrsts); + return sizeof(*uint_ptr); + case 17: /* tcpHCInSegs */ + memset(value, 0, 2*sizeof(u32_t)); /* not supported */ + return 2*sizeof(u32_t); + case 18: /* tcpHCOutSegs */ + memset(value, 0, 2*sizeof(u32_t)); /* not supported */ + return 2*sizeof(u32_t); + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("tcp_get_value(): unknown id: %"S32_F"\n", instance->node->oid)); + break; + } + + return 0; +} + +/* --- tcpConnTable --- */ + +#if LWIP_IPV4 + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range tcp_ConnTable_oid_ranges[] = { + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff }, /* IP D */ + { 0, 0xffff }, /* Port */ + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff }, /* IP D */ + { 0, 0xffff } /* Port */ +}; + +static snmp_err_t +tcp_ConnTable_get_cell_value_core(struct tcp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) +{ + LWIP_UNUSED_ARG(value_len); + + /* value */ + switch (*column) { + case 1: /* tcpConnState */ + value->u32 = pcb->state + 1; + break; + case 2: /* tcpConnLocalAddress */ + value->u32 = ip_2_ip4(&pcb->local_ip)->addr; + break; + case 3: /* tcpConnLocalPort */ + value->u32 = pcb->local_port; + break; + case 4: /* tcpConnRemAddress */ + if (pcb->state == LISTEN) { + value->u32 = IP4_ADDR_ANY4->addr; + } else { + value->u32 = ip_2_ip4(&pcb->remote_ip)->addr; + } + break; + case 5: /* tcpConnRemPort */ + if (pcb->state == LISTEN) { + value->u32 = 0; + } else { + value->u32 = pcb->remote_port; + } + break; + default: + LWIP_ASSERT("invalid id", 0); + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +tcp_ConnTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + u8_t i; + ip4_addr_t local_ip; + ip4_addr_t remote_ip; + u16_t local_port; + u16_t remote_port; + struct tcp_pcb *pcb; + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, tcp_ConnTable_oid_ranges, LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get IPs and ports from incoming OID */ + snmp_oid_to_ip4(&row_oid[0], &local_ip); /* we know it succeeds because of oid_in_range check above */ + local_port = (u16_t)row_oid[4]; + snmp_oid_to_ip4(&row_oid[5], &remote_ip); /* we know it succeeds because of oid_in_range check above */ + remote_port = (u16_t)row_oid[9]; + + /* find tcp_pcb with requested ips and ports */ + for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) { + pcb = *tcp_pcb_lists[i]; + + while (pcb != NULL) { + /* do local IP and local port match? */ + if (IP_IS_V4_VAL(pcb->local_ip) && + ip4_addr_cmp(&local_ip, ip_2_ip4(&pcb->local_ip)) && (local_port == pcb->local_port)) { + + /* PCBs in state LISTEN are not connected and have no remote_ip or remote_port */ + if (pcb->state == LISTEN) { + if (ip4_addr_cmp(&remote_ip, IP4_ADDR_ANY4) && (remote_port == 0)) { + /* fill in object properties */ + return tcp_ConnTable_get_cell_value_core(pcb, column, value, value_len); + } + } else { + if (IP_IS_V4_VAL(pcb->remote_ip) && + ip4_addr_cmp(&remote_ip, ip_2_ip4(&pcb->remote_ip)) && (remote_port == pcb->remote_port)) { + /* fill in object properties */ + return tcp_ConnTable_get_cell_value_core(pcb, column, value, value_len); + } + } + } + + pcb = pcb->next; + } + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +tcp_ConnTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + u8_t i; + struct tcp_pcb *pcb; + struct snmp_next_oid_state state; + u32_t result_temp[LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges)]; + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges)); + + /* iterate over all possible OIDs to find the next one */ + for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) { + pcb = *tcp_pcb_lists[i]; + while (pcb != NULL) { + u32_t test_oid[LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges)]; + + if (IP_IS_V4_VAL(pcb->local_ip)) { + snmp_ip4_to_oid(ip_2_ip4(&pcb->local_ip), &test_oid[0]); + test_oid[4] = pcb->local_port; + + /* PCBs in state LISTEN are not connected and have no remote_ip or remote_port */ + if (pcb->state == LISTEN) { + snmp_ip4_to_oid(IP4_ADDR_ANY4, &test_oid[5]); + test_oid[9] = 0; + } else { + if (IP_IS_V6_VAL(pcb->remote_ip)) { /* should never happen */ + continue; + } + snmp_ip4_to_oid(ip_2_ip4(&pcb->remote_ip), &test_oid[5]); + test_oid[9] = pcb->remote_port; + } + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges), pcb); + } + + pcb = pcb->next; + } + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return tcp_ConnTable_get_cell_value_core((struct tcp_pcb*)state.reference, column, value, value_len); + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +#endif /* LWIP_IPV4 */ + +/* --- tcpConnectionTable --- */ + +static snmp_err_t +tcp_ConnectionTable_get_cell_value_core(const u32_t* column, struct tcp_pcb *pcb, union snmp_variant_value* value) +{ + /* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */ + switch (*column) { + case 7: /* tcpConnectionState */ + value->u32 = pcb->state + 1; + break; + case 8: /* tcpConnectionProcess */ + value->u32 = 0; /* not supported */ + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +tcp_ConnectionTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip_addr_t local_ip, remote_ip; + u16_t local_port, remote_port; + struct tcp_pcb *pcb; + u8_t idx = 0; + u8_t i; + struct tcp_pcb ** const tcp_pcb_nonlisten_lists[] = {&tcp_bound_pcbs, &tcp_active_pcbs, &tcp_tw_pcbs}; + + LWIP_UNUSED_ARG(value_len); + + /* tcpConnectionLocalAddressType + tcpConnectionLocalAddress + tcpConnectionLocalPort */ + idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &local_ip, &local_port); + if (idx == 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* tcpConnectionRemAddressType + tcpConnectionRemAddress + tcpConnectionRemPort */ + idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &remote_ip, &remote_port); + if (idx == 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* find tcp_pcb with requested ip and port*/ + for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_nonlisten_lists); i++) { + pcb = *tcp_pcb_nonlisten_lists[i]; + + while (pcb != NULL) { + if (ip_addr_cmp(&local_ip, &pcb->local_ip) && + (local_port == pcb->local_port) && + ip_addr_cmp(&remote_ip, &pcb->remote_ip) && + (remote_port == pcb->remote_port)) { + /* fill in object properties */ + return tcp_ConnectionTable_get_cell_value_core(column, pcb, value); + } + pcb = pcb->next; + } + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +tcp_ConnectionTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct tcp_pcb *pcb; + struct snmp_next_oid_state state; + /* 1x tcpConnectionLocalAddressType + 1x OID len + 16x tcpConnectionLocalAddress + 1x tcpConnectionLocalPort + * 1x tcpConnectionRemAddressType + 1x OID len + 16x tcpConnectionRemAddress + 1x tcpConnectionRemPort */ + u32_t result_temp[38]; + u8_t i; + struct tcp_pcb ** const tcp_pcb_nonlisten_lists[] = {&tcp_bound_pcbs, &tcp_active_pcbs, &tcp_tw_pcbs}; + + LWIP_UNUSED_ARG(value_len); + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(result_temp)); + + /* iterate over all possible OIDs to find the next one */ + for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_nonlisten_lists); i++) { + pcb = *tcp_pcb_nonlisten_lists[i]; + + while (pcb != NULL) { + u8_t idx = 0; + u32_t test_oid[LWIP_ARRAYSIZE(result_temp)]; + + /* tcpConnectionLocalAddressType + tcpConnectionLocalAddress + tcpConnectionLocalPort */ + idx += snmp_ip_port_to_oid(&pcb->local_ip, pcb->local_port, &test_oid[idx]); + + /* tcpConnectionRemAddressType + tcpConnectionRemAddress + tcpConnectionRemPort */ + idx += snmp_ip_port_to_oid(&pcb->remote_ip, pcb->remote_port, &test_oid[idx]); + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, idx, pcb); + + pcb = pcb->next; + } + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return tcp_ConnectionTable_get_cell_value_core(column, (struct tcp_pcb*)state.reference, value); + } else { + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; + } +} + +/* --- tcpListenerTable --- */ + +static snmp_err_t +tcp_ListenerTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value) +{ + /* all items except tcpListenerProcess are declared as not-accessible */ + switch (*column) { + case 4: /* tcpListenerProcess */ + value->u32 = 0; /* not supported */ + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +tcp_ListenerTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip_addr_t local_ip; + u16_t local_port; + struct tcp_pcb_listen *pcb; + u8_t idx = 0; + + LWIP_UNUSED_ARG(value_len); + + /* tcpListenerLocalAddressType + tcpListenerLocalAddress + tcpListenerLocalPort */ + idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &local_ip, &local_port); + if (idx == 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* find tcp_pcb with requested ip and port*/ + pcb = tcp_listen_pcbs.listen_pcbs; + while (pcb != NULL) { + if (ip_addr_cmp(&local_ip, &pcb->local_ip) && + (local_port == pcb->local_port)) { + /* fill in object properties */ + return tcp_ListenerTable_get_cell_value_core(column, value); + } + pcb = pcb->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +tcp_ListenerTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct tcp_pcb_listen *pcb; + struct snmp_next_oid_state state; + /* 1x tcpListenerLocalAddressType + 1x OID len + 16x tcpListenerLocalAddress + 1x tcpListenerLocalPort */ + u32_t result_temp[19]; + + LWIP_UNUSED_ARG(value_len); + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(result_temp)); + + /* iterate over all possible OIDs to find the next one */ + pcb = tcp_listen_pcbs.listen_pcbs; + while (pcb != NULL) { + u8_t idx = 0; + u32_t test_oid[LWIP_ARRAYSIZE(result_temp)]; + + /* tcpListenerLocalAddressType + tcpListenerLocalAddress + tcpListenerLocalPort */ + idx += snmp_ip_port_to_oid(&pcb->local_ip, pcb->local_port, &test_oid[idx]); + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, idx, NULL); + + pcb = pcb->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return tcp_ListenerTable_get_cell_value_core(column, value); + } else { + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; + } +} + +static const struct snmp_scalar_node tcp_RtoAlgorithm = SNMP_SCALAR_CREATE_NODE_READONLY(1, SNMP_ASN1_TYPE_INTEGER, tcp_get_value); +static const struct snmp_scalar_node tcp_RtoMin = SNMP_SCALAR_CREATE_NODE_READONLY(2, SNMP_ASN1_TYPE_INTEGER, tcp_get_value); +static const struct snmp_scalar_node tcp_RtoMax = SNMP_SCALAR_CREATE_NODE_READONLY(3, SNMP_ASN1_TYPE_INTEGER, tcp_get_value); +static const struct snmp_scalar_node tcp_MaxConn = SNMP_SCALAR_CREATE_NODE_READONLY(4, SNMP_ASN1_TYPE_INTEGER, tcp_get_value); +static const struct snmp_scalar_node tcp_ActiveOpens = SNMP_SCALAR_CREATE_NODE_READONLY(5, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_PassiveOpens = SNMP_SCALAR_CREATE_NODE_READONLY(6, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_AttemptFails = SNMP_SCALAR_CREATE_NODE_READONLY(7, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_EstabResets = SNMP_SCALAR_CREATE_NODE_READONLY(8, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_CurrEstab = SNMP_SCALAR_CREATE_NODE_READONLY(9, SNMP_ASN1_TYPE_GAUGE, tcp_get_value); +static const struct snmp_scalar_node tcp_InSegs = SNMP_SCALAR_CREATE_NODE_READONLY(10, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_OutSegs = SNMP_SCALAR_CREATE_NODE_READONLY(11, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_RetransSegs = SNMP_SCALAR_CREATE_NODE_READONLY(12, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_InErrs = SNMP_SCALAR_CREATE_NODE_READONLY(14, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_OutRsts = SNMP_SCALAR_CREATE_NODE_READONLY(15, SNMP_ASN1_TYPE_COUNTER, tcp_get_value); +static const struct snmp_scalar_node tcp_HCInSegs = SNMP_SCALAR_CREATE_NODE_READONLY(17, SNMP_ASN1_TYPE_COUNTER64, tcp_get_value); +static const struct snmp_scalar_node tcp_HCOutSegs = SNMP_SCALAR_CREATE_NODE_READONLY(18, SNMP_ASN1_TYPE_COUNTER64, tcp_get_value); + +#if LWIP_IPV4 +static const struct snmp_table_simple_col_def tcp_ConnTable_columns[] = { + { 1, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnState */ + { 2, SNMP_ASN1_TYPE_IPADDR, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnLocalAddress */ + { 3, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnLocalPort */ + { 4, SNMP_ASN1_TYPE_IPADDR, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnRemAddress */ + { 5, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpConnRemPort */ +}; + +static const struct snmp_table_simple_node tcp_ConnTable = SNMP_TABLE_CREATE_SIMPLE(13, tcp_ConnTable_columns, tcp_ConnTable_get_cell_value, tcp_ConnTable_get_next_cell_instance_and_value); +#endif /* LWIP_IPV4 */ + +static const struct snmp_table_simple_col_def tcp_ConnectionTable_columns[] = { + /* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */ + { 7, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnectionState */ + { 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpConnectionProcess */ +}; + +static const struct snmp_table_simple_node tcp_ConnectionTable = SNMP_TABLE_CREATE_SIMPLE(19, tcp_ConnectionTable_columns, tcp_ConnectionTable_get_cell_value, tcp_ConnectionTable_get_next_cell_instance_and_value); + + +static const struct snmp_table_simple_col_def tcp_ListenerTable_columns[] = { + /* all items except tcpListenerProcess are declared as not-accessible */ + { 4, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpListenerProcess */ +}; + +static const struct snmp_table_simple_node tcp_ListenerTable = SNMP_TABLE_CREATE_SIMPLE(20, tcp_ListenerTable_columns, tcp_ListenerTable_get_cell_value, tcp_ListenerTable_get_next_cell_instance_and_value); + +/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ +CREATE_LWIP_SYNC_NODE( 1, tcp_RtoAlgorithm) +CREATE_LWIP_SYNC_NODE( 2, tcp_RtoMin) +CREATE_LWIP_SYNC_NODE( 3, tcp_RtoMax) +CREATE_LWIP_SYNC_NODE( 4, tcp_MaxConn) +CREATE_LWIP_SYNC_NODE( 5, tcp_ActiveOpens) +CREATE_LWIP_SYNC_NODE( 6, tcp_PassiveOpens) +CREATE_LWIP_SYNC_NODE( 7, tcp_AttemptFails) +CREATE_LWIP_SYNC_NODE( 8, tcp_EstabResets) +CREATE_LWIP_SYNC_NODE( 9, tcp_CurrEstab) +CREATE_LWIP_SYNC_NODE(10, tcp_InSegs) +CREATE_LWIP_SYNC_NODE(11, tcp_OutSegs) +CREATE_LWIP_SYNC_NODE(12, tcp_RetransSegs) +#if LWIP_IPV4 +CREATE_LWIP_SYNC_NODE(13, tcp_ConnTable) +#endif /* LWIP_IPV4 */ +CREATE_LWIP_SYNC_NODE(14, tcp_InErrs) +CREATE_LWIP_SYNC_NODE(15, tcp_OutRsts) +CREATE_LWIP_SYNC_NODE(17, tcp_HCInSegs) +CREATE_LWIP_SYNC_NODE(18, tcp_HCOutSegs) +CREATE_LWIP_SYNC_NODE(19, tcp_ConnectionTable) +CREATE_LWIP_SYNC_NODE(20, tcp_ListenerTable) + +static const struct snmp_node* const tcp_nodes[] = { + &SYNC_NODE_NAME(tcp_RtoAlgorithm).node.node, + &SYNC_NODE_NAME(tcp_RtoMin).node.node, + &SYNC_NODE_NAME(tcp_RtoMax).node.node, + &SYNC_NODE_NAME(tcp_MaxConn).node.node, + &SYNC_NODE_NAME(tcp_ActiveOpens).node.node, + &SYNC_NODE_NAME(tcp_PassiveOpens).node.node, + &SYNC_NODE_NAME(tcp_AttemptFails).node.node, + &SYNC_NODE_NAME(tcp_EstabResets).node.node, + &SYNC_NODE_NAME(tcp_CurrEstab).node.node, + &SYNC_NODE_NAME(tcp_InSegs).node.node, + &SYNC_NODE_NAME(tcp_OutSegs).node.node, + &SYNC_NODE_NAME(tcp_RetransSegs).node.node, +#if LWIP_IPV4 + &SYNC_NODE_NAME(tcp_ConnTable).node.node, +#endif /* LWIP_IPV4 */ + &SYNC_NODE_NAME(tcp_InErrs).node.node, + &SYNC_NODE_NAME(tcp_OutRsts).node.node, + &SYNC_NODE_NAME(tcp_HCInSegs).node.node, + &SYNC_NODE_NAME(tcp_HCOutSegs).node.node, + &SYNC_NODE_NAME(tcp_ConnectionTable).node.node, + &SYNC_NODE_NAME(tcp_ListenerTable).node.node +}; + +const struct snmp_tree_node snmp_mib2_tcp_root = SNMP_CREATE_TREE_NODE(6, tcp_nodes); +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_TCP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c new file mode 100644 index 0000000..6a983df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c @@ -0,0 +1,357 @@ +/** + * @file + * Management Information Base II (RFC1213) UDP objects and functions. + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + * Christiaan Simons + */ + +#include "lwip/snmp.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_mib2.h" +#include "lwip/apps/snmp_table.h" +#include "lwip/apps/snmp_scalar.h" +#include "lwip/udp.h" +#include "lwip/stats.h" + +#include + +#if LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_UDP + +#if SNMP_USE_NETCONN +#define SYNC_NODE_NAME(node_name) node_name ## _synced +#define CREATE_LWIP_SYNC_NODE(oid, node_name) \ + static const struct snmp_threadsync_node node_name ## _synced = SNMP_CREATE_THREAD_SYNC_NODE(oid, &node_name.node, &snmp_mib2_lwip_locks); +#else +#define SYNC_NODE_NAME(node_name) node_name +#define CREATE_LWIP_SYNC_NODE(oid, node_name) +#endif + +/* --- udp .1.3.6.1.2.1.7 ----------------------------------------------------- */ + +static s16_t +udp_get_value(struct snmp_node_instance* instance, void* value) +{ + u32_t *uint_ptr = (u32_t*)value; + + switch (instance->node->oid) { + case 1: /* udpInDatagrams */ + *uint_ptr = STATS_GET(mib2.udpindatagrams); + return sizeof(*uint_ptr); + case 2: /* udpNoPorts */ + *uint_ptr = STATS_GET(mib2.udpnoports); + return sizeof(*uint_ptr); + case 3: /* udpInErrors */ + *uint_ptr = STATS_GET(mib2.udpinerrors); + return sizeof(*uint_ptr); + case 4: /* udpOutDatagrams */ + *uint_ptr = STATS_GET(mib2.udpoutdatagrams); + return sizeof(*uint_ptr); + case 8: /* udpHCInDatagrams */ + memset(value, 0, 2*sizeof(u32_t)); /* not supported */ + return 2*sizeof(u32_t); + case 9: /* udpHCOutDatagrams */ + memset(value, 0, 2*sizeof(u32_t)); /* not supported */ + return 2*sizeof(u32_t); + default: + LWIP_DEBUGF(SNMP_MIB_DEBUG,("udp_get_value(): unknown id: %"S32_F"\n", instance->node->oid)); + break; + } + + return 0; +} + +/* --- udpEndpointTable --- */ + +static snmp_err_t +udp_endpointTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value) +{ + /* all items except udpEndpointProcess are declared as not-accessible */ + switch (*column) { + case 8: /* udpEndpointProcess */ + value->u32 = 0; /* not supported */ + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip_addr_t local_ip, remote_ip; + u16_t local_port, remote_port; + struct udp_pcb *pcb; + u8_t idx = 0; + + LWIP_UNUSED_ARG(value_len); + + /* udpEndpointLocalAddressType + udpEndpointLocalAddress + udpEndpointLocalPort */ + idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &local_ip, &local_port); + if (idx == 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* udpEndpointRemoteAddressType + udpEndpointRemoteAddress + udpEndpointRemotePort */ + idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &remote_ip, &remote_port); + if (idx == 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* udpEndpointInstance */ + if (row_oid_len < (idx+1)) { + return SNMP_ERR_NOSUCHINSTANCE; + } + if (row_oid[idx] != 0) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* find udp_pcb with requested ip and port*/ + pcb = udp_pcbs; + while (pcb != NULL) { + if (ip_addr_cmp(&local_ip, &pcb->local_ip) && + (local_port == pcb->local_port) && + ip_addr_cmp(&remote_ip, &pcb->remote_ip) && + (remote_port == pcb->remote_port)) { + /* fill in object properties */ + return udp_endpointTable_get_cell_value_core(column, value); + } + pcb = pcb->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +udp_endpointTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct udp_pcb *pcb; + struct snmp_next_oid_state state; + /* 1x udpEndpointLocalAddressType + 1x OID len + 16x udpEndpointLocalAddress + 1x udpEndpointLocalPort + + * 1x udpEndpointRemoteAddressType + 1x OID len + 16x udpEndpointRemoteAddress + 1x udpEndpointRemotePort + + * 1x udpEndpointInstance = 39 + */ + u32_t result_temp[39]; + + LWIP_UNUSED_ARG(value_len); + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(result_temp)); + + /* iterate over all possible OIDs to find the next one */ + pcb = udp_pcbs; + while (pcb != NULL) { + u32_t test_oid[LWIP_ARRAYSIZE(result_temp)]; + u8_t idx = 0; + + /* udpEndpointLocalAddressType + udpEndpointLocalAddress + udpEndpointLocalPort */ + idx += snmp_ip_port_to_oid(&pcb->local_ip, pcb->local_port, &test_oid[idx]); + + /* udpEndpointRemoteAddressType + udpEndpointRemoteAddress + udpEndpointRemotePort */ + idx += snmp_ip_port_to_oid(&pcb->remote_ip, pcb->remote_port, &test_oid[idx]); + + test_oid[idx] = 0; /* udpEndpointInstance */ + idx++; + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, idx, NULL); + + pcb = pcb->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return udp_endpointTable_get_cell_value_core(column, value); + } else { + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; + } +} + +/* --- udpTable --- */ + +#if LWIP_IPV4 + +/* list of allowed value ranges for incoming OID */ +static const struct snmp_oid_range udp_Table_oid_ranges[] = { + { 0, 0xff }, /* IP A */ + { 0, 0xff }, /* IP B */ + { 0, 0xff }, /* IP C */ + { 0, 0xff }, /* IP D */ + { 1, 0xffff } /* Port */ +}; + +static snmp_err_t +udp_Table_get_cell_value_core(struct udp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) +{ + LWIP_UNUSED_ARG(value_len); + + switch (*column) { + case 1: /* udpLocalAddress */ + /* set reference to PCB local IP and return a generic node that copies IP4 addresses */ + value->u32 = ip_2_ip4(&pcb->local_ip)->addr; + break; + case 2: /* udpLocalPort */ + /* set reference to PCB local port and return a generic node that copies u16_t values */ + value->u32 = pcb->local_port; + break; + default: + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static snmp_err_t +udp_Table_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) +{ + ip4_addr_t ip; + u16_t port; + struct udp_pcb *pcb; + + /* check if incoming OID length and if values are in plausible range */ + if (!snmp_oid_in_range(row_oid, row_oid_len, udp_Table_oid_ranges, LWIP_ARRAYSIZE(udp_Table_oid_ranges))) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + /* get IP and port from incoming OID */ + snmp_oid_to_ip4(&row_oid[0], &ip); /* we know it succeeds because of oid_in_range check above */ + port = (u16_t)row_oid[4]; + + /* find udp_pcb with requested ip and port*/ + pcb = udp_pcbs; + while (pcb != NULL) { + if (IP_IS_V4_VAL(pcb->local_ip)) { + if (ip4_addr_cmp(&ip, ip_2_ip4(&pcb->local_ip)) && (port == pcb->local_port)) { + /* fill in object properties */ + return udp_Table_get_cell_value_core(pcb, column, value, value_len); + } + } + pcb = pcb->next; + } + + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; +} + +static snmp_err_t +udp_Table_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) +{ + struct udp_pcb *pcb; + struct snmp_next_oid_state state; + u32_t result_temp[LWIP_ARRAYSIZE(udp_Table_oid_ranges)]; + + /* init struct to search next oid */ + snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(udp_Table_oid_ranges)); + + /* iterate over all possible OIDs to find the next one */ + pcb = udp_pcbs; + while (pcb != NULL) { + u32_t test_oid[LWIP_ARRAYSIZE(udp_Table_oid_ranges)]; + + if (IP_IS_V4_VAL(pcb->local_ip)) { + snmp_ip4_to_oid(ip_2_ip4(&pcb->local_ip), &test_oid[0]); + test_oid[4] = pcb->local_port; + + /* check generated OID: is it a candidate for the next one? */ + snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(udp_Table_oid_ranges), pcb); + } + + pcb = pcb->next; + } + + /* did we find a next one? */ + if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) { + snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len); + /* fill in object properties */ + return udp_Table_get_cell_value_core((struct udp_pcb*)state.reference, column, value, value_len); + } else { + /* not found */ + return SNMP_ERR_NOSUCHINSTANCE; + } +} + +#endif /* LWIP_IPV4 */ + +static const struct snmp_scalar_node udp_inDatagrams = SNMP_SCALAR_CREATE_NODE_READONLY(1, SNMP_ASN1_TYPE_COUNTER, udp_get_value); +static const struct snmp_scalar_node udp_noPorts = SNMP_SCALAR_CREATE_NODE_READONLY(2, SNMP_ASN1_TYPE_COUNTER, udp_get_value); +static const struct snmp_scalar_node udp_inErrors = SNMP_SCALAR_CREATE_NODE_READONLY(3, SNMP_ASN1_TYPE_COUNTER, udp_get_value); +static const struct snmp_scalar_node udp_outDatagrams = SNMP_SCALAR_CREATE_NODE_READONLY(4, SNMP_ASN1_TYPE_COUNTER, udp_get_value); +static const struct snmp_scalar_node udp_HCInDatagrams = SNMP_SCALAR_CREATE_NODE_READONLY(8, SNMP_ASN1_TYPE_COUNTER64, udp_get_value); +static const struct snmp_scalar_node udp_HCOutDatagrams = SNMP_SCALAR_CREATE_NODE_READONLY(9, SNMP_ASN1_TYPE_COUNTER64, udp_get_value); + +#if LWIP_IPV4 +static const struct snmp_table_simple_col_def udp_Table_columns[] = { + { 1, SNMP_ASN1_TYPE_IPADDR, SNMP_VARIANT_VALUE_TYPE_U32 }, /* udpLocalAddress */ + { 2, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 } /* udpLocalPort */ +}; +static const struct snmp_table_simple_node udp_Table = SNMP_TABLE_CREATE_SIMPLE(5, udp_Table_columns, udp_Table_get_cell_value, udp_Table_get_next_cell_instance_and_value); +#endif /* LWIP_IPV4 */ + +static const struct snmp_table_simple_col_def udp_endpointTable_columns[] = { + /* all items except udpEndpointProcess are declared as not-accessible */ + { 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* udpEndpointProcess */ +}; + +static const struct snmp_table_simple_node udp_endpointTable = SNMP_TABLE_CREATE_SIMPLE(7, udp_endpointTable_columns, udp_endpointTable_get_cell_value, udp_endpointTable_get_next_cell_instance_and_value); + +/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ +CREATE_LWIP_SYNC_NODE(1, udp_inDatagrams) +CREATE_LWIP_SYNC_NODE(2, udp_noPorts) +CREATE_LWIP_SYNC_NODE(3, udp_inErrors) +CREATE_LWIP_SYNC_NODE(4, udp_outDatagrams) +#if LWIP_IPV4 +CREATE_LWIP_SYNC_NODE(5, udp_Table) +#endif /* LWIP_IPV4 */ +CREATE_LWIP_SYNC_NODE(7, udp_endpointTable) +CREATE_LWIP_SYNC_NODE(8, udp_HCInDatagrams) +CREATE_LWIP_SYNC_NODE(9, udp_HCOutDatagrams) + +static const struct snmp_node* const udp_nodes[] = { + &SYNC_NODE_NAME(udp_inDatagrams).node.node, + &SYNC_NODE_NAME(udp_noPorts).node.node, + &SYNC_NODE_NAME(udp_inErrors).node.node, + &SYNC_NODE_NAME(udp_outDatagrams).node.node, +#if LWIP_IPV4 + &SYNC_NODE_NAME(udp_Table).node.node, +#endif /* LWIP_IPV4 */ + &SYNC_NODE_NAME(udp_endpointTable).node.node, + &SYNC_NODE_NAME(udp_HCInDatagrams).node.node, + &SYNC_NODE_NAME(udp_HCOutDatagrams).node.node +}; + +const struct snmp_tree_node snmp_mib2_udp_root = SNMP_CREATE_TREE_NODE(7, udp_nodes); +#endif /* LWIP_SNMP && SNMP_LWIP_MIB2 && LWIP_UDP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.c new file mode 100644 index 0000000..0cb7ca9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.c @@ -0,0 +1,1668 @@ +/** + * @file + * SNMP message processing (RFC1157). + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel + * Elias Oenal + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "snmp_msg.h" +#include "snmp_asn1.h" +#include "snmp_core_priv.h" +#include "lwip/ip_addr.h" +#include "lwip/stats.h" + +#if LWIP_SNMP_V3 +#include "lwip/apps/snmpv3.h" +#include "snmpv3_priv.h" +#ifdef LWIP_SNMPV3_INCLUDE_ENGINE +#include LWIP_SNMPV3_INCLUDE_ENGINE +#endif +#endif + +#include + +/* public (non-static) constants */ +/** SNMP community string */ +const char *snmp_community = SNMP_COMMUNITY; +/** SNMP community string for write access */ +const char *snmp_community_write = SNMP_COMMUNITY_WRITE; +/** SNMP community string for sending traps */ +const char *snmp_community_trap = SNMP_COMMUNITY_TRAP; + +snmp_write_callback_fct snmp_write_callback = NULL; +void* snmp_write_callback_arg = NULL; + +/** + * @ingroup snmp_core + * Returns current SNMP community string. + * @return current SNMP community string + */ +const char * +snmp_get_community(void) +{ + return snmp_community; +} + +/** + * @ingroup snmp_core + * Sets SNMP community string. + * The string itself (its storage) must be valid throughout the whole life of + * program (or until it is changed to sth else). + * + * @param community is a pointer to new community string + */ +void +snmp_set_community(const char * const community) +{ + LWIP_ASSERT("community string is too long!", strlen(community) <= SNMP_MAX_COMMUNITY_STR_LEN); + snmp_community = community; +} + +/** + * @ingroup snmp_core + * Returns current SNMP write-access community string. + * @return current SNMP write-access community string + */ +const char * +snmp_get_community_write(void) +{ + return snmp_community_write; +} + +/** + * @ingroup snmp_traps + * Returns current SNMP community string used for sending traps. + * @return current SNMP community string used for sending traps + */ +const char * +snmp_get_community_trap(void) +{ + return snmp_community_trap; +} + +/** + * @ingroup snmp_core + * Sets SNMP community string for write-access. + * The string itself (its storage) must be valid throughout the whole life of + * program (or until it is changed to sth else). + * + * @param community is a pointer to new write-access community string + */ +void +snmp_set_community_write(const char * const community) +{ + LWIP_ASSERT("community string must not be NULL", community != NULL); + LWIP_ASSERT("community string is too long!", strlen(community) <= SNMP_MAX_COMMUNITY_STR_LEN); + snmp_community_write = community; +} + +/** + * @ingroup snmp_traps + * Sets SNMP community string used for sending traps. + * The string itself (its storage) must be valid throughout the whole life of + * program (or until it is changed to sth else). + * + * @param community is a pointer to new trap community string + */ +void +snmp_set_community_trap(const char * const community) +{ + LWIP_ASSERT("community string is too long!", strlen(community) <= SNMP_MAX_COMMUNITY_STR_LEN); + snmp_community_trap = community; +} + +/** + * @ingroup snmp_core + * Callback fired on every successful write access + */ +void +snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg) +{ + snmp_write_callback = write_callback; + snmp_write_callback_arg = callback_arg; +} + +/* ----------------------------------------------------------------------- */ +/* forward declarations */ +/* ----------------------------------------------------------------------- */ + +static err_t snmp_process_get_request(struct snmp_request *request); +static err_t snmp_process_getnext_request(struct snmp_request *request); +static err_t snmp_process_getbulk_request(struct snmp_request *request); +static err_t snmp_process_set_request(struct snmp_request *request); + +static err_t snmp_parse_inbound_frame(struct snmp_request *request); +static err_t snmp_prepare_outbound_frame(struct snmp_request *request); +static err_t snmp_complete_outbound_frame(struct snmp_request *request); +static void snmp_execute_write_callbacks(struct snmp_request *request); + + +/* ----------------------------------------------------------------------- */ +/* implementation */ +/* ----------------------------------------------------------------------- */ + +void +snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t port) +{ + err_t err; + struct snmp_request request; + + memset(&request, 0, sizeof(request)); + request.handle = handle; + request.source_ip = source_ip; + request.source_port = port; + request.inbound_pbuf = p; + + snmp_stats.inpkts++; + + err = snmp_parse_inbound_frame(&request); + if (err == ERR_OK) { + err = snmp_prepare_outbound_frame(&request); + if (err == ERR_OK) { + + if (request.error_status == SNMP_ERR_NOERROR) { + /* only process frame if we do not already have an error to return (e.g. all readonly) */ + if (request.request_type == SNMP_ASN1_CONTEXT_PDU_GET_REQ) { + err = snmp_process_get_request(&request); + } else if (request.request_type == SNMP_ASN1_CONTEXT_PDU_GET_NEXT_REQ) { + err = snmp_process_getnext_request(&request); + } else if (request.request_type == SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ) { + err = snmp_process_getbulk_request(&request); + } else if (request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) { + err = snmp_process_set_request(&request); + } + } + + if (err == ERR_OK) { + err = snmp_complete_outbound_frame(&request); + + if (err == ERR_OK) { + err = snmp_sendto(request.handle, request.outbound_pbuf, request.source_ip, request.source_port); + + if ((request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) + && (request.error_status == SNMP_ERR_NOERROR) + && (snmp_write_callback != NULL)) { + /* raise write notification for all written objects */ + snmp_execute_write_callbacks(&request); + } + } + } + } + + if (request.outbound_pbuf != NULL) { + pbuf_free(request.outbound_pbuf); + } + } +} + +static u8_t +snmp_msg_getnext_validate_node_inst(struct snmp_node_instance* node_instance, void* validate_arg) +{ + if (((node_instance->access & SNMP_NODE_INSTANCE_ACCESS_READ) != SNMP_NODE_INSTANCE_ACCESS_READ) || (node_instance->get_value == NULL)) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + if ((node_instance->asn1_type == SNMP_ASN1_TYPE_COUNTER64) && (((struct snmp_request*)validate_arg)->version == SNMP_VERSION_1)) { + /* according to RFC 2089 skip Counter64 objects in GetNext requests from v1 clients */ + return SNMP_ERR_NOSUCHINSTANCE; + } + + return SNMP_ERR_NOERROR; +} + +static void +snmp_process_varbind(struct snmp_request *request, struct snmp_varbind *vb, u8_t get_next) +{ + err_t err; + struct snmp_node_instance node_instance; + memset(&node_instance, 0, sizeof(node_instance)); + + if (get_next) { + struct snmp_obj_id result_oid; + request->error_status = snmp_get_next_node_instance_from_oid(vb->oid.id, vb->oid.len, snmp_msg_getnext_validate_node_inst, request, &result_oid, &node_instance); + + if (request->error_status == SNMP_ERR_NOERROR) { + snmp_oid_assign(&vb->oid, result_oid.id, result_oid.len); + } + } else { + request->error_status = snmp_get_node_instance_from_oid(vb->oid.id, vb->oid.len, &node_instance); + + if (request->error_status == SNMP_ERR_NOERROR) { + /* use 'getnext_validate' method for validation to avoid code duplication (some checks have to be executed here) */ + request->error_status = snmp_msg_getnext_validate_node_inst(&node_instance, request); + + if (request->error_status != SNMP_ERR_NOERROR) { + if (node_instance.release_instance != NULL) { + node_instance.release_instance(&node_instance); + } + } + } + } + + if (request->error_status != SNMP_ERR_NOERROR) { + if (request->error_status >= SNMP_VARBIND_EXCEPTION_OFFSET) { + if ((request->version == SNMP_VERSION_2c) || request->version == SNMP_VERSION_3) { + /* in SNMP v2c a varbind related exception is stored in varbind and not in frame header */ + vb->type = (SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_CLASS_CONTEXT | (request->error_status & SNMP_VARBIND_EXCEPTION_MASK)); + vb->value_len = 0; + + err = snmp_append_outbound_varbind(&(request->outbound_pbuf_stream), vb); + if (err == ERR_OK) { + /* we stored the exception in varbind -> go on */ + request->error_status = SNMP_ERR_NOERROR; + } else if (err == ERR_BUF) { + request->error_status = SNMP_ERR_TOOBIG; + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } + } else { + /* according to RFC 1157/1905, all other errors only return genError */ + request->error_status = SNMP_ERR_GENERROR; + } + } else { + s16_t len = node_instance.get_value(&node_instance, vb->value); + vb->type = node_instance.asn1_type; + + if(len >= 0) { + vb->value_len = (u16_t)len; /* cast is OK because we checked >= 0 above */ + + LWIP_ASSERT("SNMP_MAX_VALUE_SIZE is configured too low", (vb->value_len & ~SNMP_GET_VALUE_RAW_DATA) <= SNMP_MAX_VALUE_SIZE); + err = snmp_append_outbound_varbind(&request->outbound_pbuf_stream, vb); + + if (err == ERR_BUF) { + request->error_status = SNMP_ERR_TOOBIG; + } else if (err != ERR_OK) { + request->error_status = SNMP_ERR_GENERROR; + } + } else { + request->error_status = SNMP_ERR_GENERROR; + } + + if (node_instance.release_instance != NULL) { + node_instance.release_instance(&node_instance); + } + } +} + + +/** + * Service an internal or external event for SNMP GET. + * + * @param request points to the associated message process state + */ +static err_t +snmp_process_get_request(struct snmp_request *request) +{ + snmp_vb_enumerator_err_t err; + struct snmp_varbind vb; + vb.value = request->value_buffer; + + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP get request\n")); + + while (request->error_status == SNMP_ERR_NOERROR) { + err = snmp_vb_enumerator_get_next(&request->inbound_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_OK) { + if ((vb.type == SNMP_ASN1_TYPE_NULL) && (vb.value_len == 0)) { + snmp_process_varbind(request, &vb, 0); + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else if (err == SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) { + /* malformed ASN.1, don't answer */ + return ERR_ARG; + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } + + return ERR_OK; +} + +/** + * Service an internal or external event for SNMP GET. + * + * @param request points to the associated message process state + */ +static err_t +snmp_process_getnext_request(struct snmp_request *request) +{ + snmp_vb_enumerator_err_t err; + struct snmp_varbind vb; + vb.value = request->value_buffer; + + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP get-next request\n")); + + while (request->error_status == SNMP_ERR_NOERROR) { + err = snmp_vb_enumerator_get_next(&request->inbound_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_OK) { + if ((vb.type == SNMP_ASN1_TYPE_NULL) && (vb.value_len == 0)) { + snmp_process_varbind(request, &vb, 1); + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else if (err == SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) { + /* malformed ASN.1, don't answer */ + return ERR_ARG; + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } + + return ERR_OK; +} + +/** + * Service an internal or external event for SNMP GETBULKT. + * + * @param request points to the associated message process state + */ +static err_t +snmp_process_getbulk_request(struct snmp_request *request) +{ + snmp_vb_enumerator_err_t err; + s32_t non_repeaters = request->non_repeaters; + s32_t repetitions; + u16_t repetition_offset = 0; + struct snmp_varbind_enumerator repetition_varbind_enumerator; + struct snmp_varbind vb; + vb.value = request->value_buffer; + + if (SNMP_LWIP_GETBULK_MAX_REPETITIONS > 0) { + repetitions = LWIP_MIN(request->max_repetitions, SNMP_LWIP_GETBULK_MAX_REPETITIONS); + } else { + repetitions = request->max_repetitions; + } + + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP get-bulk request\n")); + + /* process non repeaters and first repetition */ + while (request->error_status == SNMP_ERR_NOERROR) { + if (non_repeaters == 0) { + repetition_offset = request->outbound_pbuf_stream.offset; + + if (repetitions == 0) { + /* do not resolve repeaters when repetitions is set to 0 */ + break; + } + repetitions--; + } + + err = snmp_vb_enumerator_get_next(&request->inbound_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else if (err == SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) { + /* malformed ASN.1, don't answer */ + return ERR_ARG; + } else if ((err != SNMP_VB_ENUMERATOR_ERR_OK) || (vb.type != SNMP_ASN1_TYPE_NULL) || (vb.value_len != 0)) { + request->error_status = SNMP_ERR_GENERROR; + } else { + snmp_process_varbind(request, &vb, 1); + non_repeaters--; + } + } + + /* process repetitions > 1 */ + while ((request->error_status == SNMP_ERR_NOERROR) && (repetitions > 0) && (request->outbound_pbuf_stream.offset != repetition_offset)) { + + u8_t all_endofmibview = 1; + + snmp_vb_enumerator_init(&repetition_varbind_enumerator, request->outbound_pbuf, repetition_offset, request->outbound_pbuf_stream.offset - repetition_offset); + repetition_offset = request->outbound_pbuf_stream.offset; /* for next loop */ + + while (request->error_status == SNMP_ERR_NOERROR) { + vb.value = NULL; /* do NOT decode value (we enumerate outbound buffer here, so all varbinds have values assigned) */ + err = snmp_vb_enumerator_get_next(&repetition_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_OK) { + vb.value = request->value_buffer; + snmp_process_varbind(request, &vb, 1); + + if (request->error_status != SNMP_ERR_NOERROR) { + /* already set correct error-index (here it cannot be taken from inbound varbind enumerator) */ + request->error_index = request->non_repeaters + repetition_varbind_enumerator.varbind_count; + } else if (vb.type != (SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTEXT_VARBIND_END_OF_MIB_VIEW)) { + all_endofmibview = 0; + } + } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else { + LWIP_DEBUGF(SNMP_DEBUG, ("Very strange, we cannot parse the varbind output that we created just before!")); + request->error_status = SNMP_ERR_GENERROR; + request->error_index = request->non_repeaters + repetition_varbind_enumerator.varbind_count; + } + } + + if ((request->error_status == SNMP_ERR_NOERROR) && all_endofmibview) { + /* stop when all varbinds in a loop return EndOfMibView */ + break; + } + + repetitions--; + } + + if (request->error_status == SNMP_ERR_TOOBIG) { + /* for GetBulk it is ok, if not all requested variables fit into the response -> just return the varbinds added so far */ + request->error_status = SNMP_ERR_NOERROR; + } + + return ERR_OK; +} + +/** + * Service an internal or external event for SNMP SET. + * + * @param request points to the associated message process state + */ +static err_t +snmp_process_set_request(struct snmp_request *request) +{ + snmp_vb_enumerator_err_t err; + struct snmp_varbind vb; + vb.value = request->value_buffer; + + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP set request\n")); + + /* perform set test on all objects */ + while (request->error_status == SNMP_ERR_NOERROR) { + err = snmp_vb_enumerator_get_next(&request->inbound_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_OK) { + struct snmp_node_instance node_instance; + memset(&node_instance, 0, sizeof(node_instance)); + + request->error_status = snmp_get_node_instance_from_oid(vb.oid.id, vb.oid.len, &node_instance); + if (request->error_status == SNMP_ERR_NOERROR) { + if (node_instance.asn1_type != vb.type) { + request->error_status = SNMP_ERR_WRONGTYPE; + } else if (((node_instance.access & SNMP_NODE_INSTANCE_ACCESS_WRITE) != SNMP_NODE_INSTANCE_ACCESS_WRITE) || (node_instance.set_value == NULL)) { + request->error_status = SNMP_ERR_NOTWRITABLE; + } else { + if (node_instance.set_test != NULL) { + request->error_status = node_instance.set_test(&node_instance, vb.value_len, vb.value); + } + } + + if (node_instance.release_instance != NULL) { + node_instance.release_instance(&node_instance); + } + } + } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else if (err == SNMP_VB_ENUMERATOR_ERR_INVALIDLENGTH) { + request->error_status = SNMP_ERR_WRONGLENGTH; + } else if (err == SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) { + /* malformed ASN.1, don't answer */ + return ERR_ARG; + } else { + request->error_status = SNMP_ERR_GENERROR; + } + } + + /* perform real set operation on all objects */ + if (request->error_status == SNMP_ERR_NOERROR) { + snmp_vb_enumerator_init(&request->inbound_varbind_enumerator, request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len); + while (request->error_status == SNMP_ERR_NOERROR) { + err = snmp_vb_enumerator_get_next(&request->inbound_varbind_enumerator, &vb); + if (err == SNMP_VB_ENUMERATOR_ERR_OK) { + struct snmp_node_instance node_instance; + memset(&node_instance, 0, sizeof(node_instance)); + request->error_status = snmp_get_node_instance_from_oid(vb.oid.id, vb.oid.len, &node_instance); + if (request->error_status == SNMP_ERR_NOERROR) { + if (node_instance.set_value(&node_instance, vb.value_len, vb.value) != SNMP_ERR_NOERROR) { + if (request->inbound_varbind_enumerator.varbind_count == 1) { + request->error_status = SNMP_ERR_COMMITFAILED; + } else { + /* we cannot undo the set operations done so far */ + request->error_status = SNMP_ERR_UNDOFAILED; + } + } + + if (node_instance.release_instance != NULL) { + node_instance.release_instance(&node_instance); + } + } + } else if (err == SNMP_VB_ENUMERATOR_ERR_EOVB) { + /* no more varbinds in request */ + break; + } else { + /* first time enumerating varbinds work but second time not, although nothing should have changed in between ??? */ + request->error_status = SNMP_ERR_GENERROR; + } + } + } + + return ERR_OK; +} + +#define PARSE_EXEC(code, retValue) \ + if ((code) != ERR_OK) { \ + LWIP_DEBUGF(SNMP_DEBUG, ("Malformed ASN.1 detected.\n")); \ + snmp_stats.inasnparseerrs++; \ + return retValue; \ + } + +#define PARSE_ASSERT(cond, retValue) \ + if (!(cond)) { \ + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP parse assertion failed!: " # cond)); \ + snmp_stats.inasnparseerrs++; \ + return retValue; \ + } + +#define BUILD_EXEC(code, retValue) \ + if ((code) != ERR_OK) { \ + LWIP_DEBUGF(SNMP_DEBUG, ("SNMP error during creation of outbound frame!: " # code)); \ + return retValue; \ + } + +#define IF_PARSE_EXEC(code) PARSE_EXEC(code, ERR_ARG) +#define IF_PARSE_ASSERT(code) PARSE_ASSERT(code, ERR_ARG) + +/** + * Checks and decodes incoming SNMP message header, logs header errors. + * + * @param request points to the current message request state return + * @return + * - ERR_OK SNMP header is sane and accepted + * - ERR_VAL SNMP header is either malformed or rejected + */ +static err_t +snmp_parse_inbound_frame(struct snmp_request *request) +{ + struct snmp_pbuf_stream pbuf_stream; + struct snmp_asn1_tlv tlv; + s32_t parent_tlv_value_len; + s32_t s32_value; + err_t err; + + IF_PARSE_EXEC(snmp_pbuf_stream_init(&pbuf_stream, request->inbound_pbuf, 0, request->inbound_pbuf->tot_len)); + + /* decode main container consisting of version, community and PDU */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len == pbuf_stream.length)); + parent_tlv_value_len = tlv.value_len; + + /* decode version */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + if ((s32_value != SNMP_VERSION_1) && + (s32_value != SNMP_VERSION_2c) +#if LWIP_SNMP_V3 + && (s32_value != SNMP_VERSION_3) +#endif + ) + { + /* unsupported SNMP version */ + snmp_stats.inbadversions++; + return ERR_ARG; + } + request->version = (u8_t)s32_value; + +#if LWIP_SNMP_V3 + if (request->version == SNMP_VERSION_3) { + u16_t u16_value; + u16_t inbound_msgAuthenticationParameters_offset; + + /* SNMPv3 doesn't use communities */ + /* @todo: Differentiate read/write access */ + strcpy((char*)request->community, snmp_community); + request->community_strlen = (u16_t)strlen(snmp_community); + + /* RFC3414 globalData */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_SEQUENCE); + parent_tlv_value_len -= SNMP_ASN1_TLV_HDR_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + /* decode msgID */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + request->msg_id = s32_value; + + /* decode msgMaxSize */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + request->msg_max_size = s32_value; + + /* decode msgFlags */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + request->msg_flags = (u8_t)s32_value; + + /* decode msgSecurityModel */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + request->msg_security_model = s32_value; + + /* RFC3414 msgSecurityParameters + * The User-based Security Model defines the contents of the OCTET + * STRING as a SEQUENCE. + * + * We skip the protective dummy OCTET STRING header + * to access the SEQUENCE header. + */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_HDR_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + /* msgSecurityParameters SEQUENCE header */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_SEQUENCE); + parent_tlv_value_len -= SNMP_ASN1_TLV_HDR_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + /* decode msgAuthoritativeEngineID */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_authoritative_engine_id, + &u16_value, SNMP_V3_MAX_ENGINE_ID_LENGTH)); + request->msg_authoritative_engine_id_len = (u8_t)u16_value; + + /* msgAuthoritativeEngineBoots */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->msg_authoritative_engine_boots)); + + /* msgAuthoritativeEngineTime */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->msg_authoritative_engine_time)); + /* @todo: Implement time window checking */ + + /* msgUserName */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_user_name, + &u16_value, SNMP_V3_MAX_USER_LENGTH)); + request->msg_user_name_len = (u8_t)u16_value; + /* @todo: Implement unknown user error response */ + IF_PARSE_EXEC(snmpv3_get_user((char*)request->msg_user_name, NULL, NULL, NULL, NULL)); + + /* msgAuthenticationParameters */ + memset(request->msg_authentication_parameters, 0, SNMP_V3_MAX_AUTH_PARAM_LENGTH); + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + /* Remember position */ + inbound_msgAuthenticationParameters_offset = pbuf_stream.offset; + LWIP_UNUSED_ARG(inbound_msgAuthenticationParameters_offset); + /* Read auth parameters */ + IF_PARSE_ASSERT(tlv.value_len <= SNMP_V3_MAX_AUTH_PARAM_LENGTH); + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_authentication_parameters, + &u16_value, tlv.value_len)); + +#if LWIP_SNMP_V3_CRYPTO + if (request->msg_flags & SNMP_V3_AUTH_FLAG) { + const u8_t zero_arr[SNMP_V3_MAX_AUTH_PARAM_LENGTH] = { 0 }; + u8_t key[20]; + u8_t algo; + u8_t hmac[LWIP_MAX(SNMP_V3_SHA_LEN, SNMP_V3_MD5_LEN)]; + struct snmp_pbuf_stream auth_stream; + + /* Rewind stream */ + IF_PARSE_EXEC(snmp_pbuf_stream_init(&pbuf_stream, request->inbound_pbuf, 0, request->inbound_pbuf->tot_len)); + IF_PARSE_EXEC(snmp_pbuf_stream_seek_abs(&pbuf_stream, inbound_msgAuthenticationParameters_offset)); + /* Set auth parameters to zero for verification */ + IF_PARSE_EXEC(snmp_asn1_enc_raw(&pbuf_stream, zero_arr, tlv.value_len)); + + /* Verify authentication */ + IF_PARSE_EXEC(snmp_pbuf_stream_init(&auth_stream, request->inbound_pbuf, 0, request->inbound_pbuf->tot_len)); + + IF_PARSE_EXEC(snmpv3_get_user((char*)request->msg_user_name, &algo, key, NULL, NULL)); + IF_PARSE_EXEC(snmpv3_auth(&auth_stream, request->inbound_pbuf->tot_len, key, algo, hmac)); + /* @todo: Implement error response */ + IF_PARSE_EXEC(memcmp(request->msg_authentication_parameters, hmac, SNMP_V3_MAX_AUTH_PARAM_LENGTH)); + } +#else + /* Ungraceful exit if we encounter cryptography and don't support it. + * @todo: Implement error response + */ + IF_PARSE_ASSERT(!(request->msg_flags & (SNMP_V3_AUTH_FLAG | SNMP_V3_PRIV_FLAG))); +#endif + + /* msgPrivacyParameters */ + memset(request->msg_privacy_parameters, 0, SNMP_V3_MAX_PRIV_PARAM_LENGTH); + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_privacy_parameters, + &u16_value, SNMP_V3_MAX_PRIV_PARAM_LENGTH)); + +#if LWIP_SNMP_V3_CRYPTO + /* Decrypt message */ + if (request->msg_flags & SNMP_V3_PRIV_FLAG) { + u8_t key[20]; + u8_t algo; + + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_HDR_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmpv3_get_user((char*)request->msg_user_name, NULL, NULL, &algo, key)); + IF_PARSE_EXEC(snmpv3_crypt(&pbuf_stream, tlv.value_len, key, + request->msg_privacy_parameters, request->msg_authoritative_engine_boots, + request->msg_authoritative_engine_time, algo, SNMP_V3_PRIV_MODE_DECRYPT)); + } +#endif + + /* Scoped PDU + * Encryption context + */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_SEQUENCE); + parent_tlv_value_len -= SNMP_ASN1_TLV_HDR_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + /* contextEngineID */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->context_engine_id, + &u16_value, SNMP_V3_MAX_ENGINE_ID_LENGTH)); + request->context_engine_id_len = (u8_t)u16_value; + + /* contextName */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->context_name, + &u16_value, SNMP_V3_MAX_ENGINE_ID_LENGTH)); + request->context_name_len = (u8_t)u16_value; + } else +#endif + { + /* decode community */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_OCTET_STRING); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + err = snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->community, &request->community_strlen, SNMP_MAX_COMMUNITY_STR_LEN); + if (err == ERR_MEM) { + /* community string does not fit in our buffer -> its too long -> its invalid */ + request->community_strlen = 0; + snmp_pbuf_stream_seek(&pbuf_stream, tlv.value_len); + } else { + IF_PARSE_ASSERT(err == ERR_OK); + } + /* add zero terminator */ + request->community[request->community_strlen] = 0; + } + + /* decode PDU type (next container level) */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.value_len <= pbuf_stream.length); + request->inbound_padding_len = pbuf_stream.length - tlv.value_len; + parent_tlv_value_len = tlv.value_len; + + /* validate PDU type */ + switch(tlv.type) { + case (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_GET_REQ): + /* GetRequest PDU */ + snmp_stats.ingetrequests++; + break; + case (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_GET_NEXT_REQ): + /* GetNextRequest PDU */ + snmp_stats.ingetnexts++; + break; + case (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ): + /* GetBulkRequest PDU */ + if (request->version < SNMP_VERSION_2c) { + /* RFC2089: invalid, drop packet */ + return ERR_ARG; + } + break; + case (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_SET_REQ): + /* SetRequest PDU */ + snmp_stats.insetrequests++; + break; + default: + /* unsupported input PDU for this agent (no parse error) */ + LWIP_DEBUGF(SNMP_DEBUG, ("Unknown/Invalid SNMP PDU type received: %d", tlv.type)); \ + return ERR_ARG; + break; + } + request->request_type = tlv.type & SNMP_ASN1_DATATYPE_MASK; + + /* validate community (do this after decoding PDU type because we don't want to increase 'inbadcommunitynames' for wrong frame types */ + if (request->community_strlen == 0) { + /* community string was too long or really empty*/ + snmp_stats.inbadcommunitynames++; + snmp_authfail_trap(); + return ERR_ARG; + } else if (request->request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) { + if (snmp_community_write[0] == 0) { + /* our write community is empty, that means all our objects are readonly */ + request->error_status = SNMP_ERR_NOTWRITABLE; + request->error_index = 1; + } else if (strncmp(snmp_community_write, (const char*)request->community, SNMP_MAX_COMMUNITY_STR_LEN) != 0) { + /* community name does not match */ + snmp_stats.inbadcommunitynames++; + snmp_authfail_trap(); + return ERR_ARG; + } + } else { + if (strncmp(snmp_community, (const char*)request->community, SNMP_MAX_COMMUNITY_STR_LEN) != 0) { + /* community name does not match */ + snmp_stats.inbadcommunitynames++; + snmp_authfail_trap(); + return ERR_ARG; + } + } + + /* decode request ID */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->request_id)); + + /* decode error status / non-repeaters */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + if (request->request_type == SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ) { + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->non_repeaters)); + if (request->non_repeaters < 0) { + /* RFC 1905, 4.2.3 */ + request->non_repeaters = 0; + } + } else { + /* only check valid value, don't touch 'request->error_status', maybe a response error status was already set to above; */ + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); + IF_PARSE_ASSERT(s32_value == SNMP_ERR_NOERROR); + } + + /* decode error index / max-repetitions */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); + parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); + IF_PARSE_ASSERT(parent_tlv_value_len > 0); + + if (request->request_type == SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ) { + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->max_repetitions)); + if (request->max_repetitions < 0) { + /* RFC 1905, 4.2.3 */ + request->max_repetitions = 0; + } + } else { + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->error_index)); + IF_PARSE_ASSERT(s32_value == 0); + } + + /* decode varbind-list type (next container level) */ + IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); + IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len <= pbuf_stream.length)); + + request->inbound_varbind_offset = pbuf_stream.offset; + request->inbound_varbind_len = pbuf_stream.length - request->inbound_padding_len; + snmp_vb_enumerator_init(&(request->inbound_varbind_enumerator), request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len); + + return ERR_OK; +} + +#define OF_BUILD_EXEC(code) BUILD_EXEC(code, ERR_ARG) + +static err_t +snmp_prepare_outbound_frame(struct snmp_request *request) +{ + struct snmp_asn1_tlv tlv; + struct snmp_pbuf_stream* pbuf_stream = &(request->outbound_pbuf_stream); + + /* try allocating pbuf(s) for maximum response size */ + request->outbound_pbuf = pbuf_alloc(PBUF_TRANSPORT, 1472, PBUF_RAM); + if (request->outbound_pbuf == NULL) { + return ERR_MEM; + } + + snmp_pbuf_stream_init(pbuf_stream, request->outbound_pbuf, 0, request->outbound_pbuf->tot_len); + + /* 'Message' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, 0); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + + /* version */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(request->version, &tlv.value_len); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + OF_BUILD_EXEC( snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->version) ); + +#if LWIP_SNMP_V3 + if (request->version < SNMP_VERSION_3) { +#endif + /* community */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, request->community_strlen); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + OF_BUILD_EXEC( snmp_asn1_enc_raw(pbuf_stream, request->community, request->community_strlen) ); +#if LWIP_SNMP_V3 + } else { + const char* id; + + /* globalData */ + request->outbound_msg_global_data_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 1, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + /* msgID */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 1); + snmp_asn1_enc_s32t_cnt(request->msg_id, &tlv.value_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->msg_id)); + + /* msgMaxSize */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 1); + snmp_asn1_enc_s32t_cnt(request->msg_max_size, &tlv.value_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->msg_max_size)); + + /* msgFlags */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, 1); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, &request->msg_flags, 1)); + + /* msgSecurityModel */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 1); + snmp_asn1_enc_s32t_cnt(request->msg_security_model, &tlv.value_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->msg_security_model)); + + /* end of msgGlobalData */ + request->outbound_msg_global_data_end = pbuf_stream->offset; + + /* msgSecurityParameters */ + request->outbound_msg_security_parameters_str_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 1, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + request->outbound_msg_security_parameters_seq_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 1, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + /* msgAuthoritativeEngineID */ + snmpv3_get_engine_id(&id, &request->msg_authoritative_engine_id_len); + MEMCPY(request->msg_authoritative_engine_id, id, request->msg_authoritative_engine_id_len); + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, request->msg_authoritative_engine_id_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->msg_authoritative_engine_id, request->msg_authoritative_engine_id_len)); + + request->msg_authoritative_engine_time = snmpv3_get_engine_time(); + request->msg_authoritative_engine_boots = snmpv3_get_engine_boots(); + + /* msgAuthoritativeEngineBoots */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(request->msg_authoritative_engine_boots, &tlv.value_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->msg_authoritative_engine_boots)); + + /* msgAuthoritativeEngineTime */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(request->msg_authoritative_engine_time, &tlv.value_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->msg_authoritative_engine_time)); + + /* msgUserName */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, request->msg_user_name_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->msg_user_name, request->msg_user_name_len)); + +#if LWIP_SNMP_V3_CRYPTO + /* msgAuthenticationParameters */ + if (request->msg_flags & SNMP_V3_AUTH_FLAG) { + memset(request->msg_authentication_parameters, 0, SNMP_V3_MAX_AUTH_PARAM_LENGTH); + request->outbound_msg_authentication_parameters_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 1, SNMP_V3_MAX_AUTH_PARAM_LENGTH); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->msg_authentication_parameters, SNMP_V3_MAX_AUTH_PARAM_LENGTH)); + } else +#endif + { + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + } + +#if LWIP_SNMP_V3_CRYPTO + /* msgPrivacyParameters */ + if (request->msg_flags & SNMP_V3_PRIV_FLAG) { + snmpv3_build_priv_param(request->msg_privacy_parameters); + + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, SNMP_V3_MAX_PRIV_PARAM_LENGTH); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->msg_privacy_parameters, SNMP_V3_MAX_PRIV_PARAM_LENGTH)); + } else +#endif + { + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + } + + /* End of msgSecurityParameters, so we can calculate the length of this sequence later */ + request->outbound_msg_security_parameters_end = pbuf_stream->offset; + +#if LWIP_SNMP_V3_CRYPTO + /* For encryption we have to encapsulate the payload in an octet string */ + if (request->msg_flags & SNMP_V3_PRIV_FLAG) { + request->outbound_scoped_pdu_string_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 3, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + } +#endif + /* Scoped PDU + * Encryption context + */ + request->outbound_scoped_pdu_seq_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, 0); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + /* contextEngineID */ + snmpv3_get_engine_id(&id, &request->context_engine_id_len); + MEMCPY(request->context_engine_id, id, request->context_engine_id_len); + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, request->context_engine_id_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->context_engine_id, request->context_engine_id_len)); + + /* contextName */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, request->context_name_len); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, request->context_name, request->context_name_len)); + } +#endif + + /* 'PDU' sequence */ + request->outbound_pdu_offset = pbuf_stream->offset; + SNMP_ASN1_SET_TLV_PARAMS(tlv, (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_GET_RESP), 3, 0); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + + /* request ID */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(request->request_id, &tlv.value_len); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + OF_BUILD_EXEC( snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, request->request_id) ); + + /* error status */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 1); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + request->outbound_error_status_offset = pbuf_stream->offset; + OF_BUILD_EXEC( snmp_pbuf_stream_write(pbuf_stream, 0) ); + + /* error index */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 1); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + request->outbound_error_index_offset = pbuf_stream->offset; + OF_BUILD_EXEC( snmp_pbuf_stream_write(pbuf_stream, 0) ); + + /* 'VarBindList' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, 0); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(pbuf_stream, &tlv) ); + + request->outbound_varbind_offset = pbuf_stream->offset; + + return ERR_OK; +} + +/** Calculate the length of a varbind list */ +err_t +snmp_varbind_length(struct snmp_varbind *varbind, struct snmp_varbind_len *len) +{ + /* calculate required lengths */ + snmp_asn1_enc_oid_cnt(varbind->oid.id, varbind->oid.len, &len->oid_value_len); + snmp_asn1_enc_length_cnt(len->oid_value_len, &len->oid_len_len); + + if (varbind->value_len == 0) { + len->value_value_len = 0; + } else if (varbind->value_len & SNMP_GET_VALUE_RAW_DATA) { + len->value_value_len = varbind->value_len & (~SNMP_GET_VALUE_RAW_DATA); + } else { + switch (varbind->type) { + case SNMP_ASN1_TYPE_INTEGER: + if (varbind->value_len != sizeof (s32_t)) { + return ERR_VAL; + } + snmp_asn1_enc_s32t_cnt(*((s32_t*) varbind->value), &len->value_value_len); + break; + case SNMP_ASN1_TYPE_COUNTER: + case SNMP_ASN1_TYPE_GAUGE: + case SNMP_ASN1_TYPE_TIMETICKS: + if (varbind->value_len != sizeof (u32_t)) { + return ERR_VAL; + } + snmp_asn1_enc_u32t_cnt(*((u32_t*) varbind->value), &len->value_value_len); + break; + case SNMP_ASN1_TYPE_OCTET_STRING: + case SNMP_ASN1_TYPE_IPADDR: + case SNMP_ASN1_TYPE_OPAQUE: + len->value_value_len = varbind->value_len; + break; + case SNMP_ASN1_TYPE_NULL: + if (varbind->value_len != 0) { + return ERR_VAL; + } + len->value_value_len = 0; + break; + case SNMP_ASN1_TYPE_OBJECT_ID: + if ((varbind->value_len & 0x03) != 0) { + return ERR_VAL; + } + snmp_asn1_enc_oid_cnt((u32_t*) varbind->value, varbind->value_len >> 2, &len->value_value_len); + break; + case SNMP_ASN1_TYPE_COUNTER64: + if (varbind->value_len != (2 * sizeof (u32_t))) { + return ERR_VAL; + } + snmp_asn1_enc_u64t_cnt((u32_t*) varbind->value, &len->value_value_len); + break; + default: + /* unsupported type */ + return ERR_VAL; + } + } + snmp_asn1_enc_length_cnt(len->value_value_len, &len->value_len_len); + + len->vb_value_len = 1 + len->oid_len_len + len->oid_value_len + 1 + len->value_len_len + len->value_value_len; + snmp_asn1_enc_length_cnt(len->vb_value_len, &len->vb_len_len); + + return ERR_OK; +} + +#define OVB_BUILD_EXEC(code) BUILD_EXEC(code, ERR_ARG) + +err_t +snmp_append_outbound_varbind(struct snmp_pbuf_stream *pbuf_stream, struct snmp_varbind* varbind) +{ + struct snmp_asn1_tlv tlv; + struct snmp_varbind_len len; + err_t err; + + err = snmp_varbind_length(varbind, &len); + + if (err != ERR_OK) { + return err; + } + + /* check length already before adding first data because in case of GetBulk, + * data added so far is returned and therefore no partial data shall be added + */ + if ((1 + len.vb_len_len + len.vb_value_len) > pbuf_stream->length) { + return ERR_BUF; + } + + /* 'VarBind' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, len.vb_len_len, len.vb_value_len); + OVB_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + /* VarBind OID */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OBJECT_ID, len.oid_len_len, len.oid_value_len); + OVB_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + OVB_BUILD_EXEC(snmp_asn1_enc_oid(pbuf_stream, varbind->oid.id, varbind->oid.len)); + + /* VarBind value */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, varbind->type, len.value_len_len, len.value_value_len); + OVB_BUILD_EXEC(snmp_ans1_enc_tlv(pbuf_stream, &tlv)); + + if (len.value_value_len > 0) { + if (varbind->value_len & SNMP_GET_VALUE_RAW_DATA) { + OVB_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, (u8_t*) varbind->value, len.value_value_len)); + } else { + switch (varbind->type) { + case SNMP_ASN1_TYPE_INTEGER: + OVB_BUILD_EXEC(snmp_asn1_enc_s32t(pbuf_stream, len.value_value_len, *((s32_t*) varbind->value))); + break; + case SNMP_ASN1_TYPE_COUNTER: + case SNMP_ASN1_TYPE_GAUGE: + case SNMP_ASN1_TYPE_TIMETICKS: + OVB_BUILD_EXEC(snmp_asn1_enc_u32t(pbuf_stream, len.value_value_len, *((u32_t*) varbind->value))); + break; + case SNMP_ASN1_TYPE_OCTET_STRING: + case SNMP_ASN1_TYPE_IPADDR: + case SNMP_ASN1_TYPE_OPAQUE: + OVB_BUILD_EXEC(snmp_asn1_enc_raw(pbuf_stream, (u8_t*) varbind->value, len.value_value_len)); + len.value_value_len = varbind->value_len; + break; + case SNMP_ASN1_TYPE_OBJECT_ID: + OVB_BUILD_EXEC(snmp_asn1_enc_oid(pbuf_stream, (u32_t*) varbind->value, varbind->value_len / sizeof (u32_t))); + break; + case SNMP_ASN1_TYPE_COUNTER64: + OVB_BUILD_EXEC(snmp_asn1_enc_u64t(pbuf_stream, len.value_value_len, (u32_t*) varbind->value)); + break; + default: + LWIP_ASSERT("Unknown variable type", 0); + break; + } + } + } + + return ERR_OK; +} + +static err_t +snmp_complete_outbound_frame(struct snmp_request *request) +{ + struct snmp_asn1_tlv tlv; + u16_t frame_size; + u8_t outbound_padding = 0; + + if (request->version == SNMP_VERSION_1) { + if (request->error_status != SNMP_ERR_NOERROR) { + /* map v2c error codes to v1 compliant error code (according to RFC 2089) */ + switch (request->error_status) { + /* mapping of implementation specific "virtual" error codes + * (during processing of frame we already stored them in error_status field, + * so no need to check all varbinds here for those exceptions as suggested by RFC) */ + case SNMP_ERR_NOSUCHINSTANCE: + case SNMP_ERR_NOSUCHOBJECT: + case SNMP_ERR_ENDOFMIBVIEW: + request->error_status = SNMP_ERR_NOSUCHNAME; + break; + /* mapping according to RFC */ + case SNMP_ERR_WRONGVALUE: + case SNMP_ERR_WRONGENCODING: + case SNMP_ERR_WRONGTYPE: + case SNMP_ERR_WRONGLENGTH: + case SNMP_ERR_INCONSISTENTVALUE: + request->error_status = SNMP_ERR_BADVALUE; + break; + case SNMP_ERR_NOACCESS: + case SNMP_ERR_NOTWRITABLE: + case SNMP_ERR_NOCREATION: + case SNMP_ERR_INCONSISTENTNAME: + case SNMP_ERR_AUTHORIZATIONERROR: + request->error_status = SNMP_ERR_NOSUCHNAME; + break; + case SNMP_ERR_RESOURCEUNAVAILABLE: + case SNMP_ERR_COMMITFAILED: + case SNMP_ERR_UNDOFAILED: + default: + request->error_status = SNMP_ERR_GENERROR; + break; + } + } + } else { + if (request->request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) { + /* map error codes to according to RFC 1905 (4.2.5. The SetRequest-PDU) return 'NotWritable' for unknown OIDs) */ + switch (request->error_status) { + case SNMP_ERR_NOSUCHINSTANCE: + case SNMP_ERR_NOSUCHOBJECT: + case SNMP_ERR_ENDOFMIBVIEW: + request->error_status = SNMP_ERR_NOTWRITABLE; + break; + default: + break; + } + } + + if (request->error_status >= SNMP_VARBIND_EXCEPTION_OFFSET) { + /* should never occur because v2 frames store exceptions directly inside varbinds and not as frame error_status */ + LWIP_DEBUGF(SNMP_DEBUG, ("snmp_complete_outbound_frame() > Found v2 request with varbind exception code stored as error status!\n")); + return ERR_ARG; + } + } + + if ((request->error_status != SNMP_ERR_NOERROR) || (request->request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ)) { + /* all inbound vars are returned in response without any modification for error responses and successful set requests*/ + struct snmp_pbuf_stream inbound_stream; + OF_BUILD_EXEC( snmp_pbuf_stream_init(&inbound_stream, request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len) ); + OF_BUILD_EXEC( snmp_pbuf_stream_init(&(request->outbound_pbuf_stream), request->outbound_pbuf, request->outbound_varbind_offset, request->outbound_pbuf->tot_len - request->outbound_varbind_offset) ); + snmp_pbuf_stream_writeto(&inbound_stream, &(request->outbound_pbuf_stream), 0); + } + + frame_size = request->outbound_pbuf_stream.offset; + +#if LWIP_SNMP_V3 && LWIP_SNMP_V3_CRYPTO + /* Calculate padding for encryption */ + if (request->version == SNMP_VERSION_3 && (request->msg_flags & SNMP_V3_PRIV_FLAG)) { + u8_t i; + outbound_padding = (8 - (u8_t)((frame_size - request->outbound_scoped_pdu_seq_offset) & 0x07)) & 0x07; + for (i = 0; i < outbound_padding; i++) { + snmp_pbuf_stream_write(&request->outbound_pbuf_stream, 0); + } + } +#endif + + /* complete missing length in 'Message' sequence ; 'Message' tlv is located at the beginning (offset 0) */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, frame_size + outbound_padding - 1 - 3); /* - type - length_len(fixed, see snmp_prepare_outbound_frame()) */ + OF_BUILD_EXEC( snmp_pbuf_stream_init(&(request->outbound_pbuf_stream), request->outbound_pbuf, 0, request->outbound_pbuf->tot_len) ); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv) ); + +#if LWIP_SNMP_V3 + if (request->version == SNMP_VERSION_3) { + /* complete missing length in 'globalData' sequence */ + /* - type - length_len(fixed, see snmp_prepare_outbound_frame()) */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 1, request->outbound_msg_global_data_end + - request->outbound_msg_global_data_offset - 1 - 1); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_msg_global_data_offset)); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv)); + + /* complete missing length in 'msgSecurityParameters' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 1, request->outbound_msg_security_parameters_end + - request->outbound_msg_security_parameters_str_offset - 1 - 1); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_msg_security_parameters_str_offset)); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv)); + + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 1, request->outbound_msg_security_parameters_end + - request->outbound_msg_security_parameters_seq_offset - 1 - 1); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_msg_security_parameters_seq_offset)); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv)); + + /* complete missing length in scoped PDU sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, frame_size - request->outbound_scoped_pdu_seq_offset - 1 - 3); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_scoped_pdu_seq_offset)); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv)); + } +#endif + + /* complete missing length in 'PDU' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_GET_RESP), 3, + frame_size - request->outbound_pdu_offset - 1 - 3); /* - type - length_len(fixed, see snmp_prepare_outbound_frame()) */ + OF_BUILD_EXEC( snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_pdu_offset) ); + OF_BUILD_EXEC( snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv) ); + + /* process and encode final error status */ + if (request->error_status != 0) { + u16_t len; + snmp_asn1_enc_s32t_cnt(request->error_status, &len); + if (len != 1) { + /* error, we only reserved one byte for it */ + return ERR_ARG; + } + OF_BUILD_EXEC( snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_error_status_offset) ); + OF_BUILD_EXEC( snmp_asn1_enc_s32t(&(request->outbound_pbuf_stream), len, request->error_status) ); + + /* for compatibility to v1, log statistics; in v2 (RFC 1907) these statistics are obsoleted */ + switch (request->error_status) { + case SNMP_ERR_TOOBIG: + snmp_stats.outtoobigs++; + break; + case SNMP_ERR_NOSUCHNAME: + snmp_stats.outnosuchnames++; + break; + case SNMP_ERR_BADVALUE: + snmp_stats.outbadvalues++; + break; + case SNMP_ERR_GENERROR: + default: + snmp_stats.outgenerrs++; + break; + } + + if (request->error_status == SNMP_ERR_TOOBIG) { + request->error_index = 0; /* defined by RFC 1157 */ + } else if (request->error_index == 0) { + /* set index to varbind where error occured (if not already set before, e.g. during GetBulk processing) */ + request->error_index = request->inbound_varbind_enumerator.varbind_count; + } + } else { + if (request->request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) { + snmp_stats.intotalsetvars += request->inbound_varbind_enumerator.varbind_count; + } else { + snmp_stats.intotalreqvars += request->inbound_varbind_enumerator.varbind_count; + } + } + + /* encode final error index*/ + if (request->error_index != 0) { + u16_t len; + snmp_asn1_enc_s32t_cnt(request->error_index, &len); + if (len != 1) { + /* error, we only reserved one byte for it */ + return ERR_VAL; + } + OF_BUILD_EXEC( snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_error_index_offset) ); + OF_BUILD_EXEC( snmp_asn1_enc_s32t(&(request->outbound_pbuf_stream), len, request->error_index) ); + } + + /* complete missing length in 'VarBindList' sequence ; 'VarBindList' tlv is located directly before varbind offset */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 3, frame_size - request->outbound_varbind_offset); + OF_BUILD_EXEC( snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_varbind_offset - 1 - 3) ); /* - type - length_len(fixed, see snmp_prepare_outbound_frame()) */ + OF_BUILD_EXEC( snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv) ); + + /* Authenticate response */ +#if LWIP_SNMP_V3 && LWIP_SNMP_V3_CRYPTO + /* Encrypt response */ + if (request->version == SNMP_VERSION_3 && (request->msg_flags & SNMP_V3_PRIV_FLAG)) { + u8_t key[20]; + u8_t algo; + + /* complete missing length in PDU sequence */ + OF_BUILD_EXEC(snmp_pbuf_stream_init(&request->outbound_pbuf_stream, request->outbound_pbuf, 0, request->outbound_pbuf->tot_len)); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&(request->outbound_pbuf_stream), request->outbound_scoped_pdu_string_offset)); + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 3, frame_size + outbound_padding + - request->outbound_scoped_pdu_string_offset - 1 - 3); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&(request->outbound_pbuf_stream), &tlv)); + + OF_BUILD_EXEC(snmpv3_get_user((char*)request->msg_user_name, NULL, NULL, &algo, key)); + + OF_BUILD_EXEC(snmpv3_crypt(&request->outbound_pbuf_stream, tlv.value_len, key, + request->msg_privacy_parameters, request->msg_authoritative_engine_boots, + request->msg_authoritative_engine_time, algo, SNMP_V3_PRIV_MODE_ENCRYPT)); + } + + if (request->version == SNMP_VERSION_3 && (request->msg_flags & SNMP_V3_AUTH_FLAG)) { + u8_t key[20]; + u8_t algo; + u8_t hmac[20]; + + OF_BUILD_EXEC(snmpv3_get_user((char*)request->msg_user_name, &algo, key, NULL, NULL)); + OF_BUILD_EXEC(snmp_pbuf_stream_init(&(request->outbound_pbuf_stream), + request->outbound_pbuf, 0, request->outbound_pbuf->tot_len)); + OF_BUILD_EXEC(snmpv3_auth(&request->outbound_pbuf_stream, frame_size + outbound_padding, key, algo, hmac)); + + MEMCPY(request->msg_authentication_parameters, hmac, SNMP_V3_MAX_AUTH_PARAM_LENGTH); + OF_BUILD_EXEC(snmp_pbuf_stream_init(&request->outbound_pbuf_stream, + request->outbound_pbuf, 0, request->outbound_pbuf->tot_len)); + OF_BUILD_EXEC(snmp_pbuf_stream_seek_abs(&request->outbound_pbuf_stream, + request->outbound_msg_authentication_parameters_offset)); + + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 1, SNMP_V3_MAX_AUTH_PARAM_LENGTH); + OF_BUILD_EXEC(snmp_ans1_enc_tlv(&request->outbound_pbuf_stream, &tlv)); + OF_BUILD_EXEC(snmp_asn1_enc_raw(&request->outbound_pbuf_stream, + request->msg_authentication_parameters, SNMP_V3_MAX_AUTH_PARAM_LENGTH)); + } +#endif + + pbuf_realloc(request->outbound_pbuf, frame_size + outbound_padding); + + snmp_stats.outgetresponses++; + snmp_stats.outpkts++; + + return ERR_OK; +} + +static void +snmp_execute_write_callbacks(struct snmp_request *request) +{ + struct snmp_varbind_enumerator inbound_varbind_enumerator; + struct snmp_varbind vb; + + snmp_vb_enumerator_init(&inbound_varbind_enumerator, request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len); + vb.value = NULL; /* do NOT decode value (we enumerate outbound buffer here, so all varbinds have values assigned, which we don't need here) */ + + while (snmp_vb_enumerator_get_next(&inbound_varbind_enumerator, &vb) == SNMP_VB_ENUMERATOR_ERR_OK) { + snmp_write_callback(vb.oid.id, vb.oid.len, snmp_write_callback_arg); + } +} + + +/* ----------------------------------------------------------------------- */ +/* VarBind enumerator methods */ +/* ----------------------------------------------------------------------- */ + +void +snmp_vb_enumerator_init(struct snmp_varbind_enumerator* enumerator, struct pbuf* p, u16_t offset, u16_t length) +{ + snmp_pbuf_stream_init(&(enumerator->pbuf_stream), p, offset, length); + enumerator->varbind_count = 0; +} + +#define VB_PARSE_EXEC(code) PARSE_EXEC(code, SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) +#define VB_PARSE_ASSERT(code) PARSE_ASSERT(code, SNMP_VB_ENUMERATOR_ERR_ASN1ERROR) + +snmp_vb_enumerator_err_t +snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct snmp_varbind* varbind) +{ + struct snmp_asn1_tlv tlv; + u16_t varbind_len; + err_t err; + + if (enumerator->pbuf_stream.length == 0) + { + return SNMP_VB_ENUMERATOR_ERR_EOVB; + } + enumerator->varbind_count++; + + /* decode varbind itself (parent container of a varbind) */ + VB_PARSE_EXEC(snmp_asn1_dec_tlv(&(enumerator->pbuf_stream), &tlv)); + VB_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len <= enumerator->pbuf_stream.length)); + varbind_len = tlv.value_len; + + /* decode varbind name (object id) */ + VB_PARSE_EXEC(snmp_asn1_dec_tlv(&(enumerator->pbuf_stream), &tlv)); + VB_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_OBJECT_ID) && (SNMP_ASN1_TLV_LENGTH(tlv) < varbind_len) && (tlv.value_len < enumerator->pbuf_stream.length)); + + VB_PARSE_EXEC(snmp_asn1_dec_oid(&(enumerator->pbuf_stream), tlv.value_len, varbind->oid.id, &(varbind->oid.len), SNMP_MAX_OBJ_ID_LEN)); + varbind_len -= SNMP_ASN1_TLV_LENGTH(tlv); + + /* decode varbind value (object id) */ + VB_PARSE_EXEC(snmp_asn1_dec_tlv(&(enumerator->pbuf_stream), &tlv)); + VB_PARSE_ASSERT((SNMP_ASN1_TLV_LENGTH(tlv) == varbind_len) && (tlv.value_len <= enumerator->pbuf_stream.length)); + varbind->type = tlv.type; + + /* shall the value be decoded ? */ + if (varbind->value != NULL) { + switch (varbind->type) { + case SNMP_ASN1_TYPE_INTEGER: + VB_PARSE_EXEC(snmp_asn1_dec_s32t(&(enumerator->pbuf_stream), tlv.value_len, (s32_t*)varbind->value)); + varbind->value_len = sizeof(s32_t*); + break; + case SNMP_ASN1_TYPE_COUNTER: + case SNMP_ASN1_TYPE_GAUGE: + case SNMP_ASN1_TYPE_TIMETICKS: + VB_PARSE_EXEC(snmp_asn1_dec_u32t(&(enumerator->pbuf_stream), tlv.value_len, (u32_t*)varbind->value)); + varbind->value_len = sizeof(u32_t*); + break; + case SNMP_ASN1_TYPE_OCTET_STRING: + case SNMP_ASN1_TYPE_OPAQUE: + err = snmp_asn1_dec_raw(&(enumerator->pbuf_stream), tlv.value_len, (u8_t*)varbind->value, &varbind->value_len, SNMP_MAX_VALUE_SIZE); + if (err == ERR_MEM) { + return SNMP_VB_ENUMERATOR_ERR_INVALIDLENGTH; + } + VB_PARSE_ASSERT(err == ERR_OK); + break; + case SNMP_ASN1_TYPE_NULL: + varbind->value_len = 0; + break; + case SNMP_ASN1_TYPE_OBJECT_ID: + /* misuse tlv.length_len as OID_length transporter */ + err = snmp_asn1_dec_oid(&(enumerator->pbuf_stream), tlv.value_len, (u32_t*)varbind->value, &tlv.length_len, SNMP_MAX_OBJ_ID_LEN); + if (err == ERR_MEM) { + return SNMP_VB_ENUMERATOR_ERR_INVALIDLENGTH; + } + VB_PARSE_ASSERT(err == ERR_OK); + varbind->value_len = tlv.length_len * sizeof(u32_t); + break; + case SNMP_ASN1_TYPE_IPADDR: + if (tlv.value_len == 4) { + /* must be exactly 4 octets! */ + VB_PARSE_EXEC(snmp_asn1_dec_raw(&(enumerator->pbuf_stream), tlv.value_len, (u8_t*)varbind->value, &varbind->value_len, SNMP_MAX_VALUE_SIZE)); + } else { + VB_PARSE_ASSERT(0); + } + break; + case SNMP_ASN1_TYPE_COUNTER64: + VB_PARSE_EXEC(snmp_asn1_dec_u64t(&(enumerator->pbuf_stream), tlv.value_len, (u32_t*)varbind->value)); + varbind->value_len = 2 * sizeof(u32_t*); + break; + default: + VB_PARSE_ASSERT(0); + break; + } + } else { + snmp_pbuf_stream_seek(&(enumerator->pbuf_stream), tlv.value_len); + varbind->value_len = tlv.value_len; + } + + return SNMP_VB_ENUMERATOR_ERR_OK; +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.h new file mode 100644 index 0000000..2d01ef3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_msg.h @@ -0,0 +1,194 @@ +/** + * @file + * SNMP Agent message handling structures (internal API, do not use in client code). + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel + * Elias Oenal + */ + +#ifndef LWIP_HDR_APPS_SNMP_MSG_H +#define LWIP_HDR_APPS_SNMP_MSG_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP + +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "snmp_pbuf_stream.h" +#include "lwip/ip_addr.h" +#include "lwip/err.h" + +#if LWIP_SNMP_V3 +#include "snmpv3_priv.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +/* The listen port of the SNMP agent. Clients have to make their requests to + this port. Most standard clients won't work if you change this! */ +#ifndef SNMP_IN_PORT +#define SNMP_IN_PORT 161 +#endif +/* The remote port the SNMP agent sends traps to. Most standard trap sinks won't + work if you change this! */ +#ifndef SNMP_TRAP_PORT +#define SNMP_TRAP_PORT 162 +#endif + +/* version defines used in PDU */ +#define SNMP_VERSION_1 0 +#define SNMP_VERSION_2c 1 +#define SNMP_VERSION_3 3 + +struct snmp_varbind_enumerator +{ + struct snmp_pbuf_stream pbuf_stream; + u16_t varbind_count; +}; + +typedef enum { + SNMP_VB_ENUMERATOR_ERR_OK = 0, + SNMP_VB_ENUMERATOR_ERR_EOVB = 1, + SNMP_VB_ENUMERATOR_ERR_ASN1ERROR = 2, + SNMP_VB_ENUMERATOR_ERR_INVALIDLENGTH = 3 +} snmp_vb_enumerator_err_t; + +void snmp_vb_enumerator_init(struct snmp_varbind_enumerator* enumerator, struct pbuf* p, u16_t offset, u16_t length); +snmp_vb_enumerator_err_t snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct snmp_varbind* varbind); + +struct snmp_request +{ + /* Communication handle */ + void *handle; + /* source IP address */ + const ip_addr_t *source_ip; + /* source UDP port */ + u16_t source_port; + /* incoming snmp version */ + u8_t version; + /* community name (zero terminated) */ + u8_t community[SNMP_MAX_COMMUNITY_STR_LEN + 1]; + /* community string length (exclusive zero term) */ + u16_t community_strlen; + /* request type */ + u8_t request_type; + /* request ID */ + s32_t request_id; + /* error status */ + s32_t error_status; + /* error index */ + s32_t error_index; + /* non-repeaters (getBulkRequest (SNMPv2c)) */ + s32_t non_repeaters; + /* max-repetitions (getBulkRequest (SNMPv2c)) */ + s32_t max_repetitions; + +#if LWIP_SNMP_V3 + s32_t msg_id; + s32_t msg_max_size; + u8_t msg_flags; + s32_t msg_security_model; + u8_t msg_authoritative_engine_id[SNMP_V3_MAX_ENGINE_ID_LENGTH]; + u8_t msg_authoritative_engine_id_len; + s32_t msg_authoritative_engine_boots; + s32_t msg_authoritative_engine_time; + u8_t msg_user_name[SNMP_V3_MAX_USER_LENGTH]; + u8_t msg_user_name_len; + u8_t msg_authentication_parameters[SNMP_V3_MAX_AUTH_PARAM_LENGTH]; + u8_t msg_privacy_parameters[SNMP_V3_MAX_PRIV_PARAM_LENGTH]; + u8_t context_engine_id[SNMP_V3_MAX_ENGINE_ID_LENGTH]; + u8_t context_engine_id_len; + u8_t context_name[SNMP_V3_MAX_ENGINE_ID_LENGTH]; + u8_t context_name_len; +#endif + + struct pbuf *inbound_pbuf; + struct snmp_varbind_enumerator inbound_varbind_enumerator; + u16_t inbound_varbind_offset; + u16_t inbound_varbind_len; + u16_t inbound_padding_len; + + struct pbuf *outbound_pbuf; + struct snmp_pbuf_stream outbound_pbuf_stream; + u16_t outbound_pdu_offset; + u16_t outbound_error_status_offset; + u16_t outbound_error_index_offset; + u16_t outbound_varbind_offset; +#if LWIP_SNMP_V3 + u16_t outbound_msg_global_data_offset; + u16_t outbound_msg_global_data_end; + u16_t outbound_msg_security_parameters_str_offset; + u16_t outbound_msg_security_parameters_seq_offset; + u16_t outbound_msg_security_parameters_end; + u16_t outbound_msg_authentication_parameters_offset; + u16_t outbound_scoped_pdu_seq_offset; + u16_t outbound_scoped_pdu_string_offset; +#endif + + u8_t value_buffer[SNMP_MAX_VALUE_SIZE]; +}; + +/** A helper struct keeping length information about varbinds */ +struct snmp_varbind_len +{ + u8_t vb_len_len; + u16_t vb_value_len; + u8_t oid_len_len; + u16_t oid_value_len; + u8_t value_len_len; + u16_t value_value_len; +}; + +/** Agent community string */ +extern const char *snmp_community; +/** Agent community string for write access */ +extern const char *snmp_community_write; +/** handle for sending traps */ +extern void* snmp_traps_handle; + +void snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t port); +err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port); +u8_t snmp_get_local_ip_for_dst(void* handle, const ip_addr_t *dst, ip_addr_t *result); +err_t snmp_varbind_length(struct snmp_varbind *varbind, struct snmp_varbind_len *len); +err_t snmp_append_outbound_varbind(struct snmp_pbuf_stream *pbuf_stream, struct snmp_varbind* varbind); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SNMP */ + +#endif /* LWIP_HDR_APPS_SNMP_MSG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_netconn.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_netconn.c new file mode 100644 index 0000000..24c3e26 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_netconn.c @@ -0,0 +1,121 @@ +/** + * @file + * SNMP netconn frontend. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP && SNMP_USE_NETCONN + +#include +#include "lwip/api.h" +#include "lwip/ip.h" +#include "lwip/udp.h" +#include "snmp_msg.h" +#include "lwip/sys.h" + +/** SNMP netconn API worker thread */ +static void +snmp_netconn_thread(void *arg) +{ + struct netconn *conn; + struct netbuf *buf; + err_t err; + LWIP_UNUSED_ARG(arg); + + /* Bind to SNMP port with default IP address */ +#if LWIP_IPV6 + conn = netconn_new(NETCONN_UDP_IPV6); + netconn_bind(conn, IP6_ADDR_ANY, SNMP_IN_PORT); +#else /* LWIP_IPV6 */ + conn = netconn_new(NETCONN_UDP); + netconn_bind(conn, IP4_ADDR_ANY, SNMP_IN_PORT); +#endif /* LWIP_IPV6 */ + LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;); + + snmp_traps_handle = conn; + + do { + err = netconn_recv(conn, &buf); + + if (err == ERR_OK) { + snmp_receive(conn, buf->p, &buf->addr, buf->port); + } + + if (buf != NULL) { + netbuf_delete(buf); + } + } while(1); +} + +err_t +snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) +{ + err_t result; + struct netbuf buf; + + memset(&buf, 0, sizeof(buf)); + buf.p = p; + result = netconn_sendto((struct netconn*)handle, &buf, dst, port); + + return result; +} + +u8_t +snmp_get_local_ip_for_dst(void* handle, const ip_addr_t *dst, ip_addr_t *result) +{ + struct netconn* conn = (struct netconn*)handle; + struct netif *dst_if; + const ip_addr_t* dst_ip; + + LWIP_UNUSED_ARG(conn); /* unused in case of IPV4 only configuration */ + + ip_route_get_local_ip(&conn->pcb.udp->local_ip, dst, dst_if, dst_ip); + + if ((dst_if != NULL) && (dst_ip != NULL)) { + ip_addr_copy(*result, *dst_ip); + return 1; + } else { + return 0; + } +} + +/** + * Starts SNMP Agent. + */ +void +snmp_init(void) +{ + sys_thread_new("snmp_netconn", snmp_netconn_thread, NULL, SNMP_STACK_SIZE, SNMP_THREAD_PRIO); +} + +#endif /* LWIP_SNMP && SNMP_USE_NETCONN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.c new file mode 100644 index 0000000..3c1217d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.c @@ -0,0 +1,156 @@ +/** + * @file + * SNMP pbuf stream wrapper implementation (internal API, do not use in client code). + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "snmp_pbuf_stream.h" +#include "lwip/def.h" +#include + +err_t +snmp_pbuf_stream_init(struct snmp_pbuf_stream* pbuf_stream, struct pbuf* p, u16_t offset, u16_t length) +{ + pbuf_stream->offset = offset; + pbuf_stream->length = length; + pbuf_stream->pbuf = p; + + return ERR_OK; +} + +err_t +snmp_pbuf_stream_read(struct snmp_pbuf_stream* pbuf_stream, u8_t* data) +{ + if (pbuf_stream->length == 0) { + return ERR_BUF; + } + + if (pbuf_copy_partial(pbuf_stream->pbuf, data, 1, pbuf_stream->offset) == 0) { + return ERR_BUF; + } + + pbuf_stream->offset++; + pbuf_stream->length--; + + return ERR_OK; +} + +err_t +snmp_pbuf_stream_write(struct snmp_pbuf_stream* pbuf_stream, u8_t data) +{ + return snmp_pbuf_stream_writebuf(pbuf_stream, &data, 1); +} + +err_t +snmp_pbuf_stream_writebuf(struct snmp_pbuf_stream* pbuf_stream, const void* buf, u16_t buf_len) +{ + if (pbuf_stream->length < buf_len) { + return ERR_BUF; + } + + if (pbuf_take_at(pbuf_stream->pbuf, buf, buf_len, pbuf_stream->offset) != ERR_OK) { + return ERR_BUF; + } + + pbuf_stream->offset += buf_len; + pbuf_stream->length -= buf_len; + + return ERR_OK; +} + +err_t +snmp_pbuf_stream_writeto(struct snmp_pbuf_stream* pbuf_stream, struct snmp_pbuf_stream* target_pbuf_stream, u16_t len) +{ + + if ((pbuf_stream == NULL) || (target_pbuf_stream == NULL)) { + return ERR_ARG; + } + if ((len > pbuf_stream->length) || (len > target_pbuf_stream->length)) { + return ERR_ARG; + } + + if (len == 0) { + len = LWIP_MIN(pbuf_stream->length, target_pbuf_stream->length); + } + + while (len > 0) { + u16_t chunk_len; + err_t err; + u16_t target_offset; + struct pbuf* pbuf = pbuf_skip(pbuf_stream->pbuf, pbuf_stream->offset, &target_offset); + + if ((pbuf == NULL) || (pbuf->len == 0)) { + return ERR_BUF; + } + + chunk_len = LWIP_MIN(len, pbuf->len); + err = snmp_pbuf_stream_writebuf(target_pbuf_stream, &((u8_t*)pbuf->payload)[target_offset], chunk_len); + if (err != ERR_OK) { + return err; + } + + pbuf_stream->offset += chunk_len; + pbuf_stream->length -= chunk_len; + len -= chunk_len; + } + + return ERR_OK; +} + +err_t +snmp_pbuf_stream_seek(struct snmp_pbuf_stream* pbuf_stream, s32_t offset) +{ + if ((offset < 0) || (offset > pbuf_stream->length)) { + /* we cannot seek backwards or forward behind stream end */ + return ERR_ARG; + } + + pbuf_stream->offset += (u16_t)offset; + pbuf_stream->length -= (u16_t)offset; + + return ERR_OK; +} + +err_t +snmp_pbuf_stream_seek_abs(struct snmp_pbuf_stream* pbuf_stream, u32_t offset) +{ + s32_t rel_offset = offset - pbuf_stream->offset; + return snmp_pbuf_stream_seek(pbuf_stream, rel_offset); +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.h new file mode 100644 index 0000000..9778de7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_pbuf_stream.h @@ -0,0 +1,73 @@ +/** + * @file + * SNMP pbuf stream wrapper (internal API, do not use in client code). + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#ifndef LWIP_HDR_APPS_SNMP_PBUF_STREAM_H +#define LWIP_HDR_APPS_SNMP_PBUF_STREAM_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP + +#include "lwip/err.h" +#include "lwip/pbuf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct snmp_pbuf_stream +{ + struct pbuf* pbuf; + u16_t offset; + u16_t length; +}; + +err_t snmp_pbuf_stream_init(struct snmp_pbuf_stream* pbuf_stream, struct pbuf* p, u16_t offset, u16_t length); +err_t snmp_pbuf_stream_read(struct snmp_pbuf_stream* pbuf_stream, u8_t* data); +err_t snmp_pbuf_stream_write(struct snmp_pbuf_stream* pbuf_stream, u8_t data); +err_t snmp_pbuf_stream_writebuf(struct snmp_pbuf_stream* pbuf_stream, const void* buf, u16_t buf_len); +err_t snmp_pbuf_stream_writeto(struct snmp_pbuf_stream* pbuf_stream, struct snmp_pbuf_stream* target_pbuf_stream, u16_t len); +err_t snmp_pbuf_stream_seek(struct snmp_pbuf_stream* pbuf_stream, s32_t offset); +err_t snmp_pbuf_stream_seek_abs(struct snmp_pbuf_stream* pbuf_stream, u32_t offset); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SNMP */ + +#endif /* LWIP_HDR_APPS_SNMP_PBUF_STREAM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_raw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_raw.c new file mode 100644 index 0000000..4a40864 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_raw.c @@ -0,0 +1,100 @@ +/** + * @file + * SNMP RAW API frontend. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + */ + +#include "lwip/apps/snmp_opts.h" +#include "lwip/ip_addr.h" + +#if LWIP_SNMP && SNMP_USE_RAW + +#include "lwip/udp.h" +#include "lwip/ip.h" +#include "snmp_msg.h" + +/* lwIP UDP receive callback function */ +static void +snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + LWIP_UNUSED_ARG(arg); + + snmp_receive(pcb, p, addr, port); + + pbuf_free(p); +} + +err_t +snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) +{ + return udp_sendto((struct udp_pcb*)handle, p, dst, port); +} + +u8_t +snmp_get_local_ip_for_dst(void* handle, const ip_addr_t *dst, ip_addr_t *result) +{ + struct udp_pcb* udp_pcb = (struct udp_pcb*)handle; + struct netif *dst_if; + const ip_addr_t* dst_ip; + + LWIP_UNUSED_ARG(udp_pcb); /* unused in case of IPV4 only configuration */ + + ip_route_get_local_ip(&udp_pcb->local_ip, dst, dst_if, dst_ip); + + if ((dst_if != NULL) && (dst_ip != NULL)) { + ip_addr_copy(*result, *dst_ip); + return 1; + } else { + return 0; + } +} + +/** + * @ingroup snmp_core + * Starts SNMP Agent. + * Allocates UDP pcb and binds it to IP_ANY_TYPE port 161. + */ +void +snmp_init(void) +{ + err_t err; + + struct udp_pcb *snmp_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); + LWIP_ERROR("snmp_raw: no PCB", (snmp_pcb != NULL), return;); + + snmp_traps_handle = snmp_pcb; + + udp_recv(snmp_pcb, snmp_recv, (void *)SNMP_IN_PORT); + err = udp_bind(snmp_pcb, IP_ANY_TYPE, SNMP_IN_PORT); + LWIP_ERROR("snmp_raw: Unable to bind PCB", (err == ERR_OK), return;); +} + +#endif /* LWIP_SNMP && SNMP_USE_RAW */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_scalar.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_scalar.c new file mode 100644 index 0000000..136c9ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_scalar.c @@ -0,0 +1,220 @@ +/** + * @file + * SNMP scalar node support implementation. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp_scalar.h" +#include "lwip/apps/snmp_core.h" + +static s16_t snmp_scalar_array_get_value(struct snmp_node_instance* instance, void* value); +static snmp_err_t snmp_scalar_array_set_test(struct snmp_node_instance* instance, u16_t value_len, void* value); +static snmp_err_t snmp_scalar_array_set_value(struct snmp_node_instance* instance, u16_t value_len, void* value); + +snmp_err_t +snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + const struct snmp_scalar_node* scalar_node = (const struct snmp_scalar_node*)(const void*)instance->node; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + /* scalar only has one dedicated instance: .0 */ + if ((instance->instance_oid.len != 1) || (instance->instance_oid.id[0] != 0)) { + return SNMP_ERR_NOSUCHINSTANCE; + } + + instance->access = scalar_node->access; + instance->asn1_type = scalar_node->asn1_type; + instance->get_value = scalar_node->get_value; + instance->set_test = scalar_node->set_test; + instance->set_value = scalar_node->set_value; + return SNMP_ERR_NOERROR; +} + +snmp_err_t +snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + /* because our only instance is .0 we can only return a next instance if no instance oid is passed */ + if (instance->instance_oid.len == 0) { + instance->instance_oid.len = 1; + instance->instance_oid.id[0] = 0; + + return snmp_scalar_get_instance(root_oid, root_oid_len, instance); + } + + return SNMP_ERR_NOSUCHINSTANCE; +} + + +snmp_err_t +snmp_scalar_array_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + if ((instance->instance_oid.len == 2) && (instance->instance_oid.id[1] == 0)) { + const struct snmp_scalar_array_node* array_node = (const struct snmp_scalar_array_node*)(const void*)instance->node; + const struct snmp_scalar_array_node_def* array_node_def = array_node->array_nodes; + u32_t i = 0; + + while (i < array_node->array_node_count) { + if (array_node_def->oid == instance->instance_oid.id[0]) { + break; + } + + array_node_def++; + i++; + } + + if (i < array_node->array_node_count) { + instance->access = array_node_def->access; + instance->asn1_type = array_node_def->asn1_type; + instance->get_value = snmp_scalar_array_get_value; + instance->set_test = snmp_scalar_array_set_test; + instance->set_value = snmp_scalar_array_set_value; + instance->reference.const_ptr = array_node_def; + + return SNMP_ERR_NOERROR; + } + } + + return SNMP_ERR_NOSUCHINSTANCE; +} + +snmp_err_t +snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + const struct snmp_scalar_array_node* array_node = (const struct snmp_scalar_array_node*)(const void*)instance->node; + const struct snmp_scalar_array_node_def* array_node_def = array_node->array_nodes; + const struct snmp_scalar_array_node_def* result = NULL; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + if ((instance->instance_oid.len == 0) && (array_node->array_node_count > 0)) { + /* return node with lowest OID */ + u16_t i = 0; + + result = array_node_def; + array_node_def++; + + for (i = 1; i < array_node->array_node_count; i++) { + if (array_node_def->oid < result->oid) { + result = array_node_def; + } + array_node_def++; + } + } else if (instance->instance_oid.len >= 1) { + if (instance->instance_oid.len == 1) { + /* if we have the requested OID we return its instance, otherwise we search for the next available */ + u16_t i = 0; + while (i < array_node->array_node_count) { + if (array_node_def->oid == instance->instance_oid.id[0]) { + result = array_node_def; + break; + } + + array_node_def++; + i++; + } + } + if (result == NULL) { + u32_t oid_dist = 0xFFFFFFFFUL; + u16_t i = 0; + array_node_def = array_node->array_nodes; /* may be already at the end when if case before was executed without result -> reinitialize to start */ + while (i < array_node->array_node_count) { + if ((array_node_def->oid > instance->instance_oid.id[0]) && + ((u32_t)(array_node_def->oid - instance->instance_oid.id[0]) < oid_dist)) { + result = array_node_def; + oid_dist = array_node_def->oid - instance->instance_oid.id[0]; + } + + array_node_def++; + i++; + } + } + } + + if (result == NULL) { + /* nothing to return */ + return SNMP_ERR_NOSUCHINSTANCE; + } + + instance->instance_oid.len = 2; + instance->instance_oid.id[0] = result->oid; + instance->instance_oid.id[1] = 0; + + instance->access = result->access; + instance->asn1_type = result->asn1_type; + instance->get_value = snmp_scalar_array_get_value; + instance->set_test = snmp_scalar_array_set_test; + instance->set_value = snmp_scalar_array_set_value; + instance->reference.const_ptr = result; + + return SNMP_ERR_NOERROR; +} + +static s16_t +snmp_scalar_array_get_value(struct snmp_node_instance* instance, void* value) +{ + const struct snmp_scalar_array_node* array_node = (const struct snmp_scalar_array_node*)(const void*)instance->node; + const struct snmp_scalar_array_node_def* array_node_def = (const struct snmp_scalar_array_node_def*)instance->reference.const_ptr; + + return array_node->get_value(array_node_def, value); +} + +static snmp_err_t +snmp_scalar_array_set_test(struct snmp_node_instance* instance, u16_t value_len, void* value) +{ + const struct snmp_scalar_array_node* array_node = (const struct snmp_scalar_array_node*)(const void*)instance->node; + const struct snmp_scalar_array_node_def* array_node_def = (const struct snmp_scalar_array_node_def*)instance->reference.const_ptr; + + return array_node->set_test(array_node_def, value_len, value); +} + +static snmp_err_t +snmp_scalar_array_set_value(struct snmp_node_instance* instance, u16_t value_len, void* value) +{ + const struct snmp_scalar_array_node* array_node = (const struct snmp_scalar_array_node*)(const void*)instance->node; + const struct snmp_scalar_array_node_def* array_node_def = (const struct snmp_scalar_array_node_def*)instance->reference.const_ptr; + + return array_node->set_value(array_node_def, value_len, value); +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_table.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_table.c new file mode 100644 index 0000000..63ca595 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_table.c @@ -0,0 +1,343 @@ +/** + * @file + * SNMP table support implementation. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp_core.h" +#include "lwip/apps/snmp_table.h" +#include + +snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + snmp_err_t ret = SNMP_ERR_NOSUCHINSTANCE; + const struct snmp_table_node* table_node = (const struct snmp_table_node*)(const void*)instance->node; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + /* check min. length (fixed row entry definition, column, row instance oid with at least one entry */ + /* fixed row entry always has oid 1 */ + if ((instance->instance_oid.len >= 3) && (instance->instance_oid.id[0] == 1)) { + /* search column */ + const struct snmp_table_col_def* col_def = table_node->columns; + u16_t i = table_node->column_count; + while (i > 0) { + if (col_def->index == instance->instance_oid.id[1]) { + break; + } + + col_def++; + i--; + } + + if (i > 0) { + /* everything may be overwritten by get_cell_instance_method() in order to implement special handling for single columns/cells */ + instance->asn1_type = col_def->asn1_type; + instance->access = col_def->access; + instance->get_value = table_node->get_value; + instance->set_test = table_node->set_test; + instance->set_value = table_node->set_value; + + ret = table_node->get_cell_instance( + &(instance->instance_oid.id[1]), + &(instance->instance_oid.id[2]), + instance->instance_oid.len-2, + instance); + } + } + + return ret; +} + +snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + const struct snmp_table_node* table_node = (const struct snmp_table_node*)(const void*)instance->node; + const struct snmp_table_col_def* col_def; + struct snmp_obj_id row_oid; + u32_t column = 0; + snmp_err_t result; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + /* check that first part of id is 0 or 1, referencing fixed row entry */ + if ((instance->instance_oid.len > 0) && (instance->instance_oid.id[0] > 1)) { + return SNMP_ERR_NOSUCHINSTANCE; + } + if (instance->instance_oid.len > 1) { + column = instance->instance_oid.id[1]; + } + if (instance->instance_oid.len > 2) { + snmp_oid_assign(&row_oid, &(instance->instance_oid.id[2]), instance->instance_oid.len - 2); + } else { + row_oid.len = 0; + } + + instance->get_value = table_node->get_value; + instance->set_test = table_node->set_test; + instance->set_value = table_node->set_value; + + /* resolve column and value */ + do { + u16_t i; + const struct snmp_table_col_def* next_col_def = NULL; + col_def = table_node->columns; + + for (i = 0; i < table_node->column_count; i++) { + if (col_def->index == column) { + next_col_def = col_def; + break; + } else if ((col_def->index > column) && ((next_col_def == NULL) || (col_def->index < next_col_def->index))) { + next_col_def = col_def; + } + col_def++; + } + + if (next_col_def == NULL) { + /* no further column found */ + return SNMP_ERR_NOSUCHINSTANCE; + } + + instance->asn1_type = next_col_def->asn1_type; + instance->access = next_col_def->access; + + result = table_node->get_next_cell_instance( + &next_col_def->index, + &row_oid, + instance); + + if (result == SNMP_ERR_NOERROR) { + col_def = next_col_def; + break; + } + + row_oid.len = 0; /* reset row_oid because we switch to next column and start with the first entry there */ + column = next_col_def->index + 1; + } while (1); + + /* build resulting oid */ + instance->instance_oid.len = 2; + instance->instance_oid.id[0] = 1; + instance->instance_oid.id[1] = col_def->index; + snmp_oid_append(&instance->instance_oid, row_oid.id, row_oid.len); + + return SNMP_ERR_NOERROR; +} + + +snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + snmp_err_t ret = SNMP_ERR_NOSUCHINSTANCE; + const struct snmp_table_simple_node* table_node = (const struct snmp_table_simple_node*)(const void*)instance->node; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + /* check min. length (fixed row entry definition, column, row instance oid with at least one entry */ + /* fixed row entry always has oid 1 */ + if ((instance->instance_oid.len >= 3) && (instance->instance_oid.id[0] == 1)) { + ret = table_node->get_cell_value( + &(instance->instance_oid.id[1]), + &(instance->instance_oid.id[2]), + instance->instance_oid.len-2, + &instance->reference, + &instance->reference_len); + + if (ret == SNMP_ERR_NOERROR) { + /* search column */ + const struct snmp_table_simple_col_def* col_def = table_node->columns; + u32_t i = table_node->column_count; + while (i > 0) { + if (col_def->index == instance->instance_oid.id[1]) { + break; + } + + col_def++; + i--; + } + + if (i > 0) { + instance->asn1_type = col_def->asn1_type; + instance->access = SNMP_NODE_INSTANCE_READ_ONLY; + instance->set_test = NULL; + instance->set_value = NULL; + + switch (col_def->data_type) { + case SNMP_VARIANT_VALUE_TYPE_U32: + instance->get_value = snmp_table_extract_value_from_u32ref; + break; + case SNMP_VARIANT_VALUE_TYPE_S32: + instance->get_value = snmp_table_extract_value_from_s32ref; + break; + case SNMP_VARIANT_VALUE_TYPE_PTR: /* fall through */ + case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: + instance->get_value = snmp_table_extract_value_from_refconstptr; + break; + default: + LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type)); + return SNMP_ERR_GENERROR; + } + + ret = SNMP_ERR_NOERROR; + } else { + ret = SNMP_ERR_NOSUCHINSTANCE; + } + } + } + + return ret; +} + +snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + const struct snmp_table_simple_node* table_node = (const struct snmp_table_simple_node*)(const void*)instance->node; + const struct snmp_table_simple_col_def* col_def; + struct snmp_obj_id row_oid; + u32_t column = 0; + snmp_err_t result; + + LWIP_UNUSED_ARG(root_oid); + LWIP_UNUSED_ARG(root_oid_len); + + /* check that first part of id is 0 or 1, referencing fixed row entry */ + if ((instance->instance_oid.len > 0) && (instance->instance_oid.id[0] > 1)) { + return SNMP_ERR_NOSUCHINSTANCE; + } + if (instance->instance_oid.len > 1) { + column = instance->instance_oid.id[1]; + } + if (instance->instance_oid.len > 2) { + snmp_oid_assign(&row_oid, &(instance->instance_oid.id[2]), instance->instance_oid.len - 2); + } else { + row_oid.len = 0; + } + + /* resolve column and value */ + do { + u32_t i; + const struct snmp_table_simple_col_def* next_col_def = NULL; + col_def = table_node->columns; + + for (i = 0; i < table_node->column_count; i++) { + if (col_def->index == column) { + next_col_def = col_def; + break; + } else if ((col_def->index > column) && ((next_col_def == NULL) || + (col_def->index < next_col_def->index))) { + next_col_def = col_def; + } + col_def++; + } + + if (next_col_def == NULL) { + /* no further column found */ + return SNMP_ERR_NOSUCHINSTANCE; + } + + result = table_node->get_next_cell_instance_and_value( + &next_col_def->index, + &row_oid, + &instance->reference, + &instance->reference_len); + + if (result == SNMP_ERR_NOERROR) { + col_def = next_col_def; + break; + } + + row_oid.len = 0; /* reset row_oid because we switch to next column and start with the first entry there */ + column = next_col_def->index + 1; + } + while (1); + + instance->asn1_type = col_def->asn1_type; + instance->access = SNMP_NODE_INSTANCE_READ_ONLY; + instance->set_test = NULL; + instance->set_value = NULL; + + switch (col_def->data_type) { + case SNMP_VARIANT_VALUE_TYPE_U32: + instance->get_value = snmp_table_extract_value_from_u32ref; + break; + case SNMP_VARIANT_VALUE_TYPE_S32: + instance->get_value = snmp_table_extract_value_from_s32ref; + break; + case SNMP_VARIANT_VALUE_TYPE_PTR: /* fall through */ + case SNMP_VARIANT_VALUE_TYPE_CONST_PTR: + instance->get_value = snmp_table_extract_value_from_refconstptr; + break; + default: + LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type)); + return SNMP_ERR_GENERROR; + } + + /* build resulting oid */ + instance->instance_oid.len = 2; + instance->instance_oid.id[0] = 1; + instance->instance_oid.id[1] = col_def->index; + snmp_oid_append(&instance->instance_oid, row_oid.id, row_oid.len); + + return SNMP_ERR_NOERROR; +} + + +s16_t +snmp_table_extract_value_from_s32ref(struct snmp_node_instance* instance, void* value) +{ + s32_t *dst = (s32_t*)value; + *dst = instance->reference.s32; + return sizeof(*dst); +} + +s16_t +snmp_table_extract_value_from_u32ref(struct snmp_node_instance* instance, void* value) +{ + u32_t *dst = (u32_t*)value; + *dst = instance->reference.u32; + return sizeof(*dst); +} + +s16_t +snmp_table_extract_value_from_refconstptr(struct snmp_node_instance* instance, void* value) +{ + MEMCPY(value, instance->reference.const_ptr, instance->reference_len); + return (u16_t)instance->reference_len; +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c new file mode 100644 index 0000000..204f265 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c @@ -0,0 +1,219 @@ +/** + * @file + * SNMP thread synchronization implementation. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dirk Ziegelmeier + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP && (NO_SYS == 0) /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp_threadsync.h" +#include "lwip/apps/snmp_core.h" +#include "lwip/sys.h" +#include + +static void +call_synced_function(struct threadsync_data *call_data, snmp_threadsync_called_fn fn) +{ + sys_mutex_lock(&call_data->threadsync_node->instance->sem_usage_mutex); + call_data->threadsync_node->instance->sync_fn(fn, call_data); + sys_sem_wait(&call_data->threadsync_node->instance->sem); + sys_mutex_unlock(&call_data->threadsync_node->instance->sem_usage_mutex); +} + +static void +threadsync_get_value_synced(void *ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + + call_data->retval.s16 = call_data->proxy_instance.get_value(&call_data->proxy_instance, call_data->arg1.value); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static s16_t +threadsync_get_value(struct snmp_node_instance* instance, void* value) +{ + struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; + + call_data->arg1.value = value; + call_synced_function(call_data, threadsync_get_value_synced); + + return call_data->retval.s16; +} + +static void +threadsync_set_test_synced(void *ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + + call_data->retval.err = call_data->proxy_instance.set_test(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static snmp_err_t +threadsync_set_test(struct snmp_node_instance* instance, u16_t len, void *value) +{ + struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; + + call_data->arg1.value = value; + call_data->arg2.len = len; + call_synced_function(call_data, threadsync_set_test_synced); + + return call_data->retval.err; +} + +static void +threadsync_set_value_synced(void *ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + + call_data->retval.err = call_data->proxy_instance.set_value(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static snmp_err_t +threadsync_set_value(struct snmp_node_instance* instance, u16_t len, void *value) +{ + struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; + + call_data->arg1.value = value; + call_data->arg2.len = len; + call_synced_function(call_data, threadsync_set_value_synced); + + return call_data->retval.err; +} + +static void +threadsync_release_instance_synced(void* ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + + call_data->proxy_instance.release_instance(&call_data->proxy_instance); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static void +threadsync_release_instance(struct snmp_node_instance *instance) +{ + struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; + + if (call_data->proxy_instance.release_instance != NULL) { + call_synced_function(call_data, threadsync_release_instance_synced); + } +} + +static void +get_instance_synced(void* ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + const struct snmp_leaf_node *leaf = (const struct snmp_leaf_node*)(const void*)call_data->proxy_instance.node; + + call_data->retval.err = leaf->get_instance(call_data->arg1.root_oid, call_data->arg2.root_oid_len, &call_data->proxy_instance); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static void +get_next_instance_synced(void* ctx) +{ + struct threadsync_data *call_data = (struct threadsync_data*)ctx; + const struct snmp_leaf_node *leaf = (const struct snmp_leaf_node*)(const void*)call_data->proxy_instance.node; + + call_data->retval.err = leaf->get_next_instance(call_data->arg1.root_oid, call_data->arg2.root_oid_len, &call_data->proxy_instance); + + sys_sem_signal(&call_data->threadsync_node->instance->sem); +} + +static snmp_err_t +do_sync(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance, snmp_threadsync_called_fn fn) +{ + const struct snmp_threadsync_node *threadsync_node = (const struct snmp_threadsync_node*)(const void*)instance->node; + struct threadsync_data *call_data = &threadsync_node->instance->data; + + if (threadsync_node->node.node.oid != threadsync_node->target->node.oid) { + LWIP_DEBUGF(SNMP_DEBUG, ("Sync node OID does not match target node OID")); + return SNMP_ERR_NOSUCHINSTANCE; + } + + memset(&call_data->proxy_instance, 0, sizeof(call_data->proxy_instance)); + + instance->reference.ptr = call_data; + snmp_oid_assign(&call_data->proxy_instance.instance_oid, instance->instance_oid.id, instance->instance_oid.len); + + call_data->proxy_instance.node = &threadsync_node->target->node; + call_data->threadsync_node = threadsync_node; + + call_data->arg1.root_oid = root_oid; + call_data->arg2.root_oid_len = root_oid_len; + call_synced_function(call_data, fn); + + if (call_data->retval.err == SNMP_ERR_NOERROR) { + instance->access = call_data->proxy_instance.access; + instance->asn1_type = call_data->proxy_instance.asn1_type; + instance->release_instance = threadsync_release_instance; + instance->get_value = (call_data->proxy_instance.get_value != NULL)? threadsync_get_value : NULL; + instance->set_value = (call_data->proxy_instance.set_value != NULL)? threadsync_set_value : NULL; + instance->set_test = (call_data->proxy_instance.set_test != NULL)? threadsync_set_test : NULL; + snmp_oid_assign(&instance->instance_oid, call_data->proxy_instance.instance_oid.id, call_data->proxy_instance.instance_oid.len); + } + + return call_data->retval.err; +} + +snmp_err_t +snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + return do_sync(root_oid, root_oid_len, instance, get_instance_synced); +} + +snmp_err_t +snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) +{ + return do_sync(root_oid, root_oid_len, instance, get_next_instance_synced); +} + +/** Initializes thread synchronization instance */ +void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn) +{ + err_t err = sys_mutex_new(&instance->sem_usage_mutex); + LWIP_ASSERT("Failed to set up mutex", err == ERR_OK); + err = sys_sem_new(&instance->sem, 0); + LWIP_UNUSED_ARG(err); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("Failed to set up semaphore", err == ERR_OK); + instance->sync_fn = sync_fn; +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_traps.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_traps.c new file mode 100644 index 0000000..0d2df64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmp_traps.c @@ -0,0 +1,445 @@ +/** + * @file + * SNMPv1 traps implementation. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * Christiaan Simons + * + */ + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include + +#include "lwip/snmp.h" +#include "lwip/sys.h" +#include "lwip/apps/snmp.h" +#include "lwip/apps/snmp_core.h" +#include "snmp_msg.h" +#include "snmp_asn1.h" +#include "snmp_core_priv.h" + +struct snmp_msg_trap +{ + /* source enterprise ID (sysObjectID) */ + const struct snmp_obj_id *enterprise; + /* source IP address, raw network order format */ + ip_addr_t sip; + /* generic trap code */ + u32_t gen_trap; + /* specific trap code */ + u32_t spc_trap; + /* timestamp */ + u32_t ts; + /* snmp_version */ + u32_t snmp_version; + + /* output trap lengths used in ASN encoding */ + /* encoding pdu length */ + u16_t pdulen; + /* encoding community length */ + u16_t comlen; + /* encoding sequence length */ + u16_t seqlen; + /* encoding varbinds sequence length */ + u16_t vbseqlen; +}; + +static u16_t snmp_trap_varbind_sum(struct snmp_msg_trap *trap, struct snmp_varbind *varbinds); +static u16_t snmp_trap_header_sum(struct snmp_msg_trap *trap, u16_t vb_len); +static void snmp_trap_header_enc(struct snmp_msg_trap *trap, struct snmp_pbuf_stream *pbuf_stream); +static void snmp_trap_varbind_enc(struct snmp_msg_trap *trap, struct snmp_pbuf_stream *pbuf_stream, struct snmp_varbind *varbinds); + +/** Agent community string for sending traps */ +extern const char *snmp_community_trap; + +void* snmp_traps_handle; + +struct snmp_trap_dst +{ + /* destination IP address in network order */ + ip_addr_t dip; + /* set to 0 when disabled, >0 when enabled */ + u8_t enable; +}; +static struct snmp_trap_dst trap_dst[SNMP_TRAP_DESTINATIONS]; + +static u8_t snmp_auth_traps_enabled = 0; + +/** + * @ingroup snmp_traps + * Sets enable switch for this trap destination. + * @param dst_idx index in 0 .. SNMP_TRAP_DESTINATIONS-1 + * @param enable switch if 0 destination is disabled >0 enabled. + */ +void +snmp_trap_dst_enable(u8_t dst_idx, u8_t enable) +{ + if (dst_idx < SNMP_TRAP_DESTINATIONS) { + trap_dst[dst_idx].enable = enable; + } +} + +/** + * @ingroup snmp_traps + * Sets IPv4 address for this trap destination. + * @param dst_idx index in 0 .. SNMP_TRAP_DESTINATIONS-1 + * @param dst IPv4 address in host order. + */ +void +snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst) +{ + if (dst_idx < SNMP_TRAP_DESTINATIONS) { + ip_addr_set(&trap_dst[dst_idx].dip, dst); + } +} + +/** + * @ingroup snmp_traps + * Enable/disable authentication traps + */ +void +snmp_set_auth_traps_enabled(u8_t enable) +{ + snmp_auth_traps_enabled = enable; +} + +/** + * @ingroup snmp_traps + * Get authentication traps enabled state + */ +u8_t +snmp_get_auth_traps_enabled(void) +{ + return snmp_auth_traps_enabled; +} + + +/** + * @ingroup snmp_traps + * Sends a generic or enterprise specific trap message. + * + * @param eoid points to enterprise object identifier + * @param generic_trap is the trap code + * @param specific_trap used for enterprise traps when generic_trap == 6 + * @param varbinds linked list of varbinds to be sent + * @return ERR_OK when success, ERR_MEM if we're out of memory + * + * @note the use of the enterprise identifier field + * is per RFC1215. + * Use .iso.org.dod.internet.mgmt.mib-2.snmp for generic traps + * and .iso.org.dod.internet.private.enterprises.yourenterprise + * (sysObjectID) for specific traps. + */ +err_t +snmp_send_trap(const struct snmp_obj_id* eoid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds) +{ + struct snmp_msg_trap trap_msg; + struct snmp_trap_dst *td; + struct pbuf *p; + u16_t i, tot_len; + err_t err = ERR_OK; + + trap_msg.snmp_version = 0; + + for (i = 0, td = &trap_dst[0]; i < SNMP_TRAP_DESTINATIONS; i++, td++) { + if ((td->enable != 0) && !ip_addr_isany(&td->dip)) { + /* lookup current source address for this dst */ + if (snmp_get_local_ip_for_dst(snmp_traps_handle, &td->dip, &trap_msg.sip)) { + if (eoid == NULL) { + trap_msg.enterprise = snmp_get_device_enterprise_oid(); + } else { + trap_msg.enterprise = eoid; + } + + trap_msg.gen_trap = generic_trap; + if (generic_trap == SNMP_GENTRAP_ENTERPRISE_SPECIFIC) { + trap_msg.spc_trap = specific_trap; + } else { + trap_msg.spc_trap = 0; + } + + MIB2_COPY_SYSUPTIME_TO(&trap_msg.ts); + + /* pass 0, calculate length fields */ + tot_len = snmp_trap_varbind_sum(&trap_msg, varbinds); + tot_len = snmp_trap_header_sum(&trap_msg, tot_len); + + /* allocate pbuf(s) */ + p = pbuf_alloc(PBUF_TRANSPORT, tot_len, PBUF_RAM); + if (p != NULL) { + struct snmp_pbuf_stream pbuf_stream; + snmp_pbuf_stream_init(&pbuf_stream, p, 0, tot_len); + + /* pass 1, encode packet ino the pbuf(s) */ + snmp_trap_header_enc(&trap_msg, &pbuf_stream); + snmp_trap_varbind_enc(&trap_msg, &pbuf_stream, varbinds); + + snmp_stats.outtraps++; + snmp_stats.outpkts++; + + /** send to the TRAP destination */ + snmp_sendto(snmp_traps_handle, p, &td->dip, SNMP_TRAP_PORT); + pbuf_free(p); + } else { + err = ERR_MEM; + } + } else { + /* routing error */ + err = ERR_RTE; + } + } + } + return err; +} + +/** + * @ingroup snmp_traps + * Send generic SNMP trap + */ +err_t +snmp_send_trap_generic(s32_t generic_trap) +{ + static const struct snmp_obj_id oid = { 7, { 1, 3, 6, 1, 2, 1, 11 } }; + return snmp_send_trap(&oid, generic_trap, 0, NULL); +} + +/** + * @ingroup snmp_traps + * Send specific SNMP trap with variable bindings + */ +err_t +snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds) +{ + return snmp_send_trap(NULL, SNMP_GENTRAP_ENTERPRISE_SPECIFIC, specific_trap, varbinds); +} + +/** + * @ingroup snmp_traps + * Send coldstart trap + */ +void +snmp_coldstart_trap(void) +{ + snmp_send_trap_generic(SNMP_GENTRAP_COLDSTART); +} + +/** + * @ingroup snmp_traps + * Send authentication failure trap (used internally by agent) + */ +void +snmp_authfail_trap(void) +{ + if (snmp_auth_traps_enabled != 0) { + snmp_send_trap_generic(SNMP_GENTRAP_AUTH_FAILURE); + } +} + +static u16_t +snmp_trap_varbind_sum(struct snmp_msg_trap *trap, struct snmp_varbind *varbinds) +{ + struct snmp_varbind *varbind; + u16_t tot_len; + u8_t tot_len_len; + + tot_len = 0; + varbind = varbinds; + while (varbind != NULL) { + struct snmp_varbind_len len; + + if (snmp_varbind_length(varbind, &len) == ERR_OK) { + tot_len += 1 + len.vb_len_len + len.vb_value_len; + } + + varbind = varbind->next; + } + + trap->vbseqlen = tot_len; + snmp_asn1_enc_length_cnt(trap->vbseqlen, &tot_len_len); + tot_len += 1 + tot_len_len; + + return tot_len; +} + +/** + * Sums trap header field lengths from tail to head and + * returns trap_header_lengths for second encoding pass. + * + * @param trap Trap message + * @param vb_len varbind-list length + * @return the required length for encoding the trap header + */ +static u16_t +snmp_trap_header_sum(struct snmp_msg_trap *trap, u16_t vb_len) +{ + u16_t tot_len; + u16_t len; + u8_t lenlen; + + tot_len = vb_len; + + snmp_asn1_enc_u32t_cnt(trap->ts, &len); + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + snmp_asn1_enc_s32t_cnt(trap->spc_trap, &len); + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + snmp_asn1_enc_s32t_cnt(trap->gen_trap, &len); + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + if (IP_IS_V6_VAL(trap->sip)) { +#if LWIP_IPV6 + len = sizeof(ip_2_ip6(&trap->sip)->addr); +#endif + } else { +#if LWIP_IPV4 + len = sizeof(ip_2_ip4(&trap->sip)->addr); +#endif + } + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + snmp_asn1_enc_oid_cnt(trap->enterprise->id, trap->enterprise->len, &len); + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + trap->pdulen = tot_len; + snmp_asn1_enc_length_cnt(trap->pdulen, &lenlen); + tot_len += 1 + lenlen; + + trap->comlen = (u16_t)LWIP_MIN(strlen(snmp_community_trap), 0xFFFF); + snmp_asn1_enc_length_cnt(trap->comlen, &lenlen); + tot_len += 1 + lenlen + trap->comlen; + + snmp_asn1_enc_s32t_cnt(trap->snmp_version, &len); + snmp_asn1_enc_length_cnt(len, &lenlen); + tot_len += 1 + len + lenlen; + + trap->seqlen = tot_len; + snmp_asn1_enc_length_cnt(trap->seqlen, &lenlen); + tot_len += 1 + lenlen; + + return tot_len; +} + +static void +snmp_trap_varbind_enc(struct snmp_msg_trap *trap, struct snmp_pbuf_stream *pbuf_stream, struct snmp_varbind *varbinds) +{ + struct snmp_asn1_tlv tlv; + struct snmp_varbind *varbind; + + varbind = varbinds; + + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 0, trap->vbseqlen); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + + while (varbind != NULL) { + snmp_append_outbound_varbind(pbuf_stream, varbind); + + varbind = varbind->next; + } +} + +/** + * Encodes trap header from head to tail. + */ +static void +snmp_trap_header_enc(struct snmp_msg_trap *trap, struct snmp_pbuf_stream *pbuf_stream) +{ + struct snmp_asn1_tlv tlv; + + /* 'Message' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_SEQUENCE, 0, trap->seqlen); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + + /* version */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(trap->snmp_version, &tlv.value_len); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, trap->snmp_version); + + /* community */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OCTET_STRING, 0, trap->comlen); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_raw(pbuf_stream, (const u8_t *)snmp_community_trap, trap->comlen); + + /* 'PDU' sequence */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_TRAP), 0, trap->pdulen); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + + /* object ID */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_OBJECT_ID, 0, 0); + snmp_asn1_enc_oid_cnt(trap->enterprise->id, trap->enterprise->len, &tlv.value_len); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_oid(pbuf_stream, trap->enterprise->id, trap->enterprise->len); + + /* IP addr */ + if (IP_IS_V6_VAL(trap->sip)) { +#if LWIP_IPV6 + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_IPADDR, 0, sizeof(ip_2_ip6(&trap->sip)->addr)); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_raw(pbuf_stream, (const u8_t *)&ip_2_ip6(&trap->sip)->addr, sizeof(ip_2_ip6(&trap->sip)->addr)); +#endif + } else { +#if LWIP_IPV4 + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_IPADDR, 0, sizeof(ip_2_ip4(&trap->sip)->addr)); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_raw(pbuf_stream, (const u8_t *)&ip_2_ip4(&trap->sip)->addr, sizeof(ip_2_ip4(&trap->sip)->addr)); +#endif + } + + /* trap length */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(trap->gen_trap, &tlv.value_len); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, trap->gen_trap); + + /* specific trap */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_INTEGER, 0, 0); + snmp_asn1_enc_s32t_cnt(trap->spc_trap, &tlv.value_len); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, trap->spc_trap); + + /* timestamp */ + SNMP_ASN1_SET_TLV_PARAMS(tlv, SNMP_ASN1_TYPE_TIMETICKS, 0, 0); + snmp_asn1_enc_s32t_cnt(trap->ts, &tlv.value_len); + snmp_ans1_enc_tlv(pbuf_stream, &tlv); + snmp_asn1_enc_s32t(pbuf_stream, tlv.value_len, trap->ts); +} + +#endif /* LWIP_SNMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3.c new file mode 100644 index 0000000..69fb3a0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3.c @@ -0,0 +1,136 @@ +/** + * @file + * Additional SNMPv3 functionality RFC3414 and RFC3826. + */ + +/* + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Elias Oenal + */ + +#include "snmpv3_priv.h" +#include "lwip/apps/snmpv3.h" +#include "lwip/sys.h" +#include + +#if LWIP_SNMP && LWIP_SNMP_V3 + +#ifdef LWIP_SNMPV3_INCLUDE_ENGINE +#include LWIP_SNMPV3_INCLUDE_ENGINE +#endif + +#define SNMP_MAX_TIME_BOOT 2147483647UL + +/** Call this if engine has been changed. Has to reset boots, see below */ +void +snmpv3_engine_id_changed(void) +{ + snmpv3_set_engine_boots(0); +} + +/** According to RFC3414 2.2.2. + * + * The number of times that the SNMP engine has + * (re-)initialized itself since snmpEngineID + * was last configured. + */ +u32_t +snmpv3_get_engine_boots_internal(void) +{ + if (snmpv3_get_engine_boots() == 0 || + snmpv3_get_engine_boots() < SNMP_MAX_TIME_BOOT) { + return snmpv3_get_engine_boots(); + } + + snmpv3_set_engine_boots(SNMP_MAX_TIME_BOOT); + return snmpv3_get_engine_boots(); +} + +/** RFC3414 2.2.2. + * + * Once the timer reaches 2147483647 it gets reset to zero and the + * engine boot ups get incremented. + */ +u32_t +snmpv3_get_engine_time_internal(void) +{ + if (snmpv3_get_engine_time() >= SNMP_MAX_TIME_BOOT) { + snmpv3_reset_engine_time(); + + if (snmpv3_get_engine_boots() < SNMP_MAX_TIME_BOOT - 1) { + snmpv3_set_engine_boots(snmpv3_get_engine_boots() + 1); + } else { + snmpv3_set_engine_boots(SNMP_MAX_TIME_BOOT); + } + } + + return snmpv3_get_engine_time(); +} + +#if LWIP_SNMP_V3_CRYPTO + +/* This function ignores the byte order suggestion in RFC3414 + * since it simply doesn't influence the effectiveness of an IV. + * + * Implementing RFC3826 priv param algorithm if LWIP_RAND is available. + * + * @todo: This is a potential thread safety issue. + */ +err_t +snmpv3_build_priv_param(u8_t* priv_param) +{ +#ifdef LWIP_RAND /* Based on RFC3826 */ + static u8_t init; + static u32_t priv1, priv2; + + /* Lazy initialisation */ + if (init == 0) { + init = 1; + priv1 = LWIP_RAND(); + priv2 = LWIP_RAND(); + } + + SMEMCPY(&priv_param[0], &priv1, sizeof(priv1)); + SMEMCPY(&priv_param[4], &priv2, sizeof(priv2)); + + /* Emulate 64bit increment */ + priv1++; + if (!priv1) { /* Overflow */ + priv2++; + } +#else /* Based on RFC3414 */ + static u32_t ctr; + u32_t boots = LWIP_SNMPV3_GET_ENGINE_BOOTS(); + SMEMCPY(&priv_param[0], &boots, 4); + SMEMCPY(&priv_param[4], &ctr, 4); + ctr++; +#endif + return ERR_OK; +} +#endif /* LWIP_SNMP_V3_CRYPTO */ + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c new file mode 100644 index 0000000..bdfe844 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c @@ -0,0 +1,145 @@ +/** + * @file + * Dummy SNMPv3 functions. + */ + +/* + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Elias Oenal + * Dirk Ziegelmeier + */ + +#include "lwip/apps/snmpv3.h" +#include "snmpv3_priv.h" +#include +#include "lwip/err.h" + +#if LWIP_SNMP && LWIP_SNMP_V3 + +/** + * @param username is a pointer to a string. + * @param auth_algo is a pointer to u8_t. The implementation has to set this if user was found. + * @param auth_key is a pointer to a pointer to a string. Implementation has to set this if user was found. + * @param priv_algo is a pointer to u8_t. The implementation has to set this if user was found. + * @param priv_key is a pointer to a pointer to a string. Implementation has to set this if user was found. + */ +err_t +snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *priv_algo, u8_t *priv_key) +{ + const char* engine_id; + u8_t engine_id_len; + + if(strlen(username) == 0) { + return ERR_OK; + } + + if(memcmp(username, "lwip", 4) != 0) { + return ERR_VAL; + } + + snmpv3_get_engine_id(&engine_id, &engine_id_len); + + if(auth_key != NULL) { + snmpv3_password_to_key_sha((const u8_t*)"maplesyrup", 10, + (const u8_t*)engine_id, engine_id_len, + auth_key); + *auth_algo = SNMP_V3_AUTH_ALGO_SHA; + } + if(priv_key != NULL) { + snmpv3_password_to_key_sha((const u8_t*)"maplesyrup", 10, + (const u8_t*)engine_id, engine_id_len, + priv_key); + *priv_algo = SNMP_V3_PRIV_ALGO_DES; + } + return ERR_OK; +} + +/** + * Get engine ID from persistence + * @param id + * @param len + */ +void +snmpv3_get_engine_id(const char **id, u8_t *len) +{ + *id = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02"; + *len = 12; +} + +/** + * Store engine ID in persistence + * @param id + * @param len + */ +err_t +snmpv3_set_engine_id(const char *id, u8_t len) +{ + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(len); + return ERR_OK; +} + +/** + * Get engine boots from persistence. Must be increased on each boot. + * @return + */ +u32_t +snmpv3_get_engine_boots(void) +{ + return 0; +} + +/** + * Store engine boots in persistence + * @param boots + */ +void +snmpv3_set_engine_boots(u32_t boots) +{ + LWIP_UNUSED_ARG(boots); +} + +/** + * RFC3414 2.2.2. + * Once the timer reaches 2147483647 it gets reset to zero and the + * engine boot ups get incremented. + */ +u32_t +snmpv3_get_engine_time(void) +{ + return 0; +} + +/** + * Reset current engine time to 0 + */ +void +snmpv3_reset_engine_time(void) +{ +} + +#endif /* LWIP_SNMP && LWIP_SNMP_V3 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c new file mode 100644 index 0000000..0b1eefb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c @@ -0,0 +1,331 @@ +/** + * @file + * SNMPv3 crypto/auth functions implemented for ARM mbedtls. + */ + +/* + * Copyright (c) 2016 Elias Oenal and Dirk Ziegelmeier. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Elias Oenal + * Dirk Ziegelmeier + */ + +#include "lwip/apps/snmpv3.h" +#include "snmpv3_priv.h" +#include "lwip/arch.h" +#include "snmp_msg.h" +#include "lwip/sys.h" +#include + +#if LWIP_SNMP && LWIP_SNMP_V3 && LWIP_SNMP_V3_MBEDTLS + +#include "mbedtls/md.h" +#include "mbedtls/cipher.h" + +#include "mbedtls/md5.h" +#include "mbedtls/sha1.h" + +err_t +snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, + const u8_t* key, u8_t algo, u8_t* hmac_out) +{ + u32_t i; + u8_t key_len; + const mbedtls_md_info_t *md_info; + mbedtls_md_context_t ctx; + struct snmp_pbuf_stream read_stream; + snmp_pbuf_stream_init(&read_stream, stream->pbuf, stream->offset, stream->length); + + if (algo == SNMP_V3_AUTH_ALGO_MD5) { + md_info = mbedtls_md_info_from_type(MBEDTLS_MD_MD5); + key_len = SNMP_V3_MD5_LEN; + } else if (algo == SNMP_V3_AUTH_ALGO_SHA) { + md_info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1); + key_len = SNMP_V3_SHA_LEN; + } else { + return ERR_ARG; + } + + mbedtls_md_init(&ctx); + if(mbedtls_md_setup(&ctx, md_info, 1) != 0) { + return ERR_ARG; + } + + if (mbedtls_md_hmac_starts(&ctx, key, key_len) != 0) { + goto free_md; + } + + for (i = 0; i < length; i++) { + u8_t byte; + + if (snmp_pbuf_stream_read(&read_stream, &byte)) { + goto free_md; + } + + if (mbedtls_md_hmac_update(&ctx, &byte, 1) != 0) { + goto free_md; + } + } + + if (mbedtls_md_hmac_finish(&ctx, hmac_out) != 0) { + goto free_md; + } + + mbedtls_md_free(&ctx); + return ERR_OK; + +free_md: + mbedtls_md_free(&ctx); + return ERR_ARG; +} + +#if LWIP_SNMP_V3_CRYPTO + +err_t +snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, + const u8_t* key, const u8_t* priv_param, const u32_t engine_boots, + const u32_t engine_time, u8_t algo, u8_t mode) +{ + size_t i; + mbedtls_cipher_context_t ctx; + const mbedtls_cipher_info_t *cipher_info; + + struct snmp_pbuf_stream read_stream; + struct snmp_pbuf_stream write_stream; + snmp_pbuf_stream_init(&read_stream, stream->pbuf, stream->offset, stream->length); + snmp_pbuf_stream_init(&write_stream, stream->pbuf, stream->offset, stream->length); + mbedtls_cipher_init(&ctx); + + if (algo == SNMP_V3_PRIV_ALGO_DES) { + u8_t iv_local[8]; + u8_t out_bytes[8]; + size_t out_len; + + /* RFC 3414 mandates padding for DES */ + if ((length & 0x07) != 0) { + return ERR_ARG; + } + + cipher_info = mbedtls_cipher_info_from_type(MBEDTLS_CIPHER_DES_CBC); + if(mbedtls_cipher_setup(&ctx, cipher_info) != 0) { + return ERR_ARG; + } + if(mbedtls_cipher_set_padding_mode(&ctx, MBEDTLS_PADDING_NONE) != 0) { + return ERR_ARG; + } + if(mbedtls_cipher_setkey(&ctx, key, 8*8, (mode == SNMP_V3_PRIV_MODE_ENCRYPT)? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT) != 0) { + goto error; + } + + /* Prepare IV */ + for (i = 0; i < LWIP_ARRAYSIZE(iv_local); i++) { + iv_local[i] = priv_param[i] ^ key[i + 8]; + } + if(mbedtls_cipher_set_iv(&ctx, iv_local, LWIP_ARRAYSIZE(iv_local)) != 0) { + goto error; + } + + for (i = 0; i < length; i += 8) { + size_t j; + u8_t in_bytes[8]; + out_len = LWIP_ARRAYSIZE(out_bytes) ; + + for (j = 0; j < LWIP_ARRAYSIZE(in_bytes); j++) { + snmp_pbuf_stream_read(&read_stream, &in_bytes[j]); + } + + if(mbedtls_cipher_update(&ctx, in_bytes, LWIP_ARRAYSIZE(in_bytes), out_bytes, &out_len) != 0) { + goto error; + } + + snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); + } + + out_len = LWIP_ARRAYSIZE(out_bytes); + if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) { + goto error; + } + snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); + } else if (algo == SNMP_V3_PRIV_ALGO_AES) { + u8_t iv_local[16]; + + cipher_info = mbedtls_cipher_info_from_type(MBEDTLS_CIPHER_AES_128_CFB128); + if(mbedtls_cipher_setup(&ctx, cipher_info) != 0) { + return ERR_ARG; + } + if(mbedtls_cipher_setkey(&ctx, key, 16*8, (mode == SNMP_V3_PRIV_MODE_ENCRYPT)? MBEDTLS_ENCRYPT : MBEDTLS_DECRYPT) != 0) { + goto error; + } + + /* + * IV is the big endian concatenation of boots, + * uptime and priv param - see RFC3826. + */ + iv_local[0 + 0] = (engine_boots >> 24) & 0xFF; + iv_local[0 + 1] = (engine_boots >> 16) & 0xFF; + iv_local[0 + 2] = (engine_boots >> 8) & 0xFF; + iv_local[0 + 3] = (engine_boots >> 0) & 0xFF; + iv_local[4 + 0] = (engine_time >> 24) & 0xFF; + iv_local[4 + 1] = (engine_time >> 16) & 0xFF; + iv_local[4 + 2] = (engine_time >> 8) & 0xFF; + iv_local[4 + 3] = (engine_time >> 0) & 0xFF; + SMEMCPY(iv_local + 8, priv_param, 8); + if(mbedtls_cipher_set_iv(&ctx, iv_local, LWIP_ARRAYSIZE(iv_local)) != 0) { + goto error; + } + + for (i = 0; i < length; i++) { + u8_t in_byte; + u8_t out_byte; + size_t out_len = sizeof(out_byte); + + snmp_pbuf_stream_read(&read_stream, &in_byte); + if(mbedtls_cipher_update(&ctx, &in_byte, sizeof(in_byte), &out_byte, &out_len) != 0) { + goto error; + } + snmp_pbuf_stream_write(&write_stream, out_byte); + } + } else { + return ERR_ARG; + } + + mbedtls_cipher_free(&ctx); + return ERR_OK; + +error: + mbedtls_cipher_free(&ctx); + return ERR_OK; +} + +#endif /* LWIP_SNMP_V3_CRYPTO */ + +/* A.2.1. Password to Key Sample Code for MD5 */ +void +snmpv3_password_to_key_md5( + const u8_t *password, /* IN */ + u8_t passwordlen, /* IN */ + const u8_t *engineID, /* IN - pointer to snmpEngineID */ + u8_t engineLength,/* IN - length of snmpEngineID */ + u8_t *key) /* OUT - pointer to caller 16-octet buffer */ +{ + mbedtls_md5_context MD; + u8_t *cp, password_buf[64]; + u32_t password_index = 0; + u8_t i; + u32_t count = 0; + + mbedtls_md5_init(&MD); /* initialize MD5 */ + mbedtls_md5_starts(&MD); + + /**********************************************/ + /* Use while loop until we've done 1 Megabyte */ + /**********************************************/ + while (count < 1048576) { + cp = password_buf; + for (i = 0; i < 64; i++) { + /*************************************************/ + /* Take the next octet of the password, wrapping */ + /* to the beginning of the password as necessary.*/ + /*************************************************/ + *cp++ = password[password_index++ % passwordlen]; + } + mbedtls_md5_update(&MD, password_buf, 64); + count += 64; + } + mbedtls_md5_finish(&MD, key); /* tell MD5 we're done */ + + /*****************************************************/ + /* Now localize the key with the engineID and pass */ + /* through MD5 to produce final key */ + /* May want to ensure that engineLength <= 32, */ + /* otherwise need to use a buffer larger than 64 */ + /*****************************************************/ + SMEMCPY(password_buf, key, 16); + MEMCPY(password_buf + 16, engineID, engineLength); + SMEMCPY(password_buf + 16 + engineLength, key, 16); + + mbedtls_md5_starts(&MD); + mbedtls_md5_update(&MD, password_buf, 32 + engineLength); + mbedtls_md5_finish(&MD, key); + + mbedtls_md5_free(&MD); + return; +} + +/* A.2.2. Password to Key Sample Code for SHA */ +void +snmpv3_password_to_key_sha( + const u8_t *password, /* IN */ + u8_t passwordlen, /* IN */ + const u8_t *engineID, /* IN - pointer to snmpEngineID */ + u8_t engineLength,/* IN - length of snmpEngineID */ + u8_t *key) /* OUT - pointer to caller 20-octet buffer */ +{ + mbedtls_sha1_context SH; + u8_t *cp, password_buf[72]; + u32_t password_index = 0; + u8_t i; + u32_t count = 0; + + mbedtls_sha1_init(&SH); /* initialize SHA */ + mbedtls_sha1_starts(&SH); + + /**********************************************/ + /* Use while loop until we've done 1 Megabyte */ + /**********************************************/ + while (count < 1048576) { + cp = password_buf; + for (i = 0; i < 64; i++) { + /*************************************************/ + /* Take the next octet of the password, wrapping */ + /* to the beginning of the password as necessary.*/ + /*************************************************/ + *cp++ = password[password_index++ % passwordlen]; + } + mbedtls_sha1_update(&SH, password_buf, 64); + count += 64; + } + mbedtls_sha1_finish(&SH, key); /* tell SHA we're done */ + + /*****************************************************/ + /* Now localize the key with the engineID and pass */ + /* through SHA to produce final key */ + /* May want to ensure that engineLength <= 32, */ + /* otherwise need to use a buffer larger than 72 */ + /*****************************************************/ + SMEMCPY(password_buf, key, 20); + MEMCPY(password_buf + 20, engineID, engineLength); + SMEMCPY(password_buf + 20 + engineLength, key, 20); + + mbedtls_sha1_starts(&SH); + mbedtls_sha1_update(&SH, password_buf, 40 + engineLength); + mbedtls_sha1_finish(&SH, key); + + mbedtls_sha1_free(&SH); + return; +} + +#endif /* LWIP_SNMP && LWIP_SNMP_V3 && LWIP_SNMP_V3_MBEDTLS */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_priv.h new file mode 100644 index 0000000..b87666d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/snmp/snmpv3_priv.h @@ -0,0 +1,66 @@ +/** + * @file + * Additional SNMPv3 functionality RFC3414 and RFC3826 (internal API, do not use in client code). + */ + +/* + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Elias Oenal + */ + +#ifndef LWIP_HDR_APPS_SNMP_V3_PRIV_H +#define LWIP_HDR_APPS_SNMP_V3_PRIV_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP && LWIP_SNMP_V3 + +#include "snmp_pbuf_stream.h" + +/* According to RFC 3411 */ +#define SNMP_V3_MAX_ENGINE_ID_LENGTH 32 +#define SNMP_V3_MAX_USER_LENGTH 32 + +#define SNMP_V3_MAX_AUTH_PARAM_LENGTH 12 +#define SNMP_V3_MAX_PRIV_PARAM_LENGTH 8 + +#define SNMP_V3_AUTH_FLAG 0x01 +#define SNMP_V3_PRIV_FLAG 0x02 + +#define SNMP_V3_MD5_LEN 16 +#define SNMP_V3_SHA_LEN 20 + +u32_t snmpv3_get_engine_boots_internal(void); +u32_t snmpv3_get_engine_time_internal(void); +err_t snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, const u8_t* key, u8_t algo, u8_t* hmac_out); +err_t snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, const u8_t* key, + const u8_t* priv_param, const u32_t engine_boots, const u32_t engine_time, u8_t algo, u8_t mode); +err_t snmpv3_build_priv_param(u8_t* priv_param); + +#endif + +#endif /* LWIP_HDR_APPS_SNMP_V3_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/sntp/sntp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/sntp/sntp.c new file mode 100644 index 0000000..71b2abe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/sntp/sntp.c @@ -0,0 +1,727 @@ +/** + * @file + * SNTP client module + */ + +/* + * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Frédéric Bernon, Simon Goldschmidt + */ + + +/** + * @defgroup sntp SNTP + * @ingroup apps + * + * This is simple "SNTP" client for the lwIP raw API. + * It is a minimal implementation of SNTPv4 as specified in RFC 4330. + * + * For a list of some public NTP servers, see this link : + * http://support.ntp.org/bin/view/Servers/NTPPoolServers + * + * @todo: + * - set/change servers at runtime + * - complete SNTP_CHECK_RESPONSE checks 3 and 4 + */ + +#include "lwip/apps/sntp.h" + +#include "lwip/opt.h" +#include "lwip/timeouts.h" +#include "lwip/udp.h" +#include "lwip/dns.h" +#include "lwip/ip_addr.h" +#include "lwip/pbuf.h" +#include "lwip/dhcp.h" + +#include +#include + +#if LWIP_UDP + +/* Handle support for more than one server via SNTP_MAX_SERVERS */ +#if SNTP_MAX_SERVERS > 1 +#define SNTP_SUPPORT_MULTIPLE_SERVERS 1 +#else /* NTP_MAX_SERVERS > 1 */ +#define SNTP_SUPPORT_MULTIPLE_SERVERS 0 +#endif /* NTP_MAX_SERVERS > 1 */ + +#if (SNTP_UPDATE_DELAY < 15000) && !defined(SNTP_SUPPRESS_DELAY_CHECK) +#error "SNTPv4 RFC 4330 enforces a minimum update time of 15 seconds (define SNTP_SUPPRESS_DELAY_CHECK to disable this error)!" +#endif + +/* Configure behaviour depending on microsecond or second precision */ +#ifdef SNTP_SET_SYSTEM_TIME_US +#define SNTP_CALC_TIME_US 1 +#define SNTP_RECEIVE_TIME_SIZE 2 +#else +#define SNTP_SET_SYSTEM_TIME_US(sec, us) +#define SNTP_CALC_TIME_US 0 +#define SNTP_RECEIVE_TIME_SIZE 1 +#endif + + +/* the various debug levels for this file */ +#define SNTP_DEBUG_TRACE (SNTP_DEBUG | LWIP_DBG_TRACE) +#define SNTP_DEBUG_STATE (SNTP_DEBUG | LWIP_DBG_STATE) +#define SNTP_DEBUG_WARN (SNTP_DEBUG | LWIP_DBG_LEVEL_WARNING) +#define SNTP_DEBUG_WARN_STATE (SNTP_DEBUG | LWIP_DBG_LEVEL_WARNING | LWIP_DBG_STATE) +#define SNTP_DEBUG_SERIOUS (SNTP_DEBUG | LWIP_DBG_LEVEL_SERIOUS) + +#define SNTP_ERR_KOD 1 + +/* SNTP protocol defines */ +#define SNTP_MSG_LEN 48 + +#define SNTP_OFFSET_LI_VN_MODE 0 +#define SNTP_LI_MASK 0xC0 +#define SNTP_LI_NO_WARNING 0x00 +#define SNTP_LI_LAST_MINUTE_61_SEC 0x01 +#define SNTP_LI_LAST_MINUTE_59_SEC 0x02 +#define SNTP_LI_ALARM_CONDITION 0x03 /* (clock not synchronized) */ + +#define SNTP_VERSION_MASK 0x38 +#define SNTP_VERSION (4/* NTP Version 4*/<<3) + +#define SNTP_MODE_MASK 0x07 +#define SNTP_MODE_CLIENT 0x03 +#define SNTP_MODE_SERVER 0x04 +#define SNTP_MODE_BROADCAST 0x05 + +#define SNTP_OFFSET_STRATUM 1 +#define SNTP_STRATUM_KOD 0x00 + +#define SNTP_OFFSET_ORIGINATE_TIME 24 +#define SNTP_OFFSET_RECEIVE_TIME 32 +#define SNTP_OFFSET_TRANSMIT_TIME 40 + +/* number of seconds between 1900 and 1970 (MSB=1)*/ +#define DIFF_SEC_1900_1970 (2208988800UL) +/* number of seconds between 1970 and Feb 7, 2036 (6:28:16 UTC) (MSB=0) */ +#define DIFF_SEC_1970_2036 (2085978496UL) + +/** + * SNTP packet format (without optional fields) + * Timestamps are coded as 64 bits: + * - 32 bits seconds since Jan 01, 1970, 00:00 + * - 32 bits seconds fraction (0-padded) + * For future use, if the MSB in the seconds part is set, seconds are based + * on Feb 07, 2036, 06:28:16. + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct sntp_msg { + PACK_STRUCT_FLD_8(u8_t li_vn_mode); + PACK_STRUCT_FLD_8(u8_t stratum); + PACK_STRUCT_FLD_8(u8_t poll); + PACK_STRUCT_FLD_8(u8_t precision); + PACK_STRUCT_FIELD(u32_t root_delay); + PACK_STRUCT_FIELD(u32_t root_dispersion); + PACK_STRUCT_FIELD(u32_t reference_identifier); + PACK_STRUCT_FIELD(u32_t reference_timestamp[2]); + PACK_STRUCT_FIELD(u32_t originate_timestamp[2]); + PACK_STRUCT_FIELD(u32_t receive_timestamp[2]); + PACK_STRUCT_FIELD(u32_t transmit_timestamp[2]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* function prototypes */ +static void sntp_request(void *arg); + +/** The operating mode */ +static u8_t sntp_opmode; + +/** The UDP pcb used by the SNTP client */ +static struct udp_pcb* sntp_pcb; +/** Names/Addresses of servers */ +struct sntp_server { +#if SNTP_SERVER_DNS + char* name; +#endif /* SNTP_SERVER_DNS */ + ip_addr_t addr; +}; +static struct sntp_server sntp_servers[SNTP_MAX_SERVERS]; + +#if SNTP_GET_SERVERS_FROM_DHCP +static u8_t sntp_set_servers_from_dhcp; +#endif /* SNTP_GET_SERVERS_FROM_DHCP */ +#if SNTP_SUPPORT_MULTIPLE_SERVERS +/** The currently used server (initialized to 0) */ +static u8_t sntp_current_server; +#else /* SNTP_SUPPORT_MULTIPLE_SERVERS */ +#define sntp_current_server 0 +#endif /* SNTP_SUPPORT_MULTIPLE_SERVERS */ + +#if SNTP_RETRY_TIMEOUT_EXP +#define SNTP_RESET_RETRY_TIMEOUT() sntp_retry_timeout = SNTP_RETRY_TIMEOUT +/** Retry time, initialized with SNTP_RETRY_TIMEOUT and doubled with each retry. */ +static u32_t sntp_retry_timeout; +#else /* SNTP_RETRY_TIMEOUT_EXP */ +#define SNTP_RESET_RETRY_TIMEOUT() +#define sntp_retry_timeout SNTP_RETRY_TIMEOUT +#endif /* SNTP_RETRY_TIMEOUT_EXP */ + +#if SNTP_CHECK_RESPONSE >= 1 +/** Saves the last server address to compare with response */ +static ip_addr_t sntp_last_server_address; +#endif /* SNTP_CHECK_RESPONSE >= 1 */ + +#if SNTP_CHECK_RESPONSE >= 2 +/** Saves the last timestamp sent (which is sent back by the server) + * to compare against in response */ +static u32_t sntp_last_timestamp_sent[2]; +#endif /* SNTP_CHECK_RESPONSE >= 2 */ + +/** + * SNTP processing of received timestamp + */ +static void +sntp_process(u32_t *receive_timestamp) +{ + /* convert SNTP time (1900-based) to unix GMT time (1970-based) + * if MSB is 0, SNTP time is 2036-based! + */ + u32_t rx_secs = lwip_ntohl(receive_timestamp[0]); + int is_1900_based = ((rx_secs & 0x80000000) != 0); + u32_t t = is_1900_based ? (rx_secs - DIFF_SEC_1900_1970) : (rx_secs + DIFF_SEC_1970_2036); + time_t tim = t; + +#if SNTP_CALC_TIME_US + u32_t us = lwip_ntohl(receive_timestamp[1]) / 4295; + SNTP_SET_SYSTEM_TIME_US(t, us); + /* display local time from GMT time */ + LWIP_DEBUGF(SNTP_DEBUG_TRACE, ("sntp_process: %s, %"U32_F" us", ctime(&tim), us)); + +#else /* SNTP_CALC_TIME_US */ + + /* change system time and/or the update the RTC clock */ + SNTP_SET_SYSTEM_TIME(t); + /* display local time from GMT time */ + LWIP_DEBUGF(SNTP_DEBUG_TRACE, ("sntp_process: %s", ctime(&tim))); +#endif /* SNTP_CALC_TIME_US */ + LWIP_UNUSED_ARG(tim); +} + +/** + * Initialize request struct to be sent to server. + */ +static void +sntp_initialize_request(struct sntp_msg *req) +{ + memset(req, 0, SNTP_MSG_LEN); + req->li_vn_mode = SNTP_LI_NO_WARNING | SNTP_VERSION | SNTP_MODE_CLIENT; + +#if SNTP_CHECK_RESPONSE >= 2 + { + u32_t sntp_time_sec, sntp_time_us; + /* fill in transmit timestamp and save it in 'sntp_last_timestamp_sent' */ + SNTP_GET_SYSTEM_TIME(sntp_time_sec, sntp_time_us); + sntp_last_timestamp_sent[0] = lwip_htonl(sntp_time_sec + DIFF_SEC_1900_1970); + req->transmit_timestamp[0] = sntp_last_timestamp_sent[0]; + /* we send/save us instead of fraction to be faster... */ + sntp_last_timestamp_sent[1] = lwip_htonl(sntp_time_us); + req->transmit_timestamp[1] = sntp_last_timestamp_sent[1]; + } +#endif /* SNTP_CHECK_RESPONSE >= 2 */ +} + +/** + * Retry: send a new request (and increase retry timeout). + * + * @param arg is unused (only necessary to conform to sys_timeout) + */ +static void +sntp_retry(void* arg) +{ + LWIP_UNUSED_ARG(arg); + + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_retry: Next request will be sent in %"U32_F" ms\n", + sntp_retry_timeout)); + + /* set up a timer to send a retry and increase the retry delay */ + sys_timeout(sntp_retry_timeout, sntp_request, NULL); + +#if SNTP_RETRY_TIMEOUT_EXP + { + u32_t new_retry_timeout; + /* increase the timeout for next retry */ + new_retry_timeout = sntp_retry_timeout << 1; + /* limit to maximum timeout and prevent overflow */ + if ((new_retry_timeout <= SNTP_RETRY_TIMEOUT_MAX) && + (new_retry_timeout > sntp_retry_timeout)) { + sntp_retry_timeout = new_retry_timeout; + } + } +#endif /* SNTP_RETRY_TIMEOUT_EXP */ +} + +#if SNTP_SUPPORT_MULTIPLE_SERVERS +/** + * If Kiss-of-Death is received (or another packet parsing error), + * try the next server or retry the current server and increase the retry + * timeout if only one server is available. + * (implicitly, SNTP_MAX_SERVERS > 1) + * + * @param arg is unused (only necessary to conform to sys_timeout) + */ +static void +sntp_try_next_server(void* arg) +{ + u8_t old_server, i; + LWIP_UNUSED_ARG(arg); + + old_server = sntp_current_server; + for (i = 0; i < SNTP_MAX_SERVERS - 1; i++) { + sntp_current_server++; + if (sntp_current_server >= SNTP_MAX_SERVERS) { + sntp_current_server = 0; + } + if (!ip_addr_isany(&sntp_servers[sntp_current_server].addr) +#if SNTP_SERVER_DNS + || (sntp_servers[sntp_current_server].name != NULL) +#endif + ) { + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_try_next_server: Sending request to server %"U16_F"\n", + (u16_t)sntp_current_server)); + /* new server: reset retry timeout */ + SNTP_RESET_RETRY_TIMEOUT(); + /* instantly send a request to the next server */ + sntp_request(NULL); + return; + } + } + /* no other valid server found */ + sntp_current_server = old_server; + sntp_retry(NULL); +} +#else /* SNTP_SUPPORT_MULTIPLE_SERVERS */ +/* Always retry on error if only one server is supported */ +#define sntp_try_next_server sntp_retry +#endif /* SNTP_SUPPORT_MULTIPLE_SERVERS */ + +/** UDP recv callback for the sntp pcb */ +static void +sntp_recv(void *arg, struct udp_pcb* pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + u8_t mode; + u8_t stratum; + u32_t receive_timestamp[SNTP_RECEIVE_TIME_SIZE]; + err_t err; + + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(pcb); + + /* packet received: stop retry timeout */ + sys_untimeout(sntp_try_next_server, NULL); + sys_untimeout(sntp_request, NULL); + + err = ERR_ARG; +#if SNTP_CHECK_RESPONSE >= 1 + /* check server address and port */ + if (((sntp_opmode != SNTP_OPMODE_POLL) || ip_addr_cmp(addr, &sntp_last_server_address)) && + (port == SNTP_PORT)) +#else /* SNTP_CHECK_RESPONSE >= 1 */ + LWIP_UNUSED_ARG(addr); + LWIP_UNUSED_ARG(port); +#endif /* SNTP_CHECK_RESPONSE >= 1 */ + { + /* process the response */ + if (p->tot_len == SNTP_MSG_LEN) { + pbuf_copy_partial(p, &mode, 1, SNTP_OFFSET_LI_VN_MODE); + mode &= SNTP_MODE_MASK; + /* if this is a SNTP response... */ + if (((sntp_opmode == SNTP_OPMODE_POLL) && (mode == SNTP_MODE_SERVER)) || + ((sntp_opmode == SNTP_OPMODE_LISTENONLY) && (mode == SNTP_MODE_BROADCAST))) { + pbuf_copy_partial(p, &stratum, 1, SNTP_OFFSET_STRATUM); + if (stratum == SNTP_STRATUM_KOD) { + /* Kiss-of-death packet. Use another server or increase UPDATE_DELAY. */ + err = SNTP_ERR_KOD; + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_recv: Received Kiss-of-Death\n")); + } else { +#if SNTP_CHECK_RESPONSE >= 2 + /* check originate_timetamp against sntp_last_timestamp_sent */ + u32_t originate_timestamp[2]; + pbuf_copy_partial(p, &originate_timestamp, 8, SNTP_OFFSET_ORIGINATE_TIME); + if ((originate_timestamp[0] != sntp_last_timestamp_sent[0]) || + (originate_timestamp[1] != sntp_last_timestamp_sent[1])) + { + LWIP_DEBUGF(SNTP_DEBUG_WARN, ("sntp_recv: Invalid originate timestamp in response\n")); + } else +#endif /* SNTP_CHECK_RESPONSE >= 2 */ + /* @todo: add code for SNTP_CHECK_RESPONSE >= 3 and >= 4 here */ + { + /* correct answer */ + err = ERR_OK; + pbuf_copy_partial(p, &receive_timestamp, SNTP_RECEIVE_TIME_SIZE * 4, SNTP_OFFSET_TRANSMIT_TIME); + } + } + } else { + LWIP_DEBUGF(SNTP_DEBUG_WARN, ("sntp_recv: Invalid mode in response: %"U16_F"\n", (u16_t)mode)); + /* wait for correct response */ + err = ERR_TIMEOUT; + } + } else { + LWIP_DEBUGF(SNTP_DEBUG_WARN, ("sntp_recv: Invalid packet length: %"U16_F"\n", p->tot_len)); + } + } +#if SNTP_CHECK_RESPONSE >= 1 + else { + /* packet from wrong remote address or port, wait for correct response */ + err = ERR_TIMEOUT; + } +#endif /* SNTP_CHECK_RESPONSE >= 1 */ + pbuf_free(p); + if (err == ERR_OK) { + sntp_process(receive_timestamp); + + /* Set up timeout for next request (only if poll response was received)*/ + if (sntp_opmode == SNTP_OPMODE_POLL) { + /* Correct response, reset retry timeout */ + SNTP_RESET_RETRY_TIMEOUT(); + + sys_timeout((u32_t)SNTP_UPDATE_DELAY, sntp_request, NULL); + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_recv: Scheduled next time request: %"U32_F" ms\n", + (u32_t)SNTP_UPDATE_DELAY)); + } + } else if (err != ERR_TIMEOUT) { + /* Errors are only processed in case of an explicit poll response */ + if (sntp_opmode == SNTP_OPMODE_POLL) { + if (err == SNTP_ERR_KOD) { + /* Kiss-of-death packet. Use another server or increase UPDATE_DELAY. */ + sntp_try_next_server(NULL); + } else { + /* another error, try the same server again */ + sntp_retry(NULL); + } + } + } +} + +/** Actually send an sntp request to a server. + * + * @param server_addr resolved IP address of the SNTP server + */ +static void +sntp_send_request(const ip_addr_t *server_addr) +{ + struct pbuf* p; + p = pbuf_alloc(PBUF_TRANSPORT, SNTP_MSG_LEN, PBUF_RAM); + if (p != NULL) { + struct sntp_msg *sntpmsg = (struct sntp_msg *)p->payload; + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_send_request: Sending request to server\n")); + /* initialize request message */ + sntp_initialize_request(sntpmsg); + /* send request */ + udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT); + /* free the pbuf after sending it */ + pbuf_free(p); + /* set up receive timeout: try next server or retry on timeout */ + sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL); +#if SNTP_CHECK_RESPONSE >= 1 + /* save server address to verify it in sntp_recv */ + ip_addr_set(&sntp_last_server_address, server_addr); +#endif /* SNTP_CHECK_RESPONSE >= 1 */ + } else { + LWIP_DEBUGF(SNTP_DEBUG_SERIOUS, ("sntp_send_request: Out of memory, trying again in %"U32_F" ms\n", + (u32_t)SNTP_RETRY_TIMEOUT)); + /* out of memory: set up a timer to send a retry */ + sys_timeout((u32_t)SNTP_RETRY_TIMEOUT, sntp_request, NULL); + } +} + +#if SNTP_SERVER_DNS +/** + * DNS found callback when using DNS names as server address. + */ +static void +sntp_dns_found(const char* hostname, const ip_addr_t *ipaddr, void *arg) +{ + LWIP_UNUSED_ARG(hostname); + LWIP_UNUSED_ARG(arg); + + if (ipaddr != NULL) { + /* Address resolved, send request */ + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_dns_found: Server address resolved, sending request\n")); + sntp_send_request(ipaddr); + } else { + /* DNS resolving failed -> try another server */ + LWIP_DEBUGF(SNTP_DEBUG_WARN_STATE, ("sntp_dns_found: Failed to resolve server address resolved, trying next server\n")); + sntp_try_next_server(NULL); + } +} +#endif /* SNTP_SERVER_DNS */ + +/** + * Send out an sntp request. + * + * @param arg is unused (only necessary to conform to sys_timeout) + */ +static void +sntp_request(void *arg) +{ + ip_addr_t sntp_server_address; + err_t err; + + LWIP_UNUSED_ARG(arg); + + /* initialize SNTP server address */ +#if SNTP_SERVER_DNS + if (sntp_servers[sntp_current_server].name) { + /* always resolve the name and rely on dns-internal caching & timeout */ + ip_addr_set_zero(&sntp_servers[sntp_current_server].addr); + err = dns_gethostbyname(sntp_servers[sntp_current_server].name, &sntp_server_address, + sntp_dns_found, NULL); + if (err == ERR_INPROGRESS) { + /* DNS request sent, wait for sntp_dns_found being called */ + LWIP_DEBUGF(SNTP_DEBUG_STATE, ("sntp_request: Waiting for server address to be resolved.\n")); + return; + } else if (err == ERR_OK) { + sntp_servers[sntp_current_server].addr = sntp_server_address; + } + } else +#endif /* SNTP_SERVER_DNS */ + { + sntp_server_address = sntp_servers[sntp_current_server].addr; + err = (ip_addr_isany_val(sntp_server_address)) ? ERR_ARG : ERR_OK; + } + + if (err == ERR_OK) { + LWIP_DEBUGF(SNTP_DEBUG_TRACE, ("sntp_request: current server address is %s\n", + ipaddr_ntoa(&sntp_server_address))); + sntp_send_request(&sntp_server_address); + } else { + /* address conversion failed, try another server */ + LWIP_DEBUGF(SNTP_DEBUG_WARN_STATE, ("sntp_request: Invalid server address, trying next server.\n")); + sys_timeout((u32_t)SNTP_RETRY_TIMEOUT, sntp_try_next_server, NULL); + } +} + +/** + * @ingroup sntp + * Initialize this module. + * Send out request instantly or after SNTP_STARTUP_DELAY(_FUNC). + */ +void +sntp_init(void) +{ +#ifdef SNTP_SERVER_ADDRESS +#if SNTP_SERVER_DNS + sntp_setservername(0, SNTP_SERVER_ADDRESS); +#else +#error SNTP_SERVER_ADDRESS string not supported SNTP_SERVER_DNS==0 +#endif +#endif /* SNTP_SERVER_ADDRESS */ + + if (sntp_pcb == NULL) { + sntp_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); + LWIP_ASSERT("Failed to allocate udp pcb for sntp client", sntp_pcb != NULL); + if (sntp_pcb != NULL) { + udp_recv(sntp_pcb, sntp_recv, NULL); + + if (sntp_opmode == SNTP_OPMODE_POLL) { + SNTP_RESET_RETRY_TIMEOUT(); +#if SNTP_STARTUP_DELAY + sys_timeout((u32_t)SNTP_STARTUP_DELAY_FUNC, sntp_request, NULL); +#else + sntp_request(NULL); +#endif + } else if (sntp_opmode == SNTP_OPMODE_LISTENONLY) { + ip_set_option(sntp_pcb, SOF_BROADCAST); + udp_bind(sntp_pcb, IP_ANY_TYPE, SNTP_PORT); + } + } + } +} + +/** + * @ingroup sntp + * Stop this module. + */ +void +sntp_stop(void) +{ + if (sntp_pcb != NULL) { + sys_untimeout(sntp_request, NULL); + sys_untimeout(sntp_try_next_server, NULL); + udp_remove(sntp_pcb); + sntp_pcb = NULL; + } +} + +/** + * @ingroup sntp + * Get enabled state. + */ +u8_t sntp_enabled(void) +{ + return (sntp_pcb != NULL)? 1 : 0; +} + +/** + * @ingroup sntp + * Sets the operating mode. + * @param operating_mode one of the available operating modes + */ +void +sntp_setoperatingmode(u8_t operating_mode) +{ + LWIP_ASSERT("Invalid operating mode", operating_mode <= SNTP_OPMODE_LISTENONLY); + LWIP_ASSERT("Operating mode must not be set while SNTP client is running", sntp_pcb == NULL); + sntp_opmode = operating_mode; +} + +/** + * @ingroup sntp + * Gets the operating mode. + */ +u8_t +sntp_getoperatingmode(void) +{ + return sntp_opmode; +} + +#if SNTP_GET_SERVERS_FROM_DHCP +/** + * Config SNTP server handling by IP address, name, or DHCP; clear table + * @param set_servers_from_dhcp enable or disable getting server addresses from dhcp + */ +void +sntp_servermode_dhcp(int set_servers_from_dhcp) +{ + u8_t new_mode = set_servers_from_dhcp ? 1 : 0; + if (sntp_set_servers_from_dhcp != new_mode) { + sntp_set_servers_from_dhcp = new_mode; + } +} +#endif /* SNTP_GET_SERVERS_FROM_DHCP */ + +/** + * @ingroup sntp + * Initialize one of the NTP servers by IP address + * + * @param idx the index of the NTP server to set must be < SNTP_MAX_SERVERS + * @param server IP address of the NTP server to set + */ +void +sntp_setserver(u8_t idx, const ip_addr_t *server) +{ + if (idx < SNTP_MAX_SERVERS) { + if (server != NULL) { + sntp_servers[idx].addr = (*server); + } else { + ip_addr_set_zero(&sntp_servers[idx].addr); + } +#if SNTP_SERVER_DNS + sntp_servers[idx].name = NULL; +#endif + } +} + +#if LWIP_DHCP && SNTP_GET_SERVERS_FROM_DHCP +/** + * Initialize one of the NTP servers by IP address, required by DHCP + * + * @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS + * @param dnsserver IP address of the NTP server to set + */ +void +dhcp_set_ntp_servers(u8_t num, const ip4_addr_t *server) +{ + LWIP_DEBUGF(SNTP_DEBUG_TRACE, ("sntp: %s %u.%u.%u.%u as NTP server #%u via DHCP\n", + (sntp_set_servers_from_dhcp ? "Got" : "Rejected"), + ip4_addr1(server), ip4_addr2(server), ip4_addr3(server), ip4_addr4(server), num)); + if (sntp_set_servers_from_dhcp && num) { + u8_t i; + for (i = 0; (i < num) && (i < SNTP_MAX_SERVERS); i++) { + ip_addr_t addr; + ip_addr_copy_from_ip4(addr, server[i]); + sntp_setserver(i, &addr); + } + for (i = num; i < SNTP_MAX_SERVERS; i++) { + sntp_setserver(i, NULL); + } + } +} +#endif /* LWIP_DHCP && SNTP_GET_SERVERS_FROM_DHCP */ + +/** + * @ingroup sntp + * Obtain one of the currently configured by IP address (or DHCP) NTP servers + * + * @param idx the index of the NTP server + * @return IP address of the indexed NTP server or "ip_addr_any" if the NTP + * server has not been configured by address (or at all). + */ +const ip_addr_t* +sntp_getserver(u8_t idx) +{ + if (idx < SNTP_MAX_SERVERS) { + return &sntp_servers[idx].addr; + } + return IP_ADDR_ANY; +} + +#if SNTP_SERVER_DNS +/** + * Initialize one of the NTP servers by name + * + * @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS + * @param dnsserver DNS name of the NTP server to set, to be resolved at contact time + */ +void +sntp_setservername(u8_t idx, char *server) +{ + if (idx < SNTP_MAX_SERVERS) { + sntp_servers[idx].name = server; + } +} + +/** + * Obtain one of the currently configured by name NTP servers. + * + * @param numdns the index of the NTP server + * @return IP address of the indexed NTP server or NULL if the NTP + * server has not been configured by name (or at all) + */ +char * +sntp_getservername(u8_t idx) +{ + if (idx < SNTP_MAX_SERVERS) { + return sntp_servers[idx].name; + } + return NULL; +} +#endif /* SNTP_SERVER_DNS */ + +#endif /* LWIP_UDP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/tftp/tftp_server.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/tftp/tftp_server.c new file mode 100644 index 0000000..243b092 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/apps/tftp/tftp_server.c @@ -0,0 +1,417 @@ +/****************************************************************//** + * + * @file tftp_server.c + * + * @author Logan Gunthorpe + * Dirk Ziegelmeier + * + * @brief Trivial File Transfer Protocol (RFC 1350) + * + * Copyright (c) Deltatee Enterprises Ltd. 2013 + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Logan Gunthorpe + * Dirk Ziegelmeier + * + */ + +/** + * @defgroup tftp TFTP server + * @ingroup apps + * + * This is simple TFTP server for the lwIP raw API. + */ + +#include "lwip/apps/tftp_server.h" + +#if LWIP_UDP + +#include "lwip/udp.h" +#include "lwip/timeouts.h" +#include "lwip/debug.h" + +#define TFTP_MAX_PAYLOAD_SIZE 512 +#define TFTP_HEADER_LENGTH 4 + +#define TFTP_RRQ 1 +#define TFTP_WRQ 2 +#define TFTP_DATA 3 +#define TFTP_ACK 4 +#define TFTP_ERROR 5 + +enum tftp_error { + TFTP_ERROR_FILE_NOT_FOUND = 1, + TFTP_ERROR_ACCESS_VIOLATION = 2, + TFTP_ERROR_DISK_FULL = 3, + TFTP_ERROR_ILLEGAL_OPERATION = 4, + TFTP_ERROR_UNKNOWN_TRFR_ID = 5, + TFTP_ERROR_FILE_EXISTS = 6, + TFTP_ERROR_NO_SUCH_USER = 7 +}; + +#include + +struct tftp_state { + const struct tftp_context *ctx; + void *handle; + struct pbuf *last_data; + struct udp_pcb *upcb; + ip_addr_t addr; + u16_t port; + int timer; + int last_pkt; + u16_t blknum; + u8_t retries; + u8_t mode_write; +}; + +static struct tftp_state tftp_state; + +static void tftp_tmr(void* arg); + +static void +close_handle(void) +{ + tftp_state.port = 0; + ip_addr_set_any(0, &tftp_state.addr); + + if(tftp_state.last_data != NULL) { + pbuf_free(tftp_state.last_data); + tftp_state.last_data = NULL; + } + + sys_untimeout(tftp_tmr, NULL); + + if (tftp_state.handle) { + tftp_state.ctx->close(tftp_state.handle); + tftp_state.handle = NULL; + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, ("tftp: closing\n")); + } +} + +static void +send_error(const ip_addr_t *addr, u16_t port, enum tftp_error code, const char *str) +{ + int str_length = strlen(str); + struct pbuf* p; + u16_t* payload; + + p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(TFTP_HEADER_LENGTH + str_length + 1), PBUF_RAM); + if(p == NULL) { + return; + } + + payload = (u16_t*) p->payload; + payload[0] = PP_HTONS(TFTP_ERROR); + payload[1] = lwip_htons(code); + MEMCPY(&payload[2], str, str_length + 1); + + udp_sendto(tftp_state.upcb, p, addr, port); + pbuf_free(p); +} + +static void +send_ack(u16_t blknum) +{ + struct pbuf* p; + u16_t* payload; + + p = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH, PBUF_RAM); + if(p == NULL) { + return; + } + payload = (u16_t*) p->payload; + + payload[0] = PP_HTONS(TFTP_ACK); + payload[1] = lwip_htons(blknum); + udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); + pbuf_free(p); +} + +static void +resend_data(void) +{ + struct pbuf *p = pbuf_alloc(PBUF_TRANSPORT, tftp_state.last_data->len, PBUF_RAM); + if(p == NULL) { + return; + } + + if(pbuf_copy(p, tftp_state.last_data) != ERR_OK) { + pbuf_free(p); + return; + } + + udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); + pbuf_free(p); +} + +static void +send_data(void) +{ + u16_t *payload; + int ret; + + if(tftp_state.last_data != NULL) { + pbuf_free(tftp_state.last_data); + } + + tftp_state.last_data = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH + TFTP_MAX_PAYLOAD_SIZE, PBUF_RAM); + if(tftp_state.last_data == NULL) { + return; + } + + payload = (u16_t *) tftp_state.last_data->payload; + payload[0] = PP_HTONS(TFTP_DATA); + payload[1] = lwip_htons(tftp_state.blknum); + + ret = tftp_state.ctx->read(tftp_state.handle, &payload[2], TFTP_MAX_PAYLOAD_SIZE); + if (ret < 0) { + send_error(&tftp_state.addr, tftp_state.port, TFTP_ERROR_ACCESS_VIOLATION, "Error occured while reading the file."); + close_handle(); + return; + } + + pbuf_realloc(tftp_state.last_data, (u16_t)(TFTP_HEADER_LENGTH + ret)); + resend_data(); +} + +static void +recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + u16_t *sbuf = (u16_t *) p->payload; + int opcode; + + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(upcb); + + if (((tftp_state.port != 0) && (port != tftp_state.port)) || + (!ip_addr_isany_val(tftp_state.addr) && !ip_addr_cmp(&tftp_state.addr, addr))) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); + pbuf_free(p); + return; + } + + opcode = sbuf[0]; + + tftp_state.last_pkt = tftp_state.timer; + tftp_state.retries = 0; + + switch (opcode) { + case PP_HTONS(TFTP_RRQ): /* fall through */ + case PP_HTONS(TFTP_WRQ): + { + const char tftp_null = 0; + char filename[TFTP_MAX_FILENAME_LEN]; + char mode[TFTP_MAX_MODE_LEN]; + u16_t filename_end_offset; + u16_t mode_end_offset; + + if(tftp_state.handle != NULL) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); + break; + } + + sys_timeout(TFTP_TIMER_MSECS, tftp_tmr, NULL); + + /* find \0 in pbuf -> end of filename string */ + filename_end_offset = pbuf_memfind(p, &tftp_null, sizeof(tftp_null), 2); + if((u16_t)(filename_end_offset-2) > sizeof(filename)) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Filename too long/not NULL terminated"); + break; + } + pbuf_copy_partial(p, filename, filename_end_offset-2, 2); + + /* find \0 in pbuf -> end of mode string */ + mode_end_offset = pbuf_memfind(p, &tftp_null, sizeof(tftp_null), filename_end_offset+1); + if((u16_t)(mode_end_offset-filename_end_offset) > sizeof(mode)) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Mode too long/not NULL terminated"); + break; + } + pbuf_copy_partial(p, mode, mode_end_offset-filename_end_offset, filename_end_offset+1); + + tftp_state.handle = tftp_state.ctx->open(filename, mode, opcode == PP_HTONS(TFTP_WRQ)); + tftp_state.blknum = 1; + + if (!tftp_state.handle) { + send_error(addr, port, TFTP_ERROR_FILE_NOT_FOUND, "Unable to open requested file."); + break; + } + + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, ("tftp: %s request from ", (opcode == PP_HTONS(TFTP_WRQ)) ? "write" : "read")); + ip_addr_debug_print(TFTP_DEBUG | LWIP_DBG_STATE, addr); + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, (" for '%s' mode '%s'\n", filename, mode)); + + ip_addr_copy(tftp_state.addr, *addr); + tftp_state.port = port; + + if (opcode == PP_HTONS(TFTP_WRQ)) { + tftp_state.mode_write = 1; + send_ack(0); + } else { + tftp_state.mode_write = 0; + send_data(); + } + + break; + } + + case PP_HTONS(TFTP_DATA): + { + int ret; + u16_t blknum; + + if (tftp_state.handle == NULL) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "No connection"); + break; + } + + if (tftp_state.mode_write != 1) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Not a write connection"); + break; + } + + blknum = lwip_ntohs(sbuf[1]); + pbuf_header(p, -TFTP_HEADER_LENGTH); + + ret = tftp_state.ctx->write(tftp_state.handle, p); + if (ret < 0) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "error writing file"); + close_handle(); + } else { + send_ack(blknum); + } + + if (p->tot_len < TFTP_MAX_PAYLOAD_SIZE) { + close_handle(); + } + break; + } + + case PP_HTONS(TFTP_ACK): + { + u16_t blknum; + int lastpkt; + + if (tftp_state.handle == NULL) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "No connection"); + break; + } + + if (tftp_state.mode_write != 0) { + send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Not a read connection"); + break; + } + + blknum = lwip_ntohs(sbuf[1]); + if (blknum != tftp_state.blknum) { + send_error(addr, port, TFTP_ERROR_UNKNOWN_TRFR_ID, "Wrong block number"); + break; + } + + lastpkt = 0; + + if (tftp_state.last_data != NULL) { + lastpkt = tftp_state.last_data->tot_len != (TFTP_MAX_PAYLOAD_SIZE + TFTP_HEADER_LENGTH); + } + + if (!lastpkt) { + tftp_state.blknum++; + send_data(); + } else { + close_handle(); + } + + break; + } + + default: + send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "Unknown operation"); + break; + } + + pbuf_free(p); +} + +static void +tftp_tmr(void* arg) +{ + LWIP_UNUSED_ARG(arg); + + tftp_state.timer++; + + if (tftp_state.handle == NULL) { + return; + } + + sys_timeout(TFTP_TIMER_MSECS, tftp_tmr, NULL); + + if ((tftp_state.timer - tftp_state.last_pkt) > (TFTP_TIMEOUT_MSECS / TFTP_TIMER_MSECS)) { + if ((tftp_state.last_data != NULL) && (tftp_state.retries < TFTP_MAX_RETRIES)) { + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, ("tftp: timeout, retrying\n")); + resend_data(); + tftp_state.retries++; + } else { + LWIP_DEBUGF(TFTP_DEBUG | LWIP_DBG_STATE, ("tftp: timeout\n")); + close_handle(); + } + } +} + +/** @ingroup tftp + * Initialize TFTP server. + * @param ctx TFTP callback struct + */ +err_t +tftp_init(const struct tftp_context *ctx) +{ + err_t ret; + + struct udp_pcb *pcb = udp_new_ip_type(IPADDR_TYPE_ANY); + if (pcb == NULL) { + return ERR_MEM; + } + + ret = udp_bind(pcb, IP_ANY_TYPE, TFTP_PORT); + if (ret != ERR_OK) { + udp_remove(pcb); + return ret; + } + + tftp_state.handle = NULL; + tftp_state.port = 0; + tftp_state.ctx = ctx; + tftp_state.timer = 0; + tftp_state.last_data = NULL; + tftp_state.upcb = pcb; + + udp_recv(pcb, recv, NULL); + + return ERR_OK; +} + +#endif /* LWIP_UDP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/def.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/def.c new file mode 100644 index 0000000..8125313 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/def.c @@ -0,0 +1,222 @@ +/** + * @file + * Common functions used throughout the stack. + * + * These are reference implementations of the byte swapping functions. + * Again with the aim of being simple, correct and fully portable. + * Byte swapping is the second thing you would want to optimize. You will + * need to port it to your architecture and in your cc.h: + * + * \#define lwip_htons(x) your_htons + * \#define lwip_htonl(x) your_htonl + * + * Note lwip_ntohs() and lwip_ntohl() are merely references to the htonx counterparts. + * + * If you \#define them to htons() and htonl(), you should + * \#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS to prevent lwIP from + * defining htonx/ntohx compatibility macros. + + * @defgroup sys_nonstandard Non-standard functions + * @ingroup sys_layer + * lwIP provides default implementations for non-standard functions. + * These can be mapped to OS functions to reduce code footprint if desired. + * All defines related to this section must not be placed in lwipopts.h, + * but in arch/cc.h! + * These options cannot be \#defined in lwipopts.h since they are not options + * of lwIP itself, but options of the lwIP port to your system. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ + +#include "lwip/opt.h" +#include "lwip/def.h" + +#include + +#if BYTE_ORDER == LITTLE_ENDIAN + +#if !defined(lwip_htons) +/** + * Convert an u16_t from host- to network byte order. + * + * @param n u16_t in host byte order + * @return n in network byte order + */ +u16_t +lwip_htons(u16_t n) +{ + return (u16_t)PP_HTONS(n); +} +#endif /* lwip_htons */ + +#if !defined(lwip_htonl) +/** + * Convert an u32_t from host- to network byte order. + * + * @param n u32_t in host byte order + * @return n in network byte order + */ +u32_t +lwip_htonl(u32_t n) +{ + return (u32_t)PP_HTONL(n); +} +#endif /* lwip_htonl */ + +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +#ifndef lwip_strnstr +/** + * @ingroup sys_nonstandard + * lwIP default implementation for strnstr() non-standard function. + * This can be \#defined to strnstr() depending on your platform port. + */ +char* +lwip_strnstr(const char* buffer, const char* token, size_t n) +{ + const char* p; + size_t tokenlen = strlen(token); + if (tokenlen == 0) { + return LWIP_CONST_CAST(char *, buffer); + } + for (p = buffer; *p && (p + tokenlen <= buffer + n); p++) { + if ((*p == *token) && (strncmp(p, token, tokenlen) == 0)) { + return LWIP_CONST_CAST(char *, p); + } + } + return NULL; +} +#endif + +#ifndef lwip_stricmp +/** + * @ingroup sys_nonstandard + * lwIP default implementation for stricmp() non-standard function. + * This can be \#defined to stricmp() depending on your platform port. + */ +int +lwip_stricmp(const char* str1, const char* str2) +{ + char c1, c2; + + do { + c1 = *str1++; + c2 = *str2++; + if (c1 != c2) { + char c1_upc = c1 | 0x20; + if ((c1_upc >= 'a') && (c1_upc <= 'z')) { + /* characters are not equal an one is in the alphabet range: + downcase both chars and check again */ + char c2_upc = c2 | 0x20; + if (c1_upc != c2_upc) { + /* still not equal */ + /* don't care for < or > */ + return 1; + } + } else { + /* characters are not equal but none is in the alphabet range */ + return 1; + } + } + } while (c1 != 0); + return 0; +} +#endif + +#ifndef lwip_strnicmp +/** + * @ingroup sys_nonstandard + * lwIP default implementation for strnicmp() non-standard function. + * This can be \#defined to strnicmp() depending on your platform port. + */ +int +lwip_strnicmp(const char* str1, const char* str2, size_t len) +{ + char c1, c2; + + do { + c1 = *str1++; + c2 = *str2++; + if (c1 != c2) { + char c1_upc = c1 | 0x20; + if ((c1_upc >= 'a') && (c1_upc <= 'z')) { + /* characters are not equal an one is in the alphabet range: + downcase both chars and check again */ + char c2_upc = c2 | 0x20; + if (c1_upc != c2_upc) { + /* still not equal */ + /* don't care for < or > */ + return 1; + } + } else { + /* characters are not equal but none is in the alphabet range */ + return 1; + } + } + } while (len-- && c1 != 0); + return 0; +} +#endif + +#ifndef lwip_itoa +/** + * @ingroup sys_nonstandard + * lwIP default implementation for itoa() non-standard function. + * This can be \#defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform port. + */ +void +lwip_itoa(char* result, size_t bufsize, int number) +{ + const int base = 10; + char* ptr = result, *ptr1 = result, tmp_char; + int tmp_value; + LWIP_UNUSED_ARG(bufsize); + + do { + tmp_value = number; + number /= base; + *ptr++ = "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz"[35 + (tmp_value - number * base)]; + } while(number); + + /* Apply negative sign */ + if (tmp_value < 0) { + *ptr++ = '-'; + } + *ptr-- = '\0'; + while(ptr1 < ptr) { + tmp_char = *ptr; + *ptr--= *ptr1; + *ptr1++ = tmp_char; + } +} +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/dns.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/dns.c new file mode 100644 index 0000000..12c6f16 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/dns.c @@ -0,0 +1,1573 @@ +/** + * @file + * DNS - host name to IP address resolver. + * + * @defgroup dns DNS + * @ingroup callbackstyle_api + * + * Implements a DNS host name to IP address resolver. + * + * The lwIP DNS resolver functions are used to lookup a host name and + * map it to a numerical IP address. It maintains a list of resolved + * hostnames that can be queried with the dns_lookup() function. + * New hostnames can be resolved using the dns_query() function. + * + * The lwIP version of the resolver also adds a non-blocking version of + * gethostbyname() that will work with a raw API application. This function + * checks for an IP address string first and converts it if it is valid. + * gethostbyname() then does a dns_lookup() to see if the name is + * already in the table. If so, the IP is returned. If not, a query is + * issued and the function returns with a ERR_INPROGRESS status. The app + * using the dns client must then go into a waiting state. + * + * Once a hostname has been resolved (or found to be non-existent), + * the resolver code calls a specified callback function (which + * must be implemented by the module that uses the resolver). + * + * Multicast DNS queries are supported for names ending on ".local". + * However, only "One-Shot Multicast DNS Queries" are supported (RFC 6762 + * chapter 5.1), this is not a fully compliant implementation of continuous + * mDNS querying! + * + * All functions must be called from TCPIP thread. + * + * @see @ref netconn_common for thread-safe access. + */ + +/* + * Port to lwIP from uIP + * by Jim Pettinato April 2007 + * + * security fixes and more by Simon Goldschmidt + * + * uIP version Copyright (c) 2002-2003, Adam Dunkels. + * 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. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*----------------------------------------------------------------------------- + * RFC 1035 - Domain names - implementation and specification + * RFC 2181 - Clarifications to the DNS Specification + *----------------------------------------------------------------------------*/ + +/** @todo: define good default values (rfc compliance) */ +/** @todo: improve answer parsing, more checkings... */ +/** @todo: check RFC1035 - 7.3. Processing responses */ +/** @todo: one-shot mDNS: dual-stack fallback to another IP version */ + +/*----------------------------------------------------------------------------- + * Includes + *----------------------------------------------------------------------------*/ + +#include "lwip/opt.h" + +#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/udp.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/dns.h" +#include "lwip/prot/dns.h" + +#include + +/** Random generator function to create random TXIDs and source ports for queries */ +#ifndef DNS_RAND_TXID +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_XID) != 0) +#define DNS_RAND_TXID LWIP_RAND +#else +static u16_t dns_txid; +#define DNS_RAND_TXID() (++dns_txid) +#endif +#endif + +/** Limits the source port to be >= 1024 by default */ +#ifndef DNS_PORT_ALLOWED +#define DNS_PORT_ALLOWED(port) ((port) >= 1024) +#endif + +/** DNS maximum number of retries when asking for a name, before "timeout". */ +#ifndef DNS_MAX_RETRIES +#define DNS_MAX_RETRIES 4 +#endif + +/** DNS resource record max. TTL (one week as default) */ +#ifndef DNS_MAX_TTL +#define DNS_MAX_TTL 604800 +#elif DNS_MAX_TTL > 0x7FFFFFFF +#error DNS_MAX_TTL must be a positive 32-bit value +#endif + +#if DNS_TABLE_SIZE > 255 +#error DNS_TABLE_SIZE must fit into an u8_t +#endif +#if DNS_MAX_SERVERS > 255 +#error DNS_MAX_SERVERS must fit into an u8_t +#endif + +/* The number of parallel requests (i.e. calls to dns_gethostbyname + * that cannot be answered from the DNS table. + * This is set to the table size by default. + */ +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0) +#ifndef DNS_MAX_REQUESTS +#define DNS_MAX_REQUESTS DNS_TABLE_SIZE +#else +#if DNS_MAX_REQUESTS > 255 +#error DNS_MAX_REQUESTS must fit into an u8_t +#endif +#endif +#else +/* In this configuration, both arrays have to have the same size and are used + * like one entry (used/free) */ +#define DNS_MAX_REQUESTS DNS_TABLE_SIZE +#endif + +/* The number of UDP source ports used in parallel */ +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) +#ifndef DNS_MAX_SOURCE_PORTS +#define DNS_MAX_SOURCE_PORTS DNS_MAX_REQUESTS +#else +#if DNS_MAX_SOURCE_PORTS > 255 +#error DNS_MAX_SOURCE_PORTS must fit into an u8_t +#endif +#endif +#else +#ifdef DNS_MAX_SOURCE_PORTS +#undef DNS_MAX_SOURCE_PORTS +#endif +#define DNS_MAX_SOURCE_PORTS 1 +#endif + +#if LWIP_IPV4 && LWIP_IPV6 +#define LWIP_DNS_ADDRTYPE_IS_IPV6(t) (((t) == LWIP_DNS_ADDRTYPE_IPV6_IPV4) || ((t) == LWIP_DNS_ADDRTYPE_IPV6)) +#define LWIP_DNS_ADDRTYPE_MATCH_IP(t, ip) (IP_IS_V6_VAL(ip) ? LWIP_DNS_ADDRTYPE_IS_IPV6(t) : (!LWIP_DNS_ADDRTYPE_IS_IPV6(t))) +#define LWIP_DNS_ADDRTYPE_ARG(x) , x +#define LWIP_DNS_ADDRTYPE_ARG_OR_ZERO(x) x +#define LWIP_DNS_SET_ADDRTYPE(x, y) do { x = y; } while(0) +#else +#if LWIP_IPV6 +#define LWIP_DNS_ADDRTYPE_IS_IPV6(t) 1 +#else +#define LWIP_DNS_ADDRTYPE_IS_IPV6(t) 0 +#endif +#define LWIP_DNS_ADDRTYPE_MATCH_IP(t, ip) 1 +#define LWIP_DNS_ADDRTYPE_ARG(x) +#define LWIP_DNS_ADDRTYPE_ARG_OR_ZERO(x) 0 +#define LWIP_DNS_SET_ADDRTYPE(x, y) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#if LWIP_DNS_SUPPORT_MDNS_QUERIES +#define LWIP_DNS_ISMDNS_ARG(x) , x +#else +#define LWIP_DNS_ISMDNS_ARG(x) +#endif + +/** DNS query message structure. + No packing needed: only used locally on the stack. */ +struct dns_query { + /* DNS query record starts with either a domain name or a pointer + to a name already present somewhere in the packet. */ + u16_t type; + u16_t cls; +}; +#define SIZEOF_DNS_QUERY 4 + +/** DNS answer message structure. + No packing needed: only used locally on the stack. */ +struct dns_answer { + /* DNS answer record starts with either a domain name or a pointer + to a name already present somewhere in the packet. */ + u16_t type; + u16_t cls; + u32_t ttl; + u16_t len; +}; +#define SIZEOF_DNS_ANSWER 10 +/* maximum allowed size for the struct due to non-packed */ +#define SIZEOF_DNS_ANSWER_ASSERT 12 + +/* DNS table entry states */ +typedef enum { + DNS_STATE_UNUSED = 0, + DNS_STATE_NEW = 1, + DNS_STATE_ASKING = 2, + DNS_STATE_DONE = 3 +} dns_state_enum_t; + +/** DNS table entry */ +struct dns_table_entry { + u32_t ttl; + ip_addr_t ipaddr; + u16_t txid; + u8_t state; + u8_t server_idx; + u8_t tmr; + u8_t retries; + u8_t seqno; +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) + u8_t pcb_idx; +#endif + char name[DNS_MAX_NAME_LENGTH]; +#if LWIP_IPV4 && LWIP_IPV6 + u8_t reqaddrtype; +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + u8_t is_mdns; +#endif +}; + +/** DNS request table entry: used when dns_gehostbyname cannot answer the + * request from the DNS table */ +struct dns_req_entry { + /* pointer to callback on DNS query done */ + dns_found_callback found; + /* argument passed to the callback function */ + void *arg; +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0) + u8_t dns_table_idx; +#endif +#if LWIP_IPV4 && LWIP_IPV6 + u8_t reqaddrtype; +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +}; + +#if DNS_LOCAL_HOSTLIST + +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC +/** Local host-list. For hostnames in this list, no + * external name resolution is performed */ +static struct local_hostlist_entry *local_hostlist_dynamic; +#else /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + +/** Defining this allows the local_hostlist_static to be placed in a different + * linker section (e.g. FLASH) */ +#ifndef DNS_LOCAL_HOSTLIST_STORAGE_PRE +#define DNS_LOCAL_HOSTLIST_STORAGE_PRE static +#endif /* DNS_LOCAL_HOSTLIST_STORAGE_PRE */ +/** Defining this allows the local_hostlist_static to be placed in a different + * linker section (e.g. FLASH) */ +#ifndef DNS_LOCAL_HOSTLIST_STORAGE_POST +#define DNS_LOCAL_HOSTLIST_STORAGE_POST +#endif /* DNS_LOCAL_HOSTLIST_STORAGE_POST */ +DNS_LOCAL_HOSTLIST_STORAGE_PRE struct local_hostlist_entry local_hostlist_static[] + DNS_LOCAL_HOSTLIST_STORAGE_POST = DNS_LOCAL_HOSTLIST_INIT; + +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + +static void dns_init_local(void); +static err_t dns_lookup_local(const char *hostname, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addrtype)); +#endif /* DNS_LOCAL_HOSTLIST */ + + +/* forward declarations */ +static void dns_recv(void *s, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port); +static void dns_check_entries(void); +static void dns_call_found(u8_t idx, ip_addr_t* addr); + +/*----------------------------------------------------------------------------- + * Globals + *----------------------------------------------------------------------------*/ + +/* DNS variables */ +static struct udp_pcb *dns_pcbs[DNS_MAX_SOURCE_PORTS]; +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) +static u8_t dns_last_pcb_idx; +#endif +static u8_t dns_seqno; +static struct dns_table_entry dns_table[DNS_TABLE_SIZE]; +static struct dns_req_entry dns_requests[DNS_MAX_REQUESTS]; +static ip_addr_t dns_servers[DNS_MAX_SERVERS]; + +#if LWIP_IPV4 +const ip_addr_t dns_mquery_v4group = DNS_MQUERY_IPV4_GROUP_INIT; +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 +const ip_addr_t dns_mquery_v6group = DNS_MQUERY_IPV6_GROUP_INIT; +#endif /* LWIP_IPV6 */ + +/** + * Initialize the resolver: set up the UDP pcb and configure the default server + * (if DNS_SERVER_ADDRESS is set). + */ +void +dns_init(void) +{ +#ifdef DNS_SERVER_ADDRESS + /* initialize default DNS server address */ + ip_addr_t dnsserver; + DNS_SERVER_ADDRESS(&dnsserver); + dns_setserver(0, &dnsserver); +#endif /* DNS_SERVER_ADDRESS */ + + LWIP_ASSERT("sanity check SIZEOF_DNS_QUERY", + sizeof(struct dns_query) == SIZEOF_DNS_QUERY); + LWIP_ASSERT("sanity check SIZEOF_DNS_ANSWER", + sizeof(struct dns_answer) <= SIZEOF_DNS_ANSWER_ASSERT); + + LWIP_DEBUGF(DNS_DEBUG, ("dns_init: initializing\n")); + + /* if dns client not yet initialized... */ +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) == 0) + if (dns_pcbs[0] == NULL) { + dns_pcbs[0] = udp_new_ip_type(IPADDR_TYPE_ANY); + LWIP_ASSERT("dns_pcbs[0] != NULL", dns_pcbs[0] != NULL); + + /* initialize DNS table not needed (initialized to zero since it is a + * global variable) */ + LWIP_ASSERT("For implicit initialization to work, DNS_STATE_UNUSED needs to be 0", + DNS_STATE_UNUSED == 0); + + /* initialize DNS client */ + udp_bind(dns_pcbs[0], IP_ANY_TYPE, 0); + udp_recv(dns_pcbs[0], dns_recv, NULL); + } +#endif + +#if DNS_LOCAL_HOSTLIST + dns_init_local(); +#endif +} + +/** + * @ingroup dns + * Initialize one of the DNS servers. + * + * @param numdns the index of the DNS server to set must be < DNS_MAX_SERVERS + * @param dnsserver IP address of the DNS server to set + */ +void +dns_setserver(u8_t numdns, const ip_addr_t *dnsserver) +{ + if (numdns < DNS_MAX_SERVERS) { + if (dnsserver != NULL) { + dns_servers[numdns] = (*dnsserver); + } else { + dns_servers[numdns] = *IP_ADDR_ANY; + } + } +} + +/** + * @ingroup dns + * Obtain one of the currently configured DNS server. + * + * @param numdns the index of the DNS server + * @return IP address of the indexed DNS server or "ip_addr_any" if the DNS + * server has not been configured. + */ +const ip_addr_t* +dns_getserver(u8_t numdns) +{ + if (numdns < DNS_MAX_SERVERS) { + return &dns_servers[numdns]; + } else { + return IP_ADDR_ANY; + } +} + +/** + * The DNS resolver client timer - handle retries and timeouts and should + * be called every DNS_TMR_INTERVAL milliseconds (every second by default). + */ +void +dns_tmr(void) +{ + LWIP_DEBUGF(DNS_DEBUG, ("dns_tmr: dns_check_entries\n")); + dns_check_entries(); +} + +#if DNS_LOCAL_HOSTLIST +static void +dns_init_local(void) +{ +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC && defined(DNS_LOCAL_HOSTLIST_INIT) + size_t i; + struct local_hostlist_entry *entry; + /* Dynamic: copy entries from DNS_LOCAL_HOSTLIST_INIT to list */ + struct local_hostlist_entry local_hostlist_init[] = DNS_LOCAL_HOSTLIST_INIT; + size_t namelen; + for (i = 0; i < LWIP_ARRAYSIZE(local_hostlist_init); i++) { + struct local_hostlist_entry *init_entry = &local_hostlist_init[i]; + LWIP_ASSERT("invalid host name (NULL)", init_entry->name != NULL); + namelen = strlen(init_entry->name); + LWIP_ASSERT("namelen <= DNS_LOCAL_HOSTLIST_MAX_NAMELEN", namelen <= DNS_LOCAL_HOSTLIST_MAX_NAMELEN); + entry = (struct local_hostlist_entry *)memp_malloc(MEMP_LOCALHOSTLIST); + LWIP_ASSERT("mem-error in dns_init_local", entry != NULL); + if (entry != NULL) { + char* entry_name = (char*)entry + sizeof(struct local_hostlist_entry); + MEMCPY(entry_name, init_entry->name, namelen); + entry_name[namelen] = 0; + entry->name = entry_name; + entry->addr = init_entry->addr; + entry->next = local_hostlist_dynamic; + local_hostlist_dynamic = entry; + } + } +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC && defined(DNS_LOCAL_HOSTLIST_INIT) */ +} + +/** + * @ingroup dns + * Iterate the local host-list for a hostname. + * + * @param iterator_fn a function that is called for every entry in the local host-list + * @param iterator_arg 3rd argument passed to iterator_fn + * @return the number of entries in the local host-list + */ +size_t +dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg) +{ + size_t i; +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC + struct local_hostlist_entry *entry = local_hostlist_dynamic; + i = 0; + while (entry != NULL) { + if (iterator_fn != NULL) { + iterator_fn(entry->name, &entry->addr, iterator_arg); + } + i++; + entry = entry->next; + } +#else /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + for (i = 0; i < LWIP_ARRAYSIZE(local_hostlist_static); i++) { + if (iterator_fn != NULL) { + iterator_fn(local_hostlist_static[i].name, &local_hostlist_static[i].addr, iterator_arg); + } + } +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + return i; +} + +/** + * @ingroup dns + * Scans the local host-list for a hostname. + * + * @param hostname Hostname to look for in the local host-list + * @param addr the first IP address for the hostname in the local host-list or + * IPADDR_NONE if not found. + * @param dns_addrtype - LWIP_DNS_ADDRTYPE_IPV4_IPV6: try to resolve IPv4 (ATTENTION: no fallback here!) + * - LWIP_DNS_ADDRTYPE_IPV6_IPV4: try to resolve IPv6 (ATTENTION: no fallback here!) + * - LWIP_DNS_ADDRTYPE_IPV4: try to resolve IPv4 only + * - LWIP_DNS_ADDRTYPE_IPV6: try to resolve IPv6 only + * @return ERR_OK if found, ERR_ARG if not found + */ +err_t +dns_local_lookup(const char *hostname, ip_addr_t *addr, u8_t dns_addrtype) +{ + LWIP_UNUSED_ARG(dns_addrtype); + return dns_lookup_local(hostname, addr LWIP_DNS_ADDRTYPE_ARG(dns_addrtype)); +} + +/* Internal implementation for dns_local_lookup and dns_lookup */ +static err_t +dns_lookup_local(const char *hostname, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addrtype)) +{ +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC + struct local_hostlist_entry *entry = local_hostlist_dynamic; + while (entry != NULL) { + if ((lwip_stricmp(entry->name, hostname) == 0) && + LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, entry->addr)) { + if (addr) { + ip_addr_copy(*addr, entry->addr); + } + return ERR_OK; + } + entry = entry->next; + } +#else /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + size_t i; + for (i = 0; i < LWIP_ARRAYSIZE(local_hostlist_static); i++) { + if ((lwip_stricmp(local_hostlist_static[i].name, hostname) == 0) && + LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, local_hostlist_static[i].addr)) { + if (addr) { + ip_addr_copy(*addr, local_hostlist_static[i].addr); + } + return ERR_OK; + } + } +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + return ERR_ARG; +} + +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC +/** + * @ingroup dns + * Remove all entries from the local host-list for a specific hostname + * and/or IP address + * + * @param hostname hostname for which entries shall be removed from the local + * host-list + * @param addr address for which entries shall be removed from the local host-list + * @return the number of removed entries + */ +int +dns_local_removehost(const char *hostname, const ip_addr_t *addr) +{ + int removed = 0; + struct local_hostlist_entry *entry = local_hostlist_dynamic; + struct local_hostlist_entry *last_entry = NULL; + while (entry != NULL) { + if (((hostname == NULL) || !lwip_stricmp(entry->name, hostname)) && + ((addr == NULL) || ip_addr_cmp(&entry->addr, addr))) { + struct local_hostlist_entry *free_entry; + if (last_entry != NULL) { + last_entry->next = entry->next; + } else { + local_hostlist_dynamic = entry->next; + } + free_entry = entry; + entry = entry->next; + memp_free(MEMP_LOCALHOSTLIST, free_entry); + removed++; + } else { + last_entry = entry; + entry = entry->next; + } + } + return removed; +} + +/** + * @ingroup dns + * Add a hostname/IP address pair to the local host-list. + * Duplicates are not checked. + * + * @param hostname hostname of the new entry + * @param addr IP address of the new entry + * @return ERR_OK if succeeded or ERR_MEM on memory error + */ +err_t +dns_local_addhost(const char *hostname, const ip_addr_t *addr) +{ + struct local_hostlist_entry *entry; + size_t namelen; + char* entry_name; + LWIP_ASSERT("invalid host name (NULL)", hostname != NULL); + namelen = strlen(hostname); + LWIP_ASSERT("namelen <= DNS_LOCAL_HOSTLIST_MAX_NAMELEN", namelen <= DNS_LOCAL_HOSTLIST_MAX_NAMELEN); + entry = (struct local_hostlist_entry *)memp_malloc(MEMP_LOCALHOSTLIST); + if (entry == NULL) { + return ERR_MEM; + } + entry_name = (char*)entry + sizeof(struct local_hostlist_entry); + MEMCPY(entry_name, hostname, namelen); + entry_name[namelen] = 0; + entry->name = entry_name; + ip_addr_copy(entry->addr, *addr); + entry->next = local_hostlist_dynamic; + local_hostlist_dynamic = entry; + return ERR_OK; +} +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC*/ +#endif /* DNS_LOCAL_HOSTLIST */ + +/** + * @ingroup dns + * Look up a hostname in the array of known hostnames. + * + * @note This function only looks in the internal array of known + * hostnames, it does not send out a query for the hostname if none + * was found. The function dns_enqueue() can be used to send a query + * for a hostname. + * + * @param name the hostname to look up + * @param addr the hostname's IP address, as u32_t (instead of ip_addr_t to + * better check for failure: != IPADDR_NONE) or IPADDR_NONE if the hostname + * was not found in the cached dns_table. + * @return ERR_OK if found, ERR_ARG if not found + */ +static err_t +dns_lookup(const char *name, ip_addr_t *addr LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addrtype)) +{ + u8_t i; +#if DNS_LOCAL_HOSTLIST || defined(DNS_LOOKUP_LOCAL_EXTERN) +#endif /* DNS_LOCAL_HOSTLIST || defined(DNS_LOOKUP_LOCAL_EXTERN) */ +#if DNS_LOCAL_HOSTLIST + if (dns_lookup_local(name, addr LWIP_DNS_ADDRTYPE_ARG(dns_addrtype)) == ERR_OK) { + return ERR_OK; + } +#endif /* DNS_LOCAL_HOSTLIST */ +#ifdef DNS_LOOKUP_LOCAL_EXTERN + if (DNS_LOOKUP_LOCAL_EXTERN(name, addr, LWIP_DNS_ADDRTYPE_ARG_OR_ZERO(dns_addrtype)) == ERR_OK) { + return ERR_OK; + } +#endif /* DNS_LOOKUP_LOCAL_EXTERN */ + + /* Walk through name list, return entry if found. If not, return NULL. */ + for (i = 0; i < DNS_TABLE_SIZE; ++i) { + if ((dns_table[i].state == DNS_STATE_DONE) && + (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0) && + LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, dns_table[i].ipaddr)) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_lookup: \"%s\": found = ", name)); + ip_addr_debug_print(DNS_DEBUG, &(dns_table[i].ipaddr)); + LWIP_DEBUGF(DNS_DEBUG, ("\n")); + if (addr) { + ip_addr_copy(*addr, dns_table[i].ipaddr); + } + return ERR_OK; + } + } + + return ERR_ARG; +} + +/** + * Compare the "dotted" name "query" with the encoded name "response" + * to make sure an answer from the DNS server matches the current dns_table + * entry (otherwise, answers might arrive late for hostname not on the list + * any more). + * + * @param query hostname (not encoded) from the dns_table + * @param p pbuf containing the encoded hostname in the DNS response + * @param start_offset offset into p where the name starts + * @return 0xFFFF: names differ, other: names equal -> offset behind name + */ +static u16_t +dns_compare_name(const char *query, struct pbuf* p, u16_t start_offset) +{ + int n; + u16_t response_offset = start_offset; + + do { + n = pbuf_try_get_at(p, response_offset++); + if (n < 0) { + return 0xFFFF; + } + /** @see RFC 1035 - 4.1.4. Message compression */ + if ((n & 0xc0) == 0xc0) { + /* Compressed name: cannot be equal since we don't send them */ + return 0xFFFF; + } else { + /* Not compressed name */ + while (n > 0) { + int c = pbuf_try_get_at(p, response_offset); + if (c < 0) { + return 0xFFFF; + } + if ((*query) != (u8_t)c) { + return 0xFFFF; + } + ++response_offset; + ++query; + --n; + } + ++query; + } + n = pbuf_try_get_at(p, response_offset); + if (n < 0) { + return 0xFFFF; + } + } while (n != 0); + + return response_offset + 1; +} + +/** + * Walk through a compact encoded DNS name and return the end of the name. + * + * @param p pbuf containing the name + * @param query_idx start index into p pointing to encoded DNS name in the DNS server response + * @return index to end of the name + */ +static u16_t +dns_skip_name(struct pbuf* p, u16_t query_idx) +{ + int n; + u16_t offset = query_idx; + + do { + n = pbuf_try_get_at(p, offset++); + if (n < 0) { + return 0xFFFF; + } + /** @see RFC 1035 - 4.1.4. Message compression */ + if ((n & 0xc0) == 0xc0) { + /* Compressed name: since we only want to skip it (not check it), stop here */ + break; + } else { + /* Not compressed name */ + if (offset + n >= p->tot_len) { + return 0xFFFF; + } + offset = (u16_t)(offset + n); + } + n = pbuf_try_get_at(p, offset); + if (n < 0) { + return 0xFFFF; + } + } while (n != 0); + + return offset + 1; +} + +/** + * Send a DNS query packet. + * + * @param idx the DNS table entry index for which to send a request + * @return ERR_OK if packet is sent; an err_t indicating the problem otherwise + */ +static err_t +dns_send(u8_t idx) +{ + err_t err; + struct dns_hdr hdr; + struct dns_query qry; + struct pbuf *p; + u16_t query_idx, copy_len; + const char *hostname, *hostname_part; + u8_t n; + u8_t pcb_idx; + struct dns_table_entry* entry = &dns_table[idx]; + + LWIP_DEBUGF(DNS_DEBUG, ("dns_send: dns_servers[%"U16_F"] \"%s\": request\n", + (u16_t)(entry->server_idx), entry->name)); + LWIP_ASSERT("dns server out of array", entry->server_idx < DNS_MAX_SERVERS); + if (ip_addr_isany_val(dns_servers[entry->server_idx]) +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + && !entry->is_mdns +#endif + ) { + /* DNS server not valid anymore, e.g. PPP netif has been shut down */ + /* call specified callback function if provided */ + dns_call_found(idx, NULL); + /* flush this entry */ + entry->state = DNS_STATE_UNUSED; + return ERR_OK; + } + + /* if here, we have either a new query or a retry on a previous query to process */ + p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(SIZEOF_DNS_HDR + strlen(entry->name) + 2 + + SIZEOF_DNS_QUERY), PBUF_RAM); + if (p != NULL) { + const ip_addr_t* dst; + u16_t dst_port; + /* fill dns header */ + memset(&hdr, 0, SIZEOF_DNS_HDR); + hdr.id = lwip_htons(entry->txid); + hdr.flags1 = DNS_FLAG1_RD; + hdr.numquestions = PP_HTONS(1); + pbuf_take(p, &hdr, SIZEOF_DNS_HDR); + hostname = entry->name; + --hostname; + + /* convert hostname into suitable query format. */ + query_idx = SIZEOF_DNS_HDR; + do { + ++hostname; + hostname_part = hostname; + for (n = 0; *hostname != '.' && *hostname != 0; ++hostname) { + ++n; + } + copy_len = (u16_t)(hostname - hostname_part); + pbuf_put_at(p, query_idx, n); + pbuf_take_at(p, hostname_part, copy_len, query_idx + 1); + query_idx += n + 1; + } while (*hostname != 0); + pbuf_put_at(p, query_idx, 0); + query_idx++; + + /* fill dns query */ + if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) { + qry.type = PP_HTONS(DNS_RRTYPE_AAAA); + } else { + qry.type = PP_HTONS(DNS_RRTYPE_A); + } + qry.cls = PP_HTONS(DNS_RRCLASS_IN); + pbuf_take_at(p, &qry, SIZEOF_DNS_QUERY, query_idx); + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) + pcb_idx = entry->pcb_idx; +#else + pcb_idx = 0; +#endif + /* send dns packet */ + LWIP_DEBUGF(DNS_DEBUG, ("sending DNS request ID %d for name \"%s\" to server %d\r\n", + entry->txid, entry->name, entry->server_idx)); +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + if (entry->is_mdns) { + dst_port = DNS_MQUERY_PORT; +#if LWIP_IPV6 + if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) + { + dst = &dns_mquery_v6group; + } +#endif +#if LWIP_IPV4 && LWIP_IPV6 + else +#endif +#if LWIP_IPV4 + { + dst = &dns_mquery_v4group; + } +#endif + } else +#endif /* LWIP_DNS_SUPPORT_MDNS_QUERIES */ + { + dst_port = DNS_SERVER_PORT; + dst = &dns_servers[entry->server_idx]; + } + err = udp_sendto(dns_pcbs[pcb_idx], p, dst, dst_port); + + /* free pbuf */ + pbuf_free(p); + } else { + err = ERR_MEM; + } + + return err; +} + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) +static struct udp_pcb* +dns_alloc_random_port(void) +{ + err_t err; + struct udp_pcb* ret; + + ret = udp_new_ip_type(IPADDR_TYPE_ANY); + if (ret == NULL) { + /* out of memory, have to reuse an existing pcb */ + return NULL; + } + do { + u16_t port = (u16_t)DNS_RAND_TXID(); + if (!DNS_PORT_ALLOWED(port)) { + /* this port is not allowed, try again */ + err = ERR_USE; + continue; + } + err = udp_bind(ret, IP_ANY_TYPE, port); + } while (err == ERR_USE); + if (err != ERR_OK) { + udp_remove(ret); + return NULL; + } + udp_recv(ret, dns_recv, NULL); + return ret; +} + +/** + * dns_alloc_pcb() - allocates a new pcb (or reuses an existing one) to be used + * for sending a request + * + * @return an index into dns_pcbs + */ +static u8_t +dns_alloc_pcb(void) +{ + u8_t i; + u8_t idx; + + for (i = 0; i < DNS_MAX_SOURCE_PORTS; i++) { + if (dns_pcbs[i] == NULL) { + break; + } + } + if (i < DNS_MAX_SOURCE_PORTS) { + dns_pcbs[i] = dns_alloc_random_port(); + if (dns_pcbs[i] != NULL) { + /* succeeded */ + dns_last_pcb_idx = i; + return i; + } + } + /* if we come here, creating a new UDP pcb failed, so we have to use + an already existing one */ + for (i = 0, idx = dns_last_pcb_idx + 1; i < DNS_MAX_SOURCE_PORTS; i++, idx++) { + if (idx >= DNS_MAX_SOURCE_PORTS) { + idx = 0; + } + if (dns_pcbs[idx] != NULL) { + dns_last_pcb_idx = idx; + return idx; + } + } + return DNS_MAX_SOURCE_PORTS; +} +#endif /* ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) */ + +/** + * dns_call_found() - call the found callback and check if there are duplicate + * entries for the given hostname. If there are any, their found callback will + * be called and they will be removed. + * + * @param idx dns table index of the entry that is resolved or removed + * @param addr IP address for the hostname (or NULL on error or memory shortage) + */ +static void +dns_call_found(u8_t idx, ip_addr_t* addr) +{ +#if ((LWIP_DNS_SECURE & (LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)) != 0) + u8_t i; +#endif + +#if LWIP_IPV4 && LWIP_IPV6 + if (addr != NULL) { + /* check that address type matches the request and adapt the table entry */ + if (IP_IS_V6_VAL(*addr)) { + LWIP_ASSERT("invalid response", LWIP_DNS_ADDRTYPE_IS_IPV6(dns_table[idx].reqaddrtype)); + dns_table[idx].reqaddrtype = LWIP_DNS_ADDRTYPE_IPV6; + } else { + LWIP_ASSERT("invalid response", !LWIP_DNS_ADDRTYPE_IS_IPV6(dns_table[idx].reqaddrtype)); + dns_table[idx].reqaddrtype = LWIP_DNS_ADDRTYPE_IPV4; + } + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0) + for (i = 0; i < DNS_MAX_REQUESTS; i++) { + if (dns_requests[i].found && (dns_requests[i].dns_table_idx == idx)) { + (*dns_requests[i].found)(dns_table[idx].name, addr, dns_requests[i].arg); + /* flush this entry */ + dns_requests[i].found = NULL; + } + } +#else + if (dns_requests[idx].found) { + (*dns_requests[idx].found)(dns_table[idx].name, addr, dns_requests[idx].arg); + } + dns_requests[idx].found = NULL; +#endif +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) + /* close the pcb used unless other request are using it */ + for (i = 0; i < DNS_MAX_REQUESTS; i++) { + if (i == idx) { + continue; /* only check other requests */ + } + if (dns_table[i].state == DNS_STATE_ASKING) { + if (dns_table[i].pcb_idx == dns_table[idx].pcb_idx) { + /* another request is still using the same pcb */ + dns_table[idx].pcb_idx = DNS_MAX_SOURCE_PORTS; + break; + } + } + } + if (dns_table[idx].pcb_idx < DNS_MAX_SOURCE_PORTS) { + /* if we come here, the pcb is not used any more and can be removed */ + udp_remove(dns_pcbs[dns_table[idx].pcb_idx]); + dns_pcbs[dns_table[idx].pcb_idx] = NULL; + dns_table[idx].pcb_idx = DNS_MAX_SOURCE_PORTS; + } +#endif +} + +/* Create a query transmission ID that is unique for all outstanding queries */ +static u16_t +dns_create_txid(void) +{ + u16_t txid; + u8_t i; + +again: + txid = (u16_t)DNS_RAND_TXID(); + + /* check whether the ID is unique */ + for (i = 0; i < DNS_TABLE_SIZE; i++) { + if ((dns_table[i].state == DNS_STATE_ASKING) && + (dns_table[i].txid == txid)) { + /* ID already used by another pending query */ + goto again; + } + } + + return txid; +} + +/** + * dns_check_entry() - see if entry has not yet been queried and, if so, sends out a query. + * Check an entry in the dns_table: + * - send out query for new entries + * - retry old pending entries on timeout (also with different servers) + * - remove completed entries from the table if their TTL has expired + * + * @param i index of the dns_table entry to check + */ +static void +dns_check_entry(u8_t i) +{ + err_t err; + struct dns_table_entry *entry = &dns_table[i]; + + LWIP_ASSERT("array index out of bounds", i < DNS_TABLE_SIZE); + + switch (entry->state) { + case DNS_STATE_NEW: + /* initialize new entry */ + entry->txid = dns_create_txid(); + entry->state = DNS_STATE_ASKING; + entry->server_idx = 0; + entry->tmr = 1; + entry->retries = 0; + + /* send DNS packet for this entry */ + err = dns_send(i); + if (err != ERR_OK) { + LWIP_DEBUGF(DNS_DEBUG | LWIP_DBG_LEVEL_WARNING, + ("dns_send returned error: %s\n", lwip_strerr(err))); + } + break; + case DNS_STATE_ASKING: + if (--entry->tmr == 0) { + if (++entry->retries == DNS_MAX_RETRIES) { + if ((entry->server_idx + 1 < DNS_MAX_SERVERS) && !ip_addr_isany_val(dns_servers[entry->server_idx + 1]) +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + && !entry->is_mdns +#endif /* LWIP_DNS_SUPPORT_MDNS_QUERIES */ + ) { + /* change of server */ + entry->server_idx++; + entry->tmr = 1; + entry->retries = 0; + } else { + LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": timeout\n", entry->name)); + /* call specified callback function if provided */ + dns_call_found(i, NULL); + /* flush this entry */ + entry->state = DNS_STATE_UNUSED; + break; + } + } else { + /* wait longer for the next retry */ + entry->tmr = entry->retries; + } + + /* send DNS packet for this entry */ + err = dns_send(i); + if (err != ERR_OK) { + LWIP_DEBUGF(DNS_DEBUG | LWIP_DBG_LEVEL_WARNING, + ("dns_send returned error: %s\n", lwip_strerr(err))); + } + } + break; + case DNS_STATE_DONE: + /* if the time to live is nul */ + if ((entry->ttl == 0) || (--entry->ttl == 0)) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_check_entry: \"%s\": flush\n", entry->name)); + /* flush this entry, there cannot be any related pending entries in this state */ + entry->state = DNS_STATE_UNUSED; + } + break; + case DNS_STATE_UNUSED: + /* nothing to do */ + break; + default: + LWIP_ASSERT("unknown dns_table entry state:", 0); + break; + } +} + +/** + * Call dns_check_entry for each entry in dns_table - check all entries. + */ +static void +dns_check_entries(void) +{ + u8_t i; + + for (i = 0; i < DNS_TABLE_SIZE; ++i) { + dns_check_entry(i); + } +} + +/** + * Save TTL and call dns_call_found for correct response. + */ +static void +dns_correct_response(u8_t idx, u32_t ttl) +{ + struct dns_table_entry *entry = &dns_table[idx]; + + entry->state = DNS_STATE_DONE; + + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response = ", entry->name)); + ip_addr_debug_print(DNS_DEBUG, (&(entry->ipaddr))); + LWIP_DEBUGF(DNS_DEBUG, ("\n")); + + /* read the answer resource record's TTL, and maximize it if needed */ + entry->ttl = ttl; + if (entry->ttl > DNS_MAX_TTL) { + entry->ttl = DNS_MAX_TTL; + } + dns_call_found(idx, &entry->ipaddr); + + if (entry->ttl == 0) { + /* RFC 883, page 29: "Zero values are + interpreted to mean that the RR can only be used for the + transaction in progress, and should not be cached." + -> flush this entry now */ + /* entry reused during callback? */ + if (entry->state == DNS_STATE_DONE) { + entry->state = DNS_STATE_UNUSED; + } + } +} +/** + * Receive input function for DNS response packets arriving for the dns UDP pcb. + */ +static void +dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + u8_t i; + u16_t txid; + u16_t res_idx; + struct dns_hdr hdr; + struct dns_answer ans; + struct dns_query qry; + u16_t nquestions, nanswers; + + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(port); + + /* is the dns message big enough ? */ + if (p->tot_len < (SIZEOF_DNS_HDR + SIZEOF_DNS_QUERY)) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: pbuf too small\n")); + /* free pbuf and return */ + goto memerr; + } + + /* copy dns payload inside static buffer for processing */ + if (pbuf_copy_partial(p, &hdr, SIZEOF_DNS_HDR, 0) == SIZEOF_DNS_HDR) { + /* Match the ID in the DNS header with the name table. */ + txid = lwip_htons(hdr.id); + for (i = 0; i < DNS_TABLE_SIZE; i++) { + const struct dns_table_entry *entry = &dns_table[i]; + if ((entry->state == DNS_STATE_ASKING) && + (entry->txid == txid)) { + + /* We only care about the question(s) and the answers. The authrr + and the extrarr are simply discarded. */ + nquestions = lwip_htons(hdr.numquestions); + nanswers = lwip_htons(hdr.numanswers); + + /* Check for correct response. */ + if ((hdr.flags1 & DNS_FLAG1_RESPONSE) == 0) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": not a response\n", entry->name)); + goto memerr; /* ignore this packet */ + } + if (nquestions != 1) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name)); + goto memerr; /* ignore this packet */ + } + +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + if (!entry->is_mdns) +#endif /* LWIP_DNS_SUPPORT_MDNS_QUERIES */ + { + /* Check whether response comes from the same network address to which the + question was sent. (RFC 5452) */ + if (!ip_addr_cmp(addr, &dns_servers[entry->server_idx])) { + goto memerr; /* ignore this packet */ + } + } + + /* Check if the name in the "question" part match with the name in the entry and + skip it if equal. */ + res_idx = dns_compare_name(entry->name, p, SIZEOF_DNS_HDR); + if (res_idx == 0xFFFF) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name)); + goto memerr; /* ignore this packet */ + } + + /* check if "question" part matches the request */ + if (pbuf_copy_partial(p, &qry, SIZEOF_DNS_QUERY, res_idx) != SIZEOF_DNS_QUERY) { + goto memerr; /* ignore this packet */ + } + if ((qry.cls != PP_HTONS(DNS_RRCLASS_IN)) || + (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype) && (qry.type != PP_HTONS(DNS_RRTYPE_AAAA))) || + (!LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype) && (qry.type != PP_HTONS(DNS_RRTYPE_A)))) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": response not match to query\n", entry->name)); + goto memerr; /* ignore this packet */ + } + /* skip the rest of the "question" part */ + res_idx += SIZEOF_DNS_QUERY; + + /* Check for error. If so, call callback to inform. */ + if (hdr.flags2 & DNS_FLAG2_ERR_MASK) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in flags\n", entry->name)); + } else { + while ((nanswers > 0) && (res_idx < p->tot_len)) { + /* skip answer resource record's host name */ + res_idx = dns_skip_name(p, res_idx); + if (res_idx == 0xFFFF) { + goto memerr; /* ignore this packet */ + } + + /* Check for IP address type and Internet class. Others are discarded. */ + if (pbuf_copy_partial(p, &ans, SIZEOF_DNS_ANSWER, res_idx) != SIZEOF_DNS_ANSWER) { + goto memerr; /* ignore this packet */ + } + res_idx += SIZEOF_DNS_ANSWER; + + if (ans.cls == PP_HTONS(DNS_RRCLASS_IN)) { +#if LWIP_IPV4 + if ((ans.type == PP_HTONS(DNS_RRTYPE_A)) && (ans.len == PP_HTONS(sizeof(ip4_addr_t)))) { +#if LWIP_IPV4 && LWIP_IPV6 + if (!LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + { + ip4_addr_t ip4addr; + /* read the IP address after answer resource record's header */ + if (pbuf_copy_partial(p, &ip4addr, sizeof(ip4_addr_t), res_idx) != sizeof(ip4_addr_t)) { + goto memerr; /* ignore this packet */ + } + ip_addr_copy_from_ip4(dns_table[i].ipaddr, ip4addr); + pbuf_free(p); + /* handle correct response */ + dns_correct_response(i, lwip_ntohl(ans.ttl)); + return; + } + } +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + if ((ans.type == PP_HTONS(DNS_RRTYPE_AAAA)) && (ans.len == PP_HTONS(sizeof(ip6_addr_t)))) { +#if LWIP_IPV4 && LWIP_IPV6 + if (LWIP_DNS_ADDRTYPE_IS_IPV6(entry->reqaddrtype)) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + { + ip6_addr_t ip6addr; + /* read the IP address after answer resource record's header */ + if (pbuf_copy_partial(p, &ip6addr, sizeof(ip6_addr_t), res_idx) != sizeof(ip6_addr_t)) { + goto memerr; /* ignore this packet */ + } + ip_addr_copy_from_ip6(dns_table[i].ipaddr, ip6addr); + pbuf_free(p); + /* handle correct response */ + dns_correct_response(i, lwip_ntohl(ans.ttl)); + return; + } + } +#endif /* LWIP_IPV6 */ + } + /* skip this answer */ + if ((int)(res_idx + lwip_htons(ans.len)) > 0xFFFF) { + goto memerr; /* ignore this packet */ + } + res_idx += lwip_htons(ans.len); + --nanswers; + } +#if LWIP_IPV4 && LWIP_IPV6 + if ((entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) || + (entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV6_IPV4)) { + if (entry->reqaddrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) { + /* IPv4 failed, try IPv6 */ + dns_table[i].reqaddrtype = LWIP_DNS_ADDRTYPE_IPV6; + } else { + /* IPv6 failed, try IPv4 */ + dns_table[i].reqaddrtype = LWIP_DNS_ADDRTYPE_IPV4; + } + pbuf_free(p); + dns_table[i].state = DNS_STATE_NEW; + dns_check_entry(i); + return; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: \"%s\": error in response\n", entry->name)); + } + /* call callback to indicate error, clean up memory and return */ + pbuf_free(p); + dns_call_found(i, NULL); + dns_table[i].state = DNS_STATE_UNUSED; + return; + } + } + } + +memerr: + /* deallocate memory and return */ + pbuf_free(p); + return; +} + +/** + * Queues a new hostname to resolve and sends out a DNS query for that hostname + * + * @param name the hostname that is to be queried + * @param hostnamelen length of the hostname + * @param found a callback function to be called on success, failure or timeout + * @param callback_arg argument to pass to the callback function + * @return err_t return code. + */ +static err_t +dns_enqueue(const char *name, size_t hostnamelen, dns_found_callback found, + void *callback_arg LWIP_DNS_ADDRTYPE_ARG(u8_t dns_addrtype) LWIP_DNS_ISMDNS_ARG(u8_t is_mdns)) +{ + u8_t i; + u8_t lseq, lseqi; + struct dns_table_entry *entry = NULL; + size_t namelen; + struct dns_req_entry* req; + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0) + u8_t r; + /* check for duplicate entries */ + for (i = 0; i < DNS_TABLE_SIZE; i++) { + if ((dns_table[i].state == DNS_STATE_ASKING) && + (lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0)) { +#if LWIP_IPV4 && LWIP_IPV6 + if (dns_table[i].reqaddrtype != dns_addrtype) { + /* requested address types don't match + this can lead to 2 concurrent requests, but mixing the address types + for the same host should not be that common */ + continue; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + /* this is a duplicate entry, find a free request entry */ + for (r = 0; r < DNS_MAX_REQUESTS; r++) { + if (dns_requests[r].found == 0) { + dns_requests[r].found = found; + dns_requests[r].arg = callback_arg; + dns_requests[r].dns_table_idx = i; + LWIP_DNS_SET_ADDRTYPE(dns_requests[r].reqaddrtype, dns_addrtype); + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": duplicate request\n", name)); + return ERR_INPROGRESS; + } + } + } + } + /* no duplicate entries found */ +#endif + + /* search an unused entry, or the oldest one */ + lseq = 0; + lseqi = DNS_TABLE_SIZE; + for (i = 0; i < DNS_TABLE_SIZE; ++i) { + entry = &dns_table[i]; + /* is it an unused entry ? */ + if (entry->state == DNS_STATE_UNUSED) { + break; + } + /* check if this is the oldest completed entry */ + if (entry->state == DNS_STATE_DONE) { + u8_t age = dns_seqno - entry->seqno; + if (age > lseq) { + lseq = age; + lseqi = i; + } + } + } + + /* if we don't have found an unused entry, use the oldest completed one */ + if (i == DNS_TABLE_SIZE) { + if ((lseqi >= DNS_TABLE_SIZE) || (dns_table[lseqi].state != DNS_STATE_DONE)) { + /* no entry can be used now, table is full */ + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": DNS entries table is full\n", name)); + return ERR_MEM; + } else { + /* use the oldest completed one */ + i = lseqi; + entry = &dns_table[i]; + } + } + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0) + /* find a free request entry */ + req = NULL; + for (r = 0; r < DNS_MAX_REQUESTS; r++) { + if (dns_requests[r].found == NULL) { + req = &dns_requests[r]; + break; + } + } + if (req == NULL) { + /* no request entry can be used now, table is full */ + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": DNS request entries table is full\n", name)); + return ERR_MEM; + } + req->dns_table_idx = i; +#else + /* in this configuration, the entry index is the same as the request index */ + req = &dns_requests[i]; +#endif + + /* use this entry */ + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": use DNS entry %"U16_F"\n", name, (u16_t)(i))); + + /* fill the entry */ + entry->state = DNS_STATE_NEW; + entry->seqno = dns_seqno; + LWIP_DNS_SET_ADDRTYPE(entry->reqaddrtype, dns_addrtype); + LWIP_DNS_SET_ADDRTYPE(req->reqaddrtype, dns_addrtype); + req->found = found; + req->arg = callback_arg; + namelen = LWIP_MIN(hostnamelen, DNS_MAX_NAME_LENGTH-1); + MEMCPY(entry->name, name, namelen); + entry->name[namelen] = 0; + +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0) + entry->pcb_idx = dns_alloc_pcb(); + if (entry->pcb_idx >= DNS_MAX_SOURCE_PORTS) { + /* failed to get a UDP pcb */ + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": failed to allocate a pcb\n", name)); + entry->state = DNS_STATE_UNUSED; + req->found = NULL; + return ERR_MEM; + } + LWIP_DEBUGF(DNS_DEBUG, ("dns_enqueue: \"%s\": use DNS pcb %"U16_F"\n", name, (u16_t)(entry->pcb_idx))); +#endif + +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + entry->is_mdns = is_mdns; +#endif + + dns_seqno++; + + /* force to send query without waiting timer */ + dns_check_entry(i); + + /* dns query is enqueued */ + return ERR_INPROGRESS; +} + +/** + * @ingroup dns + * Resolve a hostname (string) into an IP address. + * NON-BLOCKING callback version for use with raw API!!! + * + * Returns immediately with one of err_t return codes: + * - ERR_OK if hostname is a valid IP address string or the host + * name is already in the local names table. + * - ERR_INPROGRESS enqueue a request to be sent to the DNS server + * for resolution if no errors are present. + * - ERR_ARG: dns client not initialized or invalid hostname + * + * @param hostname the hostname that is to be queried + * @param addr pointer to a ip_addr_t where to store the address if it is already + * cached in the dns_table (only valid if ERR_OK is returned!) + * @param found a callback function to be called on success, failure or timeout (only if + * ERR_INPROGRESS is returned!) + * @param callback_arg argument to pass to the callback function + * @return a err_t return code. + */ +err_t +dns_gethostbyname(const char *hostname, ip_addr_t *addr, dns_found_callback found, + void *callback_arg) +{ + return dns_gethostbyname_addrtype(hostname, addr, found, callback_arg, LWIP_DNS_ADDRTYPE_DEFAULT); +} + +/** + * @ingroup dns + * Like dns_gethostbyname, but returned address type can be controlled: + * @param hostname the hostname that is to be queried + * @param addr pointer to a ip_addr_t where to store the address if it is already + * cached in the dns_table (only valid if ERR_OK is returned!) + * @param found a callback function to be called on success, failure or timeout (only if + * ERR_INPROGRESS is returned!) + * @param callback_arg argument to pass to the callback function + * @param dns_addrtype - LWIP_DNS_ADDRTYPE_IPV4_IPV6: try to resolve IPv4 first, try IPv6 if IPv4 fails only + * - LWIP_DNS_ADDRTYPE_IPV6_IPV4: try to resolve IPv6 first, try IPv4 if IPv6 fails only + * - LWIP_DNS_ADDRTYPE_IPV4: try to resolve IPv4 only + * - LWIP_DNS_ADDRTYPE_IPV6: try to resolve IPv6 only + */ +err_t +dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr, dns_found_callback found, + void *callback_arg, u8_t dns_addrtype) +{ + size_t hostnamelen; +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + u8_t is_mdns; +#endif + /* not initialized or no valid server yet, or invalid addr pointer + * or invalid hostname or invalid hostname length */ + if ((addr == NULL) || + (!hostname) || (!hostname[0])) { + return ERR_ARG; + } +#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) == 0) + if (dns_pcbs[0] == NULL) { + return ERR_ARG; + } +#endif + hostnamelen = strlen(hostname); + if (hostnamelen >= DNS_MAX_NAME_LENGTH) { + LWIP_DEBUGF(DNS_DEBUG, ("dns_gethostbyname: name too long to resolve")); + return ERR_ARG; + } + + +#if LWIP_HAVE_LOOPIF + if (strcmp(hostname, "localhost") == 0) { + ip_addr_set_loopback(LWIP_DNS_ADDRTYPE_IS_IPV6(dns_addrtype), addr); + return ERR_OK; + } +#endif /* LWIP_HAVE_LOOPIF */ + + /* host name already in octet notation? set ip addr and return ERR_OK */ + if (ipaddr_aton(hostname, addr)) { +#if LWIP_IPV4 && LWIP_IPV6 + if ((IP_IS_V6(addr) && (dns_addrtype != LWIP_DNS_ADDRTYPE_IPV4)) || + (IP_IS_V4(addr) && (dns_addrtype != LWIP_DNS_ADDRTYPE_IPV6))) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + { + return ERR_OK; + } + } + /* already have this address cached? */ + if (dns_lookup(hostname, addr LWIP_DNS_ADDRTYPE_ARG(dns_addrtype)) == ERR_OK) { + return ERR_OK; + } +#if LWIP_IPV4 && LWIP_IPV6 + if ((dns_addrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) || (dns_addrtype == LWIP_DNS_ADDRTYPE_IPV6_IPV4)) { + /* fallback to 2nd IP type and try again to lookup */ + u8_t fallback; + if (dns_addrtype == LWIP_DNS_ADDRTYPE_IPV4_IPV6) { + fallback = LWIP_DNS_ADDRTYPE_IPV6; + } else { + fallback = LWIP_DNS_ADDRTYPE_IPV4; + } + if (dns_lookup(hostname, addr LWIP_DNS_ADDRTYPE_ARG(fallback)) == ERR_OK) { + return ERR_OK; + } + } +#else /* LWIP_IPV4 && LWIP_IPV6 */ + LWIP_UNUSED_ARG(dns_addrtype); +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#if LWIP_DNS_SUPPORT_MDNS_QUERIES + if (strstr(hostname, ".local") == &hostname[hostnamelen] - 6) { + is_mdns = 1; + } else { + is_mdns = 0; + } + + if (!is_mdns) +#endif /* LWIP_DNS_SUPPORT_MDNS_QUERIES */ + { + /* prevent calling found callback if no server is set, return error instead */ + if (ip_addr_isany_val(dns_servers[0])) { + return ERR_VAL; + } + } + + /* queue query with specified callback */ + return dns_enqueue(hostname, hostnamelen, found, callback_arg LWIP_DNS_ADDRTYPE_ARG(dns_addrtype) + LWIP_DNS_ISMDNS_ARG(is_mdns)); +} + +#endif /* LWIP_DNS */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/inet_chksum.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/inet_chksum.c new file mode 100644 index 0000000..917f3e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/inet_chksum.c @@ -0,0 +1,609 @@ +/** + * @file + * Incluse internet checksum functions.\n + * + * These are some reference implementations of the checksum algorithm, with the + * aim of being simple, correct and fully portable. Checksumming is the + * first thing you would want to optimize for your platform. If you create + * your own version, link it in and in your cc.h put: + * + * \#define LWIP_CHKSUM your_checksum_routine + * + * Or you can select from the implementations below by defining + * LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#include "lwip/inet_chksum.h" +#include "lwip/def.h" +#include "lwip/ip_addr.h" + +#include + +#ifndef LWIP_CHKSUM +# define LWIP_CHKSUM lwip_standard_chksum +# ifndef LWIP_CHKSUM_ALGORITHM +# define LWIP_CHKSUM_ALGORITHM 2 +# endif +u16_t lwip_standard_chksum(const void *dataptr, int len); +#endif +/* If none set: */ +#ifndef LWIP_CHKSUM_ALGORITHM +# define LWIP_CHKSUM_ALGORITHM 0 +#endif + +#if (LWIP_CHKSUM_ALGORITHM == 1) /* Version #1 */ +/** + * lwip checksum + * + * @param dataptr points to start of data to be summed at any boundary + * @param len length of data to be summed + * @return host order (!) lwip checksum (non-inverted Internet sum) + * + * @note accumulator size limits summable length to 64k + * @note host endianess is irrelevant (p3 RFC1071) + */ +u16_t +lwip_standard_chksum(const void *dataptr, int len) +{ + u32_t acc; + u16_t src; + const u8_t *octetptr; + + acc = 0; + /* dataptr may be at odd or even addresses */ + octetptr = (const u8_t*)dataptr; + while (len > 1) { + /* declare first octet as most significant + thus assume network order, ignoring host order */ + src = (*octetptr) << 8; + octetptr++; + /* declare second octet as least significant */ + src |= (*octetptr); + octetptr++; + acc += src; + len -= 2; + } + if (len > 0) { + /* accumulate remaining octet */ + src = (*octetptr) << 8; + acc += src; + } + /* add deferred carry bits */ + acc = (acc >> 16) + (acc & 0x0000ffffUL); + if ((acc & 0xffff0000UL) != 0) { + acc = (acc >> 16) + (acc & 0x0000ffffUL); + } + /* This maybe a little confusing: reorder sum using lwip_htons() + instead of lwip_ntohs() since it has a little less call overhead. + The caller must invert bits for Internet sum ! */ + return lwip_htons((u16_t)acc); +} +#endif + +#if (LWIP_CHKSUM_ALGORITHM == 2) /* Alternative version #2 */ +/* + * Curt McDowell + * Broadcom Corp. + * csm@broadcom.com + * + * IP checksum two bytes at a time with support for + * unaligned buffer. + * Works for len up to and including 0x20000. + * by Curt McDowell, Broadcom Corp. 12/08/2005 + * + * @param dataptr points to start of data to be summed at any boundary + * @param len length of data to be summed + * @return host order (!) lwip checksum (non-inverted Internet sum) + */ +u16_t +lwip_standard_chksum(const void *dataptr, int len) +{ + const u8_t *pb = (const u8_t *)dataptr; + const u16_t *ps; + u16_t t = 0; + u32_t sum = 0; + int odd = ((mem_ptr_t)pb & 1); + + /* Get aligned to u16_t */ + if (odd && len > 0) { + ((u8_t *)&t)[1] = *pb++; + len--; + } + + /* Add the bulk of the data */ + ps = (const u16_t *)(const void *)pb; + while (len > 1) { + sum += *ps++; + len -= 2; + } + + /* Consume left-over byte, if any */ + if (len > 0) { + ((u8_t *)&t)[0] = *(const u8_t *)ps; + } + + /* Add end bytes */ + sum += t; + + /* Fold 32-bit sum to 16 bits + calling this twice is probably faster than if statements... */ + sum = FOLD_U32T(sum); + sum = FOLD_U32T(sum); + + /* Swap if alignment was odd */ + if (odd) { + sum = SWAP_BYTES_IN_WORD(sum); + } + + return (u16_t)sum; +} +#endif + +#if (LWIP_CHKSUM_ALGORITHM == 3) /* Alternative version #3 */ +/** + * An optimized checksum routine. Basically, it uses loop-unrolling on + * the checksum loop, treating the head and tail bytes specially, whereas + * the inner loop acts on 8 bytes at a time. + * + * @arg start of buffer to be checksummed. May be an odd byte address. + * @len number of bytes in the buffer to be checksummed. + * @return host order (!) lwip checksum (non-inverted Internet sum) + * + * by Curt McDowell, Broadcom Corp. December 8th, 2005 + */ +u16_t +lwip_standard_chksum(const void *dataptr, int len) +{ + const u8_t *pb = (const u8_t *)dataptr; + const u16_t *ps; + u16_t t = 0; + const u32_t *pl; + u32_t sum = 0, tmp; + /* starts at odd byte address? */ + int odd = ((mem_ptr_t)pb & 1); + + if (odd && len > 0) { + ((u8_t *)&t)[1] = *pb++; + len--; + } + + ps = (const u16_t *)(const void*)pb; + + if (((mem_ptr_t)ps & 3) && len > 1) { + sum += *ps++; + len -= 2; + } + + pl = (const u32_t *)(const void*)ps; + + while (len > 7) { + tmp = sum + *pl++; /* ping */ + if (tmp < sum) { + tmp++; /* add back carry */ + } + + sum = tmp + *pl++; /* pong */ + if (sum < tmp) { + sum++; /* add back carry */ + } + + len -= 8; + } + + /* make room in upper bits */ + sum = FOLD_U32T(sum); + + ps = (const u16_t *)pl; + + /* 16-bit aligned word remaining? */ + while (len > 1) { + sum += *ps++; + len -= 2; + } + + /* dangling tail byte remaining? */ + if (len > 0) { /* include odd byte */ + ((u8_t *)&t)[0] = *(const u8_t *)ps; + } + + sum += t; /* add end bytes */ + + /* Fold 32-bit sum to 16 bits + calling this twice is probably faster than if statements... */ + sum = FOLD_U32T(sum); + sum = FOLD_U32T(sum); + + if (odd) { + sum = SWAP_BYTES_IN_WORD(sum); + } + + return (u16_t)sum; +} +#endif + +/** Parts of the pseudo checksum which are common to IPv4 and IPv6 */ +static u16_t +inet_cksum_pseudo_base(struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc) +{ + struct pbuf *q; + u8_t swapped = 0; + + /* iterate through all pbuf in chain */ + for (q = p; q != NULL; q = q->next) { + LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n", + (void *)q, (void *)q->next)); + acc += LWIP_CHKSUM(q->payload, q->len); + /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/ + /* just executing this next line is probably faster that the if statement needed + to check whether we really need to execute it, and does no harm */ + acc = FOLD_U32T(acc); + if (q->len % 2 != 0) { + swapped = 1 - swapped; + acc = SWAP_BYTES_IN_WORD(acc); + } + /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/ + } + + if (swapped) { + acc = SWAP_BYTES_IN_WORD(acc); + } + + acc += (u32_t)lwip_htons((u16_t)proto); + acc += (u32_t)lwip_htons(proto_len); + + /* Fold 32-bit sum to 16 bits + calling this twice is probably faster than if statements... */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc)); + return (u16_t)~(acc & 0xffffUL); +} + +#if LWIP_IPV4 +/* inet_chksum_pseudo: + * + * Calculates the IPv4 pseudo Internet checksum used by TCP and UDP for a pbuf chain. + * IP addresses are expected to be in network byte order. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param src source ip address (used for checksum of pseudo header) + * @param dst destination ip address (used for checksum of pseudo header) + * @param proto ip protocol (used for checksum of pseudo header) + * @param proto_len length of the ip data part (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip4_addr_t *src, const ip4_addr_t *dest) +{ + u32_t acc; + u32_t addr; + + addr = ip4_addr_get_u32(src); + acc = (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + addr = ip4_addr_get_u32(dest); + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + /* fold down to 16 bits */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + + return inet_cksum_pseudo_base(p, proto, proto_len, acc); +} +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +/** + * Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. + * IPv6 addresses are expected to be in network byte order. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param proto ipv6 protocol/next header (used for checksum of pseudo header) + * @param proto_len length of the ipv6 payload (used for checksum of pseudo header) + * @param src source ipv6 address (used for checksum of pseudo header) + * @param dest destination ipv6 address (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip6_addr_t *src, const ip6_addr_t *dest) +{ + u32_t acc = 0; + u32_t addr; + u8_t addr_part; + + for (addr_part = 0; addr_part < 4; addr_part++) { + addr = src->addr[addr_part]; + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + addr = dest->addr[addr_part]; + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + } + /* fold down to 16 bits */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + + return inet_cksum_pseudo_base(p, proto, proto_len, acc); +} +#endif /* LWIP_IPV6 */ + +/* ip_chksum_pseudo: + * + * Calculates the IPv4 or IPv6 pseudo Internet checksum used by TCP and UDP for a pbuf chain. + * IP addresses are expected to be in network byte order. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param src source ip address (used for checksum of pseudo header) + * @param dst destination ip address (used for checksum of pseudo header) + * @param proto ip protocol (used for checksum of pseudo header) + * @param proto_len length of the ip data part (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip_addr_t *src, const ip_addr_t *dest) +{ +#if LWIP_IPV6 + if (IP_IS_V6(dest)) { + return ip6_chksum_pseudo(p, proto, proto_len, ip_2_ip6(src), ip_2_ip6(dest)); + } +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 && LWIP_IPV6 + else +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_IPV4 + { + return inet_chksum_pseudo(p, proto, proto_len, ip_2_ip4(src), ip_2_ip4(dest)); + } +#endif /* LWIP_IPV4 */ +} + +/** Parts of the pseudo checksum which are common to IPv4 and IPv6 */ +static u16_t +inet_cksum_pseudo_partial_base(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, u32_t acc) +{ + struct pbuf *q; + u8_t swapped = 0; + u16_t chklen; + + /* iterate through all pbuf in chain */ + for (q = p; (q != NULL) && (chksum_len > 0); q = q->next) { + LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n", + (void *)q, (void *)q->next)); + chklen = q->len; + if (chklen > chksum_len) { + chklen = chksum_len; + } + acc += LWIP_CHKSUM(q->payload, chklen); + chksum_len -= chklen; + LWIP_ASSERT("delete me", chksum_len < 0x7fff); + /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/ + /* fold the upper bit down */ + acc = FOLD_U32T(acc); + if (q->len % 2 != 0) { + swapped = 1 - swapped; + acc = SWAP_BYTES_IN_WORD(acc); + } + /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/ + } + + if (swapped) { + acc = SWAP_BYTES_IN_WORD(acc); + } + + acc += (u32_t)lwip_htons((u16_t)proto); + acc += (u32_t)lwip_htons(proto_len); + + /* Fold 32-bit sum to 16 bits + calling this twice is probably faster than if statements... */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc)); + return (u16_t)~(acc & 0xffffUL); +} + +#if LWIP_IPV4 +/* inet_chksum_pseudo_partial: + * + * Calculates the IPv4 pseudo Internet checksum used by TCP and UDP for a pbuf chain. + * IP addresses are expected to be in network byte order. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param src source ip address (used for checksum of pseudo header) + * @param dst destination ip address (used for checksum of pseudo header) + * @param proto ip protocol (used for checksum of pseudo header) + * @param proto_len length of the ip data part (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest) +{ + u32_t acc; + u32_t addr; + + addr = ip4_addr_get_u32(src); + acc = (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + addr = ip4_addr_get_u32(dest); + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + /* fold down to 16 bits */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + + return inet_cksum_pseudo_partial_base(p, proto, proto_len, chksum_len, acc); +} +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +/** + * Calculates the checksum with IPv6 pseudo header used by TCP and UDP for a pbuf chain. + * IPv6 addresses are expected to be in network byte order. Will only compute for a + * portion of the payload. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param proto ipv6 protocol/next header (used for checksum of pseudo header) + * @param proto_len length of the ipv6 payload (used for checksum of pseudo header) + * @param chksum_len number of payload bytes used to compute chksum + * @param src source ipv6 address (used for checksum of pseudo header) + * @param dest destination ipv6 address (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest) +{ + u32_t acc = 0; + u32_t addr; + u8_t addr_part; + + for (addr_part = 0; addr_part < 4; addr_part++) { + addr = src->addr[addr_part]; + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + addr = dest->addr[addr_part]; + acc += (addr & 0xffffUL); + acc += ((addr >> 16) & 0xffffUL); + } + /* fold down to 16 bits */ + acc = FOLD_U32T(acc); + acc = FOLD_U32T(acc); + + return inet_cksum_pseudo_partial_base(p, proto, proto_len, chksum_len, acc); +} +#endif /* LWIP_IPV6 */ + +/* ip_chksum_pseudo_partial: + * + * Calculates the IPv4 or IPv6 pseudo Internet checksum used by TCP and UDP for a pbuf chain. + * + * @param p chain of pbufs over that a checksum should be calculated (ip data part) + * @param src source ip address (used for checksum of pseudo header) + * @param dst destination ip address (used for checksum of pseudo header) + * @param proto ip protocol (used for checksum of pseudo header) + * @param proto_len length of the ip data part (used for checksum of pseudo header) + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest) +{ +#if LWIP_IPV6 + if (IP_IS_V6(dest)) { + return ip6_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip6(src), ip_2_ip6(dest)); + } +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 && LWIP_IPV6 + else +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_IPV4 + { + return inet_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip4(src), ip_2_ip4(dest)); + } +#endif /* LWIP_IPV4 */ +} + +/* inet_chksum: + * + * Calculates the Internet checksum over a portion of memory. Used primarily for IP + * and ICMP. + * + * @param dataptr start of the buffer to calculate the checksum (no alignment needed) + * @param len length of the buffer to calculate the checksum + * @return checksum (as u16_t) to be saved directly in the protocol header + */ + +u16_t +inet_chksum(const void *dataptr, u16_t len) +{ + return (u16_t)~(unsigned int)LWIP_CHKSUM(dataptr, len); +} + +/** + * Calculate a checksum over a chain of pbufs (without pseudo-header, much like + * inet_chksum only pbufs are used). + * + * @param p pbuf chain over that the checksum should be calculated + * @return checksum (as u16_t) to be saved directly in the protocol header + */ +u16_t +inet_chksum_pbuf(struct pbuf *p) +{ + u32_t acc; + struct pbuf *q; + u8_t swapped; + + acc = 0; + swapped = 0; + for (q = p; q != NULL; q = q->next) { + acc += LWIP_CHKSUM(q->payload, q->len); + acc = FOLD_U32T(acc); + if (q->len % 2 != 0) { + swapped = 1 - swapped; + acc = SWAP_BYTES_IN_WORD(acc); + } + } + + if (swapped) { + acc = SWAP_BYTES_IN_WORD(acc); + } + return (u16_t)~(acc & 0xffffUL); +} + +/* These are some implementations for LWIP_CHKSUM_COPY, which copies data + * like MEMCPY but generates a checksum at the same time. Since this is a + * performance-sensitive function, you might want to create your own version + * in assembly targeted at your hardware by defining it in lwipopts.h: + * #define LWIP_CHKSUM_COPY(dst, src, len) your_chksum_copy(dst, src, len) + */ + +#if (LWIP_CHKSUM_COPY_ALGORITHM == 1) /* Version #1 */ +/** Safe but slow: first call MEMCPY, then call LWIP_CHKSUM. + * For architectures with big caches, data might still be in cache when + * generating the checksum after copying. + */ +u16_t +lwip_chksum_copy(void *dst, const void *src, u16_t len) +{ + MEMCPY(dst, src, len); + return LWIP_CHKSUM(dst, len); +} +#endif /* (LWIP_CHKSUM_COPY_ALGORITHM == 1) */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/init.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/init.c new file mode 100644 index 0000000..3131461 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/init.c @@ -0,0 +1,385 @@ +/** + * @file + * Modules initialization + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + */ + +#include "lwip/opt.h" + +#include "lwip/init.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/sockets.h" +#include "lwip/ip.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/igmp.h" +#include "lwip/dns.h" +#include "lwip/timeouts.h" +#include "lwip/etharp.h" +#include "lwip/ip6.h" +#include "lwip/nd6.h" +#include "lwip/mld6.h" +#include "lwip/api.h" + +#include "netif/ppp/ppp_opts.h" +#include "netif/ppp/ppp_impl.h" + +#ifndef LWIP_SKIP_PACKING_CHECK + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct packed_struct_test +{ + PACK_STRUCT_FLD_8(u8_t dummy1); + PACK_STRUCT_FIELD(u32_t dummy2); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif +#define PACKED_STRUCT_TEST_EXPECTED_SIZE 5 + +#endif + +/* Compile-time sanity checks for configuration errors. + * These can be done independently of LWIP_DEBUG, without penalty. + */ +#ifndef BYTE_ORDER + #error "BYTE_ORDER is not defined, you have to define it in your cc.h" +#endif +#if (!IP_SOF_BROADCAST && IP_SOF_BROADCAST_RECV) + #error "If you want to use broadcast filter per pcb on recv operations, you have to define IP_SOF_BROADCAST=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP && LWIP_UDPLITE) + #error "If you want to use UDP Lite, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP && LWIP_DHCP) + #error "If you want to use DHCP, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP && LWIP_MULTICAST_TX_OPTIONS) + #error "If you want to use IGMP/LWIP_MULTICAST_TX_OPTIONS, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif +#if (!LWIP_UDP && LWIP_DNS) + #error "If you want to use DNS, you have to define LWIP_UDP=1 in your lwipopts.h" +#endif +#if !MEMP_MEM_MALLOC /* MEMP_NUM_* checks are disabled when not using the pool allocator */ +#if (LWIP_ARP && ARP_QUEUEING && (MEMP_NUM_ARP_QUEUE<=0)) + #error "If you want to use ARP Queueing, you have to define MEMP_NUM_ARP_QUEUE>=1 in your lwipopts.h" +#endif +#if (LWIP_RAW && (MEMP_NUM_RAW_PCB<=0)) + #error "If you want to use RAW, you have to define MEMP_NUM_RAW_PCB>=1 in your lwipopts.h" +#endif +#if (LWIP_UDP && (MEMP_NUM_UDP_PCB<=0)) + #error "If you want to use UDP, you have to define MEMP_NUM_UDP_PCB>=1 in your lwipopts.h" +#endif +#if (LWIP_TCP && (MEMP_NUM_TCP_PCB<=0)) + #error "If you want to use TCP, you have to define MEMP_NUM_TCP_PCB>=1 in your lwipopts.h" +#endif +#if (LWIP_IGMP && (MEMP_NUM_IGMP_GROUP<=1)) + #error "If you want to use IGMP, you have to define MEMP_NUM_IGMP_GROUP>1 in your lwipopts.h" +#endif +#if (LWIP_IGMP && !LWIP_MULTICAST_TX_OPTIONS) + #error "If you want to use IGMP, you have to define LWIP_MULTICAST_TX_OPTIONS==1 in your lwipopts.h" +#endif +#if (LWIP_IGMP && !LWIP_IPV4) + #error "IGMP needs LWIP_IPV4 enabled in your lwipopts.h" +#endif +#if (LWIP_MULTICAST_TX_OPTIONS && !LWIP_IPV4) + #error "LWIP_MULTICAST_TX_OPTIONS needs LWIP_IPV4 enabled in your lwipopts.h" +#endif +#if ((LWIP_NETCONN || LWIP_SOCKET) && (MEMP_NUM_TCPIP_MSG_API<=0)) + #error "If you want to use Sequential API, you have to define MEMP_NUM_TCPIP_MSG_API>=1 in your lwipopts.h" +#endif +/* There must be sufficient timeouts, taking into account requirements of the subsystems. */ +#if LWIP_TIMERS && (MEMP_NUM_SYS_TIMEOUT < (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0))) + #error "MEMP_NUM_SYS_TIMEOUT is too low to accomodate all required timeouts" +#endif +#if (IP_REASSEMBLY && (MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS)) + #error "MEMP_NUM_REASSDATA > IP_REASS_MAX_PBUFS doesn't make sense since each struct ip_reassdata must hold 2 pbufs at least!" +#endif +#endif /* !MEMP_MEM_MALLOC */ +#if LWIP_WND_SCALE +#if (LWIP_TCP && (TCP_WND > 0xffffffff)) + #error "If you want to use TCP, TCP_WND must fit in an u32_t, so, you have to reduce it in your lwipopts.h" +#endif +#if (LWIP_TCP && (TCP_RCV_SCALE > 14)) + #error "The maximum valid window scale value is 14!" +#endif +#if (LWIP_TCP && (TCP_WND > (0xFFFFU << TCP_RCV_SCALE))) + #error "TCP_WND is bigger than the configured LWIP_WND_SCALE allows!" +#endif +#if (LWIP_TCP && ((TCP_WND >> TCP_RCV_SCALE) == 0)) + #error "TCP_WND is too small for the configured LWIP_WND_SCALE (results in zero window)!" +#endif +#else /* LWIP_WND_SCALE */ +#if (LWIP_TCP && (TCP_WND > 0xffff)) + #error "If you want to use TCP, TCP_WND must fit in an u16_t, so, you have to reduce it in your lwipopts.h (or enable window scaling)" +#endif +#endif /* LWIP_WND_SCALE */ +#if (LWIP_TCP && (TCP_SND_QUEUELEN > 0xffff)) + #error "If you want to use TCP, TCP_SND_QUEUELEN must fit in an u16_t, so, you have to reduce it in your lwipopts.h" +#endif +#if (LWIP_TCP && (TCP_SND_QUEUELEN < 2)) + #error "TCP_SND_QUEUELEN must be at least 2 for no-copy TCP writes to work" +#endif +#if (LWIP_TCP && ((TCP_MAXRTX > 12) || (TCP_SYNMAXRTX > 12))) + #error "If you want to use TCP, TCP_MAXRTX and TCP_SYNMAXRTX must less or equal to 12 (due to tcp_backoff table), so, you have to reduce them in your lwipopts.h" +#endif +#if (LWIP_TCP && TCP_LISTEN_BACKLOG && ((TCP_DEFAULT_LISTEN_BACKLOG < 0) || (TCP_DEFAULT_LISTEN_BACKLOG > 0xff))) + #error "If you want to use TCP backlog, TCP_DEFAULT_LISTEN_BACKLOG must fit into an u8_t" +#endif +#if (LWIP_NETIF_API && (NO_SYS==1)) + #error "If you want to use NETIF API, you have to define NO_SYS=0 in your lwipopts.h" +#endif +#if ((LWIP_SOCKET || LWIP_NETCONN) && (NO_SYS==1)) + #error "If you want to use Sequential API, you have to define NO_SYS=0 in your lwipopts.h" +#endif +#if (LWIP_PPP_API && (NO_SYS==1)) + #error "If you want to use PPP API, you have to define NO_SYS=0 in your lwipopts.h" +#endif +#if (LWIP_PPP_API && (PPP_SUPPORT==0)) + #error "If you want to use PPP API, you have to enable PPP_SUPPORT in your lwipopts.h" +#endif +#if (((!LWIP_DHCP) || (!LWIP_AUTOIP)) && LWIP_DHCP_AUTOIP_COOP) + #error "If you want to use DHCP/AUTOIP cooperation mode, you have to define LWIP_DHCP=1 and LWIP_AUTOIP=1 in your lwipopts.h" +#endif +#if (((!LWIP_DHCP) || (!LWIP_ARP)) && DHCP_DOES_ARP_CHECK) + #error "If you want to use DHCP ARP checking, you have to define LWIP_DHCP=1 and LWIP_ARP=1 in your lwipopts.h" +#endif +#if (!LWIP_ARP && LWIP_AUTOIP) + #error "If you want to use AUTOIP, you have to define LWIP_ARP=1 in your lwipopts.h" +#endif +#if (LWIP_TCP && ((LWIP_EVENT_API && LWIP_CALLBACK_API) || (!LWIP_EVENT_API && !LWIP_CALLBACK_API))) + #error "One and exactly one of LWIP_EVENT_API and LWIP_CALLBACK_API has to be enabled in your lwipopts.h" +#endif +#if (MEM_LIBC_MALLOC && MEM_USE_POOLS) + #error "MEM_LIBC_MALLOC and MEM_USE_POOLS may not both be simultaneously enabled in your lwipopts.h" +#endif +#if (MEM_USE_POOLS && !MEMP_USE_CUSTOM_POOLS) + #error "MEM_USE_POOLS requires custom pools (MEMP_USE_CUSTOM_POOLS) to be enabled in your lwipopts.h" +#endif +#if (PBUF_POOL_BUFSIZE <= MEM_ALIGNMENT) + #error "PBUF_POOL_BUFSIZE must be greater than MEM_ALIGNMENT or the offset may take the full first pbuf" +#endif +#if (DNS_LOCAL_HOSTLIST && !DNS_LOCAL_HOSTLIST_IS_DYNAMIC && !(defined(DNS_LOCAL_HOSTLIST_INIT))) + #error "you have to define define DNS_LOCAL_HOSTLIST_INIT {{'host1', 0x123}, {'host2', 0x234}} to initialize DNS_LOCAL_HOSTLIST" +#endif +#if PPP_SUPPORT && !PPPOS_SUPPORT && !PPPOE_SUPPORT && !PPPOL2TP_SUPPORT + #error "PPP_SUPPORT needs at least one of PPPOS_SUPPORT, PPPOE_SUPPORT or PPPOL2TP_SUPPORT turned on" +#endif +#if PPP_SUPPORT && !PPP_IPV4_SUPPORT && !PPP_IPV6_SUPPORT + #error "PPP_SUPPORT needs PPP_IPV4_SUPPORT and/or PPP_IPV6_SUPPORT turned on" +#endif +#if PPP_SUPPORT && PPP_IPV4_SUPPORT && !LWIP_IPV4 + #error "PPP_IPV4_SUPPORT needs LWIP_IPV4 turned on" +#endif +#if PPP_SUPPORT && PPP_IPV6_SUPPORT && !LWIP_IPV6 + #error "PPP_IPV6_SUPPORT needs LWIP_IPV6 turned on" +#endif +#if !LWIP_ETHERNET && (LWIP_ARP || PPPOE_SUPPORT) + #error "LWIP_ETHERNET needs to be turned on for LWIP_ARP or PPPOE_SUPPORT" +#endif +#if LWIP_TCPIP_CORE_LOCKING_INPUT && !LWIP_TCPIP_CORE_LOCKING + #error "When using LWIP_TCPIP_CORE_LOCKING_INPUT, LWIP_TCPIP_CORE_LOCKING must be enabled, too" +#endif +#if LWIP_TCP && LWIP_NETIF_TX_SINGLE_PBUF && !TCP_OVERSIZE + #error "LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE enabled to create single-pbuf TCP packets" +#endif +#if LWIP_NETCONN && LWIP_TCP +#if NETCONN_COPY != TCP_WRITE_FLAG_COPY + #error "NETCONN_COPY != TCP_WRITE_FLAG_COPY" +#endif +#if NETCONN_MORE != TCP_WRITE_FLAG_MORE + #error "NETCONN_MORE != TCP_WRITE_FLAG_MORE" +#endif +#endif /* LWIP_NETCONN && LWIP_TCP */ +#if LWIP_SOCKET +/* Check that the SO_* socket options and SOF_* lwIP-internal flags match */ +#if SO_REUSEADDR != SOF_REUSEADDR + #error "WARNING: SO_REUSEADDR != SOF_REUSEADDR" +#endif +#if SO_KEEPALIVE != SOF_KEEPALIVE + #error "WARNING: SO_KEEPALIVE != SOF_KEEPALIVE" +#endif +#if SO_BROADCAST != SOF_BROADCAST + #error "WARNING: SO_BROADCAST != SOF_BROADCAST" +#endif +#endif /* LWIP_SOCKET */ + + +/* Compile-time checks for deprecated options. + */ +#ifdef MEMP_NUM_TCPIP_MSG + #error "MEMP_NUM_TCPIP_MSG option is deprecated. Remove it from your lwipopts.h." +#endif +#ifdef TCP_REXMIT_DEBUG + #error "TCP_REXMIT_DEBUG option is deprecated. Remove it from your lwipopts.h." +#endif +#ifdef RAW_STATS + #error "RAW_STATS option is deprecated. Remove it from your lwipopts.h." +#endif +#ifdef ETHARP_QUEUE_FIRST + #error "ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h." +#endif +#ifdef ETHARP_ALWAYS_INSERT + #error "ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h." +#endif +#if !NO_SYS && LWIP_TCPIP_CORE_LOCKING && LWIP_COMPAT_MUTEX && !defined(LWIP_COMPAT_MUTEX_ALLOWED) + #error "LWIP_COMPAT_MUTEX cannot prevent priority inversion. It is recommended to implement priority-aware mutexes. (Define LWIP_COMPAT_MUTEX_ALLOWED to disable this error.)" +#endif + +#ifndef LWIP_DISABLE_TCP_SANITY_CHECKS +#define LWIP_DISABLE_TCP_SANITY_CHECKS 0 +#endif +#ifndef LWIP_DISABLE_MEMP_SANITY_CHECKS +#define LWIP_DISABLE_MEMP_SANITY_CHECKS 0 +#endif + +/* MEMP sanity checks */ +#if MEMP_MEM_MALLOC +#if !LWIP_DISABLE_MEMP_SANITY_CHECKS +#if LWIP_NETCONN || LWIP_SOCKET +#if !MEMP_NUM_NETCONN && LWIP_SOCKET +#error "lwip_sanity_check: WARNING: MEMP_NUM_NETCONN cannot be 0 when using sockets!" +#endif +#else /* MEMP_MEM_MALLOC */ +#if MEMP_NUM_NETCONN > (MEMP_NUM_TCP_PCB+MEMP_NUM_TCP_PCB_LISTEN+MEMP_NUM_UDP_PCB+MEMP_NUM_RAW_PCB) +#error "lwip_sanity_check: WARNING: MEMP_NUM_NETCONN should be less than the sum of MEMP_NUM_{TCP,RAW,UDP}_PCB+MEMP_NUM_TCP_PCB_LISTEN. If you know what you are doing, define LWIP_DISABLE_MEMP_SANITY_CHECKS to 1 to disable this error." +#endif +#endif /* LWIP_NETCONN || LWIP_SOCKET */ +#endif /* !LWIP_DISABLE_MEMP_SANITY_CHECKS */ +#if MEM_USE_POOLS +#error "MEMP_MEM_MALLOC and MEM_USE_POOLS cannot be enabled at the same time" +#endif +#ifdef LWIP_HOOK_MEMP_AVAILABLE +#error "LWIP_HOOK_MEMP_AVAILABLE doesn't make sense with MEMP_MEM_MALLOC" +#endif +#endif /* MEMP_MEM_MALLOC */ + +/* TCP sanity checks */ +#if !LWIP_DISABLE_TCP_SANITY_CHECKS +#if LWIP_TCP +#if !MEMP_MEM_MALLOC && (MEMP_NUM_TCP_SEG < TCP_SND_QUEUELEN) + #error "lwip_sanity_check: WARNING: MEMP_NUM_TCP_SEG should be at least as big as TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if TCP_SND_BUF < (2 * TCP_MSS) + #error "lwip_sanity_check: WARNING: TCP_SND_BUF must be at least as much as (2 * TCP_MSS) for things to work smoothly. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if TCP_SND_QUEUELEN < (2 * (TCP_SND_BUF / TCP_MSS)) + #error "lwip_sanity_check: WARNING: TCP_SND_QUEUELEN must be at least as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if TCP_SNDLOWAT >= TCP_SND_BUF + #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if TCP_SNDLOWAT >= (0xFFFF - (4 * TCP_MSS)) + #error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must at least be 4*MSS below u16_t overflow!" +#endif +#if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN + #error "lwip_sanity_check: WARNING: TCP_SNDQUEUELOWAT must be less than TCP_SND_QUEUELEN. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if !MEMP_MEM_MALLOC && PBUF_POOL_SIZE && (PBUF_POOL_BUFSIZE <= (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) + #error "lwip_sanity_check: WARNING: PBUF_POOL_BUFSIZE does not provide enough space for protocol headers. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if !MEMP_MEM_MALLOC && PBUF_POOL_SIZE && (TCP_WND > (PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)))) + #error "lwip_sanity_check: WARNING: TCP_WND is larger than space provided by PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - protocol headers). If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#if TCP_WND < TCP_MSS + #error "lwip_sanity_check: WARNING: TCP_WND is smaller than MSS. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." +#endif +#endif /* LWIP_TCP */ +#endif /* !LWIP_DISABLE_TCP_SANITY_CHECKS */ + +/** + * @ingroup lwip_nosys + * Initialize all modules. + * Use this in NO_SYS mode. Use tcpip_init() otherwise. + */ +void +lwip_init(void) +{ +#ifndef LWIP_SKIP_CONST_CHECK + int a; + LWIP_UNUSED_ARG(a); + LWIP_ASSERT("LWIP_CONST_CAST not implemented correctly. Check your lwIP port.", LWIP_CONST_CAST(void*, &a) == &a); +#endif +#ifndef LWIP_SKIP_PACKING_CHECK + LWIP_ASSERT("Struct packing not implemented correctly. Check your lwIP port.", sizeof(struct packed_struct_test) == PACKED_STRUCT_TEST_EXPECTED_SIZE); +#endif + + /* Modules initialization */ + stats_init(); +#if !NO_SYS + sys_init(); +#endif /* !NO_SYS */ + mem_init(); + memp_init(); + pbuf_init(); + netif_init(); +#if LWIP_IPV4 + ip_init(); +#if LWIP_ARP + etharp_init(); +#endif /* LWIP_ARP */ +#endif /* LWIP_IPV4 */ +#if LWIP_RAW + raw_init(); +#endif /* LWIP_RAW */ +#if LWIP_UDP + udp_init(); +#endif /* LWIP_UDP */ +#if LWIP_TCP + tcp_init(); +#endif /* LWIP_TCP */ +#if LWIP_IGMP + igmp_init(); +#endif /* LWIP_IGMP */ +#if LWIP_DNS + dns_init(); +#endif /* LWIP_DNS */ +#if PPP_SUPPORT + ppp_init(); +#endif + +#if LWIP_TIMERS + sys_timeouts_init(); +#endif /* LWIP_TIMERS */ +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ip.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ip.c new file mode 100644 index 0000000..2e02408 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ip.c @@ -0,0 +1,124 @@ +/** + * @file + * Common IPv4 and IPv6 code + * + * @defgroup ip IP + * @ingroup callbackstyle_api + * + * @defgroup ip4 IPv4 + * @ingroup ip + * + * @defgroup ip6 IPv6 + * @ingroup ip + * + * @defgroup ipaddr IP address handling + * @ingroup infrastructure + * + * @defgroup ip4addr IPv4 only + * @ingroup ipaddr + * + * @defgroup ip6addr IPv6 only + * @ingroup ipaddr + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 || LWIP_IPV6 + +#include "lwip/ip_addr.h" +#include "lwip/ip.h" + +/** Global data for both IPv4 and IPv6 */ +struct ip_globals ip_data; + +#if LWIP_IPV4 && LWIP_IPV6 + +const ip_addr_t ip_addr_any_type = IPADDR_ANY_TYPE_INIT; + +/** + * @ingroup ipaddr + * Convert IP address string (both versions) to numeric. + * The version is auto-detected from the string. + * + * @param cp IP address string to convert + * @param addr conversion result is stored here + * @return 1 on success, 0 on error + */ +int +ipaddr_aton(const char *cp, ip_addr_t *addr) +{ + if (cp != NULL) { + const char* c; + for (c = cp; *c != 0; c++) { + if (*c == ':') { + /* contains a colon: IPv6 address */ + if (addr) { + IP_SET_TYPE_VAL(*addr, IPADDR_TYPE_V6); + } + return ip6addr_aton(cp, ip_2_ip6(addr)); + } else if (*c == '.') { + /* contains a dot: IPv4 address */ + break; + } + } + /* call ip4addr_aton as fallback or if IPv4 was found */ + if (addr) { + IP_SET_TYPE_VAL(*addr, IPADDR_TYPE_V4); + } + return ip4addr_aton(cp, ip_2_ip4(addr)); + } + return 0; +} + +/** + * @ingroup lwip_nosys + * If both IP versions are enabled, this function can dispatch packets to the correct one. + * Don't call directly, pass to netif_add() and call netif->input(). + */ +err_t +ip_input(struct pbuf *p, struct netif *inp) +{ + if (p != NULL) { + if (IP_HDR_GET_VERSION(p->payload) == 6) { + return ip6_input(p, inp); + } + return ip4_input(p, inp); + } + return ERR_VAL; +} + +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#endif /* LWIP_IPV4 || LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/autoip.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/autoip.c new file mode 100644 index 0000000..10db8a3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/autoip.c @@ -0,0 +1,527 @@ +/** + * @file + * AutoIP Automatic LinkLocal IP Configuration + * + * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform + * with RFC 3927. + * + * @defgroup autoip AUTOIP + * @ingroup ip4 + * AUTOIP related functions + * USAGE: + * + * define @ref LWIP_AUTOIP 1 in your lwipopts.h + * Options: + * AUTOIP_TMR_INTERVAL msecs, + * I recommend a value of 100. The value must divide 1000 with a remainder almost 0. + * Possible values are 1000, 500, 333, 250, 200, 166, 142, 125, 111, 100 .... + * + * Without DHCP: + * - Call autoip_start() after netif_add(). + * + * With DHCP: + * - define @ref LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h. + * - Configure your DHCP Client. + * + * @see netifapi_autoip + */ + +/* + * + * Copyright (c) 2007 Dominik Spies + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dominik Spies + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/mem.h" +/* #include "lwip/udp.h" */ +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/autoip.h" +#include "lwip/etharp.h" +#include "lwip/prot/autoip.h" + +#include + +/** Pseudo random macro based on netif informations. + * You could use "rand()" from the C Library if you define LWIP_AUTOIP_RAND in lwipopts.h */ +#ifndef LWIP_AUTOIP_RAND +#define LWIP_AUTOIP_RAND(netif) ( (((u32_t)((netif->hwaddr[5]) & 0xff) << 24) | \ + ((u32_t)((netif->hwaddr[3]) & 0xff) << 16) | \ + ((u32_t)((netif->hwaddr[2]) & 0xff) << 8) | \ + ((u32_t)((netif->hwaddr[4]) & 0xff))) + \ + (netif_autoip_data(netif)? netif_autoip_data(netif)->tried_llipaddr : 0)) +#endif /* LWIP_AUTOIP_RAND */ + +/** + * Macro that generates the initial IP address to be tried by AUTOIP. + * If you want to override this, define it to something else in lwipopts.h. + */ +#ifndef LWIP_AUTOIP_CREATE_SEED_ADDR +#define LWIP_AUTOIP_CREATE_SEED_ADDR(netif) \ + lwip_htonl(AUTOIP_RANGE_START + ((u32_t)(((u8_t)(netif->hwaddr[4])) | \ + ((u32_t)((u8_t)(netif->hwaddr[5]))) << 8))) +#endif /* LWIP_AUTOIP_CREATE_SEED_ADDR */ + +/* static functions */ +static err_t autoip_arp_announce(struct netif *netif); +static void autoip_start_probing(struct netif *netif); + +/** + * @ingroup autoip + * Set a statically allocated struct autoip to work with. + * Using this prevents autoip_start to allocate it using mem_malloc. + * + * @param netif the netif for which to set the struct autoip + * @param autoip (uninitialised) autoip struct allocated by the application + */ +void +autoip_set_struct(struct netif *netif, struct autoip *autoip) +{ + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("autoip != NULL", autoip != NULL); + LWIP_ASSERT("netif already has a struct autoip set", + netif_autoip_data(netif) == NULL); + + /* clear data structure */ + memset(autoip, 0, sizeof(struct autoip)); + /* autoip->state = AUTOIP_STATE_OFF; */ + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, autoip); +} + +/** Restart AutoIP client and check the next address (conflict detected) + * + * @param netif The netif under AutoIP control + */ +static void +autoip_restart(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + autoip->tried_llipaddr++; + autoip_start(netif); +} + +/** + * Handle a IP address conflict after an ARP conflict detection + */ +static void +autoip_handle_arp_conflict(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + + /* RFC3927, 2.5 "Conflict Detection and Defense" allows two options where + a) means retreat on the first conflict and + b) allows to keep an already configured address when having only one + conflict in 10 seconds + We use option b) since it helps to improve the chance that one of the two + conflicting hosts may be able to retain its address. */ + + if (autoip->lastconflict > 0) { + /* retreat, there was a conflicting ARP in the last DEFEND_INTERVAL seconds */ + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_handle_arp_conflict(): we are defending, but in DEFEND_INTERVAL, retreating\n")); + + /* Active TCP sessions are aborted when removing the ip addresss */ + autoip_restart(netif); + } else { + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_handle_arp_conflict(): we are defend, send ARP Announce\n")); + autoip_arp_announce(netif); + autoip->lastconflict = DEFEND_INTERVAL * AUTOIP_TICKS_PER_SECOND; + } +} + +/** + * Create an IP-Address out of range 169.254.1.0 to 169.254.254.255 + * + * @param netif network interface on which create the IP-Address + * @param ipaddr ip address to initialize + */ +static void +autoip_create_addr(struct netif *netif, ip4_addr_t *ipaddr) +{ + struct autoip* autoip = netif_autoip_data(netif); + + /* Here we create an IP-Address out of range 169.254.1.0 to 169.254.254.255 + * compliant to RFC 3927 Section 2.1 + * We have 254 * 256 possibilities */ + + u32_t addr = lwip_ntohl(LWIP_AUTOIP_CREATE_SEED_ADDR(netif)); + addr += autoip->tried_llipaddr; + addr = AUTOIP_NET | (addr & 0xffff); + /* Now, 169.254.0.0 <= addr <= 169.254.255.255 */ + + if (addr < AUTOIP_RANGE_START) { + addr += AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1; + } + if (addr > AUTOIP_RANGE_END) { + addr -= AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1; + } + LWIP_ASSERT("AUTOIP address not in range", (addr >= AUTOIP_RANGE_START) && + (addr <= AUTOIP_RANGE_END)); + ip4_addr_set_u32(ipaddr, lwip_htonl(addr)); + + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_create_addr(): tried_llipaddr=%"U16_F", %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + (u16_t)(autoip->tried_llipaddr), ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), + ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr))); +} + +/** + * Sends an ARP probe from a network interface + * + * @param netif network interface used to send the probe + */ +static err_t +autoip_arp_probe(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + /* this works because netif->ip_addr is ANY */ + return etharp_request(netif, &autoip->llipaddr); +} + +/** + * Sends an ARP announce from a network interface + * + * @param netif network interface used to send the announce + */ +static err_t +autoip_arp_announce(struct netif *netif) +{ + return etharp_gratuitous(netif); +} + +/** + * Configure interface for use with current LL IP-Address + * + * @param netif network interface to configure with current LL IP-Address + */ +static err_t +autoip_bind(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + ip4_addr_t sn_mask, gw_addr; + + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + ("autoip_bind(netif=%p) %c%c%"U16_F" %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num, + ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr), + ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr))); + + IP4_ADDR(&sn_mask, 255, 255, 0, 0); + IP4_ADDR(&gw_addr, 0, 0, 0, 0); + + netif_set_addr(netif, &autoip->llipaddr, &sn_mask, &gw_addr); + /* interface is used by routing now that an address is set */ + + return ERR_OK; +} + +/** + * @ingroup autoip + * Start AutoIP client + * + * @param netif network interface on which start the AutoIP client + */ +err_t +autoip_start(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + err_t result = ERR_OK; + + LWIP_ERROR("netif is not up, old style port?", netif_is_up(netif), return ERR_ARG;); + + /* Set IP-Address, Netmask and Gateway to 0 to make sure that + * ARP Packets are formed correctly + */ + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], + netif->name[1], (u16_t)netif->num)); + if (autoip == NULL) { + /* no AutoIP client attached yet? */ + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + ("autoip_start(): starting new AUTOIP client\n")); + autoip = (struct autoip *)mem_malloc(sizeof(struct autoip)); + if (autoip == NULL) { + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + ("autoip_start(): could not allocate autoip\n")); + return ERR_MEM; + } + memset(autoip, 0, sizeof(struct autoip)); + /* store this AutoIP client in the netif */ + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, autoip); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_start(): allocated autoip")); + } else { + autoip->state = AUTOIP_STATE_OFF; + autoip->ttw = 0; + autoip->sent_num = 0; + ip4_addr_set_zero(&autoip->llipaddr); + autoip->lastconflict = 0; + } + + autoip_create_addr(netif, &(autoip->llipaddr)); + autoip_start_probing(netif); + + return result; +} + +static void +autoip_start_probing(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + + autoip->state = AUTOIP_STATE_PROBING; + autoip->sent_num = 0; + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_start_probing(): changing state to PROBING: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr), + ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr))); + + /* time to wait to first probe, this is randomly + * chosen out of 0 to PROBE_WAIT seconds. + * compliant to RFC 3927 Section 2.2.1 + */ + autoip->ttw = (u16_t)(LWIP_AUTOIP_RAND(netif) % (PROBE_WAIT * AUTOIP_TICKS_PER_SECOND)); + + /* + * if we tried more then MAX_CONFLICTS we must limit our rate for + * acquiring and probing address + * compliant to RFC 3927 Section 2.2.1 + */ + if (autoip->tried_llipaddr > MAX_CONFLICTS) { + autoip->ttw = RATE_LIMIT_INTERVAL * AUTOIP_TICKS_PER_SECOND; + } +} + +/** + * Handle a possible change in the network configuration. + * + * If there is an AutoIP address configured, take the interface down + * and begin probing with the same address. + */ +void +autoip_network_changed(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + + if (autoip && (autoip->state != AUTOIP_STATE_OFF)) { + autoip_start_probing(netif); + } +} + +/** + * @ingroup autoip + * Stop AutoIP client + * + * @param netif network interface on which stop the AutoIP client + */ +err_t +autoip_stop(struct netif *netif) +{ + struct autoip* autoip = netif_autoip_data(netif); + + if (autoip != NULL) { + autoip->state = AUTOIP_STATE_OFF; + if (ip4_addr_islinklocal(netif_ip4_addr(netif))) { + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + } + } + return ERR_OK; +} + +/** + * Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds + */ +void +autoip_tmr(void) +{ + struct netif *netif = netif_list; + /* loop through netif's */ + while (netif != NULL) { + struct autoip* autoip = netif_autoip_data(netif); + /* only act on AutoIP configured interfaces */ + if (autoip != NULL) { + if (autoip->lastconflict > 0) { + autoip->lastconflict--; + } + + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, + ("autoip_tmr() AutoIP-State: %"U16_F", ttw=%"U16_F"\n", + (u16_t)(autoip->state), autoip->ttw)); + + if (autoip->ttw > 0) { + autoip->ttw--; + } + + switch(autoip->state) { + case AUTOIP_STATE_PROBING: + if (autoip->ttw == 0) { + if (autoip->sent_num >= PROBE_NUM) { + /* Switch to ANNOUNCING: now we can bind to an IP address and use it */ + autoip->state = AUTOIP_STATE_ANNOUNCING; + autoip_bind(netif); + /* autoip_bind() calls netif_set_addr(): this triggers a gratuitous ARP + which counts as an announcement */ + autoip->sent_num = 1; + autoip->ttw = ANNOUNCE_WAIT * AUTOIP_TICKS_PER_SECOND; + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_tmr(): changing state to ANNOUNCING: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr), + ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr))); + } else { + autoip_arp_probe(netif); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_tmr() PROBING Sent Probe\n")); + autoip->sent_num++; + if (autoip->sent_num == PROBE_NUM) { + /* calculate time to wait to for announce */ + autoip->ttw = ANNOUNCE_WAIT * AUTOIP_TICKS_PER_SECOND; + } else { + /* calculate time to wait to next probe */ + autoip->ttw = (u16_t)((LWIP_AUTOIP_RAND(netif) % + ((PROBE_MAX - PROBE_MIN) * AUTOIP_TICKS_PER_SECOND) ) + + PROBE_MIN * AUTOIP_TICKS_PER_SECOND); + } + } + } + break; + + case AUTOIP_STATE_ANNOUNCING: + if (autoip->ttw == 0) { + autoip_arp_announce(netif); + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_tmr() ANNOUNCING Sent Announce\n")); + autoip->ttw = ANNOUNCE_INTERVAL * AUTOIP_TICKS_PER_SECOND; + autoip->sent_num++; + + if (autoip->sent_num >= ANNOUNCE_NUM) { + autoip->state = AUTOIP_STATE_BOUND; + autoip->sent_num = 0; + autoip->ttw = 0; + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("autoip_tmr(): changing state to BOUND: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(&autoip->llipaddr), ip4_addr2_16(&autoip->llipaddr), + ip4_addr3_16(&autoip->llipaddr), ip4_addr4_16(&autoip->llipaddr))); + } + } + break; + + default: + /* nothing to do in other states */ + break; + } + } + /* proceed to next network interface */ + netif = netif->next; + } +} + +/** + * Handles every incoming ARP Packet, called by etharp_input(). + * + * @param netif network interface to use for autoip processing + * @param hdr Incoming ARP packet + */ +void +autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) +{ + struct autoip* autoip = netif_autoip_data(netif); + + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE, ("autoip_arp_reply()\n")); + if ((autoip != NULL) && (autoip->state != AUTOIP_STATE_OFF)) { + /* when ip.src == llipaddr && hw.src != netif->hwaddr + * + * when probing ip.dst == llipaddr && hw.src != netif->hwaddr + * we have a conflict and must solve it + */ + ip4_addr_t sipaddr, dipaddr; + struct eth_addr netifaddr; + ETHADDR16_COPY(netifaddr.addr, netif->hwaddr); + + /* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without + * structure packing (not using structure copy which breaks strict-aliasing rules). + */ + IPADDR2_COPY(&sipaddr, &hdr->sipaddr); + IPADDR2_COPY(&dipaddr, &hdr->dipaddr); + + if (autoip->state == AUTOIP_STATE_PROBING) { + /* RFC 3927 Section 2.2.1: + * from beginning to after ANNOUNCE_WAIT + * seconds we have a conflict if + * ip.src == llipaddr OR + * ip.dst == llipaddr && hw.src != own hwaddr + */ + if ((ip4_addr_cmp(&sipaddr, &autoip->llipaddr)) || + (ip4_addr_isany_val(sipaddr) && + ip4_addr_cmp(&dipaddr, &autoip->llipaddr) && + !eth_addr_cmp(&netifaddr, &hdr->shwaddr))) { + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING, + ("autoip_arp_reply(): Probe Conflict detected\n")); + autoip_restart(netif); + } + } else { + /* RFC 3927 Section 2.5: + * in any state we have a conflict if + * ip.src == llipaddr && hw.src != own hwaddr + */ + if (ip4_addr_cmp(&sipaddr, &autoip->llipaddr) && + !eth_addr_cmp(&netifaddr, &hdr->shwaddr)) { + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING, + ("autoip_arp_reply(): Conflicting ARP-Packet detected\n")); + autoip_handle_arp_conflict(netif); + } + } + } +} + +/** check if AutoIP supplied netif->ip_addr + * + * @param netif the netif to check + * @return 1 if AutoIP supplied netif->ip_addr (state BOUND or ANNOUNCING), + * 0 otherwise + */ +u8_t +autoip_supplied_address(const struct netif *netif) +{ + if ((netif != NULL) && (netif_autoip_data(netif) != NULL)) { + struct autoip* autoip = netif_autoip_data(netif); + return (autoip->state == AUTOIP_STATE_BOUND) || (autoip->state == AUTOIP_STATE_ANNOUNCING); + } + return 0; +} + +u8_t +autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr) +{ + struct autoip* autoip = netif_autoip_data(netif); + return (autoip != NULL) && ip4_addr_cmp(addr, &(autoip->llipaddr)); +} + +#endif /* LWIP_IPV4 && LWIP_AUTOIP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/dhcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/dhcp.c new file mode 100644 index 0000000..dd35471 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/dhcp.c @@ -0,0 +1,1950 @@ +/** + * @file + * Dynamic Host Configuration Protocol client + * + * @defgroup dhcp4 DHCPv4 + * @ingroup ip4 + * DHCP (IPv4) related functions + * This is a DHCP client for the lwIP TCP/IP stack. It aims to conform + * with RFC 2131 and RFC 2132. + * + * @todo: + * - Support for interfaces other than Ethernet (SLIP, PPP, ...) + * + * Options: + * @ref DHCP_COARSE_TIMER_SECS (recommended 60 which is a minute) + * @ref DHCP_FINE_TIMER_MSECS (recommended 500 which equals TCP coarse timer) + * + * dhcp_start() starts a DHCP client instance which + * configures the interface by obtaining an IP address lease and maintaining it. + * + * Use dhcp_release() to end the lease and use dhcp_stop() + * to remove the DHCP client. + * + * @see netifapi_dhcp4 + */ + +/* + * Copyright (c) 2001-2004 Leon Woestenberg + * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * The Swedish Institute of Computer Science and Adam Dunkels + * are specifically granted permission to redistribute this + * source code. + * + * Author: Leon Woestenberg + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 && LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/stats.h" +#include "lwip/mem.h" +#include "lwip/udp.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/def.h" +#include "lwip/dhcp.h" +#include "lwip/autoip.h" +#include "lwip/dns.h" +#include "lwip/etharp.h" +#include "lwip/prot/dhcp.h" + +#include + +/** DHCP_CREATE_RAND_XID: if this is set to 1, the xid is created using + * LWIP_RAND() (this overrides DHCP_GLOBAL_XID) + */ +#ifndef DHCP_CREATE_RAND_XID +#define DHCP_CREATE_RAND_XID 1 +#endif + +/** Default for DHCP_GLOBAL_XID is 0xABCD0000 + * This can be changed by defining DHCP_GLOBAL_XID and DHCP_GLOBAL_XID_HEADER, e.g. + * \#define DHCP_GLOBAL_XID_HEADER "stdlib.h" + * \#define DHCP_GLOBAL_XID rand() + */ +#ifdef DHCP_GLOBAL_XID_HEADER +#include DHCP_GLOBAL_XID_HEADER /* include optional starting XID generation prototypes */ +#endif + +/** DHCP_OPTION_MAX_MSG_SIZE is set to the MTU + * MTU is checked to be big enough in dhcp_start */ +#define DHCP_MAX_MSG_LEN(netif) (netif->mtu) +#define DHCP_MAX_MSG_LEN_MIN_REQUIRED 576 +/** Minimum length for reply before packet is parsed */ +#define DHCP_MIN_REPLY_LEN 44 + +#define REBOOT_TRIES 2 + +#if LWIP_DNS && LWIP_DHCP_MAX_DNS_SERVERS +#if DNS_MAX_SERVERS > LWIP_DHCP_MAX_DNS_SERVERS +#define LWIP_DHCP_PROVIDE_DNS_SERVERS LWIP_DHCP_MAX_DNS_SERVERS +#else +#define LWIP_DHCP_PROVIDE_DNS_SERVERS DNS_MAX_SERVERS +#endif +#else +#define LWIP_DHCP_PROVIDE_DNS_SERVERS 0 +#endif + +/** Option handling: options are parsed in dhcp_parse_reply + * and saved in an array where other functions can load them from. + * This might be moved into the struct dhcp (not necessarily since + * lwIP is single-threaded and the array is only used while in recv + * callback). */ +enum dhcp_option_idx { + DHCP_OPTION_IDX_OVERLOAD = 0, + DHCP_OPTION_IDX_MSG_TYPE, + DHCP_OPTION_IDX_SERVER_ID, + DHCP_OPTION_IDX_LEASE_TIME, + DHCP_OPTION_IDX_T1, + DHCP_OPTION_IDX_T2, + DHCP_OPTION_IDX_SUBNET_MASK, + DHCP_OPTION_IDX_ROUTER, +#if LWIP_DHCP_PROVIDE_DNS_SERVERS + DHCP_OPTION_IDX_DNS_SERVER, + DHCP_OPTION_IDX_DNS_SERVER_LAST = DHCP_OPTION_IDX_DNS_SERVER + LWIP_DHCP_PROVIDE_DNS_SERVERS - 1, +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ +#if LWIP_DHCP_GET_NTP_SRV + DHCP_OPTION_IDX_NTP_SERVER, + DHCP_OPTION_IDX_NTP_SERVER_LAST = DHCP_OPTION_IDX_NTP_SERVER + LWIP_DHCP_MAX_NTP_SERVERS - 1, +#endif /* LWIP_DHCP_GET_NTP_SRV */ + DHCP_OPTION_IDX_MAX +}; + +/** Holds the decoded option values, only valid while in dhcp_recv. + @todo: move this into struct dhcp? */ +u32_t dhcp_rx_options_val[DHCP_OPTION_IDX_MAX]; +/** Holds a flag which option was received and is contained in dhcp_rx_options_val, + only valid while in dhcp_recv. + @todo: move this into struct dhcp? */ +u8_t dhcp_rx_options_given[DHCP_OPTION_IDX_MAX]; + +static u8_t dhcp_discover_request_options[] = { + DHCP_OPTION_SUBNET_MASK, + DHCP_OPTION_ROUTER, + DHCP_OPTION_BROADCAST +#if LWIP_DHCP_PROVIDE_DNS_SERVERS + , DHCP_OPTION_DNS_SERVER +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ +#if LWIP_DHCP_GET_NTP_SRV + , DHCP_OPTION_NTP +#endif /* LWIP_DHCP_GET_NTP_SRV */ + }; + +#ifdef DHCP_GLOBAL_XID +static u32_t xid; +static u8_t xid_initialised; +#endif /* DHCP_GLOBAL_XID */ + +#define dhcp_option_given(dhcp, idx) (dhcp_rx_options_given[idx] != 0) +#define dhcp_got_option(dhcp, idx) (dhcp_rx_options_given[idx] = 1) +#define dhcp_clear_option(dhcp, idx) (dhcp_rx_options_given[idx] = 0) +#define dhcp_clear_all_options(dhcp) (memset(dhcp_rx_options_given, 0, sizeof(dhcp_rx_options_given))) +#define dhcp_get_option_value(dhcp, idx) (dhcp_rx_options_val[idx]) +#define dhcp_set_option_value(dhcp, idx, val) (dhcp_rx_options_val[idx] = (val)) + +static struct udp_pcb *dhcp_pcb; +static u8_t dhcp_pcb_refcount; + +/* DHCP client state machine functions */ +static err_t dhcp_discover(struct netif *netif); +static err_t dhcp_select(struct netif *netif); +static void dhcp_bind(struct netif *netif); +#if DHCP_DOES_ARP_CHECK +static err_t dhcp_decline(struct netif *netif); +#endif /* DHCP_DOES_ARP_CHECK */ +static err_t dhcp_rebind(struct netif *netif); +static err_t dhcp_reboot(struct netif *netif); +static void dhcp_set_state(struct dhcp *dhcp, u8_t new_state); + +/* receive, unfold, parse and free incoming messages */ +static void dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port); + +/* set the DHCP timers */ +static void dhcp_timeout(struct netif *netif); +static void dhcp_t1_timeout(struct netif *netif); +static void dhcp_t2_timeout(struct netif *netif); + +/* build outgoing messages */ +/* create a DHCP message, fill in common headers */ +static err_t dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type); +/* free a DHCP request */ +static void dhcp_delete_msg(struct dhcp *dhcp); +/* add a DHCP option (type, then length in bytes) */ +static void dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len); +/* add option values */ +static void dhcp_option_byte(struct dhcp *dhcp, u8_t value); +static void dhcp_option_short(struct dhcp *dhcp, u16_t value); +static void dhcp_option_long(struct dhcp *dhcp, u32_t value); +#if LWIP_NETIF_HOSTNAME +static void dhcp_option_hostname(struct dhcp *dhcp, struct netif *netif); +#endif /* LWIP_NETIF_HOSTNAME */ +/* always add the DHCP options trailer to end and pad */ +static void dhcp_option_trailer(struct dhcp *dhcp); + +/** Ensure DHCP PCB is allocated and bound */ +static err_t +dhcp_inc_pcb_refcount(void) +{ + if (dhcp_pcb_refcount == 0) { + LWIP_ASSERT("dhcp_inc_pcb_refcount(): memory leak", dhcp_pcb == NULL); + + /* allocate UDP PCB */ + dhcp_pcb = udp_new(); + + if (dhcp_pcb == NULL) { + return ERR_MEM; + } + + ip_set_option(dhcp_pcb, SOF_BROADCAST); + + /* set up local and remote port for the pcb -> listen on all interfaces on all src/dest IPs */ + udp_bind(dhcp_pcb, IP4_ADDR_ANY, DHCP_CLIENT_PORT); + udp_connect(dhcp_pcb, IP4_ADDR_ANY, DHCP_SERVER_PORT); + udp_recv(dhcp_pcb, dhcp_recv, NULL); + } + + dhcp_pcb_refcount++; + + return ERR_OK; +} + +/** Free DHCP PCB if the last netif stops using it */ +static void +dhcp_dec_pcb_refcount(void) +{ + LWIP_ASSERT("dhcp_pcb_refcount(): refcount error", (dhcp_pcb_refcount > 0)); + dhcp_pcb_refcount--; + + if (dhcp_pcb_refcount == 0) { + udp_remove(dhcp_pcb); + dhcp_pcb = NULL; + } +} + +/** + * Back-off the DHCP client (because of a received NAK response). + * + * Back-off the DHCP client because of a received NAK. Receiving a + * NAK means the client asked for something non-sensible, for + * example when it tries to renew a lease obtained on another network. + * + * We clear any existing set IP address and restart DHCP negotiation + * afresh (as per RFC2131 3.2.3). + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_nak(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", + (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + /* Change to a defined state - set this before assigning the address + to ensure the callback can use dhcp_supplied_address() */ + dhcp_set_state(dhcp, DHCP_STATE_BACKING_OFF); + /* remove IP address from interface (must no longer be used, as per RFC2131) */ + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + /* We can immediately restart discovery */ + dhcp_discover(netif); +} + +#if DHCP_DOES_ARP_CHECK +/** + * Checks if the offered IP address is already in use. + * + * It does so by sending an ARP request for the offered address and + * entering CHECKING state. If no ARP reply is received within a small + * interval, the address is assumed to be free for use by us. + * + * @param netif the netif under DHCP control + */ +static void +dhcp_check(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + u16_t msecs; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0], + (s16_t)netif->name[1])); + dhcp_set_state(dhcp, DHCP_STATE_CHECKING); + /* create an ARP query for the offered IP address, expecting that no host + responds, as the IP address should not be in use. */ + result = etharp_query(netif, &dhcp->offered_ip_addr, NULL); + if (result != ERR_OK) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_check: could not perform ARP query\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + msecs = 500; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_check(): set request timeout %"U16_F" msecs\n", msecs)); +} +#endif /* DHCP_DOES_ARP_CHECK */ + +/** + * Remember the configuration offered by a DHCP server. + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_offer(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_offer(netif=%p) %c%c%"U16_F"\n", + (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + /* obtain the server address */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SERVER_ID)) { + ip_addr_set_ip4_u32(&dhcp->server_ip_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SERVER_ID))); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): server 0x%08"X32_F"\n", + ip4_addr_get_u32(ip_2_ip4(&dhcp->server_ip_addr)))); + /* remember offered address */ + ip4_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_handle_offer(): offer for 0x%08"X32_F"\n", + ip4_addr_get_u32(&dhcp->offered_ip_addr))); + + dhcp_select(netif); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_handle_offer(netif=%p) did not get server ID!\n", (void*)netif)); + } +} + +/** + * Select a DHCP server offer out of all offers. + * + * Simply select the first offer received. + * + * @param netif the netif under DHCP control + * @return lwIP specific error (see error.h) + */ +static err_t +dhcp_select(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + u16_t msecs; + u8_t i; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_select(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + dhcp_set_state(dhcp, DHCP_STATE_REQUESTING); + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif)); + + /* MUST request the offered IP address */ + dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4); + dhcp_option_long(dhcp, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + + dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4); + dhcp_option_long(dhcp, lwip_ntohl(ip4_addr_get_u32(ip_2_ip4(&dhcp->server_ip_addr)))); + + dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + dhcp_option_byte(dhcp, dhcp_discover_request_options[i]); + } + +#if LWIP_NETIF_HOSTNAME + dhcp_option_hostname(dhcp, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + dhcp_option_trailer(dhcp); + /* shrink the pbuf to the actual content length */ + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + /* send broadcast to any DHCP server */ + udp_sendto_if_src(dhcp_pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif, IP4_ADDR_ANY); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_select: REQUESTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("dhcp_select: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_select(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} + +/** + * The DHCP timer that checks for lease renewal/rebind timeouts. + * Must be called once a minute (see @ref DHCP_COARSE_TIMER_SECS). + */ +void +dhcp_coarse_tmr(void) +{ + struct netif *netif = netif_list; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_coarse_tmr()\n")); + /* iterate through all network interfaces */ + while (netif != NULL) { + /* only act on DHCP configured interfaces */ + struct dhcp *dhcp = netif_dhcp_data(netif); + if ((dhcp != NULL) && (dhcp->state != DHCP_STATE_OFF)) { + /* compare lease time to expire timeout */ + if (dhcp->t0_timeout && (++dhcp->lease_used == dhcp->t0_timeout)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t0 timeout\n")); + /* this clients' lease time has expired */ + dhcp_release(netif); + dhcp_discover(netif); + /* timer is active (non zero), and triggers (zeroes) now? */ + } else if (dhcp->t2_rebind_time && (dhcp->t2_rebind_time-- == 1)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t2 timeout\n")); + /* this clients' rebind timeout triggered */ + dhcp_t2_timeout(netif); + /* timer is active (non zero), and triggers (zeroes) now */ + } else if (dhcp->t1_renew_time && (dhcp->t1_renew_time-- == 1)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_coarse_tmr(): t1 timeout\n")); + /* this clients' renewal timeout triggered */ + dhcp_t1_timeout(netif); + } + } + /* proceed to next netif */ + netif = netif->next; + } +} + +/** + * DHCP transaction timeout handling (this function must be called every 500ms, + * see @ref DHCP_FINE_TIMER_MSECS). + * + * A DHCP server is expected to respond within a short period of time. + * This timer checks whether an outstanding DHCP request is timed out. + */ +void +dhcp_fine_tmr(void) +{ + struct netif *netif = netif_list; + /* loop through netif's */ + while (netif != NULL) { + struct dhcp *dhcp = netif_dhcp_data(netif); + /* only act on DHCP configured interfaces */ + if (dhcp != NULL) { + /* timer is active (non zero), and is about to trigger now */ + if (dhcp->request_timeout > 1) { + dhcp->request_timeout--; + } + else if (dhcp->request_timeout == 1) { + dhcp->request_timeout--; + /* { netif->dhcp->request_timeout == 0 } */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_fine_tmr(): request timeout\n")); + /* this client's request timeout triggered */ + dhcp_timeout(netif); + } + } + /* proceed to next network interface */ + netif = netif->next; + } +} + +/** + * A DHCP negotiation transaction, or ARP request, has timed out. + * + * The timer that was started with the DHCP or ARP request has + * timed out, indicating no response was received in time. + * + * @param netif the netif under DHCP control + */ +static void +dhcp_timeout(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout()\n")); + /* back-off period has passed, or server selection timed out */ + if ((dhcp->state == DHCP_STATE_BACKING_OFF) || (dhcp->state == DHCP_STATE_SELECTING)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_timeout(): restarting discovery\n")); + dhcp_discover(netif); + /* receiving the requested lease timed out */ + } else if (dhcp->state == DHCP_STATE_REQUESTING) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, DHCP request timed out\n")); + if (dhcp->tries <= 5) { + dhcp_select(netif); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): REQUESTING, releasing, restarting\n")); + dhcp_release(netif); + dhcp_discover(netif); + } +#if DHCP_DOES_ARP_CHECK + /* received no ARP reply for the offered address (which is good) */ + } else if (dhcp->state == DHCP_STATE_CHECKING) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_timeout(): CHECKING, ARP request timed out\n")); + if (dhcp->tries <= 1) { + dhcp_check(netif); + /* no ARP replies on the offered address, + looks like the IP address is indeed free */ + } else { + /* bind the interface to the offered address */ + dhcp_bind(netif); + } +#endif /* DHCP_DOES_ARP_CHECK */ + } else if (dhcp->state == DHCP_STATE_REBOOTING) { + if (dhcp->tries < REBOOT_TRIES) { + dhcp_reboot(netif); + } else { + dhcp_discover(netif); + } + } +} + +/** + * The renewal period has timed out. + * + * @param netif the netif under DHCP control + */ +static void +dhcp_t1_timeout(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_t1_timeout()\n")); + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + (dhcp->state == DHCP_STATE_RENEWING)) { + /* just retry to renew - note that the rebind timer (t2) will + * eventually time-out if renew tries fail. */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("dhcp_t1_timeout(): must renew\n")); + /* This slightly different to RFC2131: DHCPREQUEST will be sent from state + DHCP_STATE_RENEWING, not DHCP_STATE_BOUND */ + dhcp_renew(netif); + /* Calculate next timeout */ + if (((dhcp->t2_timeout - dhcp->lease_used) / 2) >= ((60 + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS)) + { + dhcp->t1_renew_time = ((dhcp->t2_timeout - dhcp->lease_used) / 2); + } + } +} + +/** + * The rebind period has timed out. + * + * @param netif the netif under DHCP control + */ +static void +dhcp_t2_timeout(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_t2_timeout()\n")); + if ((dhcp->state == DHCP_STATE_REQUESTING) || (dhcp->state == DHCP_STATE_BOUND) || + (dhcp->state == DHCP_STATE_RENEWING) || (dhcp->state == DHCP_STATE_REBINDING)) { + /* just retry to rebind */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + ("dhcp_t2_timeout(): must rebind\n")); + /* This slightly different to RFC2131: DHCPREQUEST will be sent from state + DHCP_STATE_REBINDING, not DHCP_STATE_BOUND */ + dhcp_rebind(netif); + /* Calculate next timeout */ + if (((dhcp->t0_timeout - dhcp->lease_used) / 2) >= ((60 + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS)) + { + dhcp->t2_rebind_time = ((dhcp->t0_timeout - dhcp->lease_used) / 2); + } + } +} + +/** + * Handle a DHCP ACK packet + * + * @param netif the netif under DHCP control + */ +static void +dhcp_handle_ack(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + +#if LWIP_DHCP_PROVIDE_DNS_SERVERS || LWIP_DHCP_GET_NTP_SRV + u8_t n; +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS || LWIP_DHCP_GET_NTP_SRV */ +#if LWIP_DHCP_GET_NTP_SRV + ip4_addr_t ntp_server_addrs[LWIP_DHCP_MAX_NTP_SERVERS]; +#endif + + /* clear options we might not get from the ACK */ + ip4_addr_set_zero(&dhcp->offered_sn_mask); + ip4_addr_set_zero(&dhcp->offered_gw_addr); +#if LWIP_DHCP_BOOTP_FILE + ip4_addr_set_zero(&dhcp->offered_si_addr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* lease time given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_LEASE_TIME)) { + /* remember offered lease time */ + dhcp->offered_t0_lease = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_LEASE_TIME); + } + /* renewal period given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T1)) { + /* remember given renewal period */ + dhcp->offered_t1_renew = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T1); + } else { + /* calculate safe periods for renewal */ + dhcp->offered_t1_renew = dhcp->offered_t0_lease / 2; + } + + /* renewal period given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_T2)) { + /* remember given rebind period */ + dhcp->offered_t2_rebind = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_T2); + } else { + /* calculate safe periods for rebinding (offered_t0_lease * 0.875 -> 87.5%)*/ + dhcp->offered_t2_rebind = (dhcp->offered_t0_lease * 7U) / 8U; + } + + /* (y)our internet address */ + ip4_addr_copy(dhcp->offered_ip_addr, dhcp->msg_in->yiaddr); + +#if LWIP_DHCP_BOOTP_FILE + /* copy boot server address, + boot file name copied in dhcp_parse_reply if not overloaded */ + ip4_addr_copy(dhcp->offered_si_addr, dhcp->msg_in->siaddr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* subnet mask given? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) { + /* remember given subnet mask */ + ip4_addr_set_u32(&dhcp->offered_sn_mask, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK))); + dhcp->subnet_mask_given = 1; + } else { + dhcp->subnet_mask_given = 0; + } + + /* gateway router */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) { + ip4_addr_set_u32(&dhcp->offered_gw_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER))); + } + +#if LWIP_DHCP_GET_NTP_SRV + /* NTP servers */ + for (n = 0; (n < LWIP_DHCP_MAX_NTP_SERVERS) && dhcp_option_given(dhcp, DHCP_OPTION_IDX_NTP_SERVER + n); n++) { + ip4_addr_set_u32(&ntp_server_addrs[n], lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_NTP_SERVER + n))); + } + dhcp_set_ntp_servers(n, ntp_server_addrs); +#endif /* LWIP_DHCP_GET_NTP_SRV */ + +#if LWIP_DHCP_PROVIDE_DNS_SERVERS + /* DNS servers */ + for (n = 0; (n < LWIP_DHCP_PROVIDE_DNS_SERVERS) && dhcp_option_given(dhcp, DHCP_OPTION_IDX_DNS_SERVER + n); n++) { + ip_addr_t dns_addr; + ip_addr_set_ip4_u32(&dns_addr, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_DNS_SERVER + n))); + dns_setserver(n, &dns_addr); + } +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ +} + +/** + * @ingroup dhcp4 + * Set a statically allocated struct dhcp to work with. + * Using this prevents dhcp_start to allocate it using mem_malloc. + * + * @param netif the netif for which to set the struct dhcp + * @param dhcp (uninitialised) dhcp struct allocated by the application + */ +void +dhcp_set_struct(struct netif *netif, struct dhcp *dhcp) +{ + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("dhcp != NULL", dhcp != NULL); + LWIP_ASSERT("netif already has a struct dhcp set", netif_dhcp_data(netif) == NULL); + + /* clear data structure */ + memset(dhcp, 0, sizeof(struct dhcp)); + /* dhcp_set_state(&dhcp, DHCP_STATE_OFF); */ + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, dhcp); +} + +/** + * @ingroup dhcp4 + * Removes a struct dhcp from a netif. + * + * ATTENTION: Only use this when not using dhcp_set_struct() to allocate the + * struct dhcp since the memory is passed back to the heap. + * + * @param netif the netif from which to remove the struct dhcp + */ +void dhcp_cleanup(struct netif *netif) +{ + LWIP_ASSERT("netif != NULL", netif != NULL); + + if (netif_dhcp_data(netif) != NULL) { + mem_free(netif_dhcp_data(netif)); + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL); + } +} + +/** + * @ingroup dhcp4 + * Start DHCP negotiation for a network interface. + * + * If no DHCP client instance was attached to this interface, + * a new client is created first. If a DHCP client instance + * was already present, it restarts negotiation. + * + * @param netif The lwIP network interface + * @return lwIP error code + * - ERR_OK - No error + * - ERR_MEM - Out of memory + */ +err_t +dhcp_start(struct netif *netif) +{ + struct dhcp *dhcp; + err_t result; + + LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;); + LWIP_ERROR("netif is not up, old style port?", netif_is_up(netif), return ERR_ARG;); + dhcp = netif_dhcp_data(netif); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + + /* check MTU of the netif */ + if (netif->mtu < DHCP_MAX_MSG_LEN_MIN_REQUIRED) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): Cannot use this netif with DHCP: MTU is too small\n")); + return ERR_MEM; + } + + /* no DHCP client attached yet? */ + if (dhcp == NULL) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting new DHCP client\n")); + dhcp = (struct dhcp *)mem_malloc(sizeof(struct dhcp)); + if (dhcp == NULL) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n")); + return ERR_MEM; + } + + /* store this dhcp client in the netif */ + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp")); + /* already has DHCP client attached */ + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(): restarting DHCP configuration\n")); + LWIP_ASSERT("pbuf p_out wasn't freed", dhcp->p_out == NULL); + LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL ); + + if (dhcp->pcb_allocated != 0) { + dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */ + } + /* dhcp is cleared below, no need to reset flag*/ + } + + /* clear data structure */ + memset(dhcp, 0, sizeof(struct dhcp)); + /* dhcp_set_state(&dhcp, DHCP_STATE_OFF); */ + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n")); + + if (dhcp_inc_pcb_refcount() != ERR_OK) { /* ensure DHCP PCB is allocated */ + return ERR_MEM; + } + dhcp->pcb_allocated = 1; + +#if LWIP_DHCP_CHECK_LINK_UP + if (!netif_is_link_up(netif)) { + /* set state INIT and wait for dhcp_network_changed() to call dhcp_discover() */ + dhcp_set_state(dhcp, DHCP_STATE_INIT); + return ERR_OK; + } +#endif /* LWIP_DHCP_CHECK_LINK_UP */ + + + /* (re)start the DHCP negotiation */ + result = dhcp_discover(netif); + if (result != ERR_OK) { + /* free resources allocated above */ + dhcp_stop(netif); + return ERR_MEM; + } + return result; +} + +/** + * @ingroup dhcp4 + * Inform a DHCP server of our manual configuration. + * + * This informs DHCP servers of our fixed IP address configuration + * by sending an INFORM message. It does not involve DHCP address + * configuration, it is just here to be nice to the network. + * + * @param netif The lwIP network interface + */ +void +dhcp_inform(struct netif *netif) +{ + struct dhcp dhcp; + err_t result = ERR_OK; + + LWIP_ERROR("netif != NULL", (netif != NULL), return;); + + if (dhcp_inc_pcb_refcount() != ERR_OK) { /* ensure DHCP PCB is allocated */ + return; + } + + memset(&dhcp, 0, sizeof(struct dhcp)); + dhcp_set_state(&dhcp, DHCP_STATE_INFORMING); + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, &dhcp, DHCP_INFORM); + if (result == ERR_OK) { + dhcp_option(&dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(&dhcp, DHCP_MAX_MSG_LEN(netif)); + + dhcp_option_trailer(&dhcp); + + pbuf_realloc(dhcp.p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp.options_out_len); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_inform: INFORMING\n")); + + udp_sendto_if(dhcp_pcb, dhcp.p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif); + + dhcp_delete_msg(&dhcp); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_inform: could not allocate DHCP request\n")); + } + + dhcp_dec_pcb_refcount(); /* delete DHCP PCB if not needed any more */ +} + +/** Handle a possible change in the network configuration. + * + * This enters the REBOOTING state to verify that the currently bound + * address is still valid. + */ +void +dhcp_network_changed(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + + if (!dhcp) + return; + switch (dhcp->state) { + case DHCP_STATE_REBINDING: + case DHCP_STATE_RENEWING: + case DHCP_STATE_BOUND: + case DHCP_STATE_REBOOTING: + dhcp->tries = 0; + dhcp_reboot(netif); + break; + case DHCP_STATE_OFF: + /* stay off */ + break; + default: + /* INIT/REQUESTING/CHECKING/BACKING_OFF restart with new 'rid' because the + state changes, SELECTING: continue with current 'rid' as we stay in the + same state */ +#if LWIP_DHCP_AUTOIP_COOP + if (dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_ON) { + autoip_stop(netif); + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF; + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + /* ensure we start with short timeouts, even if already discovering */ + dhcp->tries = 0; + dhcp_discover(netif); + break; + } +} + +#if DHCP_DOES_ARP_CHECK +/** + * Match an ARP reply with the offered IP address: + * check whether the offered IP address is not in use using ARP + * + * @param netif the network interface on which the reply was received + * @param addr The IP address we received a reply from + */ +void +dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr) +{ + struct dhcp *dhcp; + + LWIP_ERROR("netif != NULL", (netif != NULL), return;); + dhcp = netif_dhcp_data(netif); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_arp_reply()\n")); + /* is a DHCP client doing an ARP check? */ + if ((dhcp != NULL) && (dhcp->state == DHCP_STATE_CHECKING)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_arp_reply(): CHECKING, arp reply for 0x%08"X32_F"\n", + ip4_addr_get_u32(addr))); + /* did a host respond with the address we + were offered by the DHCP server? */ + if (ip4_addr_cmp(addr, &dhcp->offered_ip_addr)) { + /* we will not accept the offered address */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING, + ("dhcp_arp_reply(): arp reply matched with offered address, declining\n")); + dhcp_decline(netif); + } + } +} + +/** + * Decline an offered lease. + * + * Tell the DHCP server we do not accept the offered address. + * One reason to decline the lease is when we find out the address + * is already in use by another host (through ARP). + * + * @param netif the netif under DHCP control + */ +static err_t +dhcp_decline(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result = ERR_OK; + u16_t msecs; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline()\n")); + dhcp_set_state(dhcp, DHCP_STATE_BACKING_OFF); + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_DECLINE); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4); + dhcp_option_long(dhcp, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + + dhcp_option_trailer(dhcp); + /* resize pbuf to reflect true size of options */ + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + /* per section 4.4.4, broadcast DECLINE messages */ + udp_sendto_if_src(dhcp_pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif, IP4_ADDR_ANY); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_decline: BACKING OFF\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_decline: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + msecs = 10*1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_decline(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} +#endif /* DHCP_DOES_ARP_CHECK */ + + +/** + * Start the DHCP process, discover a DHCP server. + * + * @param netif the netif under DHCP control + */ +static err_t +dhcp_discover(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result = ERR_OK; + u16_t msecs; + u8_t i; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover()\n")); + ip4_addr_set_any(&dhcp->offered_ip_addr); + dhcp_set_state(dhcp, DHCP_STATE_SELECTING); + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_DISCOVER); + if (result == ERR_OK) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: making request\n")); + + dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif)); + + dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + dhcp_option_byte(dhcp, dhcp_discover_request_options[i]); + } + dhcp_option_trailer(dhcp); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: realloc()ing\n")); + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)\n")); + udp_sendto_if_src(dhcp_pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif, IP4_ADDR_ANY); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_discover: deleting()ing\n")); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover: SELECTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_discover: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } +#if LWIP_DHCP_AUTOIP_COOP + if (dhcp->tries >= LWIP_DHCP_AUTOIP_COOP_TRIES && dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_OFF) { + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_ON; + autoip_start(netif); + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + msecs = (dhcp->tries < 6 ? 1 << dhcp->tries : 60) * 1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_discover(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} + + +/** + * Bind the interface to the offered IP address. + * + * @param netif network interface to bind to the offered address + */ +static void +dhcp_bind(struct netif *netif) +{ + u32_t timeout; + struct dhcp *dhcp; + ip4_addr_t sn_mask, gw_addr; + LWIP_ERROR("dhcp_bind: netif != NULL", (netif != NULL), return;); + dhcp = netif_dhcp_data(netif); + LWIP_ERROR("dhcp_bind: dhcp != NULL", (dhcp != NULL), return;); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); + + /* reset time used of lease */ + dhcp->lease_used = 0; + + if (dhcp->offered_t0_lease != 0xffffffffUL) { + /* set renewal period timer */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t0 renewal timer %"U32_F" secs\n", dhcp->offered_t0_lease)); + timeout = (dhcp->offered_t0_lease + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + if (timeout > 0xffff) { + timeout = 0xffff; + } + dhcp->t0_timeout = (u16_t)timeout; + if (dhcp->t0_timeout == 0) { + dhcp->t0_timeout = 1; + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t0_lease*1000)); + } + + /* temporary DHCP lease? */ + if (dhcp->offered_t1_renew != 0xffffffffUL) { + /* set renewal period timer */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t1 renewal timer %"U32_F" secs\n", dhcp->offered_t1_renew)); + timeout = (dhcp->offered_t1_renew + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + if (timeout > 0xffff) { + timeout = 0xffff; + } + dhcp->t1_timeout = (u16_t)timeout; + if (dhcp->t1_timeout == 0) { + dhcp->t1_timeout = 1; + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t1_renew*1000)); + dhcp->t1_renew_time = dhcp->t1_timeout; + } + /* set renewal period timer */ + if (dhcp->offered_t2_rebind != 0xffffffffUL) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_bind(): t2 rebind timer %"U32_F" secs\n", dhcp->offered_t2_rebind)); + timeout = (dhcp->offered_t2_rebind + DHCP_COARSE_TIMER_SECS / 2) / DHCP_COARSE_TIMER_SECS; + if (timeout > 0xffff) { + timeout = 0xffff; + } + dhcp->t2_timeout = (u16_t)timeout; + if (dhcp->t2_timeout == 0) { + dhcp->t2_timeout = 1; + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_bind(): set request timeout %"U32_F" msecs\n", dhcp->offered_t2_rebind*1000)); + dhcp->t2_rebind_time = dhcp->t2_timeout; + } + + /* If we have sub 1 minute lease, t2 and t1 will kick in at the same time. */ + if ((dhcp->t1_timeout >= dhcp->t2_timeout) && (dhcp->t2_timeout > 0)) { + dhcp->t1_timeout = 0; + } + + if (dhcp->subnet_mask_given) { + /* copy offered network mask */ + ip4_addr_copy(sn_mask, dhcp->offered_sn_mask); + } else { + /* subnet mask not given, choose a safe subnet mask given the network class */ + u8_t first_octet = ip4_addr1(&dhcp->offered_ip_addr); + if (first_octet <= 127) { + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xff000000UL)); + } else if (first_octet >= 192) { + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffffff00UL)); + } else { + ip4_addr_set_u32(&sn_mask, PP_HTONL(0xffff0000UL)); + } + } + + ip4_addr_copy(gw_addr, dhcp->offered_gw_addr); + /* gateway address not given? */ + if (ip4_addr_isany_val(gw_addr)) { + /* copy network address */ + ip4_addr_get_network(&gw_addr, &dhcp->offered_ip_addr, &sn_mask); + /* use first host address on network as gateway */ + ip4_addr_set_u32(&gw_addr, ip4_addr_get_u32(&gw_addr) | PP_HTONL(0x00000001UL)); + } + +#if LWIP_DHCP_AUTOIP_COOP + if (dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_ON) { + autoip_stop(netif); + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF; + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_STATE, ("dhcp_bind(): IP: 0x%08"X32_F" SN: 0x%08"X32_F" GW: 0x%08"X32_F"\n", + ip4_addr_get_u32(&dhcp->offered_ip_addr), ip4_addr_get_u32(&sn_mask), ip4_addr_get_u32(&gw_addr))); + /* netif is now bound to DHCP leased address - set this before assigning the address + to ensure the callback can use dhcp_supplied_address() */ + dhcp_set_state(dhcp, DHCP_STATE_BOUND); + + netif_set_addr(netif, &dhcp->offered_ip_addr, &sn_mask, &gw_addr); + /* interface is used by routing now that an address is set */ +} + +/** + * @ingroup dhcp4 + * Renew an existing DHCP lease at the involved DHCP server. + * + * @param netif network interface which must renew its lease + */ +err_t +dhcp_renew(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + u16_t msecs; + u8_t i; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_renew()\n")); + dhcp_set_state(dhcp, DHCP_STATE_RENEWING); + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif)); + + dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + dhcp_option_byte(dhcp, dhcp_discover_request_options[i]); + } + +#if LWIP_NETIF_HOSTNAME + dhcp_option_hostname(dhcp, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + /* append DHCP message trailer */ + dhcp_option_trailer(dhcp); + + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + udp_sendto_if(dhcp_pcb, dhcp->p_out, &dhcp->server_ip_addr, DHCP_SERVER_PORT, netif); + dhcp_delete_msg(dhcp); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew: RENEWING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_renew: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + /* back-off on retries, but to a maximum of 20 seconds */ + msecs = dhcp->tries < 10 ? dhcp->tries * 2000 : 20 * 1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_renew(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} + +/** + * Rebind with a DHCP server for an existing DHCP lease. + * + * @param netif network interface which must rebind with a DHCP server + */ +static err_t +dhcp_rebind(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + u16_t msecs; + u8_t i; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind()\n")); + dhcp_set_state(dhcp, DHCP_STATE_REBINDING); + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif)); + + dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + dhcp_option_byte(dhcp, dhcp_discover_request_options[i]); + } + +#if LWIP_NETIF_HOSTNAME + dhcp_option_hostname(dhcp, netif); +#endif /* LWIP_NETIF_HOSTNAME */ + + dhcp_option_trailer(dhcp); + + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + /* broadcast to server */ + udp_sendto_if(dhcp_pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind: REBINDING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_rebind: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_rebind(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} + +/** + * Enter REBOOTING state to verify an existing lease + * + * @param netif network interface which must reboot + */ +static err_t +dhcp_reboot(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + u16_t msecs; + u8_t i; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot()\n")); + dhcp_set_state(dhcp, DHCP_STATE_REBOOTING); + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_REQUEST); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN); + dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN_MIN_REQUIRED); + + dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4); + dhcp_option_long(dhcp, lwip_ntohl(ip4_addr_get_u32(&dhcp->offered_ip_addr))); + + dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, LWIP_ARRAYSIZE(dhcp_discover_request_options)); + for (i = 0; i < LWIP_ARRAYSIZE(dhcp_discover_request_options); i++) { + dhcp_option_byte(dhcp, dhcp_discover_request_options[i]); + } + + dhcp_option_trailer(dhcp); + + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + /* broadcast to server */ + udp_sendto_if(dhcp_pcb, dhcp->p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot: REBOOTING\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_reboot: could not allocate DHCP request\n")); + } + if (dhcp->tries < 255) { + dhcp->tries++; + } + msecs = dhcp->tries < 10 ? dhcp->tries * 1000 : 10 * 1000; + dhcp->request_timeout = (msecs + DHCP_FINE_TIMER_MSECS - 1) / DHCP_FINE_TIMER_MSECS; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_reboot(): set request timeout %"U16_F" msecs\n", msecs)); + return result; +} + + +/** + * @ingroup dhcp4 + * Release a DHCP lease (usually called before @ref dhcp_stop). + * + * @param netif network interface which must release its lease + */ +err_t +dhcp_release(struct netif *netif) +{ + struct dhcp *dhcp = netif_dhcp_data(netif); + err_t result; + ip_addr_t server_ip_addr; + u8_t is_dhcp_supplied_address; + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release()\n")); + if (dhcp == NULL) { + return ERR_ARG; + } + ip_addr_copy(server_ip_addr, dhcp->server_ip_addr); + + is_dhcp_supplied_address = dhcp_supplied_address(netif); + + /* idle DHCP client */ + dhcp_set_state(dhcp, DHCP_STATE_OFF); + /* clean old DHCP offer */ + ip_addr_set_zero_ip4(&dhcp->server_ip_addr); + ip4_addr_set_zero(&dhcp->offered_ip_addr); + ip4_addr_set_zero(&dhcp->offered_sn_mask); + ip4_addr_set_zero(&dhcp->offered_gw_addr); +#if LWIP_DHCP_BOOTP_FILE + ip4_addr_set_zero(&dhcp->offered_si_addr); +#endif /* LWIP_DHCP_BOOTP_FILE */ + dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0; + dhcp->t1_renew_time = dhcp->t2_rebind_time = dhcp->lease_used = dhcp->t0_timeout = 0; + + if (!is_dhcp_supplied_address) { + /* don't issue release message when address is not dhcp-assigned */ + return ERR_OK; + } + + /* create and initialize the DHCP message header */ + result = dhcp_create_msg(netif, dhcp, DHCP_RELEASE); + if (result == ERR_OK) { + dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4); + dhcp_option_long(dhcp, lwip_ntohl(ip4_addr_get_u32(ip_2_ip4(&server_ip_addr)))); + + dhcp_option_trailer(dhcp); + + pbuf_realloc(dhcp->p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp->options_out_len); + + udp_sendto_if(dhcp_pcb, dhcp->p_out, &server_ip_addr, DHCP_SERVER_PORT, netif); + dhcp_delete_msg(dhcp); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_release: RELEASED, DHCP_STATE_OFF\n")); + } else { + /* sending release failed, but that's not a problem since the correct behaviour of dhcp does not rely on release */ + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("dhcp_release: could not allocate DHCP request\n")); + } + /* remove IP address from interface (prevents routing from selecting this interface) */ + netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4); + + return result; +} + +/** + * @ingroup dhcp4 + * Remove the DHCP client from the interface. + * + * @param netif The network interface to stop DHCP on + */ +void +dhcp_stop(struct netif *netif) +{ + struct dhcp *dhcp; + LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;); + dhcp = netif_dhcp_data(netif); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_stop()\n")); + /* netif is DHCP configured? */ + if (dhcp != NULL) { +#if LWIP_DHCP_AUTOIP_COOP + if (dhcp->autoip_coop_state == DHCP_AUTOIP_COOP_STATE_ON) { + autoip_stop(netif); + dhcp->autoip_coop_state = DHCP_AUTOIP_COOP_STATE_OFF; + } +#endif /* LWIP_DHCP_AUTOIP_COOP */ + + LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL); + dhcp_set_state(dhcp, DHCP_STATE_OFF); + + if (dhcp->pcb_allocated != 0) { + dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */ + dhcp->pcb_allocated = 0; + } + } +} + +/* + * Set the DHCP state of a DHCP client. + * + * If the state changed, reset the number of tries. + */ +static void +dhcp_set_state(struct dhcp *dhcp, u8_t new_state) +{ + if (new_state != dhcp->state) { + dhcp->state = new_state; + dhcp->tries = 0; + dhcp->request_timeout = 0; + } +} + +/* + * Concatenate an option type and length field to the outgoing + * DHCP message. + * + */ +static void +dhcp_option(struct dhcp *dhcp, u8_t option_type, u8_t option_len) +{ + LWIP_ASSERT("dhcp_option: dhcp->options_out_len + 2 + option_len <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U + option_len <= DHCP_OPTIONS_LEN); + dhcp->msg_out->options[dhcp->options_out_len++] = option_type; + dhcp->msg_out->options[dhcp->options_out_len++] = option_len; +} +/* + * Concatenate a single byte to the outgoing DHCP message. + * + */ +static void +dhcp_option_byte(struct dhcp *dhcp, u8_t value) +{ + LWIP_ASSERT("dhcp_option_byte: dhcp->options_out_len < DHCP_OPTIONS_LEN", dhcp->options_out_len < DHCP_OPTIONS_LEN); + dhcp->msg_out->options[dhcp->options_out_len++] = value; +} + +static void +dhcp_option_short(struct dhcp *dhcp, u16_t value) +{ + LWIP_ASSERT("dhcp_option_short: dhcp->options_out_len + 2 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 2U <= DHCP_OPTIONS_LEN); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff00U) >> 8); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t) (value & 0x00ffU); +} + +static void +dhcp_option_long(struct dhcp *dhcp, u32_t value) +{ + LWIP_ASSERT("dhcp_option_long: dhcp->options_out_len + 4 <= DHCP_OPTIONS_LEN", dhcp->options_out_len + 4U <= DHCP_OPTIONS_LEN); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0xff000000UL) >> 24); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x00ff0000UL) >> 16); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x0000ff00UL) >> 8); + dhcp->msg_out->options[dhcp->options_out_len++] = (u8_t)((value & 0x000000ffUL)); +} + +#if LWIP_NETIF_HOSTNAME +static void +dhcp_option_hostname(struct dhcp *dhcp, struct netif *netif) +{ + if (netif->hostname != NULL) { + size_t namelen = strlen(netif->hostname); + if (namelen > 0) { + size_t len; + const char *p = netif->hostname; + /* Shrink len to available bytes (need 2 bytes for OPTION_HOSTNAME + and 1 byte for trailer) */ + size_t available = DHCP_OPTIONS_LEN - dhcp->options_out_len - 3; + LWIP_ASSERT("DHCP: hostname is too long!", namelen <= available); + len = LWIP_MIN(namelen, available); + LWIP_ASSERT("DHCP: hostname is too long!", len <= 0xFF); + dhcp_option(dhcp, DHCP_OPTION_HOSTNAME, (u8_t)len); + while (len--) { + dhcp_option_byte(dhcp, *p++); + } + } + } +} +#endif /* LWIP_NETIF_HOSTNAME */ + +/** + * Extract the DHCP message and the DHCP options. + * + * Extract the DHCP message and the DHCP options, each into a contiguous + * piece of memory. As a DHCP message is variable sized by its options, + * and also allows overriding some fields for options, the easy approach + * is to first unfold the options into a contiguous piece of memory, and + * use that further on. + * + */ +static err_t +dhcp_parse_reply(struct dhcp *dhcp, struct pbuf *p) +{ + u8_t *options; + u16_t offset; + u16_t offset_max; + u16_t options_idx; + u16_t options_idx_max; + struct pbuf *q; + int parse_file_as_options = 0; + int parse_sname_as_options = 0; + + /* clear received options */ + dhcp_clear_all_options(dhcp); + /* check that beginning of dhcp_msg (up to and including chaddr) is in first pbuf */ + if (p->len < DHCP_SNAME_OFS) { + return ERR_BUF; + } + dhcp->msg_in = (struct dhcp_msg *)p->payload; +#if LWIP_DHCP_BOOTP_FILE + /* clear boot file name */ + dhcp->boot_file_name[0] = 0; +#endif /* LWIP_DHCP_BOOTP_FILE */ + + /* parse options */ + + /* start with options field */ + options_idx = DHCP_OPTIONS_OFS; + /* parse options to the end of the received packet */ + options_idx_max = p->tot_len; +again: + q = p; + while ((q != NULL) && (options_idx >= q->len)) { + options_idx -= q->len; + options_idx_max -= q->len; + q = q->next; + } + if (q == NULL) { + return ERR_BUF; + } + offset = options_idx; + offset_max = options_idx_max; + options = (u8_t*)q->payload; + /* at least 1 byte to read and no end marker, then at least 3 bytes to read? */ + while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) { + u8_t op = options[offset]; + u8_t len; + u8_t decode_len = 0; + int decode_idx = -1; + u16_t val_offset = offset + 2; + /* len byte might be in the next pbuf */ + if ((offset + 1) < q->len) { + len = options[offset + 1]; + } else { + len = (q->next != NULL ? ((u8_t*)q->next->payload)[0] : 0); + } + /* LWIP_DEBUGF(DHCP_DEBUG, ("msg_offset=%"U16_F", q->len=%"U16_F, msg_offset, q->len)); */ + decode_len = len; + switch(op) { + /* case(DHCP_OPTION_END): handled above */ + case(DHCP_OPTION_PAD): + /* special option: no len encoded */ + decode_len = len = 0; + /* will be increased below */ + offset--; + break; + case(DHCP_OPTION_SUBNET_MASK): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_SUBNET_MASK; + break; + case(DHCP_OPTION_ROUTER): + decode_len = 4; /* only copy the first given router */ + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_ROUTER; + break; +#if LWIP_DHCP_PROVIDE_DNS_SERVERS + case(DHCP_OPTION_DNS_SERVER): + /* special case: there might be more than one server */ + LWIP_ERROR("len %% 4 == 0", len % 4 == 0, return ERR_VAL;); + /* limit number of DNS servers */ + decode_len = LWIP_MIN(len, 4 * DNS_MAX_SERVERS); + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_DNS_SERVER; + break; +#endif /* LWIP_DHCP_PROVIDE_DNS_SERVERS */ + case(DHCP_OPTION_LEASE_TIME): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_LEASE_TIME; + break; +#if LWIP_DHCP_GET_NTP_SRV + case(DHCP_OPTION_NTP): + /* special case: there might be more than one server */ + LWIP_ERROR("len %% 4 == 0", len % 4 == 0, return ERR_VAL;); + /* limit number of NTP servers */ + decode_len = LWIP_MIN(len, 4 * LWIP_DHCP_MAX_NTP_SERVERS); + LWIP_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_NTP_SERVER; + break; +#endif /* LWIP_DHCP_GET_NTP_SRV*/ + case(DHCP_OPTION_OVERLOAD): + LWIP_ERROR("len == 1", len == 1, return ERR_VAL;); + /* decode overload only in options, not in file/sname: invalid packet */ + LWIP_ERROR("overload in file/sname", options_idx == DHCP_OPTIONS_OFS, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_OVERLOAD; + break; + case(DHCP_OPTION_MESSAGE_TYPE): + LWIP_ERROR("len == 1", len == 1, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_MSG_TYPE; + break; + case(DHCP_OPTION_SERVER_ID): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_SERVER_ID; + break; + case(DHCP_OPTION_T1): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_T1; + break; + case(DHCP_OPTION_T2): + LWIP_ERROR("len == 4", len == 4, return ERR_VAL;); + decode_idx = DHCP_OPTION_IDX_T2; + break; + default: + decode_len = 0; + LWIP_DEBUGF(DHCP_DEBUG, ("skipping option %"U16_F" in options\n", (u16_t)op)); + break; + } + offset += len + 2; + if (decode_len > 0) { + u32_t value = 0; + u16_t copy_len; +decode_next: + LWIP_ASSERT("check decode_idx", decode_idx >= 0 && decode_idx < DHCP_OPTION_IDX_MAX); + if (!dhcp_option_given(dhcp, decode_idx)) { + copy_len = LWIP_MIN(decode_len, 4); + if (pbuf_copy_partial(q, &value, copy_len, val_offset) != copy_len) { + return ERR_BUF; + } + if (decode_len > 4) { + /* decode more than one u32_t */ + LWIP_ERROR("decode_len %% 4 == 0", decode_len % 4 == 0, return ERR_VAL;); + dhcp_got_option(dhcp, decode_idx); + dhcp_set_option_value(dhcp, decode_idx, lwip_htonl(value)); + decode_len -= 4; + val_offset += 4; + decode_idx++; + goto decode_next; + } else if (decode_len == 4) { + value = lwip_ntohl(value); + } else { + LWIP_ERROR("invalid decode_len", decode_len == 1, return ERR_VAL;); + value = ((u8_t*)&value)[0]; + } + dhcp_got_option(dhcp, decode_idx); + dhcp_set_option_value(dhcp, decode_idx, value); + } + } + if (offset >= q->len) { + offset -= q->len; + offset_max -= q->len; + if ((offset < offset_max) && offset_max) { + q = q->next; + LWIP_ASSERT("next pbuf was null", q); + options = (u8_t*)q->payload; + } else { + /* We've run out of bytes, probably no end marker. Don't proceed. */ + break; + } + } + } + /* is this an overloaded message? */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_OVERLOAD)) { + u32_t overload = dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_OVERLOAD); + dhcp_clear_option(dhcp, DHCP_OPTION_IDX_OVERLOAD); + if (overload == DHCP_OVERLOAD_FILE) { + parse_file_as_options = 1; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded file field\n")); + } else if (overload == DHCP_OVERLOAD_SNAME) { + parse_sname_as_options = 1; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname field\n")); + } else if (overload == DHCP_OVERLOAD_SNAME_FILE) { + parse_sname_as_options = 1; + parse_file_as_options = 1; + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("overloaded sname and file field\n")); + } else { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("invalid overload option: %d\n", (int)overload)); + } +#if LWIP_DHCP_BOOTP_FILE + if (!parse_file_as_options) { + /* only do this for ACK messages */ + if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE) && + (dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE) == DHCP_ACK)) + /* copy bootp file name, don't care for sname (server hostname) */ + if (pbuf_copy_partial(p, dhcp->boot_file_name, DHCP_FILE_LEN-1, DHCP_FILE_OFS) != (DHCP_FILE_LEN-1)) { + return ERR_BUF; + } + /* make sure the string is really NULL-terminated */ + dhcp->boot_file_name[DHCP_FILE_LEN-1] = 0; + } +#endif /* LWIP_DHCP_BOOTP_FILE */ + } + if (parse_file_as_options) { + /* if both are overloaded, parse file first and then sname (RFC 2131 ch. 4.1) */ + parse_file_as_options = 0; + options_idx = DHCP_FILE_OFS; + options_idx_max = DHCP_FILE_OFS + DHCP_FILE_LEN; + goto again; + } else if (parse_sname_as_options) { + parse_sname_as_options = 0; + options_idx = DHCP_SNAME_OFS; + options_idx_max = DHCP_SNAME_OFS + DHCP_SNAME_LEN; + goto again; + } + return ERR_OK; +} + +/** + * If an incoming DHCP message is in response to us, then trigger the state machine + */ +static void +dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) +{ + struct netif *netif = ip_current_input_netif(); + struct dhcp *dhcp = netif_dhcp_data(netif); + struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload; + u8_t msg_type; + u8_t i; + + LWIP_UNUSED_ARG(arg); + + /* Caught DHCP message from netif that does not have DHCP enabled? -> not interested */ + if ((dhcp == NULL) || (dhcp->pcb_allocated == 0)) { + goto free_pbuf_and_return; + } + + LWIP_ASSERT("invalid server address type", IP_IS_V4(addr)); + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_recv(pbuf = %p) from DHCP server %"U16_F".%"U16_F".%"U16_F".%"U16_F" port %"U16_F"\n", (void*)p, + ip4_addr1_16(ip_2_ip4(addr)), ip4_addr2_16(ip_2_ip4(addr)), ip4_addr3_16(ip_2_ip4(addr)), ip4_addr4_16(ip_2_ip4(addr)), port)); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->len = %"U16_F"\n", p->len)); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->tot_len = %"U16_F"\n", p->tot_len)); + /* prevent warnings about unused arguments */ + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(addr); + LWIP_UNUSED_ARG(port); + + LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL); + + if (p->len < DHCP_MIN_REPLY_LEN) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP reply message or pbuf too short\n")); + goto free_pbuf_and_return; + } + + if (reply_msg->op != DHCP_BOOTREPLY) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("not a DHCP reply message, but type %"U16_F"\n", (u16_t)reply_msg->op)); + goto free_pbuf_and_return; + } + /* iterate through hardware address and match against DHCP message */ + for (i = 0; i < netif->hwaddr_len && i < NETIF_MAX_HWADDR_LEN && i < DHCP_CHADDR_LEN; i++) { + if (netif->hwaddr[i] != reply_msg->chaddr[i]) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("netif->hwaddr[%"U16_F"]==%02"X16_F" != reply_msg->chaddr[%"U16_F"]==%02"X16_F"\n", + (u16_t)i, (u16_t)netif->hwaddr[i], (u16_t)i, (u16_t)reply_msg->chaddr[i])); + goto free_pbuf_and_return; + } + } + /* match transaction ID against what we expected */ + if (lwip_ntohl(reply_msg->xid) != dhcp->xid) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("transaction id mismatch reply_msg->xid(%"X32_F")!=dhcp->xid(%"X32_F")\n",lwip_ntohl(reply_msg->xid),dhcp->xid)); + goto free_pbuf_and_return; + } + /* option fields could be unfold? */ + if (dhcp_parse_reply(dhcp, p) != ERR_OK) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("problem unfolding DHCP message - too short on memory?\n")); + goto free_pbuf_and_return; + } + + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("searching DHCP_OPTION_MESSAGE_TYPE\n")); + /* obtain pointer to DHCP message type */ + if (!dhcp_option_given(dhcp, DHCP_OPTION_IDX_MSG_TYPE)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("DHCP_OPTION_MESSAGE_TYPE option not found\n")); + goto free_pbuf_and_return; + } + + /* read DHCP message type */ + msg_type = (u8_t)dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_MSG_TYPE); + /* message type is DHCP ACK? */ + if (msg_type == DHCP_ACK) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_ACK received\n")); + /* in requesting state? */ + if (dhcp->state == DHCP_STATE_REQUESTING) { + dhcp_handle_ack(netif); +#if DHCP_DOES_ARP_CHECK + if ((netif->flags & NETIF_FLAG_ETHARP) != 0) { + /* check if the acknowledged lease address is already in use */ + dhcp_check(netif); + } else { + /* bind interface to the acknowledged lease address */ + dhcp_bind(netif); + } +#else + /* bind interface to the acknowledged lease address */ + dhcp_bind(netif); +#endif + } + /* already bound to the given lease address? */ + else if ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REBINDING) || + (dhcp->state == DHCP_STATE_RENEWING)) { + dhcp_handle_ack(netif); + dhcp_bind(netif); + } + } + /* received a DHCP_NAK in appropriate state? */ + else if ((msg_type == DHCP_NAK) && + ((dhcp->state == DHCP_STATE_REBOOTING) || (dhcp->state == DHCP_STATE_REQUESTING) || + (dhcp->state == DHCP_STATE_REBINDING) || (dhcp->state == DHCP_STATE_RENEWING ))) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_NAK received\n")); + dhcp_handle_nak(netif); + } + /* received a DHCP_OFFER in DHCP_STATE_SELECTING state? */ + else if ((msg_type == DHCP_OFFER) && (dhcp->state == DHCP_STATE_SELECTING)) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("DHCP_OFFER received in DHCP_STATE_SELECTING state\n")); + dhcp->request_timeout = 0; + /* remember offered lease */ + dhcp_handle_offer(netif); + } + +free_pbuf_and_return: + if (dhcp != NULL) { + dhcp->msg_in = NULL; + } + pbuf_free(p); +} + +/** + * Create a DHCP request, fill in common headers + * + * @param netif the netif under DHCP control + * @param dhcp dhcp control struct + * @param message_type message type of the request + */ +static err_t +dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type) +{ + u16_t i; +#ifndef DHCP_GLOBAL_XID + /** default global transaction identifier starting value (easy to match + * with a packet analyser). We simply increment for each new request. + * Predefine DHCP_GLOBAL_XID to a better value or a function call to generate one + * at runtime, any supporting function prototypes can be defined in DHCP_GLOBAL_XID_HEADER */ +#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND) + static u32_t xid; +#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ + static u32_t xid = 0xABCD0000; +#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ +#else + if (!xid_initialised) { + xid = DHCP_GLOBAL_XID; + xid_initialised = !xid_initialised; + } +#endif + LWIP_ERROR("dhcp_create_msg: netif != NULL", (netif != NULL), return ERR_ARG;); + LWIP_ERROR("dhcp_create_msg: dhcp != NULL", (dhcp != NULL), return ERR_VAL;); + LWIP_ASSERT("dhcp_create_msg: dhcp->p_out == NULL", dhcp->p_out == NULL); + LWIP_ASSERT("dhcp_create_msg: dhcp->msg_out == NULL", dhcp->msg_out == NULL); + dhcp->p_out = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcp_msg), PBUF_RAM); + if (dhcp->p_out == NULL) { + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("dhcp_create_msg(): could not allocate pbuf\n")); + return ERR_MEM; + } + LWIP_ASSERT("dhcp_create_msg: check that first pbuf can hold struct dhcp_msg", + (dhcp->p_out->len >= sizeof(struct dhcp_msg))); + + /* DHCP_REQUEST should reuse 'xid' from DHCPOFFER */ + if (message_type != DHCP_REQUEST) { + /* reuse transaction identifier in retransmissions */ + if (dhcp->tries == 0) { +#if DHCP_CREATE_RAND_XID && defined(LWIP_RAND) + xid = LWIP_RAND(); +#else /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ + xid++; +#endif /* DHCP_CREATE_RAND_XID && defined(LWIP_RAND) */ + } + dhcp->xid = xid; + } + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, + ("transaction id xid(%"X32_F")\n", xid)); + + dhcp->msg_out = (struct dhcp_msg *)dhcp->p_out->payload; + + dhcp->msg_out->op = DHCP_BOOTREQUEST; + /* @todo: make link layer independent */ + dhcp->msg_out->htype = DHCP_HTYPE_ETH; + dhcp->msg_out->hlen = netif->hwaddr_len; + dhcp->msg_out->hops = 0; + dhcp->msg_out->xid = lwip_htonl(dhcp->xid); + dhcp->msg_out->secs = 0; + /* we don't need the broadcast flag since we can receive unicast traffic + before being fully configured! */ + dhcp->msg_out->flags = 0; + ip4_addr_set_zero(&dhcp->msg_out->ciaddr); + /* set ciaddr to netif->ip_addr based on message_type and state */ + if ((message_type == DHCP_INFORM) || (message_type == DHCP_DECLINE) || (message_type == DHCP_RELEASE) || + ((message_type == DHCP_REQUEST) && /* DHCP_STATE_BOUND not used for sending! */ + ((dhcp->state== DHCP_STATE_RENEWING) || dhcp->state== DHCP_STATE_REBINDING))) { + ip4_addr_copy(dhcp->msg_out->ciaddr, *netif_ip4_addr(netif)); + } + ip4_addr_set_zero(&dhcp->msg_out->yiaddr); + ip4_addr_set_zero(&dhcp->msg_out->siaddr); + ip4_addr_set_zero(&dhcp->msg_out->giaddr); + for (i = 0; i < DHCP_CHADDR_LEN; i++) { + /* copy netif hardware address, pad with zeroes */ + dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len && i < NETIF_MAX_HWADDR_LEN) ? netif->hwaddr[i] : 0/* pad byte*/; + } + for (i = 0; i < DHCP_SNAME_LEN; i++) { + dhcp->msg_out->sname[i] = 0; + } + for (i = 0; i < DHCP_FILE_LEN; i++) { + dhcp->msg_out->file[i] = 0; + } + dhcp->msg_out->cookie = PP_HTONL(DHCP_MAGIC_COOKIE); + dhcp->options_out_len = 0; + /* fill options field with an incrementing array (for debugging purposes) */ + for (i = 0; i < DHCP_OPTIONS_LEN; i++) { + dhcp->msg_out->options[i] = (u8_t)i; /* for debugging only, no matter if truncated */ + } + /* Add option MESSAGE_TYPE */ + dhcp_option(dhcp, DHCP_OPTION_MESSAGE_TYPE, DHCP_OPTION_MESSAGE_TYPE_LEN); + dhcp_option_byte(dhcp, message_type); + return ERR_OK; +} + +/** + * Free previously allocated memory used to send a DHCP request. + * + * @param dhcp the dhcp struct to free the request from + */ +static void +dhcp_delete_msg(struct dhcp *dhcp) +{ + LWIP_ERROR("dhcp_delete_msg: dhcp != NULL", (dhcp != NULL), return;); + LWIP_ASSERT("dhcp_delete_msg: dhcp->p_out != NULL", dhcp->p_out != NULL); + LWIP_ASSERT("dhcp_delete_msg: dhcp->msg_out != NULL", dhcp->msg_out != NULL); + if (dhcp->p_out != NULL) { + pbuf_free(dhcp->p_out); + } + dhcp->p_out = NULL; + dhcp->msg_out = NULL; +} + +/** + * Add a DHCP message trailer + * + * Adds the END option to the DHCP message, and if + * necessary, up to three padding bytes. + * + * @param dhcp DHCP state structure + */ +static void +dhcp_option_trailer(struct dhcp *dhcp) +{ + LWIP_ERROR("dhcp_option_trailer: dhcp != NULL", (dhcp != NULL), return;); + LWIP_ASSERT("dhcp_option_trailer: dhcp->msg_out != NULL\n", dhcp->msg_out != NULL); + LWIP_ASSERT("dhcp_option_trailer: dhcp->options_out_len < DHCP_OPTIONS_LEN\n", dhcp->options_out_len < DHCP_OPTIONS_LEN); + dhcp->msg_out->options[dhcp->options_out_len++] = DHCP_OPTION_END; + /* packet is too small, or not 4 byte aligned? */ + while (((dhcp->options_out_len < DHCP_MIN_OPTIONS_LEN) || (dhcp->options_out_len & 3)) && + (dhcp->options_out_len < DHCP_OPTIONS_LEN)) { + /* add a fill/padding byte */ + dhcp->msg_out->options[dhcp->options_out_len++] = 0; + } +} + +/** check if DHCP supplied netif->ip_addr + * + * @param netif the netif to check + * @return 1 if DHCP supplied netif->ip_addr (states BOUND or RENEWING), + * 0 otherwise + */ +u8_t +dhcp_supplied_address(const struct netif *netif) +{ + if ((netif != NULL) && (netif_dhcp_data(netif) != NULL)) { + struct dhcp* dhcp = netif_dhcp_data(netif); + return (dhcp->state == DHCP_STATE_BOUND) || (dhcp->state == DHCP_STATE_RENEWING); + } + return 0; +} + +#endif /* LWIP_IPV4 && LWIP_DHCP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/etharp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/etharp.c new file mode 100644 index 0000000..3f48a99 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/etharp.c @@ -0,0 +1,1206 @@ +/** + * @file + * Address Resolution Protocol module for IP over Ethernet + * + * Functionally, ARP is divided into two parts. The first maps an IP address + * to a physical address when sending a packet, and the second part answers + * requests from other machines for our physical address. + * + * This implementation complies with RFC 826 (Ethernet ARP). It supports + * Gratuitious ARP from RFC3220 (IP Mobility Support for IPv4) section 4.6 + * if an interface calls etharp_gratuitous(our_netif) upon address change. + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2003-2004 Leon Woestenberg + * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/opt.h" + +#if LWIP_ARP || LWIP_ETHERNET + +#include "lwip/etharp.h" +#include "lwip/stats.h" +#include "lwip/snmp.h" +#include "lwip/dhcp.h" +#include "lwip/autoip.h" +#include "netif/ethernet.h" + +#include + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ + +/** Re-request a used ARP entry 1 minute before it would expire to prevent + * breaking a steadily used connection because the ARP entry timed out. */ +#define ARP_AGE_REREQUEST_USED_UNICAST (ARP_MAXAGE - 30) +#define ARP_AGE_REREQUEST_USED_BROADCAST (ARP_MAXAGE - 15) + +/** the time an ARP entry stays pending after first request, + * for ARP_TMR_INTERVAL = 1000, this is + * 10 seconds. + * + * @internal Keep this number at least 2, otherwise it might + * run out instantly if the timeout occurs directly after a request. + */ +#define ARP_MAXPENDING 5 + +/** ARP states */ +enum etharp_state { + ETHARP_STATE_EMPTY = 0, + ETHARP_STATE_PENDING, + ETHARP_STATE_STABLE, + ETHARP_STATE_STABLE_REREQUESTING_1, + ETHARP_STATE_STABLE_REREQUESTING_2 +#if ETHARP_SUPPORT_STATIC_ENTRIES + ,ETHARP_STATE_STATIC +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ +}; + +struct etharp_entry { +#if ARP_QUEUEING + /** Pointer to queue of pending outgoing packets on this ARP entry. */ + struct etharp_q_entry *q; +#else /* ARP_QUEUEING */ + /** Pointer to a single pending outgoing packet on this ARP entry. */ + struct pbuf *q; +#endif /* ARP_QUEUEING */ + ip4_addr_t ipaddr; + struct netif *netif; + struct eth_addr ethaddr; + u16_t ctime; + u8_t state; +}; + +static struct etharp_entry arp_table[ARP_TABLE_SIZE]; + +#if !LWIP_NETIF_HWADDRHINT +static u8_t etharp_cached_entry; +#endif /* !LWIP_NETIF_HWADDRHINT */ + +/** Try hard to create a new entry - we want the IP address to appear in + the cache (even if this means removing an active entry or so). */ +#define ETHARP_FLAG_TRY_HARD 1 +#define ETHARP_FLAG_FIND_ONLY 2 +#if ETHARP_SUPPORT_STATIC_ENTRIES +#define ETHARP_FLAG_STATIC_ENTRY 4 +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + +#if LWIP_NETIF_HWADDRHINT +#define ETHARP_SET_HINT(netif, hint) if (((netif) != NULL) && ((netif)->addr_hint != NULL)) \ + *((netif)->addr_hint) = (hint); +#else /* LWIP_NETIF_HWADDRHINT */ +#define ETHARP_SET_HINT(netif, hint) (etharp_cached_entry = (hint)) +#endif /* LWIP_NETIF_HWADDRHINT */ + + +/* Some checks, instead of etharp_init(): */ +#if (LWIP_ARP && (ARP_TABLE_SIZE > 0x7f)) + #error "ARP_TABLE_SIZE must fit in an s8_t, you have to reduce it in your lwipopts.h" +#endif + + +static err_t etharp_request_dst(struct netif *netif, const ip4_addr_t *ipaddr, const struct eth_addr* hw_dst_addr); +static err_t etharp_raw(struct netif *netif, + const struct eth_addr *ethsrc_addr, const struct eth_addr *ethdst_addr, + const struct eth_addr *hwsrc_addr, const ip4_addr_t *ipsrc_addr, + const struct eth_addr *hwdst_addr, const ip4_addr_t *ipdst_addr, + const u16_t opcode); + +#if ARP_QUEUEING +/** + * Free a complete queue of etharp entries + * + * @param q a qeueue of etharp_q_entry's to free + */ +static void +free_etharp_q(struct etharp_q_entry *q) +{ + struct etharp_q_entry *r; + LWIP_ASSERT("q != NULL", q != NULL); + LWIP_ASSERT("q->p != NULL", q->p != NULL); + while (q) { + r = q; + q = q->next; + LWIP_ASSERT("r->p != NULL", (r->p != NULL)); + pbuf_free(r->p); + memp_free(MEMP_ARP_QUEUE, r); + } +} +#else /* ARP_QUEUEING */ + +/** Compatibility define: free the queued pbuf */ +#define free_etharp_q(q) pbuf_free(q) + +#endif /* ARP_QUEUEING */ + +/** Clean up ARP table entries */ +static void +etharp_free_entry(int i) +{ + /* remove from SNMP ARP index tree */ + mib2_remove_arp_entry(arp_table[i].netif, &arp_table[i].ipaddr); + /* and empty packet queue */ + if (arp_table[i].q != NULL) { + /* remove all queued packets */ + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_free_entry: freeing entry %"U16_F", packet queue %p.\n", (u16_t)i, (void *)(arp_table[i].q))); + free_etharp_q(arp_table[i].q); + arp_table[i].q = NULL; + } + /* recycle entry for re-use */ + arp_table[i].state = ETHARP_STATE_EMPTY; +#ifdef LWIP_DEBUG + /* for debugging, clean out the complete entry */ + arp_table[i].ctime = 0; + arp_table[i].netif = NULL; + ip4_addr_set_zero(&arp_table[i].ipaddr); + arp_table[i].ethaddr = ethzero; +#endif /* LWIP_DEBUG */ +} + +/** + * Clears expired entries in the ARP table. + * + * This function should be called every ARP_TMR_INTERVAL milliseconds (1 second), + * in order to expire entries in the ARP table. + */ +void +etharp_tmr(void) +{ + u8_t i; + + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer\n")); + /* remove expired entries from the ARP table */ + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + u8_t state = arp_table[i].state; + if (state != ETHARP_STATE_EMPTY +#if ETHARP_SUPPORT_STATIC_ENTRIES + && (state != ETHARP_STATE_STATIC) +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + ) { + arp_table[i].ctime++; + if ((arp_table[i].ctime >= ARP_MAXAGE) || + ((arp_table[i].state == ETHARP_STATE_PENDING) && + (arp_table[i].ctime >= ARP_MAXPENDING))) { + /* pending or stable entry has become old! */ + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_timer: expired %s entry %"U16_F".\n", + arp_table[i].state >= ETHARP_STATE_STABLE ? "stable" : "pending", (u16_t)i)); + /* clean up entries that have just been expired */ + etharp_free_entry(i); + } else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING_1) { + /* Don't send more than one request every 2 seconds. */ + arp_table[i].state = ETHARP_STATE_STABLE_REREQUESTING_2; + } else if (arp_table[i].state == ETHARP_STATE_STABLE_REREQUESTING_2) { + /* Reset state to stable, so that the next transmitted packet will + re-send an ARP request. */ + arp_table[i].state = ETHARP_STATE_STABLE; + } else if (arp_table[i].state == ETHARP_STATE_PENDING) { + /* still pending, resend an ARP query */ + etharp_request(arp_table[i].netif, &arp_table[i].ipaddr); + } + } + } +} + +/** + * Search the ARP table for a matching or new entry. + * + * If an IP address is given, return a pending or stable ARP entry that matches + * the address. If no match is found, create a new entry with this address set, + * but in state ETHARP_EMPTY. The caller must check and possibly change the + * state of the returned entry. + * + * If ipaddr is NULL, return a initialized new entry in state ETHARP_EMPTY. + * + * In all cases, attempt to create new entries from an empty entry. If no + * empty entries are available and ETHARP_FLAG_TRY_HARD flag is set, recycle + * old entries. Heuristic choose the least important entry for recycling. + * + * @param ipaddr IP address to find in ARP cache, or to add if not found. + * @param flags See @ref etharp_state + * @param netif netif related to this address (used for NETIF_HWADDRHINT) + * + * @return The ARP entry index that matched or is created, ERR_MEM if no + * entry is found or could be recycled. + */ +static s8_t +etharp_find_entry(const ip4_addr_t *ipaddr, u8_t flags, struct netif* netif) +{ + s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE; + s8_t empty = ARP_TABLE_SIZE; + u8_t i = 0; + /* oldest entry with packets on queue */ + s8_t old_queue = ARP_TABLE_SIZE; + /* its age */ + u16_t age_queue = 0, age_pending = 0, age_stable = 0; + + LWIP_UNUSED_ARG(netif); + + /** + * a) do a search through the cache, remember candidates + * b) select candidate entry + * c) create new entry + */ + + /* a) in a single search sweep, do all of this + * 1) remember the first empty entry (if any) + * 2) remember the oldest stable entry (if any) + * 3) remember the oldest pending entry without queued packets (if any) + * 4) remember the oldest pending entry with queued packets (if any) + * 5) search for a matching IP entry, either pending or stable + * until 5 matches, or all entries are searched for. + */ + + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + u8_t state = arp_table[i].state; + /* no empty entry found yet and now we do find one? */ + if ((empty == ARP_TABLE_SIZE) && (state == ETHARP_STATE_EMPTY)) { + LWIP_DEBUGF(ETHARP_DEBUG, ("etharp_find_entry: found empty entry %"U16_F"\n", (u16_t)i)); + /* remember first empty entry */ + empty = i; + } else if (state != ETHARP_STATE_EMPTY) { + LWIP_ASSERT("state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE", + state == ETHARP_STATE_PENDING || state >= ETHARP_STATE_STABLE); + /* if given, does IP address match IP address in ARP entry? */ + if (ipaddr && ip4_addr_cmp(ipaddr, &arp_table[i].ipaddr) +#if ETHARP_TABLE_MATCH_NETIF + && ((netif == NULL) || (netif == arp_table[i].netif)) +#endif /* ETHARP_TABLE_MATCH_NETIF */ + ) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: found matching entry %"U16_F"\n", (u16_t)i)); + /* found exact IP address match, simply bail out */ + return i; + } + /* pending entry? */ + if (state == ETHARP_STATE_PENDING) { + /* pending with queued packets? */ + if (arp_table[i].q != NULL) { + if (arp_table[i].ctime >= age_queue) { + old_queue = i; + age_queue = arp_table[i].ctime; + } + } else + /* pending without queued packets? */ + { + if (arp_table[i].ctime >= age_pending) { + old_pending = i; + age_pending = arp_table[i].ctime; + } + } + /* stable entry? */ + } else if (state >= ETHARP_STATE_STABLE) { +#if ETHARP_SUPPORT_STATIC_ENTRIES + /* don't record old_stable for static entries since they never expire */ + if (state < ETHARP_STATE_STATIC) +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + { + /* remember entry with oldest stable entry in oldest, its age in maxtime */ + if (arp_table[i].ctime >= age_stable) { + old_stable = i; + age_stable = arp_table[i].ctime; + } + } + } + } + } + /* { we have no match } => try to create a new entry */ + + /* don't create new entry, only search? */ + if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) || + /* or no empty entry found and not allowed to recycle? */ + ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_FLAG_TRY_HARD) == 0))) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n")); + return (s8_t)ERR_MEM; + } + + /* b) choose the least destructive entry to recycle: + * 1) empty entry + * 2) oldest stable entry + * 3) oldest pending entry without queued packets + * 4) oldest pending entry with queued packets + * + * { ETHARP_FLAG_TRY_HARD is set at this point } + */ + + /* 1) empty entry available? */ + if (empty < ARP_TABLE_SIZE) { + i = empty; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting empty entry %"U16_F"\n", (u16_t)i)); + } else { + /* 2) found recyclable stable entry? */ + if (old_stable < ARP_TABLE_SIZE) { + /* recycle oldest stable*/ + i = old_stable; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest stable entry %"U16_F"\n", (u16_t)i)); + /* no queued packets should exist on stable entries */ + LWIP_ASSERT("arp_table[i].q == NULL", arp_table[i].q == NULL); + /* 3) found recyclable pending entry without queued packets? */ + } else if (old_pending < ARP_TABLE_SIZE) { + /* recycle oldest pending */ + i = old_pending; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %"U16_F" (without queue)\n", (u16_t)i)); + /* 4) found recyclable pending entry with queued packets? */ + } else if (old_queue < ARP_TABLE_SIZE) { + /* recycle oldest pending (queued packets are free in etharp_free_entry) */ + i = old_queue; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: selecting oldest pending entry %"U16_F", freeing packet queue %p\n", (u16_t)i, (void *)(arp_table[i].q))); + /* no empty or recyclable entries found */ + } else { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty or recyclable entries found\n")); + return (s8_t)ERR_MEM; + } + + /* { empty or recyclable entry found } */ + LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE); + etharp_free_entry(i); + } + + LWIP_ASSERT("i < ARP_TABLE_SIZE", i < ARP_TABLE_SIZE); + LWIP_ASSERT("arp_table[i].state == ETHARP_STATE_EMPTY", + arp_table[i].state == ETHARP_STATE_EMPTY); + + /* IP address given? */ + if (ipaddr != NULL) { + /* set IP address */ + ip4_addr_copy(arp_table[i].ipaddr, *ipaddr); + } + arp_table[i].ctime = 0; +#if ETHARP_TABLE_MATCH_NETIF + arp_table[i].netif = netif; +#endif /* ETHARP_TABLE_MATCH_NETIF*/ + return (err_t)i; +} + +/** + * Update (or insert) a IP/MAC address pair in the ARP cache. + * + * If a pending entry is resolved, any queued packets will be sent + * at this point. + * + * @param netif netif related to this entry (used for NETIF_ADDRHINT) + * @param ipaddr IP address of the inserted ARP entry. + * @param ethaddr Ethernet address of the inserted ARP entry. + * @param flags See @ref etharp_state + * + * @return + * - ERR_OK Successfully updated ARP cache. + * - ERR_MEM If we could not add a new ARP entry when ETHARP_FLAG_TRY_HARD was set. + * - ERR_ARG Non-unicast address given, those will not appear in ARP cache. + * + * @see pbuf_free() + */ +static err_t +etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags) +{ + s8_t i; + LWIP_ASSERT("netif->hwaddr_len == ETH_HWADDR_LEN", netif->hwaddr_len == ETH_HWADDR_LEN); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n", + ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr), + (u16_t)ethaddr->addr[0], (u16_t)ethaddr->addr[1], (u16_t)ethaddr->addr[2], + (u16_t)ethaddr->addr[3], (u16_t)ethaddr->addr[4], (u16_t)ethaddr->addr[5])); + /* non-unicast address? */ + if (ip4_addr_isany(ipaddr) || + ip4_addr_isbroadcast(ipaddr, netif) || + ip4_addr_ismulticast(ipaddr)) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: will not add non-unicast IP address to ARP cache\n")); + return ERR_ARG; + } + /* find or create ARP entry */ + i = etharp_find_entry(ipaddr, flags, netif); + /* bail out if no entry could be found */ + if (i < 0) { + return (err_t)i; + } + +#if ETHARP_SUPPORT_STATIC_ENTRIES + if (flags & ETHARP_FLAG_STATIC_ENTRY) { + /* record static type */ + arp_table[i].state = ETHARP_STATE_STATIC; + } else if (arp_table[i].state == ETHARP_STATE_STATIC) { + /* found entry is a static type, don't overwrite it */ + return ERR_VAL; + } else +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + { + /* mark it stable */ + arp_table[i].state = ETHARP_STATE_STABLE; + } + + /* record network interface */ + arp_table[i].netif = netif; + /* insert in SNMP ARP index tree */ + mib2_add_arp_entry(netif, &arp_table[i].ipaddr); + + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_update_arp_entry: updating stable entry %"S16_F"\n", (s16_t)i)); + /* update address */ + ETHADDR32_COPY(&arp_table[i].ethaddr, ethaddr); + /* reset time stamp */ + arp_table[i].ctime = 0; + /* this is where we will send out queued packets! */ +#if ARP_QUEUEING + while (arp_table[i].q != NULL) { + struct pbuf *p; + /* remember remainder of queue */ + struct etharp_q_entry *q = arp_table[i].q; + /* pop first item off the queue */ + arp_table[i].q = q->next; + /* get the packet pointer */ + p = q->p; + /* now queue entry can be freed */ + memp_free(MEMP_ARP_QUEUE, q); +#else /* ARP_QUEUEING */ + if (arp_table[i].q != NULL) { + struct pbuf *p = arp_table[i].q; + arp_table[i].q = NULL; +#endif /* ARP_QUEUEING */ + /* send the queued IP packet */ + ethernet_output(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr, ETHTYPE_IP); + /* free the queued IP packet */ + pbuf_free(p); + } + return ERR_OK; +} + +#if ETHARP_SUPPORT_STATIC_ENTRIES +/** Add a new static entry to the ARP table. If an entry exists for the + * specified IP address, this entry is overwritten. + * If packets are queued for the specified IP address, they are sent out. + * + * @param ipaddr IP address for the new static entry + * @param ethaddr ethernet address for the new static entry + * @return See return values of etharp_add_static_entry + */ +err_t +etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr) +{ + struct netif *netif; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_add_static_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n", + ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr), + (u16_t)ethaddr->addr[0], (u16_t)ethaddr->addr[1], (u16_t)ethaddr->addr[2], + (u16_t)ethaddr->addr[3], (u16_t)ethaddr->addr[4], (u16_t)ethaddr->addr[5])); + + netif = ip4_route(ipaddr); + if (netif == NULL) { + return ERR_RTE; + } + + return etharp_update_arp_entry(netif, ipaddr, ethaddr, ETHARP_FLAG_TRY_HARD | ETHARP_FLAG_STATIC_ENTRY); +} + +/** Remove a static entry from the ARP table previously added with a call to + * etharp_add_static_entry. + * + * @param ipaddr IP address of the static entry to remove + * @return ERR_OK: entry removed + * ERR_MEM: entry wasn't found + * ERR_ARG: entry wasn't a static entry but a dynamic one + */ +err_t +etharp_remove_static_entry(const ip4_addr_t *ipaddr) +{ + s8_t i; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_remove_static_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), ip4_addr3_16(ipaddr), ip4_addr4_16(ipaddr))); + + /* find or create ARP entry */ + i = etharp_find_entry(ipaddr, ETHARP_FLAG_FIND_ONLY, NULL); + /* bail out if no entry could be found */ + if (i < 0) { + return (err_t)i; + } + + if (arp_table[i].state != ETHARP_STATE_STATIC) { + /* entry wasn't a static entry, cannot remove it */ + return ERR_ARG; + } + /* entry found, free it */ + etharp_free_entry(i); + return ERR_OK; +} +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + +/** + * Remove all ARP table entries of the specified netif. + * + * @param netif points to a network interface + */ +void +etharp_cleanup_netif(struct netif *netif) +{ + u8_t i; + + for (i = 0; i < ARP_TABLE_SIZE; ++i) { + u8_t state = arp_table[i].state; + if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) { + etharp_free_entry(i); + } + } +} + +/** + * Finds (stable) ethernet/IP address pair from ARP table + * using interface and IP address index. + * @note the addresses in the ARP table are in network order! + * + * @param netif points to interface index + * @param ipaddr points to the (network order) IP address index + * @param eth_ret points to return pointer + * @param ip_ret points to return pointer + * @return table index if found, -1 otherwise + */ +s8_t +etharp_find_addr(struct netif *netif, const ip4_addr_t *ipaddr, + struct eth_addr **eth_ret, const ip4_addr_t **ip_ret) +{ + s8_t i; + + LWIP_ASSERT("eth_ret != NULL && ip_ret != NULL", + eth_ret != NULL && ip_ret != NULL); + + LWIP_UNUSED_ARG(netif); + + i = etharp_find_entry(ipaddr, ETHARP_FLAG_FIND_ONLY, netif); + if ((i >= 0) && (arp_table[i].state >= ETHARP_STATE_STABLE)) { + *eth_ret = &arp_table[i].ethaddr; + *ip_ret = &arp_table[i].ipaddr; + return i; + } + return -1; +} + +/** + * Possibility to iterate over stable ARP table entries + * + * @param i entry number, 0 to ARP_TABLE_SIZE + * @param ipaddr return value: IP address + * @param netif return value: points to interface + * @param eth_ret return value: ETH address + * @return 1 on valid index, 0 otherwise + */ +u8_t +etharp_get_entry(u8_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret) +{ + LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL); + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("eth_ret != NULL", eth_ret != NULL); + + if((i < ARP_TABLE_SIZE) && (arp_table[i].state >= ETHARP_STATE_STABLE)) { + *ipaddr = &arp_table[i].ipaddr; + *netif = arp_table[i].netif; + *eth_ret = &arp_table[i].ethaddr; + return 1; + } else { + return 0; + } +} + +/** + * Responds to ARP requests to us. Upon ARP replies to us, add entry to cache + * send out queued IP packets. Updates cache with snooped address pairs. + * + * Should be called for incoming ARP packets. The pbuf in the argument + * is freed by this function. + * + * @param p The ARP packet that arrived on netif. Is freed by this function. + * @param netif The lwIP network interface on which the ARP packet pbuf arrived. + * + * @see pbuf_free() + */ +void +etharp_input(struct pbuf *p, struct netif *netif) +{ + struct etharp_hdr *hdr; + /* these are aligned properly, whereas the ARP header fields might not be */ + ip4_addr_t sipaddr, dipaddr; + u8_t for_us; + + LWIP_ERROR("netif != NULL", (netif != NULL), return;); + + hdr = (struct etharp_hdr *)p->payload; + + /* RFC 826 "Packet Reception": */ + if ((hdr->hwtype != PP_HTONS(HWTYPE_ETHERNET)) || + (hdr->hwlen != ETH_HWADDR_LEN) || + (hdr->protolen != sizeof(ip4_addr_t)) || + (hdr->proto != PP_HTONS(ETHTYPE_IP))) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("etharp_input: packet dropped, wrong hw type, hwlen, proto, protolen or ethernet type (%"U16_F"/%"U16_F"/%"U16_F"/%"U16_F")\n", + hdr->hwtype, (u16_t)hdr->hwlen, hdr->proto, (u16_t)hdr->protolen)); + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + pbuf_free(p); + return; + } + ETHARP_STATS_INC(etharp.recv); + +#if LWIP_AUTOIP + /* We have to check if a host already has configured our random + * created link local address and continuously check if there is + * a host with this IP-address so we can detect collisions */ + autoip_arp_reply(netif, hdr); +#endif /* LWIP_AUTOIP */ + + /* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without + * structure packing (not using structure copy which breaks strict-aliasing rules). */ + IPADDR2_COPY(&sipaddr, &hdr->sipaddr); + IPADDR2_COPY(&dipaddr, &hdr->dipaddr); + + /* this interface is not configured? */ + if (ip4_addr_isany_val(*netif_ip4_addr(netif))) { + for_us = 0; + } else { + /* ARP packet directed to us? */ + for_us = (u8_t)ip4_addr_cmp(&dipaddr, netif_ip4_addr(netif)); + } + + /* ARP message directed to us? + -> add IP address in ARP cache; assume requester wants to talk to us, + can result in directly sending the queued packets for this host. + ARP message not directed to us? + -> update the source IP address in the cache, if present */ + etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr), + for_us ? ETHARP_FLAG_TRY_HARD : ETHARP_FLAG_FIND_ONLY); + + /* now act on the message itself */ + switch (hdr->opcode) { + /* ARP request? */ + case PP_HTONS(ARP_REQUEST): + /* ARP request. If it asked for our address, we send out a + * reply. In any case, we time-stamp any existing ARP entry, + * and possibly send out an IP packet that was queued on it. */ + + LWIP_DEBUGF (ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: incoming ARP request\n")); + /* ARP request for our address? */ + if (for_us) { + /* send ARP response */ + etharp_raw(netif, + (struct eth_addr *)netif->hwaddr, &hdr->shwaddr, + (struct eth_addr *)netif->hwaddr, netif_ip4_addr(netif), + &hdr->shwaddr, &sipaddr, + ARP_REPLY); + /* we are not configured? */ + } else if (ip4_addr_isany_val(*netif_ip4_addr(netif))) { + /* { for_us == 0 and netif->ip_addr.addr == 0 } */ + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: we are unconfigured, ARP request ignored.\n")); + /* request was not directed to us */ + } else { + /* { for_us == 0 and netif->ip_addr.addr != 0 } */ + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: ARP request was not for us.\n")); + } + break; + case PP_HTONS(ARP_REPLY): + /* ARP reply. We already updated the ARP cache earlier. */ + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: incoming ARP reply\n")); +#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK) + /* DHCP wants to know about ARP replies from any host with an + * IP address also offered to us by the DHCP server. We do not + * want to take a duplicate IP address on a single network. + * @todo How should we handle redundant (fail-over) interfaces? */ + dhcp_arp_reply(netif, &sipaddr); +#endif /* (LWIP_DHCP && DHCP_DOES_ARP_CHECK) */ + break; + default: + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_input: ARP unknown opcode type %"S16_F"\n", lwip_htons(hdr->opcode))); + ETHARP_STATS_INC(etharp.err); + break; + } + /* free ARP packet */ + pbuf_free(p); +} + +/** Just a small helper function that sends a pbuf to an ethernet address + * in the arp_table specified by the index 'arp_idx'. + */ +static err_t +etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx) +{ + LWIP_ASSERT("arp_table[arp_idx].state >= ETHARP_STATE_STABLE", + arp_table[arp_idx].state >= ETHARP_STATE_STABLE); + /* if arp table entry is about to expire: re-request it, + but only if its state is ETHARP_STATE_STABLE to prevent flooding the + network with ARP requests if this address is used frequently. */ + if (arp_table[arp_idx].state == ETHARP_STATE_STABLE) { + if (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED_BROADCAST) { + /* issue a standard request using broadcast */ + if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) { + arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING_1; + } + } else if (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED_UNICAST) { + /* issue a unicast request (for 15 seconds) to prevent unnecessary broadcast */ + if (etharp_request_dst(netif, &arp_table[arp_idx].ipaddr, &arp_table[arp_idx].ethaddr) == ERR_OK) { + arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING_1; + } + } + } + + return ethernet_output(netif, q, (struct eth_addr*)(netif->hwaddr), &arp_table[arp_idx].ethaddr, ETHTYPE_IP); +} + +/** + * Resolve and fill-in Ethernet address header for outgoing IP packet. + * + * For IP multicast and broadcast, corresponding Ethernet addresses + * are selected and the packet is transmitted on the link. + * + * For unicast addresses, the packet is submitted to etharp_query(). In + * case the IP address is outside the local network, the IP address of + * the gateway is used. + * + * @param netif The lwIP network interface which the IP packet will be sent on. + * @param q The pbuf(s) containing the IP packet to be sent. + * @param ipaddr The IP address of the packet destination. + * + * @return + * - ERR_RTE No route to destination (no gateway to external networks), + * or the return type of either etharp_query() or ethernet_output(). + */ +err_t +etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) +{ + const struct eth_addr *dest; + struct eth_addr mcastaddr; + const ip4_addr_t *dst_addr = ipaddr; + + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("q != NULL", q != NULL); + LWIP_ASSERT("ipaddr != NULL", ipaddr != NULL); + + /* Determine on destination hardware address. Broadcasts and multicasts + * are special, other IP addresses are looked up in the ARP table. */ + + /* broadcast destination IP address? */ + if (ip4_addr_isbroadcast(ipaddr, netif)) { + /* broadcast on Ethernet also */ + dest = (const struct eth_addr *)ðbroadcast; + /* multicast destination IP address? */ + } else if (ip4_addr_ismulticast(ipaddr)) { + /* Hash IP multicast address to MAC address.*/ + mcastaddr.addr[0] = LL_IP4_MULTICAST_ADDR_0; + mcastaddr.addr[1] = LL_IP4_MULTICAST_ADDR_1; + mcastaddr.addr[2] = LL_IP4_MULTICAST_ADDR_2; + mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f; + mcastaddr.addr[4] = ip4_addr3(ipaddr); + mcastaddr.addr[5] = ip4_addr4(ipaddr); + /* destination Ethernet address is multicast */ + dest = &mcastaddr; + /* unicast destination IP address? */ + } else { + s8_t i; + /* outside local network? if so, this can neither be a global broadcast nor + a subnet broadcast. */ + if (!ip4_addr_netcmp(ipaddr, netif_ip4_addr(netif), netif_ip4_netmask(netif)) && + !ip4_addr_islinklocal(ipaddr)) { +#if LWIP_AUTOIP + struct ip_hdr *iphdr = LWIP_ALIGNMENT_CAST(struct ip_hdr*, q->payload); + /* According to RFC 3297, chapter 2.6.2 (Forwarding Rules), a packet with + a link-local source address must always be "directly to its destination + on the same physical link. The host MUST NOT send the packet to any + router for forwarding". */ + if (!ip4_addr_islinklocal(&iphdr->src)) +#endif /* LWIP_AUTOIP */ + { +#ifdef LWIP_HOOK_ETHARP_GET_GW + /* For advanced routing, a single default gateway might not be enough, so get + the IP address of the gateway to handle the current destination address. */ + dst_addr = LWIP_HOOK_ETHARP_GET_GW(netif, ipaddr); + if (dst_addr == NULL) +#endif /* LWIP_HOOK_ETHARP_GET_GW */ + { + /* interface has default gateway? */ + if (!ip4_addr_isany_val(*netif_ip4_gw(netif))) { + /* send to hardware address of default gateway IP address */ + dst_addr = netif_ip4_gw(netif); + /* no default gateway available */ + } else { + /* no route to destination error (default gateway missing) */ + return ERR_RTE; + } + } + } + } +#if LWIP_NETIF_HWADDRHINT + if (netif->addr_hint != NULL) { + /* per-pcb cached entry was given */ + u8_t etharp_cached_entry = *(netif->addr_hint); + if (etharp_cached_entry < ARP_TABLE_SIZE) { +#endif /* LWIP_NETIF_HWADDRHINT */ + if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) && +#if ETHARP_TABLE_MATCH_NETIF + (arp_table[etharp_cached_entry].netif == netif) && +#endif + (ip4_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) { + /* the per-pcb-cached entry is stable and the right one! */ + ETHARP_STATS_INC(etharp.cachehit); + return etharp_output_to_arp_index(netif, q, etharp_cached_entry); + } +#if LWIP_NETIF_HWADDRHINT + } + } +#endif /* LWIP_NETIF_HWADDRHINT */ + + /* find stable entry: do this here since this is a critical path for + throughput and etharp_find_entry() is kind of slow */ + for (i = 0; i < ARP_TABLE_SIZE; i++) { + if ((arp_table[i].state >= ETHARP_STATE_STABLE) && +#if ETHARP_TABLE_MATCH_NETIF + (arp_table[i].netif == netif) && +#endif + (ip4_addr_cmp(dst_addr, &arp_table[i].ipaddr))) { + /* found an existing, stable entry */ + ETHARP_SET_HINT(netif, i); + return etharp_output_to_arp_index(netif, q, i); + } + } + /* no stable entry found, use the (slower) query function: + queue on destination Ethernet address belonging to ipaddr */ + return etharp_query(netif, dst_addr, q); + } + + /* continuation for multicast/broadcast destinations */ + /* obtain source Ethernet address of the given interface */ + /* send packet directly on the link */ + return ethernet_output(netif, q, (struct eth_addr*)(netif->hwaddr), dest, ETHTYPE_IP); +} + +/** + * Send an ARP request for the given IP address and/or queue a packet. + * + * If the IP address was not yet in the cache, a pending ARP cache entry + * is added and an ARP request is sent for the given address. The packet + * is queued on this entry. + * + * If the IP address was already pending in the cache, a new ARP request + * is sent for the given address. The packet is queued on this entry. + * + * If the IP address was already stable in the cache, and a packet is + * given, it is directly sent and no ARP request is sent out. + * + * If the IP address was already stable in the cache, and no packet is + * given, an ARP request is sent out. + * + * @param netif The lwIP network interface on which ipaddr + * must be queried for. + * @param ipaddr The IP address to be resolved. + * @param q If non-NULL, a pbuf that must be delivered to the IP address. + * q is not freed by this function. + * + * @note q must only be ONE packet, not a packet queue! + * + * @return + * - ERR_BUF Could not make room for Ethernet header. + * - ERR_MEM Hardware address unknown, and no more ARP entries available + * to query for address or queue the packet. + * - ERR_MEM Could not queue packet due to memory shortage. + * - ERR_RTE No route to destination (no gateway to external networks). + * - ERR_ARG Non-unicast address given, those will not appear in ARP cache. + * + */ +err_t +etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q) +{ + struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr; + err_t result = ERR_MEM; + int is_new_entry = 0; + s8_t i; /* ARP entry index */ + + /* non-unicast address? */ + if (ip4_addr_isbroadcast(ipaddr, netif) || + ip4_addr_ismulticast(ipaddr) || + ip4_addr_isany(ipaddr)) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: will not add non-unicast IP address to ARP cache\n")); + return ERR_ARG; + } + + /* find entry in ARP cache, ask to create entry if queueing packet */ + i = etharp_find_entry(ipaddr, ETHARP_FLAG_TRY_HARD, netif); + + /* could not find or create entry? */ + if (i < 0) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not create ARP entry\n")); + if (q) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: packet dropped\n")); + ETHARP_STATS_INC(etharp.memerr); + } + return (err_t)i; + } + + /* mark a fresh entry as pending (we just sent a request) */ + if (arp_table[i].state == ETHARP_STATE_EMPTY) { + is_new_entry = 1; + arp_table[i].state = ETHARP_STATE_PENDING; + /* record network interface for re-sending arp request in etharp_tmr */ + arp_table[i].netif = netif; + } + + /* { i is either a STABLE or (new or existing) PENDING entry } */ + LWIP_ASSERT("arp_table[i].state == PENDING or STABLE", + ((arp_table[i].state == ETHARP_STATE_PENDING) || + (arp_table[i].state >= ETHARP_STATE_STABLE))); + + /* do we have a new entry? or an implicit query request? */ + if (is_new_entry || (q == NULL)) { + /* try to resolve it; send out ARP request */ + result = etharp_request(netif, ipaddr); + if (result != ERR_OK) { + /* ARP request couldn't be sent */ + /* We don't re-send arp request in etharp_tmr, but we still queue packets, + since this failure could be temporary, and the next packet calling + etharp_query again could lead to sending the queued packets. */ + } + if (q == NULL) { + return result; + } + } + + /* packet given? */ + LWIP_ASSERT("q != NULL", q != NULL); + /* stable entry? */ + if (arp_table[i].state >= ETHARP_STATE_STABLE) { + /* we have a valid IP->Ethernet address mapping */ + ETHARP_SET_HINT(netif, i); + /* send the packet */ + result = ethernet_output(netif, q, srcaddr, &(arp_table[i].ethaddr), ETHTYPE_IP); + /* pending entry? (either just created or already pending */ + } else if (arp_table[i].state == ETHARP_STATE_PENDING) { + /* entry is still pending, queue the given packet 'q' */ + struct pbuf *p; + int copy_needed = 0; + /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but + * to copy the whole queue into a new PBUF_RAM (see bug #11400) + * PBUF_ROMs can be left as they are, since ROM must not get changed. */ + p = q; + while (p) { + LWIP_ASSERT("no packet queues allowed!", (p->len != p->tot_len) || (p->next == 0)); + if (p->type != PBUF_ROM) { + copy_needed = 1; + break; + } + p = p->next; + } + if (copy_needed) { + /* copy the whole packet into new pbufs */ + p = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM); + if (p != NULL) { + if (pbuf_copy(p, q) != ERR_OK) { + pbuf_free(p); + p = NULL; + } + } + } else { + /* referencing the old pbuf is enough */ + p = q; + pbuf_ref(p); + } + /* packet could be taken over? */ + if (p != NULL) { + /* queue packet ... */ +#if ARP_QUEUEING + struct etharp_q_entry *new_entry; + /* allocate a new arp queue entry */ + new_entry = (struct etharp_q_entry *)memp_malloc(MEMP_ARP_QUEUE); + if (new_entry != NULL) { + unsigned int qlen = 0; + new_entry->next = 0; + new_entry->p = p; + if (arp_table[i].q != NULL) { + /* queue was already existent, append the new entry to the end */ + struct etharp_q_entry *r; + r = arp_table[i].q; + qlen++; + while (r->next != NULL) { + r = r->next; + qlen++; + } + r->next = new_entry; + } else { + /* queue did not exist, first item in queue */ + arp_table[i].q = new_entry; + } +#if ARP_QUEUE_LEN + if (qlen >= ARP_QUEUE_LEN) { + struct etharp_q_entry *old; + old = arp_table[i].q; + arp_table[i].q = arp_table[i].q->next; + pbuf_free(old->p); + memp_free(MEMP_ARP_QUEUE, old); + } +#endif + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i)); + result = ERR_OK; + } else { + /* the pool MEMP_ARP_QUEUE is empty */ + pbuf_free(p); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q)); + result = ERR_MEM; + } +#else /* ARP_QUEUEING */ + /* always queue one packet per ARP request only, freeing a previously queued packet */ + if (arp_table[i].q != NULL) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"S16_F"\n", (void *)q, (s16_t)i)); + pbuf_free(arp_table[i].q); + } + arp_table[i].q = p; + result = ERR_OK; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i)); +#endif /* ARP_QUEUEING */ + } else { + ETHARP_STATS_INC(etharp.memerr); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue a copy of PBUF_REF packet %p (out of memory)\n", (void *)q)); + result = ERR_MEM; + } + } + return result; +} + +/** + * Send a raw ARP packet (opcode and all addresses can be modified) + * + * @param netif the lwip network interface on which to send the ARP packet + * @param ethsrc_addr the source MAC address for the ethernet header + * @param ethdst_addr the destination MAC address for the ethernet header + * @param hwsrc_addr the source MAC address for the ARP protocol header + * @param ipsrc_addr the source IP address for the ARP protocol header + * @param hwdst_addr the destination MAC address for the ARP protocol header + * @param ipdst_addr the destination IP address for the ARP protocol header + * @param opcode the type of the ARP packet + * @return ERR_OK if the ARP packet has been sent + * ERR_MEM if the ARP packet couldn't be allocated + * any other err_t on failure + */ +static err_t +etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, + const struct eth_addr *ethdst_addr, + const struct eth_addr *hwsrc_addr, const ip4_addr_t *ipsrc_addr, + const struct eth_addr *hwdst_addr, const ip4_addr_t *ipdst_addr, + const u16_t opcode) +{ + struct pbuf *p; + err_t result = ERR_OK; + struct etharp_hdr *hdr; + + LWIP_ASSERT("netif != NULL", netif != NULL); + + /* allocate a pbuf for the outgoing ARP request packet */ + p = pbuf_alloc(PBUF_LINK, SIZEOF_ETHARP_HDR, PBUF_RAM); + /* could allocate a pbuf for an ARP request? */ + if (p == NULL) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("etharp_raw: could not allocate pbuf for ARP request.\n")); + ETHARP_STATS_INC(etharp.memerr); + return ERR_MEM; + } + LWIP_ASSERT("check that first pbuf can hold struct etharp_hdr", + (p->len >= SIZEOF_ETHARP_HDR)); + + hdr = (struct etharp_hdr *)p->payload; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_raw: sending raw ARP packet.\n")); + hdr->opcode = lwip_htons(opcode); + + LWIP_ASSERT("netif->hwaddr_len must be the same as ETH_HWADDR_LEN for etharp!", + (netif->hwaddr_len == ETH_HWADDR_LEN)); + + /* Write the ARP MAC-Addresses */ + ETHADDR16_COPY(&hdr->shwaddr, hwsrc_addr); + ETHADDR16_COPY(&hdr->dhwaddr, hwdst_addr); + /* Copy struct ip4_addr2 to aligned ip4_addr, to support compilers without + * structure packing. */ + IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr); + IPADDR2_COPY(&hdr->dipaddr, ipdst_addr); + + hdr->hwtype = PP_HTONS(HWTYPE_ETHERNET); + hdr->proto = PP_HTONS(ETHTYPE_IP); + /* set hwlen and protolen */ + hdr->hwlen = ETH_HWADDR_LEN; + hdr->protolen = sizeof(ip4_addr_t); + + /* send ARP query */ +#if LWIP_AUTOIP + /* If we are using Link-Local, all ARP packets that contain a Link-Local + * 'sender IP address' MUST be sent using link-layer broadcast instead of + * link-layer unicast. (See RFC3927 Section 2.5, last paragraph) */ + if(ip4_addr_islinklocal(ipsrc_addr)) { + ethernet_output(netif, p, ethsrc_addr, ðbroadcast, ETHTYPE_ARP); + } else +#endif /* LWIP_AUTOIP */ + { + ethernet_output(netif, p, ethsrc_addr, ethdst_addr, ETHTYPE_ARP); + } + + ETHARP_STATS_INC(etharp.xmit); + /* free ARP query packet */ + pbuf_free(p); + p = NULL; + /* could not allocate pbuf for ARP request */ + + return result; +} + +/** + * Send an ARP request packet asking for ipaddr to a specific eth address. + * Used to send unicast request to refresh the ARP table just before an entry + * times out + * + * @param netif the lwip network interface on which to send the request + * @param ipaddr the IP address for which to ask + * @param hw_dst_addr the ethernet address to send this packet to + * @return ERR_OK if the request has been sent + * ERR_MEM if the ARP packet couldn't be allocated + * any other err_t on failure + */ +static err_t +etharp_request_dst(struct netif *netif, const ip4_addr_t *ipaddr, const struct eth_addr* hw_dst_addr) +{ + return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, hw_dst_addr, + (struct eth_addr *)netif->hwaddr, netif_ip4_addr(netif), ðzero, + ipaddr, ARP_REQUEST); +} + +/** + * Send an ARP request packet asking for ipaddr. + * + * @param netif the lwip network interface on which to send the request + * @param ipaddr the IP address for which to ask + * @return ERR_OK if the request has been sent + * ERR_MEM if the ARP packet couldn't be allocated + * any other err_t on failure + */ +err_t +etharp_request(struct netif *netif, const ip4_addr_t *ipaddr) +{ + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_request: sending ARP request.\n")); + return etharp_request_dst(netif, ipaddr, ðbroadcast); +} +#endif /* LWIP_IPV4 && LWIP_ARP */ + +#endif /* LWIP_ARP || LWIP_ETHERNET */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/icmp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/icmp.c new file mode 100644 index 0000000..5ee24ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/icmp.c @@ -0,0 +1,397 @@ +/** + * @file + * ICMP - Internet Control Message Protocol + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +/* Some ICMP messages should be passed to the transport protocols. This + is not implemented. */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 && LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/icmp.h" +#include "lwip/inet_chksum.h" +#include "lwip/ip.h" +#include "lwip/def.h" +#include "lwip/stats.h" + +#include + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +/** Small optimization: set to 0 if incoming PBUF_POOL pbuf always can be + * used to modify and send a response packet (and to 1 if this is not the case, + * e.g. when link header is stripped of when receiving) */ +#ifndef LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN +#define LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN 1 +#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */ + +/* The amount of data from the original packet to return in a dest-unreachable */ +#define ICMP_DEST_UNREACH_DATASIZE 8 + +static void icmp_send_response(struct pbuf *p, u8_t type, u8_t code); + +/** + * Processes ICMP input packets, called from ip_input(). + * + * Currently only processes icmp echo requests and sends + * out the echo response. + * + * @param p the icmp echo request packet, p->payload pointing to the icmp header + * @param inp the netif on which this packet was received + */ +void +icmp_input(struct pbuf *p, struct netif *inp) +{ + u8_t type; +#ifdef LWIP_DEBUG + u8_t code; +#endif /* LWIP_DEBUG */ + struct icmp_echo_hdr *iecho; + const struct ip_hdr *iphdr_in; + u16_t hlen; + const ip4_addr_t* src; + + ICMP_STATS_INC(icmp.recv); + MIB2_STATS_INC(mib2.icmpinmsgs); + + iphdr_in = ip4_current_header(); + hlen = IPH_HL(iphdr_in) * 4; + if (hlen < IP_HLEN) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short IP header (%"S16_F" bytes) received\n", hlen)); + goto lenerr; + } + if (p->len < sizeof(u16_t)*2) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: short ICMP (%"U16_F" bytes) received\n", p->tot_len)); + goto lenerr; + } + + type = *((u8_t *)p->payload); +#ifdef LWIP_DEBUG + code = *(((u8_t *)p->payload)+1); +#endif /* LWIP_DEBUG */ + switch (type) { + case ICMP_ER: + /* This is OK, echo reply might have been parsed by a raw PCB + (as obviously, an echo request has been sent, too). */ + MIB2_STATS_INC(mib2.icmpinechoreps); + break; + case ICMP_ECHO: + MIB2_STATS_INC(mib2.icmpinechos); + src = ip4_current_dest_addr(); + /* multicast destination address? */ + if (ip4_addr_ismulticast(ip4_current_dest_addr())) { +#if LWIP_MULTICAST_PING + /* For multicast, use address of receiving interface as source address */ + src = netif_ip4_addr(inp); +#else /* LWIP_MULTICAST_PING */ + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to multicast pings\n")); + goto icmperr; +#endif /* LWIP_MULTICAST_PING */ + } + /* broadcast destination address? */ + if (ip4_addr_isbroadcast(ip4_current_dest_addr(), ip_current_netif())) { +#if LWIP_BROADCAST_PING + /* For broadcast, use address of receiving interface as source address */ + src = netif_ip4_addr(inp); +#else /* LWIP_BROADCAST_PING */ + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: Not echoing to broadcast pings\n")); + goto icmperr; +#endif /* LWIP_BROADCAST_PING */ + } + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ping\n")); + if (p->tot_len < sizeof(struct icmp_echo_hdr)) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n")); + goto lenerr; + } +#if CHECKSUM_CHECK_ICMP + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_CHECK_ICMP) { + if (inet_chksum_pbuf(p) != 0) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n")); + pbuf_free(p); + ICMP_STATS_INC(icmp.chkerr); + MIB2_STATS_INC(mib2.icmpinerrors); + return; + } + } +#endif +#if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN + if (pbuf_header(p, (s16_t)(hlen + PBUF_LINK_HLEN + PBUF_LINK_ENCAPSULATION_HLEN))) { + /* p is not big enough to contain link headers + * allocate a new one and copy p into it + */ + struct pbuf *r; + /* allocate new packet buffer with space for link headers */ + r = pbuf_alloc(PBUF_LINK, p->tot_len + hlen, PBUF_RAM); + if (r == NULL) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: allocating new pbuf failed\n")); + goto icmperr; + } + if (r->len < hlen + sizeof(struct icmp_echo_hdr)) { + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("first pbuf cannot hold the ICMP header")); + pbuf_free(r); + goto icmperr; + } + /* copy the ip header */ + MEMCPY(r->payload, iphdr_in, hlen); + /* switch r->payload back to icmp header (cannot fail) */ + if (pbuf_header(r, (s16_t)-hlen)) { + LWIP_ASSERT("icmp_input: moving r->payload to icmp header failed\n", 0); + pbuf_free(r); + goto icmperr; + } + /* copy the rest of the packet without ip header */ + if (pbuf_copy(r, p) != ERR_OK) { + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("icmp_input: copying to new pbuf failed")); + pbuf_free(r); + goto icmperr; + } + /* free the original p */ + pbuf_free(p); + /* we now have an identical copy of p that has room for link headers */ + p = r; + } else { + /* restore p->payload to point to icmp header (cannot fail) */ + if (pbuf_header(p, -(s16_t)(hlen + PBUF_LINK_HLEN + PBUF_LINK_ENCAPSULATION_HLEN))) { + LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0); + goto icmperr; + } + } +#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN */ + /* At this point, all checks are OK. */ + /* We generate an answer by switching the dest and src ip addresses, + * setting the icmp type to ECHO_RESPONSE and updating the checksum. */ + iecho = (struct icmp_echo_hdr *)p->payload; + if (pbuf_header(p, (s16_t)hlen)) { + LWIP_DEBUGF(ICMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Can't move over header in packet")); + } else { + err_t ret; + struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; + ip4_addr_copy(iphdr->src, *src); + ip4_addr_copy(iphdr->dest, *ip4_current_src_addr()); + ICMPH_TYPE_SET(iecho, ICMP_ER); +#if CHECKSUM_GEN_ICMP + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_GEN_ICMP) { + /* adjust the checksum */ + if (iecho->chksum > PP_HTONS(0xffffU - (ICMP_ECHO << 8))) { + iecho->chksum += PP_HTONS(ICMP_ECHO << 8) + 1; + } else { + iecho->chksum += PP_HTONS(ICMP_ECHO << 8); + } + } +#if LWIP_CHECKSUM_CTRL_PER_NETIF + else { + iecho->chksum = 0; + } +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ +#else /* CHECKSUM_GEN_ICMP */ + iecho->chksum = 0; +#endif /* CHECKSUM_GEN_ICMP */ + + /* Set the correct TTL and recalculate the header checksum. */ + IPH_TTL_SET(iphdr, ICMP_TTL); + IPH_CHKSUM_SET(iphdr, 0); +#if CHECKSUM_GEN_IP + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_GEN_IP) { + IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, hlen)); + } +#endif /* CHECKSUM_GEN_IP */ + + ICMP_STATS_INC(icmp.xmit); + /* increase number of messages attempted to send */ + MIB2_STATS_INC(mib2.icmpoutmsgs); + /* increase number of echo replies attempted to send */ + MIB2_STATS_INC(mib2.icmpoutechoreps); + + /* send an ICMP packet */ + ret = ip4_output_if(p, src, LWIP_IP_HDRINCL, + ICMP_TTL, 0, IP_PROTO_ICMP, inp); + if (ret != ERR_OK) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ip_output_if returned an error: %s\n", lwip_strerr(ret))); + } + } + break; + default: + if (type == ICMP_DUR) { + MIB2_STATS_INC(mib2.icmpindestunreachs); + } else if (type == ICMP_TE) { + MIB2_STATS_INC(mib2.icmpintimeexcds); + } else if (type == ICMP_PP) { + MIB2_STATS_INC(mib2.icmpinparmprobs); + } else if (type == ICMP_SQ) { + MIB2_STATS_INC(mib2.icmpinsrcquenchs); + } else if (type == ICMP_RD) { + MIB2_STATS_INC(mib2.icmpinredirects); + } else if (type == ICMP_TS) { + MIB2_STATS_INC(mib2.icmpintimestamps); + } else if (type == ICMP_TSR) { + MIB2_STATS_INC(mib2.icmpintimestampreps); + } else if (type == ICMP_AM) { + MIB2_STATS_INC(mib2.icmpinaddrmasks); + } else if (type == ICMP_AMR) { + MIB2_STATS_INC(mib2.icmpinaddrmaskreps); + } + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", + (s16_t)type, (s16_t)code)); + ICMP_STATS_INC(icmp.proterr); + ICMP_STATS_INC(icmp.drop); + } + pbuf_free(p); + return; +lenerr: + pbuf_free(p); + ICMP_STATS_INC(icmp.lenerr); + MIB2_STATS_INC(mib2.icmpinerrors); + return; +#if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN || !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING +icmperr: + pbuf_free(p); + ICMP_STATS_INC(icmp.err); + MIB2_STATS_INC(mib2.icmpinerrors); + return; +#endif /* LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN || !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING */ +} + +/** + * Send an icmp 'destination unreachable' packet, called from ip_input() if + * the transport layer protocol is unknown and from udp_input() if the local + * port is not bound. + * + * @param p the input packet for which the 'unreachable' should be sent, + * p->payload pointing to the IP header + * @param t type of the 'unreachable' packet + */ +void +icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t) +{ + MIB2_STATS_INC(mib2.icmpoutdestunreachs); + icmp_send_response(p, ICMP_DUR, t); +} + +#if IP_FORWARD || IP_REASSEMBLY +/** + * Send a 'time exceeded' packet, called from ip_forward() if TTL is 0. + * + * @param p the input packet for which the 'time exceeded' should be sent, + * p->payload pointing to the IP header + * @param t type of the 'time exceeded' packet + */ +void +icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t) +{ + MIB2_STATS_INC(mib2.icmpouttimeexcds); + icmp_send_response(p, ICMP_TE, t); +} + +#endif /* IP_FORWARD || IP_REASSEMBLY */ + +/** + * Send an icmp packet in response to an incoming packet. + * + * @param p the input packet for which the 'unreachable' should be sent, + * p->payload pointing to the IP header + * @param type Type of the ICMP header + * @param code Code of the ICMP header + */ +static void +icmp_send_response(struct pbuf *p, u8_t type, u8_t code) +{ + struct pbuf *q; + struct ip_hdr *iphdr; + /* we can use the echo header here */ + struct icmp_echo_hdr *icmphdr; + ip4_addr_t iphdr_src; + struct netif *netif; + + /* increase number of messages attempted to send */ + MIB2_STATS_INC(mib2.icmpoutmsgs); + + /* ICMP header + IP header + 8 bytes of data */ + q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE, + PBUF_RAM); + if (q == NULL) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded: failed to allocate pbuf for ICMP packet.\n")); + MIB2_STATS_INC(mib2.icmpouterrors); + return; + } + LWIP_ASSERT("check that first pbuf can hold icmp message", + (q->len >= (sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE))); + + iphdr = (struct ip_hdr *)p->payload; + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded from ")); + ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->src); + LWIP_DEBUGF(ICMP_DEBUG, (" to ")); + ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->dest); + LWIP_DEBUGF(ICMP_DEBUG, ("\n")); + + icmphdr = (struct icmp_echo_hdr *)q->payload; + icmphdr->type = type; + icmphdr->code = code; + icmphdr->id = 0; + icmphdr->seqno = 0; + + /* copy fields from original packet */ + SMEMCPY((u8_t *)q->payload + sizeof(struct icmp_echo_hdr), (u8_t *)p->payload, + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE); + + ip4_addr_copy(iphdr_src, iphdr->src); +#ifdef LWIP_HOOK_IP4_ROUTE_SRC + { + ip4_addr_t iphdr_dst; + ip4_addr_copy(iphdr_dst, iphdr->dest); + netif = ip4_route_src(&iphdr_src, &iphdr_dst); + } +#else + netif = ip4_route(&iphdr_src); +#endif + if (netif != NULL) { + /* calculate checksum */ + icmphdr->chksum = 0; +#if CHECKSUM_GEN_ICMP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP) { + icmphdr->chksum = inet_chksum(icmphdr, q->len); + } +#endif + ICMP_STATS_INC(icmp.xmit); + ip4_output_if(q, NULL, &iphdr_src, ICMP_TTL, 0, IP_PROTO_ICMP, netif); + } + pbuf_free(q); +} + +#endif /* LWIP_IPV4 && LWIP_ICMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/igmp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/igmp.c new file mode 100644 index 0000000..74a6c37 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/igmp.c @@ -0,0 +1,800 @@ +/** + * @file + * IGMP - Internet Group Management Protocol + * + * @defgroup igmp IGMP + * @ingroup ip4 + * To be called from TCPIP thread + */ + +/* + * Copyright (c) 2002 CITEL Technologies Ltd. + * 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 CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is a contribution to the lwIP TCP/IP stack. + * The Swedish Institute of Computer Science and Adam Dunkels + * are specifically granted permission to redistribute this + * source code. +*/ + +/*------------------------------------------------------------- +Note 1) +Although the rfc requires V1 AND V2 capability +we will only support v2 since now V1 is very old (August 1989) +V1 can be added if required + +a debug print and statistic have been implemented to +show this up. +------------------------------------------------------------- +------------------------------------------------------------- +Note 2) +A query for a specific group address (as opposed to ALLHOSTS) +has now been implemented as I am unsure if it is required + +a debug print and statistic have been implemented to +show this up. +------------------------------------------------------------- +------------------------------------------------------------- +Note 3) +The router alert rfc 2113 is implemented in outgoing packets +but not checked rigorously incoming +------------------------------------------------------------- +Steve Reynolds +------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------- + * RFC 988 - Host extensions for IP multicasting - V0 + * RFC 1054 - Host extensions for IP multicasting - + * RFC 1112 - Host extensions for IP multicasting - V1 + * RFC 2236 - Internet Group Management Protocol, Version 2 - V2 <- this code is based on this RFC (it's the "de facto" standard) + * RFC 3376 - Internet Group Management Protocol, Version 3 - V3 + * RFC 4604 - Using Internet Group Management Protocol Version 3... - V3+ + * RFC 2113 - IP Router Alert Option - + *----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------- + * Includes + *----------------------------------------------------------------------------*/ + +#include "lwip/opt.h" + +#if LWIP_IPV4 && LWIP_IGMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/igmp.h" +#include "lwip/debug.h" +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/ip.h" +#include "lwip/inet_chksum.h" +#include "lwip/netif.h" +#include "lwip/stats.h" +#include "lwip/prot/igmp.h" + +#include "string.h" + +static struct igmp_group *igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr); +static err_t igmp_remove_group(struct netif* netif, struct igmp_group *group); +static void igmp_timeout(struct netif *netif, struct igmp_group *group); +static void igmp_start_timer(struct igmp_group *group, u8_t max_time); +static void igmp_delaying_member(struct igmp_group *group, u8_t maxresp); +static err_t igmp_ip_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, struct netif *netif); +static void igmp_send(struct netif *netif, struct igmp_group *group, u8_t type); + +static ip4_addr_t allsystems; +static ip4_addr_t allrouters; + +/** + * Initialize the IGMP module + */ +void +igmp_init(void) +{ + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_init: initializing\n")); + + IP4_ADDR(&allsystems, 224, 0, 0, 1); + IP4_ADDR(&allrouters, 224, 0, 0, 2); +} + +/** + * Start IGMP processing on interface + * + * @param netif network interface on which start IGMP processing + */ +err_t +igmp_start(struct netif *netif) +{ + struct igmp_group* group; + + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_start: starting IGMP processing on if %p\n", (void*)netif)); + + group = igmp_lookup_group(netif, &allsystems); + + if (group != NULL) { + group->group_state = IGMP_GROUP_IDLE_MEMBER; + group->use++; + + /* Allow the igmp messages at the MAC level */ + if (netif->igmp_mac_filter != NULL) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_start: igmp_mac_filter(ADD ")); + ip4_addr_debug_print_val(IGMP_DEBUG, allsystems); + LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", (void*)netif)); + netif->igmp_mac_filter(netif, &allsystems, NETIF_ADD_MAC_FILTER); + } + + return ERR_OK; + } + + return ERR_MEM; +} + +/** + * Stop IGMP processing on interface + * + * @param netif network interface on which stop IGMP processing + */ +err_t +igmp_stop(struct netif *netif) +{ + struct igmp_group *group = netif_igmp_data(netif); + + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP, NULL); + + while (group != NULL) { + struct igmp_group *next = group->next; /* avoid use-after-free below */ + + /* disable the group at the MAC level */ + if (netif->igmp_mac_filter != NULL) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_stop: igmp_mac_filter(DEL ")); + ip4_addr_debug_print(IGMP_DEBUG, &group->group_address); + LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", (void*)netif)); + netif->igmp_mac_filter(netif, &(group->group_address), NETIF_DEL_MAC_FILTER); + } + + /* free group */ + memp_free(MEMP_IGMP_GROUP, group); + + /* move to "next" */ + group = next; + } + return ERR_OK; +} + +/** + * Report IGMP memberships for this interface + * + * @param netif network interface on which report IGMP memberships + */ +void +igmp_report_groups(struct netif *netif) +{ + struct igmp_group *group = netif_igmp_data(netif); + + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_report_groups: sending IGMP reports on if %p\n", (void*)netif)); + + /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ + if(group != NULL) { + group = group->next; + } + + while (group != NULL) { + igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR); + group = group->next; + } +} + +/** + * Search for a group in the global igmp_group_list + * + * @param ifp the network interface for which to look + * @param addr the group ip address to search for + * @return a struct igmp_group* if the group has been found, + * NULL if the group wasn't found. + */ +struct igmp_group * +igmp_lookfor_group(struct netif *ifp, const ip4_addr_t *addr) +{ + struct igmp_group *group = netif_igmp_data(ifp); + + while (group != NULL) { + if (ip4_addr_cmp(&(group->group_address), addr)) { + return group; + } + group = group->next; + } + + /* to be clearer, we return NULL here instead of + * 'group' (which is also NULL at this point). + */ + return NULL; +} + +/** + * Search for a specific igmp group and create a new one if not found- + * + * @param ifp the network interface for which to look + * @param addr the group ip address to search + * @return a struct igmp_group*, + * NULL on memory error. + */ +static struct igmp_group * +igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr) +{ + struct igmp_group *group; + struct igmp_group *list_head = netif_igmp_data(ifp); + + /* Search if the group already exists */ + group = igmp_lookfor_group(ifp, addr); + if (group != NULL) { + /* Group already exists. */ + return group; + } + + /* Group doesn't exist yet, create a new one */ + group = (struct igmp_group *)memp_malloc(MEMP_IGMP_GROUP); + if (group != NULL) { + ip4_addr_set(&(group->group_address), addr); + group->timer = 0; /* Not running */ + group->group_state = IGMP_GROUP_NON_MEMBER; + group->last_reporter_flag = 0; + group->use = 0; + + /* Ensure allsystems group is always first in list */ + if (list_head == NULL) { + /* this is the first entry in linked list */ + LWIP_ASSERT("igmp_lookup_group: first group must be allsystems", + (ip4_addr_cmp(addr, &allsystems) != 0)); + group->next = NULL; + netif_set_client_data(ifp, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP, group); + } else { + /* append _after_ first entry */ + LWIP_ASSERT("igmp_lookup_group: all except first group must not be allsystems", + (ip4_addr_cmp(addr, &allsystems) == 0)); + group->next = list_head->next; + list_head->next = group; + } + } + + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_lookup_group: %sallocated a new group with address ", (group?"":"impossible to "))); + ip4_addr_debug_print(IGMP_DEBUG, addr); + LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", (void*)ifp)); + + return group; +} + +/** + * Remove a group in the global igmp_group_list, but don't free it yet + * + * @param group the group to remove from the global igmp_group_list + * @return ERR_OK if group was removed from the list, an err_t otherwise + */ +static err_t +igmp_remove_group(struct netif* netif, struct igmp_group *group) +{ + err_t err = ERR_OK; + struct igmp_group *tmp_group; + + /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ + for (tmp_group = netif_igmp_data(netif); tmp_group != NULL; tmp_group = tmp_group->next) { + if (tmp_group->next == group) { + tmp_group->next = group->next; + break; + } + } + /* Group not found in the global igmp_group_list */ + if (tmp_group == NULL) { + err = ERR_ARG; + } + + return err; +} + +/** + * Called from ip_input() if a new IGMP packet is received. + * + * @param p received igmp packet, p->payload pointing to the igmp header + * @param inp network interface on which the packet was received + * @param dest destination ip address of the igmp packet + */ +void +igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) +{ + struct igmp_msg* igmp; + struct igmp_group* group; + struct igmp_group* groupref; + + IGMP_STATS_INC(igmp.recv); + + /* Note that the length CAN be greater than 8 but only 8 are used - All are included in the checksum */ + if (p->len < IGMP_MINLEN) { + pbuf_free(p); + IGMP_STATS_INC(igmp.lenerr); + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: length error\n")); + return; + } + + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: message from ")); + ip4_addr_debug_print(IGMP_DEBUG, &(ip4_current_header()->src)); + LWIP_DEBUGF(IGMP_DEBUG, (" to address ")); + ip4_addr_debug_print(IGMP_DEBUG, &(ip4_current_header()->dest)); + LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", (void*)inp)); + + /* Now calculate and check the checksum */ + igmp = (struct igmp_msg *)p->payload; + if (inet_chksum(igmp, p->len)) { + pbuf_free(p); + IGMP_STATS_INC(igmp.chkerr); + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: checksum error\n")); + return; + } + + /* Packet is ok so find an existing group */ + group = igmp_lookfor_group(inp, dest); /* use the destination IP address of incoming packet */ + + /* If group can be found or create... */ + if (!group) { + pbuf_free(p); + IGMP_STATS_INC(igmp.drop); + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: IGMP frame not for us\n")); + return; + } + + /* NOW ACT ON THE INCOMING MESSAGE TYPE... */ + switch (igmp->igmp_msgtype) { + case IGMP_MEMB_QUERY: + /* IGMP_MEMB_QUERY to the "all systems" address ? */ + if ((ip4_addr_cmp(dest, &allsystems)) && ip4_addr_isany(&igmp->igmp_group_address)) { + /* THIS IS THE GENERAL QUERY */ + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: General IGMP_MEMB_QUERY on \"ALL SYSTEMS\" address (224.0.0.1) [igmp_maxresp=%i]\n", (int)(igmp->igmp_maxresp))); + + if (igmp->igmp_maxresp == 0) { + IGMP_STATS_INC(igmp.rx_v1); + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: got an all hosts query with time== 0 - this is V1 and not implemented - treat as v2\n")); + igmp->igmp_maxresp = IGMP_V1_DELAYING_MEMBER_TMR; + } else { + IGMP_STATS_INC(igmp.rx_general); + } + + groupref = netif_igmp_data(inp); + + /* Do not send messages on the all systems group address! */ + /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ + if(groupref != NULL) { + groupref = groupref->next; + } + + while (groupref) { + igmp_delaying_member(groupref, igmp->igmp_maxresp); + groupref = groupref->next; + } + } else { + /* IGMP_MEMB_QUERY to a specific group ? */ + if (!ip4_addr_isany(&igmp->igmp_group_address)) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: IGMP_MEMB_QUERY to a specific group ")); + ip4_addr_debug_print(IGMP_DEBUG, &igmp->igmp_group_address); + if (ip4_addr_cmp(dest, &allsystems)) { + ip4_addr_t groupaddr; + LWIP_DEBUGF(IGMP_DEBUG, (" using \"ALL SYSTEMS\" address (224.0.0.1) [igmp_maxresp=%i]\n", (int)(igmp->igmp_maxresp))); + /* we first need to re-look for the group since we used dest last time */ + ip4_addr_copy(groupaddr, igmp->igmp_group_address); + group = igmp_lookfor_group(inp, &groupaddr); + } else { + LWIP_DEBUGF(IGMP_DEBUG, (" with the group address as destination [igmp_maxresp=%i]\n", (int)(igmp->igmp_maxresp))); + } + + if (group != NULL) { + IGMP_STATS_INC(igmp.rx_group); + igmp_delaying_member(group, igmp->igmp_maxresp); + } else { + IGMP_STATS_INC(igmp.drop); + } + } else { + IGMP_STATS_INC(igmp.proterr); + } + } + break; + case IGMP_V2_MEMB_REPORT: + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: IGMP_V2_MEMB_REPORT\n")); + IGMP_STATS_INC(igmp.rx_report); + if (group->group_state == IGMP_GROUP_DELAYING_MEMBER) { + /* This is on a specific group we have already looked up */ + group->timer = 0; /* stopped */ + group->group_state = IGMP_GROUP_IDLE_MEMBER; + group->last_reporter_flag = 0; + } + break; + default: + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: unexpected msg %d in state %d on group %p on if %p\n", + igmp->igmp_msgtype, group->group_state, (void*)&group, (void*)inp)); + IGMP_STATS_INC(igmp.proterr); + break; + } + + pbuf_free(p); + return; +} + +/** + * @ingroup igmp + * Join a group on one network interface. + * + * @param ifaddr ip address of the network interface which should join a new group + * @param groupaddr the ip address of the group which to join + * @return ERR_OK if group was joined on the netif(s), an err_t otherwise + */ +err_t +igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) +{ + err_t err = ERR_VAL; /* no matching interface */ + struct netif *netif; + + /* make sure it is multicast address */ + LWIP_ERROR("igmp_joingroup: attempt to join non-multicast address", ip4_addr_ismulticast(groupaddr), return ERR_VAL;); + LWIP_ERROR("igmp_joingroup: attempt to join allsystems address", (!ip4_addr_cmp(groupaddr, &allsystems)), return ERR_VAL;); + + /* loop through netif's */ + netif = netif_list; + while (netif != NULL) { + /* Should we join this interface ? */ + if ((netif->flags & NETIF_FLAG_IGMP) && ((ip4_addr_isany(ifaddr) || ip4_addr_cmp(netif_ip4_addr(netif), ifaddr)))) { + err = igmp_joingroup_netif(netif, groupaddr); + if (err != ERR_OK) { + /* Return an error even if some network interfaces are joined */ + /** @todo undo any other netif already joined */ + return err; + } + } + /* proceed to next network interface */ + netif = netif->next; + } + + return err; +} + +/** + * @ingroup igmp + * Join a group on one network interface. + * + * @param netif the network interface which should join a new group + * @param groupaddr the ip address of the group which to join + * @return ERR_OK if group was joined on the netif, an err_t otherwise + */ +err_t +igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr) +{ + struct igmp_group *group; + + /* make sure it is multicast address */ + LWIP_ERROR("igmp_joingroup_netif: attempt to join non-multicast address", ip4_addr_ismulticast(groupaddr), return ERR_VAL;); + LWIP_ERROR("igmp_joingroup_netif: attempt to join allsystems address", (!ip4_addr_cmp(groupaddr, &allsystems)), return ERR_VAL;); + + /* make sure it is an igmp-enabled netif */ + LWIP_ERROR("igmp_joingroup_netif: attempt to join on non-IGMP netif", netif->flags & NETIF_FLAG_IGMP, return ERR_VAL;); + + /* find group or create a new one if not found */ + group = igmp_lookup_group(netif, groupaddr); + + if (group != NULL) { + /* This should create a new group, check the state to make sure */ + if (group->group_state != IGMP_GROUP_NON_MEMBER) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_joingroup_netif: join to group not in state IGMP_GROUP_NON_MEMBER\n")); + } else { + /* OK - it was new group */ + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_joingroup_netif: join to new group: ")); + ip4_addr_debug_print(IGMP_DEBUG, groupaddr); + LWIP_DEBUGF(IGMP_DEBUG, ("\n")); + + /* If first use of the group, allow the group at the MAC level */ + if ((group->use==0) && (netif->igmp_mac_filter != NULL)) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_joingroup_netif: igmp_mac_filter(ADD ")); + ip4_addr_debug_print(IGMP_DEBUG, groupaddr); + LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", (void*)netif)); + netif->igmp_mac_filter(netif, groupaddr, NETIF_ADD_MAC_FILTER); + } + + IGMP_STATS_INC(igmp.tx_join); + igmp_send(netif, group, IGMP_V2_MEMB_REPORT); + + igmp_start_timer(group, IGMP_JOIN_DELAYING_MEMBER_TMR); + + /* Need to work out where this timer comes from */ + group->group_state = IGMP_GROUP_DELAYING_MEMBER; + } + /* Increment group use */ + group->use++; + /* Join on this interface */ + return ERR_OK; + } else { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_joingroup_netif: Not enough memory to join to group\n")); + return ERR_MEM; + } +} + +/** + * @ingroup igmp + * Leave a group on one network interface. + * + * @param ifaddr ip address of the network interface which should leave a group + * @param groupaddr the ip address of the group which to leave + * @return ERR_OK if group was left on the netif(s), an err_t otherwise + */ +err_t +igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr) +{ + err_t err = ERR_VAL; /* no matching interface */ + struct netif *netif; + + /* make sure it is multicast address */ + LWIP_ERROR("igmp_leavegroup: attempt to leave non-multicast address", ip4_addr_ismulticast(groupaddr), return ERR_VAL;); + LWIP_ERROR("igmp_leavegroup: attempt to leave allsystems address", (!ip4_addr_cmp(groupaddr, &allsystems)), return ERR_VAL;); + + /* loop through netif's */ + netif = netif_list; + while (netif != NULL) { + /* Should we leave this interface ? */ + if ((netif->flags & NETIF_FLAG_IGMP) && ((ip4_addr_isany(ifaddr) || ip4_addr_cmp(netif_ip4_addr(netif), ifaddr)))) { + err_t res = igmp_leavegroup_netif(netif, groupaddr); + if (err != ERR_OK) { + /* Store this result if we have not yet gotten a success */ + err = res; + } + } + /* proceed to next network interface */ + netif = netif->next; + } + + return err; +} + +/** + * @ingroup igmp + * Leave a group on one network interface. + * + * @param netif the network interface which should leave a group + * @param groupaddr the ip address of the group which to leave + * @return ERR_OK if group was left on the netif, an err_t otherwise + */ +err_t +igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr) +{ + struct igmp_group *group; + + /* make sure it is multicast address */ + LWIP_ERROR("igmp_leavegroup_netif: attempt to leave non-multicast address", ip4_addr_ismulticast(groupaddr), return ERR_VAL;); + LWIP_ERROR("igmp_leavegroup_netif: attempt to leave allsystems address", (!ip4_addr_cmp(groupaddr, &allsystems)), return ERR_VAL;); + + /* make sure it is an igmp-enabled netif */ + LWIP_ERROR("igmp_leavegroup_netif: attempt to leave on non-IGMP netif", netif->flags & NETIF_FLAG_IGMP, return ERR_VAL;); + + /* find group */ + group = igmp_lookfor_group(netif, groupaddr); + + if (group != NULL) { + /* Only send a leave if the flag is set according to the state diagram */ + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup_netif: Leaving group: ")); + ip4_addr_debug_print(IGMP_DEBUG, groupaddr); + LWIP_DEBUGF(IGMP_DEBUG, ("\n")); + + /* If there is no other use of the group */ + if (group->use <= 1) { + /* Remove the group from the list */ + igmp_remove_group(netif, group); + + /* If we are the last reporter for this group */ + if (group->last_reporter_flag) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup_netif: sending leaving group\n")); + IGMP_STATS_INC(igmp.tx_leave); + igmp_send(netif, group, IGMP_LEAVE_GROUP); + } + + /* Disable the group at the MAC level */ + if (netif->igmp_mac_filter != NULL) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup_netif: igmp_mac_filter(DEL ")); + ip4_addr_debug_print(IGMP_DEBUG, groupaddr); + LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", (void*)netif)); + netif->igmp_mac_filter(netif, groupaddr, NETIF_DEL_MAC_FILTER); + } + + /* Free group struct */ + memp_free(MEMP_IGMP_GROUP, group); + } else { + /* Decrement group use */ + group->use--; + } + return ERR_OK; + } else { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup_netif: not member of group\n")); + return ERR_VAL; + } +} + +/** + * The igmp timer function (both for NO_SYS=1 and =0) + * Should be called every IGMP_TMR_INTERVAL milliseconds (100 ms is default). + */ +void +igmp_tmr(void) +{ + struct netif *netif = netif_list; + + while (netif != NULL) { + struct igmp_group *group = netif_igmp_data(netif); + + while (group != NULL) { + if (group->timer > 0) { + group->timer--; + if (group->timer == 0) { + igmp_timeout(netif, group); + } + } + group = group->next; + } + netif = netif->next; + } +} + +/** + * Called if a timeout for one group is reached. + * Sends a report for this group. + * + * @param group an igmp_group for which a timeout is reached + */ +static void +igmp_timeout(struct netif *netif, struct igmp_group *group) +{ + /* If the state is IGMP_GROUP_DELAYING_MEMBER then we send a report for this group + (unless it is the allsystems group) */ + if ((group->group_state == IGMP_GROUP_DELAYING_MEMBER) && + (!(ip4_addr_cmp(&(group->group_address), &allsystems)))) { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_timeout: report membership for group with address ")); + ip4_addr_debug_print(IGMP_DEBUG, &(group->group_address)); + LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", (void*)netif)); + + group->group_state = IGMP_GROUP_IDLE_MEMBER; + + IGMP_STATS_INC(igmp.tx_report); + igmp_send(netif, group, IGMP_V2_MEMB_REPORT); + } +} + +/** + * Start a timer for an igmp group + * + * @param group the igmp_group for which to start a timer + * @param max_time the time in multiples of IGMP_TMR_INTERVAL (decrease with + * every call to igmp_tmr()) + */ +static void +igmp_start_timer(struct igmp_group *group, u8_t max_time) +{ +#ifdef LWIP_RAND + group->timer = max_time > 2 ? (LWIP_RAND() % max_time) : 1; +#else /* LWIP_RAND */ + /* ATTENTION: use this only if absolutely necessary! */ + group->timer = max_time / 2; +#endif /* LWIP_RAND */ + + if (group->timer == 0) { + group->timer = 1; + } +} + +/** + * Delaying membership report for a group if necessary + * + * @param group the igmp_group for which "delaying" membership report + * @param maxresp query delay + */ +static void +igmp_delaying_member(struct igmp_group *group, u8_t maxresp) +{ + if ((group->group_state == IGMP_GROUP_IDLE_MEMBER) || + ((group->group_state == IGMP_GROUP_DELAYING_MEMBER) && + ((group->timer == 0) || (maxresp < group->timer)))) { + igmp_start_timer(group, maxresp); + group->group_state = IGMP_GROUP_DELAYING_MEMBER; + } +} + + +/** + * Sends an IP packet on a network interface. This function constructs the IP header + * and calculates the IP header checksum. If the source IP address is NULL, + * the IP address of the outgoing network interface is filled in as source address. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) + * @param src the source IP address to send from (if src == IP4_ADDR_ANY, the + * IP address of the netif used to send is used as source address) + * @param dest the destination IP address to send the packet to + * @param netif the netif on which to send this packet + * @return ERR_OK if the packet was sent OK + * ERR_BUF if p doesn't have enough space for IP/LINK headers + * returns errors returned by netif->output + */ +static err_t +igmp_ip_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, struct netif *netif) +{ + /* This is the "router alert" option */ + u16_t ra[2]; + ra[0] = PP_HTONS(ROUTER_ALERT); + ra[1] = 0x0000; /* Router shall examine packet */ + IGMP_STATS_INC(igmp.xmit); + return ip4_output_if_opt(p, src, dest, IGMP_TTL, 0, IP_PROTO_IGMP, netif, ra, ROUTER_ALERTLEN); +} + +/** + * Send an igmp packet to a specific group. + * + * @param group the group to which to send the packet + * @param type the type of igmp packet to send + */ +static void +igmp_send(struct netif *netif, struct igmp_group *group, u8_t type) +{ + struct pbuf* p = NULL; + struct igmp_msg* igmp = NULL; + ip4_addr_t src = *IP4_ADDR_ANY4; + ip4_addr_t* dest = NULL; + + /* IP header + "router alert" option + IGMP header */ + p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM); + + if (p) { + igmp = (struct igmp_msg *)p->payload; + LWIP_ASSERT("igmp_send: check that first pbuf can hold struct igmp_msg", + (p->len >= sizeof(struct igmp_msg))); + ip4_addr_copy(src, *netif_ip4_addr(netif)); + + if (type == IGMP_V2_MEMB_REPORT) { + dest = &(group->group_address); + ip4_addr_copy(igmp->igmp_group_address, group->group_address); + group->last_reporter_flag = 1; /* Remember we were the last to report */ + } else { + if (type == IGMP_LEAVE_GROUP) { + dest = &allrouters; + ip4_addr_copy(igmp->igmp_group_address, group->group_address); + } + } + + if ((type == IGMP_V2_MEMB_REPORT) || (type == IGMP_LEAVE_GROUP)) { + igmp->igmp_msgtype = type; + igmp->igmp_maxresp = 0; + igmp->igmp_checksum = 0; + igmp->igmp_checksum = inet_chksum(igmp, IGMP_MINLEN); + + igmp_ip_output_if(p, &src, dest, netif); + } + + pbuf_free(p); + } else { + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_send: not enough memory for igmp_send\n")); + IGMP_STATS_INC(igmp.memerr); + } +} + +#endif /* LWIP_IPV4 && LWIP_IGMP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4.c new file mode 100644 index 0000000..4e4eb61 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4.c @@ -0,0 +1,1086 @@ +/** + * @file + * This is the IPv4 layer implementation for incoming and outgoing IP traffic. + * + * @see ip_frag.c + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 + +#include "lwip/ip.h" +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/ip4_frag.h" +#include "lwip/inet_chksum.h" +#include "lwip/netif.h" +#include "lwip/icmp.h" +#include "lwip/igmp.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/autoip.h" +#include "lwip/stats.h" +#include "lwip/prot/dhcp.h" + +#include + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +/** Set this to 0 in the rare case of wanting to call an extra function to + * generate the IP checksum (in contrast to calculating it on-the-fly). */ +#ifndef LWIP_INLINE_IP_CHKSUM +#if LWIP_CHECKSUM_CTRL_PER_NETIF +#define LWIP_INLINE_IP_CHKSUM 0 +#else /* LWIP_CHECKSUM_CTRL_PER_NETIF */ +#define LWIP_INLINE_IP_CHKSUM 1 +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ +#endif + +#if LWIP_INLINE_IP_CHKSUM && CHECKSUM_GEN_IP +#define CHECKSUM_GEN_IP_INLINE 1 +#else +#define CHECKSUM_GEN_IP_INLINE 0 +#endif + +#if LWIP_DHCP || defined(LWIP_IP_ACCEPT_UDP_PORT) +#define IP_ACCEPT_LINK_LAYER_ADDRESSING 1 + +/** Some defines for DHCP to let link-layer-addressed packets through while the + * netif is down. + * To use this in your own application/protocol, define LWIP_IP_ACCEPT_UDP_PORT(port) + * to return 1 if the port is accepted and 0 if the port is not accepted. + */ +#if LWIP_DHCP && defined(LWIP_IP_ACCEPT_UDP_PORT) +/* accept DHCP client port and custom port */ +#define IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(port) (((port) == PP_NTOHS(DHCP_CLIENT_PORT)) \ + || (LWIP_IP_ACCEPT_UDP_PORT(port))) +#elif defined(LWIP_IP_ACCEPT_UDP_PORT) /* LWIP_DHCP && defined(LWIP_IP_ACCEPT_UDP_PORT) */ +/* accept custom port only */ +#define IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(port) (LWIP_IP_ACCEPT_UDP_PORT(port)) +#else /* LWIP_DHCP && defined(LWIP_IP_ACCEPT_UDP_PORT) */ +/* accept DHCP client port only */ +#define IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(port) ((port) == PP_NTOHS(DHCP_CLIENT_PORT)) +#endif /* LWIP_DHCP && defined(LWIP_IP_ACCEPT_UDP_PORT) */ + +#else /* LWIP_DHCP */ +#define IP_ACCEPT_LINK_LAYER_ADDRESSING 0 +#endif /* LWIP_DHCP */ + +/** The IP header ID of the next outgoing IP packet */ +static u16_t ip_id; + +#if LWIP_MULTICAST_TX_OPTIONS +/** The default netif used for multicast */ +static struct netif* ip4_default_multicast_netif; + +/** + * @ingroup ip4 + * Set a default netif for IPv4 multicast. */ +void +ip4_set_default_multicast_netif(struct netif* default_multicast_netif) +{ + ip4_default_multicast_netif = default_multicast_netif; +} +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + +#ifdef LWIP_HOOK_IP4_ROUTE_SRC +/** + * Source based IPv4 routing must be fully implemented in + * LWIP_HOOK_IP4_ROUTE_SRC(). This function only provides he parameters. + */ +struct netif * +ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src) +{ + if (src != NULL) { + /* when src==NULL, the hook is called from ip4_route(dest) */ + struct netif *netif = LWIP_HOOK_IP4_ROUTE_SRC(dest, src); + if (netif != NULL) { + return netif; + } + } + return ip4_route(dest); +} +#endif /* LWIP_HOOK_IP4_ROUTE_SRC */ + +/** + * Finds the appropriate network interface for a given IP address. It + * searches the list of network interfaces linearly. A match is found + * if the masked IP address of the network interface equals the masked + * IP address given to the function. + * + * @param dest the destination IP address for which to find the route + * @return the netif on which to send to reach dest + */ +struct netif * +ip4_route(const ip4_addr_t *dest) +{ + struct netif *netif; + +#if LWIP_MULTICAST_TX_OPTIONS + /* Use administratively selected interface for multicast by default */ + if (ip4_addr_ismulticast(dest) && ip4_default_multicast_netif) { + return ip4_default_multicast_netif; + } +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + + /* iterate through netifs */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + /* is the netif up, does it have a link and a valid address? */ + if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) { + /* network mask matches? */ + if (ip4_addr_netcmp(dest, netif_ip4_addr(netif), netif_ip4_netmask(netif))) { + /* return netif on which to forward IP packet */ + return netif; + } + /* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */ + if (((netif->flags & NETIF_FLAG_BROADCAST) == 0) && ip4_addr_cmp(dest, netif_ip4_gw(netif))) { + /* return netif on which to forward IP packet */ + return netif; + } + } + } + +#if LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF + /* loopif is disabled, looopback traffic is passed through any netif */ + if (ip4_addr_isloopback(dest)) { + /* don't check for link on loopback traffic */ + if (netif_default != NULL && netif_is_up(netif_default)) { + return netif_default; + } + /* default netif is not up, just use any netif for loopback traffic */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (netif_is_up(netif)) { + return netif; + } + } + return NULL; + } +#endif /* LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF */ + +#ifdef LWIP_HOOK_IP4_ROUTE_SRC + netif = LWIP_HOOK_IP4_ROUTE_SRC(dest, NULL); + if (netif != NULL) { + return netif; + } +#elif defined(LWIP_HOOK_IP4_ROUTE) + netif = LWIP_HOOK_IP4_ROUTE(dest); + if (netif != NULL) { + return netif; + } +#endif + + if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default) || + ip4_addr_isany_val(*netif_ip4_addr(netif_default))) { + /* No matching netif found and default netif is not usable. + If this is not good enough for you, use LWIP_HOOK_IP4_ROUTE() */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_route: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest))); + IP_STATS_INC(ip.rterr); + MIB2_STATS_INC(mib2.ipoutnoroutes); + return NULL; + } + + return netif_default; +} + +#if IP_FORWARD +/** + * Determine whether an IP address is in a reserved set of addresses + * that may not be forwarded, or whether datagrams to that destination + * may be forwarded. + * @param p the packet to forward + * @return 1: can forward 0: discard + */ +static int +ip4_canforward(struct pbuf *p) +{ + u32_t addr = lwip_htonl(ip4_addr_get_u32(ip4_current_dest_addr())); + + if (p->flags & PBUF_FLAG_LLBCAST) { + /* don't route link-layer broadcasts */ + return 0; + } + if ((p->flags & PBUF_FLAG_LLMCAST) && !IP_MULTICAST(addr)) { + /* don't route link-layer multicasts unless the destination address is an IP + multicast address */ + return 0; + } + if (IP_EXPERIMENTAL(addr)) { + return 0; + } + if (IP_CLASSA(addr)) { + u32_t net = addr & IP_CLASSA_NET; + if ((net == 0) || (net == ((u32_t)IP_LOOPBACKNET << IP_CLASSA_NSHIFT))) { + /* don't route loopback packets */ + return 0; + } + } + return 1; +} + +/** + * Forwards an IP packet. It finds an appropriate route for the + * packet, decrements the TTL value of the packet, adjusts the + * checksum and outputs the packet on the appropriate interface. + * + * @param p the packet to forward (p->payload points to IP header) + * @param iphdr the IP header of the input packet + * @param inp the netif on which this packet was received + */ +static void +ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) +{ + struct netif *netif; + + PERF_START; + LWIP_UNUSED_ARG(inp); + + if (!ip4_canforward(p)) { + goto return_noroute; + } + + /* RFC3927 2.7: do not forward link-local addresses */ + if (ip4_addr_islinklocal(ip4_current_dest_addr())) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_forward: not forwarding LLA %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(ip4_current_dest_addr()), ip4_addr2_16(ip4_current_dest_addr()), + ip4_addr3_16(ip4_current_dest_addr()), ip4_addr4_16(ip4_current_dest_addr()))); + goto return_noroute; + } + + /* Find network interface where to forward this IP packet to. */ + netif = ip4_route_src(ip4_current_dest_addr(), ip4_current_src_addr()); + if (netif == NULL) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_forward: no forwarding route for %"U16_F".%"U16_F".%"U16_F".%"U16_F" found\n", + ip4_addr1_16(ip4_current_dest_addr()), ip4_addr2_16(ip4_current_dest_addr()), + ip4_addr3_16(ip4_current_dest_addr()), ip4_addr4_16(ip4_current_dest_addr()))); + /* @todo: send ICMP_DUR_NET? */ + goto return_noroute; + } +#if !IP_FORWARD_ALLOW_TX_ON_RX_NETIF + /* Do not forward packets onto the same network interface on which + * they arrived. */ + if (netif == inp) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_forward: not bouncing packets back on incoming interface.\n")); + goto return_noroute; + } +#endif /* IP_FORWARD_ALLOW_TX_ON_RX_NETIF */ + + /* decrement TTL */ + IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); + /* send ICMP if TTL == 0 */ + if (IPH_TTL(iphdr) == 0) { + MIB2_STATS_INC(mib2.ipinhdrerrors); +#if LWIP_ICMP + /* Don't send ICMP messages in response to ICMP messages */ + if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) { + icmp_time_exceeded(p, ICMP_TE_TTL); + } +#endif /* LWIP_ICMP */ + return; + } + + /* Incrementally update the IP checksum. */ + if (IPH_CHKSUM(iphdr) >= PP_HTONS(0xffffU - 0x100)) { + IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1); + } else { + IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100)); + } + + LWIP_DEBUGF(IP_DEBUG, ("ip4_forward: forwarding packet to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(ip4_current_dest_addr()), ip4_addr2_16(ip4_current_dest_addr()), + ip4_addr3_16(ip4_current_dest_addr()), ip4_addr4_16(ip4_current_dest_addr()))); + + IP_STATS_INC(ip.fw); + MIB2_STATS_INC(mib2.ipforwdatagrams); + IP_STATS_INC(ip.xmit); + + PERF_STOP("ip4_forward"); + /* don't fragment if interface has mtu set to 0 [loopif] */ + if (netif->mtu && (p->tot_len > netif->mtu)) { + if ((IPH_OFFSET(iphdr) & PP_NTOHS(IP_DF)) == 0) { +#if IP_FRAG + ip4_frag(p, netif, ip4_current_dest_addr()); +#else /* IP_FRAG */ + /* @todo: send ICMP Destination Unreachable code 13 "Communication administratively prohibited"? */ +#endif /* IP_FRAG */ + } else { +#if LWIP_ICMP + /* send ICMP Destination Unreachable code 4: "Fragmentation Needed and DF Set" */ + icmp_dest_unreach(p, ICMP_DUR_FRAG); +#endif /* LWIP_ICMP */ + } + return; + } + /* transmit pbuf on chosen interface */ + netif->output(netif, p, ip4_current_dest_addr()); + return; +return_noroute: + MIB2_STATS_INC(mib2.ipoutnoroutes); +} +#endif /* IP_FORWARD */ + +/** + * This function is called by the network interface device driver when + * an IP packet is received. The function does the basic checks of the + * IP header such as packet size being at least larger than the header + * size etc. If the packet was not destined for us, the packet is + * forwarded (using ip_forward). The IP checksum is always checked. + * + * Finally, the packet is sent to the upper layer protocol input function. + * + * @param p the received IP packet (p->payload points to IP header) + * @param inp the netif on which this packet was received + * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't + * processed, but currently always returns ERR_OK) + */ +err_t +ip4_input(struct pbuf *p, struct netif *inp) +{ + struct ip_hdr *iphdr; + struct netif *netif; + u16_t iphdr_hlen; + u16_t iphdr_len; +#if IP_ACCEPT_LINK_LAYER_ADDRESSING || LWIP_IGMP + int check_ip_src = 1; +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING || LWIP_IGMP */ + + IP_STATS_INC(ip.recv); + MIB2_STATS_INC(mib2.ipinreceives); + + /* identify the IP header */ + iphdr = (struct ip_hdr *)p->payload; + if (IPH_V(iphdr) != 4) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IP packet dropped due to bad version number %"U16_F"\n", (u16_t)IPH_V(iphdr))); + ip4_debug_print(p); + pbuf_free(p); + IP_STATS_INC(ip.err); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinhdrerrors); + return ERR_OK; + } + +#ifdef LWIP_HOOK_IP4_INPUT + if (LWIP_HOOK_IP4_INPUT(p, inp)) { + /* the packet has been eaten */ + return ERR_OK; + } +#endif + + /* obtain IP header length in number of 32-bit words */ + iphdr_hlen = IPH_HL(iphdr); + /* calculate IP header length in bytes */ + iphdr_hlen *= 4; + /* obtain ip length in bytes */ + iphdr_len = lwip_ntohs(IPH_LEN(iphdr)); + + /* Trim pbuf. This is especially required for packets < 60 bytes. */ + if (iphdr_len < p->tot_len) { + pbuf_realloc(p, iphdr_len); + } + + /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */ + if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len) || (iphdr_hlen < IP_HLEN)) { + if (iphdr_hlen < IP_HLEN) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("ip4_input: short IP header (%"U16_F" bytes) received, IP packet dropped\n", iphdr_hlen)); + } + if (iphdr_hlen > p->len) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IP header (len %"U16_F") does not fit in first pbuf (len %"U16_F"), IP packet dropped.\n", + iphdr_hlen, p->len)); + } + if (iphdr_len > p->tot_len) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n", + iphdr_len, p->tot_len)); + } + /* free (drop) packet pbufs */ + pbuf_free(p); + IP_STATS_INC(ip.lenerr); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipindiscards); + return ERR_OK; + } + + /* verify checksum */ +#if CHECKSUM_CHECK_IP + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_CHECK_IP) { + if (inet_chksum(iphdr, iphdr_hlen) != 0) { + + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("Checksum (0x%"X16_F") failed, IP packet dropped.\n", inet_chksum(iphdr, iphdr_hlen))); + ip4_debug_print(p); + pbuf_free(p); + IP_STATS_INC(ip.chkerr); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinhdrerrors); + return ERR_OK; + } + } +#endif + + /* copy IP addresses to aligned ip_addr_t */ + ip_addr_copy_from_ip4(ip_data.current_iphdr_dest, iphdr->dest); + ip_addr_copy_from_ip4(ip_data.current_iphdr_src, iphdr->src); + + /* match packet against an interface, i.e. is this packet for us? */ + if (ip4_addr_ismulticast(ip4_current_dest_addr())) { +#if LWIP_IGMP + if ((inp->flags & NETIF_FLAG_IGMP) && (igmp_lookfor_group(inp, ip4_current_dest_addr()))) { + /* IGMP snooping switches need 0.0.0.0 to be allowed as source address (RFC 4541) */ + ip4_addr_t allsystems; + IP4_ADDR(&allsystems, 224, 0, 0, 1); + if (ip4_addr_cmp(ip4_current_dest_addr(), &allsystems) && + ip4_addr_isany(ip4_current_src_addr())) { + check_ip_src = 0; + } + netif = inp; + } else { + netif = NULL; + } +#else /* LWIP_IGMP */ + if ((netif_is_up(inp)) && (!ip4_addr_isany_val(*netif_ip4_addr(inp)))) { + netif = inp; + } else { + netif = NULL; + } +#endif /* LWIP_IGMP */ + } else { + /* start trying with inp. if that's not acceptable, start walking the + list of configured netifs. + 'first' is used as a boolean to mark whether we started walking the list */ + int first = 1; + netif = inp; + do { + LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest 0x%"X32_F" netif->ip_addr 0x%"X32_F" (0x%"X32_F", 0x%"X32_F", 0x%"X32_F")\n", + ip4_addr_get_u32(&iphdr->dest), ip4_addr_get_u32(netif_ip4_addr(netif)), + ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(netif_ip4_netmask(netif)), + ip4_addr_get_u32(netif_ip4_addr(netif)) & ip4_addr_get_u32(netif_ip4_netmask(netif)), + ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(netif_ip4_netmask(netif)))); + + /* interface is up and configured? */ + if ((netif_is_up(netif)) && (!ip4_addr_isany_val(*netif_ip4_addr(netif)))) { + /* unicast to this interface address? */ + if (ip4_addr_cmp(ip4_current_dest_addr(), netif_ip4_addr(netif)) || + /* or broadcast on this interface network address? */ + ip4_addr_isbroadcast(ip4_current_dest_addr(), netif) +#if LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF + || (ip4_addr_get_u32(ip4_current_dest_addr()) == PP_HTONL(IPADDR_LOOPBACK)) +#endif /* LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF */ + ) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: packet accepted on interface %c%c\n", + netif->name[0], netif->name[1])); + /* break out of for loop */ + break; + } +#if LWIP_AUTOIP + /* connections to link-local addresses must persist after changing + the netif's address (RFC3927 ch. 1.9) */ + if (autoip_accept_packet(netif, ip4_current_dest_addr())) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: LLA packet accepted on interface %c%c\n", + netif->name[0], netif->name[1])); + /* break out of for loop */ + break; + } +#endif /* LWIP_AUTOIP */ + } + if (first) { +#if !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF + /* Packets sent to the loopback address must not be accepted on an + * interface that does not have the loopback address assigned to it, + * unless a non-loopback interface is used for loopback traffic. */ + if (ip4_addr_isloopback(ip4_current_dest_addr())) { + netif = NULL; + break; + } +#endif /* !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF */ + first = 0; + netif = netif_list; + } else { + netif = netif->next; + } + if (netif == inp) { + netif = netif->next; + } + } while (netif != NULL); + } + +#if IP_ACCEPT_LINK_LAYER_ADDRESSING + /* Pass DHCP messages regardless of destination address. DHCP traffic is addressed + * using link layer addressing (such as Ethernet MAC) so we must not filter on IP. + * According to RFC 1542 section 3.1.1, referred by RFC 2131). + * + * If you want to accept private broadcast communication while a netif is down, + * define LWIP_IP_ACCEPT_UDP_PORT(dst_port), e.g.: + * + * #define LWIP_IP_ACCEPT_UDP_PORT(dst_port) ((dst_port) == PP_NTOHS(12345)) + */ + if (netif == NULL) { + /* remote port is DHCP server? */ + if (IPH_PROTO(iphdr) == IP_PROTO_UDP) { + struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + iphdr_hlen); + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip4_input: UDP packet to DHCP client port %"U16_F"\n", + lwip_ntohs(udphdr->dest))); + if (IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(udphdr->dest)) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip4_input: DHCP packet accepted.\n")); + netif = inp; + check_ip_src = 0; + } + } + } +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */ + + /* broadcast or multicast packet source address? Compliant with RFC 1122: 3.2.1.3 */ +#if LWIP_IGMP || IP_ACCEPT_LINK_LAYER_ADDRESSING + if (check_ip_src +#if IP_ACCEPT_LINK_LAYER_ADDRESSING + /* DHCP servers need 0.0.0.0 to be allowed as source address (RFC 1.1.2.2: 3.2.1.3/a) */ + && !ip4_addr_isany_val(*ip4_current_src_addr()) +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */ + ) +#endif /* LWIP_IGMP || IP_ACCEPT_LINK_LAYER_ADDRESSING */ + { + if ((ip4_addr_isbroadcast(ip4_current_src_addr(), inp)) || + (ip4_addr_ismulticast(ip4_current_src_addr()))) { + /* packet source is not valid */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, ("ip4_input: packet source is not valid.\n")); + /* free (drop) packet pbufs */ + pbuf_free(p); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinaddrerrors); + MIB2_STATS_INC(mib2.ipindiscards); + return ERR_OK; + } + } + + /* packet not for us? */ + if (netif == NULL) { + /* packet not for us, route or discard */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_TRACE, ("ip4_input: packet not for us.\n")); +#if IP_FORWARD + /* non-broadcast packet? */ + if (!ip4_addr_isbroadcast(ip4_current_dest_addr(), inp)) { + /* try to forward IP packet on (other) interfaces */ + ip4_forward(p, iphdr, inp); + } else +#endif /* IP_FORWARD */ + { + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinaddrerrors); + MIB2_STATS_INC(mib2.ipindiscards); + } + pbuf_free(p); + return ERR_OK; + } + /* packet consists of multiple fragments? */ + if ((IPH_OFFSET(iphdr) & PP_HTONS(IP_OFFMASK | IP_MF)) != 0) { +#if IP_REASSEMBLY /* packet fragment reassembly code present? */ + LWIP_DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04"X16_F" tot_len=%"U16_F" len=%"U16_F" MF=%"U16_F" offset=%"U16_F"), calling ip4_reass()\n", + lwip_ntohs(IPH_ID(iphdr)), p->tot_len, lwip_ntohs(IPH_LEN(iphdr)), (u16_t)!!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), (u16_t)((lwip_ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)*8))); + /* reassemble the packet*/ + p = ip4_reass(p); + /* packet not fully reassembled yet? */ + if (p == NULL) { + return ERR_OK; + } + iphdr = (struct ip_hdr *)p->payload; +#else /* IP_REASSEMBLY == 0, no packet fragment reassembly code present */ + pbuf_free(p); + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("IP packet dropped since it was fragmented (0x%"X16_F") (while IP_REASSEMBLY == 0).\n", + lwip_ntohs(IPH_OFFSET(iphdr)))); + IP_STATS_INC(ip.opterr); + IP_STATS_INC(ip.drop); + /* unsupported protocol feature */ + MIB2_STATS_INC(mib2.ipinunknownprotos); + return ERR_OK; +#endif /* IP_REASSEMBLY */ + } + +#if IP_OPTIONS_ALLOWED == 0 /* no support for IP options in the IP header? */ + +#if LWIP_IGMP + /* there is an extra "router alert" option in IGMP messages which we allow for but do not police */ + if ((iphdr_hlen > IP_HLEN) && (IPH_PROTO(iphdr) != IP_PROTO_IGMP)) { +#else + if (iphdr_hlen > IP_HLEN) { +#endif /* LWIP_IGMP */ + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("IP packet dropped since there were IP options (while IP_OPTIONS_ALLOWED == 0).\n")); + pbuf_free(p); + IP_STATS_INC(ip.opterr); + IP_STATS_INC(ip.drop); + /* unsupported protocol feature */ + MIB2_STATS_INC(mib2.ipinunknownprotos); + return ERR_OK; + } +#endif /* IP_OPTIONS_ALLOWED == 0 */ + + /* send to upper layers */ + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: \n")); + ip4_debug_print(p); + LWIP_DEBUGF(IP_DEBUG, ("ip4_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len)); + + ip_data.current_netif = netif; + ip_data.current_input_netif = inp; + ip_data.current_ip4_header = iphdr; + ip_data.current_ip_header_tot_len = IPH_HL(iphdr) * 4; + +#if LWIP_RAW + /* raw input did not eat the packet? */ + if (raw_input(p, inp) == 0) +#endif /* LWIP_RAW */ + { + pbuf_header(p, -(s16_t)iphdr_hlen); /* Move to payload, no check necessary. */ + + switch (IPH_PROTO(iphdr)) { +#if LWIP_UDP + case IP_PROTO_UDP: +#if LWIP_UDPLITE + case IP_PROTO_UDPLITE: +#endif /* LWIP_UDPLITE */ + MIB2_STATS_INC(mib2.ipindelivers); + udp_input(p, inp); + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case IP_PROTO_TCP: + MIB2_STATS_INC(mib2.ipindelivers); + tcp_input(p, inp); + break; +#endif /* LWIP_TCP */ +#if LWIP_ICMP + case IP_PROTO_ICMP: + MIB2_STATS_INC(mib2.ipindelivers); + icmp_input(p, inp); + break; +#endif /* LWIP_ICMP */ +#if LWIP_IGMP + case IP_PROTO_IGMP: + igmp_input(p, inp, ip4_current_dest_addr()); + break; +#endif /* LWIP_IGMP */ + default: +#if LWIP_ICMP + /* send ICMP destination protocol unreachable unless is was a broadcast */ + if (!ip4_addr_isbroadcast(ip4_current_dest_addr(), netif) && + !ip4_addr_ismulticast(ip4_current_dest_addr())) { + pbuf_header_force(p, iphdr_hlen); /* Move to ip header, no check necessary. */ + p->payload = iphdr; + icmp_dest_unreach(p, ICMP_DUR_PROTO); + } +#endif /* LWIP_ICMP */ + pbuf_free(p); + + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("Unsupported transport protocol %"U16_F"\n", (u16_t)IPH_PROTO(iphdr))); + + IP_STATS_INC(ip.proterr); + IP_STATS_INC(ip.drop); + MIB2_STATS_INC(mib2.ipinunknownprotos); + } + } + + /* @todo: this is not really necessary... */ + ip_data.current_netif = NULL; + ip_data.current_input_netif = NULL; + ip_data.current_ip4_header = NULL; + ip_data.current_ip_header_tot_len = 0; + ip4_addr_set_any(ip4_current_src_addr()); + ip4_addr_set_any(ip4_current_dest_addr()); + + return ERR_OK; +} + +/** + * Sends an IP packet on a network interface. This function constructs + * the IP header and calculates the IP header checksum. If the source + * IP address is NULL, the IP address of the outgoing network + * interface is filled in as source address. + * If the destination IP address is LWIP_IP_HDRINCL, p is assumed to already + * include an IP header and p->payload points to it instead of the data. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) + * @param src the source IP address to send from (if src == IP4_ADDR_ANY, the + * IP address of the netif used to send is used as source address) + * @param dest the destination IP address to send the packet to + * @param ttl the TTL value to be set in the IP header + * @param tos the TOS value to be set in the IP header + * @param proto the PROTOCOL to be set in the IP header + * @param netif the netif on which to send this packet + * @return ERR_OK if the packet was sent OK + * ERR_BUF if p doesn't have enough space for IP/LINK headers + * returns errors returned by netif->output + * + * @note ip_id: RFC791 "some host may be able to simply use + * unique identifiers independent of destination" + */ +err_t +ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, + u8_t proto, struct netif *netif) +{ +#if IP_OPTIONS_SEND + return ip4_output_if_opt(p, src, dest, ttl, tos, proto, netif, NULL, 0); +} + +/** + * Same as ip_output_if() but with the possibility to include IP options: + * + * @ param ip_options pointer to the IP options, copied into the IP header + * @ param optlen length of ip_options + */ +err_t +ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, + u16_t optlen) +{ +#endif /* IP_OPTIONS_SEND */ + const ip4_addr_t *src_used = src; + if (dest != LWIP_IP_HDRINCL) { + if (ip4_addr_isany(src)) { + src_used = netif_ip4_addr(netif); + } + } + +#if IP_OPTIONS_SEND + return ip4_output_if_opt_src(p, src_used, dest, ttl, tos, proto, netif, + ip_options, optlen); +#else /* IP_OPTIONS_SEND */ + return ip4_output_if_src(p, src_used, dest, ttl, tos, proto, netif); +#endif /* IP_OPTIONS_SEND */ +} + +/** + * Same as ip_output_if() but 'src' address is not replaced by netif address + * when it is 'any'. + */ +err_t +ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, + u8_t proto, struct netif *netif) +{ +#if IP_OPTIONS_SEND + return ip4_output_if_opt_src(p, src, dest, ttl, tos, proto, netif, NULL, 0); +} + +/** + * Same as ip_output_if_opt() but 'src' address is not replaced by netif address + * when it is 'any'. + */ +err_t +ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, + u16_t optlen) +{ +#endif /* IP_OPTIONS_SEND */ + struct ip_hdr *iphdr; + ip4_addr_t dest_addr; +#if CHECKSUM_GEN_IP_INLINE + u32_t chk_sum = 0; +#endif /* CHECKSUM_GEN_IP_INLINE */ + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + MIB2_STATS_INC(mib2.ipoutrequests); + + /* Should the IP header be generated or is it already included in p? */ + if (dest != LWIP_IP_HDRINCL) { + u16_t ip_hlen = IP_HLEN; +#if IP_OPTIONS_SEND + u16_t optlen_aligned = 0; + if (optlen != 0) { +#if CHECKSUM_GEN_IP_INLINE + int i; +#endif /* CHECKSUM_GEN_IP_INLINE */ + /* round up to a multiple of 4 */ + optlen_aligned = ((optlen + 3) & ~3); + ip_hlen += optlen_aligned; + /* First write in the IP options */ + if (pbuf_header(p, optlen_aligned)) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_output_if_opt: not enough room for IP options in pbuf\n")); + IP_STATS_INC(ip.err); + MIB2_STATS_INC(mib2.ipoutdiscards); + return ERR_BUF; + } + MEMCPY(p->payload, ip_options, optlen); + if (optlen < optlen_aligned) { + /* zero the remaining bytes */ + memset(((char*)p->payload) + optlen, 0, optlen_aligned - optlen); + } +#if CHECKSUM_GEN_IP_INLINE + for (i = 0; i < optlen_aligned/2; i++) { + chk_sum += ((u16_t*)p->payload)[i]; + } +#endif /* CHECKSUM_GEN_IP_INLINE */ + } +#endif /* IP_OPTIONS_SEND */ + /* generate IP header */ + if (pbuf_header(p, IP_HLEN)) { + LWIP_DEBUGF(IP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip4_output: not enough room for IP header in pbuf\n")); + + IP_STATS_INC(ip.err); + MIB2_STATS_INC(mib2.ipoutdiscards); + return ERR_BUF; + } + + iphdr = (struct ip_hdr *)p->payload; + LWIP_ASSERT("check that first pbuf can hold struct ip_hdr", + (p->len >= sizeof(struct ip_hdr))); + + IPH_TTL_SET(iphdr, ttl); + IPH_PROTO_SET(iphdr, proto); +#if CHECKSUM_GEN_IP_INLINE + chk_sum += PP_NTOHS(proto | (ttl << 8)); +#endif /* CHECKSUM_GEN_IP_INLINE */ + + /* dest cannot be NULL here */ + ip4_addr_copy(iphdr->dest, *dest); +#if CHECKSUM_GEN_IP_INLINE + chk_sum += ip4_addr_get_u32(&iphdr->dest) & 0xFFFF; + chk_sum += ip4_addr_get_u32(&iphdr->dest) >> 16; +#endif /* CHECKSUM_GEN_IP_INLINE */ + + IPH_VHL_SET(iphdr, 4, ip_hlen / 4); + IPH_TOS_SET(iphdr, tos); +#if CHECKSUM_GEN_IP_INLINE + chk_sum += PP_NTOHS(tos | (iphdr->_v_hl << 8)); +#endif /* CHECKSUM_GEN_IP_INLINE */ + IPH_LEN_SET(iphdr, lwip_htons(p->tot_len)); +#if CHECKSUM_GEN_IP_INLINE + chk_sum += iphdr->_len; +#endif /* CHECKSUM_GEN_IP_INLINE */ + IPH_OFFSET_SET(iphdr, 0); + IPH_ID_SET(iphdr, lwip_htons(ip_id)); +#if CHECKSUM_GEN_IP_INLINE + chk_sum += iphdr->_id; +#endif /* CHECKSUM_GEN_IP_INLINE */ + ++ip_id; + + if (src == NULL) { + ip4_addr_copy(iphdr->src, *IP4_ADDR_ANY4); + } else { + /* src cannot be NULL here */ + ip4_addr_copy(iphdr->src, *src); + } + +#if CHECKSUM_GEN_IP_INLINE + chk_sum += ip4_addr_get_u32(&iphdr->src) & 0xFFFF; + chk_sum += ip4_addr_get_u32(&iphdr->src) >> 16; + chk_sum = (chk_sum >> 16) + (chk_sum & 0xFFFF); + chk_sum = (chk_sum >> 16) + chk_sum; + chk_sum = ~chk_sum; + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP) { + iphdr->_chksum = (u16_t)chk_sum; /* network order */ + } +#if LWIP_CHECKSUM_CTRL_PER_NETIF + else { + IPH_CHKSUM_SET(iphdr, 0); + } +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/ +#else /* CHECKSUM_GEN_IP_INLINE */ + IPH_CHKSUM_SET(iphdr, 0); +#if CHECKSUM_GEN_IP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP) { + IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, ip_hlen)); + } +#endif /* CHECKSUM_GEN_IP */ +#endif /* CHECKSUM_GEN_IP_INLINE */ + } else { + /* IP header already included in p */ + iphdr = (struct ip_hdr *)p->payload; + ip4_addr_copy(dest_addr, iphdr->dest); + dest = &dest_addr; + } + + IP_STATS_INC(ip.xmit); + + LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num)); + ip4_debug_print(p); + +#if ENABLE_LOOPBACK + if (ip4_addr_cmp(dest, netif_ip4_addr(netif)) +#if !LWIP_HAVE_LOOPIF + || ip4_addr_isloopback(dest) +#endif /* !LWIP_HAVE_LOOPIF */ + ) { + /* Packet to self, enqueue it for loopback */ + LWIP_DEBUGF(IP_DEBUG, ("netif_loop_output()")); + return netif_loop_output(netif, p); + } +#if LWIP_MULTICAST_TX_OPTIONS + if ((p->flags & PBUF_FLAG_MCASTLOOP) != 0) { + netif_loop_output(netif, p); + } +#endif /* LWIP_MULTICAST_TX_OPTIONS */ +#endif /* ENABLE_LOOPBACK */ +#if IP_FRAG + /* don't fragment if interface has mtu set to 0 [loopif] */ + if (netif->mtu && (p->tot_len > netif->mtu)) { + return ip4_frag(p, netif, dest); + } +#endif /* IP_FRAG */ + + LWIP_DEBUGF(IP_DEBUG, ("ip4_output_if: call netif->output()\n")); + return netif->output(netif, p, dest); +} + +/** + * Simple interface to ip_output_if. It finds the outgoing network + * interface and calls upon ip_output_if to do the actual work. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) + * @param src the source IP address to send from (if src == IP4_ADDR_ANY, the + * IP address of the netif used to send is used as source address) + * @param dest the destination IP address to send the packet to + * @param ttl the TTL value to be set in the IP header + * @param tos the TOS value to be set in the IP header + * @param proto the PROTOCOL to be set in the IP header + * + * @return ERR_RTE if no route is found + * see ip_output_if() for more return values + */ +err_t +ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto) +{ + struct netif *netif; + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + if ((netif = ip4_route_src(dest, src)) == NULL) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest))); + IP_STATS_INC(ip.rterr); + return ERR_RTE; + } + + return ip4_output_if(p, src, dest, ttl, tos, proto, netif); +} + +#if LWIP_NETIF_HWADDRHINT +/** Like ip_output, but takes and addr_hint pointer that is passed on to netif->addr_hint + * before calling ip_output_if. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IP header and p->payload points to that IP header) + * @param src the source IP address to send from (if src == IP4_ADDR_ANY, the + * IP address of the netif used to send is used as source address) + * @param dest the destination IP address to send the packet to + * @param ttl the TTL value to be set in the IP header + * @param tos the TOS value to be set in the IP header + * @param proto the PROTOCOL to be set in the IP header + * @param addr_hint address hint pointer set to netif->addr_hint before + * calling ip_output_if() + * + * @return ERR_RTE if no route is found + * see ip_output_if() for more return values + */ +err_t +ip4_output_hinted(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint) +{ + struct netif *netif; + err_t err; + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + if ((netif = ip4_route_src(dest, src)) == NULL) { + LWIP_DEBUGF(IP_DEBUG, ("ip4_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest))); + IP_STATS_INC(ip.rterr); + return ERR_RTE; + } + + NETIF_SET_HWADDRHINT(netif, addr_hint); + err = ip4_output_if(p, src, dest, ttl, tos, proto, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + + return err; +} +#endif /* LWIP_NETIF_HWADDRHINT*/ + +#if IP_DEBUG +/* Print an IP header by using LWIP_DEBUGF + * @param p an IP packet, p->payload pointing to the IP header + */ +void +ip4_debug_print(struct pbuf *p) +{ + struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; + + LWIP_DEBUGF(IP_DEBUG, ("IP header:\n")); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP_DEBUG, ("|%2"S16_F" |%2"S16_F" | 0x%02"X16_F" | %5"U16_F" | (v, hl, tos, len)\n", + (u16_t)IPH_V(iphdr), + (u16_t)IPH_HL(iphdr), + (u16_t)IPH_TOS(iphdr), + lwip_ntohs(IPH_LEN(iphdr)))); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP_DEBUG, ("| %5"U16_F" |%"U16_F"%"U16_F"%"U16_F"| %4"U16_F" | (id, flags, offset)\n", + lwip_ntohs(IPH_ID(iphdr)), + (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) >> 15 & 1), + (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) >> 14 & 1), + (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) >> 13 & 1), + (u16_t)(lwip_ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK))); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | 0x%04"X16_F" | (ttl, proto, chksum)\n", + (u16_t)IPH_TTL(iphdr), + (u16_t)IPH_PROTO(iphdr), + lwip_ntohs(IPH_CHKSUM(iphdr)))); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | %3"U16_F" | %3"U16_F" | (src)\n", + ip4_addr1_16(&iphdr->src), + ip4_addr2_16(&iphdr->src), + ip4_addr3_16(&iphdr->src), + ip4_addr4_16(&iphdr->src))); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP_DEBUG, ("| %3"U16_F" | %3"U16_F" | %3"U16_F" | %3"U16_F" | (dest)\n", + ip4_addr1_16(&iphdr->dest), + ip4_addr2_16(&iphdr->dest), + ip4_addr3_16(&iphdr->dest), + ip4_addr4_16(&iphdr->dest))); + LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); +} +#endif /* IP_DEBUG */ + +#endif /* LWIP_IPV4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_addr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_addr.c new file mode 100644 index 0000000..2d47992 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_addr.c @@ -0,0 +1,331 @@ +/** + * @file + * This is the IPv4 address tools implementation. + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 + +#include "lwip/ip_addr.h" +#include "lwip/netif.h" + +/* used by IP4_ADDR_ANY and IP_ADDR_BROADCAST in ip_addr.h */ +const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY); +const ip_addr_t ip_addr_broadcast = IPADDR4_INIT(IPADDR_BROADCAST); + +/** + * Determine if an address is a broadcast address on a network interface + * + * @param addr address to be checked + * @param netif the network interface against which the address is checked + * @return returns non-zero if the address is a broadcast address + */ +u8_t +ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif) +{ + ip4_addr_t ipaddr; + ip4_addr_set_u32(&ipaddr, addr); + + /* all ones (broadcast) or all zeroes (old skool broadcast) */ + if ((~addr == IPADDR_ANY) || + (addr == IPADDR_ANY)) { + return 1; + /* no broadcast support on this network interface? */ + } else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) { + /* the given address cannot be a broadcast address + * nor can we check against any broadcast addresses */ + return 0; + /* address matches network interface address exactly? => no broadcast */ + } else if (addr == ip4_addr_get_u32(netif_ip4_addr(netif))) { + return 0; + /* on the same (sub) network... */ + } else if (ip4_addr_netcmp(&ipaddr, netif_ip4_addr(netif), netif_ip4_netmask(netif)) + /* ...and host identifier bits are all ones? =>... */ + && ((addr & ~ip4_addr_get_u32(netif_ip4_netmask(netif))) == + (IPADDR_BROADCAST & ~ip4_addr_get_u32(netif_ip4_netmask(netif))))) { + /* => network broadcast address */ + return 1; + } else { + return 0; + } +} + +/** Checks if a netmask is valid (starting with ones, then only zeros) + * + * @param netmask the IPv4 netmask to check (in network byte order!) + * @return 1 if the netmask is valid, 0 if it is not + */ +u8_t +ip4_addr_netmask_valid(u32_t netmask) +{ + u32_t mask; + u32_t nm_hostorder = lwip_htonl(netmask); + + /* first, check for the first zero */ + for (mask = 1UL << 31 ; mask != 0; mask >>= 1) { + if ((nm_hostorder & mask) == 0) { + break; + } + } + /* then check that there is no one */ + for (; mask != 0; mask >>= 1) { + if ((nm_hostorder & mask) != 0) { + /* there is a one after the first zero -> invalid */ + return 0; + } + } + /* no one after the first zero -> valid */ + return 1; +} + +/* Here for now until needed in other places in lwIP */ +#ifndef isprint +#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) +#define isprint(c) in_range(c, 0x20, 0x7f) +#define isdigit(c) in_range(c, '0', '9') +#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) +#define islower(c) in_range(c, 'a', 'z') +#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') +#endif + +/** + * Ascii internet address interpretation routine. + * The value returned is in network order. + * + * @param cp IP address in ascii representation (e.g. "127.0.0.1") + * @return ip address in network order + */ +u32_t +ipaddr_addr(const char *cp) +{ + ip4_addr_t val; + + if (ip4addr_aton(cp, &val)) { + return ip4_addr_get_u32(&val); + } + return (IPADDR_NONE); +} + +/** + * Check whether "cp" is a valid ascii representation + * of an Internet address and convert to a binary address. + * Returns 1 if the address is valid, 0 if not. + * This replaces inet_addr, the return value from which + * cannot distinguish between failure and a local broadcast address. + * + * @param cp IP address in ascii representation (e.g. "127.0.0.1") + * @param addr pointer to which to save the ip address in network order + * @return 1 if cp could be converted to addr, 0 on failure + */ +int +ip4addr_aton(const char *cp, ip4_addr_t *addr) +{ + u32_t val; + u8_t base; + char c; + u32_t parts[4]; + u32_t *pp = parts; + + c = *cp; + for (;;) { + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, 1-9=decimal. + */ + if (!isdigit(c)) { + return 0; + } + val = 0; + base = 10; + if (c == '0') { + c = *++cp; + if (c == 'x' || c == 'X') { + base = 16; + c = *++cp; + } else { + base = 8; + } + } + for (;;) { + if (isdigit(c)) { + val = (val * base) + (u32_t)(c - '0'); + c = *++cp; + } else if (base == 16 && isxdigit(c)) { + val = (val << 4) | (u32_t)(c + 10 - (islower(c) ? 'a' : 'A')); + c = *++cp; + } else { + break; + } + } + if (c == '.') { + /* + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16 bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 3) { + return 0; + } + *pp++ = val; + c = *++cp; + } else { + break; + } + } + /* + * Check for trailing characters. + */ + if (c != '\0' && !isspace(c)) { + return 0; + } + /* + * Concoct the address according to + * the number of parts specified. + */ + switch (pp - parts + 1) { + + case 0: + return 0; /* initial nondigit */ + + case 1: /* a -- 32 bits */ + break; + + case 2: /* a.b -- 8.24 bits */ + if (val > 0xffffffUL) { + return 0; + } + if (parts[0] > 0xff) { + return 0; + } + val |= parts[0] << 24; + break; + + case 3: /* a.b.c -- 8.8.16 bits */ + if (val > 0xffff) { + return 0; + } + if ((parts[0] > 0xff) || (parts[1] > 0xff)) { + return 0; + } + val |= (parts[0] << 24) | (parts[1] << 16); + break; + + case 4: /* a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xff) { + return 0; + } + if ((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff)) { + return 0; + } + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + break; + default: + LWIP_ASSERT("unhandled", 0); + break; + } + if (addr) { + ip4_addr_set_u32(addr, lwip_htonl(val)); + } + return 1; +} + +/** + * Convert numeric IP address into decimal dotted ASCII representation. + * returns ptr to static buffer; not reentrant! + * + * @param addr ip address in network order to convert + * @return pointer to a global static (!) buffer that holds the ASCII + * representation of addr + */ +char* +ip4addr_ntoa(const ip4_addr_t *addr) +{ + static char str[IP4ADDR_STRLEN_MAX]; + return ip4addr_ntoa_r(addr, str, IP4ADDR_STRLEN_MAX); +} + +/** + * Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used. + * + * @param addr ip address in network order to convert + * @param buf target buffer where the string is stored + * @param buflen length of buf + * @return either pointer to buf which now holds the ASCII + * representation of addr or NULL if buf was too small + */ +char* +ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen) +{ + u32_t s_addr; + char inv[3]; + char *rp; + u8_t *ap; + u8_t rem; + u8_t n; + u8_t i; + int len = 0; + + s_addr = ip4_addr_get_u32(addr); + + rp = buf; + ap = (u8_t *)&s_addr; + for (n = 0; n < 4; n++) { + i = 0; + do { + rem = *ap % (u8_t)10; + *ap /= (u8_t)10; + inv[i++] = (char)('0' + rem); + } while (*ap); + while (i--) { + if (len++ >= buflen) { + return NULL; + } + *rp++ = inv[i]; + } + if (len++ >= buflen) { + return NULL; + } + *rp++ = '.'; + ap++; + } + *--rp = 0; + return buf; +} + +#endif /* LWIP_IPV4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_frag.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_frag.c new file mode 100644 index 0000000..57fb44c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv4/ip4_frag.c @@ -0,0 +1,831 @@ +/** + * @file + * This is the IPv4 packet segmentation and reassembly implementation. + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Jani Monoses + * Simon Goldschmidt + * original reassembly code by Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV4 + +#include "lwip/ip4_frag.h" +#include "lwip/def.h" +#include "lwip/inet_chksum.h" +#include "lwip/netif.h" +#include "lwip/stats.h" +#include "lwip/icmp.h" + +#include + +#if IP_REASSEMBLY +/** + * The IP reassembly code currently has the following limitations: + * - IP header options are not supported + * - fragments must not overlap (e.g. due to different routes), + * currently, overlapping or duplicate fragments are thrown away + * if IP_REASS_CHECK_OVERLAP=1 (the default)! + * + * @todo: work with IP header options + */ + +/** Setting this to 0, you can turn off checking the fragments for overlapping + * regions. The code gets a little smaller. Only use this if you know that + * overlapping won't occur on your network! */ +#ifndef IP_REASS_CHECK_OVERLAP +#define IP_REASS_CHECK_OVERLAP 1 +#endif /* IP_REASS_CHECK_OVERLAP */ + +/** Set to 0 to prevent freeing the oldest datagram when the reassembly buffer is + * full (IP_REASS_MAX_PBUFS pbufs are enqueued). The code gets a little smaller. + * Datagrams will be freed by timeout only. Especially useful when MEMP_NUM_REASSDATA + * is set to 1, so one datagram can be reassembled at a time, only. */ +#ifndef IP_REASS_FREE_OLDEST +#define IP_REASS_FREE_OLDEST 1 +#endif /* IP_REASS_FREE_OLDEST */ + +#define IP_REASS_FLAG_LASTFRAG 0x01 + +/** This is a helper struct which holds the starting + * offset and the ending offset of this fragment to + * easily chain the fragments. + * It has the same packing requirements as the IP header, since it replaces + * the IP header in memory in incoming fragments (after copying it) to keep + * track of the various fragments. (-> If the IP header doesn't need packing, + * this struct doesn't need packing, too.) + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip_reass_helper { + PACK_STRUCT_FIELD(struct pbuf *next_pbuf); + PACK_STRUCT_FIELD(u16_t start); + PACK_STRUCT_FIELD(u16_t end); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#define IP_ADDRESSES_AND_ID_MATCH(iphdrA, iphdrB) \ + (ip4_addr_cmp(&(iphdrA)->src, &(iphdrB)->src) && \ + ip4_addr_cmp(&(iphdrA)->dest, &(iphdrB)->dest) && \ + IPH_ID(iphdrA) == IPH_ID(iphdrB)) ? 1 : 0 + +/* global variables */ +static struct ip_reassdata *reassdatagrams; +static u16_t ip_reass_pbufcount; + +/* function prototypes */ +static void ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev); +static int ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev); + +/** + * Reassembly timer base function + * for both NO_SYS == 0 and 1 (!). + * + * Should be called every 1000 msec (defined by IP_TMR_INTERVAL). + */ +void +ip_reass_tmr(void) +{ + struct ip_reassdata *r, *prev = NULL; + + r = reassdatagrams; + while (r != NULL) { + /* Decrement the timer. Once it reaches 0, + * clean up the incomplete fragment assembly */ + if (r->timer > 0) { + r->timer--; + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n",(u16_t)r->timer)); + prev = r; + r = r->next; + } else { + /* reassembly timed out */ + struct ip_reassdata *tmp; + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n")); + tmp = r; + /* get the next pointer before freeing */ + r = r->next; + /* free the helper struct and all enqueued pbufs */ + ip_reass_free_complete_datagram(tmp, prev); + } + } +} + +/** + * Free a datagram (struct ip_reassdata) and all its pbufs. + * Updates the total count of enqueued pbufs (ip_reass_pbufcount), + * SNMP counters and sends an ICMP time exceeded packet. + * + * @param ipr datagram to free + * @param prev the previous datagram in the linked list + * @return the number of pbufs freed + */ +static int +ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) +{ + u16_t pbufs_freed = 0; + u16_t clen; + struct pbuf *p; + struct ip_reass_helper *iprh; + + LWIP_ASSERT("prev != ipr", prev != ipr); + if (prev != NULL) { + LWIP_ASSERT("prev->next == ipr", prev->next == ipr); + } + + MIB2_STATS_INC(mib2.ipreasmfails); +#if LWIP_ICMP + iprh = (struct ip_reass_helper *)ipr->p->payload; + if (iprh->start == 0) { + /* The first fragment was received, send ICMP time exceeded. */ + /* First, de-queue the first pbuf from r->p. */ + p = ipr->p; + ipr->p = iprh->next_pbuf; + /* Then, copy the original header into it. */ + SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); + icmp_time_exceeded(p, ICMP_TE_FRAG); + clen = pbuf_clen(p); + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + pbufs_freed += clen; + pbuf_free(p); + } +#endif /* LWIP_ICMP */ + + /* First, free all received pbufs. The individual pbufs need to be released + separately as they have not yet been chained */ + p = ipr->p; + while (p != NULL) { + struct pbuf *pcur; + iprh = (struct ip_reass_helper *)p->payload; + pcur = p; + /* get the next pointer before freeing */ + p = iprh->next_pbuf; + clen = pbuf_clen(pcur); + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + pbufs_freed += clen; + pbuf_free(pcur); + } + /* Then, unchain the struct ip_reassdata from the list and free it. */ + ip_reass_dequeue_datagram(ipr, prev); + LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= pbufs_freed); + ip_reass_pbufcount -= pbufs_freed; + + return pbufs_freed; +} + +#if IP_REASS_FREE_OLDEST +/** + * Free the oldest datagram to make room for enqueueing new fragments. + * The datagram 'fraghdr' belongs to is not freed! + * + * @param fraghdr IP header of the current fragment + * @param pbufs_needed number of pbufs needed to enqueue + * (used for freeing other datagrams if not enough space) + * @return the number of pbufs freed + */ +static int +ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed) +{ + /* @todo Can't we simply remove the last datagram in the + * linked list behind reassdatagrams? + */ + struct ip_reassdata *r, *oldest, *prev, *oldest_prev; + int pbufs_freed = 0, pbufs_freed_current; + int other_datagrams; + + /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs, + * but don't free the datagram that 'fraghdr' belongs to! */ + do { + oldest = NULL; + prev = NULL; + oldest_prev = NULL; + other_datagrams = 0; + r = reassdatagrams; + while (r != NULL) { + if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) { + /* Not the same datagram as fraghdr */ + other_datagrams++; + if (oldest == NULL) { + oldest = r; + oldest_prev = prev; + } else if (r->timer <= oldest->timer) { + /* older than the previous oldest */ + oldest = r; + oldest_prev = prev; + } + } + if (r->next != NULL) { + prev = r; + } + r = r->next; + } + if (oldest != NULL) { + pbufs_freed_current = ip_reass_free_complete_datagram(oldest, oldest_prev); + pbufs_freed += pbufs_freed_current; + } + } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1)); + return pbufs_freed; +} +#endif /* IP_REASS_FREE_OLDEST */ + +/** + * Enqueues a new fragment into the fragment queue + * @param fraghdr points to the new fragments IP hdr + * @param clen number of pbufs needed to enqueue (used for freeing other datagrams if not enough space) + * @return A pointer to the queue location into which the fragment was enqueued + */ +static struct ip_reassdata* +ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen) +{ + struct ip_reassdata* ipr; +#if ! IP_REASS_FREE_OLDEST + LWIP_UNUSED_ARG(clen); +#endif + + /* No matching previous fragment found, allocate a new reassdata struct */ + ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA); + if (ipr == NULL) { +#if IP_REASS_FREE_OLDEST + if (ip_reass_remove_oldest_datagram(fraghdr, clen) >= clen) { + ipr = (struct ip_reassdata *)memp_malloc(MEMP_REASSDATA); + } + if (ipr == NULL) +#endif /* IP_REASS_FREE_OLDEST */ + { + IPFRAG_STATS_INC(ip_frag.memerr); + LWIP_DEBUGF(IP_REASS_DEBUG,("Failed to alloc reassdata struct\n")); + return NULL; + } + } + memset(ipr, 0, sizeof(struct ip_reassdata)); + ipr->timer = IP_REASS_MAXAGE; + + /* enqueue the new structure to the front of the list */ + ipr->next = reassdatagrams; + reassdatagrams = ipr; + /* copy the ip header for later tests and input */ + /* @todo: no ip options supported? */ + SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); + return ipr; +} + +/** + * Dequeues a datagram from the datagram queue. Doesn't deallocate the pbufs. + * @param ipr points to the queue entry to dequeue + */ +static void +ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) +{ + /* dequeue the reass struct */ + if (reassdatagrams == ipr) { + /* it was the first in the list */ + reassdatagrams = ipr->next; + } else { + /* it wasn't the first, so it must have a valid 'prev' */ + LWIP_ASSERT("sanity check linked list", prev != NULL); + prev->next = ipr->next; + } + + /* now we can free the ip_reassdata struct */ + memp_free(MEMP_REASSDATA, ipr); +} + +/** + * Chain a new pbuf into the pbuf list that composes the datagram. The pbuf list + * will grow over time as new pbufs are rx. + * Also checks that the datagram passes basic continuity checks (if the last + * fragment was received at least once). + * @param ipr points to the reassembly state + * @param new_p points to the pbuf for the current fragment + * @return 0 if invalid, >0 otherwise + */ +static int +ip_reass_chain_frag_into_datagram_and_validate(struct ip_reassdata *ipr, struct pbuf *new_p) +{ + struct ip_reass_helper *iprh, *iprh_tmp, *iprh_prev=NULL; + struct pbuf *q; + u16_t offset, len; + struct ip_hdr *fraghdr; + int valid = 1; + + /* Extract length and fragment offset from current fragment */ + fraghdr = (struct ip_hdr*)new_p->payload; + len = lwip_ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4; + offset = (lwip_ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8; + + /* overwrite the fragment's ip header from the pbuf with our helper struct, + * and setup the embedded helper structure. */ + /* make sure the struct ip_reass_helper fits into the IP header */ + LWIP_ASSERT("sizeof(struct ip_reass_helper) <= IP_HLEN", + sizeof(struct ip_reass_helper) <= IP_HLEN); + iprh = (struct ip_reass_helper*)new_p->payload; + iprh->next_pbuf = NULL; + iprh->start = offset; + iprh->end = offset + len; + + /* Iterate through until we either get to the end of the list (append), + * or we find one with a larger offset (insert). */ + for (q = ipr->p; q != NULL;) { + iprh_tmp = (struct ip_reass_helper*)q->payload; + if (iprh->start < iprh_tmp->start) { + /* the new pbuf should be inserted before this */ + iprh->next_pbuf = q; + if (iprh_prev != NULL) { + /* not the fragment with the lowest offset */ +#if IP_REASS_CHECK_OVERLAP + if ((iprh->start < iprh_prev->end) || (iprh->end > iprh_tmp->start)) { + /* fragment overlaps with previous or following, throw away */ + goto freepbuf; + } +#endif /* IP_REASS_CHECK_OVERLAP */ + iprh_prev->next_pbuf = new_p; + } else { + /* fragment with the lowest offset */ + ipr->p = new_p; + } + break; + } else if (iprh->start == iprh_tmp->start) { + /* received the same datagram twice: no need to keep the datagram */ + goto freepbuf; +#if IP_REASS_CHECK_OVERLAP + } else if (iprh->start < iprh_tmp->end) { + /* overlap: no need to keep the new datagram */ + goto freepbuf; +#endif /* IP_REASS_CHECK_OVERLAP */ + } else { + /* Check if the fragments received so far have no holes. */ + if (iprh_prev != NULL) { + if (iprh_prev->end != iprh_tmp->start) { + /* There is a fragment missing between the current + * and the previous fragment */ + valid = 0; + } + } + } + q = iprh_tmp->next_pbuf; + iprh_prev = iprh_tmp; + } + + /* If q is NULL, then we made it to the end of the list. Determine what to do now */ + if (q == NULL) { + if (iprh_prev != NULL) { + /* this is (for now), the fragment with the highest offset: + * chain it to the last fragment */ +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start); +#endif /* IP_REASS_CHECK_OVERLAP */ + iprh_prev->next_pbuf = new_p; + if (iprh_prev->end != iprh->start) { + valid = 0; + } + } else { +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("no previous fragment, this must be the first fragment!", + ipr->p == NULL); +#endif /* IP_REASS_CHECK_OVERLAP */ + /* this is the first fragment we ever received for this ip datagram */ + ipr->p = new_p; + } + } + + /* At this point, the validation part begins: */ + /* If we already received the last fragment */ + if ((ipr->flags & IP_REASS_FLAG_LASTFRAG) != 0) { + /* and had no holes so far */ + if (valid) { + /* then check if the rest of the fragments is here */ + /* Check if the queue starts with the first datagram */ + if ((ipr->p == NULL) || (((struct ip_reass_helper*)ipr->p->payload)->start != 0)) { + valid = 0; + } else { + /* and check that there are no holes after this datagram */ + iprh_prev = iprh; + q = iprh->next_pbuf; + while (q != NULL) { + iprh = (struct ip_reass_helper*)q->payload; + if (iprh_prev->end != iprh->start) { + valid = 0; + break; + } + iprh_prev = iprh; + q = iprh->next_pbuf; + } + /* if still valid, all fragments are received + * (because to the MF==0 already arrived */ + if (valid) { + LWIP_ASSERT("sanity check", ipr->p != NULL); + LWIP_ASSERT("sanity check", + ((struct ip_reass_helper*)ipr->p->payload) != iprh); + LWIP_ASSERT("validate_datagram:next_pbuf!=NULL", + iprh->next_pbuf == NULL); + LWIP_ASSERT("validate_datagram:datagram end!=datagram len", + iprh->end == ipr->datagram_len); + } + } + } + /* If valid is 0 here, there are some fragments missing in the middle + * (since MF == 0 has already arrived). Such datagrams simply time out if + * no more fragments are received... */ + return valid; + } + /* If we come here, not all fragments were received, yet! */ + return 0; /* not yet valid! */ +#if IP_REASS_CHECK_OVERLAP +freepbuf: + ip_reass_pbufcount -= pbuf_clen(new_p); + pbuf_free(new_p); + return 0; +#endif /* IP_REASS_CHECK_OVERLAP */ +} + +/** + * Reassembles incoming IP fragments into an IP datagram. + * + * @param p points to a pbuf chain of the fragment + * @return NULL if reassembly is incomplete, ? otherwise + */ +struct pbuf * +ip4_reass(struct pbuf *p) +{ + struct pbuf *r; + struct ip_hdr *fraghdr; + struct ip_reassdata *ipr; + struct ip_reass_helper *iprh; + u16_t offset, len, clen; + + IPFRAG_STATS_INC(ip_frag.recv); + MIB2_STATS_INC(mib2.ipreasmreqds); + + fraghdr = (struct ip_hdr*)p->payload; + + if ((IPH_HL(fraghdr) * 4) != IP_HLEN) { + LWIP_DEBUGF(IP_REASS_DEBUG,("ip4_reass: IP options currently not supported!\n")); + IPFRAG_STATS_INC(ip_frag.err); + goto nullreturn; + } + + offset = (lwip_ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8; + len = lwip_ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4; + + /* Check if we are allowed to enqueue more datagrams. */ + clen = pbuf_clen(p); + if ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) { +#if IP_REASS_FREE_OLDEST + if (!ip_reass_remove_oldest_datagram(fraghdr, clen) || + ((ip_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS)) +#endif /* IP_REASS_FREE_OLDEST */ + { + /* No datagram could be freed and still too many pbufs enqueued */ + LWIP_DEBUGF(IP_REASS_DEBUG,("ip4_reass: Overflow condition: pbufct=%d, clen=%d, MAX=%d\n", + ip_reass_pbufcount, clen, IP_REASS_MAX_PBUFS)); + IPFRAG_STATS_INC(ip_frag.memerr); + /* @todo: send ICMP time exceeded here? */ + /* drop this pbuf */ + goto nullreturn; + } + } + + /* Look for the datagram the fragment belongs to in the current datagram queue, + * remembering the previous in the queue for later dequeueing. */ + for (ipr = reassdatagrams; ipr != NULL; ipr = ipr->next) { + /* Check if the incoming fragment matches the one currently present + in the reassembly buffer. If so, we proceed with copying the + fragment into the buffer. */ + if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) { + LWIP_DEBUGF(IP_REASS_DEBUG, ("ip4_reass: matching previous fragment ID=%"X16_F"\n", + lwip_ntohs(IPH_ID(fraghdr)))); + IPFRAG_STATS_INC(ip_frag.cachehit); + break; + } + } + + if (ipr == NULL) { + /* Enqueue a new datagram into the datagram queue */ + ipr = ip_reass_enqueue_new_datagram(fraghdr, clen); + /* Bail if unable to enqueue */ + if (ipr == NULL) { + goto nullreturn; + } + } else { + if (((lwip_ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && + ((lwip_ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { + /* ipr->iphdr is not the header from the first fragment, but fraghdr is + * -> copy fraghdr into ipr->iphdr since we want to have the header + * of the first fragment (for ICMP time exceeded and later, for copying + * all options, if supported)*/ + SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); + } + } + /* Track the current number of pbufs current 'in-flight', in order to limit + the number of fragments that may be enqueued at any one time */ + ip_reass_pbufcount += clen; + + /* At this point, we have either created a new entry or pointing + * to an existing one */ + + /* check for 'no more fragments', and update queue entry*/ + if ((IPH_OFFSET(fraghdr) & PP_NTOHS(IP_MF)) == 0) { + ipr->flags |= IP_REASS_FLAG_LASTFRAG; + ipr->datagram_len = offset + len; + LWIP_DEBUGF(IP_REASS_DEBUG, + ("ip4_reass: last fragment seen, total len %"S16_F"\n", + ipr->datagram_len)); + } + /* find the right place to insert this pbuf */ + /* @todo: trim pbufs if fragments are overlapping */ + if (ip_reass_chain_frag_into_datagram_and_validate(ipr, p)) { + struct ip_reassdata *ipr_prev; + /* the totally last fragment (flag more fragments = 0) was received at least + * once AND all fragments are received */ + ipr->datagram_len += IP_HLEN; + + /* save the second pbuf before copying the header over the pointer */ + r = ((struct ip_reass_helper*)ipr->p->payload)->next_pbuf; + + /* copy the original ip header back to the first pbuf */ + fraghdr = (struct ip_hdr*)(ipr->p->payload); + SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); + IPH_LEN_SET(fraghdr, lwip_htons(ipr->datagram_len)); + IPH_OFFSET_SET(fraghdr, 0); + IPH_CHKSUM_SET(fraghdr, 0); + /* @todo: do we need to set/calculate the correct checksum? */ +#if CHECKSUM_GEN_IP + IF__NETIF_CHECKSUM_ENABLED(ip_current_input_netif(), NETIF_CHECKSUM_GEN_IP) { + IPH_CHKSUM_SET(fraghdr, inet_chksum(fraghdr, IP_HLEN)); + } +#endif /* CHECKSUM_GEN_IP */ + + p = ipr->p; + + /* chain together the pbufs contained within the reass_data list. */ + while (r != NULL) { + iprh = (struct ip_reass_helper*)r->payload; + + /* hide the ip header for every succeeding fragment */ + pbuf_header(r, -IP_HLEN); + pbuf_cat(p, r); + r = iprh->next_pbuf; + } + + /* find the previous entry in the linked list */ + if (ipr == reassdatagrams) { + ipr_prev = NULL; + } else { + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + if (ipr_prev->next == ipr) { + break; + } + } + } + + /* release the sources allocate for the fragment queue entry */ + ip_reass_dequeue_datagram(ipr, ipr_prev); + + /* and adjust the number of pbufs currently queued for reassembly. */ + ip_reass_pbufcount -= pbuf_clen(p); + + MIB2_STATS_INC(mib2.ipreasmoks); + + /* Return the pbuf chain */ + return p; + } + /* the datagram is not (yet?) reassembled completely */ + LWIP_DEBUGF(IP_REASS_DEBUG,("ip_reass_pbufcount: %d out\n", ip_reass_pbufcount)); + return NULL; + +nullreturn: + LWIP_DEBUGF(IP_REASS_DEBUG,("ip4_reass: nullreturn\n")); + IPFRAG_STATS_INC(ip_frag.drop); + pbuf_free(p); + return NULL; +} +#endif /* IP_REASSEMBLY */ + +#if IP_FRAG +#if !LWIP_NETIF_TX_SINGLE_PBUF +/** Allocate a new struct pbuf_custom_ref */ +static struct pbuf_custom_ref* +ip_frag_alloc_pbuf_custom_ref(void) +{ + return (struct pbuf_custom_ref*)memp_malloc(MEMP_FRAG_PBUF); +} + +/** Free a struct pbuf_custom_ref */ +static void +ip_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p) +{ + LWIP_ASSERT("p != NULL", p != NULL); + memp_free(MEMP_FRAG_PBUF, p); +} + +/** Free-callback function to free a 'struct pbuf_custom_ref', called by + * pbuf_free. */ +static void +ipfrag_free_pbuf_custom(struct pbuf *p) +{ + struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref*)p; + LWIP_ASSERT("pcr != NULL", pcr != NULL); + LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p); + if (pcr->original != NULL) { + pbuf_free(pcr->original); + } + ip_frag_free_pbuf_custom_ref(pcr); +} +#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */ + +/** + * Fragment an IP datagram if too large for the netif. + * + * Chop the datagram in MTU sized chunks and send them in order + * by pointing PBUF_REFs into p. + * + * @param p ip packet to send + * @param netif the netif on which to send + * @param dest destination ip address to which to send + * + * @return ERR_OK if sent successfully, err_t otherwise + */ +err_t +ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest) +{ + struct pbuf *rambuf; +#if !LWIP_NETIF_TX_SINGLE_PBUF + struct pbuf *newpbuf; + u16_t newpbuflen = 0; + u16_t left_to_copy; +#endif + struct ip_hdr *original_iphdr; + struct ip_hdr *iphdr; + const u16_t nfb = (netif->mtu - IP_HLEN) / 8; + u16_t left, fragsize; + u16_t ofo; + int last; + u16_t poff = IP_HLEN; + u16_t tmp; + + original_iphdr = (struct ip_hdr *)p->payload; + iphdr = original_iphdr; + LWIP_ERROR("ip4_frag() does not support IP options", IPH_HL(iphdr) * 4 == IP_HLEN, return ERR_VAL); + + /* Save original offset */ + tmp = lwip_ntohs(IPH_OFFSET(iphdr)); + ofo = tmp & IP_OFFMASK; + LWIP_ERROR("ip_frag(): MF already set", (tmp & IP_MF) == 0, return ERR_VAL); + + left = p->tot_len - IP_HLEN; + + while (left) { + /* Fill this fragment */ + fragsize = LWIP_MIN(left, nfb * 8); + +#if LWIP_NETIF_TX_SINGLE_PBUF + rambuf = pbuf_alloc(PBUF_IP, fragsize, PBUF_RAM); + if (rambuf == NULL) { + goto memerr; + } + LWIP_ASSERT("this needs a pbuf in one piece!", + (rambuf->len == rambuf->tot_len) && (rambuf->next == NULL)); + poff += pbuf_copy_partial(p, rambuf->payload, fragsize, poff); + /* make room for the IP header */ + if (pbuf_header(rambuf, IP_HLEN)) { + pbuf_free(rambuf); + goto memerr; + } + /* fill in the IP header */ + SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN); + iphdr = (struct ip_hdr*)rambuf->payload; +#else /* LWIP_NETIF_TX_SINGLE_PBUF */ + /* When not using a static buffer, create a chain of pbufs. + * The first will be a PBUF_RAM holding the link and IP header. + * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged, + * but limited to the size of an mtu. + */ + rambuf = pbuf_alloc(PBUF_LINK, IP_HLEN, PBUF_RAM); + if (rambuf == NULL) { + goto memerr; + } + LWIP_ASSERT("this needs a pbuf in one piece!", + (p->len >= (IP_HLEN))); + SMEMCPY(rambuf->payload, original_iphdr, IP_HLEN); + iphdr = (struct ip_hdr *)rambuf->payload; + + left_to_copy = fragsize; + while (left_to_copy) { + struct pbuf_custom_ref *pcr; + u16_t plen = p->len - poff; + newpbuflen = LWIP_MIN(left_to_copy, plen); + /* Is this pbuf already empty? */ + if (!newpbuflen) { + poff = 0; + p = p->next; + continue; + } + pcr = ip_frag_alloc_pbuf_custom_ref(); + if (pcr == NULL) { + pbuf_free(rambuf); + goto memerr; + } + /* Mirror this pbuf, although we might not need all of it. */ + newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, + (u8_t*)p->payload + poff, newpbuflen); + if (newpbuf == NULL) { + ip_frag_free_pbuf_custom_ref(pcr); + pbuf_free(rambuf); + goto memerr; + } + pbuf_ref(p); + pcr->original = p; + pcr->pc.custom_free_function = ipfrag_free_pbuf_custom; + + /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain + * so that it is removed when pbuf_dechain is later called on rambuf. + */ + pbuf_cat(rambuf, newpbuf); + left_to_copy -= newpbuflen; + if (left_to_copy) { + poff = 0; + p = p->next; + } + } + poff += newpbuflen; +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + + /* Correct header */ + last = (left <= netif->mtu - IP_HLEN); + + /* Set new offset and MF flag */ + tmp = (IP_OFFMASK & (ofo)); + if (!last) { + tmp = tmp | IP_MF; + } + IPH_OFFSET_SET(iphdr, lwip_htons(tmp)); + IPH_LEN_SET(iphdr, lwip_htons(fragsize + IP_HLEN)); + IPH_CHKSUM_SET(iphdr, 0); +#if CHECKSUM_GEN_IP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP) { + IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); + } +#endif /* CHECKSUM_GEN_IP */ + + /* No need for separate header pbuf - we allowed room for it in rambuf + * when allocated. + */ + netif->output(netif, rambuf, dest); + IPFRAG_STATS_INC(ip_frag.xmit); + + /* Unfortunately we can't reuse rambuf - the hardware may still be + * using the buffer. Instead we free it (and the ensuing chain) and + * recreate it next time round the loop. If we're lucky the hardware + * will have already sent the packet, the free will really free, and + * there will be zero memory penalty. + */ + + pbuf_free(rambuf); + left -= fragsize; + ofo += nfb; + } + MIB2_STATS_INC(mib2.ipfragoks); + return ERR_OK; +memerr: + MIB2_STATS_INC(mib2.ipfragfails); + return ERR_MEM; +} +#endif /* IP_FRAG */ + +#endif /* LWIP_IPV4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/dhcp6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/dhcp6.c new file mode 100644 index 0000000..f27a725 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/dhcp6.c @@ -0,0 +1,50 @@ +/** + * @file + * + * DHCPv6. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 && LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip6_addr.h" +#include "lwip/def.h" + + +#endif /* LWIP_IPV6 && LWIP_IPV6_DHCP6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ethip6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ethip6.c new file mode 100644 index 0000000..8f9a91b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ethip6.c @@ -0,0 +1,118 @@ +/** + * @file + * + * Ethernet output for IPv6. Uses ND tables for link-layer addressing. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 && LWIP_ETHERNET + +#include "lwip/ethip6.h" +#include "lwip/nd6.h" +#include "lwip/pbuf.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/inet_chksum.h" +#include "lwip/netif.h" +#include "lwip/icmp6.h" +#include "lwip/prot/ethernet.h" +#include "netif/ethernet.h" + +#include + +/** + * Resolve and fill-in Ethernet address header for outgoing IPv6 packet. + * + * For IPv6 multicast, corresponding Ethernet addresses + * are selected and the packet is transmitted on the link. + * + * For unicast addresses, ask the ND6 module what to do. It will either let us + * send the the packet right away, or queue the packet for later itself, unless + * an error occurs. + * + * @todo anycast addresses + * + * @param netif The lwIP network interface which the IP packet will be sent on. + * @param q The pbuf(s) containing the IP packet to be sent. + * @param ip6addr The IP address of the packet destination. + * + * @return + * - ERR_OK or the return value of @ref nd6_get_next_hop_addr_or_queue. + */ +err_t +ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) +{ + struct eth_addr dest; + const u8_t *hwaddr; + err_t result; + + /* multicast destination IP address? */ + if (ip6_addr_ismulticast(ip6addr)) { + /* Hash IP multicast address to MAC address.*/ + dest.addr[0] = 0x33; + dest.addr[1] = 0x33; + dest.addr[2] = ((const u8_t *)(&(ip6addr->addr[3])))[0]; + dest.addr[3] = ((const u8_t *)(&(ip6addr->addr[3])))[1]; + dest.addr[4] = ((const u8_t *)(&(ip6addr->addr[3])))[2]; + dest.addr[5] = ((const u8_t *)(&(ip6addr->addr[3])))[3]; + + /* Send out. */ + return ethernet_output(netif, q, (const struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6); + } + + /* We have a unicast destination IP address */ + /* @todo anycast? */ + + /* Ask ND6 what to do with the packet. */ + result = nd6_get_next_hop_addr_or_queue(netif, q, ip6addr, &hwaddr); + if (result != ERR_OK) { + return result; + } + + /* If no hardware address is returned, nd6 has queued the packet for later. */ + if (hwaddr == NULL) { + return ERR_OK; + } + + /* Send out the packet using the returned hardware address. */ + SMEMCPY(dest.addr, hwaddr, 6); + return ethernet_output(netif, q, (const struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6); +} + +#endif /* LWIP_IPV6 && LWIP_ETHERNET */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/icmp6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/icmp6.c new file mode 100644 index 0000000..323b69a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/icmp6.c @@ -0,0 +1,350 @@ +/** + * @file + * + * IPv6 version of ICMP, as per RFC 4443. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_ICMP6 && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/icmp6.h" +#include "lwip/prot/icmp6.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/inet_chksum.h" +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/nd6.h" +#include "lwip/mld6.h" +#include "lwip/ip.h" +#include "lwip/stats.h" + +#include + +#ifndef LWIP_ICMP6_DATASIZE +#define LWIP_ICMP6_DATASIZE 8 +#endif +#if LWIP_ICMP6_DATASIZE == 0 +#define LWIP_ICMP6_DATASIZE 8 +#endif + +/* Forward declarations */ +static void icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type); + + +/** + * Process an input ICMPv6 message. Called by ip6_input. + * + * Will generate a reply for echo requests. Other messages are forwarded + * to nd6_input, or mld6_input. + * + * @param p the mld packet, p->payload pointing to the icmpv6 header + * @param inp the netif on which this packet was received + */ +void +icmp6_input(struct pbuf *p, struct netif *inp) +{ + struct icmp6_hdr *icmp6hdr; + struct pbuf *r; + const ip6_addr_t *reply_src; + + ICMP6_STATS_INC(icmp6.recv); + + /* Check that ICMPv6 header fits in payload */ + if (p->len < sizeof(struct icmp6_hdr)) { + /* drop short packets */ + pbuf_free(p); + ICMP6_STATS_INC(icmp6.lenerr); + ICMP6_STATS_INC(icmp6.drop); + return; + } + + icmp6hdr = (struct icmp6_hdr *)p->payload; + +#if CHECKSUM_CHECK_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_CHECK_ICMP6) { + if (ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->tot_len, ip6_current_src_addr(), + ip6_current_dest_addr()) != 0) { + /* Checksum failed */ + pbuf_free(p); + ICMP6_STATS_INC(icmp6.chkerr); + ICMP6_STATS_INC(icmp6.drop); + return; + } + } +#endif /* CHECKSUM_CHECK_ICMP6 */ + + switch (icmp6hdr->type) { + case ICMP6_TYPE_NA: /* Neighbor advertisement */ + case ICMP6_TYPE_NS: /* Neighbor solicitation */ + case ICMP6_TYPE_RA: /* Router advertisement */ + case ICMP6_TYPE_RD: /* Redirect */ + case ICMP6_TYPE_PTB: /* Packet too big */ + nd6_input(p, inp); + return; + break; + case ICMP6_TYPE_RS: +#if LWIP_IPV6_FORWARD + /* @todo implement router functionality */ +#endif + break; +#if LWIP_IPV6_MLD + case ICMP6_TYPE_MLQ: + case ICMP6_TYPE_MLR: + case ICMP6_TYPE_MLD: + mld6_input(p, inp); + return; + break; +#endif + case ICMP6_TYPE_EREQ: +#if !LWIP_MULTICAST_PING + /* multicast destination address? */ + if (ip6_addr_ismulticast(ip6_current_dest_addr())) { + /* drop */ + pbuf_free(p); + ICMP6_STATS_INC(icmp6.drop); + return; + } +#endif /* LWIP_MULTICAST_PING */ + + /* Allocate reply. */ + r = pbuf_alloc(PBUF_IP, p->tot_len, PBUF_RAM); + if (r == NULL) { + /* drop */ + pbuf_free(p); + ICMP6_STATS_INC(icmp6.memerr); + return; + } + + /* Copy echo request. */ + if (pbuf_copy(r, p) != ERR_OK) { + /* drop */ + pbuf_free(p); + pbuf_free(r); + ICMP6_STATS_INC(icmp6.err); + return; + } + + /* Determine reply source IPv6 address. */ +#if LWIP_MULTICAST_PING + if (ip6_addr_ismulticast(ip6_current_dest_addr())) { + reply_src = ip_2_ip6(ip6_select_source_address(inp, ip6_current_src_addr())); + if (reply_src == NULL) { + /* drop */ + pbuf_free(p); + pbuf_free(r); + ICMP6_STATS_INC(icmp6.rterr); + return; + } + } + else +#endif /* LWIP_MULTICAST_PING */ + { + reply_src = ip6_current_dest_addr(); + } + + /* Set fields in reply. */ + ((struct icmp6_echo_hdr *)(r->payload))->type = ICMP6_TYPE_EREP; + ((struct icmp6_echo_hdr *)(r->payload))->chksum = 0; +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_GEN_ICMP6) { + ((struct icmp6_echo_hdr *)(r->payload))->chksum = ip6_chksum_pseudo(r, + IP6_NEXTH_ICMP6, r->tot_len, reply_src, ip6_current_src_addr()); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + /* Send reply. */ + ICMP6_STATS_INC(icmp6.xmit); + ip6_output_if(r, reply_src, ip6_current_src_addr(), + LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, inp); + pbuf_free(r); + + break; + default: + ICMP6_STATS_INC(icmp6.proterr); + ICMP6_STATS_INC(icmp6.drop); + break; + } + + pbuf_free(p); +} + + +/** + * Send an icmpv6 'destination unreachable' packet. + * + * @param p the input packet for which the 'unreachable' should be sent, + * p->payload pointing to the IPv6 header + * @param c ICMPv6 code for the unreachable type + */ +void +icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c) +{ + icmp6_send_response(p, c, 0, ICMP6_TYPE_DUR); +} + +/** + * Send an icmpv6 'packet too big' packet. + * + * @param p the input packet for which the 'packet too big' should be sent, + * p->payload pointing to the IPv6 header + * @param mtu the maximum mtu that we can accept + */ +void +icmp6_packet_too_big(struct pbuf *p, u32_t mtu) +{ + icmp6_send_response(p, 0, mtu, ICMP6_TYPE_PTB); +} + +/** + * Send an icmpv6 'time exceeded' packet. + * + * @param p the input packet for which the 'unreachable' should be sent, + * p->payload pointing to the IPv6 header + * @param c ICMPv6 code for the time exceeded type + */ +void +icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c) +{ + icmp6_send_response(p, c, 0, ICMP6_TYPE_TE); +} + +/** + * Send an icmpv6 'parameter problem' packet. + * + * @param p the input packet for which the 'param problem' should be sent, + * p->payload pointing to the IP header + * @param c ICMPv6 code for the param problem type + * @param pointer the pointer to the byte where the parameter is found + */ +void +icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, u32_t pointer) +{ + icmp6_send_response(p, c, pointer, ICMP6_TYPE_PP); +} + +/** + * Send an ICMPv6 packet in response to an incoming packet. + * + * @param p the input packet for which the response should be sent, + * p->payload pointing to the IPv6 header + * @param code Code of the ICMPv6 header + * @param data Additional 32-bit parameter in the ICMPv6 header + * @param type Type of the ICMPv6 header + */ +static void +icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type) +{ + struct pbuf *q; + struct icmp6_hdr *icmp6hdr; + const ip6_addr_t *reply_src; + ip6_addr_t *reply_dest; + ip6_addr_t reply_src_local, reply_dest_local; + struct ip6_hdr *ip6hdr; + struct netif *netif; + + /* ICMPv6 header + IPv6 header + data */ + q = pbuf_alloc(PBUF_IP, sizeof(struct icmp6_hdr) + IP6_HLEN + LWIP_ICMP6_DATASIZE, + PBUF_RAM); + if (q == NULL) { + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded: failed to allocate pbuf for ICMPv6 packet.\n")); + ICMP6_STATS_INC(icmp6.memerr); + return; + } + LWIP_ASSERT("check that first pbuf can hold icmp 6message", + (q->len >= (sizeof(struct icmp6_hdr) + IP6_HLEN + LWIP_ICMP6_DATASIZE))); + + icmp6hdr = (struct icmp6_hdr *)q->payload; + icmp6hdr->type = type; + icmp6hdr->code = code; + icmp6hdr->data = data; + + /* copy fields from original packet */ + SMEMCPY((u8_t *)q->payload + sizeof(struct icmp6_hdr), (u8_t *)p->payload, + IP6_HLEN + LWIP_ICMP6_DATASIZE); + + /* Get the destination address and netif for this ICMP message. */ + if ((ip_current_netif() == NULL) || + ((code == ICMP6_TE_FRAG) && (type == ICMP6_TYPE_TE))) { + /* Special case, as ip6_current_xxx is either NULL, or points + * to a different packet than the one that expired. + * We must use the addresses that are stored in the expired packet. */ + ip6hdr = (struct ip6_hdr *)p->payload; + /* copy from packed address to aligned address */ + ip6_addr_copy(reply_dest_local, ip6hdr->src); + ip6_addr_copy(reply_src_local, ip6hdr->dest); + reply_dest = &reply_dest_local; + reply_src = &reply_src_local; + netif = ip6_route(reply_src, reply_dest); + if (netif == NULL) { + /* drop */ + pbuf_free(q); + ICMP6_STATS_INC(icmp6.rterr); + return; + } + } + else { + netif = ip_current_netif(); + reply_dest = ip6_current_src_addr(); + + /* Select an address to use as source. */ + reply_src = ip_2_ip6(ip6_select_source_address(netif, reply_dest)); + if (reply_src == NULL) { + /* drop */ + pbuf_free(q); + ICMP6_STATS_INC(icmp6.rterr); + return; + } + } + + /* calculate checksum */ + icmp6hdr->chksum = 0; +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) { + icmp6hdr->chksum = ip6_chksum_pseudo(q, IP6_NEXTH_ICMP6, q->tot_len, + reply_src, reply_dest); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + ICMP6_STATS_INC(icmp6.xmit); + ip6_output_if(q, reply_src, reply_dest, LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif); + pbuf_free(q); +} + +#endif /* LWIP_ICMP6 && LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/inet6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/inet6.c new file mode 100644 index 0000000..d9a992c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/inet6.c @@ -0,0 +1,53 @@ +/** + * @file + * + * INET v6 addresses. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 && LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/inet.h" + +/** This variable is initialized by the system to contain the wildcard IPv6 address. + */ +const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; + +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6.c new file mode 100644 index 0000000..f14e334 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6.c @@ -0,0 +1,1122 @@ +/** + * @file + * + * IPv6 layer. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/netif.h" +#include "lwip/ip.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/ip6_frag.h" +#include "lwip/icmp6.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/dhcp6.h" +#include "lwip/nd6.h" +#include "lwip/mld6.h" +#include "lwip/debug.h" +#include "lwip/stats.h" + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +/** + * Finds the appropriate network interface for a given IPv6 address. It tries to select + * a netif following a sequence of heuristics: + * 1) if there is only 1 netif, return it + * 2) if the destination is a link-local address, try to match the src address to a netif. + * this is a tricky case because with multiple netifs, link-local addresses only have + * meaning within a particular subnet/link. + * 3) tries to match the destination subnet to a configured address + * 4) tries to find a router + * 5) tries to match the source address to the netif + * 6) returns the default netif, if configured + * + * @param src the source IPv6 address, if known + * @param dest the destination IPv6 address for which to find the route + * @return the netif on which to send to reach dest + */ +struct netif * +ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest) +{ + struct netif *netif; + s8_t i; + + /* If single netif configuration, fast return. */ + if ((netif_list != NULL) && (netif_list->next == NULL)) { + if (!netif_is_up(netif_list) || !netif_is_link_up(netif_list)) { + return NULL; + } + return netif_list; + } + + /* Special processing for link-local addresses. */ + if (ip6_addr_islinklocal(dest)) { + if (ip6_addr_isany(src)) { + /* Use default netif, if Up. */ + if (netif_default == NULL || !netif_is_up(netif_default) || + !netif_is_link_up(netif_default)) { + return NULL; + } + return netif_default; + } + + /* Try to find the netif for the source address, checking that link is up. */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (!netif_is_up(netif) || !netif_is_link_up(netif)) { + continue; + } + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_cmp(src, netif_ip6_addr(netif, i))) { + return netif; + } + } + } + + /* netif not found, use default netif, if up */ + if (netif_default == NULL || !netif_is_up(netif_default) || + !netif_is_link_up(netif_default)) { + return NULL; + } + return netif_default; + } + + /* we come here for non-link-local addresses */ +#ifdef LWIP_HOOK_IP6_ROUTE + netif = LWIP_HOOK_IP6_ROUTE(src, dest); + if (netif != NULL) { + return netif; + } +#endif + + /* See if the destination subnet matches a configured address. */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (!netif_is_up(netif) || !netif_is_link_up(netif)) { + continue; + } + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_netcmp(dest, netif_ip6_addr(netif, i))) { + return netif; + } + } + } + + /* Get the netif for a suitable router. */ + netif = nd6_find_route(dest); + if ((netif != NULL) && netif_is_up(netif) && netif_is_link_up(netif)) { + return netif; + } + + /* try with the netif that matches the source address. */ + if (!ip6_addr_isany(src)) { + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (!netif_is_up(netif) || !netif_is_link_up(netif)) { + continue; + } + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_cmp(src, netif_ip6_addr(netif, i))) { + return netif; + } + } + } + } + +#if LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF + /* loopif is disabled, loopback traffic is passed through any netif */ + if (ip6_addr_isloopback(dest)) { + /* don't check for link on loopback traffic */ + if (netif_default != NULL && netif_is_up(netif_default)) { + return netif_default; + } + /* default netif is not up, just use any netif for loopback traffic */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (netif_is_up(netif)) { + return netif; + } + } + return NULL; + } +#endif /* LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF */ + + /* no matching netif found, use default netif, if up */ + if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default)) { + return NULL; + } + return netif_default; +} + +/** + * @ingroup ip6 + * Select the best IPv6 source address for a given destination + * IPv6 address. Loosely follows RFC 3484. "Strong host" behavior + * is assumed. + * + * @param netif the netif on which to send a packet + * @param dest the destination we are trying to reach + * @return the most suitable source address to use, or NULL if no suitable + * source address is found + */ +const ip_addr_t * +ip6_select_source_address(struct netif *netif, const ip6_addr_t *dest) +{ + const ip_addr_t *src = NULL; + u8_t i; + + /* If dest is link-local, choose a link-local source. */ + if (ip6_addr_islinklocal(dest) || ip6_addr_ismulticast_linklocal(dest) || ip6_addr_ismulticast_iflocal(dest)) { + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_islinklocal(netif_ip6_addr(netif, i))) { + return netif_ip_addr6(netif, i); + } + } + } + + /* Choose a site-local with matching prefix. */ + if (ip6_addr_issitelocal(dest) || ip6_addr_ismulticast_sitelocal(dest)) { + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_issitelocal(netif_ip6_addr(netif, i)) && + ip6_addr_netcmp(dest, netif_ip6_addr(netif, i))) { + return netif_ip_addr6(netif, i); + } + } + } + + /* Choose a unique-local with matching prefix. */ + if (ip6_addr_isuniquelocal(dest) || ip6_addr_ismulticast_orglocal(dest)) { + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_isuniquelocal(netif_ip6_addr(netif, i)) && + ip6_addr_netcmp(dest, netif_ip6_addr(netif, i))) { + return netif_ip_addr6(netif, i); + } + } + } + + /* Choose a global with best matching prefix. */ + if (ip6_addr_isglobal(dest) || ip6_addr_ismulticast_global(dest)) { + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_isglobal(netif_ip6_addr(netif, i))) { + if (src == NULL) { + src = netif_ip_addr6(netif, i); + } + else { + /* Replace src only if we find a prefix match. */ + /* @todo find longest matching prefix. */ + if ((!(ip6_addr_netcmp(ip_2_ip6(src), dest))) && + ip6_addr_netcmp(netif_ip6_addr(netif, i), dest)) { + src = netif_ip_addr6(netif, i); + } + } + } + } + if (src != NULL) { + return src; + } + } + + /* Last resort: see if arbitrary prefix matches. */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_netcmp(dest, netif_ip6_addr(netif, i))) { + return netif_ip_addr6(netif, i); + } + } + + return NULL; +} + +#if LWIP_IPV6_FORWARD +/** + * Forwards an IPv6 packet. It finds an appropriate route for the + * packet, decrements the HL value of the packet, and outputs + * the packet on the appropriate interface. + * + * @param p the packet to forward (p->payload points to IP header) + * @param iphdr the IPv6 header of the input packet + * @param inp the netif on which this packet was received + */ +static void +ip6_forward(struct pbuf *p, struct ip6_hdr *iphdr, struct netif *inp) +{ + struct netif *netif; + + /* do not forward link-local or loopback addresses */ + if (ip6_addr_islinklocal(ip6_current_dest_addr()) || + ip6_addr_isloopback(ip6_current_dest_addr())) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_forward: not forwarding link-local address.\n")); + IP6_STATS_INC(ip6.rterr); + IP6_STATS_INC(ip6.drop); + return; + } + + /* Find network interface where to forward this IP packet to. */ + netif = ip6_route(IP6_ADDR_ANY6, ip6_current_dest_addr()); + if (netif == NULL) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_forward: no route for %"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F"\n", + IP6_ADDR_BLOCK1(ip6_current_dest_addr()), + IP6_ADDR_BLOCK2(ip6_current_dest_addr()), + IP6_ADDR_BLOCK3(ip6_current_dest_addr()), + IP6_ADDR_BLOCK4(ip6_current_dest_addr()), + IP6_ADDR_BLOCK5(ip6_current_dest_addr()), + IP6_ADDR_BLOCK6(ip6_current_dest_addr()), + IP6_ADDR_BLOCK7(ip6_current_dest_addr()), + IP6_ADDR_BLOCK8(ip6_current_dest_addr()))); +#if LWIP_ICMP6 + /* Don't send ICMP messages in response to ICMP messages */ + if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) { + icmp6_dest_unreach(p, ICMP6_DUR_NO_ROUTE); + } +#endif /* LWIP_ICMP6 */ + IP6_STATS_INC(ip6.rterr); + IP6_STATS_INC(ip6.drop); + return; + } + /* Do not forward packets onto the same network interface on which + * they arrived. */ + if (netif == inp) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_forward: not bouncing packets back on incoming interface.\n")); + IP6_STATS_INC(ip6.rterr); + IP6_STATS_INC(ip6.drop); + return; + } + + /* decrement HL */ + IP6H_HOPLIM_SET(iphdr, IP6H_HOPLIM(iphdr) - 1); + /* send ICMP6 if HL == 0 */ + if (IP6H_HOPLIM(iphdr) == 0) { +#if LWIP_ICMP6 + /* Don't send ICMP messages in response to ICMP messages */ + if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) { + icmp6_time_exceeded(p, ICMP6_TE_HL); + } +#endif /* LWIP_ICMP6 */ + IP6_STATS_INC(ip6.drop); + return; + } + + if (netif->mtu && (p->tot_len > netif->mtu)) { +#if LWIP_ICMP6 + /* Don't send ICMP messages in response to ICMP messages */ + if (IP6H_NEXTH(iphdr) != IP6_NEXTH_ICMP6) { + icmp6_packet_too_big(p, netif->mtu); + } +#endif /* LWIP_ICMP6 */ + IP6_STATS_INC(ip6.drop); + return; + } + + LWIP_DEBUGF(IP6_DEBUG, ("ip6_forward: forwarding packet to %"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F"\n", + IP6_ADDR_BLOCK1(ip6_current_dest_addr()), + IP6_ADDR_BLOCK2(ip6_current_dest_addr()), + IP6_ADDR_BLOCK3(ip6_current_dest_addr()), + IP6_ADDR_BLOCK4(ip6_current_dest_addr()), + IP6_ADDR_BLOCK5(ip6_current_dest_addr()), + IP6_ADDR_BLOCK6(ip6_current_dest_addr()), + IP6_ADDR_BLOCK7(ip6_current_dest_addr()), + IP6_ADDR_BLOCK8(ip6_current_dest_addr()))); + + /* transmit pbuf on chosen interface */ + netif->output_ip6(netif, p, ip6_current_dest_addr()); + IP6_STATS_INC(ip6.fw); + IP6_STATS_INC(ip6.xmit); + return; +} +#endif /* LWIP_IPV6_FORWARD */ + +/** + * This function is called by the network interface device driver when + * an IPv6 packet is received. The function does the basic checks of the + * IP header such as packet size being at least larger than the header + * size etc. If the packet was not destined for us, the packet is + * forwarded (using ip6_forward). + * + * Finally, the packet is sent to the upper layer protocol input function. + * + * @param p the received IPv6 packet (p->payload points to IPv6 header) + * @param inp the netif on which this packet was received + * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't + * processed, but currently always returns ERR_OK) + */ +err_t +ip6_input(struct pbuf *p, struct netif *inp) +{ + struct ip6_hdr *ip6hdr; + struct netif *netif; + u8_t nexth; + u16_t hlen; /* the current header length */ + u8_t i; +#if 0 /*IP_ACCEPT_LINK_LAYER_ADDRESSING*/ + @todo + int check_ip_src=1; +#endif /* IP_ACCEPT_LINK_LAYER_ADDRESSING */ + + IP6_STATS_INC(ip6.recv); + + /* identify the IP header */ + ip6hdr = (struct ip6_hdr *)p->payload; + if (IP6H_V(ip6hdr) != 6) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_WARNING, ("IPv6 packet dropped due to bad version number %"U32_F"\n", + IP6H_V(ip6hdr))); + pbuf_free(p); + IP6_STATS_INC(ip6.err); + IP6_STATS_INC(ip6.drop); + return ERR_OK; + } + +#ifdef LWIP_HOOK_IP6_INPUT + if (LWIP_HOOK_IP6_INPUT(p, inp)) { + /* the packet has been eaten */ + return ERR_OK; + } +#endif + + /* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */ + if ((IP6_HLEN > p->len) || ((IP6H_PLEN(ip6hdr) + IP6_HLEN) > p->tot_len)) { + if (IP6_HLEN > p->len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 header (len %"U16_F") does not fit in first pbuf (len %"U16_F"), IP packet dropped.\n", + (u16_t)IP6_HLEN, p->len)); + } + if ((IP6H_PLEN(ip6hdr) + IP6_HLEN) > p->tot_len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 (plen %"U16_F") is longer than pbuf (len %"U16_F"), IP packet dropped.\n", + (u16_t)(IP6H_PLEN(ip6hdr) + IP6_HLEN), p->tot_len)); + } + /* free (drop) packet pbufs */ + pbuf_free(p); + IP6_STATS_INC(ip6.lenerr); + IP6_STATS_INC(ip6.drop); + return ERR_OK; + } + + /* Trim pbuf. This should have been done at the netif layer, + * but we'll do it anyway just to be sure that its done. */ + pbuf_realloc(p, IP6_HLEN + IP6H_PLEN(ip6hdr)); + + /* copy IP addresses to aligned ip6_addr_t */ + ip_addr_copy_from_ip6(ip_data.current_iphdr_dest, ip6hdr->dest); + ip_addr_copy_from_ip6(ip_data.current_iphdr_src, ip6hdr->src); + + /* Don't accept virtual IPv4 mapped IPv6 addresses. + * Don't accept multicast source addresses. */ + if (ip6_addr_isipv4mappedipv6(ip_2_ip6(&ip_data.current_iphdr_dest)) || + ip6_addr_isipv4mappedipv6(ip_2_ip6(&ip_data.current_iphdr_src)) || + ip6_addr_ismulticast(ip_2_ip6(&ip_data.current_iphdr_src))) { + IP6_STATS_INC(ip6.err); + IP6_STATS_INC(ip6.drop); + return ERR_OK; + } + + /* current header pointer. */ + ip_data.current_ip6_header = ip6hdr; + + /* In netif, used in case we need to send ICMPv6 packets back. */ + ip_data.current_netif = inp; + ip_data.current_input_netif = inp; + + /* match packet against an interface, i.e. is this packet for us? */ + if (ip6_addr_ismulticast(ip6_current_dest_addr())) { + /* Always joined to multicast if-local and link-local all-nodes group. */ + if (ip6_addr_isallnodes_iflocal(ip6_current_dest_addr()) || + ip6_addr_isallnodes_linklocal(ip6_current_dest_addr())) { + netif = inp; + } +#if LWIP_IPV6_MLD + else if (mld6_lookfor_group(inp, ip6_current_dest_addr())) { + netif = inp; + } +#else /* LWIP_IPV6_MLD */ + else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) { + /* Filter solicited node packets when MLD is not enabled + * (for Neighbor discovery). */ + netif = NULL; + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(inp, i)) && + ip6_addr_cmp_solicitednode(ip6_current_dest_addr(), netif_ip6_addr(inp, i))) { + netif = inp; + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: solicited node packet accepted on interface %c%c\n", + netif->name[0], netif->name[1])); + break; + } + } + } +#endif /* LWIP_IPV6_MLD */ + else { + netif = NULL; + } + } else { + /* start trying with inp. if that's not acceptable, start walking the + list of configured netifs. + 'first' is used as a boolean to mark whether we started walking the list */ + int first = 1; + netif = inp; + do { + /* interface is up? */ + if (netif_is_up(netif)) { + /* unicast to this interface address? address configured? */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_cmp(ip6_current_dest_addr(), netif_ip6_addr(netif, i))) { + /* exit outer loop */ + goto netif_found; + } + } + } + if (first) { + if (ip6_addr_islinklocal(ip6_current_dest_addr()) +#if !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF + || ip6_addr_isloopback(ip6_current_dest_addr()) +#endif /* !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF */ + ) { + /* Do not match link-local addresses to other netifs. The loopback + * address is to be considered link-local and packets to it should be + * dropped on other interfaces, as per RFC 4291 Sec. 2.5.3. This + * requirement cannot be implemented in the case that loopback + * traffic is sent across a non-loopback interface, however. + */ + netif = NULL; + break; + } + first = 0; + netif = netif_list; + } else { + netif = netif->next; + } + if (netif == inp) { + netif = netif->next; + } + } while (netif != NULL); +netif_found: + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet accepted on interface %c%c\n", + netif ? netif->name[0] : 'X', netif? netif->name[1] : 'X')); + } + + /* "::" packet source address? (used in duplicate address detection) */ + if (ip6_addr_isany(ip6_current_src_addr()) && + (!ip6_addr_issolicitednode(ip6_current_dest_addr()))) { + /* packet source is not valid */ + /* free (drop) packet pbufs */ + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with src ANY_ADDRESS dropped\n")); + pbuf_free(p); + IP6_STATS_INC(ip6.drop); + goto ip6_input_cleanup; + } + + /* packet not for us? */ + if (netif == NULL) { + /* packet not for us, route or discard */ + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_TRACE, ("ip6_input: packet not for us.\n")); +#if LWIP_IPV6_FORWARD + /* non-multicast packet? */ + if (!ip6_addr_ismulticast(ip6_current_dest_addr())) { + /* try to forward IP packet on (other) interfaces */ + ip6_forward(p, ip6hdr, inp); + } +#endif /* LWIP_IPV6_FORWARD */ + pbuf_free(p); + goto ip6_input_cleanup; + } + + /* current netif pointer. */ + ip_data.current_netif = netif; + + /* Save next header type. */ + nexth = IP6H_NEXTH(ip6hdr); + + /* Init header length. */ + hlen = ip_data.current_ip_header_tot_len = IP6_HLEN; + + /* Move to payload. */ + pbuf_header(p, -IP6_HLEN); + + /* Process known option extension headers, if present. */ + while (nexth != IP6_NEXTH_NONE) + { + switch (nexth) { + case IP6_NEXTH_HOPBYHOP: + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with Hop-by-Hop options header\n")); + /* Get next header type. */ + nexth = *((u8_t *)p->payload); + + /* Get the header length. */ + hlen = 8 * (1 + *((u8_t *)p->payload + 1)); + ip_data.current_ip_header_tot_len += hlen; + + /* Skip over this header. */ + if (hlen > p->len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 options header (hlen %"U16_F") does not fit in first pbuf (len %"U16_F"), IPv6 packet dropped.\n", + hlen, p->len)); + /* free (drop) packet pbufs */ + pbuf_free(p); + IP6_STATS_INC(ip6.lenerr); + IP6_STATS_INC(ip6.drop); + goto ip6_input_cleanup; + } + + pbuf_header(p, -(s16_t)hlen); + break; + case IP6_NEXTH_DESTOPTS: + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with Destination options header\n")); + /* Get next header type. */ + nexth = *((u8_t *)p->payload); + + /* Get the header length. */ + hlen = 8 * (1 + *((u8_t *)p->payload + 1)); + ip_data.current_ip_header_tot_len += hlen; + + /* Skip over this header. */ + if (hlen > p->len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 options header (hlen %"U16_F") does not fit in first pbuf (len %"U16_F"), IPv6 packet dropped.\n", + hlen, p->len)); + /* free (drop) packet pbufs */ + pbuf_free(p); + IP6_STATS_INC(ip6.lenerr); + IP6_STATS_INC(ip6.drop); + goto ip6_input_cleanup; + } + + pbuf_header(p, -(s16_t)hlen); + break; + case IP6_NEXTH_ROUTING: + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with Routing header\n")); + /* Get next header type. */ + nexth = *((u8_t *)p->payload); + + /* Get the header length. */ + hlen = 8 * (1 + *((u8_t *)p->payload + 1)); + ip_data.current_ip_header_tot_len += hlen; + + /* Skip over this header. */ + if (hlen > p->len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 options header (hlen %"U16_F") does not fit in first pbuf (len %"U16_F"), IPv6 packet dropped.\n", + hlen, p->len)); + /* free (drop) packet pbufs */ + pbuf_free(p); + IP6_STATS_INC(ip6.lenerr); + IP6_STATS_INC(ip6.drop); + goto ip6_input_cleanup; + } + + pbuf_header(p, -(s16_t)hlen); + break; + + case IP6_NEXTH_FRAGMENT: + { + struct ip6_frag_hdr *frag_hdr; + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with Fragment header\n")); + + frag_hdr = (struct ip6_frag_hdr *)p->payload; + + /* Get next header type. */ + nexth = frag_hdr->_nexth; + + /* Fragment Header length. */ + hlen = 8; + ip_data.current_ip_header_tot_len += hlen; + + /* Make sure this header fits in current pbuf. */ + if (hlen > p->len) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("IPv6 options header (hlen %"U16_F") does not fit in first pbuf (len %"U16_F"), IPv6 packet dropped.\n", + hlen, p->len)); + /* free (drop) packet pbufs */ + pbuf_free(p); + IP6_FRAG_STATS_INC(ip6_frag.lenerr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto ip6_input_cleanup; + } + + /* Offset == 0 and more_fragments == 0? */ + if ((frag_hdr->_fragment_offset & + PP_HTONS(IP6_FRAG_OFFSET_MASK | IP6_FRAG_MORE_FLAG)) == 0) { + /* This is a 1-fragment packet, usually a packet that we have + * already reassembled. Skip this header anc continue. */ + pbuf_header(p, -(s16_t)hlen); + } else { +#if LWIP_IPV6_REASS + + /* reassemble the packet */ + p = ip6_reass(p); + /* packet not fully reassembled yet? */ + if (p == NULL) { + goto ip6_input_cleanup; + } + + /* Returned p point to IPv6 header. + * Update all our variables and pointers and continue. */ + ip6hdr = (struct ip6_hdr *)p->payload; + nexth = IP6H_NEXTH(ip6hdr); + hlen = ip_data.current_ip_header_tot_len = IP6_HLEN; + pbuf_header(p, -IP6_HLEN); + +#else /* LWIP_IPV6_REASS */ + /* free (drop) packet pbufs */ + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet with Fragment header dropped (with LWIP_IPV6_REASS==0)\n")); + pbuf_free(p); + IP6_STATS_INC(ip6.opterr); + IP6_STATS_INC(ip6.drop); + goto ip6_input_cleanup; +#endif /* LWIP_IPV6_REASS */ + } + break; + } + default: + goto options_done; + break; + } + } +options_done: + + /* p points to IPv6 header again. */ + pbuf_header_force(p, (s16_t)ip_data.current_ip_header_tot_len); + + /* send to upper layers */ + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: \n")); + ip6_debug_print(p); + LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len)); + +#if LWIP_RAW + /* raw input did not eat the packet? */ + if (raw_input(p, inp) == 0) +#endif /* LWIP_RAW */ + { + switch (nexth) { + case IP6_NEXTH_NONE: + pbuf_free(p); + break; +#if LWIP_UDP + case IP6_NEXTH_UDP: +#if LWIP_UDPLITE + case IP6_NEXTH_UDPLITE: +#endif /* LWIP_UDPLITE */ + /* Point to payload. */ + pbuf_header(p, -(s16_t)ip_data.current_ip_header_tot_len); + udp_input(p, inp); + break; +#endif /* LWIP_UDP */ +#if LWIP_TCP + case IP6_NEXTH_TCP: + /* Point to payload. */ + pbuf_header(p, -(s16_t)ip_data.current_ip_header_tot_len); + tcp_input(p, inp); + break; +#endif /* LWIP_TCP */ +#if LWIP_ICMP6 + case IP6_NEXTH_ICMP6: + /* Point to payload. */ + pbuf_header(p, -(s16_t)ip_data.current_ip_header_tot_len); + icmp6_input(p, inp); + break; +#endif /* LWIP_ICMP */ + default: +#if LWIP_ICMP6 + /* send ICMP parameter problem unless it was a multicast or ICMPv6 */ + if ((!ip6_addr_ismulticast(ip6_current_dest_addr())) && + (IP6H_NEXTH(ip6hdr) != IP6_NEXTH_ICMP6)) { + icmp6_param_problem(p, ICMP6_PP_HEADER, ip_data.current_ip_header_tot_len - hlen); + } +#endif /* LWIP_ICMP */ + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_input: Unsupported transport protocol %"U16_F"\n", (u16_t)IP6H_NEXTH(ip6hdr))); + pbuf_free(p); + IP6_STATS_INC(ip6.proterr); + IP6_STATS_INC(ip6.drop); + break; + } + } + +ip6_input_cleanup: + ip_data.current_netif = NULL; + ip_data.current_input_netif = NULL; + ip_data.current_ip6_header = NULL; + ip_data.current_ip_header_tot_len = 0; + ip6_addr_set_zero(ip6_current_src_addr()); + ip6_addr_set_zero(ip6_current_dest_addr()); + + return ERR_OK; +} + + +/** + * Sends an IPv6 packet on a network interface. This function constructs + * the IPv6 header. If the source IPv6 address is NULL, the IPv6 "ANY" address is + * used as source (usually during network startup). If the source IPv6 address it + * IP6_ADDR_ANY, the most appropriate IPv6 address of the outgoing network + * interface is filled in as source address. If the destination IPv6 address is + * LWIP_IP_HDRINCL, p is assumed to already include an IPv6 header and + * p->payload points to it instead of the data. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IPv6 header and p->payload points to that IPv6 header) + * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an + * IP address of the netif is selected and used as source address. + * if src == NULL, IP6_ADDR_ANY is used as source) + * @param dest the destination IPv6 address to send the packet to + * @param hl the Hop Limit value to be set in the IPv6 header + * @param tc the Traffic Class value to be set in the IPv6 header + * @param nexth the Next Header to be set in the IPv6 header + * @param netif the netif on which to send this packet + * @return ERR_OK if the packet was sent OK + * ERR_BUF if p doesn't have enough space for IPv6/LINK headers + * returns errors returned by netif->output + */ +err_t +ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, + u8_t nexth, struct netif *netif) +{ + const ip6_addr_t *src_used = src; + if (dest != LWIP_IP_HDRINCL) { + if (src != NULL && ip6_addr_isany(src)) { + src_used = ip_2_ip6(ip6_select_source_address(netif, dest)); + if ((src_used == NULL) || ip6_addr_isany(src_used)) { + /* No appropriate source address was found for this packet. */ + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: No suitable source address for packet.\n")); + IP6_STATS_INC(ip6.rterr); + return ERR_RTE; + } + } + } + return ip6_output_if_src(p, src_used, dest, hl, tc, nexth, netif); +} + +/** + * Same as ip6_output_if() but 'src' address is not replaced by netif address + * when it is 'any'. + */ +err_t +ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, + u8_t nexth, struct netif *netif) +{ + struct ip6_hdr *ip6hdr; + ip6_addr_t dest_addr; + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + /* Should the IPv6 header be generated or is it already included in p? */ + if (dest != LWIP_IP_HDRINCL) { + /* generate IPv6 header */ + if (pbuf_header(p, IP6_HLEN)) { + LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: not enough room for IPv6 header in pbuf\n")); + IP6_STATS_INC(ip6.err); + return ERR_BUF; + } + + ip6hdr = (struct ip6_hdr *)p->payload; + LWIP_ASSERT("check that first pbuf can hold struct ip6_hdr", + (p->len >= sizeof(struct ip6_hdr))); + + IP6H_HOPLIM_SET(ip6hdr, hl); + IP6H_NEXTH_SET(ip6hdr, nexth); + + /* dest cannot be NULL here */ + ip6_addr_copy(ip6hdr->dest, *dest); + + IP6H_VTCFL_SET(ip6hdr, 6, tc, 0); + IP6H_PLEN_SET(ip6hdr, p->tot_len - IP6_HLEN); + + if (src == NULL) { + src = IP6_ADDR_ANY6; + } + /* src cannot be NULL here */ + ip6_addr_copy(ip6hdr->src, *src); + + } else { + /* IP header already included in p */ + ip6hdr = (struct ip6_hdr *)p->payload; + ip6_addr_copy(dest_addr, ip6hdr->dest); + dest = &dest_addr; + } + + IP6_STATS_INC(ip6.xmit); + + LWIP_DEBUGF(IP6_DEBUG, ("ip6_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], (u16_t)netif->num)); + ip6_debug_print(p); + +#if ENABLE_LOOPBACK + { + int i; +#if !LWIP_HAVE_LOOPIF + if (ip6_addr_isloopback(dest)) { + return netif_loop_output(netif, p); + } +#endif /* !LWIP_HAVE_LOOPIF */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_cmp(dest, netif_ip6_addr(netif, i))) { + /* Packet to self, enqueue it for loopback */ + LWIP_DEBUGF(IP6_DEBUG, ("netif_loop_output()\n")); + return netif_loop_output(netif, p); + } + } + } +#endif /* ENABLE_LOOPBACK */ +#if LWIP_IPV6_FRAG + /* don't fragment if interface has mtu set to 0 [loopif] */ + if (netif->mtu && (p->tot_len > nd6_get_destination_mtu(dest, netif))) { + return ip6_frag(p, netif, dest); + } +#endif /* LWIP_IPV6_FRAG */ + + LWIP_DEBUGF(IP6_DEBUG, ("netif->output_ip6()\n")); + return netif->output_ip6(netif, p, dest); +} + +/** + * Simple interface to ip6_output_if. It finds the outgoing network + * interface and calls upon ip6_output_if to do the actual work. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IPv6 header and p->payload points to that IPv6 header) + * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an + * IP address of the netif is selected and used as source address. + * if src == NULL, IP6_ADDR_ANY is used as source) + * @param dest the destination IPv6 address to send the packet to + * @param hl the Hop Limit value to be set in the IPv6 header + * @param tc the Traffic Class value to be set in the IPv6 header + * @param nexth the Next Header to be set in the IPv6 header + * + * @return ERR_RTE if no route is found + * see ip_output_if() for more return values + */ +err_t +ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth) +{ + struct netif *netif; + struct ip6_hdr *ip6hdr; + ip6_addr_t src_addr, dest_addr; + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + if (dest != LWIP_IP_HDRINCL) { + netif = ip6_route(src, dest); + } else { + /* IP header included in p, read addresses. */ + ip6hdr = (struct ip6_hdr *)p->payload; + ip6_addr_copy(src_addr, ip6hdr->src); + ip6_addr_copy(dest_addr, ip6hdr->dest); + netif = ip6_route(&src_addr, &dest_addr); + } + + if (netif == NULL) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_output: no route for %"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F"\n", + IP6_ADDR_BLOCK1(dest), + IP6_ADDR_BLOCK2(dest), + IP6_ADDR_BLOCK3(dest), + IP6_ADDR_BLOCK4(dest), + IP6_ADDR_BLOCK5(dest), + IP6_ADDR_BLOCK6(dest), + IP6_ADDR_BLOCK7(dest), + IP6_ADDR_BLOCK8(dest))); + IP6_STATS_INC(ip6.rterr); + return ERR_RTE; + } + + return ip6_output_if(p, src, dest, hl, tc, nexth, netif); +} + + +#if LWIP_NETIF_HWADDRHINT +/** Like ip6_output, but takes and addr_hint pointer that is passed on to netif->addr_hint + * before calling ip6_output_if. + * + * @param p the packet to send (p->payload points to the data, e.g. next + protocol header; if dest == LWIP_IP_HDRINCL, p already includes an + IPv6 header and p->payload points to that IPv6 header) + * @param src the source IPv6 address to send from (if src == IP6_ADDR_ANY, an + * IP address of the netif is selected and used as source address. + * if src == NULL, IP6_ADDR_ANY is used as source) + * @param dest the destination IPv6 address to send the packet to + * @param hl the Hop Limit value to be set in the IPv6 header + * @param tc the Traffic Class value to be set in the IPv6 header + * @param nexth the Next Header to be set in the IPv6 header + * @param addr_hint address hint pointer set to netif->addr_hint before + * calling ip_output_if() + * + * @return ERR_RTE if no route is found + * see ip_output_if() for more return values + */ +err_t +ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint) +{ + struct netif *netif; + struct ip6_hdr *ip6hdr; + ip6_addr_t src_addr, dest_addr; + err_t err; + + LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p); + + if (dest != LWIP_IP_HDRINCL) { + netif = ip6_route(src, dest); + } else { + /* IP header included in p, read addresses. */ + ip6hdr = (struct ip6_hdr *)p->payload; + ip6_addr_copy(src_addr, ip6hdr->src); + ip6_addr_copy(dest_addr, ip6hdr->dest); + netif = ip6_route(&src_addr, &dest_addr); + } + + if (netif == NULL) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_output: no route for %"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F":%"X16_F"\n", + IP6_ADDR_BLOCK1(dest), + IP6_ADDR_BLOCK2(dest), + IP6_ADDR_BLOCK3(dest), + IP6_ADDR_BLOCK4(dest), + IP6_ADDR_BLOCK5(dest), + IP6_ADDR_BLOCK6(dest), + IP6_ADDR_BLOCK7(dest), + IP6_ADDR_BLOCK8(dest))); + IP6_STATS_INC(ip6.rterr); + return ERR_RTE; + } + + NETIF_SET_HWADDRHINT(netif, addr_hint); + err = ip6_output_if(p, src, dest, hl, tc, nexth, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + + return err; +} +#endif /* LWIP_NETIF_HWADDRHINT*/ + +#if LWIP_IPV6_MLD +/** + * Add a hop-by-hop options header with a router alert option and padding. + * + * Used by MLD when sending a Multicast listener report/done message. + * + * @param p the packet to which we will prepend the options header + * @param nexth the next header protocol number (e.g. IP6_NEXTH_ICMP6) + * @param value the value of the router alert option data (e.g. IP6_ROUTER_ALERT_VALUE_MLD) + * @return ERR_OK if hop-by-hop header was added, ERR_* otherwise + */ +err_t +ip6_options_add_hbh_ra(struct pbuf *p, u8_t nexth, u8_t value) +{ + struct ip6_hbh_hdr *hbh_hdr; + + /* Move pointer to make room for hop-by-hop options header. */ + if (pbuf_header(p, sizeof(struct ip6_hbh_hdr))) { + LWIP_DEBUGF(IP6_DEBUG, ("ip6_options: no space for options header\n")); + IP6_STATS_INC(ip6.err); + return ERR_BUF; + } + + hbh_hdr = (struct ip6_hbh_hdr *)p->payload; + + /* Set fields. */ + hbh_hdr->_nexth = nexth; + hbh_hdr->_hlen = 0; + hbh_hdr->_ra_opt_type = IP6_ROUTER_ALERT_OPTION; + hbh_hdr->_ra_opt_dlen = 2; + hbh_hdr->_ra_opt_data = value; + hbh_hdr->_padn_opt_type = IP6_PADN_ALERT_OPTION; + hbh_hdr->_padn_opt_dlen = 0; + + return ERR_OK; +} +#endif /* LWIP_IPV6_MLD */ + +#if IP6_DEBUG +/* Print an IPv6 header by using LWIP_DEBUGF + * @param p an IPv6 packet, p->payload pointing to the IPv6 header + */ +void +ip6_debug_print(struct pbuf *p) +{ + struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload; + + LWIP_DEBUGF(IP6_DEBUG, ("IPv6 header:\n")); + LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP6_DEBUG, ("| %2"U16_F" | %3"U16_F" | %7"U32_F" | (ver, class, flow)\n", + IP6H_V(ip6hdr), + IP6H_TC(ip6hdr), + IP6H_FL(ip6hdr))); + LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP6_DEBUG, ("| %5"U16_F" | %3"U16_F" | %3"U16_F" | (plen, nexth, hopl)\n", + IP6H_PLEN(ip6hdr), + IP6H_NEXTH(ip6hdr), + IP6H_HOPLIM(ip6hdr))); + LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP6_DEBUG, ("| %4"X32_F" | %4"X32_F" | %4"X32_F" | %4"X32_F" | (src)\n", + IP6_ADDR_BLOCK1(&(ip6hdr->src)), + IP6_ADDR_BLOCK2(&(ip6hdr->src)), + IP6_ADDR_BLOCK3(&(ip6hdr->src)), + IP6_ADDR_BLOCK4(&(ip6hdr->src)))); + LWIP_DEBUGF(IP6_DEBUG, ("| %4"X32_F" | %4"X32_F" | %4"X32_F" | %4"X32_F" |\n", + IP6_ADDR_BLOCK5(&(ip6hdr->src)), + IP6_ADDR_BLOCK6(&(ip6hdr->src)), + IP6_ADDR_BLOCK7(&(ip6hdr->src)), + IP6_ADDR_BLOCK8(&(ip6hdr->src)))); + LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(IP6_DEBUG, ("| %4"X32_F" | %4"X32_F" | %4"X32_F" | %4"X32_F" | (dest)\n", + IP6_ADDR_BLOCK1(&(ip6hdr->dest)), + IP6_ADDR_BLOCK2(&(ip6hdr->dest)), + IP6_ADDR_BLOCK3(&(ip6hdr->dest)), + IP6_ADDR_BLOCK4(&(ip6hdr->dest)))); + LWIP_DEBUGF(IP6_DEBUG, ("| %4"X32_F" | %4"X32_F" | %4"X32_F" | %4"X32_F" |\n", + IP6_ADDR_BLOCK5(&(ip6hdr->dest)), + IP6_ADDR_BLOCK6(&(ip6hdr->dest)), + IP6_ADDR_BLOCK7(&(ip6hdr->dest)), + IP6_ADDR_BLOCK8(&(ip6hdr->dest)))); + LWIP_DEBUGF(IP6_DEBUG, ("+-------------------------------+\n")); +} +#endif /* IP6_DEBUG */ + +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_addr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_addr.c new file mode 100644 index 0000000..aa06659 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_addr.c @@ -0,0 +1,292 @@ +/** + * @file + * + * IPv6 addresses. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * Functions for handling IPv6 addresses. + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip_addr.h" +#include "lwip/def.h" + +/* used by IP6_ADDR_ANY(6) in ip6_addr.h */ +const ip_addr_t ip6_addr_any = IPADDR6_INIT(0ul, 0ul, 0ul, 0ul); + +#ifndef isprint +#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) +#define isprint(c) in_range(c, 0x20, 0x7f) +#define isdigit(c) in_range(c, '0', '9') +#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) +#define islower(c) in_range(c, 'a', 'z') +#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') +#define xchar(i) ((i) < 10 ? '0' + (i) : 'A' + (i) - 10) +#endif + +/** + * Check whether "cp" is a valid ascii representation + * of an IPv6 address and convert to a binary address. + * Returns 1 if the address is valid, 0 if not. + * + * @param cp IPv6 address in ascii representation (e.g. "FF01::1") + * @param addr pointer to which to save the ip address in network order + * @return 1 if cp could be converted to addr, 0 on failure + */ +int +ip6addr_aton(const char *cp, ip6_addr_t *addr) +{ + u32_t addr_index, zero_blocks, current_block_index, current_block_value; + const char *s; + + /* Count the number of colons, to count the number of blocks in a "::" sequence + zero_blocks may be 1 even if there are no :: sequences */ + zero_blocks = 8; + for (s = cp; *s != 0; s++) { + if (*s == ':') { + zero_blocks--; + } else if (!isxdigit(*s)) { + break; + } + } + + /* parse each block */ + addr_index = 0; + current_block_index = 0; + current_block_value = 0; + for (s = cp; *s != 0; s++) { + if (*s == ':') { + if (addr) { + if (current_block_index & 0x1) { + addr->addr[addr_index++] |= current_block_value; + } + else { + addr->addr[addr_index] = current_block_value << 16; + } + } + current_block_index++; + current_block_value = 0; + if (current_block_index > 7) { + /* address too long! */ + return 0; + } + if (s[1] == ':') { + if (s[2] == ':') { + /* invalid format: three successive colons */ + return 0; + } + s++; + /* "::" found, set zeros */ + while (zero_blocks > 0) { + zero_blocks--; + if (current_block_index & 0x1) { + addr_index++; + } else { + if (addr) { + addr->addr[addr_index] = 0; + } + } + current_block_index++; + if (current_block_index > 7) { + /* address too long! */ + return 0; + } + } + } + } else if (isxdigit(*s)) { + /* add current digit */ + current_block_value = (current_block_value << 4) + + (isdigit(*s) ? (u32_t)(*s - '0') : + (u32_t)(10 + (islower(*s) ? *s - 'a' : *s - 'A'))); + } else { + /* unexpected digit, space? CRLF? */ + break; + } + } + + if (addr) { + if (current_block_index & 0x1) { + addr->addr[addr_index++] |= current_block_value; + } + else { + addr->addr[addr_index] = current_block_value << 16; + } + } + + /* convert to network byte order. */ + if (addr) { + for (addr_index = 0; addr_index < 4; addr_index++) { + addr->addr[addr_index] = lwip_htonl(addr->addr[addr_index]); + } + } + + if (current_block_index != 7) { + return 0; + } + + return 1; +} + +/** + * Convert numeric IPv6 address into ASCII representation. + * returns ptr to static buffer; not reentrant! + * + * @param addr ip6 address in network order to convert + * @return pointer to a global static (!) buffer that holds the ASCII + * representation of addr + */ +char * +ip6addr_ntoa(const ip6_addr_t *addr) +{ + static char str[40]; + return ip6addr_ntoa_r(addr, str, 40); +} + +/** + * Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used. + * + * @param addr ip6 address in network order to convert + * @param buf target buffer where the string is stored + * @param buflen length of buf + * @return either pointer to buf which now holds the ASCII + * representation of addr or NULL if buf was too small + */ +char * +ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen) +{ + u32_t current_block_index, current_block_value, next_block_value; + s32_t i; + u8_t zero_flag, empty_block_flag; + + i = 0; + empty_block_flag = 0; /* used to indicate a zero chain for "::' */ + + for (current_block_index = 0; current_block_index < 8; current_block_index++) { + /* get the current 16-bit block */ + current_block_value = lwip_htonl(addr->addr[current_block_index >> 1]); + if ((current_block_index & 0x1) == 0) { + current_block_value = current_block_value >> 16; + } + current_block_value &= 0xffff; + + /* Check for empty block. */ + if (current_block_value == 0) { + if (current_block_index == 7 && empty_block_flag == 1) { + /* special case, we must render a ':' for the last block. */ + buf[i++] = ':'; + if (i >= buflen) { + return NULL; + } + break; + } + if (empty_block_flag == 0) { + /* generate empty block "::", but only if more than one contiguous zero block, + * according to current formatting suggestions RFC 5952. */ + next_block_value = lwip_htonl(addr->addr[(current_block_index + 1) >> 1]); + if ((current_block_index & 0x1) == 0x01) { + next_block_value = next_block_value >> 16; + } + next_block_value &= 0xffff; + if (next_block_value == 0) { + empty_block_flag = 1; + buf[i++] = ':'; + if (i >= buflen) { + return NULL; + } + continue; /* move on to next block. */ + } + } else if (empty_block_flag == 1) { + /* move on to next block. */ + continue; + } + } else if (empty_block_flag == 1) { + /* Set this flag value so we don't produce multiple empty blocks. */ + empty_block_flag = 2; + } + + if (current_block_index > 0) { + buf[i++] = ':'; + if (i >= buflen) { + return NULL; + } + } + + if ((current_block_value & 0xf000) == 0) { + zero_flag = 1; + } else { + buf[i++] = xchar(((current_block_value & 0xf000) >> 12)); + zero_flag = 0; + if (i >= buflen) { + return NULL; + } + } + + if (((current_block_value & 0xf00) == 0) && (zero_flag)) { + /* do nothing */ + } else { + buf[i++] = xchar(((current_block_value & 0xf00) >> 8)); + zero_flag = 0; + if (i >= buflen) { + return NULL; + } + } + + if (((current_block_value & 0xf0) == 0) && (zero_flag)) { + /* do nothing */ + } + else { + buf[i++] = xchar(((current_block_value & 0xf0) >> 4)); + zero_flag = 0; + if (i >= buflen) { + return NULL; + } + } + + buf[i++] = xchar((current_block_value & 0xf)); + if (i >= buflen) { + return NULL; + } + } + + buf[i] = 0; + + return buf; +} + +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_frag.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_frag.c new file mode 100644 index 0000000..ff07f71 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/ip6_frag.c @@ -0,0 +1,805 @@ +/** + * @file + * + * IPv6 fragmentation and reassembly. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" +#include "lwip/ip6_frag.h" +#include "lwip/ip6.h" +#include "lwip/icmp6.h" +#include "lwip/nd6.h" +#include "lwip/ip.h" + +#include "lwip/pbuf.h" +#include "lwip/memp.h" +#include "lwip/stats.h" + +#include + +#if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */ + + +/** Setting this to 0, you can turn off checking the fragments for overlapping + * regions. The code gets a little smaller. Only use this if you know that + * overlapping won't occur on your network! */ +#ifndef IP_REASS_CHECK_OVERLAP +#define IP_REASS_CHECK_OVERLAP 1 +#endif /* IP_REASS_CHECK_OVERLAP */ + +/** Set to 0 to prevent freeing the oldest datagram when the reassembly buffer is + * full (IP_REASS_MAX_PBUFS pbufs are enqueued). The code gets a little smaller. + * Datagrams will be freed by timeout only. Especially useful when MEMP_NUM_REASSDATA + * is set to 1, so one datagram can be reassembled at a time, only. */ +#ifndef IP_REASS_FREE_OLDEST +#define IP_REASS_FREE_OLDEST 1 +#endif /* IP_REASS_FREE_OLDEST */ + +#if IPV6_FRAG_COPYHEADER +#define IPV6_FRAG_REQROOM ((s16_t)(sizeof(struct ip6_reass_helper) - IP6_FRAG_HLEN)) +#endif + +#define IP_REASS_FLAG_LASTFRAG 0x01 + +/** This is a helper struct which holds the starting + * offset and the ending offset of this fragment to + * easily chain the fragments. + * It has the same packing requirements as the IPv6 header, since it replaces + * the Fragment Header in memory in incoming fragments to keep + * track of the various fragments. + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip6_reass_helper { + PACK_STRUCT_FIELD(struct pbuf *next_pbuf); + PACK_STRUCT_FIELD(u16_t start); + PACK_STRUCT_FIELD(u16_t end); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* static variables */ +static struct ip6_reassdata *reassdatagrams; +static u16_t ip6_reass_pbufcount; + +/* Forward declarations. */ +static void ip6_reass_free_complete_datagram(struct ip6_reassdata *ipr); +#if IP_REASS_FREE_OLDEST +static void ip6_reass_remove_oldest_datagram(struct ip6_reassdata *ipr, int pbufs_needed); +#endif /* IP_REASS_FREE_OLDEST */ + +void +ip6_reass_tmr(void) +{ + struct ip6_reassdata *r, *tmp; + +#if !IPV6_FRAG_COPYHEADER + LWIP_ASSERT("sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN, set IPV6_FRAG_COPYHEADER to 1", + sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN); +#endif /* !IPV6_FRAG_COPYHEADER */ + + r = reassdatagrams; + while (r != NULL) { + /* Decrement the timer. Once it reaches 0, + * clean up the incomplete fragment assembly */ + if (r->timer > 0) { + r->timer--; + r = r->next; + } else { + /* reassembly timed out */ + tmp = r; + /* get the next pointer before freeing */ + r = r->next; + /* free the helper struct and all enqueued pbufs */ + ip6_reass_free_complete_datagram(tmp); + } + } +} + +/** + * Free a datagram (struct ip6_reassdata) and all its pbufs. + * Updates the total count of enqueued pbufs (ip6_reass_pbufcount), + * sends an ICMP time exceeded packet. + * + * @param ipr datagram to free + */ +static void +ip6_reass_free_complete_datagram(struct ip6_reassdata *ipr) +{ + struct ip6_reassdata *prev; + u16_t pbufs_freed = 0; + u16_t clen; + struct pbuf *p; + struct ip6_reass_helper *iprh; + +#if LWIP_ICMP6 + iprh = (struct ip6_reass_helper *)ipr->p->payload; + if (iprh->start == 0) { + /* The first fragment was received, send ICMP time exceeded. */ + /* First, de-queue the first pbuf from r->p. */ + p = ipr->p; + ipr->p = iprh->next_pbuf; + /* Then, move back to the original ipv6 header (we are now pointing to Fragment header). + This cannot fail since we already checked when receiving this fragment. */ + if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)IPV6_FRAG_HDRREF(ipr->iphdr)))) { + LWIP_ASSERT("ip6_reass_free: moving p->payload to ip6 header failed\n", 0); + } + else { + icmp6_time_exceeded(p, ICMP6_TE_FRAG); + } + clen = pbuf_clen(p); + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + pbufs_freed += clen; + pbuf_free(p); + } +#endif /* LWIP_ICMP6 */ + + /* First, free all received pbufs. The individual pbufs need to be released + separately as they have not yet been chained */ + p = ipr->p; + while (p != NULL) { + struct pbuf *pcur; + iprh = (struct ip6_reass_helper *)p->payload; + pcur = p; + /* get the next pointer before freeing */ + p = iprh->next_pbuf; + clen = pbuf_clen(pcur); + LWIP_ASSERT("pbufs_freed + clen <= 0xffff", pbufs_freed + clen <= 0xffff); + pbufs_freed += clen; + pbuf_free(pcur); + } + + /* Then, unchain the struct ip6_reassdata from the list and free it. */ + if (ipr == reassdatagrams) { + reassdatagrams = ipr->next; + } else { + prev = reassdatagrams; + while (prev != NULL) { + if (prev->next == ipr) { + break; + } + prev = prev->next; + } + if (prev != NULL) { + prev->next = ipr->next; + } + } + memp_free(MEMP_IP6_REASSDATA, ipr); + + /* Finally, update number of pbufs in reassembly queue */ + LWIP_ASSERT("ip_reass_pbufcount >= clen", ip6_reass_pbufcount >= pbufs_freed); + ip6_reass_pbufcount -= pbufs_freed; +} + +#if IP_REASS_FREE_OLDEST +/** + * Free the oldest datagram to make room for enqueueing new fragments. + * The datagram ipr is not freed! + * + * @param ipr ip6_reassdata for the current fragment + * @param pbufs_needed number of pbufs needed to enqueue + * (used for freeing other datagrams if not enough space) + */ +static void +ip6_reass_remove_oldest_datagram(struct ip6_reassdata *ipr, int pbufs_needed) +{ + struct ip6_reassdata *r, *oldest; + + /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs, + * but don't free the current datagram! */ + do { + r = oldest = reassdatagrams; + while (r != NULL) { + if (r != ipr) { + if (r->timer <= oldest->timer) { + /* older than the previous oldest */ + oldest = r; + } + } + r = r->next; + } + if (oldest == ipr) { + /* nothing to free, ipr is the only element on the list */ + return; + } + if (oldest != NULL) { + ip6_reass_free_complete_datagram(oldest); + } + } while (((ip6_reass_pbufcount + pbufs_needed) > IP_REASS_MAX_PBUFS) && (reassdatagrams != NULL)); +} +#endif /* IP_REASS_FREE_OLDEST */ + +/** + * Reassembles incoming IPv6 fragments into an IPv6 datagram. + * + * @param p points to the IPv6 Fragment Header + * @return NULL if reassembly is incomplete, pbuf pointing to + * IPv6 Header if reassembly is complete + */ +struct pbuf * +ip6_reass(struct pbuf *p) +{ + struct ip6_reassdata *ipr, *ipr_prev; + struct ip6_reass_helper *iprh, *iprh_tmp, *iprh_prev=NULL; + struct ip6_frag_hdr *frag_hdr; + u16_t offset, len; + u16_t clen; + u8_t valid = 1; + struct pbuf *q; + + IP6_FRAG_STATS_INC(ip6_frag.recv); + + if ((const void*)ip6_current_header() != ((u8_t*)p->payload) - IP6_HLEN) { + /* ip6_frag_hdr must be in the first pbuf, not chained */ + IP6_FRAG_STATS_INC(ip6_frag.proterr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; + } + + frag_hdr = (struct ip6_frag_hdr *) p->payload; + + clen = pbuf_clen(p); + + offset = lwip_ntohs(frag_hdr->_fragment_offset); + + /* Calculate fragment length from IPv6 payload length. + * Adjust for headers before Fragment Header. + * And finally adjust by Fragment Header length. */ + len = lwip_ntohs(ip6_current_header()->_plen); + len -= (u16_t)(((u8_t*)p->payload - (const u8_t*)ip6_current_header()) - IP6_HLEN); + len -= IP6_FRAG_HLEN; + + /* Look for the datagram the fragment belongs to in the current datagram queue, + * remembering the previous in the queue for later dequeueing. */ + for (ipr = reassdatagrams, ipr_prev = NULL; ipr != NULL; ipr = ipr->next) { + /* Check if the incoming fragment matches the one currently present + in the reassembly buffer. If so, we proceed with copying the + fragment into the buffer. */ + if ((frag_hdr->_identification == ipr->identification) && + ip6_addr_cmp(ip6_current_src_addr(), &(IPV6_FRAG_HDRREF(ipr->iphdr)->src)) && + ip6_addr_cmp(ip6_current_dest_addr(), &(IPV6_FRAG_HDRREF(ipr->iphdr)->dest))) { + IP6_FRAG_STATS_INC(ip6_frag.cachehit); + break; + } + ipr_prev = ipr; + } + + if (ipr == NULL) { + /* Enqueue a new datagram into the datagram queue */ + ipr = (struct ip6_reassdata *)memp_malloc(MEMP_IP6_REASSDATA); + if (ipr == NULL) { +#if IP_REASS_FREE_OLDEST + /* Make room and try again. */ + ip6_reass_remove_oldest_datagram(ipr, clen); + ipr = (struct ip6_reassdata *)memp_malloc(MEMP_IP6_REASSDATA); + if (ipr != NULL) { + /* re-search ipr_prev since it might have been removed */ + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + if (ipr_prev->next == ipr) { + break; + } + } + } else +#endif /* IP_REASS_FREE_OLDEST */ + { + IP6_FRAG_STATS_INC(ip6_frag.memerr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; + } + } + + memset(ipr, 0, sizeof(struct ip6_reassdata)); + ipr->timer = IP_REASS_MAXAGE; + + /* enqueue the new structure to the front of the list */ + ipr->next = reassdatagrams; + reassdatagrams = ipr; + + /* Use the current IPv6 header for src/dest address reference. + * Eventually, we will replace it when we get the first fragment + * (it might be this one, in any case, it is done later). */ +#if IPV6_FRAG_COPYHEADER + MEMCPY(&ipr->iphdr, ip6_current_header(), IP6_HLEN); +#else /* IPV6_FRAG_COPYHEADER */ + /* need to use the none-const pointer here: */ + ipr->iphdr = ip_data.current_ip6_header; +#endif /* IPV6_FRAG_COPYHEADER */ + + /* copy the fragmented packet id. */ + ipr->identification = frag_hdr->_identification; + + /* copy the nexth field */ + ipr->nexth = frag_hdr->_nexth; + } + + /* Check if we are allowed to enqueue more datagrams. */ + if ((ip6_reass_pbufcount + clen) > IP_REASS_MAX_PBUFS) { +#if IP_REASS_FREE_OLDEST + ip6_reass_remove_oldest_datagram(ipr, clen); + if ((ip6_reass_pbufcount + clen) <= IP_REASS_MAX_PBUFS) { + /* re-search ipr_prev since it might have been removed */ + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + if (ipr_prev->next == ipr) { + break; + } + } + } else +#endif /* IP_REASS_FREE_OLDEST */ + { + /* @todo: send ICMPv6 time exceeded here? */ + /* drop this pbuf */ + IP6_FRAG_STATS_INC(ip6_frag.memerr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; + } + } + + /* Overwrite Fragment Header with our own helper struct. */ +#if IPV6_FRAG_COPYHEADER + if (IPV6_FRAG_REQROOM > 0) { + /* Make room for struct ip6_reass_helper (only required if sizeof(void*) > 4). + This cannot fail since we already checked when receiving this fragment. */ + u8_t hdrerr = pbuf_header_force(p, IPV6_FRAG_REQROOM); + LWIP_UNUSED_ARG(hdrerr); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0); + } +#else /* IPV6_FRAG_COPYHEADER */ + LWIP_ASSERT("sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN, set IPV6_FRAG_COPYHEADER to 1", + sizeof(struct ip6_reass_helper) <= IP6_FRAG_HLEN); +#endif /* IPV6_FRAG_COPYHEADER */ + iprh = (struct ip6_reass_helper *)p->payload; + iprh->next_pbuf = NULL; + iprh->start = (offset & IP6_FRAG_OFFSET_MASK); + iprh->end = (offset & IP6_FRAG_OFFSET_MASK) + len; + + /* find the right place to insert this pbuf */ + /* Iterate through until we either get to the end of the list (append), + * or we find on with a larger offset (insert). */ + for (q = ipr->p; q != NULL;) { + iprh_tmp = (struct ip6_reass_helper*)q->payload; + if (iprh->start < iprh_tmp->start) { +#if IP_REASS_CHECK_OVERLAP + if (iprh->end > iprh_tmp->start) { + /* fragment overlaps with following, throw away */ + IP6_FRAG_STATS_INC(ip6_frag.proterr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; + } + if (iprh_prev != NULL) { + if (iprh->start < iprh_prev->end) { + /* fragment overlaps with previous, throw away */ + IP6_FRAG_STATS_INC(ip6_frag.proterr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; + } + } +#endif /* IP_REASS_CHECK_OVERLAP */ + /* the new pbuf should be inserted before this */ + iprh->next_pbuf = q; + if (iprh_prev != NULL) { + /* not the fragment with the lowest offset */ + iprh_prev->next_pbuf = p; + } else { + /* fragment with the lowest offset */ + ipr->p = p; + } + break; + } else if (iprh->start == iprh_tmp->start) { + /* received the same datagram twice: no need to keep the datagram */ + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; +#if IP_REASS_CHECK_OVERLAP + } else if (iprh->start < iprh_tmp->end) { + /* overlap: no need to keep the new datagram */ + IP6_FRAG_STATS_INC(ip6_frag.proterr); + IP6_FRAG_STATS_INC(ip6_frag.drop); + goto nullreturn; +#endif /* IP_REASS_CHECK_OVERLAP */ + } else { + /* Check if the fragments received so far have no gaps. */ + if (iprh_prev != NULL) { + if (iprh_prev->end != iprh_tmp->start) { + /* There is a fragment missing between the current + * and the previous fragment */ + valid = 0; + } + } + } + q = iprh_tmp->next_pbuf; + iprh_prev = iprh_tmp; + } + + /* If q is NULL, then we made it to the end of the list. Determine what to do now */ + if (q == NULL) { + if (iprh_prev != NULL) { + /* this is (for now), the fragment with the highest offset: + * chain it to the last fragment */ +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("check fragments don't overlap", iprh_prev->end <= iprh->start); +#endif /* IP_REASS_CHECK_OVERLAP */ + iprh_prev->next_pbuf = p; + if (iprh_prev->end != iprh->start) { + valid = 0; + } + } else { +#if IP_REASS_CHECK_OVERLAP + LWIP_ASSERT("no previous fragment, this must be the first fragment!", + ipr->p == NULL); +#endif /* IP_REASS_CHECK_OVERLAP */ + /* this is the first fragment we ever received for this ip datagram */ + ipr->p = p; + } + } + + /* Track the current number of pbufs current 'in-flight', in order to limit + the number of fragments that may be enqueued at any one time */ + ip6_reass_pbufcount += clen; + + /* Remember IPv6 header if this is the first fragment. */ + if (iprh->start == 0) { +#if IPV6_FRAG_COPYHEADER + if (iprh->next_pbuf != NULL) { + MEMCPY(&ipr->iphdr, ip6_current_header(), IP6_HLEN); + } +#else /* IPV6_FRAG_COPYHEADER */ + /* need to use the none-const pointer here: */ + ipr->iphdr = ip_data.current_ip6_header; +#endif /* IPV6_FRAG_COPYHEADER */ + } + + /* If this is the last fragment, calculate total packet length. */ + if ((offset & IP6_FRAG_MORE_FLAG) == 0) { + ipr->datagram_len = iprh->end; + } + + /* Additional validity tests: we have received first and last fragment. */ + iprh_tmp = (struct ip6_reass_helper*)ipr->p->payload; + if (iprh_tmp->start != 0) { + valid = 0; + } + if (ipr->datagram_len == 0) { + valid = 0; + } + + /* Final validity test: no gaps between current and last fragment. */ + iprh_prev = iprh; + q = iprh->next_pbuf; + while ((q != NULL) && valid) { + iprh = (struct ip6_reass_helper*)q->payload; + if (iprh_prev->end != iprh->start) { + valid = 0; + break; + } + iprh_prev = iprh; + q = iprh->next_pbuf; + } + + if (valid) { + /* All fragments have been received */ + struct ip6_hdr* iphdr_ptr; + + /* chain together the pbufs contained within the ip6_reassdata list. */ + iprh = (struct ip6_reass_helper*) ipr->p->payload; + while (iprh != NULL) { + struct pbuf* next_pbuf = iprh->next_pbuf; + if (next_pbuf != NULL) { + /* Save next helper struct (will be hidden in next step). */ + iprh_tmp = (struct ip6_reass_helper*)next_pbuf->payload; + + /* hide the fragment header for every succeeding fragment */ + pbuf_header(next_pbuf, -IP6_FRAG_HLEN); +#if IPV6_FRAG_COPYHEADER + if (IPV6_FRAG_REQROOM > 0) { + /* hide the extra bytes borrowed from ip6_hdr for struct ip6_reass_helper */ + u8_t hdrerr = pbuf_header(next_pbuf, -(s16_t)(IPV6_FRAG_REQROOM)); + LWIP_UNUSED_ARG(hdrerr); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0); + } +#endif + pbuf_cat(ipr->p, next_pbuf); + } + else { + iprh_tmp = NULL; + } + + iprh = iprh_tmp; + } + +#if IPV6_FRAG_COPYHEADER + if (IPV6_FRAG_REQROOM > 0) { + /* get back room for struct ip6_reass_helper (only required if sizeof(void*) > 4) */ + u8_t hdrerr = pbuf_header(ipr->p, -(s16_t)(IPV6_FRAG_REQROOM)); + LWIP_UNUSED_ARG(hdrerr); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("no room for struct ip6_reass_helper", hdrerr == 0); + } + iphdr_ptr = (struct ip6_hdr*)((u8_t*)ipr->p->payload - IP6_HLEN); + MEMCPY(iphdr_ptr, &ipr->iphdr, IP6_HLEN); +#else + iphdr_ptr = ipr->iphdr; +#endif + + /* Adjust datagram length by adding header lengths. */ + ipr->datagram_len += (u16_t)(((u8_t*)ipr->p->payload - (u8_t*)iphdr_ptr) + + IP6_FRAG_HLEN + - IP6_HLEN); + + /* Set payload length in ip header. */ + iphdr_ptr->_plen = lwip_htons(ipr->datagram_len); + + /* Get the first pbuf. */ + p = ipr->p; + + /* Restore Fragment Header in first pbuf. Mark as "single fragment" + * packet. Restore nexth. */ + frag_hdr = (struct ip6_frag_hdr *) p->payload; + frag_hdr->_nexth = ipr->nexth; + frag_hdr->reserved = 0; + frag_hdr->_fragment_offset = 0; + frag_hdr->_identification = 0; + + /* release the sources allocate for the fragment queue entry */ + if (reassdatagrams == ipr) { + /* it was the first in the list */ + reassdatagrams = ipr->next; + } else { + /* it wasn't the first, so it must have a valid 'prev' */ + LWIP_ASSERT("sanity check linked list", ipr_prev != NULL); + ipr_prev->next = ipr->next; + } + memp_free(MEMP_IP6_REASSDATA, ipr); + + /* adjust the number of pbufs currently queued for reassembly. */ + ip6_reass_pbufcount -= pbuf_clen(p); + + /* Move pbuf back to IPv6 header. + This cannot fail since we already checked when receiving this fragment. */ + if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)iphdr_ptr))) { + LWIP_ASSERT("ip6_reass: moving p->payload to ip6 header failed\n", 0); + pbuf_free(p); + return NULL; + } + + /* Return the pbuf chain */ + return p; + } + /* the datagram is not (yet?) reassembled completely */ + return NULL; + +nullreturn: + pbuf_free(p); + return NULL; +} + +#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ + +#if LWIP_IPV6 && LWIP_IPV6_FRAG + +#if !LWIP_NETIF_TX_SINGLE_PBUF +/** Allocate a new struct pbuf_custom_ref */ +static struct pbuf_custom_ref* +ip6_frag_alloc_pbuf_custom_ref(void) +{ + return (struct pbuf_custom_ref*)memp_malloc(MEMP_FRAG_PBUF); +} + +/** Free a struct pbuf_custom_ref */ +static void +ip6_frag_free_pbuf_custom_ref(struct pbuf_custom_ref* p) +{ + LWIP_ASSERT("p != NULL", p != NULL); + memp_free(MEMP_FRAG_PBUF, p); +} + +/** Free-callback function to free a 'struct pbuf_custom_ref', called by + * pbuf_free. */ +static void +ip6_frag_free_pbuf_custom(struct pbuf *p) +{ + struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref*)p; + LWIP_ASSERT("pcr != NULL", pcr != NULL); + LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p); + if (pcr->original != NULL) { + pbuf_free(pcr->original); + } + ip6_frag_free_pbuf_custom_ref(pcr); +} +#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */ + +/** + * Fragment an IPv6 datagram if too large for the netif or path MTU. + * + * Chop the datagram in MTU sized chunks and send them in order + * by pointing PBUF_REFs into p + * + * @param p ipv6 packet to send + * @param netif the netif on which to send + * @param dest destination ipv6 address to which to send + * + * @return ERR_OK if sent successfully, err_t otherwise + */ +err_t +ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest) +{ + struct ip6_hdr *original_ip6hdr; + struct ip6_hdr *ip6hdr; + struct ip6_frag_hdr *frag_hdr; + struct pbuf *rambuf; +#if !LWIP_NETIF_TX_SINGLE_PBUF + struct pbuf *newpbuf; + u16_t newpbuflen = 0; + u16_t left_to_copy; +#endif + static u32_t identification; + u16_t nfb; + u16_t left, cop; + u16_t mtu; + u16_t fragment_offset = 0; + u16_t last; + u16_t poff = IP6_HLEN; + + identification++; + + original_ip6hdr = (struct ip6_hdr *)p->payload; + + mtu = nd6_get_destination_mtu(dest, netif); + + /* @todo we assume there are no options in the unfragmentable part (IPv6 header). */ + left = p->tot_len - IP6_HLEN; + + nfb = (mtu - (IP6_HLEN + IP6_FRAG_HLEN)) & IP6_FRAG_OFFSET_MASK; + + while (left) { + last = (left <= nfb); + + /* Fill this fragment */ + cop = last ? left : nfb; + +#if LWIP_NETIF_TX_SINGLE_PBUF + rambuf = pbuf_alloc(PBUF_IP, cop + IP6_FRAG_HLEN, PBUF_RAM); + if (rambuf == NULL) { + IP6_FRAG_STATS_INC(ip6_frag.memerr); + return ERR_MEM; + } + LWIP_ASSERT("this needs a pbuf in one piece!", + (rambuf->len == rambuf->tot_len) && (rambuf->next == NULL)); + poff += pbuf_copy_partial(p, (u8_t*)rambuf->payload + IP6_FRAG_HLEN, cop, poff); + /* make room for the IP header */ + if (pbuf_header(rambuf, IP6_HLEN)) { + pbuf_free(rambuf); + IP6_FRAG_STATS_INC(ip6_frag.memerr); + return ERR_MEM; + } + /* fill in the IP header */ + SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN); + ip6hdr = (struct ip6_hdr *)rambuf->payload; + frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN); +#else + /* When not using a static buffer, create a chain of pbufs. + * The first will be a PBUF_RAM holding the link, IPv6, and Fragment header. + * The rest will be PBUF_REFs mirroring the pbuf chain to be fragged, + * but limited to the size of an mtu. + */ + rambuf = pbuf_alloc(PBUF_LINK, IP6_HLEN + IP6_FRAG_HLEN, PBUF_RAM); + if (rambuf == NULL) { + IP6_FRAG_STATS_INC(ip6_frag.memerr); + return ERR_MEM; + } + LWIP_ASSERT("this needs a pbuf in one piece!", + (p->len >= (IP6_HLEN))); + SMEMCPY(rambuf->payload, original_ip6hdr, IP6_HLEN); + ip6hdr = (struct ip6_hdr *)rambuf->payload; + frag_hdr = (struct ip6_frag_hdr *)((u8_t*)rambuf->payload + IP6_HLEN); + + /* Can just adjust p directly for needed offset. */ + p->payload = (u8_t *)p->payload + poff; + p->len -= poff; + p->tot_len -= poff; + + left_to_copy = cop; + while (left_to_copy) { + struct pbuf_custom_ref *pcr; + newpbuflen = (left_to_copy < p->len) ? left_to_copy : p->len; + /* Is this pbuf already empty? */ + if (!newpbuflen) { + p = p->next; + continue; + } + pcr = ip6_frag_alloc_pbuf_custom_ref(); + if (pcr == NULL) { + pbuf_free(rambuf); + IP6_FRAG_STATS_INC(ip6_frag.memerr); + return ERR_MEM; + } + /* Mirror this pbuf, although we might not need all of it. */ + newpbuf = pbuf_alloced_custom(PBUF_RAW, newpbuflen, PBUF_REF, &pcr->pc, p->payload, newpbuflen); + if (newpbuf == NULL) { + ip6_frag_free_pbuf_custom_ref(pcr); + pbuf_free(rambuf); + IP6_FRAG_STATS_INC(ip6_frag.memerr); + return ERR_MEM; + } + pbuf_ref(p); + pcr->original = p; + pcr->pc.custom_free_function = ip6_frag_free_pbuf_custom; + + /* Add it to end of rambuf's chain, but using pbuf_cat, not pbuf_chain + * so that it is removed when pbuf_dechain is later called on rambuf. + */ + pbuf_cat(rambuf, newpbuf); + left_to_copy -= newpbuflen; + if (left_to_copy) { + p = p->next; + } + } + poff = newpbuflen; +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + + /* Set headers */ + frag_hdr->_nexth = original_ip6hdr->_nexth; + frag_hdr->reserved = 0; + frag_hdr->_fragment_offset = lwip_htons((fragment_offset & IP6_FRAG_OFFSET_MASK) | (last ? 0 : IP6_FRAG_MORE_FLAG)); + frag_hdr->_identification = lwip_htonl(identification); + + IP6H_NEXTH_SET(ip6hdr, IP6_NEXTH_FRAGMENT); + IP6H_PLEN_SET(ip6hdr, cop + IP6_FRAG_HLEN); + + /* No need for separate header pbuf - we allowed room for it in rambuf + * when allocated. + */ + IP6_FRAG_STATS_INC(ip6_frag.xmit); + netif->output_ip6(netif, rambuf, dest); + + /* Unfortunately we can't reuse rambuf - the hardware may still be + * using the buffer. Instead we free it (and the ensuing chain) and + * recreate it next time round the loop. If we're lucky the hardware + * will have already sent the packet, the free will really free, and + * there will be zero memory penalty. + */ + + pbuf_free(rambuf); + left -= cop; + fragment_offset += cop; + } + return ERR_OK; +} + +#endif /* LWIP_IPV6 && LWIP_IPV6_FRAG */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/mld6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/mld6.c new file mode 100644 index 0000000..9acb82f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/mld6.c @@ -0,0 +1,588 @@ +/** + * @file + * Multicast listener discovery + * + * @defgroup mld6 MLD6 + * @ingroup ip6 + * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. + * No support for MLDv2.\n + * To be called from TCPIP thread + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +/* Based on igmp.c implementation of igmp v2 protocol */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 && LWIP_IPV6_MLD /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/mld6.h" +#include "lwip/prot/mld6.h" +#include "lwip/icmp6.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/ip.h" +#include "lwip/inet_chksum.h" +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/memp.h" +#include "lwip/stats.h" + +#include + + +/* + * MLD constants + */ +#define MLD6_HL 1 +#define MLD6_JOIN_DELAYING_MEMBER_TMR_MS (500) + +#define MLD6_GROUP_NON_MEMBER 0 +#define MLD6_GROUP_DELAYING_MEMBER 1 +#define MLD6_GROUP_IDLE_MEMBER 2 + +/* Forward declarations. */ +static struct mld_group *mld6_new_group(struct netif *ifp, const ip6_addr_t *addr); +static err_t mld6_remove_group(struct netif *netif, struct mld_group *group); +static void mld6_delayed_report(struct mld_group *group, u16_t maxresp); +static void mld6_send(struct netif *netif, struct mld_group *group, u8_t type); + + +/** + * Stop MLD processing on interface + * + * @param netif network interface on which stop MLD processing + */ +err_t +mld6_stop(struct netif *netif) +{ + struct mld_group *group = netif_mld6_data(netif); + + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6, NULL); + + while (group != NULL) { + struct mld_group *next = group->next; /* avoid use-after-free below */ + + /* disable the group at the MAC level */ + if (netif->mld_mac_filter != NULL) { + netif->mld_mac_filter(netif, &(group->group_address), NETIF_DEL_MAC_FILTER); + } + + /* free group */ + memp_free(MEMP_MLD6_GROUP, group); + + /* move to "next" */ + group = next; + } + return ERR_OK; +} + +/** + * Report MLD memberships for this interface + * + * @param netif network interface on which report MLD memberships + */ +void +mld6_report_groups(struct netif *netif) +{ + struct mld_group *group = netif_mld6_data(netif); + + while (group != NULL) { + mld6_delayed_report(group, MLD6_JOIN_DELAYING_MEMBER_TMR_MS); + group = group->next; + } +} + +/** + * Search for a group that is joined on a netif + * + * @param ifp the network interface for which to look + * @param addr the group ipv6 address to search for + * @return a struct mld_group* if the group has been found, + * NULL if the group wasn't found. + */ +struct mld_group * +mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr) +{ + struct mld_group *group = netif_mld6_data(ifp); + + while (group != NULL) { + if (ip6_addr_cmp(&(group->group_address), addr)) { + return group; + } + group = group->next; + } + + return NULL; +} + + +/** + * create a new group + * + * @param ifp the network interface for which to create + * @param addr the new group ipv6 + * @return a struct mld_group*, + * NULL on memory error. + */ +static struct mld_group * +mld6_new_group(struct netif *ifp, const ip6_addr_t *addr) +{ + struct mld_group *group; + + group = (struct mld_group *)memp_malloc(MEMP_MLD6_GROUP); + if (group != NULL) { + ip6_addr_set(&(group->group_address), addr); + group->timer = 0; /* Not running */ + group->group_state = MLD6_GROUP_IDLE_MEMBER; + group->last_reporter_flag = 0; + group->use = 0; + group->next = netif_mld6_data(ifp); + + netif_set_client_data(ifp, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6, group); + } + + return group; +} + +/** + * Remove a group from the mld_group_list, but do not free it yet + * + * @param group the group to remove + * @return ERR_OK if group was removed from the list, an err_t otherwise + */ +static err_t +mld6_remove_group(struct netif *netif, struct mld_group *group) +{ + err_t err = ERR_OK; + + /* Is it the first group? */ + if (netif_mld6_data(netif) == group) { + netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6, group->next); + } else { + /* look for group further down the list */ + struct mld_group *tmpGroup; + for (tmpGroup = netif_mld6_data(netif); tmpGroup != NULL; tmpGroup = tmpGroup->next) { + if (tmpGroup->next == group) { + tmpGroup->next = group->next; + break; + } + } + /* Group not find group */ + if (tmpGroup == NULL) { + err = ERR_ARG; + } + } + + return err; +} + + +/** + * Process an input MLD message. Called by icmp6_input. + * + * @param p the mld packet, p->payload pointing to the icmpv6 header + * @param inp the netif on which this packet was received + */ +void +mld6_input(struct pbuf *p, struct netif *inp) +{ + struct mld_header *mld_hdr; + struct mld_group *group; + + MLD6_STATS_INC(mld6.recv); + + /* Check that mld header fits in packet. */ + if (p->len < sizeof(struct mld_header)) { + /* @todo debug message */ + pbuf_free(p); + MLD6_STATS_INC(mld6.lenerr); + MLD6_STATS_INC(mld6.drop); + return; + } + + mld_hdr = (struct mld_header *)p->payload; + + switch (mld_hdr->type) { + case ICMP6_TYPE_MLQ: /* Multicast listener query. */ + /* Is it a general query? */ + if (ip6_addr_isallnodes_linklocal(ip6_current_dest_addr()) && + ip6_addr_isany(&(mld_hdr->multicast_address))) { + MLD6_STATS_INC(mld6.rx_general); + /* Report all groups, except all nodes group, and if-local groups. */ + group = netif_mld6_data(inp); + while (group != NULL) { + if ((!(ip6_addr_ismulticast_iflocal(&(group->group_address)))) && + (!(ip6_addr_isallnodes_linklocal(&(group->group_address))))) { + mld6_delayed_report(group, mld_hdr->max_resp_delay); + } + group = group->next; + } + } else { + /* Have we joined this group? + * We use IP6 destination address to have a memory aligned copy. + * mld_hdr->multicast_address should be the same. */ + MLD6_STATS_INC(mld6.rx_group); + group = mld6_lookfor_group(inp, ip6_current_dest_addr()); + if (group != NULL) { + /* Schedule a report. */ + mld6_delayed_report(group, mld_hdr->max_resp_delay); + } + } + break; /* ICMP6_TYPE_MLQ */ + case ICMP6_TYPE_MLR: /* Multicast listener report. */ + /* Have we joined this group? + * We use IP6 destination address to have a memory aligned copy. + * mld_hdr->multicast_address should be the same. */ + MLD6_STATS_INC(mld6.rx_report); + group = mld6_lookfor_group(inp, ip6_current_dest_addr()); + if (group != NULL) { + /* If we are waiting to report, cancel it. */ + if (group->group_state == MLD6_GROUP_DELAYING_MEMBER) { + group->timer = 0; /* stopped */ + group->group_state = MLD6_GROUP_IDLE_MEMBER; + group->last_reporter_flag = 0; + } + } + break; /* ICMP6_TYPE_MLR */ + case ICMP6_TYPE_MLD: /* Multicast listener done. */ + /* Do nothing, router will query us. */ + break; /* ICMP6_TYPE_MLD */ + default: + MLD6_STATS_INC(mld6.proterr); + MLD6_STATS_INC(mld6.drop); + break; + } + + pbuf_free(p); +} + +/** + * @ingroup mld6 + * Join a group on a network interface. + * + * @param srcaddr ipv6 address of the network interface which should + * join a new group. If IP6_ADDR_ANY, join on all netifs + * @param groupaddr the ipv6 address of the group to join + * @return ERR_OK if group was joined on the netif(s), an err_t otherwise + */ +err_t +mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr) +{ + err_t err = ERR_VAL; /* no matching interface */ + struct netif *netif; + + /* loop through netif's */ + netif = netif_list; + while (netif != NULL) { + /* Should we join this interface ? */ + if (ip6_addr_isany(srcaddr) || + netif_get_ip6_addr_match(netif, srcaddr) >= 0) { + err = mld6_joingroup_netif(netif, groupaddr); + if (err != ERR_OK) { + return err; + } + } + + /* proceed to next network interface */ + netif = netif->next; + } + + return err; +} + +/** + * @ingroup mld6 + * Join a group on a network interface. + * + * @param netif the network interface which should join a new group. + * @param groupaddr the ipv6 address of the group to join + * @return ERR_OK if group was joined on the netif, an err_t otherwise + */ +err_t +mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr) +{ + struct mld_group *group; + + /* find group or create a new one if not found */ + group = mld6_lookfor_group(netif, groupaddr); + + if (group == NULL) { + /* Joining a new group. Create a new group entry. */ + group = mld6_new_group(netif, groupaddr); + if (group == NULL) { + return ERR_MEM; + } + + /* Activate this address on the MAC layer. */ + if (netif->mld_mac_filter != NULL) { + netif->mld_mac_filter(netif, groupaddr, NETIF_ADD_MAC_FILTER); + } + + /* Report our membership. */ + MLD6_STATS_INC(mld6.tx_report); + mld6_send(netif, group, ICMP6_TYPE_MLR); + mld6_delayed_report(group, MLD6_JOIN_DELAYING_MEMBER_TMR_MS); + } + + /* Increment group use */ + group->use++; + return ERR_OK; +} + +/** + * @ingroup mld6 + * Leave a group on a network interface. + * + * @param srcaddr ipv6 address of the network interface which should + * leave the group. If IP6_ISANY, leave on all netifs + * @param groupaddr the ipv6 address of the group to leave + * @return ERR_OK if group was left on the netif(s), an err_t otherwise + */ +err_t +mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr) +{ + err_t err = ERR_VAL; /* no matching interface */ + struct netif *netif; + + /* loop through netif's */ + netif = netif_list; + while (netif != NULL) { + /* Should we leave this interface ? */ + if (ip6_addr_isany(srcaddr) || + netif_get_ip6_addr_match(netif, srcaddr) >= 0) { + err_t res = mld6_leavegroup_netif(netif, groupaddr); + if (err != ERR_OK) { + /* Store this result if we have not yet gotten a success */ + err = res; + } + } + /* proceed to next network interface */ + netif = netif->next; + } + + return err; +} + +/** + * @ingroup mld6 + * Leave a group on a network interface. + * + * @param netif the network interface which should leave the group. + * @param groupaddr the ipv6 address of the group to leave + * @return ERR_OK if group was left on the netif, an err_t otherwise + */ +err_t +mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr) +{ + struct mld_group *group; + + /* find group */ + group = mld6_lookfor_group(netif, groupaddr); + + if (group != NULL) { + /* Leave if there is no other use of the group */ + if (group->use <= 1) { + /* Remove the group from the list */ + mld6_remove_group(netif, group); + + /* If we are the last reporter for this group */ + if (group->last_reporter_flag) { + MLD6_STATS_INC(mld6.tx_leave); + mld6_send(netif, group, ICMP6_TYPE_MLD); + } + + /* Disable the group at the MAC level */ + if (netif->mld_mac_filter != NULL) { + netif->mld_mac_filter(netif, groupaddr, NETIF_DEL_MAC_FILTER); + } + + /* free group struct */ + memp_free(MEMP_MLD6_GROUP, group); + } else { + /* Decrement group use */ + group->use--; + } + + /* Left group */ + return ERR_OK; + } + + /* Group not found */ + return ERR_VAL; +} + + +/** + * Periodic timer for mld processing. Must be called every + * MLD6_TMR_INTERVAL milliseconds (100). + * + * When a delaying member expires, a membership report is sent. + */ +void +mld6_tmr(void) +{ + struct netif *netif = netif_list; + + while (netif != NULL) { + struct mld_group *group = netif_mld6_data(netif); + + while (group != NULL) { + if (group->timer > 0) { + group->timer--; + if (group->timer == 0) { + /* If the state is MLD6_GROUP_DELAYING_MEMBER then we send a report for this group */ + if (group->group_state == MLD6_GROUP_DELAYING_MEMBER) { + MLD6_STATS_INC(mld6.tx_report); + mld6_send(netif, group, ICMP6_TYPE_MLR); + group->group_state = MLD6_GROUP_IDLE_MEMBER; + } + } + } + group = group->next; + } + netif = netif->next; + } +} + +/** + * Schedule a delayed membership report for a group + * + * @param group the mld_group for which "delaying" membership report + * should be sent + * @param maxresp the max resp delay provided in the query + */ +static void +mld6_delayed_report(struct mld_group *group, u16_t maxresp) +{ + /* Convert maxresp from milliseconds to tmr ticks */ + maxresp = maxresp / MLD6_TMR_INTERVAL; + if (maxresp == 0) { + maxresp = 1; + } + +#ifdef LWIP_RAND + /* Randomize maxresp. (if LWIP_RAND is supported) */ + maxresp = LWIP_RAND() % maxresp; + if (maxresp == 0) { + maxresp = 1; + } +#endif /* LWIP_RAND */ + + /* Apply timer value if no report has been scheduled already. */ + if ((group->group_state == MLD6_GROUP_IDLE_MEMBER) || + ((group->group_state == MLD6_GROUP_DELAYING_MEMBER) && + ((group->timer == 0) || (maxresp < group->timer)))) { + group->timer = maxresp; + group->group_state = MLD6_GROUP_DELAYING_MEMBER; + } +} + +/** + * Send a MLD message (report or done). + * + * An IPv6 hop-by-hop options header with a router alert option + * is prepended. + * + * @param group the group to report or quit + * @param type ICMP6_TYPE_MLR (report) or ICMP6_TYPE_MLD (done) + */ +static void +mld6_send(struct netif *netif, struct mld_group *group, u8_t type) +{ + struct mld_header *mld_hdr; + struct pbuf *p; + const ip6_addr_t *src_addr; + + /* Allocate a packet. Size is MLD header + IPv6 Hop-by-hop options header. */ + p = pbuf_alloc(PBUF_IP, sizeof(struct mld_header) + sizeof(struct ip6_hbh_hdr), PBUF_RAM); + if (p == NULL) { + MLD6_STATS_INC(mld6.memerr); + return; + } + + /* Move to make room for Hop-by-hop options header. */ + if (pbuf_header(p, -IP6_HBH_HLEN)) { + pbuf_free(p); + MLD6_STATS_INC(mld6.lenerr); + return; + } + + /* Select our source address. */ + if (!ip6_addr_isvalid(netif_ip6_addr_state(netif, 0))) { + /* This is a special case, when we are performing duplicate address detection. + * We must join the multicast group, but we don't have a valid address yet. */ + src_addr = IP6_ADDR_ANY6; + } else { + /* Use link-local address as source address. */ + src_addr = netif_ip6_addr(netif, 0); + } + + /* MLD message header pointer. */ + mld_hdr = (struct mld_header *)p->payload; + + /* Set fields. */ + mld_hdr->type = type; + mld_hdr->code = 0; + mld_hdr->chksum = 0; + mld_hdr->max_resp_delay = 0; + mld_hdr->reserved = 0; + ip6_addr_set(&(mld_hdr->multicast_address), &(group->group_address)); + +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) { + mld_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, + src_addr, &(group->group_address)); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + /* Add hop-by-hop headers options: router alert with MLD value. */ + ip6_options_add_hbh_ra(p, IP6_NEXTH_ICMP6, IP6_ROUTER_ALERT_VALUE_MLD); + + if (type == ICMP6_TYPE_MLR) { + /* Remember we were the last to report */ + group->last_reporter_flag = 1; + } + + /* Send the packet out. */ + MLD6_STATS_INC(mld6.xmit); + ip6_output_if(p, (ip6_addr_isany(src_addr)) ? NULL : src_addr, &(group->group_address), + MLD6_HL, 0, IP6_NEXTH_HOPBYHOP, netif); + pbuf_free(p); +} + +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/nd6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/nd6.c new file mode 100644 index 0000000..0b36718 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/ipv6/nd6.c @@ -0,0 +1,2102 @@ +/** + * @file + * + * Neighbor discovery and stateless address autoconfiguration for IPv6. + * Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 + * (Address autoconfiguration). + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/nd6.h" +#include "lwip/priv/nd6_priv.h" +#include "lwip/prot/nd6.h" +#include "lwip/prot/icmp6.h" +#include "lwip/pbuf.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/inet_chksum.h" +#include "lwip/netif.h" +#include "lwip/icmp6.h" +#include "lwip/mld6.h" +#include "lwip/ip.h" +#include "lwip/stats.h" +#include "lwip/dns.h" + +#include + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +#if LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK +#error LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK +#endif + +/* Router tables. */ +struct nd6_neighbor_cache_entry neighbor_cache[LWIP_ND6_NUM_NEIGHBORS]; +struct nd6_destination_cache_entry destination_cache[LWIP_ND6_NUM_DESTINATIONS]; +struct nd6_prefix_list_entry prefix_list[LWIP_ND6_NUM_PREFIXES]; +struct nd6_router_list_entry default_router_list[LWIP_ND6_NUM_ROUTERS]; + +/* Default values, can be updated by a RA message. */ +u32_t reachable_time = LWIP_ND6_REACHABLE_TIME; +u32_t retrans_timer = LWIP_ND6_RETRANS_TIMER; /* @todo implement this value in timer */ + +/* Index for cache entries. */ +static u8_t nd6_cached_neighbor_index; +static u8_t nd6_cached_destination_index; + +/* Multicast address holder. */ +static ip6_addr_t multicast_address; + +/* Static buffer to parse RA packet options (size of a prefix option, biggest option) */ +static u8_t nd6_ra_buffer[sizeof(struct prefix_option)]; + +/* Forward declarations. */ +static s8_t nd6_find_neighbor_cache_entry(const ip6_addr_t *ip6addr); +static s8_t nd6_new_neighbor_cache_entry(void); +static void nd6_free_neighbor_cache_entry(s8_t i); +static s8_t nd6_find_destination_cache_entry(const ip6_addr_t *ip6addr); +static s8_t nd6_new_destination_cache_entry(void); +static s8_t nd6_is_prefix_in_netif(const ip6_addr_t *ip6addr, struct netif *netif); +static s8_t nd6_select_router(const ip6_addr_t *ip6addr, struct netif *netif); +static s8_t nd6_get_router(const ip6_addr_t *router_addr, struct netif *netif); +static s8_t nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif); +static s8_t nd6_get_onlink_prefix(ip6_addr_t *prefix, struct netif *netif); +static s8_t nd6_new_onlink_prefix(ip6_addr_t *prefix, struct netif *netif); +static s8_t nd6_get_next_hop_entry(const ip6_addr_t *ip6addr, struct netif *netif); +static err_t nd6_queue_packet(s8_t neighbor_index, struct pbuf *q); + +#define ND6_SEND_FLAG_MULTICAST_DEST 0x01 +#define ND6_SEND_FLAG_ALLNODES_DEST 0x02 +static void nd6_send_ns(struct netif *netif, const ip6_addr_t *target_addr, u8_t flags); +static void nd6_send_na(struct netif *netif, const ip6_addr_t *target_addr, u8_t flags); +static void nd6_send_neighbor_cache_probe(struct nd6_neighbor_cache_entry *entry, u8_t flags); +#if LWIP_IPV6_SEND_ROUTER_SOLICIT +static err_t nd6_send_rs(struct netif *netif); +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ + +#if LWIP_ND6_QUEUEING +static void nd6_free_q(struct nd6_q_entry *q); +#else /* LWIP_ND6_QUEUEING */ +#define nd6_free_q(q) pbuf_free(q) +#endif /* LWIP_ND6_QUEUEING */ +static void nd6_send_q(s8_t i); + + +/** + * Process an incoming neighbor discovery message + * + * @param p the nd packet, p->payload pointing to the icmpv6 header + * @param inp the netif on which this packet was received + */ +void +nd6_input(struct pbuf *p, struct netif *inp) +{ + u8_t msg_type; + s8_t i; + + ND6_STATS_INC(nd6.recv); + + msg_type = *((u8_t *)p->payload); + switch (msg_type) { + case ICMP6_TYPE_NA: /* Neighbor Advertisement. */ + { + struct na_header *na_hdr; + struct lladdr_option *lladdr_opt; + + /* Check that na header fits in packet. */ + if (p->len < (sizeof(struct na_header))) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + na_hdr = (struct na_header *)p->payload; + + /* Unsolicited NA?*/ + if (ip6_addr_ismulticast(ip6_current_dest_addr())) { + ip6_addr_t target_address; + + /* This is an unsolicited NA. + * link-layer changed? + * part of DAD mechanism? */ + + /* Create an aligned copy. */ + ip6_addr_set(&target_address, &(na_hdr->target_address)); + +#if LWIP_IPV6_DUP_DETECT_ATTEMPTS + /* If the target address matches this netif, it is a DAD response. */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (!ip6_addr_isinvalid(netif_ip6_addr_state(inp, i)) && + ip6_addr_cmp(&target_address, netif_ip6_addr(inp, i))) { + /* We are using a duplicate address. */ + netif_ip6_addr_set_state(inp, i, IP6_ADDR_INVALID); + +#if LWIP_IPV6_AUTOCONFIG + /* Check to see if this address was autoconfigured. */ + if (!ip6_addr_islinklocal(&target_address)) { + i = nd6_get_onlink_prefix(&target_address, inp); + if (i >= 0) { + /* Mark this prefix as duplicate, so that we don't use it + * to generate this address again. */ + prefix_list[i].flags |= ND6_PREFIX_AUTOCONFIG_ADDRESS_DUPLICATE; + } + } +#endif /* LWIP_IPV6_AUTOCONFIG */ + + pbuf_free(p); + return; + } + } +#endif /* LWIP_IPV6_DUP_DETECT_ATTEMPTS */ + + /* Check that link-layer address option also fits in packet. */ + if (p->len < (sizeof(struct na_header) + 2)) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct na_header)); + + if (p->len < (sizeof(struct na_header) + (lladdr_opt->length << 3))) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + /* This is an unsolicited NA, most likely there was a LLADDR change. */ + i = nd6_find_neighbor_cache_entry(&target_address); + if (i >= 0) { + if (na_hdr->flags & ND6_FLAG_OVERRIDE) { + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + } + } + } else { + ip6_addr_t target_address; + + /* This is a solicited NA. + * neighbor address resolution response? + * neighbor unreachability detection response? */ + + /* Create an aligned copy. */ + ip6_addr_set(&target_address, &(na_hdr->target_address)); + + /* Find the cache entry corresponding to this na. */ + i = nd6_find_neighbor_cache_entry(&target_address); + if (i < 0) { + /* We no longer care about this target address. drop it. */ + pbuf_free(p); + return; + } + + /* Update cache entry. */ + if ((na_hdr->flags & ND6_FLAG_OVERRIDE) || + (neighbor_cache[i].state == ND6_INCOMPLETE)) { + /* Check that link-layer address option also fits in packet. */ + if (p->len < (sizeof(struct na_header) + 2)) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct na_header)); + + if (p->len < (sizeof(struct na_header) + (lladdr_opt->length << 3))) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + } + + neighbor_cache[i].netif = inp; + neighbor_cache[i].state = ND6_REACHABLE; + neighbor_cache[i].counter.reachable_time = reachable_time; + + /* Send queued packets, if any. */ + if (neighbor_cache[i].q != NULL) { + nd6_send_q(i); + } + } + + break; /* ICMP6_TYPE_NA */ + } + case ICMP6_TYPE_NS: /* Neighbor solicitation. */ + { + struct ns_header *ns_hdr; + struct lladdr_option *lladdr_opt; + u8_t accepted; + + /* Check that ns header fits in packet. */ + if (p->len < sizeof(struct ns_header)) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + ns_hdr = (struct ns_header *)p->payload; + + /* Check if there is a link-layer address provided. Only point to it if in this buffer. */ + if (p->len >= (sizeof(struct ns_header) + 2)) { + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct ns_header)); + if (p->len < (sizeof(struct ns_header) + (lladdr_opt->length << 3))) { + lladdr_opt = NULL; + } + } else { + lladdr_opt = NULL; + } + + /* Check if the target address is configured on the receiving netif. */ + accepted = 0; + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { + if ((ip6_addr_isvalid(netif_ip6_addr_state(inp, i)) || + (ip6_addr_istentative(netif_ip6_addr_state(inp, i)) && + ip6_addr_isany(ip6_current_src_addr()))) && + ip6_addr_cmp(&(ns_hdr->target_address), netif_ip6_addr(inp, i))) { + accepted = 1; + break; + } + } + + /* NS not for us? */ + if (!accepted) { + pbuf_free(p); + return; + } + + /* Check for ANY address in src (DAD algorithm). */ + if (ip6_addr_isany(ip6_current_src_addr())) { + /* Sender is validating this address. */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { + if (!ip6_addr_isinvalid(netif_ip6_addr_state(inp, i)) && + ip6_addr_cmp(&(ns_hdr->target_address), netif_ip6_addr(inp, i))) { + /* Send a NA back so that the sender does not use this address. */ + nd6_send_na(inp, netif_ip6_addr(inp, i), ND6_FLAG_OVERRIDE | ND6_SEND_FLAG_ALLNODES_DEST); + if (ip6_addr_istentative(netif_ip6_addr_state(inp, i))) { + /* We shouldn't use this address either. */ + netif_ip6_addr_set_state(inp, i, IP6_ADDR_INVALID); + } + } + } + } else { + ip6_addr_t target_address; + + /* Sender is trying to resolve our address. */ + /* Verify that they included their own link-layer address. */ + if (lladdr_opt == NULL) { + /* Not a valid message. */ + pbuf_free(p); + ND6_STATS_INC(nd6.proterr); + ND6_STATS_INC(nd6.drop); + return; + } + + i = nd6_find_neighbor_cache_entry(ip6_current_src_addr()); + if (i>= 0) { + /* We already have a record for the solicitor. */ + if (neighbor_cache[i].state == ND6_INCOMPLETE) { + neighbor_cache[i].netif = inp; + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + + /* Delay probe in case we get confirmation of reachability from upper layer (TCP). */ + neighbor_cache[i].state = ND6_DELAY; + neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL; + } + } else { + /* Add their IPv6 address and link-layer address to neighbor cache. + * We will need it at least to send a unicast NA message, but most + * likely we will also be communicating with this node soon. */ + i = nd6_new_neighbor_cache_entry(); + if (i < 0) { + /* We couldn't assign a cache entry for this neighbor. + * we won't be able to reply. drop it. */ + pbuf_free(p); + ND6_STATS_INC(nd6.memerr); + return; + } + neighbor_cache[i].netif = inp; + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + ip6_addr_set(&(neighbor_cache[i].next_hop_address), ip6_current_src_addr()); + + /* Receiving a message does not prove reachability: only in one direction. + * Delay probe in case we get confirmation of reachability from upper layer (TCP). */ + neighbor_cache[i].state = ND6_DELAY; + neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL; + } + + /* Create an aligned copy. */ + ip6_addr_set(&target_address, &(ns_hdr->target_address)); + + /* Send back a NA for us. Allocate the reply pbuf. */ + nd6_send_na(inp, &target_address, ND6_FLAG_SOLICITED | ND6_FLAG_OVERRIDE); + } + + break; /* ICMP6_TYPE_NS */ + } + case ICMP6_TYPE_RA: /* Router Advertisement. */ + { + struct ra_header *ra_hdr; + u8_t *buffer; /* Used to copy options. */ + u16_t offset; +#if LWIP_ND6_RDNSS_MAX_DNS_SERVERS + /* There can by multiple RDNSS options per RA */ + u8_t rdnss_server_idx = 0; +#endif /* LWIP_ND6_RDNSS_MAX_DNS_SERVERS */ + + /* Check that RA header fits in packet. */ + if (p->len < sizeof(struct ra_header)) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + ra_hdr = (struct ra_header *)p->payload; + + /* If we are sending RS messages, stop. */ +#if LWIP_IPV6_SEND_ROUTER_SOLICIT + /* ensure at least one solicitation is sent */ + if ((inp->rs_count < LWIP_ND6_MAX_MULTICAST_SOLICIT) || + (nd6_send_rs(inp) == ERR_OK)) { + inp->rs_count = 0; + } +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ + + /* Get the matching default router entry. */ + i = nd6_get_router(ip6_current_src_addr(), inp); + if (i < 0) { + /* Create a new router entry. */ + i = nd6_new_router(ip6_current_src_addr(), inp); + } + + if (i < 0) { + /* Could not create a new router entry. */ + pbuf_free(p); + ND6_STATS_INC(nd6.memerr); + return; + } + + /* Re-set invalidation timer. */ + default_router_list[i].invalidation_timer = lwip_htons(ra_hdr->router_lifetime); + + /* Re-set default timer values. */ +#if LWIP_ND6_ALLOW_RA_UPDATES + if (ra_hdr->retrans_timer > 0) { + retrans_timer = lwip_htonl(ra_hdr->retrans_timer); + } + if (ra_hdr->reachable_time > 0) { + reachable_time = lwip_htonl(ra_hdr->reachable_time); + } +#endif /* LWIP_ND6_ALLOW_RA_UPDATES */ + + /* @todo set default hop limit... */ + /* ra_hdr->current_hop_limit;*/ + + /* Update flags in local entry (incl. preference). */ + default_router_list[i].flags = ra_hdr->flags; + + /* Offset to options. */ + offset = sizeof(struct ra_header); + + /* Process each option. */ + while ((p->tot_len - offset) > 0) { + if (p->len == p->tot_len) { + /* no need to copy from contiguous pbuf */ + buffer = &((u8_t*)p->payload)[offset]; + } else { + buffer = nd6_ra_buffer; + if (pbuf_copy_partial(p, buffer, sizeof(struct prefix_option), offset) != sizeof(struct prefix_option)) { + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + } + if (buffer[1] == 0) { + /* zero-length extension. drop packet */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + switch (buffer[0]) { + case ND6_OPTION_TYPE_SOURCE_LLADDR: + { + struct lladdr_option *lladdr_opt; + lladdr_opt = (struct lladdr_option *)buffer; + if ((default_router_list[i].neighbor_entry != NULL) && + (default_router_list[i].neighbor_entry->state == ND6_INCOMPLETE)) { + SMEMCPY(default_router_list[i].neighbor_entry->lladdr, lladdr_opt->addr, inp->hwaddr_len); + default_router_list[i].neighbor_entry->state = ND6_REACHABLE; + default_router_list[i].neighbor_entry->counter.reachable_time = reachable_time; + } + break; + } + case ND6_OPTION_TYPE_MTU: + { + struct mtu_option *mtu_opt; + mtu_opt = (struct mtu_option *)buffer; + if (lwip_htonl(mtu_opt->mtu) >= 1280) { +#if LWIP_ND6_ALLOW_RA_UPDATES + inp->mtu = (u16_t)lwip_htonl(mtu_opt->mtu); +#endif /* LWIP_ND6_ALLOW_RA_UPDATES */ + } + break; + } + case ND6_OPTION_TYPE_PREFIX_INFO: + { + struct prefix_option *prefix_opt; + prefix_opt = (struct prefix_option *)buffer; + + if ((prefix_opt->flags & ND6_PREFIX_FLAG_ON_LINK) && + (prefix_opt->prefix_length == 64) && + !ip6_addr_islinklocal(&(prefix_opt->prefix))) { + /* Add to on-link prefix list. */ + s8_t prefix; + ip6_addr_t prefix_addr; + + /* Get a memory-aligned copy of the prefix. */ + ip6_addr_set(&prefix_addr, &(prefix_opt->prefix)); + + /* find cache entry for this prefix. */ + prefix = nd6_get_onlink_prefix(&prefix_addr, inp); + if (prefix < 0) { + /* Create a new cache entry. */ + prefix = nd6_new_onlink_prefix(&prefix_addr, inp); + } + if (prefix >= 0) { + prefix_list[prefix].invalidation_timer = lwip_htonl(prefix_opt->valid_lifetime); + +#if LWIP_IPV6_AUTOCONFIG + if (prefix_opt->flags & ND6_PREFIX_FLAG_AUTONOMOUS) { + /* Mark prefix as autonomous, so that address autoconfiguration can take place. + * Only OR flag, so that we don't over-write other flags (such as ADDRESS_DUPLICATE)*/ + prefix_list[prefix].flags |= ND6_PREFIX_AUTOCONFIG_AUTONOMOUS; + } +#endif /* LWIP_IPV6_AUTOCONFIG */ + } + } + + break; + } + case ND6_OPTION_TYPE_ROUTE_INFO: + /* @todo implement preferred routes. + struct route_option * route_opt; + route_opt = (struct route_option *)buffer;*/ + + break; +#if LWIP_ND6_RDNSS_MAX_DNS_SERVERS + case ND6_OPTION_TYPE_RDNSS: + { + u8_t num, n; + struct rdnss_option * rdnss_opt; + + rdnss_opt = (struct rdnss_option *)buffer; + num = (rdnss_opt->length - 1) / 2; + for (n = 0; (rdnss_server_idx < DNS_MAX_SERVERS) && (n < num); n++) { + ip_addr_t rdnss_address; + + /* Get a memory-aligned copy of the prefix. */ + ip_addr_copy_from_ip6(rdnss_address, rdnss_opt->rdnss_address[n]); + + if (htonl(rdnss_opt->lifetime) > 0) { + /* TODO implement Lifetime > 0 */ + dns_setserver(rdnss_server_idx++, &rdnss_address); + } else { + /* TODO implement DNS removal in dns.c */ + u8_t s; + for (s = 0; s < DNS_MAX_SERVERS; s++) { + const ip_addr_t *addr = dns_getserver(s); + if(ip_addr_cmp(addr, &rdnss_address)) { + dns_setserver(s, NULL); + } + } + } + } + break; + } +#endif /* LWIP_ND6_RDNSS_MAX_DNS_SERVERS */ + default: + /* Unrecognized option, abort. */ + ND6_STATS_INC(nd6.proterr); + break; + } + /* option length is checked earlier to be non-zero to make sure loop ends */ + offset += 8 * ((u16_t)buffer[1]); + } + + break; /* ICMP6_TYPE_RA */ + } + case ICMP6_TYPE_RD: /* Redirect */ + { + struct redirect_header *redir_hdr; + struct lladdr_option *lladdr_opt; + ip6_addr_t tmp; + + /* Check that Redir header fits in packet. */ + if (p->len < sizeof(struct redirect_header)) { + /* @todo debug message */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + redir_hdr = (struct redirect_header *)p->payload; + + if (p->len >= (sizeof(struct redirect_header) + 2)) { + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct redirect_header)); + if (p->len < (sizeof(struct redirect_header) + (lladdr_opt->length << 3))) { + lladdr_opt = NULL; + } + } else { + lladdr_opt = NULL; + } + + /* Copy original destination address to current source address, to have an aligned copy. */ + ip6_addr_set(&tmp, &(redir_hdr->destination_address)); + + /* Find dest address in cache */ + i = nd6_find_destination_cache_entry(&tmp); + if (i < 0) { + /* Destination not in cache, drop packet. */ + pbuf_free(p); + return; + } + + /* Set the new target address. */ + ip6_addr_set(&(destination_cache[i].next_hop_addr), &(redir_hdr->target_address)); + + /* If Link-layer address of other router is given, try to add to neighbor cache. */ + if (lladdr_opt != NULL) { + if (lladdr_opt->type == ND6_OPTION_TYPE_TARGET_LLADDR) { + /* Copy target address to current source address, to have an aligned copy. */ + ip6_addr_set(&tmp, &(redir_hdr->target_address)); + + i = nd6_find_neighbor_cache_entry(&tmp); + if (i < 0) { + i = nd6_new_neighbor_cache_entry(); + if (i >= 0) { + neighbor_cache[i].netif = inp; + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + ip6_addr_set(&(neighbor_cache[i].next_hop_address), &tmp); + + /* Receiving a message does not prove reachability: only in one direction. + * Delay probe in case we get confirmation of reachability from upper layer (TCP). */ + neighbor_cache[i].state = ND6_DELAY; + neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL; + } + } + if (i >= 0) { + if (neighbor_cache[i].state == ND6_INCOMPLETE) { + MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len); + /* Receiving a message does not prove reachability: only in one direction. + * Delay probe in case we get confirmation of reachability from upper layer (TCP). */ + neighbor_cache[i].state = ND6_DELAY; + neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL; + } + } + } + } + break; /* ICMP6_TYPE_RD */ + } + case ICMP6_TYPE_PTB: /* Packet too big */ + { + struct icmp6_hdr *icmp6hdr; /* Packet too big message */ + struct ip6_hdr *ip6hdr; /* IPv6 header of the packet which caused the error */ + u32_t pmtu; + ip6_addr_t tmp; + + /* Check that ICMPv6 header + IPv6 header fit in payload */ + if (p->len < (sizeof(struct icmp6_hdr) + IP6_HLEN)) { + /* drop short packets */ + pbuf_free(p); + ND6_STATS_INC(nd6.lenerr); + ND6_STATS_INC(nd6.drop); + return; + } + + icmp6hdr = (struct icmp6_hdr *)p->payload; + ip6hdr = (struct ip6_hdr *)((u8_t*)p->payload + sizeof(struct icmp6_hdr)); + + /* Copy original destination address to current source address, to have an aligned copy. */ + ip6_addr_set(&tmp, &(ip6hdr->dest)); + + /* Look for entry in destination cache. */ + i = nd6_find_destination_cache_entry(&tmp); + if (i < 0) { + /* Destination not in cache, drop packet. */ + pbuf_free(p); + return; + } + + /* Change the Path MTU. */ + pmtu = lwip_htonl(icmp6hdr->data); + destination_cache[i].pmtu = (u16_t)LWIP_MIN(pmtu, 0xFFFF); + + break; /* ICMP6_TYPE_PTB */ + } + + default: + ND6_STATS_INC(nd6.proterr); + ND6_STATS_INC(nd6.drop); + break; /* default */ + } + + pbuf_free(p); +} + + +/** + * Periodic timer for Neighbor discovery functions: + * + * - Update neighbor reachability states + * - Update destination cache entries age + * - Update invalidation timers of default routers and on-link prefixes + * - Perform duplicate address detection (DAD) for our addresses + * - Send router solicitations + */ +void +nd6_tmr(void) +{ + s8_t i; + struct netif *netif; + + /* Process neighbor entries. */ + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + switch (neighbor_cache[i].state) { + case ND6_INCOMPLETE: + if ((neighbor_cache[i].counter.probes_sent >= LWIP_ND6_MAX_MULTICAST_SOLICIT) && + (!neighbor_cache[i].isrouter)) { + /* Retries exceeded. */ + nd6_free_neighbor_cache_entry(i); + } else { + /* Send a NS for this entry. */ + neighbor_cache[i].counter.probes_sent++; + nd6_send_neighbor_cache_probe(&neighbor_cache[i], ND6_SEND_FLAG_MULTICAST_DEST); + } + break; + case ND6_REACHABLE: + /* Send queued packets, if any are left. Should have been sent already. */ + if (neighbor_cache[i].q != NULL) { + nd6_send_q(i); + } + if (neighbor_cache[i].counter.reachable_time <= ND6_TMR_INTERVAL) { + /* Change to stale state. */ + neighbor_cache[i].state = ND6_STALE; + neighbor_cache[i].counter.stale_time = 0; + } else { + neighbor_cache[i].counter.reachable_time -= ND6_TMR_INTERVAL; + } + break; + case ND6_STALE: + neighbor_cache[i].counter.stale_time++; + break; + case ND6_DELAY: + if (neighbor_cache[i].counter.delay_time <= 1) { + /* Change to PROBE state. */ + neighbor_cache[i].state = ND6_PROBE; + neighbor_cache[i].counter.probes_sent = 0; + } else { + neighbor_cache[i].counter.delay_time--; + } + break; + case ND6_PROBE: + if ((neighbor_cache[i].counter.probes_sent >= LWIP_ND6_MAX_MULTICAST_SOLICIT) && + (!neighbor_cache[i].isrouter)) { + /* Retries exceeded. */ + nd6_free_neighbor_cache_entry(i); + } else { + /* Send a NS for this entry. */ + neighbor_cache[i].counter.probes_sent++; + nd6_send_neighbor_cache_probe(&neighbor_cache[i], 0); + } + break; + case ND6_NO_ENTRY: + default: + /* Do nothing. */ + break; + } + } + + /* Process destination entries. */ + for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) { + destination_cache[i].age++; + } + + /* Process router entries. */ + for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) { + if (default_router_list[i].neighbor_entry != NULL) { + /* Active entry. */ + if (default_router_list[i].invalidation_timer > 0) { + default_router_list[i].invalidation_timer -= ND6_TMR_INTERVAL / 1000; + } + if (default_router_list[i].invalidation_timer < ND6_TMR_INTERVAL / 1000) { + /* Less than 1 second remaining. Clear this entry. */ + default_router_list[i].neighbor_entry->isrouter = 0; + default_router_list[i].neighbor_entry = NULL; + default_router_list[i].invalidation_timer = 0; + default_router_list[i].flags = 0; + } + } + } + + /* Process prefix entries. */ + for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) { + if (prefix_list[i].netif != NULL) { + if (prefix_list[i].invalidation_timer < ND6_TMR_INTERVAL / 1000) { + /* Entry timed out, remove it */ + prefix_list[i].invalidation_timer = 0; + +#if LWIP_IPV6_AUTOCONFIG + /* If any addresses were configured with this prefix, remove them */ + if (prefix_list[i].flags & ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED) { + s8_t j; + + for (j = 1; j < LWIP_IPV6_NUM_ADDRESSES; j++) { + if ((netif_ip6_addr_state(prefix_list[i].netif, j) != IP6_ADDR_INVALID) && + ip6_addr_netcmp(&prefix_list[i].prefix, netif_ip6_addr(prefix_list[i].netif, j))) { + netif_ip6_addr_set_state(prefix_list[i].netif, j, IP6_ADDR_INVALID); + prefix_list[i].flags = 0; + + /* Exit loop. */ + break; + } + } + } +#endif /* LWIP_IPV6_AUTOCONFIG */ + + prefix_list[i].netif = NULL; + prefix_list[i].flags = 0; + } else { + prefix_list[i].invalidation_timer -= ND6_TMR_INTERVAL / 1000; + +#if LWIP_IPV6_AUTOCONFIG + /* Initiate address autoconfiguration for this prefix, if conditions are met. */ + if (prefix_list[i].netif->ip6_autoconfig_enabled && + (prefix_list[i].flags & ND6_PREFIX_AUTOCONFIG_AUTONOMOUS) && + !(prefix_list[i].flags & ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED)) { + s8_t j; + /* Try to get an address on this netif that is invalid. + * Skip 0 index (link-local address) */ + for (j = 1; j < LWIP_IPV6_NUM_ADDRESSES; j++) { + if (netif_ip6_addr_state(prefix_list[i].netif, j) == IP6_ADDR_INVALID) { + /* Generate an address using this prefix and interface ID from link-local address. */ + netif_ip6_addr_set_parts(prefix_list[i].netif, j, + prefix_list[i].prefix.addr[0], prefix_list[i].prefix.addr[1], + netif_ip6_addr(prefix_list[i].netif, 0)->addr[2], netif_ip6_addr(prefix_list[i].netif, 0)->addr[3]); + + /* Mark it as tentative (DAD will be performed if configured). */ + netif_ip6_addr_set_state(prefix_list[i].netif, j, IP6_ADDR_TENTATIVE); + + /* Mark this prefix with ADDRESS_GENERATED, so that we don't try again. */ + prefix_list[i].flags |= ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED; + + /* Exit loop. */ + break; + } + } + } +#endif /* LWIP_IPV6_AUTOCONFIG */ + } + } + } + + + /* Process our own addresses, if DAD configured. */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { + u8_t addr_state = netif_ip6_addr_state(netif, i); + if (ip6_addr_istentative(addr_state)) { + if ((addr_state & IP6_ADDR_TENTATIVE_COUNT_MASK) >= LWIP_IPV6_DUP_DETECT_ATTEMPTS) { + /* No NA received in response. Mark address as valid. */ + netif_ip6_addr_set_state(netif, i, IP6_ADDR_PREFERRED); + /* @todo implement preferred and valid lifetimes. */ + } else if (netif->flags & NETIF_FLAG_UP) { + /* Send a NS for this address. */ + nd6_send_ns(netif, netif_ip6_addr(netif, i), ND6_SEND_FLAG_MULTICAST_DEST); + /* tentative: set next state by increasing by one */ + netif_ip6_addr_set_state(netif, i, addr_state + 1); + /* @todo send max 1 NS per tmr call? enable return*/ + /*return;*/ + } + } + } + } + +#if LWIP_IPV6_SEND_ROUTER_SOLICIT + /* Send router solicitation messages, if necessary. */ + for (netif = netif_list; netif != NULL; netif = netif->next) { + if ((netif->rs_count > 0) && (netif->flags & NETIF_FLAG_UP) && + (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, 0)))) { + if (nd6_send_rs(netif) == ERR_OK) { + netif->rs_count--; + } + } + } +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ + +} + +/** Send a neighbor solicitation message for a specific neighbor cache entry + * + * @param entry the neightbor cache entry for wich to send the message + * @param flags one of ND6_SEND_FLAG_* + */ +static void +nd6_send_neighbor_cache_probe(struct nd6_neighbor_cache_entry *entry, u8_t flags) +{ + nd6_send_ns(entry->netif, &entry->next_hop_address, flags); +} + +/** + * Send a neighbor solicitation message + * + * @param netif the netif on which to send the message + * @param target_addr the IPv6 target address for the ND message + * @param flags one of ND6_SEND_FLAG_* + */ +static void +nd6_send_ns(struct netif *netif, const ip6_addr_t *target_addr, u8_t flags) +{ + struct ns_header *ns_hdr; + struct pbuf *p; + const ip6_addr_t *src_addr; + u16_t lladdr_opt_len; + + if (ip6_addr_isvalid(netif_ip6_addr_state(netif,0))) { + /* Use link-local address as source address. */ + src_addr = netif_ip6_addr(netif, 0); + /* calculate option length (in 8-byte-blocks) */ + lladdr_opt_len = ((netif->hwaddr_len + 2) + 7) >> 3; + } else { + src_addr = IP6_ADDR_ANY6; + /* Option "MUST NOT be included when the source IP address is the unspecified address." */ + lladdr_opt_len = 0; + } + + /* Allocate a packet. */ + p = pbuf_alloc(PBUF_IP, sizeof(struct ns_header) + (lladdr_opt_len << 3), PBUF_RAM); + if (p == NULL) { + ND6_STATS_INC(nd6.memerr); + return; + } + + /* Set fields. */ + ns_hdr = (struct ns_header *)p->payload; + + ns_hdr->type = ICMP6_TYPE_NS; + ns_hdr->code = 0; + ns_hdr->chksum = 0; + ns_hdr->reserved = 0; + ip6_addr_set(&(ns_hdr->target_address), target_addr); + + if (lladdr_opt_len != 0) { + struct lladdr_option *lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct ns_header)); + lladdr_opt->type = ND6_OPTION_TYPE_SOURCE_LLADDR; + lladdr_opt->length = (u8_t)lladdr_opt_len; + SMEMCPY(lladdr_opt->addr, netif->hwaddr, netif->hwaddr_len); + } + + /* Generate the solicited node address for the target address. */ + if (flags & ND6_SEND_FLAG_MULTICAST_DEST) { + ip6_addr_set_solicitednode(&multicast_address, target_addr->addr[3]); + target_addr = &multicast_address; + } + +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) { + ns_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr, + target_addr); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + /* Send the packet out. */ + ND6_STATS_INC(nd6.xmit); + ip6_output_if(p, (src_addr == IP6_ADDR_ANY6) ? NULL : src_addr, target_addr, + LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif); + pbuf_free(p); +} + +/** + * Send a neighbor advertisement message + * + * @param netif the netif on which to send the message + * @param target_addr the IPv6 target address for the ND message + * @param flags one of ND6_SEND_FLAG_* + */ +static void +nd6_send_na(struct netif *netif, const ip6_addr_t *target_addr, u8_t flags) +{ + struct na_header *na_hdr; + struct lladdr_option *lladdr_opt; + struct pbuf *p; + const ip6_addr_t *src_addr; + const ip6_addr_t *dest_addr; + u16_t lladdr_opt_len; + + /* Use link-local address as source address. */ + /* src_addr = netif_ip6_addr(netif, 0); */ + /* Use target address as source address. */ + src_addr = target_addr; + + /* Allocate a packet. */ + lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0); + p = pbuf_alloc(PBUF_IP, sizeof(struct na_header) + (lladdr_opt_len << 3), PBUF_RAM); + if (p == NULL) { + ND6_STATS_INC(nd6.memerr); + return; + } + + /* Set fields. */ + na_hdr = (struct na_header *)p->payload; + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct na_header)); + + na_hdr->type = ICMP6_TYPE_NA; + na_hdr->code = 0; + na_hdr->chksum = 0; + na_hdr->flags = flags & 0xf0; + na_hdr->reserved[0] = 0; + na_hdr->reserved[1] = 0; + na_hdr->reserved[2] = 0; + ip6_addr_set(&(na_hdr->target_address), target_addr); + + lladdr_opt->type = ND6_OPTION_TYPE_TARGET_LLADDR; + lladdr_opt->length = (u8_t)lladdr_opt_len; + SMEMCPY(lladdr_opt->addr, netif->hwaddr, netif->hwaddr_len); + + /* Generate the solicited node address for the target address. */ + if (flags & ND6_SEND_FLAG_MULTICAST_DEST) { + ip6_addr_set_solicitednode(&multicast_address, target_addr->addr[3]); + dest_addr = &multicast_address; + } else if (flags & ND6_SEND_FLAG_ALLNODES_DEST) { + ip6_addr_set_allnodes_linklocal(&multicast_address); + dest_addr = &multicast_address; + } else { + dest_addr = ip6_current_src_addr(); + } + +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) { + na_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr, + dest_addr); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + /* Send the packet out. */ + ND6_STATS_INC(nd6.xmit); + ip6_output_if(p, src_addr, dest_addr, + LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif); + pbuf_free(p); +} + +#if LWIP_IPV6_SEND_ROUTER_SOLICIT +/** + * Send a router solicitation message + * + * @param netif the netif on which to send the message + */ +static err_t +nd6_send_rs(struct netif *netif) +{ + struct rs_header *rs_hdr; + struct lladdr_option *lladdr_opt; + struct pbuf *p; + const ip6_addr_t *src_addr; + err_t err; + u16_t lladdr_opt_len = 0; + + /* Link-local source address, or unspecified address? */ + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, 0))) { + src_addr = netif_ip6_addr(netif, 0); + } else { + src_addr = IP6_ADDR_ANY6; + } + + /* Generate the all routers target address. */ + ip6_addr_set_allrouters_linklocal(&multicast_address); + + /* Allocate a packet. */ + if (src_addr != IP6_ADDR_ANY6) { + lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0); + } + p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + (lladdr_opt_len << 3), PBUF_RAM); + if (p == NULL) { + ND6_STATS_INC(nd6.memerr); + return ERR_BUF; + } + + /* Set fields. */ + rs_hdr = (struct rs_header *)p->payload; + + rs_hdr->type = ICMP6_TYPE_RS; + rs_hdr->code = 0; + rs_hdr->chksum = 0; + rs_hdr->reserved = 0; + + if (src_addr != IP6_ADDR_ANY6) { + /* Include our hw address. */ + lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct rs_header)); + lladdr_opt->type = ND6_OPTION_TYPE_SOURCE_LLADDR; + lladdr_opt->length = (u8_t)lladdr_opt_len; + SMEMCPY(lladdr_opt->addr, netif->hwaddr, netif->hwaddr_len); + } + +#if CHECKSUM_GEN_ICMP6 + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) { + rs_hdr->chksum = ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->len, src_addr, + &multicast_address); + } +#endif /* CHECKSUM_GEN_ICMP6 */ + + /* Send the packet out. */ + ND6_STATS_INC(nd6.xmit); + + err = ip6_output_if(p, (src_addr == IP6_ADDR_ANY6) ? NULL : src_addr, &multicast_address, + LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif); + pbuf_free(p); + + return err; +} +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ + +/** + * Search for a neighbor cache entry + * + * @param ip6addr the IPv6 address of the neighbor + * @return The neighbor cache entry index that matched, -1 if no + * entry is found + */ +static s8_t +nd6_find_neighbor_cache_entry(const ip6_addr_t *ip6addr) +{ + s8_t i; + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if (ip6_addr_cmp(ip6addr, &(neighbor_cache[i].next_hop_address))) { + return i; + } + } + return -1; +} + +/** + * Create a new neighbor cache entry. + * + * If no unused entry is found, will try to recycle an old entry + * according to ad-hoc "age" heuristic. + * + * @return The neighbor cache entry index that was created, -1 if no + * entry could be created + */ +static s8_t +nd6_new_neighbor_cache_entry(void) +{ + s8_t i; + s8_t j; + u32_t time; + + + /* First, try to find an empty entry. */ + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if (neighbor_cache[i].state == ND6_NO_ENTRY) { + return i; + } + } + + /* We need to recycle an entry. in general, do not recycle if it is a router. */ + + /* Next, try to find a Stale entry. */ + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ((neighbor_cache[i].state == ND6_STALE) && + (!neighbor_cache[i].isrouter)) { + nd6_free_neighbor_cache_entry(i); + return i; + } + } + + /* Next, try to find a Probe entry. */ + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ((neighbor_cache[i].state == ND6_PROBE) && + (!neighbor_cache[i].isrouter)) { + nd6_free_neighbor_cache_entry(i); + return i; + } + } + + /* Next, try to find a Delayed entry. */ + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ((neighbor_cache[i].state == ND6_DELAY) && + (!neighbor_cache[i].isrouter)) { + nd6_free_neighbor_cache_entry(i); + return i; + } + } + + /* Next, try to find the oldest reachable entry. */ + time = 0xfffffffful; + j = -1; + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ((neighbor_cache[i].state == ND6_REACHABLE) && + (!neighbor_cache[i].isrouter)) { + if (neighbor_cache[i].counter.reachable_time < time) { + j = i; + time = neighbor_cache[i].counter.reachable_time; + } + } + } + if (j >= 0) { + nd6_free_neighbor_cache_entry(j); + return j; + } + + /* Next, find oldest incomplete entry without queued packets. */ + time = 0; + j = -1; + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ( + (neighbor_cache[i].q == NULL) && + (neighbor_cache[i].state == ND6_INCOMPLETE) && + (!neighbor_cache[i].isrouter)) { + if (neighbor_cache[i].counter.probes_sent >= time) { + j = i; + time = neighbor_cache[i].counter.probes_sent; + } + } + } + if (j >= 0) { + nd6_free_neighbor_cache_entry(j); + return j; + } + + /* Next, find oldest incomplete entry with queued packets. */ + time = 0; + j = -1; + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if ((neighbor_cache[i].state == ND6_INCOMPLETE) && + (!neighbor_cache[i].isrouter)) { + if (neighbor_cache[i].counter.probes_sent >= time) { + j = i; + time = neighbor_cache[i].counter.probes_sent; + } + } + } + if (j >= 0) { + nd6_free_neighbor_cache_entry(j); + return j; + } + + /* No more entries to try. */ + return -1; +} + +/** + * Will free any resources associated with a neighbor cache + * entry, and will mark it as unused. + * + * @param i the neighbor cache entry index to free + */ +static void +nd6_free_neighbor_cache_entry(s8_t i) +{ + if ((i < 0) || (i >= LWIP_ND6_NUM_NEIGHBORS)) { + return; + } + if (neighbor_cache[i].isrouter) { + /* isrouter needs to be cleared before deleting a neighbor cache entry */ + return; + } + + /* Free any queued packets. */ + if (neighbor_cache[i].q != NULL) { + nd6_free_q(neighbor_cache[i].q); + neighbor_cache[i].q = NULL; + } + + neighbor_cache[i].state = ND6_NO_ENTRY; + neighbor_cache[i].isrouter = 0; + neighbor_cache[i].netif = NULL; + neighbor_cache[i].counter.reachable_time = 0; + ip6_addr_set_zero(&(neighbor_cache[i].next_hop_address)); +} + +/** + * Search for a destination cache entry + * + * @param ip6addr the IPv6 address of the destination + * @return The destination cache entry index that matched, -1 if no + * entry is found + */ +static s8_t +nd6_find_destination_cache_entry(const ip6_addr_t *ip6addr) +{ + s8_t i; + for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) { + if (ip6_addr_cmp(ip6addr, &(destination_cache[i].destination_addr))) { + return i; + } + } + return -1; +} + +/** + * Create a new destination cache entry. If no unused entry is found, + * will recycle oldest entry. + * + * @return The destination cache entry index that was created, -1 if no + * entry was created + */ +static s8_t +nd6_new_destination_cache_entry(void) +{ + s8_t i, j; + u32_t age; + + /* Find an empty entry. */ + for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) { + if (ip6_addr_isany(&(destination_cache[i].destination_addr))) { + return i; + } + } + + /* Find oldest entry. */ + age = 0; + j = LWIP_ND6_NUM_DESTINATIONS - 1; + for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) { + if (destination_cache[i].age > age) { + j = i; + } + } + + return j; +} + +/** + * Clear the destination cache. + * + * This operation may be necessary for consistency in the light of changing + * local addresses and/or use of the gateway hook. + */ +void +nd6_clear_destination_cache(void) +{ + int i; + + for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) { + ip6_addr_set_any(&destination_cache[i].destination_addr); + } +} + +/** + * Determine whether an address matches an on-link prefix. + * + * @param ip6addr the IPv6 address to match + * @return 1 if the address is on-link, 0 otherwise + */ +static s8_t +nd6_is_prefix_in_netif(const ip6_addr_t *ip6addr, struct netif *netif) +{ + s8_t i; + for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) { + if ((prefix_list[i].netif == netif) && + (prefix_list[i].invalidation_timer > 0) && + ip6_addr_netcmp(ip6addr, &(prefix_list[i].prefix))) { + return 1; + } + } + /* Check to see if address prefix matches a (manually?) configured address. */ + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_netcmp(ip6addr, netif_ip6_addr(netif, i))) { + return 1; + } + } + return 0; +} + +/** + * Select a default router for a destination. + * + * @param ip6addr the destination address + * @param netif the netif for the outgoing packet, if known + * @return the default router entry index, or -1 if no suitable + * router is found + */ +static s8_t +nd6_select_router(const ip6_addr_t *ip6addr, struct netif *netif) +{ + s8_t i; + /* last_router is used for round-robin router selection (as recommended + * in RFC). This is more robust in case one router is not reachable, + * we are not stuck trying to resolve it. */ + static s8_t last_router; + (void)ip6addr; /* @todo match preferred routes!! (must implement ND6_OPTION_TYPE_ROUTE_INFO) */ + + /* @todo: implement default router preference */ + + /* Look for reachable routers. */ + for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) { + if (++last_router >= LWIP_ND6_NUM_ROUTERS) { + last_router = 0; + } + if ((default_router_list[i].neighbor_entry != NULL) && + (netif != NULL ? netif == default_router_list[i].neighbor_entry->netif : 1) && + (default_router_list[i].invalidation_timer > 0) && + (default_router_list[i].neighbor_entry->state == ND6_REACHABLE)) { + return i; + } + } + + /* Look for router in other reachability states, but still valid according to timer. */ + for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) { + if (++last_router >= LWIP_ND6_NUM_ROUTERS) { + last_router = 0; + } + if ((default_router_list[i].neighbor_entry != NULL) && + (netif != NULL ? netif == default_router_list[i].neighbor_entry->netif : 1) && + (default_router_list[i].invalidation_timer > 0)) { + return i; + } + } + + /* Look for any router for which we have any information at all. */ + for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) { + if (++last_router >= LWIP_ND6_NUM_ROUTERS) { + last_router = 0; + } + if (default_router_list[i].neighbor_entry != NULL && + (netif != NULL ? netif == default_router_list[i].neighbor_entry->netif : 1)) { + return i; + } + } + + /* no suitable router found. */ + return -1; +} + +/** + * Find a router-announced route to the given destination. + * + * The caller is responsible for checking whether the returned netif, if any, + * is in a suitable state (up, link up) to be used for packet transmission. + * + * @param ip6addr the destination IPv6 address + * @return the netif to use for the destination, or NULL if none found + */ +struct netif * +nd6_find_route(const ip6_addr_t *ip6addr) +{ + s8_t i; + + i = nd6_select_router(ip6addr, NULL); + if (i >= 0) { + if (default_router_list[i].neighbor_entry != NULL) { + return default_router_list[i].neighbor_entry->netif; /* may be NULL */ + } + } + + return NULL; +} + +/** + * Find an entry for a default router. + * + * @param router_addr the IPv6 address of the router + * @param netif the netif on which the router is found, if known + * @return the index of the router entry, or -1 if not found + */ +static s8_t +nd6_get_router(const ip6_addr_t *router_addr, struct netif *netif) +{ + s8_t i; + + /* Look for router. */ + for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) { + if ((default_router_list[i].neighbor_entry != NULL) && + ((netif != NULL) ? netif == default_router_list[i].neighbor_entry->netif : 1) && + ip6_addr_cmp(router_addr, &(default_router_list[i].neighbor_entry->next_hop_address))) { + return i; + } + } + + /* router not found. */ + return -1; +} + +/** + * Create a new entry for a default router. + * + * @param router_addr the IPv6 address of the router + * @param netif the netif on which the router is connected, if known + * @return the index on the router table, or -1 if could not be created + */ +static s8_t +nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif) +{ + s8_t router_index; + s8_t free_router_index; + s8_t neighbor_index; + + /* Do we have a neighbor entry for this router? */ + neighbor_index = nd6_find_neighbor_cache_entry(router_addr); + if (neighbor_index < 0) { + /* Create a neighbor entry for this router. */ + neighbor_index = nd6_new_neighbor_cache_entry(); + if (neighbor_index < 0) { + /* Could not create neighbor entry for this router. */ + return -1; + } + ip6_addr_set(&(neighbor_cache[neighbor_index].next_hop_address), router_addr); + neighbor_cache[neighbor_index].netif = netif; + neighbor_cache[neighbor_index].q = NULL; + neighbor_cache[neighbor_index].state = ND6_INCOMPLETE; + neighbor_cache[neighbor_index].counter.probes_sent = 1; + nd6_send_neighbor_cache_probe(&neighbor_cache[neighbor_index], ND6_SEND_FLAG_MULTICAST_DEST); + } + + /* Mark neighbor as router. */ + neighbor_cache[neighbor_index].isrouter = 1; + + /* Look for empty entry. */ + free_router_index = LWIP_ND6_NUM_ROUTERS; + for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) { + /* check if router already exists (this is a special case for 2 netifs on the same subnet + - e.g. wifi and cable) */ + if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ + return router_index; + } + if (default_router_list[router_index].neighbor_entry == NULL) { + /* remember lowest free index to create a new entry */ + free_router_index = router_index; + } + } + if (free_router_index < LWIP_ND6_NUM_ROUTERS) { + default_router_list[free_router_index].neighbor_entry = &(neighbor_cache[neighbor_index]); + return free_router_index; + } + + /* Could not create a router entry. */ + + /* Mark neighbor entry as not-router. Entry might be useful as neighbor still. */ + neighbor_cache[neighbor_index].isrouter = 0; + + /* router not found. */ + return -1; +} + +/** + * Find the cached entry for an on-link prefix. + * + * @param prefix the IPv6 prefix that is on-link + * @param netif the netif on which the prefix is on-link + * @return the index on the prefix table, or -1 if not found + */ +static s8_t +nd6_get_onlink_prefix(ip6_addr_t *prefix, struct netif *netif) +{ + s8_t i; + + /* Look for prefix in list. */ + for (i = 0; i < LWIP_ND6_NUM_PREFIXES; ++i) { + if ((ip6_addr_netcmp(&(prefix_list[i].prefix), prefix)) && + (prefix_list[i].netif == netif)) { + return i; + } + } + + /* Entry not available. */ + return -1; +} + +/** + * Creates a new entry for an on-link prefix. + * + * @param prefix the IPv6 prefix that is on-link + * @param netif the netif on which the prefix is on-link + * @return the index on the prefix table, or -1 if not created + */ +static s8_t +nd6_new_onlink_prefix(ip6_addr_t *prefix, struct netif *netif) +{ + s8_t i; + + /* Create new entry. */ + for (i = 0; i < LWIP_ND6_NUM_PREFIXES; ++i) { + if ((prefix_list[i].netif == NULL) || + (prefix_list[i].invalidation_timer == 0)) { + /* Found empty prefix entry. */ + prefix_list[i].netif = netif; + ip6_addr_set(&(prefix_list[i].prefix), prefix); +#if LWIP_IPV6_AUTOCONFIG + prefix_list[i].flags = 0; +#endif /* LWIP_IPV6_AUTOCONFIG */ + return i; + } + } + + /* Entry not available. */ + return -1; +} + +/** + * Determine the next hop for a destination. Will determine if the + * destination is on-link, else a suitable on-link router is selected. + * + * The last entry index is cached for fast entry search. + * + * @param ip6addr the destination address + * @param netif the netif on which the packet will be sent + * @return the neighbor cache entry for the next hop, ERR_RTE if no + * suitable next hop was found, ERR_MEM if no cache entry + * could be created + */ +static s8_t +nd6_get_next_hop_entry(const ip6_addr_t *ip6addr, struct netif *netif) +{ +#ifdef LWIP_HOOK_ND6_GET_GW + const ip6_addr_t *next_hop_addr; +#endif /* LWIP_HOOK_ND6_GET_GW */ + s8_t i; + +#if LWIP_NETIF_HWADDRHINT + if (netif->addr_hint != NULL) { + /* per-pcb cached entry was given */ + u8_t addr_hint = *(netif->addr_hint); + if (addr_hint < LWIP_ND6_NUM_DESTINATIONS) { + nd6_cached_destination_index = addr_hint; + } + } +#endif /* LWIP_NETIF_HWADDRHINT */ + + /* Look for ip6addr in destination cache. */ + if (ip6_addr_cmp(ip6addr, &(destination_cache[nd6_cached_destination_index].destination_addr))) { + /* the cached entry index is the right one! */ + /* do nothing. */ + ND6_STATS_INC(nd6.cachehit); + } else { + /* Search destination cache. */ + i = nd6_find_destination_cache_entry(ip6addr); + if (i >= 0) { + /* found destination entry. make it our new cached index. */ + nd6_cached_destination_index = i; + } else { + /* Not found. Create a new destination entry. */ + i = nd6_new_destination_cache_entry(); + if (i >= 0) { + /* got new destination entry. make it our new cached index. */ + nd6_cached_destination_index = i; + } else { + /* Could not create a destination cache entry. */ + return ERR_MEM; + } + + /* Copy dest address to destination cache. */ + ip6_addr_set(&(destination_cache[nd6_cached_destination_index].destination_addr), ip6addr); + + /* Now find the next hop. is it a neighbor? */ + if (ip6_addr_islinklocal(ip6addr) || + nd6_is_prefix_in_netif(ip6addr, netif)) { + /* Destination in local link. */ + destination_cache[nd6_cached_destination_index].pmtu = netif->mtu; + ip6_addr_copy(destination_cache[nd6_cached_destination_index].next_hop_addr, destination_cache[nd6_cached_destination_index].destination_addr); +#ifdef LWIP_HOOK_ND6_GET_GW + } else if ((next_hop_addr = LWIP_HOOK_ND6_GET_GW(netif, ip6addr)) != NULL) { + /* Next hop for destination provided by hook function. */ + destination_cache[nd6_cached_destination_index].pmtu = netif->mtu; + ip6_addr_set(&destination_cache[nd6_cached_destination_index].next_hop_addr, next_hop_addr); +#endif /* LWIP_HOOK_ND6_GET_GW */ + } else { + /* We need to select a router. */ + i = nd6_select_router(ip6addr, netif); + if (i < 0) { + /* No router found. */ + ip6_addr_set_any(&(destination_cache[nd6_cached_destination_index].destination_addr)); + return ERR_RTE; + } + destination_cache[nd6_cached_destination_index].pmtu = netif->mtu; /* Start with netif mtu, correct through ICMPv6 if necessary */ + ip6_addr_copy(destination_cache[nd6_cached_destination_index].next_hop_addr, default_router_list[i].neighbor_entry->next_hop_address); + } + } + } + +#if LWIP_NETIF_HWADDRHINT + if (netif->addr_hint != NULL) { + /* per-pcb cached entry was given */ + *(netif->addr_hint) = nd6_cached_destination_index; + } +#endif /* LWIP_NETIF_HWADDRHINT */ + + /* Look in neighbor cache for the next-hop address. */ + if (ip6_addr_cmp(&(destination_cache[nd6_cached_destination_index].next_hop_addr), + &(neighbor_cache[nd6_cached_neighbor_index].next_hop_address))) { + /* Cache hit. */ + /* Do nothing. */ + ND6_STATS_INC(nd6.cachehit); + } else { + i = nd6_find_neighbor_cache_entry(&(destination_cache[nd6_cached_destination_index].next_hop_addr)); + if (i >= 0) { + /* Found a matching record, make it new cached entry. */ + nd6_cached_neighbor_index = i; + } else { + /* Neighbor not in cache. Make a new entry. */ + i = nd6_new_neighbor_cache_entry(); + if (i >= 0) { + /* got new neighbor entry. make it our new cached index. */ + nd6_cached_neighbor_index = i; + } else { + /* Could not create a neighbor cache entry. */ + return ERR_MEM; + } + + /* Initialize fields. */ + ip6_addr_copy(neighbor_cache[i].next_hop_address, + destination_cache[nd6_cached_destination_index].next_hop_addr); + neighbor_cache[i].isrouter = 0; + neighbor_cache[i].netif = netif; + neighbor_cache[i].state = ND6_INCOMPLETE; + neighbor_cache[i].counter.probes_sent = 1; + nd6_send_neighbor_cache_probe(&neighbor_cache[i], ND6_SEND_FLAG_MULTICAST_DEST); + } + } + + /* Reset this destination's age. */ + destination_cache[nd6_cached_destination_index].age = 0; + + return nd6_cached_neighbor_index; +} + +/** + * Queue a packet for a neighbor. + * + * @param neighbor_index the index in the neighbor cache table + * @param q packet to be queued + * @return ERR_OK if succeeded, ERR_MEM if out of memory + */ +static err_t +nd6_queue_packet(s8_t neighbor_index, struct pbuf *q) +{ + err_t result = ERR_MEM; + struct pbuf *p; + int copy_needed = 0; +#if LWIP_ND6_QUEUEING + struct nd6_q_entry *new_entry, *r; +#endif /* LWIP_ND6_QUEUEING */ + + if ((neighbor_index < 0) || (neighbor_index >= LWIP_ND6_NUM_NEIGHBORS)) { + return ERR_ARG; + } + + /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but + * to copy the whole queue into a new PBUF_RAM (see bug #11400) + * PBUF_ROMs can be left as they are, since ROM must not get changed. */ + p = q; + while (p) { + if (p->type != PBUF_ROM) { + copy_needed = 1; + break; + } + p = p->next; + } + if (copy_needed) { + /* copy the whole packet into new pbufs */ + p = pbuf_alloc(PBUF_LINK, q->tot_len, PBUF_RAM); + while ((p == NULL) && (neighbor_cache[neighbor_index].q != NULL)) { + /* Free oldest packet (as per RFC recommendation) */ +#if LWIP_ND6_QUEUEING + r = neighbor_cache[neighbor_index].q; + neighbor_cache[neighbor_index].q = r->next; + r->next = NULL; + nd6_free_q(r); +#else /* LWIP_ND6_QUEUEING */ + pbuf_free(neighbor_cache[neighbor_index].q); + neighbor_cache[neighbor_index].q = NULL; +#endif /* LWIP_ND6_QUEUEING */ + p = pbuf_alloc(PBUF_LINK, q->tot_len, PBUF_RAM); + } + if (p != NULL) { + if (pbuf_copy(p, q) != ERR_OK) { + pbuf_free(p); + p = NULL; + } + } + } else { + /* referencing the old pbuf is enough */ + p = q; + pbuf_ref(p); + } + /* packet was copied/ref'd? */ + if (p != NULL) { + /* queue packet ... */ +#if LWIP_ND6_QUEUEING + /* allocate a new nd6 queue entry */ + new_entry = (struct nd6_q_entry *)memp_malloc(MEMP_ND6_QUEUE); + if ((new_entry == NULL) && (neighbor_cache[neighbor_index].q != NULL)) { + /* Free oldest packet (as per RFC recommendation) */ + r = neighbor_cache[neighbor_index].q; + neighbor_cache[neighbor_index].q = r->next; + r->next = NULL; + nd6_free_q(r); + new_entry = (struct nd6_q_entry *)memp_malloc(MEMP_ND6_QUEUE); + } + if (new_entry != NULL) { + new_entry->next = NULL; + new_entry->p = p; + if (neighbor_cache[neighbor_index].q != NULL) { + /* queue was already existent, append the new entry to the end */ + r = neighbor_cache[neighbor_index].q; + while (r->next != NULL) { + r = r->next; + } + r->next = new_entry; + } else { + /* queue did not exist, first item in queue */ + neighbor_cache[neighbor_index].q = new_entry; + } + LWIP_DEBUGF(LWIP_DBG_TRACE, ("ipv6: queued packet %p on neighbor entry %"S16_F"\n", (void *)p, (s16_t)neighbor_index)); + result = ERR_OK; + } else { + /* the pool MEMP_ND6_QUEUE is empty */ + pbuf_free(p); + LWIP_DEBUGF(LWIP_DBG_TRACE, ("ipv6: could not queue a copy of packet %p (out of memory)\n", (void *)p)); + /* { result == ERR_MEM } through initialization */ + } +#else /* LWIP_ND6_QUEUEING */ + /* Queue a single packet. If an older packet is already queued, free it as per RFC. */ + if (neighbor_cache[neighbor_index].q != NULL) { + pbuf_free(neighbor_cache[neighbor_index].q); + } + neighbor_cache[neighbor_index].q = p; + LWIP_DEBUGF(LWIP_DBG_TRACE, ("ipv6: queued packet %p on neighbor entry %"S16_F"\n", (void *)p, (s16_t)neighbor_index)); + result = ERR_OK; +#endif /* LWIP_ND6_QUEUEING */ + } else { + LWIP_DEBUGF(LWIP_DBG_TRACE, ("ipv6: could not queue a copy of packet %p (out of memory)\n", (void *)q)); + /* { result == ERR_MEM } through initialization */ + } + + return result; +} + +#if LWIP_ND6_QUEUEING +/** + * Free a complete queue of nd6 q entries + * + * @param q a queue of nd6_q_entry to free + */ +static void +nd6_free_q(struct nd6_q_entry *q) +{ + struct nd6_q_entry *r; + LWIP_ASSERT("q != NULL", q != NULL); + LWIP_ASSERT("q->p != NULL", q->p != NULL); + while (q) { + r = q; + q = q->next; + LWIP_ASSERT("r->p != NULL", (r->p != NULL)); + pbuf_free(r->p); + memp_free(MEMP_ND6_QUEUE, r); + } +} +#endif /* LWIP_ND6_QUEUEING */ + +/** + * Send queued packets for a neighbor + * + * @param i the neighbor to send packets to + */ +static void +nd6_send_q(s8_t i) +{ + struct ip6_hdr *ip6hdr; + ip6_addr_t dest; +#if LWIP_ND6_QUEUEING + struct nd6_q_entry *q; +#endif /* LWIP_ND6_QUEUEING */ + + if ((i < 0) || (i >= LWIP_ND6_NUM_NEIGHBORS)) { + return; + } + +#if LWIP_ND6_QUEUEING + while (neighbor_cache[i].q != NULL) { + /* remember first in queue */ + q = neighbor_cache[i].q; + /* pop first item off the queue */ + neighbor_cache[i].q = q->next; + /* Get ipv6 header. */ + ip6hdr = (struct ip6_hdr *)(q->p->payload); + /* Create an aligned copy. */ + ip6_addr_set(&dest, &(ip6hdr->dest)); + /* send the queued IPv6 packet */ + (neighbor_cache[i].netif)->output_ip6(neighbor_cache[i].netif, q->p, &dest); + /* free the queued IP packet */ + pbuf_free(q->p); + /* now queue entry can be freed */ + memp_free(MEMP_ND6_QUEUE, q); + } +#else /* LWIP_ND6_QUEUEING */ + if (neighbor_cache[i].q != NULL) { + /* Get ipv6 header. */ + ip6hdr = (struct ip6_hdr *)(neighbor_cache[i].q->payload); + /* Create an aligned copy. */ + ip6_addr_set(&dest, &(ip6hdr->dest)); + /* send the queued IPv6 packet */ + (neighbor_cache[i].netif)->output_ip6(neighbor_cache[i].netif, neighbor_cache[i].q, &dest); + /* free the queued IP packet */ + pbuf_free(neighbor_cache[i].q); + neighbor_cache[i].q = NULL; + } +#endif /* LWIP_ND6_QUEUEING */ +} + +/** + * A packet is to be transmitted to a specific IPv6 destination on a specific + * interface. Check if we can find the hardware address of the next hop to use + * for the packet. If so, give the hardware address to the caller, which should + * use it to send the packet right away. Otherwise, enqueue the packet for + * later transmission while looking up the hardware address, if possible. + * + * As such, this function returns one of three different possible results: + * + * - ERR_OK with a non-NULL 'hwaddrp': the caller should send the packet now. + * - ERR_OK with a NULL 'hwaddrp': the packet has been enqueued for later. + * - not ERR_OK: something went wrong; forward the error upward in the stack. + * + * @param netif The lwIP network interface on which the IP packet will be sent. + * @param q The pbuf(s) containing the IP packet to be sent. + * @param ip6addr The destination IPv6 address of the packet. + * @param hwaddrp On success, filled with a pointer to a HW address or NULL (meaning + * the packet has been queued). + * @return + * - ERR_OK on success, ERR_RTE if no route was found for the packet, + * or ERR_MEM if low memory conditions prohibit sending the packet at all. + */ +err_t +nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp) +{ + s8_t i; + + /* Get next hop record. */ + i = nd6_get_next_hop_entry(ip6addr, netif); + if (i < 0) { + /* failed to get a next hop neighbor record. */ + return i; + } + + /* Now that we have a destination record, send or queue the packet. */ + if (neighbor_cache[i].state == ND6_STALE) { + /* Switch to delay state. */ + neighbor_cache[i].state = ND6_DELAY; + neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL; + } + /* @todo should we send or queue if PROBE? send for now, to let unicast NS pass. */ + if ((neighbor_cache[i].state == ND6_REACHABLE) || + (neighbor_cache[i].state == ND6_DELAY) || + (neighbor_cache[i].state == ND6_PROBE)) { + + /* Tell the caller to send out the packet now. */ + *hwaddrp = neighbor_cache[i].lladdr; + return ERR_OK; + } + + /* We should queue packet on this interface. */ + *hwaddrp = NULL; + return nd6_queue_packet(i, q); +} + + +/** + * Get the Path MTU for a destination. + * + * @param ip6addr the destination address + * @param netif the netif on which the packet will be sent + * @return the Path MTU, if known, or the netif default MTU + */ +u16_t +nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif) +{ + s8_t i; + + i = nd6_find_destination_cache_entry(ip6addr); + if (i >= 0) { + if (destination_cache[i].pmtu > 0) { + return destination_cache[i].pmtu; + } + } + + if (netif != NULL) { + return netif->mtu; + } + + return 1280; /* Minimum MTU */ +} + + +#if LWIP_ND6_TCP_REACHABILITY_HINTS +/** + * Provide the Neighbor discovery process with a hint that a + * destination is reachable. Called by tcp_receive when ACKs are + * received or sent (as per RFC). This is useful to avoid sending + * NS messages every 30 seconds. + * + * @param ip6addr the destination address which is know to be reachable + * by an upper layer protocol (TCP) + */ +void +nd6_reachability_hint(const ip6_addr_t *ip6addr) +{ + s8_t i; + + /* Find destination in cache. */ + if (ip6_addr_cmp(ip6addr, &(destination_cache[nd6_cached_destination_index].destination_addr))) { + i = nd6_cached_destination_index; + ND6_STATS_INC(nd6.cachehit); + } else { + i = nd6_find_destination_cache_entry(ip6addr); + } + if (i < 0) { + return; + } + + /* Find next hop neighbor in cache. */ + if (ip6_addr_cmp(&(destination_cache[i].next_hop_addr), &(neighbor_cache[nd6_cached_neighbor_index].next_hop_address))) { + i = nd6_cached_neighbor_index; + ND6_STATS_INC(nd6.cachehit); + } else { + i = nd6_find_neighbor_cache_entry(&(destination_cache[i].next_hop_addr)); + } + if (i < 0) { + return; + } + + /* For safety: don't set as reachable if we don't have a LL address yet. Misuse protection. */ + if (neighbor_cache[i].state == ND6_INCOMPLETE || neighbor_cache[i].state == ND6_NO_ENTRY) { + return; + } + + /* Set reachability state. */ + neighbor_cache[i].state = ND6_REACHABLE; + neighbor_cache[i].counter.reachable_time = reachable_time; +} +#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */ + +/** + * Remove all prefix, neighbor_cache and router entries of the specified netif. + * + * @param netif points to a network interface + */ +void +nd6_cleanup_netif(struct netif *netif) +{ + u8_t i; + s8_t router_index; + for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) { + if (prefix_list[i].netif == netif) { + prefix_list[i].netif = NULL; + prefix_list[i].flags = 0; + } + } + for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) { + if (neighbor_cache[i].netif == netif) { + for (router_index = 0; router_index < LWIP_ND6_NUM_ROUTERS; router_index++) { + if (default_router_list[router_index].neighbor_entry == &neighbor_cache[i]) { + default_router_list[router_index].neighbor_entry = NULL; + default_router_list[router_index].flags = 0; + } + } + neighbor_cache[i].isrouter = 0; + nd6_free_neighbor_cache_entry(i); + } + } +} + +#if LWIP_IPV6_MLD +/** + * The state of a local IPv6 address entry is about to change. If needed, join + * or leave the solicited-node multicast group for the address. + * + * @param netif The netif that owns the address. + * @param addr_idx The index of the address. + * @param new_state The new (IP6_ADDR_) state for the address. + */ +void +nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state) +{ + u8_t old_state, old_member, new_member; + + old_state = netif_ip6_addr_state(netif, addr_idx); + + /* Determine whether we were, and should be, a member of the solicited-node + * multicast group for this address. For tentative addresses, the group is + * not joined until the address enters the TENTATIVE_1 (or VALID) state. */ + old_member = (old_state != IP6_ADDR_INVALID && old_state != IP6_ADDR_TENTATIVE); + new_member = (new_state != IP6_ADDR_INVALID && new_state != IP6_ADDR_TENTATIVE); + + if (old_member != new_member) { + ip6_addr_set_solicitednode(&multicast_address, netif_ip6_addr(netif, addr_idx)->addr[3]); + + if (new_member) { + mld6_joingroup_netif(netif, &multicast_address); + } else { + mld6_leavegroup_netif(netif, &multicast_address); + } + } +} +#endif /* LWIP_IPV6_MLD */ + +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/mem.c new file mode 100644 index 0000000..db3b7cc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/mem.c @@ -0,0 +1,777 @@ +/** + * @file + * Dynamic memory manager + * + * This is a lightweight replacement for the standard C library malloc(). + * + * If you want to use the standard C library malloc() instead, define + * MEM_LIBC_MALLOC to 1 in your lwipopts.h + * + * To let mem_malloc() use pools (prevents fragmentation and is much faster than + * a heap but might waste some memory), define MEM_USE_POOLS to 1, define + * MEMP_USE_CUSTOM_POOLS to 1 and create a file "lwippools.h" that includes a list + * of pools like this (more pools can be added between _START and _END): + * + * Define three pools with sizes 256, 512, and 1512 bytes + * LWIP_MALLOC_MEMPOOL_START + * LWIP_MALLOC_MEMPOOL(20, 256) + * LWIP_MALLOC_MEMPOOL(10, 512) + * LWIP_MALLOC_MEMPOOL(5, 1512) + * LWIP_MALLOC_MEMPOOL_END + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * Simon Goldschmidt + * + */ + +#include "lwip/opt.h" +#include "lwip/mem.h" +#include "lwip/def.h" +#include "lwip/sys.h" +#include "lwip/stats.h" +#include "lwip/err.h" + +#include + +#if MEM_LIBC_MALLOC +#include /* for malloc()/free() */ +#endif + +#if MEM_LIBC_MALLOC || MEM_USE_POOLS + +/** mem_init is not used when using pools instead of a heap or using + * C library malloc(). + */ +void +mem_init(void) +{ +} + +/** mem_trim is not used when using pools instead of a heap or using + * C library malloc(): we can't free part of a pool element and the stack + * support mem_trim() to return a different pointer + */ +void* +mem_trim(void *mem, mem_size_t size) +{ + LWIP_UNUSED_ARG(size); + return mem; +} +#endif /* MEM_LIBC_MALLOC || MEM_USE_POOLS */ + +#if MEM_LIBC_MALLOC +/* lwIP heap implemented using C library malloc() */ + +/* in case C library malloc() needs extra protection, + * allow these defines to be overridden. + */ +#ifndef mem_clib_free +#define mem_clib_free free +#endif +#ifndef mem_clib_malloc +#define mem_clib_malloc malloc +#endif +#ifndef mem_clib_calloc +#define mem_clib_calloc calloc +#endif + +#if LWIP_STATS && MEM_STATS +#define MEM_LIBC_STATSHELPER_SIZE LWIP_MEM_ALIGN_SIZE(sizeof(mem_size_t)) +#else +#define MEM_LIBC_STATSHELPER_SIZE 0 +#endif + +/** + * Allocate a block of memory with a minimum of 'size' bytes. + * + * @param size is the minimum size of the requested block in bytes. + * @return pointer to allocated memory or NULL if no free memory was found. + * + * Note that the returned value must always be aligned (as defined by MEM_ALIGNMENT). + */ +void * +mem_malloc(mem_size_t size) +{ + void* ret = mem_clib_malloc(size + MEM_LIBC_STATSHELPER_SIZE); + if (ret == NULL) { + MEM_STATS_INC(err); + } else { + LWIP_ASSERT("malloc() must return aligned memory", LWIP_MEM_ALIGN(ret) == ret); +#if LWIP_STATS && MEM_STATS + *(mem_size_t*)ret = size; + ret = (u8_t*)ret + MEM_LIBC_STATSHELPER_SIZE; + MEM_STATS_INC_USED(used, size); +#endif + } + return ret; +} + +/** Put memory back on the heap + * + * @param rmem is the pointer as returned by a previous call to mem_malloc() + */ +void +mem_free(void *rmem) +{ + LWIP_ASSERT("rmem != NULL", (rmem != NULL)); + LWIP_ASSERT("rmem == MEM_ALIGN(rmem)", (rmem == LWIP_MEM_ALIGN(rmem))); +#if LWIP_STATS && MEM_STATS + rmem = (u8_t*)rmem - MEM_LIBC_STATSHELPER_SIZE; + MEM_STATS_DEC_USED(used, *(mem_size_t*)rmem); +#endif + mem_clib_free(rmem); +} + +#elif MEM_USE_POOLS + +/* lwIP heap implemented with different sized pools */ + +/** + * Allocate memory: determine the smallest pool that is big enough + * to contain an element of 'size' and get an element from that pool. + * + * @param size the size in bytes of the memory needed + * @return a pointer to the allocated memory or NULL if the pool is empty + */ +void * +mem_malloc(mem_size_t size) +{ + void *ret; + struct memp_malloc_helper *element = NULL; + memp_t poolnr; + mem_size_t required_size = size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper)); + + for (poolnr = MEMP_POOL_FIRST; poolnr <= MEMP_POOL_LAST; poolnr = (memp_t)(poolnr + 1)) { + /* is this pool big enough to hold an element of the required size + plus a struct memp_malloc_helper that saves the pool this element came from? */ + if (required_size <= memp_pools[poolnr]->size) { + element = (struct memp_malloc_helper*)memp_malloc(poolnr); + if (element == NULL) { + /* No need to DEBUGF or ASSERT: This error is already taken care of in memp.c */ +#if MEM_USE_POOLS_TRY_BIGGER_POOL + /** Try a bigger pool if this one is empty! */ + if (poolnr < MEMP_POOL_LAST) { + continue; + } +#endif /* MEM_USE_POOLS_TRY_BIGGER_POOL */ + MEM_STATS_INC(err); + return NULL; + } + break; + } + } + if (poolnr > MEMP_POOL_LAST) { + LWIP_ASSERT("mem_malloc(): no pool is that big!", 0); + MEM_STATS_INC(err); + return NULL; + } + + /* save the pool number this element came from */ + element->poolnr = poolnr; + /* and return a pointer to the memory directly after the struct memp_malloc_helper */ + ret = (u8_t*)element + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper)); + +#if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) + /* truncating to u16_t is safe because struct memp_desc::size is u16_t */ + element->size = (u16_t)size; + MEM_STATS_INC_USED(used, element->size); +#endif /* MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) */ +#if MEMP_OVERFLOW_CHECK + /* initialize unused memory (diff between requested size and selected pool's size) */ + memset((u8_t*)ret + size, 0xcd, memp_pools[poolnr]->size - size); +#endif /* MEMP_OVERFLOW_CHECK */ + return ret; +} + +/** + * Free memory previously allocated by mem_malloc. Loads the pool number + * and calls memp_free with that pool number to put the element back into + * its pool + * + * @param rmem the memory element to free + */ +void +mem_free(void *rmem) +{ + struct memp_malloc_helper *hmem; + + LWIP_ASSERT("rmem != NULL", (rmem != NULL)); + LWIP_ASSERT("rmem == MEM_ALIGN(rmem)", (rmem == LWIP_MEM_ALIGN(rmem))); + + /* get the original struct memp_malloc_helper */ + /* cast through void* to get rid of alignment warnings */ + hmem = (struct memp_malloc_helper*)(void*)((u8_t*)rmem - LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))); + + LWIP_ASSERT("hmem != NULL", (hmem != NULL)); + LWIP_ASSERT("hmem == MEM_ALIGN(hmem)", (hmem == LWIP_MEM_ALIGN(hmem))); + LWIP_ASSERT("hmem->poolnr < MEMP_MAX", (hmem->poolnr < MEMP_MAX)); + + MEM_STATS_DEC_USED(used, hmem->size); +#if MEMP_OVERFLOW_CHECK + { + u16_t i; + LWIP_ASSERT("MEM_USE_POOLS: invalid chunk size", + hmem->size <= memp_pools[hmem->poolnr]->size); + /* check that unused memory remained untouched (diff between requested size and selected pool's size) */ + for (i = hmem->size; i < memp_pools[hmem->poolnr]->size; i++) { + u8_t data = *((u8_t*)rmem + i); + LWIP_ASSERT("MEM_USE_POOLS: mem overflow detected", data == 0xcd); + } + } +#endif /* MEMP_OVERFLOW_CHECK */ + + /* and put it in the pool we saved earlier */ + memp_free(hmem->poolnr, hmem); +} + +#else /* MEM_USE_POOLS */ +/* lwIP replacement for your libc malloc() */ + +/** + * The heap is made up as a list of structs of this type. + * This does not have to be aligned since for getting its size, + * we only use the macro SIZEOF_STRUCT_MEM, which automatically aligns. + */ +struct mem { + /** index (-> ram[next]) of the next struct */ + mem_size_t next; + /** index (-> ram[prev]) of the previous struct */ + mem_size_t prev; + /** 1: this area is used; 0: this area is unused */ + u8_t used; +}; + +/** All allocated blocks will be MIN_SIZE bytes big, at least! + * MIN_SIZE can be overridden to suit your needs. Smaller values save space, + * larger values could prevent too small blocks to fragment the RAM too much. */ +#ifndef MIN_SIZE +#define MIN_SIZE 12 +#endif /* MIN_SIZE */ +/* some alignment macros: we define them here for better source code layout */ +#define MIN_SIZE_ALIGNED LWIP_MEM_ALIGN_SIZE(MIN_SIZE) +#define SIZEOF_STRUCT_MEM LWIP_MEM_ALIGN_SIZE(sizeof(struct mem)) +#define MEM_SIZE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEM_SIZE) + +/** If you want to relocate the heap to external memory, simply define + * LWIP_RAM_HEAP_POINTER as a void-pointer to that location. + * If so, make sure the memory at that location is big enough (see below on + * how that space is calculated). */ +#ifndef LWIP_RAM_HEAP_POINTER +/** the heap. we need one struct mem at the end and some room for alignment */ +LWIP_DECLARE_MEMORY_ALIGNED(ram_heap, MEM_SIZE_ALIGNED + (2U*SIZEOF_STRUCT_MEM)); +#define LWIP_RAM_HEAP_POINTER ram_heap +#endif /* LWIP_RAM_HEAP_POINTER */ + +/** pointer to the heap (ram_heap): for alignment, ram is now a pointer instead of an array */ +static u8_t *ram; +/** the last entry, always unused! */ +static struct mem *ram_end; +/** pointer to the lowest free block, this is used for faster search */ +static struct mem *lfree; + +/** concurrent access protection */ +#if !NO_SYS +static sys_mutex_t mem_mutex; +#endif + +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + +static volatile u8_t mem_free_count; + +/* Allow mem_free from other (e.g. interrupt) context */ +#define LWIP_MEM_FREE_DECL_PROTECT() SYS_ARCH_DECL_PROTECT(lev_free) +#define LWIP_MEM_FREE_PROTECT() SYS_ARCH_PROTECT(lev_free) +#define LWIP_MEM_FREE_UNPROTECT() SYS_ARCH_UNPROTECT(lev_free) +#define LWIP_MEM_ALLOC_DECL_PROTECT() SYS_ARCH_DECL_PROTECT(lev_alloc) +#define LWIP_MEM_ALLOC_PROTECT() SYS_ARCH_PROTECT(lev_alloc) +#define LWIP_MEM_ALLOC_UNPROTECT() SYS_ARCH_UNPROTECT(lev_alloc) + +#else /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + +/* Protect the heap only by using a semaphore */ +#define LWIP_MEM_FREE_DECL_PROTECT() +#define LWIP_MEM_FREE_PROTECT() sys_mutex_lock(&mem_mutex) +#define LWIP_MEM_FREE_UNPROTECT() sys_mutex_unlock(&mem_mutex) +/* mem_malloc is protected using semaphore AND LWIP_MEM_ALLOC_PROTECT */ +#define LWIP_MEM_ALLOC_DECL_PROTECT() +#define LWIP_MEM_ALLOC_PROTECT() +#define LWIP_MEM_ALLOC_UNPROTECT() + +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + + +/** + * "Plug holes" by combining adjacent empty struct mems. + * After this function is through, there should not exist + * one empty struct mem pointing to another empty struct mem. + * + * @param mem this points to a struct mem which just has been freed + * @internal this function is only called by mem_free() and mem_trim() + * + * This assumes access to the heap is protected by the calling function + * already. + */ +static void +plug_holes(struct mem *mem) +{ + struct mem *nmem; + struct mem *pmem; + + LWIP_ASSERT("plug_holes: mem >= ram", (u8_t *)mem >= ram); + LWIP_ASSERT("plug_holes: mem < ram_end", (u8_t *)mem < (u8_t *)ram_end); + LWIP_ASSERT("plug_holes: mem->used == 0", mem->used == 0); + + /* plug hole forward */ + LWIP_ASSERT("plug_holes: mem->next <= MEM_SIZE_ALIGNED", mem->next <= MEM_SIZE_ALIGNED); + + nmem = (struct mem *)(void *)&ram[mem->next]; + if (mem != nmem && nmem->used == 0 && (u8_t *)nmem != (u8_t *)ram_end) { + /* if mem->next is unused and not end of ram, combine mem and mem->next */ + if (lfree == nmem) { + lfree = mem; + } + mem->next = nmem->next; + ((struct mem *)(void *)&ram[nmem->next])->prev = (mem_size_t)((u8_t *)mem - ram); + } + + /* plug hole backward */ + pmem = (struct mem *)(void *)&ram[mem->prev]; + if (pmem != mem && pmem->used == 0) { + /* if mem->prev is unused, combine mem and mem->prev */ + if (lfree == mem) { + lfree = pmem; + } + pmem->next = mem->next; + ((struct mem *)(void *)&ram[mem->next])->prev = (mem_size_t)((u8_t *)pmem - ram); + } +} + +/** + * Zero the heap and initialize start, end and lowest-free + */ +void +mem_init(void) +{ + struct mem *mem; + + LWIP_ASSERT("Sanity check alignment", + (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0); + + /* align the heap */ + ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER); + /* initialize the start of the heap */ + mem = (struct mem *)(void *)ram; + mem->next = MEM_SIZE_ALIGNED; + mem->prev = 0; + mem->used = 0; + /* initialize the end of the heap */ + ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIGNED]; + ram_end->used = 1; + ram_end->next = MEM_SIZE_ALIGNED; + ram_end->prev = MEM_SIZE_ALIGNED; + + /* initialize the lowest-free pointer to the start of the heap */ + lfree = (struct mem *)(void *)ram; + + MEM_STATS_AVAIL(avail, MEM_SIZE_ALIGNED); + + if (sys_mutex_new(&mem_mutex) != ERR_OK) { + LWIP_ASSERT("failed to create mem_mutex", 0); + } +} + +/** + * Put a struct mem back on the heap + * + * @param rmem is the data portion of a struct mem as returned by a previous + * call to mem_malloc() + */ +void +mem_free(void *rmem) +{ + struct mem *mem; + LWIP_MEM_FREE_DECL_PROTECT(); + + if (rmem == NULL) { + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("mem_free(p == NULL) was called.\n")); + return; + } + LWIP_ASSERT("mem_free: sanity check alignment", (((mem_ptr_t)rmem) & (MEM_ALIGNMENT-1)) == 0); + + LWIP_ASSERT("mem_free: legal memory", (u8_t *)rmem >= (u8_t *)ram && + (u8_t *)rmem < (u8_t *)ram_end); + + if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { + SYS_ARCH_DECL_PROTECT(lev); + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_free: illegal memory\n")); + /* protect mem stats from concurrent access */ + SYS_ARCH_PROTECT(lev); + MEM_STATS_INC(illegal); + SYS_ARCH_UNPROTECT(lev); + return; + } + /* protect the heap from concurrent access */ + LWIP_MEM_FREE_PROTECT(); + /* Get the corresponding struct mem ... */ + /* cast through void* to get rid of alignment warnings */ + mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM); + /* ... which has to be in a used state ... */ + LWIP_ASSERT("mem_free: mem->used", mem->used); + /* ... and is now unused. */ + mem->used = 0; + + if (mem < lfree) { + /* the newly freed struct is now the lowest */ + lfree = mem; + } + + MEM_STATS_DEC_USED(used, mem->next - (mem_size_t)(((u8_t *)mem - ram))); + + /* finally, see if prev or next are free also */ + plug_holes(mem); +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 1; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_FREE_UNPROTECT(); +} + +/** + * Shrink memory returned by mem_malloc(). + * + * @param rmem pointer to memory allocated by mem_malloc the is to be shrinked + * @param newsize required size after shrinking (needs to be smaller than or + * equal to the previous size) + * @return for compatibility reasons: is always == rmem, at the moment + * or NULL if newsize is > old size, in which case rmem is NOT touched + * or freed! + */ +void * +mem_trim(void *rmem, mem_size_t newsize) +{ + mem_size_t size; + mem_size_t ptr, ptr2; + struct mem *mem, *mem2; + /* use the FREE_PROTECT here: it protects with sem OR SYS_ARCH_PROTECT */ + LWIP_MEM_FREE_DECL_PROTECT(); + + /* Expand the size of the allocated memory region so that we can + adjust for alignment. */ + newsize = LWIP_MEM_ALIGN_SIZE(newsize); + + if (newsize < MIN_SIZE_ALIGNED) { + /* every data block must be at least MIN_SIZE_ALIGNED long */ + newsize = MIN_SIZE_ALIGNED; + } + + if (newsize > MEM_SIZE_ALIGNED) { + return NULL; + } + + LWIP_ASSERT("mem_trim: legal memory", (u8_t *)rmem >= (u8_t *)ram && + (u8_t *)rmem < (u8_t *)ram_end); + + if ((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { + SYS_ARCH_DECL_PROTECT(lev); + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("mem_trim: illegal memory\n")); + /* protect mem stats from concurrent access */ + SYS_ARCH_PROTECT(lev); + MEM_STATS_INC(illegal); + SYS_ARCH_UNPROTECT(lev); + return rmem; + } + /* Get the corresponding struct mem ... */ + /* cast through void* to get rid of alignment warnings */ + mem = (struct mem *)(void *)((u8_t *)rmem - SIZEOF_STRUCT_MEM); + /* ... and its offset pointer */ + ptr = (mem_size_t)((u8_t *)mem - ram); + + size = mem->next - ptr - SIZEOF_STRUCT_MEM; + LWIP_ASSERT("mem_trim can only shrink memory", newsize <= size); + if (newsize > size) { + /* not supported */ + return NULL; + } + if (newsize == size) { + /* No change in size, simply return */ + return rmem; + } + + /* protect the heap from concurrent access */ + LWIP_MEM_FREE_PROTECT(); + + mem2 = (struct mem *)(void *)&ram[mem->next]; + if (mem2->used == 0) { + /* The next struct is unused, we can simply move it at little */ + mem_size_t next; + /* remember the old next pointer */ + next = mem2->next; + /* create new struct mem which is moved directly after the shrinked mem */ + ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize; + if (lfree == mem2) { + lfree = (struct mem *)(void *)&ram[ptr2]; + } + mem2 = (struct mem *)(void *)&ram[ptr2]; + mem2->used = 0; + /* restore the next pointer */ + mem2->next = next; + /* link it back to mem */ + mem2->prev = ptr; + /* link mem to it */ + mem->next = ptr2; + /* last thing to restore linked list: as we have moved mem2, + * let 'mem2->next->prev' point to mem2 again. but only if mem2->next is not + * the end of the heap */ + if (mem2->next != MEM_SIZE_ALIGNED) { + ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2; + } + MEM_STATS_DEC_USED(used, (size - newsize)); + /* no need to plug holes, we've already done that */ + } else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) { + /* Next struct is used but there's room for another struct mem with + * at least MIN_SIZE_ALIGNED of data. + * Old size ('size') must be big enough to contain at least 'newsize' plus a struct mem + * ('SIZEOF_STRUCT_MEM') with some data ('MIN_SIZE_ALIGNED'). + * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty + * region that couldn't hold data, but when mem->next gets freed, + * the 2 regions would be combined, resulting in more free memory */ + ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize; + mem2 = (struct mem *)(void *)&ram[ptr2]; + if (mem2 < lfree) { + lfree = mem2; + } + mem2->used = 0; + mem2->next = mem->next; + mem2->prev = ptr; + mem->next = ptr2; + if (mem2->next != MEM_SIZE_ALIGNED) { + ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2; + } + MEM_STATS_DEC_USED(used, (size - newsize)); + /* the original mem->next is used, so no need to plug holes! */ + } + /* else { + next struct mem is used but size between mem and mem2 is not big enough + to create another struct mem + -> don't do anyhting. + -> the remaining space stays unused since it is too small + } */ +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 1; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_FREE_UNPROTECT(); + return rmem; +} + +/** + * Allocate a block of memory with a minimum of 'size' bytes. + * + * @param size is the minimum size of the requested block in bytes. + * @return pointer to allocated memory or NULL if no free memory was found. + * + * Note that the returned value will always be aligned (as defined by MEM_ALIGNMENT). + */ +void * +mem_malloc(mem_size_t size) +{ + mem_size_t ptr, ptr2; + struct mem *mem, *mem2; +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + u8_t local_mem_free_count = 0; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_MEM_ALLOC_DECL_PROTECT(); + + if (size == 0) { + return NULL; + } + + /* Expand the size of the allocated memory region so that we can + adjust for alignment. */ + size = LWIP_MEM_ALIGN_SIZE(size); + + if (size < MIN_SIZE_ALIGNED) { + /* every data block must be at least MIN_SIZE_ALIGNED long */ + size = MIN_SIZE_ALIGNED; + } + + if (size > MEM_SIZE_ALIGNED) { + return NULL; + } + + /* protect the heap from concurrent access */ + sys_mutex_lock(&mem_mutex); + LWIP_MEM_ALLOC_PROTECT(); +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + /* run as long as a mem_free disturbed mem_malloc or mem_trim */ + do { + local_mem_free_count = 0; +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + + /* Scan through the heap searching for a free block that is big enough, + * beginning with the lowest free block. + */ + for (ptr = (mem_size_t)((u8_t *)lfree - ram); ptr < MEM_SIZE_ALIGNED - size; + ptr = ((struct mem *)(void *)&ram[ptr])->next) { + mem = (struct mem *)(void *)&ram[ptr]; +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 0; + LWIP_MEM_ALLOC_UNPROTECT(); + /* allow mem_free or mem_trim to run */ + LWIP_MEM_ALLOC_PROTECT(); + if (mem_free_count != 0) { + /* If mem_free or mem_trim have run, we have to restart since they + could have altered our current struct mem. */ + local_mem_free_count = 1; + break; + } +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + + if ((!mem->used) && + (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) { + /* mem is not used and at least perfect fit is possible: + * mem->next - (ptr + SIZEOF_STRUCT_MEM) gives us the 'user data size' of mem */ + + if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) { + /* (in addition to the above, we test if another struct mem (SIZEOF_STRUCT_MEM) containing + * at least MIN_SIZE_ALIGNED of data also fits in the 'user data space' of 'mem') + * -> split large block, create empty remainder, + * remainder must be large enough to contain MIN_SIZE_ALIGNED data: if + * mem->next - (ptr + (2*SIZEOF_STRUCT_MEM)) == size, + * struct mem would fit in but no data between mem2 and mem2->next + * @todo we could leave out MIN_SIZE_ALIGNED. We would create an empty + * region that couldn't hold data, but when mem->next gets freed, + * the 2 regions would be combined, resulting in more free memory + */ + ptr2 = ptr + SIZEOF_STRUCT_MEM + size; + /* create mem2 struct */ + mem2 = (struct mem *)(void *)&ram[ptr2]; + mem2->used = 0; + mem2->next = mem->next; + mem2->prev = ptr; + /* and insert it between mem and mem->next */ + mem->next = ptr2; + mem->used = 1; + + if (mem2->next != MEM_SIZE_ALIGNED) { + ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2; + } + MEM_STATS_INC_USED(used, (size + SIZEOF_STRUCT_MEM)); + } else { + /* (a mem2 struct does no fit into the user data space of mem and mem->next will always + * be used at this point: if not we have 2 unused structs in a row, plug_holes should have + * take care of this). + * -> near fit or exact fit: do not split, no mem2 creation + * also can't move mem->next directly behind mem, since mem->next + * will always be used at this point! + */ + mem->used = 1; + MEM_STATS_INC_USED(used, mem->next - (mem_size_t)((u8_t *)mem - ram)); + } +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT +mem_malloc_adjust_lfree: +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + if (mem == lfree) { + struct mem *cur = lfree; + /* Find next free block after mem and update lowest free pointer */ + while (cur->used && cur != ram_end) { +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + mem_free_count = 0; + LWIP_MEM_ALLOC_UNPROTECT(); + /* prevent high interrupt latency... */ + LWIP_MEM_ALLOC_PROTECT(); + if (mem_free_count != 0) { + /* If mem_free or mem_trim have run, we have to restart since they + could have altered our current struct mem or lfree. */ + goto mem_malloc_adjust_lfree; + } +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + cur = (struct mem *)(void *)&ram[cur->next]; + } + lfree = cur; + LWIP_ASSERT("mem_malloc: !lfree->used", ((lfree == ram_end) || (!lfree->used))); + } + LWIP_MEM_ALLOC_UNPROTECT(); + sys_mutex_unlock(&mem_mutex); + LWIP_ASSERT("mem_malloc: allocated memory not above ram_end.", + (mem_ptr_t)mem + SIZEOF_STRUCT_MEM + size <= (mem_ptr_t)ram_end); + LWIP_ASSERT("mem_malloc: allocated memory properly aligned.", + ((mem_ptr_t)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0); + LWIP_ASSERT("mem_malloc: sanity check alignment", + (((mem_ptr_t)mem) & (MEM_ALIGNMENT-1)) == 0); + + return (u8_t *)mem + SIZEOF_STRUCT_MEM; + } + } +#if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT + /* if we got interrupted by a mem_free, try again */ + } while (local_mem_free_count != 0); +#endif /* LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT */ + LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_malloc: could not allocate %"S16_F" bytes\n", (s16_t)size)); + MEM_STATS_INC(err); + LWIP_MEM_ALLOC_UNPROTECT(); + sys_mutex_unlock(&mem_mutex); + return NULL; +} + +#endif /* MEM_USE_POOLS */ + +#if MEM_LIBC_MALLOC && (!LWIP_STATS || !MEM_STATS) +void * +mem_calloc(mem_size_t count, mem_size_t size) +{ + return mem_clib_calloc(count, size); +} + +#else /* MEM_LIBC_MALLOC && (!LWIP_STATS || !MEM_STATS) */ +/** + * Contiguously allocates enough space for count objects that are size bytes + * of memory each and returns a pointer to the allocated memory. + * + * The allocated memory is filled with bytes of value zero. + * + * @param count number of objects to allocate + * @param size size of the objects to allocate + * @return pointer to allocated memory / NULL pointer if there is an error + */ +void * +mem_calloc(mem_size_t count, mem_size_t size) +{ + void *p; + + /* allocate 'count' objects of size 'size' */ + p = mem_malloc(count * size); + if (p) { + /* zero the memory */ + memset(p, 0, (size_t)count * (size_t)size); + } + return p; +} +#endif /* MEM_LIBC_MALLOC && (!LWIP_STATS || !MEM_STATS) */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/memp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/memp.c new file mode 100644 index 0000000..58fab1a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/memp.c @@ -0,0 +1,496 @@ +/** + * @file + * Dynamic pool memory manager + * + * lwIP has dedicated pools for many structures (netconn, protocol control blocks, + * packet buffers, ...). All these pools are managed here. + * + * @defgroup mempool Memory pools + * @ingroup infrastructure + * Custom memory pools + + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#include "lwip/memp.h" +#include "lwip/sys.h" +#include "lwip/stats.h" + +#include + +/* Make sure we include everything we need for size calculation required by memp_std.h */ +#include "lwip/pbuf.h" +#include "lwip/raw.h" +#include "lwip/udp.h" +#include "lwip/tcp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/ip4_frag.h" +#include "lwip/netbuf.h" +#include "lwip/api.h" +#include "lwip/priv/tcpip_priv.h" +#include "lwip/priv/api_msg.h" +#include "lwip/sockets.h" +#include "lwip/netifapi.h" +#include "lwip/etharp.h" +#include "lwip/igmp.h" +#include "lwip/timeouts.h" +/* needed by default MEMP_NUM_SYS_TIMEOUT */ +#include "netif/ppp/ppp_opts.h" +#include "lwip/netdb.h" +#include "lwip/dns.h" +#include "lwip/priv/nd6_priv.h" +#include "lwip/ip6_frag.h" +#include "lwip/mld6.h" + +#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc) +#include "lwip/priv/memp_std.h" + +const struct memp_desc* const memp_pools[MEMP_MAX] = { +#define LWIP_MEMPOOL(name,num,size,desc) &memp_ ## name, +#include "lwip/priv/memp_std.h" +}; + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +#if MEMP_MEM_MALLOC && MEMP_OVERFLOW_CHECK >= 2 +#undef MEMP_OVERFLOW_CHECK +/* MEMP_OVERFLOW_CHECK >= 2 does not work with MEMP_MEM_MALLOC, use 1 instead */ +#define MEMP_OVERFLOW_CHECK 1 +#endif + +#if MEMP_SANITY_CHECK && !MEMP_MEM_MALLOC +/** + * Check that memp-lists don't form a circle, using "Floyd's cycle-finding algorithm". + */ +static int +memp_sanity(const struct memp_desc *desc) +{ + struct memp *t, *h; + + t = *desc->tab; + if (t != NULL) { + for (h = t->next; (t != NULL) && (h != NULL); t = t->next, + h = ((h->next != NULL) ? h->next->next : NULL)) { + if (t == h) { + return 0; + } + } + } + + return 1; +} +#endif /* MEMP_SANITY_CHECK && !MEMP_MEM_MALLOC */ + +#if MEMP_OVERFLOW_CHECK +/** + * Check if a memp element was victim of an overflow + * (e.g. the restricted area after it has been altered) + * + * @param p the memp element to check + * @param desc the pool p comes from + */ +static void +memp_overflow_check_element_overflow(struct memp *p, const struct memp_desc *desc) +{ +#if MEMP_SANITY_REGION_AFTER_ALIGNED > 0 + u16_t k; + u8_t *m; + m = (u8_t*)p + MEMP_SIZE + desc->size; + for (k = 0; k < MEMP_SANITY_REGION_AFTER_ALIGNED; k++) { + if (m[k] != 0xcd) { + char errstr[128] = "detected memp overflow in pool "; + strcat(errstr, desc->desc); + LWIP_ASSERT(errstr, 0); + } + } +#else /* MEMP_SANITY_REGION_AFTER_ALIGNED > 0 */ + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(desc); +#endif /* MEMP_SANITY_REGION_AFTER_ALIGNED > 0 */ +} + +/** + * Check if a memp element was victim of an underflow + * (e.g. the restricted area before it has been altered) + * + * @param p the memp element to check + * @param desc the pool p comes from + */ +static void +memp_overflow_check_element_underflow(struct memp *p, const struct memp_desc *desc) +{ +#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 + u16_t k; + u8_t *m; + m = (u8_t*)p + MEMP_SIZE - MEMP_SANITY_REGION_BEFORE_ALIGNED; + for (k = 0; k < MEMP_SANITY_REGION_BEFORE_ALIGNED; k++) { + if (m[k] != 0xcd) { + char errstr[128] = "detected memp underflow in pool "; + strcat(errstr, desc->desc); + LWIP_ASSERT(errstr, 0); + } + } +#else /* MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 */ + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(desc); +#endif /* MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 */ +} + +/** + * Initialize the restricted area of on memp element. + */ +static void +memp_overflow_init_element(struct memp *p, const struct memp_desc *desc) +{ +#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 || MEMP_SANITY_REGION_AFTER_ALIGNED > 0 + u8_t *m; +#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 + m = (u8_t*)p + MEMP_SIZE - MEMP_SANITY_REGION_BEFORE_ALIGNED; + memset(m, 0xcd, MEMP_SANITY_REGION_BEFORE_ALIGNED); +#endif +#if MEMP_SANITY_REGION_AFTER_ALIGNED > 0 + m = (u8_t*)p + MEMP_SIZE + desc->size; + memset(m, 0xcd, MEMP_SANITY_REGION_AFTER_ALIGNED); +#endif +#else /* MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 || MEMP_SANITY_REGION_AFTER_ALIGNED > 0 */ + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(desc); +#endif /* MEMP_SANITY_REGION_BEFORE_ALIGNED > 0 || MEMP_SANITY_REGION_AFTER_ALIGNED > 0 */ +} + +#if MEMP_OVERFLOW_CHECK >= 2 +/** + * Do an overflow check for all elements in every pool. + * + * @see memp_overflow_check_element for a description of the check + */ +static void +memp_overflow_check_all(void) +{ + u16_t i, j; + struct memp *p; + SYS_ARCH_DECL_PROTECT(old_level); + SYS_ARCH_PROTECT(old_level); + + for (i = 0; i < MEMP_MAX; ++i) { + p = (struct memp*)LWIP_MEM_ALIGN(memp_pools[i]->base); + for (j = 0; j < memp_pools[i]->num; ++j) { + memp_overflow_check_element_overflow(p, memp_pools[i]); + memp_overflow_check_element_underflow(p, memp_pools[i]); + p = LWIP_ALIGNMENT_CAST(struct memp*, ((u8_t*)p + MEMP_SIZE + memp_pools[i]->size + MEMP_SANITY_REGION_AFTER_ALIGNED)); + } + } + SYS_ARCH_UNPROTECT(old_level); +} +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ +#endif /* MEMP_OVERFLOW_CHECK */ + +/** + * Initialize custom memory pool. + * Related functions: memp_malloc_pool, memp_free_pool + * + * @param desc pool to initialize + */ +void +memp_init_pool(const struct memp_desc *desc) +{ +#if MEMP_MEM_MALLOC + LWIP_UNUSED_ARG(desc); +#else + int i; + struct memp *memp; + + *desc->tab = NULL; + memp = (struct memp*)LWIP_MEM_ALIGN(desc->base); + /* create a linked list of memp elements */ + for (i = 0; i < desc->num; ++i) { + memp->next = *desc->tab; + *desc->tab = memp; +#if MEMP_OVERFLOW_CHECK + memp_overflow_init_element(memp, desc); +#endif /* MEMP_OVERFLOW_CHECK */ + /* cast through void* to get rid of alignment warnings */ + memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + desc->size +#if MEMP_OVERFLOW_CHECK + + MEMP_SANITY_REGION_AFTER_ALIGNED +#endif + ); + } +#if MEMP_STATS + desc->stats->avail = desc->num; +#endif /* MEMP_STATS */ +#endif /* !MEMP_MEM_MALLOC */ + +#if MEMP_STATS && (defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY) + desc->stats->name = desc->desc; +#endif /* MEMP_STATS && (defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY) */ +} + +/** + * Initializes lwIP built-in pools. + * Related functions: memp_malloc, memp_free + * + * Carves out memp_memory into linked lists for each pool-type. + */ +void +memp_init(void) +{ + u16_t i; + + /* for every pool: */ + for (i = 0; i < LWIP_ARRAYSIZE(memp_pools); i++) { + memp_init_pool(memp_pools[i]); + +#if LWIP_STATS && MEMP_STATS + lwip_stats.memp[i] = memp_pools[i]->stats; +#endif + } + +#if MEMP_OVERFLOW_CHECK >= 2 + /* check everything a first time to see if it worked */ + memp_overflow_check_all(); +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ +} + +static void* +#if !MEMP_OVERFLOW_CHECK +do_memp_malloc_pool(const struct memp_desc *desc) +#else +do_memp_malloc_pool_fn(const struct memp_desc *desc, const char* file, const int line) +#endif +{ + struct memp *memp; + SYS_ARCH_DECL_PROTECT(old_level); + +#if MEMP_MEM_MALLOC + memp = (struct memp *)mem_malloc(MEMP_SIZE + MEMP_ALIGN_SIZE(desc->size)); + SYS_ARCH_PROTECT(old_level); +#else /* MEMP_MEM_MALLOC */ + SYS_ARCH_PROTECT(old_level); + + memp = *desc->tab; +#endif /* MEMP_MEM_MALLOC */ + + if (memp != NULL) { +#if !MEMP_MEM_MALLOC +#if MEMP_OVERFLOW_CHECK == 1 + memp_overflow_check_element_overflow(memp, desc); + memp_overflow_check_element_underflow(memp, desc); +#endif /* MEMP_OVERFLOW_CHECK */ + + *desc->tab = memp->next; +#if MEMP_OVERFLOW_CHECK + memp->next = NULL; +#endif /* MEMP_OVERFLOW_CHECK */ +#endif /* !MEMP_MEM_MALLOC */ +#if MEMP_OVERFLOW_CHECK + memp->file = file; + memp->line = line; +#if MEMP_MEM_MALLOC + memp_overflow_init_element(memp, desc); +#endif /* MEMP_MEM_MALLOC */ +#endif /* MEMP_OVERFLOW_CHECK */ + LWIP_ASSERT("memp_malloc: memp properly aligned", + ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0); +#if MEMP_STATS + desc->stats->used++; + if (desc->stats->used > desc->stats->max) { + desc->stats->max = desc->stats->used; + } +#endif + SYS_ARCH_UNPROTECT(old_level); + /* cast through u8_t* to get rid of alignment warnings */ + return ((u8_t*)memp + MEMP_SIZE); + } else { + LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", desc->desc)); +#if MEMP_STATS + desc->stats->err++; +#endif + } + + SYS_ARCH_UNPROTECT(old_level); + return NULL; +} + +/** + * Get an element from a custom pool. + * + * @param desc the pool to get an element from + * + * @return a pointer to the allocated memory or a NULL pointer on error + */ +void * +#if !MEMP_OVERFLOW_CHECK +memp_malloc_pool(const struct memp_desc *desc) +#else +memp_malloc_pool_fn(const struct memp_desc *desc, const char* file, const int line) +#endif +{ + LWIP_ASSERT("invalid pool desc", desc != NULL); + if (desc == NULL) { + return NULL; + } + +#if !MEMP_OVERFLOW_CHECK + return do_memp_malloc_pool(desc); +#else + return do_memp_malloc_pool_fn(desc, file, line); +#endif +} + +/** + * Get an element from a specific pool. + * + * @param type the pool to get an element from + * + * @return a pointer to the allocated memory or a NULL pointer on error + */ +void * +#if !MEMP_OVERFLOW_CHECK +memp_malloc(memp_t type) +#else +memp_malloc_fn(memp_t type, const char* file, const int line) +#endif +{ + void *memp; + LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;); + +#if MEMP_OVERFLOW_CHECK >= 2 + memp_overflow_check_all(); +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ + +#if !MEMP_OVERFLOW_CHECK + memp = do_memp_malloc_pool(memp_pools[type]); +#else + memp = do_memp_malloc_pool_fn(memp_pools[type], file, line); +#endif + + return memp; +} + +static void +do_memp_free_pool(const struct memp_desc* desc, void *mem) +{ + struct memp *memp; + SYS_ARCH_DECL_PROTECT(old_level); + + LWIP_ASSERT("memp_free: mem properly aligned", + ((mem_ptr_t)mem % MEM_ALIGNMENT) == 0); + + /* cast through void* to get rid of alignment warnings */ + memp = (struct memp *)(void *)((u8_t*)mem - MEMP_SIZE); + + SYS_ARCH_PROTECT(old_level); + +#if MEMP_OVERFLOW_CHECK == 1 + memp_overflow_check_element_overflow(memp, desc); + memp_overflow_check_element_underflow(memp, desc); +#endif /* MEMP_OVERFLOW_CHECK */ + +#if MEMP_STATS + desc->stats->used--; +#endif + +#if MEMP_MEM_MALLOC + LWIP_UNUSED_ARG(desc); + SYS_ARCH_UNPROTECT(old_level); + mem_free(memp); +#else /* MEMP_MEM_MALLOC */ + memp->next = *desc->tab; + *desc->tab = memp; + +#if MEMP_SANITY_CHECK + LWIP_ASSERT("memp sanity", memp_sanity(desc)); +#endif /* MEMP_SANITY_CHECK */ + + SYS_ARCH_UNPROTECT(old_level); +#endif /* !MEMP_MEM_MALLOC */ +} + +/** + * Put a custom pool element back into its pool. + * + * @param desc the pool where to put mem + * @param mem the memp element to free + */ +void +memp_free_pool(const struct memp_desc* desc, void *mem) +{ + LWIP_ASSERT("invalid pool desc", desc != NULL); + if ((desc == NULL) || (mem == NULL)) { + return; + } + + do_memp_free_pool(desc, mem); +} + +/** + * Put an element back into its pool. + * + * @param type the pool where to put mem + * @param mem the memp element to free + */ +void +memp_free(memp_t type, void *mem) +{ +#ifdef LWIP_HOOK_MEMP_AVAILABLE + struct memp *old_first; +#endif + + LWIP_ERROR("memp_free: type < MEMP_MAX", (type < MEMP_MAX), return;); + + if (mem == NULL) { + return; + } + +#if MEMP_OVERFLOW_CHECK >= 2 + memp_overflow_check_all(); +#endif /* MEMP_OVERFLOW_CHECK >= 2 */ + +#ifdef LWIP_HOOK_MEMP_AVAILABLE + old_first = *memp_pools[type]->tab; +#endif + + do_memp_free_pool(memp_pools[type], mem); + +#ifdef LWIP_HOOK_MEMP_AVAILABLE + if (old_first == NULL) { + LWIP_HOOK_MEMP_AVAILABLE(type); + } +#endif +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/netif.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/netif.c new file mode 100644 index 0000000..428b148 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/netif.c @@ -0,0 +1,1265 @@ +/** + * @file + * lwIP network interface abstraction + * + * @defgroup netif Network interface (NETIF) + * @ingroup callbackstyle_api + * + * @defgroup netif_ip4 IPv4 address handling + * @ingroup netif + * + * @defgroup netif_ip6 IPv6 address handling + * @ingroup netif + * + * @defgroup netif_cd Client data handling + * Store data (void*) on a netif for application usage. + * @see @ref LWIP_NUM_NETIF_CLIENT_DATA + * @ingroup netif + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + */ + +#include "lwip/opt.h" + +#include + +#include "lwip/def.h" +#include "lwip/ip_addr.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/udp.h" +#include "lwip/raw.h" +#include "lwip/snmp.h" +#include "lwip/igmp.h" +#include "lwip/etharp.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/ip.h" +#if ENABLE_LOOPBACK +#if LWIP_NETIF_LOOPBACK_MULTITHREADING +#include "lwip/tcpip.h" +#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#endif /* ENABLE_LOOPBACK */ + +#include "netif/ethernet.h" + +#if LWIP_AUTOIP +#include "lwip/autoip.h" +#endif /* LWIP_AUTOIP */ +#if LWIP_DHCP +#include "lwip/dhcp.h" +#endif /* LWIP_DHCP */ +#if LWIP_IPV6_DHCP6 +#include "lwip/dhcp6.h" +#endif /* LWIP_IPV6_DHCP6 */ +#if LWIP_IPV6_MLD +#include "lwip/mld6.h" +#endif /* LWIP_IPV6_MLD */ +#if LWIP_IPV6 +#include "lwip/nd6.h" +#endif + +#if LWIP_NETIF_STATUS_CALLBACK +#define NETIF_STATUS_CALLBACK(n) do{ if (n->status_callback) { (n->status_callback)(n); }}while(0) +#else +#define NETIF_STATUS_CALLBACK(n) +#endif /* LWIP_NETIF_STATUS_CALLBACK */ + +#if LWIP_NETIF_LINK_CALLBACK +#define NETIF_LINK_CALLBACK(n) do{ if (n->link_callback) { (n->link_callback)(n); }}while(0) +#else +#define NETIF_LINK_CALLBACK(n) +#endif /* LWIP_NETIF_LINK_CALLBACK */ + +struct netif *netif_list; +struct netif *netif_default; + +static u8_t netif_num; + +#if LWIP_NUM_NETIF_CLIENT_DATA > 0 +static u8_t netif_client_id; +#endif + +#define NETIF_REPORT_TYPE_IPV4 0x01 +#define NETIF_REPORT_TYPE_IPV6 0x02 +static void netif_issue_reports(struct netif* netif, u8_t report_type); + +#if LWIP_IPV6 +static err_t netif_null_output_ip6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr); +#endif /* LWIP_IPV6 */ + +#if LWIP_HAVE_LOOPIF +#if LWIP_IPV4 +static err_t netif_loop_output_ipv4(struct netif *netif, struct pbuf *p, const ip4_addr_t* addr); +#endif +#if LWIP_IPV6 +static err_t netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, const ip6_addr_t* addr); +#endif + + +static struct netif loop_netif; + +/** + * Initialize a lwip network interface structure for a loopback interface + * + * @param netif the lwip network interface structure for this loopif + * @return ERR_OK if the loopif is initialized + * ERR_MEM if private data couldn't be allocated + */ +static err_t +netif_loopif_init(struct netif *netif) +{ + /* initialize the snmp variables and counters inside the struct netif + * ifSpeed: no assumption can be made! + */ + MIB2_INIT_NETIF(netif, snmp_ifType_softwareLoopback, 0); + + netif->name[0] = 'l'; + netif->name[1] = 'o'; +#if LWIP_IPV4 + netif->output = netif_loop_output_ipv4; +#endif +#if LWIP_IPV6 + netif->output_ip6 = netif_loop_output_ipv6; +#endif +#if LWIP_LOOPIF_MULTICAST + netif->flags |= NETIF_FLAG_IGMP; +#endif + return ERR_OK; +} +#endif /* LWIP_HAVE_LOOPIF */ + +void +netif_init(void) +{ +#if LWIP_HAVE_LOOPIF +#if LWIP_IPV4 +#define LOOPIF_ADDRINIT &loop_ipaddr, &loop_netmask, &loop_gw, + ip4_addr_t loop_ipaddr, loop_netmask, loop_gw; + IP4_ADDR(&loop_gw, 127,0,0,1); + IP4_ADDR(&loop_ipaddr, 127,0,0,1); + IP4_ADDR(&loop_netmask, 255,0,0,0); +#else /* LWIP_IPV4 */ +#define LOOPIF_ADDRINIT +#endif /* LWIP_IPV4 */ + +#if NO_SYS + netif_add(&loop_netif, LOOPIF_ADDRINIT NULL, netif_loopif_init, ip_input); +#else /* NO_SYS */ + netif_add(&loop_netif, LOOPIF_ADDRINIT NULL, netif_loopif_init, tcpip_input); +#endif /* NO_SYS */ + +#if LWIP_IPV6 + IP_ADDR6_HOST(loop_netif.ip6_addr, 0, 0, 0, 0x00000001UL); + loop_netif.ip6_addr_state[0] = IP6_ADDR_VALID; +#endif /* LWIP_IPV6 */ + + netif_set_link_up(&loop_netif); + netif_set_up(&loop_netif); + +#endif /* LWIP_HAVE_LOOPIF */ +} + +/** + * @ingroup lwip_nosys + * Forwards a received packet for input processing with + * ethernet_input() or ip_input() depending on netif flags. + * Don't call directly, pass to netif_add() and call + * netif->input(). + * Only works if the netif driver correctly sets + * NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag! + */ +err_t +netif_input(struct pbuf *p, struct netif *inp) +{ +#if LWIP_ETHERNET + if (inp->flags & (NETIF_FLAG_ETHARP | NETIF_FLAG_ETHERNET)) { + return ethernet_input(p, inp); + } else +#endif /* LWIP_ETHERNET */ + return ip_input(p, inp); +} + +/** + * @ingroup netif + * Add a network interface to the list of lwIP netifs. + * + * @param netif a pre-allocated netif structure + * @param ipaddr IP address for the new netif + * @param netmask network mask for the new netif + * @param gw default gateway IP address for the new netif + * @param state opaque data passed to the new netif + * @param init callback function that initializes the interface + * @param input callback function that is called to pass + * ingress packets up in the protocol layer stack.\n + * It is recommended to use a function that passes the input directly + * to the stack (netif_input(), NO_SYS=1 mode) or via sending a + * message to TCPIP thread (tcpip_input(), NO_SYS=0 mode).\n + * These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET + * to decide whether to forward to ethernet_input() or ip_input(). + * In other words, the functions only work when the netif + * driver is implemented correctly!\n + * Most members of struct netif should be be initialized by the + * netif init function = netif driver (init parameter of this function).\n + * IPv6: Don't forget to call netif_create_ip6_linklocal_address() after + * setting the MAC address in struct netif.hwaddr + * (IPv6 requires a link-local address). + * + * @return netif, or NULL if failed. + */ +struct netif * +netif_add(struct netif *netif, +#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, +#endif /* LWIP_IPV4 */ + void *state, netif_init_fn init, netif_input_fn input) +{ +#if LWIP_IPV6 + s8_t i; +#endif + + LWIP_ASSERT("No init function given", init != NULL); + + /* reset new interface configuration state */ +#if LWIP_IPV4 + ip_addr_set_zero_ip4(&netif->ip_addr); + ip_addr_set_zero_ip4(&netif->netmask); + ip_addr_set_zero_ip4(&netif->gw); +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + ip_addr_set_zero_ip6(&netif->ip6_addr[i]); + netif->ip6_addr_state[i] = IP6_ADDR_INVALID; + } + netif->output_ip6 = netif_null_output_ip6; +#endif /* LWIP_IPV6 */ + NETIF_SET_CHECKSUM_CTRL(netif, NETIF_CHECKSUM_ENABLE_ALL); + netif->flags = 0; +#ifdef netif_get_client_data + memset(netif->client_data, 0, sizeof(netif->client_data)); +#endif /* LWIP_NUM_NETIF_CLIENT_DATA */ +#if LWIP_IPV6_AUTOCONFIG + /* IPv6 address autoconfiguration not enabled by default */ + netif->ip6_autoconfig_enabled = 0; +#endif /* LWIP_IPV6_AUTOCONFIG */ +#if LWIP_IPV6_SEND_ROUTER_SOLICIT + netif->rs_count = LWIP_ND6_MAX_MULTICAST_SOLICIT; +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ +#if LWIP_NETIF_STATUS_CALLBACK + netif->status_callback = NULL; +#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#if LWIP_NETIF_LINK_CALLBACK + netif->link_callback = NULL; +#endif /* LWIP_NETIF_LINK_CALLBACK */ +#if LWIP_IGMP + netif->igmp_mac_filter = NULL; +#endif /* LWIP_IGMP */ +#if LWIP_IPV6 && LWIP_IPV6_MLD + netif->mld_mac_filter = NULL; +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ +#if ENABLE_LOOPBACK + netif->loop_first = NULL; + netif->loop_last = NULL; +#endif /* ENABLE_LOOPBACK */ + + /* remember netif specific state information data */ + netif->state = state; + netif->num = netif_num++; + netif->input = input; + + NETIF_SET_HWADDRHINT(netif, NULL); +#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS + netif->loop_cnt_current = 0; +#endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */ + +#if LWIP_IPV4 + netif_set_addr(netif, ipaddr, netmask, gw); +#endif /* LWIP_IPV4 */ + + /* call user specified initialization function for netif */ + if (init(netif) != ERR_OK) { + return NULL; + } + + /* add this netif to the list */ + netif->next = netif_list; + netif_list = netif; + mib2_netif_added(netif); + +#if LWIP_IGMP + /* start IGMP processing */ + if (netif->flags & NETIF_FLAG_IGMP) { + igmp_start(netif); + } +#endif /* LWIP_IGMP */ + + LWIP_DEBUGF(NETIF_DEBUG, ("netif: added interface %c%c IP", + netif->name[0], netif->name[1])); +#if LWIP_IPV4 + LWIP_DEBUGF(NETIF_DEBUG, (" addr ")); + ip4_addr_debug_print(NETIF_DEBUG, ipaddr); + LWIP_DEBUGF(NETIF_DEBUG, (" netmask ")); + ip4_addr_debug_print(NETIF_DEBUG, netmask); + LWIP_DEBUGF(NETIF_DEBUG, (" gw ")); + ip4_addr_debug_print(NETIF_DEBUG, gw); +#endif /* LWIP_IPV4 */ + LWIP_DEBUGF(NETIF_DEBUG, ("\n")); + return netif; +} + +#if LWIP_IPV4 +/** + * @ingroup netif_ip4 + * Change IP address configuration for a network interface (including netmask + * and default gateway). + * + * @param netif the network interface to change + * @param ipaddr the new IP address + * @param netmask the new netmask + * @param gw the new default gateway + */ +void +netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, + const ip4_addr_t *gw) +{ + if (ip4_addr_isany(ipaddr)) { + /* when removing an address, we have to remove it *before* changing netmask/gw + to ensure that tcp RST segment can be sent correctly */ + netif_set_ipaddr(netif, ipaddr); + netif_set_netmask(netif, netmask); + netif_set_gw(netif, gw); + } else { + netif_set_netmask(netif, netmask); + netif_set_gw(netif, gw); + /* set ipaddr last to ensure netmask/gw have been set when status callback is called */ + netif_set_ipaddr(netif, ipaddr); + } +} +#endif /* LWIP_IPV4*/ + +/** + * @ingroup netif + * Remove a network interface from the list of lwIP netifs. + * + * @param netif the network interface to remove + */ +void +netif_remove(struct netif *netif) +{ +#if LWIP_IPV6 + int i; +#endif + + if (netif == NULL) { + return; + } + +#if LWIP_IPV4 + if (!ip4_addr_isany_val(*netif_ip4_addr(netif))) { +#if LWIP_TCP + tcp_netif_ip_addr_changed(netif_ip_addr4(netif), NULL); +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(netif_ip_addr4(netif), NULL); +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(netif_ip_addr4(netif), NULL); +#endif /* LWIP_RAW */ + } + +#if LWIP_IGMP + /* stop IGMP processing */ + if (netif->flags & NETIF_FLAG_IGMP) { + igmp_stop(netif); + } +#endif /* LWIP_IGMP */ +#endif /* LWIP_IPV4*/ + +#if LWIP_IPV6 + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) { +#if LWIP_TCP + tcp_netif_ip_addr_changed(netif_ip_addr6(netif, i), NULL); +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(netif_ip_addr6(netif, i), NULL); +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(netif_ip_addr6(netif, i), NULL); +#endif /* LWIP_RAW */ + } + } +#if LWIP_IPV6_MLD + /* stop MLD processing */ + mld6_stop(netif); +#endif /* LWIP_IPV6_MLD */ +#endif /* LWIP_IPV6 */ + if (netif_is_up(netif)) { + /* set netif down before removing (call callback function) */ + netif_set_down(netif); + } + + mib2_remove_ip4(netif); + + /* this netif is default? */ + if (netif_default == netif) { + /* reset default netif */ + netif_set_default(NULL); + } + /* is it the first netif? */ + if (netif_list == netif) { + netif_list = netif->next; + } else { + /* look for netif further down the list */ + struct netif * tmp_netif; + for (tmp_netif = netif_list; tmp_netif != NULL; tmp_netif = tmp_netif->next) { + if (tmp_netif->next == netif) { + tmp_netif->next = netif->next; + break; + } + } + if (tmp_netif == NULL) { + return; /* netif is not on the list */ + } + } + mib2_netif_removed(netif); +#if LWIP_NETIF_REMOVE_CALLBACK + if (netif->remove_callback) { + netif->remove_callback(netif); + } +#endif /* LWIP_NETIF_REMOVE_CALLBACK */ + LWIP_DEBUGF( NETIF_DEBUG, ("netif_remove: removed netif\n") ); +} + +/** + * @ingroup netif + * Find a network interface by searching for its name + * + * @param name the name of the netif (like netif->name) plus concatenated number + * in ascii representation (e.g. 'en0') + */ +struct netif * +netif_find(const char *name) +{ + struct netif *netif; + u8_t num; + + if (name == NULL) { + return NULL; + } + + num = (u8_t)(name[2] - '0'); + + for (netif = netif_list; netif != NULL; netif = netif->next) { + if (num == netif->num && + name[0] == netif->name[0] && + name[1] == netif->name[1]) { + LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: found %c%c\n", name[0], name[1])); + return netif; + } + } + LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: didn't find %c%c\n", name[0], name[1])); + return NULL; +} + +#if LWIP_IPV4 +/** + * @ingroup netif_ip4 + * Change the IP address of a network interface + * + * @param netif the network interface to change + * @param ipaddr the new IP address + * + * @note call netif_set_addr() if you also want to change netmask and + * default gateway + */ +void +netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr) +{ + ip_addr_t new_addr; + *ip_2_ip4(&new_addr) = (ipaddr ? *ipaddr : *IP4_ADDR_ANY4); + IP_SET_TYPE_VAL(new_addr, IPADDR_TYPE_V4); + + /* address is actually being changed? */ + if (ip4_addr_cmp(ip_2_ip4(&new_addr), netif_ip4_addr(netif)) == 0) { + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n")); +#if LWIP_TCP + tcp_netif_ip_addr_changed(netif_ip_addr4(netif), &new_addr); +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(netif_ip_addr4(netif), &new_addr); +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(netif_ip_addr4(netif), &new_addr); +#endif /* LWIP_RAW */ + + mib2_remove_ip4(netif); + mib2_remove_route_ip4(0, netif); + /* set new IP address to netif */ + ip4_addr_set(ip_2_ip4(&netif->ip_addr), ipaddr); + IP_SET_TYPE_VAL(netif->ip_addr, IPADDR_TYPE_V4); + mib2_add_ip4(netif); + mib2_add_route_ip4(0, netif); + + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4); + + NETIF_STATUS_CALLBACK(netif); + } + + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: IP address of interface %c%c set to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip4_addr(netif)), + ip4_addr2_16(netif_ip4_addr(netif)), + ip4_addr3_16(netif_ip4_addr(netif)), + ip4_addr4_16(netif_ip4_addr(netif)))); +} + +/** + * @ingroup netif_ip4 + * Change the default gateway for a network interface + * + * @param netif the network interface to change + * @param gw the new default gateway + * + * @note call netif_set_addr() if you also want to change ip address and netmask + */ +void +netif_set_gw(struct netif *netif, const ip4_addr_t *gw) +{ + ip4_addr_set(ip_2_ip4(&netif->gw), gw); + IP_SET_TYPE_VAL(netif->gw, IPADDR_TYPE_V4); + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: GW address of interface %c%c set to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip4_gw(netif)), + ip4_addr2_16(netif_ip4_gw(netif)), + ip4_addr3_16(netif_ip4_gw(netif)), + ip4_addr4_16(netif_ip4_gw(netif)))); +} + +/** + * @ingroup netif_ip4 + * Change the netmask of a network interface + * + * @param netif the network interface to change + * @param netmask the new netmask + * + * @note call netif_set_addr() if you also want to change ip address and + * default gateway + */ +void +netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask) +{ + mib2_remove_route_ip4(0, netif); + /* set new netmask to netif */ + ip4_addr_set(ip_2_ip4(&netif->netmask), netmask); + IP_SET_TYPE_VAL(netif->netmask, IPADDR_TYPE_V4); + mib2_add_route_ip4(0, netif); + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: netmask of interface %c%c set to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip4_netmask(netif)), + ip4_addr2_16(netif_ip4_netmask(netif)), + ip4_addr3_16(netif_ip4_netmask(netif)), + ip4_addr4_16(netif_ip4_netmask(netif)))); +} +#endif /* LWIP_IPV4 */ + +/** + * @ingroup netif + * Set a network interface as the default network interface + * (used to output all packets for which no specific route is found) + * + * @param netif the default network interface + */ +void +netif_set_default(struct netif *netif) +{ + if (netif == NULL) { + /* remove default route */ + mib2_remove_route_ip4(1, netif); + } else { + /* install default route */ + mib2_add_route_ip4(1, netif); + } + netif_default = netif; + LWIP_DEBUGF(NETIF_DEBUG, ("netif: setting default interface %c%c\n", + netif ? netif->name[0] : '\'', netif ? netif->name[1] : '\'')); +} + +/** + * @ingroup netif + * Bring an interface up, available for processing + * traffic. + */ +void +netif_set_up(struct netif *netif) +{ + if (!(netif->flags & NETIF_FLAG_UP)) { + netif->flags |= NETIF_FLAG_UP; + + MIB2_COPY_SYSUPTIME_TO(&netif->ts); + + NETIF_STATUS_CALLBACK(netif); + + if (netif->flags & NETIF_FLAG_LINK_UP) { + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4|NETIF_REPORT_TYPE_IPV6); + } + } +} + +/** Send ARP/IGMP/MLD/RS events, e.g. on link-up/netif-up or addr-change + */ +static void +netif_issue_reports(struct netif* netif, u8_t report_type) +{ +#if LWIP_IPV4 + if ((report_type & NETIF_REPORT_TYPE_IPV4) && + !ip4_addr_isany_val(*netif_ip4_addr(netif))) { +#if LWIP_ARP + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + if (netif->flags & (NETIF_FLAG_ETHARP)) { + etharp_gratuitous(netif); + } +#endif /* LWIP_ARP */ + +#if LWIP_IGMP + /* resend IGMP memberships */ + if (netif->flags & NETIF_FLAG_IGMP) { + igmp_report_groups(netif); + } +#endif /* LWIP_IGMP */ + } +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 + if (report_type & NETIF_REPORT_TYPE_IPV6) { +#if LWIP_IPV6_MLD + /* send mld memberships */ + mld6_report_groups(netif); +#endif /* LWIP_IPV6_MLD */ +#if LWIP_IPV6_SEND_ROUTER_SOLICIT + /* Send Router Solicitation messages. */ + netif->rs_count = LWIP_ND6_MAX_MULTICAST_SOLICIT; +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ + } +#endif /* LWIP_IPV6 */ +} + +/** + * @ingroup netif + * Bring an interface down, disabling any traffic processing. + */ +void +netif_set_down(struct netif *netif) +{ + if (netif->flags & NETIF_FLAG_UP) { + netif->flags &= ~NETIF_FLAG_UP; + MIB2_COPY_SYSUPTIME_TO(&netif->ts); + +#if LWIP_IPV4 && LWIP_ARP + if (netif->flags & NETIF_FLAG_ETHARP) { + etharp_cleanup_netif(netif); + } +#endif /* LWIP_IPV4 && LWIP_ARP */ + +#if LWIP_IPV6 + nd6_cleanup_netif(netif); +#endif /* LWIP_IPV6 */ + + NETIF_STATUS_CALLBACK(netif); + } +} + +#if LWIP_NETIF_STATUS_CALLBACK +/** + * @ingroup netif + * Set callback to be called when interface is brought up/down or address is changed while up + */ +void +netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback) +{ + if (netif) { + netif->status_callback = status_callback; + } +} +#endif /* LWIP_NETIF_STATUS_CALLBACK */ + +#if LWIP_NETIF_REMOVE_CALLBACK +/** + * @ingroup netif + * Set callback to be called when the interface has been removed + */ +void +netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback) +{ + if (netif) { + netif->remove_callback = remove_callback; + } +} +#endif /* LWIP_NETIF_REMOVE_CALLBACK */ + +/** + * @ingroup netif + * Called by a driver when its link goes up + */ +void +netif_set_link_up(struct netif *netif) +{ + if (!(netif->flags & NETIF_FLAG_LINK_UP)) { + netif->flags |= NETIF_FLAG_LINK_UP; + +#if LWIP_DHCP + dhcp_network_changed(netif); +#endif /* LWIP_DHCP */ + +#if LWIP_AUTOIP + autoip_network_changed(netif); +#endif /* LWIP_AUTOIP */ + + if (netif->flags & NETIF_FLAG_UP) { + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4|NETIF_REPORT_TYPE_IPV6); + } + NETIF_LINK_CALLBACK(netif); + } +} + +/** + * @ingroup netif + * Called by a driver when its link goes down + */ +void +netif_set_link_down(struct netif *netif ) +{ + if (netif->flags & NETIF_FLAG_LINK_UP) { + netif->flags &= ~NETIF_FLAG_LINK_UP; + NETIF_LINK_CALLBACK(netif); + } +} + +#if LWIP_NETIF_LINK_CALLBACK +/** + * @ingroup netif + * Set callback to be called when link is brought up/down + */ +void +netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback) +{ + if (netif) { + netif->link_callback = link_callback; + } +} +#endif /* LWIP_NETIF_LINK_CALLBACK */ + +#if ENABLE_LOOPBACK +/** + * @ingroup netif + * Send an IP packet to be received on the same netif (loopif-like). + * The pbuf is simply copied and handed back to netif->input. + * In multithreaded mode, this is done directly since netif->input must put + * the packet on a queue. + * In callback mode, the packet is put on an internal queue and is fed to + * netif->input by netif_poll(). + * + * @param netif the lwip network interface structure + * @param p the (IP) packet to 'send' + * @return ERR_OK if the packet has been sent + * ERR_MEM if the pbuf used to copy the packet couldn't be allocated + */ +err_t +netif_loop_output(struct netif *netif, struct pbuf *p) +{ + struct pbuf *r; + err_t err; + struct pbuf *last; +#if LWIP_LOOPBACK_MAX_PBUFS + u16_t clen = 0; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ + /* If we have a loopif, SNMP counters are adjusted for it, + * if not they are adjusted for 'netif'. */ +#if MIB2_STATS +#if LWIP_HAVE_LOOPIF + struct netif *stats_if = &loop_netif; +#else /* LWIP_HAVE_LOOPIF */ + struct netif *stats_if = netif; +#endif /* LWIP_HAVE_LOOPIF */ +#endif /* MIB2_STATS */ + SYS_ARCH_DECL_PROTECT(lev); + + /* Allocate a new pbuf */ + r = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM); + if (r == NULL) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(stats_if, ifoutdiscards); + return ERR_MEM; + } +#if LWIP_LOOPBACK_MAX_PBUFS + clen = pbuf_clen(r); + /* check for overflow or too many pbuf on queue */ + if (((netif->loop_cnt_current + clen) < netif->loop_cnt_current) || + ((netif->loop_cnt_current + clen) > LWIP_LOOPBACK_MAX_PBUFS)) { + pbuf_free(r); + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(stats_if, ifoutdiscards); + return ERR_MEM; + } + netif->loop_cnt_current += clen; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ + + /* Copy the whole pbuf queue p into the single pbuf r */ + if ((err = pbuf_copy(r, p)) != ERR_OK) { + pbuf_free(r); + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(stats_if, ifoutdiscards); + return err; + } + + /* Put the packet on a linked list which gets emptied through calling + netif_poll(). */ + + /* let last point to the last pbuf in chain r */ + for (last = r; last->next != NULL; last = last->next); + + SYS_ARCH_PROTECT(lev); + if (netif->loop_first != NULL) { + LWIP_ASSERT("if first != NULL, last must also be != NULL", netif->loop_last != NULL); + netif->loop_last->next = r; + netif->loop_last = last; + } else { + netif->loop_first = r; + netif->loop_last = last; + } + SYS_ARCH_UNPROTECT(lev); + + LINK_STATS_INC(link.xmit); + MIB2_STATS_NETIF_ADD(stats_if, ifoutoctets, p->tot_len); + MIB2_STATS_NETIF_INC(stats_if, ifoutucastpkts); + +#if LWIP_NETIF_LOOPBACK_MULTITHREADING + /* For multithreading environment, schedule a call to netif_poll */ + tcpip_callback_with_block((tcpip_callback_fn)netif_poll, netif, 0); +#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */ + + return ERR_OK; +} + +#if LWIP_HAVE_LOOPIF +#if LWIP_IPV4 +static err_t +netif_loop_output_ipv4(struct netif *netif, struct pbuf *p, const ip4_addr_t* addr) +{ + LWIP_UNUSED_ARG(addr); + return netif_loop_output(netif, p); +} +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +static err_t +netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, const ip6_addr_t* addr) +{ + LWIP_UNUSED_ARG(addr); + return netif_loop_output(netif, p); +} +#endif /* LWIP_IPV6 */ +#endif /* LWIP_HAVE_LOOPIF */ + + +/** + * Call netif_poll() in the main loop of your application. This is to prevent + * reentering non-reentrant functions like tcp_input(). Packets passed to + * netif_loop_output() are put on a list that is passed to netif->input() by + * netif_poll(). + */ +void +netif_poll(struct netif *netif) +{ + /* If we have a loopif, SNMP counters are adjusted for it, + * if not they are adjusted for 'netif'. */ +#if MIB2_STATS +#if LWIP_HAVE_LOOPIF + struct netif *stats_if = &loop_netif; +#else /* LWIP_HAVE_LOOPIF */ + struct netif *stats_if = netif; +#endif /* LWIP_HAVE_LOOPIF */ +#endif /* MIB2_STATS */ + SYS_ARCH_DECL_PROTECT(lev); + + /* Get a packet from the list. With SYS_LIGHTWEIGHT_PROT=1, this is protected */ + SYS_ARCH_PROTECT(lev); + while (netif->loop_first != NULL) { + struct pbuf *in, *in_end; +#if LWIP_LOOPBACK_MAX_PBUFS + u8_t clen = 1; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ + + in = in_end = netif->loop_first; + while (in_end->len != in_end->tot_len) { + LWIP_ASSERT("bogus pbuf: len != tot_len but next == NULL!", in_end->next != NULL); + in_end = in_end->next; +#if LWIP_LOOPBACK_MAX_PBUFS + clen++; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ + } +#if LWIP_LOOPBACK_MAX_PBUFS + /* adjust the number of pbufs on queue */ + LWIP_ASSERT("netif->loop_cnt_current underflow", + ((netif->loop_cnt_current - clen) < netif->loop_cnt_current)); + netif->loop_cnt_current -= clen; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ + + /* 'in_end' now points to the last pbuf from 'in' */ + if (in_end == netif->loop_last) { + /* this was the last pbuf in the list */ + netif->loop_first = netif->loop_last = NULL; + } else { + /* pop the pbuf off the list */ + netif->loop_first = in_end->next; + LWIP_ASSERT("should not be null since first != last!", netif->loop_first != NULL); + } + /* De-queue the pbuf from its successors on the 'loop_' list. */ + in_end->next = NULL; + SYS_ARCH_UNPROTECT(lev); + + LINK_STATS_INC(link.recv); + MIB2_STATS_NETIF_ADD(stats_if, ifinoctets, in->tot_len); + MIB2_STATS_NETIF_INC(stats_if, ifinucastpkts); + /* loopback packets are always IP packets! */ + if (ip_input(in, netif) != ERR_OK) { + pbuf_free(in); + } + SYS_ARCH_PROTECT(lev); + } + SYS_ARCH_UNPROTECT(lev); +} + +#if !LWIP_NETIF_LOOPBACK_MULTITHREADING +/** + * Calls netif_poll() for every netif on the netif_list. + */ +void +netif_poll_all(void) +{ + struct netif *netif = netif_list; + /* loop through netifs */ + while (netif != NULL) { + netif_poll(netif); + /* proceed to next network interface */ + netif = netif->next; + } +} +#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#endif /* ENABLE_LOOPBACK */ + +#if LWIP_NUM_NETIF_CLIENT_DATA > 0 +/** + * @ingroup netif_cd + * Allocate an index to store data in client_data member of struct netif. + * Returned value is an index in mentioned array. + * @see LWIP_NUM_NETIF_CLIENT_DATA + */ +u8_t +netif_alloc_client_data_id(void) +{ + u8_t result = netif_client_id; + netif_client_id++; + + LWIP_ASSERT("Increase LWIP_NUM_NETIF_CLIENT_DATA in lwipopts.h", result < LWIP_NUM_NETIF_CLIENT_DATA); + return result + LWIP_NETIF_CLIENT_DATA_INDEX_MAX; +} +#endif + +#if LWIP_IPV6 +/** + * @ingroup netif_ip6 + * Change an IPv6 address of a network interface + * + * @param netif the network interface to change + * @param addr_idx index of the IPv6 address + * @param addr6 the new IPv6 address + * + * @note call netif_ip6_addr_set_state() to set the address valid/temptative + */ +void +netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6) +{ + LWIP_ASSERT("addr6 != NULL", addr6 != NULL); + netif_ip6_addr_set_parts(netif, addr_idx, addr6->addr[0], addr6->addr[1], + addr6->addr[2], addr6->addr[3]); +} + +/* + * Change an IPv6 address of a network interface (internal version taking 4 * u32_t) + * + * @param netif the network interface to change + * @param addr_idx index of the IPv6 address + * @param i0 word0 of the new IPv6 address + * @param i1 word1 of the new IPv6 address + * @param i2 word2 of the new IPv6 address + * @param i3 word3 of the new IPv6 address + */ +void +netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3) +{ + const ip6_addr_t *old_addr; + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("invalid index", addr_idx < LWIP_IPV6_NUM_ADDRESSES); + + old_addr = netif_ip6_addr(netif, addr_idx); + /* address is actually being changed? */ + if ((old_addr->addr[0] != i0) || (old_addr->addr[1] != i1) || + (old_addr->addr[2] != i2) || (old_addr->addr[3] != i3)) { + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_ip6_addr_set: netif address being changed\n")); + + if (netif_ip6_addr_state(netif, addr_idx) & IP6_ADDR_VALID) { +#if LWIP_TCP || LWIP_UDP + ip_addr_t new_ipaddr; + IP_ADDR6(&new_ipaddr, i0, i1, i2, i3); +#endif /* LWIP_TCP || LWIP_UDP */ +#if LWIP_TCP + tcp_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), &new_ipaddr); +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), &new_ipaddr); +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), &new_ipaddr); +#endif /* LWIP_RAW */ + } + /* @todo: remove/readd mib2 ip6 entries? */ + + IP6_ADDR(ip_2_ip6(&(netif->ip6_addr[addr_idx])), i0, i1, i2, i3); + IP_SET_TYPE_VAL(netif->ip6_addr[addr_idx], IPADDR_TYPE_V6); + + if (netif_ip6_addr_state(netif, addr_idx) & IP6_ADDR_VALID) { + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV6); + NETIF_STATUS_CALLBACK(netif); + } + } + + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: IPv6 address %d of interface %c%c set to %s/0x%"X8_F"\n", + addr_idx, netif->name[0], netif->name[1], ip6addr_ntoa(netif_ip6_addr(netif, addr_idx)), + netif_ip6_addr_state(netif, addr_idx))); +} + +/** + * @ingroup netif_ip6 + * Change the state of an IPv6 address of a network interface + * (INVALID, TEMPTATIVE, PREFERRED, DEPRECATED, where TEMPTATIVE + * includes the number of checks done, see ip6_addr.h) + * + * @param netif the network interface to change + * @param addr_idx index of the IPv6 address + * @param state the new IPv6 address state + */ +void +netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state) +{ + u8_t old_state; + LWIP_ASSERT("netif != NULL", netif != NULL); + LWIP_ASSERT("invalid index", addr_idx < LWIP_IPV6_NUM_ADDRESSES); + + old_state = netif_ip6_addr_state(netif, addr_idx); + /* state is actually being changed? */ + if (old_state != state) { + u8_t old_valid = old_state & IP6_ADDR_VALID; + u8_t new_valid = state & IP6_ADDR_VALID; + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_ip6_addr_set_state: netif address state being changed\n")); + +#if LWIP_IPV6_MLD + /* Reevaluate solicited-node multicast group membership. */ + if (netif->flags & NETIF_FLAG_MLD6) { + nd6_adjust_mld_membership(netif, addr_idx, state); + } +#endif /* LWIP_IPV6_MLD */ + + if (old_valid && !new_valid) { + /* address about to be removed by setting invalid */ +#if LWIP_TCP + tcp_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), NULL); +#endif /* LWIP_TCP */ +#if LWIP_UDP + udp_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), NULL); +#endif /* LWIP_UDP */ +#if LWIP_RAW + raw_netif_ip_addr_changed(netif_ip_addr6(netif, addr_idx), NULL); +#endif /* LWIP_RAW */ + /* @todo: remove mib2 ip6 entries? */ + } + netif->ip6_addr_state[addr_idx] = state; + + if (!old_valid && new_valid) { + /* address added by setting valid */ + /* @todo: add mib2 ip6 entries? */ + netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV6); + } + if ((old_state & IP6_ADDR_PREFERRED) != (state & IP6_ADDR_PREFERRED)) { + /* address state has changed (valid flag changed or switched between + preferred and deprecated) -> call the callback function */ + NETIF_STATUS_CALLBACK(netif); + } + } + + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: IPv6 address %d of interface %c%c set to %s/0x%"X8_F"\n", + addr_idx, netif->name[0], netif->name[1], ip6addr_ntoa(netif_ip6_addr(netif, addr_idx)), + netif_ip6_addr_state(netif, addr_idx))); +} + +/** + * Checks if a specific address is assigned to the netif and returns its + * index. + * + * @param netif the netif to check + * @param ip6addr the IPv6 address to find + * @return >= 0: address found, this is its index + * -1: address not found on this netif + */ +s8_t +netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr) +{ + s8_t i; + for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) && + ip6_addr_cmp(netif_ip6_addr(netif, i), ip6addr)) { + return i; + } + } + return -1; +} + +/** + * @ingroup netif_ip6 + * Create a link-local IPv6 address on a netif (stored in slot 0) + * + * @param netif the netif to create the address on + * @param from_mac_48bit if != 0, assume hwadr is a 48-bit MAC address (std conversion) + * if == 0, use hwaddr directly as interface ID + */ +void +netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit) +{ + u8_t i, addr_index; + + /* Link-local prefix. */ + ip_2_ip6(&netif->ip6_addr[0])->addr[0] = PP_HTONL(0xfe800000ul); + ip_2_ip6(&netif->ip6_addr[0])->addr[1] = 0; + + /* Generate interface ID. */ + if (from_mac_48bit) { + /* Assume hwaddr is a 48-bit IEEE 802 MAC. Convert to EUI-64 address. Complement Group bit. */ + ip_2_ip6(&netif->ip6_addr[0])->addr[2] = lwip_htonl((((u32_t)(netif->hwaddr[0] ^ 0x02)) << 24) | + ((u32_t)(netif->hwaddr[1]) << 16) | + ((u32_t)(netif->hwaddr[2]) << 8) | + (0xff)); + ip_2_ip6(&netif->ip6_addr[0])->addr[3] = lwip_htonl((0xfeul << 24) | + ((u32_t)(netif->hwaddr[3]) << 16) | + ((u32_t)(netif->hwaddr[4]) << 8) | + (netif->hwaddr[5])); + } else { + /* Use hwaddr directly as interface ID. */ + ip_2_ip6(&netif->ip6_addr[0])->addr[2] = 0; + ip_2_ip6(&netif->ip6_addr[0])->addr[3] = 0; + + addr_index = 3; + for (i = 0; (i < 8) && (i < netif->hwaddr_len); i++) { + if (i == 4) { + addr_index--; + } + ip_2_ip6(&netif->ip6_addr[0])->addr[addr_index] |= ((u32_t)(netif->hwaddr[netif->hwaddr_len - i - 1])) << (8 * (i & 0x03)); + } + } + + /* Set address state. */ +#if LWIP_IPV6_DUP_DETECT_ATTEMPTS + /* Will perform duplicate address detection (DAD). */ + netif_ip6_addr_set_state(netif, 0, IP6_ADDR_TENTATIVE); +#else + /* Consider address valid. */ + netif_ip6_addr_set_state(netif, 0, IP6_ADDR_PREFERRED); +#endif /* LWIP_IPV6_AUTOCONFIG */ +} + +/** + * @ingroup netif_ip6 + * This function allows for the easy addition of a new IPv6 address to an interface. + * It takes care of finding an empty slot and then sets the address tentative + * (to make sure that all the subsequent processing happens). + * + * @param netif netif to add the address on + * @param ip6addr address to add + * @param chosen_idx if != NULL, the chosen IPv6 address index will be stored here + */ +err_t +netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx) +{ + s8_t i; + + i = netif_get_ip6_addr_match(netif, ip6addr); + if (i >= 0) { + /* Address already added */ + if (chosen_idx != NULL) { + *chosen_idx = i; + } + return ERR_OK; + } + + /* Find a free slot -- musn't be the first one (reserved for link local) */ + for (i = 1; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (ip6_addr_isinvalid(netif_ip6_addr_state(netif, i))) { + ip_addr_copy_from_ip6(netif->ip6_addr[i], *ip6addr); + netif_ip6_addr_set_state(netif, i, IP6_ADDR_TENTATIVE); + if (chosen_idx != NULL) { + *chosen_idx = i; + } + return ERR_OK; + } + } + + if (chosen_idx != NULL) { + *chosen_idx = -1; + } + return ERR_VAL; +} + +/** Dummy IPv6 output function for netifs not supporting IPv6 + */ +static err_t +netif_null_output_ip6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr) +{ + LWIP_UNUSED_ARG(netif); + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(ipaddr); + + return ERR_IF; +} +#endif /* LWIP_IPV6 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/pbuf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/pbuf.c new file mode 100644 index 0000000..059f83a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/pbuf.c @@ -0,0 +1,1442 @@ +/** + * @file + * Packet buffer management + */ + +/** + * @defgroup pbuf Packet buffers (PBUF) + * @ingroup infrastructure + * + * Packets are built from the pbuf data structure. It supports dynamic + * memory allocation for packet contents or can reference externally + * managed packet contents both in RAM and ROM. Quick allocation for + * incoming packets is provided through pools with fixed sized pbufs. + * + * A packet may span over multiple pbufs, chained as a singly linked + * list. This is called a "pbuf chain". + * + * Multiple packets may be queued, also using this singly linked list. + * This is called a "packet queue". + * + * So, a packet queue consists of one or more pbuf chains, each of + * which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE + * NOT SUPPORTED!!! Use helper structs to queue multiple packets. + * + * The differences between a pbuf chain and a packet queue are very + * precise but subtle. + * + * The last pbuf of a packet has a ->tot_len field that equals the + * ->len field. It can be found by traversing the list. If the last + * pbuf of a packet has a ->next field other than NULL, more packets + * are on the queue. + * + * Therefore, looping through a pbuf of a single packet, has an + * loop end condition (tot_len == p->len), NOT (next == NULL). + * + * Example of custom pbuf usage for zero-copy RX: + @code{.c} +typedef struct my_custom_pbuf +{ + struct pbuf_custom p; + void* dma_descriptor; +} my_custom_pbuf_t; + +LWIP_MEMPOOL_DECLARE(RX_POOL, 10, sizeof(my_custom_pbuf_t), "Zero-copy RX PBUF pool"); + +void my_pbuf_free_custom(void* p) +{ + my_custom_pbuf_t* my_puf = (my_custom_pbuf_t*)p; + + LOCK_INTERRUPTS(); + free_rx_dma_descriptor(my_pbuf->dma_descriptor); + LWIP_MEMPOOL_FREE(RX_POOL, my_pbuf); + UNLOCK_INTERRUPTS(); +} + +void eth_rx_irq() +{ + dma_descriptor* dma_desc = get_RX_DMA_descriptor_from_ethernet(); + my_custom_pbuf_t* my_pbuf = (my_custom_pbuf_t*)LWIP_MEMPOOL_ALLOC(RX_POOL); + + my_pbuf->p.custom_free_function = my_pbuf_free_custom; + my_pbuf->dma_descriptor = dma_desc; + + invalidate_cpu_cache(dma_desc->rx_data, dma_desc->rx_length); + + struct pbuf* p = pbuf_alloced_custom(PBUF_RAW, + dma_desc->rx_length, + PBUF_REF, + &my_pbuf->p, + dma_desc->rx_data, + dma_desc->max_buffer_size); + + if(netif->input(p, netif) != ERR_OK) { + pbuf_free(p); + } +} + @endcode + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#include "lwip/stats.h" +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/pbuf.h" +#include "lwip/sys.h" +#if LWIP_TCP && TCP_QUEUE_OOSEQ +#include "lwip/priv/tcp_priv.h" +#endif +#if LWIP_CHECKSUM_ON_COPY +#include "lwip/inet_chksum.h" +#endif + +#include + +#define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) +/* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically + aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */ +#define PBUF_POOL_BUFSIZE_ALIGNED LWIP_MEM_ALIGN_SIZE(PBUF_POOL_BUFSIZE) + +#if !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ +#define PBUF_POOL_IS_EMPTY() +#else /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */ + +#if !NO_SYS +#ifndef PBUF_POOL_FREE_OOSEQ_QUEUE_CALL +#include "lwip/tcpip.h" +#define PBUF_POOL_FREE_OOSEQ_QUEUE_CALL() do { \ + if (tcpip_callback_with_block(pbuf_free_ooseq_callback, NULL, 0) != ERR_OK) { \ + SYS_ARCH_PROTECT(old_level); \ + pbuf_free_ooseq_pending = 0; \ + SYS_ARCH_UNPROTECT(old_level); \ + } } while(0) +#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */ +#endif /* !NO_SYS */ + +volatile u8_t pbuf_free_ooseq_pending; +#define PBUF_POOL_IS_EMPTY() pbuf_pool_is_empty() + +/** + * Attempt to reclaim some memory from queued out-of-sequence TCP segments + * if we run out of pool pbufs. It's better to give priority to new packets + * if we're running out. + * + * This must be done in the correct thread context therefore this function + * can only be used with NO_SYS=0 and through tcpip_callback. + */ +#if !NO_SYS +static +#endif /* !NO_SYS */ +void +pbuf_free_ooseq(void) +{ + struct tcp_pcb* pcb; + SYS_ARCH_SET(pbuf_free_ooseq_pending, 0); + + for (pcb = tcp_active_pcbs; NULL != pcb; pcb = pcb->next) { + if (NULL != pcb->ooseq) { + /** Free the ooseq pbufs of one PCB only */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free_ooseq: freeing out-of-sequence pbufs\n")); + tcp_segs_free(pcb->ooseq); + pcb->ooseq = NULL; + return; + } + } +} + +#if !NO_SYS +/** + * Just a callback function for tcpip_callback() that calls pbuf_free_ooseq(). + */ +static void +pbuf_free_ooseq_callback(void *arg) +{ + LWIP_UNUSED_ARG(arg); + pbuf_free_ooseq(); +} +#endif /* !NO_SYS */ + +/** Queue a call to pbuf_free_ooseq if not already queued. */ +static void +pbuf_pool_is_empty(void) +{ +#ifndef PBUF_POOL_FREE_OOSEQ_QUEUE_CALL + SYS_ARCH_SET(pbuf_free_ooseq_pending, 1); +#else /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */ + u8_t queued; + SYS_ARCH_DECL_PROTECT(old_level); + SYS_ARCH_PROTECT(old_level); + queued = pbuf_free_ooseq_pending; + pbuf_free_ooseq_pending = 1; + SYS_ARCH_UNPROTECT(old_level); + + if (!queued) { + /* queue a call to pbuf_free_ooseq if not already queued */ + PBUF_POOL_FREE_OOSEQ_QUEUE_CALL(); + } +#endif /* PBUF_POOL_FREE_OOSEQ_QUEUE_CALL */ +} +#endif /* !LWIP_TCP || !TCP_QUEUE_OOSEQ || !PBUF_POOL_FREE_OOSEQ */ + +/** + * @ingroup pbuf + * Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type). + * + * The actual memory allocated for the pbuf is determined by the + * layer at which the pbuf is allocated and the requested size + * (from the size parameter). + * + * @param layer flag to define header size + * @param length size of the pbuf's payload + * @param type this parameter decides how and where the pbuf + * should be allocated as follows: + * + * - PBUF_RAM: buffer memory for pbuf is allocated as one large + * chunk. This includes protocol headers as well. + * - PBUF_ROM: no buffer memory is allocated for the pbuf, even for + * protocol headers. Additional headers must be prepended + * by allocating another pbuf and chain in to the front of + * the ROM pbuf. It is assumed that the memory used is really + * similar to ROM in that it is immutable and will not be + * changed. Memory which is dynamic should generally not + * be attached to PBUF_ROM pbufs. Use PBUF_REF instead. + * - PBUF_REF: no buffer memory is allocated for the pbuf, even for + * protocol headers. It is assumed that the pbuf is only + * being used in a single thread. If the pbuf gets queued, + * then pbuf_take should be called to copy the buffer. + * - PBUF_POOL: the pbuf is allocated as a pbuf chain, with pbufs from + * the pbuf pool that is allocated during pbuf_init(). + * + * @return the allocated pbuf. If multiple pbufs where allocated, this + * is the first pbuf of a pbuf chain. + */ +struct pbuf * +pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) +{ + struct pbuf *p, *q, *r; + u16_t offset; + s32_t rem_len; /* remaining length */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F")\n", length)); + + /* determine header offset */ + switch (layer) { + case PBUF_TRANSPORT: + /* add room for transport (often TCP) layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN; + break; + case PBUF_IP: + /* add room for IP layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN; + break; + case PBUF_LINK: + /* add room for link layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN; + break; + case PBUF_RAW_TX: + /* add room for encapsulating link layer headers (e.g. 802.11) */ + offset = PBUF_LINK_ENCAPSULATION_HLEN; + break; + case PBUF_RAW: + /* no offset (e.g. RX buffers or chain successors) */ + offset = 0; + break; + default: + LWIP_ASSERT("pbuf_alloc: bad pbuf layer", 0); + return NULL; + } + + switch (type) { + case PBUF_POOL: + /* allocate head of pbuf chain into p */ + p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL); + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p)); + if (p == NULL) { + PBUF_POOL_IS_EMPTY(); + return NULL; + } + p->type = type; + p->next = NULL; + + /* make the payload pointer point 'offset' bytes into pbuf data memory */ + p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + (SIZEOF_STRUCT_PBUF + offset))); + LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned", + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); + /* the total length of the pbuf chain is the requested size */ + p->tot_len = length; + /* set the length of the first pbuf in the chain */ + p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)); + LWIP_ASSERT("check p->payload + p->len does not overflow pbuf", + ((u8_t*)p->payload + p->len <= + (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED)); + LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT", + (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 ); + /* set reference count (needed here in case we fail) */ + p->ref = 1; + + /* now allocate the tail of the pbuf chain */ + + /* remember first pbuf for linkage in next iteration */ + r = p; + /* remaining length to be allocated */ + rem_len = length - p->len; + /* any remaining pbufs to be allocated? */ + while (rem_len > 0) { + q = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL); + if (q == NULL) { + PBUF_POOL_IS_EMPTY(); + /* free chain so far allocated */ + pbuf_free(p); + /* bail out unsuccessfully */ + return NULL; + } + q->type = type; + q->flags = 0; + q->next = NULL; + /* make previous pbuf point to this pbuf */ + r->next = q; + /* set total length of this pbuf and next in chain */ + LWIP_ASSERT("rem_len < max_u16_t", rem_len < 0xffff); + q->tot_len = (u16_t)rem_len; + /* this pbuf length is pool size, unless smaller sized tail */ + q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED); + q->payload = (void *)((u8_t *)q + SIZEOF_STRUCT_PBUF); + LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned", + ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0); + LWIP_ASSERT("check p->payload + p->len does not overflow pbuf", + ((u8_t*)p->payload + p->len <= + (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED)); + q->ref = 1; + /* calculate remaining length to be allocated */ + rem_len -= q->len; + /* remember this pbuf for linkage in next iteration */ + r = q; + } + /* end of chain */ + /*r->next = NULL;*/ + + break; + case PBUF_RAM: + { + mem_size_t alloc_len = LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length); + + /* bug #50040: Check for integer overflow when calculating alloc_len */ + if (alloc_len < LWIP_MEM_ALIGN_SIZE(length)) { + return NULL; + } + + /* If pbuf is to be allocated in RAM, allocate memory for it. */ + p = (struct pbuf*)mem_malloc(alloc_len); + } + + if (p == NULL) { + return NULL; + } + /* Set up internal structure of the pbuf. */ + p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset)); + p->len = p->tot_len = length; + p->next = NULL; + p->type = type; + + LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned", + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); + break; + /* pbuf references existing (non-volatile static constant) ROM payload? */ + case PBUF_ROM: + /* pbuf references existing (externally allocated) RAM payload? */ + case PBUF_REF: + /* only allocate memory for the pbuf structure */ + p = (struct pbuf *)memp_malloc(MEMP_PBUF); + if (p == NULL) { + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("pbuf_alloc: Could not allocate MEMP_PBUF for PBUF_%s.\n", + (type == PBUF_ROM) ? "ROM" : "REF")); + return NULL; + } + /* caller must set this field properly, afterwards */ + p->payload = NULL; + p->len = p->tot_len = length; + p->next = NULL; + p->type = type; + break; + default: + LWIP_ASSERT("pbuf_alloc: erroneous type", 0); + return NULL; + } + /* set reference count */ + p->ref = 1; + /* set flags */ + p->flags = 0; + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p)); + return p; +} + +#if LWIP_SUPPORT_CUSTOM_PBUF +/** + * @ingroup pbuf + * Initialize a custom pbuf (already allocated). + * + * @param l flag to define header size + * @param length size of the pbuf's payload + * @param type type of the pbuf (only used to treat the pbuf accordingly, as + * this function allocates no memory) + * @param p pointer to the custom pbuf to initialize (already allocated) + * @param payload_mem pointer to the buffer that is used for payload and headers, + * must be at least big enough to hold 'length' plus the header size, + * may be NULL if set later. + * ATTENTION: The caller is responsible for correct alignment of this buffer!! + * @param payload_mem_len the size of the 'payload_mem' buffer, must be at least + * big enough to hold 'length' plus the header size + */ +struct pbuf* +pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p, + void *payload_mem, u16_t payload_mem_len) +{ + u16_t offset; + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloced_custom(length=%"U16_F")\n", length)); + + /* determine header offset */ + switch (l) { + case PBUF_TRANSPORT: + /* add room for transport (often TCP) layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN; + break; + case PBUF_IP: + /* add room for IP layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN; + break; + case PBUF_LINK: + /* add room for link layer header */ + offset = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN; + break; + case PBUF_RAW_TX: + /* add room for encapsulating link layer headers (e.g. 802.11) */ + offset = PBUF_LINK_ENCAPSULATION_HLEN; + break; + case PBUF_RAW: + offset = 0; + break; + default: + LWIP_ASSERT("pbuf_alloced_custom: bad pbuf layer", 0); + return NULL; + } + + if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) { + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length)); + return NULL; + } + + p->pbuf.next = NULL; + if (payload_mem != NULL) { + p->pbuf.payload = (u8_t *)payload_mem + LWIP_MEM_ALIGN_SIZE(offset); + } else { + p->pbuf.payload = NULL; + } + p->pbuf.flags = PBUF_FLAG_IS_CUSTOM; + p->pbuf.len = p->pbuf.tot_len = length; + p->pbuf.type = type; + p->pbuf.ref = 1; + return &p->pbuf; +} +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + +/** + * @ingroup pbuf + * Shrink a pbuf chain to a desired length. + * + * @param p pbuf to shrink. + * @param new_len desired new length of pbuf chain + * + * Depending on the desired length, the first few pbufs in a chain might + * be skipped and left unchanged. The new last pbuf in the chain will be + * resized, and any remaining pbufs will be freed. + * + * @note If the pbuf is ROM/REF, only the ->tot_len and ->len fields are adjusted. + * @note May not be called on a packet queue. + * + * @note Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain). + */ +void +pbuf_realloc(struct pbuf *p, u16_t new_len) +{ + struct pbuf *q; + u16_t rem_len; /* remaining length */ + s32_t grow; + + LWIP_ASSERT("pbuf_realloc: p != NULL", p != NULL); + LWIP_ASSERT("pbuf_realloc: sane p->type", p->type == PBUF_POOL || + p->type == PBUF_ROM || + p->type == PBUF_RAM || + p->type == PBUF_REF); + + /* desired length larger than current length? */ + if (new_len >= p->tot_len) { + /* enlarging not yet supported */ + return; + } + + /* the pbuf chain grows by (new_len - p->tot_len) bytes + * (which may be negative in case of shrinking) */ + grow = new_len - p->tot_len; + + /* first, step over any pbufs that should remain in the chain */ + rem_len = new_len; + q = p; + /* should this pbuf be kept? */ + while (rem_len > q->len) { + /* decrease remaining length by pbuf length */ + rem_len -= q->len; + /* decrease total length indicator */ + LWIP_ASSERT("grow < max_u16_t", grow < 0xffff); + q->tot_len += (u16_t)grow; + /* proceed to next pbuf in chain */ + q = q->next; + LWIP_ASSERT("pbuf_realloc: q != NULL", q != NULL); + } + /* we have now reached the new last pbuf (in q) */ + /* rem_len == desired length for pbuf q */ + + /* shrink allocated memory for PBUF_RAM */ + /* (other types merely adjust their length fields */ + if ((q->type == PBUF_RAM) && (rem_len != q->len) +#if LWIP_SUPPORT_CUSTOM_PBUF + && ((q->flags & PBUF_FLAG_IS_CUSTOM) == 0) +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + ) { + /* reallocate and adjust the length of the pbuf that will be split */ + q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len); + LWIP_ASSERT("mem_trim returned q == NULL", q != NULL); + } + /* adjust length fields for new last pbuf */ + q->len = rem_len; + q->tot_len = q->len; + + /* any remaining pbufs in chain? */ + if (q->next != NULL) { + /* free remaining pbufs in chain */ + pbuf_free(q->next); + } + /* q is last packet in chain */ + q->next = NULL; + +} + +/** + * Adjusts the payload pointer to hide or reveal headers in the payload. + * @see pbuf_header. + * + * @param p pbuf to change the header size. + * @param header_size_increment Number of bytes to increment header size. + * @param force Allow 'header_size_increment > 0' for PBUF_REF/PBUF_ROM types + * + * @return non-zero on failure, zero on success. + * + */ +static u8_t +pbuf_header_impl(struct pbuf *p, s16_t header_size_increment, u8_t force) +{ + u16_t type; + void *payload; + u16_t increment_magnitude; + + LWIP_ASSERT("p != NULL", p != NULL); + if ((header_size_increment == 0) || (p == NULL)) { + return 0; + } + + if (header_size_increment < 0) { + increment_magnitude = (u16_t)-header_size_increment; + /* Check that we aren't going to move off the end of the pbuf */ + LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;); + } else { + increment_magnitude = (u16_t)header_size_increment; +#if 0 + /* Can't assert these as some callers speculatively call + pbuf_header() to see if it's OK. Will return 1 below instead. */ + /* Check that we've got the correct type of pbuf to work with */ + LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL", + p->type == PBUF_RAM || p->type == PBUF_POOL); + /* Check that we aren't going to move off the beginning of the pbuf */ + LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF", + (u8_t *)p->payload - increment_magnitude >= (u8_t *)p + SIZEOF_STRUCT_PBUF); +#endif + } + + type = p->type; + /* remember current payload pointer */ + payload = p->payload; + + /* pbuf types containing payloads? */ + if (type == PBUF_RAM || type == PBUF_POOL) { + /* set new payload pointer */ + p->payload = (u8_t *)p->payload - header_size_increment; + /* boundary check fails? */ + if ((u8_t *)p->payload < (u8_t *)p + SIZEOF_STRUCT_PBUF) { + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, + ("pbuf_header: failed as %p < %p (not enough space for new header size)\n", + (void *)p->payload, (void *)((u8_t *)p + SIZEOF_STRUCT_PBUF))); + /* restore old payload pointer */ + p->payload = payload; + /* bail out unsuccessfully */ + return 1; + } + /* pbuf types referring to external payloads? */ + } else if (type == PBUF_REF || type == PBUF_ROM) { + /* hide a header in the payload? */ + if ((header_size_increment < 0) && (increment_magnitude <= p->len)) { + /* increase payload pointer */ + p->payload = (u8_t *)p->payload - header_size_increment; + } else if ((header_size_increment > 0) && force) { + p->payload = (u8_t *)p->payload - header_size_increment; + } else { + /* cannot expand payload to front (yet!) + * bail out unsuccessfully */ + return 1; + } + } else { + /* Unknown type */ + LWIP_ASSERT("bad pbuf type", 0); + return 1; + } + /* modify pbuf length fields */ + p->len += header_size_increment; + p->tot_len += header_size_increment; + + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_header: old %p new %p (%"S16_F")\n", + (void *)payload, (void *)p->payload, header_size_increment)); + + return 0; +} + +/** + * Adjusts the payload pointer to hide or reveal headers in the payload. + * + * Adjusts the ->payload pointer so that space for a header + * (dis)appears in the pbuf payload. + * + * The ->payload, ->tot_len and ->len fields are adjusted. + * + * @param p pbuf to change the header size. + * @param header_size_increment Number of bytes to increment header size which + * increases the size of the pbuf. New space is on the front. + * (Using a negative value decreases the header size.) + * If hdr_size_inc is 0, this function does nothing and returns successful. + * + * PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so + * the call will fail. A check is made that the increase in header size does + * not move the payload pointer in front of the start of the buffer. + * @return non-zero on failure, zero on success. + * + */ +u8_t +pbuf_header(struct pbuf *p, s16_t header_size_increment) +{ + return pbuf_header_impl(p, header_size_increment, 0); +} + +/** + * Same as pbuf_header but does not check if 'header_size > 0' is allowed. + * This is used internally only, to allow PBUF_REF for RX. + */ +u8_t +pbuf_header_force(struct pbuf *p, s16_t header_size_increment) +{ + return pbuf_header_impl(p, header_size_increment, 1); +} + +/** + * @ingroup pbuf + * Dereference a pbuf chain or queue and deallocate any no-longer-used + * pbufs at the head of this chain or queue. + * + * Decrements the pbuf reference count. If it reaches zero, the pbuf is + * deallocated. + * + * For a pbuf chain, this is repeated for each pbuf in the chain, + * up to the first pbuf which has a non-zero reference count after + * decrementing. So, when all reference counts are one, the whole + * chain is free'd. + * + * @param p The pbuf (chain) to be dereferenced. + * + * @return the number of pbufs that were de-allocated + * from the head of the chain. + * + * @note MUST NOT be called on a packet queue (Not verified to work yet). + * @note the reference counter of a pbuf equals the number of pointers + * that refer to the pbuf (or into the pbuf). + * + * @internal examples: + * + * Assuming existing chains a->b->c with the following reference + * counts, calling pbuf_free(a) results in: + * + * 1->2->3 becomes ...1->3 + * 3->3->3 becomes 2->3->3 + * 1->1->2 becomes ......1 + * 2->1->1 becomes 1->1->1 + * 1->1->1 becomes ....... + * + */ +u8_t +pbuf_free(struct pbuf *p) +{ + u16_t type; + struct pbuf *q; + u8_t count; + + if (p == NULL) { + LWIP_ASSERT("p != NULL", p != NULL); + /* if assertions are disabled, proceed with debug output */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("pbuf_free(p == NULL) was called.\n")); + return 0; + } + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free(%p)\n", (void *)p)); + + PERF_START; + + LWIP_ASSERT("pbuf_free: sane type", + p->type == PBUF_RAM || p->type == PBUF_ROM || + p->type == PBUF_REF || p->type == PBUF_POOL); + + count = 0; + /* de-allocate all consecutive pbufs from the head of the chain that + * obtain a zero reference count after decrementing*/ + while (p != NULL) { + u16_t ref; + SYS_ARCH_DECL_PROTECT(old_level); + /* Since decrementing ref cannot be guaranteed to be a single machine operation + * we must protect it. We put the new ref into a local variable to prevent + * further protection. */ + SYS_ARCH_PROTECT(old_level); + /* all pbufs in a chain are referenced at least once */ + LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0); + /* decrease reference count (number of pointers to pbuf) */ + ref = --(p->ref); + SYS_ARCH_UNPROTECT(old_level); + /* this pbuf is no longer referenced to? */ + if (ref == 0) { + /* remember next pbuf in chain for next iteration */ + q = p->next; + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: deallocating %p\n", (void *)p)); + type = p->type; +#if LWIP_SUPPORT_CUSTOM_PBUF + /* is this a custom pbuf? */ + if ((p->flags & PBUF_FLAG_IS_CUSTOM) != 0) { + struct pbuf_custom *pc = (struct pbuf_custom*)p; + LWIP_ASSERT("pc->custom_free_function != NULL", pc->custom_free_function != NULL); + pc->custom_free_function(p); + } else +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + { + /* is this a pbuf from the pool? */ + if (type == PBUF_POOL) { + memp_free(MEMP_PBUF_POOL, p); + /* is this a ROM or RAM referencing pbuf? */ + } else if (type == PBUF_ROM || type == PBUF_REF) { + memp_free(MEMP_PBUF, p); + /* type == PBUF_RAM */ + } else { + mem_free(p); + } + } + count++; + /* proceed to next pbuf */ + p = q; + /* p->ref > 0, this pbuf is still referenced to */ + /* (and so the remaining pbufs in chain as well) */ + } else { + LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, ref)); + /* stop walking through the chain */ + p = NULL; + } + } + PERF_STOP("pbuf_free"); + /* return number of de-allocated pbufs */ + return count; +} + +/** + * Count number of pbufs in a chain + * + * @param p first pbuf of chain + * @return the number of pbufs in a chain + */ +u16_t +pbuf_clen(const struct pbuf *p) +{ + u16_t len; + + len = 0; + while (p != NULL) { + ++len; + p = p->next; + } + return len; +} + +/** + * @ingroup pbuf + * Increment the reference count of the pbuf. + * + * @param p pbuf to increase reference counter of + * + */ +void +pbuf_ref(struct pbuf *p) +{ + /* pbuf given? */ + if (p != NULL) { + SYS_ARCH_INC(p->ref, 1); + LWIP_ASSERT("pbuf ref overflow", p->ref > 0); + } +} + +/** + * @ingroup pbuf + * Concatenate two pbufs (each may be a pbuf chain) and take over + * the caller's reference of the tail pbuf. + * + * @note The caller MAY NOT reference the tail pbuf afterwards. + * Use pbuf_chain() for that purpose. + * + * @see pbuf_chain() + */ +void +pbuf_cat(struct pbuf *h, struct pbuf *t) +{ + struct pbuf *p; + + LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)", + ((h != NULL) && (t != NULL)), return;); + + /* proceed to last pbuf of chain */ + for (p = h; p->next != NULL; p = p->next) { + /* add total length of second chain to all totals of first chain */ + p->tot_len += t->tot_len; + } + /* { p is last pbuf of first h chain, p->next == NULL } */ + LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len); + LWIP_ASSERT("p->next == NULL", p->next == NULL); + /* add total length of second chain to last pbuf total of first chain */ + p->tot_len += t->tot_len; + /* chain last pbuf of head (p) with first of tail (t) */ + p->next = t; + /* p->next now references t, but the caller will drop its reference to t, + * so netto there is no change to the reference count of t. + */ +} + +/** + * @ingroup pbuf + * Chain two pbufs (or pbuf chains) together. + * + * The caller MUST call pbuf_free(t) once it has stopped + * using it. Use pbuf_cat() instead if you no longer use t. + * + * @param h head pbuf (chain) + * @param t tail pbuf (chain) + * @note The pbufs MUST belong to the same packet. + * @note MAY NOT be called on a packet queue. + * + * The ->tot_len fields of all pbufs of the head chain are adjusted. + * The ->next field of the last pbuf of the head chain is adjusted. + * The ->ref field of the first pbuf of the tail chain is adjusted. + * + */ +void +pbuf_chain(struct pbuf *h, struct pbuf *t) +{ + pbuf_cat(h, t); + /* t is now referenced by h */ + pbuf_ref(t); + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_chain: %p references %p\n", (void *)h, (void *)t)); +} + +/** + * Dechains the first pbuf from its succeeding pbufs in the chain. + * + * Makes p->tot_len field equal to p->len. + * @param p pbuf to dechain + * @return remainder of the pbuf chain, or NULL if it was de-allocated. + * @note May not be called on a packet queue. + */ +struct pbuf * +pbuf_dechain(struct pbuf *p) +{ + struct pbuf *q; + u8_t tail_gone = 1; + /* tail */ + q = p->next; + /* pbuf has successor in chain? */ + if (q != NULL) { + /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */ + LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len); + /* enforce invariant if assertion is disabled */ + q->tot_len = p->tot_len - p->len; + /* decouple pbuf from remainder */ + p->next = NULL; + /* total length of pbuf p is its own length only */ + p->tot_len = p->len; + /* q is no longer referenced by p, free it */ + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_dechain: unreferencing %p\n", (void *)q)); + tail_gone = pbuf_free(q); + if (tail_gone > 0) { + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, + ("pbuf_dechain: deallocated %p (as it is no longer referenced)\n", (void *)q)); + } + /* return remaining tail or NULL if deallocated */ + } + /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */ + LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len); + return ((tail_gone > 0) ? NULL : q); +} + +/** + * @ingroup pbuf + * Create PBUF_RAM copies of pbufs. + * + * Used to queue packets on behalf of the lwIP stack, such as + * ARP based queueing. + * + * @note You MUST explicitly use p = pbuf_take(p); + * + * @note Only one packet is copied, no packet queue! + * + * @param p_to pbuf destination of the copy + * @param p_from pbuf source of the copy + * + * @return ERR_OK if pbuf was copied + * ERR_ARG if one of the pbufs is NULL or p_to is not big + * enough to hold p_from + */ +err_t +pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from) +{ + u16_t offset_to=0, offset_from=0, len; + + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy(%p, %p)\n", + (const void*)p_to, (const void*)p_from)); + + /* is the target big enough to hold the source? */ + LWIP_ERROR("pbuf_copy: target not big enough to hold source", ((p_to != NULL) && + (p_from != NULL) && (p_to->tot_len >= p_from->tot_len)), return ERR_ARG;); + + /* iterate through pbuf chain */ + do + { + /* copy one part of the original chain */ + if ((p_to->len - offset_to) >= (p_from->len - offset_from)) { + /* complete current p_from fits into current p_to */ + len = p_from->len - offset_from; + } else { + /* current p_from does not fit into current p_to */ + len = p_to->len - offset_to; + } + MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len); + offset_to += len; + offset_from += len; + LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len); + LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len); + if (offset_from >= p_from->len) { + /* on to next p_from (if any) */ + offset_from = 0; + p_from = p_from->next; + } + if (offset_to == p_to->len) { + /* on to next p_to (if any) */ + offset_to = 0; + p_to = p_to->next; + LWIP_ERROR("p_to != NULL", (p_to != NULL) || (p_from == NULL) , return ERR_ARG;); + } + + if ((p_from != NULL) && (p_from->len == p_from->tot_len)) { + /* don't copy more than one packet! */ + LWIP_ERROR("pbuf_copy() does not allow packet queues!", + (p_from->next == NULL), return ERR_VAL;); + } + if ((p_to != NULL) && (p_to->len == p_to->tot_len)) { + /* don't copy more than one packet! */ + LWIP_ERROR("pbuf_copy() does not allow packet queues!", + (p_to->next == NULL), return ERR_VAL;); + } + } while (p_from); + LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_copy: end of chain reached.\n")); + return ERR_OK; +} + +/** + * @ingroup pbuf + * Copy (part of) the contents of a packet buffer + * to an application supplied buffer. + * + * @param buf the pbuf from which to copy data + * @param dataptr the application supplied buffer + * @param len length of data to copy (dataptr must be big enough). No more + * than buf->tot_len will be copied, irrespective of len + * @param offset offset into the packet buffer from where to begin copying len bytes + * @return the number of bytes copied, or 0 on failure + */ +u16_t +pbuf_copy_partial(const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset) +{ + const struct pbuf *p; + u16_t left; + u16_t buf_copy_len; + u16_t copied_total = 0; + + LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;); + LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;); + + left = 0; + + if ((buf == NULL) || (dataptr == NULL)) { + return 0; + } + + /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */ + for (p = buf; len != 0 && p != NULL; p = p->next) { + if ((offset != 0) && (offset >= p->len)) { + /* don't copy from this buffer -> on to the next */ + offset -= p->len; + } else { + /* copy from this buffer. maybe only partially. */ + buf_copy_len = p->len - offset; + if (buf_copy_len > len) { + buf_copy_len = len; + } + /* copy the necessary parts of the buffer */ + MEMCPY(&((char*)dataptr)[left], &((char*)p->payload)[offset], buf_copy_len); + copied_total += buf_copy_len; + left += buf_copy_len; + len -= buf_copy_len; + offset = 0; + } + } + return copied_total; +} + +#if LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE +/** + * This method modifies a 'pbuf chain', so that its total length is + * smaller than 64K. The remainder of the original pbuf chain is stored + * in *rest. + * This function never creates new pbufs, but splits an existing chain + * in two parts. The tot_len of the modified packet queue will likely be + * smaller than 64K. + * 'packet queues' are not supported by this function. + * + * @param p the pbuf queue to be split + * @param rest pointer to store the remainder (after the first 64K) + */ +void pbuf_split_64k(struct pbuf *p, struct pbuf **rest) +{ + *rest = NULL; + if ((p != NULL) && (p->next != NULL)) { + u16_t tot_len_front = p->len; + struct pbuf *i = p; + struct pbuf *r = p->next; + + /* continue until the total length (summed up as u16_t) overflows */ + while ((r != NULL) && ((u16_t)(tot_len_front + r->len) > tot_len_front)) { + tot_len_front += r->len; + i = r; + r = r->next; + } + /* i now points to last packet of the first segment. Set next + pointer to NULL */ + i->next = NULL; + + if (r != NULL) { + /* Update the tot_len field in the first part */ + for (i = p; i != NULL; i = i->next) { + i->tot_len -= r->tot_len; + LWIP_ASSERT("tot_len/len mismatch in last pbuf", + (i->next != NULL) || (i->tot_len == i->len)); + } + if (p->flags & PBUF_FLAG_TCP_FIN) { + r->flags |= PBUF_FLAG_TCP_FIN; + } + + /* tot_len field in rest does not need modifications */ + /* reference counters do not need modifications */ + *rest = r; + } + } +} +#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + +/* Actual implementation of pbuf_skip() but returning const pointer... */ +static const struct pbuf* +pbuf_skip_const(const struct pbuf* in, u16_t in_offset, u16_t* out_offset) +{ + u16_t offset_left = in_offset; + const struct pbuf* q = in; + + /* get the correct pbuf */ + while ((q != NULL) && (q->len <= offset_left)) { + offset_left -= q->len; + q = q->next; + } + if (out_offset != NULL) { + *out_offset = offset_left; + } + return q; +} + +/** + * @ingroup pbuf + * Skip a number of bytes at the start of a pbuf + * + * @param in input pbuf + * @param in_offset offset to skip + * @param out_offset resulting offset in the returned pbuf + * @return the pbuf in the queue where the offset is + */ +struct pbuf* +pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset) +{ + const struct pbuf* out = pbuf_skip_const(in, in_offset, out_offset); + return LWIP_CONST_CAST(struct pbuf*, out); +} + +/** + * @ingroup pbuf + * Copy application supplied data into a pbuf. + * This function can only be used to copy the equivalent of buf->tot_len data. + * + * @param buf pbuf to fill with data + * @param dataptr application supplied data buffer + * @param len length of the application supplied data buffer + * + * @return ERR_OK if successful, ERR_MEM if the pbuf is not big enough + */ +err_t +pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len) +{ + struct pbuf *p; + u16_t buf_copy_len; + u16_t total_copy_len = len; + u16_t copied_total = 0; + + LWIP_ERROR("pbuf_take: invalid buf", (buf != NULL), return ERR_ARG;); + LWIP_ERROR("pbuf_take: invalid dataptr", (dataptr != NULL), return ERR_ARG;); + LWIP_ERROR("pbuf_take: buf not large enough", (buf->tot_len >= len), return ERR_MEM;); + + if ((buf == NULL) || (dataptr == NULL) || (buf->tot_len < len)) { + return ERR_ARG; + } + + /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */ + for (p = buf; total_copy_len != 0; p = p->next) { + LWIP_ASSERT("pbuf_take: invalid pbuf", p != NULL); + buf_copy_len = total_copy_len; + if (buf_copy_len > p->len) { + /* this pbuf cannot hold all remaining data */ + buf_copy_len = p->len; + } + /* copy the necessary parts of the buffer */ + MEMCPY(p->payload, &((const char*)dataptr)[copied_total], buf_copy_len); + total_copy_len -= buf_copy_len; + copied_total += buf_copy_len; + } + LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len); + return ERR_OK; +} + +/** + * @ingroup pbuf + * Same as pbuf_take() but puts data at an offset + * + * @param buf pbuf to fill with data + * @param dataptr application supplied data buffer + * @param len length of the application supplied data buffer + * @param offset offset in pbuf where to copy dataptr to + * + * @return ERR_OK if successful, ERR_MEM if the pbuf is not big enough + */ +err_t +pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset) +{ + u16_t target_offset; + struct pbuf* q = pbuf_skip(buf, offset, &target_offset); + + /* return requested data if pbuf is OK */ + if ((q != NULL) && (q->tot_len >= target_offset + len)) { + u16_t remaining_len = len; + const u8_t* src_ptr = (const u8_t*)dataptr; + /* copy the part that goes into the first pbuf */ + u16_t first_copy_len = LWIP_MIN(q->len - target_offset, len); + MEMCPY(((u8_t*)q->payload) + target_offset, dataptr, first_copy_len); + remaining_len -= first_copy_len; + src_ptr += first_copy_len; + if (remaining_len > 0) { + return pbuf_take(q->next, src_ptr, remaining_len); + } + return ERR_OK; + } + return ERR_MEM; +} + +/** + * @ingroup pbuf + * Creates a single pbuf out of a queue of pbufs. + * + * @remark: Either the source pbuf 'p' is freed by this function or the original + * pbuf 'p' is returned, therefore the caller has to check the result! + * + * @param p the source pbuf + * @param layer pbuf_layer of the new pbuf + * + * @return a new, single pbuf (p->next is NULL) + * or the old pbuf if allocation fails + */ +struct pbuf* +pbuf_coalesce(struct pbuf *p, pbuf_layer layer) +{ + struct pbuf *q; + err_t err; + if (p->next == NULL) { + return p; + } + q = pbuf_alloc(layer, p->tot_len, PBUF_RAM); + if (q == NULL) { + /* @todo: what do we do now? */ + return p; + } + err = pbuf_copy(q, p); + LWIP_UNUSED_ARG(err); /* in case of LWIP_NOASSERT */ + LWIP_ASSERT("pbuf_copy failed", err == ERR_OK); + pbuf_free(p); + return q; +} + +#if LWIP_CHECKSUM_ON_COPY +/** + * Copies data into a single pbuf (*not* into a pbuf queue!) and updates + * the checksum while copying + * + * @param p the pbuf to copy data into + * @param start_offset offset of p->payload where to copy the data to + * @param dataptr data to copy into the pbuf + * @param len length of data to copy into the pbuf + * @param chksum pointer to the checksum which is updated + * @return ERR_OK if successful, another error if the data does not fit + * within the (first) pbuf (no pbuf queues!) + */ +err_t +pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr, + u16_t len, u16_t *chksum) +{ + u32_t acc; + u16_t copy_chksum; + char *dst_ptr; + LWIP_ASSERT("p != NULL", p != NULL); + LWIP_ASSERT("dataptr != NULL", dataptr != NULL); + LWIP_ASSERT("chksum != NULL", chksum != NULL); + LWIP_ASSERT("len != 0", len != 0); + + if ((start_offset >= p->len) || (start_offset + len > p->len)) { + return ERR_ARG; + } + + dst_ptr = ((char*)p->payload) + start_offset; + copy_chksum = LWIP_CHKSUM_COPY(dst_ptr, dataptr, len); + if ((start_offset & 1) != 0) { + copy_chksum = SWAP_BYTES_IN_WORD(copy_chksum); + } + acc = *chksum; + acc += copy_chksum; + *chksum = FOLD_U32T(acc); + return ERR_OK; +} +#endif /* LWIP_CHECKSUM_ON_COPY */ + +/** + * @ingroup pbuf + * Get one byte from the specified position in a pbuf + * WARNING: returns zero for offset >= p->tot_len + * + * @param p pbuf to parse + * @param offset offset into p of the byte to return + * @return byte at an offset into p OR ZERO IF 'offset' >= p->tot_len + */ +u8_t +pbuf_get_at(const struct pbuf* p, u16_t offset) +{ + int ret = pbuf_try_get_at(p, offset); + if (ret >= 0) { + return (u8_t)ret; + } + return 0; +} + +/** + * @ingroup pbuf + * Get one byte from the specified position in a pbuf + * + * @param p pbuf to parse + * @param offset offset into p of the byte to return + * @return byte at an offset into p [0..0xFF] OR negative if 'offset' >= p->tot_len + */ +int +pbuf_try_get_at(const struct pbuf* p, u16_t offset) +{ + u16_t q_idx; + const struct pbuf* q = pbuf_skip_const(p, offset, &q_idx); + + /* return requested data if pbuf is OK */ + if ((q != NULL) && (q->len > q_idx)) { + return ((u8_t*)q->payload)[q_idx]; + } + return -1; +} + +/** + * @ingroup pbuf + * Put one byte to the specified position in a pbuf + * WARNING: silently ignores offset >= p->tot_len + * + * @param p pbuf to fill + * @param offset offset into p of the byte to write + * @param data byte to write at an offset into p + */ +void +pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data) +{ + u16_t q_idx; + struct pbuf* q = pbuf_skip(p, offset, &q_idx); + + /* write requested data if pbuf is OK */ + if ((q != NULL) && (q->len > q_idx)) { + ((u8_t*)q->payload)[q_idx] = data; + } +} + +/** + * @ingroup pbuf + * Compare pbuf contents at specified offset with memory s2, both of length n + * + * @param p pbuf to compare + * @param offset offset into p at which to start comparing + * @param s2 buffer to compare + * @param n length of buffer to compare + * @return zero if equal, nonzero otherwise + * (0xffff if p is too short, diffoffset+1 otherwise) + */ +u16_t +pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n) +{ + u16_t start = offset; + const struct pbuf* q = p; + u16_t i; + + /* pbuf long enough to perform check? */ + if(p->tot_len < (offset + n)) { + return 0xffff; + } + + /* get the correct pbuf from chain. We know it succeeds because of p->tot_len check above. */ + while ((q != NULL) && (q->len <= start)) { + start -= q->len; + q = q->next; + } + + /* return requested data if pbuf is OK */ + for (i = 0; i < n; i++) { + /* We know pbuf_get_at() succeeds because of p->tot_len check above. */ + u8_t a = pbuf_get_at(q, start + i); + u8_t b = ((const u8_t*)s2)[i]; + if (a != b) { + return i+1; + } + } + return 0; +} + +/** + * @ingroup pbuf + * Find occurrence of mem (with length mem_len) in pbuf p, starting at offset + * start_offset. + * + * @param p pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as + * return value 'not found' + * @param mem search for the contents of this buffer + * @param mem_len length of 'mem' + * @param start_offset offset into p at which to start searching + * @return 0xFFFF if substr was not found in p or the index where it was found + */ +u16_t +pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset) +{ + u16_t i; + u16_t max = p->tot_len - mem_len; + if (p->tot_len >= mem_len + start_offset) { + for (i = start_offset; i <= max; i++) { + u16_t plus = pbuf_memcmp(p, i, mem, mem_len); + if (plus == 0) { + return i; + } + } + } + return 0xFFFF; +} + +/** + * Find occurrence of substr with length substr_len in pbuf p, start at offset + * start_offset + * WARNING: in contrast to strstr(), this one does not stop at the first \0 in + * the pbuf/source string! + * + * @param p pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as + * return value 'not found' + * @param substr string to search for in p, maximum length is 0xFFFE + * @return 0xFFFF if substr was not found in p or the index where it was found + */ +u16_t +pbuf_strstr(const struct pbuf* p, const char* substr) +{ + size_t substr_len; + if ((substr == NULL) || (substr[0] == 0) || (p->tot_len == 0xFFFF)) { + return 0xFFFF; + } + substr_len = strlen(substr); + if (substr_len >= 0xFFFF) { + return 0xFFFF; + } + return pbuf_memfind(p, substr, (u16_t)substr_len, 0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/raw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/raw.c new file mode 100644 index 0000000..80cf9ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/raw.c @@ -0,0 +1,521 @@ +/** + * @file + * Implementation of raw protocol PCBs for low-level handling of + * different types of protocols besides (or overriding) those + * already available in lwIP.\n + * See also @ref raw_raw + * + * @defgroup raw_raw RAW + * @ingroup callbackstyle_api + * Implementation of raw protocol PCBs for low-level handling of + * different types of protocols besides (or overriding) those + * already available in lwIP.\n + * @see @ref raw_api + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/memp.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/raw.h" +#include "lwip/stats.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/inet_chksum.h" + +#include + +/** The list of RAW PCBs */ +static struct raw_pcb *raw_pcbs; + +static u8_t +raw_input_match(struct raw_pcb *pcb, u8_t broadcast) +{ + LWIP_UNUSED_ARG(broadcast); /* in IPv6 only case */ + +#if LWIP_IPV4 && LWIP_IPV6 + /* Dual-stack: PCBs listening to any IP type also listen to any IP address */ + if (IP_IS_ANY_TYPE_VAL(pcb->local_ip)) { +#if IP_SOF_BROADCAST_RECV + if ((broadcast != 0) && !ip_get_option(pcb, SOF_BROADCAST)) { + return 0; + } +#endif /* IP_SOF_BROADCAST_RECV */ + return 1; + } +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + + /* Only need to check PCB if incoming IP version matches PCB IP version */ + if (IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ip_current_dest_addr())) { +#if LWIP_IPV4 + /* Special case: IPv4 broadcast: receive all broadcasts + * Note: broadcast variable can only be 1 if it is an IPv4 broadcast */ + if (broadcast != 0) { +#if IP_SOF_BROADCAST_RECV + if (ip_get_option(pcb, SOF_BROADCAST)) +#endif /* IP_SOF_BROADCAST_RECV */ + { + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip))) { + return 1; + } + } + } else +#endif /* LWIP_IPV4 */ + /* Handle IPv4 and IPv6: catch all or exact match */ + if (ip_addr_isany(&pcb->local_ip) || + ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + return 1; + } + } + + return 0; +} + +/** + * Determine if in incoming IP packet is covered by a RAW PCB + * and if so, pass it to a user-provided receive callback function. + * + * Given an incoming IP datagram (as a chain of pbufs) this function + * finds a corresponding RAW PCB and calls the corresponding receive + * callback function. + * + * @param p pbuf to be demultiplexed to a RAW PCB. + * @param inp network interface on which the datagram was received. + * @return - 1 if the packet has been eaten by a RAW PCB receive + * callback function. The caller MAY NOT not reference the + * packet any longer, and MAY NOT call pbuf_free(). + * @return - 0 if packet is not eaten (pbuf is still referenced by the + * caller). + * + */ +u8_t +raw_input(struct pbuf *p, struct netif *inp) +{ + struct raw_pcb *pcb, *prev; + s16_t proto; + u8_t eaten = 0; + u8_t broadcast = ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()); + + LWIP_UNUSED_ARG(inp); + +#if LWIP_IPV6 +#if LWIP_IPV4 + if (IP_HDR_GET_VERSION(p->payload) == 6) +#endif /* LWIP_IPV4 */ + { + struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload; + proto = IP6H_NEXTH(ip6hdr); + } +#if LWIP_IPV4 + else +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + { + proto = IPH_PROTO((struct ip_hdr *)p->payload); + } +#endif /* LWIP_IPV4 */ + + prev = NULL; + pcb = raw_pcbs; + /* loop through all raw pcbs until the packet is eaten by one */ + /* this allows multiple pcbs to match against the packet by design */ + while ((eaten == 0) && (pcb != NULL)) { + if ((pcb->protocol == proto) && raw_input_match(pcb, broadcast)) { + /* receive callback function available? */ + if (pcb->recv != NULL) { +#ifndef LWIP_NOASSERT + void* old_payload = p->payload; +#endif + /* the receive callback function did not eat the packet? */ + eaten = pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr()); + if (eaten != 0) { + /* receive function ate the packet */ + p = NULL; + eaten = 1; + if (prev != NULL) { + /* move the pcb to the front of raw_pcbs so that is + found faster next time */ + prev->next = pcb->next; + pcb->next = raw_pcbs; + raw_pcbs = pcb; + } + } else { + /* sanity-check that the receive callback did not alter the pbuf */ + LWIP_ASSERT("raw pcb recv callback altered pbuf payload pointer without eating packet", + p->payload == old_payload); + } + } + /* no receive callback function was set for this raw PCB */ + } + /* drop the packet */ + prev = pcb; + pcb = pcb->next; + } + return eaten; +} + +/** + * @ingroup raw_raw + * Bind a RAW PCB. + * + * @param pcb RAW PCB to be bound with a local address ipaddr. + * @param ipaddr local IP address to bind with. Use IP4_ADDR_ANY to + * bind to all local interfaces. + * + * @return lwIP error code. + * - ERR_OK. Successful. No error occurred. + * - ERR_USE. The specified IP address is already bound to by + * another RAW PCB. + * + * @see raw_disconnect() + */ +err_t +raw_bind(struct raw_pcb *pcb, const ip_addr_t *ipaddr) +{ + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + ip_addr_set_ipaddr(&pcb->local_ip, ipaddr); + return ERR_OK; +} + +/** + * @ingroup raw_raw + * Connect an RAW PCB. This function is required by upper layers + * of lwip. Using the raw api you could use raw_sendto() instead + * + * This will associate the RAW PCB with the remote address. + * + * @param pcb RAW PCB to be connected with remote address ipaddr and port. + * @param ipaddr remote IP address to connect with. + * + * @return lwIP error code + * + * @see raw_disconnect() and raw_sendto() + */ +err_t +raw_connect(struct raw_pcb *pcb, const ip_addr_t *ipaddr) +{ + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr); + return ERR_OK; +} + +/** + * @ingroup raw_raw + * Set the callback function for received packets that match the + * raw PCB's protocol and binding. + * + * The callback function MUST either + * - eat the packet by calling pbuf_free() and returning non-zero. The + * packet will not be passed to other raw PCBs or other protocol layers. + * - not free the packet, and return zero. The packet will be matched + * against further PCBs and/or forwarded to another protocol layers. + */ +void +raw_recv(struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg) +{ + /* remember recv() callback and user data */ + pcb->recv = recv; + pcb->recv_arg = recv_arg; +} + +/** + * @ingroup raw_raw + * Send the raw IP packet to the given address. Note that actually you cannot + * modify the IP headers (this is inconsistent with the receive callback where + * you actually get the IP headers), you can only specify the IP payload here. + * It requires some more changes in lwIP. (there will be a raw_send() function + * then.) + * + * @param pcb the raw pcb which to send + * @param p the IP payload to send + * @param ipaddr the destination address of the IP packet + * + */ +err_t +raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr) +{ + err_t err; + struct netif *netif; + const ip_addr_t *src_ip; + struct pbuf *q; /* q will be sent down the stack */ + s16_t header_size; + + if ((pcb == NULL) || (ipaddr == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr)) { + return ERR_VAL; + } + + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n")); + + header_size = ( +#if LWIP_IPV4 && LWIP_IPV6 + IP_IS_V6(ipaddr) ? IP6_HLEN : IP_HLEN); +#elif LWIP_IPV4 + IP_HLEN); +#else + IP6_HLEN); +#endif + + /* not enough space to add an IP header to first pbuf in given p chain? */ + if (pbuf_header(p, header_size)) { + /* allocate header in new pbuf */ + q = pbuf_alloc(PBUF_IP, 0, PBUF_RAM); + /* new header pbuf could not be allocated? */ + if (q == NULL) { + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("raw_sendto: could not allocate header\n")); + return ERR_MEM; + } + if (p->tot_len != 0) { + /* chain header q in front of given pbuf p */ + pbuf_chain(q, p); + } + /* { first pbuf q points to header pbuf } */ + LWIP_DEBUGF(RAW_DEBUG, ("raw_sendto: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p)); + } else { + /* first pbuf q equals given pbuf */ + q = p; + if (pbuf_header(q, -header_size)) { + LWIP_ASSERT("Can't restore header we just removed!", 0); + return ERR_MEM; + } + } + + if(IP_IS_ANY_TYPE_VAL(pcb->local_ip)) { + /* Don't call ip_route() with IP_ANY_TYPE */ + netif = ip_route(IP46_ADDR_ANY(IP_GET_TYPE(ipaddr)), ipaddr); + } else { + netif = ip_route(&pcb->local_ip, ipaddr); + } + + if (netif == NULL) { + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: No route to ")); + ip_addr_debug_print(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ipaddr); + /* free any temporary header pbuf allocated by pbuf_header() */ + if (q != p) { + pbuf_free(q); + } + return ERR_RTE; + } + +#if IP_SOF_BROADCAST + if (IP_IS_V4(ipaddr)) + { + /* broadcast filter? */ + if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(ipaddr, netif)) { + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb)); + /* free any temporary header pbuf allocated by pbuf_header() */ + if (q != p) { + pbuf_free(q); + } + return ERR_VAL; + } + } +#endif /* IP_SOF_BROADCAST */ + + if (ip_addr_isany(&pcb->local_ip)) { + /* use outgoing network interface IP address as source address */ + src_ip = ip_netif_get_local_ip(netif, ipaddr); +#if LWIP_IPV6 + if (src_ip == NULL) { + if (q != p) { + pbuf_free(q); + } + return ERR_RTE; + } +#endif /* LWIP_IPV6 */ + } else { + /* use RAW PCB local IP address as source address */ + src_ip = &pcb->local_ip; + } + +#if LWIP_IPV6 + /* If requested, based on the IPV6_CHECKSUM socket option per RFC3542, + compute the checksum and update the checksum in the payload. */ + if (IP_IS_V6(ipaddr) && pcb->chksum_reqd) { + u16_t chksum = ip6_chksum_pseudo(p, pcb->protocol, p->tot_len, ip_2_ip6(src_ip), ip_2_ip6(ipaddr)); + LWIP_ASSERT("Checksum must fit into first pbuf", p->len >= (pcb->chksum_offset + 2)); + SMEMCPY(((u8_t *)p->payload) + pcb->chksum_offset, &chksum, sizeof(u16_t)); + } +#endif + + NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint); + err = ip_output_if(q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + + /* did we chain a header earlier? */ + if (q != p) { + /* free the header */ + pbuf_free(q); + } + return err; +} + +/** + * @ingroup raw_raw + * Send the raw IP packet to the address given by raw_connect() + * + * @param pcb the raw pcb which to send + * @param p the IP payload to send + * + */ +err_t +raw_send(struct raw_pcb *pcb, struct pbuf *p) +{ + return raw_sendto(pcb, p, &pcb->remote_ip); +} + +/** + * @ingroup raw_raw + * Remove an RAW PCB. + * + * @param pcb RAW PCB to be removed. The PCB is removed from the list of + * RAW PCB's and the data structure is freed from memory. + * + * @see raw_new() + */ +void +raw_remove(struct raw_pcb *pcb) +{ + struct raw_pcb *pcb2; + /* pcb to be removed is first in list? */ + if (raw_pcbs == pcb) { + /* make list start at 2nd pcb */ + raw_pcbs = raw_pcbs->next; + /* pcb not 1st in list */ + } else { + for (pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) { + /* find pcb in raw_pcbs list */ + if (pcb2->next != NULL && pcb2->next == pcb) { + /* remove pcb from list */ + pcb2->next = pcb->next; + break; + } + } + } + memp_free(MEMP_RAW_PCB, pcb); +} + +/** + * @ingroup raw_raw + * Create a RAW PCB. + * + * @return The RAW PCB which was created. NULL if the PCB data structure + * could not be allocated. + * + * @param proto the protocol number of the IPs payload (e.g. IP_PROTO_ICMP) + * + * @see raw_remove() + */ +struct raw_pcb * +raw_new(u8_t proto) +{ + struct raw_pcb *pcb; + + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_new\n")); + + pcb = (struct raw_pcb *)memp_malloc(MEMP_RAW_PCB); + /* could allocate RAW PCB? */ + if (pcb != NULL) { + /* initialize PCB to all zeroes */ + memset(pcb, 0, sizeof(struct raw_pcb)); + pcb->protocol = proto; + pcb->ttl = RAW_TTL; + pcb->next = raw_pcbs; + raw_pcbs = pcb; + } + return pcb; +} + +/** + * @ingroup raw_raw + * Create a RAW PCB for specific IP type. + * + * @return The RAW PCB which was created. NULL if the PCB data structure + * could not be allocated. + * + * @param type IP address type, see @ref lwip_ip_addr_type definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) packets, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. + * @param proto the protocol number (next header) of the IPv6 packet payload + * (e.g. IP6_NEXTH_ICMP6) + * + * @see raw_remove() + */ +struct raw_pcb * +raw_new_ip_type(u8_t type, u8_t proto) +{ + struct raw_pcb *pcb; + pcb = raw_new(proto); +#if LWIP_IPV4 && LWIP_IPV6 + if (pcb != NULL) { + IP_SET_TYPE_VAL(pcb->local_ip, type); + IP_SET_TYPE_VAL(pcb->remote_ip, type); + } +#else /* LWIP_IPV4 && LWIP_IPV6 */ + LWIP_UNUSED_ARG(type); +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + return pcb; +} + +/** This function is called from netif.c when address is changed + * + * @param old_addr IP address of the netif before change + * @param new_addr IP address of the netif after change + */ +void raw_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr) +{ + struct raw_pcb* rpcb; + + if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) { + for (rpcb = raw_pcbs; rpcb != NULL; rpcb = rpcb->next) { + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&rpcb->local_ip, old_addr)) { + /* The PCB is bound to the old ipaddr and + * is set to bound to the new one instead */ + ip_addr_copy(rpcb->local_ip, *new_addr); + } + } + } +} + +#endif /* LWIP_RAW */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/stats.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/stats.c new file mode 100644 index 0000000..893d199 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/stats.c @@ -0,0 +1,169 @@ +/** + * @file + * Statistics module + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_STATS /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/stats.h" +#include "lwip/mem.h" +#include "lwip/debug.h" + +#include + +struct stats_ lwip_stats; + +void +stats_init(void) +{ +#ifdef LWIP_DEBUG +#if MEM_STATS + lwip_stats.mem.name = "MEM"; +#endif /* MEM_STATS */ +#endif /* LWIP_DEBUG */ +} + +#if LWIP_STATS_DISPLAY +void +stats_display_proto(struct stats_proto *proto, const char *name) +{ + LWIP_PLATFORM_DIAG(("\n%s\n\t", name)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); + LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); + LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); + LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); + LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); + LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); +} + +#if IGMP_STATS || MLD6_STATS +void +stats_display_igmp(struct stats_igmp *igmp, const char *name) +{ + LWIP_PLATFORM_DIAG(("\n%s\n\t", name)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", igmp->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", igmp->recv)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", igmp->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", igmp->memerr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", igmp->proterr)); + LWIP_PLATFORM_DIAG(("rx_v1: %"STAT_COUNTER_F"\n\t", igmp->rx_v1)); + LWIP_PLATFORM_DIAG(("rx_group: %"STAT_COUNTER_F"\n\t", igmp->rx_group)); + LWIP_PLATFORM_DIAG(("rx_general: %"STAT_COUNTER_F"\n\t", igmp->rx_general)); + LWIP_PLATFORM_DIAG(("rx_report: %"STAT_COUNTER_F"\n\t", igmp->rx_report)); + LWIP_PLATFORM_DIAG(("tx_join: %"STAT_COUNTER_F"\n\t", igmp->tx_join)); + LWIP_PLATFORM_DIAG(("tx_leave: %"STAT_COUNTER_F"\n\t", igmp->tx_leave)); + LWIP_PLATFORM_DIAG(("tx_report: %"STAT_COUNTER_F"\n", igmp->tx_report)); +} +#endif /* IGMP_STATS || MLD6_STATS */ + +#if MEM_STATS || MEMP_STATS +void +stats_display_mem(struct stats_mem *mem, const char *name) +{ + LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name)); + LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); + LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); + LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); + LWIP_PLATFORM_DIAG(("err: %"U32_F"\n", (u32_t)mem->err)); +} + +#if MEMP_STATS +void +stats_display_memp(struct stats_mem *mem, int index) +{ + if (index < MEMP_MAX) { + stats_display_mem(mem, mem->name); + } +} +#endif /* MEMP_STATS */ +#endif /* MEM_STATS || MEMP_STATS */ + +#if SYS_STATS +void +stats_display_sys(struct stats_sys *sys) +{ + LWIP_PLATFORM_DIAG(("\nSYS\n\t")); + LWIP_PLATFORM_DIAG(("sem.used: %"U32_F"\n\t", (u32_t)sys->sem.used)); + LWIP_PLATFORM_DIAG(("sem.max: %"U32_F"\n\t", (u32_t)sys->sem.max)); + LWIP_PLATFORM_DIAG(("sem.err: %"U32_F"\n\t", (u32_t)sys->sem.err)); + LWIP_PLATFORM_DIAG(("mutex.used: %"U32_F"\n\t", (u32_t)sys->mutex.used)); + LWIP_PLATFORM_DIAG(("mutex.max: %"U32_F"\n\t", (u32_t)sys->mutex.max)); + LWIP_PLATFORM_DIAG(("mutex.err: %"U32_F"\n\t", (u32_t)sys->mutex.err)); + LWIP_PLATFORM_DIAG(("mbox.used: %"U32_F"\n\t", (u32_t)sys->mbox.used)); + LWIP_PLATFORM_DIAG(("mbox.max: %"U32_F"\n\t", (u32_t)sys->mbox.max)); + LWIP_PLATFORM_DIAG(("mbox.err: %"U32_F"\n", (u32_t)sys->mbox.err)); +} +#endif /* SYS_STATS */ + +void +stats_display(void) +{ + s16_t i; + + LINK_STATS_DISPLAY(); + ETHARP_STATS_DISPLAY(); + IPFRAG_STATS_DISPLAY(); + IP6_FRAG_STATS_DISPLAY(); + IP_STATS_DISPLAY(); + ND6_STATS_DISPLAY(); + IP6_STATS_DISPLAY(); + IGMP_STATS_DISPLAY(); + MLD6_STATS_DISPLAY(); + ICMP_STATS_DISPLAY(); + ICMP6_STATS_DISPLAY(); + UDP_STATS_DISPLAY(); + TCP_STATS_DISPLAY(); + MEM_STATS_DISPLAY(); + for (i = 0; i < MEMP_MAX; i++) { + MEMP_STATS_DISPLAY(i); + } + SYS_STATS_DISPLAY(); +} +#endif /* LWIP_STATS_DISPLAY */ + +#endif /* LWIP_STATS */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/sys.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/sys.c new file mode 100644 index 0000000..7059b4d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/sys.c @@ -0,0 +1,106 @@ +/** + * @file + * lwIP Operating System abstraction + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +/** + * @defgroup sys_layer Porting (system abstraction layer) + * @ingroup lwip + * @verbinclude "sys_arch.txt" + * + * @defgroup sys_os OS abstraction layer + * @ingroup sys_layer + * No need to implement functions in this section in NO_SYS mode. + * + * @defgroup sys_sem Semaphores + * @ingroup sys_os + * + * @defgroup sys_mutex Mutexes + * @ingroup sys_os + * Mutexes are recommended to correctly handle priority inversion, + * especially if you use LWIP_CORE_LOCKING . + * + * @defgroup sys_mbox Mailboxes + * @ingroup sys_os + * + * @defgroup sys_time Time + * @ingroup sys_layer + * + * @defgroup sys_prot Critical sections + * @ingroup sys_layer + * Used to protect short regions of code against concurrent access. + * - Your system is a bare-metal system (probably with an RTOS) + * and interrupts are under your control: + * Implement this as LockInterrupts() / UnlockInterrupts() + * - Your system uses an RTOS with deferred interrupt handling from a + * worker thread: Implement as a global mutex or lock/unlock scheduler + * - Your system uses a high-level OS with e.g. POSIX signals: + * Implement as a global mutex + * + * @defgroup sys_misc Misc + * @ingroup sys_os + */ + +#include "lwip/opt.h" + +#include "lwip/sys.h" + +/* Most of the functions defined in sys.h must be implemented in the + * architecture-dependent file sys_arch.c */ + +#if !NO_SYS + +#ifndef sys_msleep +/** + * Sleep for some ms. Timeouts are NOT processed while sleeping. + * + * @param ms number of milliseconds to sleep + */ +void +sys_msleep(u32_t ms) +{ + if (ms > 0) { + sys_sem_t delaysem; + err_t err = sys_sem_new(&delaysem, 0); + if (err == ERR_OK) { + sys_arch_sem_wait(&delaysem, ms); + sys_sem_free(&delaysem); + } + } +} +#endif /* sys_msleep */ + +#endif /* !NO_SYS */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp.c new file mode 100644 index 0000000..ec2e1f9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp.c @@ -0,0 +1,2164 @@ +/** + * @file + * Transmission Control Protocol for IP + * See also @ref tcp_raw + * + * @defgroup tcp_raw TCP + * @ingroup callbackstyle_api + * Transmission Control Protocol for IP\n + * @see @ref raw_api and @ref netconn + * + * Common functions for the TCP implementation, such as functinos + * for manipulating the data structures and the TCP timer functions. TCP functions + * related to input and output is found in tcp_in.c and tcp_out.c respectively.\n + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/tcp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/debug.h" +#include "lwip/stats.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/nd6.h" + +#include + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +#ifndef TCP_LOCAL_PORT_RANGE_START +/* From http://www.iana.org/assignments/port-numbers: + "The Dynamic and/or Private Ports are those from 49152 through 65535" */ +#define TCP_LOCAL_PORT_RANGE_START 0xc000 +#define TCP_LOCAL_PORT_RANGE_END 0xffff +#define TCP_ENSURE_LOCAL_PORT_RANGE(port) ((u16_t)(((port) & ~TCP_LOCAL_PORT_RANGE_START) + TCP_LOCAL_PORT_RANGE_START)) +#endif + +#if LWIP_TCP_KEEPALIVE +#define TCP_KEEP_DUR(pcb) ((pcb)->keep_cnt * (pcb)->keep_intvl) +#define TCP_KEEP_INTVL(pcb) ((pcb)->keep_intvl) +#else /* LWIP_TCP_KEEPALIVE */ +#define TCP_KEEP_DUR(pcb) TCP_MAXIDLE +#define TCP_KEEP_INTVL(pcb) TCP_KEEPINTVL_DEFAULT +#endif /* LWIP_TCP_KEEPALIVE */ + +/* As initial send MSS, we use TCP_MSS but limit it to 536. */ +#if TCP_MSS > 536 +#define INITIAL_MSS 536 +#else +#define INITIAL_MSS TCP_MSS +#endif + +static const char * const tcp_state_str[] = { + "CLOSED", + "LISTEN", + "SYN_SENT", + "SYN_RCVD", + "ESTABLISHED", + "FIN_WAIT_1", + "FIN_WAIT_2", + "CLOSE_WAIT", + "CLOSING", + "LAST_ACK", + "TIME_WAIT" +}; + +/* last local TCP port */ +static u16_t tcp_port = TCP_LOCAL_PORT_RANGE_START; + +/* Incremented every coarse grained timer shot (typically every 500 ms). */ +u32_t tcp_ticks; +static const u8_t tcp_backoff[13] = + { 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7}; + /* Times per slowtmr hits */ +static const u8_t tcp_persist_backoff[7] = { 3, 6, 12, 24, 48, 96, 120 }; + +/* The TCP PCB lists. */ + +/** List of all TCP PCBs bound but not yet (connected || listening) */ +struct tcp_pcb *tcp_bound_pcbs; +/** List of all TCP PCBs in LISTEN state */ +union tcp_listen_pcbs_t tcp_listen_pcbs; +/** List of all TCP PCBs that are in a state in which + * they accept or send data. */ +struct tcp_pcb *tcp_active_pcbs; +/** List of all TCP PCBs in TIME-WAIT state */ +struct tcp_pcb *tcp_tw_pcbs; + +/** An array with all (non-temporary) PCB lists, mainly used for smaller code size */ +struct tcp_pcb ** const tcp_pcb_lists[] = {&tcp_listen_pcbs.pcbs, &tcp_bound_pcbs, + &tcp_active_pcbs, &tcp_tw_pcbs}; + +u8_t tcp_active_pcbs_changed; + +/** Timer counter to handle calling slow-timer from tcp_tmr() */ +static u8_t tcp_timer; +static u8_t tcp_timer_ctr; +static u16_t tcp_new_port(void); + +static err_t tcp_close_shutdown_fin(struct tcp_pcb *pcb); + +/** + * Initialize this module. + */ +void +tcp_init(void) +{ +#if LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) + tcp_port = TCP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); +#endif /* LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) */ +} + +/** + * Called periodically to dispatch TCP timers. + */ +void +tcp_tmr(void) +{ + /* Call tcp_fasttmr() every 250 ms */ + tcp_fasttmr(); + + if (++tcp_timer & 1) { + /* Call tcp_slowtmr() every 500 ms, i.e., every other timer + tcp_tmr() is called. */ + tcp_slowtmr(); + } +} + +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG +/** Called when a listen pcb is closed. Iterates one pcb list and removes the + * closed listener pcb from pcb->listener if matching. + */ +static void +tcp_remove_listener(struct tcp_pcb *list, struct tcp_pcb_listen *lpcb) +{ + struct tcp_pcb *pcb; + for (pcb = list; pcb != NULL; pcb = pcb->next) { + if (pcb->listener == lpcb) { + pcb->listener = NULL; + } + } +} +#endif + +/** Called when a listen pcb is closed. Iterates all pcb lists and removes the + * closed listener pcb from pcb->listener if matching. + */ +static void +tcp_listen_closed(struct tcp_pcb *pcb) +{ +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG + size_t i; + LWIP_ASSERT("pcb != NULL", pcb != NULL); + LWIP_ASSERT("pcb->state == LISTEN", pcb->state == LISTEN); + for (i = 1; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) { + tcp_remove_listener(*tcp_pcb_lists[i], (struct tcp_pcb_listen*)pcb); + } +#endif + LWIP_UNUSED_ARG(pcb); +} + +#if TCP_LISTEN_BACKLOG +/** @ingroup tcp_raw + * Delay accepting a connection in respect to the listen backlog: + * the number of outstanding connections is increased until + * tcp_backlog_accepted() is called. + * + * ATTENTION: the caller is responsible for calling tcp_backlog_accepted() + * or else the backlog feature will get out of sync! + * + * @param pcb the connection pcb which is not fully accepted yet + */ +void +tcp_backlog_delayed(struct tcp_pcb* pcb) +{ + LWIP_ASSERT("pcb != NULL", pcb != NULL); + if ((pcb->flags & TF_BACKLOGPEND) == 0) { + if (pcb->listener != NULL) { + pcb->listener->accepts_pending++; + LWIP_ASSERT("accepts_pending != 0", pcb->listener->accepts_pending != 0); + pcb->flags |= TF_BACKLOGPEND; + } + } +} + +/** @ingroup tcp_raw + * A delayed-accept a connection is accepted (or closed/aborted): decreases + * the number of outstanding connections after calling tcp_backlog_delayed(). + * + * ATTENTION: the caller is responsible for calling tcp_backlog_accepted() + * or else the backlog feature will get out of sync! + * + * @param pcb the connection pcb which is now fully accepted (or closed/aborted) + */ +void +tcp_backlog_accepted(struct tcp_pcb* pcb) +{ + LWIP_ASSERT("pcb != NULL", pcb != NULL); + if ((pcb->flags & TF_BACKLOGPEND) != 0) { + if (pcb->listener != NULL) { + LWIP_ASSERT("accepts_pending != 0", pcb->listener->accepts_pending != 0); + pcb->listener->accepts_pending--; + pcb->flags &= ~TF_BACKLOGPEND; + } + } +} +#endif /* TCP_LISTEN_BACKLOG */ + +/** + * Closes the TX side of a connection held by the PCB. + * For tcp_close(), a RST is sent if the application didn't receive all data + * (tcp_recved() not called for all data passed to recv callback). + * + * Listening pcbs are freed and may not be referenced any more. + * Connection pcbs are freed if not yet connected and may not be referenced + * any more. If a connection is established (at least SYN received or in + * a closing state), the connection is closed, and put in a closing state. + * The pcb is then automatically freed in tcp_slowtmr(). It is therefore + * unsafe to reference it. + * + * @param pcb the tcp_pcb to close + * @return ERR_OK if connection has been closed + * another err_t if closing failed and pcb is not freed + */ +static err_t +tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data) +{ + if (rst_on_unacked_data && ((pcb->state == ESTABLISHED) || (pcb->state == CLOSE_WAIT))) { + if ((pcb->refused_data != NULL) || (pcb->rcv_wnd != TCP_WND_MAX(pcb))) { + /* Not all data received by application, send RST to tell the remote + side about this. */ + LWIP_ASSERT("pcb->flags & TF_RXCLOSED", pcb->flags & TF_RXCLOSED); + + /* don't call tcp_abort here: we must not deallocate the pcb since + that might not be expected when calling tcp_close */ + tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip, + pcb->local_port, pcb->remote_port); + + tcp_pcb_purge(pcb); + TCP_RMV_ACTIVE(pcb); + if (pcb->state == ESTABLISHED) { + /* move to TIME_WAIT since we close actively */ + pcb->state = TIME_WAIT; + TCP_REG(&tcp_tw_pcbs, pcb); + } else { + /* CLOSE_WAIT: deallocate the pcb since we already sent a RST for it */ + if (tcp_input_pcb == pcb) { + /* prevent using a deallocated pcb: free it from tcp_input later */ + tcp_trigger_input_pcb_close(); + } else { + memp_free(MEMP_TCP_PCB, pcb); + } + } + return ERR_OK; + } + } + + /* - states which free the pcb are handled here, + - states which send FIN and change state are handled in tcp_close_shutdown_fin() */ + switch (pcb->state) { + case CLOSED: + /* Closing a pcb in the CLOSED state might seem erroneous, + * however, it is in this state once allocated and as yet unused + * and the user needs some way to free it should the need arise. + * Calling tcp_close() with a pcb that has already been closed, (i.e. twice) + * or for a pcb that has been used and then entered the CLOSED state + * is erroneous, but this should never happen as the pcb has in those cases + * been freed, and so any remaining handles are bogus. */ + if (pcb->local_port != 0) { + TCP_RMV(&tcp_bound_pcbs, pcb); + } + memp_free(MEMP_TCP_PCB, pcb); + break; + case LISTEN: + tcp_listen_closed(pcb); + tcp_pcb_remove(&tcp_listen_pcbs.pcbs, pcb); + memp_free(MEMP_TCP_PCB_LISTEN, pcb); + break; + case SYN_SENT: + TCP_PCB_REMOVE_ACTIVE(pcb); + memp_free(MEMP_TCP_PCB, pcb); + MIB2_STATS_INC(mib2.tcpattemptfails); + break; + default: + return tcp_close_shutdown_fin(pcb); + } + return ERR_OK; +} + +static err_t +tcp_close_shutdown_fin(struct tcp_pcb *pcb) +{ + err_t err; + LWIP_ASSERT("pcb != NULL", pcb != NULL); + + switch (pcb->state) { + case SYN_RCVD: + err = tcp_send_fin(pcb); + if (err == ERR_OK) { + tcp_backlog_accepted(pcb); + MIB2_STATS_INC(mib2.tcpattemptfails); + pcb->state = FIN_WAIT_1; + } + break; + case ESTABLISHED: + err = tcp_send_fin(pcb); + if (err == ERR_OK) { + MIB2_STATS_INC(mib2.tcpestabresets); + pcb->state = FIN_WAIT_1; + } + break; + case CLOSE_WAIT: + err = tcp_send_fin(pcb); + if (err == ERR_OK) { + MIB2_STATS_INC(mib2.tcpestabresets); + pcb->state = LAST_ACK; + } + break; + default: + /* Has already been closed, do nothing. */ + return ERR_OK; + break; + } + + if (err == ERR_OK) { + /* To ensure all data has been sent when tcp_close returns, we have + to make sure tcp_output doesn't fail. + Since we don't really have to ensure all data has been sent when tcp_close + returns (unsent data is sent from tcp timer functions, also), we don't care + for the return value of tcp_output for now. */ + tcp_output(pcb); + } else if (err == ERR_MEM) { + /* Mark this pcb for closing. Closing is retried from tcp_tmr. */ + pcb->flags |= TF_CLOSEPEND; + } + return err; +} + +/** + * @ingroup tcp_raw + * Closes the connection held by the PCB. + * + * Listening pcbs are freed and may not be referenced any more. + * Connection pcbs are freed if not yet connected and may not be referenced + * any more. If a connection is established (at least SYN received or in + * a closing state), the connection is closed, and put in a closing state. + * The pcb is then automatically freed in tcp_slowtmr(). It is therefore + * unsafe to reference it (unless an error is returned). + * + * @param pcb the tcp_pcb to close + * @return ERR_OK if connection has been closed + * another err_t if closing failed and pcb is not freed + */ +err_t +tcp_close(struct tcp_pcb *pcb) +{ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in ")); + tcp_debug_print_state(pcb->state); + + if (pcb->state != LISTEN) { + /* Set a flag not to receive any more data... */ + pcb->flags |= TF_RXCLOSED; + } + /* ... and close */ + return tcp_close_shutdown(pcb, 1); +} + +/** + * @ingroup tcp_raw + * Causes all or part of a full-duplex connection of this PCB to be shut down. + * This doesn't deallocate the PCB unless shutting down both sides! + * Shutting down both sides is the same as calling tcp_close, so if it succeds, + * the PCB should not be referenced any more. + * + * @param pcb PCB to shutdown + * @param shut_rx shut down receive side if this is != 0 + * @param shut_tx shut down send side if this is != 0 + * @return ERR_OK if shutdown succeeded (or the PCB has already been shut down) + * another err_t on error. + */ +err_t +tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx) +{ + if (pcb->state == LISTEN) { + return ERR_CONN; + } + if (shut_rx) { + /* shut down the receive side: set a flag not to receive any more data... */ + pcb->flags |= TF_RXCLOSED; + if (shut_tx) { + /* shutting down the tx AND rx side is the same as closing for the raw API */ + return tcp_close_shutdown(pcb, 1); + } + /* ... and free buffered data */ + if (pcb->refused_data != NULL) { + pbuf_free(pcb->refused_data); + pcb->refused_data = NULL; + } + } + if (shut_tx) { + /* This can't happen twice since if it succeeds, the pcb's state is changed. + Only close in these states as the others directly deallocate the PCB */ + switch (pcb->state) { + case SYN_RCVD: + case ESTABLISHED: + case CLOSE_WAIT: + return tcp_close_shutdown(pcb, (u8_t)shut_rx); + default: + /* Not (yet?) connected, cannot shutdown the TX side as that would bring us + into CLOSED state, where the PCB is deallocated. */ + return ERR_CONN; + } + } + return ERR_OK; +} + +/** + * Abandons a connection and optionally sends a RST to the remote + * host. Deletes the local protocol control block. This is done when + * a connection is killed because of shortage of memory. + * + * @param pcb the tcp_pcb to abort + * @param reset boolean to indicate whether a reset should be sent + */ +void +tcp_abandon(struct tcp_pcb *pcb, int reset) +{ + u32_t seqno, ackno; +#if LWIP_CALLBACK_API + tcp_err_fn errf; +#endif /* LWIP_CALLBACK_API */ + void *errf_arg; + + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_abort/tcp_abandon for listen-pcbs", + pcb->state != LISTEN); + /* Figure out on which TCP PCB list we are, and remove us. If we + are in an active state, call the receive function associated with + the PCB with a NULL argument, and send an RST to the remote end. */ + if (pcb->state == TIME_WAIT) { + tcp_pcb_remove(&tcp_tw_pcbs, pcb); + memp_free(MEMP_TCP_PCB, pcb); + } else { + int send_rst = 0; + u16_t local_port = 0; + enum tcp_state last_state; + seqno = pcb->snd_nxt; + ackno = pcb->rcv_nxt; +#if LWIP_CALLBACK_API + errf = pcb->errf; +#endif /* LWIP_CALLBACK_API */ + errf_arg = pcb->callback_arg; + if (pcb->state == CLOSED) { + if (pcb->local_port != 0) { + /* bound, not yet opened */ + TCP_RMV(&tcp_bound_pcbs, pcb); + } + } else { + send_rst = reset; + local_port = pcb->local_port; + TCP_PCB_REMOVE_ACTIVE(pcb); + } + if (pcb->unacked != NULL) { + tcp_segs_free(pcb->unacked); + } + if (pcb->unsent != NULL) { + tcp_segs_free(pcb->unsent); + } +#if TCP_QUEUE_OOSEQ + if (pcb->ooseq != NULL) { + tcp_segs_free(pcb->ooseq); + } +#endif /* TCP_QUEUE_OOSEQ */ + tcp_backlog_accepted(pcb); + if (send_rst) { + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_abandon: sending RST\n")); + tcp_rst(seqno, ackno, &pcb->local_ip, &pcb->remote_ip, local_port, pcb->remote_port); + } + last_state = pcb->state; + memp_free(MEMP_TCP_PCB, pcb); + TCP_EVENT_ERR(last_state, errf, errf_arg, ERR_ABRT); + } +} + +/** + * @ingroup tcp_raw + * Aborts the connection by sending a RST (reset) segment to the remote + * host. The pcb is deallocated. This function never fails. + * + * ATTENTION: When calling this from one of the TCP callbacks, make + * sure you always return ERR_ABRT (and never return ERR_ABRT otherwise + * or you will risk accessing deallocated memory or memory leaks! + * + * @param pcb the tcp pcb to abort + */ +void +tcp_abort(struct tcp_pcb *pcb) +{ + tcp_abandon(pcb, 1); +} + +/** + * @ingroup tcp_raw + * Binds the connection to a local port number and IP address. If the + * IP address is not given (i.e., ipaddr == NULL), the IP address of + * the outgoing network interface is used instead. + * + * @param pcb the tcp_pcb to bind (no check is done whether this pcb is + * already bound!) + * @param ipaddr the local ip address to bind to (use IP4_ADDR_ANY to bind + * to any local address + * @param port the local port to bind to + * @return ERR_USE if the port is already in use + * ERR_VAL if bind failed because the PCB is not in a valid state + * ERR_OK if bound + */ +err_t +tcp_bind(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) +{ + int i; + int max_pcb_list = NUM_TCP_PCB_LISTS; + struct tcp_pcb *cpcb; + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IPv4 ANY) to subsequent functions */ + if (ipaddr == NULL) { + ipaddr = IP4_ADDR_ANY; + } +#endif /* LWIP_IPV4 */ + + /* still need to check for ipaddr == NULL in IPv6 only case */ + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + + LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL); + +#if SO_REUSE + /* Unless the REUSEADDR flag is set, + we have to check the pcbs in TIME-WAIT state, also. + We do not dump TIME_WAIT pcb's; they can still be matched by incoming + packets using both local and remote IP addresses and ports to distinguish. + */ + if (ip_get_option(pcb, SOF_REUSEADDR)) { + max_pcb_list = NUM_TCP_PCB_LISTS_NO_TIME_WAIT; + } +#endif /* SO_REUSE */ + + if (port == 0) { + port = tcp_new_port(); + if (port == 0) { + return ERR_BUF; + } + } else { + /* Check if the address already is in use (on all lists) */ + for (i = 0; i < max_pcb_list; i++) { + for (cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) { + if (cpcb->local_port == port) { +#if SO_REUSE + /* Omit checking for the same port if both pcbs have REUSEADDR set. + For SO_REUSEADDR, the duplicate-check for a 5-tuple is done in + tcp_connect. */ + if (!ip_get_option(pcb, SOF_REUSEADDR) || + !ip_get_option(cpcb, SOF_REUSEADDR)) +#endif /* SO_REUSE */ + { + /* @todo: check accept_any_ip_version */ + if ((IP_IS_V6(ipaddr) == IP_IS_V6_VAL(cpcb->local_ip)) && + (ip_addr_isany(&cpcb->local_ip) || + ip_addr_isany(ipaddr) || + ip_addr_cmp(&cpcb->local_ip, ipaddr))) { + return ERR_USE; + } + } + } + } + } + } + + if (!ip_addr_isany(ipaddr)) { + ip_addr_set(&pcb->local_ip, ipaddr); + } + pcb->local_port = port; + TCP_REG(&tcp_bound_pcbs, pcb); + LWIP_DEBUGF(TCP_DEBUG, ("tcp_bind: bind to port %"U16_F"\n", port)); + return ERR_OK; +} +#if LWIP_CALLBACK_API +/** + * Default accept callback if no accept callback is specified by the user. + */ +static err_t +tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) +{ + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(err); + + tcp_abort(pcb); + + return ERR_ABRT; +} +#endif /* LWIP_CALLBACK_API */ + +/** + * @ingroup tcp_raw + * Set the state of the connection to be LISTEN, which means that it + * is able to accept incoming connections. The protocol control block + * is reallocated in order to consume less memory. Setting the + * connection to LISTEN is an irreversible process. + * + * @param pcb the original tcp_pcb + * @param backlog the incoming connections queue limit + * @return tcp_pcb used for listening, consumes less memory. + * + * @note The original tcp_pcb is freed. This function therefore has to be + * called like this: + * tpcb = tcp_listen_with_backlog(tpcb, backlog); + */ +struct tcp_pcb * +tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog) +{ + return tcp_listen_with_backlog_and_err(pcb, backlog, NULL); +} + +/** + * @ingroup tcp_raw + * Set the state of the connection to be LISTEN, which means that it + * is able to accept incoming connections. The protocol control block + * is reallocated in order to consume less memory. Setting the + * connection to LISTEN is an irreversible process. + * + * @param pcb the original tcp_pcb + * @param backlog the incoming connections queue limit + * @param err when NULL is returned, this contains the error reason + * @return tcp_pcb used for listening, consumes less memory. + * + * @note The original tcp_pcb is freed. This function therefore has to be + * called like this: + * tpcb = tcp_listen_with_backlog_and_err(tpcb, backlog, &err); + */ +struct tcp_pcb * +tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err) +{ + struct tcp_pcb_listen *lpcb = NULL; + err_t res; + + LWIP_UNUSED_ARG(backlog); + LWIP_ERROR("tcp_listen: pcb already connected", pcb->state == CLOSED, res = ERR_CLSD; goto done); + + /* already listening? */ + if (pcb->state == LISTEN) { + lpcb = (struct tcp_pcb_listen*)pcb; + res = ERR_ALREADY; + goto done; + } +#if SO_REUSE + if (ip_get_option(pcb, SOF_REUSEADDR)) { + /* Since SOF_REUSEADDR allows reusing a local address before the pcb's usage + is declared (listen-/connection-pcb), we have to make sure now that + this port is only used once for every local IP. */ + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + if ((lpcb->local_port == pcb->local_port) && + ip_addr_cmp(&lpcb->local_ip, &pcb->local_ip)) { + /* this address/port is already used */ + lpcb = NULL; + res = ERR_USE; + goto done; + } + } + } +#endif /* SO_REUSE */ + lpcb = (struct tcp_pcb_listen *)memp_malloc(MEMP_TCP_PCB_LISTEN); + if (lpcb == NULL) { + res = ERR_MEM; + goto done; + } + lpcb->callback_arg = pcb->callback_arg; + lpcb->local_port = pcb->local_port; + lpcb->state = LISTEN; + lpcb->prio = pcb->prio; + lpcb->so_options = pcb->so_options; + lpcb->ttl = pcb->ttl; + lpcb->tos = pcb->tos; +#if LWIP_IPV4 && LWIP_IPV6 + IP_SET_TYPE_VAL(lpcb->remote_ip, pcb->local_ip.type); +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + ip_addr_copy(lpcb->local_ip, pcb->local_ip); + if (pcb->local_port != 0) { + TCP_RMV(&tcp_bound_pcbs, pcb); + } + memp_free(MEMP_TCP_PCB, pcb); +#if LWIP_CALLBACK_API + lpcb->accept = tcp_accept_null; +#endif /* LWIP_CALLBACK_API */ +#if TCP_LISTEN_BACKLOG + lpcb->accepts_pending = 0; + tcp_backlog_set(lpcb, backlog); +#endif /* TCP_LISTEN_BACKLOG */ + TCP_REG(&tcp_listen_pcbs.pcbs, (struct tcp_pcb *)lpcb); + res = ERR_OK; +done: + if (err != NULL) { + *err = res; + } + return (struct tcp_pcb *)lpcb; +} + +/** + * Update the state that tracks the available window space to advertise. + * + * Returns how much extra window would be advertised if we sent an + * update now. + */ +u32_t +tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb) +{ + u32_t new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd; + + if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) { + /* we can advertise more window */ + pcb->rcv_ann_wnd = pcb->rcv_wnd; + return new_right_edge - pcb->rcv_ann_right_edge; + } else { + if (TCP_SEQ_GT(pcb->rcv_nxt, pcb->rcv_ann_right_edge)) { + /* Can happen due to other end sending out of advertised window, + * but within actual available (but not yet advertised) window */ + pcb->rcv_ann_wnd = 0; + } else { + /* keep the right edge of window constant */ + u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt; +#if !LWIP_WND_SCALE + LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff); +#endif + pcb->rcv_ann_wnd = (tcpwnd_size_t)new_rcv_ann_wnd; + } + return 0; + } +} + +/** + * @ingroup tcp_raw + * This function should be called by the application when it has + * processed the data. The purpose is to advertise a larger window + * when the data has been processed. + * + * @param pcb the tcp_pcb for which data is read + * @param len the amount of bytes that have been read by the application + */ +void +tcp_recved(struct tcp_pcb *pcb, u16_t len) +{ + int wnd_inflation; + + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_recved for listen-pcbs", + pcb->state != LISTEN); + + pcb->rcv_wnd += len; + if (pcb->rcv_wnd > TCP_WND_MAX(pcb)) { + pcb->rcv_wnd = TCP_WND_MAX(pcb); + } else if (pcb->rcv_wnd == 0) { + /* rcv_wnd overflowed */ + if ((pcb->state == CLOSE_WAIT) || (pcb->state == LAST_ACK)) { + /* In passive close, we allow this, since the FIN bit is added to rcv_wnd + by the stack itself, since it is not mandatory for an application + to call tcp_recved() for the FIN bit, but e.g. the netconn API does so. */ + pcb->rcv_wnd = TCP_WND_MAX(pcb); + } else { + LWIP_ASSERT("tcp_recved: len wrapped rcv_wnd\n", 0); + } + } + + wnd_inflation = tcp_update_rcv_ann_wnd(pcb); + + /* If the change in the right edge of window is significant (default + * watermark is TCP_WND/4), then send an explicit update now. + * Otherwise wait for a packet to be sent in the normal course of + * events (or more window to be available later) */ + if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) { + tcp_ack_now(pcb); + tcp_output(pcb); + } + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n", + len, pcb->rcv_wnd, (u16_t)(TCP_WND_MAX(pcb) - pcb->rcv_wnd))); +} + +/** + * Allocate a new local TCP port. + * + * @return a new (free) local TCP port number + */ +static u16_t +tcp_new_port(void) +{ + u8_t i; + u16_t n = 0; + struct tcp_pcb *pcb; + +again: + if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) { + tcp_port = TCP_LOCAL_PORT_RANGE_START; + } + /* Check all PCB lists. */ + for (i = 0; i < NUM_TCP_PCB_LISTS; i++) { + for (pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) { + if (pcb->local_port == tcp_port) { + if (++n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) { + return 0; + } + goto again; + } + } + } + return tcp_port; +} + +/** + * @ingroup tcp_raw + * Connects to another host. The function given as the "connected" + * argument will be called when the connection has been established. + * + * @param pcb the tcp_pcb used to establish the connection + * @param ipaddr the remote ip address to connect to + * @param port the remote tcp port to connect to + * @param connected callback function to call when connected (on error, + the err calback will be called) + * @return ERR_VAL if invalid arguments are given + * ERR_OK if connect request has been sent + * other err_t values if connect request couldn't be sent + */ +err_t +tcp_connect(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port, + tcp_connected_fn connected) +{ + err_t ret; + u32_t iss; + u16_t old_local_port; + + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + + LWIP_ERROR("tcp_connect: can only connect from state CLOSED", pcb->state == CLOSED, return ERR_ISCONN); + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_connect to port %"U16_F"\n", port)); + ip_addr_set(&pcb->remote_ip, ipaddr); + pcb->remote_port = port; + + /* check if we have a route to the remote host */ + if (ip_addr_isany(&pcb->local_ip)) { + /* no local IP address set, yet. */ + struct netif *netif; + const ip_addr_t *local_ip; + ip_route_get_local_ip(&pcb->local_ip, &pcb->remote_ip, netif, local_ip); + if ((netif == NULL) || (local_ip == NULL)) { + /* Don't even try to send a SYN packet if we have no route + since that will fail. */ + return ERR_RTE; + } + /* Use the address as local address of the pcb. */ + ip_addr_copy(pcb->local_ip, *local_ip); + } + + old_local_port = pcb->local_port; + if (pcb->local_port == 0) { + pcb->local_port = tcp_new_port(); + if (pcb->local_port == 0) { + return ERR_BUF; + } + } else { +#if SO_REUSE + if (ip_get_option(pcb, SOF_REUSEADDR)) { + /* Since SOF_REUSEADDR allows reusing a local address, we have to make sure + now that the 5-tuple is unique. */ + struct tcp_pcb *cpcb; + int i; + /* Don't check listen- and bound-PCBs, check active- and TIME-WAIT PCBs. */ + for (i = 2; i < NUM_TCP_PCB_LISTS; i++) { + for (cpcb = *tcp_pcb_lists[i]; cpcb != NULL; cpcb = cpcb->next) { + if ((cpcb->local_port == pcb->local_port) && + (cpcb->remote_port == port) && + ip_addr_cmp(&cpcb->local_ip, &pcb->local_ip) && + ip_addr_cmp(&cpcb->remote_ip, ipaddr)) { + /* linux returns EISCONN here, but ERR_USE should be OK for us */ + return ERR_USE; + } + } + } + } +#endif /* SO_REUSE */ + } + + iss = tcp_next_iss(pcb); + pcb->rcv_nxt = 0; + pcb->snd_nxt = iss; + pcb->lastack = iss - 1; + pcb->snd_wl2 = iss - 1; + pcb->snd_lbb = iss - 1; + /* Start with a window that does not need scaling. When window scaling is + enabled and used, the window is enlarged when both sides agree on scaling. */ + pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND); + pcb->rcv_ann_right_edge = pcb->rcv_nxt; + pcb->snd_wnd = TCP_WND; + /* As initial send MSS, we use TCP_MSS but limit it to 536. + The send MSS is updated when an MSS option is received. */ + pcb->mss = INITIAL_MSS; +#if TCP_CALCULATE_EFF_SEND_MSS + pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip); +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + pcb->cwnd = 1; +#if LWIP_CALLBACK_API + pcb->connected = connected; +#else /* LWIP_CALLBACK_API */ + LWIP_UNUSED_ARG(connected); +#endif /* LWIP_CALLBACK_API */ + + /* Send a SYN together with the MSS option. */ + ret = tcp_enqueue_flags(pcb, TCP_SYN); + if (ret == ERR_OK) { + /* SYN segment was enqueued, changed the pcbs state now */ + pcb->state = SYN_SENT; + if (old_local_port != 0) { + TCP_RMV(&tcp_bound_pcbs, pcb); + } + TCP_REG_ACTIVE(pcb); + MIB2_STATS_INC(mib2.tcpactiveopens); + + tcp_output(pcb); + } + return ret; +} + +/** + * Called every 500 ms and implements the retransmission timer and the timer that + * removes PCBs that have been in TIME-WAIT for enough time. It also increments + * various timers such as the inactivity timer in each PCB. + * + * Automatically called from tcp_tmr(). + */ +void +tcp_slowtmr(void) +{ + struct tcp_pcb *pcb, *prev; + tcpwnd_size_t eff_wnd; + u8_t pcb_remove; /* flag if a PCB should be removed */ + u8_t pcb_reset; /* flag if a RST should be sent when removing */ + err_t err; + + err = ERR_OK; + + ++tcp_ticks; + ++tcp_timer_ctr; + +tcp_slowtmr_start: + /* Steps through all of the active PCBs. */ + prev = NULL; + pcb = tcp_active_pcbs; + if (pcb == NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: no active pcbs\n")); + } + while (pcb != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: processing active pcb\n")); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != CLOSED\n", pcb->state != CLOSED); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != LISTEN\n", pcb->state != LISTEN); + LWIP_ASSERT("tcp_slowtmr: active pcb->state != TIME-WAIT\n", pcb->state != TIME_WAIT); + if (pcb->last_timer == tcp_timer_ctr) { + /* skip this pcb, we have already processed it */ + pcb = pcb->next; + continue; + } + pcb->last_timer = tcp_timer_ctr; + + pcb_remove = 0; + pcb_reset = 0; + + if (pcb->state == SYN_SENT && pcb->nrtx >= TCP_SYNMAXRTX) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max SYN retries reached\n")); + } + else if (pcb->nrtx >= TCP_MAXRTX) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: max DATA retries reached\n")); + } else { + if (pcb->persist_backoff > 0) { + /* If snd_wnd is zero, use persist timer to send 1 byte probes + * instead of using the standard retransmission mechanism. */ + u8_t backoff_cnt = tcp_persist_backoff[pcb->persist_backoff-1]; + if (pcb->persist_cnt < backoff_cnt) { + pcb->persist_cnt++; + } + if (pcb->persist_cnt >= backoff_cnt) { + if (tcp_zero_window_probe(pcb) == ERR_OK) { + pcb->persist_cnt = 0; + if (pcb->persist_backoff < sizeof(tcp_persist_backoff)) { + pcb->persist_backoff++; + } + } + } + } else { + /* Increase the retransmission timer if it is running */ + if (pcb->rtime >= 0) { + ++pcb->rtime; + } + + if (pcb->unacked != NULL && pcb->rtime >= pcb->rto) { + /* Time for a retransmission. */ + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_slowtmr: rtime %"S16_F + " pcb->rto %"S16_F"\n", + pcb->rtime, pcb->rto)); + + /* Double retransmission time-out unless we are trying to + * connect to somebody (i.e., we are in SYN_SENT). */ + if (pcb->state != SYN_SENT) { + u8_t backoff_idx = LWIP_MIN(pcb->nrtx, sizeof(tcp_backoff)-1); + pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[backoff_idx]; + } + + /* Reset the retransmission timer. */ + pcb->rtime = 0; + + /* Reduce congestion window and ssthresh. */ + eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); + pcb->ssthresh = eff_wnd >> 1; + if (pcb->ssthresh < (tcpwnd_size_t)(pcb->mss << 1)) { + pcb->ssthresh = (pcb->mss << 1); + } + pcb->cwnd = pcb->mss; + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: cwnd %"TCPWNDSIZE_F + " ssthresh %"TCPWNDSIZE_F"\n", + pcb->cwnd, pcb->ssthresh)); + + /* The following needs to be called AFTER cwnd is set to one + mss - STJ */ + tcp_rexmit_rto(pcb); + } + } + } + /* Check if this PCB has stayed too long in FIN-WAIT-2 */ + if (pcb->state == FIN_WAIT_2) { + /* If this PCB is in FIN_WAIT_2 because of SHUT_WR don't let it time out. */ + if (pcb->flags & TF_RXCLOSED) { + /* PCB was fully closed (either through close() or SHUT_RDWR): + normal FIN-WAIT timeout handling. */ + if ((u32_t)(tcp_ticks - pcb->tmr) > + TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n")); + } + } + } + + /* Check if KEEPALIVE should be sent */ + if (ip_get_option(pcb, SOF_KEEPALIVE) && + ((pcb->state == ESTABLISHED) || + (pcb->state == CLOSE_WAIT))) { + if ((u32_t)(tcp_ticks - pcb->tmr) > + (pcb->keep_idle + TCP_KEEP_DUR(pcb)) / TCP_SLOW_INTERVAL) + { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to ")); + ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + LWIP_DEBUGF(TCP_DEBUG, ("\n")); + + ++pcb_remove; + ++pcb_reset; + } else if ((u32_t)(tcp_ticks - pcb->tmr) > + (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb)) + / TCP_SLOW_INTERVAL) + { + err = tcp_keepalive(pcb); + if (err == ERR_OK) { + pcb->keep_cnt_sent++; + } + } + } + + /* If this PCB has queued out of sequence data, but has been + inactive for too long, will drop the data (it will eventually + be retransmitted). */ +#if TCP_QUEUE_OOSEQ + if (pcb->ooseq != NULL && + (u32_t)tcp_ticks - pcb->tmr >= pcb->rto * TCP_OOSEQ_TIMEOUT) { + tcp_segs_free(pcb->ooseq); + pcb->ooseq = NULL; + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: dropping OOSEQ queued data\n")); + } +#endif /* TCP_QUEUE_OOSEQ */ + + /* Check if this PCB has stayed too long in SYN-RCVD */ + if (pcb->state == SYN_RCVD) { + if ((u32_t)(tcp_ticks - pcb->tmr) > + TCP_SYN_RCVD_TIMEOUT / TCP_SLOW_INTERVAL) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in SYN-RCVD\n")); + } + } + + /* Check if this PCB has stayed too long in LAST-ACK */ + if (pcb->state == LAST_ACK) { + if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { + ++pcb_remove; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in LAST-ACK\n")); + } + } + + /* If the PCB should be removed, do it. */ + if (pcb_remove) { + struct tcp_pcb *pcb2; +#if LWIP_CALLBACK_API + tcp_err_fn err_fn = pcb->errf; +#endif /* LWIP_CALLBACK_API */ + void *err_arg; + enum tcp_state last_state; + tcp_pcb_purge(pcb); + /* Remove PCB from tcp_active_pcbs list. */ + if (prev != NULL) { + LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_active_pcbs", pcb != tcp_active_pcbs); + prev->next = pcb->next; + } else { + /* This PCB was the first. */ + LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_active_pcbs", tcp_active_pcbs == pcb); + tcp_active_pcbs = pcb->next; + } + + if (pcb_reset) { + tcp_rst(pcb->snd_nxt, pcb->rcv_nxt, &pcb->local_ip, &pcb->remote_ip, + pcb->local_port, pcb->remote_port); + } + + err_arg = pcb->callback_arg; + last_state = pcb->state; + pcb2 = pcb; + pcb = pcb->next; + memp_free(MEMP_TCP_PCB, pcb2); + + tcp_active_pcbs_changed = 0; + TCP_EVENT_ERR(last_state, err_fn, err_arg, ERR_ABRT); + if (tcp_active_pcbs_changed) { + goto tcp_slowtmr_start; + } + } else { + /* get the 'next' element now and work with 'prev' below (in case of abort) */ + prev = pcb; + pcb = pcb->next; + + /* We check if we should poll the connection. */ + ++prev->polltmr; + if (prev->polltmr >= prev->pollinterval) { + prev->polltmr = 0; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: polling application\n")); + tcp_active_pcbs_changed = 0; + TCP_EVENT_POLL(prev, err); + if (tcp_active_pcbs_changed) { + goto tcp_slowtmr_start; + } + /* if err == ERR_ABRT, 'prev' is already deallocated */ + if (err == ERR_OK) { + tcp_output(prev); + } + } + } + } + + + /* Steps through all of the TIME-WAIT PCBs. */ + prev = NULL; + pcb = tcp_tw_pcbs; + while (pcb != NULL) { + LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); + pcb_remove = 0; + + /* Check if this PCB has stayed long enough in TIME-WAIT */ + if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { + ++pcb_remove; + } + + /* If the PCB should be removed, do it. */ + if (pcb_remove) { + struct tcp_pcb *pcb2; + tcp_pcb_purge(pcb); + /* Remove PCB from tcp_tw_pcbs list. */ + if (prev != NULL) { + LWIP_ASSERT("tcp_slowtmr: middle tcp != tcp_tw_pcbs", pcb != tcp_tw_pcbs); + prev->next = pcb->next; + } else { + /* This PCB was the first. */ + LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb); + tcp_tw_pcbs = pcb->next; + } + pcb2 = pcb; + pcb = pcb->next; + memp_free(MEMP_TCP_PCB, pcb2); + } else { + prev = pcb; + pcb = pcb->next; + } + } +} + +/** + * Is called every TCP_FAST_INTERVAL (250 ms) and process data previously + * "refused" by upper layer (application) and sends delayed ACKs. + * + * Automatically called from tcp_tmr(). + */ +void +tcp_fasttmr(void) +{ + struct tcp_pcb *pcb; + + ++tcp_timer_ctr; + +tcp_fasttmr_start: + pcb = tcp_active_pcbs; + + while (pcb != NULL) { + if (pcb->last_timer != tcp_timer_ctr) { + struct tcp_pcb *next; + pcb->last_timer = tcp_timer_ctr; + /* send delayed ACKs */ + if (pcb->flags & TF_ACK_DELAY) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n")); + tcp_ack_now(pcb); + tcp_output(pcb); + pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); + } + /* send pending FIN */ + if (pcb->flags & TF_CLOSEPEND) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: pending FIN\n")); + pcb->flags &= ~(TF_CLOSEPEND); + tcp_close_shutdown_fin(pcb); + } + + next = pcb->next; + + /* If there is data which was previously "refused" by upper layer */ + if (pcb->refused_data != NULL) { + tcp_active_pcbs_changed = 0; + tcp_process_refused_data(pcb); + if (tcp_active_pcbs_changed) { + /* application callback has changed the pcb list: restart the loop */ + goto tcp_fasttmr_start; + } + } + pcb = next; + } else { + pcb = pcb->next; + } + } +} + +/** Call tcp_output for all active pcbs that have TF_NAGLEMEMERR set */ +void +tcp_txnow(void) +{ + struct tcp_pcb *pcb; + + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->flags & TF_NAGLEMEMERR) { + tcp_output(pcb); + } + } +} + +/** Pass pcb->refused_data to the recv callback */ +err_t +tcp_process_refused_data(struct tcp_pcb *pcb) +{ +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + struct pbuf *rest; + while (pcb->refused_data != NULL) +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + { + err_t err; + u8_t refused_flags = pcb->refused_data->flags; + /* set pcb->refused_data to NULL in case the callback frees it and then + closes the pcb */ + struct pbuf *refused_data = pcb->refused_data; +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + pbuf_split_64k(refused_data, &rest); + pcb->refused_data = rest; +#else /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = NULL; +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + /* Notify again application with data previously received. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n")); + TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err); + if (err == ERR_OK) { + /* did refused_data include a FIN? */ + if (refused_flags & PBUF_FLAG_TCP_FIN +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + && (rest == NULL) +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + ) { + /* correct rcv_wnd as the application won't call tcp_recved() + for the FIN's seqno */ + if (pcb->rcv_wnd != TCP_WND_MAX(pcb)) { + pcb->rcv_wnd++; + } + TCP_EVENT_CLOSED(pcb, err); + if (err == ERR_ABRT) { + return ERR_ABRT; + } + } + } else if (err == ERR_ABRT) { + /* if err == ERR_ABRT, 'pcb' is already deallocated */ + /* Drop incoming packets because pcb is "full" (only if the incoming + segment contains data). */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n")); + return ERR_ABRT; + } else { + /* data is still refused, pbuf is still valid (go on for ACK-only packets) */ +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_cat(refused_data, rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = refused_data; + return ERR_INPROGRESS; + } + } + return ERR_OK; +} + +/** + * Deallocates a list of TCP segments (tcp_seg structures). + * + * @param seg tcp_seg list of TCP segments to free + */ +void +tcp_segs_free(struct tcp_seg *seg) +{ + while (seg != NULL) { + struct tcp_seg *next = seg->next; + tcp_seg_free(seg); + seg = next; + } +} + +/** + * Frees a TCP segment (tcp_seg structure). + * + * @param seg single tcp_seg to free + */ +void +tcp_seg_free(struct tcp_seg *seg) +{ + if (seg != NULL) { + if (seg->p != NULL) { + pbuf_free(seg->p); +#if TCP_DEBUG + seg->p = NULL; +#endif /* TCP_DEBUG */ + } + memp_free(MEMP_TCP_SEG, seg); + } +} + +/** + * Sets the priority of a connection. + * + * @param pcb the tcp_pcb to manipulate + * @param prio new priority + */ +void +tcp_setprio(struct tcp_pcb *pcb, u8_t prio) +{ + pcb->prio = prio; +} + +#if TCP_QUEUE_OOSEQ +/** + * Returns a copy of the given TCP segment. + * The pbuf and data are not copied, only the pointers + * + * @param seg the old tcp_seg + * @return a copy of seg + */ +struct tcp_seg * +tcp_seg_copy(struct tcp_seg *seg) +{ + struct tcp_seg *cseg; + + cseg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG); + if (cseg == NULL) { + return NULL; + } + SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); + pbuf_ref(cseg->p); + return cseg; +} +#endif /* TCP_QUEUE_OOSEQ */ + +#if LWIP_CALLBACK_API +/** + * Default receive callback that is called if the user didn't register + * a recv callback for the pcb. + */ +err_t +tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + LWIP_UNUSED_ARG(arg); + if (p != NULL) { + tcp_recved(pcb, p->tot_len); + pbuf_free(p); + } else if (err == ERR_OK) { + return tcp_close(pcb); + } + return ERR_OK; +} +#endif /* LWIP_CALLBACK_API */ + +/** + * Kills the oldest active connection that has the same or lower priority than + * 'prio'. + * + * @param prio minimum priority + */ +static void +tcp_kill_prio(u8_t prio) +{ + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + u8_t mprio; + + mprio = LWIP_MIN(TCP_PRIO_MAX, prio); + + /* We kill the oldest active connection that has lower priority than prio. */ + inactivity = 0; + inactive = NULL; + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->prio <= mprio && + (u32_t)(tcp_ticks - pcb->tmr) >= inactivity) { + inactivity = tcp_ticks - pcb->tmr; + inactive = pcb; + mprio = pcb->prio; + } + } + if (inactive != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_prio: killing oldest PCB %p (%"S32_F")\n", + (void *)inactive, inactivity)); + tcp_abort(inactive); + } +} + +/** + * Kills the oldest connection that is in specific state. + * Called from tcp_alloc() for LAST_ACK and CLOSING if no more connections are available. + */ +static void +tcp_kill_state(enum tcp_state state) +{ + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + + LWIP_ASSERT("invalid state", (state == CLOSING) || (state == LAST_ACK)); + + inactivity = 0; + inactive = NULL; + /* Go through the list of active pcbs and get the oldest pcb that is in state + CLOSING/LAST_ACK. */ + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->state == state) { + if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) { + inactivity = tcp_ticks - pcb->tmr; + inactive = pcb; + } + } + } + if (inactive != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_closing: killing oldest %s PCB %p (%"S32_F")\n", + tcp_state_str[state], (void *)inactive, inactivity)); + /* Don't send a RST, since no data is lost. */ + tcp_abandon(inactive, 0); + } +} + +/** + * Kills the oldest connection that is in TIME_WAIT state. + * Called from tcp_alloc() if no more connections are available. + */ +static void +tcp_kill_timewait(void) +{ + struct tcp_pcb *pcb, *inactive; + u32_t inactivity; + + inactivity = 0; + inactive = NULL; + /* Go through the list of TIME_WAIT pcbs and get the oldest pcb. */ + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) { + inactivity = tcp_ticks - pcb->tmr; + inactive = pcb; + } + } + if (inactive != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_timewait: killing oldest TIME-WAIT PCB %p (%"S32_F")\n", + (void *)inactive, inactivity)); + tcp_abort(inactive); + } +} + +/** + * Allocate a new tcp_pcb structure. + * + * @param prio priority for the new pcb + * @return a new tcp_pcb that initially is in state CLOSED + */ +struct tcp_pcb * +tcp_alloc(u8_t prio) +{ + struct tcp_pcb *pcb; + + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + if (pcb == NULL) { + /* Try killing oldest connection in TIME-WAIT. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest TIME-WAIT connection\n")); + tcp_kill_timewait(); + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + if (pcb == NULL) { + /* Try killing oldest connection in LAST-ACK (these wouldn't go to TIME-WAIT). */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest LAST-ACK connection\n")); + tcp_kill_state(LAST_ACK); + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + if (pcb == NULL) { + /* Try killing oldest connection in CLOSING. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest CLOSING connection\n")); + tcp_kill_state(CLOSING); + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + if (pcb == NULL) { + /* Try killing active connections with lower priority than the new one. */ + LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing connection with prio lower than %d\n", prio)); + tcp_kill_prio(prio); + /* Try to allocate a tcp_pcb again. */ + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); + if (pcb != NULL) { + /* adjust err stats: memp_malloc failed multiple times before */ + MEMP_STATS_DEC(err, MEMP_TCP_PCB); + } + } + if (pcb != NULL) { + /* adjust err stats: memp_malloc failed multiple times before */ + MEMP_STATS_DEC(err, MEMP_TCP_PCB); + } + } + if (pcb != NULL) { + /* adjust err stats: memp_malloc failed multiple times before */ + MEMP_STATS_DEC(err, MEMP_TCP_PCB); + } + } + if (pcb != NULL) { + /* adjust err stats: memp_malloc failed above */ + MEMP_STATS_DEC(err, MEMP_TCP_PCB); + } + } + if (pcb != NULL) { + /* zero out the whole pcb, so there is no need to initialize members to zero */ + memset(pcb, 0, sizeof(struct tcp_pcb)); + pcb->prio = prio; + pcb->snd_buf = TCP_SND_BUF; + /* Start with a window that does not need scaling. When window scaling is + enabled and used, the window is enlarged when both sides agree on scaling. */ + pcb->rcv_wnd = pcb->rcv_ann_wnd = TCPWND_MIN16(TCP_WND); + pcb->ttl = TCP_TTL; + /* As initial send MSS, we use TCP_MSS but limit it to 536. + The send MSS is updated when an MSS option is received. */ + pcb->mss = INITIAL_MSS; + pcb->rto = 3000 / TCP_SLOW_INTERVAL; + pcb->sv = 3000 / TCP_SLOW_INTERVAL; + pcb->rtime = -1; + pcb->cwnd = 1; + pcb->tmr = tcp_ticks; + pcb->last_timer = tcp_timer_ctr; + + /* RFC 5681 recommends setting ssthresh abritrarily high and gives an example + of using the largest advertised receive window. We've seen complications with + receiving TCPs that use window scaling and/or window auto-tuning where the + initial advertised window is very small and then grows rapidly once the + connection is established. To avoid these complications, we set ssthresh to the + largest effective cwnd (amount of in-flight data) that the sender can have. */ + pcb->ssthresh = TCP_SND_BUF; + +#if LWIP_CALLBACK_API + pcb->recv = tcp_recv_null; +#endif /* LWIP_CALLBACK_API */ + + /* Init KEEPALIVE timer */ + pcb->keep_idle = TCP_KEEPIDLE_DEFAULT; + +#if LWIP_TCP_KEEPALIVE + pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT; + pcb->keep_cnt = TCP_KEEPCNT_DEFAULT; +#endif /* LWIP_TCP_KEEPALIVE */ + } + return pcb; +} + +/** + * @ingroup tcp_raw + * Creates a new TCP protocol control block but doesn't place it on + * any of the TCP PCB lists. + * The pcb is not put on any list until binding using tcp_bind(). + * + * @internal: Maybe there should be a idle TCP PCB list where these + * PCBs are put on. Port reservation using tcp_bind() is implemented but + * allocated pcbs that are not bound can't be killed automatically if wanting + * to allocate a pcb with higher prio (@see tcp_kill_prio()) + * + * @return a new tcp_pcb that initially is in state CLOSED + */ +struct tcp_pcb * +tcp_new(void) +{ + return tcp_alloc(TCP_PRIO_NORMAL); +} + +/** + * @ingroup tcp_raw + * Creates a new TCP protocol control block but doesn't + * place it on any of the TCP PCB lists. + * The pcb is not put on any list until binding using tcp_bind(). + * + * @param type IP address type, see @ref lwip_ip_addr_type definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) connections, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. + * @return a new tcp_pcb that initially is in state CLOSED + */ +struct tcp_pcb * +tcp_new_ip_type(u8_t type) +{ + struct tcp_pcb * pcb; + pcb = tcp_alloc(TCP_PRIO_NORMAL); +#if LWIP_IPV4 && LWIP_IPV6 + if (pcb != NULL) { + IP_SET_TYPE_VAL(pcb->local_ip, type); + IP_SET_TYPE_VAL(pcb->remote_ip, type); + } +#else + LWIP_UNUSED_ARG(type); +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + return pcb; +} + +/** + * @ingroup tcp_raw + * Used to specify the argument that should be passed callback + * functions. + * + * @param pcb tcp_pcb to set the callback argument + * @param arg void pointer argument to pass to callback functions + */ +void +tcp_arg(struct tcp_pcb *pcb, void *arg) +{ + /* This function is allowed to be called for both listen pcbs and + connection pcbs. */ + if (pcb != NULL) { + pcb->callback_arg = arg; + } +} +#if LWIP_CALLBACK_API + +/** + * @ingroup tcp_raw + * Used to specify the function that should be called when a TCP + * connection receives data. + * + * @param pcb tcp_pcb to set the recv callback + * @param recv callback function to call for this pcb when data is received + */ +void +tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv) +{ + if (pcb != NULL) { + LWIP_ASSERT("invalid socket state for recv callback", pcb->state != LISTEN); + pcb->recv = recv; + } +} + +/** + * @ingroup tcp_raw + * Used to specify the function that should be called when TCP data + * has been successfully delivered to the remote host. + * + * @param pcb tcp_pcb to set the sent callback + * @param sent callback function to call for this pcb when data is successfully sent + */ +void +tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) +{ + if (pcb != NULL) { + LWIP_ASSERT("invalid socket state for sent callback", pcb->state != LISTEN); + pcb->sent = sent; + } +} + +/** + * @ingroup tcp_raw + * Used to specify the function that should be called when a fatal error + * has occurred on the connection. + * + * @note The corresponding pcb is already freed when this callback is called! + * + * @param pcb tcp_pcb to set the err callback + * @param err callback function to call for this pcb when a fatal error + * has occurred on the connection + */ +void +tcp_err(struct tcp_pcb *pcb, tcp_err_fn err) +{ + if (pcb != NULL) { + LWIP_ASSERT("invalid socket state for err callback", pcb->state != LISTEN); + pcb->errf = err; + } +} + +/** + * @ingroup tcp_raw + * Used for specifying the function that should be called when a + * LISTENing connection has been connected to another host. + * + * @param pcb tcp_pcb to set the accept callback + * @param accept callback function to call for this pcb when LISTENing + * connection has been connected to another host + */ +void +tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) +{ + if ((pcb != NULL) && (pcb->state == LISTEN)) { + struct tcp_pcb_listen *lpcb = (struct tcp_pcb_listen*)pcb; + lpcb->accept = accept; + } +} +#endif /* LWIP_CALLBACK_API */ + + +/** + * @ingroup tcp_raw + * Used to specify the function that should be called periodically + * from TCP. The interval is specified in terms of the TCP coarse + * timer interval, which is called twice a second. + * + */ +void +tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval) +{ + LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN); +#if LWIP_CALLBACK_API + pcb->poll = poll; +#else /* LWIP_CALLBACK_API */ + LWIP_UNUSED_ARG(poll); +#endif /* LWIP_CALLBACK_API */ + pcb->pollinterval = interval; +} + +/** + * Purges a TCP PCB. Removes any buffered data and frees the buffer memory + * (pcb->ooseq, pcb->unsent and pcb->unacked are freed). + * + * @param pcb tcp_pcb to purge. The pcb itself is not deallocated! + */ +void +tcp_pcb_purge(struct tcp_pcb *pcb) +{ + if (pcb->state != CLOSED && + pcb->state != TIME_WAIT && + pcb->state != LISTEN) { + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge\n")); + + tcp_backlog_accepted(pcb); + + if (pcb->refused_data != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n")); + pbuf_free(pcb->refused_data); + pcb->refused_data = NULL; + } + if (pcb->unsent != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: not all data sent\n")); + } + if (pcb->unacked != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->unacked\n")); + } +#if TCP_QUEUE_OOSEQ + if (pcb->ooseq != NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->ooseq\n")); + } + tcp_segs_free(pcb->ooseq); + pcb->ooseq = NULL; +#endif /* TCP_QUEUE_OOSEQ */ + + /* Stop the retransmission timer as it will expect data on unacked + queue if it fires */ + pcb->rtime = -1; + + tcp_segs_free(pcb->unsent); + tcp_segs_free(pcb->unacked); + pcb->unacked = pcb->unsent = NULL; +#if TCP_OVERSIZE + pcb->unsent_oversize = 0; +#endif /* TCP_OVERSIZE */ + } +} + +/** + * Purges the PCB and removes it from a PCB list. Any delayed ACKs are sent first. + * + * @param pcblist PCB list to purge. + * @param pcb tcp_pcb to purge. The pcb itself is NOT deallocated! + */ +void +tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) +{ + TCP_RMV(pcblist, pcb); + + tcp_pcb_purge(pcb); + + /* if there is an outstanding delayed ACKs, send it */ + if (pcb->state != TIME_WAIT && + pcb->state != LISTEN && + pcb->flags & TF_ACK_DELAY) { + pcb->flags |= TF_ACK_NOW; + tcp_output(pcb); + } + + if (pcb->state != LISTEN) { + LWIP_ASSERT("unsent segments leaking", pcb->unsent == NULL); + LWIP_ASSERT("unacked segments leaking", pcb->unacked == NULL); +#if TCP_QUEUE_OOSEQ + LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL); +#endif /* TCP_QUEUE_OOSEQ */ + } + + pcb->state = CLOSED; + /* reset the local port to prevent the pcb from being 'bound' */ + pcb->local_port = 0; + + LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane()); +} + +/** + * Calculates a new initial sequence number for new connections. + * + * @return u32_t pseudo random sequence number + */ +u32_t +tcp_next_iss(struct tcp_pcb *pcb) +{ +#ifdef LWIP_HOOK_TCP_ISN + return LWIP_HOOK_TCP_ISN(&pcb->local_ip, pcb->local_port, &pcb->remote_ip, pcb->remote_port); +#else /* LWIP_HOOK_TCP_ISN */ + static u32_t iss = 6510; + + LWIP_UNUSED_ARG(pcb); + + iss += tcp_ticks; /* XXX */ + return iss; +#endif /* LWIP_HOOK_TCP_ISN */ +} + +#if TCP_CALCULATE_EFF_SEND_MSS +/** + * Calculates the effective send mss that can be used for a specific IP address + * by using ip_route to determine the netif used to send to the address and + * calculating the minimum of TCP_MSS and that netif's mtu (if set). + */ +u16_t +tcp_eff_send_mss_impl(u16_t sendmss, const ip_addr_t *dest +#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING + , const ip_addr_t *src +#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ + ) +{ + u16_t mss_s; + struct netif *outif; + s16_t mtu; + + outif = ip_route(src, dest); +#if LWIP_IPV6 +#if LWIP_IPV4 + if (IP_IS_V6(dest)) +#endif /* LWIP_IPV4 */ + { + /* First look in destination cache, to see if there is a Path MTU. */ + mtu = nd6_get_destination_mtu(ip_2_ip6(dest), outif); + } +#if LWIP_IPV4 + else +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + { + if (outif == NULL) { + return sendmss; + } + mtu = outif->mtu; + } +#endif /* LWIP_IPV4 */ + + if (mtu != 0) { +#if LWIP_IPV6 +#if LWIP_IPV4 + if (IP_IS_V6(dest)) +#endif /* LWIP_IPV4 */ + { + mss_s = mtu - IP6_HLEN - TCP_HLEN; + } +#if LWIP_IPV4 + else +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + { + mss_s = mtu - IP_HLEN - TCP_HLEN; + } +#endif /* LWIP_IPV4 */ + /* RFC 1122, chap 4.2.2.6: + * Eff.snd.MSS = min(SendMSS+20, MMS_S) - TCPhdrsize - IPoptionsize + * We correct for TCP options in tcp_write(), and don't support IP options. + */ + sendmss = LWIP_MIN(sendmss, mss_s); + } + return sendmss; +} +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + +/** Helper function for tcp_netif_ip_addr_changed() that iterates a pcb list */ +static void +tcp_netif_ip_addr_changed_pcblist(const ip_addr_t* old_addr, struct tcp_pcb* pcb_list) +{ + struct tcp_pcb *pcb; + pcb = pcb_list; + while (pcb != NULL) { + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&pcb->local_ip, old_addr) +#if LWIP_AUTOIP + /* connections to link-local addresses must persist (RFC3927 ch. 1.9) */ + && (!IP_IS_V4_VAL(pcb->local_ip) || !ip4_addr_islinklocal(ip_2_ip4(&pcb->local_ip))) +#endif /* LWIP_AUTOIP */ + ) { + /* this connection must be aborted */ + struct tcp_pcb *next = pcb->next; + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb)); + tcp_abort(pcb); + pcb = next; + } else { + pcb = pcb->next; + } + } +} + +/** This function is called from netif.c when address is changed or netif is removed + * + * @param old_addr IP address of the netif before change + * @param new_addr IP address of the netif after change or NULL if netif has been removed + */ +void +tcp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr) +{ + struct tcp_pcb_listen *lpcb, *next; + + if (!ip_addr_isany(old_addr)) { + tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_active_pcbs); + tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_bound_pcbs); + + if (!ip_addr_isany(new_addr)) { + /* PCB bound to current local interface address? */ + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = next) { + next = lpcb->next; + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&lpcb->local_ip, old_addr)) { + /* The PCB is listening to the old ipaddr and + * is set to listen to the new one instead */ + ip_addr_copy(lpcb->local_ip, *new_addr); + } + } + } + } +} + +const char* +tcp_debug_state_str(enum tcp_state s) +{ + return tcp_state_str[s]; +} + +#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG +/** + * Print a tcp header for debugging purposes. + * + * @param tcphdr pointer to a struct tcp_hdr + */ +void +tcp_debug_print(struct tcp_hdr *tcphdr) +{ + LWIP_DEBUGF(TCP_DEBUG, ("TCP header:\n")); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(TCP_DEBUG, ("| %5"U16_F" | %5"U16_F" | (src port, dest port)\n", + lwip_ntohs(tcphdr->src), lwip_ntohs(tcphdr->dest))); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(TCP_DEBUG, ("| %010"U32_F" | (seq no)\n", + lwip_ntohl(tcphdr->seqno))); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(TCP_DEBUG, ("| %010"U32_F" | (ack no)\n", + lwip_ntohl(tcphdr->ackno))); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(TCP_DEBUG, ("| %2"U16_F" | |%"U16_F"%"U16_F"%"U16_F"%"U16_F"%"U16_F"%"U16_F"| %5"U16_F" | (hdrlen, flags (", + TCPH_HDRLEN(tcphdr), + (u16_t)(TCPH_FLAGS(tcphdr) >> 5 & 1), + (u16_t)(TCPH_FLAGS(tcphdr) >> 4 & 1), + (u16_t)(TCPH_FLAGS(tcphdr) >> 3 & 1), + (u16_t)(TCPH_FLAGS(tcphdr) >> 2 & 1), + (u16_t)(TCPH_FLAGS(tcphdr) >> 1 & 1), + (u16_t)(TCPH_FLAGS(tcphdr) & 1), + lwip_ntohs(tcphdr->wnd))); + tcp_debug_print_flags(TCPH_FLAGS(tcphdr)); + LWIP_DEBUGF(TCP_DEBUG, ("), win)\n")); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(TCP_DEBUG, ("| 0x%04"X16_F" | %5"U16_F" | (chksum, urgp)\n", + lwip_ntohs(tcphdr->chksum), lwip_ntohs(tcphdr->urgp))); + LWIP_DEBUGF(TCP_DEBUG, ("+-------------------------------+\n")); +} + +/** + * Print a tcp state for debugging purposes. + * + * @param s enum tcp_state to print + */ +void +tcp_debug_print_state(enum tcp_state s) +{ + LWIP_DEBUGF(TCP_DEBUG, ("State: %s\n", tcp_state_str[s])); +} + +/** + * Print tcp flags for debugging purposes. + * + * @param flags tcp flags, all active flags are printed + */ +void +tcp_debug_print_flags(u8_t flags) +{ + if (flags & TCP_FIN) { + LWIP_DEBUGF(TCP_DEBUG, ("FIN ")); + } + if (flags & TCP_SYN) { + LWIP_DEBUGF(TCP_DEBUG, ("SYN ")); + } + if (flags & TCP_RST) { + LWIP_DEBUGF(TCP_DEBUG, ("RST ")); + } + if (flags & TCP_PSH) { + LWIP_DEBUGF(TCP_DEBUG, ("PSH ")); + } + if (flags & TCP_ACK) { + LWIP_DEBUGF(TCP_DEBUG, ("ACK ")); + } + if (flags & TCP_URG) { + LWIP_DEBUGF(TCP_DEBUG, ("URG ")); + } + if (flags & TCP_ECE) { + LWIP_DEBUGF(TCP_DEBUG, ("ECE ")); + } + if (flags & TCP_CWR) { + LWIP_DEBUGF(TCP_DEBUG, ("CWR ")); + } + LWIP_DEBUGF(TCP_DEBUG, ("\n")); +} + +/** + * Print all tcp_pcbs in every list for debugging purposes. + */ +void +tcp_debug_print_pcbs(void) +{ + struct tcp_pcb *pcb; + struct tcp_pcb_listen *pcbl; + + LWIP_DEBUGF(TCP_DEBUG, ("Active PCB states:\n")); + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", + pcb->local_port, pcb->remote_port, + pcb->snd_nxt, pcb->rcv_nxt)); + tcp_debug_print_state(pcb->state); + } + + LWIP_DEBUGF(TCP_DEBUG, ("Listen PCB states:\n")); + for (pcbl = tcp_listen_pcbs.listen_pcbs; pcbl != NULL; pcbl = pcbl->next) { + LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F" ", pcbl->local_port)); + tcp_debug_print_state(pcbl->state); + } + + LWIP_DEBUGF(TCP_DEBUG, ("TIME-WAIT PCB states:\n")); + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", + pcb->local_port, pcb->remote_port, + pcb->snd_nxt, pcb->rcv_nxt)); + tcp_debug_print_state(pcb->state); + } +} + +/** + * Check state consistency of the tcp_pcb lists. + */ +s16_t +tcp_pcbs_sane(void) +{ + struct tcp_pcb *pcb; + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != CLOSED", pcb->state != CLOSED); + LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != LISTEN", pcb->state != LISTEN); + LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); + } + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_ASSERT("tcp_pcbs_sane: tw pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); + } + return 1; +} +#endif /* TCP_DEBUG */ + +#endif /* LWIP_TCP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_in.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_in.c new file mode 100644 index 0000000..ba87928 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_in.c @@ -0,0 +1,1818 @@ +/** + * @file + * Transmission Control Protocol, incoming traffic + * + * The input processing functions of the TCP layer. + * + * These functions are generally called in the order (ip_input() ->) + * tcp_input() -> * tcp_process() -> tcp_receive() (-> application). + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/priv/tcp_priv.h" +#include "lwip/def.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/inet_chksum.h" +#include "lwip/stats.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#if LWIP_ND6_TCP_REACHABILITY_HINTS +#include "lwip/nd6.h" +#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */ + +/** Initial CWND calculation as defined RFC 2581 */ +#define LWIP_TCP_CALC_INITIAL_CWND(mss) LWIP_MIN((4U * (mss)), LWIP_MAX((2U * (mss)), 4380U)); + +/* These variables are global to all functions involved in the input + processing of TCP segments. They are set by the tcp_input() + function. */ +static struct tcp_seg inseg; +static struct tcp_hdr *tcphdr; +static u16_t tcphdr_optlen; +static u16_t tcphdr_opt1len; +static u8_t* tcphdr_opt2; +static u16_t tcp_optidx; +static u32_t seqno, ackno; +static tcpwnd_size_t recv_acked; +static u16_t tcplen; +static u8_t flags; + +static u8_t recv_flags; +static struct pbuf *recv_data; + +struct tcp_pcb *tcp_input_pcb; + +/* Forward declarations. */ +static err_t tcp_process(struct tcp_pcb *pcb); +static void tcp_receive(struct tcp_pcb *pcb); +static void tcp_parseopt(struct tcp_pcb *pcb); + +static void tcp_listen_input(struct tcp_pcb_listen *pcb); +static void tcp_timewait_input(struct tcp_pcb *pcb); + +/** + * The initial input processing of TCP. It verifies the TCP header, demultiplexes + * the segment between the PCBs and passes it on to tcp_process(), which implements + * the TCP finite state machine. This function is called by the IP layer (in + * ip_input()). + * + * @param p received TCP segment to process (p->payload pointing to the TCP header) + * @param inp network interface on which this segment was received + */ +void +tcp_input(struct pbuf *p, struct netif *inp) +{ + struct tcp_pcb *pcb, *prev; + struct tcp_pcb_listen *lpcb; +#if SO_REUSE + struct tcp_pcb *lpcb_prev = NULL; + struct tcp_pcb_listen *lpcb_any = NULL; +#endif /* SO_REUSE */ + u8_t hdrlen_bytes; + err_t err; + + LWIP_UNUSED_ARG(inp); + + PERF_START; + + TCP_STATS_INC(tcp.recv); + MIB2_STATS_INC(mib2.tcpinsegs); + + tcphdr = (struct tcp_hdr *)p->payload; + +#if TCP_INPUT_DEBUG + tcp_debug_print(tcphdr); +#endif + + /* Check that TCP header fits in payload */ + if (p->len < TCP_HLEN) { + /* drop short packets */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: short packet (%"U16_F" bytes) discarded\n", p->tot_len)); + TCP_STATS_INC(tcp.lenerr); + goto dropped; + } + + /* Don't even process incoming broadcasts/multicasts. */ + if (ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()) || + ip_addr_ismulticast(ip_current_dest_addr())) { + TCP_STATS_INC(tcp.proterr); + goto dropped; + } + +#if CHECKSUM_CHECK_TCP + IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_CHECK_TCP) { + /* Verify TCP checksum. */ + u16_t chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + ip_current_src_addr(), ip_current_dest_addr()); + if (chksum != 0) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packet discarded due to failing checksum 0x%04"X16_F"\n", + chksum)); + tcp_debug_print(tcphdr); + TCP_STATS_INC(tcp.chkerr); + goto dropped; + } + } +#endif /* CHECKSUM_CHECK_TCP */ + + /* sanity-check header length */ + hdrlen_bytes = TCPH_HDRLEN(tcphdr) * 4; + if ((hdrlen_bytes < TCP_HLEN) || (hdrlen_bytes > p->tot_len)) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: invalid header length (%"U16_F")\n", (u16_t)hdrlen_bytes)); + TCP_STATS_INC(tcp.lenerr); + goto dropped; + } + + /* Move the payload pointer in the pbuf so that it points to the + TCP data instead of the TCP header. */ + tcphdr_optlen = hdrlen_bytes - TCP_HLEN; + tcphdr_opt2 = NULL; + if (p->len >= hdrlen_bytes) { + /* all options are in the first pbuf */ + tcphdr_opt1len = tcphdr_optlen; + pbuf_header(p, -(s16_t)hdrlen_bytes); /* cannot fail */ + } else { + u16_t opt2len; + /* TCP header fits into first pbuf, options don't - data is in the next pbuf */ + /* there must be a next pbuf, due to hdrlen_bytes sanity check above */ + LWIP_ASSERT("p->next != NULL", p->next != NULL); + + /* advance over the TCP header (cannot fail) */ + pbuf_header(p, -TCP_HLEN); + + /* determine how long the first and second parts of the options are */ + tcphdr_opt1len = p->len; + opt2len = tcphdr_optlen - tcphdr_opt1len; + + /* options continue in the next pbuf: set p to zero length and hide the + options in the next pbuf (adjusting p->tot_len) */ + pbuf_header(p, -(s16_t)tcphdr_opt1len); + + /* check that the options fit in the second pbuf */ + if (opt2len > p->next->len) { + /* drop short packets */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: options overflow second pbuf (%"U16_F" bytes)\n", p->next->len)); + TCP_STATS_INC(tcp.lenerr); + goto dropped; + } + + /* remember the pointer to the second part of the options */ + tcphdr_opt2 = (u8_t*)p->next->payload; + + /* advance p->next to point after the options, and manually + adjust p->tot_len to keep it consistent with the changed p->next */ + pbuf_header(p->next, -(s16_t)opt2len); + p->tot_len -= opt2len; + + LWIP_ASSERT("p->len == 0", p->len == 0); + LWIP_ASSERT("p->tot_len == p->next->tot_len", p->tot_len == p->next->tot_len); + } + + /* Convert fields in TCP header to host byte order. */ + tcphdr->src = lwip_ntohs(tcphdr->src); + tcphdr->dest = lwip_ntohs(tcphdr->dest); + seqno = tcphdr->seqno = lwip_ntohl(tcphdr->seqno); + ackno = tcphdr->ackno = lwip_ntohl(tcphdr->ackno); + tcphdr->wnd = lwip_ntohs(tcphdr->wnd); + + flags = TCPH_FLAGS(tcphdr); + tcplen = p->tot_len + ((flags & (TCP_FIN | TCP_SYN)) ? 1 : 0); + + /* Demultiplex an incoming segment. First, we check if it is destined + for an active connection. */ + prev = NULL; + + for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED); + LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); + LWIP_ASSERT("tcp_input: active pcb->state != LISTEN", pcb->state != LISTEN); + if (pcb->remote_port == tcphdr->src && + pcb->local_port == tcphdr->dest && + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + /* Move this PCB to the front of the list so that subsequent + lookups will be faster (we exploit locality in TCP segment + arrivals). */ + LWIP_ASSERT("tcp_input: pcb->next != pcb (before cache)", pcb->next != pcb); + if (prev != NULL) { + prev->next = pcb->next; + pcb->next = tcp_active_pcbs; + tcp_active_pcbs = pcb; + } else { + TCP_STATS_INC(tcp.cachehit); + } + LWIP_ASSERT("tcp_input: pcb->next != pcb (after cache)", pcb->next != pcb); + break; + } + prev = pcb; + } + + if (pcb == NULL) { + /* If it did not go to an active connection, we check the connections + in the TIME-WAIT state. */ + for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { + LWIP_ASSERT("tcp_input: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT); + if (pcb->remote_port == tcphdr->src && + pcb->local_port == tcphdr->dest && + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()) && + ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + /* We don't really care enough to move this PCB to the front + of the list since we are not very likely to receive that + many segments for connections in TIME-WAIT. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for TIME_WAITing connection.\n")); + tcp_timewait_input(pcb); + pbuf_free(p); + return; + } + } + + /* Finally, if we still did not get a match, we check all PCBs that + are LISTENing for incoming connections. */ + prev = NULL; + for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + if (lpcb->local_port == tcphdr->dest) { + if (IP_IS_ANY_TYPE_VAL(lpcb->local_ip)) { + /* found an ANY TYPE (IPv4/IPv6) match */ +#if SO_REUSE + lpcb_any = lpcb; + lpcb_prev = prev; +#else /* SO_REUSE */ + break; +#endif /* SO_REUSE */ + } else if (IP_ADDR_PCB_VERSION_MATCH_EXACT(lpcb, ip_current_dest_addr())) { + if (ip_addr_cmp(&lpcb->local_ip, ip_current_dest_addr())) { + /* found an exact match */ + break; + } else if (ip_addr_isany(&lpcb->local_ip)) { + /* found an ANY-match */ +#if SO_REUSE + lpcb_any = lpcb; + lpcb_prev = prev; +#else /* SO_REUSE */ + break; + #endif /* SO_REUSE */ + } + } + } + prev = (struct tcp_pcb *)lpcb; + } +#if SO_REUSE + /* first try specific local IP */ + if (lpcb == NULL) { + /* only pass to ANY if no specific local IP has been found */ + lpcb = lpcb_any; + prev = lpcb_prev; + } +#endif /* SO_REUSE */ + if (lpcb != NULL) { + /* Move this PCB to the front of the list so that subsequent + lookups will be faster (we exploit locality in TCP segment + arrivals). */ + if (prev != NULL) { + ((struct tcp_pcb_listen *)prev)->next = lpcb->next; + /* our successor is the remainder of the listening list */ + lpcb->next = tcp_listen_pcbs.listen_pcbs; + /* put this listening pcb at the head of the listening list */ + tcp_listen_pcbs.listen_pcbs = lpcb; + } else { + TCP_STATS_INC(tcp.cachehit); + } + + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n")); + tcp_listen_input(lpcb); + pbuf_free(p); + return; + } + } + +#if TCP_INPUT_DEBUG + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags ")); + tcp_debug_print_flags(TCPH_FLAGS(tcphdr)); + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n")); +#endif /* TCP_INPUT_DEBUG */ + + + if (pcb != NULL) { + /* The incoming segment belongs to a connection. */ +#if TCP_INPUT_DEBUG + tcp_debug_print_state(pcb->state); +#endif /* TCP_INPUT_DEBUG */ + + /* Set up a tcp_seg structure. */ + inseg.next = NULL; + inseg.len = p->tot_len; + inseg.p = p; + inseg.tcphdr = tcphdr; + + recv_data = NULL; + recv_flags = 0; + recv_acked = 0; + + if (flags & TCP_PSH) { + p->flags |= PBUF_FLAG_PUSH; + } + + /* If there is data which was previously "refused" by upper layer */ + if (pcb->refused_data != NULL) { + if ((tcp_process_refused_data(pcb) == ERR_ABRT) || + ((pcb->refused_data != NULL) && (tcplen > 0))) { + /* pcb has been aborted or refused data is still refused and the new + segment contains data */ + if (pcb->rcv_ann_wnd == 0) { + /* this is a zero-window probe, we respond to it with current RCV.NXT + and drop the data segment */ + tcp_send_empty_ack(pcb); + } + TCP_STATS_INC(tcp.drop); + MIB2_STATS_INC(mib2.tcpinerrs); + goto aborted; + } + } + tcp_input_pcb = pcb; + err = tcp_process(pcb); + /* A return value of ERR_ABRT means that tcp_abort() was called + and that the pcb has been freed. If so, we don't do anything. */ + if (err != ERR_ABRT) { + if (recv_flags & TF_RESET) { + /* TF_RESET means that the connection was reset by the other + end. We then call the error callback to inform the + application that the connection is dead before we + deallocate the PCB. */ + TCP_EVENT_ERR(pcb->state, pcb->errf, pcb->callback_arg, ERR_RST); + tcp_pcb_remove(&tcp_active_pcbs, pcb); + memp_free(MEMP_TCP_PCB, pcb); + } else { + err = ERR_OK; + /* If the application has registered a "sent" function to be + called when new send buffer space is available, we call it + now. */ + if (recv_acked > 0) { + u16_t acked16; +#if LWIP_WND_SCALE + /* recv_acked is u32_t but the sent callback only takes a u16_t, + so we might have to call it multiple times. */ + u32_t acked = recv_acked; + while (acked > 0) { + acked16 = (u16_t)LWIP_MIN(acked, 0xffffu); + acked -= acked16; +#else + { + acked16 = recv_acked; +#endif + TCP_EVENT_SENT(pcb, (u16_t)acked16, err); + if (err == ERR_ABRT) { + goto aborted; + } + } + recv_acked = 0; + } + if (recv_flags & TF_CLOSED) { + /* The connection has been closed and we will deallocate the + PCB. */ + if (!(pcb->flags & TF_RXCLOSED)) { + /* Connection closed although the application has only shut down the + tx side: call the PCB's err callback and indicate the closure to + ensure the application doesn't continue using the PCB. */ + TCP_EVENT_ERR(pcb->state, pcb->errf, pcb->callback_arg, ERR_CLSD); + } + tcp_pcb_remove(&tcp_active_pcbs, pcb); + memp_free(MEMP_TCP_PCB, pcb); + goto aborted; + } +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + while (recv_data != NULL) { + struct pbuf *rest = NULL; + pbuf_split_64k(recv_data, &rest); +#else /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + if (recv_data != NULL) { +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + + LWIP_ASSERT("pcb->refused_data == NULL", pcb->refused_data == NULL); + if (pcb->flags & TF_RXCLOSED) { + /* received data although already closed -> abort (send RST) to + notify the remote host that not all data has been processed */ + pbuf_free(recv_data); +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_free(rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + tcp_abort(pcb); + goto aborted; + } + + /* Notify application that data has been received. */ + TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err); + if (err == ERR_ABRT) { +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_free(rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + goto aborted; + } + + /* If the upper layer can't receive this data, store it */ + if (err != ERR_OK) { +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + if (rest != NULL) { + pbuf_cat(recv_data, rest); + } +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + pcb->refused_data = recv_data; + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: keep incoming packet, because pcb is \"full\"\n")); +#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE + break; + } else { + /* Upper layer received the data, go on with the rest if > 64K */ + recv_data = rest; +#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + } + } + + /* If a FIN segment was received, we call the callback + function with a NULL buffer to indicate EOF. */ + if (recv_flags & TF_GOT_FIN) { + if (pcb->refused_data != NULL) { + /* Delay this if we have refused data. */ + pcb->refused_data->flags |= PBUF_FLAG_TCP_FIN; + } else { + /* correct rcv_wnd as the application won't call tcp_recved() + for the FIN's seqno */ + if (pcb->rcv_wnd != TCP_WND_MAX(pcb)) { + pcb->rcv_wnd++; + } + TCP_EVENT_CLOSED(pcb, err); + if (err == ERR_ABRT) { + goto aborted; + } + } + } + + tcp_input_pcb = NULL; + /* Try to send something out. */ + tcp_output(pcb); +#if TCP_INPUT_DEBUG +#if TCP_DEBUG + tcp_debug_print_state(pcb->state); +#endif /* TCP_DEBUG */ +#endif /* TCP_INPUT_DEBUG */ + } + } + /* Jump target if pcb has been aborted in a callback (by calling tcp_abort()). + Below this line, 'pcb' may not be dereferenced! */ +aborted: + tcp_input_pcb = NULL; + recv_data = NULL; + + /* give up our reference to inseg.p */ + if (inseg.p != NULL) + { + pbuf_free(inseg.p); + inseg.p = NULL; + } + } else { + + /* If no matching PCB was found, send a TCP RST (reset) to the + sender. */ + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n")); + if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) { + TCP_STATS_INC(tcp.proterr); + TCP_STATS_INC(tcp.drop); + tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + } + pbuf_free(p); + } + + LWIP_ASSERT("tcp_input: tcp_pcbs_sane()", tcp_pcbs_sane()); + PERF_STOP("tcp_input"); + return; +dropped: + TCP_STATS_INC(tcp.drop); + MIB2_STATS_INC(mib2.tcpinerrs); + pbuf_free(p); +} + +/** + * Called by tcp_input() when a segment arrives for a listening + * connection (from tcp_input()). + * + * @param pcb the tcp_pcb_listen for which a segment arrived + * + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static void +tcp_listen_input(struct tcp_pcb_listen *pcb) +{ + struct tcp_pcb *npcb; + u32_t iss; + err_t rc; + + if (flags & TCP_RST) { + /* An incoming RST should be ignored. Return. */ + return; + } + + /* In the LISTEN state, we check for incoming SYN segments, + creates a new PCB, and responds with a SYN|ACK. */ + if (flags & TCP_ACK) { + /* For incoming segments with the ACK flag set, respond with a + RST. */ + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n")); + tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + } else if (flags & TCP_SYN) { + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection request %"U16_F" -> %"U16_F".\n", tcphdr->src, tcphdr->dest)); +#if TCP_LISTEN_BACKLOG + if (pcb->accepts_pending >= pcb->backlog) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: listen backlog exceeded for port %"U16_F"\n", tcphdr->dest)); + return; + } +#endif /* TCP_LISTEN_BACKLOG */ + npcb = tcp_alloc(pcb->prio); + /* If a new PCB could not be created (probably due to lack of memory), + we don't do anything, but rely on the sender will retransmit the + SYN at a time when we have more memory available. */ + if (npcb == NULL) { + err_t err; + LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: could not allocate PCB\n")); + TCP_STATS_INC(tcp.memerr); + TCP_EVENT_ACCEPT(pcb, NULL, pcb->callback_arg, ERR_MEM, err); + LWIP_UNUSED_ARG(err); /* err not useful here */ + return; + } +#if TCP_LISTEN_BACKLOG + pcb->accepts_pending++; + npcb->flags |= TF_BACKLOGPEND; +#endif /* TCP_LISTEN_BACKLOG */ + /* Set up the new PCB. */ + ip_addr_copy(npcb->local_ip, *ip_current_dest_addr()); + ip_addr_copy(npcb->remote_ip, *ip_current_src_addr()); + npcb->local_port = pcb->local_port; + npcb->remote_port = tcphdr->src; + npcb->state = SYN_RCVD; + npcb->rcv_nxt = seqno + 1; + npcb->rcv_ann_right_edge = npcb->rcv_nxt; + iss = tcp_next_iss(npcb); + npcb->snd_wl2 = iss; + npcb->snd_nxt = iss; + npcb->lastack = iss; + npcb->snd_lbb = iss; + npcb->snd_wl1 = seqno - 1;/* initialise to seqno-1 to force window update */ + npcb->callback_arg = pcb->callback_arg; +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG + npcb->listener = pcb; +#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ + /* inherit socket options */ + npcb->so_options = pcb->so_options & SOF_INHERITED; + /* Register the new PCB so that we can begin receiving segments + for it. */ + TCP_REG_ACTIVE(npcb); + + /* Parse any options in the SYN. */ + tcp_parseopt(npcb); + npcb->snd_wnd = tcphdr->wnd; + npcb->snd_wnd_max = npcb->snd_wnd; + +#if TCP_CALCULATE_EFF_SEND_MSS + npcb->mss = tcp_eff_send_mss(npcb->mss, &npcb->local_ip, &npcb->remote_ip); +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + + MIB2_STATS_INC(mib2.tcppassiveopens); + + /* Send a SYN|ACK together with the MSS option. */ + rc = tcp_enqueue_flags(npcb, TCP_SYN | TCP_ACK); + if (rc != ERR_OK) { + tcp_abandon(npcb, 0); + return; + } + tcp_output(npcb); + } + return; +} + +/** + * Called by tcp_input() when a segment arrives for a connection in + * TIME_WAIT. + * + * @param pcb the tcp_pcb for which a segment arrived + * + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static void +tcp_timewait_input(struct tcp_pcb *pcb) +{ + /* RFC 1337: in TIME_WAIT, ignore RST and ACK FINs + any 'acceptable' segments */ + /* RFC 793 3.9 Event Processing - Segment Arrives: + * - first check sequence number - we skip that one in TIME_WAIT (always + * acceptable since we only send ACKs) + * - second check the RST bit (... return) */ + if (flags & TCP_RST) { + return; + } + /* - fourth, check the SYN bit, */ + if (flags & TCP_SYN) { + /* If an incoming segment is not acceptable, an acknowledgment + should be sent in reply */ + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd)) { + /* If the SYN is in the window it is an error, send a reset */ + tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + return; + } + } else if (flags & TCP_FIN) { + /* - eighth, check the FIN bit: Remain in the TIME-WAIT state. + Restart the 2 MSL time-wait timeout.*/ + pcb->tmr = tcp_ticks; + } + + if ((tcplen > 0)) { + /* Acknowledge data, FIN or out-of-window SYN */ + pcb->flags |= TF_ACK_NOW; + tcp_output(pcb); + } + return; +} + +/** + * Implements the TCP state machine. Called by tcp_input. In some + * states tcp_receive() is called to receive data. The tcp_seg + * argument will be freed by the caller (tcp_input()) unless the + * recv_data pointer in the pcb is set. + * + * @param pcb the tcp_pcb for which a segment arrived + * + * @note the segment which arrived is saved in global variables, therefore only the pcb + * involved is passed as a parameter to this function + */ +static err_t +tcp_process(struct tcp_pcb *pcb) +{ + struct tcp_seg *rseg; + u8_t acceptable = 0; + err_t err; + + err = ERR_OK; + + /* Process incoming RST segments. */ + if (flags & TCP_RST) { + /* First, determine if the reset is acceptable. */ + if (pcb->state == SYN_SENT) { + /* "In the SYN-SENT state (a RST received in response to an initial SYN), + the RST is acceptable if the ACK field acknowledges the SYN." */ + if (ackno == pcb->snd_nxt) { + acceptable = 1; + } + } else { + /* "In all states except SYN-SENT, all reset (RST) segments are validated + by checking their SEQ-fields." */ + if (seqno == pcb->rcv_nxt) { + acceptable = 1; + } else if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + pcb->rcv_nxt + pcb->rcv_wnd)) { + /* If the sequence number is inside the window, we only send an ACK + and wait for a re-send with matching sequence number. + This violates RFC 793, but is required to protection against + CVE-2004-0230 (RST spoofing attack). */ + tcp_ack_now(pcb); + } + } + + if (acceptable) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: Connection RESET\n")); + LWIP_ASSERT("tcp_input: pcb->state != CLOSED", pcb->state != CLOSED); + recv_flags |= TF_RESET; + pcb->flags &= ~TF_ACK_DELAY; + return ERR_RST; + } else { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_process: unacceptable reset seqno %"U32_F" rcv_nxt %"U32_F"\n", + seqno, pcb->rcv_nxt)); + LWIP_DEBUGF(TCP_DEBUG, ("tcp_process: unacceptable reset seqno %"U32_F" rcv_nxt %"U32_F"\n", + seqno, pcb->rcv_nxt)); + return ERR_OK; + } + } + + if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { + /* Cope with new connection attempt after remote end crashed */ + tcp_ack_now(pcb); + return ERR_OK; + } + + if ((pcb->flags & TF_RXCLOSED) == 0) { + /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */ + pcb->tmr = tcp_ticks; + } + pcb->keep_cnt_sent = 0; + + tcp_parseopt(pcb); + + /* Do different things depending on the TCP state. */ + switch (pcb->state) { + case SYN_SENT: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("SYN-SENT: ackno %"U32_F" pcb->snd_nxt %"U32_F" unacked %"U32_F"\n", ackno, + pcb->snd_nxt, lwip_ntohl(pcb->unacked->tcphdr->seqno))); + /* received SYN ACK with expected sequence number? */ + if ((flags & TCP_ACK) && (flags & TCP_SYN) + && (ackno == pcb->lastack + 1)) { + pcb->rcv_nxt = seqno + 1; + pcb->rcv_ann_right_edge = pcb->rcv_nxt; + pcb->lastack = ackno; + pcb->snd_wnd = tcphdr->wnd; + pcb->snd_wnd_max = pcb->snd_wnd; + pcb->snd_wl1 = seqno - 1; /* initialise to seqno - 1 to force window update */ + pcb->state = ESTABLISHED; + +#if TCP_CALCULATE_EFF_SEND_MSS + pcb->mss = tcp_eff_send_mss(pcb->mss, &pcb->local_ip, &pcb->remote_ip); +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + + pcb->cwnd = LWIP_TCP_CALC_INITIAL_CWND(pcb->mss); + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_process (SENT): cwnd %"TCPWNDSIZE_F + " ssthresh %"TCPWNDSIZE_F"\n", + pcb->cwnd, pcb->ssthresh)); + LWIP_ASSERT("pcb->snd_queuelen > 0", (pcb->snd_queuelen > 0)); + --pcb->snd_queuelen; + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"TCPWNDSIZE_F"\n", (tcpwnd_size_t)pcb->snd_queuelen)); + rseg = pcb->unacked; + if (rseg == NULL) { + /* might happen if tcp_output fails in tcp_rexmit_rto() + in which case the segment is on the unsent list */ + rseg = pcb->unsent; + LWIP_ASSERT("no segment to free", rseg != NULL); + pcb->unsent = rseg->next; + } else { + pcb->unacked = rseg->next; + } + tcp_seg_free(rseg); + + /* If there's nothing left to acknowledge, stop the retransmit + timer, otherwise reset it to start again */ + if (pcb->unacked == NULL) { + pcb->rtime = -1; + } else { + pcb->rtime = 0; + pcb->nrtx = 0; + } + + /* Call the user specified function to call when successfully + * connected. */ + TCP_EVENT_CONNECTED(pcb, ERR_OK, err); + if (err == ERR_ABRT) { + return ERR_ABRT; + } + tcp_ack_now(pcb); + } + /* received ACK? possibly a half-open connection */ + else if (flags & TCP_ACK) { + /* send a RST to bring the other side in a non-synchronized state. */ + tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + /* Resend SYN immediately (don't wait for rto timeout) to establish + connection faster, but do not send more SYNs than we otherwise would + have, or we might get caught in a loop on loopback interfaces. */ + if (pcb->nrtx < TCP_SYNMAXRTX) { + pcb->rtime = 0; + tcp_rexmit_rto(pcb); + } + } + break; + case SYN_RCVD: + if (flags & TCP_ACK) { + /* expected ACK number? */ + if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) { + pcb->state = ESTABLISHED; + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection established %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG +#if LWIP_CALLBACK_API + LWIP_ASSERT("pcb->listener->accept != NULL", + (pcb->listener == NULL) || (pcb->listener->accept != NULL)); +#endif + if (pcb->listener == NULL) { + /* listen pcb might be closed by now */ + err = ERR_VAL; + } else +#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ + { + tcp_backlog_accepted(pcb); + /* Call the accept function. */ + TCP_EVENT_ACCEPT(pcb->listener, pcb, pcb->callback_arg, ERR_OK, err); + } + if (err != ERR_OK) { + /* If the accept function returns with an error, we abort + * the connection. */ + /* Already aborted? */ + if (err != ERR_ABRT) { + tcp_abort(pcb); + } + return ERR_ABRT; + } + /* If there was any data contained within this ACK, + * we'd better pass it on to the application as well. */ + tcp_receive(pcb); + + /* Prevent ACK for SYN to generate a sent event */ + if (recv_acked != 0) { + recv_acked--; + } + + pcb->cwnd = LWIP_TCP_CALC_INITIAL_CWND(pcb->mss); + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_process (SYN_RCVD): cwnd %"TCPWNDSIZE_F + " ssthresh %"TCPWNDSIZE_F"\n", + pcb->cwnd, pcb->ssthresh)); + + if (recv_flags & TF_GOT_FIN) { + tcp_ack_now(pcb); + pcb->state = CLOSE_WAIT; + } + } else { + /* incorrect ACK number, send RST */ + tcp_rst(ackno, seqno + tcplen, ip_current_dest_addr(), + ip_current_src_addr(), tcphdr->dest, tcphdr->src); + } + } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) { + /* Looks like another copy of the SYN - retransmit our SYN-ACK */ + tcp_rexmit(pcb); + } + break; + case CLOSE_WAIT: + /* FALLTHROUGH */ + case ESTABLISHED: + tcp_receive(pcb); + if (recv_flags & TF_GOT_FIN) { /* passive close */ + tcp_ack_now(pcb); + pcb->state = CLOSE_WAIT; + } + break; + case FIN_WAIT_1: + tcp_receive(pcb); + if (recv_flags & TF_GOT_FIN) { + if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + pcb->unsent == NULL) { + LWIP_DEBUGF(TCP_DEBUG, + ("TCP connection closed: FIN_WAIT_1 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_ack_now(pcb); + tcp_pcb_purge(pcb); + TCP_RMV_ACTIVE(pcb); + pcb->state = TIME_WAIT; + TCP_REG(&tcp_tw_pcbs, pcb); + } else { + tcp_ack_now(pcb); + pcb->state = CLOSING; + } + } else if ((flags & TCP_ACK) && (ackno == pcb->snd_nxt) && + pcb->unsent == NULL) { + pcb->state = FIN_WAIT_2; + } + break; + case FIN_WAIT_2: + tcp_receive(pcb); + if (recv_flags & TF_GOT_FIN) { + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: FIN_WAIT_2 %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_ack_now(pcb); + tcp_pcb_purge(pcb); + TCP_RMV_ACTIVE(pcb); + pcb->state = TIME_WAIT; + TCP_REG(&tcp_tw_pcbs, pcb); + } + break; + case CLOSING: + tcp_receive(pcb); + if ((flags & TCP_ACK) && ackno == pcb->snd_nxt && pcb->unsent == NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: CLOSING %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + tcp_pcb_purge(pcb); + TCP_RMV_ACTIVE(pcb); + pcb->state = TIME_WAIT; + TCP_REG(&tcp_tw_pcbs, pcb); + } + break; + case LAST_ACK: + tcp_receive(pcb); + if ((flags & TCP_ACK) && ackno == pcb->snd_nxt && pcb->unsent == NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("TCP connection closed: LAST_ACK %"U16_F" -> %"U16_F".\n", inseg.tcphdr->src, inseg.tcphdr->dest)); + /* bugfix #21699: don't set pcb->state to CLOSED here or we risk leaking segments */ + recv_flags |= TF_CLOSED; + } + break; + default: + break; + } + return ERR_OK; +} + +#if TCP_QUEUE_OOSEQ +/** + * Insert segment into the list (segments covered with new one will be deleted) + * + * Called from tcp_receive() + */ +static void +tcp_oos_insert_segment(struct tcp_seg *cseg, struct tcp_seg *next) +{ + struct tcp_seg *old_seg; + + if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) { + /* received segment overlaps all following segments */ + tcp_segs_free(next); + next = NULL; + } else { + /* delete some following segments + oos queue may have segments with FIN flag */ + while (next && + TCP_SEQ_GEQ((seqno + cseg->len), + (next->tcphdr->seqno + next->len))) { + /* cseg with FIN already processed */ + if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) { + TCPH_SET_FLAG(cseg->tcphdr, TCP_FIN); + } + old_seg = next; + next = next->next; + tcp_seg_free(old_seg); + } + if (next && + TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) { + /* We need to trim the incoming segment. */ + cseg->len = (u16_t)(next->tcphdr->seqno - seqno); + pbuf_realloc(cseg->p, cseg->len); + } + } + cseg->next = next; +} +#endif /* TCP_QUEUE_OOSEQ */ + +/** + * Called by tcp_process. Checks if the given segment is an ACK for outstanding + * data, and if so frees the memory of the buffered data. Next, it places the + * segment on any of the receive queues (pcb->recved or pcb->ooseq). If the segment + * is buffered, the pbuf is referenced by pbuf_ref so that it will not be freed until + * it has been removed from the buffer. + * + * If the incoming segment constitutes an ACK for a segment that was used for RTT + * estimation, the RTT is estimated here as well. + * + * Called from tcp_process(). + */ +static void +tcp_receive(struct tcp_pcb *pcb) +{ + struct tcp_seg *next; +#if TCP_QUEUE_OOSEQ + struct tcp_seg *prev, *cseg; +#endif /* TCP_QUEUE_OOSEQ */ + s32_t off; + s16_t m; + u32_t right_wnd_edge; + u16_t new_tot_len; + int found_dupack = 0; +#if TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS + u32_t ooseq_blen; + u16_t ooseq_qlen; +#endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */ + + LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED); + + if (flags & TCP_ACK) { + right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2; + + /* Update window. */ + if (TCP_SEQ_LT(pcb->snd_wl1, seqno) || + (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) || + (pcb->snd_wl2 == ackno && (u32_t)SND_WND_SCALE(pcb, tcphdr->wnd) > pcb->snd_wnd)) { + pcb->snd_wnd = SND_WND_SCALE(pcb, tcphdr->wnd); + /* keep track of the biggest window announced by the remote host to calculate + the maximum segment size */ + if (pcb->snd_wnd_max < pcb->snd_wnd) { + pcb->snd_wnd_max = pcb->snd_wnd; + } + pcb->snd_wl1 = seqno; + pcb->snd_wl2 = ackno; + if (pcb->snd_wnd == 0) { + if (pcb->persist_backoff == 0) { + /* start persist timer */ + pcb->persist_cnt = 0; + pcb->persist_backoff = 1; + } + } else if (pcb->persist_backoff > 0) { + /* stop persist timer */ + pcb->persist_backoff = 0; + } + LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: window update %"TCPWNDSIZE_F"\n", pcb->snd_wnd)); +#if TCP_WND_DEBUG + } else { + if (pcb->snd_wnd != (tcpwnd_size_t)SND_WND_SCALE(pcb, tcphdr->wnd)) { + LWIP_DEBUGF(TCP_WND_DEBUG, + ("tcp_receive: no window update lastack %"U32_F" ackno %" + U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", + pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2)); + } +#endif /* TCP_WND_DEBUG */ + } + + /* (From Stevens TCP/IP Illustrated Vol II, p970.) Its only a + * duplicate ack if: + * 1) It doesn't ACK new data + * 2) length of received packet is zero (i.e. no payload) + * 3) the advertised window hasn't changed + * 4) There is outstanding unacknowledged data (retransmission timer running) + * 5) The ACK is == biggest ACK sequence number so far seen (snd_una) + * + * If it passes all five, should process as a dupack: + * a) dupacks < 3: do nothing + * b) dupacks == 3: fast retransmit + * c) dupacks > 3: increase cwnd + * + * If it only passes 1-3, should reset dupack counter (and add to + * stats, which we don't do in lwIP) + * + * If it only passes 1, should reset dupack counter + * + */ + + /* Clause 1 */ + if (TCP_SEQ_LEQ(ackno, pcb->lastack)) { + /* Clause 2 */ + if (tcplen == 0) { + /* Clause 3 */ + if (pcb->snd_wl2 + pcb->snd_wnd == right_wnd_edge) { + /* Clause 4 */ + if (pcb->rtime >= 0) { + /* Clause 5 */ + if (pcb->lastack == ackno) { + found_dupack = 1; + if ((u8_t)(pcb->dupacks + 1) > pcb->dupacks) { + ++pcb->dupacks; + } + if (pcb->dupacks > 3) { + /* Inflate the congestion window, but not if it means that + the value overflows. */ + if ((tcpwnd_size_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) { + pcb->cwnd += pcb->mss; + } + } else if (pcb->dupacks == 3) { + /* Do fast retransmit */ + tcp_rexmit_fast(pcb); + } + } + } + } + } + /* If Clause (1) or more is true, but not a duplicate ack, reset + * count of consecutive duplicate acks */ + if (!found_dupack) { + pcb->dupacks = 0; + } + } else if (TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)) { + /* We come here when the ACK acknowledges new data. */ + + /* Reset the "IN Fast Retransmit" flag, since we are no longer + in fast retransmit. Also reset the congestion window to the + slow start threshold. */ + if (pcb->flags & TF_INFR) { + pcb->flags &= ~TF_INFR; + pcb->cwnd = pcb->ssthresh; + } + + /* Reset the number of retransmissions. */ + pcb->nrtx = 0; + + /* Reset the retransmission time-out. */ + pcb->rto = (pcb->sa >> 3) + pcb->sv; + + /* Reset the fast retransmit variables. */ + pcb->dupacks = 0; + pcb->lastack = ackno; + + /* Update the congestion control variables (cwnd and + ssthresh). */ + if (pcb->state >= ESTABLISHED) { + if (pcb->cwnd < pcb->ssthresh) { + if ((tcpwnd_size_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) { + pcb->cwnd += pcb->mss; + } + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %"TCPWNDSIZE_F"\n", pcb->cwnd)); + } else { + tcpwnd_size_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd); + if (new_cwnd > pcb->cwnd) { + pcb->cwnd = new_cwnd; + } + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: congestion avoidance cwnd %"TCPWNDSIZE_F"\n", pcb->cwnd)); + } + } + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: ACK for %"U32_F", unacked->seqno %"U32_F":%"U32_F"\n", + ackno, + pcb->unacked != NULL? + lwip_ntohl(pcb->unacked->tcphdr->seqno): 0, + pcb->unacked != NULL? + lwip_ntohl(pcb->unacked->tcphdr->seqno) + TCP_TCPLEN(pcb->unacked): 0)); + + /* Remove segment from the unacknowledged list if the incoming + ACK acknowledges them. */ + while (pcb->unacked != NULL && + TCP_SEQ_LEQ(lwip_ntohl(pcb->unacked->tcphdr->seqno) + + TCP_TCPLEN(pcb->unacked), ackno)) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unacked\n", + lwip_ntohl(pcb->unacked->tcphdr->seqno), + lwip_ntohl(pcb->unacked->tcphdr->seqno) + + TCP_TCPLEN(pcb->unacked))); + + next = pcb->unacked; + pcb->unacked = pcb->unacked->next; + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"TCPWNDSIZE_F" ... ", (tcpwnd_size_t)pcb->snd_queuelen)); + LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p))); + + pcb->snd_queuelen -= pbuf_clen(next->p); + recv_acked += next->len; + tcp_seg_free(next); + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"TCPWNDSIZE_F" (after freeing unacked)\n", (tcpwnd_size_t)pcb->snd_queuelen)); + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL || + pcb->unsent != NULL); + } + } + + /* If there's nothing left to acknowledge, stop the retransmit + timer, otherwise reset it to start again */ + if (pcb->unacked == NULL) { + pcb->rtime = -1; + } else { + pcb->rtime = 0; + } + + pcb->polltmr = 0; + +#if LWIP_IPV6 && LWIP_ND6_TCP_REACHABILITY_HINTS + if (ip_current_is_v6()) { + /* Inform neighbor reachability of forward progress. */ + nd6_reachability_hint(ip6_current_src_addr()); + } +#endif /* LWIP_IPV6 && LWIP_ND6_TCP_REACHABILITY_HINTS*/ + } else { + /* Out of sequence ACK, didn't really ack anything */ + tcp_send_empty_ack(pcb); + } + + /* We go through the ->unsent list to see if any of the segments + on the list are acknowledged by the ACK. This may seem + strange since an "unsent" segment shouldn't be acked. The + rationale is that lwIP puts all outstanding segments on the + ->unsent list after a retransmission, so these segments may + in fact have been sent once. */ + while (pcb->unsent != NULL && + TCP_SEQ_BETWEEN(ackno, lwip_ntohl(pcb->unsent->tcphdr->seqno) + + TCP_TCPLEN(pcb->unsent), pcb->snd_nxt)) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n", + lwip_ntohl(pcb->unsent->tcphdr->seqno), lwip_ntohl(pcb->unsent->tcphdr->seqno) + + TCP_TCPLEN(pcb->unsent))); + + next = pcb->unsent; + pcb->unsent = pcb->unsent->next; +#if TCP_OVERSIZE + if (pcb->unsent == NULL) { + pcb->unsent_oversize = 0; + } +#endif /* TCP_OVERSIZE */ + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"TCPWNDSIZE_F" ... ", (tcpwnd_size_t)pcb->snd_queuelen)); + LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p))); + /* Prevent ACK for FIN to generate a sent event */ + pcb->snd_queuelen -= pbuf_clen(next->p); + recv_acked += next->len; + tcp_seg_free(next); + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"TCPWNDSIZE_F" (after freeing unsent)\n", (tcpwnd_size_t)pcb->snd_queuelen)); + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_receive: valid queue length", + pcb->unacked != NULL || pcb->unsent != NULL); + } + } + pcb->snd_buf += recv_acked; + /* End of ACK for new data processing. */ + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: pcb->rttest %"U32_F" rtseq %"U32_F" ackno %"U32_F"\n", + pcb->rttest, pcb->rtseq, ackno)); + + /* RTT estimation calculations. This is done by checking if the + incoming segment acknowledges the segment we use to take a + round-trip time measurement. */ + if (pcb->rttest && TCP_SEQ_LT(pcb->rtseq, ackno)) { + /* diff between this shouldn't exceed 32K since this are tcp timer ticks + and a round-trip shouldn't be that long... */ + m = (s16_t)(tcp_ticks - pcb->rttest); + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: experienced rtt %"U16_F" ticks (%"U16_F" msec).\n", + m, (u16_t)(m * TCP_SLOW_INTERVAL))); + + /* This is taken directly from VJs original code in his paper */ + m = m - (pcb->sa >> 3); + pcb->sa += m; + if (m < 0) { + m = -m; + } + m = m - (pcb->sv >> 2); + pcb->sv += m; + pcb->rto = (pcb->sa >> 3) + pcb->sv; + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_receive: RTO %"U16_F" (%"U16_F" milliseconds)\n", + pcb->rto, (u16_t)(pcb->rto * TCP_SLOW_INTERVAL))); + + pcb->rttest = 0; + } + } + + /* If the incoming segment contains data, we must process it + further unless the pcb already received a FIN. + (RFC 793, chapter 3.9, "SEGMENT ARRIVES" in states CLOSE-WAIT, CLOSING, + LAST-ACK and TIME-WAIT: "Ignore the segment text.") */ + if ((tcplen > 0) && (pcb->state < CLOSE_WAIT)) { + /* This code basically does three things: + + +) If the incoming segment contains data that is the next + in-sequence data, this data is passed to the application. This + might involve trimming the first edge of the data. The rcv_nxt + variable and the advertised window are adjusted. + + +) If the incoming segment has data that is above the next + sequence number expected (->rcv_nxt), the segment is placed on + the ->ooseq queue. This is done by finding the appropriate + place in the ->ooseq queue (which is ordered by sequence + number) and trim the segment in both ends if needed. An + immediate ACK is sent to indicate that we received an + out-of-sequence segment. + + +) Finally, we check if the first segment on the ->ooseq queue + now is in sequence (i.e., if rcv_nxt >= ooseq->seqno). If + rcv_nxt > ooseq->seqno, we must trim the first edge of the + segment on ->ooseq before we adjust rcv_nxt. The data in the + segments that are now on sequence are chained onto the + incoming segment so that we only need to call the application + once. + */ + + /* First, we check if we must trim the first edge. We have to do + this if the sequence number of the incoming segment is less + than rcv_nxt, and the sequence number plus the length of the + segment is larger than rcv_nxt. */ + /* if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) { + if (TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {*/ + if (TCP_SEQ_BETWEEN(pcb->rcv_nxt, seqno + 1, seqno + tcplen - 1)) { + /* Trimming the first edge is done by pushing the payload + pointer in the pbuf downwards. This is somewhat tricky since + we do not want to discard the full contents of the pbuf up to + the new starting point of the data since we have to keep the + TCP header which is present in the first pbuf in the chain. + + What is done is really quite a nasty hack: the first pbuf in + the pbuf chain is pointed to by inseg.p. Since we need to be + able to deallocate the whole pbuf, we cannot change this + inseg.p pointer to point to any of the later pbufs in the + chain. Instead, we point the ->payload pointer in the first + pbuf to data in one of the later pbufs. We also set the + inseg.data pointer to point to the right place. This way, the + ->p pointer will still point to the first pbuf, but the + ->p->payload pointer will point to data in another pbuf. + + After we are done with adjusting the pbuf pointers we must + adjust the ->data pointer in the seg and the segment + length.*/ + + struct pbuf *p = inseg.p; + off = pcb->rcv_nxt - seqno; + LWIP_ASSERT("inseg.p != NULL", inseg.p); + LWIP_ASSERT("insane offset!", (off < 0x7fff)); + if (inseg.p->len < off) { + LWIP_ASSERT("pbuf too short!", (((s32_t)inseg.p->tot_len) >= off)); + new_tot_len = (u16_t)(inseg.p->tot_len - off); + while (p->len < off) { + off -= p->len; + /* KJM following line changed (with addition of new_tot_len var) + to fix bug #9076 + inseg.p->tot_len -= p->len; */ + p->tot_len = new_tot_len; + p->len = 0; + p = p->next; + } + if (pbuf_header(p, (s16_t)-off)) { + /* Do we need to cope with this failing? Assert for now */ + LWIP_ASSERT("pbuf_header failed", 0); + } + } else { + if (pbuf_header(inseg.p, (s16_t)-off)) { + /* Do we need to cope with this failing? Assert for now */ + LWIP_ASSERT("pbuf_header failed", 0); + } + } + inseg.len -= (u16_t)(pcb->rcv_nxt - seqno); + inseg.tcphdr->seqno = seqno = pcb->rcv_nxt; + } + else { + if (TCP_SEQ_LT(seqno, pcb->rcv_nxt)) { + /* the whole segment is < rcv_nxt */ + /* must be a duplicate of a packet that has already been correctly handled */ + + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %"U32_F"\n", seqno)); + tcp_ack_now(pcb); + } + } + + /* The sequence number must be within the window (above rcv_nxt + and below rcv_nxt + rcv_wnd) in order to be further + processed. */ + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + pcb->rcv_nxt + pcb->rcv_wnd - 1)) { + if (pcb->rcv_nxt == seqno) { + /* The incoming segment is the next in sequence. We check if + we have to trim the end of the segment and update rcv_nxt + and pass the data to the application. */ + tcplen = TCP_TCPLEN(&inseg); + + if (tcplen > pcb->rcv_wnd) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: other end overran receive window" + "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", + seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + /* Must remove the FIN from the header as we're trimming + * that byte of sequence-space from the packet */ + TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) & ~(unsigned int)TCP_FIN); + } + /* Adjust length of segment to fit in the window. */ + TCPWND_CHECK16(pcb->rcv_wnd); + inseg.len = (u16_t)pcb->rcv_wnd; + if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) { + inseg.len -= 1; + } + pbuf_realloc(inseg.p, inseg.len); + tcplen = TCP_TCPLEN(&inseg); + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + (seqno + tcplen) == (pcb->rcv_nxt + pcb->rcv_wnd)); + } +#if TCP_QUEUE_OOSEQ + /* Received in-sequence data, adjust ooseq data if: + - FIN has been received or + - inseq overlaps with ooseq */ + if (pcb->ooseq != NULL) { + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: received in-order FIN, binning ooseq queue\n")); + /* Received in-order FIN means anything that was received + * out of order must now have been received in-order, so + * bin the ooseq queue */ + while (pcb->ooseq != NULL) { + struct tcp_seg *old_ooseq = pcb->ooseq; + pcb->ooseq = pcb->ooseq->next; + tcp_seg_free(old_ooseq); + } + } else { + next = pcb->ooseq; + /* Remove all segments on ooseq that are covered by inseg already. + * FIN is copied from ooseq to inseg if present. */ + while (next && + TCP_SEQ_GEQ(seqno + tcplen, + next->tcphdr->seqno + next->len)) { + /* inseg cannot have FIN here (already processed above) */ + if ((TCPH_FLAGS(next->tcphdr) & TCP_FIN) != 0 && + (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) == 0) { + TCPH_SET_FLAG(inseg.tcphdr, TCP_FIN); + tcplen = TCP_TCPLEN(&inseg); + } + prev = next; + next = next->next; + tcp_seg_free(prev); + } + /* Now trim right side of inseg if it overlaps with the first + * segment on ooseq */ + if (next && + TCP_SEQ_GT(seqno + tcplen, + next->tcphdr->seqno)) { + /* inseg cannot have FIN here (already processed above) */ + inseg.len = (u16_t)(next->tcphdr->seqno - seqno); + if (TCPH_FLAGS(inseg.tcphdr) & TCP_SYN) { + inseg.len -= 1; + } + pbuf_realloc(inseg.p, inseg.len); + tcplen = TCP_TCPLEN(&inseg); + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to ooseq queue\n", + (seqno + tcplen) == next->tcphdr->seqno); + } + pcb->ooseq = next; + } + } +#endif /* TCP_QUEUE_OOSEQ */ + + pcb->rcv_nxt = seqno + tcplen; + + /* Update the receiver's (our) window. */ + LWIP_ASSERT("tcp_receive: tcplen > rcv_wnd\n", pcb->rcv_wnd >= tcplen); + pcb->rcv_wnd -= tcplen; + + tcp_update_rcv_ann_wnd(pcb); + + /* If there is data in the segment, we make preparations to + pass this up to the application. The ->recv_data variable + is used for holding the pbuf that goes to the + application. The code for reassembling out-of-sequence data + chains its data on this pbuf as well. + + If the segment was a FIN, we set the TF_GOT_FIN flag that will + be used to indicate to the application that the remote side has + closed its end of the connection. */ + if (inseg.p->tot_len > 0) { + recv_data = inseg.p; + /* Since this pbuf now is the responsibility of the + application, we delete our reference to it so that we won't + (mistakingly) deallocate it. */ + inseg.p = NULL; + } + if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received FIN.\n")); + recv_flags |= TF_GOT_FIN; + } + +#if TCP_QUEUE_OOSEQ + /* We now check if we have segments on the ->ooseq queue that + are now in sequence. */ + while (pcb->ooseq != NULL && + pcb->ooseq->tcphdr->seqno == pcb->rcv_nxt) { + + cseg = pcb->ooseq; + seqno = pcb->ooseq->tcphdr->seqno; + + pcb->rcv_nxt += TCP_TCPLEN(cseg); + LWIP_ASSERT("tcp_receive: ooseq tcplen > rcv_wnd\n", + pcb->rcv_wnd >= TCP_TCPLEN(cseg)); + pcb->rcv_wnd -= TCP_TCPLEN(cseg); + + tcp_update_rcv_ann_wnd(pcb); + + if (cseg->p->tot_len > 0) { + /* Chain this pbuf onto the pbuf that we will pass to + the application. */ + /* With window scaling, this can overflow recv_data->tot_len, but + that's not a problem since we explicitly fix that before passing + recv_data to the application. */ + if (recv_data) { + pbuf_cat(recv_data, cseg->p); + } else { + recv_data = cseg->p; + } + cseg->p = NULL; + } + if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: dequeued FIN.\n")); + recv_flags |= TF_GOT_FIN; + if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */ + pcb->state = CLOSE_WAIT; + } + } + + pcb->ooseq = cseg->next; + tcp_seg_free(cseg); + } +#endif /* TCP_QUEUE_OOSEQ */ + + + /* Acknowledge the segment(s). */ + tcp_ack(pcb); + +#if LWIP_IPV6 && LWIP_ND6_TCP_REACHABILITY_HINTS + if (ip_current_is_v6()) { + /* Inform neighbor reachability of forward progress. */ + nd6_reachability_hint(ip6_current_src_addr()); + } +#endif /* LWIP_IPV6 && LWIP_ND6_TCP_REACHABILITY_HINTS*/ + + } else { + /* We get here if the incoming segment is out-of-sequence. */ + tcp_send_empty_ack(pcb); +#if TCP_QUEUE_OOSEQ + /* We queue the segment on the ->ooseq queue. */ + if (pcb->ooseq == NULL) { + pcb->ooseq = tcp_seg_copy(&inseg); + } else { + /* If the queue is not empty, we walk through the queue and + try to find a place where the sequence number of the + incoming segment is between the sequence numbers of the + previous and the next segment on the ->ooseq queue. That is + the place where we put the incoming segment. If needed, we + trim the second edges of the previous and the incoming + segment so that it will fit into the sequence. + + If the incoming segment has the same sequence number as a + segment on the ->ooseq queue, we discard the segment that + contains less data. */ + + prev = NULL; + for (next = pcb->ooseq; next != NULL; next = next->next) { + if (seqno == next->tcphdr->seqno) { + /* The sequence number of the incoming segment is the + same as the sequence number of the segment on + ->ooseq. We check the lengths to see which one to + discard. */ + if (inseg.len > next->len) { + /* The incoming segment is larger than the old + segment. We replace some segments with the new + one. */ + cseg = tcp_seg_copy(&inseg); + if (cseg != NULL) { + if (prev != NULL) { + prev->next = cseg; + } else { + pcb->ooseq = cseg; + } + tcp_oos_insert_segment(cseg, next); + } + break; + } else { + /* Either the lengths are the same or the incoming + segment was smaller than the old one; in either + case, we ditch the incoming segment. */ + break; + } + } else { + if (prev == NULL) { + if (TCP_SEQ_LT(seqno, next->tcphdr->seqno)) { + /* The sequence number of the incoming segment is lower + than the sequence number of the first segment on the + queue. We put the incoming segment first on the + queue. */ + cseg = tcp_seg_copy(&inseg); + if (cseg != NULL) { + pcb->ooseq = cseg; + tcp_oos_insert_segment(cseg, next); + } + break; + } + } else { + /*if (TCP_SEQ_LT(prev->tcphdr->seqno, seqno) && + TCP_SEQ_LT(seqno, next->tcphdr->seqno)) {*/ + if (TCP_SEQ_BETWEEN(seqno, prev->tcphdr->seqno+1, next->tcphdr->seqno-1)) { + /* The sequence number of the incoming segment is in + between the sequence numbers of the previous and + the next segment on ->ooseq. We trim trim the previous + segment, delete next segments that included in received segment + and trim received, if needed. */ + cseg = tcp_seg_copy(&inseg); + if (cseg != NULL) { + if (TCP_SEQ_GT(prev->tcphdr->seqno + prev->len, seqno)) { + /* We need to trim the prev segment. */ + prev->len = (u16_t)(seqno - prev->tcphdr->seqno); + pbuf_realloc(prev->p, prev->len); + } + prev->next = cseg; + tcp_oos_insert_segment(cseg, next); + } + break; + } + } + /* If the "next" segment is the last segment on the + ooseq queue, we add the incoming segment to the end + of the list. */ + if (next->next == NULL && + TCP_SEQ_GT(seqno, next->tcphdr->seqno)) { + if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) { + /* segment "next" already contains all data */ + break; + } + next->next = tcp_seg_copy(&inseg); + if (next->next != NULL) { + if (TCP_SEQ_GT(next->tcphdr->seqno + next->len, seqno)) { + /* We need to trim the last segment. */ + next->len = (u16_t)(seqno - next->tcphdr->seqno); + pbuf_realloc(next->p, next->len); + } + /* check if the remote side overruns our receive window */ + if (TCP_SEQ_GT((u32_t)tcplen + seqno, pcb->rcv_nxt + (u32_t)pcb->rcv_wnd)) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, + ("tcp_receive: other end overran receive window" + "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", + seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); + if (TCPH_FLAGS(next->next->tcphdr) & TCP_FIN) { + /* Must remove the FIN from the header as we're trimming + * that byte of sequence-space from the packet */ + TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) & ~TCP_FIN); + } + /* Adjust length of segment to fit in the window. */ + next->next->len = (u16_t)(pcb->rcv_nxt + pcb->rcv_wnd - seqno); + pbuf_realloc(next->next->p, next->next->len); + tcplen = TCP_TCPLEN(next->next); + LWIP_ASSERT("tcp_receive: segment not trimmed correctly to rcv_wnd\n", + (seqno + tcplen) == (pcb->rcv_nxt + pcb->rcv_wnd)); + } + } + break; + } + } + prev = next; + } + } +#if TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS + /* Check that the data on ooseq doesn't exceed one of the limits + and throw away everything above that limit. */ + ooseq_blen = 0; + ooseq_qlen = 0; + prev = NULL; + for (next = pcb->ooseq; next != NULL; prev = next, next = next->next) { + struct pbuf *p = next->p; + ooseq_blen += p->tot_len; + ooseq_qlen += pbuf_clen(p); + if ((ooseq_blen > TCP_OOSEQ_MAX_BYTES) || + (ooseq_qlen > TCP_OOSEQ_MAX_PBUFS)) { + /* too much ooseq data, dump this and everything after it */ + tcp_segs_free(next); + if (prev == NULL) { + /* first ooseq segment is too much, dump the whole queue */ + pcb->ooseq = NULL; + } else { + /* just dump 'next' and everything after it */ + prev->next = NULL; + } + break; + } + } +#endif /* TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS */ +#endif /* TCP_QUEUE_OOSEQ */ + } + } else { + /* The incoming segment is not within the window. */ + tcp_send_empty_ack(pcb); + } + } else { + /* Segments with length 0 is taken care of here. Segments that + fall out of the window are ACKed. */ + if (!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd - 1)) { + tcp_ack_now(pcb); + } + } +} + +static u8_t +tcp_getoptbyte(void) +{ + if ((tcphdr_opt2 == NULL) || (tcp_optidx < tcphdr_opt1len)) { + u8_t* opts = (u8_t *)tcphdr + TCP_HLEN; + return opts[tcp_optidx++]; + } else { + u8_t idx = (u8_t)(tcp_optidx++ - tcphdr_opt1len); + return tcphdr_opt2[idx]; + } +} + +/** + * Parses the options contained in the incoming segment. + * + * Called from tcp_listen_input() and tcp_process(). + * Currently, only the MSS option is supported! + * + * @param pcb the tcp_pcb for which a segment arrived + */ +static void +tcp_parseopt(struct tcp_pcb *pcb) +{ + u8_t data; + u16_t mss; +#if LWIP_TCP_TIMESTAMPS + u32_t tsval; +#endif + + /* Parse the TCP MSS option, if present. */ + if (tcphdr_optlen != 0) { + for (tcp_optidx = 0; tcp_optidx < tcphdr_optlen; ) { + u8_t opt = tcp_getoptbyte(); + switch (opt) { + case LWIP_TCP_OPT_EOL: + /* End of options. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: EOL\n")); + return; + case LWIP_TCP_OPT_NOP: + /* NOP option. */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: NOP\n")); + break; + case LWIP_TCP_OPT_MSS: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: MSS\n")); + if (tcp_getoptbyte() != LWIP_TCP_OPT_LEN_MSS || (tcp_optidx - 2 + LWIP_TCP_OPT_LEN_MSS) > tcphdr_optlen) { + /* Bad length */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n")); + return; + } + /* An MSS option with the right option length. */ + mss = (tcp_getoptbyte() << 8); + mss |= tcp_getoptbyte(); + /* Limit the mss to the configured TCP_MSS and prevent division by zero */ + pcb->mss = ((mss > TCP_MSS) || (mss == 0)) ? TCP_MSS : mss; + break; +#if LWIP_WND_SCALE + case LWIP_TCP_OPT_WS: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: WND_SCALE\n")); + if (tcp_getoptbyte() != LWIP_TCP_OPT_LEN_WS || (tcp_optidx - 2 + LWIP_TCP_OPT_LEN_WS) > tcphdr_optlen) { + /* Bad length */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n")); + return; + } + /* If syn was received with wnd scale option, + activate wnd scale opt, but only if this is not a retransmission */ + if ((flags & TCP_SYN) && !(pcb->flags & TF_WND_SCALE)) { + /* An WND_SCALE option with the right option length. */ + data = tcp_getoptbyte(); + pcb->snd_scale = data; + if (pcb->snd_scale > 14U) { + pcb->snd_scale = 14U; + } + pcb->rcv_scale = TCP_RCV_SCALE; + pcb->flags |= TF_WND_SCALE; + /* window scaling is enabled, we can use the full receive window */ + LWIP_ASSERT("window not at default value", pcb->rcv_wnd == TCPWND_MIN16(TCP_WND)); + LWIP_ASSERT("window not at default value", pcb->rcv_ann_wnd == TCPWND_MIN16(TCP_WND)); + pcb->rcv_wnd = pcb->rcv_ann_wnd = TCP_WND; + } + break; +#endif +#if LWIP_TCP_TIMESTAMPS + case LWIP_TCP_OPT_TS: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: TS\n")); + if (tcp_getoptbyte() != LWIP_TCP_OPT_LEN_TS || (tcp_optidx - 2 + LWIP_TCP_OPT_LEN_TS) > tcphdr_optlen) { + /* Bad length */ + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n")); + return; + } + /* TCP timestamp option with valid length */ + tsval = tcp_getoptbyte(); + tsval |= (tcp_getoptbyte() << 8); + tsval |= (tcp_getoptbyte() << 16); + tsval |= (tcp_getoptbyte() << 24); + if (flags & TCP_SYN) { + pcb->ts_recent = lwip_ntohl(tsval); + /* Enable sending timestamps in every segment now that we know + the remote host supports it. */ + pcb->flags |= TF_TIMESTAMP; + } else if (TCP_SEQ_BETWEEN(pcb->ts_lastacksent, seqno, seqno+tcplen)) { + pcb->ts_recent = lwip_ntohl(tsval); + } + /* Advance to next option (6 bytes already read) */ + tcp_optidx += LWIP_TCP_OPT_LEN_TS - 6; + break; +#endif + default: + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: other\n")); + data = tcp_getoptbyte(); + if (data < 2) { + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_parseopt: bad length\n")); + /* If the length field is zero, the options are malformed + and we don't process them further. */ + return; + } + /* All other options have a length field, so that we easily + can skip past them. */ + tcp_optidx += data - 2; + } + } + } +} + +void +tcp_trigger_input_pcb_close(void) +{ + recv_flags |= TF_CLOSED; +} + +#endif /* LWIP_TCP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_out.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_out.c new file mode 100644 index 0000000..2435408 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/tcp_out.c @@ -0,0 +1,1671 @@ +/** + * @file + * Transmission Control Protocol, outgoing traffic + * + * The output functions of TCP. + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#include "lwip/opt.h" + +#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/priv/tcp_priv.h" +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/inet_chksum.h" +#include "lwip/stats.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#if LWIP_TCP_TIMESTAMPS +#include "lwip/sys.h" +#endif + +#include + +/* Define some copy-macros for checksum-on-copy so that the code looks + nicer by preventing too many ifdef's. */ +#if TCP_CHECKSUM_ON_COPY +#define TCP_DATA_COPY(dst, src, len, seg) do { \ + tcp_seg_add_chksum(LWIP_CHKSUM_COPY(dst, src, len), \ + len, &seg->chksum, &seg->chksum_swapped); \ + seg->flags |= TF_SEG_DATA_CHECKSUMMED; } while(0) +#define TCP_DATA_COPY2(dst, src, len, chksum, chksum_swapped) \ + tcp_seg_add_chksum(LWIP_CHKSUM_COPY(dst, src, len), len, chksum, chksum_swapped); +#else /* TCP_CHECKSUM_ON_COPY*/ +#define TCP_DATA_COPY(dst, src, len, seg) MEMCPY(dst, src, len) +#define TCP_DATA_COPY2(dst, src, len, chksum, chksum_swapped) MEMCPY(dst, src, len) +#endif /* TCP_CHECKSUM_ON_COPY*/ + +/** Define this to 1 for an extra check that the output checksum is valid + * (usefule when the checksum is generated by the application, not the stack) */ +#ifndef TCP_CHECKSUM_ON_COPY_SANITY_CHECK +#define TCP_CHECKSUM_ON_COPY_SANITY_CHECK 0 +#endif +/* Allow to override the failure of sanity check from warning to e.g. hard failure */ +#if TCP_CHECKSUM_ON_COPY_SANITY_CHECK +#ifndef TCP_CHECKSUM_ON_COPY_SANITY_CHECK_FAIL +#define TCP_CHECKSUM_ON_COPY_SANITY_CHECK_FAIL(msg) LWIP_DEBUGF(TCP_DEBUG | LWIP_DBG_LEVEL_WARNING, msg) +#endif +#endif + +#if TCP_OVERSIZE +/** The size of segment pbufs created when TCP_OVERSIZE is enabled */ +#ifndef TCP_OVERSIZE_CALC_LENGTH +#define TCP_OVERSIZE_CALC_LENGTH(length) ((length) + TCP_OVERSIZE) +#endif +#endif + +/* Forward declarations.*/ +static err_t tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif); + +/** Allocate a pbuf and create a tcphdr at p->payload, used for output + * functions other than the default tcp_output -> tcp_output_segment + * (e.g. tcp_send_empty_ack, etc.) + * + * @param pcb tcp pcb for which to send a packet (used to initialize tcp_hdr) + * @param optlen length of header-options + * @param datalen length of tcp data to reserve in pbuf + * @param seqno_be seqno in network byte order (big-endian) + * @return pbuf with p->payload being the tcp_hdr + */ +static struct pbuf * +tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen, + u32_t seqno_be /* already in network byte order */) +{ + struct tcp_hdr *tcphdr; + struct pbuf *p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM); + if (p != NULL) { + LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr", + (p->len >= TCP_HLEN + optlen)); + tcphdr = (struct tcp_hdr *)p->payload; + tcphdr->src = lwip_htons(pcb->local_port); + tcphdr->dest = lwip_htons(pcb->remote_port); + tcphdr->seqno = seqno_be; + tcphdr->ackno = lwip_htonl(pcb->rcv_nxt); + TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), TCP_ACK); + tcphdr->wnd = lwip_htons(TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd))); + tcphdr->chksum = 0; + tcphdr->urgp = 0; + + /* If we're sending a packet, update the announced right window edge */ + pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd; + } + return p; +} + +/** + * Called by tcp_close() to send a segment including FIN flag but not data. + * + * @param pcb the tcp_pcb over which to send a segment + * @return ERR_OK if sent, another err_t otherwise + */ +err_t +tcp_send_fin(struct tcp_pcb *pcb) +{ + /* first, try to add the fin to the last unsent segment */ + if (pcb->unsent != NULL) { + struct tcp_seg *last_unsent; + for (last_unsent = pcb->unsent; last_unsent->next != NULL; + last_unsent = last_unsent->next); + + if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) { + /* no SYN/FIN/RST flag in the header, we can add the FIN flag */ + TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN); + pcb->flags |= TF_FIN; + return ERR_OK; + } + } + /* no data, no length, flags, copy=1, no optdata */ + return tcp_enqueue_flags(pcb, TCP_FIN); +} + +/** + * Create a TCP segment with prefilled header. + * + * Called by tcp_write and tcp_enqueue_flags. + * + * @param pcb Protocol control block for the TCP connection. + * @param p pbuf that is used to hold the TCP header. + * @param flags TCP flags for header. + * @param seqno TCP sequence number of this packet + * @param optflags options to include in TCP header + * @return a new tcp_seg pointing to p, or NULL. + * The TCP header is filled in except ackno and wnd. + * p is freed on failure. + */ +static struct tcp_seg * +tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, u8_t optflags) +{ + struct tcp_seg *seg; + u8_t optlen = LWIP_TCP_OPT_LENGTH(optflags); + + if ((seg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG)) == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_create_segment: no memory.\n")); + pbuf_free(p); + return NULL; + } + seg->flags = optflags; + seg->next = NULL; + seg->p = p; + LWIP_ASSERT("p->tot_len >= optlen", p->tot_len >= optlen); + seg->len = p->tot_len - optlen; +#if TCP_OVERSIZE_DBGCHECK + seg->oversize_left = 0; +#endif /* TCP_OVERSIZE_DBGCHECK */ +#if TCP_CHECKSUM_ON_COPY + seg->chksum = 0; + seg->chksum_swapped = 0; + /* check optflags */ + LWIP_ASSERT("invalid optflags passed: TF_SEG_DATA_CHECKSUMMED", + (optflags & TF_SEG_DATA_CHECKSUMMED) == 0); +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* build TCP header */ + if (pbuf_header(p, TCP_HLEN)) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_create_segment: no room for TCP header in pbuf.\n")); + TCP_STATS_INC(tcp.err); + tcp_seg_free(seg); + return NULL; + } + seg->tcphdr = (struct tcp_hdr *)seg->p->payload; + seg->tcphdr->src = lwip_htons(pcb->local_port); + seg->tcphdr->dest = lwip_htons(pcb->remote_port); + seg->tcphdr->seqno = lwip_htonl(seqno); + /* ackno is set in tcp_output */ + TCPH_HDRLEN_FLAGS_SET(seg->tcphdr, (5 + optlen / 4), flags); + /* wnd and chksum are set in tcp_output */ + seg->tcphdr->urgp = 0; + return seg; +} + +/** + * Allocate a PBUF_RAM pbuf, perhaps with extra space at the end. + * + * This function is like pbuf_alloc(layer, length, PBUF_RAM) except + * there may be extra bytes available at the end. + * + * @param layer flag to define header size. + * @param length size of the pbuf's payload. + * @param max_length maximum usable size of payload+oversize. + * @param oversize pointer to a u16_t that will receive the number of usable tail bytes. + * @param pcb The TCP connection that will enqueue the pbuf. + * @param apiflags API flags given to tcp_write. + * @param first_seg true when this pbuf will be used in the first enqueued segment. + */ +#if TCP_OVERSIZE +static struct pbuf * +tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length, + u16_t *oversize, struct tcp_pcb *pcb, u8_t apiflags, + u8_t first_seg) +{ + struct pbuf *p; + u16_t alloc = length; + +#if LWIP_NETIF_TX_SINGLE_PBUF + LWIP_UNUSED_ARG(max_length); + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(apiflags); + LWIP_UNUSED_ARG(first_seg); + alloc = max_length; +#else /* LWIP_NETIF_TX_SINGLE_PBUF */ + if (length < max_length) { + /* Should we allocate an oversized pbuf, or just the minimum + * length required? If tcp_write is going to be called again + * before this segment is transmitted, we want the oversized + * buffer. If the segment will be transmitted immediately, we can + * save memory by allocating only length. We use a simple + * heuristic based on the following information: + * + * Did the user set TCP_WRITE_FLAG_MORE? + * + * Will the Nagle algorithm defer transmission of this segment? + */ + if ((apiflags & TCP_WRITE_FLAG_MORE) || + (!(pcb->flags & TF_NODELAY) && + (!first_seg || + pcb->unsent != NULL || + pcb->unacked != NULL))) { + alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(TCP_OVERSIZE_CALC_LENGTH(length))); + } + } +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + p = pbuf_alloc(layer, alloc, PBUF_RAM); + if (p == NULL) { + return NULL; + } + LWIP_ASSERT("need unchained pbuf", p->next == NULL); + *oversize = p->len - length; + /* trim p->len to the currently used size */ + p->len = p->tot_len = length; + return p; +} +#else /* TCP_OVERSIZE */ +#define tcp_pbuf_prealloc(layer, length, mx, os, pcb, api, fst) pbuf_alloc((layer), (length), PBUF_RAM) +#endif /* TCP_OVERSIZE */ + +#if TCP_CHECKSUM_ON_COPY +/** Add a checksum of newly added data to the segment */ +static void +tcp_seg_add_chksum(u16_t chksum, u16_t len, u16_t *seg_chksum, + u8_t *seg_chksum_swapped) +{ + u32_t helper; + /* add chksum to old chksum and fold to u16_t */ + helper = chksum + *seg_chksum; + chksum = FOLD_U32T(helper); + if ((len & 1) != 0) { + *seg_chksum_swapped = 1 - *seg_chksum_swapped; + chksum = SWAP_BYTES_IN_WORD(chksum); + } + *seg_chksum = chksum; +} +#endif /* TCP_CHECKSUM_ON_COPY */ + +/** Checks if tcp_write is allowed or not (checks state, snd_buf and snd_queuelen). + * + * @param pcb the tcp pcb to check for + * @param len length of data to send (checked agains snd_buf) + * @return ERR_OK if tcp_write is allowed to proceed, another err_t otherwise + */ +static err_t +tcp_write_checks(struct tcp_pcb *pcb, u16_t len) +{ + /* connection is in invalid state for data transmission? */ + if ((pcb->state != ESTABLISHED) && + (pcb->state != CLOSE_WAIT) && + (pcb->state != SYN_SENT) && + (pcb->state != SYN_RCVD)) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_STATE | LWIP_DBG_LEVEL_SEVERE, ("tcp_write() called in invalid state\n")); + return ERR_CONN; + } else if (len == 0) { + return ERR_OK; + } + + /* fail on too much data */ + if (len > pcb->snd_buf) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_write: too much data (len=%"U16_F" > snd_buf=%"TCPWNDSIZE_F")\n", + len, pcb->snd_buf)); + pcb->flags |= TF_NAGLEMEMERR; + return ERR_MEM; + } + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: queuelen: %"TCPWNDSIZE_F"\n", (tcpwnd_size_t)pcb->snd_queuelen)); + + /* If total number of pbufs on the unsent/unacked queues exceeds the + * configured maximum, return an error */ + /* check for configured max queuelen and possible overflow */ + if ((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_write: too long queue %"U16_F" (max %"U16_F")\n", + pcb->snd_queuelen, (u16_t)TCP_SND_QUEUELEN)); + TCP_STATS_INC(tcp.memerr); + pcb->flags |= TF_NAGLEMEMERR; + return ERR_MEM; + } + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_write: pbufs on queue => at least one queue non-empty", + pcb->unacked != NULL || pcb->unsent != NULL); + } else { + LWIP_ASSERT("tcp_write: no pbufs on queue => both queues empty", + pcb->unacked == NULL && pcb->unsent == NULL); + } + return ERR_OK; +} + +/** + * @ingroup tcp_raw + * Write data for sending (but does not send it immediately). + * + * It waits in the expectation of more data being sent soon (as + * it can send them more efficiently by combining them together). + * To prompt the system to send data now, call tcp_output() after + * calling tcp_write(). + * + * @param pcb Protocol control block for the TCP connection to enqueue data for. + * @param arg Pointer to the data to be enqueued for sending. + * @param len Data length in bytes + * @param apiflags combination of following flags : + * - TCP_WRITE_FLAG_COPY (0x01) data will be copied into memory belonging to the stack + * - TCP_WRITE_FLAG_MORE (0x02) for TCP connection, PSH flag will not be set on last segment sent, + * @return ERR_OK if enqueued, another err_t on error + */ +err_t +tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags) +{ + struct pbuf *concat_p = NULL; + struct tcp_seg *last_unsent = NULL, *seg = NULL, *prev_seg = NULL, *queue = NULL; + u16_t pos = 0; /* position in 'arg' data */ + u16_t queuelen; + u8_t optlen = 0; + u8_t optflags = 0; +#if TCP_OVERSIZE + u16_t oversize = 0; + u16_t oversize_used = 0; +#if TCP_OVERSIZE_DBGCHECK + u16_t oversize_add = 0; +#endif /* TCP_OVERSIZE_DBGCHECK*/ +#endif /* TCP_OVERSIZE */ + u16_t extendlen = 0; +#if TCP_CHECKSUM_ON_COPY + u16_t concat_chksum = 0; + u8_t concat_chksum_swapped = 0; + u16_t concat_chksummed = 0; +#endif /* TCP_CHECKSUM_ON_COPY */ + err_t err; + /* don't allocate segments bigger than half the maximum window we ever received */ + u16_t mss_local = LWIP_MIN(pcb->mss, TCPWND_MIN16(pcb->snd_wnd_max/2)); + mss_local = mss_local ? mss_local : pcb->mss; + +#if LWIP_NETIF_TX_SINGLE_PBUF + /* Always copy to try to create single pbufs for TX */ + apiflags |= TCP_WRITE_FLAG_COPY; +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", + (void *)pcb, arg, len, (u16_t)apiflags)); + LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)", + arg != NULL, return ERR_ARG;); + + err = tcp_write_checks(pcb, len); + if (err != ERR_OK) { + return err; + } + queuelen = pcb->snd_queuelen; + +#if LWIP_TCP_TIMESTAMPS + if ((pcb->flags & TF_TIMESTAMP)) { + /* Make sure the timestamp option is only included in data segments if we + agreed about it with the remote host. */ + optflags = TF_SEG_OPTS_TS; + optlen = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_TS); + /* ensure that segments can hold at least one data byte... */ + mss_local = LWIP_MAX(mss_local, LWIP_TCP_OPT_LEN_TS + 1); + } +#endif /* LWIP_TCP_TIMESTAMPS */ + + + /* + * TCP segmentation is done in three phases with increasing complexity: + * + * 1. Copy data directly into an oversized pbuf. + * 2. Chain a new pbuf to the end of pcb->unsent. + * 3. Create new segments. + * + * We may run out of memory at any point. In that case we must + * return ERR_MEM and not change anything in pcb. Therefore, all + * changes are recorded in local variables and committed at the end + * of the function. Some pcb fields are maintained in local copies: + * + * queuelen = pcb->snd_queuelen + * oversize = pcb->unsent_oversize + * + * These variables are set consistently by the phases: + * + * seg points to the last segment tampered with. + * + * pos records progress as data is segmented. + */ + + /* Find the tail of the unsent queue. */ + if (pcb->unsent != NULL) { + u16_t space; + u16_t unsent_optlen; + + /* @todo: this could be sped up by keeping last_unsent in the pcb */ + for (last_unsent = pcb->unsent; last_unsent->next != NULL; + last_unsent = last_unsent->next); + + /* Usable space at the end of the last unsent segment */ + unsent_optlen = LWIP_TCP_OPT_LENGTH(last_unsent->flags); + LWIP_ASSERT("mss_local is too small", mss_local >= last_unsent->len + unsent_optlen); + space = mss_local - (last_unsent->len + unsent_optlen); + + /* + * Phase 1: Copy data directly into an oversized pbuf. + * + * The number of bytes copied is recorded in the oversize_used + * variable. The actual copying is done at the bottom of the + * function. + */ +#if TCP_OVERSIZE +#if TCP_OVERSIZE_DBGCHECK + /* check that pcb->unsent_oversize matches last_unsent->oversize_left */ + LWIP_ASSERT("unsent_oversize mismatch (pcb vs. last_unsent)", + pcb->unsent_oversize == last_unsent->oversize_left); +#endif /* TCP_OVERSIZE_DBGCHECK */ + oversize = pcb->unsent_oversize; + if (oversize > 0) { + LWIP_ASSERT("inconsistent oversize vs. space", oversize <= space); + seg = last_unsent; + oversize_used = LWIP_MIN(space, LWIP_MIN(oversize, len)); + pos += oversize_used; + oversize -= oversize_used; + space -= oversize_used; + } + /* now we are either finished or oversize is zero */ + LWIP_ASSERT("inconsistent oversize vs. len", (oversize == 0) || (pos == len)); +#endif /* TCP_OVERSIZE */ + + /* + * Phase 2: Chain a new pbuf to the end of pcb->unsent. + * + * As an exception when NOT copying the data, if the given data buffer + * directly follows the last unsent data buffer in memory, extend the last + * ROM pbuf reference to the buffer, thus saving a ROM pbuf allocation. + * + * We don't extend segments containing SYN/FIN flags or options + * (len==0). The new pbuf is kept in concat_p and pbuf_cat'ed at + * the end. + */ + if ((pos < len) && (space > 0) && (last_unsent->len > 0)) { + u16_t seglen = LWIP_MIN(space, len - pos); + seg = last_unsent; + + /* Create a pbuf with a copy or reference to seglen bytes. We + * can use PBUF_RAW here since the data appears in the middle of + * a segment. A header will never be prepended. */ + if (apiflags & TCP_WRITE_FLAG_COPY) { + /* Data is copied */ + if ((concat_p = tcp_pbuf_prealloc(PBUF_RAW, seglen, space, &oversize, pcb, apiflags, 1)) == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("tcp_write : could not allocate memory for pbuf copy size %"U16_F"\n", + seglen)); + goto memerr; + } +#if TCP_OVERSIZE_DBGCHECK + oversize_add = oversize; +#endif /* TCP_OVERSIZE_DBGCHECK */ + TCP_DATA_COPY2(concat_p->payload, (const u8_t*)arg + pos, seglen, &concat_chksum, &concat_chksum_swapped); +#if TCP_CHECKSUM_ON_COPY + concat_chksummed += seglen; +#endif /* TCP_CHECKSUM_ON_COPY */ + queuelen += pbuf_clen(concat_p); + } else { + /* Data is not copied */ + /* If the last unsent pbuf is of type PBUF_ROM, try to extend it. */ + struct pbuf *p; + for (p = last_unsent->p; p->next != NULL; p = p->next); + if (p->type == PBUF_ROM && (const u8_t *)p->payload + p->len == (const u8_t *)arg) { + LWIP_ASSERT("tcp_write: ROM pbufs cannot be oversized", pos == 0); + extendlen = seglen; + } else { + if ((concat_p = pbuf_alloc(PBUF_RAW, seglen, PBUF_ROM)) == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("tcp_write: could not allocate memory for zero-copy pbuf\n")); + goto memerr; + } + /* reference the non-volatile payload data */ + ((struct pbuf_rom*)concat_p)->payload = (const u8_t*)arg + pos; + queuelen += pbuf_clen(concat_p); + } +#if TCP_CHECKSUM_ON_COPY + /* calculate the checksum of nocopy-data */ + tcp_seg_add_chksum(~inet_chksum((const u8_t*)arg + pos, seglen), seglen, + &concat_chksum, &concat_chksum_swapped); + concat_chksummed += seglen; +#endif /* TCP_CHECKSUM_ON_COPY */ + } + + pos += seglen; + } + } else { +#if TCP_OVERSIZE + LWIP_ASSERT("unsent_oversize mismatch (pcb->unsent is NULL)", + pcb->unsent_oversize == 0); +#endif /* TCP_OVERSIZE */ + } + + /* + * Phase 3: Create new segments. + * + * The new segments are chained together in the local 'queue' + * variable, ready to be appended to pcb->unsent. + */ + while (pos < len) { + struct pbuf *p; + u16_t left = len - pos; + u16_t max_len = mss_local - optlen; + u16_t seglen = LWIP_MIN(left, max_len); +#if TCP_CHECKSUM_ON_COPY + u16_t chksum = 0; + u8_t chksum_swapped = 0; +#endif /* TCP_CHECKSUM_ON_COPY */ + + if (apiflags & TCP_WRITE_FLAG_COPY) { + /* If copy is set, memory should be allocated and data copied + * into pbuf */ + if ((p = tcp_pbuf_prealloc(PBUF_TRANSPORT, seglen + optlen, mss_local, &oversize, pcb, apiflags, queue == NULL)) == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write : could not allocate memory for pbuf copy size %"U16_F"\n", seglen)); + goto memerr; + } + LWIP_ASSERT("tcp_write: check that first pbuf can hold the complete seglen", + (p->len >= seglen)); + TCP_DATA_COPY2((char *)p->payload + optlen, (const u8_t*)arg + pos, seglen, &chksum, &chksum_swapped); + } else { + /* Copy is not set: First allocate a pbuf for holding the data. + * Since the referenced data is available at least until it is + * sent out on the link (as it has to be ACKed by the remote + * party) we can safely use PBUF_ROM instead of PBUF_REF here. + */ + struct pbuf *p2; +#if TCP_OVERSIZE + LWIP_ASSERT("oversize == 0", oversize == 0); +#endif /* TCP_OVERSIZE */ + if ((p2 = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_ROM)) == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write: could not allocate memory for zero-copy pbuf\n")); + goto memerr; + } +#if TCP_CHECKSUM_ON_COPY + /* calculate the checksum of nocopy-data */ + chksum = ~inet_chksum((const u8_t*)arg + pos, seglen); + if (seglen & 1) { + chksum_swapped = 1; + chksum = SWAP_BYTES_IN_WORD(chksum); + } +#endif /* TCP_CHECKSUM_ON_COPY */ + /* reference the non-volatile payload data */ + ((struct pbuf_rom*)p2)->payload = (const u8_t*)arg + pos; + + /* Second, allocate a pbuf for the headers. */ + if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) { + /* If allocation fails, we have to deallocate the data pbuf as + * well. */ + pbuf_free(p2); + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write: could not allocate memory for header pbuf\n")); + goto memerr; + } + /* Concatenate the headers and data pbufs together. */ + pbuf_cat(p/*header*/, p2/*data*/); + } + + queuelen += pbuf_clen(p); + + /* Now that there are more segments queued, we check again if the + * length of the queue exceeds the configured maximum or + * overflows. */ + if ((queuelen > TCP_SND_QUEUELEN) || (queuelen > TCP_SNDQUEUELEN_OVERFLOW)) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("tcp_write: queue too long %"U16_F" (%d)\n", + queuelen, (int)TCP_SND_QUEUELEN)); + pbuf_free(p); + goto memerr; + } + + if ((seg = tcp_create_segment(pcb, p, 0, pcb->snd_lbb + pos, optflags)) == NULL) { + goto memerr; + } +#if TCP_OVERSIZE_DBGCHECK + seg->oversize_left = oversize; +#endif /* TCP_OVERSIZE_DBGCHECK */ +#if TCP_CHECKSUM_ON_COPY + seg->chksum = chksum; + seg->chksum_swapped = chksum_swapped; + seg->flags |= TF_SEG_DATA_CHECKSUMMED; +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* first segment of to-be-queued data? */ + if (queue == NULL) { + queue = seg; + } else { + /* Attach the segment to the end of the queued segments */ + LWIP_ASSERT("prev_seg != NULL", prev_seg != NULL); + prev_seg->next = seg; + } + /* remember last segment of to-be-queued data for next iteration */ + prev_seg = seg; + + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, ("tcp_write: queueing %"U32_F":%"U32_F"\n", + lwip_ntohl(seg->tcphdr->seqno), + lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg))); + + pos += seglen; + } + + /* + * All three segmentation phases were successful. We can commit the + * transaction. + */ +#if TCP_OVERSIZE_DBGCHECK + if ((last_unsent != NULL) && (oversize_add != 0)) { + last_unsent->oversize_left += oversize_add; + } +#endif /* TCP_OVERSIZE_DBGCHECK */ + + /* + * Phase 1: If data has been added to the preallocated tail of + * last_unsent, we update the length fields of the pbuf chain. + */ +#if TCP_OVERSIZE + if (oversize_used > 0) { + struct pbuf *p; + /* Bump tot_len of whole chain, len of tail */ + for (p = last_unsent->p; p; p = p->next) { + p->tot_len += oversize_used; + if (p->next == NULL) { + TCP_DATA_COPY((char *)p->payload + p->len, arg, oversize_used, last_unsent); + p->len += oversize_used; + } + } + last_unsent->len += oversize_used; +#if TCP_OVERSIZE_DBGCHECK + LWIP_ASSERT("last_unsent->oversize_left >= oversize_used", + last_unsent->oversize_left >= oversize_used); + last_unsent->oversize_left -= oversize_used; +#endif /* TCP_OVERSIZE_DBGCHECK */ + } + pcb->unsent_oversize = oversize; +#endif /* TCP_OVERSIZE */ + + /* + * Phase 2: concat_p can be concatenated onto last_unsent->p, unless we + * determined that the last ROM pbuf can be extended to include the new data. + */ + if (concat_p != NULL) { + LWIP_ASSERT("tcp_write: cannot concatenate when pcb->unsent is empty", + (last_unsent != NULL)); + pbuf_cat(last_unsent->p, concat_p); + last_unsent->len += concat_p->tot_len; + } else if (extendlen > 0) { + struct pbuf *p; + LWIP_ASSERT("tcp_write: extension of reference requires reference", + last_unsent != NULL && last_unsent->p != NULL); + for (p = last_unsent->p; p->next != NULL; p = p->next) { + p->tot_len += extendlen; + } + p->tot_len += extendlen; + p->len += extendlen; + last_unsent->len += extendlen; + } + +#if TCP_CHECKSUM_ON_COPY + if (concat_chksummed) { + LWIP_ASSERT("tcp_write: concat checksum needs concatenated data", + concat_p != NULL || extendlen > 0); + /*if concat checksumm swapped - swap it back */ + if (concat_chksum_swapped) { + concat_chksum = SWAP_BYTES_IN_WORD(concat_chksum); + } + tcp_seg_add_chksum(concat_chksum, concat_chksummed, &last_unsent->chksum, + &last_unsent->chksum_swapped); + last_unsent->flags |= TF_SEG_DATA_CHECKSUMMED; + } +#endif /* TCP_CHECKSUM_ON_COPY */ + + /* + * Phase 3: Append queue to pcb->unsent. Queue may be NULL, but that + * is harmless + */ + if (last_unsent == NULL) { + pcb->unsent = queue; + } else { + last_unsent->next = queue; + } + + /* + * Finally update the pcb state. + */ + pcb->snd_lbb += len; + pcb->snd_buf -= len; + pcb->snd_queuelen = queuelen; + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_write: %"S16_F" (after enqueued)\n", + pcb->snd_queuelen)); + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_write: valid queue length", + pcb->unacked != NULL || pcb->unsent != NULL); + } + + /* Set the PSH flag in the last segment that we enqueued. */ + if (seg != NULL && seg->tcphdr != NULL && ((apiflags & TCP_WRITE_FLAG_MORE)==0)) { + TCPH_SET_FLAG(seg->tcphdr, TCP_PSH); + } + + return ERR_OK; +memerr: + pcb->flags |= TF_NAGLEMEMERR; + TCP_STATS_INC(tcp.memerr); + + if (concat_p != NULL) { + pbuf_free(concat_p); + } + if (queue != NULL) { + tcp_segs_free(queue); + } + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_write: valid queue length", pcb->unacked != NULL || + pcb->unsent != NULL); + } + LWIP_DEBUGF(TCP_QLEN_DEBUG | LWIP_DBG_STATE, ("tcp_write: %"S16_F" (with mem err)\n", pcb->snd_queuelen)); + return ERR_MEM; +} + +/** + * Enqueue TCP options for transmission. + * + * Called by tcp_connect(), tcp_listen_input(), and tcp_send_ctrl(). + * + * @param pcb Protocol control block for the TCP connection. + * @param flags TCP header flags to set in the outgoing segment. + */ +err_t +tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags) +{ + struct pbuf *p; + struct tcp_seg *seg; + u8_t optflags = 0; + u8_t optlen = 0; + + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue_flags: queuelen: %"U16_F"\n", (u16_t)pcb->snd_queuelen)); + + LWIP_ASSERT("tcp_enqueue_flags: need either TCP_SYN or TCP_FIN in flags (programmer violates API)", + (flags & (TCP_SYN | TCP_FIN)) != 0); + + /* check for configured max queuelen and possible overflow (FIN flag should always come through!) */ + if (((pcb->snd_queuelen >= TCP_SND_QUEUELEN) || (pcb->snd_queuelen > TCP_SNDQUEUELEN_OVERFLOW)) && + ((flags & TCP_FIN) == 0)) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_LEVEL_SEVERE, ("tcp_enqueue_flags: too long queue %"U16_F" (max %"U16_F")\n", + pcb->snd_queuelen, (u16_t)TCP_SND_QUEUELEN)); + TCP_STATS_INC(tcp.memerr); + pcb->flags |= TF_NAGLEMEMERR; + return ERR_MEM; + } + + if (flags & TCP_SYN) { + optflags = TF_SEG_OPTS_MSS; +#if LWIP_WND_SCALE + if ((pcb->state != SYN_RCVD) || (pcb->flags & TF_WND_SCALE)) { + /* In a (sent in state SYN_RCVD), the window scale option may only + be sent if we received a window scale option from the remote host. */ + optflags |= TF_SEG_OPTS_WND_SCALE; + } +#endif /* LWIP_WND_SCALE */ + } +#if LWIP_TCP_TIMESTAMPS + if ((pcb->flags & TF_TIMESTAMP)) { + /* Make sure the timestamp option is only included in data segments if we + agreed about it with the remote host. */ + optflags |= TF_SEG_OPTS_TS; + } +#endif /* LWIP_TCP_TIMESTAMPS */ + optlen = LWIP_TCP_OPT_LENGTH(optflags); + + /* Allocate pbuf with room for TCP header + options */ + if ((p = pbuf_alloc(PBUF_TRANSPORT, optlen, PBUF_RAM)) == NULL) { + pcb->flags |= TF_NAGLEMEMERR; + TCP_STATS_INC(tcp.memerr); + return ERR_MEM; + } + LWIP_ASSERT("tcp_enqueue_flags: check that first pbuf can hold optlen", + (p->len >= optlen)); + + /* Allocate memory for tcp_seg, and fill in fields. */ + if ((seg = tcp_create_segment(pcb, p, flags, pcb->snd_lbb, optflags)) == NULL) { + pcb->flags |= TF_NAGLEMEMERR; + TCP_STATS_INC(tcp.memerr); + return ERR_MEM; + } + LWIP_ASSERT("seg->tcphdr not aligned", ((mem_ptr_t)seg->tcphdr % LWIP_MIN(MEM_ALIGNMENT, 4)) == 0); + LWIP_ASSERT("tcp_enqueue_flags: invalid segment length", seg->len == 0); + + LWIP_DEBUGF(TCP_OUTPUT_DEBUG | LWIP_DBG_TRACE, + ("tcp_enqueue_flags: queueing %"U32_F":%"U32_F" (0x%"X16_F")\n", + lwip_ntohl(seg->tcphdr->seqno), + lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg), + (u16_t)flags)); + + /* Now append seg to pcb->unsent queue */ + if (pcb->unsent == NULL) { + pcb->unsent = seg; + } else { + struct tcp_seg *useg; + for (useg = pcb->unsent; useg->next != NULL; useg = useg->next); + useg->next = seg; + } +#if TCP_OVERSIZE + /* The new unsent tail has no space */ + pcb->unsent_oversize = 0; +#endif /* TCP_OVERSIZE */ + + /* SYN and FIN bump the sequence number */ + if ((flags & TCP_SYN) || (flags & TCP_FIN)) { + pcb->snd_lbb++; + /* optlen does not influence snd_buf */ + } + if (flags & TCP_FIN) { + pcb->flags |= TF_FIN; + } + + /* update number of segments on the queues */ + pcb->snd_queuelen += pbuf_clen(seg->p); + LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_enqueue_flags: %"S16_F" (after enqueued)\n", pcb->snd_queuelen)); + if (pcb->snd_queuelen != 0) { + LWIP_ASSERT("tcp_enqueue_flags: invalid queue length", + pcb->unacked != NULL || pcb->unsent != NULL); + } + + return ERR_OK; +} + +#if LWIP_TCP_TIMESTAMPS +/* Build a timestamp option (12 bytes long) at the specified options pointer) + * + * @param pcb tcp_pcb + * @param opts option pointer where to store the timestamp option + */ +static void +tcp_build_timestamp_option(struct tcp_pcb *pcb, u32_t *opts) +{ + /* Pad with two NOP options to make everything nicely aligned */ + opts[0] = PP_HTONL(0x0101080A); + opts[1] = lwip_htonl(sys_now()); + opts[2] = lwip_htonl(pcb->ts_recent); +} +#endif + +#if LWIP_WND_SCALE +/** Build a window scale option (3 bytes long) at the specified options pointer) + * + * @param opts option pointer where to store the window scale option + */ +static void +tcp_build_wnd_scale_option(u32_t *opts) +{ + /* Pad with one NOP option to make everything nicely aligned */ + opts[0] = PP_HTONL(0x01030300 | TCP_RCV_SCALE); +} +#endif + +/** + * Send an ACK without data. + * + * @param pcb Protocol control block for the TCP connection to send the ACK + */ +err_t +tcp_send_empty_ack(struct tcp_pcb *pcb) +{ + err_t err; + struct pbuf *p; + u8_t optlen = 0; + struct netif *netif; +#if LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP + struct tcp_hdr *tcphdr; +#endif /* LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP */ + +#if LWIP_TCP_TIMESTAMPS + if (pcb->flags & TF_TIMESTAMP) { + optlen = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_TS); + } +#endif + + p = tcp_output_alloc_header(pcb, optlen, 0, lwip_htonl(pcb->snd_nxt)); + if (p == NULL) { + /* let tcp_fasttmr retry sending this ACK */ + pcb->flags |= (TF_ACK_DELAY | TF_ACK_NOW); + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n")); + return ERR_BUF; + } +#if LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP + tcphdr = (struct tcp_hdr *)p->payload; +#endif /* LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP */ + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, + ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt)); + + /* NB. MSS and window scale options are only sent on SYNs, so ignore them here */ +#if LWIP_TCP_TIMESTAMPS + pcb->ts_lastacksent = pcb->rcv_nxt; + + if (pcb->flags & TF_TIMESTAMP) { + tcp_build_timestamp_option(pcb, (u32_t *)(tcphdr + 1)); + } +#endif + + netif = ip_route(&pcb->local_ip, &pcb->remote_ip); + if (netif == NULL) { + err = ERR_RTE; + } else { +#if CHECKSUM_GEN_TCP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) { + tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + &pcb->local_ip, &pcb->remote_ip); + } +#endif + NETIF_SET_HWADDRHINT(netif, &(pcb->addr_hint)); + err = ip_output_if(p, &pcb->local_ip, &pcb->remote_ip, + pcb->ttl, pcb->tos, IP_PROTO_TCP, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + } + pbuf_free(p); + + if (err != ERR_OK) { + /* let tcp_fasttmr retry sending this ACK */ + pcb->flags |= (TF_ACK_DELAY | TF_ACK_NOW); + } else { + /* remove ACK flags from the PCB, as we sent an empty ACK now */ + pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); + } + + return err; +} + +/** + * @ingroup tcp_raw + * Find out what we can send and send it + * + * @param pcb Protocol control block for the TCP connection to send data + * @return ERR_OK if data has been sent or nothing to send + * another err_t on error + */ +err_t +tcp_output(struct tcp_pcb *pcb) +{ + struct tcp_seg *seg, *useg; + u32_t wnd, snd_nxt; + err_t err; + struct netif *netif; +#if TCP_CWND_DEBUG + s16_t i = 0; +#endif /* TCP_CWND_DEBUG */ + + /* pcb->state LISTEN not allowed here */ + LWIP_ASSERT("don't call tcp_output for listen-pcbs", + pcb->state != LISTEN); + + /* First, check if we are invoked by the TCP input processing + code. If so, we do not output anything. Instead, we rely on the + input processing code to call us when input processing is done + with. */ + if (tcp_input_pcb == pcb) { + return ERR_OK; + } + + wnd = LWIP_MIN(pcb->snd_wnd, pcb->cwnd); + + seg = pcb->unsent; + + /* If the TF_ACK_NOW flag is set and no data will be sent (either + * because the ->unsent queue is empty or because the window does + * not allow it), construct an empty ACK segment and send it. + * + * If data is to be sent, we will just piggyback the ACK (see below). + */ + if (pcb->flags & TF_ACK_NOW && + (seg == NULL || + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) { + return tcp_send_empty_ack(pcb); + } + + /* useg should point to last segment on unacked queue */ + useg = pcb->unacked; + if (useg != NULL) { + for (; useg->next != NULL; useg = useg->next); + } + + netif = ip_route(&pcb->local_ip, &pcb->remote_ip); + if (netif == NULL) { + return ERR_RTE; + } + + /* If we don't have a local IP address, we get one from netif */ + if (ip_addr_isany(&pcb->local_ip)) { + const ip_addr_t *local_ip = ip_netif_get_local_ip(netif, &pcb->remote_ip); + if (local_ip == NULL) { + return ERR_RTE; + } + ip_addr_copy(pcb->local_ip, *local_ip); + } + +#if TCP_OUTPUT_DEBUG + if (seg == NULL) { + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: nothing to send (%p)\n", + (void*)pcb->unsent)); + } +#endif /* TCP_OUTPUT_DEBUG */ +#if TCP_CWND_DEBUG + if (seg == NULL) { + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %"TCPWNDSIZE_F + ", cwnd %"TCPWNDSIZE_F", wnd %"U32_F + ", seg == NULL, ack %"U32_F"\n", + pcb->snd_wnd, pcb->cwnd, wnd, pcb->lastack)); + } else { + LWIP_DEBUGF(TCP_CWND_DEBUG, + ("tcp_output: snd_wnd %"TCPWNDSIZE_F", cwnd %"TCPWNDSIZE_F", wnd %"U32_F + ", effwnd %"U32_F", seq %"U32_F", ack %"U32_F"\n", + pcb->snd_wnd, pcb->cwnd, wnd, + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len, + lwip_ntohl(seg->tcphdr->seqno), pcb->lastack)); + } +#endif /* TCP_CWND_DEBUG */ + /* Check if we need to start the persistent timer when the next unsent segment + * does not fit within the remaining send window and RTO timer is not running (we + * have no in-flight data). A traditional approach would fill the remaining window + * with part of the unsent segment (which will engage zero-window probing upon + * reception of the zero window update from the receiver). This ensures the + * subsequent window update is reliably received. With the goal of being lightweight, + * we avoid splitting the unsent segment and treat the window as already zero. + */ + if (seg != NULL && + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd && + wnd > 0 && wnd == pcb->snd_wnd && pcb->unacked == NULL) { + /* Start the persist timer */ + if (pcb->persist_backoff == 0) { + pcb->persist_cnt = 0; + pcb->persist_backoff = 1; + } + goto output_done; + } + /* data available and window allows it to be sent? */ + while (seg != NULL && + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { + LWIP_ASSERT("RST not expected here!", + (TCPH_FLAGS(seg->tcphdr) & TCP_RST) == 0); + /* Stop sending if the nagle algorithm would prevent it + * Don't stop: + * - if tcp_write had a memory error before (prevent delayed ACK timeout) or + * - if FIN was already enqueued for this PCB (SYN is always alone in a segment - + * either seg->next != NULL or pcb->unacked == NULL; + * RST is no sent using tcp_write/tcp_output. + */ + if ((tcp_do_output_nagle(pcb) == 0) && + ((pcb->flags & (TF_NAGLEMEMERR | TF_FIN)) == 0)) { + break; + } +#if TCP_CWND_DEBUG + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %"TCPWNDSIZE_F", cwnd %"TCPWNDSIZE_F", wnd %"U32_F", effwnd %"U32_F", seq %"U32_F", ack %"U32_F", i %"S16_F"\n", + pcb->snd_wnd, pcb->cwnd, wnd, + lwip_ntohl(seg->tcphdr->seqno) + seg->len - + pcb->lastack, + lwip_ntohl(seg->tcphdr->seqno), pcb->lastack, i)); + ++i; +#endif /* TCP_CWND_DEBUG */ + + if (pcb->state != SYN_SENT) { + TCPH_SET_FLAG(seg->tcphdr, TCP_ACK); + } + +#if TCP_OVERSIZE_DBGCHECK + seg->oversize_left = 0; +#endif /* TCP_OVERSIZE_DBGCHECK */ + err = tcp_output_segment(seg, pcb, netif); + if (err != ERR_OK) { + /* segment could not be sent, for whatever reason */ + pcb->flags |= TF_NAGLEMEMERR; + return err; + } + pcb->unsent = seg->next; + if (pcb->state != SYN_SENT) { + pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); + } + snd_nxt = lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg); + if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) { + pcb->snd_nxt = snd_nxt; + } + /* put segment on unacknowledged list if length > 0 */ + if (TCP_TCPLEN(seg) > 0) { + seg->next = NULL; + /* unacked list is empty? */ + if (pcb->unacked == NULL) { + pcb->unacked = seg; + useg = seg; + /* unacked list is not empty? */ + } else { + /* In the case of fast retransmit, the packet should not go to the tail + * of the unacked queue, but rather somewhere before it. We need to check for + * this case. -STJ Jul 27, 2004 */ + if (TCP_SEQ_LT(lwip_ntohl(seg->tcphdr->seqno), lwip_ntohl(useg->tcphdr->seqno))) { + /* add segment to before tail of unacked list, keeping the list sorted */ + struct tcp_seg **cur_seg = &(pcb->unacked); + while (*cur_seg && + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + cur_seg = &((*cur_seg)->next ); + } + seg->next = (*cur_seg); + (*cur_seg) = seg; + } else { + /* add segment to tail of unacked list */ + useg->next = seg; + useg = useg->next; + } + } + /* do not queue empty segments on the unacked list */ + } else { + tcp_seg_free(seg); + } + seg = pcb->unsent; + } +output_done: +#if TCP_OVERSIZE + if (pcb->unsent == NULL) { + /* last unsent has been removed, reset unsent_oversize */ + pcb->unsent_oversize = 0; + } +#endif /* TCP_OVERSIZE */ + + pcb->flags &= ~TF_NAGLEMEMERR; + return ERR_OK; +} + +/** + * Called by tcp_output() to actually send a TCP segment over IP. + * + * @param seg the tcp_seg to send + * @param pcb the tcp_pcb for the TCP connection used to send the segment + * @param netif the netif used to send the segment + */ +static err_t +tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb, struct netif *netif) +{ + err_t err; + u16_t len; + u32_t *opts; + + if (seg->p->ref != 1) { + /* This can happen if the pbuf of this segment is still referenced by the + netif driver due to deferred transmission. Since this function modifies + p->len, we must not continue in this case. */ + return ERR_OK; + } + + /* The TCP header has already been constructed, but the ackno and + wnd fields remain. */ + seg->tcphdr->ackno = lwip_htonl(pcb->rcv_nxt); + + /* advertise our receive window size in this TCP segment */ +#if LWIP_WND_SCALE + if (seg->flags & TF_SEG_OPTS_WND_SCALE) { + /* The Window field in a SYN segment itself (the only type where we send + the window scale option) is never scaled. */ + seg->tcphdr->wnd = lwip_htons(TCPWND_MIN16(pcb->rcv_ann_wnd)); + } else +#endif /* LWIP_WND_SCALE */ + { + seg->tcphdr->wnd = lwip_htons(TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd))); + } + + pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd; + + /* Add any requested options. NB MSS option is only set on SYN + packets, so ignore it here */ + /* cast through void* to get rid of alignment warnings */ + opts = (u32_t *)(void *)(seg->tcphdr + 1); + if (seg->flags & TF_SEG_OPTS_MSS) { + u16_t mss; +#if TCP_CALCULATE_EFF_SEND_MSS + mss = tcp_eff_send_mss(TCP_MSS, &pcb->local_ip, &pcb->remote_ip); +#else /* TCP_CALCULATE_EFF_SEND_MSS */ + mss = TCP_MSS; +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + *opts = TCP_BUILD_MSS_OPTION(mss); + opts += 1; + } +#if LWIP_TCP_TIMESTAMPS + pcb->ts_lastacksent = pcb->rcv_nxt; + + if (seg->flags & TF_SEG_OPTS_TS) { + tcp_build_timestamp_option(pcb, opts); + opts += 3; + } +#endif +#if LWIP_WND_SCALE + if (seg->flags & TF_SEG_OPTS_WND_SCALE) { + tcp_build_wnd_scale_option(opts); + opts += 1; + } +#endif + + /* Set retransmission timer running if it is not currently enabled + This must be set before checking the route. */ + if (pcb->rtime < 0) { + pcb->rtime = 0; + } + + if (pcb->rttest == 0) { + pcb->rttest = tcp_ticks; + pcb->rtseq = lwip_ntohl(seg->tcphdr->seqno); + + LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_output_segment: rtseq %"U32_F"\n", pcb->rtseq)); + } + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output_segment: %"U32_F":%"U32_F"\n", + lwip_htonl(seg->tcphdr->seqno), lwip_htonl(seg->tcphdr->seqno) + + seg->len)); + + len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload); + if (len == 0) { + /** Exclude retransmitted segments from this count. */ + MIB2_STATS_INC(mib2.tcpoutsegs); + } + + seg->p->len -= len; + seg->p->tot_len -= len; + + seg->p->payload = seg->tcphdr; + + seg->tcphdr->chksum = 0; +#if CHECKSUM_GEN_TCP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) { +#if TCP_CHECKSUM_ON_COPY + u32_t acc; +#if TCP_CHECKSUM_ON_COPY_SANITY_CHECK + u16_t chksum_slow = ip_chksum_pseudo(seg->p, IP_PROTO_TCP, + seg->p->tot_len, &pcb->local_ip, &pcb->remote_ip); +#endif /* TCP_CHECKSUM_ON_COPY_SANITY_CHECK */ + if ((seg->flags & TF_SEG_DATA_CHECKSUMMED) == 0) { + LWIP_ASSERT("data included but not checksummed", + seg->p->tot_len == (TCPH_HDRLEN(seg->tcphdr) * 4)); + } + + /* rebuild TCP header checksum (TCP header changes for retransmissions!) */ + acc = ip_chksum_pseudo_partial(seg->p, IP_PROTO_TCP, + seg->p->tot_len, TCPH_HDRLEN(seg->tcphdr) * 4, &pcb->local_ip, &pcb->remote_ip); + /* add payload checksum */ + if (seg->chksum_swapped) { + seg->chksum = SWAP_BYTES_IN_WORD(seg->chksum); + seg->chksum_swapped = 0; + } + acc += (u16_t)~(seg->chksum); + seg->tcphdr->chksum = FOLD_U32T(acc); +#if TCP_CHECKSUM_ON_COPY_SANITY_CHECK + if (chksum_slow != seg->tcphdr->chksum) { + TCP_CHECKSUM_ON_COPY_SANITY_CHECK_FAIL( + ("tcp_output_segment: calculated checksum is %"X16_F" instead of %"X16_F"\n", + seg->tcphdr->chksum, chksum_slow)); + seg->tcphdr->chksum = chksum_slow; + } +#endif /* TCP_CHECKSUM_ON_COPY_SANITY_CHECK */ +#else /* TCP_CHECKSUM_ON_COPY */ + seg->tcphdr->chksum = ip_chksum_pseudo(seg->p, IP_PROTO_TCP, + seg->p->tot_len, &pcb->local_ip, &pcb->remote_ip); +#endif /* TCP_CHECKSUM_ON_COPY */ + } +#endif /* CHECKSUM_GEN_TCP */ + TCP_STATS_INC(tcp.xmit); + + NETIF_SET_HWADDRHINT(netif, &(pcb->addr_hint)); + err = ip_output_if(seg->p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, + pcb->tos, IP_PROTO_TCP, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + return err; +} + +/** + * Send a TCP RESET packet (empty segment with RST flag set) either to + * abort a connection or to show that there is no matching local connection + * for a received segment. + * + * Called by tcp_abort() (to abort a local connection), tcp_input() (if no + * matching local pcb was found), tcp_listen_input() (if incoming segment + * has ACK flag set) and tcp_process() (received segment in the wrong state) + * + * Since a RST segment is in most cases not sent for an active connection, + * tcp_rst() has a number of arguments that are taken from a tcp_pcb for + * most other segment output functions. + * + * @param seqno the sequence number to use for the outgoing segment + * @param ackno the acknowledge number to use for the outgoing segment + * @param local_ip the local IP address to send the segment from + * @param remote_ip the remote IP address to send the segment to + * @param local_port the local TCP port to send the segment from + * @param remote_port the remote TCP port to send the segment to + */ +void +tcp_rst(u32_t seqno, u32_t ackno, + const ip_addr_t *local_ip, const ip_addr_t *remote_ip, + u16_t local_port, u16_t remote_port) +{ + struct pbuf *p; + struct tcp_hdr *tcphdr; + struct netif *netif; + p = pbuf_alloc(PBUF_IP, TCP_HLEN, PBUF_RAM); + if (p == NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_rst: could not allocate memory for pbuf\n")); + return; + } + LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr", + (p->len >= sizeof(struct tcp_hdr))); + + tcphdr = (struct tcp_hdr *)p->payload; + tcphdr->src = lwip_htons(local_port); + tcphdr->dest = lwip_htons(remote_port); + tcphdr->seqno = lwip_htonl(seqno); + tcphdr->ackno = lwip_htonl(ackno); + TCPH_HDRLEN_FLAGS_SET(tcphdr, TCP_HLEN/4, TCP_RST | TCP_ACK); +#if LWIP_WND_SCALE + tcphdr->wnd = PP_HTONS(((TCP_WND >> TCP_RCV_SCALE) & 0xFFFF)); +#else + tcphdr->wnd = PP_HTONS(TCP_WND); +#endif + tcphdr->chksum = 0; + tcphdr->urgp = 0; + + TCP_STATS_INC(tcp.xmit); + MIB2_STATS_INC(mib2.tcpoutrsts); + + netif = ip_route(local_ip, remote_ip); + if (netif != NULL) { +#if CHECKSUM_GEN_TCP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) { + tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + local_ip, remote_ip); + } +#endif + /* Send output with hardcoded TTL/HL since we have no access to the pcb */ + ip_output_if(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP, netif); + } + pbuf_free(p); + LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno)); +} + +/** + * Requeue all unacked segments for retransmission + * + * Called by tcp_slowtmr() for slow retransmission. + * + * @param pcb the tcp_pcb for which to re-enqueue all unacked segments + */ +void +tcp_rexmit_rto(struct tcp_pcb *pcb) +{ + struct tcp_seg *seg; + + if (pcb->unacked == NULL) { + return; + } + + /* Move all unacked segments to the head of the unsent queue */ + for (seg = pcb->unacked; seg->next != NULL; seg = seg->next); + /* concatenate unsent queue after unacked queue */ + seg->next = pcb->unsent; +#if TCP_OVERSIZE_DBGCHECK + /* if last unsent changed, we need to update unsent_oversize */ + if (pcb->unsent == NULL) { + pcb->unsent_oversize = seg->oversize_left; + } +#endif /* TCP_OVERSIZE_DBGCHECK */ + /* unsent queue is the concatenated queue (of unacked, unsent) */ + pcb->unsent = pcb->unacked; + /* unacked queue is now empty */ + pcb->unacked = NULL; + + /* increment number of retransmissions */ + if (pcb->nrtx < 0xFF) { + ++pcb->nrtx; + } + + /* Don't take any RTT measurements after retransmitting. */ + pcb->rttest = 0; + + /* Do the actual retransmission */ + tcp_output(pcb); +} + +/** + * Requeue the first unacked segment for retransmission + * + * Called by tcp_receive() for fast retransmit. + * + * @param pcb the tcp_pcb for which to retransmit the first unacked segment + */ +void +tcp_rexmit(struct tcp_pcb *pcb) +{ + struct tcp_seg *seg; + struct tcp_seg **cur_seg; + + if (pcb->unacked == NULL) { + return; + } + + /* Move the first unacked segment to the unsent queue */ + /* Keep the unsent queue sorted. */ + seg = pcb->unacked; + pcb->unacked = seg->next; + + cur_seg = &(pcb->unsent); + while (*cur_seg && + TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) { + cur_seg = &((*cur_seg)->next ); + } + seg->next = *cur_seg; + *cur_seg = seg; +#if TCP_OVERSIZE + if (seg->next == NULL) { + /* the retransmitted segment is last in unsent, so reset unsent_oversize */ + pcb->unsent_oversize = 0; + } +#endif /* TCP_OVERSIZE */ + + if (pcb->nrtx < 0xFF) { + ++pcb->nrtx; + } + + /* Don't take any rtt measurements after retransmitting. */ + pcb->rttest = 0; + + /* Do the actual retransmission. */ + MIB2_STATS_INC(mib2.tcpretranssegs); + /* No need to call tcp_output: we are always called from tcp_input() + and thus tcp_output directly returns. */ +} + + +/** + * Handle retransmission after three dupacks received + * + * @param pcb the tcp_pcb for which to retransmit the first unacked segment + */ +void +tcp_rexmit_fast(struct tcp_pcb *pcb) +{ + if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) { + /* This is fast retransmit. Retransmit the first unacked segment. */ + LWIP_DEBUGF(TCP_FR_DEBUG, + ("tcp_receive: dupacks %"U16_F" (%"U32_F + "), fast retransmit %"U32_F"\n", + (u16_t)pcb->dupacks, pcb->lastack, + lwip_ntohl(pcb->unacked->tcphdr->seqno))); + tcp_rexmit(pcb); + + /* Set ssthresh to half of the minimum of the current + * cwnd and the advertised window */ + pcb->ssthresh = LWIP_MIN(pcb->cwnd, pcb->snd_wnd) / 2; + + /* The minimum value for ssthresh should be 2 MSS */ + if (pcb->ssthresh < (2U * pcb->mss)) { + LWIP_DEBUGF(TCP_FR_DEBUG, + ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F + " should be min 2 mss %"U16_F"...\n", + pcb->ssthresh, (u16_t)(2*pcb->mss))); + pcb->ssthresh = 2*pcb->mss; + } + + pcb->cwnd = pcb->ssthresh + 3 * pcb->mss; + pcb->flags |= TF_INFR; + + /* Reset the retransmission timer to prevent immediate rto retransmissions */ + pcb->rtime = 0; + } +} + + +/** + * Send keepalive packets to keep a connection active although + * no data is sent over it. + * + * Called by tcp_slowtmr() + * + * @param pcb the tcp_pcb for which to send a keepalive packet + */ +err_t +tcp_keepalive(struct tcp_pcb *pcb) +{ + err_t err; + struct pbuf *p; + struct netif *netif; + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: sending KEEPALIVE probe to ")); + ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + LWIP_DEBUGF(TCP_DEBUG, ("\n")); + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent)); + + p = tcp_output_alloc_header(pcb, 0, 0, lwip_htonl(pcb->snd_nxt - 1)); + if (p == NULL) { + LWIP_DEBUGF(TCP_DEBUG, + ("tcp_keepalive: could not allocate memory for pbuf\n")); + return ERR_MEM; + } + netif = ip_route(&pcb->local_ip, &pcb->remote_ip); + if (netif == NULL) { + err = ERR_RTE; + } else { +#if CHECKSUM_GEN_TCP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) { + struct tcp_hdr *tcphdr = (struct tcp_hdr *)p->payload; + tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + &pcb->local_ip, &pcb->remote_ip); + } +#endif /* CHECKSUM_GEN_TCP */ + TCP_STATS_INC(tcp.xmit); + + /* Send output to IP */ + NETIF_SET_HWADDRHINT(netif, &(pcb->addr_hint)); + err = ip_output_if(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + } + pbuf_free(p); + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F" err %d.\n", + pcb->snd_nxt - 1, pcb->rcv_nxt, (int)err)); + return err; +} + + +/** + * Send persist timer zero-window probes to keep a connection active + * when a window update is lost. + * + * Called by tcp_slowtmr() + * + * @param pcb the tcp_pcb for which to send a zero-window probe packet + */ +err_t +tcp_zero_window_probe(struct tcp_pcb *pcb) +{ + err_t err; + struct pbuf *p; + struct tcp_hdr *tcphdr; + struct tcp_seg *seg; + u16_t len; + u8_t is_fin; + u32_t snd_nxt; + struct netif *netif; + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: sending ZERO WINDOW probe to ")); + ip_addr_debug_print(TCP_DEBUG, &pcb->remote_ip); + LWIP_DEBUGF(TCP_DEBUG, ("\n")); + + LWIP_DEBUGF(TCP_DEBUG, + ("tcp_zero_window_probe: tcp_ticks %"U32_F + " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent)); + + seg = pcb->unacked; + + if (seg == NULL) { + seg = pcb->unsent; + } + if (seg == NULL) { + /* nothing to send, zero window probe not needed */ + return ERR_OK; + } + + is_fin = ((TCPH_FLAGS(seg->tcphdr) & TCP_FIN) != 0) && (seg->len == 0); + /* we want to send one seqno: either FIN or data (no options) */ + len = is_fin ? 0 : 1; + + p = tcp_output_alloc_header(pcb, 0, len, seg->tcphdr->seqno); + if (p == NULL) { + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: no memory for pbuf\n")); + return ERR_MEM; + } + tcphdr = (struct tcp_hdr *)p->payload; + + if (is_fin) { + /* FIN segment, no data */ + TCPH_FLAGS_SET(tcphdr, TCP_ACK | TCP_FIN); + } else { + /* Data segment, copy in one byte from the head of the unacked queue */ + char *d = ((char *)p->payload + TCP_HLEN); + /* Depending on whether the segment has already been sent (unacked) or not + (unsent), seg->p->payload points to the IP header or TCP header. + Ensure we copy the first TCP data byte: */ + pbuf_copy_partial(seg->p, d, 1, seg->p->tot_len - seg->len); + } + + /* The byte may be acknowledged without the window being opened. */ + snd_nxt = lwip_ntohl(seg->tcphdr->seqno) + 1; + if (TCP_SEQ_LT(pcb->snd_nxt, snd_nxt)) { + pcb->snd_nxt = snd_nxt; + } + + netif = ip_route(&pcb->local_ip, &pcb->remote_ip); + if (netif == NULL) { + err = ERR_RTE; + } else { +#if CHECKSUM_GEN_TCP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) { + tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + &pcb->local_ip, &pcb->remote_ip); + } +#endif + TCP_STATS_INC(tcp.xmit); + + /* Send output to IP */ + NETIF_SET_HWADDRHINT(netif, &(pcb->addr_hint)); + err = ip_output_if(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, + 0, IP_PROTO_TCP, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + } + + pbuf_free(p); + + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: seqno %"U32_F + " ackno %"U32_F" err %d.\n", + pcb->snd_nxt - 1, pcb->rcv_nxt, (int)err)); + return err; +} +#endif /* LWIP_TCP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/timeouts.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/timeouts.c new file mode 100644 index 0000000..227d71f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/timeouts.c @@ -0,0 +1,433 @@ +/** + * @file + * Stack-internal timers implementation. + * This file includes timer callbacks for stack-internal timers as well as + * functions to set up or stop timers and check for expired timers. + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * Simon Goldschmidt + * + */ + +#include "lwip/opt.h" + +#include "lwip/timeouts.h" +#include "lwip/priv/tcp_priv.h" + +#include "lwip/def.h" +#include "lwip/memp.h" +#include "lwip/priv/tcpip_priv.h" + +#include "lwip/ip4_frag.h" +#include "lwip/etharp.h" +#include "lwip/dhcp.h" +#include "lwip/autoip.h" +#include "lwip/igmp.h" +#include "lwip/dns.h" +#include "lwip/nd6.h" +#include "lwip/ip6_frag.h" +#include "lwip/mld6.h" +#include "lwip/sys.h" +#include "lwip/pbuf.h" + +#if LWIP_DEBUG_TIMERNAMES +#define HANDLER(x) x, #x +#else /* LWIP_DEBUG_TIMERNAMES */ +#define HANDLER(x) x +#endif /* LWIP_DEBUG_TIMERNAMES */ + +/** This array contains all stack-internal cyclic timers. To get the number of + * timers, use LWIP_ARRAYSIZE() */ +const struct lwip_cyclic_timer lwip_cyclic_timers[] = { +#if LWIP_TCP + /* The TCP timer is a special case: it does not have to run always and + is triggered to start from TCP using tcp_timer_needed() */ + {TCP_TMR_INTERVAL, HANDLER(tcp_tmr)}, +#endif /* LWIP_TCP */ +#if LWIP_IPV4 +#if IP_REASSEMBLY + {IP_TMR_INTERVAL, HANDLER(ip_reass_tmr)}, +#endif /* IP_REASSEMBLY */ +#if LWIP_ARP + {ARP_TMR_INTERVAL, HANDLER(etharp_tmr)}, +#endif /* LWIP_ARP */ +#if LWIP_DHCP + {DHCP_COARSE_TIMER_MSECS, HANDLER(dhcp_coarse_tmr)}, + {DHCP_FINE_TIMER_MSECS, HANDLER(dhcp_fine_tmr)}, +#endif /* LWIP_DHCP */ +#if LWIP_AUTOIP + {AUTOIP_TMR_INTERVAL, HANDLER(autoip_tmr)}, +#endif /* LWIP_AUTOIP */ +#if LWIP_IGMP + {IGMP_TMR_INTERVAL, HANDLER(igmp_tmr)}, +#endif /* LWIP_IGMP */ +#endif /* LWIP_IPV4 */ +#if LWIP_DNS + {DNS_TMR_INTERVAL, HANDLER(dns_tmr)}, +#endif /* LWIP_DNS */ +#if LWIP_IPV6 + {ND6_TMR_INTERVAL, HANDLER(nd6_tmr)}, +#if LWIP_IPV6_REASS + {IP6_REASS_TMR_INTERVAL, HANDLER(ip6_reass_tmr)}, +#endif /* LWIP_IPV6_REASS */ +#if LWIP_IPV6_MLD + {MLD6_TMR_INTERVAL, HANDLER(mld6_tmr)}, +#endif /* LWIP_IPV6_MLD */ +#endif /* LWIP_IPV6 */ +}; + +#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM + +/** The one and only timeout list */ +static struct sys_timeo *next_timeout; +static u32_t timeouts_last_time; + +#if LWIP_TCP +/** global variable that shows if the tcp timer is currently scheduled or not */ +static int tcpip_tcp_timer_active; + +/** + * Timer callback function that calls tcp_tmr() and reschedules itself. + * + * @param arg unused argument + */ +static void +tcpip_tcp_timer(void *arg) +{ + LWIP_UNUSED_ARG(arg); + + /* call TCP timer handler */ + tcp_tmr(); + /* timer still needed? */ + if (tcp_active_pcbs || tcp_tw_pcbs) { + /* restart timer */ + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + } else { + /* disable timer */ + tcpip_tcp_timer_active = 0; + } +} + +/** + * Called from TCP_REG when registering a new PCB: + * the reason is to have the TCP timer only running when + * there are active (or time-wait) PCBs. + */ +void +tcp_timer_needed(void) +{ + /* timer is off but needed again? */ + if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { + /* enable and start timer */ + tcpip_tcp_timer_active = 1; + sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); + } +} +#endif /* LWIP_TCP */ + +/** + * Timer callback function that calls mld6_tmr() and reschedules itself. + * + * @param arg unused argument + */ +static void +cyclic_timer(void *arg) +{ + const struct lwip_cyclic_timer* cyclic = (const struct lwip_cyclic_timer*)arg; +#if LWIP_DEBUG_TIMERNAMES + LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: %s()\n", cyclic->handler_name)); +#endif + cyclic->handler(); + sys_timeout(cyclic->interval_ms, cyclic_timer, arg); +} + +/** Initialize this module */ +void sys_timeouts_init(void) +{ + size_t i; + /* tcp_tmr() at index 0 is started on demand */ + for (i = 1; i < LWIP_ARRAYSIZE(lwip_cyclic_timers); i++) { + /* we have to cast via size_t to get rid of const warning + (this is OK as cyclic_timer() casts back to const* */ + sys_timeout(lwip_cyclic_timers[i].interval_ms, cyclic_timer, LWIP_CONST_CAST(void*, &lwip_cyclic_timers[i])); + } + + /* Initialise timestamp for sys_check_timeouts */ + timeouts_last_time = sys_now(); +} + +/** + * Create a one-shot timer (aka timeout). Timeouts are processed in the + * following cases: + * - while waiting for a message using sys_timeouts_mbox_fetch() + * - by calling sys_check_timeouts() (NO_SYS==1 only) + * + * @param msecs time in milliseconds after that the timer should expire + * @param handler callback function to call when msecs have elapsed + * @param arg argument to pass to the callback function + */ +#if LWIP_DEBUG_TIMERNAMES +void +sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name) +#else /* LWIP_DEBUG_TIMERNAMES */ +void +sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) +#endif /* LWIP_DEBUG_TIMERNAMES */ +{ + struct sys_timeo *timeout, *t; + u32_t now, diff; + + timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT); + if (timeout == NULL) { + LWIP_ASSERT("sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout != NULL); + return; + } + + now = sys_now(); + if (next_timeout == NULL) { + diff = 0; + timeouts_last_time = now; + } else { + diff = now - timeouts_last_time; + } + + timeout->next = NULL; + timeout->h = handler; + timeout->arg = arg; + timeout->time = msecs + diff; +#if LWIP_DEBUG_TIMERNAMES + timeout->handler_name = handler_name; + LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n", + (void *)timeout, msecs, handler_name, (void *)arg)); +#endif /* LWIP_DEBUG_TIMERNAMES */ + + if (next_timeout == NULL) { + next_timeout = timeout; + return; + } + + if (next_timeout->time > msecs) { + next_timeout->time -= msecs; + timeout->next = next_timeout; + next_timeout = timeout; + } else { + for (t = next_timeout; t != NULL; t = t->next) { + timeout->time -= t->time; + if (t->next == NULL || t->next->time > timeout->time) { + if (t->next != NULL) { + t->next->time -= timeout->time; + } else if (timeout->time > msecs) { + /* If this is the case, 'timeouts_last_time' and 'now' differs too much. + This can be due to sys_check_timeouts() not being called at the right + times, but also when stopping in a breakpoint. Anyway, let's assume + this is not wanted, so add the first timer's time instead of 'diff' */ + timeout->time = msecs + next_timeout->time; + } + timeout->next = t->next; + t->next = timeout; + break; + } + } + } +} + +/** + * Go through timeout list (for this task only) and remove the first matching + * entry (subsequent entries remain untouched), even though the timeout has not + * triggered yet. + * + * @param handler callback function that would be called by the timeout + * @param arg callback argument that would be passed to handler +*/ +void +sys_untimeout(sys_timeout_handler handler, void *arg) +{ + struct sys_timeo *prev_t, *t; + + if (next_timeout == NULL) { + return; + } + + for (t = next_timeout, prev_t = NULL; t != NULL; prev_t = t, t = t->next) { + if ((t->h == handler) && (t->arg == arg)) { + /* We have a match */ + /* Unlink from previous in list */ + if (prev_t == NULL) { + next_timeout = t->next; + } else { + prev_t->next = t->next; + } + /* If not the last one, add time of this one back to next */ + if (t->next != NULL) { + t->next->time += t->time; + } + memp_free(MEMP_SYS_TIMEOUT, t); + return; + } + } + return; +} + +/** + * @ingroup lwip_nosys + * Handle timeouts for NO_SYS==1 (i.e. without using + * tcpip_thread/sys_timeouts_mbox_fetch(). Uses sys_now() to call timeout + * handler functions when timeouts expire. + * + * Must be called periodically from your main loop. + */ +#if !NO_SYS && !defined __DOXYGEN__ +static +#endif /* !NO_SYS */ +void +sys_check_timeouts(void) +{ + if (next_timeout) { + struct sys_timeo *tmptimeout; + u32_t diff; + sys_timeout_handler handler; + void *arg; + u8_t had_one; + u32_t now; + + now = sys_now(); + /* this cares for wraparounds */ + diff = now - timeouts_last_time; + do { + PBUF_CHECK_FREE_OOSEQ(); + had_one = 0; + tmptimeout = next_timeout; + if (tmptimeout && (tmptimeout->time <= diff)) { + /* timeout has expired */ + had_one = 1; + timeouts_last_time += tmptimeout->time; + diff -= tmptimeout->time; + next_timeout = tmptimeout->next; + handler = tmptimeout->h; + arg = tmptimeout->arg; +#if LWIP_DEBUG_TIMERNAMES + if (handler != NULL) { + LWIP_DEBUGF(TIMERS_DEBUG, ("sct calling h=%s arg=%p\n", + tmptimeout->handler_name, arg)); + } +#endif /* LWIP_DEBUG_TIMERNAMES */ + memp_free(MEMP_SYS_TIMEOUT, tmptimeout); + if (handler != NULL) { +#if !NO_SYS + /* For LWIP_TCPIP_CORE_LOCKING, lock the core before calling the + timeout handler function. */ + LOCK_TCPIP_CORE(); +#endif /* !NO_SYS */ + handler(arg); +#if !NO_SYS + UNLOCK_TCPIP_CORE(); +#endif /* !NO_SYS */ + } + LWIP_TCPIP_THREAD_ALIVE(); + } + /* repeat until all expired timers have been called */ + } while (had_one); + } +} + +/** Set back the timestamp of the last call to sys_check_timeouts() + * This is necessary if sys_check_timeouts() hasn't been called for a long + * time (e.g. while saving energy) to prevent all timer functions of that + * period being called. + */ +void +sys_restart_timeouts(void) +{ + timeouts_last_time = sys_now(); +} + +/** Return the time left before the next timeout is due. If no timeouts are + * enqueued, returns 0xffffffff + */ +#if !NO_SYS +static +#endif /* !NO_SYS */ +u32_t +sys_timeouts_sleeptime(void) +{ + u32_t diff; + if (next_timeout == NULL) { + return 0xffffffff; + } + diff = sys_now() - timeouts_last_time; + if (diff > next_timeout->time) { + return 0; + } else { + return next_timeout->time - diff; + } +} + +#if !NO_SYS + +/** + * Wait (forever) for a message to arrive in an mbox. + * While waiting, timeouts are processed. + * + * @param mbox the mbox to fetch the message from + * @param msg the place to store the message + */ +void +sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg) +{ + u32_t sleeptime; + +again: + if (!next_timeout) { + sys_arch_mbox_fetch(mbox, msg, 0); + return; + } + + sleeptime = sys_timeouts_sleeptime(); + if (sleeptime == 0 || sys_arch_mbox_fetch(mbox, msg, sleeptime) == SYS_ARCH_TIMEOUT) { + /* If a SYS_ARCH_TIMEOUT value is returned, a timeout occurred + before a message could be fetched. */ + sys_check_timeouts(); + /* We try again to fetch a message from the mbox. */ + goto again; + } +} + +#endif /* NO_SYS */ + +#else /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */ +/* Satisfy the TCP code which calls this function */ +void +tcp_timer_needed(void) +{ +} +#endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/udp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/udp.c new file mode 100644 index 0000000..ce2e3d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/core/udp.c @@ -0,0 +1,1191 @@ +/** + * @file + * User Datagram Protocol module\n + * The code for the User Datagram Protocol UDP & UDPLite (RFC 3828).\n + * See also @ref udp_raw + * + * @defgroup udp_raw UDP + * @ingroup callbackstyle_api + * User Datagram Protocol module\n + * @see @ref raw_api and @ref netconn + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +/* @todo Check the use of '(struct udp_pcb).chksum_len_rx'! + */ + +#include "lwip/opt.h" + +#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/udp.h" +#include "lwip/def.h" +#include "lwip/memp.h" +#include "lwip/inet_chksum.h" +#include "lwip/ip_addr.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" +#include "lwip/icmp.h" +#include "lwip/icmp6.h" +#include "lwip/stats.h" +#include "lwip/snmp.h" +#include "lwip/dhcp.h" + +#include + +#ifndef UDP_LOCAL_PORT_RANGE_START +/* From http://www.iana.org/assignments/port-numbers: + "The Dynamic and/or Private Ports are those from 49152 through 65535" */ +#define UDP_LOCAL_PORT_RANGE_START 0xc000 +#define UDP_LOCAL_PORT_RANGE_END 0xffff +#define UDP_ENSURE_LOCAL_PORT_RANGE(port) ((u16_t)(((port) & ~UDP_LOCAL_PORT_RANGE_START) + UDP_LOCAL_PORT_RANGE_START)) +#endif + +/* last local UDP port */ +static u16_t udp_port = UDP_LOCAL_PORT_RANGE_START; + +/* The list of UDP PCBs */ +/* exported in udp.h (was static) */ +struct udp_pcb *udp_pcbs; + +/** + * Initialize this module. + */ +void +udp_init(void) +{ +#if LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) + udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND()); +#endif /* LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) */ +} + +/** + * Allocate a new local UDP port. + * + * @return a new (free) local UDP port number + */ +static u16_t +udp_new_port(void) +{ + u16_t n = 0; + struct udp_pcb *pcb; + +again: + if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) { + udp_port = UDP_LOCAL_PORT_RANGE_START; + } + /* Check all PCBs. */ + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->local_port == udp_port) { + if (++n > (UDP_LOCAL_PORT_RANGE_END - UDP_LOCAL_PORT_RANGE_START)) { + return 0; + } + goto again; + } + } + return udp_port; +} + +/** Common code to see if the current input packet matches the pcb + * (current input packet is accessed via ip(4/6)_current_* macros) + * + * @param pcb pcb to check + * @param inp network interface on which the datagram was received (only used for IPv4) + * @param broadcast 1 if his is an IPv4 broadcast (global or subnet-only), 0 otherwise (only used for IPv4) + * @return 1 on match, 0 otherwise + */ +static u8_t +udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast) +{ + LWIP_UNUSED_ARG(inp); /* in IPv6 only case */ + LWIP_UNUSED_ARG(broadcast); /* in IPv6 only case */ + + /* Dual-stack: PCBs listening to any IP type also listen to any IP address */ + if (IP_IS_ANY_TYPE_VAL(pcb->local_ip)) { +#if LWIP_IPV4 && IP_SOF_BROADCAST_RECV + if ((broadcast != 0) && !ip_get_option(pcb, SOF_BROADCAST)) { + return 0; + } +#endif /* LWIP_IPV4 && IP_SOF_BROADCAST_RECV */ + return 1; + } + + /* Only need to check PCB if incoming IP version matches PCB IP version */ + if (IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ip_current_dest_addr())) { +#if LWIP_IPV4 + /* Special case: IPv4 broadcast: all or broadcasts in my subnet + * Note: broadcast variable can only be 1 if it is an IPv4 broadcast */ + if (broadcast != 0) { +#if IP_SOF_BROADCAST_RECV + if (ip_get_option(pcb, SOF_BROADCAST)) +#endif /* IP_SOF_BROADCAST_RECV */ + { + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + ((ip4_current_dest_addr()->addr == IPADDR_BROADCAST)) || + ip4_addr_netcmp(ip_2_ip4(&pcb->local_ip), ip4_current_dest_addr(), netif_ip4_netmask(inp))) { + return 1; + } + } + } else +#endif /* LWIP_IPV4 */ + /* Handle IPv4 and IPv6: all or exact match */ + if (ip_addr_isany(&pcb->local_ip) || ip_addr_cmp(&pcb->local_ip, ip_current_dest_addr())) { + return 1; + } + } + + return 0; +} + +/** + * Process an incoming UDP datagram. + * + * Given an incoming UDP datagram (as a chain of pbufs) this function + * finds a corresponding UDP PCB and hands over the pbuf to the pcbs + * recv function. If no pcb is found or the datagram is incorrect, the + * pbuf is freed. + * + * @param p pbuf to be demultiplexed to a UDP PCB (p->payload pointing to the UDP header) + * @param inp network interface on which the datagram was received. + * + */ +void +udp_input(struct pbuf *p, struct netif *inp) +{ + struct udp_hdr *udphdr; + struct udp_pcb *pcb, *prev; + struct udp_pcb *uncon_pcb; + u16_t src, dest; + u8_t broadcast; + u8_t for_us = 0; + + LWIP_UNUSED_ARG(inp); + + PERF_START; + + UDP_STATS_INC(udp.recv); + + /* Check minimum length (UDP header) */ + if (p->len < UDP_HLEN) { + /* drop short packets */ + LWIP_DEBUGF(UDP_DEBUG, + ("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len)); + UDP_STATS_INC(udp.lenerr); + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + goto end; + } + + udphdr = (struct udp_hdr *)p->payload; + + /* is broadcast packet ? */ + broadcast = ip_addr_isbroadcast(ip_current_dest_addr(), ip_current_netif()); + + LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len)); + + /* convert src and dest ports to host byte order */ + src = lwip_ntohs(udphdr->src); + dest = lwip_ntohs(udphdr->dest); + + udp_debug_print(udphdr); + + /* print the UDP source and destination */ + LWIP_DEBUGF(UDP_DEBUG, ("udp (")); + ip_addr_debug_print(UDP_DEBUG, ip_current_dest_addr()); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", lwip_ntohs(udphdr->dest))); + ip_addr_debug_print(UDP_DEBUG, ip_current_src_addr()); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", lwip_ntohs(udphdr->src))); + + pcb = NULL; + prev = NULL; + uncon_pcb = NULL; + /* Iterate through the UDP pcb list for a matching pcb. + * 'Perfect match' pcbs (connected to the remote port & ip address) are + * preferred. If no perfect match is found, the first unconnected pcb that + * matches the local port and ip address gets the datagram. */ + for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + /* print the PCB local and remote address */ + LWIP_DEBUGF(UDP_DEBUG, ("pcb (")); + ip_addr_debug_print(UDP_DEBUG, &pcb->local_ip); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F") <-- (", pcb->local_port)); + ip_addr_debug_print(UDP_DEBUG, &pcb->remote_ip); + LWIP_DEBUGF(UDP_DEBUG, (", %"U16_F")\n", pcb->remote_port)); + + /* compare PCB local addr+port to UDP destination addr+port */ + if ((pcb->local_port == dest) && + (udp_input_local_match(pcb, inp, broadcast) != 0)) { + if (((pcb->flags & UDP_FLAGS_CONNECTED) == 0) && + ((uncon_pcb == NULL) +#if SO_REUSE + /* prefer specific IPs over cath-all */ + || !ip_addr_isany(&pcb->local_ip) +#endif /* SO_REUSE */ + )) { + /* the first unconnected matching PCB */ + uncon_pcb = pcb; + } + + /* compare PCB remote addr+port to UDP source addr+port */ + if ((pcb->remote_port == src) && + (ip_addr_isany_val(pcb->remote_ip) || + ip_addr_cmp(&pcb->remote_ip, ip_current_src_addr()))) { + /* the first fully matching PCB */ + if (prev != NULL) { + /* move the pcb to the front of udp_pcbs so that is + found faster next time */ + prev->next = pcb->next; + pcb->next = udp_pcbs; + udp_pcbs = pcb; + } else { + UDP_STATS_INC(udp.cachehit); + } + break; + } + } + + prev = pcb; + } + /* no fully matching pcb found? then look for an unconnected pcb */ + if (pcb == NULL) { + pcb = uncon_pcb; + } + + /* Check checksum if this is a match or if it was directed at us. */ + if (pcb != NULL) { + for_us = 1; + } else { +#if LWIP_IPV6 + if (ip_current_is_v6()) { + for_us = netif_get_ip6_addr_match(inp, ip6_current_dest_addr()) >= 0; + } +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 + if (!ip_current_is_v6()) { + for_us = ip4_addr_cmp(netif_ip4_addr(inp), ip4_current_dest_addr()); + } +#endif /* LWIP_IPV4 */ + } + + if (for_us) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: calculating checksum\n")); +#if CHECKSUM_CHECK_UDP + IF__NETIF_CHECKSUM_ENABLED(inp, CHECKSUM_CHECK_UDP) { +#if LWIP_UDPLITE + if (ip_current_header_proto() == IP_PROTO_UDPLITE) { + /* Do the UDP Lite checksum */ + u16_t chklen = lwip_ntohs(udphdr->len); + if (chklen < sizeof(struct udp_hdr)) { + if (chklen == 0) { + /* For UDP-Lite, checksum length of 0 means checksum + over the complete packet (See RFC 3828 chap. 3.1) */ + chklen = p->tot_len; + } else { + /* At least the UDP-Lite header must be covered by the + checksum! (Again, see RFC 3828 chap. 3.1) */ + goto chkerr; + } + } + if (ip_chksum_pseudo_partial(p, IP_PROTO_UDPLITE, + p->tot_len, chklen, + ip_current_src_addr(), ip_current_dest_addr()) != 0) { + goto chkerr; + } + } else +#endif /* LWIP_UDPLITE */ + { + if (udphdr->chksum != 0) { + if (ip_chksum_pseudo(p, IP_PROTO_UDP, p->tot_len, + ip_current_src_addr(), + ip_current_dest_addr()) != 0) { + goto chkerr; + } + } + } + } +#endif /* CHECKSUM_CHECK_UDP */ + if (pbuf_header(p, -UDP_HLEN)) { + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_header failed\n", 0); + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + goto end; + } + + if (pcb != NULL) { + MIB2_STATS_INC(mib2.udpindatagrams); +#if SO_REUSE && SO_REUSE_RXTOALL + if (ip_get_option(pcb, SOF_REUSEADDR) && + (broadcast || ip_addr_ismulticast(ip_current_dest_addr()))) { + /* pass broadcast- or multicast packets to all multicast pcbs + if SOF_REUSEADDR is set on the first match */ + struct udp_pcb *mpcb; + u8_t p_header_changed = 0; + s16_t hdrs_len = (s16_t)(ip_current_header_tot_len() + UDP_HLEN); + for (mpcb = udp_pcbs; mpcb != NULL; mpcb = mpcb->next) { + if (mpcb != pcb) { + /* compare PCB local addr+port to UDP destination addr+port */ + if ((mpcb->local_port == dest) && + (udp_input_local_match(mpcb, inp, broadcast) != 0)) { + /* pass a copy of the packet to all local matches */ + if (mpcb->recv != NULL) { + struct pbuf *q; + /* for that, move payload to IP header again */ + if (p_header_changed == 0) { + pbuf_header_force(p, hdrs_len); + p_header_changed = 1; + } + q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); + if (q != NULL) { + err_t err = pbuf_copy(q, p); + if (err == ERR_OK) { + /* move payload to UDP data */ + pbuf_header(q, -hdrs_len); + mpcb->recv(mpcb->recv_arg, mpcb, q, ip_current_src_addr(), src); + } + } + } + } + } + } + if (p_header_changed) { + /* and move payload to UDP data again */ + pbuf_header(p, -hdrs_len); + } + } +#endif /* SO_REUSE && SO_REUSE_RXTOALL */ + /* callback */ + if (pcb->recv != NULL) { + /* now the recv function is responsible for freeing p */ + pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src); + } else { + /* no recv function registered? then we have to free the pbuf! */ + pbuf_free(p); + goto end; + } + } else { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n")); + +#if LWIP_ICMP || LWIP_ICMP6 + /* No match was found, send ICMP destination port unreachable unless + destination address was broadcast/multicast. */ + if (!broadcast && !ip_addr_ismulticast(ip_current_dest_addr())) { + /* move payload pointer back to ip header */ + pbuf_header_force(p, (s16_t)(ip_current_header_tot_len() + UDP_HLEN)); + icmp_port_unreach(ip_current_is_v6(), p); + } +#endif /* LWIP_ICMP || LWIP_ICMP6 */ + UDP_STATS_INC(udp.proterr); + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpnoports); + pbuf_free(p); + } + } else { + pbuf_free(p); + } +end: + PERF_STOP("udp_input"); + return; +#if CHECKSUM_CHECK_UDP +chkerr: + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("udp_input: UDP (or UDP Lite) datagram discarded due to failing checksum\n")); + UDP_STATS_INC(udp.chkerr); + UDP_STATS_INC(udp.drop); + MIB2_STATS_INC(mib2.udpinerrors); + pbuf_free(p); + PERF_STOP("udp_input"); +#endif /* CHECKSUM_CHECK_UDP */ +} + +/** + * @ingroup udp_raw + * Send data using UDP. + * + * @param pcb UDP PCB used to send the data. + * @param p chain of pbuf's to be sent. + * + * The datagram will be sent to the current remote_ip & remote_port + * stored in pcb. If the pcb is not bound to a port, it will + * automatically be bound to a random port. + * + * @return lwIP error code. + * - ERR_OK. Successful. No error occurred. + * - ERR_MEM. Out of memory. + * - ERR_RTE. Could not find route to destination address. + * - ERR_VAL. No PCB or PCB is dual-stack + * - More errors could be returned by lower protocol layers. + * + * @see udp_disconnect() udp_sendto() + */ +err_t +udp_send(struct udp_pcb *pcb, struct pbuf *p) +{ + if ((pcb == NULL) || IP_IS_ANY_TYPE_VAL(pcb->remote_ip)) { + return ERR_VAL; + } + + /* send to the packet using remote ip and port stored in the pcb */ + return udp_sendto(pcb, p, &pcb->remote_ip, pcb->remote_port); +} + +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP +/** @ingroup udp_raw + * Same as udp_send() but with checksum + */ +err_t +udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, + u8_t have_chksum, u16_t chksum) +{ + if ((pcb == NULL) || IP_IS_ANY_TYPE_VAL(pcb->remote_ip)) { + return ERR_VAL; + } + + /* send to the packet using remote ip and port stored in the pcb */ + return udp_sendto_chksum(pcb, p, &pcb->remote_ip, pcb->remote_port, + have_chksum, chksum); +} +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + +/** + * @ingroup udp_raw + * Send data to a specified address using UDP. + * + * @param pcb UDP PCB used to send the data. + * @param p chain of pbuf's to be sent. + * @param dst_ip Destination IP address. + * @param dst_port Destination UDP port. + * + * dst_ip & dst_port are expected to be in the same byte order as in the pcb. + * + * If the PCB already has a remote address association, it will + * be restored after the data is sent. + * + * @return lwIP error code (@see udp_send for possible error codes) + * + * @see udp_disconnect() udp_send() + */ +err_t +udp_sendto(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port) +{ +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_chksum(pcb, p, dst_ip, dst_port, 0, 0); +} + +/** @ingroup udp_raw + * Same as udp_sendto(), but with checksum */ +err_t +udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, + u16_t dst_port, u8_t have_chksum, u16_t chksum) +{ +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + struct netif *netif; + const ip_addr_t *dst_ip_route = dst_ip; + + if ((pcb == NULL) || (dst_ip == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, dst_ip)) { + return ERR_VAL; + } + + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send\n")); + +#if LWIP_IPV6 || (LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS) + if (ip_addr_ismulticast(dst_ip_route)) { +#if LWIP_IPV6 + if (IP_IS_V6(dst_ip)) { + /* For multicast, find a netif based on source address. */ + dst_ip_route = &pcb->local_ip; + } else +#endif /* LWIP_IPV6 */ + { +#if LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS + /* IPv4 does not use source-based routing by default, so we use an + administratively selected interface for multicast by default. + However, this can be overridden by setting an interface address + in pcb->multicast_ip that is used for routing. */ + if (!ip_addr_isany_val(pcb->multicast_ip) && + !ip4_addr_cmp(ip_2_ip4(&pcb->multicast_ip), IP4_ADDR_BROADCAST)) { + dst_ip_route = &pcb->multicast_ip; + } +#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS */ + } + } +#endif /* LWIP_IPV6 || (LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS) */ + + /* find the outgoing network interface for this packet */ + if(IP_IS_ANY_TYPE_VAL(pcb->local_ip)) { + /* Don't call ip_route() with IP_ANY_TYPE */ + netif = ip_route(IP46_ADDR_ANY(IP_GET_TYPE(dst_ip_route)), dst_ip_route); + } else { + netif = ip_route(&pcb->local_ip, dst_ip_route); + } + + /* no outgoing network interface could be found? */ + if (netif == NULL) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: No route to ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, dst_ip); + LWIP_DEBUGF(UDP_DEBUG, ("\n")); + UDP_STATS_INC(udp.rterr); + return ERR_RTE; + } +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum); +#else /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + return udp_sendto_if(pcb, p, dst_ip, dst_port, netif); +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ +} + +/** + * @ingroup udp_raw + * Send data to a specified address using UDP. + * The netif used for sending can be specified. + * + * This function exists mainly for DHCP, to be able to send UDP packets + * on a netif that is still down. + * + * @param pcb UDP PCB used to send the data. + * @param p chain of pbuf's to be sent. + * @param dst_ip Destination IP address. + * @param dst_port Destination UDP port. + * @param netif the netif used for sending. + * + * dst_ip & dst_port are expected to be in the same byte order as in the pcb. + * + * @return lwIP error code (@see udp_send for possible error codes) + * + * @see udp_disconnect() udp_send() + */ +err_t +udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif) +{ +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, 0, 0); +} + +/** Same as udp_sendto_if(), but with checksum */ +err_t +udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, + u16_t dst_port, struct netif *netif, u8_t have_chksum, + u16_t chksum) +{ +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + const ip_addr_t *src_ip; + + if ((pcb == NULL) || (dst_ip == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, dst_ip)) { + return ERR_VAL; + } + + /* PCB local address is IP_ANY_ADDR? */ +#if LWIP_IPV6 + if (IP_IS_V6(dst_ip)) { + if (ip6_addr_isany(ip_2_ip6(&pcb->local_ip))) { + src_ip = ip6_select_source_address(netif, ip_2_ip6(dst_ip)); + if (src_ip == NULL) { + /* No suitable source address was found. */ + return ERR_RTE; + } + } else { + /* use UDP PCB local IPv6 address as source address, if still valid. */ + if (netif_get_ip6_addr_match(netif, ip_2_ip6(&pcb->local_ip)) < 0) { + /* Address isn't valid anymore. */ + return ERR_RTE; + } + src_ip = &pcb->local_ip; + } + } +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 && LWIP_IPV6 + else +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#if LWIP_IPV4 + if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip)) || + ip4_addr_ismulticast(ip_2_ip4(&pcb->local_ip))) { + /* if the local_ip is any or multicast + * use the outgoing network interface IP address as source address */ + src_ip = netif_ip_addr4(netif); + } else { + /* check if UDP PCB local IP address is correct + * this could be an old address if netif->ip_addr has changed */ + if (!ip4_addr_cmp(ip_2_ip4(&(pcb->local_ip)), netif_ip4_addr(netif))) { + /* local_ip doesn't match, drop the packet */ + return ERR_RTE; + } + /* use UDP PCB local IP address as source address */ + src_ip = &pcb->local_ip; + } +#endif /* LWIP_IPV4 */ +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_src_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum, src_ip); +#else /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + return udp_sendto_if_src(pcb, p, dst_ip, dst_port, netif, src_ip); +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ +} + +/** @ingroup udp_raw + * Same as @ref udp_sendto_if, but with source address */ +err_t +udp_sendto_if_src(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif, const ip_addr_t *src_ip) +{ +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP + return udp_sendto_if_src_chksum(pcb, p, dst_ip, dst_port, netif, 0, 0, src_ip); +} + +/** Same as udp_sendto_if_src(), but with checksum */ +err_t +udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, + u16_t dst_port, struct netif *netif, u8_t have_chksum, + u16_t chksum, const ip_addr_t *src_ip) +{ +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + struct udp_hdr *udphdr; + err_t err; + struct pbuf *q; /* q will be sent down the stack */ + u8_t ip_proto; + u8_t ttl; + + if ((pcb == NULL) || (dst_ip == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, src_ip) || + !IP_ADDR_PCB_VERSION_MATCH(pcb, dst_ip)) { + return ERR_VAL; + } + +#if LWIP_IPV4 && IP_SOF_BROADCAST + /* broadcast filter? */ + if (!ip_get_option(pcb, SOF_BROADCAST) && +#if LWIP_IPV6 + IP_IS_V4(dst_ip) && +#endif /* LWIP_IPV6 */ + ip_addr_isbroadcast(dst_ip, netif)) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, + ("udp_sendto_if: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb)); + return ERR_VAL; + } +#endif /* LWIP_IPV4 && IP_SOF_BROADCAST */ + + /* if the PCB is not yet bound to a port, bind it here */ + if (pcb->local_port == 0) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send: not yet bound to a port, binding now\n")); + err = udp_bind(pcb, &pcb->local_ip, pcb->local_port); + if (err != ERR_OK) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: forced port bind failed\n")); + return err; + } + } + + /* not enough space to add an UDP header to first pbuf in given p chain? */ + if (pbuf_header(p, UDP_HLEN)) { + /* allocate header in a separate new pbuf */ + q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM); + /* new header pbuf could not be allocated? */ + if (q == NULL) { + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n")); + return ERR_MEM; + } + if (p->tot_len != 0) { + /* chain header q in front of given pbuf p (only if p contains data) */ + pbuf_chain(q, p); + } + /* first pbuf q points to header pbuf */ + LWIP_DEBUGF(UDP_DEBUG, + ("udp_send: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p)); + } else { + /* adding space for header within p succeeded */ + /* first pbuf q equals given pbuf */ + q = p; + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p)); + } + LWIP_ASSERT("check that first pbuf can hold struct udp_hdr", + (q->len >= sizeof(struct udp_hdr))); + /* q now represents the packet to be sent */ + udphdr = (struct udp_hdr *)q->payload; + udphdr->src = lwip_htons(pcb->local_port); + udphdr->dest = lwip_htons(dst_port); + /* in UDP, 0 checksum means 'no checksum' */ + udphdr->chksum = 0x0000; + + /* Multicast Loop? */ +#if (LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS) || (LWIP_IPV6 && LWIP_IPV6_MLD) + if (((pcb->flags & UDP_FLAGS_MULTICAST_LOOP) != 0) && ip_addr_ismulticast(dst_ip)) { + q->flags |= PBUF_FLAG_MCASTLOOP; + } +#endif /* (LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS) || (LWIP_IPV6 && LWIP_IPV6_MLD) */ + + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: sending datagram of length %"U16_F"\n", q->tot_len)); + +#if LWIP_UDPLITE + /* UDP Lite protocol? */ + if (pcb->flags & UDP_FLAGS_UDPLITE) { + u16_t chklen, chklen_hdr; + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %"U16_F"\n", q->tot_len)); + /* set UDP message length in UDP header */ + chklen_hdr = chklen = pcb->chksum_len_tx; + if ((chklen < sizeof(struct udp_hdr)) || (chklen > q->tot_len)) { + if (chklen != 0) { + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE pcb->chksum_len is illegal: %"U16_F"\n", chklen)); + } + /* For UDP-Lite, checksum length of 0 means checksum + over the complete packet. (See RFC 3828 chap. 3.1) + At least the UDP-Lite header must be covered by the + checksum, therefore, if chksum_len has an illegal + value, we generate the checksum over the complete + packet to be safe. */ + chklen_hdr = 0; + chklen = q->tot_len; + } + udphdr->len = lwip_htons(chklen_hdr); + /* calculate checksum */ +#if CHECKSUM_GEN_UDP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_UDP) { +#if LWIP_CHECKSUM_ON_COPY + if (have_chksum) { + chklen = UDP_HLEN; + } +#endif /* LWIP_CHECKSUM_ON_COPY */ + udphdr->chksum = ip_chksum_pseudo_partial(q, IP_PROTO_UDPLITE, + q->tot_len, chklen, src_ip, dst_ip); +#if LWIP_CHECKSUM_ON_COPY + if (have_chksum) { + u32_t acc; + acc = udphdr->chksum + (u16_t)~(chksum); + udphdr->chksum = FOLD_U32T(acc); + } +#endif /* LWIP_CHECKSUM_ON_COPY */ + + /* chksum zero must become 0xffff, as zero means 'no checksum' */ + if (udphdr->chksum == 0x0000) { + udphdr->chksum = 0xffff; + } + } +#endif /* CHECKSUM_GEN_UDP */ + + ip_proto = IP_PROTO_UDPLITE; + } else +#endif /* LWIP_UDPLITE */ + { /* UDP */ + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len)); + udphdr->len = lwip_htons(q->tot_len); + /* calculate checksum */ +#if CHECKSUM_GEN_UDP + IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_UDP) { + /* Checksum is mandatory over IPv6. */ + if (IP_IS_V6(dst_ip) || (pcb->flags & UDP_FLAGS_NOCHKSUM) == 0) { + u16_t udpchksum; +#if LWIP_CHECKSUM_ON_COPY + if (have_chksum) { + u32_t acc; + udpchksum = ip_chksum_pseudo_partial(q, IP_PROTO_UDP, + q->tot_len, UDP_HLEN, src_ip, dst_ip); + acc = udpchksum + (u16_t)~(chksum); + udpchksum = FOLD_U32T(acc); + } else +#endif /* LWIP_CHECKSUM_ON_COPY */ + { + udpchksum = ip_chksum_pseudo(q, IP_PROTO_UDP, q->tot_len, + src_ip, dst_ip); + } + + /* chksum zero must become 0xffff, as zero means 'no checksum' */ + if (udpchksum == 0x0000) { + udpchksum = 0xffff; + } + udphdr->chksum = udpchksum; + } + } +#endif /* CHECKSUM_GEN_UDP */ + ip_proto = IP_PROTO_UDP; + } + + /* Determine TTL to use */ +#if LWIP_MULTICAST_TX_OPTIONS + ttl = (ip_addr_ismulticast(dst_ip) ? udp_get_multicast_ttl(pcb) : pcb->ttl); +#else /* LWIP_MULTICAST_TX_OPTIONS */ + ttl = pcb->ttl; +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum)); + LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,0x%02"X16_F",)\n", (u16_t)ip_proto)); + /* output to IP */ + NETIF_SET_HWADDRHINT(netif, &(pcb->addr_hint)); + err = ip_output_if_src(q, src_ip, dst_ip, ttl, pcb->tos, ip_proto, netif); + NETIF_SET_HWADDRHINT(netif, NULL); + + /* @todo: must this be increased even if error occurred? */ + MIB2_STATS_INC(mib2.udpoutdatagrams); + + /* did we chain a separate header pbuf earlier? */ + if (q != p) { + /* free the header pbuf */ + pbuf_free(q); + q = NULL; + /* p is still referenced by the caller, and will live on */ + } + + UDP_STATS_INC(udp.xmit); + return err; +} + +/** + * @ingroup udp_raw + * Bind an UDP PCB. + * + * @param pcb UDP PCB to be bound with a local address ipaddr and port. + * @param ipaddr local IP address to bind with. Use IP4_ADDR_ANY to + * bind to all local interfaces. + * @param port local UDP port to bind with. Use 0 to automatically bind + * to a random port between UDP_LOCAL_PORT_RANGE_START and + * UDP_LOCAL_PORT_RANGE_END. + * + * ipaddr & port are expected to be in the same byte order as in the pcb. + * + * @return lwIP error code. + * - ERR_OK. Successful. No error occurred. + * - ERR_USE. The specified ipaddr and port are already bound to by + * another UDP PCB. + * + * @see udp_disconnect() + */ +err_t +udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) +{ + struct udp_pcb *ipcb; + u8_t rebind; + +#if LWIP_IPV4 + /* Don't propagate NULL pointer (IPv4 ANY) to subsequent functions */ + if (ipaddr == NULL) { + ipaddr = IP4_ADDR_ANY; + } +#endif /* LWIP_IPV4 */ + + /* still need to check for ipaddr == NULL in IPv6 only case */ + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE, ipaddr); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port)); + + rebind = 0; + /* Check for double bind and rebind of the same pcb */ + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + /* is this UDP PCB already on active list? */ + if (pcb == ipcb) { + rebind = 1; + break; + } + } + + /* no port specified? */ + if (port == 0) { + port = udp_new_port(); + if (port == 0) { + /* no more ports available in local range */ + LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n")); + return ERR_USE; + } + } else { + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + if (pcb != ipcb) { + /* By default, we don't allow to bind to a port that any other udp + PCB is already bound to, unless *all* PCBs with that port have tha + REUSEADDR flag set. */ +#if SO_REUSE + if (!ip_get_option(pcb, SOF_REUSEADDR) || + !ip_get_option(ipcb, SOF_REUSEADDR)) +#endif /* SO_REUSE */ + { + /* port matches that of PCB in list and REUSEADDR not set -> reject */ + if ((ipcb->local_port == port) && + /* IP address matches? */ + ip_addr_cmp(&ipcb->local_ip, ipaddr)) { + /* other PCB already binds to this local IP and port */ + LWIP_DEBUGF(UDP_DEBUG, + ("udp_bind: local port %"U16_F" already bound by another pcb\n", port)); + return ERR_USE; + } + } + } + } + } + + ip_addr_set_ipaddr(&pcb->local_ip, ipaddr); + + pcb->local_port = port; + mib2_udp_bind(pcb); + /* pcb not active yet? */ + if (rebind == 0) { + /* place the PCB on the active list if not already there */ + pcb->next = udp_pcbs; + udp_pcbs = pcb; + } + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_bind: bound to ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, &pcb->local_ip); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->local_port)); + return ERR_OK; +} + +/** + * @ingroup udp_raw + * Connect an UDP PCB. + * + * This will associate the UDP PCB with the remote address. + * + * @param pcb UDP PCB to be connected with remote address ipaddr and port. + * @param ipaddr remote IP address to connect with. + * @param port remote UDP port to connect with. + * + * @return lwIP error code + * + * ipaddr & port are expected to be in the same byte order as in the pcb. + * + * The udp pcb is bound to a random local port if not already bound. + * + * @see udp_disconnect() + */ +err_t +udp_connect(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) +{ + struct udp_pcb *ipcb; + + if ((pcb == NULL) || (ipaddr == NULL)) { + return ERR_VAL; + } + + if (pcb->local_port == 0) { + err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port); + if (err != ERR_OK) { + return err; + } + } + + ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr); + pcb->remote_port = port; + pcb->flags |= UDP_FLAGS_CONNECTED; + + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_connect: connected to ")); + ip_addr_debug_print(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, + &pcb->remote_ip); + LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->remote_port)); + + /* Insert UDP PCB into the list of active UDP PCBs. */ + for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) { + if (pcb == ipcb) { + /* already on the list, just return */ + return ERR_OK; + } + } + /* PCB not yet on the list, add PCB now */ + pcb->next = udp_pcbs; + udp_pcbs = pcb; + return ERR_OK; +} + +/** + * @ingroup udp_raw + * Disconnect a UDP PCB + * + * @param pcb the udp pcb to disconnect. + */ +void +udp_disconnect(struct udp_pcb *pcb) +{ + /* reset remote address association */ +#if LWIP_IPV4 && LWIP_IPV6 + if (IP_IS_ANY_TYPE_VAL(pcb->local_ip)) { + ip_addr_copy(pcb->remote_ip, *IP_ANY_TYPE); + } else { +#endif + ip_addr_set_any(IP_IS_V6_VAL(pcb->remote_ip), &pcb->remote_ip); +#if LWIP_IPV4 && LWIP_IPV6 + } +#endif + pcb->remote_port = 0; + /* mark PCB as unconnected */ + pcb->flags &= ~UDP_FLAGS_CONNECTED; +} + +/** + * @ingroup udp_raw + * Set a receive callback for a UDP PCB + * + * This callback will be called when receiving a datagram for the pcb. + * + * @param pcb the pcb for which to set the recv callback + * @param recv function pointer of the callback function + * @param recv_arg additional argument to pass to the callback function + */ +void +udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) +{ + /* remember recv() callback and user data */ + pcb->recv = recv; + pcb->recv_arg = recv_arg; +} + +/** + * @ingroup udp_raw + * Remove an UDP PCB. + * + * @param pcb UDP PCB to be removed. The PCB is removed from the list of + * UDP PCB's and the data structure is freed from memory. + * + * @see udp_new() + */ +void +udp_remove(struct udp_pcb *pcb) +{ + struct udp_pcb *pcb2; + + mib2_udp_unbind(pcb); + /* pcb to be removed is first in list? */ + if (udp_pcbs == pcb) { + /* make list start at 2nd pcb */ + udp_pcbs = udp_pcbs->next; + /* pcb not 1st in list */ + } else { + for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) { + /* find pcb in udp_pcbs list */ + if (pcb2->next != NULL && pcb2->next == pcb) { + /* remove pcb from list */ + pcb2->next = pcb->next; + break; + } + } + } + memp_free(MEMP_UDP_PCB, pcb); +} + +/** + * @ingroup udp_raw + * Create a UDP PCB. + * + * @return The UDP PCB which was created. NULL if the PCB data structure + * could not be allocated. + * + * @see udp_remove() + */ +struct udp_pcb * +udp_new(void) +{ + struct udp_pcb *pcb; + pcb = (struct udp_pcb *)memp_malloc(MEMP_UDP_PCB); + /* could allocate UDP PCB? */ + if (pcb != NULL) { + /* UDP Lite: by initializing to all zeroes, chksum_len is set to 0 + * which means checksum is generated over the whole datagram per default + * (recommended as default by RFC 3828). */ + /* initialize PCB to all zeroes */ + memset(pcb, 0, sizeof(struct udp_pcb)); + pcb->ttl = UDP_TTL; +#if LWIP_MULTICAST_TX_OPTIONS + udp_set_multicast_ttl(pcb, UDP_TTL); +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + } + return pcb; +} + +/** + * @ingroup udp_raw + * Create a UDP PCB for specific IP type. + * + * @param type IP address type, see @ref lwip_ip_addr_type definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) packets, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. + * @return The UDP PCB which was created. NULL if the PCB data structure + * could not be allocated. + * + * @see udp_remove() + */ +struct udp_pcb * +udp_new_ip_type(u8_t type) +{ + struct udp_pcb *pcb; + pcb = udp_new(); +#if LWIP_IPV4 && LWIP_IPV6 + if (pcb != NULL) { + IP_SET_TYPE_VAL(pcb->local_ip, type); + IP_SET_TYPE_VAL(pcb->remote_ip, type); + } +#else + LWIP_UNUSED_ARG(type); +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + return pcb; +} + +/** This function is called from netif.c when address is changed + * + * @param old_addr IP address of the netif before change + * @param new_addr IP address of the netif after change + */ +void udp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr) +{ + struct udp_pcb* upcb; + + if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) { + for (upcb = udp_pcbs; upcb != NULL; upcb = upcb->next) { + /* PCB bound to current local interface address? */ + if (ip_addr_cmp(&upcb->local_ip, old_addr)) { + /* The PCB is bound to the old ipaddr and + * is set to bound to the new one instead */ + ip_addr_copy(upcb->local_ip, *new_addr); + } + } + } +} + +#if UDP_DEBUG +/** + * Print UDP header information for debug purposes. + * + * @param udphdr pointer to the udp header in memory. + */ +void +udp_debug_print(struct udp_hdr *udphdr) +{ + LWIP_DEBUGF(UDP_DEBUG, ("UDP header:\n")); + LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | %5"U16_F" | (src port, dest port)\n", + lwip_ntohs(udphdr->src), lwip_ntohs(udphdr->dest))); + LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n")); + LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | 0x%04"X16_F" | (len, chksum)\n", + lwip_ntohs(udphdr->len), lwip_ntohs(udphdr->chksum))); + LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n")); +} +#endif /* UDP_DEBUG */ + +#endif /* LWIP_UDP */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/api.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/api.h new file mode 100644 index 0000000..516bd16 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/api.h @@ -0,0 +1,400 @@ +/** + * @file + * netconn API (to be used from non-TCPIP threads) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_API_H +#define LWIP_HDR_API_H + +#include "lwip/opt.h" + +#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ +/* Note: Netconn API is always available when sockets are enabled - + * sockets are implemented on top of them */ + +#include "lwip/arch.h" +#include "lwip/netbuf.h" +#include "lwip/sys.h" +#include "lwip/ip_addr.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Throughout this file, IP addresses and port numbers are expected to be in + * the same byte order as in the corresponding pcb. + */ + +/* Flags for netconn_write (u8_t) */ +#define NETCONN_NOFLAG 0x00 +#define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */ +#define NETCONN_COPY 0x01 +#define NETCONN_MORE 0x02 +#define NETCONN_DONTBLOCK 0x04 + +/* Flags for struct netconn.flags (u8_t) */ +/** Should this netconn avoid blocking? */ +#define NETCONN_FLAG_NON_BLOCKING 0x02 +/** Was the last connect action a non-blocking one? */ +#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 +/** If a nonblocking write has been rejected before, poll_tcp needs to + check if the netconn is writable again */ +#define NETCONN_FLAG_CHECK_WRITESPACE 0x10 +#if LWIP_IPV6 +/** If this flag is set then only IPv6 communication is allowed on the + netconn. As per RFC#3493 this features defaults to OFF allowing + dual-stack usage by default. */ +#define NETCONN_FLAG_IPV6_V6ONLY 0x20 +#endif /* LWIP_IPV6 */ + + +/* Helpers to process several netconn_types by the same code */ +#define NETCONNTYPE_GROUP(t) ((t)&0xF0) +#define NETCONNTYPE_DATAGRAM(t) ((t)&0xE0) +#if LWIP_IPV6 +#define NETCONN_TYPE_IPV6 0x08 +#define NETCONNTYPE_ISIPV6(t) (((t)&NETCONN_TYPE_IPV6) != 0) +#define NETCONNTYPE_ISUDPLITE(t) (((t)&0xF3) == NETCONN_UDPLITE) +#define NETCONNTYPE_ISUDPNOCHKSUM(t) (((t)&0xF3) == NETCONN_UDPNOCHKSUM) +#else /* LWIP_IPV6 */ +#define NETCONNTYPE_ISIPV6(t) (0) +#define NETCONNTYPE_ISUDPLITE(t) ((t) == NETCONN_UDPLITE) +#define NETCONNTYPE_ISUDPNOCHKSUM(t) ((t) == NETCONN_UDPNOCHKSUM) +#endif /* LWIP_IPV6 */ + +/** @ingroup netconn_common + * Protocol family and type of the netconn + */ +enum netconn_type { + NETCONN_INVALID = 0, + /** TCP IPv4 */ + NETCONN_TCP = 0x10, +#if LWIP_IPV6 + /** TCP IPv6 */ + NETCONN_TCP_IPV6 = NETCONN_TCP | NETCONN_TYPE_IPV6 /* 0x18 */, +#endif /* LWIP_IPV6 */ + /** UDP IPv4 */ + NETCONN_UDP = 0x20, + /** UDP IPv4 lite */ + NETCONN_UDPLITE = 0x21, + /** UDP IPv4 no checksum */ + NETCONN_UDPNOCHKSUM = 0x22, + +#if LWIP_IPV6 + /** UDP IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ + NETCONN_UDP_IPV6 = NETCONN_UDP | NETCONN_TYPE_IPV6 /* 0x28 */, + /** UDP IPv6 lite (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ + NETCONN_UDPLITE_IPV6 = NETCONN_UDPLITE | NETCONN_TYPE_IPV6 /* 0x29 */, + /** UDP IPv6 no checksum (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ + NETCONN_UDPNOCHKSUM_IPV6 = NETCONN_UDPNOCHKSUM | NETCONN_TYPE_IPV6 /* 0x2a */, +#endif /* LWIP_IPV6 */ + + /** Raw connection IPv4 */ + NETCONN_RAW = 0x40 +#if LWIP_IPV6 + /** Raw connection IPv6 (dual-stack by default, unless you call @ref netconn_set_ipv6only) */ + , NETCONN_RAW_IPV6 = NETCONN_RAW | NETCONN_TYPE_IPV6 /* 0x48 */ +#endif /* LWIP_IPV6 */ +}; + +/** Current state of the netconn. Non-TCP netconns are always + * in state NETCONN_NONE! */ +enum netconn_state { + NETCONN_NONE, + NETCONN_WRITE, + NETCONN_LISTEN, + NETCONN_CONNECT, + NETCONN_CLOSE +}; + +/** Used to inform the callback function about changes + * + * Event explanation: + * + * In the netconn implementation, there are three ways to block a client: + * + * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) + * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) + * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) + * + * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking + * connections, you need to know in advance whether a call to a netconn function call would block or not, + * and these events tell you about that. + * + * RCVPLUS events say: Safe to perform a potentially blocking call call once more. + * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe + * to call netconn_accept 3 times without being blocked. + * Same thing for receive mbox. + * + * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". + * Socket implementation decrements the counter. + * + * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. + * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. + * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. + */ +enum netconn_evt { + NETCONN_EVT_RCVPLUS, + NETCONN_EVT_RCVMINUS, + NETCONN_EVT_SENDPLUS, + NETCONN_EVT_SENDMINUS, + NETCONN_EVT_ERROR +}; + +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) +/** Used for netconn_join_leave_group() */ +enum netconn_igmp { + NETCONN_JOIN, + NETCONN_LEAVE +}; +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ + +#if LWIP_DNS +/* Used for netconn_gethostbyname_addrtype(), these should match the DNS_ADDRTYPE defines in dns.h */ +#define NETCONN_DNS_DEFAULT NETCONN_DNS_IPV4_IPV6 +#define NETCONN_DNS_IPV4 0 +#define NETCONN_DNS_IPV6 1 +#define NETCONN_DNS_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */ +#define NETCONN_DNS_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */ +#endif /* LWIP_DNS */ + +/* forward-declare some structs to avoid to include their headers */ +struct ip_pcb; +struct tcp_pcb; +struct udp_pcb; +struct raw_pcb; +struct netconn; +struct api_msg; + +/** A callback prototype to inform about events for a netconn */ +typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len); + +/** A netconn descriptor */ +struct netconn { + /** type of the netconn (TCP, UDP or RAW) */ + enum netconn_type type; + /** current state of the netconn */ + enum netconn_state state; + /** the lwIP internal protocol control block */ + union { + struct ip_pcb *ip; + struct tcp_pcb *tcp; + struct udp_pcb *udp; + struct raw_pcb *raw; + } pcb; + /** the last error this netconn had */ + err_t last_err; +#if !LWIP_NETCONN_SEM_PER_THREAD + /** sem that is used to synchronously execute functions in the core context */ + sys_sem_t op_completed; +#endif + /** mbox where received packets are stored until they are fetched + by the netconn application thread (can grow quite big) */ + sys_mbox_t recvmbox; +#if LWIP_TCP + /** mbox where new connections are stored until processed + by the application thread */ + sys_mbox_t acceptmbox; +#endif /* LWIP_TCP */ + /** only used for socket layer */ +#if LWIP_SOCKET + int socket; +#endif /* LWIP_SOCKET */ +#if LWIP_SO_SNDTIMEO + /** timeout to wait for sending data (which means enqueueing data for sending + in internal buffers) in milliseconds */ + s32_t send_timeout; +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVTIMEO + /** timeout in milliseconds to wait for new data to be received + (or connections to arrive for listening netconns) */ + int recv_timeout; +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVBUF + /** maximum amount of bytes queued in recvmbox + not used for TCP: adjust TCP_WND instead! */ + int recv_bufsize; + /** number of bytes currently in recvmbox to be received, + tested against recv_bufsize to limit bytes on recvmbox + for UDP and RAW, used for FIONREAD */ + int recv_avail; +#endif /* LWIP_SO_RCVBUF */ +#if LWIP_SO_LINGER + /** values <0 mean linger is disabled, values > 0 are seconds to linger */ + s16_t linger; +#endif /* LWIP_SO_LINGER */ + /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */ + u8_t flags; +#if LWIP_TCP + /** TCP: when data passed to netconn_write doesn't fit into the send buffer, + this temporarily stores how much is already sent. */ + size_t write_offset; + /** TCP: when data passed to netconn_write doesn't fit into the send buffer, + this temporarily stores the message. + Also used during connect and close. */ + struct api_msg *current_msg; +#endif /* LWIP_TCP */ + /** A callback function that is informed about events for this netconn */ + netconn_callback callback; +}; + +/** Register an Network connection event */ +#define API_EVENT(c,e,l) if (c->callback) { \ + (*c->callback)(c, e, l); \ + } + +/** Set conn->last_err to err but don't overwrite fatal errors */ +#define NETCONN_SET_SAFE_ERR(conn, err) do { if ((conn) != NULL) { \ + SYS_ARCH_DECL_PROTECT(netconn_set_safe_err_lev); \ + SYS_ARCH_PROTECT(netconn_set_safe_err_lev); \ + if (!ERR_IS_FATAL((conn)->last_err)) { \ + (conn)->last_err = err; \ + } \ + SYS_ARCH_UNPROTECT(netconn_set_safe_err_lev); \ +}} while(0); + +/* Network connection functions: */ + +/** @ingroup netconn_common + * Create new netconn connection + * @param t @ref netconn_type */ +#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) +#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c) +struct netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, + netconn_callback callback); +err_t netconn_delete(struct netconn *conn); +/** Get the type of a netconn (as enum netconn_type). */ +#define netconn_type(conn) (conn->type) + +err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr, + u16_t *port, u8_t local); +/** @ingroup netconn_common */ +#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0) +/** @ingroup netconn_common */ +#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1) + +err_t netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port); +err_t netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port); +err_t netconn_disconnect (struct netconn *conn); +err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog); +/** @ingroup netconn_tcp */ +#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) +err_t netconn_accept(struct netconn *conn, struct netconn **new_conn); +err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf); +err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf); +err_t netconn_sendto(struct netconn *conn, struct netbuf *buf, + const ip_addr_t *addr, u16_t port); +err_t netconn_send(struct netconn *conn, struct netbuf *buf); +err_t netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size, + u8_t apiflags, size_t *bytes_written); +/** @ingroup netconn_tcp */ +#define netconn_write(conn, dataptr, size, apiflags) \ + netconn_write_partly(conn, dataptr, size, apiflags, NULL) +err_t netconn_close(struct netconn *conn); +err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx); + +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) +err_t netconn_join_leave_group(struct netconn *conn, const ip_addr_t *multiaddr, + const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave); +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ +#if LWIP_DNS +#if LWIP_IPV4 && LWIP_IPV6 +err_t netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype); +#define netconn_gethostbyname(name, addr) netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT) +#else /* LWIP_IPV4 && LWIP_IPV6 */ +err_t netconn_gethostbyname(const char *name, ip_addr_t *addr); +#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype) netconn_gethostbyname(name, addr) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ +#endif /* LWIP_DNS */ + +#define netconn_err(conn) ((conn)->last_err) +#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize) + +/** Set the blocking status of netconn calls (@todo: write/send is missing) */ +#define netconn_set_nonblocking(conn, val) do { if(val) { \ + (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \ +} else { \ + (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0) +/** Get the blocking status of netconn calls (@todo: write/send is missing) */ +#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) + +#if LWIP_IPV6 +/** @ingroup netconn_common + * TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY) + */ +#define netconn_set_ipv6only(conn, val) do { if(val) { \ + (conn)->flags |= NETCONN_FLAG_IPV6_V6ONLY; \ +} else { \ + (conn)->flags &= ~ NETCONN_FLAG_IPV6_V6ONLY; }} while(0) +/** @ingroup netconn_common + * TCP: Get the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY) + */ +#define netconn_get_ipv6only(conn) (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0) +#endif /* LWIP_IPV6 */ + +#if LWIP_SO_SNDTIMEO +/** Set the send timeout in milliseconds */ +#define netconn_set_sendtimeout(conn, timeout) ((conn)->send_timeout = (timeout)) +/** Get the send timeout in milliseconds */ +#define netconn_get_sendtimeout(conn) ((conn)->send_timeout) +#endif /* LWIP_SO_SNDTIMEO */ +#if LWIP_SO_RCVTIMEO +/** Set the receive timeout in milliseconds */ +#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout)) +/** Get the receive timeout in milliseconds */ +#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout) +#endif /* LWIP_SO_RCVTIMEO */ +#if LWIP_SO_RCVBUF +/** Set the receive buffer in bytes */ +#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize)) +/** Get the receive buffer in bytes */ +#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize) +#endif /* LWIP_SO_RCVBUF*/ + +#if LWIP_NETCONN_SEM_PER_THREAD +void netconn_thread_init(void); +void netconn_thread_cleanup(void); +#else /* LWIP_NETCONN_SEM_PER_THREAD */ +#define netconn_thread_init() +#define netconn_thread_cleanup() +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_NETCONN || LWIP_SOCKET */ + +#endif /* LWIP_HDR_API_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/FILES b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/FILES new file mode 100644 index 0000000..adfc0f3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/FILES @@ -0,0 +1,2 @@ +This directory contains application headers. +Every application shall provide one api file APP.h and optionally one options file APP_opts.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/fs.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/fs.h new file mode 100644 index 0000000..bb176fa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/fs.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_APPS_FS_H +#define LWIP_HDR_APPS_FS_H + +#include "httpd_opts.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define FS_READ_EOF -1 +#define FS_READ_DELAYED -2 + +#if HTTPD_PRECALCULATED_CHECKSUM +struct fsdata_chksum { + u32_t offset; + u16_t chksum; + u16_t len; +}; +#endif /* HTTPD_PRECALCULATED_CHECKSUM */ + +#define FS_FILE_FLAGS_HEADER_INCLUDED 0x01 +#define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02 + +struct fs_file { + const char *data; + int len; + int index; + void *pextension; +#if HTTPD_PRECALCULATED_CHECKSUM + const struct fsdata_chksum *chksum; + u16_t chksum_count; +#endif /* HTTPD_PRECALCULATED_CHECKSUM */ + u8_t flags; +#if LWIP_HTTPD_CUSTOM_FILES + u8_t is_custom_file; +#endif /* LWIP_HTTPD_CUSTOM_FILES */ +#if LWIP_HTTPD_FILE_STATE + void *state; +#endif /* LWIP_HTTPD_FILE_STATE */ +}; + +#if LWIP_HTTPD_FS_ASYNC_READ +typedef void (*fs_wait_cb)(void *arg); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ + +err_t fs_open(struct fs_file *file, const char *name); +void fs_close(struct fs_file *file); +#if LWIP_HTTPD_DYNAMIC_FILE_READ +#if LWIP_HTTPD_FS_ASYNC_READ +int fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg); +#else /* LWIP_HTTPD_FS_ASYNC_READ */ +int fs_read(struct fs_file *file, char *buffer, int count); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ +#if LWIP_HTTPD_FS_ASYNC_READ +int fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg); +#endif /* LWIP_HTTPD_FS_ASYNC_READ */ +int fs_bytes_left(struct fs_file *file); + +#if LWIP_HTTPD_FILE_STATE +/** This user-defined function is called when a file is opened. */ +void *fs_state_init(struct fs_file *file, const char *name); +/** This user-defined function is called when a file is closed. */ +void fs_state_free(struct fs_file *file, void *state); +#endif /* #if LWIP_HTTPD_FILE_STATE */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_FS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd.h new file mode 100644 index 0000000..40f1811 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd.h @@ -0,0 +1,236 @@ +/** + * @file + * HTTP server + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + * This version of the file has been modified by Texas Instruments to offer + * simple server-side-include (SSI) and Common Gateway Interface (CGI) + * capability. + */ + +#ifndef LWIP_HDR_APPS_HTTPD_H +#define LWIP_HDR_APPS_HTTPD_H + +#include "httpd_opts.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_HTTPD_CGI + +/* + * Function pointer for a CGI script handler. + * + * This function is called each time the HTTPD server is asked for a file + * whose name was previously registered as a CGI function using a call to + * http_set_cgi_handler. The iIndex parameter provides the index of the + * CGI within the ppcURLs array passed to http_set_cgi_handler. Parameters + * pcParam and pcValue provide access to the parameters provided along with + * the URI. iNumParams provides a count of the entries in the pcParam and + * pcValue arrays. Each entry in the pcParam array contains the name of a + * parameter with the corresponding entry in the pcValue array containing the + * value for that parameter. Note that pcParam may contain multiple elements + * with the same name if, for example, a multi-selection list control is used + * in the form generating the data. + * + * The function should return a pointer to a character string which is the + * path and filename of the response that is to be sent to the connected + * browser, for example "/thanks.htm" or "/response/error.ssi". + * + * The maximum number of parameters that will be passed to this function via + * iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in the incoming + * HTTP request above this number will be discarded. + * + * Requests intended for use by this CGI mechanism must be sent using the GET + * method (which encodes all parameters within the URI rather than in a block + * later in the request). Attempts to use the POST method will result in the + * request being ignored. + * + */ +typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[], + char *pcValue[]); + +/* + * Structure defining the base filename (URL) of a CGI and the associated + * function which is to be called when that URL is requested. + */ +typedef struct +{ + const char *pcCGIName; + tCGIHandler pfnCGIHandler; +} tCGI; + +void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers); + +#endif /* LWIP_HTTPD_CGI */ + +#if LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI + +#if LWIP_HTTPD_CGI_SSI +/** Define this generic CGI handler in your application. + * It is called once for every URI with parameters. + * The parameters can be stored to + */ +extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, char **pcValue +#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE + , void *connection_state +#endif /* LWIP_HTTPD_FILE_STATE */ + ); +#endif /* LWIP_HTTPD_CGI_SSI */ + +#endif /* LWIP_HTTPD_CGI || LWIP_HTTPD_CGI_SSI */ + +#if LWIP_HTTPD_SSI + +/* + * Function pointer for the SSI tag handler callback. + * + * This function will be called each time the HTTPD server detects a tag of the + * form in a .shtml, .ssi or .shtm file where "name" appears as + * one of the tags supplied to http_set_ssi_handler in the ppcTags array. The + * returned insert string, which will be appended after the the string + * "" in file sent back to the client,should be written to pointer + * pcInsert. iInsertLen contains the size of the buffer pointed to by + * pcInsert. The iIndex parameter provides the zero-based index of the tag as + * found in the ppcTags array and identifies the tag that is to be processed. + * + * The handler returns the number of characters written to pcInsert excluding + * any terminating NULL or a negative number to indicate a failure (tag not + * recognized, for example). + * + * Note that the behavior of this SSI mechanism is somewhat different from the + * "normal" SSI processing as found in, for example, the Apache web server. In + * this case, the inserted text is appended following the SSI tag rather than + * replacing the tag entirely. This allows for an implementation that does not + * require significant additional buffering of output data yet which will still + * offer usable SSI functionality. One downside to this approach is when + * attempting to use SSI within JavaScript. The SSI tag is structured to + * resemble an HTML comment but this syntax does not constitute a comment + * within JavaScript and, hence, leaving the tag in place will result in + * problems in these cases. To work around this, any SSI tag which needs to + * output JavaScript code must do so in an encapsulated way, sending the whole + * HTML section as a single include. + */ +typedef u16_t (*tSSIHandler)( +#if LWIP_HTTPD_SSI_RAW + const char* ssi_tag_name, +#else /* LWIP_HTTPD_SSI_RAW */ + int iIndex, +#endif /* LWIP_HTTPD_SSI_RAW */ + char *pcInsert, int iInsertLen +#if LWIP_HTTPD_SSI_MULTIPART + , u16_t current_tag_part, u16_t *next_tag_part +#endif /* LWIP_HTTPD_SSI_MULTIPART */ +#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE + , void *connection_state +#endif /* LWIP_HTTPD_FILE_STATE */ + ); + +/** Set the SSI handler function + * (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used) + */ +void http_set_ssi_handler(tSSIHandler pfnSSIHandler, + const char **ppcTags, int iNumTags); + +/** For LWIP_HTTPD_SSI_RAW==1, return this to indicate the tag is unknown. + * In this case, the webserver writes a warning into the page. + * You can also just return 0 to write nothing for unknown tags. + */ +#define HTTPD_SSI_TAG_UNKNOWN 0xFFFF + +#endif /* LWIP_HTTPD_SSI */ + +#if LWIP_HTTPD_SUPPORT_POST + +/* These functions must be implemented by the application */ + +/** Called when a POST request has been received. The application can decide + * whether to accept it or not. + * + * @param connection Unique connection identifier, valid until httpd_post_end + * is called. + * @param uri The HTTP header URI receiving the POST request. + * @param http_request The raw HTTP request (the first packet, normally). + * @param http_request_len Size of 'http_request'. + * @param content_len Content-Length from HTTP header. + * @param response_uri Filename of response file, to be filled when denying the + * request + * @param response_uri_len Size of the 'response_uri' buffer. + * @param post_auto_wnd Set this to 0 to let the callback code handle window + * updates by calling 'httpd_post_data_recved' (to throttle rx speed) + * default is 1 (httpd handles window updates automatically) + * @return ERR_OK: Accept the POST request, data may be passed in + * another err_t: Deny the POST request, send back 'bad request'. + */ +err_t httpd_post_begin(void *connection, const char *uri, const char *http_request, + u16_t http_request_len, int content_len, char *response_uri, + u16_t response_uri_len, u8_t *post_auto_wnd); + +/** Called for each pbuf of data that has been received for a POST. + * ATTENTION: The application is responsible for freeing the pbufs passed in! + * + * @param connection Unique connection identifier. + * @param p Received data. + * @return ERR_OK: Data accepted. + * another err_t: Data denied, http_post_get_response_uri will be called. + */ +err_t httpd_post_receive_data(void *connection, struct pbuf *p); + +/** Called when all data is received or when the connection is closed. + * The application must return the filename/URI of a file to send in response + * to this POST request. If the response_uri buffer is untouched, a 404 + * response is returned. + * + * @param connection Unique connection identifier. + * @param response_uri Filename of response file, to be filled when denying the request + * @param response_uri_len Size of the 'response_uri' buffer. + */ +void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len); + +#if LWIP_HTTPD_POST_MANUAL_WND +void httpd_post_data_recved(void *connection, u16_t recved_len); +#endif /* LWIP_HTTPD_POST_MANUAL_WND */ + +#endif /* LWIP_HTTPD_SUPPORT_POST */ + +void httpd_init(void); + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HTTPD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h new file mode 100644 index 0000000..340db15 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h @@ -0,0 +1,323 @@ +/** + * @file + * HTTP server options list + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + * This version of the file has been modified by Texas Instruments to offer + * simple server-side-include (SSI) and Common Gateway Interface (CGI) + * capability. + */ + +#ifndef LWIP_HDR_APPS_HTTPD_OPTS_H +#define LWIP_HDR_APPS_HTTPD_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup httpd_opts Options + * @ingroup httpd + * @{ + */ + +/** Set this to 1 to support CGI (old style) */ +#if !defined LWIP_HTTPD_CGI || defined __DOXYGEN__ +#define LWIP_HTTPD_CGI 0 +#endif + +/** Set this to 1 to support CGI (new style) */ +#if !defined LWIP_HTTPD_CGI_SSI || defined __DOXYGEN__ +#define LWIP_HTTPD_CGI_SSI 0 +#endif + +/** Set this to 1 to support SSI (Server-Side-Includes) */ +#if !defined LWIP_HTTPD_SSI || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI 0 +#endif + +/** Set this to 1 to implement an SSI tag handler callback that gets a const char* + * to the tag (instead of an index into a pre-registered array of known tags) */ +#if !defined LWIP_HTTPD_SSI_RAW || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_RAW 0 +#endif + +/** Set this to 1 to support HTTP POST */ +#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_POST 0 +#endif + +/* The maximum number of parameters that the CGI handler can be sent. */ +#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16 +#endif + +/** LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more + * arguments indicating a counter for insert string that are too long to be + * inserted at once: the SSI handler function must then set 'next_tag_part' + * which will be passed back to it in the next call. */ +#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_MULTIPART 0 +#endif + +/* The maximum length of the string comprising the tag name */ +#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8 +#endif + +/* The maximum length of string that can be returned to replace any given tag */ +#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192 +#endif + +#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__ +#define LWIP_HTTPD_POST_MANUAL_WND 0 +#endif + +/** This string is passed in the HTTP header as "Server: " */ +#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__ +#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" +#endif + +/** Set this to 1 if you want to include code that creates HTTP headers + * at runtime. Default is off: HTTP headers are then created statically + * by the makefsdata tool. Static headers mean smaller code size, but + * the (readonly) fsdata will grow a bit as every file includes the HTTP + * header. */ +#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__ +#define LWIP_HTTPD_DYNAMIC_HEADERS 0 +#endif + +#if !defined HTTPD_DEBUG || defined __DOXYGEN__ +#define HTTPD_DEBUG LWIP_DBG_OFF +#endif + +/** Set this to 1 to use a memp pool for allocating + * struct http_state instead of the heap. + */ +#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__ +#define HTTPD_USE_MEM_POOL 0 +#endif + +/** The server port for HTTPD to use */ +#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__ +#define HTTPD_SERVER_PORT 80 +#endif + +/** Maximum retries before the connection is aborted/closed. + * - number of times pcb->poll is called -> default is 4*500ms = 2s; + * - reset when pcb->sent is called + */ +#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__ +#define HTTPD_MAX_RETRIES 4 +#endif + +/** The poll delay is X*500ms */ +#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__ +#define HTTPD_POLL_INTERVAL 4 +#endif + +/** Priority for tcp pcbs created by HTTPD (very low by default). + * Lower priorities get killed first when running out of memory. + */ +#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__ +#define HTTPD_TCP_PRIO TCP_PRIO_MIN +#endif + +/** Set this to 1 to enable timing each file sent */ +#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__ +#define LWIP_HTTPD_TIMING 0 +#endif +/** Set this to 1 to enable timing each file sent */ +#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__ +#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF +#endif + +/** Set this to one to show error pages when parsing a request fails instead + of simply closing the connection. */ +#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0 +#endif + +/** Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes) */ +#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_V09 1 +#endif + +/** Set this to 1 to enable HTTP/1.1 persistent connections. + * ATTENTION: If the generated file system includes HTTP headers, these must + * include the "Connection: keep-alive" header (pass argument "-11" to makefsdata). + */ +#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 +#endif + +/** Set this to 1 to support HTTP request coming in in multiple packets/pbufs */ +#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1 +#endif + +#if LWIP_HTTPD_SUPPORT_REQUESTLIST +/** Number of rx pbufs to enqueue to parse an incoming request (up to the first + newline) */ +#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__ +#define LWIP_HTTPD_REQ_QUEUELEN 5 +#endif + +/** Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming + request (up to the first double-newline) */ +#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__ +#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH +#endif + +/** Defines the maximum length of a HTTP request line (up to the first CRLF, + copied from pbuf into this a global buffer when pbuf- or packet-queues + are received - otherwise the input pbuf is used directly) */ +#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) +#endif +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + +/** This is the size of a static buffer used when URIs end with '/'. + * In this buffer, the directory requested is concatenated with all the + * configured default file names. + * Set to 0 to disable checking default filenames on non-root directories. + */ +#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 +#endif + +/** Maximum length of the filename to send as response to a POST request, + * filled in by the application when a POST is finished. + */ +#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 +#endif + +/** Set this to 0 to not send the SSI tag (default is on, so the tag will + * be sent in the HTML page */ +#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_INCLUDE_TAG 1 +#endif + +/** Set this to 1 to call tcp_abort when tcp_close fails with memory error. + * This can be used to prevent consuming all memory in situations where the + * HTTP server has low priority compared to other communication. */ +#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__ +#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 +#endif + +/** Set this to 1 to kill the oldest connection when running out of + * memory for 'struct http_state' or 'struct http_ssi_state'. + * ATTENTION: This puts all connections on a linked list, so may be kind of slow. + */ +#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__ +#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 +#endif + +/** Set this to 1 to send URIs without extension without headers + * (who uses this at all??) */ +#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__ +#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 +#endif + +/** Default: Tags are sent from struct http_state and are therefore volatile */ +#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__ +#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY +#endif + +/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low + when http is not an important protocol in the device. */ +#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__ +#define HTTPD_LIMIT_SENDING_TO_2MSS 1 +#endif + +/* Define this to a function that returns the maximum amount of data to enqueue. + The function have this signature: u16_t fn(struct tcp_pcb* pcb); */ +#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__ +#if HTTPD_LIMIT_SENDING_TO_2MSS +#define HTTPD_MAX_WRITE_LEN(pcb) (2 * tcp_mss(pcb)) +#endif +#endif + +/*------------------- FS OPTIONS -------------------*/ + +/** Set this to 1 and provide the functions: + * - "int fs_open_custom(struct fs_file *file, const char *name)" + * Called first for every opened file to allow opening files + * that are not included in fsdata(_custom).c + * - "void fs_close_custom(struct fs_file *file)" + * Called to free resources allocated by fs_open_custom(). + */ +#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__ +#define LWIP_HTTPD_CUSTOM_FILES 0 +#endif + +/** Set this to 1 to support fs_read() to dynamically read file data. + * Without this (default=off), only one-block files are supported, + * and the contents must be ready after fs_open(). + */ +#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__ +#define LWIP_HTTPD_DYNAMIC_FILE_READ 0 +#endif + +/** Set this to 1 to include an application state argument per file + * that is opened. This allows to keep a state per connection/file. + */ +#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__ +#define LWIP_HTTPD_FILE_STATE 0 +#endif + +/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for + * predefined (MSS-sized) chunks of the files to prevent having to calculate + * the checksums at runtime. */ +#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__ +#define HTTPD_PRECALCULATED_CHECKSUM 0 +#endif + +/** LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations + * (fs_read_async returns FS_READ_DELAYED and calls a callback when finished). + */ +#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__ +#define LWIP_HTTPD_FS_ASYNC_READ 0 +#endif + +/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the + * file system (to prevent changing the file included in CVS) */ +#if !defined HTTPD_USE_CUSTOM_FSDATA || defined __DOXYGEN__ +#define HTTPD_USE_CUSTOM_FSDATA 0 +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/lwiperf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/lwiperf.h new file mode 100644 index 0000000..7dbebb0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/lwiperf.h @@ -0,0 +1,84 @@ +/** + * @file + * lwIP iPerf server implementation + */ + +/* + * Copyright (c) 2014 Simon Goldschmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_APPS_LWIPERF_H +#define LWIP_HDR_APPS_LWIPERF_H + +#include "lwip/opt.h" +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define LWIPERF_TCP_PORT_DEFAULT 5001 + +/** lwIPerf test results */ +enum lwiperf_report_type +{ + /** The server side test is done */ + LWIPERF_TCP_DONE_SERVER, + /** The client side test is done */ + LWIPERF_TCP_DONE_CLIENT, + /** Local error lead to test abort */ + LWIPERF_TCP_ABORTED_LOCAL, + /** Data check error lead to test abort */ + LWIPERF_TCP_ABORTED_LOCAL_DATAERROR, + /** Transmit error lead to test abort */ + LWIPERF_TCP_ABORTED_LOCAL_TXERROR, + /** Remote side aborted the test */ + LWIPERF_TCP_ABORTED_REMOTE +}; + +/** Prototype of a report function that is called when a session is finished. + This report function can show the test results. + @param report_type contains the test result */ +typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type, + const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port, + u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec); + + +void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port, + lwiperf_report_fn report_fn, void* report_arg); +void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg); +void lwiperf_abort(void* lwiperf_session); + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_LWIPERF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns.h new file mode 100644 index 0000000..d036816 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns.h @@ -0,0 +1,69 @@ +/** + * @file + * MDNS responder + */ + + /* + * Copyright (c) 2015 Verisure Innovation AB + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ +#ifndef LWIP_HDR_MDNS_H +#define LWIP_HDR_MDNS_H + +#include "lwip/apps/mdns_opts.h" +#include "lwip/netif.h" + +#if LWIP_MDNS_RESPONDER + +enum mdns_sd_proto { + DNSSD_PROTO_UDP = 0, + DNSSD_PROTO_TCP = 1 +}; + +#define MDNS_LABEL_MAXLEN 63 + +struct mdns_host; +struct mdns_service; + +/** Callback function to add text to a reply, called when generating the reply */ +typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata); + +void mdns_resp_init(void); + +err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl); +err_t mdns_resp_remove_netif(struct netif *netif); + +err_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata); +err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len); +void mdns_resp_netif_settings_changed(struct netif *netif); + +#endif /* LWIP_MDNS_RESPONDER */ + +#endif /* LWIP_HDR_MDNS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_opts.h new file mode 100644 index 0000000..bf186bc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_opts.h @@ -0,0 +1,74 @@ +/** + * @file + * MDNS responder + */ + + /* + * Copyright (c) 2015 Verisure Innovation AB + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ + +#ifndef LWIP_HDR_APPS_MDNS_OPTS_H +#define LWIP_HDR_APPS_MDNS_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup mdns_opts Options + * @ingroup mdns + * @{ + */ + +/** + * LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS + * transport. IGMP is needed for IPv4 multicast. + */ +#ifndef LWIP_MDNS_RESPONDER +#define LWIP_MDNS_RESPONDER 0 +#endif /* LWIP_MDNS_RESPONDER */ + +/** The maximum number of services per netif */ +#ifndef MDNS_MAX_SERVICES +#define MDNS_MAX_SERVICES 1 +#endif + +/** + * MDNS_DEBUG: Enable debugging for multicast DNS. + */ +#ifndef MDNS_DEBUG +#define MDNS_DEBUG LWIP_DBG_OFF +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_priv.h new file mode 100644 index 0000000..8ee6db8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mdns_priv.h @@ -0,0 +1,66 @@ +/** + * @file + * MDNS responder private definitions + */ + + /* + * Copyright (c) 2015 Verisure Innovation AB + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ +#ifndef LWIP_HDR_MDNS_PRIV_H +#define LWIP_HDR_MDNS_PRIV_H + +#include "lwip/apps/mdns_opts.h" +#include "lwip/pbuf.h" + +#if LWIP_MDNS_RESPONDER + +/* Domain struct and methods - visible for unit tests */ + +#define MDNS_DOMAIN_MAXLEN 256 +#define MDNS_READNAME_ERROR 0xFFFF + +struct mdns_domain { + /* Encoded domain name */ + u8_t name[MDNS_DOMAIN_MAXLEN]; + /* Total length of domain name, including zero */ + u16_t length; + /* Set if compression of this domain is not allowed */ + u8_t skip_compression; +}; + +err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len); +u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain); +int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b); +u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain); + +#endif /* LWIP_MDNS_RESPONDER */ + +#endif /* LWIP_HDR_MDNS_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt.h new file mode 100644 index 0000000..34b230b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt.h @@ -0,0 +1,244 @@ +/** + * @file + * MQTT client + */ + +/* + * Copyright (c) 2016 Erik Andersson + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Andersson + * + */ +#ifndef LWIP_HDR_APPS_MQTT_CLIENT_H +#define LWIP_HDR_APPS_MQTT_CLIENT_H + +#include "lwip/apps/mqtt_opts.h" +#include "lwip/err.h" +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct mqtt_client_t mqtt_client_t; + +/** @ingroup mqtt + * Default MQTT port */ +#define MQTT_PORT 1883 + +/*---------------------------------------------------------------------------------------------- */ +/* Connection with server */ + +/** + * @ingroup mqtt + * Client information and connection parameters */ +struct mqtt_connect_client_info_t { + /** Client identifier, must be set by caller */ + const char *client_id; + /** User name and password, set to NULL if not used */ + const char* client_user; + const char* client_pass; + /** keep alive time in seconds, 0 to disable keep alive functionality*/ + u16_t keep_alive; + /** will topic, set to NULL if will is not to be used, + will_msg, will_qos and will retain are then ignored */ + const char* will_topic; + const char* will_msg; + u8_t will_qos; + u8_t will_retain; +}; + +/** + * @ingroup mqtt + * Connection status codes */ +typedef enum +{ + MQTT_CONNECT_ACCEPTED = 0, + MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1, + MQTT_CONNECT_REFUSED_IDENTIFIER = 2, + MQTT_CONNECT_REFUSED_SERVER = 3, + MQTT_CONNECT_REFUSED_USERNAME_PASS = 4, + MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5, + MQTT_CONNECT_DISCONNECTED = 256, + MQTT_CONNECT_TIMEOUT = 257 +} mqtt_connection_status_t; + +/** + * @ingroup mqtt + * Function prototype for mqtt connection status callback. Called when + * client has connected to the server after initiating a mqtt connection attempt by + * calling mqtt_connect() or when connection is closed by server or an error + * + * @param client MQTT client itself + * @param arg Additional argument to pass to the callback function + * @param status Connect result code or disconnection notification @see mqtt_connection_status_t + * + */ +typedef void (*mqtt_connection_cb_t)(mqtt_client_t *client, void *arg, mqtt_connection_status_t status); + + +/** + * @ingroup mqtt + * Data callback flags */ +enum { + /** Flag set when last fragment of data arrives in data callback */ + MQTT_DATA_FLAG_LAST = 1 +}; + +/** + * @ingroup mqtt + * Function prototype for MQTT incoming publish data callback function. Called when data + * arrives to a subscribed topic @see mqtt_subscribe + * + * @param arg Additional argument to pass to the callback function + * @param data User data, pointed object, data may not be referenced after callback return, + NULL is passed when all publish data are delivered + * @param len Length of publish data fragment + * @param flags MQTT_DATA_FLAG_LAST set when this call contains the last part of data from publish message + * + */ +typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); + + +/** + * @ingroup mqtt + * Function prototype for MQTT incoming publish function. Called when an incoming publish + * arrives to a subscribed topic @see mqtt_subscribe + * + * @param arg Additional argument to pass to the callback function + * @param topic Zero terminated Topic text string, topic may not be referenced after callback return + * @param tot_len Total length of publish data, if set to 0 (no publish payload) data callback will not be invoked + */ +typedef void (*mqtt_incoming_publish_cb_t)(void *arg, const char *topic, u32_t tot_len); + + +/** + * @ingroup mqtt + * Function prototype for mqtt request callback. Called when a subscribe, unsubscribe + * or publish request has completed + * @param arg Pointer to user data supplied when invoking request + * @param err ERR_OK on success + * ERR_TIMEOUT if no response was received within timeout, + * ERR_ABRT if (un)subscribe was denied + */ +typedef void (*mqtt_request_cb_t)(void *arg, err_t err); + + +/** + * Pending request item, binds application callback to pending server requests + */ +struct mqtt_request_t +{ + /** Next item in list, NULL means this is the last in chain, + next pointing at itself means request is unallocated */ + struct mqtt_request_t *next; + /** Callback to upper layer */ + mqtt_request_cb_t cb; + void *arg; + /** MQTT packet identifier */ + u16_t pkt_id; + /** Expire time relative to element before this */ + u16_t timeout_diff; +}; + +/** Ring buffer */ +struct mqtt_ringbuf_t { + u16_t put; + u16_t get; + u8_t buf[MQTT_OUTPUT_RINGBUF_SIZE]; +}; + +/** MQTT client */ +struct mqtt_client_t +{ + /** Timers and timeouts */ + u16_t cyclic_tick; + u16_t keep_alive; + u16_t server_watchdog; + /** Packet identifier generator*/ + u16_t pkt_id_seq; + /** Packet identifier of pending incoming publish */ + u16_t inpub_pkt_id; + /** Connection state */ + u8_t conn_state; + struct tcp_pcb *conn; + /** Connection callback */ + void *connect_arg; + mqtt_connection_cb_t connect_cb; + /** Pending requests to server */ + struct mqtt_request_t *pend_req_queue; + struct mqtt_request_t req_list[MQTT_REQ_MAX_IN_FLIGHT]; + void *inpub_arg; + /** Incoming data callback */ + mqtt_incoming_data_cb_t data_cb; + mqtt_incoming_publish_cb_t pub_cb; + /** Input */ + u32_t msg_idx; + u8_t rx_buffer[MQTT_VAR_HEADER_BUFFER_LEN]; + /** Output ring-buffer */ + struct mqtt_ringbuf_t output; +}; + + +/** Connect to server */ +err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg, + const struct mqtt_connect_client_info_t *client_info); + +/** Disconnect from server */ +void mqtt_disconnect(mqtt_client_t *client); + +/** Create new client */ +mqtt_client_t *mqtt_client_new(void); + +/** Check connection status */ +u8_t mqtt_client_is_connected(mqtt_client_t *client); + +/** Set callback to call for incoming publish */ +void mqtt_set_inpub_callback(mqtt_client_t *client, mqtt_incoming_publish_cb_t, + mqtt_incoming_data_cb_t data_cb, void *arg); + +/** Common function for subscribe and unsubscribe */ +err_t mqtt_sub_unsub(mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub); + +/** @ingroup mqtt + *Subscribe to topic */ +#define mqtt_subscribe(client, topic, qos, cb, arg) mqtt_sub_unsub(client, topic, qos, cb, arg, 1) +/** @ingroup mqtt + * Unsubscribe to topic */ +#define mqtt_unsubscribe(client, topic, cb, arg) mqtt_sub_unsub(client, topic, 0, cb, arg, 0) + + +/** Publish data to topic */ +err_t mqtt_publish(mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain, + mqtt_request_cb_t cb, void *arg); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_MQTT_CLIENT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h new file mode 100644 index 0000000..ffefacd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h @@ -0,0 +1,103 @@ +/** + * @file + * MQTT client options + */ + +/* + * Copyright (c) 2016 Erik Andersson + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Andersson + * + */ +#ifndef LWIP_HDR_APPS_MQTT_OPTS_H +#define LWIP_HDR_APPS_MQTT_OPTS_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup mqtt_opts Options + * @ingroup mqtt + * @{ + */ + +/** + * Output ring-buffer size, must be able to fit largest outgoing publish message topic+payloads + */ +#ifndef MQTT_OUTPUT_RINGBUF_SIZE +#define MQTT_OUTPUT_RINGBUF_SIZE 256 +#endif + +/** + * Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8 + * If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8 + */ +#ifndef MQTT_VAR_HEADER_BUFFER_LEN +#define MQTT_VAR_HEADER_BUFFER_LEN 128 +#endif + +/** + * Maximum number of pending subscribe, unsubscribe and publish requests to server . + */ +#ifndef MQTT_REQ_MAX_IN_FLIGHT +#define MQTT_REQ_MAX_IN_FLIGHT 4 +#endif + +/** + * Seconds between each cyclic timer call. + */ +#ifndef MQTT_CYCLIC_TIMER_INTERVAL +#define MQTT_CYCLIC_TIMER_INTERVAL 5 +#endif + +/** + * Publish, subscribe and unsubscribe request timeout in seconds. + */ +#ifndef MQTT_REQ_TIMEOUT +#define MQTT_REQ_TIMEOUT 30 +#endif + +/** + * Seconds for MQTT connect response timeout after sending connect request + */ +#ifndef MQTT_CONNECT_TIMOUT +#define MQTT_CONNECT_TIMOUT 100 +#endif + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_MQTT_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns.h new file mode 100644 index 0000000..c9f68d8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns.h @@ -0,0 +1,43 @@ +/** + * @file + * NETBIOS name service responder + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ +#ifndef LWIP_HDR_APPS_NETBIOS_H +#define LWIP_HDR_APPS_NETBIOS_H + +#include "lwip/apps/netbiosns_opts.h" + +void netbiosns_init(void); +#ifndef NETBIOS_LWIP_NAME +void netbiosns_set_name(const char* hostname); +#endif +void netbiosns_stop(void); + +#endif /* LWIP_HDR_APPS_NETBIOS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns_opts.h new file mode 100644 index 0000000..0909ef7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/netbiosns_opts.h @@ -0,0 +1,59 @@ +/** + * @file + * NETBIOS name service responder options + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ +#ifndef LWIP_HDR_APPS_NETBIOS_OPTS_H +#define LWIP_HDR_APPS_NETBIOS_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup netbiosns_opts Options + * @ingroup netbiosns + * @{ + */ + +/** NetBIOS name of lwip device + * This must be uppercase until NETBIOS_STRCMP() is defined to a string + * comparision function that is case insensitive. + * If you want to use the netif's hostname, use this (with LWIP_NETIF_HOSTNAME): + * (ip_current_netif() != NULL ? ip_current_netif()->hostname != NULL ? ip_current_netif()->hostname : "" : "") + * + * If this is not defined, netbiosns_set_name() can be called at runtime to change the name. + */ +#ifdef __DOXYGEN__ +#define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV" +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_NETBIOS_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp.h new file mode 100644 index 0000000..10e8ff4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp.h @@ -0,0 +1,128 @@ +/** + * @file + * SNMP server main API - start and basic configuration + */ + +/* + * Copyright (c) 2001, 2002 Leon Woestenberg + * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Leon Woestenberg + * Martin Hentschel + * + */ +#ifndef LWIP_HDR_APPS_SNMP_H +#define LWIP_HDR_APPS_SNMP_H + +#include "lwip/apps/snmp_opts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/err.h" +#include "lwip/apps/snmp_core.h" + +/** SNMP variable binding descriptor (publically needed for traps) */ +struct snmp_varbind +{ + /** pointer to next varbind, NULL for last in list */ + struct snmp_varbind *next; + /** pointer to previous varbind, NULL for first in list */ + struct snmp_varbind *prev; + + /** object identifier */ + struct snmp_obj_id oid; + + /** value ASN1 type */ + u8_t type; + /** object value length */ + u16_t value_len; + /** object value */ + void *value; +}; + +/** + * @ingroup snmp_core + * Agent setup, start listening to port 161. + */ +void snmp_init(void); +void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs); + +void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid); +const struct snmp_obj_id* snmp_get_device_enterprise_oid(void); + +void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable); +void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst); + +/** Generic trap: cold start */ +#define SNMP_GENTRAP_COLDSTART 0 +/** Generic trap: warm start */ +#define SNMP_GENTRAP_WARMSTART 1 +/** Generic trap: link down */ +#define SNMP_GENTRAP_LINKDOWN 2 +/** Generic trap: link up */ +#define SNMP_GENTRAP_LINKUP 3 +/** Generic trap: authentication failure */ +#define SNMP_GENTRAP_AUTH_FAILURE 4 +/** Generic trap: EGP neighbor lost */ +#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5 +/** Generic trap: enterprise specific */ +#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6 + +err_t snmp_send_trap_generic(s32_t generic_trap); +err_t snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds); +err_t snmp_send_trap(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds); + +#define SNMP_AUTH_TRAPS_DISABLED 0 +#define SNMP_AUTH_TRAPS_ENABLED 1 +void snmp_set_auth_traps_enabled(u8_t enable); +u8_t snmp_get_auth_traps_enabled(void); + +const char * snmp_get_community(void); +const char * snmp_get_community_write(void); +const char * snmp_get_community_trap(void); +void snmp_set_community(const char * const community); +void snmp_set_community_write(const char * const community); +void snmp_set_community_trap(const char * const community); + +void snmp_coldstart_trap(void); +void snmp_authfail_trap(void); + +typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg); +void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg); + +#endif /* LWIP_SNMP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_core.h new file mode 100644 index 0000000..e781c53 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_core.h @@ -0,0 +1,364 @@ +/** + * @file + * SNMP core API for implementing MIBs + */ + +/* + * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Christiaan Simons + * Martin Hentschel + */ + +#ifndef LWIP_HDR_APPS_SNMP_CORE_H +#define LWIP_HDR_APPS_SNMP_CORE_H + +#include "lwip/apps/snmp_opts.h" + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip_addr.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* basic ASN1 defines */ +#define SNMP_ASN1_CLASS_UNIVERSAL 0x00 +#define SNMP_ASN1_CLASS_APPLICATION 0x40 +#define SNMP_ASN1_CLASS_CONTEXT 0x80 +#define SNMP_ASN1_CLASS_PRIVATE 0xC0 + +#define SNMP_ASN1_CONTENTTYPE_PRIMITIVE 0x00 +#define SNMP_ASN1_CONTENTTYPE_CONSTRUCTED 0x20 + +/* universal tags (from ASN.1 spec.) */ +#define SNMP_ASN1_UNIVERSAL_END_OF_CONTENT 0 +#define SNMP_ASN1_UNIVERSAL_INTEGER 2 +#define SNMP_ASN1_UNIVERSAL_OCTET_STRING 4 +#define SNMP_ASN1_UNIVERSAL_NULL 5 +#define SNMP_ASN1_UNIVERSAL_OBJECT_ID 6 +#define SNMP_ASN1_UNIVERSAL_SEQUENCE_OF 16 + +/* application specific (SNMP) tags (from SNMPv2-SMI) */ +#define SNMP_ASN1_APPLICATION_IPADDR 0 /* [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4)) */ +#define SNMP_ASN1_APPLICATION_COUNTER 1 /* [APPLICATION 1] IMPLICIT INTEGER (0..4294967295) => u32_t */ +#define SNMP_ASN1_APPLICATION_GAUGE 2 /* [APPLICATION 2] IMPLICIT INTEGER (0..4294967295) => u32_t */ +#define SNMP_ASN1_APPLICATION_TIMETICKS 3 /* [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) => u32_t */ +#define SNMP_ASN1_APPLICATION_OPAQUE 4 /* [APPLICATION 4] IMPLICIT OCTET STRING */ +#define SNMP_ASN1_APPLICATION_COUNTER64 6 /* [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615) */ + +/* context specific (SNMP) tags (from RFC 1905) */ +#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE 1 + +/* full ASN1 type defines */ +#define SNMP_ASN1_TYPE_END_OF_CONTENT (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_END_OF_CONTENT) +#define SNMP_ASN1_TYPE_INTEGER (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_INTEGER) +#define SNMP_ASN1_TYPE_OCTET_STRING (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OCTET_STRING) +#define SNMP_ASN1_TYPE_NULL (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_NULL) +#define SNMP_ASN1_TYPE_OBJECT_ID (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OBJECT_ID) +#define SNMP_ASN1_TYPE_SEQUENCE (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_UNIVERSAL_SEQUENCE_OF) +#define SNMP_ASN1_TYPE_IPADDR (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_IPADDR) +#define SNMP_ASN1_TYPE_IPADDRESS SNMP_ASN1_TYPE_IPADDR +#define SNMP_ASN1_TYPE_COUNTER (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER) +#define SNMP_ASN1_TYPE_COUNTER32 SNMP_ASN1_TYPE_COUNTER +#define SNMP_ASN1_TYPE_GAUGE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_GAUGE) +#define SNMP_ASN1_TYPE_GAUGE32 SNMP_ASN1_TYPE_GAUGE +#define SNMP_ASN1_TYPE_UNSIGNED32 SNMP_ASN1_TYPE_GAUGE +#define SNMP_ASN1_TYPE_TIMETICKS (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_TIMETICKS) +#define SNMP_ASN1_TYPE_OPAQUE (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_OPAQUE) +#define SNMP_ASN1_TYPE_COUNTER64 (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER64) + +#define SNMP_VARBIND_EXCEPTION_OFFSET 0xF0 +#define SNMP_VARBIND_EXCEPTION_MASK 0x0F + +/** error codes predefined by SNMP prot. */ +typedef enum { + SNMP_ERR_NOERROR = 0, +/* +outdated v1 error codes. do not use anmore! +#define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead +#define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead +#define SNMP_ERR_READONLY 4 use SNMP_ERR_NOTWRITABLE instead +*/ + SNMP_ERR_GENERROR = 5, + SNMP_ERR_NOACCESS = 6, + SNMP_ERR_WRONGTYPE = 7, + SNMP_ERR_WRONGLENGTH = 8, + SNMP_ERR_WRONGENCODING = 9, + SNMP_ERR_WRONGVALUE = 10, + SNMP_ERR_NOCREATION = 11, + SNMP_ERR_INCONSISTENTVALUE = 12, + SNMP_ERR_RESOURCEUNAVAILABLE = 13, + SNMP_ERR_COMMITFAILED = 14, + SNMP_ERR_UNDOFAILED = 15, + SNMP_ERR_NOTWRITABLE = 17, + SNMP_ERR_INCONSISTENTNAME = 18, + + SNMP_ERR_NOSUCHINSTANCE = SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE +} snmp_err_t; + +/** internal object identifier representation */ +struct snmp_obj_id +{ + u8_t len; + u32_t id[SNMP_MAX_OBJ_ID_LEN]; +}; + +struct snmp_obj_id_const_ref +{ + u8_t len; + const u32_t* id; +}; + +extern const struct snmp_obj_id_const_ref snmp_zero_dot_zero; /* administrative identifier from SNMPv2-SMI */ + +/** SNMP variant value, used as reference in struct snmp_node_instance and table implementation */ +union snmp_variant_value +{ + void* ptr; + const void* const_ptr; + u32_t u32; + s32_t s32; +}; + + +/** +SNMP MIB node types + tree node is the only node the stack can process in order to walk the tree, + all other nodes are assumed to be leaf nodes. + This cannot be an enum because users may want to define their own node types. +*/ +#define SNMP_NODE_TREE 0x00 +/* predefined leaf node types */ +#define SNMP_NODE_SCALAR 0x01 +#define SNMP_NODE_SCALAR_ARRAY 0x02 +#define SNMP_NODE_TABLE 0x03 +#define SNMP_NODE_THREADSYNC 0x04 + +/** node "base class" layout, the mandatory fields for a node */ +struct snmp_node +{ + /** one out of SNMP_NODE_TREE or any leaf node type (like SNMP_NODE_SCALAR) */ + u8_t node_type; + /** the number assigned to this node which used as part of the full OID */ + u32_t oid; +}; + +/** SNMP node instance access types */ +typedef enum { + SNMP_NODE_INSTANCE_ACCESS_READ = 1, + SNMP_NODE_INSTANCE_ACCESS_WRITE = 2, + SNMP_NODE_INSTANCE_READ_ONLY = SNMP_NODE_INSTANCE_ACCESS_READ, + SNMP_NODE_INSTANCE_READ_WRITE = (SNMP_NODE_INSTANCE_ACCESS_READ | SNMP_NODE_INSTANCE_ACCESS_WRITE), + SNMP_NODE_INSTANCE_WRITE_ONLY = SNMP_NODE_INSTANCE_ACCESS_WRITE, + SNMP_NODE_INSTANCE_NOT_ACCESSIBLE = 0 +} snmp_access_t; + +struct snmp_node_instance; + +typedef s16_t (*node_instance_get_value_method)(struct snmp_node_instance*, void*); +typedef snmp_err_t (*node_instance_set_test_method)(struct snmp_node_instance*, u16_t, void*); +typedef snmp_err_t (*node_instance_set_value_method)(struct snmp_node_instance*, u16_t, void*); +typedef void (*node_instance_release_method)(struct snmp_node_instance*); + +#define SNMP_GET_VALUE_RAW_DATA 0x8000 + +/** SNMP node instance */ +struct snmp_node_instance +{ + /** prefilled with the node, get_instance() is called on; may be changed by user to any value to pass an arbitrary node between calls to get_instance() and get_value/test_value/set_value */ + const struct snmp_node* node; + /** prefilled with the instance id requested; for get_instance() this is the exact oid requested; for get_next_instance() this is the relative starting point, stack expects relative oid of next node here */ + struct snmp_obj_id instance_oid; + + /** ASN type for this object (see snmp_asn1.h for definitions) */ + u8_t asn1_type; + /** one out of instance access types defined above (SNMP_NODE_INSTANCE_READ_ONLY,...) */ + snmp_access_t access; + + /** returns object value for the given object identifier. Return values <0 to indicate an error */ + node_instance_get_value_method get_value; + /** tests length and/or range BEFORE setting */ + node_instance_set_test_method set_test; + /** sets object value, only called when set_test() was successful */ + node_instance_set_value_method set_value; + /** called in any case when the instance is not required anymore by stack (useful for freeing memory allocated in get_instance/get_next_instance methods) */ + node_instance_release_method release_instance; + + /** reference to pass arbitrary value between calls to get_instance() and get_value/test_value/set_value */ + union snmp_variant_value reference; + /** see reference (if reference is a pointer, the length of underlying data may be stored here or anything else) */ + u32_t reference_len; +}; + + +/** SNMP tree node */ +struct snmp_tree_node +{ + /** inherited "base class" members */ + struct snmp_node node; + u16_t subnode_count; + const struct snmp_node* const *subnodes; +}; + +#define SNMP_CREATE_TREE_NODE(oid, subnodes) \ + {{ SNMP_NODE_TREE, (oid) }, \ + (u16_t)LWIP_ARRAYSIZE(subnodes), (subnodes) } + +#define SNMP_CREATE_EMPTY_TREE_NODE(oid) \ + {{ SNMP_NODE_TREE, (oid) }, \ + 0, NULL } + +/** SNMP leaf node */ +struct snmp_leaf_node +{ + /** inherited "base class" members */ + struct snmp_node node; + snmp_err_t (*get_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + snmp_err_t (*get_next_instance)(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +}; + +/** represents a single mib with its base oid and root node */ +struct snmp_mib +{ + const u32_t *base_oid; + u8_t base_oid_len; + const struct snmp_node *root_node; +}; + +#define SNMP_MIB_CREATE(oid_list, root_node) { (oid_list), (u8_t)LWIP_ARRAYSIZE(oid_list), root_node } + +/** OID range structure */ +struct snmp_oid_range +{ + u32_t min; + u32_t max; +}; + +/** checks if incoming OID length and values are in allowed ranges */ +u8_t snmp_oid_in_range(const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len); + +typedef enum { + SNMP_NEXT_OID_STATUS_SUCCESS, + SNMP_NEXT_OID_STATUS_NO_MATCH, + SNMP_NEXT_OID_STATUS_BUF_TO_SMALL +} snmp_next_oid_status_t; + +/** state for next_oid_init / next_oid_check functions */ +struct snmp_next_oid_state +{ + const u32_t* start_oid; + u8_t start_oid_len; + + u32_t* next_oid; + u8_t next_oid_len; + u8_t next_oid_max_len; + + snmp_next_oid_status_t status; + void* reference; +}; + +void snmp_next_oid_init(struct snmp_next_oid_state *state, + const u32_t *start_oid, u8_t start_oid_len, + u32_t *next_oid_buf, u8_t next_oid_max_len); +u8_t snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len); +u8_t snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len, void* reference); + +void snmp_oid_assign(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); +void snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); +void snmp_oid_prefix(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); +void snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len); +u8_t snmp_oid_equal(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); +s8_t snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len); + +#if LWIP_IPV4 +u8_t snmp_oid_to_ip4(const u32_t *oid, ip4_addr_t *ip); +void snmp_ip4_to_oid(const ip4_addr_t *ip, u32_t *oid); +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 +u8_t snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip); +void snmp_ip6_to_oid(const ip6_addr_t *ip, u32_t *oid); +#endif /* LWIP_IPV6 */ +#if LWIP_IPV4 || LWIP_IPV6 +u8_t snmp_ip_to_oid(const ip_addr_t *ip, u32_t *oid); +u8_t snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid); + +u8_t snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip); +u8_t snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port); +#endif /* LWIP_IPV4 || LWIP_IPV6 */ + +struct netif; +u8_t netif_to_num(const struct netif *netif); + +snmp_err_t snmp_set_test_ok(struct snmp_node_instance* instance, u16_t value_len, void* value); /* generic function which can be used if test is always successful */ + +err_t snmp_decode_bits(const u8_t *buf, u32_t buf_len, u32_t *bit_value); +err_t snmp_decode_truthvalue(const s32_t *asn1_value, u8_t *bool_value); +u8_t snmp_encode_bits(u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count); +u8_t snmp_encode_truthvalue(s32_t *asn1_value, u32_t bool_value); + +struct snmp_statistics +{ + u32_t inpkts; + u32_t outpkts; + u32_t inbadversions; + u32_t inbadcommunitynames; + u32_t inbadcommunityuses; + u32_t inasnparseerrs; + u32_t intoobigs; + u32_t innosuchnames; + u32_t inbadvalues; + u32_t inreadonlys; + u32_t ingenerrs; + u32_t intotalreqvars; + u32_t intotalsetvars; + u32_t ingetrequests; + u32_t ingetnexts; + u32_t insetrequests; + u32_t ingetresponses; + u32_t intraps; + u32_t outtoobigs; + u32_t outnosuchnames; + u32_t outbadvalues; + u32_t outgenerrs; + u32_t outgetrequests; + u32_t outgetnexts; + u32_t outsetrequests; + u32_t outgetresponses; + u32_t outtraps; +}; + +extern struct snmp_statistics snmp_stats; + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SNMP */ + +#endif /* LWIP_HDR_APPS_SNMP_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_mib2.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_mib2.h new file mode 100644 index 0000000..2f4a689 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_mib2.h @@ -0,0 +1,78 @@ +/** + * @file + * SNMP MIB2 API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Dirk Ziegelmeier + * + */ +#ifndef LWIP_HDR_APPS_SNMP_MIB2_H +#define LWIP_HDR_APPS_SNMP_MIB2_H + +#include "lwip/apps/snmp_opts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ +#if SNMP_LWIP_MIB2 + +#include "lwip/apps/snmp_core.h" + +extern const struct snmp_mib mib2; + +#if SNMP_USE_NETCONN +#include "lwip/apps/snmp_threadsync.h" +void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg); +extern struct snmp_threadsync_instance snmp_mib2_lwip_locks; +#endif + +#ifndef SNMP_SYSSERVICES +#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2)) +#endif + +void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len); /* read-only be defintion */ +void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); +void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen); +void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); +void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen); +void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); +void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen); + +#endif /* SNMP_LWIP_MIB2 */ +#endif /* LWIP_SNMP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNMP_MIB2_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_opts.h new file mode 100644 index 0000000..6c9ba7b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_opts.h @@ -0,0 +1,293 @@ +/** + * @file + * SNMP server options list + */ + +/* + * Copyright (c) 2015 Dirk Ziegelmeier + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Dirk Ziegelmeier + * + */ +#ifndef LWIP_HDR_SNMP_OPTS_H +#define LWIP_HDR_SNMP_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup snmp_opts Options + * @ingroup snmp + * @{ + */ + +/** + * LWIP_SNMP==1: This enables the lwIP SNMP agent. UDP must be available + * for SNMP transport. + * If you want to use your own SNMP agent, leave this disabled. + * To integrate MIB2 of an external agent, you need to enable + * LWIP_MIB2_CALLBACKS and MIB2_STATS. This will give you the callbacks + * and statistics counters you need to get MIB2 working. + */ +#if !defined LWIP_SNMP || defined __DOXYGEN__ +#define LWIP_SNMP 0 +#endif + +/** + * SNMP_USE_NETCONN: Use netconn API instead of raw API. + * Makes SNMP agent run in a worker thread, so blocking operations + * can be done in MIB calls. + */ +#if !defined SNMP_USE_NETCONN || defined __DOXYGEN__ +#define SNMP_USE_NETCONN 0 +#endif + +/** + * SNMP_USE_RAW: Use raw API. + * SNMP agent does not run in a worker thread, so blocking operations + * should not be done in MIB calls. + */ +#if !defined SNMP_USE_RAW || defined __DOXYGEN__ +#define SNMP_USE_RAW 1 +#endif + +#if SNMP_USE_NETCONN && SNMP_USE_RAW +#error SNMP stack can use only one of the APIs {raw, netconn} +#endif + +#if LWIP_SNMP && !SNMP_USE_NETCONN && !SNMP_USE_RAW +#error SNMP stack needs a receive API and UDP {raw, netconn} +#endif + +#if SNMP_USE_NETCONN +/** + * SNMP_STACK_SIZE: Stack size of SNMP netconn worker thread + */ +#if !defined SNMP_STACK_SIZE || defined __DOXYGEN__ +#define SNMP_STACK_SIZE DEFAULT_THREAD_STACKSIZE +#endif + +/** + * SNMP_THREAD_PRIO: SNMP netconn worker thread priority + */ +#if !defined SNMP_THREAD_PRIO || defined __DOXYGEN__ +#define SNMP_THREAD_PRIO DEFAULT_THREAD_PRIO +#endif +#endif /* SNMP_USE_NETCONN */ + +/** + * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap + * destination is required + */ +#if !defined SNMP_TRAP_DESTINATIONS || defined __DOXYGEN__ +#define SNMP_TRAP_DESTINATIONS 1 +#endif + +/** + * Only allow SNMP write actions that are 'safe' (e.g. disabling netifs is not + * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). + * Unsafe requests are disabled by default! + */ +#if !defined SNMP_SAFE_REQUESTS || defined __DOXYGEN__ +#define SNMP_SAFE_REQUESTS 1 +#endif + +/** + * The maximum length of strings used. + */ +#if !defined SNMP_MAX_OCTET_STRING_LEN || defined __DOXYGEN__ +#define SNMP_MAX_OCTET_STRING_LEN 127 +#endif + +/** + * The maximum number of Sub ID's inside an object identifier. + * Indirectly this also limits the maximum depth of SNMP tree. + */ +#if !defined SNMP_MAX_OBJ_ID_LEN || defined __DOXYGEN__ +#define SNMP_MAX_OBJ_ID_LEN 50 +#endif + +#if !defined SNMP_MAX_VALUE_SIZE || defined __DOXYGEN__ +/** + * The maximum size of a value. + */ +#define SNMP_MIN_VALUE_SIZE (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */ +/** + * The minimum size of a value. + */ +#define SNMP_MAX_VALUE_SIZE LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE) +#endif + +/** + * The snmp read-access community. Used for write-access and traps, too + * unless SNMP_COMMUNITY_WRITE or SNMP_COMMUNITY_TRAP are enabled, respectively. + */ +#if !defined SNMP_COMMUNITY || defined __DOXYGEN__ +#define SNMP_COMMUNITY "public" +#endif + +/** + * The snmp write-access community. + * Set this community to "" in order to disallow any write access. + */ +#if !defined SNMP_COMMUNITY_WRITE || defined __DOXYGEN__ +#define SNMP_COMMUNITY_WRITE "private" +#endif + +/** + * The snmp community used for sending traps. + */ +#if !defined SNMP_COMMUNITY_TRAP || defined __DOXYGEN__ +#define SNMP_COMMUNITY_TRAP "public" +#endif + +/** + * The maximum length of community string. + * If community names shall be adjusted at runtime via snmp_set_community() calls, + * enter here the possible maximum length (+1 for terminating null character). + */ +#if !defined SNMP_MAX_COMMUNITY_STR_LEN || defined __DOXYGEN__ +#define SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP)) +#endif + +/** + * The OID identifiying the device. This may be the enterprise OID itself or any OID located below it in tree. + */ +#if !defined SNMP_DEVICE_ENTERPRISE_OID || defined __DOXYGEN__ +#define SNMP_LWIP_ENTERPRISE_OID 26381 +/** + * IANA assigned enterprise ID for lwIP is 26381 + * @see http://www.iana.org/assignments/enterprise-numbers + * + * @note this enterprise ID is assigned to the lwIP project, + * all object identifiers living under this ID are assigned + * by the lwIP maintainers! + * @note don't change this define, use snmp_set_device_enterprise_oid() + * + * If you need to create your own private MIB you'll need + * to apply for your own enterprise ID with IANA: + * http://www.iana.org/numbers.html + */ +#define SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID} +/** + * Length of SNMP_DEVICE_ENTERPRISE_OID + */ +#define SNMP_DEVICE_ENTERPRISE_OID_LEN 7 +#endif + +/** + * SNMP_DEBUG: Enable debugging for SNMP messages. + */ +#if !defined SNMP_DEBUG || defined __DOXYGEN__ +#define SNMP_DEBUG LWIP_DBG_OFF +#endif + +/** + * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. + */ +#if !defined SNMP_MIB_DEBUG || defined __DOXYGEN__ +#define SNMP_MIB_DEBUG LWIP_DBG_OFF +#endif + +/** + * Indicates if the MIB2 implementation of LWIP SNMP stack is used. + */ +#if !defined SNMP_LWIP_MIB2 || defined __DOXYGEN__ +#define SNMP_LWIP_MIB2 LWIP_SNMP +#endif + +/** + * Value return for sysDesc field of MIB2. + */ +#if !defined SNMP_LWIP_MIB2_SYSDESC || defined __DOXYGEN__ +#define SNMP_LWIP_MIB2_SYSDESC "lwIP" +#endif + +/** + * Value return for sysName field of MIB2. + * To make sysName field settable, call snmp_mib2_set_sysname() to provide the necessary buffers. + */ +#if !defined SNMP_LWIP_MIB2_SYSNAME || defined __DOXYGEN__ +#define SNMP_LWIP_MIB2_SYSNAME "FQDN-unk" +#endif + +/** + * Value return for sysContact field of MIB2. + * To make sysContact field settable, call snmp_mib2_set_syscontact() to provide the necessary buffers. + */ +#if !defined SNMP_LWIP_MIB2_SYSCONTACT || defined __DOXYGEN__ +#define SNMP_LWIP_MIB2_SYSCONTACT "" +#endif + +/** + * Value return for sysLocation field of MIB2. + * To make sysLocation field settable, call snmp_mib2_set_syslocation() to provide the necessary buffers. + */ +#if !defined SNMP_LWIP_MIB2_SYSLOCATION || defined __DOXYGEN__ +#define SNMP_LWIP_MIB2_SYSLOCATION "" +#endif + +/** + * This value is used to limit the repetitions processed in GetBulk requests (value == 0 means no limitation). + * This may be useful to limit the load for a single request. + * According to SNMP RFC 1905 it is allowed to not return all requested variables from a GetBulk request if system load would be too high. + * so the effect is that the client will do more requests to gather all data. + * For the stack this could be useful in case that SNMP processing is done in TCP/IP thread. In this situation a request with many + * repetitions could block the thread for a longer time. Setting limit here will keep the stack more responsive. + */ +#if !defined SNMP_LWIP_GETBULK_MAX_REPETITIONS || defined __DOXYGEN__ +#define SNMP_LWIP_GETBULK_MAX_REPETITIONS 0 +#endif + +/** + * @} + */ + +/* + ------------------------------------ + ---------- SNMPv3 options ---------- + ------------------------------------ +*/ + +/** + * LWIP_SNMP_V3==1: This enables EXPERIMENTAL SNMPv3 support. LWIP_SNMP must + * also be enabled. + * THIS IS UNDER DEVELOPMENT AND SHOULD NOT BE ENABLED IN PRODUCTS. + */ +#ifndef LWIP_SNMP_V3 +#define LWIP_SNMP_V3 0 +#endif + +#ifndef LWIP_SNMP_V3_CRYPTO +#define LWIP_SNMP_V3_CRYPTO LWIP_SNMP_V3 +#endif + +#ifndef LWIP_SNMP_V3_MBEDTLS +#define LWIP_SNMP_V3_MBEDTLS LWIP_SNMP_V3 +#endif + +#endif /* LWIP_HDR_SNMP_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_scalar.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_scalar.h new file mode 100644 index 0000000..40a060c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_scalar.h @@ -0,0 +1,113 @@ +/** + * @file + * SNMP server MIB API to implement scalar nodes + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#ifndef LWIP_HDR_APPS_SNMP_SCALAR_H +#define LWIP_HDR_APPS_SNMP_SCALAR_H + +#include "lwip/apps/snmp_opts.h" +#include "lwip/apps/snmp_core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +/** basic scalar node */ +struct snmp_scalar_node +{ + /** inherited "base class" members */ + struct snmp_leaf_node node; + u8_t asn1_type; + snmp_access_t access; + node_instance_get_value_method get_value; + node_instance_set_test_method set_test; + node_instance_set_value_method set_value; +}; + + +snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + +#define SNMP_SCALAR_CREATE_NODE(oid, access, asn1_type, get_value_method, set_test_method, set_value_method) \ + {{{ SNMP_NODE_SCALAR, (oid) }, \ + snmp_scalar_get_instance, \ + snmp_scalar_get_next_instance }, \ + (asn1_type), (access), (get_value_method), (set_test_method), (set_value_method) } + +#define SNMP_SCALAR_CREATE_NODE_READONLY(oid, asn1_type, get_value_method) SNMP_SCALAR_CREATE_NODE(oid, SNMP_NODE_INSTANCE_READ_ONLY, asn1_type, get_value_method, NULL, NULL) + +/** scalar array node - a tree node which contains scalars only as children */ +struct snmp_scalar_array_node_def +{ + u32_t oid; + u8_t asn1_type; + snmp_access_t access; +}; + +typedef s16_t (*snmp_scalar_array_get_value_method)(const struct snmp_scalar_array_node_def*, void*); +typedef snmp_err_t (*snmp_scalar_array_set_test_method)(const struct snmp_scalar_array_node_def*, u16_t, void*); +typedef snmp_err_t (*snmp_scalar_array_set_value_method)(const struct snmp_scalar_array_node_def*, u16_t, void*); + +/** basic scalar array node */ +struct snmp_scalar_array_node +{ + /** inherited "base class" members */ + struct snmp_leaf_node node; + u16_t array_node_count; + const struct snmp_scalar_array_node_def* array_nodes; + snmp_scalar_array_get_value_method get_value; + snmp_scalar_array_set_test_method set_test; + snmp_scalar_array_set_value_method set_value; +}; + +snmp_err_t snmp_scalar_array_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +snmp_err_t snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + +#define SNMP_SCALAR_CREATE_ARRAY_NODE(oid, array_nodes, get_value_method, set_test_method, set_value_method) \ + {{{ SNMP_NODE_SCALAR_ARRAY, (oid) }, \ + snmp_scalar_array_get_instance, \ + snmp_scalar_array_get_next_instance }, \ + (u16_t)LWIP_ARRAYSIZE(array_nodes), (array_nodes), (get_value_method), (set_test_method), (set_value_method) } + +#endif /* LWIP_SNMP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNMP_SCALAR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_table.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_table.h new file mode 100644 index 0000000..4988b51 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_table.h @@ -0,0 +1,134 @@ +/** + * @file + * SNMP server MIB API to implement table nodes + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Martin Hentschel + * + */ + +#ifndef LWIP_HDR_APPS_SNMP_TABLE_H +#define LWIP_HDR_APPS_SNMP_TABLE_H + +#include "lwip/apps/snmp_opts.h" +#include "lwip/apps/snmp_core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +/** default (customizable) read/write table */ +struct snmp_table_col_def +{ + u32_t index; + u8_t asn1_type; + snmp_access_t access; +}; + +/** table node */ +struct snmp_table_node +{ + /** inherited "base class" members */ + struct snmp_leaf_node node; + u16_t column_count; + const struct snmp_table_col_def* columns; + snmp_err_t (*get_cell_instance)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, struct snmp_node_instance* cell_instance); + snmp_err_t (*get_next_cell_instance)(const u32_t* column, struct snmp_obj_id* row_oid, struct snmp_node_instance* cell_instance); + /** returns object value for the given object identifier */ + node_instance_get_value_method get_value; + /** tests length and/or range BEFORE setting */ + node_instance_set_test_method set_test; + /** sets object value, only called when set_test() was successful */ + node_instance_set_value_method set_value; +}; + +snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + +#define SNMP_TABLE_CREATE(oid, columns, get_cell_instance_method, get_next_cell_instance_method, get_value_method, set_test_method, set_value_method) \ + {{{ SNMP_NODE_TABLE, (oid) }, \ + snmp_table_get_instance, \ + snmp_table_get_next_instance }, \ + (u16_t)LWIP_ARRAYSIZE(columns), (columns), \ + (get_cell_instance_method), (get_next_cell_instance_method), \ + (get_value_method), (set_test_method), (set_value_method)} + +#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */ + + +/** simple read-only table */ +typedef enum { + SNMP_VARIANT_VALUE_TYPE_U32, + SNMP_VARIANT_VALUE_TYPE_S32, + SNMP_VARIANT_VALUE_TYPE_PTR, + SNMP_VARIANT_VALUE_TYPE_CONST_PTR +} snmp_table_column_data_type_t; + +struct snmp_table_simple_col_def +{ + u32_t index; + u8_t asn1_type; + snmp_table_column_data_type_t data_type; /* depending of what union member is used to store the value*/ +}; + +/** simple read-only table node */ +struct snmp_table_simple_node +{ + /* inherited "base class" members */ + struct snmp_leaf_node node; + u16_t column_count; + const struct snmp_table_simple_col_def* columns; + snmp_err_t (*get_cell_value)(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len); + snmp_err_t (*get_next_cell_instance_and_value)(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len); +}; + +snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + +#define SNMP_TABLE_CREATE_SIMPLE(oid, columns, get_cell_value_method, get_next_cell_instance_and_value_method) \ + {{{ SNMP_NODE_TABLE, (oid) }, \ + snmp_table_simple_get_instance, \ + snmp_table_simple_get_next_instance }, \ + (u16_t)LWIP_ARRAYSIZE(columns), (columns), (get_cell_value_method), (get_next_cell_instance_and_value_method) } + +s16_t snmp_table_extract_value_from_s32ref(struct snmp_node_instance* instance, void* value); +s16_t snmp_table_extract_value_from_u32ref(struct snmp_node_instance* instance, void* value); +s16_t snmp_table_extract_value_from_refconstptr(struct snmp_node_instance* instance, void* value); + +#endif /* LWIP_SNMP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNMP_TABLE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_threadsync.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_threadsync.h new file mode 100644 index 0000000..a25dbf2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmp_threadsync.h @@ -0,0 +1,114 @@ +/** + * @file + * SNMP server MIB API to implement thread synchronization + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Dirk Ziegelmeier + * + */ + +#ifndef LWIP_HDR_APPS_SNMP_THREADSYNC_H +#define LWIP_HDR_APPS_SNMP_THREADSYNC_H + +#include "lwip/apps/snmp_opts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/apps/snmp_core.h" +#include "lwip/sys.h" + +typedef void (*snmp_threadsync_called_fn)(void* arg); +typedef void (*snmp_threadsync_synchronizer_fn)(snmp_threadsync_called_fn fn, void* arg); + + +/** Thread sync runtime data. For internal usage only. */ +struct threadsync_data +{ + union { + snmp_err_t err; + s16_t s16; + } retval; + union { + const u32_t *root_oid; + void *value; + } arg1; + union { + u8_t root_oid_len; + u16_t len; + } arg2; + const struct snmp_threadsync_node *threadsync_node; + struct snmp_node_instance proxy_instance; +}; + +/** Thread sync instance. Needed EXCATLY once for every thread to be synced into. */ +struct snmp_threadsync_instance +{ + sys_sem_t sem; + sys_mutex_t sem_usage_mutex; + snmp_threadsync_synchronizer_fn sync_fn; + struct threadsync_data data; +}; + +/** SNMP thread sync proxy leaf node */ +struct snmp_threadsync_node +{ + /* inherited "base class" members */ + struct snmp_leaf_node node; + + const struct snmp_leaf_node *target; + struct snmp_threadsync_instance *instance; +}; + +snmp_err_t snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); +snmp_err_t snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance); + +/** Create thread sync proxy node */ +#define SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance) \ + {{{ SNMP_NODE_THREADSYNC, (oid) }, \ + snmp_threadsync_get_instance, \ + snmp_threadsync_get_next_instance }, \ + (target_leaf_node), \ + (threadsync_instance) } + +/** Create thread sync instance data */ +void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn); + +#endif /* LWIP_SNMP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNMP_THREADSYNC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmpv3.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmpv3.h new file mode 100644 index 0000000..c99fed4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/snmpv3.h @@ -0,0 +1,90 @@ +/** + * @file + * Additional SNMPv3 functionality RFC3414 and RFC3826. + */ + +/* + * Copyright (c) 2016 Elias Oenal. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Elias Oenal + */ + +#ifndef LWIP_HDR_APPS_SNMP_V3_H +#define LWIP_HDR_APPS_SNMP_V3_H + +#include "lwip/apps/snmp_opts.h" +#include "lwip/err.h" + +#if LWIP_SNMP && LWIP_SNMP_V3 + +#define SNMP_V3_AUTH_ALGO_INVAL 0 +#define SNMP_V3_AUTH_ALGO_MD5 1 +#define SNMP_V3_AUTH_ALGO_SHA 2 + +#define SNMP_V3_PRIV_ALGO_INVAL 0 +#define SNMP_V3_PRIV_ALGO_DES 1 +#define SNMP_V3_PRIV_ALGO_AES 2 + +#define SNMP_V3_PRIV_MODE_DECRYPT 0 +#define SNMP_V3_PRIV_MODE_ENCRYPT 1 + +/* + * The following callback functions must be implemented by the application. + * There is a dummy implementation in snmpv3_dummy.c. + */ + +void snmpv3_get_engine_id(const char **id, u8_t *len); +err_t snmpv3_set_engine_id(const char* id, u8_t len); + +u32_t snmpv3_get_engine_boots(void); +void snmpv3_set_engine_boots(u32_t boots); + +u32_t snmpv3_get_engine_time(void); +void snmpv3_reset_engine_time(void); + +err_t snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *priv_algo, u8_t *priv_key); + +/* The following functions are provided by the SNMPv3 agent */ + +void snmpv3_engine_id_changed(void); + +void snmpv3_password_to_key_md5( + const u8_t *password, /* IN */ + u8_t passwordlen, /* IN */ + const u8_t *engineID, /* IN - pointer to snmpEngineID */ + u8_t engineLength, /* IN - length of snmpEngineID */ + u8_t *key); /* OUT - pointer to caller 16-octet buffer */ + +void snmpv3_password_to_key_sha( + const u8_t *password, /* IN */ + u8_t passwordlen, /* IN */ + const u8_t *engineID, /* IN - pointer to snmpEngineID */ + u8_t engineLength, /* IN - length of snmpEngineID */ + u8_t *key); /* OUT - pointer to caller 20-octet buffer */ + +#endif + +#endif /* LWIP_HDR_APPS_SNMP_V3_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp.h new file mode 100644 index 0000000..40df9cc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp.h @@ -0,0 +1,76 @@ +/** + * @file + * SNTP client API + */ + +/* + * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Frédéric Bernon, Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_APPS_SNTP_H +#define LWIP_HDR_APPS_SNTP_H + +#include "lwip/apps/sntp_opts.h" +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* SNTP operating modes: default is to poll using unicast. + The mode has to be set before calling sntp_init(). */ +#define SNTP_OPMODE_POLL 0 +#define SNTP_OPMODE_LISTENONLY 1 +void sntp_setoperatingmode(u8_t operating_mode); +u8_t sntp_getoperatingmode(void); + +void sntp_init(void); +void sntp_stop(void); +u8_t sntp_enabled(void); + +void sntp_setserver(u8_t idx, const ip_addr_t *addr); +const ip_addr_t* sntp_getserver(u8_t idx); + +#if SNTP_SERVER_DNS +void sntp_setservername(u8_t idx, char *server); +char *sntp_getservername(u8_t idx); +#endif /* SNTP_SERVER_DNS */ + +#if SNTP_GET_SERVERS_FROM_DHCP +void sntp_servermode_dhcp(int set_servers_from_dhcp); +#else /* SNTP_GET_SERVERS_FROM_DHCP */ +#define sntp_servermode_dhcp(x) +#endif /* SNTP_GET_SERVERS_FROM_DHCP */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_SNTP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp_opts.h new file mode 100644 index 0000000..f3651f9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/sntp_opts.h @@ -0,0 +1,173 @@ +/** + * @file + * SNTP client options list + */ + +/* + * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Frédéric Bernon, Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_APPS_SNTP_OPTS_H +#define LWIP_HDR_APPS_SNTP_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup sntp_opts Options + * @ingroup sntp + * @{ + */ + +/** SNTP macro to change system time in seconds + * Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds instead of this one + * if you need the additional precision. + */ +#if !defined SNTP_SET_SYSTEM_TIME || defined __DOXYGEN__ +#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec) +#endif + +/** The maximum number of SNTP servers that can be set */ +#if !defined SNTP_MAX_SERVERS || defined __DOXYGEN__ +#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS +#endif + +/** Set this to 1 to implement the callback function called by dhcp when + * NTP servers are received. */ +#if !defined SNTP_GET_SERVERS_FROM_DHCP || defined __DOXYGEN__ +#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV +#endif + +/** Set this to 1 to support DNS names (or IP address strings) to set sntp servers + * One server address/name can be defined as default if SNTP_SERVER_DNS == 1: + * \#define SNTP_SERVER_ADDRESS "pool.ntp.org" + */ +#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__ +#define SNTP_SERVER_DNS 0 +#endif + +/** + * SNTP_DEBUG: Enable debugging for SNTP. + */ +#if !defined SNTP_DEBUG || defined __DOXYGEN__ +#define SNTP_DEBUG LWIP_DBG_OFF +#endif + +/** SNTP server port */ +#if !defined SNTP_PORT || defined __DOXYGEN__ +#define SNTP_PORT 123 +#endif + +/** Set this to 1 to allow config of SNTP server(s) by DNS name */ +#if !defined SNTP_SERVER_DNS || defined __DOXYGEN__ +#define SNTP_SERVER_DNS 0 +#endif + +/** Sanity check: + * Define this to + * - 0 to turn off sanity checks (default; smaller code) + * - >= 1 to check address and port of the response packet to ensure the + * response comes from the server we sent the request to. + * - >= 2 to check returned Originate Timestamp against Transmit Timestamp + * sent to the server (to ensure response to older request). + * - >= 3 @todo: discard reply if any of the LI, Stratum, or Transmit Timestamp + * fields is 0 or the Mode field is not 4 (unicast) or 5 (broadcast). + * - >= 4 @todo: to check that the Root Delay and Root Dispersion fields are each + * greater than or equal to 0 and less than infinity, where infinity is + * currently a cozy number like one second. This check avoids using a + * server whose synchronization source has expired for a very long time. + */ +#if !defined SNTP_CHECK_RESPONSE || defined __DOXYGEN__ +#define SNTP_CHECK_RESPONSE 0 +#endif + +/** According to the RFC, this shall be a random delay + * between 1 and 5 minutes (in milliseconds) to prevent load peaks. + * This can be defined to a random generation function, + * which must return the delay in milliseconds as u32_t. + * Turned off by default. + */ +#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__ +#define SNTP_STARTUP_DELAY 0 +#endif + +/** If you want the startup delay to be a function, define this + * to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1. + */ +#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__ +#define SNTP_STARTUP_DELAY_FUNC SNTP_STARTUP_DELAY +#endif + +/** SNTP receive timeout - in milliseconds + * Also used as retry timeout - this shouldn't be too low. + * Default is 3 seconds. + */ +#if !defined SNTP_RECV_TIMEOUT || defined __DOXYGEN__ +#define SNTP_RECV_TIMEOUT 3000 +#endif + +/** SNTP update delay - in milliseconds + * Default is 1 hour. Must not be beolw 15 seconds by specification (i.e. 15000) + */ +#if !defined SNTP_UPDATE_DELAY || defined __DOXYGEN__ +#define SNTP_UPDATE_DELAY 3600000 +#endif + +/** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2 + * to send in request and compare in response. + */ +#if !defined SNTP_GET_SYSTEM_TIME || defined __DOXYGEN__ +#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0) +#endif + +/** Default retry timeout (in milliseconds) if the response + * received is invalid. + * This is doubled with each retry until SNTP_RETRY_TIMEOUT_MAX is reached. + */ +#if !defined SNTP_RETRY_TIMEOUT || defined __DOXYGEN__ +#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT +#endif + +/** Maximum retry timeout (in milliseconds). */ +#if !defined SNTP_RETRY_TIMEOUT_MAX || defined __DOXYGEN__ +#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10) +#endif + +/** Increase retry timeout with every retry sent + * Default is on to conform to RFC. + */ +#if !defined SNTP_RETRY_TIMEOUT_EXP || defined __DOXYGEN__ +#define SNTP_RETRY_TIMEOUT_EXP 1 +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_SNTP_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h new file mode 100644 index 0000000..6968a80 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h @@ -0,0 +1,105 @@ +/****************************************************************//** + * + * @file tftp_opts.h + * + * @author Logan Gunthorpe + * + * @brief Trivial File Transfer Protocol (RFC 1350) implementation options + * + * Copyright (c) Deltatee Enterprises Ltd. 2013 + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Logan Gunthorpe + * + */ + +#ifndef LWIP_HDR_APPS_TFTP_OPTS_H +#define LWIP_HDR_APPS_TFTP_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup tftp_opts Options + * @ingroup tftp + * @{ + */ + +/** + * Enable TFTP debug messages + */ +#if !defined TFTP_DEBUG || defined __DOXYGEN__ +#define TFTP_DEBUG LWIP_DBG_ON +#endif + +/** + * TFTP server port + */ +#if !defined TFTP_PORT || defined __DOXYGEN__ +#define TFTP_PORT 69 +#endif + +/** + * TFTP timeout + */ +#if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__ +#define TFTP_TIMEOUT_MSECS 10000 +#endif + +/** + * Max. number of retries when a file is read from server + */ +#if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__ +#define TFTP_MAX_RETRIES 5 +#endif + +/** + * TFTP timer cyclic interval + */ +#if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__ +#define TFTP_TIMER_MSECS 50 +#endif + +/** + * Max. length of TFTP filename + */ +#if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__ +#define TFTP_MAX_FILENAME_LEN 20 +#endif + +/** + * Max. length of TFTP mode + */ +#if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__ +#define TFTP_MAX_MODE_LEN 7 +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_TFTP_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_server.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_server.h new file mode 100644 index 0000000..3fbe701 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/apps/tftp_server.h @@ -0,0 +1,94 @@ +/****************************************************************//** + * + * @file tftp_server.h + * + * @author Logan Gunthorpe + * + * @brief Trivial File Transfer Protocol (RFC 1350) + * + * Copyright (c) Deltatee Enterprises Ltd. 2013 + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Logan Gunthorpe + * + */ + +#ifndef LWIP_HDR_APPS_TFTP_SERVER_H +#define LWIP_HDR_APPS_TFTP_SERVER_H + +#include "lwip/apps/tftp_opts.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup tftp + * TFTP context containing callback functions for TFTP transfers + */ +struct tftp_context { + /** + * Open file for read/write. + * @param fname Filename + * @param mode Mode string from TFTP RFC 1350 (netascii, octet, mail) + * @param write Flag indicating read (0) or write (!= 0) access + * @returns File handle supplied to other functions + */ + void* (*open)(const char* fname, const char* mode, u8_t write); + /** + * Close file handle + * @param handle File handle returned by open() + */ + void (*close)(void* handle); + /** + * Read from file + * @param handle File handle returned by open() + * @param buf Target buffer to copy read data to + * @param bytes Number of bytes to copy to buf + * @returns >= 0: Success; < 0: Error + */ + int (*read)(void* handle, void* buf, int bytes); + /** + * Write to file + * @param handle File handle returned by open() + * @param pbuf PBUF adjusted such that payload pointer points + * to the beginning of write data. In other words, + * TFTP headers are stripped off. + * @returns >= 0: Success; < 0: Error + */ + int (*write)(void* handle, struct pbuf* p); +}; + +err_t tftp_init(const struct tftp_context* ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_APPS_TFTP_SERVER_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/arch.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/arch.h new file mode 100644 index 0000000..55714e1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/arch.h @@ -0,0 +1,319 @@ +/** + * @file + * Support for different processor and compiler architectures + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_ARCH_H +#define LWIP_HDR_ARCH_H + +#ifndef LITTLE_ENDIAN +#define LITTLE_ENDIAN 1234 +#endif + +#ifndef BIG_ENDIAN +#define BIG_ENDIAN 4321 +#endif + +#include "arch/cc.h" + +/** + * @defgroup compiler_abstraction Compiler/platform abstraction + * @ingroup sys_layer + * All defines related to this section must not be placed in lwipopts.h, + * but in arch/cc.h! + * These options cannot be \#defined in lwipopts.h since they are not options + * of lwIP itself, but options of the lwIP port to your system. + * @{ + */ + +/** Define the byte order of the system. + * Needed for conversion of network data to host byte order. + * Allowed values: LITTLE_ENDIAN and BIG_ENDIAN + */ +#ifndef BYTE_ORDER +#define BYTE_ORDER LITTLE_ENDIAN +#endif + +/** Define random number generator function of your system */ +#ifdef __DOXYGEN__ +#define LWIP_RAND() ((u32_t)rand()) +#endif + +/** Platform specific diagnostic output.\n + * Note the default implementation pulls in printf, which may + * in turn pull in a lot of standard libary code. In resource-constrained + * systems, this should be defined to something less resource-consuming. + */ +#ifndef LWIP_PLATFORM_DIAG +#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) +#include +#include +#endif + +/** Platform specific assertion handling.\n + * Note the default implementation pulls in printf, fflush and abort, which may + * in turn pull in a lot of standard libary code. In resource-constrained + * systems, this should be defined to something less resource-consuming. + */ +#ifndef LWIP_PLATFORM_ASSERT +#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ + x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) +#include +#include +#endif + +/** Define this to 1 in arch/cc.h of your port if you do not want to + * include stddef.h header to get size_t. You need to typedef size_t + * by yourself in this case. + */ +#ifndef LWIP_NO_STDDEF_H +#define LWIP_NO_STDDEF_H 0 +#endif + +#if !LWIP_NO_STDDEF_H +#include /* for size_t */ +#endif + +/** Define this to 1 in arch/cc.h of your port if your compiler does not provide + * the stdint.h header. You need to typedef the generic types listed in + * lwip/arch.h yourself in this case (u8_t, u16_t...). + */ +#ifndef LWIP_NO_STDINT_H +#define LWIP_NO_STDINT_H 0 +#endif + +/* Define generic types used in lwIP */ +#if !LWIP_NO_STDINT_H +#include +typedef uint8_t u8_t; +typedef int8_t s8_t; +typedef uint16_t u16_t; +typedef int16_t s16_t; +typedef uint32_t u32_t; +typedef int32_t s32_t; +typedef uintptr_t mem_ptr_t; +#endif + +/** Define this to 1 in arch/cc.h of your port if your compiler does not provide + * the inttypes.h header. You need to define the format strings listed in + * lwip/arch.h yourself in this case (X8_F, U16_F...). + */ +#ifndef LWIP_NO_INTTYPES_H +#define LWIP_NO_INTTYPES_H 0 +#endif + +/* Define (sn)printf formatters for these lwIP types */ +#if !LWIP_NO_INTTYPES_H +#include +#ifndef X8_F +#define X8_F "02" PRIx8 +#endif +#ifndef U16_F +#define U16_F PRIu16 +#endif +#ifndef S16_F +#define S16_F PRId16 +#endif +#ifndef X16_F +#define X16_F PRIx16 +#endif +#ifndef U32_F +#define U32_F PRIu32 +#endif +#ifndef S32_F +#define S32_F PRId32 +#endif +#ifndef X32_F +#define X32_F PRIx32 +#endif +#ifndef SZT_F +#define SZT_F PRIuPTR +#endif +#endif + +/** Define this to 1 in arch/cc.h of your port if your compiler does not provide + * the limits.h header. You need to define the type limits yourself in this case + * (e.g. INT_MAX). + */ +#ifndef LWIP_NO_LIMITS_H +#define LWIP_NO_LIMITS_H 0 +#endif + +/* Include limits.h? */ +#if !LWIP_NO_LIMITS_H +#include +#endif + +/** C++ const_cast(val) equivalent to remove constness from a value (GCC -Wcast-qual) */ +#ifndef LWIP_CONST_CAST +#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val)) +#endif + +/** Get rid of alignment cast warnings (GCC -Wcast-align) */ +#ifndef LWIP_ALIGNMENT_CAST +#define LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) +#endif + +/** Get rid of warnings related to pointer-to-numeric and vice-versa casts, + * e.g. "conversion from 'u8_t' to 'void *' of greater size" + */ +#ifndef LWIP_PTR_NUMERIC_CAST +#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) +#endif + +/** Allocates a memory buffer of specified size that is of sufficient size to align + * its start address using LWIP_MEM_ALIGN. + * You can declare your own version here e.g. to enforce alignment without adding + * trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement + * requirements.\n + * e.g. if you use gcc and need 32 bit alignment:\n + * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] \_\_attribute\_\_((aligned(4)))\n + * or more portable:\n + * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)] + */ +#ifndef LWIP_DECLARE_MEMORY_ALIGNED +#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] +#endif + +/** Calculate memory size for an aligned buffer - returns the next highest + * multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and + * LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4). + */ +#ifndef LWIP_MEM_ALIGN_SIZE +#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) +#endif + +/** Calculate safe memory size for an aligned buffer when using an unaligned + * type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the + * start (e.g. if buffer is u8_t[] and actual data will be u32_t*) + */ +#ifndef LWIP_MEM_ALIGN_BUFFER +#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U)) +#endif + +/** Align a memory pointer to the alignment defined by MEM_ALIGNMENT + * so that ADDR % MEM_ALIGNMENT == 0 + */ +#ifndef LWIP_MEM_ALIGN +#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** Packed structs support. + * Placed BEFORE declaration of a packed struct.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_BEGIN +#define PACK_STRUCT_BEGIN +#endif /* PACK_STRUCT_BEGIN */ + +/** Packed structs support. + * Placed AFTER declaration of a packed struct.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_END +#define PACK_STRUCT_END +#endif /* PACK_STRUCT_END */ + +/** Packed structs support. + * Placed between end of declaration of a packed struct and trailing semicolon.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_STRUCT +#if defined(__GNUC__) || defined(__clang__) +#define PACK_STRUCT_STRUCT __attribute__((packed)) +#else +#define PACK_STRUCT_STRUCT +#endif +#endif /* PACK_STRUCT_STRUCT */ + +/** Packed structs support. + * Wraps u32_t and u16_t members.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_FIELD +#define PACK_STRUCT_FIELD(x) x +#endif /* PACK_STRUCT_FIELD */ + +/** Packed structs support. + * Wraps u8_t members, where some compilers warn that packing is not necessary.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_FLD_8 +#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) +#endif /* PACK_STRUCT_FLD_8 */ + +/** Packed structs support. + * Wraps members that are packed structs themselves, where some compilers warn that packing is not necessary.\n + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifndef PACK_STRUCT_FLD_S +#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) +#endif /* PACK_STRUCT_FLD_S */ + +/** Packed structs support using \#include files before and after struct to be packed.\n + * The file included BEFORE the struct is "arch/bpstruct.h".\n + * The file included AFTER the struct is "arch/epstruct.h".\n + * This can be used to implement struct packing on MS Visual C compilers, see + * the Win32 port in the lwIP contrib repository for reference. + * For examples of packed struct declarations, see include/lwip/prot/ subfolder.\n + * A port to GCC/clang is included in lwIP, if you use these compilers there is nothing to do here. + */ +#ifdef __DOXYGEN__ +#define PACK_STRUCT_USE_INCLUDES +#endif + +/** Eliminates compiler warning about unused arguments (GCC -Wextra -Wunused). */ +#ifndef LWIP_UNUSED_ARG +#define LWIP_UNUSED_ARG(x) (void)x +#endif /* LWIP_UNUSED_ARG */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_ARCH_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/autoip.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/autoip.h new file mode 100644 index 0000000..1d85bcc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/autoip.h @@ -0,0 +1,99 @@ +/** + * @file + * + * AutoIP Automatic LinkLocal IP Configuration + */ + +/* + * + * Copyright (c) 2007 Dominik Spies + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dominik Spies + * + * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform + * with RFC 3927. + * + */ + +#ifndef LWIP_HDR_AUTOIP_H +#define LWIP_HDR_AUTOIP_H + +#include "lwip/opt.h" + +#if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/netif.h" +/* #include "lwip/udp.h" */ +#include "lwip/etharp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** AutoIP Timing */ +#define AUTOIP_TMR_INTERVAL 100 +#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) + +/** AutoIP state information per netif */ +struct autoip +{ + /** the currently selected, probed, announced or used LL IP-Address */ + ip4_addr_t llipaddr; + /** current AutoIP state machine state */ + u8_t state; + /** sent number of probes or announces, dependent on state */ + u8_t sent_num; + /** ticks to wait, tick is AUTOIP_TMR_INTERVAL long */ + u16_t ttw; + /** ticks until a conflict can be solved by defending */ + u8_t lastconflict; + /** total number of probed/used Link Local IP-Addresses */ + u8_t tried_llipaddr; +}; + + +void autoip_set_struct(struct netif *netif, struct autoip *autoip); +/** Remove a struct autoip previously set to the netif using autoip_set_struct() */ +#define autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0) +err_t autoip_start(struct netif *netif); +err_t autoip_stop(struct netif *netif); +void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr); +void autoip_tmr(void); +void autoip_network_changed(struct netif *netif); +u8_t autoip_supplied_address(const struct netif *netif); + +/* for lwIP internal use by ip4.c */ +u8_t autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr); + +#define netif_autoip_data(netif) ((struct autoip*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV4 && LWIP_AUTOIP */ + +#endif /* LWIP_HDR_AUTOIP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/debug.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/debug.h new file mode 100644 index 0000000..a142f1c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/debug.h @@ -0,0 +1,167 @@ +/** + * @file + * Debug messages infrastructure + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_DEBUG_H +#define LWIP_HDR_DEBUG_H + +#include "lwip/arch.h" +#include "lwip/opt.h" + +/** + * @defgroup debugging_levels LWIP_DBG_MIN_LEVEL and LWIP_DBG_TYPES_ON values + * @ingroup lwip_opts_debugmsg + * @{ + */ + +/** @name Debug level (LWIP_DBG_MIN_LEVEL) + * @{ + */ +/** Debug level: ALL messages*/ +#define LWIP_DBG_LEVEL_ALL 0x00 +/** Debug level: Warnings. bad checksums, dropped packets, ... */ +#define LWIP_DBG_LEVEL_WARNING 0x01 +/** Debug level: Serious. memory allocation failures, ... */ +#define LWIP_DBG_LEVEL_SERIOUS 0x02 +/** Debug level: Severe */ +#define LWIP_DBG_LEVEL_SEVERE 0x03 +/** + * @} + */ + +#define LWIP_DBG_MASK_LEVEL 0x03 +/* compatibility define only */ +#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL + +/** @name Enable/disable debug messages completely (LWIP_DBG_TYPES_ON) + * @{ + */ +/** flag for LWIP_DEBUGF to enable that debug message */ +#define LWIP_DBG_ON 0x80U +/** flag for LWIP_DEBUGF to disable that debug message */ +#define LWIP_DBG_OFF 0x00U +/** + * @} + */ + +/** @name Debug message types (LWIP_DBG_TYPES_ON) + * @{ + */ +/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ +#define LWIP_DBG_TRACE 0x40U +/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ +#define LWIP_DBG_STATE 0x20U +/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ +#define LWIP_DBG_FRESH 0x10U +/** flag for LWIP_DEBUGF to halt after printing this debug message */ +#define LWIP_DBG_HALT 0x08U +/** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup lwip_assertions Assertion handling + * @ingroup lwip_opts_debug + * @{ + */ +/** + * LWIP_NOASSERT: Disable LWIP_ASSERT checks: + * To disable assertions define LWIP_NOASSERT in arch/cc.h. + */ +#ifdef __DOXYGEN__ +#define LWIP_NOASSERT +#undef LWIP_NOASSERT +#endif +/** + * @} + */ + +#ifndef LWIP_NOASSERT +#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \ + LWIP_PLATFORM_ASSERT(message); }} while(0) +#ifndef LWIP_PLATFORM_ASSERT +#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT(message) needs to be defined in your arch/cc.h" +#endif +#else /* LWIP_NOASSERT */ +#define LWIP_ASSERT(message, assertion) +#endif /* LWIP_NOASSERT */ + +#ifndef LWIP_ERROR +#ifndef LWIP_NOASSERT +#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message) +#elif defined LWIP_DEBUG +#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_DIAG((message)) +#else +#define LWIP_PLATFORM_ERROR(message) +#endif + +/* if "expression" isn't true, then print "message" and execute "handler" expression */ +#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ + LWIP_PLATFORM_ERROR(message); handler;}} while(0) +#endif /* LWIP_ERROR */ + +/** Enable debug message printing, but only if debug message type is enabled + * AND is of correct type AND is at least LWIP_DBG_LEVEL. + */ +#ifdef __DOXYGEN__ +#define LWIP_DEBUG +#undef LWIP_DEBUG +#endif + +#ifdef LWIP_DEBUG +#ifndef LWIP_PLATFORM_DIAG +#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG(message) needs to be defined in your arch/cc.h" +#endif +#define LWIP_DEBUGF(debug, message) do { \ + if ( \ + ((debug) & LWIP_DBG_ON) && \ + ((debug) & LWIP_DBG_TYPES_ON) && \ + ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ + LWIP_PLATFORM_DIAG(message); \ + if ((debug) & LWIP_DBG_HALT) { \ + while(1); \ + } \ + } \ + } while(0) + +#else /* LWIP_DEBUG */ +#define LWIP_DEBUGF(debug, message) +#endif /* LWIP_DEBUG */ + +#endif /* LWIP_HDR_DEBUG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/def.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/def.h new file mode 100644 index 0000000..aaa64c7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/def.h @@ -0,0 +1,142 @@ +/** + * @file + * various utility macros + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_DEF_H +#define LWIP_HDR_DEF_H + +/* arch.h might define NULL already */ +#include "lwip/arch.h" +#include "lwip/opt.h" +#if LWIP_PERF +#include "arch/perf.h" +#else /* LWIP_PERF */ +#define PERF_START /* null definition */ +#define PERF_STOP(x) /* null definition */ +#endif /* LWIP_PERF */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) +#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) + +/* Get the number of entries in an array ('x' must NOT be a pointer!) */ +#define LWIP_ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0])) + +/** Create u32_t value from bytes */ +#define LWIP_MAKEU32(a,b,c,d) (((u32_t)((a) & 0xff) << 24) | \ + ((u32_t)((b) & 0xff) << 16) | \ + ((u32_t)((c) & 0xff) << 8) | \ + (u32_t)((d) & 0xff)) + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +#if BYTE_ORDER == BIG_ENDIAN +#define lwip_htons(x) (x) +#define lwip_ntohs(x) (x) +#define lwip_htonl(x) (x) +#define lwip_ntohl(x) (x) +#define PP_HTONS(x) (x) +#define PP_NTOHS(x) (x) +#define PP_HTONL(x) (x) +#define PP_NTOHL(x) (x) +#else /* BYTE_ORDER != BIG_ENDIAN */ +#ifndef lwip_htons +u16_t lwip_htons(u16_t x); +#endif +#define lwip_ntohs(x) lwip_htons(x) + +#ifndef lwip_htonl +u32_t lwip_htonl(u32_t x); +#endif +#define lwip_ntohl(x) lwip_htonl(x) + +/* Provide usual function names as macros for users, but this can be turned off */ +#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS +#define htons(x) lwip_htons(x) +#define ntohs(x) lwip_ntohs(x) +#define htonl(x) lwip_htonl(x) +#define ntohl(x) lwip_ntohl(x) +#endif + +/* These macros should be calculated by the preprocessor and are used + with compile-time constants only (so that there is no little-endian + overhead at runtime). */ +#define PP_HTONS(x) ((((x) & 0x00ffUL) << 8) | (((x) & 0xff00UL) >> 8)) +#define PP_NTOHS(x) PP_HTONS(x) +#define PP_HTONL(x) ((((x) & 0x000000ffUL) << 24) | \ + (((x) & 0x0000ff00UL) << 8) | \ + (((x) & 0x00ff0000UL) >> 8) | \ + (((x) & 0xff000000UL) >> 24)) +#define PP_NTOHL(x) PP_HTONL(x) + +#endif /* BYTE_ORDER == BIG_ENDIAN */ + +/* Functions that are not available as standard implementations. + * In cc.h, you can #define these to implementations available on + * your platform to save some code bytes if you use these functions + * in your application, too. + */ + +#ifndef lwip_itoa +/* This can be #defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform */ +void lwip_itoa(char* result, size_t bufsize, int number); +#endif +#ifndef lwip_strnicmp +/* This can be #defined to strnicmp() or strncasecmp() depending on your platform */ +int lwip_strnicmp(const char* str1, const char* str2, size_t len); +#endif +#ifndef lwip_stricmp +/* This can be #defined to stricmp() or strcasecmp() depending on your platform */ +int lwip_stricmp(const char* str1, const char* str2); +#endif +#ifndef lwip_strnstr +/* This can be #defined to strnstr() depending on your platform */ +char* lwip_strnstr(const char* buffer, const char* token, size_t n); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_DEF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp.h new file mode 100644 index 0000000..ac1b18e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp.h @@ -0,0 +1,143 @@ +/** + * @file + * DHCP client API + */ + +/* + * Copyright (c) 2001-2004 Leon Woestenberg + * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Leon Woestenberg + * + */ +#ifndef LWIP_HDR_DHCP_H +#define LWIP_HDR_DHCP_H + +#include "lwip/opt.h" + +#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/netif.h" +#include "lwip/udp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** period (in seconds) of the application calling dhcp_coarse_tmr() */ +#define DHCP_COARSE_TIMER_SECS 60 +/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ +#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) +/** period (in milliseconds) of the application calling dhcp_fine_tmr() */ +#define DHCP_FINE_TIMER_MSECS 500 + +#define DHCP_BOOT_FILE_LEN 128U + +/* AutoIP cooperation flags (struct dhcp.autoip_coop_state) */ +typedef enum { + DHCP_AUTOIP_COOP_STATE_OFF = 0, + DHCP_AUTOIP_COOP_STATE_ON = 1 +} dhcp_autoip_coop_state_enum_t; + +struct dhcp +{ + /** transaction identifier of last sent request */ + u32_t xid; + /** incoming msg */ + struct dhcp_msg *msg_in; + /** track PCB allocation state */ + u8_t pcb_allocated; + /** current DHCP state machine state */ + u8_t state; + /** retries of current request */ + u8_t tries; +#if LWIP_DHCP_AUTOIP_COOP + u8_t autoip_coop_state; +#endif + u8_t subnet_mask_given; + + struct pbuf *p_out; /* pbuf of outcoming msg */ + struct dhcp_msg *msg_out; /* outgoing msg */ + u16_t options_out_len; /* outgoing msg options length */ + u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */ + u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ + u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ + u16_t t1_renew_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next renew try */ + u16_t t2_rebind_time; /* #ticks with period DHCP_COARSE_TIMER_SECS until next rebind try */ + u16_t lease_used; /* #ticks with period DHCP_COARSE_TIMER_SECS since last received DHCP ack */ + u16_t t0_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for lease time */ + ip_addr_t server_ip_addr; /* dhcp server address that offered this lease (ip_addr_t because passed to UDP) */ + ip4_addr_t offered_ip_addr; + ip4_addr_t offered_sn_mask; + ip4_addr_t offered_gw_addr; + + u32_t offered_t0_lease; /* lease period (in seconds) */ + u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ + u32_t offered_t2_rebind; /* recommended rebind time (usually 87.5 of lease period) */ +#if LWIP_DHCP_BOOTP_FILE + ip4_addr_t offered_si_addr; + char boot_file_name[DHCP_BOOT_FILE_LEN]; +#endif /* LWIP_DHCP_BOOTPFILE */ +}; + + +void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp); +/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */ +#define dhcp_remove_struct(netif) do { (netif)->dhcp = NULL; } while(0) +void dhcp_cleanup(struct netif *netif); +err_t dhcp_start(struct netif *netif); +err_t dhcp_renew(struct netif *netif); +err_t dhcp_release(struct netif *netif); +void dhcp_stop(struct netif *netif); +void dhcp_inform(struct netif *netif); +void dhcp_network_changed(struct netif *netif); +#if DHCP_DOES_ARP_CHECK +void dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr); +#endif +u8_t dhcp_supplied_address(const struct netif *netif); +/* to be called every minute */ +void dhcp_coarse_tmr(void); +/* to be called every half second */ +void dhcp_fine_tmr(void); + +#if LWIP_DHCP_GET_NTP_SRV +/** This function must exist, in other to add offered NTP servers to + * the NTP (or SNTP) engine. + * See LWIP_DHCP_MAX_NTP_SERVERS */ +extern void dhcp_set_ntp_servers(u8_t num_ntp_servers, const ip4_addr_t* ntp_server_addrs); +#endif /* LWIP_DHCP_GET_NTP_SRV */ + +#define netif_dhcp_data(netif) ((struct dhcp*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_DHCP */ + +#endif /*LWIP_HDR_DHCP_H*/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp6.h new file mode 100644 index 0000000..455336d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dhcp6.h @@ -0,0 +1,58 @@ +/** + * @file + * + * IPv6 address autoconfiguration as per RFC 4862. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * IPv6 address autoconfiguration as per RFC 4862. + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_IP6_DHCP6_H +#define LWIP_HDR_IP6_DHCP6_H + +#include "lwip/opt.h" + +#if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ + + +struct dhcp6 +{ + /*@todo: implement DHCP6*/ +}; + +#endif /* LWIP_IPV6_DHCP6 */ + +#endif /* LWIP_HDR_IP6_DHCP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dns.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dns.h new file mode 100644 index 0000000..1453d72 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/dns.h @@ -0,0 +1,130 @@ +/** + * @file + * DNS API + */ + +/** + * lwip DNS resolver header file. + + * Author: Jim Pettinato + * April 2007 + + * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. + * + * 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. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LWIP_HDR_DNS_H +#define LWIP_HDR_DNS_H + +#include "lwip/opt.h" + +#if LWIP_DNS + +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** DNS timer period */ +#define DNS_TMR_INTERVAL 1000 + +/* DNS resolve types: */ +#define LWIP_DNS_ADDRTYPE_IPV4 0 +#define LWIP_DNS_ADDRTYPE_IPV6 1 +#define LWIP_DNS_ADDRTYPE_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */ +#define LWIP_DNS_ADDRTYPE_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */ +#if LWIP_IPV4 && LWIP_IPV6 +#ifndef LWIP_DNS_ADDRTYPE_DEFAULT +#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4_IPV6 +#endif +#elif LWIP_IPV4 +#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4 +#else +#define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV6 +#endif + +#if DNS_LOCAL_HOSTLIST +/** struct used for local host-list */ +struct local_hostlist_entry { + /** static hostname */ + const char *name; + /** static host address in network byteorder */ + ip_addr_t addr; + struct local_hostlist_entry *next; +}; +#define DNS_LOCAL_HOSTLIST_ELEM(name, addr_init) {name, addr_init, NULL} +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC +#ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN +#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH +#endif +#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1)) +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ +#endif /* DNS_LOCAL_HOSTLIST */ + +#if LWIP_IPV4 +extern const ip_addr_t dns_mquery_v4group; +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 +extern const ip_addr_t dns_mquery_v6group; +#endif /* LWIP_IPV6 */ + +/** Callback which is invoked when a hostname is found. + * A function of this type must be implemented by the application using the DNS resolver. + * @param name pointer to the name that was looked up. + * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname, + * or NULL if the name could not be found (or on any other error). + * @param callback_arg a user-specified callback argument passed to dns_gethostbyname +*/ +typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg); + +void dns_init(void); +void dns_tmr(void); +void dns_setserver(u8_t numdns, const ip_addr_t *dnsserver); +const ip_addr_t* dns_getserver(u8_t numdns); +err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, + dns_found_callback found, void *callback_arg); +err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr, + dns_found_callback found, void *callback_arg, + u8_t dns_addrtype); + + +#if DNS_LOCAL_HOSTLIST +size_t dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg); +err_t dns_local_lookup(const char *hostname, ip_addr_t *addr, u8_t dns_addrtype); +#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC +int dns_local_removehost(const char *hostname, const ip_addr_t *addr); +err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr); +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ +#endif /* DNS_LOCAL_HOSTLIST */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_DNS */ + +#endif /* LWIP_HDR_DNS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/err.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/err.h new file mode 100644 index 0000000..84e528d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/err.h @@ -0,0 +1,119 @@ +/** + * @file + * lwIP Error codes + */ +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_ERR_H +#define LWIP_HDR_ERR_H + +#include "lwip/opt.h" +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup infrastructure_errors Error codes + * @ingroup infrastructure + * @{ + */ + +/** Define LWIP_ERR_T in cc.h if you want to use + * a different type for your platform (must be signed). */ +#ifdef LWIP_ERR_T +typedef LWIP_ERR_T err_t; +#else /* LWIP_ERR_T */ +typedef s8_t err_t; +#endif /* LWIP_ERR_T*/ + +/** Definitions for error constants. */ +typedef enum { +/** No error, everything OK. */ + ERR_OK = 0, +/** Out of memory error. */ + ERR_MEM = -1, +/** Buffer error. */ + ERR_BUF = -2, +/** Timeout. */ + ERR_TIMEOUT = -3, +/** Routing problem. */ + ERR_RTE = -4, +/** Operation in progress */ + ERR_INPROGRESS = -5, +/** Illegal value. */ + ERR_VAL = -6, +/** Operation would block. */ + ERR_WOULDBLOCK = -7, +/** Address in use. */ + ERR_USE = -8, +/** Already connecting. */ + ERR_ALREADY = -9, +/** Conn already established.*/ + ERR_ISCONN = -10, +/** Not connected. */ + ERR_CONN = -11, +/** Low-level netif error */ + ERR_IF = -12, + +/** Connection aborted. */ + ERR_ABRT = -13, +/** Connection reset. */ + ERR_RST = -14, +/** Connection closed. */ + ERR_CLSD = -15, +/** Illegal argument. */ + ERR_ARG = -16 +} err_enum_t; + +#define ERR_IS_FATAL(e) ((e) <= ERR_ABRT) + +/** + * @} + */ + +#ifdef LWIP_DEBUG +extern const char *lwip_strerr(err_t err); +#else +#define lwip_strerr(x) "" +#endif /* LWIP_DEBUG */ + +#if !NO_SYS +int err_to_errno(err_t err); +#endif /* !NO_SYS */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_ERR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/errno.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/errno.h new file mode 100644 index 0000000..641cffb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/errno.h @@ -0,0 +1,193 @@ +/** + * @file + * Posix Errno defines + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_ERRNO_H +#define LWIP_HDR_ERRNO_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LWIP_PROVIDE_ERRNO + +#define EPERM 1 /* Operation not permitted */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Try again */ +#define ENOMEM 12 /* Out of memory */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Device or resource busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* File table overflow */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Math argument out of domain of func */ +#define ERANGE 34 /* Math result not representable */ +#define EDEADLK 35 /* Resource deadlock would occur */ +#define ENAMETOOLONG 36 /* File name too long */ +#define ENOLCK 37 /* No record locks available */ +#define ENOSYS 38 /* Function not implemented */ +#define ENOTEMPTY 39 /* Directory not empty */ +#define ELOOP 40 /* Too many symbolic links encountered */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ +#define ENOMSG 42 /* No message of desired type */ +#define EIDRM 43 /* Identifier removed */ +#define ECHRNG 44 /* Channel number out of range */ +#define EL2NSYNC 45 /* Level 2 not synchronized */ +#define EL3HLT 46 /* Level 3 halted */ +#define EL3RST 47 /* Level 3 reset */ +#define ELNRNG 48 /* Link number out of range */ +#define EUNATCH 49 /* Protocol driver not attached */ +#define ENOCSI 50 /* No CSI structure available */ +#define EL2HLT 51 /* Level 2 halted */ +#define EBADE 52 /* Invalid exchange */ +#define EBADR 53 /* Invalid request descriptor */ +#define EXFULL 54 /* Exchange full */ +#define ENOANO 55 /* No anode */ +#define EBADRQC 56 /* Invalid request code */ +#define EBADSLT 57 /* Invalid slot */ + +#define EDEADLOCK EDEADLK + +#define EBFONT 59 /* Bad font file format */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data available */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* Object is remote */ +#define ENOLINK 67 /* Link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 72 /* Multihop attempted */ +#define EDOTDOT 73 /* RFS specific error */ +#define EBADMSG 74 /* Not a data message */ +#define EOVERFLOW 75 /* Value too large for defined data type */ +#define ENOTUNIQ 76 /* Name not unique on network */ +#define EBADFD 77 /* File descriptor in bad state */ +#define EREMCHG 78 /* Remote address changed */ +#define ELIBACC 79 /* Can not access a needed shared library */ +#define ELIBBAD 80 /* Accessing a corrupted shared library */ +#define ELIBSCN 81 /* .lib section in a.out corrupted */ +#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ +#define ELIBEXEC 83 /* Cannot exec a shared library directly */ +#define EILSEQ 84 /* Illegal byte sequence */ +#define ERESTART 85 /* Interrupted system call should be restarted */ +#define ESTRPIPE 86 /* Streams pipe error */ +#define EUSERS 87 /* Too many users */ +#define ENOTSOCK 88 /* Socket operation on non-socket */ +#define EDESTADDRREQ 89 /* Destination address required */ +#define EMSGSIZE 90 /* Message too long */ +#define EPROTOTYPE 91 /* Protocol wrong type for socket */ +#define ENOPROTOOPT 92 /* Protocol not available */ +#define EPROTONOSUPPORT 93 /* Protocol not supported */ +#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ +#define EADDRINUSE 98 /* Address already in use */ +#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ +#define ENETDOWN 100 /* Network is down */ +#define ENETUNREACH 101 /* Network is unreachable */ +#define ENETRESET 102 /* Network dropped connection because of reset */ +#define ECONNABORTED 103 /* Software caused connection abort */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EISCONN 106 /* Transport endpoint is already connected */ +#define ENOTCONN 107 /* Transport endpoint is not connected */ +#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ +#define ETOOMANYREFS 109 /* Too many references: cannot splice */ +#define ETIMEDOUT 110 /* Connection timed out */ +#define ECONNREFUSED 111 /* Connection refused */ +#define EHOSTDOWN 112 /* Host is down */ +#define EHOSTUNREACH 113 /* No route to host */ +#define EALREADY 114 /* Operation already in progress */ +#define EINPROGRESS 115 /* Operation now in progress */ +#define ESTALE 116 /* Stale NFS file handle */ +#define EUCLEAN 117 /* Structure needs cleaning */ +#define ENOTNAM 118 /* Not a XENIX named type file */ +#define ENAVAIL 119 /* No XENIX semaphores available */ +#define EISNAM 120 /* Is a named type file */ +#define EREMOTEIO 121 /* Remote I/O error */ +#define EDQUOT 122 /* Quota exceeded */ + +#define ENOMEDIUM 123 /* No medium found */ +#define EMEDIUMTYPE 124 /* Wrong medium type */ + +#ifndef errno +extern int errno; +#endif + +#else /* LWIP_PROVIDE_ERRNO */ + +/* Define LWIP_ERRNO_INCLUDE to to include the error defines here */ +#ifdef LWIP_ERRNO_INCLUDE +#include LWIP_ERRNO_INCLUDE +#endif /* LWIP_ERRNO_INCLUDE */ + +#endif /* LWIP_PROVIDE_ERRNO */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_ERRNO_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/etharp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/etharp.h new file mode 100644 index 0000000..7080a19 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/etharp.h @@ -0,0 +1,106 @@ +/** + * @file + * Ethernet output function - handles OUTGOING ethernet level traffic, implements + * ARP resolving. + * To be used in most low-level netif implementations + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2003-2004 Leon Woestenberg + * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#ifndef LWIP_HDR_NETIF_ETHARP_H +#define LWIP_HDR_NETIF_ETHARP_H + +#include "lwip/opt.h" + +#if LWIP_ARP || LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/ip4_addr.h" +#include "lwip/netif.h" +#include "lwip/ip4.h" +#include "lwip/prot/ethernet.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/prot/etharp.h" + +/** 1 seconds period */ +#define ARP_TMR_INTERVAL 1000 + +#if ARP_QUEUEING +/** struct for queueing outgoing packets for unknown address + * defined here to be accessed by memp.h + */ +struct etharp_q_entry { + struct etharp_q_entry *next; + struct pbuf *p; +}; +#endif /* ARP_QUEUEING */ + +#define etharp_init() /* Compatibility define, no init needed. */ +void etharp_tmr(void); +s8_t etharp_find_addr(struct netif *netif, const ip4_addr_t *ipaddr, + struct eth_addr **eth_ret, const ip4_addr_t **ip_ret); +u8_t etharp_get_entry(u8_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret); +err_t etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr); +err_t etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q); +err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr); +/** For Ethernet network interfaces, we might want to send "gratuitous ARP"; + * this is an ARP packet sent by a node in order to spontaneously cause other + * nodes to update an entry in their ARP cache. + * From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */ +#define etharp_gratuitous(netif) etharp_request((netif), netif_ip4_addr(netif)) +void etharp_cleanup_netif(struct netif *netif); + +#if ETHARP_SUPPORT_STATIC_ENTRIES +err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr); +err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr); +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + +#endif /* LWIP_IPV4 && LWIP_ARP */ + +void etharp_input(struct pbuf *p, struct netif *netif); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_ARP || LWIP_ETHERNET */ + +#endif /* LWIP_HDR_NETIF_ETHARP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ethip6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ethip6.h new file mode 100644 index 0000000..5e88dff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ethip6.h @@ -0,0 +1,68 @@ +/** + * @file + * + * Ethernet output for IPv6. Uses ND tables for link-layer addressing. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_ETHIP6_H +#define LWIP_HDR_ETHIP6_H + +#include "lwip/opt.h" + +#if LWIP_IPV6 && LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 && LWIP_ETHERNET */ + +#endif /* LWIP_HDR_ETHIP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp.h new file mode 100644 index 0000000..f5a31fd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp.h @@ -0,0 +1,110 @@ +/** + * @file + * ICMP API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_ICMP_H +#define LWIP_HDR_ICMP_H + +#include "lwip/opt.h" +#include "lwip/pbuf.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/prot/icmp.h" + +#if LWIP_IPV6 && LWIP_ICMP6 +#include "lwip/icmp6.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** ICMP destination unreachable codes */ +enum icmp_dur_type { + /** net unreachable */ + ICMP_DUR_NET = 0, + /** host unreachable */ + ICMP_DUR_HOST = 1, + /** protocol unreachable */ + ICMP_DUR_PROTO = 2, + /** port unreachable */ + ICMP_DUR_PORT = 3, + /** fragmentation needed and DF set */ + ICMP_DUR_FRAG = 4, + /** source route failed */ + ICMP_DUR_SR = 5 +}; + +/** ICMP time exceeded codes */ +enum icmp_te_type { + /** time to live exceeded in transit */ + ICMP_TE_TTL = 0, + /** fragment reassembly time exceeded */ + ICMP_TE_FRAG = 1 +}; + +#if LWIP_IPV4 && LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ + +void icmp_input(struct pbuf *p, struct netif *inp); +void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t); +void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t); + +#endif /* LWIP_IPV4 && LWIP_ICMP */ + +#if LWIP_IPV4 && LWIP_IPV6 +#if LWIP_ICMP && LWIP_ICMP6 +#define icmp_port_unreach(isipv6, pbuf) ((isipv6) ? \ + icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) : \ + icmp_dest_unreach(pbuf, ICMP_DUR_PORT)) +#elif LWIP_ICMP +#define icmp_port_unreach(isipv6, pbuf) do{ if(!(isipv6)) { icmp_dest_unreach(pbuf, ICMP_DUR_PORT);}}while(0) +#elif LWIP_ICMP6 +#define icmp_port_unreach(isipv6, pbuf) do{ if(isipv6) { icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT);}}while(0) +#else +#define icmp_port_unreach(isipv6, pbuf) +#endif +#elif LWIP_IPV6 && LWIP_ICMP6 +#define icmp_port_unreach(isipv6, pbuf) icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) +#elif LWIP_IPV4 && LWIP_ICMP +#define icmp_port_unreach(isipv6, pbuf) icmp_dest_unreach(pbuf, ICMP_DUR_PORT) +#else /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) */ +#define icmp_port_unreach(isipv6, pbuf) +#endif /* (LWIP_IPV6 && LWIP_ICMP6) || (LWIP_IPV4 && LWIP_ICMP) LWIP_IPV4*/ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_ICMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp6.h new file mode 100644 index 0000000..a29dc8c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/icmp6.h @@ -0,0 +1,70 @@ +/** + * @file + * + * IPv6 version of ICMP, as per RFC 4443. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ +#ifndef LWIP_HDR_ICMP6_H +#define LWIP_HDR_ICMP6_H + +#include "lwip/opt.h" +#include "lwip/pbuf.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" +#include "lwip/prot/icmp6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_ICMP6 && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +void icmp6_input(struct pbuf *p, struct netif *inp); +void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c); +void icmp6_packet_too_big(struct pbuf *p, u32_t mtu); +void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c); +void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, u32_t pointer); + +#endif /* LWIP_ICMP6 && LWIP_IPV6 */ + + +#ifdef __cplusplus +} +#endif + + +#endif /* LWIP_HDR_ICMP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/igmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/igmp.h new file mode 100644 index 0000000..ffd80e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/igmp.h @@ -0,0 +1,115 @@ +/** + * @file + * IGMP API + */ + +/* + * Copyright (c) 2002 CITEL Technologies Ltd. + * 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 CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is a contribution to the lwIP TCP/IP stack. + * The Swedish Institute of Computer Science and Adam Dunkels + * are specifically granted permission to redistribute this + * source code. +*/ + +#ifndef LWIP_HDR_IGMP_H +#define LWIP_HDR_IGMP_H + +#include "lwip/opt.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/pbuf.h" + +#if LWIP_IPV4 && LWIP_IGMP /* don't build if not configured for use in lwipopts.h */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* IGMP timer */ +#define IGMP_TMR_INTERVAL 100 /* Milliseconds */ +#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL) +#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL) + +/* Compatibility defines (don't use for new code) */ +#define IGMP_DEL_MAC_FILTER NETIF_DEL_MAC_FILTER +#define IGMP_ADD_MAC_FILTER NETIF_ADD_MAC_FILTER + +/** + * igmp group structure - there is + * a list of groups for each interface + * these should really be linked from the interface, but + * if we keep them separate we will not affect the lwip original code + * too much + * + * There will be a group for the all systems group address but this + * will not run the state machine as it is used to kick off reports + * from all the other groups + */ +struct igmp_group { + /** next link */ + struct igmp_group *next; + /** multicast address */ + ip4_addr_t group_address; + /** signifies we were the last person to report */ + u8_t last_reporter_flag; + /** current state of the group */ + u8_t group_state; + /** timer for reporting, negative is OFF */ + u16_t timer; + /** counter of simultaneous uses */ + u8_t use; +}; + +/* Prototypes */ +void igmp_init(void); +err_t igmp_start(struct netif *netif); +err_t igmp_stop(struct netif *netif); +void igmp_report_groups(struct netif *netif); +struct igmp_group *igmp_lookfor_group(struct netif *ifp, const ip4_addr_t *addr); +void igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest); +err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); +err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); +err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); +err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); +void igmp_tmr(void); + +/** @ingroup igmp + * Get list head of IGMP groups for netif. + * Note: The allsystems group IP is contained in the list as first entry. + * @see @ref netif_set_igmp_mac_filter() + */ +#define netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV4 && LWIP_IGMP */ + +#endif /* LWIP_HDR_IGMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet.h new file mode 100644 index 0000000..4a34f02 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet.h @@ -0,0 +1,172 @@ +/** + * @file + * This file (together with sockets.h) aims to provide structs and functions from + * - arpa/inet.h + * - netinet/in.h + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_INET_H +#define LWIP_HDR_INET_H + +#include "lwip/opt.h" +#include "lwip/def.h" +#include "lwip/ip_addr.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* If your port already typedef's in_addr_t, define IN_ADDR_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(in_addr_t) && !defined(IN_ADDR_T_DEFINED) +typedef u32_t in_addr_t; +#endif + +struct in_addr { + in_addr_t s_addr; +}; + +struct in6_addr { + union { + u32_t u32_addr[4]; + u8_t u8_addr[16]; + } un; +#define s6_addr un.u8_addr +}; + +/** 255.255.255.255 */ +#define INADDR_NONE IPADDR_NONE +/** 127.0.0.1 */ +#define INADDR_LOOPBACK IPADDR_LOOPBACK +/** 0.0.0.0 */ +#define INADDR_ANY IPADDR_ANY +/** 255.255.255.255 */ +#define INADDR_BROADCAST IPADDR_BROADCAST + +/** This macro can be used to initialize a variable of type struct in6_addr + to the IPv6 wildcard address. */ +#define IN6ADDR_ANY_INIT {{{0,0,0,0}}} +/** This macro can be used to initialize a variable of type struct in6_addr + to the IPv6 loopback address. */ +#define IN6ADDR_LOOPBACK_INIT {{{0,0,0,PP_HTONL(1)}}} +/** This variable is initialized by the system to contain the wildcard IPv6 address. */ +extern const struct in6_addr in6addr_any; + +/* Definitions of the bits in an (IPv4) Internet address integer. + + On subnets, host and network parts are found according to + the subnet mask, not these masks. */ +#define IN_CLASSA(a) IP_CLASSA(a) +#define IN_CLASSA_NET IP_CLASSA_NET +#define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT +#define IN_CLASSA_HOST IP_CLASSA_HOST +#define IN_CLASSA_MAX IP_CLASSA_MAX + +#define IN_CLASSB(b) IP_CLASSB(b) +#define IN_CLASSB_NET IP_CLASSB_NET +#define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT +#define IN_CLASSB_HOST IP_CLASSB_HOST +#define IN_CLASSB_MAX IP_CLASSB_MAX + +#define IN_CLASSC(c) IP_CLASSC(c) +#define IN_CLASSC_NET IP_CLASSC_NET +#define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT +#define IN_CLASSC_HOST IP_CLASSC_HOST +#define IN_CLASSC_MAX IP_CLASSC_MAX + +#define IN_CLASSD(d) IP_CLASSD(d) +#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */ +#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */ +#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */ +#define IN_CLASSD_MAX IP_CLASSD_MAX + +#define IN_MULTICAST(a) IP_MULTICAST(a) + +#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a) +#define IN_BADCLASS(a) IP_BADCLASS(a) + +#define IN_LOOPBACKNET IP_LOOPBACKNET + + +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN IP4ADDR_STRLEN_MAX +#endif +#if LWIP_IPV6 +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN IP6ADDR_STRLEN_MAX +#endif +#endif + +#if LWIP_IPV4 + +#define inet_addr_from_ip4addr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr)) +#define inet_addr_to_ip4addr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr)) +/* ATTENTION: the next define only works because both s_addr and ip4_addr_t are an u32_t effectively! */ +#define inet_addr_to_ip4addr_p(target_ip4addr_p, source_inaddr) ((target_ip4addr_p) = (ip4_addr_t*)&((source_inaddr)->s_addr)) + +/* directly map this to the lwip internal functions */ +#define inet_addr(cp) ipaddr_addr(cp) +#define inet_aton(cp, addr) ip4addr_aton(cp, (ip4_addr_t*)addr) +#define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr)) +#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen) + +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +#define inet6_addr_from_ip6addr(target_in6addr, source_ip6addr) {(target_in6addr)->un.u32_addr[0] = (source_ip6addr)->addr[0]; \ + (target_in6addr)->un.u32_addr[1] = (source_ip6addr)->addr[1]; \ + (target_in6addr)->un.u32_addr[2] = (source_ip6addr)->addr[2]; \ + (target_in6addr)->un.u32_addr[3] = (source_ip6addr)->addr[3];} +#define inet6_addr_to_ip6addr(target_ip6addr, source_in6addr) {(target_ip6addr)->addr[0] = (source_in6addr)->un.u32_addr[0]; \ + (target_ip6addr)->addr[1] = (source_in6addr)->un.u32_addr[1]; \ + (target_ip6addr)->addr[2] = (source_in6addr)->un.u32_addr[2]; \ + (target_ip6addr)->addr[3] = (source_in6addr)->un.u32_addr[3];} +/* ATTENTION: the next define only works because both in6_addr and ip6_addr_t are an u32_t[4] effectively! */ +#define inet6_addr_to_ip6addr_p(target_ip6addr_p, source_in6addr) ((target_ip6addr_p) = (ip6_addr_t*)(source_in6addr)) + +/* directly map this to the lwip internal functions */ +#define inet6_aton(cp, addr) ip6addr_aton(cp, (ip6_addr_t*)addr) +#define inet6_ntoa(addr) ip6addr_ntoa((const ip6_addr_t*)&(addr)) +#define inet6_ntoa_r(addr, buf, buflen) ip6addr_ntoa_r((const ip6_addr_t*)&(addr), buf, buflen) + +#endif /* LWIP_IPV6 */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_INET_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet_chksum.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet_chksum.h new file mode 100644 index 0000000..4e23d7f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/inet_chksum.h @@ -0,0 +1,105 @@ +/** + * @file + * IP checksum calculation functions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_INET_CHKSUM_H +#define LWIP_HDR_INET_CHKSUM_H + +#include "lwip/opt.h" + +#include "lwip/pbuf.h" +#include "lwip/ip_addr.h" + +/** Swap the bytes in an u16_t: much like lwip_htons() for little-endian */ +#ifndef SWAP_BYTES_IN_WORD +#define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) +#endif /* SWAP_BYTES_IN_WORD */ + +/** Split an u32_t in two u16_ts and add them up */ +#ifndef FOLD_U32T +#define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) +#endif + +#if LWIP_CHECKSUM_ON_COPY +/** Function-like macro: same as MEMCPY but returns the checksum of copied data + as u16_t */ +# ifndef LWIP_CHKSUM_COPY +# define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) +# ifndef LWIP_CHKSUM_COPY_ALGORITHM +# define LWIP_CHKSUM_COPY_ALGORITHM 1 +# endif /* LWIP_CHKSUM_COPY_ALGORITHM */ +# else /* LWIP_CHKSUM_COPY */ +# define LWIP_CHKSUM_COPY_ALGORITHM 0 +# endif /* LWIP_CHKSUM_COPY */ +#else /* LWIP_CHECKSUM_ON_COPY */ +# define LWIP_CHKSUM_COPY_ALGORITHM 0 +#endif /* LWIP_CHECKSUM_ON_COPY */ + +#ifdef __cplusplus +extern "C" { +#endif + +u16_t inet_chksum(const void *dataptr, u16_t len); +u16_t inet_chksum_pbuf(struct pbuf *p); +#if LWIP_CHKSUM_COPY_ALGORITHM +u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len); +#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ + +#if LWIP_IPV4 +u16_t inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip4_addr_t *src, const ip4_addr_t *dest); +u16_t inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto, + u16_t proto_len, u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest); +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +u16_t ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip6_addr_t *src, const ip6_addr_t *dest); +u16_t ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest); +#endif /* LWIP_IPV6 */ + + +u16_t ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, + const ip_addr_t *src, const ip_addr_t *dest); +u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, + u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_INET_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/init.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/init.h new file mode 100644 index 0000000..940fa21 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/init.h @@ -0,0 +1,100 @@ +/** + * @file + * lwIP initialization API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_INIT_H +#define LWIP_HDR_INIT_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup lwip_version Version + * @ingroup lwip + * @{ + */ + +/** X.x.x: Major version of the stack */ +#define LWIP_VERSION_MAJOR 2 +/** x.X.x: Minor version of the stack */ +#define LWIP_VERSION_MINOR 0 +/** x.x.X: Revision of the stack */ +#define LWIP_VERSION_REVISION 2 +/** For release candidates, this is set to 1..254 + * For official releases, this is set to 255 (LWIP_RC_RELEASE) + * For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */ +#define LWIP_VERSION_RC LWIP_RC_RELEASE + +/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ +#define LWIP_RC_RELEASE 255 +/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions */ +#define LWIP_RC_DEVELOPMENT 0 + +#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) +#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) +#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) + +/* Some helper defines to get a version string */ +#define LWIP_VERSTR2(x) #x +#define LWIP_VERSTR(x) LWIP_VERSTR2(x) +#if LWIP_VERSION_IS_RELEASE +#define LWIP_VERSION_STRING_SUFFIX "" +#elif LWIP_VERSION_IS_DEVELOPMENT +#define LWIP_VERSION_STRING_SUFFIX "d" +#else +#define LWIP_VERSION_STRING_SUFFIX "rc" LWIP_VERSTR(LWIP_VERSION_RC) +#endif + +/** Provides the version of the stack */ +#define LWIP_VERSION (((u32_t)LWIP_VERSION_MAJOR) << 24 | ((u32_t)LWIP_VERSION_MINOR) << 16 | \ + ((u32_t)LWIP_VERSION_REVISION) << 8 | ((u32_t)LWIP_VERSION_RC)) +/** Provides the version of the stack as string */ +#define LWIP_VERSION_STRING LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX + +/** + * @} + */ + +/* Modules initialization */ +void lwip_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_INIT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip.h new file mode 100644 index 0000000..0673be9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip.h @@ -0,0 +1,319 @@ +/** + * @file + * IP API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_IP_H +#define LWIP_HDR_IP_H + +#include "lwip/opt.h" + +#include "lwip/def.h" +#include "lwip/pbuf.h" +#include "lwip/ip_addr.h" +#include "lwip/err.h" +#include "lwip/netif.h" +#include "lwip/ip4.h" +#include "lwip/ip6.h" +#include "lwip/prot/ip.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* This is passed as the destination address to ip_output_if (not + to ip_output), meaning that an IP header already is constructed + in the pbuf. This is used when TCP retransmits. */ +#define LWIP_IP_HDRINCL NULL + +/** pbufs passed to IP must have a ref-count of 1 as their payload pointer + gets altered as the packet is passed down the stack */ +#ifndef LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX +#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p) LWIP_ASSERT("p->ref == 1", (p)->ref == 1) +#endif + +#if LWIP_NETIF_HWADDRHINT +#define IP_PCB_ADDRHINT ;u8_t addr_hint +#else +#define IP_PCB_ADDRHINT +#endif /* LWIP_NETIF_HWADDRHINT */ + +/** This is the common part of all PCB types. It needs to be at the + beginning of a PCB type definition. It is located here so that + changes to this common part are made in one location instead of + having to change all PCB structs. */ +#define IP_PCB \ + /* ip addresses in network byte order */ \ + ip_addr_t local_ip; \ + ip_addr_t remote_ip; \ + /* Socket options */ \ + u8_t so_options; \ + /* Type Of Service */ \ + u8_t tos; \ + /* Time To Live */ \ + u8_t ttl \ + /* link layer address resolution hint */ \ + IP_PCB_ADDRHINT + +struct ip_pcb { +/* Common members of all PCB types */ + IP_PCB; +}; + +/* + * Option flags per-socket. These are the same like SO_XXX in sockets.h + */ +#define SOF_REUSEADDR 0x04U /* allow local address reuse */ +#define SOF_KEEPALIVE 0x08U /* keep connections alive */ +#define SOF_BROADCAST 0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ + +/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */ +#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE) + +/** Global variables of this module, kept in a struct for efficient access using base+index. */ +struct ip_globals +{ + /** The interface that accepted the packet for the current callback invocation. */ + struct netif *current_netif; + /** The interface that received the packet for the current callback invocation. */ + struct netif *current_input_netif; +#if LWIP_IPV4 + /** Header of the input packet currently being processed. */ + struct ip_hdr *current_ip4_header; +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + /** Header of the input IPv6 packet currently being processed. */ + struct ip6_hdr *current_ip6_header; +#endif /* LWIP_IPV6 */ + /** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */ + u16_t current_ip_header_tot_len; + /** Source IP address of current_header */ + ip_addr_t current_iphdr_src; + /** Destination IP address of current_header */ + ip_addr_t current_iphdr_dest; +}; +extern struct ip_globals ip_data; + + +/** Get the interface that accepted the current packet. + * This may or may not be the receiving netif, depending on your netif/network setup. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip_current_netif() (ip_data.current_netif) +/** Get the interface that received the current packet. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip_current_input_netif() (ip_data.current_input_netif) +/** Total header length of ip(6)_current_header() (i.e. after this, the UDP/TCP header starts) */ +#define ip_current_header_tot_len() (ip_data.current_ip_header_tot_len) +/** Source IP address of current_header */ +#define ip_current_src_addr() (&ip_data.current_iphdr_src) +/** Destination IP address of current_header */ +#define ip_current_dest_addr() (&ip_data.current_iphdr_dest) + +#if LWIP_IPV4 && LWIP_IPV6 +/** Get the IPv4 header of the current packet. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip4_current_header() ((const struct ip_hdr*)(ip_data.current_ip4_header)) +/** Get the IPv6 header of the current packet. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) +/** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */ +#define ip_current_is_v6() (ip6_current_header() != NULL) +/** Source IPv6 address of current_header */ +#define ip6_current_src_addr() (ip_2_ip6(&ip_data.current_iphdr_src)) +/** Destination IPv6 address of current_header */ +#define ip6_current_dest_addr() (ip_2_ip6(&ip_data.current_iphdr_dest)) +/** Get the transport layer protocol */ +#define ip_current_header_proto() (ip_current_is_v6() ? \ + IP6H_NEXTH(ip6_current_header()) :\ + IPH_PROTO(ip4_current_header())) +/** Get the transport layer header */ +#define ip_next_header_ptr() ((const void*)((ip_current_is_v6() ? \ + (const u8_t*)ip6_current_header() : (const u8_t*)ip4_current_header()) + ip_current_header_tot_len())) + +/** Source IP4 address of current_header */ +#define ip4_current_src_addr() (ip_2_ip4(&ip_data.current_iphdr_src)) +/** Destination IP4 address of current_header */ +#define ip4_current_dest_addr() (ip_2_ip4(&ip_data.current_iphdr_dest)) + +#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ + +/** Get the IPv4 header of the current packet. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip4_current_header() ((const struct ip_hdr*)(ip_data.current_ip4_header)) +/** Always returns FALSE when only supporting IPv4 only */ +#define ip_current_is_v6() 0 +/** Get the transport layer protocol */ +#define ip_current_header_proto() IPH_PROTO(ip4_current_header()) +/** Get the transport layer header */ +#define ip_next_header_ptr() ((const void*)((const u8_t*)ip4_current_header() + ip_current_header_tot_len())) +/** Source IP4 address of current_header */ +#define ip4_current_src_addr() (&ip_data.current_iphdr_src) +/** Destination IP4 address of current_header */ +#define ip4_current_dest_addr() (&ip_data.current_iphdr_dest) + +#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ + +/** Get the IPv6 header of the current packet. + * This function must only be called from a receive callback (udp_recv, + * raw_recv, tcp_accept). It will return NULL otherwise. */ +#define ip6_current_header() ((const struct ip6_hdr*)(ip_data.current_ip6_header)) +/** Always returns TRUE when only supporting IPv6 only */ +#define ip_current_is_v6() 1 +/** Get the transport layer protocol */ +#define ip_current_header_proto() IP6H_NEXTH(ip6_current_header()) +/** Get the transport layer header */ +#define ip_next_header_ptr() ((const void*)((const u8_t*)ip6_current_header())) +/** Source IP6 address of current_header */ +#define ip6_current_src_addr() (&ip_data.current_iphdr_src) +/** Destination IP6 address of current_header */ +#define ip6_current_dest_addr() (&ip_data.current_iphdr_dest) + +#endif /* LWIP_IPV6 */ + +/** Union source address of current_header */ +#define ip_current_src_addr() (&ip_data.current_iphdr_src) +/** Union destination address of current_header */ +#define ip_current_dest_addr() (&ip_data.current_iphdr_dest) + +/** Gets an IP pcb option (SOF_* flags) */ +#define ip_get_option(pcb, opt) ((pcb)->so_options & (opt)) +/** Sets an IP pcb option (SOF_* flags) */ +#define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt)) +/** Resets an IP pcb option (SOF_* flags) */ +#define ip_reset_option(pcb, opt) ((pcb)->so_options &= ~(opt)) + +#if LWIP_IPV4 && LWIP_IPV6 +/** + * @ingroup ip + * Output IP packet, netif is selected by source address + */ +#define ip_output(p, src, dest, ttl, tos, proto) \ + (IP_IS_V6(dest) ? \ + ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \ + ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto)) +/** + * @ingroup ip + * Output IP packet to specified interface + */ +#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ + (IP_IS_V6(dest) ? \ + ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ + ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif)) +/** + * @ingroup ip + * Output IP packet to interface specifying source address + */ +#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ + (IP_IS_V6(dest) ? \ + ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ + ip4_output_if_src(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif)) +/** Output IP packet with addr_hint */ +#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ + (IP_IS_V6(dest) ? \ + ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \ + ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint)) +/** + * @ingroup ip + * Get netif for address combination. See \ref ip6_route and \ref ip4_route + */ +#define ip_route(src, dest) \ + (IP_IS_V6(dest) ? \ + ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \ + ip4_route_src(ip_2_ip4(dest), ip_2_ip4(src))) +/** + * @ingroup ip + * Get netif for IP. + */ +#define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \ + ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \ + ip4_netif_get_local_ip(netif)) +#define ip_debug_print(is_ipv6, p) ((is_ipv6) ? ip6_debug_print(p) : ip4_debug_print(p)) + +err_t ip_input(struct pbuf *p, struct netif *inp); + +#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ + +#define ip_output(p, src, dest, ttl, tos, proto) \ + ip4_output(p, src, dest, ttl, tos, proto) +#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ + ip4_output_if(p, src, dest, ttl, tos, proto, netif) +#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ + ip4_output_if_src(p, src, dest, ttl, tos, proto, netif) +#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ + ip4_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) +#define ip_route(src, dest) \ + ip4_route_src(dest, src) +#define ip_netif_get_local_ip(netif, dest) \ + ip4_netif_get_local_ip(netif) +#define ip_debug_print(is_ipv6, p) ip4_debug_print(p) + +#define ip_input ip4_input + +#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */ + +#define ip_output(p, src, dest, ttl, tos, proto) \ + ip6_output(p, src, dest, ttl, tos, proto) +#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ + ip6_output_if(p, src, dest, ttl, tos, proto, netif) +#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ + ip6_output_if_src(p, src, dest, ttl, tos, proto, netif) +#define ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) \ + ip6_output_hinted(p, src, dest, ttl, tos, proto, addr_hint) +#define ip_route(src, dest) \ + ip6_route(src, dest) +#define ip_netif_get_local_ip(netif, dest) \ + ip6_netif_get_local_ip(netif, dest) +#define ip_debug_print(is_ipv6, p) ip6_debug_print(p) + +#define ip_input ip6_input + +#endif /* LWIP_IPV6 */ + +#define ip_route_get_local_ip(src, dest, netif, ipaddr) do { \ + (netif) = ip_route(src, dest); \ + (ipaddr) = ip_netif_get_local_ip(netif, dest); \ +}while(0) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_IP_H */ + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4.h new file mode 100644 index 0000000..48246ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4.h @@ -0,0 +1,111 @@ +/** + * @file + * IPv4 API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_IP4_H +#define LWIP_HDR_IP4_H + +#include "lwip/opt.h" + +#if LWIP_IPV4 + +#include "lwip/def.h" +#include "lwip/pbuf.h" +#include "lwip/ip4_addr.h" +#include "lwip/err.h" +#include "lwip/netif.h" +#include "lwip/prot/ip4.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LWIP_HOOK_IP4_ROUTE_SRC +#define LWIP_IPV4_SRC_ROUTING 1 +#else +#define LWIP_IPV4_SRC_ROUTING 0 +#endif + +/** Currently, the function ip_output_if_opt() is only used with IGMP */ +#define IP_OPTIONS_SEND (LWIP_IPV4 && LWIP_IGMP) + +#define ip_init() /* Compatibility define, no init needed. */ +struct netif *ip4_route(const ip4_addr_t *dest); +#if LWIP_IPV4_SRC_ROUTING +struct netif *ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src); +#else /* LWIP_IPV4_SRC_ROUTING */ +#define ip4_route_src(dest, src) ip4_route(dest) +#endif /* LWIP_IPV4_SRC_ROUTING */ +err_t ip4_input(struct pbuf *p, struct netif *inp); +err_t ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto); +err_t ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif); +err_t ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif); +#if LWIP_NETIF_HWADDRHINT +err_t ip4_output_hinted(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint); +#endif /* LWIP_NETIF_HWADDRHINT */ +#if IP_OPTIONS_SEND +err_t ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, + u16_t optlen); +err_t ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest, + u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, + u16_t optlen); +#endif /* IP_OPTIONS_SEND */ + +#if LWIP_MULTICAST_TX_OPTIONS +void ip4_set_default_multicast_netif(struct netif* default_multicast_netif); +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + +#define ip4_netif_get_local_ip(netif) (((netif) != NULL) ? netif_ip_addr4(netif) : NULL) + +#if IP_DEBUG +void ip4_debug_print(struct pbuf *p); +#else +#define ip4_debug_print(p) +#endif /* IP_DEBUG */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV4 */ + +#endif /* LWIP_HDR_IP_H */ + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_addr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_addr.h new file mode 100644 index 0000000..51b46b8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_addr.h @@ -0,0 +1,227 @@ +/** + * @file + * IPv4 address API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_IP4_ADDR_H +#define LWIP_HDR_IP4_ADDR_H + +#include "lwip/opt.h" +#include "lwip/def.h" + +#if LWIP_IPV4 + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the aligned version of ip4_addr_t, + used as local variable, on the stack, etc. */ +struct ip4_addr { + u32_t addr; +}; + +/** ip4_addr_t uses a struct for convenience only, so that the same defines can + * operate both on ip4_addr_t as well as on ip4_addr_p_t. */ +typedef struct ip4_addr ip4_addr_t; + +/** + * struct ipaddr2 is used in the definition of the ARP packet format in + * order to support compilers that don't have structure packing. + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip4_addr2 { + PACK_STRUCT_FIELD(u16_t addrw[2]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* Forward declaration to not include netif.h */ +struct netif; + +/** 255.255.255.255 */ +#define IPADDR_NONE ((u32_t)0xffffffffUL) +/** 127.0.0.1 */ +#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL) +/** 0.0.0.0 */ +#define IPADDR_ANY ((u32_t)0x00000000UL) +/** 255.255.255.255 */ +#define IPADDR_BROADCAST ((u32_t)0xffffffffUL) + +/* Definitions of the bits in an Internet address integer. + + On subnets, host and network parts are found according to + the subnet mask, not these masks. */ +#define IP_CLASSA(a) ((((u32_t)(a)) & 0x80000000UL) == 0) +#define IP_CLASSA_NET 0xff000000 +#define IP_CLASSA_NSHIFT 24 +#define IP_CLASSA_HOST (0xffffffff & ~IP_CLASSA_NET) +#define IP_CLASSA_MAX 128 + +#define IP_CLASSB(a) ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL) +#define IP_CLASSB_NET 0xffff0000 +#define IP_CLASSB_NSHIFT 16 +#define IP_CLASSB_HOST (0xffffffff & ~IP_CLASSB_NET) +#define IP_CLASSB_MAX 65536 + +#define IP_CLASSC(a) ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL) +#define IP_CLASSC_NET 0xffffff00 +#define IP_CLASSC_NSHIFT 8 +#define IP_CLASSC_HOST (0xffffffff & ~IP_CLASSC_NET) + +#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL) +#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */ +#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */ +#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */ +#define IP_MULTICAST(a) IP_CLASSD(a) + +#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) +#define IP_BADCLASS(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) + +#define IP_LOOPBACKNET 127 /* official! */ + +/** Set an IP address given by the four byte-parts */ +#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) + +/** MEMCPY-like copying of IP addresses where addresses are known to be + * 16-bit-aligned if the port is correctly configured (so a port could define + * this to copying 2 u16_t's) - no NULL-pointer-checking needed. */ +#ifndef IPADDR2_COPY +#define IPADDR2_COPY(dest, src) SMEMCPY(dest, src, sizeof(ip4_addr_t)) +#endif + +/** Copy IP address - faster than ip4_addr_set: no NULL check */ +#define ip4_addr_copy(dest, src) ((dest).addr = (src).addr) +/** Safely copy one IP address to another (src may be NULL) */ +#define ip4_addr_set(dest, src) ((dest)->addr = \ + ((src) == NULL ? 0 : \ + (src)->addr)) +/** Set complete address to zero */ +#define ip4_addr_set_zero(ipaddr) ((ipaddr)->addr = 0) +/** Set address to IPADDR_ANY (no need for lwip_htonl()) */ +#define ip4_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY) +/** Set address to loopback address */ +#define ip4_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) +/** Check if an address is in the loopback region */ +#define ip4_addr_isloopback(ipaddr) (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24)) +/** Safely copy one IP address to another and change byte order + * from host- to network-order. */ +#define ip4_addr_set_hton(dest, src) ((dest)->addr = \ + ((src) == NULL ? 0:\ + lwip_htonl((src)->addr))) +/** IPv4 only: set the IP address given as an u32_t */ +#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) +/** IPv4 only: get the IP address as an u32_t */ +#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr) + +/** Get the network address by combining host address with netmask */ +#define ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0) + +/** + * Determine if two address are on the same network. + * + * @arg addr1 IP address 1 + * @arg addr2 IP address 2 + * @arg mask network identifier mask + * @return !0 if the network identifiers of both address match + */ +#define ip4_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ + (mask)->addr) == \ + ((addr2)->addr & \ + (mask)->addr)) +#define ip4_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr) + +#define ip4_addr_isany_val(addr1) ((addr1).addr == IPADDR_ANY) +#define ip4_addr_isany(addr1) ((addr1) == NULL || ip4_addr_isany_val(*(addr1))) + +#define ip4_addr_isbroadcast(addr1, netif) ip4_addr_isbroadcast_u32((addr1)->addr, netif) +u8_t ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif); + +#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr) +u8_t ip4_addr_netmask_valid(u32_t netmask); + +#define ip4_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL)) + +#define ip4_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL)) + +#define ip4_addr_debug_print_parts(debug, a, b, c, d) \ + LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d)) +#define ip4_addr_debug_print(debug, ipaddr) \ + ip4_addr_debug_print_parts(debug, \ + (u16_t)((ipaddr) != NULL ? ip4_addr1_16(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? ip4_addr2_16(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? ip4_addr3_16(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? ip4_addr4_16(ipaddr) : 0)) +#define ip4_addr_debug_print_val(debug, ipaddr) \ + ip4_addr_debug_print_parts(debug, \ + ip4_addr1_16(&(ipaddr)), \ + ip4_addr2_16(&(ipaddr)), \ + ip4_addr3_16(&(ipaddr)), \ + ip4_addr4_16(&(ipaddr))) + +/* Get one byte from the 4-byte address */ +#define ip4_addr1(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[0]) +#define ip4_addr2(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[1]) +#define ip4_addr3(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[2]) +#define ip4_addr4(ipaddr) (((const u8_t*)(&(ipaddr)->addr))[3]) +/* These are cast to u16_t, with the intent that they are often arguments + * to printf using the U16_F format from cc.h. */ +#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr)) +#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr)) +#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr)) +#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr)) + +#define IP4ADDR_STRLEN_MAX 16 + +/** For backwards compatibility */ +#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr) + +u32_t ipaddr_addr(const char *cp); +int ip4addr_aton(const char *cp, ip4_addr_t *addr); +/** returns ptr to static buffer; not reentrant! */ +char *ip4addr_ntoa(const ip4_addr_t *addr); +char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV4 */ + +#endif /* LWIP_HDR_IP_ADDR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_frag.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_frag.h new file mode 100644 index 0000000..ed5bf14 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip4_frag.h @@ -0,0 +1,100 @@ +/** + * @file + * IP fragmentation/reassembly + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Jani Monoses + * + */ + +#ifndef LWIP_HDR_IP4_FRAG_H +#define LWIP_HDR_IP4_FRAG_H + +#include "lwip/opt.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/ip_addr.h" +#include "lwip/ip.h" + +#if LWIP_IPV4 + +#ifdef __cplusplus +extern "C" { +#endif + +#if IP_REASSEMBLY +/* The IP reassembly timer interval in milliseconds. */ +#define IP_TMR_INTERVAL 1000 + +/** IP reassembly helper struct. + * This is exported because memp needs to know the size. + */ +struct ip_reassdata { + struct ip_reassdata *next; + struct pbuf *p; + struct ip_hdr iphdr; + u16_t datagram_len; + u8_t flags; + u8_t timer; +}; + +void ip_reass_init(void); +void ip_reass_tmr(void); +struct pbuf * ip4_reass(struct pbuf *p); +#endif /* IP_REASSEMBLY */ + +#if IP_FRAG +#if !LWIP_NETIF_TX_SINGLE_PBUF +#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED +#define LWIP_PBUF_CUSTOM_REF_DEFINED +/** A custom pbuf that holds a reference to another pbuf, which is freed + * when this custom pbuf is freed. This is used to create a custom PBUF_REF + * that points into the original pbuf. */ +struct pbuf_custom_ref { + /** 'base class' */ + struct pbuf_custom pc; + /** pointer to the original pbuf that is referenced */ + struct pbuf *original; +}; +#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */ +#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */ + +err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest); +#endif /* IP_FRAG */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV4 */ + +#endif /* LWIP_HDR_IP4_FRAG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6.h new file mode 100644 index 0000000..099b94f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6.h @@ -0,0 +1,93 @@ +/** + * @file + * + * IPv6 layer. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ +#ifndef LWIP_HDR_IP6_H +#define LWIP_HDR_IP6_H + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip6_addr.h" +#include "lwip/prot/ip6.h" +#include "lwip/def.h" +#include "lwip/pbuf.h" +#include "lwip/netif.h" + +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct netif *ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest); +const ip_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest); +err_t ip6_input(struct pbuf *p, struct netif *inp); +err_t ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth); +err_t ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); +err_t ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); +#if LWIP_NETIF_HWADDRHINT +err_t ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, + u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint); +#endif /* LWIP_NETIF_HWADDRHINT */ +#if LWIP_IPV6_MLD +err_t ip6_options_add_hbh_ra(struct pbuf * p, u8_t nexth, u8_t value); +#endif /* LWIP_IPV6_MLD */ + +#define ip6_netif_get_local_ip(netif, dest) (((netif) != NULL) ? \ + ip6_select_source_address(netif, dest) : NULL) + +#if IP6_DEBUG +void ip6_debug_print(struct pbuf *p); +#else +#define ip6_debug_print(p) +#endif /* IP6_DEBUG */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 */ + +#endif /* LWIP_HDR_IP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_addr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_addr.h new file mode 100644 index 0000000..ee381ae --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_addr.h @@ -0,0 +1,285 @@ +/** + * @file + * + * IPv6 addresses. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * Structs and macros for handling IPv6 addresses. + * + * Please coordinate changes and requests with Ivan Delamer + * + */ +#ifndef LWIP_HDR_IP6_ADDR_H +#define LWIP_HDR_IP6_ADDR_H + +#include "lwip/opt.h" +#include "def.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** This is the aligned version of ip6_addr_t, + used as local variable, on the stack, etc. */ +struct ip6_addr { + u32_t addr[4]; +}; + +/** IPv6 address */ +typedef struct ip6_addr ip6_addr_t; + +/** Set an IPv6 partial address given by byte-parts */ +#define IP6_ADDR_PART(ip6addr, index, a,b,c,d) \ + (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) + +/** Set a full IPv6 address by passing the 4 u32_t indices in network byte order + (use PP_HTONL() for constants) */ +#define IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) do { \ + (ip6addr)->addr[0] = idx0; \ + (ip6addr)->addr[1] = idx1; \ + (ip6addr)->addr[2] = idx2; \ + (ip6addr)->addr[3] = idx3; } while(0) + +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) +/** Access address in 16-bit block */ +#define IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) + +/** Copy IPv6 address - faster than ip6_addr_set: no NULL check */ +#define ip6_addr_copy(dest, src) do{(dest).addr[0] = (src).addr[0]; \ + (dest).addr[1] = (src).addr[1]; \ + (dest).addr[2] = (src).addr[2]; \ + (dest).addr[3] = (src).addr[3];}while(0) +/** Safely copy one IPv6 address to another (src may be NULL) */ +#define ip6_addr_set(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : (src)->addr[0]; \ + (dest)->addr[1] = (src) == NULL ? 0 : (src)->addr[1]; \ + (dest)->addr[2] = (src) == NULL ? 0 : (src)->addr[2]; \ + (dest)->addr[3] = (src) == NULL ? 0 : (src)->addr[3];}while(0) + +/** Set complete address to zero */ +#define ip6_addr_set_zero(ip6addr) do{(ip6addr)->addr[0] = 0; \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[2] = 0; \ + (ip6addr)->addr[3] = 0;}while(0) + +/** Set address to ipv6 'any' (no need for lwip_htonl()) */ +#define ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr) +/** Set address to ipv6 loopback address */ +#define ip6_addr_set_loopback(ip6addr) do{(ip6addr)->addr[0] = 0; \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[2] = 0; \ + (ip6addr)->addr[3] = PP_HTONL(0x00000001UL);}while(0) +/** Safely copy one IPv6 address to another and change byte order + * from host- to network-order. */ +#define ip6_addr_set_hton(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : lwip_htonl((src)->addr[0]); \ + (dest)->addr[1] = (src) == NULL ? 0 : lwip_htonl((src)->addr[1]); \ + (dest)->addr[2] = (src) == NULL ? 0 : lwip_htonl((src)->addr[2]); \ + (dest)->addr[3] = (src) == NULL ? 0 : lwip_htonl((src)->addr[3]);}while(0) + + +/** + * Determine if two IPv6 address are on the same network. + * + * @arg addr1 IPv6 address 1 + * @arg addr2 IPv6 address 2 + * @return !0 if the network identifiers of both address match + */ +#define ip6_addr_netcmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \ + ((addr1)->addr[1] == (addr2)->addr[1])) + +#define ip6_addr_cmp(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \ + ((addr1)->addr[1] == (addr2)->addr[1]) && \ + ((addr1)->addr[2] == (addr2)->addr[2]) && \ + ((addr1)->addr[3] == (addr2)->addr[3])) + +#define ip6_get_subnet_id(ip6addr) (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL) + +#define ip6_addr_isany_val(ip6addr) (((ip6addr).addr[0] == 0) && \ + ((ip6addr).addr[1] == 0) && \ + ((ip6addr).addr[2] == 0) && \ + ((ip6addr).addr[3] == 0)) +#define ip6_addr_isany(ip6addr) (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr))) + +#define ip6_addr_isloopback(ip6addr) (((ip6addr)->addr[0] == 0UL) && \ + ((ip6addr)->addr[1] == 0UL) && \ + ((ip6addr)->addr[2] == 0UL) && \ + ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) + +#define ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL)) + +#define ip6_addr_islinklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL)) + +#define ip6_addr_issitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL)) + +#define ip6_addr_isuniquelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL)) + +#define ip6_addr_isipv4mappedipv6(ip6addr) (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL))) + +#define ip6_addr_ismulticast(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) +#define ip6_addr_multicast_transient_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL)) +#define ip6_addr_multicast_prefix_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL)) +#define ip6_addr_multicast_rendezvous_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL)) +#define ip6_addr_multicast_scope(ip6addr) ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xf) +#define IP6_MULTICAST_SCOPE_RESERVED 0x0 +#define IP6_MULTICAST_SCOPE_RESERVED0 0x0 +#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL 0x1 +#define IP6_MULTICAST_SCOPE_LINK_LOCAL 0x2 +#define IP6_MULTICAST_SCOPE_RESERVED3 0x3 +#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL 0x4 +#define IP6_MULTICAST_SCOPE_SITE_LOCAL 0x5 +#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 0x8 +#define IP6_MULTICAST_SCOPE_GLOBAL 0xe +#define IP6_MULTICAST_SCOPE_RESERVEDF 0xf +#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL)) +#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL)) +#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL)) +#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL)) +#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL)) +#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL)) + +/* @todo define get/set for well-know multicast addresses, e.g. ff02::1 */ +#define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \ + ((ip6addr)->addr[1] == 0UL) && \ + ((ip6addr)->addr[2] == 0UL) && \ + ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) + +#define ip6_addr_isallnodes_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ + ((ip6addr)->addr[1] == 0UL) && \ + ((ip6addr)->addr[2] == 0UL) && \ + ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL))) +#define ip6_addr_set_allnodes_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[2] = 0; \ + (ip6addr)->addr[3] = PP_HTONL(0x00000001UL);}while(0) + +#define ip6_addr_isallrouters_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ + ((ip6addr)->addr[1] == 0UL) && \ + ((ip6addr)->addr[2] == 0UL) && \ + ((ip6addr)->addr[3] == PP_HTONL(0x00000002UL))) +#define ip6_addr_set_allrouters_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[2] = 0; \ + (ip6addr)->addr[3] = PP_HTONL(0x00000002UL);}while(0) + +#define ip6_addr_issolicitednode(ip6addr) ( ((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ + ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \ + (((ip6addr)->addr[3] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) ) + +#define ip6_addr_set_solicitednode(ip6addr, if_id) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[2] = PP_HTONL(0x00000001UL); \ + (ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id));}while(0) + +#define ip6_addr_cmp_solicitednode(ip6addr, sn_addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \ + ((ip6addr)->addr[1] == 0) && \ + ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \ + ((ip6addr)->addr[3] == (PP_HTONL(0xff000000UL) | (sn_addr)->addr[3]))) + +/* IPv6 address states. */ +#define IP6_ADDR_INVALID 0x00 +#define IP6_ADDR_TENTATIVE 0x08 +#define IP6_ADDR_TENTATIVE_1 0x09 /* 1 probe sent */ +#define IP6_ADDR_TENTATIVE_2 0x0a /* 2 probes sent */ +#define IP6_ADDR_TENTATIVE_3 0x0b /* 3 probes sent */ +#define IP6_ADDR_TENTATIVE_4 0x0c /* 4 probes sent */ +#define IP6_ADDR_TENTATIVE_5 0x0d /* 5 probes sent */ +#define IP6_ADDR_TENTATIVE_6 0x0e /* 6 probes sent */ +#define IP6_ADDR_TENTATIVE_7 0x0f /* 7 probes sent */ +#define IP6_ADDR_VALID 0x10 /* This bit marks an address as valid (preferred or deprecated) */ +#define IP6_ADDR_PREFERRED 0x30 +#define IP6_ADDR_DEPRECATED 0x10 /* Same as VALID (valid but not preferred) */ + +#define IP6_ADDR_TENTATIVE_COUNT_MASK 0x07 /* 1-7 probes sent */ + +#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID) +#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE) +#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */ +#define ip6_addr_ispreferred(addr_state) (addr_state == IP6_ADDR_PREFERRED) +#define ip6_addr_isdeprecated(addr_state) (addr_state == IP6_ADDR_DEPRECATED) + +#define ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h) \ + LWIP_DEBUGF(debug, ("%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F, \ + a, b, c, d, e, f, g, h)) +#define ip6_addr_debug_print(debug, ipaddr) \ + ip6_addr_debug_print_parts(debug, \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK1(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK2(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK3(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK4(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK5(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK6(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0), \ + (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0)) +#define ip6_addr_debug_print_val(debug, ipaddr) \ + ip6_addr_debug_print_parts(debug, \ + IP6_ADDR_BLOCK1(&(ipaddr)), \ + IP6_ADDR_BLOCK2(&(ipaddr)), \ + IP6_ADDR_BLOCK3(&(ipaddr)), \ + IP6_ADDR_BLOCK4(&(ipaddr)), \ + IP6_ADDR_BLOCK5(&(ipaddr)), \ + IP6_ADDR_BLOCK6(&(ipaddr)), \ + IP6_ADDR_BLOCK7(&(ipaddr)), \ + IP6_ADDR_BLOCK8(&(ipaddr))) + +#define IP6ADDR_STRLEN_MAX 46 + +int ip6addr_aton(const char *cp, ip6_addr_t *addr); +/** returns ptr to static buffer; not reentrant! */ +char *ip6addr_ntoa(const ip6_addr_t *addr); +char *ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen); + + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 */ + +#endif /* LWIP_HDR_IP6_ADDR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_frag.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_frag.h new file mode 100644 index 0000000..6be2747 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip6_frag.h @@ -0,0 +1,120 @@ +/** + * @file + * + * IPv6 fragmentation and reassembly. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ +#ifndef LWIP_HDR_IP6_FRAG_H +#define LWIP_HDR_IP6_FRAG_H + +#include "lwip/opt.h" +#include "lwip/pbuf.h" +#include "lwip/ip6_addr.h" +#include "lwip/ip6.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */ + +/** IP6_FRAG_COPYHEADER==1: for platforms where sizeof(void*) > 4, this needs to + * be enabled (to not overwrite part of the data). When enabled, the IPv6 header + * is copied instead of referencing it, which gives more room for struct ip6_reass_helper */ +#ifndef IPV6_FRAG_COPYHEADER +#define IPV6_FRAG_COPYHEADER 0 +#endif + +/** The IPv6 reassembly timer interval in milliseconds. */ +#define IP6_REASS_TMR_INTERVAL 1000 + +/* Copy the complete header of the first fragment to struct ip6_reassdata + or just point to its original location in the first pbuf? */ +#if IPV6_FRAG_COPYHEADER +#define IPV6_FRAG_HDRPTR +#define IPV6_FRAG_HDRREF(hdr) (&(hdr)) +#else /* IPV6_FRAG_COPYHEADER */ +#define IPV6_FRAG_HDRPTR * +#define IPV6_FRAG_HDRREF(hdr) (hdr) +#endif /* IPV6_FRAG_COPYHEADER */ + +/** IPv6 reassembly helper struct. + * This is exported because memp needs to know the size. + */ +struct ip6_reassdata { + struct ip6_reassdata *next; + struct pbuf *p; + struct ip6_hdr IPV6_FRAG_HDRPTR iphdr; + u32_t identification; + u16_t datagram_len; + u8_t nexth; + u8_t timer; +}; + +#define ip6_reass_init() /* Compatibility define */ +void ip6_reass_tmr(void); +struct pbuf *ip6_reass(struct pbuf *p); + +#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ + +#if LWIP_IPV6 && LWIP_IPV6_FRAG /* don't build if not configured for use in lwipopts.h */ + +#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED +#define LWIP_PBUF_CUSTOM_REF_DEFINED +/** A custom pbuf that holds a reference to another pbuf, which is freed + * when this custom pbuf is freed. This is used to create a custom PBUF_REF + * that points into the original pbuf. */ +struct pbuf_custom_ref { + /** 'base class' */ + struct pbuf_custom pc; + /** pointer to the original pbuf that is referenced */ + struct pbuf *original; +}; +#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */ + +err_t ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest); + +#endif /* LWIP_IPV6 && LWIP_IPV6_FRAG */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_IP6_FRAG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip_addr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip_addr.h new file mode 100644 index 0000000..11f65d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/ip_addr.h @@ -0,0 +1,407 @@ +/** + * @file + * IP address API (common IPv4 and IPv6) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_IP_ADDR_H +#define LWIP_HDR_IP_ADDR_H + +#include "lwip/opt.h" +#include "lwip/def.h" + +#include "lwip/ip4_addr.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup ipaddr + * IP address types for use in ip_addr_t.type member. + * @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type(). + */ +enum lwip_ip_addr_type { + /** IPv4 */ + IPADDR_TYPE_V4 = 0U, + /** IPv6 */ + IPADDR_TYPE_V6 = 6U, + /** IPv4+IPv6 ("dual-stack") */ + IPADDR_TYPE_ANY = 46U +}; + +#if LWIP_IPV4 && LWIP_IPV6 +/** + * @ingroup ipaddr + * A union struct for both IP version's addresses. + * ATTENTION: watch out for its size when adding IPv6 address scope! + */ +typedef struct ip_addr { + union { + ip6_addr_t ip6; + ip4_addr_t ip4; + } u_addr; + /** @ref lwip_ip_addr_type */ + u8_t type; +} ip_addr_t; + +extern const ip_addr_t ip_addr_any_type; + +/** @ingroup ip4addr */ +#define IPADDR4_INIT(u32val) { { { { u32val, 0ul, 0ul, 0ul } } }, IPADDR_TYPE_V4 } +/** @ingroup ip4addr */ +#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) +/** @ingroup ip6addr */ +#define IPADDR6_INIT(a, b, c, d) { { { { a, b, c, d } } }, IPADDR_TYPE_V6 } +/** @ingroup ip6addr */ +#define IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } } }, IPADDR_TYPE_V6 } + +/** @ingroup ipaddr */ +#define IP_IS_ANY_TYPE_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY) +/** @ingroup ipaddr */ +#define IPADDR_ANY_TYPE_INIT { { { { 0ul, 0ul, 0ul, 0ul } } }, IPADDR_TYPE_ANY } + +/** @ingroup ip4addr */ +#define IP_IS_V4_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4) +/** @ingroup ip6addr */ +#define IP_IS_V6_VAL(ipaddr) (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6) +/** @ingroup ip4addr */ +#define IP_IS_V4(ipaddr) (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr))) +/** @ingroup ip6addr */ +#define IP_IS_V6(ipaddr) (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr))) + +#define IP_SET_TYPE_VAL(ipaddr, iptype) do { (ipaddr).type = (iptype); }while(0) +#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0) +#define IP_GET_TYPE(ipaddr) ((ipaddr)->type) + +#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) (IP_GET_TYPE(&pcb->local_ip) == IP_GET_TYPE(ipaddr)) +#define IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr) (IP_IS_ANY_TYPE_VAL(pcb->local_ip) || IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)) + +/** @ingroup ip6addr + * Convert generic ip address to specific protocol version + */ +#define ip_2_ip6(ipaddr) (&((ipaddr)->u_addr.ip6)) +/** @ingroup ip4addr + * Convert generic ip address to specific protocol version + */ +#define ip_2_ip4(ipaddr) (&((ipaddr)->u_addr.ip4)) + +/** @ingroup ip4addr */ +#define IP_ADDR4(ipaddr,a,b,c,d) do { IP4_ADDR(ip_2_ip4(ipaddr),a,b,c,d); \ + IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V4); } while(0) +/** @ingroup ip6addr */ +#define IP_ADDR6(ipaddr,i0,i1,i2,i3) do { IP6_ADDR(ip_2_ip6(ipaddr),i0,i1,i2,i3); \ + IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V6); } while(0) +/** @ingroup ip6addr */ +#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) + +/** @ingroup ipaddr */ +#define ip_addr_copy(dest, src) do{ IP_SET_TYPE_VAL(dest, IP_GET_TYPE(&src)); if(IP_IS_V6_VAL(src)){ \ + ip6_addr_copy(*ip_2_ip6(&(dest)), *ip_2_ip6(&(src))); }else{ \ + ip4_addr_copy(*ip_2_ip4(&(dest)), *ip_2_ip4(&(src))); }}while(0) +/** @ingroup ip6addr */ +#define ip_addr_copy_from_ip6(dest, src) do{ \ + ip6_addr_copy(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0) +/** @ingroup ip4addr */ +#define ip_addr_copy_from_ip4(dest, src) do{ \ + ip4_addr_copy(*ip_2_ip4(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V4); }while(0) +/** @ingroup ip4addr */ +#define ip_addr_set_ip4_u32(ipaddr, val) do{if(ipaddr){ip4_addr_set_u32(ip_2_ip4(ipaddr), val); \ + IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) +/** @ingroup ip4addr */ +#define ip_addr_get_ip4_u32(ipaddr) (((ipaddr) && IP_IS_V4(ipaddr)) ? \ + ip4_addr_get_u32(ip_2_ip4(ipaddr)) : 0) +/** @ingroup ipaddr */ +#define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \ + ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); }else{ \ + ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); }}while(0) +/** @ingroup ipaddr */ +#define ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src) +/** @ingroup ipaddr */ +#define ip_addr_set_zero(ipaddr) do{ \ + ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, 0); }while(0) +/** @ingroup ip5addr */ +#define ip_addr_set_zero_ip4(ipaddr) do{ \ + ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }while(0) +/** @ingroup ip6addr */ +#define ip_addr_set_zero_ip6(ipaddr) do{ \ + ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }while(0) +/** @ingroup ipaddr */ +#define ip_addr_set_any(is_ipv6, ipaddr) do{if(is_ipv6){ \ + ip6_addr_set_any(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \ + ip4_addr_set_any(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) +/** @ingroup ipaddr */ +#define ip_addr_set_loopback(is_ipv6, ipaddr) do{if(is_ipv6){ \ + ip6_addr_set_loopback(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \ + ip4_addr_set_loopback(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }}while(0) +/** @ingroup ipaddr */ +#define ip_addr_set_hton(dest, src) do{if(IP_IS_V6(src)){ \ + ip6_addr_set_hton(ip_2_ip6(ipaddr), (src)); IP_SET_TYPE(dest, IPADDR_TYPE_V6); }else{ \ + ip4_addr_set_hton(ip_2_ip4(ipaddr), (src)); IP_SET_TYPE(dest, IPADDR_TYPE_V4); }}while(0) +/** @ingroup ipaddr */ +#define ip_addr_get_network(target, host, netmask) do{if(IP_IS_V6(host)){ \ + ip4_addr_set_zero(ip_2_ip4(target)); IP_SET_TYPE(target, IPADDR_TYPE_V6); } else { \ + ip4_addr_get_network(ip_2_ip4(target), ip_2_ip4(host), ip_2_ip4(netmask)); IP_SET_TYPE(target, IPADDR_TYPE_V4); }}while(0) +/** @ingroup ipaddr */ +#define ip_addr_netcmp(addr1, addr2, mask) ((IP_IS_V6(addr1) && IP_IS_V6(addr2)) ? \ + 0 : \ + ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask)) +/** @ingroup ipaddr */ +#define ip_addr_cmp(addr1, addr2) ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \ + ip6_addr_cmp(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \ + ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2)))) +/** @ingroup ipaddr */ +#define ip_addr_isany(ipaddr) ((IP_IS_V6(ipaddr)) ? \ + ip6_addr_isany(ip_2_ip6(ipaddr)) : \ + ip4_addr_isany(ip_2_ip4(ipaddr))) +/** @ingroup ipaddr */ +#define ip_addr_isany_val(ipaddr) ((IP_IS_V6_VAL(ipaddr)) ? \ + ip6_addr_isany_val(*ip_2_ip6(&(ipaddr))) : \ + ip4_addr_isany_val(*ip_2_ip4(&(ipaddr)))) +/** @ingroup ipaddr */ +#define ip_addr_isbroadcast(ipaddr, netif) ((IP_IS_V6(ipaddr)) ? \ + 0 : \ + ip4_addr_isbroadcast(ip_2_ip4(ipaddr), netif)) +/** @ingroup ipaddr */ +#define ip_addr_ismulticast(ipaddr) ((IP_IS_V6(ipaddr)) ? \ + ip6_addr_ismulticast(ip_2_ip6(ipaddr)) : \ + ip4_addr_ismulticast(ip_2_ip4(ipaddr))) +/** @ingroup ipaddr */ +#define ip_addr_isloopback(ipaddr) ((IP_IS_V6(ipaddr)) ? \ + ip6_addr_isloopback(ip_2_ip6(ipaddr)) : \ + ip4_addr_isloopback(ip_2_ip4(ipaddr))) +/** @ingroup ipaddr */ +#define ip_addr_islinklocal(ipaddr) ((IP_IS_V6(ipaddr)) ? \ + ip6_addr_islinklocal(ip_2_ip6(ipaddr)) : \ + ip4_addr_islinklocal(ip_2_ip4(ipaddr))) +#define ip_addr_debug_print(debug, ipaddr) do { if(IP_IS_V6(ipaddr)) { \ + ip6_addr_debug_print(debug, ip_2_ip6(ipaddr)); } else { \ + ip4_addr_debug_print(debug, ip_2_ip4(ipaddr)); }}while(0) +#define ip_addr_debug_print_val(debug, ipaddr) do { if(IP_IS_V6_VAL(ipaddr)) { \ + ip6_addr_debug_print_val(debug, *ip_2_ip6(&(ipaddr))); } else { \ + ip4_addr_debug_print_val(debug, *ip_2_ip4(&(ipaddr))); }}while(0) +/** @ingroup ipaddr */ +#define ipaddr_ntoa(addr) (((addr) == NULL) ? "NULL" : \ + ((IP_IS_V6(addr)) ? ip6addr_ntoa(ip_2_ip6(addr)) : ip4addr_ntoa(ip_2_ip4(addr)))) +/** @ingroup ipaddr */ +#define ipaddr_ntoa_r(addr, buf, buflen) (((addr) == NULL) ? "NULL" : \ + ((IP_IS_V6(addr)) ? ip6addr_ntoa_r(ip_2_ip6(addr), buf, buflen) : ip4addr_ntoa_r(ip_2_ip4(addr), buf, buflen))) +int ipaddr_aton(const char *cp, ip_addr_t *addr); + +/** @ingroup ipaddr */ +#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX + +/** @ingroup ipaddr */ +#define ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) do { \ + (ip6addr)->addr[3] = (ip4addr)->addr; \ + (ip6addr)->addr[2] = PP_HTONL(0x0000FFFFUL); \ + (ip6addr)->addr[1] = 0; \ + (ip6addr)->addr[0] = 0; } while(0); + +/** @ingroup ipaddr */ +#define unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) \ + (ip4addr)->addr = (ip6addr)->addr[3]; + +#define IP46_ADDR_ANY(type) (((type) == IPADDR_TYPE_V6)? IP6_ADDR_ANY : IP4_ADDR_ANY) + +#else /* LWIP_IPV4 && LWIP_IPV6 */ + +#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb) 1 +#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) 1 + +#if LWIP_IPV4 + +typedef ip4_addr_t ip_addr_t; +#define IPADDR4_INIT(u32val) { u32val } +#define IPADDR4_INIT_BYTES(a,b,c,d) IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d))) +#define IP_IS_V4_VAL(ipaddr) 1 +#define IP_IS_V6_VAL(ipaddr) 0 +#define IP_IS_V4(ipaddr) 1 +#define IP_IS_V6(ipaddr) 0 +#define IP_IS_ANY_TYPE_VAL(ipaddr) 0 +#define IP_SET_TYPE_VAL(ipaddr, iptype) +#define IP_SET_TYPE(ipaddr, iptype) +#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V4 +#define ip_2_ip4(ipaddr) (ipaddr) +#define IP_ADDR4(ipaddr,a,b,c,d) IP4_ADDR(ipaddr,a,b,c,d) + +#define ip_addr_copy(dest, src) ip4_addr_copy(dest, src) +#define ip_addr_copy_from_ip4(dest, src) ip4_addr_copy(dest, src) +#define ip_addr_set_ip4_u32(ipaddr, val) ip4_addr_set_u32(ip_2_ip4(ipaddr), val) +#define ip_addr_get_ip4_u32(ipaddr) ip4_addr_get_u32(ip_2_ip4(ipaddr)) +#define ip_addr_set(dest, src) ip4_addr_set(dest, src) +#define ip_addr_set_ipaddr(dest, src) ip4_addr_set(dest, src) +#define ip_addr_set_zero(ipaddr) ip4_addr_set_zero(ipaddr) +#define ip_addr_set_zero_ip4(ipaddr) ip4_addr_set_zero(ipaddr) +#define ip_addr_set_any(is_ipv6, ipaddr) ip4_addr_set_any(ipaddr) +#define ip_addr_set_loopback(is_ipv6, ipaddr) ip4_addr_set_loopback(ipaddr) +#define ip_addr_set_hton(dest, src) ip4_addr_set_hton(dest, src) +#define ip_addr_get_network(target, host, mask) ip4_addr_get_network(target, host, mask) +#define ip_addr_netcmp(addr1, addr2, mask) ip4_addr_netcmp(addr1, addr2, mask) +#define ip_addr_cmp(addr1, addr2) ip4_addr_cmp(addr1, addr2) +#define ip_addr_isany(ipaddr) ip4_addr_isany(ipaddr) +#define ip_addr_isany_val(ipaddr) ip4_addr_isany_val(ipaddr) +#define ip_addr_isloopback(ipaddr) ip4_addr_isloopback(ipaddr) +#define ip_addr_islinklocal(ipaddr) ip4_addr_islinklocal(ipaddr) +#define ip_addr_isbroadcast(addr, netif) ip4_addr_isbroadcast(addr, netif) +#define ip_addr_ismulticast(ipaddr) ip4_addr_ismulticast(ipaddr) +#define ip_addr_debug_print(debug, ipaddr) ip4_addr_debug_print(debug, ipaddr) +#define ip_addr_debug_print_val(debug, ipaddr) ip4_addr_debug_print_val(debug, ipaddr) +#define ipaddr_ntoa(ipaddr) ip4addr_ntoa(ipaddr) +#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip4addr_ntoa_r(ipaddr, buf, buflen) +#define ipaddr_aton(cp, addr) ip4addr_aton(cp, addr) + +#define IPADDR_STRLEN_MAX IP4ADDR_STRLEN_MAX + +#define IP46_ADDR_ANY(type) (IP4_ADDR_ANY) + +#else /* LWIP_IPV4 */ + +typedef ip6_addr_t ip_addr_t; +#define IPADDR6_INIT(a, b, c, d) { { a, b, c, d } } +#define IPADDR6_INIT_HOST(a, b, c, d) { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } } +#define IP_IS_V4_VAL(ipaddr) 0 +#define IP_IS_V6_VAL(ipaddr) 1 +#define IP_IS_V4(ipaddr) 0 +#define IP_IS_V6(ipaddr) 1 +#define IP_IS_ANY_TYPE_VAL(ipaddr) 0 +#define IP_SET_TYPE_VAL(ipaddr, iptype) +#define IP_SET_TYPE(ipaddr, iptype) +#define IP_GET_TYPE(ipaddr) IPADDR_TYPE_V6 +#define ip_2_ip6(ipaddr) (ipaddr) +#define IP_ADDR6(ipaddr,i0,i1,i2,i3) IP6_ADDR(ipaddr,i0,i1,i2,i3) +#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3)) + +#define ip_addr_copy(dest, src) ip6_addr_copy(dest, src) +#define ip_addr_copy_from_ip6(dest, src) ip6_addr_copy(dest, src) +#define ip_addr_set(dest, src) ip6_addr_set(dest, src) +#define ip_addr_set_ipaddr(dest, src) ip6_addr_set(dest, src) +#define ip_addr_set_zero(ipaddr) ip6_addr_set_zero(ipaddr) +#define ip_addr_set_zero_ip6(ipaddr) ip6_addr_set_zero(ipaddr) +#define ip_addr_set_any(is_ipv6, ipaddr) ip6_addr_set_any(ipaddr) +#define ip_addr_set_loopback(is_ipv6, ipaddr) ip6_addr_set_loopback(ipaddr) +#define ip_addr_set_hton(dest, src) ip6_addr_set_hton(dest, src) +#define ip_addr_get_network(target, host, mask) ip6_addr_set_zero(target) +#define ip_addr_netcmp(addr1, addr2, mask) 0 +#define ip_addr_cmp(addr1, addr2) ip6_addr_cmp(addr1, addr2) +#define ip_addr_isany(ipaddr) ip6_addr_isany(ipaddr) +#define ip_addr_isany_val(ipaddr) ip6_addr_isany_val(ipaddr) +#define ip_addr_isloopback(ipaddr) ip6_addr_isloopback(ipaddr) +#define ip_addr_islinklocal(ipaddr) ip6_addr_islinklocal(ipaddr) +#define ip_addr_isbroadcast(addr, netif) 0 +#define ip_addr_ismulticast(ipaddr) ip6_addr_ismulticast(ipaddr) +#define ip_addr_debug_print(debug, ipaddr) ip6_addr_debug_print(debug, ipaddr) +#define ip_addr_debug_print_val(debug, ipaddr) ip6_addr_debug_print_val(debug, ipaddr) +#define ipaddr_ntoa(ipaddr) ip6addr_ntoa(ipaddr) +#define ipaddr_ntoa_r(ipaddr, buf, buflen) ip6addr_ntoa_r(ipaddr, buf, buflen) +#define ipaddr_aton(cp, addr) ip6addr_aton(cp, addr) + +#define IPADDR_STRLEN_MAX IP6ADDR_STRLEN_MAX + +#define IP46_ADDR_ANY(type) (IP6_ADDR_ANY) + +#endif /* LWIP_IPV4 */ +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#if LWIP_IPV4 + +extern const ip_addr_t ip_addr_any; +extern const ip_addr_t ip_addr_broadcast; + +/** + * @ingroup ip4addr + * Can be used as a fixed/const ip_addr_t + * for the IP wildcard. + * Defined to @ref IP4_ADDR_ANY when IPv4 is enabled. + * Defined to @ref IP6_ADDR_ANY in IPv6 only systems. + * Use this if you can handle IPv4 _AND_ IPv6 addresses. + * Use @ref IP4_ADDR_ANY or @ref IP6_ADDR_ANY when the IP + * type matters. + */ +#define IP_ADDR_ANY IP4_ADDR_ANY +/** + * @ingroup ip4addr + * Can be used as a fixed/const ip_addr_t + * for the IPv4 wildcard and the broadcast address + */ +#define IP4_ADDR_ANY (&ip_addr_any) +/** + * @ingroup ip4addr + * Can be used as a fixed/const ip4_addr_t + * for the wildcard and the broadcast address + */ +#define IP4_ADDR_ANY4 (ip_2_ip4(&ip_addr_any)) + +/** @ingroup ip4addr */ +#define IP_ADDR_BROADCAST (&ip_addr_broadcast) +/** @ingroup ip4addr */ +#define IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast)) + +#endif /* LWIP_IPV4*/ + +#if LWIP_IPV6 + +extern const ip_addr_t ip6_addr_any; + +/** + * @ingroup ip6addr + * IP6_ADDR_ANY can be used as a fixed ip_addr_t + * for the IPv6 wildcard address + */ +#define IP6_ADDR_ANY (&ip6_addr_any) +/** + * @ingroup ip6addr + * IP6_ADDR_ANY6 can be used as a fixed ip6_addr_t + * for the IPv6 wildcard address + */ +#define IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any)) + +#if !LWIP_IPV4 +/** IPv6-only configurations */ +#define IP_ADDR_ANY IP6_ADDR_ANY +#endif /* !LWIP_IPV4 */ + +#endif + +#if LWIP_IPV4 && LWIP_IPV6 +/** @ingroup ipaddr */ +#define IP_ANY_TYPE (&ip_addr_any_type) +#else +#define IP_ANY_TYPE IP_ADDR_ANY +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_IP_ADDR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mem.h new file mode 100644 index 0000000..ff208d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mem.h @@ -0,0 +1,82 @@ +/** + * @file + * Heap API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_MEM_H +#define LWIP_HDR_MEM_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if MEM_LIBC_MALLOC + +#include "lwip/arch.h" + +typedef size_t mem_size_t; +#define MEM_SIZE_F SZT_F + +#elif MEM_USE_POOLS + +typedef u16_t mem_size_t; +#define MEM_SIZE_F U16_F + +#else + +/* MEM_SIZE would have to be aligned, but using 64000 here instead of + * 65535 leaves some room for alignment... + */ +#if MEM_SIZE > 64000L +typedef u32_t mem_size_t; +#define MEM_SIZE_F U32_F +#else +typedef u16_t mem_size_t; +#define MEM_SIZE_F U16_F +#endif /* MEM_SIZE > 64000 */ +#endif + +void mem_init(void); +void *mem_trim(void *mem, mem_size_t size); +void *mem_malloc(mem_size_t size); +void *mem_calloc(mem_size_t count, mem_size_t size); +void mem_free(void *mem); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_MEM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/memp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/memp.h new file mode 100644 index 0000000..68fcd99 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/memp.h @@ -0,0 +1,153 @@ +/** + * @file + * Memory pool API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#ifndef LWIP_HDR_MEMP_H +#define LWIP_HDR_MEMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* run once with empty definition to handle all custom includes in lwippools.h */ +#define LWIP_MEMPOOL(name,num,size,desc) +#include "lwip/priv/memp_std.h" + +/** Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */ +typedef enum { +#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name, +#include "lwip/priv/memp_std.h" + MEMP_MAX +} memp_t; + +#include "lwip/priv/memp_priv.h" +#include "lwip/stats.h" + +extern const struct memp_desc* const memp_pools[MEMP_MAX]; + +/** + * @ingroup mempool + * Declare prototype for private memory pool if it is used in multiple files + */ +#define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name + +#if MEMP_MEM_MALLOC + +#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ + LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ + const struct memp_desc memp_ ## name = { \ + DECLARE_LWIP_MEMPOOL_DESC(desc) \ + LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ + LWIP_MEM_ALIGN_SIZE(size) \ + }; + +#else /* MEMP_MEM_MALLOC */ + +/** + * @ingroup mempool + * Declare a private memory pool + * Private mempools example: + * .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool); + * .c: + * - in global variables section: LWIP_MEMPOOL_DECLARE(my_private_pool, 10, sizeof(foo), "Some description") + * - call ONCE before using pool (e.g. in some init() function): LWIP_MEMPOOL_INIT(my_private_pool); + * - allocate: void* my_new_mem = LWIP_MEMPOOL_ALLOC(my_private_pool); + * - free: LWIP_MEMPOOL_FREE(my_private_pool, my_new_mem); + * + * To relocate a pool, declare it as extern in cc.h. Example for GCC: + * extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_my_private_pool[]; + */ +#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ + LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \ + \ + LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ + \ + static struct memp *memp_tab_ ## name; \ + \ + const struct memp_desc memp_ ## name = { \ + DECLARE_LWIP_MEMPOOL_DESC(desc) \ + LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ + LWIP_MEM_ALIGN_SIZE(size), \ + (num), \ + memp_memory_ ## name ## _base, \ + &memp_tab_ ## name \ + }; + +#endif /* MEMP_MEM_MALLOC */ + +/** + * @ingroup mempool + * Initialize a private memory pool + */ +#define LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name) +/** + * @ingroup mempool + * Allocate from a private memory pool + */ +#define LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name) +/** + * @ingroup mempool + * Free element from a private memory pool + */ +#define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x)) + +#if MEM_USE_POOLS +/** This structure is used to save the pool one element came from. + * This has to be defined here as it is required for pool size calculation. */ +struct memp_malloc_helper +{ + memp_t poolnr; +#if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) + u16_t size; +#endif /* MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) */ +}; +#endif /* MEM_USE_POOLS */ + +void memp_init(void); + +#if MEMP_OVERFLOW_CHECK +void *memp_malloc_fn(memp_t type, const char* file, const int line); +#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__) +#else +void *memp_malloc(memp_t type); +#endif +void memp_free(memp_t type, void *mem); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_MEMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mld6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mld6.h new file mode 100644 index 0000000..7fa0797 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/mld6.h @@ -0,0 +1,99 @@ +/** + * @file + * + * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. + * No support for MLDv2. + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_MLD6_H +#define LWIP_HDR_MLD6_H + +#include "lwip/opt.h" + +#if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** MLD group */ +struct mld_group { + /** next link */ + struct mld_group *next; + /** multicast address */ + ip6_addr_t group_address; + /** signifies we were the last person to report */ + u8_t last_reporter_flag; + /** current state of the group */ + u8_t group_state; + /** timer for reporting */ + u16_t timer; + /** counter of simultaneous uses */ + u8_t use; +}; + +#define MLD6_TMR_INTERVAL 100 /* Milliseconds */ + +err_t mld6_stop(struct netif *netif); +void mld6_report_groups(struct netif *netif); +void mld6_tmr(void); +struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr); +void mld6_input(struct pbuf *p, struct netif *inp); +err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); +err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); +err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); +err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); + +/** @ingroup mld6 + * Get list head of MLD6 groups for netif. + * Note: The allnodes group IP is NOT in the list, since it must always + * be received for correct IPv6 operation. + * @see @ref netif_set_mld_mac_filter() + */ +#define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6_MLD && LWIP_IPV6 */ + +#endif /* LWIP_HDR_MLD6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/nd6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/nd6.h new file mode 100644 index 0000000..8204fa4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/nd6.h @@ -0,0 +1,84 @@ +/** + * @file + * + * Neighbor discovery and stateless address autoconfiguration for IPv6. + * Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 + * (Address autoconfiguration). + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_ND6_H +#define LWIP_HDR_ND6_H + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip6_addr.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** 1 second period */ +#define ND6_TMR_INTERVAL 1000 + +struct pbuf; +struct netif; + +void nd6_tmr(void); +void nd6_input(struct pbuf *p, struct netif *inp); +void nd6_clear_destination_cache(void); +struct netif *nd6_find_route(const ip6_addr_t *ip6addr); +err_t nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp); +u16_t nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif); +#if LWIP_ND6_TCP_REACHABILITY_HINTS +void nd6_reachability_hint(const ip6_addr_t *ip6addr); +#endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */ +void nd6_cleanup_netif(struct netif *netif); +#if LWIP_IPV6_MLD +void nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state); +#endif /* LWIP_IPV6_MLD */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 */ + +#endif /* LWIP_HDR_ND6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netbuf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netbuf.h new file mode 100644 index 0000000..e6865f8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netbuf.h @@ -0,0 +1,118 @@ +/** + * @file + * netbuf API (for netconn API) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_NETBUF_H +#define LWIP_HDR_NETBUF_H + +#include "lwip/opt.h" + +#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ +/* Note: Netconn API is always available when sockets are enabled - + * sockets are implemented on top of them */ + +#include "lwip/pbuf.h" +#include "lwip/ip_addr.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** This netbuf has dest-addr/port set */ +#define NETBUF_FLAG_DESTADDR 0x01 +/** This netbuf includes a checksum */ +#define NETBUF_FLAG_CHKSUM 0x02 + +/** "Network buffer" - contains data and addressing info */ +struct netbuf { + struct pbuf *p, *ptr; + ip_addr_t addr; + u16_t port; +#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY +#if LWIP_CHECKSUM_ON_COPY + u8_t flags; +#endif /* LWIP_CHECKSUM_ON_COPY */ + u16_t toport_chksum; +#if LWIP_NETBUF_RECVINFO + ip_addr_t toaddr; +#endif /* LWIP_NETBUF_RECVINFO */ +#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */ +}; + +/* Network buffer functions: */ +struct netbuf * netbuf_new (void); +void netbuf_delete (struct netbuf *buf); +void * netbuf_alloc (struct netbuf *buf, u16_t size); +void netbuf_free (struct netbuf *buf); +err_t netbuf_ref (struct netbuf *buf, + const void *dataptr, u16_t size); +void netbuf_chain (struct netbuf *head, struct netbuf *tail); + +err_t netbuf_data (struct netbuf *buf, + void **dataptr, u16_t *len); +s8_t netbuf_next (struct netbuf *buf); +void netbuf_first (struct netbuf *buf); + + +#define netbuf_copy_partial(buf, dataptr, len, offset) \ + pbuf_copy_partial((buf)->p, (dataptr), (len), (offset)) +#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) +#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) +#define netbuf_len(buf) ((buf)->p->tot_len) +#define netbuf_fromaddr(buf) (&((buf)->addr)) +#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set(&((buf)->addr), fromaddr) +#define netbuf_fromport(buf) ((buf)->port) +#if LWIP_NETBUF_RECVINFO +#define netbuf_destaddr(buf) (&((buf)->toaddr)) +#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr) +#if LWIP_CHECKSUM_ON_COPY +#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0) +#else /* LWIP_CHECKSUM_ON_COPY */ +#define netbuf_destport(buf) ((buf)->toport_chksum) +#endif /* LWIP_CHECKSUM_ON_COPY */ +#endif /* LWIP_NETBUF_RECVINFO */ +#if LWIP_CHECKSUM_ON_COPY +#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \ + (buf)->toport_chksum = chksum; } while(0) +#endif /* LWIP_CHECKSUM_ON_COPY */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_NETCONN || LWIP_SOCKET */ + +#endif /* LWIP_HDR_NETBUF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netdb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netdb.h new file mode 100644 index 0000000..d3d15df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netdb.h @@ -0,0 +1,150 @@ +/** + * @file + * NETDB API (sockets) + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_NETDB_H +#define LWIP_HDR_NETDB_H + +#include "lwip/opt.h" + +#if LWIP_DNS && LWIP_SOCKET + +#include "lwip/arch.h" +#include "lwip/inet.h" +#include "lwip/sockets.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* some rarely used options */ +#ifndef LWIP_DNS_API_DECLARE_H_ERRNO +#define LWIP_DNS_API_DECLARE_H_ERRNO 1 +#endif + +#ifndef LWIP_DNS_API_DEFINE_ERRORS +#define LWIP_DNS_API_DEFINE_ERRORS 1 +#endif + +#ifndef LWIP_DNS_API_DEFINE_FLAGS +#define LWIP_DNS_API_DEFINE_FLAGS 1 +#endif + +#ifndef LWIP_DNS_API_DECLARE_STRUCTS +#define LWIP_DNS_API_DECLARE_STRUCTS 1 +#endif + +#if LWIP_DNS_API_DEFINE_ERRORS +/** Errors used by the DNS API functions, h_errno can be one of them */ +#define EAI_NONAME 200 +#define EAI_SERVICE 201 +#define EAI_FAIL 202 +#define EAI_MEMORY 203 +#define EAI_FAMILY 204 + +#define HOST_NOT_FOUND 210 +#define NO_DATA 211 +#define NO_RECOVERY 212 +#define TRY_AGAIN 213 +#endif /* LWIP_DNS_API_DEFINE_ERRORS */ + +#if LWIP_DNS_API_DEFINE_FLAGS +/* input flags for struct addrinfo */ +#define AI_PASSIVE 0x01 +#define AI_CANONNAME 0x02 +#define AI_NUMERICHOST 0x04 +#define AI_NUMERICSERV 0x08 +#define AI_V4MAPPED 0x10 +#define AI_ALL 0x20 +#define AI_ADDRCONFIG 0x40 +#endif /* LWIP_DNS_API_DEFINE_FLAGS */ + +#if LWIP_DNS_API_DECLARE_STRUCTS +struct hostent { + char *h_name; /* Official name of the host. */ + char **h_aliases; /* A pointer to an array of pointers to alternative host names, + terminated by a null pointer. */ + int h_addrtype; /* Address type. */ + int h_length; /* The length, in bytes, of the address. */ + char **h_addr_list; /* A pointer to an array of pointers to network addresses (in + network byte order) for the host, terminated by a null pointer. */ +#define h_addr h_addr_list[0] /* for backward compatibility */ +}; + +struct addrinfo { + int ai_flags; /* Input flags. */ + int ai_family; /* Address family of socket. */ + int ai_socktype; /* Socket type. */ + int ai_protocol; /* Protocol of socket. */ + socklen_t ai_addrlen; /* Length of socket address. */ + struct sockaddr *ai_addr; /* Socket address of socket. */ + char *ai_canonname; /* Canonical name of service location. */ + struct addrinfo *ai_next; /* Pointer to next in list. */ +}; +#endif /* LWIP_DNS_API_DECLARE_STRUCTS */ + +#define NETDB_ELEM_SIZE (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1) + +#if LWIP_DNS_API_DECLARE_H_ERRNO +/* application accessible error code set by the DNS API functions */ +extern int h_errno; +#endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ + +struct hostent *lwip_gethostbyname(const char *name); +int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, + size_t buflen, struct hostent **result, int *h_errnop); +void lwip_freeaddrinfo(struct addrinfo *ai); +int lwip_getaddrinfo(const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct addrinfo **res); + +#if LWIP_COMPAT_SOCKETS +/** @ingroup netdbapi */ +#define gethostbyname(name) lwip_gethostbyname(name) +/** @ingroup netdbapi */ +#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ + lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) +/** @ingroup netdbapi */ +#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) +/** @ingroup netdbapi */ +#define getaddrinfo(nodname, servname, hints, res) \ + lwip_getaddrinfo(nodname, servname, hints, res) +#endif /* LWIP_COMPAT_SOCKETS */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_DNS && LWIP_SOCKET */ + +#endif /* LWIP_HDR_NETDB_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netif.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netif.h new file mode 100644 index 0000000..67a2d24 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netif.h @@ -0,0 +1,474 @@ +/** + * @file + * netif API (to be used from TCPIP thread) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_NETIF_H +#define LWIP_HDR_NETIF_H + +#include "lwip/opt.h" + +#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) + +#include "lwip/err.h" + +#include "lwip/ip_addr.h" + +#include "lwip/def.h" +#include "lwip/pbuf.h" +#include "lwip/stats.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Throughout this file, IP addresses are expected to be in + * the same byte order as in IP_PCB. */ + +/** Must be the maximum of all used hardware address lengths + across all types of interfaces in use. + This does not have to be changed, normally. */ +#ifndef NETIF_MAX_HWADDR_LEN +#define NETIF_MAX_HWADDR_LEN 6U +#endif + +/** + * @defgroup netif_flags Flags + * @ingroup netif + * @{ + */ + +/** Whether the network interface is 'up'. This is + * a software flag used to control whether this network + * interface is enabled and processes traffic. + * It must be set by the startup code before this netif can be used + * (also for dhcp/autoip). + */ +#define NETIF_FLAG_UP 0x01U +/** If set, the netif has broadcast capability. + * Set by the netif driver in its init function. */ +#define NETIF_FLAG_BROADCAST 0x02U +/** If set, the interface has an active link + * (set by the network interface driver). + * Either set by the netif driver in its init function (if the link + * is up at that time) or at a later point once the link comes up + * (if link detection is supported by the hardware). */ +#define NETIF_FLAG_LINK_UP 0x04U +/** If set, the netif is an ethernet device using ARP. + * Set by the netif driver in its init function. + * Used to check input packet types and use of DHCP. */ +#define NETIF_FLAG_ETHARP 0x08U +/** If set, the netif is an ethernet device. It might not use + * ARP or TCP/IP if it is used for PPPoE only. + */ +#define NETIF_FLAG_ETHERNET 0x10U +/** If set, the netif has IGMP capability. + * Set by the netif driver in its init function. */ +#define NETIF_FLAG_IGMP 0x20U +/** If set, the netif has MLD6 capability. + * Set by the netif driver in its init function. */ +#define NETIF_FLAG_MLD6 0x40U + +/** + * @} + */ + +enum lwip_internal_netif_client_data_index +{ +#if LWIP_DHCP + LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, +#endif +#if LWIP_AUTOIP + LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP, +#endif +#if LWIP_IGMP + LWIP_NETIF_CLIENT_DATA_INDEX_IGMP, +#endif +#if LWIP_IPV6_MLD + LWIP_NETIF_CLIENT_DATA_INDEX_MLD6, +#endif + LWIP_NETIF_CLIENT_DATA_INDEX_MAX +}; + +#if LWIP_CHECKSUM_CTRL_PER_NETIF +#define NETIF_CHECKSUM_GEN_IP 0x0001 +#define NETIF_CHECKSUM_GEN_UDP 0x0002 +#define NETIF_CHECKSUM_GEN_TCP 0x0004 +#define NETIF_CHECKSUM_GEN_ICMP 0x0008 +#define NETIF_CHECKSUM_GEN_ICMP6 0x0010 +#define NETIF_CHECKSUM_CHECK_IP 0x0100 +#define NETIF_CHECKSUM_CHECK_UDP 0x0200 +#define NETIF_CHECKSUM_CHECK_TCP 0x0400 +#define NETIF_CHECKSUM_CHECK_ICMP 0x0800 +#define NETIF_CHECKSUM_CHECK_ICMP6 0x1000 +#define NETIF_CHECKSUM_ENABLE_ALL 0xFFFF +#define NETIF_CHECKSUM_DISABLE_ALL 0x0000 +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ + +struct netif; + +/** MAC Filter Actions, these are passed to a netif's igmp_mac_filter or + * mld_mac_filter callback function. */ +enum netif_mac_filter_action { + /** Delete a filter entry */ + NETIF_DEL_MAC_FILTER = 0, + /** Add a filter entry */ + NETIF_ADD_MAC_FILTER = 1 +}; + +/** Function prototype for netif init functions. Set up flags and output/linkoutput + * callback functions in this function. + * + * @param netif The netif to initialize + */ +typedef err_t (*netif_init_fn)(struct netif *netif); +/** Function prototype for netif->input functions. This function is saved as 'input' + * callback function in the netif struct. Call it when a packet has been received. + * + * @param p The received packet, copied into a pbuf + * @param inp The netif which received the packet + */ +typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp); + +#if LWIP_IPV4 +/** Function prototype for netif->output functions. Called by lwIP when a packet + * shall be sent. For ethernet netif, set this to 'etharp_output' and set + * 'linkoutput'. + * + * @param netif The netif which shall send a packet + * @param p The packet to send (p->payload points to IP header) + * @param ipaddr The IP address to which the packet shall be sent + */ +typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p, + const ip4_addr_t *ipaddr); +#endif /* LWIP_IPV4*/ + +#if LWIP_IPV6 +/** Function prototype for netif->output_ip6 functions. Called by lwIP when a packet + * shall be sent. For ethernet netif, set this to 'ethip6_output' and set + * 'linkoutput'. + * + * @param netif The netif which shall send a packet + * @param p The packet to send (p->payload points to IP header) + * @param ipaddr The IPv6 address to which the packet shall be sent + */ +typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p, + const ip6_addr_t *ipaddr); +#endif /* LWIP_IPV6 */ + +/** Function prototype for netif->linkoutput functions. Only used for ethernet + * netifs. This function is called by ARP when a packet shall be sent. + * + * @param netif The netif which shall send a packet + * @param p The packet to send (raw ethernet packet) + */ +typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p); +/** Function prototype for netif status- or link-callback functions. */ +typedef void (*netif_status_callback_fn)(struct netif *netif); +#if LWIP_IPV4 && LWIP_IGMP +/** Function prototype for netif igmp_mac_filter functions */ +typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif, + const ip4_addr_t *group, enum netif_mac_filter_action action); +#endif /* LWIP_IPV4 && LWIP_IGMP */ +#if LWIP_IPV6 && LWIP_IPV6_MLD +/** Function prototype for netif mld_mac_filter functions */ +typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif, + const ip6_addr_t *group, enum netif_mac_filter_action action); +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ + +#if LWIP_DHCP || LWIP_AUTOIP || LWIP_IGMP || LWIP_IPV6_MLD || (LWIP_NUM_NETIF_CLIENT_DATA > 0) +u8_t netif_alloc_client_data_id(void); +/** @ingroup netif_cd + * Set client data. Obtain ID from netif_alloc_client_data_id(). + */ +#define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data) +/** @ingroup netif_cd + * Get client data. Obtain ID from netif_alloc_client_data_id(). + */ +#define netif_get_client_data(netif, id) (netif)->client_data[(id)] +#endif /* LWIP_DHCP || LWIP_AUTOIP || (LWIP_NUM_NETIF_CLIENT_DATA > 0) */ + +/** Generic data structure used for all lwIP network interfaces. + * The following fields should be filled in by the initialization + * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */ +struct netif { + /** pointer to next in linked list */ + struct netif *next; + +#if LWIP_IPV4 + /** IP address configuration in network byte order */ + ip_addr_t ip_addr; + ip_addr_t netmask; + ip_addr_t gw; +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + /** Array of IPv6 addresses for this netif. */ + ip_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES]; + /** The state of each IPv6 address (Tentative, Preferred, etc). + * @see ip6_addr.h */ + u8_t ip6_addr_state[LWIP_IPV6_NUM_ADDRESSES]; +#endif /* LWIP_IPV6 */ + /** This function is called by the network device driver + * to pass a packet up the TCP/IP stack. */ + netif_input_fn input; +#if LWIP_IPV4 + /** This function is called by the IP module when it wants + * to send a packet on the interface. This function typically + * first resolves the hardware address, then sends the packet. + * For ethernet physical layer, this is usually etharp_output() */ + netif_output_fn output; +#endif /* LWIP_IPV4 */ + /** This function is called by ethernet_output() when it wants + * to send a packet on the interface. This function outputs + * the pbuf as-is on the link medium. */ + netif_linkoutput_fn linkoutput; +#if LWIP_IPV6 + /** This function is called by the IPv6 module when it wants + * to send a packet on the interface. This function typically + * first resolves the hardware address, then sends the packet. + * For ethernet physical layer, this is usually ethip6_output() */ + netif_output_ip6_fn output_ip6; +#endif /* LWIP_IPV6 */ +#if LWIP_NETIF_STATUS_CALLBACK + /** This function is called when the netif state is set to up or down + */ + netif_status_callback_fn status_callback; +#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#if LWIP_NETIF_LINK_CALLBACK + /** This function is called when the netif link is set to up or down + */ + netif_status_callback_fn link_callback; +#endif /* LWIP_NETIF_LINK_CALLBACK */ +#if LWIP_NETIF_REMOVE_CALLBACK + /** This function is called when the netif has been removed */ + netif_status_callback_fn remove_callback; +#endif /* LWIP_NETIF_REMOVE_CALLBACK */ + /** This field can be set by the device driver and could point + * to state information for the device. */ + void *state; +#ifdef netif_get_client_data + void* client_data[LWIP_NETIF_CLIENT_DATA_INDEX_MAX + LWIP_NUM_NETIF_CLIENT_DATA]; +#endif +#if LWIP_IPV6_AUTOCONFIG + /** is this netif enabled for IPv6 autoconfiguration */ + u8_t ip6_autoconfig_enabled; +#endif /* LWIP_IPV6_AUTOCONFIG */ +#if LWIP_IPV6_SEND_ROUTER_SOLICIT + /** Number of Router Solicitation messages that remain to be sent. */ + u8_t rs_count; +#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */ +#if LWIP_NETIF_HOSTNAME + /* the hostname for this netif, NULL is a valid value */ + const char* hostname; +#endif /* LWIP_NETIF_HOSTNAME */ +#if LWIP_CHECKSUM_CTRL_PER_NETIF + u16_t chksum_flags; +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF*/ + /** maximum transfer unit (in bytes) */ + u16_t mtu; + /** number of bytes used in hwaddr */ + u8_t hwaddr_len; + /** link level hardware address of this interface */ + u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; + /** flags (@see @ref netif_flags) */ + u8_t flags; + /** descriptive abbreviation */ + char name[2]; + /** number of this interface */ + u8_t num; +#if MIB2_STATS + /** link type (from "snmp_ifType" enum from snmp_mib2.h) */ + u8_t link_type; + /** (estimate) link speed */ + u32_t link_speed; + /** timestamp at last change made (up/down) */ + u32_t ts; + /** counters */ + struct stats_mib2_netif_ctrs mib2_counters; +#endif /* MIB2_STATS */ +#if LWIP_IPV4 && LWIP_IGMP + /** This function could be called to add or delete an entry in the multicast + filter table of the ethernet MAC.*/ + netif_igmp_mac_filter_fn igmp_mac_filter; +#endif /* LWIP_IPV4 && LWIP_IGMP */ +#if LWIP_IPV6 && LWIP_IPV6_MLD + /** This function could be called to add or delete an entry in the IPv6 multicast + filter table of the ethernet MAC. */ + netif_mld_mac_filter_fn mld_mac_filter; +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ +#if LWIP_NETIF_HWADDRHINT + u8_t *addr_hint; +#endif /* LWIP_NETIF_HWADDRHINT */ +#if ENABLE_LOOPBACK + /* List of packets to be queued for ourselves. */ + struct pbuf *loop_first; + struct pbuf *loop_last; +#if LWIP_LOOPBACK_MAX_PBUFS + u16_t loop_cnt_current; +#endif /* LWIP_LOOPBACK_MAX_PBUFS */ +#endif /* ENABLE_LOOPBACK */ +}; + +#if LWIP_CHECKSUM_CTRL_PER_NETIF +#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \ + (netif)->chksum_flags = chksumflags; } while(0) +#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0)) +#else /* LWIP_CHECKSUM_CTRL_PER_NETIF */ +#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) +#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) +#endif /* LWIP_CHECKSUM_CTRL_PER_NETIF */ + +/** The list of network interfaces. */ +extern struct netif *netif_list; +/** The default network interface. */ +extern struct netif *netif_default; + +void netif_init(void); + +struct netif *netif_add(struct netif *netif, +#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, +#endif /* LWIP_IPV4 */ + void *state, netif_init_fn init, netif_input_fn input); +#if LWIP_IPV4 +void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, + const ip4_addr_t *gw); +#endif /* LWIP_IPV4 */ +void netif_remove(struct netif * netif); + +/* Returns a network interface given its name. The name is of the form + "et0", where the first two letters are the "name" field in the + netif structure, and the digit is in the num field in the same + structure. */ +struct netif *netif_find(const char *name); + +void netif_set_default(struct netif *netif); + +#if LWIP_IPV4 +void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); +void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); +void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); +/** @ingroup netif_ip4 */ +#define netif_ip4_addr(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr))) +/** @ingroup netif_ip4 */ +#define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask))) +/** @ingroup netif_ip4 */ +#define netif_ip4_gw(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw))) +/** @ingroup netif_ip4 */ +#define netif_ip_addr4(netif) ((const ip_addr_t*)&((netif)->ip_addr)) +/** @ingroup netif_ip4 */ +#define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask)) +/** @ingroup netif_ip4 */ +#define netif_ip_gw4(netif) ((const ip_addr_t*)&((netif)->gw)) +#endif /* LWIP_IPV4 */ + +void netif_set_up(struct netif *netif); +void netif_set_down(struct netif *netif); +/** @ingroup netif + * Ask if an interface is up + */ +#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) + +#if LWIP_NETIF_STATUS_CALLBACK +void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback); +#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#if LWIP_NETIF_REMOVE_CALLBACK +void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback); +#endif /* LWIP_NETIF_REMOVE_CALLBACK */ + +void netif_set_link_up(struct netif *netif); +void netif_set_link_down(struct netif *netif); +/** Ask if a link is up */ +#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) + +#if LWIP_NETIF_LINK_CALLBACK +void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback); +#endif /* LWIP_NETIF_LINK_CALLBACK */ + +#if LWIP_NETIF_HOSTNAME +/** @ingroup netif */ +#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) +/** @ingroup netif */ +#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) +#endif /* LWIP_NETIF_HOSTNAME */ + +#if LWIP_IGMP +/** @ingroup netif */ +#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) +#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL) +#endif /* LWIP_IGMP */ + +#if LWIP_IPV6 && LWIP_IPV6_MLD +/** @ingroup netif */ +#define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0) +#define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL) +#define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0) +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ + +#if ENABLE_LOOPBACK +err_t netif_loop_output(struct netif *netif, struct pbuf *p); +void netif_poll(struct netif *netif); +#if !LWIP_NETIF_LOOPBACK_MULTITHREADING +void netif_poll_all(void); +#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#endif /* ENABLE_LOOPBACK */ + +err_t netif_input(struct pbuf *p, struct netif *inp); + +#if LWIP_IPV6 +/** @ingroup netif_ip6 */ +#define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i]))) +/** @ingroup netif_ip6 */ +#define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i]))) +void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6); +void netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3); +#define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i]) +void netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state); +s8_t netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr); +void netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit); +err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx); +#define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0) +#endif /* LWIP_IPV6 */ + +#if LWIP_NETIF_HWADDRHINT +#define NETIF_SET_HWADDRHINT(netif, hint) ((netif)->addr_hint = (hint)) +#else /* LWIP_NETIF_HWADDRHINT */ +#define NETIF_SET_HWADDRHINT(netif, hint) +#endif /* LWIP_NETIF_HWADDRHINT */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_NETIF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netifapi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netifapi.h new file mode 100644 index 0000000..8bd2b4f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/netifapi.h @@ -0,0 +1,140 @@ +/** + * @file + * netif API (to be used from non-TCPIP threads) + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ +#ifndef LWIP_HDR_NETIFAPI_H +#define LWIP_HDR_NETIFAPI_H + +#include "lwip/opt.h" + +#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/sys.h" +#include "lwip/netif.h" +#include "lwip/dhcp.h" +#include "lwip/autoip.h" +#include "lwip/priv/tcpip_priv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_MPU_COMPATIBLE +#define NETIFAPI_IPADDR_DEF(type, m) type m +#else /* LWIP_MPU_COMPATIBLE */ +#define NETIFAPI_IPADDR_DEF(type, m) const type * m +#endif /* LWIP_MPU_COMPATIBLE */ + +typedef void (*netifapi_void_fn)(struct netif *netif); +typedef err_t (*netifapi_errt_fn)(struct netif *netif); + +struct netifapi_msg { + struct tcpip_api_call_data call; + struct netif *netif; + union { + struct { +#if LWIP_IPV4 + NETIFAPI_IPADDR_DEF(ip4_addr_t, ipaddr); + NETIFAPI_IPADDR_DEF(ip4_addr_t, netmask); + NETIFAPI_IPADDR_DEF(ip4_addr_t, gw); +#endif /* LWIP_IPV4 */ + void *state; + netif_init_fn init; + netif_input_fn input; + } add; + struct { + netifapi_void_fn voidfunc; + netifapi_errt_fn errtfunc; + } common; + } msg; +}; + + +/* API for application */ +err_t netifapi_netif_add(struct netif *netif, +#if LWIP_IPV4 + const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, +#endif /* LWIP_IPV4 */ + void *state, netif_init_fn init, netif_input_fn input); + +#if LWIP_IPV4 +err_t netifapi_netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, + const ip4_addr_t *netmask, const ip4_addr_t *gw); +#endif /* LWIP_IPV4*/ + +err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc, + netifapi_errt_fn errtfunc); + +/** @ingroup netifapi_netif */ +#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL) +/** @ingroup netifapi_netif */ +#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL) +/** @ingroup netifapi_netif */ +#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL) +/** @ingroup netifapi_netif */ +#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL) +/** @ingroup netifapi_netif */ +#define netifapi_netif_set_link_up(n) netifapi_netif_common(n, netif_set_link_up, NULL) +/** @ingroup netifapi_netif */ +#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) + +/** + * @defgroup netifapi_dhcp4 DHCPv4 + * @ingroup netifapi + * To be called from non-TCPIP threads + */ +/** @ingroup netifapi_dhcp4 */ +#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start) +/** @ingroup netifapi_dhcp4 */ +#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL) +/** @ingroup netifapi_dhcp4 */ +#define netifapi_dhcp_inform(n) netifapi_netif_common(n, dhcp_inform, NULL) +/** @ingroup netifapi_dhcp4 */ +#define netifapi_dhcp_renew(n) netifapi_netif_common(n, NULL, dhcp_renew) +/** @ingroup netifapi_dhcp4 */ +#define netifapi_dhcp_release(n) netifapi_netif_common(n, NULL, dhcp_release) + +/** + * @defgroup netifapi_autoip AUTOIP + * @ingroup netifapi + * To be called from non-TCPIP threads + */ +/** @ingroup netifapi_autoip */ +#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start) +/** @ingroup netifapi_autoip */ +#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_NETIF_API */ + +#endif /* LWIP_HDR_NETIFAPI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/opt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/opt.h new file mode 100644 index 0000000..fd459af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/opt.h @@ -0,0 +1,2876 @@ +/** + * @file + * + * lwIP Options Configuration + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +/* + * NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug - + * without this, doxygen does not see the actual #define + */ + +#if !defined LWIP_HDR_OPT_H +#define LWIP_HDR_OPT_H + +/* + * Include user defined options first. Anything not defined in these files + * will be set to standard values. Override anything you don't like! + */ +#include "lwipopts.h" +#include "lwip/debug.h" + +/** + * @defgroup lwip_opts Options (lwipopts.h) + * @ingroup lwip + * + * @defgroup lwip_opts_debug Debugging + * @ingroup lwip_opts + * + * @defgroup lwip_opts_infrastructure Infrastructure + * @ingroup lwip_opts + * + * @defgroup lwip_opts_callback Callback-style APIs + * @ingroup lwip_opts + * + * @defgroup lwip_opts_threadsafe_apis Thread-safe APIs + * @ingroup lwip_opts + */ + + /* + ------------------------------------ + -------------- NO SYS -------------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_nosys NO_SYS + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * NO_SYS==1: Use lwIP without OS-awareness (no thread, semaphores, mutexes or + * mboxes). This means threaded APIs cannot be used (socket, netconn, + * i.e. everything in the 'api' folder), only the callback-style raw API is + * available (and you have to watch out for yourself that you don't access + * lwIP functions/structures from more than one context at a time!) + */ +#if !defined NO_SYS || defined __DOXYGEN__ +#define NO_SYS 0 +#endif +/** + * @} + */ + +/** + * @defgroup lwip_opts_timers Timers + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * LWIP_TIMERS==0: Drop support for sys_timeout and lwip-internal cyclic timers. + * (the array of lwip-internal cyclic timers is still provided) + * (check NO_SYS_NO_TIMERS for compatibility to old versions) + */ +#if !defined LWIP_TIMERS || defined __DOXYGEN__ +#ifdef NO_SYS_NO_TIMERS +#define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) +#else +#define LWIP_TIMERS 1 +#endif +#endif + +/** + * LWIP_TIMERS_CUSTOM==1: Provide your own timer implementation. + * Function prototypes in timeouts.h and the array of lwip-internal cyclic timers + * are still included, but the implementation is not. The following functions + * will be required: sys_timeouts_init(), sys_timeout(), sys_untimeout(), + * sys_timeouts_mbox_fetch() + */ +#if !defined LWIP_TIMERS_CUSTOM || defined __DOXYGEN__ +#define LWIP_TIMERS_CUSTOM 0 +#endif +/** + * @} + */ + +/** + * @defgroup lwip_opts_memcpy memcpy + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * MEMCPY: override this if you have a faster implementation at hand than the + * one included in your C library + */ +#if !defined MEMCPY || defined __DOXYGEN__ +#define MEMCPY(dst,src,len) memcpy(dst,src,len) +#endif + +/** + * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a + * call to memcpy() if the length is known at compile time and is small. + */ +#if !defined SMEMCPY || defined __DOXYGEN__ +#define SMEMCPY(dst,src,len) memcpy(dst,src,len) +#endif +/** + * @} + */ + +/* + ------------------------------------ + ----------- Core locking ----------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_lock Core locking and MPU + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * LWIP_MPU_COMPATIBLE: enables special memory management mechanism + * which makes lwip able to work on MPU (Memory Protection Unit) system + * by not passing stack-pointers to other threads + * (this decreases performance as memory is allocated from pools instead + * of keeping it on the stack) + */ +#if !defined LWIP_MPU_COMPATIBLE || defined __DOXYGEN__ +#define LWIP_MPU_COMPATIBLE 0 +#endif + +/** + * LWIP_TCPIP_CORE_LOCKING + * Creates a global mutex that is held during TCPIP thread operations. + * Can be locked by client code to perform lwIP operations without changing + * into TCPIP thread using callbacks. See LOCK_TCPIP_CORE() and + * UNLOCK_TCPIP_CORE(). + * Your system should provide mutexes supporting priority inversion to use this. + */ +#if !defined LWIP_TCPIP_CORE_LOCKING || defined __DOXYGEN__ +#define LWIP_TCPIP_CORE_LOCKING 1 +#endif + +/** + * LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled, + * this lets tcpip_input() grab the mutex for input packets as well, + * instead of allocating a message and passing it to tcpip_thread. + * + * ATTENTION: this does not work when tcpip_input() is called from + * interrupt context! + */ +#if !defined LWIP_TCPIP_CORE_LOCKING_INPUT || defined __DOXYGEN__ +#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 +#endif + +/** + * SYS_LIGHTWEIGHT_PROT==1: enable inter-task protection (and task-vs-interrupt + * protection) for certain critical regions during buffer allocation, deallocation + * and memory allocation and deallocation. + * ATTENTION: This is required when using lwIP from more than one context! If + * you disable this, you must be sure what you are doing! + */ +#if !defined SYS_LIGHTWEIGHT_PROT || defined __DOXYGEN__ +#define SYS_LIGHTWEIGHT_PROT 1 +#endif +/** + * @} + */ + +/* + ------------------------------------ + ---------- Memory options ---------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_mem Heap and memory pools + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library + * instead of the lwip internal allocator. Can save code size if you + * already use it. + */ +#if !defined MEM_LIBC_MALLOC || defined __DOXYGEN__ +#define MEM_LIBC_MALLOC 0 +#endif + +/** + * MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. + * Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution + * speed (heap alloc can be much slower than pool alloc) and usage from interrupts + * (especially if your netif driver allocates PBUF_POOL pbufs for received frames + * from interrupt)! + * ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, + * not only for internal pools defined in memp_std.h)! + */ +#if !defined MEMP_MEM_MALLOC || defined __DOXYGEN__ +#define MEMP_MEM_MALLOC 0 +#endif + +/** + * MEM_ALIGNMENT: should be set to the alignment of the CPU + * 4 byte alignment -> \#define MEM_ALIGNMENT 4 + * 2 byte alignment -> \#define MEM_ALIGNMENT 2 + */ +#if !defined MEM_ALIGNMENT || defined __DOXYGEN__ +#define MEM_ALIGNMENT 1 +#endif + +/** + * MEM_SIZE: the size of the heap memory. If the application will send + * a lot of data that needs to be copied, this should be set high. + */ +#if !defined MEM_SIZE || defined __DOXYGEN__ +#define MEM_SIZE 1600 +#endif + +/** + * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable + * amount of bytes before and after each memp element in every pool and fills + * it with a prominent default value. + * MEMP_OVERFLOW_CHECK == 0 no checking + * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed + * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time + * memp_malloc() or memp_free() is called (useful but slow!) + */ +#if !defined MEMP_OVERFLOW_CHECK || defined __DOXYGEN__ +#define MEMP_OVERFLOW_CHECK 0 +#endif + +/** + * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make + * sure that there are no cycles in the linked lists. + */ +#if !defined MEMP_SANITY_CHECK || defined __DOXYGEN__ +#define MEMP_SANITY_CHECK 0 +#endif + +/** + * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set + * of memory pools of various sizes. When mem_malloc is called, an element of + * the smallest pool that can provide the length needed is returned. + * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. + */ +#if !defined MEM_USE_POOLS || defined __DOXYGEN__ +#define MEM_USE_POOLS 0 +#endif + +/** + * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next + * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more + * reliable. */ +#if !defined MEM_USE_POOLS_TRY_BIGGER_POOL || defined __DOXYGEN__ +#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 +#endif + +/** + * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h + * that defines additional pools beyond the "standard" ones required + * by lwIP. If you set this to 1, you must have lwippools.h in your + * include path somewhere. + */ +#if !defined MEMP_USE_CUSTOM_POOLS || defined __DOXYGEN__ +#define MEMP_USE_CUSTOM_POOLS 0 +#endif + +/** + * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from + * interrupt context (or another context that doesn't allow waiting for a + * semaphore). + * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, + * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs + * with each loop so that mem_free can run. + * + * ATTENTION: As you can see from the above description, this leads to dis-/ + * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc + * can need longer. + * + * If you don't want that, at least for NO_SYS=0, you can still use the following + * functions to enqueue a deallocation call which then runs in the tcpip_thread + * context: + * - pbuf_free_callback(p); + * - mem_free_callback(m); + */ +#if !defined LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT || defined __DOXYGEN__ +#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 +#endif +/** + * @} + */ + +/* + ------------------------------------------------ + ---------- Internal Memory Pool Sizes ---------- + ------------------------------------------------ +*/ +/** + * @defgroup lwip_opts_memp Internal memory pools + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). + * If the application sends a lot of data out of ROM (or other static memory), + * this should be set high. + */ +#if !defined MEMP_NUM_PBUF || defined __DOXYGEN__ +#define MEMP_NUM_PBUF 16 +#endif + +/** + * MEMP_NUM_RAW_PCB: Number of raw connection PCBs + * (requires the LWIP_RAW option) + */ +#if !defined MEMP_NUM_RAW_PCB || defined __DOXYGEN__ +#define MEMP_NUM_RAW_PCB 4 +#endif + +/** + * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One + * per active UDP "connection". + * (requires the LWIP_UDP option) + */ +#if !defined MEMP_NUM_UDP_PCB || defined __DOXYGEN__ +#define MEMP_NUM_UDP_PCB 4 +#endif + +/** + * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. + * (requires the LWIP_TCP option) + */ +#if !defined MEMP_NUM_TCP_PCB || defined __DOXYGEN__ +#define MEMP_NUM_TCP_PCB 5 +#endif + +/** + * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. + * (requires the LWIP_TCP option) + */ +#if !defined MEMP_NUM_TCP_PCB_LISTEN || defined __DOXYGEN__ +#define MEMP_NUM_TCP_PCB_LISTEN 8 +#endif + +/** + * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. + * (requires the LWIP_TCP option) + */ +#if !defined MEMP_NUM_TCP_SEG || defined __DOXYGEN__ +#define MEMP_NUM_TCP_SEG 16 +#endif + +/** + * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for + * reassembly (whole packets, not fragments!) + */ +#if !defined MEMP_NUM_REASSDATA || defined __DOXYGEN__ +#define MEMP_NUM_REASSDATA 5 +#endif + +/** + * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent + * (fragments, not whole packets!). + * This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 + * with DMA-enabled MACs where the packet is not yet sent when netif->output + * returns. + */ +#if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__ +#define MEMP_NUM_FRAG_PBUF 15 +#endif + +/** + * MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing + * packets (pbufs) that are waiting for an ARP request (to resolve + * their destination address) to finish. + * (requires the ARP_QUEUEING option) + */ +#if !defined MEMP_NUM_ARP_QUEUE || defined __DOXYGEN__ +#define MEMP_NUM_ARP_QUEUE 30 +#endif + +/** + * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces + * can be members at the same time (one per netif - allsystems group -, plus one + * per netif membership). + * (requires the LWIP_IGMP option) + */ +#if !defined MEMP_NUM_IGMP_GROUP || defined __DOXYGEN__ +#define MEMP_NUM_IGMP_GROUP 8 +#endif + +/** + * MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active timeouts. + * The default number of timeouts is calculated here for all enabled modules. + * The formula expects settings to be either '0' or '1'. + */ +#if !defined MEMP_NUM_SYS_TIMEOUT || defined __DOXYGEN__ +#define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + (PPP_SUPPORT*6*MEMP_NUM_PPP_PCB) + (LWIP_IPV6 ? (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD) : 0)) +#endif + +/** + * MEMP_NUM_NETBUF: the number of struct netbufs. + * (only needed if you use the sequential API, like api_lib.c) + */ +#if !defined MEMP_NUM_NETBUF || defined __DOXYGEN__ +#define MEMP_NUM_NETBUF 2 +#endif + +/** + * MEMP_NUM_NETCONN: the number of struct netconns. + * (only needed if you use the sequential API, like api_lib.c) + */ +#if !defined MEMP_NUM_NETCONN || defined __DOXYGEN__ +#define MEMP_NUM_NETCONN 4 +#endif + +/** + * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used + * for callback/timeout API communication. + * (only needed if you use tcpip.c) + */ +#if !defined MEMP_NUM_TCPIP_MSG_API || defined __DOXYGEN__ +#define MEMP_NUM_TCPIP_MSG_API 8 +#endif + +/** + * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used + * for incoming packets. + * (only needed if you use tcpip.c) + */ +#if !defined MEMP_NUM_TCPIP_MSG_INPKT || defined __DOXYGEN__ +#define MEMP_NUM_TCPIP_MSG_INPKT 8 +#endif + +/** + * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls + * (before freeing the corresponding memory using lwip_freeaddrinfo()). + */ +#if !defined MEMP_NUM_NETDB || defined __DOXYGEN__ +#define MEMP_NUM_NETDB 1 +#endif + +/** + * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list + * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. + */ +#if !defined MEMP_NUM_LOCALHOSTLIST || defined __DOXYGEN__ +#define MEMP_NUM_LOCALHOSTLIST 1 +#endif + +/** + * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. + */ +#if !defined PBUF_POOL_SIZE || defined __DOXYGEN__ +#define PBUF_POOL_SIZE 16 +#endif + +/** MEMP_NUM_API_MSG: the number of concurrently active calls to various + * socket, netconn, and tcpip functions + */ +#if !defined MEMP_NUM_API_MSG || defined __DOXYGEN__ +#define MEMP_NUM_API_MSG MEMP_NUM_TCPIP_MSG_API +#endif + +/** MEMP_NUM_DNS_API_MSG: the number of concurrently active calls to netconn_gethostbyname + */ +#if !defined MEMP_NUM_DNS_API_MSG || defined __DOXYGEN__ +#define MEMP_NUM_DNS_API_MSG MEMP_NUM_TCPIP_MSG_API +#endif + +/** MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA: the number of concurrently active calls + * to getsockopt/setsockopt + */ +#if !defined MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA || defined __DOXYGEN__ +#define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API +#endif + +/** MEMP_NUM_NETIFAPI_MSG: the number of concurrently active calls to the + * netifapi functions + */ +#if !defined MEMP_NUM_NETIFAPI_MSG || defined __DOXYGEN__ +#define MEMP_NUM_NETIFAPI_MSG MEMP_NUM_TCPIP_MSG_API +#endif +/** + * @} + */ + +/* + --------------------------------- + ---------- ARP options ---------- + --------------------------------- +*/ +/** + * @defgroup lwip_opts_arp ARP + * @ingroup lwip_opts_ipv4 + * @{ + */ +/** + * LWIP_ARP==1: Enable ARP functionality. + */ +#if !defined LWIP_ARP || defined __DOXYGEN__ +#define LWIP_ARP 1 +#endif + +/** + * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. + */ +#if !defined ARP_TABLE_SIZE || defined __DOXYGEN__ +#define ARP_TABLE_SIZE 10 +#endif + +/** the time an ARP entry stays valid after its last update, + * for ARP_TMR_INTERVAL = 1000, this is + * (60 * 5) seconds = 5 minutes. + */ +#if !defined ARP_MAXAGE || defined __DOXYGEN__ +#define ARP_MAXAGE 300 +#endif + +/** + * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address + * resolution. By default, only the most recent packet is queued per IP address. + * This is sufficient for most protocols and mainly reduces TCP connection + * startup time. Set this to 1 if you know your application sends more than one + * packet in a row to an IP address that is not in the ARP cache. + */ +#if !defined ARP_QUEUEING || defined __DOXYGEN__ +#define ARP_QUEUEING 0 +#endif + +/** The maximum number of packets which may be queued for each + * unresolved address by other network layers. Defaults to 3, 0 means disabled. + * Old packets are dropped, new packets are queued. + */ +#if !defined ARP_QUEUE_LEN || defined __DOXYGEN__ +#define ARP_QUEUE_LEN 3 +#endif + +/** + * ETHARP_SUPPORT_VLAN==1: support receiving and sending ethernet packets with + * VLAN header. See the description of LWIP_HOOK_VLAN_CHECK and + * LWIP_HOOK_VLAN_SET hooks to check/set VLAN headers. + * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. + * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. + * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. + * Alternatively, define a function/define ETHARP_VLAN_CHECK_FN(eth_hdr, vlan) + * that returns 1 to accept a packet or 0 to drop a packet. + */ +#if !defined ETHARP_SUPPORT_VLAN || defined __DOXYGEN__ +#define ETHARP_SUPPORT_VLAN 0 +#endif + +/** LWIP_ETHERNET==1: enable ethernet support even though ARP might be disabled + */ +#if !defined LWIP_ETHERNET || defined __DOXYGEN__ +#define LWIP_ETHERNET LWIP_ARP +#endif + +/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure + * alignment of payload after that header. Since the header is 14 bytes long, + * without this padding e.g. addresses in the IP header will not be aligned + * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. + */ +#if !defined ETH_PAD_SIZE || defined __DOXYGEN__ +#define ETH_PAD_SIZE 0 +#endif + +/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table + * entries (using etharp_add_static_entry/etharp_remove_static_entry). + */ +#if !defined ETHARP_SUPPORT_STATIC_ENTRIES || defined __DOXYGEN__ +#define ETHARP_SUPPORT_STATIC_ENTRIES 0 +#endif + +/** ETHARP_TABLE_MATCH_NETIF==1: Match netif for ARP table entries. + * If disabled, duplicate IP address on multiple netifs are not supported + * (but this should only occur for AutoIP). + */ +#if !defined ETHARP_TABLE_MATCH_NETIF || defined __DOXYGEN__ +#define ETHARP_TABLE_MATCH_NETIF 0 +#endif +/** + * @} + */ + +/* + -------------------------------- + ---------- IP options ---------- + -------------------------------- +*/ +/** + * @defgroup lwip_opts_ipv4 IPv4 + * @ingroup lwip_opts + * @{ + */ +/** + * LWIP_IPV4==1: Enable IPv4 + */ +#if !defined LWIP_IPV4 || defined __DOXYGEN__ +#define LWIP_IPV4 1 +#endif + +/** + * IP_FORWARD==1: Enables the ability to forward IP packets across network + * interfaces. If you are going to run lwIP on a device with only one network + * interface, define this to 0. + */ +#if !defined IP_FORWARD || defined __DOXYGEN__ +#define IP_FORWARD 0 +#endif + +/** + * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that + * this option does not affect outgoing packet sizes, which can be controlled + * via IP_FRAG. + */ +#if !defined IP_REASSEMBLY || defined __DOXYGEN__ +#define IP_REASSEMBLY 1 +#endif + +/** + * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note + * that this option does not affect incoming packet sizes, which can be + * controlled via IP_REASSEMBLY. + */ +#if !defined IP_FRAG || defined __DOXYGEN__ +#define IP_FRAG 1 +#endif + +#if !LWIP_IPV4 +/* disable IPv4 extensions when IPv4 is disabled */ +#undef IP_FORWARD +#define IP_FORWARD 0 +#undef IP_REASSEMBLY +#define IP_REASSEMBLY 0 +#undef IP_FRAG +#define IP_FRAG 0 +#endif /* !LWIP_IPV4 */ + +/** + * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. + * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. + * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). + */ +#if !defined IP_OPTIONS_ALLOWED || defined __DOXYGEN__ +#define IP_OPTIONS_ALLOWED 1 +#endif + +/** + * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) + * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived + * in this time, the whole packet is discarded. + */ +#if !defined IP_REASS_MAXAGE || defined __DOXYGEN__ +#define IP_REASS_MAXAGE 3 +#endif + +/** + * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. + * Since the received pbufs are enqueued, be sure to configure + * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive + * packets even if the maximum amount of fragments is enqueued for reassembly! + */ +#if !defined IP_REASS_MAX_PBUFS || defined __DOXYGEN__ +#define IP_REASS_MAX_PBUFS 10 +#endif + +/** + * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. + */ +#if !defined IP_DEFAULT_TTL || defined __DOXYGEN__ +#define IP_DEFAULT_TTL 255 +#endif + +/** + * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast + * filter per pcb on udp and raw send operations. To enable broadcast filter + * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. + */ +#if !defined IP_SOF_BROADCAST || defined __DOXYGEN__ +#define IP_SOF_BROADCAST 0 +#endif + +/** + * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast + * filter on recv operations. + */ +#if !defined IP_SOF_BROADCAST_RECV || defined __DOXYGEN__ +#define IP_SOF_BROADCAST_RECV 0 +#endif + +/** + * IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1: allow ip_forward() to send packets back + * out on the netif where it was received. This should only be used for + * wireless networks. + * ATTENTION: When this is 1, make sure your netif driver correctly marks incoming + * link-layer-broadcast/multicast packets as such using the corresponding pbuf flags! + */ +#if !defined IP_FORWARD_ALLOW_TX_ON_RX_NETIF || defined __DOXYGEN__ +#define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0 +#endif + +/** + * LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS==1: randomize the local port for the first + * local TCP/UDP pcb (default==0). This can prevent creating predictable port + * numbers after booting a device. + */ +#if !defined LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS || defined __DOXYGEN__ +#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 0 +#endif +/** + * @} + */ + +/* + ---------------------------------- + ---------- ICMP options ---------- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_icmp ICMP + * @ingroup lwip_opts_ipv4 + * @{ + */ +/** + * LWIP_ICMP==1: Enable ICMP module inside the IP stack. + * Be careful, disable that make your product non-compliant to RFC1122 + */ +#if !defined LWIP_ICMP || defined __DOXYGEN__ +#define LWIP_ICMP 1 +#endif + +/** + * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. + */ +#if !defined ICMP_TTL || defined __DOXYGEN__ +#define ICMP_TTL (IP_DEFAULT_TTL) +#endif + +/** + * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) + */ +#if !defined LWIP_BROADCAST_PING || defined __DOXYGEN__ +#define LWIP_BROADCAST_PING 0 +#endif + +/** + * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) + */ +#if !defined LWIP_MULTICAST_PING || defined __DOXYGEN__ +#define LWIP_MULTICAST_PING 0 +#endif +/** + * @} + */ + +/* + --------------------------------- + ---------- RAW options ---------- + --------------------------------- +*/ +/** + * @defgroup lwip_opts_raw RAW + * @ingroup lwip_opts_callback + * @{ + */ +/** + * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. + */ +#if !defined LWIP_RAW || defined __DOXYGEN__ +#define LWIP_RAW 0 +#endif + +/** + * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. + */ +#if !defined RAW_TTL || defined __DOXYGEN__ +#define RAW_TTL (IP_DEFAULT_TTL) +#endif +/** + * @} + */ + +/* + ---------------------------------- + ---------- DHCP options ---------- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_dhcp DHCP + * @ingroup lwip_opts_ipv4 + * @{ + */ +/** + * LWIP_DHCP==1: Enable DHCP module. + */ +#if !defined LWIP_DHCP || defined __DOXYGEN__ +#define LWIP_DHCP 0 +#endif +#if !LWIP_IPV4 +/* disable DHCP when IPv4 is disabled */ +#undef LWIP_DHCP +#define LWIP_DHCP 0 +#endif /* !LWIP_IPV4 */ + +/** + * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. + */ +#if !defined DHCP_DOES_ARP_CHECK || defined __DOXYGEN__ +#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) +#endif + +/** + * LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has + * NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and + * netif drivers might not set this flag, the default is off. If enabled, + * netif_set_link_up() must be called to continue dhcp starting. + */ +#if !defined LWIP_DHCP_CHECK_LINK_UP +#define LWIP_DHCP_CHECK_LINK_UP 0 +#endif + +/** + * LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name. + */ +#if !defined LWIP_DHCP_BOOTP_FILE || defined __DOXYGEN__ +#define LWIP_DHCP_BOOTP_FILE 0 +#endif + +/** + * LWIP_DHCP_GETS_NTP==1: Request NTP servers with discover/select. For each + * response packet, an callback is called, which has to be provided by the port: + * void dhcp_set_ntp_servers(u8_t num_ntp_servers, ip_addr_t* ntp_server_addrs); +*/ +#if !defined LWIP_DHCP_GET_NTP_SRV || defined __DOXYGEN__ +#define LWIP_DHCP_GET_NTP_SRV 0 +#endif + +/** + * The maximum of NTP servers requested + */ +#if !defined LWIP_DHCP_MAX_NTP_SERVERS || defined __DOXYGEN__ +#define LWIP_DHCP_MAX_NTP_SERVERS 1 +#endif + +/** + * LWIP_DHCP_MAX_DNS_SERVERS > 0: Request DNS servers with discover/select. + * DHCP servers received in the response are passed to DNS via @ref dns_setserver() + * (up to the maximum limit defined here). + */ +#if !defined LWIP_DHCP_MAX_DNS_SERVERS || defined __DOXYGEN__ +#define LWIP_DHCP_MAX_DNS_SERVERS DNS_MAX_SERVERS +#endif +/** + * @} + */ + +/* + ------------------------------------ + ---------- AUTOIP options ---------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_autoip AUTOIP + * @ingroup lwip_opts_ipv4 + * @{ + */ +/** + * LWIP_AUTOIP==1: Enable AUTOIP module. + */ +#if !defined LWIP_AUTOIP || defined __DOXYGEN__ +#define LWIP_AUTOIP 0 +#endif +#if !LWIP_IPV4 +/* disable AUTOIP when IPv4 is disabled */ +#undef LWIP_AUTOIP +#define LWIP_AUTOIP 0 +#endif /* !LWIP_IPV4 */ + +/** + * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on + * the same interface at the same time. + */ +#if !defined LWIP_DHCP_AUTOIP_COOP || defined __DOXYGEN__ +#define LWIP_DHCP_AUTOIP_COOP 0 +#endif + +/** + * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes + * that should be sent before falling back on AUTOIP (the DHCP client keeps + * running in this case). This can be set as low as 1 to get an AutoIP address + * very quickly, but you should be prepared to handle a changing IP address + * when DHCP overrides AutoIP. + */ +#if !defined LWIP_DHCP_AUTOIP_COOP_TRIES || defined __DOXYGEN__ +#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 +#endif +/** + * @} + */ + +/* + ---------------------------------- + ----- SNMP MIB2 support ----- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_mib2 SNMP MIB2 callbacks + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * LWIP_MIB2_CALLBACKS==1: Turn on SNMP MIB2 callbacks. + * Turn this on to get callbacks needed to implement MIB2. + * Usually MIB2_STATS should be enabled, too. + */ +#if !defined LWIP_MIB2_CALLBACKS || defined __DOXYGEN__ +#define LWIP_MIB2_CALLBACKS 0 +#endif +/** + * @} + */ + +/* + ---------------------------------- + ----- Multicast/IGMP options ----- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_igmp IGMP + * @ingroup lwip_opts_ipv4 + * @{ + */ +/** + * LWIP_IGMP==1: Turn on IGMP module. + */ +#if !defined LWIP_IGMP || defined __DOXYGEN__ +#define LWIP_IGMP 0 +#endif +#if !LWIP_IPV4 +#undef LWIP_IGMP +#define LWIP_IGMP 0 +#endif + +/** + * LWIP_MULTICAST_TX_OPTIONS==1: Enable multicast TX support like the socket options + * IP_MULTICAST_TTL/IP_MULTICAST_IF/IP_MULTICAST_LOOP + */ +#if !defined LWIP_MULTICAST_TX_OPTIONS || defined __DOXYGEN__ +#define LWIP_MULTICAST_TX_OPTIONS (LWIP_IGMP && LWIP_UDP) +#endif +/** + * @} + */ + +/* + ---------------------------------- + ---------- DNS options ----------- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_dns DNS + * @ingroup lwip_opts_callback + * @{ + */ +/** + * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS + * transport. + */ +#if !defined LWIP_DNS || defined __DOXYGEN__ +#define LWIP_DNS 0 +#endif + +/** DNS maximum number of entries to maintain locally. */ +#if !defined DNS_TABLE_SIZE || defined __DOXYGEN__ +#define DNS_TABLE_SIZE 4 +#endif + +/** DNS maximum host name length supported in the name table. */ +#if !defined DNS_MAX_NAME_LENGTH || defined __DOXYGEN__ +#define DNS_MAX_NAME_LENGTH 256 +#endif + +/** The maximum of DNS servers + * The first server can be initialized automatically by defining + * DNS_SERVER_ADDRESS(ipaddr), where 'ipaddr' is an 'ip_addr_t*' + */ +#if !defined DNS_MAX_SERVERS || defined __DOXYGEN__ +#define DNS_MAX_SERVERS 2 +#endif + +/** DNS do a name checking between the query and the response. */ +#if !defined DNS_DOES_NAME_CHECK || defined __DOXYGEN__ +#define DNS_DOES_NAME_CHECK 1 +#endif + +/** LWIP_DNS_SECURE: controls the security level of the DNS implementation + * Use all DNS security features by default. + * This is overridable but should only be needed by very small targets + * or when using against non standard DNS servers. */ +#if !defined LWIP_DNS_SECURE || defined __DOXYGEN__ +#define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) +#endif + +/* A list of DNS security features follows */ +#define LWIP_DNS_SECURE_RAND_XID 1 +#define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2 +#define LWIP_DNS_SECURE_RAND_SRC_PORT 4 + +/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, you have to define an initializer: + * \#define DNS_LOCAL_HOSTLIST_INIT {DNS_LOCAL_HOSTLIST_ELEM("host_ip4", IPADDR4_INIT_BYTES(1,2,3,4)), \ + * DNS_LOCAL_HOSTLIST_ELEM("host_ip6", IPADDR6_INIT_HOST(123, 234, 345, 456)} + * + * Instead, you can also use an external function: + * \#define DNS_LOOKUP_LOCAL_EXTERN(x) extern err_t my_lookup_function(const char *name, ip_addr_t *addr, u8_t dns_addrtype) + * that looks up the IP address and returns ERR_OK if found (LWIP_DNS_ADDRTYPE_xxx is passed in dns_addrtype). + */ +#if !defined DNS_LOCAL_HOSTLIST || defined __DOXYGEN__ +#define DNS_LOCAL_HOSTLIST 0 +#endif /* DNS_LOCAL_HOSTLIST */ + +/** If this is turned on, the local host-list can be dynamically changed + * at runtime. */ +#if !defined DNS_LOCAL_HOSTLIST_IS_DYNAMIC || defined __DOXYGEN__ +#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 +#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + +/** Set this to 1 to enable querying ".local" names via mDNS + * using a One-Shot Multicast DNS Query */ +#if !defined LWIP_DNS_SUPPORT_MDNS_QUERIES || defined __DOXYGEN__ +#define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 +#endif +/** + * @} + */ + +/* + --------------------------------- + ---------- UDP options ---------- + --------------------------------- +*/ +/** + * @defgroup lwip_opts_udp UDP + * @ingroup lwip_opts_callback + * @{ + */ +/** + * LWIP_UDP==1: Turn on UDP. + */ +#if !defined LWIP_UDP || defined __DOXYGEN__ +#define LWIP_UDP 1 +#endif + +/** + * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) + */ +#if !defined LWIP_UDPLITE || defined __DOXYGEN__ +#define LWIP_UDPLITE 0 +#endif + +/** + * UDP_TTL: Default Time-To-Live value. + */ +#if !defined UDP_TTL || defined __DOXYGEN__ +#define UDP_TTL (IP_DEFAULT_TTL) +#endif + +/** + * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. + */ +#if !defined LWIP_NETBUF_RECVINFO || defined __DOXYGEN__ +#define LWIP_NETBUF_RECVINFO 0 +#endif +/** + * @} + */ + +/* + --------------------------------- + ---------- TCP options ---------- + --------------------------------- +*/ +/** + * @defgroup lwip_opts_tcp TCP + * @ingroup lwip_opts_callback + * @{ + */ +/** + * LWIP_TCP==1: Turn on TCP. + */ +#if !defined LWIP_TCP || defined __DOXYGEN__ +#define LWIP_TCP 1 +#endif + +/** + * TCP_TTL: Default Time-To-Live value. + */ +#if !defined TCP_TTL || defined __DOXYGEN__ +#define TCP_TTL (IP_DEFAULT_TTL) +#endif + +/** + * TCP_WND: The size of a TCP window. This must be at least + * (2 * TCP_MSS) for things to work well. + * ATTENTION: when using TCP_RCV_SCALE, TCP_WND is the total size + * with scaling applied. Maximum window value in the TCP header + * will be TCP_WND >> TCP_RCV_SCALE + */ +#if !defined TCP_WND || defined __DOXYGEN__ +#define TCP_WND (4 * TCP_MSS) +#endif + +/** + * TCP_MAXRTX: Maximum number of retransmissions of data segments. + */ +#if !defined TCP_MAXRTX || defined __DOXYGEN__ +#define TCP_MAXRTX 12 +#endif + +/** + * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. + */ +#if !defined TCP_SYNMAXRTX || defined __DOXYGEN__ +#define TCP_SYNMAXRTX 6 +#endif + +/** + * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. + * Define to 0 if your device is low on memory. + */ +#if !defined TCP_QUEUE_OOSEQ || defined __DOXYGEN__ +#define TCP_QUEUE_OOSEQ (LWIP_TCP) +#endif + +/** + * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, + * you might want to increase this.) + * For the receive side, this MSS is advertised to the remote side + * when opening a connection. For the transmit size, this MSS sets + * an upper limit on the MSS advertised by the remote host. + */ +#if !defined TCP_MSS || defined __DOXYGEN__ +#define TCP_MSS 536 +#endif + +/** + * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really + * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which + * reflects the available reassembly buffer size at the remote host) and the + * largest size permitted by the IP layer" (RFC 1122) + * Setting this to 1 enables code that checks TCP_MSS against the MTU of the + * netif used for a connection and limits the MSS if it would be too big otherwise. + */ +#if !defined TCP_CALCULATE_EFF_SEND_MSS || defined __DOXYGEN__ +#define TCP_CALCULATE_EFF_SEND_MSS 1 +#endif + + +/** + * TCP_SND_BUF: TCP sender buffer space (bytes). + * To achieve good performance, this should be at least 2 * TCP_MSS. + */ +#if !defined TCP_SND_BUF || defined __DOXYGEN__ +#define TCP_SND_BUF (2 * TCP_MSS) +#endif + +/** + * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least + * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. + */ +#if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ +#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) +#endif + +/** + * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than + * TCP_SND_BUF. It is the amount of space which must be available in the + * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). + */ +#if !defined TCP_SNDLOWAT || defined __DOXYGEN__ +#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) +#endif + +/** + * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be less + * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below + * this number, select returns writable (combined with TCP_SNDLOWAT). + */ +#if !defined TCP_SNDQUEUELOWAT || defined __DOXYGEN__ +#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) +#endif + +/** + * TCP_OOSEQ_MAX_BYTES: The maximum number of bytes queued on ooseq per pcb. + * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. + */ +#if !defined TCP_OOSEQ_MAX_BYTES || defined __DOXYGEN__ +#define TCP_OOSEQ_MAX_BYTES 0 +#endif + +/** + * TCP_OOSEQ_MAX_PBUFS: The maximum number of pbufs queued on ooseq per pcb. + * Default is 0 (no limit). Only valid for TCP_QUEUE_OOSEQ==1. + */ +#if !defined TCP_OOSEQ_MAX_PBUFS || defined __DOXYGEN__ +#define TCP_OOSEQ_MAX_PBUFS 0 +#endif + +/** + * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. + */ +#if !defined TCP_LISTEN_BACKLOG || defined __DOXYGEN__ +#define TCP_LISTEN_BACKLOG 0 +#endif + +/** + * The maximum allowed backlog for TCP listen netconns. + * This backlog is used unless another is explicitly specified. + * 0xff is the maximum (u8_t). + */ +#if !defined TCP_DEFAULT_LISTEN_BACKLOG || defined __DOXYGEN__ +#define TCP_DEFAULT_LISTEN_BACKLOG 0xff +#endif + +/** + * TCP_OVERSIZE: The maximum number of bytes that tcp_write may + * allocate ahead of time in an attempt to create shorter pbuf chains + * for transmission. The meaningful range is 0 to TCP_MSS. Some + * suggested values are: + * + * 0: Disable oversized allocation. Each tcp_write() allocates a new + pbuf (old behaviour). + * 1: Allocate size-aligned pbufs with minimal excess. Use this if your + * scatter-gather DMA requires aligned fragments. + * 128: Limit the pbuf/memory overhead to 20%. + * TCP_MSS: Try to create unfragmented TCP packets. + * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. + */ +#if !defined TCP_OVERSIZE || defined __DOXYGEN__ +#define TCP_OVERSIZE TCP_MSS +#endif + +/** + * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. + * The timestamp option is currently only used to help remote hosts, it is not + * really used locally. Therefore, it is only enabled when a TS option is + * received in the initial SYN packet from a remote host. + */ +#if !defined LWIP_TCP_TIMESTAMPS || defined __DOXYGEN__ +#define LWIP_TCP_TIMESTAMPS 0 +#endif + +/** + * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an + * explicit window update + */ +#if !defined TCP_WND_UPDATE_THRESHOLD || defined __DOXYGEN__ +#define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4)) +#endif + +/** + * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. + * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all + * events (accept, sent, etc) that happen in the system. + * LWIP_CALLBACK_API==1: The PCB callback function is called directly + * for the event. This is the default. + */ +#if !defined(LWIP_EVENT_API) && !defined(LWIP_CALLBACK_API) || defined __DOXYGEN__ +#define LWIP_EVENT_API 0 +#define LWIP_CALLBACK_API 1 +#else +#ifndef LWIP_EVENT_API +#define LWIP_EVENT_API 0 +#endif +#ifndef LWIP_CALLBACK_API +#define LWIP_CALLBACK_API 0 +#endif +#endif + +/** + * LWIP_WND_SCALE and TCP_RCV_SCALE: + * Set LWIP_WND_SCALE to 1 to enable window scaling. + * Set TCP_RCV_SCALE to the desired scaling factor (shift count in the + * range of [0..14]). + * When LWIP_WND_SCALE is enabled but TCP_RCV_SCALE is 0, we can use a large + * send window while having a small receive window only. + */ +#if !defined LWIP_WND_SCALE || defined __DOXYGEN__ +#define LWIP_WND_SCALE 0 +#define TCP_RCV_SCALE 0 +#endif +/** + * @} + */ + +/* + ---------------------------------- + ---------- Pbuf options ---------- + ---------------------------------- +*/ +/** + * @defgroup lwip_opts_pbuf PBUF + * @ingroup lwip_opts + * @{ + */ +/** + * PBUF_LINK_HLEN: the number of bytes that should be allocated for a + * link level header. The default is 14, the standard value for + * Ethernet. + */ +#if !defined PBUF_LINK_HLEN || defined __DOXYGEN__ +#if defined LWIP_HOOK_VLAN_SET && !defined __DOXYGEN__ +#define PBUF_LINK_HLEN (18 + ETH_PAD_SIZE) +#else /* LWIP_HOOK_VLAN_SET */ +#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) +#endif /* LWIP_HOOK_VLAN_SET */ +#endif + +/** + * PBUF_LINK_ENCAPSULATION_HLEN: the number of bytes that should be allocated + * for an additional encapsulation header before ethernet headers (e.g. 802.11) + */ +#if !defined PBUF_LINK_ENCAPSULATION_HLEN || defined __DOXYGEN__ +#define PBUF_LINK_ENCAPSULATION_HLEN 0u +#endif + +/** + * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is + * designed to accommodate single full size TCP frame in one pbuf, including + * TCP_MSS, IP header, and link header. + */ +#if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__ +#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) +#endif +/** + * @} + */ + +/* + ------------------------------------------------ + ---------- Network Interfaces options ---------- + ------------------------------------------------ +*/ +/** + * @defgroup lwip_opts_netif NETIF + * @ingroup lwip_opts + * @{ + */ +/** + * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname + * field. + */ +#if !defined LWIP_NETIF_HOSTNAME || defined __DOXYGEN__ +#define LWIP_NETIF_HOSTNAME 0 +#endif + +/** + * LWIP_NETIF_API==1: Support netif api (in netifapi.c) + */ +#if !defined LWIP_NETIF_API || defined __DOXYGEN__ +#define LWIP_NETIF_API 0 +#endif + +/** + * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface + * changes its up/down status (i.e., due to DHCP IP acquisition) + */ +#if !defined LWIP_NETIF_STATUS_CALLBACK || defined __DOXYGEN__ +#define LWIP_NETIF_STATUS_CALLBACK 0 +#endif + +/** + * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface + * whenever the link changes (i.e., link down) + */ +#if !defined LWIP_NETIF_LINK_CALLBACK || defined __DOXYGEN__ +#define LWIP_NETIF_LINK_CALLBACK 0 +#endif + +/** + * LWIP_NETIF_REMOVE_CALLBACK==1: Support a callback function that is called + * when a netif has been removed + */ +#if !defined LWIP_NETIF_REMOVE_CALLBACK || defined __DOXYGEN__ +#define LWIP_NETIF_REMOVE_CALLBACK 0 +#endif + +/** + * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table + * indices) in struct netif. TCP and UDP can make use of this to prevent + * scanning the ARP table for every sent packet. While this is faster for big + * ARP tables or many concurrent connections, it might be counterproductive + * if you have a tiny ARP table or if there never are concurrent connections. + */ +#if !defined LWIP_NETIF_HWADDRHINT || defined __DOXYGEN__ +#define LWIP_NETIF_HWADDRHINT 0 +#endif + +/** + * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data + * to be sent into one single pbuf. This is for compatibility with DMA-enabled + * MACs that do not support scatter-gather. + * Beware that this might involve CPU-memcpy before transmitting that would not + * be needed without this flag! Use this only if you need to! + * + * @todo: TCP and IP-frag do not work with this, yet: + */ +#if !defined LWIP_NETIF_TX_SINGLE_PBUF || defined __DOXYGEN__ +#define LWIP_NETIF_TX_SINGLE_PBUF 0 +#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ + +/** + * LWIP_NUM_NETIF_CLIENT_DATA: Number of clients that may store + * data in client_data member array of struct netif. + */ +#if !defined LWIP_NUM_NETIF_CLIENT_DATA || defined __DOXYGEN__ +#define LWIP_NUM_NETIF_CLIENT_DATA 0 +#endif +/** + * @} + */ + +/* + ------------------------------------ + ---------- LOOPIF options ---------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_loop Loopback interface + * @ingroup lwip_opts_netif + * @{ + */ +/** + * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1). + * This is only needed when no real netifs are available. If at least one other + * netif is available, loopback traffic uses this netif. + */ +#if !defined LWIP_HAVE_LOOPIF || defined __DOXYGEN__ +#define LWIP_HAVE_LOOPIF LWIP_NETIF_LOOPBACK +#endif + +/** + * LWIP_LOOPIF_MULTICAST==1: Support multicast/IGMP on loop interface (127.0.0.1). + */ +#if !defined LWIP_LOOPIF_MULTICAST || defined __DOXYGEN__ +#define LWIP_LOOPIF_MULTICAST 0 +#endif + +/** + * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP + * address equal to the netif IP address, looping them back up the stack. + */ +#if !defined LWIP_NETIF_LOOPBACK || defined __DOXYGEN__ +#define LWIP_NETIF_LOOPBACK 0 +#endif + +/** + * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback + * sending for each netif (0 = disabled) + */ +#if !defined LWIP_LOOPBACK_MAX_PBUFS || defined __DOXYGEN__ +#define LWIP_LOOPBACK_MAX_PBUFS 0 +#endif + +/** + * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in + * the system, as netifs must change how they behave depending on this setting + * for the LWIP_NETIF_LOOPBACK option to work. + * Setting this is needed to avoid reentering non-reentrant functions like + * tcp_input(). + * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a + * multithreaded environment like tcpip.c. In this case, netif->input() + * is called directly. + * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. + * The packets are put on a list and netif_poll() must be called in + * the main application loop. + */ +#if !defined LWIP_NETIF_LOOPBACK_MULTITHREADING || defined __DOXYGEN__ +#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) +#endif +/** + * @} + */ + +/* + ------------------------------------ + ---------- Thread options ---------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_thread Threading + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. + */ +#if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__ +#define TCPIP_THREAD_NAME "tcpip_thread" +#endif + +/** + * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. + * The stack size value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined TCPIP_THREAD_STACKSIZE || defined __DOXYGEN__ +#define TCPIP_THREAD_STACKSIZE 0 +#endif + +/** + * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. + * The priority value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined TCPIP_THREAD_PRIO || defined __DOXYGEN__ +#define TCPIP_THREAD_PRIO 1 +#endif + +/** + * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages + * The queue size value itself is platform-dependent, but is passed to + * sys_mbox_new() when tcpip_init is called. + */ +#if !defined TCPIP_MBOX_SIZE || defined __DOXYGEN__ +#define TCPIP_MBOX_SIZE 0 +#endif + +/** + * Define this to something that triggers a watchdog. This is called from + * tcpip_thread after processing a message. + */ +#if !defined LWIP_TCPIP_THREAD_ALIVE || defined __DOXYGEN__ +#define LWIP_TCPIP_THREAD_ALIVE() +#endif + +/** + * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. + */ +#if !defined SLIPIF_THREAD_NAME || defined __DOXYGEN__ +#define SLIPIF_THREAD_NAME "slipif_loop" +#endif + +/** + * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. + * The stack size value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined SLIPIF_THREAD_STACKSIZE || defined __DOXYGEN__ +#define SLIPIF_THREAD_STACKSIZE 0 +#endif + +/** + * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. + * The priority value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined SLIPIF_THREAD_PRIO || defined __DOXYGEN__ +#define SLIPIF_THREAD_PRIO 1 +#endif + +/** + * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. + */ +#if !defined DEFAULT_THREAD_NAME || defined __DOXYGEN__ +#define DEFAULT_THREAD_NAME "lwIP" +#endif + +/** + * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. + * The stack size value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined DEFAULT_THREAD_STACKSIZE || defined __DOXYGEN__ +#define DEFAULT_THREAD_STACKSIZE 0 +#endif + +/** + * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. + * The priority value itself is platform-dependent, but is passed to + * sys_thread_new() when the thread is created. + */ +#if !defined DEFAULT_THREAD_PRIO || defined __DOXYGEN__ +#define DEFAULT_THREAD_PRIO 1 +#endif + +/** + * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a + * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed + * to sys_mbox_new() when the recvmbox is created. + */ +#if !defined DEFAULT_RAW_RECVMBOX_SIZE || defined __DOXYGEN__ +#define DEFAULT_RAW_RECVMBOX_SIZE 0 +#endif + +/** + * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a + * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed + * to sys_mbox_new() when the recvmbox is created. + */ +#if !defined DEFAULT_UDP_RECVMBOX_SIZE || defined __DOXYGEN__ +#define DEFAULT_UDP_RECVMBOX_SIZE 0 +#endif + +/** + * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a + * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed + * to sys_mbox_new() when the recvmbox is created. + */ +#if !defined DEFAULT_TCP_RECVMBOX_SIZE || defined __DOXYGEN__ +#define DEFAULT_TCP_RECVMBOX_SIZE 0 +#endif + +/** + * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. + * The queue size value itself is platform-dependent, but is passed to + * sys_mbox_new() when the acceptmbox is created. + */ +#if !defined DEFAULT_ACCEPTMBOX_SIZE || defined __DOXYGEN__ +#define DEFAULT_ACCEPTMBOX_SIZE 0 +#endif +/** + * @} + */ + +/* + ---------------------------------------------- + ---------- Sequential layer options ---------- + ---------------------------------------------- +*/ +/** + * @defgroup lwip_opts_netconn Netconn + * @ingroup lwip_opts_threadsafe_apis + * @{ + */ +/** + * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) + */ +#if !defined LWIP_NETCONN || defined __DOXYGEN__ +#define LWIP_NETCONN 1 +#endif + +/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout to create + * timers running in tcpip_thread from another thread. + */ +#if !defined LWIP_TCPIP_TIMEOUT || defined __DOXYGEN__ +#define LWIP_TCPIP_TIMEOUT 0 +#endif + +/** LWIP_NETCONN_SEM_PER_THREAD==1: Use one (thread-local) semaphore per + * thread calling socket/netconn functions instead of allocating one + * semaphore per netconn (and per select etc.) + * ATTENTION: a thread-local semaphore for API calls is needed: + * - LWIP_NETCONN_THREAD_SEM_GET() returning a sys_sem_t* + * - LWIP_NETCONN_THREAD_SEM_ALLOC() creating the semaphore + * - LWIP_NETCONN_THREAD_SEM_FREE() freeing the semaphore + * The latter 2 can be invoked up by calling netconn_thread_init()/netconn_thread_cleanup(). + * Ports may call these for threads created with sys_thread_new(). + */ +#if !defined LWIP_NETCONN_SEM_PER_THREAD || defined __DOXYGEN__ +#define LWIP_NETCONN_SEM_PER_THREAD 0 +#endif + +/** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, + * writing from a 2nd thread and closing from a 3rd thread at the same time. + * ATTENTION: This is currently really alpha! Some requirements: + * - LWIP_NETCONN_SEM_PER_THREAD==1 is required to use one socket/netconn from + * multiple threads at once + * - sys_mbox_free() has to unblock receive tasks waiting on recvmbox/acceptmbox + * and prevent a task pending on this during/after deletion + */ +#if !defined LWIP_NETCONN_FULLDUPLEX || defined __DOXYGEN__ +#define LWIP_NETCONN_FULLDUPLEX 0 +#endif +/** + * @} + */ + +/* + ------------------------------------ + ---------- Socket options ---------- + ------------------------------------ +*/ +/** + * @defgroup lwip_opts_socket Sockets + * @ingroup lwip_opts_threadsafe_apis + * @{ + */ +/** + * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) + */ +#if !defined LWIP_SOCKET || defined __DOXYGEN__ +#define LWIP_SOCKET 1 +#endif + +/* LWIP_SOCKET_SET_ERRNO==1: Set errno when socket functions cannot complete + * successfully, as required by POSIX. Default is POSIX-compliant. + */ +#if !defined LWIP_SOCKET_SET_ERRNO || defined __DOXYGEN__ +#define LWIP_SOCKET_SET_ERRNO 1 +#endif + +/** + * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names through defines. + * LWIP_COMPAT_SOCKETS==2: Same as ==1 but correctly named functions are created. + * While this helps code completion, it might conflict with existing libraries. + * (only used if you use sockets.c) + */ +#if !defined LWIP_COMPAT_SOCKETS || defined __DOXYGEN__ +#define LWIP_COMPAT_SOCKETS 1 +#endif + +/** + * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. + * Disable this option if you use a POSIX operating system that uses the same + * names (read, write & close). (only used if you use sockets.c) + */ +#if !defined LWIP_POSIX_SOCKETS_IO_NAMES || defined __DOXYGEN__ +#define LWIP_POSIX_SOCKETS_IO_NAMES 1 +#endif + +/** + * LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n. + * This can be useful when there are multiple APIs which create file descriptors. + * When they all start with a different offset and you won't make them overlap you can + * re implement read/write/close/ioctl/fnctl to send the requested action to the right + * library (sharing select will need more work though). + */ +#if !defined LWIP_SOCKET_OFFSET || defined __DOXYGEN__ +#define LWIP_SOCKET_OFFSET 0 +#endif + +/** + * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT + * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set + * in seconds. (does not require sockets.c, and will affect tcp.c) + */ +#if !defined LWIP_TCP_KEEPALIVE || defined __DOXYGEN__ +#define LWIP_TCP_KEEPALIVE 0 +#endif + +/** + * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and + * SO_SNDTIMEO processing. + */ +#if !defined LWIP_SO_SNDTIMEO || defined __DOXYGEN__ +#define LWIP_SO_SNDTIMEO 0 +#endif + +/** + * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and + * SO_RCVTIMEO processing. + */ +#if !defined LWIP_SO_RCVTIMEO || defined __DOXYGEN__ +#define LWIP_SO_RCVTIMEO 0 +#endif + +/** + * LWIP_SO_SNDRCVTIMEO_NONSTANDARD==1: SO_RCVTIMEO/SO_SNDTIMEO take an int + * (milliseconds, much like winsock does) instead of a struct timeval (default). + */ +#if !defined LWIP_SO_SNDRCVTIMEO_NONSTANDARD || defined __DOXYGEN__ +#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0 +#endif + +/** + * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. + */ +#if !defined LWIP_SO_RCVBUF || defined __DOXYGEN__ +#define LWIP_SO_RCVBUF 0 +#endif + +/** + * LWIP_SO_LINGER==1: Enable SO_LINGER processing. + */ +#if !defined LWIP_SO_LINGER || defined __DOXYGEN__ +#define LWIP_SO_LINGER 0 +#endif + +/** + * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. + */ +#if !defined RECV_BUFSIZE_DEFAULT || defined __DOXYGEN__ +#define RECV_BUFSIZE_DEFAULT INT_MAX +#endif + +/** + * By default, TCP socket/netconn close waits 20 seconds max to send the FIN + */ +#if !defined LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT || defined __DOXYGEN__ +#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000 +#endif + +/** + * SO_REUSE==1: Enable SO_REUSEADDR option. + */ +#if !defined SO_REUSE || defined __DOXYGEN__ +#define SO_REUSE 0 +#endif + +/** + * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets + * to all local matches if SO_REUSEADDR is turned on. + * WARNING: Adds a memcpy for every packet if passing to more than one pcb! + */ +#if !defined SO_REUSE_RXTOALL || defined __DOXYGEN__ +#define SO_REUSE_RXTOALL 0 +#endif + +/** + * LWIP_FIONREAD_LINUXMODE==0 (default): ioctl/FIONREAD returns the amount of + * pending data in the network buffer. This is the way windows does it. It's + * the default for lwIP since it is smaller. + * LWIP_FIONREAD_LINUXMODE==1: ioctl/FIONREAD returns the size of the next + * pending datagram in bytes. This is the way linux does it. This code is only + * here for compatibility. + */ +#if !defined LWIP_FIONREAD_LINUXMODE || defined __DOXYGEN__ +#define LWIP_FIONREAD_LINUXMODE 0 +#endif +/** + * @} + */ + +/* + ---------------------------------------- + ---------- Statistics options ---------- + ---------------------------------------- +*/ +/** + * @defgroup lwip_opts_stats Statistics + * @ingroup lwip_opts_debug + * @{ + */ +/** + * LWIP_STATS==1: Enable statistics collection in lwip_stats. + */ +#if !defined LWIP_STATS || defined __DOXYGEN__ +#define LWIP_STATS 1 +#endif + +#if LWIP_STATS + +/** + * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. + */ +#if !defined LWIP_STATS_DISPLAY || defined __DOXYGEN__ +#define LWIP_STATS_DISPLAY 0 +#endif + +/** + * LINK_STATS==1: Enable link stats. + */ +#if !defined LINK_STATS || defined __DOXYGEN__ +#define LINK_STATS 1 +#endif + +/** + * ETHARP_STATS==1: Enable etharp stats. + */ +#if !defined ETHARP_STATS || defined __DOXYGEN__ +#define ETHARP_STATS (LWIP_ARP) +#endif + +/** + * IP_STATS==1: Enable IP stats. + */ +#if !defined IP_STATS || defined __DOXYGEN__ +#define IP_STATS 1 +#endif + +/** + * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is + * on if using either frag or reass. + */ +#if !defined IPFRAG_STATS || defined __DOXYGEN__ +#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) +#endif + +/** + * ICMP_STATS==1: Enable ICMP stats. + */ +#if !defined ICMP_STATS || defined __DOXYGEN__ +#define ICMP_STATS 1 +#endif + +/** + * IGMP_STATS==1: Enable IGMP stats. + */ +#if !defined IGMP_STATS || defined __DOXYGEN__ +#define IGMP_STATS (LWIP_IGMP) +#endif + +/** + * UDP_STATS==1: Enable UDP stats. Default is on if + * UDP enabled, otherwise off. + */ +#if !defined UDP_STATS || defined __DOXYGEN__ +#define UDP_STATS (LWIP_UDP) +#endif + +/** + * TCP_STATS==1: Enable TCP stats. Default is on if TCP + * enabled, otherwise off. + */ +#if !defined TCP_STATS || defined __DOXYGEN__ +#define TCP_STATS (LWIP_TCP) +#endif + +/** + * MEM_STATS==1: Enable mem.c stats. + */ +#if !defined MEM_STATS || defined __DOXYGEN__ +#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) +#endif + +/** + * MEMP_STATS==1: Enable memp.c pool stats. + */ +#if !defined MEMP_STATS || defined __DOXYGEN__ +#define MEMP_STATS (MEMP_MEM_MALLOC == 0) +#endif + +/** + * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). + */ +#if !defined SYS_STATS || defined __DOXYGEN__ +#define SYS_STATS (NO_SYS == 0) +#endif + +/** + * IP6_STATS==1: Enable IPv6 stats. + */ +#if !defined IP6_STATS || defined __DOXYGEN__ +#define IP6_STATS (LWIP_IPV6) +#endif + +/** + * ICMP6_STATS==1: Enable ICMP for IPv6 stats. + */ +#if !defined ICMP6_STATS || defined __DOXYGEN__ +#define ICMP6_STATS (LWIP_IPV6 && LWIP_ICMP6) +#endif + +/** + * IP6_FRAG_STATS==1: Enable IPv6 fragmentation stats. + */ +#if !defined IP6_FRAG_STATS || defined __DOXYGEN__ +#define IP6_FRAG_STATS (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS)) +#endif + +/** + * MLD6_STATS==1: Enable MLD for IPv6 stats. + */ +#if !defined MLD6_STATS || defined __DOXYGEN__ +#define MLD6_STATS (LWIP_IPV6 && LWIP_IPV6_MLD) +#endif + +/** + * ND6_STATS==1: Enable Neighbor discovery for IPv6 stats. + */ +#if !defined ND6_STATS || defined __DOXYGEN__ +#define ND6_STATS (LWIP_IPV6) +#endif + +/** + * MIB2_STATS==1: Stats for SNMP MIB2. + */ +#if !defined MIB2_STATS || defined __DOXYGEN__ +#define MIB2_STATS 0 +#endif + +#else + +#define LINK_STATS 0 +#define ETHARP_STATS 0 +#define IP_STATS 0 +#define IPFRAG_STATS 0 +#define ICMP_STATS 0 +#define IGMP_STATS 0 +#define UDP_STATS 0 +#define TCP_STATS 0 +#define MEM_STATS 0 +#define MEMP_STATS 0 +#define SYS_STATS 0 +#define LWIP_STATS_DISPLAY 0 +#define IP6_STATS 0 +#define ICMP6_STATS 0 +#define IP6_FRAG_STATS 0 +#define MLD6_STATS 0 +#define ND6_STATS 0 +#define MIB2_STATS 0 + +#endif /* LWIP_STATS */ +/** + * @} + */ + +/* + -------------------------------------- + ---------- Checksum options ---------- + -------------------------------------- +*/ +/** + * @defgroup lwip_opts_checksum Checksum + * @ingroup lwip_opts_infrastructure + * @{ + */ +/** + * LWIP_CHECKSUM_CTRL_PER_NETIF==1: Checksum generation/check can be enabled/disabled + * per netif. + * ATTENTION: if enabled, the CHECKSUM_GEN_* and CHECKSUM_CHECK_* defines must be enabled! + */ +#if !defined LWIP_CHECKSUM_CTRL_PER_NETIF || defined __DOXYGEN__ +#define LWIP_CHECKSUM_CTRL_PER_NETIF 0 +#endif + +/** + * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. + */ +#if !defined CHECKSUM_GEN_IP || defined __DOXYGEN__ +#define CHECKSUM_GEN_IP 1 +#endif + +/** + * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. + */ +#if !defined CHECKSUM_GEN_UDP || defined __DOXYGEN__ +#define CHECKSUM_GEN_UDP 1 +#endif + +/** + * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. + */ +#if !defined CHECKSUM_GEN_TCP || defined __DOXYGEN__ +#define CHECKSUM_GEN_TCP 1 +#endif + +/** + * CHECKSUM_GEN_ICMP==1: Generate checksums in software for outgoing ICMP packets. + */ +#if !defined CHECKSUM_GEN_ICMP || defined __DOXYGEN__ +#define CHECKSUM_GEN_ICMP 1 +#endif + +/** + * CHECKSUM_GEN_ICMP6==1: Generate checksums in software for outgoing ICMP6 packets. + */ +#if !defined CHECKSUM_GEN_ICMP6 || defined __DOXYGEN__ +#define CHECKSUM_GEN_ICMP6 1 +#endif + +/** + * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. + */ +#if !defined CHECKSUM_CHECK_IP || defined __DOXYGEN__ +#define CHECKSUM_CHECK_IP 1 +#endif + +/** + * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. + */ +#if !defined CHECKSUM_CHECK_UDP || defined __DOXYGEN__ +#define CHECKSUM_CHECK_UDP 1 +#endif + +/** + * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. + */ +#if !defined CHECKSUM_CHECK_TCP || defined __DOXYGEN__ +#define CHECKSUM_CHECK_TCP 1 +#endif + +/** + * CHECKSUM_CHECK_ICMP==1: Check checksums in software for incoming ICMP packets. + */ +#if !defined CHECKSUM_CHECK_ICMP || defined __DOXYGEN__ +#define CHECKSUM_CHECK_ICMP 1 +#endif + +/** + * CHECKSUM_CHECK_ICMP6==1: Check checksums in software for incoming ICMPv6 packets + */ +#if !defined CHECKSUM_CHECK_ICMP6 || defined __DOXYGEN__ +#define CHECKSUM_CHECK_ICMP6 1 +#endif + +/** + * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from + * application buffers to pbufs. + */ +#if !defined LWIP_CHECKSUM_ON_COPY || defined __DOXYGEN__ +#define LWIP_CHECKSUM_ON_COPY 0 +#endif +/** + * @} + */ + +/* + --------------------------------------- + ---------- IPv6 options --------------- + --------------------------------------- +*/ +/** + * @defgroup lwip_opts_ipv6 IPv6 + * @ingroup lwip_opts + * @{ + */ +/** + * LWIP_IPV6==1: Enable IPv6 + */ +#if !defined LWIP_IPV6 || defined __DOXYGEN__ +#define LWIP_IPV6 0 +#endif + +/** + * LWIP_IPV6_NUM_ADDRESSES: Number of IPv6 addresses per netif. + */ +#if !defined LWIP_IPV6_NUM_ADDRESSES || defined __DOXYGEN__ +#define LWIP_IPV6_NUM_ADDRESSES 3 +#endif + +/** + * LWIP_IPV6_FORWARD==1: Forward IPv6 packets across netifs + */ +#if !defined LWIP_IPV6_FORWARD || defined __DOXYGEN__ +#define LWIP_IPV6_FORWARD 0 +#endif + +/** + * LWIP_IPV6_FRAG==1: Fragment outgoing IPv6 packets that are too big. + */ +#if !defined LWIP_IPV6_FRAG || defined __DOXYGEN__ +#define LWIP_IPV6_FRAG 0 +#endif + +/** + * LWIP_IPV6_REASS==1: reassemble incoming IPv6 packets that fragmented + */ +#if !defined LWIP_IPV6_REASS || defined __DOXYGEN__ +#define LWIP_IPV6_REASS (LWIP_IPV6) +#endif + +/** + * LWIP_IPV6_SEND_ROUTER_SOLICIT==1: Send router solicitation messages during + * network startup. + */ +#if !defined LWIP_IPV6_SEND_ROUTER_SOLICIT || defined __DOXYGEN__ +#define LWIP_IPV6_SEND_ROUTER_SOLICIT 1 +#endif + +/** + * LWIP_IPV6_AUTOCONFIG==1: Enable stateless address autoconfiguration as per RFC 4862. + */ +#if !defined LWIP_IPV6_AUTOCONFIG || defined __DOXYGEN__ +#define LWIP_IPV6_AUTOCONFIG (LWIP_IPV6) +#endif + +/** + * LWIP_IPV6_DUP_DETECT_ATTEMPTS=[0..7]: Number of duplicate address detection attempts. + */ +#if !defined LWIP_IPV6_DUP_DETECT_ATTEMPTS || defined __DOXYGEN__ +#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 1 +#endif +/** + * @} + */ + +/** + * @defgroup lwip_opts_icmp6 ICMP6 + * @ingroup lwip_opts_ipv6 + * @{ + */ +/** + * LWIP_ICMP6==1: Enable ICMPv6 (mandatory per RFC) + */ +#if !defined LWIP_ICMP6 || defined __DOXYGEN__ +#define LWIP_ICMP6 (LWIP_IPV6) +#endif + +/** + * LWIP_ICMP6_DATASIZE: bytes from original packet to send back in + * ICMPv6 error messages. + */ +#if !defined LWIP_ICMP6_DATASIZE || defined __DOXYGEN__ +#define LWIP_ICMP6_DATASIZE 8 +#endif + +/** + * LWIP_ICMP6_HL: default hop limit for ICMPv6 messages + */ +#if !defined LWIP_ICMP6_HL || defined __DOXYGEN__ +#define LWIP_ICMP6_HL 255 +#endif +/** + * @} + */ + +/** + * @defgroup lwip_opts_mld6 Multicast listener discovery + * @ingroup lwip_opts_ipv6 + * @{ + */ +/** + * LWIP_IPV6_MLD==1: Enable multicast listener discovery protocol. + * If LWIP_IPV6 is enabled but this setting is disabled, the MAC layer must + * indiscriminately pass all inbound IPv6 multicast traffic to lwIP. + */ +#if !defined LWIP_IPV6_MLD || defined __DOXYGEN__ +#define LWIP_IPV6_MLD (LWIP_IPV6) +#endif + +/** + * MEMP_NUM_MLD6_GROUP: Max number of IPv6 multicast groups that can be joined. + * There must be enough groups so that each netif can join the solicited-node + * multicast group for each of its local addresses, plus one for MDNS if + * applicable, plus any number of groups to be joined on UDP sockets. + */ +#if !defined MEMP_NUM_MLD6_GROUP || defined __DOXYGEN__ +#define MEMP_NUM_MLD6_GROUP 4 +#endif +/** + * @} + */ + +/** + * @defgroup lwip_opts_nd6 Neighbor discovery + * @ingroup lwip_opts_ipv6 + * @{ + */ +/** + * LWIP_ND6_QUEUEING==1: queue outgoing IPv6 packets while MAC address + * is being resolved. + */ +#if !defined LWIP_ND6_QUEUEING || defined __DOXYGEN__ +#define LWIP_ND6_QUEUEING (LWIP_IPV6) +#endif + +/** + * MEMP_NUM_ND6_QUEUE: Max number of IPv6 packets to queue during MAC resolution. + */ +#if !defined MEMP_NUM_ND6_QUEUE || defined __DOXYGEN__ +#define MEMP_NUM_ND6_QUEUE 20 +#endif + +/** + * LWIP_ND6_NUM_NEIGHBORS: Number of entries in IPv6 neighbor cache + */ +#if !defined LWIP_ND6_NUM_NEIGHBORS || defined __DOXYGEN__ +#define LWIP_ND6_NUM_NEIGHBORS 10 +#endif + +/** + * LWIP_ND6_NUM_DESTINATIONS: number of entries in IPv6 destination cache + */ +#if !defined LWIP_ND6_NUM_DESTINATIONS || defined __DOXYGEN__ +#define LWIP_ND6_NUM_DESTINATIONS 10 +#endif + +/** + * LWIP_ND6_NUM_PREFIXES: number of entries in IPv6 on-link prefixes cache + */ +#if !defined LWIP_ND6_NUM_PREFIXES || defined __DOXYGEN__ +#define LWIP_ND6_NUM_PREFIXES 5 +#endif + +/** + * LWIP_ND6_NUM_ROUTERS: number of entries in IPv6 default router cache + */ +#if !defined LWIP_ND6_NUM_ROUTERS || defined __DOXYGEN__ +#define LWIP_ND6_NUM_ROUTERS 3 +#endif + +/** + * LWIP_ND6_MAX_MULTICAST_SOLICIT: max number of multicast solicit messages to send + * (neighbor solicit and router solicit) + */ +#if !defined LWIP_ND6_MAX_MULTICAST_SOLICIT || defined __DOXYGEN__ +#define LWIP_ND6_MAX_MULTICAST_SOLICIT 3 +#endif + +/** + * LWIP_ND6_MAX_UNICAST_SOLICIT: max number of unicast neighbor solicitation messages + * to send during neighbor reachability detection. + */ +#if !defined LWIP_ND6_MAX_UNICAST_SOLICIT || defined __DOXYGEN__ +#define LWIP_ND6_MAX_UNICAST_SOLICIT 3 +#endif + +/** + * Unused: See ND RFC (time in milliseconds). + */ +#if !defined LWIP_ND6_MAX_ANYCAST_DELAY_TIME || defined __DOXYGEN__ +#define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000 +#endif + +/** + * Unused: See ND RFC + */ +#if !defined LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT || defined __DOXYGEN__ +#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3 +#endif + +/** + * LWIP_ND6_REACHABLE_TIME: default neighbor reachable time (in milliseconds). + * May be updated by router advertisement messages. + */ +#if !defined LWIP_ND6_REACHABLE_TIME || defined __DOXYGEN__ +#define LWIP_ND6_REACHABLE_TIME 30000 +#endif + +/** + * LWIP_ND6_RETRANS_TIMER: default retransmission timer for solicitation messages + */ +#if !defined LWIP_ND6_RETRANS_TIMER || defined __DOXYGEN__ +#define LWIP_ND6_RETRANS_TIMER 1000 +#endif + +/** + * LWIP_ND6_DELAY_FIRST_PROBE_TIME: Delay before first unicast neighbor solicitation + * message is sent, during neighbor reachability detection. + */ +#if !defined LWIP_ND6_DELAY_FIRST_PROBE_TIME || defined __DOXYGEN__ +#define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000 +#endif + +/** + * LWIP_ND6_ALLOW_RA_UPDATES==1: Allow Router Advertisement messages to update + * Reachable time and retransmission timers, and netif MTU. + */ +#if !defined LWIP_ND6_ALLOW_RA_UPDATES || defined __DOXYGEN__ +#define LWIP_ND6_ALLOW_RA_UPDATES 1 +#endif + +/** + * LWIP_ND6_TCP_REACHABILITY_HINTS==1: Allow TCP to provide Neighbor Discovery + * with reachability hints for connected destinations. This helps avoid sending + * unicast neighbor solicitation messages. + */ +#if !defined LWIP_ND6_TCP_REACHABILITY_HINTS || defined __DOXYGEN__ +#define LWIP_ND6_TCP_REACHABILITY_HINTS 1 +#endif + +/** + * LWIP_ND6_RDNSS_MAX_DNS_SERVERS > 0: Use IPv6 Router Advertisement Recursive + * DNS Server Option (as per RFC 6106) to copy a defined maximum number of DNS + * servers to the DNS module. + */ +#if !defined LWIP_ND6_RDNSS_MAX_DNS_SERVERS || defined __DOXYGEN__ +#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 +#endif +/** + * @} + */ + +/** + * LWIP_IPV6_DHCP6==1: enable DHCPv6 stateful address autoconfiguration. + */ +#if !defined LWIP_IPV6_DHCP6 || defined __DOXYGEN__ +#define LWIP_IPV6_DHCP6 0 +#endif + +/* + --------------------------------------- + ---------- Hook options --------------- + --------------------------------------- +*/ + +/** + * @defgroup lwip_opts_hooks Hooks + * @ingroup lwip_opts_infrastructure + * Hooks are undefined by default, define them to a function if you need them. + * @{ + */ + +/** + * LWIP_HOOK_FILENAME: Custom filename to #include in files that provide hooks. + * Declare your hook function prototypes in there, you may also #include all headers + * providing data types that are need in this file. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h" +#endif + +/** + * LWIP_HOOK_TCP_ISN: + * Hook for generation of the Initial Sequence Number (ISN) for a new TCP + * connection. The default lwIP ISN generation algorithm is very basic and may + * allow for TCP spoofing attacks. This hook provides the means to implement + * the standardized ISN generation algorithm from RFC 6528 (see contrib/adons/tcp_isn), + * or any other desired algorithm as a replacement. + * Called from tcp_connect() and tcp_listen_input() when an ISN is needed for + * a new TCP connection, if TCP support (@ref LWIP_TCP) is enabled.\n + * Signature: u32_t my_hook_tcp_isn(const ip_addr_t* local_ip, u16_t local_port, const ip_addr_t* remote_ip, u16_t remote_port); + * - it may be necessary to use "struct ip_addr" (ip4_addr, ip6_addr) instead of "ip_addr_t" in function declarations\n + * Arguments: + * - local_ip: pointer to the local IP address of the connection + * - local_port: local port number of the connection (host-byte order) + * - remote_ip: pointer to the remote IP address of the connection + * - remote_port: remote port number of the connection (host-byte order)\n + * Return value: + * - the 32-bit Initial Sequence Number to use for the new TCP connection. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port) +#endif + +/** + * LWIP_HOOK_IP4_INPUT(pbuf, input_netif): + * - called from ip_input() (IPv4) + * - pbuf: received struct pbuf passed to ip_input() + * - input_netif: struct netif on which the packet has been received + * Return values: + * - 0: Hook has not consumed the packet, packet is processed as normal + * - != 0: Hook has consumed the packet. + * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook + * (i.e. free it when done). + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) +#endif + +/** + * LWIP_HOOK_IP4_ROUTE(dest): + * - called from ip_route() (IPv4) + * - dest: destination IPv4 address + * Returns the destination netif or NULL if no destination netif is found. In + * that case, ip_route() continues as normal. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_IP4_ROUTE() +#endif + +/** + * LWIP_HOOK_IP4_ROUTE_SRC(dest, src): + * - source-based routing for IPv4 (see LWIP_HOOK_IP4_ROUTE(), src may be NULL) + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) +#endif + +/** + * LWIP_HOOK_ETHARP_GET_GW(netif, dest): + * - called from etharp_output() (IPv4) + * - netif: the netif used for sending + * - dest: the destination IPv4 address + * Returns the IPv4 address of the gateway to handle the specified destination + * IPv4 address. If NULL is returned, the netif's default gateway is used. + * The returned address MUST be directly reachable on the specified netif! + * This function is meant to implement advanced IPv4 routing together with + * LWIP_HOOK_IP4_ROUTE(). The actual routing/gateway table implementation is + * not part of lwIP but can e.g. be hidden in the netif's state argument. +*/ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_ETHARP_GET_GW(netif, dest) +#endif + +/** + * LWIP_HOOK_IP6_INPUT(pbuf, input_netif): + * - called from ip6_input() (IPv6) + * - pbuf: received struct pbuf passed to ip6_input() + * - input_netif: struct netif on which the packet has been received + * Return values: + * - 0: Hook has not consumed the packet, packet is processed as normal + * - != 0: Hook has consumed the packet. + * If the hook consumed the packet, 'pbuf' is in the responsibility of the hook + * (i.e. free it when done). + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_IP6_INPUT(pbuf, input_netif) +#endif + +/** + * LWIP_HOOK_IP6_ROUTE(src, dest): + * - called from ip6_route() (IPv6) + * - src: sourc IPv6 address + * - dest: destination IPv6 address + * Returns the destination netif or NULL if no destination netif is found. In + * that case, ip6_route() continues as normal. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_IP6_ROUTE(src, dest) +#endif + +/** + * LWIP_HOOK_ND6_GET_GW(netif, dest): + * - called from nd6_get_next_hop_entry() (IPv6) + * - netif: the netif used for sending + * - dest: the destination IPv6 address + * Returns the IPv6 address of the next hop to handle the specified destination + * IPv6 address. If NULL is returned, a NDP-discovered router is used instead. + * The returned address MUST be directly reachable on the specified netif! + * This function is meant to implement advanced IPv6 routing together with + * LWIP_HOOK_IP6_ROUTE(). The actual routing/gateway table implementation is + * not part of lwIP but can e.g. be hidden in the netif's state argument. +*/ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_ND6_GET_GW(netif, dest) +#endif + +/** + * LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr): + * - called from ethernet_input() if VLAN support is enabled + * - netif: struct netif on which the packet has been received + * - eth_hdr: struct eth_hdr of the packet + * - vlan_hdr: struct eth_vlan_hdr of the packet + * Return values: + * - 0: Packet must be dropped. + * - != 0: Packet must be accepted. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr) +#endif + +/** + * LWIP_HOOK_VLAN_SET: + * Hook can be used to set prio_vid field of vlan_hdr. If you need to store data + * on per-netif basis to implement this callback, see @ref netif_cd. + * Called from ethernet_output() if VLAN support (@ref ETHARP_SUPPORT_VLAN) is enabled.\n + * Signature: s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);\n + * Arguments: + * - netif: struct netif that the packet will be sent through + * - p: struct pbuf packet to be sent + * - src: source eth address + * - dst: destination eth address + * - eth_type: ethernet type to packet to be sent\n + * + * + * Return values: + * - <0: Packet shall not contain VLAN header. + * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) +#endif + +/** + * LWIP_HOOK_MEMP_AVAILABLE(memp_t_type): + * - called from memp_free() when a memp pool was empty and an item is now available + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type) +#endif + +/** + * LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif): + * Called from ethernet_input() when an unknown eth type is encountered. + * Return ERR_OK if packet is accepted, any error code otherwise. + * Payload points to ethernet header! + */ +#ifdef __DOXYGEN__ +#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif) +#endif +/** + * @} + */ + +/* + --------------------------------------- + ---------- Debugging options ---------- + --------------------------------------- +*/ +/** + * @defgroup lwip_opts_debugmsg Debug messages + * @ingroup lwip_opts_debug + * @{ + */ +/** + * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is + * compared against this value. If it is smaller, then debugging + * messages are written. + * @see debugging_levels + */ +#if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ +#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL +#endif + +/** + * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable + * debug messages of certain types. + * @see debugging_levels + */ +#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ +#define LWIP_DBG_TYPES_ON LWIP_DBG_ON +#endif + +/** + * ETHARP_DEBUG: Enable debugging in etharp.c. + */ +#if !defined ETHARP_DEBUG || defined __DOXYGEN__ +#define ETHARP_DEBUG LWIP_DBG_OFF +#endif + +/** + * NETIF_DEBUG: Enable debugging in netif.c. + */ +#if !defined NETIF_DEBUG || defined __DOXYGEN__ +#define NETIF_DEBUG LWIP_DBG_OFF +#endif + +/** + * PBUF_DEBUG: Enable debugging in pbuf.c. + */ +#if !defined PBUF_DEBUG || defined __DOXYGEN__ +#define PBUF_DEBUG LWIP_DBG_OFF +#endif + +/** + * API_LIB_DEBUG: Enable debugging in api_lib.c. + */ +#if !defined API_LIB_DEBUG || defined __DOXYGEN__ +#define API_LIB_DEBUG LWIP_DBG_OFF +#endif + +/** + * API_MSG_DEBUG: Enable debugging in api_msg.c. + */ +#if !defined API_MSG_DEBUG || defined __DOXYGEN__ +#define API_MSG_DEBUG LWIP_DBG_OFF +#endif + +/** + * SOCKETS_DEBUG: Enable debugging in sockets.c. + */ +#if !defined SOCKETS_DEBUG || defined __DOXYGEN__ +#define SOCKETS_DEBUG LWIP_DBG_OFF +#endif + +/** + * ICMP_DEBUG: Enable debugging in icmp.c. + */ +#if !defined ICMP_DEBUG || defined __DOXYGEN__ +#define ICMP_DEBUG LWIP_DBG_OFF +#endif + +/** + * IGMP_DEBUG: Enable debugging in igmp.c. + */ +#if !defined IGMP_DEBUG || defined __DOXYGEN__ +#define IGMP_DEBUG LWIP_DBG_OFF +#endif + +/** + * INET_DEBUG: Enable debugging in inet.c. + */ +#if !defined INET_DEBUG || defined __DOXYGEN__ +#define INET_DEBUG LWIP_DBG_OFF +#endif + +/** + * IP_DEBUG: Enable debugging for IP. + */ +#if !defined IP_DEBUG || defined __DOXYGEN__ +#define IP_DEBUG LWIP_DBG_OFF +#endif + +/** + * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. + */ +#if !defined IP_REASS_DEBUG || defined __DOXYGEN__ +#define IP_REASS_DEBUG LWIP_DBG_OFF +#endif + +/** + * RAW_DEBUG: Enable debugging in raw.c. + */ +#if !defined RAW_DEBUG || defined __DOXYGEN__ +#define RAW_DEBUG LWIP_DBG_OFF +#endif + +/** + * MEM_DEBUG: Enable debugging in mem.c. + */ +#if !defined MEM_DEBUG || defined __DOXYGEN__ +#define MEM_DEBUG LWIP_DBG_OFF +#endif + +/** + * MEMP_DEBUG: Enable debugging in memp.c. + */ +#if !defined MEMP_DEBUG || defined __DOXYGEN__ +#define MEMP_DEBUG LWIP_DBG_OFF +#endif + +/** + * SYS_DEBUG: Enable debugging in sys.c. + */ +#if !defined SYS_DEBUG || defined __DOXYGEN__ +#define SYS_DEBUG LWIP_DBG_OFF +#endif + +/** + * TIMERS_DEBUG: Enable debugging in timers.c. + */ +#if !defined TIMERS_DEBUG || defined __DOXYGEN__ +#define TIMERS_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_DEBUG: Enable debugging for TCP. + */ +#if !defined TCP_DEBUG || defined __DOXYGEN__ +#define TCP_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. + */ +#if !defined TCP_INPUT_DEBUG || defined __DOXYGEN__ +#define TCP_INPUT_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. + */ +#if !defined TCP_FR_DEBUG || defined __DOXYGEN__ +#define TCP_FR_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit + * timeout. + */ +#if !defined TCP_RTO_DEBUG || defined __DOXYGEN__ +#define TCP_RTO_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. + */ +#if !defined TCP_CWND_DEBUG || defined __DOXYGEN__ +#define TCP_CWND_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. + */ +#if !defined TCP_WND_DEBUG || defined __DOXYGEN__ +#define TCP_WND_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. + */ +#if !defined TCP_OUTPUT_DEBUG || defined __DOXYGEN__ +#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. + */ +#if !defined TCP_RST_DEBUG || defined __DOXYGEN__ +#define TCP_RST_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. + */ +#if !defined TCP_QLEN_DEBUG || defined __DOXYGEN__ +#define TCP_QLEN_DEBUG LWIP_DBG_OFF +#endif + +/** + * UDP_DEBUG: Enable debugging in UDP. + */ +#if !defined UDP_DEBUG || defined __DOXYGEN__ +#define UDP_DEBUG LWIP_DBG_OFF +#endif + +/** + * TCPIP_DEBUG: Enable debugging in tcpip.c. + */ +#if !defined TCPIP_DEBUG || defined __DOXYGEN__ +#define TCPIP_DEBUG LWIP_DBG_OFF +#endif + +/** + * SLIP_DEBUG: Enable debugging in slipif.c. + */ +#if !defined SLIP_DEBUG || defined __DOXYGEN__ +#define SLIP_DEBUG LWIP_DBG_OFF +#endif + +/** + * DHCP_DEBUG: Enable debugging in dhcp.c. + */ +#if !defined DHCP_DEBUG || defined __DOXYGEN__ +#define DHCP_DEBUG LWIP_DBG_OFF +#endif + +/** + * AUTOIP_DEBUG: Enable debugging in autoip.c. + */ +#if !defined AUTOIP_DEBUG || defined __DOXYGEN__ +#define AUTOIP_DEBUG LWIP_DBG_OFF +#endif + +/** + * DNS_DEBUG: Enable debugging for DNS. + */ +#if !defined DNS_DEBUG || defined __DOXYGEN__ +#define DNS_DEBUG LWIP_DBG_OFF +#endif + +/** + * IP6_DEBUG: Enable debugging for IPv6. + */ +#if !defined IP6_DEBUG || defined __DOXYGEN__ +#define IP6_DEBUG LWIP_DBG_OFF +#endif +/** + * @} + */ + +/* + -------------------------------------------------- + ---------- Performance tracking options ---------- + -------------------------------------------------- +*/ +/** + * @defgroup lwip_opts_perf Performance + * @ingroup lwip_opts_debug + * @{ + */ +/** + * LWIP_PERF: Enable performance testing for lwIP + * (if enabled, arch/perf.h is included) + */ +#if !defined LWIP_PERF || defined __DOXYGEN__ +#define LWIP_PERF 0 +#endif +/** + * @} + */ + +#endif /* LWIP_HDR_OPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/pbuf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/pbuf.h new file mode 100644 index 0000000..9061046 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/pbuf.h @@ -0,0 +1,263 @@ +/** + * @file + * pbuf API + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#ifndef LWIP_HDR_PBUF_H +#define LWIP_HDR_PBUF_H + +#include "lwip/opt.h" +#include "lwip/err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type + * but they are allocated by external code (initialised by calling + * pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they + * are freed by calling pbuf_custom->custom_free_function(). + * Currently, the pbuf_custom code is only needed for one specific configuration + * of IP_FRAG, unless required by external driver/application code. */ +#ifndef LWIP_SUPPORT_CUSTOM_PBUF +#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) +#endif + +/* @todo: We need a mechanism to prevent wasting memory in every pbuf + (TCP vs. UDP, IPv4 vs. IPv6: UDP/IPv4 packets may waste up to 28 bytes) */ + +#define PBUF_TRANSPORT_HLEN 20 +#if LWIP_IPV6 +#define PBUF_IP_HLEN 40 +#else +#define PBUF_IP_HLEN 20 +#endif + +/** + * @ingroup pbuf + * Enumeration of pbuf layers + */ +typedef enum { + /** Includes spare room for transport layer header, e.g. UDP header. + * Use this if you intend to pass the pbuf to functions like udp_send(). + */ + PBUF_TRANSPORT, + /** Includes spare room for IP header. + * Use this if you intend to pass the pbuf to functions like raw_send(). + */ + PBUF_IP, + /** Includes spare room for link layer header (ethernet header). + * Use this if you intend to pass the pbuf to functions like ethernet_output(). + * @see PBUF_LINK_HLEN + */ + PBUF_LINK, + /** Includes spare room for additional encapsulation header before ethernet + * headers (e.g. 802.11). + * Use this if you intend to pass the pbuf to functions like netif->linkoutput(). + * @see PBUF_LINK_ENCAPSULATION_HLEN + */ + PBUF_RAW_TX, + /** Use this for input packets in a netif driver when calling netif->input() + * in the most common case - ethernet-layer netif driver. */ + PBUF_RAW +} pbuf_layer; + +/** + * @ingroup pbuf + * Enumeration of pbuf types + */ +typedef enum { + /** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload + are allocated in one piece of contiguous memory (so the first payload byte + can be calculated from struct pbuf). + pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might + change in future versions). + This should be used for all OUTGOING packets (TX).*/ + PBUF_RAM, + /** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in + totally different memory areas. Since it points to ROM, payload does not + have to be copied when queued for transmission. */ + PBUF_ROM, + /** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change + so it has to be duplicated when queued before transmitting, depending on + who has a 'ref' to it. */ + PBUF_REF, + /** pbuf payload refers to RAM. This one comes from a pool and should be used + for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct + pbuf and its payload are allocated in one piece of contiguous memory (so + the first payload byte can be calculated from struct pbuf). + Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing, + you are unable to receive TCP acks! */ + PBUF_POOL +} pbuf_type; + + +/** indicates this packet's data should be immediately passed to the application */ +#define PBUF_FLAG_PUSH 0x01U +/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function() + when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */ +#define PBUF_FLAG_IS_CUSTOM 0x02U +/** indicates this pbuf is UDP multicast to be looped back */ +#define PBUF_FLAG_MCASTLOOP 0x04U +/** indicates this pbuf was received as link-level broadcast */ +#define PBUF_FLAG_LLBCAST 0x08U +/** indicates this pbuf was received as link-level multicast */ +#define PBUF_FLAG_LLMCAST 0x10U +/** indicates this pbuf includes a TCP FIN flag */ +#define PBUF_FLAG_TCP_FIN 0x20U + +/** Main packet buffer struct */ +struct pbuf { + /** next pbuf in singly linked pbuf chain */ + struct pbuf *next; + + /** pointer to the actual data in the buffer */ + void *payload; + + /** + * total length of this buffer and all next buffers in chain + * belonging to the same packet. + * + * For non-queue packet chains this is the invariant: + * p->tot_len == p->len + (p->next? p->next->tot_len: 0) + */ + u16_t tot_len; + + /** length of this buffer */ + u16_t len; + + /** pbuf_type as u8_t instead of enum to save space */ + u8_t /*pbuf_type*/ type; + + /** misc flags */ + u8_t flags; + + /** + * the reference count always equals the number of pointers + * that refer to this pbuf. This can be pointers from an application, + * the stack itself, or pbuf->next pointers from a chain. + */ + u16_t ref; +}; + + +/** Helper struct for const-correctness only. + * The only meaning of this one is to provide a const payload pointer + * for PBUF_ROM type. + */ +struct pbuf_rom { + /** next pbuf in singly linked pbuf chain */ + struct pbuf *next; + + /** pointer to the actual data in the buffer */ + const void *payload; +}; + +#if LWIP_SUPPORT_CUSTOM_PBUF +/** Prototype for a function to free a custom pbuf */ +typedef void (*pbuf_free_custom_fn)(struct pbuf *p); + +/** A custom pbuf: like a pbuf, but following a function pointer to free it. */ +struct pbuf_custom { + /** The actual pbuf */ + struct pbuf pbuf; + /** This function is called when pbuf_free deallocates this pbuf(_custom) */ + pbuf_free_custom_fn custom_free_function; +}; +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ + +/** Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty */ +#ifndef PBUF_POOL_FREE_OOSEQ +#define PBUF_POOL_FREE_OOSEQ 1 +#endif /* PBUF_POOL_FREE_OOSEQ */ +#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ +extern volatile u8_t pbuf_free_ooseq_pending; +void pbuf_free_ooseq(void); +/** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() + at regular intervals from main level to check if ooseq pbufs need to be + freed! */ +#define PBUF_CHECK_FREE_OOSEQ() do { if(pbuf_free_ooseq_pending) { \ + /* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \ + ooseq queued pbufs now */ \ + pbuf_free_ooseq(); }}while(0) +#else /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ */ + /* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */ + #define PBUF_CHECK_FREE_OOSEQ() +#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ*/ + +/* Initializes the pbuf module. This call is empty for now, but may not be in future. */ +#define pbuf_init() + +struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type); +#if LWIP_SUPPORT_CUSTOM_PBUF +struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, + struct pbuf_custom *p, void *payload_mem, + u16_t payload_mem_len); +#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ +void pbuf_realloc(struct pbuf *p, u16_t size); +u8_t pbuf_header(struct pbuf *p, s16_t header_size); +u8_t pbuf_header_force(struct pbuf *p, s16_t header_size); +void pbuf_ref(struct pbuf *p); +u8_t pbuf_free(struct pbuf *p); +u16_t pbuf_clen(const struct pbuf *p); +void pbuf_cat(struct pbuf *head, struct pbuf *tail); +void pbuf_chain(struct pbuf *head, struct pbuf *tail); +struct pbuf *pbuf_dechain(struct pbuf *p); +err_t pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from); +u16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, u16_t len, u16_t offset); +err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len); +err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset); +struct pbuf *pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset); +struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer); +#if LWIP_CHECKSUM_ON_COPY +err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr, + u16_t len, u16_t *chksum); +#endif /* LWIP_CHECKSUM_ON_COPY */ +#if LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE +void pbuf_split_64k(struct pbuf *p, struct pbuf **rest); +#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ + +u8_t pbuf_get_at(const struct pbuf* p, u16_t offset); +int pbuf_try_get_at(const struct pbuf* p, u16_t offset); +void pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data); +u16_t pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n); +u16_t pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset); +u16_t pbuf_strstr(const struct pbuf* p, const char* substr); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PBUF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/api_msg.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/api_msg.h new file mode 100644 index 0000000..f12b8b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/api_msg.h @@ -0,0 +1,216 @@ +/** + * @file + * netconn API lwIP internal implementations (do not use in application code) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_API_MSG_H +#define LWIP_HDR_API_MSG_H + +#include "lwip/opt.h" + +#if LWIP_NETCONN || LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ +/* Note: Netconn API is always available when sockets are enabled - + * sockets are implemented on top of them */ + +#include "lwip/arch.h" +#include "lwip/ip_addr.h" +#include "lwip/err.h" +#include "lwip/sys.h" +#include "lwip/igmp.h" +#include "lwip/api.h" +#include "lwip/priv/tcpip_priv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_MPU_COMPATIBLE +#if LWIP_NETCONN_SEM_PER_THREAD +#define API_MSG_M_DEF_SEM(m) *m +#else +#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m) +#endif +#else /* LWIP_MPU_COMPATIBLE */ +#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m) +#endif /* LWIP_MPU_COMPATIBLE */ + +/* For the netconn API, these values are use as a bitmask! */ +#define NETCONN_SHUT_RD 1 +#define NETCONN_SHUT_WR 2 +#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR) + +/* IP addresses and port numbers are expected to be in + * the same byte order as in the corresponding pcb. + */ +/** This struct includes everything that is necessary to execute a function + for a netconn in another thread context (mainly used to process netconns + in the tcpip_thread context to be thread safe). */ +struct api_msg { + /** The netconn which to process - always needed: it includes the semaphore + which is used to block the application thread until the function finished. */ + struct netconn *conn; + /** The return value of the function executed in tcpip_thread. */ + err_t err; + /** Depending on the executed function, one of these union members is used */ + union { + /** used for lwip_netconn_do_send */ + struct netbuf *b; + /** used for lwip_netconn_do_newconn */ + struct { + u8_t proto; + } n; + /** used for lwip_netconn_do_bind and lwip_netconn_do_connect */ + struct { + API_MSG_M_DEF_C(ip_addr_t, ipaddr); + u16_t port; + } bc; + /** used for lwip_netconn_do_getaddr */ + struct { + ip_addr_t API_MSG_M_DEF(ipaddr); + u16_t API_MSG_M_DEF(port); + u8_t local; + } ad; + /** used for lwip_netconn_do_write */ + struct { + const void *dataptr; + size_t len; + u8_t apiflags; +#if LWIP_SO_SNDTIMEO + u32_t time_started; +#endif /* LWIP_SO_SNDTIMEO */ + } w; + /** used for lwip_netconn_do_recv */ + struct { + u32_t len; + } r; +#if LWIP_TCP + /** used for lwip_netconn_do_close (/shutdown) */ + struct { + u8_t shut; +#if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER + u32_t time_started; +#else /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + u8_t polls_left; +#endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ + } sd; +#endif /* LWIP_TCP */ +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) + /** used for lwip_netconn_do_join_leave_group */ + struct { + API_MSG_M_DEF_C(ip_addr_t, multiaddr); + API_MSG_M_DEF_C(ip_addr_t, netif_addr); + enum netconn_igmp join_or_leave; + } jl; +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ +#if TCP_LISTEN_BACKLOG + struct { + u8_t backlog; + } lb; +#endif /* TCP_LISTEN_BACKLOG */ + } msg; +#if LWIP_NETCONN_SEM_PER_THREAD + sys_sem_t* op_completed_sem; +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ +}; + +#if LWIP_NETCONN_SEM_PER_THREAD +#define LWIP_API_MSG_SEM(msg) ((msg)->op_completed_sem) +#else /* LWIP_NETCONN_SEM_PER_THREAD */ +#define LWIP_API_MSG_SEM(msg) (&(msg)->conn->op_completed) +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ + + +#if LWIP_DNS +/** As lwip_netconn_do_gethostbyname requires more arguments but doesn't require a netconn, + it has its own struct (to avoid struct api_msg getting bigger than necessary). + lwip_netconn_do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg + (see netconn_gethostbyname). */ +struct dns_api_msg { + /** Hostname to query or dotted IP address string */ +#if LWIP_MPU_COMPATIBLE + char name[DNS_MAX_NAME_LENGTH]; +#else /* LWIP_MPU_COMPATIBLE */ + const char *name; +#endif /* LWIP_MPU_COMPATIBLE */ + /** The resolved address is stored here */ + ip_addr_t API_MSG_M_DEF(addr); +#if LWIP_IPV4 && LWIP_IPV6 + /** Type of resolve call */ + u8_t dns_addrtype; +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + /** This semaphore is posted when the name is resolved, the application thread + should wait on it. */ + sys_sem_t API_MSG_M_DEF_SEM(sem); + /** Errors are given back here */ + err_t API_MSG_M_DEF(err); +}; +#endif /* LWIP_DNS */ + +#if LWIP_TCP +extern u8_t netconn_aborted; +#endif /* LWIP_TCP */ + +void lwip_netconn_do_newconn (void *m); +void lwip_netconn_do_delconn (void *m); +void lwip_netconn_do_bind (void *m); +void lwip_netconn_do_connect (void *m); +void lwip_netconn_do_disconnect (void *m); +void lwip_netconn_do_listen (void *m); +void lwip_netconn_do_send (void *m); +void lwip_netconn_do_recv (void *m); +#if TCP_LISTEN_BACKLOG +void lwip_netconn_do_accepted (void *m); +#endif /* TCP_LISTEN_BACKLOG */ +void lwip_netconn_do_write (void *m); +void lwip_netconn_do_getaddr (void *m); +void lwip_netconn_do_close (void *m); +void lwip_netconn_do_shutdown (void *m); +#if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) +void lwip_netconn_do_join_leave_group(void *m); +#endif /* LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) */ + +#if LWIP_DNS +void lwip_netconn_do_gethostbyname(void *arg); +#endif /* LWIP_DNS */ + +struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback); +void netconn_free(struct netconn *conn); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_NETCONN || LWIP_SOCKET */ + +#endif /* LWIP_HDR_API_MSG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_priv.h new file mode 100644 index 0000000..f246061 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_priv.h @@ -0,0 +1,183 @@ +/** + * @file + * memory pools lwIP internal implementations (do not use in application code) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#ifndef LWIP_HDR_MEMP_PRIV_H +#define LWIP_HDR_MEMP_PRIV_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lwip/mem.h" + +#if MEMP_OVERFLOW_CHECK +/* if MEMP_OVERFLOW_CHECK is turned on, we reserve some bytes at the beginning + * and at the end of each element, initialize them as 0xcd and check + * them later. */ +/* If MEMP_OVERFLOW_CHECK is >= 2, on every call to memp_malloc or memp_free, + * every single element in each pool is checked! + * This is VERY SLOW but also very helpful. */ +/* MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER can be overridden in + * lwipopts.h to change the amount reserved for checking. */ +#ifndef MEMP_SANITY_REGION_BEFORE +#define MEMP_SANITY_REGION_BEFORE 16 +#endif /* MEMP_SANITY_REGION_BEFORE*/ +#if MEMP_SANITY_REGION_BEFORE > 0 +#define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE) +#else +#define MEMP_SANITY_REGION_BEFORE_ALIGNED 0 +#endif /* MEMP_SANITY_REGION_BEFORE*/ +#ifndef MEMP_SANITY_REGION_AFTER +#define MEMP_SANITY_REGION_AFTER 16 +#endif /* MEMP_SANITY_REGION_AFTER*/ +#if MEMP_SANITY_REGION_AFTER > 0 +#define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER) +#else +#define MEMP_SANITY_REGION_AFTER_ALIGNED 0 +#endif /* MEMP_SANITY_REGION_AFTER*/ + +/* MEMP_SIZE: save space for struct memp and for sanity check */ +#define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED) +#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED) + +#else /* MEMP_OVERFLOW_CHECK */ + +/* No sanity checks + * We don't need to preserve the struct memp while not allocated, so we + * can save a little space and set MEMP_SIZE to 0. + */ +#define MEMP_SIZE 0 +#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x)) + +#endif /* MEMP_OVERFLOW_CHECK */ + +#if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK +struct memp { + struct memp *next; +#if MEMP_OVERFLOW_CHECK + const char *file; + int line; +#endif /* MEMP_OVERFLOW_CHECK */ +}; +#endif /* !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK */ + +#if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS +/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */ +typedef enum { + /* Get the first (via: + MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/ + MEMP_POOL_HELPER_FIRST = ((u8_t) +#define LWIP_MEMPOOL(name,num,size,desc) +#define LWIP_MALLOC_MEMPOOL_START 1 +#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0 +#define LWIP_MALLOC_MEMPOOL_END +#include "lwip/priv/memp_std.h" + ) , + /* Get the last (via: + MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */ + MEMP_POOL_HELPER_LAST = ((u8_t) +#define LWIP_MEMPOOL(name,num,size,desc) +#define LWIP_MALLOC_MEMPOOL_START +#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size * +#define LWIP_MALLOC_MEMPOOL_END 1 +#include "lwip/priv/memp_std.h" + ) +} memp_pool_helper_t; + +/* The actual start and stop values are here (cast them over) + We use this helper type and these defines so we can avoid using const memp_t values */ +#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST) +#define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST) +#endif /* MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS */ + +/** Memory pool descriptor */ +struct memp_desc { +#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY + /** Textual description */ + const char *desc; +#endif /* LWIP_DEBUG || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY */ +#if MEMP_STATS + /** Statistics */ + struct stats_mem *stats; +#endif + + /** Element size */ + u16_t size; + +#if !MEMP_MEM_MALLOC + /** Number of elements */ + u16_t num; + + /** Base address */ + u8_t *base; + + /** First free element of each pool. Elements form a linked list. */ + struct memp **tab; +#endif /* MEMP_MEM_MALLOC */ +}; + +#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY +#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc), +#else +#define DECLARE_LWIP_MEMPOOL_DESC(desc) +#endif + +#if MEMP_STATS +#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name; +#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name, +#else +#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) +#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) +#endif + +void memp_init_pool(const struct memp_desc *desc); + +#if MEMP_OVERFLOW_CHECK +void *memp_malloc_pool_fn(const struct memp_desc* desc, const char* file, const int line); +#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__) +#else +void *memp_malloc_pool(const struct memp_desc *desc); +#endif +void memp_free_pool(const struct memp_desc* desc, void *mem); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_MEMP_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_std.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_std.h new file mode 100644 index 0000000..ce9fd50 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/memp_std.h @@ -0,0 +1,146 @@ +/** + * @file + * lwIP internal memory pools (do not use in application code) + * This file is deliberately included multiple times: once with empty + * definition of LWIP_MEMPOOL() to handle all includes and multiple times + * to build up various lists of mem pools. + */ + +/* + * SETUP: Make sure we define everything we will need. + * + * We have create three types of pools: + * 1) MEMPOOL - standard pools + * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c + * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct + * + * If the include'r doesn't require any special treatment of each of the types + * above, then will declare #2 & #3 to be just standard mempools. + */ +#ifndef LWIP_MALLOC_MEMPOOL +/* This treats "malloc pools" just like any other pool. + The pools are a little bigger to provide 'size' as the amount of user data. */ +#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))), "MALLOC_"#size) +#define LWIP_MALLOC_MEMPOOL_START +#define LWIP_MALLOC_MEMPOOL_END +#endif /* LWIP_MALLOC_MEMPOOL */ + +#ifndef LWIP_PBUF_MEMPOOL +/* This treats "pbuf pools" just like any other pool. + * Allocates buffers for a pbuf struct AND a payload size */ +#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc) +#endif /* LWIP_PBUF_MEMPOOL */ + + +/* + * A list of internal pools used by LWIP. + * + * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) + * creates a pool name MEMP_pool_name. description is used in stats.c + */ +#if LWIP_RAW +LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB") +#endif /* LWIP_RAW */ + +#if LWIP_UDP +LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB") +#endif /* LWIP_UDP */ + +#if LWIP_TCP +LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB") +LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN") +LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG") +#endif /* LWIP_TCP */ + +#if LWIP_IPV4 && IP_REASSEMBLY +LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA") +#endif /* LWIP_IPV4 && IP_REASSEMBLY */ +#if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG) +LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF") +#endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */ + +#if LWIP_NETCONN || LWIP_SOCKET +LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") +LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") +#endif /* LWIP_NETCONN || LWIP_SOCKET */ + +#if NO_SYS==0 +LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") +#if LWIP_MPU_COMPATIBLE +LWIP_MEMPOOL(API_MSG, MEMP_NUM_API_MSG, sizeof(struct api_msg), "API_MSG") +#if LWIP_DNS +LWIP_MEMPOOL(DNS_API_MSG, MEMP_NUM_DNS_API_MSG, sizeof(struct dns_api_msg), "DNS_API_MSG") +#endif +#if LWIP_SOCKET && !LWIP_TCPIP_CORE_LOCKING +LWIP_MEMPOOL(SOCKET_SETGETSOCKOPT_DATA, MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA, sizeof(struct lwip_setgetsockopt_data), "SOCKET_SETGETSOCKOPT_DATA") +#endif +#if LWIP_NETIF_API +LWIP_MEMPOOL(NETIFAPI_MSG, MEMP_NUM_NETIFAPI_MSG, sizeof(struct netifapi_msg), "NETIFAPI_MSG") +#endif +#endif /* LWIP_MPU_COMPATIBLE */ +#if !LWIP_TCPIP_CORE_LOCKING_INPUT +LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") +#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ +#endif /* NO_SYS==0 */ + +#if LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING +LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE") +#endif /* LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING */ + +#if LWIP_IGMP +LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP") +#endif /* LWIP_IGMP */ + +#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM +LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT") +#endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */ + +#if LWIP_DNS && LWIP_SOCKET +LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") +#endif /* LWIP_DNS && LWIP_SOCKET */ +#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC +LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST") +#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ + +#if LWIP_IPV6 && LWIP_ND6_QUEUEING +LWIP_MEMPOOL(ND6_QUEUE, MEMP_NUM_ND6_QUEUE, sizeof(struct nd6_q_entry), "ND6_QUEUE") +#endif /* LWIP_IPV6 && LWIP_ND6_QUEUEING */ + +#if LWIP_IPV6 && LWIP_IPV6_REASS +LWIP_MEMPOOL(IP6_REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip6_reassdata), "IP6_REASSDATA") +#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */ + +#if LWIP_IPV6 && LWIP_IPV6_MLD +LWIP_MEMPOOL(MLD6_GROUP, MEMP_NUM_MLD6_GROUP, sizeof(struct mld_group), "MLD6_GROUP") +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ + + +/* + * A list of pools of pbuf's used by LWIP. + * + * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) + * creates a pool name MEMP_pool_name. description is used in stats.c + * This allocates enough space for the pbuf struct and a payload. + * (Example: pbuf_payload_size=0 allocates only size for the struct) + */ +LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM") +LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL") + + +/* + * Allow for user-defined pools; this must be explicitly set in lwipopts.h + * since the default is to NOT look for lwippools.h + */ +#if MEMP_USE_CUSTOM_POOLS +#include "lwippools.h" +#endif /* MEMP_USE_CUSTOM_POOLS */ + +/* + * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later + * (#undef is ignored for something that is not defined) + */ +#undef LWIP_MEMPOOL +#undef LWIP_MALLOC_MEMPOOL +#undef LWIP_MALLOC_MEMPOOL_START +#undef LWIP_MALLOC_MEMPOOL_END +#undef LWIP_PBUF_MEMPOOL diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/nd6_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/nd6_priv.h new file mode 100644 index 0000000..4bda0b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/nd6_priv.h @@ -0,0 +1,144 @@ +/** + * @file + * + * Neighbor discovery and stateless address autoconfiguration for IPv6. + * Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 + * (Address autoconfiguration). + */ + +/* + * Copyright (c) 2010 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_ND6_PRIV_H +#define LWIP_HDR_ND6_PRIV_H + +#include "lwip/opt.h" + +#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/ip6_addr.h" +#include "lwip/netif.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_ND6_QUEUEING +/** struct for queueing outgoing packets for unknown address + * defined here to be accessed by memp.h + */ +struct nd6_q_entry { + struct nd6_q_entry *next; + struct pbuf *p; +}; +#endif /* LWIP_ND6_QUEUEING */ + +/** Struct for tables. */ +struct nd6_neighbor_cache_entry { + ip6_addr_t next_hop_address; + struct netif *netif; + u8_t lladdr[NETIF_MAX_HWADDR_LEN]; + /*u32_t pmtu;*/ +#if LWIP_ND6_QUEUEING + /** Pointer to queue of pending outgoing packets on this entry. */ + struct nd6_q_entry *q; +#else /* LWIP_ND6_QUEUEING */ + /** Pointer to a single pending outgoing packet on this entry. */ + struct pbuf *q; +#endif /* LWIP_ND6_QUEUEING */ + u8_t state; + u8_t isrouter; + union { + u32_t reachable_time; /* in ms since value may originate from network packet */ + u32_t delay_time; /* ticks (ND6_TMR_INTERVAL) */ + u32_t probes_sent; + u32_t stale_time; /* ticks (ND6_TMR_INTERVAL) */ + } counter; +}; + +struct nd6_destination_cache_entry { + ip6_addr_t destination_addr; + ip6_addr_t next_hop_addr; + u16_t pmtu; + u32_t age; +}; + +struct nd6_prefix_list_entry { + ip6_addr_t prefix; + struct netif *netif; + u32_t invalidation_timer; /* in ms since value may originate from network packet */ +#if LWIP_IPV6_AUTOCONFIG + u8_t flags; +#define ND6_PREFIX_AUTOCONFIG_AUTONOMOUS 0x01 +#define ND6_PREFIX_AUTOCONFIG_ADDRESS_GENERATED 0x02 +#define ND6_PREFIX_AUTOCONFIG_ADDRESS_DUPLICATE 0x04 +#endif /* LWIP_IPV6_AUTOCONFIG */ +}; + +struct nd6_router_list_entry { + struct nd6_neighbor_cache_entry *neighbor_entry; + u32_t invalidation_timer; /* in ms since value may originate from network packet */ + u8_t flags; +}; + +enum nd6_neighbor_cache_entry_state { + ND6_NO_ENTRY = 0, + ND6_INCOMPLETE, + ND6_REACHABLE, + ND6_STALE, + ND6_DELAY, + ND6_PROBE +}; + +/* Router tables. */ +/* @todo make these static? and entries accessible through API? */ +extern struct nd6_neighbor_cache_entry neighbor_cache[]; +extern struct nd6_destination_cache_entry destination_cache[]; +extern struct nd6_prefix_list_entry prefix_list[]; +extern struct nd6_router_list_entry default_router_list[]; + +/* Default values, can be updated by a RA message. */ +extern u32_t reachable_time; +extern u32_t retrans_timer; + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 */ + +#endif /* LWIP_HDR_ND6_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcp_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcp_priv.h new file mode 100644 index 0000000..73e8967 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcp_priv.h @@ -0,0 +1,507 @@ +/** + * @file + * TCP internal implementations (do not use in application code) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_TCP_PRIV_H +#define LWIP_HDR_TCP_PRIV_H + +#include "lwip/opt.h" + +#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/tcp.h" +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/ip.h" +#include "lwip/icmp.h" +#include "lwip/err.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" +#include "lwip/prot/tcp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Functions for interfacing with TCP: */ + +/* Lower layer interface to TCP: */ +void tcp_init (void); /* Initialize this module. */ +void tcp_tmr (void); /* Must be called every + TCP_TMR_INTERVAL + ms. (Typically 250 ms). */ +/* It is also possible to call these two functions at the right + intervals (instead of calling tcp_tmr()). */ +void tcp_slowtmr (void); +void tcp_fasttmr (void); + +/* Call this from a netif driver (watch out for threading issues!) that has + returned a memory error on transmit and now has free buffers to send more. + This iterates all active pcbs that had an error and tries to call + tcp_output, so use this with care as it might slow down the system. */ +void tcp_txnow (void); + +/* Only used by IP to pass a TCP segment to TCP: */ +void tcp_input (struct pbuf *p, struct netif *inp); +/* Used within the TCP code only: */ +struct tcp_pcb * tcp_alloc (u8_t prio); +void tcp_abandon (struct tcp_pcb *pcb, int reset); +err_t tcp_send_empty_ack(struct tcp_pcb *pcb); +void tcp_rexmit (struct tcp_pcb *pcb); +void tcp_rexmit_rto (struct tcp_pcb *pcb); +void tcp_rexmit_fast (struct tcp_pcb *pcb); +u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb); +err_t tcp_process_refused_data(struct tcp_pcb *pcb); + +/** + * This is the Nagle algorithm: try to combine user data to send as few TCP + * segments as possible. Only send if + * - no previously transmitted data on the connection remains unacknowledged or + * - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or + * - the only unsent segment is at least pcb->mss bytes long (or there is more + * than one unsent segment - with lwIP, this can happen although unsent->len < mss) + * - or if we are in fast-retransmit (TF_INFR) + */ +#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ + ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \ + (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \ + ((tpcb)->unsent->len >= (tpcb)->mss))) || \ + ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \ + ) ? 1 : 0) +#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK) + + +#define TCP_SEQ_LT(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) < 0) +#define TCP_SEQ_LEQ(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) <= 0) +#define TCP_SEQ_GT(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) > 0) +#define TCP_SEQ_GEQ(a,b) ((s32_t)((u32_t)(a) - (u32_t)(b)) >= 0) +/* is b<=a<=c? */ +#if 0 /* see bug #10548 */ +#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b)) +#endif +#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c)) + +#ifndef TCP_TMR_INTERVAL +#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */ +#endif /* TCP_TMR_INTERVAL */ + +#ifndef TCP_FAST_INTERVAL +#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */ +#endif /* TCP_FAST_INTERVAL */ + +#ifndef TCP_SLOW_INTERVAL +#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */ +#endif /* TCP_SLOW_INTERVAL */ + +#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */ +#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */ + +#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */ + +#ifndef TCP_MSL +#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */ +#endif + +/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */ +#ifndef TCP_KEEPIDLE_DEFAULT +#define TCP_KEEPIDLE_DEFAULT 7200000UL /* Default KEEPALIVE timer in milliseconds */ +#endif + +#ifndef TCP_KEEPINTVL_DEFAULT +#define TCP_KEEPINTVL_DEFAULT 75000UL /* Default Time between KEEPALIVE probes in milliseconds */ +#endif + +#ifndef TCP_KEEPCNT_DEFAULT +#define TCP_KEEPCNT_DEFAULT 9U /* Default Counter for KEEPALIVE probes */ +#endif + +#define TCP_MAXIDLE TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */ + +#define TCP_TCPLEN(seg) ((seg)->len + (((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0) ? 1U : 0U)) + +/** Flags used on input processing, not on pcb->flags +*/ +#define TF_RESET (u8_t)0x08U /* Connection was reset. */ +#define TF_CLOSED (u8_t)0x10U /* Connection was successfully closed. */ +#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */ + + +#if LWIP_EVENT_API + +#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) ret = lwip_tcp_event(arg, (pcb),\ + LWIP_EVENT_ACCEPT, NULL, 0, err) +#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ + LWIP_EVENT_SENT, NULL, space, ERR_OK) +#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ + LWIP_EVENT_RECV, (p), 0, (err)) +#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ + LWIP_EVENT_RECV, NULL, 0, ERR_OK) +#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ + LWIP_EVENT_CONNECTED, NULL, 0, (err)) +#define TCP_EVENT_POLL(pcb,ret) do { if ((pcb)->state != SYN_RCVD) { \ + ret = lwip_tcp_event((pcb)->callback_arg, (pcb), LWIP_EVENT_POLL, NULL, 0, ERR_OK); \ + } else { \ + ret = ERR_ARG; } } while(0) +#define TCP_EVENT_ERR(last_state,errf,arg,err) do { if (last_state != SYN_RCVD) { \ + lwip_tcp_event((arg), NULL, LWIP_EVENT_ERR, NULL, 0, (err)); } } while(0) + +#else /* LWIP_EVENT_API */ + +#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) \ + do { \ + if((lpcb)->accept != NULL) \ + (ret) = (lpcb)->accept((arg),(pcb),(err)); \ + else (ret) = ERR_ARG; \ + } while (0) + +#define TCP_EVENT_SENT(pcb,space,ret) \ + do { \ + if((pcb)->sent != NULL) \ + (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \ + else (ret) = ERR_OK; \ + } while (0) + +#define TCP_EVENT_RECV(pcb,p,err,ret) \ + do { \ + if((pcb)->recv != NULL) { \ + (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\ + } else { \ + (ret) = tcp_recv_null(NULL, (pcb), (p), (err)); \ + } \ + } while (0) + +#define TCP_EVENT_CLOSED(pcb,ret) \ + do { \ + if(((pcb)->recv != NULL)) { \ + (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\ + } else { \ + (ret) = ERR_OK; \ + } \ + } while (0) + +#define TCP_EVENT_CONNECTED(pcb,err,ret) \ + do { \ + if((pcb)->connected != NULL) \ + (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \ + else (ret) = ERR_OK; \ + } while (0) + +#define TCP_EVENT_POLL(pcb,ret) \ + do { \ + if((pcb)->poll != NULL) \ + (ret) = (pcb)->poll((pcb)->callback_arg,(pcb)); \ + else (ret) = ERR_OK; \ + } while (0) + +#define TCP_EVENT_ERR(last_state,errf,arg,err) \ + do { \ + LWIP_UNUSED_ARG(last_state); \ + if((errf) != NULL) \ + (errf)((arg),(err)); \ + } while (0) + +#endif /* LWIP_EVENT_API */ + +/** Enabled extra-check for TCP_OVERSIZE if LWIP_DEBUG is enabled */ +#if TCP_OVERSIZE && defined(LWIP_DEBUG) +#define TCP_OVERSIZE_DBGCHECK 1 +#else +#define TCP_OVERSIZE_DBGCHECK 0 +#endif + +/** Don't generate checksum on copy if CHECKSUM_GEN_TCP is disabled */ +#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP) + +/* This structure represents a TCP segment on the unsent, unacked and ooseq queues */ +struct tcp_seg { + struct tcp_seg *next; /* used when putting segments on a queue */ + struct pbuf *p; /* buffer containing data + TCP header */ + u16_t len; /* the TCP length of this segment */ +#if TCP_OVERSIZE_DBGCHECK + u16_t oversize_left; /* Extra bytes available at the end of the last + pbuf in unsent (used for asserting vs. + tcp_pcb.unsent_oversize only) */ +#endif /* TCP_OVERSIZE_DBGCHECK */ +#if TCP_CHECKSUM_ON_COPY + u16_t chksum; + u8_t chksum_swapped; +#endif /* TCP_CHECKSUM_ON_COPY */ + u8_t flags; +#define TF_SEG_OPTS_MSS (u8_t)0x01U /* Include MSS option. */ +#define TF_SEG_OPTS_TS (u8_t)0x02U /* Include timestamp option. */ +#define TF_SEG_DATA_CHECKSUMMED (u8_t)0x04U /* ALL data (not the header) is + checksummed into 'chksum' */ +#define TF_SEG_OPTS_WND_SCALE (u8_t)0x08U /* Include WND SCALE option */ + struct tcp_hdr *tcphdr; /* the TCP header */ +}; + +#define LWIP_TCP_OPT_EOL 0 +#define LWIP_TCP_OPT_NOP 1 +#define LWIP_TCP_OPT_MSS 2 +#define LWIP_TCP_OPT_WS 3 +#define LWIP_TCP_OPT_TS 8 + +#define LWIP_TCP_OPT_LEN_MSS 4 +#if LWIP_TCP_TIMESTAMPS +#define LWIP_TCP_OPT_LEN_TS 10 +#define LWIP_TCP_OPT_LEN_TS_OUT 12 /* aligned for output (includes NOP padding) */ +#else +#define LWIP_TCP_OPT_LEN_TS_OUT 0 +#endif +#if LWIP_WND_SCALE +#define LWIP_TCP_OPT_LEN_WS 3 +#define LWIP_TCP_OPT_LEN_WS_OUT 4 /* aligned for output (includes NOP padding) */ +#else +#define LWIP_TCP_OPT_LEN_WS_OUT 0 +#endif + +#define LWIP_TCP_OPT_LENGTH(flags) \ + (flags & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \ + (flags & TF_SEG_OPTS_TS ? LWIP_TCP_OPT_LEN_TS_OUT : 0) + \ + (flags & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS_OUT : 0) + +/** This returns a TCP header option for MSS in an u32_t */ +#define TCP_BUILD_MSS_OPTION(mss) lwip_htonl(0x02040000 | ((mss) & 0xFFFF)) + +#if LWIP_WND_SCALE +#define TCPWNDSIZE_F U32_F +#define TCPWND_MAX 0xFFFFFFFFU +#define TCPWND_CHECK16(x) LWIP_ASSERT("window size > 0xFFFF", (x) <= 0xFFFF) +#define TCPWND_MIN16(x) ((u16_t)LWIP_MIN((x), 0xFFFF)) +#else /* LWIP_WND_SCALE */ +#define TCPWNDSIZE_F U16_F +#define TCPWND_MAX 0xFFFFU +#define TCPWND_CHECK16(x) +#define TCPWND_MIN16(x) x +#endif /* LWIP_WND_SCALE */ + +/* Global variables: */ +extern struct tcp_pcb *tcp_input_pcb; +extern u32_t tcp_ticks; +extern u8_t tcp_active_pcbs_changed; + +/* The TCP PCB lists. */ +union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ + struct tcp_pcb_listen *listen_pcbs; + struct tcp_pcb *pcbs; +}; +extern struct tcp_pcb *tcp_bound_pcbs; +extern union tcp_listen_pcbs_t tcp_listen_pcbs; +extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a + state in which they accept or send + data. */ +extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */ + +#define NUM_TCP_PCB_LISTS_NO_TIME_WAIT 3 +#define NUM_TCP_PCB_LISTS 4 +extern struct tcp_pcb ** const tcp_pcb_lists[NUM_TCP_PCB_LISTS]; + +/* Axioms about the above lists: + 1) Every TCP PCB that is not CLOSED is in one of the lists. + 2) A PCB is only in one of the lists. + 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. + 4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state. +*/ +/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB + with a PCB list or removes a PCB from a list, respectively. */ +#ifndef TCP_DEBUG_PCB_LISTS +#define TCP_DEBUG_PCB_LISTS 0 +#endif +#if TCP_DEBUG_PCB_LISTS +#define TCP_REG(pcbs, npcb) do {\ + struct tcp_pcb *tcp_tmp_pcb; \ + LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \ + for (tcp_tmp_pcb = *(pcbs); \ + tcp_tmp_pcb != NULL; \ + tcp_tmp_pcb = tcp_tmp_pcb->next) { \ + LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \ + } \ + LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \ + (npcb)->next = *(pcbs); \ + LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \ + *(pcbs) = (npcb); \ + LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ + tcp_timer_needed(); \ + } while(0) +#define TCP_RMV(pcbs, npcb) do { \ + struct tcp_pcb *tcp_tmp_pcb; \ + LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \ + LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \ + if(*(pcbs) == (npcb)) { \ + *(pcbs) = (*pcbs)->next; \ + } else for (tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \ + if(tcp_tmp_pcb->next == (npcb)) { \ + tcp_tmp_pcb->next = (npcb)->next; \ + break; \ + } \ + } \ + (npcb)->next = NULL; \ + LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ + LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (npcb), *(pcbs))); \ + } while(0) + +#else /* LWIP_DEBUG */ + +#define TCP_REG(pcbs, npcb) \ + do { \ + (npcb)->next = *pcbs; \ + *(pcbs) = (npcb); \ + tcp_timer_needed(); \ + } while (0) + +#define TCP_RMV(pcbs, npcb) \ + do { \ + if(*(pcbs) == (npcb)) { \ + (*(pcbs)) = (*pcbs)->next; \ + } \ + else { \ + struct tcp_pcb *tcp_tmp_pcb; \ + for (tcp_tmp_pcb = *pcbs; \ + tcp_tmp_pcb != NULL; \ + tcp_tmp_pcb = tcp_tmp_pcb->next) { \ + if(tcp_tmp_pcb->next == (npcb)) { \ + tcp_tmp_pcb->next = (npcb)->next; \ + break; \ + } \ + } \ + } \ + (npcb)->next = NULL; \ + } while(0) + +#endif /* LWIP_DEBUG */ + +#define TCP_REG_ACTIVE(npcb) \ + do { \ + TCP_REG(&tcp_active_pcbs, npcb); \ + tcp_active_pcbs_changed = 1; \ + } while (0) + +#define TCP_RMV_ACTIVE(npcb) \ + do { \ + TCP_RMV(&tcp_active_pcbs, npcb); \ + tcp_active_pcbs_changed = 1; \ + } while (0) + +#define TCP_PCB_REMOVE_ACTIVE(pcb) \ + do { \ + tcp_pcb_remove(&tcp_active_pcbs, pcb); \ + tcp_active_pcbs_changed = 1; \ + } while (0) + + +/* Internal functions: */ +struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb); +void tcp_pcb_purge(struct tcp_pcb *pcb); +void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb); + +void tcp_segs_free(struct tcp_seg *seg); +void tcp_seg_free(struct tcp_seg *seg); +struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); + +#define tcp_ack(pcb) \ + do { \ + if((pcb)->flags & TF_ACK_DELAY) { \ + (pcb)->flags &= ~TF_ACK_DELAY; \ + (pcb)->flags |= TF_ACK_NOW; \ + } \ + else { \ + (pcb)->flags |= TF_ACK_DELAY; \ + } \ + } while (0) + +#define tcp_ack_now(pcb) \ + do { \ + (pcb)->flags |= TF_ACK_NOW; \ + } while (0) + +err_t tcp_send_fin(struct tcp_pcb *pcb); +err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags); + +void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg); + +void tcp_rst(u32_t seqno, u32_t ackno, + const ip_addr_t *local_ip, const ip_addr_t *remote_ip, + u16_t local_port, u16_t remote_port); + +u32_t tcp_next_iss(struct tcp_pcb *pcb); + +err_t tcp_keepalive(struct tcp_pcb *pcb); +err_t tcp_zero_window_probe(struct tcp_pcb *pcb); +void tcp_trigger_input_pcb_close(void); + +#if TCP_CALCULATE_EFF_SEND_MSS +u16_t tcp_eff_send_mss_impl(u16_t sendmss, const ip_addr_t *dest +#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING + , const ip_addr_t *src +#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ + ); +#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING +#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest, src) +#else /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ +#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest) +#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */ +#endif /* TCP_CALCULATE_EFF_SEND_MSS */ + +#if LWIP_CALLBACK_API +err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err); +#endif /* LWIP_CALLBACK_API */ + +#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG +void tcp_debug_print(struct tcp_hdr *tcphdr); +void tcp_debug_print_flags(u8_t flags); +void tcp_debug_print_state(enum tcp_state s); +void tcp_debug_print_pcbs(void); +s16_t tcp_pcbs_sane(void); +#else +# define tcp_debug_print(tcphdr) +# define tcp_debug_print_flags(flags) +# define tcp_debug_print_state(s) +# define tcp_debug_print_pcbs() +# define tcp_pcbs_sane() 1 +#endif /* TCP_DEBUG */ + +/** External function (implemented in timers.c), called when TCP detects + * that a timer is needed (i.e. active- or time-wait-pcb found). */ +void tcp_timer_needed(void); + +void tcp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_TCP */ + +#endif /* LWIP_HDR_TCP_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcpip_priv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcpip_priv.h new file mode 100644 index 0000000..630efb1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/priv/tcpip_priv.h @@ -0,0 +1,160 @@ +/** + * @file + * TCPIP API internal implementations (do not use in application code) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_TCPIP_PRIV_H +#define LWIP_HDR_TCPIP_PRIV_H + +#include "lwip/opt.h" + +#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/tcpip.h" +#include "lwip/sys.h" +#include "lwip/timeouts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct pbuf; +struct netif; + +#if LWIP_MPU_COMPATIBLE +#define API_VAR_REF(name) (*(name)) +#define API_VAR_DECLARE(type, name) type * name +#define API_VAR_ALLOC(type, pool, name, errorval) do { \ + name = (type *)memp_malloc(pool); \ + if (name == NULL) { \ + return errorval; \ + } \ + } while(0) +#define API_VAR_ALLOC_POOL(type, pool, name, errorval) do { \ + name = (type *)LWIP_MEMPOOL_ALLOC(pool); \ + if (name == NULL) { \ + return errorval; \ + } \ + } while(0) +#define API_VAR_FREE(pool, name) memp_free(pool, name) +#define API_VAR_FREE_POOL(pool, name) LWIP_MEMPOOL_FREE(pool, name) +#define API_EXPR_REF(expr) (&(expr)) +#if LWIP_NETCONN_SEM_PER_THREAD +#define API_EXPR_REF_SEM(expr) (expr) +#else +#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) +#endif +#define API_EXPR_DEREF(expr) expr +#define API_MSG_M_DEF(m) m +#define API_MSG_M_DEF_C(t, m) t m +#else /* LWIP_MPU_COMPATIBLE */ +#define API_VAR_REF(name) name +#define API_VAR_DECLARE(type, name) type name +#define API_VAR_ALLOC(type, pool, name, errorval) +#define API_VAR_ALLOC_POOL(type, pool, name, errorval) +#define API_VAR_FREE(pool, name) +#define API_VAR_FREE_POOL(pool, name) +#define API_EXPR_REF(expr) expr +#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr) +#define API_EXPR_DEREF(expr) (*(expr)) +#define API_MSG_M_DEF(m) *m +#define API_MSG_M_DEF_C(t, m) const t * m +#endif /* LWIP_MPU_COMPATIBLE */ + +err_t tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem); + +struct tcpip_api_call_data +{ +#if !LWIP_TCPIP_CORE_LOCKING + err_t err; +#if !LWIP_NETCONN_SEM_PER_THREAD + sys_sem_t sem; +#endif /* LWIP_NETCONN_SEM_PER_THREAD */ +#else /* !LWIP_TCPIP_CORE_LOCKING */ + u8_t dummy; /* avoid empty struct :-( */ +#endif /* !LWIP_TCPIP_CORE_LOCKING */ +}; +typedef err_t (*tcpip_api_call_fn)(struct tcpip_api_call_data* call); +err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call); + +enum tcpip_msg_type { + TCPIP_MSG_API, + TCPIP_MSG_API_CALL, + TCPIP_MSG_INPKT, +#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS + TCPIP_MSG_TIMEOUT, + TCPIP_MSG_UNTIMEOUT, +#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ + TCPIP_MSG_CALLBACK, + TCPIP_MSG_CALLBACK_STATIC +}; + +struct tcpip_msg { + enum tcpip_msg_type type; + union { + struct { + tcpip_callback_fn function; + void* msg; + } api_msg; + struct { + tcpip_api_call_fn function; + struct tcpip_api_call_data *arg; + sys_sem_t *sem; + } api_call; + struct { + struct pbuf *p; + struct netif *netif; + netif_input_fn input_fn; + } inp; + struct { + tcpip_callback_fn function; + void *ctx; + } cb; +#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS + struct { + u32_t msecs; + sys_timeout_handler h; + void *arg; + } tmo; +#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ + } msg; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* !NO_SYS */ + +#endif /* LWIP_HDR_TCPIP_PRIV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/autoip.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/autoip.h new file mode 100644 index 0000000..fd3af8a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/autoip.h @@ -0,0 +1,78 @@ +/** + * @file + * AutoIP protocol definitions + */ + +/* + * + * Copyright (c) 2007 Dominik Spies + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * Author: Dominik Spies + * + * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform + * with RFC 3927. + * + */ + +#ifndef LWIP_HDR_PROT_AUTOIP_H +#define LWIP_HDR_PROT_AUTOIP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* 169.254.0.0 */ +#define AUTOIP_NET 0xA9FE0000 +/* 169.254.1.0 */ +#define AUTOIP_RANGE_START (AUTOIP_NET | 0x0100) +/* 169.254.254.255 */ +#define AUTOIP_RANGE_END (AUTOIP_NET | 0xFEFF) + +/* RFC 3927 Constants */ +#define PROBE_WAIT 1 /* second (initial random delay) */ +#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ +#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ +#define PROBE_NUM 3 /* (number of probe packets) */ +#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ +#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ +#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ +#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ +#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ +#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ + +/* AutoIP client states */ +typedef enum { + AUTOIP_STATE_OFF = 0, + AUTOIP_STATE_PROBING = 1, + AUTOIP_STATE_ANNOUNCING = 2, + AUTOIP_STATE_BOUND = 3 +} autoip_state_enum_t; + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_AUTOIP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dhcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dhcp.h new file mode 100644 index 0000000..112953c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dhcp.h @@ -0,0 +1,183 @@ +/** + * @file + * DHCP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Leon Woestenberg + * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Leon Woestenberg + * + */ +#ifndef LWIP_HDR_PROT_DHCP_H +#define LWIP_HDR_PROT_DHCP_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define DHCP_CLIENT_PORT 68 +#define DHCP_SERVER_PORT 67 + + + /* DHCP message item offsets and length */ +#define DHCP_CHADDR_LEN 16U +#define DHCP_SNAME_OFS 44U +#define DHCP_SNAME_LEN 64U +#define DHCP_FILE_OFS 108U +#define DHCP_FILE_LEN 128U +#define DHCP_MSG_LEN 236U +#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4U) /* 4 byte: cookie */ + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/** minimum set of fields of any DHCP message */ +struct dhcp_msg +{ + PACK_STRUCT_FLD_8(u8_t op); + PACK_STRUCT_FLD_8(u8_t htype); + PACK_STRUCT_FLD_8(u8_t hlen); + PACK_STRUCT_FLD_8(u8_t hops); + PACK_STRUCT_FIELD(u32_t xid); + PACK_STRUCT_FIELD(u16_t secs); + PACK_STRUCT_FIELD(u16_t flags); + PACK_STRUCT_FLD_S(ip4_addr_p_t ciaddr); + PACK_STRUCT_FLD_S(ip4_addr_p_t yiaddr); + PACK_STRUCT_FLD_S(ip4_addr_p_t siaddr); + PACK_STRUCT_FLD_S(ip4_addr_p_t giaddr); + PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]); + PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]); + PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]); + PACK_STRUCT_FIELD(u32_t cookie); +#define DHCP_MIN_OPTIONS_LEN 68U +/** make sure user does not configure this too small */ +#if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) +# undef DHCP_OPTIONS_LEN +#endif +/** allow this to be configured in lwipopts.h, but not too small */ +#if (!defined(DHCP_OPTIONS_LEN)) +/** set this to be sufficient for your options in outgoing DHCP msgs */ +# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN +#endif + PACK_STRUCT_FLD_8(u8_t options[DHCP_OPTIONS_LEN]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + + +/* DHCP client states */ +typedef enum { + DHCP_STATE_OFF = 0, + DHCP_STATE_REQUESTING = 1, + DHCP_STATE_INIT = 2, + DHCP_STATE_REBOOTING = 3, + DHCP_STATE_REBINDING = 4, + DHCP_STATE_RENEWING = 5, + DHCP_STATE_SELECTING = 6, + DHCP_STATE_INFORMING = 7, + DHCP_STATE_CHECKING = 8, + DHCP_STATE_PERMANENT = 9, /* not yet implemented */ + DHCP_STATE_BOUND = 10, + DHCP_STATE_RELEASING = 11, /* not yet implemented */ + DHCP_STATE_BACKING_OFF = 12 +} dhcp_state_enum_t; + +/* DHCP op codes */ +#define DHCP_BOOTREQUEST 1 +#define DHCP_BOOTREPLY 2 + +/* DHCP message types */ +#define DHCP_DISCOVER 1 +#define DHCP_OFFER 2 +#define DHCP_REQUEST 3 +#define DHCP_DECLINE 4 +#define DHCP_ACK 5 +#define DHCP_NAK 6 +#define DHCP_RELEASE 7 +#define DHCP_INFORM 8 + +/** DHCP hardware type, currently only ethernet is supported */ +#define DHCP_HTYPE_ETH 1 + +#define DHCP_MAGIC_COOKIE 0x63825363UL + +/* This is a list of options for BOOTP and DHCP, see RFC 2132 for descriptions */ + +/* BootP options */ +#define DHCP_OPTION_PAD 0 +#define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ +#define DHCP_OPTION_ROUTER 3 +#define DHCP_OPTION_DNS_SERVER 6 +#define DHCP_OPTION_HOSTNAME 12 +#define DHCP_OPTION_IP_TTL 23 +#define DHCP_OPTION_MTU 26 +#define DHCP_OPTION_BROADCAST 28 +#define DHCP_OPTION_TCP_TTL 37 +#define DHCP_OPTION_NTP 42 +#define DHCP_OPTION_END 255 + +/* DHCP options */ +#define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */ +#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ +#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ + +#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ +#define DHCP_OPTION_MESSAGE_TYPE_LEN 1 + +#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ +#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */ + +#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ +#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 + +#define DHCP_OPTION_T1 58 /* T1 renewal time */ +#define DHCP_OPTION_T2 59 /* T2 rebinding time */ +#define DHCP_OPTION_US 60 +#define DHCP_OPTION_CLIENT_ID 61 +#define DHCP_OPTION_TFTP_SERVERNAME 66 +#define DHCP_OPTION_BOOTFILE 67 + +/* possible combinations of overloading the file and sname fields with options */ +#define DHCP_OVERLOAD_NONE 0 +#define DHCP_OVERLOAD_FILE 1 +#define DHCP_OVERLOAD_SNAME 2 +#define DHCP_OVERLOAD_SNAME_FILE 3 + + +#ifdef __cplusplus +} +#endif + +#endif /*LWIP_HDR_PROT_DHCP_H*/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dns.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dns.h new file mode 100644 index 0000000..94782d6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/dns.h @@ -0,0 +1,140 @@ +/** + * @file + * DNS - host name to IP address resolver. + */ + +/* + * Port to lwIP from uIP + * by Jim Pettinato April 2007 + * + * security fixes and more by Simon Goldschmidt + * + * uIP version Copyright (c) 2002-2003, Adam Dunkels. + * 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. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LWIP_HDR_PROT_DNS_H +#define LWIP_HDR_PROT_DNS_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** DNS server port address */ +#ifndef DNS_SERVER_PORT +#define DNS_SERVER_PORT 53 +#endif + +/* DNS field TYPE used for "Resource Records" */ +#define DNS_RRTYPE_A 1 /* a host address */ +#define DNS_RRTYPE_NS 2 /* an authoritative name server */ +#define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */ +#define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */ +#define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */ +#define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */ +#define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */ +#define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */ +#define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */ +#define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */ +#define DNS_RRTYPE_WKS 11 /* a well known service description */ +#define DNS_RRTYPE_PTR 12 /* a domain name pointer */ +#define DNS_RRTYPE_HINFO 13 /* host information */ +#define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */ +#define DNS_RRTYPE_MX 15 /* mail exchange */ +#define DNS_RRTYPE_TXT 16 /* text strings */ +#define DNS_RRTYPE_AAAA 28 /* IPv6 address */ +#define DNS_RRTYPE_SRV 33 /* service location */ +#define DNS_RRTYPE_ANY 255 /* any type */ + +/* DNS field CLASS used for "Resource Records" */ +#define DNS_RRCLASS_IN 1 /* the Internet */ +#define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */ +#define DNS_RRCLASS_CH 3 /* the CHAOS class */ +#define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */ +#define DNS_RRCLASS_ANY 255 /* any class */ +#define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */ + +/* DNS protocol flags */ +#define DNS_FLAG1_RESPONSE 0x80 +#define DNS_FLAG1_OPCODE_STATUS 0x10 +#define DNS_FLAG1_OPCODE_INVERSE 0x08 +#define DNS_FLAG1_OPCODE_STANDARD 0x00 +#define DNS_FLAG1_AUTHORATIVE 0x04 +#define DNS_FLAG1_TRUNC 0x02 +#define DNS_FLAG1_RD 0x01 +#define DNS_FLAG2_RA 0x80 +#define DNS_FLAG2_ERR_MASK 0x0f +#define DNS_FLAG2_ERR_NONE 0x00 +#define DNS_FLAG2_ERR_NAME 0x03 + +#define DNS_HDR_GET_OPCODE(hdr) ((((hdr)->flags1) >> 3) & 0xF) + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/** DNS message header */ +struct dns_hdr { + PACK_STRUCT_FIELD(u16_t id); + PACK_STRUCT_FLD_8(u8_t flags1); + PACK_STRUCT_FLD_8(u8_t flags2); + PACK_STRUCT_FIELD(u16_t numquestions); + PACK_STRUCT_FIELD(u16_t numanswers); + PACK_STRUCT_FIELD(u16_t numauthrr); + PACK_STRUCT_FIELD(u16_t numextrarr); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif +#define SIZEOF_DNS_HDR 12 + + +/* Multicast DNS definitions */ + +/** UDP port for multicast DNS queries */ +#ifndef DNS_MQUERY_PORT +#define DNS_MQUERY_PORT 5353 +#endif + +/* IPv4 group for multicast DNS queries: 224.0.0.251 */ +#ifndef DNS_MQUERY_IPV4_GROUP_INIT +#define DNS_MQUERY_IPV4_GROUP_INIT IPADDR4_INIT_BYTES(224,0,0,251) +#endif + +/* IPv6 group for multicast DNS queries: FF02::FB */ +#ifndef DNS_MQUERY_IPV6_GROUP_INIT +#define DNS_MQUERY_IPV6_GROUP_INIT IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_DNS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/etharp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/etharp.h new file mode 100644 index 0000000..ec78305 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/etharp.h @@ -0,0 +1,91 @@ +/** + * @file + * ARP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_ETHARP_H +#define LWIP_HDR_PROT_ETHARP_H + +#include "lwip/arch.h" +#include "lwip/prot/ethernet.h" +#include "lwip/ip4_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ETHARP_HWADDR_LEN +#define ETHARP_HWADDR_LEN ETH_HWADDR_LEN +#endif + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/** the ARP message, see RFC 826 ("Packet format") */ +struct etharp_hdr { + PACK_STRUCT_FIELD(u16_t hwtype); + PACK_STRUCT_FIELD(u16_t proto); + PACK_STRUCT_FLD_8(u8_t hwlen); + PACK_STRUCT_FLD_8(u8_t protolen); + PACK_STRUCT_FIELD(u16_t opcode); + PACK_STRUCT_FLD_S(struct eth_addr shwaddr); + PACK_STRUCT_FLD_S(struct ip4_addr2 sipaddr); + PACK_STRUCT_FLD_S(struct eth_addr dhwaddr); + PACK_STRUCT_FLD_S(struct ip4_addr2 dipaddr); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#define SIZEOF_ETHARP_HDR 28 + +/* ARP hwtype values */ +enum etharp_hwtype { + HWTYPE_ETHERNET = 1 + /* others not used */ +}; + +/* ARP message types (opcodes) */ +enum etharp_opcode { + ARP_REQUEST = 1, + ARP_REPLY = 2 +}; + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_ETHARP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ethernet.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ethernet.h new file mode 100644 index 0000000..e4baa29 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ethernet.h @@ -0,0 +1,170 @@ +/** + * @file + * Ethernet protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_ETHERNET_H +#define LWIP_HDR_PROT_ETHERNET_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ETH_HWADDR_LEN +#ifdef ETHARP_HWADDR_LEN +#define ETH_HWADDR_LEN ETHARP_HWADDR_LEN /* compatibility mode */ +#else +#define ETH_HWADDR_LEN 6 +#endif +#endif + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct eth_addr { + PACK_STRUCT_FLD_8(u8_t addr[ETH_HWADDR_LEN]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/** Ethernet header */ +struct eth_hdr { +#if ETH_PAD_SIZE + PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]); +#endif + PACK_STRUCT_FLD_S(struct eth_addr dest); + PACK_STRUCT_FLD_S(struct eth_addr src); + PACK_STRUCT_FIELD(u16_t type); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE) + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/** VLAN header inserted between ethernet header and payload + * if 'type' in ethernet header is ETHTYPE_VLAN. + * See IEEE802.Q */ +struct eth_vlan_hdr { + PACK_STRUCT_FIELD(u16_t prio_vid); + PACK_STRUCT_FIELD(u16_t tpid); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#define SIZEOF_VLAN_HDR 4 +#define VLAN_ID(vlan_hdr) (lwip_htons((vlan_hdr)->prio_vid) & 0xFFF) + +/** + * @ingroup ethernet + * A list of often ethtypes (although lwIP does not use all of them): */ +enum eth_type { + /** Internet protocol v4 */ + ETHTYPE_IP = 0x0800U, + /** Address resolution protocol */ + ETHTYPE_ARP = 0x0806U, + /** Wake on lan */ + ETHTYPE_WOL = 0x0842U, + /** RARP */ + ETHTYPE_RARP = 0x8035U, + /** Virtual local area network */ + ETHTYPE_VLAN = 0x8100U, + /** Internet protocol v6 */ + ETHTYPE_IPV6 = 0x86DDU, + /** PPP Over Ethernet Discovery Stage */ + ETHTYPE_PPPOEDISC = 0x8863U, + /** PPP Over Ethernet Session Stage */ + ETHTYPE_PPPOE = 0x8864U, + /** Jumbo Frames */ + ETHTYPE_JUMBO = 0x8870U, + /** Process field network */ + ETHTYPE_PROFINET = 0x8892U, + /** Ethernet for control automation technology */ + ETHTYPE_ETHERCAT = 0x88A4U, + /** Link layer discovery protocol */ + ETHTYPE_LLDP = 0x88CCU, + /** Serial real-time communication system */ + ETHTYPE_SERCOS = 0x88CDU, + /** Media redundancy protocol */ + ETHTYPE_MRP = 0x88E3U, + /** Precision time protocol */ + ETHTYPE_PTP = 0x88F7U, + /** Q-in-Q, 802.1ad */ + ETHTYPE_QINQ = 0x9100U +}; + +/** The 24-bit IANA IPv4-multicast OUI is 01-00-5e: */ +#define LL_IP4_MULTICAST_ADDR_0 0x01 +#define LL_IP4_MULTICAST_ADDR_1 0x00 +#define LL_IP4_MULTICAST_ADDR_2 0x5e + +/** IPv6 multicast uses this prefix */ +#define LL_IP6_MULTICAST_ADDR_0 0x33 +#define LL_IP6_MULTICAST_ADDR_1 0x33 + +/** MEMCPY-like macro to copy to/from struct eth_addr's that are local variables + * or known to be 32-bit aligned within the protocol header. */ +#ifndef ETHADDR32_COPY +#define ETHADDR32_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) +#endif + +/** MEMCPY-like macro to copy to/from struct eth_addr's that are no local + * variables and known to be 16-bit aligned within the protocol header. */ +#ifndef ETHADDR16_COPY +#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) +#endif + +#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_ETHERNET_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp.h new file mode 100644 index 0000000..7d19385 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp.h @@ -0,0 +1,91 @@ +/** + * @file + * ICMP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_ICMP_H +#define LWIP_HDR_PROT_ICMP_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ICMP_ER 0 /* echo reply */ +#define ICMP_DUR 3 /* destination unreachable */ +#define ICMP_SQ 4 /* source quench */ +#define ICMP_RD 5 /* redirect */ +#define ICMP_ECHO 8 /* echo */ +#define ICMP_TE 11 /* time exceeded */ +#define ICMP_PP 12 /* parameter problem */ +#define ICMP_TS 13 /* timestamp */ +#define ICMP_TSR 14 /* timestamp reply */ +#define ICMP_IRQ 15 /* information request */ +#define ICMP_IR 16 /* information reply */ +#define ICMP_AM 17 /* address mask request */ +#define ICMP_AMR 18 /* address mask reply */ + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +/** This is the standard ICMP header only that the u32_t data + * is split to two u16_t like ICMP echo needs it. + * This header is also used for other ICMP types that do not + * use the data part. + */ +PACK_STRUCT_BEGIN +struct icmp_echo_hdr { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u16_t id); + PACK_STRUCT_FIELD(u16_t seqno); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* Compatibility defines, old versions used to combine type and code to an u16_t */ +#define ICMPH_TYPE(hdr) ((hdr)->type) +#define ICMPH_CODE(hdr) ((hdr)->code) +#define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) +#define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_ICMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp6.h new file mode 100644 index 0000000..3461120 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/icmp6.h @@ -0,0 +1,170 @@ +/** + * @file + * ICMP6 protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_ICMP6_H +#define LWIP_HDR_PROT_ICMP6_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** ICMP type */ +enum icmp6_type { + /** Destination unreachable */ + ICMP6_TYPE_DUR = 1, + /** Packet too big */ + ICMP6_TYPE_PTB = 2, + /** Time exceeded */ + ICMP6_TYPE_TE = 3, + /** Parameter problem */ + ICMP6_TYPE_PP = 4, + /** Private experimentation */ + ICMP6_TYPE_PE1 = 100, + /** Private experimentation */ + ICMP6_TYPE_PE2 = 101, + /** Reserved for expansion of error messages */ + ICMP6_TYPE_RSV_ERR = 127, + + /** Echo request */ + ICMP6_TYPE_EREQ = 128, + /** Echo reply */ + ICMP6_TYPE_EREP = 129, + /** Multicast listener query */ + ICMP6_TYPE_MLQ = 130, + /** Multicast listener report */ + ICMP6_TYPE_MLR = 131, + /** Multicast listener done */ + ICMP6_TYPE_MLD = 132, + /** Router solicitation */ + ICMP6_TYPE_RS = 133, + /** Router advertisement */ + ICMP6_TYPE_RA = 134, + /** Neighbor solicitation */ + ICMP6_TYPE_NS = 135, + /** Neighbor advertisement */ + ICMP6_TYPE_NA = 136, + /** Redirect */ + ICMP6_TYPE_RD = 137, + /** Multicast router advertisement */ + ICMP6_TYPE_MRA = 151, + /** Multicast router solicitation */ + ICMP6_TYPE_MRS = 152, + /** Multicast router termination */ + ICMP6_TYPE_MRT = 153, + /** Private experimentation */ + ICMP6_TYPE_PE3 = 200, + /** Private experimentation */ + ICMP6_TYPE_PE4 = 201, + /** Reserved for expansion of informational messages */ + ICMP6_TYPE_RSV_INF = 255 +}; + +/** ICMP destination unreachable codes */ +enum icmp6_dur_code { + /** No route to destination */ + ICMP6_DUR_NO_ROUTE = 0, + /** Communication with destination administratively prohibited */ + ICMP6_DUR_PROHIBITED = 1, + /** Beyond scope of source address */ + ICMP6_DUR_SCOPE = 2, + /** Address unreachable */ + ICMP6_DUR_ADDRESS = 3, + /** Port unreachable */ + ICMP6_DUR_PORT = 4, + /** Source address failed ingress/egress policy */ + ICMP6_DUR_POLICY = 5, + /** Reject route to destination */ + ICMP6_DUR_REJECT_ROUTE = 6 +}; + +/** ICMP time exceeded codes */ +enum icmp6_te_code { + /** Hop limit exceeded in transit */ + ICMP6_TE_HL = 0, + /** Fragment reassembly time exceeded */ + ICMP6_TE_FRAG = 1 +}; + +/** ICMP parameter code */ +enum icmp6_pp_code { + /** Erroneous header field encountered */ + ICMP6_PP_FIELD = 0, + /** Unrecognized next header type encountered */ + ICMP6_PP_HEADER = 1, + /** Unrecognized IPv6 option encountered */ + ICMP6_PP_OPTION = 2 +}; + +/** This is the standard ICMP6 header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct icmp6_hdr { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u32_t data); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** This is the ICMP6 header adapted for echo req/resp. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct icmp6_echo_hdr { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u16_t id); + PACK_STRUCT_FIELD(u16_t seqno); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_ICMP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/igmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/igmp.h new file mode 100644 index 0000000..d60cb31 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/igmp.h @@ -0,0 +1,90 @@ +/** + * @file + * IGMP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_IGMP_H +#define LWIP_HDR_PROT_IGMP_H + +#include "lwip/arch.h" +#include "lwip/ip4_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * IGMP constants + */ +#define IGMP_TTL 1 +#define IGMP_MINLEN 8 +#define ROUTER_ALERT 0x9404U +#define ROUTER_ALERTLEN 4 + +/* + * IGMP message types, including version number. + */ +#define IGMP_MEMB_QUERY 0x11 /* Membership query */ +#define IGMP_V1_MEMB_REPORT 0x12 /* Ver. 1 membership report */ +#define IGMP_V2_MEMB_REPORT 0x16 /* Ver. 2 membership report */ +#define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */ + +/* Group membership states */ +#define IGMP_GROUP_NON_MEMBER 0 +#define IGMP_GROUP_DELAYING_MEMBER 1 +#define IGMP_GROUP_IDLE_MEMBER 2 + +/** + * IGMP packet format. + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct igmp_msg { + PACK_STRUCT_FLD_8(u8_t igmp_msgtype); + PACK_STRUCT_FLD_8(u8_t igmp_maxresp); + PACK_STRUCT_FIELD(u16_t igmp_checksum); + PACK_STRUCT_FLD_S(ip4_addr_p_t igmp_group_address); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_IGMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip.h new file mode 100644 index 0000000..bbfae36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip.h @@ -0,0 +1,51 @@ +/** + * @file + * IP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_IP_H +#define LWIP_HDR_PROT_IP_H + +#include "lwip/arch.h" + +#define IP_PROTO_ICMP 1 +#define IP_PROTO_IGMP 2 +#define IP_PROTO_UDP 17 +#define IP_PROTO_UDPLITE 136 +#define IP_PROTO_TCP 6 + +/** This operates on a void* by loading the first byte */ +#define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4) + +#endif /* LWIP_HDR_PROT_IP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip4.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip4.h new file mode 100644 index 0000000..bd442c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip4.h @@ -0,0 +1,127 @@ +/** + * @file + * IPv4 protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_IP4_H +#define LWIP_HDR_PROT_IP4_H + +#include "lwip/arch.h" +#include "lwip/ip4_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the packed version of ip4_addr_t, + used in network headers that are itself packed */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip4_addr_packed { + PACK_STRUCT_FIELD(u32_t addr); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +typedef struct ip4_addr_packed ip4_addr_p_t; + +/* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */ +#define IP_HLEN 20 + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +/* The IPv4 header */ +struct ip_hdr { + /* version / header length */ + PACK_STRUCT_FLD_8(u8_t _v_hl); + /* type of service */ + PACK_STRUCT_FLD_8(u8_t _tos); + /* total length */ + PACK_STRUCT_FIELD(u16_t _len); + /* identification */ + PACK_STRUCT_FIELD(u16_t _id); + /* fragment offset field */ + PACK_STRUCT_FIELD(u16_t _offset); +#define IP_RF 0x8000U /* reserved fragment flag */ +#define IP_DF 0x4000U /* don't fragment flag */ +#define IP_MF 0x2000U /* more fragments flag */ +#define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */ + /* time to live */ + PACK_STRUCT_FLD_8(u8_t _ttl); + /* protocol*/ + PACK_STRUCT_FLD_8(u8_t _proto); + /* checksum */ + PACK_STRUCT_FIELD(u16_t _chksum); + /* source and destination IP addresses */ + PACK_STRUCT_FLD_S(ip4_addr_p_t src); + PACK_STRUCT_FLD_S(ip4_addr_p_t dest); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* Macros to get struct ip_hdr fields: */ +#define IPH_V(hdr) ((hdr)->_v_hl >> 4) +#define IPH_HL(hdr) ((hdr)->_v_hl & 0x0f) +#define IPH_TOS(hdr) ((hdr)->_tos) +#define IPH_LEN(hdr) ((hdr)->_len) +#define IPH_ID(hdr) ((hdr)->_id) +#define IPH_OFFSET(hdr) ((hdr)->_offset) +#define IPH_TTL(hdr) ((hdr)->_ttl) +#define IPH_PROTO(hdr) ((hdr)->_proto) +#define IPH_CHKSUM(hdr) ((hdr)->_chksum) + +/* Macros to set struct ip_hdr fields: */ +#define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl))) +#define IPH_TOS_SET(hdr, tos) (hdr)->_tos = (tos) +#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) +#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) +#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) +#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl) +#define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto) +#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_IP4_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip6.h new file mode 100644 index 0000000..6e1e263 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/ip6.h @@ -0,0 +1,169 @@ +/** + * @file + * IPv6 protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_IP6_H +#define LWIP_HDR_PROT_IP6_H + +#include "lwip/arch.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the packed version of ip6_addr_t, + used in network headers that are itself packed */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip6_addr_packed { + PACK_STRUCT_FIELD(u32_t addr[4]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif +typedef struct ip6_addr_packed ip6_addr_p_t; + +#define IP6_HLEN 40 + +#define IP6_NEXTH_HOPBYHOP 0 +#define IP6_NEXTH_TCP 6 +#define IP6_NEXTH_UDP 17 +#define IP6_NEXTH_ENCAPS 41 +#define IP6_NEXTH_ROUTING 43 +#define IP6_NEXTH_FRAGMENT 44 +#define IP6_NEXTH_ICMP6 58 +#define IP6_NEXTH_NONE 59 +#define IP6_NEXTH_DESTOPTS 60 +#define IP6_NEXTH_UDPLITE 136 + +/** The IPv6 header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip6_hdr { + /** version / traffic class / flow label */ + PACK_STRUCT_FIELD(u32_t _v_tc_fl); + /** payload length */ + PACK_STRUCT_FIELD(u16_t _plen); + /** next header */ + PACK_STRUCT_FLD_8(u8_t _nexth); + /** hop limit */ + PACK_STRUCT_FLD_8(u8_t _hoplim); + /** source and destination IP addresses */ + PACK_STRUCT_FLD_S(ip6_addr_p_t src); + PACK_STRUCT_FLD_S(ip6_addr_p_t dest); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* Hop-by-hop router alert option. */ +#define IP6_HBH_HLEN 8 +#define IP6_PAD1_OPTION 0 +#define IP6_PADN_ALERT_OPTION 1 +#define IP6_ROUTER_ALERT_OPTION 5 +#define IP6_ROUTER_ALERT_VALUE_MLD 0 +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip6_hbh_hdr { + /* next header */ + PACK_STRUCT_FLD_8(u8_t _nexth); + /* header length */ + PACK_STRUCT_FLD_8(u8_t _hlen); + /* router alert option type */ + PACK_STRUCT_FLD_8(u8_t _ra_opt_type); + /* router alert option data len */ + PACK_STRUCT_FLD_8(u8_t _ra_opt_dlen); + /* router alert option data */ + PACK_STRUCT_FIELD(u16_t _ra_opt_data); + /* PadN option type */ + PACK_STRUCT_FLD_8(u8_t _padn_opt_type); + /* PadN option data len */ + PACK_STRUCT_FLD_8(u8_t _padn_opt_dlen); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* Fragment header. */ +#define IP6_FRAG_HLEN 8 +#define IP6_FRAG_OFFSET_MASK 0xfff8 +#define IP6_FRAG_MORE_FLAG 0x0001 +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ip6_frag_hdr { + /* next header */ + PACK_STRUCT_FLD_8(u8_t _nexth); + /* reserved */ + PACK_STRUCT_FLD_8(u8_t reserved); + /* fragment offset */ + PACK_STRUCT_FIELD(u16_t _fragment_offset); + /* fragmented packet identification */ + PACK_STRUCT_FIELD(u32_t _identification); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#define IP6H_V(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 28) & 0x0f) +#define IP6H_TC(hdr) ((lwip_ntohl((hdr)->_v_tc_fl) >> 20) & 0xff) +#define IP6H_FL(hdr) (lwip_ntohl((hdr)->_v_tc_fl) & 0x000fffff) +#define IP6H_PLEN(hdr) (lwip_ntohs((hdr)->_plen)) +#define IP6H_NEXTH(hdr) ((hdr)->_nexth) +#define IP6H_NEXTH_P(hdr) ((u8_t *)(hdr) + 6) +#define IP6H_HOPLIM(hdr) ((hdr)->_hoplim) + +#define IP6H_VTCFL_SET(hdr, v, tc, fl) (hdr)->_v_tc_fl = (lwip_htonl((((u32_t)(v)) << 28) | (((u32_t)(tc)) << 20) | (fl))) +#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = lwip_htons(plen) +#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth) +#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_IP6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/mld6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/mld6.h new file mode 100644 index 0000000..be3a006 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/mld6.h @@ -0,0 +1,70 @@ +/** + * @file + * MLD6 protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_MLD6_H +#define LWIP_HDR_PROT_MLD6_H + +#include "lwip/arch.h" +#include "lwip/prot/ip6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Multicast listener report/query/done message header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct mld_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u16_t max_resp_delay); + PACK_STRUCT_FIELD(u16_t reserved); + PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_MLD6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/nd6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/nd6.h new file mode 100644 index 0000000..2d4903d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/nd6.h @@ -0,0 +1,277 @@ +/** + * @file + * ND6 protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_ND6_H +#define LWIP_HDR_PROT_ND6_H + +#include "lwip/arch.h" +#include "lwip/ip6_addr.h" +#include "lwip/prot/ip6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Neighbor solicitation message header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ns_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u32_t reserved); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Neighbor advertisement message header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct na_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FLD_8(u8_t flags); + PACK_STRUCT_FLD_8(u8_t reserved[3]); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif +#define ND6_FLAG_ROUTER (0x80) +#define ND6_FLAG_SOLICITED (0x40) +#define ND6_FLAG_OVERRIDE (0x20) + +/** Router solicitation message header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct rs_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u32_t reserved); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Router advertisement message header. */ +#define ND6_RA_FLAG_MANAGED_ADDR_CONFIG (0x80) +#define ND6_RA_FLAG_OTHER_CONFIG (0x40) +#define ND6_RA_FLAG_HOME_AGENT (0x20) +#define ND6_RA_PREFERENCE_MASK (0x18) +#define ND6_RA_PREFERENCE_HIGH (0x08) +#define ND6_RA_PREFERENCE_MEDIUM (0x00) +#define ND6_RA_PREFERENCE_LOW (0x18) +#define ND6_RA_PREFERENCE_DISABLED (0x10) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct ra_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FLD_8(u8_t current_hop_limit); + PACK_STRUCT_FLD_8(u8_t flags); + PACK_STRUCT_FIELD(u16_t router_lifetime); + PACK_STRUCT_FIELD(u32_t reachable_time); + PACK_STRUCT_FIELD(u32_t retrans_timer); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Redirect message header. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct redirect_header { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u32_t reserved); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); + PACK_STRUCT_FLD_S(ip6_addr_p_t destination_address); + /* Options follow. */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Link-layer address option. */ +#define ND6_OPTION_TYPE_SOURCE_LLADDR (0x01) +#define ND6_OPTION_TYPE_TARGET_LLADDR (0x02) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct lladdr_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t addr[NETIF_MAX_HWADDR_LEN]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Prefix information option. */ +#define ND6_OPTION_TYPE_PREFIX_INFO (0x03) +#define ND6_PREFIX_FLAG_ON_LINK (0x80) +#define ND6_PREFIX_FLAG_AUTONOMOUS (0x40) +#define ND6_PREFIX_FLAG_ROUTER_ADDRESS (0x20) +#define ND6_PREFIX_FLAG_SITE_PREFIX (0x10) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct prefix_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t prefix_length); + PACK_STRUCT_FLD_8(u8_t flags); + PACK_STRUCT_FIELD(u32_t valid_lifetime); + PACK_STRUCT_FIELD(u32_t preferred_lifetime); + PACK_STRUCT_FLD_8(u8_t reserved2[3]); + PACK_STRUCT_FLD_8(u8_t site_prefix_length); + PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Redirected header option. */ +#define ND6_OPTION_TYPE_REDIR_HDR (0x04) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct redirected_header_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t reserved[6]); + /* Portion of redirected packet follows. */ + /* PACK_STRUCT_FLD_8(u8_t redirected[8]); */ +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** MTU option. */ +#define ND6_OPTION_TYPE_MTU (0x05) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct mtu_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FIELD(u16_t reserved); + PACK_STRUCT_FIELD(u32_t mtu); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Route information option. */ +#define ND6_OPTION_TYPE_ROUTE_INFO (24) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct route_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t prefix_length); + PACK_STRUCT_FLD_8(u8_t preference); + PACK_STRUCT_FIELD(u32_t route_lifetime); + PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/** Recursive DNS Server Option. */ +#if LWIP_ND6_RDNSS_MAX_DNS_SERVERS +#define LWIP_RDNSS_OPTION_MAX_SERVERS LWIP_ND6_RDNSS_MAX_DNS_SERVERS +#else +#define LWIP_RDNSS_OPTION_MAX_SERVERS 1 +#endif +#define ND6_OPTION_TYPE_RDNSS (25) +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct rdnss_option { + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FIELD(u16_t reserved); + PACK_STRUCT_FIELD(u32_t lifetime); + PACK_STRUCT_FLD_S(ip6_addr_p_t rdnss_address[LWIP_RDNSS_OPTION_MAX_SERVERS]); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_ND6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/tcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/tcp.h new file mode 100644 index 0000000..67fe7b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/tcp.h @@ -0,0 +1,97 @@ +/** + * @file + * TCP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_TCP_H +#define LWIP_HDR_PROT_TCP_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Length of the TCP header, excluding options. */ +#define TCP_HLEN 20 + +/* Fields are (of course) in network byte order. + * Some fields are converted to host byte order in tcp_input(). + */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct tcp_hdr { + PACK_STRUCT_FIELD(u16_t src); + PACK_STRUCT_FIELD(u16_t dest); + PACK_STRUCT_FIELD(u32_t seqno); + PACK_STRUCT_FIELD(u32_t ackno); + PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags); + PACK_STRUCT_FIELD(u16_t wnd); + PACK_STRUCT_FIELD(u16_t chksum); + PACK_STRUCT_FIELD(u16_t urgp); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* TCP header flags bits */ +#define TCP_FIN 0x01U +#define TCP_SYN 0x02U +#define TCP_RST 0x04U +#define TCP_PSH 0x08U +#define TCP_ACK 0x10U +#define TCP_URG 0x20U +#define TCP_ECE 0x40U +#define TCP_CWR 0x80U +/* Valid TCP header flags */ +#define TCP_FLAGS 0x3fU + +#define TCPH_HDRLEN(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12)) +#define TCPH_FLAGS(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)) + +#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr)) +#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags)) +#define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = (u16_t)(lwip_htons((u16_t)((len) << 12) | (flags))) + +#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags)) +#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags)) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_TCP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/udp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/udp.h new file mode 100644 index 0000000..664f19a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/prot/udp.h @@ -0,0 +1,68 @@ +/** + * @file + * UDP protocol definitions + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_PROT_UDP_H +#define LWIP_HDR_PROT_UDP_H + +#include "lwip/arch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define UDP_HLEN 8 + +/* Fields are (of course) in network byte order. */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct udp_hdr { + PACK_STRUCT_FIELD(u16_t src); + PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */ + PACK_STRUCT_FIELD(u16_t len); + PACK_STRUCT_FIELD(u16_t chksum); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_PROT_UDP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/raw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/raw.h new file mode 100644 index 0000000..30aa147 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/raw.h @@ -0,0 +1,118 @@ +/** + * @file + * raw API (to be used from TCPIP thread)\n + * See also @ref raw_raw + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_RAW_H +#define LWIP_HDR_RAW_H + +#include "lwip/opt.h" + +#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/def.h" +#include "lwip/ip.h" +#include "lwip/ip_addr.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct raw_pcb; + +/** Function prototype for raw pcb receive callback functions. + * @param arg user supplied argument (raw_pcb.recv_arg) + * @param pcb the raw_pcb which received data + * @param p the packet buffer that was received + * @param addr the remote IP address from which the packet was received + * @return 1 if the packet was 'eaten' (aka. deleted), + * 0 if the packet lives on + * If returning 1, the callback is responsible for freeing the pbuf + * if it's not used any more. + */ +typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr); + +/** the RAW protocol control block */ +struct raw_pcb { + /* Common members of all PCB types */ + IP_PCB; + + struct raw_pcb *next; + + u8_t protocol; + + /** receive callback function */ + raw_recv_fn recv; + /* user-supplied argument for the recv callback */ + void *recv_arg; +#if LWIP_IPV6 + /* fields for handling checksum computations as per RFC3542. */ + u16_t chksum_offset; + u8_t chksum_reqd; +#endif +}; + +/* The following functions is the application layer interface to the + RAW code. */ +struct raw_pcb * raw_new (u8_t proto); +struct raw_pcb * raw_new_ip_type(u8_t type, u8_t proto); +void raw_remove (struct raw_pcb *pcb); +err_t raw_bind (struct raw_pcb *pcb, const ip_addr_t *ipaddr); +err_t raw_connect (struct raw_pcb *pcb, const ip_addr_t *ipaddr); + +err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr); +err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); + +void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg); + +/* The following functions are the lower layer interface to RAW. */ +u8_t raw_input (struct pbuf *p, struct netif *inp); +#define raw_init() /* Compatibility define, no init needed. */ + +void raw_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); + +/* for compatibility with older implementation */ +#define raw_new_ip6(proto) raw_new_ip_type(IPADDR_TYPE_V6, proto) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_RAW */ + +#endif /* LWIP_HDR_RAW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sio.h new file mode 100644 index 0000000..7643e19 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sio.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + */ + +/* + * This is the interface to the platform specific serial IO module + * It needs to be implemented by those platforms which need SLIP or PPP + */ + +#ifndef SIO_H +#define SIO_H + +#include "lwip/arch.h" +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* If you want to define sio_fd_t elsewhere or differently, + define this in your cc.h file. */ +#ifndef __sio_fd_t_defined +typedef void * sio_fd_t; +#endif + +/* The following functions can be defined to something else in your cc.h file + or be implemented in your custom sio.c file. */ + +#ifndef sio_open +/** + * Opens a serial device for communication. + * + * @param devnum device number + * @return handle to serial device if successful, NULL otherwise + */ +sio_fd_t sio_open(u8_t devnum); +#endif + +#ifndef sio_send +/** + * Sends a single character to the serial device. + * + * @param c character to send + * @param fd serial device handle + * + * @note This function will block until the character can be sent. + */ +void sio_send(u8_t c, sio_fd_t fd); +#endif + +#ifndef sio_recv +/** + * Receives a single character from the serial device. + * + * @param fd serial device handle + * + * @note This function will block until a character is received. + */ +u8_t sio_recv(sio_fd_t fd); +#endif + +#ifndef sio_read +/** + * Reads from the serial device. + * + * @param fd serial device handle + * @param data pointer to data buffer for receiving + * @param len maximum length (in bytes) of data to receive + * @return number of bytes actually received - may be 0 if aborted by sio_read_abort + * + * @note This function will block until data can be received. The blocking + * can be cancelled by calling sio_read_abort(). + */ +u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len); +#endif + +#ifndef sio_tryread +/** + * Tries to read from the serial device. Same as sio_read but returns + * immediately if no data is available and never blocks. + * + * @param fd serial device handle + * @param data pointer to data buffer for receiving + * @param len maximum length (in bytes) of data to receive + * @return number of bytes actually received + */ +u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len); +#endif + +#ifndef sio_write +/** + * Writes to the serial device. + * + * @param fd serial device handle + * @param data pointer to data to send + * @param len length (in bytes) of data to send + * @return number of bytes actually sent + * + * @note This function will block until all data can be sent. + */ +u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); +#endif + +#ifndef sio_read_abort +/** + * Aborts a blocking sio_read() call. + * + * @param fd serial device handle + */ +void sio_read_abort(sio_fd_t fd); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* SIO_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/snmp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/snmp.h new file mode 100644 index 0000000..8704d0b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/snmp.h @@ -0,0 +1,213 @@ +/** + * @file + * SNMP support API for implementing netifs and statitics for MIB2 + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Dirk Ziegelmeier + * + */ +#ifndef LWIP_HDR_SNMP_H +#define LWIP_HDR_SNMP_H + +#include "lwip/opt.h" +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct udp_pcb; +struct netif; + +/** + * @defgroup netif_mib2 MIB2 statistics + * @ingroup netif + */ + +/* MIB2 statistics functions */ +#if MIB2_STATS /* don't build if not configured for use in lwipopts.h */ +/** + * @ingroup netif_mib2 + * @see RFC1213, "MIB-II, 6. Definitions" + */ +enum snmp_ifType { + snmp_ifType_other=1, /* none of the following */ + snmp_ifType_regular1822, + snmp_ifType_hdh1822, + snmp_ifType_ddn_x25, + snmp_ifType_rfc877_x25, + snmp_ifType_ethernet_csmacd, + snmp_ifType_iso88023_csmacd, + snmp_ifType_iso88024_tokenBus, + snmp_ifType_iso88025_tokenRing, + snmp_ifType_iso88026_man, + snmp_ifType_starLan, + snmp_ifType_proteon_10Mbit, + snmp_ifType_proteon_80Mbit, + snmp_ifType_hyperchannel, + snmp_ifType_fddi, + snmp_ifType_lapb, + snmp_ifType_sdlc, + snmp_ifType_ds1, /* T-1 */ + snmp_ifType_e1, /* european equiv. of T-1 */ + snmp_ifType_basicISDN, + snmp_ifType_primaryISDN, /* proprietary serial */ + snmp_ifType_propPointToPointSerial, + snmp_ifType_ppp, + snmp_ifType_softwareLoopback, + snmp_ifType_eon, /* CLNP over IP [11] */ + snmp_ifType_ethernet_3Mbit, + snmp_ifType_nsip, /* XNS over IP */ + snmp_ifType_slip, /* generic SLIP */ + snmp_ifType_ultra, /* ULTRA technologies */ + snmp_ifType_ds3, /* T-3 */ + snmp_ifType_sip, /* SMDS */ + snmp_ifType_frame_relay +}; + +/** This macro has a precision of ~49 days because sys_now returns u32_t. \#define your own if you want ~490 days. */ +#ifndef MIB2_COPY_SYSUPTIME_TO +#define MIB2_COPY_SYSUPTIME_TO(ptrToVal) (*(ptrToVal) = (sys_now() / 10)) +#endif + +/** + * @ingroup netif_mib2 + * Increment stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs) + */ +#define MIB2_STATS_NETIF_INC(n, x) do { ++(n)->mib2_counters.x; } while(0) +/** + * @ingroup netif_mib2 + * Add value to stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs) + */ +#define MIB2_STATS_NETIF_ADD(n, x, val) do { (n)->mib2_counters.x += (val); } while(0) + +/** + * @ingroup netif_mib2 + * Init MIB2 statistic counters in netif + * @param netif Netif to init + * @param type one of enum @ref snmp_ifType + * @param speed your link speed here (units: bits per second) + */ +#define MIB2_INIT_NETIF(netif, type, speed) do { \ + (netif)->link_type = (type); \ + (netif)->link_speed = (speed);\ + (netif)->ts = 0; \ + (netif)->mib2_counters.ifinoctets = 0; \ + (netif)->mib2_counters.ifinucastpkts = 0; \ + (netif)->mib2_counters.ifinnucastpkts = 0; \ + (netif)->mib2_counters.ifindiscards = 0; \ + (netif)->mib2_counters.ifinerrors = 0; \ + (netif)->mib2_counters.ifinunknownprotos = 0; \ + (netif)->mib2_counters.ifoutoctets = 0; \ + (netif)->mib2_counters.ifoutucastpkts = 0; \ + (netif)->mib2_counters.ifoutnucastpkts = 0; \ + (netif)->mib2_counters.ifoutdiscards = 0; \ + (netif)->mib2_counters.ifouterrors = 0; } while(0) +#else /* MIB2_STATS */ +#ifndef MIB2_COPY_SYSUPTIME_TO +#define MIB2_COPY_SYSUPTIME_TO(ptrToVal) +#endif +#define MIB2_INIT_NETIF(netif, type, speed) +#define MIB2_STATS_NETIF_INC(n, x) +#define MIB2_STATS_NETIF_ADD(n, x, val) +#endif /* MIB2_STATS */ + +/* LWIP MIB2 callbacks */ +#if LWIP_MIB2_CALLBACKS /* don't build if not configured for use in lwipopts.h */ +/* network interface */ +void mib2_netif_added(struct netif *ni); +void mib2_netif_removed(struct netif *ni); + +#if LWIP_IPV4 && LWIP_ARP +/* ARP (for atTable and ipNetToMediaTable) */ +void mib2_add_arp_entry(struct netif *ni, ip4_addr_t *ip); +void mib2_remove_arp_entry(struct netif *ni, ip4_addr_t *ip); +#else /* LWIP_IPV4 && LWIP_ARP */ +#define mib2_add_arp_entry(ni,ip) +#define mib2_remove_arp_entry(ni,ip) +#endif /* LWIP_IPV4 && LWIP_ARP */ + +/* IP */ +#if LWIP_IPV4 +void mib2_add_ip4(struct netif *ni); +void mib2_remove_ip4(struct netif *ni); +void mib2_add_route_ip4(u8_t dflt, struct netif *ni); +void mib2_remove_route_ip4(u8_t dflt, struct netif *ni); +#endif /* LWIP_IPV4 */ + +/* UDP */ +#if LWIP_UDP +void mib2_udp_bind(struct udp_pcb *pcb); +void mib2_udp_unbind(struct udp_pcb *pcb); +#endif /* LWIP_UDP */ + +#else /* LWIP_MIB2_CALLBACKS */ +/* LWIP_MIB2_CALLBACKS support not available */ +/* define everything to be empty */ + +/* network interface */ +#define mib2_netif_added(ni) +#define mib2_netif_removed(ni) + +/* ARP */ +#define mib2_add_arp_entry(ni,ip) +#define mib2_remove_arp_entry(ni,ip) + +/* IP */ +#define mib2_add_ip4(ni) +#define mib2_remove_ip4(ni) +#define mib2_add_route_ip4(dflt, ni) +#define mib2_remove_route_ip4(dflt, ni) + +/* UDP */ +#define mib2_udp_bind(pcb) +#define mib2_udp_unbind(pcb) +#endif /* LWIP_MIB2_CALLBACKS */ + +/* for source-code compatibility reasons only, can be removed (not used internally) */ +#define NETIF_INIT_SNMP MIB2_INIT_NETIF +#define snmp_add_ifinoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifinoctets, value) +#define snmp_inc_ifinucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinucastpkts) +#define snmp_inc_ifinnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifinnucastpkts) +#define snmp_inc_ifindiscards(ni) MIB2_STATS_NETIF_INC(ni, ifindiscards) +#define snmp_inc_ifinerrors(ni) MIB2_STATS_NETIF_INC(ni, ifinerrors) +#define snmp_inc_ifinunknownprotos(ni) MIB2_STATS_NETIF_INC(ni, ifinunknownprotos) +#define snmp_add_ifoutoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifoutoctets, value) +#define snmp_inc_ifoutucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutucastpkts) +#define snmp_inc_ifoutnucastpkts(ni) MIB2_STATS_NETIF_INC(ni, ifoutnucastpkts) +#define snmp_inc_ifoutdiscards(ni) MIB2_STATS_NETIF_INC(ni, ifoutdiscards) +#define snmp_inc_ifouterrors(ni) MIB2_STATS_NETIF_INC(ni, ifouterrors) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_SNMP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sockets.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sockets.h new file mode 100644 index 0000000..2522056 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sockets.h @@ -0,0 +1,593 @@ +/** + * @file + * Socket API (to be used from non-TCPIP threads) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + + +#ifndef LWIP_HDR_SOCKETS_H +#define LWIP_HDR_SOCKETS_H + +#include "lwip/opt.h" + +#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/ip_addr.h" +#include "lwip/err.h" +#include "lwip/inet.h" +#include "lwip/errno.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* If your port already typedef's sa_family_t, define SA_FAMILY_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(sa_family_t) && !defined(SA_FAMILY_T_DEFINED) +typedef u8_t sa_family_t; +#endif +/* If your port already typedef's in_port_t, define IN_PORT_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(in_port_t) && !defined(IN_PORT_T_DEFINED) +typedef u16_t in_port_t; +#endif + +#if LWIP_IPV4 +/* members are in network byte order */ +struct sockaddr_in { + u8_t sin_len; + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; +#define SIN_ZERO_LEN 8 + char sin_zero[SIN_ZERO_LEN]; +}; +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +struct sockaddr_in6 { + u8_t sin6_len; /* length of this structure */ + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* Transport layer port # */ + u32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + u32_t sin6_scope_id; /* Set of interfaces for scope */ +}; +#endif /* LWIP_IPV6 */ + +struct sockaddr { + u8_t sa_len; + sa_family_t sa_family; + char sa_data[14]; +}; + +struct sockaddr_storage { + u8_t s2_len; + sa_family_t ss_family; + char s2_data1[2]; + u32_t s2_data2[3]; +#if LWIP_IPV6 + u32_t s2_data3[3]; +#endif /* LWIP_IPV6 */ +}; + +/* If your port already typedef's socklen_t, define SOCKLEN_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(socklen_t) && !defined(SOCKLEN_T_DEFINED) +typedef u32_t socklen_t; +#endif + +struct lwip_sock; + +#if !LWIP_TCPIP_CORE_LOCKING +/** Maximum optlen used by setsockopt/getsockopt */ +#define LWIP_SETGETSOCKOPT_MAXOPTLEN 16 + +/** This struct is used to pass data to the set/getsockopt_internal + * functions running in tcpip_thread context (only a void* is allowed) */ +struct lwip_setgetsockopt_data { + /** socket index for which to change options */ + int s; + /** level of the option to process */ + int level; + /** name of the option to process */ + int optname; + /** set: value to set the option to + * get: value of the option is stored here */ +#if LWIP_MPU_COMPATIBLE + u8_t optval[LWIP_SETGETSOCKOPT_MAXOPTLEN]; +#else + union { + void *p; + const void *pc; + } optval; +#endif + /** size of *optval */ + socklen_t optlen; + /** if an error occurs, it is temporarily stored here */ + err_t err; + /** semaphore to wake up the calling task */ + void* completed_sem; +}; +#endif /* !LWIP_TCPIP_CORE_LOCKING */ + +#if !defined(iovec) +struct iovec { + void *iov_base; + size_t iov_len; +}; +#endif + +struct msghdr { + void *msg_name; + socklen_t msg_namelen; + struct iovec *msg_iov; + int msg_iovlen; + void *msg_control; + socklen_t msg_controllen; + int msg_flags; +}; + +/* Socket protocol types (TCP/UDP/RAW) */ +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 + +/* + * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) + */ +#define SO_REUSEADDR 0x0004 /* Allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ + + +/* + * Additional options, not kept in so_options. + */ +#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_DONTROUTE 0x0010 /* Unimplemented: just use interface addresses */ +#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */ +#define SO_LINGER 0x0080 /* linger on close if data present */ +#define SO_DONTLINGER ((int)(~SO_LINGER)) +#define SO_OOBINLINE 0x0100 /* Unimplemented: leave received OOB data in line */ +#define SO_REUSEPORT 0x0200 /* Unimplemented: allow local address & port reuse */ +#define SO_SNDBUF 0x1001 /* Unimplemented: send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* Unimplemented: send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* Unimplemented: receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* send timeout */ +#define SO_RCVTIMEO 0x1006 /* receive timeout */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ +#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */ +#define SO_NO_CHECK 0x100a /* don't create UDP checksum */ + + +/* + * Structure used for manipulating linger option. + */ +struct linger { + int l_onoff; /* option on/off */ + int l_linger; /* linger time in seconds */ +}; + +/* + * Level number for (get/set)sockopt() to apply to socket itself. + */ +#define SOL_SOCKET 0xfff /* options for socket level */ + + +#define AF_UNSPEC 0 +#define AF_INET 2 +#if LWIP_IPV6 +#define AF_INET6 10 +#else /* LWIP_IPV6 */ +#define AF_INET6 AF_UNSPEC +#endif /* LWIP_IPV6 */ +#define PF_INET AF_INET +#define PF_INET6 AF_INET6 +#define PF_UNSPEC AF_UNSPEC + +#define IPPROTO_IP 0 +#define IPPROTO_ICMP 1 +#define IPPROTO_TCP 6 +#define IPPROTO_UDP 17 +#if LWIP_IPV6 +#define IPPROTO_IPV6 41 +#define IPPROTO_ICMPV6 58 +#endif /* LWIP_IPV6 */ +#define IPPROTO_UDPLITE 136 +#define IPPROTO_RAW 255 + +/* Flags we can use with send and recv. */ +#define MSG_PEEK 0x01 /* Peeks at an incoming message */ +#define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */ +#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */ +#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */ +#define MSG_MORE 0x10 /* Sender will send more */ + + +/* + * Options for level IPPROTO_IP + */ +#define IP_TOS 1 +#define IP_TTL 2 + +#if LWIP_TCP +/* + * Options for level IPPROTO_TCP + */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ +#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */ +#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ +#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ +#endif /* LWIP_TCP */ + +#if LWIP_IPV6 +/* + * Options for level IPPROTO_IPV6 + */ +#define IPV6_CHECKSUM 7 /* RFC3542: calculate and insert the ICMPv6 checksum for raw sockets. */ +#define IPV6_V6ONLY 27 /* RFC3493: boolean control to restrict AF_INET6 sockets to IPv6 communications only. */ +#endif /* LWIP_IPV6 */ + +#if LWIP_UDP && LWIP_UDPLITE +/* + * Options for level IPPROTO_UDPLITE + */ +#define UDPLITE_SEND_CSCOV 0x01 /* sender checksum coverage */ +#define UDPLITE_RECV_CSCOV 0x02 /* minimal receiver checksum coverage */ +#endif /* LWIP_UDP && LWIP_UDPLITE*/ + + +#if LWIP_MULTICAST_TX_OPTIONS +/* + * Options and types for UDP multicast traffic handling + */ +#define IP_MULTICAST_TTL 5 +#define IP_MULTICAST_IF 6 +#define IP_MULTICAST_LOOP 7 +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + +#if LWIP_IGMP +/* + * Options and types related to multicast membership + */ +#define IP_ADD_MEMBERSHIP 3 +#define IP_DROP_MEMBERSHIP 4 + +typedef struct ip_mreq { + struct in_addr imr_multiaddr; /* IP multicast address of group */ + struct in_addr imr_interface; /* local IP address of interface */ +} ip_mreq; +#endif /* LWIP_IGMP */ + +/* + * The Type of Service provides an indication of the abstract + * parameters of the quality of service desired. These parameters are + * to be used to guide the selection of the actual service parameters + * when transmitting a datagram through a particular network. Several + * networks offer service precedence, which somehow treats high + * precedence traffic as more important than other traffic (generally + * by accepting only traffic above a certain precedence at time of high + * load). The major choice is a three way tradeoff between low-delay, + * high-reliability, and high-throughput. + * The use of the Delay, Throughput, and Reliability indications may + * increase the cost (in some sense) of the service. In many networks + * better performance for one of these parameters is coupled with worse + * performance on another. Except for very unusual cases at most two + * of these three indications should be set. + */ +#define IPTOS_TOS_MASK 0x1E +#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#define IPTOS_LOWCOST 0x02 +#define IPTOS_MINCOST IPTOS_LOWCOST + +/* + * The Network Control precedence designation is intended to be used + * within a network only. The actual use and control of that + * designation is up to each network. The Internetwork Control + * designation is intended for use by gateway control originators only. + * If the actual use of these precedence designations is of concern to + * a particular network, it is the responsibility of that network to + * control the access to, and use of, those precedence designations. + */ +#define IPTOS_PREC_MASK 0xe0 +#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) +#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_INTERNETCONTROL 0xc0 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 + + +/* + * Commands for ioctlsocket(), taken from the BSD file fcntl.h. + * lwip_ioctl only supports FIONREAD and FIONBIO, for now + * + * Ioctl's have the command encoded in the lower word, + * and the size of any in or out parameters in the upper + * word. The high 2 bits of the upper word are used + * to encode the in/out status of the parameter; for now + * we restrict parameters to at most 128 bytes. + */ +#if !defined(FIONREAD) || !defined(FIONBIO) +#define IOCPARM_MASK 0x7fU /* parameters must be < 128 bytes */ +#define IOC_VOID 0x20000000UL /* no parameters */ +#define IOC_OUT 0x40000000UL /* copy out parameters */ +#define IOC_IN 0x80000000UL /* copy in parameters */ +#define IOC_INOUT (IOC_IN|IOC_OUT) + /* 0x20000000 distinguishes new & + old ioctl's */ +#define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) + +#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) + +#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) +#endif /* !defined(FIONREAD) || !defined(FIONBIO) */ + +#ifndef FIONREAD +#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */ +#endif +#ifndef FIONBIO +#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */ +#endif + +/* Socket I/O Controls: unimplemented */ +#ifndef SIOCSHIWAT +#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */ +#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */ +#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */ +#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */ +#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */ +#endif + +/* commands for fnctl */ +#ifndef F_GETFL +#define F_GETFL 3 +#endif +#ifndef F_SETFL +#define F_SETFL 4 +#endif + +/* File status flags and file access modes for fnctl, + these are bits in an int. */ +#ifndef O_NONBLOCK +#define O_NONBLOCK 1 /* nonblocking I/O */ +#endif +#ifndef O_NDELAY +#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */ +#endif + +#ifndef SHUT_RD + #define SHUT_RD 0 + #define SHUT_WR 1 + #define SHUT_RDWR 2 +#endif + +/* FD_SET used for lwip_select */ +#ifndef FD_SET +#undef FD_SETSIZE +/* Make FD_SETSIZE match NUM_SOCKETS in socket.c */ +#define FD_SETSIZE MEMP_NUM_NETCONN +#define FDSETSAFESET(n, code) do { \ + if (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0)) { \ + code; }} while(0) +#define FDSETSAFEGET(n, code) (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0) ?\ + (code) : 0) +#define FD_SET(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] |= (1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) +#define FD_CLR(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] &= ~(1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) +#define FD_ISSET(n,p) FDSETSAFEGET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] & (1 << (((n)-LWIP_SOCKET_OFFSET) & 7))) +#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p))) + +typedef struct fd_set +{ + unsigned char fd_bits [(FD_SETSIZE+7)/8]; +} fd_set; + +#elif LWIP_SOCKET_OFFSET +#error LWIP_SOCKET_OFFSET does not work with external FD_SET! +#elif FD_SETSIZE < MEMP_NUM_NETCONN +#error "external FD_SETSIZE too small for number of sockets" +#endif /* FD_SET */ + +/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided + * by your system, set this to 0 and include in cc.h */ +#ifndef LWIP_TIMEVAL_PRIVATE +#define LWIP_TIMEVAL_PRIVATE 1 +#endif + +#if LWIP_TIMEVAL_PRIVATE +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ +}; +#endif /* LWIP_TIMEVAL_PRIVATE */ + +#define lwip_socket_init() /* Compatibility define, no init needed. */ +void lwip_socket_thread_init(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */ +void lwip_socket_thread_cleanup(void); /* LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore */ + +#if LWIP_COMPAT_SOCKETS == 2 +/* This helps code parsers/code completion by not having the COMPAT functions as defines */ +#define lwip_accept accept +#define lwip_bind bind +#define lwip_shutdown shutdown +#define lwip_getpeername getpeername +#define lwip_getsockname getsockname +#define lwip_setsockopt setsockopt +#define lwip_getsockopt getsockopt +#define lwip_close closesocket +#define lwip_connect connect +#define lwip_listen listen +#define lwip_recv recv +#define lwip_recvfrom recvfrom +#define lwip_send send +#define lwip_sendmsg sendmsg +#define lwip_sendto sendto +#define lwip_socket socket +#define lwip_select select +#define lwip_ioctlsocket ioctl + +#if LWIP_POSIX_SOCKETS_IO_NAMES +#define lwip_read read +#define lwip_write write +#define lwip_writev writev +#undef lwip_close +#define lwip_close close +#define closesocket(s) close(s) +#define lwip_fcntl fcntl +#define lwip_ioctl ioctl +#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ +#endif /* LWIP_COMPAT_SOCKETS == 2 */ + +int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); +int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); +int lwip_shutdown(int s, int how); +int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); +int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); +int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); +int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); +int lwip_close(int s); +int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); +int lwip_listen(int s, int backlog); +int lwip_recv(int s, void *mem, size_t len, int flags); +int lwip_read(int s, void *mem, size_t len); +int lwip_recvfrom(int s, void *mem, size_t len, int flags, + struct sockaddr *from, socklen_t *fromlen); +int lwip_send(int s, const void *dataptr, size_t size, int flags); +int lwip_sendmsg(int s, const struct msghdr *message, int flags); +int lwip_sendto(int s, const void *dataptr, size_t size, int flags, + const struct sockaddr *to, socklen_t tolen); +int lwip_socket(int domain, int type, int protocol); +int lwip_write(int s, const void *dataptr, size_t size); +int lwip_writev(int s, const struct iovec *iov, int iovcnt); +int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, + struct timeval *timeout); +int lwip_ioctl(int s, long cmd, void *argp); +int lwip_fcntl(int s, int cmd, int val); + +#if LWIP_COMPAT_SOCKETS +#if LWIP_COMPAT_SOCKETS != 2 +/** @ingroup socket */ +#define accept(s,addr,addrlen) lwip_accept(s,addr,addrlen) +/** @ingroup socket */ +#define bind(s,name,namelen) lwip_bind(s,name,namelen) +/** @ingroup socket */ +#define shutdown(s,how) lwip_shutdown(s,how) +/** @ingroup socket */ +#define getpeername(s,name,namelen) lwip_getpeername(s,name,namelen) +/** @ingroup socket */ +#define getsockname(s,name,namelen) lwip_getsockname(s,name,namelen) +/** @ingroup socket */ +#define setsockopt(s,level,optname,opval,optlen) lwip_setsockopt(s,level,optname,opval,optlen) +/** @ingroup socket */ +#define getsockopt(s,level,optname,opval,optlen) lwip_getsockopt(s,level,optname,opval,optlen) +/** @ingroup socket */ +#define closesocket(s) lwip_close(s) +/** @ingroup socket */ +#define connect(s,name,namelen) lwip_connect(s,name,namelen) +/** @ingroup socket */ +#define listen(s,backlog) lwip_listen(s,backlog) +/** @ingroup socket */ +#define recv(s,mem,len,flags) lwip_recv(s,mem,len,flags) +/** @ingroup socket */ +#define recvfrom(s,mem,len,flags,from,fromlen) lwip_recvfrom(s,mem,len,flags,from,fromlen) +/** @ingroup socket */ +#define send(s,dataptr,size,flags) lwip_send(s,dataptr,size,flags) +/** @ingroup socket */ +#define sendmsg(s,message,flags) lwip_sendmsg(s,message,flags) +/** @ingroup socket */ +#define sendto(s,dataptr,size,flags,to,tolen) lwip_sendto(s,dataptr,size,flags,to,tolen) +/** @ingroup socket */ +#define socket(domain,type,protocol) lwip_socket(domain,type,protocol) +/** @ingroup socket */ +#define select(maxfdp1,readset,writeset,exceptset,timeout) lwip_select(maxfdp1,readset,writeset,exceptset,timeout) +/** @ingroup socket */ +#define ioctlsocket(s,cmd,argp) lwip_ioctl(s,cmd,argp) + +#if LWIP_POSIX_SOCKETS_IO_NAMES +/** @ingroup socket */ +#define read(s,mem,len) lwip_read(s,mem,len) +/** @ingroup socket */ +#define write(s,dataptr,len) lwip_write(s,dataptr,len) +/** @ingroup socket */ +#define writev(s,iov,iovcnt) lwip_writev(s,iov,iovcnt) +/** @ingroup socket */ +#define close(s) lwip_close(s) +/** @ingroup socket */ +#define fcntl(s,cmd,val) lwip_fcntl(s,cmd,val) +/** @ingroup socket */ +#define ioctl(s,cmd,argp) lwip_ioctl(s,cmd,argp) +#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ +#endif /* LWIP_COMPAT_SOCKETS != 2 */ + +#if LWIP_IPV4 && LWIP_IPV6 +/** @ingroup socket */ +#define inet_ntop(af,src,dst,size) \ + (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) \ + : (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL)) +/** @ingroup socket */ +#define inet_pton(af,src,dst) \ + (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) \ + : (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0)) +#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */ +#define inet_ntop(af,src,dst,size) \ + (((af) == AF_INET) ? ip4addr_ntoa_r((const ip4_addr_t*)(src),(dst),(size)) : NULL) +#define inet_pton(af,src,dst) \ + (((af) == AF_INET) ? ip4addr_aton((src),(ip4_addr_t*)(dst)) : 0) +#else /* LWIP_IPV4 && LWIP_IPV6 */ +#define inet_ntop(af,src,dst,size) \ + (((af) == AF_INET6) ? ip6addr_ntoa_r((const ip6_addr_t*)(src),(dst),(size)) : NULL) +#define inet_pton(af,src,dst) \ + (((af) == AF_INET6) ? ip6addr_aton((src),(ip6_addr_t*)(dst)) : 0) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + +#endif /* LWIP_COMPAT_SOCKETS */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_SOCKET */ + +#endif /* LWIP_HDR_SOCKETS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/stats.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/stats.h new file mode 100644 index 0000000..bcda2ac --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/stats.h @@ -0,0 +1,491 @@ +/** + * @file + * Statistics API (to be used from TCPIP thread) + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_STATS_H +#define LWIP_HDR_STATS_H + +#include "lwip/opt.h" + +#include "lwip/mem.h" +#include "lwip/memp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_STATS + +#ifndef LWIP_STATS_LARGE +#define LWIP_STATS_LARGE 0 +#endif + +#if LWIP_STATS_LARGE +#define STAT_COUNTER u32_t +#define STAT_COUNTER_F U32_F +#else +#define STAT_COUNTER u16_t +#define STAT_COUNTER_F U16_F +#endif + +/** Protocol related stats */ +struct stats_proto { + STAT_COUNTER xmit; /* Transmitted packets. */ + STAT_COUNTER recv; /* Received packets. */ + STAT_COUNTER fw; /* Forwarded packets. */ + STAT_COUNTER drop; /* Dropped packets. */ + STAT_COUNTER chkerr; /* Checksum error. */ + STAT_COUNTER lenerr; /* Invalid length error. */ + STAT_COUNTER memerr; /* Out of memory error. */ + STAT_COUNTER rterr; /* Routing error. */ + STAT_COUNTER proterr; /* Protocol error. */ + STAT_COUNTER opterr; /* Error in options. */ + STAT_COUNTER err; /* Misc error. */ + STAT_COUNTER cachehit; +}; + +/** IGMP stats */ +struct stats_igmp { + STAT_COUNTER xmit; /* Transmitted packets. */ + STAT_COUNTER recv; /* Received packets. */ + STAT_COUNTER drop; /* Dropped packets. */ + STAT_COUNTER chkerr; /* Checksum error. */ + STAT_COUNTER lenerr; /* Invalid length error. */ + STAT_COUNTER memerr; /* Out of memory error. */ + STAT_COUNTER proterr; /* Protocol error. */ + STAT_COUNTER rx_v1; /* Received v1 frames. */ + STAT_COUNTER rx_group; /* Received group-specific queries. */ + STAT_COUNTER rx_general; /* Received general queries. */ + STAT_COUNTER rx_report; /* Received reports. */ + STAT_COUNTER tx_join; /* Sent joins. */ + STAT_COUNTER tx_leave; /* Sent leaves. */ + STAT_COUNTER tx_report; /* Sent reports. */ +}; + +/** Memory stats */ +struct stats_mem { +#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY + const char *name; +#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */ + STAT_COUNTER err; + mem_size_t avail; + mem_size_t used; + mem_size_t max; + STAT_COUNTER illegal; +}; + +/** System element stats */ +struct stats_syselem { + STAT_COUNTER used; + STAT_COUNTER max; + STAT_COUNTER err; +}; + +/** System stats */ +struct stats_sys { + struct stats_syselem sem; + struct stats_syselem mutex; + struct stats_syselem mbox; +}; + +/** SNMP MIB2 stats */ +struct stats_mib2 { + /* IP */ + u32_t ipinhdrerrors; + u32_t ipinaddrerrors; + u32_t ipinunknownprotos; + u32_t ipindiscards; + u32_t ipindelivers; + u32_t ipoutrequests; + u32_t ipoutdiscards; + u32_t ipoutnoroutes; + u32_t ipreasmoks; + u32_t ipreasmfails; + u32_t ipfragoks; + u32_t ipfragfails; + u32_t ipfragcreates; + u32_t ipreasmreqds; + u32_t ipforwdatagrams; + u32_t ipinreceives; + + /* TCP */ + u32_t tcpactiveopens; + u32_t tcppassiveopens; + u32_t tcpattemptfails; + u32_t tcpestabresets; + u32_t tcpoutsegs; + u32_t tcpretranssegs; + u32_t tcpinsegs; + u32_t tcpinerrs; + u32_t tcpoutrsts; + + /* UDP */ + u32_t udpindatagrams; + u32_t udpnoports; + u32_t udpinerrors; + u32_t udpoutdatagrams; + + /* ICMP */ + u32_t icmpinmsgs; + u32_t icmpinerrors; + u32_t icmpindestunreachs; + u32_t icmpintimeexcds; + u32_t icmpinparmprobs; + u32_t icmpinsrcquenchs; + u32_t icmpinredirects; + u32_t icmpinechos; + u32_t icmpinechoreps; + u32_t icmpintimestamps; + u32_t icmpintimestampreps; + u32_t icmpinaddrmasks; + u32_t icmpinaddrmaskreps; + u32_t icmpoutmsgs; + u32_t icmpouterrors; + u32_t icmpoutdestunreachs; + u32_t icmpouttimeexcds; + u32_t icmpoutechos; /* can be incremented by user application ('ping') */ + u32_t icmpoutechoreps; +}; + +/** + * @ingroup netif_mib2 + * SNMP MIB2 interface stats + */ +struct stats_mib2_netif_ctrs { + /** The total number of octets received on the interface, including framing characters */ + u32_t ifinoctets; + /** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were + * not addressed to a multicast or broadcast address at this sub-layer */ + u32_t ifinucastpkts; + /** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were + * addressed to a multicast or broadcast address at this sub-layer */ + u32_t ifinnucastpkts; + /** The number of inbound packets which were chosen to be discarded even though no errors had + * been detected to prevent their being deliverable to a higher-layer protocol. One possible + * reason for discarding such a packet could be to free up buffer space */ + u32_t ifindiscards; + /** For packet-oriented interfaces, the number of inbound packets that contained errors + * preventing them from being deliverable to a higher-layer protocol. For character- + * oriented or fixed-length interfaces, the number of inbound transmission units that + * contained errors preventing them from being deliverable to a higher-layer protocol. */ + u32_t ifinerrors; + /** For packet-oriented interfaces, the number of packets received via the interface which + * were discarded because of an unknown or unsupported protocol. For character-oriented + * or fixed-length interfaces that support protocol multiplexing the number of transmission + * units received via the interface which were discarded because of an unknown or unsupported + * protocol. For any interface that does not support protocol multiplexing, this counter will + * always be 0 */ + u32_t ifinunknownprotos; + /** The total number of octets transmitted out of the interface, including framing characters. */ + u32_t ifoutoctets; + /** The total number of packets that higher-level protocols requested be transmitted, and + * which were not addressed to a multicast or broadcast address at this sub-layer, including + * those that were discarded or not sent. */ + u32_t ifoutucastpkts; + /** The total number of packets that higher-level protocols requested be transmitted, and which + * were addressed to a multicast or broadcast address at this sub-layer, including + * those that were discarded or not sent. */ + u32_t ifoutnucastpkts; + /** The number of outbound packets which were chosen to be discarded even though no errors had + * been detected to prevent their being transmitted. One possible reason for discarding + * such a packet could be to free up buffer space. */ + u32_t ifoutdiscards; + /** For packet-oriented interfaces, the number of outbound packets that could not be transmitted + * because of errors. For character-oriented or fixed-length interfaces, the number of outbound + * transmission units that could not be transmitted because of errors. */ + u32_t ifouterrors; +}; + +/** lwIP stats container */ +struct stats_ { +#if LINK_STATS + /** Link level */ + struct stats_proto link; +#endif +#if ETHARP_STATS + /** ARP */ + struct stats_proto etharp; +#endif +#if IPFRAG_STATS + /** Fragmentation */ + struct stats_proto ip_frag; +#endif +#if IP_STATS + /** IP */ + struct stats_proto ip; +#endif +#if ICMP_STATS + /** ICMP */ + struct stats_proto icmp; +#endif +#if IGMP_STATS + /** IGMP */ + struct stats_igmp igmp; +#endif +#if UDP_STATS + /** UDP */ + struct stats_proto udp; +#endif +#if TCP_STATS + /** TCP */ + struct stats_proto tcp; +#endif +#if MEM_STATS + /** Heap */ + struct stats_mem mem; +#endif +#if MEMP_STATS + /** Internal memory pools */ + struct stats_mem *memp[MEMP_MAX]; +#endif +#if SYS_STATS + /** System */ + struct stats_sys sys; +#endif +#if IP6_STATS + /** IPv6 */ + struct stats_proto ip6; +#endif +#if ICMP6_STATS + /** ICMP6 */ + struct stats_proto icmp6; +#endif +#if IP6_FRAG_STATS + /** IPv6 fragmentation */ + struct stats_proto ip6_frag; +#endif +#if MLD6_STATS + /** Multicast listener discovery */ + struct stats_igmp mld6; +#endif +#if ND6_STATS + /** Neighbor discovery */ + struct stats_proto nd6; +#endif +#if MIB2_STATS + /** SNMP MIB2 */ + struct stats_mib2 mib2; +#endif +}; + +/** Global variable containing lwIP internal statistics. Add this to your debugger's watchlist. */ +extern struct stats_ lwip_stats; + +/** Init statistics */ +void stats_init(void); + +#define STATS_INC(x) ++lwip_stats.x +#define STATS_DEC(x) --lwip_stats.x +#define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ + if (lwip_stats.x.max < lwip_stats.x.used) { \ + lwip_stats.x.max = lwip_stats.x.used; \ + } \ + } while(0) +#define STATS_GET(x) lwip_stats.x +#else /* LWIP_STATS */ +#define stats_init() +#define STATS_INC(x) +#define STATS_DEC(x) +#define STATS_INC_USED(x) +#endif /* LWIP_STATS */ + +#if TCP_STATS +#define TCP_STATS_INC(x) STATS_INC(x) +#define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") +#else +#define TCP_STATS_INC(x) +#define TCP_STATS_DISPLAY() +#endif + +#if UDP_STATS +#define UDP_STATS_INC(x) STATS_INC(x) +#define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") +#else +#define UDP_STATS_INC(x) +#define UDP_STATS_DISPLAY() +#endif + +#if ICMP_STATS +#define ICMP_STATS_INC(x) STATS_INC(x) +#define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") +#else +#define ICMP_STATS_INC(x) +#define ICMP_STATS_DISPLAY() +#endif + +#if IGMP_STATS +#define IGMP_STATS_INC(x) STATS_INC(x) +#define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp, "IGMP") +#else +#define IGMP_STATS_INC(x) +#define IGMP_STATS_DISPLAY() +#endif + +#if IP_STATS +#define IP_STATS_INC(x) STATS_INC(x) +#define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") +#else +#define IP_STATS_INC(x) +#define IP_STATS_DISPLAY() +#endif + +#if IPFRAG_STATS +#define IPFRAG_STATS_INC(x) STATS_INC(x) +#define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") +#else +#define IPFRAG_STATS_INC(x) +#define IPFRAG_STATS_DISPLAY() +#endif + +#if ETHARP_STATS +#define ETHARP_STATS_INC(x) STATS_INC(x) +#define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") +#else +#define ETHARP_STATS_INC(x) +#define ETHARP_STATS_DISPLAY() +#endif + +#if LINK_STATS +#define LINK_STATS_INC(x) STATS_INC(x) +#define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") +#else +#define LINK_STATS_INC(x) +#define LINK_STATS_DISPLAY() +#endif + +#if MEM_STATS +#define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y +#define MEM_STATS_INC(x) STATS_INC(mem.x) +#define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y) +#define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x -= y +#define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") +#else +#define MEM_STATS_AVAIL(x, y) +#define MEM_STATS_INC(x) +#define MEM_STATS_INC_USED(x, y) +#define MEM_STATS_DEC_USED(x, y) +#define MEM_STATS_DISPLAY() +#endif + + #if MEMP_STATS +#define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i]->x) +#define MEMP_STATS_DISPLAY(i) stats_display_memp(lwip_stats.memp[i], i) +#define MEMP_STATS_GET(x, i) STATS_GET(memp[i]->x) + #else +#define MEMP_STATS_DEC(x, i) +#define MEMP_STATS_DISPLAY(i) +#define MEMP_STATS_GET(x, i) 0 +#endif + +#if SYS_STATS +#define SYS_STATS_INC(x) STATS_INC(sys.x) +#define SYS_STATS_DEC(x) STATS_DEC(sys.x) +#define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) +#define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) +#else +#define SYS_STATS_INC(x) +#define SYS_STATS_DEC(x) +#define SYS_STATS_INC_USED(x) +#define SYS_STATS_DISPLAY() +#endif + +#if IP6_STATS +#define IP6_STATS_INC(x) STATS_INC(x) +#define IP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6, "IPv6") +#else +#define IP6_STATS_INC(x) +#define IP6_STATS_DISPLAY() +#endif + +#if ICMP6_STATS +#define ICMP6_STATS_INC(x) STATS_INC(x) +#define ICMP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp6, "ICMPv6") +#else +#define ICMP6_STATS_INC(x) +#define ICMP6_STATS_DISPLAY() +#endif + +#if IP6_FRAG_STATS +#define IP6_FRAG_STATS_INC(x) STATS_INC(x) +#define IP6_FRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6_frag, "IPv6 FRAG") +#else +#define IP6_FRAG_STATS_INC(x) +#define IP6_FRAG_STATS_DISPLAY() +#endif + +#if MLD6_STATS +#define MLD6_STATS_INC(x) STATS_INC(x) +#define MLD6_STATS_DISPLAY() stats_display_igmp(&lwip_stats.mld6, "MLDv1") +#else +#define MLD6_STATS_INC(x) +#define MLD6_STATS_DISPLAY() +#endif + +#if ND6_STATS +#define ND6_STATS_INC(x) STATS_INC(x) +#define ND6_STATS_DISPLAY() stats_display_proto(&lwip_stats.nd6, "ND") +#else +#define ND6_STATS_INC(x) +#define ND6_STATS_DISPLAY() +#endif + +#if MIB2_STATS +#define MIB2_STATS_INC(x) STATS_INC(x) +#else +#define MIB2_STATS_INC(x) +#endif + +/* Display of statistics */ +#if LWIP_STATS_DISPLAY +void stats_display(void); +void stats_display_proto(struct stats_proto *proto, const char *name); +void stats_display_igmp(struct stats_igmp *igmp, const char *name); +void stats_display_mem(struct stats_mem *mem, const char *name); +void stats_display_memp(struct stats_mem *mem, int index); +void stats_display_sys(struct stats_sys *sys); +#else /* LWIP_STATS_DISPLAY */ +#define stats_display() +#define stats_display_proto(proto, name) +#define stats_display_igmp(igmp, name) +#define stats_display_mem(mem, name) +#define stats_display_memp(mem, index) +#define stats_display_sys(sys) +#endif /* LWIP_STATS_DISPLAY */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_STATS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sys.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sys.h new file mode 100644 index 0000000..d12bae0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/sys.h @@ -0,0 +1,455 @@ +/** + * @file + * OS abstraction layer + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + */ + +#ifndef LWIP_HDR_SYS_H +#define LWIP_HDR_SYS_H + +#include "lwip/opt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if NO_SYS + +/* For a totally minimal and standalone system, we provide null + definitions of the sys_ functions. */ +typedef u8_t sys_sem_t; +typedef u8_t sys_mutex_t; +typedef u8_t sys_mbox_t; + +#define sys_sem_new(s, c) ERR_OK +#define sys_sem_signal(s) +#define sys_sem_wait(s) +#define sys_arch_sem_wait(s,t) +#define sys_sem_free(s) +#define sys_sem_valid(s) 0 +#define sys_sem_valid_val(s) 0 +#define sys_sem_set_invalid(s) +#define sys_sem_set_invalid_val(s) +#define sys_mutex_new(mu) ERR_OK +#define sys_mutex_lock(mu) +#define sys_mutex_unlock(mu) +#define sys_mutex_free(mu) +#define sys_mutex_valid(mu) 0 +#define sys_mutex_set_invalid(mu) +#define sys_mbox_new(m, s) ERR_OK +#define sys_mbox_fetch(m,d) +#define sys_mbox_tryfetch(m,d) +#define sys_mbox_post(m,d) +#define sys_mbox_trypost(m,d) +#define sys_mbox_free(m) +#define sys_mbox_valid(m) +#define sys_mbox_valid_val(m) +#define sys_mbox_set_invalid(m) +#define sys_mbox_set_invalid_val(m) + +#define sys_thread_new(n,t,a,s,p) + +#define sys_msleep(t) + +#else /* NO_SYS */ + +/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */ +#define SYS_ARCH_TIMEOUT 0xffffffffUL + +/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. + * For now we use the same magic value, but we allow this to change in future. + */ +#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT + +#include "lwip/err.h" +#include "arch/sys_arch.h" + +/** Function prototype for thread functions */ +typedef void (*lwip_thread_fn)(void *arg); + +/* Function prototypes for functions to be implemented by platform ports + (in sys_arch.c) */ + +/* Mutex functions: */ + +/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores + should be used instead */ +#ifndef LWIP_COMPAT_MUTEX +#define LWIP_COMPAT_MUTEX 0 +#endif + +#if LWIP_COMPAT_MUTEX +/* for old ports that don't have mutexes: define them to binary semaphores */ +#define sys_mutex_t sys_sem_t +#define sys_mutex_new(mutex) sys_sem_new(mutex, 1) +#define sys_mutex_lock(mutex) sys_sem_wait(mutex) +#define sys_mutex_unlock(mutex) sys_sem_signal(mutex) +#define sys_mutex_free(mutex) sys_sem_free(mutex) +#define sys_mutex_valid(mutex) sys_sem_valid(mutex) +#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex) + +#else /* LWIP_COMPAT_MUTEX */ + +/** + * @ingroup sys_mutex + * Create a new mutex. + * Note that mutexes are expected to not be taken recursively by the lwIP code, + * so both implementation types (recursive or non-recursive) should work. + * @param mutex pointer to the mutex to create + * @return ERR_OK if successful, another err_t otherwise + */ +err_t sys_mutex_new(sys_mutex_t *mutex); +/** + * @ingroup sys_mutex + * Lock a mutex + * @param mutex the mutex to lock + */ +void sys_mutex_lock(sys_mutex_t *mutex); +/** + * @ingroup sys_mutex + * Unlock a mutex + * @param mutex the mutex to unlock + */ +void sys_mutex_unlock(sys_mutex_t *mutex); +/** + * @ingroup sys_mutex + * Delete a semaphore + * @param mutex the mutex to delete + */ +void sys_mutex_free(sys_mutex_t *mutex); +#ifndef sys_mutex_valid +/** + * @ingroup sys_mutex + * Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid + */ +int sys_mutex_valid(sys_mutex_t *mutex); +#endif +#ifndef sys_mutex_set_invalid +/** + * @ingroup sys_mutex + * Set a mutex invalid so that sys_mutex_valid returns 0 + */ +void sys_mutex_set_invalid(sys_mutex_t *mutex); +#endif +#endif /* LWIP_COMPAT_MUTEX */ + +/* Semaphore functions: */ + +/** + * @ingroup sys_sem + * Create a new semaphore + * @param sem pointer to the semaphore to create + * @param count initial count of the semaphore + * @return ERR_OK if successful, another err_t otherwise + */ +err_t sys_sem_new(sys_sem_t *sem, u8_t count); +/** + * @ingroup sys_sem + * Signals a semaphore + * @param sem the semaphore to signal + */ +void sys_sem_signal(sys_sem_t *sem); +/** + * @ingroup sys_sem + * Wait for a semaphore for the specified timeout + * @param sem the semaphore to wait for + * @param timeout timeout in milliseconds to wait (0 = wait forever) + * @return time (in milliseconds) waited for the semaphore + * or SYS_ARCH_TIMEOUT on timeout + */ +u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout); +/** + * @ingroup sys_sem + * Delete a semaphore + * @param sem semaphore to delete + */ +void sys_sem_free(sys_sem_t *sem); +/** Wait for a semaphore - forever/no timeout */ +#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) +#ifndef sys_sem_valid +/** + * @ingroup sys_sem + * Check if a semaphore is valid/allocated: return 1 for valid, 0 for invalid + */ +int sys_sem_valid(sys_sem_t *sem); +#endif +#ifndef sys_sem_set_invalid +/** + * @ingroup sys_sem + * Set a semaphore invalid so that sys_sem_valid returns 0 + */ +void sys_sem_set_invalid(sys_sem_t *sem); +#endif +#ifndef sys_sem_valid_val +/** + * Same as sys_sem_valid() but taking a value, not a pointer + */ +#define sys_sem_valid_val(sem) sys_sem_valid(&(sem)) +#endif +#ifndef sys_sem_set_invalid_val +/** + * Same as sys_sem_set_invalid() but taking a value, not a pointer + */ +#define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem)) +#endif + +#ifndef sys_msleep +/** + * @ingroup sys_misc + * Sleep for specified number of ms + */ +void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */ +#endif + +/* Mailbox functions. */ + +/** + * @ingroup sys_mbox + * Create a new mbox of specified size + * @param mbox pointer to the mbox to create + * @param size (minimum) number of messages in this mbox + * @return ERR_OK if successful, another err_t otherwise + */ +err_t sys_mbox_new(sys_mbox_t *mbox, int size); +/** + * @ingroup sys_mbox + * Post a message to an mbox - may not fail + * -> blocks if full, only used from tasks not from ISR + * @param mbox mbox to posts the message + * @param msg message to post (ATTENTION: can be NULL) + */ +void sys_mbox_post(sys_mbox_t *mbox, void *msg); +/** + * @ingroup sys_mbox + * Try to post a message to an mbox - may fail if full or ISR + * @param mbox mbox to posts the message + * @param msg message to post (ATTENTION: can be NULL) + */ +err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); +/** + * @ingroup sys_mbox + * Wait for a new message to arrive in the mbox + * @param mbox mbox to get a message from + * @param msg pointer where the message is stored + * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever) + * @return time (in milliseconds) waited for a message, may be 0 if not waited + or SYS_ARCH_TIMEOUT on timeout + * The returned time has to be accurate to prevent timer jitter! + */ +u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); +/* Allow port to override with a macro, e.g. special timeout for sys_arch_mbox_fetch() */ +#ifndef sys_arch_mbox_tryfetch +/** + * @ingroup sys_mbox + * Wait for a new message to arrive in the mbox + * @param mbox mbox to get a message from + * @param msg pointer where the message is stored + * @return 0 (milliseconds) if a message has been received + * or SYS_MBOX_EMPTY if the mailbox is empty + */ +u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); +#endif +/** + * For now, we map straight to sys_arch implementation. + */ +#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) +/** + * @ingroup sys_mbox + * Delete an mbox + * @param mbox mbox to delete + */ +void sys_mbox_free(sys_mbox_t *mbox); +#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) +#ifndef sys_mbox_valid +/** + * @ingroup sys_mbox + * Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid + */ +int sys_mbox_valid(sys_mbox_t *mbox); +#endif +#ifndef sys_mbox_set_invalid +/** + * @ingroup sys_mbox + * Set an mbox invalid so that sys_mbox_valid returns 0 + */ +void sys_mbox_set_invalid(sys_mbox_t *mbox); +#endif +#ifndef sys_mbox_valid_val +/** + * Same as sys_mbox_valid() but taking a value, not a pointer + */ +#define sys_mbox_valid_val(mbox) sys_mbox_valid(&(mbox)) +#endif +#ifndef sys_mbox_set_invalid_val +/** + * Same as sys_mbox_set_invalid() but taking a value, not a pointer + */ +#define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox)) +#endif + + +/** + * @ingroup sys_misc + * The only thread function: + * Creates a new thread + * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!) + * @param name human-readable name for the thread (used for debugging purposes) + * @param thread thread-function + * @param arg parameter passed to 'thread' + * @param stacksize stack size in bytes for the new thread (may be ignored by ports) + * @param prio priority of the new thread (may be ignored by ports) */ +sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio); + +#endif /* NO_SYS */ + +/* sys_init() must be called before anything else. */ +void sys_init(void); + +#ifndef sys_jiffies +/** + * Ticks/jiffies since power up. + */ +u32_t sys_jiffies(void); +#endif + +/** + * @ingroup sys_time + * Returns the current time in milliseconds, + * may be the same as sys_jiffies or at least based on it. + */ +u32_t sys_now(void); + +/* Critical Region Protection */ +/* These functions must be implemented in the sys_arch.c file. + In some implementations they can provide a more light-weight protection + mechanism than using semaphores. Otherwise semaphores can be used for + implementation */ +#ifndef SYS_ARCH_PROTECT +/** SYS_LIGHTWEIGHT_PROT + * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection + * for certain critical regions during buffer allocation, deallocation and memory + * allocation and deallocation. + */ +#if SYS_LIGHTWEIGHT_PROT + +/** + * @ingroup sys_prot + * SYS_ARCH_DECL_PROTECT + * declare a protection variable. This macro will default to defining a variable of + * type sys_prot_t. If a particular port needs a different implementation, then + * this macro may be defined in sys_arch.h. + */ +#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev +/** + * @ingroup sys_prot + * SYS_ARCH_PROTECT + * Perform a "fast" protect. This could be implemented by + * disabling interrupts for an embedded system or by using a semaphore or + * mutex. The implementation should allow calling SYS_ARCH_PROTECT when + * already protected. The old protection level is returned in the variable + * "lev". This macro will default to calling the sys_arch_protect() function + * which should be implemented in sys_arch.c. If a particular port needs a + * different implementation, then this macro may be defined in sys_arch.h + */ +#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() +/** + * @ingroup sys_prot + * SYS_ARCH_UNPROTECT + * Perform a "fast" set of the protection level to "lev". This could be + * implemented by setting the interrupt level to "lev" within the MACRO or by + * using a semaphore or mutex. This macro will default to calling the + * sys_arch_unprotect() function which should be implemented in + * sys_arch.c. If a particular port needs a different implementation, then + * this macro may be defined in sys_arch.h + */ +#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) +sys_prot_t sys_arch_protect(void); +void sys_arch_unprotect(sys_prot_t pval); + +#else + +#define SYS_ARCH_DECL_PROTECT(lev) +#define SYS_ARCH_PROTECT(lev) +#define SYS_ARCH_UNPROTECT(lev) + +#endif /* SYS_LIGHTWEIGHT_PROT */ + +#endif /* SYS_ARCH_PROTECT */ + +/* + * Macros to set/get and increase/decrease variables in a thread-safe way. + * Use these for accessing variable that are used from more than one thread. + */ + +#ifndef SYS_ARCH_INC +#define SYS_ARCH_INC(var, val) do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var += val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while(0) +#endif /* SYS_ARCH_INC */ + +#ifndef SYS_ARCH_DEC +#define SYS_ARCH_DEC(var, val) do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var -= val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while(0) +#endif /* SYS_ARCH_DEC */ + +#ifndef SYS_ARCH_GET +#define SYS_ARCH_GET(var, ret) do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + ret = var; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while(0) +#endif /* SYS_ARCH_GET */ + +#ifndef SYS_ARCH_SET +#define SYS_ARCH_SET(var, val) do { \ + SYS_ARCH_DECL_PROTECT(old_level); \ + SYS_ARCH_PROTECT(old_level); \ + var = val; \ + SYS_ARCH_UNPROTECT(old_level); \ + } while(0) +#endif /* SYS_ARCH_SET */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_SYS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcp.h new file mode 100644 index 0000000..34d1c10 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcp.h @@ -0,0 +1,433 @@ +/** + * @file + * TCP API (to be used from TCPIP thread)\n + * See also @ref tcp_raw + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_TCP_H +#define LWIP_HDR_TCP_H + +#include "lwip/opt.h" + +#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/ip.h" +#include "lwip/icmp.h" +#include "lwip/err.h" +#include "lwip/ip6.h" +#include "lwip/ip6_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct tcp_pcb; + +/** Function prototype for tcp accept callback functions. Called when a new + * connection can be accepted on a listening pcb. + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param newpcb The new connection pcb + * @param err An error code if there has been an error accepting. + * Only return ERR_ABRT if you have called tcp_abort from within the + * callback function! + */ +typedef err_t (*tcp_accept_fn)(void *arg, struct tcp_pcb *newpcb, err_t err); + +/** Function prototype for tcp receive callback functions. Called when data has + * been received. + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param tpcb The connection pcb which received data + * @param p The received data (or NULL when the connection has been closed!) + * @param err An error code if there has been an error receiving + * Only return ERR_ABRT if you have called tcp_abort from within the + * callback function! + */ +typedef err_t (*tcp_recv_fn)(void *arg, struct tcp_pcb *tpcb, + struct pbuf *p, err_t err); + +/** Function prototype for tcp sent callback functions. Called when sent data has + * been acknowledged by the remote side. Use it to free corresponding resources. + * This also means that the pcb has now space available to send new data. + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param tpcb The connection pcb for which data has been acknowledged + * @param len The amount of bytes acknowledged + * @return ERR_OK: try to send some data by calling tcp_output + * Only return ERR_ABRT if you have called tcp_abort from within the + * callback function! + */ +typedef err_t (*tcp_sent_fn)(void *arg, struct tcp_pcb *tpcb, + u16_t len); + +/** Function prototype for tcp poll callback functions. Called periodically as + * specified by @see tcp_poll. + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param tpcb tcp pcb + * @return ERR_OK: try to send some data by calling tcp_output + * Only return ERR_ABRT if you have called tcp_abort from within the + * callback function! + */ +typedef err_t (*tcp_poll_fn)(void *arg, struct tcp_pcb *tpcb); + +/** Function prototype for tcp error callback functions. Called when the pcb + * receives a RST or is unexpectedly closed for any other reason. + * + * @note The corresponding pcb is already freed when this callback is called! + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param err Error code to indicate why the pcb has been closed + * ERR_ABRT: aborted through tcp_abort or by a TCP timer + * ERR_RST: the connection was reset by the remote host + */ +typedef void (*tcp_err_fn)(void *arg, err_t err); + +/** Function prototype for tcp connected callback functions. Called when a pcb + * is connected to the remote side after initiating a connection attempt by + * calling tcp_connect(). + * + * @param arg Additional argument to pass to the callback function (@see tcp_arg()) + * @param tpcb The connection pcb which is connected + * @param err An unused error code, always ERR_OK currently ;-) @todo! + * Only return ERR_ABRT if you have called tcp_abort from within the + * callback function! + * + * @note When a connection attempt fails, the error callback is currently called! + */ +typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err); + +#if LWIP_WND_SCALE +#define RCV_WND_SCALE(pcb, wnd) (((wnd) >> (pcb)->rcv_scale)) +#define SND_WND_SCALE(pcb, wnd) (((wnd) << (pcb)->snd_scale)) +#define TCPWND16(x) ((u16_t)LWIP_MIN((x), 0xFFFF)) +#define TCP_WND_MAX(pcb) ((tcpwnd_size_t)(((pcb)->flags & TF_WND_SCALE) ? TCP_WND : TCPWND16(TCP_WND))) +typedef u32_t tcpwnd_size_t; +#else +#define RCV_WND_SCALE(pcb, wnd) (wnd) +#define SND_WND_SCALE(pcb, wnd) (wnd) +#define TCPWND16(x) (x) +#define TCP_WND_MAX(pcb) TCP_WND +typedef u16_t tcpwnd_size_t; +#endif + +#if LWIP_WND_SCALE || TCP_LISTEN_BACKLOG || LWIP_TCP_TIMESTAMPS +typedef u16_t tcpflags_t; +#else +typedef u8_t tcpflags_t; +#endif + +enum tcp_state { + CLOSED = 0, + LISTEN = 1, + SYN_SENT = 2, + SYN_RCVD = 3, + ESTABLISHED = 4, + FIN_WAIT_1 = 5, + FIN_WAIT_2 = 6, + CLOSE_WAIT = 7, + CLOSING = 8, + LAST_ACK = 9, + TIME_WAIT = 10 +}; + +/** + * members common to struct tcp_pcb and struct tcp_listen_pcb + */ +#define TCP_PCB_COMMON(type) \ + type *next; /* for the linked list */ \ + void *callback_arg; \ + enum tcp_state state; /* TCP state */ \ + u8_t prio; \ + /* ports are in host byte order */ \ + u16_t local_port + + +/** the TCP protocol control block for listening pcbs */ +struct tcp_pcb_listen { +/** Common members of all PCB types */ + IP_PCB; +/** Protocol specific PCB members */ + TCP_PCB_COMMON(struct tcp_pcb_listen); + +#if LWIP_CALLBACK_API + /* Function to call when a listener has been connected. */ + tcp_accept_fn accept; +#endif /* LWIP_CALLBACK_API */ + +#if TCP_LISTEN_BACKLOG + u8_t backlog; + u8_t accepts_pending; +#endif /* TCP_LISTEN_BACKLOG */ +}; + + +/** the TCP protocol control block */ +struct tcp_pcb { +/** common PCB members */ + IP_PCB; +/** protocol specific PCB members */ + TCP_PCB_COMMON(struct tcp_pcb); + + /* ports are in host byte order */ + u16_t remote_port; + + tcpflags_t flags; +#define TF_ACK_DELAY 0x01U /* Delayed ACK. */ +#define TF_ACK_NOW 0x02U /* Immediate ACK. */ +#define TF_INFR 0x04U /* In fast recovery. */ +#define TF_CLOSEPEND 0x08U /* If this is set, tcp_close failed to enqueue the FIN (retried in tcp_tmr) */ +#define TF_RXCLOSED 0x10U /* rx closed by tcp_shutdown */ +#define TF_FIN 0x20U /* Connection was closed locally (FIN segment enqueued). */ +#define TF_NODELAY 0x40U /* Disable Nagle algorithm */ +#define TF_NAGLEMEMERR 0x80U /* nagle enabled, memerr, try to output to prevent delayed ACK to happen */ +#if LWIP_WND_SCALE +#define TF_WND_SCALE 0x0100U /* Window Scale option enabled */ +#endif +#if TCP_LISTEN_BACKLOG +#define TF_BACKLOGPEND 0x0200U /* If this is set, a connection pcb has increased the backlog on its listener */ +#endif +#if LWIP_TCP_TIMESTAMPS +#define TF_TIMESTAMP 0x0400U /* Timestamp option enabled */ +#endif + + /* the rest of the fields are in host byte order + as we have to do some math with them */ + + /* Timers */ + u8_t polltmr, pollinterval; + u8_t last_timer; + u32_t tmr; + + /* receiver variables */ + u32_t rcv_nxt; /* next seqno expected */ + tcpwnd_size_t rcv_wnd; /* receiver window available */ + tcpwnd_size_t rcv_ann_wnd; /* receiver window to announce */ + u32_t rcv_ann_right_edge; /* announced right edge of window */ + + /* Retransmission timer. */ + s16_t rtime; + + u16_t mss; /* maximum segment size */ + + /* RTT (round trip time) estimation variables */ + u32_t rttest; /* RTT estimate in 500ms ticks */ + u32_t rtseq; /* sequence number being timed */ + s16_t sa, sv; /* @todo document this */ + + s16_t rto; /* retransmission time-out */ + u8_t nrtx; /* number of retransmissions */ + + /* fast retransmit/recovery */ + u8_t dupacks; + u32_t lastack; /* Highest acknowledged seqno. */ + + /* congestion avoidance/control variables */ + tcpwnd_size_t cwnd; + tcpwnd_size_t ssthresh; + + /* sender variables */ + u32_t snd_nxt; /* next new seqno to be sent */ + u32_t snd_wl1, snd_wl2; /* Sequence and acknowledgement numbers of last + window update. */ + u32_t snd_lbb; /* Sequence number of next byte to be buffered. */ + tcpwnd_size_t snd_wnd; /* sender window */ + tcpwnd_size_t snd_wnd_max; /* the maximum sender window announced by the remote host */ + + tcpwnd_size_t snd_buf; /* Available buffer space for sending (in bytes). */ +#define TCP_SNDQUEUELEN_OVERFLOW (0xffffU-3) + u16_t snd_queuelen; /* Number of pbufs currently in the send buffer. */ + +#if TCP_OVERSIZE + /* Extra bytes available at the end of the last pbuf in unsent. */ + u16_t unsent_oversize; +#endif /* TCP_OVERSIZE */ + + /* These are ordered by sequence number: */ + struct tcp_seg *unsent; /* Unsent (queued) segments. */ + struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ +#if TCP_QUEUE_OOSEQ + struct tcp_seg *ooseq; /* Received out of sequence segments. */ +#endif /* TCP_QUEUE_OOSEQ */ + + struct pbuf *refused_data; /* Data previously received but not yet taken by upper layer */ + +#if LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG + struct tcp_pcb_listen* listener; +#endif /* LWIP_CALLBACK_API || TCP_LISTEN_BACKLOG */ + +#if LWIP_CALLBACK_API + /* Function to be called when more send buffer space is available. */ + tcp_sent_fn sent; + /* Function to be called when (in-sequence) data has arrived. */ + tcp_recv_fn recv; + /* Function to be called when a connection has been set up. */ + tcp_connected_fn connected; + /* Function which is called periodically. */ + tcp_poll_fn poll; + /* Function to be called whenever a fatal error occurs. */ + tcp_err_fn errf; +#endif /* LWIP_CALLBACK_API */ + +#if LWIP_TCP_TIMESTAMPS + u32_t ts_lastacksent; + u32_t ts_recent; +#endif /* LWIP_TCP_TIMESTAMPS */ + + /* idle time before KEEPALIVE is sent */ + u32_t keep_idle; +#if LWIP_TCP_KEEPALIVE + u32_t keep_intvl; + u32_t keep_cnt; +#endif /* LWIP_TCP_KEEPALIVE */ + + /* Persist timer counter */ + u8_t persist_cnt; + /* Persist timer back-off */ + u8_t persist_backoff; + + /* KEEPALIVE counter */ + u8_t keep_cnt_sent; + +#if LWIP_WND_SCALE + u8_t snd_scale; + u8_t rcv_scale; +#endif +}; + +#if LWIP_EVENT_API + +enum lwip_event { + LWIP_EVENT_ACCEPT, + LWIP_EVENT_SENT, + LWIP_EVENT_RECV, + LWIP_EVENT_CONNECTED, + LWIP_EVENT_POLL, + LWIP_EVENT_ERR +}; + +err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb, + enum lwip_event, + struct pbuf *p, + u16_t size, + err_t err); + +#endif /* LWIP_EVENT_API */ + +/* Application program's interface: */ +struct tcp_pcb * tcp_new (void); +struct tcp_pcb * tcp_new_ip_type (u8_t type); + +void tcp_arg (struct tcp_pcb *pcb, void *arg); +#if LWIP_CALLBACK_API +void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv); +void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent); +void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err); +void tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept); +#endif /* LWIP_CALLBACK_API */ +void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval); + +#if LWIP_TCP_TIMESTAMPS +#define tcp_mss(pcb) (((pcb)->flags & TF_TIMESTAMP) ? ((pcb)->mss - 12) : (pcb)->mss) +#else /* LWIP_TCP_TIMESTAMPS */ +#define tcp_mss(pcb) ((pcb)->mss) +#endif /* LWIP_TCP_TIMESTAMPS */ +#define tcp_sndbuf(pcb) (TCPWND16((pcb)->snd_buf)) +#define tcp_sndqueuelen(pcb) ((pcb)->snd_queuelen) +/** @ingroup tcp_raw */ +#define tcp_nagle_disable(pcb) ((pcb)->flags |= TF_NODELAY) +/** @ingroup tcp_raw */ +#define tcp_nagle_enable(pcb) ((pcb)->flags = (tcpflags_t)((pcb)->flags & ~TF_NODELAY)) +/** @ingroup tcp_raw */ +#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0) + +#if TCP_LISTEN_BACKLOG +#define tcp_backlog_set(pcb, new_backlog) do { \ + LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", (pcb)->state == LISTEN); \ + ((struct tcp_pcb_listen *)(pcb))->backlog = ((new_backlog) ? (new_backlog) : 1); } while(0) +void tcp_backlog_delayed(struct tcp_pcb* pcb); +void tcp_backlog_accepted(struct tcp_pcb* pcb); +#else /* TCP_LISTEN_BACKLOG */ +#define tcp_backlog_set(pcb, new_backlog) +#define tcp_backlog_delayed(pcb) +#define tcp_backlog_accepted(pcb) +#endif /* TCP_LISTEN_BACKLOG */ +#define tcp_accepted(pcb) /* compatibility define, not needed any more */ + +void tcp_recved (struct tcp_pcb *pcb, u16_t len); +err_t tcp_bind (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, + u16_t port); +err_t tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr, + u16_t port, tcp_connected_fn connected); + +struct tcp_pcb * tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err); +struct tcp_pcb * tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog); +/** @ingroup tcp_raw */ +#define tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) + +void tcp_abort (struct tcp_pcb *pcb); +err_t tcp_close (struct tcp_pcb *pcb); +err_t tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx); + +/* Flags for "apiflags" parameter in tcp_write */ +#define TCP_WRITE_FLAG_COPY 0x01 +#define TCP_WRITE_FLAG_MORE 0x02 + +err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len, + u8_t apiflags); + +void tcp_setprio (struct tcp_pcb *pcb, u8_t prio); + +#define TCP_PRIO_MIN 1 +#define TCP_PRIO_NORMAL 64 +#define TCP_PRIO_MAX 127 + +err_t tcp_output (struct tcp_pcb *pcb); + + +const char* tcp_debug_state_str(enum tcp_state s); + +/* for compatibility with older implementation */ +#define tcp_new_ip6() tcp_new_ip_type(IPADDR_TYPE_V6) + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_TCP */ + +#endif /* LWIP_HDR_TCP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcpip.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcpip.h new file mode 100644 index 0000000..f2f6b46 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/tcpip.h @@ -0,0 +1,106 @@ +/** + * @file + * Functions to sync with TCPIP thread + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_TCPIP_H +#define LWIP_HDR_TCPIP_H + +#include "lwip/opt.h" + +#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/err.h" +#include "lwip/timeouts.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_TCPIP_CORE_LOCKING +/** The global semaphore to lock the stack. */ +extern sys_mutex_t lock_tcpip_core; +/** Lock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ +#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) +/** Unlock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */ +#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) +#else /* LWIP_TCPIP_CORE_LOCKING */ +#define LOCK_TCPIP_CORE() +#define UNLOCK_TCPIP_CORE() +#endif /* LWIP_TCPIP_CORE_LOCKING */ + +struct pbuf; +struct netif; + +/** Function prototype for the init_done function passed to tcpip_init */ +typedef void (*tcpip_init_done_fn)(void *arg); +/** Function prototype for functions passed to tcpip_callback() */ +typedef void (*tcpip_callback_fn)(void *ctx); + +/* Forward declarations */ +struct tcpip_callback_msg; + +void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg); + +err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn); +err_t tcpip_input(struct pbuf *p, struct netif *inp); + +err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block); +/** + * @ingroup lwip_os + * @see tcpip_callback_with_block + */ +#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) + +struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx); +void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg); +err_t tcpip_trycallback(struct tcpip_callback_msg* msg); + +/* free pbufs or heap memory from another context without blocking */ +err_t pbuf_free_callback(struct pbuf *p); +err_t mem_free_callback(void *m); + +#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS +err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg); +err_t tcpip_untimeout(sys_timeout_handler h, void *arg); +#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */ + +#ifdef __cplusplus +} +#endif + +#endif /* !NO_SYS */ + +#endif /* LWIP_HDR_TCPIP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/timeouts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/timeouts.h new file mode 100644 index 0000000..c9b93aa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/timeouts.h @@ -0,0 +1,121 @@ +/** + * @file + * Timer implementations + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_TIMEOUTS_H +#define LWIP_HDR_TIMEOUTS_H + +#include "lwip/opt.h" +#include "lwip/err.h" +#if !NO_SYS +#include "lwip/sys.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef LWIP_DEBUG_TIMERNAMES +#ifdef LWIP_DEBUG +#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG +#else /* LWIP_DEBUG */ +#define LWIP_DEBUG_TIMERNAMES 0 +#endif /* LWIP_DEBUG*/ +#endif + +/** Function prototype for a stack-internal timer function that has to be + * called at a defined interval */ +typedef void (* lwip_cyclic_timer_handler)(void); + +/** This struct contains information about a stack-internal timer function + that has to be called at a defined interval */ +struct lwip_cyclic_timer { + u32_t interval_ms; + lwip_cyclic_timer_handler handler; +#if LWIP_DEBUG_TIMERNAMES + const char* handler_name; +#endif /* LWIP_DEBUG_TIMERNAMES */ +}; + +/** This array contains all stack-internal cyclic timers. To get the number of + * timers, use LWIP_ARRAYSIZE() */ +extern const struct lwip_cyclic_timer lwip_cyclic_timers[]; + +#if LWIP_TIMERS + +/** Function prototype for a timeout callback function. Register such a function + * using sys_timeout(). + * + * @param arg Additional argument to pass to the function - set up by sys_timeout() + */ +typedef void (* sys_timeout_handler)(void *arg); + +struct sys_timeo { + struct sys_timeo *next; + u32_t time; + sys_timeout_handler h; + void *arg; +#if LWIP_DEBUG_TIMERNAMES + const char* handler_name; +#endif /* LWIP_DEBUG_TIMERNAMES */ +}; + +void sys_timeouts_init(void); + +#if LWIP_DEBUG_TIMERNAMES +void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); +#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) +#else /* LWIP_DEBUG_TIMERNAMES */ +void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); +#endif /* LWIP_DEBUG_TIMERNAMES */ + +void sys_untimeout(sys_timeout_handler handler, void *arg); +void sys_restart_timeouts(void); +#if NO_SYS +void sys_check_timeouts(void); +u32_t sys_timeouts_sleeptime(void); +#else /* NO_SYS */ +void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); +#endif /* NO_SYS */ + + +#endif /* LWIP_TIMERS */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_TIMEOUTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/udp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/udp.h new file mode 100644 index 0000000..b929907 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/lwip/udp.h @@ -0,0 +1,182 @@ +/** + * @file + * UDP API (to be used from TCPIP thread)\n + * See also @ref udp_raw + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_UDP_H +#define LWIP_HDR_UDP_H + +#include "lwip/opt.h" + +#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/ip_addr.h" +#include "lwip/ip.h" +#include "lwip/ip6_addr.h" +#include "lwip/prot/udp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define UDP_FLAGS_NOCHKSUM 0x01U +#define UDP_FLAGS_UDPLITE 0x02U +#define UDP_FLAGS_CONNECTED 0x04U +#define UDP_FLAGS_MULTICAST_LOOP 0x08U + +struct udp_pcb; + +/** Function prototype for udp pcb receive callback functions + * addr and port are in same byte order as in the pcb + * The callback is responsible for freeing the pbuf + * if it's not used any more. + * + * ATTENTION: Be aware that 'addr' might point into the pbuf 'p' so freeing this pbuf + * can make 'addr' invalid, too. + * + * @param arg user supplied argument (udp_pcb.recv_arg) + * @param pcb the udp_pcb which received data + * @param p the packet buffer that was received + * @param addr the remote IP address from which the packet was received + * @param port the remote port from which the packet was received + */ +typedef void (*udp_recv_fn)(void *arg, struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *addr, u16_t port); + +/** the UDP protocol control block */ +struct udp_pcb { +/** Common members of all PCB types */ + IP_PCB; + +/* Protocol specific PCB members */ + + struct udp_pcb *next; + + u8_t flags; + /** ports are in host byte order */ + u16_t local_port, remote_port; + +#if LWIP_MULTICAST_TX_OPTIONS + /** outgoing network interface for multicast packets */ + ip_addr_t multicast_ip; + /** TTL for outgoing multicast packets */ + u8_t mcast_ttl; +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + +#if LWIP_UDPLITE + /** used for UDP_LITE only */ + u16_t chksum_len_rx, chksum_len_tx; +#endif /* LWIP_UDPLITE */ + + /** receive callback function */ + udp_recv_fn recv; + /** user-supplied argument for the recv callback */ + void *recv_arg; +}; +/* udp_pcbs export for external reference (e.g. SNMP agent) */ +extern struct udp_pcb *udp_pcbs; + +/* The following functions is the application layer interface to the + UDP code. */ +struct udp_pcb * udp_new (void); +struct udp_pcb * udp_new_ip_type(u8_t type); +void udp_remove (struct udp_pcb *pcb); +err_t udp_bind (struct udp_pcb *pcb, const ip_addr_t *ipaddr, + u16_t port); +err_t udp_connect (struct udp_pcb *pcb, const ip_addr_t *ipaddr, + u16_t port); +void udp_disconnect (struct udp_pcb *pcb); +void udp_recv (struct udp_pcb *pcb, udp_recv_fn recv, + void *recv_arg); +err_t udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, + struct netif *netif); +err_t udp_sendto_if_src(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, + struct netif *netif, const ip_addr_t *src_ip); +err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port); +err_t udp_send (struct udp_pcb *pcb, struct pbuf *p); + +#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP +err_t udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, + struct netif *netif, u8_t have_chksum, + u16_t chksum); +err_t udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, + u8_t have_chksum, u16_t chksum); +err_t udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, + u8_t have_chksum, u16_t chksum); +err_t udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, + const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif, + u8_t have_chksum, u16_t chksum, const ip_addr_t *src_ip); +#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */ + +#define udp_flags(pcb) ((pcb)->flags) +#define udp_setflags(pcb, f) ((pcb)->flags = (f)) + +/* The following functions are the lower layer interface to UDP. */ +void udp_input (struct pbuf *p, struct netif *inp); + +void udp_init (void); + +/* for compatibility with older implementation */ +#define udp_new_ip6() udp_new_ip_type(IPADDR_TYPE_V6) + +#if LWIP_MULTICAST_TX_OPTIONS +#define udp_set_multicast_netif_addr(pcb, ip4addr) ip_addr_copy_from_ip4((pcb)->multicast_ip, *(ip4addr)) +#define udp_get_multicast_netif_addr(pcb) ip_2_ip4(&(pcb)->multicast_ip) +#define udp_set_multicast_ttl(pcb, value) do { (pcb)->mcast_ttl = value; } while(0) +#define udp_get_multicast_ttl(pcb) ((pcb)->mcast_ttl) +#endif /* LWIP_MULTICAST_TX_OPTIONS */ + +#if UDP_DEBUG +void udp_debug_print(struct udp_hdr *udphdr); +#else +#define udp_debug_print(udphdr) +#endif + +void udp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_UDP */ + +#endif /* LWIP_HDR_UDP_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/etharp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/etharp.h new file mode 100644 index 0000000..b536fd2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/etharp.h @@ -0,0 +1,3 @@ +/* ARP has been moved to core/ipv4, provide this #include for compatibility only */ +#include "lwip/etharp.h" +#include "netif/ethernet.h" diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ethernet.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ethernet.h new file mode 100644 index 0000000..49649cb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ethernet.h @@ -0,0 +1,77 @@ +/** + * @file + * Ethernet input function - handles INCOMING ethernet level traffic + * To be used in most low-level netif implementations + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2003-2004 Leon Woestenberg + * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +#ifndef LWIP_HDR_NETIF_ETHERNET_H +#define LWIP_HDR_NETIF_ETHERNET_H + +#include "lwip/opt.h" + +#include "lwip/pbuf.h" +#include "lwip/netif.h" +#include "lwip/prot/ethernet.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if LWIP_ARP || LWIP_ETHERNET + +/** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type) + * to a filter function that returns the correct netif when using multiple + * netifs on one hardware interface where the netif's low-level receive + * routine cannot decide for the correct netif (e.g. when mapping multiple + * IP addresses to one hardware interface). + */ +#ifndef LWIP_ARP_FILTER_NETIF +#define LWIP_ARP_FILTER_NETIF 0 +#endif + +err_t ethernet_input(struct pbuf *p, struct netif *netif); +err_t ethernet_output(struct netif* netif, struct pbuf* p, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type); + +extern const struct eth_addr ethbroadcast, ethzero; + +#endif /* LWIP_ARP || LWIP_ETHERNET */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_NETIF_ETHERNET_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6.h new file mode 100644 index 0000000..4174644 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6.h @@ -0,0 +1,86 @@ +/** + * @file + * + * 6LowPAN output for IPv6. Uses ND tables for link-layer addressing. Fragments packets to 6LowPAN units. + */ + +/* + * Copyright (c) 2015 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_LOWPAN6_H +#define LWIP_HDR_LOWPAN6_H + +#include "netif/lowpan6_opts.h" + +#if LWIP_IPV6 && LWIP_6LOWPAN /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/ip.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** 1 second period */ +#define LOWPAN6_TMR_INTERVAL 1000 + +void lowpan6_tmr(void); + +err_t lowpan6_set_context(u8_t index, const ip6_addr_t * context); +err_t lowpan6_set_short_addr(u8_t addr_high, u8_t addr_low); + +#if LWIP_IPV4 +err_t lowpan4_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr); +#endif /* LWIP_IPV4 */ +err_t lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); +err_t lowpan6_input(struct pbuf * p, struct netif *netif); +err_t lowpan6_if_init(struct netif *netif); + +/* pan_id in network byte order. */ +err_t lowpan6_set_pan_id(u16_t pan_id); + +#if !NO_SYS +err_t tcpip_6lowpan_input(struct pbuf *p, struct netif *inp); +#endif /* !NO_SYS */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_IPV6 && LWIP_6LOWPAN */ + +#endif /* LWIP_HDR_LOWPAN6_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6_opts.h new file mode 100644 index 0000000..fb93ea0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/lowpan6_opts.h @@ -0,0 +1,70 @@ +/** + * @file + * 6LowPAN options list + */ + +/* + * Copyright (c) 2015 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +#ifndef LWIP_HDR_LOWPAN6_OPTS_H +#define LWIP_HDR_LOWPAN6_OPTS_H + +#include "lwip/opt.h" + +#ifndef LWIP_6LOWPAN +#define LWIP_6LOWPAN 0 +#endif + +#ifndef LWIP_6LOWPAN_NUM_CONTEXTS +#define LWIP_6LOWPAN_NUM_CONTEXTS 10 +#endif + +#ifndef LWIP_6LOWPAN_INFER_SHORT_ADDRESS +#define LWIP_6LOWPAN_INFER_SHORT_ADDRESS 1 +#endif + +#ifndef LWIP_6LOWPAN_IPHC +#define LWIP_6LOWPAN_IPHC 1 +#endif + +#ifndef LWIP_6LOWPAN_HW_CRC +#define LWIP_6LOWPAN_HW_CRC 1 +#endif + +#ifndef LOWPAN6_DEBUG +#define LOWPAN6_DEBUG LWIP_DBG_OFF +#endif + +#endif /* LWIP_HDR_LOWPAN6_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ccp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ccp.h new file mode 100644 index 0000000..14dd659 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ccp.h @@ -0,0 +1,156 @@ +/* + * ccp.h - Definitions for PPP Compression Control Protocol. + * + * Copyright (c) 1994-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CCP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef CCP_H +#define CCP_H + +/* + * CCP codes. + */ + +#define CCP_CONFREQ 1 +#define CCP_CONFACK 2 +#define CCP_TERMREQ 5 +#define CCP_TERMACK 6 +#define CCP_RESETREQ 14 +#define CCP_RESETACK 15 + +/* + * Max # bytes for a CCP option + */ + +#define CCP_MAX_OPTION_LENGTH 32 + +/* + * Parts of a CCP packet. + */ + +#define CCP_CODE(dp) ((dp)[0]) +#define CCP_ID(dp) ((dp)[1]) +#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) +#define CCP_HDRLEN 4 + +#define CCP_OPT_CODE(dp) ((dp)[0]) +#define CCP_OPT_LENGTH(dp) ((dp)[1]) +#define CCP_OPT_MINLEN 2 + +#if BSDCOMPRESS_SUPPORT +/* + * Definitions for BSD-Compress. + */ + +#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ +#define CILEN_BSD_COMPRESS 3 /* length of config. option */ + +/* Macros for handling the 3rd byte of the BSD-Compress config option. */ +#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ +#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ +#define BSD_CURRENT_VERSION 1 /* current version number */ +#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) + +#define BSD_MIN_BITS 9 /* smallest code size supported */ +#define BSD_MAX_BITS 15 /* largest code size supported */ +#endif /* BSDCOMPRESS_SUPPORT */ + +#if DEFLATE_SUPPORT +/* + * Definitions for Deflate. + */ + +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ +#define CILEN_DEFLATE 4 /* length of its config option */ + +#define DEFLATE_MIN_SIZE 9 +#define DEFLATE_MAX_SIZE 15 +#define DEFLATE_METHOD_VAL 8 +#define DEFLATE_SIZE(x) (((x) >> 4) + 8) +#define DEFLATE_METHOD(x) ((x) & 0x0F) +#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) +#define DEFLATE_CHK_SEQUENCE 0 +#endif /* DEFLATE_SUPPORT */ + +#if MPPE_SUPPORT +/* + * Definitions for MPPE. + */ + +#define CI_MPPE 18 /* config option for MPPE */ +#define CILEN_MPPE 6 /* length of config option */ +#endif /* MPPE_SUPPORT */ + +#if PREDICTOR_SUPPORT +/* + * Definitions for other, as yet unsupported, compression methods. + */ + +#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ +#define CILEN_PREDICTOR_1 2 /* length of its config option */ +#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ +#define CILEN_PREDICTOR_2 2 /* length of its config option */ +#endif /* PREDICTOR_SUPPORT */ + +typedef struct ccp_options { +#if DEFLATE_SUPPORT + unsigned int deflate :1; /* do Deflate? */ + unsigned int deflate_correct :1; /* use correct code for deflate? */ + unsigned int deflate_draft :1; /* use draft RFC code for deflate? */ +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + unsigned int bsd_compress :1; /* do BSD Compress? */ +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + unsigned int predictor_1 :1; /* do Predictor-1? */ + unsigned int predictor_2 :1; /* do Predictor-2? */ +#endif /* PREDICTOR_SUPPORT */ + +#if MPPE_SUPPORT + u8_t mppe; /* MPPE bitfield */ +#endif /* MPPE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + u_short bsd_bits; /* # bits/code for BSD Compress */ +#endif /* BSDCOMPRESS_SUPPORT */ +#if DEFLATE_SUPPORT + u_short deflate_size; /* lg(window size) for Deflate */ +#endif /* DEFLATE_SUPPORT */ + u8_t method; /* code for chosen compression method */ +} ccp_options; + +extern const struct protent ccp_protent; + +void ccp_resetrequest(ppp_pcb *pcb); /* Issue a reset-request. */ + +#endif /* CCP_H */ +#endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-md5.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-md5.h new file mode 100644 index 0000000..eb0269f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-md5.h @@ -0,0 +1,36 @@ +/* + * chap-md5.h - New CHAP/MD5 implementation. + * + * Copyright (c) 2003 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +extern const struct chap_digest_type md5_digest; + +#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-new.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-new.h new file mode 100644 index 0000000..64eae32 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap-new.h @@ -0,0 +1,192 @@ +/* + * chap-new.c - New CHAP implementation. + * + * Copyright (c) 2003 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef CHAP_H +#define CHAP_H + +#include "ppp.h" + +/* + * CHAP packets begin with a standard header with code, id, len (2 bytes). + */ +#define CHAP_HDRLEN 4 + +/* + * Values for the code field. + */ +#define CHAP_CHALLENGE 1 +#define CHAP_RESPONSE 2 +#define CHAP_SUCCESS 3 +#define CHAP_FAILURE 4 + +/* + * CHAP digest codes. + */ +#define CHAP_MD5 5 +#if MSCHAP_SUPPORT +#define CHAP_MICROSOFT 0x80 +#define CHAP_MICROSOFT_V2 0x81 +#endif /* MSCHAP_SUPPORT */ + +/* + * Semi-arbitrary limits on challenge and response fields. + */ +#define MAX_CHALLENGE_LEN 64 +#define MAX_RESPONSE_LEN 64 + +/* + * These limits apply to challenge and response packets we send. + * The +4 is the +1 that we actually need rounded up. + */ +#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) +#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) + +/* bitmask of supported algorithms */ +#if MSCHAP_SUPPORT +#define MDTYPE_MICROSOFT_V2 0x1 +#define MDTYPE_MICROSOFT 0x2 +#endif /* MSCHAP_SUPPORT */ +#define MDTYPE_MD5 0x4 +#define MDTYPE_NONE 0 + +#if MSCHAP_SUPPORT +/* Return the digest alg. ID for the most preferred digest type. */ +#define CHAP_DIGEST(mdtype) \ + ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \ + ((mdtype) & MDTYPE_MICROSOFT_V2)? CHAP_MICROSOFT_V2: \ + ((mdtype) & MDTYPE_MICROSOFT)? CHAP_MICROSOFT: \ + 0 +#else /* !MSCHAP_SUPPORT */ +#define CHAP_DIGEST(mdtype) \ + ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \ + 0 +#endif /* MSCHAP_SUPPORT */ + +/* Return the bit flag (lsb set) for our most preferred digest type. */ +#define CHAP_MDTYPE(mdtype) ((mdtype) ^ ((mdtype) - 1)) & (mdtype) + +/* Return the bit flag for a given digest algorithm ID. */ +#if MSCHAP_SUPPORT +#define CHAP_MDTYPE_D(digest) \ + ((digest) == CHAP_MICROSOFT_V2)? MDTYPE_MICROSOFT_V2: \ + ((digest) == CHAP_MICROSOFT)? MDTYPE_MICROSOFT: \ + ((digest) == CHAP_MD5)? MDTYPE_MD5: \ + 0 +#else /* !MSCHAP_SUPPORT */ +#define CHAP_MDTYPE_D(digest) \ + ((digest) == CHAP_MD5)? MDTYPE_MD5: \ + 0 +#endif /* MSCHAP_SUPPORT */ + +/* Can we do the requested digest? */ +#if MSCHAP_SUPPORT +#define CHAP_CANDIGEST(mdtype, digest) \ + ((digest) == CHAP_MICROSOFT_V2)? (mdtype) & MDTYPE_MICROSOFT_V2: \ + ((digest) == CHAP_MICROSOFT)? (mdtype) & MDTYPE_MICROSOFT: \ + ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \ + 0 +#else /* !MSCHAP_SUPPORT */ +#define CHAP_CANDIGEST(mdtype, digest) \ + ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \ + 0 +#endif /* MSCHAP_SUPPORT */ + +/* + * The code for each digest type has to supply one of these. + */ +struct chap_digest_type { + int code; + +#if PPP_SERVER + /* + * Note: challenge and response arguments below are formatted as + * a length byte followed by the actual challenge/response data. + */ + void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); + int (*verify_response)(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); +#endif /* PPP_SERVER */ + void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *priv); + int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); + void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); +}; + +/* + * Each interface is described by chap structure. + */ +#if CHAP_SUPPORT +typedef struct chap_client_state { + u8_t flags; + const char *name; + const struct chap_digest_type *digest; + unsigned char priv[64]; /* private area for digest's use */ +} chap_client_state; + +#if PPP_SERVER +typedef struct chap_server_state { + u8_t flags; + u8_t id; + const char *name; + const struct chap_digest_type *digest; + int challenge_xmits; + int challenge_pktlen; + unsigned char challenge[CHAL_MAX_PKTLEN]; +} chap_server_state; +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPORT */ + +#if 0 /* UNUSED */ +/* Hook for a plugin to validate CHAP challenge */ +extern int (*chap_verify_hook)(char *name, char *ourname, int id, + const struct chap_digest_type *digest, + unsigned char *challenge, unsigned char *response, + char *message, int message_space); +#endif /* UNUSED */ + +#if PPP_SERVER +/* Called by authentication code to start authenticating the peer. */ +extern void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code); +#endif /* PPP_SERVER */ + +/* Called by auth. code to start authenticating us to the peer. */ +extern void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code); + +/* Represents the CHAP protocol to the main pppd code */ +extern const struct protent chap_protent; + +#endif /* CHAP_H */ +#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap_ms.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap_ms.h new file mode 100644 index 0000000..0795291 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/chap_ms.h @@ -0,0 +1,44 @@ +/* + * chap_ms.h - Challenge Handshake Authentication Protocol definitions. + * + * Copyright (c) 1995 Eric Rosenquist. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: chap_ms.h,v 1.13 2004/11/15 22:13:26 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef CHAPMS_INCLUDE +#define CHAPMS_INCLUDE + +extern const struct chap_digest_type chapms_digest; +extern const struct chap_digest_type chapms2_digest; + +#endif /* CHAPMS_INCLUDE */ + +#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eap.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eap.h new file mode 100644 index 0000000..3ee9aaf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eap.h @@ -0,0 +1,169 @@ +/* + * eap.h - Extensible Authentication Protocol for PPP (RFC 2284) + * + * Copyright (c) 2001 by Sun Microsystems, Inc. + * All rights reserved. + * + * Non-exclusive rights to redistribute, modify, translate, and use + * this software in source and binary forms, in whole or in part, is + * hereby granted, provided that the above copyright notice is + * duplicated in any source form, and that neither the name of the + * copyright holder nor the author is used to endorse or promote + * products derived from this software. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Original version by James Carlson + * + * $Id: eap.h,v 1.2 2003/06/11 23:56:26 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPP_EAP_H +#define PPP_EAP_H + +#include "ppp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Packet header = Code, id, length. + */ +#define EAP_HEADERLEN 4 + + +/* EAP message codes. */ +#define EAP_REQUEST 1 +#define EAP_RESPONSE 2 +#define EAP_SUCCESS 3 +#define EAP_FAILURE 4 + +/* EAP types */ +#define EAPT_IDENTITY 1 +#define EAPT_NOTIFICATION 2 +#define EAPT_NAK 3 /* (response only) */ +#define EAPT_MD5CHAP 4 +#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ +#define EAPT_TOKEN 6 /* Generic Token Card */ +/* 7 and 8 are unassigned. */ +#define EAPT_RSA 9 /* RSA Public Key Authentication */ +#define EAPT_DSS 10 /* DSS Unilateral */ +#define EAPT_KEA 11 /* KEA */ +#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ +#define EAPT_TLS 13 /* EAP-TLS */ +#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ +#define EAPT_W2K 15 /* Windows 2000 EAP */ +#define EAPT_ARCOT 16 /* Arcot Systems */ +#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ +#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ +#define EAPT_SRP 19 /* Secure Remote Password */ +/* 20 is deprecated */ + +/* EAP SRP-SHA1 Subtypes */ +#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ +#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ +#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ +#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ +#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ +#define EAPSRP_ACK 3 /* Response 3 - final ack */ +#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ + +#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ + +#define SRP_PSEUDO_ID "pseudo_" +#define SRP_PSEUDO_LEN 7 + +#define MD5_SIGNATURE_SIZE 16 +#define EAP_MIN_CHALLENGE_LENGTH 17 +#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ + +#define EAP_STATES \ + "Initial", "Pending", "Closed", "Listen", "Identify", \ + "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" + +#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) +#if PPP_SERVER +#define eap_server_active(pcb) \ + ((pcb)->eap.es_server.ea_state >= eapIdentify && \ + (pcb)->eap.es_server.ea_state <= eapMD5Chall) +#endif /* PPP_SERVER */ + +/* + * Complete EAP state for one PPP session. + */ +enum eap_state_code { + eapInitial = 0, /* No EAP authentication yet requested */ + eapPending, /* Waiting for LCP (no timer) */ + eapClosed, /* Authentication not in use */ + eapListen, /* Client ready (and timer running) */ + eapIdentify, /* EAP Identify sent */ + eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ + eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ + eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ + eapMD5Chall, /* Sent MD5-Challenge */ + eapOpen, /* Completed authentication */ + eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ + eapBadAuth /* Failed authentication */ +}; + +struct eap_auth { + const char *ea_name; /* Our name */ + char ea_peer[MAXNAMELEN +1]; /* Peer's name */ + void *ea_session; /* Authentication library linkage */ + u_char *ea_skey; /* Shared encryption key */ + u_short ea_namelen; /* Length of our name */ + u_short ea_peerlen; /* Length of peer's name */ + enum eap_state_code ea_state; + u_char ea_id; /* Current id */ + u_char ea_requests; /* Number of Requests sent/received */ + u_char ea_responses; /* Number of Responses */ + u_char ea_type; /* One of EAPT_* */ + u32_t ea_keyflags; /* SRP shared key usage flags */ +}; + +#ifndef EAP_MAX_CHALLENGE_LENGTH +#define EAP_MAX_CHALLENGE_LENGTH 24 +#endif +typedef struct eap_state { + struct eap_auth es_client; /* Client (authenticatee) data */ +#if PPP_SERVER + struct eap_auth es_server; /* Server (authenticator) data */ +#endif /* PPP_SERVER */ + int es_savedtime; /* Saved timeout */ + int es_rechallenge; /* EAP rechallenge interval */ + int es_lwrechallenge; /* SRP lightweight rechallenge inter */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ + int es_usedpseudo; /* Set if we already sent PN */ + int es_challen; /* Length of challenge string */ + u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; +} eap_state; + +/* + * Timeouts. + */ +#if 0 /* moved to ppp_opts.h */ +#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ +#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ +#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ +#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ +#endif /* moved to ppp_opts.h */ + +void eap_authwithpeer(ppp_pcb *pcb, const char *localname); +void eap_authpeer(ppp_pcb *pcb, const char *localname); + +extern const struct protent eap_protent; + +#ifdef __cplusplus +} +#endif + +#endif /* PPP_EAP_H */ + +#endif /* PPP_SUPPORT && EAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ecp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ecp.h new file mode 100644 index 0000000..5cdce29 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ecp.h @@ -0,0 +1,50 @@ +/* + * ecp.h - Definitions for PPP Encryption Control Protocol. + * + * Copyright (c) 2002 Google, Inc. + * 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +typedef struct ecp_options { + bool required; /* Is ECP required? */ + unsigned enctype; /* Encryption type */ +} ecp_options; + +extern fsm ecp_fsm[]; +extern ecp_options ecp_wantoptions[]; +extern ecp_options ecp_gotoptions[]; +extern ecp_options ecp_allowoptions[]; +extern ecp_options ecp_hisoptions[]; + +extern const struct protent ecp_protent; + +#endif /* PPP_SUPPORT && ECP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eui64.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eui64.h new file mode 100644 index 0000000..20ac22e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/eui64.h @@ -0,0 +1,94 @@ +/* + * eui64.h - EUI64 routines for IPv6CP. + * + * Copyright (c) 1999 Tommi Komulainen. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Tommi Komulainen + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: eui64.h,v 1.6 2002/12/04 23:03:32 paulus Exp $ +*/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef EUI64_H +#define EUI64_H + +/* + * @todo: + * + * Maybe this should be done by processing struct in6_addr directly... + */ +typedef union +{ + u8_t e8[8]; + u16_t e16[4]; + u32_t e32[2]; +} eui64_t; + +#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) +#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ + ((e).e32[1] == (o).e32[1])) +#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; + +#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) + +#define eui64_magic(e) do { \ + (e).e32[0] = magic(); \ + (e).e32[1] = magic(); \ + (e).e8[0] &= ~2; \ + } while (0) +#define eui64_magic_nz(x) do { \ + eui64_magic(x); \ + } while (eui64_iszero(x)) +#define eui64_magic_ne(x, y) do { \ + eui64_magic(x); \ + } while (eui64_equals(x, y)) + +#define eui64_get(ll, cp) do { \ + eui64_copy((*cp), (ll)); \ + (cp) += sizeof(eui64_t); \ + } while (0) + +#define eui64_put(ll, cp) do { \ + eui64_copy((ll), (*cp)); \ + (cp) += sizeof(eui64_t); \ + } while (0) + +#define eui64_set32(e, l) do { \ + (e).e32[0] = 0; \ + (e).e32[1] = lwip_htonl(l); \ + } while (0) +#define eui64_setlo32(e, l) eui64_set32(e, l) + +char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ + +#endif /* EUI64_H */ +#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/fsm.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/fsm.h new file mode 100644 index 0000000..b6915d3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/fsm.h @@ -0,0 +1,175 @@ +/* + * fsm.h - {Link, IP} Control Protocol Finite State Machine definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef FSM_H +#define FSM_H + +#include "ppp.h" + +/* + * Packet header = Code, id, length. + */ +#define HEADERLEN 4 + + +/* + * CP (LCP, IPCP, etc.) codes. + */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ + + +/* + * Each FSM is described by an fsm structure and fsm callbacks. + */ +typedef struct fsm { + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ +} fsm; + + +typedef struct fsm_callbacks { + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ +} fsm_callbacks; + + +/* + * Link states. + */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ + + +/* + * Flags - indicate options controlling FSM operation + */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ + + +/* + * Timeouts. + */ +#if 0 /* moved to ppp_opts.h */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#endif /* moved to ppp_opts.h */ + + +/* + * Prototypes + */ +void fsm_init(fsm *f); +void fsm_lowerup(fsm *f); +void fsm_lowerdown(fsm *f); +void fsm_open(fsm *f); +void fsm_close(fsm *f, const char *reason); +void fsm_input(fsm *f, u_char *inpacket, int l); +void fsm_protreject(fsm *f); +void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen); + + +#endif /* FSM_H */ +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipcp.h new file mode 100644 index 0000000..45f46b3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipcp.h @@ -0,0 +1,126 @@ +/* + * ipcp.h - IP Control Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef IPCP_H +#define IPCP_H + +/* + * Options. + */ +#define CI_ADDRS 1 /* IP Addresses */ +#if VJ_SUPPORT +#define CI_COMPRESSTYPE 2 /* Compression Type */ +#endif /* VJ_SUPPORT */ +#define CI_ADDR 3 + +#if LWIP_DNS +#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS2 131 /* Secondary DNS value */ +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ +#define CI_MS_WINS1 130 /* Primary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ +#endif /* UNUSED - WINS */ + +#if VJ_SUPPORT +#define MAX_STATES 16 /* from slcompress.h */ + +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ + /* maxslot and slot number compression) */ + +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ +#endif /* VJ_SUPPORT */ + +typedef struct ipcp_options { + unsigned int neg_addr :1; /* Negotiate IP Address? */ + unsigned int old_addrs :1; /* Use old (IP-Addresses) option? */ + unsigned int req_addr :1; /* Ask peer to send IP address? */ +#if 0 /* UNUSED */ + unsigned int default_route :1; /* Assign default route through interface? */ + unsigned int replace_default_route :1; /* Replace default route through interface? */ +#endif /* UNUSED */ +#if 0 /* UNUSED - PROXY ARP */ + unsigned int proxy_arp :1; /* Make proxy ARP entry for peer? */ +#endif /* UNUSED - PROXY ARP */ +#if VJ_SUPPORT + unsigned int neg_vj :1; /* Van Jacobson Compression? */ + unsigned int old_vj :1; /* use old (short) form of VJ option? */ + unsigned int cflag :1; +#endif /* VJ_SUPPORT */ + unsigned int accept_local :1; /* accept peer's value for ouraddr */ + unsigned int accept_remote :1; /* accept peer's value for hisaddr */ +#if LWIP_DNS + unsigned int req_dns1 :1; /* Ask peer to send primary DNS address? */ + unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ +#endif /* LWIP_DNS */ + + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ +#if LWIP_DNS + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ +#endif /* UNUSED - WINS */ + +#if VJ_SUPPORT + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ +#endif /* VJ_SUPPORT */ +} ipcp_options; + +#if 0 /* UNUSED, already defined by lwIP */ +char *ip_ntoa (u32_t); +#endif /* UNUSED, already defined by lwIP */ + +extern const struct protent ipcp_protent; + +#endif /* IPCP_H */ +#endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h new file mode 100644 index 0000000..07d1ae3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h @@ -0,0 +1,183 @@ +/* + * ipv6cp.h - PPP IPV6 Control Protocol. + * + * Copyright (c) 1999 Tommi Komulainen. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Tommi Komulainen + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* Original version, based on RFC2023 : + + Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt, + Alain.Durand@imag.fr, IMAG, + Jean-Luc.Richier@imag.fr, IMAG-LSR. + + Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE, + Alain.Durand@imag.fr, IMAG, + Jean-Luc.Richier@imag.fr, IMAG-LSR. + + Ce travail a été fait au sein du GIE DYADE (Groupement d'Intérêt + Économique ayant pour membres BULL S.A. et l'INRIA). + + Ce logiciel informatique est disponible aux conditions + usuelles dans la recherche, c'est-à-dire qu'il peut + être utilisé, copié, modifié, distribué à l'unique + condition que ce texte soit conservé afin que + l'origine de ce logiciel soit reconnue. + + Le nom de l'Institut National de Recherche en Informatique + et en Automatique (INRIA), de l'IMAG, ou d'une personne morale + ou physique ayant participé à l'élaboration de ce logiciel ne peut + être utilisé sans son accord préalable explicite. + + Ce logiciel est fourni tel quel sans aucune garantie, + support ou responsabilité d'aucune sorte. + Ce logiciel est dérivé de sources d'origine + "University of California at Berkeley" et + "Digital Equipment Corporation" couvertes par des copyrights. + + L'Institut d'Informatique et de Mathématiques Appliquées de Grenoble (IMAG) + est une fédération d'unités mixtes de recherche du CNRS, de l'Institut National + Polytechnique de Grenoble et de l'Université Joseph Fourier regroupant + sept laboratoires dont le laboratoire Logiciels, Systèmes, Réseaux (LSR). + + This work has been done in the context of GIE DYADE (joint R & D venture + between BULL S.A. and INRIA). + + This software is available with usual "research" terms + with the aim of retain credits of the software. + Permission to use, copy, modify and distribute this software for any + purpose and without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies, + and the name of INRIA, IMAG, or any contributor not be used in advertising + or publicity pertaining to this material without the prior explicit + permission. The software is provided "as is" without any + warranties, support or liabilities of any kind. + This software is derived from source code from + "University of California at Berkeley" and + "Digital Equipment Corporation" protected by copyrights. + + Grenoble's Institute of Computer Science and Applied Mathematics (IMAG) + is a federation of seven research units funded by the CNRS, National + Polytechnic Institute of Grenoble and University Joseph Fourier. + The research unit in Software, Systems, Networks (LSR) is member of IMAG. +*/ + +/* + * Derived from : + * + * + * ipcp.h - IP Control Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ipv6cp.h,v 1.7 2002/12/04 23:03:32 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef IPV6CP_H +#define IPV6CP_H + +#include "eui64.h" + +/* + * Options. + */ +#define CI_IFACEID 1 /* Interface Identifier */ +#ifdef IPV6CP_COMP +#define CI_COMPRESSTYPE 2 /* Compression Type */ +#endif /* IPV6CP_COMP */ + +/* No compression types yet defined. + *#define IPV6CP_COMP 0x004f + */ +typedef struct ipv6cp_options { + unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ + unsigned int req_ifaceid :1; /* Ask peer to send interface identifier? */ + unsigned int accept_local :1; /* accept peer's value for iface id? */ + unsigned int opt_local :1; /* ourtoken set by option */ + unsigned int opt_remote :1; /* histoken set by option */ + unsigned int use_ip :1; /* use IP as interface identifier */ +#if 0 + unsigned int use_persistent :1; /* use uniquely persistent value for address */ +#endif +#ifdef IPV6CP_COMP + unsigned int neg_vj :1; /* Van Jacobson Compression? */ +#endif /* IPV6CP_COMP */ + +#ifdef IPV6CP_COMP + u_short vj_protocol; /* protocol value to use in VJ option */ +#endif /* IPV6CP_COMP */ + eui64_t ourid, hisid; /* Interface identifiers */ +} ipv6cp_options; + +extern const struct protent ipv6cp_protent; + +#endif /* IPV6CP_H */ +#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/lcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/lcp.h new file mode 100644 index 0000000..12e2a05 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/lcp.h @@ -0,0 +1,171 @@ +/* + * lcp.h - Link Control Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: lcp.h,v 1.20 2004/11/14 22:53:42 carlsonj Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef LCP_H +#define LCP_H + +#include "ppp.h" + +/* + * Options. + */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ + +/* + * LCP-specific packet types (code numbers). + */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ + +/* Value used as data for CI_CALLBACK option */ +#define CBCP_OPT 6 /* Use callback control protocol */ + +#if 0 /* moved to ppp_opts.h */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ +#endif /* moved to ppp_opts.h */ + +/* An endpoint discriminator, used with multilink. */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +struct epdisc { + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; +}; + +/* + * The state of options is described by an lcp_options structure. + */ +typedef struct lcp_options { + unsigned int passive :1; /* Don't die if we don't get a response */ + unsigned int silent :1; /* Wait for the other end to start first */ +#if 0 /* UNUSED */ + unsigned int restart :1; /* Restart vs. exit after close */ +#endif /* UNUSED */ + unsigned int neg_mru :1; /* Negotiate the MRU? */ + unsigned int neg_asyncmap :1; /* Negotiate the async map? */ +#if PAP_SUPPORT + unsigned int neg_upap :1; /* Ask for UPAP authentication? */ +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + unsigned int neg_chap :1; /* Ask for CHAP authentication? */ +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + unsigned int neg_eap :1; /* Ask for EAP authentication? */ +#endif /* EAP_SUPPORT */ + unsigned int neg_magicnumber :1; /* Ask for magic number? */ + unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */ + unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */ +#if LQR_SUPPORT + unsigned int neg_lqr :1; /* Negotiate use of Link Quality Reports */ +#endif /* LQR_SUPPORT */ + unsigned int neg_cbcp :1; /* Negotiate use of CBCP */ +#ifdef HAVE_MULTILINK + unsigned int neg_mrru :1; /* negotiate multilink MRRU */ +#endif /* HAVE_MULTILINK */ + unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ + unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ + + u16_t mru; /* Value of MRU */ +#ifdef HAVE_MULTILINK + u16_t mrru; /* Value of MRRU, and multilink enable */ +#endif /* MULTILINK */ +#if CHAP_SUPPORT + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ +#endif /* CHAP_SUPPORT */ + u32_t asyncmap; /* Value of async map */ + u32_t magicnumber; + u8_t numloops; /* Number of loops during magic number neg. */ +#if LQR_SUPPORT + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ +#endif /* LQR_SUPPORT */ + struct epdisc endpoint; /* endpoint discriminator */ +} lcp_options; + +void lcp_open(ppp_pcb *pcb); +void lcp_close(ppp_pcb *pcb, const char *reason); +void lcp_lowerup(ppp_pcb *pcb); +void lcp_lowerdown(ppp_pcb *pcb); +void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len); /* send protocol reject */ + +extern const struct protent lcp_protent; + +#if 0 /* moved to ppp_opts.h */ +/* Default number of times we receive our magic number from the peer + before deciding the link is looped-back. */ +#define DEFLOOPBACKFAIL 10 +#endif /* moved to ppp_opts.h */ + +#endif /* LCP_H */ +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/magic.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/magic.h new file mode 100644 index 0000000..a2a9b53 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/magic.h @@ -0,0 +1,122 @@ +/* + * magic.h - PPP Magic Number definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ + */ +/***************************************************************************** +* randm.h - Random number generator header file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* Copyright (c) 1998 Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 98-05-29 Guy Lancaster , Global Election Systems Inc. +* Extracted from avos. +*****************************************************************************/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef MAGIC_H +#define MAGIC_H + +/*********************** +*** PUBLIC FUNCTIONS *** +***********************/ + +/* + * Initialize the random number generator. + */ +void magic_init(void); + +/* + * Randomize our random seed value. To be called for truely random events + * such as user operations and network traffic. + */ +void magic_randomize(void); + +/* + * Return a new random number. + */ +u32_t magic(void); /* Returns the next magic number */ + +/* + * Fill buffer with random bytes + * + * Use the random pool to generate random data. This degrades to pseudo + * random when used faster than randomness is supplied using magic_churnrand(). + * Thus it's important to make sure that the results of this are not + * published directly because one could predict the next result to at + * least some degree. Also, it's important to get a good seed before + * the first use. + */ +void magic_random_bytes(unsigned char *buf, u32_t buf_len); + +/* + * Return a new random number between 0 and (2^pow)-1 included. + */ +u32_t magic_pow(u8_t pow); + +#endif /* MAGIC_H */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/mppe.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/mppe.h new file mode 100644 index 0000000..1ae8a5d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/mppe.h @@ -0,0 +1,173 @@ +/* + * mppe.h - Definitions for MPPE + * + * Copyright (c) 2008 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && MPPE_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef MPPE_H +#define MPPE_H + +#include "netif/ppp/pppcrypt.h" + +#define MPPE_PAD 4 /* MPPE growth per frame */ +#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ + +/* option bits for ccp_options.mppe */ +#define MPPE_OPT_40 0x01 /* 40 bit */ +#define MPPE_OPT_128 0x02 /* 128 bit */ +#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ +/* unsupported opts */ +#define MPPE_OPT_56 0x08 /* 56 bit */ +#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ +#define MPPE_OPT_D 0x20 /* Unknown */ +#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) +#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ + +/* + * This is not nice ... the alternative is a bitfield struct though. + * And unfortunately, we cannot share the same bits for the option + * names above since C and H are the same bit. We could do a u_int32 + * but then we have to do a lwip_htonl() all the time and/or we still need + * to know which octet is which. + */ +#define MPPE_C_BIT 0x01 /* MPPC */ +#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ +#define MPPE_L_BIT 0x20 /* 40-bit */ +#define MPPE_S_BIT 0x40 /* 128-bit */ +#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ +#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ + +/* Does not include H bit; used for least significant octet only. */ +#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) + +/* Build a CI from mppe opts (see RFC 3078) */ +#define MPPE_OPTS_TO_CI(opts, ci) \ + do { \ + u_char *ptr = ci; /* u_char[4] */ \ + \ + /* H bit */ \ + if (opts & MPPE_OPT_STATEFUL) \ + *ptr++ = 0x0; \ + else \ + *ptr++ = MPPE_H_BIT; \ + *ptr++ = 0; \ + *ptr++ = 0; \ + \ + /* S,L bits */ \ + *ptr = 0; \ + if (opts & MPPE_OPT_128) \ + *ptr |= MPPE_S_BIT; \ + if (opts & MPPE_OPT_40) \ + *ptr |= MPPE_L_BIT; \ + /* M,D,C bits not supported */ \ + } while (/* CONSTCOND */ 0) + +/* The reverse of the above */ +#define MPPE_CI_TO_OPTS(ci, opts) \ + do { \ + const u_char *ptr = ci; /* u_char[4] */ \ + \ + opts = 0; \ + \ + /* H bit */ \ + if (!(ptr[0] & MPPE_H_BIT)) \ + opts |= MPPE_OPT_STATEFUL; \ + \ + /* S,L bits */ \ + if (ptr[3] & MPPE_S_BIT) \ + opts |= MPPE_OPT_128; \ + if (ptr[3] & MPPE_L_BIT) \ + opts |= MPPE_OPT_40; \ + \ + /* M,D,C bits */ \ + if (ptr[3] & MPPE_M_BIT) \ + opts |= MPPE_OPT_56; \ + if (ptr[3] & MPPE_D_BIT) \ + opts |= MPPE_OPT_D; \ + if (ptr[3] & MPPE_C_BIT) \ + opts |= MPPE_OPT_MPPC; \ + \ + /* Other bits */ \ + if (ptr[0] & ~MPPE_H_BIT) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[1] || ptr[2]) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[3] & ~MPPE_ALL_BITS) \ + opts |= MPPE_OPT_UNKNOWN; \ + } while (/* CONSTCOND */ 0) + +/* Shared MPPE padding between MSCHAP and MPPE */ +#define SHA1_PAD_SIZE 40 + +static const u8_t mppe_sha1_pad1[SHA1_PAD_SIZE] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2 +}; + +/* + * State for an MPPE (de)compressor. + */ +typedef struct ppp_mppe_state { + lwip_arc4_context arc4; + u8_t master_key[MPPE_MAX_KEY_LEN]; + u8_t session_key[MPPE_MAX_KEY_LEN]; + u8_t keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! + * If we want to support 56-bit, the unit has to change to bits + */ + u8_t bits; /* MPPE control bits */ + u16_t ccount; /* 12-bit coherency count (seqno) */ + u16_t sanity_errors; /* take down LCP if too many */ + unsigned int stateful :1; /* stateful mode flag */ + unsigned int discard :1; /* stateful mode packet loss flag */ +} ppp_mppe_state; + +void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); +void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options); +void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state); +err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol); +void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state); +err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb); + +#endif /* MPPE_H */ +#endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h new file mode 100644 index 0000000..4af724c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h @@ -0,0 +1,81 @@ +/** + * \file arc4.h + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if LWIP_INCLUDED_POLARSSL_ARC4 + +#ifndef LWIP_INCLUDED_POLARSSL_ARC4_H +#define LWIP_INCLUDED_POLARSSL_ARC4_H + +/** + * \brief ARC4 context structure + */ +typedef struct +{ + int x; /*!< permutation index */ + int y; /*!< permutation index */ + unsigned char m[256]; /*!< permutation table */ +} +arc4_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief ARC4 key schedule + * + * \param ctx ARC4 context to be initialized + * \param key the secret key + * \param keylen length of the key + */ +void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ); + +/** + * \brief ARC4 cipher function + * + * \param ctx ARC4 context + * \param buf buffer to be processed + * \param buflen amount of data in buf + */ +void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_INCLUDED_POLARSSL_ARC4_H */ + +#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h new file mode 100644 index 0000000..e893890 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h @@ -0,0 +1,92 @@ +/** + * \file des.h + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if LWIP_INCLUDED_POLARSSL_DES + +#ifndef LWIP_INCLUDED_POLARSSL_DES_H +#define LWIP_INCLUDED_POLARSSL_DES_H + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +/** + * \brief DES context structure + */ +typedef struct +{ + int mode; /*!< encrypt/decrypt */ + unsigned long sk[32]; /*!< DES subkeys */ +} +des_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief DES key schedule (56-bit, encryption) + * + * \param ctx DES context to be initialized + * \param key 8-byte secret key + */ +void des_setkey_enc( des_context *ctx, unsigned char key[8] ); + +/** + * \brief DES key schedule (56-bit, decryption) + * + * \param ctx DES context to be initialized + * \param key 8-byte secret key + */ +void des_setkey_dec( des_context *ctx, unsigned char key[8] ); + +/** + * \brief DES-ECB block encryption/decryption + * + * \param ctx DES context + * \param input 64-bit input block + * \param output 64-bit output block + */ +void des_crypt_ecb( des_context *ctx, + const unsigned char input[8], + unsigned char output[8] ); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_INCLUDED_POLARSSL_DES_H */ + +#endif /* LWIP_INCLUDED_POLARSSL_DES */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h new file mode 100644 index 0000000..5704456 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h @@ -0,0 +1,97 @@ +/** + * \file md4.h + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if LWIP_INCLUDED_POLARSSL_MD4 + +#ifndef LWIP_INCLUDED_POLARSSL_MD4_H +#define LWIP_INCLUDED_POLARSSL_MD4_H + +/** + * \brief MD4 context structure + */ +typedef struct +{ + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} +md4_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief MD4 context setup + * + * \param ctx context to be initialized + */ +void md4_starts( md4_context *ctx ); + +/** + * \brief MD4 process buffer + * + * \param ctx MD4 context + * \param input buffer holding the data + * \param ilen length of the input data + */ +void md4_update( md4_context *ctx, const unsigned char *input, int ilen ); + +/** + * \brief MD4 final digest + * + * \param ctx MD4 context + * \param output MD4 checksum result + */ +void md4_finish( md4_context *ctx, unsigned char output[16] ); + +/** + * \brief Output = MD4( input buffer ) + * + * \param input buffer holding the data + * \param ilen length of the input data + * \param output MD4 checksum result + */ +void md4( unsigned char *input, int ilen, unsigned char output[16] ); + + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_INCLUDED_POLARSSL_MD4_H */ + +#endif /* LWIP_INCLUDED_POLARSSL_MD4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h new file mode 100644 index 0000000..1244011 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h @@ -0,0 +1,96 @@ +/** + * \file md5.h + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if LWIP_INCLUDED_POLARSSL_MD5 + +#ifndef LWIP_INCLUDED_POLARSSL_MD5_H +#define LWIP_INCLUDED_POLARSSL_MD5_H + +/** + * \brief MD5 context structure + */ +typedef struct +{ + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} +md5_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief MD5 context setup + * + * \param ctx context to be initialized + */ +void md5_starts( md5_context *ctx ); + +/** + * \brief MD5 process buffer + * + * \param ctx MD5 context + * \param input buffer holding the data + * \param ilen length of the input data + */ +void md5_update( md5_context *ctx, const unsigned char *input, int ilen ); + +/** + * \brief MD5 final digest + * + * \param ctx MD5 context + * \param output MD5 checksum result + */ +void md5_finish( md5_context *ctx, unsigned char output[16] ); + +/** + * \brief Output = MD5( input buffer ) + * + * \param input buffer holding the data + * \param ilen length of the input data + * \param output MD5 checksum result + */ +void md5( unsigned char *input, int ilen, unsigned char output[16] ); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_INCLUDED_POLARSSL_MD5_H */ + +#endif /* LWIP_INCLUDED_POLARSSL_MD5 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h new file mode 100644 index 0000000..a4c53e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h @@ -0,0 +1,96 @@ +/** + * \file sha1.h + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if LWIP_INCLUDED_POLARSSL_SHA1 + +#ifndef LWIP_INCLUDED_POLARSSL_SHA1_H +#define LWIP_INCLUDED_POLARSSL_SHA1_H + +/** + * \brief SHA-1 context structure + */ +typedef struct +{ + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[5]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} +sha1_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief SHA-1 context setup + * + * \param ctx context to be initialized + */ +void sha1_starts( sha1_context *ctx ); + +/** + * \brief SHA-1 process buffer + * + * \param ctx SHA-1 context + * \param input buffer holding the data + * \param ilen length of the input data + */ +void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen ); + +/** + * \brief SHA-1 final digest + * + * \param ctx SHA-1 context + * \param output SHA-1 checksum result + */ +void sha1_finish( sha1_context *ctx, unsigned char output[20] ); + +/** + * \brief Output = SHA-1( input buffer ) + * + * \param input buffer holding the data + * \param ilen length of the input data + * \param output SHA-1 checksum result + */ +void sha1( unsigned char *input, int ilen, unsigned char output[20] ); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_INCLUDED_POLARSSL_SHA1_H */ + +#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp.h new file mode 100644 index 0000000..d9ea097 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp.h @@ -0,0 +1,690 @@ +/***************************************************************************** +* ppp.h - Network Point to Point Protocol header file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* portions Copyright (c) 1997 Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 97-11-05 Guy Lancaster , Global Election Systems Inc. +* Original derived from BSD codes. +*****************************************************************************/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPP_H +#define PPP_H + +#include "lwip/def.h" +#include "lwip/stats.h" +#include "lwip/mem.h" +#include "lwip/netif.h" +#include "lwip/sys.h" +#include "lwip/timeouts.h" +#if PPP_IPV6_SUPPORT +#include "lwip/ip6_addr.h" +#endif /* PPP_IPV6_SUPPORT */ + +/* Disable non-working or rarely used PPP feature, so rarely that we don't want to bloat ppp_opts.h with them */ +#ifndef PPP_OPTIONS +#define PPP_OPTIONS 0 +#endif + +#ifndef PPP_NOTIFY +#define PPP_NOTIFY 0 +#endif + +#ifndef PPP_REMOTENAME +#define PPP_REMOTENAME 0 +#endif + +#ifndef PPP_IDLETIMELIMIT +#define PPP_IDLETIMELIMIT 0 +#endif + +#ifndef PPP_LCP_ADAPTIVE +#define PPP_LCP_ADAPTIVE 0 +#endif + +#ifndef PPP_MAXCONNECT +#define PPP_MAXCONNECT 0 +#endif + +#ifndef PPP_ALLOWED_ADDRS +#define PPP_ALLOWED_ADDRS 0 +#endif + +#ifndef PPP_PROTOCOLNAME +#define PPP_PROTOCOLNAME 0 +#endif + +#ifndef PPP_STATS_SUPPORT +#define PPP_STATS_SUPPORT 0 +#endif + +#ifndef DEFLATE_SUPPORT +#define DEFLATE_SUPPORT 0 +#endif + +#ifndef BSDCOMPRESS_SUPPORT +#define BSDCOMPRESS_SUPPORT 0 +#endif + +#ifndef PREDICTOR_SUPPORT +#define PREDICTOR_SUPPORT 0 +#endif + +/************************* +*** PUBLIC DEFINITIONS *** +*************************/ + +/* + * The basic PPP frame. + */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ + +/* + * Values for phase. + */ +#define PPP_PHASE_DEAD 0 +#define PPP_PHASE_MASTER 1 +#define PPP_PHASE_HOLDOFF 2 +#define PPP_PHASE_INITIALIZE 3 +#define PPP_PHASE_SERIALCONN 4 +#define PPP_PHASE_DORMANT 5 +#define PPP_PHASE_ESTABLISH 6 +#define PPP_PHASE_AUTHENTICATE 7 +#define PPP_PHASE_CALLBACK 8 +#define PPP_PHASE_NETWORK 9 +#define PPP_PHASE_RUNNING 10 +#define PPP_PHASE_TERMINATE 11 +#define PPP_PHASE_DISCONNECT 12 + +/* Error codes. */ +#define PPPERR_NONE 0 /* No error. */ +#define PPPERR_PARAM 1 /* Invalid parameter. */ +#define PPPERR_OPEN 2 /* Unable to open PPP session. */ +#define PPPERR_DEVICE 3 /* Invalid I/O device for PPP. */ +#define PPPERR_ALLOC 4 /* Unable to allocate resources. */ +#define PPPERR_USER 5 /* User interrupt. */ +#define PPPERR_CONNECT 6 /* Connection lost. */ +#define PPPERR_AUTHFAIL 7 /* Failed authentication challenge. */ +#define PPPERR_PROTOCOL 8 /* Failed to meet protocol. */ +#define PPPERR_PEERDEAD 9 /* Connection timeout */ +#define PPPERR_IDLETIMEOUT 10 /* Idle Timeout */ +#define PPPERR_CONNECTTIME 11 /* Max connect time reached */ +#define PPPERR_LOOPBACK 12 /* Loopback detected */ + +/* Whether auth support is enabled at all */ +#define PPP_AUTH_SUPPORT (PAP_SUPPORT || CHAP_SUPPORT || EAP_SUPPORT) + +/************************ +*** PUBLIC DATA TYPES *** +************************/ + +/* + * Other headers require ppp_pcb definition for prototypes, but ppp_pcb + * require some structure definition from other headers as well, we are + * fixing the dependency loop here by declaring the ppp_pcb type then + * by including headers containing necessary struct definition for ppp_pcb + */ +typedef struct ppp_pcb_s ppp_pcb; + +/* Type definitions for BSD code. */ +#ifndef __u_char_defined +typedef unsigned long u_long; +typedef unsigned int u_int; +typedef unsigned short u_short; +typedef unsigned char u_char; +#endif + +#include "fsm.h" +#include "lcp.h" +#if CCP_SUPPORT +#include "ccp.h" +#endif /* CCP_SUPPORT */ +#if MPPE_SUPPORT +#include "mppe.h" +#endif /* MPPE_SUPPORT */ +#if PPP_IPV4_SUPPORT +#include "ipcp.h" +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT +#include "ipv6cp.h" +#endif /* PPP_IPV6_SUPPORT */ +#if PAP_SUPPORT +#include "upap.h" +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT +#include "chap-new.h" +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT +#include "eap.h" +#endif /* EAP_SUPPORT */ +#if VJ_SUPPORT +#include "vj.h" +#endif /* VJ_SUPPORT */ + +/* Link status callback function prototype */ +typedef void (*ppp_link_status_cb_fn)(ppp_pcb *pcb, int err_code, void *ctx); + +/* + * PPP configuration. + */ +typedef struct ppp_settings_s { + +#if PPP_SERVER && PPP_AUTH_SUPPORT + unsigned int auth_required :1; /* Peer is required to authenticate */ + unsigned int null_login :1; /* Username of "" and a password of "" are acceptable */ +#endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ +#if PPP_REMOTENAME + unsigned int explicit_remote :1; /* remote_name specified with remotename opt */ +#endif /* PPP_REMOTENAME */ +#if PAP_SUPPORT + unsigned int refuse_pap :1; /* Don't proceed auth. with PAP */ +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + unsigned int refuse_chap :1; /* Don't proceed auth. with CHAP */ +#endif /* CHAP_SUPPORT */ +#if MSCHAP_SUPPORT + unsigned int refuse_mschap :1; /* Don't proceed auth. with MS-CHAP */ + unsigned int refuse_mschap_v2 :1; /* Don't proceed auth. with MS-CHAPv2 */ +#endif /* MSCHAP_SUPPORT */ +#if EAP_SUPPORT + unsigned int refuse_eap :1; /* Don't proceed auth. with EAP */ +#endif /* EAP_SUPPORT */ +#if LWIP_DNS + unsigned int usepeerdns :1; /* Ask peer for DNS adds */ +#endif /* LWIP_DNS */ + unsigned int persist :1; /* Persist mode, always try to open the connection */ +#if PRINTPKT_SUPPORT + unsigned int hide_password :1; /* Hide password in dumped packets */ +#endif /* PRINTPKT_SUPPORT */ + unsigned int noremoteip :1; /* Let him have no IP address */ + unsigned int lax_recv :1; /* accept control chars in asyncmap */ + unsigned int noendpoint :1; /* don't send/accept endpoint discriminator */ +#if PPP_LCP_ADAPTIVE + unsigned int lcp_echo_adaptive :1; /* request echo only if the link was idle */ +#endif /* PPP_LCP_ADAPTIVE */ +#if MPPE_SUPPORT + unsigned int require_mppe :1; /* Require MPPE (Microsoft Point to Point Encryption) */ + unsigned int refuse_mppe_40 :1; /* Allow MPPE 40-bit mode? */ + unsigned int refuse_mppe_128 :1; /* Allow MPPE 128-bit mode? */ + unsigned int refuse_mppe_stateful :1; /* Allow MPPE stateful mode? */ +#endif /* MPPE_SUPPORT */ + + u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */ + +#if PPP_IDLETIMELIMIT + u16_t idle_time_limit; /* Disconnect if idle for this many seconds */ +#endif /* PPP_IDLETIMELIMIT */ +#if PPP_MAXCONNECT + u32_t maxconnect; /* Maximum connect time (seconds) */ +#endif /* PPP_MAXCONNECT */ + +#if PPP_AUTH_SUPPORT + /* auth data */ + const char *user; /* Username for PAP */ + const char *passwd; /* Password for PAP, secret for CHAP */ +#if PPP_REMOTENAME + char remote_name[MAXNAMELEN + 1]; /* Peer's name for authentication */ +#endif /* PPP_REMOTENAME */ + +#if PAP_SUPPORT + u8_t pap_timeout_time; /* Timeout (seconds) for auth-req retrans. */ + u8_t pap_max_transmits; /* Number of auth-reqs sent */ +#if PPP_SERVER + u8_t pap_req_timeout; /* Time to wait for auth-req from peer */ +#endif /* PPP_SERVER */ +#endif /* PAP_SUPPPORT */ + +#if CHAP_SUPPORT + u8_t chap_timeout_time; /* Timeout (seconds) for retransmitting req */ + u8_t chap_max_transmits; /* max # times to send challenge */ +#if PPP_SERVER + u8_t chap_rechallenge_time; /* Time to wait for auth-req from peer */ +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPPORT */ + +#if EAP_SUPPORT + u8_t eap_req_time; /* Time to wait (for retransmit/fail) */ + u8_t eap_allow_req; /* Max Requests allowed */ +#if PPP_SERVER + u8_t eap_timeout_time; /* Time to wait (for retransmit/fail) */ + u8_t eap_max_transmits; /* Max Requests allowed */ +#endif /* PPP_SERVER */ +#endif /* EAP_SUPPORT */ + +#endif /* PPP_AUTH_SUPPORT */ + + u8_t fsm_timeout_time; /* Timeout time in seconds */ + u8_t fsm_max_conf_req_transmits; /* Maximum Configure-Request transmissions */ + u8_t fsm_max_term_transmits; /* Maximum Terminate-Request transmissions */ + u8_t fsm_max_nak_loops; /* Maximum number of nak loops tolerated */ + + u8_t lcp_loopbackfail; /* Number of times we receive our magic number from the peer + before deciding the link is looped-back. */ + u8_t lcp_echo_interval; /* Interval between LCP echo-requests */ + u8_t lcp_echo_fails; /* Tolerance to unanswered echo-requests */ + +} ppp_settings; + +#if PPP_SERVER +struct ppp_addrs { +#if PPP_IPV4_SUPPORT + ip4_addr_t our_ipaddr, his_ipaddr, netmask; +#if LWIP_DNS + ip4_addr_t dns1, dns2; +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + ip6_addr_t our6_ipaddr, his6_ipaddr; +#endif /* PPP_IPV6_SUPPORT */ +}; +#endif /* PPP_SERVER */ + +/* + * PPP interface control block. + */ +struct ppp_pcb_s { + ppp_settings settings; + const struct link_callbacks *link_cb; + void *link_ctx_cb; + void (*link_status_cb)(ppp_pcb *pcb, int err_code, void *ctx); /* Status change callback */ +#if PPP_NOTIFY_PHASE + void (*notify_phase_cb)(ppp_pcb *pcb, u8_t phase, void *ctx); /* Notify phase callback */ +#endif /* PPP_NOTIFY_PHASE */ + void *ctx_cb; /* Callbacks optional pointer */ + struct netif *netif; /* PPP interface */ + u8_t phase; /* where the link is at */ + u8_t err_code; /* Code indicating why interface is down. */ + + /* flags */ +#if PPP_IPV4_SUPPORT + unsigned int ask_for_local :1; /* request our address from peer */ + unsigned int ipcp_is_open :1; /* haven't called np_finished() */ + unsigned int ipcp_is_up :1; /* have called ipcp_up() */ + unsigned int if4_up :1; /* True when the IPv4 interface is up. */ +#if 0 /* UNUSED - PROXY ARP */ + unsigned int proxy_arp_set :1; /* Have created proxy arp entry */ +#endif /* UNUSED - PROXY ARP */ +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + unsigned int ipv6cp_is_up :1; /* have called ip6cp_up() */ + unsigned int if6_up :1; /* True when the IPv6 interface is up. */ +#endif /* PPP_IPV6_SUPPORT */ + unsigned int lcp_echo_timer_running :1; /* set if a timer is running */ +#if VJ_SUPPORT + unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */ +#endif /* VJ_SUPPORT */ +#if CCP_SUPPORT + unsigned int ccp_all_rejected :1; /* we rejected all peer's options */ +#endif /* CCP_SUPPORT */ +#if MPPE_SUPPORT + unsigned int mppe_keys_set :1; /* Have the MPPE keys been set? */ +#endif /* MPPE_SUPPORT */ + +#if PPP_AUTH_SUPPORT + /* auth data */ +#if PPP_SERVER && defined(HAVE_MULTILINK) + char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */ +#endif /* PPP_SERVER && defined(HAVE_MULTILINK) */ + u16_t auth_pending; /* Records which authentication operations haven't completed yet. */ + u16_t auth_done; /* Records which authentication operations have been completed. */ + +#if PAP_SUPPORT + upap_state upap; /* PAP data */ +#endif /* PAP_SUPPORT */ + +#if CHAP_SUPPORT + chap_client_state chap_client; /* CHAP client data */ +#if PPP_SERVER + chap_server_state chap_server; /* CHAP server data */ +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPORT */ + +#if EAP_SUPPORT + eap_state eap; /* EAP data */ +#endif /* EAP_SUPPORT */ +#endif /* PPP_AUTH_SUPPORT */ + + fsm lcp_fsm; /* LCP fsm structure */ + lcp_options lcp_wantoptions; /* Options that we want to request */ + lcp_options lcp_gotoptions; /* Options that peer ack'd */ + lcp_options lcp_allowoptions; /* Options we allow peer to request */ + lcp_options lcp_hisoptions; /* Options that we ack'd */ + u16_t peer_mru; /* currently negotiated peer MRU */ + u8_t lcp_echos_pending; /* Number of outstanding echo msgs */ + u8_t lcp_echo_number; /* ID number of next echo frame */ + + u8_t num_np_open; /* Number of network protocols which we have opened. */ + u8_t num_np_up; /* Number of network protocols which have come up. */ + +#if VJ_SUPPORT + struct vjcompress vj_comp; /* Van Jacobson compression header. */ +#endif /* VJ_SUPPORT */ + +#if CCP_SUPPORT + fsm ccp_fsm; /* CCP fsm structure */ + ccp_options ccp_wantoptions; /* what to request the peer to use */ + ccp_options ccp_gotoptions; /* what the peer agreed to do */ + ccp_options ccp_allowoptions; /* what we'll agree to do */ + ccp_options ccp_hisoptions; /* what we agreed to do */ + u8_t ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */ + u8_t ccp_receive_method; /* Method chosen on receive path */ + u8_t ccp_transmit_method; /* Method chosen on transmit path */ +#if MPPE_SUPPORT + ppp_mppe_state mppe_comp; /* MPPE "compressor" structure */ + ppp_mppe_state mppe_decomp; /* MPPE "decompressor" structure */ +#endif /* MPPE_SUPPORT */ +#endif /* CCP_SUPPORT */ + +#if PPP_IPV4_SUPPORT + fsm ipcp_fsm; /* IPCP fsm structure */ + ipcp_options ipcp_wantoptions; /* Options that we want to request */ + ipcp_options ipcp_gotoptions; /* Options that peer ack'd */ + ipcp_options ipcp_allowoptions; /* Options we allow peer to request */ + ipcp_options ipcp_hisoptions; /* Options that we ack'd */ +#endif /* PPP_IPV4_SUPPORT */ + +#if PPP_IPV6_SUPPORT + fsm ipv6cp_fsm; /* IPV6CP fsm structure */ + ipv6cp_options ipv6cp_wantoptions; /* Options that we want to request */ + ipv6cp_options ipv6cp_gotoptions; /* Options that peer ack'd */ + ipv6cp_options ipv6cp_allowoptions; /* Options we allow peer to request */ + ipv6cp_options ipv6cp_hisoptions; /* Options that we ack'd */ +#endif /* PPP_IPV6_SUPPORT */ +}; + +/************************ + *** PUBLIC FUNCTIONS *** + ************************/ + +/* + * WARNING: For multi-threads environment, all ppp_set_* functions most + * only be called while the PPP is in the dead phase (i.e. disconnected). + */ + +#if PPP_AUTH_SUPPORT +/* + * Set PPP authentication. + * + * Warning: Using PPPAUTHTYPE_ANY might have security consequences. + * RFC 1994 says: + * + * In practice, within or associated with each PPP server, there is a + * database which associates "user" names with authentication + * information ("secrets"). It is not anticipated that a particular + * named user would be authenticated by multiple methods. This would + * make the user vulnerable to attacks which negotiate the least secure + * method from among a set (such as PAP rather than CHAP). If the same + * secret was used, PAP would reveal the secret to be used later with + * CHAP. + * + * Instead, for each user name there should be an indication of exactly + * one method used to authenticate that user name. If a user needs to + * make use of different authentication methods under different + * circumstances, then distinct user names SHOULD be employed, each of + * which identifies exactly one authentication method. + * + * Default is none auth type, unset (NULL) user and passwd. + */ +#define PPPAUTHTYPE_NONE 0x00 +#define PPPAUTHTYPE_PAP 0x01 +#define PPPAUTHTYPE_CHAP 0x02 +#define PPPAUTHTYPE_MSCHAP 0x04 +#define PPPAUTHTYPE_MSCHAP_V2 0x08 +#define PPPAUTHTYPE_EAP 0x10 +#define PPPAUTHTYPE_ANY 0xff +void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); + +/* + * If set, peer is required to authenticate. This is mostly necessary for PPP server support. + * + * Default is false. + */ +#define ppp_set_auth_required(ppp, boolval) (ppp->settings.auth_required = boolval) +#endif /* PPP_AUTH_SUPPORT */ + +#if PPP_IPV4_SUPPORT +/* + * Set PPP interface "our" and "his" IPv4 addresses. This is mostly necessary for PPP server + * support but it can also be used on a PPP link where each side choose its own IP address. + * + * Default is unset (0.0.0.0). + */ +#define ppp_set_ipcp_ouraddr(ppp, addr) do { ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr); \ + ppp->ask_for_local = ppp->ipcp_wantoptions.ouraddr != 0; } while(0) +#define ppp_set_ipcp_hisaddr(ppp, addr) (ppp->ipcp_wantoptions.hisaddr = ip4_addr_get_u32(addr)) +#if LWIP_DNS +/* + * Set DNS server addresses that are sent if the peer asks for them. This is mostly necessary + * for PPP server support. + * + * Default is unset (0.0.0.0). + */ +#define ppp_set_ipcp_dnsaddr(ppp, index, addr) (ppp->ipcp_allowoptions.dnsaddr[index] = ip4_addr_get_u32(addr)) + +/* + * If set, we ask the peer for up to 2 DNS server addresses. Received DNS server addresses are + * registered using the dns_setserver() function. + * + * Default is false. + */ +#define ppp_set_usepeerdns(ppp, boolval) (ppp->settings.usepeerdns = boolval) +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ + +#if MPPE_SUPPORT +/* Disable MPPE (Microsoft Point to Point Encryption). This parameter is exclusive. */ +#define PPP_MPPE_DISABLE 0x00 +/* Require the use of MPPE (Microsoft Point to Point Encryption). */ +#define PPP_MPPE_ENABLE 0x01 +/* Allow MPPE to use stateful mode. Stateless mode is still attempted first. */ +#define PPP_MPPE_ALLOW_STATEFUL 0x02 +/* Refuse the use of MPPE with 40-bit encryption. Conflict with PPP_MPPE_REFUSE_128. */ +#define PPP_MPPE_REFUSE_40 0x04 +/* Refuse the use of MPPE with 128-bit encryption. Conflict with PPP_MPPE_REFUSE_40. */ +#define PPP_MPPE_REFUSE_128 0x08 +/* + * Set MPPE configuration + * + * Default is disabled. + */ +void ppp_set_mppe(ppp_pcb *pcb, u8_t flags); +#endif /* MPPE_SUPPORT */ + +/* + * Wait for up to intval milliseconds for a valid PPP packet from the peer. + * At the end of this time, or when a valid PPP packet is received from the + * peer, we commence negotiation by sending our first LCP packet. + * + * Default is 0. + */ +#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval) + +/* + * If set, we will attempt to initiate a connection but if no reply is received from + * the peer, we will then just wait passively for a valid LCP packet from the peer. + * + * Default is false. + */ +#define ppp_set_passive(ppp, boolval) (ppp->lcp_wantoptions.passive = boolval) + +/* + * If set, we will not transmit LCP packets to initiate a connection until a valid + * LCP packet is received from the peer. This is what we usually call the server mode. + * + * Default is false. + */ +#define ppp_set_silent(ppp, boolval) (ppp->lcp_wantoptions.silent = boolval) + +/* + * If set, enable protocol field compression negotiation in both the receive and + * the transmit direction. + * + * Default is true. + */ +#define ppp_set_neg_pcomp(ppp, boolval) (ppp->lcp_wantoptions.neg_pcompression = \ + ppp->lcp_allowoptions.neg_pcompression = boolval) + +/* + * If set, enable Address/Control compression in both the receive and the transmit + * direction. + * + * Default is true. + */ +#define ppp_set_neg_accomp(ppp, boolval) (ppp->lcp_wantoptions.neg_accompression = \ + ppp->lcp_allowoptions.neg_accompression = boolval) + +/* + * If set, enable asyncmap negotiation. Otherwise forcing all control characters to + * be escaped for both the transmit and the receive direction. + * + * Default is true. + */ +#define ppp_set_neg_asyncmap(ppp, boolval) (ppp->lcp_wantoptions.neg_asyncmap = \ + ppp->lcp_allowoptions.neg_asyncmap = boolval) + +/* + * This option sets the Async-Control-Character-Map (ACCM) for this end of the link. + * The ACCM is a set of 32 bits, one for each of the ASCII control characters with + * values from 0 to 31, where a 1 bit indicates that the corresponding control + * character should not be used in PPP packets sent to this system. The map is + * an unsigned 32 bits integer where the least significant bit (00000001) represents + * character 0 and the most significant bit (80000000) represents character 31. + * We will then ask the peer to send these characters as a 2-byte escape sequence. + * + * Default is 0. + */ +#define ppp_set_asyncmap(ppp, intval) (ppp->lcp_wantoptions.asyncmap = intval) + +/* + * Set a PPP interface as the default network interface + * (used to output all packets for which no specific route is found). + */ +#define ppp_set_default(ppp) netif_set_default(ppp->netif) + +#if PPP_NOTIFY_PHASE +/* + * Set a PPP notify phase callback. + * + * This can be used for example to set a LED pattern depending on the + * current phase of the PPP session. + */ +typedef void (*ppp_notify_phase_cb_fn)(ppp_pcb *pcb, u8_t phase, void *ctx); +void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); +#endif /* PPP_NOTIFY_PHASE */ + +/* + * Initiate a PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * Holdoff is the time to wait (in seconds) before initiating + * the connection. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff); + +#if PPP_SERVER +/* + * Listen for an incoming PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_listen(ppp_pcb *pcb); +#endif /* PPP_SERVER */ + +/* + * Initiate the end of a PPP connection. + * Any outstanding packets in the queues are dropped. + * + * Setting nocarrier to 1 close the PPP connection without initiating the + * shutdown procedure. Always using nocarrier = 0 is still recommended, + * this is going to take a little longer time if your link is down, but + * is a safer choice for the PPP state machine. + * + * Return 0 on success, an error code on failure. + */ +err_t ppp_close(ppp_pcb *pcb, u8_t nocarrier); + +/* + * Release the control block. + * + * This can only be called if PPP is in the dead phase. + * + * You must use ppp_close() before if you wish to terminate + * an established PPP session. + * + * Return 0 on success, an error code on failure. + */ +err_t ppp_free(ppp_pcb *pcb); + +/* + * PPP IOCTL commands. + * + * Get the up status - 0 for down, non-zero for up. The argument must + * point to an int. + */ +#define PPPCTLG_UPSTATUS 0 + +/* + * Get the PPP error code. The argument must point to an int. + * Returns a PPPERR_* value. + */ +#define PPPCTLG_ERRCODE 1 + +/* + * Get the fd associated with a PPP over serial + */ +#define PPPCTLG_FD 2 + +/* + * Get and set parameters for the given connection. + * Return 0 on success, an error code on failure. + */ +err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); + +/* Get the PPP netif interface */ +#define ppp_netif(ppp) (ppp->netif) + +/* Set an lwIP-style status-callback for the selected PPP device */ +#define ppp_set_netif_statuscallback(ppp, status_cb) \ + netif_set_status_callback(ppp->netif, status_cb); + +/* Set an lwIP-style link-callback for the selected PPP device */ +#define ppp_set_netif_linkcallback(ppp, link_cb) \ + netif_set_link_callback(ppp->netif, link_cb); + +#endif /* PPP_H */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h new file mode 100644 index 0000000..1d4c774 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h @@ -0,0 +1,629 @@ +/***************************************************************************** +* ppp.h - Network Point to Point Protocol header file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* portions Copyright (c) 1997 Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 97-11-05 Guy Lancaster , Global Election Systems Inc. +* Original derived from BSD codes. +*****************************************************************************/ +#ifndef LWIP_HDR_PPP_IMPL_H +#define LWIP_HDR_PPP_IMPL_H + +#include "netif/ppp/ppp_opts.h" + +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifdef PPP_INCLUDE_SETTINGS_HEADER +#include "ppp_settings.h" +#endif + +#include /* formats */ +#include +#include +#include /* strtol() */ + +#include "lwip/netif.h" +#include "lwip/def.h" +#include "lwip/timeouts.h" + +#include "ppp.h" +#include "pppdebug.h" + +/* + * Memory used for control packets. + * + * PPP_CTRL_PBUF_MAX_SIZE is the amount of memory we allocate when we + * cannot figure out how much we are going to use before filling the buffer. + */ +#if PPP_USE_PBUF_RAM +#define PPP_CTRL_PBUF_TYPE PBUF_RAM +#define PPP_CTRL_PBUF_MAX_SIZE 512 +#else /* PPP_USE_PBUF_RAM */ +#define PPP_CTRL_PBUF_TYPE PBUF_POOL +#define PPP_CTRL_PBUF_MAX_SIZE PBUF_POOL_BUFSIZE +#endif /* PPP_USE_PBUF_RAM */ + +/* + * The basic PPP frame. + */ +#define PPP_ADDRESS(p) (((u_char *)(p))[0]) +#define PPP_CONTROL(p) (((u_char *)(p))[1]) +#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) + +/* + * Significant octet values. + */ +#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ +#define PPP_UI 0x03 /* Unnumbered Information */ +#define PPP_FLAG 0x7e /* Flag Sequence */ +#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ +#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ + +/* + * Protocol field values. + */ +#define PPP_IP 0x21 /* Internet Protocol */ +#if 0 /* UNUSED */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ +#endif /* UNUSED */ +#if VJ_SUPPORT +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#endif /* VJ_SUPPORT */ +#if PPP_IPV6_SUPPORT +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#endif /* PPP_IPV6_SUPPORT */ +#if CCP_SUPPORT +#define PPP_COMP 0xfd /* compressed packet */ +#endif /* CCP_SUPPORT */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#if 0 /* UNUSED */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#endif /* UNUSED */ +#if PPP_IPV6_SUPPORT +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ +#endif /* PPP_IPV6_SUPPORT */ +#if CCP_SUPPORT +#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#endif /* CCP_SUPPORT */ +#if ECP_SUPPORT +#define PPP_ECP 0x8053 /* Encryption Control Protocol */ +#endif /* ECP_SUPPORT */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ +#if PAP_SUPPORT +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#endif /* PAP_SUPPORT */ +#if LQR_SUPPORT +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#endif /* LQR_SUPPORT */ +#if CHAP_SUPPORT +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#endif /* CHAP_SUPPORT */ +#if CBCP_SUPPORT +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ +#endif /* CBCP_SUPPORT */ +#if EAP_SUPPORT +#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ +#endif /* EAP_SUPPORT */ + +/* + * The following struct gives the addresses of procedures to call + * for a particular lower link level protocol. + */ +struct link_callbacks { + /* Start a connection (e.g. Initiate discovery phase) */ + void (*connect) (ppp_pcb *pcb, void *ctx); +#if PPP_SERVER + /* Listen for an incoming connection (Passive mode) */ + void (*listen) (ppp_pcb *pcb, void *ctx); +#endif /* PPP_SERVER */ + /* End a connection (i.e. initiate disconnect phase) */ + void (*disconnect) (ppp_pcb *pcb, void *ctx); + /* Free lower protocol control block */ + err_t (*free) (ppp_pcb *pcb, void *ctx); + /* Write a pbuf to a ppp link, only used from PPP functions to send PPP packets. */ + err_t (*write)(ppp_pcb *pcb, void *ctx, struct pbuf *p); + /* Send a packet from lwIP core (IPv4 or IPv6) */ + err_t (*netif_output)(ppp_pcb *pcb, void *ctx, struct pbuf *p, u_short protocol); + /* configure the transmit-side characteristics of the PPP interface */ + void (*send_config)(ppp_pcb *pcb, void *ctx, u32_t accm, int pcomp, int accomp); + /* confire the receive-side characteristics of the PPP interface */ + void (*recv_config)(ppp_pcb *pcb, void *ctx, u32_t accm, int pcomp, int accomp); +}; + +/* + * What to do with network protocol (NP) packets. + */ +enum NPmode { + NPMODE_PASS, /* pass the packet through */ + NPMODE_DROP, /* silently drop the packet */ + NPMODE_ERROR, /* return an error */ + NPMODE_QUEUE /* save it up for later. */ +}; + +/* + * Statistics. + */ +#if PPP_STATS_SUPPORT +struct pppstat { + unsigned int ppp_ibytes; /* bytes received */ + unsigned int ppp_ipackets; /* packets received */ + unsigned int ppp_ierrors; /* receive errors */ + unsigned int ppp_obytes; /* bytes sent */ + unsigned int ppp_opackets; /* packets sent */ + unsigned int ppp_oerrors; /* transmit errors */ +}; + +#if VJ_SUPPORT +struct vjstat { + unsigned int vjs_packets; /* outbound packets */ + unsigned int vjs_compressed; /* outbound compressed packets */ + unsigned int vjs_searches; /* searches for connection state */ + unsigned int vjs_misses; /* times couldn't find conn. state */ + unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ + unsigned int vjs_compressedin; /* inbound compressed packets */ + unsigned int vjs_errorin; /* inbound unknown type packets */ + unsigned int vjs_tossed; /* inbound packets tossed because of error */ +}; +#endif /* VJ_SUPPORT */ + +struct ppp_stats { + struct pppstat p; /* basic PPP statistics */ +#if VJ_SUPPORT + struct vjstat vj; /* VJ header compression statistics */ +#endif /* VJ_SUPPORT */ +}; + +#if CCP_SUPPORT +struct compstat { + unsigned int unc_bytes; /* total uncompressed bytes */ + unsigned int unc_packets; /* total uncompressed packets */ + unsigned int comp_bytes; /* compressed bytes */ + unsigned int comp_packets; /* compressed packets */ + unsigned int inc_bytes; /* incompressible bytes */ + unsigned int inc_packets; /* incompressible packets */ + unsigned int ratio; /* recent compression ratio << 8 */ +}; + +struct ppp_comp_stats { + struct compstat c; /* packet compression statistics */ + struct compstat d; /* packet decompression statistics */ +}; +#endif /* CCP_SUPPORT */ + +#endif /* PPP_STATS_SUPPORT */ + +#if PPP_IDLETIMELIMIT +/* + * The following structure records the time in seconds since + * the last NP packet was sent or received. + */ +struct ppp_idle { + time_t xmit_idle; /* time since last NP packet sent */ + time_t recv_idle; /* time since last NP packet received */ +}; +#endif /* PPP_IDLETIMELIMIT */ + +/* values for epdisc.class */ +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 + +/* + * Global variables. + */ +#ifdef HAVE_MULTILINK +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; +#endif + +#ifdef MAXOCTETS +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern int maxoctets_dir; /* Direction : + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ +extern int maxoctets_timeout; /* Timeout for check of octets limit */ +#define PPP_OCTETS_DIRECTION_SUM 0 +#define PPP_OCTETS_DIRECTION_IN 1 +#define PPP_OCTETS_DIRECTION_OUT 2 +#define PPP_OCTETS_DIRECTION_MAXOVERAL 3 +/* same as previos, but little different on RADIUS side */ +#define PPP_OCTETS_DIRECTION_MAXSESSION 4 +#endif + +/* Data input may be used by CCP and ECP, remove this entry + * from struct protent to save some flash + */ +#define PPP_DATAINPUT 0 + +/* + * The following struct gives the addresses of procedures to call + * for a particular protocol. + */ +struct protent { + u_short protocol; /* PPP protocol number */ + /* Initialization procedure */ + void (*init) (ppp_pcb *pcb); + /* Process a received packet */ + void (*input) (ppp_pcb *pcb, u_char *pkt, int len); + /* Process a received protocol-reject */ + void (*protrej) (ppp_pcb *pcb); + /* Lower layer has come up */ + void (*lowerup) (ppp_pcb *pcb); + /* Lower layer has gone down */ + void (*lowerdown) (ppp_pcb *pcb); + /* Open the protocol */ + void (*open) (ppp_pcb *pcb); + /* Close the protocol */ + void (*close) (ppp_pcb *pcb, const char *reason); +#if PRINTPKT_SUPPORT + /* Print a packet in readable form */ + int (*printpkt) (const u_char *pkt, int len, + void (*printer) (void *, const char *, ...), + void *arg); +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + /* Process a received data packet */ + void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + const char *name; /* Text name of protocol */ + const char *data_name; /* Text name of corresponding data protocol */ +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + option_t *options; /* List of command-line options */ + /* Check requested options, assign defaults */ + void (*check_options) (void); +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + /* Configure interface for demand-dial */ + int (*demand_conf) (int unit); + /* Say whether to bring up link for this pkt */ + int (*active_pkt) (u_char *pkt, int len); +#endif /* DEMAND_SUPPORT */ +}; + +/* Table of pointers to supported protocols */ +extern const struct protent* const protocols[]; + + +/* Values for auth_pending, auth_done */ +#if PAP_SUPPORT +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 +#endif /* EAP_SUPPORT */ + +/* Values for auth_done only */ +#if CHAP_SUPPORT +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 +#if MSCHAP_SUPPORT +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 +#endif /* MSCHAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ + +/* Supported CHAP protocols */ +#if CHAP_SUPPORT + +#if MSCHAP_SUPPORT +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) +#else /* MSCHAP_SUPPORT */ +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MD5) +#endif /* MSCHAP_SUPPORT */ + +#else /* CHAP_SUPPORT */ +#define CHAP_MDTYPE_SUPPORTED (MDTYPE_NONE) +#endif /* CHAP_SUPPORT */ + +#if PPP_STATS_SUPPORT +/* + * PPP statistics structure + */ +struct pppd_stats { + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; +}; +#endif /* PPP_STATS_SUPPORT */ + + +/* + * PPP private functions + */ + + +/* + * Functions called from lwIP core. + */ + +/* initialize the PPP subsystem */ +int ppp_init(void); + +/* + * Functions called from PPP link protocols. + */ + +/* Create a new PPP control block */ +ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, void *link_ctx_cb, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + +/* Initiate LCP open request */ +void ppp_start(ppp_pcb *pcb); + +/* Called when link failed to setup */ +void ppp_link_failed(ppp_pcb *pcb); + +/* Called when link is normally down (i.e. it was asked to end) */ +void ppp_link_end(ppp_pcb *pcb); + +/* function called to process input packet */ +void ppp_input(ppp_pcb *pcb, struct pbuf *pb); + +/* helper function, merge a pbuf chain into one pbuf */ +struct pbuf *ppp_singlebuf(struct pbuf *p); + + +/* + * Functions called by PPP protocols. + */ + +/* function called by all PPP subsystems to send packets */ +err_t ppp_write(ppp_pcb *pcb, struct pbuf *p); + +/* functions called by auth.c link_terminated() */ +void ppp_link_terminated(ppp_pcb *pcb); + +void new_phase(ppp_pcb *pcb, int p); + +int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp); +int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp); + +#if PPP_IPV4_SUPPORT +int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr, u32_t netmask); +int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr); +#if 0 /* UNUSED - PROXY ARP */ +int sifproxyarp(ppp_pcb *pcb, u32_t his_adr); +int cifproxyarp(ppp_pcb *pcb, u32_t his_adr); +#endif /* UNUSED - PROXY ARP */ +#if LWIP_DNS +int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); +int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); +#endif /* LWIP_DNS */ +#if VJ_SUPPORT +int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid); +#endif /* VJ_SUPPORT */ +int sifup(ppp_pcb *pcb); +int sifdown (ppp_pcb *pcb); +u32_t get_mask(u32_t addr); +#endif /* PPP_IPV4_SUPPORT */ + +#if PPP_IPV6_SUPPORT +int sif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64); +int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64); +int sif6up(ppp_pcb *pcb); +int sif6down (ppp_pcb *pcb); +#endif /* PPP_IPV6_SUPPORT */ + +#if DEMAND_SUPPORT +int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode); +#endif /* DEMAND_SUPPORt */ + +void netif_set_mtu(ppp_pcb *pcb, int mtu); +int netif_get_mtu(ppp_pcb *pcb); + +#if CCP_SUPPORT +#if 0 /* unused */ +int ccp_test(ppp_pcb *pcb, u_char *opt_ptr, int opt_len, int for_transmit); +#endif /* unused */ +void ccp_set(ppp_pcb *pcb, u8_t isopen, u8_t isup, u8_t receive_method, u8_t transmit_method); +void ccp_reset_comp(ppp_pcb *pcb); +void ccp_reset_decomp(ppp_pcb *pcb); +#if 0 /* unused */ +int ccp_fatal_error(ppp_pcb *pcb); +#endif /* unused */ +#endif /* CCP_SUPPORT */ + +#if PPP_IDLETIMELIMIT +int get_idle_time(ppp_pcb *pcb, struct ppp_idle *ip); +#endif /* PPP_IDLETIMELIMIT */ + +#if DEMAND_SUPPORT +int get_loop_output(void); +#endif /* DEMAND_SUPPORT */ + +/* Optional protocol names list, to make our messages a little more informative. */ +#if PPP_PROTOCOLNAME +const char * protocol_name(int proto); +#endif /* PPP_PROTOCOLNAME */ + +/* Optional stats support, to get some statistics on the PPP interface */ +#if PPP_STATS_SUPPORT +void print_link_stats(void); /* Print stats, if available */ +void reset_link_stats(int u); /* Reset (init) stats when link goes up */ +void update_link_stats(int u); /* Get stats at link termination */ +#endif /* PPP_STATS_SUPPORT */ + + + +/* + * Inline versions of get/put char/short/long. + * Pointer is advanced; we assume that both arguments + * are lvalues and will already be in registers. + * cp MUST be u_char *. + */ +#define GETCHAR(c, cp) { \ + (c) = *(cp)++; \ +} +#define PUTCHAR(c, cp) { \ + *(cp)++ = (u_char) (c); \ +} +#define GETSHORT(s, cp) { \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ +} +#define PUTSHORT(s, cp) { \ + *(cp)++ = (u_char) ((s) >> 8); \ + *(cp)++ = (u_char) (s); \ +} +#define GETLONG(l, cp) { \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ +} +#define PUTLONG(l, cp) { \ + *(cp)++ = (u_char) ((l) >> 24); \ + *(cp)++ = (u_char) ((l) >> 16); \ + *(cp)++ = (u_char) ((l) >> 8); \ + *(cp)++ = (u_char) (l); \ +} + +#define INCPTR(n, cp) ((cp) += (n)) +#define DECPTR(n, cp) ((cp) -= (n)) + +/* + * System dependent definitions for user-level 4.3BSD UNIX implementation. + */ +#define TIMEOUT(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t)*1000, (f), (a)); } while(0) +#define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) +#define UNTIMEOUT(f, a) sys_untimeout((f), (a)) + +#define BZERO(s, n) memset(s, 0, n) +#define BCMP(s1, s2, l) memcmp(s1, s2, l) + +#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } + +/* + * MAKEHEADER - Add Header fields to a packet. + */ +#define MAKEHEADER(p, t) { \ + PUTCHAR(PPP_ALLSTATIONS, p); \ + PUTCHAR(PPP_UI, p); \ + PUTSHORT(t, p); } + +/* Procedures exported from auth.c */ +void link_required(ppp_pcb *pcb); /* we are starting to use the link */ +void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ +void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ +void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ +void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ +void start_networks(ppp_pcb *pcb); /* start all the network control protos */ +void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos */ +#if PPP_AUTH_SUPPORT +#if PPP_SERVER +int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); + /* check the user name and passwd against configuration */ +void auth_peer_fail(ppp_pcb *pcb, int protocol); + /* peer failed to authenticate itself */ +void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); + /* peer successfully authenticated itself */ +#endif /* PPP_SERVER */ +void auth_withpeer_fail(ppp_pcb *pcb, int protocol); + /* we failed to authenticate ourselves */ +void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); + /* we successfully authenticated ourselves */ +#endif /* PPP_AUTH_SUPPORT */ +void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ +void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ +void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ +#if PPP_AUTH_SUPPORT +int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); + /* get "secret" for chap */ +#endif /* PPP_AUTH_SUPPORT */ + +/* Procedures exported from ipcp.c */ +/* int parse_dotted_ip (char *, u32_t *); */ + +/* Procedures exported from demand.c */ +#if DEMAND_SUPPORT +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ +void demand_unblock (void); /* set all NPs to pass packets */ +void demand_discard (void); /* set all NPs to discard packets */ +void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ +int loop_chars (unsigned char *, int); /* process chars from loopback */ +int loop_frame (unsigned char *, int); /* should we bring link up? */ +#endif /* DEMAND_SUPPORT */ + +/* Procedures exported from multilink.c */ +#ifdef HAVE_MULTILINK +void mp_check_options (void); /* Check multilink-related options */ +int mp_join_bundle (void); /* join our link to an appropriate bundle */ +void mp_exit_bundle (void); /* have disconnected our link from bundle */ +void mp_bundle_terminated (void); +char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ +int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ +#else +#define mp_bundle_terminated() /* nothing */ +#define mp_exit_bundle() /* nothing */ +#define doing_multilink 0 +#define multilink_master 0 +#endif + +/* Procedures exported from utils.c. */ +void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const char *, ...), void *arg); /* Format a string for output */ +int ppp_slprintf(char *buf, int buflen, const char *fmt, ...); /* sprintf++ */ +int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args); /* vsprintf++ */ +size_t ppp_strlcpy(char *dest, const char *src, size_t len); /* safe strcpy */ +size_t ppp_strlcat(char *dest, const char *src, size_t len); /* safe strncpy */ +void ppp_dbglog(const char *fmt, ...); /* log a debug message */ +void ppp_info(const char *fmt, ...); /* log an informational message */ +void ppp_notice(const char *fmt, ...); /* log a notice-level message */ +void ppp_warn(const char *fmt, ...); /* log a warning message */ +void ppp_error(const char *fmt, ...); /* log an error message */ +void ppp_fatal(const char *fmt, ...); /* log an error message and die(1) */ +#if PRINTPKT_SUPPORT +void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len); + /* dump packet to debug log if interesting */ +#endif /* PRINTPKT_SUPPORT */ + + +#endif /* PPP_SUPPORT */ +#endif /* LWIP_HDR_PPP_IMPL_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_opts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_opts.h new file mode 100644 index 0000000..fa79c09 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/ppp_opts.h @@ -0,0 +1,593 @@ +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#ifndef LWIP_PPP_OPTS_H +#define LWIP_PPP_OPTS_H + +#include "lwip/opt.h" + +/** + * PPP_SUPPORT==1: Enable PPP. + */ +#ifndef PPP_SUPPORT +#define PPP_SUPPORT 0 +#endif + +/** + * PPPOE_SUPPORT==1: Enable PPP Over Ethernet + */ +#ifndef PPPOE_SUPPORT +#define PPPOE_SUPPORT 0 +#endif + +/** + * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP + */ +#ifndef PPPOL2TP_SUPPORT +#define PPPOL2TP_SUPPORT 0 +#endif + +/** + * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support) + */ +#ifndef PPPOL2TP_AUTH_SUPPORT +#define PPPOL2TP_AUTH_SUPPORT PPPOL2TP_SUPPORT +#endif + +/** + * PPPOS_SUPPORT==1: Enable PPP Over Serial + */ +#ifndef PPPOS_SUPPORT +#define PPPOS_SUPPORT PPP_SUPPORT +#endif + +/** + * LWIP_PPP_API==1: Enable PPP API (in pppapi.c) + */ +#ifndef LWIP_PPP_API +#define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0)) +#endif + +/** + * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP + * connections (requires the PPP_SUPPORT option) + */ +#ifndef MEMP_NUM_PPP_PCB +#define MEMP_NUM_PPP_PCB 1 +#endif + +#if PPP_SUPPORT + +/** + * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS + * interfaces (only used with PPPOS_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOS_INTERFACES +#define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB +#endif + +/** + * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE + * interfaces (only used with PPPOE_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOE_INTERFACES +#define MEMP_NUM_PPPOE_INTERFACES 1 +#endif + +/** + * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP + * interfaces (only used with PPPOL2TP_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOL2TP_INTERFACES +#define MEMP_NUM_PPPOL2TP_INTERFACES 1 +#endif + +/** + * MEMP_NUM_PPP_API_MSG: Number of concurrent PPP API messages (in pppapi.c) + */ +#ifndef MEMP_NUM_PPP_API_MSG +#define MEMP_NUM_PPP_API_MSG 5 +#endif + +/** + * PPP_DEBUG: Enable debugging for PPP. + */ +#ifndef PPP_DEBUG +#define PPP_DEBUG LWIP_DBG_OFF +#endif + +/** + * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback(). + * + * Please read the "PPPoS input path" chapter in the PPP documentation about this option. + */ +#ifndef PPP_INPROC_IRQ_SAFE +#define PPP_INPROC_IRQ_SAFE 0 +#endif + +/** + * PRINTPKT_SUPPORT==1: Enable PPP print packet support + * + * Mandatory for debugging, it displays exchanged packet content in debug trace. + */ +#ifndef PRINTPKT_SUPPORT +#define PRINTPKT_SUPPORT 0 +#endif + +/** + * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support + */ +#ifndef PPP_IPV4_SUPPORT +#define PPP_IPV4_SUPPORT (LWIP_IPV4) +#endif + +/** + * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support + */ +#ifndef PPP_IPV6_SUPPORT +#define PPP_IPV6_SUPPORT (LWIP_IPV6) +#endif + +/** + * PPP_NOTIFY_PHASE==1: Support PPP notify phase support + * + * PPP notify phase support allows you to set a callback which is + * called on change of the internal PPP state machine. + * + * This can be used for example to set a LED pattern depending on the + * current phase of the PPP session. + */ +#ifndef PPP_NOTIFY_PHASE +#define PPP_NOTIFY_PHASE 0 +#endif + +/** + * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets. + * + * Memory allocated must be single buffered for PPP to works, it requires pbuf + * that are not going to be chained when allocated. This requires setting + * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems. + * + * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous + * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE. + */ +#ifndef PPP_USE_PBUF_RAM +#define PPP_USE_PBUF_RAM 0 +#endif + +/** + * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS + */ +#ifndef PPP_FCS_TABLE +#define PPP_FCS_TABLE 1 +#endif + +/** + * PAP_SUPPORT==1: Support PAP. + */ +#ifndef PAP_SUPPORT +#define PAP_SUPPORT 0 +#endif + +/** + * CHAP_SUPPORT==1: Support CHAP. + */ +#ifndef CHAP_SUPPORT +#define CHAP_SUPPORT 0 +#endif + +/** + * MSCHAP_SUPPORT==1: Support MSCHAP. + */ +#ifndef MSCHAP_SUPPORT +#define MSCHAP_SUPPORT 0 +#endif +#if MSCHAP_SUPPORT +/* MSCHAP requires CHAP support */ +#undef CHAP_SUPPORT +#define CHAP_SUPPORT 1 +#endif /* MSCHAP_SUPPORT */ + +/** + * EAP_SUPPORT==1: Support EAP. + */ +#ifndef EAP_SUPPORT +#define EAP_SUPPORT 0 +#endif + +/** + * CCP_SUPPORT==1: Support CCP. + */ +#ifndef CCP_SUPPORT +#define CCP_SUPPORT 0 +#endif + +/** + * MPPE_SUPPORT==1: Support MPPE. + */ +#ifndef MPPE_SUPPORT +#define MPPE_SUPPORT 0 +#endif +#if MPPE_SUPPORT +/* MPPE requires CCP support */ +#undef CCP_SUPPORT +#define CCP_SUPPORT 1 +/* MPPE requires MSCHAP support */ +#undef MSCHAP_SUPPORT +#define MSCHAP_SUPPORT 1 +/* MSCHAP requires CHAP support */ +#undef CHAP_SUPPORT +#define CHAP_SUPPORT 1 +#endif /* MPPE_SUPPORT */ + +/** + * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef CBCP_SUPPORT +#define CBCP_SUPPORT 0 +#endif + +/** + * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef ECP_SUPPORT +#define ECP_SUPPORT 0 +#endif + +/** + * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef DEMAND_SUPPORT +#define DEMAND_SUPPORT 0 +#endif + +/** + * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets. + */ +#ifndef LQR_SUPPORT +#define LQR_SUPPORT 0 +#endif + +/** + * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). + * + * Currently only supported for PPPoS. + */ +#ifndef PPP_SERVER +#define PPP_SERVER 0 +#endif + +#if PPP_SERVER +/* + * PPP_OUR_NAME: Our name for authentication purposes + */ +#ifndef PPP_OUR_NAME +#define PPP_OUR_NAME "lwIP" +#endif +#endif /* PPP_SERVER */ + +/** + * VJ_SUPPORT==1: Support VJ header compression. + */ +#ifndef VJ_SUPPORT +#define VJ_SUPPORT 1 +#endif +/* VJ compression is only supported for TCP over IPv4 over PPPoS. */ +#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP +#undef VJ_SUPPORT +#define VJ_SUPPORT 0 +#endif /* !PPPOS_SUPPORT */ + +/** + * PPP_MD5_RANDM==1: Use MD5 for better randomness. + * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled. + */ +#ifndef PPP_MD5_RANDM +#define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT) +#endif + +/** + * PolarSSL embedded library + * + * + * lwIP contains some files fetched from the latest BSD release of + * the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption + * methods we need for lwIP PPP support. + * + * The PolarSSL files were cleaned to contain only the necessary struct + * fields and functions needed for lwIP. + * + * The PolarSSL API was not changed at all, so if you are already using + * PolarSSL you can choose to skip the compilation of the included PolarSSL + * library into lwIP. + * + * If you are not using the embedded copy you must include external + * libraries into your arch/cc.h port file. + * + * Beware of the stack requirements which can be a lot larger if you are not + * using our cleaned PolarSSL library. + */ + +/** + * LWIP_USE_EXTERNAL_POLARSSL: Use external PolarSSL library + */ +#ifndef LWIP_USE_EXTERNAL_POLARSSL +#define LWIP_USE_EXTERNAL_POLARSSL 0 +#endif + +/** + * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library + */ +#ifndef LWIP_USE_EXTERNAL_MBEDTLS +#define LWIP_USE_EXTERNAL_MBEDTLS 0 +#endif + +/* + * PPP Timeouts + */ + +/** + * FSM_DEFTIMEOUT: Timeout time in seconds + */ +#ifndef FSM_DEFTIMEOUT +#define FSM_DEFTIMEOUT 6 +#endif + +/** + * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions + */ +#ifndef FSM_DEFMAXTERMREQS +#define FSM_DEFMAXTERMREQS 2 +#endif + +/** + * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions + */ +#ifndef FSM_DEFMAXCONFREQS +#define FSM_DEFMAXCONFREQS 10 +#endif + +/** + * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops + */ +#ifndef FSM_DEFMAXNAKLOOPS +#define FSM_DEFMAXNAKLOOPS 5 +#endif + +/** + * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req + */ +#ifndef UPAP_DEFTIMEOUT +#define UPAP_DEFTIMEOUT 6 +#endif + +/** + * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send + */ +#ifndef UPAP_DEFTRANSMITS +#define UPAP_DEFTRANSMITS 10 +#endif + +#if PPP_SERVER +/** + * UPAP_DEFREQTIME: Time to wait for auth-req from peer + */ +#ifndef UPAP_DEFREQTIME +#define UPAP_DEFREQTIME 30 +#endif +#endif /* PPP_SERVER */ + +/** + * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req + */ +#ifndef CHAP_DEFTIMEOUT +#define CHAP_DEFTIMEOUT 6 +#endif + +/** + * CHAP_DEFTRANSMITS: max # times to send challenge + */ +#ifndef CHAP_DEFTRANSMITS +#define CHAP_DEFTRANSMITS 10 +#endif + +#if PPP_SERVER +/** + * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds + */ +#ifndef CHAP_DEFRECHALLENGETIME +#define CHAP_DEFRECHALLENGETIME 0 +#endif +#endif /* PPP_SERVER */ + +/** + * EAP_DEFREQTIME: Time to wait for peer request + */ +#ifndef EAP_DEFREQTIME +#define EAP_DEFREQTIME 6 +#endif + +/** + * EAP_DEFALLOWREQ: max # times to accept requests + */ +#ifndef EAP_DEFALLOWREQ +#define EAP_DEFALLOWREQ 10 +#endif + +#if PPP_SERVER +/** + * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit + */ +#ifndef EAP_DEFTIMEOUT +#define EAP_DEFTIMEOUT 6 +#endif + +/** + * EAP_DEFTRANSMITS: max # times to transmit + */ +#ifndef EAP_DEFTRANSMITS +#define EAP_DEFTRANSMITS 10 +#endif +#endif /* PPP_SERVER */ + +/** + * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer + * before deciding the link is looped-back. + */ +#ifndef LCP_DEFLOOPBACKFAIL +#define LCP_DEFLOOPBACKFAIL 10 +#endif + +/** + * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable. + */ +#ifndef LCP_ECHOINTERVAL +#define LCP_ECHOINTERVAL 0 +#endif + +/** + * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure. + */ +#ifndef LCP_MAXECHOFAILS +#define LCP_MAXECHOFAILS 3 +#endif + +/** + * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. + */ +#ifndef PPP_MAXIDLEFLAG +#define PPP_MAXIDLEFLAG 100 +#endif + +/** + * PPP Packet sizes + */ + +/** + * PPP_MRU: Default MRU + */ +#ifndef PPP_MRU +#define PPP_MRU 1500 +#endif + +/** + * PPP_DEFMRU: Default MRU to try + */ +#ifndef PPP_DEFMRU +#define PPP_DEFMRU 1500 +#endif + +/** + * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384) + */ +#ifndef PPP_MAXMRU +#define PPP_MAXMRU 1500 +#endif + +/** + * PPP_MINMRU: No MRUs below this + */ +#ifndef PPP_MINMRU +#define PPP_MINMRU 128 +#endif + +/** + * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP + * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8) + * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2) + */ +#if PPPOL2TP_SUPPORT +#ifndef PPPOL2TP_DEFMRU +#define PPPOL2TP_DEFMRU 1450 +#endif +#endif /* PPPOL2TP_SUPPORT */ + +/** + * MAXNAMELEN: max length of hostname or name for auth + */ +#ifndef MAXNAMELEN +#define MAXNAMELEN 256 +#endif + +/** + * MAXSECRETLEN: max length of password or secret + */ +#ifndef MAXSECRETLEN +#define MAXSECRETLEN 256 +#endif + +/* ------------------------------------------------------------------------- */ + +/* + * Build triggers for embedded PolarSSL + */ +#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS + +/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */ +#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM +#define LWIP_INCLUDED_POLARSSL_MD5 1 +#endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */ + +#if MSCHAP_SUPPORT + +/* MSCHAP require MD4 support */ +#define LWIP_INCLUDED_POLARSSL_MD4 1 +/* MSCHAP require SHA1 support */ +#define LWIP_INCLUDED_POLARSSL_SHA1 1 +/* MSCHAP require DES support */ +#define LWIP_INCLUDED_POLARSSL_DES 1 + +/* MS-CHAP support is required for MPPE */ +#if MPPE_SUPPORT +/* MPPE require ARC4 support */ +#define LWIP_INCLUDED_POLARSSL_ARC4 1 +#endif /* MPPE_SUPPORT */ + +#endif /* MSCHAP_SUPPORT */ + +#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */ + +/* Default value if unset */ +#ifndef LWIP_INCLUDED_POLARSSL_MD4 +#define LWIP_INCLUDED_POLARSSL_MD4 0 +#endif /* LWIP_INCLUDED_POLARSSL_MD4 */ +#ifndef LWIP_INCLUDED_POLARSSL_MD5 +#define LWIP_INCLUDED_POLARSSL_MD5 0 +#endif /* LWIP_INCLUDED_POLARSSL_MD5 */ +#ifndef LWIP_INCLUDED_POLARSSL_SHA1 +#define LWIP_INCLUDED_POLARSSL_SHA1 0 +#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ +#ifndef LWIP_INCLUDED_POLARSSL_DES +#define LWIP_INCLUDED_POLARSSL_DES 0 +#endif /* LWIP_INCLUDED_POLARSSL_DES */ +#ifndef LWIP_INCLUDED_POLARSSL_ARC4 +#define LWIP_INCLUDED_POLARSSL_ARC4 0 +#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ + +#endif /* PPP_SUPPORT */ + +#endif /* LWIP_PPP_OPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppapi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppapi.h new file mode 100644 index 0000000..913d93f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppapi.h @@ -0,0 +1,137 @@ +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#ifndef LWIP_PPPAPI_H +#define LWIP_PPPAPI_H + +#include "netif/ppp/ppp_opts.h" + +#if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/sys.h" +#include "lwip/netif.h" +#include "lwip/priv/tcpip_priv.h" +#include "netif/ppp/ppp.h" +#if PPPOS_SUPPORT +#include "netif/ppp/pppos.h" +#endif /* PPPOS_SUPPORT */ + +#ifdef __cplusplus +extern "C" { +#endif + +struct pppapi_msg_msg { + ppp_pcb *ppp; + union { +#if PPP_NOTIFY_PHASE + struct { + ppp_notify_phase_cb_fn notify_phase_cb; + } setnotifyphasecb; +#endif /* PPP_NOTIFY_PHASE */ +#if PPPOS_SUPPORT + struct { + struct netif *pppif; + pppos_output_cb_fn output_cb; + ppp_link_status_cb_fn link_status_cb; + void *ctx_cb; + } serialcreate; +#endif /* PPPOS_SUPPORT */ +#if PPPOE_SUPPORT + struct { + struct netif *pppif; + struct netif *ethif; + const char *service_name; + const char *concentrator_name; + ppp_link_status_cb_fn link_status_cb; + void *ctx_cb; + } ethernetcreate; +#endif /* PPPOE_SUPPORT */ +#if PPPOL2TP_SUPPORT + struct { + struct netif *pppif; + struct netif *netif; + API_MSG_M_DEF_C(ip_addr_t, ipaddr); + u16_t port; +#if PPPOL2TP_AUTH_SUPPORT + const u8_t *secret; + u8_t secret_len; +#endif /* PPPOL2TP_AUTH_SUPPORT */ + ppp_link_status_cb_fn link_status_cb; + void *ctx_cb; + } l2tpcreate; +#endif /* PPPOL2TP_SUPPORT */ + struct { + u16_t holdoff; + } connect; + struct { + u8_t nocarrier; + } close; + struct { + u8_t cmd; + void *arg; + } ioctl; + } msg; +}; + +struct pppapi_msg { + struct tcpip_api_call_data call; + struct pppapi_msg_msg msg; +}; + +/* API for application */ +err_t pppapi_set_default(ppp_pcb *pcb); +#if PPP_NOTIFY_PHASE +err_t pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); +#endif /* PPP_NOTIFY_PHASE */ +#if PPPOS_SUPPORT +ppp_pcb *pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb); +#endif /* PPPOS_SUPPORT */ +#if PPPOE_SUPPORT +ppp_pcb *pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name, + const char *concentrator_name, ppp_link_status_cb_fn link_status_cb, + void *ctx_cb); +#endif /* PPPOE_SUPPORT */ +#if PPPOL2TP_SUPPORT +ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port, + const u8_t *secret, u8_t secret_len, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); +#endif /* PPPOL2TP_SUPPORT */ +err_t pppapi_connect(ppp_pcb *pcb, u16_t holdoff); +#if PPP_SERVER +err_t pppapi_listen(ppp_pcb *pcb); +#endif /* PPP_SERVER */ +err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier); +err_t pppapi_free(ppp_pcb *pcb); +err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_PPP_API */ + +#endif /* LWIP_PPPAPI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h new file mode 100644 index 0000000..a7b2099 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h @@ -0,0 +1,136 @@ +/* + * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 + * + * Extracted from chap_ms.c by James Carlson. + * + * Copyright (c) 1995 Eric Rosenquist. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +/* This header file is included in all PPP modules needing hashes and/or ciphers */ + +#ifndef PPPCRYPT_H +#define PPPCRYPT_H + +/* + * If included PolarSSL copy is not used, user is expected to include + * external libraries in arch/cc.h (which is included by lwip/arch.h). + */ +#include "lwip/arch.h" + +/* + * Map hashes and ciphers functions to PolarSSL + */ +#if !LWIP_USE_EXTERNAL_MBEDTLS + +#include "netif/ppp/polarssl/md4.h" +#define lwip_md4_context md4_context +#define lwip_md4_init(context) +#define lwip_md4_starts md4_starts +#define lwip_md4_update md4_update +#define lwip_md4_finish md4_finish +#define lwip_md4_free(context) + +#include "netif/ppp/polarssl/md5.h" +#define lwip_md5_context md5_context +#define lwip_md5_init(context) +#define lwip_md5_starts md5_starts +#define lwip_md5_update md5_update +#define lwip_md5_finish md5_finish +#define lwip_md5_free(context) + +#include "netif/ppp/polarssl/sha1.h" +#define lwip_sha1_context sha1_context +#define lwip_sha1_init(context) +#define lwip_sha1_starts sha1_starts +#define lwip_sha1_update sha1_update +#define lwip_sha1_finish sha1_finish +#define lwip_sha1_free(context) + +#include "netif/ppp/polarssl/des.h" +#define lwip_des_context des_context +#define lwip_des_init(context) +#define lwip_des_setkey_enc des_setkey_enc +#define lwip_des_crypt_ecb des_crypt_ecb +#define lwip_des_free(context) + +#include "netif/ppp/polarssl/arc4.h" +#define lwip_arc4_context arc4_context +#define lwip_arc4_init(context) +#define lwip_arc4_setup arc4_setup +#define lwip_arc4_crypt arc4_crypt +#define lwip_arc4_free(context) + +#endif /* !LWIP_USE_EXTERNAL_MBEDTLS */ + +/* + * Map hashes and ciphers functions to mbed TLS + */ +#if LWIP_USE_EXTERNAL_MBEDTLS + +#define lwip_md4_context mbedtls_md4_context +#define lwip_md4_init mbedtls_md4_init +#define lwip_md4_starts mbedtls_md4_starts +#define lwip_md4_update mbedtls_md4_update +#define lwip_md4_finish mbedtls_md4_finish +#define lwip_md4_free mbedtls_md4_free + +#define lwip_md5_context mbedtls_md5_context +#define lwip_md5_init mbedtls_md5_init +#define lwip_md5_starts mbedtls_md5_starts +#define lwip_md5_update mbedtls_md5_update +#define lwip_md5_finish mbedtls_md5_finish +#define lwip_md5_free mbedtls_md5_free + +#define lwip_sha1_context mbedtls_sha1_context +#define lwip_sha1_init mbedtls_sha1_init +#define lwip_sha1_starts mbedtls_sha1_starts +#define lwip_sha1_update mbedtls_sha1_update +#define lwip_sha1_finish mbedtls_sha1_finish +#define lwip_sha1_free mbedtls_sha1_free + +#define lwip_des_context mbedtls_des_context +#define lwip_des_init mbedtls_des_init +#define lwip_des_setkey_enc mbedtls_des_setkey_enc +#define lwip_des_crypt_ecb mbedtls_des_crypt_ecb +#define lwip_des_free mbedtls_des_free + +#define lwip_arc4_context mbedtls_arc4_context +#define lwip_arc4_init mbedtls_arc4_init +#define lwip_arc4_setup mbedtls_arc4_setup +#define lwip_arc4_crypt(context, buffer, length) mbedtls_arc4_crypt(context, length, buffer, buffer) +#define lwip_arc4_free mbedtls_arc4_free + +#endif /* LWIP_USE_EXTERNAL_MBEDTLS */ + +void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key); + +#endif /* PPPCRYPT_H */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppdebug.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppdebug.h new file mode 100644 index 0000000..7ead045 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppdebug.h @@ -0,0 +1,80 @@ +/***************************************************************************** +* pppdebug.h - System debugging utilities. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* portions Copyright (c) 1998 Global Election Systems Inc. +* portions Copyright (c) 2001 by Cognizant Pty Ltd. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY (please don't use tabs!) +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 98-07-29 Guy Lancaster , Global Election Systems Inc. +* Original. +* +***************************************************************************** +*/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPPDEBUG_H +#define PPPDEBUG_H + +/* Trace levels. */ +#define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) +#define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) +#define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) +#define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) +#define LOG_INFO (PPP_DEBUG) +#define LOG_DETAIL (PPP_DEBUG) +#define LOG_DEBUG (PPP_DEBUG) + +#if PPP_DEBUG + +#define MAINDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define SYSDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define FSMDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define LCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define IPCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define IPV6CPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define UPAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define CHAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) +#define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) + +#else /* PPP_DEBUG */ + +#define MAINDEBUG(a) +#define SYSDEBUG(a) +#define FSMDEBUG(a) +#define LCPDEBUG(a) +#define IPCPDEBUG(a) +#define IPV6CPDEBUG(a) +#define UPAPDEBUG(a) +#define CHAPDEBUG(a) +#define PPPDEBUG(a, b) + +#endif /* PPP_DEBUG */ + +#endif /* PPPDEBUG_H */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppoe.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppoe.h new file mode 100644 index 0000000..9f8f289 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppoe.h @@ -0,0 +1,179 @@ +/***************************************************************************** +* pppoe.h - PPP Over Ethernet implementation for lwIP. +* +* Copyright (c) 2006 by Marc Boucher, Services Informatiques (MBSI) inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 06-01-01 Marc Boucher +* Ported to lwIP. +*****************************************************************************/ + + + +/* based on NetBSD: if_pppoe.c,v 1.64 2006/01/31 23:50:15 martin Exp */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Martin Husemann . + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOE_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPP_OE_H +#define PPP_OE_H + +#include "ppp.h" +#include "lwip/etharp.h" + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct pppoehdr { + PACK_STRUCT_FLD_8(u8_t vertype); + PACK_STRUCT_FLD_8(u8_t code); + PACK_STRUCT_FIELD(u16_t session); + PACK_STRUCT_FIELD(u16_t plen); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct pppoetag { + PACK_STRUCT_FIELD(u16_t tag); + PACK_STRUCT_FIELD(u16_t len); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + + +#define PPPOE_STATE_INITIAL 0 +#define PPPOE_STATE_PADI_SENT 1 +#define PPPOE_STATE_PADR_SENT 2 +#define PPPOE_STATE_SESSION 3 +/* passive */ +#define PPPOE_STATE_PADO_SENT 1 + +#define PPPOE_HEADERLEN sizeof(struct pppoehdr) +#define PPPOE_VERTYPE 0x11 /* VER=1, TYPE = 1 */ + +#define PPPOE_TAG_EOL 0x0000 /* end of list */ +#define PPPOE_TAG_SNAME 0x0101 /* service name */ +#define PPPOE_TAG_ACNAME 0x0102 /* access concentrator name */ +#define PPPOE_TAG_HUNIQUE 0x0103 /* host unique */ +#define PPPOE_TAG_ACCOOKIE 0x0104 /* AC cookie */ +#define PPPOE_TAG_VENDOR 0x0105 /* vendor specific */ +#define PPPOE_TAG_RELAYSID 0x0110 /* relay session id */ +#define PPPOE_TAG_SNAME_ERR 0x0201 /* service name error */ +#define PPPOE_TAG_ACSYS_ERR 0x0202 /* AC system error */ +#define PPPOE_TAG_GENERIC_ERR 0x0203 /* gerneric error */ + +#define PPPOE_CODE_PADI 0x09 /* Active Discovery Initiation */ +#define PPPOE_CODE_PADO 0x07 /* Active Discovery Offer */ +#define PPPOE_CODE_PADR 0x19 /* Active Discovery Request */ +#define PPPOE_CODE_PADS 0x65 /* Active Discovery Session confirmation */ +#define PPPOE_CODE_PADT 0xA7 /* Active Discovery Terminate */ + +#ifndef PPPOE_MAX_AC_COOKIE_LEN +#define PPPOE_MAX_AC_COOKIE_LEN 64 +#endif + +struct pppoe_softc { + struct pppoe_softc *next; + struct netif *sc_ethif; /* ethernet interface we are using */ + ppp_pcb *pcb; /* PPP PCB */ + + struct eth_addr sc_dest; /* hardware address of concentrator */ + u16_t sc_session; /* PPPoE session id */ + u8_t sc_state; /* discovery phase or session connected */ + +#ifdef PPPOE_TODO + u8_t *sc_service_name; /* if != NULL: requested name of service */ + u8_t *sc_concentrator_name; /* if != NULL: requested concentrator id */ +#endif /* PPPOE_TODO */ + u8_t sc_ac_cookie[PPPOE_MAX_AC_COOKIE_LEN]; /* content of AC cookie we must echo back */ + u8_t sc_ac_cookie_len; /* length of cookie data */ +#ifdef PPPOE_SERVER + u8_t *sc_hunique; /* content of host unique we must echo back */ + u8_t sc_hunique_len; /* length of host unique */ +#endif + u8_t sc_padi_retried; /* number of PADI retries already done */ + u8_t sc_padr_retried; /* number of PADR retries already done */ +}; + + +#define pppoe_init() /* compatibility define, no initialization needed */ + +ppp_pcb *pppoe_create(struct netif *pppif, + struct netif *ethif, + const char *service_name, const char *concentrator_name, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + +/* + * Functions called from lwIP + * DO NOT CALL FROM lwIP USER APPLICATION. + */ +void pppoe_disc_input(struct netif *netif, struct pbuf *p); +void pppoe_data_input(struct netif *netif, struct pbuf *p); + +#endif /* PPP_OE_H */ + +#endif /* PPP_SUPPORT && PPPOE_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppol2tp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppol2tp.h new file mode 100644 index 0000000..f03950e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppol2tp.h @@ -0,0 +1,201 @@ +/** + * @file + * Network Point to Point Protocol over Layer 2 Tunneling Protocol header file. + * + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOL2TP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPPOL2TP_H +#define PPPOL2TP_H + +#include "ppp.h" + +/* Timeout */ +#define PPPOL2TP_CONTROL_TIMEOUT (5*1000) /* base for quick timeout calculation */ +#define PPPOL2TP_SLOW_RETRY (60*1000) /* persistent retry interval */ + +#define PPPOL2TP_MAXSCCRQ 4 /* retry SCCRQ four times (quickly) */ +#define PPPOL2TP_MAXICRQ 4 /* retry IRCQ four times */ +#define PPPOL2TP_MAXICCN 4 /* retry ICCN four times */ + +/* L2TP header flags */ +#define PPPOL2TP_HEADERFLAG_CONTROL 0x8000 +#define PPPOL2TP_HEADERFLAG_LENGTH 0x4000 +#define PPPOL2TP_HEADERFLAG_SEQUENCE 0x0800 +#define PPPOL2TP_HEADERFLAG_OFFSET 0x0200 +#define PPPOL2TP_HEADERFLAG_PRIORITY 0x0100 +#define PPPOL2TP_HEADERFLAG_VERSION 0x0002 + +/* Mandatory bits for control: Control, Length, Sequence, Version 2 */ +#define PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY (PPPOL2TP_HEADERFLAG_CONTROL|PPPOL2TP_HEADERFLAG_LENGTH|PPPOL2TP_HEADERFLAG_SEQUENCE|PPPOL2TP_HEADERFLAG_VERSION) +/* Forbidden bits for control: Offset, Priority */ +#define PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN (PPPOL2TP_HEADERFLAG_OFFSET|PPPOL2TP_HEADERFLAG_PRIORITY) + +/* Mandatory bits for data: Version 2 */ +#define PPPOL2TP_HEADERFLAG_DATA_MANDATORY (PPPOL2TP_HEADERFLAG_VERSION) + +/* AVP (Attribute Value Pair) header */ +#define PPPOL2TP_AVPHEADERFLAG_MANDATORY 0x8000 +#define PPPOL2TP_AVPHEADERFLAG_HIDDEN 0x4000 +#define PPPOL2TP_AVPHEADERFLAG_LENGTHMASK 0x03ff + +/* -- AVP - Message type */ +#define PPPOL2TP_AVPTYPE_MESSAGE 0 /* Message type */ + +/* Control Connection Management */ +#define PPPOL2TP_MESSAGETYPE_SCCRQ 1 /* Start Control Connection Request */ +#define PPPOL2TP_MESSAGETYPE_SCCRP 2 /* Start Control Connection Reply */ +#define PPPOL2TP_MESSAGETYPE_SCCCN 3 /* Start Control Connection Connected */ +#define PPPOL2TP_MESSAGETYPE_STOPCCN 4 /* Stop Control Connection Notification */ +#define PPPOL2TP_MESSAGETYPE_HELLO 6 /* Hello */ +/* Call Management */ +#define PPPOL2TP_MESSAGETYPE_OCRQ 7 /* Outgoing Call Request */ +#define PPPOL2TP_MESSAGETYPE_OCRP 8 /* Outgoing Call Reply */ +#define PPPOL2TP_MESSAGETYPE_OCCN 9 /* Outgoing Call Connected */ +#define PPPOL2TP_MESSAGETYPE_ICRQ 10 /* Incoming Call Request */ +#define PPPOL2TP_MESSAGETYPE_ICRP 11 /* Incoming Call Reply */ +#define PPPOL2TP_MESSAGETYPE_ICCN 12 /* Incoming Call Connected */ +#define PPPOL2TP_MESSAGETYPE_CDN 14 /* Call Disconnect Notify */ +/* Error reporting */ +#define PPPOL2TP_MESSAGETYPE_WEN 15 /* WAN Error Notify */ +/* PPP Session Control */ +#define PPPOL2TP_MESSAGETYPE_SLI 16 /* Set Link Info */ + +/* -- AVP - Result code */ +#define PPPOL2TP_AVPTYPE_RESULTCODE 1 /* Result code */ +#define PPPOL2TP_RESULTCODE 1 /* General request to clear control connection */ + +/* -- AVP - Protocol version (!= L2TP Header version) */ +#define PPPOL2TP_AVPTYPE_VERSION 2 +#define PPPOL2TP_VERSION 0x0100 /* L2TP Protocol version 1, revision 0 */ + +/* -- AVP - Framing capabilities */ +#define PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES 3 /* Bearer capabilities */ +#define PPPOL2TP_FRAMINGCAPABILITIES 0x00000003 /* Async + Sync framing */ + +/* -- AVP - Bearer capabilities */ +#define PPPOL2TP_AVPTYPE_BEARERCAPABILITIES 4 /* Bearer capabilities */ +#define PPPOL2TP_BEARERCAPABILITIES 0x00000003 /* Analog + Digital Access */ + +/* -- AVP - Tie breaker */ +#define PPPOL2TP_AVPTYPE_TIEBREAKER 5 + +/* -- AVP - Host name */ +#define PPPOL2TP_AVPTYPE_HOSTNAME 7 /* Host name */ +#define PPPOL2TP_HOSTNAME "lwIP" /* FIXME: make it configurable */ + +/* -- AVP - Vendor name */ +#define PPPOL2TP_AVPTYPE_VENDORNAME 8 /* Vendor name */ +#define PPPOL2TP_VENDORNAME "lwIP" /* FIXME: make it configurable */ + +/* -- AVP - Assign tunnel ID */ +#define PPPOL2TP_AVPTYPE_TUNNELID 9 /* Assign Tunnel ID */ + +/* -- AVP - Receive window size */ +#define PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE 10 /* Receive window size */ +#define PPPOL2TP_RECEIVEWINDOWSIZE 8 /* FIXME: make it configurable */ + +/* -- AVP - Challenge */ +#define PPPOL2TP_AVPTYPE_CHALLENGE 11 /* Challenge */ + +/* -- AVP - Cause code */ +#define PPPOL2TP_AVPTYPE_CAUSECODE 12 /* Cause code*/ + +/* -- AVP - Challenge response */ +#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE 13 /* Challenge response */ +#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE 16 + +/* -- AVP - Assign session ID */ +#define PPPOL2TP_AVPTYPE_SESSIONID 14 /* Assign Session ID */ + +/* -- AVP - Call serial number */ +#define PPPOL2TP_AVPTYPE_CALLSERIALNUMBER 15 /* Call Serial Number */ + +/* -- AVP - Framing type */ +#define PPPOL2TP_AVPTYPE_FRAMINGTYPE 19 /* Framing Type */ +#define PPPOL2TP_FRAMINGTYPE 0x00000001 /* Sync framing */ + +/* -- AVP - TX Connect Speed */ +#define PPPOL2TP_AVPTYPE_TXCONNECTSPEED 24 /* TX Connect Speed */ +#define PPPOL2TP_TXCONNECTSPEED 100000000 /* Connect speed: 100 Mbits/s */ + +/* L2TP Session state */ +#define PPPOL2TP_STATE_INITIAL 0 +#define PPPOL2TP_STATE_SCCRQ_SENT 1 +#define PPPOL2TP_STATE_ICRQ_SENT 2 +#define PPPOL2TP_STATE_ICCN_SENT 3 +#define PPPOL2TP_STATE_DATA 4 + +#define PPPOL2TP_OUTPUT_DATA_HEADER_LEN 6 /* Our data header len */ + +/* + * PPPoL2TP interface control block. + */ +typedef struct pppol2tp_pcb_s pppol2tp_pcb; +struct pppol2tp_pcb_s { + ppp_pcb *ppp; /* PPP PCB */ + u8_t phase; /* L2TP phase */ + struct udp_pcb *udp; /* UDP L2TP Socket */ + struct netif *netif; /* Output interface, used as a default route */ + ip_addr_t remote_ip; /* LNS IP Address */ + u16_t remote_port; /* LNS port */ +#if PPPOL2TP_AUTH_SUPPORT + const u8_t *secret; /* Secret string */ + u8_t secret_len; /* Secret string length */ + u8_t secret_rv[16]; /* Random vector */ + u8_t challenge_hash[16]; /* Challenge response */ + u8_t send_challenge; /* Boolean whether the next sent packet should contains a challenge response */ +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + u16_t tunnel_port; /* Tunnel port */ + u16_t our_ns; /* NS to peer */ + u16_t peer_nr; /* NR from peer */ + u16_t peer_ns; /* NS from peer */ + u16_t source_tunnel_id; /* Tunnel ID assigned by peer */ + u16_t remote_tunnel_id; /* Tunnel ID assigned to peer */ + u16_t source_session_id; /* Session ID assigned by peer */ + u16_t remote_session_id; /* Session ID assigned to peer */ + + u8_t sccrq_retried; /* number of SCCRQ retries already done */ + u8_t icrq_retried; /* number of ICRQ retries already done */ + u8_t iccn_retried; /* number of ICCN retries already done */ +}; + + +/* Create a new L2TP session. */ +ppp_pcb *pppol2tp_create(struct netif *pppif, + struct netif *netif, const ip_addr_t *ipaddr, u16_t port, + const u8_t *secret, u8_t secret_len, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + +#endif /* PPPOL2TP_H */ +#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppos.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppos.h new file mode 100644 index 0000000..d924a9f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/pppos.h @@ -0,0 +1,118 @@ +/** + * @file + * Network Point to Point Protocol over Serial header file. + * + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOS_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPPOS_H +#define PPPOS_H + +#include "lwip/sys.h" + +#include "ppp.h" +#include "vj.h" + +/* PPP packet parser states. Current state indicates operation yet to be + * completed. */ +enum { + PDIDLE = 0, /* Idle state - waiting. */ + PDSTART, /* Process start flag. */ + PDADDRESS, /* Process address field. */ + PDCONTROL, /* Process control field. */ + PDPROTOCOL1, /* Process protocol field 1. */ + PDPROTOCOL2, /* Process protocol field 2. */ + PDDATA /* Process data byte. */ +}; + +/* PPPoS serial output callback function prototype */ +typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx); + +/* + * Extended asyncmap - allows any character to be escaped. + */ +typedef u8_t ext_accm[32]; + +/* + * PPPoS interface control block. + */ +typedef struct pppos_pcb_s pppos_pcb; +struct pppos_pcb_s { + /* -- below are data that will NOT be cleared between two sessions */ + ppp_pcb *ppp; /* PPP PCB */ + pppos_output_cb_fn output_cb; /* PPP serial output callback */ + + /* -- below are data that will be cleared between two sessions + * + * last_xmit must be the first member of cleared members, because it is + * used to know which part must not be cleared. + */ + u32_t last_xmit; /* Time of last transmission. */ + ext_accm out_accm; /* Async-Ctl-Char-Map for output. */ + + /* flags */ + unsigned int open :1; /* Set if PPPoS is open */ + unsigned int pcomp :1; /* Does peer accept protocol compression? */ + unsigned int accomp :1; /* Does peer accept addr/ctl compression? */ + + /* PPPoS rx */ + ext_accm in_accm; /* Async-Ctl-Char-Map for input. */ + struct pbuf *in_head, *in_tail; /* The input packet. */ + u16_t in_protocol; /* The input protocol code. */ + u16_t in_fcs; /* Input Frame Check Sequence value. */ + u8_t in_state; /* The input process state. */ + u8_t in_escaped; /* Escape next character. */ +}; + +/* Create a new PPPoS session. */ +ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + +#if !NO_SYS && !PPP_INPROC_IRQ_SAFE +/* Pass received raw characters to PPPoS to be decoded through lwIP TCPIP thread. */ +err_t pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l); +#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ + +/* PPP over Serial: this is the input function to be called for received data. */ +void pppos_input(ppp_pcb *ppp, u8_t* data, int len); + + +/* + * Functions called from lwIP + * DO NOT CALL FROM lwIP USER APPLICATION. + */ +#if !NO_SYS && !PPP_INPROC_IRQ_SAFE +err_t pppos_input_sys(struct pbuf *p, struct netif *inp); +#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ + +#endif /* PPPOS_H */ +#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/upap.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/upap.h new file mode 100644 index 0000000..7da792e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/upap.h @@ -0,0 +1,123 @@ +/* + * upap.h - User/Password Authentication Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: upap.h,v 1.8 2002/12/04 23:03:33 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef UPAP_H +#define UPAP_H + +#include "ppp.h" + +/* + * Packet header = Code, id, length. + */ +#define UPAP_HEADERLEN 4 + + +/* + * UPAP codes. + */ +#define UPAP_AUTHREQ 1 /* Authenticate-Request */ +#define UPAP_AUTHACK 2 /* Authenticate-Ack */ +#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ + + +/* + * Client states. + */ +#define UPAPCS_INITIAL 0 /* Connection down */ +#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ +#define UPAPCS_OPEN 4 /* We've received an Ack */ +#define UPAPCS_BADAUTH 5 /* We've received a Nak */ + +/* + * Server states. + */ +#define UPAPSS_INITIAL 0 /* Connection down */ +#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ +#define UPAPSS_OPEN 4 /* We've sent an Ack */ +#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ + + +/* + * Timeouts. + */ +#if 0 /* moved to ppp_opts.h */ +#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ +#endif /* moved to ppp_opts.h */ + +/* + * Each interface is described by upap structure. + */ +#if PAP_SUPPORT +typedef struct upap_state { + const char *us_user; /* User */ + u8_t us_userlen; /* User length */ + const char *us_passwd; /* Password */ + u8_t us_passwdlen; /* Password length */ + u8_t us_clientstate; /* Client state */ +#if PPP_SERVER + u8_t us_serverstate; /* Server state */ +#endif /* PPP_SERVER */ + u8_t us_id; /* Current id */ + u8_t us_transmits; /* Number of auth-reqs sent */ +} upap_state; +#endif /* PAP_SUPPORT */ + + +void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password); +#if PPP_SERVER +void upap_authpeer(ppp_pcb *pcb); +#endif /* PPP_SERVER */ + +extern const struct protent pap_protent; + +#endif /* UPAP_H */ +#endif /* PPP_SUPPORT && PAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/vj.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/vj.h new file mode 100644 index 0000000..7f389c8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/ppp/vj.h @@ -0,0 +1,161 @@ +/* + * Definitions for tcp compression routines. + * + * $Id: vj.h,v 1.7 2010/02/22 17:52:09 goldsimon Exp $ + * + * Copyright (c) 1989 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: + * - Initial distribution. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef VJ_H +#define VJ_H + +#include "lwip/ip.h" +#include "lwip/priv/tcp_priv.h" + +#define MAX_SLOTS 16 /* must be > 2 and < 256 */ +#define MAX_HDR 128 + +/* + * Compressed packet format: + * + * The first octet contains the packet type (top 3 bits), TCP + * 'push' bit, and flags that indicate which of the 4 TCP sequence + * numbers have changed (bottom 5 bits). The next octet is a + * conversation number that associates a saved IP/TCP header with + * the compressed packet. The next two octets are the TCP checksum + * from the original datagram. The next 0 to 15 octets are + * sequence number changes, one change per bit set in the header + * (there may be no changes and there are two special cases where + * the receiver implicitly knows what changed -- see below). + * + * There are 5 numbers which can change (they are always inserted + * in the following order): TCP urgent pointer, window, + * acknowlegement, sequence number and IP ID. (The urgent pointer + * is different from the others in that its value is sent, not the + * change in value.) Since typical use of SLIP links is biased + * toward small packets (see comments on MTU/MSS below), changes + * use a variable length coding with one octet for numbers in the + * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the + * range 256 - 65535 or 0. (If the change in sequence number or + * ack is more than 65535, an uncompressed packet is sent.) + */ + +/* + * Packet types (must not conflict with IP protocol version) + * + * The top nibble of the first octet is the packet type. There are + * three possible types: IP (not proto TCP or tcp with one of the + * control flags set); uncompressed TCP (a normal IP/TCP packet but + * with the 8-bit protocol field replaced by an 8-bit connection id -- + * this type of packet syncs the sender & receiver); and compressed + * TCP (described above). + * + * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and + * is logically part of the 4-bit "changes" field that follows. Top + * three bits are actual packet type. For backward compatibility + * and in the interest of conserving bits, numbers are chosen so the + * IP protocol version number (4) which normally appears in this nibble + * means "IP packet". + */ + +/* packet types */ +#define TYPE_IP 0x40 +#define TYPE_UNCOMPRESSED_TCP 0x70 +#define TYPE_COMPRESSED_TCP 0x80 +#define TYPE_ERROR 0x00 + +/* Bits in first octet of compressed packet */ +#define NEW_C 0x40 /* flag bits for what changed in a packet */ +#define NEW_I 0x20 +#define NEW_S 0x08 +#define NEW_A 0x04 +#define NEW_W 0x02 +#define NEW_U 0x01 + +/* reserved, special-case values of above */ +#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ +#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ +#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) + +#define TCP_PUSH_BIT 0x10 + + +/* + * "state" data for each active tcp conversation on the wire. This is + * basically a copy of the entire IP/TCP header from the last packet + * we saw from the conversation together with a small identifier + * the transmit & receive ends of the line use to locate saved header. + */ +struct cstate { + struct cstate *cs_next; /* next most recently used state (xmit only) */ + u16_t cs_hlen; /* size of hdr (receive only) */ + u8_t cs_id; /* connection # associated with this state */ + u8_t cs_filler; + union { + char csu_hdr[MAX_HDR]; + struct ip_hdr csu_ip; /* ip/tcp hdr from most recent packet */ + } vjcs_u; +}; +#define cs_ip vjcs_u.csu_ip +#define cs_hdr vjcs_u.csu_hdr + + +struct vjstat { + u32_t vjs_packets; /* outbound packets */ + u32_t vjs_compressed; /* outbound compressed packets */ + u32_t vjs_searches; /* searches for connection state */ + u32_t vjs_misses; /* times couldn't find conn. state */ + u32_t vjs_uncompressedin; /* inbound uncompressed packets */ + u32_t vjs_compressedin; /* inbound compressed packets */ + u32_t vjs_errorin; /* inbound unknown type packets */ + u32_t vjs_tossed; /* inbound packets tossed because of error */ +}; + +/* + * all the state data for one serial line (we need one of these per line). + */ +struct vjcompress { + struct cstate *last_cs; /* most recently used tstate */ + u8_t last_recv; /* last rcvd conn. id */ + u8_t last_xmit; /* last sent conn. id */ + u16_t flags; + u8_t maxSlotIndex; + u8_t compressSlot; /* Flag indicating OK to compress slot ID. */ +#if LINK_STATS + struct vjstat stats; +#endif + struct cstate tstate[MAX_SLOTS]; /* xmit connection states */ + struct cstate rstate[MAX_SLOTS]; /* receive connection states */ +}; + +/* flag values */ +#define VJF_TOSS 1U /* tossing rcvd frames because of input err */ + +extern void vj_compress_init (struct vjcompress *comp); +extern u8_t vj_compress_tcp (struct vjcompress *comp, struct pbuf **pb); +extern void vj_uncompress_err (struct vjcompress *comp); +extern int vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp); +extern int vj_uncompress_tcp (struct pbuf **nb, struct vjcompress *comp); + +#endif /* VJ_H */ + +#endif /* PPP_SUPPORT && VJ_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/slipif.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/slipif.h new file mode 100644 index 0000000..65ba31f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/netif/slipif.h @@ -0,0 +1,87 @@ +/** + * @file + * + * SLIP netif API + */ + +/* + * Copyright (c) 2001, Swedish Institute of Computer Science. + * 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 Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef LWIP_HDR_NETIF_SLIPIF_H +#define LWIP_HDR_NETIF_SLIPIF_H + +#include "lwip/opt.h" +#include "lwip/netif.h" + +/** Set this to 1 to start a thread that blocks reading on the serial line + * (using sio_read()). + */ +#ifndef SLIP_USE_RX_THREAD +#define SLIP_USE_RX_THREAD !NO_SYS +#endif + +/** Set this to 1 to enable functions to pass in RX bytes from ISR context. + * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled + * packets on a queue, which is fed into lwIP from slipif_poll(). + * If disabled, slipif_poll() polls the serial line (using sio_tryread()). + */ +#ifndef SLIP_RX_FROM_ISR +#define SLIP_RX_FROM_ISR 0 +#endif + +/** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets + * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. + * If disabled, packets will be dropped if more than one packet is received. + */ +#ifndef SLIP_RX_QUEUE +#define SLIP_RX_QUEUE SLIP_RX_FROM_ISR +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +err_t slipif_init(struct netif * netif); +void slipif_poll(struct netif *netif); +#if SLIP_RX_FROM_ISR +void slipif_process_rxqueue(struct netif *netif); +void slipif_received_byte(struct netif *netif, u8_t data); +void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); +#endif /* SLIP_RX_FROM_ISR */ + +#ifdef __cplusplus +} +#endif + +#endif /* LWIP_HDR_NETIF_SLIPIF_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/errno.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/errno.h new file mode 100644 index 0000000..5917c75 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/errno.h @@ -0,0 +1,33 @@ +/** + * @file + * This file is a posix wrapper for lwip/errno.h. + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/errno.h" diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/netdb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/netdb.h new file mode 100644 index 0000000..12d4c7f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/netdb.h @@ -0,0 +1,33 @@ +/** + * @file + * This file is a posix wrapper for lwip/netdb.h. + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/netdb.h" diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/sys/socket.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/sys/socket.h new file mode 100644 index 0000000..0ed9baf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/include/posix/sys/socket.h @@ -0,0 +1,33 @@ +/** + * @file + * This file is a posix wrapper for lwip/sockets.h. + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/sockets.h" diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/FILES b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/FILES new file mode 100644 index 0000000..a3ff431 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/FILES @@ -0,0 +1,24 @@ +This directory contains generic network interface device drivers that +do not contain any hardware or architecture specific code. The files +are: + +ethernet.c + Shared code for Ethernet based interfaces. + +ethernetif.c + An example of how an Ethernet device driver could look. This + file can be used as a "skeleton" for developing new Ethernet + network device drivers. It uses the etharp.c ARP code. + +lowpan6.c + A 6LoWPAN implementation as a netif. + +slipif.c + A generic implementation of the SLIP (Serial Line IP) + protocol. It requires a sio (serial I/O) module to work. + +ppp/ Point-to-Point Protocol stack + The lwIP PPP support is based from pppd (http://ppp.samba.org) with + huge changes to match code size and memory requirements for embedded + devices. Please read /doc/ppp.txt and ppp/PPPD_FOLLOWUP for a detailed + explanation. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernet.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernet.c new file mode 100644 index 0000000..52ea423 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernet.c @@ -0,0 +1,314 @@ +/** + * @file + * Ethernet common functions + * + * @defgroup ethernet Ethernet + * @ingroup callbackstyle_api + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2003-2004 Leon Woestenberg + * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "lwip/opt.h" + +#if LWIP_ARP || LWIP_ETHERNET + +#include "netif/ethernet.h" +#include "lwip/def.h" +#include "lwip/stats.h" +#include "lwip/etharp.h" +#include "lwip/ip.h" +#include "lwip/snmp.h" + +#include + +#include "netif/ppp/ppp_opts.h" +#if PPPOE_SUPPORT +#include "netif/ppp/pppoe.h" +#endif /* PPPOE_SUPPORT */ + +#ifdef LWIP_HOOK_FILENAME +#include LWIP_HOOK_FILENAME +#endif + +const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}}; +const struct eth_addr ethzero = {{0,0,0,0,0,0}}; + +/** + * @ingroup lwip_nosys + * Process received ethernet frames. Using this function instead of directly + * calling ip_input and passing ARP frames through etharp in ethernetif_input, + * the ARP cache is protected from concurrent access.\n + * Don't call directly, pass to netif_add() and call netif->input(). + * + * @param p the received packet, p->payload pointing to the ethernet header + * @param netif the network interface on which the packet was received + * + * @see LWIP_HOOK_UNKNOWN_ETH_PROTOCOL + * @see ETHARP_SUPPORT_VLAN + * @see LWIP_HOOK_VLAN_CHECK + */ +err_t +ethernet_input(struct pbuf *p, struct netif *netif) +{ + struct eth_hdr* ethhdr; + u16_t type; +#if LWIP_ARP || ETHARP_SUPPORT_VLAN || LWIP_IPV6 + s16_t ip_hdr_offset = SIZEOF_ETH_HDR; +#endif /* LWIP_ARP || ETHARP_SUPPORT_VLAN */ + + if (p->len <= SIZEOF_ETH_HDR) { + /* a packet with only an ethernet header (or less) is not valid for us */ + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + MIB2_STATS_NETIF_INC(netif, ifinerrors); + goto free_and_return; + } + + /* points to packet payload, which starts with an Ethernet header */ + ethhdr = (struct eth_hdr *)p->payload; + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, + ("ethernet_input: dest:%"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F", src:%"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F":%"X8_F", type:%"X16_F"\n", + (unsigned)ethhdr->dest.addr[0], (unsigned)ethhdr->dest.addr[1], (unsigned)ethhdr->dest.addr[2], + (unsigned)ethhdr->dest.addr[3], (unsigned)ethhdr->dest.addr[4], (unsigned)ethhdr->dest.addr[5], + (unsigned)ethhdr->src.addr[0], (unsigned)ethhdr->src.addr[1], (unsigned)ethhdr->src.addr[2], + (unsigned)ethhdr->src.addr[3], (unsigned)ethhdr->src.addr[4], (unsigned)ethhdr->src.addr[5], + lwip_htons(ethhdr->type))); + + type = ethhdr->type; +#if ETHARP_SUPPORT_VLAN + if (type == PP_HTONS(ETHTYPE_VLAN)) { + struct eth_vlan_hdr *vlan = (struct eth_vlan_hdr*)(((char*)ethhdr) + SIZEOF_ETH_HDR); + if (p->len <= SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR) { + /* a packet with only an ethernet/vlan header (or less) is not valid for us */ + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + MIB2_STATS_NETIF_INC(netif, ifinerrors); + goto free_and_return; + } +#if defined(LWIP_HOOK_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK_FN) /* if not, allow all VLANs */ +#ifdef LWIP_HOOK_VLAN_CHECK + if (!LWIP_HOOK_VLAN_CHECK(netif, ethhdr, vlan)) { +#elif defined(ETHARP_VLAN_CHECK_FN) + if (!ETHARP_VLAN_CHECK_FN(ethhdr, vlan)) { +#elif defined(ETHARP_VLAN_CHECK) + if (VLAN_ID(vlan) != ETHARP_VLAN_CHECK) { +#endif + /* silently ignore this packet: not for our VLAN */ + pbuf_free(p); + return ERR_OK; + } +#endif /* defined(LWIP_HOOK_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK_FN) */ + type = vlan->tpid; + ip_hdr_offset = SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR; + } +#endif /* ETHARP_SUPPORT_VLAN */ + +#if LWIP_ARP_FILTER_NETIF + netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, lwip_htons(type)); +#endif /* LWIP_ARP_FILTER_NETIF*/ + + if (ethhdr->dest.addr[0] & 1) { + /* this might be a multicast or broadcast packet */ + if (ethhdr->dest.addr[0] == LL_IP4_MULTICAST_ADDR_0) { +#if LWIP_IPV4 + if ((ethhdr->dest.addr[1] == LL_IP4_MULTICAST_ADDR_1) && + (ethhdr->dest.addr[2] == LL_IP4_MULTICAST_ADDR_2)) { + /* mark the pbuf as link-layer multicast */ + p->flags |= PBUF_FLAG_LLMCAST; + } +#endif /* LWIP_IPV4 */ + } +#if LWIP_IPV6 + else if ((ethhdr->dest.addr[0] == LL_IP6_MULTICAST_ADDR_0) && + (ethhdr->dest.addr[1] == LL_IP6_MULTICAST_ADDR_1)) { + /* mark the pbuf as link-layer multicast */ + p->flags |= PBUF_FLAG_LLMCAST; + } +#endif /* LWIP_IPV6 */ + else if (eth_addr_cmp(ðhdr->dest, ðbroadcast)) { + /* mark the pbuf as link-layer broadcast */ + p->flags |= PBUF_FLAG_LLBCAST; + } + } + + switch (type) { +#if LWIP_IPV4 && LWIP_ARP + /* IP packet? */ + case PP_HTONS(ETHTYPE_IP): + if (!(netif->flags & NETIF_FLAG_ETHARP)) { + goto free_and_return; + } + /* skip Ethernet header */ + if ((p->len < ip_hdr_offset) || pbuf_header(p, (s16_t)-ip_hdr_offset)) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("ethernet_input: IPv4 packet dropped, too short (%"S16_F"/%"S16_F")\n", + p->tot_len, ip_hdr_offset)); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("Can't move over header in packet")); + goto free_and_return; + } else { + /* pass to IP layer */ + ip4_input(p, netif); + } + break; + + case PP_HTONS(ETHTYPE_ARP): + if (!(netif->flags & NETIF_FLAG_ETHARP)) { + goto free_and_return; + } + /* skip Ethernet header */ + if ((p->len < ip_hdr_offset) || pbuf_header(p, (s16_t)-ip_hdr_offset)) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("ethernet_input: ARP response packet dropped, too short (%"S16_F"/%"S16_F")\n", + p->tot_len, ip_hdr_offset)); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("Can't move over header in packet")); + ETHARP_STATS_INC(etharp.lenerr); + ETHARP_STATS_INC(etharp.drop); + goto free_and_return; + } else { + /* pass p to ARP module */ + etharp_input(p, netif); + } + break; +#endif /* LWIP_IPV4 && LWIP_ARP */ +#if PPPOE_SUPPORT + case PP_HTONS(ETHTYPE_PPPOEDISC): /* PPP Over Ethernet Discovery Stage */ + pppoe_disc_input(netif, p); + break; + + case PP_HTONS(ETHTYPE_PPPOE): /* PPP Over Ethernet Session Stage */ + pppoe_data_input(netif, p); + break; +#endif /* PPPOE_SUPPORT */ + +#if LWIP_IPV6 + case PP_HTONS(ETHTYPE_IPV6): /* IPv6 */ + /* skip Ethernet header */ + if ((p->len < ip_hdr_offset) || pbuf_header(p, (s16_t)-ip_hdr_offset)) { + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_WARNING, + ("ethernet_input: IPv6 packet dropped, too short (%"S16_F"/%"S16_F")\n", + p->tot_len, ip_hdr_offset)); + goto free_and_return; + } else { + /* pass to IPv6 layer */ + ip6_input(p, netif); + } + break; +#endif /* LWIP_IPV6 */ + + default: +#ifdef LWIP_HOOK_UNKNOWN_ETH_PROTOCOL + if(LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(p, netif) == ERR_OK) { + break; + } +#endif + ETHARP_STATS_INC(etharp.proterr); + ETHARP_STATS_INC(etharp.drop); + MIB2_STATS_NETIF_INC(netif, ifinunknownprotos); + goto free_and_return; + } + + /* This means the pbuf is freed or consumed, + so the caller doesn't have to free it again */ + return ERR_OK; + +free_and_return: + pbuf_free(p); + return ERR_OK; +} + +/** + * @ingroup ethernet + * Send an ethernet packet on the network using netif->linkoutput(). + * The ethernet header is filled in before sending. + * + * @see LWIP_HOOK_VLAN_SET + * + * @param netif the lwIP network interface on which to send the packet + * @param p the packet to send. pbuf layer must be @ref PBUF_LINK. + * @param src the source MAC address to be copied into the ethernet header + * @param dst the destination MAC address to be copied into the ethernet header + * @param eth_type ethernet type (@ref eth_type) + * @return ERR_OK if the packet was sent, any other err_t on failure + */ +err_t +ethernet_output(struct netif* netif, struct pbuf* p, + const struct eth_addr* src, const struct eth_addr* dst, + u16_t eth_type) +{ + struct eth_hdr* ethhdr; + u16_t eth_type_be = lwip_htons(eth_type); + +#if ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET) + s32_t vlan_prio_vid = LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type); + if (vlan_prio_vid >= 0) { + struct eth_vlan_hdr* vlanhdr; + + LWIP_ASSERT("prio_vid must be <= 0xFFFF", vlan_prio_vid <= 0xFFFF); + + if (pbuf_header(p, SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR) != 0) { + goto pbuf_header_failed; + } + vlanhdr = (struct eth_vlan_hdr*)(((u8_t*)p->payload) + SIZEOF_ETH_HDR); + vlanhdr->tpid = eth_type_be; + vlanhdr->prio_vid = lwip_htons((u16_t)vlan_prio_vid); + + eth_type_be = PP_HTONS(ETHTYPE_VLAN); + } else +#endif /* ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET) */ + { + if (pbuf_header(p, SIZEOF_ETH_HDR) != 0) { + goto pbuf_header_failed; + } + } + + ethhdr = (struct eth_hdr*)p->payload; + ethhdr->type = eth_type_be; + ETHADDR32_COPY(ðhdr->dest, dst); + ETHADDR16_COPY(ðhdr->src, src); + + LWIP_ASSERT("netif->hwaddr_len must be 6 for ethernet_output!", + (netif->hwaddr_len == ETH_HWADDR_LEN)); + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, + ("ethernet_output: sending packet %p\n", (void *)p)); + + /* send the packet */ + return netif->linkoutput(netif, p); + +pbuf_header_failed: + LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, + ("ethernet_output: could not allocate room for header.\n")); + LINK_STATS_INC(link.lenerr); + return ERR_BUF; +} + +#endif /* LWIP_ARP || LWIP_ETHERNET */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernetif.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernetif.c new file mode 100644 index 0000000..dc8ae6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ethernetif.c @@ -0,0 +1,335 @@ +/** + * @file + * Ethernet Interface Skeleton + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ + +/* + * This file is a skeleton for developing Ethernet network interface + * drivers for lwIP. Add code to the low_level functions and do a + * search-and-replace for the word "ethernetif" to replace it with + * something that better describes your network interface. + */ + +#include "lwip/opt.h" + +#if 0 /* don't build, this is only a skeleton, see previous comment */ + +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/stats.h" +#include "lwip/snmp.h" +#include "lwip/ethip6.h" +#include "lwip/etharp.h" +#include "netif/ppp/pppoe.h" + +/* Define those to better describe your network interface. */ +#define IFNAME0 'e' +#define IFNAME1 'n' + +/** + * Helper struct to hold private data used to operate your ethernet interface. + * Keeping the ethernet address of the MAC in this struct is not necessary + * as it is already kept in the struct netif. + * But this is only an example, anyway... + */ +struct ethernetif { + struct eth_addr *ethaddr; + /* Add whatever per-interface state that is needed here. */ +}; + +/* Forward declarations. */ +static void ethernetif_input(struct netif *netif); + +/** + * In this function, the hardware should be initialized. + * Called from ethernetif_init(). + * + * @param netif the already initialized lwip network interface structure + * for this ethernetif + */ +static void +low_level_init(struct netif *netif) +{ + struct ethernetif *ethernetif = netif->state; + + /* set MAC hardware address length */ + netif->hwaddr_len = ETHARP_HWADDR_LEN; + + /* set MAC hardware address */ + netif->hwaddr[0] = ; + ... + netif->hwaddr[5] = ; + + /* maximum transfer unit */ + netif->mtu = 1500; + + /* device capabilities */ + /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + +#if LWIP_IPV6 && LWIP_IPV6_MLD + /* + * For hardware/netifs that implement MAC filtering. + * All-nodes link-local is handled by default, so we must let the hardware know + * to allow multicast packets in. + * Should set mld_mac_filter previously. */ + if (netif->mld_mac_filter != NULL) { + ip6_addr_t ip6_allnodes_ll; + ip6_addr_set_allnodes_linklocal(&ip6_allnodes_ll); + netif->mld_mac_filter(netif, &ip6_allnodes_ll, NETIF_ADD_MAC_FILTER); + } +#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */ + + /* Do whatever else is needed to initialize interface. */ +} + +/** + * This function should do the actual transmission of the packet. The packet is + * contained in the pbuf that is passed to the function. This pbuf + * might be chained. + * + * @param netif the lwip network interface structure for this ethernetif + * @param p the MAC packet to send (e.g. IP packet including MAC addresses and type) + * @return ERR_OK if the packet could be sent + * an err_t value if the packet couldn't be sent + * + * @note Returning ERR_MEM here if a DMA queue of your MAC is full can lead to + * strange results. You might consider waiting for space in the DMA queue + * to become available since the stack doesn't retry to send a packet + * dropped because of memory failure (except for the TCP timers). + */ + +static err_t +low_level_output(struct netif *netif, struct pbuf *p) +{ + struct ethernetif *ethernetif = netif->state; + struct pbuf *q; + + initiate transfer(); + +#if ETH_PAD_SIZE + pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ +#endif + + for (q = p; q != NULL; q = q->next) { + /* Send the data from the pbuf to the interface, one pbuf at a + time. The size of the data in each pbuf is kept in the ->len + variable. */ + send data from(q->payload, q->len); + } + + signal that packet should be sent(); + + MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p->tot_len); + if (((u8_t*)p->payload)[0] & 1) { + /* broadcast or multicast packet*/ + MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts); + } else { + /* unicast packet */ + MIB2_STATS_NETIF_INC(netif, ifoutucastpkts); + } + /* increase ifoutdiscards or ifouterrors on error */ + +#if ETH_PAD_SIZE + pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ +#endif + + LINK_STATS_INC(link.xmit); + + return ERR_OK; +} + +/** + * Should allocate a pbuf and transfer the bytes of the incoming + * packet from the interface into the pbuf. + * + * @param netif the lwip network interface structure for this ethernetif + * @return a pbuf filled with the received packet (including MAC header) + * NULL on memory error + */ +static struct pbuf * +low_level_input(struct netif *netif) +{ + struct ethernetif *ethernetif = netif->state; + struct pbuf *p, *q; + u16_t len; + + /* Obtain the size of the packet and put it into the "len" + variable. */ + len = ; + +#if ETH_PAD_SIZE + len += ETH_PAD_SIZE; /* allow room for Ethernet padding */ +#endif + + /* We allocate a pbuf chain of pbufs from the pool. */ + p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); + + if (p != NULL) { + +#if ETH_PAD_SIZE + pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ +#endif + + /* We iterate over the pbuf chain until we have read the entire + * packet into the pbuf. */ + for (q = p; q != NULL; q = q->next) { + /* Read enough bytes to fill this pbuf in the chain. The + * available data in the pbuf is given by the q->len + * variable. + * This does not necessarily have to be a memcpy, you can also preallocate + * pbufs for a DMA-enabled MAC and after receiving truncate it to the + * actually received size. In this case, ensure the tot_len member of the + * pbuf is the sum of the chained pbuf len members. + */ + read data into(q->payload, q->len); + } + acknowledge that packet has been read(); + + MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); + if (((u8_t*)p->payload)[0] & 1) { + /* broadcast or multicast packet*/ + MIB2_STATS_NETIF_INC(netif, ifinnucastpkts); + } else { + /* unicast packet*/ + MIB2_STATS_NETIF_INC(netif, ifinucastpkts); + } +#if ETH_PAD_SIZE + pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ +#endif + + LINK_STATS_INC(link.recv); + } else { + drop packet(); + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(netif, ifindiscards); + } + + return p; +} + +/** + * This function should be called when a packet is ready to be read + * from the interface. It uses the function low_level_input() that + * should handle the actual reception of bytes from the network + * interface. Then the type of the received packet is determined and + * the appropriate input function is called. + * + * @param netif the lwip network interface structure for this ethernetif + */ +static void +ethernetif_input(struct netif *netif) +{ + struct ethernetif *ethernetif; + struct eth_hdr *ethhdr; + struct pbuf *p; + + ethernetif = netif->state; + + /* move received packet into a new pbuf */ + p = low_level_input(netif); + /* if no packet could be read, silently ignore this */ + if (p != NULL) { + /* pass all packets to ethernet_input, which decides what packets it supports */ + if (netif->input(p, netif) != ERR_OK) { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); + pbuf_free(p); + p = NULL; + } + } +} + +/** + * Should be called at the beginning of the program to set up the + * network interface. It calls the function low_level_init() to do the + * actual setup of the hardware. + * + * This function should be passed as a parameter to netif_add(). + * + * @param netif the lwip network interface structure for this ethernetif + * @return ERR_OK if the loopif is initialized + * ERR_MEM if private data couldn't be allocated + * any other err_t on error + */ +err_t +ethernetif_init(struct netif *netif) +{ + struct ethernetif *ethernetif; + + LWIP_ASSERT("netif != NULL", (netif != NULL)); + + ethernetif = mem_malloc(sizeof(struct ethernetif)); + if (ethernetif == NULL) { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_init: out of memory\n")); + return ERR_MEM; + } + +#if LWIP_NETIF_HOSTNAME + /* Initialize interface hostname */ + netif->hostname = "lwip"; +#endif /* LWIP_NETIF_HOSTNAME */ + + /* + * Initialize the snmp variables and counters inside the struct netif. + * The last argument should be replaced with your link speed, in units + * of bits per second. + */ + MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, LINK_SPEED_OF_YOUR_NETIF_IN_BPS); + + netif->state = ethernetif; + netif->name[0] = IFNAME0; + netif->name[1] = IFNAME1; + /* We directly use etharp_output() here to save a function call. + * You can instead declare your own function an call etharp_output() + * from it if you have to do some checks before sending (e.g. if link + * is available...) */ + netif->output = etharp_output; +#if LWIP_IPV6 + netif->output_ip6 = ethip6_output; +#endif /* LWIP_IPV6 */ + netif->linkoutput = low_level_output; + + ethernetif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]); + + /* initialize the hardware */ + low_level_init(netif); + + return ERR_OK; +} + +#endif /* 0 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/lowpan6.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/lowpan6.c new file mode 100644 index 0000000..9a84cbc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/lowpan6.c @@ -0,0 +1,1193 @@ +/** + * @file + * + * 6LowPAN output for IPv6. Uses ND tables for link-layer addressing. Fragments packets to 6LowPAN units. + */ + +/* + * Copyright (c) 2015 Inico Technologies Ltd. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Ivan Delamer + * + * + * Please coordinate changes and requests with Ivan Delamer + * + */ + +/** + * @defgroup sixlowpan 6LowPAN netif + * @ingroup addons + * 6LowPAN netif implementation + */ + +#include "netif/lowpan6.h" + +#if LWIP_IPV6 && LWIP_6LOWPAN + +#include "lwip/ip.h" +#include "lwip/pbuf.h" +#include "lwip/ip_addr.h" +#include "lwip/netif.h" +#include "lwip/nd6.h" +#include "lwip/mem.h" +#include "lwip/udp.h" +#include "lwip/tcpip.h" +#include "lwip/snmp.h" + +#include + +struct ieee_802154_addr { + u8_t addr_len; + u8_t addr[8]; +}; + +/** This is a helper struct. + */ +struct lowpan6_reass_helper { + struct pbuf *pbuf; + struct lowpan6_reass_helper *next_packet; + u8_t timer; + struct ieee_802154_addr sender_addr; + u16_t datagram_size; + u16_t datagram_tag; +}; + +static struct lowpan6_reass_helper * reass_list; + +#if LWIP_6LOWPAN_NUM_CONTEXTS > 0 +static ip6_addr_t lowpan6_context[LWIP_6LOWPAN_NUM_CONTEXTS]; +#endif + +static u16_t ieee_802154_pan_id; + +static const struct ieee_802154_addr ieee_802154_broadcast = {2, {0xff, 0xff}}; + +#if LWIP_6LOWPAN_INFER_SHORT_ADDRESS +static struct ieee_802154_addr short_mac_addr = {2, {0,0}}; +#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ + +static err_t dequeue_datagram(struct lowpan6_reass_helper *lrh); + +/** + * Periodic timer for 6LowPAN functions: + * + * - Remove incomplete/old packets + */ +void +lowpan6_tmr(void) +{ + struct lowpan6_reass_helper *lrh, *lrh_temp; + + lrh = reass_list; + while (lrh != NULL) { + lrh_temp = lrh->next_packet; + if ((--lrh->timer) == 0) { + dequeue_datagram(lrh); + pbuf_free(lrh->pbuf); + mem_free(lrh); + } + lrh = lrh_temp; + } +} + +/** + * Removes a datagram from the reassembly queue. + **/ +static err_t +dequeue_datagram(struct lowpan6_reass_helper *lrh) +{ + struct lowpan6_reass_helper *lrh_temp; + + if (reass_list == lrh) { + reass_list = reass_list->next_packet; + } else { + lrh_temp = reass_list; + while (lrh_temp != NULL) { + if (lrh_temp->next_packet == lrh) { + lrh_temp->next_packet = lrh->next_packet; + break; + } + lrh_temp = lrh_temp->next_packet; + } + } + + return ERR_OK; +} + +static s8_t +lowpan6_context_lookup(const ip6_addr_t *ip6addr) +{ + s8_t i; + + for (i = 0; i < LWIP_6LOWPAN_NUM_CONTEXTS; i++) { + if (ip6_addr_netcmp(&lowpan6_context[i], ip6addr)) { + return i; + } + } + + return -1; +} + +/* Determine compression mode for unicast address. */ +static s8_t +lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct ieee_802154_addr *mac_addr) +{ + if (mac_addr->addr_len == 2) { + if ((ip6addr->addr[2] == (u32_t)PP_HTONL(0x000000ff)) && + ((ip6addr->addr[3] & PP_HTONL(0xffff0000)) == PP_NTOHL(0xfe000000))) { + if ((ip6addr->addr[3] & PP_HTONL(0x0000ffff)) == lwip_ntohl((mac_addr->addr[0] << 8) | mac_addr->addr[1])) { + return 3; + } + } + } else if (mac_addr->addr_len == 8) { + if ((ip6addr->addr[2] == lwip_ntohl(((mac_addr->addr[0] ^ 2) << 24) | (mac_addr->addr[1] << 16) | mac_addr->addr[2] << 8 | mac_addr->addr[3])) && + (ip6addr->addr[3] == lwip_ntohl((mac_addr->addr[4] << 24) | (mac_addr->addr[5] << 16) | mac_addr->addr[6] << 8 | mac_addr->addr[7]))) { + return 3; + } + } + + if ((ip6addr->addr[2] == PP_HTONL(0x000000ffUL)) && + ((ip6addr->addr[3] & PP_HTONL(0xffff0000)) == PP_NTOHL(0xfe000000UL))) { + return 2; + } + + return 1; +} + +/* Determine compression mode for multicast address. */ +static s8_t +lowpan6_get_address_mode_mc(const ip6_addr_t *ip6addr) +{ + if ((ip6addr->addr[0] == PP_HTONL(0xff020000)) && + (ip6addr->addr[1] == 0) && + (ip6addr->addr[2] == 0) && + ((ip6addr->addr[3] & PP_HTONL(0xffffff00)) == 0)) { + return 3; + } else if (((ip6addr->addr[0] & PP_HTONL(0xff00ffff)) == PP_HTONL(0xff000000)) && + (ip6addr->addr[1] == 0)) { + if ((ip6addr->addr[2] == 0) && + ((ip6addr->addr[3] & PP_HTONL(0xff000000)) == 0)) { + return 2; + } else if ((ip6addr->addr[2] & PP_HTONL(0xffffff00)) == 0) { + return 1; + } + } + + return 0; +} + +/* + * Encapsulates data into IEEE 802.15.4 frames. + * Fragments an IPv6 datagram into 6LowPAN units, which fit into IEEE 802.15.4 frames. + * If configured, will compress IPv6 and or UDP headers. + * */ +static err_t +lowpan6_frag(struct netif *netif, struct pbuf *p, const struct ieee_802154_addr *src, const struct ieee_802154_addr *dst) +{ + struct pbuf * p_frag; + u16_t frag_len, remaining_len; + u8_t * buffer; + u8_t ieee_header_len; + u8_t lowpan6_header_len; + s8_t i; + static u8_t frame_seq_num; + static u16_t datagram_tag; + u16_t datagram_offset; + err_t err = ERR_IF; + + /* We'll use a dedicated pbuf for building 6LowPAN fragments. */ + p_frag = pbuf_alloc(PBUF_RAW, 127, PBUF_RAM); + if (p_frag == NULL) { + MIB2_STATS_NETIF_INC(netif, ifoutdiscards); + return ERR_MEM; + } + + /* Write IEEE 802.15.4 header. */ + buffer = (u8_t*)p_frag->payload; + ieee_header_len = 0; + if (dst == &ieee_802154_broadcast) { + buffer[ieee_header_len++] = 0x01; /* data packet, no ack required. */ + } else { + buffer[ieee_header_len++] = 0x21; /* data packet, ack required. */ + } + buffer[ieee_header_len] = (0x00 << 4); /* 2003 frame version */ + buffer[ieee_header_len] |= (dst->addr_len == 2) ? (0x02 << 2) : (0x03 << 2); /* destination addressing mode */ + buffer[ieee_header_len] |= (src->addr_len == 2) ? (0x02 << 6) : (0x03 << 6); /* source addressing mode */ + ieee_header_len++; + buffer[ieee_header_len++] = frame_seq_num++; + + buffer[ieee_header_len++] = ieee_802154_pan_id & 0xff; /* pan id */ + buffer[ieee_header_len++] = (ieee_802154_pan_id >> 8) & 0xff; /* pan id */ + i = dst->addr_len; + while (i-- > 0) { + buffer[ieee_header_len++] = dst->addr[i]; + } + + buffer[ieee_header_len++] = ieee_802154_pan_id & 0xff; /* pan id */ + buffer[ieee_header_len++] = (ieee_802154_pan_id >> 8) & 0xff; /* pan id */ + i = src->addr_len; + while (i-- > 0) { + buffer[ieee_header_len++] = src->addr[i]; + } + +#if LWIP_6LOWPAN_IPHC + /* Perform 6LowPAN IPv6 header compression according to RFC 6282 */ + { + struct ip6_hdr *ip6hdr; + + /* Point to ip6 header and align copies of src/dest addresses. */ + ip6hdr = (struct ip6_hdr *)p->payload; + ip_addr_copy_from_ip6(ip_data.current_iphdr_dest, ip6hdr->dest); + ip_addr_copy_from_ip6(ip_data.current_iphdr_src, ip6hdr->src); + + /* Basic length of 6LowPAN header, set dispatch and clear fields. */ + lowpan6_header_len = 2; + buffer[ieee_header_len] = 0x60; + buffer[ieee_header_len + 1] = 0; + + /* Determine whether there will be a Context Identifier Extension byte or not. + * If so, set it already. */ +#if LWIP_6LOWPAN_NUM_CONTEXTS > 0 + buffer[ieee_header_len + 2] = 0; + + i = lowpan6_context_lookup(ip_2_ip6(&ip_data.current_iphdr_src)); + if (i >= 0) { + /* Stateful source address compression. */ + buffer[ieee_header_len + 1] |= 0x40; + buffer[ieee_header_len + 2] |= (i & 0x0f) << 4; + } + + i = lowpan6_context_lookup(ip_2_ip6(&ip_data.current_iphdr_dest)); + if (i >= 0) { + /* Stateful destination address compression. */ + buffer[ieee_header_len + 1] |= 0x04; + buffer[ieee_header_len + 2] |= i & 0x0f; + } + + if (buffer[ieee_header_len + 2] != 0x00) { + /* Context identifier extension byte is appended. */ + buffer[ieee_header_len + 1] |= 0x80; + lowpan6_header_len++; + } +#endif /* LWIP_6LOWPAN_NUM_CONTEXTS > 0 */ + + /* Determine TF field: Traffic Class, Flow Label */ + if (IP6H_FL(ip6hdr) == 0) { + /* Flow label is elided. */ + buffer[ieee_header_len] |= 0x10; + if (IP6H_TC(ip6hdr) == 0) { + /* Traffic class (ECN+DSCP) elided too. */ + buffer[ieee_header_len] |= 0x08; + } else { + /* Traffic class (ECN+DSCP) appended. */ + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_TC(ip6hdr); + } + } else { + if (((IP6H_TC(ip6hdr) & 0x3f) == 0)) { + /* DSCP portion of Traffic Class is elided, ECN and FL are appended (3 bytes) */ + buffer[ieee_header_len] |= 0x08; + + buffer[ieee_header_len + lowpan6_header_len] = IP6H_TC(ip6hdr) & 0xc0; + buffer[ieee_header_len + lowpan6_header_len++] |= (IP6H_FL(ip6hdr) >> 16) & 0x0f; + buffer[ieee_header_len + lowpan6_header_len++] = (IP6H_FL(ip6hdr) >> 8) & 0xff; + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_FL(ip6hdr) & 0xff; + } else { + /* Traffic class and flow label are appended (4 bytes) */ + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_TC(ip6hdr); + buffer[ieee_header_len + lowpan6_header_len++] = (IP6H_FL(ip6hdr) >> 16) & 0x0f; + buffer[ieee_header_len + lowpan6_header_len++] = (IP6H_FL(ip6hdr) >> 8) & 0xff; + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_FL(ip6hdr) & 0xff; + } + } + + /* Compress NH? + * Only if UDP for now. @todo support other NH compression. */ + if (IP6H_NEXTH(ip6hdr) == IP6_NEXTH_UDP) { + buffer[ieee_header_len] |= 0x04; + } else { + /* append nexth. */ + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_NEXTH(ip6hdr); + } + + /* Compress hop limit? */ + if (IP6H_HOPLIM(ip6hdr) == 255) { + buffer[ieee_header_len] |= 0x03; + } else if (IP6H_HOPLIM(ip6hdr) == 64) { + buffer[ieee_header_len] |= 0x02; + } else if (IP6H_HOPLIM(ip6hdr) == 1) { + buffer[ieee_header_len] |= 0x01; + } else { + /* append hop limit */ + buffer[ieee_header_len + lowpan6_header_len++] = IP6H_HOPLIM(ip6hdr); + } + + /* Compress source address */ + if (((buffer[ieee_header_len + 1] & 0x40) != 0) || + (ip6_addr_islinklocal(ip_2_ip6(&ip_data.current_iphdr_src)))) { + /* Context-based or link-local source address compression. */ + i = lowpan6_get_address_mode(ip_2_ip6(&ip_data.current_iphdr_src), src); + buffer[ieee_header_len + 1] |= (i & 0x03) << 4; + if (i == 1) { + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 16, 8); + lowpan6_header_len += 8; + } else if (i == 2) { + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 22, 2); + lowpan6_header_len += 2; + } + } else if (ip6_addr_isany(ip_2_ip6(&ip_data.current_iphdr_src))) { + /* Special case: mark SAC and leave SAM=0 */ + buffer[ieee_header_len + 1] |= 0x40; + } else { + /* Append full address. */ + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 8, 16); + lowpan6_header_len += 16; + } + + /* Compress destination address */ + if (ip6_addr_ismulticast(ip_2_ip6(&ip_data.current_iphdr_dest))) { + /* @todo support stateful multicast address compression */ + + buffer[ieee_header_len + 1] |= 0x08; + + i = lowpan6_get_address_mode_mc(ip_2_ip6(&ip_data.current_iphdr_dest)); + buffer[ieee_header_len + 1] |= i & 0x03; + if (i == 0) { + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 24, 16); + lowpan6_header_len += 16; + } else if (i == 1) { + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[25]; + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 35, 5); + lowpan6_header_len += 5; + } else if (i == 2) { + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[25]; + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 37, 3); + lowpan6_header_len += 3; + } else if (i == 3) { + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[39]; + } + } else if (((buffer[ieee_header_len + 1] & 0x04) != 0) || + (ip6_addr_islinklocal(ip_2_ip6(&ip_data.current_iphdr_dest)))) { + /* Context-based or link-local destination address compression. */ + i = lowpan6_get_address_mode(ip_2_ip6(&ip_data.current_iphdr_dest), dst); + buffer[ieee_header_len + 1] |= i & 0x03; + if (i == 1) { + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 32, 8); + lowpan6_header_len += 8; + } else if (i == 2) { + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 38, 2); + lowpan6_header_len += 2; + } + } else { + /* Append full address. */ + MEMCPY(buffer + ieee_header_len + lowpan6_header_len, (u8_t*)p->payload + 24, 16); + lowpan6_header_len += 16; + } + + /* Move to payload. */ + pbuf_header(p, -IP6_HLEN); + + /* Compress UDP header? */ + if (IP6H_NEXTH(ip6hdr) == IP6_NEXTH_UDP) { + /* @todo support optional checksum compression */ + + buffer[ieee_header_len + lowpan6_header_len] = 0xf0; + + /* determine port compression mode. */ + if ((((u8_t *)p->payload)[0] == 0xf0) && ((((u8_t *)p->payload)[1] & 0xf0) == 0xb0) && + (((u8_t *)p->payload)[2] == 0xf0) && ((((u8_t *)p->payload)[3] & 0xf0) == 0xb0)) { + /* Compress source and dest ports. */ + buffer[ieee_header_len + lowpan6_header_len++] |= 0x03; + buffer[ieee_header_len + lowpan6_header_len++] = ((((u8_t *)p->payload)[1] & 0x0f) << 4) | (((u8_t *)p->payload)[3] & 0x0f); + } else if (((u8_t *)p->payload)[0] == 0xf0) { + /* Compress source port. */ + buffer[ieee_header_len + lowpan6_header_len++] |= 0x02; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[1]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[2]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[3]; + } else if (((u8_t *)p->payload)[2] == 0xf0) { + /* Compress dest port. */ + buffer[ieee_header_len + lowpan6_header_len++] |= 0x01; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[0]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[1]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[3]; + } else { + /* append full ports. */ + lowpan6_header_len++; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[0]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[1]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[2]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[3]; + } + + /* elide length and copy checksum */ + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[6]; + buffer[ieee_header_len + lowpan6_header_len++] = ((u8_t *)p->payload)[7]; + + pbuf_header(p, -UDP_HLEN); + } + } + +#else /* LWIP_6LOWPAN_HC */ + /* Send uncompressed IPv6 header with appropriate dispatch byte. */ + lowpan6_header_len = 1; + buffer[ieee_header_len] = 0x41; /* IPv6 dispatch */ +#endif /* LWIP_6LOWPAN_HC */ + + /* Calculate remaining packet length */ + remaining_len = p->tot_len; + + if (remaining_len > 0x7FF) { + MIB2_STATS_NETIF_INC(netif, ifoutdiscards); + /* datagram_size must fit into 11 bit */ + pbuf_free(p_frag); + return ERR_VAL; + } + + /* Fragment, or 1 packet? */ + if (remaining_len > (127 - ieee_header_len - lowpan6_header_len - 3)) { /* 127 - header - 1 byte dispatch - 2 bytes CRC */ + /* We must move the 6LowPAN header to make room for the FRAG header. */ + i = lowpan6_header_len; + while (i-- != 0) { + buffer[ieee_header_len + i + 4] = buffer[ieee_header_len + i]; + } + + /* Now we need to fragment the packet. FRAG1 header first */ + buffer[ieee_header_len] = 0xc0 | (((p->tot_len + lowpan6_header_len) >> 8) & 0x7); + buffer[ieee_header_len + 1] = (p->tot_len + lowpan6_header_len) & 0xff; + + datagram_tag++; + buffer[ieee_header_len + 2] = datagram_tag & 0xff; + buffer[ieee_header_len + 3] = (datagram_tag >> 8) & 0xff; + + /* Fragment follows. */ + frag_len = (127 - ieee_header_len - 4 - 2) & 0xf8; + + pbuf_copy_partial(p, buffer + ieee_header_len + lowpan6_header_len + 4, frag_len - lowpan6_header_len, 0); + remaining_len -= frag_len - lowpan6_header_len; + datagram_offset = frag_len; + + /* 2 bytes CRC */ +#if LWIP_6LOWPAN_HW_CRC + /* Leave blank, will be filled by HW. */ +#else /* LWIP_6LOWPAN_HW_CRC */ + /* @todo calculate CRC */ +#endif /* LWIP_6LOWPAN_HW_CRC */ + + /* Calculate frame length */ + p_frag->len = p_frag->tot_len = ieee_header_len + 4 + frag_len + 2; /* add 2 dummy bytes for crc*/ + + /* send the packet */ + MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p_frag->tot_len); + LWIP_DEBUGF(LOWPAN6_DEBUG | LWIP_DBG_TRACE, ("lowpan6_send: sending packet %p\n", (void *)p)); + err = netif->linkoutput(netif, p_frag); + + while ((remaining_len > 0) && (err == ERR_OK)) { + /* new frame, new seq num for ACK */ + buffer[2] = frame_seq_num++; + + buffer[ieee_header_len] |= 0x20; /* Change FRAG1 to FRAGN */ + + buffer[ieee_header_len + 4] = (u8_t)(datagram_offset >> 3); /* datagram offset in FRAGN header (datagram_offset is max. 11 bit) */ + + frag_len = (127 - ieee_header_len - 5 - 2) & 0xf8; + if (frag_len > remaining_len) { + frag_len = remaining_len; + } + + pbuf_copy_partial(p, buffer + ieee_header_len + 5, frag_len, p->tot_len - remaining_len); + remaining_len -= frag_len; + datagram_offset += frag_len; + + /* 2 bytes CRC */ +#if LWIP_6LOWPAN_HW_CRC + /* Leave blank, will be filled by HW. */ +#else /* LWIP_6LOWPAN_HW_CRC */ + /* @todo calculate CRC */ +#endif /* LWIP_6LOWPAN_HW_CRC */ + + /* Calculate frame length */ + p_frag->len = p_frag->tot_len = frag_len + 5 + ieee_header_len + 2; + + /* send the packet */ + MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p_frag->tot_len); + LWIP_DEBUGF(LOWPAN6_DEBUG | LWIP_DBG_TRACE, ("lowpan6_send: sending packet %p\n", (void *)p)); + err = netif->linkoutput(netif, p_frag); + } + } else { + /* It fits in one frame. */ + frag_len = remaining_len; + + /* Copy IPv6 packet */ + pbuf_copy_partial(p, buffer + ieee_header_len + lowpan6_header_len, frag_len, 0); + remaining_len = 0; + + /* 2 bytes CRC */ +#if LWIP_6LOWPAN_HW_CRC + /* Leave blank, will be filled by HW. */ +#else /* LWIP_6LOWPAN_HW_CRC */ + /* @todo calculate CRC */ +#endif /* LWIP_6LOWPAN_HW_CRC */ + + /* Calculate frame length */ + p_frag->len = p_frag->tot_len = frag_len + lowpan6_header_len + ieee_header_len + 2; + + /* send the packet */ + MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p_frag->tot_len); + LWIP_DEBUGF(LOWPAN6_DEBUG | LWIP_DBG_TRACE, ("lowpan6_send: sending packet %p\n", (void *)p)); + err = netif->linkoutput(netif, p_frag); + } + + pbuf_free(p_frag); + + return err; +} + +err_t +lowpan6_set_context(u8_t idx, const ip6_addr_t * context) +{ + if (idx >= LWIP_6LOWPAN_NUM_CONTEXTS) { + return ERR_ARG; + } + + ip6_addr_set(&lowpan6_context[idx], context); + + return ERR_OK; +} + +#if LWIP_6LOWPAN_INFER_SHORT_ADDRESS +err_t +lowpan6_set_short_addr(u8_t addr_high, u8_t addr_low) +{ + short_mac_addr.addr[0] = addr_high; + short_mac_addr.addr[1] = addr_low; + + return ERR_OK; +} +#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ + +#if LWIP_IPV4 +err_t +lowpan4_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) +{ + (void)netif; + (void)q; + (void)ipaddr; + + return ERR_IF; +} +#endif /* LWIP_IPV4 */ + +/** + * Resolve and fill-in IEEE 802.15.4 address header for outgoing IPv6 packet. + * + * Perform Header Compression and fragment if necessary. + * + * @param netif The lwIP network interface which the IP packet will be sent on. + * @param q The pbuf(s) containing the IP packet to be sent. + * @param ip6addr The IP address of the packet destination. + * + * @return err_t + */ +err_t +lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) +{ + err_t result; + const u8_t *hwaddr; + struct ieee_802154_addr src, dest; +#if LWIP_6LOWPAN_INFER_SHORT_ADDRESS + ip6_addr_t ip6_src; + struct ip6_hdr * ip6_hdr; +#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ + +#if LWIP_6LOWPAN_INFER_SHORT_ADDRESS + /* Check if we can compress source address (use aligned copy) */ + ip6_hdr = (struct ip6_hdr *)q->payload; + ip6_addr_set(&ip6_src, &ip6_hdr->src); + if (lowpan6_get_address_mode(&ip6_src, &short_mac_addr) == 3) { + src.addr_len = 2; + src.addr[0] = short_mac_addr.addr[0]; + src.addr[1] = short_mac_addr.addr[1]; + } else +#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ + { + src.addr_len = netif->hwaddr_len; + SMEMCPY(src.addr, netif->hwaddr, netif->hwaddr_len); + } + + /* multicast destination IP address? */ + if (ip6_addr_ismulticast(ip6addr)) { + MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts); + /* We need to send to the broadcast address.*/ + return lowpan6_frag(netif, q, &src, &ieee_802154_broadcast); + } + + /* We have a unicast destination IP address */ + /* @todo anycast? */ + +#if LWIP_6LOWPAN_INFER_SHORT_ADDRESS + if (src.addr_len == 2) { + /* If source address was compressable to short_mac_addr, and dest has same subnet and + * is also compressable to 2-bytes, assume we can infer dest as a short address too. */ + dest.addr_len = 2; + dest.addr[0] = ((u8_t *)q->payload)[38]; + dest.addr[1] = ((u8_t *)q->payload)[39]; + if ((src.addr_len == 2) && (ip6_addr_netcmp(&ip6_hdr->src, &ip6_hdr->dest)) && + (lowpan6_get_address_mode(ip6addr, &dest) == 3)) { + MIB2_STATS_NETIF_INC(netif, ifoutucastpkts); + return lowpan6_frag(netif, q, &src, &dest); + } + } +#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */ + + /* Ask ND6 what to do with the packet. */ + result = nd6_get_next_hop_addr_or_queue(netif, q, ip6addr, &hwaddr); + if (result != ERR_OK) { + MIB2_STATS_NETIF_INC(netif, ifoutdiscards); + return result; + } + + /* If no hardware address is returned, nd6 has queued the packet for later. */ + if (hwaddr == NULL) { + return ERR_OK; + } + + /* Send out the packet using the returned hardware address. */ + dest.addr_len = netif->hwaddr_len; + SMEMCPY(dest.addr, hwaddr, netif->hwaddr_len); + MIB2_STATS_NETIF_INC(netif, ifoutucastpkts); + return lowpan6_frag(netif, q, &src, &dest); +} + +static struct pbuf * +lowpan6_decompress(struct pbuf * p, struct ieee_802154_addr * src, struct ieee_802154_addr * dest) +{ + struct pbuf * q; + u8_t * lowpan6_buffer; + s8_t lowpan6_offset; + struct ip6_hdr *ip6hdr; + s8_t i; + s8_t ip6_offset = IP6_HLEN; + + + q = pbuf_alloc(PBUF_IP, p->len + IP6_HLEN + UDP_HLEN, PBUF_POOL); + if (q == NULL) { + pbuf_free(p); + return NULL; + } + + lowpan6_buffer = (u8_t *)p->payload; + ip6hdr = (struct ip6_hdr *)q->payload; + + lowpan6_offset = 2; + if (lowpan6_buffer[1] & 0x80) { + lowpan6_offset++; + } + + /* Set IPv6 version, traffic class and flow label. */ + if ((lowpan6_buffer[0] & 0x18) == 0x00) { + IP6H_VTCFL_SET(ip6hdr, 6, lowpan6_buffer[lowpan6_offset], ((lowpan6_buffer[lowpan6_offset+1] & 0x0f) << 16) | (lowpan6_buffer[lowpan6_offset + 2] << 8) | lowpan6_buffer[lowpan6_offset+3]); + lowpan6_offset += 4; + } else if ((lowpan6_buffer[0] & 0x18) == 0x08) { + IP6H_VTCFL_SET(ip6hdr, 6, lowpan6_buffer[lowpan6_offset] & 0xc0, ((lowpan6_buffer[lowpan6_offset] & 0x0f) << 16) | (lowpan6_buffer[lowpan6_offset + 1] << 8) | lowpan6_buffer[lowpan6_offset+2]); + lowpan6_offset += 3; + } else if ((lowpan6_buffer[0] & 0x18) == 0x10) { + IP6H_VTCFL_SET(ip6hdr, 6, lowpan6_buffer[lowpan6_offset],0); + lowpan6_offset += 1; + } else if ((lowpan6_buffer[0] & 0x18) == 0x18) { + IP6H_VTCFL_SET(ip6hdr, 6, 0, 0); + } + + /* Set Next Header */ + if ((lowpan6_buffer[0] & 0x04) == 0x00) { + IP6H_NEXTH_SET(ip6hdr, lowpan6_buffer[lowpan6_offset++]); + } else { + /* We should fill this later with NHC decoding */ + IP6H_NEXTH_SET(ip6hdr, 0); + } + + /* Set Hop Limit */ + if ((lowpan6_buffer[0] & 0x03) == 0x00) { + IP6H_HOPLIM_SET(ip6hdr, lowpan6_buffer[lowpan6_offset++]); + } else if ((lowpan6_buffer[0] & 0x03) == 0x01) { + IP6H_HOPLIM_SET(ip6hdr, 1); + } else if ((lowpan6_buffer[0] & 0x03) == 0x02) { + IP6H_HOPLIM_SET(ip6hdr, 64); + } else if ((lowpan6_buffer[0] & 0x03) == 0x03) { + IP6H_HOPLIM_SET(ip6hdr, 255); + } + + /* Source address decoding. */ + if ((lowpan6_buffer[1] & 0x40) == 0x00) { + /* Stateless compression */ + if ((lowpan6_buffer[1] & 0x30) == 0x00) { + /* copy full address */ + MEMCPY(&ip6hdr->src.addr[0], lowpan6_buffer + lowpan6_offset, 16); + lowpan6_offset += 16; + } else if ((lowpan6_buffer[1] & 0x30) == 0x10) { + ip6hdr->src.addr[0] = PP_HTONL(0xfe800000UL); + ip6hdr->src.addr[1] = 0; + MEMCPY(&ip6hdr->src.addr[2], lowpan6_buffer + lowpan6_offset, 8); + lowpan6_offset += 8; + } else if ((lowpan6_buffer[1] & 0x30) == 0x20) { + ip6hdr->src.addr[0] = PP_HTONL(0xfe800000UL); + ip6hdr->src.addr[1] = 0; + ip6hdr->src.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->src.addr[3] = lwip_htonl(0xfe000000UL | (lowpan6_buffer[lowpan6_offset] << 8) | + lowpan6_buffer[lowpan6_offset+1]); + lowpan6_offset += 2; + } else if ((lowpan6_buffer[1] & 0x30) == 0x30) { + ip6hdr->src.addr[0] = PP_HTONL(0xfe800000UL); + ip6hdr->src.addr[1] = 0; + if (src->addr_len == 2) { + ip6hdr->src.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->src.addr[3] = lwip_htonl(0xfe000000UL | (src->addr[0] << 8) | src->addr[1]); + } else { + ip6hdr->src.addr[2] = lwip_htonl(((src->addr[0] ^ 2) << 24) | (src->addr[1] << 16) | + (src->addr[2] << 8) | src->addr[3]); + ip6hdr->src.addr[3] = lwip_htonl((src->addr[4] << 24) | (src->addr[5] << 16) | + (src->addr[6] << 8) | src->addr[7]); + } + } + } else { + /* Stateful compression */ + if ((lowpan6_buffer[1] & 0x30) == 0x00) { + /* ANY address */ + ip6hdr->src.addr[0] = 0; + ip6hdr->src.addr[1] = 0; + ip6hdr->src.addr[2] = 0; + ip6hdr->src.addr[3] = 0; + } else { + /* Set prefix from context info */ + if (lowpan6_buffer[1] & 0x80) { + i = (lowpan6_buffer[2] >> 4) & 0x0f; + } else { + i = 0; + } + if (i >= LWIP_6LOWPAN_NUM_CONTEXTS) { + /* Error */ + pbuf_free(p); + pbuf_free(q); + return NULL; + } + + ip6hdr->src.addr[0] = lowpan6_context[i].addr[0]; + ip6hdr->src.addr[1] = lowpan6_context[i].addr[1]; + } + + if ((lowpan6_buffer[1] & 0x30) == 0x10) { + MEMCPY(&ip6hdr->src.addr[2], lowpan6_buffer + lowpan6_offset, 8); + lowpan6_offset += 8; + } else if ((lowpan6_buffer[1] & 0x30) == 0x20) { + ip6hdr->src.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->src.addr[3] = lwip_htonl(0xfe000000UL | (lowpan6_buffer[lowpan6_offset] << 8) | lowpan6_buffer[lowpan6_offset+1]); + lowpan6_offset += 2; + } else if ((lowpan6_buffer[1] & 0x30) == 0x30) { + if (src->addr_len == 2) { + ip6hdr->src.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->src.addr[3] = lwip_htonl(0xfe000000UL | (src->addr[0] << 8) | src->addr[1]); + } else { + ip6hdr->src.addr[2] = lwip_htonl(((src->addr[0] ^ 2) << 24) | (src->addr[1] << 16) | (src->addr[2] << 8) | src->addr[3]); + ip6hdr->src.addr[3] = lwip_htonl((src->addr[4] << 24) | (src->addr[5] << 16) | (src->addr[6] << 8) | src->addr[7]); + } + } + } + + /* Destination address decoding. */ + if (lowpan6_buffer[1] & 0x08) { + /* Multicast destination */ + if (lowpan6_buffer[1] & 0x04) { + /* @todo support stateful multicast addressing */ + pbuf_free(p); + pbuf_free(q); + return NULL; + } + + if ((lowpan6_buffer[1] & 0x03) == 0x00) { + /* copy full address */ + MEMCPY(&ip6hdr->dest.addr[0], lowpan6_buffer + lowpan6_offset, 16); + lowpan6_offset += 16; + } else if ((lowpan6_buffer[1] & 0x03) == 0x01) { + ip6hdr->dest.addr[0] = lwip_htonl(0xff000000UL | (lowpan6_buffer[lowpan6_offset++] << 16)); + ip6hdr->dest.addr[1] = 0; + ip6hdr->dest.addr[2] = lwip_htonl(lowpan6_buffer[lowpan6_offset++]); + ip6hdr->dest.addr[3] = lwip_htonl((lowpan6_buffer[lowpan6_offset] << 24) | (lowpan6_buffer[lowpan6_offset + 1] << 16) | (lowpan6_buffer[lowpan6_offset + 2] << 8) | lowpan6_buffer[lowpan6_offset + 3]); + lowpan6_offset += 4; + } else if ((lowpan6_buffer[1] & 0x03) == 0x02) { + ip6hdr->dest.addr[0] = lwip_htonl(0xff000000UL | lowpan6_buffer[lowpan6_offset++]); + ip6hdr->dest.addr[1] = 0; + ip6hdr->dest.addr[2] = 0; + ip6hdr->dest.addr[3] = lwip_htonl((lowpan6_buffer[lowpan6_offset] << 16) | (lowpan6_buffer[lowpan6_offset + 1] << 8) | lowpan6_buffer[lowpan6_offset + 2]); + lowpan6_offset += 3; + } else if ((lowpan6_buffer[1] & 0x03) == 0x03) { + ip6hdr->dest.addr[0] = PP_HTONL(0xff020000UL); + ip6hdr->dest.addr[1] = 0; + ip6hdr->dest.addr[2] = 0; + ip6hdr->dest.addr[3] = lwip_htonl(lowpan6_buffer[lowpan6_offset++]); + } + + } else { + if (lowpan6_buffer[1] & 0x04) { + /* Stateful destination compression */ + /* Set prefix from context info */ + if (lowpan6_buffer[1] & 0x80) { + i = lowpan6_buffer[2] & 0x0f; + } else { + i = 0; + } + if (i >= LWIP_6LOWPAN_NUM_CONTEXTS) { + /* Error */ + pbuf_free(p); + pbuf_free(q); + return NULL; + } + + ip6hdr->dest.addr[0] = lowpan6_context[i].addr[0]; + ip6hdr->dest.addr[1] = lowpan6_context[i].addr[1]; + } else { + /* Link local address compression */ + ip6hdr->dest.addr[0] = PP_HTONL(0xfe800000UL); + ip6hdr->dest.addr[1] = 0; + } + + if ((lowpan6_buffer[1] & 0x03) == 0x00) { + /* copy full address */ + MEMCPY(&ip6hdr->dest.addr[0], lowpan6_buffer + lowpan6_offset, 16); + lowpan6_offset += 16; + } else if ((lowpan6_buffer[1] & 0x03) == 0x01) { + MEMCPY(&ip6hdr->dest.addr[2], lowpan6_buffer + lowpan6_offset, 8); + lowpan6_offset += 8; + } else if ((lowpan6_buffer[1] & 0x03) == 0x02) { + ip6hdr->dest.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->dest.addr[3] = lwip_htonl(0xfe000000UL | (lowpan6_buffer[lowpan6_offset] << 8) | lowpan6_buffer[lowpan6_offset + 1]); + lowpan6_offset += 2; + } else if ((lowpan6_buffer[1] & 0x03) == 0x03) { + if (dest->addr_len == 2) { + ip6hdr->dest.addr[2] = PP_HTONL(0x000000ffUL); + ip6hdr->dest.addr[3] = lwip_htonl(0xfe000000UL | (dest->addr[0] << 8) | dest->addr[1]); + } else { + ip6hdr->dest.addr[2] = lwip_htonl(((dest->addr[0] ^ 2) << 24) | (dest->addr[1] << 16) | dest->addr[2] << 8 | dest->addr[3]); + ip6hdr->dest.addr[3] = lwip_htonl((dest->addr[4] << 24) | (dest->addr[5] << 16) | dest->addr[6] << 8 | dest->addr[7]); + } + } + } + + + /* Next Header Compression (NHC) decoding? */ + if (lowpan6_buffer[0] & 0x04) { + if ((lowpan6_buffer[lowpan6_offset] & 0xf8) == 0xf0) { + struct udp_hdr *udphdr; + + /* UDP compression */ + IP6H_NEXTH_SET(ip6hdr, IP6_NEXTH_UDP); + udphdr = (struct udp_hdr *)((u8_t *)q->payload + ip6_offset); + + if (lowpan6_buffer[lowpan6_offset] & 0x04) { + /* @todo support checksum decompress */ + pbuf_free(p); + pbuf_free(q); + return NULL; + } + + /* Decompress ports */ + i = lowpan6_buffer[lowpan6_offset++] & 0x03; + if (i == 0) { + udphdr->src = lwip_htons(lowpan6_buffer[lowpan6_offset] << 8 | lowpan6_buffer[lowpan6_offset + 1]); + udphdr->dest = lwip_htons(lowpan6_buffer[lowpan6_offset + 2] << 8 | lowpan6_buffer[lowpan6_offset + 3]); + lowpan6_offset += 4; + } else if (i == 0x01) { + udphdr->src = lwip_htons(lowpan6_buffer[lowpan6_offset] << 8 | lowpan6_buffer[lowpan6_offset + 1]); + udphdr->dest = lwip_htons(0xf000 | lowpan6_buffer[lowpan6_offset + 2]); + lowpan6_offset += 3; + } else if (i == 0x02) { + udphdr->src = lwip_htons(0xf000 | lowpan6_buffer[lowpan6_offset]); + udphdr->dest = lwip_htons(lowpan6_buffer[lowpan6_offset + 1] << 8 | lowpan6_buffer[lowpan6_offset + 2]); + lowpan6_offset += 3; + } else if (i == 0x03) { + udphdr->src = lwip_htons(0xf0b0 | ((lowpan6_buffer[lowpan6_offset] >> 4) & 0x0f)); + udphdr->dest = lwip_htons(0xf0b0 | (lowpan6_buffer[lowpan6_offset] & 0x0f)); + lowpan6_offset += 1; + } + + udphdr->chksum = lwip_htons(lowpan6_buffer[lowpan6_offset] << 8 | lowpan6_buffer[lowpan6_offset + 1]); + lowpan6_offset += 2; + udphdr->len = lwip_htons(p->tot_len - lowpan6_offset + UDP_HLEN); + + ip6_offset += UDP_HLEN; + } else { + /* @todo support NHC other than UDP */ + pbuf_free(p); + pbuf_free(q); + return NULL; + } + } + + /* Now we copy leftover contents from p to q, so we have all L2 and L3 headers (and L4?) in a single PBUF. + * Replace p with q, and free p */ + pbuf_header(p, -lowpan6_offset); + MEMCPY((u8_t*)q->payload + ip6_offset, p->payload, p->len); + q->len = q->tot_len = ip6_offset + p->len; + if (p->next != NULL) { + pbuf_cat(q, p->next); + } + p->next = NULL; + pbuf_free(p); + + /* Infer IPv6 payload length for header */ + IP6H_PLEN_SET(ip6hdr, q->tot_len - IP6_HLEN); + + /* all done */ + return q; +} + +err_t +lowpan6_input(struct pbuf * p, struct netif *netif) +{ + u8_t * puc; + s8_t i; + struct ieee_802154_addr src, dest; + u16_t datagram_size, datagram_offset, datagram_tag; + struct lowpan6_reass_helper *lrh, *lrh_temp; + + MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); + + /* Analyze header. @todo validate. */ + puc = (u8_t*)p->payload; + datagram_offset = 5; + if ((puc[1] & 0x0c) == 0x0c) { + dest.addr_len = 8; + for (i = 0; i < 8; i++) { + dest.addr[i] = puc[datagram_offset + 7 - i]; + } + datagram_offset += 8; + } else { + dest.addr_len = 2; + dest.addr[0] = puc[datagram_offset + 1]; + dest.addr[1] = puc[datagram_offset]; + datagram_offset += 2; + } + + datagram_offset += 2; /* skip PAN ID. */ + + if ((puc[1] & 0xc0) == 0xc0) { + src.addr_len = 8; + for (i = 0; i < 8; i++) { + src.addr[i] = puc[datagram_offset + 7 - i]; + } + datagram_offset += 8; + } else { + src.addr_len = 2; + src.addr[0] = puc[datagram_offset + 1]; + src.addr[1] = puc[datagram_offset]; + datagram_offset += 2; + } + + pbuf_header(p, -datagram_offset); /* hide IEEE802.15.4 header. */ + + /* Check dispatch. */ + puc = (u8_t*)p->payload; + + if ((*puc & 0xf8) == 0xc0) { + /* FRAG1 dispatch. add this packet to reassembly list. */ + datagram_size = ((u16_t)(puc[0] & 0x07) << 8) | (u16_t)puc[1]; + datagram_tag = ((u16_t)puc[2] << 8) | (u16_t)puc[3]; + + /* check for duplicate */ + lrh = reass_list; + while (lrh != NULL) { + if ((lrh->sender_addr.addr_len == src.addr_len) && + (memcmp(lrh->sender_addr.addr, src.addr, src.addr_len) == 0)) { + /* address match with packet in reassembly. */ + if ((datagram_tag == lrh->datagram_tag) && (datagram_size == lrh->datagram_size)) { + MIB2_STATS_NETIF_INC(netif, ifindiscards); + /* duplicate fragment. */ + pbuf_free(p); + return ERR_OK; + } else { + /* We are receiving the start of a new datagram. Discard old one (incomplete). */ + lrh_temp = lrh->next_packet; + dequeue_datagram(lrh); + pbuf_free(lrh->pbuf); + mem_free(lrh); + + /* Check next datagram in queue. */ + lrh = lrh_temp; + } + } else { + /* Check next datagram in queue. */ + lrh = lrh->next_packet; + } + } + + pbuf_header(p, -4); /* hide frag1 dispatch */ + + lrh = (struct lowpan6_reass_helper *) mem_malloc(sizeof(struct lowpan6_reass_helper)); + if (lrh == NULL) { + MIB2_STATS_NETIF_INC(netif, ifindiscards); + pbuf_free(p); + return ERR_MEM; + } + + lrh->sender_addr.addr_len = src.addr_len; + for (i = 0; i < src.addr_len; i++) { + lrh->sender_addr.addr[i] = src.addr[i]; + } + lrh->datagram_size = datagram_size; + lrh->datagram_tag = datagram_tag; + lrh->pbuf = p; + lrh->next_packet = reass_list; + lrh->timer = 2; + reass_list = lrh; + + return ERR_OK; + } else if ((*puc & 0xf8) == 0xe0) { + /* FRAGN dispatch, find packet being reassembled. */ + datagram_size = ((u16_t)(puc[0] & 0x07) << 8) | (u16_t)puc[1]; + datagram_tag = ((u16_t)puc[2] << 8) | (u16_t)puc[3]; + datagram_offset = (u16_t)puc[4] << 3; + pbuf_header(p, -5); /* hide frag1 dispatch */ + + for (lrh = reass_list; lrh != NULL; lrh = lrh->next_packet) { + if ((lrh->sender_addr.addr_len == src.addr_len) && + (memcmp(lrh->sender_addr.addr, src.addr, src.addr_len) == 0) && + (datagram_tag == lrh->datagram_tag) && + (datagram_size == lrh->datagram_size)) { + break; + } + } + if (lrh == NULL) { + /* rogue fragment */ + MIB2_STATS_NETIF_INC(netif, ifindiscards); + pbuf_free(p); + return ERR_OK; + } + + if (lrh->pbuf->tot_len < datagram_offset) { + /* duplicate, ignore. */ + pbuf_free(p); + return ERR_OK; + } else if (lrh->pbuf->tot_len > datagram_offset) { + MIB2_STATS_NETIF_INC(netif, ifindiscards); + /* We have missed a fragment. Delete whole reassembly. */ + dequeue_datagram(lrh); + pbuf_free(lrh->pbuf); + mem_free(lrh); + pbuf_free(p); + return ERR_OK; + } + pbuf_cat(lrh->pbuf, p); + p = NULL; + + /* is packet now complete?*/ + if (lrh->pbuf->tot_len >= lrh->datagram_size) { + /* dequeue from reass list. */ + dequeue_datagram(lrh); + + /* get pbuf */ + p = lrh->pbuf; + + /* release helper */ + mem_free(lrh); + } else { + return ERR_OK; + } + } + + if (p == NULL) { + return ERR_OK; + } + + /* We have a complete packet, check dispatch for headers. */ + puc = (u8_t*)p->payload; + + if (*puc == 0x41) { + /* This is a complete IPv6 packet, just skip dispatch byte. */ + pbuf_header(p, -1); /* hide dispatch byte. */ + } else if ((*puc & 0xe0 )== 0x60) { + /* IPv6 headers are compressed using IPHC. */ + p = lowpan6_decompress(p, &src, &dest); + if (p == NULL) { + MIB2_STATS_NETIF_INC(netif, ifindiscards); + return ERR_OK; + } + } else { + MIB2_STATS_NETIF_INC(netif, ifindiscards); + pbuf_free(p); + return ERR_OK; + } + + /* @todo: distinguish unicast/multicast */ + MIB2_STATS_NETIF_INC(netif, ifinucastpkts); + + return ip6_input(p, netif); +} + +err_t +lowpan6_if_init(struct netif *netif) +{ + netif->name[0] = 'L'; + netif->name[1] = '6'; +#if LWIP_IPV4 + netif->output = lowpan4_output; +#endif /* LWIP_IPV4 */ + netif->output_ip6 = lowpan6_output; + + MIB2_INIT_NETIF(netif, snmp_ifType_other, 0); + + /* maximum transfer unit */ + netif->mtu = 1280; + + /* broadcast capability */ + netif->flags = NETIF_FLAG_BROADCAST /* | NETIF_FLAG_LOWPAN6 */; + + return ERR_OK; +} + +err_t +lowpan6_set_pan_id(u16_t pan_id) +{ + ieee_802154_pan_id = pan_id; + + return ERR_OK; +} + +#if !NO_SYS +/** + * Pass a received packet to tcpip_thread for input processing + * + * @param p the received packet, p->payload pointing to the + * IEEE 802.15.4 header. + * @param inp the network interface on which the packet was received + */ +err_t +tcpip_6lowpan_input(struct pbuf *p, struct netif *inp) +{ + return tcpip_inpkt(p, inp, lowpan6_input); +} +#endif /* !NO_SYS */ + +#endif /* LWIP_IPV6 && LWIP_6LOWPAN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/PPPD_FOLLOWUP b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/PPPD_FOLLOWUP new file mode 100644 index 0000000..c231982 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/PPPD_FOLLOWUP @@ -0,0 +1,473 @@ +The lwIP PPP support is based from pppd 2.4.5 (http://ppp.samba.org) with +huge changes to match code size and memory requirements for embedded devices. + +Anyway, pppd has a mature codebase for years and the average commit count +is getting low on their Git repository, meaning that we can follow what +is happening on their side and merge what is relevant for lwIP. + +So, here is the pppd follow up, so that we don't get away too far from pppd. + + +== Patch fetched from from pppd Debian packages == + +This has nothing to do with pppd, but we merged some good patch from +Debian and this is a good place to be. + +- LCP adaptive echo, so that we don't send LCP echo request if we + are receiving data from peer, can be enabled by setting PPP_LCP_ADAPTIVE + to true. + +- IPCP no/replace default route option, were added in the early stage of + the ppp port, but it wasn't really helpful and was disabled when adding + the new API ppp_set_default() call, which gives the lwIP user control over + which one is the default interface, it was actually a requirement if you + are doing PPP over PPP (i.e. PPPoL2TP, VPN link, over PPPoE, ADSL link). + +- using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting + for PADO due to no modem attached, bug reported to pppd bug tracker, fixed + in Debian but not in the latest (at the time when the port were started) + pppd release. + + +== Commits on pppd == + +2010-03-06 - Document +ipv6 and ipv6cp-accept-local + e7537958aee79b3f653c601e903cb31d78fb7dcc + +Don't care. + + +2010-03-06 - Install pppol2tp plugins with sane permissions + 406215672cfadc03017341fe03802d1c7294b903 + +Don't care. + + +2010-03-07 - pppd: Terminate correctly if lcp_lowerup delayed calling + fsm_lowerup + 3eb9e810cfa515543655659b72dde30c54fea0a5 + +Merged 2012-05-17. + + +2010-03-07 - rp_pppoe: Copy acName and pppd_pppoe_service after option parsing + cab58617fd9d328029fffabc788020264b4fa91f + +Don't care, is a patch for pppd/plugins/rp-pppoe/plugin.c which is not part +of the port. + + +2010-08-23 - set and reset options to control environment variables + for scripts. + 2b6310fd24dba8e0fca8999916a162f0a1842a84 + +We can't fork processes in embedded, therefore all the pppd process run +feature is disabled in the port, so we don't care about the new +"environment variables" pppd feature. + + +2010-08-23 - Nit: use _exit when exec fails and restrict values to 0-255 + per POSIX. + 2b4ea140432eeba5a007c0d4e6236bd0e0c12ba4 + +Again, we are not running as a heavy process, so all exit() or _exit() calls +were removed. + + +2010-08-23 - Fix quote handling in configuration files to be more like shell + quoting. + 3089132cdf5b58dbdfc2daf08ec5c08eb47f8aca + +We are not parsing config file, all the filesystem I/O stuff were disabled +in our port. + + +2010-08-24 - rp-pppoe: allow MTU to be increased up to 1500 + fd1dcdf758418f040da3ed801ab001b5e46854e7 + +Only concern changes on RP-PPPoE plugin, which we don't use. + + +2010-09-11 - chat: Allow TIMEOUT value to come from environment variable + ae80bf833e48a6202f44a935a68083ae52ad3824 + +See 2b6310fd24dba8e0fca8999916a162f0a1842a84. + + +2011-03-05 - pppdump: Fix printfs with insufficient arguments + 7b8db569642c83ba3283745034f2e2c95e459423 + +pppdump is a ppp tool outside pppd source tree. + + +2012-05-06 - pppd: Don't unconditionally disable VJ compression under Linux + d8a66adf98a0e525cf38031b42098d539da6eeb6 + +Patch for sys-linux.c, which we don't use. + + +2012-05-20 - Remove old version of Linux if_pppol2tp.h + c41092dd4c49267f232f6cba3d31c6c68bfdf68d + +Not in the port. + + +2012-05-20 - pppd: Make MSCHAP-v2 cope better with packet loss + 08ef47ca532294eb428238c831616748940e24a2 + +This is an interesting patch. However it consumes much more memory for +MSCHAP and I am not sure if the benefit worth it. The PPP client can +always start the authentication again if it failed for whatever reason. + + +2012-05-20 - scripts: Make poff ignore extra arguments to pppd + 18f515f32c9f5723a9c2c912601e04335106534b + +Again, we are not running scripts. + + +2012-05-20 - rp-pppoe plugin: Print leading zeros in MAC address + f5dda0cfc220c4b52e26144096d729e27b30f0f7 + +Again, we are not using the RP-PPPoE plugin. + + +2012-05-20 - pppd: Notify IPv6 up/down as we do for IPv4 + 845cda8fa18939cf56e60b073f63a7efa65336fc + +This is just a patch that adds plugins hooks for IPv6, the plugin interface +was disabled because we don't have .so plugins in embedded. + + +2012-05-20 - pppd: Enable IPV6 by default and fix some warnings + 0b6118239615e98959f7e0b4e746bdd197533248 + +Change on Makefile for IPv6, warnings were already cleared during port. + + +2012-05-20 - contrib: Fix pppgetpass.gtk compilation + 80a8e2ce257ca12cce723519a0f20ea1d663b14a + +Change on Makefile, don't care. + + +2012-05-20 - pppd: Don't crash if crypt() returns NULL + 04c4348108d847e034dd91066cc6843f60d71731 + +We are using the PolarSSL DES implementation that does not return NULL. + + +2012-05-20 - pppd: Eliminate some warnings + c44ae5e6a7338c96eb463881fe709b2dfaffe568 + +Again, we are handling compilation warnings on our own. + + +2012-05-20 - rp-pppoe plugin: Import some fixes from rp-pppoe-3.10 + 1817d83e51a411044e730ba89ebdb0480e1c8cd4 + +Once more, we are not using the RP-PPPoE plugin. + + +2013-01-23 - pppd: Clarify circumstances where DNS1/DNS2 environment variables are set + cf2f5c9538b9400ade23446a194729b0a4113b3a + +Documentation only. + + +2013-02-03 - ppp: ignore unrecognised radiusclient configuration directives + 7f736dde0da3c19855997d9e67370e351e15e923 + +Radius plugin, not in the port. + + +2013-02-03 - pppd: Take out unused %r conversion completely + 356d8d558d844412119aa18c8e5a113bc6459c7b + +Merged 2014-04-15. + + +2013-02-03 - pppd: Arrange to use logwtmp from libutil on Linux + 9617a7eb137f4fee62799a677a9ecf8d834db3f5 + +Patch for sys-linux.c, which we don't use. + + +2013-02-03 - pppdump: Eliminate some compiler warnings + 3e3acf1ba2b3046c072a42c19164788a9e419bd1 + +pppdump is a ppp tool outside pppd source tree. + + +2013-02-03 - chat: Correct spelling errors in the man page + 8dea1b969d266ccbf6f3a8c5474eb6dcd8838e3b + +Documentation only. + + +2013-02-03 - pppd: Fix spelling errors in man page + 9e05a25d76b3f83096c661678010320df673df6b + +Documentation only. + + +2013-02-03 - plugins/passprompt: Fix potential out-of-bounds array reference + 8edb889b753056a691a3e4b217a110a35f9fdedb + +Plugin patch, we do not have plugins. + + +2013-02-03 - chat: Fix *roff errors in the man page + a7c3489eeaf44e83ce592143c7c8a5b5c29f4c48 + +Documentation only. + + +2013-03-02 - pppd: Fix man page description of case when remote IP address isn't known + 224841f4799f4f1e2e71bc490c54448d66740f4f + +Documentation only. + + +2013-03-02 - pppd: Add master_detach option + 398ed2585640d198c53e736ee5bbd67f7ce8168e + +Option for multilink support, we do not support multilink and this option +is about detaching from the terminal, which is out of the embedded scope. + + +2013-03-11 - pppd: Default exit status to EXIT_CONNECT_FAILED during connection phase + 225361d64ae737afdc8cb57579a2f33525461bc9 + +Commented out in our port, and already fixed by a previously applied Debian patch. + + +2013-03-11 - pppstats: Fix undefined macro in man page + d16a3985eade5280b8e171f5dd0670a91cba0d39 + +Documentation only. + + +2013-05-11 - plugins/radius: Handle bindaddr keyword in radiusclient.conf + d883b2dbafeed3ebd9d7a56ab1469373bd001a3b + +Radius plugin, not in the port. + + +2013-06-09 - pppoatm: Remove explicit loading of pppoatm kernel module + 52cd43a84bea524033b918b603698104f221bbb7 + +PPPoATM plugin, not in the port. + + +2013-06-09 - pppd: Fix segfault in update_db_entry() + 37476164f15a45015310b9d4b197c2d7db1f7f8f + +We do not use the samba db. + + +2013-06-09 - chat: Fix some text that was intended to be literal + cd9683676618adcee8add2c3cfa3382341b5a1f6 + +Documentation only. + + +2013-06-09 - README.pppoe: Minor semantic fix + b5b8898af6fd3d44e873cfc66810ace5f1f47e17 + +Documentation only. + + +2013-06-10 - radius: Handle additional attributes + 2f581cd986a56f2ec4a95abad4f8297a1b10d7e2 + +Radius plugin, not in the port. + + +2013-06-10 - chat, pppd: Use \e instead of \\ in man pages + 8d6942415d22f6ca4377340ca26e345c3f5fa5db + +Documentation only. + + +2014-01-02 - pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v + 906814431bddeb2061825fa1ebad1a967b6d87a9 + +Merged 2014-04-15. + + +2014-01-02 - pppd: Accept IPCP ConfAck packets containing MS-WINS options + a243f217f1c6ac1aa7793806bc88590d077f490a + +Merged 2014-04-15. + + +2014-01-02 - config: Update Solaris compiler options and enable CHAPMS and IPV6 + 99c46caaed01b7edba87962aa52b77fad61bfd7b + +Solaris port, don't care. + + +2014-01-02 - Update README and patchlevel for 2.4.6 release + 4043750fca36e7e0eb90d702e048ad1da4929418 + +Just release stuff. + + +2014-02-18 - pppd: Add option "stop-bits" to set number of serial port stop bits. + ad993a20ee485f0d0e2ac4105221641b200da6e2 + +Low level serial port, not in the port. + + +2014-03-09 - pppd: Separate IPv6 handling for sifup/sifdown + b04d2dc6df5c6b5650fea44250d58757ee3dac4a + +Reimplemented. + + +2014-03-09 - pppol2tp: Connect up/down events to notifiers and add IPv6 ones + fafbe50251efc7d6b4a8be652d085316e112b34f + +Not in the port. + + +2014-03-09 - pppd: Add declarations to eliminate compile warnings + 50967962addebe15c7a7e63116ff46a0441dc464 + +We are handling compilation warnings on our own + + +2014-03-09 - pppd: Eliminate some unnecessary ifdefs + de8da14d845ee6db9236ccfddabf1d8ebf045ddb + +We mostly did that previously. Anyway, merged 2014-12-24. + + +2014-08-01 - radius: Fix realms-config-file option + 880a81be7c8e0fe8567227bc17a1bff3ea035943 + +Radius plugin, not in the port. + + +2014-08-01 - pppd: Eliminate potential integer overflow in option parsing + 7658e8257183f062dc01f87969c140707c7e52cb + +pppd config file parser, not in the port. + + +2014-08-01 - pppd: Eliminate memory leak with multiple instances of a string option + b94b7fbbaa0589aa6ec5fdc733aeb9ff294d2656 + +pppd config file parser, not in the port. + + +2014-08-01 - pppd: Fix a stack variable overflow in MSCHAP-v2 + 36733a891fb56594fcee580f667b33a64b990981 + +This fixes a bug introduced in 08ef47ca ("pppd: Make MSCHAP-v2 cope better with packet loss"). + +We didn't merge 08ef47ca ;-) + + +2014-08-01 - winbind plugin: Add -DMPPE=1 to eliminate compiler warnings + 2b05e22c62095e97dd0a97e4b5588402c2185071 + +Linux plugin, not in the port. + + +2014-08-09 - Update README and patchlevel for 2.4.7 release + 6e8eaa7a78b31cdab2edf140a9c8afdb02ffaca5 + +Just release stuff. + + +2014-08-10 - abort on errors in subdir builds + 5e90783d11a59268e05f4cfb29ce2343b13e8ab2 + +Linux Makefile, not in the port. + + +2014-06-03 - pppd: add support for defaultroute-metric option + 35e5a569c988b1ff865b02a24d9a727a00db4da9 + +Only necessary for Linux, lwIP does not support route metrics. + + +2014-12-13 - scripts: Avoid killing wrong pppd + 67811a647d399db5d188a242827760615a0f86b5 + +pppd helper script, not in the port. + + +2014-12-20 - pppd: Fix sign-extension when displaying bytes in octal + 5e8c3cb256a7e86e3572a82a75d51c6850efdbdc + +Merged 2016-07-02. + + +2015-03-01 - Suppress false error message on PPPoE disconnect + 219aac3b53d0827549377f1bfe22853ee52d4405 + +PPPoE plugin, not in the port. + + +2015-03-01 - Send PADT on PPPoE disconnect + cd2c14f998c57bbe6a01dc5854f2763c0d7f31fb + +PPPoE plugin, not in the port. And our PPPoE implementation already does +that: pppoe_disconnect() calls pppoe_send_padt(). + + +2015-08-14 - pppd: ipxcp: Prevent buffer overrun on remote router name + fe149de624f96629a7f46732055d8f718c74b856 + +We never ported IPX support. lwIP does not support IPX. + + +2015-03-25 - pppd: Fix ccp_options.mppe type + 234edab99a6bb250cc9ecd384cca27b0c8b475ce + +We found that while working on MPPE support in lwIP, that's our patch ;-) + + +2015-03-24 - pppd: Fix ccp_cilen calculated size if both deflate_correct and deflate_draft are enabled + 094cb8ae4c61db225e67fedadb4964f846dd0c27 + +We found that while working on MPPE support in lwIP, that's our patch ;-) + + +2015-08-14 - Merge branch 'master' of https://github.com/ncopa/ppp + 3a5c9a8fbc8970375cd881151d44e4b6fe249c6a + +Merge commit, we don't care. + + +2015-08-14 - Merge branch 'master' of git://github.com/vapier/ppp + 912e4fc6665aca188dced7ea7fdc663ce5a2dd24 + +Merge commit, we don't care. + + +2015-08-14 - Merge branch 'bug_fix' of git://github.com/radaiming/ppp + dfd33d7f526ecd7b39dd1bba8101260d02af5ebb + +Merge commit, we don't care. + + +2015-08-14 - Merge branch 'master' of git://github.com/pprindeville/ppp + aa4a985f6114d08cf4e47634fb6325da71016473 + +Merge commit, we don't care. + + +2015-08-14 - Merge branch 'no-error-on-already-closed' of git://github.com/farnz/ppp + 6edf252483b30dbcdcc5059f01831455365d5b6e + +Merge commit, we don't care. + + +2015-08-14 - Merge branch 'send-padt-on-disconnect' of git://github.com/farnz/ppp + 84684243d651f55f6df69d2a6707b52fbbe62bb9 + +Merge commit, we don't care. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/auth.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/auth.c new file mode 100644 index 0000000..c8673ad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/auth.c @@ -0,0 +1,2510 @@ +/* + * auth.c - PPP authentication and phase control. + * + * Copyright (c) 1993-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Derived from main.c, which is: + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(_PATH_LASTLOG) && defined(__linux__) +#include +#endif + +#include +#include +#include + +#ifdef HAS_SHADOW +#include +#ifndef PW_PPP +#define PW_PPP PW_LOGIN +#endif +#endif + +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/lcp.h" +#if CCP_SUPPORT +#include "netif/ppp/ccp.h" +#endif /* CCP_SUPPORT */ +#if ECP_SUPPORT +#include "netif/ppp/ecp.h" +#endif /* ECP_SUPPORT */ +#include "netif/ppp/ipcp.h" +#if PAP_SUPPORT +#include "netif/ppp/upap.h" +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT +#include "netif/ppp/chap-new.h" +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT +#include "netif/ppp/eap.h" +#endif /* EAP_SUPPORT */ +#if CBCP_SUPPORT +#include "netif/ppp/cbcp.h" +#endif + +#if 0 /* UNUSED */ +#include "session.h" +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +/* Bits in scan_authfile return value */ +#define NONWILD_SERVER 1 +#define NONWILD_CLIENT 2 + +#define ISWILD(word) (word[0] == '*' && word[1] == 0) +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +/* List of addresses which the peer may use. */ +static struct permitted_ip *addresses[NUM_PPP]; + +/* Wordlist giving addresses which the peer may use + without authenticating itself. */ +static struct wordlist *noauth_addrs; + +/* Remote telephone number, if available */ +char remote_number[MAXNAMELEN]; + +/* Wordlist giving remote telephone numbers which may connect. */ +static struct wordlist *permitted_numbers; + +/* Extra options to apply, from the secrets file entry for the peer. */ +static struct wordlist *extra_options; +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +/* Set if we require authentication only because we have a default route. */ +static bool default_auth; + +/* Hook to enable a plugin to control the idle time limit */ +int (*idle_time_hook) (struct ppp_idle *) = NULL; + +/* Hook for a plugin to say whether we can possibly authenticate any peer */ +int (*pap_check_hook) (void) = NULL; + +/* Hook for a plugin to check the PAP user and password */ +int (*pap_auth_hook) (char *user, char *passwd, char **msgp, + struct wordlist **paddrs, + struct wordlist **popts) = NULL; + +/* Hook for a plugin to know about the PAP user logout */ +void (*pap_logout_hook) (void) = NULL; + +/* Hook for a plugin to get the PAP password for authenticating us */ +int (*pap_passwd_hook) (char *user, char *passwd) = NULL; + +/* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */ +int (*chap_check_hook) (void) = NULL; + +/* Hook for a plugin to get the CHAP password for authenticating us */ +int (*chap_passwd_hook) (char *user, char *passwd) = NULL; + +/* Hook for a plugin to say whether it is OK if the peer + refuses to authenticate. */ +int (*null_auth_hook) (struct wordlist **paddrs, + struct wordlist **popts) = NULL; + +int (*allowed_address_hook) (u32_t addr) = NULL; +#endif /* UNUSED */ + +#ifdef HAVE_MULTILINK +/* Hook for plugin to hear when an interface joins a multilink bundle */ +void (*multilink_join_hook) (void) = NULL; +#endif + +#if PPP_NOTIFY +/* A notifier for when the peer has authenticated itself, + and we are proceeding to the network phase. */ +struct notifier *auth_up_notifier = NULL; + +/* A notifier for when the link goes down. */ +struct notifier *link_down_notifier = NULL; +#endif /* PPP_NOTIFY */ + +/* + * Option variables. + */ +#if 0 /* MOVED TO ppp_settings */ +bool uselogin = 0; /* Use /etc/passwd for checking PAP */ +bool session_mgmt = 0; /* Do session management (login records) */ +bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ +bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ +bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ +bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ +#if MSCHAP_SUPPORT +bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +#else /* MSCHAP_SUPPORT */ +bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +#endif /* MSCHAP_SUPPORT */ +bool usehostname = 0; /* Use hostname for our_name */ +bool auth_required = 0; /* Always require authentication from peer */ +bool allow_any_ip = 0; /* Allow peer to use any IP address */ +bool explicit_remote = 0; /* User specified explicit remote name */ +bool explicit_user = 0; /* Set if "user" option supplied */ +bool explicit_passwd = 0; /* Set if "password" option supplied */ +char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +static char *uafname; /* name of most recent +ua file */ + +extern char *crypt (const char *, const char *); +#endif /* UNUSED */ +/* Prototypes for procedures local to this file. */ + +static void network_phase(ppp_pcb *pcb); +#if PPP_IDLETIMELIMIT +static void check_idle(void *arg); +#endif /* PPP_IDLETIMELIMIT */ +#if PPP_MAXCONNECT +static void connect_time_expired(void *arg); +#endif /* PPP_MAXCONNECT */ +#if 0 /* UNUSED */ +static int null_login (int); +/* static int get_pap_passwd (char *); */ +static int have_pap_secret (int *); +static int have_chap_secret (char *, char *, int, int *); +static int have_srp_secret (char *client, char *server, int need_ip, + int *lacks_ipp); +static int ip_addr_check (u32_t, struct permitted_ip *); +static int scan_authfile (FILE *, char *, char *, char *, + struct wordlist **, struct wordlist **, + char *, int); +static void free_wordlist (struct wordlist *); +static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); +static int some_ip_ok (struct wordlist *); +static int setupapfile (char **); +static int privgroup (char **); +static int set_noauth_addr (char **); +static int set_permitted_number (char **); +static void check_access (FILE *, char *); +static int wordlist_count (struct wordlist *); +#endif /* UNUSED */ + +#ifdef MAXOCTETS +static void check_maxoctets (void *); +#endif + +#if PPP_OPTIONS +/* + * Authentication-related options. + */ +option_t auth_options[] = { + { "auth", o_bool, &auth_required, + "Require authentication from peer", OPT_PRIO | 1 }, + { "noauth", o_bool, &auth_required, + "Don't require peer to authenticate", OPT_PRIOSUB | OPT_PRIV, + &allow_any_ip }, + { "require-pap", o_bool, &lcp_wantoptions[0].neg_upap, + "Require PAP authentication from peer", + OPT_PRIOSUB | 1, &auth_required }, + { "+pap", o_bool, &lcp_wantoptions[0].neg_upap, + "Require PAP authentication from peer", + OPT_ALIAS | OPT_PRIOSUB | 1, &auth_required }, + { "require-chap", o_bool, &auth_required, + "Require CHAP authentication from peer", + OPT_PRIOSUB | OPT_A2OR | MDTYPE_MD5, + &lcp_wantoptions[0].chap_mdtype }, + { "+chap", o_bool, &auth_required, + "Require CHAP authentication from peer", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2OR | MDTYPE_MD5, + &lcp_wantoptions[0].chap_mdtype }, +#if MSCHAP_SUPPORT + { "require-mschap", o_bool, &auth_required, + "Require MS-CHAP authentication from peer", + OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT, + &lcp_wantoptions[0].chap_mdtype }, + { "+mschap", o_bool, &auth_required, + "Require MS-CHAP authentication from peer", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT, + &lcp_wantoptions[0].chap_mdtype }, + { "require-mschap-v2", o_bool, &auth_required, + "Require MS-CHAPv2 authentication from peer", + OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT_V2, + &lcp_wantoptions[0].chap_mdtype }, + { "+mschap-v2", o_bool, &auth_required, + "Require MS-CHAPv2 authentication from peer", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT_V2, + &lcp_wantoptions[0].chap_mdtype }, +#endif /* MSCHAP_SUPPORT */ +#if 0 + { "refuse-pap", o_bool, &refuse_pap, + "Don't agree to auth to peer with PAP", 1 }, + { "-pap", o_bool, &refuse_pap, + "Don't allow PAP authentication with peer", OPT_ALIAS | 1 }, + { "refuse-chap", o_bool, &refuse_chap, + "Don't agree to auth to peer with CHAP", + OPT_A2CLRB | MDTYPE_MD5, + &lcp_allowoptions[0].chap_mdtype }, + { "-chap", o_bool, &refuse_chap, + "Don't allow CHAP authentication with peer", + OPT_ALIAS | OPT_A2CLRB | MDTYPE_MD5, + &lcp_allowoptions[0].chap_mdtype }, +#endif +#if MSCHAP_SUPPORT +#if 0 + { "refuse-mschap", o_bool, &refuse_mschap, + "Don't agree to auth to peer with MS-CHAP", + OPT_A2CLRB | MDTYPE_MICROSOFT, + &lcp_allowoptions[0].chap_mdtype }, + { "-mschap", o_bool, &refuse_mschap, + "Don't allow MS-CHAP authentication with peer", + OPT_ALIAS | OPT_A2CLRB | MDTYPE_MICROSOFT, + &lcp_allowoptions[0].chap_mdtype }, + { "refuse-mschap-v2", o_bool, &refuse_mschap_v2, + "Don't agree to auth to peer with MS-CHAPv2", + OPT_A2CLRB | MDTYPE_MICROSOFT_V2, + &lcp_allowoptions[0].chap_mdtype }, + { "-mschap-v2", o_bool, &refuse_mschap_v2, + "Don't allow MS-CHAPv2 authentication with peer", + OPT_ALIAS | OPT_A2CLRB | MDTYPE_MICROSOFT_V2, + &lcp_allowoptions[0].chap_mdtype }, +#endif +#endif /* MSCHAP_SUPPORT*/ +#if EAP_SUPPORT + { "require-eap", o_bool, &lcp_wantoptions[0].neg_eap, + "Require EAP authentication from peer", OPT_PRIOSUB | 1, + &auth_required }, +#if 0 + { "refuse-eap", o_bool, &refuse_eap, + "Don't agree to authenticate to peer with EAP", 1 }, +#endif +#endif /* EAP_SUPPORT */ + { "name", o_string, our_name, + "Set local name for authentication", + OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXNAMELEN }, + + { "+ua", o_special, (void *)setupapfile, + "Get PAP user and password from file", + OPT_PRIO | OPT_A2STRVAL, &uafname }, + +#if 0 + { "user", o_string, user, + "Set name for auth with peer", OPT_PRIO | OPT_STATIC, + &explicit_user, MAXNAMELEN }, + + { "password", o_string, passwd, + "Password for authenticating us to the peer", + OPT_PRIO | OPT_STATIC | OPT_HIDE, + &explicit_passwd, MAXSECRETLEN }, +#endif + + { "usehostname", o_bool, &usehostname, + "Must use hostname for authentication", 1 }, + + { "remotename", o_string, remote_name, + "Set remote name for authentication", OPT_PRIO | OPT_STATIC, + &explicit_remote, MAXNAMELEN }, + + { "login", o_bool, &uselogin, + "Use system password database for PAP", OPT_A2COPY | 1 , + &session_mgmt }, + { "enable-session", o_bool, &session_mgmt, + "Enable session accounting for remote peers", OPT_PRIV | 1 }, + + { "papcrypt", o_bool, &cryptpap, + "PAP passwords are encrypted", 1 }, + + { "privgroup", o_special, (void *)privgroup, + "Allow group members to use privileged options", OPT_PRIV | OPT_A2LIST }, + + { "allow-ip", o_special, (void *)set_noauth_addr, + "Set IP address(es) which can be used without authentication", + OPT_PRIV | OPT_A2LIST }, + + { "remotenumber", o_string, remote_number, + "Set remote telephone number for authentication", OPT_PRIO | OPT_STATIC, + NULL, MAXNAMELEN }, + + { "allow-number", o_special, (void *)set_permitted_number, + "Set telephone number(s) which are allowed to connect", + OPT_PRIV | OPT_A2LIST }, + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +#if 0 /* UNUSED */ +/* + * setupapfile - specifies UPAP info for authenticating with peer. + */ +static int +setupapfile(argv) + char **argv; +{ + FILE *ufile; + int l; + uid_t euid; + char u[MAXNAMELEN], p[MAXSECRETLEN]; + char *fname; + + lcp_allowoptions[0].neg_upap = 1; + + /* open user info file */ + fname = strdup(*argv); + if (fname == NULL) + novm("+ua file name"); + euid = geteuid(); + if (seteuid(getuid()) == -1) { + option_error("unable to reset uid before opening %s: %m", fname); + return 0; + } + ufile = fopen(fname, "r"); + if (seteuid(euid) == -1) + fatal("unable to regain privileges: %m"); + if (ufile == NULL) { + option_error("unable to open user login data file %s", fname); + return 0; + } + check_access(ufile, fname); + uafname = fname; + + /* get username */ + if (fgets(u, MAXNAMELEN - 1, ufile) == NULL + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); + option_error("unable to read user login data file %s", fname); + return 0; + } + fclose(ufile); + + /* get rid of newlines */ + l = strlen(u); + if (l > 0 && u[l-1] == '\n') + u[l-1] = 0; + l = strlen(p); + if (l > 0 && p[l-1] == '\n') + p[l-1] = 0; + + if (override_value("user", option_priority, fname)) { + strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); + explicit_user = 1; + } + if (override_value("passwd", option_priority, fname)) { + strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); + explicit_passwd = 1; + } + + return (1); +} + +/* + * privgroup - allow members of the group to have privileged access. + */ +static int +privgroup(argv) + char **argv; +{ + struct group *g; + int i; + + g = getgrnam(*argv); + if (g == 0) { + option_error("group %s is unknown", *argv); + return 0; + } + for (i = 0; i < ngroups; ++i) { + if (groups[i] == g->gr_gid) { + privileged = 1; + break; + } + } + return 1; +} + + +/* + * set_noauth_addr - set address(es) that can be used without authentication. + * Equivalent to specifying an entry like `"" * "" addr' in pap-secrets. + */ +static int +set_noauth_addr(argv) + char **argv; +{ + char *addr = *argv; + int l = strlen(addr) + 1; + struct wordlist *wp; + + wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); + if (wp == NULL) + novm("allow-ip argument"); + wp->word = (char *) (wp + 1); + wp->next = noauth_addrs; + MEMCPY(wp->word, addr, l); + noauth_addrs = wp; + return 1; +} + + +/* + * set_permitted_number - set remote telephone number(s) that may connect. + */ +static int +set_permitted_number(argv) + char **argv; +{ + char *number = *argv; + int l = strlen(number) + 1; + struct wordlist *wp; + + wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); + if (wp == NULL) + novm("allow-number argument"); + wp->word = (char *) (wp + 1); + wp->next = permitted_numbers; + MEMCPY(wp->word, number, l); + permitted_numbers = wp; + return 1; +} +#endif + +/* + * An Open on LCP has requested a change from Dead to Establish phase. + */ +void link_required(ppp_pcb *pcb) { + LWIP_UNUSED_ARG(pcb); +} + +#if 0 +/* + * Bring the link up to the point of being able to do ppp. + */ +void start_link(unit) + int unit; +{ + ppp_pcb *pcb = &ppp_pcb_list[unit]; + char *msg; + + status = EXIT_NEGOTIATION_FAILED; + new_phase(pcb, PPP_PHASE_SERIALCONN); + + hungup = 0; + devfd = the_channel->connect(); + msg = "Connect script failed"; + if (devfd < 0) + goto fail; + + /* set up the serial device as a ppp interface */ + /* + * N.B. we used to do tdb_writelock/tdb_writeunlock around this + * (from establish_ppp to set_ifunit). However, we won't be + * doing the set_ifunit in multilink mode, which is the only time + * we need the atomicity that the tdb_writelock/tdb_writeunlock + * gives us. Thus we don't need the tdb_writelock/tdb_writeunlock. + */ + fd_ppp = the_channel->establish_ppp(devfd); + msg = "ppp establishment failed"; + if (fd_ppp < 0) { + status = EXIT_FATAL_ERROR; + goto disconnect; + } + + if (!demand && ifunit >= 0) + set_ifunit(1); + + /* + * Start opening the connection and wait for + * incoming events (reply, timeout, etc.). + */ + if (ifunit >= 0) + ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); + else + ppp_notice("Starting negotiation on %s", ppp_devnam); + add_fd(fd_ppp); + + new_phase(pcb, PPP_PHASE_ESTABLISH); + + lcp_lowerup(pcb); + return; + + disconnect: + new_phase(pcb, PPP_PHASE_DISCONNECT); + if (the_channel->disconnect) + the_channel->disconnect(); + + fail: + new_phase(pcb, PPP_PHASE_DEAD); + if (the_channel->cleanup) + (*the_channel->cleanup)(); +} +#endif + +/* + * LCP has terminated the link; go to the Dead phase and take the + * physical layer down. + */ +void link_terminated(ppp_pcb *pcb) { + if (pcb->phase == PPP_PHASE_DEAD +#ifdef HAVE_MULTILINK + || pcb->phase == PPP_PHASE_MASTER +#endif /* HAVE_MULTILINK */ + ) + return; + new_phase(pcb, PPP_PHASE_DISCONNECT); + +#if 0 /* UNUSED */ + if (pap_logout_hook) { + pap_logout_hook(); + } + session_end(devnam); +#endif /* UNUSED */ + + if (!doing_multilink) { + ppp_notice("Connection terminated."); +#if PPP_STATS_SUPPORT + print_link_stats(); +#endif /* PPP_STATS_SUPPORT */ + } else + ppp_notice("Link terminated."); + + lcp_lowerdown(pcb); + + ppp_link_terminated(pcb); +#if 0 + /* + * Delete pid files before disestablishing ppp. Otherwise it + * can happen that another pppd gets the same unit and then + * we delete its pid file. + */ + if (!doing_multilink && !demand) + remove_pidfiles(); + + /* + * If we may want to bring the link up again, transfer + * the ppp unit back to the loopback. Set the + * real serial device back to its normal mode of operation. + */ + if (fd_ppp >= 0) { + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + if (doing_multilink) + mp_exit_bundle(); + fd_ppp = -1; + } + if (!hungup) + lcp_lowerdown(pcb); + if (!doing_multilink && !demand) + script_unsetenv("IFNAME"); + + /* + * Run disconnector script, if requested. + * XXX we may not be able to do this if the line has hung up! + */ + if (devfd >= 0 && the_channel->disconnect) { + the_channel->disconnect(); + devfd = -1; + } + if (the_channel->cleanup) + (*the_channel->cleanup)(); + + if (doing_multilink && multilink_master) { + if (!bundle_terminating) + new_phase(pcb, PPP_PHASE_MASTER); + else + mp_bundle_terminated(); + } else + new_phase(pcb, PPP_PHASE_DEAD); +#endif +} + +/* + * LCP has gone down; it will either die or try to re-establish. + */ +void link_down(ppp_pcb *pcb) { +#if PPP_NOTIFY + notify(link_down_notifier, 0); +#endif /* PPP_NOTIFY */ + + if (!doing_multilink) { + upper_layers_down(pcb); + if (pcb->phase != PPP_PHASE_DEAD +#ifdef HAVE_MULTILINK + && pcb->phase != PPP_PHASE_MASTER +#endif /* HAVE_MULTILINK */ + ) + new_phase(pcb, PPP_PHASE_ESTABLISH); + } + /* XXX if doing_multilink, should do something to stop + network-layer traffic on the link */ +} + +void upper_layers_down(ppp_pcb *pcb) { + int i; + const struct protent *protp; + + for (i = 0; (protp = protocols[i]) != NULL; ++i) { + if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) + (*protp->lowerdown)(pcb); + if (protp->protocol < 0xC000 && protp->close != NULL) + (*protp->close)(pcb, "LCP down"); + } + pcb->num_np_open = 0; + pcb->num_np_up = 0; +} + +/* + * The link is established. + * Proceed to the Dead, Authenticate or Network phase as appropriate. + */ +void link_established(ppp_pcb *pcb) { +#if PPP_AUTH_SUPPORT + int auth; +#if PPP_SERVER +#if PAP_SUPPORT + lcp_options *wo = &pcb->lcp_wantoptions; +#endif /* PAP_SUPPORT */ + lcp_options *go = &pcb->lcp_gotoptions; +#endif /* PPP_SERVER */ + lcp_options *ho = &pcb->lcp_hisoptions; +#endif /* PPP_AUTH_SUPPORT */ + int i; + const struct protent *protp; + + /* + * Tell higher-level protocols that LCP is up. + */ + if (!doing_multilink) { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol != PPP_LCP + && protp->lowerup != NULL) + (*protp->lowerup)(pcb); + } + +#if PPP_AUTH_SUPPORT +#if PPP_SERVER +#if PPP_ALLOWED_ADDRS + if (!auth_required && noauth_addrs != NULL) + set_allowed_addrs(unit, NULL, NULL); +#endif /* PPP_ALLOWED_ADDRS */ + + if (pcb->settings.auth_required && !(0 +#if PAP_SUPPORT + || go->neg_upap +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + || go->neg_chap +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + || go->neg_eap +#endif /* EAP_SUPPORT */ + )) { + +#if PPP_ALLOWED_ADDRS + /* + * We wanted the peer to authenticate itself, and it refused: + * if we have some address(es) it can use without auth, fine, + * otherwise treat it as though it authenticated with PAP using + * a username of "" and a password of "". If that's not OK, + * boot it out. + */ + if (noauth_addrs != NULL) { + set_allowed_addrs(unit, NULL, NULL); + } else +#endif /* PPP_ALLOWED_ADDRS */ + if (!pcb->settings.null_login +#if PAP_SUPPORT + || !wo->neg_upap +#endif /* PAP_SUPPORT */ + ) { + ppp_warn("peer refused to authenticate: terminating link"); +#if 0 /* UNUSED */ + status = EXIT_PEER_AUTH_FAILED; +#endif /* UNUSED */ + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "peer refused to authenticate"); + return; + } + } +#endif /* PPP_SERVER */ + + new_phase(pcb, PPP_PHASE_AUTHENTICATE); + auth = 0; +#if PPP_SERVER +#if EAP_SUPPORT + if (go->neg_eap) { + eap_authpeer(pcb, PPP_OUR_NAME); + auth |= EAP_PEER; + } else +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT + if (go->neg_chap) { + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); + auth |= CHAP_PEER; + } else +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + if (go->neg_upap) { + upap_authpeer(pcb); + auth |= PAP_PEER; + } else +#endif /* PAP_SUPPORT */ + {} +#endif /* PPP_SERVER */ + +#if EAP_SUPPORT + if (ho->neg_eap) { + eap_authwithpeer(pcb, pcb->settings.user); + auth |= EAP_WITHPEER; + } else +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT + if (ho->neg_chap) { + chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); + auth |= CHAP_WITHPEER; + } else +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + if (ho->neg_upap) { + upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); + auth |= PAP_WITHPEER; + } else +#endif /* PAP_SUPPORT */ + {} + + pcb->auth_pending = auth; + pcb->auth_done = 0; + + if (!auth) +#endif /* PPP_AUTH_SUPPORT */ + network_phase(pcb); +} + +/* + * Proceed to the network phase. + */ +static void network_phase(ppp_pcb *pcb) { +#if CBCP_SUPPORT + ppp_pcb *pcb = &ppp_pcb_list[unit]; +#endif +#if 0 /* UNUSED */ + lcp_options *go = &lcp_gotoptions[unit]; +#endif /* UNUSED */ + +#if 0 /* UNUSED */ + /* Log calling number. */ + if (*remote_number) + ppp_notice("peer from calling number %q authorized", remote_number); +#endif /* UNUSED */ + +#if PPP_NOTIFY + /* + * If the peer had to authenticate, notify it now. + */ + if (0 +#if CHAP_SUPPORT + || go->neg_chap +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + || go->neg_upap +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + || go->neg_eap +#endif /* EAP_SUPPORT */ + ) { + notify(auth_up_notifier, 0); + } +#endif /* PPP_NOTIFY */ + +#if CBCP_SUPPORT + /* + * If we negotiated callback, do it now. + */ + if (go->neg_cbcp) { + new_phase(pcb, PPP_PHASE_CALLBACK); + (*cbcp_protent.open)(pcb); + return; + } +#endif + +#if PPP_OPTIONS + /* + * Process extra options from the secrets file + */ + if (extra_options) { + options_from_list(extra_options, 1); + free_wordlist(extra_options); + extra_options = 0; + } +#endif /* PPP_OPTIONS */ + start_networks(pcb); +} + +void start_networks(ppp_pcb *pcb) { +#if CCP_SUPPORT || ECP_SUPPORT + int i; + const struct protent *protp; +#endif /* CCP_SUPPORT || ECP_SUPPORT */ + + new_phase(pcb, PPP_PHASE_NETWORK); + +#ifdef HAVE_MULTILINK + if (multilink) { + if (mp_join_bundle()) { + if (multilink_join_hook) + (*multilink_join_hook)(); + if (updetach && !nodetach) + detach(); + return; + } + } +#endif /* HAVE_MULTILINK */ + +#ifdef PPP_FILTER + if (!demand) + set_filters(&pass_filter, &active_filter); +#endif +#if CCP_SUPPORT || ECP_SUPPORT + /* Start CCP and ECP */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if ( + (0 +#if ECP_SUPPORT + || protp->protocol == PPP_ECP +#endif /* ECP_SUPPORT */ +#if CCP_SUPPORT + || protp->protocol == PPP_CCP +#endif /* CCP_SUPPORT */ + ) + && protp->open != NULL) + (*protp->open)(pcb); +#endif /* CCP_SUPPORT || ECP_SUPPORT */ + + /* + * Bring up other network protocols iff encryption is not required. + */ + if (1 +#if ECP_SUPPORT + && !ecp_gotoptions[unit].required +#endif /* ECP_SUPPORT */ +#if MPPE_SUPPORT + && !pcb->ccp_gotoptions.mppe +#endif /* MPPE_SUPPORT */ + ) + continue_networks(pcb); +} + +void continue_networks(ppp_pcb *pcb) { + int i; + const struct protent *protp; + + /* + * Start the "real" network protocols. + */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol < 0xC000 +#if CCP_SUPPORT + && protp->protocol != PPP_CCP +#endif /* CCP_SUPPORT */ +#if ECP_SUPPORT + && protp->protocol != PPP_ECP +#endif /* ECP_SUPPORT */ + && protp->open != NULL) { + (*protp->open)(pcb); + ++pcb->num_np_open; + } + + if (pcb->num_np_open == 0) + /* nothing to do */ + lcp_close(pcb, "No network protocols running"); +} + +#if PPP_AUTH_SUPPORT +#if PPP_SERVER +/* + * auth_check_passwd - Check the user name and passwd against configuration. + * + * returns: + * 0: Authentication failed. + * 1: Authentication succeeded. + * In either case, msg points to an appropriate message and msglen to the message len. + */ +int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen) { + int secretuserlen; + int secretpasswdlen; + + if (pcb->settings.user && pcb->settings.passwd) { + secretuserlen = (int)strlen(pcb->settings.user); + secretpasswdlen = (int)strlen(pcb->settings.passwd); + if (secretuserlen == userlen + && secretpasswdlen == passwdlen + && !memcmp(auser, pcb->settings.user, userlen) + && !memcmp(apasswd, pcb->settings.passwd, passwdlen) ) { + *msg = "Login ok"; + *msglen = sizeof("Login ok")-1; + return 1; + } + } + + *msg = "Login incorrect"; + *msglen = sizeof("Login incorrect")-1; + return 0; +} + +/* + * The peer has failed to authenticate himself using `protocol'. + */ +void auth_peer_fail(ppp_pcb *pcb, int protocol) { + LWIP_UNUSED_ARG(protocol); + /* + * Authentication failure: take the link down + */ +#if 0 /* UNUSED */ + status = EXIT_PEER_AUTH_FAILED; +#endif /* UNUSED */ + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "Authentication failed"); +} + +/* + * The peer has been successfully authenticated using `protocol'. + */ +void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen) { + int bit; +#ifndef HAVE_MULTILINK + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(namelen); +#endif /* HAVE_MULTILINK */ + + switch (protocol) { +#if CHAP_SUPPORT + case PPP_CHAP: + bit = CHAP_PEER; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_PEER; + break; +#if MSCHAP_SUPPORT + case CHAP_MICROSOFT: + bit |= CHAP_MS_PEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_PEER; + break; +#endif /* MSCHAP_SUPPORT */ + default: + break; + } + break; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + case PPP_PAP: + bit = PAP_PEER; + break; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + case PPP_EAP: + bit = EAP_PEER; + break; +#endif /* EAP_SUPPORT */ + default: + ppp_warn("auth_peer_success: unknown protocol %x", protocol); + return; + } + +#ifdef HAVE_MULTILINK + /* + * Save the authenticated name of the peer for later. + */ + if (namelen > (int)sizeof(pcb->peer_authname) - 1) + namelen = (int)sizeof(pcb->peer_authname) - 1; + MEMCPY(pcb->peer_authname, name, namelen); + pcb->peer_authname[namelen] = 0; +#endif /* HAVE_MULTILINK */ +#if 0 /* UNUSED */ + script_setenv("PEERNAME", , 0); +#endif /* UNUSED */ + + /* Save the authentication method for later. */ + pcb->auth_done |= bit; + + /* + * If there is no more authentication still to be done, + * proceed to the network (or callback) phase. + */ + if ((pcb->auth_pending &= ~bit) == 0) + network_phase(pcb); +} +#endif /* PPP_SERVER */ + +/* + * We have failed to authenticate ourselves to the peer using `protocol'. + */ +void auth_withpeer_fail(ppp_pcb *pcb, int protocol) { + LWIP_UNUSED_ARG(protocol); + /* + * We've failed to authenticate ourselves to our peer. + * + * Some servers keep sending CHAP challenges, but there + * is no point in persisting without any way to get updated + * authentication secrets. + * + * He'll probably take the link down, and there's not much + * we can do except wait for that. + */ + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "Failed to authenticate ourselves to peer"); +} + +/* + * We have successfully authenticated ourselves with the peer using `protocol'. + */ +void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { + int bit; + const char *prot = ""; + + switch (protocol) { +#if CHAP_SUPPORT + case PPP_CHAP: + bit = CHAP_WITHPEER; + prot = "CHAP"; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_WITHPEER; + break; +#if MSCHAP_SUPPORT + case CHAP_MICROSOFT: + bit |= CHAP_MS_WITHPEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_WITHPEER; + break; +#endif /* MSCHAP_SUPPORT */ + default: + break; + } + break; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + case PPP_PAP: + bit = PAP_WITHPEER; + prot = "PAP"; + break; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + case PPP_EAP: + bit = EAP_WITHPEER; + prot = "EAP"; + break; +#endif /* EAP_SUPPORT */ + default: + ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); + bit = 0; + /* no break */ + } + + ppp_notice("%s authentication succeeded", prot); + + /* Save the authentication method for later. */ + pcb->auth_done |= bit; + + /* + * If there is no more authentication still being done, + * proceed to the network (or callback) phase. + */ + if ((pcb->auth_pending &= ~bit) == 0) + network_phase(pcb); +} +#endif /* PPP_AUTH_SUPPORT */ + + +/* + * np_up - a network protocol has come up. + */ +void np_up(ppp_pcb *pcb, int proto) { +#if PPP_IDLETIMELIMIT + int tlim; +#endif /* PPP_IDLETIMELIMIT */ + LWIP_UNUSED_ARG(proto); + + if (pcb->num_np_up == 0) { + /* + * At this point we consider that the link has come up successfully. + */ + new_phase(pcb, PPP_PHASE_RUNNING); + +#if PPP_IDLETIMELIMIT +#if 0 /* UNUSED */ + if (idle_time_hook != 0) + tlim = (*idle_time_hook)(NULL); + else +#endif /* UNUSED */ + tlim = pcb->settings.idle_time_limit; + if (tlim > 0) + TIMEOUT(check_idle, (void*)pcb, tlim); +#endif /* PPP_IDLETIMELIMIT */ + +#if PPP_MAXCONNECT + /* + * Set a timeout to close the connection once the maximum + * connect time has expired. + */ + if (pcb->settings.maxconnect > 0) + TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); +#endif /* PPP_MAXCONNECT */ + +#ifdef MAXOCTETS + if (maxoctets > 0) + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); +#endif + +#if 0 /* Unused */ + /* + * Detach now, if the updetach option was given. + */ + if (updetach && !nodetach) + detach(); +#endif /* Unused */ + } + ++pcb->num_np_up; +} + +/* + * np_down - a network protocol has gone down. + */ +void np_down(ppp_pcb *pcb, int proto) { + LWIP_UNUSED_ARG(proto); + if (--pcb->num_np_up == 0) { +#if PPP_IDLETIMELIMIT + UNTIMEOUT(check_idle, (void*)pcb); +#endif /* PPP_IDLETIMELIMIT */ +#if PPP_MAXCONNECT + UNTIMEOUT(connect_time_expired, NULL); +#endif /* PPP_MAXCONNECT */ +#ifdef MAXOCTETS + UNTIMEOUT(check_maxoctets, NULL); +#endif + new_phase(pcb, PPP_PHASE_NETWORK); + } +} + +/* + * np_finished - a network protocol has finished using the link. + */ +void np_finished(ppp_pcb *pcb, int proto) { + LWIP_UNUSED_ARG(proto); + if (--pcb->num_np_open <= 0) { + /* no further use for the link: shut up shop. */ + lcp_close(pcb, "No network protocols running"); + } +} + +#ifdef MAXOCTETS +static void +check_maxoctets(arg) + void *arg; +{ +#if PPP_STATS_SUPPORT + unsigned int used; + + update_link_stats(ifunit); + link_stats_valid=0; + + switch(maxoctets_dir) { + case PPP_OCTETS_DIRECTION_IN: + used = link_stats.bytes_in; + break; + case PPP_OCTETS_DIRECTION_OUT: + used = link_stats.bytes_out; + break; + case PPP_OCTETS_DIRECTION_MAXOVERAL: + case PPP_OCTETS_DIRECTION_MAXSESSION: + used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; + break; + default: + used = link_stats.bytes_in+link_stats.bytes_out; + break; + } + if (used > maxoctets) { + ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; + lcp_close(pcb, "Traffic limit"); +#if 0 /* UNUSED */ + need_holdoff = 0; +#endif /* UNUSED */ + } else { + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); + } +#endif /* PPP_STATS_SUPPORT */ +} +#endif /* MAXOCTETS */ + +#if PPP_IDLETIMELIMIT +/* + * check_idle - check whether the link has been idle for long + * enough that we can shut it down. + */ +static void check_idle(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + struct ppp_idle idle; + time_t itime; + int tlim; + + if (!get_idle_time(pcb, &idle)) + return; +#if 0 /* UNUSED */ + if (idle_time_hook != 0) { + tlim = idle_time_hook(&idle); + } else { +#endif /* UNUSED */ + itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); + tlim = pcb->settings.idle_time_limit - itime; +#if 0 /* UNUSED */ + } +#endif /* UNUSED */ + if (tlim <= 0) { + /* link is idle: shut it down. */ + ppp_notice("Terminating connection due to lack of activity."); + pcb->err_code = PPPERR_IDLETIMEOUT; + lcp_close(pcb, "Link inactive"); +#if 0 /* UNUSED */ + need_holdoff = 0; +#endif /* UNUSED */ + } else { + TIMEOUT(check_idle, (void*)pcb, tlim); + } +} +#endif /* PPP_IDLETIMELIMIT */ + +#if PPP_MAXCONNECT +/* + * connect_time_expired - log a message and close the connection. + */ +static void connect_time_expired(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_info("Connect time expired"); + pcb->err_code = PPPERR_CONNECTTIME; + lcp_close(pcb, "Connect time expired"); /* Close connection */ +} +#endif /* PPP_MAXCONNECT */ + +#if PPP_OPTIONS +/* + * auth_check_options - called to check authentication options. + */ +void +auth_check_options() +{ + lcp_options *wo = &lcp_wantoptions[0]; + int can_auth; + int lacks_ip; + + /* Default our_name to hostname, and user to our_name */ + if (our_name[0] == 0 || usehostname) + strlcpy(our_name, hostname, sizeof(our_name)); + /* If a blank username was explicitly given as an option, trust + the user and don't use our_name */ + if (ppp_settings.user[0] == 0 && !explicit_user) + strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); + + /* + * If we have a default route, require the peer to authenticate + * unless the noauth option was given or the real user is root. + */ + if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { + auth_required = 1; + default_auth = 1; + } + +#if CHAP_SUPPORT + /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ + if (wo->chap_mdtype) + wo->neg_chap = 1; +#endif /* CHAP_SUPPORT */ + + /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ + if (auth_required) { + allow_any_ip = 0; + if (1 +#if CHAP_SUPPORT + && !wo->neg_chap +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + && !wo->neg_upap +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + && !wo->neg_eap +#endif /* EAP_SUPPORT */ + ) { +#if CHAP_SUPPORT + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + wo->neg_upap = 1; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + wo->neg_eap = 1; +#endif /* EAP_SUPPORT */ + } + } else { +#if CHAP_SUPPORT + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + wo->neg_upap = 0; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + wo->neg_eap = 0; +#endif /* EAP_SUPPORT */ + } + + /* + * Check whether we have appropriate secrets to use + * to authenticate the peer. Note that EAP can authenticate by way + * of a CHAP-like exchanges as well as SRP. + */ + lacks_ip = 0; +#if PAP_SUPPORT + can_auth = wo->neg_upap && (uselogin || have_pap_secret(&lacks_ip)); +#else + can_auth = 0; +#endif /* PAP_SUPPORT */ + if (!can_auth && (0 +#if CHAP_SUPPORT + || wo->neg_chap +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + || wo->neg_eap +#endif /* EAP_SUPPORT */ + )) { +#if CHAP_SUPPORT + can_auth = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); +#else + can_auth = 0; +#endif + } + if (!can_auth +#if EAP_SUPPORT + && wo->neg_eap +#endif /* EAP_SUPPORT */ + ) { + can_auth = have_srp_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); + } + + if (auth_required && !can_auth && noauth_addrs == NULL) { + if (default_auth) { + option_error( +"By default the remote system is required to authenticate itself"); + option_error( +"(because this system has a default route to the internet)"); + } else if (explicit_remote) + option_error( +"The remote system (%s) is required to authenticate itself", + remote_name); + else + option_error( +"The remote system is required to authenticate itself"); + option_error( +"but I couldn't find any suitable secret (password) for it to use to do so."); + if (lacks_ip) + option_error( +"(None of the available passwords would let it use an IP address.)"); + + exit(1); + } + + /* + * Early check for remote number authorization. + */ + if (!auth_number()) { + ppp_warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); + } +} +#endif /* PPP_OPTIONS */ + +#if 0 /* UNUSED */ +/* + * auth_reset - called when LCP is starting negotiations to recheck + * authentication options, i.e. whether we have appropriate secrets + * to use for authenticating ourselves and/or the peer. + */ +void +auth_reset(unit) + int unit; +{ + lcp_options *go = &lcp_gotoptions[unit]; + lcp_options *ao = &lcp_allowoptions[unit]; + int hadchap; + + hadchap = -1; + ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); + ao->neg_chap = (!refuse_chap || !refuse_mschap || !refuse_mschap_v2) + && (passwd[0] != 0 || + (hadchap = have_chap_secret(user, (explicit_remote? remote_name: + NULL), 0, NULL))); + ao->neg_eap = !refuse_eap && ( + passwd[0] != 0 || + (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, + (explicit_remote? remote_name: NULL), 0, NULL))) || + have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); + + hadchap = -1; + if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) + go->neg_upap = 0; + if (go->neg_chap) { + if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, NULL))) + go->neg_chap = 0; + } + if (go->neg_eap && + (hadchap == 0 || (hadchap == -1 && + !have_chap_secret((explicit_remote? remote_name: NULL), our_name, + 1, NULL))) && + !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, + NULL)) + go->neg_eap = 0; +} + +/* + * check_passwd - Check the user name and passwd against the PAP secrets + * file. If requested, also check against the system password database, + * and login the user if OK. + * + * returns: + * UPAP_AUTHNAK: Authentication failed. + * UPAP_AUTHACK: Authentication succeeded. + * In either case, msg points to an appropriate message. + */ +int +check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) + int unit; + char *auser; + int userlen; + char *apasswd; + int passwdlen; + char **msg; +{ + return UPAP_AUTHNAK; + int ret; + char *filename; + FILE *f; + struct wordlist *addrs = NULL, *opts = NULL; + char passwd[256], user[256]; + char secret[MAXWORDLEN]; + static int attempts = 0; + + /* + * Make copies of apasswd and auser, then null-terminate them. + * If there are unprintable characters in the password, make + * them visible. + */ + slprintf(ppp_settings.passwd, sizeof(ppp_settings.passwd), "%.*v", passwdlen, apasswd); + slprintf(ppp_settings.user, sizeof(ppp_settings.user), "%.*v", userlen, auser); + *msg = ""; + + /* + * Check if a plugin wants to handle this. + */ + if (pap_auth_hook) { + ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); + if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + return ret? UPAP_AUTHACK: UPAP_AUTHNAK; + } + } + + /* + * Open the file of pap secrets and scan for a suitable secret + * for authenticating this user. + */ + filename = _PATH_UPAPFILE; + addrs = opts = NULL; + ret = UPAP_AUTHNAK; + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open PAP password file %s: %m", filename); + + } else { + check_access(f, filename); + if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { + ppp_warn("no PAP secret found for %s", user); + } else { + /* + * If the secret is "@login", it means to check + * the password against the login database. + */ + int login_secret = strcmp(secret, "@login") == 0; + ret = UPAP_AUTHACK; + if (uselogin || login_secret) { + /* login option or secret is @login */ + if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { + ret = UPAP_AUTHNAK; + } + } else if (session_mgmt) { + if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { + ppp_warn("Peer %q failed PAP Session verification", user); + ret = UPAP_AUTHNAK; + } + } + if (secret[0] != 0 && !login_secret) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) + && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) + ret = UPAP_AUTHNAK; + } + } + fclose(f); + } + + if (ret == UPAP_AUTHNAK) { + if (**msg == 0) + *msg = "Login incorrect"; + /* + * XXX can we ever get here more than once?? + * Frustrate passwd stealer programs. + * Allow 10 tries, but start backing off after 3 (stolen from login). + * On 10'th, drop the connection. + */ + if (attempts++ >= 10) { + ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); + lcp_close(pcb, "login failed"); + } + if (attempts > 3) + sleep((u_int) (attempts - 3) * 5); + if (opts != NULL) + free_wordlist(opts); + + } else { + attempts = 0; /* Reset count */ + if (**msg == 0) + *msg = "Login ok"; + set_allowed_addrs(unit, addrs, opts); + } + + if (addrs != NULL) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + BZERO(secret, sizeof(secret)); + + return ret; +} + +/* + * null_login - Check if a username of "" and a password of "" are + * acceptable, and iff so, set the list of acceptable IP addresses + * and return 1. + */ +static int +null_login(unit) + int unit; +{ + char *filename; + FILE *f; + int i, ret; + struct wordlist *addrs, *opts; + char secret[MAXWORDLEN]; + + /* + * Check if a plugin wants to handle this. + */ + ret = -1; + if (null_auth_hook) + ret = (*null_auth_hook)(&addrs, &opts); + + /* + * Open the file of pap secrets and scan for a suitable secret. + */ + if (ret <= 0) { + filename = _PATH_UPAPFILE; + addrs = NULL; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); + + i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); + ret = i >= 0 && secret[0] == 0; + BZERO(secret, sizeof(secret)); + fclose(f); + } + + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + + return ret; +} + +/* + * get_pap_passwd - get a password for authenticating ourselves with + * our peer using PAP. Returns 1 on success, 0 if no suitable password + * could be found. + * Assumes passwd points to MAXSECRETLEN bytes of space (if non-null). + */ +static int +get_pap_passwd(passwd) + char *passwd; +{ + char *filename; + FILE *f; + int ret; + char secret[MAXWORDLEN]; + + /* + * Check whether a plugin wants to supply this. + */ + if (pap_passwd_hook) { + ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); + if (ret >= 0) + return ret; + } + + filename = _PATH_UPAPFILE; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); + ret = scan_authfile(f, user, + (remote_name[0]? remote_name: NULL), + secret, NULL, NULL, filename, 0); + fclose(f); + if (ret < 0) + return 0; + if (passwd != NULL) + strlcpy(passwd, secret, MAXSECRETLEN); + BZERO(secret, sizeof(secret)); + return 1; +} + +/* + * have_pap_secret - check whether we have a PAP file with any + * secrets that we could possibly use for authenticating the peer. + */ +static int +have_pap_secret(lacks_ipp) + int *lacks_ipp; +{ + FILE *f; + int ret; + char *filename; + struct wordlist *addrs; + + /* let the plugin decide, if there is one */ + if (pap_check_hook) { + ret = (*pap_check_hook)(); + if (ret >= 0) + return ret; + } + + filename = _PATH_UPAPFILE; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + + ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name, + NULL, &addrs, NULL, filename, 0); + fclose(f); + if (ret >= 0 && !some_ip_ok(addrs)) { + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; + } + if (addrs != 0) + free_wordlist(addrs); + + return ret >= 0; +} + +/* + * have_chap_secret - check whether we have a CHAP file with a + * secret that we could possibly use for authenticating `client' + * on `server'. Either can be the null string, meaning we don't + * know the identity yet. + */ +static int +have_chap_secret(client, server, need_ip, lacks_ipp) + char *client; + char *server; + int need_ip; + int *lacks_ipp; +{ + FILE *f; + int ret; + char *filename; + struct wordlist *addrs; + + if (chap_check_hook) { + ret = (*chap_check_hook)(); + if (ret >= 0) { + return ret; + } + } + + filename = _PATH_CHAPFILE; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + + if (client != NULL && client[0] == 0) + client = NULL; + else if (server != NULL && server[0] == 0) + server = NULL; + + ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); + fclose(f); + if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; + } + if (addrs != 0) + free_wordlist(addrs); + + return ret >= 0; +} + +/* + * have_srp_secret - check whether we have a SRP file with a + * secret that we could possibly use for authenticating `client' + * on `server'. Either can be the null string, meaning we don't + * know the identity yet. + */ +static int +have_srp_secret(client, server, need_ip, lacks_ipp) + char *client; + char *server; + int need_ip; + int *lacks_ipp; +{ + FILE *f; + int ret; + char *filename; + struct wordlist *addrs; + + filename = _PATH_SRPFILE; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + + if (client != NULL && client[0] == 0) + client = NULL; + else if (server != NULL && server[0] == 0) + server = NULL; + + ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); + fclose(f); + if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; + } + if (addrs != 0) + free_wordlist(addrs); + + return ret >= 0; +} +#endif /* UNUSED */ + +#if PPP_AUTH_SUPPORT +/* + * get_secret - open the CHAP secret file and return the secret + * for authenticating the given client on the given server. + * (We could be either client or server). + */ +int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server) { + int len; + LWIP_UNUSED_ARG(server); + LWIP_UNUSED_ARG(am_server); + + if (!client || !client[0] || !pcb->settings.user || !pcb->settings.passwd || strcmp(client, pcb->settings.user)) { + return 0; + } + + len = (int)strlen(pcb->settings.passwd); + if (len > MAXSECRETLEN) { + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; + } + + MEMCPY(secret, pcb->settings.passwd, len); + *secret_len = len; + return 1; + +#if 0 /* UNUSED */ + FILE *f; + int ret, len; + char *filename; + struct wordlist *addrs, *opts; + char secbuf[MAXWORDLEN]; + struct wordlist *addrs; + addrs = NULL; + + if (!am_server && ppp_settings.passwd[0] != 0) { + strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); + } else if (!am_server && chap_passwd_hook) { + if ( (*chap_passwd_hook)(client, secbuf) < 0) { + ppp_error("Unable to obtain CHAP password for %s on %s from plugin", + client, server); + return 0; + } + } else { + filename = _PATH_CHAPFILE; + addrs = NULL; + secbuf[0] = 0; + + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open chap secret file %s: %m", filename); + return 0; + } + check_access(f, filename); + + ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); + fclose(f); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + } + + len = strlen(secbuf); + if (len > MAXSECRETLEN) { + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; + } + MEMCPY(secret, secbuf, len); + BZERO(secbuf, sizeof(secbuf)); + *secret_len = len; + + return 1; +#endif /* UNUSED */ +} +#endif /* PPP_AUTH_SUPPORT */ + + +#if 0 /* UNUSED */ +/* + * get_srp_secret - open the SRP secret file and return the secret + * for authenticating the given client on the given server. + * (We could be either client or server). + */ +int +get_srp_secret(unit, client, server, secret, am_server) + int unit; + char *client; + char *server; + char *secret; + int am_server; +{ + FILE *fp; + int ret; + char *filename; + struct wordlist *addrs, *opts; + + if (!am_server && ppp_settings.passwd[0] != '\0') { + strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); + } else { + filename = _PATH_SRPFILE; + addrs = NULL; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ppp_error("Can't open srp secret file %s: %m", filename); + return 0; + } + check_access(fp, filename); + + secret[0] = '\0'; + ret = scan_authfile(fp, client, server, secret, &addrs, &opts, + filename, am_server); + fclose(fp); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != NULL) + free_wordlist(opts); + if (addrs != NULL) + free_wordlist(addrs); + } + + return 1; +} + +/* + * set_allowed_addrs() - set the list of allowed addresses. + * Also looks for `--' indicating options to apply for this peer + * and leaves the following words in extra_options. + */ +static void +set_allowed_addrs(unit, addrs, opts) + int unit; + struct wordlist *addrs; + struct wordlist *opts; +{ + int n; + struct wordlist *ap, **plink; + struct permitted_ip *ip; + char *ptr_word, *ptr_mask; + struct hostent *hp; + struct netent *np; + u32_t a, mask, ah, offset; + struct ipcp_options *wo = &ipcp_wantoptions[unit]; + u32_t suggested_ip = 0; + + if (addresses[unit] != NULL) + free(addresses[unit]); + addresses[unit] = NULL; + if (extra_options != NULL) + free_wordlist(extra_options); + extra_options = opts; + + /* + * Count the number of IP addresses given. + */ + n = wordlist_count(addrs) + wordlist_count(noauth_addrs); + if (n == 0) + return; + ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); + if (ip == 0) + return; + + /* temporarily append the noauth_addrs list to addrs */ + for (plink = &addrs; *plink != NULL; plink = &(*plink)->next) + ; + *plink = noauth_addrs; + + n = 0; + for (ap = addrs; ap != NULL; ap = ap->next) { + /* "-" means no addresses authorized, "*" means any address allowed */ + ptr_word = ap->word; + if (strcmp(ptr_word, "-") == 0) + break; + if (strcmp(ptr_word, "*") == 0) { + ip[n].permit = 1; + ip[n].base = ip[n].mask = 0; + ++n; + break; + } + + ip[n].permit = 1; + if (*ptr_word == '!') { + ip[n].permit = 0; + ++ptr_word; + } + + mask = ~ (u32_t) 0; + offset = 0; + ptr_mask = strchr (ptr_word, '/'); + if (ptr_mask != NULL) { + int bit_count; + char *endp; + + bit_count = (int) strtol (ptr_mask+1, &endp, 10); + if (bit_count <= 0 || bit_count > 32) { + ppp_warn("invalid address length %v in auth. address list", + ptr_mask+1); + continue; + } + bit_count = 32 - bit_count; /* # bits in host part */ + if (*endp == '+') { + offset = ifunit + 1; + ++endp; + } + if (*endp != 0) { + ppp_warn("invalid address length syntax: %v", ptr_mask+1); + continue; + } + *ptr_mask = '\0'; + mask <<= bit_count; + } + + hp = gethostbyname(ptr_word); + if (hp != NULL && hp->h_addrtype == AF_INET) { + a = *(u32_t *)hp->h_addr; + } else { + np = getnetbyname (ptr_word); + if (np != NULL && np->n_addrtype == AF_INET) { + a = lwip_htonl ((u32_t)np->n_net); + if (ptr_mask == NULL) { + /* calculate appropriate mask for net */ + ah = lwip_ntohl(a); + if (IN_CLASSA(ah)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(ah)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(ah)) + mask = IN_CLASSC_NET; + } + } else { + a = inet_addr (ptr_word); + } + } + + if (ptr_mask != NULL) + *ptr_mask = '/'; + + if (a == (u32_t)-1L) { + ppp_warn("unknown host %s in auth. address list", ap->word); + continue; + } + if (offset != 0) { + if (offset >= ~mask) { + ppp_warn("interface unit %d too large for subnet %v", + ifunit, ptr_word); + continue; + } + a = lwip_htonl((lwip_ntohl(a) & mask) + offset); + mask = ~(u32_t)0; + } + ip[n].mask = lwip_htonl(mask); + ip[n].base = a & ip[n].mask; + ++n; + if (~mask == 0 && suggested_ip == 0) + suggested_ip = a; + } + *plink = NULL; + + ip[n].permit = 0; /* make the last entry forbid all addresses */ + ip[n].base = 0; /* to terminate the list */ + ip[n].mask = 0; + + addresses[unit] = ip; + + /* + * If the address given for the peer isn't authorized, or if + * the user hasn't given one, AND there is an authorized address + * which is a single host, then use that if we find one. + */ + if (suggested_ip != 0 + && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { + wo->hisaddr = suggested_ip; + /* + * Do we insist on this address? No, if there are other + * addresses authorized than the suggested one. + */ + if (n > 1) + wo->accept_remote = 1; + } +} + +/* + * auth_ip_addr - check whether the peer is authorized to use + * a given IP address. Returns 1 if authorized, 0 otherwise. + */ +int +auth_ip_addr(unit, addr) + int unit; + u32_t addr; +{ + int ok; + + /* don't allow loopback or multicast address */ + if (bad_ip_adrs(addr)) + return 0; + + if (allowed_address_hook) { + ok = allowed_address_hook(addr); + if (ok >= 0) return ok; + } + + if (addresses[unit] != NULL) { + ok = ip_addr_check(addr, addresses[unit]); + if (ok >= 0) + return ok; + } + + if (auth_required) + return 0; /* no addresses authorized */ + return allow_any_ip || privileged || !have_route_to(addr); +} + +static int +ip_addr_check(addr, addrs) + u32_t addr; + struct permitted_ip *addrs; +{ + for (; ; ++addrs) + if ((addr & addrs->mask) == addrs->base) + return addrs->permit; +} + +/* + * bad_ip_adrs - return 1 if the IP address is one we don't want + * to use, such as an address in the loopback net or a multicast address. + * addr is in network byte order. + */ +int +bad_ip_adrs(addr) + u32_t addr; +{ + addr = lwip_ntohl(addr); + return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET + || IN_MULTICAST(addr) || IN_BADCLASS(addr); +} + +/* + * some_ip_ok - check a wordlist to see if it authorizes any + * IP address(es). + */ +static int +some_ip_ok(addrs) + struct wordlist *addrs; +{ + for (; addrs != 0; addrs = addrs->next) { + if (addrs->word[0] == '-') + break; + if (addrs->word[0] != '!') + return 1; /* some IP address is allowed */ + } + return 0; +} + +/* + * auth_number - check whether the remote number is allowed to connect. + * Returns 1 if authorized, 0 otherwise. + */ +int +auth_number() +{ + struct wordlist *wp = permitted_numbers; + int l; + + /* Allow all if no authorization list. */ + if (!wp) + return 1; + + /* Allow if we have a match in the authorization list. */ + while (wp) { + /* trailing '*' wildcard */ + l = strlen(wp->word); + if ((wp->word)[l - 1] == '*') + l--; + if (!strncasecmp(wp->word, remote_number, l)) + return 1; + wp = wp->next; + } + + return 0; +} + +/* + * check_access - complain if a secret file has too-liberal permissions. + */ +static void +check_access(f, filename) + FILE *f; + char *filename; +{ + struct stat sbuf; + + if (fstat(fileno(f), &sbuf) < 0) { + ppp_warn("cannot stat secret file %s: %m", filename); + } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { + ppp_warn("Warning - secret file %s has world and/or group access", + filename); + } +} + +/* + * scan_authfile - Scan an authorization file for a secret suitable + * for authenticating `client' on `server'. The return value is -1 + * if no secret is found, otherwise >= 0. The return value has + * NONWILD_CLIENT set if the secret didn't have "*" for the client, and + * NONWILD_SERVER set if the secret didn't have "*" for the server. + * Any following words on the line up to a "--" (i.e. address authorization + * info) are placed in a wordlist and returned in *addrs. Any + * following words (extra options) are placed in a wordlist and + * returned in *opts. + * We assume secret is NULL or points to MAXWORDLEN bytes of space. + * Flags are non-zero if we need two colons in the secret in order to + * match. + */ +static int +scan_authfile(f, client, server, secret, addrs, opts, filename, flags) + FILE *f; + char *client; + char *server; + char *secret; + struct wordlist **addrs; + struct wordlist **opts; + char *filename; + int flags; +{ + int newline, xxx; + int got_flag, best_flag; + FILE *sf; + struct wordlist *ap, *addr_list, *alist, **app; + char word[MAXWORDLEN]; + char atfile[MAXWORDLEN]; + char lsecret[MAXWORDLEN]; + char *cp; + + if (addrs != NULL) + *addrs = NULL; + if (opts != NULL) + *opts = NULL; + addr_list = NULL; + if (!getword(f, word, &newline, filename)) + return -1; /* file is empty??? */ + newline = 1; + best_flag = -1; + for (;;) { + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(f, word, &newline, filename)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a client - check if it's a match or a wildcard. + */ + got_flag = 0; + if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { + newline = 0; + continue; + } + if (!ISWILD(word)) + got_flag = NONWILD_CLIENT; + + /* + * Now get a server and check if it matches. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + if (!ISWILD(word)) { + if (server != NULL && strcmp(word, server) != 0) + continue; + got_flag |= NONWILD_SERVER; + } + + /* + * Got some sort of a match - see if it's better than what + * we have already. + */ + if (got_flag <= best_flag) + continue; + + /* + * Get the secret. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + + /* + * SRP-SHA1 authenticator should never be reading secrets from + * a file. (Authenticatee may, though.) + */ + if (flags && ((cp = strchr(word, ':')) == NULL || + strchr(cp + 1, ':') == NULL)) + continue; + + if (secret != NULL) { + /* + * Special syntax: @/pathname means read secret from file. + */ + if (word[0] == '@' && word[1] == '/') { + strlcpy(atfile, word+1, sizeof(atfile)); + if ((sf = fopen(atfile, "r")) == NULL) { + ppp_warn("can't open indirect secret file %s", atfile); + continue; + } + check_access(sf, atfile); + if (!getword(sf, word, &xxx, atfile)) { + ppp_warn("no secret in indirect secret file %s", atfile); + fclose(sf); + continue; + } + fclose(sf); + } + strlcpy(lsecret, word, sizeof(lsecret)); + } + + /* + * Now read address authorization info and make a wordlist. + */ + app = &alist; + for (;;) { + if (!getword(f, word, &newline, filename) || newline) + break; + ap = (struct wordlist *) + malloc(sizeof(struct wordlist) + strlen(word) + 1); + if (ap == NULL) + novm("authorized addresses"); + ap->word = (char *) (ap + 1); + strcpy(ap->word, word); + *app = ap; + app = &ap->next; + } + *app = NULL; + + /* + * This is the best so far; remember it. + */ + best_flag = got_flag; + if (addr_list) + free_wordlist(addr_list); + addr_list = alist; + if (secret != NULL) + strlcpy(secret, lsecret, MAXWORDLEN); + + if (!newline) + break; + } + + /* scan for a -- word indicating the start of options */ + for (app = &addr_list; (ap = *app) != NULL; app = &ap->next) + if (strcmp(ap->word, "--") == 0) + break; + /* ap = start of options */ + if (ap != NULL) { + ap = ap->next; /* first option */ + free(*app); /* free the "--" word */ + *app = NULL; /* terminate addr list */ + } + if (opts != NULL) + *opts = ap; + else if (ap != NULL) + free_wordlist(ap); + if (addrs != NULL) + *addrs = addr_list; + else if (addr_list != NULL) + free_wordlist(addr_list); + + return best_flag; +} + +/* + * wordlist_count - return the number of items in a wordlist + */ +static int +wordlist_count(wp) + struct wordlist *wp; +{ + int n; + + for (n = 0; wp != NULL; wp = wp->next) + ++n; + return n; +} + +/* + * free_wordlist - release memory allocated for a wordlist. + */ +static void +free_wordlist(wp) + struct wordlist *wp; +{ + struct wordlist *next; + + while (wp != NULL) { + next = wp->next; + free(wp); + wp = next; + } +} +#endif /* UNUSED */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ccp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ccp.c new file mode 100644 index 0000000..f8519eb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ccp.c @@ -0,0 +1,1740 @@ +/* + * ccp.c - PPP Compression Control Protocol. + * + * Copyright (c) 1994-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CCP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include +#include + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/ccp.h" + +#if MPPE_SUPPORT +#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ +#include "netif/ppp/mppe.h" /* mppe_init() */ +#endif /* MPPE_SUPPORT */ + +/* + * Unfortunately there is a bug in zlib which means that using a + * size of 8 (window size = 256) for Deflate compression will cause + * buffer overruns and kernel crashes in the deflate module. + * Until this is fixed we only accept sizes in the range 9 .. 15. + * Thanks to James Carlson for pointing this out. + */ +#define DEFLATE_MIN_WORKS 9 + +/* + * Command-line options. + */ +#if PPP_OPTIONS +static int setbsdcomp (char **); +static int setdeflate (char **); +static char bsd_value[8]; +static char deflate_value[8]; + +/* + * Option variables. + */ +#if MPPE_SUPPORT +bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ +#endif /* MPPE_SUPPORT */ + +static option_t ccp_option_list[] = { + { "noccp", o_bool, &ccp_protent.enabled_flag, + "Disable CCP negotiation" }, + { "-ccp", o_bool, &ccp_protent.enabled_flag, + "Disable CCP negotiation", OPT_ALIAS }, + + { "bsdcomp", o_special, (void *)setbsdcomp, + "Request BSD-Compress packet compression", + OPT_PRIO | OPT_A2STRVAL | OPT_STATIC, bsd_value }, + { "nobsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, + "don't allow BSD-Compress", OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].bsd_compress }, + { "-bsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, + "don't allow BSD-Compress", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].bsd_compress }, + + { "deflate", o_special, (void *)setdeflate, + "request Deflate compression", + OPT_PRIO | OPT_A2STRVAL | OPT_STATIC, deflate_value }, + { "nodeflate", o_bool, &ccp_wantoptions[0].deflate, + "don't allow Deflate compression", OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].deflate }, + { "-deflate", o_bool, &ccp_wantoptions[0].deflate, + "don't allow Deflate compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].deflate }, + + { "nodeflatedraft", o_bool, &ccp_wantoptions[0].deflate_draft, + "don't use draft deflate #", OPT_A2COPY, + &ccp_allowoptions[0].deflate_draft }, + + { "predictor1", o_bool, &ccp_wantoptions[0].predictor_1, + "request Predictor-1", OPT_PRIO | 1 }, + { "nopredictor1", o_bool, &ccp_wantoptions[0].predictor_1, + "don't allow Predictor-1", OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].predictor_1 }, + { "-predictor1", o_bool, &ccp_wantoptions[0].predictor_1, + "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, + &ccp_allowoptions[0].predictor_1 }, + +#if MPPE_SUPPORT + /* MPPE options are symmetrical ... we only set wantoptions here */ + { "require-mppe", o_bool, &ccp_wantoptions[0].mppe, + "require MPPE encryption", + OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 }, + { "+mppe", o_bool, &ccp_wantoptions[0].mppe, + "require MPPE encryption", + OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 }, + { "nomppe", o_bool, &ccp_wantoptions[0].mppe, + "don't allow MPPE encryption", OPT_PRIO }, + { "-mppe", o_bool, &ccp_wantoptions[0].mppe, + "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO }, + + /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */ + { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe, + "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40, + &ccp_wantoptions[0].mppe }, + { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe, + "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40, + &ccp_wantoptions[0].mppe }, + { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe, + "don't allow MPPE 40-bit encryption", + OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe }, + { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe, + "don't allow MPPE 40-bit encryption", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, + &ccp_wantoptions[0].mppe }, + + { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe, + "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128, + &ccp_wantoptions[0].mppe }, + { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe, + "require MPPE 128-bit encryption", + OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128, + &ccp_wantoptions[0].mppe }, + { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe, + "don't allow MPPE 128-bit encryption", + OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe }, + { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe, + "don't allow MPPE 128-bit encryption", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, + &ccp_wantoptions[0].mppe }, + + /* strange one; we always request stateless, but will we allow stateful? */ + { "mppe-stateful", o_bool, &refuse_mppe_stateful, + "allow MPPE stateful mode", OPT_PRIO }, + { "nomppe-stateful", o_bool, &refuse_mppe_stateful, + "disallow MPPE stateful mode", OPT_PRIO | 1 }, +#endif /* MPPE_SUPPORT */ + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points from main code. + */ +static void ccp_init(ppp_pcb *pcb); +static void ccp_open(ppp_pcb *pcb); +static void ccp_close(ppp_pcb *pcb, const char *reason); +static void ccp_lowerup(ppp_pcb *pcb); +static void ccp_lowerdown(ppp_pcb *pcb); +static void ccp_input(ppp_pcb *pcb, u_char *pkt, int len); +static void ccp_protrej(ppp_pcb *pcb); +#if PRINTPKT_SUPPORT +static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT +static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len); +#endif /* PPP_DATAINPUT */ + +const struct protent ccp_protent = { + PPP_CCP, + ccp_init, + ccp_input, + ccp_protrej, + ccp_lowerup, + ccp_lowerdown, + ccp_open, + ccp_close, +#if PRINTPKT_SUPPORT + ccp_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + ccp_datainput, +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "CCP", + "Compressed", +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + ccp_option_list, + NULL, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, + NULL +#endif /* DEMAND_SUPPORT */ +}; + +/* + * Callbacks for fsm code. + */ +static void ccp_resetci (fsm *); +static int ccp_cilen (fsm *); +static void ccp_addci (fsm *, u_char *, int *); +static int ccp_ackci (fsm *, u_char *, int); +static int ccp_nakci (fsm *, u_char *, int, int); +static int ccp_rejci (fsm *, u_char *, int); +static int ccp_reqci (fsm *, u_char *, int *, int); +static void ccp_up (fsm *); +static void ccp_down (fsm *); +static int ccp_extcode (fsm *, int, int, u_char *, int); +static void ccp_rack_timeout (void *); +static const char *method_name (ccp_options *, ccp_options *); + +static const fsm_callbacks ccp_callbacks = { + ccp_resetci, + ccp_cilen, + ccp_addci, + ccp_ackci, + ccp_nakci, + ccp_rejci, + ccp_reqci, + ccp_up, + ccp_down, + NULL, + NULL, + NULL, + NULL, + ccp_extcode, + "CCP" +}; + +/* + * Do we want / did we get any compression? + */ +static int ccp_anycompress(ccp_options *opt) { + return (0 +#if DEFLATE_SUPPORT + || (opt)->deflate +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + || (opt)->bsd_compress +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + || (opt)->predictor_1 || (opt)->predictor_2 +#endif /* PREDICTOR_SUPPORT */ +#if MPPE_SUPPORT + || (opt)->mppe +#endif /* MPPE_SUPPORT */ + ); +} + +/* + * Local state (mainly for handling reset-reqs and reset-acks). + */ +#define RACK_PENDING 1 /* waiting for reset-ack */ +#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ + +#define RACKTIMEOUT 1 /* second */ + +#if PPP_OPTIONS +/* + * Option parsing + */ +static int +setbsdcomp(argv) + char **argv; +{ + int rbits, abits; + char *str, *endp; + + str = *argv; + abits = rbits = strtol(str, &endp, 0); + if (endp != str && *endp == ',') { + str = endp + 1; + abits = strtol(str, &endp, 0); + } + if (*endp != 0 || endp == str) { + option_error("invalid parameter '%s' for bsdcomp option", *argv); + return 0; + } + if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) + || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { + option_error("bsdcomp option values must be 0 or %d .. %d", + BSD_MIN_BITS, BSD_MAX_BITS); + return 0; + } + if (rbits > 0) { + ccp_wantoptions[0].bsd_compress = 1; + ccp_wantoptions[0].bsd_bits = rbits; + } else + ccp_wantoptions[0].bsd_compress = 0; + if (abits > 0) { + ccp_allowoptions[0].bsd_compress = 1; + ccp_allowoptions[0].bsd_bits = abits; + } else + ccp_allowoptions[0].bsd_compress = 0; + ppp_slprintf(bsd_value, sizeof(bsd_value), + rbits == abits? "%d": "%d,%d", rbits, abits); + + return 1; +} + +static int +setdeflate(argv) + char **argv; +{ + int rbits, abits; + char *str, *endp; + + str = *argv; + abits = rbits = strtol(str, &endp, 0); + if (endp != str && *endp == ',') { + str = endp + 1; + abits = strtol(str, &endp, 0); + } + if (*endp != 0 || endp == str) { + option_error("invalid parameter '%s' for deflate option", *argv); + return 0; + } + if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) + || (abits != 0 && (abits < DEFLATE_MIN_SIZE + || abits > DEFLATE_MAX_SIZE))) { + option_error("deflate option values must be 0 or %d .. %d", + DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); + return 0; + } + if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) { + if (rbits == DEFLATE_MIN_SIZE) + rbits = DEFLATE_MIN_WORKS; + if (abits == DEFLATE_MIN_SIZE) + abits = DEFLATE_MIN_WORKS; + warn("deflate option value of %d changed to %d to avoid zlib bug", + DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); + } + if (rbits > 0) { + ccp_wantoptions[0].deflate = 1; + ccp_wantoptions[0].deflate_size = rbits; + } else + ccp_wantoptions[0].deflate = 0; + if (abits > 0) { + ccp_allowoptions[0].deflate = 1; + ccp_allowoptions[0].deflate_size = abits; + } else + ccp_allowoptions[0].deflate = 0; + ppp_slprintf(deflate_value, sizeof(deflate_value), + rbits == abits? "%d": "%d,%d", rbits, abits); + + return 1; +} +#endif /* PPP_OPTIONS */ + +/* + * ccp_init - initialize CCP. + */ +static void ccp_init(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; + + f->pcb = pcb; + f->protocol = PPP_CCP; + f->callbacks = &ccp_callbacks; + fsm_init(f); + +#if 0 /* Not necessary, everything is cleared in ppp_new() */ + memset(wo, 0, sizeof(*wo)); + memset(go, 0, sizeof(*go)); + memset(ao, 0, sizeof(*ao)); + memset(ho, 0, sizeof(*ho)); +#endif /* 0 */ + +#if DEFLATE_SUPPORT + wo->deflate = 1; + wo->deflate_size = DEFLATE_MAX_SIZE; + wo->deflate_correct = 1; + wo->deflate_draft = 1; + ao->deflate = 1; + ao->deflate_size = DEFLATE_MAX_SIZE; + ao->deflate_correct = 1; + ao->deflate_draft = 1; +#endif /* DEFLATE_SUPPORT */ + +#if BSDCOMPRESS_SUPPORT + wo->bsd_compress = 1; + wo->bsd_bits = BSD_MAX_BITS; + ao->bsd_compress = 1; + ao->bsd_bits = BSD_MAX_BITS; +#endif /* BSDCOMPRESS_SUPPORT */ + +#if PREDICTOR_SUPPORT + ao->predictor_1 = 1; +#endif /* PREDICTOR_SUPPORT */ +} + +/* + * ccp_open - CCP is allowed to come up. + */ +static void ccp_open(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; + ccp_options *go = &pcb->ccp_gotoptions; + + if (f->state != PPP_FSM_OPENED) + ccp_set(pcb, 1, 0, 0, 0); + + /* + * Find out which compressors the kernel supports before + * deciding whether to open in silent mode. + */ + ccp_resetci(f); + if (!ccp_anycompress(go)) + f->flags |= OPT_SILENT; + + fsm_open(f); +} + +/* + * ccp_close - Terminate CCP. + */ +static void ccp_close(ppp_pcb *pcb, const char *reason) { + fsm *f = &pcb->ccp_fsm; + ccp_set(pcb, 0, 0, 0, 0); + fsm_close(f, reason); +} + +/* + * ccp_lowerup - we may now transmit CCP packets. + */ +static void ccp_lowerup(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; + fsm_lowerup(f); +} + +/* + * ccp_lowerdown - we may not transmit CCP packets. + */ +static void ccp_lowerdown(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; + fsm_lowerdown(f); +} + +/* + * ccp_input - process a received CCP packet. + */ +static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { + fsm *f = &pcb->ccp_fsm; + ccp_options *go = &pcb->ccp_gotoptions; + int oldstate; + + /* + * Check for a terminate-request so we can print a message. + */ + oldstate = f->state; + fsm_input(f, p, len); + if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { + ppp_notice("Compression disabled by peer."); +#if MPPE_SUPPORT + if (go->mppe) { + ppp_error("MPPE disabled, closing LCP"); + lcp_close(pcb, "MPPE disabled by peer"); + } +#endif /* MPPE_SUPPORT */ + } + + /* + * If we get a terminate-ack and we're not asking for compression, + * close CCP. + */ + if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK + && !ccp_anycompress(go)) + ccp_close(pcb, "No compression negotiated"); +} + +/* + * Handle a CCP-specific code. + */ +static int ccp_extcode(fsm *f, int code, int id, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(len); + + switch (code) { + case CCP_RESETREQ: + if (f->state != PPP_FSM_OPENED) + break; + ccp_reset_comp(pcb); + /* send a reset-ack, which the transmitter will see and + reset its compression state. */ + fsm_sdata(f, CCP_RESETACK, id, NULL, 0); + break; + + case CCP_RESETACK: + if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { + pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); + UNTIMEOUT(ccp_rack_timeout, f); + ccp_reset_decomp(pcb); + } + break; + + default: + return 0; + } + + return 1; +} + +/* + * ccp_protrej - peer doesn't talk CCP. + */ +static void ccp_protrej(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; +#if MPPE_SUPPORT + ccp_options *go = &pcb->ccp_gotoptions; +#endif /* MPPE_SUPPORT */ + + ccp_set(pcb, 0, 0, 0, 0); + fsm_lowerdown(f); + +#if MPPE_SUPPORT + if (go->mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } +#endif /* MPPE_SUPPORT */ + +} + +/* + * ccp_resetci - initialize at start of negotiation. + */ +static void ccp_resetci(fsm *f) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + ccp_options *wo = &pcb->ccp_wantoptions; +#if MPPE_SUPPORT + ccp_options *ao = &pcb->ccp_allowoptions; +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT + u_char opt_buf[CCP_MAX_OPTION_LENGTH]; +#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */ +#if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT + int res; +#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */ + +#if MPPE_SUPPORT + if (pcb->settings.require_mppe) { + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + } +#endif /* MPPE_SUPPORT */ + + *go = *wo; + pcb->ccp_all_rejected = 0; + +#if MPPE_SUPPORT + if (go->mppe) { + int auth_mschap_bits = pcb->auth_done; + int numbits; + + /* + * Start with a basic sanity check: mschap[v2] auth must be in + * exactly one direction. RFC 3079 says that the keys are + * 'derived from the credentials of the peer that initiated the call', + * however the PPP protocol doesn't have such a concept, and pppd + * cannot get this info externally. Instead we do the best we can. + * NB: If MPPE is required, all other compression opts are invalid. + * So, we return right away if we can't do it. + */ + + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + CHAP_MS2_WITHPEER | CHAP_MS2_PEER); + /* Count the mschap auths */ + auth_mschap_bits >>= CHAP_MS_SHIFT; + numbits = 0; + do { + numbits += auth_mschap_bits & 1; + auth_mschap_bits >>= 1; + } while (auth_mschap_bits); + if (numbits > 1) { + ppp_error("MPPE required, but auth done in both directions."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + if (!numbits) { + ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* A plugin (eg radius) may not have obtained key material. */ + if (!pcb->mppe_keys_set) { + ppp_error("MPPE required, but keys are not available. " + "Possible plugin problem?"); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* LM auth not supported for MPPE */ + if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { + /* This might be noise */ + if (go->mppe & MPPE_OPT_40) { + ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); + go->mppe &= ~MPPE_OPT_40; + wo->mppe &= ~MPPE_OPT_40; + } + } + + /* Last check: can we actually negotiate something? */ + if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { + /* Could be misconfig, could be 40-bit disabled above. */ + ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* sync options */ + ao->mppe = go->mppe; + /* MPPE is not compatible with other compression types */ +#if BSDCOMPRESS_SUPPORT + ao->bsd_compress = go->bsd_compress = 0; +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + ao->predictor_1 = go->predictor_1 = 0; + ao->predictor_2 = go->predictor_2 = 0; +#endif /* PREDICTOR_SUPPORT */ +#if DEFLATE_SUPPORT + ao->deflate = go->deflate = 0; +#endif /* DEFLATE_SUPPORT */ + } +#endif /* MPPE_SUPPORT */ + + /* + * Check whether the kernel knows about the various + * compression methods we might request. + */ +#if BSDCOMPRESS_SUPPORT + /* FIXME: we don't need to test if BSD compress is available + * if BSDCOMPRESS_SUPPORT is set, it is. + */ + if (go->bsd_compress) { + opt_buf[0] = CI_BSD_COMPRESS; + opt_buf[1] = CILEN_BSD_COMPRESS; + for (;;) { + if (go->bsd_bits < BSD_MIN_BITS) { + go->bsd_compress = 0; + break; + } + opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->bsd_compress = 0; + break; + } + go->bsd_bits--; + } + } +#endif /* BSDCOMPRESS_SUPPORT */ +#if DEFLATE_SUPPORT + /* FIXME: we don't need to test if deflate is available + * if DEFLATE_SUPPORT is set, it is. + */ + if (go->deflate) { + if (go->deflate_correct) { + opt_buf[0] = CI_DEFLATE; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_correct = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_correct = 0; + break; + } + go->deflate_size--; + } + } + if (go->deflate_draft) { + opt_buf[0] = CI_DEFLATE_DRAFT; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_draft = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_draft = 0; + break; + } + go->deflate_size--; + } + } + if (!go->deflate_correct && !go->deflate_draft) + go->deflate = 0; + } +#endif /* DEFLATE_SUPPORT */ +#if PREDICTOR_SUPPORT + /* FIXME: we don't need to test if predictor is available, + * if PREDICTOR_SUPPORT is set, it is. + */ + if (go->predictor_1) { + opt_buf[0] = CI_PREDICTOR_1; + opt_buf[1] = CILEN_PREDICTOR_1; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) + go->predictor_1 = 0; + } + if (go->predictor_2) { + opt_buf[0] = CI_PREDICTOR_2; + opt_buf[1] = CILEN_PREDICTOR_2; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) + go->predictor_2 = 0; + } +#endif /* PREDICTOR_SUPPORT */ +} + +/* + * ccp_cilen - Return total length of our configuration info. + */ +static int ccp_cilen(fsm *f) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + + return 0 +#if BSDCOMPRESS_SUPPORT + + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) +#endif /* BSDCOMPRESS_SUPPORT */ +#if DEFLATE_SUPPORT + + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) +#endif /* DEFLATE_SUPPORT */ +#if PREDICTOR_SUPPORT + + (go->predictor_1? CILEN_PREDICTOR_1: 0) + + (go->predictor_2? CILEN_PREDICTOR_2: 0) +#endif /* PREDICTOR_SUPPORT */ +#if MPPE_SUPPORT + + (go->mppe? CILEN_MPPE: 0) +#endif /* MPPE_SUPPORT */ + ; +} + +/* + * ccp_addci - put our requests in a packet. + */ +static void ccp_addci(fsm *f, u_char *p, int *lenp) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + u_char *p0 = p; + + /* + * Add the compression types that we can receive, in decreasing + * preference order. + */ +#if MPPE_SUPPORT + if (go->mppe) { + p[0] = CI_MPPE; + p[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &p[2]); + mppe_init(pcb, &pcb->mppe_decomp, go->mppe); + p += CILEN_MPPE; + } +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + if (go->deflate) { + if (go->deflate_correct) { + p[0] = CI_DEFLATE; + p[1] = CILEN_DEFLATE; + p[2] = DEFLATE_MAKE_OPT(go->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + if (go->deflate_draft) { + p[0] = CI_DEFLATE_DRAFT; + p[1] = CILEN_DEFLATE; + p[2] = p[2 - CILEN_DEFLATE]; + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + } +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + if (go->bsd_compress) { + p[0] = CI_BSD_COMPRESS; + p[1] = CILEN_BSD_COMPRESS; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + p += CILEN_BSD_COMPRESS; + } +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + /* XXX Should Predictor 2 be preferable to Predictor 1? */ + if (go->predictor_1) { + p[0] = CI_PREDICTOR_1; + p[1] = CILEN_PREDICTOR_1; + p += CILEN_PREDICTOR_1; + } + if (go->predictor_2) { + p[0] = CI_PREDICTOR_2; + p[1] = CILEN_PREDICTOR_2; + p += CILEN_PREDICTOR_2; + } +#endif /* PREDICTOR_SUPPORT */ + + go->method = (p > p0)? p0[0]: 0; + + *lenp = p - p0; +} + +/* + * ccp_ackci - process a received configure-ack, and return + * 1 iff the packet was OK. + */ +static int ccp_ackci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; +#if BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT + u_char *p0 = p; +#endif /* BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */ + +#if MPPE_SUPPORT + if (go->mppe) { + u_char opt_buf[CILEN_MPPE]; + + opt_buf[0] = CI_MPPE; + opt_buf[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); + if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) + return 0; + p += CILEN_MPPE; + len -= CILEN_MPPE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + } +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + if (go->deflate) { + if (len < CILEN_DEFLATE + || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + if (go->deflate_correct && go->deflate_draft) { + if (len < CILEN_DEFLATE + || p[0] != CI_DEFLATE_DRAFT + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } + } +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + if (go->bsd_compress) { + if (len < CILEN_BSD_COMPRESS + || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS + || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; + } +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + if (go->predictor_1) { + if (len < CILEN_PREDICTOR_1 + || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) + return 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; + } + if (go->predictor_2) { + if (len < CILEN_PREDICTOR_2 + || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) + return 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; + } +#endif /* PREDICTOR_SUPPORT */ + + if (len != 0) + return 0; + return 1; +} + +/* + * ccp_nakci - process received configure-nak. + * Returns 1 iff the nak was OK. + */ +static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + ccp_options no; /* options we've seen already */ + ccp_options try_; /* options to ask for next time */ + LWIP_UNUSED_ARG(treat_as_reject); +#if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT + LWIP_UNUSED_ARG(p); + LWIP_UNUSED_ARG(len); +#endif /* !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ + + memset(&no, 0, sizeof(no)); + try_ = *go; + +#if MPPE_SUPPORT + if (go->mppe && len >= CILEN_MPPE + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + no.mppe = 1; + /* + * Peer wants us to use a different strength or other setting. + * Fail if we aren't willing to use his suggestion. + */ + MPPE_CI_TO_OPTS(&p[2], try_.mppe); + if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + try_.mppe = 0; + } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { + /* Peer must have set options we didn't request (suggest) */ + try_.mppe = 0; + } + + if (!try_.mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } + } +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + if (go->deflate && len >= CILEN_DEFLATE + && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + && p[1] == CILEN_DEFLATE) { + no.deflate = 1; + /* + * Peer wants us to use a different code size or something. + * Stop asking for Deflate if we don't understand his suggestion. + */ + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS + || p[3] != DEFLATE_CHK_SEQUENCE) + try_.deflate = 0; + else if (DEFLATE_SIZE(p[2]) < go->deflate_size) + try_.deflate_size = DEFLATE_SIZE(p[2]); + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + if (go->deflate_correct && go->deflate_draft + && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT + && p[1] == CILEN_DEFLATE) { + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } + } +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + if (go->bsd_compress && len >= CILEN_BSD_COMPRESS + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + no.bsd_compress = 1; + /* + * Peer wants us to use a different number of bits + * or a different version. + */ + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) + try_.bsd_compress = 0; + else if (BSD_NBITS(p[2]) < go->bsd_bits) + try_.bsd_bits = BSD_NBITS(p[2]); + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + } +#endif /* BSDCOMPRESS_SUPPORT */ + + /* + * Predictor-1 and 2 have no options, so they can't be Naked. + * + * There may be remaining options but we ignore them. + */ + + if (f->state != PPP_FSM_OPENED) + *go = try_; + return 1; +} + +/* + * ccp_rejci - reject some of our suggested compression methods. + */ +static int ccp_rejci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + ccp_options try_; /* options to request next time */ + + try_ = *go; + + /* + * Cope with empty configure-rejects by ceasing to send + * configure-requests. + */ + if (len == 0 && pcb->ccp_all_rejected) + return -1; + +#if MPPE_SUPPORT + if (go->mppe && len >= CILEN_MPPE + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + ppp_error("MPPE required but peer refused"); + lcp_close(pcb, "MPPE required but peer refused"); + p += CILEN_MPPE; + len -= CILEN_MPPE; + } +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + if (go->deflate_correct && len >= CILEN_DEFLATE + && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_correct = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } + if (go->deflate_draft && len >= CILEN_DEFLATE + && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_draft = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } + if (!try_.deflate_correct && !try_.deflate_draft) + try_.deflate = 0; +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + if (go->bsd_compress && len >= CILEN_BSD_COMPRESS + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + try_.bsd_compress = 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + } +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + if (go->predictor_1 && len >= CILEN_PREDICTOR_1 + && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { + try_.predictor_1 = 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + } + if (go->predictor_2 && len >= CILEN_PREDICTOR_2 + && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { + try_.predictor_2 = 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + } +#endif /* PREDICTOR_SUPPORT */ + + if (len != 0) + return 0; + + if (f->state != PPP_FSM_OPENED) + *go = try_; + + return 1; +} + +/* + * ccp_reqci - processed a received configure-request. + * Returns CONFACK, CONFNAK or CONFREJ and the packet modified + * appropriately. + */ +static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { + ppp_pcb *pcb = f->pcb; + ccp_options *ho = &pcb->ccp_hisoptions; + ccp_options *ao = &pcb->ccp_allowoptions; + int ret, newret; +#if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT + int res; + int nb; +#endif /* DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT */ + u_char *p0, *retp; + int len, clen, type; +#if MPPE_SUPPORT + u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ + /* CI_MPPE, or due to other options? */ +#endif /* MPPE_SUPPORT */ + + ret = CONFACK; + retp = p0 = p; + len = *lenp; + + memset(ho, 0, sizeof(ccp_options)); + ho->method = (len > 0)? p[0]: 0; + + while (len > 0) { + newret = CONFACK; + if (len < 2 || p[1] < 2 || p[1] > len) { + /* length is bad */ + clen = len; + newret = CONFREJ; + + } else { + type = p[0]; + clen = p[1]; + + switch (type) { +#if MPPE_SUPPORT + case CI_MPPE: + if (!ao->mppe || clen != CILEN_MPPE) { + newret = CONFREJ; + break; + } + MPPE_CI_TO_OPTS(&p[2], ho->mppe); + + /* Nak if anything unsupported or unknown are set. */ + if (ho->mppe & MPPE_OPT_UNSUPPORTED) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNSUPPORTED; + } + if (ho->mppe & MPPE_OPT_UNKNOWN) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNKNOWN; + } + + /* Check state opt */ + if (ho->mppe & MPPE_OPT_STATEFUL) { + /* + * We can Nak and request stateless, but it's a + * lot easier to just assume the peer will request + * it if he can do it; stateful mode is bad over + * the Internet -- which is where we expect MPPE. + */ + if (pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + newret = CONFREJ; + break; + } + } + + /* Find out which of {S,L} are set. */ + if ((ho->mppe & MPPE_OPT_128) + && (ho->mppe & MPPE_OPT_40)) { + /* Both are set, negotiate the strongest. */ + newret = CONFNAK; + if (ao->mppe & MPPE_OPT_128) + ho->mppe &= ~MPPE_OPT_40; + else if (ao->mppe & MPPE_OPT_40) + ho->mppe &= ~MPPE_OPT_128; + else { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_128) { + if (!(ao->mppe & MPPE_OPT_128)) { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_40) { + if (!(ao->mppe & MPPE_OPT_40)) { + newret = CONFREJ; + break; + } + } else { + /* Neither are set. */ + /* We cannot accept this. */ + newret = CONFNAK; + /* Give the peer our idea of what can be used, + so it can choose and confirm */ + ho->mppe = ao->mppe; + } + + /* rebuild the opts */ + MPPE_OPTS_TO_CI(ho->mppe, &p[2]); + if (newret == CONFACK) { + int mtu; + + mppe_init(pcb, &pcb->mppe_comp, ho->mppe); + /* + * We need to decrease the interface MTU by MPPE_PAD + * because MPPE frames **grow**. The kernel [must] + * allocate MPPE_PAD extra bytes in xmit buffers. + */ + mtu = netif_get_mtu(pcb); + if (mtu) + netif_set_mtu(pcb, mtu - MPPE_PAD); + else + newret = CONFREJ; + } + + /* + * We have accepted MPPE or are willing to negotiate + * MPPE parameters. A CONFREJ is due to subsequent + * (non-MPPE) processing. + */ + rej_for_ci_mppe = 0; + break; +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (!ao->deflate || clen != CILEN_DEFLATE + || (!ao->deflate_correct && type == CI_DEFLATE) + || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { + newret = CONFREJ; + break; + } + + ho->deflate = 1; + ho->deflate_size = nb = DEFLATE_SIZE(p[2]); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || p[3] != DEFLATE_CHK_SEQUENCE + || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do Deflate with the window + * size they want. If the window is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_DEFLATE, 1); + if (res > 0) + break; /* it's OK now */ + if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { + newret = CONFREJ; + p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); + break; + } + newret = CONFNAK; + --nb; + p[2] = DEFLATE_MAKE_OPT(nb); + } + } + break; +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + case CI_BSD_COMPRESS: + if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { + newret = CONFREJ; + break; + } + + ho->bsd_compress = 1; + ho->bsd_bits = nb = BSD_NBITS(p[2]); + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION + || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do BSD-Compress with the code + * size they want. If the code size is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); + if (res > 0) + break; + if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { + newret = CONFREJ; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, + ho->bsd_bits); + break; + } + newret = CONFNAK; + --nb; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); + } + } + break; +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + case CI_PREDICTOR_1: + if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { + newret = CONFREJ; + break; + } + + ho->predictor_1 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { + newret = CONFREJ; + } + break; + + case CI_PREDICTOR_2: + if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { + newret = CONFREJ; + break; + } + + ho->predictor_2 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { + newret = CONFREJ; + } + break; +#endif /* PREDICTOR_SUPPORT */ + + default: + newret = CONFREJ; + } + } + + if (newret == CONFNAK && dont_nak) + newret = CONFREJ; + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { + /* we're returning this option */ + if (newret == CONFREJ && ret == CONFNAK) + retp = p0; + ret = newret; + if (p != retp) + MEMCPY(retp, p, clen); + retp += clen; + } + + p += clen; + len -= clen; + } + + if (ret != CONFACK) { + if (ret == CONFREJ && *lenp == retp - p0) + pcb->ccp_all_rejected = 1; + else + *lenp = retp - p0; + } +#if MPPE_SUPPORT + if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } +#endif /* MPPE_SUPPORT */ + return ret; +} + +/* + * Make a string name for a compression method (or 2). + */ +static const char *method_name(ccp_options *opt, ccp_options *opt2) { + static char result[64]; +#if !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT + LWIP_UNUSED_ARG(opt2); +#endif /* !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ + + if (!ccp_anycompress(opt)) + return "(none)"; + switch (opt->method) { +#if MPPE_SUPPORT + case CI_MPPE: + { + char *p = result; + char *q = result + sizeof(result); /* 1 past result */ + + ppp_slprintf(p, q - p, "MPPE "); + p += 5; + if (opt->mppe & MPPE_OPT_128) { + ppp_slprintf(p, q - p, "128-bit "); + p += 8; + } + if (opt->mppe & MPPE_OPT_40) { + ppp_slprintf(p, q - p, "40-bit "); + p += 7; + } + if (opt->mppe & MPPE_OPT_STATEFUL) + ppp_slprintf(p, q - p, "stateful"); + else + ppp_slprintf(p, q - p, "stateless"); + + break; + } +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) + ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size, opt2->deflate_size); + else + ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size); + break; +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + case CI_BSD_COMPRESS: + if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", + opt->bsd_bits, opt2->bsd_bits); + else + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", + opt->bsd_bits); + break; +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + case CI_PREDICTOR_1: + return "Predictor 1"; + case CI_PREDICTOR_2: + return "Predictor 2"; +#endif /* PREDICTOR_SUPPORT */ + default: + ppp_slprintf(result, sizeof(result), "Method %d", opt->method); + } + return result; +} + +/* + * CCP has come up - inform the kernel driver and log a message. + */ +static void ccp_up(fsm *f) { + ppp_pcb *pcb = f->pcb; + ccp_options *go = &pcb->ccp_gotoptions; + ccp_options *ho = &pcb->ccp_hisoptions; + char method1[64]; + + ccp_set(pcb, 1, 1, go->method, ho->method); + if (ccp_anycompress(go)) { + if (ccp_anycompress(ho)) { + if (go->method == ho->method) { + ppp_notice("%s compression enabled", method_name(go, ho)); + } else { + ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); + ppp_notice("%s / %s compression enabled", + method1, method_name(ho, NULL)); + } + } else + ppp_notice("%s receive compression enabled", method_name(go, NULL)); + } else if (ccp_anycompress(ho)) + ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); +#if MPPE_SUPPORT + if (go->mppe) { + continue_networks(pcb); /* Bring up IP et al */ + } +#endif /* MPPE_SUPPORT */ +} + +/* + * CCP has gone down - inform the kernel driver. + */ +static void ccp_down(fsm *f) { + ppp_pcb *pcb = f->pcb; +#if MPPE_SUPPORT + ccp_options *go = &pcb->ccp_gotoptions; +#endif /* MPPE_SUPPORT */ + + if (pcb->ccp_localstate & RACK_PENDING) + UNTIMEOUT(ccp_rack_timeout, f); + pcb->ccp_localstate = 0; + ccp_set(pcb, 1, 0, 0, 0); +#if MPPE_SUPPORT + if (go->mppe) { + go->mppe = 0; + if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { + /* If LCP is not already going down, make sure it does. */ + ppp_error("MPPE disabled"); + lcp_close(pcb, "MPPE disabled"); + } + } +#endif /* MPPE_SUPPORT */ +} + +#if PRINTPKT_SUPPORT +/* + * Print the contents of a CCP packet. + */ +static const char* const ccp_codenames[] = { + "ConfReq", "ConfAck", "ConfNak", "ConfRej", + "TermReq", "TermAck", "CodeRej", + NULL, NULL, NULL, NULL, NULL, NULL, + "ResetReq", "ResetAck", +}; + +static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, const char *, ...), void *arg) { + const u_char *p0, *optend; + int code, id, len; + int optlen; + + p0 = p; + if (plen < HEADERLEN) + return 0; + code = p[0]; + id = p[1]; + len = (p[2] << 8) + p[3]; + if (len < HEADERLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) + printer(arg, " %s", ccp_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= HEADERLEN; + p += HEADERLEN; + + switch (code) { + case CONFREQ: + case CONFACK: + case CONFNAK: + case CONFREJ: + /* print list of possible compression methods */ + while (len >= 2) { + code = p[0]; + optlen = p[1]; + if (optlen < 2 || optlen > len) + break; + printer(arg, " <"); + len -= optlen; + optend = p + optlen; + switch (code) { +#if MPPE_SUPPORT + case CI_MPPE: + if (optlen >= CILEN_MPPE) { + u_char mppe_opts; + + MPPE_CI_TO_OPTS(&p[2], mppe_opts); + printer(arg, "mppe %s %s %s %s %s %s%s", + (p[2] & MPPE_H_BIT)? "+H": "-H", + (p[5] & MPPE_M_BIT)? "+M": "-M", + (p[5] & MPPE_S_BIT)? "+S": "-S", + (p[5] & MPPE_L_BIT)? "+L": "-L", + (p[5] & MPPE_D_BIT)? "+D": "-D", + (p[5] & MPPE_C_BIT)? "+C": "-C", + (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); + if (mppe_opts & MPPE_OPT_UNKNOWN) + printer(arg, " (%.2x %.2x %.2x %.2x)", + p[2], p[3], p[4], p[5]); + p += CILEN_MPPE; + } + break; +#endif /* MPPE_SUPPORT */ +#if DEFLATE_SUPPORT + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (optlen >= CILEN_DEFLATE) { + printer(arg, "deflate%s %d", + (code == CI_DEFLATE_DRAFT? "(old#)": ""), + DEFLATE_SIZE(p[2])); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) + printer(arg, " method %d", DEFLATE_METHOD(p[2])); + if (p[3] != DEFLATE_CHK_SEQUENCE) + printer(arg, " check %d", p[3]); + p += CILEN_DEFLATE; + } + break; +#endif /* DEFLATE_SUPPORT */ +#if BSDCOMPRESS_SUPPORT + case CI_BSD_COMPRESS: + if (optlen >= CILEN_BSD_COMPRESS) { + printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), + BSD_NBITS(p[2])); + p += CILEN_BSD_COMPRESS; + } + break; +#endif /* BSDCOMPRESS_SUPPORT */ +#if PREDICTOR_SUPPORT + case CI_PREDICTOR_1: + if (optlen >= CILEN_PREDICTOR_1) { + printer(arg, "predictor 1"); + p += CILEN_PREDICTOR_1; + } + break; + case CI_PREDICTOR_2: + if (optlen >= CILEN_PREDICTOR_2) { + printer(arg, "predictor 2"); + p += CILEN_PREDICTOR_2; + } + break; +#endif /* PREDICTOR_SUPPORT */ + default: + break; + } + while (p < optend) + printer(arg, " %.2x", *p++); + printer(arg, ">"); + } + break; + + case TERMACK: + case TERMREQ: + if (len > 0 && *p >= ' ' && *p < 0x7f) { + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; + default: + break; + } + + /* dump out the rest of the packet in hex */ + while (--len >= 0) + printer(arg, " %.2x", *p++); + + return p - p0; +} +#endif /* PRINTPKT_SUPPORT */ + +#if PPP_DATAINPUT +/* + * We have received a packet that the decompressor failed to + * decompress. Here we would expect to issue a reset-request, but + * Motorola has a patent on resetting the compressor as a result of + * detecting an error in the decompressed data after decompression. + * (See US patent 5,130,993; international patent publication number + * WO 91/10289; Australian patent 73296/91.) + * + * So we ask the kernel whether the error was detected after + * decompression; if it was, we take CCP down, thus disabling + * compression :-(, otherwise we issue the reset-request. + */ +static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len) { + fsm *f; +#if MPPE_SUPPORT + ccp_options *go = &pcb->ccp_gotoptions; +#endif /* MPPE_SUPPORT */ + LWIP_UNUSED_ARG(pkt); + LWIP_UNUSED_ARG(len); + + f = &pcb->ccp_fsm; + if (f->state == PPP_FSM_OPENED) { + if (ccp_fatal_error(pcb)) { + /* + * Disable compression by taking CCP down. + */ + ppp_error("Lost compression sync: disabling compression"); + ccp_close(pcb, "Lost compression sync"); +#if MPPE_SUPPORT + /* + * If we were doing MPPE, we must also take the link down. + */ + if (go->mppe) { + ppp_error("Too many MPPE errors, closing LCP"); + lcp_close(pcb, "Too many MPPE errors"); + } +#endif /* MPPE_SUPPORT */ + } else { + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; + } + } +} +#endif /* PPP_DATAINPUT */ + +/* + * We have received a packet that the decompressor failed to + * decompress. Issue a reset-request. + */ +void ccp_resetrequest(ppp_pcb *pcb) { + fsm *f = &pcb->ccp_fsm; + + if (f->state != PPP_FSM_OPENED) + return; + + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; +} + +/* + * Timeout waiting for reset-ack. + */ +static void ccp_rack_timeout(void *arg) { + fsm *f = (fsm*)arg; + ppp_pcb *pcb = f->pcb; + + if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate &= ~RREQ_REPEAT; + } else + pcb->ccp_localstate &= ~RACK_PENDING; +} + +#endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-md5.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-md5.c new file mode 100644 index 0000000..88f069f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-md5.c @@ -0,0 +1,126 @@ +/* + * chap-md5.c - New CHAP/MD5 implementation. + * + * Copyright (c) 2003 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/chap-new.h" +#include "netif/ppp/chap-md5.h" +#include "netif/ppp/magic.h" +#include "netif/ppp/pppcrypt.h" + +#define MD5_HASH_SIZE 16 +#define MD5_MIN_CHALLENGE 17 +#define MD5_MAX_CHALLENGE 24 +#define MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE 3 /* 2^3-1 = 7, 17+7 = 24 */ + +#if PPP_SERVER +static void chap_md5_generate_challenge(ppp_pcb *pcb, unsigned char *cp) { + int clen; + LWIP_UNUSED_ARG(pcb); + + clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); + *cp++ = clen; + magic_random_bytes(cp, clen); +} + +static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + lwip_md5_context ctx; + unsigned char idbyte = id; + unsigned char hash[MD5_HASH_SIZE]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(pcb); + + challenge_len = *challenge++; + response_len = *response++; + if (response_len == MD5_HASH_SIZE) { + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, hash); + lwip_md5_free(&ctx); + + /* Test if our hash matches the peer's response */ + if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + } + ppp_slprintf(message, message_space, "Access denied"); + return 0; +} +#endif /* PPP_SERVER */ + +static void chap_md5_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + lwip_md5_context ctx; + unsigned char idbyte = id; + int challenge_len = *challenge++; + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + LWIP_UNUSED_ARG(pcb); + + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, (const u_char *)secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, &response[1]); + lwip_md5_free(&ctx); + response[0] = MD5_HASH_SIZE; +} + +const struct chap_digest_type md5_digest = { + CHAP_MD5, /* code */ +#if PPP_SERVER + chap_md5_generate_challenge, + chap_md5_verify_response, +#endif /* PPP_SERVER */ + chap_md5_make_response, + NULL, /* check_success */ + NULL, /* handle_failure */ +}; + +#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-new.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-new.c new file mode 100644 index 0000000..485122d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap-new.c @@ -0,0 +1,677 @@ +/* + * chap-new.c - New CHAP implementation. + * + * Copyright (c) 2003 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#if 0 /* UNUSED */ +#include "session.h" +#endif /* UNUSED */ + +#include "netif/ppp/chap-new.h" +#include "netif/ppp/chap-md5.h" +#if MSCHAP_SUPPORT +#include "netif/ppp/chap_ms.h" +#endif +#include "netif/ppp/magic.h" + +#if 0 /* UNUSED */ +/* Hook for a plugin to validate CHAP challenge */ +int (*chap_verify_hook)(const char *name, const char *ourname, int id, + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) = NULL; +#endif /* UNUSED */ + +#if PPP_OPTIONS +/* + * Command-line options. + */ +static option_t chap_option_list[] = { + { "chap-restart", o_int, &chap_timeout_time, + "Set timeout for CHAP", OPT_PRIO }, + { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, + "Set max #xmits for challenge", OPT_PRIO }, + { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, + "Set interval for rechallenge", OPT_PRIO }, + { NULL } +}; +#endif /* PPP_OPTIONS */ + + +/* Values for flags in chap_client_state and chap_server_state */ +#define LOWERUP 1 +#define AUTH_STARTED 2 +#define AUTH_DONE 4 +#define AUTH_FAILED 8 +#define TIMEOUT_PENDING 0x10 +#define CHALLENGE_VALID 0x20 + +/* + * Prototypes. + */ +static void chap_init(ppp_pcb *pcb); +static void chap_lowerup(ppp_pcb *pcb); +static void chap_lowerdown(ppp_pcb *pcb); +#if PPP_SERVER +static void chap_timeout(void *arg); +static void chap_generate_challenge(ppp_pcb *pcb); +static void chap_handle_response(ppp_pcb *pcb, int code, + unsigned char *pkt, int len); +static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); +#endif /* PPP_SERVER */ +static void chap_respond(ppp_pcb *pcb, int id, + unsigned char *pkt, int len); +static void chap_handle_status(ppp_pcb *pcb, int code, int id, + unsigned char *pkt, int len); +static void chap_protrej(ppp_pcb *pcb); +static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen); +#if PRINTPKT_SUPPORT +static int chap_print_pkt(const unsigned char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ + +/* List of digest types that we know about */ +static const struct chap_digest_type* const chap_digests[] = { + &md5_digest, +#if MSCHAP_SUPPORT + &chapms_digest, + &chapms2_digest, +#endif /* MSCHAP_SUPPORT */ + NULL +}; + +/* + * chap_init - reset to initial state. + */ +static void chap_init(ppp_pcb *pcb) { + LWIP_UNUSED_ARG(pcb); + +#if 0 /* Not necessary, everything is cleared in ppp_new() */ + memset(&pcb->chap_client, 0, sizeof(chap_client_state)); +#if PPP_SERVER + memset(&pcb->chap_server, 0, sizeof(chap_server_state)); +#endif /* PPP_SERVER */ +#endif /* 0 */ +} + +/* + * chap_lowerup - we can start doing stuff now. + */ +static void chap_lowerup(ppp_pcb *pcb) { + + pcb->chap_client.flags |= LOWERUP; +#if PPP_SERVER + pcb->chap_server.flags |= LOWERUP; + if (pcb->chap_server.flags & AUTH_STARTED) + chap_timeout(pcb); +#endif /* PPP_SERVER */ +} + +static void chap_lowerdown(ppp_pcb *pcb) { + + pcb->chap_client.flags = 0; +#if PPP_SERVER + if (pcb->chap_server.flags & TIMEOUT_PENDING) + UNTIMEOUT(chap_timeout, pcb); + pcb->chap_server.flags = 0; +#endif /* PPP_SERVER */ +} + +#if PPP_SERVER +/* + * chap_auth_peer - Start authenticating the peer. + * If the lower layer is already up, we start sending challenges, + * otherwise we wait for the lower layer to come up. + */ +void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { + const struct chap_digest_type *dp; + int i; + + if (pcb->chap_server.flags & AUTH_STARTED) { + ppp_error("CHAP: peer authentication already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_server.digest = dp; + pcb->chap_server.name = our_name; + /* Start with a random ID value */ + pcb->chap_server.id = magic(); + pcb->chap_server.flags |= AUTH_STARTED; + if (pcb->chap_server.flags & LOWERUP) + chap_timeout(pcb); +} +#endif /* PPP_SERVER */ + +/* + * chap_auth_with_peer - Prepare to authenticate ourselves to the peer. + * There isn't much to do until we receive a challenge. + */ +void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { + const struct chap_digest_type *dp; + int i; + + if(NULL == our_name) + return; + + if (pcb->chap_client.flags & AUTH_STARTED) { + ppp_error("CHAP: authentication with peer already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_client.digest = dp; + pcb->chap_client.name = our_name; + pcb->chap_client.flags |= AUTH_STARTED; +} + +#if PPP_SERVER +/* + * chap_timeout - It's time to send another challenge to the peer. + * This could be either a retransmission of a previous challenge, + * or a new challenge to start re-authentication. + */ +static void chap_timeout(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + struct pbuf *p; + + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { + pcb->chap_server.challenge_xmits = 0; + chap_generate_challenge(pcb); + pcb->chap_server.flags |= CHALLENGE_VALID; + } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; + auth_peer_fail(pcb, PPP_CHAP); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); + ppp_write(pcb, p); + ++pcb->chap_server.challenge_xmits; + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); +} + +/* + * chap_generate_challenge - generate a challenge string and format + * the challenge packet in pcb->chap_server.challenge_pkt. + */ +static void chap_generate_challenge(ppp_pcb *pcb) { + int clen = 1, nlen, len; + unsigned char *p; + + p = pcb->chap_server.challenge; + MAKEHEADER(p, PPP_CHAP); + p += CHAP_HDRLEN; + pcb->chap_server.digest->generate_challenge(pcb, p); + clen = *p; + nlen = strlen(pcb->chap_server.name); + memcpy(p + 1 + clen, pcb->chap_server.name, nlen); + + len = CHAP_HDRLEN + 1 + clen + nlen; + pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; + + p = pcb->chap_server.challenge + PPP_HDRLEN; + p[0] = CHAP_CHALLENGE; + p[1] = ++pcb->chap_server.id; + p[2] = len >> 8; + p[3] = len; +} + +/* + * chap_handle_response - check the response to our challenge. + */ +static void chap_handle_response(ppp_pcb *pcb, int id, + unsigned char *pkt, int len) { + int response_len, ok, mlen; + const unsigned char *response; + unsigned char *outp; + struct pbuf *p; + const char *name = NULL; /* initialized to shut gcc up */ +#if 0 /* UNUSED */ + int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, + const unsigned char *, const unsigned char *, char *, int); +#endif /* UNUSED */ + char rname[MAXNAMELEN+1]; + char message[256]; + + if ((pcb->chap_server.flags & LOWERUP) == 0) + return; + if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) + return; + if (pcb->chap_server.flags & CHALLENGE_VALID) { + response = pkt; + GETCHAR(response_len, pkt); + len -= response_len + 1; /* length of name */ + name = (char *)pkt + response_len; + if (len < 0) + return; + + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } +#if PPP_REMOTENAME + if (pcb->settings.explicit_remote) { + name = pcb->remote_name; + } else +#endif /* PPP_REMOTENAME */ + { + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); + name = rname; + } + +#if 0 /* UNUSED */ + if (chap_verify_hook) + verifier = chap_verify_hook; + else + verifier = chap_verify_response; + ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); +#endif /* UNUSED */ + ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, message, sizeof(message)); +#if 0 /* UNUSED */ + if (!ok || !auth_number()) { +#endif /* UNUSED */ + if (!ok) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP authentication", name); + } + } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) + return; + + /* send the response */ + mlen = strlen(message); + len = CHAP_HDRLEN + mlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (unsigned char *)p->payload; + MAKEHEADER(outp, PPP_CHAP); + + outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + if (mlen > 0) + memcpy(outp + CHAP_HDRLEN, message, mlen); + ppp_write(pcb, p); + + if (pcb->chap_server.flags & CHALLENGE_VALID) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { + +#if 0 /* UNUSED */ + /* + * Auth is OK, so now we need to check session restrictions + * to ensure everything is OK, but only if we used a + * plugin, and only if we're configured to check. This + * allows us to do PAM checks on PPP servers that + * authenticate against ActiveDirectory, and use AD for + * account info (like when using Winbind integrated with + * PAM). + */ + if (session_mgmt && + session_check(name, NULL, devnam, NULL) == 0) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP Session verification", name); + } +#endif /* UNUSED */ + + } + if (pcb->chap_server.flags & AUTH_FAILED) { + auth_peer_fail(pcb, PPP_CHAP); + } else { + if ((pcb->chap_server.flags & AUTH_DONE) == 0) + auth_peer_success(pcb, PPP_CHAP, + pcb->chap_server.digest->code, + name, strlen(name)); + if (pcb->settings.chap_rechallenge_time) { + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, pcb, + pcb->settings.chap_rechallenge_time); + } + } + pcb->chap_server.flags |= AUTH_DONE; + } +} + +/* + * chap_verify_response - check whether the peer's response matches + * what we think it should be. Returns 1 if it does (authentication + * succeeded), or 0 if it doesn't. + */ +static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + int ok; + unsigned char secret[MAXSECRETLEN]; + int secret_len; + + /* Get the secret that the peer is supposed to know */ + if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { + ppp_error("No CHAP secret found for authenticating %q", name); + return 0; + } + ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, + response, message, message_space); + memset(secret, 0, sizeof(secret)); + + return ok; +} +#endif /* PPP_SERVER */ + +/* + * chap_respond - Generate and send a response to a challenge. + */ +static void chap_respond(ppp_pcb *pcb, int id, + unsigned char *pkt, int len) { + int clen, nlen; + int secret_len; + struct pbuf *p; + u_char *outp; + char rname[MAXNAMELEN+1]; + char secret[MAXSECRETLEN+1]; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) + return; /* not ready */ + if (len < 2 || len < pkt[0] + 1) + return; /* too short */ + clen = pkt[0]; + nlen = len - (clen + 1); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); + +#if PPP_REMOTENAME + /* Microsoft doesn't send their name back in the PPP packet */ + if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) + strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); +#endif /* PPP_REMOTENAME */ + + /* get secret for authenticating ourselves with the specified host */ + if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { + secret_len = 0; /* assume null secret if can't find one */ + ppp_warn("No CHAP secret found for authenticating us to %q", rname); + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_CHAP); + outp += CHAP_HDRLEN; + + pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, + secret, secret_len, pcb->chap_client.priv); + memset(secret, 0, secret_len); + + clen = *outp; + nlen = strlen(pcb->chap_client.name); + memcpy(outp + clen + 1, pcb->chap_client.name, nlen); + + outp = (u_char*)p->payload + PPP_HDRLEN; + len = CHAP_HDRLEN + clen + 1 + nlen; + outp[0] = CHAP_RESPONSE; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + + pbuf_realloc(p, PPP_HDRLEN + len); + ppp_write(pcb, p); +} + +static void chap_handle_status(ppp_pcb *pcb, int code, int id, + unsigned char *pkt, int len) { + const char *msg = NULL; + LWIP_UNUSED_ARG(id); + + if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) + != (AUTH_STARTED|LOWERUP)) + return; + pcb->chap_client.flags |= AUTH_DONE; + + if (code == CHAP_SUCCESS) { + /* used for MS-CHAP v2 mutual auth, yuck */ + if (pcb->chap_client.digest->check_success != NULL) { + if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) + code = CHAP_FAILURE; + } else + msg = "CHAP authentication succeeded"; + } else { + if (pcb->chap_client.digest->handle_failure != NULL) + (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); + else + msg = "CHAP authentication failed"; + } + if (msg) { + if (len > 0) + ppp_info("%s: %.*v", msg, len, pkt); + else + ppp_info("%s", msg); + } + if (code == CHAP_SUCCESS) + auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); + else { + pcb->chap_client.flags |= AUTH_FAILED; + ppp_error("CHAP authentication failed"); + auth_withpeer_fail(pcb, PPP_CHAP); + } +} + +static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen) { + unsigned char code, id; + int len; + + if (pktlen < CHAP_HDRLEN) + return; + GETCHAR(code, pkt); + GETCHAR(id, pkt); + GETSHORT(len, pkt); + if (len < CHAP_HDRLEN || len > pktlen) + return; + len -= CHAP_HDRLEN; + + switch (code) { + case CHAP_CHALLENGE: + chap_respond(pcb, id, pkt, len); + break; +#if PPP_SERVER + case CHAP_RESPONSE: + chap_handle_response(pcb, id, pkt, len); + break; +#endif /* PPP_SERVER */ + case CHAP_FAILURE: + case CHAP_SUCCESS: + chap_handle_status(pcb, code, id, pkt, len); + break; + default: + break; + } +} + +static void chap_protrej(ppp_pcb *pcb) { + +#if PPP_SERVER + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } + if (pcb->chap_server.flags & AUTH_STARTED) { + pcb->chap_server.flags = 0; + auth_peer_fail(pcb, PPP_CHAP); + } +#endif /* PPP_SERVER */ + if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { + pcb->chap_client.flags &= ~AUTH_STARTED; + ppp_error("CHAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_CHAP); + } +} + +#if PRINTPKT_SUPPORT +/* + * chap_print_pkt - print the contents of a CHAP packet. + */ +static const char* const chap_code_names[] = { + "Challenge", "Response", "Success", "Failure" +}; + +static int chap_print_pkt(const unsigned char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int clen, nlen; + unsigned char x; + + if (plen < CHAP_HDRLEN) + return 0; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < CHAP_HDRLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) + printer(arg, " %s", chap_code_names[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= CHAP_HDRLEN; + switch (code) { + case CHAP_CHALLENGE: + case CHAP_RESPONSE: + if (len < 1) + break; + clen = p[0]; + if (len < clen + 1) + break; + ++p; + nlen = len - clen - 1; + printer(arg, " <"); + for (; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, "%.2x", x); + } + printer(arg, ">, name = "); + ppp_print_string(p, nlen, printer, arg); + break; + case CHAP_FAILURE: + case CHAP_SUCCESS: + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + break; + default: + for (clen = len; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, " %.2x", x); + } + /* no break */ + } + + return len + CHAP_HDRLEN; +} +#endif /* PRINTPKT_SUPPORT */ + +const struct protent chap_protent = { + PPP_CHAP, + chap_init, + chap_input, + chap_protrej, + chap_lowerup, + chap_lowerdown, + NULL, /* open */ + NULL, /* close */ +#if PRINTPKT_SUPPORT + chap_print_pkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, /* datainput */ +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "CHAP", /* name */ + NULL, /* data_name */ +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + chap_option_list, + NULL, /* check_options */ +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, + NULL +#endif /* DEMAND_SUPPORT */ +}; + +#endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap_ms.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap_ms.c new file mode 100644 index 0000000..5a989c9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/chap_ms.c @@ -0,0 +1,962 @@ +/* + * chap_ms.c - Microsoft MS-CHAP compatible implementation. + * + * Copyright (c) 1995 Eric Rosenquist. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Modifications by Lauri Pesonen / lpesonen@clinet.fi, april 1997 + * + * Implemented LANManager type password response to MS-CHAP challenges. + * Now pppd provides both NT style and LANMan style blocks, and the + * prefered is set by option "ms-lanman". Default is to use NT. + * The hash text (StdText) was taken from Win95 RASAPI32.DLL. + * + * You should also use DOMAIN\\USERNAME as described in README.MSCHAP80 + */ + +/* + * Modifications by Frank Cusack, frank@google.com, March 2002. + * + * Implemented MS-CHAPv2 functionality, heavily based on sample + * implementation in RFC 2759. Implemented MPPE functionality, + * heavily based on sample implementation in RFC 3079. + * + * Copyright (c) 2002 Google, Inc. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#include +#include +#include +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/chap-new.h" +#include "netif/ppp/chap_ms.h" +#include "netif/ppp/pppcrypt.h" +#include "netif/ppp/magic.h" +#if MPPE_SUPPORT +#include "netif/ppp/mppe.h" /* For mppe_sha1_pad*, mppe_set_key() */ +#endif /* MPPE_SUPPORT */ + +#define SHA1_SIGNATURE_SIZE 20 +#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ +#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ + +#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ +#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ +#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ + /* as ASCII */ + +/* Error codes for MS-CHAP failure messages. */ +#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 +#define MS_CHAP_ERROR_ACCT_DISABLED 647 +#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 +#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 +#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 +#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 + +/* + * Offsets within the response field for MS-CHAP + */ +#define MS_CHAP_LANMANRESP 0 +#define MS_CHAP_LANMANRESP_LEN 24 +#define MS_CHAP_NTRESP 24 +#define MS_CHAP_NTRESP_LEN 24 +#define MS_CHAP_USENT 48 + +/* + * Offsets within the response field for MS-CHAP2 + */ +#define MS_CHAP2_PEER_CHALLENGE 0 +#define MS_CHAP2_PEER_CHAL_LEN 16 +#define MS_CHAP2_RESERVED_LEN 8 +#define MS_CHAP2_NTRESP 24 +#define MS_CHAP2_NTRESP_LEN 24 +#define MS_CHAP2_FLAGS 48 + +#if MPPE_SUPPORT +#if 0 /* UNUSED */ +/* These values are the RADIUS attribute values--see RFC 2548. */ +#define MPPE_ENC_POL_ENC_ALLOWED 1 +#define MPPE_ENC_POL_ENC_REQUIRED 2 +#define MPPE_ENC_TYPES_RC4_40 2 +#define MPPE_ENC_TYPES_RC4_128 4 + +/* used by plugins (using above values) */ +extern void set_mppe_enc_types(int, int); +#endif /* UNUSED */ +#endif /* MPPE_SUPPORT */ + +/* Are we the authenticator or authenticatee? For MS-CHAPv2 key derivation. */ +#define MS_CHAP2_AUTHENTICATEE 0 +#define MS_CHAP2_AUTHENTICATOR 1 + +static void ascii2unicode (const char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); +static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); +static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); +static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, + u_char[24]); +static void GenerateAuthenticatorResponsePlain + (const char*, int, u_char[24], const u_char[16], const u_char *, + const char *, u_char[41]); +#ifdef MSLANMAN +static void ChapMS_LANMan (u_char *, char *, int, u_char *); +#endif + +static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); + +#if MPPE_SUPPORT +static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); +static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); +#endif /* MPPE_SUPPORT */ + +static void ChapMS (ppp_pcb *pcb, const u_char *, const char *, int, u_char *); +static void ChapMS2 (ppp_pcb *pcb, const u_char *, const u_char *, const char *, const char *, int, + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); + +#ifdef MSLANMAN +bool ms_lanman = 0; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ +#endif + +#if MPPE_SUPPORT +#ifdef DEBUGMPPEKEY +/* For MPPE debug */ +/* Use "[]|}{?/><,`!2&&(" (sans quotes) for RFC 3079 MS-CHAPv2 test value */ +static char *mschap_challenge = NULL; +/* Use "!@\#$%^&*()_+:3|~" (sans quotes, backslash is to escape #) for ... */ +static char *mschap2_peer_challenge = NULL; +#endif + +#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ +#include "netif/ppp/ccp.h" +#endif /* MPPE_SUPPORT */ + +#if PPP_OPTIONS +/* + * Command-line options. + */ +static option_t chapms_option_list[] = { +#ifdef MSLANMAN + { "ms-lanman", o_bool, &ms_lanman, + "Use LanMan passwd when using MS-CHAP", 1 }, +#endif +#ifdef DEBUGMPPEKEY + { "mschap-challenge", o_string, &mschap_challenge, + "specify CHAP challenge" }, + { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, + "specify CHAP peer challenge" }, +#endif + { NULL } +}; +#endif /* PPP_OPTIONS */ + +#if PPP_SERVER +/* + * chapms_generate_challenge - generate a challenge for MS-CHAP. + * For MS-CHAP the challenge length is fixed at 8 bytes. + * The length goes in challenge[0] and the actual challenge starts + * at challenge[1]. + */ +static void chapms_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { + LWIP_UNUSED_ARG(pcb); + + *challenge++ = 8; +#ifdef DEBUGMPPEKEY + if (mschap_challenge && strlen(mschap_challenge) == 8) + memcpy(challenge, mschap_challenge, 8); + else +#endif + magic_random_bytes(challenge, 8); +} + +static void chapms2_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { + LWIP_UNUSED_ARG(pcb); + + *challenge++ = 16; +#ifdef DEBUGMPPEKEY + if (mschap_challenge && strlen(mschap_challenge) == 16) + memcpy(challenge, mschap_challenge, 16); + else +#endif + magic_random_bytes(challenge, 16); +} + +static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP_RESPONSE_LEN]; + int diff; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(name); + + challenge_len = *challenge++; /* skip length, is 8 */ + response_len = *response++; + if (response_len != MS_CHAP_RESPONSE_LEN) + goto bad; + +#ifndef MSLANMAN + if (!response[MS_CHAP_USENT]) { + /* Should really propagate this into the error packet. */ + ppp_notice("Peer request for LANMAN auth not supported"); + goto bad; + } +#endif + + /* Generate the expected response. */ + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); + +#ifdef MSLANMAN + /* Determine which part of response to verify against */ + if (!response[MS_CHAP_USENT]) + diff = memcmp(&response[MS_CHAP_LANMANRESP], + &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); + else +#endif + diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], + MS_CHAP_NTRESP_LEN); + + if (diff == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + + bad: + /* See comments below for MS-CHAP V2 */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", + challenge_len, challenge); + return 0; +} + +static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP2_RESPONSE_LEN]; + char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + + challenge_len = *challenge++; /* skip length, is 16 */ + response_len = *response++; + if (response_len != MS_CHAP2_RESPONSE_LEN) + goto bad; /* not even the right length */ + + /* Generate the expected response and our mutual auth. */ + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); + + /* compare MDs and send the appropriate status */ + /* + * Per RFC 2759, success message must be formatted as + * "S= M=" + * where + * is the Authenticator Response (mutual auth) + * is a text message + * + * However, some versions of Windows (win98 tested) do not know + * about the M= part (required per RFC 2759) and flag + * it as an error (reported incorrectly as an encryption error + * to the user). Since the RFC requires it, and it can be + * useful information, we supply it if the peer is a conforming + * system. Luckily (?), win98 sets the Flags field to 0x04 + * (contrary to RFC requirements) so we can use that to + * distinguish between conforming and non-conforming systems. + * + * Special thanks to Alex Swiridov for + * help debugging this. + */ + if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], + MS_CHAP2_NTRESP_LEN) == 0) { + if (response[MS_CHAP2_FLAGS]) + ppp_slprintf(message, message_space, "S=%s", saresponse); + else + ppp_slprintf(message, message_space, "S=%s M=%s", + saresponse, "Access granted"); + return 1; + } + + bad: + /* + * Failure message must be formatted as + * "E=e R=r C=c V=v M=m" + * where + * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) + * r = retry (we use 1, ok to retry) + * c = challenge to use for next response, we reuse previous + * v = Change Password version supported, we use 0 + * m = text message + * + * The M=m part is only for MS-CHAPv2. Neither win2k nor + * win98 (others untested) display the message to the user anyway. + * They also both ignore the E=e code. + * + * Note that it's safe to reuse the same challenge as we don't + * actually accept another response based on the error message + * (and no clients try to resend a response anyway). + * + * Basically, this whole bit is useless code, even the small + * implementation here is only because of overspecification. + */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", + challenge_len, challenge, "Access denied"); + return 0; +} +#endif /* PPP_SERVER */ + +static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + challenge++; /* skip length, should be 8 */ + *response++ = MS_CHAP_RESPONSE_LEN; + ChapMS(pcb, challenge, secret, secret_len, response); +} + +static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + challenge++; /* skip length, should be 16 */ + *response++ = MS_CHAP2_RESPONSE_LEN; + ChapMS2(pcb, challenge, +#ifdef DEBUGMPPEKEY + mschap2_peer_challenge, +#else + NULL, +#endif + our_name, secret, secret_len, response, private_, + MS_CHAP2_AUTHENTICATEE); +} + +static int chapms2_check_success(ppp_pcb *pcb, unsigned char *msg, int len, unsigned char *private_) { + LWIP_UNUSED_ARG(pcb); + + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || + strncmp((char *)msg, "S=", 2) != 0) { + /* Packet does not start with "S=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + msg += 2; + len -= 2; + if (len < MS_AUTH_RESPONSE_LENGTH + || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { + /* Authenticator Response did not match expected. */ + ppp_error("MS-CHAPv2 mutual authentication failed."); + return 0; + } + /* Authenticator Response matches. */ + msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ + len -= MS_AUTH_RESPONSE_LENGTH; + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { + msg += 3; /* Eat the delimiter */ + } else if (len) { + /* Packet has extra text which does not begin " M=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + return 1; +} + +static void chapms_handle_failure(ppp_pcb *pcb, unsigned char *inp, int len) { + int err; + const char *p; + char msg[64]; + LWIP_UNUSED_ARG(pcb); + + /* We want a null-terminated string for strxxx(). */ + len = LWIP_MIN(len, 63); + MEMCPY(msg, inp, len); + msg[len] = 0; + p = msg; + + /* + * Deal with MS-CHAP formatted failure messages; just print the + * M= part (if any). For MS-CHAP we're not really supposed + * to use M=, but it shouldn't hurt. See + * chapms[2]_verify_response. + */ + if (!strncmp(p, "E=", 2)) + err = strtol(p+2, NULL, 10); /* Remember the error code. */ + else + goto print_msg; /* Message is badly formatted. */ + + if (len && ((p = strstr(p, " M=")) != NULL)) { + /* M= field found. */ + p += 3; + } else { + /* No M=; use the error code. */ + switch (err) { + case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: + p = "E=646 Restricted logon hours"; + break; + + case MS_CHAP_ERROR_ACCT_DISABLED: + p = "E=647 Account disabled"; + break; + + case MS_CHAP_ERROR_PASSWD_EXPIRED: + p = "E=648 Password expired"; + break; + + case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: + p = "E=649 No dialin permission"; + break; + + case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: + p = "E=691 Authentication failure"; + break; + + case MS_CHAP_ERROR_CHANGING_PASSWORD: + /* Should never see this, we don't support Change Password. */ + p = "E=709 Error changing password"; + break; + + default: + ppp_error("Unknown MS-CHAP authentication failure: %.*v", + len, inp); + return; + } + } +print_msg: + if (p != NULL) + ppp_error("MS-CHAP authentication failed: %v", p); +} + +static void ChallengeResponse(const u_char *challenge, + const u_char PasswordHash[MD4_SIGNATURE_SIZE], + u_char response[24]) { + u_char ZPasswordHash[21]; + lwip_des_context des; + u_char des_key[8]; + + BZERO(ZPasswordHash, sizeof(ZPasswordHash)); + MEMCPY(ZPasswordHash, PasswordHash, MD4_SIGNATURE_SIZE); + +#if 0 + dbglog("ChallengeResponse - ZPasswordHash %.*B", + sizeof(ZPasswordHash), ZPasswordHash); +#endif + + pppcrypt_56_to_64_bit_key(ZPasswordHash + 0, des_key); + lwip_des_init(&des); + lwip_des_setkey_enc(&des, des_key); + lwip_des_crypt_ecb(&des, challenge, response +0); + lwip_des_free(&des); + + pppcrypt_56_to_64_bit_key(ZPasswordHash + 7, des_key); + lwip_des_init(&des); + lwip_des_setkey_enc(&des, des_key); + lwip_des_crypt_ecb(&des, challenge, response +8); + lwip_des_free(&des); + + pppcrypt_56_to_64_bit_key(ZPasswordHash + 14, des_key); + lwip_des_init(&des); + lwip_des_setkey_enc(&des, des_key); + lwip_des_crypt_ecb(&des, challenge, response +16); + lwip_des_free(&des); + +#if 0 + dbglog("ChallengeResponse - response %.24B", response); +#endif +} + +static void ChallengeHash(const u_char PeerChallenge[16], const u_char *rchallenge, + const char *username, u_char Challenge[8]) { + lwip_sha1_context sha1Context; + u_char sha1Hash[SHA1_SIGNATURE_SIZE]; + const char *user; + + /* remove domain from "domain\username" */ + if ((user = strrchr(username, '\\')) != NULL) + ++user; + else + user = username; + + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, PeerChallenge, 16); + lwip_sha1_update(&sha1Context, rchallenge, 16); + lwip_sha1_update(&sha1Context, (const unsigned char*)user, strlen(user)); + lwip_sha1_finish(&sha1Context, sha1Hash); + lwip_sha1_free(&sha1Context); + + MEMCPY(Challenge, sha1Hash, 8); +} + +/* + * Convert the ASCII version of the password to Unicode. + * This implicitly supports 8-bit ISO8859/1 characters. + * This gives us the little-endian representation, which + * is assumed by all M$ CHAP RFCs. (Unicode byte ordering + * is machine-dependent.) + */ +static void ascii2unicode(const char ascii[], int ascii_len, u_char unicode[]) { + int i; + + BZERO(unicode, ascii_len * 2); + for (i = 0; i < ascii_len; i++) + unicode[i * 2] = (u_char) ascii[i]; +} + +static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE]) { + lwip_md4_context md4Context; + + lwip_md4_init(&md4Context); + lwip_md4_starts(&md4Context); + lwip_md4_update(&md4Context, secret, secret_len); + lwip_md4_finish(&md4Context, hash); + lwip_md4_free(&md4Context); +} + +static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_len, + u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + + /* Hash the Unicode version of the secret (== password). */ + ascii2unicode(secret, secret_len, unicodePassword); + NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); + + ChallengeResponse(rchallenge, PasswordHash, NTResponse); +} + +static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], const char *username, + const char *secret, int secret_len, u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char Challenge[8]; + + ChallengeHash(PeerChallenge, rchallenge, username, Challenge); + + /* Hash the Unicode version of the secret (== password). */ + ascii2unicode(secret, secret_len, unicodePassword); + NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); + + ChallengeResponse(Challenge, PasswordHash, NTResponse); +} + +#ifdef MSLANMAN +static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ + +static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, + unsigned char *response) { + int i; + u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + lwip_des_context des; + u_char des_key[8]; + + /* LANMan password is case insensitive */ + BZERO(UcasePassword, sizeof(UcasePassword)); + for (i = 0; i < secret_len; i++) + UcasePassword[i] = (u_char)toupper(secret[i]); + + pppcrypt_56_to_64_bit_key(UcasePassword +0, des_key); + lwip_des_init(&des); + lwip_des_setkey_enc(&des, des_key); + lwip_des_crypt_ecb(&des, StdText, PasswordHash +0); + lwip_des_free(&des); + + pppcrypt_56_to_64_bit_key(UcasePassword +7, des_key); + lwip_des_init(&des); + lwip_des_setkey_enc(&des, des_key); + lwip_des_crypt_ecb(&des, StdText, PasswordHash +8); + lwip_des_free(&des); + + ChallengeResponse(rchallenge, PasswordHash, &response[MS_CHAP_LANMANRESP]); +} +#endif + + +static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + /* + * "Magic" constants used in response generation, from RFC 2759. + */ + static const u_char Magic1[39] = /* "Magic server to client signing constant" */ + { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, + 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, + 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; + static const u_char Magic2[41] = /* "Pad to make it do more than one iteration" */ + { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, + 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, + 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, + 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, + 0x6E }; + + int i; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; + u_char Challenge[8]; + + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, PasswordHashHash, MD4_SIGNATURE_SIZE); + lwip_sha1_update(&sha1Context, NTResponse, 24); + lwip_sha1_update(&sha1Context, Magic1, sizeof(Magic1)); + lwip_sha1_finish(&sha1Context, Digest); + lwip_sha1_free(&sha1Context); + + ChallengeHash(PeerChallenge, rchallenge, username, Challenge); + + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, Digest, sizeof(Digest)); + lwip_sha1_update(&sha1Context, Challenge, sizeof(Challenge)); + lwip_sha1_update(&sha1Context, Magic2, sizeof(Magic2)); + lwip_sha1_finish(&sha1Context, Digest); + lwip_sha1_free(&sha1Context); + + /* Convert to ASCII hex string. */ + for (i = 0; i < LWIP_MAX((MS_AUTH_RESPONSE_LENGTH / 2), (int)sizeof(Digest)); i++) + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); +} + + +static void GenerateAuthenticatorResponsePlain( + const char *secret, int secret_len, + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + + /* Hash (x2) the Unicode version of the secret (== password). */ + ascii2unicode(secret, secret_len, unicodePassword); + NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); + NTPasswordHash(PasswordHash, sizeof(PasswordHash), + PasswordHashHash); + + GenerateAuthenticatorResponse(PasswordHashHash, NTResponse, PeerChallenge, + rchallenge, username, authResponse); +} + + +#if MPPE_SUPPORT +/* + * Set mppe_xxxx_key from MS-CHAP credentials. (see RFC 3079) + */ +static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + + /* Hash (x2) the Unicode version of the secret (== password). */ + ascii2unicode(secret, secret_len, unicodePassword); + NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); + NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash); + + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, PasswordHashHash, MD4_SIGNATURE_SIZE); + lwip_sha1_update(&sha1Context, PasswordHashHash, MD4_SIGNATURE_SIZE); + lwip_sha1_update(&sha1Context, rchallenge, 8); + lwip_sha1_finish(&sha1Context, Digest); + lwip_sha1_free(&sha1Context); + + /* Same key in both directions. */ + mppe_set_key(pcb, &pcb->mppe_comp, Digest); + mppe_set_key(pcb, &pcb->mppe_decomp, Digest); + + pcb->mppe_keys_set = 1; +} + +/* + * Set mppe_xxxx_key from MS-CHAPv2 credentials. (see RFC 3079) + */ +static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_char NTResponse[24], int IsServer) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + const u_char *s; + + /* "This is the MPPE Master Key" */ + static const u_char Magic1[27] = + { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; + /* "On the client side, this is the send key; " + "on the server side, it is the receive key." */ + static const u_char Magic2[84] = + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, + 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, + 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; + /* "On the client side, this is the receive key; " + "on the server side, it is the send key." */ + static const u_char Magic3[84] = + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; + + /* Hash (x2) the Unicode version of the secret (== password). */ + ascii2unicode(secret, secret_len, unicodePassword); + NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); + NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash); + + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, PasswordHashHash, MD4_SIGNATURE_SIZE); + lwip_sha1_update(&sha1Context, NTResponse, 24); + lwip_sha1_update(&sha1Context, Magic1, sizeof(Magic1)); + lwip_sha1_finish(&sha1Context, MasterKey); + lwip_sha1_free(&sha1Context); + + /* + * generate send key + */ + if (IsServer) + s = Magic3; + else + s = Magic2; + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, MasterKey, 16); + lwip_sha1_update(&sha1Context, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1Context, s, 84); + lwip_sha1_update(&sha1Context, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1Context, Digest); + lwip_sha1_free(&sha1Context); + + mppe_set_key(pcb, &pcb->mppe_comp, Digest); + + /* + * generate recv key + */ + if (IsServer) + s = Magic2; + else + s = Magic3; + lwip_sha1_init(&sha1Context); + lwip_sha1_starts(&sha1Context); + lwip_sha1_update(&sha1Context, MasterKey, 16); + lwip_sha1_update(&sha1Context, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1Context, s, 84); + lwip_sha1_update(&sha1Context, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1Context, Digest); + lwip_sha1_free(&sha1Context); + + mppe_set_key(pcb, &pcb->mppe_decomp, Digest); + + pcb->mppe_keys_set = 1; +} + +#endif /* MPPE_SUPPORT */ + + +static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len, + unsigned char *response) { +#if !MPPE_SUPPORT + LWIP_UNUSED_ARG(pcb); +#endif /* !MPPE_SUPPORT */ + BZERO(response, MS_CHAP_RESPONSE_LEN); + + ChapMS_NT(rchallenge, secret, secret_len, &response[MS_CHAP_NTRESP]); + +#ifdef MSLANMAN + ChapMS_LANMan(rchallenge, secret, secret_len, + &response[MS_CHAP_LANMANRESP]); + + /* preferred method is set by option */ + response[MS_CHAP_USENT] = !ms_lanman; +#else + response[MS_CHAP_USENT] = 1; +#endif + +#if MPPE_SUPPORT + Set_Start_Key(pcb, rchallenge, secret, secret_len); +#endif /* MPPE_SUPPORT */ +} + + +/* + * If PeerChallenge is NULL, one is generated and the PeerChallenge + * field of response is filled in. Call this way when generating a response. + * If PeerChallenge is supplied, it is copied into the PeerChallenge field. + * Call this way when verifying a response (or debugging). + * Do not call with PeerChallenge = response. + * + * The PeerChallenge field of response is then used for calculation of the + * Authenticator Response. + */ +static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerChallenge, + const char *user, const char *secret, int secret_len, unsigned char *response, + u_char authResponse[], int authenticator) { + /* ARGSUSED */ + LWIP_UNUSED_ARG(authenticator); +#if !MPPE_SUPPORT + LWIP_UNUSED_ARG(pcb); +#endif /* !MPPE_SUPPORT */ + + BZERO(response, MS_CHAP2_RESPONSE_LEN); + + /* Generate the Peer-Challenge if requested, or copy it if supplied. */ + if (!PeerChallenge) + magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); + else + MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, + MS_CHAP2_PEER_CHAL_LEN); + + /* Generate the NT-Response */ + ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user, + secret, secret_len, &response[MS_CHAP2_NTRESP]); + + /* Generate the Authenticator Response. */ + GenerateAuthenticatorResponsePlain(secret, secret_len, + &response[MS_CHAP2_NTRESP], + &response[MS_CHAP2_PEER_CHALLENGE], + rchallenge, user, authResponse); + +#if MPPE_SUPPORT + SetMasterKeys(pcb, secret, secret_len, + &response[MS_CHAP2_NTRESP], authenticator); +#endif /* MPPE_SUPPORT */ +} + +#if 0 /* UNUSED */ +#if MPPE_SUPPORT +/* + * Set MPPE options from plugins. + */ +void set_mppe_enc_types(int policy, int types) { + /* Early exit for unknown policies. */ + if (policy != MPPE_ENC_POL_ENC_ALLOWED || + policy != MPPE_ENC_POL_ENC_REQUIRED) + return; + + /* Don't modify MPPE if it's optional and wasn't already configured. */ + if (policy == MPPE_ENC_POL_ENC_ALLOWED && !ccp_wantoptions[0].mppe) + return; + + /* + * Disable undesirable encryption types. Note that we don't ENABLE + * any encryption types, to avoid overriding manual configuration. + */ + switch(types) { + case MPPE_ENC_TYPES_RC4_40: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ + break; + case MPPE_ENC_TYPES_RC4_128: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ + break; + default: + break; + } +} +#endif /* MPPE_SUPPORT */ +#endif /* UNUSED */ + +const struct chap_digest_type chapms_digest = { + CHAP_MICROSOFT, /* code */ +#if PPP_SERVER + chapms_generate_challenge, + chapms_verify_response, +#endif /* PPP_SERVER */ + chapms_make_response, + NULL, /* check_success */ + chapms_handle_failure, +}; + +const struct chap_digest_type chapms2_digest = { + CHAP_MICROSOFT_V2, /* code */ +#if PPP_SERVER + chapms2_generate_challenge, + chapms2_verify_response, +#endif /* PPP_SERVER */ + chapms2_make_response, + chapms2_check_success, + chapms_handle_failure, +}; + +#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/demand.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/demand.c new file mode 100644 index 0000000..26c6c30 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/demand.c @@ -0,0 +1,465 @@ +/* + * demand.c - Support routines for demand-dialling. + * + * Copyright (c) 1996-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && DEMAND_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef PPP_FILTER +#include +#endif + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/ipcp.h" +#include "netif/ppp/lcp.h" + +char *frame; +int framelen; +int framemax; +int escape_flag; +int flush_flag; +int fcs; + +struct packet { + int length; + struct packet *next; + unsigned char data[1]; +}; + +struct packet *pend_q; +struct packet *pend_qtail; + +static int active_packet (unsigned char *, int); + +/* + * demand_conf - configure the interface for doing dial-on-demand. + */ +void +demand_conf() +{ + int i; + const struct protent *protp; + +/* framemax = lcp_allowoptions[0].mru; + if (framemax < PPP_MRU) */ + framemax = PPP_MRU; + framemax += PPP_HDRLEN + PPP_FCSLEN; + frame = malloc(framemax); + if (frame == NULL) + novm("demand frame"); + framelen = 0; + pend_q = NULL; + escape_flag = 0; + flush_flag = 0; + fcs = PPP_INITFCS; + + netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); + if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 + || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) + fatal("Couldn't set up demand-dialled PPP interface: %m"); + +#ifdef PPP_FILTER + set_filters(&pass_filter, &active_filter); +#endif + + /* + * Call the demand_conf procedure for each protocol that's got one. + */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->demand_conf != NULL) + ((*protp->demand_conf)(pcb)); +/* FIXME: find a way to die() here */ +#if 0 + if (!((*protp->demand_conf)(pcb))) + die(1); +#endif +} + + +/* + * demand_block - set each network protocol to block further packets. + */ +void +demand_block() +{ + int i; + const struct protent *protp; + + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); + get_loop_output(); +} + +/* + * demand_discard - set each network protocol to discard packets + * with an error. + */ +void +demand_discard() +{ + struct packet *pkt, *nextpkt; + int i; + const struct protent *protp; + + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); + get_loop_output(); + + /* discard all saved packets */ + for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { + nextpkt = pkt->next; + free(pkt); + } + pend_q = NULL; + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; +} + +/* + * demand_unblock - set each enabled network protocol to pass packets. + */ +void +demand_unblock() +{ + int i; + const struct protent *protp; + + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); +} + +/* + * FCS lookup table as calculated by genfcstab. + */ +static u_short fcstab[256] = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; + +/* + * loop_chars - process characters received from the loopback. + * Calls loop_frame when a complete frame has been accumulated. + * Return value is 1 if we need to bring up the link, 0 otherwise. + */ +int +loop_chars(p, n) + unsigned char *p; + int n; +{ + int c, rv; + + rv = 0; + +/* check for synchronous connection... */ + + if ( (p[0] == 0xFF) && (p[1] == 0x03) ) { + rv = loop_frame(p,n); + return rv; + } + + for (; n > 0; --n) { + c = *p++; + if (c == PPP_FLAG) { + if (!escape_flag && !flush_flag + && framelen > 2 && fcs == PPP_GOODFCS) { + framelen -= 2; + if (loop_frame((unsigned char *)frame, framelen)) + rv = 1; + } + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; + continue; + } + if (flush_flag) + continue; + if (escape_flag) { + c ^= PPP_TRANS; + escape_flag = 0; + } else if (c == PPP_ESCAPE) { + escape_flag = 1; + continue; + } + if (framelen >= framemax) { + flush_flag = 1; + continue; + } + frame[framelen++] = c; + fcs = PPP_FCS(fcs, c); + } + return rv; +} + +/* + * loop_frame - given a frame obtained from the loopback, + * decide whether to bring up the link or not, and, if we want + * to transmit this frame later, put it on the pending queue. + * Return value is 1 if we need to bring up the link, 0 otherwise. + * We assume that the kernel driver has already applied the + * pass_filter, so we won't get packets it rejected. + * We apply the active_filter to see if we want this packet to + * bring up the link. + */ +int +loop_frame(frame, len) + unsigned char *frame; + int len; +{ + struct packet *pkt; + + /* dbglog("from loop: %P", frame, len); */ + if (len < PPP_HDRLEN) + return 0; + if ((PPP_PROTOCOL(frame) & 0x8000) != 0) + return 0; /* shouldn't get any of these anyway */ + if (!active_packet(frame, len)) + return 0; + + pkt = (struct packet *) malloc(sizeof(struct packet) + len); + if (pkt != NULL) { + pkt->length = len; + pkt->next = NULL; + memcpy(pkt->data, frame, len); + if (pend_q == NULL) + pend_q = pkt; + else + pend_qtail->next = pkt; + pend_qtail = pkt; + } + return 1; +} + +/* + * demand_rexmit - Resend all those frames which we got via the + * loopback, now that the real serial link is up. + */ +void +demand_rexmit(proto, newip) + int proto; + u32_t newip; +{ + struct packet *pkt, *prev, *nextpkt; + unsigned short checksum; + unsigned short pkt_checksum = 0; + unsigned iphdr; + struct timeval tv; + char cv = 0; + char ipstr[16]; + + prev = NULL; + pkt = pend_q; + pend_q = NULL; + tv.tv_sec = 1; + tv.tv_usec = 0; + select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ + for (; pkt != NULL; pkt = nextpkt) { + nextpkt = pkt->next; + if (PPP_PROTOCOL(pkt->data) == proto) { + if ( (proto == PPP_IP) && newip ) { + /* Get old checksum */ + + iphdr = (pkt->data[4] & 15) << 2; + checksum = *((unsigned short *) (pkt->data+14)); + if (checksum == 0xFFFF) { + checksum = 0; + } + + + if (pkt->data[13] == 17) { + pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr)); + if (pkt_checksum) { + cv = 1; + if (pkt_checksum == 0xFFFF) { + pkt_checksum = 0; + } + } + else { + cv = 0; + } + } + + if (pkt->data[13] == 6) { + pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); + cv = 1; + if (pkt_checksum == 0xFFFF) { + pkt_checksum = 0; + } + } + + /* Delete old Source-IP-Address */ + checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + + pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + + /* Change Source-IP-Address */ + * ((u32_t *) (pkt->data + 16)) = newip; + + /* Add new Source-IP-Address */ + checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + + pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + + /* Write new checksum */ + if (!checksum) { + checksum = 0xFFFF; + } + *((unsigned short *) (pkt->data+14)) = checksum; + if (pkt->data[13] == 6) { + *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; + } + if (cv && (pkt->data[13] == 17) ) { + *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; + } + + /* Log Packet */ + strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); + if (pkt->data[13] == 1) { + syslog(LOG_INFO,"Open ICMP %s -> %s\n", + ipstr, + inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); + } else { + syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", + pkt->data[13] == 6 ? "TCP" : "UDP", + ipstr, + ntohs(*( (short *) (pkt->data+iphdr+4))), + inet_ntoa(*( (struct in_addr *) (pkt->data+20))), + ntohs(*( (short *) (pkt->data+iphdr+6)))); + } + } + output(pcb, pkt->data, pkt->length); + free(pkt); + } else { + if (prev == NULL) + pend_q = pkt; + else + prev->next = pkt; + prev = pkt; + } + } + pend_qtail = prev; + if (prev != NULL) + prev->next = NULL; +} + +/* + * Scan a packet to decide whether it is an "active" packet, + * that is, whether it is worth bringing up the link for. + */ +static int +active_packet(p, len) + unsigned char *p; + int len; +{ + int proto, i; + const struct protent *protp; + + if (len < PPP_HDRLEN) + return 0; + proto = PPP_PROTOCOL(p); +#ifdef PPP_FILTER + p[0] = 1; /* outbound packet indicator */ + if ((pass_filter.bf_len != 0 + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; + return 0; + } + p[0] = 0xff; +#endif + for (i = 0; (protp = protocols[i]) != NULL; ++i) { + if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { + if (protp->active_pkt == NULL) + return 1; + return (*protp->active_pkt)(p, len); + } + } + return 0; /* not a supported protocol !!?? */ +} + +#endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eap.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eap.c new file mode 100644 index 0000000..8fb5636 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eap.c @@ -0,0 +1,2423 @@ +/* + * eap.c - Extensible Authentication Protocol for PPP (RFC 2284) + * + * Copyright (c) 2001 by Sun Microsystems, Inc. + * All rights reserved. + * + * Non-exclusive rights to redistribute, modify, translate, and use + * this software in source and binary forms, in whole or in part, is + * hereby granted, provided that the above copyright notice is + * duplicated in any source form, and that neither the name of the + * copyright holder nor the author is used to endorse or promote + * products derived from this software. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Original version by James Carlson + * + * This implementation of EAP supports MD5-Challenge and SRP-SHA1 + * authentication styles. Note that support of MD5-Challenge is a + * requirement of RFC 2284, and that it's essentially just a + * reimplementation of regular RFC 1994 CHAP using EAP messages. + * + * As an authenticator ("server"), there are multiple phases for each + * style. In the first phase of each style, the unauthenticated peer + * name is queried using the EAP Identity request type. If the + * "remotename" option is used, then this phase is skipped, because + * the peer's name is presumed to be known. + * + * For MD5-Challenge, there are two phases, and the second phase + * consists of sending the challenge itself and handling the + * associated response. + * + * For SRP-SHA1, there are four phases. The second sends 's', 'N', + * and 'g'. The reply contains 'A'. The third sends 'B', and the + * reply contains 'M1'. The forth sends the 'M2' value. + * + * As an authenticatee ("client"), there's just a single phase -- + * responding to the queries generated by the peer. EAP is an + * authenticator-driven protocol. + * + * Based on draft-ietf-pppext-eap-srp-03.txt. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/eap.h" +#include "netif/ppp/magic.h" +#include "netif/ppp/pppcrypt.h" + +#ifdef USE_SRP +#include +#include +#include +#endif /* USE_SRP */ + +#ifndef SHA_DIGESTSIZE +#define SHA_DIGESTSIZE 20 +#endif + +#ifdef USE_SRP +static char *pn_secret = NULL; /* Pseudonym generating secret */ +#endif + +#if PPP_OPTIONS +/* + * Command-line options. + */ +static option_t eap_option_list[] = { + { "eap-restart", o_int, &eap_states[0].es_server.ea_timeout, + "Set retransmit timeout for EAP Requests (server)" }, + { "eap-max-sreq", o_int, &eap_states[0].es_server.ea_maxrequests, + "Set max number of EAP Requests sent (server)" }, + { "eap-timeout", o_int, &eap_states[0].es_client.ea_timeout, + "Set time limit for peer EAP authentication" }, + { "eap-max-rreq", o_int, &eap_states[0].es_client.ea_maxrequests, + "Set max number of EAP Requests allows (client)" }, + { "eap-interval", o_int, &eap_states[0].es_rechallenge, + "Set interval for EAP rechallenge" }, +#ifdef USE_SRP + { "srp-interval", o_int, &eap_states[0].es_lwrechallenge, + "Set interval for SRP lightweight rechallenge" }, + { "srp-pn-secret", o_string, &pn_secret, + "Long term pseudonym generation secret" }, + { "srp-use-pseudonym", o_bool, &eap_states[0].es_usepseudo, + "Use pseudonym if offered one by server", 1 }, +#endif + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points. + */ +static void eap_init(ppp_pcb *pcb); +static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen); +static void eap_protrej(ppp_pcb *pcb); +static void eap_lowerup(ppp_pcb *pcb); +static void eap_lowerdown(ppp_pcb *pcb); +#if PRINTPKT_SUPPORT +static int eap_printpkt(const u_char *inp, int inlen, + void (*)(void *arg, const char *fmt, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ + +const struct protent eap_protent = { + PPP_EAP, /* protocol number */ + eap_init, /* initialization procedure */ + eap_input, /* process a received packet */ + eap_protrej, /* process a received protocol-reject */ + eap_lowerup, /* lower layer has gone up */ + eap_lowerdown, /* lower layer has gone down */ + NULL, /* open the protocol */ + NULL, /* close the protocol */ +#if PRINTPKT_SUPPORT + eap_printpkt, /* print a packet in readable form */ +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, /* process a received data packet */ +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "EAP", /* text name of protocol */ + NULL, /* text name of corresponding data protocol */ +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + eap_option_list, /* list of command-line options */ + NULL, /* check requested options; assign defaults */ +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, /* configure interface for demand-dial */ + NULL /* say whether to bring up link for this pkt */ +#endif /* DEMAND_SUPPORT */ +}; + +#ifdef USE_SRP +/* + * A well-known 2048 bit modulus. + */ +static const u_char wkmodulus[] = { + 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, + 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, + 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, + 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, + 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, + 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, + 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, + 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, + 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, + 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, + 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, + 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, + 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, + 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, + 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, + 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, + 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, + 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, + 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, + 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, + 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, + 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, + 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, + 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, + 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, + 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, + 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, + 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, + 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, + 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, + 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, + 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 +}; +#endif + +#if PPP_SERVER +/* Local forward declarations. */ +static void eap_server_timeout(void *arg); +#endif /* PPP_SERVER */ + +/* + * Convert EAP state code to printable string for debug. + */ +static const char * eap_state_name(enum eap_state_code esc) +{ + static const char *state_names[] = { EAP_STATES }; + + return (state_names[(int)esc]); +} + +/* + * eap_init - Initialize state for an EAP user. This is currently + * called once by main() during start-up. + */ +static void eap_init(ppp_pcb *pcb) { + + BZERO(&pcb->eap, sizeof(eap_state)); +#if PPP_SERVER + pcb->eap.es_server.ea_id = magic(); +#endif /* PPP_SERVER */ +} + +/* + * eap_client_timeout - Give up waiting for the peer to send any + * Request messages. + */ +static void eap_client_timeout(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (!eap_client_active(pcb)) + return; + + ppp_error("EAP: timeout waiting for Request from peer"); + auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; +} + +/* + * eap_authwithpeer - Authenticate to our peer (behave as client). + * + * Start client state and wait for requests. This is called only + * after eap_lowerup. + */ +void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { + + if(NULL == localname) + return; + + /* Save the peer name we're given */ + pcb->eap.es_client.ea_name = localname; + pcb->eap.es_client.ea_namelen = strlen(localname); + + pcb->eap.es_client.ea_state = eapListen; + + /* + * Start a timer so that if the other end just goes + * silent, we don't sit here waiting forever. + */ + if (pcb->settings.eap_req_time > 0) + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); +} + +#if PPP_SERVER +/* + * Format a standard EAP Failure message and send it to the peer. + * (Server operation) + */ +static void eap_send_failure(ppp_pcb *pcb) { + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_FAILURE, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + pcb->eap.es_server.ea_state = eapBadAuth; + auth_peer_fail(pcb, PPP_EAP); +} + +/* + * Format a standard EAP Success message and send it to the peer. + * (Server operation) + */ +static void eap_send_success(ppp_pcb *pcb) { + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_SUCCESS, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + auth_peer_success(pcb, PPP_EAP, 0, + pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); +} +#endif /* PPP_SERVER */ + +#ifdef USE_SRP +/* + * Set DES key according to pseudonym-generating secret and current + * date. + */ +static bool +pncrypt_setkey(int timeoffs) +{ + struct tm *tp; + char tbuf[9]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + time_t reftime; + + if (pn_secret == NULL) + return (0); + reftime = time(NULL) + timeoffs; + tp = localtime(&reftime); + SHA1Init(&ctxt); + SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); + strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); + SHA1Update(&ctxt, tbuf, strlen(tbuf)); + SHA1Final(dig, &ctxt); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + return (DesSetkey(dig)); +} + +static char base64[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +struct b64state { + u32_t bs_bits; + int bs_offs; +}; + +static int +b64enc(bs, inp, inlen, outp) +struct b64state *bs; +u_char *inp; +int inlen; +u_char *outp; +{ + int outlen = 0; + + while (inlen > 0) { + bs->bs_bits = (bs->bs_bits << 8) | *inp++; + inlen--; + bs->bs_offs += 8; + if (bs->bs_offs >= 24) { + *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; + *outp++ = base64[bs->bs_bits & 0x3F]; + outlen += 4; + bs->bs_offs = 0; + bs->bs_bits = 0; + } + } + return (outlen); +} + +static int +b64flush(bs, outp) +struct b64state *bs; +u_char *outp; +{ + int outlen = 0; + + if (bs->bs_offs == 8) { + *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; + outlen = 2; + } else if (bs->bs_offs == 16) { + *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; + outlen = 3; + } + bs->bs_offs = 0; + bs->bs_bits = 0; + return (outlen); +} + +static int +b64dec(bs, inp, inlen, outp) +struct b64state *bs; +u_char *inp; +int inlen; +u_char *outp; +{ + int outlen = 0; + char *cp; + + while (inlen > 0) { + if ((cp = strchr(base64, *inp++)) == NULL) + break; + bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); + inlen--; + bs->bs_offs += 6; + if (bs->bs_offs >= 8) { + *outp++ = bs->bs_bits >> (bs->bs_offs - 8); + outlen++; + bs->bs_offs -= 8; + } + } + return (outlen); +} +#endif /* USE_SRP */ + +#if PPP_SERVER +/* + * Assume that current waiting server state is complete and figure + * next state to use based on available authentication data. 'status' + * indicates if there was an error in handling the last query. It is + * 0 for success and non-zero for failure. + */ +static void eap_figure_next_state(ppp_pcb *pcb, int status) { +#ifdef USE_SRP + unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; + struct t_pw tpw; + struct t_confent *tce, mytce; + char *cp, *cp2; + struct t_server *ts; + int id, i, plen, toffs; + u_char vals[2]; + struct b64state bs; +#endif /* USE_SRP */ + + pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; + switch (pcb->eap.es_server.ea_state) { + case eapBadAuth: + return; + + case eapIdentify: +#ifdef USE_SRP + /* Discard any previous session. */ + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } +#endif /* USE_SRP */ + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } +#ifdef USE_SRP + /* If we've got a pseudonym, try to decode to real name. */ + if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && + strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, + SRP_PSEUDO_LEN) == 0 && + (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < + sizeof (secbuf)) { + BZERO(&bs, sizeof (bs)); + plen = b64dec(&bs, + pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, + pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, + secbuf); + toffs = 0; + for (i = 0; i < 5; i++) { + pncrypt_setkey(toffs); + toffs -= 86400; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesDecrypt(secbuf, clear)) { + ppp_dbglog("no DES here; cannot decode " + "pseudonym"); + return; + } + id = *(unsigned char *)clear; + if (id + 1 <= plen && id + 9 > plen) + break; + } + if (plen % 8 == 0 && i < 5) { + /* + * Note that this is always shorter than the + * original stored string, so there's no need + * to realloc. + */ + if ((i = plen = *(unsigned char *)clear) > 7) + i = 7; + pcb->eap.es_server.ea_peerlen = plen; + dp = (unsigned char *)pcb->eap.es_server.ea_peer; + MEMCPY(dp, clear + 1, i); + plen -= i; + dp += i; + sp = secbuf + 8; + while (plen > 0) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesDecrypt(sp, dp); + sp += 8; + dp += 8; + plen -= 8; + } + pcb->eap.es_server.ea_peer[ + pcb->eap.es_server.ea_peerlen] = '\0'; + ppp_dbglog("decoded pseudonym to \"%.*q\"", + pcb->eap.es_server.ea_peerlen, + pcb->eap.es_server.ea_peer); + } else { + ppp_dbglog("failed to decode real name"); + /* Stay in eapIdentfy state; requery */ + break; + } + } + /* Look up user in secrets database. */ + if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { + /* Set up default in case SRP entry is bad */ + pcb->eap.es_server.ea_state = eapMD5Chall; + /* Get t_confent based on index in srp-secrets */ + id = strtol((char *)secbuf, &cp, 10); + if (*cp++ != ':' || id < 0) + break; + if (id == 0) { + mytce.index = 0; + mytce.modulus.data = (u_char *)wkmodulus; + mytce.modulus.len = sizeof (wkmodulus); + mytce.generator.data = (u_char *)"\002"; + mytce.generator.len = 1; + tce = &mytce; + } else if ((tce = gettcid(id)) != NULL) { + /* + * Client will have to verify this modulus/ + * generator combination, and that will take + * a while. Lengthen the timeout here. + */ + if (pcb->settings.eap_timeout_time > 0 && + pcb->settings.eap_timeout_time < 30) + pcb->settings.eap_timeout_time = 30; + } else { + break; + } + if ((cp2 = strchr(cp, ':')) == NULL) + break; + *cp2++ = '\0'; + tpw.pebuf.name = pcb->eap.es_server.ea_peer; + tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, + cp); + tpw.pebuf.password.data = tpw.pwbuf; + tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, + cp2); + tpw.pebuf.salt.data = tpw.saltbuf; + if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) + break; + pcb->eap.es_server.ea_session = (void *)ts; + pcb->eap.es_server.ea_state = eapSRP1; + vals[0] = pcb->eap.es_server.ea_id + 1; + vals[1] = EAPT_SRP; + t_serveraddexdata(ts, vals, 2); + /* Generate B; must call before t_servergetkey() */ + t_servergenexp(ts); + break; + } +#endif /* USE_SRP */ + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + case eapSRP1: +#ifdef USE_SRP + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } +#endif /* USE_SRP */ + if (status == 1) { + pcb->eap.es_server.ea_state = eapMD5Chall; + } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP2; + } + break; + + case eapSRP2: +#ifdef USE_SRP + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } +#endif /* USE_SRP */ + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP3; + } + break; + + case eapSRP3: + case eapSRP4: +#ifdef USE_SRP + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } +#endif /* USE_SRP */ + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + case eapMD5Chall: + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + default: + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } + if (pcb->eap.es_server.ea_state == eapBadAuth) + eap_send_failure(pcb); +} + +/* + * Format an EAP Request message and send it to the peer. Message + * type depends on current state. (Server operation) + */ +static void eap_send_request(ppp_pcb *pcb) { + struct pbuf *p; + u_char *outp; + u_char *lenloc; + int outlen; + int len; + const char *str; +#ifdef USE_SRP + struct t_server *ts; + u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; + int i, j; + struct b64state b64; + SHA1_CTX ctxt; +#endif /* USE_SRP */ + + /* Handle both initial auth and restart */ + if (pcb->eap.es_server.ea_state < eapIdentify && + pcb->eap.es_server.ea_state != eapInitial) { + pcb->eap.es_server.ea_state = eapIdentify; +#if PPP_REMOTENAME + if (pcb->settings.explicit_remote && pcb->remote_name) { + /* + * If we already know the peer's + * unauthenticated name, then there's no + * reason to ask. Go to next state instead. + */ + int len = (int)strlen(pcb->remote_name); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + } +#endif /* PPP_REMOTENAME */ + } + + if (pcb->settings.eap_max_transmits > 0 && + pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { + if (pcb->eap.es_server.ea_responses > 0) + ppp_error("EAP: too many Requests sent"); + else + ppp_error("EAP: no response to Requests"); + eap_send_failure(pcb); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_REQUEST, outp); + PUTCHAR(pcb->eap.es_server.ea_id, outp); + lenloc = outp; + INCPTR(2, outp); + + switch (pcb->eap.es_server.ea_state) { + case eapIdentify: + PUTCHAR(EAPT_IDENTITY, outp); + str = "Name"; + len = strlen(str); + MEMCPY(outp, str, len); + INCPTR(len, outp); + break; + + case eapMD5Chall: + PUTCHAR(EAPT_MD5CHAP, outp); + /* + * pick a random challenge length between + * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH + */ + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + PUTCHAR(pcb->eap.es_challen, outp); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + break; + +#ifdef USE_SRP + case eapSRP1: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CHALLENGE, outp); + + PUTCHAR(pcb->eap.es_server.ea_namelen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + PUTCHAR(ts->s.len, outp); + MEMCPY(outp, ts->s.data, ts->s.len); + INCPTR(ts->s.len, outp); + + if (ts->g.len == 1 && ts->g.data[0] == 2) { + PUTCHAR(0, outp); + } else { + PUTCHAR(ts->g.len, outp); + MEMCPY(outp, ts->g.data, ts->g.len); + INCPTR(ts->g.len, outp); + } + + if (ts->n.len != sizeof (wkmodulus) || + BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { + MEMCPY(outp, ts->n.data, ts->n.len); + INCPTR(ts->n.len, outp); + } + break; + + case eapSRP2: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SKEY, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, ts->B.data, ts->B.len); + INCPTR(ts->B.len, outp); + break; + + case eapSRP3: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SVALIDATOR, outp); + PUTLONG(SRPVAL_EBIT, outp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); + INCPTR(SHA_DIGESTSIZE, outp); + + if (pncrypt_setkey(0)) { + /* Generate pseudonym */ + optr = outp; + cp = (unsigned char *)pcb->eap.es_server.ea_peer; + if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) + j = 7; + clear[0] = i; + MEMCPY(clear + 1, cp, j); + i -= j; + cp += j; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesEncrypt(clear, cipher)) { + ppp_dbglog("no DES here; not generating pseudonym"); + break; + } + BZERO(&b64, sizeof (b64)); + outp++; /* space for pseudonym length */ + outp += b64enc(&b64, cipher, 8, outp); + while (i >= 8) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(cp, cipher); + outp += b64enc(&b64, cipher, 8, outp); + cp += 8; + i -= 8; + } + if (i > 0) { + MEMCPY(clear, cp, i); + cp += i; + magic_random_bytes(cp, 8-i); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(clear, cipher); + outp += b64enc(&b64, cipher, 8, outp); + } + outp += b64flush(&b64, outp); + + /* Set length and pad out to next 20 octet boundary */ + i = outp - optr - 1; + *optr = i; + i %= SHA_DIGESTSIZE; + if (i != 0) { + magic_random_bytes(outp, SHA_DIGESTSIZE-i); + INCPTR(SHA_DIGESTSIZE-i, outp); + } + + /* Obscure the pseudonym with SHA1 hash */ + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + while (optr < outp) { + SHA1Final(dig, &ctxt); + cp = dig; + while (cp < dig + SHA_DIGESTSIZE) + *optr++ ^= *cp++; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, + SHA_DIGESTSIZE); + } + } + break; + + case eapSRP4: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_LWRECHALLENGE, outp); + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + break; +#endif /* USE_SRP */ + + default: + return; + } + + outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; + PUTSHORT(outlen, lenloc); + + pbuf_realloc(p, outlen + PPP_HDRLEN); + ppp_write(pcb, p); + + pcb->eap.es_server.ea_requests++; + + if (pcb->settings.eap_timeout_time > 0) + TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); +} + +/* + * eap_authpeer - Authenticate our peer (behave as server). + * + * Start server state and send first request. This is called only + * after eap_lowerup. + */ +void eap_authpeer(ppp_pcb *pcb, const char *localname) { + + /* Save the name we're given. */ + pcb->eap.es_server.ea_name = localname; + pcb->eap.es_server.ea_namelen = strlen(localname); + + pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; + + /* Lower layer up yet? */ + if (pcb->eap.es_server.ea_state == eapInitial || + pcb->eap.es_server.ea_state == eapPending) { + pcb->eap.es_server.ea_state = eapPending; + return; + } + + pcb->eap.es_server.ea_state = eapPending; + + /* ID number not updated here intentionally; hashed into M1 */ + eap_send_request(pcb); +} + +/* + * eap_server_timeout - Retransmission timer for sending Requests + * expired. + */ +static void eap_server_timeout(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (!eap_server_active(pcb)) + return; + + /* EAP ID number must not change on timeout. */ + eap_send_request(pcb); +} + +/* + * When it's time to send rechallenge the peer, this timeout is + * called. Once the rechallenge is successful, the response handler + * will restart the timer. If it fails, then the link is dropped. + */ +static void eap_rechallenge(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (pcb->eap.es_server.ea_state != eapOpen && + pcb->eap.es_server.ea_state != eapSRP4) + return; + + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); +} + +static void srp_lwrechallenge(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (pcb->eap.es_server.ea_state != eapOpen || + pcb->eap.es_server.ea_type != EAPT_SRP) + return; + + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapSRP4; + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); +} +#endif /* PPP_SERVER */ + +/* + * eap_lowerup - The lower layer is now up. + * + * This is called before either eap_authpeer or eap_authwithpeer. See + * link_established() in auth.c. All that's necessary here is to + * return to closed state so that those two routines will do the right + * thing. + */ +static void eap_lowerup(ppp_pcb *pcb) { + pcb->eap.es_client.ea_state = eapClosed; +#if PPP_SERVER + pcb->eap.es_server.ea_state = eapClosed; +#endif /* PPP_SERVER */ +} + +/* + * eap_lowerdown - The lower layer is now down. + * + * Cancel all timeouts and return to initial state. + */ +static void eap_lowerdown(ppp_pcb *pcb) { + + if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } +#if PPP_SERVER + if (eap_server_active(pcb)) { + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + } else { + if ((pcb->eap.es_server.ea_state == eapOpen || + pcb->eap.es_server.ea_state == eapSRP4) && + pcb->eap.es_rechallenge > 0) { + UNTIMEOUT(eap_rechallenge, (void *)pcb); + } + if (pcb->eap.es_server.ea_state == eapOpen && + pcb->eap.es_lwrechallenge > 0) { + UNTIMEOUT(srp_lwrechallenge, (void *)pcb); + } + } + + pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; + pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; +#endif /* PPP_SERVER */ +} + +/* + * eap_protrej - Peer doesn't speak this protocol. + * + * This shouldn't happen. If it does, it represents authentication + * failure. + */ +static void eap_protrej(ppp_pcb *pcb) { + + if (eap_client_active(pcb)) { + ppp_error("EAP authentication failed due to Protocol-Reject"); + auth_withpeer_fail(pcb, PPP_EAP); + } +#if PPP_SERVER + if (eap_server_active(pcb)) { + ppp_error("EAP authentication of peer failed on Protocol-Reject"); + auth_peer_fail(pcb, PPP_EAP); + } +#endif /* PPP_SERVER */ + eap_lowerdown(pcb); +} + +/* + * Format and send a regular EAP Response message. + */ +static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_char *str, int lenstr) { + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(typenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); +} + +/* + * Format and send an MD5-Challenge EAP Response message. + */ +static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char *name, int namelen) { + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + + namelen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_MD5CHAP, outp); + PUTCHAR(MD5_SIGNATURE_SIZE, outp); + MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); + INCPTR(MD5_SIGNATURE_SIZE, outp); + if (namelen > 0) { + MEMCPY(outp, name, namelen); + } + + ppp_write(pcb, p); +} + +#ifdef USE_SRP +/* + * Format and send a SRP EAP Response message. + */ +static void +eap_srp_response(esp, id, subtypenum, str, lenstr) +eap_state *esp; +u_char id; +u_char subtypenum; +u_char *str; +int lenstr; +{ + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(subtypenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); +} + +/* + * Format and send a SRP EAP Client Validator Response message. + */ +static void +eap_srpval_response(esp, id, flags, str) +eap_state *esp; +u_char id; +u32_t flags; +u_char *str; +{ + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + + SHA_DIGESTSIZE; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CVALIDATOR, outp); + PUTLONG(flags, outp); + MEMCPY(outp, str, SHA_DIGESTSIZE); + + ppp_write(pcb, p); +} +#endif /* USE_SRP */ + +static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) { + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char); + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_NAK, outp); + PUTCHAR(type, outp); + + ppp_write(pcb, p); +} + +#ifdef USE_SRP +static char * +name_of_pn_file() +{ + char *user, *path, *file; + struct passwd *pw; + size_t pl; + static bool pnlogged = 0; + + pw = getpwuid(getuid()); + if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { + errno = EINVAL; + return (NULL); + } + file = _PATH_PSEUDONYM; + pl = strlen(user) + strlen(file) + 2; + path = malloc(pl); + if (path == NULL) + return (NULL); + (void) slprintf(path, pl, "%s/%s", user, file); + if (!pnlogged) { + ppp_dbglog("pseudonym file: %s", path); + pnlogged = 1; + } + return (path); +} + +static int +open_pn_file(modebits) +mode_t modebits; +{ + char *path; + int fd, err; + + if ((path = name_of_pn_file()) == NULL) + return (-1); + fd = open(path, modebits, S_IRUSR | S_IWUSR); + err = errno; + free(path); + errno = err; + return (fd); +} + +static void +remove_pn_file() +{ + char *path; + + if ((path = name_of_pn_file()) != NULL) { + (void) unlink(path); + (void) free(path); + } +} + +static void +write_pseudonym(esp, inp, len, id) +eap_state *esp; +u_char *inp; +int len, id; +{ + u_char val; + u_char *datp, *digp; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int dsize, fd, olen = len; + + /* + * Do the decoding by working backwards. This eliminates the need + * to save the decoded output in a separate buffer. + */ + val = id; + while (len > 0) { + if ((dsize = len % SHA_DIGESTSIZE) == 0) + dsize = SHA_DIGESTSIZE; + len -= dsize; + datp = inp + len; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &val, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); + if (len > 0) { + SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); + } else { + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + } + SHA1Final(dig, &ctxt); + for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) + *datp++ ^= *digp; + } + + /* Now check that the result is sane */ + if (olen <= 0 || *inp + 1 > olen) { + ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); + return; + } + + /* Save it away */ + fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); + if (fd < 0) { + ppp_dbglog("EAP: error saving pseudonym: %m"); + return; + } + len = write(fd, inp + 1, *inp); + if (close(fd) != -1 && len == *inp) { + ppp_dbglog("EAP: saved pseudonym"); + pcb->eap.es_usedpseudo = 0; + } else { + ppp_dbglog("EAP: failed to save pseudonym"); + remove_pn_file(); + } +} +#endif /* USE_SRP */ + +/* + * eap_request - Receive EAP Request message (client mode). + */ +static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) { + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; +#ifdef USE_SRP + struct t_client *tc; + struct t_num sval, gval, Nval, *Ap, Bval; + u_char vals[2]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int fd; +#endif /* USE_SRP */ + + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the + * same for duplicate detection purposes. + */ + + pcb->eap.es_client.ea_requests++; + if (pcb->settings.eap_allow_req != 0 && + pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { + ppp_info("EAP: received too many Request messages"); + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + auth_withpeer_fail(pcb, PPP_EAP); + return; + } + + if (len <= 0) { + ppp_error("EAP: empty Request message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (len > 0) + ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); +#ifdef USE_SRP + if (pcb->eap.es_usepseudo && + (pcb->eap.es_usedpseudo == 0 || + (pcb->eap.es_usedpseudo == 1 && + id == pcb->eap.es_client.ea_id))) { + pcb->eap.es_usedpseudo = 1; + /* Try to get a pseudonym */ + if ((fd = open_pn_file(O_RDONLY)) >= 0) { + strcpy(rhostname, SRP_PSEUDO_ID); + len = read(fd, rhostname + SRP_PSEUDO_LEN, + sizeof (rhostname) - SRP_PSEUDO_LEN); + /* XXX NAI unsupported */ + if (len > 0) { + eap_send_response(pcb, id, typenum, + rhostname, len + SRP_PSEUDO_LEN); + } + (void) close(fd); + if (len > 0) + break; + } + } + /* Stop using pseudonym now. */ + if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { + remove_pn_file(); + pcb->eap.es_usedpseudo = 2; + } +#endif /* USE_SRP */ + eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + + case EAPT_NOTIFICATION: + if (len > 0) + ppp_info("EAP: Notification \"%.*q\"", len, inp); + eap_send_response(pcb, id, typenum, NULL, 0); + break; + + case EAPT_NAK: + /* + * Avoid the temptation to send Response Nak in reply + * to Request Nak here. It can only lead to trouble. + */ + ppp_warn("EAP: unexpected Nak in Request; ignored"); + /* Return because we're waiting for something real. */ + return; + + case EAPT_MD5CHAP: + if (len < 1) { + ppp_error("EAP: received MD5-Challenge with no data"); + /* Bogus request; wait for something real. */ + return; + } + GETCHAR(vallen, inp); + len--; + if (vallen < 8 || vallen > len) { + ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", + vallen, len); + /* Try something better. */ + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } + +#if PPP_REMOTENAME + /* In case the remote doesn't give us his name. */ + if (pcb->settings.explicit_remote || + (pcb->settings.remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); +#endif /* PPP_REMOTENAME */ + + /* + * Get the secret for authenticating ourselves with + * the specified host. + */ + if (!get_secret(pcb, pcb->eap.es_client.ea_name, + rhostname, secret, &secret_len, 0)) { + ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + typenum = id; + lwip_md5_update(&mdContext, &typenum, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, inp, vallen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + +#ifdef USE_SRP + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: received empty SRP Request"); + /* Bogus request; wait for something real. */ + return; + } + + /* Get subtype */ + GETCHAR(vallen, inp); + len--; + switch (vallen) { + case EAPSRP_CHALLENGE: + tc = NULL; + if (pcb->eap.es_client.ea_session != NULL) { + tc = (struct t_client *)pcb->eap.es_client. + ea_session; + /* + * If this is a new challenge, then start + * over with a new client session context. + * Otherwise, just resend last response. + */ + if (id != pcb->eap.es_client.ea_id) { + t_clientclose(tc); + pcb->eap.es_client.ea_session = NULL; + tc = NULL; + } + } + /* No session key just yet */ + pcb->eap.es_client.ea_skey = NULL; + if (tc == NULL) { + int rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (name)"); + /* Ignore badly-formed messages */ + return; + } + MEMCPY(rhostname, inp, vallen); + rhostname[vallen] = '\0'; + INCPTR(vallen, inp); + len -= vallen; + + /* + * In case the remote doesn't give us his name, + * use configured name. + */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == 0)) { + strlcpy(rhostname, remote_name, + sizeof (rhostname)); + } + + rhostnamelen = (int)strlen(rhostname); + if (rhostnamelen > MAXNAMELEN) { + rhostnamelen = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); + pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; + pcb->eap.es_client.ea_peerlen = rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (s)"); + /* Ignore badly-formed messages */ + return; + } + sval.data = inp; + sval.len = vallen; + INCPTR(vallen, inp); + len -= vallen; + + GETCHAR(vallen, inp); + len--; + if (vallen > len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (g)"); + /* Ignore badly-formed messages */ + return; + } + /* If no generator present, then use value 2 */ + if (vallen == 0) { + gval.data = (u_char *)"\002"; + gval.len = 1; + } else { + gval.data = inp; + gval.len = vallen; + } + INCPTR(vallen, inp); + len -= vallen; + + /* + * If no modulus present, then use well-known + * value. + */ + if (len == 0) { + Nval.data = (u_char *)wkmodulus; + Nval.len = sizeof (wkmodulus); + } else { + Nval.data = inp; + Nval.len = len; + } + tc = t_clientopen(pcb->eap.es_client.ea_name, + &Nval, &gval, &sval); + if (tc == NULL) { + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + pcb->eap.es_client.ea_session = (void *)tc; + + /* Add Challenge ID & type to verifier */ + vals[0] = id; + vals[1] = EAPT_SRP; + t_clientaddexdata(tc, vals, 2); + } + Ap = t_clientgenexp(tc); + eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, + Ap->len); + break; + + case EAPSRP_SKEY: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL) { + ppp_warn("EAP: peer sent Subtype 2 without 1"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + if (pcb->eap.es_client.ea_skey != NULL) { + /* + * ID number should not change here. Warn + * if it does (but otherwise ignore). + */ + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 2 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + if (get_srp_secret(pcb->eap.es_unit, + pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_peer, secret, 0) == 0) { + /* + * Can't work with this peer because + * the secret is missing. Just give + * up. + */ + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + Bval.data = inp; + Bval.len = len; + t_clientpasswd(tc, secret); + BZERO(secret, sizeof (secret)); + pcb->eap.es_client.ea_skey = + t_clientgetkey(tc, &Bval); + if (pcb->eap.es_client.ea_skey == NULL) { + /* Server is rogue; stop now */ + ppp_error("EAP: SRP server is rogue"); + goto client_failure; + } + } + eap_srpval_response(esp, id, SRPVAL_EBIT, + t_clientresponse(tc)); + break; + + case EAPSRP_SVALIDATOR: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { + ppp_warn("EAP: peer sent Subtype 3 without 1/2"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + /* + * If we're already open, then this ought to be a + * duplicate. Otherwise, check that the server is + * who we think it is. + */ + if (pcb->eap.es_client.ea_state == eapOpen) { + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 3 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + len -= sizeof (u32_t) + SHA_DIGESTSIZE; + if (len < 0 || t_clientverify(tc, inp + + sizeof (u32_t)) != 0) { + ppp_error("EAP: SRP server verification " + "failed"); + goto client_failure; + } + GETLONG(pcb->eap.es_client.ea_keyflags, inp); + /* Save pseudonym if user wants it. */ + if (len > 0 && pcb->eap.es_usepseudo) { + INCPTR(SHA_DIGESTSIZE, inp); + write_pseudonym(esp, inp, len, id); + } + } + /* + * We've verified our peer. We're now mostly done, + * except for waiting on the regular EAP Success + * message. + */ + eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); + break; + + case EAPSRP_LWRECHALLENGE: + if (len < 4) { + ppp_warn("EAP: malformed Lightweight rechallenge"); + return; + } + SHA1Init(&ctxt); + vals[0] = id; + SHA1Update(&ctxt, vals, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, inp, len); + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + SHA1Final(dig, &ctxt); + eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, + SHA_DIGESTSIZE); + break; + + default: + ppp_error("EAP: unknown SRP Subtype %d", vallen); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + break; +#endif /* USE_SRP */ + + default: + ppp_info("EAP: unknown authentication type %d; Naking", typenum); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); + } + return; + +#ifdef USE_SRP +client_failure: + pcb->eap.es_client.ea_state = eapBadAuth; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, (void *)esp); + } + pcb->eap.es_client.ea_session = NULL; + t_clientclose(tc); + auth_withpeer_fail(pcb, PPP_EAP); +#endif /* USE_SRP */ +} + +#if PPP_SERVER +/* + * eap_response - Receive EAP Response message (server mode). + */ +static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; +#ifdef USE_SRP + struct t_server *ts; + struct t_num A; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; +#endif /* USE_SRP */ + + if (pcb->eap.es_server.ea_id != id) { + ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, + pcb->eap.es_server.ea_id); + return; + } + + pcb->eap.es_server.ea_responses++; + + if (len <= 0) { + ppp_error("EAP: empty Response message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (pcb->eap.es_server.ea_state != eapIdentify) { + ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, + inp); + break; + } + ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, inp, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_NOTIFICATION: + ppp_dbglog("EAP unexpected Notification; response discarded"); + break; + + case EAPT_NAK: + if (len < 1) { + ppp_info("EAP: Nak Response with no suggested protocol"); + eap_figure_next_state(pcb, 1); + break; + } + + GETCHAR(vallen, inp); + len--; + + if ( +#if PPP_REMOTENAME + !pcb->explicit_remote && +#endif /* PPP_REMOTENAME */ + pcb->eap.es_server.ea_state == eapIdentify){ + /* Peer cannot Nak Identify Request */ + eap_figure_next_state(pcb, 1); + break; + } + + switch (vallen) { + case EAPT_SRP: + /* Run through SRP validator selection again. */ + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_MD5CHAP: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + default: + ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); + switch (pcb->eap.es_server.ea_state) { + case eapSRP1: + case eapSRP2: + case eapSRP3: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + case eapMD5Chall: + case eapSRP4: + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + default: + break; + } + break; + } + break; + + case EAPT_MD5CHAP: + if (pcb->eap.es_server.ea_state != eapMD5Chall) { + ppp_error("EAP: unexpected MD5-Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < 1) { + ppp_error("EAP: received MD5-Response with no data"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen != 16 || vallen > len) { + ppp_error("EAP: MD5-Response with bad length %d", vallen); + eap_figure_next_state(pcb, 1); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } + +#if PPP_REMOTENAME + /* In case the remote doesn't give us his name. */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, remote_name, sizeof (rhostname)); +#endif /* PPP_REMOTENAME */ + + /* + * Get the secret for authenticating the specified + * host. + */ + if (!get_secret(pcb, rhostname, + pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { + ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); + eap_send_failure(pcb); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_type = EAPT_MD5CHAP; + eap_send_success(pcb); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); + break; + +#ifdef USE_SRP + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: empty SRP Response"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(typenum, inp); + len--; + switch (typenum) { + case EAPSRP_CKEY: + if (pcb->eap.es_server.ea_state != eapSRP1) { + ppp_error("EAP: unexpected SRP Subtype 1 Response"); + eap_figure_next_state(pcb, 1); + break; + } + A.data = inp; + A.len = len; + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); + if (pcb->eap.es_server.ea_skey == NULL) { + /* Client's A value is bogus; terminate now */ + ppp_error("EAP: bogus A value from client"); + eap_send_failure(pcb); + } else { + eap_figure_next_state(pcb, 0); + } + break; + + case EAPSRP_CVALIDATOR: + if (pcb->eap.es_server.ea_state != eapSRP2) { + ppp_error("EAP: unexpected SRP Subtype 2 Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { + ppp_error("EAP: M1 length %d < %d", len, + sizeof (u32_t) + SHA_DIGESTSIZE); + eap_figure_next_state(pcb, 1); + break; + } + GETLONG(pcb->eap.es_server.ea_keyflags, inp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + if (t_serververify(ts, inp)) { + ppp_info("EAP: unable to validate client identity"); + eap_send_failure(pcb); + break; + } + eap_figure_next_state(pcb, 0); + break; + + case EAPSRP_ACK: + if (pcb->eap.es_server.ea_state != eapSRP3) { + ppp_error("EAP: unexpected SRP Subtype 3 Response"); + eap_send_failure(esp); + break; + } + pcb->eap.es_server.ea_type = EAPT_SRP; + eap_send_success(pcb, esp); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, + pcb->eap.es_rechallenge); + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, pcb, + pcb->eap.es_lwrechallenge); + break; + + case EAPSRP_LWRECHALLENGE: + if (pcb->eap.es_server.ea_state != eapSRP4) { + ppp_info("EAP: unexpected SRP Subtype 4 Response"); + return; + } + if (len != SHA_DIGESTSIZE) { + ppp_error("EAP: bad Lightweight rechallenge " + "response"); + return; + } + SHA1Init(&ctxt); + vallen = id; + SHA1Update(&ctxt, &vallen, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + SHA1Final(dig, &ctxt); + if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { + ppp_error("EAP: failed Lightweight rechallenge"); + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_state = eapOpen; + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, esp, + pcb->eap.es_lwrechallenge); + break; + } + break; +#endif /* USE_SRP */ + + default: + /* This can't happen. */ + ppp_error("EAP: unknown Response type %d; ignored", typenum); + return; + } + + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + + if (pcb->eap.es_server.ea_state != eapBadAuth && + pcb->eap.es_server.ea_state != eapOpen) { + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); + } +} +#endif /* PPP_SERVER */ + +/* + * eap_success - Receive EAP Success message (client mode). + */ +static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) { + LWIP_UNUSED_ARG(id); + + if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected success message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + return; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapOpen; + auth_withpeer_success(pcb, PPP_EAP, 0); +} + +/* + * eap_failure - Receive EAP Failure message (client mode). + */ +static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) { + LWIP_UNUSED_ARG(id); + + if (!eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapBadAuth; + + ppp_error("EAP: peer reports authentication failure"); + auth_withpeer_fail(pcb, PPP_EAP); +} + +/* + * eap_input - Handle received EAP message. + */ +static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { + u_char code, id; + int len; + + /* + * Parse header (code, id and length). If packet too short, + * drop it. + */ + if (inlen < EAP_HEADERLEN) { + ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) { + ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, + EAP_HEADERLEN, inlen); + return; + } + len -= EAP_HEADERLEN; + + /* Dispatch based on message code */ + switch (code) { + case EAP_REQUEST: + eap_request(pcb, inp, id, len); + break; + +#if PPP_SERVER + case EAP_RESPONSE: + eap_response(pcb, inp, id, len); + break; +#endif /* PPP_SERVER */ + + case EAP_SUCCESS: + eap_success(pcb, inp, id, len); + break; + + case EAP_FAILURE: + eap_failure(pcb, inp, id, len); + break; + + default: /* XXX Need code reject */ + /* Note: it's not legal to send EAP Nak here. */ + ppp_warn("EAP: unknown code %d received", code); + break; + } +} + +#if PRINTPKT_SUPPORT +/* + * eap_printpkt - print the contents of an EAP packet. + */ +static const char* const eap_codenames[] = { + "Request", "Response", "Success", "Failure" +}; + +static const char* const eap_typenames[] = { + "Identity", "Notification", "Nak", "MD5-Challenge", + "OTP", "Generic-Token", NULL, NULL, + "RSA", "DSS", "KEA", "KEA-Validate", + "TLS", "Defender", "Windows 2000", "Arcot", + "Cisco", "Nokia", "SRP" +}; + +static int eap_printpkt(const u_char *inp, int inlen, void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len, rtype, vallen; + const u_char *pstart; + u32_t uval; + + if (inlen < EAP_HEADERLEN) + return (0); + pstart = inp; + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) + return (0); + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) + printer(arg, " %s", eap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= EAP_HEADERLEN; + switch (code) { + case EAP_REQUEST: + if (len < 1) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + case EAPT_NOTIFICATION: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_MD5CHAP: + if (len <= 0) + break; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 3) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CHALLENGE: + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + if (vallen > 0) { + printer(arg, " "); + } else { + printer(arg, " "); + } + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + if (vallen == 0) { + printer(arg, " "); + } else { + printer(arg, " ", vallen, inp); + } + INCPTR(vallen, inp); + len -= vallen; + if (len == 0) { + printer(arg, " "); + } else { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_SKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_SVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + printer(arg, " ", len, inp, + len < SHA_DIGESTSIZE ? "?" : ""); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_RESPONSE: + if (len < 1) + break; + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPT_NAK: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " (%s)", eap_typenames[rtype-1]); + printer(arg, ">"); + break; + + case EAPT_MD5CHAP: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 1) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_CVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_ACK: + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + INCPTR(vallen, inp); + len -= vallen; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_SUCCESS: /* No payload expected for these! */ + case EAP_FAILURE: + default: + break; + + truncated: + printer(arg, " "); + break; + } + + if (len > 8) + printer(arg, "%8B...", inp); + else if (len > 0) + printer(arg, "%.*B", len, inp); + INCPTR(len, inp); + + return (inp - pstart); +} +#endif /* PRINTPKT_SUPPORT */ + +#endif /* PPP_SUPPORT && EAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ecp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ecp.c new file mode 100644 index 0000000..4d84f60 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ecp.c @@ -0,0 +1,191 @@ +/* + * ecp.c - PPP Encryption Control Protocol. + * + * Copyright (c) 2002 Google, Inc. + * 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Derived from ccp.c, which is: + * + * Copyright (c) 1994-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/ecp.h" + +#if PPP_OPTIONS +static option_t ecp_option_list[] = { + { "noecp", o_bool, &ecp_protent.enabled_flag, + "Disable ECP negotiation" }, + { "-ecp", o_bool, &ecp_protent.enabled_flag, + "Disable ECP negotiation", OPT_ALIAS }, + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points from main code. + */ +static void ecp_init (int unit); +/* +static void ecp_open (int unit); +static void ecp_close (int unit, char *); +static void ecp_lowerup (int unit); +static void ecp_lowerdown (int); +static void ecp_input (int unit, u_char *pkt, int len); +static void ecp_protrej (int unit); +*/ +#if PRINTPKT_SUPPORT +static int ecp_printpkt (const u_char *pkt, int len, + void (*printer) (void *, char *, ...), + void *arg); +#endif /* PRINTPKT_SUPPORT */ +/* +static void ecp_datainput (int unit, u_char *pkt, int len); +*/ + +const struct protent ecp_protent = { + PPP_ECP, + ecp_init, + NULL, /* ecp_input, */ + NULL, /* ecp_protrej, */ + NULL, /* ecp_lowerup, */ + NULL, /* ecp_lowerdown, */ + NULL, /* ecp_open, */ + NULL, /* ecp_close, */ +#if PRINTPKT_SUPPORT + ecp_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, /* ecp_datainput, */ +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "ECP", + "Encrypted", +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + ecp_option_list, + NULL, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, + NULL +#endif /* DEMAND_SUPPORT */ +}; + +fsm ecp_fsm[NUM_PPP]; +ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ +ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ +ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ +ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ + +static const fsm_callbacks ecp_callbacks = { + NULL, /* ecp_resetci, */ + NULL, /* ecp_cilen, */ + NULL, /* ecp_addci, */ + NULL, /* ecp_ackci, */ + NULL, /* ecp_nakci, */ + NULL, /* ecp_rejci, */ + NULL, /* ecp_reqci, */ + NULL, /* ecp_up, */ + NULL, /* ecp_down, */ + NULL, + NULL, + NULL, + NULL, + NULL, /* ecp_extcode, */ + "ECP" +}; + +/* + * ecp_init - initialize ECP. + */ +static void +ecp_init(unit) + int unit; +{ + fsm *f = &ecp_fsm[unit]; + + f->unit = unit; + f->protocol = PPP_ECP; + f->callbacks = &ecp_callbacks; + fsm_init(f); + +#if 0 /* Not necessary, everything is cleared in ppp_new() */ + memset(&ecp_wantoptions[unit], 0, sizeof(ecp_options)); + memset(&ecp_gotoptions[unit], 0, sizeof(ecp_options)); + memset(&ecp_allowoptions[unit], 0, sizeof(ecp_options)); + memset(&ecp_hisoptions[unit], 0, sizeof(ecp_options)); +#endif /* 0 */ + +} + + +#if PRINTPKT_SUPPORT +static int +ecp_printpkt(p, plen, printer, arg) + const u_char *p; + int plen; + void (*printer) (void *, char *, ...); + void *arg; +{ + return 0; +} +#endif /* PRINTPKT_SUPPORT */ + +#endif /* PPP_SUPPORT && ECP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eui64.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eui64.c new file mode 100644 index 0000000..01493bc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/eui64.c @@ -0,0 +1,56 @@ +/* + * eui64.c - EUI64 routines for IPv6CP. + * + * Copyright (c) 1999 Tommi Komulainen. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Tommi Komulainen + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/eui64.h" + +/* + * eui64_ntoa - Make an ascii representation of an interface identifier + */ +char *eui64_ntoa(eui64_t e) { + static char buf[20]; + + sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", + e.e8[0], e.e8[1], e.e8[2], e.e8[3], + e.e8[4], e.e8[5], e.e8[6], e.e8[7]); + return buf; +} + +#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/fsm.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/fsm.c new file mode 100644 index 0000000..81eba11 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/fsm.c @@ -0,0 +1,799 @@ +/* + * fsm.c - {Link, IP} Control Protocol Finite State Machine. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +/* + * @todo: + * Randomize fsm id on link/init. + * Deal with variable outgoing MTU. + */ + +#if 0 /* UNUSED */ +#include +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" + +static void fsm_timeout (void *); +static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len); +static void fsm_rconfack(fsm *f, int id, u_char *inp, int len); +static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len); +static void fsm_rtermreq(fsm *f, int id, u_char *p, int len); +static void fsm_rtermack(fsm *f); +static void fsm_rcoderej(fsm *f, u_char *inp, int len); +static void fsm_sconfreq(fsm *f, int retransmit); + +#define PROTO_NAME(f) ((f)->callbacks->proto_name) + +/* + * fsm_init - Initialize fsm. + * + * Initialize fsm state. + */ +void fsm_init(fsm *f) { + ppp_pcb *pcb = f->pcb; + f->state = PPP_FSM_INITIAL; + f->flags = 0; + f->id = 0; /* XXX Start with random id? */ + f->maxnakloops = pcb->settings.fsm_max_nak_loops; + f->term_reason_len = 0; +} + + +/* + * fsm_lowerup - The lower layer is up. + */ +void fsm_lowerup(fsm *f) { + switch( f->state ){ + case PPP_FSM_INITIAL: + f->state = PPP_FSM_CLOSED; + break; + + case PPP_FSM_STARTING: + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; + + default: + FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ + } +} + + +/* + * fsm_lowerdown - The lower layer is down. + * + * Cancel all timeouts and inform upper layers. + */ +void fsm_lowerdown(fsm *f) { + switch( f->state ){ + case PPP_FSM_CLOSED: + f->state = PPP_FSM_INITIAL; + break; + + case PPP_FSM_STOPPED: + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; + + case PPP_FSM_CLOSING: + f->state = PPP_FSM_INITIAL; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; + + case PPP_FSM_STOPPING: + case PPP_FSM_REQSENT: + case PPP_FSM_ACKRCVD: + case PPP_FSM_ACKSENT: + f->state = PPP_FSM_STARTING; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; + + case PPP_FSM_OPENED: + if( f->callbacks->down ) + (*f->callbacks->down)(f); + f->state = PPP_FSM_STARTING; + break; + + default: + FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ + } +} + + +/* + * fsm_open - Link is allowed to come up. + */ +void fsm_open(fsm *f) { + switch( f->state ){ + case PPP_FSM_INITIAL: + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; + + case PPP_FSM_CLOSED: + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; + + case PPP_FSM_CLOSING: + f->state = PPP_FSM_STOPPING; + /* fall through */ + /* no break */ + case PPP_FSM_STOPPED: + case PPP_FSM_OPENED: + if( f->flags & OPT_RESTART ){ + fsm_lowerdown(f); + fsm_lowerup(f); + } + break; + default: + break; + } +} + +/* + * terminate_layer - Start process of shutting down the FSM + * + * Cancel any timeout running, notify upper layers we're done, and + * send a terminate-request message as configured. + */ +static void terminate_layer(fsm *f, int nextstate) { + ppp_pcb *pcb = f->pcb; + + if( f->state != PPP_FSM_OPENED ) + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + else if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers we're down */ + + /* Init restart counter and send Terminate-Request */ + f->retransmits = pcb->settings.fsm_max_term_transmits; + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + + if (f->retransmits == 0) { + /* + * User asked for no terminate requests at all; just close it. + * We've already fired off one Terminate-Request just to be nice + * to the peer, but we're not going to wait for a reply. + */ + f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + return; + } + + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + + f->state = nextstate; +} + +/* + * fsm_close - Start closing connection. + * + * Cancel timeouts and either initiate close or possibly go directly to + * the PPP_FSM_CLOSED state. + */ +void fsm_close(fsm *f, const char *reason) { + f->term_reason = reason; + f->term_reason_len = (reason == NULL? 0: LWIP_MIN(strlen(reason), 0xFF) ); + switch( f->state ){ + case PPP_FSM_STARTING: + f->state = PPP_FSM_INITIAL; + break; + case PPP_FSM_STOPPED: + f->state = PPP_FSM_CLOSED; + break; + case PPP_FSM_STOPPING: + f->state = PPP_FSM_CLOSING; + break; + + case PPP_FSM_REQSENT: + case PPP_FSM_ACKRCVD: + case PPP_FSM_ACKSENT: + case PPP_FSM_OPENED: + terminate_layer(f, PPP_FSM_CLOSING); + break; + default: + break; + } +} + + +/* + * fsm_timeout - Timeout expired. + */ +static void fsm_timeout(void *arg) { + fsm *f = (fsm *) arg; + ppp_pcb *pcb = f->pcb; + + switch (f->state) { + case PPP_FSM_CLOSING: + case PPP_FSM_STOPPING: + if( f->retransmits <= 0 ){ + /* + * We've waited for an ack long enough. Peer probably heard us. + */ + f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } else { + /* Send Terminate-Request */ + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + } + break; + + case PPP_FSM_REQSENT: + case PPP_FSM_ACKRCVD: + case PPP_FSM_ACKSENT: + if (f->retransmits <= 0) { + ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); + f->state = PPP_FSM_STOPPED; + if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) + (*f->callbacks->finished)(f); + + } else { + /* Retransmit the configure-request */ + if (f->callbacks->retransmit) + (*f->callbacks->retransmit)(f); + fsm_sconfreq(f, 1); /* Re-send Configure-Request */ + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; + } + break; + + default: + FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ + } +} + + +/* + * fsm_input - Input packet. + */ +void fsm_input(fsm *f, u_char *inpacket, int l) { + u_char *inp; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). + * If packet too short, drop it. + */ + inp = inpacket; + if (l < HEADERLEN) { + FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < HEADERLEN) { + FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); + return; + } + if (len > l) { + FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); + return; + } + len -= HEADERLEN; /* subtract header length */ + + if( f->state == PPP_FSM_INITIAL || f->state == PPP_FSM_STARTING ){ + FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", + f->protocol, f->state)); + return; + } + + /* + * Action depends on code. + */ + switch (code) { + case CONFREQ: + fsm_rconfreq(f, id, inp, len); + break; + + case CONFACK: + fsm_rconfack(f, id, inp, len); + break; + + case CONFNAK: + case CONFREJ: + fsm_rconfnakrej(f, code, id, inp, len); + break; + + case TERMREQ: + fsm_rtermreq(f, id, inp, len); + break; + + case TERMACK: + fsm_rtermack(f); + break; + + case CODEREJ: + fsm_rcoderej(f, inp, len); + break; + + default: + if( !f->callbacks->extcode + || !(*f->callbacks->extcode)(f, code, id, inp, len) ) + fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); + break; + } +} + + +/* + * fsm_rconfreq - Receive Configure-Request. + */ +static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { + int code, reject_if_disagree; + + switch( f->state ){ + case PPP_FSM_CLOSED: + /* Go away, we're closed */ + fsm_sdata(f, TERMACK, id, NULL, 0); + return; + case PPP_FSM_CLOSING: + case PPP_FSM_STOPPING: + return; + + case PPP_FSM_OPENED: + /* Go down and restart negotiation */ + if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; + + case PPP_FSM_STOPPED: + /* Negotiation started by our peer */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; + default: + break; + } + + /* + * Pass the requested configuration options + * to protocol-specific code for checking. + */ + if (f->callbacks->reqci){ /* Check CI */ + reject_if_disagree = (f->nakloops >= f->maxnakloops); + code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); + } else if (len) + code = CONFREJ; /* Reject all CI */ + else + code = CONFACK; + + /* send the Ack, Nak or Rej to the peer */ + fsm_sdata(f, code, id, inp, len); + + if (code == CONFACK) { + if (f->state == PPP_FSM_ACKRCVD) { + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + } else + f->state = PPP_FSM_ACKSENT; + f->nakloops = 0; + + } else { + /* we sent CONFACK or CONFREJ */ + if (f->state != PPP_FSM_ACKRCVD) + f->state = PPP_FSM_REQSENT; + if( code == CONFNAK ) + ++f->nakloops; + } +} + + +/* + * fsm_rconfack - Receive Configure-Ack. + */ +static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { + ppp_pcb *pcb = f->pcb; + + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ + if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): + (len == 0)) ){ + /* Ack is bad - ignore it */ + ppp_error("Received bad configure-ack: %P", inp, len); + return; + } + f->seen_ack = 1; + f->rnakloops = 0; + + switch (f->state) { + case PPP_FSM_CLOSED: + case PPP_FSM_STOPPED: + fsm_sdata(f, TERMACK, id, NULL, 0); + break; + + case PPP_FSM_REQSENT: + f->state = PPP_FSM_ACKRCVD; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + break; + + case PPP_FSM_ACKRCVD: + /* Huh? an extra valid Ack? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; + + case PPP_FSM_ACKSENT: + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + break; + + case PPP_FSM_OPENED: + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; + default: + break; + } +} + + +/* + * fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. + */ +static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { + int ret; + int treat_as_reject; + + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ + + if (code == CONFNAK) { + ++f->rnakloops; + treat_as_reject = (f->rnakloops >= f->maxnakloops); + if (f->callbacks->nakci == NULL + || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { + ppp_error("Received bad configure-nak: %P", inp, len); + return; + } + } else { + f->rnakloops = 0; + if (f->callbacks->rejci == NULL + || !(ret = f->callbacks->rejci(f, inp, len))) { + ppp_error("Received bad configure-rej: %P", inp, len); + return; + } + } + + f->seen_ack = 1; + + switch (f->state) { + case PPP_FSM_CLOSED: + case PPP_FSM_STOPPED: + fsm_sdata(f, TERMACK, id, NULL, 0); + break; + + case PPP_FSM_REQSENT: + case PPP_FSM_ACKSENT: + /* They didn't agree to what we wanted - try another request */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + if (ret < 0) + f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ + else + fsm_sconfreq(f, 0); /* Send Configure-Request */ + break; + + case PPP_FSM_ACKRCVD: + /* Got a Nak/reject when we had already had an Ack?? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; + + case PPP_FSM_OPENED: + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; + default: + break; + } +} + + +/* + * fsm_rtermreq - Receive Terminate-Req. + */ +static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + + switch (f->state) { + case PPP_FSM_ACKRCVD: + case PPP_FSM_ACKSENT: + f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ + break; + + case PPP_FSM_OPENED: + if (len > 0) { + ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); + } else + ppp_info("%s terminated by peer", PROTO_NAME(f)); + f->retransmits = 0; + f->state = PPP_FSM_STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + break; + default: + break; + } + + fsm_sdata(f, TERMACK, id, NULL, 0); +} + + +/* + * fsm_rtermack - Receive Terminate-Ack. + */ +static void fsm_rtermack(fsm *f) { + switch (f->state) { + case PPP_FSM_CLOSING: + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; + case PPP_FSM_STOPPING: + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; + + case PPP_FSM_ACKRCVD: + f->state = PPP_FSM_REQSENT; + break; + + case PPP_FSM_OPENED: + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; + default: + break; + } +} + + +/* + * fsm_rcoderej - Receive an Code-Reject. + */ +static void fsm_rcoderej(fsm *f, u_char *inp, int len) { + u_char code, id; + + if (len < HEADERLEN) { + FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + ppp_warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); + + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; +} + + +/* + * fsm_protreject - Peer doesn't speak this protocol. + * + * Treat this as a catastrophic error (RXJ-). + */ +void fsm_protreject(fsm *f) { + switch( f->state ){ + case PPP_FSM_CLOSING: + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ + case PPP_FSM_CLOSED: + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; + + case PPP_FSM_STOPPING: + case PPP_FSM_REQSENT: + case PPP_FSM_ACKRCVD: + case PPP_FSM_ACKSENT: + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ + case PPP_FSM_STOPPED: + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; + + case PPP_FSM_OPENED: + terminate_layer(f, PPP_FSM_STOPPING); + break; + + default: + FSMDEBUG(("%s: Protocol-reject event in state %d!", + PROTO_NAME(f), f->state)); + /* no break */ + } +} + + +/* + * fsm_sconfreq - Send a Configure-Request. + */ +static void fsm_sconfreq(fsm *f, int retransmit) { + ppp_pcb *pcb = f->pcb; + struct pbuf *p; + u_char *outp; + int cilen; + + if( f->state != PPP_FSM_REQSENT && f->state != PPP_FSM_ACKRCVD && f->state != PPP_FSM_ACKSENT ){ + /* Not currently negotiating - reset options */ + if( f->callbacks->resetci ) + (*f->callbacks->resetci)(f); + f->nakloops = 0; + f->rnakloops = 0; + } + + if( !retransmit ){ + /* New request - reset retransmission counter, use new ID */ + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + f->reqid = ++f->id; + } + + f->seen_ack = 0; + + /* + * Make up the request packet + */ + if( f->callbacks->cilen && f->callbacks->addci ){ + cilen = (*f->callbacks->cilen)(f); + if( cilen > pcb->peer_mru - HEADERLEN ) + cilen = pcb->peer_mru - HEADERLEN; + } else + cilen = 0; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + /* send the request to our peer */ + outp = (u_char*)p->payload; + MAKEHEADER(outp, f->protocol); + PUTCHAR(CONFREQ, outp); + PUTCHAR(f->reqid, outp); + PUTSHORT(cilen + HEADERLEN, outp); + if (cilen != 0) { + (*f->callbacks->addci)(f, outp, &cilen); + LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); + } + + ppp_write(pcb, p); + + /* start the retransmit timer */ + --f->retransmits; + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); +} + + +/* + * fsm_sdata - Send some data. + * + * Used for all packets sent to our peer by this module. + */ +void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) { + ppp_pcb *pcb = f->pcb; + struct pbuf *p; + u_char *outp; + int outlen; + + /* Adjust length to be smaller than MTU */ + if (datalen > pcb->peer_mru - HEADERLEN) + datalen = pcb->peer_mru - HEADERLEN; + outlen = datalen + HEADERLEN; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + if (datalen) /* && data != outp + PPP_HDRLEN + HEADERLEN) -- was only for fsm_sconfreq() */ + MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); + MAKEHEADER(outp, f->protocol); + PUTCHAR(code, outp); + PUTCHAR(id, outp); + PUTSHORT(outlen, outp); + ppp_write(pcb, p); +} + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipcp.c new file mode 100644 index 0000000..b7c766e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipcp.c @@ -0,0 +1,2418 @@ +/* + * ipcp.c - PPP IP Control Protocol. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +/* + * @todo: + */ + +#if 0 /* UNUSED */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/ipcp.h" + +#if 0 /* UNUSED */ +/* global vars */ +u32_t netmask = 0; /* IP netmask to set on interface */ +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ +#endif /* UNUSED */ + +#if 0 /* moved to ppp_settings */ +bool noremoteip = 0; /* Let him have no IP address */ +#endif /* moved to ppp_setting */ + +#if 0 /* UNUSED */ +/* Hook for a plugin to know when IP protocol has come up */ +void (*ip_up_hook) (void) = NULL; + +/* Hook for a plugin to know when IP protocol has come down */ +void (*ip_down_hook) (void) = NULL; + +/* Hook for a plugin to choose the remote IP address */ +void (*ip_choose_hook) (u32_t *) = NULL; +#endif /* UNUSED */ + +#if PPP_NOTIFY +/* Notifiers for when IPCP goes up and down */ +struct notifier *ip_up_notifier = NULL; +struct notifier *ip_down_notifier = NULL; +#endif /* PPP_NOTIFY */ + +/* local vars */ +#if 0 /* moved to ppp_pcb */ +static int default_route_set[NUM_PPP]; /* Have set up a default route */ +static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ +static int ipcp_is_up; /* have called np_up() */ +static int ipcp_is_open; /* haven't called np_finished() */ +static bool ask_for_local; /* request our address from peer */ +#endif /* moved to ppp_pcb */ +#if 0 /* UNUSED */ +static char vj_value[8]; /* string form of vj option value */ +static char netmask_str[20]; /* string form of netmask value */ +#endif /* UNUSED */ + +/* + * Callbacks for fsm code. (CI = Configuration Information) + */ +static void ipcp_resetci(fsm *f); /* Reset our CI */ +static int ipcp_cilen(fsm *f); /* Return length of our CI */ +static void ipcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ +static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject);/* Peer nak'd our CI */ +static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ +static void ipcp_up(fsm *f); /* We're UP */ +static void ipcp_down(fsm *f); /* We're DOWN */ +static void ipcp_finished(fsm *f); /* Don't need lower layer */ + +static const fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ + ipcp_resetci, /* Reset our Configuration Information */ + ipcp_cilen, /* Length of our Configuration Information */ + ipcp_addci, /* Add our Configuration Information */ + ipcp_ackci, /* ACK our Configuration Information */ + ipcp_nakci, /* NAK our Configuration Information */ + ipcp_rejci, /* Reject our Configuration Information */ + ipcp_reqci, /* Request peer's Configuration Information */ + ipcp_up, /* Called when fsm reaches OPENED state */ + ipcp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPCP" /* String name of protocol */ +}; + +/* + * Command-line options. + */ +#if PPP_OPTIONS +static int setvjslots (char **); +static int setdnsaddr (char **); +static int setwinsaddr (char **); +static int setnetmask (char **); +int setipaddr (char *, char **, int); + +static void printipaddr (option_t *, void (*)(void *, char *,...),void *); + +static option_t ipcp_option_list[] = { + { "noip", o_bool, &ipcp_protent.enabled_flag, + "Disable IP and IPCP" }, + { "-ip", o_bool, &ipcp_protent.enabled_flag, + "Disable IP and IPCP", OPT_ALIAS }, + + { "novj", o_bool, &ipcp_wantoptions[0].neg_vj, + "Disable VJ compression", OPT_A2CLR, &ipcp_allowoptions[0].neg_vj }, + { "-vj", o_bool, &ipcp_wantoptions[0].neg_vj, + "Disable VJ compression", OPT_ALIAS | OPT_A2CLR, + &ipcp_allowoptions[0].neg_vj }, + + { "novjccomp", o_bool, &ipcp_wantoptions[0].cflag, + "Disable VJ connection-ID compression", OPT_A2CLR, + &ipcp_allowoptions[0].cflag }, + { "-vjccomp", o_bool, &ipcp_wantoptions[0].cflag, + "Disable VJ connection-ID compression", OPT_ALIAS | OPT_A2CLR, + &ipcp_allowoptions[0].cflag }, + + { "vj-max-slots", o_special, (void *)setvjslots, + "Set maximum VJ header slots", + OPT_PRIO | OPT_A2STRVAL | OPT_STATIC, vj_value }, + + { "ipcp-accept-local", o_bool, &ipcp_wantoptions[0].accept_local, + "Accept peer's address for us", 1 }, + { "ipcp-accept-remote", o_bool, &ipcp_wantoptions[0].accept_remote, + "Accept peer's address for it", 1 }, + + { "ipparam", o_string, &ipparam, + "Set ip script parameter", OPT_PRIO }, + + { "noipdefault", o_bool, &disable_defaultip, + "Don't use name for default IP adrs", 1 }, + + { "ms-dns", 1, (void *)setdnsaddr, + "DNS address for the peer's use" }, + { "ms-wins", 1, (void *)setwinsaddr, + "Nameserver for SMB over TCP/IP for peer" }, + + { "ipcp-restart", o_int, &ipcp_fsm[0].timeouttime, + "Set timeout for IPCP", OPT_PRIO }, + { "ipcp-max-terminate", o_int, &ipcp_fsm[0].maxtermtransmits, + "Set max #xmits for term-reqs", OPT_PRIO }, + { "ipcp-max-configure", o_int, &ipcp_fsm[0].maxconfreqtransmits, + "Set max #xmits for conf-reqs", OPT_PRIO }, + { "ipcp-max-failure", o_int, &ipcp_fsm[0].maxnakloops, + "Set max #conf-naks for IPCP", OPT_PRIO }, + + { "defaultroute", o_bool, &ipcp_wantoptions[0].default_route, + "Add default route", OPT_ENABLE|1, &ipcp_allowoptions[0].default_route }, + { "nodefaultroute", o_bool, &ipcp_allowoptions[0].default_route, + "disable defaultroute option", OPT_A2CLR, + &ipcp_wantoptions[0].default_route }, + { "-defaultroute", o_bool, &ipcp_allowoptions[0].default_route, + "disable defaultroute option", OPT_ALIAS | OPT_A2CLR, + &ipcp_wantoptions[0].default_route }, + + { "replacedefaultroute", o_bool, + &ipcp_wantoptions[0].replace_default_route, + "Replace default route", 1 + }, + { "noreplacedefaultroute", o_bool, + &ipcp_allowoptions[0].replace_default_route, + "Never replace default route", OPT_A2COPY, + &ipcp_wantoptions[0].replace_default_route }, + { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, + "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, + { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, + "disable proxyarp option", OPT_A2CLR, + &ipcp_wantoptions[0].proxy_arp }, + { "-proxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, + "disable proxyarp option", OPT_ALIAS | OPT_A2CLR, + &ipcp_wantoptions[0].proxy_arp }, + + { "usepeerdns", o_bool, &usepeerdns, + "Ask peer for DNS address(es)", 1 }, + + { "netmask", o_special, (void *)setnetmask, + "set netmask", OPT_PRIO | OPT_A2STRVAL | OPT_STATIC, netmask_str }, + + { "ipcp-no-addresses", o_bool, &ipcp_wantoptions[0].old_addrs, + "Disable old-style IP-Addresses usage", OPT_A2CLR, + &ipcp_allowoptions[0].old_addrs }, + { "ipcp-no-address", o_bool, &ipcp_wantoptions[0].neg_addr, + "Disable IP-Address usage", OPT_A2CLR, + &ipcp_allowoptions[0].neg_addr }, + + { "noremoteip", o_bool, &noremoteip, + "Allow peer to have no IP address", 1 }, + + { "nosendip", o_bool, &ipcp_wantoptions[0].neg_addr, + "Don't send our IP address to peer", OPT_A2CLR, + &ipcp_wantoptions[0].old_addrs}, + + { "IP addresses", o_wild, (void *) &setipaddr, + "set local and remote IP addresses", + OPT_NOARG | OPT_A2PRINTER, (void *) &printipaddr }, + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points from main code. + */ +static void ipcp_init(ppp_pcb *pcb); +static void ipcp_open(ppp_pcb *pcb); +static void ipcp_close(ppp_pcb *pcb, const char *reason); +static void ipcp_lowerup(ppp_pcb *pcb); +static void ipcp_lowerdown(ppp_pcb *pcb); +static void ipcp_input(ppp_pcb *pcb, u_char *p, int len); +static void ipcp_protrej(ppp_pcb *pcb); +#if PRINTPKT_SUPPORT +static int ipcp_printpkt(const u_char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS +static void ip_check_options (void); +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT +static int ip_demand_conf (int); +static int ip_active_pkt (u_char *, int); +#endif /* DEMAND_SUPPORT */ +#if 0 /* UNUSED */ +static void create_resolv (u32_t, u32_t); +#endif /* UNUSED */ + +const struct protent ipcp_protent = { + PPP_IPCP, + ipcp_init, + ipcp_input, + ipcp_protrej, + ipcp_lowerup, + ipcp_lowerdown, + ipcp_open, + ipcp_close, +#if PRINTPKT_SUPPORT + ipcp_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "IPCP", + "IP", +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + ipcp_option_list, + ip_check_options, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + ip_demand_conf, + ip_active_pkt +#endif /* DEMAND_SUPPORT */ +}; + +static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t replacedefaultroute); + +/* + * Lengths of configuration options. + */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ +#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ +#define CILEN_ADDR 6 /* new-style single address option */ +#define CILEN_ADDRS 10 /* old-style dual address option */ + + +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") + +#if 0 /* UNUSED, already defined by lwIP */ +/* + * Make a string representation of a network IP address. + */ +char * +ip_ntoa(ipaddr) +u32_t ipaddr; +{ + static char b[64]; + + slprintf(b, sizeof(b), "%I", ipaddr); + return b; +} +#endif /* UNUSED, already defined by lwIP */ + +/* + * Option parsing. + */ +#if PPP_OPTIONS +/* + * setvjslots - set maximum number of connection slots for VJ compression + */ +static int +setvjslots(argv) + char **argv; +{ + int value; + + if (!int_option(*argv, &value)) + return 0; + + if (value < 2 || value > 16) { + option_error("vj-max-slots value must be between 2 and 16"); + return 0; + } + ipcp_wantoptions [0].maxslotindex = + ipcp_allowoptions[0].maxslotindex = value - 1; + slprintf(vj_value, sizeof(vj_value), "%d", value); + return 1; +} + +/* + * setdnsaddr - set the dns address(es) + */ +static int +setdnsaddr(argv) + char **argv; +{ + u32_t dns; + struct hostent *hp; + + dns = inet_addr(*argv); + if (dns == (u32_t) -1) { + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-dns option", + *argv); + return 0; + } + dns = *(u32_t *)hp->h_addr; + } + + /* We take the last 2 values given, the 2nd-last as the primary + and the last as the secondary. If only one is given it + becomes both primary and secondary. */ + if (ipcp_allowoptions[0].dnsaddr[1] == 0) + ipcp_allowoptions[0].dnsaddr[0] = dns; + else + ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; + + /* always set the secondary address value. */ + ipcp_allowoptions[0].dnsaddr[1] = dns; + + return (1); +} + +/* + * setwinsaddr - set the wins address(es) + * This is primrarly used with the Samba package under UNIX or for pointing + * the caller to the existing WINS server on a Windows NT platform. + */ +static int +setwinsaddr(argv) + char **argv; +{ + u32_t wins; + struct hostent *hp; + + wins = inet_addr(*argv); + if (wins == (u32_t) -1) { + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-wins option", + *argv); + return 0; + } + wins = *(u32_t *)hp->h_addr; + } + + /* We take the last 2 values given, the 2nd-last as the primary + and the last as the secondary. If only one is given it + becomes both primary and secondary. */ + if (ipcp_allowoptions[0].winsaddr[1] == 0) + ipcp_allowoptions[0].winsaddr[0] = wins; + else + ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; + + /* always set the secondary address value. */ + ipcp_allowoptions[0].winsaddr[1] = wins; + + return (1); +} + +/* + * setipaddr - Set the IP address + * If doit is 0, the call is to check whether this option is + * potentially an IP address specification. + * Not static so that plugins can call it to set the addresses + */ +int +setipaddr(arg, argv, doit) + char *arg; + char **argv; + int doit; +{ + struct hostent *hp; + char *colon; + u32_t local, remote; + ipcp_options *wo = &ipcp_wantoptions[0]; + static int prio_local = 0, prio_remote = 0; + + /* + * IP address pair separated by ":". + */ + if ((colon = strchr(arg, ':')) == NULL) + return 0; + if (!doit) + return 1; + + /* + * If colon first character, then no local addr. + */ + if (colon != arg && option_priority >= prio_local) { + *colon = '\0'; + if ((local = inet_addr(arg)) == (u32_t) -1) { + if ((hp = gethostbyname(arg)) == NULL) { + option_error("unknown host: %s", arg); + return 0; + } + local = *(u32_t *)hp->h_addr; + } + if (bad_ip_adrs(local)) { + option_error("bad local IP address %s", ip_ntoa(local)); + return 0; + } + if (local != 0) + wo->ouraddr = local; + *colon = ':'; + prio_local = option_priority; + } + + /* + * If colon last character, then no remote addr. + */ + if (*++colon != '\0' && option_priority >= prio_remote) { + if ((remote = inet_addr(colon)) == (u32_t) -1) { + if ((hp = gethostbyname(colon)) == NULL) { + option_error("unknown host: %s", colon); + return 0; + } + remote = *(u32_t *)hp->h_addr; + if (remote_name[0] == 0) + strlcpy(remote_name, colon, sizeof(remote_name)); + } + if (bad_ip_adrs(remote)) { + option_error("bad remote IP address %s", ip_ntoa(remote)); + return 0; + } + if (remote != 0) + wo->hisaddr = remote; + prio_remote = option_priority; + } + + return 1; +} + +static void +printipaddr(opt, printer, arg) + option_t *opt; + void (*printer) (void *, char *, ...); + void *arg; +{ + ipcp_options *wo = &ipcp_wantoptions[0]; + + if (wo->ouraddr != 0) + printer(arg, "%I", wo->ouraddr); + printer(arg, ":"); + if (wo->hisaddr != 0) + printer(arg, "%I", wo->hisaddr); +} + +/* + * setnetmask - set the netmask to be used on the interface. + */ +static int +setnetmask(argv) + char **argv; +{ + u32_t mask; + int n; + char *p; + + /* + * Unfortunately, if we use inet_addr, we can't tell whether + * a result of all 1s is an error or a valid 255.255.255.255. + */ + p = *argv; + n = parse_dotted_ip(p, &mask); + + mask = lwip_htonl(mask); + + if (n == 0 || p[n] != 0 || (netmask & ~mask) != 0) { + option_error("invalid netmask value '%s'", *argv); + return 0; + } + + netmask = mask; + slprintf(netmask_str, sizeof(netmask_str), "%I", mask); + + return (1); +} + +int +parse_dotted_ip(p, vp) + char *p; + u32_t *vp; +{ + int n; + u32_t v, b; + char *endp, *p0 = p; + + v = 0; + for (n = 3;; --n) { + b = strtoul(p, &endp, 0); + if (endp == p) + return 0; + if (b > 255) { + if (n < 3) + return 0; + /* accept e.g. 0xffffff00 */ + *vp = b; + return endp - p0; + } + v |= b << (n * 8); + p = endp; + if (n == 0) + break; + if (*p != '.') + return 0; + ++p; + } + *vp = v; + return p - p0; +} +#endif /* PPP_OPTIONS */ + +/* + * ipcp_init - Initialize IPCP. + */ +static void ipcp_init(ppp_pcb *pcb) { + fsm *f = &pcb->ipcp_fsm; + + ipcp_options *wo = &pcb->ipcp_wantoptions; + ipcp_options *ao = &pcb->ipcp_allowoptions; + + f->pcb = pcb; + f->protocol = PPP_IPCP; + f->callbacks = &ipcp_callbacks; + fsm_init(f); + + /* + * Some 3G modems use repeated IPCP NAKs as a way of stalling + * until they can contact a server on the network, so we increase + * the default number of NAKs we accept before we start treating + * them as rejects. + */ + f->maxnakloops = 100; + +#if 0 /* Not necessary, everything is cleared in ppp_new() */ + memset(wo, 0, sizeof(*wo)); + memset(ao, 0, sizeof(*ao)); +#endif /* 0 */ + + wo->neg_addr = wo->old_addrs = 1; +#if VJ_SUPPORT + wo->neg_vj = 1; + wo->vj_protocol = IPCP_VJ_COMP; + wo->maxslotindex = MAX_STATES - 1; /* really max index */ + wo->cflag = 1; +#endif /* VJ_SUPPORT */ + +#if 0 /* UNUSED */ + /* wanting default route by default */ + wo->default_route = 1; +#endif /* UNUSED */ + + ao->neg_addr = ao->old_addrs = 1; +#if VJ_SUPPORT + /* max slots and slot-id compression are currently hardwired in */ + /* ppp_if.c to 16 and 1, this needs to be changed (among other */ + /* things) gmc */ + + ao->neg_vj = 1; + ao->maxslotindex = MAX_STATES - 1; + ao->cflag = 1; +#endif /* #if VJ_SUPPORT */ + +#if 0 /* UNUSED */ + /* + * XXX These control whether the user may use the proxyarp + * and defaultroute options. + */ + ao->proxy_arp = 1; + ao->default_route = 1; +#endif /* UNUSED */ +} + + +/* + * ipcp_open - IPCP is allowed to come up. + */ +static void ipcp_open(ppp_pcb *pcb) { + fsm *f = &pcb->ipcp_fsm; + fsm_open(f); + pcb->ipcp_is_open = 1; +} + + +/* + * ipcp_close - Take IPCP down. + */ +static void ipcp_close(ppp_pcb *pcb, const char *reason) { + fsm *f = &pcb->ipcp_fsm; + fsm_close(f, reason); +} + + +/* + * ipcp_lowerup - The lower layer is up. + */ +static void ipcp_lowerup(ppp_pcb *pcb) { + fsm *f = &pcb->ipcp_fsm; + fsm_lowerup(f); +} + + +/* + * ipcp_lowerdown - The lower layer is down. + */ +static void ipcp_lowerdown(ppp_pcb *pcb) { + fsm *f = &pcb->ipcp_fsm; + fsm_lowerdown(f); +} + + +/* + * ipcp_input - Input IPCP packet. + */ +static void ipcp_input(ppp_pcb *pcb, u_char *p, int len) { + fsm *f = &pcb->ipcp_fsm; + fsm_input(f, p, len); +} + + +/* + * ipcp_protrej - A Protocol-Reject was received for IPCP. + * + * Pretend the lower layer went down, so we shut up. + */ +static void ipcp_protrej(ppp_pcb *pcb) { + fsm *f = &pcb->ipcp_fsm; + fsm_lowerdown(f); +} + + +/* + * ipcp_resetci - Reset our CI. + * Called by fsm_sconfreq, Send Configure Request. + */ +static void ipcp_resetci(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipcp_options *wo = &pcb->ipcp_wantoptions; + ipcp_options *go = &pcb->ipcp_gotoptions; + ipcp_options *ao = &pcb->ipcp_allowoptions; + + wo->req_addr = (wo->neg_addr || wo->old_addrs) && + (ao->neg_addr || ao->old_addrs); + if (wo->ouraddr == 0) + wo->accept_local = 1; + if (wo->hisaddr == 0) + wo->accept_remote = 1; +#if LWIP_DNS + wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ +#endif /* LWIP_DNS */ + *go = *wo; + if (!pcb->ask_for_local) + go->ouraddr = 0; +#if 0 /* UNUSED */ + if (ip_choose_hook) { + ip_choose_hook(&wo->hisaddr); + if (wo->hisaddr) { + wo->accept_remote = 0; + } + } +#endif /* UNUSED */ + BZERO(&pcb->ipcp_hisoptions, sizeof(ipcp_options)); +} + + +/* + * ipcp_cilen - Return length of our CI. + * Called by fsm_sconfreq, Send Configure Request. + */ +static int ipcp_cilen(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipcp_options *go = &pcb->ipcp_gotoptions; +#if VJ_SUPPORT + ipcp_options *wo = &pcb->ipcp_wantoptions; +#endif /* VJ_SUPPORT */ + ipcp_options *ho = &pcb->ipcp_hisoptions; + +#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) +#if VJ_SUPPORT +#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) +#endif /* VJ_SUPPORT */ +#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) +#if LWIP_DNS +#define LENCIDNS(neg) LENCIADDR(neg) +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ +#define LENCIWINS(neg) LENCIADDR(neg) +#endif /* UNUSED - WINS */ + + /* + * First see if we want to change our options to the old + * forms because we have received old forms from the peer. + */ + if (go->neg_addr && go->old_addrs && !ho->neg_addr && ho->old_addrs) + go->neg_addr = 0; + +#if VJ_SUPPORT + if (wo->neg_vj && !go->neg_vj && !go->old_vj) { + /* try an older style of VJ negotiation */ + /* use the old style only if the peer did */ + if (ho->neg_vj && ho->old_vj) { + go->neg_vj = 1; + go->old_vj = 1; + go->vj_protocol = ho->vj_protocol; + } + } +#endif /* VJ_SUPPORT */ + + return (LENCIADDRS(!go->neg_addr && go->old_addrs) + +#if VJ_SUPPORT + LENCIVJ(go->neg_vj, go->old_vj) + +#endif /* VJ_SUPPORT */ + LENCIADDR(go->neg_addr) + +#if LWIP_DNS + LENCIDNS(go->req_dns1) + + LENCIDNS(go->req_dns2) + +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ + LENCIWINS(go->winsaddr[0]) + + LENCIWINS(go->winsaddr[1]) + +#endif /* UNUSED - WINS */ + 0); +} + + +/* + * ipcp_addci - Add our desired CIs to a packet. + * Called by fsm_sconfreq, Send Configure Request. + */ +static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { + ppp_pcb *pcb = f->pcb; + ipcp_options *go = &pcb->ipcp_gotoptions; + int len = *lenp; + +#define ADDCIADDRS(opt, neg, val1, val2) \ + if (neg) { \ + if (len >= CILEN_ADDRS) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDRS, ucp); \ + l = lwip_ntohl(val1); \ + PUTLONG(l, ucp); \ + l = lwip_ntohl(val2); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDRS; \ + } else \ + go->old_addrs = 0; \ + } + +#if VJ_SUPPORT +#define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ + if (neg) { \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + if (!old) { \ + PUTCHAR(maxslotindex, ucp); \ + PUTCHAR(cflag, ucp); \ + } \ + len -= vjlen; \ + } else \ + neg = 0; \ + } +#endif /* VJ_SUPPORT */ + +#define ADDCIADDR(opt, neg, val) \ + if (neg) { \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(val); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ + } + +#if LWIP_DNS +#define ADDCIDNS(opt, neg, addr) \ + if (neg) { \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ + } +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ +#define ADDCIWINS(opt, addr) \ + if (addr) { \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + addr = 0; \ + } +#endif /* UNUSED - WINS */ + + ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, + go->hisaddr); + +#if VJ_SUPPORT + ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, + go->maxslotindex, go->cflag); +#endif /* VJ_SUPPORT */ + + ADDCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); + +#if LWIP_DNS + ADDCIDNS(CI_MS_DNS1, go->req_dns1, go->dnsaddr[0]); + + ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ + ADDCIWINS(CI_MS_WINS1, go->winsaddr[0]); + + ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); +#endif /* UNUSED - WINS */ + + *lenp -= len; +} + + +/* + * ipcp_ackci - Ack our CIs. + * Called by fsm_rconfack, Receive Configure ACK. + * + * Returns: + * 0 - Ack was bad. + * 1 - Ack was good. + */ +static int ipcp_ackci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ipcp_options *go = &pcb->ipcp_gotoptions; + u_short cilen, citype; + u32_t cilong; +#if VJ_SUPPORT + u_short cishort; + u_char cimaxslotindex, cicflag; +#endif /* VJ_SUPPORT */ + + /* + * CIs must be in exactly the same order that we sent... + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ + +#define ACKCIADDRS(opt, neg, val1, val2) \ + if (neg) { \ + u32_t l; \ + if ((len -= CILEN_ADDRS) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDRS || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val1 != cilong) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val2 != cilong) \ + goto bad; \ + } + +#if VJ_SUPPORT +#define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ + if (neg) { \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslotindex) \ + goto bad; \ + GETCHAR(cicflag, p); \ + if (cicflag != cflag) \ + goto bad; \ + } \ + } +#endif /* VJ_SUPPORT */ + +#define ACKCIADDR(opt, neg, val) \ + if (neg) { \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val != cilong) \ + goto bad; \ + } + +#if LWIP_DNS +#define ACKCIDNS(opt, neg, addr) \ + if (neg) { \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ + } +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ +#define ACKCIWINS(opt, addr) \ + if (addr) { \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ + } +#endif /* UNUSED - WINS */ + + ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, + go->hisaddr); + +#if VJ_SUPPORT + ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, + go->maxslotindex, go->cflag); +#endif /* VJ_SUPPORT */ + + ACKCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); + +#if LWIP_DNS + ACKCIDNS(CI_MS_DNS1, go->req_dns1, go->dnsaddr[0]); + + ACKCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ + ACKCIWINS(CI_MS_WINS1, go->winsaddr[0]); + + ACKCIWINS(CI_MS_WINS2, go->winsaddr[1]); +#endif /* UNUSED - WINS */ + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + return (1); + +bad: + IPCPDEBUG(("ipcp_ackci: received bad Ack!")); + return (0); +} + +/* + * ipcp_nakci - Peer has sent a NAK for some of our CIs. + * This should not modify any state if the Nak is bad + * or if IPCP is in the OPENED state. + * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. + * + * Returns: + * 0 - Nak was bad. + * 1 - Nak was good. + */ +static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { + ppp_pcb *pcb = f->pcb; + ipcp_options *go = &pcb->ipcp_gotoptions; + u_char citype, cilen, *next; +#if VJ_SUPPORT + u_char cimaxslotindex, cicflag; + u_short cishort; +#endif /* VJ_SUPPORT */ + u32_t ciaddr1, ciaddr2, l; +#if LWIP_DNS + u32_t cidnsaddr; +#endif /* LWIP_DNS */ + ipcp_options no; /* options we've seen Naks for */ + ipcp_options try_; /* options to request next time */ + + BZERO(&no, sizeof(no)); + try_ = *go; + + /* + * Any Nak'd CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define NAKCIADDRS(opt, neg, code) \ + if ((neg) && \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + GETLONG(l, p); \ + ciaddr2 = lwip_htonl(l); \ + no.old_addrs = 1; \ + code \ + } + +#if VJ_SUPPORT +#define NAKCIVJ(opt, neg, code) \ + if (go->neg && \ + ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ + } +#endif /* VJ_SUPPORT */ + +#define NAKCIADDR(opt, neg, code) \ + if (go->neg && \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + no.neg = 1; \ + code \ + } + +#if LWIP_DNS +#define NAKCIDNS(opt, neg, code) \ + if (go->neg && \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cidnsaddr = lwip_htonl(l); \ + no.neg = 1; \ + code \ + } +#endif /* LWIP_DNS */ + + /* + * Accept the peer's idea of {our,his} address, if different + * from our idea, only if the accept_{local,remote} flag is set. + */ + NAKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, + if (treat_as_reject) { + try_.old_addrs = 0; + } else { + if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + if (go->accept_remote && ciaddr2) { + /* take his idea of his address */ + try_.hisaddr = ciaddr2; + } + } + ); + +#if VJ_SUPPORT + /* + * Accept the peer's value of maxslotindex provided that it + * is less than what we asked for. Turn off slot-ID compression + * if the peer wants. Send old-style compress-type option if + * the peer wants. + */ + NAKCIVJ(CI_COMPRESSTYPE, neg_vj, + if (treat_as_reject) { + try_.neg_vj = 0; + } else if (cilen == CILEN_VJ) { + GETCHAR(cimaxslotindex, p); + GETCHAR(cicflag, p); + if (cishort == IPCP_VJ_COMP) { + try_.old_vj = 0; + if (cimaxslotindex < go->maxslotindex) + try_.maxslotindex = cimaxslotindex; + if (!cicflag) + try_.cflag = 0; + } else { + try_.neg_vj = 0; + } + } else { + if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { + try_.old_vj = 1; + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); +#endif /* VJ_SUPPORT */ + + NAKCIADDR(CI_ADDR, neg_addr, + if (treat_as_reject) { + try_.neg_addr = 0; + try_.old_addrs = 0; + } else if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + ); + +#if LWIP_DNS + NAKCIDNS(CI_MS_DNS1, req_dns1, + if (treat_as_reject) { + try_.req_dns1 = 0; + } else { + try_.dnsaddr[0] = cidnsaddr; + } + ); + + NAKCIDNS(CI_MS_DNS2, req_dns2, + if (treat_as_reject) { + try_.req_dns2 = 0; + } else { + try_.dnsaddr[1] = cidnsaddr; + } + ); +#endif /* #if LWIP_DNS */ + + /* + * There may be remaining CIs, if the peer is requesting negotiation + * on an option that we didn't include in our request packet. + * If they want to negotiate about IP addresses, we comply. + * If they want us to ask for compression, we refuse. + * If they want us to ask for ms-dns, we do that, since some + * peers get huffy if we don't. + */ + while (len >= CILEN_VOID) { + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; + + switch (citype) { +#if VJ_SUPPORT + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; +#endif /* VJ_SUPPORT */ + case CI_ADDRS: + if ((!go->neg_addr && go->old_addrs) || no.old_addrs + || cilen != CILEN_ADDRS) + goto bad; + try_.neg_addr = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + GETLONG(l, p); + ciaddr2 = lwip_htonl(l); + if (ciaddr2 && go->accept_remote) + try_.hisaddr = ciaddr2; + no.old_addrs = 1; + break; + case CI_ADDR: + if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) + goto bad; + try_.old_addrs = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + if (try_.ouraddr != 0) + try_.neg_addr = 1; + no.neg_addr = 1; + break; +#if LWIP_DNS + case CI_MS_DNS1: + if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[0] = lwip_htonl(l); + try_.req_dns1 = 1; + no.req_dns1 = 1; + break; + case CI_MS_DNS2: + if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[1] = lwip_htonl(l); + try_.req_dns2 = 1; + no.req_dns2 = 1; + break; +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ + case CI_MS_WINS1: + case CI_MS_WINS2: + if (cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1) + try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; + break; +#endif /* UNUSED - WINS */ + default: + break; + } + p = next; + } + + /* + * OK, the Nak is good. Now we can update state. + * If there are any remaining options, we ignore them. + */ + if (f->state != PPP_FSM_OPENED) + *go = try_; + + return 1; + +bad: + IPCPDEBUG(("ipcp_nakci: received bad Nak!")); + return 0; +} + + +/* + * ipcp_rejci - Reject some of our CIs. + * Callback from fsm_rconfnakrej. + */ +static int ipcp_rejci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ipcp_options *go = &pcb->ipcp_gotoptions; + u_char cilen; +#if VJ_SUPPORT + u_char cimaxslotindex, ciflag; + u_short cishort; +#endif /* VJ_SUPPORT */ + u32_t cilong; + ipcp_options try_; /* options to request next time */ + + try_ = *go; + /* + * Any Rejected CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define REJCIADDRS(opt, neg, val1, val2) \ + if ((neg) && \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val1) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val2) \ + goto bad; \ + try_.old_addrs = 0; \ + } + +#if VJ_SUPPORT +#define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ + if (go->neg && \ + p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslot) \ + goto bad; \ + GETCHAR(ciflag, p); \ + if (ciflag != cflag) \ + goto bad; \ + } \ + try_.neg = 0; \ + } +#endif /* VJ_SUPPORT */ + +#define REJCIADDR(opt, neg, val) \ + if (go->neg && \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ + } + +#if LWIP_DNS +#define REJCIDNS(opt, neg, dnsaddr) \ + if (go->neg && \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != dnsaddr) \ + goto bad; \ + try_.neg = 0; \ + } +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ +#define REJCIWINS(opt, addr) \ + if (addr && \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != addr) \ + goto bad; \ + try_.winsaddr[opt == CI_MS_WINS2] = 0; \ + } +#endif /* UNUSED - WINS */ + + REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, + go->ouraddr, go->hisaddr); + +#if VJ_SUPPORT + REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, + go->maxslotindex, go->cflag); +#endif /* VJ_SUPPORT */ + + REJCIADDR(CI_ADDR, neg_addr, go->ouraddr); + +#if LWIP_DNS + REJCIDNS(CI_MS_DNS1, req_dns1, go->dnsaddr[0]); + + REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ + REJCIWINS(CI_MS_WINS1, go->winsaddr[0]); + + REJCIWINS(CI_MS_WINS2, go->winsaddr[1]); +#endif /* UNUSED - WINS */ + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + /* + * Now we can update state. + */ + if (f->state != PPP_FSM_OPENED) + *go = try_; + return 1; + +bad: + IPCPDEBUG(("ipcp_rejci: received bad Reject!")); + return 0; +} + + +/* + * ipcp_reqci - Check the peer's requested CIs and send appropriate response. + * Callback from fsm_rconfreq, Receive Configure Request + * + * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified + * appropriately. If reject_if_disagree is non-zero, doesn't return + * CONFNAK; returns CONFREJ if it can't return CONFACK. + * + * inp = Requested CIs + * len = Length of requested CIs + */ +static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { + ppp_pcb *pcb = f->pcb; + ipcp_options *wo = &pcb->ipcp_wantoptions; + ipcp_options *ho = &pcb->ipcp_hisoptions; + ipcp_options *ao = &pcb->ipcp_allowoptions; + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ +#if VJ_SUPPORT + u_short cishort; /* Parsed short value */ +#endif /* VJ_SUPPORT */ + u32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ +#if VJ_SUPPORT + u_char maxslotindex, cflag; +#endif /* VJ_SUPPORT */ +#if LWIP_DNS + int d; +#endif /* LWIP_DNS */ + + /* + * Reset all his options. + */ + BZERO(ho, sizeof(*ho)); + + /* + * Process all his options. + */ + next = inp; + while (l) { + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPCPDEBUG(("ipcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_ADDRS: + if (!ao->old_addrs || ho->neg_addr || + cilen != CILEN_ADDRS) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + /* + * If he doesn't know our address, or if we both have our address + * but disagree about it, then NAK it with our idea. + */ + GETLONG(tl, p); /* Parse desination address (ours) */ + ciaddr2 = lwip_htonl(tl); + if (ciaddr2 != wo->ouraddr) { + if (ciaddr2 == 0 || !wo->accept_local) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->ouraddr); + PUTLONG(tl, p); + } + } else { + wo->ouraddr = ciaddr2; /* accept peer's idea */ + } + } + + ho->old_addrs = 1; + ho->hisaddr = ciaddr1; + ho->ouraddr = ciaddr2; + break; + + case CI_ADDR: + if (!ao->neg_addr || ho->old_addrs || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + ho->neg_addr = 1; + ho->hisaddr = ciaddr1; + break; + +#if LWIP_DNS + case CI_MS_DNS1: + case CI_MS_DNS2: + /* Microsoft primary or secondary DNS request */ + d = citype == CI_MS_DNS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->dnsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->dnsaddr[d]) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(ao->dnsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; + } + break; +#endif /* LWIP_DNS */ + +#if 0 /* UNUSED - WINS */ + case CI_MS_WINS1: + case CI_MS_WINS2: + /* Microsoft primary or secondary WINS request */ + d = citype == CI_MS_WINS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->winsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->winsaddr[d]) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(ao->winsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; + } + break; +#endif /* UNUSED - WINS */ + +#if VJ_SUPPORT + case CI_COMPRESSTYPE: + if (!ao->neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + if (!(cishort == IPCP_VJ_COMP || + (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + if (cilen == CILEN_VJ) { + GETCHAR(maxslotindex, p); + if (maxslotindex > ao->maxslotindex) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(ao->maxslotindex, p); + } + } + GETCHAR(cflag, p); + if (cflag && !ao->cflag) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(wo->cflag, p); + } + } + ho->maxslotindex = maxslotindex; + ho->cflag = cflag; + } else { + ho->old_vj = 1; + ho->maxslotindex = MAX_STATES - 1; + ho->cflag = 1; + } + break; +#endif /* VJ_SUPPORT */ + + default: + orc = CONFREJ; + break; + } +endswitch: + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); + } + + /* + * If we aren't rejecting this packet, and we want to negotiate + * their address, and they didn't send their address, then we + * send a NAK with a CI_ADDR option appended. We assume the + * input buffer is long enough that we can append the extra + * option safely. + */ + if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs && + wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_addr = 0; /* don't ask again */ + } + PUTCHAR(CI_ADDR, ucp); + PUTCHAR(CILEN_ADDR, ucp); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, ucp); + } + + *len = ucp - inp; /* Compute output length */ + IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); + return (rc); /* Return final code */ +} + + +#if 0 /* UNUSED */ +/* + * ip_check_options - check that any IP-related options are OK, + * and assign appropriate defaults. + */ +static void +ip_check_options() +{ + struct hostent *hp; + u32_t local; + ipcp_options *wo = &ipcp_wantoptions[0]; + + /* + * Default our local IP address based on our hostname. + * If local IP address already given, don't bother. + */ + if (wo->ouraddr == 0 && !disable_defaultip) { + /* + * Look up our hostname (possibly with domain name appended) + * and take the first IP address as our local IP address. + * If there isn't an IP address for our hostname, too bad. + */ + wo->accept_local = 1; /* don't insist on this default value */ + if ((hp = gethostbyname(hostname)) != NULL) { + local = *(u32_t *)hp->h_addr; + if (local != 0 && !bad_ip_adrs(local)) + wo->ouraddr = local; + } + } + ask_for_local = wo->ouraddr != 0 || !disable_defaultip; +} +#endif /* UNUSED */ + +#if DEMAND_SUPPORT +/* + * ip_demand_conf - configure the interface as though + * IPCP were up, for use with dial-on-demand. + */ +static int +ip_demand_conf(u) + int u; +{ + ppp_pcb *pcb = &ppp_pcb_list[u]; + ipcp_options *wo = &ipcp_wantoptions[u]; + + if (wo->hisaddr == 0 && !pcb->settings.noremoteip) { + /* make up an arbitrary address for the peer */ + wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); + wo->accept_remote = 1; + } + if (wo->ouraddr == 0) { + /* make up an arbitrary address for us */ + wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); + wo->accept_local = 1; + ask_for_local = 0; /* don't tell the peer this address */ + } + if (!sifaddr(pcb, wo->ouraddr, wo->hisaddr, get_mask(wo->ouraddr))) + return 0; + if (!sifup(pcb)) + return 0; + if (!sifnpmode(pcb, PPP_IP, NPMODE_QUEUE)) + return 0; +#if 0 /* UNUSED */ + if (wo->default_route) + if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, + wo->replace_default_route)) + default_route_set[u] = 1; +#endif /* UNUSED */ +#if 0 /* UNUSED - PROXY ARP */ + if (wo->proxy_arp) + if (sifproxyarp(pcb, wo->hisaddr)) + proxy_arp_set[u] = 1; +#endif /* UNUSED - PROXY ARP */ + + ppp_notice("local IP address %I", wo->ouraddr); + if (wo->hisaddr) + ppp_notice("remote IP address %I", wo->hisaddr); + + return 1; +} +#endif /* DEMAND_SUPPORT */ + +/* + * ipcp_up - IPCP has come UP. + * + * Configure the IP network interface appropriately and bring it up. + */ +static void ipcp_up(fsm *f) { + ppp_pcb *pcb = f->pcb; + u32_t mask; + ipcp_options *ho = &pcb->ipcp_hisoptions; + ipcp_options *go = &pcb->ipcp_gotoptions; + ipcp_options *wo = &pcb->ipcp_wantoptions; + + IPCPDEBUG(("ipcp: up")); + + /* + * We must have a non-zero IP address for both ends of the link. + */ + if (!ho->neg_addr && !ho->old_addrs) + ho->hisaddr = wo->hisaddr; + + if (!(go->neg_addr || go->old_addrs) && (wo->neg_addr || wo->old_addrs) + && wo->ouraddr != 0) { + ppp_error("Peer refused to agree to our IP address"); + ipcp_close(f->pcb, "Refused our IP address"); + return; + } + if (go->ouraddr == 0) { + ppp_error("Could not determine local IP address"); + ipcp_close(f->pcb, "Could not determine local IP address"); + return; + } + if (ho->hisaddr == 0 && !pcb->settings.noremoteip) { + ho->hisaddr = lwip_htonl(0x0a404040); + ppp_warn("Could not determine remote IP address: defaulting to %I", + ho->hisaddr); + } +#if 0 /* UNUSED */ + script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); + if (ho->hisaddr != 0) + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); +#endif /* UNUSED */ + +#if LWIP_DNS + if (!go->req_dns1) + go->dnsaddr[0] = 0; + if (!go->req_dns2) + go->dnsaddr[1] = 0; +#if 0 /* UNUSED */ + if (go->dnsaddr[0]) + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + if (go->dnsaddr[1]) + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); +#endif /* UNUSED */ + if (pcb->settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { + sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); +#if 0 /* UNUSED */ + script_setenv("USEPEERDNS", "1", 0); + create_resolv(go->dnsaddr[0], go->dnsaddr[1]); +#endif /* UNUSED */ + } +#endif /* LWIP_DNS */ + + /* + * Check that the peer is allowed to use the IP address it wants. + */ + if (ho->hisaddr != 0) { + u32_t addr = lwip_ntohl(ho->hisaddr); + if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET + || IP_MULTICAST(addr) || IP_BADCLASS(addr) + /* + * For now, consider that PPP in server mode with peer required + * to authenticate must provide the peer IP address, reject any + * IP address wanted by peer different than the one we wanted. + */ +#if PPP_SERVER && PPP_AUTH_SUPPORT + || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) +#endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ + ) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(pcb, "Unauthorized remote IP address"); + return; + } + } +#if 0 /* Unused */ + /* Upstream checking code */ + if (ho->hisaddr != 0 && !auth_ip_addr(f->unit, ho->hisaddr)) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(f->unit, "Unauthorized remote IP address"); + return; + } +#endif /* Unused */ + +#if VJ_SUPPORT + /* set tcp compression */ + sifvjcomp(pcb, ho->neg_vj, ho->cflag, ho->maxslotindex); +#endif /* VJ_SUPPORT */ + +#if DEMAND_SUPPORT + /* + * If we are doing dial-on-demand, the interface is already + * configured, so we put out any saved-up packets, then set the + * interface to pass IP packets. + */ + if (demand) { + if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { + ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, + wo->replace_default_route); + if (go->ouraddr != wo->ouraddr) { + ppp_warn("Local IP address changed to %I", go->ouraddr); + script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); + wo->ouraddr = go->ouraddr; + } else + script_unsetenv("OLDIPLOCAL"); + if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { + ppp_warn("Remote IP address changed to %I", ho->hisaddr); + script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); + wo->hisaddr = ho->hisaddr; + } else + script_unsetenv("OLDIPREMOTE"); + + /* Set the interface to the new addresses */ + mask = get_mask(go->ouraddr); + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { +#if PPP_DEBUG + ppp_warn("Interface configuration failed"); +#endif /* PPP_DEBUG */ + ipcp_close(f->unit, "Interface configuration failed"); + return; + } + + /* assign a default route through the interface if required */ + if (ipcp_wantoptions[f->unit].default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + default_route_set[f->unit] = 1; + +#if 0 /* UNUSED - PROXY ARP */ + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + proxy_arp_set[f->unit] = 1; +#endif /* UNUSED - PROXY ARP */ + + } + demand_rexmit(PPP_IP,go->ouraddr); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); + + } else +#endif /* DEMAND_SUPPORT */ + { + /* + * Set IP addresses and (if specified) netmask. + */ + mask = get_mask(go->ouraddr); + +#if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { +#if PPP_DEBUG + ppp_warn("Interface configuration failed"); +#endif /* PPP_DEBUG */ + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } +#endif + + /* bring the interface up for IP */ + if (!sifup(pcb)) { +#if PPP_DEBUG + ppp_warn("Interface failed to come up"); +#endif /* PPP_DEBUG */ + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } + +#if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { +#if PPP_DEBUG + ppp_warn("Interface configuration failed"); +#endif /* PPP_DEBUG */ + ipcp_close(f->unit, "Interface configuration failed"); + return; + } +#endif +#if DEMAND_SUPPORT + sifnpmode(pcb, PPP_IP, NPMODE_PASS); +#endif /* DEMAND_SUPPORT */ + +#if 0 /* UNUSED */ + /* assign a default route through the interface if required */ + if (wo->default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + pcb->default_route_set = 1; +#endif /* UNUSED */ + +#if 0 /* UNUSED - PROXY ARP */ + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && wo->proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + pcb->proxy_arp_set = 1; +#endif /* UNUSED - PROXY ARP */ + + wo->ouraddr = go->ouraddr; + + ppp_notice("local IP address %I", go->ouraddr); + if (ho->hisaddr != 0) + ppp_notice("remote IP address %I", ho->hisaddr); +#if LWIP_DNS + if (go->dnsaddr[0]) + ppp_notice("primary DNS address %I", go->dnsaddr[0]); + if (go->dnsaddr[1]) + ppp_notice("secondary DNS address %I", go->dnsaddr[1]); +#endif /* LWIP_DNS */ + } + +#if PPP_STATS_SUPPORT + reset_link_stats(f->unit); +#endif /* PPP_STATS_SUPPORT */ + + np_up(pcb, PPP_IP); + pcb->ipcp_is_up = 1; + +#if PPP_NOTIFY + notify(ip_up_notifier, 0); +#endif /* PPP_NOTIFY */ +#if 0 /* UNUSED */ + if (ip_up_hook) + ip_up_hook(); +#endif /* UNUSED */ +} + + +/* + * ipcp_down - IPCP has gone DOWN. + * + * Take the IP network interface down, clear its addresses + * and delete routes through it. + */ +static void ipcp_down(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipcp_options *ho = &pcb->ipcp_hisoptions; + ipcp_options *go = &pcb->ipcp_gotoptions; + + IPCPDEBUG(("ipcp: down")); +#if PPP_STATS_SUPPORT + /* XXX a bit IPv4-centric here, we only need to get the stats + * before the interface is marked down. */ + /* XXX more correct: we must get the stats before running the notifiers, + * at least for the radius plugin */ + update_link_stats(f->unit); +#endif /* PPP_STATS_SUPPORT */ +#if PPP_NOTIFY + notify(ip_down_notifier, 0); +#endif /* PPP_NOTIFY */ +#if 0 /* UNUSED */ + if (ip_down_hook) + ip_down_hook(); +#endif /* UNUSED */ + if (pcb->ipcp_is_up) { + pcb->ipcp_is_up = 0; + np_down(pcb, PPP_IP); + } +#if VJ_SUPPORT + sifvjcomp(pcb, 0, 0, 0); +#endif /* VJ_SUPPORT */ + +#if PPP_STATS_SUPPORT + print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), + * because print_link_stats() sets link_stats_valid + * to 0 (zero) */ +#endif /* PPP_STATS_SUPPORT */ + +#if DEMAND_SUPPORT + /* + * If we are doing dial-on-demand, set the interface + * to queue up outgoing packets (for now). + */ + if (demand) { + sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); + } else +#endif /* DEMAND_SUPPORT */ + { +#if DEMAND_SUPPORT + sifnpmode(pcb, PPP_IP, NPMODE_DROP); +#endif /* DEMAND_SUPPORT */ + sifdown(pcb); + ipcp_clear_addrs(pcb, go->ouraddr, + ho->hisaddr, 0); +#if LWIP_DNS + cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); +#endif /* LWIP_DNS */ + } +} + + +/* + * ipcp_clear_addrs() - clear the interface addresses, routes, + * proxy arp entries, etc. + */ +static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t replacedefaultroute) { + LWIP_UNUSED_ARG(replacedefaultroute); + +#if 0 /* UNUSED - PROXY ARP */ + if (pcb->proxy_arp_set) { + cifproxyarp(pcb, hisaddr); + pcb->proxy_arp_set = 0; + } +#endif /* UNUSED - PROXY ARP */ +#if 0 /* UNUSED */ + /* If replacedefaultroute, sifdefaultroute will be called soon + * with replacedefaultroute set and that will overwrite the current + * default route. This is the case only when doing demand, otherwise + * during demand, this cifdefaultroute would restore the old default + * route which is not what we want in this case. In the non-demand + * case, we'll delete the default route and restore the old if there + * is one saved by an sifdefaultroute with replacedefaultroute. + */ + if (!replacedefaultroute && pcb->default_route_set) { + cifdefaultroute(pcb, ouraddr, hisaddr); + pcb->default_route_set = 0; + } +#endif /* UNUSED */ + cifaddr(pcb, ouraddr, hisaddr); +} + + +/* + * ipcp_finished - possibly shut down the lower layers. + */ +static void ipcp_finished(fsm *f) { + ppp_pcb *pcb = f->pcb; + if (pcb->ipcp_is_open) { + pcb->ipcp_is_open = 0; + np_finished(pcb, PPP_IP); + } +} + + +#if 0 /* UNUSED */ +/* + * create_resolv - create the replacement resolv.conf file + */ +static void +create_resolv(peerdns1, peerdns2) + u32_t peerdns1, peerdns2; +{ + +} +#endif /* UNUSED */ + +#if PRINTPKT_SUPPORT +/* + * ipcp_printpkt - print the contents of an IPCP packet. + */ +static const char* const ipcp_codenames[] = { + "ConfReq", "ConfAck", "ConfNak", "ConfRej", + "TermReq", "TermAck", "CodeRej" +}; + +static int ipcp_printpkt(const u_char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len, olen; + const u_char *pstart, *optend; +#if VJ_SUPPORT + u_short cishort; +#endif /* VJ_SUPPORT */ + u32_t cilong; + + if (plen < HEADERLEN) + return 0; + pstart = p; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < HEADERLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipcp_codenames)) + printer(arg, " %s", ipcp_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= HEADERLEN; + switch (code) { + case CONFREQ: + case CONFACK: + case CONFNAK: + case CONFREJ: + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_ADDRS: + if (olen == CILEN_ADDRS) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addrs %I", lwip_htonl(cilong)); + GETLONG(cilong, p); + printer(arg, " %I", lwip_htonl(cilong)); + } + break; +#if VJ_SUPPORT + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + switch (cishort) { + case IPCP_VJ_COMP: + printer(arg, "VJ"); + break; + case IPCP_VJ_COMP_OLD: + printer(arg, "old-VJ"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; +#endif /* VJ_SUPPORT */ + case CI_ADDR: + if (olen == CILEN_ADDR) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addr %I", lwip_htonl(cilong)); + } + break; +#if LWIP_DNS + case CI_MS_DNS1: + case CI_MS_DNS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), + htonl(cilong)); + break; +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ + case CI_MS_WINS1: + case CI_MS_WINS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-wins %I", lwip_htonl(cilong)); + break; +#endif /* UNUSED - WINS */ + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; + + case TERMACK: + case TERMREQ: + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; + default: + break; + } + + /* print the rest of the bytes in the packet */ + for (; len > 0; --len) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + + return p - pstart; +} +#endif /* PRINTPKT_SUPPORT */ + +#if DEMAND_SUPPORT +/* + * ip_active_pkt - see if this IP packet is worth bringing the link up for. + * We don't bring the link up for IP fragments or for TCP FIN packets + * with no data. + */ +#define IP_HDRLEN 20 /* bytes */ +#define IP_OFFMASK 0x1fff +#ifndef IPPROTO_TCP +#define IPPROTO_TCP 6 +#endif +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 + +/* + * We use these macros because the IP header may be at an odd address, + * and some compilers might use word loads to get th_off or ip_hl. + */ + +#define net_short(x) (((x)[0] << 8) + (x)[1]) +#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) +#define get_ipoff(x) net_short((unsigned char *)(x) + 6) +#define get_ipproto(x) (((unsigned char *)(x))[9]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) + +static int +ip_active_pkt(pkt, len) + u_char *pkt; + int len; +{ + u_char *tcp; + int hlen; + + len -= PPP_HDRLEN; + pkt += PPP_HDRLEN; + if (len < IP_HDRLEN) + return 0; + if ((get_ipoff(pkt) & IP_OFFMASK) != 0) + return 0; + if (get_ipproto(pkt) != IPPROTO_TCP) + return 1; + hlen = get_iphl(pkt) * 4; + if (len < hlen + TCP_HDRLEN) + return 0; + tcp = pkt + hlen; + if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) + return 0; + return 1; +} +#endif /* DEMAND_SUPPORT */ + +#endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipv6cp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipv6cp.c new file mode 100644 index 0000000..11c18df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ipv6cp.c @@ -0,0 +1,1533 @@ +/* + * ipv6cp.c - PPP IPV6 Control Protocol. + * + * Copyright (c) 1999 Tommi Komulainen. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Tommi Komulainen + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* Original version, based on RFC2023 : + + Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt, + Alain.Durand@imag.fr, IMAG, + Jean-Luc.Richier@imag.fr, IMAG-LSR. + + Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE, + Alain.Durand@imag.fr, IMAG, + Jean-Luc.Richier@imag.fr, IMAG-LSR. + + Ce travail a été fait au sein du GIE DYADE (Groupement d'Intérêt + Économique ayant pour membres BULL S.A. et l'INRIA). + + Ce logiciel informatique est disponible aux conditions + usuelles dans la recherche, c'est-à-dire qu'il peut + être utilisé, copié, modifié, distribué à l'unique + condition que ce texte soit conservé afin que + l'origine de ce logiciel soit reconnue. + + Le nom de l'Institut National de Recherche en Informatique + et en Automatique (INRIA), de l'IMAG, ou d'une personne morale + ou physique ayant participé à l'élaboration de ce logiciel ne peut + être utilisé sans son accord préalable explicite. + + Ce logiciel est fourni tel quel sans aucune garantie, + support ou responsabilité d'aucune sorte. + Ce logiciel est dérivé de sources d'origine + "University of California at Berkeley" et + "Digital Equipment Corporation" couvertes par des copyrights. + + L'Institut d'Informatique et de Mathématiques Appliquées de Grenoble (IMAG) + est une fédération d'unités mixtes de recherche du CNRS, de l'Institut National + Polytechnique de Grenoble et de l'Université Joseph Fourier regroupant + sept laboratoires dont le laboratoire Logiciels, Systèmes, Réseaux (LSR). + + This work has been done in the context of GIE DYADE (joint R & D venture + between BULL S.A. and INRIA). + + This software is available with usual "research" terms + with the aim of retain credits of the software. + Permission to use, copy, modify and distribute this software for any + purpose and without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies, + and the name of INRIA, IMAG, or any contributor not be used in advertising + or publicity pertaining to this material without the prior explicit + permission. The software is provided "as is" without any + warranties, support or liabilities of any kind. + This software is derived from source code from + "University of California at Berkeley" and + "Digital Equipment Corporation" protected by copyrights. + + Grenoble's Institute of Computer Science and Applied Mathematics (IMAG) + is a federation of seven research units funded by the CNRS, National + Polytechnic Institute of Grenoble and University Joseph Fourier. + The research unit in Software, Systems, Networks (LSR) is member of IMAG. +*/ + +/* + * Derived from : + * + * + * ipcp.c - PPP IP Control Protocol. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ + */ + +/* + * @todo: + * + * Proxy Neighbour Discovery. + * + * Better defines for selecting the ordering of + * interface up / set address. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/fsm.h" +#include "netif/ppp/ipcp.h" +#include "netif/ppp/ipv6cp.h" +#include "netif/ppp/magic.h" + +/* global vars */ +#if 0 /* UNUSED */ +int no_ifaceid_neg = 0; +#endif /* UNUSED */ + +/* + * Callbacks for fsm code. (CI = Configuration Information) + */ +static void ipv6cp_resetci(fsm *f); /* Reset our CI */ +static int ipv6cp_cilen(fsm *f); /* Return length of our CI */ +static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ +static int ipv6cp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ +static int ipv6cp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ +static void ipv6cp_up(fsm *f); /* We're UP */ +static void ipv6cp_down(fsm *f); /* We're DOWN */ +static void ipv6cp_finished(fsm *f); /* Don't need lower layer */ + +static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ + ipv6cp_resetci, /* Reset our Configuration Information */ + ipv6cp_cilen, /* Length of our Configuration Information */ + ipv6cp_addci, /* Add our Configuration Information */ + ipv6cp_ackci, /* ACK our Configuration Information */ + ipv6cp_nakci, /* NAK our Configuration Information */ + ipv6cp_rejci, /* Reject our Configuration Information */ + ipv6cp_reqci, /* Request peer's Configuration Information */ + ipv6cp_up, /* Called when fsm reaches OPENED state */ + ipv6cp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipv6cp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPV6CP" /* String name of protocol */ +}; + +#if PPP_OPTIONS +/* + * Command-line options. + */ +static int setifaceid(char **arg)); +static void printifaceid(option_t *, + void (*)(void *, char *, ...), void *)); + +static option_t ipv6cp_option_list[] = { + { "ipv6", o_special, (void *)setifaceid, + "Set interface identifiers for IPV6", + OPT_A2PRINTER, (void *)printifaceid }, + + { "+ipv6", o_bool, &ipv6cp_protent.enabled_flag, + "Enable IPv6 and IPv6CP", OPT_PRIO | 1 }, + { "noipv6", o_bool, &ipv6cp_protent.enabled_flag, + "Disable IPv6 and IPv6CP", OPT_PRIOSUB }, + { "-ipv6", o_bool, &ipv6cp_protent.enabled_flag, + "Disable IPv6 and IPv6CP", OPT_PRIOSUB | OPT_ALIAS }, + + { "ipv6cp-accept-local", o_bool, &ipv6cp_allowoptions[0].accept_local, + "Accept peer's interface identifier for us", 1 }, + + { "ipv6cp-use-ipaddr", o_bool, &ipv6cp_allowoptions[0].use_ip, + "Use (default) IPv4 address as interface identifier", 1 }, + + { "ipv6cp-use-persistent", o_bool, &ipv6cp_wantoptions[0].use_persistent, + "Use uniquely-available persistent value for link local address", 1 }, + + { "ipv6cp-restart", o_int, &ipv6cp_fsm[0].timeouttime, + "Set timeout for IPv6CP", OPT_PRIO }, + { "ipv6cp-max-terminate", o_int, &ipv6cp_fsm[0].maxtermtransmits, + "Set max #xmits for term-reqs", OPT_PRIO }, + { "ipv6cp-max-configure", o_int, &ipv6cp_fsm[0].maxconfreqtransmits, + "Set max #xmits for conf-reqs", OPT_PRIO }, + { "ipv6cp-max-failure", o_int, &ipv6cp_fsm[0].maxnakloops, + "Set max #conf-naks for IPv6CP", OPT_PRIO }, + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points from main code. + */ +static void ipv6cp_init(ppp_pcb *pcb); +static void ipv6cp_open(ppp_pcb *pcb); +static void ipv6cp_close(ppp_pcb *pcb, const char *reason); +static void ipv6cp_lowerup(ppp_pcb *pcb); +static void ipv6cp_lowerdown(ppp_pcb *pcb); +static void ipv6cp_input(ppp_pcb *pcb, u_char *p, int len); +static void ipv6cp_protrej(ppp_pcb *pcb); +#if PPP_OPTIONS +static void ipv6_check_options(void); +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT +static int ipv6_demand_conf(int u); +#endif /* DEMAND_SUPPORT */ +#if PRINTPKT_SUPPORT +static int ipv6cp_printpkt(const u_char *p, int plen, + void (*printer)(void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ +#if DEMAND_SUPPORT +static int ipv6_active_pkt(u_char *pkt, int len); +#endif /* DEMAND_SUPPORT */ + +const struct protent ipv6cp_protent = { + PPP_IPV6CP, + ipv6cp_init, + ipv6cp_input, + ipv6cp_protrej, + ipv6cp_lowerup, + ipv6cp_lowerdown, + ipv6cp_open, + ipv6cp_close, +#if PRINTPKT_SUPPORT + ipv6cp_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "IPV6CP", + "IPV6", +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + ipv6cp_option_list, + ipv6_check_options, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + ipv6_demand_conf, + ipv6_active_pkt +#endif /* DEMAND_SUPPORT */ +}; + +static void ipv6cp_clear_addrs(ppp_pcb *pcb, eui64_t ourid, eui64_t hisid); +#if 0 /* UNUSED */ +static void ipv6cp_script(char *)); +static void ipv6cp_script_done(void *)); +#endif /* UNUSED */ + +/* + * Lengths of configuration options. + */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ +#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ + +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") + +#if 0 /* UNUSED */ +/* + * This state variable is used to ensure that we don't + * run an ipcp-up/down script while one is already running. + */ +static enum script_state { + s_down, + s_up, +} ipv6cp_script_state; +static pid_t ipv6cp_script_pid; +#endif /* UNUSED */ + +static char *llv6_ntoa(eui64_t ifaceid); + +#if PPP_OPTIONS +/* + * setifaceid - set the interface identifiers manually + */ +static int +setifaceid(argv) + char **argv; +{ + char *comma, *arg, c; + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + struct in6_addr addr; + static int prio_local, prio_remote; + +#define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) + + arg = *argv; + if ((comma = strchr(arg, ',')) == NULL) + comma = arg + strlen(arg); + + /* + * If comma first character, then no local identifier + */ + if (comma != arg) { + c = *comma; + *comma = '\0'; + + if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (local): %s", arg); + return 0; + } + + if (option_priority >= prio_local) { + eui64_copy(addr.s6_addr32[2], wo->ourid); + wo->opt_local = 1; + prio_local = option_priority; + } + *comma = c; + } + + /* + * If comma last character, the no remote identifier + */ + if (*comma != 0 && *++comma != '\0') { + if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (remote): %s", comma); + return 0; + } + if (option_priority >= prio_remote) { + eui64_copy(addr.s6_addr32[2], wo->hisid); + wo->opt_remote = 1; + prio_remote = option_priority; + } + } + + if (override_value("+ipv6", option_priority, option_source)) + ipv6cp_protent.enabled_flag = 1; + return 1; +} + +static void +printifaceid(opt, printer, arg) + option_t *opt; + void (*printer)(void *, char *, ...)); + void *arg; +{ + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + + if (wo->opt_local) + printer(arg, "%s", llv6_ntoa(wo->ourid)); + printer(arg, ","); + if (wo->opt_remote) + printer(arg, "%s", llv6_ntoa(wo->hisid)); +} +#endif /* PPP_OPTIONS */ + +/* + * Make a string representation of a network address. + */ +static char * +llv6_ntoa(eui64_t ifaceid) +{ + static char b[26]; + + sprintf(b, "fe80::%02x%02x:%02x%02x:%02x%02x:%02x%02x", + ifaceid.e8[0], ifaceid.e8[1], ifaceid.e8[2], ifaceid.e8[3], + ifaceid.e8[4], ifaceid.e8[5], ifaceid.e8[6], ifaceid.e8[7]); + + return b; +} + + +/* + * ipv6cp_init - Initialize IPV6CP. + */ +static void ipv6cp_init(ppp_pcb *pcb) { + fsm *f = &pcb->ipv6cp_fsm; + ipv6cp_options *wo = &pcb->ipv6cp_wantoptions; + ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; + + f->pcb = pcb; + f->protocol = PPP_IPV6CP; + f->callbacks = &ipv6cp_callbacks; + fsm_init(f); + +#if 0 /* Not necessary, everything is cleared in ppp_new() */ + memset(wo, 0, sizeof(*wo)); + memset(ao, 0, sizeof(*ao)); +#endif /* 0 */ + + wo->accept_local = 1; + wo->neg_ifaceid = 1; + ao->neg_ifaceid = 1; + +#ifdef IPV6CP_COMP + wo->neg_vj = 1; + ao->neg_vj = 1; + wo->vj_protocol = IPV6CP_COMP; +#endif + +} + + +/* + * ipv6cp_open - IPV6CP is allowed to come up. + */ +static void ipv6cp_open(ppp_pcb *pcb) { + fsm_open(&pcb->ipv6cp_fsm); +} + + +/* + * ipv6cp_close - Take IPV6CP down. + */ +static void ipv6cp_close(ppp_pcb *pcb, const char *reason) { + fsm_close(&pcb->ipv6cp_fsm, reason); +} + + +/* + * ipv6cp_lowerup - The lower layer is up. + */ +static void ipv6cp_lowerup(ppp_pcb *pcb) { + fsm_lowerup(&pcb->ipv6cp_fsm); +} + + +/* + * ipv6cp_lowerdown - The lower layer is down. + */ +static void ipv6cp_lowerdown(ppp_pcb *pcb) { + fsm_lowerdown(&pcb->ipv6cp_fsm); +} + + +/* + * ipv6cp_input - Input IPV6CP packet. + */ +static void ipv6cp_input(ppp_pcb *pcb, u_char *p, int len) { + fsm_input(&pcb->ipv6cp_fsm, p, len); +} + + +/* + * ipv6cp_protrej - A Protocol-Reject was received for IPV6CP. + * + * Pretend the lower layer went down, so we shut up. + */ +static void ipv6cp_protrej(ppp_pcb *pcb) { + fsm_lowerdown(&pcb->ipv6cp_fsm); +} + + +/* + * ipv6cp_resetci - Reset our CI. + */ +static void ipv6cp_resetci(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *wo = &pcb->ipv6cp_wantoptions; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; + + wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid; + + if (!wo->opt_local) { + eui64_magic_nz(wo->ourid); + } + + *go = *wo; + eui64_zero(go->hisid); /* last proposed interface identifier */ +} + + +/* + * ipv6cp_cilen - Return length of our CI. + */ +static int ipv6cp_cilen(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + +#ifdef IPV6CP_COMP +#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) +#endif /* IPV6CP_COMP */ +#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) + + return (LENCIIFACEID(go->neg_ifaceid) + +#ifdef IPV6CP_COMP + LENCIVJ(go->neg_vj) + +#endif /* IPV6CP_COMP */ + 0); +} + + +/* + * ipv6cp_addci - Add our desired CIs to a packet. + */ +static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + int len = *lenp; + +#ifdef IPV6CP_COMP +#define ADDCIVJ(opt, neg, val) \ + if (neg) { \ + int vjlen = CILEN_COMPRESS; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + len -= vjlen; \ + } else \ + neg = 0; \ + } +#endif /* IPV6CP_COMP */ + +#define ADDCIIFACEID(opt, neg, val1) \ + if (neg) { \ + int idlen = CILEN_IFACEID; \ + if (len >= idlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(idlen, ucp); \ + eui64_put(val1, ucp); \ + len -= idlen; \ + } else \ + neg = 0; \ + } + + ADDCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); + +#ifdef IPV6CP_COMP + ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol); +#endif /* IPV6CP_COMP */ + + *lenp -= len; +} + + +/* + * ipv6cp_ackci - Ack our CIs. + * + * Returns: + * 0 - Ack was bad. + * 1 - Ack was good. + */ +static int ipv6cp_ackci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + u_short cilen, citype; +#ifdef IPV6CP_COMP + u_short cishort; +#endif /* IPV6CP_COMP */ + eui64_t ifaceid; + + /* + * CIs must be in exactly the same order that we sent... + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ + +#ifdef IPV6CP_COMP +#define ACKCIVJ(opt, neg, val) \ + if (neg) { \ + int vjlen = CILEN_COMPRESS; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + } +#endif /* IPV6CP_COMP */ + +#define ACKCIIFACEID(opt, neg, val1) \ + if (neg) { \ + int idlen = CILEN_IFACEID; \ + if ((len -= idlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != idlen || \ + citype != opt) \ + goto bad; \ + eui64_get(ifaceid, p); \ + if (! eui64_equals(val1, ifaceid)) \ + goto bad; \ + } + + ACKCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); + +#ifdef IPV6CP_COMP + ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol); +#endif /* IPV6CP_COMP */ + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + return (1); + +bad: + IPV6CPDEBUG(("ipv6cp_ackci: received bad Ack!")); + return (0); +} + +/* + * ipv6cp_nakci - Peer has sent a NAK for some of our CIs. + * This should not modify any state if the Nak is bad + * or if IPV6CP is in the OPENED state. + * + * Returns: + * 0 - Nak was bad. + * 1 - Nak was good. + */ +static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + u_char citype, cilen, *next; +#ifdef IPV6CP_COMP + u_short cishort; +#endif /* IPV6CP_COMP */ + eui64_t ifaceid; + ipv6cp_options no; /* options we've seen Naks for */ + ipv6cp_options try_; /* options to request next time */ + + BZERO(&no, sizeof(no)); + try_ = *go; + + /* + * Any Nak'd CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define NAKCIIFACEID(opt, neg, code) \ + if (go->neg && \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + no.neg = 1; \ + code \ + } + +#ifdef IPV6CP_COMP +#define NAKCIVJ(opt, neg, code) \ + if (go->neg && \ + ((cilen = p[1]) == CILEN_COMPRESS) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ + } +#endif /* IPV6CP_COMP */ + + /* + * Accept the peer's idea of {our,his} interface identifier, if different + * from our idea, only if the accept_{local,remote} flag is set. + */ + NAKCIIFACEID(CI_IFACEID, neg_ifaceid, + if (treat_as_reject) { + try_.neg_ifaceid = 0; + } else if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); + } + ); + +#ifdef IPV6CP_COMP + NAKCIVJ(CI_COMPRESSTYPE, neg_vj, + { + if (cishort == IPV6CP_COMP && !treat_as_reject) { + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); +#endif /* IPV6CP_COMP */ + + /* + * There may be remaining CIs, if the peer is requesting negotiation + * on an option that we didn't include in our request packet. + * If they want to negotiate about interface identifier, we comply. + * If they want us to ask for compression, we refuse. + */ + while (len >= CILEN_VOID) { + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; + + switch (citype) { +#ifdef IPV6CP_COMP + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; +#endif /* IPV6CP_COMP */ + case CI_IFACEID: + if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) + goto bad; + try_.neg_ifaceid = 1; + eui64_get(ifaceid, p); + if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + } + no.neg_ifaceid = 1; + break; + default: + break; + } + p = next; + } + + /* If there is still anything left, this packet is bad. */ + if (len != 0) + goto bad; + + /* + * OK, the Nak is good. Now we can update state. + */ + if (f->state != PPP_FSM_OPENED) + *go = try_; + + return 1; + +bad: + IPV6CPDEBUG(("ipv6cp_nakci: received bad Nak!")); + return 0; +} + + +/* + * ipv6cp_rejci - Reject some of our CIs. + */ +static int ipv6cp_rejci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + u_char cilen; +#ifdef IPV6CP_COMP + u_short cishort; +#endif /* IPV6CP_COMP */ + eui64_t ifaceid; + ipv6cp_options try_; /* options to request next time */ + + try_ = *go; + /* + * Any Rejected CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define REJCIIFACEID(opt, neg, val1) \ + if (go->neg && \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + /* Check rejected value. */ \ + if (! eui64_equals(ifaceid, val1)) \ + goto bad; \ + try_.neg = 0; \ + } + +#ifdef IPV6CP_COMP +#define REJCIVJ(opt, neg, val) \ + if (go->neg && \ + p[1] == CILEN_COMPRESS && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ + } +#endif /* IPV6CP_COMP */ + + REJCIIFACEID(CI_IFACEID, neg_ifaceid, go->ourid); + +#ifdef IPV6CP_COMP + REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol); +#endif /* IPV6CP_COMP */ + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + /* + * Now we can update state. + */ + if (f->state != PPP_FSM_OPENED) + *go = try_; + return 1; + +bad: + IPV6CPDEBUG(("ipv6cp_rejci: received bad Reject!")); + return 0; +} + + +/* + * ipv6cp_reqci - Check the peer's requested CIs and send appropriate response. + * + * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified + * appropriately. If reject_if_disagree is non-zero, doesn't return + * CONFNAK; returns CONFREJ if it can't return CONFACK. + * + * inp = Requested CIs + * len = Length of requested CIs + * + */ +static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *wo = &pcb->ipv6cp_wantoptions; + ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; + ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ +#ifdef IPV6CP_COMP + u_short cishort; /* Parsed short value */ +#endif /* IPV6CP_COMP */ + eui64_t ifaceid; /* Parsed interface identifier */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ + + /* + * Reset all his options. + */ + BZERO(ho, sizeof(*ho)); + + /* + * Process all his options. + */ + next = inp; + while (l) { + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_IFACEID: + IPV6CPDEBUG(("ipv6cp: received interface identifier ")); + + if (!ao->neg_ifaceid || + cilen != CILEN_IFACEID) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no interface identifier, or if we both have same + * identifier then NAK it with new idea. + * In particular, if we don't know his identifier, but he does, + * then accept it. + */ + eui64_get(ifaceid, p); + IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); + if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { + orc = CONFREJ; /* Reject CI */ + break; + } + if (!eui64_iszero(wo->hisid) && + !eui64_equals(ifaceid, wo->hisid) && + eui64_iszero(go->hisid)) { + + orc = CONFNAK; + ifaceid = wo->hisid; + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } else + if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { + orc = CONFNAK; + if (eui64_iszero(go->hisid)) /* first time, try option */ + ifaceid = wo->hisid; + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->ourid)) /* bad luck */ + eui64_magic(ifaceid); + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } + + ho->neg_ifaceid = 1; + ho->hisid = ifaceid; + break; + +#ifdef IPV6CP_COMP + case CI_COMPRESSTYPE: + IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); + if (!ao->neg_vj || + (cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + IPV6CPDEBUG(("(%d)", cishort)); + + if (!(cishort == IPV6CP_COMP)) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + break; +#endif /* IPV6CP_COMP */ + + default: + orc = CONFREJ; + break; + } + +endswitch: + IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); + + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); + } + + /* + * If we aren't rejecting this packet, and we want to negotiate + * their identifier and they didn't send their identifier, then we + * send a NAK with a CI_IFACEID option appended. We assume the + * input buffer is long enough that we can append the extra + * option safely. + */ + if (rc != CONFREJ && !ho->neg_ifaceid && + wo->req_ifaceid && !reject_if_disagree) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_ifaceid = 0; /* don't ask again */ + } + PUTCHAR(CI_IFACEID, ucp); + PUTCHAR(CILEN_IFACEID, ucp); + eui64_put(wo->hisid, ucp); + } + + *len = ucp - inp; /* Compute output length */ + IPV6CPDEBUG(("ipv6cp: returning Configure-%s", CODENAME(rc))); + return (rc); /* Return final code */ +} + +#if PPP_OPTIONS +/* + * ipv6_check_options - check that any IP-related options are OK, + * and assign appropriate defaults. + */ +static void ipv6_check_options() { + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + + if (!ipv6cp_protent.enabled_flag) + return; + + /* + * Persistent link-local id is only used when user has not explicitly + * configure/hard-code the id + */ + if ((wo->use_persistent) && (!wo->opt_local) && (!wo->opt_remote)) { + + /* + * On systems where there are no Ethernet interfaces used, there + * may be other ways to obtain a persistent id. Right now, it + * will fall back to using magic [see eui64_magic] below when + * an EUI-48 from MAC address can't be obtained. Other possibilities + * include obtaining EEPROM serial numbers, or some other unique + * yet persistent number. On Sparc platforms, this is possible, + * but too bad there's no standards yet for x86 machines. + */ + if (ether_to_eui64(&wo->ourid)) { + wo->opt_local = 1; + } + } + + if (!wo->opt_local) { /* init interface identifier */ + if (wo->use_ip && eui64_iszero(wo->ourid)) { + eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); + if (!eui64_iszero(wo->ourid)) + wo->opt_local = 1; + } + + while (eui64_iszero(wo->ourid)) + eui64_magic(wo->ourid); + } + + if (!wo->opt_remote) { + if (wo->use_ip && eui64_iszero(wo->hisid)) { + eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); + if (!eui64_iszero(wo->hisid)) + wo->opt_remote = 1; + } + } + + if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) { + option_error("local/remote LL address required for demand-dialling\n"); + exit(1); + } +} +#endif /* PPP_OPTIONS */ + +#if DEMAND_SUPPORT +/* + * ipv6_demand_conf - configure the interface as though + * IPV6CP were up, for use with dial-on-demand. + */ +static int ipv6_demand_conf(int u) { + ipv6cp_options *wo = &ipv6cp_wantoptions[u]; + + if (!sif6up(u)) + return 0; + + if (!sif6addr(u, wo->ourid, wo->hisid)) + return 0; + + if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) + return 0; + + ppp_notice("ipv6_demand_conf"); + ppp_notice("local LL address %s", llv6_ntoa(wo->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(wo->hisid)); + + return 1; +} +#endif /* DEMAND_SUPPORT */ + + +/* + * ipv6cp_up - IPV6CP has come UP. + * + * Configure the IPv6 network interface appropriately and bring it up. + */ +static void ipv6cp_up(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *wo = &pcb->ipv6cp_wantoptions; + ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + + IPV6CPDEBUG(("ipv6cp: up")); + + /* + * We must have a non-zero LL address for both ends of the link. + */ + if (!ho->neg_ifaceid) + ho->hisid = wo->hisid; + +#if 0 /* UNUSED */ + if(!no_ifaceid_neg) { +#endif /* UNUSED */ + if (eui64_iszero(ho->hisid)) { + ppp_error("Could not determine remote LL address"); + ipv6cp_close(f->pcb, "Could not determine remote LL address"); + return; + } + if (eui64_iszero(go->ourid)) { + ppp_error("Could not determine local LL address"); + ipv6cp_close(f->pcb, "Could not determine local LL address"); + return; + } + if (eui64_equals(go->ourid, ho->hisid)) { + ppp_error("local and remote LL addresses are equal"); + ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); + return; + } +#if 0 /* UNUSED */ + } +#endif /* UNUSED */ +#if 0 /* UNUSED */ + script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 0); + script_setenv("LLREMOTE", llv6_ntoa(ho->hisid), 0); +#endif /* UNUSED */ + +#ifdef IPV6CP_COMP + /* set tcp compression */ + sif6comp(f->unit, ho->neg_vj); +#endif + +#if DEMAND_SUPPORT + /* + * If we are doing dial-on-demand, the interface is already + * configured, so we put out any saved-up packets, then set the + * interface to pass IPv6 packets. + */ + if (demand) { + if (! eui64_equals(go->ourid, wo->ourid) || + ! eui64_equals(ho->hisid, wo->hisid)) { + if (! eui64_equals(go->ourid, wo->ourid)) + warn("Local LL address changed to %s", + llv6_ntoa(go->ourid)); + if (! eui64_equals(ho->hisid, wo->hisid)) + warn("Remote LL address changed to %s", + llv6_ntoa(ho->hisid)); + ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); + + /* Set the interface to the new addresses */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + if (debug) + warn("sif6addr failed"); + ipv6cp_close(f->unit, "Interface configuration failed"); + return; + } + + } + demand_rexmit(PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); + + } else +#endif /* DEMAND_SUPPORT */ + { + /* + * Set LL addresses + */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } + + /* bring the interface up for IPv6 */ + if (!sif6up(f->pcb)) { + PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } +#if DEMAND_SUPPORT + sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); +#endif /* DEMAND_SUPPORT */ + + ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); + } + + np_up(f->pcb, PPP_IPV6); + pcb->ipv6cp_is_up = 1; + +#if 0 /* UNUSED */ + /* + * Execute the ipv6-up script, like this: + * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL + */ + if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } +#endif /* UNUSED */ +} + + +/* + * ipv6cp_down - IPV6CP has gone DOWN. + * + * Take the IPv6 network interface down, clear its addresses + * and delete routes through it. + */ +static void ipv6cp_down(fsm *f) { + ppp_pcb *pcb = f->pcb; + ipv6cp_options *go = &pcb->ipv6cp_gotoptions; + ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; + + IPV6CPDEBUG(("ipv6cp: down")); +#if PPP_STATS_SUPPORT + update_link_stats(f->unit); +#endif /* PPP_STATS_SUPPORT */ + if (pcb->ipv6cp_is_up) { + pcb->ipv6cp_is_up = 0; + np_down(f->pcb, PPP_IPV6); + } +#ifdef IPV6CP_COMP + sif6comp(f->unit, 0); +#endif + +#if DEMAND_SUPPORT + /* + * If we are doing dial-on-demand, set the interface + * to queue up outgoing packets (for now). + */ + if (demand) { + sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); + } else +#endif /* DEMAND_SUPPORT */ + { +#if DEMAND_SUPPORT + sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); +#endif /* DEMAND_SUPPORT */ + ipv6cp_clear_addrs(f->pcb, + go->ourid, + ho->hisid); + sif6down(f->pcb); + } + +#if 0 /* UNUSED */ + /* Execute the ipv6-down script */ + if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } +#endif /* UNUSED */ +} + + +/* + * ipv6cp_clear_addrs() - clear the interface addresses, routes, + * proxy neighbour discovery entries, etc. + */ +static void ipv6cp_clear_addrs(ppp_pcb *pcb, eui64_t ourid, eui64_t hisid) { + cif6addr(pcb, ourid, hisid); +} + + +/* + * ipv6cp_finished - possibly shut down the lower layers. + */ +static void ipv6cp_finished(fsm *f) { + np_finished(f->pcb, PPP_IPV6); +} + + +#if 0 /* UNUSED */ +/* + * ipv6cp_script_done - called when the ipv6-up or ipv6-down script + * has finished. + */ +static void +ipv6cp_script_done(arg) + void *arg; +{ + ipv6cp_script_pid = 0; + switch (ipv6cp_script_state) { + case s_up: + if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } + break; + case s_down: + if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } + break; + } +} + + +/* + * ipv6cp_script - Execute a script with arguments + * interface-name tty-name speed local-LL remote-LL. + */ +static void +ipv6cp_script(script) + char *script; +{ + char strspeed[32], strlocal[32], strremote[32]; + char *argv[8]; + + sprintf(strspeed, "%d", baud_rate); + strcpy(strlocal, llv6_ntoa(ipv6cp_gotoptions[0].ourid)); + strcpy(strremote, llv6_ntoa(ipv6cp_hisoptions[0].hisid)); + + argv[0] = script; + argv[1] = ifname; + argv[2] = devnam; + argv[3] = strspeed; + argv[4] = strlocal; + argv[5] = strremote; + argv[6] = ipparam; + argv[7] = NULL; + + ipv6cp_script_pid = run_program(script, argv, 0, ipv6cp_script_done, + NULL, 0); +} +#endif /* UNUSED */ + +#if PRINTPKT_SUPPORT +/* + * ipv6cp_printpkt - print the contents of an IPV6CP packet. + */ +static const char* const ipv6cp_codenames[] = { + "ConfReq", "ConfAck", "ConfNak", "ConfRej", + "TermReq", "TermAck", "CodeRej" +}; + +static int ipv6cp_printpkt(const u_char *p, int plen, + void (*printer)(void *, const char *, ...), void *arg) { + int code, id, len, olen; + const u_char *pstart, *optend; +#ifdef IPV6CP_COMP + u_short cishort; +#endif /* IPV6CP_COMP */ + eui64_t ifaceid; + + if (plen < HEADERLEN) + return 0; + pstart = p; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < HEADERLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipv6cp_codenames)) + printer(arg, " %s", ipv6cp_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= HEADERLEN; + switch (code) { + case CONFREQ: + case CONFACK: + case CONFNAK: + case CONFREJ: + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { +#ifdef IPV6CP_COMP + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + printer(arg, "0x%x", cishort); + } + break; +#endif /* IPV6CP_COMP */ + case CI_IFACEID: + if (olen == CILEN_IFACEID) { + p += 2; + eui64_get(ifaceid, p); + printer(arg, "addr %s", llv6_ntoa(ifaceid)); + } + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; + + case TERMACK: + case TERMREQ: + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; + default: + break; + } + + /* print the rest of the bytes in the packet */ + for (; len > 0; --len) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + + return p - pstart; +} +#endif /* PRINTPKT_SUPPORT */ + +#if DEMAND_SUPPORT +/* + * ipv6_active_pkt - see if this IP packet is worth bringing the link up for. + * We don't bring the link up for IP fragments or for TCP FIN packets + * with no data. + */ +#define IP6_HDRLEN 40 /* bytes */ +#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 + +/* + * We use these macros because the IP header may be at an odd address, + * and some compilers might use word loads to get th_off or ip_hl. + */ + +#define get_ip6nh(x) (((unsigned char *)(x))[6]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) + +static int ipv6_active_pkt(u_char *pkt, int len) { + u_char *tcp; + + len -= PPP_HDRLEN; + pkt += PPP_HDRLEN; + if (len < IP6_HDRLEN) + return 0; + if (get_ip6nh(pkt) == IP6_NHDR_FRAG) + return 0; + if (get_ip6nh(pkt) != IPPROTO_TCP) + return 1; + if (len < IP6_HDRLEN + TCP_HDRLEN) + return 0; + tcp = pkt + IP6_HDRLEN; + if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == IP6_HDRLEN + get_tcpoff(tcp) * 4) + return 0; + return 1; +} +#endif /* DEMAND_SUPPORT */ + +#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/lcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/lcp.c new file mode 100644 index 0000000..90ed183 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/lcp.c @@ -0,0 +1,2790 @@ +/* + * lcp.c - PPP Link Control Protocol. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +/* + * @todo: + */ + +#if 0 /* UNUSED */ +#include +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/lcp.h" +#if CHAP_SUPPORT +#include "netif/ppp/chap-new.h" +#endif /* CHAP_SUPPORT */ +#include "netif/ppp/magic.h" + +/* + * When the link comes up we want to be able to wait for a short while, + * or until seeing some input from the peer, before starting to send + * configure-requests. We do this by delaying the fsm_lowerup call. + */ +/* steal a bit in fsm flags word */ +#define DELAYED_UP 0x80 + +static void lcp_delayed_up(void *arg); + +/* + * LCP-related command-line options. + */ +#if 0 /* UNUSED */ +int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ +int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +/* options */ +static u_int lcp_echo_interval = LCP_ECHOINTERVAL; /* Interval between LCP echo-requests */ +static u_int lcp_echo_fails = LCP_MAXECHOFAILS; /* Tolerance to unanswered echo-requests */ +#endif /* UNUSED */ + +#if 0 /* UNUSED */ +#if PPP_LCP_ADAPTIVE +bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ +#endif +bool lax_recv = 0; /* accept control chars in asyncmap */ +bool noendpoint = 0; /* don't send/accept endpoint discriminator */ +#endif /* UNUSED */ + +#if PPP_OPTIONS +static int noopt (char **); +#endif /* PPP_OPTIONS */ + +#ifdef HAVE_MULTILINK +static int setendpoint (char **); +static void printendpoint (option_t *, void (*)(void *, char *, ...), + void *); +#endif /* HAVE_MULTILINK */ + +#if PPP_OPTIONS +static option_t lcp_option_list[] = { + /* LCP options */ + { "-all", o_special_noarg, (void *)noopt, + "Don't request/allow any LCP options" }, + + { "noaccomp", o_bool, &lcp_wantoptions[0].neg_accompression, + "Disable address/control compression", + OPT_A2CLR, &lcp_allowoptions[0].neg_accompression }, + { "-ac", o_bool, &lcp_wantoptions[0].neg_accompression, + "Disable address/control compression", + OPT_ALIAS | OPT_A2CLR, &lcp_allowoptions[0].neg_accompression }, + + { "asyncmap", o_uint32, &lcp_wantoptions[0].asyncmap, + "Set asyncmap (for received packets)", + OPT_OR, &lcp_wantoptions[0].neg_asyncmap }, + { "-as", o_uint32, &lcp_wantoptions[0].asyncmap, + "Set asyncmap (for received packets)", + OPT_ALIAS | OPT_OR, &lcp_wantoptions[0].neg_asyncmap }, + { "default-asyncmap", o_uint32, &lcp_wantoptions[0].asyncmap, + "Disable asyncmap negotiation", + OPT_OR | OPT_NOARG | OPT_VAL(~0U) | OPT_A2CLR, + &lcp_allowoptions[0].neg_asyncmap }, + { "-am", o_uint32, &lcp_wantoptions[0].asyncmap, + "Disable asyncmap negotiation", + OPT_ALIAS | OPT_OR | OPT_NOARG | OPT_VAL(~0U) | OPT_A2CLR, + &lcp_allowoptions[0].neg_asyncmap }, + + { "nomagic", o_bool, &lcp_wantoptions[0].neg_magicnumber, + "Disable magic number negotiation (looped-back line detection)", + OPT_A2CLR, &lcp_allowoptions[0].neg_magicnumber }, + { "-mn", o_bool, &lcp_wantoptions[0].neg_magicnumber, + "Disable magic number negotiation (looped-back line detection)", + OPT_ALIAS | OPT_A2CLR, &lcp_allowoptions[0].neg_magicnumber }, + + { "mru", o_int, &lcp_wantoptions[0].mru, + "Set MRU (maximum received packet size) for negotiation", + OPT_PRIO, &lcp_wantoptions[0].neg_mru }, + { "default-mru", o_bool, &lcp_wantoptions[0].neg_mru, + "Disable MRU negotiation (use default 1500)", + OPT_PRIOSUB | OPT_A2CLR, &lcp_allowoptions[0].neg_mru }, + { "-mru", o_bool, &lcp_wantoptions[0].neg_mru, + "Disable MRU negotiation (use default 1500)", + OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR, &lcp_allowoptions[0].neg_mru }, + + { "mtu", o_int, &lcp_allowoptions[0].mru, + "Set our MTU", OPT_LIMITS, NULL, MAXMRU, MINMRU }, + + { "nopcomp", o_bool, &lcp_wantoptions[0].neg_pcompression, + "Disable protocol field compression", + OPT_A2CLR, &lcp_allowoptions[0].neg_pcompression }, + { "-pc", o_bool, &lcp_wantoptions[0].neg_pcompression, + "Disable protocol field compression", + OPT_ALIAS | OPT_A2CLR, &lcp_allowoptions[0].neg_pcompression }, + + { "passive", o_bool, &lcp_wantoptions[0].passive, + "Set passive mode", 1 }, + { "-p", o_bool, &lcp_wantoptions[0].passive, + "Set passive mode", OPT_ALIAS | 1 }, + + { "silent", o_bool, &lcp_wantoptions[0].silent, + "Set silent mode", 1 }, + + { "lcp-echo-failure", o_int, &lcp_echo_fails, + "Set number of consecutive echo failures to indicate link failure", + OPT_PRIO }, + { "lcp-echo-interval", o_int, &lcp_echo_interval, + "Set time in seconds between LCP echo requests", OPT_PRIO }, +#if PPP_LCP_ADAPTIVE + { "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive, + "Suppress LCP echo requests if traffic was received", 1 }, +#endif + { "lcp-restart", o_int, &lcp_fsm[0].timeouttime, + "Set time in seconds between LCP retransmissions", OPT_PRIO }, + { "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits, + "Set maximum number of LCP terminate-request transmissions", OPT_PRIO }, + { "lcp-max-configure", o_int, &lcp_fsm[0].maxconfreqtransmits, + "Set maximum number of LCP configure-request transmissions", OPT_PRIO }, + { "lcp-max-failure", o_int, &lcp_fsm[0].maxnakloops, + "Set limit on number of LCP configure-naks", OPT_PRIO }, + + { "receive-all", o_bool, &lax_recv, + "Accept all received control characters", 1 }, + +#ifdef HAVE_MULTILINK + { "mrru", o_int, &lcp_wantoptions[0].mrru, + "Maximum received packet size for multilink bundle", + OPT_PRIO, &lcp_wantoptions[0].neg_mrru }, + + { "mpshortseq", o_bool, &lcp_wantoptions[0].neg_ssnhf, + "Use short sequence numbers in multilink headers", + OPT_PRIO | 1, &lcp_allowoptions[0].neg_ssnhf }, + { "nompshortseq", o_bool, &lcp_wantoptions[0].neg_ssnhf, + "Don't use short sequence numbers in multilink headers", + OPT_PRIOSUB | OPT_A2CLR, &lcp_allowoptions[0].neg_ssnhf }, + + { "endpoint", o_special, (void *) setendpoint, + "Endpoint discriminator for multilink", + OPT_PRIO | OPT_A2PRINTER, (void *) printendpoint }, +#endif /* HAVE_MULTILINK */ + + { "noendpoint", o_bool, &noendpoint, + "Don't send or accept multilink endpoint discriminator", 1 }, + + {NULL} +}; +#endif /* PPP_OPTIONS */ + +/* + * Callbacks for fsm code. (CI = Configuration Information) + */ +static void lcp_resetci(fsm *f); /* Reset our CI */ +static int lcp_cilen(fsm *f); /* Return length of our CI */ +static void lcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI to pkt */ +static int lcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ +static int lcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree); /* Rcv peer CI */ +static void lcp_up(fsm *f); /* We're UP */ +static void lcp_down(fsm *f); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ +static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len); +static void lcp_rprotrej(fsm *f, u_char *inp, int len); + +/* + * routines to send LCP echos to peer + */ + +static void lcp_echo_lowerup(ppp_pcb *pcb); +static void lcp_echo_lowerdown(ppp_pcb *pcb); +static void LcpEchoTimeout(void *arg); +static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len); +static void LcpSendEchoRequest(fsm *f); +static void LcpLinkFailure(fsm *f); +static void LcpEchoCheck(fsm *f); + +static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ + lcp_resetci, /* Reset our Configuration Information */ + lcp_cilen, /* Length of our Configuration Information */ + lcp_addci, /* Add our Configuration Information */ + lcp_ackci, /* ACK our Configuration Information */ + lcp_nakci, /* NAK our Configuration Information */ + lcp_rejci, /* Reject our Configuration Information */ + lcp_reqci, /* Request peer's Configuration Information */ + lcp_up, /* Called when fsm reaches OPENED state */ + lcp_down, /* Called when fsm leaves OPENED state */ + lcp_starting, /* Called when we want the lower layer up */ + lcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + lcp_extcode, /* Called to handle LCP-specific codes */ + "LCP" /* String name of protocol */ +}; + +/* + * Protocol entry points. + * Some of these are called directly. + */ + +static void lcp_init(ppp_pcb *pcb); +static void lcp_input(ppp_pcb *pcb, u_char *p, int len); +static void lcp_protrej(ppp_pcb *pcb); +#if PRINTPKT_SUPPORT +static int lcp_printpkt(const u_char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ + +const struct protent lcp_protent = { + PPP_LCP, + lcp_init, + lcp_input, + lcp_protrej, + lcp_lowerup, + lcp_lowerdown, + lcp_open, + lcp_close, +#if PRINTPKT_SUPPORT + lcp_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "LCP", + NULL, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + lcp_option_list, + NULL, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, + NULL +#endif /* DEMAND_SUPPORT */ +}; + +/* + * Length of each type of configuration option (in octets) + */ +#define CILEN_VOID 2 +#define CILEN_CHAR 3 +#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ +#if CHAP_SUPPORT +#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ +#endif /* CHAP_SUPPORT */ +#define CILEN_LONG 6 /* CILEN_VOID + 4 */ +#if LQR_SUPPORT +#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ +#endif /* LQR_SUPPORT */ +#define CILEN_CBCP 3 + +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") + +#if PPP_OPTIONS +/* + * noopt - Disable all options (why?). + */ +static int +noopt(argv) + char **argv; +{ + BZERO((char *) &lcp_wantoptions[0], sizeof (struct lcp_options)); + BZERO((char *) &lcp_allowoptions[0], sizeof (struct lcp_options)); + + return (1); +} +#endif /* PPP_OPTIONS */ + +#ifdef HAVE_MULTILINK +static int +setendpoint(argv) + char **argv; +{ + if (str_to_epdisc(&lcp_wantoptions[0].endpoint, *argv)) { + lcp_wantoptions[0].neg_endpoint = 1; + return 1; + } + option_error("Can't parse '%s' as an endpoint discriminator", *argv); + return 0; +} + +static void +printendpoint(opt, printer, arg) + option_t *opt; + void (*printer) (void *, char *, ...); + void *arg; +{ + printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); +} +#endif /* HAVE_MULTILINK */ + +/* + * lcp_init - Initialize LCP. + */ +static void lcp_init(ppp_pcb *pcb) { + fsm *f = &pcb->lcp_fsm; + lcp_options *wo = &pcb->lcp_wantoptions; + lcp_options *ao = &pcb->lcp_allowoptions; + + f->pcb = pcb; + f->protocol = PPP_LCP; + f->callbacks = &lcp_callbacks; + + fsm_init(f); + + BZERO(wo, sizeof(*wo)); + wo->neg_mru = 1; + wo->mru = PPP_DEFMRU; + wo->neg_asyncmap = 1; + wo->neg_magicnumber = 1; + wo->neg_pcompression = 1; + wo->neg_accompression = 1; + + BZERO(ao, sizeof(*ao)); + ao->neg_mru = 1; + ao->mru = PPP_MAXMRU; + ao->neg_asyncmap = 1; +#if CHAP_SUPPORT + ao->neg_chap = 1; + ao->chap_mdtype = CHAP_MDTYPE_SUPPORTED; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + ao->neg_upap = 1; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + ao->neg_eap = 1; +#endif /* EAP_SUPPORT */ + ao->neg_magicnumber = 1; + ao->neg_pcompression = 1; + ao->neg_accompression = 1; + ao->neg_endpoint = 1; +} + + +/* + * lcp_open - LCP is allowed to come up. + */ +void lcp_open(ppp_pcb *pcb) { + fsm *f = &pcb->lcp_fsm; + lcp_options *wo = &pcb->lcp_wantoptions; + + f->flags &= ~(OPT_PASSIVE | OPT_SILENT); + if (wo->passive) + f->flags |= OPT_PASSIVE; + if (wo->silent) + f->flags |= OPT_SILENT; + fsm_open(f); +} + + +/* + * lcp_close - Take LCP down. + */ +void lcp_close(ppp_pcb *pcb, const char *reason) { + fsm *f = &pcb->lcp_fsm; + int oldstate; + + if (pcb->phase != PPP_PHASE_DEAD +#ifdef HAVE_MULTILINK + && pcb->phase != PPP_PHASE_MASTER +#endif /* HAVE_MULTILINK */ + ) + new_phase(pcb, PPP_PHASE_TERMINATE); + + if (f->flags & DELAYED_UP) { + UNTIMEOUT(lcp_delayed_up, f); + f->state = PPP_FSM_STOPPED; + } + oldstate = f->state; + + fsm_close(f, reason); + if (oldstate == PPP_FSM_STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. + */ + f->flags &= ~DELAYED_UP; + lcp_finished(f); + } +} + + +/* + * lcp_lowerup - The lower layer is up. + */ +void lcp_lowerup(ppp_pcb *pcb) { + lcp_options *wo = &pcb->lcp_wantoptions; + fsm *f = &pcb->lcp_fsm; + /* + * Don't use A/C or protocol compression on transmission, + * but accept A/C and protocol compressed packets + * if we are going to ask for A/C and protocol compression. + */ + if (ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0) < 0 + || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), + wo->neg_pcompression, wo->neg_accompression) < 0) + return; + pcb->peer_mru = PPP_MRU; + + if (pcb->settings.listen_time != 0) { + f->flags |= DELAYED_UP; + TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); + } else + fsm_lowerup(f); +} + + +/* + * lcp_lowerdown - The lower layer is down. + */ +void lcp_lowerdown(ppp_pcb *pcb) { + fsm *f = &pcb->lcp_fsm; + + if (f->flags & DELAYED_UP) { + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + } else + fsm_lowerdown(f); +} + + +/* + * lcp_delayed_up - Bring the lower layer up now. + */ +static void lcp_delayed_up(void *arg) { + fsm *f = (fsm*)arg; + + if (f->flags & DELAYED_UP) { + f->flags &= ~DELAYED_UP; + fsm_lowerup(f); + } +} + + +/* + * lcp_input - Input LCP packet. + */ +static void lcp_input(ppp_pcb *pcb, u_char *p, int len) { + fsm *f = &pcb->lcp_fsm; + + if (f->flags & DELAYED_UP) { + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + fsm_lowerup(f); + } + fsm_input(f, p, len); +} + +/* + * lcp_extcode - Handle a LCP-specific code. + */ +static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u_char *magp; + + switch( code ){ + case PROTREJ: + lcp_rprotrej(f, inp, len); + break; + + case ECHOREQ: + if (f->state != PPP_FSM_OPENED) + break; + magp = inp; + PUTLONG(go->magicnumber, magp); + fsm_sdata(f, ECHOREP, id, inp, len); + break; + + case ECHOREP: + lcp_received_echo_reply(f, id, inp, len); + break; + + case DISCREQ: + case IDENTIF: + case TIMEREM: + break; + + default: + return 0; + } + return 1; +} + + +/* + * lcp_rprotrej - Receive an Protocol-Reject. + * + * Figure out which protocol is rejected and inform it. + */ +static void lcp_rprotrej(fsm *f, u_char *inp, int len) { + int i; + const struct protent *protp; + u_short prot; +#if PPP_PROTOCOLNAME + const char *pname; +#endif /* PPP_PROTOCOLNAME */ + + if (len < 2) { + LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); + return; + } + + GETSHORT(prot, inp); + + /* + * Protocol-Reject packets received in any state other than the LCP + * OPENED state SHOULD be silently discarded. + */ + if( f->state != PPP_FSM_OPENED ){ + LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); + return; + } + +#if PPP_PROTOCOLNAME + pname = protocol_name(prot); +#endif /* PPP_PROTOCOLNAME */ + + /* + * Upcall the proper Protocol-Reject routine. + */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol == prot) { +#if PPP_PROTOCOLNAME + if (pname != NULL) + ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, + prot); + else +#endif /* PPP_PROTOCOLNAME */ + ppp_dbglog("Protocol-Reject for 0x%x received", prot); + (*protp->protrej)(f->pcb); + return; + } + +#if PPP_PROTOCOLNAME + if (pname != NULL) + ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, + prot); + else +#endif /* #if PPP_PROTOCOLNAME */ + ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); +} + + +/* + * lcp_protrej - A Protocol-Reject was received. + */ +/*ARGSUSED*/ +static void lcp_protrej(ppp_pcb *pcb) { + /* + * Can't reject LCP! + */ + ppp_error("Received Protocol-Reject for LCP!"); + fsm_protreject(&pcb->lcp_fsm); +} + + +/* + * lcp_sprotrej - Send a Protocol-Reject for some protocol. + */ +void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len) { + fsm *f = &pcb->lcp_fsm; + /* + * Send back the protocol and the information field of the + * rejected packet. We only get here if LCP is in the OPENED state. + */ +#if 0 + p += 2; + len -= 2; +#endif + + fsm_sdata(f, PROTREJ, ++f->id, + p, len); +} + + +/* + * lcp_resetci - Reset our CI. + */ +static void lcp_resetci(fsm *f) { + ppp_pcb *pcb = f->pcb; + lcp_options *wo = &pcb->lcp_wantoptions; + lcp_options *go = &pcb->lcp_gotoptions; + lcp_options *ao = &pcb->lcp_allowoptions; + +#if PPP_AUTH_SUPPORT + + /* note: default value is true for allow options */ + if (pcb->settings.user && pcb->settings.passwd) { +#if PAP_SUPPORT + if (pcb->settings.refuse_pap) { + ao->neg_upap = 0; + } +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + if (pcb->settings.refuse_chap) { + ao->chap_mdtype &= ~MDTYPE_MD5; + } +#if MSCHAP_SUPPORT + if (pcb->settings.refuse_mschap) { + ao->chap_mdtype &= ~MDTYPE_MICROSOFT; + } + if (pcb->settings.refuse_mschap_v2) { + ao->chap_mdtype &= ~MDTYPE_MICROSOFT_V2; + } +#endif /* MSCHAP_SUPPORT */ + ao->neg_chap = (ao->chap_mdtype != MDTYPE_NONE); +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + if (pcb->settings.refuse_eap) { + ao->neg_eap = 0; + } +#endif /* EAP_SUPPORT */ + +#if PPP_SERVER + /* note: default value is false for wanted options */ + if (pcb->settings.auth_required) { +#if PAP_SUPPORT + if (!pcb->settings.refuse_pap) { + wo->neg_upap = 1; + } +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + if (!pcb->settings.refuse_chap) { + wo->chap_mdtype |= MDTYPE_MD5; + } +#if MSCHAP_SUPPORT + if (!pcb->settings.refuse_mschap) { + wo->chap_mdtype |= MDTYPE_MICROSOFT; + } + if (!pcb->settings.refuse_mschap_v2) { + wo->chap_mdtype |= MDTYPE_MICROSOFT_V2; + } +#endif /* MSCHAP_SUPPORT */ + wo->neg_chap = (wo->chap_mdtype != MDTYPE_NONE); +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + if (!pcb->settings.refuse_eap) { + wo->neg_eap = 1; + } +#endif /* EAP_SUPPORT */ + } +#endif /* PPP_SERVER */ + + } else { +#if PAP_SUPPORT + ao->neg_upap = 0; +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + ao->neg_chap = 0; + ao->chap_mdtype = MDTYPE_NONE; +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + ao->neg_eap = 0; +#endif /* EAP_SUPPORT */ + } + + PPPDEBUG(LOG_DEBUG, ("ppp: auth protocols:")); +#if PAP_SUPPORT + PPPDEBUG(LOG_DEBUG, (" PAP=%d", ao->neg_upap)); +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + PPPDEBUG(LOG_DEBUG, (" CHAP=%d CHAP_MD5=%d", ao->neg_chap, !!(ao->chap_mdtype&MDTYPE_MD5))); +#if MSCHAP_SUPPORT + PPPDEBUG(LOG_DEBUG, (" CHAP_MS=%d CHAP_MS2=%d", !!(ao->chap_mdtype&MDTYPE_MICROSOFT), !!(ao->chap_mdtype&MDTYPE_MICROSOFT_V2))); +#endif /* MSCHAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + PPPDEBUG(LOG_DEBUG, (" EAP=%d", ao->neg_eap)); +#endif /* EAP_SUPPORT */ + PPPDEBUG(LOG_DEBUG, ("\n")); + +#endif /* PPP_AUTH_SUPPORT */ + + wo->magicnumber = magic(); + wo->numloops = 0; + *go = *wo; +#ifdef HAVE_MULTILINK + if (!multilink) { + go->neg_mrru = 0; +#endif /* HAVE_MULTILINK */ + go->neg_ssnhf = 0; + go->neg_endpoint = 0; +#ifdef HAVE_MULTILINK + } +#endif /* HAVE_MULTILINK */ + if (pcb->settings.noendpoint) + ao->neg_endpoint = 0; + pcb->peer_mru = PPP_MRU; +#if 0 /* UNUSED */ + auth_reset(pcb); +#endif /* UNUSED */ +} + + +/* + * lcp_cilen - Return length of our CI. + */ +static int lcp_cilen(fsm *f) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + +#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) +#if CHAP_SUPPORT +#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) +#endif /* CHAP_SUPPORT */ +#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) +#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) +#if LQR_SUPPORT +#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) +#endif /* LQR_SUPPORT */ +#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) + /* + * NB: we only ask for one of CHAP, UPAP, or EAP, even if we will + * accept more than one. We prefer EAP first, then CHAP, then + * PAP. + */ + return (LENCISHORT(go->neg_mru && go->mru != PPP_DEFMRU) + + LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + +#if EAP_SUPPORT + LENCISHORT(go->neg_eap) + +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT + LENCICHAP(!go->neg_eap && go->neg_chap) + +#endif /* EAP_SUPPORT */ +#if !EAP_SUPPORT + LENCICHAP(go->neg_chap) + +#endif /* !EAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT && CHAP_SUPPORT + LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + +#endif /* EAP_SUPPORT && CHAP_SUPPORT */ +#if EAP_SUPPORT && !CHAP_SUPPORT + LENCISHORT(!go->neg_eap && go->neg_upap) + +#endif /* EAP_SUPPORT && !CHAP_SUPPORT */ +#if !EAP_SUPPORT && CHAP_SUPPORT + LENCISHORT(!go->neg_chap && go->neg_upap) + +#endif /* !EAP_SUPPORT && CHAP_SUPPORT */ +#if !EAP_SUPPORT && !CHAP_SUPPORT + LENCISHORT(go->neg_upap) + +#endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ +#endif /* PAP_SUPPORT */ +#if LQR_SUPPORT + LENCILQR(go->neg_lqr) + +#endif /* LQR_SUPPORT */ + LENCICBCP(go->neg_cbcp) + + LENCILONG(go->neg_magicnumber) + + LENCIVOID(go->neg_pcompression) + + LENCIVOID(go->neg_accompression) + +#ifdef HAVE_MULTILINK + LENCISHORT(go->neg_mrru) + +#endif /* HAVE_MULTILINK */ + LENCIVOID(go->neg_ssnhf) + + (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); +} + + +/* + * lcp_addci - Add our desired CIs to a packet. + */ +static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u_char *start_ucp = ucp; + +#define ADDCIVOID(opt, neg) \ + if (neg) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_VOID, ucp); \ + } +#define ADDCISHORT(opt, neg, val) \ + if (neg) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_SHORT, ucp); \ + PUTSHORT(val, ucp); \ + } +#if CHAP_SUPPORT +#define ADDCICHAP(opt, neg, val) \ + if (neg) { \ + PUTCHAR((opt), ucp); \ + PUTCHAR(CILEN_CHAP, ucp); \ + PUTSHORT(PPP_CHAP, ucp); \ + PUTCHAR((CHAP_DIGEST(val)), ucp); \ + } +#endif /* CHAP_SUPPORT */ +#define ADDCILONG(opt, neg, val) \ + if (neg) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LONG, ucp); \ + PUTLONG(val, ucp); \ + } +#if LQR_SUPPORT +#define ADDCILQR(opt, neg, val) \ + if (neg) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LQR, ucp); \ + PUTSHORT(PPP_LQR, ucp); \ + PUTLONG(val, ucp); \ + } +#endif /* LQR_SUPPORT */ +#define ADDCICHAR(opt, neg, val) \ + if (neg) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR, ucp); \ + PUTCHAR(val, ucp); \ + } +#define ADDCIENDP(opt, neg, class, val, len) \ + if (neg) { \ + int i; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR + len, ucp); \ + PUTCHAR(class, ucp); \ + for (i = 0; i < len; ++i) \ + PUTCHAR(val[i], ucp); \ + } + + ADDCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); + ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, + go->asyncmap); +#if EAP_SUPPORT + ADDCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT + ADDCICHAP(CI_AUTHTYPE, !go->neg_eap && go->neg_chap, go->chap_mdtype); +#endif /* EAP_SUPPORT */ +#if !EAP_SUPPORT + ADDCICHAP(CI_AUTHTYPE, go->neg_chap, go->chap_mdtype); +#endif /* !EAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT && CHAP_SUPPORT + ADDCISHORT(CI_AUTHTYPE, !go->neg_eap && !go->neg_chap && go->neg_upap, PPP_PAP); +#endif /* EAP_SUPPORT && CHAP_SUPPORT */ +#if EAP_SUPPORT && !CHAP_SUPPORT + ADDCISHORT(CI_AUTHTYPE, !go->neg_eap && go->neg_upap, PPP_PAP); +#endif /* EAP_SUPPORT && !CHAP_SUPPORT */ +#if !EAP_SUPPORT && CHAP_SUPPORT + ADDCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP); +#endif /* !EAP_SUPPORT && CHAP_SUPPORT */ +#if !EAP_SUPPORT && !CHAP_SUPPORT + ADDCISHORT(CI_AUTHTYPE, go->neg_upap, PPP_PAP); +#endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ +#endif /* PAP_SUPPORT */ +#if LQR_SUPPORT + ADDCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period); +#endif /* LQR_SUPPORT */ + ADDCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT); + ADDCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber); + ADDCIVOID(CI_PCOMPRESSION, go->neg_pcompression); + ADDCIVOID(CI_ACCOMPRESSION, go->neg_accompression); +#ifdef HAVE_MULTILINK + ADDCISHORT(CI_MRRU, go->neg_mrru, go->mrru); +#endif + ADDCIVOID(CI_SSNHF, go->neg_ssnhf); + ADDCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, + go->endpoint.value, go->endpoint.length); + + if (ucp - start_ucp != *lenp) { + /* this should never happen, because peer_mtu should be 1500 */ + ppp_error("Bug in lcp_addci: wrong length"); + } +} + + +/* + * lcp_ackci - Ack our CIs. + * This should not modify any state if the Ack is bad. + * + * Returns: + * 0 - Ack was bad. + * 1 - Ack was good. + */ +static int lcp_ackci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u_char cilen, citype, cichar; + u_short cishort; + u32_t cilong; + + /* + * CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define ACKCIVOID(opt, neg) \ + if (neg) { \ + if ((len -= CILEN_VOID) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_VOID || \ + citype != opt) \ + goto bad; \ + } +#define ACKCISHORT(opt, neg, val) \ + if (neg) { \ + if ((len -= CILEN_SHORT) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_SHORT || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + } +#define ACKCICHAR(opt, neg, val) \ + if (neg) { \ + if ((len -= CILEN_CHAR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != val) \ + goto bad; \ + } +#if CHAP_SUPPORT +#define ACKCICHAP(opt, neg, val) \ + if (neg) { \ + if ((len -= CILEN_CHAP) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAP || \ + citype != (opt)) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_CHAP) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != (CHAP_DIGEST(val))) \ + goto bad; \ + } +#endif /* CHAP_SUPPORT */ +#define ACKCILONG(opt, neg, val) \ + if (neg) { \ + if ((len -= CILEN_LONG) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LONG || \ + citype != opt) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ + } +#if LQR_SUPPORT +#define ACKCILQR(opt, neg, val) \ + if (neg) { \ + if ((len -= CILEN_LQR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LQR || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_LQR) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ + } +#endif /* LQR_SUPPORT */ +#define ACKCIENDP(opt, neg, class, val, vlen) \ + if (neg) { \ + int i; \ + if ((len -= CILEN_CHAR + vlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR + vlen || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + } + + ACKCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); + ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, + go->asyncmap); +#if EAP_SUPPORT + ACKCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT + ACKCICHAP(CI_AUTHTYPE, !go->neg_eap && go->neg_chap, go->chap_mdtype); +#endif /* EAP_SUPPORT */ +#if !EAP_SUPPORT + ACKCICHAP(CI_AUTHTYPE, go->neg_chap, go->chap_mdtype); +#endif /* !EAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ +#if EAP_SUPPORT && CHAP_SUPPORT + ACKCISHORT(CI_AUTHTYPE, !go->neg_eap && !go->neg_chap && go->neg_upap, PPP_PAP); +#endif /* EAP_SUPPORT && CHAP_SUPPORT */ +#if EAP_SUPPORT && !CHAP_SUPPORT + ACKCISHORT(CI_AUTHTYPE, !go->neg_eap && go->neg_upap, PPP_PAP); +#endif /* EAP_SUPPORT && !CHAP_SUPPORT */ +#if !EAP_SUPPORT && CHAP_SUPPORT + ACKCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP); +#endif /* !EAP_SUPPORT && CHAP_SUPPORT */ +#if !EAP_SUPPORT && !CHAP_SUPPORT + ACKCISHORT(CI_AUTHTYPE, go->neg_upap, PPP_PAP); +#endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ +#endif /* PAP_SUPPORT */ +#if LQR_SUPPORT + ACKCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period); +#endif /* LQR_SUPPORT */ + ACKCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT); + ACKCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber); + ACKCIVOID(CI_PCOMPRESSION, go->neg_pcompression); + ACKCIVOID(CI_ACCOMPRESSION, go->neg_accompression); +#ifdef HAVE_MULTILINK + ACKCISHORT(CI_MRRU, go->neg_mrru, go->mrru); +#endif /* HAVE_MULTILINK */ + ACKCIVOID(CI_SSNHF, go->neg_ssnhf); + ACKCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, + go->endpoint.value, go->endpoint.length); + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + return (1); +bad: + LCPDEBUG(("lcp_acki: received bad Ack!")); + return (0); +} + + +/* + * lcp_nakci - Peer has sent a NAK for some of our CIs. + * This should not modify any state if the Nak is bad + * or if LCP is in the OPENED state. + * + * Returns: + * 0 - Nak was bad. + * 1 - Nak was good. + */ +static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + lcp_options *wo = &pcb->lcp_wantoptions; + u_char citype, cichar, *next; + u_short cishort; + u32_t cilong; + lcp_options no; /* options we've seen Naks for */ + lcp_options try_; /* options to request next time */ + int looped_back = 0; + int cilen; + + BZERO(&no, sizeof(no)); + try_ = *go; + + /* + * Any Nak'd CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define NAKCIVOID(opt, neg) \ + if (go->neg && \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + no.neg = 1; \ + try_.neg = 0; \ + } +#if CHAP_SUPPORT +#define NAKCICHAP(opt, neg, code) \ + if (go->neg && \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ + } +#endif /* CHAP_SUPPORT */ +#define NAKCICHAR(opt, neg, code) \ + if (go->neg && \ + len >= CILEN_CHAR && \ + p[1] == CILEN_CHAR && \ + p[0] == opt) { \ + len -= CILEN_CHAR; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ + } +#define NAKCISHORT(opt, neg, code) \ + if (go->neg && \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ + } +#define NAKCILONG(opt, neg, code) \ + if (go->neg && \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ + } +#if LQR_SUPPORT +#define NAKCILQR(opt, neg, code) \ + if (go->neg && \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ + } +#endif /* LQR_SUPPORT */ +#define NAKCIENDP(opt, neg) \ + if (go->neg && \ + len >= CILEN_CHAR && \ + p[0] == opt && \ + p[1] >= CILEN_CHAR && \ + p[1] <= len) { \ + len -= p[1]; \ + INCPTR(p[1], p); \ + no.neg = 1; \ + try_.neg = 0; \ + } + + /* + * NOTE! There must be no assignments to individual fields of *go in + * the code below. Any such assignment is a BUG! + */ + /* + * We don't care if they want to send us smaller packets than + * we want. Therefore, accept any MRU less than what we asked for, + * but then ignore the new value when setting the MRU in the kernel. + * If they send us a bigger MRU than what we asked, accept it, up to + * the limit of the default MRU we'd get if we didn't negotiate. + */ + if (go->neg_mru && go->mru != PPP_DEFMRU) { + NAKCISHORT(CI_MRU, neg_mru, + if (cishort <= wo->mru || cishort <= PPP_DEFMRU) + try_.mru = cishort; + ); + } + + /* + * Add any characters they want to our (receive-side) asyncmap. + */ + if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { + NAKCILONG(CI_ASYNCMAP, neg_asyncmap, + try_.asyncmap = go->asyncmap | cilong; + ); + } + + /* + * If they've nak'd our authentication-protocol, check whether + * they are proposing a different protocol, or a different + * hash algorithm for CHAP. + */ + if ((0 +#if CHAP_SUPPORT + || go->neg_chap +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + || go->neg_upap +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + || go->neg_eap +#endif /* EAP_SUPPORT */ + ) + && len >= CILEN_SHORT + && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { + cilen = p[1]; + len -= cilen; +#if CHAP_SUPPORT + no.neg_chap = go->neg_chap; +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + no.neg_upap = go->neg_upap; +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + no.neg_eap = go->neg_eap; +#endif /* EAP_SUPPORT */ + INCPTR(2, p); + GETSHORT(cishort, p); + +#if PAP_SUPPORT + if (cishort == PPP_PAP && cilen == CILEN_SHORT) { +#if EAP_SUPPORT + /* If we were asking for EAP, then we need to stop that. */ + if (go->neg_eap) + try_.neg_eap = 0; + else +#endif /* EAP_SUPPORT */ + +#if CHAP_SUPPORT + /* If we were asking for CHAP, then we need to stop that. */ + if (go->neg_chap) + try_.neg_chap = 0; + else +#endif /* CHAP_SUPPORT */ + + /* + * If we weren't asking for CHAP or EAP, then we were asking for + * PAP, in which case this Nak is bad. + */ + goto bad; + } else +#endif /* PAP_SUPPORT */ + +#if CHAP_SUPPORT + if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { + GETCHAR(cichar, p); +#if EAP_SUPPORT + /* Stop asking for EAP, if we were. */ + if (go->neg_eap) { + try_.neg_eap = 0; + /* Try to set up to use their suggestion, if possible */ + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else +#endif /* EAP_SUPPORT */ + if (go->neg_chap) { + /* + * We were asking for our preferred algorithm, they must + * want something different. + */ + if (cichar != CHAP_DIGEST(go->chap_mdtype)) { + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { + /* Use their suggestion if we support it ... */ + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else { + /* ... otherwise, try our next-preferred algorithm. */ + try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); + if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ + try_.neg_chap = 0; + } + } else { + /* + * Whoops, they Nak'd our algorithm of choice + * but then suggested it back to us. + */ + goto bad; + } + } else { + /* + * Stop asking for PAP if we were asking for it. + */ +#if PAP_SUPPORT + try_.neg_upap = 0; +#endif /* PAP_SUPPORT */ + } + + } else +#endif /* CHAP_SUPPORT */ + { + +#if EAP_SUPPORT + /* + * If we were asking for EAP, and they're Conf-Naking EAP, + * well, that's just strange. Nobody should do that. + */ + if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) + ppp_dbglog("Unexpected Conf-Nak for EAP"); + + /* + * We don't recognize what they're suggesting. + * Stop asking for what we were asking for. + */ + if (go->neg_eap) + try_.neg_eap = 0; + else +#endif /* EAP_SUPPORT */ + +#if CHAP_SUPPORT + if (go->neg_chap) + try_.neg_chap = 0; + else +#endif /* CHAP_SUPPORT */ + +#if PAP_SUPPORT + if(1) + try_.neg_upap = 0; + else +#endif /* PAP_SUPPORT */ + {} + + p += cilen - CILEN_SHORT; + } + } + +#if LQR_SUPPORT + /* + * If they can't cope with our link quality protocol, we'll have + * to stop asking for LQR. We haven't got any other protocol. + * If they Nak the reporting period, take their value XXX ? + */ + NAKCILQR(CI_QUALITY, neg_lqr, + if (cishort != PPP_LQR) + try_.neg_lqr = 0; + else + try_.lqr_period = cilong; + ); +#endif /* LQR_SUPPORT */ + + /* + * Only implementing CBCP...not the rest of the callback options + */ + NAKCICHAR(CI_CALLBACK, neg_cbcp, + try_.neg_cbcp = 0; + (void)cichar; /* if CHAP support is not compiled, cichar is set but not used, which makes some compilers complaining */ + ); + + /* + * Check for a looped-back line. + */ + NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, + try_.magicnumber = magic(); + looped_back = 1; + ); + + /* + * Peer shouldn't send Nak for protocol compression or + * address/control compression requests; they should send + * a Reject instead. If they send a Nak, treat it as a Reject. + */ + NAKCIVOID(CI_PCOMPRESSION, neg_pcompression); + NAKCIVOID(CI_ACCOMPRESSION, neg_accompression); + +#ifdef HAVE_MULTILINK + /* + * Nak for MRRU option - accept their value if it is smaller + * than the one we want. + */ + if (go->neg_mrru) { + NAKCISHORT(CI_MRRU, neg_mrru, + if (treat_as_reject) + try_.neg_mrru = 0; + else if (cishort <= wo->mrru) + try_.mrru = cishort; + ); + } +#else /* HAVE_MULTILINK */ + LWIP_UNUSED_ARG(treat_as_reject); +#endif /* HAVE_MULTILINK */ + + /* + * Nak for short sequence numbers shouldn't be sent, treat it + * like a reject. + */ + NAKCIVOID(CI_SSNHF, neg_ssnhf); + + /* + * Nak of the endpoint discriminator option is not permitted, + * treat it like a reject. + */ + NAKCIENDP(CI_EPDISC, neg_endpoint); + + /* + * There may be remaining CIs, if the peer is requesting negotiation + * on an option that we didn't include in our request packet. + * If we see an option that we requested, or one we've already seen + * in this packet, then this packet is bad. + * If we wanted to respond by starting to negotiate on the requested + * option(s), we could, but we don't, because except for the + * authentication type and quality protocol, if we are not negotiating + * an option, it is because we were told not to. + * For the authentication type, the Nak from the peer means + * `let me authenticate myself with you' which is a bit pointless. + * For the quality protocol, the Nak means `ask me to send you quality + * reports', but if we didn't ask for them, we don't want them. + * An option we don't recognize represents the peer asking to + * negotiate some option we don't support, so ignore it. + */ + while (len >= CILEN_VOID) { + GETCHAR(citype, p); + GETCHAR(cilen, p); + if (cilen < CILEN_VOID || (len -= cilen) < 0) + goto bad; + next = p + cilen - 2; + + switch (citype) { + case CI_MRU: + if ((go->neg_mru && go->mru != PPP_DEFMRU) + || no.neg_mru || cilen != CILEN_SHORT) + goto bad; + GETSHORT(cishort, p); + if (cishort < PPP_DEFMRU) { + try_.neg_mru = 1; + try_.mru = cishort; + } + break; + case CI_ASYNCMAP: + if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + || no.neg_asyncmap || cilen != CILEN_LONG) + goto bad; + break; + case CI_AUTHTYPE: + if (0 +#if CHAP_SUPPORT + || go->neg_chap || no.neg_chap +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + || go->neg_upap || no.neg_upap +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + || go->neg_eap || no.neg_eap +#endif /* EAP_SUPPORT */ + ) + goto bad; + break; + case CI_MAGICNUMBER: + if (go->neg_magicnumber || no.neg_magicnumber || + cilen != CILEN_LONG) + goto bad; + break; + case CI_PCOMPRESSION: + if (go->neg_pcompression || no.neg_pcompression + || cilen != CILEN_VOID) + goto bad; + break; + case CI_ACCOMPRESSION: + if (go->neg_accompression || no.neg_accompression + || cilen != CILEN_VOID) + goto bad; + break; +#if LQR_SUPPORT + case CI_QUALITY: + if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) + goto bad; + break; +#endif /* LQR_SUPPORT */ +#ifdef HAVE_MULTILINK + case CI_MRRU: + if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) + goto bad; + break; +#endif /* HAVE_MULTILINK */ + case CI_SSNHF: + if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) + goto bad; + try_.neg_ssnhf = 1; + break; + case CI_EPDISC: + if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) + goto bad; + break; + default: + break; + } + p = next; + } + + /* + * OK, the Nak is good. Now we can update state. + * If there are any options left we ignore them. + */ + if (f->state != PPP_FSM_OPENED) { + if (looped_back) { + if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { + ppp_notice("Serial line is looped back."); + pcb->err_code = PPPERR_LOOPBACK; + lcp_close(f->pcb, "Loopback detected"); + } + } else + try_.numloops = 0; + *go = try_; + } + + return 1; + +bad: + LCPDEBUG(("lcp_nakci: received bad Nak!")); + return 0; +} + + +/* + * lcp_rejci - Peer has Rejected some of our CIs. + * This should not modify any state if the Reject is bad + * or if LCP is in the OPENED state. + * + * Returns: + * 0 - Reject was bad. + * 1 - Reject was good. + */ +static int lcp_rejci(fsm *f, u_char *p, int len) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u_char cichar; + u_short cishort; + u32_t cilong; + lcp_options try_; /* options to request next time */ + + try_ = *go; + + /* + * Any Rejected CIs must be in exactly the same order that we sent. + * Check packet length and CI length at each step. + * If we find any deviations, then this packet is bad. + */ +#define REJCIVOID(opt, neg) \ + if (go->neg && \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + try_.neg = 0; \ + } +#define REJCISHORT(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ + } + +#if CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT +#define REJCICHAP(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = try_.neg_upap = 0; \ + } +#endif /* CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT */ + +#if CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT +#define REJCICHAP(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_upap = 0; \ + } +#endif /* CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT */ + +#if CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT +#define REJCICHAP(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = 0; \ + } +#endif /* CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT */ + +#if CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT +#define REJCICHAP(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + } +#endif /* CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT */ + +#define REJCILONG(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ + } +#if LQR_SUPPORT +#define REJCILQR(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cishort != PPP_LQR || cilong != val) \ + goto bad; \ + try_.neg = 0; \ + } +#endif /* LQR_SUPPORT */ +#define REJCICBCP(opt, neg, val) \ + if (go->neg && \ + len >= CILEN_CBCP && \ + p[1] == CILEN_CBCP && \ + p[0] == opt) { \ + len -= CILEN_CBCP; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if (cichar != val) \ + goto bad; \ + try_.neg = 0; \ + } +#define REJCIENDP(opt, neg, class, val, vlen) \ + if (go->neg && \ + len >= CILEN_CHAR + vlen && \ + p[0] == opt && \ + p[1] == CILEN_CHAR + vlen) { \ + int i; \ + len -= CILEN_CHAR + vlen; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + try_.neg = 0; \ + } + + REJCISHORT(CI_MRU, neg_mru, go->mru); + REJCILONG(CI_ASYNCMAP, neg_asyncmap, go->asyncmap); +#if EAP_SUPPORT + REJCISHORT(CI_AUTHTYPE, neg_eap, PPP_EAP); + if (!go->neg_eap) { +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT + REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); + if (!go->neg_chap) { +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + } +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + } +#endif /* EAP_SUPPORT */ +#if LQR_SUPPORT + REJCILQR(CI_QUALITY, neg_lqr, go->lqr_period); +#endif /* LQR_SUPPORT */ + REJCICBCP(CI_CALLBACK, neg_cbcp, CBCP_OPT); + REJCILONG(CI_MAGICNUMBER, neg_magicnumber, go->magicnumber); + REJCIVOID(CI_PCOMPRESSION, neg_pcompression); + REJCIVOID(CI_ACCOMPRESSION, neg_accompression); +#ifdef HAVE_MULTILINK + REJCISHORT(CI_MRRU, neg_mrru, go->mrru); +#endif /* HAVE_MULTILINK */ + REJCIVOID(CI_SSNHF, neg_ssnhf); + REJCIENDP(CI_EPDISC, neg_endpoint, go->endpoint.class_, + go->endpoint.value, go->endpoint.length); + + /* + * If there are any remaining CIs, then this packet is bad. + */ + if (len != 0) + goto bad; + /* + * Now we can update state. + */ + if (f->state != PPP_FSM_OPENED) + *go = try_; + return 1; + +bad: + LCPDEBUG(("lcp_rejci: received bad Reject!")); + return 0; +} + + +/* + * lcp_reqci - Check the peer's requested CIs and send appropriate response. + * + * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified + * appropriately. If reject_if_disagree is non-zero, doesn't return + * CONFNAK; returns CONFREJ if it can't return CONFACK. + * + * inp = Requested CIs + * lenp = Length of requested CIs + */ +static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + lcp_options *ho = &pcb->lcp_hisoptions; + lcp_options *ao = &pcb->lcp_allowoptions; + u_char *cip, *next; /* Pointer to current and next CIs */ + int cilen, citype, cichar; /* Parsed len, type, char value */ + u_short cishort; /* Parsed short value */ + u32_t cilong; /* Parse long value */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *rejp; /* Pointer to next char in reject frame */ + struct pbuf *nakp; /* Nak buffer */ + u_char *nakoutp; /* Pointer to next char in Nak frame */ + int l = *lenp; /* Length left */ + + /* + * Reset all his options. + */ + BZERO(ho, sizeof(*ho)); + + /* + * Process all his options. + */ + next = inp; + nakp = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == nakp) + return 0; + if(nakp->tot_len != nakp->len) { + pbuf_free(nakp); + return 0; + } + + nakoutp = (u_char*)nakp->payload; + rejp = inp; + while (l) { + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + LCPDEBUG(("lcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + citype = 0; + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_MRU: + if (!ao->neg_mru || /* Allow option? */ + cilen != CILEN_SHORT) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETSHORT(cishort, p); /* Parse MRU */ + + /* + * He must be able to receive at least our minimum. + * No need to check a maximum. If he sends a large number, + * we'll just ignore it. + */ + if (cishort < PPP_MINMRU) { + orc = CONFNAK; /* Nak CI */ + PUTCHAR(CI_MRU, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ + break; + } + ho->neg_mru = 1; /* Remember he sent MRU */ + ho->mru = cishort; /* And remember value */ + break; + + case CI_ASYNCMAP: + if (!ao->neg_asyncmap || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * Asyncmap must have set at least the bits + * which are set in lcp_allowoptions[unit].asyncmap. + */ + if ((ao->asyncmap & ~cilong) != 0) { + orc = CONFNAK; + PUTCHAR(CI_ASYNCMAP, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(ao->asyncmap | cilong, nakoutp); + break; + } + ho->neg_asyncmap = 1; + ho->asyncmap = cilong; + break; + + case CI_AUTHTYPE: + if (cilen < CILEN_SHORT || + !(0 +#if PAP_SUPPORT + || ao->neg_upap +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + || ao->neg_chap +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + || ao->neg_eap +#endif /* EAP_SUPPORT */ + )) { + /* + * Reject the option if we're not willing to authenticate. + */ + ppp_dbglog("No auth is possible"); + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + /* + * Authtype must be PAP, CHAP, or EAP. + * + * Note: if more than one of ao->neg_upap, ao->neg_chap, and + * ao->neg_eap are set, and the peer sends a Configure-Request + * with two or more authenticate-protocol requests, then we will + * reject the second request. + * Whether we end up doing CHAP, UPAP, or EAP depends then on + * the ordering of the CIs in the peer's Configure-Request. + */ + +#if PAP_SUPPORT + if (cishort == PPP_PAP) { + /* we've already accepted CHAP or EAP */ + if (0 +#if CHAP_SUPPORT + || ho->neg_chap +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + || ho->neg_eap +#endif /* EAP_SUPPORT */ + || cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_upap) { /* we don't want to do PAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); +#if EAP_SUPPORT + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else { +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + } +#endif /* EAP_SUPPORT */ + break; + } + ho->neg_upap = 1; + break; + } +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + if (cishort == PPP_CHAP) { + /* we've already accepted PAP or EAP */ + if ( +#if PAP_SUPPORT + ho->neg_upap || +#endif /* PAP_SUPPORT */ +#if EAP_SUPPORT + ho->neg_eap || +#endif /* EAP_SUPPORT */ + cilen != CILEN_CHAP) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_chap) { /* we don't want to do CHAP */ + orc = CONFNAK; /* NAK it and suggest EAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); +#if EAP_SUPPORT + if (ao->neg_eap) { + PUTSHORT(PPP_EAP, nakoutp); + } else +#endif /* EAP_SUPPORT */ +#if PAP_SUPPORT + if(1) { + PUTSHORT(PPP_PAP, nakoutp); + } + else +#endif /* PAP_SUPPORT */ + {} + break; + } + GETCHAR(cichar, p); /* get digest type */ + if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { + /* + * We can't/won't do the requested type, + * suggest something else. + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + break; + } + ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ + ho->neg_chap = 1; + break; + } +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + if (cishort == PPP_EAP) { + /* we've already accepted CHAP or PAP */ + if ( +#if CHAP_SUPPORT + ho->neg_chap || +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + ho->neg_upap || +#endif /* PAP_SUPPORT */ + cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_eap) { /* we don't want to do EAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); +#if CHAP_SUPPORT + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else +#endif /* PAP_SUPPORT */ + {} + break; + } + ho->neg_eap = 1; + break; + } +#endif /* EAP_SUPPORT */ + + /* + * We don't recognize the protocol they're asking for. + * Nak it with something we're willing to do. + * (At this point we know ao->neg_upap || ao->neg_chap || + * ao->neg_eap.) + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + +#if EAP_SUPPORT + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else +#endif /* EAP_SUPPORT */ +#if CHAP_SUPPORT + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else +#endif /* CHAP_SUPPORT */ +#if PAP_SUPPORT + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else +#endif /* PAP_SUPPORT */ + {} + break; + +#if LQR_SUPPORT + case CI_QUALITY: + if (!ao->neg_lqr || + cilen != CILEN_LQR) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + GETLONG(cilong, p); + + /* + * Check the protocol and the reporting period. + * XXX When should we Nak this, and what with? + */ + if (cishort != PPP_LQR) { + orc = CONFNAK; + PUTCHAR(CI_QUALITY, nakoutp); + PUTCHAR(CILEN_LQR, nakoutp); + PUTSHORT(PPP_LQR, nakoutp); + PUTLONG(ao->lqr_period, nakoutp); + break; + } + break; +#endif /* LQR_SUPPORT */ + + case CI_MAGICNUMBER: + if (!(ao->neg_magicnumber || go->neg_magicnumber) || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * He must have a different magic number. + */ + if (go->neg_magicnumber && + cilong == go->magicnumber) { + cilong = magic(); /* Don't put magic() inside macro! */ + orc = CONFNAK; + PUTCHAR(CI_MAGICNUMBER, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(cilong, nakoutp); + break; + } + ho->neg_magicnumber = 1; + ho->magicnumber = cilong; + break; + + + case CI_PCOMPRESSION: + if (!ao->neg_pcompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_pcompression = 1; + break; + + case CI_ACCOMPRESSION: + if (!ao->neg_accompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_accompression = 1; + break; + +#ifdef HAVE_MULTILINK + case CI_MRRU: + if (!ao->neg_mrru + || !multilink + || cilen != CILEN_SHORT) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + /* possibly should insist on a minimum/maximum MRRU here */ + ho->neg_mrru = 1; + ho->mrru = cishort; + break; +#endif /* HAVE_MULTILINK */ + + case CI_SSNHF: + if (!ao->neg_ssnhf +#ifdef HAVE_MULTILINK + || !multilink +#endif /* HAVE_MULTILINK */ + || cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_ssnhf = 1; + break; + + case CI_EPDISC: + if (!ao->neg_endpoint || + cilen < CILEN_CHAR || + cilen > CILEN_CHAR + MAX_ENDP_LEN) { + orc = CONFREJ; + break; + } + GETCHAR(cichar, p); + cilen -= CILEN_CHAR; + ho->neg_endpoint = 1; + ho->endpoint.class_ = cichar; + ho->endpoint.length = cilen; + MEMCPY(ho->endpoint.value, p, cilen); + INCPTR(cilen, p); + break; + + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + break; + } + +endswitch: + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree /* Getting fed up with sending NAKs? */ + && citype != CI_MAGICNUMBER) { + orc = CONFREJ; /* Get tough if so */ + } else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + rc = CONFNAK; + } + } + if (orc == CONFREJ) { /* Reject this CI */ + rc = CONFREJ; + if (cip != rejp) /* Need to move rejected CI? */ + MEMCPY(rejp, cip, cilen); /* Move it */ + INCPTR(cilen, rejp); /* Update output pointer */ + } + } + + /* + * If we wanted to send additional NAKs (for unsent CIs), the + * code would go here. The extra NAKs would go at *nakoutp. + * At present there are no cases where we want to ask the + * peer to negotiate an option. + */ + + switch (rc) { + case CONFACK: + *lenp = next - inp; + break; + case CONFNAK: + /* + * Copy the Nak'd options from the nak buffer to the caller's buffer. + */ + *lenp = nakoutp - (u_char*)nakp->payload; + MEMCPY(inp, nakp->payload, *lenp); + break; + case CONFREJ: + *lenp = rejp - inp; + break; + default: + break; + } + + pbuf_free(nakp); + LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); + return (rc); /* Return final code */ +} + + +/* + * lcp_up - LCP has come UP. + */ +static void lcp_up(fsm *f) { + ppp_pcb *pcb = f->pcb; + lcp_options *wo = &pcb->lcp_wantoptions; + lcp_options *ho = &pcb->lcp_hisoptions; + lcp_options *go = &pcb->lcp_gotoptions; + lcp_options *ao = &pcb->lcp_allowoptions; + int mtu, mru; + + if (!go->neg_magicnumber) + go->magicnumber = 0; + if (!ho->neg_magicnumber) + ho->magicnumber = 0; + + /* + * Set our MTU to the smaller of the MTU we wanted and + * the MRU our peer wanted. If we negotiated an MRU, + * set our MRU to the larger of value we wanted and + * the value we got in the negotiation. + * Note on the MTU: the link MTU can be the MRU the peer wanted, + * the interface MTU is set to the lowest of that, the + * MTU we want to use, and our link MRU. + */ + mtu = ho->neg_mru? ho->mru: PPP_MRU; + mru = go->neg_mru? LWIP_MAX(wo->mru, go->mru): PPP_MRU; +#ifdef HAVE_MULTILINK + if (!(multilink && go->neg_mrru && ho->neg_mrru)) +#endif /* HAVE_MULTILINK */ + netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + ppp_send_config(pcb, mtu, + (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), + ho->neg_pcompression, ho->neg_accompression); + ppp_recv_config(pcb, mru, + (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); + + if (ho->neg_mru) + pcb->peer_mru = ho->mru; + + lcp_echo_lowerup(f->pcb); /* Enable echo messages */ + + link_established(pcb); +} + + +/* + * lcp_down - LCP has gone DOWN. + * + * Alert other protocols. + */ +static void lcp_down(fsm *f) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + + lcp_echo_lowerdown(f->pcb); + + link_down(pcb); + + ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0); + ppp_recv_config(pcb, PPP_MRU, + (go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); + pcb->peer_mru = PPP_MRU; +} + + +/* + * lcp_starting - LCP needs the lower layer up. + */ +static void lcp_starting(fsm *f) { + ppp_pcb *pcb = f->pcb; + link_required(pcb); +} + + +/* + * lcp_finished - LCP has finished with the lower layer. + */ +static void lcp_finished(fsm *f) { + ppp_pcb *pcb = f->pcb; + link_terminated(pcb); +} + + +#if PRINTPKT_SUPPORT +/* + * lcp_printpkt - print the contents of an LCP packet. + */ +static const char* const lcp_codenames[] = { + "ConfReq", "ConfAck", "ConfNak", "ConfRej", + "TermReq", "TermAck", "CodeRej", "ProtRej", + "EchoReq", "EchoRep", "DiscReq", "Ident", + "TimeRem" +}; + +static int lcp_printpkt(const u_char *p, int plen, + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len, olen, i; + const u_char *pstart, *optend; + u_short cishort; + u32_t cilong; + + if (plen < HEADERLEN) + return 0; + pstart = p; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < HEADERLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(lcp_codenames)) + printer(arg, " %s", lcp_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= HEADERLEN; + switch (code) { + case CONFREQ: + case CONFACK: + case CONFNAK: + case CONFREJ: + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_MRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mru %d", cishort); + } + break; + case CI_ASYNCMAP: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "asyncmap 0x%x", cilong); + } + break; + case CI_AUTHTYPE: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "auth "); + GETSHORT(cishort, p); + switch (cishort) { +#if PAP_SUPPORT + case PPP_PAP: + printer(arg, "pap"); + break; +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + case PPP_CHAP: + printer(arg, "chap"); + if (p < optend) { + switch (*p) { + case CHAP_MD5: + printer(arg, " MD5"); + ++p; + break; +#if MSCHAP_SUPPORT + case CHAP_MICROSOFT: + printer(arg, " MS"); + ++p; + break; + + case CHAP_MICROSOFT_V2: + printer(arg, " MS-v2"); + ++p; + break; +#endif /* MSCHAP_SUPPORT */ + default: + break; + } + } + break; +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + case PPP_EAP: + printer(arg, "eap"); + break; +#endif /* EAP_SUPPORT */ + default: + printer(arg, "0x%x", cishort); + } + } + break; +#if LQR_SUPPORT + case CI_QUALITY: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "quality "); + GETSHORT(cishort, p); + switch (cishort) { + case PPP_LQR: + printer(arg, "lqr"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; +#endif /* LQR_SUPPORT */ + case CI_CALLBACK: + if (olen >= CILEN_CHAR) { + p += 2; + printer(arg, "callback "); + GETCHAR(cishort, p); + switch (cishort) { + case CBCP_OPT: + printer(arg, "CBCP"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; + case CI_MAGICNUMBER: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "magic 0x%x", cilong); + } + break; + case CI_PCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "pcomp"); + } + break; + case CI_ACCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "accomp"); + } + break; + case CI_MRRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mrru %d", cishort); + } + break; + case CI_SSNHF: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "ssnhf"); + } + break; + case CI_EPDISC: +#ifdef HAVE_MULTILINK + if (olen >= CILEN_CHAR) { + struct epdisc epd; + p += 2; + GETCHAR(epd.class, p); + epd.length = olen - CILEN_CHAR; + if (epd.length > MAX_ENDP_LEN) + epd.length = MAX_ENDP_LEN; + if (epd.length > 0) { + MEMCPY(epd.value, p, epd.length); + p += epd.length; + } + printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); + } +#else + printer(arg, "endpoint"); +#endif + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; + + case TERMACK: + case TERMREQ: + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; + + case ECHOREQ: + case ECHOREP: + case DISCREQ: + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + break; + + case IDENTIF: + case TIMEREM: + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + if (code == TIMEREM) { + if (len < 4) + break; + GETLONG(cilong, p); + printer(arg, " seconds=%u", cilong); + len -= 4; + } + if (len > 0) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; + default: + break; + } + + /* print the rest of the bytes in the packet */ + for (i = 0; i < len && i < 32; ++i) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + if (i < len) { + printer(arg, " ..."); + p += len - i; + } + + return p - pstart; +} +#endif /* PRINTPKT_SUPPORT */ + +/* + * Time to shut down the link because there is nothing out there. + */ + +static void LcpLinkFailure(fsm *f) { + ppp_pcb *pcb = f->pcb; + if (f->state == PPP_FSM_OPENED) { + ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); + ppp_notice("Serial link appears to be disconnected."); + pcb->err_code = PPPERR_PEERDEAD; + lcp_close(pcb, "Peer not responding"); + } +} + +/* + * Timer expired for the LCP echo requests from this process. + */ + +static void LcpEchoCheck(fsm *f) { + ppp_pcb *pcb = f->pcb; + + LcpSendEchoRequest (f); + if (f->state != PPP_FSM_OPENED) + return; + + /* + * Start the timer for the next interval. + */ + if (pcb->lcp_echo_timer_running) + ppp_warn("assertion lcp_echo_timer_running==0 failed"); + TIMEOUT (LcpEchoTimeout, f, pcb->settings.lcp_echo_interval); + pcb->lcp_echo_timer_running = 1; +} + +/* + * LcpEchoTimeout - Timer expired on the LCP echo + */ + +static void LcpEchoTimeout(void *arg) { + fsm *f = (fsm*)arg; + ppp_pcb *pcb = f->pcb; + if (pcb->lcp_echo_timer_running != 0) { + pcb->lcp_echo_timer_running = 0; + LcpEchoCheck ((fsm *) arg); + } +} + +/* + * LcpEchoReply - LCP has received a reply to the echo + */ + +static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u32_t magic_val; + LWIP_UNUSED_ARG(id); + + /* Check the magic number - don't count replies from ourselves. */ + if (len < 4) { + ppp_dbglog("lcp: received short Echo-Reply, length %d", len); + return; + } + GETLONG(magic_val, inp); + if (go->neg_magicnumber + && magic_val == go->magicnumber) { + ppp_warn("appear to have received our own echo-reply!"); + return; + } + + /* Reset the number of outstanding echo frames */ + pcb->lcp_echos_pending = 0; +} + +/* + * LcpSendEchoRequest - Send an echo request frame to the peer + */ + +static void LcpSendEchoRequest(fsm *f) { + ppp_pcb *pcb = f->pcb; + lcp_options *go = &pcb->lcp_gotoptions; + u32_t lcp_magic; + u_char pkt[4], *pktp; + + /* + * Detect the failure of the peer at this point. + */ + if (pcb->settings.lcp_echo_fails != 0) { + if (pcb->lcp_echos_pending >= pcb->settings.lcp_echo_fails) { + LcpLinkFailure(f); + pcb->lcp_echos_pending = 0; + } + } + +#if PPP_LCP_ADAPTIVE + /* + * If adaptive echos have been enabled, only send the echo request if + * no traffic was received since the last one. + */ + if (pcb->settings.lcp_echo_adaptive) { + static unsigned int last_pkts_in = 0; + +#if PPP_STATS_SUPPORT + update_link_stats(f->unit); + link_stats_valid = 0; +#endif /* PPP_STATS_SUPPORT */ + + if (link_stats.pkts_in != last_pkts_in) { + last_pkts_in = link_stats.pkts_in; + return; + } + } +#endif + + /* + * Make and send the echo request frame. + */ + if (f->state == PPP_FSM_OPENED) { + lcp_magic = go->magicnumber; + pktp = pkt; + PUTLONG(lcp_magic, pktp); + fsm_sdata(f, ECHOREQ, pcb->lcp_echo_number++, pkt, pktp - pkt); + ++pcb->lcp_echos_pending; + } +} + +/* + * lcp_echo_lowerup - Start the timer for the LCP frame + */ + +static void lcp_echo_lowerup(ppp_pcb *pcb) { + fsm *f = &pcb->lcp_fsm; + + /* Clear the parameters for generating echo frames */ + pcb->lcp_echos_pending = 0; + pcb->lcp_echo_number = 0; + pcb->lcp_echo_timer_running = 0; + + /* If a timeout interval is specified then start the timer */ + if (pcb->settings.lcp_echo_interval != 0) + LcpEchoCheck (f); +} + +/* + * lcp_echo_lowerdown - Stop the timer for the LCP frame + */ + +static void lcp_echo_lowerdown(ppp_pcb *pcb) { + fsm *f = &pcb->lcp_fsm; + + if (pcb->lcp_echo_timer_running != 0) { + UNTIMEOUT (LcpEchoTimeout, f); + pcb->lcp_echo_timer_running = 0; + } +} + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/magic.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/magic.c new file mode 100644 index 0000000..d0d87c5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/magic.c @@ -0,0 +1,294 @@ +/* + * magic.c - PPP Magic Number routines. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/***************************************************************************** +* randm.c - Random number generator program file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* Copyright (c) 1998 by Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 98-06-03 Guy Lancaster , Global Election Systems Inc. +* Extracted from avos. +*****************************************************************************/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/magic.h" + +#if PPP_MD5_RANDM /* Using MD5 for better randomness if enabled */ + +#include "netif/ppp/pppcrypt.h" + +#define MD5_HASH_SIZE 16 +static char magic_randpool[MD5_HASH_SIZE]; /* Pool of randomness. */ +static long magic_randcount; /* Pseudo-random incrementer */ +static u32_t magic_randomseed; /* Seed used for random number generation. */ + +/* + * Churn the randomness pool on a random event. Call this early and often + * on random and semi-random system events to build randomness in time for + * usage. For randomly timed events, pass a null pointer and a zero length + * and this will use the system timer and other sources to add randomness. + * If new random data is available, pass a pointer to that and it will be + * included. + * + * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 + */ +static void magic_churnrand(char *rand_data, u32_t rand_len) { + lwip_md5_context md5_ctx; + + /* LWIP_DEBUGF(LOG_INFO, ("magic_churnrand: %u@%P\n", rand_len, rand_data)); */ + lwip_md5_init(&md5_ctx); + lwip_md5_starts(&md5_ctx); + lwip_md5_update(&md5_ctx, (u_char *)magic_randpool, sizeof(magic_randpool)); + if (rand_data) { + lwip_md5_update(&md5_ctx, (u_char *)rand_data, rand_len); + } else { + struct { + /* INCLUDE fields for any system sources of randomness */ + u32_t jiffies; +#ifdef LWIP_RAND + u32_t rand; +#endif /* LWIP_RAND */ + } sys_data; + magic_randomseed += sys_jiffies(); + sys_data.jiffies = magic_randomseed; +#ifdef LWIP_RAND + sys_data.rand = LWIP_RAND(); +#endif /* LWIP_RAND */ + /* Load sys_data fields here. */ + lwip_md5_update(&md5_ctx, (u_char *)&sys_data, sizeof(sys_data)); + } + lwip_md5_finish(&md5_ctx, (u_char *)magic_randpool); + lwip_md5_free(&md5_ctx); +/* LWIP_DEBUGF(LOG_INFO, ("magic_churnrand: -> 0\n")); */ +} + +/* + * Initialize the random number generator. + */ +void magic_init(void) { + magic_churnrand(NULL, 0); +} + +/* + * Randomize our random seed value. + */ +void magic_randomize(void) { + magic_churnrand(NULL, 0); +} + +/* + * magic_random_bytes - Fill a buffer with random bytes. + * + * Use the random pool to generate random data. This degrades to pseudo + * random when used faster than randomness is supplied using magic_churnrand(). + * Note: It's important that there be sufficient randomness in magic_randpool + * before this is called for otherwise the range of the result may be + * narrow enough to make a search feasible. + * + * Ref: Applied Cryptography 2nd Ed. by Bruce Schneier p. 427 + * + * XXX Why does he not just call magic_churnrand() for each block? Probably + * so that you don't ever publish the seed which could possibly help + * predict future values. + * XXX Why don't we preserve md5 between blocks and just update it with + * magic_randcount each time? Probably there is a weakness but I wish that + * it was documented. + */ +void magic_random_bytes(unsigned char *buf, u32_t buf_len) { + lwip_md5_context md5_ctx; + u_char tmp[MD5_HASH_SIZE]; + u32_t n; + + while (buf_len > 0) { + lwip_md5_init(&md5_ctx); + lwip_md5_starts(&md5_ctx); + lwip_md5_update(&md5_ctx, (u_char *)magic_randpool, sizeof(magic_randpool)); + lwip_md5_update(&md5_ctx, (u_char *)&magic_randcount, sizeof(magic_randcount)); + lwip_md5_finish(&md5_ctx, tmp); + lwip_md5_free(&md5_ctx); + magic_randcount++; + n = LWIP_MIN(buf_len, MD5_HASH_SIZE); + MEMCPY(buf, tmp, n); + buf += n; + buf_len -= n; + } +} + +/* + * Return a new random number. + */ +u32_t magic(void) { + u32_t new_rand; + + magic_random_bytes((unsigned char *)&new_rand, sizeof(new_rand)); + + return new_rand; +} + +#else /* PPP_MD5_RANDM */ + +/*****************************/ +/*** LOCAL DATA STRUCTURES ***/ +/*****************************/ +#ifndef LWIP_RAND +static int magic_randomized; /* Set when truely randomized. */ +#endif /* LWIP_RAND */ +static u32_t magic_randomseed; /* Seed used for random number generation. */ + + +/***********************************/ +/*** PUBLIC FUNCTION DEFINITIONS ***/ +/***********************************/ + +/* + * Initialize the random number generator. + * + * Here we attempt to compute a random number seed but even if + * it isn't random, we'll randomize it later. + * + * The current method uses the fields from the real time clock, + * the idle process counter, the millisecond counter, and the + * hardware timer tick counter. When this is invoked + * in startup(), then the idle counter and timer values may + * repeat after each boot and the real time clock may not be + * operational. Thus we call it again on the first random + * event. + */ +void magic_init(void) { + magic_randomseed += sys_jiffies(); +#ifndef LWIP_RAND + /* Initialize the Borland random number generator. */ + srand((unsigned)magic_randomseed); +#endif /* LWIP_RAND */ +} + +/* + * magic_init - Initialize the magic number generator. + * + * Randomize our random seed value. Here we use the fact that + * this function is called at *truely random* times by the polling + * and network functions. Here we only get 16 bits of new random + * value but we use the previous value to randomize the other 16 + * bits. + */ +void magic_randomize(void) { +#ifndef LWIP_RAND + if (!magic_randomized) { + magic_randomized = !0; + magic_init(); + /* The initialization function also updates the seed. */ + } else { +#endif /* LWIP_RAND */ + magic_randomseed += sys_jiffies(); +#ifndef LWIP_RAND + } +#endif /* LWIP_RAND */ +} + +/* + * Return a new random number. + * + * Here we use the Borland rand() function to supply a pseudo random + * number which we make truely random by combining it with our own + * seed which is randomized by truely random events. + * Thus the numbers will be truely random unless there have been no + * operator or network events in which case it will be pseudo random + * seeded by the real time clock. + */ +u32_t magic(void) { +#ifdef LWIP_RAND + return LWIP_RAND() + magic_randomseed; +#else /* LWIP_RAND */ + return ((u32_t)rand() << 16) + (u32_t)rand() + magic_randomseed; +#endif /* LWIP_RAND */ +} + +/* + * magic_random_bytes - Fill a buffer with random bytes. + */ +void magic_random_bytes(unsigned char *buf, u32_t buf_len) { + u32_t new_rand, n; + + while (buf_len > 0) { + new_rand = magic(); + n = LWIP_MIN(buf_len, sizeof(new_rand)); + MEMCPY(buf, &new_rand, n); + buf += n; + buf_len -= n; + } +} +#endif /* PPP_MD5_RANDM */ + +/* + * Return a new random number between 0 and (2^pow)-1 included. + */ +u32_t magic_pow(u8_t pow) { + return magic() & ~(~0UL<. + * Copyright (c) 2002,2003,2004 Google, Inc. + * All rights reserved. + * + * License: + * Permission to use, copy, modify, and distribute this software and its + * documentation is hereby granted, provided that the above copyright + * notice appears in all copies. This software is provided without any + * warranty, express or implied. + * + * Changelog: + * 08/12/05 - Matt Domsch + * Only need extra skb padding on transmit, not receive. + * 06/18/04 - Matt Domsch , Oleg Makarenko + * Use Linux kernel 2.6 arc4 and sha1 routines rather than + * providing our own. + * 2/15/04 - TS: added #include and testing for Kernel + * version before using + * MOD_DEC_USAGE_COUNT/MOD_INC_USAGE_COUNT which are + * deprecated in 2.6 + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && MPPE_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include + +#include "lwip/err.h" + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/ccp.h" +#include "netif/ppp/mppe.h" +#include "netif/ppp/pppdebug.h" +#include "netif/ppp/pppcrypt.h" + +#define SHA1_SIGNATURE_SIZE 20 + +/* ppp_mppe_state.bits definitions */ +#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ +#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ +#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ +#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ + +#define MPPE_BIT_FLUSHED MPPE_BIT_A +#define MPPE_BIT_ENCRYPTED MPPE_BIT_D + +#define MPPE_BITS(p) ((p)[0] & 0xf0) +#define MPPE_CCOUNT(p) ((((p)[0] & 0x0f) << 8) + (p)[1]) +#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ + +#define MPPE_OVHD 2 /* MPPE overhead/packet */ +#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ + +/* + * Perform the MPPE rekey algorithm, from RFC 3078, sec. 7.3. + * Well, not what's written there, but rather what they meant. + */ +static void mppe_rekey(ppp_mppe_state * state, int initial_key) +{ + lwip_sha1_context sha1_ctx; + u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; + + /* + * Key Derivation, from RFC 3078, RFC 3079. + * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. + */ + lwip_sha1_init(&sha1_ctx); + lwip_sha1_starts(&sha1_ctx); + lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1_ctx, sha1_digest); + lwip_sha1_free(&sha1_ctx); + MEMCPY(state->session_key, sha1_digest, state->keylen); + + if (!initial_key) { + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); + lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); + lwip_arc4_free(&state->arc4); + } + if (state->keylen == 8) { + /* See RFC 3078 */ + state->session_key[0] = 0xd1; + state->session_key[1] = 0x26; + state->session_key[2] = 0x9e; + } + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); +} + +/* + * Set key, used by MSCHAP before mppe_init() is actually called by CCP so we + * don't have to keep multiple copies of keys. + */ +void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key) { + LWIP_UNUSED_ARG(pcb); + MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); +} + +/* + * Initialize (de)compressor state. + */ +void +mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) +{ +#if PPP_DEBUG + const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; + if (&pcb->mppe_decomp == state) { + debugstr = (const u8_t*)"mppe_decomp_init"; + } +#endif /* PPP_DEBUG */ + + /* Save keys. */ + MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); + + if (options & MPPE_OPT_128) + state->keylen = 16; + else if (options & MPPE_OPT_40) + state->keylen = 8; + else { + PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, + pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + return; + } + if (options & MPPE_OPT_STATEFUL) + state->stateful = 1; + + /* Generate the initial session key. */ + mppe_rekey(state, 1); + +#if PPP_DEBUG + { + int i; + char mkey[sizeof(state->master_key) * 2 + 1]; + char skey[sizeof(state->session_key) * 2 + 1]; + + PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", + debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, + (state->stateful) ? "stateful" : "stateless")); + + for (i = 0; i < (int)sizeof(state->master_key); i++) + sprintf(mkey + i * 2, "%02x", state->master_key[i]); + for (i = 0; i < (int)sizeof(state->session_key); i++) + sprintf(skey + i * 2, "%02x", state->session_key[i]); + PPPDEBUG(LOG_DEBUG, + ("%s[%d]: keys: master: %s initial session: %s\n", + debugstr, pcb->netif->num, mkey, skey)); + } +#endif /* PPP_DEBUG */ + + /* + * Initialize the coherency count. The initial value is not specified + * in RFC 3078, but we can make a reasonable assumption that it will + * start at 0. Setting it to the max here makes the comp/decomp code + * do the right thing (determined through experiment). + */ + state->ccount = MPPE_CCOUNT_SPACE - 1; + + /* + * Note that even though we have initialized the key table, we don't + * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. + */ + state->bits = MPPE_BIT_ENCRYPTED; +} + +/* + * We received a CCP Reset-Request (actually, we are sending a Reset-Ack), + * tell the compressor to rekey. Note that we MUST NOT rekey for + * every CCP Reset-Request; we only rekey on the next xmit packet. + * We might get multiple CCP Reset-Requests if our CCP Reset-Ack is lost. + * So, rekeying for every CCP Reset-Request is broken as the peer will not + * know how many times we've rekeyed. (If we rekey and THEN get another + * CCP Reset-Request, we must rekey again.) + */ +void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) +{ + LWIP_UNUSED_ARG(pcb); + state->bits |= MPPE_BIT_FLUSHED; +} + +/* + * Compress (encrypt) a packet. + * It's strange to call this a compressor, since the output is always + * MPPE_OVHD + 2 bytes larger than the input. + */ +err_t +mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol) +{ + struct pbuf *n, *np; + u8_t *pl; + err_t err; + + LWIP_UNUSED_ARG(pcb); + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before encryption. + */ + np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_POOL); + if (!np) { + return ERR_MEM; + } + + /* Hide MPPE header + protocol */ + pbuf_header(np, -(s16_t)(MPPE_OVHD + sizeof(protocol))); + + if ((err = pbuf_copy(np, *pb)) != ERR_OK) { + pbuf_free(np); + return err; + } + + /* Reveal MPPE header + protocol */ + pbuf_header(np, (s16_t)(MPPE_OVHD + sizeof(protocol))); + + *pb = np; + pl = (u8_t*)np->payload; + + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); + /* FIXME: use PUT* macros */ + pl[0] = state->ccount>>8; + pl[1] = state->ccount; + + if (!state->stateful || /* stateless mode */ + ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ + (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ + /* We must rekey */ + if (state->stateful) { + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); + } + mppe_rekey(state, 0); + state->bits |= MPPE_BIT_FLUSHED; + } + pl[0] |= state->bits; + state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ + pl += MPPE_OVHD; + + /* Add protocol */ + /* FIXME: add PFC support */ + pl[0] = protocol >> 8; + pl[1] = protocol; + + /* Hide MPPE header */ + pbuf_header(np, -(s16_t)MPPE_OVHD); + + /* Encrypt packet */ + for (n = np; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* Reveal MPPE header */ + pbuf_header(np, (s16_t)MPPE_OVHD); + + return ERR_OK; +} + +/* + * We received a CCP Reset-Ack. Just ignore it. + */ +void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) +{ + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(state); + return; +} + +/* + * Decompress (decrypt) an MPPE packet. + */ +err_t +mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) +{ + struct pbuf *n0 = *pb, *n; + u8_t *pl; + u16_t ccount; + u8_t flushed; + + /* MPPE Header */ + if (n0->len < MPPE_OVHD) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: short pkt (%d)\n", + pcb->netif->num, n0->len)); + state->sanity_errors += 100; + goto sanity_error; + } + + pl = (u8_t*)n0->payload; + flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; + ccount = MPPE_CCOUNT(pl); + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", + pcb->netif->num, ccount)); + + /* sanity checks -- terminate with extreme prejudice */ + if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", + pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (!state->stateful && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " + "stateless mode!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " + "flag packet!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + + /* + * Check the coherency count. + */ + + if (!state->stateful) { + /* Discard late packet */ + if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { + state->sanity_errors++; + goto sanity_error; + } + + /* RFC 3078, sec 8.1. Rekey for every packet. */ + while (state->ccount != ccount) { + mppe_rekey(state, 0); + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + } + } else { + /* RFC 3078, sec 8.2. */ + if (!state->discard) { + /* normal state */ + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + if (ccount != state->ccount) { + /* + * (ccount > state->ccount) + * Packet loss detected, enter the discard state. + * Signal the peer to rekey (by sending a CCP Reset-Request). + */ + state->discard = 1; + ccp_resetrequest(pcb); + return ERR_BUF; + } + } else { + /* discard state */ + if (!flushed) { + /* ccp.c will be silent (no additional CCP Reset-Requests). */ + return ERR_BUF; + } else { + /* Rekey for every missed "flag" packet. */ + while ((ccount & ~0xff) != + (state->ccount & ~0xff)) { + mppe_rekey(state, 0); + state->ccount = + (state->ccount + + 256) % MPPE_CCOUNT_SPACE; + } + + /* reset */ + state->discard = 0; + state->ccount = ccount; + /* + * Another problem with RFC 3078 here. It implies that the + * peer need not send a Reset-Ack packet. But RFC 1962 + * requires it. Hopefully, M$ does send a Reset-Ack; even + * though it isn't required for MPPE synchronization, it is + * required to reset CCP state. + */ + } + } + if (flushed) + mppe_rekey(state, 0); + } + + /* Hide MPPE header */ + pbuf_header(n0, -(s16_t)(MPPE_OVHD)); + + /* Decrypt the packet. */ + for (n = n0; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* good packet credit */ + state->sanity_errors >>= 1; + + return ERR_OK; + +sanity_error: + if (state->sanity_errors >= SANITY_MAX) { + /* + * Take LCP down if the peer is sending too many bogons. + * We don't want to do this for a single or just a few + * instances since it could just be due to packet corruption. + */ + lcp_close(pcb, "Too many MPPE errors"); + } + return ERR_BUF; +} + +#endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/multilink.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/multilink.c new file mode 100644 index 0000000..62014e8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/multilink.c @@ -0,0 +1,609 @@ +/* + * multilink.c - support routines for multilink. + * + * Copyright (c) 2000-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && defined(HAVE_MULTILINK) /* don't build if not configured for use in lwipopts.h */ + +/* Multilink support + * + * Multilink uses Samba TDB (Trivial Database Library), which + * we cannot port, because it needs a filesystem. + * + * We have to choose between doing a memory-shared TDB-clone, + * or dropping multilink support at all. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/lcp.h" +#include "netif/ppp/tdb.h" + +bool endpoint_specified; /* user gave explicit endpoint discriminator */ +char *bundle_id; /* identifier for our bundle */ +char *blinks_id; /* key for the list of links */ +bool doing_multilink; /* multilink was enabled and agreed to */ +bool multilink_master; /* we own the multilink bundle */ + +extern TDB_CONTEXT *pppdb; +extern char db_key[]; + +static void make_bundle_links (int append); +static void remove_bundle_link (void); +static void iterate_bundle_links (void (*func) (char *)); + +static int get_default_epdisc (struct epdisc *); +static int parse_num (char *str, const char *key, int *valp); +static int owns_unit (TDB_DATA pid, int unit); + +#define set_ip_epdisc(ep, addr) do { \ + ep->length = 4; \ + ep->value[0] = addr >> 24; \ + ep->value[1] = addr >> 16; \ + ep->value[2] = addr >> 8; \ + ep->value[3] = addr; \ +} while (0) + +#define LOCAL_IP_ADDR(addr) \ + (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ + || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ + || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ + +#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) + +void +mp_check_options() +{ + lcp_options *wo = &lcp_wantoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + + doing_multilink = 0; + if (!multilink) + return; + /* if we're doing multilink, we have to negotiate MRRU */ + if (!wo->neg_mrru) { + /* mrru not specified, default to mru */ + wo->mrru = wo->mru; + wo->neg_mrru = 1; + } + ao->mrru = ao->mru; + ao->neg_mrru = 1; + + if (!wo->neg_endpoint && !noendpoint) { + /* get a default endpoint value */ + wo->neg_endpoint = get_default_epdisc(&wo->endpoint); + } +} + +/* + * Make a new bundle or join us to an existing bundle + * if we are doing multilink. + */ +int +mp_join_bundle() +{ + lcp_options *go = &lcp_gotoptions[0]; + lcp_options *ho = &lcp_hisoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + int unit, pppd_pid; + int l, mtu; + char *p; + TDB_DATA key, pid, rec; + + if (doing_multilink) { + /* have previously joined a bundle */ + if (!go->neg_mrru || !ho->neg_mrru) { + notice("oops, didn't get multilink on renegotiation"); + lcp_close(pcb, "multilink required"); + return 0; + } + /* XXX should check the peer_authname and ho->endpoint + are the same as previously */ + return 0; + } + + if (!go->neg_mrru || !ho->neg_mrru) { + /* not doing multilink */ + if (go->neg_mrru) + notice("oops, multilink negotiated only for receive"); + mtu = ho->neg_mru? ho->mru: PPP_MRU; + if (mtu > ao->mru) + mtu = ao->mru; + if (demand) { + /* already have a bundle */ + cfg_bundle(0, 0, 0, 0); + netif_set_mtu(pcb, mtu); + return 0; + } + make_new_bundle(0, 0, 0, 0); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + return 0; + } + + doing_multilink = 1; + + /* + * Find the appropriate bundle or join a new one. + * First we make up a name for the bundle. + * The length estimate is worst-case assuming every + * character has to be quoted. + */ + l = 4 * strlen(peer_authname) + 10; + if (ho->neg_endpoint) + l += 3 * ho->endpoint.length + 8; + if (bundle_name) + l += 3 * strlen(bundle_name) + 2; + bundle_id = malloc(l); + if (bundle_id == 0) + novm("bundle identifier"); + + p = bundle_id; + p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); + if (ho->neg_endpoint || bundle_name) + *p++ = '/'; + if (ho->neg_endpoint) + p += slprintf(p, bundle_id+l-p, "%s", + epdisc_to_str(&ho->endpoint)); + if (bundle_name) + p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); + + /* Make the key for the list of links belonging to the bundle */ + l = p - bundle_id; + blinks_id = malloc(l + 7); + if (blinks_id == NULL) + novm("bundle links key"); + slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); + + /* + * For demand mode, we only need to configure the bundle + * and attach the link. + */ + mtu = LWIP_MIN(ho->mrru, ao->mru); + if (demand) { + cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + return 0; + } + + /* + * Check if the bundle ID is already in the database. + */ + unit = -1; + lock_db(); + key.dptr = bundle_id; + key.dsize = p - bundle_id; + pid = tdb_fetch(pppdb, key); + if (pid.dptr != NULL) { + /* bundle ID exists, see if the pppd record exists */ + rec = tdb_fetch(pppdb, pid); + if (rec.dptr != NULL && rec.dsize > 0) { + /* make sure the string is null-terminated */ + rec.dptr[rec.dsize-1] = 0; + /* parse the interface number */ + parse_num(rec.dptr, "IFNAME=ppp", &unit); + /* check the pid value */ + if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) + || !process_exists(pppd_pid) + || !owns_unit(pid, unit)) + unit = -1; + free(rec.dptr); + } + free(pid.dptr); + } + + if (unit >= 0) { + /* attach to existing unit */ + if (bundle_attach(unit)) { + set_ifunit(0); + script_setenv("BUNDLE", bundle_id + 7, 0); + make_bundle_links(1); + unlock_db(); + info("Link attached to %s", ifname); + return 1; + } + /* attach failed because bundle doesn't exist */ + } + + /* we have to make a new bundle */ + make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + make_bundle_links(pcb); + unlock_db(); + info("New bundle %s created", ifname); + multilink_master = 1; + return 0; +} + +void mp_exit_bundle() +{ + lock_db(); + remove_bundle_link(); + unlock_db(); +} + +static void sendhup(char *str) +{ + int pid; + + if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { + if (debug) + dbglog("sending SIGHUP to process %d", pid); + kill(pid, SIGHUP); + } +} + +void mp_bundle_terminated() +{ + TDB_DATA key; + + bundle_terminating = 1; + upper_layers_down(pcb); + notice("Connection terminated."); +#if PPP_STATS_SUPPORT + print_link_stats(); +#endif /* PPP_STATS_SUPPORT */ + if (!demand) { + remove_pidfiles(); + script_unsetenv("IFNAME"); + } + + lock_db(); + destroy_bundle(); + iterate_bundle_links(sendhup); + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + tdb_delete(pppdb, key); + unlock_db(); + + new_phase(PPP_PHASE_DEAD); + + doing_multilink = 0; + multilink_master = 0; +} + +static void make_bundle_links(int append) +{ + TDB_DATA key, rec; + char *p; + char entry[32]; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + p = entry; + if (append) { + rec = tdb_fetch(pppdb, key); + if (rec.dptr != NULL && rec.dsize > 0) { + rec.dptr[rec.dsize-1] = 0; + if (strstr(rec.dptr, db_key) != NULL) { + /* already in there? strange */ + warn("link entry already exists in tdb"); + return; + } + l = rec.dsize + strlen(entry); + p = malloc(l); + if (p == NULL) + novm("bundle link list"); + slprintf(p, l, "%s%s", rec.dptr, entry); + } else { + warn("bundle link list not found"); + } + if (rec.dptr != NULL) + free(rec.dptr); + } + rec.dptr = p; + rec.dsize = strlen(p) + 1; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't %s bundle link list", + append? "update": "create"); + if (p != entry) + free(p); +} + +static void remove_bundle_link() +{ + TDB_DATA key, rec; + char entry[32]; + char *p, *q; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + rec.dptr[rec.dsize-1] = 0; + p = strstr(rec.dptr, entry); + if (p != NULL) { + q = p + strlen(entry); + l = strlen(q) + 1; + memmove(p, q, l); + rec.dsize = p - rec.dptr + l; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't update bundle link list (removal)"); + } + free(rec.dptr); +} + +static void iterate_bundle_links(void (*func)(char *)) +{ + TDB_DATA key, rec, pp; + char *p, *q; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + error("bundle link list not found (iterating list)"); + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + p = rec.dptr; + p[rec.dsize-1] = 0; + while ((q = strchr(p, ';')) != NULL) { + *q = 0; + key.dptr = p; + key.dsize = q - p; + pp = tdb_fetch(pppdb, key); + if (pp.dptr != NULL && pp.dsize > 0) { + pp.dptr[pp.dsize-1] = 0; + func(pp.dptr); + } + if (pp.dptr != NULL) + free(pp.dptr); + p = q + 1; + } + free(rec.dptr); +} + +static int +parse_num(str, key, valp) + char *str; + const char *key; + int *valp; +{ + char *p, *endp; + int i; + + p = strstr(str, key); + if (p != 0) { + p += strlen(key); + i = strtol(p, &endp, 10); + if (endp != p && (*endp == 0 || *endp == ';')) { + *valp = i; + return 1; + } + } + return 0; +} + +/* + * Check whether the pppd identified by `key' still owns ppp unit `unit'. + */ +static int +owns_unit(key, unit) + TDB_DATA key; + int unit; +{ + char ifkey[32]; + TDB_DATA kd, vd; + int ret = 0; + + slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); + kd.dptr = ifkey; + kd.dsize = strlen(ifkey); + vd = tdb_fetch(pppdb, kd); + if (vd.dptr != NULL) { + ret = vd.dsize == key.dsize + && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; + free(vd.dptr); + } + return ret; +} + +static int +get_default_epdisc(ep) + struct epdisc *ep; +{ + char *p; + struct hostent *hp; + u32_t addr; + + /* First try for an ethernet MAC address */ + p = get_first_ethernet(); + if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { + ep->class = EPD_MAC; + ep->length = 6; + return 1; + } + + /* see if our hostname corresponds to a reasonable IP address */ + hp = gethostbyname(hostname); + if (hp != NULL) { + addr = *(u32_t *)hp->h_addr; + if (!bad_ip_adrs(addr)) { + addr = lwip_ntohl(addr); + if (!LOCAL_IP_ADDR(addr)) { + ep->class = EPD_IP; + set_ip_epdisc(ep, addr); + return 1; + } + } + } + + return 0; +} + +/* + * epdisc_to_str - make a printable string from an endpoint discriminator. + */ + +static char *endp_class_names[] = { + "null", "local", "IP", "MAC", "magic", "phone" +}; + +char * +epdisc_to_str(ep) + struct epdisc *ep; +{ + static char str[MAX_ENDP_LEN*3+8]; + u_char *p = ep->value; + int i, mask = 0; + char *q, c, c2; + + if (ep->class == EPD_NULL && ep->length == 0) + return "null"; + if (ep->class == EPD_IP && ep->length == 4) { + u32_t addr; + + GETLONG(addr, p); + slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); + return str; + } + + c = ':'; + c2 = '.'; + if (ep->class == EPD_MAC && ep->length == 6) + c2 = ':'; + else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) + mask = 3; + q = str; + if (ep->class <= EPD_PHONENUM) + q += slprintf(q, sizeof(str)-1, "%s", + endp_class_names[ep->class]); + else + q += slprintf(q, sizeof(str)-1, "%d", ep->class); + c = ':'; + for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { + if ((i & mask) == 0) { + *q++ = c; + c = c2; + } + q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); + } + return str; +} + +static int hexc_val(int c) +{ + if (c >= 'a') + return c - 'a' + 10; + if (c >= 'A') + return c - 'A' + 10; + return c - '0'; +} + +int +str_to_epdisc(ep, str) + struct epdisc *ep; + char *str; +{ + int i, l; + char *p, *endp; + + for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { + int sl = strlen(endp_class_names[i]); + if (strncasecmp(str, endp_class_names[i], sl) == 0) { + str += sl; + break; + } + } + if (i > EPD_PHONENUM) { + /* not a class name, try a decimal class number */ + i = strtol(str, &endp, 10); + if (endp == str) + return 0; /* can't parse class number */ + str = endp; + } + ep->class = i; + if (*str == 0) { + ep->length = 0; + return 1; + } + if (*str != ':' && *str != '.') + return 0; + ++str; + + if (i == EPD_IP) { + u32_t addr; + i = parse_dotted_ip(str, &addr); + if (i == 0 || str[i] != 0) + return 0; + set_ip_epdisc(ep, addr); + return 1; + } + if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { + ep->length = 6; + return 1; + } + + p = str; + for (l = 0; l < MAX_ENDP_LEN; ++l) { + if (*str == 0) + break; + if (p <= str) + for (p = str; isxdigit(*p); ++p) + ; + i = p - str; + if (i == 0) + return 0; + ep->value[l] = hexc_val(*str++); + if ((i & 1) == 0) + ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); + if (*str == ':' || *str == '.') + ++str; + } + if (*str != 0 || (ep->class == EPD_MAC && l != 6)) + return 0; + ep->length = l; + return 1; +} + +#endif /* PPP_SUPPORT && HAVE_MULTILINK */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/README b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/README new file mode 100644 index 0000000..3fdf159 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/README @@ -0,0 +1,22 @@ +About PolarSSL files into lwIP PPP support +------------------------------------------ + +This folder contains some files fetched from the latest BSD release of +the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption +methods we need for lwIP PPP support. + +The PolarSSL files were cleaned to contain only the necessary struct +fields and functions needed for lwIP. + +The PolarSSL API was not changed at all, so if you are already using +PolarSSL you can choose to skip the compilation of the included PolarSSL +library into lwIP. + +If you are not using the embedded copy you must include external +libraries into your arch/cc.h port file. + +Beware of the stack requirements which can be a lot larger if you are not +using our cleaned PolarSSL library. + + +PolarSSL project website: http://polarssl.org/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c new file mode 100644 index 0000000..6e17ec4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c @@ -0,0 +1,101 @@ +/* + * An implementation of the ARCFOUR algorithm + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * The ARCFOUR algorithm was publicly disclosed on 94/09. + * + * http://groups.google.com/group/sci.crypt/msg/10a300c9d21afca0 + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_ARC4 + +#include "netif/ppp/polarssl/arc4.h" +/* + * ARC4 key schedule + */ +void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ) +{ + int i, j, k, a; + unsigned char *m; + + ctx->x = 0; + ctx->y = 0; + m = ctx->m; + + for( i = 0; i < 256; i++ ) + m[i] = (unsigned char) i; + + j = k = 0; + + for( i = 0; i < 256; i++, k++ ) + { + if( k >= keylen ) k = 0; + + a = m[i]; + j = ( j + a + key[k] ) & 0xFF; + m[i] = m[j]; + m[j] = (unsigned char) a; + } +} + +/* + * ARC4 cipher function + */ +void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ) +{ + int i, x, y, a, b; + unsigned char *m; + + x = ctx->x; + y = ctx->y; + m = ctx->m; + + for( i = 0; i < buflen; i++ ) + { + x = ( x + 1 ) & 0xFF; a = m[x]; + y = ( y + a ) & 0xFF; b = m[y]; + + m[x] = (unsigned char) b; + m[y] = (unsigned char) a; + + buf[i] = (unsigned char) + ( buf[i] ^ m[(unsigned char)( a + b )] ); + } + + ctx->x = x; + ctx->y = y; +} + +#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_DES */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/des.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/des.c new file mode 100644 index 0000000..9a89d00 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/des.c @@ -0,0 +1,422 @@ +/* + * FIPS-46-3 compliant Triple-DES implementation + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * DES, on which TDES is based, was originally designed by Horst Feistel + * at IBM in 1974, and was adopted as a standard by NIST (formerly NBS). + * + * http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_DES + +#include "netif/ppp/polarssl/des.h" + +/* + * 32-bit integer manipulation macros (big endian) + */ +#ifndef GET_ULONG_BE +#define GET_ULONG_BE(n,b,i) \ +{ \ + (n) = ( (unsigned long) (b)[(i) ] << 24 ) \ + | ( (unsigned long) (b)[(i) + 1] << 16 ) \ + | ( (unsigned long) (b)[(i) + 2] << 8 ) \ + | ( (unsigned long) (b)[(i) + 3] ); \ +} +#endif + +#ifndef PUT_ULONG_BE +#define PUT_ULONG_BE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) ); \ +} +#endif + +/* + * Expanded DES S-boxes + */ +static const unsigned long SB1[64] = +{ + 0x01010400, 0x00000000, 0x00010000, 0x01010404, + 0x01010004, 0x00010404, 0x00000004, 0x00010000, + 0x00000400, 0x01010400, 0x01010404, 0x00000400, + 0x01000404, 0x01010004, 0x01000000, 0x00000004, + 0x00000404, 0x01000400, 0x01000400, 0x00010400, + 0x00010400, 0x01010000, 0x01010000, 0x01000404, + 0x00010004, 0x01000004, 0x01000004, 0x00010004, + 0x00000000, 0x00000404, 0x00010404, 0x01000000, + 0x00010000, 0x01010404, 0x00000004, 0x01010000, + 0x01010400, 0x01000000, 0x01000000, 0x00000400, + 0x01010004, 0x00010000, 0x00010400, 0x01000004, + 0x00000400, 0x00000004, 0x01000404, 0x00010404, + 0x01010404, 0x00010004, 0x01010000, 0x01000404, + 0x01000004, 0x00000404, 0x00010404, 0x01010400, + 0x00000404, 0x01000400, 0x01000400, 0x00000000, + 0x00010004, 0x00010400, 0x00000000, 0x01010004 +}; + +static const unsigned long SB2[64] = +{ + 0x80108020, 0x80008000, 0x00008000, 0x00108020, + 0x00100000, 0x00000020, 0x80100020, 0x80008020, + 0x80000020, 0x80108020, 0x80108000, 0x80000000, + 0x80008000, 0x00100000, 0x00000020, 0x80100020, + 0x00108000, 0x00100020, 0x80008020, 0x00000000, + 0x80000000, 0x00008000, 0x00108020, 0x80100000, + 0x00100020, 0x80000020, 0x00000000, 0x00108000, + 0x00008020, 0x80108000, 0x80100000, 0x00008020, + 0x00000000, 0x00108020, 0x80100020, 0x00100000, + 0x80008020, 0x80100000, 0x80108000, 0x00008000, + 0x80100000, 0x80008000, 0x00000020, 0x80108020, + 0x00108020, 0x00000020, 0x00008000, 0x80000000, + 0x00008020, 0x80108000, 0x00100000, 0x80000020, + 0x00100020, 0x80008020, 0x80000020, 0x00100020, + 0x00108000, 0x00000000, 0x80008000, 0x00008020, + 0x80000000, 0x80100020, 0x80108020, 0x00108000 +}; + +static const unsigned long SB3[64] = +{ + 0x00000208, 0x08020200, 0x00000000, 0x08020008, + 0x08000200, 0x00000000, 0x00020208, 0x08000200, + 0x00020008, 0x08000008, 0x08000008, 0x00020000, + 0x08020208, 0x00020008, 0x08020000, 0x00000208, + 0x08000000, 0x00000008, 0x08020200, 0x00000200, + 0x00020200, 0x08020000, 0x08020008, 0x00020208, + 0x08000208, 0x00020200, 0x00020000, 0x08000208, + 0x00000008, 0x08020208, 0x00000200, 0x08000000, + 0x08020200, 0x08000000, 0x00020008, 0x00000208, + 0x00020000, 0x08020200, 0x08000200, 0x00000000, + 0x00000200, 0x00020008, 0x08020208, 0x08000200, + 0x08000008, 0x00000200, 0x00000000, 0x08020008, + 0x08000208, 0x00020000, 0x08000000, 0x08020208, + 0x00000008, 0x00020208, 0x00020200, 0x08000008, + 0x08020000, 0x08000208, 0x00000208, 0x08020000, + 0x00020208, 0x00000008, 0x08020008, 0x00020200 +}; + +static const unsigned long SB4[64] = +{ + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802080, 0x00800081, 0x00800001, 0x00002001, + 0x00000000, 0x00802000, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00800080, 0x00800001, + 0x00000001, 0x00002000, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002001, 0x00002080, + 0x00800081, 0x00000001, 0x00002080, 0x00800080, + 0x00002000, 0x00802080, 0x00802081, 0x00000081, + 0x00800080, 0x00800001, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00000000, 0x00802000, + 0x00002080, 0x00800080, 0x00800081, 0x00000001, + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802081, 0x00000081, 0x00000001, 0x00002000, + 0x00800001, 0x00002001, 0x00802080, 0x00800081, + 0x00002001, 0x00002080, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002000, 0x00802080 +}; + +static const unsigned long SB5[64] = +{ + 0x00000100, 0x02080100, 0x02080000, 0x42000100, + 0x00080000, 0x00000100, 0x40000000, 0x02080000, + 0x40080100, 0x00080000, 0x02000100, 0x40080100, + 0x42000100, 0x42080000, 0x00080100, 0x40000000, + 0x02000000, 0x40080000, 0x40080000, 0x00000000, + 0x40000100, 0x42080100, 0x42080100, 0x02000100, + 0x42080000, 0x40000100, 0x00000000, 0x42000000, + 0x02080100, 0x02000000, 0x42000000, 0x00080100, + 0x00080000, 0x42000100, 0x00000100, 0x02000000, + 0x40000000, 0x02080000, 0x42000100, 0x40080100, + 0x02000100, 0x40000000, 0x42080000, 0x02080100, + 0x40080100, 0x00000100, 0x02000000, 0x42080000, + 0x42080100, 0x00080100, 0x42000000, 0x42080100, + 0x02080000, 0x00000000, 0x40080000, 0x42000000, + 0x00080100, 0x02000100, 0x40000100, 0x00080000, + 0x00000000, 0x40080000, 0x02080100, 0x40000100 +}; + +static const unsigned long SB6[64] = +{ + 0x20000010, 0x20400000, 0x00004000, 0x20404010, + 0x20400000, 0x00000010, 0x20404010, 0x00400000, + 0x20004000, 0x00404010, 0x00400000, 0x20000010, + 0x00400010, 0x20004000, 0x20000000, 0x00004010, + 0x00000000, 0x00400010, 0x20004010, 0x00004000, + 0x00404000, 0x20004010, 0x00000010, 0x20400010, + 0x20400010, 0x00000000, 0x00404010, 0x20404000, + 0x00004010, 0x00404000, 0x20404000, 0x20000000, + 0x20004000, 0x00000010, 0x20400010, 0x00404000, + 0x20404010, 0x00400000, 0x00004010, 0x20000010, + 0x00400000, 0x20004000, 0x20000000, 0x00004010, + 0x20000010, 0x20404010, 0x00404000, 0x20400000, + 0x00404010, 0x20404000, 0x00000000, 0x20400010, + 0x00000010, 0x00004000, 0x20400000, 0x00404010, + 0x00004000, 0x00400010, 0x20004010, 0x00000000, + 0x20404000, 0x20000000, 0x00400010, 0x20004010 +}; + +static const unsigned long SB7[64] = +{ + 0x00200000, 0x04200002, 0x04000802, 0x00000000, + 0x00000800, 0x04000802, 0x00200802, 0x04200800, + 0x04200802, 0x00200000, 0x00000000, 0x04000002, + 0x00000002, 0x04000000, 0x04200002, 0x00000802, + 0x04000800, 0x00200802, 0x00200002, 0x04000800, + 0x04000002, 0x04200000, 0x04200800, 0x00200002, + 0x04200000, 0x00000800, 0x00000802, 0x04200802, + 0x00200800, 0x00000002, 0x04000000, 0x00200800, + 0x04000000, 0x00200800, 0x00200000, 0x04000802, + 0x04000802, 0x04200002, 0x04200002, 0x00000002, + 0x00200002, 0x04000000, 0x04000800, 0x00200000, + 0x04200800, 0x00000802, 0x00200802, 0x04200800, + 0x00000802, 0x04000002, 0x04200802, 0x04200000, + 0x00200800, 0x00000000, 0x00000002, 0x04200802, + 0x00000000, 0x00200802, 0x04200000, 0x00000800, + 0x04000002, 0x04000800, 0x00000800, 0x00200002 +}; + +static const unsigned long SB8[64] = +{ + 0x10001040, 0x00001000, 0x00040000, 0x10041040, + 0x10000000, 0x10001040, 0x00000040, 0x10000000, + 0x00040040, 0x10040000, 0x10041040, 0x00041000, + 0x10041000, 0x00041040, 0x00001000, 0x00000040, + 0x10040000, 0x10000040, 0x10001000, 0x00001040, + 0x00041000, 0x00040040, 0x10040040, 0x10041000, + 0x00001040, 0x00000000, 0x00000000, 0x10040040, + 0x10000040, 0x10001000, 0x00041040, 0x00040000, + 0x00041040, 0x00040000, 0x10041000, 0x00001000, + 0x00000040, 0x10040040, 0x00001000, 0x00041040, + 0x10001000, 0x00000040, 0x10000040, 0x10040000, + 0x10040040, 0x10000000, 0x00040000, 0x10001040, + 0x00000000, 0x10041040, 0x00040040, 0x10000040, + 0x10040000, 0x10001000, 0x10001040, 0x00000000, + 0x10041040, 0x00041000, 0x00041000, 0x00001040, + 0x00001040, 0x00040040, 0x10000000, 0x10041000 +}; + +/* + * PC1: left and right halves bit-swap + */ +static const unsigned long LHs[16] = +{ + 0x00000000, 0x00000001, 0x00000100, 0x00000101, + 0x00010000, 0x00010001, 0x00010100, 0x00010101, + 0x01000000, 0x01000001, 0x01000100, 0x01000101, + 0x01010000, 0x01010001, 0x01010100, 0x01010101 +}; + +static const unsigned long RHs[16] = +{ + 0x00000000, 0x01000000, 0x00010000, 0x01010000, + 0x00000100, 0x01000100, 0x00010100, 0x01010100, + 0x00000001, 0x01000001, 0x00010001, 0x01010001, + 0x00000101, 0x01000101, 0x00010101, 0x01010101, +}; + +/* + * Initial Permutation macro + */ +#define DES_IP(X,Y) \ +{ \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T; \ + X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF; \ +} + +/* + * Final Permutation macro + */ +#define DES_FP(X,Y) \ +{ \ + X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T; \ + Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF; \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ +} + +/* + * DES round macro + */ +#define DES_ROUND(X,Y) \ +{ \ + T = *SK++ ^ X; \ + Y ^= SB8[ (T ) & 0x3F ] ^ \ + SB6[ (T >> 8) & 0x3F ] ^ \ + SB4[ (T >> 16) & 0x3F ] ^ \ + SB2[ (T >> 24) & 0x3F ]; \ + \ + T = *SK++ ^ ((X << 28) | (X >> 4)); \ + Y ^= SB7[ (T ) & 0x3F ] ^ \ + SB5[ (T >> 8) & 0x3F ] ^ \ + SB3[ (T >> 16) & 0x3F ] ^ \ + SB1[ (T >> 24) & 0x3F ]; \ +} + +#define SWAP(a,b) { unsigned long t = a; a = b; b = t; t = 0; } + +static void des_setkey( unsigned long SK[32], unsigned char key[8] ) +{ + int i; + unsigned long X, Y, T; + + GET_ULONG_BE( X, key, 0 ); + GET_ULONG_BE( Y, key, 4 ); + + /* + * Permuted Choice 1 + */ + T = ((Y >> 4) ^ X) & 0x0F0F0F0F; X ^= T; Y ^= (T << 4); + T = ((Y ) ^ X) & 0x10101010; X ^= T; Y ^= (T ); + + X = (LHs[ (X ) & 0xF] << 3) | (LHs[ (X >> 8) & 0xF ] << 2) + | (LHs[ (X >> 16) & 0xF] << 1) | (LHs[ (X >> 24) & 0xF ] ) + | (LHs[ (X >> 5) & 0xF] << 7) | (LHs[ (X >> 13) & 0xF ] << 6) + | (LHs[ (X >> 21) & 0xF] << 5) | (LHs[ (X >> 29) & 0xF ] << 4); + + Y = (RHs[ (Y >> 1) & 0xF] << 3) | (RHs[ (Y >> 9) & 0xF ] << 2) + | (RHs[ (Y >> 17) & 0xF] << 1) | (RHs[ (Y >> 25) & 0xF ] ) + | (RHs[ (Y >> 4) & 0xF] << 7) | (RHs[ (Y >> 12) & 0xF ] << 6) + | (RHs[ (Y >> 20) & 0xF] << 5) | (RHs[ (Y >> 28) & 0xF ] << 4); + + X &= 0x0FFFFFFF; + Y &= 0x0FFFFFFF; + + /* + * calculate subkeys + */ + for( i = 0; i < 16; i++ ) + { + if( i < 2 || i == 8 || i == 15 ) + { + X = ((X << 1) | (X >> 27)) & 0x0FFFFFFF; + Y = ((Y << 1) | (Y >> 27)) & 0x0FFFFFFF; + } + else + { + X = ((X << 2) | (X >> 26)) & 0x0FFFFFFF; + Y = ((Y << 2) | (Y >> 26)) & 0x0FFFFFFF; + } + + *SK++ = ((X << 4) & 0x24000000) | ((X << 28) & 0x10000000) + | ((X << 14) & 0x08000000) | ((X << 18) & 0x02080000) + | ((X << 6) & 0x01000000) | ((X << 9) & 0x00200000) + | ((X >> 1) & 0x00100000) | ((X << 10) & 0x00040000) + | ((X << 2) & 0x00020000) | ((X >> 10) & 0x00010000) + | ((Y >> 13) & 0x00002000) | ((Y >> 4) & 0x00001000) + | ((Y << 6) & 0x00000800) | ((Y >> 1) & 0x00000400) + | ((Y >> 14) & 0x00000200) | ((Y ) & 0x00000100) + | ((Y >> 5) & 0x00000020) | ((Y >> 10) & 0x00000010) + | ((Y >> 3) & 0x00000008) | ((Y >> 18) & 0x00000004) + | ((Y >> 26) & 0x00000002) | ((Y >> 24) & 0x00000001); + + *SK++ = ((X << 15) & 0x20000000) | ((X << 17) & 0x10000000) + | ((X << 10) & 0x08000000) | ((X << 22) & 0x04000000) + | ((X >> 2) & 0x02000000) | ((X << 1) & 0x01000000) + | ((X << 16) & 0x00200000) | ((X << 11) & 0x00100000) + | ((X << 3) & 0x00080000) | ((X >> 6) & 0x00040000) + | ((X << 15) & 0x00020000) | ((X >> 4) & 0x00010000) + | ((Y >> 2) & 0x00002000) | ((Y << 8) & 0x00001000) + | ((Y >> 14) & 0x00000808) | ((Y >> 9) & 0x00000400) + | ((Y ) & 0x00000200) | ((Y << 7) & 0x00000100) + | ((Y >> 7) & 0x00000020) | ((Y >> 3) & 0x00000011) + | ((Y << 2) & 0x00000004) | ((Y >> 21) & 0x00000002); + } +} + +/* + * DES key schedule (56-bit, encryption) + */ +void des_setkey_enc( des_context *ctx, unsigned char key[8] ) +{ + des_setkey( ctx->sk, key ); +} + +/* + * DES key schedule (56-bit, decryption) + */ +void des_setkey_dec( des_context *ctx, unsigned char key[8] ) +{ + int i; + + des_setkey( ctx->sk, key ); + + for( i = 0; i < 16; i += 2 ) + { + SWAP( ctx->sk[i ], ctx->sk[30 - i] ); + SWAP( ctx->sk[i + 1], ctx->sk[31 - i] ); + } +} + +/* + * DES-ECB block encryption/decryption + */ +void des_crypt_ecb( des_context *ctx, + const unsigned char input[8], + unsigned char output[8] ) +{ + int i; + unsigned long X, Y, T, *SK; + + SK = ctx->sk; + + GET_ULONG_BE( X, input, 0 ); + GET_ULONG_BE( Y, input, 4 ); + + DES_IP( X, Y ); + + for( i = 0; i < 8; i++ ) + { + DES_ROUND( Y, X ); + DES_ROUND( X, Y ); + } + + DES_FP( Y, X ); + + PUT_ULONG_BE( Y, output, 0 ); + PUT_ULONG_BE( X, output, 4 ); +} + +#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_DES */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md4.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md4.c new file mode 100644 index 0000000..b1701a0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md4.c @@ -0,0 +1,281 @@ +/* + * RFC 1186/1320 compliant MD4 implementation + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * The MD4 algorithm was designed by Ron Rivest in 1990. + * + * http://www.ietf.org/rfc/rfc1186.txt + * http://www.ietf.org/rfc/rfc1320.txt + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD4 + +#include "netif/ppp/polarssl/md4.h" + +#include + +/* + * 32-bit integer manipulation macros (little endian) + */ +#ifndef GET_ULONG_LE +#define GET_ULONG_LE(n,b,i) \ +{ \ + (n) = ( (unsigned long) (b)[(i) ] ) \ + | ( (unsigned long) (b)[(i) + 1] << 8 ) \ + | ( (unsigned long) (b)[(i) + 2] << 16 ) \ + | ( (unsigned long) (b)[(i) + 3] << 24 ); \ +} +#endif + +#ifndef PUT_ULONG_LE +#define PUT_ULONG_LE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \ +} +#endif + +/* + * MD4 context setup + */ +void md4_starts( md4_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x67452301; + ctx->state[1] = 0xEFCDAB89; + ctx->state[2] = 0x98BADCFE; + ctx->state[3] = 0x10325476; +} + +static void md4_process( md4_context *ctx, const unsigned char data[64] ) +{ + unsigned long X[16], A, B, C, D; + + GET_ULONG_LE( X[ 0], data, 0 ); + GET_ULONG_LE( X[ 1], data, 4 ); + GET_ULONG_LE( X[ 2], data, 8 ); + GET_ULONG_LE( X[ 3], data, 12 ); + GET_ULONG_LE( X[ 4], data, 16 ); + GET_ULONG_LE( X[ 5], data, 20 ); + GET_ULONG_LE( X[ 6], data, 24 ); + GET_ULONG_LE( X[ 7], data, 28 ); + GET_ULONG_LE( X[ 8], data, 32 ); + GET_ULONG_LE( X[ 9], data, 36 ); + GET_ULONG_LE( X[10], data, 40 ); + GET_ULONG_LE( X[11], data, 44 ); + GET_ULONG_LE( X[12], data, 48 ); + GET_ULONG_LE( X[13], data, 52 ); + GET_ULONG_LE( X[14], data, 56 ); + GET_ULONG_LE( X[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + +#define F(x, y, z) ((x & y) | ((~x) & z)) +#define P(a,b,c,d,x,s) { a += F(b,c,d) + x; a = S(a,s); } + + P( A, B, C, D, X[ 0], 3 ); + P( D, A, B, C, X[ 1], 7 ); + P( C, D, A, B, X[ 2], 11 ); + P( B, C, D, A, X[ 3], 19 ); + P( A, B, C, D, X[ 4], 3 ); + P( D, A, B, C, X[ 5], 7 ); + P( C, D, A, B, X[ 6], 11 ); + P( B, C, D, A, X[ 7], 19 ); + P( A, B, C, D, X[ 8], 3 ); + P( D, A, B, C, X[ 9], 7 ); + P( C, D, A, B, X[10], 11 ); + P( B, C, D, A, X[11], 19 ); + P( A, B, C, D, X[12], 3 ); + P( D, A, B, C, X[13], 7 ); + P( C, D, A, B, X[14], 11 ); + P( B, C, D, A, X[15], 19 ); + +#undef P +#undef F + +#define F(x,y,z) ((x & y) | (x & z) | (y & z)) +#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x5A827999; a = S(a,s); } + + P( A, B, C, D, X[ 0], 3 ); + P( D, A, B, C, X[ 4], 5 ); + P( C, D, A, B, X[ 8], 9 ); + P( B, C, D, A, X[12], 13 ); + P( A, B, C, D, X[ 1], 3 ); + P( D, A, B, C, X[ 5], 5 ); + P( C, D, A, B, X[ 9], 9 ); + P( B, C, D, A, X[13], 13 ); + P( A, B, C, D, X[ 2], 3 ); + P( D, A, B, C, X[ 6], 5 ); + P( C, D, A, B, X[10], 9 ); + P( B, C, D, A, X[14], 13 ); + P( A, B, C, D, X[ 3], 3 ); + P( D, A, B, C, X[ 7], 5 ); + P( C, D, A, B, X[11], 9 ); + P( B, C, D, A, X[15], 13 ); + +#undef P +#undef F + +#define F(x,y,z) (x ^ y ^ z) +#define P(a,b,c,d,x,s) { a += F(b,c,d) + x + 0x6ED9EBA1; a = S(a,s); } + + P( A, B, C, D, X[ 0], 3 ); + P( D, A, B, C, X[ 8], 9 ); + P( C, D, A, B, X[ 4], 11 ); + P( B, C, D, A, X[12], 15 ); + P( A, B, C, D, X[ 2], 3 ); + P( D, A, B, C, X[10], 9 ); + P( C, D, A, B, X[ 6], 11 ); + P( B, C, D, A, X[14], 15 ); + P( A, B, C, D, X[ 1], 3 ); + P( D, A, B, C, X[ 9], 9 ); + P( C, D, A, B, X[ 5], 11 ); + P( B, C, D, A, X[13], 15 ); + P( A, B, C, D, X[ 3], 3 ); + P( D, A, B, C, X[11], 9 ); + P( C, D, A, B, X[ 7], 11 ); + P( B, C, D, A, X[15], 15 ); + +#undef F +#undef P + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; +} + +/* + * MD4 process buffer + */ +void md4_update( md4_context *ctx, const unsigned char *input, int ilen ) +{ + int fill; + unsigned long left; + + if( ilen <= 0 ) + return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += ilen; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < (unsigned long) ilen ) + ctx->total[1]++; + + if( left && ilen >= fill ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, fill ); + md4_process( ctx, ctx->buffer ); + input += fill; + ilen -= fill; + left = 0; + } + + while( ilen >= 64 ) + { + md4_process( ctx, input ); + input += 64; + ilen -= 64; + } + + if( ilen > 0 ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, ilen ); + } +} + +static const unsigned char md4_padding[64] = +{ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* + * MD4 final digest + */ +void md4_finish( md4_context *ctx, unsigned char output[16] ) +{ + unsigned long last, padn; + unsigned long high, low; + unsigned char msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_ULONG_LE( low, msglen, 0 ); + PUT_ULONG_LE( high, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + md4_update( ctx, md4_padding, padn ); + md4_update( ctx, msglen, 8 ); + + PUT_ULONG_LE( ctx->state[0], output, 0 ); + PUT_ULONG_LE( ctx->state[1], output, 4 ); + PUT_ULONG_LE( ctx->state[2], output, 8 ); + PUT_ULONG_LE( ctx->state[3], output, 12 ); +} + +/* + * output = MD4( input buffer ) + */ +void md4( unsigned char *input, int ilen, unsigned char output[16] ) +{ + md4_context ctx; + + md4_starts( &ctx ); + md4_update( &ctx, input, ilen ); + md4_finish( &ctx, output ); +} + +#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD4 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md5.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md5.c new file mode 100644 index 0000000..1ec4d81 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/md5.c @@ -0,0 +1,300 @@ +/* + * RFC 1321 compliant MD5 implementation + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * The MD5 algorithm was designed by Ron Rivest in 1991. + * + * http://www.ietf.org/rfc/rfc1321.txt + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD5 + +#include "netif/ppp/polarssl/md5.h" + +#include + +/* + * 32-bit integer manipulation macros (little endian) + */ +#ifndef GET_ULONG_LE +#define GET_ULONG_LE(n,b,i) \ +{ \ + (n) = ( (unsigned long) (b)[(i) ] ) \ + | ( (unsigned long) (b)[(i) + 1] << 8 ) \ + | ( (unsigned long) (b)[(i) + 2] << 16 ) \ + | ( (unsigned long) (b)[(i) + 3] << 24 ); \ +} +#endif + +#ifndef PUT_ULONG_LE +#define PUT_ULONG_LE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \ +} +#endif + +/* + * MD5 context setup + */ +void md5_starts( md5_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x67452301; + ctx->state[1] = 0xEFCDAB89; + ctx->state[2] = 0x98BADCFE; + ctx->state[3] = 0x10325476; +} + +static void md5_process( md5_context *ctx, const unsigned char data[64] ) +{ + unsigned long X[16], A, B, C, D; + + GET_ULONG_LE( X[ 0], data, 0 ); + GET_ULONG_LE( X[ 1], data, 4 ); + GET_ULONG_LE( X[ 2], data, 8 ); + GET_ULONG_LE( X[ 3], data, 12 ); + GET_ULONG_LE( X[ 4], data, 16 ); + GET_ULONG_LE( X[ 5], data, 20 ); + GET_ULONG_LE( X[ 6], data, 24 ); + GET_ULONG_LE( X[ 7], data, 28 ); + GET_ULONG_LE( X[ 8], data, 32 ); + GET_ULONG_LE( X[ 9], data, 36 ); + GET_ULONG_LE( X[10], data, 40 ); + GET_ULONG_LE( X[11], data, 44 ); + GET_ULONG_LE( X[12], data, 48 ); + GET_ULONG_LE( X[13], data, 52 ); + GET_ULONG_LE( X[14], data, 56 ); + GET_ULONG_LE( X[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) + +#define P(a,b,c,d,k,s,t) \ +{ \ + a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ +} + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + +#define F(x,y,z) (z ^ (x & (y ^ z))) + + P( A, B, C, D, 0, 7, 0xD76AA478 ); + P( D, A, B, C, 1, 12, 0xE8C7B756 ); + P( C, D, A, B, 2, 17, 0x242070DB ); + P( B, C, D, A, 3, 22, 0xC1BDCEEE ); + P( A, B, C, D, 4, 7, 0xF57C0FAF ); + P( D, A, B, C, 5, 12, 0x4787C62A ); + P( C, D, A, B, 6, 17, 0xA8304613 ); + P( B, C, D, A, 7, 22, 0xFD469501 ); + P( A, B, C, D, 8, 7, 0x698098D8 ); + P( D, A, B, C, 9, 12, 0x8B44F7AF ); + P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); + P( B, C, D, A, 11, 22, 0x895CD7BE ); + P( A, B, C, D, 12, 7, 0x6B901122 ); + P( D, A, B, C, 13, 12, 0xFD987193 ); + P( C, D, A, B, 14, 17, 0xA679438E ); + P( B, C, D, A, 15, 22, 0x49B40821 ); + +#undef F + +#define F(x,y,z) (y ^ (z & (x ^ y))) + + P( A, B, C, D, 1, 5, 0xF61E2562 ); + P( D, A, B, C, 6, 9, 0xC040B340 ); + P( C, D, A, B, 11, 14, 0x265E5A51 ); + P( B, C, D, A, 0, 20, 0xE9B6C7AA ); + P( A, B, C, D, 5, 5, 0xD62F105D ); + P( D, A, B, C, 10, 9, 0x02441453 ); + P( C, D, A, B, 15, 14, 0xD8A1E681 ); + P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); + P( A, B, C, D, 9, 5, 0x21E1CDE6 ); + P( D, A, B, C, 14, 9, 0xC33707D6 ); + P( C, D, A, B, 3, 14, 0xF4D50D87 ); + P( B, C, D, A, 8, 20, 0x455A14ED ); + P( A, B, C, D, 13, 5, 0xA9E3E905 ); + P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); + P( C, D, A, B, 7, 14, 0x676F02D9 ); + P( B, C, D, A, 12, 20, 0x8D2A4C8A ); + +#undef F + +#define F(x,y,z) (x ^ y ^ z) + + P( A, B, C, D, 5, 4, 0xFFFA3942 ); + P( D, A, B, C, 8, 11, 0x8771F681 ); + P( C, D, A, B, 11, 16, 0x6D9D6122 ); + P( B, C, D, A, 14, 23, 0xFDE5380C ); + P( A, B, C, D, 1, 4, 0xA4BEEA44 ); + P( D, A, B, C, 4, 11, 0x4BDECFA9 ); + P( C, D, A, B, 7, 16, 0xF6BB4B60 ); + P( B, C, D, A, 10, 23, 0xBEBFBC70 ); + P( A, B, C, D, 13, 4, 0x289B7EC6 ); + P( D, A, B, C, 0, 11, 0xEAA127FA ); + P( C, D, A, B, 3, 16, 0xD4EF3085 ); + P( B, C, D, A, 6, 23, 0x04881D05 ); + P( A, B, C, D, 9, 4, 0xD9D4D039 ); + P( D, A, B, C, 12, 11, 0xE6DB99E5 ); + P( C, D, A, B, 15, 16, 0x1FA27CF8 ); + P( B, C, D, A, 2, 23, 0xC4AC5665 ); + +#undef F + +#define F(x,y,z) (y ^ (x | ~z)) + + P( A, B, C, D, 0, 6, 0xF4292244 ); + P( D, A, B, C, 7, 10, 0x432AFF97 ); + P( C, D, A, B, 14, 15, 0xAB9423A7 ); + P( B, C, D, A, 5, 21, 0xFC93A039 ); + P( A, B, C, D, 12, 6, 0x655B59C3 ); + P( D, A, B, C, 3, 10, 0x8F0CCC92 ); + P( C, D, A, B, 10, 15, 0xFFEFF47D ); + P( B, C, D, A, 1, 21, 0x85845DD1 ); + P( A, B, C, D, 8, 6, 0x6FA87E4F ); + P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); + P( C, D, A, B, 6, 15, 0xA3014314 ); + P( B, C, D, A, 13, 21, 0x4E0811A1 ); + P( A, B, C, D, 4, 6, 0xF7537E82 ); + P( D, A, B, C, 11, 10, 0xBD3AF235 ); + P( C, D, A, B, 2, 15, 0x2AD7D2BB ); + P( B, C, D, A, 9, 21, 0xEB86D391 ); + +#undef F + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; +} + +/* + * MD5 process buffer + */ +void md5_update( md5_context *ctx, const unsigned char *input, int ilen ) +{ + int fill; + unsigned long left; + + if( ilen <= 0 ) + return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += ilen; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < (unsigned long) ilen ) + ctx->total[1]++; + + if( left && ilen >= fill ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, fill ); + md5_process( ctx, ctx->buffer ); + input += fill; + ilen -= fill; + left = 0; + } + + while( ilen >= 64 ) + { + md5_process( ctx, input ); + input += 64; + ilen -= 64; + } + + if( ilen > 0 ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, ilen ); + } +} + +static const unsigned char md5_padding[64] = +{ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* + * MD5 final digest + */ +void md5_finish( md5_context *ctx, unsigned char output[16] ) +{ + unsigned long last, padn; + unsigned long high, low; + unsigned char msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_ULONG_LE( low, msglen, 0 ); + PUT_ULONG_LE( high, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + md5_update( ctx, md5_padding, padn ); + md5_update( ctx, msglen, 8 ); + + PUT_ULONG_LE( ctx->state[0], output, 0 ); + PUT_ULONG_LE( ctx->state[1], output, 4 ); + PUT_ULONG_LE( ctx->state[2], output, 8 ); + PUT_ULONG_LE( ctx->state[3], output, 12 ); +} + +/* + * output = MD5( input buffer ) + */ +void md5( unsigned char *input, int ilen, unsigned char output[16] ) +{ + md5_context ctx; + + md5_starts( &ctx ); + md5_update( &ctx, input, ilen ); + md5_finish( &ctx, output ); +} + +#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD5 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c new file mode 100644 index 0000000..c2192ea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c @@ -0,0 +1,335 @@ +/* + * FIPS-180-1 compliant SHA-1 implementation + * + * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine + * + * Copyright (C) 2009 Paul Bakker + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names of PolarSSL or XySSL nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * The SHA-1 standard was published by NIST in 1993. + * + * http://www.itl.nist.gov/fipspubs/fip180-1.htm + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_SHA1 + +#include "netif/ppp/polarssl/sha1.h" + +#include + +/* + * 32-bit integer manipulation macros (big endian) + */ +#ifndef GET_ULONG_BE +#define GET_ULONG_BE(n,b,i) \ +{ \ + (n) = ( (unsigned long) (b)[(i) ] << 24 ) \ + | ( (unsigned long) (b)[(i) + 1] << 16 ) \ + | ( (unsigned long) (b)[(i) + 2] << 8 ) \ + | ( (unsigned long) (b)[(i) + 3] ); \ +} +#endif + +#ifndef PUT_ULONG_BE +#define PUT_ULONG_BE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) ); \ +} +#endif + +/* + * SHA-1 context setup + */ +void sha1_starts( sha1_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x67452301; + ctx->state[1] = 0xEFCDAB89; + ctx->state[2] = 0x98BADCFE; + ctx->state[3] = 0x10325476; + ctx->state[4] = 0xC3D2E1F0; +} + +static void sha1_process( sha1_context *ctx, const unsigned char data[64] ) +{ + unsigned long temp, W[16], A, B, C, D, E; + + GET_ULONG_BE( W[ 0], data, 0 ); + GET_ULONG_BE( W[ 1], data, 4 ); + GET_ULONG_BE( W[ 2], data, 8 ); + GET_ULONG_BE( W[ 3], data, 12 ); + GET_ULONG_BE( W[ 4], data, 16 ); + GET_ULONG_BE( W[ 5], data, 20 ); + GET_ULONG_BE( W[ 6], data, 24 ); + GET_ULONG_BE( W[ 7], data, 28 ); + GET_ULONG_BE( W[ 8], data, 32 ); + GET_ULONG_BE( W[ 9], data, 36 ); + GET_ULONG_BE( W[10], data, 40 ); + GET_ULONG_BE( W[11], data, 44 ); + GET_ULONG_BE( W[12], data, 48 ); + GET_ULONG_BE( W[13], data, 52 ); + GET_ULONG_BE( W[14], data, 56 ); + GET_ULONG_BE( W[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) + +#define R(t) \ +( \ + temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ + W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ + ( W[t & 0x0F] = S(temp,1) ) \ +) + +#define P(a,b,c,d,e,x) \ +{ \ + e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ +} + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + E = ctx->state[4]; + +#define F(x,y,z) (z ^ (x & (y ^ z))) +#define K 0x5A827999 + + P( A, B, C, D, E, W[0] ); + P( E, A, B, C, D, W[1] ); + P( D, E, A, B, C, W[2] ); + P( C, D, E, A, B, W[3] ); + P( B, C, D, E, A, W[4] ); + P( A, B, C, D, E, W[5] ); + P( E, A, B, C, D, W[6] ); + P( D, E, A, B, C, W[7] ); + P( C, D, E, A, B, W[8] ); + P( B, C, D, E, A, W[9] ); + P( A, B, C, D, E, W[10] ); + P( E, A, B, C, D, W[11] ); + P( D, E, A, B, C, W[12] ); + P( C, D, E, A, B, W[13] ); + P( B, C, D, E, A, W[14] ); + P( A, B, C, D, E, W[15] ); + P( E, A, B, C, D, R(16) ); + P( D, E, A, B, C, R(17) ); + P( C, D, E, A, B, R(18) ); + P( B, C, D, E, A, R(19) ); + +#undef K +#undef F + +#define F(x,y,z) (x ^ y ^ z) +#define K 0x6ED9EBA1 + + P( A, B, C, D, E, R(20) ); + P( E, A, B, C, D, R(21) ); + P( D, E, A, B, C, R(22) ); + P( C, D, E, A, B, R(23) ); + P( B, C, D, E, A, R(24) ); + P( A, B, C, D, E, R(25) ); + P( E, A, B, C, D, R(26) ); + P( D, E, A, B, C, R(27) ); + P( C, D, E, A, B, R(28) ); + P( B, C, D, E, A, R(29) ); + P( A, B, C, D, E, R(30) ); + P( E, A, B, C, D, R(31) ); + P( D, E, A, B, C, R(32) ); + P( C, D, E, A, B, R(33) ); + P( B, C, D, E, A, R(34) ); + P( A, B, C, D, E, R(35) ); + P( E, A, B, C, D, R(36) ); + P( D, E, A, B, C, R(37) ); + P( C, D, E, A, B, R(38) ); + P( B, C, D, E, A, R(39) ); + +#undef K +#undef F + +#define F(x,y,z) ((x & y) | (z & (x | y))) +#define K 0x8F1BBCDC + + P( A, B, C, D, E, R(40) ); + P( E, A, B, C, D, R(41) ); + P( D, E, A, B, C, R(42) ); + P( C, D, E, A, B, R(43) ); + P( B, C, D, E, A, R(44) ); + P( A, B, C, D, E, R(45) ); + P( E, A, B, C, D, R(46) ); + P( D, E, A, B, C, R(47) ); + P( C, D, E, A, B, R(48) ); + P( B, C, D, E, A, R(49) ); + P( A, B, C, D, E, R(50) ); + P( E, A, B, C, D, R(51) ); + P( D, E, A, B, C, R(52) ); + P( C, D, E, A, B, R(53) ); + P( B, C, D, E, A, R(54) ); + P( A, B, C, D, E, R(55) ); + P( E, A, B, C, D, R(56) ); + P( D, E, A, B, C, R(57) ); + P( C, D, E, A, B, R(58) ); + P( B, C, D, E, A, R(59) ); + +#undef K +#undef F + +#define F(x,y,z) (x ^ y ^ z) +#define K 0xCA62C1D6 + + P( A, B, C, D, E, R(60) ); + P( E, A, B, C, D, R(61) ); + P( D, E, A, B, C, R(62) ); + P( C, D, E, A, B, R(63) ); + P( B, C, D, E, A, R(64) ); + P( A, B, C, D, E, R(65) ); + P( E, A, B, C, D, R(66) ); + P( D, E, A, B, C, R(67) ); + P( C, D, E, A, B, R(68) ); + P( B, C, D, E, A, R(69) ); + P( A, B, C, D, E, R(70) ); + P( E, A, B, C, D, R(71) ); + P( D, E, A, B, C, R(72) ); + P( C, D, E, A, B, R(73) ); + P( B, C, D, E, A, R(74) ); + P( A, B, C, D, E, R(75) ); + P( E, A, B, C, D, R(76) ); + P( D, E, A, B, C, R(77) ); + P( C, D, E, A, B, R(78) ); + P( B, C, D, E, A, R(79) ); + +#undef K +#undef F + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; + ctx->state[4] += E; +} + +/* + * SHA-1 process buffer + */ +void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen ) +{ + int fill; + unsigned long left; + + if( ilen <= 0 ) + return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += ilen; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < (unsigned long) ilen ) + ctx->total[1]++; + + if( left && ilen >= fill ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, fill ); + sha1_process( ctx, ctx->buffer ); + input += fill; + ilen -= fill; + left = 0; + } + + while( ilen >= 64 ) + { + sha1_process( ctx, input ); + input += 64; + ilen -= 64; + } + + if( ilen > 0 ) + { + MEMCPY( (void *) (ctx->buffer + left), + input, ilen ); + } +} + +static const unsigned char sha1_padding[64] = +{ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* + * SHA-1 final digest + */ +void sha1_finish( sha1_context *ctx, unsigned char output[20] ) +{ + unsigned long last, padn; + unsigned long high, low; + unsigned char msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_ULONG_BE( high, msglen, 0 ); + PUT_ULONG_BE( low, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + sha1_update( ctx, sha1_padding, padn ); + sha1_update( ctx, msglen, 8 ); + + PUT_ULONG_BE( ctx->state[0], output, 0 ); + PUT_ULONG_BE( ctx->state[1], output, 4 ); + PUT_ULONG_BE( ctx->state[2], output, 8 ); + PUT_ULONG_BE( ctx->state[3], output, 12 ); + PUT_ULONG_BE( ctx->state[4], output, 16 ); +} + +/* + * output = SHA-1( input buffer ) + */ +void sha1( unsigned char *input, int ilen, unsigned char output[20] ) +{ + sha1_context ctx; + + sha1_starts( &ctx ); + sha1_update( &ctx, input, ilen ); + sha1_finish( &ctx, output ); +} + +#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_SHA1 */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ppp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ppp.c new file mode 100644 index 0000000..8b77765 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/ppp.c @@ -0,0 +1,1647 @@ +/***************************************************************************** +* ppp.c - Network Point to Point Protocol program file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* portions Copyright (c) 1997 by Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 97-11-05 Guy Lancaster , Global Election Systems Inc. +* Original. +*****************************************************************************/ + +/* + * ppp_defs.h - PPP definitions. + * + * if_pppvar.h - private structures and declarations for PPP. + * + * Copyright (c) 1994 The Australian National University. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation is hereby granted, provided that the above copyright + * notice appears in all copies. This software is provided without any + * warranty, express or implied. The Australian National University + * makes no representations about the suitability of this software for + * any purpose. + * + * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF + * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO + * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, + * OR MODIFICATIONS. + */ + +/* + * if_ppp.h - Point-to-Point Protocol definitions. + * + * Copyright (c) 1989 Carnegie Mellon University. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by Carnegie Mellon University. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @defgroup ppp PPP netif + * @ingroup addons + * @verbinclude "ppp.txt" + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/pbuf.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/tcpip.h" +#include "lwip/api.h" +#include "lwip/snmp.h" +#include "lwip/ip4.h" /* for ip4_input() */ +#if PPP_IPV6_SUPPORT +#include "lwip/ip6.h" /* for ip6_input() */ +#endif /* PPP_IPV6_SUPPORT */ +#include "lwip/dns.h" + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/pppos.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/lcp.h" +#include "netif/ppp/magic.h" + +#if PAP_SUPPORT +#include "netif/ppp/upap.h" +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT +#include "netif/ppp/chap-new.h" +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT +#include "netif/ppp/eap.h" +#endif /* EAP_SUPPORT */ +#if CCP_SUPPORT +#include "netif/ppp/ccp.h" +#endif /* CCP_SUPPORT */ +#if MPPE_SUPPORT +#include "netif/ppp/mppe.h" +#endif /* MPPE_SUPPORT */ +#if ECP_SUPPORT +#include "netif/ppp/ecp.h" +#endif /* EAP_SUPPORT */ +#if VJ_SUPPORT +#include "netif/ppp/vj.h" +#endif /* VJ_SUPPORT */ +#if PPP_IPV4_SUPPORT +#include "netif/ppp/ipcp.h" +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT +#include "netif/ppp/ipv6cp.h" +#endif /* PPP_IPV6_SUPPORT */ + +/*************************/ +/*** LOCAL DEFINITIONS ***/ +/*************************/ + +/* Memory pools */ +#if PPPOS_SUPPORT +LWIP_MEMPOOL_PROTOTYPE(PPPOS_PCB); +#endif +#if PPPOE_SUPPORT +LWIP_MEMPOOL_PROTOTYPE(PPPOE_IF); +#endif +#if PPPOL2TP_SUPPORT +LWIP_MEMPOOL_PROTOTYPE(PPPOL2TP_PCB); +#endif +#if LWIP_PPP_API && LWIP_MPU_COMPATIBLE +LWIP_MEMPOOL_PROTOTYPE(PPPAPI_MSG); +#endif +LWIP_MEMPOOL_DECLARE(PPP_PCB, MEMP_NUM_PPP_PCB, sizeof(ppp_pcb), "PPP_PCB") + +/* FIXME: add stats per PPP session */ +#if PPP_STATS_SUPPORT +static struct timeval start_time; /* Time when link was started. */ +static struct pppd_stats old_link_stats; +struct pppd_stats link_stats; +unsigned link_connect_time; +int link_stats_valid; +#endif /* PPP_STATS_SUPPORT */ + +/* + * PPP Data Link Layer "protocol" table. + * One entry per supported protocol. + * The last entry must be NULL. + */ +const struct protent* const protocols[] = { + &lcp_protent, +#if PAP_SUPPORT + &pap_protent, +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + &chap_protent, +#endif /* CHAP_SUPPORT */ +#if CBCP_SUPPORT + &cbcp_protent, +#endif /* CBCP_SUPPORT */ +#if PPP_IPV4_SUPPORT + &ipcp_protent, +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + &ipv6cp_protent, +#endif /* PPP_IPV6_SUPPORT */ +#if CCP_SUPPORT + &ccp_protent, +#endif /* CCP_SUPPORT */ +#if ECP_SUPPORT + &ecp_protent, +#endif /* ECP_SUPPORT */ +#ifdef AT_CHANGE + &atcp_protent, +#endif /* AT_CHANGE */ +#if EAP_SUPPORT + &eap_protent, +#endif /* EAP_SUPPORT */ + NULL +}; + +/* Prototypes for procedures local to this file. */ +static void ppp_do_connect(void *arg); +static err_t ppp_netif_init_cb(struct netif *netif); +#if LWIP_IPV4 +static err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip4_addr_t *ipaddr); +#endif /* LWIP_IPV4 */ +#if PPP_IPV6_SUPPORT +static err_t ppp_netif_output_ip6(struct netif *netif, struct pbuf *pb, const ip6_addr_t *ipaddr); +#endif /* PPP_IPV6_SUPPORT */ +static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protocol); + +/***********************************/ +/*** PUBLIC FUNCTION DEFINITIONS ***/ +/***********************************/ +#if PPP_AUTH_SUPPORT +void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd) { +#if PAP_SUPPORT + pcb->settings.refuse_pap = !(authtype & PPPAUTHTYPE_PAP); +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + pcb->settings.refuse_chap = !(authtype & PPPAUTHTYPE_CHAP); +#if MSCHAP_SUPPORT + pcb->settings.refuse_mschap = !(authtype & PPPAUTHTYPE_MSCHAP); + pcb->settings.refuse_mschap_v2 = !(authtype & PPPAUTHTYPE_MSCHAP_V2); +#endif /* MSCHAP_SUPPORT */ +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + pcb->settings.refuse_eap = !(authtype & PPPAUTHTYPE_EAP); +#endif /* EAP_SUPPORT */ + pcb->settings.user = user; + pcb->settings.passwd = passwd; +} +#endif /* PPP_AUTH_SUPPORT */ + +#if MPPE_SUPPORT +/* Set MPPE configuration */ +void ppp_set_mppe(ppp_pcb *pcb, u8_t flags) { + if (flags == PPP_MPPE_DISABLE) { + pcb->settings.require_mppe = 0; + return; + } + + pcb->settings.require_mppe = 1; + pcb->settings.refuse_mppe_stateful = !(flags & PPP_MPPE_ALLOW_STATEFUL); + pcb->settings.refuse_mppe_40 = !!(flags & PPP_MPPE_REFUSE_40); + pcb->settings.refuse_mppe_128 = !!(flags & PPP_MPPE_REFUSE_128); +} +#endif /* MPPE_SUPPORT */ + +#if PPP_NOTIFY_PHASE +void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb) { + pcb->notify_phase_cb = notify_phase_cb; + notify_phase_cb(pcb, pcb->phase, pcb->ctx_cb); +} +#endif /* PPP_NOTIFY_PHASE */ + +/* + * Initiate a PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * Holdoff is the time to wait (in seconds) before initiating + * the connection. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff) { + if (pcb->phase != PPP_PHASE_DEAD) { + return ERR_ALREADY; + } + + PPPDEBUG(LOG_DEBUG, ("ppp_connect[%d]: holdoff=%d\n", pcb->netif->num, holdoff)); + + if (holdoff == 0) { + ppp_do_connect(pcb); + return ERR_OK; + } + + new_phase(pcb, PPP_PHASE_HOLDOFF); + sys_timeout((u32_t)(holdoff*1000), ppp_do_connect, pcb); + return ERR_OK; +} + +#if PPP_SERVER +/* + * Listen for an incoming PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_listen(ppp_pcb *pcb) { + if (pcb->phase != PPP_PHASE_DEAD) { + return ERR_ALREADY; + } + + PPPDEBUG(LOG_DEBUG, ("ppp_listen[%d]\n", pcb->netif->num)); + + if (pcb->link_cb->listen) { + new_phase(pcb, PPP_PHASE_INITIALIZE); + pcb->link_cb->listen(pcb, pcb->link_ctx_cb); + return ERR_OK; + } + return ERR_IF; +} +#endif /* PPP_SERVER */ + +/* + * Initiate the end of a PPP connection. + * Any outstanding packets in the queues are dropped. + * + * Setting nocarrier to 1 close the PPP connection without initiating the + * shutdown procedure. Always using nocarrier = 0 is still recommended, + * this is going to take a little longer time if your link is down, but + * is a safer choice for the PPP state machine. + * + * Return 0 on success, an error code on failure. + */ +err_t +ppp_close(ppp_pcb *pcb, u8_t nocarrier) +{ + pcb->err_code = PPPERR_USER; + + /* holdoff phase, cancel the reconnection */ + if (pcb->phase == PPP_PHASE_HOLDOFF) { + sys_untimeout(ppp_do_connect, pcb); + new_phase(pcb, PPP_PHASE_DEAD); + } + + /* dead phase, nothing to do, call the status callback to be consistent */ + if (pcb->phase == PPP_PHASE_DEAD) { + pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb); + return ERR_OK; + } + + /* Already terminating, nothing to do */ + if (pcb->phase >= PPP_PHASE_TERMINATE) { + return ERR_INPROGRESS; + } + + /* LCP not open, close link protocol */ + if (pcb->phase < PPP_PHASE_ESTABLISH) { + new_phase(pcb, PPP_PHASE_DISCONNECT); + ppp_link_terminated(pcb); + return ERR_OK; + } + + /* + * Only accept carrier lost signal on the stable running phase in order + * to prevent changing the PPP phase FSM in transition phases. + * + * Always using nocarrier = 0 is still recommended, this is going to + * take a little longer time, but is a safer choice from FSM point of view. + */ + if (nocarrier && pcb->phase == PPP_PHASE_RUNNING) { + PPPDEBUG(LOG_DEBUG, ("ppp_close[%d]: carrier lost -> lcp_lowerdown\n", pcb->netif->num)); + lcp_lowerdown(pcb); + /* forced link termination, this will force link protocol to disconnect. */ + link_terminated(pcb); + return ERR_OK; + } + + /* Disconnect */ + PPPDEBUG(LOG_DEBUG, ("ppp_close[%d]: kill_link -> lcp_close\n", pcb->netif->num)); + /* LCP soft close request. */ + lcp_close(pcb, "User request"); + return ERR_OK; +} + +/* + * Release the control block. + * + * This can only be called if PPP is in the dead phase. + * + * You must use ppp_close() before if you wish to terminate + * an established PPP session. + * + * Return 0 on success, an error code on failure. + */ +err_t ppp_free(ppp_pcb *pcb) { + err_t err; + if (pcb->phase != PPP_PHASE_DEAD) { + return ERR_CONN; + } + + PPPDEBUG(LOG_DEBUG, ("ppp_free[%d]\n", pcb->netif->num)); + + netif_remove(pcb->netif); + + err = pcb->link_cb->free(pcb, pcb->link_ctx_cb); + + LWIP_MEMPOOL_FREE(PPP_PCB, pcb); + return err; +} + +/* Get and set parameters for the given connection. + * Return 0 on success, an error code on failure. */ +err_t +ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg) +{ + if (pcb == NULL) { + return ERR_VAL; + } + + switch(cmd) { + case PPPCTLG_UPSTATUS: /* Get the PPP up status. */ + if (!arg) { + goto fail; + } + *(int *)arg = (int)(0 +#if PPP_IPV4_SUPPORT + || pcb->if4_up +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + || pcb->if6_up +#endif /* PPP_IPV6_SUPPORT */ + ); + return ERR_OK; + + case PPPCTLG_ERRCODE: /* Get the PPP error code. */ + if (!arg) { + goto fail; + } + *(int *)arg = (int)(pcb->err_code); + return ERR_OK; + + default: + goto fail; + } + +fail: + return ERR_VAL; +} + + +/**********************************/ +/*** LOCAL FUNCTION DEFINITIONS ***/ +/**********************************/ + +static void ppp_do_connect(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF", pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF); + + new_phase(pcb, PPP_PHASE_INITIALIZE); + pcb->link_cb->connect(pcb, pcb->link_ctx_cb); +} + +/* + * ppp_netif_init_cb - netif init callback + */ +static err_t ppp_netif_init_cb(struct netif *netif) { + netif->name[0] = 'p'; + netif->name[1] = 'p'; +#if LWIP_IPV4 + /* FIXME: change that when netif_null_output_ip4() will materialize */ + netif->output = ppp_netif_output_ip4; +#endif /* LWIP_IPV4 */ +#if PPP_IPV6_SUPPORT + netif->output_ip6 = ppp_netif_output_ip6; +#endif /* PPP_IPV6_SUPPORT */ + netif->flags = NETIF_FLAG_UP; +#if LWIP_NETIF_HOSTNAME + /* @todo: Initialize interface hostname */ + /* netif_set_hostname(netif, "lwip"); */ +#endif /* LWIP_NETIF_HOSTNAME */ + return ERR_OK; +} + +#if LWIP_IPV4 +/* + * Send an IPv4 packet on the given connection. + */ +static err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip4_addr_t *ipaddr) { + LWIP_UNUSED_ARG(ipaddr); +#if PPP_IPV4_SUPPORT + return ppp_netif_output(netif, pb, PPP_IP); +#else /* PPP_IPV4_SUPPORT */ + LWIP_UNUSED_ARG(netif); + LWIP_UNUSED_ARG(pb); + return ERR_IF; +#endif /* PPP_IPV4_SUPPORT */ +} +#endif /* LWIP_IPV4 */ + +#if PPP_IPV6_SUPPORT +/* + * Send an IPv6 packet on the given connection. + */ +static err_t ppp_netif_output_ip6(struct netif *netif, struct pbuf *pb, const ip6_addr_t *ipaddr) { + LWIP_UNUSED_ARG(ipaddr); + return ppp_netif_output(netif, pb, PPP_IPV6); +} +#endif /* PPP_IPV6_SUPPORT */ + +static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protocol) { + ppp_pcb *pcb = (ppp_pcb*)netif->state; + err_t err; + struct pbuf *fpb = NULL; + + /* Check that the link is up. */ + if (0 +#if PPP_IPV4_SUPPORT + || (protocol == PPP_IP && !pcb->if4_up) +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + || (protocol == PPP_IPV6 && !pcb->if6_up) +#endif /* PPP_IPV6_SUPPORT */ + ) { + PPPDEBUG(LOG_ERR, ("ppp_netif_output[%d]: link not up\n", pcb->netif->num)); + goto err_rte_drop; + } + +#if MPPE_SUPPORT + /* If MPPE is required, refuse any IP packet until we are able to crypt them. */ + if (pcb->settings.require_mppe && pcb->ccp_transmit_method != CI_MPPE) { + PPPDEBUG(LOG_ERR, ("ppp_netif_output[%d]: MPPE required, not up\n", pcb->netif->num)); + goto err_rte_drop; + } +#endif /* MPPE_SUPPORT */ + +#if VJ_SUPPORT + /* + * Attempt Van Jacobson header compression if VJ is configured and + * this is an IP packet. + */ + if (protocol == PPP_IP && pcb->vj_enabled) { + switch (vj_compress_tcp(&pcb->vj_comp, &pb)) { + case TYPE_IP: + /* No change... + protocol = PPP_IP; */ + break; + case TYPE_COMPRESSED_TCP: + /* vj_compress_tcp() returns a new allocated pbuf, indicate we should free + * our duplicated pbuf later */ + fpb = pb; + protocol = PPP_VJC_COMP; + break; + case TYPE_UNCOMPRESSED_TCP: + /* vj_compress_tcp() returns a new allocated pbuf, indicate we should free + * our duplicated pbuf later */ + fpb = pb; + protocol = PPP_VJC_UNCOMP; + break; + default: + PPPDEBUG(LOG_WARNING, ("ppp_netif_output[%d]: bad IP packet\n", pcb->netif->num)); + LINK_STATS_INC(link.proterr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(pcb->netif, ifoutdiscards); + return ERR_VAL; + } + } +#endif /* VJ_SUPPORT */ + +#if CCP_SUPPORT + switch (pcb->ccp_transmit_method) { + case 0: + break; /* Don't compress */ +#if MPPE_SUPPORT + case CI_MPPE: + if ((err = mppe_compress(pcb, &pcb->mppe_comp, &pb, protocol)) != ERR_OK) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(netif, ifoutdiscards); + goto err; + } + /* if VJ compressor returned a new allocated pbuf, free it */ + if (fpb) { + pbuf_free(fpb); + } + /* mppe_compress() returns a new allocated pbuf, indicate we should free + * our duplicated pbuf later */ + fpb = pb; + protocol = PPP_COMP; + break; +#endif /* MPPE_SUPPORT */ + default: + PPPDEBUG(LOG_ERR, ("ppp_netif_output[%d]: bad CCP transmit method\n", pcb->netif->num)); + goto err_rte_drop; /* Cannot really happen, we only negotiate what we are able to do */ + } +#endif /* CCP_SUPPORT */ + + err = pcb->link_cb->netif_output(pcb, pcb->link_ctx_cb, pb, protocol); + goto err; + +err_rte_drop: + err = ERR_RTE; + LINK_STATS_INC(link.rterr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(netif, ifoutdiscards); +err: + if (fpb) { + pbuf_free(fpb); + } + return err; +} + +/************************************/ +/*** PRIVATE FUNCTION DEFINITIONS ***/ +/************************************/ + +/* Initialize the PPP subsystem. */ +int ppp_init(void) +{ +#if PPPOS_SUPPORT + LWIP_MEMPOOL_INIT(PPPOS_PCB); +#endif +#if PPPOE_SUPPORT + LWIP_MEMPOOL_INIT(PPPOE_IF); +#endif +#if PPPOL2TP_SUPPORT + LWIP_MEMPOOL_INIT(PPPOL2TP_PCB); +#endif +#if LWIP_PPP_API && LWIP_MPU_COMPATIBLE + LWIP_MEMPOOL_INIT(PPPAPI_MSG); +#endif + + LWIP_MEMPOOL_INIT(PPP_PCB); + + /* + * Initialize magic number generator now so that protocols may + * use magic numbers in initialization. + */ + magic_init(); + + return 0; +} + +/* + * Create a new PPP control block. + * + * This initializes the PPP control block but does not + * attempt to negotiate the LCP session. + * + * Return a new PPP connection control block pointer + * on success or a null pointer on failure. + */ +ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, void *link_ctx_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb) { + ppp_pcb *pcb; + const struct protent *protp; + int i; + + /* PPP is single-threaded: without a callback, + * there is no way to know when the link is up. */ + if (link_status_cb == NULL) { + return NULL; + } + + pcb = (ppp_pcb*)LWIP_MEMPOOL_ALLOC(PPP_PCB); + if (pcb == NULL) { + return NULL; + } + + memset(pcb, 0, sizeof(ppp_pcb)); + + /* default configuration */ +#if PAP_SUPPORT + pcb->settings.pap_timeout_time = UPAP_DEFTIMEOUT; + pcb->settings.pap_max_transmits = UPAP_DEFTRANSMITS; +#if PPP_SERVER + pcb->settings.pap_req_timeout = UPAP_DEFREQTIME; +#endif /* PPP_SERVER */ +#endif /* PAP_SUPPORT */ + +#if CHAP_SUPPORT + pcb->settings.chap_timeout_time = CHAP_DEFTIMEOUT; + pcb->settings.chap_max_transmits = CHAP_DEFTRANSMITS; +#if PPP_SERVER + pcb->settings.chap_rechallenge_time = CHAP_DEFRECHALLENGETIME; +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPPORT */ + +#if EAP_SUPPORT + pcb->settings.eap_req_time = EAP_DEFREQTIME; + pcb->settings.eap_allow_req = EAP_DEFALLOWREQ; +#if PPP_SERVER + pcb->settings.eap_timeout_time = EAP_DEFTIMEOUT; + pcb->settings.eap_max_transmits = EAP_DEFTRANSMITS; +#endif /* PPP_SERVER */ +#endif /* EAP_SUPPORT */ + + pcb->settings.lcp_loopbackfail = LCP_DEFLOOPBACKFAIL; + pcb->settings.lcp_echo_interval = LCP_ECHOINTERVAL; + pcb->settings.lcp_echo_fails = LCP_MAXECHOFAILS; + + pcb->settings.fsm_timeout_time = FSM_DEFTIMEOUT; + pcb->settings.fsm_max_conf_req_transmits = FSM_DEFMAXCONFREQS; + pcb->settings.fsm_max_term_transmits = FSM_DEFMAXTERMREQS; + pcb->settings.fsm_max_nak_loops = FSM_DEFMAXNAKLOOPS; + + pcb->netif = pppif; + MIB2_INIT_NETIF(pppif, snmp_ifType_ppp, 0); + if (!netif_add(pcb->netif, +#if LWIP_IPV4 + IP4_ADDR_ANY4, IP4_ADDR_BROADCAST, IP4_ADDR_ANY4, +#endif /* LWIP_IPV4 */ + (void *)pcb, ppp_netif_init_cb, NULL)) { + LWIP_MEMPOOL_FREE(PPP_PCB, pcb); + PPPDEBUG(LOG_ERR, ("ppp_new: netif_add failed\n")); + return NULL; + } + + pcb->link_cb = callbacks; + pcb->link_ctx_cb = link_ctx_cb; + pcb->link_status_cb = link_status_cb; + pcb->ctx_cb = ctx_cb; + + /* + * Initialize each protocol. + */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) { + (*protp->init)(pcb); + } + + new_phase(pcb, PPP_PHASE_DEAD); + return pcb; +} + +/** Initiate LCP open request */ +void ppp_start(ppp_pcb *pcb) { + PPPDEBUG(LOG_DEBUG, ("ppp_start[%d]\n", pcb->netif->num)); + + /* Clean data not taken care by anything else, mostly shared data. */ +#if PPP_STATS_SUPPORT + link_stats_valid = 0; +#endif /* PPP_STATS_SUPPORT */ +#if MPPE_SUPPORT + pcb->mppe_keys_set = 0; + memset(&pcb->mppe_comp, 0, sizeof(pcb->mppe_comp)); + memset(&pcb->mppe_decomp, 0, sizeof(pcb->mppe_decomp)); +#endif /* MPPE_SUPPORT */ +#if VJ_SUPPORT + vj_compress_init(&pcb->vj_comp); +#endif /* VJ_SUPPORT */ + + /* Start protocol */ + new_phase(pcb, PPP_PHASE_ESTABLISH); + lcp_open(pcb); + lcp_lowerup(pcb); + PPPDEBUG(LOG_DEBUG, ("ppp_start[%d]: finished\n", pcb->netif->num)); +} + +/** Called when link failed to setup */ +void ppp_link_failed(ppp_pcb *pcb) { + PPPDEBUG(LOG_DEBUG, ("ppp_link_failed[%d]\n", pcb->netif->num)); + new_phase(pcb, PPP_PHASE_DEAD); + pcb->err_code = PPPERR_OPEN; + pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb); +} + +/** Called when link is normally down (i.e. it was asked to end) */ +void ppp_link_end(ppp_pcb *pcb) { + PPPDEBUG(LOG_DEBUG, ("ppp_link_end[%d]\n", pcb->netif->num)); + new_phase(pcb, PPP_PHASE_DEAD); + if (pcb->err_code == PPPERR_NONE) { + pcb->err_code = PPPERR_CONNECT; + } + pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb); +} + +/* + * Pass the processed input packet to the appropriate handler. + * This function and all handlers run in the context of the tcpip_thread + */ +void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { + u16_t protocol; +#if PPP_DEBUG && PPP_PROTOCOLNAME + const char *pname; +#endif /* PPP_DEBUG && PPP_PROTOCOLNAME */ + + magic_randomize(); + + if (pb->len < 2) { + PPPDEBUG(LOG_ERR, ("ppp_input[%d]: packet too short\n", pcb->netif->num)); + goto drop; + } + protocol = (((u8_t *)pb->payload)[0] << 8) | ((u8_t*)pb->payload)[1]; + +#if PRINTPKT_SUPPORT + ppp_dump_packet(pcb, "rcvd", (unsigned char *)pb->payload, pb->len); +#endif /* PRINTPKT_SUPPORT */ + + pbuf_header(pb, -(s16_t)sizeof(protocol)); + + LINK_STATS_INC(link.recv); + MIB2_STATS_NETIF_INC(pcb->netif, ifinucastpkts); + MIB2_STATS_NETIF_ADD(pcb->netif, ifinoctets, pb->tot_len); + + /* + * Toss all non-LCP packets unless LCP is OPEN. + */ + if (protocol != PPP_LCP && pcb->lcp_fsm.state != PPP_FSM_OPENED) { + ppp_dbglog("Discarded non-LCP packet when LCP not open"); + goto drop; + } + + /* + * Until we get past the authentication phase, toss all packets + * except LCP, LQR and authentication packets. + */ + if (pcb->phase <= PPP_PHASE_AUTHENTICATE + && !(protocol == PPP_LCP +#if LQR_SUPPORT + || protocol == PPP_LQR +#endif /* LQR_SUPPORT */ +#if PAP_SUPPORT + || protocol == PPP_PAP +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + || protocol == PPP_CHAP +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + || protocol == PPP_EAP +#endif /* EAP_SUPPORT */ + )) { + ppp_dbglog("discarding proto 0x%x in phase %d", protocol, pcb->phase); + goto drop; + } + +#if CCP_SUPPORT +#if MPPE_SUPPORT + /* + * MPPE is required and unencrypted data has arrived (this + * should never happen!). We should probably drop the link if + * the protocol is in the range of what should be encrypted. + * At the least, we drop this packet. + */ + if (pcb->settings.require_mppe && protocol != PPP_COMP && protocol < 0x8000) { + PPPDEBUG(LOG_ERR, ("ppp_input[%d]: MPPE required, received unencrypted data!\n", pcb->netif->num)); + goto drop; + } +#endif /* MPPE_SUPPORT */ + + if (protocol == PPP_COMP) { + u8_t *pl; + + switch (pcb->ccp_receive_method) { +#if MPPE_SUPPORT + case CI_MPPE: + if (mppe_decompress(pcb, &pcb->mppe_decomp, &pb) != ERR_OK) { + goto drop; + } + break; +#endif /* MPPE_SUPPORT */ + default: + PPPDEBUG(LOG_ERR, ("ppp_input[%d]: bad CCP receive method\n", pcb->netif->num)); + goto drop; /* Cannot really happen, we only negotiate what we are able to do */ + } + + /* Assume no PFC */ + if (pb->len < 2) { + goto drop; + } + + /* Extract and hide protocol (do PFC decompression if necessary) */ + pl = (u8_t*)pb->payload; + if (pl[0] & 0x01) { + protocol = pl[0]; + pbuf_header(pb, -(s16_t)1); + } else { + protocol = (pl[0] << 8) | pl[1]; + pbuf_header(pb, -(s16_t)2); + } + } +#endif /* CCP_SUPPORT */ + + switch(protocol) { + +#if PPP_IPV4_SUPPORT + case PPP_IP: /* Internet Protocol */ + PPPDEBUG(LOG_INFO, ("ppp_input[%d]: ip in pbuf len=%d\n", pcb->netif->num, pb->tot_len)); + ip4_input(pb, pcb->netif); + return; +#endif /* PPP_IPV4_SUPPORT */ + +#if PPP_IPV6_SUPPORT + case PPP_IPV6: /* Internet Protocol Version 6 */ + PPPDEBUG(LOG_INFO, ("ppp_input[%d]: ip6 in pbuf len=%d\n", pcb->netif->num, pb->tot_len)); + ip6_input(pb, pcb->netif); + return; +#endif /* PPP_IPV6_SUPPORT */ + +#if VJ_SUPPORT + case PPP_VJC_COMP: /* VJ compressed TCP */ + /* + * Clip off the VJ header and prepend the rebuilt TCP/IP header and + * pass the result to IP. + */ + PPPDEBUG(LOG_INFO, ("ppp_input[%d]: vj_comp in pbuf len=%d\n", pcb->netif->num, pb->tot_len)); + if (pcb->vj_enabled && vj_uncompress_tcp(&pb, &pcb->vj_comp) >= 0) { + ip4_input(pb, pcb->netif); + return; + } + /* Something's wrong so drop it. */ + PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ compressed\n", pcb->netif->num)); + break; + + case PPP_VJC_UNCOMP: /* VJ uncompressed TCP */ + /* + * Process the TCP/IP header for VJ header compression and then pass + * the packet to IP. + */ + PPPDEBUG(LOG_INFO, ("ppp_input[%d]: vj_un in pbuf len=%d\n", pcb->netif->num, pb->tot_len)); + if (pcb->vj_enabled && vj_uncompress_uncomp(pb, &pcb->vj_comp) >= 0) { + ip4_input(pb, pcb->netif); + return; + } + /* Something's wrong so drop it. */ + PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ uncompressed\n", pcb->netif->num)); + break; +#endif /* VJ_SUPPORT */ + + default: { + int i; + const struct protent *protp; + + /* + * Upcall the proper protocol input routine. + */ + for (i = 0; (protp = protocols[i]) != NULL; ++i) { + if (protp->protocol == protocol) { + pb = ppp_singlebuf(pb); + (*protp->input)(pcb, (u8_t*)pb->payload, pb->len); + goto out; + } +#if 0 /* UNUSED + * + * This is actually a (hacked?) way for the Linux kernel to pass a data + * packet to pppd. pppd in normal condition only do signaling + * (LCP, PAP, CHAP, IPCP, ...) and does not handle any data packet at all. + * + * We don't even need this interface, which is only there because of PPP + * interface limitation between Linux kernel and pppd. For MPPE, which uses + * CCP to negotiate although it is not really a (de)compressor, we added + * ccp_resetrequest() in CCP and MPPE input data flow is calling either + * ccp_resetrequest() or lcp_close() if the issue is, respectively, non-fatal + * or fatal, this is what ccp_datainput() really do. + */ + if (protocol == (protp->protocol & ~0x8000) + && protp->datainput != NULL) { + (*protp->datainput)(pcb, pb->payload, pb->len); + goto out; + } +#endif /* UNUSED */ + } + +#if PPP_DEBUG +#if PPP_PROTOCOLNAME + pname = protocol_name(protocol); + if (pname != NULL) { + ppp_warn("Unsupported protocol '%s' (0x%x) received", pname, protocol); + } else +#endif /* PPP_PROTOCOLNAME */ + ppp_warn("Unsupported protocol 0x%x received", protocol); +#endif /* PPP_DEBUG */ + pbuf_header(pb, (s16_t)sizeof(protocol)); + lcp_sprotrej(pcb, (u8_t*)pb->payload, pb->len); + } + break; + } + +drop: + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(pcb->netif, ifindiscards); + +out: + pbuf_free(pb); +} + +/* merge a pbuf chain into one pbuf */ +struct pbuf *ppp_singlebuf(struct pbuf *p) { + struct pbuf *q, *b; + u8_t *pl; + + if(p->tot_len == p->len) { + return p; + } + + q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); + if(!q) { + PPPDEBUG(LOG_ERR, + ("ppp_singlebuf: unable to alloc new buf (%d)\n", p->tot_len)); + return p; /* live dangerously */ + } + + for(b = p, pl = (u8_t*)q->payload; b != NULL; b = b->next) { + MEMCPY(pl, b->payload, b->len); + pl += b->len; + } + + pbuf_free(p); + + return q; +} + +/* + * Write a pbuf to a ppp link, only used from PPP functions + * to send PPP packets. + * + * IPv4 and IPv6 packets from lwIP are sent, respectively, + * with ppp_netif_output_ip4() and ppp_netif_output_ip6() + * functions (which are callbacks of the netif PPP interface). + */ +err_t ppp_write(ppp_pcb *pcb, struct pbuf *p) { +#if PRINTPKT_SUPPORT + ppp_dump_packet(pcb, "sent", (unsigned char *)p->payload+2, p->len-2); +#endif /* PRINTPKT_SUPPORT */ + return pcb->link_cb->write(pcb, pcb->link_ctx_cb, p); +} + +void ppp_link_terminated(ppp_pcb *pcb) { + PPPDEBUG(LOG_DEBUG, ("ppp_link_terminated[%d]\n", pcb->netif->num)); + pcb->link_cb->disconnect(pcb, pcb->link_ctx_cb); + PPPDEBUG(LOG_DEBUG, ("ppp_link_terminated[%d]: finished.\n", pcb->netif->num)); +} + + +/************************************************************************ + * Functions called by various PPP subsystems to configure + * the PPP interface or change the PPP phase. + */ + +/* + * new_phase - signal the start of a new phase of pppd's operation. + */ +void new_phase(ppp_pcb *pcb, int p) { + pcb->phase = p; + PPPDEBUG(LOG_DEBUG, ("ppp phase changed[%d]: phase=%d\n", pcb->netif->num, pcb->phase)); +#if PPP_NOTIFY_PHASE + if (pcb->notify_phase_cb != NULL) { + pcb->notify_phase_cb(pcb, p, pcb->ctx_cb); + } +#endif /* PPP_NOTIFY_PHASE */ +} + +/* + * ppp_send_config - configure the transmit-side characteristics of + * the ppp interface. + */ +int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp) { + LWIP_UNUSED_ARG(mtu); + /* pcb->mtu = mtu; -- set correctly with netif_set_mtu */ + + if (pcb->link_cb->send_config) { + pcb->link_cb->send_config(pcb, pcb->link_ctx_cb, accm, pcomp, accomp); + } + + PPPDEBUG(LOG_INFO, ("ppp_send_config[%d]\n", pcb->netif->num) ); + return 0; +} + +/* + * ppp_recv_config - configure the receive-side characteristics of + * the ppp interface. + */ +int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp) { + LWIP_UNUSED_ARG(mru); + + if (pcb->link_cb->recv_config) { + pcb->link_cb->recv_config(pcb, pcb->link_ctx_cb, accm, pcomp, accomp); + } + + PPPDEBUG(LOG_INFO, ("ppp_recv_config[%d]\n", pcb->netif->num)); + return 0; +} + +#if PPP_IPV4_SUPPORT +/* + * sifaddr - Config the interface IP addresses and netmask. + */ +int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr, u32_t netmask) { + ip4_addr_t ip, nm, gw; + + ip4_addr_set_u32(&ip, our_adr); + ip4_addr_set_u32(&nm, netmask); + ip4_addr_set_u32(&gw, his_adr); + netif_set_addr(pcb->netif, &ip, &nm, &gw); + return 1; +} + +/******************************************************************** + * + * cifaddr - Clear the interface IP addresses, and delete routes + * through the interface if possible. + */ +int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr) { + LWIP_UNUSED_ARG(our_adr); + LWIP_UNUSED_ARG(his_adr); + + netif_set_addr(pcb->netif, IP4_ADDR_ANY4, IP4_ADDR_BROADCAST, IP4_ADDR_ANY4); + return 1; +} + +#if 0 /* UNUSED - PROXY ARP */ +/******************************************************************** + * + * sifproxyarp - Make a proxy ARP entry for the peer. + */ + +int sifproxyarp(ppp_pcb *pcb, u32_t his_adr) { + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(his_adr); + return 0; +} + +/******************************************************************** + * + * cifproxyarp - Delete the proxy ARP entry for the peer. + */ + +int cifproxyarp(ppp_pcb *pcb, u32_t his_adr) { + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(his_adr); + return 0; +} +#endif /* UNUSED - PROXY ARP */ + +#if LWIP_DNS +/* + * sdns - Config the DNS servers + */ +int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) { + ip_addr_t ns; + LWIP_UNUSED_ARG(pcb); + + ip_addr_set_ip4_u32(&ns, ns1); + dns_setserver(0, &ns); + ip_addr_set_ip4_u32(&ns, ns2); + dns_setserver(1, &ns); + return 1; +} + +/******************************************************************** + * + * cdns - Clear the DNS servers + */ +int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) { + const ip_addr_t *nsa; + ip_addr_t nsb; + LWIP_UNUSED_ARG(pcb); + + nsa = dns_getserver(0); + ip_addr_set_ip4_u32(&nsb, ns1); + if (ip_addr_cmp(nsa, &nsb)) { + dns_setserver(0, IP_ADDR_ANY); + } + nsa = dns_getserver(1); + ip_addr_set_ip4_u32(&nsb, ns2); + if (ip_addr_cmp(nsa, &nsb)) { + dns_setserver(1, IP_ADDR_ANY); + } + return 1; +} +#endif /* LWIP_DNS */ + +#if VJ_SUPPORT +/******************************************************************** + * + * sifvjcomp - config tcp header compression + */ +int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid) { + pcb->vj_enabled = vjcomp; + pcb->vj_comp.compressSlot = cidcomp; + pcb->vj_comp.maxSlotIndex = maxcid; + PPPDEBUG(LOG_INFO, ("sifvjcomp[%d]: VJ compress enable=%d slot=%d max slot=%d\n", + pcb->netif->num, vjcomp, cidcomp, maxcid)); + return 0; +} +#endif /* VJ_SUPPORT */ + +/* + * sifup - Config the interface up and enable IP packets to pass. + */ +int sifup(ppp_pcb *pcb) { + pcb->if4_up = 1; + pcb->err_code = PPPERR_NONE; + netif_set_link_up(pcb->netif); + + PPPDEBUG(LOG_DEBUG, ("sifup[%d]: err_code=%d\n", pcb->netif->num, pcb->err_code)); + pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb); + return 1; +} + +/******************************************************************** + * + * sifdown - Disable the indicated protocol and config the interface + * down if there are no remaining protocols. + */ +int sifdown(ppp_pcb *pcb) { + + pcb->if4_up = 0; + + if (1 +#if PPP_IPV6_SUPPORT + /* set the interface down if IPv6 is down as well */ + && !pcb->if6_up +#endif /* PPP_IPV6_SUPPORT */ + ) { + /* make sure the netif link callback is called */ + netif_set_link_down(pcb->netif); + } + PPPDEBUG(LOG_DEBUG, ("sifdown[%d]: err_code=%d\n", pcb->netif->num, pcb->err_code)); + return 1; +} + +/******************************************************************** + * + * Return user specified netmask, modified by any mask we might determine + * for address `addr' (in network byte order). + * Here we scan through the system's list of interfaces, looking for + * any non-point-to-point interfaces which might appear to be on the same + * network as `addr'. If we find any, we OR in their netmask to the + * user-specified netmask. + */ +u32_t get_mask(u32_t addr) { +#if 0 + u32_t mask, nmask; + + addr = lwip_htonl(addr); + if (IP_CLASSA(addr)) { /* determine network mask for address class */ + nmask = IP_CLASSA_NET; + } else if (IP_CLASSB(addr)) { + nmask = IP_CLASSB_NET; + } else { + nmask = IP_CLASSC_NET; + } + + /* class D nets are disallowed by bad_ip_adrs */ + mask = PP_HTONL(0xffffff00UL) | lwip_htonl(nmask); + + /* XXX + * Scan through the system's network interfaces. + * Get each netmask and OR them into our mask. + */ + /* return mask; */ + return mask; +#endif /* 0 */ + LWIP_UNUSED_ARG(addr); + return IPADDR_BROADCAST; +} +#endif /* PPP_IPV4_SUPPORT */ + +#if PPP_IPV6_SUPPORT +#define IN6_LLADDR_FROM_EUI64(ip6, eui64) do { \ + ip6.addr[0] = PP_HTONL(0xfe800000); \ + ip6.addr[1] = 0; \ + eui64_copy(eui64, ip6.addr[2]); \ + } while (0) + +/******************************************************************** + * + * sif6addr - Config the interface with an IPv6 link-local address + */ +int sif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64) { + ip6_addr_t ip6; + LWIP_UNUSED_ARG(his_eui64); + + IN6_LLADDR_FROM_EUI64(ip6, our_eui64); + netif_ip6_addr_set(pcb->netif, 0, &ip6); + netif_ip6_addr_set_state(pcb->netif, 0, IP6_ADDR_PREFERRED); + /* FIXME: should we add an IPv6 static neighbor using his_eui64 ? */ + return 1; +} + +/******************************************************************** + * + * cif6addr - Remove IPv6 address from interface + */ +int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64) { + LWIP_UNUSED_ARG(our_eui64); + LWIP_UNUSED_ARG(his_eui64); + + netif_ip6_addr_set(pcb->netif, 0, IP6_ADDR_ANY6); + netif_ip6_addr_set_state(pcb->netif, 0, IP6_ADDR_INVALID); + return 1; +} + +/* + * sif6up - Config the interface up and enable IPv6 packets to pass. + */ +int sif6up(ppp_pcb *pcb) { + + pcb->if6_up = 1; + pcb->err_code = PPPERR_NONE; + netif_set_link_up(pcb->netif); + + PPPDEBUG(LOG_DEBUG, ("sif6up[%d]: err_code=%d\n", pcb->netif->num, pcb->err_code)); + pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb); + return 1; +} + +/******************************************************************** + * + * sif6down - Disable the indicated protocol and config the interface + * down if there are no remaining protocols. + */ +int sif6down(ppp_pcb *pcb) { + + pcb->if6_up = 0; + + if (1 +#if PPP_IPV4_SUPPORT + /* set the interface down if IPv4 is down as well */ + && !pcb->if4_up +#endif /* PPP_IPV4_SUPPORT */ + ) { + /* make sure the netif link callback is called */ + netif_set_link_down(pcb->netif); + } + PPPDEBUG(LOG_DEBUG, ("sif6down[%d]: err_code=%d\n", pcb->netif->num, pcb->err_code)); + return 1; +} +#endif /* PPP_IPV6_SUPPORT */ + +#if DEMAND_SUPPORT +/* + * sifnpmode - Set the mode for handling packets for a given NP. + */ +int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode) { + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(proto); + LWIP_UNUSED_ARG(mode); + return 0; +} +#endif /* DEMAND_SUPPORT */ + +/* + * netif_set_mtu - set the MTU on the PPP network interface. + */ +void netif_set_mtu(ppp_pcb *pcb, int mtu) { + + pcb->netif->mtu = mtu; + PPPDEBUG(LOG_INFO, ("netif_set_mtu[%d]: mtu=%d\n", pcb->netif->num, mtu)); +} + +/* + * netif_get_mtu - get PPP interface MTU + */ +int netif_get_mtu(ppp_pcb *pcb) { + + return pcb->netif->mtu; +} + +#if CCP_SUPPORT +#if 0 /* unused */ +/* + * ccp_test - whether a given compression method is acceptable for use. + */ +int +ccp_test(ppp_pcb *pcb, u_char *opt_ptr, int opt_len, int for_transmit) +{ + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(opt_ptr); + LWIP_UNUSED_ARG(opt_len); + LWIP_UNUSED_ARG(for_transmit); + return -1; +} +#endif /* unused */ + +/* + * ccp_set - inform about the current state of CCP. + */ +void +ccp_set(ppp_pcb *pcb, u8_t isopen, u8_t isup, u8_t receive_method, u8_t transmit_method) +{ + LWIP_UNUSED_ARG(isopen); + LWIP_UNUSED_ARG(isup); + pcb->ccp_receive_method = receive_method; + pcb->ccp_transmit_method = transmit_method; + PPPDEBUG(LOG_DEBUG, ("ccp_set[%d]: is_open=%d, is_up=%d, receive_method=%u, transmit_method=%u\n", + pcb->netif->num, isopen, isup, receive_method, transmit_method)); +} + +void +ccp_reset_comp(ppp_pcb *pcb) +{ + switch (pcb->ccp_transmit_method) { +#if MPPE_SUPPORT + case CI_MPPE: + mppe_comp_reset(pcb, &pcb->mppe_comp); + break; +#endif /* MPPE_SUPPORT */ + default: + break; + } +} + +void +ccp_reset_decomp(ppp_pcb *pcb) +{ + switch (pcb->ccp_receive_method) { +#if MPPE_SUPPORT + case CI_MPPE: + mppe_decomp_reset(pcb, &pcb->mppe_decomp); + break; +#endif /* MPPE_SUPPORT */ + default: + break; + } +} + +#if 0 /* unused */ +/* + * ccp_fatal_error - returns 1 if decompression was disabled as a + * result of an error detected after decompression of a packet, + * 0 otherwise. This is necessary because of patent nonsense. + */ +int +ccp_fatal_error(ppp_pcb *pcb) +{ + LWIP_UNUSED_ARG(pcb); + return 1; +} +#endif /* unused */ +#endif /* CCP_SUPPORT */ + +#if PPP_IDLETIMELIMIT +/******************************************************************** + * + * get_idle_time - return how long the link has been idle. + */ +int get_idle_time(ppp_pcb *pcb, struct ppp_idle *ip) { + /* FIXME: add idle time support and make it optional */ + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(ip); + return 1; +} +#endif /* PPP_IDLETIMELIMIT */ + +#if DEMAND_SUPPORT +/******************************************************************** + * + * get_loop_output - get outgoing packets from the ppp device, + * and detect when we want to bring the real link up. + * Return value is 1 if we need to bring up the link, 0 otherwise. + */ +int get_loop_output(void) { + return 0; +} +#endif /* DEMAND_SUPPORT */ + +#if PPP_PROTOCOLNAME +/* List of protocol names, to make our messages a little more informative. */ +struct protocol_list { + u_short proto; + const char *name; +} const protocol_list[] = { + { 0x21, "IP" }, + { 0x23, "OSI Network Layer" }, + { 0x25, "Xerox NS IDP" }, + { 0x27, "DECnet Phase IV" }, + { 0x29, "Appletalk" }, + { 0x2b, "Novell IPX" }, + { 0x2d, "VJ compressed TCP/IP" }, + { 0x2f, "VJ uncompressed TCP/IP" }, + { 0x31, "Bridging PDU" }, + { 0x33, "Stream Protocol ST-II" }, + { 0x35, "Banyan Vines" }, + { 0x39, "AppleTalk EDDP" }, + { 0x3b, "AppleTalk SmartBuffered" }, + { 0x3d, "Multi-Link" }, + { 0x3f, "NETBIOS Framing" }, + { 0x41, "Cisco Systems" }, + { 0x43, "Ascom Timeplex" }, + { 0x45, "Fujitsu Link Backup and Load Balancing (LBLB)" }, + { 0x47, "DCA Remote Lan" }, + { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, + { 0x4b, "SNA over 802.2" }, + { 0x4d, "SNA" }, + { 0x4f, "IP6 Header Compression" }, + { 0x51, "KNX Bridging Data" }, + { 0x53, "Encryption" }, + { 0x55, "Individual Link Encryption" }, + { 0x57, "IPv6" }, + { 0x59, "PPP Muxing" }, + { 0x5b, "Vendor-Specific Network Protocol" }, + { 0x61, "RTP IPHC Full Header" }, + { 0x63, "RTP IPHC Compressed TCP" }, + { 0x65, "RTP IPHC Compressed non-TCP" }, + { 0x67, "RTP IPHC Compressed UDP 8" }, + { 0x69, "RTP IPHC Compressed RTP 8" }, + { 0x6f, "Stampede Bridging" }, + { 0x73, "MP+" }, + { 0xc1, "NTCITS IPI" }, + { 0xfb, "single-link compression" }, + { 0xfd, "Compressed Datagram" }, + { 0x0201, "802.1d Hello Packets" }, + { 0x0203, "IBM Source Routing BPDU" }, + { 0x0205, "DEC LANBridge100 Spanning Tree" }, + { 0x0207, "Cisco Discovery Protocol" }, + { 0x0209, "Netcs Twin Routing" }, + { 0x020b, "STP - Scheduled Transfer Protocol" }, + { 0x020d, "EDP - Extreme Discovery Protocol" }, + { 0x0211, "Optical Supervisory Channel Protocol" }, + { 0x0213, "Optical Supervisory Channel Protocol" }, + { 0x0231, "Luxcom" }, + { 0x0233, "Sigma Network Systems" }, + { 0x0235, "Apple Client Server Protocol" }, + { 0x0281, "MPLS Unicast" }, + { 0x0283, "MPLS Multicast" }, + { 0x0285, "IEEE p1284.4 standard - data packets" }, + { 0x0287, "ETSI TETRA Network Protocol Type 1" }, + { 0x0289, "Multichannel Flow Treatment Protocol" }, + { 0x2063, "RTP IPHC Compressed TCP No Delta" }, + { 0x2065, "RTP IPHC Context State" }, + { 0x2067, "RTP IPHC Compressed UDP 16" }, + { 0x2069, "RTP IPHC Compressed RTP 16" }, + { 0x4001, "Cray Communications Control Protocol" }, + { 0x4003, "CDPD Mobile Network Registration Protocol" }, + { 0x4005, "Expand accelerator protocol" }, + { 0x4007, "ODSICP NCP" }, + { 0x4009, "DOCSIS DLL" }, + { 0x400B, "Cetacean Network Detection Protocol" }, + { 0x4021, "Stacker LZS" }, + { 0x4023, "RefTek Protocol" }, + { 0x4025, "Fibre Channel" }, + { 0x4027, "EMIT Protocols" }, + { 0x405b, "Vendor-Specific Protocol (VSP)" }, + { 0x8021, "Internet Protocol Control Protocol" }, + { 0x8023, "OSI Network Layer Control Protocol" }, + { 0x8025, "Xerox NS IDP Control Protocol" }, + { 0x8027, "DECnet Phase IV Control Protocol" }, + { 0x8029, "Appletalk Control Protocol" }, + { 0x802b, "Novell IPX Control Protocol" }, + { 0x8031, "Bridging NCP" }, + { 0x8033, "Stream Protocol Control Protocol" }, + { 0x8035, "Banyan Vines Control Protocol" }, + { 0x803d, "Multi-Link Control Protocol" }, + { 0x803f, "NETBIOS Framing Control Protocol" }, + { 0x8041, "Cisco Systems Control Protocol" }, + { 0x8043, "Ascom Timeplex" }, + { 0x8045, "Fujitsu LBLB Control Protocol" }, + { 0x8047, "DCA Remote Lan Network Control Protocol (RLNCP)" }, + { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, + { 0x804b, "SNA over 802.2 Control Protocol" }, + { 0x804d, "SNA Control Protocol" }, + { 0x804f, "IP6 Header Compression Control Protocol" }, + { 0x8051, "KNX Bridging Control Protocol" }, + { 0x8053, "Encryption Control Protocol" }, + { 0x8055, "Individual Link Encryption Control Protocol" }, + { 0x8057, "IPv6 Control Protocol" }, + { 0x8059, "PPP Muxing Control Protocol" }, + { 0x805b, "Vendor-Specific Network Control Protocol (VSNCP)" }, + { 0x806f, "Stampede Bridging Control Protocol" }, + { 0x8073, "MP+ Control Protocol" }, + { 0x80c1, "NTCITS IPI Control Protocol" }, + { 0x80fb, "Single Link Compression Control Protocol" }, + { 0x80fd, "Compression Control Protocol" }, + { 0x8207, "Cisco Discovery Protocol Control" }, + { 0x8209, "Netcs Twin Routing" }, + { 0x820b, "STP - Control Protocol" }, + { 0x820d, "EDPCP - Extreme Discovery Protocol Ctrl Prtcl" }, + { 0x8235, "Apple Client Server Protocol Control" }, + { 0x8281, "MPLSCP" }, + { 0x8285, "IEEE p1284.4 standard - Protocol Control" }, + { 0x8287, "ETSI TETRA TNP1 Control Protocol" }, + { 0x8289, "Multichannel Flow Treatment Protocol" }, + { 0xc021, "Link Control Protocol" }, + { 0xc023, "Password Authentication Protocol" }, + { 0xc025, "Link Quality Report" }, + { 0xc027, "Shiva Password Authentication Protocol" }, + { 0xc029, "CallBack Control Protocol (CBCP)" }, + { 0xc02b, "BACP Bandwidth Allocation Control Protocol" }, + { 0xc02d, "BAP" }, + { 0xc05b, "Vendor-Specific Authentication Protocol (VSAP)" }, + { 0xc081, "Container Control Protocol" }, + { 0xc223, "Challenge Handshake Authentication Protocol" }, + { 0xc225, "RSA Authentication Protocol" }, + { 0xc227, "Extensible Authentication Protocol" }, + { 0xc229, "Mitsubishi Security Info Exch Ptcl (SIEP)" }, + { 0xc26f, "Stampede Bridging Authorization Protocol" }, + { 0xc281, "Proprietary Authentication Protocol" }, + { 0xc283, "Proprietary Authentication Protocol" }, + { 0xc481, "Proprietary Node ID Authentication Protocol" }, + { 0, NULL }, +}; + +/* + * protocol_name - find a name for a PPP protocol. + */ +const char * protocol_name(int proto) { + const struct protocol_list *lp; + + for (lp = protocol_list; lp->proto != 0; ++lp) { + if (proto == lp->proto) { + return lp->name; + } + } + return NULL; +} +#endif /* PPP_PROTOCOLNAME */ + +#if PPP_STATS_SUPPORT + +/* ---- Note on PPP Stats support ---- + * + * The one willing link stats support should add the get_ppp_stats() + * to fetch statistics from lwIP. + */ + +/* + * reset_link_stats - "reset" stats when link goes up. + */ +void reset_link_stats(int u) { + if (!get_ppp_stats(u, &old_link_stats)) { + return; + } + gettimeofday(&start_time, NULL); +} + +/* + * update_link_stats - get stats at link termination. + */ +void update_link_stats(int u) { + struct timeval now; + char numbuf[32]; + + if (!get_ppp_stats(u, &link_stats) || gettimeofday(&now, NULL) < 0) { + return; + } + link_connect_time = now.tv_sec - start_time.tv_sec; + link_stats_valid = 1; + + link_stats.bytes_in -= old_link_stats.bytes_in; + link_stats.bytes_out -= old_link_stats.bytes_out; + link_stats.pkts_in -= old_link_stats.pkts_in; + link_stats.pkts_out -= old_link_stats.pkts_out; +} + +void print_link_stats() { + /* + * Print connect time and statistics. + */ + if (link_stats_valid) { + int t = (link_connect_time + 5) / 6; /* 1/10ths of minutes */ + info("Connect time %d.%d minutes.", t/10, t%10); + info("Sent %u bytes, received %u bytes.", link_stats.bytes_out, link_stats.bytes_in); + link_stats_valid = 0; + } +} +#endif /* PPP_STATS_SUPPORT */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppapi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppapi.c new file mode 100644 index 0000000..947f7ba --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppapi.c @@ -0,0 +1,427 @@ +/** + * @file + * Point To Point Protocol Sequential API module + * + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "netif/ppp/ppp_opts.h" + +#if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */ + +#include "netif/ppp/pppapi.h" +#include "lwip/priv/tcpip_priv.h" +#include "netif/ppp/pppoe.h" +#include "netif/ppp/pppol2tp.h" +#include "netif/ppp/pppos.h" + +#if LWIP_MPU_COMPATIBLE +LWIP_MEMPOOL_DECLARE(PPPAPI_MSG, MEMP_NUM_PPP_API_MSG, sizeof(struct pppapi_msg), "PPPAPI_MSG") +#endif + +#define PPPAPI_VAR_REF(name) API_VAR_REF(name) +#define PPPAPI_VAR_DECLARE(name) API_VAR_DECLARE(struct pppapi_msg, name) +#define PPPAPI_VAR_ALLOC(name) API_VAR_ALLOC_POOL(struct pppapi_msg, PPPAPI_MSG, name, ERR_MEM) +#define PPPAPI_VAR_ALLOC_RETURN_NULL(name) API_VAR_ALLOC_POOL(struct pppapi_msg, PPPAPI_MSG, name, NULL) +#define PPPAPI_VAR_FREE(name) API_VAR_FREE_POOL(PPPAPI_MSG, name) + +/** + * Call ppp_set_default() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_set_default(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + ppp_set_default(msg->msg.ppp); + return ERR_OK; +} + +/** + * Call ppp_set_default() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_set_default(ppp_pcb *pcb) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + err = tcpip_api_call(pppapi_do_ppp_set_default, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} + + +#if PPP_NOTIFY_PHASE +/** + * Call ppp_set_notify_phase_callback() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_set_notify_phase_callback(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + ppp_set_notify_phase_callback(msg->msg.ppp, msg->msg.msg.setnotifyphasecb.notify_phase_cb); + return ERR_OK; +} + +/** + * Call ppp_set_notify_phase_callback() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + PPPAPI_VAR_REF(msg).msg.msg.setnotifyphasecb.notify_phase_cb = notify_phase_cb; + err = tcpip_api_call(pppapi_do_ppp_set_notify_phase_callback, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} +#endif /* PPP_NOTIFY_PHASE */ + + +#if PPPOS_SUPPORT +/** + * Call pppos_create() inside the tcpip_thread context. + */ +static err_t +pppapi_do_pppos_create(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + msg->msg.ppp = pppos_create(msg->msg.msg.serialcreate.pppif, msg->msg.msg.serialcreate.output_cb, + msg->msg.msg.serialcreate.link_status_cb, msg->msg.msg.serialcreate.ctx_cb); + return ERR_OK; +} + +/** + * Call pppos_create() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +ppp_pcb* +pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) +{ + ppp_pcb* result; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC_RETURN_NULL(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = NULL; + PPPAPI_VAR_REF(msg).msg.msg.serialcreate.pppif = pppif; + PPPAPI_VAR_REF(msg).msg.msg.serialcreate.output_cb = output_cb; + PPPAPI_VAR_REF(msg).msg.msg.serialcreate.link_status_cb = link_status_cb; + PPPAPI_VAR_REF(msg).msg.msg.serialcreate.ctx_cb = ctx_cb; + tcpip_api_call(pppapi_do_pppos_create, &PPPAPI_VAR_REF(msg).call); + result = PPPAPI_VAR_REF(msg).msg.ppp; + PPPAPI_VAR_FREE(msg); + return result; +} +#endif /* PPPOS_SUPPORT */ + + +#if PPPOE_SUPPORT +/** + * Call pppoe_create() inside the tcpip_thread context. + */ +static err_t +pppapi_do_pppoe_create(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + msg->msg.ppp = pppoe_create(msg->msg.msg.ethernetcreate.pppif, msg->msg.msg.ethernetcreate.ethif, + msg->msg.msg.ethernetcreate.service_name, msg->msg.msg.ethernetcreate.concentrator_name, + msg->msg.msg.ethernetcreate.link_status_cb, msg->msg.msg.ethernetcreate.ctx_cb); + return ERR_OK; +} + +/** + * Call pppoe_create() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +ppp_pcb* +pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name, + const char *concentrator_name, ppp_link_status_cb_fn link_status_cb, + void *ctx_cb) +{ + ppp_pcb* result; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC_RETURN_NULL(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = NULL; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.pppif = pppif; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.ethif = ethif; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.service_name = service_name; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.concentrator_name = concentrator_name; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.link_status_cb = link_status_cb; + PPPAPI_VAR_REF(msg).msg.msg.ethernetcreate.ctx_cb = ctx_cb; + tcpip_api_call(pppapi_do_pppoe_create, &PPPAPI_VAR_REF(msg).call); + result = PPPAPI_VAR_REF(msg).msg.ppp; + PPPAPI_VAR_FREE(msg); + return result; +} +#endif /* PPPOE_SUPPORT */ + + +#if PPPOL2TP_SUPPORT +/** + * Call pppol2tp_create() inside the tcpip_thread context. + */ +static err_t +pppapi_do_pppol2tp_create(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + msg->msg.ppp = pppol2tp_create(msg->msg.msg.l2tpcreate.pppif, + msg->msg.msg.l2tpcreate.netif, API_EXPR_REF(msg->msg.msg.l2tpcreate.ipaddr), msg->msg.msg.l2tpcreate.port, +#if PPPOL2TP_AUTH_SUPPORT + msg->msg.msg.l2tpcreate.secret, + msg->msg.msg.l2tpcreate.secret_len, +#else /* PPPOL2TP_AUTH_SUPPORT */ + NULL, + 0, +#endif /* PPPOL2TP_AUTH_SUPPORT */ + msg->msg.msg.l2tpcreate.link_status_cb, msg->msg.msg.l2tpcreate.ctx_cb); + return ERR_OK; +} + +/** + * Call pppol2tp_create() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +ppp_pcb* +pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port, + const u8_t *secret, u8_t secret_len, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) +{ + ppp_pcb* result; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC_RETURN_NULL(msg); +#if !PPPOL2TP_AUTH_SUPPORT + LWIP_UNUSED_ARG(secret); + LWIP_UNUSED_ARG(secret_len); +#endif /* !PPPOL2TP_AUTH_SUPPORT */ + + PPPAPI_VAR_REF(msg).msg.ppp = NULL; + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.pppif = pppif; + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.netif = netif; + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.ipaddr = PPPAPI_VAR_REF(ipaddr); + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.port = port; +#if PPPOL2TP_AUTH_SUPPORT + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.secret = secret; + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.secret_len = secret_len; +#endif /* PPPOL2TP_AUTH_SUPPORT */ + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.link_status_cb = link_status_cb; + PPPAPI_VAR_REF(msg).msg.msg.l2tpcreate.ctx_cb = ctx_cb; + tcpip_api_call(pppapi_do_pppol2tp_create, &PPPAPI_VAR_REF(msg).call); + result = PPPAPI_VAR_REF(msg).msg.ppp; + PPPAPI_VAR_FREE(msg); + return result; +} +#endif /* PPPOL2TP_SUPPORT */ + + +/** + * Call ppp_connect() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_connect(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + return ppp_connect(msg->msg.ppp, msg->msg.msg.connect.holdoff); +} + +/** + * Call ppp_connect() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_connect(ppp_pcb *pcb, u16_t holdoff) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + PPPAPI_VAR_REF(msg).msg.msg.connect.holdoff = holdoff; + err = tcpip_api_call(pppapi_do_ppp_connect, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} + + +#if PPP_SERVER +/** + * Call ppp_listen() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_listen(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + return ppp_listen(msg->msg.ppp); +} + +/** + * Call ppp_listen() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_listen(ppp_pcb *pcb) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + err = tcpip_api_call(pppapi_do_ppp_listen, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} +#endif /* PPP_SERVER */ + + +/** + * Call ppp_close() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_close(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + return ppp_close(msg->msg.ppp, msg->msg.msg.close.nocarrier); +} + +/** + * Call ppp_close() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_close(ppp_pcb *pcb, u8_t nocarrier) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + PPPAPI_VAR_REF(msg).msg.msg.close.nocarrier = nocarrier; + err = tcpip_api_call(pppapi_do_ppp_close, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} + + +/** + * Call ppp_free() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_free(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + return ppp_free(msg->msg.ppp); +} + +/** + * Call ppp_free() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_free(ppp_pcb *pcb) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + err = tcpip_api_call(pppapi_do_ppp_free, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} + + +/** + * Call ppp_ioctl() inside the tcpip_thread context. + */ +static err_t +pppapi_do_ppp_ioctl(struct tcpip_api_call_data *m) +{ + /* cast through void* to silence alignment warnings. + * We know it works because the structs have been instantiated as struct pppapi_msg */ + struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; + + return ppp_ioctl(msg->msg.ppp, msg->msg.msg.ioctl.cmd, msg->msg.msg.ioctl.arg); +} + +/** + * Call ppp_ioctl() in a thread-safe way by running that function inside the + * tcpip_thread context. + */ +err_t +pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg) +{ + err_t err; + PPPAPI_VAR_DECLARE(msg); + PPPAPI_VAR_ALLOC(msg); + + PPPAPI_VAR_REF(msg).msg.ppp = pcb; + PPPAPI_VAR_REF(msg).msg.msg.ioctl.cmd = cmd; + PPPAPI_VAR_REF(msg).msg.msg.ioctl.arg = arg; + err = tcpip_api_call(pppapi_do_ppp_ioctl, &PPPAPI_VAR_REF(msg).call); + PPPAPI_VAR_FREE(msg); + return err; +} + +#endif /* LWIP_PPP_API */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppcrypt.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppcrypt.c new file mode 100644 index 0000000..82d78c1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppcrypt.c @@ -0,0 +1,66 @@ +/* + * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 + * + * Extracted from chap_ms.c by James Carlson. + * + * Copyright (c) 1995 Eric Rosenquist. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not necessary */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/pppcrypt.h" + + +static u_char pppcrypt_get_7bits(u_char *input, int startBit) { + unsigned int word; + + word = (unsigned)input[startBit / 8] << 8; + word |= (unsigned)input[startBit / 8 + 1]; + + word >>= 15 - (startBit % 8 + 7); + + return word & 0xFE; +} + +/* IN 56 bit DES key missing parity bits + * OUT 64 bit DES key with parity bits added + */ +void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { + des_key[0] = pppcrypt_get_7bits(key, 0); + des_key[1] = pppcrypt_get_7bits(key, 7); + des_key[2] = pppcrypt_get_7bits(key, 14); + des_key[3] = pppcrypt_get_7bits(key, 21); + des_key[4] = pppcrypt_get_7bits(key, 28); + des_key[5] = pppcrypt_get_7bits(key, 35); + des_key[6] = pppcrypt_get_7bits(key, 42); + des_key[7] = pppcrypt_get_7bits(key, 49); +} + +#endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppoe.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppoe.c new file mode 100644 index 0000000..eabfa4d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppoe.c @@ -0,0 +1,1191 @@ +/***************************************************************************** +* pppoe.c - PPP Over Ethernet implementation for lwIP. +* +* Copyright (c) 2006 by Marc Boucher, Services Informatiques (MBSI) inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR +* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +****************************************************************************** +* REVISION HISTORY +* +* 06-01-01 Marc Boucher +* Ported to lwIP. +*****************************************************************************/ + + + +/* based on NetBSD: if_pppoe.c,v 1.64 2006/01/31 23:50:15 martin Exp */ + +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Martin Husemann . + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOE_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#endif /* UNUSED */ + +#include "lwip/timeouts.h" +#include "lwip/memp.h" +#include "lwip/stats.h" +#include "lwip/snmp.h" + +#include "netif/ethernet.h" +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/lcp.h" +#include "netif/ppp/ipcp.h" +#include "netif/ppp/pppoe.h" + +/* Memory pool */ +LWIP_MEMPOOL_DECLARE(PPPOE_IF, MEMP_NUM_PPPOE_INTERFACES, sizeof(struct pppoe_softc), "PPPOE_IF") + +/* Add a 16 bit unsigned value to a buffer pointed to by PTR */ +#define PPPOE_ADD_16(PTR, VAL) \ + *(PTR)++ = (u8_t)((VAL) / 256); \ + *(PTR)++ = (u8_t)((VAL) % 256) + +/* Add a complete PPPoE header to the buffer pointed to by PTR */ +#define PPPOE_ADD_HEADER(PTR, CODE, SESS, LEN) \ + *(PTR)++ = PPPOE_VERTYPE; \ + *(PTR)++ = (CODE); \ + PPPOE_ADD_16(PTR, SESS); \ + PPPOE_ADD_16(PTR, LEN) + +#define PPPOE_DISC_TIMEOUT (5*1000) /* base for quick timeout calculation */ +#define PPPOE_SLOW_RETRY (60*1000) /* persistent retry interval */ +#define PPPOE_DISC_MAXPADI 4 /* retry PADI four times (quickly) */ +#define PPPOE_DISC_MAXPADR 2 /* retry PADR twice */ + +#ifdef PPPOE_SERVER +#error "PPPOE_SERVER is not yet supported under lwIP!" +/* from if_spppsubr.c */ +#define IFF_PASSIVE IFF_LINK0 /* wait passively for connection */ +#endif + +#define PPPOE_ERRORSTRING_LEN 64 + + +/* callbacks called from PPP core */ +static err_t pppoe_write(ppp_pcb *ppp, void *ctx, struct pbuf *p); +static err_t pppoe_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short protocol); +static void pppoe_connect(ppp_pcb *ppp, void *ctx); +static void pppoe_disconnect(ppp_pcb *ppp, void *ctx); +static err_t pppoe_destroy(ppp_pcb *ppp, void *ctx); + +/* management routines */ +static void pppoe_abort_connect(struct pppoe_softc *); +#if 0 /* UNUSED */ +static void pppoe_clear_softc(struct pppoe_softc *, const char *); +#endif /* UNUSED */ + +/* internal timeout handling */ +static void pppoe_timeout(void *); + +/* sending actual protocol controll packets */ +static err_t pppoe_send_padi(struct pppoe_softc *); +static err_t pppoe_send_padr(struct pppoe_softc *); +#ifdef PPPOE_SERVER +static err_t pppoe_send_pado(struct pppoe_softc *); +static err_t pppoe_send_pads(struct pppoe_softc *); +#endif +static err_t pppoe_send_padt(struct netif *, u_int, const u8_t *); + +/* internal helper functions */ +static err_t pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb); +static struct pppoe_softc* pppoe_find_softc_by_session(u_int session, struct netif *rcvif); +static struct pppoe_softc* pppoe_find_softc_by_hunique(u8_t *token, size_t len, struct netif *rcvif); + +/** linked list of created pppoe interfaces */ +static struct pppoe_softc *pppoe_softc_list; + +/* Callbacks structure for PPP core */ +static const struct link_callbacks pppoe_callbacks = { + pppoe_connect, +#if PPP_SERVER + NULL, +#endif /* PPP_SERVER */ + pppoe_disconnect, + pppoe_destroy, + pppoe_write, + pppoe_netif_output, + NULL, + NULL +}; + +/* + * Create a new PPP Over Ethernet (PPPoE) connection. + * + * Return 0 on success, an error code on failure. + */ +ppp_pcb *pppoe_create(struct netif *pppif, + struct netif *ethif, + const char *service_name, const char *concentrator_name, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) +{ + ppp_pcb *ppp; + struct pppoe_softc *sc; + LWIP_UNUSED_ARG(service_name); + LWIP_UNUSED_ARG(concentrator_name); + + sc = (struct pppoe_softc *)LWIP_MEMPOOL_ALLOC(PPPOE_IF); + if (sc == NULL) { + return NULL; + } + + ppp = ppp_new(pppif, &pppoe_callbacks, sc, link_status_cb, ctx_cb); + if (ppp == NULL) { + LWIP_MEMPOOL_FREE(PPPOE_IF, sc); + return NULL; + } + + memset(sc, 0, sizeof(struct pppoe_softc)); + sc->pcb = ppp; + sc->sc_ethif = ethif; + /* put the new interface at the head of the list */ + sc->next = pppoe_softc_list; + pppoe_softc_list = sc; + return ppp; +} + +/* Called by PPP core */ +static err_t pppoe_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) { + struct pppoe_softc *sc = (struct pppoe_softc *)ctx; + struct pbuf *ph; /* Ethernet + PPPoE header */ + err_t ret; +#if MIB2_STATS + u16_t tot_len; +#else /* MIB2_STATS */ + LWIP_UNUSED_ARG(ppp); +#endif /* MIB2_STATS */ + + /* skip address & flags */ + pbuf_header(p, -(s16_t)2); + + ph = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN), PBUF_RAM); + if(!ph) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.proterr); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + pbuf_free(p); + return ERR_MEM; + } + + pbuf_header(ph, -(s16_t)PPPOE_HEADERLEN); /* hide PPPoE header */ + pbuf_cat(ph, p); +#if MIB2_STATS + tot_len = ph->tot_len; +#endif /* MIB2_STATS */ + + ret = pppoe_xmit(sc, ph); + if (ret != ERR_OK) { + LINK_STATS_INC(link.err); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return ret; + } + + MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, (u16_t)tot_len); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); + LINK_STATS_INC(link.xmit); + return ERR_OK; +} + +/* Called by PPP core */ +static err_t pppoe_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short protocol) { + struct pppoe_softc *sc = (struct pppoe_softc *)ctx; + struct pbuf *pb; + u8_t *pl; + err_t err; +#if MIB2_STATS + u16_t tot_len; +#else /* MIB2_STATS */ + LWIP_UNUSED_ARG(ppp); +#endif /* MIB2_STATS */ + + /* @todo: try to use pbuf_header() here! */ + pb = pbuf_alloc(PBUF_LINK, PPPOE_HEADERLEN + sizeof(protocol), PBUF_RAM); + if(!pb) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.proterr); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return ERR_MEM; + } + + pbuf_header(pb, -(s16_t)PPPOE_HEADERLEN); + + pl = (u8_t*)pb->payload; + PUTSHORT(protocol, pl); + + pbuf_chain(pb, p); +#if MIB2_STATS + tot_len = pb->tot_len; +#endif /* MIB2_STATS */ + + if( (err = pppoe_xmit(sc, pb)) != ERR_OK) { + LINK_STATS_INC(link.err); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return err; + } + + MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, tot_len); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); + LINK_STATS_INC(link.xmit); + return ERR_OK; +} + +static err_t +pppoe_destroy(ppp_pcb *ppp, void *ctx) +{ + struct pppoe_softc *sc = (struct pppoe_softc *)ctx; + struct pppoe_softc **copp, *freep; + LWIP_UNUSED_ARG(ppp); + + sys_untimeout(pppoe_timeout, sc); + + /* remove interface from list */ + for (copp = &pppoe_softc_list; (freep = *copp); copp = &freep->next) { + if (freep == sc) { + *copp = freep->next; + break; + } + } + +#ifdef PPPOE_TODO + if (sc->sc_concentrator_name) { + mem_free(sc->sc_concentrator_name); + } + if (sc->sc_service_name) { + mem_free(sc->sc_service_name); + } +#endif /* PPPOE_TODO */ + LWIP_MEMPOOL_FREE(PPPOE_IF, sc); + + return ERR_OK; +} + +/* + * Find the interface handling the specified session. + * Note: O(number of sessions open), this is a client-side only, mean + * and lean implementation, so number of open sessions typically should + * be 1. + */ +static struct pppoe_softc* pppoe_find_softc_by_session(u_int session, struct netif *rcvif) { + struct pppoe_softc *sc; + + for (sc = pppoe_softc_list; sc != NULL; sc = sc->next) { + if (sc->sc_state == PPPOE_STATE_SESSION + && sc->sc_session == session + && sc->sc_ethif == rcvif) { + return sc; + } + } + return NULL; +} + +/* Check host unique token passed and return appropriate softc pointer, + * or NULL if token is bogus. */ +static struct pppoe_softc* pppoe_find_softc_by_hunique(u8_t *token, size_t len, struct netif *rcvif) { + struct pppoe_softc *sc, *t; + + if (len != sizeof sc) { + return NULL; + } + MEMCPY(&t, token, len); + + for (sc = pppoe_softc_list; sc != NULL; sc = sc->next) { + if (sc == t) { + break; + } + } + + if (sc == NULL) { + PPPDEBUG(LOG_DEBUG, ("pppoe: alien host unique tag, no session found\n")); + return NULL; + } + + /* should be safe to access *sc now */ + if (sc->sc_state < PPPOE_STATE_PADI_SENT || sc->sc_state >= PPPOE_STATE_SESSION) { + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": host unique tag found, but it belongs to a connection in state %d\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, sc->sc_state)); + return NULL; + } + if (sc->sc_ethif != rcvif) { + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": wrong interface, not accepting host unique\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + return NULL; + } + return sc; +} + +/* analyze and handle a single received packet while not in session state */ +void +pppoe_disc_input(struct netif *netif, struct pbuf *pb) +{ + u16_t tag, len; + u16_t session, plen; + struct pppoe_softc *sc; +#if PPP_DEBUG + const char *err_msg = NULL; +#endif /* PPP_DEBUG */ + u8_t *ac_cookie; + u16_t ac_cookie_len; +#ifdef PPPOE_SERVER + u8_t *hunique; + size_t hunique_len; +#endif + struct pppoehdr *ph; + struct pppoetag pt; + int off, err; + struct eth_hdr *ethhdr; + + /* don't do anything if there is not a single PPPoE instance */ + if (pppoe_softc_list == NULL) { + pbuf_free(pb); + return; + } + + pb = ppp_singlebuf(pb); + + if (pb->len < sizeof(*ethhdr)) { + goto done; + } + ethhdr = (struct eth_hdr *)pb->payload; + off = sizeof(*ethhdr); + + ac_cookie = NULL; + ac_cookie_len = 0; +#ifdef PPPOE_SERVER + hunique = NULL; + hunique_len = 0; +#endif + session = 0; + if (pb->len - off < (u16_t)PPPOE_HEADERLEN) { + PPPDEBUG(LOG_DEBUG, ("pppoe: packet too short: %d\n", pb->len)); + goto done; + } + + ph = (struct pppoehdr *) (ethhdr + 1); + if (ph->vertype != PPPOE_VERTYPE) { + PPPDEBUG(LOG_DEBUG, ("pppoe: unknown version/type packet: 0x%x\n", ph->vertype)); + goto done; + } + session = lwip_ntohs(ph->session); + plen = lwip_ntohs(ph->plen); + off += sizeof(*ph); + + if (plen + off > pb->len) { + PPPDEBUG(LOG_DEBUG, ("pppoe: packet content does not fit: data available = %d, packet size = %u\n", + pb->len - off, plen)); + goto done; + } + if(pb->tot_len == pb->len) { + pb->tot_len = pb->len = (u16_t)off + plen; /* ignore trailing garbage */ + } + tag = 0; + len = 0; + sc = NULL; + while (off + sizeof(pt) <= pb->len) { + MEMCPY(&pt, (u8_t*)pb->payload + off, sizeof(pt)); + tag = lwip_ntohs(pt.tag); + len = lwip_ntohs(pt.len); + if (off + sizeof(pt) + len > pb->len) { + PPPDEBUG(LOG_DEBUG, ("pppoe: tag 0x%x len 0x%x is too long\n", tag, len)); + goto done; + } + switch (tag) { + case PPPOE_TAG_EOL: + goto breakbreak; + case PPPOE_TAG_SNAME: + break; /* ignored */ + case PPPOE_TAG_ACNAME: + break; /* ignored */ + case PPPOE_TAG_HUNIQUE: + if (sc != NULL) { + break; + } +#ifdef PPPOE_SERVER + hunique = (u8_t*)pb->payload + off + sizeof(pt); + hunique_len = len; +#endif + sc = pppoe_find_softc_by_hunique((u8_t*)pb->payload + off + sizeof(pt), len, netif); + break; + case PPPOE_TAG_ACCOOKIE: + if (ac_cookie == NULL) { + if (len > PPPOE_MAX_AC_COOKIE_LEN) { + PPPDEBUG(LOG_DEBUG, ("pppoe: AC cookie is too long: len = %d, max = %d\n", len, PPPOE_MAX_AC_COOKIE_LEN)); + goto done; + } + ac_cookie = (u8_t*)pb->payload + off + sizeof(pt); + ac_cookie_len = len; + } + break; +#if PPP_DEBUG + case PPPOE_TAG_SNAME_ERR: + err_msg = "SERVICE NAME ERROR"; + break; + case PPPOE_TAG_ACSYS_ERR: + err_msg = "AC SYSTEM ERROR"; + break; + case PPPOE_TAG_GENERIC_ERR: + err_msg = "GENERIC ERROR"; + break; +#endif /* PPP_DEBUG */ + default: + break; + } +#if PPP_DEBUG + if (err_msg != NULL) { + char error_tmp[PPPOE_ERRORSTRING_LEN]; + u16_t error_len = LWIP_MIN(len, sizeof(error_tmp)-1); + strncpy(error_tmp, (char*)pb->payload + off + sizeof(pt), error_len); + error_tmp[error_len] = '\0'; + if (sc) { + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": %s: %s\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err_msg, error_tmp)); + } else { + PPPDEBUG(LOG_DEBUG, ("pppoe: %s: %s\n", err_msg, error_tmp)); + } + } +#endif /* PPP_DEBUG */ + off += sizeof(pt) + len; + } + +breakbreak:; + switch (ph->code) { + case PPPOE_CODE_PADI: +#ifdef PPPOE_SERVER + /* + * got service name, concentrator name, and/or host unique. + * ignore if we have no interfaces with IFF_PASSIVE|IFF_UP. + */ + if (LIST_EMPTY(&pppoe_softc_list)) { + goto done; + } + LIST_FOREACH(sc, &pppoe_softc_list, sc_list) { + if (!(sc->sc_sppp.pp_if.if_flags & IFF_UP)) { + continue; + } + if (!(sc->sc_sppp.pp_if.if_flags & IFF_PASSIVE)) { + continue; + } + if (sc->sc_state == PPPOE_STATE_INITIAL) { + break; + } + } + if (sc == NULL) { + /* PPPDEBUG(LOG_DEBUG, ("pppoe: free passive interface is not found\n")); */ + goto done; + } + if (hunique) { + if (sc->sc_hunique) { + mem_free(sc->sc_hunique); + } + sc->sc_hunique = mem_malloc(hunique_len); + if (sc->sc_hunique == NULL) { + goto done; + } + sc->sc_hunique_len = hunique_len; + MEMCPY(sc->sc_hunique, hunique, hunique_len); + } + MEMCPY(&sc->sc_dest, eh->ether_shost, sizeof sc->sc_dest); + sc->sc_state = PPPOE_STATE_PADO_SENT; + pppoe_send_pado(sc); + break; +#endif /* PPPOE_SERVER */ + case PPPOE_CODE_PADR: +#ifdef PPPOE_SERVER + /* + * get sc from ac_cookie if IFF_PASSIVE + */ + if (ac_cookie == NULL) { + /* be quiet if there is not a single pppoe instance */ + PPPDEBUG(LOG_DEBUG, ("pppoe: received PADR but not includes ac_cookie\n")); + goto done; + } + sc = pppoe_find_softc_by_hunique(ac_cookie, ac_cookie_len, netif); + if (sc == NULL) { + /* be quiet if there is not a single pppoe instance */ + if (!LIST_EMPTY(&pppoe_softc_list)) { + PPPDEBUG(LOG_DEBUG, ("pppoe: received PADR but could not find request for it\n")); + } + goto done; + } + if (sc->sc_state != PPPOE_STATE_PADO_SENT) { + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": received unexpected PADR\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + goto done; + } + if (hunique) { + if (sc->sc_hunique) { + mem_free(sc->sc_hunique); + } + sc->sc_hunique = mem_malloc(hunique_len); + if (sc->sc_hunique == NULL) { + goto done; + } + sc->sc_hunique_len = hunique_len; + MEMCPY(sc->sc_hunique, hunique, hunique_len); + } + pppoe_send_pads(sc); + sc->sc_state = PPPOE_STATE_SESSION; + ppp_start(sc->pcb); /* notify upper layers */ + break; +#else + /* ignore, we are no access concentrator */ + goto done; +#endif /* PPPOE_SERVER */ + case PPPOE_CODE_PADO: + if (sc == NULL) { + /* be quiet if there is not a single pppoe instance */ + if (pppoe_softc_list != NULL) { + PPPDEBUG(LOG_DEBUG, ("pppoe: received PADO but could not find request for it\n")); + } + goto done; + } + if (sc->sc_state != PPPOE_STATE_PADI_SENT) { + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": received unexpected PADO\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + goto done; + } + if (ac_cookie) { + sc->sc_ac_cookie_len = ac_cookie_len; + MEMCPY(sc->sc_ac_cookie, ac_cookie, ac_cookie_len); + } + MEMCPY(&sc->sc_dest, ethhdr->src.addr, sizeof(sc->sc_dest.addr)); + sys_untimeout(pppoe_timeout, sc); + sc->sc_padr_retried = 0; + sc->sc_state = PPPOE_STATE_PADR_SENT; + if ((err = pppoe_send_padr(sc)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": failed to send PADR, error=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err)); + } + sys_timeout(PPPOE_DISC_TIMEOUT * (1 + sc->sc_padr_retried), pppoe_timeout, sc); + break; + case PPPOE_CODE_PADS: + if (sc == NULL) { + goto done; + } + sc->sc_session = session; + sys_untimeout(pppoe_timeout, sc); + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": session 0x%x connected\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, session)); + sc->sc_state = PPPOE_STATE_SESSION; + ppp_start(sc->pcb); /* notify upper layers */ + break; + case PPPOE_CODE_PADT: + /* Don't disconnect here, we let the LCP Echo/Reply find the fact + * that PPP session is down. Asking the PPP stack to end the session + * require strict checking about the PPP phase to prevent endless + * disconnection loops. + */ +#if 0 /* UNUSED */ + if (sc == NULL) { /* PADT frames are rarely sent with a hunique tag, this is actually almost always true */ + goto done; + } + pppoe_clear_softc(sc, "received PADT"); +#endif /* UNUSED */ + break; + default: + if(sc) { + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": unknown code (0x%"X16_F") session = 0x%"X16_F"\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, + (u16_t)ph->code, session)); + } else { + PPPDEBUG(LOG_DEBUG, ("pppoe: unknown code (0x%"X16_F") session = 0x%"X16_F"\n", (u16_t)ph->code, session)); + } + break; + } + +done: + pbuf_free(pb); + return; +} + +void +pppoe_data_input(struct netif *netif, struct pbuf *pb) +{ + u16_t session, plen; + struct pppoe_softc *sc; + struct pppoehdr *ph; +#ifdef PPPOE_TERM_UNKNOWN_SESSIONS + u8_t shost[ETHER_ADDR_LEN]; +#endif + +#ifdef PPPOE_TERM_UNKNOWN_SESSIONS + MEMCPY(shost, ((struct eth_hdr *)pb->payload)->src.addr, sizeof(shost)); +#endif + if (pbuf_header(pb, -(s16_t)sizeof(struct eth_hdr)) != 0) { + /* bail out */ + PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n")); + LINK_STATS_INC(link.lenerr); + goto drop; + } + + if (pb->len < sizeof(*ph)) { + PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); + goto drop; + } + ph = (struct pppoehdr *)pb->payload; + + if (ph->vertype != PPPOE_VERTYPE) { + PPPDEBUG(LOG_DEBUG, ("pppoe (data): unknown version/type packet: 0x%x\n", ph->vertype)); + goto drop; + } + if (ph->code != 0) { + goto drop; + } + + session = lwip_ntohs(ph->session); + sc = pppoe_find_softc_by_session(session, netif); + if (sc == NULL) { +#ifdef PPPOE_TERM_UNKNOWN_SESSIONS + PPPDEBUG(LOG_DEBUG, ("pppoe: input for unknown session 0x%x, sending PADT\n", session)); + pppoe_send_padt(netif, session, shost); +#endif + goto drop; + } + + plen = lwip_ntohs(ph->plen); + + if (pbuf_header(pb, -(s16_t)(PPPOE_HEADERLEN)) != 0) { + /* bail out */ + PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n")); + LINK_STATS_INC(link.lenerr); + goto drop; + } + + PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, + pb->len, plen)); + + if (pb->tot_len < plen) { + goto drop; + } + + /* Dispatch the packet thereby consuming it. */ + ppp_input(sc->pcb, pb); + return; + +drop: + pbuf_free(pb); +} + +static err_t +pppoe_output(struct pppoe_softc *sc, struct pbuf *pb) +{ + struct eth_hdr *ethhdr; + u16_t etype; + err_t res; + + /* make room for Ethernet header - should not fail */ + if (pbuf_header(pb, (s16_t)(sizeof(struct eth_hdr))) != 0) { + /* bail out */ + PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_output: could not allocate room for Ethernet header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + LINK_STATS_INC(link.lenerr); + pbuf_free(pb); + return ERR_BUF; + } + ethhdr = (struct eth_hdr *)pb->payload; + etype = sc->sc_state == PPPOE_STATE_SESSION ? ETHTYPE_PPPOE : ETHTYPE_PPPOEDISC; + ethhdr->type = lwip_htons(etype); + MEMCPY(ðhdr->dest.addr, &sc->sc_dest.addr, sizeof(ethhdr->dest.addr)); + MEMCPY(ðhdr->src.addr, &sc->sc_ethif->hwaddr, sizeof(ethhdr->src.addr)); + + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F" (%x) state=%d, session=0x%x output -> %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F", len=%d\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, etype, + sc->sc_state, sc->sc_session, + sc->sc_dest.addr[0], sc->sc_dest.addr[1], sc->sc_dest.addr[2], sc->sc_dest.addr[3], sc->sc_dest.addr[4], sc->sc_dest.addr[5], + pb->tot_len)); + + res = sc->sc_ethif->linkoutput(sc->sc_ethif, pb); + + pbuf_free(pb); + + return res; +} + +static err_t +pppoe_send_padi(struct pppoe_softc *sc) +{ + struct pbuf *pb; + u8_t *p; + int len; +#ifdef PPPOE_TODO + int l1 = 0, l2 = 0; /* XXX: gcc */ +#endif /* PPPOE_TODO */ + + /* calculate length of frame (excluding ethernet header + pppoe header) */ + len = 2 + 2 + 2 + 2 + sizeof sc; /* service name tag is required, host unique is send too */ +#ifdef PPPOE_TODO + if (sc->sc_service_name != NULL) { + l1 = (int)strlen(sc->sc_service_name); + len += l1; + } + if (sc->sc_concentrator_name != NULL) { + l2 = (int)strlen(sc->sc_concentrator_name); + len += 2 + 2 + l2; + } +#endif /* PPPOE_TODO */ + LWIP_ASSERT("sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff", + sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff); + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM); + if (!pb) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + PPPOE_ADD_HEADER(p, PPPOE_CODE_PADI, 0, (u16_t)len); + PPPOE_ADD_16(p, PPPOE_TAG_SNAME); +#ifdef PPPOE_TODO + if (sc->sc_service_name != NULL) { + PPPOE_ADD_16(p, l1); + MEMCPY(p, sc->sc_service_name, l1); + p += l1; + } else +#endif /* PPPOE_TODO */ + { + PPPOE_ADD_16(p, 0); + } +#ifdef PPPOE_TODO + if (sc->sc_concentrator_name != NULL) { + PPPOE_ADD_16(p, PPPOE_TAG_ACNAME); + PPPOE_ADD_16(p, l2); + MEMCPY(p, sc->sc_concentrator_name, l2); + p += l2; + } +#endif /* PPPOE_TODO */ + PPPOE_ADD_16(p, PPPOE_TAG_HUNIQUE); + PPPOE_ADD_16(p, sizeof(sc)); + MEMCPY(p, &sc, sizeof sc); + + /* send pkt */ + return pppoe_output(sc, pb); +} + +static void +pppoe_timeout(void *arg) +{ + u32_t retry_wait; + int err; + struct pppoe_softc *sc = (struct pppoe_softc*)arg; + + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": timeout\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + + switch (sc->sc_state) { + case PPPOE_STATE_PADI_SENT: + /* + * We have two basic ways of retrying: + * - Quick retry mode: try a few times in short sequence + * - Slow retry mode: we already had a connection successfully + * established and will try infinitely (without user + * intervention) + * We only enter slow retry mode if IFF_LINK1 (aka autodial) + * is not set. + */ + if (sc->sc_padi_retried < 0xff) { + sc->sc_padi_retried++; + } + if (!sc->pcb->settings.persist && sc->sc_padi_retried >= PPPOE_DISC_MAXPADI) { +#if 0 + if ((sc->sc_sppp.pp_if.if_flags & IFF_LINK1) == 0) { + /* slow retry mode */ + retry_wait = PPPOE_SLOW_RETRY; + } else +#endif + { + pppoe_abort_connect(sc); + return; + } + } + /* initialize for quick retry mode */ + retry_wait = LWIP_MIN(PPPOE_DISC_TIMEOUT * sc->sc_padi_retried, PPPOE_SLOW_RETRY); + if ((err = pppoe_send_padi(sc)) != 0) { + sc->sc_padi_retried--; + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": failed to transmit PADI, error=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err)); + } + sys_timeout(retry_wait, pppoe_timeout, sc); + break; + + case PPPOE_STATE_PADR_SENT: + sc->sc_padr_retried++; + if (sc->sc_padr_retried >= PPPOE_DISC_MAXPADR) { + MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest)); + sc->sc_state = PPPOE_STATE_PADI_SENT; + sc->sc_padr_retried = 0; + if ((err = pppoe_send_padi(sc)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": failed to send PADI, error=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err)); + } + sys_timeout(PPPOE_DISC_TIMEOUT * (1 + sc->sc_padi_retried), pppoe_timeout, sc); + return; + } + if ((err = pppoe_send_padr(sc)) != 0) { + sc->sc_padr_retried--; + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": failed to send PADR, error=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err)); + } + sys_timeout(PPPOE_DISC_TIMEOUT * (1 + sc->sc_padr_retried), pppoe_timeout, sc); + break; + default: + return; /* all done, work in peace */ + } +} + +/* Start a connection (i.e. initiate discovery phase) */ +static void +pppoe_connect(ppp_pcb *ppp, void *ctx) +{ + err_t err; + struct pppoe_softc *sc = (struct pppoe_softc *)ctx; + lcp_options *lcp_wo; + lcp_options *lcp_ao; +#if PPP_IPV4_SUPPORT && VJ_SUPPORT + ipcp_options *ipcp_wo; + ipcp_options *ipcp_ao; +#endif /* PPP_IPV4_SUPPORT && VJ_SUPPORT */ + + sc->sc_session = 0; + sc->sc_ac_cookie_len = 0; + sc->sc_padi_retried = 0; + sc->sc_padr_retried = 0; + /* changed to real address later */ + MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest)); +#ifdef PPPOE_SERVER + /* wait PADI if IFF_PASSIVE */ + if ((sc->sc_sppp.pp_if.if_flags & IFF_PASSIVE)) { + return 0; + } +#endif + + lcp_wo = &ppp->lcp_wantoptions; + lcp_wo->mru = sc->sc_ethif->mtu-PPPOE_HEADERLEN-2; /* two byte PPP protocol discriminator, then IP data */ + lcp_wo->neg_asyncmap = 0; + lcp_wo->neg_pcompression = 0; + lcp_wo->neg_accompression = 0; + lcp_wo->passive = 0; + lcp_wo->silent = 0; + + lcp_ao = &ppp->lcp_allowoptions; + lcp_ao->mru = sc->sc_ethif->mtu-PPPOE_HEADERLEN-2; /* two byte PPP protocol discriminator, then IP data */ + lcp_ao->neg_asyncmap = 0; + lcp_ao->neg_pcompression = 0; + lcp_ao->neg_accompression = 0; + +#if PPP_IPV4_SUPPORT && VJ_SUPPORT + ipcp_wo = &ppp->ipcp_wantoptions; + ipcp_wo->neg_vj = 0; + ipcp_wo->old_vj = 0; + + ipcp_ao = &ppp->ipcp_allowoptions; + ipcp_ao->neg_vj = 0; + ipcp_ao->old_vj = 0; +#endif /* PPP_IPV4_SUPPORT && VJ_SUPPORT */ + + /* save state, in case we fail to send PADI */ + sc->sc_state = PPPOE_STATE_PADI_SENT; + if ((err = pppoe_send_padi(sc)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": failed to send PADI, error=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, err)); + } + sys_timeout(PPPOE_DISC_TIMEOUT, pppoe_timeout, sc); +} + +/* disconnect */ +static void +pppoe_disconnect(ppp_pcb *ppp, void *ctx) +{ + struct pppoe_softc *sc = (struct pppoe_softc *)ctx; + + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": disconnecting\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + if (sc->sc_state == PPPOE_STATE_SESSION) { + pppoe_send_padt(sc->sc_ethif, sc->sc_session, (const u8_t *)&sc->sc_dest); + } + + /* stop any timer, disconnect can be called while initiating is in progress */ + sys_untimeout(pppoe_timeout, sc); + sc->sc_state = PPPOE_STATE_INITIAL; +#ifdef PPPOE_SERVER + if (sc->sc_hunique) { + mem_free(sc->sc_hunique); + sc->sc_hunique = NULL; /* probably not necessary, if state is initial we shouldn't have to access hunique anyway */ + } + sc->sc_hunique_len = 0; /* probably not necessary, if state is initial we shouldn't have to access hunique anyway */ +#endif + ppp_link_end(ppp); /* notify upper layers */ + return; +} + +/* Connection attempt aborted */ +static void +pppoe_abort_connect(struct pppoe_softc *sc) +{ + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": could not establish connection\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + sc->sc_state = PPPOE_STATE_INITIAL; + ppp_link_failed(sc->pcb); /* notify upper layers */ +} + +/* Send a PADR packet */ +static err_t +pppoe_send_padr(struct pppoe_softc *sc) +{ + struct pbuf *pb; + u8_t *p; + size_t len; +#ifdef PPPOE_TODO + size_t l1 = 0; /* XXX: gcc */ +#endif /* PPPOE_TODO */ + + len = 2 + 2 + 2 + 2 + sizeof(sc); /* service name, host unique */ +#ifdef PPPOE_TODO + if (sc->sc_service_name != NULL) { /* service name tag maybe empty */ + l1 = strlen(sc->sc_service_name); + len += l1; + } +#endif /* PPPOE_TODO */ + if (sc->sc_ac_cookie_len > 0) { + len += 2 + 2 + sc->sc_ac_cookie_len; /* AC cookie */ + } + LWIP_ASSERT("sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff", + sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len <= 0xffff); + pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM); + if (!pb) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + p = (u8_t*)pb->payload; + PPPOE_ADD_HEADER(p, PPPOE_CODE_PADR, 0, len); + PPPOE_ADD_16(p, PPPOE_TAG_SNAME); +#ifdef PPPOE_TODO + if (sc->sc_service_name != NULL) { + PPPOE_ADD_16(p, l1); + MEMCPY(p, sc->sc_service_name, l1); + p += l1; + } else +#endif /* PPPOE_TODO */ + { + PPPOE_ADD_16(p, 0); + } + if (sc->sc_ac_cookie_len > 0) { + PPPOE_ADD_16(p, PPPOE_TAG_ACCOOKIE); + PPPOE_ADD_16(p, sc->sc_ac_cookie_len); + MEMCPY(p, sc->sc_ac_cookie, sc->sc_ac_cookie_len); + p += sc->sc_ac_cookie_len; + } + PPPOE_ADD_16(p, PPPOE_TAG_HUNIQUE); + PPPOE_ADD_16(p, sizeof(sc)); + MEMCPY(p, &sc, sizeof sc); + + return pppoe_output(sc, pb); +} + +/* send a PADT packet */ +static err_t +pppoe_send_padt(struct netif *outgoing_if, u_int session, const u8_t *dest) +{ + struct pbuf *pb; + struct eth_hdr *ethhdr; + err_t res; + u8_t *p; + + pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN), PBUF_RAM); + if (!pb) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + pbuf_header(pb, (s16_t)sizeof(struct eth_hdr)); + ethhdr = (struct eth_hdr *)pb->payload; + ethhdr->type = PP_HTONS(ETHTYPE_PPPOEDISC); + MEMCPY(ðhdr->dest.addr, dest, sizeof(ethhdr->dest.addr)); + MEMCPY(ðhdr->src.addr, &outgoing_if->hwaddr, sizeof(ethhdr->src.addr)); + + p = (u8_t*)(ethhdr + 1); + PPPOE_ADD_HEADER(p, PPPOE_CODE_PADT, session, 0); + + res = outgoing_if->linkoutput(outgoing_if, pb); + + pbuf_free(pb); + + return res; +} + +#ifdef PPPOE_SERVER +static err_t +pppoe_send_pado(struct pppoe_softc *sc) +{ + struct pbuf *pb; + u8_t *p; + size_t len; + + /* calc length */ + len = 0; + /* include ac_cookie */ + len += 2 + 2 + sizeof(sc); + /* include hunique */ + len += 2 + 2 + sc->sc_hunique_len; + pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM); + if (!pb) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + p = (u8_t*)pb->payload; + PPPOE_ADD_HEADER(p, PPPOE_CODE_PADO, 0, len); + PPPOE_ADD_16(p, PPPOE_TAG_ACCOOKIE); + PPPOE_ADD_16(p, sizeof(sc)); + MEMCPY(p, &sc, sizeof(sc)); + p += sizeof(sc); + PPPOE_ADD_16(p, PPPOE_TAG_HUNIQUE); + PPPOE_ADD_16(p, sc->sc_hunique_len); + MEMCPY(p, sc->sc_hunique, sc->sc_hunique_len); + return pppoe_output(sc, pb); +} + +static err_t +pppoe_send_pads(struct pppoe_softc *sc) +{ + struct pbuf *pb; + u8_t *p; + size_t len, l1 = 0; /* XXX: gcc */ + + sc->sc_session = mono_time.tv_sec % 0xff + 1; + /* calc length */ + len = 0; + /* include hunique */ + len += 2 + 2 + 2 + 2 + sc->sc_hunique_len; /* service name, host unique*/ + if (sc->sc_service_name != NULL) { /* service name tag maybe empty */ + l1 = strlen(sc->sc_service_name); + len += l1; + } + pb = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HEADERLEN + len), PBUF_RAM); + if (!pb) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + p = (u8_t*)pb->payload; + PPPOE_ADD_HEADER(p, PPPOE_CODE_PADS, sc->sc_session, len); + PPPOE_ADD_16(p, PPPOE_TAG_SNAME); + if (sc->sc_service_name != NULL) { + PPPOE_ADD_16(p, l1); + MEMCPY(p, sc->sc_service_name, l1); + p += l1; + } else { + PPPOE_ADD_16(p, 0); + } + PPPOE_ADD_16(p, PPPOE_TAG_HUNIQUE); + PPPOE_ADD_16(p, sc->sc_hunique_len); + MEMCPY(p, sc->sc_hunique, sc->sc_hunique_len); + return pppoe_output(sc, pb); +} +#endif + +static err_t +pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb) +{ + u8_t *p; + size_t len; + + len = pb->tot_len; + + /* make room for PPPoE header - should not fail */ + if (pbuf_header(pb, (s16_t)(PPPOE_HEADERLEN)) != 0) { + /* bail out */ + PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_xmit: could not allocate room for PPPoE header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + LINK_STATS_INC(link.lenerr); + pbuf_free(pb); + return ERR_BUF; + } + + p = (u8_t*)pb->payload; + PPPOE_ADD_HEADER(p, 0, sc->sc_session, len); + + return pppoe_output(sc, pb); +} + +#if 0 /*def PFIL_HOOKS*/ +static int +pppoe_ifattach_hook(void *arg, struct pbuf **mp, struct netif *ifp, int dir) +{ + struct pppoe_softc *sc; + int s; + + if (mp != (struct pbuf **)PFIL_IFNET_DETACH) { + return 0; + } + + LIST_FOREACH(sc, &pppoe_softc_list, sc_list) { + if (sc->sc_ethif != ifp) { + continue; + } + if (sc->sc_sppp.pp_if.if_flags & IFF_UP) { + sc->sc_sppp.pp_if.if_flags &= ~(IFF_UP|IFF_RUNNING); + PPPDEBUG(LOG_DEBUG, ("%c%c%"U16_F": ethernet interface detached, going down\n", + sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num)); + } + sc->sc_ethif = NULL; + pppoe_clear_softc(sc, "ethernet interface detached"); + } + + return 0; +} +#endif + +#if 0 /* UNUSED */ +static void +pppoe_clear_softc(struct pppoe_softc *sc, const char *message) +{ + LWIP_UNUSED_ARG(message); + + /* stop timer */ + sys_untimeout(pppoe_timeout, sc); + PPPDEBUG(LOG_DEBUG, ("pppoe: %c%c%"U16_F": session 0x%x terminated, %s\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, sc->sc_session, message)); + sc->sc_state = PPPOE_STATE_INITIAL; + ppp_link_end(sc->pcb); /* notify upper layers - /!\ dangerous /!\ - see pppoe_disc_input() */ +} +#endif /* UNUSED */ +#endif /* PPP_SUPPORT && PPPOE_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppol2tp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppol2tp.c new file mode 100644 index 0000000..d44471e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppol2tp.c @@ -0,0 +1,1131 @@ +/** + * @file + * Network Point to Point Protocol over Layer 2 Tunneling Protocol program file. + * + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +/* + * L2TP Support status: + * + * Supported: + * - L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels) + * - LAC + * + * Not supported: + * - LNS (require PPP server support) + * - L2TPv3 ethernet pseudowires + * - L2TPv3 VLAN pseudowire + * - L2TPv3 PPP pseudowires + * - L2TPv3 IP encapsulation + * - L2TPv3 IP pseudowire + * - L2TP tunnel switching - http://tools.ietf.org/html/draft-ietf-l2tpext-tunnel-switching-08 + * - Multiple tunnels per UDP socket, as well as multiple sessions per tunnel + * - Hidden AVPs + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOL2TP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "lwip/err.h" +#include "lwip/memp.h" +#include "lwip/netif.h" +#include "lwip/udp.h" +#include "lwip/snmp.h" + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/lcp.h" +#include "netif/ppp/ipcp.h" +#include "netif/ppp/pppol2tp.h" +#include "netif/ppp/pppcrypt.h" +#include "netif/ppp/magic.h" + +/* Memory pool */ +LWIP_MEMPOOL_DECLARE(PPPOL2TP_PCB, MEMP_NUM_PPPOL2TP_INTERFACES, sizeof(pppol2tp_pcb), "PPPOL2TP_PCB") + +/* callbacks called from PPP core */ +static err_t pppol2tp_write(ppp_pcb *ppp, void *ctx, struct pbuf *p); +static err_t pppol2tp_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short protocol); +static err_t pppol2tp_destroy(ppp_pcb *ppp, void *ctx); /* Destroy a L2TP control block */ +static void pppol2tp_connect(ppp_pcb *ppp, void *ctx); /* Be a LAC, connect to a LNS. */ +static void pppol2tp_disconnect(ppp_pcb *ppp, void *ctx); /* Disconnect */ + + /* Prototypes for procedures local to this file. */ +static void pppol2tp_input(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port); +static void pppol2tp_dispatch_control_packet(pppol2tp_pcb *l2tp, u16_t port, struct pbuf *p, u16_t ns, u16_t nr); +static void pppol2tp_timeout(void *arg); +static void pppol2tp_abort_connect(pppol2tp_pcb *l2tp); +static err_t pppol2tp_send_sccrq(pppol2tp_pcb *l2tp); +static err_t pppol2tp_send_scccn(pppol2tp_pcb *l2tp, u16_t ns); +static err_t pppol2tp_send_icrq(pppol2tp_pcb *l2tp, u16_t ns); +static err_t pppol2tp_send_iccn(pppol2tp_pcb *l2tp, u16_t ns); +static err_t pppol2tp_send_zlb(pppol2tp_pcb *l2tp, u16_t ns); +static err_t pppol2tp_send_stopccn(pppol2tp_pcb *l2tp, u16_t ns); +static err_t pppol2tp_xmit(pppol2tp_pcb *l2tp, struct pbuf *pb); +static err_t pppol2tp_udp_send(pppol2tp_pcb *l2tp, struct pbuf *pb); + +/* Callbacks structure for PPP core */ +static const struct link_callbacks pppol2tp_callbacks = { + pppol2tp_connect, +#if PPP_SERVER + NULL, +#endif /* PPP_SERVER */ + pppol2tp_disconnect, + pppol2tp_destroy, + pppol2tp_write, + pppol2tp_netif_output, + NULL, + NULL +}; + + +/* Create a new L2TP session. */ +ppp_pcb *pppol2tp_create(struct netif *pppif, + struct netif *netif, const ip_addr_t *ipaddr, u16_t port, + const u8_t *secret, u8_t secret_len, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) { + ppp_pcb *ppp; + pppol2tp_pcb *l2tp; + struct udp_pcb *udp; +#if !PPPOL2TP_AUTH_SUPPORT + LWIP_UNUSED_ARG(secret); + LWIP_UNUSED_ARG(secret_len); +#endif /* !PPPOL2TP_AUTH_SUPPORT */ + + if (ipaddr == NULL) { + goto ipaddr_check_failed; + } + + l2tp = (pppol2tp_pcb *)LWIP_MEMPOOL_ALLOC(PPPOL2TP_PCB); + if (l2tp == NULL) { + goto memp_malloc_l2tp_failed; + } + + udp = udp_new_ip_type(IP_GET_TYPE(ipaddr)); + if (udp == NULL) { + goto udp_new_failed; + } + udp_recv(udp, pppol2tp_input, l2tp); + + ppp = ppp_new(pppif, &pppol2tp_callbacks, l2tp, link_status_cb, ctx_cb); + if (ppp == NULL) { + goto ppp_new_failed; + } + + memset(l2tp, 0, sizeof(pppol2tp_pcb)); + l2tp->phase = PPPOL2TP_STATE_INITIAL; + l2tp->ppp = ppp; + l2tp->udp = udp; + l2tp->netif = netif; + ip_addr_copy(l2tp->remote_ip, *ipaddr); + l2tp->remote_port = port; +#if PPPOL2TP_AUTH_SUPPORT + l2tp->secret = secret; + l2tp->secret_len = secret_len; +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + return ppp; + +ppp_new_failed: + udp_remove(udp); +udp_new_failed: + LWIP_MEMPOOL_FREE(PPPOL2TP_PCB, l2tp); +memp_malloc_l2tp_failed: +ipaddr_check_failed: + return NULL; +} + +/* Called by PPP core */ +static err_t pppol2tp_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb *)ctx; + struct pbuf *ph; /* UDP + L2TP header */ + err_t ret; +#if MIB2_STATS + u16_t tot_len; +#else /* MIB2_STATS */ + LWIP_UNUSED_ARG(ppp); +#endif /* MIB2_STATS */ + + ph = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(PPPOL2TP_OUTPUT_DATA_HEADER_LEN), PBUF_RAM); + if(!ph) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.proterr); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + pbuf_free(p); + return ERR_MEM; + } + + pbuf_header(ph, -(s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN); /* hide L2TP header */ + pbuf_cat(ph, p); +#if MIB2_STATS + tot_len = ph->tot_len; +#endif /* MIB2_STATS */ + + ret = pppol2tp_xmit(l2tp, ph); + if (ret != ERR_OK) { + LINK_STATS_INC(link.err); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return ret; + } + + MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, (u16_t)tot_len); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); + LINK_STATS_INC(link.xmit); + return ERR_OK; +} + +/* Called by PPP core */ +static err_t pppol2tp_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short protocol) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb *)ctx; + struct pbuf *pb; + u8_t *pl; + err_t err; +#if MIB2_STATS + u16_t tot_len; +#else /* MIB2_STATS */ + LWIP_UNUSED_ARG(ppp); +#endif /* MIB2_STATS */ + + /* @todo: try to use pbuf_header() here! */ + pb = pbuf_alloc(PBUF_TRANSPORT, PPPOL2TP_OUTPUT_DATA_HEADER_LEN + sizeof(protocol), PBUF_RAM); + if(!pb) { + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.proterr); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return ERR_MEM; + } + + pbuf_header(pb, -(s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN); + + pl = (u8_t*)pb->payload; + PUTSHORT(protocol, pl); + + pbuf_chain(pb, p); +#if MIB2_STATS + tot_len = pb->tot_len; +#endif /* MIB2_STATS */ + + if( (err = pppol2tp_xmit(l2tp, pb)) != ERR_OK) { + LINK_STATS_INC(link.err); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return err; + } + + MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, tot_len); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); + LINK_STATS_INC(link.xmit); + return ERR_OK; +} + +/* Destroy a L2TP control block */ +static err_t pppol2tp_destroy(ppp_pcb *ppp, void *ctx) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb *)ctx; + LWIP_UNUSED_ARG(ppp); + + sys_untimeout(pppol2tp_timeout, l2tp); + udp_remove(l2tp->udp); + LWIP_MEMPOOL_FREE(PPPOL2TP_PCB, l2tp); + return ERR_OK; +} + +/* Be a LAC, connect to a LNS. */ +static void pppol2tp_connect(ppp_pcb *ppp, void *ctx) { + err_t err; + pppol2tp_pcb *l2tp = (pppol2tp_pcb *)ctx; + lcp_options *lcp_wo; + lcp_options *lcp_ao; +#if PPP_IPV4_SUPPORT && VJ_SUPPORT + ipcp_options *ipcp_wo; + ipcp_options *ipcp_ao; +#endif /* PPP_IPV4_SUPPORT && VJ_SUPPORT */ + + l2tp->tunnel_port = l2tp->remote_port; + l2tp->our_ns = 0; + l2tp->peer_nr = 0; + l2tp->peer_ns = 0; + l2tp->source_tunnel_id = 0; + l2tp->remote_tunnel_id = 0; + l2tp->source_session_id = 0; + l2tp->remote_session_id = 0; + /* l2tp->*_retried are cleared when used */ + + lcp_wo = &ppp->lcp_wantoptions; + lcp_wo->mru = PPPOL2TP_DEFMRU; + lcp_wo->neg_asyncmap = 0; + lcp_wo->neg_pcompression = 0; + lcp_wo->neg_accompression = 0; + lcp_wo->passive = 0; + lcp_wo->silent = 0; + + lcp_ao = &ppp->lcp_allowoptions; + lcp_ao->mru = PPPOL2TP_DEFMRU; + lcp_ao->neg_asyncmap = 0; + lcp_ao->neg_pcompression = 0; + lcp_ao->neg_accompression = 0; + +#if PPP_IPV4_SUPPORT && VJ_SUPPORT + ipcp_wo = &ppp->ipcp_wantoptions; + ipcp_wo->neg_vj = 0; + ipcp_wo->old_vj = 0; + + ipcp_ao = &ppp->ipcp_allowoptions; + ipcp_ao->neg_vj = 0; + ipcp_ao->old_vj = 0; +#endif /* PPP_IPV4_SUPPORT && VJ_SUPPORT */ + + /* Listen to a random source port, we need to do that instead of using udp_connect() + * because the L2TP LNS might answer with its own random source port (!= 1701) + */ +#if LWIP_IPV6 + if (IP_IS_V6_VAL(l2tp->udp->local_ip)) { + udp_bind(l2tp->udp, IP6_ADDR_ANY, 0); + } else +#endif /* LWIP_IPV6 */ + udp_bind(l2tp->udp, IP_ADDR_ANY, 0); + +#if PPPOL2TP_AUTH_SUPPORT + /* Generate random vector */ + if (l2tp->secret != NULL) { + magic_random_bytes(l2tp->secret_rv, sizeof(l2tp->secret_rv)); + } +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + do { + l2tp->remote_tunnel_id = magic(); + } while(l2tp->remote_tunnel_id == 0); + /* save state, in case we fail to send SCCRQ */ + l2tp->sccrq_retried = 0; + l2tp->phase = PPPOL2TP_STATE_SCCRQ_SENT; + if ((err = pppol2tp_send_sccrq(l2tp)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCRQ, error=%d\n", err)); + } + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); +} + +/* Disconnect */ +static void pppol2tp_disconnect(ppp_pcb *ppp, void *ctx) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb *)ctx; + + l2tp->our_ns++; + pppol2tp_send_stopccn(l2tp, l2tp->our_ns); + + /* stop any timer, disconnect can be called while initiating is in progress */ + sys_untimeout(pppol2tp_timeout, l2tp); + l2tp->phase = PPPOL2TP_STATE_INITIAL; + ppp_link_end(ppp); /* notify upper layers */ +} + +/* UDP Callback for incoming IPv4 L2TP frames */ +static void pppol2tp_input(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb*)arg; + u16_t hflags, hlen, len=0, tunnel_id=0, session_id=0, ns=0, nr=0, offset=0; + u8_t *inp; + LWIP_UNUSED_ARG(pcb); + + /* we can't unbound a UDP pcb, thus we can still receive UDP frames after the link is closed */ + if (l2tp->phase < PPPOL2TP_STATE_SCCRQ_SENT) { + goto free_and_return; + } + + if (!ip_addr_cmp(&l2tp->remote_ip, addr)) { + goto free_and_return; + } + + /* discard packet if port mismatch, but only if we received a SCCRP */ + if (l2tp->phase > PPPOL2TP_STATE_SCCRQ_SENT && l2tp->tunnel_port != port) { + goto free_and_return; + } + + /* printf("-----------\nL2TP INPUT, %d\n", p->len); */ + + /* L2TP header */ + if (p->len < sizeof(hflags) + sizeof(tunnel_id) + sizeof(session_id) ) { + goto packet_too_short; + } + + inp = (u8_t*)p->payload; + GETSHORT(hflags, inp); + + if (hflags & PPPOL2TP_HEADERFLAG_CONTROL) { + /* check mandatory flags for a control packet */ + if ( (hflags & PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY) != PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY ) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: mandatory header flags for control packet not set\n")); + goto free_and_return; + } + /* check forbidden flags for a control packet */ + if (hflags & PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: forbidden header flags for control packet found\n")); + goto free_and_return; + } + } else { + /* check mandatory flags for a data packet */ + if ( (hflags & PPPOL2TP_HEADERFLAG_DATA_MANDATORY) != PPPOL2TP_HEADERFLAG_DATA_MANDATORY) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: mandatory header flags for data packet not set\n")); + goto free_and_return; + } + } + + /* Expected header size */ + hlen = sizeof(hflags) + sizeof(tunnel_id) + sizeof(session_id); + if (hflags & PPPOL2TP_HEADERFLAG_LENGTH) { + hlen += sizeof(len); + } + if (hflags & PPPOL2TP_HEADERFLAG_SEQUENCE) { + hlen += sizeof(ns) + sizeof(nr); + } + if (hflags & PPPOL2TP_HEADERFLAG_OFFSET) { + hlen += sizeof(offset); + } + if (p->len < hlen) { + goto packet_too_short; + } + + if (hflags & PPPOL2TP_HEADERFLAG_LENGTH) { + GETSHORT(len, inp); + if (p->len < len || len < hlen) { + goto packet_too_short; + } + } + GETSHORT(tunnel_id, inp); + GETSHORT(session_id, inp); + if (hflags & PPPOL2TP_HEADERFLAG_SEQUENCE) { + GETSHORT(ns, inp); + GETSHORT(nr, inp); + } + if (hflags & PPPOL2TP_HEADERFLAG_OFFSET) { + GETSHORT(offset, inp) + if (offset > 4096) { /* don't be fooled with large offset which might overflow hlen */ + PPPDEBUG(LOG_DEBUG, ("pppol2tp: strange packet received, offset=%d\n", offset)); + goto free_and_return; + } + hlen += offset; + if (p->len < hlen) { + goto packet_too_short; + } + INCPTR(offset, inp); + } + + /* printf("HLEN = %d\n", hlen); */ + + /* skip L2TP header */ + if (pbuf_header(p, -(s16_t)hlen) != 0) { + goto free_and_return; + } + + /* printf("LEN=%d, TUNNEL_ID=%d, SESSION_ID=%d, NS=%d, NR=%d, OFFSET=%d\n", len, tunnel_id, session_id, ns, nr, offset); */ + PPPDEBUG(LOG_DEBUG, ("pppol2tp: input packet, len=%"U16_F", tunnel=%"U16_F", session=%"U16_F", ns=%"U16_F", nr=%"U16_F"\n", + len, tunnel_id, session_id, ns, nr)); + + /* Control packet */ + if (hflags & PPPOL2TP_HEADERFLAG_CONTROL) { + pppol2tp_dispatch_control_packet(l2tp, port, p, ns, nr); + goto free_and_return; + } + + /* Data packet */ + if(l2tp->phase != PPPOL2TP_STATE_DATA) { + goto free_and_return; + } + if(tunnel_id != l2tp->remote_tunnel_id) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: tunnel ID mismatch, assigned=%d, received=%d\n", l2tp->remote_tunnel_id, tunnel_id)); + goto free_and_return; + } + if(session_id != l2tp->remote_session_id) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: session ID mismatch, assigned=%d, received=%d\n", l2tp->remote_session_id, session_id)); + goto free_and_return; + } + /* + * skip address & flags if necessary + * + * RFC 2661 does not specify whether the PPP frame in the L2TP payload should + * have a HDLC header or not. We handle both cases for compatibility. + */ + if (p->len >= 2) { + GETSHORT(hflags, inp); + if (hflags == 0xff03) { + pbuf_header(p, -(s16_t)2); + } + } + /* Dispatch the packet thereby consuming it. */ + ppp_input(l2tp->ppp, p); + return; + +packet_too_short: + PPPDEBUG(LOG_DEBUG, ("pppol2tp: packet too short: %d\n", p->len)); +free_and_return: + pbuf_free(p); +} + +/* L2TP Control packet entry point */ +static void pppol2tp_dispatch_control_packet(pppol2tp_pcb *l2tp, u16_t port, struct pbuf *p, u16_t ns, u16_t nr) { + u8_t *inp; + u16_t avplen, avpflags, vendorid, attributetype, messagetype=0; + err_t err; +#if PPPOL2TP_AUTH_SUPPORT + lwip_md5_context md5_ctx; + u8_t md5_hash[16]; + u8_t challenge_id = 0; +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + l2tp->peer_nr = nr; + l2tp->peer_ns = ns; + /* printf("L2TP CTRL INPUT, ns=%d, nr=%d, len=%d\n", ns, nr, p->len); */ + + /* Handle the special case of the ICCN acknowledge */ + if (l2tp->phase == PPPOL2TP_STATE_ICCN_SENT && l2tp->peer_nr > l2tp->our_ns) { + l2tp->phase = PPPOL2TP_STATE_DATA; + } + + /* ZLB packets */ + if (p->tot_len == 0) { + return; + } + + p = ppp_singlebuf(p); + inp = (u8_t*)p->payload; + /* Decode AVPs */ + while (p->len > 0) { + if (p->len < sizeof(avpflags) + sizeof(vendorid) + sizeof(attributetype) ) { + goto packet_too_short; + } + GETSHORT(avpflags, inp); + avplen = avpflags & PPPOL2TP_AVPHEADERFLAG_LENGTHMASK; + /* printf("AVPLEN = %d\n", avplen); */ + if (p->len < avplen || avplen < sizeof(avpflags) + sizeof(vendorid) + sizeof(attributetype)) { + goto packet_too_short; + } + GETSHORT(vendorid, inp); + GETSHORT(attributetype, inp); + avplen -= sizeof(avpflags) + sizeof(vendorid) + sizeof(attributetype); + + /* Message type must be the first AVP */ + if (messagetype == 0) { + if (attributetype != 0 || vendorid != 0 || avplen != sizeof(messagetype) ) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: message type must be the first AVP\n")); + return; + } + GETSHORT(messagetype, inp); + /* printf("Message type = %d\n", messagetype); */ + switch(messagetype) { + /* Start Control Connection Reply */ + case PPPOL2TP_MESSAGETYPE_SCCRP: + /* Only accept SCCRP packet if we sent a SCCRQ */ + if (l2tp->phase != PPPOL2TP_STATE_SCCRQ_SENT) { + goto send_zlb; + } + break; + /* Incoming Call Reply */ + case PPPOL2TP_MESSAGETYPE_ICRP: + /* Only accept ICRP packet if we sent a IRCQ */ + if (l2tp->phase != PPPOL2TP_STATE_ICRQ_SENT) { + goto send_zlb; + } + break; + /* Stop Control Connection Notification */ + case PPPOL2TP_MESSAGETYPE_STOPCCN: + pppol2tp_send_zlb(l2tp, l2tp->our_ns); /* Ack the StopCCN before we switch to down state */ + if (l2tp->phase < PPPOL2TP_STATE_DATA) { + pppol2tp_abort_connect(l2tp); + } else if (l2tp->phase == PPPOL2TP_STATE_DATA) { + /* Don't disconnect here, we let the LCP Echo/Reply find the fact + * that PPP session is down. Asking the PPP stack to end the session + * require strict checking about the PPP phase to prevent endless + * disconnection loops. + */ + } + return; + default: + break; + } + goto nextavp; + } + + /* Skip proprietary L2TP extensions */ + if (vendorid != 0) { + goto skipavp; + } + + switch (messagetype) { + /* Start Control Connection Reply */ + case PPPOL2TP_MESSAGETYPE_SCCRP: + switch (attributetype) { + case PPPOL2TP_AVPTYPE_TUNNELID: + if (avplen != sizeof(l2tp->source_tunnel_id) ) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: AVP Assign tunnel ID length check failed\n")); + return; + } + GETSHORT(l2tp->source_tunnel_id, inp); + PPPDEBUG(LOG_DEBUG, ("pppol2tp: Assigned tunnel ID %"U16_F"\n", l2tp->source_tunnel_id)); + goto nextavp; +#if PPPOL2TP_AUTH_SUPPORT + case PPPOL2TP_AVPTYPE_CHALLENGE: + if (avplen == 0) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: Challenge length check failed\n")); + return; + } + if (l2tp->secret == NULL) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: Received challenge from peer and no secret key available\n")); + pppol2tp_abort_connect(l2tp); + return; + } + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&md5_ctx); + lwip_md5_starts(&md5_ctx); + challenge_id = PPPOL2TP_MESSAGETYPE_SCCCN; + lwip_md5_update(&md5_ctx, &challenge_id, 1); + lwip_md5_update(&md5_ctx, l2tp->secret, l2tp->secret_len); + lwip_md5_update(&md5_ctx, inp, avplen); + lwip_md5_finish(&md5_ctx, l2tp->challenge_hash); + lwip_md5_free(&md5_ctx); + l2tp->send_challenge = 1; + goto skipavp; + case PPPOL2TP_AVPTYPE_CHALLENGERESPONSE: + if (avplen != PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: AVP Challenge Response length check failed\n")); + return; + } + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&md5_ctx); + lwip_md5_starts(&md5_ctx); + challenge_id = PPPOL2TP_MESSAGETYPE_SCCRP; + lwip_md5_update(&md5_ctx, &challenge_id, 1); + lwip_md5_update(&md5_ctx, l2tp->secret, l2tp->secret_len); + lwip_md5_update(&md5_ctx, l2tp->secret_rv, sizeof(l2tp->secret_rv)); + lwip_md5_finish(&md5_ctx, md5_hash); + lwip_md5_free(&md5_ctx); + if ( memcmp(inp, md5_hash, sizeof(md5_hash)) ) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: Received challenge response from peer and secret key do not match\n")); + pppol2tp_abort_connect(l2tp); + return; + } + goto skipavp; +#endif /* PPPOL2TP_AUTH_SUPPORT */ + default: + break; + } + break; + /* Incoming Call Reply */ + case PPPOL2TP_MESSAGETYPE_ICRP: + switch (attributetype) { + case PPPOL2TP_AVPTYPE_SESSIONID: + if (avplen != sizeof(l2tp->source_session_id) ) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: AVP Assign session ID length check failed\n")); + return; + } + GETSHORT(l2tp->source_session_id, inp); + PPPDEBUG(LOG_DEBUG, ("pppol2tp: Assigned session ID %"U16_F"\n", l2tp->source_session_id)); + goto nextavp; + default: + break; + } + break; + default: + break; + } + +skipavp: + INCPTR(avplen, inp); +nextavp: + /* printf("AVP Found, vendor=%d, attribute=%d, len=%d\n", vendorid, attributetype, avplen); */ + /* next AVP */ + if (pbuf_header(p, -(s16_t)(avplen + sizeof(avpflags) + sizeof(vendorid) + sizeof(attributetype)) ) != 0) { + return; + } + } + + switch(messagetype) { + /* Start Control Connection Reply */ + case PPPOL2TP_MESSAGETYPE_SCCRP: + do { + l2tp->remote_session_id = magic(); + } while(l2tp->remote_session_id == 0); + l2tp->tunnel_port = port; /* LNS server might have chosen its own local port */ + l2tp->icrq_retried = 0; + l2tp->phase = PPPOL2TP_STATE_ICRQ_SENT; + l2tp->our_ns++; + if ((err = pppol2tp_send_scccn(l2tp, l2tp->our_ns)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); + } + l2tp->our_ns++; + if ((err = pppol2tp_send_icrq(l2tp, l2tp->our_ns)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); + } + sys_untimeout(pppol2tp_timeout, l2tp); + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + /* Incoming Call Reply */ + case PPPOL2TP_MESSAGETYPE_ICRP: + l2tp->iccn_retried = 0; + l2tp->phase = PPPOL2TP_STATE_ICCN_SENT; + l2tp->our_ns++; + ppp_start(l2tp->ppp); /* notify upper layers */ + if ((err = pppol2tp_send_iccn(l2tp, l2tp->our_ns)) != 0) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); + } + sys_untimeout(pppol2tp_timeout, l2tp); + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + /* Unhandled packet, send ZLB ACK */ + default: + goto send_zlb; + } + return; + +send_zlb: + pppol2tp_send_zlb(l2tp, l2tp->our_ns); + return; +packet_too_short: + PPPDEBUG(LOG_DEBUG, ("pppol2tp: packet too short: %d\n", p->len)); +} + +/* L2TP Timeout handler */ +static void pppol2tp_timeout(void *arg) { + pppol2tp_pcb *l2tp = (pppol2tp_pcb*)arg; + err_t err; + u32_t retry_wait; + + PPPDEBUG(LOG_DEBUG, ("pppol2tp: timeout\n")); + + switch (l2tp->phase) { + case PPPOL2TP_STATE_SCCRQ_SENT: + /* backoff wait */ + if (l2tp->sccrq_retried < 0xff) { + l2tp->sccrq_retried++; + } + if (!l2tp->ppp->settings.persist && l2tp->sccrq_retried >= PPPOL2TP_MAXSCCRQ) { + pppol2tp_abort_connect(l2tp); + return; + } + retry_wait = LWIP_MIN(PPPOL2TP_CONTROL_TIMEOUT * l2tp->sccrq_retried, PPPOL2TP_SLOW_RETRY); + PPPDEBUG(LOG_DEBUG, ("pppol2tp: sccrq_retried=%d\n", l2tp->sccrq_retried)); + if ((err = pppol2tp_send_sccrq(l2tp)) != 0) { + l2tp->sccrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCRQ, error=%d\n", err)); + } + sys_timeout(retry_wait, pppol2tp_timeout, l2tp); + break; + + case PPPOL2TP_STATE_ICRQ_SENT: + l2tp->icrq_retried++; + if (l2tp->icrq_retried >= PPPOL2TP_MAXICRQ) { + pppol2tp_abort_connect(l2tp); + return; + } + PPPDEBUG(LOG_DEBUG, ("pppol2tp: icrq_retried=%d\n", l2tp->icrq_retried)); + if (l2tp->peer_nr <= l2tp->our_ns -1) { /* the SCCCN was not acknowledged */ + if ((err = pppol2tp_send_scccn(l2tp, l2tp->our_ns -1)) != 0) { + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + } + } + if ((err = pppol2tp_send_icrq(l2tp, l2tp->our_ns)) != 0) { + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); + } + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + + case PPPOL2TP_STATE_ICCN_SENT: + l2tp->iccn_retried++; + if (l2tp->iccn_retried >= PPPOL2TP_MAXICCN) { + pppol2tp_abort_connect(l2tp); + return; + } + PPPDEBUG(LOG_DEBUG, ("pppol2tp: iccn_retried=%d\n", l2tp->iccn_retried)); + if ((err = pppol2tp_send_iccn(l2tp, l2tp->our_ns)) != 0) { + l2tp->iccn_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); + } + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + + default: + return; /* all done, work in peace */ + } +} + +/* Connection attempt aborted */ +static void pppol2tp_abort_connect(pppol2tp_pcb *l2tp) { + PPPDEBUG(LOG_DEBUG, ("pppol2tp: could not establish connection\n")); + l2tp->phase = PPPOL2TP_STATE_INITIAL; + ppp_link_failed(l2tp->ppp); /* notify upper layers */ +} + +/* Initiate a new tunnel */ +static err_t pppol2tp_send_sccrq(pppol2tp_pcb *l2tp) { + struct pbuf *pb; + u8_t *p; + u16_t len; + + /* calculate UDP packet length */ + len = 12 +8 +8 +10 +10 +6+sizeof(PPPOL2TP_HOSTNAME)-1 +6+sizeof(PPPOL2TP_VENDORNAME)-1 +8 +8; +#if PPPOL2TP_AUTH_SUPPORT + if (l2tp->secret != NULL) { + len += 6 + sizeof(l2tp->secret_rv); + } +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(0, p); /* Tunnel Id */ + PUTSHORT(0, p); /* Session Id */ + PUTSHORT(0, p); /* NS Sequence number - to peer */ + PUTSHORT(0, p); /* NR Sequence number - expected for peer */ + + /* AVP - Message type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_MESSAGE, p); /* Attribute type: Message Type */ + PUTSHORT(PPPOL2TP_MESSAGETYPE_SCCRQ, p); /* Attribute value: Message type: SCCRQ */ + + /* AVP - L2TP Version */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_VERSION, p); /* Attribute type: Version */ + PUTSHORT(PPPOL2TP_VERSION, p); /* Attribute value: L2TP Version */ + + /* AVP - Framing capabilities */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 10, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES, p); /* Attribute type: Framing capabilities */ + PUTLONG(PPPOL2TP_FRAMINGCAPABILITIES, p); /* Attribute value: Framing capabilities */ + + /* AVP - Bearer capabilities */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 10, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_BEARERCAPABILITIES, p); /* Attribute type: Bearer capabilities */ + PUTLONG(PPPOL2TP_BEARERCAPABILITIES, p); /* Attribute value: Bearer capabilities */ + + /* AVP - Host name */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 6+sizeof(PPPOL2TP_HOSTNAME)-1, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_HOSTNAME, p); /* Attribute type: Hostname */ + MEMCPY(p, PPPOL2TP_HOSTNAME, sizeof(PPPOL2TP_HOSTNAME)-1); /* Attribute value: Hostname */ + INCPTR(sizeof(PPPOL2TP_HOSTNAME)-1, p); + + /* AVP - Vendor name */ + PUTSHORT(6+sizeof(PPPOL2TP_VENDORNAME)-1, p); /* len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_VENDORNAME, p); /* Attribute type: Vendor name */ + MEMCPY(p, PPPOL2TP_VENDORNAME, sizeof(PPPOL2TP_VENDORNAME)-1); /* Attribute value: Vendor name */ + INCPTR(sizeof(PPPOL2TP_VENDORNAME)-1, p); + + /* AVP - Assign tunnel ID */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_TUNNELID, p); /* Attribute type: Tunnel ID */ + PUTSHORT(l2tp->remote_tunnel_id, p); /* Attribute value: Tunnel ID */ + + /* AVP - Receive window size */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE, p); /* Attribute type: Receive window size */ + PUTSHORT(PPPOL2TP_RECEIVEWINDOWSIZE, p); /* Attribute value: Receive window size */ + +#if PPPOL2TP_AUTH_SUPPORT + /* AVP - Challenge */ + if (l2tp->secret != NULL) { + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 6 + sizeof(l2tp->secret_rv), p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_CHALLENGE, p); /* Attribute type: Challenge */ + MEMCPY(p, l2tp->secret_rv, sizeof(l2tp->secret_rv)); /* Attribute value: Random vector */ + INCPTR(sizeof(l2tp->secret_rv), p); + } +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + return pppol2tp_udp_send(l2tp, pb); +} + +/* Complete tunnel establishment */ +static err_t pppol2tp_send_scccn(pppol2tp_pcb *l2tp, u16_t ns) { + struct pbuf *pb; + u8_t *p; + u16_t len; + + /* calculate UDP packet length */ + len = 12 +8; +#if PPPOL2TP_AUTH_SUPPORT + if (l2tp->send_challenge) { + len += 6 + sizeof(l2tp->challenge_hash); + } +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(0, p); /* Session Id */ + PUTSHORT(ns, p); /* NS Sequence number - to peer */ + PUTSHORT(l2tp->peer_ns+1, p); /* NR Sequence number - expected for peer */ + + /* AVP - Message type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_MESSAGE, p); /* Attribute type: Message Type */ + PUTSHORT(PPPOL2TP_MESSAGETYPE_SCCCN, p); /* Attribute value: Message type: SCCCN */ + +#if PPPOL2TP_AUTH_SUPPORT + /* AVP - Challenge response */ + if (l2tp->send_challenge) { + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 6 + sizeof(l2tp->challenge_hash), p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_CHALLENGERESPONSE, p); /* Attribute type: Challenge response */ + MEMCPY(p, l2tp->challenge_hash, sizeof(l2tp->challenge_hash)); /* Attribute value: Computed challenge */ + INCPTR(sizeof(l2tp->challenge_hash), p); + } +#endif /* PPPOL2TP_AUTH_SUPPORT */ + + return pppol2tp_udp_send(l2tp, pb); +} + +/* Initiate a new session */ +static err_t pppol2tp_send_icrq(pppol2tp_pcb *l2tp, u16_t ns) { + struct pbuf *pb; + u8_t *p; + u16_t len; + u32_t serialnumber; + + /* calculate UDP packet length */ + len = 12 +8 +8 +10; + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(0, p); /* Session Id */ + PUTSHORT(ns, p); /* NS Sequence number - to peer */ + PUTSHORT(l2tp->peer_ns+1, p); /* NR Sequence number - expected for peer */ + + /* AVP - Message type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_MESSAGE, p); /* Attribute type: Message Type */ + PUTSHORT(PPPOL2TP_MESSAGETYPE_ICRQ, p); /* Attribute value: Message type: ICRQ */ + + /* AVP - Assign session ID */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_SESSIONID, p); /* Attribute type: Session ID */ + PUTSHORT(l2tp->remote_session_id, p); /* Attribute value: Session ID */ + + /* AVP - Call Serial Number */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 10, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_CALLSERIALNUMBER, p); /* Attribute type: Serial number */ + serialnumber = magic(); + PUTLONG(serialnumber, p); /* Attribute value: Serial number */ + + return pppol2tp_udp_send(l2tp, pb); +} + +/* Complete tunnel establishment */ +static err_t pppol2tp_send_iccn(pppol2tp_pcb *l2tp, u16_t ns) { + struct pbuf *pb; + u8_t *p; + u16_t len; + + /* calculate UDP packet length */ + len = 12 +8 +10 +10; + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(l2tp->source_session_id, p); /* Session Id */ + PUTSHORT(ns, p); /* NS Sequence number - to peer */ + PUTSHORT(l2tp->peer_ns+1, p); /* NR Sequence number - expected for peer */ + + /* AVP - Message type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_MESSAGE, p); /* Attribute type: Message Type */ + PUTSHORT(PPPOL2TP_MESSAGETYPE_ICCN, p); /* Attribute value: Message type: ICCN */ + + /* AVP - Framing type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 10, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_FRAMINGTYPE, p); /* Attribute type: Framing type */ + PUTLONG(PPPOL2TP_FRAMINGTYPE, p); /* Attribute value: Framing type */ + + /* AVP - TX Connect speed */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 10, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_TXCONNECTSPEED, p); /* Attribute type: TX Connect speed */ + PUTLONG(PPPOL2TP_TXCONNECTSPEED, p); /* Attribute value: TX Connect speed */ + + return pppol2tp_udp_send(l2tp, pb); +} + +/* Send a ZLB ACK packet */ +static err_t pppol2tp_send_zlb(pppol2tp_pcb *l2tp, u16_t ns) { + struct pbuf *pb; + u8_t *p; + u16_t len; + + /* calculate UDP packet length */ + len = 12; + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(0, p); /* Session Id */ + PUTSHORT(ns, p); /* NS Sequence number - to peer */ + PUTSHORT(l2tp->peer_ns+1, p); /* NR Sequence number - expected for peer */ + + return pppol2tp_udp_send(l2tp, pb); +} + +/* Send a StopCCN packet */ +static err_t pppol2tp_send_stopccn(pppol2tp_pcb *l2tp, u16_t ns) { + struct pbuf *pb; + u8_t *p; + u16_t len; + + /* calculate UDP packet length */ + len = 12 +8 +8 +8; + + /* allocate a buffer */ + pb = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + if (pb == NULL) { + return ERR_MEM; + } + LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len); + + p = (u8_t*)pb->payload; + /* fill in pkt */ + /* L2TP control header */ + PUTSHORT(PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY, p); + PUTSHORT(len, p); /* Length */ + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(0, p); /* Session Id */ + PUTSHORT(ns, p); /* NS Sequence number - to peer */ + PUTSHORT(l2tp->peer_ns+1, p); /* NR Sequence number - expected for peer */ + + /* AVP - Message type */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_MESSAGE, p); /* Attribute type: Message Type */ + PUTSHORT(PPPOL2TP_MESSAGETYPE_STOPCCN, p); /* Attribute value: Message type: StopCCN */ + + /* AVP - Assign tunnel ID */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_TUNNELID, p); /* Attribute type: Tunnel ID */ + PUTSHORT(l2tp->remote_tunnel_id, p); /* Attribute value: Tunnel ID */ + + /* AVP - Result code */ + PUTSHORT(PPPOL2TP_AVPHEADERFLAG_MANDATORY + 8, p); /* Mandatory flag + len field */ + PUTSHORT(0, p); /* Vendor ID */ + PUTSHORT(PPPOL2TP_AVPTYPE_RESULTCODE, p); /* Attribute type: Result code */ + PUTSHORT(PPPOL2TP_RESULTCODE, p); /* Attribute value: Result code */ + + return pppol2tp_udp_send(l2tp, pb); +} + +static err_t pppol2tp_xmit(pppol2tp_pcb *l2tp, struct pbuf *pb) { + u8_t *p; + + /* make room for L2TP header - should not fail */ + if (pbuf_header(pb, (s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN) != 0) { + /* bail out */ + PPPDEBUG(LOG_ERR, ("pppol2tp: pppol2tp_pcb: could not allocate room for L2TP header\n")); + LINK_STATS_INC(link.lenerr); + pbuf_free(pb); + return ERR_BUF; + } + + p = (u8_t*)pb->payload; + PUTSHORT(PPPOL2TP_HEADERFLAG_DATA_MANDATORY, p); + PUTSHORT(l2tp->source_tunnel_id, p); /* Tunnel Id */ + PUTSHORT(l2tp->source_session_id, p); /* Session Id */ + + return pppol2tp_udp_send(l2tp, pb); +} + +static err_t pppol2tp_udp_send(pppol2tp_pcb *l2tp, struct pbuf *pb) { + err_t err; + if (l2tp->netif) { + err = udp_sendto_if(l2tp->udp, pb, &l2tp->remote_ip, l2tp->tunnel_port, l2tp->netif); + } else { + err = udp_sendto(l2tp->udp, pb, &l2tp->remote_ip, l2tp->tunnel_port); + } + pbuf_free(pb); + return err; +} + +#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppos.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppos.c new file mode 100644 index 0000000..fb48df4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/pppos.c @@ -0,0 +1,875 @@ +/** + * @file + * Network Point to Point Protocol over Serial file. + * + */ + +/* + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOS_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include + +#include "lwip/arch.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" +#include "lwip/sys.h" +#include "lwip/memp.h" +#include "lwip/netif.h" +#include "lwip/snmp.h" +#include "lwip/priv/tcpip_priv.h" +#include "lwip/api.h" +#include "lwip/ip4.h" /* for ip4_input() */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/pppos.h" +#include "netif/ppp/vj.h" + +/* Memory pool */ +LWIP_MEMPOOL_DECLARE(PPPOS_PCB, MEMP_NUM_PPPOS_INTERFACES, sizeof(pppos_pcb), "PPPOS_PCB") + +/* callbacks called from PPP core */ +static err_t pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p); +static err_t pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol); +static void pppos_connect(ppp_pcb *ppp, void *ctx); +#if PPP_SERVER +static void pppos_listen(ppp_pcb *ppp, void *ctx); +#endif /* PPP_SERVER */ +static void pppos_disconnect(ppp_pcb *ppp, void *ctx); +static err_t pppos_destroy(ppp_pcb *ppp, void *ctx); +static void pppos_send_config(ppp_pcb *ppp, void *ctx, u32_t accm, int pcomp, int accomp); +static void pppos_recv_config(ppp_pcb *ppp, void *ctx, u32_t accm, int pcomp, int accomp); + +/* Prototypes for procedures local to this file. */ +#if PPP_INPROC_IRQ_SAFE +static void pppos_input_callback(void *arg); +#endif /* PPP_INPROC_IRQ_SAFE */ +static void pppos_input_free_current_packet(pppos_pcb *pppos); +static void pppos_input_drop(pppos_pcb *pppos); +static err_t pppos_output_append(pppos_pcb *pppos, err_t err, struct pbuf *nb, u8_t c, u8_t accm, u16_t *fcs); +static err_t pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb, u16_t *fcs); + +/* Callbacks structure for PPP core */ +static const struct link_callbacks pppos_callbacks = { + pppos_connect, +#if PPP_SERVER + pppos_listen, +#endif /* PPP_SERVER */ + pppos_disconnect, + pppos_destroy, + pppos_write, + pppos_netif_output, + pppos_send_config, + pppos_recv_config +}; + +/* PPP's Asynchronous-Control-Character-Map. The mask array is used + * to select the specific bit for a character. */ +#define ESCAPE_P(accm, c) ((accm)[(c) >> 3] & 1 << (c & 0x07)) + +#if PPP_FCS_TABLE +/* + * FCS lookup table as calculated by genfcstab. + */ +static const u16_t fcstab[256] = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; +#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff]) +#else /* PPP_FCS_TABLE */ +/* The HDLC polynomial: X**0 + X**5 + X**12 + X**16 (0x8408) */ +#define PPP_FCS_POLYNOMIAL 0x8408 +static u16_t +ppp_get_fcs(u8_t byte) +{ + unsigned int octet; + int bit; + octet = byte; + for (bit = 8; bit-- > 0; ) { + octet = (octet & 0x01) ? ((octet >> 1) ^ PPP_FCS_POLYNOMIAL) : (octet >> 1); + } + return octet & 0xffff; +} +#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ ppp_get_fcs(((fcs) ^ (c)) & 0xff)) +#endif /* PPP_FCS_TABLE */ + +/* + * Values for FCS calculations. + */ +#define PPP_INITFCS 0xffff /* Initial FCS value */ +#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ + +#if PPP_INPROC_IRQ_SAFE +#define PPPOS_DECL_PROTECT(lev) SYS_ARCH_DECL_PROTECT(lev) +#define PPPOS_PROTECT(lev) SYS_ARCH_PROTECT(lev) +#define PPPOS_UNPROTECT(lev) SYS_ARCH_UNPROTECT(lev) +#else +#define PPPOS_DECL_PROTECT(lev) +#define PPPOS_PROTECT(lev) +#define PPPOS_UNPROTECT(lev) +#endif /* PPP_INPROC_IRQ_SAFE */ + + +/* + * Create a new PPP connection using the given serial I/O device. + * + * Return 0 on success, an error code on failure. + */ +ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb) +{ + pppos_pcb *pppos; + ppp_pcb *ppp; + + pppos = (pppos_pcb *)LWIP_MEMPOOL_ALLOC(PPPOS_PCB); + if (pppos == NULL) { + return NULL; + } + + ppp = ppp_new(pppif, &pppos_callbacks, pppos, link_status_cb, ctx_cb); + if (ppp == NULL) { + LWIP_MEMPOOL_FREE(PPPOS_PCB, pppos); + return NULL; + } + + memset(pppos, 0, sizeof(pppos_pcb)); + pppos->ppp = ppp; + pppos->output_cb = output_cb; + return ppp; +} + +/* Called by PPP core */ +static err_t +pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + u8_t *s; + struct pbuf *nb; + u16_t n; + u16_t fcs_out; + err_t err; + LWIP_UNUSED_ARG(ppp); + + /* Grab an output buffer. */ + nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL); + if (nb == NULL) { + PPPDEBUG(LOG_WARNING, ("pppos_write[%d]: alloc fail\n", ppp->netif->num)); + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + pbuf_free(p); + return ERR_MEM; + } + + /* If the link has been idle, we'll send a fresh flag character to + * flush any noise. */ + err = ERR_OK; + if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { + err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL); + } + + /* Load output buffer. */ + fcs_out = PPP_INITFCS; + s = (u8_t*)p->payload; + n = p->len; + while (n-- > 0) { + err = pppos_output_append(pppos, err, nb, *s++, 1, &fcs_out); + } + + err = pppos_output_last(pppos, err, nb, &fcs_out); + if (err == ERR_OK) { + PPPDEBUG(LOG_INFO, ("pppos_write[%d]: len=%d\n", ppp->netif->num, p->len)); + } else { + PPPDEBUG(LOG_WARNING, ("pppos_write[%d]: output failed len=%d\n", ppp->netif->num, p->len)); + } + pbuf_free(p); + return err; +} + +/* Called by PPP core */ +static err_t +pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + struct pbuf *nb, *p; + u16_t fcs_out; + err_t err; + LWIP_UNUSED_ARG(ppp); + + /* Grab an output buffer. */ + nb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL); + if (nb == NULL) { + PPPDEBUG(LOG_WARNING, ("pppos_netif_output[%d]: alloc fail\n", ppp->netif->num)); + LINK_STATS_INC(link.memerr); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + return ERR_MEM; + } + + /* If the link has been idle, we'll send a fresh flag character to + * flush any noise. */ + err = ERR_OK; + if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) { + err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL); + } + + fcs_out = PPP_INITFCS; + if (!pppos->accomp) { + err = pppos_output_append(pppos, err, nb, PPP_ALLSTATIONS, 1, &fcs_out); + err = pppos_output_append(pppos, err, nb, PPP_UI, 1, &fcs_out); + } + if (!pppos->pcomp || protocol > 0xFF) { + err = pppos_output_append(pppos, err, nb, (protocol >> 8) & 0xFF, 1, &fcs_out); + } + err = pppos_output_append(pppos, err, nb, protocol & 0xFF, 1, &fcs_out); + + /* Load packet. */ + for(p = pb; p; p = p->next) { + u16_t n = p->len; + u8_t *s = (u8_t*)p->payload; + + while (n-- > 0) { + err = pppos_output_append(pppos, err, nb, *s++, 1, &fcs_out); + } + } + + err = pppos_output_last(pppos, err, nb, &fcs_out); + if (err == ERR_OK) { + PPPDEBUG(LOG_INFO, ("pppos_netif_output[%d]: proto=0x%"X16_F", len = %d\n", ppp->netif->num, protocol, pb->tot_len)); + } else { + PPPDEBUG(LOG_WARNING, ("pppos_netif_output[%d]: output failed proto=0x%"X16_F", len = %d\n", ppp->netif->num, protocol, pb->tot_len)); + } + return err; +} + +static void +pppos_connect(ppp_pcb *ppp, void *ctx) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + PPPOS_DECL_PROTECT(lev); + +#if PPP_INPROC_IRQ_SAFE + /* input pbuf left over from last session? */ + pppos_input_free_current_packet(pppos); +#endif /* PPP_INPROC_IRQ_SAFE */ + + /* reset PPPoS control block to its initial state */ + memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - offsetof(pppos_pcb, last_xmit)); + + /* + * Default the in and out accm so that escape and flag characters + * are always escaped. + */ + pppos->in_accm[15] = 0x60; /* no need to protect since RX is not running */ + pppos->out_accm[15] = 0x60; + PPPOS_PROTECT(lev); + pppos->open = 1; + PPPOS_UNPROTECT(lev); + + /* + * Start the connection and handle incoming events (packet or timeout). + */ + PPPDEBUG(LOG_INFO, ("pppos_connect: unit %d: connecting\n", ppp->netif->num)); + ppp_start(ppp); /* notify upper layers */ +} + +#if PPP_SERVER +static void +pppos_listen(ppp_pcb *ppp, void *ctx) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + PPPOS_DECL_PROTECT(lev); + +#if PPP_INPROC_IRQ_SAFE + /* input pbuf left over from last session? */ + pppos_input_free_current_packet(pppos); +#endif /* PPP_INPROC_IRQ_SAFE */ + + /* reset PPPoS control block to its initial state */ + memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - offsetof(pppos_pcb, last_xmit)); + + /* + * Default the in and out accm so that escape and flag characters + * are always escaped. + */ + pppos->in_accm[15] = 0x60; /* no need to protect since RX is not running */ + pppos->out_accm[15] = 0x60; + PPPOS_PROTECT(lev); + pppos->open = 1; + PPPOS_UNPROTECT(lev); + + /* + * Wait for something to happen. + */ + PPPDEBUG(LOG_INFO, ("pppos_listen: unit %d: listening\n", ppp->netif->num)); + ppp_start(ppp); /* notify upper layers */ +} +#endif /* PPP_SERVER */ + +static void +pppos_disconnect(ppp_pcb *ppp, void *ctx) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + PPPOS_DECL_PROTECT(lev); + + PPPOS_PROTECT(lev); + pppos->open = 0; + PPPOS_UNPROTECT(lev); + + /* If PPP_INPROC_IRQ_SAFE is used we cannot call + * pppos_input_free_current_packet() here because + * rx IRQ might still call pppos_input(). + */ +#if !PPP_INPROC_IRQ_SAFE + /* input pbuf left ? */ + pppos_input_free_current_packet(pppos); +#endif /* !PPP_INPROC_IRQ_SAFE */ + + ppp_link_end(ppp); /* notify upper layers */ +} + +static err_t +pppos_destroy(ppp_pcb *ppp, void *ctx) +{ + pppos_pcb *pppos = (pppos_pcb *)ctx; + LWIP_UNUSED_ARG(ppp); + +#if PPP_INPROC_IRQ_SAFE + /* input pbuf left ? */ + pppos_input_free_current_packet(pppos); +#endif /* PPP_INPROC_IRQ_SAFE */ + + LWIP_MEMPOOL_FREE(PPPOS_PCB, pppos); + return ERR_OK; +} + +#if !NO_SYS && !PPP_INPROC_IRQ_SAFE +/** Pass received raw characters to PPPoS to be decoded through lwIP TCPIP thread. + * + * @param ppp PPP descriptor index, returned by pppos_create() + * @param s received data + * @param l length of received data + */ +err_t +pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l) +{ + struct pbuf *p; + err_t err; + + p = pbuf_alloc(PBUF_RAW, l, PBUF_POOL); + if (!p) { + return ERR_MEM; + } + pbuf_take(p, s, l); + + err = tcpip_inpkt(p, ppp_netif(ppp), pppos_input_sys); + if (err != ERR_OK) { + pbuf_free(p); + } + return err; +} + +/* called from TCPIP thread */ +err_t pppos_input_sys(struct pbuf *p, struct netif *inp) { + ppp_pcb *ppp = (ppp_pcb*)inp->state; + struct pbuf *n; + + for (n = p; n; n = n->next) { + pppos_input(ppp, (u8_t*)n->payload, n->len); + } + pbuf_free(p); + return ERR_OK; +} +#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ + +/** PPPoS input helper struct, must be packed since it is stored + * to pbuf->payload, which might be unaligned. */ +#if PPP_INPROC_IRQ_SAFE +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct pppos_input_header { + PACK_STRUCT_FIELD(ppp_pcb *ppp); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif +#endif /* PPP_INPROC_IRQ_SAFE */ + +/** Pass received raw characters to PPPoS to be decoded. + * + * @param ppp PPP descriptor index, returned by pppos_create() + * @param s received data + * @param l length of received data + */ +void +pppos_input(ppp_pcb *ppp, u8_t *s, int l) +{ + pppos_pcb *pppos = (pppos_pcb *)ppp->link_ctx_cb; + struct pbuf *next_pbuf; + u8_t cur_char; + u8_t escaped; + PPPOS_DECL_PROTECT(lev); + + PPPDEBUG(LOG_DEBUG, ("pppos_input[%d]: got %d bytes\n", ppp->netif->num, l)); + while (l-- > 0) { + cur_char = *s++; + + PPPOS_PROTECT(lev); + /* ppp_input can disconnect the interface, we need to abort to prevent a memory + * leak if there are remaining bytes because pppos_connect and pppos_listen + * functions expect input buffer to be free. Furthermore there are no real + * reason to continue reading bytes if we are disconnected. + */ + if (!pppos->open) { + PPPOS_UNPROTECT(lev); + return; + } + escaped = ESCAPE_P(pppos->in_accm, cur_char); + PPPOS_UNPROTECT(lev); + /* Handle special characters. */ + if (escaped) { + /* Check for escape sequences. */ + /* XXX Note that this does not handle an escaped 0x5d character which + * would appear as an escape character. Since this is an ASCII ']' + * and there is no reason that I know of to escape it, I won't complicate + * the code to handle this case. GLL */ + if (cur_char == PPP_ESCAPE) { + pppos->in_escaped = 1; + /* Check for the flag character. */ + } else if (cur_char == PPP_FLAG) { + /* If this is just an extra flag character, ignore it. */ + if (pppos->in_state <= PDADDRESS) { + /* ignore it */; + /* If we haven't received the packet header, drop what has come in. */ + } else if (pppos->in_state < PDDATA) { + PPPDEBUG(LOG_WARNING, + ("pppos_input[%d]: Dropping incomplete packet %d\n", + ppp->netif->num, pppos->in_state)); + LINK_STATS_INC(link.lenerr); + pppos_input_drop(pppos); + /* If the fcs is invalid, drop the packet. */ + } else if (pppos->in_fcs != PPP_GOODFCS) { + PPPDEBUG(LOG_INFO, + ("pppos_input[%d]: Dropping bad fcs 0x%"X16_F" proto=0x%"X16_F"\n", + ppp->netif->num, pppos->in_fcs, pppos->in_protocol)); + /* Note: If you get lots of these, check for UART frame errors or try different baud rate */ + LINK_STATS_INC(link.chkerr); + pppos_input_drop(pppos); + /* Otherwise it's a good packet so pass it on. */ + } else { + struct pbuf *inp; + /* Trim off the checksum. */ + if(pppos->in_tail->len > 2) { + pppos->in_tail->len -= 2; + + pppos->in_tail->tot_len = pppos->in_tail->len; + if (pppos->in_tail != pppos->in_head) { + pbuf_cat(pppos->in_head, pppos->in_tail); + } + } else { + pppos->in_tail->tot_len = pppos->in_tail->len; + if (pppos->in_tail != pppos->in_head) { + pbuf_cat(pppos->in_head, pppos->in_tail); + } + + pbuf_realloc(pppos->in_head, pppos->in_head->tot_len - 2); + } + + /* Dispatch the packet thereby consuming it. */ + inp = pppos->in_head; + /* Packet consumed, release our references. */ + pppos->in_head = NULL; + pppos->in_tail = NULL; +#if IP_FORWARD || LWIP_IPV6_FORWARD + /* hide the room for Ethernet forwarding header */ + pbuf_header(inp, -(s16_t)(PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN)); +#endif /* IP_FORWARD || LWIP_IPV6_FORWARD */ +#if PPP_INPROC_IRQ_SAFE + if(tcpip_callback_with_block(pppos_input_callback, inp, 0) != ERR_OK) { + PPPDEBUG(LOG_ERR, ("pppos_input[%d]: tcpip_callback() failed, dropping packet\n", ppp->netif->num)); + pbuf_free(inp); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards); + } +#else /* PPP_INPROC_IRQ_SAFE */ + ppp_input(ppp, inp); +#endif /* PPP_INPROC_IRQ_SAFE */ + } + + /* Prepare for a new packet. */ + pppos->in_fcs = PPP_INITFCS; + pppos->in_state = PDADDRESS; + pppos->in_escaped = 0; + /* Other characters are usually control characters that may have + * been inserted by the physical layer so here we just drop them. */ + } else { + PPPDEBUG(LOG_WARNING, + ("pppos_input[%d]: Dropping ACCM char <%d>\n", ppp->netif->num, cur_char)); + } + /* Process other characters. */ + } else { + /* Unencode escaped characters. */ + if (pppos->in_escaped) { + pppos->in_escaped = 0; + cur_char ^= PPP_TRANS; + } + + /* Process character relative to current state. */ + switch(pppos->in_state) { + case PDIDLE: /* Idle state - waiting. */ + /* Drop the character if it's not 0xff + * we would have processed a flag character above. */ + if (cur_char != PPP_ALLSTATIONS) { + break; + } + /* no break */ + /* Fall through */ + + case PDSTART: /* Process start flag. */ + /* Prepare for a new packet. */ + pppos->in_fcs = PPP_INITFCS; + /* no break */ + /* Fall through */ + + case PDADDRESS: /* Process address field. */ + if (cur_char == PPP_ALLSTATIONS) { + pppos->in_state = PDCONTROL; + break; + } + /* no break */ + + /* Else assume compressed address and control fields so + * fall through to get the protocol... */ + case PDCONTROL: /* Process control field. */ + /* If we don't get a valid control code, restart. */ + if (cur_char == PPP_UI) { + pppos->in_state = PDPROTOCOL1; + break; + } + /* no break */ + +#if 0 + else { + PPPDEBUG(LOG_WARNING, + ("pppos_input[%d]: Invalid control <%d>\n", ppp->netif->num, cur_char)); + pppos->in_state = PDSTART; + } +#endif + case PDPROTOCOL1: /* Process protocol field 1. */ + /* If the lower bit is set, this is the end of the protocol + * field. */ + if (cur_char & 1) { + pppos->in_protocol = cur_char; + pppos->in_state = PDDATA; + } else { + pppos->in_protocol = (u16_t)cur_char << 8; + pppos->in_state = PDPROTOCOL2; + } + break; + case PDPROTOCOL2: /* Process protocol field 2. */ + pppos->in_protocol |= cur_char; + pppos->in_state = PDDATA; + break; + case PDDATA: /* Process data byte. */ + /* Make space to receive processed data. */ + if (pppos->in_tail == NULL || pppos->in_tail->len == PBUF_POOL_BUFSIZE) { + u16_t pbuf_alloc_len; + if (pppos->in_tail != NULL) { + pppos->in_tail->tot_len = pppos->in_tail->len; + if (pppos->in_tail != pppos->in_head) { + pbuf_cat(pppos->in_head, pppos->in_tail); + /* give up the in_tail reference now */ + pppos->in_tail = NULL; + } + } + /* If we haven't started a packet, we need a packet header. */ + pbuf_alloc_len = 0; +#if IP_FORWARD || LWIP_IPV6_FORWARD + /* If IP forwarding is enabled we are reserving PBUF_LINK_ENCAPSULATION_HLEN + * + PBUF_LINK_HLEN bytes so the packet is being allocated with enough header + * space to be forwarded (to Ethernet for example). + */ + if (pppos->in_head == NULL) { + pbuf_alloc_len = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN; + } +#endif /* IP_FORWARD || LWIP_IPV6_FORWARD */ + next_pbuf = pbuf_alloc(PBUF_RAW, pbuf_alloc_len, PBUF_POOL); + if (next_pbuf == NULL) { + /* No free buffers. Drop the input packet and let the + * higher layers deal with it. Continue processing + * the received pbuf chain in case a new packet starts. */ + PPPDEBUG(LOG_ERR, ("pppos_input[%d]: NO FREE PBUFS!\n", ppp->netif->num)); + LINK_STATS_INC(link.memerr); + pppos_input_drop(pppos); + pppos->in_state = PDSTART; /* Wait for flag sequence. */ + break; + } + if (pppos->in_head == NULL) { + u8_t *payload = ((u8_t*)next_pbuf->payload) + pbuf_alloc_len; +#if PPP_INPROC_IRQ_SAFE + ((struct pppos_input_header*)payload)->ppp = ppp; + payload += sizeof(struct pppos_input_header); + next_pbuf->len += sizeof(struct pppos_input_header); +#endif /* PPP_INPROC_IRQ_SAFE */ + next_pbuf->len += sizeof(pppos->in_protocol); + *(payload++) = pppos->in_protocol >> 8; + *(payload) = pppos->in_protocol & 0xFF; + pppos->in_head = next_pbuf; + } + pppos->in_tail = next_pbuf; + } + /* Load character into buffer. */ + ((u8_t*)pppos->in_tail->payload)[pppos->in_tail->len++] = cur_char; + break; + default: + break; + } + + /* update the frame check sequence number. */ + pppos->in_fcs = PPP_FCS(pppos->in_fcs, cur_char); + } + } /* while (l-- > 0), all bytes processed */ +} + +#if PPP_INPROC_IRQ_SAFE +/* PPPoS input callback using one input pointer + */ +static void pppos_input_callback(void *arg) { + struct pbuf *pb = (struct pbuf*)arg; + ppp_pcb *ppp; + + ppp = ((struct pppos_input_header*)pb->payload)->ppp; + if(pbuf_header(pb, -(s16_t)sizeof(struct pppos_input_header))) { + LWIP_ASSERT("pbuf_header failed\n", 0); + goto drop; + } + + /* Dispatch the packet thereby consuming it. */ + ppp_input(ppp, pb); + return; + +drop: + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(ppp->netif, ifindiscards); + pbuf_free(pb); +} +#endif /* PPP_INPROC_IRQ_SAFE */ + +static void +pppos_send_config(ppp_pcb *ppp, void *ctx, u32_t accm, int pcomp, int accomp) +{ + int i; + pppos_pcb *pppos = (pppos_pcb *)ctx; + LWIP_UNUSED_ARG(ppp); + + pppos->pcomp = pcomp; + pppos->accomp = accomp; + + /* Load the ACCM bits for the 32 control codes. */ + for (i = 0; i < 32/8; i++) { + pppos->out_accm[i] = (u8_t)((accm >> (8 * i)) & 0xFF); + } + + PPPDEBUG(LOG_INFO, ("pppos_send_config[%d]: out_accm=%X %X %X %X\n", + pppos->ppp->netif->num, + pppos->out_accm[0], pppos->out_accm[1], pppos->out_accm[2], pppos->out_accm[3])); +} + +static void +pppos_recv_config(ppp_pcb *ppp, void *ctx, u32_t accm, int pcomp, int accomp) +{ + int i; + pppos_pcb *pppos = (pppos_pcb *)ctx; + PPPOS_DECL_PROTECT(lev); + LWIP_UNUSED_ARG(ppp); + LWIP_UNUSED_ARG(pcomp); + LWIP_UNUSED_ARG(accomp); + + /* Load the ACCM bits for the 32 control codes. */ + PPPOS_PROTECT(lev); + for (i = 0; i < 32 / 8; i++) { + pppos->in_accm[i] = (u8_t)(accm >> (i * 8)); + } + PPPOS_UNPROTECT(lev); + + PPPDEBUG(LOG_INFO, ("pppos_recv_config[%d]: in_accm=%X %X %X %X\n", + pppos->ppp->netif->num, + pppos->in_accm[0], pppos->in_accm[1], pppos->in_accm[2], pppos->in_accm[3])); +} + +/* + * Drop the input packet. + */ +static void +pppos_input_free_current_packet(pppos_pcb *pppos) +{ + if (pppos->in_head != NULL) { + if (pppos->in_tail && (pppos->in_tail != pppos->in_head)) { + pbuf_free(pppos->in_tail); + } + pbuf_free(pppos->in_head); + pppos->in_head = NULL; + } + pppos->in_tail = NULL; +} + +/* + * Drop the input packet and increase error counters. + */ +static void +pppos_input_drop(pppos_pcb *pppos) +{ + if (pppos->in_head != NULL) { +#if 0 + PPPDEBUG(LOG_INFO, ("pppos_input_drop: %d:%.*H\n", pppos->in_head->len, min(60, pppos->in_head->len * 2), pppos->in_head->payload)); +#endif + PPPDEBUG(LOG_INFO, ("pppos_input_drop: pbuf len=%d, addr %p\n", pppos->in_head->len, (void*)pppos->in_head)); + } + pppos_input_free_current_packet(pppos); +#if VJ_SUPPORT + vj_uncompress_err(&pppos->ppp->vj_comp); +#endif /* VJ_SUPPORT */ + + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(pppos->ppp->netif, ifindiscards); +} + +/* + * pppos_output_append - append given character to end of given pbuf. + * If out_accm is not 0 and the character needs to be escaped, do so. + * If pbuf is full, send the pbuf and reuse it. + * Return the current pbuf. + */ +static err_t +pppos_output_append(pppos_pcb *pppos, err_t err, struct pbuf *nb, u8_t c, u8_t accm, u16_t *fcs) +{ + if (err != ERR_OK) { + return err; + } + + /* Make sure there is room for the character and an escape code. + * Sure we don't quite fill the buffer if the character doesn't + * get escaped but is one character worth complicating this? */ + if ((PBUF_POOL_BUFSIZE - nb->len) < 2) { + u32_t l = pppos->output_cb(pppos->ppp, (u8_t*)nb->payload, nb->len, pppos->ppp->ctx_cb); + if (l != nb->len) { + return ERR_IF; + } + nb->len = 0; + } + + /* Update FCS before checking for special characters. */ + if (fcs) { + *fcs = PPP_FCS(*fcs, c); + } + + /* Copy to output buffer escaping special characters. */ + if (accm && ESCAPE_P(pppos->out_accm, c)) { + *((u8_t*)nb->payload + nb->len++) = PPP_ESCAPE; + *((u8_t*)nb->payload + nb->len++) = c ^ PPP_TRANS; + } else { + *((u8_t*)nb->payload + nb->len++) = c; + } + + return ERR_OK; +} + +static err_t +pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb, u16_t *fcs) +{ + ppp_pcb *ppp = pppos->ppp; + + /* Add FCS and trailing flag. */ + err = pppos_output_append(pppos, err, nb, ~(*fcs) & 0xFF, 1, NULL); + err = pppos_output_append(pppos, err, nb, (~(*fcs) >> 8) & 0xFF, 1, NULL); + err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL); + + if (err != ERR_OK) { + goto failed; + } + + /* Send remaining buffer if not empty */ + if (nb->len > 0) { + u32_t l = pppos->output_cb(ppp, (u8_t*)nb->payload, nb->len, ppp->ctx_cb); + if (l != nb->len) { + err = ERR_IF; + goto failed; + } + } + + pppos->last_xmit = sys_now(); + MIB2_STATS_NETIF_ADD(ppp->netif, ifoutoctets, nb->tot_len); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutucastpkts); + LINK_STATS_INC(link.xmit); + pbuf_free(nb); + return ERR_OK; + +failed: + pppos->last_xmit = 0; /* prepend PPP_FLAG to next packet */ + LINK_STATS_INC(link.err); + LINK_STATS_INC(link.drop); + MIB2_STATS_NETIF_INC(ppp->netif, ifoutdiscards); + pbuf_free(nb); + return err; +} + +#endif /* PPP_SUPPORT && PPPOS_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/upap.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/upap.c new file mode 100644 index 0000000..d00c2d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/upap.c @@ -0,0 +1,677 @@ +/* + * upap.c - User/Password Authentication Protocol. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. 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. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +/* + * @todo: + */ + +#if 0 /* UNUSED */ +#include +#include +#endif /* UNUSED */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/upap.h" + +#if PPP_OPTIONS +/* + * Command-line options. + */ +static option_t pap_option_list[] = { + { "hide-password", o_bool, &hide_password, + "Don't output passwords to log", OPT_PRIO | 1 }, + { "show-password", o_bool, &hide_password, + "Show password string in debug log messages", OPT_PRIOSUB | 0 }, + + { "pap-restart", o_int, &upap[0].us_timeouttime, + "Set retransmit timeout for PAP", OPT_PRIO }, + { "pap-max-authreq", o_int, &upap[0].us_maxtransmits, + "Set max number of transmissions for auth-reqs", OPT_PRIO }, + { "pap-timeout", o_int, &upap[0].us_reqtimeout, + "Set time limit for peer PAP authentication", OPT_PRIO }, + + { NULL } +}; +#endif /* PPP_OPTIONS */ + +/* + * Protocol entry points. + */ +static void upap_init(ppp_pcb *pcb); +static void upap_lowerup(ppp_pcb *pcb); +static void upap_lowerdown(ppp_pcb *pcb); +static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l); +static void upap_protrej(ppp_pcb *pcb); +#if PRINTPKT_SUPPORT +static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, const char *, ...), void *arg); +#endif /* PRINTPKT_SUPPORT */ + +const struct protent pap_protent = { + PPP_PAP, + upap_init, + upap_input, + upap_protrej, + upap_lowerup, + upap_lowerdown, + NULL, + NULL, +#if PRINTPKT_SUPPORT + upap_printpkt, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_DATAINPUT + NULL, +#endif /* PPP_DATAINPUT */ +#if PRINTPKT_SUPPORT + "PAP", + NULL, +#endif /* PRINTPKT_SUPPORT */ +#if PPP_OPTIONS + pap_option_list, + NULL, +#endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT + NULL, + NULL +#endif /* DEMAND_SUPPORT */ +}; + +static void upap_timeout(void *arg); +#if PPP_SERVER +static void upap_reqtimeout(void *arg); +static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len); +#endif /* PPP_SERVER */ +static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len); +static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len); +static void upap_sauthreq(ppp_pcb *pcb); +#if PPP_SERVER +static void upap_sresp(ppp_pcb *pcb, u_char code, u_char id, const char *msg, int msglen); +#endif /* PPP_SERVER */ + + +/* + * upap_init - Initialize a UPAP unit. + */ +static void upap_init(ppp_pcb *pcb) { + pcb->upap.us_user = NULL; + pcb->upap.us_userlen = 0; + pcb->upap.us_passwd = NULL; + pcb->upap.us_passwdlen = 0; + pcb->upap.us_clientstate = UPAPCS_INITIAL; +#if PPP_SERVER + pcb->upap.us_serverstate = UPAPSS_INITIAL; +#endif /* PPP_SERVER */ + pcb->upap.us_id = 0; +} + + +/* + * upap_authwithpeer - Authenticate us with our peer (start client). + * + * Set new state and send authenticate's. + */ +void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) { + + if(!user || !password) + return; + + /* Save the username and password we're given */ + pcb->upap.us_user = user; + pcb->upap.us_userlen = LWIP_MIN(strlen(user), 0xff); + pcb->upap.us_passwd = password; + pcb->upap.us_passwdlen = LWIP_MIN(strlen(password), 0xff); + pcb->upap.us_transmits = 0; + + /* Lower layer up yet? */ + if (pcb->upap.us_clientstate == UPAPCS_INITIAL || + pcb->upap.us_clientstate == UPAPCS_PENDING) { + pcb->upap.us_clientstate = UPAPCS_PENDING; + return; + } + + upap_sauthreq(pcb); /* Start protocol */ +} + +#if PPP_SERVER +/* + * upap_authpeer - Authenticate our peer (start server). + * + * Set new state. + */ +void upap_authpeer(ppp_pcb *pcb) { + + /* Lower layer up yet? */ + if (pcb->upap.us_serverstate == UPAPSS_INITIAL || + pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_PENDING; + return; + } + + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); +} +#endif /* PPP_SERVER */ + +/* + * upap_timeout - Retransmission timer for sending auth-reqs expired. + */ +static void upap_timeout(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) + return; + + if (pcb->upap.us_transmits >= pcb->settings.pap_max_transmits) { + /* give up in disgust */ + ppp_error("No response to PAP authenticate-requests"); + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + auth_withpeer_fail(pcb, PPP_PAP); + return; + } + + upap_sauthreq(pcb); /* Send Authenticate-Request */ +} + + +#if PPP_SERVER +/* + * upap_reqtimeout - Give up waiting for the peer to send an auth-req. + */ +static void upap_reqtimeout(void *arg) { + ppp_pcb *pcb = (ppp_pcb*)arg; + + if (pcb->upap.us_serverstate != UPAPSS_LISTEN) + return; /* huh?? */ + + auth_peer_fail(pcb, PPP_PAP); + pcb->upap.us_serverstate = UPAPSS_BADAUTH; +} +#endif /* PPP_SERVER */ + + +/* + * upap_lowerup - The lower layer is up. + * + * Start authenticating if pending. + */ +static void upap_lowerup(ppp_pcb *pcb) { + + if (pcb->upap.us_clientstate == UPAPCS_INITIAL) + pcb->upap.us_clientstate = UPAPCS_CLOSED; + else if (pcb->upap.us_clientstate == UPAPCS_PENDING) { + upap_sauthreq(pcb); /* send an auth-request */ + } + +#if PPP_SERVER + if (pcb->upap.us_serverstate == UPAPSS_INITIAL) + pcb->upap.us_serverstate = UPAPSS_CLOSED; + else if (pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + } +#endif /* PPP_SERVER */ +} + + +/* + * upap_lowerdown - The lower layer is down. + * + * Cancel all timeouts. + */ +static void upap_lowerdown(ppp_pcb *pcb) { + + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ + UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ +#if PPP_SERVER + if (pcb->upap.us_serverstate == UPAPSS_LISTEN && pcb->settings.pap_req_timeout > 0) + UNTIMEOUT(upap_reqtimeout, pcb); +#endif /* PPP_SERVER */ + + pcb->upap.us_clientstate = UPAPCS_INITIAL; +#if PPP_SERVER + pcb->upap.us_serverstate = UPAPSS_INITIAL; +#endif /* PPP_SERVER */ +} + + +/* + * upap_protrej - Peer doesn't speak this protocol. + * + * This shouldn't happen. In any case, pretend lower layer went down. + */ +static void upap_protrej(ppp_pcb *pcb) { + + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) { + ppp_error("PAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_PAP); + } +#if PPP_SERVER + if (pcb->upap.us_serverstate == UPAPSS_LISTEN) { + ppp_error("PAP authentication of peer failed (protocol-reject)"); + auth_peer_fail(pcb, PPP_PAP); + } +#endif /* PPP_SERVER */ + upap_lowerdown(pcb); +} + + +/* + * upap_input - Input UPAP packet. + */ +static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { + u_char *inp; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). + * If packet too short, drop it. + */ + inp = inpacket; + if (l < UPAP_HEADERLEN) { + UPAPDEBUG(("pap_input: rcvd short header.")); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < UPAP_HEADERLEN) { + UPAPDEBUG(("pap_input: rcvd illegal length.")); + return; + } + if (len > l) { + UPAPDEBUG(("pap_input: rcvd short packet.")); + return; + } + len -= UPAP_HEADERLEN; + + /* + * Action depends on code. + */ + switch (code) { + case UPAP_AUTHREQ: +#if PPP_SERVER + upap_rauthreq(pcb, inp, id, len); +#endif /* PPP_SERVER */ + break; + + case UPAP_AUTHACK: + upap_rauthack(pcb, inp, id, len); + break; + + case UPAP_AUTHNAK: + upap_rauthnak(pcb, inp, id, len); + break; + + default: /* XXX Need code reject */ + break; + } +} + +#if PPP_SERVER +/* + * upap_rauth - Receive Authenticate. + */ +static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { + u_char ruserlen, rpasswdlen; + char *ruser; + char *rpasswd; + char rhostname[256]; + int retcode; + const char *msg; + int msglen; + + if (pcb->upap.us_serverstate < UPAPSS_LISTEN) + return; + + /* + * If we receive a duplicate authenticate-request, we are + * supposed to return the same status as for the first request. + */ + if (pcb->upap.us_serverstate == UPAPSS_OPEN) { + upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ + return; + } + if (pcb->upap.us_serverstate == UPAPSS_BADAUTH) { + upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ + return; + } + + /* + * Parse user/passwd. + */ + if (len < 1) { + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; + } + GETCHAR(ruserlen, inp); + len -= sizeof (u_char) + ruserlen + sizeof (u_char); + if (len < 0) { + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; + } + ruser = (char *) inp; + INCPTR(ruserlen, inp); + GETCHAR(rpasswdlen, inp); + if (len < rpasswdlen) { + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; + } + + rpasswd = (char *) inp; + + /* + * Check the username and password given. + */ + retcode = UPAP_AUTHNAK; + if (auth_check_passwd(pcb, ruser, ruserlen, rpasswd, rpasswdlen, &msg, &msglen)) { + retcode = UPAP_AUTHACK; + } + BZERO(rpasswd, rpasswdlen); + +#if 0 /* UNUSED */ + /* + * Check remote number authorization. A plugin may have filled in + * the remote number or added an allowed number, and rather than + * return an authenticate failure, is leaving it for us to verify. + */ + if (retcode == UPAP_AUTHACK) { + if (!auth_number()) { + /* We do not want to leak info about the pap result. */ + retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ + warn("calling number %q is not authorized", remote_number); + } + } + + msglen = strlen(msg); + if (msglen > 255) + msglen = 255; +#endif /* UNUSED */ + + upap_sresp(pcb, retcode, id, msg, msglen); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rhostname, sizeof(rhostname), "%.*v", ruserlen, ruser); + + if (retcode == UPAP_AUTHACK) { + pcb->upap.us_serverstate = UPAPSS_OPEN; + ppp_notice("PAP peer authentication succeeded for %q", rhostname); + auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); + } else { + pcb->upap.us_serverstate = UPAPSS_BADAUTH; + ppp_warn("PAP peer authentication failed for %q", rhostname); + auth_peer_fail(pcb, PPP_PAP); + } + + if (pcb->settings.pap_req_timeout > 0) + UNTIMEOUT(upap_reqtimeout, pcb); +} +#endif /* PPP_SERVER */ + +/* + * upap_rauthack - Receive Authenticate-Ack. + */ +static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len) { + u_char msglen; + char *msg; + LWIP_UNUSED_ARG(id); + + if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ + return; + + /* + * Parse message. + */ + if (len < 1) { + UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); + } else { + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthack: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } + } + + pcb->upap.us_clientstate = UPAPCS_OPEN; + + auth_withpeer_success(pcb, PPP_PAP, 0); +} + + +/* + * upap_rauthnak - Receive Authenticate-Nak. + */ +static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len) { + u_char msglen; + char *msg; + LWIP_UNUSED_ARG(id); + + if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ + return; + + /* + * Parse message. + */ + if (len < 1) { + UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); + } else { + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } + } + + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + + ppp_error("PAP authentication failed"); + auth_withpeer_fail(pcb, PPP_PAP); +} + + +/* + * upap_sauthreq - Send an Authenticate-Request. + */ +static void upap_sauthreq(ppp_pcb *pcb) { + struct pbuf *p; + u_char *outp; + int outlen; + + outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + + pcb->upap.us_userlen + pcb->upap.us_passwdlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_PAP); + + PUTCHAR(UPAP_AUTHREQ, outp); + PUTCHAR(++pcb->upap.us_id, outp); + PUTSHORT(outlen, outp); + PUTCHAR(pcb->upap.us_userlen, outp); + MEMCPY(outp, pcb->upap.us_user, pcb->upap.us_userlen); + INCPTR(pcb->upap.us_userlen, outp); + PUTCHAR(pcb->upap.us_passwdlen, outp); + MEMCPY(outp, pcb->upap.us_passwd, pcb->upap.us_passwdlen); + + ppp_write(pcb, p); + + TIMEOUT(upap_timeout, pcb, pcb->settings.pap_timeout_time); + ++pcb->upap.us_transmits; + pcb->upap.us_clientstate = UPAPCS_AUTHREQ; +} + +#if PPP_SERVER +/* + * upap_sresp - Send a response (ack or nak). + */ +static void upap_sresp(ppp_pcb *pcb, u_char code, u_char id, const char *msg, int msglen) { + struct pbuf *p; + u_char *outp; + int outlen; + + outlen = UPAP_HEADERLEN + sizeof (u_char) + msglen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_PAP); + + PUTCHAR(code, outp); + PUTCHAR(id, outp); + PUTSHORT(outlen, outp); + PUTCHAR(msglen, outp); + MEMCPY(outp, msg, msglen); + + ppp_write(pcb, p); +} +#endif /* PPP_SERVER */ + +#if PRINTPKT_SUPPORT +/* + * upap_printpkt - print the contents of a PAP packet. + */ +static const char* const upap_codenames[] = { + "AuthReq", "AuthAck", "AuthNak" +}; + +static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int mlen, ulen, wlen; + const u_char *user, *pwd, *msg; + const u_char *pstart; + + if (plen < UPAP_HEADERLEN) + return 0; + pstart = p; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < UPAP_HEADERLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(upap_codenames)) + printer(arg, " %s", upap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= UPAP_HEADERLEN; + switch (code) { + case UPAP_AUTHREQ: + if (len < 1) + break; + ulen = p[0]; + if (len < ulen + 2) + break; + wlen = p[ulen + 1]; + if (len < ulen + wlen + 2) + break; + user = (const u_char *) (p + 1); + pwd = (const u_char *) (p + ulen + 2); + p += ulen + wlen + 2; + len -= ulen + wlen + 2; + printer(arg, " user="); + ppp_print_string(user, ulen, printer, arg); + printer(arg, " password="); +/* FIXME: require ppp_pcb struct as printpkt() argument */ +#if 0 + if (!pcb->settings.hide_password) +#endif + ppp_print_string(pwd, wlen, printer, arg); +#if 0 + else + printer(arg, ""); +#endif + break; + case UPAP_AUTHACK: + case UPAP_AUTHNAK: + if (len < 1) + break; + mlen = p[0]; + if (len < mlen + 1) + break; + msg = (const u_char *) (p + 1); + p += mlen + 1; + len -= mlen + 1; + printer(arg, " "); + ppp_print_string(msg, mlen, printer, arg); + break; + default: + break; + } + + /* print the rest of the bytes in the packet */ + for (; len > 0; --len) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + + return p - pstart; +} +#endif /* PRINTPKT_SUPPORT */ + +#endif /* PPP_SUPPORT && PAP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/utils.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/utils.c new file mode 100644 index 0000000..008c633 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/utils.c @@ -0,0 +1,959 @@ +/* + * utils.c - various utility functions used in pppd. + * + * Copyright (c) 1999-2002 Paul Mackerras. 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. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#if 0 /* UNUSED */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SVR4 +#include +#endif +#endif /* UNUSED */ + +#include /* isdigit() */ + +#include "netif/ppp/ppp_impl.h" + +#include "netif/ppp/fsm.h" +#include "netif/ppp/lcp.h" + +#if defined(SUNOS4) +extern char *strerror(); +#endif + +static void ppp_logit(int level, const char *fmt, va_list args); +static void ppp_log_write(int level, char *buf); +#if PRINTPKT_SUPPORT +static void ppp_vslp_printer(void *arg, const char *fmt, ...); +static void ppp_format_packet(const u_char *p, int len, + void (*printer) (void *, const char *, ...), void *arg); + +struct buffer_info { + char *ptr; + int len; +}; +#endif /* PRINTPKT_SUPPORT */ + +/* + * ppp_strlcpy - like strcpy/strncpy, doesn't overflow destination buffer, + * always leaves destination null-terminated (for len > 0). + */ +size_t ppp_strlcpy(char *dest, const char *src, size_t len) { + size_t ret = strlen(src); + + if (len != 0) { + if (ret < len) + strcpy(dest, src); + else { + strncpy(dest, src, len - 1); + dest[len-1] = 0; + } + } + return ret; +} + +/* + * ppp_strlcat - like strcat/strncat, doesn't overflow destination buffer, + * always leaves destination null-terminated (for len > 0). + */ +size_t ppp_strlcat(char *dest, const char *src, size_t len) { + size_t dlen = strlen(dest); + + return dlen + ppp_strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0)); +} + + +/* + * ppp_slprintf - format a message into a buffer. Like sprintf except we + * also specify the length of the output buffer, and we handle + * %m (error message), %v (visible string), + * %q (quoted string), %t (current time) and %I (IP address) formats. + * Doesn't do floating-point formats. + * Returns the number of chars put into buf. + */ +int ppp_slprintf(char *buf, int buflen, const char *fmt, ...) { + va_list args; + int n; + + va_start(args, fmt); + n = ppp_vslprintf(buf, buflen, fmt, args); + va_end(args); + return n; +} + +/* + * ppp_vslprintf - like ppp_slprintf, takes a va_list instead of a list of args. + */ +#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) + +int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { + int c, i, n; + int width, prec, fillch; + int base, len, neg, quoted; + unsigned long val = 0; + const char *f; + char *str, *buf0; + const unsigned char *p; + char num[32]; +#if 0 /* need port */ + time_t t; +#endif /* need port */ + u32_t ip; + static char hexchars[] = "0123456789abcdef"; +#if PRINTPKT_SUPPORT + struct buffer_info bufinfo; +#endif /* PRINTPKT_SUPPORT */ + + buf0 = buf; + --buflen; + while (buflen > 0) { + for (f = fmt; *f != '%' && *f != 0; ++f) + ; + if (f > fmt) { + len = f - fmt; + if (len > buflen) + len = buflen; + memcpy(buf, fmt, len); + buf += len; + buflen -= len; + fmt = f; + } + if (*fmt == 0) + break; + c = *++fmt; + width = 0; + prec = -1; + fillch = ' '; + if (c == '0') { + fillch = '0'; + c = *++fmt; + } + if (c == '*') { + width = va_arg(args, int); + c = *++fmt; + } else { + while (isdigit(c)) { + width = width * 10 + c - '0'; + c = *++fmt; + } + } + if (c == '.') { + c = *++fmt; + if (c == '*') { + prec = va_arg(args, int); + c = *++fmt; + } else { + prec = 0; + while (isdigit(c)) { + prec = prec * 10 + c - '0'; + c = *++fmt; + } + } + } + str = 0; + base = 0; + neg = 0; + ++fmt; + switch (c) { + case 'l': + c = *fmt++; + switch (c) { + case 'd': + val = va_arg(args, long); + if ((long)val < 0) { + neg = 1; + val = (unsigned long)-(long)val; + } + base = 10; + break; + case 'u': + val = va_arg(args, unsigned long); + base = 10; + break; + default: + OUTCHAR('%'); + OUTCHAR('l'); + --fmt; /* so %lz outputs %lz etc. */ + continue; + } + break; + case 'd': + i = va_arg(args, int); + if (i < 0) { + neg = 1; + val = -i; + } else + val = i; + base = 10; + break; + case 'u': + val = va_arg(args, unsigned int); + base = 10; + break; + case 'o': + val = va_arg(args, unsigned int); + base = 8; + break; + case 'x': + case 'X': + val = va_arg(args, unsigned int); + base = 16; + break; +#if 0 /* unused (and wrong on LLP64 systems) */ + case 'p': + val = (unsigned long) va_arg(args, void *); + base = 16; + neg = 2; + break; +#endif /* unused (and wrong on LLP64 systems) */ + case 's': + str = va_arg(args, char *); + break; + case 'c': + num[0] = va_arg(args, int); + num[1] = 0; + str = num; + break; +#if 0 /* do we always have strerror() in embedded ? */ + case 'm': + str = strerror(errno); + break; +#endif /* do we always have strerror() in embedded ? */ + case 'I': + ip = va_arg(args, u32_t); + ip = lwip_ntohl(ip); + ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, + (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); + str = num; + break; +#if 0 /* need port */ + case 't': + time(&t); + str = ctime(&t); + str += 4; /* chop off the day name */ + str[15] = 0; /* chop off year and newline */ + break; +#endif /* need port */ + case 'v': /* "visible" string */ + case 'q': /* quoted string */ + quoted = c == 'q'; + p = va_arg(args, unsigned char *); + if (p == NULL) + p = (const unsigned char *)""; + if (fillch == '0' && prec >= 0) { + n = prec; + } else { + n = strlen((const char *)p); + if (prec >= 0 && n > prec) + n = prec; + } + while (n > 0 && buflen > 0) { + c = *p++; + --n; + if (!quoted && c >= 0x80) { + OUTCHAR('M'); + OUTCHAR('-'); + c -= 0x80; + } + if (quoted && (c == '"' || c == '\\')) + OUTCHAR('\\'); + if (c < 0x20 || (0x7f <= c && c < 0xa0)) { + if (quoted) { + OUTCHAR('\\'); + switch (c) { + case '\t': OUTCHAR('t'); break; + case '\n': OUTCHAR('n'); break; + case '\b': OUTCHAR('b'); break; + case '\f': OUTCHAR('f'); break; + default: + OUTCHAR('x'); + OUTCHAR(hexchars[c >> 4]); + OUTCHAR(hexchars[c & 0xf]); + } + } else { + if (c == '\t') + OUTCHAR(c); + else { + OUTCHAR('^'); + OUTCHAR(c ^ 0x40); + } + } + } else + OUTCHAR(c); + } + continue; +#if PRINTPKT_SUPPORT + case 'P': /* print PPP packet */ + bufinfo.ptr = buf; + bufinfo.len = buflen + 1; + p = va_arg(args, unsigned char *); + n = va_arg(args, int); + ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); + buf = bufinfo.ptr; + buflen = bufinfo.len - 1; + continue; +#endif /* PRINTPKT_SUPPORT */ + case 'B': + p = va_arg(args, unsigned char *); + for (n = prec; n > 0; --n) { + c = *p++; + if (fillch == ' ') + OUTCHAR(' '); + OUTCHAR(hexchars[(c >> 4) & 0xf]); + OUTCHAR(hexchars[c & 0xf]); + } + continue; + default: + *buf++ = '%'; + if (c != '%') + --fmt; /* so %z outputs %z etc. */ + --buflen; + continue; + } + if (base != 0) { + str = num + sizeof(num); + *--str = 0; + while (str > num + neg) { + *--str = hexchars[val % base]; + val = val / base; + if (--prec <= 0 && val == 0) + break; + } + switch (neg) { + case 1: + *--str = '-'; + break; + case 2: + *--str = 'x'; + *--str = '0'; + break; + default: + break; + } + len = num + sizeof(num) - 1 - str; + } else { + len = strlen(str); + if (prec >= 0 && len > prec) + len = prec; + } + if (width > 0) { + if (width > buflen) + width = buflen; + if ((n = width - len) > 0) { + buflen -= n; + for (; n > 0; --n) + *buf++ = fillch; + } + } + if (len > buflen) + len = buflen; + memcpy(buf, str, len); + buf += len; + buflen -= len; + } + *buf = 0; + return buf - buf0; +} + +#if PRINTPKT_SUPPORT +/* + * vslp_printer - used in processing a %P format + */ +static void ppp_vslp_printer(void *arg, const char *fmt, ...) { + int n; + va_list pvar; + struct buffer_info *bi; + + va_start(pvar, fmt); + bi = (struct buffer_info *) arg; + n = ppp_vslprintf(bi->ptr, bi->len, fmt, pvar); + va_end(pvar); + + bi->ptr += n; + bi->len -= n; +} +#endif /* PRINTPKT_SUPPORT */ + +#if 0 /* UNUSED */ +/* + * log_packet - format a packet and log it. + */ + +void +log_packet(p, len, prefix, level) + u_char *p; + int len; + char *prefix; + int level; +{ + init_pr_log(prefix, level); + ppp_format_packet(p, len, pr_log, &level); + end_pr_log(); +} +#endif /* UNUSED */ + +#if PRINTPKT_SUPPORT +/* + * ppp_format_packet - make a readable representation of a packet, + * calling `printer(arg, format, ...)' to output it. + */ +static void ppp_format_packet(const u_char *p, int len, + void (*printer) (void *, const char *, ...), void *arg) { + int i, n; + u_short proto; + const struct protent *protp; + + if (len >= 2) { + GETSHORT(proto, p); + len -= 2; + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == protp->protocol) + break; + if (protp != NULL) { + printer(arg, "[%s", protp->name); + n = (*protp->printpkt)(p, len, printer, arg); + printer(arg, "]"); + p += n; + len -= n; + } else { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); + } + } + + if (len > 32) + printer(arg, "%.32B ...", p); + else + printer(arg, "%.*B", len, p); +} +#endif /* PRINTPKT_SUPPORT */ + +#if 0 /* UNUSED */ +/* + * init_pr_log, end_pr_log - initialize and finish use of pr_log. + */ + +static char line[256]; /* line to be logged accumulated here */ +static char *linep; /* current pointer within line */ +static int llevel; /* level for logging */ + +void +init_pr_log(prefix, level) + const char *prefix; + int level; +{ + linep = line; + if (prefix != NULL) { + ppp_strlcpy(line, prefix, sizeof(line)); + linep = line + strlen(line); + } + llevel = level; +} + +void +end_pr_log() +{ + if (linep != line) { + *linep = 0; + ppp_log_write(llevel, line); + } +} + +/* + * pr_log - printer routine for outputting to log + */ +void +pr_log (void *arg, const char *fmt, ...) +{ + int l, n; + va_list pvar; + char *p, *eol; + char buf[256]; + + va_start(pvar, fmt); + n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); + va_end(pvar); + + p = buf; + eol = strchr(buf, '\n'); + if (linep != line) { + l = (eol == NULL)? n: eol - buf; + if (linep + l < line + sizeof(line)) { + if (l > 0) { + memcpy(linep, buf, l); + linep += l; + } + if (eol == NULL) + return; + p = eol + 1; + eol = strchr(p, '\n'); + } + *linep = 0; + ppp_log_write(llevel, line); + linep = line; + } + + while (eol != NULL) { + *eol = 0; + ppp_log_write(llevel, p); + p = eol + 1; + eol = strchr(p, '\n'); + } + + /* assumes sizeof(buf) <= sizeof(line) */ + l = buf + n - p; + if (l > 0) { + memcpy(line, p, n); + linep = line + l; + } +} +#endif /* UNUSED */ + +/* + * ppp_print_string - print a readable representation of a string using + * printer. + */ +void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const char *, ...), void *arg) { + int c; + + printer(arg, "\""); + for (; len > 0; --len) { + c = *p++; + if (' ' <= c && c <= '~') { + if (c == '\\' || c == '"') + printer(arg, "\\"); + printer(arg, "%c", c); + } else { + switch (c) { + case '\n': + printer(arg, "\\n"); + break; + case '\r': + printer(arg, "\\r"); + break; + case '\t': + printer(arg, "\\t"); + break; + default: + printer(arg, "\\%.3o", (u8_t)c); + /* no break */ + } + } + } + printer(arg, "\""); +} + +/* + * ppp_logit - does the hard work for fatal et al. + */ +static void ppp_logit(int level, const char *fmt, va_list args) { + char buf[1024]; + + ppp_vslprintf(buf, sizeof(buf), fmt, args); + ppp_log_write(level, buf); +} + +static void ppp_log_write(int level, char *buf) { + LWIP_UNUSED_ARG(level); /* necessary if PPPDEBUG is defined to an empty function */ + LWIP_UNUSED_ARG(buf); + PPPDEBUG(level, ("%s\n", buf) ); +#if 0 + if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { + int n = strlen(buf); + + if (n > 0 && buf[n-1] == '\n') + --n; + if (write(log_to_fd, buf, n) != n + || write(log_to_fd, "\n", 1) != 1) + log_to_fd = -1; + } +#endif +} + +/* + * ppp_fatal - log an error message and die horribly. + */ +void ppp_fatal(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_ERR, fmt, pvar); + va_end(pvar); + + LWIP_ASSERT("ppp_fatal", 0); /* as promised */ +} + +/* + * ppp_error - log an error message. + */ +void ppp_error(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_ERR, fmt, pvar); + va_end(pvar); +#if 0 /* UNUSED */ + ++error_count; +#endif /* UNUSED */ +} + +/* + * ppp_warn - log a warning message. + */ +void ppp_warn(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_WARNING, fmt, pvar); + va_end(pvar); +} + +/* + * ppp_notice - log a notice-level message. + */ +void ppp_notice(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_NOTICE, fmt, pvar); + va_end(pvar); +} + +/* + * ppp_info - log an informational message. + */ +void ppp_info(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_INFO, fmt, pvar); + va_end(pvar); +} + +/* + * ppp_dbglog - log a debug message. + */ +void ppp_dbglog(const char *fmt, ...) { + va_list pvar; + + va_start(pvar, fmt); + ppp_logit(LOG_DEBUG, fmt, pvar); + va_end(pvar); +} + +#if PRINTPKT_SUPPORT +/* + * ppp_dump_packet - print out a packet in readable form if it is interesting. + * Assumes len >= PPP_HDRLEN. + */ +void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { + int proto; + + /* + * don't print data packets, i.e. IPv4, IPv6, VJ, and compressed packets. + */ + proto = (p[0] << 8) + p[1]; + if (proto < 0xC000 && (proto & ~0x8000) == proto) + return; + + /* + * don't print valid LCP echo request/reply packets if the link is up. + */ + if (proto == PPP_LCP && pcb->phase == PPP_PHASE_RUNNING && len >= 2 + HEADERLEN) { + unsigned char *lcp = p + 2; + int l = (lcp[2] << 8) + lcp[3]; + + if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) + && l >= HEADERLEN && l <= len - 2) + return; + } + + ppp_dbglog("%s %P", tag, p, len); +} +#endif /* PRINTPKT_SUPPORT */ + +#if 0 /* Unused */ + +/* + * complete_read - read a full `count' bytes from fd, + * unless end-of-file or an error other than EINTR is encountered. + */ +ssize_t +complete_read(int fd, void *buf, size_t count) +{ + size_t done; + ssize_t nb; + char *ptr = buf; + + for (done = 0; done < count; ) { + nb = read(fd, ptr, count - done); + if (nb < 0) { + if (errno == EINTR) + continue; + return -1; + } + if (nb == 0) + break; + done += nb; + ptr += nb; + } + return done; +} + +/* Procedures for locking the serial device using a lock file. */ +#ifndef LOCK_DIR +#ifdef __linux__ +#define LOCK_DIR "/var/lock" +#else +#ifdef SVR4 +#define LOCK_DIR "/var/spool/locks" +#else +#define LOCK_DIR "/var/spool/lock" +#endif +#endif +#endif /* LOCK_DIR */ + +static char lock_file[MAXPATHLEN]; + +/* + * lock - create a lock file for the named device + */ +int +lock(dev) + char *dev; +{ +#ifdef LOCKLIB + int result; + + result = mklock (dev, (void *) 0); + if (result == 0) { + ppp_strlcpy(lock_file, dev, sizeof(lock_file)); + return 0; + } + + if (result > 0) + ppp_notice("Device %s is locked by pid %d", dev, result); + else + ppp_error("Can't create lock file %s", lock_file); + return -1; + +#else /* LOCKLIB */ + + char lock_buffer[12]; + int fd, pid, n; + +#ifdef SVR4 + struct stat sbuf; + + if (stat(dev, &sbuf) < 0) { + ppp_error("Can't get device number for %s: %m", dev); + return -1; + } + if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { + ppp_error("Can't lock %s: not a character device", dev); + return -1; + } + ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", + LOCK_DIR, major(sbuf.st_dev), + major(sbuf.st_rdev), minor(sbuf.st_rdev)); +#else + char *p; + char lockdev[MAXPATHLEN]; + + if ((p = strstr(dev, "dev/")) != NULL) { + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; + } else + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; + + ppp_slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); +#endif + + while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { + if (errno != EEXIST) { + ppp_error("Can't create lock file %s: %m", lock_file); + break; + } + + /* Read the lock file to find out who has the device locked. */ + fd = open(lock_file, O_RDONLY, 0); + if (fd < 0) { + if (errno == ENOENT) /* This is just a timing problem. */ + continue; + ppp_error("Can't open existing lock file %s: %m", lock_file); + break; + } +#ifndef LOCK_BINARY + n = read(fd, lock_buffer, 11); +#else + n = read(fd, &pid, sizeof(pid)); +#endif /* LOCK_BINARY */ + close(fd); + fd = -1; + if (n <= 0) { + ppp_error("Can't read pid from lock file %s", lock_file); + break; + } + + /* See if the process still exists. */ +#ifndef LOCK_BINARY + lock_buffer[n] = 0; + pid = atoi(lock_buffer); +#endif /* LOCK_BINARY */ + if (pid == getpid()) + return 1; /* somebody else locked it for us */ + if (pid == 0 + || (kill(pid, 0) == -1 && errno == ESRCH)) { + if (unlink (lock_file) == 0) { + ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); + continue; + } + ppp_warn("Couldn't remove stale lock on %s", dev); + } else + ppp_notice("Device %s is locked by pid %d", dev, pid); + break; + } + + if (fd < 0) { + lock_file[0] = 0; + return -1; + } + + pid = getpid(); +#ifndef LOCK_BINARY + ppp_slprintf(lock_buffer, sizeof(lock_buffer), "%10d\n", pid); + write (fd, lock_buffer, 11); +#else + write(fd, &pid, sizeof (pid)); +#endif + close(fd); + return 0; + +#endif +} + +/* + * relock - called to update our lockfile when we are about to detach, + * thus changing our pid (we fork, the child carries on, and the parent dies). + * Note that this is called by the parent, with pid equal to the pid + * of the child. This avoids a potential race which would exist if + * we had the child rewrite the lockfile (the parent might die first, + * and another process could think the lock was stale if it checked + * between when the parent died and the child rewrote the lockfile). + */ +int +relock(pid) + int pid; +{ +#ifdef LOCKLIB + /* XXX is there a way to do this? */ + return -1; +#else /* LOCKLIB */ + + int fd; + char lock_buffer[12]; + + if (lock_file[0] == 0) + return -1; + fd = open(lock_file, O_WRONLY, 0); + if (fd < 0) { + ppp_error("Couldn't reopen lock file %s: %m", lock_file); + lock_file[0] = 0; + return -1; + } + +#ifndef LOCK_BINARY + ppp_slprintf(lock_buffer, sizeof(lock_buffer), "%10d\n", pid); + write (fd, lock_buffer, 11); +#else + write(fd, &pid, sizeof(pid)); +#endif /* LOCK_BINARY */ + close(fd); + return 0; + +#endif /* LOCKLIB */ +} + +/* + * unlock - remove our lockfile + */ +void +unlock() +{ + if (lock_file[0]) { +#ifdef LOCKLIB + (void) rmlock(lock_file, (void *) 0); +#else + unlink(lock_file); +#endif + lock_file[0] = 0; + } +} + +#endif /* Unused */ + +#endif /* PPP_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/vj.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/vj.c new file mode 100644 index 0000000..168c340 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/ppp/vj.c @@ -0,0 +1,695 @@ +/* + * Routines to compress and uncompess tcp packets (for transmission + * over low speed serial lines. + * + * Copyright (c) 1989 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: + * Initial distribution. + * + * Modified June 1993 by Paul Mackerras, paulus@cs.anu.edu.au, + * so that the entire packet being decompressed doesn't have + * to be in contiguous memory (just the compressed header). + * + * Modified March 1998 by Guy Lancaster, glanca@gesn.com, + * for a 16 bit processor. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#include "netif/ppp/ppp_impl.h" +#include "netif/ppp/pppdebug.h" + +#include "netif/ppp/vj.h" + +#include + +#if LINK_STATS +#define INCR(counter) ++comp->stats.counter +#else +#define INCR(counter) +#endif + +void +vj_compress_init(struct vjcompress *comp) +{ + u8_t i; + struct cstate *tstate = comp->tstate; + +#if MAX_SLOTS == 0 + memset((char *)comp, 0, sizeof(*comp)); +#endif + comp->maxSlotIndex = MAX_SLOTS - 1; + comp->compressSlot = 0; /* Disable slot ID compression by default. */ + for (i = MAX_SLOTS - 1; i > 0; --i) { + tstate[i].cs_id = i; + tstate[i].cs_next = &tstate[i - 1]; + } + tstate[0].cs_next = &tstate[MAX_SLOTS - 1]; + tstate[0].cs_id = 0; + comp->last_cs = &tstate[0]; + comp->last_recv = 255; + comp->last_xmit = 255; + comp->flags = VJF_TOSS; +} + + +/* ENCODE encodes a number that is known to be non-zero. ENCODEZ + * checks for zero (since zero has to be encoded in the long, 3 byte + * form). + */ +#define ENCODE(n) { \ + if ((u16_t)(n) >= 256) { \ + *cp++ = 0; \ + cp[1] = (u8_t)(n); \ + cp[0] = (u8_t)((n) >> 8); \ + cp += 2; \ + } else { \ + *cp++ = (u8_t)(n); \ + } \ +} +#define ENCODEZ(n) { \ + if ((u16_t)(n) >= 256 || (u16_t)(n) == 0) { \ + *cp++ = 0; \ + cp[1] = (u8_t)(n); \ + cp[0] = (u8_t)((n) >> 8); \ + cp += 2; \ + } else { \ + *cp++ = (u8_t)(n); \ + } \ +} + +#define DECODEL(f) { \ + if (*cp == 0) {\ + u32_t tmp_ = lwip_ntohl(f) + ((cp[1] << 8) | cp[2]); \ + (f) = lwip_htonl(tmp_); \ + cp += 3; \ + } else { \ + u32_t tmp_ = lwip_ntohl(f) + (u32_t)*cp++; \ + (f) = lwip_htonl(tmp_); \ + } \ +} + +#define DECODES(f) { \ + if (*cp == 0) {\ + u16_t tmp_ = lwip_ntohs(f) + (((u16_t)cp[1] << 8) | cp[2]); \ + (f) = lwip_htons(tmp_); \ + cp += 3; \ + } else { \ + u16_t tmp_ = lwip_ntohs(f) + (u16_t)*cp++; \ + (f) = lwip_htons(tmp_); \ + } \ +} + +#define DECODEU(f) { \ + if (*cp == 0) {\ + (f) = lwip_htons(((u16_t)cp[1] << 8) | cp[2]); \ + cp += 3; \ + } else { \ + (f) = lwip_htons((u16_t)*cp++); \ + } \ +} + +/* Helper structures for unaligned *u32_t and *u16_t accesses */ +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct vj_u32_t { + PACK_STRUCT_FIELD(u32_t v); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/bpstruct.h" +#endif +PACK_STRUCT_BEGIN +struct vj_u16_t { + PACK_STRUCT_FIELD(u16_t v); +} PACK_STRUCT_STRUCT; +PACK_STRUCT_END +#ifdef PACK_STRUCT_USE_INCLUDES +# include "arch/epstruct.h" +#endif + +/* + * vj_compress_tcp - Attempt to do Van Jacobson header compression on a + * packet. This assumes that nb and comp are not null and that the first + * buffer of the chain contains a valid IP header. + * Return the VJ type code indicating whether or not the packet was + * compressed. + */ +u8_t +vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb) +{ + struct pbuf *np = *pb; + struct ip_hdr *ip = (struct ip_hdr *)np->payload; + struct cstate *cs = comp->last_cs->cs_next; + u16_t ilen = IPH_HL(ip); + u16_t hlen; + struct tcp_hdr *oth; + struct tcp_hdr *th; + u16_t deltaS, deltaA = 0; + u32_t deltaL; + u32_t changes = 0; + u8_t new_seq[16]; + u8_t *cp = new_seq; + + /* + * Check that the packet is IP proto TCP. + */ + if (IPH_PROTO(ip) != IP_PROTO_TCP) { + return (TYPE_IP); + } + + /* + * Bail if this is an IP fragment or if the TCP packet isn't + * `compressible' (i.e., ACK isn't set or some other control bit is + * set). + */ + if ((IPH_OFFSET(ip) & PP_HTONS(0x3fff)) || np->tot_len < 40) { + return (TYPE_IP); + } + th = (struct tcp_hdr *)&((struct vj_u32_t*)ip)[ilen]; + if ((TCPH_FLAGS(th) & (TCP_SYN|TCP_FIN|TCP_RST|TCP_ACK)) != TCP_ACK) { + return (TYPE_IP); + } + + /* Check that the TCP/IP headers are contained in the first buffer. */ + hlen = ilen + TCPH_HDRLEN(th); + hlen <<= 2; + if (np->len < hlen) { + PPPDEBUG(LOG_INFO, ("vj_compress_tcp: header len %d spans buffers\n", hlen)); + return (TYPE_IP); + } + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before compression. */ + np = pbuf_alloc(PBUF_RAW, np->tot_len, PBUF_POOL); + if (!np) { + return (TYPE_IP); + } + + if (pbuf_copy(np, *pb) != ERR_OK) { + pbuf_free(np); + return (TYPE_IP); + } + + *pb = np; + ip = (struct ip_hdr *)np->payload; + + /* + * Packet is compressible -- we're going to send either a + * COMPRESSED_TCP or UNCOMPRESSED_TCP packet. Either way we need + * to locate (or create) the connection state. Special case the + * most recently used connection since it's most likely to be used + * again & we don't have to do any reordering if it's used. + */ + INCR(vjs_packets); + if (!ip4_addr_cmp(&ip->src, &cs->cs_ip.src) + || !ip4_addr_cmp(&ip->dest, &cs->cs_ip.dest) + || (*(struct vj_u32_t*)th).v != (((struct vj_u32_t*)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]).v) { + /* + * Wasn't the first -- search for it. + * + * States are kept in a circularly linked list with + * last_cs pointing to the end of the list. The + * list is kept in lru order by moving a state to the + * head of the list whenever it is referenced. Since + * the list is short and, empirically, the connection + * we want is almost always near the front, we locate + * states via linear search. If we don't find a state + * for the datagram, the oldest state is (re-)used. + */ + struct cstate *lcs; + struct cstate *lastcs = comp->last_cs; + + do { + lcs = cs; cs = cs->cs_next; + INCR(vjs_searches); + if (ip4_addr_cmp(&ip->src, &cs->cs_ip.src) + && ip4_addr_cmp(&ip->dest, &cs->cs_ip.dest) + && (*(struct vj_u32_t*)th).v == (((struct vj_u32_t*)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]).v) { + goto found; + } + } while (cs != lastcs); + + /* + * Didn't find it -- re-use oldest cstate. Send an + * uncompressed packet that tells the other side what + * connection number we're using for this conversation. + * Note that since the state list is circular, the oldest + * state points to the newest and we only need to set + * last_cs to update the lru linkage. + */ + INCR(vjs_misses); + comp->last_cs = lcs; + goto uncompressed; + + found: + /* + * Found it -- move to the front on the connection list. + */ + if (cs == lastcs) { + comp->last_cs = lcs; + } else { + lcs->cs_next = cs->cs_next; + cs->cs_next = lastcs->cs_next; + lastcs->cs_next = cs; + } + } + + oth = (struct tcp_hdr *)&((struct vj_u32_t*)&cs->cs_ip)[ilen]; + deltaS = ilen; + + /* + * Make sure that only what we expect to change changed. The first + * line of the `if' checks the IP protocol version, header length & + * type of service. The 2nd line checks the "Don't fragment" bit. + * The 3rd line checks the time-to-live and protocol (the protocol + * check is unnecessary but costless). The 4th line checks the TCP + * header length. The 5th line checks IP options, if any. The 6th + * line checks TCP options, if any. If any of these things are + * different between the previous & current datagram, we send the + * current datagram `uncompressed'. + */ + if ((((struct vj_u16_t*)ip)[0]).v != (((struct vj_u16_t*)&cs->cs_ip)[0]).v + || (((struct vj_u16_t*)ip)[3]).v != (((struct vj_u16_t*)&cs->cs_ip)[3]).v + || (((struct vj_u16_t*)ip)[4]).v != (((struct vj_u16_t*)&cs->cs_ip)[4]).v + || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) + || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) + || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) { + goto uncompressed; + } + + /* + * Figure out which of the changing fields changed. The + * receiver expects changes in the order: urgent, window, + * ack, seq (the order minimizes the number of temporaries + * needed in this section of code). + */ + if (TCPH_FLAGS(th) & TCP_URG) { + deltaS = lwip_ntohs(th->urgp); + ENCODEZ(deltaS); + changes |= NEW_U; + } else if (th->urgp != oth->urgp) { + /* argh! URG not set but urp changed -- a sensible + * implementation should never do this but RFC793 + * doesn't prohibit the change so we have to deal + * with it. */ + goto uncompressed; + } + + if ((deltaS = (u16_t)(lwip_ntohs(th->wnd) - lwip_ntohs(oth->wnd))) != 0) { + ENCODE(deltaS); + changes |= NEW_W; + } + + if ((deltaL = lwip_ntohl(th->ackno) - lwip_ntohl(oth->ackno)) != 0) { + if (deltaL > 0xffff) { + goto uncompressed; + } + deltaA = (u16_t)deltaL; + ENCODE(deltaA); + changes |= NEW_A; + } + + if ((deltaL = lwip_ntohl(th->seqno) - lwip_ntohl(oth->seqno)) != 0) { + if (deltaL > 0xffff) { + goto uncompressed; + } + deltaS = (u16_t)deltaL; + ENCODE(deltaS); + changes |= NEW_S; + } + + switch(changes) { + case 0: + /* + * Nothing changed. If this packet contains data and the + * last one didn't, this is probably a data packet following + * an ack (normal on an interactive connection) and we send + * it compressed. Otherwise it's probably a retransmit, + * retransmitted ack or window probe. Send it uncompressed + * in case the other side missed the compressed version. + */ + if (IPH_LEN(ip) != IPH_LEN(&cs->cs_ip) && + lwip_ntohs(IPH_LEN(&cs->cs_ip)) == hlen) { + break; + } + /* no break */ + /* fall through */ + + case SPECIAL_I: + case SPECIAL_D: + /* + * actual changes match one of our special case encodings -- + * send packet uncompressed. + */ + goto uncompressed; + + case NEW_S|NEW_A: + if (deltaS == deltaA && deltaS == lwip_ntohs(IPH_LEN(&cs->cs_ip)) - hlen) { + /* special case for echoed terminal traffic */ + changes = SPECIAL_I; + cp = new_seq; + } + break; + + case NEW_S: + if (deltaS == lwip_ntohs(IPH_LEN(&cs->cs_ip)) - hlen) { + /* special case for data xfer */ + changes = SPECIAL_D; + cp = new_seq; + } + break; + default: + break; + } + + deltaS = (u16_t)(lwip_ntohs(IPH_ID(ip)) - lwip_ntohs(IPH_ID(&cs->cs_ip))); + if (deltaS != 1) { + ENCODEZ(deltaS); + changes |= NEW_I; + } + if (TCPH_FLAGS(th) & TCP_PSH) { + changes |= TCP_PUSH_BIT; + } + /* + * Grab the cksum before we overwrite it below. Then update our + * state with this packet's header. + */ + deltaA = lwip_ntohs(th->chksum); + MEMCPY(&cs->cs_ip, ip, hlen); + + /* + * We want to use the original packet as our compressed packet. + * (cp - new_seq) is the number of bytes we need for compressed + * sequence numbers. In addition we need one byte for the change + * mask, one for the connection id and two for the tcp checksum. + * So, (cp - new_seq) + 4 bytes of header are needed. hlen is how + * many bytes of the original packet to toss so subtract the two to + * get the new packet size. + */ + deltaS = (u16_t)(cp - new_seq); + if (!comp->compressSlot || comp->last_xmit != cs->cs_id) { + comp->last_xmit = cs->cs_id; + hlen -= deltaS + 4; + if (pbuf_header(np, -(s16_t)hlen)){ + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_header failed\n", 0); + } + cp = (u8_t*)np->payload; + *cp++ = (u8_t)(changes | NEW_C); + *cp++ = cs->cs_id; + } else { + hlen -= deltaS + 3; + if (pbuf_header(np, -(s16_t)hlen)) { + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_header failed\n", 0); + } + cp = (u8_t*)np->payload; + *cp++ = (u8_t)changes; + } + *cp++ = (u8_t)(deltaA >> 8); + *cp++ = (u8_t)deltaA; + MEMCPY(cp, new_seq, deltaS); + INCR(vjs_compressed); + return (TYPE_COMPRESSED_TCP); + + /* + * Update connection state cs & send uncompressed packet (that is, + * a regular ip/tcp packet but with the 'conversation id' we hope + * to use on future compressed packets in the protocol field). + */ +uncompressed: + MEMCPY(&cs->cs_ip, ip, hlen); + IPH_PROTO_SET(ip, cs->cs_id); + comp->last_xmit = cs->cs_id; + return (TYPE_UNCOMPRESSED_TCP); +} + +/* + * Called when we may have missed a packet. + */ +void +vj_uncompress_err(struct vjcompress *comp) +{ + comp->flags |= VJF_TOSS; + INCR(vjs_errorin); +} + +/* + * "Uncompress" a packet of type TYPE_UNCOMPRESSED_TCP. + * Return 0 on success, -1 on failure. + */ +int +vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) +{ + u32_t hlen; + struct cstate *cs; + struct ip_hdr *ip; + + ip = (struct ip_hdr *)nb->payload; + hlen = IPH_HL(ip) << 2; + if (IPH_PROTO(ip) >= MAX_SLOTS + || hlen + sizeof(struct tcp_hdr) > nb->len + || (hlen += TCPH_HDRLEN(((struct tcp_hdr *)&((char *)ip)[hlen])) << 2) + > nb->len + || hlen > MAX_HDR) { + PPPDEBUG(LOG_INFO, ("vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", + IPH_PROTO(ip), hlen, nb->len)); + comp->flags |= VJF_TOSS; + INCR(vjs_errorin); + return -1; + } + cs = &comp->rstate[comp->last_recv = IPH_PROTO(ip)]; + comp->flags &=~ VJF_TOSS; + IPH_PROTO_SET(ip, IP_PROTO_TCP); + MEMCPY(&cs->cs_ip, ip, hlen); + cs->cs_hlen = (u16_t)hlen; + INCR(vjs_uncompressedin); + return 0; +} + +/* + * Uncompress a packet of type TYPE_COMPRESSED_TCP. + * The packet is composed of a buffer chain and the first buffer + * must contain an accurate chain length. + * The first buffer must include the entire compressed TCP/IP header. + * This procedure replaces the compressed header with the uncompressed + * header and returns the length of the VJ header. + */ +int +vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) +{ + u8_t *cp; + struct tcp_hdr *th; + struct cstate *cs; + struct vj_u16_t *bp; + struct pbuf *n0 = *nb; + u32_t tmp; + u32_t vjlen, hlen, changes; + + INCR(vjs_compressedin); + cp = (u8_t*)n0->payload; + changes = *cp++; + if (changes & NEW_C) { + /* + * Make sure the state index is in range, then grab the state. + * If we have a good state index, clear the 'discard' flag. + */ + if (*cp >= MAX_SLOTS) { + PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: bad cid=%d\n", *cp)); + goto bad; + } + + comp->flags &=~ VJF_TOSS; + comp->last_recv = *cp++; + } else { + /* + * this packet has an implicit state index. If we've + * had a line error since the last time we got an + * explicit state index, we have to toss the packet. + */ + if (comp->flags & VJF_TOSS) { + PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: tossing\n")); + INCR(vjs_tossed); + return (-1); + } + } + cs = &comp->rstate[comp->last_recv]; + hlen = IPH_HL(&cs->cs_ip) << 2; + th = (struct tcp_hdr *)&((u8_t*)&cs->cs_ip)[hlen]; + th->chksum = lwip_htons((*cp << 8) | cp[1]); + cp += 2; + if (changes & TCP_PUSH_BIT) { + TCPH_SET_FLAG(th, TCP_PSH); + } else { + TCPH_UNSET_FLAG(th, TCP_PSH); + } + + switch (changes & SPECIALS_MASK) { + case SPECIAL_I: + { + u32_t i = lwip_ntohs(IPH_LEN(&cs->cs_ip)) - cs->cs_hlen; + /* some compilers can't nest inline assembler.. */ + tmp = lwip_ntohl(th->ackno) + i; + th->ackno = lwip_htonl(tmp); + tmp = lwip_ntohl(th->seqno) + i; + th->seqno = lwip_htonl(tmp); + } + break; + + case SPECIAL_D: + /* some compilers can't nest inline assembler.. */ + tmp = lwip_ntohl(th->seqno) + lwip_ntohs(IPH_LEN(&cs->cs_ip)) - cs->cs_hlen; + th->seqno = lwip_htonl(tmp); + break; + + default: + if (changes & NEW_U) { + TCPH_SET_FLAG(th, TCP_URG); + DECODEU(th->urgp); + } else { + TCPH_UNSET_FLAG(th, TCP_URG); + } + if (changes & NEW_W) { + DECODES(th->wnd); + } + if (changes & NEW_A) { + DECODEL(th->ackno); + } + if (changes & NEW_S) { + DECODEL(th->seqno); + } + break; + } + if (changes & NEW_I) { + DECODES(cs->cs_ip._id); + } else { + IPH_ID_SET(&cs->cs_ip, lwip_ntohs(IPH_ID(&cs->cs_ip)) + 1); + IPH_ID_SET(&cs->cs_ip, lwip_htons(IPH_ID(&cs->cs_ip))); + } + + /* + * At this point, cp points to the first byte of data in the + * packet. Fill in the IP total length and update the IP + * header checksum. + */ + vjlen = (u16_t)(cp - (u8_t*)n0->payload); + if (n0->len < vjlen) { + /* + * We must have dropped some characters (crc should detect + * this but the old slip framing won't) + */ + PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: head buffer %d too short %d\n", + n0->len, vjlen)); + goto bad; + } + +#if BYTE_ORDER == LITTLE_ENDIAN + tmp = n0->tot_len - vjlen + cs->cs_hlen; + IPH_LEN_SET(&cs->cs_ip, lwip_htons((u16_t)tmp)); +#else + IPH_LEN_SET(&cs->cs_ip, lwip_htons(n0->tot_len - vjlen + cs->cs_hlen)); +#endif + + /* recompute the ip header checksum */ + bp = (struct vj_u16_t*) &cs->cs_ip; + IPH_CHKSUM_SET(&cs->cs_ip, 0); + for (tmp = 0; hlen > 0; hlen -= 2) { + tmp += (*bp++).v; + } + tmp = (tmp & 0xffff) + (tmp >> 16); + tmp = (tmp & 0xffff) + (tmp >> 16); + IPH_CHKSUM_SET(&cs->cs_ip, (u16_t)(~tmp)); + + /* Remove the compressed header and prepend the uncompressed header. */ + if (pbuf_header(n0, -(s16_t)vjlen)) { + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_header failed\n", 0); + goto bad; + } + + if(LWIP_MEM_ALIGN(n0->payload) != n0->payload) { + struct pbuf *np, *q; + u8_t *bufptr; + +#if IP_FORWARD + /* If IP forwarding is enabled we are using a PBUF_LINK packet type so + * the packet is being allocated with enough header space to be + * forwarded (to Ethernet for example). + */ + np = pbuf_alloc(PBUF_LINK, n0->len + cs->cs_hlen, PBUF_POOL); +#else /* IP_FORWARD */ + np = pbuf_alloc(PBUF_RAW, n0->len + cs->cs_hlen, PBUF_POOL); +#endif /* IP_FORWARD */ + if(!np) { + PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: realign failed\n")); + goto bad; + } + + if (pbuf_header(np, -(s16_t)cs->cs_hlen)) { + /* Can we cope with this failing? Just assert for now */ + LWIP_ASSERT("pbuf_header failed\n", 0); + goto bad; + } + + bufptr = (u8_t*)n0->payload; + for(q = np; q != NULL; q = q->next) { + MEMCPY(q->payload, bufptr, q->len); + bufptr += q->len; + } + + if(n0->next) { + pbuf_chain(np, n0->next); + pbuf_dechain(n0); + } + pbuf_free(n0); + n0 = np; + } + + if (pbuf_header(n0, (s16_t)cs->cs_hlen)) { + struct pbuf *np; + + LWIP_ASSERT("vj_uncompress_tcp: cs->cs_hlen <= PBUF_POOL_BUFSIZE", cs->cs_hlen <= PBUF_POOL_BUFSIZE); + np = pbuf_alloc(PBUF_RAW, cs->cs_hlen, PBUF_POOL); + if(!np) { + PPPDEBUG(LOG_WARNING, ("vj_uncompress_tcp: prepend failed\n")); + goto bad; + } + pbuf_cat(np, n0); + n0 = np; + } + LWIP_ASSERT("n0->len >= cs->cs_hlen", n0->len >= cs->cs_hlen); + MEMCPY(n0->payload, &cs->cs_ip, cs->cs_hlen); + + *nb = n0; + + return vjlen; + +bad: + comp->flags |= VJF_TOSS; + INCR(vjs_errorin); + return (-1); +} + +#endif /* PPP_SUPPORT && VJ_SUPPORT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/slipif.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/slipif.c new file mode 100644 index 0000000..6eb83c3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/src/netif/slipif.c @@ -0,0 +1,555 @@ +/** + * @file + * SLIP Interface + * + */ + +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * 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 Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is built upon the file: src/arch/rtxc/netif/sioslip.c + * + * Author: Magnus Ivarsson + * Simon Goldschmidt + */ + + +/** + * @defgroup slipif SLIP netif + * @ingroup addons + * + * This is an arch independent SLIP netif. The specific serial hooks must be + * provided by another file. They are sio_open, sio_read/sio_tryread and sio_send + * + * Usage: This netif can be used in three ways:\n + * 1) For NO_SYS==0, an RX thread can be used which blocks on sio_read() + * until data is received.\n + * 2) In your main loop, call slipif_poll() to check for new RX bytes, + * completed packets are fed into netif->input().\n + * 3) Call slipif_received_byte[s]() from your serial RX ISR and + * slipif_process_rxqueue() from your main loop. ISR level decodes + * packets and puts completed packets on a queue which is fed into + * the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for + * pbuf_alloc to work on ISR level!). + * + */ + +#include "netif/slipif.h" +#include "lwip/opt.h" + +#include "lwip/def.h" +#include "lwip/pbuf.h" +#include "lwip/stats.h" +#include "lwip/snmp.h" +#include "lwip/sys.h" +#include "lwip/sio.h" + +#define SLIP_END 0xC0 /* 0300: start and end of every packet */ +#define SLIP_ESC 0xDB /* 0333: escape start (one byte escaped data follows) */ +#define SLIP_ESC_END 0xDC /* 0334: following escape: original byte is 0xC0 (END) */ +#define SLIP_ESC_ESC 0xDD /* 0335: following escape: original byte is 0xDB (ESC) */ + +/** Maximum packet size that is received by this netif */ +#ifndef SLIP_MAX_SIZE +#define SLIP_MAX_SIZE 1500 +#endif + +/** Define this to the interface speed for SNMP + * (sio_fd is the sio_fd_t returned by sio_open). + * The default value of zero means 'unknown'. + */ +#ifndef SLIP_SIO_SPEED +#define SLIP_SIO_SPEED(sio_fd) 0 +#endif + +enum slipif_recv_state { + SLIP_RECV_NORMAL, + SLIP_RECV_ESCAPE +}; + +struct slipif_priv { + sio_fd_t sd; + /* q is the whole pbuf chain for a packet, p is the current pbuf in the chain */ + struct pbuf *p, *q; + u8_t state; + u16_t i, recved; +#if SLIP_RX_FROM_ISR + struct pbuf *rxpackets; +#endif +}; + +/** + * Send a pbuf doing the necessary SLIP encapsulation + * + * Uses the serial layer's sio_send() + * + * @param netif the lwip network interface structure for this slipif + * @param p the pbuf chain packet to send + * @return always returns ERR_OK since the serial layer does not provide return values + */ +static err_t +slipif_output(struct netif *netif, struct pbuf *p) +{ + struct slipif_priv *priv; + struct pbuf *q; + u16_t i; + u8_t c; + + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + LWIP_ASSERT("p != NULL", (p != NULL)); + + LWIP_DEBUGF(SLIP_DEBUG, ("slipif_output(%"U16_F"): sending %"U16_F" bytes\n", (u16_t)netif->num, p->tot_len)); + priv = (struct slipif_priv *)netif->state; + + /* Send pbuf out on the serial I/O device. */ + /* Start with packet delimiter. */ + sio_send(SLIP_END, priv->sd); + + for (q = p; q != NULL; q = q->next) { + for (i = 0; i < q->len; i++) { + c = ((u8_t *)q->payload)[i]; + switch (c) { + case SLIP_END: + /* need to escape this byte (0xC0 -> 0xDB, 0xDC) */ + sio_send(SLIP_ESC, priv->sd); + sio_send(SLIP_ESC_END, priv->sd); + break; + case SLIP_ESC: + /* need to escape this byte (0xDB -> 0xDB, 0xDD) */ + sio_send(SLIP_ESC, priv->sd); + sio_send(SLIP_ESC_ESC, priv->sd); + break; + default: + /* normal byte - no need for escaping */ + sio_send(c, priv->sd); + break; + } + } + } + /* End with packet delimiter. */ + sio_send(SLIP_END, priv->sd); + return ERR_OK; +} + +#if LWIP_IPV4 +/** + * Send a pbuf doing the necessary SLIP encapsulation + * + * Uses the serial layer's sio_send() + * + * @param netif the lwip network interface structure for this slipif + * @param p the pbuf chain packet to send + * @param ipaddr the ip address to send the packet to (not used for slipif) + * @return always returns ERR_OK since the serial layer does not provide return values + */ +static err_t +slipif_output_v4(struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr) +{ + LWIP_UNUSED_ARG(ipaddr); + return slipif_output(netif, p); +} +#endif /* LWIP_IPV4 */ + +#if LWIP_IPV6 +/** + * Send a pbuf doing the necessary SLIP encapsulation + * + * Uses the serial layer's sio_send() + * + * @param netif the lwip network interface structure for this slipif + * @param p the pbuf chain packet to send + * @param ipaddr the ip address to send the packet to (not used for slipif) + * @return always returns ERR_OK since the serial layer does not provide return values + */ +static err_t +slipif_output_v6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr) +{ + LWIP_UNUSED_ARG(ipaddr); + return slipif_output(netif, p); +} +#endif /* LWIP_IPV6 */ + +/** + * Handle the incoming SLIP stream character by character + * + * @param netif the lwip network interface structure for this slipif + * @param c received character (multiple calls to this function will + * return a complete packet, NULL is returned before - used for polling) + * @return The IP packet when SLIP_END is received + */ +static struct pbuf* +slipif_rxbyte(struct netif *netif, u8_t c) +{ + struct slipif_priv *priv; + struct pbuf *t; + + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + + priv = (struct slipif_priv *)netif->state; + + switch (priv->state) { + case SLIP_RECV_NORMAL: + switch (c) { + case SLIP_END: + if (priv->recved > 0) { + /* Received whole packet. */ + /* Trim the pbuf to the size of the received packet. */ + pbuf_realloc(priv->q, priv->recved); + + LINK_STATS_INC(link.recv); + + LWIP_DEBUGF(SLIP_DEBUG, ("slipif: Got packet (%"U16_F" bytes)\n", priv->recved)); + t = priv->q; + priv->p = priv->q = NULL; + priv->i = priv->recved = 0; + return t; + } + return NULL; + case SLIP_ESC: + priv->state = SLIP_RECV_ESCAPE; + return NULL; + default: + break; + } /* end switch (c) */ + break; + case SLIP_RECV_ESCAPE: + /* un-escape END or ESC bytes, leave other bytes + (although that would be a protocol error) */ + switch (c) { + case SLIP_ESC_END: + c = SLIP_END; + break; + case SLIP_ESC_ESC: + c = SLIP_ESC; + break; + default: + break; + } + priv->state = SLIP_RECV_NORMAL; + break; + default: + break; + } /* end switch (priv->state) */ + + /* byte received, packet not yet completely received */ + if (priv->p == NULL) { + /* allocate a new pbuf */ + LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: alloc\n")); + priv->p = pbuf_alloc(PBUF_LINK, (PBUF_POOL_BUFSIZE - PBUF_LINK_HLEN - PBUF_LINK_ENCAPSULATION_HLEN), PBUF_POOL); + + if (priv->p == NULL) { + LINK_STATS_INC(link.drop); + LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: no new pbuf! (DROP)\n")); + /* don't process any further since we got no pbuf to receive to */ + return NULL; + } + + if (priv->q != NULL) { + /* 'chain' the pbuf to the existing chain */ + pbuf_cat(priv->q, priv->p); + } else { + /* p is the first pbuf in the chain */ + priv->q = priv->p; + } + } + + /* this automatically drops bytes if > SLIP_MAX_SIZE */ + if ((priv->p != NULL) && (priv->recved <= SLIP_MAX_SIZE)) { + ((u8_t *)priv->p->payload)[priv->i] = c; + priv->recved++; + priv->i++; + if (priv->i >= priv->p->len) { + /* on to the next pbuf */ + priv->i = 0; + if (priv->p->next != NULL && priv->p->next->len > 0) { + /* p is a chain, on to the next in the chain */ + priv->p = priv->p->next; + } else { + /* p is a single pbuf, set it to NULL so next time a new + * pbuf is allocated */ + priv->p = NULL; + } + } + } + return NULL; +} + +/** Like slipif_rxbyte, but passes completed packets to netif->input + * + * @param netif The lwip network interface structure for this slipif + * @param c received character + */ +static void +slipif_rxbyte_input(struct netif *netif, u8_t c) +{ + struct pbuf *p; + p = slipif_rxbyte(netif, c); + if (p != NULL) { + if (netif->input(p, netif) != ERR_OK) { + pbuf_free(p); + } + } +} + +#if SLIP_USE_RX_THREAD +/** + * The SLIP input thread. + * + * Feed the IP layer with incoming packets + * + * @param nf the lwip network interface structure for this slipif + */ +static void +slipif_loop_thread(void *nf) +{ + u8_t c; + struct netif *netif = (struct netif *)nf; + struct slipif_priv *priv = (struct slipif_priv *)netif->state; + + while (1) { + if (sio_read(priv->sd, &c, 1) > 0) { + slipif_rxbyte_input(netif, c); + } + } +} +#endif /* SLIP_USE_RX_THREAD */ + +/** + * SLIP netif initialization + * + * Call the arch specific sio_open and remember + * the opened device in the state field of the netif. + * + * @param netif the lwip network interface structure for this slipif + * @return ERR_OK if serial line could be opened, + * ERR_MEM if no memory could be allocated, + * ERR_IF is serial line couldn't be opened + * + * @note netif->num must contain the number of the serial port to open + * (0 by default). If netif->state is != NULL, it is interpreted as an + * u8_t pointer pointing to the serial port number instead of netif->num. + * + */ +err_t +slipif_init(struct netif *netif) +{ + struct slipif_priv *priv; + u8_t sio_num; + + LWIP_DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%"U16_F"\n", (u16_t)netif->num)); + + /* Allocate private data */ + priv = (struct slipif_priv *)mem_malloc(sizeof(struct slipif_priv)); + if (!priv) { + return ERR_MEM; + } + + netif->name[0] = 's'; + netif->name[1] = 'l'; +#if LWIP_IPV4 + netif->output = slipif_output_v4; +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + netif->output_ip6 = slipif_output_v6; +#endif /* LWIP_IPV6 */ + netif->mtu = SLIP_MAX_SIZE; + + /* netif->state or netif->num contain the port number */ + if (netif->state != NULL) { + sio_num = *(u8_t*)netif->state; + } else { + sio_num = netif->num; + } + /* Try to open the serial port. */ + priv->sd = sio_open(sio_num); + if (!priv->sd) { + /* Opening the serial port failed. */ + mem_free(priv); + return ERR_IF; + } + + /* Initialize private data */ + priv->p = NULL; + priv->q = NULL; + priv->state = SLIP_RECV_NORMAL; + priv->i = 0; + priv->recved = 0; +#if SLIP_RX_FROM_ISR + priv->rxpackets = NULL; +#endif + + netif->state = priv; + + /* initialize the snmp variables and counters inside the struct netif */ + MIB2_INIT_NETIF(netif, snmp_ifType_slip, SLIP_SIO_SPEED(priv->sd)); + +#if SLIP_USE_RX_THREAD + /* Create a thread to poll the serial line. */ + sys_thread_new(SLIPIF_THREAD_NAME, slipif_loop_thread, netif, + SLIPIF_THREAD_STACKSIZE, SLIPIF_THREAD_PRIO); +#endif /* SLIP_USE_RX_THREAD */ + return ERR_OK; +} + +/** + * Polls the serial device and feeds the IP layer with incoming packets. + * + * @param netif The lwip network interface structure for this slipif + */ +void +slipif_poll(struct netif *netif) +{ + u8_t c; + struct slipif_priv *priv; + + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + + priv = (struct slipif_priv *)netif->state; + + while (sio_tryread(priv->sd, &c, 1) > 0) { + slipif_rxbyte_input(netif, c); + } +} + +#if SLIP_RX_FROM_ISR +/** + * Feeds the IP layer with incoming packets that were receive + * + * @param netif The lwip network interface structure for this slipif + */ +void +slipif_process_rxqueue(struct netif *netif) +{ + struct slipif_priv *priv; + SYS_ARCH_DECL_PROTECT(old_level); + + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + + priv = (struct slipif_priv *)netif->state; + + SYS_ARCH_PROTECT(old_level); + while (priv->rxpackets != NULL) { + struct pbuf *p = priv->rxpackets; +#if SLIP_RX_QUEUE + /* dequeue packet */ + struct pbuf *q = p; + while ((q->len != q->tot_len) && (q->next != NULL)) { + q = q->next; + } + priv->rxpackets = q->next; + q->next = NULL; +#else /* SLIP_RX_QUEUE */ + priv->rxpackets = NULL; +#endif /* SLIP_RX_QUEUE */ + SYS_ARCH_UNPROTECT(old_level); + if (netif->input(p, netif) != ERR_OK) { + pbuf_free(p); + } + SYS_ARCH_PROTECT(old_level); + } +} + +/** Like slipif_rxbyte, but queues completed packets. + * + * @param netif The lwip network interface structure for this slipif + * @param data Received serial byte + */ +static void +slipif_rxbyte_enqueue(struct netif *netif, u8_t data) +{ + struct pbuf *p; + struct slipif_priv *priv = (struct slipif_priv *)netif->state; + SYS_ARCH_DECL_PROTECT(old_level); + + p = slipif_rxbyte(netif, data); + if (p != NULL) { + SYS_ARCH_PROTECT(old_level); + if (priv->rxpackets != NULL) { +#if SLIP_RX_QUEUE + /* queue multiple pbufs */ + struct pbuf *q = p; + while (q->next != NULL) { + q = q->next; + } + q->next = p; + } else { +#else /* SLIP_RX_QUEUE */ + pbuf_free(priv->rxpackets); + } + { +#endif /* SLIP_RX_QUEUE */ + priv->rxpackets = p; + } + SYS_ARCH_UNPROTECT(old_level); + } +} + +/** + * Process a received byte, completed packets are put on a queue that is + * fed into IP through slipif_process_rxqueue(). + * + * This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled. + * + * @param netif The lwip network interface structure for this slipif + * @param data received character + */ +void +slipif_received_byte(struct netif *netif, u8_t data) +{ + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + slipif_rxbyte_enqueue(netif, data); +} + +/** + * Process multiple received byte, completed packets are put on a queue that is + * fed into IP through slipif_process_rxqueue(). + * + * This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled. + * + * @param netif The lwip network interface structure for this slipif + * @param data received character + * @param len Number of received characters + */ +void +slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len) +{ + u8_t i; + u8_t *rxdata = data; + LWIP_ASSERT("netif != NULL", (netif != NULL)); + LWIP_ASSERT("netif->state != NULL", (netif->state != NULL)); + + for (i = 0; i < len; i++, rxdata++) { + slipif_rxbyte_enqueue(netif, *rxdata); + } +} +#endif /* SLIP_RX_FROM_ISR */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/Makefile b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/Makefile new file mode 100644 index 0000000..67ffb19 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (c) 2001, 2002 Swedish Institute of Computer Science. +# 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. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +# SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +# +# This file is part of the lwIP TCP/IP stack. +# +# Author: Adam Dunkels +# + +all compile: lwip_fuzz +.PHONY: all clean + +CC=afl-gcc +LDFLAGS=-lm +CFLAGS=-O0 + +CONTRIBDIR=../../../lwip-contrib +include $(CONTRIBDIR)/ports/unix/Common.mk + +clean: + rm -f *.o $(LWIPLIBCOMMON) lwip_fuzz *.s .depend* *.core core + +depend dep: .depend + +include .depend + +.depend: fuzz.c $(LWIPFILES) $(APPFILES) + $(CCDEP) $(CFLAGS) -MM $^ > .depend || rm -f .depend + +lwip_fuzz: .depend $(LWIPLIBCOMMON) fuzz.o + $(CC) $(CFLAGS) -o lwip_fuzz fuzz.o $(LWIPLIBCOMMON) $(LDFLAGS) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/README b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/README new file mode 100644 index 0000000..1d1e3d8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/README @@ -0,0 +1,34 @@ + +Fuzzing the lwIP stack (afl-fuzz requires linux/unix or similar) + +This directory contains a small app that reads Ethernet frames from stdin and +processes them. It is used together with the 'american fuzzy lop' tool (found +at http://lcamtuf.coredump.cx/afl/) and the sample inputs to test how +unexpected inputs are handled. The afl tool will read the known inputs, and +try to modify them to exercise as many code paths as possible, by instrumenting +the code and keeping track of which code is executed. + +Just running make will produce the test program. + +Then run afl with: + +afl-fuzz -i inputs/ -o output ./lwip_fuzz + +and it should start working. It will probably complain about CPU scheduler, +set AFL_SKIP_CPUFREQ=1 to ignore it. +If it complains about invalid "/proc/sys/kernel/core_pattern" setting, try +executing "sudo bash -c 'echo core > /proc/sys/kernel/core_pattern'". + +The input is split into different subdirectories since they test different +parts of the code, and since you want to run one instance of afl-fuzz on each +core. + +When afl finds a crash or a hang, the input that caused it will be placed in +the output directory. If you have hexdump and text2pcap tools installed, +running output_to_pcap.sh will create pcap files for each input +file to simplify viewing in wireshark. + +The lwipopts.h file needs to have checksum checking off, otherwise almost every +packet will be discarded because of that. The other options can be tuned to +expose different parts of the code. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/config.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/config.h new file mode 100644 index 0000000..e69de29 diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/fuzz.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/fuzz.c new file mode 100644 index 0000000..a9157f1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/fuzz.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ + +#include "lwip/init.h" +#include "lwip/netif.h" +#include "netif/etharp.h" +#if LWIP_IPV6 +#include "lwip/ethip6.h" +#include "lwip/nd6.h" +#endif +#include +#include + +/* no-op send function */ +static err_t lwip_tx_func(struct netif *netif, struct pbuf *p) +{ + LWIP_UNUSED_ARG(netif); + LWIP_UNUSED_ARG(p); + return ERR_OK; +} + +static err_t testif_init(struct netif *netif) +{ + netif->name[0] = 'f'; + netif->name[1] = 'z'; + netif->output = etharp_output; + netif->linkoutput = lwip_tx_func; + netif->mtu = 1500; + netif->hwaddr_len = 6; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP; + + netif->hwaddr[0] = 0x00; + netif->hwaddr[1] = 0x23; + netif->hwaddr[2] = 0xC1; + netif->hwaddr[3] = 0xDE; + netif->hwaddr[4] = 0xD0; + netif->hwaddr[5] = 0x0D; + +#if LWIP_IPV6 + netif->output_ip6 = ethip6_output; + netif->ip6_autoconfig_enabled = 1; + netif_create_ip6_linklocal_address(netif, 1); + netif->flags |= NETIF_FLAG_MLD6; +#endif + + return ERR_OK; +} + +static void input_pkt(struct netif *netif, const u8_t *data, size_t len) +{ + struct pbuf *p, *q; + err_t err; + + LWIP_ASSERT("pkt too big", len <= 0xFFFF); + p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL); + LWIP_ASSERT("alloc failed", p); + for(q = p; q != NULL; q = q->next) { + MEMCPY(q->payload, data, q->len); + data += q->len; + } + err = netif->input(p, netif); + if (err != ERR_OK) { + pbuf_free(p); + } +} + +int main(int argc, char** argv) +{ + struct netif net_test; + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + u8_t pktbuf[2000]; + size_t len; + + lwip_init(); + + IP4_ADDR(&addr, 172, 30, 115, 84); + IP4_ADDR(&netmask, 255, 255, 255, 0); + IP4_ADDR(&gw, 172, 30, 115, 1); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + +#if LWIP_IPV6 + nd6_tmr(); /* tick nd to join multicast groups */ +#endif + + if(argc > 1) { + FILE* f; + const char* filename; + printf("reading input from file... "); + fflush(stdout); + filename = argv[1]; + LWIP_ASSERT("invalid filename", filename != NULL); + f = fopen(filename, "rb"); + LWIP_ASSERT("open failed", f != NULL); + len = fread(pktbuf, 1, sizeof(pktbuf), f); + fclose(f); + printf("testing file: \"%s\"...\r\n", filename); + } else { + len = fread(pktbuf, 1, sizeof(pktbuf), stdin); + } + input_pkt(&net_test, pktbuf, len); + + return 0; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/arp/arp_req.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/arp/arp_req.bin new file mode 100644 index 0000000..b317334 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/arp/arp_req.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/icmp/icmp_ping.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/icmp/icmp_ping.bin new file mode 100644 index 0000000..87e1ea7 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/icmp/icmp_ping.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/neighbor_solicitation.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/neighbor_solicitation.bin new file mode 100644 index 0000000..d2f921c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/neighbor_solicitation.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/router_adv.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/router_adv.bin new file mode 100644 index 0000000..3aa9615 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/ipv6/router_adv.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/tcp/tcp_syn.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/tcp/tcp_syn.bin new file mode 100644 index 0000000..d77f6d2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/tcp/tcp_syn.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/udp/udp_port_5000.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/udp/udp_port_5000.bin new file mode 100644 index 0000000..d77e267 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/inputs/udp/udp_port_5000.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/lwipopts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/lwipopts.h new file mode 100644 index 0000000..4aff09b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/lwipopts.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_LWIPOPTS_H__ +#define LWIP_HDR_LWIPOPTS_H__ + +/* Prevent having to link sys_arch.c (we don't test the API layers in unit tests) */ +#define NO_SYS 1 +#define LWIP_NETCONN 0 +#define LWIP_SOCKET 0 +#define SYS_LIGHTWEIGHT_PROT 0 + +#define LWIP_IPV6 1 +#define IPV6_FRAG_COPYHEADER 1 +#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0 + +/* Enable DHCP to test it */ +#define LWIP_DHCP 1 + +/* Turn off checksum verification of fuzzed data */ +#define CHECKSUM_CHECK_IP 0 +#define CHECKSUM_CHECK_UDP 0 +#define CHECKSUM_CHECK_TCP 0 +#define CHECKSUM_CHECK_ICMP 0 +#define CHECKSUM_CHECK_ICMP6 0 + +/* Minimal changes to opt.h required for tcp unit tests: */ +#define MEM_SIZE 16000 +#define TCP_SND_QUEUELEN 40 +#define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN +#define TCP_SND_BUF (12 * TCP_MSS) +#define TCP_WND (10 * TCP_MSS) +#define LWIP_WND_SCALE 1 +#define TCP_RCV_SCALE 0 +#define PBUF_POOL_SIZE 400 /* pbuf tests need ~200KByte */ + +/* Minimal changes to opt.h required for etharp unit tests: */ +#define ETHARP_SUPPORT_STATIC_ENTRIES 1 + +#endif /* LWIP_HDR_LWIPOPTS_H__ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/output_to_pcap.sh b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/output_to_pcap.sh new file mode 100644 index 0000000..c999ff0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/fuzz/output_to_pcap.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ -z "$1" ] +then + echo "This script will make pcap files from the afl-fuzz crash/hang files" + echo "It needs hexdump and text2pcap" + echo "Please give output directory as argument" + exit 2 +fi + +for i in `ls $1/crashes/id*` +do + PCAPNAME=`echo $i | grep pcap` + if [ -z "$PCAPNAME" ]; then + hexdump -C $i > $1/$$.tmp + text2pcap $1/$$.tmp ${i}.pcap + fi +done +for i in `ls $1/hangs/id*` +do + PCAPNAME=`echo $i | grep pcap` + if [ -z "$PCAPNAME" ]; then + hexdump -C $i > $1/$$.tmp + text2pcap $1/$$.tmp ${i}.pcap + fi +done +rm -f $1/$$.tmp + +echo +echo "Created pcap files:" +ls $1/*/*.pcap diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.c new file mode 100644 index 0000000..66b4877 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.c @@ -0,0 +1,121 @@ +#include "test_mem.h" + +#include "lwip/mem.h" +#include "lwip/stats.h" + +#if !LWIP_STATS || !MEM_STATS +#error "This tests needs MEM-statistics enabled" +#endif +#if LWIP_DNS +#error "This test needs DNS turned off (as it mallocs on init)" +#endif + +/* Setups/teardown functions */ + +static void +mem_setup(void) +{ +} + +static void +mem_teardown(void) +{ +} + + +/* Test functions */ + +/** Call mem_malloc, mem_free and mem_trim and check stats */ +START_TEST(test_mem_one) +{ +#define SIZE1 16 +#define SIZE1_2 12 +#define SIZE2 16 + void *p1, *p2; + mem_size_t s1, s2; + LWIP_UNUSED_ARG(_i); + + fail_unless(lwip_stats.mem.used == 0); + + p1 = mem_malloc(SIZE1); + fail_unless(p1 != NULL); + fail_unless(lwip_stats.mem.used >= SIZE1); + s1 = lwip_stats.mem.used; + + p2 = mem_malloc(SIZE2); + fail_unless(p2 != NULL); + fail_unless(lwip_stats.mem.used >= SIZE2 + s1); + s2 = lwip_stats.mem.used; + + mem_trim(p1, SIZE1_2); + + mem_free(p2); + fail_unless(lwip_stats.mem.used <= s2 - SIZE2); + + mem_free(p1); + fail_unless(lwip_stats.mem.used == 0); +} +END_TEST + +static void malloc_keep_x(int x, int num, int size, int freestep) +{ + int i; + void* p[16]; + LWIP_ASSERT("invalid size", size >= 0 && size < (mem_size_t)-1); + memset(p, 0, sizeof(p)); + for(i = 0; i < num && i < 16; i++) { + p[i] = mem_malloc((mem_size_t)size); + fail_unless(p[i] != NULL); + } + for(i = 0; i < num && i < 16; i += freestep) { + if (i == x) { + continue; + } + mem_free(p[i]); + p[i] = NULL; + } + for(i = 0; i < num && i < 16; i++) { + if (i == x) { + continue; + } + if (p[i] != NULL) { + mem_free(p[i]); + p[i] = NULL; + } + } + fail_unless(p[x] != NULL); + mem_free(p[x]); +} + +START_TEST(test_mem_random) +{ + const int num = 16; + int x; + int size; + int freestep; + LWIP_UNUSED_ARG(_i); + + fail_unless(lwip_stats.mem.used == 0); + + for (x = 0; x < num; x++) { + for (size = 1; size < 32; size++) { + for (freestep = 1; freestep <= 3; freestep++) { + fail_unless(lwip_stats.mem.used == 0); + malloc_keep_x(x, num, size, freestep); + fail_unless(lwip_stats.mem.used == 0); + } + } + } +} +END_TEST + +/** Create the suite including all tests for this module */ +Suite * +mem_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_mem_one), + TESTFUNC(test_mem_random) + }; + return create_suite("MEM", tests, sizeof(tests)/sizeof(testfunc), mem_setup, mem_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.h new file mode 100644 index 0000000..325134c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_mem.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_MEM_H +#define LWIP_HDR_TEST_MEM_H + +#include "../lwip_check.h" + +Suite *mem_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.c new file mode 100644 index 0000000..9315c4c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.c @@ -0,0 +1,239 @@ +#include "test_pbuf.h" + +#include "lwip/pbuf.h" +#include "lwip/stats.h" + +#if !LWIP_STATS || !MEM_STATS ||!MEMP_STATS +#error "This tests needs MEM- and MEMP-statistics enabled" +#endif +#if LWIP_DNS +#error "This test needs DNS turned off (as it mallocs on init)" +#endif +#if !LWIP_TCP || !TCP_QUEUE_OOSEQ || !LWIP_WND_SCALE +#error "This test needs TCP OOSEQ queueing and window scaling enabled" +#endif + +/* Setups/teardown functions */ + +static void +pbuf_setup(void) +{ +} + +static void +pbuf_teardown(void) +{ +} + + +#define TESTBUFSIZE_1 65535 +#define TESTBUFSIZE_2 65530 +#define TESTBUFSIZE_3 50050 +static u8_t testbuf_1[TESTBUFSIZE_1]; +static u8_t testbuf_1a[TESTBUFSIZE_1]; +static u8_t testbuf_2[TESTBUFSIZE_2]; +static u8_t testbuf_2a[TESTBUFSIZE_2]; +static u8_t testbuf_3[TESTBUFSIZE_3]; +static u8_t testbuf_3a[TESTBUFSIZE_3]; + +/* Test functions */ + +/** Call pbuf_copy on a pbuf with zero length */ +START_TEST(test_pbuf_copy_zero_pbuf) +{ + struct pbuf *p1, *p2, *p3; + err_t err; + LWIP_UNUSED_ARG(_i); + + fail_unless(lwip_stats.mem.used == 0); + fail_unless(MEMP_STATS_GET(used, MEMP_PBUF_POOL) == 0); + + p1 = pbuf_alloc(PBUF_RAW, 1024, PBUF_RAM); + fail_unless(p1 != NULL); + fail_unless(p1->ref == 1); + + p2 = pbuf_alloc(PBUF_RAW, 2, PBUF_POOL); + fail_unless(p2 != NULL); + fail_unless(p2->ref == 1); + p2->len = p2->tot_len = 0; + + pbuf_cat(p1, p2); + fail_unless(p1->ref == 1); + fail_unless(p2->ref == 1); + + p3 = pbuf_alloc(PBUF_RAW, p1->tot_len, PBUF_POOL); + err = pbuf_copy(p3, p1); + fail_unless(err == ERR_VAL); + + pbuf_free(p1); + pbuf_free(p3); + fail_unless(lwip_stats.mem.used == 0); + + fail_unless(lwip_stats.mem.used == 0); + fail_unless(MEMP_STATS_GET(used, MEMP_PBUF_POOL) == 0); +} +END_TEST + +START_TEST(test_pbuf_split_64k_on_small_pbufs) +{ + struct pbuf *p, *rest=NULL; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, 1, PBUF_POOL); + pbuf_split_64k(p, &rest); + fail_unless(p->tot_len == 1); + pbuf_free(p); +} +END_TEST + +START_TEST(test_pbuf_queueing_bigger_than_64k) +{ + int i; + err_t err; + struct pbuf *p1, *p2, *p3, *rest2=NULL, *rest3=NULL; + LWIP_UNUSED_ARG(_i); + + for(i = 0; i < TESTBUFSIZE_1; i++) { + testbuf_1[i] = (u8_t)rand(); + } + for(i = 0; i < TESTBUFSIZE_2; i++) { + testbuf_2[i] = (u8_t)rand(); + } + for(i = 0; i < TESTBUFSIZE_3; i++) { + testbuf_3[i] = (u8_t)rand(); + } + + p1 = pbuf_alloc(PBUF_RAW, TESTBUFSIZE_1, PBUF_POOL); + fail_unless(p1 != NULL); + p2 = pbuf_alloc(PBUF_RAW, TESTBUFSIZE_2, PBUF_POOL); + fail_unless(p2 != NULL); + p3 = pbuf_alloc(PBUF_RAW, TESTBUFSIZE_3, PBUF_POOL); + fail_unless(p3 != NULL); + err = pbuf_take(p1, testbuf_1, TESTBUFSIZE_1); + fail_unless(err == ERR_OK); + err = pbuf_take(p2, testbuf_2, TESTBUFSIZE_2); + fail_unless(err == ERR_OK); + err = pbuf_take(p3, testbuf_3, TESTBUFSIZE_3); + fail_unless(err == ERR_OK); + + pbuf_cat(p1, p2); + pbuf_cat(p1, p3); + + pbuf_split_64k(p1, &rest2); + fail_unless(p1->tot_len == TESTBUFSIZE_1); + fail_unless(rest2->tot_len == (u16_t)((TESTBUFSIZE_2+TESTBUFSIZE_3) & 0xFFFF)); + pbuf_split_64k(rest2, &rest3); + fail_unless(rest2->tot_len == TESTBUFSIZE_2); + fail_unless(rest3->tot_len == TESTBUFSIZE_3); + + pbuf_copy_partial(p1, testbuf_1a, TESTBUFSIZE_1, 0); + pbuf_copy_partial(rest2, testbuf_2a, TESTBUFSIZE_2, 0); + pbuf_copy_partial(rest3, testbuf_3a, TESTBUFSIZE_3, 0); + for(i = 0; i < TESTBUFSIZE_1; i++) + fail_unless(testbuf_1[i] == testbuf_1a[i]); + for(i = 0; i < TESTBUFSIZE_2; i++) + fail_unless(testbuf_2[i] == testbuf_2a[i]); + for(i = 0; i < TESTBUFSIZE_3; i++) + fail_unless(testbuf_3[i] == testbuf_3a[i]); + + pbuf_free(p1); + pbuf_free(rest2); + pbuf_free(rest3); +} +END_TEST + +/* Test for bug that writing with pbuf_take_at() did nothing + * and returned ERR_OK when writing at beginning of a pbuf + * in the chain. + */ +START_TEST(test_pbuf_take_at_edge) +{ + err_t res; + u8_t *out; + int i; + u8_t testdata[] = { 0x01, 0x08, 0x82, 0x02 }; + struct pbuf *p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL); + struct pbuf *q = p->next; + LWIP_UNUSED_ARG(_i); + /* alloc big enough to get a chain of pbufs */ + fail_if(p->tot_len == p->len); + memset(p->payload, 0, p->len); + memset(q->payload, 0, q->len); + + /* copy data to the beginning of first pbuf */ + res = pbuf_take_at(p, &testdata, sizeof(testdata), 0); + fail_unless(res == ERR_OK); + + out = (u8_t*)p->payload; + for (i = 0; i < (int)sizeof(testdata); i++) { + fail_unless(out[i] == testdata[i], + "Bad data at pos %d, was %02X, expected %02X", i, out[i], testdata[i]); + } + + /* copy data to the just before end of first pbuf */ + res = pbuf_take_at(p, &testdata, sizeof(testdata), p->len - 1); + fail_unless(res == ERR_OK); + + out = (u8_t*)p->payload; + fail_unless(out[p->len - 1] == testdata[0], + "Bad data at pos %d, was %02X, expected %02X", p->len - 1, out[p->len - 1], testdata[0]); + out = (u8_t*)q->payload; + for (i = 1; i < (int)sizeof(testdata); i++) { + fail_unless(out[i-1] == testdata[i], + "Bad data at pos %d, was %02X, expected %02X", p->len - 1 + i, out[i-1], testdata[i]); + } + + /* copy data to the beginning of second pbuf */ + res = pbuf_take_at(p, &testdata, sizeof(testdata), p->len); + fail_unless(res == ERR_OK); + + out = (u8_t*)p->payload; + for (i = 0; i < (int)sizeof(testdata); i++) { + fail_unless(out[i] == testdata[i], + "Bad data at pos %d, was %02X, expected %02X", p->len+i, out[i], testdata[i]); + } +} +END_TEST + +/* Verify pbuf_put_at()/pbuf_get_at() when using + * offsets equal to beginning of new pbuf in chain + */ +START_TEST(test_pbuf_get_put_at_edge) +{ + u8_t *out; + u8_t testdata = 0x01; + u8_t getdata; + struct pbuf *p = pbuf_alloc(PBUF_RAW, 1024, PBUF_POOL); + struct pbuf *q = p->next; + LWIP_UNUSED_ARG(_i); + /* alloc big enough to get a chain of pbufs */ + fail_if(p->tot_len == p->len); + memset(p->payload, 0, p->len); + memset(q->payload, 0, q->len); + + /* put byte at the beginning of second pbuf */ + pbuf_put_at(p, p->len, testdata); + + out = (u8_t*)q->payload; + fail_unless(*out == testdata, + "Bad data at pos %d, was %02X, expected %02X", p->len, *out, testdata); + + getdata = pbuf_get_at(p, p->len); + fail_unless(*out == getdata, + "pbuf_get_at() returned bad data at pos %d, was %02X, expected %02X", p->len, getdata, *out); +} +END_TEST + +/** Create the suite including all tests for this module */ +Suite * +pbuf_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_pbuf_copy_zero_pbuf), + TESTFUNC(test_pbuf_split_64k_on_small_pbufs), + TESTFUNC(test_pbuf_queueing_bigger_than_64k), + TESTFUNC(test_pbuf_take_at_edge), + TESTFUNC(test_pbuf_get_put_at_edge) + }; + return create_suite("PBUF", tests, sizeof(tests)/sizeof(testfunc), pbuf_setup, pbuf_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.h new file mode 100644 index 0000000..da7730a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/core/test_pbuf.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_PBUF_H +#define LWIP_HDR_TEST_PBUF_H + +#include "../lwip_check.h" + +Suite *pbuf_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.c new file mode 100644 index 0000000..47aaa08 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.c @@ -0,0 +1,1024 @@ +#include "test_dhcp.h" + +#include "lwip/netif.h" +#include "lwip/dhcp.h" +#include "lwip/prot/dhcp.h" +#include "lwip/etharp.h" +#include "netif/ethernet.h" + +struct netif net_test; + +static const u8_t broadcast[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + +static const u8_t magic_cookie[] = { 0x63, 0x82, 0x53, 0x63 }; + +static u8_t dhcp_offer[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, /* To unit */ + 0x00, 0x0F, 0xEE, 0x30, 0xAB, 0x22, /* From Remote host */ + 0x08, 0x00, /* Protocol: IP */ + 0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x36, 0xcc, 0xc3, 0xaa, 0xbd, 0xab, 0xc3, 0xaa, 0xbd, 0xc8, /* IP header */ + 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x00, 0x00, /* UDP header */ + + 0x02, /* Type == Boot reply */ + 0x01, 0x06, /* Hw Ethernet, 6 bytes addrlen */ + 0x00, /* 0 hops */ + 0xAA, 0xAA, 0xAA, 0xAA, /* Transaction id, will be overwritten */ + 0x00, 0x00, /* 0 seconds elapsed */ + 0x00, 0x00, /* Flags (unicast) */ + 0x00, 0x00, 0x00, 0x00, /* Client ip */ + 0xc3, 0xaa, 0xbd, 0xc8, /* Your IP */ + 0xc3, 0xaa, 0xbd, 0xab, /* DHCP server ip */ + 0x00, 0x00, 0x00, 0x00, /* relay agent */ + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MAC addr + padding */ + + /* Empty server name and boot file name */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x63, 0x82, 0x53, 0x63, /* Magic cookie */ + 0x35, 0x01, 0x02, /* Message type: Offer */ + 0x36, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* Server identifier (IP) */ + 0x33, 0x04, 0x00, 0x00, 0x00, 0x78, /* Lease time 2 minutes */ + 0x03, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* Router IP */ + 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet mask */ + 0xff, /* End option */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Padding */ +}; + +static u8_t dhcp_ack[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, /* To unit */ + 0x00, 0x0f, 0xEE, 0x30, 0xAB, 0x22, /* From remote host */ + 0x08, 0x00, /* Proto IP */ + 0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x36, 0xcc, 0xc3, 0xaa, 0xbd, 0xab, 0xc3, 0xaa, 0xbd, 0xc8, /* IP header */ + 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x00, 0x00, /* UDP header */ + 0x02, /* Bootp reply */ + 0x01, 0x06, /* Hw type Eth, len 6 */ + 0x00, /* 0 hops */ + 0xAA, 0xAA, 0xAA, 0xAA, + 0x00, 0x00, /* 0 seconds elapsed */ + 0x00, 0x00, /* Flags (unicast) */ + 0x00, 0x00, 0x00, 0x00, /* Client IP */ + 0xc3, 0xaa, 0xbd, 0xc8, /* Your IP */ + 0xc3, 0xaa, 0xbd, 0xab, /* DHCP server IP */ + 0x00, 0x00, 0x00, 0x00, /* Relay agent */ + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Macaddr + padding */ + + /* Empty server name and boot file name */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x63, 0x82, 0x53, 0x63, /* Magic cookie */ + 0x35, 0x01, 0x05, /* Dhcp message type ack */ + 0x36, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* DHCP server identifier */ + 0x33, 0x04, 0x00, 0x00, 0x00, 0x78, /* Lease time 2 minutes */ + 0x03, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* Router IP */ + 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Netmask */ + 0xff, /* End marker */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Padding */ +}; + +static const u8_t arpreply[] = { + 0x00, 0x23, 0xC1, 0xDE, 0xD0, 0x0D, /* dst mac */ + 0x00, 0x32, 0x44, 0x20, 0x01, 0x02, /* src mac */ + 0x08, 0x06, /* proto arp */ + 0x00, 0x01, /* hw eth */ + 0x08, 0x00, /* proto ip */ + 0x06, /* hw addr len 6 */ + 0x04, /* proto addr len 4 */ + 0x00, 0x02, /* arp reply */ + 0x00, 0x32, 0x44, 0x20, 0x01, 0x02, /* sender mac */ + 0xc3, 0xaa, 0xbd, 0xc8, /* sender ip */ + 0x00, 0x23, 0xC1, 0xDE, 0xD0, 0x0D, /* target mac */ + 0x00, 0x00, 0x00, 0x00, /* target ip */ +}; + +static int txpacket; +static enum tcase { + TEST_LWIP_DHCP, + TEST_LWIP_DHCP_NAK, + TEST_LWIP_DHCP_RELAY, + TEST_LWIP_DHCP_NAK_NO_ENDMARKER, + TEST_LWIP_DHCP_INVALID_OVERLOAD +} tcase; + +static int debug = 0; +static void setdebug(int a) {debug = a;} + +static int tick = 0; +static void tick_lwip(void) +{ + tick++; + if (tick % 5 == 0) { + dhcp_fine_tmr(); + } + if (tick % 600 == 0) { + dhcp_coarse_tmr(); + } +} + +static void send_pkt(struct netif *netif, const u8_t *data, size_t len) +{ + struct pbuf *p, *q; + LWIP_ASSERT("pkt too big", len <= 0xFFFF); + p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL); + + if (debug) { + /* Dump data */ + u32_t i; + printf("RX data (len %d)", p->tot_len); + for (i = 0; i < len; i++) { + printf(" %02X", data[i]); + } + printf("\n"); + } + + fail_unless(p != NULL); + for(q = p; q != NULL; q = q->next) { + memcpy(q->payload, data, q->len); + data += q->len; + } + netif->input(p, netif); +} + +static err_t lwip_tx_func(struct netif *netif, struct pbuf *p); + +static err_t testif_init(struct netif *netif) +{ + netif->name[0] = 'c'; + netif->name[1] = 'h'; + netif->output = etharp_output; + netif->linkoutput = lwip_tx_func; + netif->mtu = 1500; + netif->hwaddr_len = 6; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP; + + netif->hwaddr[0] = 0x00; + netif->hwaddr[1] = 0x23; + netif->hwaddr[2] = 0xC1; + netif->hwaddr[3] = 0xDE; + netif->hwaddr[4] = 0xD0; + netif->hwaddr[5] = 0x0D; + + return ERR_OK; +} + +static void dhcp_setup(void) +{ + txpacket = 0; +} + +static void dhcp_teardown(void) +{ +} + +static void check_pkt(struct pbuf *p, u32_t pos, const u8_t *mem, u32_t len) +{ + u8_t *data; + + fail_if((pos + len) > p->tot_len); + while (pos > p->len && p->next) { + pos -= p->len; + p = p->next; + } + fail_if(p == NULL); + fail_unless(pos + len <= p->len); /* All data we seek within same pbuf */ + + data = (u8_t*)p->payload; + fail_if(memcmp(&data[pos], mem, len), "data at pos %d, len %d in packet %d did not match", pos, len, txpacket); +} + +static void check_pkt_fuzzy(struct pbuf *p, u32_t startpos, const u8_t *mem, u32_t len) +{ + int found; + u32_t i; + u8_t *data; + + fail_if((startpos + len) > p->tot_len); + while (startpos > p->len && p->next) { + startpos -= p->len; + p = p->next; + } + fail_if(p == NULL); + fail_unless(startpos + len <= p->len); /* All data we seek within same pbuf */ + + found = 0; + data = (u8_t*)p->payload; + for (i = startpos; i <= (p->len - len); i++) { + if (memcmp(&data[i], mem, len) == 0) { + found = 1; + break; + } + } + fail_unless(found); +} + +static err_t lwip_tx_func(struct netif *netif, struct pbuf *p) +{ + fail_unless(netif == &net_test); + txpacket++; + + if (debug) { + struct pbuf *pp = p; + /* Dump data */ + printf("TX data (pkt %d, len %d, tick %d)", txpacket, p->tot_len, tick); + do { + int i; + for (i = 0; i < pp->len; i++) { + printf(" %02X", ((u8_t *) pp->payload)[i]); + } + if (pp->next) { + pp = pp->next; + } + } while (pp->next); + printf("\n"); + } + + switch (tcase) { + case TEST_LWIP_DHCP: + switch (txpacket) { + case 1: + case 2: + { + const u8_t ipproto[] = { 0x08, 0x00 }; + const u8_t bootp_start[] = { 0x01, 0x01, 0x06, 0x00}; /* bootp request, eth, hwaddr len 6, 0 hops */ + const u8_t ipaddrs[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + check_pkt(p, 0, broadcast, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, ipproto, sizeof(ipproto)); /* eth level proto: ip */ + + check_pkt(p, 42, bootp_start, sizeof(bootp_start)); + + check_pkt(p, 53, ipaddrs, sizeof(ipaddrs)); + + check_pkt(p, 70, netif->hwaddr, 6); /* mac addr inside bootp */ + + check_pkt(p, 278, magic_cookie, sizeof(magic_cookie)); + + /* Check dchp message type, can be at different positions */ + if (txpacket == 1) { + u8_t dhcp_discover_opt[] = { 0x35, 0x01, 0x01 }; + check_pkt_fuzzy(p, 282, dhcp_discover_opt, sizeof(dhcp_discover_opt)); + } else if (txpacket == 2) { + u8_t dhcp_request_opt[] = { 0x35, 0x01, 0x03 }; + u8_t requested_ipaddr[] = { 0x32, 0x04, 0xc3, 0xaa, 0xbd, 0xc8 }; /* Ask for offered IP */ + + check_pkt_fuzzy(p, 282, dhcp_request_opt, sizeof(dhcp_request_opt)); + check_pkt_fuzzy(p, 282, requested_ipaddr, sizeof(requested_ipaddr)); + } + break; + } + case 3: + case 4: + case 5: + { + const u8_t arpproto[] = { 0x08, 0x06 }; + + check_pkt(p, 0, broadcast, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, arpproto, sizeof(arpproto)); /* eth level proto: ip */ + break; + } + default: + fail(); + break; + } + break; + + case TEST_LWIP_DHCP_NAK: + { + const u8_t ipproto[] = { 0x08, 0x00 }; + const u8_t bootp_start[] = { 0x01, 0x01, 0x06, 0x00}; /* bootp request, eth, hwaddr len 6, 0 hops */ + const u8_t ipaddrs[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + const u8_t dhcp_nak_opt[] = { 0x35, 0x01, 0x04 }; + const u8_t requested_ipaddr[] = { 0x32, 0x04, 0xc3, 0xaa, 0xbd, 0xc8 }; /* offered IP */ + + fail_unless(txpacket == 4); + check_pkt(p, 0, broadcast, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, ipproto, sizeof(ipproto)); /* eth level proto: ip */ + + check_pkt(p, 42, bootp_start, sizeof(bootp_start)); + + check_pkt(p, 53, ipaddrs, sizeof(ipaddrs)); + + check_pkt(p, 70, netif->hwaddr, 6); /* mac addr inside bootp */ + + check_pkt(p, 278, magic_cookie, sizeof(magic_cookie)); + + check_pkt_fuzzy(p, 282, dhcp_nak_opt, sizeof(dhcp_nak_opt)); /* NAK the ack */ + + check_pkt_fuzzy(p, 282, requested_ipaddr, sizeof(requested_ipaddr)); + break; + } + + case TEST_LWIP_DHCP_RELAY: + switch (txpacket) { + case 1: + case 2: + { + const u8_t ipproto[] = { 0x08, 0x00 }; + const u8_t bootp_start[] = { 0x01, 0x01, 0x06, 0x00}; /* bootp request, eth, hwaddr len 6, 0 hops */ + const u8_t ipaddrs[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + check_pkt(p, 0, broadcast, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, ipproto, sizeof(ipproto)); /* eth level proto: ip */ + + check_pkt(p, 42, bootp_start, sizeof(bootp_start)); + + check_pkt(p, 53, ipaddrs, sizeof(ipaddrs)); + + check_pkt(p, 70, netif->hwaddr, 6); /* mac addr inside bootp */ + + check_pkt(p, 278, magic_cookie, sizeof(magic_cookie)); + + /* Check dchp message type, can be at different positions */ + if (txpacket == 1) { + u8_t dhcp_discover_opt[] = { 0x35, 0x01, 0x01 }; + check_pkt_fuzzy(p, 282, dhcp_discover_opt, sizeof(dhcp_discover_opt)); + } else if (txpacket == 2) { + u8_t dhcp_request_opt[] = { 0x35, 0x01, 0x03 }; + u8_t requested_ipaddr[] = { 0x32, 0x04, 0x4f, 0x8a, 0x33, 0x05 }; /* Ask for offered IP */ + + check_pkt_fuzzy(p, 282, dhcp_request_opt, sizeof(dhcp_request_opt)); + check_pkt_fuzzy(p, 282, requested_ipaddr, sizeof(requested_ipaddr)); + } + break; + } + case 3: + case 4: + case 5: + case 6: + { + const u8_t arpproto[] = { 0x08, 0x06 }; + + check_pkt(p, 0, broadcast, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, arpproto, sizeof(arpproto)); /* eth level proto: ip */ + break; + } + case 7: + { + const u8_t fake_arp[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xab }; + const u8_t ipproto[] = { 0x08, 0x00 }; + const u8_t bootp_start[] = { 0x01, 0x01, 0x06, 0x00}; /* bootp request, eth, hwaddr len 6, 0 hops */ + const u8_t ipaddrs[] = { 0x00, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + const u8_t dhcp_request_opt[] = { 0x35, 0x01, 0x03 }; + + check_pkt(p, 0, fake_arp, 6); /* eth level dest: broadcast */ + check_pkt(p, 6, netif->hwaddr, 6); /* eth level src: unit mac */ + + check_pkt(p, 12, ipproto, sizeof(ipproto)); /* eth level proto: ip */ + + check_pkt(p, 42, bootp_start, sizeof(bootp_start)); + + check_pkt(p, 53, ipaddrs, sizeof(ipaddrs)); + + check_pkt(p, 70, netif->hwaddr, 6); /* mac addr inside bootp */ + + check_pkt(p, 278, magic_cookie, sizeof(magic_cookie)); + + /* Check dchp message type, can be at different positions */ + check_pkt_fuzzy(p, 282, dhcp_request_opt, sizeof(dhcp_request_opt)); + break; + } + default: + fail(); + break; + } + break; + + default: + break; + } + + return ERR_OK; +} + +/* + * Test basic happy flow DHCP session. + * Validate that xid is checked. + */ +START_TEST(test_dhcp) +{ + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + int i; + u32_t xid; + LWIP_UNUSED_ARG(_i); + + tcase = TEST_LWIP_DHCP; + setdebug(0); + + IP4_ADDR(&addr, 0, 0, 0, 0); + IP4_ADDR(&netmask, 0, 0, 0, 0); + IP4_ADDR(&gw, 0, 0, 0, 0); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + + dhcp_start(&net_test); + + fail_unless(txpacket == 1); /* DHCP discover sent */ + xid = netif_dhcp_data(&net_test)->xid; /* Write bad xid, not using htonl! */ + memcpy(&dhcp_offer[46], &xid, 4); + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + fail_unless(txpacket == 1, "TX %d packets, expected 1", txpacket); /* Nothing more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); + memcpy(&dhcp_offer[46], &xid, 4); /* insert correct transaction id */ + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + fail_unless(txpacket == 2, "TX %d packets, expected 2", txpacket); /* DHCP request sent */ + xid = netif_dhcp_data(&net_test)->xid; /* Write bad xid, not using htonl! */ + memcpy(&dhcp_ack[46], &xid, 4); + send_pkt(&net_test, dhcp_ack, sizeof(dhcp_ack)); + + fail_unless(txpacket == 2, "TX %d packets, still expected 2", txpacket); /* No more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + memcpy(&dhcp_ack[46], &xid, 4); /* insert transaction id */ + send_pkt(&net_test, dhcp_ack, sizeof(dhcp_ack)); + + for (i = 0; i < 20; i++) { + tick_lwip(); + } + fail_unless(txpacket == 5, "TX %d packets, expected 5", txpacket); /* ARP requests sent */ + + /* Interface up */ + fail_unless(netif_is_up(&net_test)); + + /* Now it should have taken the IP */ + IP4_ADDR(&addr, 195, 170, 189, 200); + IP4_ADDR(&netmask, 255, 255, 255, 0); + IP4_ADDR(&gw, 195, 170, 189, 171); + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + netif_remove(&net_test); +} +END_TEST + +/* + * Test that IP address is not taken and NAK is sent if someone + * replies to ARP requests for the offered address. + */ +START_TEST(test_dhcp_nak) +{ + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + u32_t xid; + LWIP_UNUSED_ARG(_i); + + tcase = TEST_LWIP_DHCP; + setdebug(0); + + IP4_ADDR(&addr, 0, 0, 0, 0); + IP4_ADDR(&netmask, 0, 0, 0, 0); + IP4_ADDR(&gw, 0, 0, 0, 0); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + + dhcp_start(&net_test); + + fail_unless(txpacket == 1); /* DHCP discover sent */ + xid = netif_dhcp_data(&net_test)->xid; /* Write bad xid, not using htonl! */ + memcpy(&dhcp_offer[46], &xid, 4); + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + fail_unless(txpacket == 1); /* Nothing more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); + memcpy(&dhcp_offer[46], &xid, 4); /* insert correct transaction id */ + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + fail_unless(txpacket == 2); /* DHCP request sent */ + xid = netif_dhcp_data(&net_test)->xid; /* Write bad xid, not using htonl! */ + memcpy(&dhcp_ack[46], &xid, 4); + send_pkt(&net_test, dhcp_ack, sizeof(dhcp_ack)); + + fail_unless(txpacket == 2); /* No more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + memcpy(&dhcp_ack[46], &xid, 4); /* insert transaction id */ + send_pkt(&net_test, dhcp_ack, sizeof(dhcp_ack)); + + fail_unless(txpacket == 3); /* ARP request sent */ + + tcase = TEST_LWIP_DHCP_NAK; /* Switch testcase */ + + /* Send arp reply, mark offered IP as taken */ + send_pkt(&net_test, arpreply, sizeof(arpreply)); + + fail_unless(txpacket == 4); /* DHCP nak sent */ + + netif_remove(&net_test); +} +END_TEST + +/* + * Test case based on captured data where + * replies are sent from a different IP than the + * one the client unicasted to. + */ +START_TEST(test_dhcp_relayed) +{ + u8_t relay_offer[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, + 0x00, 0x22, 0x93, 0x5a, 0xf7, 0x60, + 0x08, 0x00, 0x45, 0x00, + 0x01, 0x38, 0xfd, 0x53, 0x00, 0x00, 0x40, 0x11, + 0x78, 0x46, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a, + 0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24, + 0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35, + 0xb6, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23, + 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, + 0x53, 0x63, 0x01, 0x04, 0xff, 0xff, 0xfe, 0x00, + 0x03, 0x04, 0x4f, 0x8a, 0x32, 0x01, 0x06, 0x08, + 0x4f, 0x8a, 0x00, 0xb4, 0x55, 0x08, 0x1f, 0xd1, + 0x1c, 0x04, 0x4f, 0x8a, 0x33, 0xff, 0x33, 0x04, + 0x00, 0x00, 0x54, 0x49, 0x35, 0x01, 0x02, 0x36, + 0x04, 0x0a, 0xb5, 0x04, 0x01, 0xff + }; + + u8_t relay_ack1[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x22, + 0x93, 0x5a, 0xf7, 0x60, 0x08, 0x00, 0x45, 0x00, + 0x01, 0x38, 0xfd, 0x55, 0x00, 0x00, 0x40, 0x11, + 0x78, 0x44, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a, + 0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24, + 0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35, + 0xb6, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23, + 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, + 0x53, 0x63, 0x01, 0x04, 0xff, 0xff, 0xfe, 0x00, + 0x03, 0x04, 0x4f, 0x8a, 0x32, 0x01, 0x06, 0x08, + 0x4f, 0x8a, 0x00, 0xb4, 0x55, 0x08, 0x1f, 0xd1, + 0x1c, 0x04, 0x4f, 0x8a, 0x33, 0xff, 0x33, 0x04, + 0x00, 0x00, 0x54, 0x49, 0x35, 0x01, 0x05, 0x36, + 0x04, 0x0a, 0xb5, 0x04, 0x01, 0xff + }; + + u8_t relay_ack2[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, + 0x00, 0x22, 0x93, 0x5a, 0xf7, 0x60, + 0x08, 0x00, 0x45, 0x00, + 0x01, 0x38, 0xfa, 0x18, 0x00, 0x00, 0x40, 0x11, + 0x7b, 0x81, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a, + 0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24, + 0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x49, 0x8b, + 0x6e, 0xab, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x8a, + 0x33, 0x05, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23, + 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, + 0x53, 0x63, 0x01, 0x04, 0xff, 0xff, 0xfe, 0x00, + 0x03, 0x04, 0x4f, 0x8a, 0x32, 0x01, 0x06, 0x08, + 0x4f, 0x8a, 0x00, 0xb4, 0x55, 0x08, 0x1f, 0xd1, + 0x1c, 0x04, 0x4f, 0x8a, 0x33, 0xff, 0x33, 0x04, + 0x00, 0x00, 0x54, 0x60, 0x35, 0x01, 0x05, 0x36, + 0x04, 0x0a, 0xb5, 0x04, 0x01, 0xff }; + + const u8_t arp_resp[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, /* DEST */ + 0x00, 0x22, 0x93, 0x5a, 0xf7, 0x60, /* SRC */ + 0x08, 0x06, /* Type: ARP */ + 0x00, 0x01, /* HW: Ethernet */ + 0x08, 0x00, /* PROTO: IP */ + 0x06, /* HW size */ + 0x04, /* PROTO size */ + 0x00, 0x02, /* OPCODE: Reply */ + + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xab, /* Target MAC */ + 0x4f, 0x8a, 0x32, 0x01, /* Target IP */ + + 0x00, 0x23, 0xc1, 0x00, 0x06, 0x50, /* src mac */ + 0x4f, 0x8a, 0x33, 0x05, /* src ip */ + + /* Padding follows.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; + + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + int i; + u32_t xid; + LWIP_UNUSED_ARG(_i); + + tcase = TEST_LWIP_DHCP_RELAY; + setdebug(0); + + IP4_ADDR(&addr, 0, 0, 0, 0); + IP4_ADDR(&netmask, 0, 0, 0, 0); + IP4_ADDR(&gw, 0, 0, 0, 0); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + + dhcp_start(&net_test); + + fail_unless(txpacket == 1); /* DHCP discover sent */ + + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + fail_unless(txpacket == 1); /* Nothing more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); + memcpy(&relay_offer[46], &xid, 4); /* insert correct transaction id */ + send_pkt(&net_test, relay_offer, sizeof(relay_offer)); + + /* request sent? */ + fail_unless(txpacket == 2, "txpkt = %d, should be 2", txpacket); + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + memcpy(&relay_ack1[46], &xid, 4); /* insert transaction id */ + send_pkt(&net_test, relay_ack1, sizeof(relay_ack1)); + + for (i = 0; i < 25; i++) { + tick_lwip(); + } + fail_unless(txpacket == 5, "txpkt should be 5, is %d", txpacket); /* ARP requests sent */ + + /* Interface up */ + fail_unless(netif_is_up(&net_test)); + + /* Now it should have taken the IP */ + IP4_ADDR(&addr, 79, 138, 51, 5); + IP4_ADDR(&netmask, 255, 255, 254, 0); + IP4_ADDR(&gw, 79, 138, 50, 1); + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + fail_unless(txpacket == 5, "txpacket = %d", txpacket); + + for (i = 0; i < 108000 - 25; i++) { + tick_lwip(); + } + + fail_unless(netif_is_up(&net_test)); + fail_unless(txpacket == 6, "txpacket = %d", txpacket); + + /* We need to send arp response here.. */ + + send_pkt(&net_test, arp_resp, sizeof(arp_resp)); + + fail_unless(txpacket == 7, "txpacket = %d", txpacket); + fail_unless(netif_is_up(&net_test)); + + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + memcpy(&relay_ack2[46], &xid, 4); /* insert transaction id */ + send_pkt(&net_test, relay_ack2, sizeof(relay_ack2)); + + for (i = 0; i < 100000; i++) { + tick_lwip(); + } + + fail_unless(txpacket == 7, "txpacket = %d", txpacket); + + netif_remove(&net_test); + +} +END_TEST + +START_TEST(test_dhcp_nak_no_endmarker) +{ + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + + u8_t dhcp_nack_no_endmarker[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x54, 0x75, + 0xd0, 0x26, 0xd0, 0x0d, 0x08, 0x00, 0x45, 0x00, + 0x01, 0x15, 0x38, 0x86, 0x00, 0x00, 0xff, 0x11, + 0xc0, 0xa8, 0xc0, 0xa8, 0x01, 0x01, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x01, + 0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x7a, 0xcb, + 0xba, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, + 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, + 0x53, 0x63, 0x35, 0x01, 0x06, 0x36, 0x04, 0xc0, + 0xa8, 0x01, 0x01, 0x31, 0xef, 0xad, 0x72, 0x31, + 0x43, 0x4e, 0x44, 0x30, 0x32, 0x35, 0x30, 0x43, + 0x52, 0x47, 0x44, 0x38, 0x35, 0x36, 0x3c, 0x08, + 0x4d, 0x53, 0x46, 0x54, 0x20, 0x35, 0x2e, 0x30, + 0x37, 0x0d, 0x01, 0x0f, 0x03, 0x06, 0x2c, 0x2e, + 0x2f, 0x1f, 0x21, 0x79, 0xf9, 0x2b, 0xfc, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x71, + 0xf3, 0x5b, 0xe2, 0x71, 0x2e, 0x01, 0x08, 0x03, + 0x04, 0xc0, 0xa8, 0x01, 0x01, 0xff, 0xeb, 0x1e, + 0x44, 0xec, 0xeb, 0x1e, 0x30, 0x37, 0x0c, 0x01, + 0x0f, 0x03, 0x06, 0x2c, 0x2e, 0x2f, 0x1f, 0x21, + 0x79, 0xf9, 0x2b, 0xff, 0x25, 0xc0, 0x09, 0xd6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + u32_t xid; + LWIP_UNUSED_ARG(_i); + + tcase = TEST_LWIP_DHCP_NAK_NO_ENDMARKER; + setdebug(0); + + IP4_ADDR(&addr, 0, 0, 0, 0); + IP4_ADDR(&netmask, 0, 0, 0, 0); + IP4_ADDR(&gw, 0, 0, 0, 0); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + + dhcp_start(&net_test); + + fail_unless(txpacket == 1); /* DHCP discover sent */ + xid = netif_dhcp_data(&net_test)->xid; /* Write bad xid, not using htonl! */ + memcpy(&dhcp_offer[46], &xid, 4); + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + + fail_unless(txpacket == 1); /* Nothing more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); + memcpy(&dhcp_offer[46], &xid, 4); /* insert correct transaction id */ + send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); + + fail_unless(netif_dhcp_data(&net_test)->state == DHCP_STATE_REQUESTING); + + fail_unless(txpacket == 2); /* No more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + memcpy(&dhcp_nack_no_endmarker[46], &xid, 4); /* insert transaction id */ + send_pkt(&net_test, dhcp_nack_no_endmarker, sizeof(dhcp_nack_no_endmarker)); + + /* NAK should put us in another state for a while, no other way detecting it */ + fail_unless(netif_dhcp_data(&net_test)->state != DHCP_STATE_REQUESTING); + + netif_remove(&net_test); +} +END_TEST + +START_TEST(test_dhcp_invalid_overload) +{ + u8_t dhcp_offer_invalid_overload[] = { + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, /* To unit */ + 0x00, 0x0F, 0xEE, 0x30, 0xAB, 0x22, /* From Remote host */ + 0x08, 0x00, /* Protocol: IP */ + 0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x36, 0xcc, 0xc3, 0xaa, 0xbd, 0xab, 0xc3, 0xaa, 0xbd, 0xc8, /* IP header */ + 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x00, 0x00, /* UDP header */ + + 0x02, /* Type == Boot reply */ + 0x01, 0x06, /* Hw Ethernet, 6 bytes addrlen */ + 0x00, /* 0 hops */ + 0xAA, 0xAA, 0xAA, 0xAA, /* Transaction id, will be overwritten */ + 0x00, 0x00, /* 0 seconds elapsed */ + 0x00, 0x00, /* Flags (unicast) */ + 0x00, 0x00, 0x00, 0x00, /* Client ip */ + 0xc3, 0xaa, 0xbd, 0xc8, /* Your IP */ + 0xc3, 0xaa, 0xbd, 0xab, /* DHCP server ip */ + 0x00, 0x00, 0x00, 0x00, /* relay agent */ + 0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MAC addr + padding */ + + /* Empty server name */ + 0x34, 0x01, 0x02, 0xff, /* Overload: SNAME + END */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* Empty boot file name */ + 0x34, 0x01, 0x01, 0xff, /* Overload FILE + END */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x63, 0x82, 0x53, 0x63, /* Magic cookie */ + 0x35, 0x01, 0x02, /* Message type: Offer */ + 0x36, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* Server identifier (IP) */ + 0x33, 0x04, 0x00, 0x00, 0x00, 0x78, /* Lease time 2 minutes */ + 0x03, 0x04, 0xc3, 0xaa, 0xbd, 0xab, /* Router IP */ + 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet mask */ + 0x34, 0x01, 0x03, /* Overload: FILE + SNAME */ + 0xff, /* End option */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Padding */ + }; + ip4_addr_t addr; + ip4_addr_t netmask; + ip4_addr_t gw; + u32_t xid; + LWIP_UNUSED_ARG(_i); + + tcase = TEST_LWIP_DHCP_INVALID_OVERLOAD; + setdebug(0); + + IP4_ADDR(&addr, 0, 0, 0, 0); + IP4_ADDR(&netmask, 0, 0, 0, 0); + IP4_ADDR(&gw, 0, 0, 0, 0); + + netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); + netif_set_up(&net_test); + + dhcp_start(&net_test); + + fail_unless(txpacket == 1); /* DHCP discover sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); + memcpy(&dhcp_offer_invalid_overload[46], &xid, 4); /* insert correct transaction id */ + dhcp_offer_invalid_overload[311] = 3; + send_pkt(&net_test, dhcp_offer_invalid_overload, sizeof(dhcp_offer_invalid_overload)); + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + fail_unless(txpacket == 1); /* Nothing more sent */ + + dhcp_offer_invalid_overload[311] = 2; + send_pkt(&net_test, dhcp_offer_invalid_overload, sizeof(dhcp_offer_invalid_overload)); + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + fail_unless(txpacket == 1); /* Nothing more sent */ + + dhcp_offer_invalid_overload[311] = 1; + send_pkt(&net_test, dhcp_offer_invalid_overload, sizeof(dhcp_offer_invalid_overload)); + /* IP addresses should be zero */ + fail_if(memcmp(&addr, &net_test.ip_addr, sizeof(ip4_addr_t))); + fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); + fail_if(memcmp(&gw, &net_test.gw, sizeof(ip4_addr_t))); + fail_unless(txpacket == 1); /* Nothing more sent */ + + dhcp_offer_invalid_overload[311] = 0; + send_pkt(&net_test, dhcp_offer_invalid_overload, sizeof(dhcp_offer)); + + fail_unless(netif_dhcp_data(&net_test)->state == DHCP_STATE_REQUESTING); + + fail_unless(txpacket == 2); /* No more sent */ + xid = htonl(netif_dhcp_data(&net_test)->xid); /* xid updated */ + + netif_remove(&net_test); +} +END_TEST + +/** Create the suite including all tests for this module */ +Suite * +dhcp_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_dhcp), + TESTFUNC(test_dhcp_nak), + TESTFUNC(test_dhcp_relayed), + TESTFUNC(test_dhcp_nak_no_endmarker), + TESTFUNC(test_dhcp_invalid_overload) + }; + return create_suite("DHCP", tests, sizeof(tests)/sizeof(testfunc), dhcp_setup, dhcp_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.h new file mode 100644 index 0000000..0d88fa1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/dhcp/test_dhcp.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_DHCP_H +#define LWIP_HDR_TEST_DHCP_H + +#include "../lwip_check.h" + +Suite* dhcp_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.c new file mode 100644 index 0000000..59d73b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.c @@ -0,0 +1,269 @@ +#include "test_etharp.h" + +#include "lwip/udp.h" +#include "lwip/etharp.h" +#include "netif/ethernet.h" +#include "lwip/stats.h" + +#if !LWIP_STATS || !UDP_STATS || !MEMP_STATS || !ETHARP_STATS +#error "This tests needs UDP-, MEMP- and ETHARP-statistics enabled" +#endif +#if !ETHARP_SUPPORT_STATIC_ENTRIES +#error "This test needs ETHARP_SUPPORT_STATIC_ENTRIES enabled" +#endif + +static struct netif test_netif; +static ip4_addr_t test_ipaddr, test_netmask, test_gw; +struct eth_addr test_ethaddr = {{1,1,1,1,1,1}}; +struct eth_addr test_ethaddr2 = {{1,1,1,1,1,2}}; +struct eth_addr test_ethaddr3 = {{1,1,1,1,1,3}}; +struct eth_addr test_ethaddr4 = {{1,1,1,1,1,4}}; +static int linkoutput_ctr; + +/* Helper functions */ +static void +etharp_remove_all(void) +{ + int i; + /* call etharp_tmr often enough to have all entries cleaned */ + for(i = 0; i < 0xff; i++) { + etharp_tmr(); + } +} + +static err_t +default_netif_linkoutput(struct netif *netif, struct pbuf *p) +{ + fail_unless(netif == &test_netif); + fail_unless(p != NULL); + linkoutput_ctr++; + return ERR_OK; +} + +static err_t +default_netif_init(struct netif *netif) +{ + fail_unless(netif != NULL); + netif->linkoutput = default_netif_linkoutput; + netif->output = etharp_output; + netif->mtu = 1500; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + netif->hwaddr_len = ETHARP_HWADDR_LEN; + return ERR_OK; +} + +static void +default_netif_add(void) +{ + IP4_ADDR(&test_gw, 192,168,0,1); + IP4_ADDR(&test_ipaddr, 192,168,0,1); + IP4_ADDR(&test_netmask, 255,255,0,0); + + fail_unless(netif_default == NULL); + netif_set_default(netif_add(&test_netif, &test_ipaddr, &test_netmask, + &test_gw, NULL, default_netif_init, NULL)); + netif_set_up(&test_netif); +} + +static void +default_netif_remove(void) +{ + fail_unless(netif_default == &test_netif); + netif_remove(&test_netif); +} + +static void +create_arp_response(ip4_addr_t *adr) +{ + int k; + struct eth_hdr *ethhdr; + struct etharp_hdr *etharphdr; + struct pbuf *p = pbuf_alloc(PBUF_RAW, sizeof(struct eth_hdr) + sizeof(struct etharp_hdr), PBUF_RAM); + if(p == NULL) { + FAIL_RET(); + } + ethhdr = (struct eth_hdr*)p->payload; + etharphdr = (struct etharp_hdr*)(ethhdr + 1); + + ethhdr->dest = test_ethaddr; + ethhdr->src = test_ethaddr2; + ethhdr->type = htons(ETHTYPE_ARP); + + etharphdr->hwtype = htons(/*HWTYPE_ETHERNET*/ 1); + etharphdr->proto = htons(ETHTYPE_IP); + etharphdr->hwlen = ETHARP_HWADDR_LEN; + etharphdr->protolen = sizeof(ip4_addr_t); + etharphdr->opcode = htons(ARP_REPLY); + + SMEMCPY(ðarphdr->sipaddr, adr, sizeof(ip4_addr_t)); + SMEMCPY(ðarphdr->dipaddr, &test_ipaddr, sizeof(ip4_addr_t)); + + k = 6; + while(k > 0) { + k--; + /* Write the ARP MAC-Addresses */ + etharphdr->shwaddr.addr[k] = test_ethaddr2.addr[k]; + etharphdr->dhwaddr.addr[k] = test_ethaddr.addr[k]; + /* Write the Ethernet MAC-Addresses */ + ethhdr->dest.addr[k] = test_ethaddr.addr[k]; + ethhdr->src.addr[k] = test_ethaddr2.addr[k]; + } + + ethernet_input(p, &test_netif); +} + +/* Setups/teardown functions */ + +static void +etharp_setup(void) +{ + etharp_remove_all(); + default_netif_add(); +} + +static void +etharp_teardown(void) +{ + etharp_remove_all(); + default_netif_remove(); +} + + +/* Test functions */ + +START_TEST(test_etharp_table) +{ +#if ETHARP_SUPPORT_STATIC_ENTRIES + err_t err; +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + s8_t idx; + const ip4_addr_t *unused_ipaddr; + struct eth_addr *unused_ethaddr; + struct udp_pcb* pcb; + LWIP_UNUSED_ARG(_i); + + if (netif_default != &test_netif) { + fail("This test needs a default netif"); + } + + linkoutput_ctr = 0; + + pcb = udp_new(); + fail_unless(pcb != NULL); + if (pcb != NULL) { + ip4_addr_t adrs[ARP_TABLE_SIZE + 2]; + int i; + for(i = 0; i < ARP_TABLE_SIZE + 2; i++) { + IP4_ADDR(&adrs[i], 192,168,0,i+2); + } + /* fill ARP-table with dynamic entries */ + for(i = 0; i < ARP_TABLE_SIZE; i++) { + struct pbuf *p = pbuf_alloc(PBUF_TRANSPORT, 10, PBUF_RAM); + fail_unless(p != NULL); + if (p != NULL) { + err_t err2; + ip_addr_t dst; + ip_addr_copy_from_ip4(dst, adrs[i]); + err2 = udp_sendto(pcb, p, &dst, 123); + fail_unless(err2 == ERR_OK); + /* etharp request sent? */ + fail_unless(linkoutput_ctr == (2*i) + 1); + pbuf_free(p); + + /* create an ARP response */ + create_arp_response(&adrs[i]); + /* queued UDP packet sent? */ + fail_unless(linkoutput_ctr == (2*i) + 2); + + idx = etharp_find_addr(NULL, &adrs[i], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == i); + etharp_tmr(); + } + } + linkoutput_ctr = 0; +#if ETHARP_SUPPORT_STATIC_ENTRIES + /* create one static entry */ + err = etharp_add_static_entry(&adrs[ARP_TABLE_SIZE], &test_ethaddr3); + fail_unless(err == ERR_OK); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == 0); + fail_unless(linkoutput_ctr == 0); +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + + linkoutput_ctr = 0; + /* fill ARP-table with dynamic entries */ + for(i = 0; i < ARP_TABLE_SIZE; i++) { + struct pbuf *p = pbuf_alloc(PBUF_TRANSPORT, 10, PBUF_RAM); + fail_unless(p != NULL); + if (p != NULL) { + err_t err2; + ip_addr_t dst; + ip_addr_copy_from_ip4(dst, adrs[i]); + err2 = udp_sendto(pcb, p, &dst, 123); + fail_unless(err2 == ERR_OK); + /* etharp request sent? */ + fail_unless(linkoutput_ctr == (2*i) + 1); + pbuf_free(p); + + /* create an ARP response */ + create_arp_response(&adrs[i]); + /* queued UDP packet sent? */ + fail_unless(linkoutput_ctr == (2*i) + 2); + + idx = etharp_find_addr(NULL, &adrs[i], &unused_ethaddr, &unused_ipaddr); + if (i < ARP_TABLE_SIZE - 1) { + fail_unless(idx == i+1); + } else { + /* the last entry must not overwrite the static entry! */ + fail_unless(idx == 1); + } + etharp_tmr(); + } + } +#if ETHARP_SUPPORT_STATIC_ENTRIES + /* create a second static entry */ + err = etharp_add_static_entry(&adrs[ARP_TABLE_SIZE+1], &test_ethaddr4); + fail_unless(err == ERR_OK); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == 0); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE+1], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == 2); + /* and remove it again */ + err = etharp_remove_static_entry(&adrs[ARP_TABLE_SIZE+1]); + fail_unless(err == ERR_OK); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == 0); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE+1], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == -1); +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + + /* check that static entries don't time out */ + etharp_remove_all(); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == 0); + +#if ETHARP_SUPPORT_STATIC_ENTRIES + /* remove the first static entry */ + err = etharp_remove_static_entry(&adrs[ARP_TABLE_SIZE]); + fail_unless(err == ERR_OK); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == -1); + idx = etharp_find_addr(NULL, &adrs[ARP_TABLE_SIZE+1], &unused_ethaddr, &unused_ipaddr); + fail_unless(idx == -1); +#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ + + udp_remove(pcb); + } +} +END_TEST + + +/** Create the suite including all tests for this module */ +Suite * +etharp_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_etharp_table) + }; + return create_suite("ETHARP", tests, sizeof(tests)/sizeof(testfunc), etharp_setup, etharp_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.h new file mode 100644 index 0000000..2dd772d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/etharp/test_etharp.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_ETHARP_H +#define LWIP_HDR_TEST_ETHARP_H + +#include "../lwip_check.h" + +Suite* etharp_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_check.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_check.h new file mode 100644 index 0000000..0c218d1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_check.h @@ -0,0 +1,37 @@ +#ifndef LWIP_HDR_LWIP_CHECK_H +#define LWIP_HDR_LWIP_CHECK_H + +/* Common header file for lwIP unit tests using the check framework */ + +#include +#include +#include + +#define FAIL_RET() do { fail(); return; } while(0) +#define EXPECT(x) fail_unless(x) +#define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) +#define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) +#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) + +typedef struct { + TFun func; + const char *name; +} testfunc; + +#define TESTFUNC(x) {(x), "" # x "" } + +/* Modified function from check.h, supplying function name */ +#define tcase_add_named_test(tc,tf) \ + _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1) + +/** typedef for a function returning a test suite */ +typedef Suite* (suite_getter_fn)(void); + +/** Create a test suite */ +Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown); + +#ifdef LWIP_UNITTESTS_LIB +int lwip_unittests_run(void) +#endif + +#endif /* LWIP_HDR_LWIP_CHECK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_unittests.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_unittests.c new file mode 100644 index 0000000..46fd430 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwip_unittests.c @@ -0,0 +1,70 @@ +#include "lwip_check.h" + +#include "udp/test_udp.h" +#include "tcp/test_tcp.h" +#include "tcp/test_tcp_oos.h" +#include "core/test_mem.h" +#include "core/test_pbuf.h" +#include "etharp/test_etharp.h" +#include "dhcp/test_dhcp.h" +#include "mdns/test_mdns.h" + +#include "lwip/init.h" + +Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown) +{ + size_t i; + Suite *s = suite_create(name); + + for(i = 0; i < num_tests; i++) { + TCase *tc_core = tcase_create(name); + if ((setup != NULL) || (teardown != NULL)) { + tcase_add_checked_fixture(tc_core, setup, teardown); + } + tcase_add_named_test(tc_core, tests[i]); + suite_add_tcase(s, tc_core); + } + return s; +} + +#ifdef LWIP_UNITTESTS_LIB +int lwip_unittests_run(void) +#else +int main(void) +#endif +{ + int number_failed; + SRunner *sr; + size_t i; + suite_getter_fn* suites[] = { + udp_suite, + tcp_suite, + tcp_oos_suite, + mem_suite, + pbuf_suite, + etharp_suite, + dhcp_suite, + mdns_suite + }; + size_t num = sizeof(suites)/sizeof(void*); + LWIP_ASSERT("No suites defined", num > 0); + + lwip_init(); + + sr = srunner_create((suites[0])()); + for(i = 1; i < num; i++) { + srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); + } + +#ifdef LWIP_UNITTESTS_NOFORK + srunner_set_fork_status(sr, CK_NOFORK); +#endif +#ifdef LWIP_UNITTESTS_FORK + srunner_set_fork_status(sr, CK_FORK); +#endif + + srunner_run_all(sr, CK_NORMAL); + number_failed = srunner_ntests_failed(sr); + srunner_free(sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwipopts.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwipopts.h new file mode 100644 index 0000000..25252b4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/lwipopts.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Simon Goldschmidt + * + */ +#ifndef LWIP_HDR_LWIPOPTS_H +#define LWIP_HDR_LWIPOPTS_H + +/* Prevent having to link sys_arch.c (we don't test the API layers in unit tests) */ +#define NO_SYS 1 +#define SYS_LIGHTWEIGHT_PROT 0 +#define LWIP_NETCONN 0 +#define LWIP_SOCKET 0 + +/* Enable DHCP to test it, disable UDP checksum to easier inject packets */ +#define LWIP_DHCP 1 + +/* Minimal changes to opt.h required for tcp unit tests: */ +#define MEM_SIZE 16000 +#define TCP_SND_QUEUELEN 40 +#define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN +#define TCP_SND_BUF (12 * TCP_MSS) +#define TCP_WND (10 * TCP_MSS) +#define LWIP_WND_SCALE 1 +#define TCP_RCV_SCALE 0 +#define PBUF_POOL_SIZE 400 /* pbuf tests need ~200KByte */ + +/* Enable IGMP and MDNS for MDNS tests */ +#define LWIP_IGMP 1 +#define LWIP_MDNS_RESPONDER 1 +#define LWIP_NUM_NETIF_CLIENT_DATA (LWIP_MDNS_RESPONDER) + +/* Minimal changes to opt.h required for etharp unit tests: */ +#define ETHARP_SUPPORT_STATIC_ENTRIES 1 + +#endif /* LWIP_HDR_LWIPOPTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.c new file mode 100644 index 0000000..ca9be64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.c @@ -0,0 +1,915 @@ +/* + * Copyright (c) 2015 Verisure Innovation AB + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Erik Ekman + * + */ + +#include "test_mdns.h" + +#include "lwip/pbuf.h" +#include "lwip/apps/mdns.h" +#include "lwip/apps/mdns_priv.h" + +START_TEST(readname_basic) +{ + static const u8_t data[] = { 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00 }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == sizeof(data)); + fail_unless(domain.length == sizeof(data)); + fail_if(memcmp(&domain.name, data, sizeof(data))); +} +END_TEST + +START_TEST(readname_anydata) +{ + static const u8_t data[] = { 0x05, 0x00, 0xFF, 0x08, 0xc0, 0x0f, 0x04, 0x7f, 0x80, 0x82, 0x88, 0x00 }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == sizeof(data)); + fail_unless(domain.length == sizeof(data)); + fail_if(memcmp(&domain.name, data, sizeof(data))); +} +END_TEST + +START_TEST(readname_short_buf) +{ + static const u8_t data[] = { 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a' }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_long_label) +{ + static const u8_t data[] = { + 0x05, 'm', 'u', 'l', 't', 'i', + 0x52, 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_overflow) +{ + static const u8_t data[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_jump_earlier) +{ + static const u8_t data[] = { + /* Some padding needed, not supported to jump to bytes containing dns header */ + /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 10 */ 0x0f, 0x0e, 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xab, + /* 20 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x0c + }; + static const u8_t fullname[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 20, &domain); + pbuf_free(p); + fail_unless(offset == sizeof(data)); + fail_unless(domain.length == sizeof(fullname)); + + fail_if(memcmp(&domain.name, fullname, sizeof(fullname))); +} +END_TEST + +START_TEST(readname_jump_earlier_jump) +{ + static const u8_t data[] = { + /* Some padding needed, not supported to jump to bytes containing dns header */ + /* 0x00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x08 */ 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x0a, 0xf2, + /* 0x10 */ 0x04, 'c', 'a', 's', 't', 0x00, 0xc0, 0x10, + /* 0x18 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x16 + }; + static const u8_t fullname[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0x18, &domain); + pbuf_free(p); + fail_unless(offset == sizeof(data)); + fail_unless(domain.length == sizeof(fullname)); + + fail_if(memcmp(&domain.name, fullname, sizeof(fullname))); +} +END_TEST + +START_TEST(readname_jump_maxdepth) +{ + static const u8_t data[] = { + /* Some padding needed, not supported to jump to bytes containing dns header */ + /* 0x00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0x08 */ 0x00, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x0a, 0xf2, + /* 0x10 */ 0x04, 'n', 'a', 'm', 'e', 0xc0, 0x27, 0x03, + /* 0x18 */ 0x03, 'd', 'n', 's', 0xc0, 0x10, 0xc0, 0x10, + /* 0x20 */ 0x04, 'd', 'e', 'e', 'p', 0xc0, 0x18, 0x00, + /* 0x28 */ 0x04, 'c', 'a', 's', 't', 0xc0, 0x20, 0xb0, + /* 0x30 */ 0x05, 'm', 'u', 'l', 't', 'i', 0xc0, 0x28 + }; + static const u8_t fullname[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', + 0x04, 'd', 'e', 'e', 'p', 0x03, 'd', 'n', 's', + 0x04, 'n', 'a', 'm', 'e', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0x30, &domain); + pbuf_free(p); + fail_unless(offset == sizeof(data)); + fail_unless(domain.length == sizeof(fullname)); + + fail_if(memcmp(&domain.name, fullname, sizeof(fullname))); +} +END_TEST + +START_TEST(readname_jump_later) +{ + static const u8_t data[] = { + /* 0x00 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x10, 0x00, 0x01, 0x40, + /* 0x10 */ 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xab + }; + static const u8_t fullname[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == 13); + fail_unless(domain.length == sizeof(fullname)); + + fail_if(memcmp(&domain.name, fullname, sizeof(fullname))); +} +END_TEST + +START_TEST(readname_half_jump) +{ + static const u8_t data[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_jump_toolong) +{ + static const u8_t data[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc2, 0x10, 0x00, 0x01, 0x40 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 0, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_jump_loop_label) +{ + static const u8_t data[] = { + /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x10 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 10, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(readname_jump_loop_jump) +{ + static const u8_t data[] = { + /* 0 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 10 */ 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0xc0, 0x15 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + offset = mdns_readname(p, 10, &domain); + pbuf_free(p); + fail_unless(offset == MDNS_READNAME_ERROR); +} +END_TEST + +START_TEST(add_label_basic) +{ + static const u8_t data[] = { 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00 }; + struct mdns_domain domain; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + fail_unless(domain.length == sizeof(data)); + fail_if(memcmp(&domain.name, data, sizeof(data))); +} +END_TEST + +START_TEST(add_label_long_label) +{ + static const char *toolong = "abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-abcdefghijklmnopqrstuvwxyz0123456789-"; + struct mdns_domain domain; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, toolong, (u8_t)strlen(toolong)); + fail_unless(res == ERR_VAL); +} +END_TEST + +START_TEST(add_label_full) +{ + static const char *label = "0123456789abcdef0123456789abcdef"; + struct mdns_domain domain; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 33); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 66); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 99); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 132); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 165); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 198); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 231); + res = mdns_domain_add_label(&domain, label, (u8_t)strlen(label)); + fail_unless(res == ERR_VAL); + fail_unless(domain.length == 231); + res = mdns_domain_add_label(&domain, label, 25); + fail_unless(res == ERR_VAL); + fail_unless(domain.length == 231); + res = mdns_domain_add_label(&domain, label, 24); + fail_unless(res == ERR_VAL); + fail_unless(domain.length == 231); + res = mdns_domain_add_label(&domain, label, 23); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 255); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + fail_unless(domain.length == 256); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_VAL); + fail_unless(domain.length == 256); +} +END_TEST + +START_TEST(domain_eq_basic) +{ + static const u8_t data[] = { + 0x05, 'm', 'u', 'l', 't', 'i', 0x04, 'c', 'a', 's', 't', 0x00 + }; + struct mdns_domain domain1, domain2; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain1, 0, sizeof(domain1)); + res = mdns_domain_add_label(&domain1, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, NULL, 0); + fail_unless(res == ERR_OK); + fail_unless(domain1.length == sizeof(data)); + + memset(&domain2, 0, sizeof(domain2)); + res = mdns_domain_add_label(&domain2, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, NULL, 0); + fail_unless(res == ERR_OK); + + fail_unless(mdns_domain_eq(&domain1, &domain2)); +} +END_TEST + +START_TEST(domain_eq_diff) +{ + struct mdns_domain domain1, domain2; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain1, 0, sizeof(domain1)); + res = mdns_domain_add_label(&domain1, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, "base", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, NULL, 0); + fail_unless(res == ERR_OK); + + memset(&domain2, 0, sizeof(domain2)); + res = mdns_domain_add_label(&domain2, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, NULL, 0); + fail_unless(res == ERR_OK); + + fail_if(mdns_domain_eq(&domain1, &domain2)); +} +END_TEST + +START_TEST(domain_eq_case) +{ + struct mdns_domain domain1, domain2; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain1, 0, sizeof(domain1)); + res = mdns_domain_add_label(&domain1, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, NULL, 0); + fail_unless(res == ERR_OK); + + memset(&domain2, 0, sizeof(domain2)); + res = mdns_domain_add_label(&domain2, "MulTI", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, "casT", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, NULL, 0); + fail_unless(res == ERR_OK); + + fail_unless(mdns_domain_eq(&domain1, &domain2)); +} +END_TEST + +START_TEST(domain_eq_anydata) +{ + static const u8_t data1[] = { 0x05, 0xcc, 0xdc, 0x00, 0xa0 }; + static const u8_t data2[] = { 0x7f, 0x8c, 0x01, 0xff, 0xcf }; + struct mdns_domain domain1, domain2; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain1, 0, sizeof(domain1)); + res = mdns_domain_add_label(&domain1, (const char*)data1, sizeof(data1)); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, "cast", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, (const char*)data2, sizeof(data2)); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, NULL, 0); + fail_unless(res == ERR_OK); + + memset(&domain2, 0, sizeof(domain2)); + res = mdns_domain_add_label(&domain2, (const char*)data1, sizeof(data1)); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, "casT", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, (const char*)data2, sizeof(data2)); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, NULL, 0); + fail_unless(res == ERR_OK); + + fail_unless(mdns_domain_eq(&domain1, &domain2)); +} +END_TEST + +START_TEST(domain_eq_length) +{ + struct mdns_domain domain1, domain2; + err_t res; + LWIP_UNUSED_ARG(_i); + + memset(&domain1, 0, sizeof(domain1)); + memset(domain1.name, 0xAA, sizeof(MDNS_DOMAIN_MAXLEN)); + res = mdns_domain_add_label(&domain1, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain1, "cast", 4); + fail_unless(res == ERR_OK); + + memset(&domain2, 0, sizeof(domain2)); + memset(domain2.name, 0xBB, sizeof(MDNS_DOMAIN_MAXLEN)); + res = mdns_domain_add_label(&domain2, "multi", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain2, "cast", 4); + fail_unless(res == ERR_OK); + + fail_unless(mdns_domain_eq(&domain1, &domain2)); +} +END_TEST + +START_TEST(compress_full_match) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 0 bytes, then a jump to addr 2 */ + fail_unless(length == 0); + fail_unless(offset == 2); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_full_match_subset) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x02, 'g', 'o', 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 0 bytes, then a jump to addr 5 */ + fail_unless(length == 0); + fail_unless(offset == 5); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_full_match_jump) +{ + static const u8_t data[] = { + /* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + /* 0x10 */ 0x04, 'l', 'w', 'i', 'p', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xc0, 0x00, 0x02, 0x00, + /* 0x20 */ 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0xc0, 0x15 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 0x20; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 0 bytes, then a jump to addr 0x20 */ + fail_unless(length == 0); + fail_unless(offset == 0x20); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_no_match) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x04, 'l', 'w', 'i', 'p', 0x05, 'w', 'i', 'k', 'i', 'a', 0x03, 'c', 'o', 'm', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + /* Write all bytes, no jump */ + fail_unless(length == domain.length); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_2nd_label) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "lwip", 4); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 5 bytes, then a jump to addr 9 */ + fail_unless(length == 5); + fail_unless(offset == 9); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_2nd_label_short) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x04, 'l', 'w', 'i', 'p', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 5 bytes, then a jump to addr 7 */ + fail_unless(length == 7); + fail_unless(offset == 7); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_jump_to_jump) +{ + static const u8_t data[] = { + /* 0x00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + /* 0x10 */ 0x04, 'l', 'w', 'i', 'p', 0x05, 'l', 'o', 'c', 'a', 'l', 0x00, 0xc0, 0x00, 0x02, 0x00, + /* 0x20 */ 0x07, 'b', 'a', 'n', 'a', 'n', 'a', 's', 0xc0, 0x15 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 0x20; + length = mdns_compress_domain(p, &offset, &domain); + /* Dont compress if jump would be to a jump */ + fail_unless(length == domain.length); + + offset = 0x10; + length = mdns_compress_domain(p, &offset, &domain); + /* Write 7 bytes, then a jump to addr 0x15 */ + fail_unless(length == 7); + fail_unless(offset == 0x15); + + pbuf_free(p); +} +END_TEST + +START_TEST(compress_long_match) +{ + static const u8_t data[] = { + 0x00, 0x00, + 0x06, 'f', 'o', 'o', 'b', 'a', 'r', 0x05, 'l', 'o', 'c', 'a', 'l', 0x03, 'c', 'o', 'm', 0x00 + }; + struct pbuf *p; + struct mdns_domain domain; + u16_t offset; + u16_t length; + err_t res; + LWIP_UNUSED_ARG(_i); + + p = pbuf_alloc(PBUF_RAW, sizeof(data), PBUF_ROM); + p->payload = (void *)(size_t)data; + fail_if(p == NULL); + + memset(&domain, 0, sizeof(domain)); + res = mdns_domain_add_label(&domain, "foobar", 6); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, "local", 5); + fail_unless(res == ERR_OK); + res = mdns_domain_add_label(&domain, NULL, 0); + fail_unless(res == ERR_OK); + + offset = 2; + length = mdns_compress_domain(p, &offset, &domain); + fail_unless(length == domain.length); + + pbuf_free(p); +} +END_TEST + +Suite* mdns_suite(void) +{ + testfunc tests[] = { + TESTFUNC(readname_basic), + TESTFUNC(readname_anydata), + TESTFUNC(readname_short_buf), + TESTFUNC(readname_long_label), + TESTFUNC(readname_overflow), + TESTFUNC(readname_jump_earlier), + TESTFUNC(readname_jump_earlier_jump), + TESTFUNC(readname_jump_maxdepth), + TESTFUNC(readname_jump_later), + TESTFUNC(readname_half_jump), + TESTFUNC(readname_jump_toolong), + TESTFUNC(readname_jump_loop_label), + TESTFUNC(readname_jump_loop_jump), + + TESTFUNC(add_label_basic), + TESTFUNC(add_label_long_label), + TESTFUNC(add_label_full), + + TESTFUNC(domain_eq_basic), + TESTFUNC(domain_eq_diff), + TESTFUNC(domain_eq_case), + TESTFUNC(domain_eq_anydata), + TESTFUNC(domain_eq_length), + + TESTFUNC(compress_full_match), + TESTFUNC(compress_full_match_subset), + TESTFUNC(compress_full_match_jump), + TESTFUNC(compress_no_match), + TESTFUNC(compress_2nd_label), + TESTFUNC(compress_2nd_label_short), + TESTFUNC(compress_jump_to_jump), + TESTFUNC(compress_long_match), + }; + return create_suite("MDNS", tests, sizeof(tests)/sizeof(testfunc), NULL, NULL); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.h new file mode 100644 index 0000000..c3df339 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/mdns/test_mdns.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_MDNS_H__ +#define LWIP_HDR_TEST_MDNS_H__ + +#include "../lwip_check.h" + +Suite* mdns_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.c new file mode 100644 index 0000000..64121ca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.c @@ -0,0 +1,314 @@ +#include "tcp_helper.h" + +#include "lwip/priv/tcp_priv.h" +#include "lwip/stats.h" +#include "lwip/pbuf.h" +#include "lwip/inet_chksum.h" +#include "lwip/ip_addr.h" + +#if !LWIP_STATS || !TCP_STATS || !MEMP_STATS +#error "This tests needs TCP- and MEMP-statistics enabled" +#endif + +/** Remove all pcbs on the given list. */ +static void +tcp_remove(struct tcp_pcb* pcb_list) +{ + struct tcp_pcb *pcb = pcb_list; + struct tcp_pcb *pcb2; + + while(pcb != NULL) { + pcb2 = pcb; + pcb = pcb->next; + tcp_abort(pcb2); + } +} + +/** Remove all pcbs on listen-, active- and time-wait-list (bound- isn't exported). */ +void +tcp_remove_all(void) +{ + tcp_remove(tcp_listen_pcbs.pcbs); + tcp_remove(tcp_active_pcbs); + tcp_remove(tcp_tw_pcbs); + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_PCB_LISTEN) == 0); + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_SEG) == 0); + fail_unless(MEMP_STATS_GET(used, MEMP_PBUF_POOL) == 0); +} + +/** Create a TCP segment usable for passing to tcp_input */ +static struct pbuf* +tcp_create_segment_wnd(ip_addr_t* src_ip, ip_addr_t* dst_ip, + u16_t src_port, u16_t dst_port, void* data, size_t data_len, + u32_t seqno, u32_t ackno, u8_t headerflags, u16_t wnd) +{ + struct pbuf *p, *q; + struct ip_hdr* iphdr; + struct tcp_hdr* tcphdr; + u16_t pbuf_len = (u16_t)(sizeof(struct ip_hdr) + sizeof(struct tcp_hdr) + data_len); + LWIP_ASSERT("data_len too big", data_len <= 0xFFFF); + + p = pbuf_alloc(PBUF_RAW, pbuf_len, PBUF_POOL); + EXPECT_RETNULL(p != NULL); + /* first pbuf must be big enough to hold the headers */ + EXPECT_RETNULL(p->len >= (sizeof(struct ip_hdr) + sizeof(struct tcp_hdr))); + if (data_len > 0) { + /* first pbuf must be big enough to hold at least 1 data byte, too */ + EXPECT_RETNULL(p->len > (sizeof(struct ip_hdr) + sizeof(struct tcp_hdr))); + } + + for(q = p; q != NULL; q = q->next) { + memset(q->payload, 0, q->len); + } + + iphdr = (struct ip_hdr*)p->payload; + /* fill IP header */ + iphdr->dest.addr = ip_2_ip4(dst_ip)->addr; + iphdr->src.addr = ip_2_ip4(src_ip)->addr; + IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); + IPH_TOS_SET(iphdr, 0); + IPH_LEN_SET(iphdr, htons(p->tot_len)); + IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); + + /* let p point to TCP header */ + pbuf_header(p, -(s16_t)sizeof(struct ip_hdr)); + + tcphdr = (struct tcp_hdr*)p->payload; + tcphdr->src = htons(src_port); + tcphdr->dest = htons(dst_port); + tcphdr->seqno = htonl(seqno); + tcphdr->ackno = htonl(ackno); + TCPH_HDRLEN_SET(tcphdr, sizeof(struct tcp_hdr)/4); + TCPH_FLAGS_SET(tcphdr, headerflags); + tcphdr->wnd = htons(wnd); + + if (data_len > 0) { + /* let p point to TCP data */ + pbuf_header(p, -(s16_t)sizeof(struct tcp_hdr)); + /* copy data */ + pbuf_take(p, data, (u16_t)data_len); + /* let p point to TCP header again */ + pbuf_header(p, sizeof(struct tcp_hdr)); + } + + /* calculate checksum */ + + tcphdr->chksum = ip_chksum_pseudo(p, + IP_PROTO_TCP, p->tot_len, src_ip, dst_ip); + + pbuf_header(p, sizeof(struct ip_hdr)); + + return p; +} + +/** Create a TCP segment usable for passing to tcp_input */ +struct pbuf* +tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, + u16_t src_port, u16_t dst_port, void* data, size_t data_len, + u32_t seqno, u32_t ackno, u8_t headerflags) +{ + return tcp_create_segment_wnd(src_ip, dst_ip, src_port, dst_port, data, + data_len, seqno, ackno, headerflags, TCP_WND); +} + +/** Create a TCP segment usable for passing to tcp_input + * - IP-addresses, ports, seqno and ackno are taken from pcb + * - seqno and ackno can be altered with an offset + */ +struct pbuf* +tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, u32_t seqno_offset, + u32_t ackno_offset, u8_t headerflags) +{ + return tcp_create_segment(&pcb->remote_ip, &pcb->local_ip, pcb->remote_port, pcb->local_port, + data, data_len, pcb->rcv_nxt + seqno_offset, pcb->lastack + ackno_offset, headerflags); +} + +/** Create a TCP segment usable for passing to tcp_input + * - IP-addresses, ports, seqno and ackno are taken from pcb + * - seqno and ackno can be altered with an offset + * - TCP window can be adjusted + */ +struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, + u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd) +{ + return tcp_create_segment_wnd(&pcb->remote_ip, &pcb->local_ip, pcb->remote_port, pcb->local_port, + data, data_len, pcb->rcv_nxt + seqno_offset, pcb->lastack + ackno_offset, headerflags, wnd); +} + +/** Safely bring a tcp_pcb into the requested state */ +void +tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, + ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port) +{ + u32_t iss; + + /* @todo: are these all states? */ + /* @todo: remove from previous list */ + pcb->state = state; + + iss = tcp_next_iss(pcb); + pcb->snd_wl2 = iss; + pcb->snd_nxt = iss; + pcb->lastack = iss; + pcb->snd_lbb = iss; + + if (state == ESTABLISHED) { + TCP_REG(&tcp_active_pcbs, pcb); + ip_addr_copy(pcb->local_ip, *local_ip); + pcb->local_port = local_port; + ip_addr_copy(pcb->remote_ip, *remote_ip); + pcb->remote_port = remote_port; + } else if(state == LISTEN) { + TCP_REG(&tcp_listen_pcbs.pcbs, pcb); + ip_addr_copy(pcb->local_ip, *local_ip); + pcb->local_port = local_port; + } else if(state == TIME_WAIT) { + TCP_REG(&tcp_tw_pcbs, pcb); + ip_addr_copy(pcb->local_ip, *local_ip); + pcb->local_port = local_port; + ip_addr_copy(pcb->remote_ip, *remote_ip); + pcb->remote_port = remote_port; + } else { + fail(); + } +} + +void +test_tcp_counters_err(void* arg, err_t err) +{ + struct test_tcp_counters* counters = (struct test_tcp_counters*)arg; + EXPECT_RET(arg != NULL); + counters->err_calls++; + counters->last_err = err; +} + +static void +test_tcp_counters_check_rxdata(struct test_tcp_counters* counters, struct pbuf* p) +{ + struct pbuf* q; + u32_t i, received; + if(counters->expected_data == NULL) { + /* no data to compare */ + return; + } + EXPECT_RET(counters->recved_bytes + p->tot_len <= counters->expected_data_len); + received = counters->recved_bytes; + for(q = p; q != NULL; q = q->next) { + char *data = (char*)q->payload; + for(i = 0; i < q->len; i++) { + EXPECT_RET(data[i] == counters->expected_data[received]); + received++; + } + } + EXPECT(received == counters->recved_bytes + p->tot_len); +} + +err_t +test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err) +{ + struct test_tcp_counters* counters = (struct test_tcp_counters*)arg; + EXPECT_RETX(arg != NULL, ERR_OK); + EXPECT_RETX(pcb != NULL, ERR_OK); + EXPECT_RETX(err == ERR_OK, ERR_OK); + + if (p != NULL) { + if (counters->close_calls == 0) { + counters->recv_calls++; + test_tcp_counters_check_rxdata(counters, p); + counters->recved_bytes += p->tot_len; + } else { + counters->recv_calls_after_close++; + counters->recved_bytes_after_close += p->tot_len; + } + pbuf_free(p); + } else { + counters->close_calls++; + } + EXPECT(counters->recv_calls_after_close == 0 && counters->recved_bytes_after_close == 0); + return ERR_OK; +} + +/** Allocate a pcb and set up the test_tcp_counters_* callbacks */ +struct tcp_pcb* +test_tcp_new_counters_pcb(struct test_tcp_counters* counters) +{ + struct tcp_pcb* pcb = tcp_new(); + if (pcb != NULL) { + /* set up args and callbacks */ + tcp_arg(pcb, counters); + tcp_recv(pcb, test_tcp_counters_recv); + tcp_err(pcb, test_tcp_counters_err); + pcb->snd_wnd = TCP_WND; + pcb->snd_wnd_max = TCP_WND; + } + return pcb; +} + +/** Calls tcp_input() after adjusting current_iphdr_dest */ +void test_tcp_input(struct pbuf *p, struct netif *inp) +{ + struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; + /* these lines are a hack, don't use them as an example :-) */ + ip_addr_copy_from_ip4(*ip_current_dest_addr(), iphdr->dest); + ip_addr_copy_from_ip4(*ip_current_src_addr(), iphdr->src); + ip_current_netif() = inp; + ip_data.current_ip4_header = iphdr; + + /* since adding IPv6, p->payload must point to tcp header, not ip header */ + pbuf_header(p, -(s16_t)sizeof(struct ip_hdr)); + + tcp_input(p, inp); + + ip_addr_set_zero(ip_current_dest_addr()); + ip_addr_set_zero(ip_current_src_addr()); + ip_current_netif() = NULL; + ip_data.current_ip4_header = NULL; +} + +static err_t test_tcp_netif_output(struct netif *netif, struct pbuf *p, + const ip4_addr_t *ipaddr) +{ + struct test_tcp_txcounters *txcounters = (struct test_tcp_txcounters*)netif->state; + LWIP_UNUSED_ARG(ipaddr); + if (txcounters != NULL) + { + txcounters->num_tx_calls++; + txcounters->num_tx_bytes += p->tot_len; + if (txcounters->copy_tx_packets) { + struct pbuf *p_copy = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM); + err_t err; + EXPECT(p_copy != NULL); + err = pbuf_copy(p_copy, p); + EXPECT(err == ERR_OK); + if (txcounters->tx_packets == NULL) { + txcounters->tx_packets = p_copy; + } else { + pbuf_cat(txcounters->tx_packets, p_copy); + } + } + } + return ERR_OK; +} + +void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, + ip_addr_t *ip_addr, ip_addr_t *netmask) +{ + struct netif *n; + memset(netif, 0, sizeof(struct netif)); + if (txcounters != NULL) { + memset(txcounters, 0, sizeof(struct test_tcp_txcounters)); + netif->state = txcounters; + } + netif->output = test_tcp_netif_output; + netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; + ip_addr_copy_from_ip4(netif->netmask, *ip_2_ip4(netmask)); + ip_addr_copy_from_ip4(netif->ip_addr, *ip_2_ip4(ip_addr)); + for (n = netif_list; n != NULL; n = n->next) { + if (n == netif) { + return; + } + } + netif->next = NULL; + netif_list = netif; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.h new file mode 100644 index 0000000..0497481 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/tcp_helper.h @@ -0,0 +1,52 @@ +#ifndef LWIP_HDR_TCP_HELPER_H +#define LWIP_HDR_TCP_HELPER_H + +#include "../lwip_check.h" +#include "lwip/arch.h" +#include "lwip/tcp.h" +#include "lwip/netif.h" + +/* counters used for test_tcp_counters_* callback functions */ +struct test_tcp_counters { + u32_t recv_calls; + u32_t recved_bytes; + u32_t recv_calls_after_close; + u32_t recved_bytes_after_close; + u32_t close_calls; + u32_t err_calls; + err_t last_err; + char* expected_data; + u32_t expected_data_len; +}; + +struct test_tcp_txcounters { + u32_t num_tx_calls; + u32_t num_tx_bytes; + u8_t copy_tx_packets; + struct pbuf *tx_packets; +}; + +/* Helper functions */ +void tcp_remove_all(void); + +struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, + u16_t src_port, u16_t dst_port, void* data, size_t data_len, + u32_t seqno, u32_t ackno, u8_t headerflags); +struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, + u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); +struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, + u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd); +void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, + ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); +void test_tcp_counters_err(void* arg, err_t err); +err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); + +struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); + +void test_tcp_input(struct pbuf *p, struct netif *inp); + +void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, + ip_addr_t *ip_addr, ip_addr_t *netmask); + + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.c new file mode 100644 index 0000000..d99b807 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.c @@ -0,0 +1,744 @@ +#include "test_tcp.h" + +#include "lwip/priv/tcp_priv.h" +#include "lwip/stats.h" +#include "tcp_helper.h" +#include "lwip/inet_chksum.h" + +#ifdef _MSC_VER +#pragma warning(disable: 4307) /* we explicitly wrap around TCP seqnos */ +#endif + +#if !LWIP_STATS || !TCP_STATS || !MEMP_STATS +#error "This tests needs TCP- and MEMP-statistics enabled" +#endif +#if TCP_SND_BUF <= TCP_WND +#error "This tests needs TCP_SND_BUF to be > TCP_WND" +#endif + +static u8_t test_tcp_timer; + +/* our own version of tcp_tmr so we can reset fast/slow timer state */ +static void +test_tcp_tmr(void) +{ + tcp_fasttmr(); + if (++test_tcp_timer & 1) { + tcp_slowtmr(); + } +} + +/* Setups/teardown functions */ + +static void +tcp_setup(void) +{ + /* reset iss to default (6510) */ + tcp_ticks = 0; + tcp_ticks = 0 - (tcp_next_iss(NULL) - 6510); + tcp_next_iss(NULL); + tcp_ticks = 0; + + test_tcp_timer = 0; + tcp_remove_all(); +} + +static void +tcp_teardown(void) +{ + netif_list = NULL; + netif_default = NULL; + tcp_remove_all(); +} + + +/* Test functions */ + +/** Call tcp_new() and tcp_abort() and test memp stats */ +START_TEST(test_tcp_new_abort) +{ + struct tcp_pcb* pcb; + LWIP_UNUSED_ARG(_i); + + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); + + pcb = tcp_new(); + fail_unless(pcb != NULL); + if (pcb != NULL) { + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + fail_unless(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); + } +} +END_TEST + +/** Create an ESTABLISHED pcb and check if receive callback is called */ +START_TEST(test_tcp_recv_inseq) +{ + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf* p; + char data[] = {1, 2, 3, 4}; + ip_addr_t remote_ip, local_ip, netmask; + u16_t data_len; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + struct test_tcp_txcounters txcounters; + LWIP_UNUSED_ARG(_i); + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + data_len = sizeof(data); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = data_len; + counters.expected_data = data; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + + /* create a segment */ + p = tcp_create_rx_segment(pcb, counters.expected_data, data_len, 0, 0, 0); + EXPECT(p != NULL); + if (p != NULL) { + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 1); + EXPECT(counters.recved_bytes == data_len); + EXPECT(counters.err_calls == 0); + } + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + +/** Check that we handle malformed tcp headers, and discard the pbuf(s) */ +START_TEST(test_tcp_malformed_header) +{ + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf* p; + char data[] = {1, 2, 3, 4}; + ip_addr_t remote_ip, local_ip, netmask; + u16_t data_len, chksum; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + struct test_tcp_txcounters txcounters; + struct tcp_hdr *hdr; + LWIP_UNUSED_ARG(_i); + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + data_len = sizeof(data); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = data_len; + counters.expected_data = data; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + + /* create a segment */ + p = tcp_create_rx_segment(pcb, counters.expected_data, data_len, 0, 0, 0); + + pbuf_header(p, -(s16_t)sizeof(struct ip_hdr)); + + hdr = (struct tcp_hdr *)p->payload; + TCPH_HDRLEN_FLAGS_SET(hdr, 15, 0x3d1); + + hdr->chksum = 0; + + chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len, + &remote_ip, &local_ip); + + hdr->chksum = chksum; + + pbuf_header(p, sizeof(struct ip_hdr)); + + EXPECT(p != NULL); + EXPECT(p->next == NULL); + if (p != NULL) { + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + } + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + + +/** Provoke fast retransmission by duplicate ACKs and then recover by ACKing all sent data. + * At the end, send more data. */ +START_TEST(test_tcp_fast_retx_recover) +{ + struct netif netif; + struct test_tcp_txcounters txcounters; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf* p; + char data1[] = { 1, 2, 3, 4}; + char data2[] = { 5, 6, 7, 8}; + char data3[] = { 9, 10, 11, 12}; + char data4[] = {13, 14, 15, 16}; + char data5[] = {17, 18, 19, 20}; + char data6[TCP_MSS] = {21, 22, 23, 24}; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + err_t err; + LWIP_UNUSED_ARG(_i); + + /* initialize local vars */ + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + memset(&counters, 0, sizeof(counters)); + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->mss = TCP_MSS; + /* disable initial congestion window (we don't send a SYN here...) */ + pcb->cwnd = pcb->snd_wnd; + + /* send data1 */ + err = tcp_write(pcb, data1, sizeof(data1), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT_RET(txcounters.num_tx_calls == 1); + EXPECT_RET(txcounters.num_tx_bytes == sizeof(data1) + sizeof(struct tcp_hdr) + sizeof(struct ip_hdr)); + memset(&txcounters, 0, sizeof(txcounters)); + /* "recv" ACK for data1 */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 4, TCP_ACK); + EXPECT_RET(p != NULL); + test_tcp_input(p, &netif); + EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(pcb->unacked == NULL); + /* send data2 */ + err = tcp_write(pcb, data2, sizeof(data2), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT_RET(txcounters.num_tx_calls == 1); + EXPECT_RET(txcounters.num_tx_bytes == sizeof(data2) + sizeof(struct tcp_hdr) + sizeof(struct ip_hdr)); + memset(&txcounters, 0, sizeof(txcounters)); + /* duplicate ACK for data1 (data2 is lost) */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + EXPECT_RET(p != NULL); + test_tcp_input(p, &netif); + EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(pcb->dupacks == 1); + /* send data3 */ + err = tcp_write(pcb, data3, sizeof(data3), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /* nagle enabled, no tx calls */ + EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(txcounters.num_tx_bytes == 0); + memset(&txcounters, 0, sizeof(txcounters)); + /* 2nd duplicate ACK for data1 (data2 and data3 are lost) */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + EXPECT_RET(p != NULL); + test_tcp_input(p, &netif); + EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(pcb->dupacks == 2); + /* queue data4, don't send it (unsent-oversize is != 0) */ + err = tcp_write(pcb, data4, sizeof(data4), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + /* 3nd duplicate ACK for data1 (data2 and data3 are lost) -> fast retransmission */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + EXPECT_RET(p != NULL); + test_tcp_input(p, &netif); + /*EXPECT_RET(txcounters.num_tx_calls == 1);*/ + EXPECT_RET(pcb->dupacks == 3); + memset(&txcounters, 0, sizeof(txcounters)); + /* @todo: check expected data?*/ + + /* send data5, not output yet */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + /*err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK);*/ + EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(txcounters.num_tx_bytes == 0); + memset(&txcounters, 0, sizeof(txcounters)); + { + int i = 0; + do + { + err = tcp_write(pcb, data6, TCP_MSS, TCP_WRITE_FLAG_COPY); + i++; + }while(err == ERR_OK); + EXPECT_RET(err != ERR_OK); + } + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /*EXPECT_RET(txcounters.num_tx_calls == 0); + EXPECT_RET(txcounters.num_tx_bytes == 0);*/ + memset(&txcounters, 0, sizeof(txcounters)); + + /* send even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /* ...and even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /* ...and even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /* ...and even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + + /* send ACKs for data2 and data3 */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 12, TCP_ACK); + EXPECT_RET(p != NULL); + test_tcp_input(p, &netif); + /*EXPECT_RET(txcounters.num_tx_calls == 0);*/ + + /* ...and even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + /* ...and even more data */ + err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + +#if 0 + /* create expected segment */ + p1 = tcp_create_rx_segment(pcb, counters.expected_data, data_len, 0, 0, 0); + EXPECT_RET(p != NULL); + if (p != NULL) { + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT_RET(counters.close_calls == 0); + EXPECT_RET(counters.recv_calls == 1); + EXPECT_RET(counters.recved_bytes == data_len); + EXPECT_RET(counters.err_calls == 0); + } +#endif + /* make sure the pcb is freed */ + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + +static u8_t tx_data[TCP_WND*2]; + +static void +check_seqnos(struct tcp_seg *segs, int num_expected, u32_t *seqnos_expected) +{ + struct tcp_seg *s = segs; + int i; + for (i = 0; i < num_expected; i++, s = s->next) { + EXPECT_RET(s != NULL); + EXPECT(s->tcphdr->seqno == htonl(seqnos_expected[i])); + } + EXPECT(s == NULL); +} + +/** Send data with sequence numbers that wrap around the u32_t range. + * Then, provoke fast retransmission by duplicate ACKs and check that all + * segment lists are still properly sorted. */ +START_TEST(test_tcp_fast_rexmit_wraparound) +{ + struct netif netif; + struct test_tcp_txcounters txcounters; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf* p; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + err_t err; +#define SEQNO1 (0xFFFFFF00 - TCP_MSS) +#define ISS 6510 + u16_t i, sent_total = 0; + u32_t seqnos[] = { + SEQNO1, + SEQNO1 + (1 * TCP_MSS), + SEQNO1 + (2 * TCP_MSS), + SEQNO1 + (3 * TCP_MSS), + SEQNO1 + (4 * TCP_MSS), + SEQNO1 + (5 * TCP_MSS)}; + LWIP_UNUSED_ARG(_i); + + for (i = 0; i < sizeof(tx_data); i++) { + tx_data[i] = (u8_t)i; + } + + /* initialize local vars */ + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + memset(&counters, 0, sizeof(counters)); + + /* create and initialize the pcb */ + tcp_ticks = SEQNO1 - ISS; + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->mss = TCP_MSS; + /* disable initial congestion window (we don't send a SYN here...) */ + pcb->cwnd = 2*TCP_MSS; + /* start in congestion advoidance */ + pcb->ssthresh = pcb->cwnd; + + /* send 6 mss-sized segments */ + for (i = 0; i < 6; i++) { + err = tcp_write(pcb, &tx_data[sent_total], TCP_MSS, TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + sent_total += TCP_MSS; + } + check_seqnos(pcb->unsent, 6, seqnos); + EXPECT(pcb->unacked == NULL); + err = tcp_output(pcb); + EXPECT(txcounters.num_tx_calls == 2); + EXPECT(txcounters.num_tx_bytes == 2 * (TCP_MSS + 40U)); + memset(&txcounters, 0, sizeof(txcounters)); + + check_seqnos(pcb->unacked, 2, seqnos); + check_seqnos(pcb->unsent, 4, &seqnos[2]); + + /* ACK the first segment */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, TCP_MSS, TCP_ACK); + test_tcp_input(p, &netif); + /* ensure this didn't trigger a retransmission. Only one + segment should be transmitted because cwnd opened up by + TCP_MSS and a fraction since we are in congestion avoidance */ + EXPECT(txcounters.num_tx_calls == 1); + EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U); + memset(&txcounters, 0, sizeof(txcounters)); + check_seqnos(pcb->unacked, 2, &seqnos[1]); + check_seqnos(pcb->unsent, 3, &seqnos[3]); + + /* 3 dupacks */ + EXPECT(pcb->dupacks == 0); + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + test_tcp_input(p, &netif); + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(pcb->dupacks == 1); + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + test_tcp_input(p, &netif); + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(pcb->dupacks == 2); + /* 3rd dupack -> fast rexmit */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + test_tcp_input(p, &netif); + EXPECT(pcb->dupacks == 3); + EXPECT(txcounters.num_tx_calls == 4); + memset(&txcounters, 0, sizeof(txcounters)); + EXPECT(pcb->unsent == NULL); + check_seqnos(pcb->unacked, 5, &seqnos[1]); + + /* make sure the pcb is freed */ + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + +/** Send data with sequence numbers that wrap around the u32_t range. + * Then, provoke RTO retransmission and check that all + * segment lists are still properly sorted. */ +START_TEST(test_tcp_rto_rexmit_wraparound) +{ + struct netif netif; + struct test_tcp_txcounters txcounters; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + err_t err; +#define SEQNO1 (0xFFFFFF00 - TCP_MSS) +#define ISS 6510 + u16_t i, sent_total = 0; + u32_t seqnos[] = { + SEQNO1, + SEQNO1 + (1 * TCP_MSS), + SEQNO1 + (2 * TCP_MSS), + SEQNO1 + (3 * TCP_MSS), + SEQNO1 + (4 * TCP_MSS), + SEQNO1 + (5 * TCP_MSS)}; + LWIP_UNUSED_ARG(_i); + + for (i = 0; i < sizeof(tx_data); i++) { + tx_data[i] = (u8_t)i; + } + + /* initialize local vars */ + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + memset(&counters, 0, sizeof(counters)); + + /* create and initialize the pcb */ + tcp_ticks = 0; + tcp_ticks = 0 - tcp_next_iss(NULL); + tcp_ticks = SEQNO1 - tcp_next_iss(NULL); + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->mss = TCP_MSS; + /* disable initial congestion window (we don't send a SYN here...) */ + pcb->cwnd = 2*TCP_MSS; + + /* send 6 mss-sized segments */ + for (i = 0; i < 6; i++) { + err = tcp_write(pcb, &tx_data[sent_total], TCP_MSS, TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + sent_total += TCP_MSS; + } + check_seqnos(pcb->unsent, 6, seqnos); + EXPECT(pcb->unacked == NULL); + err = tcp_output(pcb); + EXPECT(txcounters.num_tx_calls == 2); + EXPECT(txcounters.num_tx_bytes == 2 * (TCP_MSS + 40U)); + memset(&txcounters, 0, sizeof(txcounters)); + + check_seqnos(pcb->unacked, 2, seqnos); + check_seqnos(pcb->unsent, 4, &seqnos[2]); + + /* call the tcp timer some times */ + for (i = 0; i < 10; i++) { + test_tcp_tmr(); + EXPECT(txcounters.num_tx_calls == 0); + } + /* 11th call to tcp_tmr: RTO rexmit fires */ + test_tcp_tmr(); + EXPECT(txcounters.num_tx_calls == 1); + check_seqnos(pcb->unacked, 1, seqnos); + check_seqnos(pcb->unsent, 5, &seqnos[1]); + + /* fake greater cwnd */ + pcb->cwnd = pcb->snd_wnd; + /* send more data */ + err = tcp_output(pcb); + EXPECT(err == ERR_OK); + /* check queues are sorted */ + EXPECT(pcb->unsent == NULL); + check_seqnos(pcb->unacked, 6, seqnos); + + /* make sure the pcb is freed */ + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + +/** Provoke fast retransmission by duplicate ACKs and then recover by ACKing all sent data. + * At the end, send more data. */ +static void test_tcp_tx_full_window_lost(u8_t zero_window_probe_from_unsent) +{ + struct netif netif; + struct test_tcp_txcounters txcounters; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + err_t err; + u16_t sent_total, i; + u8_t expected = 0xFE; + + for (i = 0; i < sizeof(tx_data); i++) { + u8_t d = (u8_t)i; + if (d == 0xFE) { + d = 0xF0; + } + tx_data[i] = d; + } + if (zero_window_probe_from_unsent) { + tx_data[TCP_WND] = expected; + } else { + tx_data[0] = expected; + } + + /* initialize local vars */ + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, &txcounters, &local_ip, &netmask); + memset(&counters, 0, sizeof(counters)); + memset(&txcounters, 0, sizeof(txcounters)); + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->mss = TCP_MSS; + /* disable initial congestion window (we don't send a SYN here...) */ + pcb->cwnd = pcb->snd_wnd; + + /* send a full window (minus 1 packets) of TCP data in MSS-sized chunks */ + sent_total = 0; + if ((TCP_WND - TCP_MSS) % TCP_MSS != 0) { + u16_t initial_data_len = (TCP_WND - TCP_MSS) % TCP_MSS; + err = tcp_write(pcb, &tx_data[sent_total], initial_data_len, TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT(txcounters.num_tx_calls == 1); + EXPECT(txcounters.num_tx_bytes == initial_data_len + 40U); + memset(&txcounters, 0, sizeof(txcounters)); + sent_total += initial_data_len; + } + for (; sent_total < (TCP_WND - TCP_MSS); sent_total += TCP_MSS) { + err = tcp_write(pcb, &tx_data[sent_total], TCP_MSS, TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT(txcounters.num_tx_calls == 1); + EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U); + memset(&txcounters, 0, sizeof(txcounters)); + } + EXPECT(sent_total == (TCP_WND - TCP_MSS)); + + /* now ACK the packet before the first */ + p = tcp_create_rx_segment(pcb, NULL, 0, 0, 0, TCP_ACK); + test_tcp_input(p, &netif); + /* ensure this didn't trigger a retransmission */ + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(txcounters.num_tx_bytes == 0); + + EXPECT(pcb->persist_backoff == 0); + /* send the last packet, now a complete window has been sent */ + err = tcp_write(pcb, &tx_data[sent_total], TCP_MSS, TCP_WRITE_FLAG_COPY); + sent_total += TCP_MSS; + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT(txcounters.num_tx_calls == 1); + EXPECT(txcounters.num_tx_bytes == TCP_MSS + 40U); + memset(&txcounters, 0, sizeof(txcounters)); + EXPECT(pcb->persist_backoff == 0); + + if (zero_window_probe_from_unsent) { + /* ACK all data but close the TX window */ + p = tcp_create_rx_segment_wnd(pcb, NULL, 0, 0, TCP_WND, TCP_ACK, 0); + test_tcp_input(p, &netif); + /* ensure this didn't trigger any transmission */ + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(txcounters.num_tx_bytes == 0); + EXPECT(pcb->persist_backoff == 1); + } + + /* send one byte more (out of window) -> persist timer starts */ + err = tcp_write(pcb, &tx_data[sent_total], 1, TCP_WRITE_FLAG_COPY); + EXPECT_RET(err == ERR_OK); + err = tcp_output(pcb); + EXPECT_RET(err == ERR_OK); + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(txcounters.num_tx_bytes == 0); + memset(&txcounters, 0, sizeof(txcounters)); + if (!zero_window_probe_from_unsent) { + /* no persist timer unless a zero window announcement has been received */ + EXPECT(pcb->persist_backoff == 0); + } else { + EXPECT(pcb->persist_backoff == 1); + + /* call tcp_timer some more times to let persist timer count up */ + for (i = 0; i < 4; i++) { + test_tcp_tmr(); + EXPECT(txcounters.num_tx_calls == 0); + EXPECT(txcounters.num_tx_bytes == 0); + } + + /* this should trigger the zero-window-probe */ + txcounters.copy_tx_packets = 1; + test_tcp_tmr(); + txcounters.copy_tx_packets = 0; + EXPECT(txcounters.num_tx_calls == 1); + EXPECT(txcounters.num_tx_bytes == 1 + 40U); + EXPECT(txcounters.tx_packets != NULL); + if (txcounters.tx_packets != NULL) { + u8_t sent; + u16_t ret; + ret = pbuf_copy_partial(txcounters.tx_packets, &sent, 1, 40U); + EXPECT(ret == 1); + EXPECT(sent == expected); + } + if (txcounters.tx_packets != NULL) { + pbuf_free(txcounters.tx_packets); + txcounters.tx_packets = NULL; + } + } + + /* make sure the pcb is freed */ + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} + +START_TEST(test_tcp_tx_full_window_lost_from_unsent) +{ + LWIP_UNUSED_ARG(_i); + test_tcp_tx_full_window_lost(1); +} +END_TEST + +START_TEST(test_tcp_tx_full_window_lost_from_unacked) +{ + LWIP_UNUSED_ARG(_i); + test_tcp_tx_full_window_lost(0); +} +END_TEST + +/** Create the suite including all tests for this module */ +Suite * +tcp_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_tcp_new_abort), + TESTFUNC(test_tcp_recv_inseq), + TESTFUNC(test_tcp_malformed_header), + TESTFUNC(test_tcp_fast_retx_recover), + TESTFUNC(test_tcp_fast_rexmit_wraparound), + TESTFUNC(test_tcp_rto_rexmit_wraparound), + TESTFUNC(test_tcp_tx_full_window_lost_from_unacked), + TESTFUNC(test_tcp_tx_full_window_lost_from_unsent) + }; + return create_suite("TCP", tests, sizeof(tests)/sizeof(testfunc), tcp_setup, tcp_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.h new file mode 100644 index 0000000..f28ee56 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_TCP_H +#define LWIP_HDR_TEST_TCP_H + +#include "../lwip_check.h" + +Suite *tcp_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.c new file mode 100644 index 0000000..be61172 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.c @@ -0,0 +1,1049 @@ +#include "test_tcp_oos.h" + +#include "lwip/priv/tcp_priv.h" +#include "lwip/stats.h" +#include "tcp_helper.h" + +#if !LWIP_STATS || !TCP_STATS || !MEMP_STATS +#error "This tests needs TCP- and MEMP-statistics enabled" +#endif +#if !TCP_QUEUE_OOSEQ +#error "This tests needs TCP_QUEUE_OOSEQ enabled" +#endif + +/** CHECK_SEGMENTS_ON_OOSEQ: + * 1: check count, seqno and len of segments on pcb->ooseq (strict) + * 0: only check that bytes are received in correct order (less strict) */ +#define CHECK_SEGMENTS_ON_OOSEQ 1 + +#if CHECK_SEGMENTS_ON_OOSEQ +#define EXPECT_OOSEQ(x) EXPECT(x) +#else +#define EXPECT_OOSEQ(x) +#endif + +/* helper functions */ + +/** Get the numbers of segments on the ooseq list */ +static int tcp_oos_count(struct tcp_pcb* pcb) +{ + int num = 0; + struct tcp_seg* seg = pcb->ooseq; + while(seg != NULL) { + num++; + seg = seg->next; + } + return num; +} + +#if TCP_OOSEQ_MAX_PBUFS && (TCP_OOSEQ_MAX_PBUFS < ((TCP_WND / TCP_MSS) + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) +/** Get the numbers of pbufs on the ooseq list */ +static int tcp_oos_pbuf_count(struct tcp_pcb* pcb) +{ + int num = 0; + struct tcp_seg* seg = pcb->ooseq; + while(seg != NULL) { + num += pbuf_clen(seg->p); + seg = seg->next; + } + return num; +} +#endif + +/** Get the seqno of a segment (by index) on the ooseq list + * + * @param pcb the pcb to check for ooseq segments + * @param seg_index index of the segment on the ooseq list + * @return seqno of the segment + */ +static u32_t +tcp_oos_seg_seqno(struct tcp_pcb* pcb, int seg_index) +{ + int num = 0; + struct tcp_seg* seg = pcb->ooseq; + + /* then check the actual segment */ + while(seg != NULL) { + if(num == seg_index) { + return seg->tcphdr->seqno; + } + num++; + seg = seg->next; + } + fail(); + return 0; +} + +/** Get the tcplen (datalen + SYN/FIN) of a segment (by index) on the ooseq list + * + * @param pcb the pcb to check for ooseq segments + * @param seg_index index of the segment on the ooseq list + * @return tcplen of the segment + */ +static int +tcp_oos_seg_tcplen(struct tcp_pcb* pcb, int seg_index) +{ + int num = 0; + struct tcp_seg* seg = pcb->ooseq; + + /* then check the actual segment */ + while(seg != NULL) { + if(num == seg_index) { + return TCP_TCPLEN(seg); + } + num++; + seg = seg->next; + } + fail(); + return -1; +} + +/** Get the tcplen (datalen + SYN/FIN) of all segments on the ooseq list + * + * @param pcb the pcb to check for ooseq segments + * @return tcplen of all segment + */ +static int +tcp_oos_tcplen(struct tcp_pcb* pcb) +{ + int len = 0; + struct tcp_seg* seg = pcb->ooseq; + + /* then check the actual segment */ + while(seg != NULL) { + len += TCP_TCPLEN(seg); + seg = seg->next; + } + return len; +} + +/* Setup/teardown functions */ + +static void +tcp_oos_setup(void) +{ + tcp_remove_all(); +} + +static void +tcp_oos_teardown(void) +{ + tcp_remove_all(); + netif_list = NULL; + netif_default = NULL; +} + + + +/* Test functions */ + +/** create multiple segments and pass them to tcp_input in a wrong + * order to see if ooseq-caching works correctly + * FIN is received in out-of-sequence segments only */ +START_TEST(test_tcp_recv_ooseq_FIN_OOSEQ) +{ + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p_8_9, *p_4_8, *p_4_10, *p_2_14, *p_fin, *pinseq; + char data[] = { + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16}; + ip_addr_t remote_ip, local_ip, netmask; + u16_t data_len; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + LWIP_UNUSED_ARG(_i); + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + data_len = sizeof(data); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = data_len; + counters.expected_data = data; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + + /* create segments */ + /* pinseq is sent as last segment! */ + pinseq = tcp_create_rx_segment(pcb, &data[0], 4, 0, 0, TCP_ACK); + /* p1: 8 bytes before FIN */ + /* seqno: 8..16 */ + p_8_9 = tcp_create_rx_segment(pcb, &data[8], 8, 8, 0, TCP_ACK|TCP_FIN); + /* p2: 4 bytes before p1, including the first 4 bytes of p1 (partly duplicate) */ + /* seqno: 4..11 */ + p_4_8 = tcp_create_rx_segment(pcb, &data[4], 8, 4, 0, TCP_ACK); + /* p3: same as p2 but 2 bytes longer */ + /* seqno: 4..13 */ + p_4_10 = tcp_create_rx_segment(pcb, &data[4], 10, 4, 0, TCP_ACK); + /* p4: 14 bytes before FIN, includes data from p1 and p2, plus partly from pinseq */ + /* seqno: 2..15 */ + p_2_14 = tcp_create_rx_segment(pcb, &data[2], 14, 2, 0, TCP_ACK); + /* FIN, seqno 16 */ + p_fin = tcp_create_rx_segment(pcb, NULL, 0,16, 0, TCP_ACK|TCP_FIN); + EXPECT(pinseq != NULL); + EXPECT(p_8_9 != NULL); + EXPECT(p_4_8 != NULL); + EXPECT(p_4_10 != NULL); + EXPECT(p_2_14 != NULL); + EXPECT(p_fin != NULL); + if ((pinseq != NULL) && (p_8_9 != NULL) && (p_4_8 != NULL) && (p_4_10 != NULL) && (p_2_14 != NULL) && (p_fin != NULL)) { + /* pass the segment to tcp_input */ + test_tcp_input(p_8_9, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 8); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 9); /* includes FIN */ + + /* pass the segment to tcp_input */ + test_tcp_input(p_4_8, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 4); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 4); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 8); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 9); /* includes FIN */ + + /* pass the segment to tcp_input */ + test_tcp_input(p_4_10, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* ooseq queue: unchanged */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 4); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 4); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 8); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 9); /* includes FIN */ + + /* pass the segment to tcp_input */ + test_tcp_input(p_2_14, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 2); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 15); /* includes FIN */ + + /* pass the segment to tcp_input */ + test_tcp_input(p_fin, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* ooseq queue: unchanged */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 2); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 15); /* includes FIN */ + + /* pass the segment to tcp_input */ + test_tcp_input(pinseq, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 1); + EXPECT(counters.recv_calls == 1); + EXPECT(counters.recved_bytes == data_len); + EXPECT(counters.err_calls == 0); + EXPECT(pcb->ooseq == NULL); + } + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + + +/** create multiple segments and pass them to tcp_input in a wrong + * order to see if ooseq-caching works correctly + * FIN is received IN-SEQUENCE at the end */ +START_TEST(test_tcp_recv_ooseq_FIN_INSEQ) +{ + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p_1_2, *p_4_8, *p_3_11, *p_2_12, *p_15_1, *p_15_1a, *pinseq, *pinseqFIN; + char data[] = { + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16}; + ip_addr_t remote_ip, local_ip, netmask; + u16_t data_len; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + LWIP_UNUSED_ARG(_i); + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + data_len = sizeof(data); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = data_len; + counters.expected_data = data; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + + /* create segments */ + /* p1: 7 bytes - 2 before FIN */ + /* seqno: 1..2 */ + p_1_2 = tcp_create_rx_segment(pcb, &data[1], 2, 1, 0, TCP_ACK); + /* p2: 4 bytes before p1, including the first 4 bytes of p1 (partly duplicate) */ + /* seqno: 4..11 */ + p_4_8 = tcp_create_rx_segment(pcb, &data[4], 8, 4, 0, TCP_ACK); + /* p3: same as p2 but 2 bytes longer and one byte more at the front */ + /* seqno: 3..13 */ + p_3_11 = tcp_create_rx_segment(pcb, &data[3], 11, 3, 0, TCP_ACK); + /* p4: 13 bytes - 2 before FIN - should be ignored as contained in p1 and p3 */ + /* seqno: 2..13 */ + p_2_12 = tcp_create_rx_segment(pcb, &data[2], 12, 2, 0, TCP_ACK); + /* pinseq is the first segment that is held back to create ooseq! */ + /* seqno: 0..3 */ + pinseq = tcp_create_rx_segment(pcb, &data[0], 4, 0, 0, TCP_ACK); + /* p5: last byte before FIN */ + /* seqno: 15 */ + p_15_1 = tcp_create_rx_segment(pcb, &data[15], 1, 15, 0, TCP_ACK); + /* p6: same as p5, should be ignored */ + p_15_1a= tcp_create_rx_segment(pcb, &data[15], 1, 15, 0, TCP_ACK); + /* pinseqFIN: last 2 bytes plus FIN */ + /* only segment containing seqno 14 and FIN */ + pinseqFIN = tcp_create_rx_segment(pcb, &data[14], 2, 14, 0, TCP_ACK|TCP_FIN); + EXPECT(pinseq != NULL); + EXPECT(p_1_2 != NULL); + EXPECT(p_4_8 != NULL); + EXPECT(p_3_11 != NULL); + EXPECT(p_2_12 != NULL); + EXPECT(p_15_1 != NULL); + EXPECT(p_15_1a != NULL); + EXPECT(pinseqFIN != NULL); + if ((pinseq != NULL) && (p_1_2 != NULL) && (p_4_8 != NULL) && (p_3_11 != NULL) && (p_2_12 != NULL) + && (p_15_1 != NULL) && (p_15_1a != NULL) && (pinseqFIN != NULL)) { + /* pass the segment to tcp_input */ + test_tcp_input(p_1_2, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2); + + /* pass the segment to tcp_input */ + test_tcp_input(p_4_8, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 4); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 8); + + /* pass the segment to tcp_input */ + test_tcp_input(p_3_11, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 2); + /* p_3_11 has removed p_4_8 from ooseq */ + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 3); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 11); + + /* pass the segment to tcp_input */ + test_tcp_input(p_2_12, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 2); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 1); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 1) == 2); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 1) == 12); + + /* pass the segment to tcp_input */ + test_tcp_input(pinseq, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 1); + EXPECT(counters.recved_bytes == 14); + EXPECT(counters.err_calls == 0); + EXPECT(pcb->ooseq == NULL); + + /* pass the segment to tcp_input */ + test_tcp_input(p_15_1, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 1); + EXPECT(counters.recved_bytes == 14); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 15); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1); + + /* pass the segment to tcp_input */ + test_tcp_input(p_15_1a, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 1); + EXPECT(counters.recved_bytes == 14); + EXPECT(counters.err_calls == 0); + /* check ooseq queue: unchanged */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == 1); + EXPECT_OOSEQ(tcp_oos_seg_seqno(pcb, 0) == 15); + EXPECT_OOSEQ(tcp_oos_seg_tcplen(pcb, 0) == 1); + + /* pass the segment to tcp_input */ + test_tcp_input(pinseqFIN, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 1); + EXPECT(counters.recv_calls == 2); + EXPECT(counters.recved_bytes == data_len); + EXPECT(counters.err_calls == 0); + EXPECT(pcb->ooseq == NULL); + } + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} +END_TEST + +static char data_full_wnd[TCP_WND + TCP_MSS]; + +/** create multiple segments and pass them to tcp_input with the first segment missing + * to simulate overruning the rxwin with ooseq queueing enabled */ +START_TEST(test_tcp_recv_ooseq_overrun_rxwin) +{ +#if !TCP_OOSEQ_MAX_BYTES && !TCP_OOSEQ_MAX_PBUFS + int i, k; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *pinseq, *p_ovr; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + int datalen = 0; + int datalen2; + + for(i = 0; i < (int)sizeof(data_full_wnd); i++) { + data_full_wnd[i] = (char)i; + } + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = TCP_WND; + counters.expected_data = data_full_wnd; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->rcv_nxt = 0x8000; + + /* create segments */ + /* pinseq is sent as last segment! */ + pinseq = tcp_create_rx_segment(pcb, &data_full_wnd[0], TCP_MSS, 0, 0, TCP_ACK); + + for(i = TCP_MSS, k = 0; i < TCP_WND; i += TCP_MSS, k++) { + int count, expected_datalen; + struct pbuf *p = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)], + TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK); + EXPECT_RET(p != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + count = tcp_oos_count(pcb); + EXPECT_OOSEQ(count == k+1); + datalen = tcp_oos_tcplen(pcb); + if (i + TCP_MSS < TCP_WND) { + expected_datalen = (k+1)*TCP_MSS; + } else { + expected_datalen = TCP_WND - TCP_MSS; + } + if (datalen != expected_datalen) { + EXPECT_OOSEQ(datalen == expected_datalen); + } + } + + /* pass in one more segment, cleary overrunning the rxwin */ + p_ovr = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)], TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK); + EXPECT_RET(p_ovr != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p_ovr, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == k); + datalen2 = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen == datalen2); + + /* now pass inseq */ + test_tcp_input(pinseq, &netif); + EXPECT(pcb->ooseq == NULL); + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +#endif /* !TCP_OOSEQ_MAX_BYTES && !TCP_OOSEQ_MAX_PBUFS */ + LWIP_UNUSED_ARG(_i); +} +END_TEST + +/** similar to above test, except seqno starts near the max rxwin */ +START_TEST(test_tcp_recv_ooseq_overrun_rxwin_edge) +{ +#if !TCP_OOSEQ_MAX_BYTES && !TCP_OOSEQ_MAX_PBUFS + int i, k; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *pinseq, *p_ovr; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + int datalen = 0; + int datalen2; + + for(i = 0; i < (int)sizeof(data_full_wnd); i++) { + data_full_wnd[i] = (char)i; + } + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = TCP_WND; + counters.expected_data = data_full_wnd; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->rcv_nxt = 0xffffffff - (TCP_WND / 2); + + /* create segments */ + /* pinseq is sent as last segment! */ + pinseq = tcp_create_rx_segment(pcb, &data_full_wnd[0], TCP_MSS, 0, 0, TCP_ACK); + + for(i = TCP_MSS, k = 0; i < TCP_WND; i += TCP_MSS, k++) { + int count, expected_datalen; + struct pbuf *p = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)], + TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK); + EXPECT_RET(p != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + count = tcp_oos_count(pcb); + EXPECT_OOSEQ(count == k+1); + datalen = tcp_oos_tcplen(pcb); + if (i + TCP_MSS < TCP_WND) { + expected_datalen = (k+1)*TCP_MSS; + } else { + expected_datalen = TCP_WND - TCP_MSS; + } + if (datalen != expected_datalen) { + EXPECT_OOSEQ(datalen == expected_datalen); + } + } + + /* pass in one more segment, cleary overrunning the rxwin */ + p_ovr = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS*(k+1)], TCP_MSS, TCP_MSS*(k+1), 0, TCP_ACK); + EXPECT_RET(p_ovr != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p_ovr, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == k); + datalen2 = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen == datalen2); + + /* now pass inseq */ + test_tcp_input(pinseq, &netif); + EXPECT(pcb->ooseq == NULL); + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +#endif /* !TCP_OOSEQ_MAX_BYTES && !TCP_OOSEQ_MAX_PBUFS */ + LWIP_UNUSED_ARG(_i); +} +END_TEST + +START_TEST(test_tcp_recv_ooseq_max_bytes) +{ +#if TCP_OOSEQ_MAX_BYTES && (TCP_OOSEQ_MAX_BYTES < (TCP_WND + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) + int i, k; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p_ovr; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + int datalen = 0; + int datalen2; + + for(i = 0; i < sizeof(data_full_wnd); i++) { + data_full_wnd[i] = (char)i; + } + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = TCP_WND; + counters.expected_data = data_full_wnd; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->rcv_nxt = 0x8000; + + /* don't 'recv' the first segment (1 byte) so that all other segments will be ooseq */ + + /* create segments and 'recv' them */ + for(k = 1, i = 1; k < TCP_OOSEQ_MAX_BYTES; k += TCP_MSS, i++) { + int count; + struct pbuf *p = tcp_create_rx_segment(pcb, &data_full_wnd[k], + TCP_MSS, k, 0, TCP_ACK); + EXPECT_RET(p != NULL); + EXPECT_RET(p->next == NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + count = tcp_oos_pbuf_count(pcb); + EXPECT_OOSEQ(count == i); + datalen = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen == (i * TCP_MSS)); + } + + /* pass in one more segment, overrunning the limit */ + p_ovr = tcp_create_rx_segment(pcb, &data_full_wnd[k+1], 1, k+1, 0, TCP_ACK); + EXPECT_RET(p_ovr != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p_ovr, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue (ensure the new segment was not accepted) */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == (i-1)); + datalen2 = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen2 == ((i-1) * TCP_MSS)); + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +#endif /* TCP_OOSEQ_MAX_BYTES && (TCP_OOSEQ_MAX_BYTES < (TCP_WND + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) */ + LWIP_UNUSED_ARG(_i); +} +END_TEST + +START_TEST(test_tcp_recv_ooseq_max_pbufs) +{ +#if TCP_OOSEQ_MAX_PBUFS && (TCP_OOSEQ_MAX_PBUFS < ((TCP_WND / TCP_MSS) + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) + int i; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p_ovr; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + int datalen = 0; + int datalen2; + + for(i = 0; i < sizeof(data_full_wnd); i++) { + data_full_wnd[i] = (char)i; + } + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = TCP_WND; + counters.expected_data = data_full_wnd; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->rcv_nxt = 0x8000; + + /* don't 'recv' the first segment (1 byte) so that all other segments will be ooseq */ + + /* create segments and 'recv' them */ + for(i = 1; i <= TCP_OOSEQ_MAX_PBUFS; i++) { + int count; + struct pbuf *p = tcp_create_rx_segment(pcb, &data_full_wnd[i], + 1, i, 0, TCP_ACK); + EXPECT_RET(p != NULL); + EXPECT_RET(p->next == NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue */ + count = tcp_oos_pbuf_count(pcb); + EXPECT_OOSEQ(count == i); + datalen = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen == i); + } + + /* pass in one more segment, overrunning the limit */ + p_ovr = tcp_create_rx_segment(pcb, &data_full_wnd[i+1], 1, i+1, 0, TCP_ACK); + EXPECT_RET(p_ovr != NULL); + /* pass the segment to tcp_input */ + test_tcp_input(p_ovr, &netif); + /* check if counters are as expected */ + EXPECT(counters.close_calls == 0); + EXPECT(counters.recv_calls == 0); + EXPECT(counters.recved_bytes == 0); + EXPECT(counters.err_calls == 0); + /* check ooseq queue (ensure the new segment was not accepted) */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == (i-1)); + datalen2 = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(datalen2 == (i-1)); + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +#endif /* TCP_OOSEQ_MAX_PBUFS && (TCP_OOSEQ_MAX_BYTES < (TCP_WND + 1)) && (PBUF_POOL_BUFSIZE >= (TCP_MSS + PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) */ + LWIP_UNUSED_ARG(_i); +} +END_TEST + +static void +check_rx_counters(struct tcp_pcb *pcb, struct test_tcp_counters *counters, u32_t exp_close_calls, u32_t exp_rx_calls, + u32_t exp_rx_bytes, u32_t exp_err_calls, int exp_oos_count, int exp_oos_len) +{ + int oos_len; + EXPECT(counters->close_calls == exp_close_calls); + EXPECT(counters->recv_calls == exp_rx_calls); + EXPECT(counters->recved_bytes == exp_rx_bytes); + EXPECT(counters->err_calls == exp_err_calls); + /* check that pbuf is queued in ooseq */ + EXPECT_OOSEQ(tcp_oos_count(pcb) == exp_oos_count); + oos_len = tcp_oos_tcplen(pcb); + EXPECT_OOSEQ(exp_oos_len == oos_len); +} + +/* this test uses 4 packets: + * - data (len=TCP_MSS) + * - FIN + * - data after FIN (len=1) (invalid) + * - 2nd FIN (invalid) + * + * the parameter 'delay_packet' is a bitmask that choses which on these packets is ooseq + */ +static void test_tcp_recv_ooseq_double_FINs(int delay_packet) +{ + int i, k; + struct test_tcp_counters counters; + struct tcp_pcb* pcb; + struct pbuf *p_normal_fin, *p_data_after_fin, *p, *p_2nd_fin_ooseq; + ip_addr_t remote_ip, local_ip, netmask; + u16_t remote_port = 0x100, local_port = 0x101; + struct netif netif; + u32_t exp_rx_calls = 0, exp_rx_bytes = 0, exp_close_calls = 0, exp_oos_pbufs = 0, exp_oos_tcplen = 0; + int first_dropped = 0xff; + + for(i = 0; i < (int)sizeof(data_full_wnd); i++) { + data_full_wnd[i] = (char)i; + } + + /* initialize local vars */ + memset(&netif, 0, sizeof(netif)); + IP_ADDR4(&local_ip, 192, 168, 1, 1); + IP_ADDR4(&remote_ip, 192, 168, 1, 2); + IP_ADDR4(&netmask, 255, 255, 255, 0); + test_tcp_init_netif(&netif, NULL, &local_ip, &netmask); + /* initialize counter struct */ + memset(&counters, 0, sizeof(counters)); + counters.expected_data_len = TCP_WND; + counters.expected_data = data_full_wnd; + + /* create and initialize the pcb */ + pcb = test_tcp_new_counters_pcb(&counters); + EXPECT_RET(pcb != NULL); + tcp_set_state(pcb, ESTABLISHED, &local_ip, &remote_ip, local_port, remote_port); + pcb->rcv_nxt = 0x8000; + + /* create segments */ + p = tcp_create_rx_segment(pcb, &data_full_wnd[0], TCP_MSS, 0, 0, TCP_ACK); + p_normal_fin = tcp_create_rx_segment(pcb, NULL, 0, TCP_MSS, 0, TCP_ACK|TCP_FIN); + k = 1; + p_data_after_fin = tcp_create_rx_segment(pcb, &data_full_wnd[TCP_MSS+1], k, TCP_MSS+1, 0, TCP_ACK); + p_2nd_fin_ooseq = tcp_create_rx_segment(pcb, NULL, 0, TCP_MSS+1+k, 0, TCP_ACK|TCP_FIN); + + if(delay_packet & 1) { + /* drop normal data */ + first_dropped = 1; + } else { + /* send normal data */ + test_tcp_input(p, &netif); + exp_rx_calls++; + exp_rx_bytes += TCP_MSS; + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 2) { + /* drop FIN */ + if(first_dropped > 2) { + first_dropped = 2; + } + } else { + /* send FIN */ + test_tcp_input(p_normal_fin, &netif); + if (first_dropped < 2) { + /* already dropped packets, this one is ooseq */ + exp_oos_pbufs++; + exp_oos_tcplen++; + } else { + /* inseq */ + exp_close_calls++; + } + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 4) { + /* drop data-after-FIN */ + if(first_dropped > 3) { + first_dropped = 3; + } + } else { + /* send data-after-FIN */ + test_tcp_input(p_data_after_fin, &netif); + if (first_dropped < 3) { + /* already dropped packets, this one is ooseq */ + if (delay_packet & 2) { + /* correct FIN was ooseq */ + exp_oos_pbufs++; + exp_oos_tcplen += k; + } + } else { + /* inseq: no change */ + } + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 8) { + /* drop 2nd-FIN */ + if(first_dropped > 4) { + first_dropped = 4; + } + } else { + /* send 2nd-FIN */ + test_tcp_input(p_2nd_fin_ooseq, &netif); + if (first_dropped < 3) { + /* already dropped packets, this one is ooseq */ + if (delay_packet & 2) { + /* correct FIN was ooseq */ + exp_oos_pbufs++; + exp_oos_tcplen++; + } + } else { + /* inseq: no change */ + } + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 1) { + /* dropped normal data before */ + test_tcp_input(p, &netif); + exp_rx_calls++; + exp_rx_bytes += TCP_MSS; + if((delay_packet & 2) == 0) { + /* normal FIN was NOT delayed */ + exp_close_calls++; + exp_oos_pbufs = exp_oos_tcplen = 0; + } + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 2) { + /* dropped normal FIN before */ + test_tcp_input(p_normal_fin, &netif); + exp_close_calls++; + exp_oos_pbufs = exp_oos_tcplen = 0; + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 4) { + /* dropped data-after-FIN before */ + test_tcp_input(p_data_after_fin, &netif); + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + if(delay_packet & 8) { + /* dropped 2nd-FIN before */ + test_tcp_input(p_2nd_fin_ooseq, &netif); + } + /* check if counters are as expected */ + check_rx_counters(pcb, &counters, exp_close_calls, exp_rx_calls, exp_rx_bytes, 0, exp_oos_pbufs, exp_oos_tcplen); + + /* check that ooseq data has been dumped */ + EXPECT(pcb->ooseq == NULL); + + /* make sure the pcb is freed */ + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 1); + tcp_abort(pcb); + EXPECT(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); +} + +/** create multiple segments and pass them to tcp_input with the first segment missing + * to simulate overruning the rxwin with ooseq queueing enabled */ +#define FIN_TEST(name, num) \ + START_TEST(name) \ + { \ + LWIP_UNUSED_ARG(_i); \ + test_tcp_recv_ooseq_double_FINs(num); \ + } \ + END_TEST +FIN_TEST(test_tcp_recv_ooseq_double_FIN_0, 0) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_1, 1) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_2, 2) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_3, 3) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_4, 4) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_5, 5) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_6, 6) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_7, 7) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_8, 8) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_9, 9) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_10, 10) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_11, 11) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_12, 12) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_13, 13) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_14, 14) +FIN_TEST(test_tcp_recv_ooseq_double_FIN_15, 15) + + +/** Create the suite including all tests for this module */ +Suite * +tcp_oos_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_tcp_recv_ooseq_FIN_OOSEQ), + TESTFUNC(test_tcp_recv_ooseq_FIN_INSEQ), + TESTFUNC(test_tcp_recv_ooseq_overrun_rxwin), + TESTFUNC(test_tcp_recv_ooseq_overrun_rxwin_edge), + TESTFUNC(test_tcp_recv_ooseq_max_bytes), + TESTFUNC(test_tcp_recv_ooseq_max_pbufs), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_0), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_1), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_2), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_3), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_4), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_5), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_6), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_7), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_8), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_9), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_10), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_11), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_12), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_13), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_14), + TESTFUNC(test_tcp_recv_ooseq_double_FIN_15) + }; + return create_suite("TCP_OOS", tests, sizeof(tests)/sizeof(testfunc), tcp_oos_setup, tcp_oos_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.h new file mode 100644 index 0000000..5b82013 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/tcp/test_tcp_oos.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_TCP_OOS_H +#define LWIP_HDR_TEST_TCP_OOS_H + +#include "../lwip_check.h" + +Suite *tcp_oos_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.c new file mode 100644 index 0000000..147822f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.c @@ -0,0 +1,68 @@ +#include "test_udp.h" + +#include "lwip/udp.h" +#include "lwip/stats.h" + +#if !LWIP_STATS || !UDP_STATS || !MEMP_STATS +#error "This tests needs UDP- and MEMP-statistics enabled" +#endif + +/* Helper functions */ +static void +udp_remove_all(void) +{ + struct udp_pcb *pcb = udp_pcbs; + struct udp_pcb *pcb2; + + while(pcb != NULL) { + pcb2 = pcb; + pcb = pcb->next; + udp_remove(pcb2); + } + fail_unless(MEMP_STATS_GET(used, MEMP_UDP_PCB) == 0); +} + +/* Setups/teardown functions */ + +static void +udp_setup(void) +{ + udp_remove_all(); +} + +static void +udp_teardown(void) +{ + udp_remove_all(); +} + + +/* Test functions */ + +START_TEST(test_udp_new_remove) +{ + struct udp_pcb* pcb; + LWIP_UNUSED_ARG(_i); + + fail_unless(MEMP_STATS_GET(used, MEMP_UDP_PCB) == 0); + + pcb = udp_new(); + fail_unless(pcb != NULL); + if (pcb != NULL) { + fail_unless(MEMP_STATS_GET(used, MEMP_UDP_PCB) == 1); + udp_remove(pcb); + fail_unless(MEMP_STATS_GET(used, MEMP_UDP_PCB) == 0); + } +} +END_TEST + + +/** Create the suite including all tests for this module */ +Suite * +udp_suite(void) +{ + testfunc tests[] = { + TESTFUNC(test_udp_new_remove), + }; + return create_suite("UDP", tests, sizeof(tests)/sizeof(testfunc), udp_setup, udp_teardown); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.h new file mode 100644 index 0000000..5426bf4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/lwip-2.0.2/test/unit/udp/test_udp.h @@ -0,0 +1,8 @@ +#ifndef LWIP_HDR_TEST_UDP_H +#define LWIP_HDR_TEST_UDP_H + +#include "../lwip_check.h" + +Suite* udp_suite(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_enet_eval.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_enet_eval.c new file mode 100644 index 0000000..c7ccda6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_enet_eval.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_enet_eval.c + \brief ethernet hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_enet.h" +#include "gd32f10x_enet_eval.h" +#include "main.h" + +const uint8_t gd32_str[] = {"\r\n ############ Welcome GigaDevice ############\r\n"}; +static __IO uint32_t enet_init_status = 0; +static void enet_gpio_config(void); +static void enet_mac_dma_config(void); +#ifdef USE_ENET_INTERRUPT +static void nvic_configuration(void); +#endif /* USE_ENET_INTERRUPT */ + +/*! + \brief setup ethernet system(GPIOs, clocks, MAC, DMA, systick) + \param[in] none + \param[out] none + \retval none +*/ +void enet_system_setup(void) +{ + uint32_t ahb_frequency = 0; + +#ifdef USE_ENET_INTERRUPT + nvic_configuration(); +#endif /* USE_ENET_INTERRUPT */ + + /* configure the GPIO ports for ethernet pins */ + enet_gpio_config(); + + /* configure the ethernet MAC/DMA */ + enet_mac_dma_config(); + + if (enet_init_status == 0){ + while(1){ + } + } + +#ifdef USE_ENET_INTERRUPT + enet_interrupt_enable(ENET_DMA_INT_NIE); + enet_interrupt_enable(ENET_DMA_INT_RIE); +#endif /* USE_ENET_INTERRUPT */ + + /* configure systick clock source as HCLK */ + systick_clksource_set(SYSTICK_CLKSOURCE_HCLK); + + /* an interrupt every 10ms */ + ahb_frequency = rcu_clock_freq_get(CK_AHB); + SysTick_Config(ahb_frequency / 100); +} + +/*! + \brief configures the ethernet interface + \param[in] none + \param[out] none + \retval none +*/ +static void enet_mac_dma_config(void) +{ + ErrStatus reval_state = ERROR; + + /* enable ethernet clock */ + rcu_periph_clock_enable(RCU_ENET); + rcu_periph_clock_enable(RCU_ENETTX); + rcu_periph_clock_enable(RCU_ENETRX); + + /* reset ethernet on AHB bus */ + enet_deinit(); + + reval_state = enet_software_reset(); + if(reval_state == ERROR){ + while(1){} + } + +#ifdef CHECKSUM_BY_HARDWARE + enet_init_status = enet_init(ENET_AUTO_NEGOTIATION, ENET_AUTOCHECKSUM_DROP_FAILFRAMES, ENET_BROADCAST_FRAMES_PASS); +#else + enet_init_status = enet_init(ENET_AUTO_NEGOTIATION, ENET_NO_AUTOCHECKSUM, ENET_BROADCAST_FRAMES_PASS); +#endif + +} + +#ifdef USE_ENET_INTERRUPT +/*! + \brief configures the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +static void nvic_configuration(void) +{ + nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x0); + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable(ENET_IRQn, 0, 0); +} +#endif /* USE_ENET_INTERRUPT */ + +/*! + \brief configures the different GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +static void enet_gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_GPIOC); + + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + + /* enable SYSCFG clock */ + rcu_periph_clock_enable(RCU_AF); + +#ifdef MII_MODE + +#ifdef PHY_CLOCK_MCO + /* output HXTAL clock (25MHz) on CKOUT0 pin(PA8) to clock the PHY */ + rcu_ckout0_config(RCU_CKOUT0SRC_HXTAL); +#endif /* PHY_CLOCK_MCO */ + + gpio_ethernet_phy_select(GPIO_ENET_PHY_MII); + +#elif defined RMII_MODE + + rcu_pll2_config(RCU_PLL2_MUL10); + rcu_osci_on(RCU_PLL2_CK); + rcu_osci_stab_wait(RCU_PLL2_CK); + /* get 50MHz from CK_PLL2 on CKOUT0 pin (PA8) to clock the PHY */ + rcu_ckout0_config(RCU_CKOUT0SRC_CKPLL2); + gpio_ethernet_phy_select(GPIO_ENET_PHY_RMII); + +#endif + +#ifdef MII_MODE + + /* PA0: ETH_MII_CRS */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + /* PA1: ETH_RX_CLK */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + /* PA2: ETH_MDIO */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + /* PA3: ETH_MII_COL */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_3); + /* PA7: ETH_MII_RX_DV */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + /* PC1: ETH_MDC */ + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + /* PC2: ETH_MII_TXD2 */ + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + /* PC3: ETH_MII_TX_CLK */ + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_3); + /* PC4: ETH_MII_RXD0 */ + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_4); + /* PC5: ETH_MII_RXD1 */ + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_5); + + /* PB0: ETH_MII_RXD2 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + /* PB1: ETH_MII_RXD3 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + /* PB8: ETH_MII_TXD3 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + /* PB10: ETH_MII_RX_ER */ + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + /* PB11: ETH_MII_TX_EN */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); + /* PB12: ETH_MII_TXD0 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_12); + /* PB13: ETH_MII_TXD1 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + + +#elif defined RMII_MODE + + /* PA1: ETH_RMII_REF_CLK */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + /* PA2: ETH_MDIO */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + /* PA7: ETH_RMII_CRS_DV */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + /* PC1: ETH_MDC */ + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + /* PC4: ETH_RMII_RXD0 */ + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_4); + /* PC5: ETH_RMII_RXD1 */ + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_5); + + /* PB11: ETH_RMII_TX_EN */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); + /* PB12: ETH_RMII_TXD0 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_12); + /* PB13: ETH_RMII_TXD1 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + +#endif /* MII_MODE */ + +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_it.c new file mode 100644 index 0000000..4a3f485 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/gd32f10x_it.c @@ -0,0 +1,180 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x.h" +#include "main.h" + +extern void lwip_pkt_handle(void); +extern void time_update(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + /* update the g_localtime by adding SYSTEMTICK_PERIOD_MS each SysTick interrupt */ + time_update(); +} + +#ifdef USE_ENET_INTERRUPT +/*! + \brief this function handles ethernet interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void ENET_IRQHandler(void) +{ + uint32_t reval; + + /* clear the enet DMA Rx interrupt pending bits */ + enet_interrupt_flag_clear(ENET_DMA_INT_FLAG_RS_CLR); + enet_interrupt_flag_clear(ENET_DMA_INT_FLAG_NI_CLR); + /* handles all the received frames */ + do{ + reval = enet_rxframe_size_get(); + + if(reval > 1){ + lwip_pkt_handle(); + } + }while(reval != 0); +} +#endif /* USE_ENET_INTERRUPT */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/hello_gigadevice.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/hello_gigadevice.c new file mode 100644 index 0000000..d875f04 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/hello_gigadevice.c @@ -0,0 +1,210 @@ +/*! + \file hello_gigadevice.c + \brief TCP server demo program + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "hello_gigadevice.h" +#include "lwip/tcp.h" +#include +#include +#include "gd32f10x.h" + +#define GREETING "\n\r======= HelloGigaDevice =======\ + \n\r== GD32 ==\ + \n\r== Telnet SUCCESS==\ + \n\rHello. What is your name?\r\n" +#define HELLO "\n\rGigaDevice��23��PORT Hello " +#define MAX_NAME_SIZE 32 + +extern const uint8_t gd32_str[]; +struct name +{ + int length; + char bytes[MAX_NAME_SIZE]; +}; + +static err_t hello_gigadevice_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err); +static err_t hello_gigadevice_accept(void *arg, struct tcp_pcb *pcb, err_t err); +static void hello_gigadevice_conn_err(void *arg, err_t err); + +/*! + \brief called when a data is received on the telnet connection + \param[in] arg: the user argument + \param[in] pcb: the tcp_pcb that has received the data + \param[in] p: the packet buffer + \param[in] err: the error value linked with the received data + \param[out] none + \retval err_t: error value +*/ +static err_t hello_gigadevice_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) +{ + struct pbuf *q; + struct name *name = (struct name *)arg; + int done; + char *c; + int i; + + /* we perform here any necessary processing on the pbuf */ + if (p != NULL){ + /* we call this function to tell the LwIp that we have processed the data */ + /* this lets the stack advertise a larger window, so more data can be received*/ + tcp_recved(pcb, p->tot_len); + + /* check the name if NULL, no data passed, return with illegal argument error */ + if(!name){ + pbuf_free(p); + return ERR_ARG; + } + + done = 0; + for(q=p; q != NULL; q = q->next){ + c = q->payload; + for(i=0; ilen && !done; i++){ + done = ((c[i] == '\r') || (c[i] == '\n')); + if(name->length < MAX_NAME_SIZE){ + name->bytes[name->length++] = c[i]; + } + } + } + + if(done){ + if(name->bytes[name->length-2] != '\r' || name->bytes[name->length-1] != '\n'){ + if((name->bytes[name->length-1] == '\r' || name->bytes[name->length-1] == '\n') && (name->length+1 <= MAX_NAME_SIZE)){ + name->length += 1; + }else if(name->length+2 <= MAX_NAME_SIZE){ + name->length += 2; + }else{ + name->length = MAX_NAME_SIZE; + } + + name->bytes[name->length-2] = '\r'; + name->bytes[name->length-1] = '\n'; + } + + tcp_write(pcb, HELLO, strlen(HELLO), 1); + tcp_write(pcb, name->bytes, name->length, TCP_WRITE_FLAG_COPY); + printf("\n\rGigaDevice\n\rTelnet %s %s", HELLO, name->bytes); + name->length = 0; + } + /* end of processing, we free the pbuf */ + pbuf_free(p); + + }else if (err == ERR_OK){ + /* when the pbuf is NULL and the err is ERR_OK, the remote end is closing the connection. */ + /* we free the allocated memory and we close the connection */ + mem_free(name); + return tcp_close(pcb); + } + return ERR_OK; +} + +/*! + \brief this function when the Telnet connection is established + \param[in] arg: user supplied argument + \param[in] pcb: the tcp_pcb which accepted the connection + \param[in] err: error value + \param[out] none + \retval err_t: error value +*/ +static err_t hello_gigadevice_accept(void *arg, struct tcp_pcb *pcb, err_t err) +{ + u32_t ipaddress; + u8_t iptxt[50]; + volatile u8_t iptab[4]; + + ipaddress = pcb->remote_ip.addr; + printf("\n\rTelnet hello_gigadevice_accept:%d.%d.%d.%d %s", + (u8_t)(ipaddress),(u8_t)(ipaddress >> 8),(u8_t)(ipaddress >> 16),(u8_t)(ipaddress >> 24),GREETING); + + /* read its IP address */ + iptab[0] = (u8_t)(ipaddress >> 24); + iptab[1] = (u8_t)(ipaddress >> 16); + iptab[2] = (u8_t)(ipaddress >> 8); + iptab[3] = (u8_t)(ipaddress); + + sprintf((char*)iptxt, "Telnet:%d.%d.%d.%d ", iptab[3], iptab[2], iptab[1], iptab[0]); + printf("%s\r\n",iptxt); + /* tell LwIP to associate this structure with this connection. */ + tcp_arg(pcb, mem_calloc(sizeof(struct name), 1)); + + /* configure LwIP to use our call back functions. */ + tcp_err(pcb, hello_gigadevice_conn_err); + tcp_recv(pcb, hello_gigadevice_recv); + + /* send out the first message */ + tcp_write(pcb, iptxt, strlen((char *)iptxt), 1); + sprintf((char*)iptxt, "Your telnet computer's IP is: %d.%d.%d.%d\n", iptab[3], iptab[2], iptab[1], iptab[0]); + printf("%s\r\n",iptxt); + tcp_write(pcb, gd32_str, strlen((char *)gd32_str), 1); + tcp_write(pcb, GREETING, strlen(GREETING), 1); + + return ERR_OK; +} + +/*! + \brief initialize the hello application + \param[in] none + \param[out] none + \retval none +*/ +void hello_gigadevice_init(void) +{ + struct tcp_pcb *pcb; + + /* create a new TCP control block */ + pcb = tcp_new(); + + /* assign to the new pcb a local IP address and a port number */ + /* using IP_ADDR_ANY allow the pcb to be used by any local interface */ + tcp_bind(pcb, IP_ADDR_ANY, 23); + + /* set the connection to the LISTEN state */ + pcb = tcp_listen(pcb); + + /* Specify the function to be called when a connection is established */ + tcp_accept(pcb, hello_gigadevice_accept); +} + +/*! + \brief this function is called when an error occurs on the connection + \param[in] arg: user supplied argument + \param[in] err: error value + \param[out] none + \retval none +*/ +static void hello_gigadevice_conn_err(void *arg, err_t err) +{ + struct name *name; + name = (struct name *)arg; + + mem_free(name); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/main.c new file mode 100644 index 0000000..1c83777 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/main.c @@ -0,0 +1,124 @@ +/*! + \file main.c + \brief enet demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "netconf.h" +#include "main.h" +#include "lwip/tcp.h" +#include "lwip/timeouts.h" +#include "gd32f10x_eval.h" +#include "hello_gigadevice.h" + +#define SYSTEMTICK_PERIOD_MS 10 + +__IO uint32_t g_localtime = 0; /* for creating a time reference incremented by 10ms */ +uint32_t timingdelay; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_com_init(EVAL_COM0); + + /* setup ethernet system(GPIOs, clocks, MAC, DMA, systick) */ + enet_system_setup(); + + /* initilaize the LwIP stack */ + lwip_stack_init(); + + /* initilaize the helloGigadevice module telnet 23 */ + hello_gigadevice_init(); + + while(1){ + +#ifndef USE_ENET_INTERRUPT + /* check if any packet received */ + if (enet_rxframe_size_get()){ + /* process received ethernet packet */ + lwip_pkt_handle(); + } +#endif /* USE_ENET_INTERRUPT */ + + /* handle periodic timers for LwIP */ +#ifdef TIMEOUT_CHECK_USE_LWIP + sys_check_timeouts(); + +#ifdef USE_DHCP + lwip_dhcp_process_handle(); +#endif /* USE_DHCP */ + +#else + lwip_periodic_handle(g_localtime); +#endif /* TIMEOUT_CHECK_USE_LWIP */ + } +} + +/*! + \brief insert a delay time + \param[in] ncount: number of 10ms periods to wait for + \param[out] none + \param[out] none +*/ +void delay_10ms(uint32_t ncount) +{ + /* capture the current local time */ + timingdelay = g_localtime + ncount; + + /* wait until the desired delay finish */ + while(timingdelay > g_localtime){ + } +} + +/*! + \brief updates the system local time + \param[in] none + \param[out] none + \param[out] none +*/ +void time_update(void) +{ + g_localtime += SYSTEMTICK_PERIOD_MS; +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/netconf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/netconf.c new file mode 100644 index 0000000..a85c473 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/netconf.c @@ -0,0 +1,241 @@ +/*! + \file netconf.c + \brief network connection configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "lwip/mem.h" +#include "lwip/memp.h" +#include "lwip/tcp.h" +#include "lwip/udp.h" +#include "netif/etharp.h" +#include "lwip/dhcp.h" +#include "ethernetif.h" +#include "stdint.h" +#include "main.h" +#include "netconf.h" +#include +#include "lwip/timeouts.h" +#include "lwip/priv/tcp_priv.h" + +#define MAX_DHCP_TRIES 4 + +typedef enum +{ + DHCP_START=0, + DHCP_WAIT_ADDRESS, + DHCP_ADDRESS_ASSIGNED, + DHCP_TIMEOUT +}dhcp_state_enum; + +#ifdef USE_DHCP +uint32_t dhcp_fine_timer = 0; +uint32_t dhcp_coarse_timer = 0; +dhcp_state_enum dhcp_state = DHCP_START; +#endif + +struct netif netif; +uint32_t tcp_timer = 0; +uint32_t arp_timer = 0; +ip_addr_t ip_address = {0}; + +void lwip_dhcp_process_handle(void); + +/*! + \brief initializes the LwIP stack + \param[in] none + \param[out] none + \retval none +*/ +void lwip_stack_init(void) +{ + ip_addr_t ipaddr; + ip_addr_t netmask; + ip_addr_t gw; + + /* initializes the dynamic memory heap defined by MEM_SIZE */ + mem_init(); + + /* initializes the memory pools defined by MEMP_NUM_x */ + memp_init(); + +#ifdef TIMEOUT_CHECK_USE_LWIP + sys_timeouts_init(); +#endif /* TIMEOUT_CHECK_USE_LWIP */ + +#ifdef USE_DHCP + ipaddr.addr = 0; + netmask.addr = 0; + gw.addr = 0; +#else + IP4_ADDR(&ipaddr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3); + IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3); + IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3); + +#endif /* USE_DHCP */ + + /* - netif_add(struct netif *netif, struct ip_addr *ipaddr, + struct ip_addr *netmask, struct ip_addr *gw, + void *state, err_t (* init)(struct netif *netif), + err_t (* input)(struct pbuf *p, struct netif *netif)) + + Adds your network interface to the netif_list. Allocate a struct + netif and pass a pointer to this structure as the first argument. + Give pointers to cleared ip_addr structures when using DHCP, + or fill them with sane numbers otherwise. The state pointer may be NULL. + + The init function pointer must point to a initialization function for + your ethernet netif interface. The following code illustrates it's use.*/ + netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input); + + /* registers the default network interface */ + netif_set_default(&netif); + + /* when the netif is fully configured this function must be called */ + netif_set_up(&netif); +} + +/*! + \brief called when a frame is received + \param[in] none + \param[out] none + \retval none +*/ +void lwip_pkt_handle(void) +{ + /* read a received packet from the Ethernet buffers and send it to the lwIP for handling */ + ethernetif_input(&netif); +} + +/*! + \brief LwIP periodic tasks + \param[in] localtime the current LocalTime value + \param[out] none + \retval none +*/ +void lwip_periodic_handle(__IO uint32_t localtime) +{ +#if LWIP_TCP + /* TCP periodic process every 250 ms */ + if (localtime - tcp_timer >= TCP_TMR_INTERVAL){ + tcp_timer = localtime; + tcp_tmr(); + } + +#endif /* LWIP_TCP */ + + /* ARP periodic process every 5s */ + if ((localtime - arp_timer) >= ARP_TMR_INTERVAL){ + arp_timer = localtime; + etharp_tmr(); + } + +#ifdef USE_DHCP + /* fine DHCP periodic process every 500ms */ + if (localtime - dhcp_fine_timer >= DHCP_FINE_TIMER_MSECS){ + dhcp_fine_timer = localtime; + dhcp_fine_tmr(); + if ((dhcp_state != DHCP_ADDRESS_ASSIGNED) && (dhcp_state != DHCP_TIMEOUT)){ + /* process DHCP state machine */ + lwip_dhcp_process_handle(); + } + } + + /* DHCP coarse periodic process every 60s */ + if (localtime - dhcp_coarse_timer >= DHCP_COARSE_TIMER_MSECS){ + dhcp_coarse_timer = localtime; + dhcp_coarse_tmr(); + } + +#endif /* USE_DHCP */ +} + +#ifdef USE_DHCP +/*! + \brief lwip_dhcp_process_handle + \param[in] none + \param[out] none + \retval none +*/ +void lwip_dhcp_process_handle(void) +{ + ip_addr_t ipaddr; + ip_addr_t netmask; + ip_addr_t gw; + struct dhcp *dhcp_client; + + dhcp_client = netif_dhcp_data(&netif); + + switch (dhcp_state){ + case DHCP_START: + dhcp_start(&netif); + ip_address.addr = 0; + dhcp_state = DHCP_WAIT_ADDRESS; + break; + + case DHCP_WAIT_ADDRESS: + /* read the new IP address */ + ip_address.addr = netif.ip_addr.addr; + + if (ip_address.addr != 0){ + dhcp_state = DHCP_ADDRESS_ASSIGNED; + /* stop DHCP */ + dhcp_stop(&netif); + + printf("\r\nDHCP -- eval board ip address: %d.%d.%d.%d \r\n", ip4_addr1_16(&ip_address), \ + ip4_addr2_16(&ip_address), ip4_addr3_16(&ip_address), ip4_addr4_16(&ip_address)); + }else{ + /* DHCP timeout */ + if (dhcp_client->tries > MAX_DHCP_TRIES){ + dhcp_state = DHCP_TIMEOUT; + /* stop DHCP */ + dhcp_stop(&netif); + + /* static address used */ + IP4_ADDR(&ipaddr, IP_ADDR0 ,IP_ADDR1 , IP_ADDR2 , IP_ADDR3 ); + IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1, NETMASK_ADDR2, NETMASK_ADDR3); + IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3); + netif_set_addr(&netif, &ipaddr , &netmask, &gw); + } + } + break; + + default: + break; + } +} +#endif /* USE_DHCP */ + +unsigned long sys_now(void) +{ + extern volatile unsigned int g_localtime; + return g_localtime; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/readme.txt new file mode 100644 index 0000000..0e74a5a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/ENET/Telnet/src/readme.txt @@ -0,0 +1,54 @@ +/*! + \file readme.txt + \brief description of the enet demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +enet peripherals to send and receive frames in normal mode and use lwip tcp/ip +stack to realize ping, telnet and tcp server functions. + + JP4,JP13,JP18,JP19 must be fitted. + + It is configured in RMII mode, and 25MHz oscillator should be used, the system clock +is configured to 108MHz. Users should configure ip address, mask and gw of GD32107C-EVAL +board according to the actual net situation from the private defines in main.h. + + This demo realize Telnet application, the eval board acts as tcp server. Users can link +the client with the eval board server, using 23 port. Users can see the reply from the +server, and can send the name(should input enter key) to server. + + By default, the packet reception is polled in while(1). If users want to receive packet in +interrupt service, uncomment the macro define USE_ENET_INTERRUPT in main.h. + + If users need dhcp function, it can be configured from the private defines in lwipopts.h and main.h. +This function is closed in default. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.c new file mode 100644 index 0000000..610ab39 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.c @@ -0,0 +1,103 @@ +/*! + \file exmc_lcd.c + \brief EXMC LCD driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "exmc_lcd.h" + +/*! + \brief lcd peripheral initialize + \param[in] none + \param[out] none + \retval none +*/ +void exmc_lcd_init(void) +{ + exmc_norsram_parameter_struct lcd_init_struct; + exmc_norsram_timing_parameter_struct lcd_timing_init_struct; + + /* EXMC clock enable */ + rcu_periph_clock_enable(RCU_EXMC); + rcu_periph_clock_enable(RCU_AF); + /* GPIO clock enable */ + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* configure EXMC_D[0~15]*/ + /* PD14(EXMC_D0), PD15(EXMC_D1),PD0(EXMC_D2), PD1(EXMC_D3), PD8(EXMC_D13), PD9(EXMC_D14), PD10(EXMC_D15) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15); + + /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), + PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | + GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); + + /* configure PE2(EXMC_A23) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + + /* configure NOE and NWE */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); + + /* configure EXMC_NE0(PD7) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + lcd_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_A; + lcd_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK; + lcd_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE; + lcd_timing_init_struct.bus_latency = 0; + lcd_timing_init_struct.asyn_data_setuptime = 5; + lcd_timing_init_struct.asyn_address_holdtime = 0; + lcd_timing_init_struct.asyn_address_setuptime = 2; + + lcd_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION0; + lcd_init_struct.write_mode = EXMC_ASYN_WRITE; + lcd_init_struct.extended_mode = DISABLE; + lcd_init_struct.asyn_wait = DISABLE; + lcd_init_struct.nwait_signal = DISABLE; + lcd_init_struct.memory_write = ENABLE; + lcd_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + lcd_init_struct.wrap_burst_mode = DISABLE; + lcd_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + lcd_init_struct.burst_mode = DISABLE; + lcd_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + lcd_init_struct.memory_type = EXMC_MEMORY_TYPE_SRAM; + lcd_init_struct.address_data_mux = DISABLE; + lcd_init_struct.read_write_timing = &lcd_timing_init_struct; + lcd_init_struct.write_timing = &lcd_timing_init_struct; + + exmc_norsram_init(&lcd_init_struct); + + exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION0); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.h new file mode 100644 index 0000000..807f8d0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/exmc_lcd.h @@ -0,0 +1,41 @@ +/*! + \file exmc_lcd.h + \brief the header file of EXMC LCD driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef EXMC_LCD_H +#define EXMC_LCD_H + +/* lcd peripheral initialize */ +void exmc_lcd_init(void); + +#endif /* EXMC_LCD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.c new file mode 100644 index 0000000..b8cb2f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.c @@ -0,0 +1,450 @@ +/*! + \file ili9320.c + \brief LCD driver functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "ili9320.h" +#include "ili9320_font.h" + +/*! + \brief write data to the selected LCD register + \param[in] register_id: the selected register id + \param[in] value: the register value to be written + \param[out] none + \retval none +*/ + +void lcd_register_write(uint16_t register_id,uint16_t value) +{ + *(__IO uint16_t *) (BANK0_LCD_C)= register_id; + *(__IO uint16_t *) (BANK0_LCD_D)= value; +} + +/*! + \brief read the value of LCD register + \param[in] register_id: the register id + \param[out] none + \retval the register value +*/ +uint16_t lcd_register_read(uint8_t register_id) +{ + uint16_t data; + *(__IO uint16_t *) (BANK0_LCD_C)= register_id; + data = *(__IO uint16_t *) (BANK0_LCD_D); + return data; +} + +/*! + \brief write command to LCD register + \param[in] value: the register value to be written + \param[out] none + \retval none +*/ +void lcd_command_write(uint16_t value) +{ + /* write 16-bit index, then write reg */ + *(__IO uint16_t *) (BANK0_LCD_D) = value; +} + +/*! + \brief prepare to write to the LCD GRAM register(R22h) + \param[in] none + \param[out] none + \retval none +*/ +void lcd_gram_write_prepare(void) +{ + *(__IO uint16_t *) (BANK0_LCD_C) = 0x0022; +} + +/*! + \brief write RGB code to the LCD GRAM register + \param[in] rgb_code: the pixel color in RGB mode (5-6-5) + \param[out] none + \retval none +*/ +void lcd_gram_write(uint16_t rgb_code) +{ + /* write 16-bit GRAM register */ + *(__IO uint16_t *) (BANK0_LCD_D) = rgb_code; +} + +/*! + \brief read data from GRAM + \param[in] none + \param[out] none + \retval GRAM value +*/ +uint16_t lcd_gram_read(void) +{ + uint16_t data; + + /* write GRAM register (R22h) */ + *(__IO uint16_t *) (BANK0_LCD_C) = 0x0022; + /* dummy read (invalid data) */ + *(__IO uint16_t *) (BANK0_LCD_D); + + data = *(__IO uint16_t *) (BANK0_LCD_D); + return data; +} + +/*! + \brief initialize the LCD + \param[in] none + \param[out] none + \retval none +*/ +void lcd_init(void) +{ + uint16_t i; + + if(1){ /*!< if(device_code == 0x8989) */ + lcd_register_write(0x0000,0x0001); + lcd_register_write(0x0003,0xA8A4); + lcd_register_write(0x000C,0x0000); + lcd_register_write(0x000D,0x080C); + lcd_register_write(0x000E,0x2B00); + lcd_register_write(0x001E,0x00B0); + lcd_register_write(0x0001,0x2B3F); + lcd_register_write(0x0002,0x0600); + lcd_register_write(0x0010,0x0000); + lcd_register_write(0x0011,0x6070); + lcd_register_write(0x0005,0x0000); + lcd_register_write(0x0006,0x0000); + lcd_register_write(0x0016,0xEF1C); + lcd_register_write(0x0017,0x0003); + lcd_register_write(0x0007,0x0233); + lcd_register_write(0x000B,0x0000); + lcd_register_write(0x000F,0x0000); + lcd_register_write(0x0041,0x0000); + lcd_register_write(0x0042,0x0000); + lcd_register_write(0x0048,0x0000); + lcd_register_write(0x0049,0x013F); + lcd_register_write(0x004A,0x0000); + lcd_register_write(0x004B,0x0000); + lcd_register_write(0x0044,0xEF00); + lcd_register_write(0x0045,0x0000); + lcd_register_write(0x0046,0x013F); + lcd_register_write(0x0030,0x0707); + lcd_register_write(0x0031,0x0204); + lcd_register_write(0x0032,0x0204); + lcd_register_write(0x0033,0x0502); + lcd_register_write(0x0034,0x0507); + lcd_register_write(0x0035,0x0204); + lcd_register_write(0x0036,0x0204); + lcd_register_write(0x0037,0x0502); + lcd_register_write(0x003A,0x0302); + lcd_register_write(0x003B,0x0302); + lcd_register_write(0x0023,0x0000); + lcd_register_write(0x0024,0x0000); + lcd_register_write(0x0025,0x8000); + lcd_register_write(0x004e,0); + lcd_register_write(0x004f,0); + }else{ + return; + } + + for(i=50000;i>0;i--); +} + +/*! + \brief set the cursor of LCD + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[out] none + \retval none +*/ +void lcd_cursor_set(uint16_t x,uint16_t y) +{ + lcd_register_write(0x004e,x); + lcd_register_write(0x004f,y); + +} + +/*! + \brief clear the LCD screen to the specified color + \param[in] color: specified screen color + \param[out] none + \retval none +*/ +void lcd_clear(uint16_t color) +{ + uint32_t index=0; + lcd_cursor_set(0,0); + /* prepare to write GRAM */ + lcd_gram_write_prepare(); + for(index=0;index<76800;index++){ + *(__IO uint16_t *) (BANK0_LCD_D) = color; + } +} + +/*! + \brief set the point according to the specified position and color + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[in] point: specified color of the point + \param[out] none + \retval none +*/ +void lcd_point_set(uint16_t x,uint16_t y,uint16_t point) +{ + if ((x > 240)||(y > 320)){ + return; + } + lcd_cursor_set(x,y); + lcd_gram_write_prepare(); + lcd_gram_write(point); +} + +/*! + \brief get point GRAM according to the specified position + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[out] none + \retval GRAM value of point +*/ +uint16_t lcd_point_get(uint16_t x,uint16_t y) +{ + uint16_t data; + + if ((x > 240)||(y > 320)){ + return 0; + } + + lcd_cursor_set(x,y); + data = lcd_gram_read(); + + return data; +} + +/*! + \brief set window area + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[out] none + \retval none +*/ +void lcd_windows_set(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y) +{ + lcd_cursor_set(start_x, start_y); + + lcd_register_write(0x0050, start_x); + lcd_register_write(0x0052, start_y); + lcd_register_write(0x0051, end_x); + lcd_register_write(0x0053, end_y); +} + +/*! + \brief draw a horizontal line on LCD screen + \param[in] x: the row-coordinate + \param[in] start_y: the start column-coordinate + \param[in] end_y: the end column-coordinate + \param[in] color: specified color of the point + \param[in] width: line width + \param[out] none + \retval none +*/ + +void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width) +{ + uint16_t i, y; + + for (i = 0; i < width; i++) { + uint16_t sx = x + i; + + for (y = start_y; y < end_y; y++) { + lcd_point_set(sx, y, color); + } + } +} + +/*! + \brief draw a rectangle according to the specified position and color + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[in] point: specified color of the point + \param[out] none + \retval none +*/ +void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point) +{ + uint16_t x,y; + x=start_x; + y=start_y; + /* draw four lines */ + for(x=start_x;xstart_x;x--){ + lcd_point_set(x,y,point); + } + for(y=end_y;y>start_y;y--){ + lcd_point_set(x,y,point); + } +} + +/*! + \brief fill the specified color to a rectangle + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[in] color: specified color + \param[out] none + \retval none +*/ +void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t color) +{ + uint16_t x, y; + x = start_x; + y = start_y; + + for (x = start_x; x < end_x; x++) { + for (y = start_y; y < end_y; y++) { + lcd_point_set(x, y, color); + } + } +} + +/*! + \brief draw a picture on LCD screen according to the specified position + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[in] pic: the picture pointer + \param[out] none + \retval none +*/ +void lcd_picture_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t *pic) +{ + uint32_t i, total; + uint16_t *picturepointer = pic; + uint16_t x,y; + + x = start_x; + y = start_y; + + total = (end_x - start_x + 1) * (end_y - start_y + 1); + + for(i = 0; i < total; i ++){ + /* set point according to the specified position and color */ + lcd_point_set(x,y,*picturepointer++); + x++; + if(x > end_x){ + y++; + x = start_x; + } + } +} + +/*! + \brief display a char on LCD screen according to the specified position + \param[in] x: the start position of row-coordinate + \param[in] y: the start position of column-coordinate + \param[in] c: the char + \param[in] char_color: the color of char + \param[in] c_format: the struct of char format + font: CHAR_FONT_8_16 or CHAR_FONT_16_24 + direction: CHAR_DIRECTION_HORIZONTAL or CHAR_DIRECTION_VERTICAL + char_color: the color of char + bk_color: the color of backgroud + \param[out] none + \retval none +*/ +void lcd_char_display(uint16_t x,uint16_t y,uint8_t c,char_format_struct c_format) +{ + uint16_t i = 0, j = 0; + uint8_t temp_char = 0; + uint16_t temp_char_16 = 0; + + if(CHAR_FONT_8_16 == c_format.font){ /* 8x16 ASCII */ + for (i = 0; i < 16; i++) { + temp_char = ascii_8x16[((c - 0x20) * 16) + i]; + if(CHAR_DIRECTION_HORIZONTAL == c_format.direction){ + for (j = 0; j < 8; j++) { + if (((temp_char >> (7 - j)) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x - i, y + j, c_format.char_color); + } else { + /* set point of background */ + lcd_point_set(x - i, y + j, c_format.bk_color); + } + } + }else{ + for (j = 0; j < 8; j++) { + if (((temp_char >> (7 - j)) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x + j, y + i, c_format.char_color); + } else { + /* set point of background */ + lcd_point_set(x + j, y + i, c_format.bk_color); + } + } + } + } + }else if(CHAR_FONT_16_24 == c_format.font){ /* 16x24 ASCII */ + for (i = 0; i < 24; i++) { + temp_char_16 = ASCII_Table_16x24[((c - 0x20) * 24) + i]; + if(CHAR_DIRECTION_HORIZONTAL == c_format.direction){ + for (j = 0; j < 16; j++) { + if (((temp_char_16 >> j) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x - i, y + j, c_format.char_color); + } else { + /* set point of background */ + lcd_point_set(x - i, y + j, c_format.bk_color); + } + } + }else{ + for (j = 0; j < 16; j++) { + if (((temp_char_16 >> j) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x + j, y + i, c_format.char_color); + } else { + /* set point of background */ + lcd_point_set(x + j, y + i, c_format.bk_color); + } + } + } + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.h new file mode 100644 index 0000000..57ed32f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320.h @@ -0,0 +1,229 @@ +/*! + \file ili9320.h + \brief LCD driver header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef ILI9320_H +#define ILI9320_H + +#include "gd32f10x.h" + +#define BANK0_LCD_D ((uint32_t)0x61000000) /*!< LCD Data ADDR */ +#define BANK0_LCD_C ((uint32_t)0x60000000) /*!< LCD Reg ADDR */ + +/* LCD registers */ +#define R0 0x00 +#define R1 0x01 +#define R2 0x02 +#define R3 0x03 +#define R4 0x04 +#define R5 0x05 +#define R6 0x06 +#define R7 0x07 +#define R8 0x08 +#define R9 0x09 +#define R10 0x0A +#define R11 0x0B +#define R12 0x0C +#define R13 0x0D +#define R14 0x0E +#define R15 0x0F +#define R16 0x10 +#define R17 0x11 +#define R18 0x12 +#define R19 0x13 +#define R20 0x14 +#define R21 0x15 +#define R22 0x16 +#define R23 0x17 +#define R24 0x18 +#define R25 0x19 +#define R26 0x1A +#define R27 0x1B +#define R28 0x1C +#define R29 0x1D +#define R30 0x1E +#define R31 0x1F +#define R32 0x20 +#define R33 0x21 +#define R34 0x22 +#define R35 0x23 +#define R36 0x24 +#define R37 0x25 +#define R40 0x28 +#define R41 0x29 +#define R43 0x2B +#define R45 0x2D +#define R48 0x30 +#define R49 0x31 +#define R50 0x32 +#define R51 0x33 +#define R52 0x34 +#define R53 0x35 +#define R54 0x36 +#define R55 0x37 +#define R56 0x38 +#define R57 0x39 +#define R58 0x3A +#define R59 0x3B +#define R60 0x3C +#define R61 0x3D +#define R62 0x3E +#define R63 0x3F +#define R64 0x40 +#define R65 0x41 +#define R66 0x42 +#define R67 0x43 +#define R68 0x44 +#define R69 0x45 +#define R70 0x46 +#define R71 0x47 +#define R72 0x48 +#define R73 0x49 +#define R74 0x4A +#define R75 0x4B +#define R76 0x4C +#define R77 0x4D +#define R78 0x4E +#define R79 0x4F +#define R80 0x50 +#define R81 0x51 +#define R82 0x52 +#define R83 0x53 +#define R96 0x60 +#define R97 0x61 +#define R106 0x6A +#define R118 0x76 +#define R128 0x80 +#define R129 0x81 +#define R130 0x82 +#define R131 0x83 +#define R132 0x84 +#define R133 0x85 +#define R134 0x86 +#define R135 0x87 +#define R136 0x88 +#define R137 0x89 +#define R139 0x8B +#define R140 0x8C +#define R141 0x8D +#define R143 0x8F +#define R144 0x90 +#define R145 0x91 +#define R146 0x92 +#define R147 0x93 +#define R148 0x94 +#define R149 0x95 +#define R150 0x96 +#define R151 0x97 +#define R152 0x98 +#define R153 0x99 +#define R154 0x9A +#define R157 0x9D +#define R192 0xC0 +#define R193 0xC1 +#define R229 0xE5 + +/* LCD color */ +#define WHITE 0xFFFF +#define BLACK 0x0000 +#define GREY 0xF7DE +#define BLUE 0x001F +#define BLUE2 0x051F +#define RED 0xF800 +#define MAGENTA 0xF81F +#define GREEN 0x07E0 +#define CYAN 0x7FFF +#define YELLOW 0xFFE0 + +#define LINE0 0 +#define LINE1 24 +#define LINE2 48 +#define LINE3 72 +#define LINE4 96 +#define LINE5 120 +#define LINE6 144 +#define LINE7 168 +#define LINE8 192 +#define LINE9 216 + +/* char format struct definitions */ +typedef struct +{ + uint16_t font; /*!< the type of font */ + uint16_t direction; /*!< the direction of char */ + uint16_t char_color; /*!< the color of char */ + uint16_t bk_color; /*!< the color of backgroud */ +}char_format_struct; + +#define CHAR_FONT_8_16 ((uint16_t)0x0000U) /*!< the font of char is 8X16 */ +#define CHAR_FONT_16_24 ((uint16_t)0x0001U) /*!< the font of char is 16X24 */ + +#define CHAR_DIRECTION_HORIZONTAL ((uint16_t)0x0000U) /*!< character display direction is horizontal */ +#define CHAR_DIRECTION_VERTICAL ((uint16_t)0x0001U) /*!< character display direction is vertical */ + +/* initize the LCD */ +void lcd_init(void); +/* write data to the selected LCD register */ +void lcd_register_write(uint16_t register_id,uint16_t value); +/* read the value of LCD register */ +uint16_t lcd_register_read(uint8_t register_id); +/* write command to LCD register */ +void lcd_command_write (uint16_t value); +/* prepare to write to the LCD GRAM */ +void lcd_gram_write_prepare(void); +/* write RGB code to the LCD GRAM register */ +void lcd_gram_write(uint16_t rgb_code); +/* read data from GRAM */ +uint16_t lcd_gram_read(void); +/* set the curson of LCD */ +void lcd_cursor_set(uint16_t x,uint16_t y); +/* clear the LCD screen to the specified color */ +void lcd_clear(uint16_t Color); +/* set the point according to the specified position and color */ +void lcd_point_set(uint16_t x,uint16_t y,uint16_t point); +/* get the point according to the specified position */ +uint16_t lcd_point_get(uint16_t x,uint16_t y); +/* set window area */ +void lcd_windows_set(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y); +/* draw a horizontal line on LCD screen */ +void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width); +/* draw a rectangle according to the specified position and color */ +void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point); +/* fill the specified color to a rectangle */ +void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t color); +/* draw a picture on LCD screen according to the specified position */ +void lcd_picture_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t *pic); +/* display a char on LCD screen according to the specified position */ +void lcd_char_display(uint16_t x,uint16_t y,uint8_t c,char_format_struct c_format); + +#endif /* ILI9320_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320_font.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320_font.h new file mode 100644 index 0000000..5fc3aad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/ili9320_font.h @@ -0,0 +1,711 @@ +/*! + \file ili9320_font.h + \brief LCD font header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +/* 8x16 ASCII */ +unsigned char const ascii_8x16[1536] = { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, +0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, +0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xCE,0xD6,0xD6,0xE6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00, +0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, +0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, +0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, +0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, +0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, +0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00 +}; + +/* ASCII Table: each character is 16 column (16dots large) + and 24 raw (24 dots high) */ +const uint16_t ASCII_Table_16x24[] = +{ +/** + * @brief Space ' ' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '!' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '"' + */ + 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '#' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, + 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, + 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, +/** + * @brief '$' + */ + 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, + 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, + 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, +/** + * @brief '%' + */ + 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, + 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, + 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, +/** + * @brief '&' + */ + 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, + 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, + 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ''' + */ + 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '(' + */ + 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, +/** + * @brief ')' + */ + 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, +/** + * @brief '*' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '+' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ',' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, +/** + * @brief '-' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '.' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '/' + */ + 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, + 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, + 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '0' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, + 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '1' + */ + 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '2' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '3' + */ + 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, + 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '4' + */ + 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, + 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '5' + */ + 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, + 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '6' + */ + 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, + 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '7' + */ + 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, + 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '8' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, + 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, + 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '9' + */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, + 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, + 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ':' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ';' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, +/** + * @brief '<' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, + 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '=' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '>' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, + 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '?' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, + 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '@' + */ + 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, + 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, + 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'A' + */ + 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, + 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, + 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'B' + */ + 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, + 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, + 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'C' + */ + 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, + 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'D' + */ + 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, + 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, + 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'E' + */ + 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'F' + */ + 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'G' + */ + 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, + 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, + 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'H' + */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'I' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'J' + */ + 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, + 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'K' + */ + 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, + 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'L' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'M' + */ + 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, + 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, + 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'N' + */ + 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, + 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, + 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'O' + */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'P' + */ + 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Q' + */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, + 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'R' + */ + 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, + 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'S' + */ + 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, + 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, + 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'T' + */ + 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'U' + */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'V' + */ + 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, + 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'W' + */ + 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, + 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, + 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'X' + */ + 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, + 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, + 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Y' + */ + 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, + 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'Z' + */ + 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, + 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, + 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '[' + */ + 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, +/** + * @brief '\' + */ + 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, + 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ']' + */ + 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, +/** + * @brief '^' + */ + 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, + 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '_' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief ''' + */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'a' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, + 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, + 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'b' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'c' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, + 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, + 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'd' + */ + 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'e' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, + 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'f' + */ + 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'g' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, + 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, + 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, +/** + * @brief 'h' + */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'i' + */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'j' + */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, +/** + * @brief 'k' + */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, + 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, + 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'l' + */ + 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'm' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, + 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, + 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'n' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'o' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, + 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'p' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, +/** + * @brief 'q' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, +/** + * @brief 'r' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, + 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 's' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, + 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 't' + */ + 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'u' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, + 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, + 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'v' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, + 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'w' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, + 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, + 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'x' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, + 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, + 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief 'y' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, + 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, + 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, +/** + * @brief 'z' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/** + * @brief '{' + */ + 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, +/** + * @brief '|' + */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, +/** + * @brief '}' + */ + 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, +/** + * @brief '~' + */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + }; diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/main.c new file mode 100644 index 0000000..f17c3b2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/main.c @@ -0,0 +1,85 @@ +/*! + \file main.c + \brief LCD test demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "exmc_lcd.h" +#include "ili9320.h" +#include "picture.h" + +uint8_t gd_website_string[]={"www.gigadevice.com"} ; +uint16_t device_code; +char_format_struct char_format; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint16_t i; + + /* configure the EXMC access mode */ + exmc_lcd_init(); + + /* read the LCD Controller device code:(0x8989) */ + device_code = lcd_register_read(0x0000); + + /* initialize the LCD */ + lcd_init(); + + /* clear the LCD screen */ + lcd_clear(WHITE); + + /* draw the picture of Gigadevice logo */ + lcd_picture_draw(40,100,40+160-1,100+87-1,(uint16_t *)(picture + BMP_HEADSIZE)); + + /* draw a rectangle */ + lcd_rectangle_draw(10,10,230,310,BLUE); + + /* configure char format */ + char_format.char_color = BLUE; + char_format.bk_color = WHITE; + char_format.direction = CHAR_DIRECTION_VERTICAL; + char_format.font = CHAR_FONT_8_16; + + /* draw character on LCD screen */ + for(i = 0; i < sizeof(gd_website_string)-1; i++){ + lcd_char_display((50+8*i), 180+20, *(gd_website_string+i),char_format); + } + + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.c new file mode 100644 index 0000000..985deab --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.c @@ -0,0 +1,1779 @@ +/*! + \file picture.c + \brief picture file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "picture.h" + +/* the picture of Gigadevice logo, 160*87 */ +const uint8_t picture[27848] = { 0X00,0X10,0XA0,0X00,0X57,0X00,0X01,0X1B, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XFF,0XDE,0XFF,0XFF,0XFF, +0XDE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XFD,0XFF, +0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0XFF,0XFF, +0XDF,0XF7,0XFF,0XFF,0XFF,0XF7,0XFE,0XF7,0XFE,0XF7,0XFE,0XF7,0XFF,0XF7,0XFE,0XF7, +0XFE,0XF7,0XFF,0XFF,0XDE,0XEF,0X5E,0XE7,0X7F,0XE7,0X7F,0XE7,0X5E,0XE7,0X5E,0XDF, +0X5E,0XE7,0X5F,0XE7,0X7F,0XE7,0X5F,0XE7,0X7E,0XE7,0X9E,0XE7,0XFF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XDF,0XF7,0XFF,0XFF,0XDF,0XF7, +0XDF,0XF7,0XFF,0XF7,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0X9E,0XEF,0X5D,0XE7,0X1C,0XDF,0XBB,0XCE,0X9B,0XCE,0X5B,0XC6, +0X99,0XAD,0X58,0XA5,0XB7,0X8C,0X37,0X7C,0XF6,0X73,0XF6,0X73,0XF6,0X73,0XF6,0X73, +0XD5,0X6B,0XB5,0X6B,0X94,0X63,0X33,0X5B,0X33,0X5B,0X12,0X53,0XF2,0X52,0X13,0X53, +0X53,0X5B,0X13,0X53,0X13,0X53,0X33,0X5B,0X11,0X53,0X52,0X5B,0XB3,0X63,0XB3,0X63, +0XB3,0X63,0XB3,0X63,0XB3,0X63,0XF4,0X6B,0X15,0X74,0XB7,0X94,0X18,0X9D,0X38,0XA5, +0X1B,0XBE,0X7B,0XCE,0XBB,0XD6,0XDB,0XD6,0X1C,0XDF,0X7D,0XEF,0XBE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDD,0XF7,0XFE,0XF7, +0XFE,0XF7,0XFF,0XF7,0XDF,0XEF,0XBE,0XE7,0X7E,0XDF,0X5E,0XDF,0X3C,0XB6,0X18,0X95, +0X16,0X74,0XB4,0X63,0X76,0X5B,0X55,0X53,0X95,0X63,0XB5,0X63,0X16,0X74,0X16,0X74, +0X15,0X74,0X35,0X74,0XD3,0X73,0XB2,0X73,0X92,0X6B,0X71,0X6B,0XF2,0X7B,0X12,0X7C, +0X12,0X7C,0X32,0X7C,0X73,0X84,0X97,0XAD,0XD7,0XB5,0XD7,0XB5,0XD8,0XB5,0XF8,0XB5, +0X19,0XBE,0XF8,0XB5,0X9A,0XCE,0X5D,0XE7,0X7D,0XEF,0X7D,0XEF,0X7D,0XEF,0X7D,0XEF, +0X7D,0XEF,0X1C,0XE7,0X38,0XC6,0XF7,0XBD,0XF7,0XBD,0XD8,0XB5,0XD9,0XB5,0X56,0XA5, +0X53,0X84,0XF2,0X7B,0XD1,0X73,0XB1,0X6B,0X91,0X6B,0XEE,0X5A,0X2F,0X63,0XD2,0X73, +0XB5,0X94,0X99,0XAD,0X5C,0XC6,0X3E,0XE7,0X3E,0XE7,0XBF,0XF7,0XBF,0XF7,0XBF,0XF7, +0XBF,0XFF,0XBF,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XDD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XBF,0XEF,0XFF,0XD6, +0X99,0XA5,0X36,0X84,0X73,0X63,0X73,0X63,0XB5,0X73,0XB5,0X73,0X38,0X7C,0X38,0X7C, +0XF7,0X73,0XB6,0X6B,0X93,0X63,0X11,0X53,0X72,0X63,0X14,0X74,0X18,0X95,0XDB,0XB5, +0X5C,0XC6,0X7F,0XE7,0X9F,0XEF,0XBF,0XF7,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0XFF,0XFF,0XDF,0XF7, +0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0X9E,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XBE,0XF7,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XFF,0XDF,0XF7,0XFF,0XF7,0XBF,0XEF,0XDF,0XF7,0XDF,0XF7, +0XBE,0XF7,0X7E,0XE7,0X7B,0XC6,0XD8,0XB5,0XF5,0X9C,0XD1,0X73,0X11,0X84,0X72,0X8C, +0X97,0XB5,0XDB,0XDE,0X7E,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XF7,0XFD,0XD6,0XD9,0XAD,0XF6,0X94,0X35,0X7C,0XD4,0X6B,0XB5,0X6B,0X37,0X7C, +0X38,0X7C,0X37,0X84,0XB5,0X73,0X54,0X6B,0X74,0X6B,0XB4,0X73,0XF9,0X9C,0X9B,0XAD, +0X7D,0XCE,0XDD,0XD6,0X5D,0XE7,0XBF,0XF7,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7,0XDF,0XFF,0X7E,0XF7, +0X1C,0XE7,0XDB,0XDE,0X9A,0XD6,0X18,0XC6,0XD7,0XBD,0X38,0XC6,0X59,0XCE,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0X1F,0XDF,0XBA,0XAD,0X97,0X8C, +0XD5,0X6B,0XF5,0X6B,0X16,0X74,0X15,0X74,0X15,0X74,0XD4,0X6B,0XB3,0X63,0X35,0X7C, +0XF8,0X94,0XD9,0XAD,0X7B,0XC6,0XFD,0XD6,0X7E,0XEF,0XDE,0XF7,0XFE,0XFF,0XFE,0XF7, +0XFD,0XFF,0XFD,0XFF,0XDE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDE,0XFF, +0XFE,0XFF,0XDE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XDE,0XFF,0XFF,0XFF,0XDE,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0X7D,0XEF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XF7, +0XDF,0XF7,0X5E,0XE7,0X5B,0XC6,0X58,0X9D,0X35,0X7C,0X74,0X63,0XD6,0X73,0X18,0X7C, +0XD6,0X6B,0XF6,0X73,0X16,0X74,0XF8,0X94,0XB9,0XAD,0X7B,0XC6,0X9F,0XE7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XFF,0XFF,0XF7,0XFF,0XF7,0XFE,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF, +0XFD,0XFF,0XFD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XDE,0XF7,0XDE,0XF7,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XBF,0XEF,0X5D,0XE7,0XBB,0XAD, +0X36,0X7C,0X72,0X63,0XD4,0X6B,0X56,0X7C,0X35,0X74,0XD4,0X6B,0XD4,0X6B,0XF8,0X8C, +0X5B,0XC6,0X5F,0XE7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFC,0XFF, +0XFD,0XF7,0XDF,0XF7,0XFF,0XF7,0X5F,0XE7,0XD7,0X94,0XF1,0X5A,0X94,0X6B,0X38,0X7C, +0X79,0X84,0X95,0X6B,0X53,0X5B,0X96,0X84,0X9D,0XC6,0XFF,0XF7,0XDF,0XEF,0XFF,0XF7, +0XFC,0XF7,0XFD,0XF7,0XDD,0XF7,0XFD,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XF7,0XFF,0XF7, +0X3E,0XDF,0X75,0X84,0X93,0X6B,0XD5,0X73,0X57,0X84,0XD4,0X6B,0X72,0X63,0X14,0X7C, +0X3C,0XBE,0X5E,0XE7,0XBF,0XEF,0XDF,0XF7,0XDF,0XF7,0XBE,0XF7,0XDE,0XF7,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XDD,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0X1C,0XE7,0X78,0XAD,0XF5,0X7B, +0XB6,0X73,0X18,0X7C,0XD8,0X73,0X96,0X6B,0X77,0X84,0X5B,0XBE,0X5E,0XDF,0XFD,0XF7, +0XFD,0XFF,0XFD,0XFF,0XFE,0XFF,0XDE,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF,0XBF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XDF,0XF7,0X9E,0XE7,0X7B,0XC6,0X55,0X7C,0XB5,0X63,0XF7,0X73,0X38,0X7C, +0XF6,0X73,0XF4,0X73,0X77,0XA5,0X3D,0XE7,0XFF,0XFF,0XDE,0XFF,0XDE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XBE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XDE,0XF7, +0X5D,0XE7,0X78,0XA5,0XB3,0X6B,0XB4,0X6B,0X78,0X84,0X37,0X7C,0XF5,0X73,0X55,0X84, +0XFA,0XB5,0XFF,0XF7,0XDF,0XF7,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XBE,0XEF,0XFF,0XF7,0XBE,0XEF,0X97,0XA5, +0X30,0X63,0XF6,0X73,0X58,0X84,0XF6,0X7B,0X33,0X63,0XF8,0X9C,0X9F,0XEF,0XFF,0XFF, +0XDE,0XF7,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XDE,0XF7,0XDF,0XF7,0X9E,0XE7,0XF6,0X94,0XB3,0X63,0X36,0X7C, +0X99,0X8C,0XF6,0X73,0X33,0X63,0XDB,0XB5,0XBF,0XF7,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0X7F,0XE7,0X17,0X9D,0XD4,0X73,0X16,0X7C,0X5A,0X7C,0XF7,0X73, +0XB4,0X6B,0XFA,0XB5,0X7F,0XEF,0XFF,0XF7,0XFE,0XFF,0XFD,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XFF,0XFF,0XFF,0XDF,0XF7, +0XBF,0XEF,0XB9,0XAD,0XF4,0X73,0X16,0X7C,0X37,0X7C,0X38,0X84,0XD5,0X73,0X9A,0XA5, +0X7E,0XE7,0XDE,0XF7,0XFE,0XF7,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XDD,0XD6, +0X96,0X8C,0XD4,0X73,0X37,0X84,0X37,0X84,0XD5,0X73,0X97,0X8C,0X3E,0XE7,0XFF,0XFF, +0XFE,0XF7,0XFD,0XFF,0XFD,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X9E,0XEF,0X1A,0XB6,0X92,0X63, +0X98,0X84,0X37,0X7C,0X16,0X7C,0X14,0X7C,0XFD,0XDE,0XFF,0XF7,0XFE,0XFF,0XDE,0XFF, +0XDE,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XBE,0XF7,0X12,0X7C,0X14,0X7C,0X77,0X84, +0X57,0X7C,0X95,0X63,0X5A,0XA5,0XDF,0XF7,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFD,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XDE,0XF7,0XFE,0XFF,0XDF,0XF7,0X7C,0XC6,0XB5,0X73,0X59,0X7C,0X37,0X74,0X56,0X7C, +0XD2,0X73,0XDC,0XD6,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XDD,0XF7,0XFE,0XFF,0XBE,0XF7, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDE,0XF7,0XDF,0XF7,0X78,0XAD,0XD5,0X73,0X38,0X84,0X57,0X7C,0X15,0X74,0XD7,0X94, +0XDF,0XF7,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XDF,0XF7, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDE,0XF7,0XFE,0XFF, +0XBE,0XEF,0X37,0X9D,0XF5,0X73,0X58,0X84,0X59,0X84,0X14,0X74,0X99,0XAD,0XDF,0XF7, +0XDF,0XF7,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XEF,0X7B,0XC6,0X77,0XAD, +0XD3,0X94,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFE,0XF7,0X5D,0XDF, +0X33,0X7C,0X37,0X7C,0X38,0X7C,0X17,0X74,0XD4,0X6B,0XDC,0XD6,0XDF,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XF7,0XDF,0XF7,0X16,0X74,0X31,0X5B,0X4F,0X5B, +0XFC,0XD6,0XDE,0XF7,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XF7,0XDF,0XF7,0X34,0X7C, +0X38,0X7C,0X3A,0X7C,0X39,0X7C,0X93,0X63,0XDC,0XCE,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XBF,0XF7,0XFF,0XFF,0X94,0X8C,0X54,0X5B,0X31,0X5B,0XFE,0XD6, +0X9F,0XEF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XF7,0XDF,0XF7,0X13,0X74,0XD5,0X6B, +0X5B,0X84,0X3A,0X7C,0X54,0X63,0X7E,0XE7,0XFE,0XF7,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XF7,0XFF,0XFF,0X9F,0XEF,0XFA,0XB5,0X0F,0X5B,0X72,0X63,0XFE,0XD6,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBF,0XEF,0X14,0X7C,0X16,0X74,0X79,0X84, +0X39,0X7C,0XB5,0X6B,0X9C,0XCE,0X7D,0XE7,0XDD,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XF7,0X7B,0XC6,0X30,0X5B,0X92,0X63,0XFD,0XD6,0XBF,0XEF,0XDF,0XF7, +0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XBE,0XF7,0X56,0X84,0X17,0X74,0X59,0X7C,0X38,0X7C, +0XF4,0X6B,0X97,0XA5,0XDF,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7, +0XDF,0XF7,0X9C,0XCE,0X50,0X5B,0X31,0X53,0X3E,0XD7,0XFE,0XF7,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDE,0XFF,0XBE,0XF7,0XFF,0XFF,0X57,0XA5,0XF7,0X73,0X5A,0X84,0X18,0X7C,0X36,0X7C, +0XD5,0X8C,0XFE,0XF7,0XBD,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XF7,0XDF,0XF7,0X9E,0XEF,0X9E,0XE7,0X3D,0XDF,0X1C,0XDF,0X1C,0XD7, +0X1C,0XDF,0X1C,0XD7,0XFC,0XCE,0X9A,0XC6,0X39,0XB6,0X39,0XB6,0X39,0XB6,0X39,0XB6, +0X39,0XB6,0X39,0XB6,0X39,0XB6,0X39,0XB6,0X19,0XB6,0X39,0XB6,0X3A,0XB6,0X3A,0XB6, +0X3A,0XB6,0X3A,0XB6,0X3A,0XB6,0X39,0XB6,0X39,0XB6,0X39,0XB6,0X39,0XB6,0X39,0XB6, +0X59,0XB6,0X39,0XB6,0X3A,0XB6,0X3A,0XB6,0X1B,0XAE,0X7C,0XBE,0XDE,0XCE,0X1E,0XD7, +0XFE,0XD6,0X71,0X63,0XB2,0X63,0X5F,0XD7,0XBF,0XE7,0XDE,0XF7,0XDE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XF7,0X7C,0XC6,0XD5,0X6B,0X59,0X7C,0X17,0X74,0X16,0X7C,0XD3,0X73, +0X3D,0XE7,0XDF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDE,0XF7, +0XDF,0XF7,0XDF,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XF7,0X9E,0XEF,0X9E,0XEF, +0X9E,0XEF,0X1C,0XD7,0X5D,0XDF,0XFC,0XCE,0X7A,0XBE,0X59,0XBE,0XF8,0XB5,0XB7,0XAD, +0X55,0X9D,0X77,0X9D,0X77,0X95,0X56,0X95,0X77,0X9D,0X19,0XAE,0XD8,0XA5,0XD8,0XA5, +0XF9,0XAD,0XF9,0XA5,0X1A,0XA6,0X1A,0XA6,0X19,0XA6,0X19,0XA6,0X1A,0XA6,0X1A,0XA6, +0X1A,0XA6,0X1A,0XA6,0X1A,0XA6,0X1A,0XA6,0X1A,0XA6,0X1A,0XA6,0X1A,0XA6,0X98,0X95, +0X98,0X95,0X98,0X95,0X98,0X95,0X98,0X95,0X77,0X8D,0X77,0X8D,0X78,0X8D,0X98,0X8D, +0X78,0X8D,0X99,0X8D,0X99,0X8D,0X9A,0X8D,0X9A,0X8D,0XBB,0X95,0X39,0X85,0X3A,0X8D, +0X73,0X5B,0XB4,0X63,0X1A,0X95,0X90,0X42,0X53,0X5B,0X91,0X5B,0X13,0X6C,0X17,0X95, +0X5C,0XBE,0XFD,0XD6,0X7E,0XE7,0XBF,0XF7,0XDF,0XF7,0XBF,0XF7,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XBF,0XEF,0XD3,0X73,0X58,0X7C,0X39,0X7C,0X58,0X7C,0XF5,0X73,0X5B,0XC6, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0X3C,0XE7,0X7D,0XEF,0X18,0XBE, +0X38,0XC6,0X9A,0XCE,0X59,0XC6,0XD7,0XB5,0XD7,0XB5,0X59,0XC6,0X9A,0XCE,0XFB,0XDE, +0XFC,0XD6,0XDF,0XF7,0XBF,0XEF,0XDF,0XF7,0XFF,0XF7,0XDF,0XF7,0XDF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XDF,0XEF,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XDF,0XEF,0XFF,0XEF,0XDF,0XE7,0XDF,0XE7,0XFF,0XEF,0XDF,0XE7, +0X3D,0XD7,0XFC,0XC6,0X3A,0XAE,0XB8,0XA5,0XF7,0X9D,0XB6,0X95,0X97,0X95,0XD2,0X63, +0X93,0X63,0X57,0X7C,0X14,0X53,0XF4,0X52,0X15,0X53,0X36,0X53,0X16,0X53,0X15,0X53, +0X54,0X5B,0X32,0X53,0X10,0X53,0X0F,0X4B,0XD1,0X63,0X16,0X95,0XBD,0XCE,0X9F,0XEF, +0XDF,0XF7,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XF3,0X73,0X36,0X7C,0X58,0X7C,0X58,0X7C,0X57,0X7C,0XF3,0X73,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XDF,0XFF,0X7D,0XEF,0X5D,0XE7,0X1B,0XDF, +0X1C,0XDF,0X3C,0XE7,0XFB,0XDE,0X1C,0XDF,0X9D,0XEF,0X7D,0XEF,0XBE,0XF7,0XBE,0XF7, +0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XF7,0XDE,0XF7, +0XFF,0XF7,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XFF,0XEF,0XFF,0XEF,0X51,0X74,0X12,0X74, +0X1E,0XD7,0X9A,0XA5,0X56,0X84,0XB5,0X6B,0X12,0X5B,0XD5,0X4A,0XF6,0X52,0X36,0X53, +0X35,0X53,0X55,0X53,0X33,0X4B,0X13,0X43,0X33,0X43,0X53,0X4B,0X13,0X53,0X12,0X53, +0XB4,0X6B,0X38,0X9D,0XFE,0XD6,0XFF,0XF7,0XFE,0XF7,0XDD,0XF7,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XF7, +0XFA,0XBD,0XD3,0X73,0X58,0X7C,0X39,0X7C,0X37,0X7C,0XB4,0X6B,0XFD,0XD6,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XBE,0XF7,0X9E,0XF7,0X7D,0XEF,0XDF,0XFF,0XBE,0XF7,0XDF,0XF7,0XDF,0XF7, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFE,0XFF,0XDE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XBF,0XEF,0X16,0X9D,0X94,0X8C,0X7F,0XEF, +0XDF,0XF7,0XDF,0XF7,0XFF,0XF7,0XDE,0XEF,0X9E,0XE7,0XBD,0XCE,0X9A,0XA5,0X15,0X6C, +0X32,0X53,0X13,0X4B,0X35,0X4B,0X36,0X4B,0X37,0X4B,0X37,0X4B,0X36,0X53,0X36,0X53, +0X15,0X53,0X13,0X53,0X52,0X5B,0XF3,0X73,0X3A,0XB6,0XBF,0XEF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X9F,0XEF, +0X31,0X63,0X16,0X7C,0X79,0X84,0X39,0X7C,0X57,0X7C,0X31,0X5B,0XDF,0XEF,0XFF,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XDE,0XF7,0XFF,0XFF,0XBE,0XF7,0X17,0XA5,0XD3,0X7B,0X9F,0XF7,0XBF,0XFF, +0XDF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XF7,0XFD,0XF7,0XFE,0XF7,0XFE,0XF7,0XFF,0XF7, +0X3E,0XDF,0XB9,0XA5,0XF5,0X6B,0X34,0X53,0X15,0X4B,0X16,0X4B,0X36,0X4B,0X36,0X53, +0X36,0X53,0X16,0X53,0X15,0X53,0X34,0X53,0XF2,0X4A,0X36,0X74,0X1E,0XDF,0XDF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XF7,0X5C,0XC6, +0XB4,0X6B,0X58,0X84,0X38,0X7C,0X58,0X74,0X16,0X7C,0X58,0X9D,0XFF,0XF7,0XDD,0XF7, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBE,0XEF,0XB7,0XB5,0X73,0X8C,0XBF,0XFF,0XFF,0XFF,0XDE,0XFF, +0XDE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XDF,0XF7,0XFF,0XF7,0X3B,0XBE,0XB2,0X6B,0X31,0X53,0X75,0X53,0XF4,0X4A, +0X16,0X4B,0X16,0X4B,0X37,0X53,0XF6,0X4A,0X16,0X53,0XF4,0X4A,0XB5,0X6B,0XFE,0XDE, +0XDF,0XF7,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XF7,0XFF,0XF7,0XD2,0X73, +0X78,0X84,0X59,0X7C,0X38,0X74,0X58,0X7C,0XD5,0X73,0XBF,0XEF,0XFE,0XF7,0XFD,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XF7,0X9E,0XEF,0X59,0XC6,0XD4,0X94,0XFF,0XFF,0XFF,0XFF,0XDE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XBD,0XF7,0XFE,0XFF,0XDE,0XF7,0XBE,0XF7,0X77,0XA5,0X6F,0X32,0X54,0X53, +0X35,0X53,0X16,0X53,0XF6,0X4A,0X57,0X53,0X16,0X4B,0X35,0X53,0X34,0X53,0XF4,0X73, +0XFF,0XF7,0XFD,0XF7,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7E,0XE7,0X50,0X5B, +0X37,0X7C,0X59,0X7C,0X58,0X7C,0X57,0X74,0X73,0X6B,0XFF,0XFF,0XFE,0XF7,0XFD,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XBE,0XEF,0X7E,0XE7,0XF4,0X94,0XBF,0XEF,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XDE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XDE,0XFF,0XFF,0XFF,0XBF,0XF7,0XBF,0XF7,0XF8,0X8C,0X32,0X53, +0X34,0X53,0X15,0X4B,0X36,0X53,0X15,0X4B,0X14,0X4B,0X55,0X53,0XF3,0X4A,0X53,0X5B, +0X9F,0XE7,0XFE,0XF7,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0X5B,0XC6,0XB4,0X6B, +0X38,0X7C,0X58,0X7C,0X57,0X7C,0X57,0X7C,0XF3,0X7B,0XDF,0XF7,0XFF,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XF7, +0X3C,0XE7,0X55,0XAD,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XF7,0X9F,0XEF,0X33,0X5B, +0X36,0X5B,0X16,0X4B,0X15,0X4B,0X75,0X53,0X35,0X4B,0X15,0X4B,0X34,0X53,0X51,0X53, +0X5F,0XDF,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFA,0XB5,0XF7,0X7B, +0X39,0X7C,0X57,0X7C,0X57,0X7C,0X57,0X7C,0XF3,0X7B,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X5D,0XEF, +0XD7,0XBD,0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XDF,0XF7,0X32,0X5B, +0X16,0X53,0X17,0X4B,0X35,0X4B,0X34,0X4B,0X14,0X4B,0X56,0X53,0X33,0X53,0X34,0X74, +0XFF,0XF7,0XDF,0XF7,0XBF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0X98,0XAD,0X17,0X7C, +0X39,0X7C,0X57,0X7C,0X57,0X7C,0X58,0X7C,0XF2,0X73,0XDF,0XF7,0XFF,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X1C,0XE7, +0XDF,0XFF,0XFF,0XFF,0X9E,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XF7,0XDF,0XEF,0X31,0X53, +0X15,0X53,0X16,0X4B,0X35,0X4B,0X34,0X4B,0X54,0X53,0XF4,0X4A,0X52,0X5B,0XFC,0XCE, +0X9F,0XEF,0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XB9,0XAD,0X17,0X7C, +0X39,0X7C,0X57,0X7C,0X57,0X7C,0X59,0X7C,0XD2,0X73,0XFF,0XF7,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X7D,0XEF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDC,0XC6,0X32,0X4B, +0XF4,0X4A,0X16,0X4B,0X15,0X4B,0X13,0X53,0X32,0X53,0X53,0X5B,0XBD,0XCE,0XBF,0XEF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XF7,0XD9,0XB5,0X17,0X7C, +0X39,0X7C,0X38,0X7C,0X58,0X7C,0X59,0X7C,0X91,0X63,0XFF,0XF7,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XEF,0X93,0X5B,0X14,0X4B, +0X36,0X53,0X16,0X53,0X14,0X53,0X32,0X5B,0X50,0X5B,0X5E,0XE7,0XBF,0XEF,0XFF,0XFF, +0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFE,0XFF,0XFE,0XF7,0XDC,0XD6,0X74,0X6B, +0X39,0X7C,0X58,0X7C,0X37,0X7C,0X39,0X7C,0XF4,0X73,0XDD,0XCE,0XDF,0XF7,0XFF,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X5D,0XEF,0X5D,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XF7,0XBF,0XF7,0X95,0X84,0X35,0X53,0X15,0X4B, +0X57,0X5B,0XF4,0X4A,0X13,0X53,0X96,0X84,0X9F,0XEF,0X7D,0XEF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0X7E,0XE7,0X12,0X5B, +0X59,0X84,0X57,0X7C,0X37,0X7C,0X59,0X7C,0X37,0X7C,0X14,0X74,0XFF,0XF7,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFB,0XDE,0XF7,0XBD,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XBF,0XF7,0XDF,0XF7,0X3E,0XDF,0X34,0X7C,0X11,0X53,0X16,0X53,0X15,0X53, +0XF3,0X4A,0X94,0X6B,0X1C,0XBE,0XFF,0XF7,0XBF,0XF7,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XDF,0XF7,0X97,0X8C, +0X58,0X84,0X36,0X7C,0X78,0X7C,0X39,0X7C,0X38,0X7C,0X94,0X6B,0XFD,0XD6,0XFF,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7, +0X9E,0XEF,0XB7,0XB5,0X73,0X8C,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0X9F,0XF7,0XBF,0XF7,0X3B,0XBE,0X52,0X5B,0X54,0X5B,0X14,0X4B,0X14,0X53,0X32,0X53, +0X17,0X95,0X7E,0XE7,0XDF,0XF7,0XBF,0XF7,0XFF,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFF,0XF7,0XFE,0XD6, +0X54,0X63,0X77,0X84,0X57,0X7C,0X39,0X7C,0X39,0X7C,0X37,0X7C,0X34,0X7C,0X9E,0XEF, +0XDE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0X5D,0XE7, +0X73,0X8C,0X93,0X8C,0XDF,0XF7,0X9E,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0X5D,0XE7,0X95,0X8C,0XF1,0X52,0X34,0X53,0XD4,0X42,0X56,0X53,0X55,0X7C,0X5F,0XDF, +0XDE,0XEF,0XDD,0XF7,0XFD,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0X73,0X84,0XF4,0X73,0X99,0X7C,0X19,0X6C,0X58,0X7C,0X57,0X7C,0XD4,0X6B,0XF7,0X94, +0XBF,0XEF,0XFF,0XFF,0XDE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFC,0XF7,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XFF,0XF7,0X9F,0XEF,0XFF,0XFF,0X1A,0XBE,0X0F,0X63, +0X97,0XAD,0XFF,0XFF,0XDD,0XF7,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFD,0XFF,0XFD,0XFF,0XFE,0XFF,0XDE,0XFF, +0XDF,0XFF,0XBF,0XF7,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFD,0XEF,0XFF,0XEF,0X9B,0X9D, +0XB3,0X42,0X16,0X53,0X15,0X5B,0XF2,0X5A,0X75,0X8C,0X7F,0XEF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XF7,0XB2,0X6B,0X77,0X7C,0X58,0X74,0X58,0X7C,0X37,0X7C,0X98,0X84,0XD4,0X6B, +0X78,0XA5,0XBF,0XEF,0XDF,0XF7,0XFF,0XFF,0XDE,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFD,0XFF,0XFE,0XFF,0XBF,0XF7,0X7E,0XEF,0XF2,0X7B,0X0F,0X63,0XDD,0XDE, +0XBF,0XF7,0XDF,0XF7,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBF,0XFF,0XBF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XBD,0XF7,0XFE,0XFF,0XFB,0XB5,0X72,0X63,0X52,0X5B, +0XF2,0X4A,0X12,0X53,0X7A,0XA5,0X7E,0XE7,0XFF,0XFF,0XDE,0XF7,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0X7F,0XE7,0XD3,0X6B,0X56,0X7C,0X59,0X7C,0X39,0X7C,0X38,0X7C,0X58,0X7C, +0XD4,0X73,0X55,0X84,0X3E,0XDF,0XFF,0XF7,0XDE,0XF7,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBF,0XFF,0XDF,0XFF, +0XBD,0XF7,0XDD,0XF7,0X5D,0XE7,0XD5,0X94,0X2F,0X63,0XB5,0X94,0X7F,0XEF,0XDF,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XBF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFE,0XF7, +0XDD,0XF7,0XFE,0XF7,0XBF,0XF7,0X79,0XAD,0XB3,0X73,0XF4,0X5A,0XD2,0X52,0XD4,0X73, +0X3B,0XB6,0X9F,0XE7,0XFF,0XF7,0XFE,0XF7,0XFE,0XFF,0XDD,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XBE,0XF7,0XFF,0XFF,0X7E,0XE7,0X74,0X84,0X16,0X74,0X38,0X7C,0X39,0X7C,0X59,0X7C, +0X58,0X7C,0X16,0X74,0XD3,0X6B,0X3A,0XBE,0XBF,0XEF,0XFE,0XF7,0XFE,0XF7,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF,0XDE,0XFF,0XBE,0XF7, +0XFE,0XDE,0X39,0XA5,0X31,0X63,0X13,0X7C,0X5B,0XC6,0XFF,0XFF,0XBF,0XF7,0XDF,0XF7, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XF7,0XFE,0XF7,0XDE,0XF7,0XFE,0XF7, +0X1D,0XDF,0X57,0XA5,0X72,0X6B,0XB2,0X52,0X96,0X73,0XF9,0X9C,0XFE,0XDE,0XDF,0XF7, +0XFF,0XF7,0XDD,0XEF,0XFE,0XF7,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XD6,0X84,0XF4,0X6B,0X37,0X7C,0X59,0X84, +0X38,0X7C,0X59,0X7C,0X78,0X84,0X93,0X63,0X77,0X84,0XFC,0XD6,0XDF,0XEF,0XFF,0XF7, +0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XF7,0XFE,0XF7,0XBF,0XEF,0XFC,0XD6,0X17,0X9D, +0X31,0X5B,0XD5,0X73,0XDB,0XB5,0XBF,0XF7,0XDF,0XF7,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFD,0XF7,0X9D,0XEF,0XBC,0XCE,0X97,0X8C, +0XF3,0X5A,0X53,0X63,0X96,0X8C,0XFC,0XD6,0XFE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFE,0XF7, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0X9C,0XCE,0X30,0X5B,0X56,0X7C, +0X58,0X7C,0XF7,0X73,0X39,0X7C,0X38,0X7C,0X38,0X7C,0XB3,0X6B,0X14,0X74,0XDE,0XCE, +0XBF,0XEF,0XFF,0XF7,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFD,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XF7,0XFF,0XFF,0XFF,0XF7,0X9E,0XEF,0XBD,0XCE,0XD4,0X73,0X31,0X5B,0X51,0X5B, +0XF9,0XAD,0XFF,0XEF,0XDF,0XF7,0XDF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBF,0XF7,0XFE,0XDE,0X98,0X8C,0XD0,0X52,0XF0,0X52,0X75,0X84, +0XDD,0XD6,0XDF,0XF7,0XFF,0XF7,0XFE,0XF7,0XFE,0XF7,0XFC,0XFF,0XFD,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XB9,0XB5, +0X51,0X63,0XF5,0X73,0X78,0X84,0X17,0X74,0X58,0X7C,0X57,0X7C,0X77,0X84,0X15,0X74, +0X93,0X63,0XBA,0XAD,0X9F,0XEF,0XFF,0XF7,0X9E,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XEF,0XDF,0XF7, +0XDF,0XEF,0XBD,0XCE,0X37,0X7C,0X32,0X5B,0X72,0X63,0XB1,0X6B,0X19,0XB6,0XDF,0XF7, +0XBD,0XE7,0XFF,0XF7,0XFE,0XF7,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFD,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XFF,0X9E,0XEF, +0X5E,0XE7,0XD5,0X9C,0XCD,0X52,0X4F,0X63,0XB8,0X94,0XBE,0XD6,0XDF,0XF7,0XFE,0XF7, +0XFD,0XF7,0XFD,0XF7,0XFF,0XFF,0XDF,0XFF,0XBF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFD,0XFF,0XFD,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0X5E,0XE7,0X1A,0XBE,0XD2,0X6B,0XB3,0X6B,0X76,0X7C,0X58,0X7C,0X57,0X7C,0X58,0X7C, +0X78,0X7C,0X16,0X74,0XD4,0X6B,0XF4,0X73,0X38,0X9D,0XFE,0XD6,0XDF,0XF7,0XFF,0XF7, +0XDF,0XF7,0XDF,0XF7,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XFF,0XF7,0XFF,0XF7,0X1E,0XDF,0X78,0XA5,0X75,0X84, +0XD3,0X73,0X31,0X5B,0X73,0X63,0X9A,0XAD,0XFD,0XD6,0XDE,0XF7,0XBD,0XF7,0XDE,0XF7, +0XFE,0XFF,0XFF,0XFF,0XDE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XBF,0XF7,0X7B,0XCE,0XB4,0X94,0XB0,0X73, +0X52,0X84,0XF8,0XBD,0X1D,0XDF,0XBF,0XF7,0XFD,0XF7,0XDD,0XF7,0XFE,0XFF,0XFF,0XFF, +0XDF,0XFF,0XBF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7, +0XFE,0XFF,0XDF,0XF7,0XDF,0XF7,0X9B,0XC6,0XF6,0X8C,0XD5,0X6B,0XF6,0X6B,0X58,0X7C, +0X38,0X7C,0X38,0X7C,0X58,0X7C,0X37,0X7C,0XF6,0X73,0XD4,0X6B,0X12,0X7C,0XF5,0X9C, +0XB7,0XB5,0X9A,0XCE,0X9E,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0X1C,0XE7,0X3A,0XC6,0X77,0XAD,0XF6,0X94,0X13,0X7C,0X92,0X6B,0X93,0X63,0XD4,0X6B, +0X39,0X9D,0X9B,0XC6,0XDD,0XF7,0XFE,0XF7,0XFF,0XFF,0XBF,0XF7,0XDF,0XFF,0XBF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDE,0XFF,0XDE,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0X3D,0XE7,0XD7,0XB5,0X95,0X94,0X13,0X7C,0XD6,0X9C,0X19,0XC6,0X5E,0XE7, +0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XFF,0XDE,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFD,0XFF,0XFD,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X5E,0XE7,0XB7,0XAD,0X73,0X84, +0XD2,0X73,0XF4,0X73,0X16,0X74,0X37,0X7C,0X58,0X7C,0X59,0X7C,0X5A,0X7C,0X39,0X74, +0XF7,0X6B,0X95,0X63,0XB5,0X63,0X36,0X74,0X5A,0X95,0XFA,0XAD,0X3A,0XBE,0XDC,0XD6, +0X5E,0XE7,0XBF,0XEF,0XDF,0XF7,0XDF,0XF7,0XFE,0XF7,0XFE,0XF7,0XFE,0XF7,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XF7,0XDE,0XF7,0XFF,0XF7, +0XBF,0XEF,0X9F,0XE7,0X3D,0XD7,0XBC,0XCE,0X1A,0XB6,0XDA,0XAD,0XF7,0X8C,0X55,0X7C, +0X92,0X63,0X94,0X63,0XD5,0X6B,0XD4,0X6B,0X95,0X84,0X56,0XA5,0XBA,0XD6,0XDE,0XF7, +0XFE,0XFF,0XFD,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XFF,0XF7,0XFF,0XF7,0XDF,0XF7,0XDB,0XD6,0XF8,0XB5, +0X93,0X8C,0X32,0X84,0X56,0XA5,0XBB,0XD6,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XF7,0XDF,0XF7,0XFF,0XF7, +0XFF,0XF7,0X1E,0XD7,0XBA,0XAD,0X55,0X7C,0XD4,0X6B,0XF5,0X73,0X16,0X74,0X57,0X7C, +0X57,0X7C,0X36,0X7C,0X77,0X84,0X97,0X84,0X36,0X7C,0X56,0X7C,0XF6,0X73,0X75,0X6B, +0X54,0X63,0X33,0X63,0X53,0X63,0X94,0X6B,0X16,0X7C,0X98,0X8C,0XD9,0X94,0XF9,0X94, +0XF9,0X9C,0X1A,0X9D,0X1A,0X9D,0XFA,0X9C,0XF9,0X9C,0X98,0X8C,0X98,0X8C,0XD5,0X73, +0X94,0X6B,0X95,0X6B,0X74,0X63,0X95,0X6B,0XB6,0X73,0X17,0X7C,0X95,0X6B,0XB6,0X73, +0X57,0X84,0X99,0XA5,0X1E,0XDF,0XFF,0XF7,0XDF,0XF7,0XFF,0XF7,0XFF,0XFF,0XDF,0XFF, +0XDE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XBE,0XF7,0XDF,0XFF,0X7E,0XEF,0XFC,0XDE,0X55,0XA5,0X51,0X84,0X14,0X9D,0X1C,0XDF, +0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDE,0XF7,0XBE,0XF7, +0XFF,0XFF,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XDF,0XEF,0X5F,0XE7,0XD9,0XAD, +0X94,0X84,0X91,0X63,0X71,0X63,0X72,0X63,0X52,0X63,0XD4,0X73,0XF6,0X73,0XF8,0X73, +0X39,0X7C,0X59,0X84,0X38,0X7C,0X79,0X84,0X59,0X84,0X59,0X84,0X99,0X8C,0X58,0X84, +0X38,0X7C,0X17,0X7C,0X17,0X7C,0X17,0X7C,0X37,0X7C,0XB4,0X6B,0X53,0X5B,0X74,0X63, +0X71,0X63,0X91,0X6B,0X74,0X84,0XD9,0XB5,0X9C,0XCE,0X7E,0XE7,0XFF,0XF7,0XFF,0XF7, +0XBE,0XEF,0XFE,0XF7,0XFE,0XF7,0XFE,0XF7,0XFE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0X18,0XC6,0X92,0X94,0X55,0XAD,0X3D,0XE7,0XDF,0XF7,0XBF,0XF7,0XDF,0XF7,0XDF,0XFF, +0XDF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XF7,0XFE,0XF7,0XFE,0XF7,0XFF,0XF7,0XDF,0XF7, +0XFF,0XFF,0XDF,0XF7,0XBF,0XF7,0X5E,0XEF,0X5E,0XEF,0X3E,0XE7,0XBD,0XCE,0X9C,0XC6, +0X7B,0XC6,0XD9,0XAD,0X37,0X9D,0X37,0X9D,0X37,0X9D,0X37,0X9D,0X16,0X95,0X3A,0XBE, +0X5B,0XBE,0X7B,0XC6,0X9C,0XCE,0XDC,0XCE,0X5D,0XDF,0X5E,0XE7,0X7E,0XE7,0X9E,0XEF, +0XDF,0XF7,0XFF,0XFF,0XFF,0XF7,0XFF,0XFF,0XFE,0XF7,0XFE,0XFF,0XDC,0XF7,0XFC,0XF7, +0XFC,0XF7,0XFD,0XFF,0XFD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X7D,0XEF,0X59,0XCE,0X96,0XB5,0X18,0XC6,0X1C,0XE7, +0X7D,0XEF,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XBF,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7, +0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X9E,0XF7,0X5D,0XEF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XFD,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF, +0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF,0XFE,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFE,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF, +0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0X9E,0XF7,0XDF,0XFF,0XBE,0XF7,0XDF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XBE,0XF7,0XFB,0XDE,0X3C,0XE7,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0X5D,0XEF,0X7D,0XEF, +0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF, +0X5D,0XEF,0X55,0XAD,0X49,0X4A,0XE3,0X18,0XA2,0X10,0X65,0X29,0X0C,0X63,0X96,0XB5, +0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XD7,0XBD,0X20,0X00,0X04,0X21,0XB6,0XB5,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XD3,0X9C,0X08,0X42,0X49,0X4A, +0X28,0X42,0X69,0X4A,0XEF,0X7B,0XB6,0XB5,0XBE,0XF7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBA,0XD6,0X20,0X00,0XA2,0X10, +0XD7,0XBD,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDB,0XDE, +0XE3,0X18,0X20,0X00,0X20,0X00,0X20,0X00,0X41,0X08,0X00,0X00,0X61,0X08,0X00,0X00, +0X28,0X42,0X3C,0XE7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XF3,0X9C,0X61,0X08,0X41,0X08,0X8A,0X52,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XEF,0X7B,0X20,0X00,0X20,0X00, +0X00,0X00,0X00,0X00,0X00,0X00,0X20,0X00,0XC7,0X39,0X3C,0XE7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X79,0XCE,0X20,0X00,0X00,0X00, +0XC7,0X39,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0X5D,0XEF,0XA2,0X10, +0X00,0X00,0X20,0X00,0X24,0X21,0XEF,0X7B,0X9A,0XD6,0XBA,0XD6,0X4D,0X6B,0X20,0X00, +0XC3,0X18,0XAE,0X73,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0X9E,0XF7,0X79,0XCE,0XEB,0X5A,0XBA,0XD6,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XDF,0XFF,0X9E,0XF7,0X9A,0XD6, +0X7D,0XEF,0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0X5D,0XEF, +0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XCF,0X7B,0X00,0X00,0X82,0X10, +0XAA,0X52,0X4D,0X6B,0X08,0X42,0X00,0X00,0X41,0X08,0XE3,0X18,0X1C,0XE7,0XBE,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0X9E,0XF7,0XFB,0XDE,0XBA,0XD6,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XBE,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X9E,0XF7,0XFF,0XFF, +0XFF,0XFF,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0X1C,0XE7,0XEB,0X5A, +0X38,0XC6,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X5D,0XEF,0XBA,0XD6,0X5D,0XEF,0XDF,0XFF,0XBE,0XF7, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0X9A,0XD6,0X5D,0XEF,0XFF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XB2,0X94,0X00,0X00, +0X41,0X08,0XC7,0X39,0XBA,0XD6,0XFF,0XFF,0X9E,0XF7,0XDF,0XFF,0XFF,0XFF,0XDB,0XDE, +0XD7,0XBD,0X9E,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XF7,0XBD,0X61,0X08,0X82,0X10,0X14,0XA5,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7D,0XEF,0X7D,0XEF,0XC7,0X39,0X41,0X08,0X20,0X00, +0X00,0X00,0X86,0X31,0XE3,0X18,0X41,0X08,0X69,0X4A,0X1C,0XE7,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X96,0XB5,0XE3,0X18,0X20,0X00, +0X20,0X00,0X41,0X08,0X69,0X4A,0X82,0X10,0X61,0X08,0XD3,0X9C,0XDF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X10,0X84,0X00,0X00,0X61,0X08, +0XB2,0X94,0XDF,0XFF,0XDF,0XFF,0X59,0XCE,0X82,0X10,0X00,0X00,0X8A,0X52,0XFF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0X59,0XCE, +0X86,0X31,0X41,0X08,0X20,0X00,0X41,0X08,0XA2,0X10,0X10,0X84,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XAA,0X52,0X41,0X08, +0X08,0X42,0X3C,0XE7,0XBE,0XF7,0XBE,0XF7,0X45,0X29,0X41,0X08,0X28,0X42,0XFB,0XDE, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBA,0XD6,0X82,0X10,0X41,0X08, +0XB2,0X94,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XBE,0XF7,0X71,0X8C,0XE3,0X18,0X20,0X00,0X00,0X00,0X20,0X00,0XE3,0X18,0X71,0X8C, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7, +0X7D,0XEF,0XB2,0X94,0XC3,0X18,0X41,0X08,0X00,0X00,0X41,0X08,0XE3,0X18,0X14,0XA5, +0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0X49,0X4A,0X20,0X00, +0X82,0X10,0XD7,0XBD,0XDF,0XFF,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X9E,0XF7,0XBE,0XF7,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X18,0XC6,0X00,0X00,0X61,0X08,0X10,0X84,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X65,0X29,0X41,0X08,0X20,0X00,0XA2,0X10, +0X45,0X29,0X61,0X08,0X20,0X00,0X00,0X00,0X45,0X29,0X1C,0XE7,0XBE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X1C,0XE7,0X61,0X08,0X20,0X00,0X61,0X08, +0X24,0X21,0XA6,0X31,0X20,0X00,0X00,0X00,0X20,0X00,0XEB,0X5A,0XBE,0XF7,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XCF,0X7B,0X00,0X00,0X82,0X10, +0XB2,0X94,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XE7,0X39,0X20,0X00,0X04,0X21,0X5D,0XEF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDB,0XDE,0XC3,0X18, +0X20,0X00,0XE3,0X18,0XA6,0X31,0X8A,0X52,0X82,0X10,0X00,0X00,0X8A,0X52,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X1C,0XE7,0X82,0X10, +0X20,0X00,0X71,0X8C,0XBE,0XF7,0X59,0XCE,0X20,0X00,0X61,0X08,0X2C,0X63,0XBE,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X20,0X00, +0X8E,0X73,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7, +0XCF,0X7B,0X00,0X00,0X20,0X00,0X82,0X10,0X86,0X31,0X65,0X29,0X20,0X00,0X61,0X08, +0X8E,0X73,0XBE,0XF7,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0X96,0XB5,0X20,0X00,0X20,0X00,0XC3,0X18,0X08,0X42,0X28,0X42,0X00,0X00,0X61,0X08, +0X10,0X84,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XE7,0X39,0X00,0X00, +0XE3,0X18,0X1C,0XE7,0XDF,0XFF,0XDF,0XFF,0XAA,0X52,0X08,0X42,0XE7,0X39,0XE7,0X39, +0XE7,0X39,0X69,0X4A,0XDB,0XDE,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XF7,0XBD,0X20,0X00,0X20,0X00,0X4D,0X6B,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X5D,0XEF,0X61,0X08,0X20,0X00,0XE7,0X39,0XB6,0XB5, +0X7D,0XEF,0XBA,0XD6,0X82,0X10,0X00,0X00,0X45,0X29,0X1C,0XE7,0XBE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X0C,0X63,0X61,0X08,0X61,0X08,0X0C,0X63, +0XBA,0XD6,0X7D,0XEF,0X92,0X94,0X20,0X00,0X20,0X00,0XCB,0X5A,0XDF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XCF,0X7B,0X00,0X00,0X61,0X08, +0XB2,0X94,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X49,0X4A,0X20,0X00,0X82,0X10,0X3C,0XE7, +0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X4D,0X6B,0X00,0X00, +0X82,0X10,0X49,0X4A,0X55,0XAD,0X55,0XAD,0XCF,0X7B,0X20,0X00,0X20,0X00,0X14,0XA5, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X8A,0X52, +0X00,0X00,0X24,0X21,0X3C,0XE7,0X45,0X29,0X00,0X00,0X24,0X21,0XD7,0XBD,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X00,0X00, +0X6D,0X6B,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFB,0XDE, +0X00,0X00,0X20,0X00,0X45,0X29,0X34,0XA5,0XBE,0XF7,0XBE,0XF7,0X59,0XCE,0X71,0X8C, +0X1C,0XE7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0X08,0X42,0X20,0X00,0XA2,0X10,0X0C,0X63,0X75,0XAD,0X55,0XAD,0X2C,0X63,0X00,0X00, +0X20,0X00,0XF7,0XBD,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0X8E,0X73,0X41,0X08, +0X41,0X08,0XFB,0XDE,0X9E,0XF7,0XDF,0XFF,0X45,0X29,0X20,0X00,0X00,0X00,0X20,0X00, +0X20,0X00,0X61,0X08,0X2C,0X63,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XF7,0XBD,0X00,0X00,0X20,0X00,0X8E,0X73,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X61,0X08,0XEF,0X7B,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0X24,0X21,0X00,0X00,0X45,0X29,0X1C,0XE7,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XA6,0X31,0X00,0X00,0X04,0X21,0XD7,0XBD, +0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0X82,0X10,0X00,0X00,0X2C,0X63,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XEF,0X7B,0X00,0X00,0X61,0X08, +0XB2,0X94,0XFF,0XFF,0XBE,0XF7,0XDF,0XFF,0XC7,0X39,0X00,0X00,0XE3,0X18,0XFB,0XDE, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0X24,0X21,0X20,0X00, +0X00,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,0X00,0XCB,0X5A, +0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFB,0XDE, +0X61,0X08,0X20,0X00,0X8A,0X52,0X00,0X00,0X41,0X08,0X0C,0X63,0XBE,0XF7,0XBE,0XF7, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X00,0X00, +0X6D,0X6B,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X96,0XB5, +0X00,0X00,0X20,0X00,0X8E,0X73,0X9E,0XF7,0XFF,0XFF,0XBE,0XF7,0XBE,0XF7,0XDF,0XFF, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X9E,0XF7, +0XA2,0X10,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,0X00,0X20,0X00,0X20,0X00, +0X00,0X00,0X71,0X8C,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X59,0XCE,0X00,0X00, +0X00,0X00,0XEB,0X5A,0XDF,0XFF,0XBE,0XF7,0XBE,0XF7,0X14,0XA5,0X14,0XA5,0XE3,0X18, +0X00,0X00,0XE3,0X18,0X75,0XAD,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X38,0XC6,0X00,0X00,0X41,0X08,0X71,0X8C,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X9E,0XF7,0X20,0X00,0X41,0X08,0X6D,0X6B,0XDF,0XFF, +0X9E,0XF7,0X7D,0XEF,0XC3,0X18,0X00,0X00,0X45,0X29,0XFB,0XDE,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X0C,0X63,0X61,0X08,0XC3,0X18,0XF7,0XBD, +0XBE,0XF7,0XDF,0XFF,0X18,0XC6,0X20,0X00,0X20,0X00,0XCB,0X5A,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XAE,0X73,0X00,0X00,0X82,0X10, +0XB2,0X94,0XDF,0XFF,0XDF,0XFF,0X92,0X94,0X00,0X00,0X41,0X08,0XA6,0X31,0X9E,0XF7, +0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0X28,0X42,0X00,0X00, +0X65,0X29,0X92,0X94,0X51,0X8C,0XF3,0X9C,0XB2,0X94,0X92,0X94,0X92,0X94,0XD3,0X9C, +0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0X8A,0X52,0X20,0X00,0X00,0X00,0X00,0X00,0X04,0X21,0XD7,0XBD,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X00,0X00, +0X6D,0X6B,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X18,0XC6, +0X20,0X00,0X00,0X00,0X71,0X8C,0XDF,0XFF,0X9E,0XF7,0XFF,0XFF,0XBE,0XF7,0XDF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7, +0X04,0X21,0X82,0X10,0XA6,0X31,0XEF,0X7B,0XB2,0X94,0X71,0X8C,0XD3,0X9C,0X10,0X84, +0X14,0XA5,0XF7,0XBD,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XCF,0X7B, +0X41,0X08,0X20,0X00,0XE3,0X18,0XB2,0X94,0X96,0XB5,0X51,0X8C,0XC3,0X18,0X00,0X00, +0X61,0X08,0X69,0X4A,0XBE,0XF7,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X38,0XC6,0X20,0X00,0X20,0X00,0X92,0X94,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X45,0X29,0X00,0X00,0X61,0X08,0XCB,0X5A, +0X8E,0X73,0XC3,0X18,0X00,0X00,0X00,0X00,0X45,0X29,0X1C,0XE7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDB,0XDE,0X41,0X08,0X61,0X08,0XA6,0X31, +0X34,0XA5,0XEF,0X7B,0X61,0X08,0X00,0X00,0X20,0X00,0XAA,0X52,0XFF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XCF,0X7B,0X00,0X00,0X00,0X00, +0X45,0X29,0X08,0X42,0XE3,0X18,0X00,0X00,0X00,0X00,0XA2,0X10,0X30,0X84,0XFF,0XFF, +0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0X38,0XC6,0X20,0X00, +0X00,0X00,0XEB,0X5A,0X7D,0XEF,0X55,0XAD,0X86,0X31,0X8A,0X52,0XFB,0XDE,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X9E,0XF7, +0X79,0XCE,0X20,0X00,0X20,0X00,0X00,0X00,0XCB,0X5A,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDB,0XDE,0X00,0X00,0X20,0X00, +0XCF,0X7B,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0X69,0X4A,0X41,0X08,0X41,0X08,0X10,0X84,0X38,0XC6,0X71,0X8C,0XA2,0X10,0X2C,0X63, +0X5D,0XEF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF, +0X14,0XA5,0X00,0X00,0X00,0X00,0XEF,0X7B,0X3C,0XE7,0XB2,0X94,0XC3,0X18,0X2C,0X63, +0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XF3,0X9C,0XA2,0X10,0X00,0X00,0X20,0X00,0X00,0X00,0X20,0X00,0X00,0X00,0X82,0X10, +0X49,0X4A,0XBA,0XD6,0XBE,0XF7,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X96,0XB5,0X20,0X00,0X41,0X08,0X30,0X84,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X9E,0XF7,0X49,0X4A,0X20,0X00,0X00,0X00, +0X00,0X00,0X82,0X10,0X20,0X00,0X00,0X00,0X45,0X29,0XFB,0XDE,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X55,0XAD,0X82,0X10,0X00,0X00, +0X00,0X00,0X41,0X08,0X41,0X08,0X20,0X00,0X41,0X08,0XCB,0X5A,0XFF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XAE,0X73,0X00,0X00,0X00,0X00, +0X00,0X00,0X00,0X00,0X20,0X00,0X41,0X08,0XC3,0X18,0XCF,0X7B,0X9E,0XF7,0XFF,0XFF, +0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0X14,0XA5, +0X82,0X10,0X20,0X00,0X41,0X08,0X20,0X00,0X00,0X00,0XA2,0X10,0XAA,0X52,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XBE,0XF7,0X69,0X4A,0X20,0X00,0X45,0X29,0XF7,0XBD,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBA,0XD6,0X00,0X00,0X20,0X00, +0X8E,0X73,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7, +0X5D,0XEF,0X28,0X42,0X20,0X00,0X00,0X00,0X20,0X00,0X00,0X00,0X20,0X00,0XC3,0X18, +0X10,0X84,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0X7D,0XEF,0X92,0X94,0X00,0X00,0X20,0X00,0X20,0X00,0X00,0X00,0X20,0X00,0X82,0X10, +0X4D,0X6B,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XBE,0XF7, +0XDF,0XFF,0X1C,0XE7,0XD3,0X9C,0X69,0X4A,0XA6,0X31,0XC7,0X39,0XCB,0X5A,0XB2,0X94, +0X5D,0XEF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0X9E,0XF7,0XD3,0X9C,0X6D,0X6B,0X14,0XA5,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0X9E,0XF7,0XD7,0XBD,0XD7,0XBD,0XD7,0XBD,0X10,0X84, +0XCF,0X7B,0XEF,0X7B,0X41,0X08,0X00,0X00,0X08,0X42,0XBE,0XF7,0XBE,0XF7,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XBA,0XD6,0X10,0X84, +0X08,0X42,0X08,0X42,0X92,0X94,0XF3,0X9C,0X6D,0X6B,0XB2,0X94,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFB,0XDE,0X71,0X8C,0X6D,0X6B, +0X6D,0X6B,0X4D,0X6B,0X6D,0X6B,0X51,0X8C,0X59,0XCE,0XBE,0XF7,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7, +0XDB,0XDE,0X51,0X8C,0X69,0X4A,0XC7,0X39,0XCB,0X5A,0XB2,0X94,0X5D,0XEF,0XFF,0XFF, +0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XFF,0XFF,0X1C,0XE7,0X51,0X8C,0XCF,0X7B,0X7D,0XEF,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X9E,0XF7,0X55,0XAD,0X8E,0X73, +0XF3,0X9C,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XDF,0XFF, +0XDF,0XFF,0XFF,0XFF,0XD7,0XBD,0X6D,0X6B,0XE7,0X39,0XE7,0X39,0X0C,0X63,0X75,0XAD, +0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0X79,0XCE,0X8E,0X73,0XE7,0X39,0XC7,0X39,0XCB,0X5A,0X96,0XB5, +0XBE,0XF7,0XDF,0XFF,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0X7D,0XEF,0XC3,0X18,0X00,0X00,0X04,0X21,0X69,0X4A, +0XAA,0X52,0XE3,0X18,0X00,0X00,0X82,0X10,0X4D,0X6B,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XA6,0X31,0X41,0X08,0X20,0X00, +0X00,0X00,0X00,0X00,0X41,0X08,0XAA,0X52,0XBA,0XD6,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X9E,0XF7,0XBE,0XF7,0XDF,0XFF,0X5D,0XEF,0X55,0XAD, +0X51,0X8C,0X92,0X94,0X79,0XCE,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0XDF,0XFF,0XBE,0XF7,0XFF,0XFF, +0XBE,0XF7,0XFF,0XFF,0XBE,0XF7,0XDF,0XFF,0XFF,0XFF,0XBE,0XF7,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, +}; diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.h new file mode 100644 index 0000000..6461a9e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/picture.h @@ -0,0 +1,44 @@ +/*! + \file picture.h + \brief picture header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef PICTURE_H +#define PICTURE_H + +#include "gd32f10x.h" + +#define BMP_HEADSIZE (8) + +extern const uint8_t picture[]; + +#endif /* PICTURE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/readme.txt new file mode 100644 index 0000000..3b0471f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/LCD/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of the EXMC_LCD demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use EXMC +peripheral to drive LCD. This board uses EXMC_NE0 to support LCD. You can see +GigaDevice logo and website on the LCD screen. + + P2 and P3 must be fitted. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.c new file mode 100644 index 0000000..2817e38 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.c @@ -0,0 +1,586 @@ +/*! + \file exmc_nandflash.c + \brief nandflash(hynix HY27UF081G2A) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "exmc_nandflash.h" + +/* defines the physical address of nand flash, and it is determined by the hardware */ +#define BANK1_NAND_ADDR ((uint32_t)0x70000000) +#define BANK_NAND_ADDR BANK1_NAND_ADDR + +/* define operating nand flash macro */ +#define NAND_CMD_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_CMD_AREA) +#define NAND_ADDR_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_ADDR_AREA) +#define NAND_DATA_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA) + +/* the macro of calculate nand flash operating address */ +#define ROW_ADDRESS (address.page + (address.block + (address.zone * NAND_ZONE_SIZE)) * NAND_BLOCK_SIZE) + +/* page bit count per block */ +#define PAGE_BIT 6 + +/* function prototypes */ +/* write a set of data to nand flash for the specified pages addresses */ +static uint8_t exmc_nand_writepage(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount); +/* read a set of data from nand flash for the specified pages addresses */ +static uint8_t exmc_nand_readpage(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount); +/* write the main area information for the specified pages addresses */ +static uint8_t exmc_nand_writedata(uint8_t *pbuffer, nand_address_struct physicaladdress, uint16_t bytecount); +/* read the main area information for the specified pages addresses */ +static uint8_t exmc_nand_readdata(uint8_t *pbuffer, nand_address_struct phyaddress, uint16_t bytecount); +/* erase data specified block */ +static uint8_t exmc_nand_eraseblock(uint32_t blocknum); +/* reads the NAND memory status */ +static uint8_t exmc_nand_readstatus(void); +/* get the NAND operation status */ +static uint8_t exmc_nand_getstatus(void); + +/*! + \brief nand flash peripheral initialize + \param[in] none + \param[out] none + \retval none +*/ +void exmc_nandflash_init(void) +{ + exmc_nand_parameter_struct nand_init_struct; + exmc_nand_pccard_timing_parameter_struct nand_timing_init_struct; + + /* enable EXMC clock*/ + rcu_periph_clock_enable(RCU_EXMC); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + rcu_periph_clock_enable(RCU_GPIOF); + rcu_periph_clock_enable(RCU_GPIOG); + + /* configure GPIO EXMC_D[0-7] */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_14 | GPIO_PIN_15); + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10); + + /* configure GPIO ALE(EXMC_A16) and CLE(EXMC_A17) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11 | GPIO_PIN_12); + + /* configure NOE(PD4) and NWE(PD5)*/ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); + + /* configure NWAIT(PD6) */ + gpio_init(GPIOD, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /* configure NCE1(PD7) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + /* EXMC configuration */ + nand_timing_init_struct.setuptime = 1; + nand_timing_init_struct.waittime = 3; + nand_timing_init_struct.holdtime = 2; + nand_timing_init_struct.databus_hiztime = 2; + + nand_init_struct.nand_bank = EXMC_BANK1_NAND; + nand_init_struct.ecc_size = EXMC_ECC_SIZE_2048BYTES; + nand_init_struct.atr_latency = EXMC_ALE_RE_DELAY_1_HCLK; + nand_init_struct.ctr_latency = EXMC_CLE_RE_DELAY_1_HCLK; + nand_init_struct.ecc_logic = ENABLE; + nand_init_struct.databus_width = EXMC_NAND_DATABUS_WIDTH_8B; + nand_init_struct.wait_feature = ENABLE; + nand_init_struct.common_space_timing = &nand_timing_init_struct; + nand_init_struct.attribute_space_timing = &nand_timing_init_struct; + + exmc_nand_init(&nand_init_struct); + + /* enable EXMC NAND bank1 */ + exmc_nand_enable(EXMC_BANK1_NAND); +} + + +/*! + \brief read NAND flash ID + \param[in] nand_id: structure of nand flash ID + \param[out] none + \retval none +*/ +void nand_read_id(nand_id_struct* nand_id) +{ + uint32_t data = 0; + + /* send command to the command area */ + NAND_CMD_AREA = NAND_CMD_READID; + + /* send address to the address area */ + NAND_ADDR_AREA = 0x00; + + /* read id from NAND flash */ + data = *(__IO uint32_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA); + + nand_id->maker_id = ADDR_1ST_CYCLE (data); + nand_id->device_id = ADDR_2ND_CYCLE (data); + nand_id->third_id = ADDR_3RD_CYCLE (data); + nand_id->fourth_id = ADDR_4TH_CYCLE (data); +} + +/*! + \brief write a set of data to nand flash for the specified pages addresses + \param[in] pbuffer: pointer on the buffer containing data to be written + \param[in] address: the address of the data to be written + \param[in] bytecount: byte count to be written(bytecount + address.page_in_offset <= nand_page_total_size) + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_writepage(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount) +{ + uint16_t i; + + /* send 1st cycle page programming command to the command area */ + NAND_CMD_AREA = NAND_CMD_WRITE_1ST; + + /* send address to the address area, for HY27UF081G2A + bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 + first byte: A7 A6 A5 A4 A3 A2 A1 A0 (bit7 - bit0 of page address) + second byte: 0 0 0 0 A11 A10 A9 A8 (bit11 - bit8 of page address, high 4bit must be zero) + third byte�� A19 A18 A17 A16 A15 A14 A13 A12 + fourth byte��A27 A26 A25 A24 A23 A22 A21 A20 + */ + NAND_ADDR_AREA = address.page_in_offset; + NAND_ADDR_AREA = address.page_in_offset >> 8; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + /* write data to data area */ + for(i = 0; i < bytecount; i++){ + NAND_DATA_AREA = pbuffer[i]; + } + + /* send 2nd cycle page programming command to the command area */ + NAND_CMD_AREA = NAND_CMD_WRITE_2ND; + + /* check operation stauts */ + if (NAND_READY == exmc_nand_getstatus()){ + return NAND_OK; + } + return NAND_FAIL; +} + +/*! + \brief read a set of data from nand flash for the specified pages addresses + \param[in] pbuffer: pointer on the buffer filling data to be read + \param[in] address: the address of the data to be read + \param[in] bytecount: byte count to be read(bytecount + address.page_in_offset <= NAND_PAGE_TOTAL_SIZE) + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_readpage(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount) +{ + uint16_t i; + + /* send 1st cycle read command to the command area */ + NAND_CMD_AREA = NAND_CMD_READ1_1ST; + + /* send address to the address area, for HY27UF081G2A + bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 + first byte: A7 A6 A5 A4 A3 A2 A1 A0 (bit7 - bit0 of page address) + second byte: 0 0 0 0 A11 A10 A9 A8 (bit11 - bit8 of page address, high 4bit must be zero) + third byte�� A19 A18 A17 A16 A15 A14 A13 A12 + fourth byte��A27 A26 A25 A24 A23 A22 A21 A20 + */ + NAND_ADDR_AREA = address.page_in_offset; + NAND_ADDR_AREA = address.page_in_offset >> 8; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + /* send 2nd cycle read command to the command area */ + NAND_CMD_AREA = NAND_CMD_READ1_2ND; + + /* read data to pbuffer */ + for(i = 0; i < bytecount; i++){ + pbuffer[i] = NAND_DATA_AREA; + } + + /* check operation stauts */ + if (NAND_READY == exmc_nand_getstatus()){ + return NAND_OK; + } + return NAND_FAIL; +} + +/*! + \brief write the spare area information for the specified pages addresses + \param[in] pbuffer: pointer on the buffer containing data to be written + \param[in] address: the address of the data to be written + \param[in] bytecount: byte count to be written(bytecount + (address.page_in_offset - NAND_PAGE_SIZE) <= NAND_SPARE_AREA_SIZE) + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t exmc_nand_writespare(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount) +{ + /* address.page_in_offset > NAND_PAGE_SIZE */ + if(address.page_in_offset <= NAND_PAGE_SIZE){ + return NAND_FAIL; + } + + /* bytecount + address.page_in_offset < NAND_PAGE_TOTAL_SIZE */ + if (bytecount + address.page_in_offset >= NAND_PAGE_TOTAL_SIZE){ + return NAND_FAIL; + } + + /* write spare area */ + return exmc_nand_writepage(pbuffer, address, bytecount); +} + +/*! + \brief read the spare area information for the specified pages addresses + \param[in] pbuffer: pointer on the buffer containing data to be read + \param[in] address: the address of the data to be read + \param[in] bytecount: byte count to be read(bytecount + (address.page_in_offset - NAND_PAGE_SIZE) <= NAND_SPARE_AREA_SIZE) + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t exmc_nand_readspare(uint8_t *pbuffer,nand_address_struct address, uint16_t bytecount) +{ + /* address.page_in_offset > NAND_PAGE_SIZE */ + if(address.page_in_offset <= NAND_PAGE_SIZE){ + return NAND_FAIL; + } + + /* bytecount + address.page_in_offset < NAND_PAGE_TOTAL_SIZE */ + if (bytecount + address.page_in_offset >= NAND_PAGE_TOTAL_SIZE){ + return NAND_FAIL; + } + + /* read spare area */ + return exmc_nand_readpage(pbuffer, address, bytecount); +} + +/*! + \brief write the main area information for the specified pages addresses + \param[in] pbuffer: pointer on the buffer containing data to be written + \param[in] physicaladdress: the address of the data to be written + \param[in] bytecount: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_writedata(uint8_t *pbuffer, nand_address_struct physicaladdress, uint16_t bytecount) +{ + uint8_t *temp_pbuffer = pbuffer; + + /* erase block before write data based on the feature of nand flash */ + exmc_nand_eraseblock(physicaladdress.block); + + /* if the number of data bytes to be written plus the offset is greater than the page size, + the automatic next page */ + while(bytecount + physicaladdress.page_in_offset > NAND_PAGE_SIZE){ + if(exmc_nand_writepage(temp_pbuffer, physicaladdress, NAND_PAGE_SIZE - physicaladdress.page_in_offset) != NAND_OK){ + return NAND_FAIL; + } + /* compute address of the next block */ + bytecount -= NAND_PAGE_SIZE - physicaladdress.page_in_offset; + temp_pbuffer += NAND_PAGE_SIZE - physicaladdress.page_in_offset; + physicaladdress.page++; + physicaladdress.page_in_offset = 0; + } + + /* write the last less than one block of data */ + if(bytecount > 0){ + if(exmc_nand_writepage(temp_pbuffer, physicaladdress,bytecount) != NAND_OK){ + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read the main area information for the specified pages addresses + \param[in] pbuffer: pointer on the buffer containing data to be read + \param[in] phyaddress: the address of the data to be read + \param[in] bytecount: byte count to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_readdata(uint8_t *pbuffer, nand_address_struct phyaddress, uint16_t bytecount) +{ + uint8_t *temp_pbuffer = pbuffer; + /* if the number of data bytes to be read plus the offset is greater than the page size, the automatic next page */ + while(bytecount + phyaddress.page_in_offset > NAND_PAGE_SIZE){ + if(exmc_nand_readpage(temp_pbuffer, phyaddress, NAND_PAGE_SIZE - phyaddress.page_in_offset) != NAND_OK){ + return NAND_FAIL; + } + phyaddress.page++; + temp_pbuffer += NAND_PAGE_SIZE - phyaddress.page_in_offset; + bytecount -= NAND_PAGE_SIZE - phyaddress.page_in_offset; + phyaddress.page_in_offset = 0; + } + + if(bytecount>0){ + if(exmc_nand_readpage(temp_pbuffer, phyaddress, bytecount) != NAND_OK){ + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief erase data specified block + \param[in] blocknum: block number to be erased data + \param[out] none + \retval NAND memory status +*/ +static uint8_t exmc_nand_eraseblock(uint32_t blocknum) +{ + /* send 1st cycle erase command to command area */ + NAND_CMD_AREA = NAND_CMD_ERASE_1ST; + + /* block number into a block number and the page number */ + blocknum <<= PAGE_BIT; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(blocknum); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(blocknum); + + /* send 2nd cycle erase command to command area */ + NAND_CMD_AREA = NAND_CMD_ERASE_2ND; + + return (exmc_nand_getstatus()); +} + +/*! + \brief reset nand flash + \param[in] none + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_reset(void) +{ + NAND_CMD_AREA = NAND_CMD_RESET; + + /* check operation stauts */ + if (NAND_READY == exmc_nand_getstatus()){ + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief reads the NAND memory status + \param[in] none + \param[out] none + \retval NAND memory status +*/ +static uint8_t exmc_nand_readstatus(void) +{ + uint8_t data; + uint8_t status = NAND_BUSY; + + /* send read status command to the command area */ + NAND_CMD_AREA = NAND_CMD_STATUS; + + data = NAND_DATA_AREA; + + if((data & NAND_ERROR) == NAND_ERROR){ + status = NAND_ERROR; + } + else if((data & NAND_READY) == NAND_READY){ + status = NAND_READY; + } + else{ + status = NAND_BUSY; + } + + return (status); +} + +/*! + \brief get the NAND operation status + \param[in] none + \param[out] none + \retval new status of the NAND operation +*/ +static uint8_t exmc_nand_getstatus(void) +{ + uint32_t timeout = 0x10000; + uint8_t status = NAND_READY; + + status = exmc_nand_readstatus(); + + /* waiting for NAND operation over, it will exit after a timeout */ + while ((status != NAND_READY) && (timeout != 0x00)){ + status = exmc_nand_readstatus(); + timeout--; + } + + if(timeout == 0x00){ + status = NAND_TIMEOUT_ERROR; + } + + return (status); +} + +/*! + \brief write the main area information for the specified logic addresses + \param[in] memaddr: the logic address of the data to be written + \param[in] pwritebuf: pointer on the buffer containing data to be written + \param[in] bytecount: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_write(uint32_t memaddr, uint8_t *pwritebuf, uint16_t bytecount) +{ + uint32_t temp_blockremainsize; + nand_address_struct physicaladdress; + uint32_t temp; + + temp = memaddr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + /* compute physical zone number */ + physicaladdress.zone= memaddr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + + /* compute physical block number */ + physicaladdress.block = memaddr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + /* compute physical page number */ + physicaladdress.page = temp / NAND_PAGE_SIZE; + + /* compute physical offset into page */ + physicaladdress.page_in_offset = temp % NAND_PAGE_SIZE; + temp_blockremainsize = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE)-(NAND_PAGE_SIZE * physicaladdress.page + + physicaladdress.page_in_offset); + + /* if the number of data bytes to be written plus the offset is greater than the block size, the automatic next block. */ + while(bytecount > temp_blockremainsize){ + if(NAND_FAIL == exmc_nand_writedata(pwritebuf,physicaladdress,temp_blockremainsize)){ + return NAND_FAIL; + } + + physicaladdress.block++; + pwritebuf += temp_blockremainsize; + bytecount -= temp_blockremainsize; + physicaladdress.page = 0; + physicaladdress.page_in_offset = 0; + temp_blockremainsize = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(bytecount > 0){ + if(NAND_FAIL == exmc_nand_writedata(pwritebuf, physicaladdress, bytecount)){ + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read the main area information for the specified logic addresses + \param[in] memaddr: the logic address of the data to be read + \param[in] preadbuf: pointer on the buffer containing data to be read + \param[in] bytecount: byte count to be reas + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_read(uint32_t memaddr, uint8_t *preadbuf, uint16_t bytecount) +{ + uint32_t temp_blockremainsize; + nand_address_struct physicaladdress; + uint32_t temp; + + temp = memaddr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + /* compute physical zone number */ + physicaladdress.zone= memaddr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + + /* compute physical block number */ + physicaladdress.block = memaddr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + /* compute physical page number */ + physicaladdress.page = temp / NAND_PAGE_SIZE; + + /* compute physical offset into page */ + physicaladdress.page_in_offset = temp % NAND_PAGE_SIZE; + + temp_blockremainsize=(NAND_BLOCK_SIZE * NAND_PAGE_SIZE) - (NAND_PAGE_SIZE * physicaladdress.page + physicaladdress.page_in_offset); + + /* if the number of data bytes to be read plus the offset is greater than the block size, the automatic next block */ + while(bytecount > temp_blockremainsize){ + if(NAND_FAIL == exmc_nand_readdata(preadbuf,physicaladdress,temp_blockremainsize)){ + return NAND_FAIL; + } + physicaladdress.block++; + preadbuf += temp_blockremainsize; + bytecount -= temp_blockremainsize; + physicaladdress.page = 0; + physicaladdress.page_in_offset = 0; + temp_blockremainsize = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(bytecount > 0){ + if(exmc_nand_readdata(preadbuf,physicaladdress, bytecount) == NAND_FAIL){ + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief format nand flash + \param[in] none + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_format(void) +{ + uint16_t i; + + for (i = 0; i < NAND_BLOCK_COUNT; i++){ + if(NAND_READY != exmc_nand_eraseblock(i)){ + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief fill the buffer with specified value + \param[in] pbuffer: pointer on the buffer to fill + \param[in] buffer_lenght: size of the buffer to fill + \param[in] value: value to fill on the buffer + \param[out] none + \retval none +*/ +void fill_buffer_nand(uint8_t *pbuffer, uint16_t buffer_lenght, uint32_t value) +{ + uint16_t index = 0; + + for (index = 0; index < buffer_lenght; index++){ + pbuffer[index] = value + index; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.h new file mode 100644 index 0000000..b50da1c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/exmc_nandflash.h @@ -0,0 +1,138 @@ +/*! + \file exmc_nandflash.h + \brief the header file of nandflash(hynix HY27UF081G2A) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef EXMC_NANDFLASH_H +#define EXMC_NANDFLASH_H + +#include "gd32f10x.h" + +/* NAND area definition */ +/* A16 = CLE high command area */ +#define EXMC_CMD_AREA (uint32_t)(1<<16) +/* A17 = ALE high address area */ +#define EXMC_ADDR_AREA (uint32_t)(1<<17) +/* data area */ +#define EXMC_DATA_AREA ((uint32_t)0x00000000) + +/* NAND memory command (hynix HY27UF081G2A) */ +#define NAND_CMD_READ1_1ST ((uint8_t)0x00) +#define NAND_CMD_READ1_2ND ((uint8_t)0x30) +#define NAND_CMD_WRITE_1ST ((uint8_t)0x80) +#define NAND_CMD_WRITE_2ND ((uint8_t)0x10) +#define NAND_CMD_ERASE_1ST ((uint8_t)0x60) +#define NAND_CMD_ERASE_2ND ((uint8_t)0xD0) +#define NAND_CMD_READID ((uint8_t)0x90) +#define NAND_CMD_STATUS ((uint8_t)0x70) +#define NAND_CMD_LOCK_STATUS ((uint8_t)0x7A) +#define NAND_CMD_RESET ((uint8_t)0xFF) + +/* NAND memory status */ +#define NAND_BUSY ((uint8_t)0x00) +#define NAND_ERROR ((uint8_t)0x01) +#define NAND_READY ((uint8_t)0x40) +#define NAND_TIMEOUT_ERROR ((uint8_t)0x80) + +/* NAND memory parameters */ +/* NAND zone count */ +#define NAND_ZONE_COUNT ((uint16_t)0x0001) + +/* 1024 block per zone */ +#define NAND_ZONE_SIZE ((uint16_t)0x0400) + +/* 64 pages per block */ +#define NAND_BLOCK_SIZE ((uint16_t)0x0040) + +/* 2 * 1024 bytes per page */ +#define NAND_PAGE_SIZE ((uint16_t)0x0800) + +/* last 64 bytes as spare area */ +#define NAND_SPARE_AREA_SIZE ((uint16_t)0x0040) + +/* total page size = page size + spare are size */ +#define NAND_PAGE_TOTAL_SIZE (NAND_PAGE_SIZE + NAND_SPARE_AREA_SIZE) + +/* max read and write address */ +#define NAND_MAX_ADDRESS (((NAND_ZONE_COUNT*NAND_ZONE_SIZE)*NAND_BLOCK_SIZE)*NAND_PAGE_SIZE) + +/* block count */ +#define NAND_BLOCK_COUNT 1024 + +/* NAND memory address computation */ +#define ADDR_1ST_CYCLE(ADDR) (uint8_t)((ADDR)& 0xFF) +#define ADDR_2ND_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF00) >> 8) +#define ADDR_3RD_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF0000) >> 16) +#define ADDR_4TH_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF000000) >> 24) + +/* define return value of functions */ +#define NAND_OK 0 +#define NAND_FAIL 1 + +/* NAND id structure */ +typedef struct +{ + uint8_t maker_id; + uint8_t device_id; + uint8_t third_id; + uint8_t fourth_id; +}nand_id_struct; + +typedef struct +{ + uint16_t zone; + uint16_t block; + uint16_t page; + uint16_t page_in_offset; +} nand_address_struct; + +/* function declarations */ +/* nand flash peripheral initialize */ +void exmc_nandflash_init(void); +/* read NAND flash ID */ +void nand_read_id(nand_id_struct* nand_id); +/* write the spare area information for the specified pages addresses */ +uint8_t exmc_nand_writespare(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount); +/* read the spare area information for the specified pages addresses */ +uint8_t exmc_nand_readspare(uint8_t *pbuffer, nand_address_struct address, uint16_t bytecount); +/* reset nand flash */ +uint8_t nand_reset(void); +/* write the main area information for the specified logic addresses */ +uint8_t nand_write(uint32_t memaddr, uint8_t *pwritebuf, uint16_t bytecount); +/* read the main area information for the specified logic addresses */ +uint8_t nand_read(uint32_t mem_addr, uint8_t *preadbuf, uint16_t bytecount); +/* format nand flash */ +uint8_t nand_format(void); +/* fill the buffer with specified value */ +void fill_buffer_nand(uint8_t *pbuffer, uint16_t buffer_lenght, uint32_t value); + +#endif /* EXMC_NANDFLASH_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/main.c new file mode 100644 index 0000000..f9c5114 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/main.c @@ -0,0 +1,178 @@ +/*! + \file main.c + \brief NAND test demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "exmc_nandflash.h" + +#define BUFFER_SIZE (0x100U) +#define NAND_HY_MAKERID (0xADU) +#define NAND_HY_DEVICEID (0xF1U) + +nand_id_struct nand_id; +uint8_t txbuffer[BUFFER_SIZE], rxbuffer[BUFFER_SIZE]; +__IO uint32_t writereadstatus = 0, status= 0; +uint32_t j = 0; +uint32_t k = 0; +uint32_t writereadaddr ; +uint16_t zone, block, page, pageoffset; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* LED initialize */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED5); + /* config the USART */ + gd_eval_com_init(EVAL_COM0); + /* config the EXMC access mode */ + exmc_nandflash_init(); + /* read NAND ID */ + nand_read_id(&nand_id); + + printf("read NAND ID"); + /* print NAND ID */ + printf("\r\nNand flash ID:0x%X 0x%X 0x%X 0x%X\r\n",nand_id.maker_id,nand_id.device_id, + nand_id.third_id,nand_id.fourth_id); + + if((NAND_HY_MAKERID == nand_id.maker_id) && (NAND_HY_DEVICEID == nand_id.device_id)) + { + /* set the read and write the address */ + zone = 0; + block = 10; + page = 0; + pageoffset = 1100; + writereadaddr = ((zone * NAND_ZONE_SIZE + block) * NAND_BLOCK_SIZE + page) + * NAND_PAGE_SIZE + pageoffset; + + /* whether address cross-border */ + if((writereadaddr + BUFFER_SIZE ) > NAND_MAX_ADDRESS) + { + printf("\r\naddress cross-border"); + + /* failure, light on LED5 */ + gd_eval_led_on(LED5); + while(1); + } + + /* fill writebuffer with 0x00.. */ + fill_buffer_nand(txbuffer, BUFFER_SIZE , 0x00); + + /* write data to nand flash */ + status = nand_write(writereadaddr, txbuffer, BUFFER_SIZE); + if(NAND_OK == status) + { + printf("\r\nwrite data successfully!"); + } + else + { + printf("\r\nwrite data failure!"); + + /* failure, light on LED5 */ + gd_eval_led_on(LED5); + while(1); + } + + /* read data from nand flash */ + status = nand_read(writereadaddr, rxbuffer, BUFFER_SIZE); + if(NAND_OK == status) + { + printf("\r\nread data successfully!"); + } + else + { + printf("\r\nread data failure!\n\r"); + + /* failure, light on LED5 */ + gd_eval_led_on(LED5); + while(1); + } + + /* Read and write data comparison for equality */ + writereadstatus = 0; + for(j = 0; j < BUFFER_SIZE; j++) + { + if(txbuffer[j] != rxbuffer[j]) + { + writereadstatus++; + break; + } + } + + printf("\r\nthe result to access the nand flash:"); + if (writereadstatus == 0) + { + printf("\r\naccess NAND flash successfully!"); + + gd_eval_led_on(LED2); + } + else + { + printf("\r\naccess NAND flash failure!"); + + /* failure, light on LED5 */ + gd_eval_led_on(LED5); + while(1); + } + printf("\r\nprintf data to be read:\r\n"); + for(k = 0; k < BUFFER_SIZE; k ++) + { + printf("0x%02X ",rxbuffer[k]); + } + } + else + { + printf("\n\rread NAND ID failure!\n\r"); + + /* failure, light on LED5 */ + gd_eval_led_on(LED5); + while(1); + } + + while (1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM0,USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/readme.txt new file mode 100644 index 0000000..85848b2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NAND/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of the EXMC_NAND demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to use EXMC +peripheral to control NAND memory. This board uses EXMC_BANK1_NAND to support +NAND memory. + + This demo shows the write and read data operation process of NAND memory by +EXMC module. Firstly, read NAND_ID. If the operation fails, this demo will print +out the failure information and light on LED5, otherwise print out the ID information. +Secondly, write and read the NAND memory. If the test result is correct, LED2 will be +turned on and the data writed to the NAND will be printed out. + + JP24(Nand),JP5, P2 and P3 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.c new file mode 100644 index 0000000..bf5d0e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.c @@ -0,0 +1,349 @@ +/*! + \file exmc_norflash.c + \brief EXMC NOR Flash(M29W128FH) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "exmc_norflash.h" + +#define BANK0_NOR1_ADDR ((uint32_t)0x60000000) +#define BANK_NORFLASH_ADDR BANK0_NOR1_ADDR + +#define BLOCKERASE_TIMEOUT ((uint32_t)0x00A00000) +#define CHIPERASE_TIMEOUT ((uint32_t)0x30000000) +#define PROGRAM_TIMEOUT ((uint32_t)0x00001400) + +#define ADDR_SHIFT(A) (BANK_NORFLASH_ADDR + (2 * (A))) +#define NOR_WRITE(Address, Data) (*(__IO uint16_t *)(Address) = (Data)) + +/*! + \brief nor flash peripheral initialize + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norflash_init(void) +{ + exmc_norsram_parameter_struct nor_init_struct; + exmc_norsram_timing_parameter_struct nor_timing_init_struct; + + /* EXMC clock enable */ + rcu_periph_clock_enable(RCU_EXMC); + + /* EXMC enable */ + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* configure EXMC_D[0~15]*/ + /* PD14(EXMC_D0), PD15(EXMC_D1),PD0(EXMC_D2), PD1(EXMC_D3), PD8(EXMC_D13), PD9(EXMC_D14), PD10(EXMC_D15) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15); + + /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), + PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | + GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); + + /* PD11(EXMC_A16), PD12(EXMC_A17), PD13(EXMC_A18) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13); + + /* PE3(EXMC_A19), PE4(EXMC_A20), PE5(EXMC_A21), PE6(EXMC_A22) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6); + + /* configure PD4(NOE), PD5(NWE), PD7(NE0) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_7); + + /* configure NADV */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + /* configure NWAIT */ + gpio_init(GPIOD, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + nor_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_B; + nor_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK; + nor_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE; + nor_timing_init_struct.bus_latency = 0; + nor_timing_init_struct.asyn_data_setuptime = 7; + nor_timing_init_struct.asyn_address_holdtime = 2; + nor_timing_init_struct.asyn_address_setuptime = 6; + + nor_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION0; + nor_init_struct.write_mode = EXMC_ASYN_WRITE; + nor_init_struct.extended_mode = DISABLE; + nor_init_struct.asyn_wait = DISABLE; + nor_init_struct.nwait_signal = DISABLE; + nor_init_struct.memory_write = ENABLE; + nor_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + nor_init_struct.wrap_burst_mode = DISABLE; + nor_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + nor_init_struct.burst_mode = DISABLE; + nor_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + nor_init_struct.memory_type = EXMC_MEMORY_TYPE_NOR; + nor_init_struct.address_data_mux = ENABLE; + nor_init_struct.read_write_timing = &nor_timing_init_struct; + nor_init_struct.write_timing = &nor_timing_init_struct; + + exmc_norsram_init(&nor_init_struct); + + exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION0); +} + + +/*! + \brief read NOR memory's manufacturer, device code, block_protection_indicator, block_protection_status + \param[in] nor_id: pointer to a nor_idtypedef structure + \param[out] none + \retval none +*/ +void nor_read_id(nor_id_struct* nor_id) +{ + NOR_WRITE(ADDR_SHIFT(CMD_READID_ADD_1ST), CMD_READID_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_READID_ADD_2ND), CMD_READID_DATA_2ND); + NOR_WRITE(ADDR_SHIFT(CMD_READID_ADD_3RD), CMD_READID_DATA_3RD); + + /* read NOR Flash ID */ + nor_id->manufacturer_code = *(__IO uint16_t *) ADDR_SHIFT(0x0000); + nor_id->device_code1 = *(__IO uint16_t *) ADDR_SHIFT(0x0001); + nor_id->device_code2 = *(__IO uint16_t *) ADDR_SHIFT(0x000E); + nor_id->device_code3 = *(__IO uint16_t *) ADDR_SHIFT(0x000F); +} + +/*! + \brief erase the specified nor flash block + \param[in] blockaddr: address of the block to be erased + \param[out] none + \retval NOR_SUCCESS,NOR_ERROR,NOR_TIMEOUT +*/ +nor_status_struct nor_eraseblock(uint32_t blockaddr) +{ + NOR_WRITE(ADDR_SHIFT(CMD_BLOCKERASE_ADD_1ST), CMD_BLOCKERASE_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_BLOCKERASE_ADD_2ND), CMD_BLOCKERASE_DATA_2ND); + NOR_WRITE(ADDR_SHIFT(CMD_BLOCKERASE_ADD_3RD), CMD_BLOCKERASE_DATA_3RD); + NOR_WRITE(ADDR_SHIFT(CMD_BLOCKERASE_ADD_4TH), CMD_BLOCKERASE_DATA_4TH); + NOR_WRITE(ADDR_SHIFT(CMD_BLOCKERASE_ADD_5TH), CMD_BLOCKERASE_DATA_5TH); + NOR_WRITE((BANK_NORFLASH_ADDR + blockaddr), CMD_BLOCKERASE_DATA_6TH); + + return (nor_get_status(BLOCKERASE_TIMEOUT)); +} + +/*! + \brief erase the entire chip + \param[in] none + \param[out] none + \retval NOR_SUCCESS,NOR_ERROR,NOR_TIMEOUT +*/ +nor_status_struct nor_erasechip(void) +{ + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_1ST), CMD_CHIPERASE_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_2ND), CMD_CHIPERASE_DATA_2ND); + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_3RD), CMD_CHIPERASE_DATA_3RD); + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_4TH), CMD_CHIPERASE_DATA_4TH); + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_5TH), CMD_CHIPERASE_DATA_5TH); + NOR_WRITE(ADDR_SHIFT(CMD_CHIPERASE_ADD_6TH), CMD_CHIPERASE_DATA_6TH); + + return (nor_get_status(CHIPERASE_TIMEOUT)); +} + +/*! + \brief write a half-word to the specified address of nor flash + \param[in] writeaddr: NOR flash internal address to write to + \param[in] data: data to be written + \param[out] none + \retval NOR_SUCCESS,NOR_ERROR,NOR_TIMEOUT +*/ +nor_status_struct nor_write_halfword(uint32_t writeaddr, uint16_t data) +{ + NOR_WRITE(ADDR_SHIFT(CMD_WRITE_ADD_1ST), CMD_WRITE_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_WRITE_ADD_2ND), CMD_WRITE_DATA_2ND); + NOR_WRITE(ADDR_SHIFT(CMD_WRITE_ADD_3RD), CMD_WRITE_DATA_3RD); + NOR_WRITE((BANK_NORFLASH_ADDR + writeaddr), data); + + return (nor_get_status(PROGRAM_TIMEOUT)); +} + +/*! + \brief write a half-word buffer to the specified address of nor flash + \param[in] pbuffer: pointer to a half-word buffer + \param[in] writeaddr: NOR flash internal address from which the data will be written + \param[in] halfword_count: count of half words to write + \param[out] none + \retval NOR_SUCCESS,NOR_ERROR,NOR_TIMEOUT +*/ +nor_status_struct nor_write_buffer(uint16_t* pbuffer, uint32_t writeaddr, uint32_t halfword_count) +{ + nor_status_struct status = NOR_ONGOING; + + do{ + /* write data to nor flash */ + status = nor_write_halfword(writeaddr, *pbuffer++); + writeaddr = writeaddr + 2; + halfword_count--; + }while((NOR_SUCCESS == status) && (halfword_count != 0)); + + return (status); +} + +/*! + \brief read a half-word from the specified address of nor flash + \param[in] readaddr: NOR flash internal address to read from + \param[out] none + \retval A half-word read from the nor flash +*/ +uint16_t nor_read_halfword(uint32_t readaddr) +{ + NOR_WRITE(ADDR_SHIFT(CMD_READ_ADD_1ST), CMD_READ_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_READ_ADD_2ND), CMD_READ_DATA_2ND); + NOR_WRITE((BANK_NORFLASH_ADDR + readaddr), CMD_READ_DATA_3RD); + + return (*(__IO uint16_t *)((BANK_NORFLASH_ADDR + readaddr))); +} + +/*! + \brief read a set of data from the specified address of nor flash + \param[in] pbuffer: pointer to a half-word buffer + \param[in] readaddr: NOR flash internal address to read from + \param[in] halfword_count: count of half words to write + \param[out] none + \retval none +*/ +void nor_readbuffer(uint16_t* pbuffer, uint32_t readaddr, uint32_t halfword_count) +{ + NOR_WRITE(ADDR_SHIFT(CMD_READ_ADD_1ST), CMD_READ_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_READ_ADD_2ND), CMD_READ_DATA_2ND); + NOR_WRITE((BANK_NORFLASH_ADDR + readaddr), CMD_READ_DATA_3RD); + + for(; halfword_count != 0x00; halfword_count--){ + /* read a halfword from the nor flash */ + *pbuffer++ = *(__IO uint16_t *)((BANK_NORFLASH_ADDR + readaddr)); + readaddr = readaddr + 2; + } +} + +/*! + \brief return the nor flash to read mode and reset the errors in the nor flash status register + \param[in] none + \param[out] none + \retval none +*/ +void nor_reset(void) +{ + NOR_WRITE(ADDR_SHIFT(CMD_RESET_ADD_1ST), CMD_RESET_DATA_1ST); + NOR_WRITE(ADDR_SHIFT(CMD_RESET_ADD_2ND), CMD_RESET_DATA_2ND); + NOR_WRITE(BANK_NORFLASH_ADDR , CMD_RESET_DATA_3RD); +} + +/*! + \brief return the nor flash to read mode + \param[in] none + \param[out] none + \retval none +*/ +void nor_return_to_read_mode(void) +{ + NOR_WRITE(BANK_NORFLASH_ADDR , CMD_RESET_DATA_3RD); +} + +/*! + \brief return the nor flash operation status + \param[in] time_out: NOR flash progamming timeout + \param[out] none + \retval none +*/ +nor_status_struct nor_get_status(uint32_t time_out) +{ + uint16_t val1 = 0x00, val2 = 0x00; + nor_status_struct status = NOR_ONGOING; + uint32_t timeout = time_out; + + /* poll on nor flash ready/busy signal */ + while(RESET != (gpio_input_bit_get(GPIOD, GPIO_PIN_6)) && (timeout > 0)){ + timeout--; + } + + timeout = time_out; + + while((gpio_input_bit_get(GPIOD, GPIO_PIN_6) == RESET) && (timeout > 0)){ + timeout--; + } + + /* get the nor flash operation status */ + while((time_out != 0x00) && (status != NOR_SUCCESS)){ + time_out--; + + /* read DQ6 and DQ5 */ + val1 = *(__IO uint16_t *)(BANK_NORFLASH_ADDR ); + val2 = *(__IO uint16_t *)(BANK_NORFLASH_ADDR ); + + if((val1 & 0x0040) == (val2 & 0x0040)) { + return NOR_SUCCESS; + } + + if((val1 & 0x0020) != 0x0020){ + status = NOR_ONGOING; + } + + val1 = *(__IO uint16_t *)(BANK_NORFLASH_ADDR ); + val2 = *(__IO uint16_t *)(BANK_NORFLASH_ADDR ); + + if((val1 & 0x0040) == (val2 & 0x0040)) { + return NOR_SUCCESS; + }else if((val1 & 0x0020) == 0x0020){ + return NOR_ERROR; + } + } + + if(time_out == 0x00){ + status = NOR_TIMEOUT; + } + + return (status); +} + +/*! + \brief fill the buffer with specified value + \param[in] pbuffer: pointer on the buffer to fill + \param[in] buffer_lenght: lenght of the buffer to fill + \param[in] value: value to fill on the buffer + \param[out] none + \retval none +*/ +void nor_fill_buffer(uint16_t *pbuffer, uint16_t buffer_lenght, uint32_t value) +{ + uint16_t index = 0; + + /* put in global buffer same values */ + for (index = 0; index < buffer_lenght; index++ ){ + pbuffer[index] = value + index; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.h new file mode 100644 index 0000000..b677f1a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/exmc_norflash.h @@ -0,0 +1,145 @@ +/*! + \file exmc_norflash.h + \brief the header file of EXMC NOR Flash(M29W128FH) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#ifndef EXMC_NORFLASH_H +#define EXMC_NORFLASH_H + +/* read id command define */ +#define CMD_READID_ADD_1ST 0x0555 +#define CMD_READID_DATA_1ST 0x00AA +#define CMD_READID_ADD_2ND 0x02AA +#define CMD_READID_DATA_2ND 0x0055 +#define CMD_READID_ADD_3RD 0x0555 +#define CMD_READID_DATA_3RD 0x0090 + +/* Block Erase Command define */ +#define CMD_BLOCKERASE_ADD_1ST 0x0555 +#define CMD_BLOCKERASE_DATA_1ST 0x00AA +#define CMD_BLOCKERASE_ADD_2ND 0x02AA +#define CMD_BLOCKERASE_DATA_2ND 0x0055 +#define CMD_BLOCKERASE_ADD_3RD 0x0555 +#define CMD_BLOCKERASE_DATA_3RD 0x0080 +#define CMD_BLOCKERASE_ADD_4TH 0x0555 +#define CMD_BLOCKERASE_DATA_4TH 0x00AA +#define CMD_BLOCKERASE_ADD_5TH 0x02AA +#define CMD_BLOCKERASE_DATA_5TH 0x0055 +#define CMD_BLOCKERASE_DATA_6TH 0x0030 + +/* chip erase command define */ +#define CMD_CHIPERASE_ADD_1ST 0x0555 +#define CMD_CHIPERASE_DATA_1ST 0x00AA +#define CMD_CHIPERASE_ADD_2ND 0x02AA +#define CMD_CHIPERASE_DATA_2ND 0x0055 +#define CMD_CHIPERASE_ADD_3RD 0x0555 +#define CMD_CHIPERASE_DATA_3RD 0x0080 +#define CMD_CHIPERASE_ADD_4TH 0x0555 +#define CMD_CHIPERASE_DATA_4TH 0x00AA +#define CMD_CHIPERASE_ADD_5TH 0x02AA +#define CMD_CHIPERASE_DATA_5TH 0x0055 +#define CMD_CHIPERASE_ADD_6TH 0x0555 +#define CMD_CHIPERASE_DATA_6TH 0x0010 + +/* reset command define */ +#define CMD_RESET_ADD_1ST 0x0555 +#define CMD_RESET_DATA_1ST 0x00AA +#define CMD_RESET_ADD_2ND 0x02AA +#define CMD_RESET_DATA_2ND 0x0055 +#define CMD_RESET_DATA_3RD 0x00F0 + +/* read command define */ +#define CMD_READ_ADD_1ST 0x0555 +#define CMD_READ_DATA_1ST 0x00AA +#define CMD_READ_ADD_2ND 0x02AA +#define CMD_READ_DATA_2ND 0x0055 +#define CMD_READ_DATA_3RD 0x00F0 + +/* write command define */ +#define CMD_WRITE_ADD_1ST 0x0555 +#define CMD_WRITE_DATA_1ST 0x00AA +#define CMD_WRITE_ADD_2ND 0x02AA +#define CMD_WRITE_DATA_2ND 0x0055 +#define CMD_WRITE_ADD_3RD 0x0555 +#define CMD_WRITE_DATA_3RD 0x00A0 + +/* max read and write address */ +#define NOR_MAX_ADDRESS ((uint32_t)0x01000000) + +/* NOR id structure */ +typedef struct +{ + uint16_t manufacturer_code; + uint16_t device_code1; + uint16_t device_code2; + uint16_t device_code3; +}nor_id_struct; + +/* NOR status */ +typedef enum +{ + NOR_SUCCESS = 0, + NOR_ONGOING, + NOR_ERROR, + NOR_TIMEOUT +}nor_status_struct; + +/* function declarations */ +/* nor flash peripheral initialize */ +void exmc_norflash_init(void); +/* read NOR memory's manufacturer, device code, + block_protection_indicator, block_protection_status */ +void nor_read_id(nor_id_struct* nor_id); +/* erase the specified nor flash block */ +nor_status_struct nor_eraseblock(uint32_t blockaddr); +/* erase the entire chip */ +nor_status_struct nor_erasechip(void); +/* write a half-word to the specified address of nor flash */ +nor_status_struct nor_write_halfword(uint32_t writeaddr, uint16_t data); +/* write a half-word buffer to the specified address of nor flash */ +nor_status_struct nor_write_buffer(uint16_t* pbuffer, uint32_t writeaddr, uint32_t halfword_count); +/* read a half-word from the specified address of nor flash */ +uint16_t nor_read_halfword(uint32_t readaddr); +/* read a set of data from the specified address of nor flash */ +void nor_readbuffer(uint16_t* pbuffer, uint32_t readaddr, uint32_t halfwordcount); +/* return the nor flash to read mode and reset the errors in the nor flash status register */ +void nor_reset(void); +/* return the nor flash operation status */ +nor_status_struct nor_get_status(uint32_t time_out); +/* return the nor flash to read mode */ +void nor_return_to_read_mode(void); +/* fill the buffer with specified value */ +void nor_fill_buffer(uint16_t *pbuffer, uint16_t buffer_lenght, uint32_t value); + +#endif /* EXMC_NORFLASH_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/main.c new file mode 100644 index 0000000..18ad924 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/main.c @@ -0,0 +1,138 @@ +/*! + \file main.c + \brief EXMC NOR Flash demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "exmc_norflash.h" + +/* NOR */ +#define BUFFER_SIZE 0x100 +#define WRITE_READ_ADDR 0x0000 + +nor_id_struct nor_id; +uint32_t writereadstatus = 0; +uint16_t writebuffer[BUFFER_SIZE]; +uint16_t readbuffer[BUFFER_SIZE]; +nor_status_struct status; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint32_t i=0; + + /* config the USART */ + gd_eval_com_init(EVAL_COM0); + /* config the EXMC access mode */ + exmc_norflash_init(); + /* read nor flash id and printf */ + nor_read_id(&nor_id); + + printf("\r\nread NOR ID"); + + /* print NOR ID */ + printf("\r\nNOR flash ID:0x%X 0x%X 0x%X 0x%X\r\n",nor_id.manufacturer_code,nor_id.device_code1, + nor_id.device_code2,nor_id.device_code3); + nor_return_to_read_mode(); + + /* erase the nor flash block to be written data */ + status = nor_eraseblock(WRITE_READ_ADDR); + if(NOR_SUCCESS == status){ + printf("\r\nerase nor flash block successfully!"); + }else{ + printf("\r\nerase nor flash block failure!"); + while(1); + } + + /* whether address cross-border */ + if((WRITE_READ_ADDR + BUFFER_SIZE ) > NOR_MAX_ADDRESS){ + printf("\n\raddress cross-border\n\r"); + while(1); + } + + /* fill writeBuffer with the specified value */ + nor_fill_buffer(writebuffer, BUFFER_SIZE, 0x0001); + + /* write data to nor flash, WRITE_READ_ADDR: the starting address of the write data */ + status = nor_write_buffer(writebuffer, WRITE_READ_ADDR, BUFFER_SIZE); + if(NOR_SUCCESS == status){ + printf("\r\nwrite data to nor flash block successfully!"); + }else{ + printf("\r\nwrite data to nor flash block failure!"); + + while(1); + } + + /* read data from nor flash, WRITE_READ_ADDR: the starting address of the read data*/ + nor_readbuffer(readbuffer, WRITE_READ_ADDR, BUFFER_SIZE); + + /* read and write data comparison for equality */ + writereadstatus = 0; + for(i = 0x00; i < BUFFER_SIZE; i++){ + if (readbuffer[i] != writebuffer[i]){ + writereadstatus++; + break; + } + } + + printf("\n\rthe result to access the nor flash:\n\r"); + if(writereadstatus == 0) + { + printf("\n\raccess nor flash successfully!\n\r"); + }else{ + printf("\n\raccess nor flash failure!\n\r"); + while(1); + } + + printf("\n\rprintf data to be read: \n\r"); + printf("\n\r"); + for(i = 0; i < BUFFER_SIZE; i++) + { + printf("%d ",readbuffer[i]); + } + while(1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM0,USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/readme.txt new file mode 100644 index 0000000..14d2359 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/NOR/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of the EXMC_NOR demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GDM3201VB Start Kit board, it shows how to use +EXMC peripheral to control NOR memory. + + This demo shows the write and read data operation process of NOR memory by +EXMC module. Select the project "GD32F10X_MD".If the operation is correct, a +success information and the data writed to the NOR memory. Otherwise, a failure +information will be printed out. + + SW1 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.c new file mode 100644 index 0000000..9438289 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.c @@ -0,0 +1,248 @@ +/*! + \file exmc_sram.c + \brief EXMC SRAM(ISSI IS61LV51216) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "exmc_sram.h" + +#define Bank0_SRAM2_ADDR ((uint32_t)0x60000000) +#define BANK_SRAM_ADDR Bank0_SRAM2_ADDR + +/*! + \brief SRAM peripheral initialize + \param[in] none + \param[out] none + \retval none +*/ +void exmc_sram_init(void) +{ + exmc_norsram_parameter_struct nor_init_struct; + exmc_norsram_timing_parameter_struct nor_timing_init_struct; + + /* EXMC clock enable */ + rcu_periph_clock_enable(RCU_EXMC); + + /* EXMC enable */ + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* configure EXMC_D[0~15]*/ + /* PD14(EXMC_D0), PD15(EXMC_D1),PD0(EXMC_D2), PD1(EXMC_D3), PD8(EXMC_D13), PD9(EXMC_D14), PD10(EXMC_D15) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15); + + /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), + PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | + GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); + /* PD11(EXMC_A16), PD12(EXMC_A17), PD13(EXMC_A18) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13); + + /* configure NOE(PD4),NWE(PD5) and NE0(PD7) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_7); + + /* configure NBL0(PE0) and NBL1(PE1) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1); + + /* configure EXMC NADV (PB7) */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + /* configure timing parameter */ + nor_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_A; + nor_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK; + nor_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE; + nor_timing_init_struct.bus_latency = 1; + nor_timing_init_struct.asyn_data_setuptime = 7; + nor_timing_init_struct.asyn_address_holdtime = 2; + nor_timing_init_struct.asyn_address_setuptime = 5; + + /* configure EXMC bus parameters */ + nor_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION0; + nor_init_struct.write_mode = EXMC_ASYN_WRITE; + nor_init_struct.extended_mode = DISABLE; + nor_init_struct.asyn_wait = DISABLE; + nor_init_struct.nwait_signal = DISABLE; + nor_init_struct.memory_write = ENABLE; + nor_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + nor_init_struct.wrap_burst_mode = DISABLE; + nor_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + nor_init_struct.burst_mode = DISABLE; + nor_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + nor_init_struct.memory_type = EXMC_MEMORY_TYPE_SRAM; + nor_init_struct.address_data_mux = ENABLE; + nor_init_struct.read_write_timing = &nor_timing_init_struct; + nor_init_struct.write_timing = &nor_timing_init_struct; + exmc_norsram_init(&nor_init_struct); + + /* enable the EXMC bank0 NORSRAM */ + exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION0); +} + +/*! + \brief write a Half-word buffer(data is 16 bits) to the EXMC SRAM memory + \param[in] pbuffer : pointer to buffer + \param[in] writeaddr : SRAM memory internal address from which the data will be written + \param[in] num_halfword_write : number of half-words to write + \param[out] none + \retval none +*/ +void exmc_sram_writebuffer_16(uint16_t* pbuffer, uint32_t writeaddr, uint32_t num_halfword_write) +{ + /* while there is data to write */ + for(;num_halfword_write != 0;num_halfword_write--){ + /* transfer data to the memory */ + *(uint16_t *) (BANK_SRAM_ADDR + writeaddr) = *pbuffer++; + + /* increment the address */ + writeaddr += 2; + } +} + +/*! + \brief read a block of 16-bit data from the EXMC SRAM memory + \param[in] pbuffer : pointer to the buffer that receives the data read from the SRAM memory + \param[in] readaddr : SRAM memory internal address to read from + \param[in] num_halfword_read : number of half-words to read + \param[out] none + \retval none +*/ +void exmc_sram_readbuffer_16(uint16_t* pbuffer, uint32_t readaddr, uint32_t num_halfword_read) +{ + /* while there is data to read */ + for(; num_halfword_read != 0; num_halfword_read--) { + /* read a half-word from the memory */ + *pbuffer++ = *(uint16_t*) (BANK_SRAM_ADDR + readaddr); + + /* increment the address */ + readaddr += 2; + } +} + +/*! + \brief write a word buffer(data is 32 bits) to the EXMC SRAM memory + \param[in] pbuffer : pointer to buffer + \param[in] writeaddr : SRAM memory internal address from which the data will be written + \param[in] num_word_write : number of words to write + \param[out] none + \retval none +*/ +void exmc_sram_writebuffer_32(uint32_t* pbuffer, uint32_t writeaddr, uint32_t num_word_write) +{ + /* while there is data to write */ + for(; num_word_write != 0; num_word_write--){ + /* transfer data to the memory */ + *(uint32_t *)(BANK_SRAM_ADDR + writeaddr) = *pbuffer++; + + /* increment the address */ + writeaddr += 4; + } +} + +/*! + \brief read a block of 32-bit data from the EXMC SRAM memory + \param[in] pbuffer : pointer to the buffer that receives the data read from the SRAM memory + \param[in] readaddr : SRAM memory internal address to read from + \param[in] num_word_read : number of words to read + \param[out] none + \retval none +*/ +void exmc_sram_readbuffer_32(uint32_t* pbuffer, uint32_t readaddr, uint32_t num_word_read) +{ + /* while there is data to read */ + for(; num_word_read != 0; num_word_read--){ + /* read a word from the memory */ + *pbuffer++ = *(uint32_t*) (BANK_SRAM_ADDR + readaddr); + + /* increment the address */ + readaddr += 4; + } +} + +/*! + \brief write a Byte buffer(data is 8 bits ) to the EXMC SRAM memory + \param[in] pbuffer : pointer to buffer + \param[in] writeaddr : SRAM memory internal address from which the data will be written + \param[in] num_byte_write : number of bytes to write + \param[out] none + \retval none +*/ +void exmc_sram_writebuffer_8(uint8_t* pbuffer, uint32_t writeaddr, uint32_t num_byte_write) +{ + /* while there is data to write */ + for(; num_byte_write != 0; num_byte_write--){ + /* transfer data to the memory */ + *(uint8_t *) (BANK_SRAM_ADDR + writeaddr) = *pbuffer++; + + /* increment the address*/ + writeaddr += 1; + } +} + +/*! + \brief read a block of 8-bit data from the EXMC SRAM memory + \param[in] pbuffer : pointer to the buffer that receives the data read from the SRAM memory + \param[in] readaddr : SRAM memory internal address to read from + \param[in] num_byte_read : number of bytes to write + \param[out] none + \retval none +*/ +void exmc_sram_readbuffer_8(uint8_t* pbuffer, uint32_t readaddr, uint32_t num_byte_read) +{ + /* while there is data to read */ + for(; num_byte_read != 0; num_byte_read--){ + /* read a byte from the memory */ + *pbuffer++ = *(uint8_t*) (BANK_SRAM_ADDR + readaddr); + + /* increment the address */ + readaddr += 1; + } +} + +/*! + \brief fill the 16-bit buffer with specified value + \param[in] pbuffer: pointer on the buffer to fill + \param[in] buffersize: size of the buffer to fill + \param[in] offset: first value to fill on the buffer + \param[out] none + \retval none +*/ +void fill_buffer_16(uint16_t *pbuffer, uint16_t buffer_lenght, uint16_t offset) +{ + uint16_t index = 0; + + for(index = 0; index < buffer_lenght; index++ ){ + pbuffer[index] = index + offset; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.h new file mode 100644 index 0000000..ef5a90e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/exmc_sram.h @@ -0,0 +1,58 @@ +/*! + \file exmc_sram.h + \brief the header file of EXMC SRAM(ISSI IS61LV51216) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef EXMC_SRAM_H +#define EXMC_SRAM_H + +#include "gd32f10x.h" + +/* function declarations */ +/* SRAM peripheral initialize */ +void exmc_sram_init(void); +/* write a Half-word buffer(data is 16 bits) to the EXMC SRAM memory */ +void exmc_sram_writebuffer_16(uint16_t* pbuffer, uint32_t writeaddr, uint32_t num_halfword_write); +/* read a block of 16-bit data from the EXMC SRAM memory */ +void exmc_sram_readbuffer_16(uint16_t* pbuffer, uint32_t readaddr, uint32_t num_halfword_read); +/* write a Byte buffer(data is 8 bits ) to the EXMC SRAM memory */ +void exmc_sram_writebuffer_8(uint8_t* pbuffer, uint32_t writeaddr, uint32_t num_byte_write); +/* read a block of 8-bit data from the EXMC SRAM memory */ +void exmc_sram_readbuffer_8(uint8_t* pbuffer, uint32_t readaddr, uint32_t num_byte_read); +/* write a word buffer(data is 32 bits) to the EXMC SRAM memory */ +void exmc_sram_writebuffer_32(uint32_t* pbuffer, uint32_t writeaddr, uint32_t num_word_write); +/* read a block of 32-bit data from the EXMC SRAM memory */ +void exmc_sram_readbuffer_32(uint32_t* pbuffer, uint32_t readaddr, uint32_t num_word_read); +/* fill the 16-bit buffer with specified value */ +void fill_buffer_16(uint16_t *pbuffer, uint16_t buffer_lenght, uint16_t offset); + +#endif /* EXMC_SRAM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/main.c new file mode 100644 index 0000000..889001b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/main.c @@ -0,0 +1,96 @@ +/*! + \file main.c + \brief EXMC SRAM demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "exmc_sram.h" + +#define BUFFER_SIZE 4 /*!< write or read buffer size */ +#define WRITE_READ_ADDR 0x0000 /*!< SRAM write or read address */ + +uint16_t txbuffer[BUFFER_SIZE]; +uint16_t rxbuffer[BUFFER_SIZE]; +uint16_t writereadstatus = 0; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint16_t i = 0; + + /* config the USART */ + gd_eval_com_init(EVAL_COM0); + /* config the EXMC access mode */ + exmc_sram_init(); + /* fill txbuffer */ + fill_buffer_16(txbuffer, BUFFER_SIZE, 0x1215); + /* write data to SRAM */ + exmc_sram_writebuffer_16(txbuffer, WRITE_READ_ADDR, BUFFER_SIZE); + /* read data from SRAM */ + exmc_sram_readbuffer_16(rxbuffer, WRITE_READ_ADDR, BUFFER_SIZE); + /* compare two buffers */ + for(i = 0;i < BUFFER_SIZE;i++){ + if (rxbuffer[i] != txbuffer[i]){ + writereadstatus ++; + break; + } + } + if(writereadstatus){ + printf("\r\nSRAM test failed!"); + }else{ + printf("\r\nSRAM test successed!"); + printf("\r\nthe data is:\r\n"); + for(i=0;i < BUFFER_SIZE;i++){ + printf("%6x",rxbuffer[i]); + if(((i+1)%6) == 0){ + printf("\r\n"); + } + } + } + + while(1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while (RESET == usart_flag_get(EVAL_COM0,USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/readme.txt new file mode 100644 index 0000000..49e1470 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXMC/SRAM/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of the EXMC_SRAM demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GDM3201VB Start Kit board, it shows how to use EXMC peripheral +to control SRAM memory. + + This demo shows the write and read data operation process of SRAM memory by EXMC + module. Select the project "GD32F10X_MD". If the operation is correct, "SRAM test +successed!" will be printed and the data read from the SRAM will be printed out. +Otherwise, "SRAM test failed!" will be printed. + + SW1 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.c new file mode 100644 index 0000000..264034e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.c @@ -0,0 +1,154 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles external lines 10 to 15 interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler(void) +{ + if(RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) { + gd_eval_led_toggle(LED3); + exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.h new file mode 100644 index 0000000..9ef58c8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles external lines 10 to 15 interrupt request */ +void EXTI10_15_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/main.c new file mode 100644 index 0000000..49dda18 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/main.c @@ -0,0 +1,56 @@ +/*! + \file main.c + \brief the example of EXTI which generates an interrupt request and toggle the LED + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LEDs and turn on LED2 */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_on(LED2); + + /* configure the tamper key */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + + while(1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/readme.txt new file mode 100644 index 0000000..e59f9e7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/EXTI/Key_external_interrupt_mode/readme.txt @@ -0,0 +1,38 @@ +/*! + \file readme.txt + \brief description of the EXTI key example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to generate +the interrupt request, and toggle the LED. After the system start-up,LED2 is on. +When tamper key is pressed, LED3 is toggled, it is switched on; when tamper key +is pressed once again, LED3 is toggled, it is switched off. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.c new file mode 100644 index 0000000..46e9029 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.c @@ -0,0 +1,182 @@ +/*! + \file main.c + \brief main flash program, erase + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "main.h" + +#define FMC_PAGE_SIZE ((uint16_t)0x400U) +#define FMC_WRITE_START_ADDR ((uint32_t)0x08004000U) +#define FMC_WRITE_END_ADDR ((uint32_t)0x08004800U) + +uint32_t *ptrd; +uint32_t address = 0x00; +uint32_t data0 = 0x01234567U; +led_typedef_enum led_num = LED4; + +/* calculate the num of page to be programmed/erased */ +uint32_t page_num = (FMC_WRITE_END_ADDR - FMC_WRITE_START_ADDR) / FMC_PAGE_SIZE; +/* calculate the num of page to be programmed/erased */ +uint32_t word_num = ((FMC_WRITE_END_ADDR - FMC_WRITE_START_ADDR) >> 2); + +/*! + \brief erase fmc pages from FMC_WRITE_START_ADDR to FMC_WRITE_END_ADDR + \param[in] none + \param[out] none + \retval none +*/ +void fmc_erase_pages(void) +{ + uint32_t erase_counter; + + /* unlock the flash program/erase controller */ + fmc_unlock(); + + /* clear all pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_END); + fmc_flag_clear(FMC_FLAG_BANK0_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR); + + /* erase the flash pages */ + for(erase_counter = 0; erase_counter < page_num; erase_counter++){ + fmc_page_erase(FMC_WRITE_START_ADDR + (FMC_PAGE_SIZE * erase_counter)); + fmc_flag_clear(FMC_FLAG_BANK0_END); + fmc_flag_clear(FMC_FLAG_BANK0_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR); + } + + /* lock the main FMC after the erase operation */ + fmc_lock(); +} + +/*! + \brief program fmc word by word from FMC_WRITE_START_ADDR to FMC_WRITE_END_ADDR + \param[in] none + \param[out] none + \retval none +*/ +void fmc_program(void) +{ + /* unlock the flash program/erase controller */ + fmc_unlock(); + + address = FMC_WRITE_START_ADDR; + + /* program flash */ + while(address < FMC_WRITE_END_ADDR){ + fmc_word_program(address, data0); + address += 4; + fmc_flag_clear(FMC_FLAG_BANK0_END); + fmc_flag_clear(FMC_FLAG_BANK0_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR); + } + + /* lock the main FMC after the program operation */ + fmc_lock(); +} + +/*! + \brief check fmc erase result + \param[in] none + \param[out] none + \retval none +*/ +void fmc_erase_pages_check(void) +{ + uint32_t i; + + ptrd = (uint32_t *)FMC_WRITE_START_ADDR; + + /* check flash whether has been erased */ + for(i = 0; i < word_num; i++){ + if(0xFFFFFFFF != (*ptrd)){ + led_num = LED2; + gd_eval_led_on(led_num); + break; + }else{ + ptrd++; + } + } +} + +/*! + \brief check fmc program result + \param[in] none + \param[out] none + \retval none +*/ +void fmc_program_check(void) +{ + uint32_t i; + + ptrd = (uint32_t *)FMC_WRITE_START_ADDR; + + /* check flash whether has been programmed */ + for(i = 0; i < word_num; i++){ + if((*ptrd) != data0){ + led_num = LED3; + gd_eval_led_on(led_num); + break; + }else{ + ptrd++; + } + } +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize led on the board */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + + /* step1: erase pages and check if it is successful. if not, light the LED2 */ + fmc_erase_pages(); + fmc_erase_pages_check(); + + /* step2: program and check if it is successful. if not, light the LED3 */ + fmc_program(); + fmc_program_check(); + + /* if all the operations are successful, light the LED4 */ + gd_eval_led_on(led_num); + + while(1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.h new file mode 100644 index 0000000..d45367c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/main.h @@ -0,0 +1,47 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +/* erase fmc pages from FMC_WRITE_START_ADDR to FMC_WRITE_END_ADDR */ +void fmc_erase_pages(void); +/* program fmc word by word from FMC_WRITE_START_ADDR to FMC_WRITE_END_ADDR */ +void fmc_program(void); +/* check fmc erase result */ +void fmc_erase_pages_check(void); +/* check fmc program result */ +void fmc_program_check(void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/readme.txt new file mode 100644 index 0000000..bd2c2a0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Erase_Program/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of the Erase_Program example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + This example is based on the GD32107C-EVAL board, it provides a description of +how to erase and program flash memory. + + In erasing operation, a comparison between flash memory and 0xffffffff is done to +check whether the flash memory has been correctly erased. If the result is wrong, +LED2 will be on. + + In programming operation, a comparison between flash memory and target data is +done to check whether the flash memory has been correctly programmed. If the result +is wrong, LED3 will be on. + + If all the three operations are successful, LED4 will be on. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/main.c new file mode 100644 index 0000000..920aa14 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/main.c @@ -0,0 +1,158 @@ +/*! + \file main.c + \brief main flash program, write_protection + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include + +#define FLASH_PAGE_PROGRAM +//#define WRITE_PROTECTION_ENABLE +#define WRITE_PROTECTION_DISABLE + +typedef enum {FAILED = 0, PASSED = !FAILED} test_state; +#define FLASH_PAGE_SIZE ((uint16_t)0x800) +#define FMC_PAGES_PROTECTED (OB_WP_4 | OB_WP_5) + +#define BANK0_WRITE_START_ADDR ((uint32_t)0x08004000) +#define BANK0_WRITE_END_ADDR ((uint32_t)0x08010000) + +uint32_t erase_counter = 0x0, address = 0x0; +uint16_t data = 0x1753; +uint32_t wp_value = 0xFFFFFFFF, protected_pages = 0x0; +uint32_t page_number; +__IO fmc_state_enum fmc_state = FMC_READY; +__IO test_state program_state = PASSED; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize led on the board */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* unlock the flash program/erase controller */ + fmc_unlock(); + ob_unlock(); + + fmc_flag_clear(FMC_FLAG_BANK0_END); + fmc_flag_clear(FMC_FLAG_BANK0_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR); + + /* get pages write protection status */ + wp_value = ob_write_protection_get(); + +#ifdef WRITE_PROTECTION_DISABLE + /* get pages already write protected */ + protected_pages = ~(wp_value | FMC_PAGES_PROTECTED); + /* check if desired pages are already write protected */ + if((wp_value | (~FMC_PAGES_PROTECTED)) != 0xFFFFFFFF ){ + /* erase all the option Bytes */ + fmc_state = ob_erase(); + + /* check if there is write protected pages */ + if(protected_pages != 0x0){ + /* Restore write protected pages */ + fmc_state = ob_write_protection_enable(protected_pages); + } + /* generate system reset to load the new option byte values */ + NVIC_SystemReset(); + } +#elif defined WRITE_PROTECTION_ENABLE + /* get current write protected pages and the new pages to be protected */ + protected_pages = (~wp_value) | FMC_PAGES_PROTECTED; + + /* check if desired pages are not yet write protected */ + if(((~wp_value) & FMC_PAGES_PROTECTED )!= FMC_PAGES_PROTECTED){ + + /* erase all the option bytes because if a program operation is + performed on a protected page, the flash memory returns a + protection error */ + fmc_state = ob_erase(); + + /* enable the pages write protection */ + fmc_state = ob_write_protection_enable(protected_pages); + + /* generate system reset to load the new option byte values */ + NVIC_SystemReset(); + } +#endif /* WRITE_PROTECTION_DISABLE */ + +#ifdef FLASH_PAGE_PROGRAM + /* get the number of pages to be erased */ + page_number = (BANK0_WRITE_END_ADDR - BANK0_WRITE_START_ADDR) / FLASH_PAGE_SIZE; + + /* the selected pages are not write protected */ + if(0x00 != (wp_value & FMC_PAGES_PROTECTED)){ + /* clear all pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_END); + fmc_flag_clear(FMC_FLAG_BANK0_WPERR); + fmc_flag_clear(FMC_FLAG_BANK0_PGERR); + + /* erase the flash pages */ + for(erase_counter = 0; (erase_counter < page_number) && (FMC_READY == fmc_state); erase_counter++){ + fmc_state = fmc_page_erase(BANK0_WRITE_START_ADDR + (FLASH_PAGE_SIZE * erase_counter)); + } + + /* flash half word program of data 0x1753 at addresses defined by BANK1_WRITE_START_ADDR and BANK1_WRITE_END_ADDR */ + address = BANK0_WRITE_START_ADDR; + + while((address < BANK0_WRITE_END_ADDR) && (FMC_READY == fmc_state)){ + fmc_state = fmc_halfword_program(address, data); + address = address + 2; + } + /* check the correctness of written data */ + address = BANK0_WRITE_START_ADDR; + + while((address < BANK0_WRITE_END_ADDR) && (FAILED != program_state)){ + if(REG16(address) != data){ + program_state = FAILED; + } + address += 2; + } + gd_eval_led_on(LED2); + } + else{ + /* error to program the flash: the desired pages are write protected */ + program_state = FAILED; + gd_eval_led_on(LED3); + } +#endif /* FLASH_PAGE_PROGRAM */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/readme.txt new file mode 100644 index 0000000..b83a675 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FMC/Write_Protection/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of the Write_Protection example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL board, it provides a description of how to +enable and disable the write protection for the embedded flash. + + Uncomment the line "#define WRITE_PROTECTION_ENABLE" and "#define FLASH_PAGE_PROGRAM" +in main.c file, download the program, an error will occur to program the flash and LED3 +will on. + + Uncomment the line "#define WRITE_PROTECTION_DISABLE" and "#define FLASH_PAGE_PROGRAM" +in main.c file, download the program, the flash will be writeen correctly and LED2 will on. + + User can check the value of FMC_WP register to verify if the write protected operation is +successful or not. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.c new file mode 100644 index 0000000..180c101 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.c @@ -0,0 +1,169 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles EXTI10_15 interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler(void) +{ + /* make sure whether the tamper key EXTI Line is interrupted */ + if(RESET != exti_interrupt_flag_get(EXTI_13)) { + /* reload FWDGT counter */ + fwdgt_counter_reload(); + } + + /* clear the interrupt flag bit */ + exti_interrupt_flag_clear(EXTI_13); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.h new file mode 100644 index 0000000..29fa4c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* this function handles EXTI10_15 interrupt request */ +void EXTI10_15_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/main.c new file mode 100644 index 0000000..cc6ee25 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/main.c @@ -0,0 +1,76 @@ +/*! + \file main.c + \brief FWDGT key demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + /* configure LED */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* configure the Tamper key which is used to reload FWDGT */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + delay_1ms(500); + /* configure FWDGT counter clock: 40KHz(IRC40K) / 64 = 0.625 KHz */ + fwdgt_config(2 * 500, FWDGT_PSC_DIV64); + /* after 1.6 seconds to generate a reset */ + fwdgt_enable(); + + /* check if the system has resumed from FWDGT reset */ + if(RESET != rcu_flag_get(RCU_FLAG_FWDGTRST)) { + /* turn on LED3 */ + gd_eval_led_on(LED3); + /* clear the FWDGT reset flag */ + rcu_all_reset_flag_clear(); + + while(1) { + } + } else { + /* turn on LED2 */ + gd_eval_led_on(LED2); + } + while(1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/readme.txt new file mode 100644 index 0000000..94caf0d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/readme.txt @@ -0,0 +1,58 @@ +/*! + \file readme.txt + \brief description of the FWDGT_key example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to reload the +FWDGT counter at regulate period using the EXTI interrupt. The FWDGT timeout +is set to 1.6s (the timeout may varies due to IRC40K frequency dispersion). + + An EXTI is connected to a specific GPIO pin and configured to generate an interrupt +on its falling edge: when the EXTI Line interrupt is triggered (by pressing the tamper +key on the board), the corresponding interrupt is served. In the ISR, FWDGT counter is +reloaded). + + If the EXTI Line interrupt does not occur, the FWDGT counter is not reloaded before +the FWDGT counter reaches 00h, and the FWDGT reset. + + There are three operation methods as follow: + 1.After the download is completed and the system is powered on, LED2 flashes once and +then LED3 starts flashing. + + 2.After the download is completed and the system is powered on, start to press the tamper +button in quick succession, then LED2 is always on, and stop pressing the tamper button in +quick succession and LED3 starts to flash. + + 3.After the download is completed and the system is powered on, LED2 flashes once and then +LED3 starts flashing. At this time, after pressing the tamper button in rapid succession, +LED3 is always on, and after stopping the rapid and continuous pressing of the tamper button, +LED3 starts flashing diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.c new file mode 100644 index 0000000..db9fcaa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while(1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay) { + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay) { + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.h new file mode 100644 index 0000000..2e54b93 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/FWDGT/FWDGT_key/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.c new file mode 100644 index 0000000..f8ce6a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.h new file mode 100644 index 0000000..d8da237 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_libopt.h new file mode 100644 index 0000000..1727d82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/main.c new file mode 100644 index 0000000..4741575 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/main.c @@ -0,0 +1,63 @@ +/*! + \file main.c + \brief debug port use as GPIO output + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + + /* SWD remap */ + gpio_pin_remap_config(GPIO_SWJ_SWDPENABLE_REMAP, ENABLE); + /* GPIOB output */ + gpio_init(GPIOB, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3|GPIO_PIN_4); + + while(1){ + gpio_bit_set(GPIOB, GPIO_PIN_3|GPIO_PIN_4); + delay_1ms(500); + gpio_bit_reset(GPIOB, GPIO_PIN_3|GPIO_PIN_4); + delay_1ms(500); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/readme.txt new file mode 100644 index 0000000..bdac1d0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/readme.txt @@ -0,0 +1,39 @@ +/*! + \file readme.txt + \brief description of debug port use as GPIO output example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C board, it provides a description +of PB3/PB4 output. + + After system start-up, PB3 and PB4 will output high level and low level every 500ms. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.c new file mode 100644 index 0000000..7b7622a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.h new file mode 100644 index 0000000..3b483d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Debugport_use_as_GPIO_output/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.c new file mode 100644 index 0000000..3da342a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.c @@ -0,0 +1,152 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "main.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.h new file mode 100644 index 0000000..2b7b488 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.c new file mode 100644 index 0000000..0c7f9f3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.c @@ -0,0 +1,63 @@ +/*! + \file main.c + \brief keyboard polling mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include "gd32f10x_eval.h" +#include + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + gd_eval_led_init(LED2); + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + while(1){ + /* check whether the button is pressed */ + if(RESET == gd_eval_key_state_get(KEY_TAMPER)){ + delay_1ms(100); + + /* check whether the button is pressed */ + if(RESET == gd_eval_key_state_get(KEY_TAMPER)){ + gd_eval_led_toggle(LED2); + } + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.h new file mode 100644 index 0000000..90d36c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __MAIN_H +#define __MAIN_H + +/* led spark function */ +void led_spark(void); + +#endif /* __MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/readme.txt new file mode 100644 index 0000000..62bddc8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of keyboard polling mode example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C board, it provides a description +of how to use Tamper key to control the LED2. The example uses polling mode. + + Press the Tamper key, LED2 will be on. Press the Tamper Key again, LED2 will be off. + + On the GD32F107C-EVAL-V1.3 board, the Tamper key is connected to PC13 and the LED2 +is connected to PC0. + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.c new file mode 100644 index 0000000..0918b02 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.h new file mode 100644 index 0000000..016a55f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Keyboard_polling_mode/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.c new file mode 100644 index 0000000..3da342a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.c @@ -0,0 +1,152 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "main.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.h new file mode 100644 index 0000000..2b7b488 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.c new file mode 100644 index 0000000..1210346 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.c @@ -0,0 +1,72 @@ +/*! + \file main.c + \brief running led + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + while(1){ + /* turn on led2, turn off led5 */ + gd_eval_led_on(LED2); + gd_eval_led_off(LED5); + delay_1ms(1000); + /* turn on led3, turn off led2 */ + gd_eval_led_on(LED3); + gd_eval_led_off(LED2); + delay_1ms(1000); + /* turn on led4, turn off led3 */ + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + delay_1ms(1000); + /* turn on led5, turn off led4 */ + gd_eval_led_on(LED5); + gd_eval_led_off(LED4); + delay_1ms(1000); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.h new file mode 100644 index 0000000..90d36c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __MAIN_H +#define __MAIN_H + +/* led spark function */ +void led_spark(void); + +#endif /* __MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/readme.txt new file mode 100644 index 0000000..13e7cd2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of running led example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C board, it provides a description +of Running_led. After system start-up, firstly, LED2 on, then, LED3 on, four +LEDs can light periodically. + + On the GD32F107C-EVAL-V1.3 board,LED2 connected to PC0, LED3 connected to PC2, LED4 +connected to PE0, LED5 connected to PE1. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.c new file mode 100644 index 0000000..0918b02 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.h new file mode 100644 index 0000000..016a55f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/GPIO/Running_led/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.c new file mode 100644 index 0000000..b9676e5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.c @@ -0,0 +1,702 @@ +/*! + \file at24cxx.c + \brief the read and write function file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "at24cxx.h" +#include "i2c.h" +#include + +#define EEPROM_BLOCK0_ADDRESS 0xA0 +#define BUFFER_SIZE 256 +uint16_t eeprom_address; + +/*! + \brief I2C read and write functions + \param[in] none + \param[out] none + \retval I2C_OK or I2C_FAIL +*/ +uint8_t i2c_24c02_test(void) +{ + uint16_t i; + uint8_t i2c_buffer_write[BUFFER_SIZE]; + uint8_t i2c_buffer_read[BUFFER_SIZE]; + + printf("\r\nAT24C02 writing...\r\n"); + + /* initialize i2c_buffer_write */ + for(i = 0; i < BUFFER_SIZE; i++) { + i2c_buffer_write[i] = i; + printf("0x%02X ", i2c_buffer_write[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + /* EEPROM data write */ + eeprom_buffer_write_timeout(i2c_buffer_write, EEP_FIRST_PAGE, BUFFER_SIZE); + printf("AT24C02 reading...\r\n"); + /* EEPROM data read */ + eeprom_buffer_read_timeout(i2c_buffer_read, EEP_FIRST_PAGE, BUFFER_SIZE); + /* compare the read buffer and write buffer */ + for(i = 0; i < BUFFER_SIZE; i++) { + if(i2c_buffer_read[i] != i2c_buffer_write[i]) { + printf("0x%02X ", i2c_buffer_read[i]); + printf("Err:data read and write aren't matching.\n\r"); + return I2C_FAIL; + } + printf("0x%02X ", i2c_buffer_read[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + printf("I2C-AT24C02 test passed!\n\r"); + return I2C_OK; +} + +/*! + \brief initialize peripherals used by the I2C EEPROM driver + \param[in] none + \param[out] none + \retval none +*/ +void i2c_eeprom_init(void) +{ + eeprom_address = EEPROM_BLOCK0_ADDRESS; +} + +/*! + \brief write one byte to the EEPROM and use timeout function + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write to + \param[out] none + \retval none +*/ +uint8_t eeprom_byte_write_timeout(uint8_t *p_buffer, uint8_t write_address) +{ + uint8_t state = I2C_START; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in WRITE BYTE!\n"); + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + timeout = 0; + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends start signal timeout in WRITE BYTE!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + /* address flag set means i2c slave sends ACK */ + while((! i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + state = I2C_TRANSMIT_DATA; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master clears address flag timeout in WRITE BYTE!\n"); + } + break; + case I2C_TRANSMIT_DATA: + /* wait until the transmit data buffer is empty */ + while((! i2c_flag_get(I2CX, I2C_FLAG_TBE)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, write_address); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE BYTE!\n"); + } + + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, *p_buffer); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE BYTE!\n"); + } + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + state = I2C_STOP; + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE BYTE!\n"); + } + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_END; + i2c_timeout_flag = I2C_OK; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends stop signal timeout in WRITE BYTE!\n"); + } + break; + default: + state = I2C_START; + i2c_timeout_flag = I2C_OK; + timeout = 0; + printf("i2c master sends start signal in WRITE BYTE.\n"); + break; + } + } + return I2C_END; +} +/*! + \brief write more than one byte to the EEPROM with a single write cycle + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write to + \param[in] number_of_byte: number of bytes to write to the EEPROM + \param[out] none + \retval none +*/ +uint8_t eeprom_page_write_timeout(uint8_t *p_buffer, uint8_t write_address, uint8_t number_of_byte) +{ + uint8_t state = I2C_START; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in WRITE!\n"); + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + timeout = 0; + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends start signal timeout in WRITE!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + /* address flag set means i2c slave sends ACK */ + while((! i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + state = I2C_TRANSMIT_DATA; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master clears address flag timeout in WRITE!\n"); + } + break; + case I2C_TRANSMIT_DATA: + /* wait until the transmit data buffer is empty */ + while((! i2c_flag_get(I2CX, I2C_FLAG_TBE)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, write_address); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends EEPROM's internal address timeout in WRITE!\n"); + } + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE!\n"); + } + while(number_of_byte--) { + i2c_data_transmit(I2CX, *p_buffer); + /* point to the next byte to be written */ + p_buffer++; + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE!\n"); + } + } + timeout = 0; + state = I2C_STOP; + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_END; + i2c_timeout_flag = I2C_OK; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends stop signal timeout in WRITE!\n"); + } + break; + default: + state = I2C_START; + i2c_timeout_flag = I2C_OK; + timeout = 0; + printf("i2c master sends start signal in WRITE.\n"); + break; + } + } + return I2C_END; +} + +/*! + \brief write buffer of data to the EEPROM use timeout function + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write to + \param[in] number_of_byte: number of bytes to write to the EEPROM + \param[out] none + \retval none +*/ +void eeprom_buffer_write_timeout(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte) +{ + uint8_t number_of_page = 0, number_of_single = 0, address = 0, count = 0; + + address = write_address % I2C_PAGE_SIZE; + count = I2C_PAGE_SIZE - address; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + /* if write_address is I2C_PAGE_SIZE aligned */ + if(0 == address) { + while(number_of_page--) { + eeprom_page_write_timeout(p_buffer, write_address, I2C_PAGE_SIZE); + eeprom_wait_standby_state_timeout(); + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE; + } + if(0 != number_of_single) { + eeprom_page_write_timeout(p_buffer, write_address, number_of_single); + eeprom_wait_standby_state_timeout(); + } + } else { + /* if write_address is not I2C_PAGE_SIZE aligned */ + if(number_of_byte < count) { + eeprom_page_write_timeout(p_buffer, write_address, number_of_byte); + eeprom_wait_standby_state_timeout(); + } else { + number_of_byte -= count; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + if(0 != count) { + eeprom_page_write_timeout(p_buffer, write_address, count); + eeprom_wait_standby_state_timeout(); + write_address += count; + p_buffer += count; + } + /* write page */ + while(number_of_page--) { + eeprom_page_write_timeout(p_buffer, write_address, I2C_PAGE_SIZE); + eeprom_wait_standby_state_timeout(); + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE; + } + /* write single */ + if(0 != number_of_single) { + eeprom_page_write_timeout(p_buffer, write_address, number_of_single); + eeprom_wait_standby_state_timeout(); + } + } + } +} + +/*! + \brief read data from the EEPROM + \param[in] p_buffer: pointer to the buffer that receives the data read from the EEPROM + \param[in] read_address: EEPROM's internal address to start reading from + \param[in] number_of_byte: number of bytes to reads from the EEPROM + \param[out] none + \retval none +*/ +uint8_t eeprom_buffer_read_timeout(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte) +{ + uint8_t state = I2C_START; + uint8_t read_cycle = 0; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + if(RESET == read_cycle) { + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* whether to send ACK or not for the next byte */ + if(2 == number_of_byte) { + i2c_ackpos_config(I2CX, I2C_ACKPOS_NEXT); + } + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in READ!\n"); + } + } + /* send the start signal */ + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + if(RESET == read_cycle) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + i2c_master_addressing(I2CX, eeprom_address, I2C_RECEIVER); + if(number_of_byte < 3) { + /* disable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + } + state = I2C_CLEAR_ADDRESS_FLAG; + } + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends start signal timeout in READ!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + /* address flag set means i2c slave sends ACK */ + while((!i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + if((SET == read_cycle) && (1 == number_of_byte)) { + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + } + timeout = 0; + state = I2C_TRANSMIT_DATA; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master clears address flag timeout in READ!\n"); + } + break; + case I2C_TRANSMIT_DATA: + if(RESET == read_cycle) { + /* wait until the transmit data buffer is empty */ + while((! i2c_flag_get(I2CX, I2C_FLAG_TBE)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, read_address); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master wait data buffer is empty timeout in READ!\n"); + } + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_START; + read_cycle++; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends EEPROM's internal address timeout in READ!\n"); + } + } else { + while(number_of_byte) { + timeout++; + if(3 == number_of_byte) { + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + /* disable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + } + if(2 == number_of_byte) { + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + } + /* wait until RBNE bit is set */ + if(i2c_flag_get(I2CX, I2C_FLAG_RBNE)) { + /* read a byte from the EEPROM */ + *p_buffer = i2c_data_receive(I2CX); + + /* point to the next location where the byte read will be saved */ + p_buffer++; + + /* decrement the read bytes counter */ + number_of_byte--; + timeout = 0; + } + if(timeout > I2C_TIME_OUT) { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends data timeout in READ!\n"); + } + } + timeout = 0; + state = I2C_STOP; + } + break; + case I2C_STOP: + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_END; + i2c_timeout_flag = I2C_OK; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends stop signal timeout in READ!\n"); + } + break; + default: + state = I2C_START; + read_cycle = 0; + i2c_timeout_flag = I2C_OK; + timeout = 0; + printf("i2c master sends start signal in READ.\n"); + break; + } + } + return I2C_END; +} + +/*! + \brief wait for EEPROM standby state use timeout function + \param[in] none + \param[out] none + \retval none +*/ +uint8_t eeprom_wait_standby_state_timeout() +{ + uint8_t state = I2C_START; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in EEPROM standby!\n"); + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + timeout = 0; + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends start signal timeout in EEPROM standby!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + while((!((i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) || (i2c_flag_get(I2CX, I2C_FLAG_AERR)))) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + if(i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + i2c_timeout_flag = I2C_OK; + /* exit the function */ + return I2C_END; + } else { + /* clear the bit of AE */ + i2c_flag_clear(I2CX, I2C_FLAG_AERR); + timeout = 0; + state = I2C_STOP; + } + } else { + timeout = 0; + state = I2C_START; + printf("i2c master clears address flag timeout in EEPROM standby!\n"); + } + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_START; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends stop signal timeout in EEPROM standby!\n"); + } + break; + default: + state = I2C_START; + timeout = 0; + printf("i2c master sends start signal end in EEPROM standby!.\n"); + break; + } + } + return I2C_END; + +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.h new file mode 100644 index 0000000..911ae51 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/at24cxx.h @@ -0,0 +1,70 @@ +/*! + \file at24cxx.h + \brief the header file of AT24Cxx + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef AT24CXX_H +#define AT24CXX_H + +#include "gd32f10x.h" + +typedef enum { + I2C_START = 0, + I2C_SEND_ADDRESS, + I2C_CLEAR_ADDRESS_FLAG, + I2C_TRANSMIT_DATA, + I2C_STOP, +} i2c_process_enum; + +#define I2C_TIME_OUT (uint16_t)(5000) +#define EEP_FIRST_PAGE 0x00 + +#define I2C_OK 1 +#define I2C_FAIL 0 +#define I2C_END 1 + +/* I2C read and write functions */ +uint8_t i2c_24c02_test(void); +/* initialize EEPROM address */ +void i2c_eeprom_init(void); +/* write one byte to the EEPROM and use timeout function */ +uint8_t eeprom_byte_write_timeout(uint8_t *p_buffer, uint8_t write_address); +/* write more than one byte to the EEPROM use timeout function */ +uint8_t eeprom_page_write_timeout(uint8_t *p_buffer, uint8_t write_address, uint8_t number_of_byte); +/* write buffer of data to the EEPROM use timeout function */ +void eeprom_buffer_write_timeout(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte); +/* read data from the EEPROM use timeout function */ +uint8_t eeprom_buffer_read_timeout(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte); +/* wait for EEPROM standby state use timeout function */ +uint8_t eeprom_wait_standby_state_timeout(void); + +#endif /* AT24CXX_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.c new file mode 100644 index 0000000..7cf5fd8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.h new file mode 100644 index 0000000..b692559 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_libopt.h new file mode 100644 index 0000000..c6de971 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.c new file mode 100644 index 0000000..a0821c8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.c @@ -0,0 +1,109 @@ +/*! + \file i2c.c + \brief I2C configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "i2c.h" +#include +#include "systick.h" + +/*! + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIO_I2C); + + /* connect PB6 to I2C_SCL */ + /* connect PB7 to I2C_SDA */ + gpio_init(I2C_SCL_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); +} + +/*! + \brief configure the I2CX interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* enable I2C clock */ + rcu_periph_clock_enable(RCU_I2C); + /* configure I2C clock */ + i2c_clock_config(I2CX, I2C_SPEED, I2C_DTCY_2); + /* configure I2C address */ + i2c_mode_addr_config(I2CX, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2CX_SLAVE_ADDRESS7); + /* enable I2CX */ + i2c_enable(I2CX); + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); +} + +/*! + \brief reset i2c bus + \param[in] none + \param[out] none + \retval none +*/ +void i2c_bus_reset() +{ + i2c_deinit(I2CX); + /* configure SDA/SCL for GPIO */ + GPIO_BC(I2C_SCL_PORT) |= I2C_SCL_PIN; + GPIO_BC(I2C_SDA_PORT) |= I2C_SDA_PIN; + gpio_init(I2C_SCL_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + GPIO_BOP(I2C_SCL_PORT) |= I2C_SCL_PIN; + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + GPIO_BOP(I2C_SDA_PORT) |= I2C_SDA_PIN; + /* connect I2C_SCL_PIN to I2C_SCL */ + /* connect I2C_SDA_PIN to I2C_SDA */ + gpio_init(I2C_SCL_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); + /* configure the I2CX interface */ + i2c_config(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.h new file mode 100644 index 0000000..a6fdffb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/i2c.h @@ -0,0 +1,59 @@ +/*! + \file i2c.h + \brief the header file of I2C + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef I2C_H +#define I2C_H + +#include "gd32f10x.h" + +#define I2C_SPEED 100000 +#define I2CX_SLAVE_ADDRESS7 0xA0 +#define I2C_PAGE_SIZE 8 + +#define I2CX I2C0 +#define RCU_GPIO_I2C RCU_GPIOB +#define RCU_I2C RCU_I2C0 +#define I2C_SCL_PORT GPIOB +#define I2C_SDA_PORT GPIOB +#define I2C_SCL_PIN GPIO_PIN_6 +#define I2C_SDA_PIN GPIO_PIN_7 + +/* configure the GPIO ports */ +void gpio_config(void); +/* configure the I2C0 interfaces */ +void i2c_config(void); +/* reset i2c bus */ +void i2c_bus_reset(void); + +#endif /* I2C_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/main.c new file mode 100644 index 0000000..f8a6d44 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/main.c @@ -0,0 +1,161 @@ +/*! + \file main.c + \brief use the I2C bus to write and read EEPROM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "i2c.h" +#include "at24cxx.h" + +uint8_t count = 0; + +void led_turn_on(uint8_t led_number); +void led_config(void); + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + /* turn off LED2,LED3,LED4,LED5 */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + + /* configure LEDs */ + led_config(); + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + printf("I2C-24C02 configured....\n\r"); + + /* configure GPIO */ + gpio_config(); + + /* configure I2C */ + i2c_config(); + + /* initialize EEPROM */ + i2c_eeprom_init(); + + printf("\r\nThe I2C is hardware interface "); + printf("\r\nThe speed is %d", I2C_SPEED); + + if(I2C_OK == i2c_24c02_test()) { + while(1) { + /* turn off all LEDs */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + /* turn on a LED */ + led_turn_on(count % 4); + count++; + if(count >= 4) { + count = 0; + } + delay_1ms(500); + } + } + /* turn on all LEDs */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + + while(1) { + } + +} + +/*! + \brief turn on a LED + \param[in] led_number + \param[out] none + \retval none +*/ +void led_turn_on(uint8_t led_number) +{ + switch(led_number) { + case 0: + gd_eval_led_on(LED2); + break; + case 1: + gd_eval_led_on(LED3); + break; + case 2: + gd_eval_led_on(LED4); + break; + case 3: + gd_eval_led_on(LED5); + break; + default: + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + break; + } +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/readme.txt new file mode 100644 index 0000000..0ad8773 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of using the I2C bus to write and read EEPROM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, It describes a communication +method between I2C bus and EEPROM with timeout and bus release function. The +access result will be printed by COM0. + + Procedures sequentially writes 256 bytes of data to the EEPROM from the 0x00 +address, and then the program sequentially reads 256 bytes of data from the +EEPROM from the 0x00 address. Compare the written data and read data, if the +same,"I2C-AT24C02 test passed!" will be printed, while the board of the four +LED lights start flashing, otherwise "Err:data read and write aren't matching." +will be printed, while the four LEDs light will on. + + P4 should be fitted to I2C and JP5 must be fitted to the USART port. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.c new file mode 100644 index 0000000..b6dc0a8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while(1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay) { + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay) { + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.h new file mode 100644 index 0000000..d5f18e2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.c new file mode 100644 index 0000000..61edc3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.c @@ -0,0 +1,583 @@ +/*! + \file at24cxx.c + \brief the read and write function file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "at24cxx.h" +#include "i2c.h" +#include + +#define EEPROM_BLOCK0_ADDRESS 0xA0 +#define BUFFER_SIZE 256 +uint16_t eeprom_address; + +/*! + \brief I2C read and write functions + \param[in] none + \param[out] none + \retval I2C_OK or I2C_FAIL +*/ +uint8_t i2c_24c02_test(void) +{ + uint16_t i; + + uint8_t i2c_buffer_write[BUFFER_SIZE]; + uint8_t i2c_buffer_read[BUFFER_SIZE]; + + printf("\r\nAT24C02 writing...\r\n"); + + /* initialize i2c_buffer_write */ + for(i = 0; i < BUFFER_SIZE; i++) { + i2c_buffer_write[i] = i; + printf("0x%02X ", i2c_buffer_write[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + /* EEPROM data write */ + eeprom_buffer_write_dma_timeout(i2c_buffer_write, EEP_FIRST_PAGE, BUFFER_SIZE); + printf("AT24C02 reading...\r\n"); + /* EEPROM data read */ + eeprom_buffer_read_dma_timeout(i2c_buffer_read, EEP_FIRST_PAGE, BUFFER_SIZE); + /* compare the read buffer and write buffer */ + for(i = 0; i < BUFFER_SIZE; i++) { + if(i2c_buffer_read[i] != i2c_buffer_write[i]) { + printf("0x%02X ", i2c_buffer_read[i]); + printf("Err:data read and write aren't matching.\n\r"); + return I2C_FAIL; + } + printf("0x%02X ", i2c_buffer_read[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + printf("I2C-AT24C02 test passed!\n\r"); + return I2C_OK; +} + +/*! + \brief initialize peripherals used by the I2C EEPROM driver + \param[in] none + \param[out] none + \retval none +*/ +void i2c_eeprom_init(void) +{ + eeprom_address = EEPROM_BLOCK0_ADDRESS; +} + +/*! + \brief write more than one byte to the EEPROM with a single write cycle + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write to + \param[in] number_of_byte: number of bytes to write to the EEPROM + \param[out] none + \retval none +*/ +uint8_t eeprom_page_write_dma_timeout(uint8_t *p_buffer, uint8_t write_address, uint8_t number_of_byte) +{ + dma_parameter_struct dma_init_struct; + + uint8_t state = I2C_START; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in WRITE!\n"); + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + timeout = 0; + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends start signal timeout in WRITE!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + /* address flag set means i2c slave sends ACK */ + while((! i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + state = I2C_TRANSMIT_DATA; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master clears address flag timeout in WRITE!\n"); + } + break; + case I2C_TRANSMIT_DATA: + /* wait until the transmit data buffer is empty */ + while((! i2c_flag_get(I2CX, I2C_FLAG_TBE)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, write_address); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends EEPROM's internal address timeout in WRITE!\n"); + } + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + dma_deinit(I2C_DMA, DMA_TX_CH); + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)p_buffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = number_of_byte; + dma_init_struct.periph_addr = (uint32_t)&I2C_DATA(I2CX); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(I2C_DMA, DMA_TX_CH, &dma_init_struct); + /* enable I2CX DMA */ + i2c_dma_config(I2CX, I2C_DMA_ON); + /* enable DMA0 channel5 */ + dma_channel_enable(I2C_DMA, DMA_TX_CH); + /* wait until BTC bit is set */ + while(!dma_flag_get(I2C_DMA, DMA_TX_CH, DMA_FLAG_FTF)); + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_STOP; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends data timeout in WRITE!\n"); + } + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_END; + i2c_timeout_flag = I2C_OK; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends stop signal timeout in WRITE!\n"); + } + break; + default: + state = I2C_START; + i2c_timeout_flag = I2C_OK; + timeout = 0; + printf("i2c master sends start signal in WRITE.\n"); + break; + } + } + return I2C_END; +} + +/*! + \brief write buffer of data to the EEPROM use timeout function + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write + \param[in] number_of_byte: number of bytes to write to the EEPROM + \param[out] none + \retval none +*/ +void eeprom_buffer_write_dma_timeout(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte) +{ + uint8_t number_of_page = 0, number_of_single = 0, address = 0, count = 0; + + address = write_address % I2C_PAGE_SIZE; + count = I2C_PAGE_SIZE - address; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + /* if write_address is I2C_PAGE_SIZE aligned */ + if(0 == address) { + while(number_of_page--) { + eeprom_page_write_dma_timeout(p_buffer, write_address, I2C_PAGE_SIZE); + eeprom_wait_standby_state_timeout(); + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE; + } + if(0 != number_of_single) { + eeprom_page_write_dma_timeout(p_buffer, write_address, number_of_single); + eeprom_wait_standby_state_timeout(); + } + } else { + /* if write_address is not I2C_PAGE_SIZE aligned */ + if(number_of_byte < count) { + eeprom_page_write_dma_timeout(p_buffer, write_address, number_of_byte); + eeprom_wait_standby_state_timeout(); + } else { + number_of_byte -= count; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + if(0 != count) { + eeprom_page_write_dma_timeout(p_buffer, write_address, count); + eeprom_wait_standby_state_timeout(); + write_address += count; + p_buffer += count; + } + /* write page */ + while(number_of_page--) { + eeprom_page_write_dma_timeout(p_buffer, write_address, I2C_PAGE_SIZE); + eeprom_wait_standby_state_timeout(); + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE; + } + /* write single */ + if(0 != number_of_single) { + eeprom_page_write_dma_timeout(p_buffer, write_address, number_of_single); + eeprom_wait_standby_state_timeout(); + } + } + } +} + +/*! + \brief read data from the EEPROM + \param[in] p_buffer: pointer to the buffer that receives the data read from the EEPROM + \param[in] read_address: EEPROM's internal address to start reading from + \param[in] number_of_byte: number of bytes to reads from the EEPROM + \param[out] none + \retval none +*/ +uint8_t eeprom_buffer_read_dma_timeout(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte) +{ + dma_parameter_struct dma_init_struct; + + uint8_t state = I2C_START; + uint8_t read_cycle = 0; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + if(RESET == read_cycle) { + /* disable I2CX */ + i2c_disable(I2CX); + /* enable I2CX */ + i2c_enable(I2CX); + + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the start signal */ + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in READ!\n"); + } + } else { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + if(RESET == read_cycle) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + i2c_master_addressing(I2CX, eeprom_address, I2C_RECEIVER); + state = I2C_CLEAR_ADDRESS_FLAG; + } + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends start signal timeout in READ!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + /* address flag set means i2c slave sends ACK */ + while((!i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + state = I2C_TRANSMIT_DATA; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master clears address flag timeout in READ!\n"); + } + break; + case I2C_TRANSMIT_DATA: + if(RESET == read_cycle) { + /* wait until the transmit data buffer is empty */ + while((! i2c_flag_get(I2CX, I2C_FLAG_TBE)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + /* send the EEPROM's internal address to write to : only one byte address */ + i2c_data_transmit(I2CX, read_address); + timeout = 0; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master wait data buffer is empty timeout in READ!\n"); + } + /* wait until BTC bit is set */ + while((!i2c_flag_get(I2CX, I2C_FLAG_BTC)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_START; + read_cycle++; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends EEPROM's internal address timeout in READ!\n"); + } + } else { + /* one byte master reception procedure (polling) */ + if(number_of_byte < 2) { + /* disable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + /* clear ADDSEND register by reading I2C_STAT0 then I2C_STAT1 register (I2C_STAT0 has already been read) */ + i2c_flag_get(I2CX, I2C_FLAG_ADDSEND); + /* send a stop condition to I2C bus*/ + i2c_stop_on_bus(I2CX); + /* wait for the byte to be received */ + while(!i2c_flag_get(I2CX, I2C_FLAG_RBNE)); + /* read the byte received from the EEPROM */ + *p_buffer = i2c_data_receive(I2CX); + /* decrement the read bytes counter */ + number_of_byte--; + timeout = 0; + state = I2C_STOP; + } else { /* more than one byte master reception procedure (DMA) */ + dma_deinit(I2C_DMA, DMA_RX_CH); + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)p_buffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = number_of_byte; + dma_init_struct.periph_addr = (uint32_t)&I2C_DATA(I2CX); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(I2C_DMA, DMA_RX_CH, &dma_init_struct); + + i2c_dma_last_transfer_config(I2CX, I2C_DMALST_ON); + /* enable I2CX DMA */ + i2c_dma_config(I2CX, I2C_DMA_ON); + /* enable DMA0 channel5 */ + dma_channel_enable(I2C_DMA, DMA_RX_CH); + /* wait until BTC bit is set */ + while(!dma_flag_get(I2C_DMA, DMA_RX_CH, DMA_FLAG_FTF)); + state = I2C_STOP; + } + } + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_END; + i2c_timeout_flag = I2C_OK; + } else { + timeout = 0; + state = I2C_START; + read_cycle = 0; + printf("i2c master sends stop signal timeout in READ!\n"); + } + break; + default: + state = I2C_START; + read_cycle = 0; + i2c_timeout_flag = I2C_OK; + timeout = 0; + printf("i2c master sends start signal in READ.\n"); + break; + } + } + return I2C_END; +} + +/*! + \brief wait for EEPROM standby state use timeout function + \param[in] none + \param[out] none + \retval none +*/ +uint8_t eeprom_wait_standby_state_timeout(void) +{ + uint8_t state = I2C_START; + uint16_t timeout = 0; + uint8_t i2c_timeout_flag = 0; + + while(!(i2c_timeout_flag)) { + switch(state) { + case I2C_START: + /* i2c master sends start signal only when the bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_start_on_bus(I2CX); + timeout = 0; + state = I2C_SEND_ADDRESS; + } else { + i2c_bus_reset(); + timeout = 0; + state = I2C_START; + printf("i2c bus is busy in EEPROM standby!\n"); + } + break; + case I2C_SEND_ADDRESS: + /* i2c master sends START signal successfully */ + while((! i2c_flag_get(I2CX, I2C_FLAG_SBSEND)) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + timeout = 0; + state = I2C_CLEAR_ADDRESS_FLAG; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends start signal timeout in EEPROM standby!\n"); + } + break; + case I2C_CLEAR_ADDRESS_FLAG: + while((!((i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) || (i2c_flag_get(I2CX, I2C_FLAG_AERR)))) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + if(i2c_flag_get(I2CX, I2C_FLAG_ADDSEND)) { + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + timeout = 0; + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + i2c_timeout_flag = I2C_OK; + /* exit the function */ + return I2C_END; + + } else { + /* clear the bit of AE */ + i2c_flag_clear(I2CX, I2C_FLAG_AERR); + timeout = 0; + state = I2C_STOP; + } + } else { + timeout = 0; + state = I2C_START; + printf("i2c master clears address flag timeout in EEPROM standby!\n"); + } + break; + case I2C_STOP: + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* i2c master sends STOP signal successfully */ + while((I2C_CTL0(I2CX) & I2C_CTL0_STOP) && (timeout < I2C_TIME_OUT)) { + timeout++; + } + if(timeout < I2C_TIME_OUT) { + timeout = 0; + state = I2C_START; + } else { + timeout = 0; + state = I2C_START; + printf("i2c master sends stop signal timeout in EEPROM standby!\n"); + } + break; + default: + state = I2C_START; + timeout = 0; + printf("i2c master sends start signal end in EEPROM standby!.\n"); + break; + } + } + return I2C_END; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.h new file mode 100644 index 0000000..c8b7c7d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/at24cxx.h @@ -0,0 +1,68 @@ +/*! + \file at24cxx.h + \brief the header file of AT24Cxx + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef AT24CXX_H +#define AT24CXX_H + +#include "gd32f10x.h" + +typedef enum { + I2C_START = 0, + I2C_SEND_ADDRESS, + I2C_CLEAR_ADDRESS_FLAG, + I2C_TRANSMIT_DATA, + I2C_STOP, +} i2c_process_enum; + +#define I2C_TIME_OUT (uint16_t)(5000) +#define EEP_FIRST_PAGE 0x00 + +#define I2C_OK 1 +#define I2C_FAIL 0 +#define I2C_END 1 + +/* I2C read and write functions */ +uint8_t i2c_24c02_test(void); +/* initialize EEPROM address */ +void i2c_eeprom_init(void); +/* write more than one byte to the EEPROM use timeout function */ +uint8_t eeprom_page_write_dma_timeout(uint8_t *p_buffer, uint8_t write_address, uint8_t number_of_byte); +/* write buffer of data to the EEPROM use timeout function */ +void eeprom_buffer_write_dma_timeout(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte); +/* read data from the EEPROM use timeout function */ +uint8_t eeprom_buffer_read_dma_timeout(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte); +/* wait for EEPROM standby state use timeout function */ +uint8_t eeprom_wait_standby_state_timeout(void); + +#endif /* AT24CXX_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.c new file mode 100644 index 0000000..7cf5fd8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.h new file mode 100644 index 0000000..b692559 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..c6de971 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.c new file mode 100644 index 0000000..af3afca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.c @@ -0,0 +1,111 @@ +/*! + \file i2c.c + \brief I2C configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "i2c.h" +#include +#include "systick.h" + +/*! + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIO_I2C); + + /* connect I2C_SCL_PIN to I2C_SCL */ + /* connect I2C_SDA_PIN to I2C_SDA */ + gpio_init(I2C_SCL_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); +} + +/*! + \brief configure the I2C interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* enable I2C clock */ + rcu_periph_clock_enable(RCU_I2C); + /* configure I2C clock */ + i2c_clock_config(I2CX, I2C_SPEED, I2C_DTCY_2); + /* configure I2C address */ + i2c_mode_addr_config(I2CX, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2CX_SLAVE_ADDRESS7); + /* enable I2CX */ + i2c_enable(I2CX); + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); +} + +/*! + \brief reset i2c bus + \param[in] none + \param[out] none + \retval none +*/ +void i2c_bus_reset() +{ + i2c_deinit(I2CX); + /* configure SDA/SCL for GPIO */ + GPIO_BC(I2C_SCL_PORT) |= I2C_SCL_PIN; + GPIO_BC(I2C_SDA_PORT) |= I2C_SDA_PIN; + gpio_init(I2C_SCL_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + GPIO_BOP(I2C_SCL_PORT) |= I2C_SCL_PIN; + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + GPIO_BOP(I2C_SDA_PORT) |= I2C_SDA_PIN; + /* connect I2C_SCL_PIN to I2C_SCL */ + /* connect I2C_SDA_PIN to I2C_SDA */ + gpio_init(I2C_SCL_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); + /* configure the I2CX interface */ + i2c_config(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.h new file mode 100644 index 0000000..4bc4eec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/i2c.h @@ -0,0 +1,61 @@ +/*! + \file i2c.h + \brief the header file of I2C + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef I2C_H +#define I2C_H + +#include "gd32f10x.h" + +#define I2CX_SLAVE_ADDRESS7 0xA0 +#define I2C_SPEED 100000 +#define I2C_PAGE_SIZE 8 +#define I2CX I2C0 +#define RCU_GPIO_I2C RCU_GPIOB +#define RCU_I2C RCU_I2C0 +#define I2C_SCL_PORT GPIOB +#define I2C_SDA_PORT GPIOB +#define I2C_SCL_PIN GPIO_PIN_6 +#define I2C_SDA_PIN GPIO_PIN_7 +#define I2C_DMA DMA0 +#define DMA_TX_CH DMA_CH5 +#define DMA_RX_CH DMA_CH6 + +/* configure the GPIO ports */ +void gpio_config(void); +/* configure the I2C interfaces */ +void i2c_config(void); +/* reset i2c bus */ +void i2c_bus_reset(void); + +#endif /* I2C_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/main.c new file mode 100644 index 0000000..9442c74 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/main.c @@ -0,0 +1,160 @@ +/*! + \file main.c + \brief use the I2C bus to write and read EEPROM by DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "i2c.h" +#include "at24cxx.h" + +uint8_t count = 0; + +void led_turn_on(uint8_t led_number); +void led_config(void); + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + /* turn off LED2,LED3,LED4,LED5 */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + + /* configure LEDs */ + led_config(); + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + printf("I2C-24C02 configured....\n\r"); + + /* configure GPIO */ + gpio_config(); + + /* configure I2C */ + i2c_config(); + + /* initialize EEPROM */ + i2c_eeprom_init(); + + printf("\r\nThe I2C is hardware interface "); + printf("\r\nThe speed is %d", I2C_SPEED); + + if(I2C_OK == i2c_24c02_test()) { + while(1) { + /* turn off all LEDs */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + /* turn on a LED */ + led_turn_on(count % 4); + count++; + if(count >= 4) { + count = 0; + } + delay_1ms(500); + } + } + /* turn on all LEDs */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + + while(1) { + } +} + +/*! + \brief turn on a LED + \param[in] led_number + \param[out] none + \retval none +*/ +void led_turn_on(uint8_t led_number) +{ + switch(led_number) { + case 0: + gd_eval_led_on(LED2); + break; + case 1: + gd_eval_led_on(LED3); + break; + case 2: + gd_eval_led_on(LED4); + break; + case 3: + gd_eval_led_on(LED5); + break; + default: + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + break; + } +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/readme.txt new file mode 100644 index 0000000..19c6664 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of using the I2C bus to write and read EEPROM by DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, It describes a communication +method between I2C bus and EEPROM with timeout and bus release function. The +communication use DMA. The access result will be printed by COM0. + + Procedures sequentially writes 256 bytes of data to the EEPROM from the 0x00 +address, and then the program sequentially reads 256 bytes of data from the +EEPROM from the 0x00 address. Compare the written data and read data, if the +same,"I2C-AT24C02 test passed!" will be printed, while the board of the four +LED lights start flashing, otherwise "Err:data read and write aren't matching." +will be printed, while the four LEDs light will on. + + P4 should be fitted to I2C and JP5 must be fitted to the USART port. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.c new file mode 100644 index 0000000..b6dc0a8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while(1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay) { + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay) { + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.h new file mode 100644 index 0000000..e4ea787 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_dma/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.c new file mode 100644 index 0000000..4ab31ed --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.c @@ -0,0 +1,298 @@ +/*! + \file at24cxx.c + \brief the read and write function file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "at24cxx.h" +#include "i2c.h" +#include + +#define EEPROM_BLOCK0_ADDRESS 0xA0 +#define BUFFER_SIZE 256 +uint16_t eeprom_address; +uint8_t i2c_buffer_write[BUFFER_SIZE]; +uint8_t i2c_buffer_read[BUFFER_SIZE]; +volatile uint8_t *i2c_write; +volatile uint8_t *i2c_read; +volatile uint16_t i2c_nbytes; +volatile uint16_t i2c_write_dress; +volatile uint16_t i2c_read_dress; +volatile uint8_t i2c_process_flag = 0; + + +/*! + \brief I2C read and write functions + \param[in] none + \param[out] none + \retval I2C_OK or I2C_FAIL +*/ +uint8_t i2c_24c02_test(void) +{ + uint16_t i; + + printf("\r\nAT24C02 writing...\r\n"); + + /* initialize i2c_buffer_write */ + for(i = 0; i < BUFFER_SIZE; i++) { + i2c_buffer_write[i] = i; + printf("0x%02X ", i2c_buffer_write[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + /* EEPROM data write */ + eeprom_buffer_write_interrupt(i2c_buffer_write, EEP_FIRST_PAGE, BUFFER_SIZE); + printf("AT24C02 reading...\r\n"); + /* EEPROM data read */ + eeprom_buffer_read_interrupt(i2c_buffer_read, EEP_FIRST_PAGE, BUFFER_SIZE); + /* compare the read buffer and write buffer */ + for(i = 0; i < BUFFER_SIZE; i++) { + if(i2c_buffer_read[i] != i2c_buffer_write[i]) { + printf("0x%02X ", i2c_buffer_read[i]); + printf("Err:data read and write aren't matching.\n\r"); + return I2C_FAIL; + } + printf("0x%02X ", i2c_buffer_read[i]); + if(15 == i % 16) { + printf("\r\n"); + } + } + printf("I2C-AT24C02 test passed!\n\r"); + return I2C_OK; +} + +/*! + \brief initialize peripherals used by the I2C EEPROM driver + \param[in] none + \param[out] none + \retval none +*/ +void i2c_eeprom_init() +{ + eeprom_address = EEPROM_BLOCK0_ADDRESS; +} + +/*! + \brief write buffer of data to the I2C EEPROM + \param[in] p_buffer: pointer to the buffer containing the data to be written to the EEPROM + \param[in] write_address: EEPROM's internal address to write to + \param[in] number_of_byte: number of bytes to write to the EEPROM + \param[out] none + \retval none +*/ +void eeprom_buffer_write_interrupt(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte) +{ + uint8_t number_of_page = 0, number_of_single = 0, address = 0, count = 0; + + address = write_address % I2C_PAGE_SIZE; + count = I2C_PAGE_SIZE - address; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + i2c_process_flag = 0; + /* if write_address is I2C_PAGE_SIZE aligned */ + if(0 == address) { + while(number_of_page--) { + i2c_nbytes = I2C_PAGE_SIZE; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE; + } + if(0 != number_of_single) { + i2c_nbytes = number_of_single; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + } + } else { + /* if write_address is not I2C_PAGE_SIZE aligned */ + if(number_of_byte < count) { + i2c_nbytes = number_of_byte; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + + } else { + number_of_byte -= count; + number_of_page = number_of_byte / I2C_PAGE_SIZE; + number_of_single = number_of_byte % I2C_PAGE_SIZE; + + if(0 != count) { + i2c_nbytes = count; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + + write_address += count; + p_buffer += count; + } + /* write page */ + while(number_of_page--) { + i2c_nbytes = number_of_page; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + + write_address += I2C_PAGE_SIZE; + p_buffer += I2C_PAGE_SIZE;; + } + /* write single */ + if(0 != number_of_single) { + i2c_nbytes = number_of_page; + i2c_write_dress = write_address; + i2c_write = p_buffer; + /* write data by interrupt */ + eeprom_page_write_interrupt(); + eeprom_wait_standby_state(); + } + } + } + i2c_process_flag = SET; +} + +/*! + \brief write more than one byte to the EEPROM by interrupt + \param[in] none + \param[out] none + \retval none +*/ +void eeprom_page_write_interrupt() +{ + i2c_process_flag = 0; + /* enable the I2CX interrupt */ + i2c_interrupt_enable(I2CX, I2C_INT_ERR); + i2c_interrupt_enable(I2CX, I2C_INT_EV); + i2c_interrupt_enable(I2CX, I2C_INT_BUF); + /* the master waits until the I2C bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY)); + /* the master sends a start condition to I2C bus */ + i2c_start_on_bus(I2CX); + while((i2c_nbytes > 0)); +} + +/*! + \brief read data from the EEPROM by interrupt + \param[in] p_buffer: pointer to the buffer that receives the data read from the EEPROM + \param[in] read_address: EEPROM's internal address to start reading from + \param[in] number_of_byte: number of bytes to reads from the EEPROM + \param[out] none + \retval none +*/ +void eeprom_buffer_read_interrupt(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte) +{ + i2c_read = p_buffer; + i2c_read_dress = read_address; + i2c_nbytes = number_of_byte; + + i2c_process_flag = SET; + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); + /* enable the I2CX interrupt */ + i2c_interrupt_enable(I2CX, I2C_INT_ERR); + i2c_interrupt_enable(I2CX, I2C_INT_EV); + i2c_interrupt_enable(I2CX, I2C_INT_BUF); + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY)); + if(2 == number_of_byte) { + i2c_ackpos_config(I2CX, I2C_ACKPOS_NEXT); + } + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2CX); + while((i2c_nbytes > 0)); +} + +/*! + \brief wait for EEPROM standby state + \param[in] none + \param[out] none + \retval none +*/ +void eeprom_wait_standby_state(void) +{ + __IO uint32_t val = 0; + + while(1) { + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2CX, I2C_FLAG_I2CBSY)); + + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2CX); + + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_SBSEND)); + + /* send slave address to I2C bus */ + i2c_master_addressing(I2CX, eeprom_address, I2C_TRANSMITTER); + + /* keep looping till the Address is acknowledged or the AE flag is set (address not acknowledged at time) */ + do { + /* get the current value of the I2C_STAT0 register */ + val = I2C_STAT0(I2CX); + + } while(0 == (val & (I2C_STAT0_ADDSEND | I2C_STAT0_AERR))); + + /* check if the ADDSEND flag has been set */ + if(val & I2C_STAT0_ADDSEND) { + + /* clear ADDSEND flag */ + i2c_flag_clear(I2CX, I2C_FLAG_ADDSEND); + + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + + /* exit the function */ + return ; + + } else { + /* clear the bit of AE */ + i2c_flag_clear(I2CX, I2C_FLAG_AERR); + } + + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* wait until the stop condition is finished */ + while(I2C_CTL0(I2CX) & I2C_CTL0_STOP); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.h new file mode 100644 index 0000000..3decdd7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/at24cxx.h @@ -0,0 +1,58 @@ +/*! + \file at24cxx.h + \brief the header file of AT24Cxx + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef AT24CXX_H +#define AT24CXX_H + +#include "gd32f10x.h" + +#define EEP_FIRST_PAGE 0x00 + +#define I2C_OK 0 +#define I2C_FAIL 1 + +/* I2C read and write functions */ +uint8_t i2c_24c02_test(void); +/* initialize EEPROM address */ +void i2c_eeprom_init(void); +/* write buffer of data to the EEPROM */ +void eeprom_buffer_write_interrupt(uint8_t *p_buffer, uint8_t write_address, uint16_t number_of_byte); +/* write more than one byte to the EEPROM by interrupt*/ +void eeprom_page_write_interrupt(void); +/* read data from the EEPROM by interrupt*/ +void eeprom_buffer_read_interrupt(uint8_t *p_buffer, uint8_t read_address, uint16_t number_of_byte); +/* wait for EEPROM standby state */ +void eeprom_wait_standby_state(void); + +#endif /* AT24CXX_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.c new file mode 100644 index 0000000..712ba64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.c @@ -0,0 +1,175 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "i2c.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief I2C0 event handle function + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_EV_IRQHandler(void) +{ + i2cx_event_irq_handler(); +} + +/*! + \brief I2C0 error handle function + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_ER_IRQHandler(void) +{ + i2cx_error_irq_handler(); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.h new file mode 100644 index 0000000..720ff1c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_it.h @@ -0,0 +1,64 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* I2C0 event handle function */ +void I2C0_EV_IRQHandler(void); +/* I2C0 error handle function */ +void I2C0_ER_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_libopt.h new file mode 100644 index 0000000..c6de971 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.c new file mode 100644 index 0000000..9c2f398 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.c @@ -0,0 +1,261 @@ +/*! + \file i2c.c + \brief I2C configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "i2c.h" +#include +#include "systick.h" + +uint8_t i2c_read_process = 0; +uint8_t i2c_write_process = 0; + +/*! + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIO_I2C); + + /* connect I2C_SCL_PIN to I2C_SCL */ + /* connect I2C_SDA_PIN to I2C_SDA */ + gpio_init(I2C_SCL_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SCL_PIN); + gpio_init(I2C_SDA_PORT, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, I2C_SDA_PIN); +} + +/*! + \brief configure the I2C0 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* enable I2C clock */ + rcu_periph_clock_enable(RCU_I2C); + /* configure I2C clock */ + i2c_clock_config(I2CX, I2C_SPEED, I2C_DTCY_2); + /* configure I2C address */ + i2c_mode_addr_config(I2CX, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2CX_SLAVE_ADDRESS7); + /* enable I2CX */ + i2c_enable(I2CX); + /* enable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_ENABLE); +} + +/*! + \brief handle I2C0 event interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void i2cx_event_irq_handler(void) +{ + if(RESET == i2c_process_flag) { + switch(i2c_write_process) { + case I2C_SEND_ADDRESS_FIRST: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_SBSEND)) { + /* send slave address */ + i2c_master_addressing(I2CX, I2CX_SLAVE_ADDRESS7, I2C_TRANSMITTER); + i2c_write_process = I2C_CLEAR_ADDRESS_FLAG_FIRST; + } + break; + case I2C_CLEAR_ADDRESS_FLAG_FIRST: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_ADDSEND)) { + /*clear ADDSEND bit */ + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_ADDSEND); + i2c_write_process = I2C_TRANSMIT_WRITE_READ_ADD; + } + break; + case I2C_TRANSMIT_WRITE_READ_ADD: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_TBE)) { + i2c_data_transmit(I2CX, i2c_write_dress); + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + i2c_write_process = I2C_TRANSMIT_DATA; + } + break; + case I2C_TRANSMIT_DATA: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_TBE)) { + /* the master sends a data byte */ + i2c_data_transmit(I2CX, *i2c_write++); + i2c_nbytes--; + if(RESET == i2c_nbytes) { + i2c_write_process = I2C_STOP; + } + } + break; + case I2C_STOP: + /* the master sends a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* disable the I2CX interrupt */ + i2c_interrupt_disable(I2CX, I2C_INT_ERR); + i2c_interrupt_disable(I2CX, I2C_INT_BUF); + i2c_interrupt_disable(I2CX, I2C_INT_EV); + i2c_write_process = I2C_SEND_ADDRESS_FIRST; + break; + default: + break; + } + } else if(SET == i2c_process_flag) { + switch(i2c_read_process) { + case I2C_SEND_ADDRESS_FIRST: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_SBSEND)) { + /* send slave address */ + i2c_master_addressing(I2CX, I2CX_SLAVE_ADDRESS7, I2C_TRANSMITTER); + i2c_read_process = I2C_CLEAR_ADDRESS_FLAG_FIRST; + } + break; + case I2C_CLEAR_ADDRESS_FLAG_FIRST: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_ADDSEND)) { + /*clear ADDSEND bit */ + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_ADDSEND); + i2c_read_process = I2C_TRANSMIT_WRITE_READ_ADD; + } + break; + case I2C_TRANSMIT_WRITE_READ_ADD: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_TBE)) { + i2c_data_transmit(I2CX, i2c_read_dress); + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2CX); + i2c_read_process = I2C_SEND_ADDRESS_SECOND; + } + break; + case I2C_SEND_ADDRESS_SECOND: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_SBSEND)) { + i2c_master_addressing(I2CX, I2CX_SLAVE_ADDRESS7, I2C_RECEIVER); + if(i2c_nbytes < 3) { + /* disable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + } + i2c_read_process = I2C_CLEAR_ADDRESS_FLAG_SECOND; + } + break; + case I2C_CLEAR_ADDRESS_FLAG_SECOND: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_ADDSEND)) { + /*clear ADDSEND bit */ + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_ADDSEND); + if((1 == i2c_nbytes) || (2 == i2c_nbytes)) { + /* clear the ACKEN before the ADDSEND is cleared */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + } + i2c_read_process = I2C_TRANSMIT_DATA; + } + break; + case I2C_TRANSMIT_DATA: + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_RBNE)) { + if(i2c_nbytes > 0) { + if(i2c_nbytes == 3) { + /* wait until BTC bit is set */ + while(!i2c_flag_get(I2CX, I2C_FLAG_BTC)); + /* disable acknowledge */ + i2c_ack_config(I2CX, I2C_ACK_DISABLE); + } + /* read a byte from the EEPROM */ + *i2c_read = i2c_data_receive(I2CX); + i2c_read++; + i2c_nbytes--; + if(i2c_nbytes == 0) { + i2c_read_process = I2C_SEND_ADDRESS_FIRST; + /* the master sends a stop condition to I2C bus */ + i2c_stop_on_bus(I2CX); + /* disable the I2CX interrupt */ + i2c_interrupt_disable(I2CX, I2C_INT_ERR); + i2c_interrupt_disable(I2CX, I2C_INT_BUF); + i2c_interrupt_disable(I2CX, I2C_INT_EV); + i2c_process_flag = RESET; + } + } + } + break; + default: + break; + } + } +} + +/*! + \brief handle I2CX error interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void i2cx_error_irq_handler(void) +{ + /* no acknowledge received */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_AERR)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_AERR); + } + + /* SMBus alert */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_SMBALT)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_SMBALT); + } + + /* bus timeout in SMBus mode */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_SMBTO)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_SMBTO); + } + + /* over-run or under-run when SCL stretch is disabled */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_OUERR)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_OUERR); + } + + /* arbitration lost */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_LOSTARB)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_LOSTARB); + } + + /* bus error */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_BERR)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_BERR); + } + + /* CRC value doesn't match */ + if(i2c_interrupt_flag_get(I2CX, I2C_INT_FLAG_PECERR)) { + i2c_interrupt_flag_clear(I2CX, I2C_INT_FLAG_PECERR); + } + + /* disable the error interrupt */ + i2c_interrupt_disable(I2CX, I2C_INT_ERR); + i2c_interrupt_disable(I2CX, I2C_INT_BUF); + i2c_interrupt_disable(I2CX, I2C_INT_EV); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.h new file mode 100644 index 0000000..04ad6a8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/i2c.h @@ -0,0 +1,77 @@ +/*! + \file i2c.h + \brief the header file of I2C + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef I2C_H +#define I2C_H + +#include "gd32f10x.h" + +#define I2CX_SLAVE_ADDRESS7 0xA0 +#define I2C_SPEED 100000 +#define I2C_PAGE_SIZE 8 +#define I2CX I2C0 +#define RCU_GPIO_I2C RCU_GPIOB +#define RCU_I2C RCU_I2C0 +#define I2C_SCL_PORT GPIOB +#define I2C_SDA_PORT GPIOB +#define I2C_SCL_PIN GPIO_PIN_6 +#define I2C_SDA_PIN GPIO_PIN_7 + +typedef enum { + I2C_SEND_ADDRESS_FIRST = 0, + I2C_CLEAR_ADDRESS_FLAG_FIRST, + I2C_TRANSMIT_WRITE_READ_ADD, + I2C_SEND_ADDRESS_SECOND, + I2C_CLEAR_ADDRESS_FLAG_SECOND, + I2C_TRANSMIT_DATA, + I2C_STOP, +} i2c_process_enum; + +extern volatile uint8_t *i2c_write; +extern volatile uint8_t *i2c_read; +extern volatile uint16_t i2c_nbytes; +extern volatile uint16_t i2c_write_dress; +extern volatile uint16_t i2c_read_dress; +extern volatile uint8_t i2c_process_flag; + +/* configure the GPIO ports */ +void gpio_config(void); +/* configure the I2C0 interfaces */ +void i2c_config(void); +/* handle I2CX event interrupt request */ +void i2cx_event_irq_handler(void); +/* handle I2CX error interrupt request */ +void i2cx_error_irq_handler(void); + +#endif /* I2C_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/main.c new file mode 100644 index 0000000..da303fb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/main.c @@ -0,0 +1,176 @@ +/*! + \file main.c + \brief use the I2C bus to write and read EEPROM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "i2c.h" +#include "at24cxx.h" + +uint8_t count = 0; + +void led_turn_on(uint8_t led_number); +void led_config(void); +void i2c_nvic_config(void); + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + /* turn off LED2,LED3,LED4,LED5 */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + + /* configure LEDs */ + led_config(); + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + printf("I2C-24C02 configured....\n\r"); + /* cofigure the NVIC */ + i2c_nvic_config(); + + /* configure GPIO */ + gpio_config(); + + /* configure I2C */ + i2c_config(); + + /* initialize EEPROM */ + i2c_eeprom_init(); + + printf("\r\nThe I2C is hardware interface "); + printf("\r\nThe speed is %d", I2C_SPEED); + + if(I2C_OK == i2c_24c02_test()) { + while(1) { + /* turn off all LEDs */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + /* turn on a LED */ + led_turn_on(count % 4); + count++; + if(count >= 4) { + count = 0; + } + delay_1ms(500); + } + } + /* turn on all LEDs */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + + while(1) { + } +} + +/*! + \brief turn on a LED + \param[in] led_number + \param[out] none + \retval none +*/ +void led_turn_on(uint8_t led_number) +{ + switch(led_number) { + case 0: + gd_eval_led_on(LED2); + break; + case 1: + gd_eval_led_on(LED3); + break; + case 2: + gd_eval_led_on(LED4); + break; + case 3: + gd_eval_led_on(LED5); + break; + default: + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + break; + } +} + +/*! + \brief cofigure the NVIC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void i2c_nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(I2C0_EV_IRQn, 0, 2); + nvic_irq_enable(I2C0_ER_IRQn, 0, 1); +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/readme.txt new file mode 100644 index 0000000..6864c02 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of using the I2C bus to write and read EEPROM + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it provides a description +of how to use the I2C bus to write and read EEPROM by interrupt. The access result +will be printed by COM0. + + Procedures sequentially writes 256 bytes of data to the EEPROM from the 0x00 +address, and then the program sequentially reads 256 bytes of data from the +EEPROM from the 0x00 address. Compare the written data and read data, if the +same,"I2C-AT24C02 test passed!" will be printed, while the board of the four +LED lights start flashing, otherwise "Err:data read and write aren't matching." +will be printed, while the four LEDs light will on. + + P4 should be fitted to I2C and JP5 must be fitted to the USART port. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.c new file mode 100644 index 0000000..b6dc0a8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while(1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay) { + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay) { + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.h new file mode 100644 index 0000000..e4ea787 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/I2C_EEPROM_interrput/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/main.c new file mode 100644 index 0000000..1dc9a3e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/main.c @@ -0,0 +1,205 @@ +/*! + \file main.c + \brief master receiver and slave transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C1_SLAVE_ADDRESS7 0x72 + +uint8_t i2c_transmitter[16]; +uint8_t i2c_receiver[16]; +ErrStatus state = ERROR; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* initialize led */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + for(i = 0; i < 16; i++) { + i2c_transmitter[i] = i + 0x80; + } + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + /* send slave address to I2C bus */ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_RECEIVER); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C1, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C1, I2C_FLAG_ADDSEND); + + for(i = 0; i < 15; i++) { + /* send a data byte */ + i2c_data_transmit(I2C1, i2c_transmitter[i]); + /* wait until the transmission data register is empty */ + while(!i2c_flag_get(I2C1, I2C_FLAG_TBE)); + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + /* read a data from I2C_DATA */ + i2c_receiver[i] = i2c_data_receive(I2C0); + } + /* send a NACK for the last data byte */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + /* send a data byte */ + i2c_data_transmit(I2C1, i2c_transmitter[i]); + /* wait until the transmission data register is empty */ + while(!i2c_flag_get(I2C1, I2C_FLAG_TBE)); + /* the master doesn't acknowledge for the last byte */ + while(!i2c_flag_get(I2C1, I2C_FLAG_AERR)); + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2C0); + while(I2C_CTL0(I2C0) & 0x0200); + i2c_receiver[i] = i2c_data_receive(I2C0); + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + /* clear the bit of AE */ + i2c_flag_clear(I2C1, I2C_FLAG_AERR); + + /* compare the transmit buffer and the receive buffer */ + state = memory_compare(i2c_transmitter, i2c_receiver, 16); + /* if success, LED2 and LED3 are on */ + if(SUCCESS == state) { + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } else { + /* if failed, LED2 and LED3 are off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + while(1) { + } +} + +/*! + \brief memory compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C1 clock */ + rcu_periph_clock_enable(RCU_I2C1); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* I2C0 and I2C1 GPIO ports */ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + /* connect PB10 to I2C1_SCL */ + /* connect PB11 to I2C1_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_10 | GPIO_PIN_11); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + i2c_clock_config(I2C1, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C1_SLAVE_ADDRESS7); + /* enable I2C1 */ + i2c_enable(I2C1); + /* enable acknowledge */ + i2c_ack_config(I2C1, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/readme.txt new file mode 100644 index 0000000..1820008 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of the master receiver and slave transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming mode in +master receiving mode and slave transmitting mode. In this demo, I2C0 is operated as +master receiver, I2C1 is operated as slave and the SCL line and SDA line of I2C interface +are controled by the I/O pin PB10 and PB11(or PB6 and PB7) respectively. + + This demo shows the receiving data process of the master and the sending data process +of the slave. If transfer is sucessfully completed, LED2 and LED3 are on. + + We shoud use the jumper to connect the PB6 and PB10. The PB7 and PB11 are connected as well. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C0_IE.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C0_IE.c new file mode 100644 index 0000000..ff889a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C0_IE.c @@ -0,0 +1,132 @@ +/*! + \file I2C0_IE.c + \brief I2C0_MasterReceiver interrupt program + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_i2c.h" +#include "I2C_IE.h" + +uint32_t event1; + +/*! + \brief handle I2C0 event interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_EventIRQ_Handler(void) +{ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SBSEND)) { + /* the master sends slave address */ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_RECEIVER); + } else if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_ADDSEND)) { + if((1 == I2C_nBytes) || (2 == I2C_nBytes)) { + /* clear the ACKEN before the ADDSEND is cleared */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + /* clear the ADDSEND bit */ + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_ADDSEND); + } else { + /* clear the ADDSEND bit */ + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_ADDSEND); + } + } else if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_RBNE)) { + if(I2C_nBytes > 0) { + if(3 == I2C_nBytes) { + /* wait until the second last data byte is received into the shift register */ + while(!i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_BTC)); + /* send a NACK for the last data byte */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + } + /* read a data byte from I2C_DATA*/ + *i2c_rxbuffer++ = i2c_data_receive(I2C0); + I2C_nBytes--; + if(0 == I2C_nBytes) { + i2c_stop_on_bus(I2C0); + status = SUCCESS; + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + i2c_ackpos_config(I2C0, I2C_ACKPOS_CURRENT); + i2c_interrupt_disable(I2C0, I2C_INT_ERR); + i2c_interrupt_disable(I2C0, I2C_INT_BUF); + i2c_interrupt_disable(I2C0, I2C_INT_EV); + } + } + } +} + +/*! + \brief handle I2C0 error interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_ErrorIRQ_Handler(void) +{ + /* no acknowledge received */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_AERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_AERR); + } + + /* SMBus alert */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SMBALT)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_SMBALT); + } + + /* bus timeout in SMBus mode */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SMBTO)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_SMBTO); + } + + /* over-run or under-run when SCL stretch is disabled */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_OUERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_OUERR); + } + + /* arbitration lost */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_LOSTARB)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_LOSTARB); + } + + /* bus error */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_BERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_BERR); + } + + /* CRC value doesn't match */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_PECERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_PECERR); + } + + /* disable the error interrupt */ + i2c_interrupt_disable(I2C0, I2C_INT_ERR); + i2c_interrupt_disable(I2C0, I2C_INT_BUF); + i2c_interrupt_disable(I2C0, I2C_INT_EV); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C1_IE.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C1_IE.c new file mode 100644 index 0000000..68d99bc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C1_IE.c @@ -0,0 +1,104 @@ +/*! + \file I2C1_IE.c + \brief I2C1_SlaveTransmitter interrupt program + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_i2c.h" +#include "I2C_IE.h" + +uint32_t event2; + +/*! + \brief handle I2C1 event interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_EventIRQ_Handler(void) +{ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_ADDSEND)) { + /* clear the ADDSEND bit */ + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_ADDSEND); + } else if((i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_TBE)) && (!i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_AERR))) { + /* send a data byte */ + i2c_data_transmit(I2C1, *i2c_txbuffer++); + } +} + +/*! + \brief handle I2C1 error interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_ErrorIRQ_Handler(void) +{ + /* no acknowledge received */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_AERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_AERR); + } + + /* SMBus alert */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_SMBALT)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_SMBALT); + } + + /* bus timeout in SMBus mode */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_SMBTO)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_SMBTO); + } + + /* over-run or under-run when SCL stretch is disabled */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_OUERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_OUERR); + } + + /* arbitration lost */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_LOSTARB)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_LOSTARB); + } + + /* bus error */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_BERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_BERR); + } + + /* CRC value doesn't match */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_PECERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_PECERR); + } + + /* disable the error interrupt */ + i2c_interrupt_disable(I2C1, I2C_INT_ERR); + i2c_interrupt_disable(I2C1, I2C_INT_BUF); + i2c_interrupt_disable(I2C1, I2C_INT_EV); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C_IE.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C_IE.h new file mode 100644 index 0000000..779d23a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/I2C_IE.h @@ -0,0 +1,58 @@ +/*! + \file I2C_IE.h + \brief The header file of I2C0 and I2C1 interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef I2C_IE_H +#define I2C_IE_H + +#include "gd32f10x.h" + +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C1_SLAVE_ADDRESS7 0x72 + +extern volatile ErrStatus status; +extern volatile uint8_t *i2c_txbuffer; +extern volatile uint8_t *i2c_rxbuffer; +extern volatile uint16_t I2C_nBytes; + +/* function declarations */ +/* handle I2C0 event interrupt request */ +void I2C0_EventIRQ_Handler(void); +/* handle I2C0 error interrupt request */ +void I2C0_ErrorIRQ_Handler(void); +/* handle I2C1 event interrupt request */ +void I2C1_EventIRQ_Handler(void); +/* handle I2C1 error interrupt request */ +void I2C1_ErrorIRQ_Handler(void); + +#endif /* I2C_IE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..7013b61 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.c @@ -0,0 +1,184 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "I2C_IE.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles I2C0 event interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_EV_IRQHandler(void) +{ + I2C0_EventIRQ_Handler(); +} + +/*! + \brief this function handles I2C0 error interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_ER_IRQHandler(void) +{ + I2C0_ErrorIRQ_Handler(); +} + +/*! + \brief this function handles I2C1 event interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_EV_IRQHandler(void) +{ + I2C1_EventIRQ_Handler(); +} + +/*! + \brief this function handles I2C1 error interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_ER_IRQHandler(void) +{ + I2C1_ErrorIRQ_Handler(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..cfde6af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_it.h @@ -0,0 +1,66 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* I2C0 event handle function */ +void I2C0_EV_IRQHandler(void); +/* I2C0 error handle function */ +void I2C0_ER_IRQHandler(void); +/* I2C1 event handle function */ +void I2C1_EV_IRQHandler(void); +/* I2C1 error handle function */ +void I2C1_ER_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/main.c new file mode 100644 index 0000000..aaf85b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/main.c @@ -0,0 +1,204 @@ +/*! + \file main.c + \brief master receiver and slave transmitter interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "I2C_IE.h" + +uint8_t i2c_buffer_transmitter[16]; +uint8_t i2c_buffer_receiver[16]; + +volatile uint8_t *i2c_txbuffer; +volatile uint8_t *i2c_rxbuffer; +volatile uint16_t I2C_nBytes; +volatile ErrStatus status; +ErrStatus state = ERROR; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); +void i2c_nvic_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* initialize LED2, LED3, as the transfer instruction */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + rcu_config(); + gpio_config(); + i2c_config(); + i2c_nvic_config(); + + for(i = 0; i < 16; i++) { + i2c_buffer_transmitter[i] = i + 0x80; + } + /* initialize i2c_txbuffer, i2c_rxbuffer, I2C_nBytes and status */ + i2c_txbuffer = i2c_buffer_transmitter; + i2c_rxbuffer = i2c_buffer_receiver; + I2C_nBytes = 16; + status = ERROR; + + /* enable the I2C0 interrupt */ + i2c_interrupt_enable(I2C0, I2C_INT_ERR); + i2c_interrupt_enable(I2C0, I2C_INT_EV); + i2c_interrupt_enable(I2C0, I2C_INT_BUF); + /* enable the I2C1 interrupt */ + i2c_interrupt_enable(I2C1, I2C_INT_ERR); + i2c_interrupt_enable(I2C1, I2C_INT_EV); + i2c_interrupt_enable(I2C1, I2C_INT_BUF); + if(2 == I2C_nBytes) { + /* send ACK for the next byte */ + i2c_ackpos_config(I2C0, I2C_ACKPOS_NEXT); + } + /* the master waits until the I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* the master sends a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + + while(I2C_nBytes > 0); + while(SUCCESS != status); + /* if the transfer is successfully completed, LED2 and LED3 is on */ + state = memory_compare(i2c_buffer_transmitter, i2c_buffer_receiver, 16); + if(SUCCESS == state) { + /* if success, LED2 and LED3 are on */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } else { + /* if failed, LED2 and LED3 are off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + while(1) { + } +} + +/*! + \brief memory compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C1 clock */ + rcu_periph_clock_enable(RCU_I2C1); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* I2C0 and I2C1 GPIO ports */ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + /* connect PB10 to I2C1_SCL */ + /* connect PB11 to I2C1_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_10 | GPIO_PIN_11); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + i2c_clock_config(I2C1, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C1_SLAVE_ADDRESS7); + /* enable I2C1 */ + i2c_enable(I2C1); + /* enable acknowledge */ + i2c_ack_config(I2C1, I2C_ACK_ENABLE); +} + +/*! + \brief cofigure the NVIC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void i2c_nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(I2C0_EV_IRQn, 0, 3); + nvic_irq_enable(I2C1_EV_IRQn, 0, 4); + nvic_irq_enable(I2C0_ER_IRQn, 0, 2); + nvic_irq_enable(I2C1_ER_IRQn, 0, 1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/readme.txt new file mode 100644 index 0000000..2da4477 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver&slave_transmitter_interrupt/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of the master receiver and slave transmitter interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to use the I2C +interrupt programming mode in master receiving mode or slave transmitting mode. +In this demo, I2C0 is operated as the master receiver and I2C1 as the slave +transmitter. Moreover,the SCL line and SDA line of I2C0 interface are controled +by the I/O pin PB6 and PB7 respectively. The SCL and SDA of I2C1 are controled +by the pin PB10 and PB11 respectively. + + This demo will send the data of i2c_buffer_transmitter array through I2C1 interface +to the I2C0, and it will store the data received by I2C0 in the i2c_buffer_receiver +array. If transfer is sucessfully completed, LED2 and LED3 are on. + + We shoud use the jumper to connect the PB6 and PB10. The PB7 and PB11 are +connected as well. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/main.c new file mode 100644 index 0000000..1370cf8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/main.c @@ -0,0 +1,188 @@ +/*! + \file main.c + \brief master receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define I2C_10BIT_ADDRESS 0 + +#define I2C0_OWN_ADDRESS7 0x72 +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C0_SLAVE_ADDRESS10 0x0322 + +uint8_t i2c_receiver[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; +#if I2C_10BIT_ADDRESS + uint8_t slave10_first_byte, slave10_second_byte; +#endif + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + printf("\r\n I2C Start"); + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + +#if I2C_10BIT_ADDRESS + slave10_first_byte = (0xF0) | (uint8_t)((I2C0_SLAVE_ADDRESS10 & 0x0300) >> 7); + /* send slave address first byte to I2C bus */ + i2c_master_addressing(I2C0, slave10_first_byte, I2C_TRANSMITTER); + /* wait until ADD10SEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADD10SEND)); + /* the second byte contains the remaining 8 bits of the 10-bit address */ + slave10_second_byte = (uint8_t)(I2C0_SLAVE_ADDRESS10 & 0x00FF); + /* send slave address 2nd byte to I2C bus */ + i2c_master_addressing(I2C0, slave10_second_byte, I2C_TRANSMITTER); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + /* send slave address first byte to I2C bus */ + i2c_master_addressing(I2C0, slave10_first_byte, I2C_RECEIVER); +#else + /* send slave address to I2C bus */ + i2c_master_addressing(I2C0, I2C0_SLAVE_ADDRESS7, I2C_RECEIVER); +#endif + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + + for(i = 0; i < 16; i++) { + if(13 == i) { + /* wait until the second last data byte is received into the shift register */ + while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)); + /* disable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + } + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + /* read a data from I2C_DATA */ + i2c_receiver[i] = i2c_data_receive(I2C0); + } + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2C0); + /* wait until stop condition generate */ + while(I2C_CTL0(I2C0) & 0x0200); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + + printf("\r\n I2C SUCCESS"); + + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 400000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_OWN_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/readme.txt new file mode 100644 index 0000000..f9246c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of the master receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in master receiving mode. In this demo,I2C0 is operated as master receiver, +and the SCL line and SDA line of I2C0 interface are controled by the I/O pin +PB6 and PB7 respectively. + + This demo shows the receiving data process of the master. And it will store +the received data in the i2c_receiver array. + + This demo doesn't perform the data transfer actually, which is due to no +specific slave.In the specific application, we must send the correct slave +address, and the master and the slave may need to be connected by the jumper +if necessary. When the macro I2C_10BIT_ADDRESS is 1, I2C communicate in 10 bit +addressing mode, otherwise, I2C communicate in 7 bit addressing mode. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/main.c new file mode 100644 index 0000000..a84ac7b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/main.c @@ -0,0 +1,137 @@ +/*! + \file main.c + \brief master receiver one byte + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#define I2C0_SLAVE_ADDRESS7 0x72 +#define I2C1_SLAVE_ADDRESS7 0x82 + +uint8_t i2c_receiver[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + i = 0; + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + /* send slave address to I2C bus */ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_RECEIVER); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + + /* N=1,reset ACKEN bit before clearing ADDRSEND bit */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* N=1,send stop condition after clearing ADDRSEND bit */ + i2c_stop_on_bus(I2C0); + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + /* read a data from I2C_DATA */ + i2c_receiver[i++] = i2c_data_receive(I2C0); + /* wait until stop condition generate */ + while(I2C_CTL0(I2C0) & 0x0200); + /* Enable Acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/readme.txt new file mode 100644 index 0000000..21fb5cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_one_byte/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the master receiver one byte + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in master receiving mode which the master only want to receive one byte of +data. In this demo,I2C0 is operated as master receiver,and the SCL line and SDA +line of I2C0 interface are controled by the I/O pin PB6 and PB7 respectively. + + This demo shows the receiving one byte process of the master. And it will store +the received data in the i2c_receiver array. + + This demo doesn't perform the data transfer actually, which is due to no +specific slave.In the specific application, we must send the correct slave +address, and the master and the slave may need to be connected by the jumper +if necessary. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/main.c new file mode 100644 index 0000000..b07a261 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/main.c @@ -0,0 +1,146 @@ +/*! + \file main.c + \brief master receiver two bytes + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#define I2C0_OWN_ADDRESS7 0x72 +#define I2C0_SLAVE_ADDRESS7 0x82 + +uint8_t i2c_receiver[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + i = 0; + /* send a NACK for the next data byte which will be received into the shift register */ + i2c_ackpos_config(I2C0, I2C_ACKPOS_NEXT); + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + /* send slave address to I2C bus */ + i2c_master_addressing(I2C0, I2C0_SLAVE_ADDRESS7, I2C_RECEIVER); + /* disable ACK before clearing ADDSEND bit */ + i2c_ack_config(I2C0, I2C_ACK_DISABLE); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* Wait until the last data byte is received into the shift register */ + while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)); + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + + /* read a data from I2C_DATA */ + i2c_receiver[i++] = i2c_data_receive(I2C0); + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + /* read a data from I2C_DATA */ + i2c_receiver[i++] = i2c_data_receive(I2C0); + /* send a stop condition */ + i2c_stop_on_bus(I2C0); + /* wait until stop condition generate */ + while(I2C_CTL0(I2C0) & 0x0200); + i2c_ackpos_config(I2C0, I2C_ACKPOS_CURRENT); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_OWN_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/readme.txt new file mode 100644 index 0000000..25d5ae6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_receiver_two_bytes/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the master receiver two bytes + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in master receiving mode which the master only want to receive two bytes of +data. In this demo,I2C0 is operated as master receiver,and the SCL line and SDA +line of I2C0 interface are controled by the I/O pin PB6 and PB7 respectively. + + This demo shows the receiving two bytes process of the master. And it will store +the received data in the i2c_receiver array. + + This demo doesn't perform the data transfer actually, which is due to no +specific slave.In the specific application, we must send the correct slave +address, and the master and the slave may need to be connected by the jumper +if necessary. + + P4 must be fitted. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/main.c new file mode 100644 index 0000000..2e7ed58 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/main.c @@ -0,0 +1,191 @@ +/*! + \file main.c + \brief master transmitter slave receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C1_SLAVE_ADDRESS7 0x72 + +uint8_t i2c_transmitter[16]; +uint8_t i2c_receiver[16]; +ErrStatus state = ERROR; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + rcu_config(); + gpio_config(); + i2c_config(); + + for(i = 0; i < 16; i++) { + i2c_transmitter[i] = i + 0x80; + } + + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + + /* send slave address to I2C bus*/ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_TRANSMITTER); + + /* wait until ADDSEND bit is set*/ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + while(!i2c_flag_get(I2C1, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + i2c_flag_clear(I2C1, I2C_FLAG_ADDSEND); + for(i = 0; i < 16; i++) { + /* send a data byte */ + i2c_data_transmit(I2C0, i2c_transmitter[i]); + /* wait until the transmission data register is empty*/ + while(!i2c_flag_get(I2C0, I2C_FLAG_TBE)); + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C1, I2C_FLAG_RBNE)); + /* read a data from I2C_DATA */ + i2c_receiver[i] = i2c_data_receive(I2C1); + } + /* send a stop condition to I2C bus*/ + i2c_stop_on_bus(I2C0); + /* wait until stop condition generate */ + while(I2C_CTL0(I2C0) & 0x0200); + while(!i2c_flag_get(I2C1, I2C_FLAG_STPDET)); + /* clear the STPDET bit */ + i2c_enable(I2C0); + state = memory_compare(i2c_transmitter, i2c_receiver, 16); + if(SUCCESS == state) { + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + while(1) { + } +} + +/*! + \brief memory compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C1 clock */ + rcu_periph_clock_enable(RCU_I2C1); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports. + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* I2C0 and I2C1 GPIO ports */ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + /* connect PB10 to I2C1_SCL */ + /* connect PB11 to I2C1_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_10 | GPIO_PIN_11); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* configure I2C0 clock */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* configure I2C0 address */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + /* configure I2C1 clock */ + i2c_clock_config(I2C1, 100000, I2C_DTCY_2); + /* configure I2C1 address */ + i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C1_SLAVE_ADDRESS7); + /* enable I2C1 */ + i2c_enable(I2C1); + /* enable acknowledge */ + i2c_ack_config(I2C1, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/readme.txt new file mode 100644 index 0000000..f990991 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver/readme.txt @@ -0,0 +1,45 @@ +/*! + \file readme.txt + \brief description of the master transmitter and slave receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming mode in master +transmitter mode and slave receiving mode. In this demo,I2C0 is operated as master transmitter +,I2C1 is operated as slave receiver and the SCL line and SDA line of I2C interface are controled +by the I/O pin PB10 and PB11(or PB6 and PB7) respectively. + + This demo shows the sending data process of the master and the receiving data process of the slave. +If transfer is sucessfully completed, LED2 and LED3 is light. + + We shoud use the jumper to connect the PB6 and PB10. The PB7 and PB11 are connected as well. + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..ed398e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/main.c new file mode 100644 index 0000000..d6a30d5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/main.c @@ -0,0 +1,221 @@ +/*! + \file main.c + \brief master transmitter slave receiver through DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C1_SLAVE_ADDRESS7 0x72 +#define ARRAYNUM(arr_nanme) (uint32_t)(sizeof(arr_nanme) / sizeof(*(arr_nanme))) +#define I2C0_DATA_ADDRESS 0x40005410 +#define I2C1_DATA_ADDRESS 0x40005810 +#define BUFFER_SIZE (ARRAYNUM(i2c0_buff_tx)-1) + +uint8_t i2c0_buff_tx[] = "I2C DMA test"; +uint8_t i2c1_buff_rx[BUFFER_SIZE]; +__IO ErrStatus state = ERROR; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + dma_parameter_struct dma_init_struct; + + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + rcu_config(); + gpio_config(); + i2c_config(); + + /* initialize DMA channel4 */ + dma_deinit(DMA0, DMA_CH4); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)i2c1_buff_rx; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = BUFFER_SIZE; + dma_init_struct.periph_addr = I2C1_DATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + + /* initialize DMA channel5 */ + dma_deinit(DMA0, DMA_CH5); + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)i2c0_buff_tx; + dma_init_struct.periph_addr = I2C0_DATA_ADDRESS; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH5, &dma_init_struct); + + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + + /* send slave address to I2C bus*/ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_TRANSMITTER); + + /* wait until ADDSEND bit is set*/ + while(!i2c_flag_get(I2C1, I2C_FLAG_ADDSEND)); + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + i2c_flag_clear(I2C1, I2C_FLAG_ADDSEND); + + /* enable I2C1 DMA */ + i2c_dma_config(I2C1, I2C_DMA_ON); + /* enable I2C0 DMA */ + i2c_dma_config(I2C0, I2C_DMA_ON); + /* enable DMA0 channel4 */ + dma_channel_enable(DMA0, DMA_CH4); + /* enable DMA0 channel5 */ + dma_channel_enable(DMA0, DMA_CH5); + + /* DMA0 channel4 full transfer finish flag */ + while(!dma_flag_get(DMA0, DMA_CH4, DMA_FLAG_FTF)); + /* DMA0 channel5 full transfer finish flag */ + while(!dma_flag_get(DMA0, DMA_CH5, DMA_FLAG_FTF)); + + /* send a stop condition to I2C bus*/ + i2c_stop_on_bus(I2C0); + /* wait until stop condition generate */ + while(I2C_CTL0(I2C0) & 0x0200); + while(!i2c_flag_get(I2C1, I2C_FLAG_STPDET)); + /* clear the STPDET bit */ + i2c_enable(I2C1); + state = memory_compare(i2c0_buff_tx, i2c1_buff_rx, BUFFER_SIZE); + if(SUCCESS == state) { + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + while(1) { + } +} + +/*! + \brief memory compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C1 clock */ + rcu_periph_clock_enable(RCU_I2C1); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); +} + +/*! + \brief cofigure the GPIO ports. + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + /* connect PB10 to I2C1_SCL */ + /* connect PB11 to I2C1_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_10 | GPIO_PIN_11); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* configure I2C0 clock */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* configure I2C0 address */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + /* configure I2C1 clock */ + i2c_clock_config(I2C1, 100000, I2C_DTCY_2); + /* configure I2C1 address */ + i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C1_SLAVE_ADDRESS7); + /* enable I2C1 */ + i2c_enable(I2C1); + /* enable acknowledge */ + i2c_ack_config(I2C1, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/readme.txt new file mode 100644 index 0000000..60cc0cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_dma/readme.txt @@ -0,0 +1,46 @@ +/*! + \file main.c + \brief master transmitter slave receiver through DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32E103V-EVAL-V1.0 board, it shows how to use DMA channel5 to transimit data +from RAM memory to I2C0 data register and how to use DMA channel4 to receive data from I2C1 data register. + + In this demo, I2C0 is operated as master transmitter ,I2C1 is operated as slave receiver and the SCL +line and SDA line of I2C interface are controled by the I/O pin PB10 and PB11(or PB6 and PB7) respectively. +If transfer is sucessfully completed, LED2 and LED3 is light. + + We shoud use the jumper to connect the PB6 and PB10. The PB7 and PB11 are connected as well. + + P4 must be fitted. + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C0_IE.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C0_IE.c new file mode 100644 index 0000000..ba4e29b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C0_IE.c @@ -0,0 +1,117 @@ +/*! + \file I2C0_IE.c + \brief I2C0 master transmitter interrupt program + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_i2c.h" +#include "I2C_IE.h" + +uint32_t event1; + +/*! + \brief handle I2C0 event interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_EventIRQ_Handler(void) +{ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SBSEND)) { + /* send slave address */ + i2c_master_addressing(I2C0, I2C1_SLAVE_ADDRESS7, I2C_TRANSMITTER); + } else if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_ADDSEND)) { + /*clear ADDSEND bit */ + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_ADDSEND); + } else if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_TBE)) { + if(I2C_nBytes > 0) { + /* the master sends a data byte */ + i2c_data_transmit(I2C0, *i2c_txbuffer++); + I2C_nBytes--; + } else { + /* the master sends a stop condition to I2C bus */ + i2c_stop_on_bus(I2C0); + /* disable the I2C0 interrupt */ + i2c_interrupt_disable(I2C0, I2C_INT_ERR); + i2c_interrupt_disable(I2C0, I2C_INT_BUF); + i2c_interrupt_disable(I2C0, I2C_INT_EV); + } + } +} + +/*! + \brief handle I2C0 error interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_ErrorIRQ_Handler(void) +{ + /* no acknowledge received */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_AERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_AERR); + } + + /* SMBus alert */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SMBALT)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_SMBALT); + } + + /* bus timeout in SMBus mode */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_SMBTO)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_SMBTO); + } + + /* over-run or under-run when SCL stretch is disabled */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_OUERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_OUERR); + } + + /* arbitration lost */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_LOSTARB)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_LOSTARB); + } + + /* bus error */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_BERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_BERR); + } + + /* CRC value doesn't match */ + if(i2c_interrupt_flag_get(I2C0, I2C_INT_FLAG_PECERR)) { + i2c_interrupt_flag_clear(I2C0, I2C_INT_FLAG_PECERR); + } + + /* disable the error interrupt */ + i2c_interrupt_disable(I2C0, I2C_INT_ERR); + i2c_interrupt_disable(I2C0, I2C_INT_BUF); + i2c_interrupt_disable(I2C0, I2C_INT_EV); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C1_IE.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C1_IE.c new file mode 100644 index 0000000..43826fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C1_IE.c @@ -0,0 +1,112 @@ +/*! + \file I2C1_IE.c + \brief I2C1 slave receiver interrupt program + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_i2c.h" +#include "I2C_IE.h" + +uint32_t event2; + +/*! + \brief handle I2C1 event interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_EventIRQ_Handler(void) +{ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_ADDSEND)) { + /* clear the ADDSEND bit */ + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_ADDSEND); + } else if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_RBNE)) { + /* if reception data register is not empty ,I2C1 will read a data from I2C_DATA */ + *i2c_rxbuffer++ = i2c_data_receive(I2C1); + } else if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_STPDET)) { + status = SUCCESS; + /* clear the STPDET bit */ + i2c_enable(I2C1); + /* disable I2C1 interrupt */ + i2c_interrupt_disable(I2C1, I2C_INT_ERR); + i2c_interrupt_disable(I2C1, I2C_INT_BUF); + i2c_interrupt_disable(I2C1, I2C_INT_EV); + } +} + +/*! + \brief handle I2C1 error interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_ErrorIRQ_Handler(void) +{ + /* no acknowledge received */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_AERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_AERR); + } + + /* SMBus alert */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_SMBALT)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_SMBALT); + } + + /* bus timeout in SMBus mode */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_SMBTO)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_SMBTO); + } + + /* over-run or under-run when SCL stretch is disabled */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_OUERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_OUERR); + } + + /* arbitration lost */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_LOSTARB)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_LOSTARB); + } + + /* bus error */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_BERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_BERR); + } + + /* CRC value doesn't match */ + if(i2c_interrupt_flag_get(I2C1, I2C_INT_FLAG_PECERR)) { + i2c_interrupt_flag_clear(I2C1, I2C_INT_FLAG_PECERR); + } + + /* disable the error interrupt */ + i2c_interrupt_disable(I2C1, I2C_INT_ERR); + i2c_interrupt_disable(I2C1, I2C_INT_BUF); + i2c_interrupt_disable(I2C1, I2C_INT_EV); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C_IE.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C_IE.h new file mode 100644 index 0000000..b514112 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/I2C_IE.h @@ -0,0 +1,59 @@ +/*! + \file I2C1_IE.c + \brief The header file of I2C0 and I2C1 interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef I2C_IE_H +#define I2C_IE_H + +#include "gd32f10x.h" + +#define I2C0_SLAVE_ADDRESS7 0x82 +#define I2C1_SLAVE_ADDRESS7 0x72 + +extern volatile ErrStatus status; +extern volatile uint8_t *i2c_txbuffer; +extern volatile uint8_t *i2c_rxbuffer; +extern volatile uint16_t I2C_nBytes; + +/* function declarations */ +/* handle I2C0 event interrupt request */ +void I2C0_EventIRQ_Handler(void); +/* handle I2C0 error interrupt request */ +void I2C0_ErrorIRQ_Handler(void); +/* handle I2C1 event interrupt request */ +void I2C1_EventIRQ_Handler(void); +/* handle I2C1 error interrupt request */ +void I2C1_ErrorIRQ_Handler(void); + +#endif /* I2C_IE_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..7013b61 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.c @@ -0,0 +1,184 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "I2C_IE.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles I2C0 event interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_EV_IRQHandler(void) +{ + I2C0_EventIRQ_Handler(); +} + +/*! + \brief this function handles I2C0 error interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C0_ER_IRQHandler(void) +{ + I2C0_ErrorIRQ_Handler(); +} + +/*! + \brief this function handles I2C1 event interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_EV_IRQHandler(void) +{ + I2C1_EventIRQ_Handler(); +} + +/*! + \brief this function handles I2C1 error interrupt request exception + \param[in] none + \param[out] none + \retval none +*/ +void I2C1_ER_IRQHandler(void) +{ + I2C1_ErrorIRQ_Handler(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..cfde6af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_it.h @@ -0,0 +1,66 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* I2C0 event handle function */ +void I2C0_EV_IRQHandler(void); +/* I2C0 error handle function */ +void I2C0_ER_IRQHandler(void); +/* I2C1 event handle function */ +void I2C1_EV_IRQHandler(void); +/* I2C1 error handle function */ +void I2C1_ER_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/main.c new file mode 100644 index 0000000..3b9d4f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/main.c @@ -0,0 +1,206 @@ +/*! + \file main.c + \brief master transmitter slave receiver interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "I2C_IE.h" + +uint8_t i2c_buffer_transmitter[16]; +uint8_t i2c_buffer_receiver[16]; + +volatile uint8_t *i2c_txbuffer; +volatile uint8_t *i2c_rxbuffer; +volatile uint16_t I2C_nBytes; +volatile ErrStatus status; +ErrStatus state = ERROR; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); +void i2c_nvic_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* initialize LED2, LED3, as the transfer instruction */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + rcu_config(); + gpio_config(); + i2c_config(); + i2c_nvic_config(); + + for(i = 0; i < 16; i++) { + i2c_buffer_transmitter[i] = i + 0x80; + } + /* initialize i2c_txbuffer, i2c_rxbuffer, I2C_nBytes and status */ + i2c_txbuffer = i2c_buffer_transmitter; + i2c_rxbuffer = i2c_buffer_receiver; + I2C_nBytes = 16; + status = ERROR; + + /* enable the I2C0 interrupt */ + i2c_interrupt_enable(I2C0, I2C_INT_ERR); + i2c_interrupt_enable(I2C0, I2C_INT_EV); + i2c_interrupt_enable(I2C0, I2C_INT_BUF); + + /* enable the I2C1 interrupt */ + i2c_interrupt_enable(I2C1, I2C_INT_ERR); + i2c_interrupt_enable(I2C1, I2C_INT_EV); + i2c_interrupt_enable(I2C1, I2C_INT_BUF); + + /* the master waits until the I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + + /* the master sends a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + + while((I2C_nBytes > 0)); + while(SUCCESS != status); + /* if the transfer is successfully completed, LED2 and LED3 is on */ + state = memory_compare(i2c_buffer_transmitter, i2c_buffer_receiver, 16); + if(SUCCESS == state) { + /* if success, LED2 and LED3 are on */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + } else { + /* if failed, LED2 and LED3 are off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + } + while(1) { + } +} + +/*! + \brief memory compare function + \param[in] src : source data + \param[in] dst : destination data + \param[in] length : the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint16_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C1 clock */ + rcu_periph_clock_enable(RCU_I2C1); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports. + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* I2C0 and I2C1 GPIO ports */ + /* connect PB6 to I2C0_SCL */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + /* connect PB10 to I2C1_SCL */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + /* connect PB11 to I2C1_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_11); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces.. + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); + i2c_clock_config(I2C1, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C1, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C1_SLAVE_ADDRESS7); + /* enable I2C1 */ + i2c_enable(I2C1); + /* enable acknowledge */ + i2c_ack_config(I2C1, I2C_ACK_ENABLE); +} + +/*! + \brief cofigure the NVIC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void i2c_nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(I2C0_EV_IRQn, 0, 3); + nvic_irq_enable(I2C1_EV_IRQn, 0, 4); + nvic_irq_enable(I2C0_ER_IRQn, 0, 2); + nvic_irq_enable(I2C1_ER_IRQn, 0, 1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/readme.txt new file mode 100644 index 0000000..7872d3f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter&slave_receiver_interrupt/readme.txt @@ -0,0 +1,50 @@ +/*! + \file readme.txt + \brief description of the master transmitter and slave receiver interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to use the I2C +interrupt programming mode in master transmitting mode or slave receiving mode. +In this demo, I2C0 is operated as the master transmitter and I2C1 as the slave +receiver. Moreover,the SCL line and SDA line of I2C0 interface are controled +by the I/O pin PB6 and PB7 respectively. The SCL and SDA of I2C1 are controled +by the pin PB10 and PB11 respectively. + + This demo will send the data of i2c_buffer_transmitter array through I2C1 interface +to the I2C0, and it will store the data received by I2C1 in the i2c_buffer_receiver +array. If transfer is sucessfully completed, LED2 and LED3 are on. + + We shoud use the jumper to connect the PB6 and PB10. The PB7 and PB11 are +connected as well. + + P4 must be fitted. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/main.c new file mode 100644 index 0000000..727998c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/main.c @@ -0,0 +1,141 @@ +/*! + \file main.c + \brief master transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#define I2C0_OWN_ADDRESS7 0x72 +#define I2C0_SLAVE_ADDRESS7 0x82 + +uint8_t i2c_transmitter[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + for(i = 0; i < 16; i++) { + i2c_transmitter[i] = i + 0x80; + } + + /* wait until I2C bus is idle */ + while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY)); + /* send a start condition to I2C bus */ + i2c_start_on_bus(I2C0); + /* wait until SBSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)); + /* send slave address to I2C bus */ + i2c_master_addressing(I2C0, I2C0_SLAVE_ADDRESS7, I2C_TRANSMITTER); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* wait until the transmit data buffer is empty */ + while(!i2c_flag_get(I2C0, I2C_FLAG_TBE)); + + for(i = 0; i < 16; i++) { + /* data transmission */ + i2c_data_transmit(I2C0, i2c_transmitter[i]); + /* wait until the TBE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_TBE)); + } + /* send a stop condition to I2C bus */ + i2c_stop_on_bus(I2C0); + while(I2C_CTL0(I2C0) & 0x0200); + + /* infinite loop */ + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* I2C0 and I2C1 GPIO ports */ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 100000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_SLAVE_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/readme.txt new file mode 100644 index 0000000..c7b2e1c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Master_transmitter/readme.txt @@ -0,0 +1,47 @@ +/*! + \file readme.txt + \brief description of the master transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in master transmitting mode.In this demo,I2C0 is operated as the master +transmitter, and the SCL line and SDA line of I2C0 interface are controled by +the I/O pin PB6 and PB7 respectively. + + This demo shows the sending process of the master. And it will send the data +in the i2c_transmitter array through I2C0. + + The demo doesn't perform the data transfer actually, which is due to no specific +slave. In the specific application, we must send the correct slave address, and the +master and the slave may need to be connected by the jumper if necessary. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/main.c new file mode 100644 index 0000000..517f104 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/main.c @@ -0,0 +1,145 @@ +/*! + \file main.c + \brief slave receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define I2C0_OWN_ADDRESS7 0x82 + +uint8_t i2c_receiver[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* configure USART */ + gd_eval_com_init(EVAL_COM0); + + printf("\r\n I2C Start"); + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + printf("\r\n I2C slave receive data: \r\n"); + i = 0; + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + + for(i = 0; i < 16; i++) { + /* wait until the RBNE bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_RBNE)); + + /* read a data byte from I2C_DATA */ + i2c_receiver[i] = i2c_data_receive(I2C0); + } + /* wait until the STPDET bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_STPDET)); + /* clear the STPDET bit */ + i2c_enable(I2C0); + + printf("\r\n I2C SUCCESS"); + + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 400000, I2C_DTCY_2); + /* I2C address configure */ + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_OWN_ADDRESS7); + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} + +/* retarget the C library printf function to the usart */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/readme.txt new file mode 100644 index 0000000..ff699a2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_receiver/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the slave receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in slave receiving mode. In this demo, I2C0 is operated as slave receiver, +and the SCL line and SDA line of I2C0 interface are controled by the I/O pin +PB6 and PB7 respectively. + + This demo shows the receving process of the slave. And it will store the +received data in the i2c_receiver array. + + The demo doesn't perform the data transfer actually, which is due to no specific +master.In the specific application, we need config the master to start a data +transmission.In addition,the master and the slave may need to be connected by +the jumper if necessary. + + P4 must be fitted. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/main.c new file mode 100644 index 0000000..6087bcc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/main.c @@ -0,0 +1,150 @@ +/*! + \file main.c + \brief slave transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" + +#define I2C_10BIT_ADDRESS 0 + +#define I2C0_OWN_ADDRESS7 0x82 +#define I2C0_SLAVE_ADDRESS7 0x72 +#define I2C0_OWN_ADDRESS10 0x0322 + +uint8_t i2c_transmitter[16]; + +void rcu_config(void); +void gpio_config(void); +void i2c_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t i; + + /* RCU config */ + rcu_config(); + /* GPIO config */ + gpio_config(); + /* I2C config */ + i2c_config(); + + for(i = 0; i < 16; i++) { + i2c_transmitter[i] = i + 0x80; + } + +#if I2C_10BIT_ADDRESS + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); +#else + /* wait until ADDSEND bit is set */ + while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)); + /* clear ADDSEND bit */ + i2c_flag_clear(I2C0, I2C_FLAG_ADDSEND); +#endif + /* wait until the transmission data register is empty */ + while(!i2c_flag_get(I2C0, I2C_FLAG_TBE)); + + for(i = 0; i < 16; i++) { + /* send a data byte */ + i2c_data_transmit(I2C0, i2c_transmitter[i]); + /* wait until the transmission data register is empty */ + while(!i2c_flag_get(I2C0, I2C_FLAG_TBE)); + } + /* the master doesn't acknowledge for the last byte */ + while(!i2c_flag_get(I2C0, I2C_FLAG_AERR)); + /* clear the bit of AERR */ + i2c_flag_clear(I2C0, I2C_FLAG_AERR); + + while(1) { + } +} + +/*! + \brief enable the peripheral clock + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable I2C0 clock */ + rcu_periph_clock_enable(RCU_I2C0); +} + +/*! + \brief cofigure the GPIO ports + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* connect PB6 to I2C0_SCL */ + /* connect PB7 to I2C0_SDA */ + gpio_init(GPIOB, GPIO_MODE_AF_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_6 | GPIO_PIN_7); +} + +/*! + \brief cofigure the I2C0 and I2C1 interfaces + \param[in] none + \param[out] none + \retval none +*/ +void i2c_config(void) +{ + /* I2C clock configure */ + i2c_clock_config(I2C0, 400000, I2C_DTCY_2); + /* I2C address configure */ +#if I2C_10BIT_ADDRESS + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_10BITS, I2C0_OWN_ADDRESS10); +#else + i2c_mode_addr_config(I2C0, I2C_I2CMODE_ENABLE, I2C_ADDFORMAT_7BITS, I2C0_OWN_ADDRESS7); +#endif + /* enable I2C0 */ + i2c_enable(I2C0); + /* enable acknowledge */ + i2c_ack_config(I2C0, I2C_ACK_ENABLE); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/readme.txt new file mode 100644 index 0000000..2a95064 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/I2C/Slave_transmitter/readme.txt @@ -0,0 +1,50 @@ +/*! + \file readme.txt + \brief description of the slave transmitter + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows the I2C programming +mode in slave transmitting mode.In this demo,I2C0 is operated as slave +transmitter,and the SCL line and SDA line of I2C0 interface are controled by +the I/O pin PB6 and PB7 respectively. + + This demo shows the sending data process of the slave. And it will send the +data in the i2c_transmitter array through the I2C0. + + The demo doesn't perform the data transfer actually, which is due to no specific +master.In the specific application, we need config the master to start a data +transmission.In addition,the master and the slave may need to be connected by +the jumper if necessary.When the macro I2C_10BIT_ADDRESS is 1, I2C communicate in +10 bit addressing mode, otherwise, I2C communicate in 7 bit addressing mode. + + P4 must be fitted. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.c new file mode 100644 index 0000000..7a4dec0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.c @@ -0,0 +1,179 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "main.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles RTC alarm interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void RTC_Alarm_IRQHandler(void) +{ + if(RESET != rtc_interrupt_flag_get(RTC_INT_FLAG_ALARM)){ + /* clear the RTC alarm and EXTI_17 interrupt flags */ + rtc_interrupt_flag_clear(RTC_INT_FLAG_ALARM); + exti_interrupt_flag_clear(EXTI_17); + /* update RTC alarm time */ + rtc_register_sync_wait(); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_counter_set(0U); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_alarm_config(ALARM_TIME_INTERVAL); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* feed dog */ + fwdgt_counter_reload(); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.h new file mode 100644 index 0000000..57a4143 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); +/* this function handles RTC global interrupt request */ +void RTC_Alarm_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_libopt.h new file mode 100644 index 0000000..cfdf1b6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/gd32f10x_libopt.h @@ -0,0 +1,76 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.c new file mode 100644 index 0000000..bbc8354 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.c @@ -0,0 +1,164 @@ +/*! + \file main.c + \brief deepsleep wakeup through RTC alarm interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "main.h" + +void led_config(void); +void nvic_configuration(void); +void rtc_configuration(void); +void fwdgt_configuration(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* nvic configuration */ + nvic_configuration(); + /* LED configuration */ + led_config(); + /* systick configuration */ + systick_config(); + gd_eval_led_on(LED5); + delay_1ms(2000U); + gd_eval_led_off(LED5); + /* RTC configuration */ + rtc_configuration(); + /* FWDGT configuration */ + fwdgt_configuration(); + + while(1){ + delay_1ms(50U); + /* PMU enters deepsleep mode */ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + gd_eval_led_toggle(LED2); + } +} + +/*! + \brief LED configuration + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED5); +} + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_configuration(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable(RTC_Alarm_IRQn, 2U, 1U); +} + +/*! + \brief configure the RTC + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration(void) +{ + /* enable PMU and BKPI clocks */ + rcu_periph_clock_enable(RCU_BKPI); + rcu_periph_clock_enable(RCU_PMU); + /* allow access to backup domain */ + pmu_backup_write_enable(); + /* reset backup domain */ + bkp_deinit(); + + /* enable IRC40K */ + rcu_osci_on(RCU_IRC40K); + /* wait till IRC40K is ready */ + rcu_osci_stab_wait(RCU_IRC40K); + /* select RCU_IRC40K as RTC clock source */ + rcu_rtc_clock_config(RCU_RTCSRC_IRC40K); + /* enable RTC Clock */ + rcu_periph_clock_enable(RCU_RTC); + + /* wait for RTC registers synchronization */ + rtc_register_sync_wait(); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* enable the RTC alarm interrupt */ + rtc_interrupt_enable(RTC_INT_ALARM); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* set RTC prescaler: set RTC period to 1s */ + rtc_prescaler_set(40000); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_counter_set(0U); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_alarm_config(ALARM_TIME_INTERVAL); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + + /* EXTI configuration */ + exti_deinit(); + exti_init(EXTI_17,EXTI_INTERRUPT,EXTI_TRIG_RISING); + rtc_flag_clear(RTC_FLAG_ALARM); + exti_interrupt_flag_clear(EXTI_17); + exti_interrupt_enable(EXTI_17); +} + +/*! + \brief configure the FWDGT + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_configuration(void) +{ + /* confiure FWDGT counter clock: 40KHz(IRC40K) / 256 = 0.15625 KHz */ + fwdgt_config(1250, FWDGT_PSC_DIV256); + while(FWDGT_STAT); + /* after 8 seconds to generate a reset */ + fwdgt_enable(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.h new file mode 100644 index 0000000..f909657 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/main.h @@ -0,0 +1,40 @@ +/*! + \file main.h + \brief the header file of the main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +#define ALARM_TIME_INTERVAL (2U) + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/readme.txt new file mode 100644 index 0000000..3312e17 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of wakeup from deepsleep mode by RTC alarm demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it explains how to configure the +RTC module to wake up MCU from deepsleep and feed dog in RTC alarm interrupt. + Select RCU_IRC40K as RTC and FWDGT clock source. The RTC alarm interval is 2s and the +FWDGT timeout is configured as 8s. + After start-up, the LED2 is off and the LED5 is on. After 2 seconds, LED5 is off and the +MCU enters deepsleep mode. MCU is waked up by RTC alarm every 2 seconds. After wakeup, LED2 +is toggled, then MCU enters deepsleep mode again. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.c new file mode 100644 index 0000000..77449e7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.c @@ -0,0 +1,85 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.h new file mode 100644 index 0000000..71395a0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_RTC/systick.h @@ -0,0 +1,49 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif/* SYS_TICK_H */ + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.c new file mode 100644 index 0000000..fa52a0d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.c @@ -0,0 +1,165 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" +#include "main.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + led_spark(); +} + +/*! + \brief this function handles EXTI10_15 exception + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler(void) +{ + if(SET == exti_interrupt_flag_get(EXTI_13)){ + exti_interrupt_flag_clear(EXTI_13); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.h new file mode 100644 index 0000000..18eeb6e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); +/* EXTI10_15 handle function */ +void EXTI10_15_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.c new file mode 100644 index 0000000..09733b3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.c @@ -0,0 +1,109 @@ +/*! + \file main.c + \brief deepsleep wakeup through exti interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "main.h" + +void led_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* systick configuration */ + systick_config(); + /* LED configuration */ + led_config(); + /* enable clock */ + rcu_periph_clock_enable(RCU_PMU); + /* wakeup key configuration */ + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO); + /* tamper key EXTI configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + /* press wakeup key to enter deepsleep mode and use tamper key to generate a exti interrupt to wakeup mcu */ + while(1){ + if(RESET == gpio_input_bit_get(WAKEUP_KEY_GPIO_PORT, WAKEUP_KEY_PIN)) + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + } +} + +/*! + \brief toggle the LED + \param[in] none + \param[out] none + \retval none +*/ +void led_spark(void) +{ + static __IO uint32_t timingdelaylocal = 0; + + if (timingdelaylocal != 0x00){ + /* all the LEDs on */ + if(timingdelaylocal < 200){ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + }else{ + /* all the LEDs off */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + } + timingdelaylocal--; + }else{ + timingdelaylocal = 400; + } +} + +/*! + \brief LED configuration + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.h new file mode 100644 index 0000000..cabc3a3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of the main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +/* led spark function */ +void led_spark(void); + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/readme.txt new file mode 100644 index 0000000..b8a8146 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/readme.txt @@ -0,0 +1,39 @@ +/*! + \file readme.txt + \brief description of the deepsleep wakeup through exti demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it shows pmu how to enter deepsleep +mode and wakeup it. Press wakeup key to enter deepsleep mode, led stop flashing. When +you press tamper key to generate an exti interrupt, mcu will be wakeuped from deepsleep +mode, led sparks again. But the led sparks slower, because at this time IRC8M is the system +clock. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.h new file mode 100644 index 0000000..58a13f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Deepsleep_wakeup_exti/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.c new file mode 100644 index 0000000..d62a848 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.c @@ -0,0 +1,153 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles LVD exception + \param[in] none + \param[out] none + \retval none +*/ +void LVD_IRQHandler(void) +{ + if(RESET != exti_interrupt_flag_get(EXTI_16)){ + gd_eval_led_toggle(LED2); + exti_interrupt_flag_clear(EXTI_16); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/main.c new file mode 100644 index 0000000..f8aaa19 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/main.c @@ -0,0 +1,63 @@ +/*! + \file main.c + \brief low voltage detector + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* NVIC configuration */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE0_SUB4); + nvic_irq_enable(LVD_IRQn,0,0); + /* enable clock */ + rcu_periph_clock_enable(RCU_PMU); + /* initialize LED2 */ + gd_eval_led_init(LED2); + /* turn on LED2*/ + gd_eval_led_on(LED2); + /* EXTI_16 configuration */ + exti_init(EXTI_16, EXTI_INTERRUPT, EXTI_TRIG_BOTH); + /* configure the LVD threshold to 2.9v */ + pmu_lvd_select(PMU_LVDT_7); + + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/readme.txt new file mode 100644 index 0000000..7ab7928 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Low_voltage_detector/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of the low voltage detector demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it shows how to use low voltage detector. +If VDD/VDDA is higher or lower than the LVD threshold, then a LVD event will occur. The event +is internally connected to the EXTI line 16 and can generate an interrupt if enabled through +the EXTI registers. Use external power connect 3.3v pin and GND pin of the board, adjust +voltage higher or lower than the LVD threshold 2.9v, LED2 will toggle. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.c new file mode 100644 index 0000000..f8ce6a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.h new file mode 100644 index 0000000..4d67180 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_libopt.h new file mode 100644 index 0000000..cfdf1b6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/gd32f10x_libopt.h @@ -0,0 +1,76 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.c new file mode 100644 index 0000000..82c3c85 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.c @@ -0,0 +1,130 @@ +/*! + \file main.c + \brief standby wakeup through RTC alarm interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "systick.h" +#include "main.h" + +void led_config(void); +void rtc_configuration(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + /* LED configuration and turn on all LEDs */ + led_config(); + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + /* delay 2s */ + delay_1ms(2000); + /* enable PMU clock */ + rcu_periph_clock_enable(RCU_PMU); + /* configure RTC */ + rtc_configuration(); + pmu_flag_clear(PMU_FLAG_RESET_STANDBY); + /* PMU enters standby mode */ + pmu_to_standbymode(); + + while(1){ + } +} + +/*! + \brief configure LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief configure the RTC + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration(void) +{ + /* enable BKPI clock */ + rcu_periph_clock_enable(RCU_BKPI); + /* allow access to backup domain */ + pmu_backup_write_enable(); + /* reset backup domain */ + bkp_deinit(); + + /* enable IRC40K */ + rcu_osci_on(RCU_IRC40K); + /* wait till IRC40K is ready */ + rcu_osci_stab_wait(RCU_IRC40K); + /* select RCU_IRC40K as RTC clock source */ + rcu_rtc_clock_config(RCU_RTCSRC_IRC40K); + /* enable RTC clock */ + rcu_periph_clock_enable(RCU_RTC); + + /* wait for RTC registers synchronization */ + rtc_register_sync_wait(); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* enable the RTC alarm interrupt */ + rtc_interrupt_enable(RTC_INT_ALARM); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* set RTC prescaler: set RTC period to 1s */ + rtc_prescaler_set(40000); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_counter_set(0U); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + rtc_alarm_config(ALARM_TIME_INTERVAL); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* clear the RTC alarm flag */ + rtc_flag_clear(RTC_FLAG_ALARM); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.h new file mode 100644 index 0000000..8f87553 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/main.h @@ -0,0 +1,40 @@ +/*! + \file main.h + \brief the header file of the main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +#define ALARM_TIME_INTERVAL (3U) + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/readme.txt new file mode 100644 index 0000000..a823290 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of wakeup from standby by RTC alarm demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it explains how to configure the +RTC module to wakeup MCU from standby mode through RTC alarm interrupt. + Select RCU_IRC40K as RTC clock source. The RTC alarm interval is configured as 3s. +After start-up, the LED2~LED5 is on. After 2s, MCU enter standby mode, all LEDs turn +off. After 3 seconds, MCU will be wakeuped from standby mode by RTC alarm interrupt, a +power-on reset occurs and the MCU will execute instruction code from the 0x00000000 address. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.c new file mode 100644 index 0000000..d5a356a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.c @@ -0,0 +1,85 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay){ + delay--; + } +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.h new file mode 100644 index 0000000..71395a0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_RTC/systick.h @@ -0,0 +1,49 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif/* SYS_TICK_H */ + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/main.c new file mode 100644 index 0000000..b8278ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/main.c @@ -0,0 +1,82 @@ +/*! + \file main.c + \brief standby wakeup through wakeup pin + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void led_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* enable clock */ + rcu_periph_clock_enable(RCU_PMU); + /* LED configuration and turn on all LEDs */ + led_config(); + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_on(LED3); + gd_eval_led_on(LED5); + /* tamper key configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + /* enable wakeup pin */ + pmu_wakeup_pin_enable(); + pmu_flag_clear(PMU_FLAG_RESET_STANDBY); + /* press tamper key to enter standby mode and use wakeup key to wakeup mcu */ + while(1){ + if(RESET == gpio_input_bit_get(TAMPER_KEY_GPIO_PORT, TAMPER_KEY_PIN)){ + pmu_to_standbymode(); + } + } +} + +/*! + \brief configure LED + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/readme.txt new file mode 100644 index 0000000..eafc7ef --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/PMU/Standby_wakeup_pin/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of the standby mode wakeup through wakeup pin demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it shows pmu how to enter standby +mode and wakeup it. Press tamper key to enter standby mode, LEDs turn off. When you press +wakeup key, mcu will be wakeuped from standby mode, LEDs will be turn on. when exit from +the standby mode, a power-on reset occurs and the mcu will execute instruction code +from the 0x00000000 address. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.c new file mode 100644 index 0000000..f8ce6a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.h new file mode 100644 index 0000000..d8da237 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_libopt.h new file mode 100644 index 0000000..a26c831 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/main.c new file mode 100644 index 0000000..1524a86 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/main.c @@ -0,0 +1,80 @@ +/*! + \file main.c + \brief clock output via CKOUT pin example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the Systick */ + systick_config(); + /* peripheral clock enable */ + rcu_periph_clock_enable(RCU_GPIOA); + /* configure clock output pin */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_8); + + /* configure CKOUT0 to output system clock */ + rcu_ckout0_config(RCU_CKOUT0SRC_CKSYS); + delay_1ms(1000); + + /* enable IRC8M clock */ + rcu_osci_on(RCU_IRC8M); + if(ERROR == rcu_osci_stab_wait(RCU_IRC8M)){ + while(1){ + } + } + /* configure CKOUT0 to output IRC8M clock */ + rcu_ckout0_config(RCU_CKOUT0SRC_IRC8M); + delay_1ms(1000); + + /* enable HXTAL clock */ + rcu_osci_on(RCU_HXTAL); + if(ERROR == rcu_osci_stab_wait(RCU_HXTAL)){ + while(1){ + } + } + /* configure CKOUT0 to output HXTAL clock */ + rcu_ckout0_config(RCU_CKOUT0SRC_HXTAL); + + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/readme.txt new file mode 100644 index 0000000..28ce3d3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/readme.txt @@ -0,0 +1,38 @@ +/*! + \file readme.txt + \brief description of clock output via CKOUT pin example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL board, it provides a +description of how to configure CKOUT0 to output different clock sources. +CK_SYS, CK_IRC8M and CK_HXTAL will be output separately. The clock output +pin is PA8 and the result can be observed by oscilloscope. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.c new file mode 100644 index 0000000..ef3d20b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.h new file mode 100644 index 0000000..815ed33 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Ckout_pin_clock_output/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.c new file mode 100644 index 0000000..f8ce6a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.h new file mode 100644 index 0000000..d8da237 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_libopt.h new file mode 100644 index 0000000..a26c831 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/main.c new file mode 100644 index 0000000..e89fe03 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/main.c @@ -0,0 +1,101 @@ +/*! + \file main.c + \brief reset source detect example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include +#include "gd32f10x_eval.h" + +void mcu_software_reset(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the Systick, USART and key */ + systick_config(); + gd_eval_com_init(EVAL_COM0); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO); + + if(RESET != rcu_flag_get(RCU_FLAG_PORRST)){ + printf("\r\nPower reset generated"); + } + + if(RESET != rcu_flag_get(RCU_FLAG_SWRST)){ + printf("\r\nSoftware reset generated"); + } + + if((RESET != rcu_flag_get(RCU_FLAG_EPRST)) && (RESET == rcu_flag_get(RCU_FLAG_PORRST))){ + printf("\r\nExternal PIN reset generated"); + } + /* clear all reset flags */ + rcu_all_reset_flag_clear(); + + while(1){ + /* press Wakeup key to software reset mcu */ + if(RESET == gd_eval_key_state_get(KEY_WAKEUP)){ + delay_1ms(100); + if(RESET == gd_eval_key_state_get(KEY_WAKEUP)){ + delay_1ms(50); + mcu_software_reset(); + } + } + } +} + +/*! + \brief software reset mcu + \param[in] none + \param[out] none + \retval none +*/ +void mcu_software_reset(void) +{ + /* set FAULTMASK */ + __set_FAULTMASK(1); + NVIC_SystemReset(); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/readme.txt new file mode 100644 index 0000000..333fcfc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/readme.txt @@ -0,0 +1,38 @@ +/*! + \file readme.txt + \brief description of reset source detect example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL board, it provides a +description of how to detect different reset sources. The reset sources +will be printed out through HyperTerminal. Press Reset pin to generate +external PIN reset. Press Wakeup pin to generate software reset. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.c new file mode 100644 index 0000000..ef3d20b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.h new file mode 100644 index 0000000..815ed33 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/Reset_source_detect/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_libopt.h new file mode 100644 index 0000000..a26c831 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/main.c new file mode 100644 index 0000000..5773004 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RCU/System_clock_switch/main.c @@ -0,0 +1,236 @@ +/*! + \file main.c + \brief system clock switch example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +static void _delay(uint32_t timeout); +static void switch_system_clock_to_36m_hxtal(void); +static void switch_system_clock_to_108m_irc8m(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the USART */ + gd_eval_com_init(EVAL_COM0); + printf("\r\nCK_SYS switch test demo\r\n"); + + /* disable the USART */ + usart_disable(EVAL_COM0); + + /* switch system clock to 36MHz by HXTAL */ + switch_system_clock_to_36m_hxtal(); + gd_eval_com_init(EVAL_COM0); + /* print out the clock frequency of system */ + printf("\r\nCK_SYS is %d", rcu_clock_freq_get(CK_SYS)); + + _delay(1000); + + /* switch system clock to 108MHz by IRC8M */ + switch_system_clock_to_108m_irc8m(); + gd_eval_com_init(EVAL_COM0); + /* print out the clock frequency of system */ + printf("\r\nCK_SYS is %d", rcu_clock_freq_get(CK_SYS)); + + while(1){ + } +} + +/*! + \brief delay function + \param[in] timeout: time out + \param[out] none + \retval none +*/ +static void _delay(uint32_t timeout) +{ + __IO uint32_t i,j; + for(i=0; i + +uint32_t RTCSRC_FLAG = 0; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* COM0 configure */ + gd_eval_com_init(EVAL_COM0); + + /* NVIC configure */ + nvic_configuration(); + + printf( "\r\n This is a RTC demo...... \r\n" ); + + /* get RTC clock entry selection */ + RTCSRC_FLAG = GET_BITS(RCU_BDCTL, 8, 9); + + if ((bkp_data_read(BKP_DATA_0) != 0xA5A5) || (0x00 == RTCSRC_FLAG)){ + /* backup data register value is not correct or not yet programmed + or RTC clock source is not configured (when the first time the program + is executed or data in RCU_BDCTL is lost due to Vbat feeding) */ + printf("\r\nThis is a RTC demo!\r\n"); + printf("\r\n\n RTC not yet configured...."); + + /* RTC configuration */ + rtc_configuration(); + + printf("\r\n RTC configured...."); + + /* adjust time by values entred by the user on the hyperterminal */ + time_adjust(); + + bkp_data_write(BKP_DATA_0, 0xA5A5); + }else{ + /* check if the power on reset flag is set */ + if (rcu_flag_get(RCU_FLAG_PORRST) != RESET){ + printf("\r\n\n Power On Reset occurred...."); + }else if (rcu_flag_get(RCU_FLAG_SWRST) != RESET){ + /* check if the pin reset flag is set */ + printf("\r\n\n External Reset occurred...."); + } + + /* allow access to BKP domain */ + rcu_periph_clock_enable(RCU_PMU); + pmu_backup_write_enable(); + + printf("\r\n No need to configure RTC...."); + /* wait for RTC registers synchronization */ + rtc_register_sync_wait(); + + /* enable the RTC second */ + rtc_interrupt_enable(RTC_INT_SECOND); + + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + } + +#ifdef RTCCLOCKOUTPUT_ENABLE + /* enable PMU and BKPI clocks */ + rcu_periph_clock_enable(RCU_BKPI); + rcu_periph_clock_enable(RCU_PMU); + /* allow access to BKP domain */ + pmu_backup_write_enable(); + + /* disable the tamper pin */ + bkp_tamper_detection_disable(); + + /* enable RTC clock output on tamper Pin */ + bkp_rtc_calibration_output_enable(); +#endif + + /* clear reset flags */ + rcu_all_reset_flag_clear(); + + /* display time in infinite loop */ + time_show(); + + while (1){ + } +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/readme.txt new file mode 100644 index 0000000..7db25c3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of calendar demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it explains how to configure the +RTC module. In this demo, RTC peripheral is configured to display calendar. Select LXTAL +as RTC clock source. And the HyperTerminal should be connected to the evaluation board via COM0. + After start-up, get key value from BKP data register or bit RTCSRC of backup domain +control register. If the value is incorrect, the program will ask to set the time on the +HyperTerminal. If the key value is correct, by the HyperTerminal set time,the calendar will +be displayed on the HyperTerminal. + The RTC module is in the Backup Domain, and is not reset by the system reset. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.c new file mode 100644 index 0000000..4446a6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.c @@ -0,0 +1,217 @@ +/*! + \file rtc.c + \brief RTC check and config,time_show and time_adjust function + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "rtc.h" + +/* enter the second interruption,set the second interrupt flag to 1 */ +__IO uint32_t timedisplay; + +/*! + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none +*/ +void nvic_configuration(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(RTC_IRQn,1,0); +} + +/*! + \brief configure the RTC + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration(void) +{ + /* enable PMU and BKPI clocks */ + rcu_periph_clock_enable(RCU_BKPI); + rcu_periph_clock_enable(RCU_PMU); + /* allow access to BKP domain */ + pmu_backup_write_enable(); + + /* reset backup domain */ + bkp_deinit(); + + /* enable LXTAL */ + rcu_osci_on(RCU_LXTAL); + /* wait till LXTAL is ready */ + rcu_osci_stab_wait(RCU_LXTAL); + + /* select RCU_LXTAL as RTC clock source */ + rcu_rtc_clock_config(RCU_RTCSRC_LXTAL); + + /* enable RTC Clock */ + rcu_periph_clock_enable(RCU_RTC); + + /* wait for RTC registers synchronization */ + rtc_register_sync_wait(); + + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + + /* enable the RTC second interrupt*/ + rtc_interrupt_enable(RTC_INT_SECOND); + + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + + /* set RTC prescaler: set RTC period to 1s */ + rtc_prescaler_set(32767); + + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); +} + +/*! + \brief return the time entered by user, using Hyperterminal + \param[in] none + \param[out] none + \retval current time of RTC counter value +*/ +uint32_t time_regulate(void) +{ + uint32_t tmp_hh = 0xFF, tmp_mm = 0xFF, tmp_ss = 0xFF; + + printf("\r\n==============Time Settings====================================="); + printf("\r\n Please Set Hours"); + + while (tmp_hh == 0xFF){ + tmp_hh = usart_scanf(23); + } + printf(": %d", tmp_hh); + printf("\r\n Please Set Minutes"); + while (tmp_mm == 0xFF){ + tmp_mm = usart_scanf(59); + } + printf(": %d", tmp_mm); + printf("\r\n Please Set Seconds"); + while (tmp_ss == 0xFF){ + tmp_ss = usart_scanf(59); + } + printf(": %d", tmp_ss); + + /* return the value store in RTC counter register */ + return((tmp_hh*3600 + tmp_mm*60 + tmp_ss)); +} + +/*! + \brief adjust time + \param[in] none + \param[out] none + \retval none +*/ +void time_adjust(void) +{ + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); + /* change the current time */ + rtc_counter_set(time_regulate()); + /* wait until last write operation on RTC registers has finished */ + rtc_lwoff_wait(); +} + +/*! + \brief display the current time + \param[in] timeVar: RTC counter value + \param[out] none + \retval none +*/ +void time_display(uint32_t timevar) +{ + uint32_t thh = 0, tmm = 0, tss = 0; + + /* compute hours */ + thh = timevar / 3600; + /* compute minutes */ + tmm = (timevar % 3600) / 60; + /* compute seconds */ + tss = (timevar % 3600) % 60; + + printf(" Time: %0.2d:%0.2d:%0.2d\r\n", thh, tmm, tss); +} + +/*! + \brief show the current time (HH:MM:SS) on the Hyperterminal + \param[in] none + \param[out] none + \retval none +*/ +void time_show(void) +{ + printf("\n\r"); + + /* infinite loop */ + while (1){ + /* if 1s has paased */ + if (timedisplay == 1){ + /* display current time */ + time_display(rtc_counter_get()); + timedisplay = 0; + } + } +} + +/*! + \brief get numeric values from the hyperterminal + \param[in] value: input value from the hyperterminal + \param[out] none + \retval input value in BCD mode +*/ +uint8_t usart_scanf(uint32_t value) +{ + uint32_t index = 0; + uint32_t tmp[2] = {0, 0}; + + while (index < 2){ + /* loop until RBNE = 1 */ + while (usart_flag_get(USART0, USART_FLAG_RBNE) == RESET); + tmp[index++] = (usart_data_receive(USART0)); + + if ((tmp[index - 1] < 0x30) || (tmp[index - 1] > 0x39)){ + printf("\n\rPlease enter valid number between 0 and 9\n"); + index--; + } + } + /* calculate the Corresponding value */ + index = (tmp[1] - 0x30) + ((tmp[0] - 0x30) * 10); + /* check */ + if (index > value){ + printf("\n\rPlease enter valid number between 0 and %d\n", value); + return 0xFF; + } + return index; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.h new file mode 100644 index 0000000..3c2fc7e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/RTC/Calendar_demo/rtc.h @@ -0,0 +1,50 @@ +/*! + \file rtc.h + \brief headfile of RTC check and config,time_show and time_adjust function + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __RTC_H +#define __RTC_H + +#include "gd32f10x.h" +#include + +void nvic_configuration(void); +void rtc_configuration(void); +uint32_t time_regulate(void); +void time_adjust(void); +void time_display(uint32_t timevar); +void time_show(void); +uint8_t usart_scanf(uint32_t value); + +#endif /* __RTC_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.c new file mode 100644 index 0000000..336cf68 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.c @@ -0,0 +1,161 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "sdcard.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles SDIO interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void SDIO_IRQHandler(void) +{ + sd_interrupts_process(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/main.c new file mode 100644 index 0000000..be63b4e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/main.c @@ -0,0 +1,415 @@ +/*! + \file main.c + \brief SD card read and write demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "sdcard.h" +#include + +//#define DATA_PRINT /* uncomment the macro to print out the data */ + +sd_card_info_struct sd_cardinfo; /* information of SD card */ +uint32_t buf_write[512]; /* store the data written to the card */ +uint32_t buf_read[512]; /* store the data read from the card */ + +void nvic_config(void); +sd_error_enum sd_io_init(void); +void card_info_get(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + sd_error_enum sd_error; + uint16_t i = 5; +#ifdef DATA_PRINT + uint8_t *pdata; +#endif /* DATA_PRINT */ + + /* configure the NVIC, USART and LED */ + nvic_config(); + gd_eval_com_init(EVAL_COM0); + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + /* turn off all the LEDs */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + + /* initialize the card */ + do{ + sd_error = sd_io_init(); + }while((SD_OK != sd_error) && (--i)); + + if(i){ + printf("\r\n Card init success!\r\n"); + }else{ + printf("\r\n Card init failed!\r\n"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + } + + /* get the information of the card and print it out by USART */ + card_info_get(); + + /* init the write buffer */ + for(i=0; i<512; i++){ + buf_write[i] = i; + } + + printf("\r\n\r\n Card test:"); + + /* single block operation test */ + sd_error = sd_block_write(buf_write, 100*512, 512); + if(SD_OK != sd_error){ + printf("\r\n Block write fail!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n Block write success!"); + } + sd_error = sd_block_read(buf_read, 100*512, 512); + if(SD_OK != sd_error){ + printf("\r\n Block read fail!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n Block read success!"); +#ifdef DATA_PRINT + pdata = (uint8_t *)buf_read; + /* print data by USART */ + printf("\r\n"); + for(i = 0; i < 128; i++){ + printf(" %3d %3d %3d %3d ", *pdata, *(pdata+1), *(pdata+2), *(pdata+3)); + pdata += 4; + if(0 == (i + 1) % 4){ + printf("\r\n"); + } + } +#endif /* DATA_PRINT */ + } + + /* lock and unlock operation test */ + if(SD_CCC_LOCK_CARD & sd_cardinfo.card_csd.ccc){ + /* lock the card */ + sd_error = sd_lock_unlock(SD_LOCK); + if(SD_OK != sd_error){ + printf("\r\n Lock failed!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n The card is locked!"); + } + sd_error = sd_erase(100*512, 101*512); + if(SD_OK != sd_error){ + printf("\r\n Erase failed!"); + }else{ + printf("\r\n Erase success!"); + } + + /* unlock the card */ + sd_error = sd_lock_unlock(SD_UNLOCK); + if(SD_OK != sd_error){ + printf("\r\n Unlock failed!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n The card is unlocked!"); + } + sd_error = sd_erase(100*512, 101*512); + if(SD_OK != sd_error){ + printf("\r\n Erase failed!"); + }else{ + printf("\r\n Erase success!"); + } + + sd_error = sd_block_read(buf_read, 100*512, 512); + if(SD_OK != sd_error){ + printf("\r\n Block read fail!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n Block read success!"); +#ifdef DATA_PRINT + pdata = (uint8_t *)buf_read; + /* print data by USART */ + printf("\r\n"); + for(i = 0; i < 128; i++){ + printf(" %3d %3d %3d %3d ", *pdata, *(pdata+1), *(pdata+2), *(pdata+3)); + pdata += 4; + if(0 == (i + 1) % 4){ + printf("\r\n"); + } + } +#endif /* DATA_PRINT */ + } + } + + /* multiple blocks operation test */ + sd_error = sd_multiblocks_write(buf_write, 200*512, 512, 3); + if(SD_OK != sd_error){ + printf("\r\n Multiple block write fail!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n Multiple block write success!"); + } + sd_error = sd_multiblocks_read(buf_read, 200*512, 512, 3); + if(SD_OK != sd_error){ + printf("\r\n Multiple block read fail!"); + /* turn on LED2, LED4 and turn off LED3, LED5 */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + while (1){ + } + }else{ + printf("\r\n Multiple block read success!"); +#ifdef DATA_PRINT + pdata = (uint8_t *)buf_read; + /* print data by USART */ + printf("\r\n"); + for(i = 0; i < 512; i++){ + printf(" %3d %3d %3d %3d ", *pdata, *(pdata+1), *(pdata+2), *(pdata+3)); + pdata += 4; + if(0 == (i + 1) % 4){ + printf("\r\n"); + } + } +#endif /* DATA_PRINT */ + } + + /* turn on all the LEDs */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + gd_eval_led_on(LED5); + while (1){ + } +} + +/*! + \brief configure the NVIC + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(SDIO_IRQn, 0, 0); +} + +/*! + \brief initialize the card, get the card information, set the bus mode and transfer mode + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_io_init(void) +{ + sd_error_enum status = SD_OK; + uint32_t cardstate = 0; + status = sd_init(); + if(SD_OK == status){ + status = sd_card_information_get(&sd_cardinfo); + } + if(SD_OK == status){ + status = sd_card_select_deselect(sd_cardinfo.card_rca); + } + status = sd_cardstatus_get(&cardstate); + if(cardstate & 0x02000000){ + printf("\r\n the card is locked!"); + while (1){ + } + } + if ((SD_OK == status) && (!(cardstate & 0x02000000))) + { + /* set bus mode */ + status = sd_bus_mode_config(SDIO_BUSMODE_4BIT); +// status = sd_bus_mode_config( SDIO_BUSMODE_1BIT ); + } + if (SD_OK == status) + { + /* set data transfer mode */ +// status = sd_transfer_mode_config( SD_DMA_MODE ); + status = sd_transfer_mode_config( SD_POLLING_MODE ); + } + return status; +} + +/*! + \brief get the card information and print it out by USRAT + \param[in] none + \param[out] none + \retval none +*/ +void card_info_get(void) +{ + uint8_t sd_spec, sd_spec3, sd_spec4, sd_security; + uint32_t block_count, block_size; + uint16_t temp_ccc; + printf("\r\n Card information:"); + sd_spec = (sd_scr[1] & 0x0F000000) >> 24; + sd_spec3 = (sd_scr[1] & 0x00008000) >> 15; + sd_spec4 = (sd_scr[1] & 0x00000400) >> 10; + if(2 == sd_spec) + { + if(1 == sd_spec3) + { + if(1 == sd_spec4) + { + printf("\r\n## Card version 4.xx ##"); + } + else + { + printf("\r\n## Card version 3.0x ##"); + } + } + else + { + printf("\r\n## Card version 2.00 ##"); + } + } + else if(1 == sd_spec) + { + printf("\r\n## Card version 1.10 ##"); + } + else if(0 == sd_spec) + { + printf("\r\n## Card version 1.0x ##"); + } + + sd_security = (sd_scr[1] & 0x00700000) >> 20; + if(2 == sd_security) + { + printf("\r\n## SDSC card ##"); + } + else if(3 == sd_security) + { + printf("\r\n## SDHC card ##"); + } + else if(4 == sd_security) + { + printf("\r\n## SDXC card ##"); + } + + block_count = (sd_cardinfo.card_csd.c_size + 1)*1024; + block_size = 512; + printf("\r\n## Device size is %dKB ##", sd_card_capacity_get()); + printf("\r\n## Block size is %dB ##", block_size); + printf("\r\n## Block count is %d ##", block_count); + + if(sd_cardinfo.card_csd.read_bl_partial){ + printf("\r\n## Partial blocks for read allowed ##" ); + } + if(sd_cardinfo.card_csd.write_bl_partial){ + printf("\r\n## Partial blocks for write allowed ##" ); + } + temp_ccc = sd_cardinfo.card_csd.ccc; + printf("\r\n## CardCommandClasses is: %x ##", temp_ccc); + if((SD_CCC_BLOCK_READ & temp_ccc) && (SD_CCC_BLOCK_WRITE & temp_ccc)){ + printf("\r\n## Block operation supported ##"); + } + if(SD_CCC_ERASE & temp_ccc){ + printf("\r\n## Erase supported ##"); + } + if(SD_CCC_WRITE_PROTECTION & temp_ccc){ + printf("\r\n## Write protection supported ##"); + } + if(SD_CCC_LOCK_CARD & temp_ccc){ + printf("\r\n## Lock unlock supported ##"); + } + if(SD_CCC_APPLICATION_SPECIFIC & temp_ccc){ + printf("\r\n## Application specific supported ##"); + } + if(SD_CCC_IO_MODE & temp_ccc){ + printf("\r\n## I/O mode supported ##"); + } + if(SD_CCC_SWITCH & temp_ccc){ + printf("\r\n## Switch function supported ##"); + } +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/readme.txt new file mode 100644 index 0000000..524befc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of SD card read and write example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32103C-EVAL board, it shows how to use SDIO to read or +write to SD card. After initializing the card successfully, print out the detailed information +of the card by USART. Then write a block of data to the card and read. If any error occurs, +print the error message and turn on LED2, LED4 and turn off LED3, LED5. After that, do the +lock and unlock operation test. Lock the card first and try to erase the data of the card. +Then unlock the card and erase the card. If any error occurs, print the error message and +turn on LED2, LED4 and turn off LED3, LED5. Last is the multiple blocks operation test. If +no error occurs, turn on all the LEDs. + + Uncomment the macro DATA_PRINT to print out the data and display them through HyperTerminal. + + JP20 must be jumpped to SDIO. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.c new file mode 100644 index 0000000..4af19d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.c @@ -0,0 +1,2441 @@ +/*! + \file sdcard.c + \brief SD card driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "sdcard.h" +#include "gd32f10x_sdio.h" +#include + +/* card status of R1 definitions */ +#define SD_R1_OUT_OF_RANGE BIT(31) /* command's argument was out of the allowed range */ +#define SD_R1_ADDRESS_ERROR BIT(30) /* misaligned address which did not match the block length */ +#define SD_R1_BLOCK_LEN_ERROR BIT(29) /* transferred block length is not allowed */ +#define SD_R1_ERASE_SEQ_ERROR BIT(28) /* an error in the sequence of erase commands occurred */ +#define SD_R1_ERASE_PARAM BIT(27) /* an invalid selection of write-blocks for erase occurred */ +#define SD_R1_WP_VIOLATION BIT(26) /* the host attempts to write to a protected block or to the temporary or permanent write protected card */ +#define SD_R1_CARD_IS_LOCKED BIT(25) /* the card is locked by the host */ +#define SD_R1_LOCK_UNLOCK_FAILED BIT(24) /* a sequence or password error has been detected in lock/unlock card command */ +#define SD_R1_COM_CRC_ERROR BIT(23) /* CRC check of the previous command failed */ +#define SD_R1_ILLEGAL_COMMAND BIT(22) /* command not legal for the card state */ +#define SD_R1_CARD_ECC_FAILED BIT(21) /* card internal ECC was applied but failed to correct the data */ +#define SD_R1_CC_ERROR BIT(20) /* internal card controller error */ +#define SD_R1_GENERAL_UNKNOWN_ERROR BIT(19) /* a general or an unknown error occurred during the operation */ +#define SD_R1_CSD_OVERWRITE BIT(16) /* read only section of the CSD does not match or attempt to reverse the copy or permanent WP bits */ +#define SD_R1_WP_ERASE_SKIP BIT(15) /* partial address space was erased */ +#define SD_R1_CARD_ECC_DISABLED BIT(14) /* command has been executed without using the internal ECC */ +#define SD_R1_ERASE_RESET BIT(13) /* an erase sequence was cleared before executing */ +#define SD_R1_READY_FOR_DATA BIT(8) /* correspond to buffer empty signaling on the bus */ +#define SD_R1_APP_CMD BIT(5) /* card will expect ACMD */ +#define SD_R1_AKE_SEQ_ERROR BIT(3) /* error in the sequence of the authentication process */ +#define SD_R1_ERROR_BITS (uint32_t)0xFDF9E008 /* all the R1 error bits */ + +/* card status of R6 definitions */ +#define SD_R6_COM_CRC_ERROR BIT(15) /* CRC check of the previous command failed */ +#define SD_R6_ILLEGAL_COMMAND BIT(14) /* command not legal for the card state */ +#define SD_R6_GENERAL_UNKNOWN_ERROR BIT(13) /* a general or an unknown error occurred during the operation */ + +/* card state */ +#define SD_CARDSTATE_IDLE ((uint8_t)0x00) /* card is in idle state */ +#define SD_CARDSTATE_READY ((uint8_t)0x01) /* card is in ready state */ +#define SD_CARDSTATE_IDENTIFICAT ((uint8_t)0x02) /* card is in identificat state */ +#define SD_CARDSTATE_STANDBY ((uint8_t)0x03) /* card is in standby state */ +#define SD_CARDSTATE_TRANSFER ((uint8_t)0x04) /* card is in transfer state */ +#define SD_CARDSTATE_DATA ((uint8_t)0x05) /* card is in data sending state */ +#define SD_CARDSTATE_RECEIVING ((uint8_t)0x06) /* card is in receiving state */ +#define SD_CARDSTATE_PROGRAMMING ((uint8_t)0x07) /* card is in programming state */ +#define SD_CARDSTATE_DISCONNECT ((uint8_t)0x08) /* card is in disconnect state */ +#define SD_CARDSTATE_LOCKED ((uint32_t)0x02000000) /* card is in locked state */ + +#define SD_CHECK_PATTERN ((uint32_t)0x000001AA) /* check pattern for CMD8 */ +#define SD_VOLTAGE_WINDOW ((uint32_t)0x80100000) /* host 3.3V request in ACMD41 */ + +/* parameters for ACMD41(voltage validation) */ +#define SD_HIGH_CAPACITY ((uint32_t)0x40000000) /* high capacity SD memory card */ +#define SD_STD_CAPACITY ((uint32_t)0x00000000) /* standard capacity SD memory card */ + +/* SD bus width, check SCR register */ +#define SD_BUS_WIDTH_4BIT ((uint32_t)0x00040000) /* 4-bit width bus mode */ +#define SD_BUS_WIDTH_1BIT ((uint32_t)0x00010000) /* 1-bit width bus mode */ + +/* masks for SCR register */ +#define SD_MASK_0_7BITS ((uint32_t)0x000000FF) /* mask [7:0] bits */ +#define SD_MASK_8_15BITS ((uint32_t)0x0000FF00) /* mask [15:8] bits */ +#define SD_MASK_16_23BITS ((uint32_t)0x00FF0000) /* mask [23:16] bits */ +#define SD_MASK_24_31BITS ((uint32_t)0xFF000000) /* mask [31:24] bits */ + +#define SDIO_FIFO_ADDR ((uint32_t)SDIO + 0x80U) /* address of SDIO_FIFO */ +#define SD_FIFOHALF_WORDS ((uint32_t)0x00000008) /* words of FIFO half full/empty */ +#define SD_FIFOHALF_BYTES ((uint32_t)0x00000020) /* bytes of FIFO half full/empty */ + +#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF) /* DSM data timeout */ +#define SD_MAX_VOLT_VALIDATION ((uint32_t)0x0000FFFF) /* the maximum times of voltage validation */ +#define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF) /* the maximum length of data */ +#define SD_ALLZERO ((uint32_t)0x00000000) /* all zero */ +#define SD_RCA_SHIFT ((uint8_t)0x10) /* RCA shift bits */ +#define SD_CLK_DIV_INIT ((uint16_t)0x00FF) /* SD clock division in initilization phase */ +#define SD_CLK_DIV_TRANS ((uint16_t)0x0003) /* SD clock division in transmission phase */ + +#define SDIO_MASK_INTC_FLAGS ((uint32_t)0x00C007FF) /* mask flags of SDIO_INTC */ + +uint32_t sd_scr[2] = {0,0}; /* content of SCR register */ + +static sdio_card_type_enum cardtype = SDIO_STD_CAPACITY_SD_CARD_V1_1; /* SD card type */ +static uint32_t sd_csd[4] = {0,0,0,0}; /* content of CSD register */ +static uint32_t sd_cid[4] = {0,0,0,0}; /* content of CID register */ +static uint16_t sd_rca = 0; /* RCA of SD card */ +static uint32_t transmode = SD_POLLING_MODE; +static uint32_t totalnumber_bytes = 0, stopcondition = 0; +static __IO sd_error_enum transerror = SD_OK; +static __IO uint32_t transend = 0, number_bytes = 0; + +/* check if the command sent error occurs */ +static sd_error_enum cmdsent_error_check(void); +/* check if error occurs for R1 response */ +static sd_error_enum r1_error_check(uint8_t cmdindex); +/* check if error type for R1 response */ +static sd_error_enum r1_error_type_check(uint32_t resp); +/* check if error occurs for R2 response */ +static sd_error_enum r2_error_check(void); +/* check if error occurs for R3 response */ +static sd_error_enum r3_error_check(void); +/* check if error occurs for R6 response */ +static sd_error_enum r6_error_check(uint8_t cmdindex, uint16_t *prca); +/* check if error occurs for R7 response */ +static sd_error_enum r7_error_check(void); + +/* get the state which the card is in */ +static sd_error_enum sd_card_state_get(uint8_t *pcardstate); +/* configure the bus width mode */ +static sd_error_enum sd_bus_width_config(uint32_t buswidth); +/* get the SCR of corresponding card */ +static sd_error_enum sd_scr_get(uint16_t rca, uint32_t *pscr); +/* get the data block size */ +static uint32_t sd_datablocksize_get(uint16_t bytesnumber); + +/* configure the GPIO of SDIO interface */ +static void gpio_config(void); +/* configure the RCU of SDIO and DMA */ +static void rcu_config(void); +/* configure the DMA for SDIO transfer request */ +static void dma_transfer_config(uint32_t *srcbuf, uint32_t bufsize); +/* configure the DMA for SDIO reveive request */ +static void dma_receive_config(uint32_t *dstbuf, uint32_t bufsize); + +/*! + \brief initialize the SD card and make it in standby state + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_init(void) +{ + sd_error_enum status = SD_OK; + /* configure the RCU and GPIO, deinitialize the SDIO */ + rcu_config(); + gpio_config(); + sdio_deinit(); + + /* configure the clock and work voltage */ + status = sd_power_on(); + if(SD_OK != status){ + return status; + } + + /* initialize the card and get CID and CSD of the card */ + status = sd_card_init(); + if(SD_OK != status){ + return status; + } + + /* configure the SDIO peripheral */ + sdio_clock_config(SDIO_SDIOCLKEDGE_RISING, SDIO_CLOCKBYPASS_DISABLE, SDIO_CLOCKPWRSAVE_DISABLE, SD_CLK_DIV_TRANS); + sdio_bus_mode_set(SDIO_BUSMODE_1BIT); + sdio_hardware_clock_disable(); + + return status; +} + +/*! + \brief initialize the card and get CID and CSD of the card + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_card_init(void) +{ + sd_error_enum status = SD_OK; + uint16_t temp_rca = 0x01; + + if(SDIO_POWER_OFF == sdio_power_state_get()){ + status = SD_OPERATION_IMPROPER; + return status; + } + + /* the card is not I/O only card */ + if(SDIO_SECURE_DIGITAL_IO_CARD != cardtype){ + /* send CMD2(SD_CMD_ALL_SEND_CID) to get the CID numbers */ + sdio_command_response_config(SD_CMD_ALL_SEND_CID, (uint32_t)0x0, SDIO_RESPONSETYPE_LONG); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r2_error_check(); + if(SD_OK != status){ + return status; + } + + /* store the CID numbers */ + sd_cid[0] = sdio_response_get(SDIO_RESPONSE0); + sd_cid[1] = sdio_response_get(SDIO_RESPONSE1); + sd_cid[2] = sdio_response_get(SDIO_RESPONSE2); + sd_cid[3] = sdio_response_get(SDIO_RESPONSE3); + } + + /* the card is SD memory card or the I/O card has the memory portion */ + if ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype) || (SDIO_SECURE_DIGITAL_IO_COMBO_CARD == cardtype)){ + /* send CMD3(SEND_RELATIVE_ADDR) to ask the card to publish a new relative address (RCA) */ + sdio_command_response_config(SD_CMD_SEND_RELATIVE_ADDR, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r6_error_check(SD_CMD_SEND_RELATIVE_ADDR, &temp_rca); + if(SD_OK != status){ + return status; + } + } + + if(SDIO_SECURE_DIGITAL_IO_CARD != cardtype){ + /* the card is not I/O only card */ + sd_rca = temp_rca; + + /* send CMD9(SEND_CSD) to get the addressed card's card-specific data (CSD) */ + sdio_command_response_config(SD_CMD_SEND_CSD, (uint32_t)(temp_rca << SD_RCA_SHIFT), SDIO_RESPONSETYPE_LONG); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r2_error_check(); + if(SD_OK != status){ + return status; + } + + /* store the card-specific data (CSD) */ + sd_csd[0] = sdio_response_get(SDIO_RESPONSE0); + sd_csd[1] = sdio_response_get(SDIO_RESPONSE1); + sd_csd[2] = sdio_response_get(SDIO_RESPONSE2); + sd_csd[3] = sdio_response_get(SDIO_RESPONSE3); + } + return status; +} + +/*! + \brief configure the clock and the work voltage, and get the card type + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_power_on(void) +{ + sd_error_enum status = SD_OK; + uint32_t sdcardtype = SD_STD_CAPACITY, response = 0, count = 0; + uint8_t busyflag = 0; + + /* configure the SDIO peripheral */ + sdio_clock_config(SDIO_SDIOCLKEDGE_RISING, SDIO_CLOCKBYPASS_DISABLE, SDIO_CLOCKPWRSAVE_DISABLE, SD_CLK_DIV_INIT); + sdio_bus_mode_set(SDIO_BUSMODE_1BIT); + sdio_hardware_clock_disable(); + sdio_power_state_set(SDIO_POWER_ON); + /* enable SDIO_CLK clock output */ + sdio_clock_enable(); + + /* send CMD0(GO_IDLE_STATE) to reset the card */ + sdio_command_response_config(SD_CMD_GO_IDLE_STATE, (uint32_t)0x0, SDIO_RESPONSETYPE_NO); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + /* enable the CSM */ + sdio_csm_enable(); + + /* check if command sent error occurs */ + status = cmdsent_error_check(); + if(SD_OK != status){ + return status; + } + + /* send CMD8(SEND_IF_COND) to get SD memory card interface condition */ + sdio_command_response_config(SD_CMD_SEND_IF_COND, SD_CHECK_PATTERN, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + if(SD_OK == r7_error_check()){ + /* SD Card 2.0 */ + cardtype = SDIO_STD_CAPACITY_SD_CARD_V2_0; + sdcardtype = SD_HIGH_CAPACITY; + } + + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + if(SD_OK == r1_error_check(SD_CMD_APP_CMD)){ + /* SD memory card */ + while((!busyflag) && (count < SD_MAX_VOLT_VALIDATION)){ + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* send ACMD41(SD_SEND_OP_COND) to get host capacity support information (HCS) and OCR content */ + sdio_command_response_config(SD_APPCMD_SD_SEND_OP_COND, (SD_VOLTAGE_WINDOW | sdcardtype), SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r3_error_check(); + if(SD_OK != status){ + return status; + } + /* get the response and check card power up status bit(busy) */ + response = sdio_response_get(SDIO_RESPONSE0); + busyflag = (uint8_t)((response >> 31)&(uint32_t)0x01); + ++count; + } + if(count >= SD_MAX_VOLT_VALIDATION){ + status = SD_VOLTRANGE_INVALID; + return status; + } + if(response &= SD_HIGH_CAPACITY){ + /* SDHC card */ + cardtype = SDIO_HIGH_CAPACITY_SD_CARD; + } + } + return status; +} + +/*! + \brief close the power of SDIO + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_power_off(void) +{ + sd_error_enum status = SD_OK; + sdio_power_state_set(SDIO_POWER_OFF); + return status; +} + +/*! + \brief configure the bus mode + \param[in] busmode: the bus mode + \arg SDIO_BUSMODE_1BIT: 1-bit SDIO card bus mode + \arg SDIO_BUSMODE_4BIT: 4-bit SDIO card bus mode + \arg SDIO_BUSMODE_8BIT: 8-bit SDIO card bus mode (MMC only) + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_bus_mode_config(uint32_t busmode) +{ + sd_error_enum status = SD_OK; + if(SDIO_MULTIMEDIA_CARD == cardtype){ + /* MMC card doesn't support this function */ + status = SD_FUNCTION_UNSUPPORTED; + return status; + }else if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype)){ + if(SDIO_BUSMODE_8BIT == busmode){ + /* 8 bit bus mode doesn't support */ + status = SD_FUNCTION_UNSUPPORTED; + return status; + }else if(SDIO_BUSMODE_4BIT == busmode){ + /* configure SD bus width and the SDIO */ + status = sd_bus_width_config(SD_BUS_WIDTH_4BIT); + if(SD_OK == status){ + sdio_clock_config(SDIO_SDIOCLKEDGE_RISING, SDIO_CLOCKBYPASS_DISABLE, + SDIO_CLOCKPWRSAVE_DISABLE, SD_CLK_DIV_TRANS); + sdio_bus_mode_set(busmode); + sdio_hardware_clock_disable(); + } + }else if(SDIO_BUSMODE_1BIT == busmode){ + /* configure SD bus width and the SDIO */ + status = sd_bus_width_config(SD_BUS_WIDTH_1BIT); + if(SD_OK == status){ + sdio_clock_config(SDIO_SDIOCLKEDGE_RISING, SDIO_CLOCKBYPASS_DISABLE, + SDIO_CLOCKPWRSAVE_DISABLE, SD_CLK_DIV_TRANS); + sdio_bus_mode_set(busmode); + sdio_hardware_clock_disable(); + } + }else{ + status = SD_PARAMETER_INVALID; + } + } + return status; +} + +/*! + \brief configure the mode of transmission + \param[in] txmode: transfer mode + \arg SD_DMA_MODE: DMA mode + \arg SD_POLLING_MODE: polling mode + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_transfer_mode_config(uint32_t txmode) +{ + sd_error_enum status = SD_OK; + /* set the transfer mode */ + if((SD_DMA_MODE == txmode) || (SD_POLLING_MODE == txmode)){ + transmode = txmode; + }else{ + status = SD_PARAMETER_INVALID; + } + return status; +} + +/*! + \brief read a block data into a buffer from the specified address of a card + \param[out] preadbuffer: a pointer that store a block read data + \param[in] readaddr: the read data address + \param[in] blocksize: the data block size + \retval sd_error_enum +*/ +sd_error_enum sd_block_read(uint32_t *preadbuffer, uint32_t readaddr, uint16_t blocksize) +{ + /* initialize the variables */ + sd_error_enum status = SD_OK; + uint32_t count = 0, align = 0, datablksize = SDIO_DATABLOCKSIZE_1BYTE, *ptempbuff = preadbuffer; + __IO uint32_t timeout = 0; + + if(NULL == preadbuffer){ + status = SD_PARAMETER_INVALID; + return status; + } + + transerror = SD_OK; + transend = 0; + totalnumber_bytes = 0; + /* clear all DSM configuration */ + sdio_data_config(0, 0, SDIO_DATABLOCKSIZE_1BYTE); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_disable(); + sdio_dma_disable(); + + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return status; + } + + /* blocksize is fixed in 512B for SDHC card */ + if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + blocksize = 512; + readaddr /= 512; + } + + align = blocksize & (blocksize - 1); + if((blocksize > 0) && (blocksize <= 2048) && (0 == align)){ + datablksize = sd_datablocksize_get(blocksize); + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)blocksize, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + + stopcondition = 0; + totalnumber_bytes = blocksize; + + /* configure SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, totalnumber_bytes, datablksize); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOSDIO); + sdio_dsm_enable(); + + /* send CMD17(READ_SINGLE_BLOCK) to read a block */ + sdio_command_response_config(SD_CMD_READ_SINGLE_BLOCK, (uint32_t)readaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_READ_SINGLE_BLOCK); + if(SD_OK != status){ + return status; + } + + if(SD_POLLING_MODE == transmode){ + /* polling mode */ + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_RXORE | SDIO_FLAG_DTBLKEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_RFH)){ + /* at least 8 words can be read in the FIFO */ + for(count = 0; count < SD_FIFOHALF_WORDS; count++){ + *(ptempbuff + count) = sdio_data_read(); + } + ptempbuff += SD_FIFOHALF_WORDS; + } + } + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_RXORE)){ + status = SD_RX_OVERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_RXORE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + while(RESET != sdio_flag_get(SDIO_FLAG_RXDTVAL)){ + *ptempbuff = sdio_data_read(); + ++ptempbuff; + } + /* clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + }else if(SD_DMA_MODE == transmode){ + /* DMA mode */ + /* enable the SDIO corresponding interrupts and DMA function */ + sdio_interrupt_enable(SDIO_INT_CCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_RXORE | SDIO_INT_DTEND | SDIO_INT_STBITE); + sdio_dma_enable(); + dma_receive_config(preadbuffer, blocksize); + timeout = 100000; + while((RESET == dma_flag_get(DMA1, DMA_CH3, DMA_FLAG_FTF)) && (timeout > 0)){ + timeout--; + if(0 == timeout){ + return SD_ERROR; + } + } + }else{ + status = SD_PARAMETER_INVALID; + } + return status; +} + +/*! + \brief read multiple blocks data into a buffer from the specified address of a card + \param[out] preadbuffer: a pointer that store multiple blocks read data + \param[in] readaddr: the read data address + \param[in] blocksize: the data block size + \param[in] blocksnumber: number of blocks that will be read + \retval sd_error_enum +*/ +sd_error_enum sd_multiblocks_read(uint32_t *preadbuffer, uint32_t readaddr, uint16_t blocksize, uint32_t blocksnumber) +{ + /* initialize the variables */ + sd_error_enum status = SD_OK; + uint32_t count = 0, align = 0, datablksize = SDIO_DATABLOCKSIZE_1BYTE, *ptempbuff = preadbuffer; + __IO uint32_t timeout = 0; + + if(NULL == preadbuffer){ + status = SD_PARAMETER_INVALID; + return status; + } + + transerror = SD_OK; + transend = 0; + totalnumber_bytes = 0; + /* clear all DSM configuration */ + sdio_data_config(0, 0, SDIO_DATABLOCKSIZE_1BYTE); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_disable(); + sdio_dma_disable(); + + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return status; + } + + /* blocksize is fixed in 512B for SDHC card */ + if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + blocksize = 512; + readaddr /= 512; + } + + align = blocksize & (blocksize - 1); + if((blocksize > 0) && (blocksize <= 2048) && (0 == align)){ + datablksize = sd_datablocksize_get(blocksize); + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)blocksize, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + + if(blocksnumber > 1){ + if(blocksnumber * blocksize > SD_MAX_DATA_LENGTH){ + /* exceeds the maximum length */ + status = SD_PARAMETER_INVALID; + return status; + } + + stopcondition = 1; + totalnumber_bytes = blocksnumber * blocksize; + + /* configure the SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, totalnumber_bytes, datablksize); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOSDIO); + sdio_dsm_enable(); + + /* send CMD18(READ_MULTIPLE_BLOCK) to read multiple blocks */ + sdio_command_response_config(SD_CMD_READ_MULTIPLE_BLOCK, readaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_READ_MULTIPLE_BLOCK); + if(SD_OK != status){ + return status; + } + + if(SD_POLLING_MODE == transmode){ + /* polling mode */ + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_RXORE | SDIO_FLAG_DTEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_RFH)){ + /* at least 8 words can be read in the FIFO */ + for(count = 0; count < SD_FIFOHALF_WORDS; count++){ + *(ptempbuff + count) = sdio_data_read(); + } + ptempbuff += SD_FIFOHALF_WORDS; + } + } + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_RXORE)){ + status = SD_RX_OVERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_RXORE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + while(RESET != sdio_flag_get(SDIO_FLAG_RXDTVAL)){ + *ptempbuff = sdio_data_read(); + ++ptempbuff; + } + + if(RESET != sdio_flag_get(SDIO_FLAG_DTEND)){ + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype)){ + /* send CMD12(STOP_TRANSMISSION) to stop transmission */ + sdio_command_response_config(SD_CMD_STOP_TRANSMISSION, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_STOP_TRANSMISSION); + if(SD_OK != status){ + return status; + } + } + } + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + }else if(SD_DMA_MODE == transmode){ + /* DMA mode */ + /* enable the SDIO corresponding interrupts and DMA function */ + sdio_interrupt_enable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_RXORE | SDIO_INT_DTEND | SDIO_INT_STBITE); + sdio_dma_enable(); + dma_receive_config(preadbuffer, totalnumber_bytes); + + timeout = 100000; + while((RESET == dma_flag_get(DMA1, DMA_CH3, DMA_FLAG_FTF)) && (timeout > 0)){ + timeout--; + if(0 == timeout){ + return SD_ERROR; + } + } + while((0 == transend) && (SD_OK == transerror)){ + } + if(SD_OK != transerror){ + return transerror; + } + }else{ + status = SD_PARAMETER_INVALID; + } + } + return status; +} + +/*! + \brief write a block data to the specified address of a card + \param[in] pwritebuffer: a pointer that store a block data to be transferred + \param[in] writeaddr: the read data address + \param[in] blocksize: the data block size + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_block_write(uint32_t *pwritebuffer, uint32_t writeaddr, uint16_t blocksize) +{ + /* initialize the variables */ + sd_error_enum status = SD_OK; + uint8_t cardstate = 0; + uint32_t count = 0, align = 0, datablksize = SDIO_DATABLOCKSIZE_1BYTE, *ptempbuff = pwritebuffer; + uint32_t transbytes = 0, restwords = 0, response = 0; + __IO uint32_t timeout = 0; + + if(NULL == pwritebuffer){ + status = SD_PARAMETER_INVALID; + return status; + } + + transerror = SD_OK; + transend = 0; + totalnumber_bytes = 0; + /* clear all DSM configuration */ + sdio_data_config(0, 0, SDIO_DATABLOCKSIZE_1BYTE); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_disable(); + sdio_dma_disable(); + + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return status; + } + + /* blocksize is fixed in 512B for SDHC card */ + if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + blocksize = 512; + writeaddr /= 512; + } + + align = blocksize & (blocksize - 1); + if((blocksize > 0) && (blocksize <= 2048) && (0 == align)){ + datablksize = sd_datablocksize_get(blocksize); + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)blocksize, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + + /* send CMD13(SEND_STATUS), addressed card sends its status registers */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + + response = sdio_response_get(SDIO_RESPONSE0); + timeout = 100000; + + while((0 == (response & SD_R1_READY_FOR_DATA)) && (timeout > 0)){ + /* continue to send CMD13 to polling the state of card until buffer empty or timeout */ + --timeout; + /* send CMD13(SEND_STATUS), addressed card sends its status registers */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + response = sdio_response_get(SDIO_RESPONSE0); + } + if(0 == timeout){ + return SD_ERROR; + } + + /* send CMD24(WRITE_BLOCK) to write a block */ + sdio_command_response_config(SD_CMD_WRITE_BLOCK, writeaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_WRITE_BLOCK); + if(SD_OK != status){ + return status; + } + + stopcondition = 0; + totalnumber_bytes = blocksize; + + /* configure the SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, totalnumber_bytes, datablksize); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_enable(); + + if(SD_POLLING_MODE == transmode){ + /* polling mode */ + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_TXURE | SDIO_FLAG_DTBLKEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_TFH)){ + /* at least 8 words can be written into the FIFO */ + if((totalnumber_bytes - transbytes) < SD_FIFOHALF_BYTES){ + restwords = (totalnumber_bytes - transbytes)/4 + (((totalnumber_bytes - transbytes)%4 == 0) ? 0 : 1); + for(count = 0; count < restwords; count++){ + sdio_data_write(*ptempbuff); + ++ptempbuff; + transbytes += 4; + } + }else{ + for(count = 0; count < SD_FIFOHALF_WORDS; count++){ + sdio_data_write(*(ptempbuff + count)); + } + /* 8 words(32 bytes) has been transferred */ + ptempbuff += SD_FIFOHALF_WORDS; + transbytes += SD_FIFOHALF_BYTES; + } + } + } + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_TXURE)){ + status = SD_TX_UNDERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_TXURE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + }else if(SD_DMA_MODE == transmode){ + /* DMA mode */ + /* enable the SDIO corresponding interrupts and DMA */ + sdio_interrupt_enable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_TXURE | SDIO_INT_DTEND | SDIO_INT_STBITE); + dma_transfer_config(pwritebuffer, blocksize); + sdio_dma_enable(); + + timeout = 100000; + while((RESET == dma_flag_get(DMA1, DMA_CH3, DMA_FLAG_FTF)) && (timeout > 0)){ + timeout--; + if(0 == timeout){ + return SD_ERROR; + } + } + while ((0 == transend) && (SD_OK == transerror)){ + } + + if (SD_OK != transerror){ + return transerror; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + + /* clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the card state and wait the card is out of programming and receiving state */ + status = sd_card_state_get(&cardstate); + while((SD_OK == status) && ((SD_CARDSTATE_PROGRAMMING == cardstate) || (SD_CARDSTATE_RECEIVING == cardstate))){ + status = sd_card_state_get(&cardstate); + } + return status; +} + +/*! + \brief write multiple blocks data to the specified address of a card + \param[in] pwritebuffer: a pointer that store multiple blocks data to be transferred + \param[in] writeaddr: the read data address + \param[in] blocksize: the data block size + \param[in] blocksnumber: number of blocks that will be written + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_multiblocks_write(uint32_t *pwritebuffer, uint32_t writeaddr, uint16_t blocksize, uint32_t blocksnumber) +{ + /* initialize the variables */ + sd_error_enum status = SD_OK; + uint8_t cardstate = 0; + uint32_t count = 0, align = 0, datablksize = SDIO_DATABLOCKSIZE_1BYTE, *ptempbuff = pwritebuffer; + uint32_t transbytes = 0, restwords = 0; + __IO uint32_t timeout = 0; + + if(NULL == pwritebuffer){ + status = SD_PARAMETER_INVALID; + return status; + } + + transerror = SD_OK; + transend = 0; + totalnumber_bytes = 0; + /* clear all DSM configuration */ + sdio_data_config(0, 0, SDIO_DATABLOCKSIZE_1BYTE); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_disable(); + sdio_dma_disable(); + + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return status; + } + + /* blocksize is fixed in 512B for SDHC card */ + if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + blocksize = 512; + writeaddr /= 512; + } + + align = blocksize & (blocksize - 1); + if((blocksize > 0) && (blocksize <= 2048) && (0 == align)){ + datablksize = sd_datablocksize_get(blocksize); + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)blocksize, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + + /* send CMD13(SEND_STATUS), addressed card sends its status registers */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + + if(blocksnumber > 1){ + if(blocksnumber * blocksize > SD_MAX_DATA_LENGTH){ + status = SD_PARAMETER_INVALID; + return status; + } + + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype)){ + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* send ACMD23(SET_WR_BLK_ERASE_COUNT) to set the number of write blocks to be preerased before writing */ + sdio_command_response_config(SD_APPCMD_SET_WR_BLK_ERASE_COUNT, blocksnumber, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_APPCMD_SET_WR_BLK_ERASE_COUNT); + if(SD_OK != status){ + return status; + } + } + /* send CMD25(WRITE_MULTIPLE_BLOCK) to continuously write blocks of data */ + sdio_command_response_config(SD_CMD_WRITE_MULTIPLE_BLOCK, writeaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_WRITE_MULTIPLE_BLOCK); + if(SD_OK != status){ + return status; + } + + stopcondition = 1; + totalnumber_bytes = blocksnumber * blocksize; + + /* configure the SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, totalnumber_bytes, datablksize); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_enable(); + + if(SD_POLLING_MODE == transmode){ + /* polling mode */ + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_TXURE | SDIO_FLAG_DTEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_TFH)){ + /* at least 8 words can be written into the FIFO */ + if(!((totalnumber_bytes - transbytes) < SD_FIFOHALF_BYTES)){ + for(count = 0; count < SD_FIFOHALF_WORDS; count++){ + sdio_data_write(*(ptempbuff + count)); + } + /* 8 words(32 bytes) has been transferred */ + ptempbuff += SD_FIFOHALF_WORDS; + transbytes += SD_FIFOHALF_BYTES; + }else{ + restwords = (totalnumber_bytes - transbytes)/4 + (((totalnumber_bytes - transbytes)%4 == 0) ? 0 : 1); + for(count = 0; count < restwords; count++){ + sdio_data_write(*ptempbuff); + ++ptempbuff; + transbytes += 4; + } + } + } + } + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_TXURE)){ + status = SD_TX_UNDERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_TXURE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + + if(RESET != sdio_flag_get(SDIO_FLAG_DTEND)){ + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype)){ + /* send CMD12(STOP_TRANSMISSION) to stop transmission */ + sdio_command_response_config(SD_CMD_STOP_TRANSMISSION, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_STOP_TRANSMISSION); + if(SD_OK != status){ + return status; + } + } + } + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + }else if(SD_DMA_MODE == transmode){ + /* DMA mode */ + /* enable SDIO corresponding interrupts and DMA */ + sdio_interrupt_enable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_TXURE | SDIO_INT_DTEND | SDIO_INT_STBITE); + sdio_dma_enable(); + dma_transfer_config(pwritebuffer, totalnumber_bytes); + + timeout = 100000; + while((RESET == dma_flag_get(DMA1, DMA_CH3, DMA_FLAG_FTF) && (timeout > 0))){ + timeout--; + if(0 == timeout){ + return SD_ERROR; + } + } + while((0 == transend) && (SD_OK == transerror)){ + } + if(SD_OK != transerror){ + return transerror; + } + }else{ + status = SD_PARAMETER_INVALID; + return status; + } + } + + /* clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the card state and wait the card is out of programming and receiving state */ + status = sd_card_state_get(&cardstate); + while((SD_OK == status) && ((SD_CARDSTATE_PROGRAMMING == cardstate) || (SD_CARDSTATE_RECEIVING == cardstate))){ + status = sd_card_state_get(&cardstate); + } + return status; +} + +/*! + \brief erase a continuous area of a card + \param[in] startaddr: the start address + \param[in] endaddr: the end address + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_erase(uint32_t startaddr, uint32_t endaddr) +{ + /* initialize the variables */ + sd_error_enum status = SD_OK; + uint32_t count = 0, clkdiv = 0; + __IO uint32_t delay = 0; + uint8_t cardstate = 0, tempbyte = 0; + uint16_t tempccc = 0; + + /* get the card command classes from CSD */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_24_31BITS) >> 24); + tempccc = (uint16_t)((uint16_t)tempbyte << 4); + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_16_23BITS) >> 16); + tempccc |= (uint16_t)((uint16_t)(tempbyte & 0xF0) >> 4); + if(0 == (tempccc & SD_CCC_ERASE)){ + /* don't support the erase command */ + status = SD_FUNCTION_UNSUPPORTED; + return status; + } + clkdiv = (SDIO_CLKCTL & SDIO_CLKCTL_DIV); + clkdiv += 2; + delay = 108000 / clkdiv; + + /* check whether the card is locked */ + if (sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED) + { + status = SD_LOCK_UNLOCK_FAILED; + return(status); + } + + /* blocksize is fixed in 512B for SDHC card */ + if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + startaddr /= 512; + endaddr /= 512; + } + + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype) || + (SDIO_HIGH_CAPACITY_SD_CARD == cardtype)){ + /* send CMD32(ERASE_WR_BLK_START) to set the address of the first write block to be erased */ + sdio_command_response_config(SD_CMD_ERASE_WR_BLK_START, startaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_ERASE_WR_BLK_START); + if(SD_OK != status){ + return status; + } + + /* send CMD33(ERASE_WR_BLK_END) to set the address of the last write block of the continuous range to be erased */ + sdio_command_response_config(SD_CMD_ERASE_WR_BLK_END, endaddr, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_ERASE_WR_BLK_END); + if(SD_OK != status){ + return status; + } + } + + /* send CMD38(ERASE) to set the address of the first write block to be erased */ + sdio_command_response_config(SD_CMD_ERASE, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_ERASE); + if(SD_OK != status){ + return status; + } + /* loop until the counter is reach to the calculated time */ + for(count = 0; count < delay; count++){ + } + /* get the card state and wait the card is out of programming and receiving state */ + status = sd_card_state_get(&cardstate); + while((SD_OK == status) && ((SD_CARDSTATE_PROGRAMMING == cardstate) || (SD_CARDSTATE_RECEIVING == cardstate))){ + status = sd_card_state_get(&cardstate); + } + return status; +} + +/*! + \brief process all the interrupts which the corresponding flags are set + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_interrupts_process(void) +{ + transerror = SD_OK; + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_DTEND)){ + /* send CMD12 to stop data transfer in multipule blocks operation */ + if(1 == stopcondition){ + transerror = sd_transfer_stop(); + }else{ + transerror = SD_OK; + } + sdio_interrupt_flag_clear(SDIO_INT_DTEND); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + transend = 1; + number_bytes = 0; + return transerror; + } + + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_DTCRCERR)){ + sdio_interrupt_flag_clear(SDIO_INT_DTCRCERR); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + number_bytes = 0; + transerror = SD_DATA_CRC_ERROR; + return transerror; + } + + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_DTTMOUT)){ + sdio_interrupt_flag_clear(SDIO_INT_DTTMOUT); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + number_bytes = 0; + transerror = SD_DATA_TIMEOUT; + return transerror; + } + + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_STBITE)){ + sdio_interrupt_flag_clear(SDIO_INT_STBITE); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + number_bytes = 0; + transerror = SD_START_BIT_ERROR; + return transerror; + } + + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_TXURE)){ + sdio_interrupt_flag_clear(SDIO_INT_TXURE); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + number_bytes = 0; + transerror = SD_TX_UNDERRUN_ERROR; + return transerror; + } + + if(RESET != sdio_interrupt_flag_get(SDIO_INT_FLAG_RXORE)){ + sdio_interrupt_flag_clear(SDIO_INT_RXORE); + /* disable all the interrupts */ + sdio_interrupt_disable(SDIO_INT_DTCRCERR | SDIO_INT_DTTMOUT | SDIO_INT_DTEND | SDIO_INT_STBITE | + SDIO_INT_TFH | SDIO_INT_RFH | SDIO_INT_TXURE | SDIO_INT_RXORE); + number_bytes = 0; + transerror = SD_RX_OVERRUN_ERROR; + return transerror; + } + return transerror; +} + +/*! + \brief select or deselect a card + \param[in] cardrca: the RCA of a card + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_card_select_deselect(uint16_t cardrca) +{ + sd_error_enum status = SD_OK; + /* send CMD7(SELECT/DESELECT_CARD) to select or deselect the card */ + sdio_command_response_config(SD_CMD_SELECT_DESELECT_CARD, (uint32_t)(cardrca << SD_RCA_SHIFT), SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + status = r1_error_check(SD_CMD_SELECT_DESELECT_CARD); + return status; +} + +/*! + \brief get the card status whose response format R1 contains a 32-bit field + \param[in] none + \param[out] pcardstatus: a pointer that store card status + \retval sd_error_enum +*/ +sd_error_enum sd_cardstatus_get(uint32_t *pcardstatus) +{ + sd_error_enum status = SD_OK; + if(NULL == pcardstatus){ + status = SD_PARAMETER_INVALID; + return status; + } + + /* send CMD13(SEND_STATUS), addressed card sends its status register */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + + *pcardstatus = sdio_response_get(SDIO_RESPONSE0); + return status; +} + +/*! + \brief get the SD status, the size of the SD status is one data block of 512 bit + \param[in] none + \param[out] psdstatus: a pointer that store SD card status + \retval sd_error_enum +*/ +sd_error_enum sd_sdstatus_get(uint32_t *psdstatus) +{ + sd_error_enum status = SD_OK; + uint32_t count = 0; + + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return(status); + } + + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)64, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* configure the SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, (uint32_t)64, SDIO_DATABLOCKSIZE_64BYTES); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOSDIO); + sdio_dsm_enable(); + + /* send ACMD13(SD_STATUS) to get the SD status */ + sdio_command_response_config(SD_APPCMD_SD_STATUS, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_APPCMD_SD_STATUS); + if(SD_OK != status){ + return status; + } + + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_RXORE | SDIO_FLAG_DTBLKEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_RFH)){ + for(count = 0; count < SD_FIFOHALF_WORDS; count++){ + *(psdstatus + count) = sdio_data_read(); + } + psdstatus += SD_FIFOHALF_WORDS; + } + } + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_RXORE)){ + status = SD_RX_OVERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_RXORE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + while(RESET != sdio_flag_get(SDIO_FLAG_RXDTVAL)){ + *psdstatus = sdio_data_read(); + ++psdstatus; + } + + /* clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + psdstatus -= 16; + for(count = 0; count < 16; count++){ + psdstatus[count] = ((psdstatus[count] & SD_MASK_0_7BITS) << 24) |((psdstatus[count] & SD_MASK_8_15BITS) << 8) | + ((psdstatus[count] & SD_MASK_16_23BITS) >> 8) |((psdstatus[count] & SD_MASK_24_31BITS) >> 24); + } + return status; +} + +/*! + \brief stop an ongoing data transfer + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_transfer_stop(void) +{ + sd_error_enum status = SD_OK; + /* send CMD12(STOP_TRANSMISSION) to stop transmission */ + sdio_command_response_config(SD_CMD_STOP_TRANSMISSION, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_STOP_TRANSMISSION); + return status; +} + +/*! + \brief lock or unlock a card + \param[in] lockstate: the lock state + \arg SD_LOCK: lock the SD card + \arg SD_UNLOCK: unlock the SD card + \param[out] none + \retval sd_error_enum +*/ +sd_error_enum sd_lock_unlock(uint8_t lockstate) +{ + sd_error_enum status = SD_OK; + uint8_t cardstate = 0, tempbyte = 0; + uint32_t pwd1 = 0, pwd2 = 0, response = 0; + __IO uint32_t timeout = 0; + uint16_t tempccc = 0; + + /* get the card command classes from CSD */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_24_31BITS) >> 24); + tempccc = (uint16_t)((uint16_t)tempbyte << 4); + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_16_23BITS) >> 16); + tempccc |= (uint16_t)((uint16_t)(tempbyte & 0xF0) >> 4); + + if(0 == (tempccc & SD_CCC_LOCK_CARD)){ + /* don't support the lock command */ + status = SD_FUNCTION_UNSUPPORTED; + return status; + } + /* password pattern */ + pwd1 = (0x01020600|lockstate); + pwd2 = 0x03040506; + + /* clear all DSM configuration */ + sdio_data_config(0, 0, SDIO_DATABLOCKSIZE_1BYTE); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_disable(); + sdio_dma_disable(); + + /* send CMD16(SET_BLOCKLEN) to set the block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)8, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + + /* send CMD13(SEND_STATUS), addressed card sends its status register */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + + response = sdio_response_get(SDIO_RESPONSE0); + timeout = 100000; + while((0 == (response & SD_R1_READY_FOR_DATA)) && (timeout > 0)){ + /* continue to send CMD13 to polling the state of card until buffer empty or timeout */ + --timeout; + /* send CMD13(SEND_STATUS), addressed card sends its status registers */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SEND_STATUS); + if(SD_OK != status){ + return status; + } + response = sdio_response_get(SDIO_RESPONSE0); + } + if(0 == timeout){ + return SD_ERROR; + } + + /* send CMD42(LOCK_UNLOCK) to set/reset the password or lock/unlock the card */ + sdio_command_response_config(SD_CMD_LOCK_UNLOCK, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_LOCK_UNLOCK); + if(SD_OK != status){ + return status; + } + + response = sdio_response_get(SDIO_RESPONSE0); + + /* configure the SDIO data transmission */ + sdio_data_config(SD_DATATIMEOUT, (uint32_t)8, SDIO_DATABLOCKSIZE_8BYTES); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOCARD); + sdio_dsm_enable(); + + /* write password pattern */ + sdio_data_write(pwd1); + sdio_data_write(pwd2); + + /* whether some error occurs and return it */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_TXURE)){ + status = SD_TX_UNDERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_TXURE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + + /* clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the card state and wait the card is out of programming and receiving state */ + status = sd_card_state_get(&cardstate); + while((SD_OK == status) && ((SD_CARDSTATE_PROGRAMMING == cardstate) || (SD_CARDSTATE_RECEIVING == cardstate))){ + status = sd_card_state_get(&cardstate); + } + return status; +} + +/*! + \brief get the data transfer state + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +sd_transfer_state_enum sd_transfer_state_get(void) +{ + sd_transfer_state_enum transtate = SD_NO_TRANSFER; + if(RESET != sdio_flag_get(SDIO_FLAG_TXRUN | SDIO_FLAG_RXRUN)){ + transtate = SD_TRANSFER_IN_PROGRESS; + } + return transtate; +} + +/*! + \brief get SD card capacity + \param[in] none + \param[out] none + \retval capacity of the card(KB) +*/ +uint32_t sd_card_capacity_get(void) +{ + uint8_t tempbyte = 0, devicesize_mult = 0, readblklen = 0; + uint32_t capacity = 0, devicesize = 0; + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype)){ + /* calculate the c_size(device size) */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_8_15BITS) >> 8); + devicesize = (uint32_t)((uint32_t)(tempbyte & 0x03) << 10); + tempbyte = (uint8_t)(sd_csd[1] & SD_MASK_0_7BITS); + devicesize |= (uint32_t)((uint32_t)tempbyte << 2); + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_24_31BITS) >> 24); + devicesize |= (uint32_t)((uint32_t)(tempbyte & 0xC0) >> 6); + + /* calculate the c_size_mult(device size multiplier) */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_16_23BITS) >> 16); + devicesize_mult = (tempbyte & 0x03) << 1; + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_8_15BITS) >> 8); + devicesize_mult |= (tempbyte & 0x80) >> 7; + + /* calculate the read_bl_len */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_16_23BITS) >> 16); + readblklen = tempbyte & 0x0F; + + /* capacity = BLOCKNR*BLOCK_LEN, BLOCKNR = (C_SIZE+1)*MULT, MULT = 2^(C_SIZE_MULT+2), BLOCK_LEN = 2^READ_BL_LEN */ + capacity = (devicesize + 1)*(1 << (devicesize_mult + 2)); + capacity *= (1 << readblklen); + + /* change the unit of capacity to KByte */ + capacity /= 1024; + }else if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + /* calculate the c_size */ + tempbyte = (uint8_t)(sd_csd[1] & SD_MASK_0_7BITS); + devicesize = (uint32_t)((uint32_t)(tempbyte & 0x3F) << 16); + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_24_31BITS) >> 24); + devicesize |= (uint32_t)((uint32_t)tempbyte << 8); + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_16_23BITS) >> 16); + devicesize |= (uint32_t)tempbyte; + + /* capacity = (c_size+1)*512KByte */ + capacity = (devicesize + 1)*512; + } + return capacity; +} + +/*! + \brief get the detailed information of the SD card based on received CID and CSD + \param[in] none + \param[out] pcardinfo: a pointer that store the detailed card information + \retval sd_error_enum +*/ +sd_error_enum sd_card_information_get(sd_card_info_struct *pcardinfo) +{ + sd_error_enum status = SD_OK; + uint8_t tempbyte = 0; + + if(NULL == pcardinfo){ + status = SD_PARAMETER_INVALID; + return status; + } + + /* store the card type and RCA */ + pcardinfo->card_type = cardtype; + pcardinfo->card_rca = sd_rca; + + /* CID byte 0 */ + tempbyte = (uint8_t)((sd_cid[0] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_cid.mid = tempbyte; + + /* CID byte 1 */ + tempbyte = (uint8_t)((sd_cid[0] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_cid.oid = (uint16_t)((uint16_t)tempbyte << 8); + + /* CID byte 2 */ + tempbyte = (uint8_t)((sd_cid[0] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_cid.oid |= (uint16_t)tempbyte; + + /* CID byte 3 */ + tempbyte = (uint8_t)(sd_cid[0] & SD_MASK_0_7BITS); + pcardinfo->card_cid.pnm0 = (uint32_t)((uint32_t)tempbyte << 24); + + /* CID byte 4 */ + tempbyte = (uint8_t)((sd_cid[1] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_cid.pnm0 |= (uint32_t)((uint32_t)tempbyte << 16); + + /* CID byte 5 */ + tempbyte = (uint8_t)((sd_cid[1] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_cid.pnm0 |= (uint32_t)((uint32_t)tempbyte << 8); + + /* CID byte 6 */ + tempbyte = (uint8_t)((sd_cid[1] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_cid.pnm0 |= (uint32_t)(tempbyte); + + /* CID byte 7 */ + tempbyte = (uint8_t)(sd_cid[1] & SD_MASK_0_7BITS); + pcardinfo->card_cid.pnm1 = tempbyte; + + /* CID byte 8 */ + tempbyte = (uint8_t)((sd_cid[2] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_cid.prv = tempbyte; + + /* CID byte 9 */ + tempbyte = (uint8_t)((sd_cid[2] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_cid.psn = (uint32_t)((uint32_t)tempbyte << 24); + + /* CID byte 10 */ + tempbyte = (uint8_t)((sd_cid[2] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_cid.psn |= (uint32_t)((uint32_t)tempbyte << 16); + + /* CID byte 11 */ + tempbyte = (uint8_t)(sd_cid[2] & SD_MASK_0_7BITS); + pcardinfo->card_cid.psn |= (uint32_t)tempbyte; + + /* CID byte 12 */ + tempbyte = (uint8_t)((sd_cid[3] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_cid.psn |= (uint32_t)tempbyte; + + /* CID byte 13 */ + tempbyte = (uint8_t)((sd_cid[3] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_cid.mdt = (uint16_t)((uint16_t)(tempbyte & 0x0F) << 8); + + /* CID byte 14 */ + tempbyte = (uint8_t)((sd_cid[3] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_cid.mdt |= (uint16_t)tempbyte; + + /* CID byte 15 */ + tempbyte = (uint8_t)(sd_cid[3] & SD_MASK_0_7BITS); + pcardinfo->card_cid.cid_crc = (tempbyte & 0xFE) >> 1; + + /* CSD byte 0 */ + tempbyte = (uint8_t)((sd_csd[0] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_csd.csd_struct = (tempbyte & 0xC0) >> 6; + + /* CSD byte 1 */ + tempbyte = (uint8_t)((sd_csd[0] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_csd.taac = tempbyte; + + /* CSD byte 2 */ + tempbyte = (uint8_t)((sd_csd[0] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_csd.nsac = tempbyte; + + /* CSD byte 3 */ + tempbyte = (uint8_t)(sd_csd[0] & SD_MASK_0_7BITS); + pcardinfo->card_csd.tran_speed = tempbyte; + + /* CSD byte 4 */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_csd.ccc = (uint16_t)((uint16_t)tempbyte << 4); + + /* CSD byte 5 */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_csd.ccc |= (uint16_t)((uint16_t)(tempbyte & 0xF0) >> 4); + pcardinfo->card_csd.read_bl_len = tempbyte & 0x0F; + + /* CSD byte 6 */ + tempbyte = (uint8_t)((sd_csd[1] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_csd.read_bl_partial = (tempbyte & 0x80) >> 7; + pcardinfo->card_csd.write_blk_misalign = (tempbyte & 0x40) >> 6; + pcardinfo->card_csd.read_blk_misalign = (tempbyte & 0x20) >> 5; + pcardinfo->card_csd.dsp_imp = (tempbyte & 0x10) >> 4; + + if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == cardtype) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == cardtype)){ + /* card is SDSC card, CSD version 1.0 */ + pcardinfo->card_csd.c_size = (uint32_t)((uint32_t)(tempbyte & 0x03) << 10); + + /* CSD byte 7 */ + tempbyte = (uint8_t)(sd_csd[1] & SD_MASK_0_7BITS); + pcardinfo->card_csd.c_size |= (uint32_t)((uint32_t)tempbyte << 2); + + /* CSD byte 8 */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_csd.c_size |= (uint32_t)((uint32_t)(tempbyte & 0xC0) >> 6); + pcardinfo->card_csd.vdd_r_curr_min = (tempbyte & 0x38) >> 3; + pcardinfo->card_csd.vdd_r_curr_max = tempbyte & 0x07; + + /* CSD byte 9 */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_csd.vdd_w_curr_min = (tempbyte & 0xE0) >> 5; + pcardinfo->card_csd.vdd_w_curr_max = (tempbyte & 0x1C) >> 2; + pcardinfo->card_csd.c_size_mult = (tempbyte & 0x03) << 1; + + /* CSD byte 10 */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_csd.c_size_mult |= (tempbyte & 0x80) >> 7; + + /* calculate the card block size and capacity */ + pcardinfo->card_blocksize = 1 << (pcardinfo->card_csd.read_bl_len); + pcardinfo->card_capacity = pcardinfo->card_csd.c_size + 1; + pcardinfo->card_capacity *= (1 << (pcardinfo->card_csd.c_size_mult + 2)); + pcardinfo->card_capacity *= pcardinfo->card_blocksize; + }else if(SDIO_HIGH_CAPACITY_SD_CARD == cardtype){ + /* card is SDHC card, CSD version 2.0 */ + /* CSD byte 7 */ + tempbyte = (uint8_t)(sd_csd[1] & SD_MASK_0_7BITS); + pcardinfo->card_csd.c_size = (uint32_t)((uint32_t)(tempbyte & 0x3F) << 16); + + /* CSD byte 8 */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_csd.c_size |= (uint32_t)((uint32_t)tempbyte << 8); + + /* CSD byte 9 */ + tempbyte = (uint8_t)((sd_csd[2] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_csd.c_size |= (uint32_t)tempbyte; + + /* calculate the card block size and capacity */ + pcardinfo->card_blocksize = 512; + pcardinfo->card_capacity = (pcardinfo->card_csd.c_size + 1) * 512 *1024; + } + + pcardinfo->card_csd.erase_blk_en = (tempbyte & 0x40) >> 6; + pcardinfo->card_csd.sector_size = (tempbyte & 0x3F) << 1; + + /* CSD byte 11 */ + tempbyte = (uint8_t)(sd_csd[2] & SD_MASK_0_7BITS); + pcardinfo->card_csd.sector_size |= (tempbyte & 0x80) >> 7; + pcardinfo->card_csd.wp_grp_size = (tempbyte & 0x7F); + + /* CSD byte 12 */ + tempbyte = (uint8_t)((sd_csd[3] & SD_MASK_24_31BITS) >> 24); + pcardinfo->card_csd.wp_grp_enable = (tempbyte & 0x80) >> 7; + pcardinfo->card_csd.r2w_factor = (tempbyte & 0x1C) >> 2; + pcardinfo->card_csd.write_bl_len = (tempbyte & 0x03) << 2; + + /* CSD byte 13 */ + tempbyte = (uint8_t)((sd_csd[3] & SD_MASK_16_23BITS) >> 16); + pcardinfo->card_csd.write_bl_len |= (tempbyte & 0xC0) >> 6; + pcardinfo->card_csd.write_bl_partial = (tempbyte & 0x20) >> 5; + + /* CSD byte 14 */ + tempbyte = (uint8_t)((sd_csd[3] & SD_MASK_8_15BITS) >> 8); + pcardinfo->card_csd.file_format_grp = (tempbyte & 0x80) >> 7; + pcardinfo->card_csd.copy_flag = (tempbyte & 0x40) >> 6; + pcardinfo->card_csd.perm_write_protect = (tempbyte & 0x20) >> 5; + pcardinfo->card_csd.tmp_write_protect = (tempbyte & 0x10) >> 4; + pcardinfo->card_csd.file_format = (tempbyte & 0x0C) >> 2; + + /* CSD byte 15 */ + tempbyte = (uint8_t)(sd_csd[3] & SD_MASK_0_7BITS); + pcardinfo->card_csd.csd_crc = (tempbyte & 0xFE) >> 1; + + return status; +} + +/*! + \brief check if the command sent error occurs + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum cmdsent_error_check(void) +{ + sd_error_enum status = SD_OK; + __IO uint32_t timeout = 100000; + /* check command sent flag */ + while((RESET == sdio_flag_get(SDIO_FLAG_CMDSEND)) && (timeout > 0)){ + --timeout; + } + /* command response is timeout */ + if(0 == timeout){ + status = SD_CMD_RESP_TIMEOUT; + return status; + } + /* if the command is sent, clear the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + return status; +} + +/*! + \brief check if error type for R1 response + \param[in] resp: content of response + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum r1_error_type_check(uint32_t resp) +{ + sd_error_enum status = SD_ERROR; + /* check which error occurs */ + if(resp & SD_R1_OUT_OF_RANGE){ + status = SD_OUT_OF_RANGE; + }else if(resp & SD_R1_ADDRESS_ERROR){ + status = SD_ADDRESS_ERROR; + }else if(resp & SD_R1_BLOCK_LEN_ERROR){ + status = SD_BLOCK_LEN_ERROR; + }else if(resp & SD_R1_ERASE_SEQ_ERROR){ + status = SD_ERASE_SEQ_ERROR; + }else if(resp & SD_R1_ERASE_PARAM){ + status = SD_ERASE_PARAM; + }else if(resp & SD_R1_WP_VIOLATION){ + status = SD_WP_VIOLATION; + }else if(resp & SD_R1_LOCK_UNLOCK_FAILED){ + status = SD_LOCK_UNLOCK_FAILED; + }else if(resp & SD_R1_COM_CRC_ERROR){ + status = SD_COM_CRC_ERROR; + }else if(resp & SD_R1_ILLEGAL_COMMAND){ + status = SD_ILLEGAL_COMMAND; + }else if(resp & SD_R1_CARD_ECC_FAILED){ + status = SD_CARD_ECC_FAILED; + }else if(resp & SD_R1_CC_ERROR){ + status = SD_CC_ERROR; + }else if(resp & SD_R1_GENERAL_UNKNOWN_ERROR){ + status = SD_GENERAL_UNKNOWN_ERROR; + }else if(resp & SD_R1_CSD_OVERWRITE){ + status = SD_CSD_OVERWRITE; + }else if(resp & SD_R1_WP_ERASE_SKIP){ + status = SD_WP_ERASE_SKIP; + }else if(resp & SD_R1_CARD_ECC_DISABLED){ + status = SD_CARD_ECC_DISABLED; + }else if(resp & SD_R1_ERASE_RESET){ + status = SD_ERASE_RESET; + }else if(resp & SD_R1_AKE_SEQ_ERROR){ + status = SD_AKE_SEQ_ERROR; + } + return status; +} + +/*! + \brief check if error occurs for R1 response + \param[in] cmdindex: the index of command + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum r1_error_check(uint8_t cmdindex) +{ + sd_error_enum status = SD_OK; + uint32_t reg_status = 0, resp_r1 = 0; + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV))){ + reg_status = SDIO_STAT; + } + /* check whether an error or timeout occurs or command response received */ + if(reg_status & SDIO_FLAG_CCRCERR){ + status = SD_CMD_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_CCRCERR); + return status; + }else if(reg_status & SDIO_FLAG_CMDTMOUT){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + + /* check whether the last response command index is the desired one */ + if(sdio_command_index_get() != cmdindex){ + status = SD_ILLEGAL_COMMAND; + return status; + } + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the SDIO response register 0 for checking */ + resp_r1 = sdio_response_get(SDIO_RESPONSE0); + if(SD_ALLZERO == (resp_r1 & SD_R1_ERROR_BITS)){ + /* no error occurs, return SD_OK */ + status = SD_OK; + return status; + } + + /* if some error occurs, return the error type */ + status = r1_error_type_check(resp_r1); + return status; +} + +/*! + \brief check if error occurs for R2 response + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum r2_error_check(void) +{ + sd_error_enum status = SD_OK; + uint32_t reg_status = 0; + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV))){ + reg_status = SDIO_STAT; + } + /* check whether an error or timeout occurs or command response received */ + if(reg_status & SDIO_FLAG_CCRCERR){ + status = SD_CMD_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_CCRCERR); + return status; + }else if(reg_status & SDIO_FLAG_CMDTMOUT){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + return status; +} + +/*! + \brief check if error occurs for R3 response + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum r3_error_check(void) +{ + sd_error_enum status = SD_OK; + uint32_t reg_status = 0; + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV))){ + reg_status = SDIO_STAT; + } + if(reg_status & SDIO_FLAG_CMDTMOUT){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + return status; +} + +/*! + \brief check if error occurs for R6 response + \param[in] cmdindex: the index of command + \param[out] prca: a pointer that store the RCA of card + \retval sd_error_enum +*/ +static sd_error_enum r6_error_check(uint8_t cmdindex, uint16_t *prca) +{ + sd_error_enum status = SD_OK; + uint32_t reg_status = 0, response = 0; + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV))){ + reg_status = SDIO_STAT; + } + /* check whether an error or timeout occurs or command response received */ + if(reg_status & SDIO_FLAG_CCRCERR){ + status = SD_CMD_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_CCRCERR); + return status; + }else if(reg_status & SDIO_FLAG_CMDTMOUT){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + + /* check whether the last response command index is the desired one */ + if(sdio_command_index_get() != cmdindex){ + status = SD_ILLEGAL_COMMAND; + return status; + } + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the SDIO response register 0 for checking */ + response = sdio_response_get(SDIO_RESPONSE0); + + if(SD_ALLZERO == (response & (SD_R6_COM_CRC_ERROR | SD_R6_ILLEGAL_COMMAND | SD_R6_GENERAL_UNKNOWN_ERROR))){ + *prca = (uint16_t)(response >> 16); + return status; + } + /* if some error occurs, return the error type */ + if(response & SD_R6_COM_CRC_ERROR){ + status = SD_COM_CRC_ERROR; + }else if(response & SD_R6_ILLEGAL_COMMAND){ + status = SD_ILLEGAL_COMMAND; + }else if(response & SD_R6_GENERAL_UNKNOWN_ERROR){ + status = SD_GENERAL_UNKNOWN_ERROR; + } + return status; +} + +/*! + \brief check if error occurs for R7 response + \param[in] none + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum r7_error_check(void) +{ + sd_error_enum status = SD_ERROR; + uint32_t reg_status = 0; + __IO uint32_t timeout = 100000; + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV)) && (timeout > 0)){ + reg_status = SDIO_STAT; + --timeout; + } + + /* check the flags */ + if((reg_status & SDIO_FLAG_CMDTMOUT) || (0 == timeout)){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + if(reg_status & SDIO_FLAG_CMDRECV){ + status = SD_OK; + sdio_flag_clear(SDIO_FLAG_CMDRECV); + return status; + } + return status; +} + +/*! + \brief get the state which the card is in + \param[in] none + \param[out] pcardstate: a pointer that store the card state + \arg SD_CARDSTATE_IDLE: card is in idle state + \arg SD_CARDSTATE_READY: card is in ready state + \arg SD_CARDSTATE_IDENTIFICAT: card is in identificat state + \arg SD_CARDSTATE_STANDBY: card is in standby state + \arg SD_CARDSTATE_TRANSFER: card is in transfer state + \arg SD_CARDSTATE_DATA: card is in data state + \arg SD_CARDSTATE_RECEIVING: card is in receiving state + \arg SD_CARDSTATE_PROGRAMMING: card is in programming state + \arg SD_CARDSTATE_DISCONNECT: card is in disconnect state + \arg SD_CARDSTATE_LOCKED: card is in locked state + \retval sd_error_enum +*/ +static sd_error_enum sd_card_state_get(uint8_t *pcardstate) +{ + sd_error_enum status = SD_OK; + __IO uint32_t reg_status = 0, response = 0; + + /* send CMD13(SEND_STATUS), addressed card sends its status register */ + sdio_command_response_config(SD_CMD_SEND_STATUS, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + + /* store the content of SDIO_STAT */ + reg_status = SDIO_STAT; + while(!(reg_status & (SDIO_FLAG_CCRCERR | SDIO_FLAG_CMDTMOUT | SDIO_FLAG_CMDRECV))){ + reg_status = SDIO_STAT; + } + /* check whether an error or timeout occurs or command response received */ + if(reg_status & SDIO_FLAG_CCRCERR){ + status = SD_CMD_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_CCRCERR); + return status; + }else if(reg_status & SDIO_FLAG_CMDTMOUT){ + status = SD_CMD_RESP_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_CMDTMOUT); + return status; + } + + /* command response received, store the response command index */ + reg_status = (uint32_t)sdio_command_index_get(); + if(reg_status != (uint32_t)SD_CMD_SEND_STATUS){ + status = SD_ILLEGAL_COMMAND; + return status; + } + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* get the SDIO response register 0 for checking */ + response = sdio_response_get(SDIO_RESPONSE0); + *pcardstate = (uint8_t)((response >> 9) & 0x0000000F); + + if(SD_ALLZERO == (response & SD_R1_ERROR_BITS)){ + /* no error occurs, return SD_OK */ + status = SD_OK; + return status; + } + + /* if some error occurs, return the error type */ + status = r1_error_type_check(response); + return status; +} + +/*! + \brief configure the bus width mode + \param[in] buswidth: the bus width + \arg SD_BUS_WIDTH_1BIT: 1-bit bus width + \arg SD_BUS_WIDTH_4BIT: 4-bit bus width + \param[out] none + \retval sd_error_enum +*/ +static sd_error_enum sd_bus_width_config(uint32_t buswidth) +{ + sd_error_enum status = SD_OK; + /* check whether the card is locked */ + if(sdio_response_get(SDIO_RESPONSE0) & SD_CARDSTATE_LOCKED){ + status = SD_LOCK_UNLOCK_FAILED; + return status; + } + /* get the SCR register */ + status = sd_scr_get(sd_rca, sd_scr); + if(SD_OK != status){ + return status; + } + + if(SD_BUS_WIDTH_1BIT == buswidth){ + if(SD_ALLZERO != (sd_scr[1] & buswidth)){ + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* send ACMD6(SET_BUS_WIDTH) to define the data bus width */ + sdio_command_response_config(SD_APPCMD_SET_BUS_WIDTH, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_APPCMD_SET_BUS_WIDTH); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_OPERATION_IMPROPER; + } + return status; + }else if(SD_BUS_WIDTH_4BIT == buswidth){ + if(SD_ALLZERO != (sd_scr[1] & buswidth)){ + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)sd_rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* send ACMD6(SET_BUS_WIDTH) to define the data bus width */ + sdio_command_response_config(SD_APPCMD_SET_BUS_WIDTH, (uint32_t)0x2, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_APPCMD_SET_BUS_WIDTH); + if(SD_OK != status){ + return status; + } + }else{ + status = SD_OPERATION_IMPROPER; + } + return status; + }else{ + status = SD_PARAMETER_INVALID; + return status; + } +} + +/*! + \brief get the SCR of corresponding card + \param[in] rca: RCA of a card + \param[out] pscr: a pointer that store the SCR content + \retval sd_error_enum +*/ +static sd_error_enum sd_scr_get(uint16_t rca, uint32_t *pscr) +{ + sd_error_enum status = SD_OK; + uint32_t temp_scr[2] = {0, 0}, idx_scr = 0; + /* send CMD16(SET_BLOCKLEN) to set block length */ + sdio_command_response_config(SD_CMD_SET_BLOCKLEN, (uint32_t)8, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_SET_BLOCKLEN); + if(SD_OK != status){ + return status; + } + + /* send CMD55(APP_CMD) to indicate next command is application specific command */ + sdio_command_response_config(SD_CMD_APP_CMD, (uint32_t)rca << SD_RCA_SHIFT, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_CMD_APP_CMD); + if(SD_OK != status){ + return status; + } + + /* configure SDIO data */ + sdio_data_config(SD_DATATIMEOUT, (uint32_t)8, SDIO_DATABLOCKSIZE_8BYTES); + sdio_data_transfer_config(SDIO_TRANSMODE_BLOCK, SDIO_TRANSDIRECTION_TOSDIO); + sdio_dsm_enable(); + + /* send ACMD51(SEND_SCR) to read the SD configuration register */ + sdio_command_response_config(SD_APPCMD_SEND_SCR, (uint32_t)0x0, SDIO_RESPONSETYPE_SHORT); + sdio_wait_type_set(SDIO_WAITTYPE_NO); + sdio_csm_enable(); + /* check if some error occurs */ + status = r1_error_check(SD_APPCMD_SEND_SCR); + if(SD_OK != status){ + return status; + } + + /* store the received SCR */ + while(!sdio_flag_get(SDIO_FLAG_DTCRCERR | SDIO_FLAG_DTTMOUT | SDIO_FLAG_RXORE | SDIO_FLAG_DTBLKEND | SDIO_FLAG_STBITE)){ + if(RESET != sdio_flag_get(SDIO_FLAG_RXDTVAL)){ + *(temp_scr + idx_scr) = sdio_data_read(); + ++idx_scr; + } + } + + /* check whether some error occurs */ + if(RESET != sdio_flag_get(SDIO_FLAG_DTCRCERR)){ + status = SD_DATA_CRC_ERROR; + sdio_flag_clear(SDIO_FLAG_DTCRCERR); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_DTTMOUT)){ + status = SD_DATA_TIMEOUT; + sdio_flag_clear(SDIO_FLAG_DTTMOUT); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_RXORE)){ + status = SD_RX_OVERRUN_ERROR; + sdio_flag_clear(SDIO_FLAG_RXORE); + return status; + }else if(RESET != sdio_flag_get(SDIO_FLAG_STBITE)){ + status = SD_START_BIT_ERROR; + sdio_flag_clear(SDIO_FLAG_STBITE); + return status; + } + + /* clear all the SDIO_INTC flags */ + sdio_flag_clear(SDIO_MASK_INTC_FLAGS); + /* readjust the temp SCR value */ + *(pscr) = ((temp_scr[1] & SD_MASK_0_7BITS) << 24) | ((temp_scr[1] & SD_MASK_8_15BITS) << 8) | + ((temp_scr[1] & SD_MASK_16_23BITS) >> 8) | ((temp_scr[1] & SD_MASK_24_31BITS) >> 24); + *(pscr + 1) = ((temp_scr[0] & SD_MASK_0_7BITS) << 24) | ((temp_scr[0] & SD_MASK_8_15BITS) << 8) | + ((temp_scr[0] & SD_MASK_16_23BITS) >> 8) | ((temp_scr[0] & SD_MASK_24_31BITS) >> 24); + return status; +} + +/*! + \brief get the data block size + \param[in] bytesnumber: the number of bytes + \param[out] none + \retval data block size + \arg SDIO_DATABLOCKSIZE_1BYTE: block size = 1 byte + \arg SDIO_DATABLOCKSIZE_2BYTES: block size = 2 bytes + \arg SDIO_DATABLOCKSIZE_4BYTES: block size = 4 bytes + \arg SDIO_DATABLOCKSIZE_8BYTES: block size = 8 bytes + \arg SDIO_DATABLOCKSIZE_16BYTES: block size = 16 bytes + \arg SDIO_DATABLOCKSIZE_32BYTES: block size = 32 bytes + \arg SDIO_DATABLOCKSIZE_64BYTES: block size = 64 bytes + \arg SDIO_DATABLOCKSIZE_128BYTES: block size = 128 bytes + \arg SDIO_DATABLOCKSIZE_256BYTES: block size = 256 bytes + \arg SDIO_DATABLOCKSIZE_512BYTES: block size = 512 bytes + \arg SDIO_DATABLOCKSIZE_1024BYTES: block size = 1024 bytes + \arg SDIO_DATABLOCKSIZE_2048BYTES: block size = 2048 bytes + \arg SDIO_DATABLOCKSIZE_4096BYTES: block size = 4096 bytes + \arg SDIO_DATABLOCKSIZE_8192BYTES: block size = 8192 bytes + \arg SDIO_DATABLOCKSIZE_16384BYTES: block size = 16384 bytes +*/ +static uint32_t sd_datablocksize_get(uint16_t bytesnumber) +{ + uint8_t exp_val = 0; + /* calculate the exponent of 2 */ + while(1 != bytesnumber){ + bytesnumber >>= 1; + ++exp_val; + } + return DATACTL_BLKSZ(exp_val); +} + +/*! + \brief configure the GPIO of SDIO interface + \param[in] none + \param[out] none + \retval none +*/ +static void gpio_config(void) +{ + /* configure the PB.8, PB.9, PC.6, PC.7, PC.8, PC.9, PC.10, PC.11, PC.12 and PD.2 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_8 | GPIO_PIN_9); + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_8 | + GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12); + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_2); +} + +/*! + \brief configure the RCU of SDIO and DMA + \param[in] none + \param[out] none + \retval none +*/ +static void rcu_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_GPIOC); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_AF); + + rcu_periph_clock_enable(RCU_SDIO); + rcu_periph_clock_enable(RCU_DMA1); +} + +/*! + \brief configure the DMA1 channel 3 for transferring data + \param[in] srcbuf: a pointer point to a buffer which will be transferred + \param[in] bufsize: the size of buffer(not used in flow controller is peripheral) + \param[out] none + \retval none +*/ +static void dma_transfer_config(uint32_t *srcbuf, uint32_t bufsize) +{ + dma_parameter_struct dma_struct; + /* clear all the interrupt flags */ + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_G); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_FTF); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_HTF); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_ERR); + dma_channel_disable(DMA1, DMA_CH3); + dma_deinit(DMA1, DMA_CH3); + + /* configure the DMA1 channel3 */ + dma_struct.periph_addr = (uint32_t)SDIO_FIFO_ADDR; + dma_struct.memory_addr = (uint32_t)srcbuf; + dma_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_struct.number = bufsize / 4; + dma_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_struct.periph_width = DMA_PERIPHERAL_WIDTH_32BIT; + dma_struct.memory_width = DMA_MEMORY_WIDTH_32BIT; + dma_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA1, DMA_CH3, &dma_struct); + + dma_circulation_disable(DMA1, DMA_CH3); + dma_channel_enable(DMA1, DMA_CH3); +} + +/*! + \brief configure the DMA1 channel 3 for receiving data + \param[in] dstbuf: a pointer point to a buffer which will receive data + \param[in] bufsize: the size of buffer(not used in flow controller is peripheral) + \param[out] none + \retval none +*/ +static void dma_receive_config(uint32_t *dstbuf, uint32_t bufsize) +{ + dma_parameter_struct dma_struct; + /* clear all the interrupt flags */ + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_G); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_FTF); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_HTF); + dma_flag_clear(DMA1, DMA_CH3, DMA_FLAG_ERR); + dma_channel_disable(DMA1, DMA_CH3); + dma_deinit(DMA1, DMA_CH3); + + /* configure the DMA1 channel 3 */ + dma_struct.periph_addr = (uint32_t)SDIO_FIFO_ADDR; + dma_struct.memory_addr = (uint32_t)dstbuf; + dma_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_struct.number = bufsize / 4; + dma_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_struct.periph_width = DMA_PERIPHERAL_WIDTH_32BIT; + dma_struct.memory_width = DMA_MEMORY_WIDTH_32BIT; + dma_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA1, DMA_CH3, &dma_struct); + + dma_circulation_disable(DMA1, DMA_CH3); + dma_channel_enable(DMA1, DMA_CH3); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.h new file mode 100644 index 0000000..1caead0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SDIO/Read_write/sdcard.h @@ -0,0 +1,259 @@ +/*! + \file sdcard.h + \brief the header file of SD card driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SDCARD_H +#define SDCARD_H + +#include "gd32f10x.h" + +/* SD memory card bus commands index */ +#define SD_CMD_GO_IDLE_STATE ((uint8_t)0) /* CMD0, GO_IDLE_STATE */ +#define SD_CMD_ALL_SEND_CID ((uint8_t)2) /* CMD2, ALL_SEND_CID */ +#define SD_CMD_SEND_RELATIVE_ADDR ((uint8_t)3) /* CMD3, SEND_RELATIVE_ADDR */ +#define SD_CMD_SET_DSR ((uint8_t)4) /* CMD4, SET_DSR */ +#define SD_CMD_SWITCH_FUNC ((uint8_t)6) /* CMD6, SWITCH_FUNC */ +#define SD_CMD_SELECT_DESELECT_CARD ((uint8_t)7) /* CMD7, SELECT_DESELECT_CARD */ +#define SD_CMD_SEND_IF_COND ((uint8_t)8) /* CMD8, SEND_IF_COND */ +#define SD_CMD_SEND_CSD ((uint8_t)9) /* CMD9, SEND_CSD */ +#define SD_CMD_SEND_CID ((uint8_t)10) /* CMD10, SEND_CID */ +#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12) /* CMD12, STOP_TRANSMISSION */ +#define SD_CMD_SEND_STATUS ((uint8_t)13) /* CMD13, SEND_STATUS */ +#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15) /* CMD15, GO_INACTIVE_STATE */ +#define SD_CMD_SET_BLOCKLEN ((uint8_t)16) /* CMD16, SET_BLOCKLEN */ +#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17) /* CMD17, READ_SINGLE_BLOCK */ +#define SD_CMD_READ_MULTIPLE_BLOCK ((uint8_t)18) /* CMD18, READ_MULTIPLE_BLOCK */ +#define SD_CMD_WRITE_BLOCK ((uint8_t)24) /* CMD24, WRITE_BLOCK */ +#define SD_CMD_WRITE_MULTIPLE_BLOCK ((uint8_t)25) /* CMD25, WRITE_MULTIPLE_BLOCK */ +#define SD_CMD_PROG_CSD ((uint8_t)27) /* CMD27, PROG_CSD */ +#define SD_CMD_SET_WRITE_PROT ((uint8_t)28) /* CMD28, SET_WRITE_PROT */ +#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29) /* CMD29, CLR_WRITE_PROT */ +#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30) /* CMD30, SEND_WRITE_PROT */ +#define SD_CMD_ERASE_WR_BLK_START ((uint8_t)32) /* CMD32, ERASE_WR_BLK_START */ +#define SD_CMD_ERASE_WR_BLK_END ((uint8_t)33) /* CMD33, ERASE_WR_BLK_END */ +#define SD_CMD_ERASE ((uint8_t)38) /* CMD38, ERASE */ +#define SD_CMD_LOCK_UNLOCK ((uint8_t)42) /* CMD42, LOCK_UNLOCK */ +#define SD_CMD_APP_CMD ((uint8_t)55) /* CMD55, APP_CMD */ +#define SD_CMD_GEN_CMD ((uint8_t)56) /* CMD56, GEN_CMD */ + +/* SD memory card application specific commands index */ +#define SD_APPCMD_SET_BUS_WIDTH ((uint8_t)6) /* ACMD6, SET_BUS_WIDTH */ +#define SD_APPCMD_SD_STATUS ((uint8_t)13) /* ACMD13, SD_STATUS */ +#define SD_APPCMD_SEND_NUM_WR_BLOCKS ((uint8_t)22) /* ACMD22, SEND_NUM_WR_BLOCKS */ +#define SD_APPCMD_SET_WR_BLK_ERASE_COUNT ((uint8_t)23) /* ACMD23, SET_WR_BLK_ERASE_COUNT */ +#define SD_APPCMD_SD_SEND_OP_COND ((uint8_t)41) /* ACMD41, SD_SEND_OP_COND */ +#define SD_APPCMD_SET_CLR_CARD_DETECT ((uint8_t)42) /* ACMD42, SET_CLR_CARD_DETECT */ +#define SD_APPCMD_SEND_SCR ((uint8_t)51) /* ACMD51, SEND_SCR */ + +/* card command class */ +#define SD_CCC_SWITCH BIT(10) /* class 10 */ +#define SD_CCC_IO_MODE BIT(9) /* class 9 */ +#define SD_CCC_APPLICATION_SPECIFIC BIT(8) /* class 8 */ +#define SD_CCC_LOCK_CARD BIT(7) /* class 7 */ +#define SD_CCC_WRITE_PROTECTION BIT(6) /* class 6 */ +#define SD_CCC_ERASE BIT(5) /* class 5 */ +#define SD_CCC_BLOCK_WRITE BIT(4) /* class 4 */ +#define SD_CCC_BLOCK_READ BIT(2) /* class 2 */ +#define SD_CCC_BASIC BIT(0) /* class 0 */ + +/* SD card data transmission mode */ +#define SD_DMA_MODE ((uint32_t)0x00000000) /* DMA mode */ +#define SD_POLLING_MODE ((uint32_t)0x00000001) /* polling mode */ + +/* lock unlock status */ +#define SD_LOCK ((uint8_t)0x05) /* lock the SD card */ +#define SD_UNLOCK ((uint8_t)0x02) /* unlock the SD card */ + +/* supported memory cards types */ +typedef enum +{ + SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0, /* standard capacity SD card version 1.1 */ + SDIO_STD_CAPACITY_SD_CARD_V2_0, /* standard capacity SD card version 2.0 */ + SDIO_HIGH_CAPACITY_SD_CARD, /* high capacity SD card */ + SDIO_SECURE_DIGITAL_IO_CARD, /* secure digital IO card */ + SDIO_SECURE_DIGITAL_IO_COMBO_CARD, /* secure digital IO combo card */ + SDIO_MULTIMEDIA_CARD, /* multimedia card */ + SDIO_HIGH_CAPACITY_MULTIMEDIA_CARD, /* high capacity multimedia card */ + SDIO_HIGH_SPEED_MULTIMEDIA_CARD /* high speed multimedia card */ +}sdio_card_type_enum; + +/* card identification (CID) register */ +typedef struct +{ + __IO uint8_t mid; /* manufacturer ID */ + __IO uint16_t oid; /* OEM/application ID */ + __IO uint32_t pnm0; /* product name */ + __IO uint8_t pnm1; /* product name */ + __IO uint8_t prv; /* product revision */ + __IO uint32_t psn; /* product serial number */ + __IO uint16_t mdt; /* manufacturing date */ + __IO uint8_t cid_crc; /* CID CRC7 checksum */ +}sd_cid_struct; + +/* CSD register (CSD version 1.0 and 2.0) */ +typedef struct +{ + __IO uint8_t csd_struct; /* CSD struct */ + __IO uint8_t taac; /* data read access-time */ + __IO uint8_t nsac; /* data read access-time in CLK cycles */ + __IO uint8_t tran_speed; /* max. data transfer rate */ + __IO uint16_t ccc; /* card command classes */ + __IO uint8_t read_bl_len; /* max. read data block length */ + __IO uint8_t read_bl_partial; /* partial blocks for read allowed */ + __IO uint8_t write_blk_misalign; /* write block misalignment */ + __IO uint8_t read_blk_misalign; /* read block misalignment */ + __IO uint8_t dsp_imp; /* DSR implemented */ + __IO uint32_t c_size; /* device size, 12 bits in CSD version 1.0, 22 bits in CSD version 2.0 */ + __IO uint8_t vdd_r_curr_min; /* max. read current @VDD min, CSD version 1.0 */ + __IO uint8_t vdd_r_curr_max; /* max. read current @VDD max, CSD version 1.0 */ + __IO uint8_t vdd_w_curr_min; /* max. write current @VDD min, CSD version 1.0 */ + __IO uint8_t vdd_w_curr_max; /* max. write current @VDD max, CSD version 1.0 */ + __IO uint8_t c_size_mult; /* device size multiplier, CSD version 1.0 */ + __IO uint8_t erase_blk_en; /* erase single block enable */ + __IO uint8_t sector_size; /* erase sector size */ + __IO uint8_t wp_grp_size; /* write protect group size */ + __IO uint8_t wp_grp_enable; /* write protect group enable */ + __IO uint8_t r2w_factor; /* write speed factor */ + __IO uint8_t write_bl_len; /* max. write data block length */ + __IO uint8_t write_bl_partial; /* partial blocks for write allowed */ + __IO uint8_t file_format_grp; /* file format group */ + __IO uint8_t copy_flag; /* copy flag (OTP) */ + __IO uint8_t perm_write_protect; /* permanent write protection */ + __IO uint8_t tmp_write_protect; /* temporary write protection */ + __IO uint8_t file_format; /* file format */ + __IO uint8_t csd_crc; /* CSD CRC checksum */ +}sd_csd_struct; + +/* information of card */ +typedef struct +{ + sd_cid_struct card_cid; /* CID register */ + sd_csd_struct card_csd; /* CSD register */ + sdio_card_type_enum card_type; /* card tpye */ + uint32_t card_capacity; /* card capacity */ + uint32_t card_blocksize; /* card block size */ + uint16_t card_rca; /* card relative card address */ +}sd_card_info_struct; + +/* SD error flags */ +typedef enum +{ + SD_OUT_OF_RANGE = 0, /* command's argument was out of range */ + SD_ADDRESS_ERROR, /* misaligned address which did not match the block length */ + SD_BLOCK_LEN_ERROR, /* transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */ + SD_ERASE_SEQ_ERROR, /* an error in the sequence of erase command occurs */ + SD_ERASE_PARAM, /* an invalid selection of write-blocks for erase occurred */ + SD_WP_VIOLATION, /* attempt to program a write protect block or permanent write protected card */ + SD_LOCK_UNLOCK_FAILED, /* sequence or password error has been detected in lock/unlock card command */ + SD_COM_CRC_ERROR, /* CRC check of the previous command failed */ + SD_ILLEGAL_COMMAND, /* command not legal for the card state */ + SD_CARD_ECC_FAILED, /* card internal ECC was applied but failed to correct the data */ + SD_CC_ERROR, /* internal card controller error */ + SD_GENERAL_UNKNOWN_ERROR, /* general or unknown error occurred during the operation */ + SD_CSD_OVERWRITE, /* read only section of the CSD does not match the card content or an attempt to reverse the copy or permanent WP bits was made */ + SD_WP_ERASE_SKIP, /* only partial address space was erased or the temporary or permanent write protected card was erased */ + SD_CARD_ECC_DISABLED, /* command has been executed without using internal ECC */ + SD_ERASE_RESET, /* erase sequence was cleared before executing because an out of erase sequence command was received */ + SD_AKE_SEQ_ERROR, /* error in the sequence of the authentication process */ + + SD_CMD_CRC_ERROR, /* command response received (CRC check failed) */ + SD_DATA_CRC_ERROR, /* data block sent/received (CRC check failed) */ + SD_CMD_RESP_TIMEOUT, /* command response timeout */ + SD_DATA_TIMEOUT, /* data timeout */ + SD_TX_UNDERRUN_ERROR, /* transmit FIFO underrun error occurs */ + SD_RX_OVERRUN_ERROR, /* received FIFO overrun error occurs */ + SD_START_BIT_ERROR, /* start bit error in the bus */ + + SD_VOLTRANGE_INVALID, /* the voltage range is invalid */ + SD_PARAMETER_INVALID, /* the parameter is invalid */ + SD_OPERATION_IMPROPER, /* the operation is improper */ + SD_FUNCTION_UNSUPPORTED, /* the function is unsupported */ + SD_ERROR, /* an error occurred */ + SD_OK /* no error occurred */ +}sd_error_enum; + +typedef enum +{ + SD_NO_TRANSFER = 0, /* no data transfer is acting */ + SD_TRANSFER_IN_PROGRESS /* data transfer is in progress */ +}sd_transfer_state_enum; + +extern uint32_t sd_scr[2]; /* SD card SCR */ + +/* function declarations */ +/* initialize the SD card and make it in standby state */ +sd_error_enum sd_init(void); +/* initialize the card and get CID and CSD of the card */ +sd_error_enum sd_card_init(void); +/* configure the clock and the work voltage, and get the card type */ +sd_error_enum sd_power_on(void); +/* close the power of SDIO */ +sd_error_enum sd_power_off(void); + +/* configure the bus mode */ +sd_error_enum sd_bus_mode_config(uint32_t busmode); +/* configure the mode of transmission */ +sd_error_enum sd_transfer_mode_config(uint32_t txmode); + +/* read a block data into a buffer from the specified address of a card */ +sd_error_enum sd_block_read(uint32_t *preadbuffer, uint32_t readaddr, uint16_t blocksize); +/* read multiple blocks data into a buffer from the specified address of a card */ +sd_error_enum sd_multiblocks_read(uint32_t *preadbuffer, uint32_t readaddr, uint16_t blocksize, uint32_t blocksnumber); +/* write a block data to the specified address of a card */ +sd_error_enum sd_block_write(uint32_t *pwritebuffer, uint32_t writeaddr, uint16_t blocksize); +/* write multiple blocks data to the specified address of a card */ +sd_error_enum sd_multiblocks_write(uint32_t *pwritebuffer, uint32_t writeaddr, uint16_t blocksize, uint32_t blocksnumber); +/* erase a continuous area of a card */ +sd_error_enum sd_erase(uint32_t startaddr, uint32_t endaddr); +/* process all the interrupts which the corresponding flags are set */ +sd_error_enum sd_interrupts_process(void); + +/* select or deselect a card */ +sd_error_enum sd_card_select_deselect(uint16_t cardrca); +/* get the card status whose response format R1 contains a 32-bit field */ +sd_error_enum sd_cardstatus_get(uint32_t *pcardstatus); +/* get the SD status, the size of the SD status is one data block of 512 bit */ +sd_error_enum sd_sdstatus_get(uint32_t *psdstatus); +/* stop an ongoing data transfer */ +sd_error_enum sd_transfer_stop(void); +/* lock or unlock a card */ +sd_error_enum sd_lock_unlock(uint8_t lockstate); + +/* get the data transfer state */ +sd_transfer_state_enum sd_transfer_state_get(void); +/* get SD card capacity(KB) */ +uint32_t sd_card_capacity_get(void); +/* get the detailed information of the SD card based on received CID and CSD */ +sd_error_enum sd_card_information_get(sd_card_info_struct *pcardinfo); + +#endif /* SDCARD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/main.c new file mode 100644 index 0000000..e50d82b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/main.c @@ -0,0 +1,261 @@ +/*! + \file main.c + \brief I2S master send and slave receive communication using DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define ARRAYSIZE 10 + +uint16_t i2s1_send_array[ARRAYSIZE] = {0xAAB1, 0xAAB2, 0xAAB3, 0xAAB4, 0xAAB5, 0xAAB6, 0xAAB7, 0xAAB8, 0xAAB9, 0xAABA}; +uint16_t i2s2_receive_array[ARRAYSIZE]; +uint32_t send_n = 0, receive_n = 0; +ErrStatus hxtal_stabilization; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void spi_config(void); +ErrStatus memory_compare(uint16_t *src, uint16_t *dst, uint8_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LED */ + gd_eval_led_init(LED2); + + /* enable peripheral clock */ + rcu_config(); + /* configure GPIO */ + gpio_config(); + /* configure DMA */ + dma_config(); + /* configure SPI */ + spi_config(); + + /* enable SPI DMA */ + spi_dma_enable(SPI2, SPI_DMA_RECEIVE); + spi_dma_enable(SPI1, SPI_DMA_TRANSMIT); + + /* enable DMA channel */ + /* I2S1_Rx DMA channel */ + dma_channel_enable(DMA1, DMA_CH0); + /* I2S1_Tx DMA channel */ + dma_channel_enable(DMA0, DMA_CH4); + + /* enable SPI */ + i2s_enable(SPI2); + i2s_enable(SPI1); + + /* wait DMA transmit completed */ + while(!dma_flag_get(DMA0, DMA_CH4, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA1, DMA_CH0, DMA_FLAG_FTF)) { + } + + /* compare receive data with send data */ + if(ERROR != memory_compare(i2s2_receive_array, i2s1_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + + while(1); +} + +/*! + \brief configure different peripheral clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* deinitialize the RCU */ + rcu_deinit(); + + /* turn on the oscillator HXTAL */ + rcu_osci_on(RCU_HXTAL); + hxtal_stabilization = rcu_osci_stab_wait(RCU_HXTAL); + if(SUCCESS == hxtal_stabilization) { + /* AHB = SYSCLK */ + rcu_ahb_clock_config(RCU_AHB_CKSYS_DIV1); + /* APB1 = AHB/2 */ + rcu_apb1_clock_config(RCU_APB1_CKAHB_DIV2); + /* APB2 = AHB/1 */ + rcu_apb2_clock_config(RCU_APB2_CKAHB_DIV1); + /* CK_PLL1 = 25M */ + rcu_predv1_config(RCU_PREDV1_DIV8); + rcu_pll1_config(RCU_PLL1_MUL8); + /* turn on the oscillator PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + while(ERROR == rcu_osci_stab_wait(RCU_PLL1_CK)); + /* CK_PLL = 25M *3 = 75M*/ + rcu_predv0_config(RCU_PREDV0SRC_CKPLL1, RCU_PREDV0_DIV1); + rcu_pll_config(RCU_PLLSRC_HXTAL, RCU_PLL_MUL3); + /* CK_PLL2 = 25/8*14 M= 43.75M*/ + rcu_pll2_config(RCU_PLL2_MUL14); + /* turn on the oscillator PLL1 */ + rcu_osci_on(RCU_PLL2_CK); + while(ERROR == rcu_osci_stab_wait(RCU_PLL2_CK)); + /* configure the I2S1/I2S2 clock source selection */ + rcu_i2s1_clock_config(RCU_I2S1SRC_CKPLL2_MUL2); + rcu_i2s2_clock_config(RCU_I2S2SRC_CKPLL2_MUL2); + } + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + /* wait till PLL is ready */ + while(ERROR == rcu_osci_stab_wait(RCU_PLL_CK)); + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()); + + /* enable I2S1 clock */ + rcu_periph_clock_enable(RCU_SPI1); + /* enable I2S2 clock */ + rcu_periph_clock_enable(RCU_SPI2); + /* enable GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + /* enable GPIOB clock */ + rcu_periph_clock_enable(RCU_GPIOB); + /* enable GPIOC clock */ + rcu_periph_clock_enable(RCU_GPIOC); + /* enable AF clock */ + rcu_periph_clock_enable(RCU_AF); + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* enable DMA1 clock */ + rcu_periph_clock_enable(RCU_DMA1); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure I2S1 GPIO: I2S1_WS/PB12, I2S1_CK/PB13, I2S_SD/PB15 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_15); + + /* configure I2S2 GPIO: I2S2_WS/PA4, I2S2_CK/PC10, I2S2_SD/PC12 */ + gpio_pin_remap_config(GPIO_SPI2_REMAP, ENABLE); + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10 | GPIO_PIN_12); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_4); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + dma_struct_para_init(&dma_init_struct); + + /* configure I2S1 transmit DMA: DMA0, DMA_CH4 */ + dma_deinit(DMA0, DMA_CH4); + + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI1); + dma_init_struct.memory_addr = (uint32_t)i2s1_send_array; + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_init_struct.priority = DMA_PRIORITY_LOW; + dma_init_struct.number = ARRAYSIZE; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH4); + dma_memory_to_memory_disable(DMA0, DMA_CH4); + + /* configure I2S2 receive DMA: DMA1, DMA_CH0 */ + dma_deinit(DMA1, DMA_CH0); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI2); + dma_init_struct.memory_addr = (uint32_t)i2s2_receive_array; + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA1, DMA_CH0, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA1, DMA_CH0); + dma_memory_to_memory_disable(DMA1, DMA_CH0); +} + +/*! + \brief configure the SPI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + /* reset I2S1/I2S2 */ + spi_i2s_deinit(SPI1); + spi_i2s_deinit(SPI2); + + /* configure I2S1 */ + i2s_init(SPI1, I2S_MODE_MASTERTX, I2S_STD_PHILLIPS, I2S_CKPL_LOW); + i2s_psc_config(SPI1, I2S_AUDIOSAMPLE_44K, I2S_FRAMEFORMAT_DT16B_CH16B, I2S_MCKOUT_DISABLE); + + /* configure I2S2 */ + i2s_init(SPI2, I2S_MODE_SLAVERX, I2S_STD_PHILLIPS, I2S_CKPL_LOW); + i2s_psc_config(SPI2, I2S_AUDIOSAMPLE_44K, I2S_FRAMEFORMAT_DT16B_CH16B, I2S_MCKOUT_DISABLE); +} + +/*! + \brief memory compare function + \param[in] src: source data pointer + \param[in] dst: destination data pointer + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint16_t *src, uint16_t *dst, uint8_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/readme.txt new file mode 100644 index 0000000..8c59f3e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/I2S_master_transmit_slave_receive_dma/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of I2S master send and slave receive communication using DMA demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL board, it shows I2S1 master send and I2S2 slave +receive communication by using DMA mode. After the communication is completed, if data received +is equal to data transmitted, LED2 turns on, if not LED2 turns off. + + Connect I2S1 WS PIN(PB12) to I2S2 WS PIN(PA4). + Connect I2S1 CK PIN(PB13) to I2S2 CK PIN(PC10). + Connect I2S1 SD PIN(PB15) to I2S2 SD PIN(PC12). diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/main.c new file mode 100644 index 0000000..225345d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/main.c @@ -0,0 +1,290 @@ +/*! + \file main.c + \brief SPI fullduplex communication use DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define SPI_CRC_ENABLE 1 +#define ARRAYSIZE 10 + +uint8_t spi0_send_array[ARRAYSIZE] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA}; +uint8_t spi2_send_array[ARRAYSIZE] = {0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA}; +uint8_t spi0_receive_array[ARRAYSIZE]; +uint8_t spi2_receive_array[ARRAYSIZE]; + +uint32_t send_n = 0, receive_n = 0; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void spi_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* enable peripheral clock */ + rcu_config(); + /* configure GPIO */ + gpio_config(); + /* configure DMA */ + dma_config(); + /* configure SPI */ + spi_config(); + + /* enable SPI */ + spi_enable(SPI2); + spi_enable(SPI0); + + /* enable DMA channel */ + /* SPI0_Rx DMA channel */ + dma_channel_enable(DMA0, DMA_CH1); + /* SPI0_Tx DMA channel */ + dma_channel_enable(DMA0, DMA_CH2); + /* SPI2_Rx DMA channel */ + dma_channel_enable(DMA1, DMA_CH0); + /* SPI2_Tx DMA channel */ + dma_channel_enable(DMA1, DMA_CH1); + + /* enable SPI DMA */ + spi_dma_enable(SPI2, SPI_DMA_TRANSMIT); + spi_dma_enable(SPI2, SPI_DMA_RECEIVE); + spi_dma_enable(SPI0, SPI_DMA_TRANSMIT); + spi_dma_enable(SPI0, SPI_DMA_RECEIVE); + + /* wait DMA transmit completed */ + while(!dma_flag_get(DMA0, DMA_CH2, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA1, DMA_CH1, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA0, DMA_CH1, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA1, DMA_CH0, DMA_FLAG_FTF)) { + } + +#if SPI_CRC_ENABLE + /* check the CRC error status */ + if(SET != spi_i2s_flag_get(SPI0, SPI_FLAG_CRCERR)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + + if(SET != spi_i2s_flag_get(SPI2, SPI_FLAG_CRCERR)) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } +#else + /* compare receive data with send data */ + if(ERROR != memory_compare(spi2_receive_array, spi0_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + if(ERROR != memory_compare(spi0_receive_array, spi2_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } +#endif /* enable CRC function */ + + while(1) { + } +} + +/*! + \brief configure different peripheral clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOC); + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(RCU_DMA0); + rcu_periph_clock_enable(RCU_DMA1); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_SPI2); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* config SPI0 GPIO: SCK/PA5, MISO/PA6, MOSI/PA7 */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /* config SPI2 GPIO: SCK/PC10, MISO/PC11, MOSI/PC12 */ + gpio_pin_remap_config(GPIO_SPI2_REMAP, ENABLE); + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10 | GPIO_PIN_12); + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + + dma_struct_para_init(&dma_init_struct); + + /* configure SPI0 transmit DMA:DMA0-DMA_CH2 */ + dma_deinit(DMA0, DMA_CH2); + + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI0); + dma_init_struct.memory_addr = (uint32_t)spi0_send_array; + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_LOW; + dma_init_struct.number = ARRAYSIZE; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init(DMA0, DMA_CH2, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH2); + dma_memory_to_memory_disable(DMA0, DMA_CH2); + + /* configure SPI2 transmit DMA: DMA1,DMA_CH1 */ + dma_deinit(DMA1, DMA_CH1); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI2); + dma_init_struct.memory_addr = (uint32_t)spi2_send_array; + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.priority = DMA_PRIORITY_MEDIUM; + dma_init(DMA1, DMA_CH1, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA1, DMA_CH1); + dma_memory_to_memory_disable(DMA1, DMA_CH1); + /* configure SPI0 receive DMA: DMA0-DMA_CH1 */ + dma_deinit(DMA0, DMA_CH1); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI0); + dma_init_struct.memory_addr = (uint32_t)spi0_receive_array; + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH1, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH1); + dma_memory_to_memory_disable(DMA0, DMA_CH1); + + /* configure SPI2 receive DMA: DMA1,DMA_CH0 */ + dma_deinit(DMA1, DMA_CH0); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI2); + dma_init_struct.memory_addr = (uint32_t)spi2_receive_array; + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; +#if SPI_CRC_ENABLE + dma_init_struct.number = ARRAYSIZE + 1; +#endif /* enable CRC function */ + dma_init(DMA1, DMA_CH0, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA1, DMA_CH0); + dma_memory_to_memory_disable(DMA1, DMA_CH0); +} + +/*! + \brief configure the SPI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + spi_parameter_struct spi_init_struct; + /* deinitilize SPI and the parameters */ + spi_i2s_deinit(SPI0); + spi_i2s_deinit(SPI2); + spi_struct_para_init(&spi_init_struct); + + /* configure SPI0 parameter */ + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_struct.device_mode = SPI_MASTER; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_8; + spi_init_struct.endian = SPI_ENDIAN_MSB; + spi_init(SPI0, &spi_init_struct); + + /* configure SPI2 parameter */ + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_struct.device_mode = SPI_SLAVE; + spi_init(SPI2, &spi_init_struct); + +#if SPI_CRC_ENABLE + /* configure SPI CRC function */ + spi_crc_polynomial_set(SPI0, 7); + spi_crc_polynomial_set(SPI2, 7); + spi_crc_on(SPI0); + spi_crc_on(SPI2); +#endif /* enable CRC function */ +} + +/*! + \brief memory compare function + \param[in] src: source data pointer + \param[in] dst: destination data pointer + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/readme.txt new file mode 100644 index 0000000..370671a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_dma/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief description of the master and slave fullduplex communication use dma demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + This example is based on the GD32107C-EVAL board, it shows SPI0 and SPI2 full-duplex +communication use DMA mode. + + 1.Modify file: example/SPI/SPI_master_slave_fullduplex_dma/main.c, choose to disable +CRC function. + #define SPI_CRC_ENABLE 0 + After the communicate is completed, if received data equal to the data sent, LED2 and +LED3 turn on, if not, LED2 and LED3 turn off. + + 2.Modify file: example/SPI/SPI_master_slave_fullduplex_dma/main.c, choose to enable +CRC function. + #define SPI_CRC_ENABLE 1 + After the communication is completed, if the CRC checking is passed, LED2 and LED3 turn +on, and if not, LED2 and LED3 turn off. + + Connect SPI0 SCK PIN(PA5) to SPI2 SCK PIN(PC10). + Connect SPI0 MISO PIN(PA6) to SPI2 MISO PIN(PC11). + Connect SPI0 MOSI PIN(PA7) to SPI2 MOSI PIN(PC12). diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/main.c new file mode 100644 index 0000000..98a9fb1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/main.c @@ -0,0 +1,258 @@ +/*! + \file main.c + \brief SPI fullduplex communication use polling mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define SPI_CRC_ENABLE 1 +#define ARRAYSIZE 10 + +uint8_t spi0_send_array[ARRAYSIZE] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA}; +uint8_t spi2_send_array[ARRAYSIZE] = {0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA}; +uint8_t spi0_receive_array[ARRAYSIZE]; +uint8_t spi2_receive_array[ARRAYSIZE]; +uint32_t send_n = 0, receive_n = 0; +uint32_t crc_value1 = 0, crc_value2 = 0; + +void rcu_config(void); +void gpio_config(void); +void spi_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + /* enable peripheral clock */ + rcu_config(); + /* configure GPIO */ + gpio_config(); + /* configure SPI */ + spi_config(); + /* enable SPI */ + spi_enable(SPI2); + spi_enable(SPI0); + +#if SPI_CRC_ENABLE + /* wait for transmit completed */ + while(send_n < ARRAYSIZE) { + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI2, spi2_send_array[send_n]); + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI0, spi0_send_array[send_n++]); + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_RBNE)) { + } + spi2_receive_array[receive_n] = spi_i2s_data_receive(SPI2); + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_RBNE)) { + } + spi0_receive_array[receive_n++] = spi_i2s_data_receive(SPI0); + } + + /* send the last data */ + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI2, spi2_send_array[send_n]); + + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI0, spi0_send_array[send_n++]); + + /* send the CRC value */ + spi_crc_next(SPI2); + spi_crc_next(SPI0); + + /* receive the last data */ + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_RBNE)) { + } + spi0_receive_array[receive_n] = spi_i2s_data_receive(SPI0); + + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_RBNE)) { + } + spi2_receive_array[receive_n++] = spi_i2s_data_receive(SPI2); + + /* receive the CRC value */ + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_RBNE)) { + } + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_RBNE)) { + } + crc_value1 = spi_i2s_data_receive(SPI0); + crc_value2 = spi_i2s_data_receive(SPI2); + + /* check the CRC error status */ + if(SET != spi_i2s_flag_get(SPI0, SPI_FLAG_CRCERR)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + + if(SET != spi_i2s_flag_get(SPI2, SPI_FLAG_CRCERR)) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } +#else + /* wait for transmit completed */ + while(send_n < ARRAYSIZE) { + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI2, spi2_send_array[send_n]); + + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_TBE)) { + } + spi_i2s_data_transmit(SPI0, spi0_send_array[send_n++]); + + while(RESET == spi_i2s_flag_get(SPI2, SPI_FLAG_RBNE)) { + } + spi2_receive_array[receive_n] = spi_i2s_data_receive(SPI2); + + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_RBNE)) { + } + spi0_receive_array[receive_n++] = spi_i2s_data_receive(SPI0); + } + + /* compare receive data with send data */ + if(ERROR != memory_compare(spi2_receive_array, spi0_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + + if(ERROR != memory_compare(spi0_receive_array, spi2_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } +#endif /* enable CRC function */ + + while(1) { + } +} + +/*! + \brief configure different peripheral clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOC); + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_SPI2); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure SPI0 GPIO: SCK/PA5, MISO/PA6, MOSI/PA7 */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /* configure SPI2 GPIO: SCK/PC10, MISO/PC11, MOSI/PC12 */ + gpio_pin_remap_config(GPIO_SPI2_REMAP, ENABLE); + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10 | GPIO_PIN_12); + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); +} + +/*! + \brief configure the SPI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + spi_parameter_struct spi_init_struct; + /* deinitilize SPI and the parameters */ + spi_i2s_deinit(SPI0); + spi_i2s_deinit(SPI2); + spi_struct_para_init(&spi_init_struct); + + /* configure SPI0 parameter */ + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_struct.device_mode = SPI_MASTER; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_32; + spi_init_struct.endian = SPI_ENDIAN_MSB; + spi_init(SPI0, &spi_init_struct); + + /* configure SPI2 parameter */ + spi_init_struct.device_mode = SPI_SLAVE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init(SPI2, &spi_init_struct); + +#if SPI_CRC_ENABLE + /* configure SPI CRC function */ + spi_crc_polynomial_set(SPI0, 7); + spi_crc_polynomial_set(SPI2, 7); + spi_crc_on(SPI0); + spi_crc_on(SPI2); +#endif /* enable CRC function */ +} + +/*! + \brief memory compare function + \param[in] src: source data pointer + \param[in] dst: destination data pointer + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/readme.txt new file mode 100644 index 0000000..df2ba7c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_fullduplex_polling/readme.txt @@ -0,0 +1,52 @@ +/*! + \file readme.txt + \brief description of the master and slave fullduplex communication use polling demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL board, it shows SPI0 and SPI2 full-duplex +communication using polling mode. + + 1.Modify file: example/SPI/SPI_master_slave_fullduplex_polling/main.c, choose to disable +CRC function. + #define SPI_CRC_ENABLE 0 + After the communicate is completed, if the data received equal to the data sent, LED2 and LED3 +turn on, if not LED2 and LED3 turn off. + + 2.Modify file: example/SPI/SPI_master_slave_fullduplex_polling/main.c, choose to enable +CRC function. + #define SPI_CRC_ENABLE 1 + After the communication is completed, if the CRC checking is passed, LED2 and LED3 turn +on, and if not, LED2 and LED3 turn off. + + Connect SPI0 SCK PIN(PA5) TO SPI2 SCK PIN(PC10). + Connect SPI0 MISO PIN(PA6) TO SPI2 MISO PIN(PC11). + Connect SPI0 MOSI PIN(PA7) TO SPI2 MOSI PIN(PC12). diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..1727d82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/main.c new file mode 100644 index 0000000..d21b4d5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/main.c @@ -0,0 +1,310 @@ +/*! + \file main.c + \brief SPI simplex communication use DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define MASTER_TRANSMIT_SLVAE_RECEIVE +//#define SLAVE_TRANSMIT_MASTER_RECEIVE + +#define ARRAYSIZE 10 + +#define SET_SPI2_NSS_HIGH gpio_bit_set(GPIOA,GPIO_PIN_2); +#define SET_SPI2_NSS_LOW gpio_bit_reset(GPIOA,GPIO_PIN_2); + +uint8_t spi0_send_array[ARRAYSIZE] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA}; +uint8_t spi2_send_array[ARRAYSIZE] = {0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA}; +uint8_t spi0_receive_array[ARRAYSIZE]; +uint8_t spi2_receive_array[ARRAYSIZE]; + +uint32_t send_n = 0, receive_n = 0; + +void rcu_config(void); +void gpio_config(void); +void dma_config(void); +void spi_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* enable peripheral clock */ + rcu_config(); + /* configure GPIO */ + gpio_config(); + + SET_SPI2_NSS_HIGH + + /* configure DMA */ + dma_config(); + /* configure SPI */ + spi_config(); + +#ifdef MASTER_TRANSMIT_SLVAE_RECEIVE + /* enable DMA channel */ + /* SPI0_Tx DMA channel */ + dma_channel_enable(DMA0, DMA_CH2); + /* SPI2_Rx DMA channel */ + dma_channel_enable(DMA1, DMA_CH0); + + /* enable SPI DMA */ + spi_dma_enable(SPI2, SPI_DMA_RECEIVE); + spi_dma_enable(SPI0, SPI_DMA_TRANSMIT); +#endif /* master send and slave receive */ + +#ifdef SLAVE_TRANSMIT_MASTER_RECEIVE + /* enable DMA channel */ + /* SPI0_Rx DMA channel */ + dma_channel_enable(DMA0, DMA_CH1); + /* SPI2_Tx DMA channel */ + dma_channel_enable(DMA1, DMA_CH1); + /* enable SPI DMA */ + spi_dma_enable(SPI2, SPI_DMA_TRANSMIT); + spi_dma_enable(SPI0, SPI_DMA_RECEIVE); +#endif /* slave send and master receive */ + + /* enable SPI */ + spi_enable(SPI2); + spi_enable(SPI0); + + SET_SPI2_NSS_LOW + +#ifdef MASTER_TRANSMIT_SLVAE_RECEIVE + /* wait DMA transmit completed */ + while(!dma_flag_get(DMA0, DMA_CH2, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA1, DMA_CH0, DMA_FLAG_FTF)) { + } + + /* compare receive data with send data */ + if(ERROR != memory_compare(spi2_receive_array, spi0_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } +#endif /* master send and slave receive */ + +#ifdef SLAVE_TRANSMIT_MASTER_RECEIVE + /* wait DMA transmit completed */ + while(!dma_flag_get(DMA0, DMA_CH1, DMA_FLAG_FTF)) { + } + while(!dma_flag_get(DMA1, DMA_CH1, DMA_FLAG_FTF)) { + } + + /* compare receive data with send data */ + if(ERROR != memory_compare(spi0_receive_array, spi2_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } +#endif /* slave send and master receive */ + + SET_SPI2_NSS_HIGH + + /* disable SPI */ + spi_disable(SPI2); + spi_disable(SPI0); + + while(1) { + } +} + +/*! + \brief configure different peripheral clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOC); + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(RCU_DMA0); + rcu_periph_clock_enable(RCU_DMA1); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_SPI2); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure SPI0 GPIO: SCK/PA5, MISO/PA6, MOSI/PA7 */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + /* set GPIO PA2 as SPI0 NSS output */ + gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + + /* configure SPI2 GPIO: SCK/PC10, MISO/PC11, MOSI/PC12, NSS/PA4 */ + gpio_pin_remap_config(GPIO_SPI2_REMAP, ENABLE); + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10 | GPIO_PIN_12); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_4); + gpio_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); +} + +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + dma_struct_para_init(&dma_init_struct); + + /* configure SPI0 transmit dma: DMA0-DMA_CH2 */ + dma_deinit(DMA0, DMA_CH2); + + + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI0); + dma_init_struct.memory_addr = (uint32_t)spi0_send_array; + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_LOW; + dma_init_struct.number = ARRAYSIZE; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init(DMA0, DMA_CH2, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH2); + dma_memory_to_memory_disable(DMA0, DMA_CH2); + + /* configure SPI0 receive DMA: DMA0-DMA_CH1 */ + dma_deinit(DMA0, DMA_CH1); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI0); + dma_init_struct.memory_addr = (uint32_t)spi0_receive_array; + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH1, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH1); + dma_memory_to_memory_disable(DMA0, DMA_CH1); + + /* configure SPI2 transmit DMA: DMA1-DMA_CH1 */ + dma_deinit(DMA1, DMA_CH1); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI2); + dma_init_struct.memory_addr = (uint32_t)spi2_send_array; + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.priority = DMA_PRIORITY_MEDIUM; + dma_init(DMA1, DMA_CH1, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA1, DMA_CH1); + dma_memory_to_memory_disable(DMA1, DMA_CH1); + + /* configure SPI2 receive DMA: DMA1-DMA_CH0 */ + dma_deinit(DMA1, DMA_CH0); + dma_init_struct.periph_addr = (uint32_t)&SPI_DATA(SPI2); + dma_init_struct.memory_addr = (uint32_t)spi2_receive_array; + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA1, DMA_CH0, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA1, DMA_CH0); + dma_memory_to_memory_disable(DMA1, DMA_CH0); +} + +/*! + \brief configure the SPI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + spi_parameter_struct spi_init_struct; + /* deinitilize SPI and the parameters */ + spi_i2s_deinit(SPI0); + spi_i2s_deinit(SPI2); + spi_struct_para_init(&spi_init_struct); + + /* configure SPI0 parameter */ +#ifdef MASTER_TRANSMIT_SLVAE_RECEIVE + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; +#endif /* master send and slave receive */ +#ifdef SLAVE_TRANSMIT_MASTER_RECEIVE + spi_init_struct.trans_mode = SPI_TRANSMODE_RECEIVEONLY; +#endif /* slave send and master receive */ + spi_init_struct.device_mode = SPI_MASTER; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_8; + spi_init_struct.endian = SPI_ENDIAN_MSB; + spi_init(SPI0, &spi_init_struct); + + /* configure SPI2 parameter */ +#ifdef MASTER_TRANSMIT_SLVAE_RECEIVE + spi_init_struct.trans_mode = SPI_TRANSMODE_RECEIVEONLY; +#endif +#ifdef SLAVE_TRANSMIT_MASTER_RECEIVE + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; +#endif + spi_init_struct.device_mode = SPI_SLAVE; + spi_init_struct.nss = SPI_NSS_HARD; + spi_init(SPI2, &spi_init_struct); +} + +/*! + \brief memory compare function + \param[in] src: source data pointer + \param[in] dst: destination data pointer + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus : ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/readme.txt new file mode 100644 index 0000000..9d843a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_slave_simplex_dma/readme.txt @@ -0,0 +1,58 @@ +/*! + \file readme.txt + \brief description of the master and slave simplex communication use dma demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it shows SPI0 and SPI2 simplex +communication use DMA mode. + + 1.Master transmit slave receive mode: + Connect SPI0 SCK PIN(PA5) TO SPI2 SCK PIN(PC10). + Connect SPI0 MOSI PIN(PA7) TO SPI2 MOSI PIN(PC12). + Connect SPI0 NSS PIN(PA2) TO SPI2 NSS PIN(PA4). + + Modify file: example/SPI/SPI_master_slave_simplex_dma/main.c, choose master transmit slave receive mode. + #define MASTER_TRANSMIT_SLVAE_RECEIVE + //#define SLAVE_TRANSMIT_MASTER_RECEIVE + + After the communicate is complete,if receive data is equal to send data, LED2 turn on, if not LED2 turn off. + + 2.Slave transmit master receive mode: + Connect SPI0 SCK PIN(PA5) TO SPI2 SCK PIN(PC10). + Connect SPI0 MISO PIN(PA6) TO SPI2 MISO PIN(PC11). + Connect SPI0 NSS PIN(PA2) TO SPI2 NSS PIN(PA4). + + Modify file: example/SPI/SPI_master_slave_simplex_dma/main.c, choose slave transmit master receive mode. + //#define MASTER_TRANSMIT_SLVAE_RECEIVE + #define SLAVE_TRANSMIT_MASTER_RECEIVE + + After the communicate is complete,if receive data is equal to send data, LED3 turn on, if not LED3 turn off. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..9f0f9b1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.c @@ -0,0 +1,196 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "main.h" + +extern uint8_t spi0_send_array[ ]; +extern uint8_t spi2_receive_array[ ]; +extern volatile uint32_t send_n , receive_n ; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles SPI0 Handler exception + \param[in] none + \param[out] none + \retval none +*/ +void SPI0_IRQHandler(void) +{ + if(RESET != spi_i2s_interrupt_flag_get(SPI0, SPI_I2S_INT_FLAG_TBE)){ + /* send data */ + spi_i2s_data_transmit(SPI0, spi0_send_array[send_n++]); + + if(ARRAYSIZE == send_n){ +#if SPI_CRC_ENABLE + /* send the CRC value */ + spi_crc_next(SPI0); +#endif /* enable CRC function */ + spi_i2s_interrupt_disable(SPI0, SPI_I2S_INT_TBE); + } + } +} + +/*! + \brief this function handles SPI2 Handler exception + \param[in] none + \param[out] none + \retval none +*/ +void SPI2_IRQHandler(void) +{ + /* receive data */ + if(RESET != spi_i2s_interrupt_flag_get(SPI2, SPI_I2S_INT_FLAG_RBNE)){ + spi2_receive_array[receive_n++] = spi_i2s_data_receive(SPI2); +#if SPI_CRC_ENABLE + if((ARRAYSIZE - 1) == receive_n) { + /* receive the CRC value */ + spi_crc_next(SPI1); + } +#endif /* enable CRC function */ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..dc24fd5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_it.h @@ -0,0 +1,65 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* SPI0 handle function */ +void SPI0_IRQHandler(void); +/* SPI2 handle function */ +void SPI2_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.c new file mode 100644 index 0000000..e35a187 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.c @@ -0,0 +1,187 @@ +/*! + \file main.c + \brief master send and slave receive data use interrupt mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" +#include "main.h" + +volatile uint32_t send_n = 0, receive_n = 0; +uint8_t spi0_send_array[ARRAYSIZE] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA}; +uint8_t spi2_receive_array[ARRAYSIZE]; + +void rcu_config(void); +void gpio_config(void); +void spi_config(void); +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize the LEDs */ + gd_eval_led_init(LED2); + + /* configure NVIC */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(SPI0_IRQn, 1, 1); + nvic_irq_enable(SPI2_IRQn, 0, 1); + + /* enable peripheral clock */ + rcu_config(); + /* configure GPIO */ + gpio_config(); + /* configure SPI */ + spi_config(); + /* enable SPI interrupt */ + spi_i2s_interrupt_enable(SPI0, SPI_I2S_INT_TBE); + spi_i2s_interrupt_enable(SPI2, SPI_I2S_INT_RBNE); + + /* enable SPI */ + spi_enable(SPI2); + spi_enable(SPI0); + + /* wait transmit complete */ + while(receive_n < ARRAYSIZE); + +#if SPI_CRC_ENABLE + /* check the CRC error status */ + if(SET != spi_i2s_flag_get(SPI2, SPI_FLAG_CRCERR)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } +#else + /* compare receive data with send data */ + if(ERROR != memory_compare(spi2_receive_array, spi0_send_array, ARRAYSIZE)) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } +#endif /* enable CRC function */ + + while(1) { + } +} + +/*! + \brief configure different peripheral clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOC); + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_SPI2); +} + +/*! + \brief configure the GPIO peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure SPI0 GPIO: SCK/PA5, MOSI/PA7 */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + + /* configure SPI2 GPIO: SCK/PC10, MISO/PC11 */ + gpio_pin_remap_config(GPIO_SPI2_REMAP, ENABLE); + gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10 | GPIO_PIN_11); +} + +/*! + \brief configure the SPI peripheral + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + spi_parameter_struct spi_init_struct; + /* deinitilize SPI and the parameters */ + spi_i2s_deinit(SPI0); + spi_i2s_deinit(SPI2); + spi_struct_para_init(&spi_init_struct); + + /* configure SPI0 parameter */ + spi_init_struct.trans_mode = SPI_TRANSMODE_BDTRANSMIT; + spi_init_struct.device_mode = SPI_MASTER; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_8; + spi_init_struct.endian = SPI_ENDIAN_MSB; + spi_init(SPI0, &spi_init_struct); + + /* configure SPI2 parameter */ + spi_init_struct.trans_mode = SPI_TRANSMODE_BDRECEIVE; + spi_init_struct.device_mode = SPI_SLAVE; + spi_init(SPI2, &spi_init_struct); + +#if SPI_CRC_ENABLE + /* configure SPI CRC function */ + spi_crc_polynomial_set(SPI0, 7); + spi_crc_polynomial_set(SPI1, 7); + spi_crc_on(SPI0); + spi_crc_on(SPI1); +#endif /* enable CRC function */ +} + +/*! + \brief memory compare function + \param[in] src: source data pointer + \param[in] dst: destination data pointer + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t *src, uint8_t *dst, uint8_t length) +{ + while(length--) { + if(*src++ != *dst++) { + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.h new file mode 100644 index 0000000..61ad06c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +#define SPI_CRC_ENABLE 1 /*!< enable CRC function */ +#define ARRAYSIZE 10 /*!< define the number of data to be transmitted */ + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/readme.txt new file mode 100644 index 0000000..314d3a2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SPI/SPI_master_transmit_slave_receive_interrupt/readme.txt @@ -0,0 +1,51 @@ +/*! + \file readme.txt + \brief description of the master transmit and slave receive through interrupt demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it shows master sends data and +slave receives data using interrupt mode. + + 1.Modify files: example/SPI/SPI_master_transmit_slave_receive_interrupt/main.h, choose +to disable CRC function. + #define SPI_CRC_ENABLE 0 + After the communication is completed, if the data received equal to the data sent, LED2 +turn on, and if not, LED2 turn off. + + 2.Modify files: example/SPI/SPI_master_transmit_slave_receive_interrupt/main.h, choose +to enable CRC function. + #define SPI_CRC_ENABLE 1 + After the communication is completed, if the CRC checking is passed, LED2 turn on, +and if not, LED2 turn off. + + Connect SPI0 SCK PIN(PA5) to SPI2 SCK PIN(PC10). + Connect SPI0 MOSI PIN(PA7) to SPI2 MISO PIN(PC11). diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_libopt.h new file mode 100644 index 0000000..a26c831 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/main.c new file mode 100644 index 0000000..248a3aa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/main.c @@ -0,0 +1,67 @@ +/*! + \file main.c + \brief led spark with systick delay in polling mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ + +int main(void) +{ + /* configure systick */ + systick_config(); + + /* initialize the LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); + + while(1){ + gd_eval_led_toggle(LED2); + delay_1ms(500); + gd_eval_led_toggle(LED3); + delay_1ms(500); + gd_eval_led_toggle(LED4); + delay_1ms(500); + gd_eval_led_toggle(LED5); + delay_1ms(500); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/readme.txt new file mode 100644 index 0000000..e0afbab --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/readme.txt @@ -0,0 +1,39 @@ +/*! + \file readme.txt + \brief description of led spark with systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board. After system start-up, +LED2~LED5 toggles at intervals of 500 millisecond. + + On the GD32F107C-EVAL-V1.3 board, LED2 connected to PC0, LED3 connected to PC2, LED4 +connected to PE0, LED5 connected to PE1. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.c new file mode 100644 index 0000000..12f759a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.c @@ -0,0 +1,105 @@ +/*! + \file systick.c + \brief the systick configuration in polling mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static float count_1us = 0; +volatile static float count_1ms = 0; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* systick clock source is from HCLK/8 */ + systick_clksource_set(SYSTICK_CLKSOURCE_HCLK_DIV8); + count_1us = (float)SystemCoreClock/8000000; + count_1ms = (float)count_1us * 1000; +} + +/*! + \brief delay a time in microseconds in polling mode + \param[in] count: count in microseconds + \param[out] none + \retval none +*/ +void delay_1us(uint32_t count) +{ + uint32_t ctl; + + /* reload the count value */ + SysTick->LOAD = (uint32_t)(count * count_1us); + /* clear the current count value */ + SysTick->VAL = 0x0000U; + /* enable the systick timer */ + SysTick->CTRL = SysTick_CTRL_ENABLE_Msk; + /* wait for the COUNTFLAG flag set */ + do{ + ctl = SysTick->CTRL; + }while((ctl&SysTick_CTRL_ENABLE_Msk)&&!(ctl & SysTick_CTRL_COUNTFLAG_Msk)); + /* disable the systick timer */ + SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; + /* clear the current count value */ + SysTick->VAL = 0x0000U; +} + +/*! + \brief delay a time in milliseconds in polling mode + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + uint32_t ctl; + + /* reload the count value */ + SysTick->LOAD = (uint32_t)(count * count_1ms); + /* clear the current count value */ + SysTick->VAL = 0x0000U; + /* enable the systick timer */ + SysTick->CTRL = SysTick_CTRL_ENABLE_Msk; + /* wait for the COUNTFLAG flag set */ + do{ + ctl = SysTick->CTRL; + }while((ctl&SysTick_CTRL_ENABLE_Msk)&&!(ctl & SysTick_CTRL_COUNTFLAG_Msk)); + /* disable the systick timer */ + SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; + /* clear the current count value */ + SysTick->VAL = 0x0000U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.h new file mode 100644 index 0000000..fd32344 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/SYSTICK/Systick_delay_polling/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay a time in microseconds */ +void delay_1us(uint32_t count); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.c new file mode 100644 index 0000000..3f84456 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.c @@ -0,0 +1,278 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x_it.h" +#include "systick.h" + +__IO uint32_t step = 1; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + timer_event_software_generate(TIMER0,TIMER_EVENT_SRC_CMTG); +} + +/*! + \brief this function handles TIMER0 interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void TIMER0_TRG_CMT_IRQHandler(void) +{ + /* clear TIMER interrupt flag */ + timer_interrupt_flag_clear(TIMER0,TIMER_INT_CMT); + + switch(step){ + /* next step: step 2 configuration .A-C` breakover---------------------------- */ + case 1: + /* channel0 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_DISABLE); + + /* channel1 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_DISABLE); + + /* channel2 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_ENABLE); + + step++; + break; + + /* next step: step 3 configuration .B-C` breakover---------------------------- */ + case 2: + /* channel0 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_DISABLE); + + /* channel1 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_DISABLE); + + /* channel2 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_ENABLE); + + step++; + break; + + /* next step: step 4 configuration .B-A` breakover---------------------------- */ + case 3: + /* channel0 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_ENABLE); + + /* channel1 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_DISABLE); + + /* channel2 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_DISABLE); + + step++; + break; + + /* next step: step 5 configuration .C-A` breakover---------------------------- */ + case 4: + /* channel0 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_ENABLE); + + /* channel1 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_DISABLE); + + /* channel2 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_DISABLE); + + step++; + break; + + /* next step: step 6 configuration .C-B` breakover---------------------------- */ + case 5: + /* channel0 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_DISABLE); + + /* channel1 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_ENABLE); + + /* channel2 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_DISABLE); + + step++; + break; + + /* next step: step 1 configuration .A-B` breakover---------------------------- */ + case 6: + /* channel0 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCX_ENABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_0,TIMER_CCXN_DISABLE); + + /* channel1 configuration */ + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_1,TIMER_CCXN_ENABLE); + + /* channel2 configuration */ + timer_channel_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCX_DISABLE); + timer_channel_complementary_output_state_config(TIMER0,TIMER_CH_2,TIMER_CCXN_DISABLE); + + step = 1; + break; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.h new file mode 100644 index 0000000..9bec1c4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_it.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); +/*TIMER0 handle function*/ +void TIMER0_BRK_UP_TRG_COM_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/main.c new file mode 100644 index 0000000..58eaf69 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/main.c @@ -0,0 +1,178 @@ +/*! + \file main.c + \brief TIMER0 6-steps demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "systick.h" + +void gpio_config(void); +void timer_config(void); +void nvic_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + + /* configure PA8 PA9 PA10(TIMER0 CH0 CH1 CH2) as alternate function */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + + /* configure PB13 PB14 PB15(TIMER0 CH0N CH1N CH2N) as alternate function */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_14); + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_15); + + /* configure PB12(TIMER0 BKIN) as alternate function */ + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_12); +} + +/** + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none + */ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER0_TRG_CMT_IRQn, 0, 1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* ----------------------------------------------------------------------- + TIMER0 configuration: + generate 3 complementary PWM signal. + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 108 + so the TIMER0 counter clock used is 1MHz. + insert a dead time equal to (64 + 36) * 2 / systemcoreclock =1.85us + configure the break feature, active at low level, and using the automatic + output enable feature. + use the locking parameters level 0. + ----------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + timer_break_parameter_struct timer_breakpara; + + rcu_periph_clock_enable(RCU_TIMER0); + + timer_deinit(TIMER0); + + /* TIMER0 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 599; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0,&timer_initpara); + + /* CH0/CH0N,CH1/CH1N and CH2/CH2N configuration in timing mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_ENABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_HIGH; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_HIGH; + + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_2,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,299); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_TIMING); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_ENABLE); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_1,299); + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_TIMING); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_1,TIMER_OC_SHADOW_ENABLE); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_2,299); + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_TIMING); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_2,TIMER_OC_SHADOW_ENABLE); + + /* automatic output enable, break, dead time and lock configuration*/ + timer_breakpara.runoffstate = TIMER_ROS_STATE_ENABLE; + timer_breakpara.ideloffstate = TIMER_IOS_STATE_ENABLE ; + timer_breakpara.deadtime = 164; + timer_breakpara.breakpolarity = TIMER_BREAK_POLARITY_LOW; + timer_breakpara.outputautostate = TIMER_OUTAUTO_ENABLE; + timer_breakpara.protectmode = TIMER_CCHP_PROT_OFF; + timer_breakpara.breakstate = TIMER_BREAK_ENABLE; + timer_break_config(TIMER0,&timer_breakpara); + + /* TIMER0 primary output function enable */ + timer_primary_output_config(TIMER0,ENABLE); + + /* TIMER0 channel control update interrupt enable */ + timer_interrupt_enable(TIMER0,TIMER_INT_CMT); + /* TIMER0 break interrupt disable */ + timer_interrupt_disable(TIMER0,TIMER_INT_BRK); + + /* TIMER0 counter enable */ + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + systick_config(); + nvic_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/readme.txt new file mode 100644 index 0000000..0485511 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/readme.txt @@ -0,0 +1,58 @@ +/*! + \file readme.txt + \brief description of the TIMER0 6-steps demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + This demo is based on the GD32107C-EVAL board, it shows how to +configure the TIMER0 peripheral to generate three complementary TIMER0 signals +(for BLDC ) with dead time. + + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 108 so the +TIMER0 counter clock used is 1MHz. + + Channel change sequence: + AB`->AC`->BC`->BA`->CA`->CB` +step1:1-0 0-1 0-0 (CH0-CH0N CH1-CH1N CH2-CH2N) +step2:1-0 0-0 0-1 (CH0-CH0N CH1-CH1N CH2-CH2N) +step3:0-0 1-0 0-1 (CH0-CH0N CH1-CH1N CH2-CH2N) +step4:0-1 1-0 0-0 (CH0-CH0N CH1-CH1N CH2-CH2N) +step5:0-1 0-0 1-0 (CH0-CH0N CH1-CH1N CH2-CH2N) +step6:0-0 0-1 1-0 (CH0-CH0N CH1-CH1N CH2-CH2N) + + Connect the TIMER0 pins to a logic analyzer to monitor the different waveforms: + - TIMER0_CH0 pin (PA8) + - TIMER0_CH0N pin (PB13) + - TIMER0_CH1 pin (PA9) + - TIMER0_CH1N pin (PB14) + - TIMER0_CH2 pin (PA10) + - TIMER0_CH2N pin (PB15) \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.c new file mode 100644 index 0000000..02c5186 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.c @@ -0,0 +1,84 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x.h" +#include "systick.h" + +static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 100U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.h new file mode 100644 index 0000000..14ebfa7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_6-steps/systick.h @@ -0,0 +1,48 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/main.c new file mode 100644 index 0000000..f215505 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/main.c @@ -0,0 +1,151 @@ +/*! + \file main.c + \brief TIMER0 deadtime break demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA8(TIMER0 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + + /*configure PB13(TIMER0 CH0N) as alternate function*/ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + + /*configure PB12(TIMER0 BRKIN) as alternate function*/ + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_12); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* ----------------------------------------------------------------------- + TIMER0 configuration: + generate 1 complementary PWM signal. + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 108 so the + TIMER0 counter clock used is 1MHz. + the duty cycle is computed as the following description: + the channel 0 duty cycle is set to 25% so channel 0N is set to 75%. + + insert a dead time equal to ((32+31)*16*4)/systemcoreclock = 37.3us + + configure the break feature, active at high level, and using the automatic + output enable feature. + + use the locking parameters level1. + ----------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + timer_break_parameter_struct timer_breakpara; + + rcu_periph_clock_enable(RCU_TIMER0); + + timer_deinit(TIMER0); + + /* TIMER0 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 1599; + timer_initpara.clockdivision = TIMER_CKDIV_DIV4; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0,&timer_initpara); + + /* CH0/CH0N configuration in PWM mode0 */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_ENABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_HIGH; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,399); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* automatic output enable, break, dead time and lock configuration*/ + timer_breakpara.runoffstate = TIMER_ROS_STATE_DISABLE; + timer_breakpara.ideloffstate = TIMER_IOS_STATE_DISABLE ; + timer_breakpara.deadtime = 255; + timer_breakpara.breakpolarity = TIMER_BREAK_POLARITY_LOW; + timer_breakpara.outputautostate = TIMER_OUTAUTO_ENABLE; + timer_breakpara.protectmode = TIMER_CCHP_PROT_0; + timer_breakpara.breakstate = TIMER_BREAK_ENABLE; + timer_break_config(TIMER0,&timer_breakpara); + + /* TIMER0 primary output function enable */ + timer_primary_output_config(TIMER0,ENABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + + /* TIMER0 counter enable */ + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/readme.txt new file mode 100644 index 0000000..641f3e8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_deadtime_break/readme.txt @@ -0,0 +1,60 @@ +/*! + \file readme.txt + \brief description of the TIMER0 deadtime break demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + This demo is based on the GD32107C-EVAL board, it shows how to +configure the TIMER0 peripheral to generate complementary signals, +to insert a defined dead time value, to use the break feature and +to lock the desired parameters. + + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 107 ,so +the TIMER0 counter clock used is 1MHz. + + The duty cycle is computed as the following description: +the channel 0 duty cycle is set to 25% so channel 0N is set to 75%. + + Insert a dead time equal to ((32 + 31) * 16 * 4) / systemcoreclock = 37.3us + + Configure the break feature, active at Low level(with GND), and using the +automatic output enable feature. + + Use the Locking parameters level1. + + Connect the TIMER0 pins to an oscilloscope to monitor the different waveforms: + - TIMER0_CH0 pin (PA8) + - TIMER0_CH0N pin (PB13) + + Connect one key's pin (PB14 for example) and TIMER0_BRKIN pin PB12 with Dupont +line. Press the key (User Key for example), the break of the wave can be observed +through the oscilloscope. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/main.c new file mode 100644 index 0000000..93bcb58 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/main.c @@ -0,0 +1,175 @@ +/*! + \file main.c + \brief TIMER0 dma demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define TIMER0_CH0CV_OFFSET (0x34) +#define TIMER0_CH0CV_ADDR (TIMER0 + TIMER0_CH0CV_OFFSET) +#define TRANSFER_NUM (3) +uint16_t buffer[TRANSFER_NUM] = {249,499,749}; + +void gpio_config(void); +void timer_config(void); +void dma_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA8(TIMER0 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); +} + +/** + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none + */ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); + + /* initialize DMA channel 4 */ + dma_deinit(DMA0, DMA_CH4); + + /* DMA channel 4 initialize */ + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)buffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_init_struct.number = TRANSFER_NUM; + dma_init_struct.periph_addr = (uint32_t)TIMER0_CH0CV_ADDR; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + + /* DMA0 channel 4 mode configuration */ + dma_circulation_enable(DMA0, DMA_CH4); + dma_memory_to_memory_disable(DMA0, DMA_CH4); + + /* enable DMA0 transfer */ + dma_channel_enable(DMA0, DMA_CH4); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* TIMER0 DMA Transfer example ------------------------------------------------- + TIMER0CLK = 108 MHz, Prescaler = 108 + TIMER0 counter clock = systemcoreclock/108 = 1MHz. + + the objective is to configure TIMER0 channel 1 to generate PWM + signal with a frequency equal to 1KHz and a variable duty cycle(25%,50%,75%) that is + changed by the DMA after a specific number of update DMA request. + + the number of this repetitive requests is defined by the TIMER0 repetition counter, + each 2 update requests, the TIMER0 Channel 0 duty cycle changes to the next new + value defined by the buffer . + -----------------------------------------------------------------------------*/ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER0); + + timer_deinit(TIMER0); + + /* TIMER0 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 1; + timer_init(TIMER0,&timer_initpara); + + /* CH0 configuration in PWM1 mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_HIGH; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,buffer[0]); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* TIMER0 primary output enable */ + timer_primary_output_config(TIMER0,ENABLE); + + /* TIMER0 update DMA request enable */ + timer_dma_enable(TIMER0,TIMER_DMA_UPD); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + + /* TIMER0 counter enable */ + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + dma_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/readme.txt new file mode 100644 index 0000000..f3d9da2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of the TIMER0 DMA demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + This demo is based on the GD32107C-EVAL board, it shows how to +use DMA with TIMER0 update request to transfer data from memory +to TIMER0 capture compare register 0. + + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 108 +so the TIMER0 counter clock used is 1MHz. + + The objective is to configure TIMER0 channel 0(PA8) to generate PWM signal with +a frequency equal to 1KHz and a variable duty cycle(25%,50%,75%) that is changed +by the DMA after a specific number of Update DMA request. + + The number of this repetitive requests is defined by the TIMER0 repetition counter, +each 2 update requests, the TIMER0 Channel 0 duty cycle changes to the next new +value defined by the buffer. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_libopt.h new file mode 100644 index 0000000..73a9400 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/main.c new file mode 100644 index 0000000..b11d8a8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/main.c @@ -0,0 +1,206 @@ +/*! + \file main.c + \brief TIMER0 dma burst demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define TIMER0_DMATB_OFFSET (0x4C) /* TIMER0_DMATB address offset */ +#define TIMER0_DMATB_ADDR (TIMER0 + TIMER0_DMATB_OFFSET) /* TIMER0_DMATB address */ +#define TRANSFER_NUM (8) + +uint16_t buffer[TRANSFER_NUM] = {99,199,299,399,499,599,699,799}; + + +void gpio_config(void); +void timer_config(void); +void dma_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA8(TIMER0 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + + /*configure PA9(TIMER0 CH1) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + + /*configure PA10(TIMER0 CH2) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + + /*configure PA11(TIMER0 CH3) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11); +} + +/** + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none + */ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + + /* enable DMA clock */ + rcu_periph_clock_enable(RCU_DMA0); + + /* initialize DMA channel5 */ + dma_deinit(DMA0, DMA_CH4); + + /* DMA channel 4 initialize */ + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)buffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_init_struct.number = TRANSFER_NUM; + dma_init_struct.periph_addr = (uint32_t)TIMER0_DMATB_ADDR; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + + /* DMA0 channel 4 mode configuration */ + dma_circulation_enable(DMA0, DMA_CH4); + dma_memory_to_memory_disable(DMA0, DMA_CH4); + + /* enable DMA0 transfer */ + dma_channel_enable(DMA0, DMA_CH4); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* TIMER0 DMA transfer example ------------------------------------------------- + TIMER0CLK = 108 MHz, prescaler = 108 + TIMER0 counter clock = systemcoreclock/108 = 1MHz. + + The objective is to configure TIMER0 channel 0~3(PA8~PA11) to generate PWM signal. + capture compare register 0~3 are to be updated twice per circle.On the first update + DMA request, data1 is transferred to CH0CV, data2 is transferred to CH1CV, data3 is + transferred to CH2CV,data4 is transferred to CH3CV and duty cycle(10%,20%,30%,40%). + On the second update DMA request, data5 is transferred to CH0CV, data6 is transferred + to CH1CV, data7 is transferred to CH2CV,data8 is transferred to CH3CV and duty cycle + (50%,60%,70%,80%). + -----------------------------------------------------------------------------*/ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER0); + + timer_deinit(TIMER0); + + /* TIMER0 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0,&timer_initpara); + + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_HIGH; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_2,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_3,&timer_ocintpara); + + /* CH0 configuration in PWM0 mode */ + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,buffer[0]); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* CH1 configuration in PWM0 mode */ + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_1,buffer[0]); + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + /* CH2 configuration in PWM0 mode */ + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_2,buffer[0]); + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + /* CH3 configuration in PWM0 mode */ + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_3,buffer[0]); + timer_channel_output_mode_config(TIMER0,TIMER_CH_3,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_3,TIMER_OC_SHADOW_DISABLE); + + /* TIMER0 primary output enable */ + timer_primary_output_config(TIMER0,ENABLE); + + /* TIMER0 update DMA request enable */ + timer_dma_transfer_config(TIMER0,TIMER_DMACFG_DMATA_CH0CV,TIMER_DMACFG_DMATC_4TRANSFER); + timer_dma_enable(TIMER0,TIMER_DMA_UPD); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + + /* TIMER0 counter enable */ + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + dma_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/readme.txt new file mode 100644 index 0000000..438c2b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_dma_burst/readme.txt @@ -0,0 +1,49 @@ +/*! + \file readme.txt + \brief description of the TIMER0 DMA burst demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + This demo is based on the GD32107C-EVAL board, it shows how to use DMA with +TIMER0 update request to transfer data from memory to TIMER0 capture compare +register 0~3. + + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 108 +so the TIMER0 counter clock used is 1MHz. + + The objective is to configure TIMER0 channel 0~3(PA8~PA11) to generate PWM signal. +capture compare register 0~3 are to be updated twice per circle.On the first update +DMA request, data1 is transferred to CH0CV, data2 is transferred to CH1CV, data3 is +transferred to CH2CV,data4 is transferred to CH3CV and duty cycle(10%,20%,30%,40%). +On the second update DMA request, data5 is transferred to CH0CV, data6 is transferred +to CH1CV, data7 is transferred to CH2CV,data8 is transferred to CH3CV and duty cycle +(50%,60%,70%,80%). diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/main.c new file mode 100644 index 0000000..b857edb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/main.c @@ -0,0 +1,142 @@ +/*! + \file main.c + \brief TIMER0 complementary signals demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + + /*Configure PA8 PA9 PA10(TIMER0 CH0 CH1 CH2) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + + /*Configure PB13 PB14 PB15(TIMER0 CH0N CH1N CH2N) as alternate function*/ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_14); + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_15); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ +/* ----------------------------------------------------------------------- + TIMER0 configuration to: + generate 3 complementary PWM signals with 3 different duty cycles: + TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 5400 so the + TIMER0 counter clock used is 20KHz. + the three duty cycles are computed as the following description: + the channel 0 duty cycle is set to 25% so channel 1N is set to 75%. + the channel 1 duty cycle is set to 50% so channel 2N is set to 50%. + the channel 2 duty cycle is set to 75% so channel 3N is set to 25%. + ----------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER0); + + timer_deinit(TIMER0); + + /* TIMER0 configuration */ + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 15999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0,&timer_initpara); + + /* CH1,CH2 and CH3 configuration in PWM mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_ENABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER0,TIMER_CH_2,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,3999); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_1,7999); + timer_channel_output_mode_config(TIMER0,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_2,11999); + timer_channel_output_mode_config(TIMER0,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + timer_primary_output_config(TIMER0,ENABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/readme.txt new file mode 100644 index 0000000..854c594 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER0_pwmout_complementarysignals/readme.txt @@ -0,0 +1,51 @@ +/*! + \file readme.txt + \brief description of the TIMER0 complementary signals demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to +configure the TIMER0 peripheral to generate three complementary TIMER0 signals. +TIMER0CLK is fixed to systemcoreclock, the TIMER0 prescaler is equal to 5400 +so the TIMER0 counter clock used is 20KHz. + + The Three duty cycles are computed as the following description: + The channel 0 duty cycle is set to 25% so channel 0N is set to 75%. + The channel 1 duty cycle is set to 50% so channel 1N is set to 50%. + The channel 2 duty cycle is set to 75% so channel 2N is set to 25%. + + Connect the TIMER0 pins to an oscilloscope to monitor the different waveforms: + - TIMER0_CH0 pin (PA8) + - TIMER0_CH0N pin (PB13) + - TIMER0_CH1 pin (PA9) + - TIMER0_CH1N pin (PB14) + - TIMER0_CH2 pin (PA10) + - TIMER0_CH2N pin (PB15) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.c new file mode 100644 index 0000000..7f929fa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.c @@ -0,0 +1,166 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles TIMER1 interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void TIMER1_IRQHandler(void) +{ + if(SET == timer_interrupt_flag_get(TIMER1, TIMER_INT_FLAG_UP)){ + /* clear update interrupt bit */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_UP); + gd_eval_led_toggle(LED2); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.h new file mode 100644 index 0000000..76033c7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* TIMER1 handle function */ +void TIMER1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_libopt.h new file mode 100644 index 0000000..1727d82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/main.c new file mode 100644 index 0000000..a2d3a3a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/main.c @@ -0,0 +1,133 @@ +/*! + \file main.c + \brief TIMER1 extclock count demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* configure the TIMER peripheral */ +void timer_config(void); +/* configure the TIMER1 peripheral */ +void nvic_config(void); +/* configure the TIMER1 GPIO */ +void gpio_config(void); + +/** + \brief configure the TIMER1 interrupt + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER1_IRQn, 1, 1); +} + +/** + \brief configure the TIMER1 GPIO + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA0(TIMER1 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer_config(void) +{ + /* ---------------------------------------------------------------------------- + TIMER1 Configuration: + TIMER1 count with external clock, the prescaler is 0, the period is 1000. + ---------------------------------------------------------------------------- */ + timer_parameter_struct timer_initpara; + timer_ic_parameter_struct timer_icinitpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + /* TIMER1 configuration */ + timer_initpara.prescaler = 0; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_init(TIMER1, &timer_initpara); + + /* TIMER1 CH0 input capture configuration */ + timer_icinitpara.icpolarity = TIMER_IC_POLARITY_RISING; + timer_icinitpara.icselection = TIMER_IC_SELECTION_DIRECTTI; + timer_icinitpara.icprescaler = TIMER_IC_PSC_DIV1; + timer_icinitpara.icfilter = 0x01; + timer_input_capture_config(TIMER1, TIMER_CH_0, &timer_icinitpara); + + /* slave mode selection : TIMER1 */ + /* TIMER1 input trigger : external trigger connected to CI0 */ + timer_input_trigger_source_select(TIMER1,TIMER_SMCFG_TRGSEL_CI0FE0); + timer_slave_mode_select(TIMER1,TIMER_SLAVE_MODE_EXTERNAL0); + + /* enable the TIMER interrupt */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_UP); + timer_interrupt_enable(TIMER1, TIMER_INT_UP); + + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_led_init(LED2); + nvic_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/readme.txt new file mode 100644 index 0000000..633a7b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_extclock_count/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief TIMER1 extclock count demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows how to configure the +TIMER peripheral update interrupt with the corresponding interrupt request to generate +a time base. + + The TIMxCLK frequency is set to external clock, the prescaler is 0, the period is 1000. +Enable TIMER1 update interrupt, in the handler routine, LED2 is toggled. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/main.c new file mode 100644 index 0000000..bba19e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/main.c @@ -0,0 +1,135 @@ +/*! + \file main.c + \brief TIMER1 external trigger demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA2(TIMER1 CH2) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + + /*configure PA0(TIMER1 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* Timer with an external trigger ------------------------------------- + TIMER1 is configured as slave timer for an external trigger connected + to TIMER1 CI0 pin : + - The TIMER1 CI0FE0 is used as trigger input + - rising edge is used to start the TIMER1: event mode. + - TIMER1 CH2 is used PWM0 Mode + the starts of the TIMER1 counter are controlled by the + external trigger. + -------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocinitpara; + timer_parameter_struct timer_initpara; + timer_ic_parameter_struct timer_icinitpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + + /* TIMER1 configuration */ + timer_initpara.prescaler = 239; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 7999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH2 configuration in OC PWM0 mode */ + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER1,TIMER_CH_2,&timer_ocinitpara); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_2,3999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + /* TIMER1 CH0 input capture configuration */ + timer_icinitpara.icpolarity = TIMER_IC_POLARITY_RISING; + timer_icinitpara.icselection = TIMER_IC_SELECTION_DIRECTTI; + timer_icinitpara.icprescaler = TIMER_IC_PSC_DIV1; + timer_icinitpara.icfilter = 0x02; + timer_input_capture_config(TIMER1,TIMER_CH_0,&timer_icinitpara); + + /* slave mode selection : TIMER1 */ + /* TIMER1 input trigger : external trigger connected to CI0 */ + timer_input_trigger_source_select(TIMER1,TIMER_SMCFG_TRGSEL_CI0FE0); + timer_slave_mode_select(TIMER1,TIMER_SLAVE_MODE_EVENT); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/readme.txt new file mode 100644 index 0000000..b1defe7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_exttrigger/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of the TIMER1 external trigger demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to start TIMER +peripherals with an external trigger. + TIMER1 is configured as slave timer for an external trigger connected to +TIMER1 TI0 pin : + - The TIMER1 TI0FP0 is used as trigger input + - Rising edge is used to start the TIMER1: event mode. + - TIMER1 is used PWM0 Mode + The starts of the TIMER1 counter are controlled by the external trigger. + + Connect the TIMER1 CH2 pin (PA2) to an oscilloscope to monitor the waveform. +Connect the TIMER1 CH0 pin PA0 to +3V3 on the board as a external trigger with a +rising edge. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/main.c new file mode 100644 index 0000000..e0e9205 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/main.c @@ -0,0 +1,133 @@ +/*! + \file main.c + \brief TIMER1 oc active demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*Configure PA0 PA1 PA2(TIMER1 CH0 CH1 CH2) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* --------------------------------------------------------------- + TIMER1 Configuration: + TIMER1CLK = SystemCoreClock / 10800 = 10K, + And generate 3 signals with 3 different delays: + TIMER1_CH0 delay = 4000/10000 = 0.4s + TIMER1_CH1 delay = 8000/10000 = 0.8s + TIMER1_CH2 delay = 12000/10000 = 1.2s + --------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + + /* TIMER1 configuration */ + timer_initpara.prescaler = 10799; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 65535; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH0,CH1 and CH2 configuration in OC active mode */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER1,TIMER_CH_0,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_2,&timer_ocintpara); + + /* CH0 configuration in OC active mode */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_0,3999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_0,TIMER_OC_MODE_ACTIVE); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* CH1 configuration in OC active mode */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_1,7999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_1,TIMER_OC_MODE_ACTIVE); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + /* CH2 configuration in OC active mode */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_2,11999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_2,TIMER_OC_MODE_ACTIVE); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/readme.txt new file mode 100644 index 0000000..1cf016d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocactive/readme.txt @@ -0,0 +1,52 @@ +/*! + \file readme.txt + \brief description of the TIMER1 OC active demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +TIMER peripheral to generate three different signals with three different delays. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 10800 +so the TIMER1 counter clock is 10KHz. + + And generate 3 signals with 3 different delays: + TIMER1_CH0 delay = 4000/10K = 0.4s + TIMER1_CH1 delay = 8000/10K = 0.8s + TIMER1_CH2 delay = 12000/10K = 1.2s + + Connect the TIMER1 pins to leds and reset the board to watch the signal: + - TIMER1_CH0 pin (PA0) + - TIMER1_CH1 pin (PA1) + - TIMER1_CH2 pin (PA2) + - LED3 pin (PC2) + - LED4 pin (PE0) + - LED5 pin (PE1) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.c new file mode 100644 index 0000000..70917cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.c @@ -0,0 +1,173 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/** + * @brief This function handles TIMER1 interrupt request. + * @param None + * @retval None + */ +void TIMER1_IRQHandler(void) +{ + if(SET == timer_interrupt_flag_get(TIMER1, TIMER_INT_FLAG_CH0)){ + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_CH0); + gd_eval_led_off(LED2); + }else if(SET == timer_interrupt_flag_get(TIMER1, TIMER_INT_FLAG_CH1)){ + /* clear channel 1 interrupt bit */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_CH1); + gd_eval_led_off(LED3); + }else if(SET == timer_interrupt_flag_get(TIMER1, TIMER_INT_FLAG_CH2)){ + /* clear channel 2 interrupt bit */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_CH2); + gd_eval_led_off(LED4); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.h new file mode 100644 index 0000000..24f9f6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* TIMER1 handle function */ +void TIMER1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/main.c new file mode 100644 index 0000000..efd09cc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/main.c @@ -0,0 +1,163 @@ +/*! + \file main.c + \brief TIMER1 oc inactive demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* configure the GPIO ports */ +void gpio_config(void); +/* configure the TIMER1 interrupt */ +void nvic_config(void); +/* configure the TIMER peripheral */ +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*Configure PA0/PA1/PA2(TIMER1 CH0/CH1/CH2) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); +} + +/** + \brief configure the TIMER1 interrupt + \param[in] none + \param[out] none + \retval none + */ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER1_IRQn, 1, 1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* --------------------------------------------------------------- + TIMER1 Configuration: + TIMER1CLK = SystemCoreClock / 54000 = 2KHz, + And generate 3 signals with 3 different delays: + TIMER1_CH0 delay = 2000/2000 = 1s + TIMER1_CH1 delay = 4000/2000 = 2s + TIMER1_CH2 delay = 6000/2000 = 3s + --------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocinitpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + /* TIMER1 configuration */ + timer_initpara.prescaler = 53999; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 10000; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1, &timer_initpara); + + /* initialize TIMER channel output parameter struct */ + timer_channel_output_struct_para_init(&timer_ocinitpara); + /* CH0,CH1 and CH2 configuration in OC inactive mode */ + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER1, TIMER_CH_0, &timer_ocinitpara); + timer_channel_output_config(TIMER1, TIMER_CH_1, &timer_ocinitpara); + timer_channel_output_config(TIMER1, TIMER_CH_2, &timer_ocinitpara); + + /* CH0 configuration in OC inactive mode */ + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_0, 2000); + timer_channel_output_mode_config(TIMER1, TIMER_CH_0, TIMER_OC_MODE_INACTIVE); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE); + + /* CH1 configuration in OC inactive mode */ + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_1, 4000); + timer_channel_output_mode_config(TIMER1, TIMER_CH_1, TIMER_OC_MODE_INACTIVE); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_1, TIMER_OC_SHADOW_DISABLE); + + /* CH2 configuration in OC inactive mode */ + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_2, 6000); + timer_channel_output_mode_config(TIMER1, TIMER_CH_2, TIMER_OC_MODE_INACTIVE); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_2, TIMER_OC_SHADOW_DISABLE); + + timer_interrupt_enable(TIMER1, TIMER_INT_CH0 | TIMER_INT_CH1 | TIMER_INT_CH2); + + gd_eval_led_on(LED2); + gd_eval_led_on(LED3); + gd_eval_led_on(LED4); + + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + + gpio_config(); + nvic_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/readme.txt new file mode 100644 index 0000000..e6766b6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_ocinactive/readme.txt @@ -0,0 +1,52 @@ +/*! + \file readme.txt + \brief description of the TIMER1 OC inactive demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +TIMER peripheral to generate three different signals with three different delays. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 54000, so the +TIMER1 counter clock is 2KHz. + + And generate 3 signals with 3 different delays: + TIMER1_CH0 delay = 2000/2000 = 1s. + TIMER1_CH1 delay = 4000/2000 = 2s. + TIMER1_CH2 delay = 6000/2000 = 3s. + + So PA0 is reset after a delay equal to 1s, PA1 is reset after a delay equal to 2s, +and PA2 is reset after a delay equal to 3s. + + While the counter is lower than the TIMER_CHxCV registers values, which determines +the output delay, the LED2, LED3 and LED4 are turned on. When the counter value reaches +the TIMER_CHxCV registers values, the channel output compare interrupts are generated, +and in the handler routine, these LEDs are turned off. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/main.c new file mode 100644 index 0000000..ae18294 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/main.c @@ -0,0 +1,116 @@ +/*! + \file main.c + \brief TIMER1 oc toggle demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA1(TIMER1 CH1) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); +} + +/** + \brief configure the timer peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* --------------------------------------------------------------------------- + TIMER1 configuration: output compare toggle mode: + TIMER1CLK = systemcoreclock / 5400 = 20K, + CH1 update rate = TIMER1 counter clock / CH1VAL = 20000/4000 = 5 Hz + ----------------------------------------------------------------------------*/ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + + /* TIMER1 configuration */ + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 3999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH1 configuration in OC TOGGLE mode */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER1,TIMER_CH_1,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_1,3999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_1,TIMER_OC_MODE_TOGGLE); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/readme.txt new file mode 100644 index 0000000..467ddff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_octoggle/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of the TIMER1 OC toggle demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +TIMER peripheral to generate the toggle signal. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 5400 +so the TIMER1 counter clock is 20KHz. + + TIMER1 configuration: output compare toggle mode: +CH1 update rate = TIMER1 counter clock / CH1CC = 20000/4000 = 5 Hz. + + Connect the TIMER1 CH1 pin (PA1) to an oscilloscope to monitor the waveform. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/main.c new file mode 100644 index 0000000..b7c0d37 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/main.c @@ -0,0 +1,136 @@ +/*! + \file main.c + \brief TIMER1 PWM output demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*Configure PA1 PA2 PA3(TIMER1 CH1 CH2 CH3) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* ----------------------------------------------------------------------- + TIMER1 configuration: generate 3 PWM signals with 3 different duty cycles: + TIMER1CLK = SystemCoreClock / 108 = 1MHz + + TIMER1 channel1 duty cycle = (4000/ 16000)* 100 = 25% + TIMER1 channel2 duty cycle = (8000/ 16000)* 100 = 50% + TIMER1 channel3 duty cycle = (12000/ 16000)* 100 = 75% + ----------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + + /* TIMER1 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 15999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH1,CH2 and CH3 configuration in PWM mode1 */ + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + + timer_channel_output_config(TIMER1,TIMER_CH_1,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_2,&timer_ocintpara); + timer_channel_output_config(TIMER1,TIMER_CH_3,&timer_ocintpara); + + /* CH1 configuration in PWM mode1,duty cycle 25% */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_1,3999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_1,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + /* CH2 configuration in PWM mode1,duty cycle 50% */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_2,7999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_2,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_2,TIMER_OC_SHADOW_DISABLE); + + /* CH3 configuration in PWM mode1,duty cycle 75% */ + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_3,11999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_3,TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_3,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); + /* auto-reload preload enable */ + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/readme.txt new file mode 100644 index 0000000..9cb6710 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_pwmout/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the TIMER1 PWM output demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +TIMER peripheral in PWM (Pulse Width Modulation) mode. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 108 so the +TIMER1 counter clock is 1MHz. + + TIMER1 Channel1 duty cycle = (4000/ 16000)* 100 = 25%. + TIMER1 Channel2 duty cycle = (8000/ 16000)* 100 = 50%. + TIMER1 Channel3 duty cycle = (12000/ 16000)* 100 = 75%. + + Connect the TIMER1 pins to an oscilloscope to monitor the different waveforms: + - TIMER1_CH1 pin (PA1) + - TIMER1_CH2 pin (PA2) + - TIMER1_CH3 pin (PA3) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/main.c new file mode 100644 index 0000000..5f5c374 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/main.c @@ -0,0 +1,139 @@ +/*! + \file main.c + \brief TIMER1 single pulse demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA0 PA1(TIMER1 CH0 CH1) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* ----------------------------------------------------------------------- + TIMER1 configuration: single pulse mode + the external signal is connected to TIMER1 CH0 pin (PA0) and the falling + edge is used as active edge. + the single pulse signal is output on TIMER1 CH1 pin (PA1). + + the TIMER1CLK frequency is set to systemcoreclock,the prescaler is + 6,so the TIMER1 counter clock is 18MHz. + + single pulse value = (TIMER1_Period - TIMER1_Pulse) / TIMER1 counter clock + = (65535 - 11535) / 18MHz = 3 ms. + ----------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocinitpara; + timer_parameter_struct timer_initpara; + timer_ic_parameter_struct timer_icinitpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + + /* TIMER1 configuration */ + timer_initpara.prescaler = 5; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 65535; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* auto-reload preload disable */ + timer_auto_reload_shadow_disable(TIMER1); + + /* CH1 configuration in OC PWM2 mode */ + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER1,TIMER_CH_1,&timer_ocinitpara); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_1,11535); + timer_channel_output_mode_config(TIMER1,TIMER_CH_1,TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_1,TIMER_OC_SHADOW_DISABLE); + + /* TIMER1 CH0 input capture configuration */ + timer_icinitpara.icpolarity = TIMER_IC_POLARITY_FALLING; + timer_icinitpara.icselection = TIMER_IC_SELECTION_DIRECTTI; + timer_icinitpara.icprescaler = TIMER_IC_PSC_DIV1; + timer_icinitpara.icfilter = 0x00; + timer_input_capture_config(TIMER1,TIMER_CH_0,&timer_icinitpara); + + /* single pulse mode selection */ + timer_single_pulse_mode_config(TIMER1,TIMER_SP_MODE_SINGLE); + + /* slave mode selection : TIMER1 */ + /* TIMER1 input trigger : external trigger connected to CI0 */ + timer_input_trigger_source_select(TIMER1,TIMER_SMCFG_TRGSEL_CI0FE0); + timer_slave_mode_select(TIMER1,TIMER_SLAVE_MODE_EVENT); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/readme.txt new file mode 100644 index 0000000..a68a51e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_singlepulse/readme.txt @@ -0,0 +1,50 @@ +/*! + \file readme.txt + \brief description of the TIMER1 single pulse demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure +the TIMER1 peripheral in single pulse mode. + The external signal is connected to TIMER1 CH0 pin (PA0) and the falling +edge is used as active edge. + + The single pulse signal is output on TIMER1 CH1 pin (PA1). + + The TIMER1CLK frequency is set to systemcoreclock,the prescaler is 6,so the +TIMER1 counter clock is 18MHz. + + single pulse value = (TIMER1_period - TIMER1_pulse) / TIMER1 counter clock + = (65535 - 11535) / 18MHz = 3 ms. + + Connect the TIMER1 CH1 pin (PA1) to an oscilloscope to monitor the waveform. +Connect the TIMER1 CH0 pin (PA0) to KEY_TAMPER(PC13),When KEY_TAMPER is pressed, +a single pulse is generated on TIMER1 CH1 pin. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.c new file mode 100644 index 0000000..59842d1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.c @@ -0,0 +1,166 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include +#include "gd32f10x_eval.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles TIMER1 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER1_IRQHandler(void) +{ + if(SET == timer_interrupt_flag_get(TIMER1, TIMER_INT_FLAG_UP)){ + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_UP); + gd_eval_led_toggle(LED2); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.h new file mode 100644 index 0000000..24f9f6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* TIMER1 handle function */ +void TIMER1_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/main.c new file mode 100644 index 0000000..ca43e2e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/main.c @@ -0,0 +1,102 @@ +/*! + \file main.c + \brief TIMER1 timebase demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* configure the TIMER peripheral */ +void timer_config(void); +/* configure the TIMER1 interrupt */ +void nvic_config(void); + +/** + \brief configure the TIMER1 interrupt + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER1_IRQn, 1, 1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none +*/ +void timer_config(void) +{ + /* ---------------------------------------------------------------------------- + TIMER1 Configuration: + TIMER1CLK = SystemCoreClock/10800 = 10KHz, the period is 1s(10000/10000 = 1s). + ---------------------------------------------------------------------------- */ + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER1); + + timer_deinit(TIMER1); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + /* TIMER1 configuration */ + timer_initpara.prescaler = 10799; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 9999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_init(TIMER1, &timer_initpara); + + timer_interrupt_flag_clear(TIMER1, TIMER_INT_FLAG_UP); + timer_interrupt_enable(TIMER1, TIMER_INT_UP); + timer_enable(TIMER1); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_led_init(LED2); + + timer_config(); + nvic_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/readme.txt new file mode 100644 index 0000000..282a4ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER1_timebase/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of the TIMER1 timebase demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to configure the +TIMER peripheral update interrupt with the corresponding interrupt request to generate +a time base. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 12000, so the TIMER1 +counter clock is 10KHz. TIMER1 CARL is 10000, so the period is 1s(10000/10000 = 1s). + + Enable TIMER1 update interrupt, so the TIMER1 generates an interrupt each 1s, in the +handler routine, LED2 is toggled each 1s. + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.c new file mode 100644 index 0000000..d42b38b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.c @@ -0,0 +1,188 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include +#include "systick.h" + +uint16_t readvalue1 = 0, readvalue2 = 0; +uint16_t ccnumber = 0; +uint32_t count = 0; +__IO uint16_t fre = 0; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/** + * @brief This function handles TIMER2 interrupt request. + * @param None + * @retval None + */ +void TIMER2_IRQHandler(void) +{ + if(SET == timer_interrupt_flag_get(TIMER2,TIMER_INT_CH0)){ + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER2,TIMER_INT_CH0); + + if(0 == ccnumber){ + /* read channel 0 capture value */ + readvalue1 = timer_channel_capture_value_register_read(TIMER2,TIMER_CH_0); + ccnumber = 1; + }else if(1 == ccnumber){ + /* read channel 0 capture value */ + readvalue2 = timer_channel_capture_value_register_read(TIMER2,TIMER_CH_0); + + if(readvalue2 > readvalue1){ + count = (readvalue2 - readvalue1); + }else{ + count = ((0xFFFF - readvalue1) + readvalue2); + } + + fre = (float)1000000 / count; + ccnumber = 0; + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.h new file mode 100644 index 0000000..9de916f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* TIMER2 handle function */ +void TIMER2_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/main.c new file mode 100644 index 0000000..edb9e9d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/main.c @@ -0,0 +1,148 @@ +/*! + \file main.c + \brief TIMER2 input capture demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "systick.h" +extern __IO uint16_t fre; + +void gpio_configuration(void); +void timer_configuration(void); +void nvic_configuration(void); +int fputc(int ch, FILE *f); + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t) ch); + while (usart_flag_get(EVAL_COM1,USART_FLAG_TBE) == RESET); + return ch; +} + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_configuration(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA6 (TIMER2 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); +} + +/** + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none + */ +void nvic_configuration(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER2_IRQn, 1, 1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_configuration(void) +{ + /* TIMER2 configuration: input capture mode ------------------- + the external signal is connected to TIMER2 CH0 pin (PA6) + the rising edge is used as active edge + the TIMER2 CH0CV is used to compute the frequency value + ------------------------------------------------------------ */ + timer_ic_parameter_struct timer_icinitpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER2); + + timer_deinit(TIMER2); + + /* TIMER2 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 65535; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER2,&timer_initpara); + + /* TIMER2 configuration */ + /* TIMER2 CH0 input capture configuration */ + timer_icinitpara.icpolarity = TIMER_IC_POLARITY_RISING; + timer_icinitpara.icselection = TIMER_IC_SELECTION_DIRECTTI; + timer_icinitpara.icprescaler = TIMER_IC_PSC_DIV1; + timer_icinitpara.icfilter = 0x0; + timer_input_capture_config(TIMER2,TIMER_CH_0,&timer_icinitpara); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER2); + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER2,TIMER_INT_CH0); + /* channel 0 interrupt enable */ + timer_interrupt_enable(TIMER2,TIMER_INT_CH0); + + /* TIMER2 counter enable */ + timer_enable(TIMER2); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + gpio_configuration(); + gd_eval_com_init(EVAL_COM1); + nvic_configuration(); + timer_configuration(); + + while (1){ + delay_1ms(1000); + printf("\r /**** TIMER2 Input Capture Demo ****/\r\n"); + printf(" the frequence is %dHz\r\n", fre); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/readme.txt new file mode 100644 index 0000000..19a7838 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/readme.txt @@ -0,0 +1,56 @@ +/*! + \file readme.txt + \brief description of the TIMER2 input capture demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows TIMER peripheral to +measure the frequency of an external signal. + + The TIMxCLK frequency is set to systemcoreclock,the prescaler is 108 so +the TIMER2 counter clock is 1MHz. + + The external signal is connected to TIMER2 CH0 pin (PA6). + The amplitude of the external signal is better to be set as 3.3V. + The rising edge is used as active edge. + The TIMER2 CH0CV is used to compute the frequency value. + + The available frequence of the input signal is ranging from 16Hz to 20KHz. +You can use USART to watch the frequency of the input signal.The USART is +configured as follow: + - BaudRate = 115200 baud + - Word Length = 8 Bits + - One Stop Bit + - No parity + - Hardware flow control disabled (RTS and CTS signals) + - Receive and transmit enabled + + JP4 must be jumpped to USART. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.h new file mode 100644 index 0000000..2d355fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_inputcapture/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.c new file mode 100644 index 0000000..31252ca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.c @@ -0,0 +1,185 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include +#include "systick.h" + +uint32_t ic1value = 0,ic2value = 0; +__IO uint16_t dutycycle = 0; +__IO uint16_t frequency = 0; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/** + * @brief this function handles TIMER2 interrupt request + * @param None + * @retval None + */ +void TIMER2_IRQHandler(void) +{ + if(SET == timer_interrupt_flag_get(TIMER2,TIMER_INT_CH0)){ + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER2,TIMER_INT_CH0); + /* read channel 0 capture value */ + ic1value = timer_channel_capture_value_register_read(TIMER2,TIMER_CH_0)+1; + + if(0 != ic1value){ + /* read channel 1 capture value */ + ic2value = timer_channel_capture_value_register_read(TIMER2,TIMER_CH_1)+1; + + /* calculate the duty cycle value */ + dutycycle = (ic2value * 100) / ic1value; + /* calculate the frequency value */ + frequency = (float)1000000 / ic1value; + }else{ + /* reset the data */ + dutycycle = 0; + frequency = 0; + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.h new file mode 100644 index 0000000..9de916f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_it.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); +/* TIMER2 handle function */ +void TIMER2_IRQHandler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/main.c new file mode 100644 index 0000000..a1251ba --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/main.c @@ -0,0 +1,156 @@ +/*! + \file main.c + \brief TIMER2 PWM input capture demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" +#include "systick.h" + +extern __IO uint16_t dutycycle; +extern __IO uint16_t frequency; + +void gpio_configuration(void); +void timer_configuration(void); +void nvic_configuration(void); +int fputc(int ch, FILE *f); + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t) ch); + while (usart_flag_get(EVAL_COM1,USART_FLAG_TBE) == RESET); + return ch; +} + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_configuration(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA6 (TIMER2 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); +} + +/** + \brief configure the nested vectored interrupt controller + \param[in] none + \param[out] none + \retval none + */ +void nvic_configuration(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + nvic_irq_enable(TIMER2_IRQn, 1, 1); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_configuration(void) +{ + /* TIMER2 configuration: PWM input mode ------------------------ + the external signal is connected to TIMER2 CH0 pin(PA6) + the rising edge is used as active edge + the TIMER2 CH0CV is used to compute the frequency value + the TIMER2 CH1CV is used to compute the duty cycle value + ------------------------------------------------------------ */ + timer_ic_parameter_struct timer_icinitpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER2); + + timer_deinit(TIMER2); + + /* TIMER2 configuration */ + timer_initpara.prescaler = 107; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 65535; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER2,&timer_initpara); + + /* TIMER2 configuration */ + /* TIMER2 CH0 PWM input capture configuration */ + timer_icinitpara.icpolarity = TIMER_IC_POLARITY_RISING; + timer_icinitpara.icselection = TIMER_IC_SELECTION_DIRECTTI; + timer_icinitpara.icprescaler = TIMER_IC_PSC_DIV1; + timer_icinitpara.icfilter = 0x0; + timer_input_pwm_capture_config(TIMER2,TIMER_CH_0,&timer_icinitpara); + + /* slave mode selection: TIMER2 */ + timer_input_trigger_source_select(TIMER2,TIMER_SMCFG_TRGSEL_CI0FE0); + timer_slave_mode_select(TIMER2,TIMER_SLAVE_MODE_RESTART); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER2); + /* clear channel 0 interrupt bit */ + timer_interrupt_flag_clear(TIMER2,TIMER_INT_CH0); + /* channel 0 interrupt enable */ + timer_interrupt_enable(TIMER2,TIMER_INT_CH0); + + /* TIMER2 counter enable */ + timer_enable(TIMER2); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + systick_config(); + gpio_configuration(); + gd_eval_com_init(EVAL_COM1); + nvic_configuration(); + timer_configuration(); + + while (1){ + delay_1ms(1000); + printf("\r /**** TIMER2 PWM Input Capture Demo ****/\r\n"); + printf(" the dutycycle is %d \n", dutycycle); + printf(" the frequence is %d \n", frequency); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/readme.txt new file mode 100644 index 0000000..201ea6d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/readme.txt @@ -0,0 +1,56 @@ +/*! + \file readme.txt + \brief description of the TIMER2 PWM input capture demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to use the TIMER +peripheral to measure the frequency and duty cycle of an external signal. + + The TIMxCLK frequency is set to systemcoreclock, the prescaler is 108 so the +TIMER2 counter clock is 1MHz. + + The external signal is connected to TIMER2 CH0 pin (PA6). + The rising edge is used as active edge. + The TIMER2 CH0CV is used to compute the frequency value. + The TIMER2 CH1CV is used to compute the duty cycle value. + + The available frequence of the input signal is ranging from 16Hz to 20KHz. +You can use USART to watch the frequency and duty cycle of the input signal. +The USART is configured as follow: + - BaudRate = 115200 baud + - Word Length = 8 Bits + - One Stop Bit + - No parity + - Hardware flow control disabled (RTS and CTS signals) + - Receive and transmit enabled + + JP4 must be jumpped to USART. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.c new file mode 100644 index 0000000..89df60a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.h new file mode 100644 index 0000000..2d355fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMER2_pwminputcapture/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/main.c new file mode 100644 index 0000000..79800d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/main.c @@ -0,0 +1,211 @@ +/*! + \file main.c + \brief TIMERs cascade synchro demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +void gpio_config(void); +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA6(TIMER2 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /*configure PA0(TIMER1 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + + /*configure PA8(TIMER0 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* timers synchronisation in cascade mode ---------------------------- + 1/TIMER1 is configured as master timer: + - PWM mode is used + - The TIMER1 update event is used as trigger output + + 2/TIMER2 is slave for TIMER1 and master for TIMER0, + - PWM mode is used + - The ITR1(TIMER1) is used as input trigger + - external clock mode is used,the counter counts on the rising edges of + the selected trigger. + - the TIMER2 update event is used as trigger output. + + 3/TIMER0 is slave for TIMER2, + - PWM mode is used + - The ITR2(TIMER2) is used as input trigger + - external clock mode is used,the counter counts on the rising edges of + the selected trigger. + -------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocintpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER0); + rcu_periph_clock_enable(RCU_TIMER1); + rcu_periph_clock_enable(RCU_TIMER2); + + /* TIMER1 configuration */ + timer_deinit(TIMER1); + + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 3999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1,&timer_initpara); + + /* CH1 configuration in PWM1 mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER1,TIMER_CH_0,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER1,TIMER_CH_0,1999); + timer_channel_output_mode_config(TIMER1,TIMER_CH_0,TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER1,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); + /* select the master slave mode */ + timer_master_slave_mode_config(TIMER1,TIMER_MASTER_SLAVE_MODE_ENABLE); + /* TIMER1 update event is used as trigger output */ + timer_master_output_trigger_source_select(TIMER1,TIMER_TRI_OUT_SRC_UPDATE); + + /* TIMER2 configuration */ + timer_deinit(TIMER2); + + timer_initpara.prescaler = 0; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 1; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER2,&timer_initpara); + + /* CH0 configuration in PWM1 mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER2,TIMER_CH_0,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER2,TIMER_CH_0,1); + timer_channel_output_mode_config(TIMER2,TIMER_CH_0,TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER2,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER2); + /* slave mode selection: TIMER2 */ + timer_slave_mode_select(TIMER2,TIMER_SLAVE_MODE_EXTERNAL0); + timer_input_trigger_source_select(TIMER2,TIMER_SMCFG_TRGSEL_ITI1); + /* select the master slave mode */ + timer_master_slave_mode_config(TIMER2,TIMER_MASTER_SLAVE_MODE_ENABLE); + /* TIMER2 update event is used as trigger output */ + timer_master_output_trigger_source_select(TIMER2,TIMER_TRI_OUT_SRC_UPDATE); + + /* TIMER0 configuration */ + timer_deinit(TIMER0); + + timer_initpara.prescaler = 0; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 1; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0,&timer_initpara); + + /* CH0 configuration in PWM1 mode */ + timer_ocintpara.outputstate = TIMER_CCX_ENABLE; + timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocintpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocintpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocintpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER0,TIMER_CH_0,&timer_ocintpara); + + timer_channel_output_pulse_value_config(TIMER0,TIMER_CH_0,1); + timer_channel_output_mode_config(TIMER0,TIMER_CH_0,TIMER_OC_MODE_PWM1); + timer_channel_output_shadow_config(TIMER0,TIMER_CH_0,TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + /* TIMER0 output enable */ + timer_primary_output_config(TIMER0,ENABLE); + /* slave mode selection: TIMER0 */ + timer_slave_mode_select(TIMER0,TIMER_SLAVE_MODE_EXTERNAL0); + timer_input_trigger_source_select(TIMER0,TIMER_SMCFG_TRGSEL_ITI2); + + /* TIMER counter enable */ + timer_enable(TIMER1); + timer_enable(TIMER2); + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/readme.txt new file mode 100644 index 0000000..0fe9ecf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_cascadesynchro/readme.txt @@ -0,0 +1,74 @@ +/*! + \file readme.txt + \brief description of the TIMERs cascade synchro demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32103C-EVAL board, it shows how to synchronize +TIMER peripherals in cascade mode. + + In this example three timers are used: + 1/TIMER1 is configured as master timer: + - PWM mode is used + - The TIMER1 update event is used as trigger output + + 2/TIMER2 is slave for TIMER1 and master for TIMER0, + - PWM mode is used + - The ITR0(TIMER1) is used as input trigger + - External clock mode is used,the counter counts on the rising edges of + the selected trigger. + - The TIMER2 update event is used as trigger output. + + 3/TIMER0 is slave for TIMER2, + - PWM mode is used + - The ITR1(TIMER2) is used as input trigger + - External clock mode is used,the counter counts on the rising edges of + the selected trigger. + + The TIMERxCLK is fixed to 108 MHz, the TIMER1 counter clock is : +108MHz/5400= 20 KHz. + + The master timer TIMER1 is running at TIMER1 frequency : + TIMER1 frequency = (TIMER1 counter clock)/ (TIMER1 period + 1) = 5 Hz +and the duty cycle = TIMER1_CH0CC/(TIMER1_CAR + 1) = 50% + + The TIMER2 is running: + - At (TIMER1 frequency)/ (TIMER2 period + 1) = 2.5 Hz and a duty cycle + equal to TIMER2_CH0CC/(TIMER2_CAR + 1) = 50% + + The TIMER0 is running: + - At (TIMER2 frequency)/ (TIMER0 period + 1) = 1.25 Hz and a duty cycle + equal to TIMER0_CH0CC/(TIMER0_CAR + 1) = 50% + + Connect the three pins to a logic analyzer to monitor the different waveforms: + - TIMER1_CH0 pin (PA0) + - TIMER2_CH0 pin (PA6) + - TIMER0_CH0 pin (PA8) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/main.c new file mode 100644 index 0000000..e9804f8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/main.c @@ -0,0 +1,221 @@ +/*! + \file main.c + \brief TIMERs parallel synchro demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +/* configure the GPIO ports */ +void gpio_config(void); +/* configure the TIMER peripheral */ +void timer_config(void); + +/** + \brief configure the GPIO ports + \param[in] none + \param[out] none + \retval none + */ +void gpio_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_AF); + + /*configure PA0(TIMER1 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0); + + /*configure PA6(TIMER2 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /*configure PA8(TIMER0 CH0) as alternate function*/ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8); +} + +/** + \brief configure the TIMER peripheral + \param[in] none + \param[out] none + \retval none + */ +void timer_config(void) +{ + /* timers synchronisation in parallel mode ---------------------------- + 1/TIMER1 is configured as master timer: + - PWM mode is used. + - The TIMER1 update event is used as trigger output. + + 2/TIMER2 is slave for TIMER1, + - PWM mode is used. + - The ITR1(TIMER1) is used as input trigger. + - external clock mode is used, the counter counts on the rising edges of + the selected trigger. + + 3/TIMER0 is slave for TIMER1, + - PWM mode is used. + - The ITR1(TIMER1) is used as input trigger. + - external clock mode is used, the counter counts on the rising edges of + the selected trigger. + -------------------------------------------------------------------- */ + timer_oc_parameter_struct timer_ocinitpara; + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER0); + rcu_periph_clock_enable(RCU_TIMER1); + rcu_periph_clock_enable(RCU_TIMER2); + + /* TIMER1 configuration */ + timer_deinit(TIMER1); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 5399; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 3999; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER1, &timer_initpara); + + /* initialize TIMER channel output parameter struct */ + timer_channel_output_struct_para_init(&timer_ocinitpara); + /* CH1 configuration in PWM0 mode */ + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER1, TIMER_CH_0, &timer_ocinitpara); + + timer_channel_output_pulse_value_config(TIMER1, TIMER_CH_0, 2000); + timer_channel_output_mode_config(TIMER1, TIMER_CH_0, TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER1, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER1); + /* select the master slave mode */ + timer_master_slave_mode_config(TIMER1, TIMER_MASTER_SLAVE_MODE_ENABLE); + /* TIMER1 update event is used as trigger output */ + timer_master_output_trigger_source_select(TIMER1, TIMER_TRI_OUT_SRC_UPDATE); + + /* TIMER2 configuration */ + timer_deinit(TIMER2); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 0; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 1; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER2, &timer_initpara); + + /* initialize TIMER channel output parameter struct */ + timer_channel_output_struct_para_init(&timer_ocinitpara); + /* CH0 configuration in PWM mode 0 */ + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER2, TIMER_CH_0, &timer_ocinitpara); + + timer_channel_output_pulse_value_config(TIMER2, TIMER_CH_0, 1); + timer_channel_output_mode_config(TIMER2, TIMER_CH_0, TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER2, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER2); + /* slave mode selection: TIMER2 */ + timer_slave_mode_select(TIMER2, TIMER_SLAVE_MODE_EXTERNAL0); + timer_input_trigger_source_select(TIMER2, TIMER_SMCFG_TRGSEL_ITI1); + /* select the master slave mode */ + timer_master_slave_mode_config(TIMER2, TIMER_MASTER_SLAVE_MODE_ENABLE); + /* TIMER2 update event is used as trigger output */ + timer_master_output_trigger_source_select(TIMER2, TIMER_TRI_OUT_SRC_UPDATE); + + /* TIMER0 configuration */ + timer_deinit(TIMER0); + /* initialize TIMER init parameter struct */ + timer_struct_para_init(&timer_initpara); + timer_initpara.prescaler = 0; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.period = 1; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0; + timer_init(TIMER0, &timer_initpara); + + /* initialize TIMER channel output parameter struct */ + timer_channel_output_struct_para_init(&timer_ocinitpara); + /* CH0 configuration in PWM0 mode */ + timer_ocinitpara.outputstate = TIMER_CCX_ENABLE; + timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE; + timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH; + timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH; + timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW; + timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; + timer_channel_output_config(TIMER0, TIMER_CH_0, &timer_ocinitpara); + + timer_channel_output_pulse_value_config(TIMER0, TIMER_CH_0, 1); + timer_channel_output_mode_config(TIMER0, TIMER_CH_0, TIMER_OC_MODE_PWM0); + timer_channel_output_shadow_config(TIMER0, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE); + + /* auto-reload preload enable */ + timer_auto_reload_shadow_enable(TIMER0); + /* TIMER0 output enable */ + timer_primary_output_config(TIMER0, ENABLE); + /* slave mode selection: TIMER0 */ + timer_slave_mode_select(TIMER0, TIMER_SLAVE_MODE_EXTERNAL0); + timer_input_trigger_source_select(TIMER0, TIMER_SMCFG_TRGSEL_ITI1); + + /* TIMER counter enable */ + timer_enable(TIMER1); + timer_enable(TIMER2); + timer_enable(TIMER0); +} + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gpio_config(); + timer_config(); + + while (1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/readme.txt new file mode 100644 index 0000000..7412e3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/TIMER/TIMERs_parallelsynchro/readme.txt @@ -0,0 +1,69 @@ +/*! + \file readme.txt + \brief description of the TIMERs parallel synchro demo for gd32e10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it shows how to synchronize +TIMER peripherals in parallel mode. + + In this example three timers are used: + 1/TIMER1 is configured as master timer: + - PWM mode is used. + - The TIMER1 update event is used as trigger output. + + 2/TIMER2 is slave for TIMER1, + - PWM mode is used. + - The ITR1(TIMER1) is used as input trigger. + - external clock mode is used, the counter counts on the rising edges of + the selected trigger. + + 3/TIMER0 is slave for TIMER1, + - PWM mode is used. + - The ITR1(TIMER1) is used as input trigger. + - external clock mode is used, the counter counts on the rising edges of + the selected trigger. + + The TIMERxCLK is fixed to 108 MHz, the TIMER1 counter clock is: +108MHz/5400= 20KHz. + + The master timer TIMER1 CH0(PA0) is running at TIMER1 frequency: + TIMER1 frequency = (TIMER1 counter clock)/ (TIMER1 period + 1) = 5 Hz +and the duty cycle = TIMER1_CH0CV/(TIMER1_CAR + 1) = 50% + + The TIMER2 CH0(PA6) is running: + - At (TIMER1 frequency)/ (TIMER2 period + 1) = 2.5 Hz and a duty cycle + equal to TIMER2_CH0CV/(TIMER2_CAR + 1) = 50% + + The TIMER0 CH0(PA8) is running: + - At (TIMER1 frequency)/ (TIMER0 period + 1) = 2.5 Hz and a duty cycle + equal to TIMER2_CH0CV/(TIMER2_CAR + 1) = 50% + \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/main.c new file mode 100644 index 0000000..ff82ab9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/main.c @@ -0,0 +1,113 @@ +/*! + \file main.c + \brief USART DMA transmitter receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define ARRAYNUM(arr_name) (uint32_t)(sizeof(arr_name) / sizeof(*(arr_name))) +#define USART0_DATA_ADDRESS ((uint32_t)&USART_DATA(USART0)) + +uint8_t rxbuffer[10]; +uint8_t txbuffer[] = "\n\rUSART DMA receive and transmit example, please input 10 bytes:\n\r"; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + dma_parameter_struct dma_init_struct; + /* enable DMA0 */ + rcu_periph_clock_enable(RCU_DMA0); + /* initialize USART */ + gd_eval_com_init(EVAL_COM0); + /* deinitialize DMA channel3(USART0 tx) */ + dma_deinit(DMA0, DMA_CH3); + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)txbuffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = ARRAYNUM(txbuffer); + dma_init_struct.periph_addr = USART0_DATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH3, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH3); + /* enable DMA channel3 */ + dma_channel_enable(DMA0, DMA_CH3); + + /* USART DMA enable for transmission and reception */ + usart_dma_transmit_config(USART0, USART_TRANSMIT_DMA_ENABLE); + + /* wait DMA Channel transfer complete */ + while(RESET == dma_flag_get(DMA0, DMA_CH3, DMA_FLAG_FTF)); + while(1){ + /* deinitialize DMA channel4 (USART0 rx) */ + dma_deinit(DMA0, DMA_CH4); + usart_flag_clear(USART0, USART_FLAG_RBNE); + usart_dma_receive_config(USART0, USART_RECEIVE_DMA_ENABLE); + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)rxbuffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = 10; + dma_init_struct.periph_addr = USART0_DATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH4); + /* enable DMA channel4 */ + dma_channel_enable(DMA0, DMA_CH4); + + /* wait DMA channel transfer complete */ + while(RESET == dma_flag_get(DMA0, DMA_CH4, DMA_FLAG_FTF)); + usart_dma_receive_config(USART0, USART_RECEIVE_DMA_DISABLE); + printf("\n\r%s\n\r", rxbuffer); + } +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/readme.txt new file mode 100644 index 0000000..e12c846 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief USART DMA transmitter receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on theGD32F107C-EVAL-V1.3 board, it shows how to use the USART +DMA transmit and receive. + + Firstly, the USART sends the strings to the hyperterminal and then loops waiting for +receiving max 10 bytes data from the hyperterminal.If the number of data you enter +equal with or more than 10 bytes, USART will send 10 bytes to the hyperterminal. + JP5 jump to USARTO. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..5b11f9d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.c @@ -0,0 +1,175 @@ +/*! + \file gd32e10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern FlagStatus g_transfer_complete; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles DMA0_Channel3_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void DMA0_Channel3_IRQHandler(void) +{ + if(dma_interrupt_flag_get(DMA0, DMA_CH3, DMA_INT_FLAG_FTF)){ + dma_interrupt_flag_clear(DMA0, DMA_CH3, DMA_INT_FLAG_G); + g_transfer_complete = SET; + } +} + +/*! + \brief this function handles DMA0_Channel4_IRQHandler interrupt + \param[in] none + \param[out] none + \retval none +*/ +void DMA0_Channel4_IRQHandler(void) +{ + if(dma_interrupt_flag_get(DMA0, DMA_CH4, DMA_INT_FLAG_FTF)){ + dma_interrupt_flag_clear(DMA0, DMA_CH4, DMA_INT_FLAG_G); + g_transfer_complete = SET; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..890920f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32e10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/main.c new file mode 100644 index 0000000..7c8bb76 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/main.c @@ -0,0 +1,144 @@ +/*! + \file main.c + \brief transmit/receive data using DMA interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USART0_DATA_ADDRESS ((uint32_t)&USART_DATA(USART0)) +#define ARRAYNUM(arr_nanme) (uint32_t)(sizeof(arr_nanme) / sizeof(*(arr_nanme))) + +__IO FlagStatus g_transfer_complete = RESET; +uint8_t rxbuffer[10]; +uint8_t txbuffer[] = "\n\rUSART DMA interrupt receive and transmit example, please input 10 bytes:\n\r"; + +void nvic_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + dma_parameter_struct dma_init_struct; + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* initialize USART */ + gd_eval_com_init(EVAL_COM0); + /*configure DMA0 interrupt*/ + nvic_config(); + + /* deinitialize DMA channel3(USART0 tx) */ + dma_deinit(DMA0, DMA_CH3); + dma_struct_para_init(&dma_init_struct); + + + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)txbuffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = ARRAYNUM(txbuffer); + dma_init_struct.periph_addr = USART0_DATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH3, &dma_init_struct); + + /* deinitialize DMA channel4 (USART0 rx) */ + dma_deinit(DMA0, DMA_CH4); + dma_struct_para_init(&dma_init_struct); + + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)rxbuffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = 10; + dma_init_struct.periph_addr = USART0_DATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.memory_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH3); + dma_memory_to_memory_disable(DMA0, DMA_CH3); + dma_circulation_disable(DMA0, DMA_CH4); + dma_memory_to_memory_disable(DMA0, DMA_CH4); + + /* USART DMA0 enable for reception */ + usart_dma_receive_config(USART0, USART_RECEIVE_DMA_ENABLE); + /* enable DMA0 channel4 transfer complete interrupt */ + dma_interrupt_enable(DMA0, DMA_CH4, DMA_INT_FTF); + /* enable DMA0 channel4 */ + dma_channel_enable(DMA0, DMA_CH4); + /* USART DMA0 enable for transmission */ + usart_dma_transmit_config(USART0, USART_TRANSMIT_DMA_ENABLE); + /* enable DMA0 channel3 transfer complete interrupt */ + dma_interrupt_enable(DMA0, DMA_CH3, DMA_INT_FTF); + /* enable DMA0 channel3 */ + dma_channel_enable(DMA0, DMA_CH3); + + /* waiting for the transfer to complete*/ + while(RESET == g_transfer_complete); + + g_transfer_complete = RESET; + + /* waiting for the transfer to complete*/ + while(RESET == g_transfer_complete); + + printf("\n\r%s\n\r", rxbuffer); + while(1); +} + +/*! + \brief configure DMA interrupt + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(DMA0_Channel3_IRQn, 0, 0); + nvic_irq_enable(DMA0_Channel4_IRQn, 0, 1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/readme.txt new file mode 100644 index 0000000..0c8ba7e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/DMA_transmitter&receiver_interrupt/readme.txt @@ -0,0 +1,44 @@ +/*! + \file readme.txt + \brief description of transmit/receive data using DMA interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it provides a description +of how to use DMA channel3 to transmit data from RAM memory to USART data +register and how to use DMA channel4 to receive data from USART data register +to RAM memory. + + Firstly, the USART sends the strings to the hyperterminal and then waiting for +receiving max 10 bytes data from the hyperterminal. If the number of data you enter +equal with or more than 10 bytes, USART will send 10 bytes to the hyperterminal. + + JP5 and JP6 must be fitted. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/main.c new file mode 100644 index 0000000..bdf3552 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/main.c @@ -0,0 +1,187 @@ +/*! + \file main.c + \brief USART half-duplex transmitter and receiver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define ARRAYNUM(arr_nanme) (uint32_t)(sizeof(arr_nanme) / sizeof(*(arr_nanme))) +#define TRANSMIT_SIZE0 (ARRAYNUM(transmitter_buffer0)) +#define TRANSMIT_SIZE1 (ARRAYNUM(transmitter_buffer1)) + +uint8_t transmitter_buffer0[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F}; +uint8_t transmitter_buffer1[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F}; +uint8_t receiver_buffer0[TRANSMIT_SIZE1]; +uint8_t receiver_buffer1[TRANSMIT_SIZE0]; +uint8_t transfersize0 = TRANSMIT_SIZE0; +uint8_t transfersize1 = TRANSMIT_SIZE1; +__IO uint8_t txcount0 = 0; +__IO uint16_t rxcount0 = 0; +__IO uint8_t txcount1 = 0; +__IO uint16_t rxcount1 = 0; +ErrStatus state1 = ERROR; +ErrStatus state2 = ERROR; + +ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* enable USART and GPIOA clock */ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_USART0); + rcu_periph_clock_enable(RCU_USART1); + + /* configure USART0 Tx as alternate function push-pull */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + /* configure USART1 Tx as alternate function push-pull */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + /* configure the USART0 Tx pin and USART1 Tx pin */ + + /* USART0 and USART1 baudrate configuration */ + usart_baudrate_set(USART0, 115200); + usart_baudrate_set(USART1, 115200); + + /* enable USART0 half duplex mode*/ + usart_halfduplex_enable(USART0); + /* enable USART1 half duplex mode*/ + usart_halfduplex_enable(USART1); + + /* configure USART transmitter */ + usart_transmit_config(USART0, USART_TRANSMIT_ENABLE); + usart_transmit_config(USART1, USART_TRANSMIT_ENABLE); + + /* configure USART receiver */ + usart_receive_config(USART0, USART_RECEIVE_ENABLE); + usart_receive_config(USART1, USART_RECEIVE_ENABLE); + + /* enable USART */ + usart_enable(USART0); + usart_enable(USART1); + + /* clear the USART1 data register */ + usart_data_receive(USART1); + /* USART0 transmit and USART1 receive */ + while(transfersize0--) + { + /* wait until end of transmit */ + while(RESET == usart_flag_get(USART0, USART_FLAG_TBE)); + usart_data_transmit(USART0, transmitter_buffer0[txcount0++]); + + while(RESET == usart_flag_get(USART1, USART_FLAG_RBNE)); + /* store the received byte in the receiver_buffer1 */ + receiver_buffer1[rxcount0++] = usart_data_receive(USART1); + } + /* clear the USART0 data register */ + usart_data_receive(USART0); + /* USART1 transmit and USART0 receive */ + while(transfersize1--) + { + /* wait until end of transmit */ + while(RESET == usart_flag_get(USART1, USART_FLAG_TBE)); + usart_data_transmit(USART1, transmitter_buffer1[txcount1++]); + + while(RESET == usart_flag_get(USART0, USART_FLAG_RBNE)); + /* store the received byte in the receiver_buffer0 */ + receiver_buffer0[rxcount1++] = usart_data_receive(USART0); + } + + /* compare the received data with the send ones */ + state1 = memory_compare(transmitter_buffer0, receiver_buffer1, TRANSMIT_SIZE0); + state2 = memory_compare(transmitter_buffer1, receiver_buffer0, TRANSMIT_SIZE1); + if(SUCCESS == state1){ + /* if the data transmitted from USART0 and received by USART1 are the same */ + gd_eval_led_on(LED2); + }else{ + /* if the data transmitted from USART0 and received by USART1 are not the same */ + gd_eval_led_off(LED2); + } + if(SUCCESS == state2){ + /* if the data transmitted from USART1 and received by USART0 are the same */ + gd_eval_led_on(LED3); + }else{ + /* if the data transmitted from USART1 and received by USART0 are not the same */ + gd_eval_led_off(LED3); + } + while(1){ + } +} + +/*! + \brief memory compare function + \param[in] src: source data + \param[in] dst: destination data + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint16_t length) +{ + while(length--){ + if(*src++ != *dst++){ + return ERROR; + } + } + return SUCCESS; +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM1, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM1, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/readme.txt new file mode 100644 index 0000000..dde9bad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Half_duplex_transmitter&receiver/readme.txt @@ -0,0 +1,42 @@ +/*! + \file readme.txt + \brief description of the USART HalfDuplex + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F107C-EVAL-V1.3 board, it provides a basic communication +USART0 whith USART1 in Half-Duplex mode. + + The transmitter_buffer0 and transmitter_buffer1 are sent by USART0 and USART1 respectively and +displayed in HyperTerminal. If the data received by USART0 is equal to transmitter_buffer1, LED2 +is turned on. If the data received by USART1 is equal to transmitter_buffer0, LED3 is turned on. + + connect USART0_Tx(PA9) to USART1_Tx(PA2) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..18498a5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.c @@ -0,0 +1,174 @@ +/*! + \file gd32e10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "gd32f10x_eval.h" + +extern uint8_t rx_count; +extern uint8_t receive_flag; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USART interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void USART0_IRQHandler(void) +{ + if(RESET != usart_interrupt_flag_get(USART0, USART_INT_FLAG_IDLE)) { + /* clear IDLE flag */ + usart_data_receive(USART0); + /* toggle the LED2 */ + gd_eval_led_toggle(LED2); + + /* number of data received */ + rx_count = 256 - (dma_transfer_number_get(DMA0, DMA_CH4)); + receive_flag = 1; + + /* disable DMA and reconfigure */ + dma_channel_disable(DMA0, DMA_CH4); + dma_transfer_number_config(DMA0, DMA_CH4, 256); + dma_channel_enable(DMA0, DMA_CH4); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..f16db5f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_it.h @@ -0,0 +1,61 @@ +/*! + \file gd32e10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* NMI handle function */ +void NMI_Handler(void); +/* HardFault handle function */ +void HardFault_Handler(void); +/* MemManage handle function */ +void MemManage_Handler(void); +/* BusFault handle function */ +void BusFault_Handler(void); +/* UsageFault handle function */ +void UsageFault_Handler(void); +/* SVC handle function */ +void SVC_Handler(void); +/* DebugMon handle function */ +void DebugMon_Handler(void); +/* PendSV handle function */ +void PendSV_Handler(void); +/* SysTick handle function */ +void SysTick_Handler(void); +/* USART0 handle function */ +void USART0_IRQHandler(void); +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..c6de971 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/main.c new file mode 100644 index 0000000..6be2eed --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/main.c @@ -0,0 +1,160 @@ +/*! + \file main.c + \brief USART DMA receive by IDLE interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define USART0_RDATA_ADDRESS ((uint32_t)&USART_DATA(USART0)) + +uint8_t rxbuffer[256]; +uint8_t rx_count = 0; +uint8_t tx_count = 0; +__IO uint8_t receive_flag = 0; + +void dma_config(void); +void usart_config(void); +void nvic_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_on(LED2); + nvic_config(); + + /* initialize DMA */ + dma_config(); + + /* initialize USART */ + usart_config(); + + usart_interrupt_enable(USART0, USART_INT_IDLE); + printf("\n\rPlease send data less than 256 bytes:\n\r"); + + /* wait the data is received and send to the hyperterminal */ + while(1) { + if(1 == receive_flag) { + for(tx_count = 0; tx_count < rx_count; tx_count++) { + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + usart_data_transmit(EVAL_COM0, rxbuffer[tx_count]); + } + receive_flag = 0; + } + } +} + +/*! + \brief configure USART DMA + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) +{ + dma_parameter_struct dma_init_struct; + + rcu_periph_clock_enable(RCU_DMA0); + + /* deinitialize DMA channel4 (USART0 rx) */ + dma_deinit(DMA0, DMA_CH4); + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)rxbuffer; + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT; + dma_init_struct.number = 256; + dma_init_struct.periph_addr = USART0_RDATA_ADDRESS; + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; + dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH; + dma_init(DMA0, DMA_CH4, &dma_init_struct); + /* configure DMA mode */ + dma_circulation_disable(DMA0, DMA_CH4); + /* enable DMA channel4 */ + dma_channel_enable(DMA0, DMA_CH4); +} + +/*! + \brief configure USART + \param[in] none + \param[out] none + \retval none +*/ +void usart_config(void) +{ + /* enable GPIO clock */ + rcu_periph_clock_enable(RCU_GPIOA); + + /* enable USART clock */ + rcu_periph_clock_enable(RCU_USART0); + + /* connect port to USARTx_Tx */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + + /* connect port to USARTx_Rx */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + + /* USART configure */ + usart_deinit(USART0); + usart_baudrate_set(USART0, 115200U); + usart_receive_config(USART0, USART_RECEIVE_ENABLE); + usart_transmit_config(USART0, USART_TRANSMIT_ENABLE); + usart_dma_receive_config(USART0, USART_RECEIVE_DMA_ENABLE); + usart_dma_transmit_config(USART0, USART_TRANSMIT_DMA_ENABLE); + usart_enable(USART0); +} + +/*! + \brief configure NVIC + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + nvic_irq_enable(USART0_IRQn, 0, 0); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/readme.txt new file mode 100644 index 0000000..b4ff380 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/IDLE_receiver_interrupt/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of USART DMA receive by IDLE interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32F107C-EVAL-V1.3 board, it shows how to use the USART +DMA receive data by IDLE interrupt(the length of data is not fixed). + Firstly, the LED2 is on and USART waiting for receiving max 256 bytes data from the +hyperterminal. Every time if the number of data(length is not fixed) you sent from the +hyperterminal, LED2 will be toggled and the received data will be send to the hyperterminal. + +JP5 jump to USART0. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/main.c new file mode 100644 index 0000000..1188044 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/main.c @@ -0,0 +1,107 @@ +/*! + \file main.c + \brief USART printf + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include + +/* open the macro to use USART0 remapping */ +//#define USART0_REMAP + +void usart_config(void); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usart_config(); + printf("a usart transmit test example!"); + while(1); +} + +/*! + \brief USART0 configure + \param[in] none + \param[out] none + \retval none +*/ +void usart_config(void) +{ + /* enable USART clock */ + rcu_periph_clock_enable(RCU_USART0); + + #if defined USART0_REMAP + /* enable GPIO clock */ + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + /* USART0 remapping */ + gpio_pin_remap_config(GPIO_USART0_REMAP, ENABLE); + /* connect port to USARTx_Tx */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + /* connect port to USARTx_Rx */ + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + #else + /* enable GPIO clock */ + rcu_periph_clock_enable(RCU_GPIOA); + + /* connect port to USARTx_Tx */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); + /* connect port to USARTx_Rx */ + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + #endif + + /* USART configure */ + usart_deinit(USART0); + usart_baudrate_set(USART0, 115200U); + usart_word_length_set(USART0, USART_WL_8BIT); + usart_stop_bit_set(USART0, USART_STB_1BIT); + usart_parity_config(USART0, USART_PM_NONE); + usart_hardware_flow_rts_config(USART0, USART_RTS_DISABLE); + usart_hardware_flow_cts_config(USART0, USART_CTS_DISABLE); + usart_receive_config(USART0, USART_RECEIVE_ENABLE); + usart_transmit_config(USART0, USART_TRANSMIT_ENABLE); + usart_enable(USART0); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(USART0, (uint8_t)ch); + while(RESET == usart_flag_get(USART0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/readme.txt new file mode 100644 index 0000000..ecf9b54 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Printf/readme.txt @@ -0,0 +1,47 @@ +/*! + \file readme.txt + \brief description of the USART printf + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F107C-EVAL-V1.3 board, it shows how to retarget the C +library printf function to the USART. + If the macro USART0_REMAP is defined to use the USART0 remapping function, jump PA9 +to PB6, PA10 to PB7. + + The USARTx is configured as follow: + - BaudRate = 115200 baud + - Word Length = 8 Bits + - One Stop Bit + - No parity + - Hardware flow control disabled (RTS and CTS signals) + - Receive and transmit enabled + JP5 jump to USART0 \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.c new file mode 100644 index 0000000..09bcfea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.c @@ -0,0 +1,138 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ +#include "gd32f10x_it.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.h new file mode 100644 index 0000000..2170e8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_it.h @@ -0,0 +1,58 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/main.c new file mode 100644 index 0000000..2a65a8a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/main.c @@ -0,0 +1,249 @@ +/*! + \file main.c + \brief USART synchronous + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include + +#define txbuffer_size1 (countof(txbuffer1) - 1) +#define txbuffer_size2 (countof(txbuffer2) - 1) +#define DYMMY_BYTE 0x00000000 +#define countof(a) (sizeof(a) / sizeof(*(a))) + +uint8_t txbuffer1[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F}; +uint8_t txbuffer2[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F}; +uint8_t rxbuffer1[txbuffer_size2]; +uint8_t rxbuffer2[txbuffer_size1]; +__IO uint8_t data_read1 = txbuffer_size2; +__IO uint8_t data_read2 = txbuffer_size1; +__IO uint8_t tx_counter1 = 0, rx_counter1 = 0; +__IO uint8_t tx_counter2 = 0, rx_counter2 = 0; +__IO ErrStatus state1 = ERROR; +__IO ErrStatus state2 = ERROR; + +void usart_config(void); +void spi_config(void); +void led_init(void); +ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint16_t length); + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* initialize leds */ + led_init(); + /* turn off LED2~5 */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + + /* configure USART */ + usart_config(); + + /* configure SPI */ + spi_config(); + + while(data_read2--){ + while(RESET == usart_flag_get(USART0, USART_FLAG_TBE)){ + } + /* write one byte in the USART0 data register */ + usart_data_transmit(USART0, txbuffer1[tx_counter1++]); + /* wait until end of transmit */ + while(RESET == usart_flag_get(USART0, USART_FLAG_TC)){ + } + /* wait the byte is entirely received by SPI0 */ + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_RBNE)){ + } + /* store the received byte in the rxbuffer2 */ + rxbuffer2[rx_counter2++] = spi_i2s_data_receive(SPI0); + } + + /* clear the USART0 data register */ + usart_data_receive(USART0); + + while(data_read1--){ + /* wait until end of transmit */ + while(RESET == spi_i2s_flag_get(SPI0, SPI_FLAG_TBE)){ + } + /* write one byte in the SPI0 transmit data register */ + spi_i2s_data_transmit(SPI0, txbuffer2[tx_counter2++]); + + /* send a dummy byte to generate clock to slave */ + usart_data_transmit(USART0, DYMMY_BYTE); + /* wait until end of transmit */ + while(RESET == usart_flag_get(USART0, USART_FLAG_TC)){ + } + /* wait the byte is entirely received by USART0 */ + while(RESET == usart_flag_get(USART0, USART_FLAG_RBNE)){ + } + /* store the received byte in the rxbuffer1 */ + rxbuffer1[rx_counter1++] = usart_data_receive(USART0); + } + + /* check the received data with the send ones */ + state1 = memory_compare(txbuffer1, rxbuffer2, txbuffer_size1); + state2 = memory_compare(txbuffer2, rxbuffer1, txbuffer_size2); + + if(SUCCESS == state1){ + /* if the data transmitted from USART0 and received by SPI0 are the same */ + gd_eval_led_on(LED2); + gd_eval_led_on(LED4); + }else{ + /* if the data transmitted from USART0 and received by SPI0 are not the same */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED4); + } + if(SUCCESS == state2){ + /* if the data transmitted from SPI0 and received by USART0 are the same */ + gd_eval_led_on(LED3); + gd_eval_led_on(LED5); + }else{ + /* if the data transmitted from SPI0 and received by USART0 are not the same */ + gd_eval_led_off(LED3); + gd_eval_led_off(LED5); + } + while(1){ + } +} +/*! + \brief configure USART + \param[in] none + \param[out] none + \retval none +*/ +void usart_config(void) +{ + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_USART0); + rcu_periph_clock_enable(RCU_AF); + + /* configure USART Tx as alternate function push-pull */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9|GPIO_PIN_8); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10); + + /* configure USART synchronous mode */ + usart_synchronous_clock_enable(USART0); + usart_synchronous_clock_config(USART0, USART_CLEN_EN, USART_CPH_2CK, USART_CPL_HIGH); + + usart_baudrate_set(USART0, 115200); + /* configure USART transmitter */ + usart_transmit_config(USART0, USART_TRANSMIT_ENABLE); + /* configure USART receiver */ + usart_receive_config(USART0, USART_RECEIVE_ENABLE); + /* enable USART */ + usart_enable(USART0); +} + +/*! + \brief configure SPI + \param[in] none + \param[out] none + \retval none +*/ +void spi_config(void) +{ + spi_parameter_struct spi_init_parameter; + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_AF); + + spi_i2s_deinit(SPI0); + + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_5 | GPIO_PIN_6); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_10MHZ, GPIO_PIN_7); + + /* configure SPI0 */ + spi_init_parameter.device_mode = SPI_SLAVE; + spi_init_parameter.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_parameter.frame_size = SPI_FRAMESIZE_8BIT; + spi_init_parameter.nss = SPI_NSS_SOFT; + spi_init_parameter.endian = SPI_ENDIAN_LSB; + spi_init_parameter.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_parameter.prescale = SPI_PSC_32; + spi_init(SPI0, &spi_init_parameter); + + /* SPI0 enable */ + spi_enable(SPI0); +} + +/*! + \brief initialize leds + \param[in] none + \param[out] none + \retval none +*/ +void led_init(void) +{ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} + +/*! + \brief memory compare function + \param[in] src: source data + \param[in] dst: destination data + \param[in] length: the compare data length + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus memory_compare(uint8_t* src, uint8_t* dst, uint16_t length) +{ + while(length--){ + if(*src++ != *dst++){ + return ERROR; + } + } + return SUCCESS; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/readme.txt new file mode 100644 index 0000000..7dadf55 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Synchronous/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief USART synchronous + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F107C-EVAL-V1.3 board, it provides a basic +communication between USART0 (Synchronous mode) and SPI0. First, USART0 +transmit a series of data to SPI0, then SPI0 transmit a series of data +to USART0. Compare the transmitted data and the received data. If the +data transmitted from USART0 and received by SPI0 are the same, LED2 and +LED4 will on, otherwise off. If the data transmitted from SPI0 and +received by USART0 are the same, LED3 and LED5 will on, otherwise off. + + connect SPI0 SCK pin(PA5) TO USART0_CK pin(PA8) + connect SPI0 MISO pin(PA6) TO USART0_RX pin(PA10) + connect SPI0 MOSI pin(PA7) TO USART0_TX pin(PA9) + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.c new file mode 100644 index 0000000..0bac963 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.c @@ -0,0 +1,166 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" + +extern uint8_t tx_size; +extern uint8_t rx_size; +extern __IO uint8_t txcount; +extern __IO uint16_t rxcount; +extern uint8_t rxbuffer[32]; +extern uint8_t txbuffer[]; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USART RBNE interrupt request and TBE interrupt request + \param[in] none + \param[out] none + \retval none +*/ +void USART0_IRQHandler(void) +{ + if(RESET != usart_interrupt_flag_get(USART0, USART_INT_FLAG_RBNE)){ + /* receive data */ + rxbuffer[rxcount++] = usart_data_receive(USART0); + if(rxcount == rx_size){ + usart_interrupt_disable(USART0, USART_INT_RBNE); + } + } + if(RESET != usart_interrupt_flag_get(USART0, USART_INT_FLAG_TBE)){ + /* transmit data */ + usart_data_transmit(USART0, txbuffer[txcount++]); + if(txcount == tx_size){ + usart_interrupt_disable(USART0, USART_INT_TBE); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_libopt.h new file mode 100644 index 0000000..569f0a9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/main.c new file mode 100644 index 0000000..3ff6a9d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/main.c @@ -0,0 +1,84 @@ +/*! + \file main.c + \brief USART transmit and receive interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include +#include "gd32f10x_eval.h" + +#define ARRAYNUM(arr_nanme) (uint32_t)(sizeof(arr_nanme) / sizeof(*(arr_nanme))) +#define TRANSMIT_SIZE (ARRAYNUM(txbuffer) - 1) + +uint8_t txbuffer[] = "\n\rUSART interrupt test\n\r"; +uint8_t rxbuffer[32]; +uint8_t tx_size = TRANSMIT_SIZE; +uint8_t rx_size = 32; +__IO uint8_t txcount = 0; +__IO uint16_t rxcount = 0; + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* USART interrupt configuration */ + nvic_irq_enable(USART0_IRQn, 0, 0); + /* configure COM0 */ + gd_eval_com_init(EVAL_COM0); + /* enable USART TBE interrupt */ + usart_interrupt_enable(USART0, USART_INT_TBE); + + /* wait until USART send the transmitter_buffer */ + while(txcount < tx_size); + + while(RESET == usart_flag_get(USART0, USART_FLAG_TC)); + + usart_interrupt_enable(USART0, USART_INT_RBNE); + + /* wait until USART receive the receiver_buffer */ + while(rxcount < rx_size); + if(rxcount == rx_size) + printf("\n\rUSART receive successfully!\n\r"); + while (1); +} + +/* retarget the C library printf function to the USART */ +int fputc(int ch, FILE *f) +{ + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)); + return ch; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/readme.txt new file mode 100644 index 0000000..6f32f7f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USART/Transmitter&receiver_interrupt/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief description of the USART transmit and receive interrupt + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F107C-EVAL-V1.3 board, it shows how to use the USART +transmit and receive interrupts to communicate with the hyperterminal. + + Firstly, the USART sends the strings to the hyperterminal and still waits for +receiving data from the hyperterminal. Only the number of data you enter is equal +to or more than 32 bytes, USART will send strings: "USART receive successfully!" +(the reception is stopped when this maximum receive value is reached). + JP5 jump to USART0. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewp new file mode 100644 index 0000000..a8a14ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewp @@ -0,0 +1,1066 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f103c_audio_codec.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewt new file mode 100644 index 0000000..0d688fd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.ewt @@ -0,0 +1,1171 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f103c_audio_codec.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.eww new file mode 100644 index 0000000..778937f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/EWARM/audio.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\audio.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvopt new file mode 100644 index 0000000..efce2dd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvopt @@ -0,0 +1,649 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + audio + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U59400616 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 + + + 0 + UL2CM3 + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 18 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 72 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 52 + 0 + 0 + 0 + 0 + ..\src\gd32f103c_audio_codec.c + gd32f103c_audio_codec.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 29 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 15 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + audio_core.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 24 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + audio_out_itf.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 24 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvoptx new file mode 100644 index 0000000..0b572a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvoptx @@ -0,0 +1,572 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + audio + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U59400616 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\src\gd32f103c_audio_codec.c + gd32f103c_audio_codec.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + audio_core.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + audio_out_itf.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 24 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvproj new file mode 100644 index 0000000..6f3ed36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvproj @@ -0,0 +1,579 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + audio + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + audio + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + gd32f103c_audio_codec.c + 1 + ..\src\gd32f103c_audio_codec.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + audio_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + + + audio_out_itf.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvprojx new file mode 100644 index 0000000..1b59b9c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/MDK-ARM/audio.uvprojx @@ -0,0 +1,572 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + audio + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + audio + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + gd32f103c_audio_codec.c + 1 + ..\src\gd32f103c_audio_codec.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + audio_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_core.c + + + audio_out_itf.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\audio\Source\audio_out_itf.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f103c_audio_codec.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f103c_audio_codec.h new file mode 100644 index 0000000..d5dc577 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f103c_audio_codec.h @@ -0,0 +1,127 @@ +/*! + \file gd32f103c_audio_codec.h + \brief header file of the low layer driver for audio codec + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F103C_AUDIO_CODEC_H +#define __GD32F103C_AUDIO_CODEC_H + +#include "gd32f10x.h" + +/* Select the interrupt preemption priority and sub-priority for the DMA interrupt */ +#define AD_IRQ_PREPRIO 0 +#define AD_IRQ_SUBRIO 0 + +/* uncomment the defines below to select if the master clock mode should be enabled or not */ +#define IIS_MCLK_ENABLED +/* #define IIS_MCLK_DISABLED */ + +/* hardware configuration defines parameters */ + +/* I2S peripheral configuration defines (data and control interface of the audio codec) */ +#define AD_I2S SPI1 +#define AD_I2S_CLK RCU_SPI1 +#define AD_I2S_ADDRESS (SPI1+0x0C) +#define AD_I2S_IRQ SPI1_IRQn +#define AD_I2S_WS_PIN GPIO_PIN_12 +#define AD_I2S_SCK_PIN GPIO_PIN_13 +#define AD_I2S_SD_PIN GPIO_PIN_15 +#define AD_I2S_MCK_PIN GPIO_PIN_6 +#define AD_I2S_MCK_GPIO GPIOC +#define AD_I2S_GPIO GPIOB +#define AD_I2S_GPIO_CLK RCU_GPIOB +#define AD_I2S_MCK_CLK RCU_GPIOC + +/* I2S DMA stream definitions */ +#define AD_DMA_CLOCK RCU_DMA0 +#define AD_DMA_CHANNEL DMA_CH4 +#define AD_DMA_IRQ DMA0_Channel4_IRQn +#define AD_DMA_FLAG_TC DMA_FLAG_FTF +#define AD_DMA_FLAG_HT DMA_FLAG_HTF +#define AD_DMA_FLAG_TE DMA_FLAG_ERR +#define AD_DMA_FLAG_GL DMA_INT_FLAG_G +#define AD_DMA_FLAG_ALL DMA_INT_FLAG_G +#define AD_DMA DMA0 + +#define Audio_DMA_IRQHandler DMA0_Channel4_IRQHandler + +/* mute commands */ +#define AD_MUTE 0x01U +#define AD_UNMUTE 0x00U + +/* functions return value */ +#define AD_OK 0x00U +#define AD_FAIL 0xFFU + +#define AD_PAUSE 0U +#define AD_RESUME 1U + +/* audio machine states */ +#define AD_STATE_INACTIVE 0x00U +#define AD_STATE_ACTIVE 0x01U +#define AD_STATE_PLAYING 0x02U +#define AD_STATE_PAUSED 0x03U +#define AD_STATE_STOPPED 0x04U +#define AD_STATE_ERROR 0x05U + +/* mask for the bit en of the i2s cfgr register */ +#define I2S_ENABLE_MASK (0x0400) + +/* audio commands enumeration */ +typedef enum +{ + AD_CMD_PLAY = 1U, + AD_CMD_PAUSE, + AD_CMD_STOP, +}audio_cmd_enum; + +/* function declarations */ +/* initializes the audio codec audio interface (i2s) */ +void codec_audio_interface_init(uint32_t audio_freq); +/* deinitialize the audio codec audio interface */ +void codec_audio_interface_deinit(void); +/* initializes IOs used by the audio codec */ +void codec_gpio_init(void); +/* deinitialize IOs used by the audio codec interface */ +void codec_gpio_deinit(void); +/* initializes dma to prepare for audio data transfer */ +void codec_i2s_dma_init(void); +/* restore default state of the used media */ +void codec_i2s_dma_deinit(void); +/* starts playing audio stream from the audio media */ +void audio_play(uint32_t addr, uint32_t size); +/* pauses or resumes the audio stream playing from the media */ +void audio_pause_resume(uint32_t cmd, uint32_t addr, uint32_t size); +/* stops audio stream playing on the used media */ +void audio_stop(void); + +#endif /* __GD32F103C_AUDIO_CODEC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_conf.h new file mode 100644 index 0000000..accc1eb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_conf.h @@ -0,0 +1,97 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "gd32f103c_audio_codec.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 2U + +#define USBD_AD_INTERFACE 0U + +/* class layer parameter */ +#define AD_TOTAL_IF_NUM 0x02U + +#define AD_OUT_EP EP_OUT(1) + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x20U) +#define EP0_TX_ADDR (0x60U) + +#define AD_BUF_ADDR (AD_BUF0_ADDR | (AD_BUF1_ADDR << 16U)) + +#define AD_BUF0_ADDR (0xA0U) +#define AD_BUF1_ADDR (0xF0U) + +/* speaker parameter */ +#define USBD_SPEAKER_FREQ USBD_AD_FREQ_16K +#define SPEAKER_OUT_BIT_RESOLUTION 16 +#define SPEAKER_OUT_CHANNEL_NBR 2 /* Mono = 1, Stereo = 2 */ +#define SPEAKER_OUT_PACKET (uint32_t)(((USBD_SPEAKER_FREQ * \ + (SPEAKER_OUT_BIT_RESOLUTION/8) *\ + SPEAKER_OUT_CHANNEL_NBR) /1000)) + +#define SPEAKER_OUT_MAX_PACKET SPEAKER_OUT_PACKET + +/* Audio frequency in Hz */ +#define USBD_AD_FREQ_48K 48000U +#define USBD_AD_FREQ_44K 44100U +#define USBD_AD_FREQ_16K 16000U +#define USBD_AD_FREQ_22K 22000U + +#define DEFAULT_VOLUME 65U /* Default volume in % (Mute=0%, Max = 100%) in Logarithmic values. + To get accurate volume variations, it is possible to use a logarithmic + coversion table to convert from percentage to logarithmic law. + In order to keep this example code simple, this conversion is not used.*/ + +/* USB user string supported */ +#define USB_SUPPORT_USER_STRING_DESC + +/* endpoint count used by the Printer device */ +#define EP_COUNT (2U) + +#define USB_STRING_COUNT 4U + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_hw.h new file mode 100644 index 0000000..f562937 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/inc/usbd_hw.h @@ -0,0 +1,49 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* configure rcu clock */ +void rcu_config(void); + +/* configure gpio port */ +void gpio_config(void); + +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/readme.txt new file mode 100644 index 0000000..8fdd273 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/readme.txt @@ -0,0 +1,68 @@ +/*! + \file readme.txt + \brief description of the USB Audio demo. + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB-Device peripheral. + + The Audio device example allows device to communicate with host (PC) as USB headphone +using isochronous pipe for audio data transfer along with some control commands (i.e. +Mute). + + It follows the "Universal Serial Bus Device Class Definition for Audio Devices +Release 1.0 March 18, 1998" defined by the USB Implementers Forum for reprogramming +an application through USB-FS-Device. + + Following this specification, it is possible to manage only Full Speed USB mode +(High Speed is not supported). + + This class is natively supported by most Operating Systems (no need for specific +driver setup). + + This example uses the I2S interface to stream audio data from USB Host to the audio +codec implemented on the evaluation board. Then audio stream is output to the Headphone. + + For the GD32F103C board, it possible to use one of the two quartz below: + - 14.7456MHz which provides best audio quality + - Standard 25MHz which provides lesser quality + + The device supports one audio frequency (the host driver manages the sampling rate +conversion from original audio file sampling rate to the sampling rate supported +by the device). It is possible to configure this audio frequency by modifying the +usbd_conf.h file (define USBD_AUDIO_FREQ). It is advised to set high frequencies +to guarantee a high audio quality. + It is also possible to modify the default volume through define DEFAULT_VOLUME in file +usbd_conf.h. + +note: The audio frequencies leading to non integer number of data (44.1KHz, 22.05KHz, + 11.025KHz...) will not allow an optimum audio quality since one data will be lost + every two/more frames. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f103c_audio_codec.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f103c_audio_codec.c new file mode 100644 index 0000000..dbceef3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f103c_audio_codec.c @@ -0,0 +1,347 @@ +/*! + \file gd32f103c_audio_codec.c + \brief the low layer driver for audio codec + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f103c_audio_codec.h" +#include "audio_core.h" +#include "usbd_core.h" +#include "gd32f10x_spi.h" + +extern usb_dev usbd_audio; + +/* this structure is declared global because it is handled by two different functions */ +static dma_parameter_struct dma_initstructure; + +uint32_t i2s_audiofreq = 0; + +/*! + \brief initializes the audio codec audio interface (i2s) + \note this function assumes that the i2s input clock (through pll_r in + devices reva/z and through dedicated plli2s_r in devices revb/y) + is already configured and ready to be used + \param[in] audio_freq: audio frequency to be configured for the i2s peripheral + \param[out] none + \retval none +*/ +void codec_audio_interface_init(uint32_t audio_freq) +{ + i2s_audiofreq = audio_freq; + + /* enable the AD_I2S peripheral clock */ + rcu_periph_clock_enable(AD_I2S_CLK); + + /* AD_I2S peripheral configuration */ + spi_i2s_deinit(AD_I2S); + + /* initialize the I2S peripheral with the structure above */ + i2s_psc_config(AD_I2S, audio_freq, I2S_FRAMEFORMAT_DT16B_CH16B, +#ifdef IIS_MCLK_ENABLED + I2S_MCKOUT_ENABLE +#elif defined(IIS_MCLK_DISABLED) + I2S_MCKOUT_DISABLE +#endif + ); + + i2s_init(AD_I2S, I2S_MODE_MASTERTX, I2S_STD_MSB, I2S_CKPL_HIGH); + + /* enable the I2S DMA TX request */ + spi_dma_enable( AD_I2S, SPI_DMA_TRANSMIT); +} + +/*! + \brief deinitialize the audio codec audio interface + \param[in] none + \param[out] none + \retval none +*/ +void codec_audio_interface_deinit(void) +{ + /* disable the codec_i2s peripheral */ + i2s_disable(AD_I2S); + + /* deinitialize the codec_i2s peripheral */ + spi_i2s_deinit(AD_I2S); + + /* disable the codec_i2s peripheral clock */ + rcu_periph_clock_disable(AD_I2S_CLK); +} + +/*! + \brief initializes IOs used by the audio codec + \param[in] none + \param[out] none + \retval none +*/ +void codec_gpio_init(void) +{ + /* enable GPIO clock */ + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(AD_I2S_GPIO_CLK); + rcu_periph_clock_enable(AD_I2S_MCK_CLK); + + /* AD_I2S pins configuraiton: WS, SCK and SD pins */ + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_WS_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_SCK_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_SD_PIN); + +#ifdef IIS_MCLK_ENABLED + /* codec_i2s pins configuraiton: mck pin */ + gpio_init(AD_I2S_MCK_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_MCK_PIN); +#endif /* IIS_MCLK_ENABLED */ +} + +/*! + \brief deinitialize IOs used by the audio codec interface + \param[in] none + \param[out] none + \retval none +*/ +void codec_gpio_deinit(void) +{ + /* deinitialize all the GPIOs used by the driver */ + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_WS_PIN ); + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_SCK_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_SD_PIN); + +#ifdef IIS_MCLK_ENABLED + /* AD_I2S pins deinitialization: MCK pin */ + gpio_init(AD_I2S_MCK_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_MCK_PIN); +#endif /* IIS_MCLK_ENABLED */ +} + +/*! + \brief initializes dma to prepare for audio data transfer + from Media to the I2S peripheral + \param[in] none + \param[out] none + \retval none +*/ +void codec_i2s_dma_init(void) +{ + /* enable the DMA clock */ + rcu_periph_clock_enable(AD_DMA_CLOCK); + + /* configure the DMA Stream */ + dma_deinit(AD_DMA, AD_DMA_CHANNEL); + + /* set the parameters to be configured */ + dma_initstructure.periph_addr = AD_I2S_ADDRESS; + dma_initstructure.memory_addr = (uint32_t)0; + dma_initstructure.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_initstructure.number = (uint32_t)0xFFFF; + dma_initstructure.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_initstructure.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_initstructure.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_initstructure.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_circulation_disable(AD_DMA, AD_DMA_CHANNEL); + dma_initstructure.priority = DMA_PRIORITY_HIGH; + + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the selected dma interrupts */ + dma_interrupt_enable(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FTF); + + /* I2S DMA IRQ channel configuration */ + nvic_irq_enable(AD_DMA_IRQ, AD_IRQ_PREPRIO, AD_IRQ_SUBRIO); +} + +/*! + \brief restore default state of the used media + \param[in] none + \param[out] none + \retval none +*/ +void codec_i2s_dma_deinit(void) +{ + /* deinitialize the NVIC interrupt for the I2S DMA Stream */ + nvic_irq_disable(AD_DMA_IRQ); + + /* disable the DMA channel before the deinitialization */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* deinitialize the DMA channel */ + dma_deinit(AD_DMA, AD_DMA_CHANNEL); +} + +/*! + \brief starts playing audio stream from the audio media + \param[in] addr: pointer to the audio stream buffer + \param[in] size: number of data in the audio stream buffer + \param[out] none + \retval none +*/ +void audio_play(uint32_t addr, uint32_t size) +{ + /* disable the I2S DMA Stream*/ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_FTF); + + /* configure the buffer address and size */ + dma_initstructure.memory_addr = (uint32_t)addr; + dma_initstructure.number = (uint32_t)size; + + /* configure the DMA Stream with the new parameters */ + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the I2S DMA Stream*/ + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + + /* if the i2s peripheral is still not enabled, enable it */ + if ((SPI_I2SCTL(AD_I2S) & I2S_ENABLE_MASK) == 0) { + i2s_enable(AD_I2S); + } +} + +/*! + \brief pauses or resumes the audio stream playing from the media + \param[in] cmd: AD_PAUSE (or 0) to pause, AD_RESUME (or any value different + from 0) to resume + \param[in] addr: address from/at which the audio stream should resume/pause + \param[in] size: number of data to be configured for next resume + \param[out] none + \retval none +*/ +void audio_pause_resume(uint32_t cmd, uint32_t addr, uint32_t size) +{ + /* pause the audio file playing */ + if (cmd == AD_PAUSE) { + /* stop the current DMA request by resetting the I2S peripherals */ + codec_audio_interface_deinit(); + + /* re-configure the I2S interface for the next resume operation */ + codec_audio_interface_init(i2s_audiofreq); + + /* disable the DMA Stream */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_ALL); + } else { + /* configure the buffer address and size */ + dma_initstructure.memory_addr = (uint32_t)addr; + dma_initstructure.number = (uint32_t)size; + + /* configure the DMA Stream with the new parameters */ + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the I2S DMA Stream*/ + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + + /* if the I2S peripheral is still not enabled, enable it */ + if (0U == (SPI_I2SCTL(AD_I2S) & I2S_ENABLE_MASK)) { + i2s_enable(AD_I2S); + } + } +} + +/*! + \brief stops audio stream playing on the used media + \param[in] none + \param[out] none + \retval none +*/ +void audio_stop(void) +{ + /* stop the current DMA request by resetting the I2S cell */ + codec_audio_interface_deinit(); + + /* re-configure the I2S interface for the next play operation */ + codec_audio_interface_init(i2s_audiofreq); + + /* stop the transfer on the I2S side: Stop and disable the DMA stream */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear all the DMA flags for the next transfer */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_ALL); +} + +/*! + \brief this function handles main media layer interrupt + \param[in] none + \param[out] none + \retval 0 if correct communication, else wrong communication +*/ +void Audio_DMA_IRQHandler(void) +{ + uint16_t remain_size = 0; + usbd_audio_handler *audio = usbd_audio.class_data[USBD_AD_INTERFACE]; + + /* transfer complete interrupt */ + if(dma_flag_get(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_TC) != RESET){ + /* increment to the next sub-buffer */ + audio->isoc_out_rdptr += audio->dam_tx_len; + + if (audio->isoc_out_rdptr >= (audio->isoc_out_buff + TOTAL_OUT_BUF_SIZE)) { + /* roll back to the start of buffer */ + audio->isoc_out_rdptr = audio->isoc_out_buff; + } + + if (audio->isoc_out_wrptr >= audio->isoc_out_rdptr) { + remain_size = audio->isoc_out_wrptr - audio->isoc_out_rdptr; + } else { + remain_size = TOTAL_OUT_BUF_SIZE + audio->isoc_out_buff - audio->isoc_out_rdptr; + } + + /* check if the end of file has been reached */ + if (remain_size > 0) { + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the TC flag */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_TC); + + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_ERR); + + DMA_CHMADDR(AD_DMA, AD_DMA_CHANNEL) = (uint32_t)audio->isoc_out_rdptr; + + DMA_CHCNT(AD_DMA, AD_DMA_CHANNEL) = (uint32_t)((remain_size/2) & DMA_CHANNEL_CNT_MASK); + + /* update the current DMA tx data length */ + audio->dam_tx_len = (remain_size/2)*2; + + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + }else{ + /* disable the I2S DMA Stream*/ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_FTF); + + /* clear flag */ + audio->dam_tx_len = 0; + audio->play_flag = 0U; + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_it.c new file mode 100644 index 0000000..d6e541a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_it.c @@ -0,0 +1,175 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +extern usb_dev usbd_audio; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +/*! + \brief this function handles USBD high priority interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_HP_CAN0_TX_IRQHandler (void) +{ + usbd_int_hpst(&usbd_audio); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..f40c940 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/gd32f10x_usbd_hw.c @@ -0,0 +1,92 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + if (system_clock == 48000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1); + } else if (system_clock == 72000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1_5); + } else if (system_clock == 96000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + } else { + /* reserved */ + } + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 2 bits for PreEmption priority, 2 bits for SubPriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 2U, 0U); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_HP_CAN0_TX_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/main.c new file mode 100644 index 0000000..2b8657d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/main.c @@ -0,0 +1,65 @@ +/*! + \file main.c + \brief USB audio device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "audio_core.h" +#include "usbd_hw.h" + +usb_dev usbd_audio; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_audio, &audio_desc, &audio_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_audio); + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/system_gd32f10x.c new file mode 100644 index 0000000..45dce05 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/audio_headphone/src/system_gd32f10x.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewp new file mode 100644 index 0000000..137ad4a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewp @@ -0,0 +1,1055 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewt new file mode 100644 index 0000000..d46e0e5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.ewt @@ -0,0 +1,1159 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.eww new file mode 100644 index 0000000..28f99e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/EWARM/cdc_acm.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\cdc_acm.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvopt new file mode 100644 index 0000000..582488d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvopt @@ -0,0 +1,620 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + cdc_acm + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 5 + 14 + 2 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 6 + 15 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 6 + 16 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 7 + 17 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 7 + 18 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 7 + 19 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 7 + 20 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 8 + 21 + 1 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + cdc_acm_core.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 58133820 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvoptx new file mode 100644 index 0000000..f66193d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvoptx @@ -0,0 +1,556 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + cdc_acm + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + 0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 5 + 14 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 6 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 6 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 7 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 7 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 7 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 7 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 8 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + cdc_acm_core.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvproj new file mode 100644 index 0000000..a0fd27b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvproj @@ -0,0 +1,564 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + cdc_acm + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + cdc_acm + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + cdc_acm_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvprojx new file mode 100644 index 0000000..211d4df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/MDK-ARM/cdc_acm.uvprojx @@ -0,0 +1,557 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + cdc_acm + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + cdc_acm + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + cdc_acm_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Source\cdc_acm_core.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_conf.h new file mode 100644 index 0000000..189fe28 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_conf.h @@ -0,0 +1,86 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +#define CDC_COM_INTERFACE 0U + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +//#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* endpoint count used by the CDC ACM device */ +#define CDC_CMD_EP EP_IN(2U) +#define CDC_IN_EP EP_IN(1U) +#define CDC_OUT_EP EP_OUT(3U) + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0x80U) + +/* CDC data Tx buffer address offset */ +#define BULK_TX_ADDR (0x140U) + +/* CDC data Rx buffer address offset */ +#define BULK_RX_ADDR (0x100U) + +/* CDC command Tx buffer address offset */ +#define INT_TX_ADDR (0xC0U) + +#define CDC_ACM_CMD_PACKET_SIZE 8U +#define CDC_ACM_DATA_PACKET_SIZE 64U + +/* endpoint count used by the CDC ACM device */ +#define EP_COUNT (4U) + +#define USB_STRING_COUNT 4U + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif/* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_hw.h new file mode 100644 index 0000000..6e99a8c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usb hardware configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure rcu clock */ +void rcu_config(void); +/* configure gpio */ +void gpio_config(void); +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/readme.txt new file mode 100644 index 0000000..3f286d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief Description of the USB CDC_ACM demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB-Device peripheral. + + The target of this example is to read data from and write data to USB devices using +the CDC protocol. + + It makes the USB device look like a serial port (NO serial cable connectors: You +can see the data transferred to and from via USB instead of USB-to-USART bridge connection). + This example loops back the contents of a text file over usb port. To run the example, +Type a message using the PC's keyboard. Any data that shows in HyperTerminal is received +from the device. + This CDC_ACM Demo provides the firmware examples for the GD32F10x families. + + - OUT transfers (receive the data from the PC to GD32): + When a packet is received from the PC on the OUT pipe (EP3),by calling cdc_acm_data_receive( ) + it will be stored in the usb_data_buffer[]. + + - IN transfers (to send the data received from the GD32 to the PC): + When a packet is sent from the GD32 on the IN pipe (EP1), by calling cdc_acm_data_send(), + put the data into the usb_data_buffer[] buffer for sending data to the host. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..5127130 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/gd32f10x_usbd_hw.c @@ -0,0 +1,89 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + if (system_clock == 48000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1); + } else if (system_clock == 72000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1_5); + } else if (system_clock == 96000000U) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + } else { + /* reserved */ + } + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/main.c new file mode 100644 index 0000000..9f9f87f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/main.c @@ -0,0 +1,74 @@ +/*! + \file main.c + \brief USB CDC ACM device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "cdc_acm_core.h" +#include "usbd_hw.h" + +usb_dev usbd_cdc; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_cdc, &cdc_desc, &cdc_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_cdc); + + while (USBD_CONFIGURED != usbd_cdc.cur_status) { + /* wait for standard USB enumeration is finished */ + } + + while (1) { + if (0U == cdc_acm_check_ready(&usbd_cdc)) { + cdc_acm_data_receive(&usbd_cdc); + } else { + cdc_acm_data_send(&usbd_cdc); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/cdc_acm/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewp new file mode 100644 index 0000000..597611d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewp @@ -0,0 +1,1052 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Appliction + + $PROJ_DIR$\..\src\dual_cdc_acm_core.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewt new file mode 100644 index 0000000..f97eb8b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.ewt @@ -0,0 +1,1156 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Appliction + + $PROJ_DIR$\..\src\dual_cdc_acm_core.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.eww new file mode 100644 index 0000000..fda292a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/EWARM/dual_cdc.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\dual_cdc.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvopt new file mode 100644 index 0000000..94e50ea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvopt @@ -0,0 +1,612 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + dual_cdc + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 46 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 17 + 0 + 0 + 0 + 0 + ..\src\dual_cdc_acm_core.c + dual_cdc_acm_core.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 55 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 21 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 7 + 21 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 8 + 22 + 5 + 0 + 0 + 47 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvoptx new file mode 100644 index 0000000..edb4b96 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvoptx @@ -0,0 +1,548 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + dual_cdc + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + 0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\dual_cdc_acm_core.c + dual_cdc_acm_core.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 7 + 21 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 8 + 22 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvproj new file mode 100644 index 0000000..1c13244 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvproj @@ -0,0 +1,559 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + dual_cdc + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dual_cdc + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + dual_cdc_acm_core.c + 1 + ..\src\dual_cdc_acm_core.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvprojx new file mode 100644 index 0000000..50babc0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/MDK-ARM/dual_cdc.uvprojx @@ -0,0 +1,552 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + dual_cdc + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dual_cdc + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\cdc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + dual_cdc_acm_core.c + 1 + ..\src\dual_cdc_acm_core.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/dual_cdc_acm_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/dual_cdc_acm_core.h new file mode 100644 index 0000000..b0eefdd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/dual_cdc_acm_core.h @@ -0,0 +1,99 @@ +/*! + \file cdc_acm_core.h + \brief the header file of IAP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DUAL_CDC_ACM_CORE_H +#define __DUAL_CDC_ACM_CORE_H + +#include "cdc_acm_core.h" + +#define CDC_DATA_ITF_NUM 2U + +#pragma pack(1) + +typedef struct +{ + usb_desc_header header; /*!< regular descriptor header containing the descriptor's type and length */ + uint8_t bFirstInterface; /*!< bFirstInterface */ + uint8_t bInterfaceCount; /*!< bInterfaceCount */ + uint8_t bFunctionClass; /*!< bFunctionClass */ + uint8_t bFunctionSubClass; /*!< bFunctionSubClass */ + uint8_t bFunctionProtocol; /*!< bFunctionProtocol */ + uint8_t iFunction; /*!< iFunction */ +} usb_desc_IAD; + +#pragma pack() + +typedef struct +{ + usb_desc_config config; + usb_desc_IAD cdc_iad0; + usb_desc_itf cdc_loopback_interface0; + usb_desc_header_func cdc_loopback_header0; + usb_desc_call_managment_func cdc_loopback_call_managment0; + usb_desc_acm_func cdc_loopback_acm0; + usb_desc_union_func cdc_loopback_union0; + usb_desc_ep cdc_loopback_cmd_endpoint0; + usb_desc_itf cdc_loopback_data_interface0; + usb_desc_ep cdc_loopback_out_endpoint0; + usb_desc_ep cdc_loopback_in_endpoint0; + usb_desc_IAD cdc_iad1; + usb_desc_itf cdc_loopback_interface1; + usb_desc_header_func cdc_loopback_header1; + usb_desc_call_managment_func cdc_loopback_call_managment1; + usb_desc_acm_func cdc_loopback_acm1; + usb_desc_union_func cdc_loopback_union1; + usb_desc_ep cdc_loopback_cmd_endpoint1; + usb_desc_itf cdc_loopback_data_interface1; + usb_desc_ep cdc_loopback_out_endpoint1; + usb_desc_ep cdc_loopback_in_endpoint1; +} usb_dual_cdc_desc_config_set; + +extern usb_desc dual_cdc_desc; +extern usb_class dual_cdc_class; + +/* function declarations */ +/* receive CDC ACM 0 data */ +void cdc_data_receive0(usb_dev *udev); +/* receive CDC ACM 1 data */ +void cdc_data_receive1(usb_dev *udev); +/* send CDC ACM 0 data */ +void cdc_acm_data_send0(usb_dev *udev); +/* send CDC ACM 1 data */ +void cdc_acm_data_send1(usb_dev *udev); +/* check CDC ACM 0 is ready for data transfer */ +uint8_t cdc_check_ready0(usb_dev *udev); +/* check CDC ACM 1 is ready for data transfer */ +uint8_t cdc_check_ready1(usb_dev *udev); + +#endif /* __DUAL_CDC_ACM_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_conf.h new file mode 100644 index 0000000..be77924 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_conf.h @@ -0,0 +1,98 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 4U + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +//#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* endpoint count used by the CDC ACM device 0 */ +#define CDC_ACM0_CMD_EP EP_IN(3U) +#define CDC_ACM0_DATA_IN_EP EP_IN(1U) +#define CDC_ACM0_DATA_OUT_EP EP_OUT(1U) + +/* endpoint count used by the CDC ACM device 1 */ +#define CDC_ACM1_CMD_EP EP_IN(4U) +#define CDC_ACM1_DATA_IN_EP EP_IN(2U) +#define CDC_ACM1_DATA_OUT_EP EP_OUT(2U) + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0x80U) + +/* CDC0 data Tx buffer address offset */ +#define BULK0_TX_ADDR (0x110U) + +/* CDC0 data Rx buffer address offset */ +#define BULK0_RX_ADDR (0xD0U) + +/* CDC0 command Tx buffer address offset */ +#define INT0_TX_ADDR (0xC0U) + +/* CDC1 data Tx buffer address offset */ +#define BULK1_TX_ADDR (0x1A0U) + +/* CDC1 data Rx buffer address offset */ +#define BULK1_RX_ADDR (0x160U) + +/* CDC1 command Tx buffer address offset */ +#define INT1_TX_ADDR (0x150U) + + +#define CDC_ACM_CMD_PACKET_SIZE 8U +#define CDC_ACM_DATA_PACKET_SIZE 64U + +/* endpoint count used by the CDC ACM device */ +#define EP_COUNT (5U) +#define USB_STRING_COUNT 4U + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_hw.h new file mode 100644 index 0000000..526cb77 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure rcu clock */ +void rcu_config(void); +/* configure gpio port */ +void gpio_config(void); +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/readme.txt new file mode 100644 index 0000000..111e812 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/readme.txt @@ -0,0 +1,52 @@ +/*! + \file readme.txt + \brief Description of the USB CDC_ACM demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB-Device peripheral. + + The target of this example is to read data from and write data to USB devices using +the CDC protocol. + It makes the USB device look like a serial port (NO serial cable connectors: You +can see the data transferred to and from via USB instead of USB-to-USART bridge connection). + This example loops back the contents of a text file over usb port. To run the example, +Type a message using the PC's keyboard. Any data that shows in HyperTerminal is received +from the device. + This CDC_ACM Demo provides the firmware examples for the GD32F10x families. + + - OUT transfers (receive the data from the PC to GD32): + When a packet is received from the PC on the OUT pipe (EP3),by calling cdc_acm_data_receive( ) + it will be stored in the usb_data_buffer[]. + + - IN transfers (to send the data received from the GD32 to the PC): + When a packet is sent from the GD32 on the IN pipe (EP1), by calling cdc_acm_data_send(), + put the data into the usb_data_buffer[] buffer for sending data to the host. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/dual_cdc_acm_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/dual_cdc_acm_core.c new file mode 100644 index 0000000..b59e89c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/dual_cdc_acm_core.c @@ -0,0 +1,757 @@ +/*! + \file dual_cdc_acm_core.c + \brief CDC ACM driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "dual_cdc_acm_core.h" + +#define USBD_VID 0x28E9 +#define USBD_PID 0x029B + +/* note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev dual_cdc_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200, + .bDeviceClass = 0xEF, + .bDeviceSubClass = 0x02, + .bDeviceProtocol = 0x01, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +usb_dual_cdc_desc_config_set dual_cdc_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG, + }, + .wTotalLength = sizeof(usb_dual_cdc_desc_config_set), + .bNumInterfaces = 0x04, + .bConfigurationValue = 0x01, + .iConfiguration = 0x00, + .bmAttributes = 0x80, + .bMaxPower = 0x32 + }, + + .cdc_iad0 = + { + .header = + { + .bLength = sizeof(usb_desc_IAD), + .bDescriptorType = 0x0BU + }, + .bFirstInterface = 0x00, + .bInterfaceCount = 0x02, + .bFunctionClass = 0x02, + .bFunctionSubClass = 0x02, + .bFunctionProtocol = 0x01, + .iFunction = 0x00 + }, + + .cdc_loopback_interface0 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x01, + .bInterfaceClass = 0x02, + .bInterfaceSubClass = 0x02, + .bInterfaceProtocol = 0x01, + .iInterface = 0x00 + }, + + .cdc_loopback_header0 = + { + .header = + { + .bLength = sizeof(usb_desc_header_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x00, + .bcdCDC = 0x0110 + }, + + .cdc_loopback_call_managment0 = + { + .header = + { + .bLength = sizeof(usb_desc_call_managment_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x01, + .bmCapabilities = 0x00, + .bDataInterface = 0x01 + }, + + .cdc_loopback_acm0 = + { + .header = + { + .bLength = sizeof(usb_desc_acm_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x02, + .bmCapabilities = 0x02, + }, + + .cdc_loopback_union0 = + { + .header = + { + .bLength = sizeof(usb_desc_union_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x06, + .bMasterInterface = 0x00, + .bSlaveInterface0 = 0x01, + }, + + .cdc_loopback_cmd_endpoint0 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM0_CMD_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CDC_ACM_CMD_PACKET_SIZE, + .bInterval = 0x0A + }, + + .cdc_loopback_data_interface0 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x0A, + .bInterfaceSubClass = 0x00, + .bInterfaceProtocol = 0x00, + .iInterface = 0x00 + }, + + .cdc_loopback_out_endpoint0 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM0_DATA_OUT_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00 + }, + + .cdc_loopback_in_endpoint0 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM0_DATA_IN_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00 + }, + + .cdc_iad1 = + { + .header = + { + .bLength = sizeof(usb_desc_IAD), + .bDescriptorType = 0x0B + }, + .bFirstInterface = 0x02, + .bInterfaceCount = 0x02, + .bFunctionClass = 0x02, + .bFunctionSubClass = 0x02, + .bFunctionProtocol = 0x01, + .iFunction = 0x00 + }, + + .cdc_loopback_interface1 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x02, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x01, + .bInterfaceClass = 0x02, + .bInterfaceSubClass = 0x02, + .bInterfaceProtocol = 0x01, + .iInterface = 0x00 + }, + + .cdc_loopback_header1 = + { + .header = + { + .bLength = sizeof(usb_desc_header_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x00, + .bcdCDC = 0x0110 + }, + + .cdc_loopback_call_managment1 = + { + .header = + { + .bLength = sizeof(usb_desc_call_managment_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x01, + .bmCapabilities = 0x00, + .bDataInterface = 0x03 + }, + + .cdc_loopback_acm1 = + { + .header = + { + .bLength = sizeof(usb_desc_acm_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x02, + .bmCapabilities = 0x02, + }, + + .cdc_loopback_union1 = + { + .header = + { + .bLength = sizeof(usb_desc_union_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x06, + .bMasterInterface = 0x02, + .bSlaveInterface0 = 0x03, + }, + + .cdc_loopback_cmd_endpoint1 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM1_CMD_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CDC_ACM_CMD_PACKET_SIZE, + .bInterval = 0x0A + }, + + .cdc_loopback_data_interface1 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x03, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x0A, + .bInterfaceSubClass = 0x00, + .bInterfaceProtocol = 0x00, + .iInterface = 0x00 + }, + + .cdc_loopback_out_endpoint1 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM1_DATA_OUT_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00 + }, + + .cdc_loopback_in_endpoint1 = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_ACM1_DATA_IN_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00 + } +}; + +/* USB language ID Descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(13U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'D', 'U', 'A', 'L', '_', 'C', 'D', 'C'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +static uint8_t* usbd_dual_cdc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc dual_cdc_desc = { + .dev_desc = (uint8_t *)&dual_cdc_dev_desc, + .config_desc = (uint8_t *)&dual_cdc_config_desc, + .strings = usbd_dual_cdc_strings +}; + +static uint8_t dual_cdc_init (usb_dev *udev, uint8_t config_index); +static uint8_t dual_cdc_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t dual_cdc_req_handler (usb_dev *udev, usb_req *req); +static uint8_t dual_cdc_ctlx_out (usb_dev *udev); + +static void dual_cdc_data_in (usb_dev *udev, uint8_t ep_num); +static void dual_cdc_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class dual_cdc_class = { + .req_cmd = 0xFFU, + + .init = dual_cdc_init, + .deinit = dual_cdc_deinit, + .req_process = dual_cdc_req_handler, + .ctlx_out = dual_cdc_ctlx_out, + .data_in = dual_cdc_data_in, + .data_out = dual_cdc_data_out +}; + +/*! + \brief receive CDC ACM 0 data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_data_receive0(usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[0]; + + cdc->packet_receive = 0U; + cdc->pre_packet_send = 0U; + + usbd_ep_recev(udev, CDC_ACM0_DATA_OUT_EP, (uint8_t*)(cdc->data), USB_CDC_RX_LEN); +} + +/*! + \brief receive CDC ACM 1 data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_data_receive1(usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[1]; + + cdc->packet_receive = 0U; + cdc->pre_packet_send = 0U; + + usbd_ep_recev(udev, CDC_ACM1_DATA_OUT_EP, (uint8_t*)(cdc->data), USB_CDC_RX_LEN); +} + +/*! + \brief send CDC ACM 0 data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_acm_data_send0(usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[0]; + uint32_t data_len = cdc->receive_length; + + if ((0U != data_len) && (1U == cdc->packet_sent)) { + cdc->packet_sent = 0U; + usbd_ep_send(udev, CDC_ACM0_DATA_IN_EP, (uint8_t*)(cdc->data), (uint16_t)data_len); + cdc->receive_length = 0U; + } +} + +/*! + \brief send CDC ACM 1 data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_acm_data_send1(usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[1]; + uint32_t data_len = cdc->receive_length; + + if ((0U != data_len) && (1U == cdc->packet_sent)) { + cdc->packet_sent = 0U; + usbd_ep_send(udev, CDC_ACM1_DATA_IN_EP, (uint8_t*)(cdc->data), (uint16_t)data_len); + cdc->receive_length = 0U; + } +} + +/*! + \brief check CDC ACM 0 is ready for data transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval 0 if cdc is ready, 5 else +*/ +uint8_t cdc_check_ready0(usb_dev *udev) +{ + if (udev->class_data[0] != NULL) { + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[0]; + + if ((1U == cdc->packet_receive) && (1U == cdc->pre_packet_send)) { + return 0U; + } + } + + return 5U; +} + +/*! + \brief check CDC ACM 1 is ready for data transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval 0 if cdc is ready, 5 else +*/ +uint8_t cdc_check_ready1(usb_dev *udev) +{ + if (udev->class_data[1] != NULL) { + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[1]; + + if ((1U == cdc->packet_receive) && (1U == cdc->pre_packet_send)) { + return 0U; + } + } + + return 5U; +} + +/*! + \brief initialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dual_cdc_init (usb_dev *udev, uint8_t config_index) +{ + static usb_cdc_handler cdc_handler0, cdc_handler1; + + /* initialize the data Tx/Rx endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, BULK0_TX_ADDR, &(dual_cdc_config_desc.cdc_loopback_in_endpoint0)); + usbd_ep_init(udev, EP_BUF_SNG, BULK0_RX_ADDR, &(dual_cdc_config_desc.cdc_loopback_out_endpoint0)); + + usbd_ep_init(udev, EP_BUF_SNG, BULK1_TX_ADDR, &(dual_cdc_config_desc.cdc_loopback_in_endpoint1)); + usbd_ep_init(udev, EP_BUF_SNG, BULK1_RX_ADDR, &(dual_cdc_config_desc.cdc_loopback_out_endpoint1)); + + /* initialize the command Tx endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, INT0_TX_ADDR, &(dual_cdc_config_desc.cdc_loopback_cmd_endpoint0)); + usbd_ep_init(udev, EP_BUF_SNG, INT1_TX_ADDR, &(dual_cdc_config_desc.cdc_loopback_cmd_endpoint1)); + + udev->ep_transc[EP_ID(CDC_ACM0_DATA_IN_EP)][TRANSC_IN] = dual_cdc_class.data_in; + udev->ep_transc[CDC_ACM0_DATA_OUT_EP][TRANSC_OUT] = dual_cdc_class.data_out; + + udev->ep_transc[EP_ID(CDC_ACM1_DATA_IN_EP)][TRANSC_IN] = dual_cdc_class.data_in; + udev->ep_transc[CDC_ACM1_DATA_OUT_EP][TRANSC_OUT] = dual_cdc_class.data_out; + + /* initialize cdc handler 0 structure */ + cdc_handler0.packet_receive = 0U; + cdc_handler0.packet_sent = 1U; + cdc_handler0.pre_packet_send = 1U; + cdc_handler0.receive_length = 0U; + + cdc_handler0.line_coding = (acm_line){ + .dwDTERate = 115200, + .bCharFormat = 0, + .bParityType = 0, + .bDataBits = 0x08 + }; + + udev->class_data[0] = (void *)&cdc_handler0; + + /* initialize cdc handler 1 structure */ + cdc_handler1.packet_receive = 0U; + cdc_handler1.packet_sent = 1U; + cdc_handler1.pre_packet_send = 1U; + cdc_handler1.receive_length = 0U; + + cdc_handler1.line_coding = (acm_line){ + .dwDTERate = 115200, + .bCharFormat = 0, + .bParityType = 0, + .bDataBits = 0x08 + }; + + udev->class_data[1] = (void *)&cdc_handler1; + + return USBD_OK; +} + +/*! + \brief deinitialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dual_cdc_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize the data Tx/Rx endpoint */ + usbd_ep_deinit(udev, CDC_ACM0_DATA_IN_EP); + usbd_ep_deinit(udev, CDC_ACM0_DATA_OUT_EP); + + usbd_ep_deinit(udev, CDC_ACM1_DATA_IN_EP); + usbd_ep_deinit(udev, CDC_ACM1_DATA_OUT_EP); + + /* deinitialize the command Tx endpoint */ + usbd_ep_deinit(udev, CDC_ACM0_CMD_EP); + usbd_ep_deinit(udev, CDC_ACM1_CMD_EP); + + return USBD_OK; +} + +/*! + \brief command data received on control endpoint + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t dual_cdc_ctlx_out (usb_dev *udev) +{ + usb_cdc_handler *cdc0 = (usb_cdc_handler *)udev->class_data[0]; + usb_cdc_handler *cdc1 = (usb_cdc_handler *)udev->class_data[1]; + + if (NO_CMD != udev->class_core->req_cmd) { + cdc0->packet_receive = 1U; + cdc0->pre_packet_send = 1U; + + cdc1->packet_receive = 1U; + cdc1->pre_packet_send = 1U; + + udev->class_core->req_cmd = NO_CMD; + } + + return USBD_OK; +} + +/*! + \brief handle CDC ACM data in DATA IN transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static void dual_cdc_data_in (usb_dev *udev, uint8_t ep_num) +{ + usb_cdc_handler *cdc = NULL; + usb_transc *transc = &udev->transc_in[ep_num]; + + if ((CDC_ACM0_DATA_IN_EP & 0x7F) == ep_num) { + cdc = (usb_cdc_handler *)udev->class_data[0]; + } else { + cdc = (usb_cdc_handler *)udev->class_data[1]; + } + + if (transc->xfer_count == transc->max_len) { + usbd_ep_send(udev, EP_ID(ep_num), NULL, 0U); + } else { + cdc->packet_sent = 1U; + cdc->pre_packet_send = 1U; + } +} + +/*! + \brief handle CDC ACM data in DATA OUT transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static void dual_cdc_data_out (usb_dev *udev, uint8_t ep_num) +{ + usb_cdc_handler *cdc = NULL; + + if (ep_num == (CDC_ACM0_DATA_OUT_EP & 0x7F)) { + cdc = (usb_cdc_handler *)udev->class_data[0]; + } else { + cdc = (usb_cdc_handler *)udev->class_data[1]; + } + + cdc->packet_receive = 1U; + cdc->receive_length = udev->transc_out[ep_num].xfer_count; +} + +/*! + \brief handle the CDC ACM class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t dual_cdc_req_handler (usb_dev *udev, usb_req *req) +{ + usb_cdc_handler *cdc = NULL; + uint8_t status = REQ_NOTSUPP, noti_buf[10] = {0U}; + + if(0x00 == (req->wIndex & 0xFF)){ + cdc = (usb_cdc_handler *)udev->class_data[0]; + }else { + cdc = (usb_cdc_handler *)udev->class_data[1]; + } + + acm_notification *notif = (void *)noti_buf; + + switch (req->bRequest) { + case SEND_ENCAPSULATED_COMMAND: + break; + + case GET_ENCAPSULATED_RESPONSE: + break; + + case SET_COMM_FEATURE: + break; + + case GET_COMM_FEATURE: + break; + + case CLEAR_COMM_FEATURE: + break; + + case SET_LINE_CODING: + /* set the value of the current command to be processed */ + udev->class_core->req_cmd = req->bRequest; + + usb_transc_config(&udev->transc_out[0U], (uint8_t *)&cdc->line_coding, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case GET_LINE_CODING: + usb_transc_config(&udev->transc_in[0U], (uint8_t *)&cdc->line_coding, 7U, 0U); + + status = REQ_SUPP; + break; + + case SET_CONTROL_LINE_STATE: + notif->bmRequestType = 0xA1U; + notif->bNotification = USB_CDC_NOTIFY_SERIAL_STATE; + notif->wIndex = 0U; + notif->wValue = 0U; + notif->wLength = 2U; + noti_buf[8] = (uint8_t)req->wValue & 3U; + noti_buf[9] = 0U; + + status = REQ_SUPP; + break; + + case SEND_BREAK: + break; + + default: + break; + } + + return status; +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..4d4494b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/main.c new file mode 100644 index 0000000..ba69c20 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/main.c @@ -0,0 +1,80 @@ +/*! + \file main.c + \brief USB dual CDC ACM device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dual_cdc_acm_core.h" +#include "usbd_hw.h" + +usb_dev usbd_dual_cdc; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_dual_cdc, &dual_cdc_desc, &dual_cdc_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_dual_cdc); + + while (USBD_CONFIGURED != usbd_dual_cdc.cur_status) { + /* wait for standard USB enumeration is finished */ + } + + while (1) { + if (0U == cdc_check_ready0(&usbd_dual_cdc)) { + cdc_data_receive0(&usbd_dual_cdc); + } else { + cdc_acm_data_send0(&usbd_dual_cdc); + } + + if (0U == cdc_check_ready1(&usbd_dual_cdc)) { + cdc_data_receive1(&usbd_dual_cdc); + } else { + cdc_acm_data_send1(&usbd_dual_cdc); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_dual_cdc/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewp new file mode 100644 index 0000000..162c90a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewp @@ -0,0 +1,1062 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\hid_printer_wrapper.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewt new file mode 100644 index 0000000..fa41322 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.ewt @@ -0,0 +1,1165 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Appliction + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\hid_printer_wrapper.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.eww new file mode 100644 index 0000000..f79c39f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/EWARM/hid_printer.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\hid_printer.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt new file mode 100644 index 0000000..50565ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt @@ -0,0 +1,652 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + hid_printer_composite + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\hid_printer_wrapper.c + hid_printer_wrapper.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 55 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx new file mode 100644 index 0000000..c0a5038 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx @@ -0,0 +1,580 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + hid_printer_composite + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + g_free_buf_addr,0x0A + + + 1 + 1 + (sizeof(usbd_ep_buf_struct) * EP_COUNT) + + + + + 1 + 0 + 0x200004D0 + 0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\hid_printer_wrapper.c + hid_printer_wrapper.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj new file mode 100644 index 0000000..897901e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj @@ -0,0 +1,574 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + hid_printer_composite + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + hid_printer_wrapper.c + 1 + ..\src\hid_printer_wrapper.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + custom_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + printer_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx new file mode 100644 index 0000000..79fde87 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx @@ -0,0 +1,567 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + hid_printer_composite + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + hid_printer_wrapper.c + 1 + ..\src\hid_printer_wrapper.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + custom_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + printer_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/hid_printer_wrapper.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/hid_printer_wrapper.h new file mode 100644 index 0000000..3f91c46 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/hid_printer_wrapper.h @@ -0,0 +1,60 @@ +/*! + \file hid_printer_wrapper.h + \brief header file for the hid_printer_wrapper.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __HID_PRINTER_WRAPPER_H +#define __HID_PRINTER_WRAPPER_H + +#include "custom_hid_core.h" +#include "printer_core.h" + +#pragma pack(1) + +typedef struct +{ + usb_desc_config config; + usb_desc_itf hid_interface; + usb_desc_hid hid_vendorhid; + usb_desc_ep hid_ep_report_in; + usb_desc_ep hid_ep_report_out; + usb_desc_itf printer_interface; + usb_desc_ep printer_ep_data_in; + usb_desc_ep printer_ep_data_out; +} usb_hid_printer_desc_config_set_struct; + +#pragma pack() + +extern usb_desc hid_printer_desc; +extern usb_class hid_printer_class; + +#endif /* __HID_PRINTER_WRAPPER_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_conf.h new file mode 100644 index 0000000..245955c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_conf.h @@ -0,0 +1,94 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 2U + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +//#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +#define CUSTOM_HID_INTERFACE 0x00 +#define PRINTER_INTERFACE 0x01 + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0x80U) + +/* HID data Tx/Rx buffer address offset */ +#define HID_TX_ADDR 0xC0U +#define HID_RX_ADDR 0xD0U + +/* class layer parameter used by the Custom HID device */ +#define CUSTOMHID_IN_EP EP_IN(1) +#define CUSTOMHID_OUT_EP EP_OUT(1) + +#define CUSTOMHID_IN_PACKET 2 +#define CUSTOMHID_OUT_PACKET 2 + +/* class layer parameter used by the printer device */ +#define PRINTER_IN_EP EP_IN(2) +#define PRINTER_OUT_EP EP_OUT(2) + +#define BULK_TX_ADDR 0xE0U +#define BULK_RX_ADDR 0x120U + +#define PRINTER_IN_PACKET 64 +#define PRINTER_OUT_PACKET 64 + +/* endpoint count used by the composite device */ +#define EP_COUNT 3U + +#define USB_STRING_COUNT 4 + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BUFFER_ADDRESS (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_hw.h new file mode 100644 index 0000000..526cb77 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure rcu clock */ +void rcu_config(void); +/* configure gpio port */ +void gpio_config(void); +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/readme.txt new file mode 100644 index 0000000..f7e0c5e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief description of the the USB HID/printer composite demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB-Device peripheral. + + A composite device is one that has multiple interfaces controlled independently +of each other. Using composite device, multiple functions are combined into a single +device. In this Example the independent interfaces are : custom HID and USB Printer. + + This demo was created by combining the code in the HID and USB Printer. + + The implementation of the composite HID-Printer device is done by creating a wrapping class +(see folder hid_printer_wrapper ) that makes calls to the separate HID and USB Printer class +layer handlers (files custom_hid_core.c and printer_core.c files). + + To test the demo, you can run HID demo and at same time you can select the USB Printer. + + When even one of the interface class of the device is changed, it should be handled +differently by Windows. However, it doesn't recognize the modification. To avoid conflict +on Windows, we suggest to assign another VID/PID to the device or delete device instance +from device manager. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_it.c new file mode 100644 index 0000000..92cb186 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_it.c @@ -0,0 +1,223 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" +#include "hid_printer_wrapper.h" + +uint8_t Send_Buffer[4] = {0x00, 0x01, 0x00, 0x01}; + +extern usb_dev usbd_hid_printer; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles EXTI0_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == usbd_hid_printer.cur_status) { + Send_Buffer[0] = 0x15; + + if (RESET == gd_eval_key_state_get(KEY_WAKEUP)) { + if(Send_Buffer[1]) { + Send_Buffer[1] = 0x00; + } else { + Send_Buffer[1] = 0x01; + } + } + + custom_hid_report_send (&usbd_hid_printer, Send_Buffer, 2); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles EXTI10_15_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(USER_KEY_EXTI_LINE)) { + if(USBD_CONFIGURED == usbd_hid_printer.cur_status) { + Send_Buffer[2] = 0x16; + + if (RESET == gd_eval_key_state_get(KEY_USER)) { + if(Send_Buffer[3]) { + Send_Buffer[3] = 0x00; + } else { + Send_Buffer[3] = 0x01; + } + } + + custom_hid_report_send (&usbd_hid_printer, &Send_Buffer[2], 2); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(USER_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles USBD low priority interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..26f4a64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/hid_printer_wrapper.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/hid_printer_wrapper.c new file mode 100644 index 0000000..38c2fad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/hid_printer_wrapper.c @@ -0,0 +1,342 @@ +/*! + \file hid_printer_wrapper.c + \brief this file calls to the separate HID and printer class layer handlers + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "hid_printer_wrapper.h" +#include "usbd_lld_int.h" + +#define USBD_VID 0x28E9 +#define USBD_PID 0x325A + +/* note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev hid_printer_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200, + .bDeviceClass = 0x00, + .bDeviceSubClass = 0x00, + .bDeviceProtocol = 0x00, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +usb_hid_printer_desc_config_set_struct hid_printer_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = sizeof(usb_hid_printer_desc_config_set_struct), + .bNumInterfaces = 0x02, + .bConfigurationValue = 0x01, + .iConfiguration = 0x00, + .bmAttributes = 0x80, + .bMaxPower = 0x32 + }, + + .hid_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x03, + .bInterfaceSubClass = 0x00, + .bInterfaceProtocol = 0x00, + .iInterface = 0x00 + }, + + .hid_vendorhid = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111, + .bCountryCode = 0x00, + .bNumDescriptors = 0x01, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = DESC_LEN_REPORT, + }, + + .hid_ep_report_in = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_IN_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CUSTOMHID_IN_PACKET, + .bInterval = 0x20 + }, + + .hid_ep_report_out = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_OUT_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CUSTOMHID_OUT_PACKET, + .bInterval = 0x20 + }, + + .printer_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x07, + .bInterfaceSubClass = 0x01, + .bInterfaceProtocol = 0x02, + .iInterface = 0x00 + }, + + .printer_ep_data_in = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_IN_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = PRINTER_IN_PACKET, + .bInterval = 0x00 + }, + + .printer_ep_data_out = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_OUT_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = PRINTER_OUT_PACKET, + .bInterval = 0x00 + } +}; + +/* USB language ID Descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(16U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'H', 'I', 'D', '_', 'P', 'R', 'I', 'N', 'T', 'E', 'R'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +static uint8_t* usbd_hid_printer_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc hid_printer_desc = { + .dev_desc = (uint8_t *)&hid_printer_dev_desc, + .config_desc = (uint8_t *)&hid_printer_config_desc, + .strings = usbd_hid_printer_strings +}; + +static uint8_t hid_printer_init (usb_dev *udev, uint8_t config_index); +static uint8_t hid_printer_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t hid_printer_req_handler (usb_dev *udev, usb_req *req); + +static void hid_printer_data_out (usb_dev *udev, uint8_t ep_num); +static void hid_printer_data_in (usb_dev *udev, uint8_t ep_num); + +usb_class hid_printer_class = { + .req_cmd = 0xFFU, + + .init = hid_printer_init, + .deinit = hid_printer_deinit, + .req_process = hid_printer_req_handler, + .data_in = hid_printer_data_in, + .data_out = hid_printer_data_out +}; + +/*! + \brief initialize the HID/printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_init (usb_dev *udev, uint8_t config_index) +{ + /* HID initialization */ + custom_hid_class.init(udev, config_index); + + /* printer initialization */ + printer_class.init(udev, config_index); + + return USBD_OK; +} + +/*! + \brief deinitialize the HID/printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_deinit (usb_dev *udev, uint8_t config_index) +{ + /* HID deinitialize */ + custom_hid_class.deinit(udev, config_index); + + /* printer deinitialize */ + printer_class.deinit(udev, config_index); + + return USBD_OK; +} + +/*! + \brief handle HID/printer class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_req_handler (usb_dev *udev, usb_req *req) +{ + if ((req->wIndex & 0xFF) == CUSTOM_HID_INTERFACE) { + return custom_hid_class.req_process(udev, req); + } else { + return printer_class.req_process(udev, req); + } +} + +/*! + \brief handle data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static void hid_printer_data_in (usb_dev *udev, uint8_t ep_num) +{ + if((CUSTOMHID_IN_EP & 0x7FU) == ep_num) { + custom_hid_class.data_in(udev, ep_num); + } else if ((PRINTER_IN_EP & 0x7FU) == ep_num) { + printer_class.data_in(udev, ep_num); + } else { + /* no operation */ + } +} + +/*! + \brief handle data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static void hid_printer_data_out (usb_dev *udev, uint8_t ep_num) +{ + if((CUSTOMHID_OUT_EP & 0x7FU) == ep_num) { + custom_hid_class.data_out(udev, ep_num); + } else if ((PRINTER_OUT_EP & 0x7FU) == ep_num) { + printer_class.data_out(udev, ep_num); + } else { + /* no operation */ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/main.c new file mode 100644 index 0000000..84ee3bf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/main.c @@ -0,0 +1,109 @@ +/*! + \file main.c + \brief USB main routine for HID/printer composite device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "hid_printer_wrapper.h" +#include "custom_hid_core.h" +#include "usbd_hw.h" + +usb_dev usbd_hid_printer; + +extern hid_fop_handler fop_handler; + +void key_config(void); +void led_config(void); + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* led configuration */ + led_config(); + + /* key configuration */ + key_config(); + + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_hid_printer, &hid_printer_desc, &hid_printer_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_hid_printer); + + while (USBD_CONFIGURED != usbd_hid_printer.cur_status) { + /* wait for standard USB enumeration is finished */ + } + + while(1){ + } +} + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +void key_config(void) +{ + /* keys configuration */ + gd_eval_key_init(KEY_USER, KEY_MODE_EXTI); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); +} + +/*! + \brief configure the leds + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + /* initialize LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/system_gd32f10x.c new file mode 100644 index 0000000..d9151e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/composite_dev_hid_printer/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series + + \version 2020-07-01, V3.0.0, firmware for GD32F10x +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewp new file mode 100644 index 0000000..a9a67c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewp @@ -0,0 +1,1055 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewt new file mode 100644 index 0000000..919e634 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.ewt @@ -0,0 +1,1159 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.eww new file mode 100644 index 0000000..1205c87 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/EWARM/custom_hid.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\custom_hid.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvopt new file mode 100644 index 0000000..3d42d9b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvopt @@ -0,0 +1,667 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + custom_hid + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=75,103,485,649,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + + + + 0 + 1 + NVIC + + + 1 + 1 + NVIC->IP[nvic_irq] + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + System Viewer\EXTI + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 12 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 3 + 0 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 5 + 17 + 2 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 7 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 8 + 24 + 1 + 0 + 0 + 35 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 13 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvoptx new file mode 100644 index 0000000..e4d0294 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvoptx @@ -0,0 +1,590 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + custom_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=75,103,485,649,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + NVIC + + + 1 + 1 + NVIC->IP[nvic_irq] + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + System Viewer\EXTI + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 5 + 17 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 7 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 8 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvproj new file mode 100644 index 0000000..5e1efbf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvproj @@ -0,0 +1,579 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + custom_hid + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + custom_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + custom_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvprojx new file mode 100644 index 0000000..ec65d0b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/MDK-ARM/custom_hid.uvprojx @@ -0,0 +1,572 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + custom_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + custom_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + custom_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\custom_hid_core.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_conf.h new file mode 100644 index 0000000..471622d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_conf.h @@ -0,0 +1,82 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +#define CUSTOM_HID_INTERFACE 0U + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +//#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* endpoint count used by the CDC ACM device */ +#define CUSTOMHID_IN_EP EP_IN(1U) +#define CUSTOMHID_OUT_EP EP_OUT(1U) + +#define CUSTOMHID_IN_PACKET 2U +#define CUSTOMHID_OUT_PACKET 2U + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0xA0U) + +/* CDC data Tx buffer address offset */ +#define HID_TX_ADDR (0x140U) + +/* CDC data Rx buffer address offset */ +#define HID_RX_ADDR (0x100U) + +/* endpoint count used by the CDC ACM device */ +#define EP_COUNT (4U) + +#define USB_STRING_COUNT 4U + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_hw.h new file mode 100644 index 0000000..526cb77 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure rcu clock */ +void rcu_config(void); +/* configure gpio port */ +void gpio_config(void); +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/readme.txt new file mode 100644 index 0000000..f85716d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/readme.txt @@ -0,0 +1,50 @@ +/*! + \file readme.txt + \brief description of the USB Custom HID device demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB-Device peripheral. + + The GD32 device is enumerated as an USB Custom HID device, that uses the +native PC Host HID driver. + + To test the demo, you need to: + - Download the "Custom_HID Client" PC applet + - Start the "Custom_HID Client" PC applet and connect GD32 USB to PC + - The device should be detected and shown in the PC applet + - Make sure that following report ID are configured: LED2 ID (0x11), + LED3 ID(0x12), LED4 ID(0x13), LED5 ID(0x14), BUTTON1_ID(0x15) and + BUTTON2_ID(0x16). + - Select LEDs in the applet to switch on/off on the EVAL board + - Press the Wakeup key and User2 key on the EVAL board to switch on + /off the button1/button2 status in the PC applet \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/custom_hid_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/custom_hid_itf.c new file mode 100644 index 0000000..9c9dc4a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/custom_hid_itf.c @@ -0,0 +1,70 @@ +/*! + \file custom_hid_itf.c + \brief custom HID interface driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "custom_hid_core.h" + +static void key_config(void); +static void led_config(void); + +hid_fop_handler fop_handler = { + .periph_config = {key_config, led_config} +}; + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +static void key_config(void) +{ + /* keys configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); +} + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +static void led_config(void) +{ + /* initialize LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_it.c new file mode 100644 index 0000000..7880fd8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_it.c @@ -0,0 +1,222 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" +#include "custom_hid_core.h" + +extern usb_dev usbd_custom_hid; + +uint8_t Send_Buffer[4] = {0x00, 0x01, 0x00, 0x01}; + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +/*! + \brief this function handles EXTI0_1_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == usbd_custom_hid.cur_status) { + Send_Buffer[0] = 0x15U; + + if (RESET == gd_eval_key_state_get(KEY_WAKEUP)) { + if(Send_Buffer[1]) { + Send_Buffer[1] = 0x00U; + } else { + Send_Buffer[1] = 0x01U; + } + } + + custom_hid_report_send (&usbd_custom_hid, Send_Buffer, 2U); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles EXTI14_15_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) { + if(USBD_CONFIGURED == usbd_custom_hid.cur_status) { + Send_Buffer[2] = 0x16U; + + if (RESET == gd_eval_key_state_get(KEY_TAMPER)) { + if(Send_Buffer[3]) { + Send_Buffer[3] = 0x00U; + } else { + Send_Buffer[3] = 0x01U; + } + } + custom_hid_report_send (&usbd_custom_hid, &Send_Buffer[2], 2U); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE); + } +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..26f4a64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb hardware configure file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/main.c new file mode 100644 index 0000000..04ad321 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/main.c @@ -0,0 +1,73 @@ +/*! + \file main.c + \brief construct a USB custom HID device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "custom_hid_core.h" +#include "usbd_hw.h" + +usb_dev usbd_custom_hid; + +extern hid_fop_handler fop_handler; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + custom_hid_itfop_register(&usbd_custom_hid, &fop_handler); + + /* USB device configuration */ + usbd_init(&usbd_custom_hid, &custom_hid_desc, &custom_hid_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_custom_hid); + + while (USBD_CONFIGURED != usbd_custom_hid.cur_status) { + /* wait for standard USB enumeration is finished */ + } + + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/custom_hid/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewd new file mode 100644 index 0000000..860344f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewp new file mode 100644 index 0000000..014b20e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewp @@ -0,0 +1,1076 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\exmc_nandflash.c + + + $PROJ_DIR$\..\src\gd25qxx.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\inter_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\nand_flash_if.c + + + $PROJ_DIR$\..\src\nor_flash_if.c + + + $PROJ_DIR$\..\src\systick.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewt new file mode 100644 index 0000000..d184a53 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.ewt @@ -0,0 +1,1180 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\exmc_nandflash.c + + + $PROJ_DIR$\..\src\gd25qxx.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\inter_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\nand_flash_if.c + + + $PROJ_DIR$\..\src\nor_flash_if.c + + + $PROJ_DIR$\..\src\systick.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.eww new file mode 100644 index 0000000..0753ebf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/EWARM/dfu.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\dfu.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvopt new file mode 100644 index 0000000..dc0ee36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvopt @@ -0,0 +1,797 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + dfu + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U59701280 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000) + + + + + 0 + 0 + 130 + 1 +
134225142
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\nand_flash_if.c + + \\dfu\../src/nand_flash_if.c\130 +
+
+ + + 0 + 1 + dfu_status + + + 1 + 1 + pbuf + + + + + 1 + 0 + 0x200003ef + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 58 + 0 + 44 + 63 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + ..\src\systick.c + systick.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\exmc_nandflash.c + exmc_nandflash.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\gd25qxx.c + gd25qxx.c + 0 + 0 + + + 1 + 7 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\inter_flash_if.c + inter_flash_if.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 56 + 0 + 0 + 0 + 0 + ..\src\nand_flash_if.c + nand_flash_if.c + 0 + 0 + + + 1 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\nor_flash_if.c + nor_flash_if.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 23 + 1 + 0 + 0 + 12 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 24 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 25 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 26 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 27 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 28 + 1 + 0 + 0 + 21 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 29 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + dfu_core.c + 0 + 0 + + + 7 + 30 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + dfu_mem.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 31 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 32 + 5 + 0 + 0 + 35 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvoptx new file mode 100644 index 0000000..99b48fe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvoptx @@ -0,0 +1,693 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + dfu + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 -FP0($$Device:GD32F103VE$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U59701280 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + 0 + 130 + 1 +
134225142
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\nand_flash_if.c + + \\dfu\../src/nand_flash_if.c\130 +
+
+ + + 0 + 1 + dfu_status + + + 1 + 1 + pbuf + + + + + 1 + 0 + 0x200003ef + 0 + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\systick.c + systick.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\exmc_nandflash.c + exmc_nandflash.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + ..\src\gd25qxx.c + gd25qxx.c + 0 + 0 + + + 1 + 7 + 1 + 0 + 0 + 0 + ..\src\inter_flash_if.c + inter_flash_if.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 0 + ..\src\nand_flash_if.c + nand_flash_if.c + 0 + 0 + + + 1 + 9 + 1 + 0 + 0 + 0 + ..\src\nor_flash_if.c + nor_flash_if.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 10 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + dfu_core.c + 0 + 0 + + + 7 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + dfu_mem.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 31 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 32 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvproj new file mode 100644 index 0000000..b3327d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvproj @@ -0,0 +1,614 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + dfu + 0x4 + ARM-ADS + + + GD32F103VE + GigaDevice + IRAM(0x20000000-0x2000FFFF) IROM(0x08000000-0x0807FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dfu + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x80000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x80000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 4 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + systick.c + 1 + ..\src\systick.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + exmc_nandflash.c + 1 + ..\src\exmc_nandflash.c + + + gd25qxx.c + 1 + ..\src\gd25qxx.c + + + inter_flash_if.c + 1 + ..\src\inter_flash_if.c + + + nand_flash_if.c + 1 + ..\src\nand_flash_if.c + + + nor_flash_if.c + 1 + ..\src\nor_flash_if.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + dfu_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + + + dfu_mem.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvprojx new file mode 100644 index 0000000..6e48efc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/MDK-ARM/dfu.uvprojx @@ -0,0 +1,607 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + dfu + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VE + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00010000) IROM(0x08000000,0x00080000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 -FP0($$Device:GD32F103VE$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VE$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VE$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dfu + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x80000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x80000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 4 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + systick.c + 1 + ..\src\systick.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + exmc_nandflash.c + 1 + ..\src\exmc_nandflash.c + + + gd25qxx.c + 1 + ..\src\gd25qxx.c + + + inter_flash_if.c + 1 + ..\src\inter_flash_if.c + + + nand_flash_if.c + 1 + ..\src\nand_flash_if.c + + + nor_flash_if.c + 1 + ..\src\nor_flash_if.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + dfu_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_core.c + + + dfu_mem.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\dfu\Source\dfu_mem.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/exmc_nandflash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/exmc_nandflash.h new file mode 100644 index 0000000..784eb94 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/exmc_nandflash.h @@ -0,0 +1,150 @@ +/*! + \file exmc_nandflash.h + \brief the header file of nandflash driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __EXMC_NANDFLASH_H +#define __EXMC_NANDFLASH_H + +#include "gd32f10x.h" +#include "string.h" + +/* NAND area definition */ +/* A16 = CLE high command area */ +#define EXMC_CMD_AREA (uint32_t)(1<<16) +/* A17 = ALE high address area */ +#define EXMC_ADDR_AREA (uint32_t)(1<<17) +/* data area */ +#define EXMC_DATA_AREA ((uint32_t)0x00000000) + +/* NAND memory command (hynix GD9FU1G8F2AMG) */ +#define NAND_CMD_READ1_1ST ((uint8_t)0x00) +#define NAND_CMD_READ1_2ND ((uint8_t)0x30) +#define NAND_CMD_WRITE_1ST ((uint8_t)0x80) +#define NAND_CMD_WRITE_2ND ((uint8_t)0x10) +#define NAND_CMD_ERASE_1ST ((uint8_t)0x60) +#define NAND_CMD_ERASE_2ND ((uint8_t)0xD0) +#define NAND_CMD_READID ((uint8_t)0x90) +#define NAND_CMD_STATUS ((uint8_t)0x70) +#define NAND_CMD_LOCK_STATUS ((uint8_t)0x7A) +#define NAND_CMD_RESET ((uint8_t)0xFF) + +/* NAND memory status */ +#define NAND_BUSY ((uint8_t)0x00) +#define NAND_ERROR ((uint8_t)0x01) +#define NAND_READY ((uint8_t)0x40) +#define NAND_TIMEOUT_ERROR ((uint8_t)0x80) + +/* NAND memory parameters */ +#define NAND_ZONE_COUNT ((uint16_t)0x0001) /* NAND zone count */ +#define NAND_PAGE_SIZE ((uint16_t)0x0800) /* 2 * 1024 bytes per page */ +#define NAND_BLOCK_SIZE ((uint16_t)0x0040) /* 64 pages per block */ +#define NAND_ZONE_SIZE ((uint16_t)0x0400) /* 1024 block per zone */ +#define NAND_SPARE_AREA_SIZE ((uint16_t)0x0040) /* last 128 bytes as spare area */ + +#define NAND_BLOCK_COUNT 1024 /* block count */ +#define NAND_PAGE_TOTAL_SIZE (NAND_PAGE_SIZE + NAND_SPARE_AREA_SIZE) /* total page size = page size + spare are size */ + +/* command code type define */ +#define NAND_CMD_COPYBACK_A ((uint8_t)0x00) /* PAGE COPY-BACK command sequence */ +#define NAND_CMD_COPYBACK_B ((uint8_t)0x35) +#define NAND_CMD_COPYBACK_C ((uint8_t)0x85) +#define NAND_CMD_COPYBACK_D ((uint8_t)0x10) + +#define NAND_CMD_STATUS ((uint8_t)0x70) /* Read NAND Flash status */ + +#define MAX_PHY_BLOCKS_PER_ZONE 1024 +#define MAX_LOG_BLOCKS_PER_ZONE 1000 + +#define NAND_BAD_BLOCK_FLAG 0x00 +#define NAND_USED_BLOCK_FLAG 0xFE + +#define BI_OFFSET 0 +#define USED_OFFSET 1 +#define LBN0_OFFSET 2 +#define LBN1_OFFSET 3 +#define VALID_SPARE_SIZE 4 + +#define NAND_OK 0 +#define NAND_FAIL 1 + +#define BLOCK_ODD 0 +#define BLOCK_EVEN 1 + +#define FREE_BLOCK (1 << 12) +#define BAD_BLOCK (1 << 13) +#define VALID_BLOCK (1 << 14) +#define USED_BLOCK (1 << 15) + +#define EXCHANGE_BLOCKS_NUM 2 + +#define BAD_BALOK_TEST_CYCLE 5 +#define DATA_BLOCK_PERCENT 98 + +#define ADDR_1ST_CYCLE(ADDR) (uint8_t)((ADDR)& 0xFF) /* 1st addressing cycle */ +#define ADDR_2ND_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF00) >> 8) /* 2nd addressing cycle */ +#define ADDR_3RD_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF0000) >> 16) /* 3rd addressing cycle */ +#define ADDR_4TH_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF000000) >> 24) /* 4th addressing cycle */ + +/* NAND id structure */ +typedef struct +{ + uint8_t maker_id; + uint8_t device_id; + uint8_t third_id; + uint8_t fourth_id; +} nand_id_struct; + +/* NAND address structure */ +typedef struct +{ + uint16_t zone; + uint16_t block; + uint16_t page; + uint16_t page_in_offset; +} nand_address_struct; + +/* function declarations */ +/* nand flash peripheral initialize */ +uint8_t exmc_nandflash_init(uint32_t nand_bank); +/* read NAND flash ID */ +void nand_read_id(nand_id_struct *nand_id); +/* write data to nand flash */ +uint8_t nand_write(uint32_t memaddr, uint8_t *pwritebuf, uint16_t bytecount); +/* read data from nand flash */ +uint8_t nand_read(uint32_t mem_addr, uint8_t *preadbuf, uint16_t bytecount); +/* scan and test specific block */ +uint8_t nand_scan_block(uint32_t pagenum); +/* check block is free block */ +uint8_t nand_judge_free_block(uint32_t blocknum); + +#endif /* __EXMC_NANDFLASH_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd25qxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd25qxx.h new file mode 100644 index 0000000..ab0a00c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd25qxx.h @@ -0,0 +1,72 @@ +/*! + \file gd25qxx.h + \brief the header file of SPI flash gd25qxx driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD25QXX_H +#define __GD25QXX_H + +#include "gd32f10x.h" + +#define SPI_FLASH_PAGE_SIZE 0x100 +#define SPI_FLASH_CS_LOW() gpio_bit_reset(GPIOE, GPIO_PIN_3) +#define SPI_FLASH_CS_HIGH() gpio_bit_set(GPIOE, GPIO_PIN_3) + +/* initialize SPI0 GPIO and parameter */ +void spi_flash_init(void); +/* erase the specified flash sector */ +void spi_flash_sector_erase(uint32_t sector_addr); +/* erase the entire flash */ +void spi_flash_bulk_erase(void); +/* write more than one byte to the flash */ +void spi_flash_page_write(uint8_t* pbuffer,uint32_t write_addr,uint16_t num_byte_to_write); +/* write block of data to the flash */ +void spi_flash_buffer_write(uint8_t* pbuffer,uint32_t write_addr,uint16_t num_byte_to_write); +/* read a block of data from the flash */ +void spi_flash_buffer_read(uint8_t* pbuffer,uint32_t read_addr,uint16_t num_byte_to_read); +/* read flash identification */ +uint32_t spi_flash_read_id(void); +/* initiate a read data byte (read) sequence from the flash */ +void spi_flash_start_read_sequence(uint32_t read_addr); +/* read a byte from the SPI flash */ +uint8_t spi_flash_read_byte(void); +/* send a byte through the SPI interface and return the byte received from the SPI bus */ +uint8_t spi_flash_send_byte(uint8_t byte); +/* send a half word through the SPI interface and return the half word received from the SPI bus */ +uint16_t spi_flash_send_halfword(uint16_t half_word); +/* enable the write access to the flash */ +void spi_flash_write_enable(void); +/* poll the status of the write in progress (wip) flag in the flash's status register */ +void spi_flash_wait_for_write_end(void); +void spi_flash_block_erase(uint32_t block_addr); + +#endif /* __GD25QXX_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/inter_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/inter_flash_if.h new file mode 100644 index 0000000..8eaffe7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/inter_flash_if.h @@ -0,0 +1,52 @@ +/*! + \file inter_flash_if.h + \brief USB DFU device internal flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __INTER_FLASH_IF_H +#define __INTER_FLASH_IF_H + +#include "dfu_mem.h" + +#define FLASH_START_ADDR 0x08000000 +#define FLASH_END_ADDR 0x08300000 + +#define OB_RDPT 0x1ffff800 +#define MAL_MASK_OB 0xFFFFFF00 + +#define INTER_FLASH_IF_STR "@Internal Flash /0x08000000/16*002Ka,112*002Kg" + +/* local function prototypes ('static') */ +/* write option byte */ +fmc_state_enum option_byte_write(uint32_t mem_add, uint8_t *data); + +#endif /* __INTER_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nand_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nand_flash_if.h new file mode 100644 index 0000000..8c2e631 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nand_flash_if.h @@ -0,0 +1,45 @@ +/*! + \file nand_flash_if.h + \brief USB DFU device nand flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nand the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __NAND_FLASH_IF_H +#define __NAND_FLASH_IF_H + +#include "dfu_mem.h" + +#define NAND_FLASH_START_ADDR 0x70000000 +#define NAND_FLASH_END_ADDR 0x78000000 + +#define NAND_FLASH_IF_STR "@Nand Flash /0x70000000/4096*032Kg" + +#endif /* __NAND_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nor_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nor_flash_if.h new file mode 100644 index 0000000..fa861ad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/nor_flash_if.h @@ -0,0 +1,46 @@ +/*! + \file nor_flash_if.h + \brief USB DFU device nor flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __NOR_FLASH_IF_H +#define __NOR_FLASH_IF_H + +#include "dfu_mem.h" + +#define NOR_FLASH_START_ADDR 0x00000000U +#define NOR_FLASH_END_ADDR 0x00200000U + +#define NOR_FLASH_IF_STR "@Nor Flash /0x00000000/64*032Kg" + + +#endif /* __NOR_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/systick.h new file mode 100644 index 0000000..76bf52b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/systick.h @@ -0,0 +1,48 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __SYSTICK_H +#define __SYSTICK_H + +#include + +/* function declarations */ +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* __SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_conf.h new file mode 100644 index 0000000..0e65640 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_conf.h @@ -0,0 +1,95 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "dfu_mem.h" +#include "exmc_nandflash.h" +#include "nor_flash_if.h" +#include "nand_flash_if.h" +#include "inter_flash_if.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STR_DESC_MAX_SIZE 64U + +#define DFU_MAX_ALT_ITF_NUM 3 +#define STR_IDX_ALT_ITF0 5 +#define STR_IDX_ALT_ITF1 6 +#define STR_IDX_ALT_ITF2 7 + +#define USBD_DFU_INTERFACE 0U + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* USB user string supported */ +#define USB_SUPPORT_USER_STRING_DESC + +#define MAX_USED_MEMORY_MEDIA 3U + +/* DFU maximum data packet size */ +#define TRANSFER_SIZE 2048U + +/* memory address from where user application will be loaded, which represents + the dfu code protected against write and erase operations.*/ +#define APP_LOADED_ADDR 0x08008000U + +/* Make sure the corresponding memory where the DFU code should not be loaded + cannot be erased or overwritten by DFU application. */ +#define IS_PROTECTED_AREA(addr) (uint8_t)((((addr) >= 0x08000000) && ((addr) < (APP_LOADED_ADDR)))? 1 : 0) + +/* DFU endpoint define */ +#define DFU_IN_EP EP_IN(0) +#define DFU_OUT_EP EP_OUT(0) + +#define EP0_TX_ADDR 0x10U +#define EP0_RX_ADDR 0x50U + +/* endpoint count used by the DFU device */ +#define EP_COUNT (1U) + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_STRING_COUNT 8 + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_hw.h new file mode 100644 index 0000000..2dc2051 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure the different system clocks */ +void rcu_config(void); +/* configure the gpio peripheral */ +void gpio_config(void); +/* configure interrupt priority */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/readme.txt new file mode 100644 index 0000000..48654d9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/readme.txt @@ -0,0 +1,62 @@ +/*! + \file readme.txt + \brief description of the USB DFU device demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32103C-EVAL board,it presents the implementation +of a device firmware upgrade (DFU) capability in the GD32 USB device. + + It follows the DFU class specification defined by the USB Implementers Forum for +reprogramming an application through USBFS. + + The DFU principle is particularly well suited to USBFS applications that +need to be reprogrammed in the field. + + The supported memorys of this example are the internal flash memory, the external +nand flash memory and the external nor flash memory. + + To test the demo, the internal flash is used as an example: + + Step 1: User need a configuration hex image or bin image. The hex image and the bin image +should set application address at APP_LOADED_ADDR in the internal flash memory. User can refer to +"../Test_Images" folder and use the hex images and bin images in it. + + Step 2: User need install the corresponding GD DFU Driver with your PC operation system. + + Step 3: Once the configuration *.hex image is generated, it can be downloaded into the +internal flash memory or the external falsh memory using the GD tool "GD32 MCU DFUEx Tool +" available for download from http://www.gd32mcu.com/cn/download. + + The GD tool "GD32AllInOneProgrammer" can operate the option Byte in the internal flash. + + Step 4: After each device reset, hold down the TAMPER key on the GD32207i-EVAL board into app +routine in the internal flash. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/exmc_nandflash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/exmc_nandflash.c new file mode 100644 index 0000000..d007a3c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/exmc_nandflash.c @@ -0,0 +1,1076 @@ +/*! + \file exmc_nandflash.c + \brief nandflash(GD9FU1G8F2AMG) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "exmc_nandflash.h" + +/* define the physical address of nand flash, and it is determined by the hardware */ +#define BANK1_NAND_ADDR ((uint32_t)0x70000000) +#define BANK_NAND_ADDR BANK1_NAND_ADDR + +/* define operating nand flash macro */ +#define NAND_CMD_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_CMD_AREA) +#define NAND_ADDR_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_ADDR_AREA) +#define NAND_DATA_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA) + +/* the macro of calculate nand flash operating address */ +#define ROW_ADDRESS (addr.page + (addr.block + (addr.zone * NAND_ZONE_SIZE)) * NAND_BLOCK_SIZE) + +/* define NWATI operation */ +#define NWAIT_OPERA_FUNC() while(gpio_input_bit_get(GPIOD, GPIO_PIN_6) == 0) + +/* static variable definition */ +static uint16_t cur_zone = 0; +static uint16_t LUT_tab[NAND_BLOCK_COUNT]; +static uint8_t temp_buf[NAND_PAGE_TOTAL_SIZE]; + +/* local function prototypes ('static') */ +static uint8_t exmc_nand_page_copyback(uint32_t src_pageno, uint32_t dest_pageno); +static uint8_t exmc_nand_page_copyback_ex(uint32_t src_pageno, uint32_t dest_pageno, uint8_t *pbuf, uint16_t offset, uint16_t size); +static uint8_t exmc_nand_write_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_write_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_write_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_erase_block(uint32_t blocknum); +static uint8_t exmc_nand_read_status(void); +static uint8_t exmc_nand_get_status(void); +static uint8_t nand_write_new_block(nand_address_struct addr, nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size); +static uint8_t nand_write_block(nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size); +static uint8_t nand_read_block(nand_address_struct logaddr, uint8_t *preadbuf, uint16_t size); +static uint8_t nand_build_LUT(uint16_t zone); +static uint16_t nand_find_free_block(uint8_t odd_even); +static uint8_t nand_judge_buf_ok(uint8_t *pbuf, uint32_t len, uint8_t value); +static uint8_t nand_isbad_block(uint32_t blocknum); +static uint8_t nand_mark_used_block(uint32_t blocknum); +static void nand_mark_bad_block(uint32_t blocknum); +static uint8_t nand_mark_logic_block(uint32_t blocknum, uint16_t logblock); + +/*! + \brief initialize nand flash peripheral + \param[in] none + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t exmc_nandflash_init(uint32_t nand_bank) +{ + exmc_nand_parameter_struct nand_init_struct; + exmc_nand_pccard_timing_parameter_struct nand_timing_init_struct; + + /* enable EXMC clock*/ + rcu_periph_clock_enable(RCU_EXMC); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* common GPIO configuration */ + /* D2(PD0),D3(PD1),D0(PD14) and D1(PD15) pins configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_14 | GPIO_PIN_15); + + /* D4(PE7),D5(PE8),D6(PE9) and D7(PE10) pins configuration */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10); + + /* CLE(PD11)and ALE(PD12) pins configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11 | GPIO_PIN_12); + + /* NOE(PD4) and NWE(PD5) pins configuration*/ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); + + /* NWAIT(PD6) pin configuration */ + gpio_init(GPIOD, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /* NCE1(PD7) pin configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); /* EXMC configuration */ + nand_timing_init_struct.setuptime = 1U; + nand_timing_init_struct.waittime = 3U; + nand_timing_init_struct.holdtime = 2U; + nand_timing_init_struct.databus_hiztime = 2U; + + nand_init_struct.nand_bank = EXMC_BANK1_NAND; + nand_init_struct.ecc_size = EXMC_ECC_SIZE_2048BYTES; + nand_init_struct.atr_latency = EXMC_ALE_RE_DELAY_1_HCLK; + nand_init_struct.ctr_latency = EXMC_CLE_RE_DELAY_1_HCLK; + nand_init_struct.ecc_logic = ENABLE; + nand_init_struct.databus_width = EXMC_NAND_DATABUS_WIDTH_8B; + nand_init_struct.wait_feature = ENABLE; + nand_init_struct.common_space_timing = &nand_timing_init_struct; + nand_init_struct.attribute_space_timing = &nand_timing_init_struct; + + exmc_nand_init(&nand_init_struct); + + /* enable EXMC NAND bank1 */ + exmc_nand_enable(EXMC_BANK1_NAND); + + /* build LUT(Look up table) */ + return nand_build_LUT(0); +} + +/*! + \brief read NAND flash ID + \param[in] nand_id: structure of nand flash ID + \param[out] none + \retval none +*/ +void nand_read_id(nand_id_struct *nand_id) +{ + uint32_t data = 0; + + /* send command to the command area */ + NAND_CMD_AREA = NAND_CMD_READID; + + /* send address to the address area */ + NAND_ADDR_AREA = 0x00; + + /* sequence to read ID from NAND flash */ + data = *(__IO uint32_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA); + + nand_id->maker_id = ADDR_1ST_CYCLE(data); + nand_id->device_id = ADDR_2ND_CYCLE(data); + nand_id->third_id = ADDR_3RD_CYCLE(data); + nand_id->fourth_id = ADDR_4TH_CYCLE(data); +} + +/*! + \brief write data to nand flash + \param[in] mem_addr: logic page number to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_write(uint32_t mem_addr, uint8_t *pwritebuf, uint16_t size) +{ + uint32_t temp; + uint32_t block_remain_size; + nand_address_struct logaddr; + + temp = mem_addr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + logaddr.zone = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + logaddr.block = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + logaddr.page = temp / NAND_PAGE_SIZE; + logaddr.page_in_offset = temp % NAND_PAGE_SIZE; + + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE) - \ + (NAND_PAGE_SIZE * logaddr.page + logaddr.page_in_offset); + + while(size > block_remain_size) { + if(NAND_FAIL == nand_write_block(logaddr, pwritebuf, block_remain_size)) { + return NAND_FAIL; + } + + logaddr.block++; + pwritebuf += block_remain_size; + size -= block_remain_size; + logaddr.page = 0; + logaddr.page_in_offset = 0; + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(size > 0) { + if(NAND_FAIL == nand_write_block(logaddr, pwritebuf, size)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read data from nand flash + \param[in] mem_addr: logic page number to be read + \param[in] preadbuf: pointer to the data buffer to be read + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_read(uint32_t mem_addr, uint8_t *preadbuf, uint16_t size) +{ + uint32_t temp; + uint32_t block_remain_size; + nand_address_struct logaddr; + + temp = mem_addr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + logaddr.zone = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + logaddr.block = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + logaddr.page = temp / NAND_PAGE_SIZE; + logaddr.page_in_offset = temp % NAND_PAGE_SIZE; + + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE) - \ + (NAND_PAGE_SIZE * logaddr.page + logaddr.page_in_offset); + + while(size > block_remain_size) { + if(NAND_FAIL == nand_read_block(logaddr, preadbuf, block_remain_size)) { + return NAND_FAIL; + } + + logaddr.block++; + preadbuf += block_remain_size; + size -= block_remain_size; + logaddr.page = 0; + logaddr.page_in_offset = 0; + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(size > 0) { + if(NAND_FAIL == nand_read_block(logaddr, preadbuf, size)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief scan and test specific block + \param[in] blocknum: block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_scan_block(uint32_t blocknum) +{ + uint32_t i, k; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE; + + memset(temp_buf, 0x00, NAND_PAGE_TOTAL_SIZE); + + for(i = 0; i < BAD_BALOK_TEST_CYCLE; i++) { + if(NAND_READY != exmc_nand_erase_block(blocknum)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page = 0; + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0xFF)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + + addr.page = 0; + + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + memset(temp_buf, 0x00, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != exmc_nand_write_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0x00)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + } + + if(NAND_READY != exmc_nand_erase_block(blocknum)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page = 0; + + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0xFF)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + + return NAND_OK; +} + +/*! + \brief check block is free block + \param[in] blocknum: block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ + uint8_t nand_judge_free_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + USED_OFFSET; + + if(nand_isbad_block(blocknum)) { + return 0; + } + + exmc_nand_read_page(&flag, addr, 1); + + if(0xFF == flag) { + return 1; + } + + return 0; +} + +/*! + \brief copy data from a page to another page + \param[in] src_pageno: source page number + \param[in] dest_pageno: destination page number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_page_copyback(uint32_t src_pageno, uint32_t dest_pageno) +{ + NAND_CMD_AREA = NAND_CMD_COPYBACK_A; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = src_pageno; + NAND_ADDR_AREA = (src_pageno & 0xFF00) >> 8; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_B; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = dest_pageno; + NAND_ADDR_AREA = (dest_pageno & 0xFF00) >> 8; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_D; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief copy data from a page to another page and update some data in target page + \param[in] src_pageno: source page number + \param[in] dest_pageno: destination page number + \param[in] pbuf: data buffer + \param[in] offset: offset in the page, data buffer will write data from it + \param[in] size: data buffer size + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_page_copyback_ex(uint32_t src_pageno, uint32_t dest_pageno, uint8_t *pbuf, uint16_t offset, uint16_t size) +{ + uint16_t i; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_A; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = src_pageno; + NAND_ADDR_AREA = (src_pageno & 0xFF00U) >> 8U; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_B; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = dest_pageno; + NAND_ADDR_AREA = (dest_pageno & 0xFF00U) >> 8U; + + /* need no data, need no wait */ + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = offset; + NAND_ADDR_AREA = offset >> 8U; + + /* send data */ + for(i = 0; i < size; i++) { + NAND_DATA_AREA = pbuf[i]; + } + + NAND_CMD_AREA = NAND_CMD_COPYBACK_D; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief write data to page + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: the address of the data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint16_t i; + + /* send write page command */ + NAND_CMD_AREA = NAND_CMD_WRITE_1ST; + + NAND_ADDR_AREA = addr.page_in_offset; + NAND_ADDR_AREA = addr.page_in_offset >> 8U; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + /* write data */ + for(i = 0; i < bytecnt; i++) { + NAND_DATA_AREA = pbuf[i]; + } + + NAND_CMD_AREA = NAND_CMD_WRITE_2ND; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief read data from page + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the address of the data to be read + \param[in] bytecnt: byte count to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint16_t i; + + /* send read page command */ + NAND_CMD_AREA = NAND_CMD_READ1_1ST; + + NAND_ADDR_AREA = addr.page_in_offset; + NAND_ADDR_AREA = addr.page_in_offset >> 8; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + NAND_CMD_AREA = NAND_CMD_READ1_2ND; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + /* read data to buffer */ + for(i = 0; i < bytecnt; i++) { + pbuf[i] = NAND_DATA_AREA; + } + + return NAND_OK; +} + +/*! + \brief write the spare area of one page data + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: the address of the data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + if(addr.page_in_offset < NAND_PAGE_SIZE) { + return NAND_FAIL; + } + + if(bytecnt + addr.page_in_offset > NAND_PAGE_TOTAL_SIZE) { + return NAND_FAIL; + } + + return exmc_nand_write_page(pbuf, addr, bytecnt); +} + +/*! + \brief read data from the spare area of 1 page + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the address of the data to be read + \param[in] bytecnt: count of spare area to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + if(addr.page_in_offset < NAND_PAGE_SIZE) { + return NAND_FAIL; + } + + if(bytecnt + addr.page_in_offset > NAND_PAGE_TOTAL_SIZE) { + return NAND_FAIL; + } + + return exmc_nand_read_page(pbuf, addr, bytecnt); +} + +/*! + \brief write data to the page main data area + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: physical address data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint8_t *temppbuf = pbuf; + + while(bytecnt + addr.page_in_offset > NAND_PAGE_SIZE) { + if(NAND_OK != exmc_nand_write_page(temppbuf, + addr, + NAND_PAGE_SIZE - addr.page_in_offset)) { + return NAND_FAIL; + } + + bytecnt -= NAND_PAGE_SIZE - addr.page_in_offset; + temppbuf += NAND_PAGE_SIZE - addr.page_in_offset; + addr.page++; + addr.page_in_offset = 0; + } + + if(bytecnt > 0) { + if(NAND_OK != exmc_nand_write_page(temppbuf, addr, bytecnt)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read data from the page main data area + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the physical address of the data to be read + \param[in] bytecnt: byte count to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint8_t *temppbuf = pbuf; + + while(bytecnt + addr.page_in_offset > NAND_PAGE_SIZE) { + if(NAND_OK != exmc_nand_read_page(temppbuf, addr, NAND_PAGE_SIZE - addr.page_in_offset)) { + return NAND_FAIL; + } + + addr.page++; + temppbuf += NAND_PAGE_SIZE - addr.page_in_offset; + bytecnt -= NAND_PAGE_SIZE - addr.page_in_offset; + addr.page_in_offset = 0; + } + + if(bytecnt > 0) { + if(NAND_OK != exmc_nand_read_page(temppbuf, addr, bytecnt)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief erase complete block of NAND flash + \param[in] blocknum: block number to be erased + \param[out] none + \retval NAND_TIMEOUT_ERROR, NAND_READY +*/ +static uint8_t exmc_nand_erase_block(uint32_t blocknum) +{ + /* send erase command */ + NAND_CMD_AREA = NAND_CMD_ERASE_1ST; + + blocknum <<= 6; + NAND_ADDR_AREA = blocknum; + NAND_ADDR_AREA = blocknum >> 8; + + NAND_CMD_AREA = NAND_CMD_ERASE_2ND; + + return (exmc_nand_get_status()); +} + +/*! + \brief read the NAND flash status + \param[in] none + \param[out] none + \retval NAND_BUSY, NAND_READY, NAND_ERROR +*/ +static uint8_t exmc_nand_read_status(void) +{ + uint8_t data; + uint8_t status = NAND_BUSY; + + /* read operation status */ + NAND_CMD_AREA = NAND_CMD_STATUS; + data = *(__IO uint8_t *)(BANK_NAND_ADDR); + + if(NAND_ERROR == (data & NAND_ERROR)) { + status = NAND_ERROR; + } else if(NAND_READY == (data & NAND_READY)) { + status = NAND_READY; + } else { + status = NAND_BUSY; + } + + return (status); +} + +/*! + \brief get NAND flash operation status + \param[in] none + \param[out] none + \retval NAND_TIMEOUT_ERROR, NAND_READY +*/ +static uint8_t exmc_nand_get_status(void) +{ + uint32_t timeout = 0x10000; + uint8_t status = NAND_READY; + + status = exmc_nand_read_status(); + + /* wait for operation is over, exit when time out */ + while((NAND_READY != status) && (0x00U != timeout)) { + status = exmc_nand_read_status(); + timeout--; + } + + if(0x00 == timeout) { + status = NAND_TIMEOUT_ERROR; + } + + return status; +} + +/*! + \brief copy data from old block to new block and write new data to the new block + \param[in] addr: physical address data to be written + \param[in] logaddr: logic address data to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_write_new_block(nand_address_struct addr, nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size) +{ + uint16_t n, i, offset; + uint16_t newblock; + + for(n = 0; n < 5; n++) { + if(addr.block & 0x0001) { + newblock = nand_find_free_block(BLOCK_EVEN); + } else { + newblock = nand_find_free_block(BLOCK_ODD); + } + + if(newblock >= NAND_BLOCK_COUNT) { + return NAND_FAIL; + } + + for(i = 0; i < NAND_BLOCK_SIZE; i++) { + if(i == addr.page) { + offset = addr.page_in_offset; + while(offset + size > NAND_PAGE_SIZE) { + if(exmc_nand_page_copyback_ex(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i, + pwritebuf, offset, + NAND_PAGE_SIZE - offset) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + + break; + } + + pwritebuf += NAND_PAGE_SIZE - offset; + size -= NAND_PAGE_SIZE - offset; + offset = 0; + i++; + } + + if(size > 0) { + if(exmc_nand_page_copyback_ex(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i, + pwritebuf, offset, size) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + break; + } + } + } else { + if(exmc_nand_page_copyback(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + break; + } + } + } + + if(i == NAND_BLOCK_SIZE) { + if(NAND_FAIL == nand_mark_used_block(newblock)) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + continue; + } else { + nand_mark_logic_block(newblock, logaddr.block); + } + + if(NAND_READY != exmc_nand_erase_block(addr.block)) { + nand_mark_bad_block(addr.block); + nand_build_LUT(addr.zone); + continue; + } + + nand_build_LUT(addr.zone); + break; + } + } + + return NAND_OK; +} + +/*! + \brief write data to block + \param[in] logaddr: logic address to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_write_block(nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size) +{ + uint16_t PBN; + nand_address_struct addr; + + if(cur_zone != logaddr.zone) { + nand_build_LUT(logaddr.zone); + } + + PBN = LUT_tab[logaddr.block]; + + if(0xFFFFU == PBN) { + return NAND_FAIL; + } + + addr.zone = logaddr.zone; + addr.block = PBN & 0x03FF; + addr.page = logaddr.page; + addr.page_in_offset = logaddr.page_in_offset; + + if(PBN & USED_BLOCK) { + return nand_write_new_block(addr, logaddr, (uint8_t *)pwritebuf, size); + } else { + if(NAND_FAIL == exmc_nand_write_data((uint8_t *)pwritebuf, addr, size)) { + return NAND_FAIL; + } + + if(NAND_FAIL == nand_mark_used_block(addr.block)) { + return NAND_FAIL; + } else { + if(NAND_FAIL == nand_mark_logic_block(addr.block, logaddr.block)) { + return NAND_FAIL; + } + } + + return NAND_OK; + } +} + + +/*! + \brief read data from block + \param[in] logaddr: logic address to be read + \param[in] preadbuf: pointer to the data buffer to be read + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_read_block(nand_address_struct logaddr, uint8_t *preadbuf, uint16_t size) +{ + uint16_t PBN; + nand_address_struct addr; + + if(cur_zone != logaddr.zone) { + nand_build_LUT(logaddr.zone); + } + + PBN = LUT_tab[logaddr.block]; + addr.block = PBN & 0x03FF; + + if(addr.block >= NAND_BLOCK_COUNT) { + return NAND_FAIL; + } + + addr.zone = logaddr.zone; + addr.page = logaddr.page; + addr.page_in_offset = logaddr.page_in_offset; + + if(NAND_FAIL == exmc_nand_read_data((uint8_t *)preadbuf, addr, size)) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief build NAND flash look up table + \param[in] zone: bulid zone + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_build_LUT(uint16_t zone) +{ + uint16_t logic_blockID; + uint16_t bad_block, cur_block, free_block; + uint8_t spare_area[NAND_SPARE_AREA_SIZE]; + nand_address_struct addr; + + cur_zone = zone; + addr.zone = cur_zone; + addr.block = 0x00; + addr.page = 0x00; + addr.page_in_offset = NAND_PAGE_SIZE; + + /* 1st step : init */ + for(cur_block = 0; cur_block < NAND_ZONE_SIZE; cur_block++) { + LUT_tab[cur_block] = FREE_BLOCK; + } + + /* init Pointers */ + bad_block = NAND_ZONE_SIZE - 1; + cur_block = 0; + + /* 2nd step : locate used and bad blocks */ + while(cur_block < NAND_ZONE_SIZE) { + addr.block = cur_block; + exmc_nand_read_spare(spare_area, addr, NAND_SPARE_AREA_SIZE); + + if(spare_area[BI_OFFSET] != 0xFF) { + LUT_tab[bad_block--] |= cur_block | (uint16_t)BAD_BLOCK; + LUT_tab[cur_block] &= (uint16_t)~FREE_BLOCK; + + if(bad_block <= MAX_LOG_BLOCKS_PER_ZONE + EXCHANGE_BLOCKS_NUM) { + return NAND_FAIL; + } + } else if(spare_area[USED_OFFSET] == 0xFE) { + logic_blockID = (spare_area[LBN0_OFFSET] + (spare_area[LBN1_OFFSET] * 256)) & 0x03FF; + LUT_tab[logic_blockID] |= cur_block | VALID_BLOCK | USED_BLOCK; + LUT_tab[cur_block] &= (uint16_t)(~FREE_BLOCK); + } + + cur_block++; + } + + /* 3rd step : locate free blocks by scanning the LUT already built partially */ + free_block = 0; + for(cur_block = 0; cur_block < NAND_ZONE_SIZE; cur_block++) { + if(cur_block == 81) { + } + + if(!(LUT_tab[cur_block] & USED_BLOCK)) { + do { + if(LUT_tab[free_block] & FREE_BLOCK) { + LUT_tab [cur_block] |= free_block; + LUT_tab [free_block] &= ~FREE_BLOCK; + break; + } + + free_block++; + } while(free_block < NAND_ZONE_SIZE); + } + } + + return NAND_OK; +} + +/*! + \brief find free exchange block, according the block number(odd number select 1001, even number select 1000) + \param[in] odd_even: block number is odd or even + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint16_t nand_find_free_block(uint8_t odd_even) +{ + if(BLOCK_ODD == odd_even) { + return LUT_tab[MAX_LOG_BLOCKS_PER_ZONE] & 0x03FF; + } else if(BLOCK_EVEN == odd_even) { + return LUT_tab[MAX_LOG_BLOCKS_PER_ZONE + 1] & 0x03FF; + } + + return 0xFFFF; +} + +/*! + \brief check NAND data is right + \param[in] pbuf: input buffer + \param[in] len: buffer length + \param[in] value: right value in buffer + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_judge_buf_ok(uint8_t *pbuf, uint32_t len, uint8_t value) +{ + uint32_t i; + + for(i = 0; i < len; i++) { + if(pbuf[i] != value) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief check block is bad block + \param[in] blocknum: physical block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_isbad_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + BI_OFFSET; + + exmc_nand_read_spare(&flag, addr, 1); + + if(0xFFU != flag) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief mark used block + \param[in] blocknum: physical block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_mark_used_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + USED_OFFSET; + + flag = NAND_USED_BLOCK_FLAG; + + if(NAND_FAIL == exmc_nand_write_spare(&flag, addr, 1)) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief mark bad block + \param[in] blocknum: block number + \param[out] none + \retval none +*/ +static void nand_mark_bad_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + BI_OFFSET; + + flag = NAND_BAD_BLOCK_FLAG; + + if(NAND_FAIL == exmc_nand_write_spare(&flag, addr, 1)) { + addr.page = 1; + exmc_nand_write_spare(&flag, addr, 1); + } +} + +/*! + \brief mark logic block to specific block + \param[in] blocknum: physical block number + \param[in] logblock: logic block number + \param[out] none + \retval none +*/ +static uint8_t nand_mark_logic_block(uint32_t blocknum, uint16_t logblock) +{ + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + LBN0_OFFSET; + + if(NAND_FAIL == exmc_nand_write_spare((uint8_t *)&logblock, addr, 2)) { + return NAND_FAIL; + } + + return NAND_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd25qxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd25qxx.c new file mode 100644 index 0000000..bf42894 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd25qxx.c @@ -0,0 +1,467 @@ +/*! + \file gd25qxx.c + \brief SPI flash gd25qxx driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd25qxx.h" +#include "gd32f10x.h" +#include + +#define WRITE 0x02 /* write to memory instruction */ +#define WRSR 0x01 /* write status register instruction */ +#define WREN 0x06 /* write enable instruction */ + +#define READ 0x03 /* read from memory instruction */ +#define RDSR 0x05 /* read status register instruction */ +#define RDID 0x9F /* read identification */ +#define SE 0x20 /* sector erase instruction */ +#define BE (0x52U) /* block erase instruction */ +#define CE (0xC7U) /* chip erase instruction */ + + +#define WIP_FLAG 0x01 /* write in progress(wip)flag */ +#define DUMMY_BYTE 0xA5 + +/*! + \brief initialize SPI0 GPIO and parameter + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_init(void) +{ + spi_parameter_struct spi_init_struct; + + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOE); + rcu_periph_clock_enable(RCU_SPI0); + + /* SPI0_SCK(PA5), SPI0_MISO(PA6) and SPI0_MOSI(PA7) GPIO pin configuration */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + /* SPI0_CS(PE3) GPIO pin configuration */ + gpio_init(GPIOE, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3); + + /* chip select invalid*/ + SPI_FLASH_CS_HIGH(); + + /* SPI0 parameter config */ + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_struct.device_mode = SPI_MASTER;; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT;; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_LOW_PH_1EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_8 ; + spi_init_struct.endian = SPI_ENDIAN_MSB;; + spi_init(SPI0, &spi_init_struct); + + /* set crc polynomial */ + spi_crc_polynomial_set(SPI0,7); + /* enable SPI0 */ + spi_enable(SPI0); +} + +/*! + \brief erase the specified flash sector + \param[in] sector_addr: address of the sector to erase + \param[out] none + \retval none +*/ +void spi_flash_sector_erase(uint32_t sector_addr) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* sector erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send sector erase instruction */ + spi_flash_send_byte(SE); + /* send sector_addr high nibble address byte */ + spi_flash_send_byte((sector_addr & 0xFF0000) >> 16); + /* send sector_addr medium nibble address byte */ + spi_flash_send_byte((sector_addr & 0xFF00) >> 8); + /* send sector_addr low nibble address byte */ + spi_flash_send_byte(sector_addr & 0xFF); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + + +/*! + \brief erase the specified flash block(unit: 32KB) + \param[in] block_addr: address of the block to erase + \param[out] none + \retval none +*/ +void spi_flash_block_erase(uint32_t block_addr) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* block erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send block erase instruction */ + spi_flash_send_byte(BE); + /* send block_addr high nibble address byte */ + spi_flash_send_byte((block_addr & 0xFF0000U) >> 16U); + /* send block_addr medium nibble address byte */ + spi_flash_send_byte((block_addr & 0xFF00U) >> 8U); + /* send block_addr low nibble address byte */ + spi_flash_send_byte(block_addr & 0xFFU); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/* + \brief erase the entire flash + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_bulk_erase(void) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* bulk erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send bulk erase instruction */ + spi_flash_send_byte(CE); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/*! + \brief write more than one byte to the flash + \param[in] pbuffer: pointer to the buffer + \param[in] write_addr: flash's internal address to write + \param[in] num_byte_to_write: number of bytes to write to the flash + \param[out] none + \retval none +*/ +void spi_flash_page_write(uint8_t* pbuffer, uint32_t write_addr, uint16_t num_byte_to_write) +{ + /* enable the write access to the flash */ + spi_flash_write_enable(); + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "write to memory" instruction */ + spi_flash_send_byte(WRITE); + /* send write_addr high nibble address byte to write to */ + spi_flash_send_byte((write_addr & 0xFF0000) >> 16); + /* send write_addr medium nibble address byte to write to */ + spi_flash_send_byte((write_addr & 0xFF00) >> 8); + /* send write_addr low nibble address byte to write to */ + spi_flash_send_byte(write_addr & 0xFF); + + /* while there is data to be written on the flash */ + while(num_byte_to_write--){ + /* send the current byte */ + spi_flash_send_byte(*pbuffer); + /* point on the next byte to be written */ + pbuffer++; + } + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/*! + \brief write block of data to the flash + \param[in] pbuffer: pointer to the buffer + \param[in] write_addr: flash's internal address to write + \param[in] num_byte_to_write: number of bytes to write to the flash + \param[out] none + \retval none +*/ +void spi_flash_buffer_write(uint8_t* pbuffer, uint32_t write_addr, uint16_t num_byte_to_write) +{ + uint8_t num_of_page = 0, num_of_single = 0, addr = 0, count = 0, temp = 0; + + addr = write_addr % SPI_FLASH_PAGE_SIZE; + count = SPI_FLASH_PAGE_SIZE - addr; + num_of_page = num_byte_to_write / SPI_FLASH_PAGE_SIZE; + num_of_single = num_byte_to_write % SPI_FLASH_PAGE_SIZE; + + /* write_addr is SPI_FLASH_PAGE_SIZE aligned */ + if(0 == addr){ + /* num_byte_to_write < SPI_FLASH_PAGE_SIZE */ + if(0 == num_of_page) + spi_flash_page_write(pbuffer,write_addr,num_byte_to_write); + /* num_byte_to_write > SPI_FLASH_PAGE_SIZE */ + else{ + while(num_of_page--){ + spi_flash_page_write(pbuffer,write_addr,SPI_FLASH_PAGE_SIZE); + write_addr += SPI_FLASH_PAGE_SIZE; + pbuffer += SPI_FLASH_PAGE_SIZE; + } + spi_flash_page_write(pbuffer,write_addr,num_of_single); + } + }else{ + /* write_addr is not SPI_FLASH_PAGE_SIZE aligned */ + if(0 == num_of_page){ + /* (num_byte_to_write + write_addr) > SPI_FLASH_PAGE_SIZE */ + if(num_of_single > count){ + temp = num_of_single - count; + spi_flash_page_write(pbuffer,write_addr,count); + write_addr += count; + pbuffer += count; + spi_flash_page_write(pbuffer,write_addr,temp); + }else + spi_flash_page_write(pbuffer,write_addr,num_byte_to_write); + }else{ + /* num_byte_to_write > SPI_FLASH_PAGE_SIZE */ + num_byte_to_write -= count; + num_of_page = num_byte_to_write / SPI_FLASH_PAGE_SIZE; + num_of_single = num_byte_to_write % SPI_FLASH_PAGE_SIZE; + + spi_flash_page_write(pbuffer,write_addr, count); + write_addr += count; + pbuffer += count; + + while(num_of_page--){ + spi_flash_page_write(pbuffer,write_addr,SPI_FLASH_PAGE_SIZE); + write_addr += SPI_FLASH_PAGE_SIZE; + pbuffer += SPI_FLASH_PAGE_SIZE; + } + + if(0 != num_of_single) + spi_flash_page_write(pbuffer,write_addr,num_of_single); + } + } +} + +/*! + \brief read a block of data from the flash + \param[in] pbuffer: pointer to the buffer that receives the data read from the flash + \param[in] read_addr: flash's internal address to read from + \param[in] num_byte_to_read: number of bytes to read from the flash + \param[out] none + \retval none +*/ +void spi_flash_buffer_read(uint8_t* pbuffer, uint32_t read_addr, uint16_t num_byte_to_read) +{ + /* select the flash: chip slect low */ + SPI_FLASH_CS_LOW(); + + /* send "read from memory " instruction */ + spi_flash_send_byte(READ); + + /* send read_addr high nibble address byte to read from */ + spi_flash_send_byte((read_addr & 0xFF0000) >> 16); + /* send read_addr medium nibble address byte to read from */ + spi_flash_send_byte((read_addr& 0xFF00) >> 8); + /* send read_addr low nibble address byte to read from */ + spi_flash_send_byte(read_addr & 0xFF); + + /* while there is data to be read */ + while(num_byte_to_read--){ + /* read a byte from the flash */ + *pbuffer = spi_flash_send_byte(DUMMY_BYTE); + /* point to the next location where the byte read will be saved */ + pbuffer++; + } + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} + +/*! + \brief read flash identification + \param[in] none + \param[out] none + \retval flash identification +*/ +uint32_t spi_flash_read_id(void) +{ + uint32_t temp = 0, temp0 = 0, temp1 = 0, temp2 = 0; + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "RDID " instruction */ + spi_flash_send_byte(0x9F); + + /* read a byte from the flash */ + temp0 = spi_flash_send_byte(DUMMY_BYTE); + + /* read a byte from the flash */ + temp1 = spi_flash_send_byte(DUMMY_BYTE); + + /* read a byte from the flash */ + temp2 = spi_flash_send_byte(DUMMY_BYTE); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + temp = (temp0 << 16) | (temp1 << 8) | temp2; + + return temp; +} + +/*! + \brief initiate a read data byte (read) sequence from the flash + \param[in] read_addr: flash's internal address to read from + \param[out] none + \retval none +*/ +void spi_flash_start_read_sequence(uint32_t read_addr) +{ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "read from memory " instruction */ + spi_flash_send_byte(READ); + + /* send the 24-bit address of the address to read from */ + /* send read_addr high nibble address byte */ + spi_flash_send_byte((read_addr & 0xFF0000) >> 16); + /* send read_addr medium nibble address byte */ + spi_flash_send_byte((read_addr& 0xFF00) >> 8); + /* send read_addr low nibble address byte */ + spi_flash_send_byte(read_addr & 0xFF); +} + +/*! + \brief read a byte from the SPI flash + \param[in] none + \param[out] none + \retval byte read from the SPI flash +*/ +uint8_t spi_flash_read_byte(void) +{ + return(spi_flash_send_byte(DUMMY_BYTE)); +} + +/*! + \brief send a byte through the SPI interface and return the byte received from the SPI bus + \param[in] byte: byte to send + \param[out] none + \retval the value of the received byte +*/ +uint8_t spi_flash_send_byte(uint8_t byte) +{ + /* loop while data register in not emplty */ + while (RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_TBE)); + + /* send byte through the SPI0 peripheral */ + spi_i2s_data_transmit(SPI0,byte); + + /* wait to receive a byte */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_RBNE)); + + /* return the byte read from the SPI bus */ + return(spi_i2s_data_receive(SPI0)); +} + +/*! + \brief send a half word through the SPI interface and return the half word received from the SPI bus + \param[in] half_word: half word to send + \param[out] none + \retval the value of the received byte +*/ +uint16_t spi_flash_send_halfword(uint16_t half_word) +{ + /* loop while data register in not emplty */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_TBE)); + + /* send half word through the SPI0 peripheral */ + spi_i2s_data_transmit(SPI0,half_word); + + /* wait to receive a half word */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_RBNE)); + + /* return the half word read from the SPI bus */ + return spi_i2s_data_receive(SPI0); +} + +/*! + \brief enable the write access to the flash + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_write_enable(void) +{ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "write enable" instruction */ + spi_flash_send_byte(WREN); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} + +/*! + \brief poll the status of the write in progress(wip) flag in the flash's status register + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_wait_for_write_end(void) +{ + uint8_t flash_status = 0; + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "read status register" instruction */ + spi_flash_send_byte(RDSR); + + /* loop as long as the memory is busy with a write cycle */ + do{ + /* send a dummy byte to generate the clock needed by the flash + and put the value of the status register in flash_status variable */ + flash_status = spi_flash_send_byte(DUMMY_BYTE); + }while((flash_status & WIP_FLAG) == SET); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_it.c new file mode 100644 index 0000000..ab646dc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_it.c @@ -0,0 +1,175 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +extern void delay_decrement(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..2e53f2e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/gd32f10x_usbd_hw.c @@ -0,0 +1,89 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config (void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + if (48000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1); + } else if (72000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1_5); + } else if (96000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + } else { + /* reserved */ + } + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config (void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config (void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/inter_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/inter_flash_if.c new file mode 100644 index 0000000..7064918 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/inter_flash_if.c @@ -0,0 +1,262 @@ +/*! + \file inter_flash_if.c + \brief USB DFU device flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "inter_flash_if.h" +#include "dfu_mem.h" + +/* local function prototypes ('static') */ +static uint8_t flash_if_init(void); +static uint8_t flash_if_deinit(void); +static uint8_t flash_if_erase(uint32_t addr); +static uint8_t flash_if_write(uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t *flash_if_read(uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t flash_if_checkaddr(uint32_t addr); +static fmc_state_enum fmc_bank0_state_get(void); +static fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout); + +dfu_mem_prop dfu_inter_flash_cb = { + (const uint8_t *)INTER_FLASH_IF_STR, + flash_if_init, + flash_if_deinit, + flash_if_erase, + flash_if_write, + flash_if_read, + flash_if_checkaddr, + 60, /* flash erase timeout in ms */ + 80 /* flash programming timeout in ms (80us * RAM Buffer size (1024 Bytes) */ +}; + +/*! + \brief program option byte + \param[in] Mem_Add: target address + \param[in] data: pointer to target data + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum option_byte_write(uint32_t mem_add, uint8_t *data) +{ + uint8_t index; + + fmc_state_enum status ; + + /* unlock the flash program erase controller */ + fmc_unlock(); + + /* clear pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + /* authorize the small information block programming */ + ob_unlock(); + + /* start erase the option byte */ + FMC_CTL0 |= FMC_CTL0_OBER; + FMC_CTL0 |= FMC_CTL0_START; + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + FMC_CTL0 &= ~FMC_CTL0_OBER; + /* set the OBPG bit */ + FMC_CTL0 |= FMC_CTL0_OBPG; + + /* option bytes always have 16 bytes */ + for (index = 0U; index < 15U; index = index + 2U) { + *(__IO uint16_t *)mem_add = data[index] & 0xffU; + + mem_add = mem_add + 2U; + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + } + + /* if the program operation is completed, disable the OBPG Bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + + fmc_lock(); + + return status; +} + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_init(void) +{ + /* unlock the internal flash */ + fmc_unlock(); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_deinit(void) +{ + /* lock the internal flash */ + fmc_lock(); + + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_erase(uint32_t addr) +{ + fmc_page_erase(addr); + + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_write(uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t idx = 0U; + + /* unlock the flash program erase controller */ + fmc_unlock(); + + /* not an aligned data */ + if (len & 0x03U) { + for(idx = len; idx < ((len & 0xFFFCU) + 4U); idx++) { + buf[idx] = 0xFFU; + } + } + + /* data received are word multiple */ + for (idx = 0U; idx < len; idx += 4U) { + fmc_word_program(addr, *(uint32_t *)(buf + idx)); + + addr += 4U; + } + + fmc_lock(); + + return MEM_OK; +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *flash_if_read(uint8_t *buf, uint32_t addr, uint32_t len) +{ + return (uint8_t *)(addr); +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_checkaddr(uint32_t addr) +{ + if((addr >= FLASH_START_ADDR) && (addr < FLASH_END_ADDR)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} + +/*! + \brief get the FMC bank0 state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_bank0_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_BUSY)) { + fmc_state = FMC_BUSY; + } else { + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_WPERR)) { + fmc_state = FMC_WPERR; + } else { + if((uint32_t)0x00U != (FMC_STAT0 & (FMC_STAT0_PGERR))) { + fmc_state = FMC_PGERR; + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC bank0 is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do { + /* get FMC state */ + fmc_state = fmc_bank0_state_get(); + timeout--; + } while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state) { + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/main.c new file mode 100644 index 0000000..b3b11de --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/main.c @@ -0,0 +1,90 @@ +/*! + \file main.c + \brief USB device main routine + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_core.h" +#include "usbd_hw.h" + +#define SRAM_SIZE REG16(0x1ffff7e2)*1024 +#define SRAM_START_ADDRESS SRAM_BASE +#define SRAM_END_ADDRESS SRAM_BASE+SRAM_SIZE + +usb_dev usb_dfu; + +/*! + \brief main routine will construct a DFU device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint32_t app_addr; + app_func application; + uint32_t sram_sect = REG32(APP_LOADED_ADDR); + + /* configure tamper key to run firmware */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + /* tamper key must be pressed on GD32-EVAL when power on */ + if(0U != gd_eval_key_state_get(KEY_TAMPER)){ + /* test if user code is programmed starting from address 0x08008000 */ + if ((sram_sect >= SRAM_START_ADDRESS)&&((sram_sect < SRAM_END_ADDRESS))) { + app_addr = *(__IO uint32_t*) (APP_LOADED_ADDR + 4U); + application = (app_func) app_addr; + + /* initialize user application's stack pointer */ + __set_MSP(*(__IO uint32_t*) APP_LOADED_ADDR); + + /* jump to user application */ + application(); + } + } + + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usb_dfu, &dfu_desc, &dfu_class); + + /* NVIC configuration */ + nvic_config(); + + usbd_connect(&usb_dfu); + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nand_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nand_flash_if.c new file mode 100644 index 0000000..1d10c5a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nand_flash_if.c @@ -0,0 +1,149 @@ +/*! + \file nand_flash_if.c + \brief USB DFU device nand flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nand the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "nand_flash_if.h" +#include "exmc_nandflash.h" +#include "dfu_mem.h" + +/* local function prototypes ('static') */ +static uint8_t nand_flash_if_init (void); +static uint8_t nand_flash_if_deinit (void); +static uint8_t nand_flash_if_erase (uint32_t addr); +static uint8_t nand_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t* nand_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t nand_flash_if_checkaddr (uint32_t addr); + +dfu_mem_prop dfu_nand_flash_cb = +{ + (const uint8_t *)NAND_FLASH_IF_STR, + + nand_flash_if_init, + nand_flash_if_deinit, + nand_flash_if_erase, + nand_flash_if_write, + nand_flash_if_read, + nand_flash_if_checkaddr, + 20, /* flash erase timeout in ms */ + 40 /* flash programming timeout in ms */ +}; + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_init (void) +{ + /* configure the EXMC access mode */ + exmc_nandflash_init(EXMC_BANK1_NAND); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_deinit (void) +{ + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_erase (uint32_t addr) +{ + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* calculate actual address */ + uint32_t addr_actual = addr - NAND_FLASH_START_ADDR; + + /* write block of data to the flash */ + if(NAND_OK == nand_write(addr_actual, buf, len)){ + return MEM_OK; + }else{ + return MEM_FAIL; + } +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *nand_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* calculate actual address */ + uint32_t addr_actual = addr - NAND_FLASH_START_ADDR; + + nand_read(addr_actual, buf, len); + + return buf; +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_checkaddr (uint32_t addr) +{ + if ((addr >= NAND_FLASH_START_ADDR) && (addr < NAND_FLASH_END_ADDR)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nor_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nor_flash_if.c new file mode 100644 index 0000000..03cf32b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/nor_flash_if.c @@ -0,0 +1,144 @@ +/*! + \file nor_flash_if.c + \brief USB DFU device nor flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd25qxx.h" +#include "nor_flash_if.h" +#include "dfu_mem.h" + +/* local function prototypes ('static') */ +static uint8_t nor_flash_if_init (void); +static uint8_t nor_flash_if_deinit (void); +static uint8_t nor_flash_if_erase (uint32_t addr); +static uint8_t nor_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t* nor_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t nor_flash_if_checkaddr (uint32_t addr); + +dfu_mem_prop dfu_nor_flash_cb = +{ + (const uint8_t *)NOR_FLASH_IF_STR, + + nor_flash_if_init, + nor_flash_if_deinit, + nor_flash_if_erase, + nor_flash_if_write, + nor_flash_if_read, + nor_flash_if_checkaddr, + 400, /* flash erase timeout in ms */ + 20 /* flash programming timeout in ms */ +}; + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_init (void) +{ + /* initialize spi interface*/ + spi_flash_init(); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_deinit (void) +{ + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_erase (uint32_t addr) +{ + /* erase the specified flash sector */ + spi_flash_block_erase(addr); + + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* write block of data to the flash */ + spi_flash_buffer_write(buf, addr, len); + + return MEM_OK; +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *nor_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + spi_flash_buffer_read(buf, addr, len); + + return buf; +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_checkaddr (uint32_t addr) +{ + if (((addr > NOR_FLASH_START_ADDR) && (addr < NOR_FLASH_END_ADDR)) || (NOR_FLASH_START_ADDR == addr)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/systick.c new file mode 100644 index 0000000..18d7084 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/dev_firmware_update/src/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "systick.h" +#include "usbd_conf.h" + +static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)){ + /* capture error */ + while (1){ + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay){ + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if (0U != delay){ + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewp new file mode 100644 index 0000000..05401c8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewp @@ -0,0 +1,1053 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Driver + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewt new file mode 100644 index 0000000..4b08e63 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.ewt @@ -0,0 +1,1156 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Driver + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.eww new file mode 100644 index 0000000..5d17e90 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/EWARM/iap.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\iap.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvopt new file mode 100644 index 0000000..728ae04 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvopt @@ -0,0 +1,625 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + iap + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + + + 0 + 0 + 200 + 1 +
134224018
+ 0 + 0 + 0 + 0 + 0 + 1 + D:\SVN\fm3203\GD32F10x_Firmware_Library_V2.0.0\Firmware\GD32F30x_usbd_driver\Source\usbd_std.c + + +
+
+ + + 0 + 1 + report_buf + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 57 + 0 + 34 + 63 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 34 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Driver + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + usb_iap_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 22 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvoptx new file mode 100644 index 0000000..077c065 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvoptx @@ -0,0 +1,560 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + iap + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + + + 0 + 0 + 200 + 1 +
134224018
+ 0 + 0 + 0 + 0 + 0 + 1 + D:\SVN\fm3203\GD32F10x_Firmware_Library_V2.0.0\Firmware\GD32F30x_usbd_driver\Source\usbd_std.c + + +
+
+ + + 0 + 1 + report_buf + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Driver + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + usb_iap_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 22 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvproj new file mode 100644 index 0000000..8d2d531 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvproj @@ -0,0 +1,562 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + iap + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + iap + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Driver + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usb_iap_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvprojx new file mode 100644 index 0000000..173959b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/MDK-ARM/iap.uvprojx @@ -0,0 +1,555 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + iap + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + iap + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Driver + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usb_iap_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\iap\Source\usb_iap_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_conf.h new file mode 100644 index 0000000..7f928ed --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_conf.h @@ -0,0 +1,96 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +#define USBD_IAP_INTERFACE 0U + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +/* #define USBD_LOWPWR_MODE_ENABLE */ + +/* endpoint count used by the custom HID device */ +#define EP_COUNT (2U) + +/* base address offset of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_STRING_COUNT 4U + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0x80U) + +#define IAP_IN_EP EP_IN(1U) +#define IAP_OUT_EP EP_OUT(1U) + +#define IAP_IN_PACKET 17U +#define IAP_OUT_PACKET 64U + +/* Tx buffer address offset */ +#define INT_TX_ADDR (0x100U) + +/* Rx buffer address offset */ +#define INT_RX_ADDR (0x140U) + +#define TRANSFER_SIZE 62U /* IAP maximum data packet size */ + +#define PAGE_SIZE 2048U /* MCU page size */ + +/* memory address from where user application will be loaded, which represents + the DFU code protected against write and erase operations.*/ +#define APP_LOADED_ADDR 0x08008000U + +/* maximum number of supported memory media (Flash, RAM or EEPROM and so on) */ +#define MAX_USED_MEMORY_MEDIA 1 + +/* make sure the corresponding memory where the DFU code should not be loaded + cannot be erased or overwritten by DFU application. */ +#define IS_PROTECTED_AREA(addr) (uint8_t)((((addr) >= 0x08000000U) && ((addr) < (APP_LOADED_ADDR)))? 1U : 0U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_hw.h new file mode 100644 index 0000000..2dc2051 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure the different system clocks */ +void rcu_config(void); +/* configure the gpio peripheral */ +void gpio_config(void); +/* configure interrupt priority */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/readme.txt new file mode 100644 index 0000000..59a477e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief description of the USB custom HID device for IAP demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USBFS peripheral. + + The GD32 device is enumerated as an USB Custom HID device for IAP, that uses the +native PC Host HID driver. + + To test the demo, you need a configuration hex image or bin image. The hex image +or the bin image should set application address at 0x8008000. You can refer to +"Utilities/Binary/DFU_Images" folder and use the hex images or bin images in it. + + To test the demo, you need to: + - Download the "USB IAP Client" PC applet + - Start the "USB IAP Client" PC applet and connect GD32 USB to PC (Note: maybe + the driver installing is failed in the first time, try to reset again.) + - The device should be detected and shown in the PC applet + - Select the hex image and download it to the flash + - After each device reset, the mcu will run the new application + - After each device reset, hold down the TAMPER key on the GD32F10X-EVAL board + to enter IAP mode \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..7b6abd7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/gd32f10x_usbd_hw.c @@ -0,0 +1,89 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config (void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + if (48000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1); + } else if (72000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV1_5); + } else if (96000000U == system_clock) { + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + } else { + /* reserved */ + } + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config (void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config (void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/main.c new file mode 100644 index 0000000..8e63dc5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/main.c @@ -0,0 +1,91 @@ +/*! + \file main.c + \brief USB IAP device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usb_iap_core.h" +#include "usbd_hw.h" + +#define SRAM_SIZE REG16(0x1ffff7e2)*1024 +#define SRAM_START_ADDRESS SRAM_BASE +#define SRAM_END_ADDRESS SRAM_BASE+SRAM_SIZE + +usb_dev usbd_iap; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint32_t app_address; + app_func application; + uint32_t sram_sect = REG32(APP_LOADED_ADDR); + + /* configure Tamper key to run firmware */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + /* tamper key must be pressed on board when power on */ + if(0U != gd_eval_key_state_get(KEY_TAMPER)) { + /* test if user code is programmed starting from address 0x8008000 */ + if ((sram_sect > SRAM_START_ADDRESS)&&((sram_sect < SRAM_END_ADDRESS))) { + app_address = *(__IO uint32_t*) (APP_LOADED_ADDR + 4U); + application = (app_func) app_address; + + /* initialize user application's stack pointer */ + __set_MSP(*(__IO uint32_t*) APP_LOADED_ADDR); + + /* jump to user application */ + application(); + } + } + + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_iap, &iap_desc, &iap_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_iap); + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/in_application_program_hid/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewd new file mode 100644 index 0000000..1dad6c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewp new file mode 100644 index 0000000..9212072 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewp @@ -0,0 +1,1067 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\flash_data.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\internal_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\msc_mem.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewt new file mode 100644 index 0000000..f62d2a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.ewt @@ -0,0 +1,1171 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\flash_data.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\internal_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\msc_mem.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.eww new file mode 100644 index 0000000..c7ad0a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/EWARM/msc_cdrom.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\msc_cdrom.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvopt new file mode 100644 index 0000000..acca06b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvopt @@ -0,0 +1,731 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + msc_cdrom + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + + + + 0 + 1 + bbb_data + + + 1 + 1 + bbb_cbw + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 28 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\internal_flash_if.c + internal_flash_if.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 61 + 0 + 0 + 0 + 0 + ..\src\flash_data.c + flash_data.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\msc_mem.c + msc_mem.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 7 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 8 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 18 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 25 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 28 + 2 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 29 + 5 + 0 + 0 + 60 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx new file mode 100644 index 0000000..e9170ba --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx @@ -0,0 +1,638 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + msc_cdrom + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + bbb_data + + + 1 + 1 + bbb_cbw + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\internal_flash_if.c + internal_flash_if.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\flash_data.c + flash_data.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + ..\src\msc_mem.c + msc_mem.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 7 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 28 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 29 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvproj new file mode 100644 index 0000000..fb655fa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvproj @@ -0,0 +1,642 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_cdrom + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_cdrom + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + internal_flash_if.c + 1 + ..\src\internal_flash_if.c + + + flash_data.c + 1 + ..\src\flash_data.c + + + 2 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + + + + + + + + + + + + msc_mem.c + 1 + ..\src\msc_mem.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx new file mode 100644 index 0000000..2648a99 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx @@ -0,0 +1,643 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_cdrom + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_cdrom + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + internal_flash_if.c + 1 + ..\src\internal_flash_if.c + + + flash_data.c + 1 + ..\src\flash_data.c + + + 2 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + msc_mem.c + 1 + ..\src\msc_mem.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/internal_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/internal_flash_if.h new file mode 100644 index 0000000..7a22a44 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/internal_flash_if.h @@ -0,0 +1,48 @@ +/*! + \file internal_flash_if.h + \brief the header file of internal_flash_if.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __INTERNAL_FLASH_IF_H +#define __INTERNAL_FLASH_IF_H + +#include "usbd_conf.h" + +/* function declarations */ +/* initialize the nand flash */ +uint32_t flash_init(void); +/* read data from multiple blocks of nand flash */ +uint32_t flash_read_multi_blocks(uint8_t* pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num); +/* write data to multiple blocks of flash */ +uint32_t flash_write_multi_blocks(uint8_t* pBuf, uint32_t write_addr, uint16_t block_size, uint32_t block_num); + +#endif /* __INTERNAL_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_conf.h new file mode 100644 index 0000000..9c62df3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_conf.h @@ -0,0 +1,85 @@ +/*! + /file usbd_conf.h + /brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +//#define USE_EXTERNAL_MEDIA +#define USE_INTERNAL_MEDIA + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STRING_COUNT 4U + +#define USBD_MSC_INTERFACE 0U + +#define PAGE_SIZE ((uint32_t)(512U)) +#define NAND_FLASH_BASE_ADDRESS ((uint32_t)(0x08000000U + 0x04000U)) +#define NAND_FLASH_END_ADDRESS ((uint32_t)(0x08000000U + 0x10000U)) + +#define MSC_IN_EP EP_IN(1U) +#define MSC_OUT_EP EP_OUT(2U) + +#define EP0_TX_ADDR 0x40U +#define EP0_RX_ADDR 0x80U + +#define BULK_TX_ADDR 0xC0U +#define BULK_RX_ADDR 0x100U + +#define MEM_LUN_NUM 1U + +#define MSC_DATA_PACKET_SIZE 64U +#define MSC_MEDIA_PACKET_SIZE PAGE_SIZE + +#define BLOCK_SIZE 512U +#define BLOCK_NUM ((NAND_FLASH_END_ADDRESS - NAND_FLASH_BASE_ADDRESS) / 512U) + +/* endpoint count used by the MSC device */ +#define EP_COUNT (3U) + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_hw.h new file mode 100644 index 0000000..2dc2051 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure the different system clocks */ +void rcu_config(void); +/* configure the gpio peripheral */ +void gpio_config(void); +/* configure interrupt priority */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/readme.txt new file mode 100644 index 0000000..22830b4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the MSC demo. + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32103C-EVAL-V1.0 board,it provides a description of +how to use the USB device application based on the Mass Storage Class (MSC). + + This demo is provides a description of how to use the USBD peripheral. + + It illustrates an implementation of the CD-ROM which uses the bulk transfer while +the internal Flash is used as storage media. + + This example supports the BBB (bulk only transfer) protocol and all needed SCSI +(small computer system interface) commands, and is compatible with Windows platform. + + After running the example, the user just has to plug the USB cable into a PC host +and the device is automatically detected. A new CDROM appears in the system window +and the user can open it to read the contents. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/flash_data.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/flash_data.c new file mode 100644 index 0000000..8695da6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/flash_data.c @@ -0,0 +1,2999 @@ +/*! + \file flash_data.c + \brief the data will be store in flash + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_conf.h" + +#if defined ( __ICCARM__ ) +const uint8_t Flash_Data[] @0x8004000 = +#else +const uint8_t Flash_Data[] __attribute__((at(0x8004000))) = +#endif +{ +0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31, 0x00, 0x02, 0x04, 0x01, 0x00, +0x02, 0xe0, 0x00, 0x60, 0x00, 0xf8, 0x01, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x0a, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, +0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, +0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 0x16, +0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, 0x06, +0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x38, 0x4e, 0x24, 0x7d, 0x20, 0x8b, 0xc1, 0x99, +0xe8, 0x7e, 0x01, 0x83, 0xeb, 0x3a, 0x66, 0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, +0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0xfe, +0x06, 0xd8, 0x7d, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, +0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11, 0x60, 0x89, 0x46, 0xfc, 0x89, 0x56, 0xfe, 0xb8, +0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, +0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x28, 0x01, 0x72, 0x3e, 0x38, 0x2d, 0x74, 0x17, 0x60, +0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x3d, 0x4e, 0x74, 0x09, 0x83, 0xc7, 0x20, +0x3b, 0xfb, 0x72, 0xe7, 0xeb, 0xdd, 0xfe, 0x0e, 0xd8, 0x7d, 0x7b, 0xa7, 0xbe, 0x7f, 0x7d, 0xac, +0x98, 0x03, 0xf0, 0xac, 0x98, 0x40, 0x74, 0x0c, 0x48, 0x74, 0x13, 0xb4, 0x0e, 0xbb, 0x07, 0x00, +0xcd, 0x10, 0xeb, 0xef, 0xbe, 0x82, 0x7d, 0xeb, 0xe6, 0xbe, 0x80, 0x7d, 0xeb, 0xe1, 0xcd, 0x16, +0x5e, 0x1f, 0x66, 0x8f, 0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, 0xfe, +0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1, 0x04, 0xe8, 0xc2, 0x00, +0x72, 0xd7, 0xea, 0x00, 0x02, 0x70, 0x00, 0x52, 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x91, +0x8b, 0x46, 0x18, 0xa2, 0x26, 0x05, 0x96, 0x92, 0x33, 0xd2, 0xf7, 0xf6, 0x91, 0xf7, 0xf6, 0x42, +0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, +0x02, 0x80, 0x7e, 0x02, 0x0e, 0x75, 0x04, 0xb4, 0x42, 0x8b, 0xf4, 0x8a, 0x56, 0x24, 0xcd, 0x13, +0x61, 0x61, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03, +0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x79, 0x73, +0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, +0x49, 0x2f, 0x4f, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, +0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c, 0x20, 0x61, 0x6e, +0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, +0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 0x59, 0x53, 0x7f, 0x01, +0x00, 0x41, 0xbb, 0x00, 0x07, 0x60, 0x66, 0x6a, 0x00, 0xe9, 0x3b, 0xff, 0x00, 0x00, 0x55, 0xaa, +0xf8, 0xff, 0xff, 0x03, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xa0, 0x00, 0x0b, +0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13, 0xf0, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xf8, 0xff, 0xff, 0x03, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xa0, 0x00, 0x0b, +0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13, 0xf0, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x41, 0x47, 0x00, 0x44, 0x00, 0x5f, 0x00, 0x4c, 0x00, 0x6f, 0x00, 0x0f, 0x00, 0xc8, 0x67, 0x00, +0x6f, 0x00, 0x2e, 0x00, 0x6a, 0x00, 0x70, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0x47, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x4f, 0x20, 0x4a, 0x50, 0x47, 0x00, 0x10, 0xb3, 0x0b, 0x4f, +0x94, 0x4f, 0x00, 0x00, 0x00, 0x00, 0xb3, 0x50, 0x94, 0x4f, 0x02, 0x00, 0xc4, 0x8c, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x01, 0x2c, +0x01, 0x2c, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x04, +0x04, 0x03, 0x05, 0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x08, +0x08, 0x0a, 0x08, 0x07, 0x07, 0x0a, 0x0d, 0x0a, 0x0a, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x09, +0x0e, 0x0f, 0x0d, 0x0c, 0x0e, 0x0b, 0x0c, 0x0c, 0x0c, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x02, 0x02, +0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, +0x00, 0x11, 0x08, 0x01, 0xe2, 0x02, 0x5f, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, +0x01, 0xff, 0xc4, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, +0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, +0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, +0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, +0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, +0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, +0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, +0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, +0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, +0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, +0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, +0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 0x01, 0x00, 0x03, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x11, 0x00, +0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, +0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, +0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, +0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, +0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, +0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, +0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, +0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, +0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, +0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, +0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, +0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xfd, +0xfc, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x85, 0xab, 0xe4, 0xff, 0x00, +0xda, 0x7b, 0xfe, 0x0b, 0x1f, 0xf0, 0x53, 0xf6, 0x67, 0xba, 0xba, 0xd3, 0x86, 0xb8, 0xfe, 0x34, +0xf1, 0x0d, 0xb6, 0x55, 0xb4, 0xdf, 0x0f, 0x6d, 0xba, 0x58, 0x98, 0x71, 0x89, 0x6e, 0x32, 0x20, +0x42, 0x0f, 0x05, 0x43, 0xb3, 0xa9, 0xea, 0xbc, 0x57, 0x56, 0x0f, 0x05, 0x88, 0xc5, 0x54, 0xf6, +0x58, 0x68, 0x39, 0xcb, 0xb2, 0x5f, 0x9f, 0x63, 0x93, 0x1b, 0x8f, 0xc3, 0x60, 0xe9, 0xfb, 0x6c, +0x54, 0xd4, 0x23, 0xdd, 0xbb, 0x7d, 0xdd, 0xfd, 0x11, 0xf5, 0x8e, 0x6b, 0x9d, 0xf8, 0x81, 0xf1, +0x37, 0xc3, 0x7f, 0x0b, 0x74, 0x9f, 0xb7, 0x78, 0x9b, 0x5e, 0xd1, 0xfc, 0x3f, 0x67, 0x82, 0x44, +0xda, 0x8d, 0xec, 0x76, 0xa8, 0xd8, 0xec, 0x0b, 0x11, 0x93, 0xec, 0x39, 0xaf, 0xc6, 0xff, 0x00, +0xda, 0x1f, 0xfe, 0x0b, 0xd9, 0xf1, 0x6b, 0xe2, 0xb9, 0xb8, 0xb5, 0xf0, 0x8d, 0x9e, 0x91, 0xf0, +0xf7, 0x4a, 0x6c, 0xa8, 0x36, 0xce, 0x6f, 0x6f, 0xd8, 0x7a, 0x19, 0x98, 0x28, 0x07, 0xdd, 0x15, +0x0f, 0xd7, 0x38, 0xaf, 0x91, 0x7c, 0x5f, 0xf1, 0xb7, 0xc5, 0x9e, 0x3f, 0xd6, 0x6e, 0x35, 0x3d, +0x6b, 0x5e, 0xbe, 0xd5, 0xb5, 0x0b, 0xbf, 0xbd, 0x71, 0x7a, 0x7c, 0xf9, 0xcf, 0xfd, 0xb5, 0x93, +0x2f, 0xff, 0x00, 0x8f, 0x57, 0xde, 0xe5, 0xbe, 0x1c, 0x62, 0x6a, 0xda, 0x58, 0xda, 0x8a, 0x9a, +0xec, 0xbd, 0xe7, 0xf7, 0xe8, 0x97, 0xde, 0xcf, 0xcd, 0x33, 0x7f, 0x14, 0x68, 0xd2, 0xbc, 0x32, +0xda, 0x2e, 0xa3, 0xef, 0x27, 0xc9, 0x1f, 0x92, 0xb3, 0x93, 0xf4, 0x69, 0x1f, 0xb6, 0xdf, 0x15, +0x3f, 0xe0, 0xb3, 0x1f, 0x06, 0x7c, 0x00, 0x66, 0x87, 0x49, 0xbc, 0xd6, 0xbc, 0x63, 0x74, 0xa0, +0x80, 0x34, 0xbb, 0x23, 0x1c, 0x3b, 0xb9, 0xeb, 0x2c, 0xe6, 0x30, 0x47, 0x1d, 0x50, 0x3f, 0x5e, +0xfc, 0xd7, 0xcf, 0xbf, 0x10, 0xff, 0x00, 0xe0, 0xbd, 0x3e, 0x22, 0xbd, 0x66, 0x8f, 0xc2, 0x9e, +0x00, 0xd1, 0x74, 0xe0, 0x3e, 0xeb, 0xea, 0xf7, 0x92, 0xdf, 0x33, 0x7b, 0x98, 0xe2, 0xf2, 0x71, +0xc7, 0x6d, 0xc7, 0xea, 0x6b, 0xf2, 0xd7, 0xfe, 0x13, 0x4d, 0x60, 0x7f, 0xcb, 0xfd, 0xcf, 0xfd, +0xf2, 0x9f, 0xe1, 0x52, 0x43, 0xe3, 0x9d, 0x62, 0x35, 0xc2, 0xdf, 0x33, 0x7b, 0xbd, 0xb4, 0x6e, +0x7f, 0x36, 0x43, 0x5f, 0x73, 0x82, 0xe0, 0x4c, 0x8f, 0x0f, 0xac, 0xe9, 0xca, 0xa3, 0xfe, 0xf3, +0xfd, 0x15, 0x97, 0xde, 0x7e, 0x61, 0x9a, 0x71, 0xe7, 0x17, 0xe2, 0xdb, 0x54, 0x6b, 0x53, 0xa2, +0xbb, 0x46, 0x3f, 0xac, 0x94, 0x9f, 0xdc, 0xd1, 0xf7, 0x17, 0x8c, 0x3f, 0xe0, 0xae, 0xff, 0x00, +0x1e, 0x3c, 0x52, 0xec, 0xb1, 0x78, 0xa2, 0xc7, 0x41, 0x85, 0x86, 0x19, 0x74, 0xdd, 0x2e, 0xdb, +0x18, 0xf6, 0x79, 0x11, 0xd8, 0x7d, 0x43, 0x03, 0x5e, 0x75, 0xaf, 0x7e, 0xdc, 0x5f, 0x19, 0x7c, +0x4b, 0x36, 0xf9, 0xbe, 0x29, 0xf8, 0xed, 0x71, 0xff, 0x00, 0x3e, 0x9a, 0xa4, 0xb6, 0xc3, 0xf2, +0x89, 0x94, 0x57, 0xcd, 0x96, 0x9f, 0x13, 0x75, 0x3b, 0x76, 0x1e, 0x6a, 0xd8, 0xcc, 0xb8, 0xc1, +0xf3, 0x21, 0xd8, 0xd8, 0xf6, 0x28, 0x40, 0x07, 0xf0, 0xfc, 0x2b, 0x5b, 0x4e, 0xf8, 0xa1, 0x67, +0x2b, 0x2f, 0xda, 0xa0, 0xb9, 0xb6, 0x73, 0xc1, 0x91, 0x1b, 0xcf, 0x8c, 0x7a, 0x93, 0x80, 0x18, +0x7d, 0x00, 0x35, 0xf4, 0xd8, 0x5c, 0xa7, 0x29, 0xa5, 0xa5, 0x2a, 0x10, 0x8f, 0xfd, 0xba, 0xbf, +0x3b, 0x33, 0xf3, 0xdc, 0xcf, 0x1b, 0xc5, 0x55, 0x2f, 0x2a, 0xd8, 0xaa, 0x93, 0x5d, 0x6d, 0x52, +0x5f, 0x92, 0x6b, 0xf2, 0x3d, 0x52, 0xf7, 0xe3, 0x97, 0x8e, 0x35, 0x19, 0x7c, 0xcb, 0x9f, 0x19, +0xf8, 0xba, 0xeb, 0xdd, 0xf5, 0x69, 0x9b, 0x1f, 0x9b, 0xd5, 0x76, 0xf8, 0xbf, 0xe2, 0xd3, 0xff, +0x00, 0x33, 0x57, 0x88, 0x7f, 0xf0, 0x69, 0x37, 0xff, 0x00, 0x17, 0x5c, 0xbd, 0x95, 0xfd, 0xbe, +0xa5, 0x00, 0x9a, 0xd6, 0x68, 0x25, 0x87, 0x20, 0x16, 0x89, 0xf7, 0x6d, 0x27, 0xb3, 0x0e, 0xaa, +0x7d, 0x88, 0x06, 0xa6, 0xcd, 0x7a, 0xd1, 0xc1, 0xe1, 0x9a, 0xba, 0x84, 0x7e, 0xe4, 0x7c, 0x85, +0x4c, 0xcf, 0x1f, 0x19, 0x38, 0xce, 0xac, 0xef, 0xe7, 0x29, 0x7e, 0xae, 0xe7, 0x59, 0xa6, 0x7e, +0xd0, 0x1e, 0x3e, 0xd1, 0x6e, 0x7c, 0xcb, 0x3f, 0x1b, 0x78, 0xc6, 0xd2, 0xe1, 0x4f, 0x5b, 0x6d, +0x5e, 0xe5, 0x48, 0xfc, 0x9e, 0xba, 0xdf, 0x0e, 0x7e, 0xde, 0x5f, 0x1a, 0x3c, 0x32, 0x3f, 0xd1, +0xfe, 0x29, 0x78, 0xbe, 0x4e, 0x73, 0xfe, 0x99, 0xa9, 0xc9, 0x75, 0xff, 0x00, 0xa3, 0x77, 0xd7, +0x93, 0x51, 0x59, 0xd4, 0xca, 0xb0, 0x75, 0x15, 0xaa, 0x52, 0x8b, 0xf5, 0x8a, 0x7f, 0xa1, 0xad, +0x0e, 0x20, 0xcd, 0x28, 0xbe, 0x6a, 0x38, 0x9a, 0x91, 0xf4, 0x9c, 0x97, 0xe4, 0xcf, 0xa9, 0x3c, +0x1b, 0xff, 0x00, 0x05, 0x8d, 0xf8, 0xe9, 0xe1, 0x5d, 0xa2, 0xf3, 0x5a, 0xd2, 0x7c, 0x40, 0xaa, +0x46, 0x17, 0x53, 0xd2, 0x21, 0x5c, 0x8f, 0x43, 0xf6, 0x71, 0x13, 0x7e, 0x3d, 0x7d, 0xeb, 0xd9, +0x7e, 0x1d, 0xff, 0x00, 0xc1, 0x7a, 0xb5, 0x08, 0xbc, 0xa8, 0xfc, 0x5d, 0xf0, 0xf6, 0xce, 0x70, +0xd8, 0xdd, 0x73, 0xa4, 0x6a, 0x4d, 0x0e, 0x38, 0xe7, 0xf7, 0x52, 0xab, 0xe7, 0x3f, 0xf5, 0xd0, +0x63, 0xde, 0xbf, 0x3d, 0xa8, 0xaf, 0x17, 0x17, 0xc1, 0x39, 0x2e, 0x21, 0x7b, 0xf8, 0x78, 0xaf, +0xf0, 0xde, 0x3f, 0x93, 0x48, 0xfa, 0x7c, 0xbf, 0xc5, 0x0e, 0x27, 0xc1, 0xb5, 0xc9, 0x8b, 0x94, +0x97, 0x69, 0xda, 0x77, 0xff, 0x00, 0xc0, 0x93, 0x7f, 0x73, 0x4f, 0xcc, 0xfd, 0x92, 0xf8, 0x59, +0xff, 0x00, 0x05, 0x77, 0xf8, 0x25, 0xf1, 0x31, 0xe3, 0x8a, 0xe3, 0x5e, 0xbf, 0xf0, 0x9d, 0xdc, +0xa7, 0x02, 0x0d, 0x76, 0xcc, 0xc2, 0x3f, 0x19, 0x63, 0x32, 0x44, 0x3e, 0xac, 0xe3, 0xad, 0x7d, +0x15, 0xe1, 0x5f, 0x18, 0xe9, 0x5e, 0x38, 0xd1, 0xd7, 0x51, 0xd0, 0xf5, 0x5d, 0x3b, 0x5a, 0xd3, +0xe4, 0xfb, 0x97, 0x56, 0x37, 0x31, 0xdc, 0x40, 0xdd, 0xf8, 0x74, 0x24, 0x1e, 0x08, 0xfc, 0xeb, +0xf9, 0xe3, 0x23, 0x35, 0xb7, 0xe0, 0x3f, 0x89, 0x5e, 0x24, 0xf8, 0x53, 0xae, 0xff, 0x00, 0x69, +0x78, 0x63, 0x5c, 0xd4, 0xfc, 0x3f, 0xa8, 0x77, 0xb9, 0xd3, 0x2e, 0xe4, 0xb7, 0x2d, 0xec, 0x76, +0x75, 0x1d, 0x78, 0x3c, 0x72, 0x6b, 0xe3, 0x73, 0x2f, 0x0a, 0x70, 0xd3, 0x5c, 0xd8, 0x2a, 0xce, +0x2f, 0xb4, 0xac, 0xd7, 0xde, 0xac, 0xd7, 0xe2, 0x7e, 0x93, 0x93, 0x7d, 0x20, 0x31, 0x94, 0xda, +0x8e, 0x69, 0x87, 0x8c, 0xd7, 0x78, 0x37, 0x17, 0xf7, 0x3b, 0xa7, 0xf7, 0xc5, 0x1f, 0xd0, 0xce, +0x68, 0xaf, 0xc9, 0xcf, 0x80, 0xdf, 0xf0, 0x5b, 0x3f, 0x88, 0x5f, 0x0f, 0xfe, 0xcf, 0x67, 0xe3, +0x6d, 0x3f, 0x4f, 0xf1, 0xc6, 0x9a, 0x3e, 0x53, 0x74, 0x80, 0x58, 0x6a, 0x0a, 0x3a, 0x7d, 0xf4, +0x06, 0x37, 0xc6, 0x3a, 0x32, 0x06, 0x63, 0xd5, 0xb9, 0xcd, 0x7d, 0xdd, 0xfb, 0x38, 0x7f, 0xc1, +0x43, 0xbe, 0x17, 0x7e, 0xd3, 0xef, 0x0d, 0xae, 0x85, 0xaf, 0x0d, 0x3f, 0x5d, 0xb8, 0x1c, 0x68, +0xfa, 0xaa, 0x8b, 0x5b, 0xc2, 0x7a, 0x61, 0x32, 0x4a, 0x4b, 0xff, 0x00, 0x6c, 0xd9, 0xbd, 0xeb, +0xf3, 0x8c, 0xe3, 0x84, 0x73, 0x4c, 0xb6, 0xf3, 0xaf, 0x4e, 0xf0, 0xfe, 0x68, 0xea, 0xbe, 0x7d, +0x57, 0xcd, 0x23, 0xf6, 0x9e, 0x1b, 0xf1, 0x13, 0x21, 0xce, 0x9a, 0xa7, 0x85, 0xac, 0xa3, 0x51, +0xfd, 0x89, 0xfb, 0xb2, 0xf9, 0x5f, 0x49, 0x7f, 0xdb, 0xad, 0x9e, 0xeb, 0x45, 0x14, 0x66, 0xbe, +0x68, 0xfb, 0x80, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x66, 0xb0, 0x7e, +0x20, 0x78, 0xff, 0x00, 0x45, 0xf8, 0x55, 0xe1, 0x0b, 0xef, 0x10, 0xf8, 0x8b, 0x54, 0xb1, 0xd1, +0x74, 0x3d, 0x2e, 0x2f, 0x3a, 0xf2, 0xf6, 0xf2, 0x51, 0x14, 0x30, 0x2e, 0x40, 0x19, 0x63, 0xea, +0x48, 0x00, 0x75, 0x24, 0x80, 0x01, 0x24, 0x02, 0x6a, 0xda, 0x8c, 0x55, 0xdb, 0x06, 0xd2, 0x57, +0x7b, 0x1b, 0xd9, 0xaf, 0x99, 0x3f, 0x6d, 0x8f, 0xf8, 0x2a, 0x87, 0xc3, 0x3f, 0xd8, 0xae, 0x0b, +0x8d, 0x3b, 0x50, 0xbc, 0x6f, 0x13, 0x78, 0xd4, 0x46, 0x0c, 0x7e, 0x1d, 0xd2, 0xe4, 0x56, 0x9a, +0x22, 0x46, 0x41, 0xb9, 0x93, 0x94, 0xb7, 0x5e, 0x41, 0xf9, 0xb2, 0xe4, 0x1c, 0xac, 0x6e, 0x2b, +0xe1, 0x3f, 0xdb, 0xef, 0xfe, 0x0b, 0xa7, 0xaf, 0x7c, 0x52, 0x92, 0xf3, 0xc2, 0x9f, 0x06, 0x64, +0xd4, 0x3c, 0x2d, 0xe1, 0xd3, 0xba, 0x39, 0x7c, 0x46, 0x54, 0xc5, 0xab, 0x6a, 0x4b, 0xd3, 0xfd, +0x1c, 0x75, 0xb5, 0x8c, 0xf3, 0x86, 0x3f, 0xbe, 0x3f, 0x29, 0xfd, 0xd1, 0x0c, 0xa7, 0xf3, 0xd2, +0x79, 0x64, 0xbc, 0xba, 0x69, 0xa6, 0x66, 0x91, 0xe4, 0x62, 0xee, 0xec, 0x4b, 0x33, 0xb1, 0x24, +0x92, 0x4f, 0x52, 0x49, 0xe4, 0x93, 0xde, 0xbf, 0x49, 0xc8, 0x3c, 0x3f, 0xa9, 0x59, 0x2a, 0xf9, +0x97, 0xbb, 0x1d, 0xf9, 0x56, 0xef, 0xd5, 0xf4, 0xf4, 0xdf, 0xd0, 0xfc, 0xbf, 0x88, 0xbc, 0x46, +0xa5, 0x41, 0xba, 0x19, 0x67, 0xbf, 0x2d, 0xb9, 0x9f, 0xc2, 0xbd, 0x3b, 0xfa, 0xed, 0xea, 0x7d, +0x17, 0xfb, 0x60, 0x7f, 0xc1, 0x52, 0xfe, 0x2c, 0x7e, 0xd8, 0xe6, 0xef, 0x4f, 0xd4, 0xb5, 0x66, +0xf0, 0xef, 0x83, 0xe6, 0xca, 0x7f, 0xc2, 0x3f, 0xa2, 0x48, 0xd6, 0xf6, 0xd2, 0x21, 0xed, 0x70, +0xf9, 0xf3, 0x6e, 0x38, 0xc6, 0x44, 0x87, 0xcb, 0x24, 0x64, 0x46, 0x95, 0xf3, 0x8a, 0xa8, 0x55, +0xc0, 0x1c, 0x52, 0xd1, 0x5f, 0xac, 0x60, 0xf0, 0x38, 0x7c, 0x25, 0x3f, 0x65, 0x86, 0x82, 0x8c, +0x7c, 0xbf, 0x5e, 0xef, 0xcc, 0xfc, 0x7f, 0x1d, 0x98, 0x62, 0x71, 0x95, 0x3d, 0xb6, 0x2a, 0x6e, +0x52, 0xf3, 0xfd, 0x3b, 0x2f, 0x20, 0xa3, 0x34, 0x51, 0x5d, 0x67, 0x18, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0xfb, 0x5b, 0xb9, 0x2c, 0x2e, 0x16, 0x6b, 0x79, 0x26, 0x8e, 0xe1, 0x06, +0x04, 0xb1, 0x39, 0x56, 0xfa, 0x71, 0xdb, 0xd8, 0xf1, 0x5d, 0x7f, 0x87, 0xfe, 0x27, 0x2b, 0xba, +0x47, 0xaa, 0x2a, 0x46, 0xcd, 0xc0, 0x9e, 0x24, 0xc2, 0xff, 0x00, 0xdb, 0x44, 0x1d, 0x3e, 0xaa, +0x31, 0xfe, 0xc8, 0x1c, 0xd7, 0x1b, 0x41, 0xaa, 0xa7, 0x37, 0x07, 0x78, 0x9c, 0x18, 0xec, 0xb6, +0x86, 0x2e, 0x3c, 0xb5, 0x96, 0xbd, 0x1f, 0x55, 0xf3, 0xff, 0x00, 0x33, 0xd7, 0xd4, 0xf9, 0x8c, +0xbf, 0x32, 0xc9, 0x1b, 0x80, 0xca, 0xca, 0xc1, 0x95, 0x81, 0xee, 0x08, 0xe0, 0x8f, 0x7a, 0x5a, +0xf3, 0x6f, 0x09, 0xf8, 0xc2, 0x6f, 0x0b, 0xc8, 0xb1, 0xb7, 0x99, 0x2d, 0xac, 0x84, 0x97, 0x83, +0x39, 0x68, 0xb3, 0xd5, 0xa3, 0xcf, 0x4e, 0xb9, 0x2b, 0xd1, 0xbd, 0xba, 0xd7, 0xa2, 0xd9, 0x5f, +0x47, 0xa9, 0x5b, 0x89, 0xa1, 0x29, 0x3c, 0x77, 0x0b, 0xba, 0x39, 0x17, 0xf8, 0x87, 0x4f, 0xc0, +0x8c, 0x74, 0xea, 0x0e, 0x45, 0x7a, 0x54, 0x6b, 0x29, 0xaf, 0x33, 0xf3, 0x7c, 0xd3, 0x28, 0xab, +0x82, 0x9d, 0xa5, 0xac, 0x5e, 0xcf, 0xf4, 0x7d, 0x9f, 0x91, 0x25, 0x14, 0x51, 0x5d, 0x07, 0x94, +0x14, 0x51, 0x45, 0x00, 0x14, 0x84, 0x64, 0xfa, 0x7d, 0x0e, 0x29, 0x68, 0xa0, 0x0f, 0xa9, 0x3f, +0x65, 0x9f, 0xf8, 0x2b, 0x1f, 0xc4, 0x8f, 0xd9, 0xed, 0xad, 0xf4, 0xdd, 0x6a, 0xe1, 0xbc, 0x75, +0xe1, 0x75, 0xc2, 0xfd, 0x97, 0x53, 0xba, 0xff, 0x00, 0x4a, 0xb5, 0x51, 0xda, 0x2b, 0x92, 0x0b, +0x71, 0xfd, 0xd9, 0x37, 0xae, 0x3e, 0xe8, 0x5a, 0xfd, 0x30, 0xfd, 0x98, 0xbf, 0x6d, 0x8f, 0x87, +0xff, 0x00, 0xb5, 0xb6, 0x90, 0x65, 0xf0, 0xae, 0xac, 0x06, 0xa9, 0x6e, 0x9b, 0xee, 0xf4, 0x8b, +0xcc, 0x43, 0x7f, 0x6b, 0xee, 0x63, 0xcf, 0xce, 0x9c, 0xfd, 0xf4, 0x2c, 0xbd, 0x89, 0x07, 0x81, +0xf8, 0x57, 0x57, 0xbc, 0x3f, 0xe2, 0x3d, 0x43, 0xc2, 0x7a, 0xe5, 0xb6, 0xa9, 0xa5, 0xdf, 0x5f, +0x69, 0xba, 0x85, 0x9b, 0x07, 0xb6, 0xba, 0xb5, 0xb9, 0x36, 0xf3, 0xdb, 0x11, 0xd0, 0xc7, 0x20, +0x20, 0x8f, 0xa8, 0xe6, 0xbf, 0x3f, 0xe2, 0x2f, 0x0f, 0xf0, 0x19, 0x82, 0x75, 0x70, 0xeb, 0xd9, +0x54, 0xee, 0x96, 0x8f, 0xd5, 0x7e, 0xaa, 0xcf, 0xbd, 0xcf, 0xd7, 0x78, 0x3b, 0xc5, 0xfc, 0xdb, +0x28, 0x6a, 0x86, 0x31, 0xba, 0xf4, 0x7b, 0x49, 0xfb, 0xd1, 0x5f, 0xdd, 0x96, 0xff, 0x00, 0x29, +0x5f, 0xb2, 0xb2, 0xd4, 0xfe, 0x89, 0xb3, 0x45, 0x7e, 0x76, 0xfe, 0xc2, 0x7f, 0xf0, 0x58, 0x95, +0xd6, 0xee, 0x2c, 0xbc, 0x23, 0xf1, 0x7a, 0x48, 0x2d, 0x2e, 0xa4, 0x3e, 0x45, 0xa7, 0x89, 0xc0, +0x09, 0x1c, 0xad, 0xc0, 0x02, 0xed, 0x40, 0xc2, 0x7f, 0xd7, 0x65, 0xc2, 0x74, 0xdc, 0x06, 0x19, +0xcf, 0xe8, 0x64, 0x13, 0x0b, 0x84, 0x0e, 0xb8, 0x65, 0x61, 0x95, 0x61, 0xdf, 0xdc, 0x1a, 0xfc, +0x33, 0x38, 0xc9, 0x71, 0x79, 0x5d, 0x7f, 0x61, 0x8b, 0x8d, 0xbb, 0x3d, 0xd3, 0x5d, 0xd3, 0xfe, +0x9a, 0xea, 0x7f, 0x55, 0xf0, 0xdf, 0x13, 0xe5, 0xd9, 0xee, 0x17, 0xeb, 0x79, 0x7c, 0xf9, 0x97, +0x54, 0xf4, 0x94, 0x5f, 0x69, 0x2e, 0x8f, 0xf0, 0x7d, 0x1b, 0x26, 0xa2, 0x8a, 0x2b, 0xca, 0x3e, +0x80, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xcd, 0x15, +0xe2, 0x3f, 0xb6, 0xf7, 0xed, 0xbb, 0xe1, 0x1f, 0xd8, 0x6f, 0xe1, 0x23, 0xf8, 0x93, 0xc4, 0x8d, +0xf6, 0xcd, 0x52, 0xf3, 0x74, 0x1a, 0x26, 0x89, 0x04, 0x81, 0x6e, 0xb5, 0x8b, 0x80, 0x3e, 0xea, +0xf5, 0xd9, 0x1a, 0xe5, 0x4c, 0x92, 0x90, 0x42, 0x06, 0x1c, 0x33, 0x32, 0x23, 0x6b, 0x42, 0x85, +0x5a, 0xf5, 0x63, 0x46, 0x8c, 0x5c, 0xa5, 0x27, 0x64, 0x91, 0x8e, 0x23, 0x11, 0x4a, 0x85, 0x29, +0x56, 0xad, 0x25, 0x18, 0xc5, 0x5d, 0xb7, 0xd0, 0xda, 0xfd, 0xab, 0x7f, 0x6b, 0x8f, 0x04, 0xfe, +0xc6, 0x7f, 0x0c, 0x26, 0xf1, 0x47, 0x8d, 0x75, 0x2f, 0xb3, 0x42, 0x77, 0x25, 0x8d, 0x8c, 0x58, +0x7b, 0xcd, 0x56, 0x60, 0x32, 0x21, 0x82, 0x3c, 0x8d, 0xcc, 0x72, 0x32, 0x49, 0x0a, 0x80, 0xe5, +0x99, 0x47, 0x35, 0xf8, 0x6b, 0xfb, 0x72, 0xff, 0x00, 0xc1, 0x42, 0x3c, 0x71, 0xfb, 0x77, 0xf8, +0xd7, 0xed, 0x1a, 0xed, 0xc3, 0x69, 0x7e, 0x16, 0xd3, 0xe5, 0x32, 0x69, 0x7e, 0x1c, 0xb4, 0x90, +0xb5, 0xa5, 0x86, 0x46, 0x03, 0xb9, 0xc0, 0x33, 0xcf, 0x8c, 0xe6, 0x56, 0x1c, 0x65, 0xb6, 0x04, +0x56, 0x20, 0xf1, 0x7f, 0xb4, 0xe7, 0xed, 0x45, 0xe3, 0x1f, 0xda, 0xfb, 0xe2, 0xc5, 0xdf, 0x8c, +0xbc, 0x67, 0x7a, 0xb7, 0x97, 0xd7, 0x23, 0xcb, 0xb3, 0xb3, 0x88, 0x15, 0xb3, 0xd3, 0x2d, 0xc1, +0xc8, 0xb7, 0x81, 0x32, 0x76, 0xc6, 0x39, 0x3c, 0x92, 0x58, 0x92, 0xcc, 0x4b, 0x12, 0x4f, 0x9e, +0x8e, 0x2b, 0xf7, 0x0e, 0x17, 0xe0, 0xfa, 0x39, 0x74, 0x55, 0x7c, 0x45, 0xa5, 0x5b, 0xbf, 0x48, +0xf9, 0x2f, 0x3f, 0x3f, 0xbb, 0x4d, 0xff, 0x00, 0x05, 0xe2, 0xce, 0x34, 0xad, 0x99, 0x49, 0xe1, +0xf0, 0xd7, 0x8d, 0x1f, 0xb9, 0xcb, 0xcd, 0xf9, 0x7f, 0x77, 0xef, 0xd7, 0x62, 0x8a, 0x28, 0xaf, +0xb7, 0x3e, 0x0c, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, +0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x2b, 0x63, 0xc1, 0x5e, 0x2c, 0xff, 0x00, 0x84, 0x72, +0xeb, 0xc9, 0x9a, 0x46, 0x6b, 0x39, 0x5b, 0xf7, 0xa3, 0xaf, 0x90, 0xdf, 0xf3, 0xd5, 0x7f, 0x21, +0xb8, 0x0e, 0xa0, 0x0e, 0xea, 0x05, 0x63, 0xd1, 0xd2, 0x9c, 0x64, 0xd3, 0xba, 0x39, 0xf1, 0x58, +0x5a, 0x78, 0x8a, 0x4e, 0x95, 0x55, 0x74, 0xff, 0x00, 0xad, 0x3c, 0xcf, 0x5e, 0x47, 0x0e, 0x37, +0x29, 0x0c, 0xad, 0xc8, 0x60, 0x72, 0x18, 0x7a, 0x8a, 0x75, 0x72, 0xdf, 0x0d, 0x7c, 0x4a, 0xd7, +0x96, 0xd2, 0x69, 0xf2, 0x49, 0xb9, 0xad, 0xe3, 0xdf, 0x6c, 0x58, 0xfd, 0xe8, 0x7b, 0xa6, 0x7f, +0xd9, 0x24, 0x63, 0xd9, 0xb1, 0xd1, 0x6b, 0xa9, 0xaf, 0x5e, 0x95, 0x45, 0x38, 0xf3, 0x23, 0xf2, +0x7c, 0x76, 0x0e, 0x78, 0x5a, 0xf2, 0xa1, 0x3e, 0x9f, 0x8a, 0xe8, 0xc2, 0x8a, 0x28, 0xad, 0x0e, +0x30, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x51, 0x40, 0x06, 0x33, 0x5f, 0x73, 0x7f, 0xc1, 0x2f, +0xbf, 0xe0, 0xa5, 0x37, 0x1f, 0x0b, 0x75, 0x3d, 0x3f, 0xe1, 0xcf, 0xc4, 0x0d, 0x41, 0xee, 0x3c, +0x2f, 0x70, 0x45, 0xbe, 0x91, 0xaa, 0x4e, 0x79, 0xd1, 0x5b, 0xb4, 0x32, 0xb1, 0xff, 0x00, 0x97, +0x73, 0xd0, 0x1f, 0xf9, 0x65, 0xc7, 0xf0, 0x67, 0x67, 0xc3, 0x34, 0x11, 0x91, 0x5e, 0x3e, 0x77, +0x92, 0xe1, 0xb3, 0x4c, 0x33, 0xc3, 0x62, 0x56, 0x9d, 0x1f, 0x54, 0xfa, 0x35, 0xfd, 0x6b, 0xb3, +0x3e, 0x8b, 0x85, 0xf8, 0x9f, 0x1b, 0x90, 0xe3, 0xa3, 0x8e, 0xc1, 0x4b, 0x55, 0xf1, 0x47, 0xa4, +0xa3, 0xd6, 0x2d, 0x7e, 0x4f, 0x74, 0xf5, 0x47, 0xf4, 0x69, 0x9a, 0x2b, 0xe1, 0xef, 0xf8, 0x23, +0xc7, 0xed, 0xad, 0x27, 0xc6, 0x4f, 0x00, 0x3f, 0xc3, 0xaf, 0x12, 0x5e, 0x7d, 0xa3, 0xc4, 0x9e, +0x17, 0xb6, 0x57, 0xd3, 0xae, 0x5d, 0xbe, 0x6b, 0xeb, 0x11, 0x80, 0x23, 0x27, 0xbc, 0x90, 0xfc, +0xaa, 0x4f, 0x52, 0x85, 0x3a, 0x95, 0x63, 0x5f, 0x70, 0xe6, 0xbf, 0x98, 0x33, 0x6c, 0xae, 0xb6, +0x5d, 0x8b, 0x9e, 0x0e, 0xbf, 0xc5, 0x17, 0xf2, 0x6b, 0xa3, 0x5e, 0x4d, 0x1f, 0xdd, 0x9c, 0x3f, +0x9e, 0xe1, 0xb3, 0x8c, 0xbe, 0x9e, 0x63, 0x84, 0x7e, 0xec, 0xd6, 0xdd, 0x53, 0xea, 0x9f, 0x9a, +0x7a, 0x05, 0x14, 0x51, 0x5e, 0x71, 0xed, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x56, 0x0f, 0xc4, +0x0f, 0x1f, 0xe8, 0xff, 0x00, 0x0a, 0xfc, 0x13, 0xa9, 0xf8, 0x93, 0xc4, 0x1a, 0x84, 0x3a, 0x5e, +0x87, 0xa2, 0xda, 0xbd, 0xe5, 0xf5, 0xe4, 0xc7, 0x09, 0x04, 0x48, 0x32, 0xcc, 0x71, 0x92, 0x7a, +0x70, 0x00, 0x24, 0x92, 0x00, 0x04, 0x90, 0x28, 0xd5, 0xb4, 0x92, 0xbb, 0x14, 0xa4, 0x92, 0xbc, +0xb6, 0x38, 0x8f, 0xda, 0xef, 0xf6, 0xae, 0xf0, 0xbf, 0xec, 0x65, 0xf0, 0x4b, 0x52, 0xf1, 0xa7, +0x8a, 0x26, 0xcc, 0x56, 0xff, 0x00, 0xba, 0xb1, 0xb1, 0x47, 0x02, 0xe3, 0x55, 0xba, 0x60, 0x4c, +0x76, 0xf1, 0x03, 0xd5, 0x9b, 0x04, 0x96, 0xc1, 0x08, 0xaa, 0xcc, 0x78, 0x53, 0x5f, 0x80, 0x5f, +0xb5, 0x17, 0xed, 0x37, 0xe2, 0xcf, 0xda, 0xf3, 0xe3, 0x15, 0xef, 0x8d, 0x3c, 0x63, 0x74, 0xb7, +0x57, 0xd7, 0x80, 0x45, 0x67, 0x67, 0x18, 0x22, 0xd7, 0x4d, 0xb6, 0x04, 0x94, 0xb6, 0x80, 0x76, +0x8c, 0x64, 0x9f, 0x56, 0x25, 0x9d, 0x89, 0x62, 0x49, 0xed, 0x3f, 0xe0, 0xa0, 0xff, 0x00, 0xb7, +0x2e, 0xb5, 0xfb, 0x76, 0xfc, 0x72, 0x9f, 0x5e, 0xba, 0xfb, 0x45, 0x87, 0x85, 0xf4, 0xc2, 0xf6, +0x9e, 0x1d, 0xd2, 0xe4, 0x61, 0xfe, 0x81, 0x6c, 0x48, 0xcb, 0xb0, 0x1c, 0x79, 0xf2, 0xe1, 0x5a, +0x42, 0x09, 0xe8, 0xa9, 0x92, 0xb1, 0x83, 0x5e, 0x13, 0x5f, 0xba, 0xf0, 0x7f, 0x0b, 0xc7, 0x2e, +0xa3, 0xf5, 0x8a, 0xeb, 0xf7, 0xd2, 0x5a, 0xff, 0x00, 0x75, 0x3e, 0x8b, 0xcf, 0xbf, 0xdd, 0xb6, +0xff, 0x00, 0x80, 0x71, 0xa7, 0x16, 0x4b, 0x32, 0xad, 0xf5, 0x6c, 0x3b, 0xfd, 0xcc, 0x5f, 0xfe, +0x04, 0xd7, 0x57, 0xe5, 0xfc, 0xbf, 0x7e, 0xfb, 0x14, 0x51, 0x45, 0x7d, 0xb9, 0xf0, 0x61, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x04, 0xda, 0x5e, 0xa2, 0xda, 0x26, +0xa5, 0x6f, 0x75, 0x1f, 0xcd, 0x24, 0x52, 0x79, 0x9b, 0x73, 0x8f, 0x31, 0x7a, 0x32, 0xff, 0x00, +0xc0, 0x94, 0x95, 0xfc, 0x6b, 0xd6, 0x45, 0xc2, 0xcc, 0x9e, 0x64, 0x6d, 0xbe, 0x19, 0xd1, 0x65, +0x8d, 0xbf, 0xbc, 0xac, 0x03, 0x29, 0xfc, 0x41, 0x06, 0xbc, 0x82, 0xbd, 0x0b, 0xe1, 0xd6, 0xa3, +0xfd, 0xa1, 0xe1, 0x78, 0x63, 0x6f, 0xf5, 0x96, 0x72, 0xb5, 0xb1, 0xcf, 0x52, 0xbf, 0x7d, 0x0f, +0xe4, 0xdb, 0x47, 0xfb, 0xbf, 0x89, 0xea, 0xc2, 0x4a, 0xd2, 0xe5, 0x3e, 0x47, 0x8b, 0x70, 0x8a, +0x54, 0x63, 0x88, 0x8e, 0xf1, 0x76, 0xf9, 0x3f, 0xf8, 0x3f, 0x99, 0xbd, 0x45, 0x14, 0x57, 0xa4, +0x7c, 0x08, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xd5, 0x7c, +0x11, 0xf8, 0xc5, 0xa9, 0x7c, 0x03, 0xf8, 0xbb, 0xe1, 0xdf, 0x18, 0xe8, 0xb9, 0xfe, 0xd0, 0xd0, +0x6f, 0x05, 0xd6, 0x01, 0xc0, 0xba, 0x5e, 0x92, 0xc2, 0x4f, 0xf7, 0x24, 0x42, 0xe8, 0xc4, 0x7f, +0x0c, 0x86, 0xbf, 0x7a, 0xbe, 0x1e, 0xf8, 0xff, 0x00, 0x4d, 0xf8, 0xa1, 0xe0, 0x4d, 0x1f, 0xc4, +0x9a, 0x44, 0xbf, 0x68, 0xd2, 0xf5, 0xdb, 0x38, 0xaf, 0x6d, 0x64, 0xc7, 0x25, 0x24, 0x50, 0xc0, +0x1f, 0x42, 0x33, 0x82, 0x3b, 0x10, 0x6b, 0xf9, 0xeb, 0xaf, 0xd5, 0xbf, 0xf8, 0x22, 0x07, 0xc6, +0x96, 0xf1, 0xc7, 0xec, 0xdd, 0xab, 0x78, 0x46, 0xea, 0x4d, 0xd7, 0x3e, 0x07, 0xd4, 0x4a, 0xdb, +0x8f, 0xee, 0xd9, 0xdd, 0x6e, 0x96, 0x3f, 0xfc, 0x8a, 0xb7, 0x18, 0xf6, 0xc0, 0xed, 0x5f, 0x93, +0xf8, 0xa5, 0x93, 0xaa, 0x98, 0x58, 0x66, 0x30, 0x5e, 0xf4, 0x1d, 0x9f, 0xf8, 0x5e, 0xdf, 0x73, +0xfc, 0xcf, 0xe8, 0x0f, 0x01, 0xb8, 0x8e, 0x54, 0x71, 0xf5, 0x72, 0x6a, 0xaf, 0xdd, 0xaa, 0xb9, +0xa3, 0xe5, 0x28, 0xad, 0x6d, 0xeb, 0x1d, 0x5f, 0xf8, 0x4f, 0xb6, 0x68, 0xa2, 0x8a, 0xfc, 0x3c, +0xfe, 0xa8, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfc, 0x77, 0xff, 0x00, 0x82, 0xe8, 0xfe, 0xdf, 0xad, +0xf1, 0x53, 0xc7, 0xcf, 0xf0, 0x6f, 0xc2, 0xb7, 0xdb, 0xbc, 0x37, 0xe1, 0x5b, 0xb0, 0x7c, 0x47, +0x24, 0x6d, 0xf2, 0xea, 0x5a, 0x92, 0x1e, 0x2d, 0xce, 0x3a, 0xc5, 0x6e, 0x7a, 0x8e, 0x86, 0x6c, +0xf0, 0x0c, 0x2a, 0x4f, 0xdd, 0x5f, 0xf0, 0x55, 0x7f, 0xdb, 0x61, 0x7f, 0x62, 0xdf, 0xd9, 0x92, +0xea, 0xfb, 0x4b, 0xb8, 0x8d, 0x7c, 0x6d, 0xe2, 0x72, 0xfa, 0x5f, 0x87, 0xa3, 0xc8, 0x2d, 0x14, +0x85, 0x47, 0x9b, 0x75, 0x83, 0xd4, 0x42, 0x87, 0x70, 0xc8, 0x20, 0xc8, 0xd1, 0x29, 0x18, 0x6a, +0xfc, 0x09, 0x96, 0x59, 0x2e, 0x6e, 0x1a, 0x59, 0x99, 0xdd, 0x99, 0x8b, 0x33, 0x3b, 0x6e, 0x67, +0x27, 0x92, 0x49, 0x3c, 0x92, 0x7a, 0x92, 0x79, 0xaf, 0xd2, 0xbc, 0x3f, 0xc8, 0x15, 0x6a, 0x9f, +0xda, 0x55, 0xd7, 0xbb, 0x1d, 0x23, 0xe6, 0xfa, 0xbf, 0x96, 0xcb, 0xcf, 0xd0, 0xfc, 0xbb, 0xc4, +0x6e, 0x22, 0x74, 0x29, 0x2c, 0xb3, 0x0e, 0xfd, 0xe9, 0xeb, 0x2b, 0x74, 0x8f, 0x45, 0xf3, 0xeb, +0xe5, 0xe4, 0xc2, 0x8a, 0x28, 0xaf, 0xd8, 0x8f, 0xc5, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0xba, 0xaf, 0x84, 0xd7, 0x3b, 0x2e, +0xef, 0xad, 0xf3, 0xc4, 0xd0, 0x47, 0x71, 0x8c, 0x7f, 0x71, 0xb6, 0xf5, 0xed, 0x9f, 0x30, 0x7d, +0x78, 0xf4, 0xae, 0x56, 0xba, 0x0f, 0x85, 0xe1, 0x93, 0xc4, 0xfb, 0x54, 0xed, 0x59, 0x22, 0x95, +0x5b, 0xdc, 0x65, 0x4f, 0xe8, 0x40, 0x3f, 0x85, 0x69, 0x49, 0xda, 0x68, 0xf2, 0xb3, 0xba, 0x7c, +0xf8, 0x1a, 0x8b, 0xca, 0xff, 0x00, 0x75, 0x8f, 0x40, 0xa2, 0x8a, 0x2b, 0xd8, 0x3f, 0x28, 0x0a, +0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfb, 0x2b, 0xfe, 0x08, +0x87, 0xe3, 0xb9, 0x3c, 0x39, 0xfb, 0x58, 0xea, 0x3a, 0x2c, 0x84, 0xfd, 0x9f, 0xc4, 0x9a, 0x04, +0xf1, 0x05, 0xcf, 0xfc, 0xb7, 0x86, 0x48, 0xe5, 0x53, 0xff, 0x00, 0x7c, 0x09, 0x46, 0x3d, 0xfd, +0xab, 0xe3, 0x5a, 0xf7, 0xff, 0x00, 0xf8, 0x25, 0xbe, 0xad, 0xfd, 0x8b, 0xfb, 0x7b, 0xfc, 0x3b, +0x98, 0x8e, 0x3e, 0xd1, 0x73, 0x6c, 0x47, 0xfd, 0x74, 0xb3, 0xb8, 0x8f, 0xff, 0x00, 0x67, 0xaf, +0x9e, 0xe2, 0xcc, 0x3a, 0xad, 0x93, 0xe2, 0x20, 0xff, 0x00, 0x92, 0x4f, 0xe6, 0x95, 0xd7, 0xe2, +0x8f, 0xb1, 0xf0, 0xfb, 0x19, 0x2c, 0x37, 0x12, 0x60, 0xaa, 0xc7, 0xfe, 0x7e, 0x46, 0x3f, 0x29, +0x3e, 0x57, 0xf8, 0x36, 0x7e, 0xda, 0xd1, 0x45, 0x15, 0xfc, 0xb0, 0x7f, 0x7b, 0x85, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x35, 0x9f, +0x69, 0x1f, 0xe7, 0x14, 0xea, 0xf9, 0x1f, 0xfe, 0x0b, 0x31, 0xfb, 0x54, 0xc9, 0xfb, 0x33, 0xfe, +0xc6, 0x5a, 0xa5, 0xae, 0x9d, 0x70, 0x21, 0xf1, 0x27, 0x8f, 0x18, 0xf8, 0x7b, 0x4e, 0x2a, 0xdf, +0x3c, 0x31, 0x48, 0xa7, 0xed, 0x33, 0x0e, 0xe3, 0x6c, 0x3b, 0x90, 0x30, 0xfb, 0xb2, 0x4b, 0x19, +0xae, 0xac, 0x16, 0x12, 0xa6, 0x2b, 0x11, 0x0c, 0x35, 0x2f, 0x8a, 0x4d, 0x2f, 0xf8, 0x3f, 0x23, +0x97, 0x1d, 0x8c, 0xa7, 0x84, 0xc3, 0xcf, 0x13, 0x57, 0xe1, 0x82, 0x6d, 0xfc, 0x8f, 0xca, 0xbf, +0xf8, 0x2a, 0x27, 0xed, 0x84, 0xdf, 0xb6, 0x57, 0xed, 0x61, 0xab, 0xea, 0xd6, 0x37, 0x5e, 0x6f, +0x83, 0xbc, 0x3e, 0x4e, 0x8b, 0xe1, 0xe0, 0xad, 0x94, 0x7b, 0x78, 0xd8, 0x96, 0xb9, 0x03, 0xd6, +0x79, 0x73, 0x26, 0x70, 0x0f, 0x97, 0xe5, 0x29, 0xfb, 0x95, 0xf3, 0xbd, 0x00, 0x6d, 0x18, 0xf4, +0xa2, 0xbf, 0xa6, 0x30, 0x38, 0x3a, 0x78, 0x4c, 0x3c, 0x30, 0xd4, 0x97, 0xbb, 0x14, 0x92, 0xff, +0x00, 0x3f, 0x57, 0xd4, 0xfe, 0x59, 0xcc, 0x31, 0xb5, 0x71, 0x98, 0x99, 0xe2, 0xab, 0x3b, 0xca, +0x4e, 0xff, 0x00, 0xf0, 0x3d, 0x17, 0x40, 0xa2, 0x8a, 0x2b, 0xa8, 0xe3, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xe8, 0x3e, 0x18, +0x92, 0xbe, 0x2b, 0x53, 0x8c, 0xe2, 0x39, 0x73, 0xed, 0xf7, 0x6b, 0x9f, 0xae, 0xa3, 0xe1, 0x4d, +0xbb, 0x3e, 0xa9, 0x75, 0x30, 0x56, 0x2b, 0x0c, 0x6b, 0x09, 0xf4, 0xcc, 0x8e, 0x18, 0x7e, 0x3f, +0xba, 0x3f, 0xad, 0x69, 0x49, 0x5e, 0x68, 0xf2, 0xf3, 0xa9, 0xa8, 0xe0, 0xaa, 0xb7, 0xda, 0xdf, +0x7d, 0x8e, 0xe0, 0x70, 0x28, 0xa3, 0xa5, 0x15, 0xec, 0x1f, 0x93, 0x85, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x7b, 0xdf, 0xfc, 0x13, 0x03, 0x4b, 0x7d, 0x5b, +0xf6, 0xf7, 0xf8, 0x75, 0x0a, 0x36, 0x3f, 0xd2, 0xae, 0x2e, 0x0f, 0xd2, 0x3b, 0x49, 0xa4, 0x3f, +0xa4, 0x66, 0xbc, 0x12, 0xbe, 0xbb, 0xff, 0x00, 0x82, 0x28, 0xf8, 0x15, 0xbc, 0x51, 0xfb, 0x64, +0x36, 0xa8, 0xd0, 0xaf, 0xd9, 0xfc, 0x33, 0xa1, 0x5d, 0x5d, 0x06, 0x20, 0xf0, 0xf2, 0x98, 0xed, +0xc0, 0xcf, 0xa9, 0x12, 0x48, 0x7f, 0x06, 0xaf, 0x03, 0x8a, 0xab, 0xaa, 0x39, 0x46, 0x26, 0xa3, +0xfe, 0x49, 0x2f, 0x9b, 0x56, 0x5f, 0x8b, 0x3e, 0xbb, 0x80, 0x70, 0xb2, 0xc4, 0x71, 0x1e, 0x0a, +0x94, 0x7f, 0xe7, 0xe4, 0x1f, 0xca, 0x2f, 0x99, 0xfe, 0x09, 0x9f, 0xaf, 0x34, 0x51, 0x45, 0x7f, +0x2b, 0x1f, 0xdf, 0x41, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x9a, 0xfc, 0x35, 0xff, 0x00, 0x82, 0xe6, 0xfe, 0xd1, 0xbf, 0xf0, 0xbb, +0x3f, 0x6d, 0x4b, 0x9f, 0x0e, 0xd9, 0xdd, 0x79, 0x9a, 0x1f, 0xc3, 0x5b, 0x3f, 0xec, 0x68, 0xc2, +0x9c, 0xa1, 0xbb, 0x7d, 0xb2, 0xde, 0x38, 0xff, 0x00, 0x6b, 0x3e, 0x5c, 0x27, 0xde, 0xdb, 0xf1, +0xaf, 0xd9, 0xcf, 0x8d, 0xff, 0x00, 0x14, 0xac, 0x7e, 0x07, 0x7c, 0x21, 0xf1, 0x47, 0x8c, 0xb5, +0x2f, 0x9a, 0xc7, 0xc2, 0xba, 0x55, 0xce, 0xa9, 0x2a, 0x64, 0x29, 0x90, 0x43, 0x11, 0x7f, 0x2c, +0x1f, 0xef, 0x31, 0x1b, 0x40, 0xee, 0x58, 0x77, 0xc5, 0x7f, 0x34, 0x7e, 0x26, 0xf1, 0x1e, 0xa1, +0xe3, 0x4f, 0x13, 0x6a, 0x5a, 0xd6, 0xad, 0x72, 0x6f, 0x35, 0x7d, 0x6a, 0xf2, 0x7b, 0xfb, 0xe9, +0x4f, 0x59, 0x6e, 0x26, 0x62, 0xee, 0xc7, 0xea, 0xcc, 0x4f, 0xe3, 0x5f, 0xa3, 0x78, 0x73, 0x97, +0xaa, 0xb8, 0x99, 0xe3, 0x25, 0xb4, 0x15, 0x97, 0xab, 0xff, 0x00, 0x24, 0xad, 0xf3, 0x3f, 0x31, +0xf1, 0x3b, 0x34, 0x74, 0xb0, 0x94, 0xf0, 0x50, 0xde, 0xa3, 0xbb, 0xff, 0x00, 0x0c, 0x7f, 0xcd, +0xb4, 0xfe, 0x4c, 0xab, 0x45, 0x14, 0x57, 0xec, 0xc7, 0xe2, 0x21, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0xd6, +0xbb, 0xcf, 0x86, 0x36, 0x1f, 0x67, 0xd0, 0x24, 0x99, 0x97, 0xe6, 0xbc, 0x9c, 0xb8, 0x38, 0xea, +0x89, 0xf2, 0x0f, 0xfc, 0x78, 0x3f, 0xf9, 0xcd, 0x70, 0xd6, 0x96, 0xb2, 0x5f, 0x5c, 0xc7, 0x6f, +0x0a, 0x6e, 0xb8, 0x92, 0x45, 0x8a, 0x31, 0xee, 0xc7, 0x03, 0x3f, 0xd6, 0xbd, 0x62, 0xc6, 0xc5, +0x74, 0xdb, 0x38, 0x6d, 0xe2, 0xe6, 0x18, 0xe2, 0x58, 0x50, 0x90, 0x01, 0x60, 0xa3, 0x19, 0x3e, +0xe7, 0xad, 0x74, 0xe1, 0x63, 0x79, 0xf3, 0x76, 0x3e, 0x4f, 0x8b, 0x31, 0x4a, 0x18, 0x78, 0xd0, +0x5b, 0xc9, 0xdf, 0xe4, 0xbf, 0xe0, 0xe8, 0x4b, 0x45, 0x14, 0x57, 0xa6, 0x7e, 0x7e, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x04, 0xe2, 0xbf, 0x52, 0x3f, 0xe0, +0x86, 0x3f, 0x05, 0xe4, 0xf0, 0xb7, 0xc1, 0x1f, 0x11, 0xf8, 0xe2, 0xea, 0x1f, 0x2e, 0xe3, 0xc5, +0xb7, 0xeb, 0x6b, 0x68, 0x4a, 0xfd, 0xfb, 0x6b, 0x60, 0xc0, 0xba, 0x9f, 0xf6, 0xa5, 0x92, 0x45, +0x3e, 0xf0, 0x8a, 0xfc, 0xd7, 0xf8, 0x59, 0xf0, 0xd7, 0x54, 0xf8, 0xc5, 0xf1, 0x1f, 0x43, 0xf0, +0xa6, 0x89, 0x07, 0xda, 0x75, 0x2d, 0x7a, 0xee, 0x3b, 0x4b, 0x70, 0x7f, 0x87, 0x7f, 0x56, 0x3e, +0x91, 0xa0, 0xcb, 0xb1, 0xec, 0xa2, 0xbf, 0x7a, 0x3e, 0x10, 0xfc, 0x2f, 0xd3, 0x7e, 0x0b, 0x7c, +0x2e, 0xd0, 0x3c, 0x27, 0xa4, 0xff, 0x00, 0xc8, 0x3b, 0xc3, 0xf6, 0x51, 0x59, 0xc4, 0xc5, 0x70, +0xd2, 0xed, 0x18, 0x69, 0x1b, 0x1f, 0xc4, 0xed, 0x97, 0x3e, 0xec, 0x6b, 0xf2, 0xbf, 0x14, 0x33, +0x85, 0x4b, 0x07, 0x1c, 0xbe, 0x0f, 0xde, 0xa8, 0xee, 0xff, 0x00, 0xc2, 0xbf, 0xcd, 0xdb, 0xee, +0x67, 0xef, 0x9e, 0x03, 0xf0, 0xec, 0xab, 0xe6, 0x55, 0x33, 0x8a, 0x8b, 0xdc, 0xa4, 0x9c, 0x63, +0xe7, 0x39, 0x6f, 0x6f, 0x48, 0xdf, 0xff, 0x00, 0x02, 0x47, 0x59, 0x45, 0x14, 0x57, 0xe1, 0x67, +0xf5, 0x60, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x01, 0xf1, 0x0f, 0xfc, 0x17, 0xc3, 0xe3, 0x01, 0xf8, 0x71, 0xfb, 0x0d, 0xb6, 0x83, 0x6f, +0x37, 0x97, 0x75, 0xe3, 0xcd, 0x6a, 0xd7, 0x4c, 0x60, 0xa7, 0x0c, 0x2d, 0xe2, 0x26, 0xea, 0x53, +0xfe, 0xe9, 0x30, 0x47, 0x19, 0xf5, 0xf3, 0x71, 0xd0, 0x9a, 0xfc, 0x49, 0xaf, 0xd1, 0xaf, 0xf8, +0x38, 0xeb, 0xe2, 0x67, 0xf6, 0xa7, 0xc7, 0x0f, 0x87, 0x3e, 0x0e, 0x47, 0x3b, 0x74, 0x3d, 0x0e, +0xe3, 0x56, 0x70, 0x3a, 0x16, 0xbc, 0x9f, 0xc9, 0x19, 0xec, 0x48, 0x16, 0x67, 0xe8, 0x1c, 0xff, +0x00, 0x7a, 0xbf, 0x39, 0x6b, 0xf7, 0xae, 0x03, 0xc1, 0xaa, 0x19, 0x44, 0x25, 0xd6, 0x6d, 0xc9, +0xfe, 0x4b, 0xf0, 0x48, 0xfe, 0x7a, 0xf1, 0x0b, 0x1a, 0xeb, 0xe7, 0x13, 0x87, 0x4a, 0x69, 0x45, +0x7d, 0xd7, 0x7f, 0x8b, 0x61, 0x45, 0x14, 0x57, 0xd9, 0x1f, 0x10, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x4e, 0xb7, 0xb7, +0x92, 0xfe, 0x78, 0xe1, 0x85, 0x77, 0x5c, 0x49, 0x2a, 0xc3, 0x18, 0xf5, 0x66, 0x38, 0x1f, 0xad, +0x02, 0x94, 0x92, 0x57, 0x67, 0x59, 0xf0, 0xbb, 0x42, 0xf3, 0x1d, 0xf5, 0x19, 0x97, 0x84, 0xdd, +0x6f, 0x16, 0x47, 0x72, 0x31, 0x23, 0xfe, 0x00, 0xed, 0x07, 0xdd, 0xbd, 0x2b, 0xb2, 0xa8, 0x6c, +0x34, 0xf8, 0xf4, 0xbd, 0x3e, 0x1b, 0x58, 0x7f, 0xd4, 0xc7, 0x1a, 0xc4, 0x87, 0x18, 0x2d, 0x8e, +0xac, 0x7d, 0xc9, 0xc9, 0x3e, 0xe4, 0xd4, 0xd5, 0xeb, 0x50, 0x87, 0x24, 0x2c, 0x7e, 0x49, 0x9a, +0x63, 0x9e, 0x2b, 0x13, 0x2a, 0xaf, 0x6e, 0x9e, 0x8b, 0x6f, 0xf3, 0xf9, 0x85, 0x14, 0x51, 0x5b, +0x1e, 0x78, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x50, 0x4e, 0x28, 0x27, 0x02, 0xbe, +0xd2, 0xff, 0x00, 0x82, 0x61, 0x7f, 0xc1, 0x38, 0x2e, 0x3e, 0x38, 0xeb, 0x96, 0x1e, 0x3f, 0xf1, +0xbe, 0x9e, 0xd6, 0xfe, 0x09, 0xd3, 0x4f, 0x99, 0x63, 0x65, 0x72, 0xbf, 0x36, 0xbd, 0x28, 0xe8, +0x48, 0xff, 0x00, 0x9f, 0x75, 0xee, 0x4f, 0x0e, 0x46, 0xde, 0x46, 0xec, 0x79, 0x39, 0xd6, 0x73, +0x87, 0xcb, 0x30, 0xd2, 0xc5, 0x62, 0x5e, 0x8b, 0x65, 0xd5, 0xbe, 0x89, 0x79, 0xbf, 0xc3, 0x76, +0x7d, 0x07, 0x0c, 0xf0, 0xde, 0x37, 0x3c, 0xc7, 0x47, 0x03, 0x82, 0x8d, 0xdb, 0xdd, 0xf4, 0x8a, +0xeb, 0x26, 0xfa, 0x25, 0xf8, 0xec, 0xb5, 0x67, 0xb6, 0x7f, 0xc1, 0x1b, 0xbf, 0x62, 0x79, 0x3e, +0x1e, 0xf8, 0x57, 0xfe, 0x16, 0xa7, 0x89, 0x6d, 0x3e, 0xcf, 0xad, 0x6b, 0xd6, 0xc1, 0x34, 0x2b, +0x57, 0x5e, 0x6d, 0x2c, 0x9c, 0x02, 0x6e, 0x08, 0x3d, 0x1e, 0x6f, 0xe1, 0x3d, 0xa3, 0xe9, 0xc3, +0xe0, 0x7d, 0xed, 0x50, 0xc5, 0x10, 0x8d, 0x36, 0xae, 0xd5, 0x55, 0x18, 0x00, 0x74, 0x15, 0x35, +0x7f, 0x2f, 0xe7, 0x19, 0xb5, 0x6c, 0xcb, 0x17, 0x3c, 0x65, 0x7d, 0xe5, 0xb2, 0xec, 0xba, 0x25, +0xe9, 0xff, 0x00, 0x04, 0xfe, 0xec, 0xe1, 0xbe, 0x1f, 0xc3, 0x64, 0xb9, 0x75, 0x3c, 0xbb, 0x0b, +0xf0, 0xc1, 0x6a, 0xfa, 0xc9, 0xbd, 0xe4, 0xfc, 0xdb, 0xfb, 0xb6, 0x5a, 0x24, 0x14, 0x51, 0x45, +0x79, 0xa7, 0xb8, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x7e, 0x07, 0xff, 0x00, 0xc1, 0x68, 0x7c, 0x70, 0xde, 0x37, 0xff, 0x00, 0x82, +0x8e, 0xf8, 0xf5, 0x56, 0x45, 0x92, 0xd7, 0x42, 0x4b, 0x1d, 0x32, 0x23, 0xed, 0x1d, 0xa4, 0x2d, +0x20, 0xfc, 0x25, 0x79, 0x47, 0xe1, 0x5f, 0x2d, 0xd7, 0xaa, 0x7e, 0xdc, 0xfe, 0x24, 0x6f, 0x16, +0xfe, 0xda, 0xdf, 0x17, 0x75, 0x06, 0x94, 0x5c, 0x6e, 0xf1, 0x86, 0xa9, 0x12, 0x91, 0xd0, 0xc3, +0x1d, 0xd4, 0xb1, 0xc7, 0x8f, 0xfb, 0x66, 0xa2, 0xbc, 0xae, 0xbf, 0xa6, 0x32, 0x5a, 0x3e, 0xc7, +0x01, 0x46, 0x92, 0xe9, 0x08, 0xfe, 0x48, 0xfe, 0x58, 0xcf, 0x2b, 0xba, 0xd9, 0x8d, 0x7a, 0xaf, +0xac, 0xe5, 0xf9, 0xb4, 0x14, 0x51, 0x45, 0x7a, 0x87, 0x94, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x15, 0xbf, 0xf0, 0xd7, 0x4d, 0x17, +0x9e, 0x22, 0xf3, 0x5c, 0x7c, 0x96, 0x70, 0x34, 0xbf, 0xf0, 0x36, 0xf9, 0x00, 0xfc, 0x8b, 0x1f, +0xf8, 0x0f, 0xe0, 0x70, 0x2b, 0xb6, 0xf8, 0x4d, 0x07, 0x97, 0xa5, 0xde, 0x4d, 0xd3, 0xed, 0x12, +0x2c, 0x39, 0xcf, 0xf7, 0x10, 0x1f, 0xfd, 0xa8, 0x6b, 0x4a, 0x31, 0xbc, 0xd2, 0x3c, 0x7c, 0xfa, +0xbf, 0xb2, 0xc0, 0xce, 0x4b, 0xae, 0x9f, 0x79, 0xd5, 0x51, 0x46, 0x68, 0xaf, 0x60, 0xfc, 0xac, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa3, 0x35, 0x6f, 0x40, 0xd0, 0x6f, 0xfc, 0x57, 0xac, 0xc1, 0xa7, +0xe9, 0x96, 0x57, 0xda, 0xa6, 0xa1, 0x74, 0x71, 0x6f, 0x6b, 0x6b, 0x6e, 0x6e, 0x26, 0x6f, 0xa2, +0x28, 0x24, 0xfe, 0x15, 0x33, 0x9a, 0x82, 0xe6, 0x93, 0xb2, 0x2e, 0x9d, 0x39, 0x54, 0x92, 0x84, +0x13, 0x6d, 0xec, 0x96, 0xad, 0x95, 0x2a, 0x6d, 0x3b, 0x4c, 0xba, 0xd6, 0xb5, 0x2b, 0x7b, 0x3b, +0x4b, 0x79, 0x2f, 0x2e, 0xaf, 0x18, 0x25, 0xb5, 0xb5, 0xb0, 0x2c, 0xce, 0xc4, 0xe0, 0x00, 0x07, +0x24, 0x9e, 0x80, 0x0e, 0x49, 0xaf, 0xac, 0x3f, 0x67, 0x8f, 0xf8, 0x23, 0xa7, 0xc5, 0x0f, 0x8b, +0xc6, 0x0b, 0xcf, 0x13, 0x2a, 0x78, 0x0b, 0x45, 0x6c, 0x36, 0x75, 0x01, 0xe6, 0x6a, 0x0c, 0x3f, +0xd9, 0xb6, 0x53, 0x91, 0xf4, 0x95, 0x90, 0xfb, 0x11, 0x5f, 0xa1, 0xdf, 0xb2, 0xe7, 0xec, 0x0f, +0xf0, 0xef, 0xf6, 0x4d, 0xb5, 0x59, 0xbc, 0x3d, 0xa6, 0xb5, 0xf6, 0xbc, 0xd1, 0xec, 0x97, 0x5d, +0xd4, 0x48, 0x9e, 0xfd, 0x81, 0x18, 0x21, 0x1b, 0x00, 0x44, 0x84, 0x1c, 0x6d, 0x8c, 0x2e, 0x46, +0x33, 0xb8, 0xf3, 0x5f, 0x05, 0x9f, 0x78, 0x85, 0x97, 0x60, 0x53, 0x85, 0x07, 0xed, 0x6a, 0x76, +0x8b, 0xd1, 0x7a, 0xcb, 0x6f, 0xba, 0xec, 0xfd, 0x67, 0x85, 0x3c, 0x1d, 0xce, 0x73, 0x49, 0x46, +0xae, 0x32, 0x2f, 0x0f, 0x4b, 0xab, 0x92, 0xf7, 0x9a, 0xf2, 0x8e, 0xff, 0x00, 0xf8, 0x15, 0x97, +0x5d, 0x76, 0x3e, 0x4b, 0xfd, 0x83, 0x3f, 0xe0, 0x8f, 0x33, 0xcf, 0x71, 0x63, 0xe2, 0xdf, 0x8b, +0xd6, 0xc2, 0x18, 0x54, 0xad, 0xc5, 0xa7, 0x85, 0xf2, 0x09, 0x98, 0xf5, 0x0d, 0x7a, 0x7a, 0x01, +0xdf, 0xc9, 0x07, 0x9c, 0xe1, 0xf1, 0xf3, 0x46, 0x7f, 0x46, 0xad, 0x6d, 0x22, 0xd3, 0xed, 0x92, +0x18, 0x63, 0x48, 0x61, 0x85, 0x42, 0x47, 0x1a, 0x2e, 0xd5, 0x45, 0x03, 0x00, 0x01, 0xd8, 0x0f, +0x4a, 0xb5, 0x45, 0x7e, 0x1b, 0x9d, 0x67, 0x98, 0xcc, 0xd6, 0xbf, 0xb7, 0xc5, 0xca, 0xfd, 0x92, +0xd9, 0x2e, 0xc9, 0x7e, 0xbb, 0xbe, 0xa7, 0xf5, 0x57, 0x0c, 0xf0, 0xb6, 0x5d, 0x90, 0xe1, 0x7e, +0xab, 0x97, 0xc2, 0xdd, 0xe4, 0xf5, 0x94, 0x9f, 0x76, 0xff, 0x00, 0x24, 0xac, 0x97, 0x44, 0x14, +0x51, 0x46, 0x6b, 0xc8, 0x3e, 0x88, 0x33, 0x45, 0x50, 0xd5, 0x35, 0x5b, 0x5d, 0x06, 0xc1, 0xae, +0xaf, 0xae, 0x6d, 0xac, 0xed, 0xe3, 0x1f, 0x3c, 0xd7, 0x12, 0x2c, 0x48, 0xbf, 0x52, 0xdc, 0x57, +0x3d, 0x0f, 0xc7, 0x7f, 0x03, 0xdc, 0x5c, 0x18, 0x63, 0xf1, 0x97, 0x84, 0xe4, 0x9c, 0x1c, 0x6c, +0x5d, 0x5e, 0xdc, 0xb7, 0xe5, 0xbf, 0x34, 0xe3, 0x09, 0xcb, 0x58, 0xc5, 0xbf, 0x91, 0x33, 0xa9, +0x4e, 0x0e, 0xd3, 0x92, 0x5e, 0xad, 0x1d, 0x85, 0x15, 0x0c, 0x52, 0x2d, 0xc4, 0x2b, 0x22, 0xed, +0x64, 0x75, 0xca, 0x90, 0x78, 0x23, 0xd6, 0xa6, 0xcd, 0x4d, 0xca, 0x0a, 0x28, 0xa2, 0x98, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x1f, 0xcc, 0x6f, 0xc6, 0x6b, 0xc3, 0xa8, 0xfc, 0x64, +0xf1, 0x6d, 0xcb, 0x7d, 0xe9, 0xb5, 0xeb, 0xd7, 0x39, 0x1d, 0x73, 0x70, 0xe7, 0xfa, 0xd7, 0x3b, +0x5a, 0x5e, 0x33, 0x12, 0xc3, 0xe3, 0x1d, 0x62, 0x39, 0xb7, 0x0b, 0xa1, 0xa8, 0x5c, 0x87, 0xdd, +0xf7, 0xb3, 0xbd, 0x81, 0xcf, 0xbe, 0x6b, 0x36, 0xbf, 0xa9, 0xb0, 0xd1, 0xe5, 0xa5, 0x15, 0xe4, +0xbf, 0x23, 0xf9, 0x2f, 0x15, 0x2b, 0xd7, 0x9b, 0xf3, 0x7f, 0x98, 0x51, 0x45, 0x15, 0xb1, 0xce, +0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, +0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x50, 0x5b, 0x15, +0xa9, 0xa6, 0xf8, 0x2b, 0x54, 0xd5, 0x55, 0x59, 0x6d, 0x1e, 0x38, 0x5b, 0xa4, 0xb2, 0x1f, 0x25, +0x7f, 0x23, 0xf3, 0x1f, 0xa8, 0x06, 0x9a, 0x4d, 0xbb, 0x23, 0x1a, 0xd8, 0x8a, 0x54, 0x63, 0xcd, +0x56, 0x4a, 0x2b, 0xcc, 0xcb, 0xcd, 0x7a, 0x17, 0xc3, 0x24, 0x58, 0xfc, 0x29, 0x13, 0x0d, 0xaa, +0x5d, 0xe6, 0x66, 0xf7, 0xe4, 0x0f, 0xe4, 0x2b, 0x3f, 0x4d, 0xf8, 0x51, 0x12, 0x6d, 0x6b, 0xcb, +0xa9, 0xa4, 0xf5, 0x8d, 0x10, 0x20, 0x1f, 0xf0, 0x26, 0xce, 0x7f, 0xef, 0x91, 0x5f, 0xab, 0x1f, +0xf0, 0x46, 0x4f, 0xd9, 0x6b, 0xe1, 0x6f, 0x8d, 0x3f, 0x66, 0x39, 0x75, 0xad, 0x4b, 0xc1, 0x3a, +0x1e, 0xb3, 0xad, 0x58, 0xeb, 0xb7, 0x36, 0x4f, 0x73, 0xaa, 0x41, 0xf6, 0xd6, 0x3b, 0x52, 0x19, +0x17, 0xe5, 0x97, 0x28, 0xa4, 0x09, 0x06, 0x30, 0xa3, 0x9e, 0x7a, 0xd7, 0x9b, 0x9d, 0x67, 0x0b, +0x27, 0xc3, 0x7d, 0x76, 0xb4, 0x1c, 0x95, 0xd2, 0xb2, 0xb6, 0xee, 0xff, 0x00, 0x81, 0x8e, 0x57, +0x96, 0x53, 0xe2, 0xac, 0x57, 0xf6, 0x4e, 0x0e, 0xaa, 0x8c, 0xad, 0xcd, 0x76, 0x9d, 0xac, 0xad, +0xb7, 0x77, 0xaf, 0x91, 0xf9, 0xc5, 0xe1, 0xff, 0x00, 0x0d, 0x6a, 0x3e, 0x28, 0xd4, 0x0d, 0xb6, +0x97, 0x63, 0xa8, 0x6a, 0x97, 0x40, 0x67, 0x6d, 0xa5, 0xa9, 0xb8, 0x6f, 0xc8, 0x0a, 0xf5, 0x3f, +0x07, 0xfe, 0xc0, 0x1f, 0x1b, 0x3c, 0x76, 0x17, 0xec, 0x7f, 0x0d, 0x3c, 0x59, 0x18, 0x73, 0x85, +0x37, 0xd6, 0xdf, 0xd9, 0xea, 0x7d, 0x0f, 0xfa, 0x46, 0xce, 0x3d, 0xfa, 0x57, 0xee, 0x26, 0x87, +0xa2, 0xd9, 0xf8, 0x72, 0xc5, 0x6d, 0x74, 0xfb, 0x5b, 0x5b, 0x1b, 0x54, 0xc9, 0x58, 0x6d, 0xe1, +0x58, 0x63, 0x1f, 0x45, 0x5c, 0x0f, 0xd2, 0xb4, 0x2b, 0xf3, 0xac, 0x47, 0x8a, 0xd8, 0x99, 0x7f, +0xbb, 0xd0, 0x8c, 0x7f, 0xc4, 0xdb, 0xfc, 0xb9, 0x4f, 0xd1, 0xf0, 0x3f, 0x47, 0xfc, 0x04, 0x17, +0xfb, 0x5e, 0x2e, 0x72, 0xff, 0x00, 0x0a, 0x51, 0xfc, 0xf9, 0xcf, 0xc7, 0xff, 0x00, 0x08, 0x7f, +0xc1, 0x16, 0x7e, 0x36, 0xf8, 0x91, 0x15, 0xaf, 0xa1, 0xf0, 0x8f, 0x87, 0x06, 0x32, 0x46, 0xa1, +0xaa, 0x79, 0x8c, 0x3d, 0xbf, 0xd1, 0xd2, 0x51, 0x9f, 0xc7, 0x1e, 0xf5, 0xeb, 0xde, 0x0c, 0xff, +0x00, 0x82, 0x07, 0xcf, 0x36, 0x24, 0xf1, 0x27, 0xc4, 0x85, 0x89, 0x7b, 0xdb, 0x69, 0x9a, 0x5f, +0x99, 0x9f, 0xfb, 0x6b, 0x23, 0x8f, 0xfd, 0x17, 0xf8, 0xd7, 0xe9, 0x17, 0x5a, 0x2b, 0xc1, 0xc4, +0xf8, 0x89, 0x9d, 0xd5, 0xd2, 0x35, 0x14, 0x3f, 0xc3, 0x15, 0xfa, 0xdd, 0x9f, 0x5d, 0x81, 0xf0, +0x6b, 0x85, 0xf0, 0xfa, 0xce, 0x8c, 0xaa, 0x7f, 0x8a, 0x6f, 0xf2, 0x8f, 0x2a, 0xfc, 0x2c, 0x7c, +0x9d, 0xf0, 0xd7, 0xfe, 0x08, 0xdb, 0xf0, 0x4f, 0xc0, 0x6f, 0x1c, 0x9a, 0x86, 0x9f, 0xae, 0x78, +0xae, 0xe1, 0x39, 0xdd, 0xab, 0xea, 0x2c, 0x13, 0x3c, 0x7f, 0x04, 0x02, 0x25, 0x61, 0xec, 0xdb, +0xba, 0xf3, 0x9a, 0xfa, 0x1f, 0xe1, 0xdf, 0xc2, 0x1f, 0x0a, 0xfc, 0x25, 0xd3, 0x1a, 0xcf, 0xc2, +0xbe, 0x1d, 0xd1, 0x7c, 0x3b, 0x6d, 0x8c, 0x32, 0x69, 0xd6, 0x51, 0xdb, 0xef, 0xc7, 0xf7, 0x8a, +0x80, 0x58, 0xfb, 0x9c, 0x9a, 0xea, 0xb1, 0x46, 0x2b, 0xe5, 0xb1, 0xd9, 0xb6, 0x3b, 0x18, 0xff, +0x00, 0xda, 0xaa, 0xca, 0x7e, 0x4d, 0xb6, 0xbe, 0xed, 0x8f, 0xbc, 0xca, 0xf8, 0x7f, 0x2c, 0xcb, +0x95, 0xb0, 0x38, 0x78, 0x53, 0xf3, 0x8c, 0x52, 0x7f, 0x37, 0x6b, 0xbf, 0x98, 0x51, 0x45, 0x15, +0xc0, 0x7a, 0xe1, 0x45, 0x14, 0x50, 0x04, 0x33, 0x4c, 0x20, 0x5d, 0xce, 0x55, 0x55, 0x46, 0x4b, +0x1e, 0xdf, 0x5a, 0xfc, 0xf2, 0xfd, 0xb7, 0x3f, 0xe0, 0xb2, 0x4d, 0xa1, 0xea, 0x97, 0x9e, 0x19, +0xf8, 0x40, 0x6c, 0x2e, 0xa4, 0xb4, 0xca, 0x5d, 0xf8, 0x9a, 0x75, 0x13, 0xc4, 0xad, 0xdc, 0x5a, +0xc6, 0x7e, 0x49, 0x07, 0xfd, 0x34, 0x70, 0xca, 0x79, 0xc2, 0x11, 0xb5, 0xeb, 0x7f, 0xfe, 0x0b, +0x3d, 0xfb, 0x63, 0xdd, 0x7c, 0x3b, 0xf0, 0xb5, 0x97, 0xc2, 0xdf, 0x0f, 0xde, 0x7d, 0x97, 0x52, +0xf1, 0x45, 0xb9, 0xb8, 0xd6, 0xee, 0x11, 0xbe, 0x6b, 0x6b, 0x2c, 0xed, 0x48, 0x78, 0xe8, 0x66, +0x2a, 0xdb, 0xba, 0x1d, 0x89, 0x8c, 0x61, 0xeb, 0xf2, 0xfc, 0x0c, 0x0a, 0xfd, 0x6b, 0x80, 0xf8, +0x26, 0x8e, 0x2a, 0x92, 0xcc, 0x73, 0x05, 0xcd, 0x17, 0xf0, 0xc5, 0xec, 0xd7, 0x77, 0xdf, 0xc9, +0x7c, 0xdd, 0xd1, 0xfc, 0xf3, 0xe2, 0xc7, 0x8a, 0x18, 0x8c, 0x0d, 0x77, 0x92, 0xe5, 0x12, 0xe5, +0x9a, 0xfe, 0x24, 0xd6, 0xe9, 0xb5, 0x7e, 0x58, 0xf6, 0x76, 0x6a, 0xef, 0xa6, 0xca, 0xcd, 0x36, +0xb7, 0xfe, 0x23, 0xfc, 0x55, 0xf1, 0x37, 0xc5, 0xed, 0x73, 0xfb, 0x4b, 0xc4, 0xfa, 0xf6, 0xa9, +0xaf, 0x5f, 0x67, 0x2b, 0x71, 0x79, 0x77, 0x24, 0xfb, 0x3d, 0x80, 0x7e, 0x14, 0x76, 0xc0, 0xc0, +0xae, 0x7f, 0x60, 0x34, 0xb4, 0x57, 0xed, 0x34, 0x68, 0xd3, 0xa5, 0x15, 0x0a, 0x71, 0x49, 0x2d, +0x92, 0x56, 0x3f, 0x99, 0x31, 0x18, 0xaa, 0xd5, 0xea, 0x3a, 0xb5, 0xe6, 0xe5, 0x27, 0xbb, 0x6d, +0xb6, 0xfe, 0x6c, 0xee, 0xbe, 0x0a, 0xfe, 0xd3, 0x5e, 0x3e, 0xfd, 0x9e, 0x75, 0x55, 0xba, 0xf0, +0x6f, 0x8a, 0xb5, 0x2d, 0x0d, 0x15, 0xb7, 0x1b, 0x4f, 0xb4, 0x6e, 0xb4, 0xb8, 0xe7, 0xfe, 0x5a, +0x42, 0xff, 0x00, 0xbb, 0x7e, 0xfc, 0xb2, 0xf7, 0x35, 0xfa, 0x65, 0xfb, 0x05, 0x7f, 0xc1, 0x54, +0xf4, 0x7f, 0xda, 0x62, 0xf6, 0xd3, 0xc2, 0x9e, 0x2f, 0xb7, 0xb4, 0xf0, 0xef, 0x8d, 0xee, 0x06, +0xdb, 0x66, 0x8d, 0xb1, 0x65, 0xac, 0x11, 0xff, 0x00, 0x3c, 0xf7, 0x64, 0xc7, 0x2f, 0x5f, 0xdd, +0xb1, 0x21, 0xbf, 0x84, 0x93, 0xf2, 0x0f, 0xc9, 0x3c, 0x66, 0xa4, 0xb3, 0xbb, 0x92, 0xc6, 0xe6, +0x0b, 0x8b, 0x79, 0xda, 0xd6, 0xea, 0xd4, 0x86, 0x47, 0x53, 0x86, 0x42, 0x39, 0x04, 0x1e, 0xc4, +0x7e, 0x95, 0xf3, 0x1c, 0x45, 0xc2, 0x38, 0x1c, 0xd2, 0x93, 0xe7, 0x8a, 0x8d, 0x4e, 0x93, 0x4b, +0x5b, 0xf9, 0xf7, 0x5e, 0xbf, 0x2b, 0x1f, 0x73, 0xc1, 0xbe, 0x23, 0x66, 0xb9, 0x0d, 0x78, 0xf2, +0x4d, 0xce, 0x8f, 0xda, 0xa7, 0x27, 0x74, 0xd7, 0x5e, 0x5b, 0xfc, 0x2e, 0xdb, 0x5b, 0x4e, 0xe9, +0x9f, 0xd1, 0x85, 0x15, 0xf3, 0x7f, 0xfc, 0x13, 0x37, 0xf6, 0xba, 0x93, 0xf6, 0xb4, 0xfd, 0x9f, +0x63, 0xb9, 0xd5, 0x66, 0x56, 0xf1, 0x67, 0x86, 0xa4, 0x5d, 0x3b, 0x58, 0xc7, 0x06, 0xe4, 0xe3, +0x31, 0x5c, 0xe3, 0xfe, 0x9a, 0xa8, 0x39, 0xc7, 0xf1, 0xa4, 0x98, 0x00, 0x62, 0xbe, 0x90, 0xaf, +0xe6, 0xdc, 0x76, 0x0a, 0xae, 0x0f, 0x11, 0x3c, 0x2d, 0x75, 0x69, 0x41, 0xd9, 0xff, 0x00, 0x5e, +0x7b, 0xa3, 0xfb, 0x63, 0x2a, 0xcc, 0xf0, 0xf9, 0x8e, 0x0e, 0x9e, 0x3b, 0x0a, 0xef, 0x0a, 0x89, +0x49, 0x3f, 0x27, 0xdf, 0xcd, 0x6c, 0xfc, 0xc2, 0x8a, 0x28, 0xae, 0x53, 0xd0, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x3f, 0x99, 0x1f, 0x8d, 0x5a, 0x5b, 0x68, 0xff, 0x00, 0x1a, 0x7c, 0x69, 0x68, 0xcb, 0xb5, +0xad, 0xf5, 0xfb, 0xd8, 0x88, 0x3f, 0xc2, 0x56, 0xe5, 0xc1, 0xf7, 0xed, 0xde, 0xb9, 0x9a, 0xf5, +0xaf, 0xdb, 0xdf, 0xc3, 0x72, 0x78, 0x4f, 0xf6, 0xe2, 0xf8, 0xbd, 0x63, 0x26, 0xd5, 0xdd, 0xe2, +0xfd, 0x4e, 0x75, 0x51, 0xd1, 0x56, 0x7b, 0x89, 0x27, 0x8f, 0x1f, 0x83, 0x8a, 0xf2, 0x5a, 0xfe, +0xa0, 0xcb, 0xea, 0x73, 0xe1, 0xa9, 0xcd, 0x75, 0x8a, 0x7f, 0x82, 0x3f, 0x94, 0x33, 0x2a, 0x7e, +0xcf, 0x17, 0x56, 0x1d, 0xa5, 0x25, 0xf8, 0xb0, 0xa2, 0x8a, 0x2b, 0xb0, 0xe2, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x29, 0xc9, 0x1c, 0x93, 0xcd, 0x1c, 0x70, 0xf9, 0xb3, 0xcd, 0x29, 0xda, 0x91, 0xc6, +0x9b, 0x99, 0x8f, 0xb0, 0x1c, 0xd7, 0x4d, 0xa1, 0xfc, 0x33, 0x92, 0x66, 0x8e, 0x4d, 0x4a, 0x63, +0x0c, 0x3d, 0x7e, 0xcd, 0x0b, 0x06, 0x99, 0xbf, 0xde, 0x6e, 0x55, 0x7f, 0x0c, 0x9f, 0xa7, 0x5a, +0xa8, 0x46, 0x52, 0x76, 0x89, 0xc7, 0x8c, 0xcc, 0x30, 0xf8, 0x58, 0xf3, 0x57, 0x95, 0xbf, 0x3f, +0xb8, 0xe6, 0xed, 0xac, 0xe4, 0xbe, 0x9d, 0x61, 0xb7, 0x8e, 0x69, 0x2e, 0x1b, 0xa4, 0x70, 0xa1, +0x66, 0xfc, 0x87, 0xf3, 0xae, 0x93, 0x47, 0xf8, 0x61, 0x25, 0xd6, 0xd6, 0xd4, 0x26, 0x10, 0xa7, +0x53, 0x6f, 0x6f, 0x87, 0x94, 0x8f, 0x77, 0xfb, 0xab, 0xf8, 0x6e, 0xff, 0x00, 0x0e, 0xbb, 0x4d, +0xd2, 0x2d, 0xf4, 0x6b, 0x7f, 0x2a, 0xde, 0x18, 0x63, 0x8b, 0xf8, 0x82, 0x0f, 0x99, 0xff, 0x00, +0xde, 0x6e, 0xad, 0xf8, 0x93, 0x56, 0xab, 0xb6, 0x9e, 0x0d, 0x2d, 0x67, 0xa9, 0xf1, 0x38, 0xee, +0x2a, 0xaf, 0x53, 0xdc, 0xc3, 0x2e, 0x45, 0xdd, 0xea, 0xff, 0x00, 0xc9, 0x14, 0x74, 0x8f, 0x0e, +0x58, 0xe8, 0x8a, 0xbf, 0x64, 0xb6, 0x86, 0x19, 0x47, 0x3e, 0x73, 0xfc, 0xf2, 0x9f, 0xf8, 0x11, +0xe4, 0x7d, 0x06, 0x07, 0xd2, 0xaf, 0x75, 0xa2, 0x8a, 0xeb, 0x8c, 0x54, 0x74, 0x47, 0xcc, 0xd5, +0xad, 0x3a, 0x92, 0xe7, 0xa8, 0xdb, 0x7d, 0xd8, 0x57, 0xe9, 0xaf, 0xfc, 0x10, 0x4f, 0xc6, 0xeb, +0x79, 0xf0, 0xaf, 0xe2, 0x17, 0x87, 0x04, 0x9b, 0x9b, 0x4d, 0xd5, 0xe0, 0xd4, 0xc2, 0x9f, 0x4b, +0x88, 0x4c, 0x79, 0xff, 0x00, 0xc9, 0x50, 0x0f, 0xa7, 0x1e, 0xb5, 0xf9, 0x95, 0x5f, 0x5b, 0xff, +0x00, 0xc1, 0x18, 0xbe, 0x2e, 0x27, 0xc3, 0xff, 0x00, 0xda, 0xfe, 0x3d, 0x0e, 0xe2, 0x70, 0x2d, +0xbc, 0x65, 0xa5, 0xcd, 0xa6, 0x8c, 0xf0, 0xa2, 0xe2, 0x3c, 0x5c, 0x44, 0x7f, 0x28, 0xe4, 0x40, +0x3b, 0x99, 0x07, 0xb5, 0x7c, 0x8f, 0x1e, 0x60, 0x9e, 0x27, 0x24, 0xad, 0x18, 0xef, 0x14, 0xa5, +0xff, 0x00, 0x80, 0xb4, 0xdf, 0xe1, 0x73, 0xf4, 0x2f, 0x09, 0xf3, 0x38, 0xe0, 0xb8, 0xa3, 0x0d, +0x29, 0xbb, 0x29, 0xb7, 0x07, 0xff, 0x00, 0x6f, 0x26, 0x97, 0xfe, 0x4d, 0x63, 0xf5, 0xf6, 0x8a, +0x33, 0x45, 0x7f, 0x33, 0x9f, 0xdc, 0x41, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x46, 0x68, 0xac, 0xfd, 0x6f, 0x5a, 0x87, 0xc3, 0x9a, 0x35, 0xd6, 0xa1, 0x75, +0xf2, 0xda, 0xd8, 0xc1, 0x25, 0xc4, 0xcc, 0x07, 0x44, 0x45, 0x2c, 0x7f, 0x40, 0x68, 0xeb, 0x60, +0xd1, 0x2b, 0xb3, 0xf0, 0xcf, 0xf6, 0xe8, 0xf8, 0x8f, 0x27, 0xc5, 0xbf, 0xdb, 0x03, 0xe2, 0x2e, +0xb2, 0xd2, 0x79, 0xca, 0xba, 0xbc, 0xf6, 0x76, 0xa7, 0xb1, 0x82, 0xdb, 0xfd, 0x1e, 0x2c, 0x0e, +0xd9, 0x48, 0xd4, 0xfd, 0x49, 0x3d, 0x72, 0x6b, 0xc9, 0xea, 0xc6, 0xb3, 0xac, 0xdc, 0x78, 0x83, +0x56, 0xbc, 0xd4, 0x2f, 0x0e, 0x6e, 0x2e, 0xee, 0x5a, 0xe6, 0x7c, 0x0e, 0x33, 0x21, 0xc9, 0xfe, +0x75, 0x5c, 0xd7, 0xf5, 0xe6, 0x5f, 0x87, 0x58, 0x7c, 0x35, 0x3a, 0x0b, 0xec, 0xc5, 0x2f, 0xb9, +0x24, 0x7f, 0x9d, 0x39, 0xc6, 0x35, 0xe3, 0x31, 0xf5, 0xb1, 0x72, 0xde, 0xa4, 0xe5, 0x2f, 0xbe, +0x4d, 0xff, 0x00, 0xc0, 0xf9, 0x05, 0x14, 0x51, 0x5d, 0x87, 0x9a, 0x14, 0x1a, 0x28, 0xa0, 0x0f, +0xb0, 0xbf, 0xe0, 0x89, 0xff, 0x00, 0x12, 0x26, 0xf0, 0x97, 0xed, 0x71, 0x75, 0xa0, 0x99, 0x89, +0xb3, 0xf1, 0x76, 0x91, 0x3c, 0x0c, 0x99, 0xe0, 0xcd, 0x0f, 0xfa, 0x44, 0x6d, 0xf5, 0x11, 0xa4, +0xbf, 0xf7, 0xf0, 0xd7, 0xeb, 0x95, 0x7e, 0x30, 0xff, 0x00, 0xc1, 0x22, 0x74, 0x59, 0xf5, 0x3f, +0xdb, 0xe7, 0xc1, 0xf7, 0x11, 0x0f, 0x97, 0x4b, 0xb7, 0xd4, 0x2e, 0xae, 0x7e, 0x86, 0xca, 0x78, +0xbf, 0xf4, 0x39, 0x45, 0x7e, 0xcf, 0x57, 0xf3, 0xcf, 0x89, 0x94, 0xe1, 0x1c, 0xe6, 0xf1, 0xde, +0x50, 0x8b, 0x7e, 0xb7, 0x6b, 0xf2, 0x48, 0xfe, 0xc7, 0xf0, 0x3a, 0xb5, 0x49, 0xf0, 0xd7, 0x24, +0xf6, 0x8d, 0x49, 0xa8, 0xfa, 0x5a, 0x2f, 0xf3, 0x6f, 0xe6, 0x14, 0x51, 0x45, 0x7e, 0x7a, 0x7e, +0xc2, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x7e, 0x0d, 0x7f, 0xc1, 0x6d, 0xbc, 0x06, 0xde, 0x0a, 0xff, 0x00, +0x82, 0x8d, 0x78, 0xd2, 0xe0, 0xa8, 0x8e, 0xdb, 0xc4, 0x76, 0x5a, 0x76, 0xab, 0x10, 0x55, 0xc0, +0xc1, 0xb6, 0x8e, 0x07, 0x3e, 0xf9, 0x92, 0x09, 0x49, 0x3e, 0xa4, 0xd7, 0xca, 0x15, 0xfa, 0x51, +0xff, 0x00, 0x07, 0x1f, 0xfc, 0x31, 0x36, 0x3f, 0x12, 0xbe, 0x19, 0xf8, 0xda, 0x38, 0xf7, 0x7f, +0x69, 0xe9, 0x97, 0x5a, 0x14, 0xee, 0x07, 0xdd, 0x6b, 0x79, 0x96, 0x78, 0x81, 0xfa, 0xfd, 0xa6, +0x62, 0x3f, 0xdd, 0x6a, 0xfc, 0xd7, 0xaf, 0xe8, 0xae, 0x13, 0xc5, 0x7b, 0x7c, 0xa2, 0x84, 0xfb, +0x46, 0xdf, 0xf8, 0x0e, 0x9f, 0xa1, 0xfc, 0xd1, 0xc6, 0x38, 0x57, 0x87, 0xce, 0x6b, 0xc3, 0xbb, +0xe6, 0xff, 0x00, 0xc0, 0xbd, 0xef, 0xd4, 0x28, 0xa2, 0x8a, 0xfa, 0x23, 0xe6, 0x82, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0x8d, 0x0b, 0xb4, 0x6a, +0xb1, 0xb4, 0x92, 0xca, 0xc1, 0x11, 0x15, 0x77, 0x33, 0xb1, 0xe8, 0x00, 0x1d, 0x49, 0xa0, 0x1b, +0xb6, 0xac, 0x33, 0x5b, 0x5e, 0x1c, 0xf0, 0x3d, 0xd6, 0xbc, 0xb1, 0xce, 0xfb, 0xad, 0xac, 0xcf, +0x22, 0x67, 0x5f, 0x9e, 0x61, 0xff, 0x00, 0x4c, 0xd7, 0xbf, 0xfb, 0xc7, 0x03, 0xeb, 0xd2, 0xb6, +0xbc, 0x27, 0xf0, 0xe9, 0x6d, 0x04, 0x77, 0x5a, 0x8a, 0x24, 0xf3, 0x70, 0xc9, 0x11, 0xf9, 0xa3, +0x84, 0xff, 0x00, 0xb7, 0xd4, 0x33, 0x7b, 0x7d, 0xd1, 0xef, 0xdb, 0xac, 0xc7, 0x3f, 0xa5, 0x75, +0xd1, 0xc2, 0xb7, 0xac, 0xcf, 0x8d, 0xcd, 0xb8, 0x9d, 0x41, 0xba, 0x58, 0x3d, 0x5f, 0xf3, 0x74, +0xf9, 0x77, 0xf5, 0x28, 0xe8, 0xfe, 0x1f, 0xb3, 0xd0, 0xa1, 0x29, 0x6d, 0x1a, 0xc6, 0xcc, 0x3e, +0x79, 0x9b, 0xe6, 0x96, 0x4f, 0xab, 0x75, 0xfc, 0x06, 0x07, 0xb5, 0x5e, 0xa2, 0x8a, 0xef, 0x8c, +0x54, 0x55, 0x91, 0xf1, 0x35, 0x2a, 0x4e, 0xa4, 0x9c, 0xea, 0x3b, 0xb7, 0xd5, 0x85, 0x14, 0x51, +0x54, 0x66, 0x14, 0x51, 0x45, 0x00, 0x15, 0xad, 0xe0, 0x3f, 0x19, 0xea, 0x1f, 0x0d, 0x7c, 0x6f, +0xa4, 0xf8, 0x8b, 0x4b, 0x9b, 0xec, 0xfa, 0x96, 0x83, 0x79, 0x0d, 0xe5, 0xa9, 0x3f, 0xf3, 0xd6, +0x39, 0x04, 0x88, 0x0f, 0xb1, 0xc7, 0xf3, 0xac, 0x9a, 0x2b, 0x3a, 0x94, 0xe3, 0x52, 0x2e, 0x12, +0xd5, 0x3d, 0x19, 0xad, 0x1a, 0xd3, 0xa3, 0x51, 0x55, 0xa6, 0xed, 0x28, 0xb4, 0xd3, 0xec, 0xd6, +0xa9, 0xfc, 0x99, 0xfd, 0x04, 0x7c, 0x1f, 0xf8, 0xa7, 0xa6, 0xfc, 0x6c, 0xf8, 0x5b, 0xa0, 0x78, +0xb3, 0x47, 0x6c, 0xe9, 0xfa, 0xfd, 0x94, 0x77, 0x91, 0x8d, 0xd9, 0x31, 0x16, 0x1f, 0x34, 0x6c, +0x7f, 0xbc, 0x8c, 0x19, 0x1b, 0xdd, 0x4d, 0x75, 0x95, 0xf9, 0xa9, 0xff, 0x00, 0x04, 0x4d, 0xfd, +0xae, 0x23, 0xd2, 0xb5, 0x0b, 0xdf, 0x84, 0x7a, 0xd5, 0xd0, 0x58, 0x75, 0x02, 0xfa, 0x9f, 0x87, +0x9d, 0xcf, 0x0b, 0x2e, 0x37, 0x5c, 0x5a, 0xff, 0x00, 0xc0, 0xb1, 0xe6, 0xa8, 0xf5, 0x12, 0x77, +0x61, 0x5f, 0xa5, 0x79, 0xaf, 0xe5, 0x5e, 0x20, 0xc9, 0xa7, 0x95, 0xe3, 0xea, 0x61, 0x25, 0xb2, +0x77, 0x8b, 0xef, 0x17, 0xb3, 0xfd, 0x1f, 0x9a, 0x67, 0xf7, 0xdf, 0x07, 0x71, 0x25, 0x2c, 0xf7, +0x29, 0xa5, 0x98, 0x53, 0xdd, 0xab, 0x49, 0x76, 0x92, 0xf8, 0x97, 0xdf, 0xaa, 0xf2, 0x69, 0x85, +0x14, 0x51, 0x5e, 0x29, 0xf5, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x5e, 0x2b, +0xff, 0x00, 0x05, 0x0d, 0xf1, 0xfa, 0xfc, 0x31, 0xfd, 0x8a, 0xbe, 0x22, 0x6a, 0x45, 0xb6, 0xbc, +0xda, 0x43, 0xe9, 0xa8, 0x7b, 0xee, 0xba, 0x2b, 0x6c, 0x31, 0xef, 0xfb, 0xdc, 0xfb, 0x63, 0x3d, +0xab, 0xda, 0xab, 0xe0, 0xbf, 0xf8, 0x2e, 0xcf, 0xc5, 0x65, 0xd1, 0xbe, 0x0b, 0xf8, 0x47, 0xc1, +0xb1, 0x48, 0x05, 0xc7, 0x88, 0x35, 0x47, 0xd4, 0x6e, 0x14, 0x1e, 0x7e, 0xcf, 0x6c, 0x84, 0x60, +0x8f, 0xf6, 0x9e, 0x55, 0x23, 0xd4, 0xc6, 0x7d, 0x0d, 0x7b, 0x5c, 0x37, 0x81, 0x78, 0xbc, 0xd6, +0x85, 0x0e, 0x8e, 0x49, 0xbf, 0x45, 0xab, 0xfc, 0x13, 0x3e, 0x5f, 0x8d, 0x73, 0x45, 0x97, 0x64, +0x58, 0xac, 0x67, 0x58, 0xc1, 0xa5, 0xfe, 0x29, 0x7b, 0xb1, 0xfc, 0x5a, 0x3f, 0x2f, 0xd4, 0x60, +0x51, 0x45, 0x15, 0xfd, 0x5c, 0x7f, 0x9f, 0xe1, 0x45, 0x14, 0x50, 0x01, 0x45, 0x15, 0x06, 0xa5, +0x7f, 0x0e, 0x8f, 0xa7, 0x49, 0x71, 0x31, 0xc4, 0x11, 0xa6, 0xf6, 0x00, 0xf2, 0xe7, 0xa0, 0x51, +0xee, 0x49, 0x00, 0x7d, 0x6a, 0x65, 0x24, 0x95, 0xd9, 0x50, 0x84, 0xa7, 0x25, 0x08, 0x2b, 0xb6, +0x7d, 0xb1, 0xff, 0x00, 0x04, 0x29, 0xf0, 0xfb, 0x6b, 0xdf, 0xb5, 0x77, 0x8a, 0xb5, 0x28, 0xe3, +0xdd, 0x6b, 0xe1, 0xff, 0x00, 0x0b, 0x79, 0x72, 0x70, 0x7f, 0x77, 0x3d, 0xcd, 0xc4, 0x42, 0x2e, +0x7b, 0x1f, 0x2e, 0x09, 0xf8, 0x3d, 0x43, 0x83, 0xda, 0xbf, 0x58, 0xeb, 0xf3, 0xaf, 0xfe, 0x0d, +0xdd, 0xf8, 0x7d, 0x25, 0xaf, 0xc0, 0xaf, 0x88, 0x9e, 0x39, 0xbb, 0x8f, 0x6d, 0xdf, 0x8b, 0x3c, +0x43, 0x15, 0x8e, 0x71, 0xf7, 0xa2, 0xb3, 0x80, 0x11, 0x8f, 0xf6, 0x56, 0x4b, 0xa9, 0x54, 0x7a, +0x6c, 0x3e, 0xd5, 0xfa, 0x29, 0x5f, 0xcc, 0xbc, 0x71, 0x8c, 0xfa, 0xce, 0x75, 0x5a, 0x4b, 0x68, +0xda, 0x3f, 0x72, 0x5f, 0xad, 0xcf, 0xee, 0xbf, 0x0d, 0x72, 0x9f, 0xec, 0xee, 0x1c, 0xc3, 0xd0, +0x96, 0xed, 0x39, 0x3f, 0x59, 0x36, 0xff, 0x00, 0x2b, 0x05, 0x14, 0x51, 0x5f, 0x26, 0x7d, 0xd8, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x01, 0xf1, 0x8f, 0xfc, 0x17, 0x6b, 0xe0, 0xe1, 0xf8, 0xa7, 0xfb, 0x03, 0x6a, +0x9a, 0xac, 0x30, 0x89, 0x6f, 0x3c, 0x0b, 0xa9, 0xda, 0xeb, 0xa9, 0xb5, 0x7e, 0x63, 0x16, 0x4d, +0xbc, 0xc3, 0x3f, 0xdd, 0x11, 0xdc, 0x34, 0x84, 0x74, 0xfd, 0xd0, 0x3d, 0x40, 0xaf, 0xc3, 0x90, +0x73, 0x5f, 0xd3, 0x97, 0xc4, 0xbf, 0x87, 0xda, 0x7f, 0xc5, 0x7f, 0x87, 0x3a, 0xff, 0x00, 0x85, +0xf5, 0x65, 0x66, 0xd3, 0x3c, 0x49, 0xa6, 0xdc, 0x69, 0x77, 0x8a, 0xa7, 0x05, 0xa2, 0x9e, 0x26, +0x89, 0xf1, 0xef, 0xb5, 0x8e, 0x2b, 0xf9, 0xa3, 0xf1, 0xff, 0x00, 0x81, 0xf5, 0x2f, 0x85, 0xde, +0x3e, 0xd7, 0x7c, 0x2f, 0xac, 0x2a, 0xae, 0xb1, 0xe1, 0xdd, 0x42, 0xe3, 0x4d, 0xbe, 0x0b, 0xf7, +0x7c, 0xf8, 0x25, 0x31, 0x36, 0x3d, 0xb2, 0xbc, 0x7a, 0x8c, 0x57, 0xec, 0x1e, 0x1a, 0xe6, 0x1c, +0xf8, 0x6a, 0x98, 0x37, 0xbc, 0x5d, 0xd7, 0xa3, 0xff, 0x00, 0x82, 0xbf, 0x14, 0x7e, 0x2b, 0xe2, +0x86, 0x5f, 0xc9, 0x89, 0xa5, 0x8d, 0x4b, 0x49, 0x2e, 0x57, 0xea, 0xb5, 0x5f, 0x7a, 0x7f, 0x83, +0x32, 0x68, 0xa2, 0x8a, 0xfd, 0x30, 0xfc, 0xb4, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x9d, 0x04, 0x0d, 0x71, 0x2c, 0x51, 0xc7, 0x1b, 0xcd, 0x34, 0xcc, 0x23, 0x8d, 0x11, +0x72, 0xce, 0xc7, 0x80, 0x00, 0xa0, 0x2f, 0x6d, 0x58, 0xb6, 0xb6, 0xb2, 0xdd, 0xdc, 0x88, 0x61, +0x59, 0x2e, 0x1a, 0x76, 0xd8, 0x91, 0xa7, 0x57, 0x3f, 0xe7, 0xf0, 0x15, 0xe8, 0x3e, 0x13, 0xf0, +0x74, 0x5e, 0x1b, 0x89, 0x66, 0x93, 0x63, 0x5e, 0x4a, 0xbf, 0x3c, 0xa0, 0x65, 0x61, 0x07, 0xaa, +0x27, 0xf2, 0x2d, 0xd4, 0xfd, 0x38, 0x2e, 0xf0, 0x7f, 0x83, 0xd3, 0xc3, 0x16, 0x85, 0xa4, 0xf2, +0xe6, 0xbb, 0x65, 0x02, 0x79, 0x01, 0xca, 0xc4, 0x0f, 0x3e, 0x5a, 0x7b, 0x7a, 0x9e, 0xe7, 0xdb, +0x15, 0xb5, 0x5d, 0xf8, 0x7c, 0x3a, 0x5e, 0xf4, 0xb7, 0xfe, 0xbf, 0x13, 0xf3, 0xbc, 0xfb, 0x3e, +0x95, 0x76, 0xf0, 0xf8, 0x77, 0x68, 0x75, 0x7d, 0xff, 0x00, 0xe0, 0x07, 0x41, 0x45, 0x14, 0x57, +0x69, 0xf2, 0xe1, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x05, 0xcd, 0x03, 0x5f, 0xbc, 0xf0, 0xa6, 0xbd, 0x65, 0xaa, 0x69, 0x77, 0x52, 0x59, +0x6a, 0x1a, 0x65, 0xca, 0xdd, 0x5b, 0x5c, 0xdb, 0x1d, 0xad, 0x6f, 0x34, 0x64, 0x34, 0x72, 0x03, +0xea, 0x18, 0x03, 0xf8, 0x57, 0xed, 0x27, 0xfc, 0x13, 0xfb, 0xf6, 0xd9, 0xd3, 0x7f, 0x6c, 0x5f, +0x84, 0x8b, 0x71, 0x2b, 0x43, 0x67, 0xe3, 0x0d, 0x15, 0x12, 0x1d, 0x72, 0xc7, 0xa0, 0xdf, 0xc8, +0x17, 0x11, 0x7a, 0xc5, 0x26, 0x09, 0xff, 0x00, 0x61, 0xb7, 0x29, 0xe8, 0x09, 0xfc, 0x4f, 0x15, +0xd8, 0x7c, 0x0d, 0xf8, 0xe5, 0xe2, 0x4f, 0xd9, 0xcf, 0xe2, 0x6e, 0x9f, 0xe2, 0xaf, 0x0a, 0xdf, +0x1b, 0x3d, 0x4a, 0xcf, 0x82, 0x09, 0xfd, 0xc5, 0xdc, 0x3c, 0x79, 0x90, 0xca, 0x9f, 0xc7, 0x1b, +0xe0, 0x71, 0xeb, 0xca, 0xe1, 0x80, 0x61, 0xf1, 0xbc, 0x61, 0xc2, 0xd0, 0xce, 0x30, 0xd6, 0x8e, +0x95, 0x63, 0xf0, 0xbf, 0xfd, 0xb5, 0xf9, 0x3f, 0xc3, 0xef, 0xbf, 0xe9, 0x1e, 0x1c, 0x71, 0xe5, +0x5e, 0x1c, 0xc7, 0x5e, 0xa5, 0xe5, 0x87, 0xa9, 0x65, 0x38, 0xae, 0x9d, 0xa4, 0x97, 0x75, 0xf8, +0xa7, 0x67, 0xd2, 0xdf, 0xd0, 0x26, 0x68, 0xaf, 0x0d, 0xfd, 0x8d, 0x3f, 0x6d, 0xef, 0x0a, 0xfe, +0xd8, 0xfe, 0x0a, 0x5b, 0xad, 0x26, 0x41, 0xa7, 0xf8, 0x86, 0xce, 0x25, 0x3a, 0xa6, 0x87, 0x71, +0x20, 0xfb, 0x45, 0xa3, 0x1e, 0x37, 0xa9, 0xff, 0x00, 0x96, 0x90, 0x93, 0xd1, 0xc7, 0xa8, 0x0c, +0x14, 0xf1, 0x5e, 0xe5, 0x5f, 0xce, 0x18, 0xac, 0x2d, 0x6c, 0x35, 0x69, 0x50, 0xc4, 0x45, 0xc6, +0x51, 0xdd, 0x33, 0xfb, 0x53, 0x01, 0x98, 0x61, 0xb1, 0xb8, 0x78, 0xe2, 0xb0, 0x93, 0x53, 0xa7, +0x25, 0x74, 0xd6, 0xcf, 0xfa, 0xea, 0xb7, 0x4f, 0x46, 0x14, 0x51, 0x9a, 0x2b, 0x03, 0xb0, 0x28, +0xa2, 0x8a, 0x00, 0x33, 0x5f, 0x8c, 0x9f, 0xf0, 0x56, 0xaf, 0x8d, 0x7f, 0xf0, 0xb7, 0xbf, 0x6c, +0xad, 0x6a, 0xd6, 0xde, 0x7d, 0xda, 0x7f, 0x83, 0x51, 0x74, 0x1b, 0x7e, 0x78, 0x2f, 0x1e, 0x4d, +0xc9, 0xfa, 0xf9, 0xf2, 0x48, 0x9f, 0xf6, 0xc8, 0x7a, 0x60, 0x7e, 0xaa, 0xfe, 0xd4, 0x5f, 0x1b, +0xad, 0x7f, 0x66, 0xff, 0x00, 0x80, 0x7e, 0x28, 0xf1, 0x95, 0xc6, 0xc6, 0x93, 0x48, 0xb3, 0x66, +0xb5, 0x8d, 0xba, 0x5c, 0x5d, 0x3e, 0x23, 0x82, 0x3f, 0xf8, 0x14, 0xac, 0x80, 0xfa, 0x0c, 0x9e, +0xd5, 0xf8, 0x2f, 0xa9, 0xea, 0x17, 0x1a, 0xce, 0xa1, 0x71, 0x79, 0x79, 0x70, 0xd7, 0x57, 0x57, +0x8c, 0x6e, 0x6e, 0x59, 0xba, 0xbb, 0x13, 0x92, 0x4f, 0xb9, 0x26, 0xbf, 0x56, 0xf0, 0xb7, 0x2b, +0x75, 0x31, 0x15, 0x33, 0x09, 0xad, 0x22, 0xb9, 0x57, 0xab, 0xdf, 0xee, 0x5f, 0x99, 0xfc, 0xfd, +0xe3, 0xd7, 0x10, 0x2a, 0x58, 0x2a, 0x39, 0x3d, 0x37, 0xef, 0x54, 0x7c, 0xf2, 0xff, 0x00, 0x0c, +0x7e, 0x1b, 0xfa, 0xcb, 0x5f, 0xfb, 0x76, 0xfd, 0x08, 0x47, 0x02, 0x8a, 0x28, 0xaf, 0xdc, 0x8f, +0xe5, 0x80, 0xa2, 0x8a, 0x59, 0x24, 0x52, 0x85, 0x43, 0x2a, 0xaa, 0x82, 0xc4, 0xb1, 0xc0, 0x00, +0x7f, 0x4a, 0x4d, 0x80, 0xd2, 0x7e, 0x80, 0x01, 0x92, 0x4f, 0x61, 0x5e, 0x79, 0xe3, 0xcf, 0x16, +0x2e, 0xb7, 0x72, 0x21, 0x82, 0x4f, 0xf8, 0x97, 0xdb, 0xb1, 0x2a, 0xdd, 0xae, 0x64, 0xe8, 0x64, +0xfa, 0x0c, 0xe0, 0x7b, 0x12, 0x7b, 0xe0, 0x5a, 0xf1, 0xbf, 0x8d, 0xff, 0x00, 0xb5, 0x56, 0x4b, +0x3b, 0x29, 0x5b, 0xec, 0xb9, 0xdb, 0x3d, 0xc0, 0xeb, 0x75, 0xfe, 0xca, 0xfa, 0x27, 0x5c, 0xff, +0x00, 0x7b, 0x3e, 0x9d, 0x7a, 0x7f, 0xd8, 0xbf, 0xe0, 0x1f, 0xfc, 0x34, 0xe7, 0xed, 0x55, 0xe0, +0x1f, 0x02, 0x98, 0xfc, 0xcb, 0x3d, 0x7b, 0x54, 0x4f, 0xed, 0x05, 0xce, 0x3f, 0xd0, 0xe1, 0xcc, +0xd7, 0x3c, 0xf6, 0x3e, 0x44, 0x52, 0xe3, 0xdc, 0x81, 0xde, 0xbc, 0x8c, 0xc7, 0x1d, 0x0a, 0x74, +0xa5, 0x52, 0x4f, 0xdd, 0x8a, 0x6d, 0xfc, 0x95, 0xcf, 0xd1, 0x38, 0x53, 0x86, 0xea, 0xca, 0xbc, +0x27, 0x51, 0x7b, 0xf2, 0x69, 0x45, 0x76, 0xbb, 0x4a, 0xef, 0xef, 0xf9, 0x1f, 0xb9, 0x7f, 0xf0, +0x4c, 0xdf, 0x83, 0x6d, 0xf0, 0x1b, 0xf6, 0x14, 0xf8, 0x6f, 0xa0, 0xcd, 0x09, 0x82, 0xfa, 0x5d, +0x29, 0x35, 0x5b, 0xe5, 0x2b, 0x87, 0x4b, 0x8b, 0xc6, 0x6b, 0xa9, 0x15, 0xbd, 0x4a, 0x19, 0xb6, +0x7b, 0x04, 0x03, 0xa0, 0x15, 0xef, 0x94, 0xd5, 0x4d, 0x9f, 0x4e, 0xc3, 0x1d, 0x29, 0xd5, 0xfc, +0xab, 0x88, 0xad, 0x2a, 0xd5, 0xa7, 0x5e, 0x7b, 0xc9, 0xb6, 0xfe, 0x6e, 0xe7, 0xf6, 0xf6, 0x1b, +0x0f, 0x1a, 0x14, 0x61, 0x42, 0x1b, 0x45, 0x24, 0xbe, 0x4a, 0xc1, 0x45, 0x14, 0x56, 0x26, 0xc1, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x5f, 0x89, 0xff, 0x00, 0xf0, 0x5e, 0xff, 0x00, 0xd9, 0xc1, 0xbe, 0x13, +0x7e, 0xd7, 0x76, 0xbe, 0x35, 0xb3, 0xb7, 0xdb, 0xa3, 0xfc, 0x48, 0xb2, 0x17, 0x2c, 0x54, 0x61, +0x53, 0x51, 0xb6, 0x54, 0x86, 0x61, 0x8e, 0xd9, 0x43, 0x6f, 0x26, 0x7a, 0xb3, 0x49, 0x29, 0xe7, +0x04, 0xd7, 0xed, 0x85, 0x7c, 0xcb, 0xff, 0x00, 0x05, 0x60, 0xfd, 0x94, 0x9b, 0xf6, 0xb5, 0xfd, +0x8e, 0x35, 0xed, 0x2f, 0x4e, 0xb4, 0xfb, 0x57, 0x8a, 0x3c, 0x34, 0x7f, 0xb7, 0xf4, 0x25, 0x55, +0xdd, 0x24, 0xb7, 0x10, 0x2b, 0x6f, 0x81, 0x40, 0xe4, 0x99, 0x61, 0x69, 0x63, 0x03, 0xa6, 0xf6, +0x42, 0x7e, 0xed, 0x7d, 0x17, 0x0a, 0xe6, 0xab, 0x01, 0x99, 0x42, 0xa4, 0x9f, 0xbb, 0x2f, 0x76, +0x5e, 0x8f, 0xaf, 0xc9, 0xd9, 0x9f, 0x33, 0xc5, 0xd9, 0x4b, 0xcc, 0x32, 0xca, 0x94, 0xa0, 0xbd, +0xf8, 0xfb, 0xd1, 0xf5, 0x5d, 0x3e, 0x6a, 0xeb, 0xe6, 0x7e, 0x02, 0xd1, 0x4d, 0x8e, 0x41, 0x2a, +0x2b, 0x29, 0xca, 0xb0, 0xc8, 0x22, 0x9d, 0x5f, 0xd1, 0x47, 0xf3, 0x48, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x31, 0xf9, 0x79, 0xe9, 0x5d, 0xd7, 0xc3, 0xdf, 0x08, 0xff, 0x00, 0x67, +0x5b, 0x2d, 0xf5, 0xcc, 0x67, 0xed, 0x52, 0x2e, 0x60, 0x46, 0x1c, 0xdb, 0x46, 0x47, 0x52, 0x3f, +0xbe, 0xdf, 0xa0, 0xe3, 0xa9, 0x22, 0xb1, 0x7e, 0x1f, 0x78, 0x65, 0x75, 0xad, 0x40, 0xdd, 0x4e, +0x9b, 0xad, 0x6d, 0x5c, 0x61, 0x58, 0x71, 0x71, 0x2f, 0x04, 0x2f, 0xfb, 0xa3, 0x82, 0x7f, 0xe0, +0x23, 0xa1, 0x35, 0xe8, 0x04, 0xe4, 0xf3, 0xd7, 0xb9, 0xf5, 0xae, 0xcc, 0x2d, 0x1b, 0xfb, 0xec, +0xf8, 0xbe, 0x26, 0xcd, 0xad, 0xfe, 0xc7, 0x49, 0xff, 0x00, 0x8b, 0xfc, 0xbf, 0xcc, 0x28, 0xa2, +0x8a, 0xf4, 0x0f, 0x87, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x05, 0x14, 0x50, 0x06, 0xd7, 0x80, 0x7c, +0x7f, 0xad, 0xfc, 0x2a, 0xf1, 0x7d, 0x8f, 0x88, 0x3c, 0x39, 0xaa, 0xdf, 0x69, 0x3a, 0xd6, 0x9a, +0xd9, 0xb5, 0xbb, 0xb5, 0x6c, 0x32, 0xfa, 0x8f, 0x42, 0x08, 0xe0, 0xa1, 0x05, 0x58, 0x64, 0x1c, +0x82, 0x45, 0x7e, 0x97, 0x7e, 0xc6, 0x9f, 0xf0, 0x59, 0x5f, 0x0e, 0xfc, 0x43, 0x86, 0xd7, 0x43, +0xf8, 0xa1, 0xf6, 0x5f, 0x0b, 0xeb, 0x98, 0x54, 0x4d, 0x61, 0x78, 0xd3, 0x6f, 0x0f, 0xac, 0xbf, +0xf3, 0xee, 0xe7, 0xbe, 0x73, 0x1f, 0x53, 0x94, 0xe1, 0x6b, 0xf2, 0xdf, 0x34, 0x11, 0x9a, 0xf9, +0xbc, 0xfb, 0x85, 0xf0, 0x39, 0xb4, 0x2d, 0x89, 0x8d, 0xa4, 0xb6, 0x92, 0xf8, 0x97, 0xf9, 0xaf, +0x27, 0xf2, 0x3e, 0xd3, 0x84, 0x78, 0xf3, 0x34, 0xe1, 0xea, 0xbc, 0xd8, 0x29, 0x5e, 0x9b, 0xf8, +0xa1, 0x2d, 0x62, 0xfc, 0xfb, 0xa7, 0xe6, 0xad, 0xe7, 0x73, 0xfa, 0x26, 0xb0, 0xd4, 0x61, 0xd5, +0xac, 0xa1, 0xb8, 0xb5, 0x9a, 0x3b, 0x9b, 0x7b, 0x84, 0xdf, 0x14, 0xd1, 0x30, 0x78, 0xdd, 0x4f, +0x20, 0x82, 0x0e, 0x08, 0x3e, 0xbc, 0x8a, 0xbd, 0x9a, 0xfc, 0x1c, 0xfd, 0x9f, 0x3f, 0x6c, 0xdf, +0x89, 0x1f, 0xb3, 0x0d, 0xc7, 0xfc, 0x52, 0x3e, 0x26, 0xbc, 0xb6, 0xd3, 0x98, 0xee, 0x7d, 0x2e, +0xe4, 0x0b, 0x8d, 0x3d, 0xf3, 0xd7, 0xf7, 0x4f, 0xc0, 0x27, 0xbb, 0x26, 0xd6, 0xff, 0x00, 0x6a, +0xbe, 0xd7, 0xf8, 0x2f, 0xff, 0x00, 0x05, 0xdc, 0xd2, 0x6f, 0x21, 0x8e, 0xdf, 0xc7, 0xfe, 0x0b, +0xbe, 0xb3, 0xb8, 0xe0, 0x3d, 0xf6, 0x82, 0xc2, 0x78, 0x5c, 0xfa, 0xf9, 0x12, 0x30, 0x64, 0x1f, +0x49, 0x1c, 0xfe, 0x3c, 0x57, 0xe3, 0x39, 0xb7, 0x87, 0x39, 0xa6, 0x11, 0xb9, 0x61, 0xd2, 0xab, +0x1f, 0x2d, 0x1f, 0xce, 0x2f, 0xf4, 0xb9, 0xfd, 0x31, 0xc3, 0xfe, 0x34, 0x64, 0x39, 0x84, 0x54, +0x31, 0x6d, 0xe1, 0xea, 0x76, 0x96, 0xb1, 0xf9, 0x49, 0x69, 0x6f, 0xf1, 0x28, 0x9f, 0xa1, 0x99, +0xa3, 0x35, 0xe0, 0xbf, 0x0f, 0xff, 0x00, 0xe0, 0xa5, 0x5f, 0x03, 0xfe, 0x24, 0x47, 0x1f, 0xd8, +0xfe, 0x20, 0xe8, 0xf6, 0x12, 0x30, 0xe6, 0x3d, 0x55, 0x64, 0xd3, 0x76, 0x1e, 0xa4, 0x17, 0x9d, +0x55, 0x0f, 0xd4, 0x31, 0x1e, 0xf5, 0xb3, 0xf1, 0xaf, 0xf6, 0xc9, 0xf0, 0x1f, 0xc2, 0x4f, 0x82, +0xba, 0xd7, 0x8c, 0xa1, 0xf1, 0x27, 0x87, 0xb5, 0xc8, 0xb4, 0xcb, 0x62, 0xf6, 0xd6, 0xf6, 0x1a, +0x9c, 0x33, 0x35, 0xfc, 0xe7, 0xe5, 0x8e, 0x24, 0xd8, 0xc7, 0x3b, 0x9c, 0xa8, 0x24, 0x74, 0x19, +0x3d, 0x05, 0x7c, 0x7c, 0xb2, 0xbc, 0x6c, 0x6a, 0xaa, 0x33, 0xa3, 0x25, 0x26, 0xd2, 0x49, 0xa6, +0xb5, 0x7e, 0xa8, 0xfd, 0x1e, 0x9e, 0x7b, 0x96, 0xd4, 0xa1, 0x2c, 0x4d, 0x3a, 0xf0, 0x94, 0x22, +0x9b, 0x6d, 0x49, 0x35, 0x64, 0xae, 0xde, 0x8d, 0x9f, 0x15, 0x7f, 0xc1, 0x71, 0x7f, 0x69, 0x55, +0xd6, 0x3c, 0x51, 0xa2, 0xfc, 0x2c, 0xd2, 0xee, 0x07, 0x93, 0xa4, 0x6d, 0xd5, 0xf5, 0x9d, 0xa7, +0xfe, 0x5b, 0xba, 0x9f, 0x22, 0x23, 0xfe, 0xe4, 0x64, 0xc8, 0x47, 0x4f, 0xde, 0xa1, 0xea, 0xb5, +0xf0, 0x08, 0xad, 0x6f, 0x88, 0x3e, 0x3c, 0xd4, 0x7e, 0x24, 0xf8, 0xd3, 0x55, 0xf1, 0x26, 0xb5, +0x78, 0x97, 0x3a, 0xb6, 0xb9, 0x77, 0x2d, 0xdd, 0xdb, 0x96, 0x01, 0x7c, 0xd9, 0x39, 0x3d, 0xf8, +0x1e, 0xdd, 0x00, 0xe3, 0xa0, 0xae, 0x76, 0x7f, 0x10, 0x69, 0xf6, 0x4b, 0x99, 0x6f, 0xad, 0xe3, +0xe3, 0x85, 0xfb, 0x4a, 0x16, 0x3f, 0xf0, 0x10, 0x73, 0xfa, 0x57, 0xf4, 0xe7, 0x0e, 0xe5, 0x30, +0xca, 0xf2, 0xfa, 0x78, 0x45, 0xba, 0x57, 0x93, 0xef, 0x27, 0xbb, 0xfd, 0x17, 0x95, 0x8f, 0xe1, +0x9e, 0x32, 0xcf, 0xab, 0xe7, 0xf9, 0xcd, 0x6c, 0xc2, 0xcf, 0x96, 0x4e, 0xd1, 0x56, 0x7a, 0x41, +0x7c, 0x2b, 0xc9, 0xdb, 0x57, 0xe6, 0xd9, 0x72, 0x8c, 0xd6, 0x05, 0xf7, 0xc4, 0xad, 0x2e, 0xd1, +0x58, 0x45, 0x25, 0xd5, 0xd4, 0x9d, 0x00, 0x86, 0x22, 0xa9, 0x9f, 0xf7, 0x9f, 0x1f, 0x98, 0x06, +0xb9, 0xed, 0x5b, 0xe2, 0x5d, 0xf5, 0xda, 0x30, 0xb5, 0x8e, 0x1b, 0x08, 0x9b, 0xf8, 0x93, 0xf7, +0x93, 0x7f, 0xdf, 0x4c, 0x30, 0x3e, 0xaa, 0xa0, 0x8f, 0x5a, 0xf5, 0xa5, 0x8a, 0x82, 0x3c, 0xcc, +0x2f, 0x0f, 0xe3, 0x6b, 0x3f, 0x87, 0x95, 0x77, 0x7a, 0x7f, 0xc1, 0x3b, 0x2d, 0x63, 0x5f, 0xb3, +0xd0, 0x62, 0xdd, 0x73, 0x22, 0xc4, 0xc4, 0x65, 0x21, 0x5f, 0x9a, 0x69, 0x7f, 0xdd, 0x5f, 0xea, +0x70, 0x3d, 0xeb, 0x84, 0xf1, 0x27, 0x8d, 0xe7, 0xf1, 0x2e, 0xe8, 0x46, 0x60, 0xb1, 0xcf, 0x16, +0xe8, 0xd9, 0x69, 0x7d, 0x0c, 0x87, 0xbf, 0xae, 0x3a, 0x0f, 0x7e, 0xb5, 0x93, 0x2c, 0xcd, 0x34, +0xb2, 0x49, 0x24, 0xb2, 0x4d, 0x34, 0x87, 0x2f, 0x24, 0x8c, 0x59, 0xdc, 0xfa, 0x92, 0x79, 0x26, +0x92, 0xb8, 0x6a, 0x62, 0x25, 0x3d, 0x36, 0x47, 0xd9, 0x65, 0x9c, 0x3f, 0x43, 0x0a, 0xd4, 0xe5, +0xef, 0x4f, 0xbb, 0x5a, 0x2f, 0x44, 0x19, 0xaf, 0xd3, 0x6f, 0xf8, 0x37, 0x57, 0xf6, 0x70, 0x6d, +0x47, 0x5f, 0xf1, 0xb7, 0xc5, 0x9b, 0xeb, 0x75, 0xf2, 0x6c, 0xd0, 0x78, 0x6b, 0x4a, 0x2d, 0xce, +0x65, 0x6d, 0x93, 0x5d, 0xb8, 0xf4, 0x2a, 0xbe, 0x42, 0x86, 0x1d, 0x7c, 0xd9, 0x47, 0x1c, 0x83, +0xf9, 0xa7, 0xa1, 0xe8, 0x37, 0xbe, 0x29, 0xd7, 0xac, 0xf4, 0xad, 0x32, 0xce, 0x5d, 0x43, 0x51, +0xd4, 0xae, 0xd2, 0xc6, 0xc6, 0xce, 0x31, 0x97, 0x9e, 0xe2, 0x56, 0x0a, 0x88, 0xa3, 0xb9, 0x66, +0x20, 0x01, 0x5f, 0xd1, 0xaf, 0xec, 0x6d, 0xfb, 0x39, 0xd9, 0x7e, 0xc9, 0x9f, 0xb3, 0x67, 0x84, +0x7c, 0x03, 0x66, 0xd1, 0x4d, 0x26, 0x85, 0x64, 0x05, 0xf4, 0xf1, 0xfd, 0xdb, 0xbb, 0xc9, 0x09, +0x92, 0xe2, 0x61, 0xdf, 0x0d, 0x33, 0x39, 0x5c, 0xf2, 0x17, 0x03, 0xb0, 0xaf, 0xce, 0x7c, 0x42, +0xcd, 0x95, 0x0c, 0x02, 0xc2, 0xc5, 0xfb, 0xd5, 0x5f, 0xfe, 0x4a, 0xb5, 0x7f, 0xa2, 0xfb, 0xcf, +0xd9, 0x3c, 0x37, 0xca, 0x5e, 0x23, 0x30, 0x78, 0xc9, 0xaf, 0x76, 0x92, 0xff, 0x00, 0xc9, 0x9e, +0x8b, 0xee, 0x57, 0x7f, 0x75, 0xd1, 0xea, 0xb4, 0x51, 0x45, 0x7e, 0x26, 0x7e, 0xf0, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x7e, 0x0b, 0x7f, 0xc1, 0x60, 0xbf, +0x63, 0xe6, 0xfd, 0x94, 0xbf, 0x6b, 0x1d, 0x42, 0xfb, 0x4d, 0xb3, 0x11, 0x78, 0x43, 0xc7, 0xcd, +0x26, 0xb7, 0xa4, 0x6c, 0x5c, 0x47, 0x04, 0xa5, 0x81, 0xba, 0xb5, 0x1d, 0x87, 0x97, 0x2b, 0x06, +0x00, 0x70, 0x23, 0x9e, 0x21, 0xd8, 0xd7, 0xca, 0x9d, 0xab, 0xfa, 0x16, 0xff, 0x00, 0x82, 0x8d, +0x7e, 0xc7, 0x56, 0x9f, 0xb6, 0xd7, 0xec, 0xcb, 0xaa, 0xf8, 0x59, 0x7c, 0x98, 0x7c, 0x49, 0x64, +0x4e, 0xa3, 0xe1, 0xeb, 0xb7, 0x38, 0xf2, 0x2f, 0x51, 0x4e, 0xd5, 0x63, 0xda, 0x39, 0x41, 0x68, +0x9f, 0xa8, 0x02, 0x4d, 0xd8, 0x25, 0x16, 0xbf, 0x9f, 0x1d, 0x67, 0x47, 0xbc, 0xf0, 0xde, 0xb1, +0x79, 0xa7, 0x6a, 0x36, 0x92, 0xe9, 0xfa, 0x86, 0x9b, 0x2b, 0xd9, 0x5e, 0xd9, 0x4a, 0x85, 0x24, +0x82, 0x74, 0x62, 0xae, 0x8c, 0x0f, 0x46, 0x56, 0x04, 0x11, 0xd8, 0x83, 0x5f, 0xbc, 0x70, 0x4e, +0x7a, 0xb1, 0xf8, 0x15, 0x4a, 0xa3, 0xfd, 0xe5, 0x3b, 0x27, 0xe6, 0xba, 0x3f, 0xd1, 0xf9, 0xaf, +0x33, 0xf9, 0xef, 0x8e, 0xb2, 0x07, 0x97, 0xe3, 0x9d, 0x6a, 0x6b, 0xf7, 0x75, 0x2e, 0xd7, 0x93, +0xdd, 0xaf, 0xd5, 0x79, 0x6d, 0x7b, 0x32, 0xbd, 0x14, 0x51, 0x5f, 0x68, 0x7c, 0x38, 0x54, 0x96, +0x36, 0x92, 0xdf, 0xde, 0x47, 0x6b, 0x02, 0xee, 0xb8, 0x92, 0x41, 0x1c, 0x79, 0xe8, 0x3d, 0xcf, +0xb0, 0x19, 0x27, 0xd0, 0x03, 0x51, 0xd7, 0x63, 0xf0, 0xb7, 0x43, 0xda, 0x24, 0xd4, 0x24, 0x5f, +0x99, 0xf3, 0x6d, 0x1f, 0xa8, 0x03, 0xfd, 0x63, 0x8f, 0xc7, 0x0a, 0x0f, 0xb3, 0x7a, 0xd5, 0x53, +0x87, 0x3c, 0xb9, 0x4f, 0x3f, 0x33, 0xc7, 0x2c, 0x26, 0x1e, 0x55, 0xba, 0xec, 0xbd, 0x5e, 0xdf, +0xe7, 0xf2, 0x3a, 0x7d, 0x1f, 0x4d, 0x87, 0x48, 0xb1, 0x8e, 0xda, 0x35, 0xfd, 0xca, 0xa6, 0xdc, +0x91, 0xf3, 0x3b, 0x75, 0x66, 0x3e, 0xe4, 0x92, 0x7f, 0x1f, 0x4a, 0xb1, 0x45, 0x15, 0xec, 0x46, +0x29, 0x2b, 0x23, 0xf2, 0x59, 0xd4, 0x94, 0xe4, 0xe7, 0x37, 0x76, 0xf5, 0x6f, 0xd4, 0x28, 0xa2, +0x8a, 0xa2, 0x42, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x00, 0x0d, 0xe7, 0x6f, 0x5e, 0xc2, 0xbc, 0xef, 0xe2, 0x17, 0x88, 0x17, 0x5c, 0xd4, +0xc5, 0xac, 0x6e, 0xaf, 0x67, 0x66, 0xe4, 0x06, 0x53, 0x95, 0x9e, 0x5e, 0x8c, 0xfe, 0x84, 0x0e, +0x54, 0x1e, 0x9f, 0x78, 0x8e, 0x1a, 0xb7, 0xbe, 0x20, 0xf8, 0xaf, 0xfb, 0x36, 0xcb, 0xec, 0x76, +0xf2, 0x1f, 0xb6, 0x4c, 0x9f, 0xbc, 0x65, 0x3c, 0xdb, 0x44, 0x7f, 0xf6, 0x66, 0xe8, 0x3d, 0x06, +0x4f, 0x70, 0x6b, 0x85, 0x03, 0x02, 0xbc, 0xfc, 0x55, 0x5b, 0xfb, 0x8b, 0xe6, 0x7d, 0xb7, 0x0b, +0xe5, 0x56, 0xff, 0x00, 0x6c, 0xa8, 0xbf, 0xc3, 0xe9, 0xdf, 0xfc, 0x86, 0xf9, 0x29, 0xfd, 0xd5, +0xfc, 0xa9, 0xc1, 0x71, 0xda, 0x8a, 0x2b, 0x8c, 0xfb, 0x60, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, +0x57, 0x45, 0xf0, 0x83, 0xe1, 0x3e, 0xbd, 0xf1, 0xdb, 0xe2, 0x86, 0x83, 0xe0, 0xdf, 0x0b, 0xda, +0xfd, 0xbb, 0x5c, 0xf1, 0x15, 0xe8, 0xb2, 0xb2, 0x43, 0x90, 0xa0, 0x9e, 0x4b, 0x31, 0x19, 0xc4, +0x71, 0xa8, 0x69, 0x1c, 0xf3, 0x84, 0x52, 0x7b, 0x56, 0x75, 0x2a, 0x46, 0x9c, 0x5c, 0xe6, 0xec, +0x96, 0xad, 0xf6, 0x48, 0xd2, 0x9d, 0x39, 0xd4, 0x9a, 0xa7, 0x05, 0x76, 0xdd, 0x92, 0x5b, 0xb6, +0xf4, 0x47, 0xdb, 0x9f, 0xf0, 0x41, 0x2f, 0xd8, 0xfd, 0xbe, 0x2b, 0x7c, 0x71, 0xbc, 0xf8, 0xab, +0xac, 0x5a, 0xee, 0xf0, 0xf7, 0x80, 0xdb, 0xec, 0xfa, 0x66, 0xf5, 0xca, 0xdd, 0xea, 0xae, 0x9d, +0x7d, 0x0f, 0x91, 0x0b, 0x6f, 0x23, 0xa8, 0x79, 0xa1, 0x20, 0xfc, 0xa6, 0xbf, 0x65, 0xab, 0xce, +0x7f, 0x65, 0xaf, 0xd9, 0xdb, 0x44, 0xfd, 0x94, 0x3e, 0x03, 0xf8, 0x77, 0xc0, 0x3e, 0x1f, 0x1b, +0xac, 0x74, 0x1b, 0x51, 0x14, 0x97, 0x2c, 0xa1, 0x64, 0xbf, 0xb8, 0x63, 0xba, 0x6b, 0x87, 0x19, +0x38, 0x69, 0x24, 0x66, 0x62, 0x33, 0x81, 0x90, 0xa3, 0x80, 0x05, 0x7a, 0x35, 0x7f, 0x39, 0x71, +0x16, 0x70, 0xf3, 0x2c, 0x74, 0xf1, 0x1f, 0x67, 0x68, 0xae, 0xd1, 0x5b, 0x7c, 0xde, 0xec, 0xfe, +0x9a, 0xe1, 0xac, 0x96, 0x39, 0x66, 0x5f, 0x0c, 0x37, 0xda, 0xde, 0x4f, 0xbc, 0x9e, 0xff, 0x00, +0x25, 0xb2, 0xf2, 0x0a, 0x28, 0xa2, 0xbc, 0x43, 0xde, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfc, 0xa5, 0xff, 0x00, 0x82, 0xf0, 0xff, 0x00, 0xc1, 0x3f, +0x1a, 0xc2, 0xf6, 0x4f, 0x8e, 0x7e, 0x11, 0xb3, 0x5f, 0xb2, 0xdc, 0x18, 0xe0, 0xf1, 0x85, 0xa4, +0x43, 0x84, 0x6e, 0x12, 0x2b, 0xf0, 0x3d, 0x1b, 0xe5, 0x8e, 0x5c, 0x77, 0xf2, 0xdf, 0x1c, 0xc8, +0xd5, 0xfa, 0xb5, 0x59, 0xbe, 0x21, 0xd1, 0x2c, 0xfc, 0x51, 0xa3, 0x5e, 0x69, 0xba, 0x8d, 0xad, +0xbd, 0xf6, 0x9b, 0xa8, 0x41, 0x25, 0xad, 0xdd, 0xb4, 0xf1, 0x89, 0x22, 0xb8, 0x89, 0xd4, 0xa3, +0xa3, 0xa9, 0xe0, 0xa9, 0x52, 0x41, 0x07, 0x82, 0x09, 0xaf, 0x53, 0x27, 0xcd, 0xea, 0xe5, 0xb8, +0xb8, 0xe2, 0x69, 0x74, 0xd1, 0xae, 0xeb, 0xaa, 0xff, 0x00, 0x2f, 0x3b, 0x1e, 0x4e, 0x79, 0x93, +0xd1, 0xcc, 0xf0, 0x92, 0xc2, 0xd6, 0xeb, 0xaa, 0x7d, 0x9f, 0x47, 0xfe, 0x7d, 0xd5, 0xd1, 0xfc, +0xbe, 0x83, 0x45, 0x7d, 0x3b, 0xff, 0x00, 0x05, 0x3d, 0xff, 0x00, 0x82, 0x79, 0x6a, 0x1f, 0xb0, +0xbf, 0xc6, 0x1f, 0x3b, 0x4d, 0xb7, 0x9a, 0xf3, 0xe1, 0xdf, 0x89, 0x24, 0x66, 0xd0, 0x6f, 0xdb, +0x2d, 0xf6, 0x26, 0xe5, 0x8d, 0x84, 0xcc, 0x72, 0x7c, 0xd8, 0xd7, 0x95, 0x27, 0xfd, 0x64, 0x63, +0x76, 0x4b, 0x2c, 0x81, 0x3e, 0x62, 0xaf, 0xe8, 0xcc, 0xbf, 0x1d, 0x47, 0x19, 0x42, 0x38, 0x9a, +0x0e, 0xf1, 0x92, 0xfe, 0x93, 0xf3, 0x5d, 0x4f, 0xe6, 0x7c, 0xc7, 0x2f, 0xaf, 0x81, 0xc4, 0x4b, +0x0d, 0x88, 0x56, 0x94, 0x5f, 0xf4, 0xd7, 0x93, 0xe8, 0x3a, 0xd6, 0x07, 0xbb, 0x9e, 0x38, 0x63, +0x5d, 0xd3, 0x3c, 0x8b, 0x0c, 0x60, 0x9e, 0x37, 0x31, 0xc0, 0xcf, 0xe7, 0x5e, 0xaf, 0xa6, 0xd9, +0xa6, 0x9f, 0x61, 0x0d, 0xac, 0x3c, 0x43, 0x14, 0x6b, 0x12, 0x71, 0xc9, 0xc7, 0x52, 0x7d, 0xcf, +0x53, 0xee, 0x4d, 0x70, 0xff, 0x00, 0x0c, 0xf4, 0xd1, 0x79, 0xae, 0x4d, 0x71, 0xb7, 0x74, 0x76, +0x71, 0x65, 0x78, 0xff, 0x00, 0x96, 0x8f, 0x95, 0x5f, 0xfc, 0x77, 0x79, 0xfc, 0xbd, 0xab, 0xbf, +0xaf, 0x6f, 0x07, 0x4f, 0xdd, 0x72, 0x3f, 0x31, 0xe2, 0xcc, 0x63, 0x9d, 0x68, 0xe1, 0xe2, 0xf4, +0x8a, 0xbb, 0xf5, 0x7f, 0xf0, 0x02, 0x8a, 0x28, 0xae, 0xd3, 0xe4, 0xc2, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x03, 0x35, 0x93, 0xe2, 0xff, +0x00, 0x14, 0x47, 0xe1, 0xbb, 0x35, 0x6f, 0x96, 0x5b, 0xbb, 0x80, 0x45, 0xb4, 0x07, 0xff, 0x00, +0x43, 0x6f, 0xf6, 0x47, 0xea, 0x78, 0xf5, 0x21, 0xde, 0x24, 0xf1, 0x4c, 0x3e, 0x19, 0xb7, 0x0c, +0xdb, 0x6e, 0x2e, 0x26, 0x04, 0xdb, 0xda, 0x86, 0xe5, 0xba, 0x8d, 0xcd, 0xe8, 0x80, 0xf7, 0xea, +0x7a, 0x0e, 0xe4, 0x79, 0xbe, 0xa1, 0x7f, 0x36, 0xa9, 0x78, 0xd7, 0x37, 0x33, 0x19, 0xde, 0xe0, +0xe5, 0xdb, 0x18, 0x03, 0x1d, 0x14, 0x0e, 0xc0, 0x74, 0x02, 0xb8, 0xf1, 0x15, 0xed, 0xee, 0xc7, +0x73, 0xe9, 0x32, 0x3c, 0x91, 0xe2, 0x5f, 0xb7, 0xac, 0xbd, 0xc5, 0xf8, 0xff, 0x00, 0xc0, 0x1b, +0x2c, 0xd2, 0x5d, 0xdc, 0x4b, 0x24, 0xf2, 0x34, 0xed, 0x3b, 0x17, 0x92, 0x46, 0xea, 0xec, 0x7a, +0xd3, 0x68, 0xa2, 0xbc, 0xf3, 0xf4, 0x78, 0xc5, 0x25, 0x64, 0x14, 0x51, 0x45, 0x03, 0x0a, 0x28, +0xa3, 0x38, 0xa0, 0x01, 0x9b, 0x68, 0xc9, 0xe2, 0xbf, 0x62, 0xbf, 0xe0, 0x87, 0x3f, 0xf0, 0x4f, +0xa9, 0x3e, 0x07, 0xfc, 0x3c, 0x5f, 0x8b, 0x1e, 0x2d, 0xb3, 0x11, 0x78, 0xbb, 0xc6, 0x16, 0x61, +0x74, 0x8b, 0x59, 0x57, 0xe6, 0xd2, 0x74, 0xd6, 0xc3, 0x06, 0x23, 0xf8, 0x66, 0x9f, 0xe5, 0x63, +0xdd, 0x63, 0x08, 0x3e, 0x52, 0xf2, 0x2d, 0x7c, 0xb1, 0xff, 0x00, 0x04, 0x74, 0xff, 0x00, 0x82, +0x6b, 0xc9, 0xfb, 0x4f, 0xf8, 0xf2, 0x1f, 0x88, 0xde, 0x32, 0xd3, 0x54, 0xfc, 0x39, 0xf0, 0xdd, +0xde, 0xeb, 0x28, 0x26, 0x4f, 0x97, 0xc4, 0x77, 0x88, 0x7f, 0xd5, 0x63, 0xf8, 0xad, 0xe2, 0x60, +0x3c, 0xc2, 0x7e, 0x57, 0x60, 0x23, 0xf9, 0xbf, 0x7a, 0x17, 0xf6, 0xc4, 0x0e, 0x6b, 0xf2, 0x7e, +0x3c, 0xe2, 0x45, 0x2b, 0xe5, 0x98, 0x67, 0xfe, 0x36, 0xbf, 0xf4, 0x9f, 0xf3, 0xfb, 0xbb, 0x9f, +0xb0, 0x78, 0x7b, 0xc2, 0xee, 0x36, 0xcd, 0x71, 0x4b, 0xfc, 0x09, 0xff, 0x00, 0xe9, 0x5f, 0xfc, +0x8f, 0x96, 0xbd, 0x82, 0x8a, 0x28, 0xaf, 0xca, 0xcf, 0xd7, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0e, 0x17, +0xf6, 0x82, 0xf8, 0x07, 0xe1, 0x9f, 0xda, 0x77, 0xe1, 0x36, 0xad, 0xe0, 0xbf, 0x17, 0x58, 0x8b, +0xfd, 0x17, 0x58, 0x8f, 0x0f, 0xb4, 0xed, 0x9a, 0xda, 0x41, 0xca, 0x4d, 0x13, 0x60, 0xec, 0x95, +0x1b, 0x0c, 0xad, 0x83, 0xc8, 0xc1, 0x04, 0x12, 0x0f, 0xe0, 0x47, 0xed, 0xc5, 0xfb, 0x14, 0x78, +0xa3, 0xf6, 0x18, 0xf8, 0xc9, 0x71, 0xe1, 0x9d, 0x79, 0x5e, 0xf3, 0x49, 0xbe, 0xdd, 0x26, 0x83, +0xae, 0x08, 0xf6, 0xdb, 0x6a, 0xd6, 0xc3, 0x1c, 0x81, 0xce, 0xd9, 0x97, 0x20, 0x49, 0x11, 0x39, +0x46, 0x39, 0xe5, 0x19, 0x1d, 0xbf, 0xa3, 0x1a, 0xf3, 0x3f, 0xda, 0x8b, 0xf6, 0x5a, 0xf0, 0x87, +0xed, 0x81, 0xf0, 0x96, 0xf3, 0xc1, 0xbe, 0x34, 0xb1, 0xfb, 0x55, 0x85, 0xc1, 0xf3, 0xad, 0xae, +0x63, 0xc2, 0xdd, 0x69, 0xb7, 0x00, 0x10, 0x97, 0x10, 0x3e, 0x0e, 0xd9, 0x17, 0x24, 0x74, 0x2a, +0xc0, 0xb2, 0xb0, 0x65, 0x2c, 0xa7, 0xea, 0x38, 0x5f, 0x89, 0x6a, 0x65, 0x55, 0xb9, 0x67, 0x79, +0x52, 0x96, 0xeb, 0xb7, 0x9a, 0xf3, 0x5d, 0x7b, 0xa3, 0xe4, 0xf8, 0xb3, 0x85, 0xe9, 0xe6, 0xf4, +0x2f, 0x0f, 0x76, 0xac, 0x7e, 0x17, 0xdf, 0xfb, 0xaf, 0xc9, 0xfe, 0x0f, 0x54, 0x7f, 0x3f, 0x1f, +0x0d, 0xec, 0x05, 0x8f, 0x85, 0xe3, 0x97, 0x6f, 0xef, 0x2e, 0xa6, 0x79, 0xce, 0x7f, 0xba, 0x3e, +0x45, 0x1f, 0xf8, 0xe9, 0x3f, 0xf0, 0x2a, 0xdf, 0xaf, 0x56, 0xfd, 0xab, 0x3f, 0x62, 0x7f, 0x14, +0x7e, 0xc4, 0xfe, 0x31, 0x87, 0x44, 0xd6, 0xe2, 0xfb, 0x7e, 0x8f, 0x24, 0x4d, 0xfd, 0x95, 0xac, +0xdb, 0x29, 0x58, 0x35, 0x48, 0x91, 0x40, 0xe4, 0x73, 0xe5, 0xca, 0x38, 0x2d, 0x19, 0x24, 0xae, +0x78, 0x2c, 0xa5, 0x58, 0xf9, 0x4d, 0x7f, 0x49, 0x65, 0xd8, 0xaa, 0x18, 0x8c, 0x3c, 0x6b, 0x61, +0xe4, 0xa5, 0x16, 0xb4, 0x68, 0xfe, 0x1b, 0xe2, 0x0c, 0x1e, 0x2b, 0x0d, 0x98, 0xd5, 0xa3, 0x8d, +0x83, 0x84, 0xd4, 0x9d, 0xd3, 0xfc, 0x3d, 0x53, 0x56, 0xb3, 0x5a, 0x3d, 0xd6, 0x81, 0x45, 0x14, +0x57, 0x71, 0xe3, 0x85, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x9c, 0x50, 0x01, 0x45, 0x15, 0x1d, +0xd5, 0xd4, 0x3a, 0x7d, 0xb4, 0x93, 0xcc, 0xd1, 0xac, 0x71, 0xfd, 0xf9, 0x64, 0x60, 0xaa, 0xbf, +0x8f, 0xaf, 0xb7, 0x53, 0xda, 0x93, 0x76, 0x1c, 0x62, 0xdb, 0xb2, 0x24, 0xcd, 0x60, 0xf8, 0xc3, +0xc6, 0xd1, 0x68, 0x29, 0x24, 0x30, 0xaa, 0xcd, 0xa8, 0xf4, 0xd9, 0xd6, 0x3b, 0x6f, 0x77, 0xf7, +0xff, 0x00, 0x67, 0xaf, 0xae, 0x3b, 0xe2, 0xf8, 0x8f, 0xe2, 0x34, 0x97, 0x7b, 0xe1, 0xd3, 0xfc, +0xc4, 0x5e, 0x43, 0xcc, 0xc3, 0x6c, 0xd2, 0x7f, 0xb8, 0x3f, 0x80, 0x63, 0xbf, 0xde, 0xff, 0x00, +0x76, 0xb9, 0x70, 0x3f, 0x3e, 0xa7, 0x3d, 0xcd, 0x70, 0xd6, 0xc5, 0x5f, 0x48, 0x7d, 0xe7, 0xd8, +0xe5, 0x3c, 0x32, 0xe5, 0x6a, 0xd8, 0xcd, 0x17, 0x48, 0xff, 0x00, 0x9f, 0x6f, 0x4f, 0xbf, 0xa0, +0xfb, 0xbb, 0xd9, 0x2f, 0xef, 0x26, 0x9a, 0x76, 0x92, 0xe6, 0x49, 0x8e, 0xe9, 0x24, 0x6e, 0xad, +0xff, 0x00, 0xd6, 0x1d, 0x00, 0x1c, 0x00, 0x30, 0x29, 0x94, 0x51, 0x5c, 0x47, 0xdc, 0xc6, 0x29, +0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x61, 0x45, 0x14, 0x50, 0x01, 0x9a, 0xfa, 0x63, 0xfe, 0x09, +0xa7, 0xff, 0x00, 0x04, 0xe4, 0xd6, 0xbf, 0x6f, 0x1f, 0x89, 0xbe, 0x75, 0xe7, 0xda, 0x34, 0xbf, +0x87, 0x7a, 0x0c, 0x83, 0xfb, 0x73, 0x54, 0x45, 0xda, 0xd2, 0xb7, 0x04, 0x59, 0xdb, 0x92, 0x30, +0x67, 0x60, 0x79, 0x38, 0x22, 0x24, 0x21, 0x8f, 0x26, 0x35, 0x90, 0xff, 0x00, 0x82, 0x73, 0x7f, +0xc1, 0x35, 0x3c, 0x4d, 0xfb, 0x78, 0x78, 0xd7, 0xed, 0x92, 0x79, 0xda, 0x0f, 0xc3, 0xbd, 0x2e, +0x60, 0xba, 0xa6, 0xb8, 0x07, 0xcd, 0x31, 0x18, 0x26, 0xd6, 0xd7, 0x20, 0x89, 0x27, 0x23, 0x19, +0x27, 0xe5, 0x88, 0x1d, 0xcd, 0x93, 0xb2, 0x39, 0x3f, 0x74, 0x7e, 0x10, 0x7c, 0x20, 0xf0, 0xef, +0xc0, 0x6f, 0x87, 0x1a, 0x4f, 0x84, 0xbc, 0x25, 0xa4, 0xdb, 0x68, 0xbe, 0x1f, 0xd1, 0x61, 0xf2, +0x6c, 0xed, 0x21, 0x07, 0x08, 0x32, 0x59, 0x99, 0x98, 0x92, 0x5d, 0xd9, 0x89, 0x66, 0x76, 0x25, +0x99, 0x99, 0x98, 0x92, 0x49, 0x35, 0xf9, 0xef, 0x17, 0xf1, 0x84, 0x70, 0x71, 0x78, 0x3c, 0x1b, +0xbd, 0x57, 0xbb, 0xfe, 0x5f, 0xfe, 0xdb, 0xf2, 0xdd, 0x9f, 0xa3, 0xf0, 0x5f, 0x05, 0xcb, 0x1b, +0x25, 0x8d, 0xc6, 0xab, 0x52, 0x5a, 0xa4, 0xfe, 0xdf, 0xff, 0x00, 0x6b, 0xf9, 0xec, 0x5e, 0xf0, +0x07, 0x80, 0xb4, 0x8f, 0x85, 0x9e, 0x0c, 0xd3, 0x3c, 0x3d, 0xe1, 0xfd, 0x3e, 0xdf, 0x49, 0xd1, +0x74, 0x6b, 0x74, 0xb3, 0xb1, 0xb3, 0x81, 0x76, 0xc7, 0x6f, 0x12, 0x00, 0x15, 0x47, 0x52, 0x7a, +0x75, 0x24, 0x92, 0x49, 0x27, 0x24, 0x93, 0x5b, 0xb4, 0x51, 0x5f, 0x8a, 0xea, 0xdd, 0xde, 0xe7, +0xee, 0xb1, 0x49, 0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x0e, 0x4f, 0xe2, 0xdf, 0xc1, 0xff, 0x00, 0x0e, 0x7c, 0x78, 0xf0, 0x1d, 0xe7, 0x86, 0xfc, +0x55, 0xa5, 0xdb, 0x6a, 0xda, 0x35, 0xf0, 0xf9, 0xe2, 0x94, 0x7c, 0xd1, 0x9c, 0x70, 0xe8, 0xc3, +0x06, 0x37, 0x19, 0x38, 0x65, 0x20, 0x8c, 0xf5, 0xaf, 0xc8, 0xdf, 0xdb, 0x9f, 0xfe, 0x09, 0xb5, +0xe2, 0x8f, 0xd9, 0x17, 0x52, 0xba, 0xd6, 0x34, 0xcf, 0x37, 0xc4, 0x3e, 0x01, 0x95, 0xc7, 0x93, +0xa9, 0xec, 0xfd, 0xfd, 0x86, 0x7a, 0x47, 0x72, 0x07, 0xdc, 0xf4, 0xf3, 0x06, 0x11, 0xb8, 0xfb, +0x8c, 0x42, 0x0f, 0xd9, 0xea, 0xa5, 0xa8, 0x69, 0xd1, 0x6a, 0xd6, 0x93, 0x5b, 0x5c, 0x43, 0x1d, +0xc5, 0xad, 0xc2, 0x18, 0xa5, 0x8a, 0x55, 0x0d, 0x1c, 0xa8, 0xc3, 0x05, 0x4a, 0x9e, 0x08, 0x20, +0xf4, 0x3d, 0x6b, 0xe9, 0x38, 0x73, 0x8a, 0x31, 0x79, 0x3d, 0x5b, 0xd2, 0x7c, 0xd4, 0xdf, 0xc5, +0x17, 0xb3, 0xf3, 0x5d, 0x9f, 0x9a, 0xf9, 0xdc, 0xf8, 0x9e, 0x34, 0xe0, 0x3c, 0xbb, 0x88, 0xe8, +0x72, 0xe2, 0x17, 0x2d, 0x58, 0xfc, 0x35, 0x16, 0xeb, 0xc9, 0xf7, 0x8f, 0x93, 0xf9, 0x59, 0x9f, +0xce, 0xc0, 0x39, 0xa2, 0xbf, 0x47, 0xbf, 0x6e, 0xdf, 0xf8, 0x23, 0x8a, 0x6a, 0x1f, 0x6b, 0xf1, +0x57, 0xc1, 0xcb, 0x58, 0x61, 0xbd, 0x62, 0x67, 0xba, 0xf0, 0xcc, 0x93, 0xac, 0x51, 0xcc, 0x7a, +0x9f, 0xb1, 0xc8, 0xe4, 0x2a, 0x37, 0x5f, 0xdd, 0x48, 0xc1, 0x39, 0xf9, 0x5d, 0x00, 0x0a, 0x7f, +0x37, 0x75, 0xb9, 0x9b, 0xc2, 0x7e, 0x27, 0xbc, 0xd1, 0x75, 0xa8, 0x6f, 0x74, 0x1d, 0x7b, 0x4f, +0x7f, 0x2e, 0xf7, 0x4c, 0xd5, 0x23, 0x6b, 0x3b, 0x88, 0x5b, 0xd1, 0x96, 0x40, 0x30, 0x70, 0x41, +0xea, 0x72, 0x0d, 0x7f, 0x41, 0xe4, 0x9c, 0x4d, 0x81, 0xcd, 0x69, 0x73, 0xe1, 0xa7, 0xef, 0x75, +0x8b, 0xd1, 0xaf, 0x97, 0x6f, 0x35, 0xa1, 0xfc, 0x7f, 0xc4, 0xfc, 0x07, 0x9c, 0x64, 0x55, 0x9c, +0x31, 0x74, 0x9b, 0x87, 0x49, 0xc6, 0xee, 0x2f, 0xe7, 0xd1, 0xf9, 0x3b, 0x3e, 0xd7, 0x24, 0xcd, +0x14, 0x44, 0xdb, 0x51, 0x5d, 0x79, 0x56, 0x19, 0x04, 0x74, 0x3f, 0x8d, 0x19, 0xc5, 0x7d, 0x09, +0xf1, 0xa1, 0x45, 0x19, 0xa3, 0x34, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x46, 0x68, 0xcd, 0x00, +0x14, 0x50, 0x73, 0x8c, 0xf6, 0xee, 0x7d, 0x2b, 0x37, 0x51, 0xf1, 0x8e, 0x99, 0xa6, 0x1d, 0xb3, +0x5c, 0xdb, 0xbc, 0x83, 0x83, 0x1c, 0x07, 0xce, 0x7c, 0xfa, 0x61, 0x72, 0x07, 0xfc, 0x08, 0x8a, +0x99, 0x4d, 0x47, 0x56, 0x6b, 0x46, 0x85, 0x4a, 0xaf, 0x96, 0x94, 0x5b, 0x7e, 0x49, 0xb3, 0x4a, +0x9a, 0xcd, 0xe4, 0x87, 0x63, 0x22, 0xc5, 0x1c, 0x63, 0x2c, 0xec, 0xdb, 0x55, 0x47, 0xb9, 0xe9, +0x5c, 0x6e, 0xab, 0xf1, 0x4d, 0xe4, 0xdd, 0xf6, 0x2b, 0x3f, 0x2f, 0xb7, 0x9b, 0x29, 0xcb, 0x0f, +0xf8, 0x02, 0x9c, 0x67, 0xfe, 0x04, 0x7e, 0x95, 0xcd, 0xea, 0x7a, 0xad, 0xe6, 0xb6, 0x73, 0x75, +0x71, 0x3c, 0x98, 0x39, 0x54, 0x63, 0x88, 0xd7, 0xe8, 0xa3, 0x81, 0xf5, 0xc5, 0x72, 0xd4, 0xc5, +0x45, 0x7c, 0x3a, 0x9f, 0x43, 0x83, 0xe1, 0x7c, 0x55, 0x5f, 0x7a, 0xb7, 0xb8, 0xbf, 0x1f, 0xbb, +0xfe, 0x09, 0xd9, 0xeb, 0x9f, 0x13, 0x2d, 0x6c, 0x83, 0x2d, 0x8c, 0x7f, 0x6c, 0x91, 0x78, 0xf3, +0x0e, 0x55, 0x10, 0xfd, 0x7a, 0xb7, 0xe1, 0x80, 0x7b, 0x35, 0x71, 0xba, 0xd6, 0xb3, 0x77, 0xad, +0xdc, 0x09, 0x2e, 0xa6, 0x92, 0x7d, 0xa4, 0x94, 0x8f, 0xee, 0xc7, 0x17, 0xfb, 0xab, 0xd0, 0x7f, +0x33, 0xdc, 0x9a, 0xac, 0x3a, 0x51, 0x5c, 0x75, 0x2a, 0x4a, 0x5b, 0x9f, 0x65, 0x81, 0xc9, 0xf0, +0xd8, 0x45, 0xfb, 0xb5, 0xef, 0x77, 0x7b, 0xff, 0x00, 0xc0, 0x0a, 0x28, 0xa2, 0xb3, 0x3d, 0x40, +0xa2, 0x8a, 0x33, 0x40, 0x05, 0x14, 0x57, 0x45, 0xf0, 0xa7, 0xe1, 0x17, 0x89, 0xfe, 0x39, 0xf8, +0xea, 0xd3, 0xc3, 0x5e, 0x0d, 0xd0, 0x75, 0x4f, 0x11, 0x6b, 0x97, 0xdc, 0xa5, 0x95, 0x8a, 0x6e, +0x60, 0x01, 0x00, 0xb3, 0x1e, 0x15, 0x22, 0x19, 0x19, 0x91, 0x88, 0x51, 0x9e, 0x48, 0xac, 0xea, +0x54, 0x85, 0x38, 0xb9, 0xcd, 0xd9, 0x2d, 0xdb, 0xd1, 0x23, 0x4a, 0x74, 0xa7, 0x52, 0x6a, 0x14, +0xd3, 0x6d, 0xec, 0x92, 0xbb, 0x7e, 0x89, 0x1c, 0xe9, 0x6d, 0xa3, 0xe9, 0x5f, 0x70, 0x7f, 0xc1, +0x36, 0x3f, 0xe0, 0x8e, 0x9a, 0xf7, 0xed, 0x43, 0x36, 0x9f, 0xe3, 0x3f, 0x88, 0x90, 0xea, 0x1e, +0x18, 0xf8, 0x73, 0xb5, 0x67, 0x82, 0xd8, 0x9f, 0x2f, 0x50, 0xf1, 0x22, 0x9e, 0x9e, 0x57, 0x78, +0x2d, 0xcf, 0x53, 0x36, 0x37, 0x3a, 0x91, 0xe5, 0x8f, 0x98, 0x4a, 0x9f, 0x54, 0x7f, 0xc1, 0x3e, +0xff, 0x00, 0xe0, 0x86, 0xfe, 0x1f, 0xf8, 0x2b, 0x35, 0x9f, 0x8a, 0xbe, 0x2c, 0x7f, 0x66, 0xf8, +0xbb, 0xc5, 0x51, 0x85, 0x92, 0xd7, 0x46, 0x54, 0xf3, 0x34, 0x8d, 0x29, 0xba, 0xfe, 0xf0, 0x37, +0xfc, 0x7d, 0x4c, 0x3d, 0x58, 0x08, 0xd4, 0x9e, 0x15, 0xc8, 0x12, 0x57, 0xe8, 0x60, 0xaf, 0xca, +0xf8, 0x93, 0x8f, 0x53, 0x4f, 0x0d, 0x96, 0x3f, 0x27, 0x3f, 0xfe, 0x47, 0xfc, 0xfe, 0xee, 0xe7, +0xeb, 0x9c, 0x2f, 0xe1, 0xef, 0x2b, 0x58, 0xac, 0xd5, 0x79, 0xa8, 0x7f, 0xf2, 0x4f, 0xf4, 0x5f, +0x3e, 0xc6, 0x0f, 0x80, 0x7e, 0x1f, 0xe8, 0xbf, 0x0b, 0x3c, 0x23, 0x61, 0xe1, 0xff, 0x00, 0x0e, +0xe9, 0x96, 0x7a, 0x3e, 0x87, 0xa4, 0xc2, 0x20, 0xb2, 0xb1, 0xb4, 0x8c, 0x47, 0x0d, 0xbc, 0x63, +0x3c, 0x2a, 0x8f, 0x52, 0x49, 0x27, 0xa9, 0x24, 0x92, 0x49, 0x24, 0xd6, 0xf5, 0x14, 0x57, 0xe5, +0x7a, 0xb7, 0x77, 0xb9, 0xfa, 0xe2, 0x49, 0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0xbc, 0x5f, +0xf6, 0xb0, 0xfd, 0x83, 0xfe, 0x1a, 0xfe, 0xda, 0x5e, 0x1d, 0x5b, 0x3f, 0x1b, 0x68, 0x4b, 0x26, +0xa1, 0x04, 0x46, 0x3b, 0x2d, 0x66, 0xc4, 0x8b, 0x7d, 0x53, 0x4f, 0x1c, 0xff, 0x00, 0xab, 0x9b, +0x07, 0x2a, 0x09, 0x27, 0xcb, 0x90, 0x3c, 0x64, 0xf2, 0x50, 0x91, 0x5e, 0xd1, 0x45, 0x6b, 0x42, +0xbd, 0x5a, 0x35, 0x15, 0x5a, 0x32, 0x71, 0x92, 0xd9, 0xad, 0x19, 0x8e, 0x23, 0x0f, 0x4a, 0xbd, +0x37, 0x4a, 0xb4, 0x54, 0xa2, 0xf7, 0x4d, 0x5d, 0x1f, 0x87, 0xff, 0x00, 0xb5, 0xa7, 0xfc, 0x11, +0x3f, 0xe2, 0xd7, 0xec, 0xcf, 0x25, 0xd6, 0xad, 0xe0, 0x76, 0xba, 0xf8, 0x8d, 0xe1, 0x75, 0x25, +0xf7, 0xe9, 0x11, 0xb4, 0x3a, 0xb5, 0xaa, 0xf0, 0x7f, 0x7b, 0x6a, 0xac, 0x4c, 0x83, 0xb6, 0x61, +0x32, 0x13, 0x82, 0x4a, 0x20, 0xe2, 0xbe, 0x45, 0x8f, 0xc7, 0x7a, 0xc6, 0x99, 0x70, 0xd6, 0xf2, +0x4d, 0xfb, 0xe8, 0x9b, 0x63, 0xc7, 0x71, 0x6e, 0x8c, 0xc8, 0x54, 0xe0, 0x83, 0xc0, 0x6c, 0xe7, +0x83, 0x93, 0x9e, 0x2b, 0xfa, 0x7a, 0xaf, 0x0b, 0xfd, 0xa8, 0xbf, 0xe0, 0x9d, 0x9f, 0x08, 0xff, +0x00, 0x6c, 0x0b, 0x69, 0x64, 0xf1, 0x87, 0x85, 0xad, 0xff, 0x00, 0xb6, 0xd9, 0x42, 0x26, 0xb9, +0xa7, 0x1f, 0xb1, 0xea, 0x91, 0xe0, 0x60, 0x66, 0x65, 0x1f, 0xbd, 0x00, 0x74, 0x59, 0x43, 0xa8, +0xcf, 0x4c, 0xf3, 0x5f, 0xa4, 0x64, 0xde, 0x23, 0xd6, 0xa5, 0x6a, 0x79, 0x84, 0x79, 0x97, 0xf3, +0x47, 0x47, 0xf3, 0x5b, 0x3f, 0x95, 0x8f, 0xca, 0x78, 0x83, 0xc2, 0x8c, 0x16, 0x29, 0xba, 0xb8, +0x1b, 0x27, 0xfc, 0xb2, 0x57, 0x5f, 0x27, 0x67, 0x25, 0xf8, 0x9f, 0x80, 0x90, 0x7c, 0x53, 0xbc, +0x8c, 0x01, 0x25, 0x9d, 0xbc, 0xde, 0xa5, 0x3c, 0xc8, 0xc9, 0xfc, 0xd8, 0xff, 0x00, 0x9e, 0xd5, +0x3c, 0x5f, 0x16, 0x5c, 0x75, 0xd2, 0xd1, 0x86, 0x31, 0xc4, 0xe4, 0x7f, 0xec, 0xa6, 0xbe, 0xe6, +0xfd, 0xa3, 0xbf, 0xe0, 0xde, 0x5f, 0x1b, 0x78, 0x45, 0xae, 0xaf, 0xbe, 0x17, 0x78, 0xa3, 0x4d, +0xf1, 0x75, 0x8a, 0x82, 0xc9, 0xa6, 0x6a, 0xdb, 0x74, 0xfd, 0x47, 0x1d, 0x94, 0x4b, 0xcc, 0x13, +0x37, 0xfb, 0x4c, 0x61, 0x1e, 0xdc, 0x73, 0xf0, 0xff, 0x00, 0xc6, 0x5f, 0xd9, 0xd7, 0xc7, 0xbf, +0xb3, 0xc6, 0xab, 0xf6, 0x4f, 0x1d, 0x78, 0x37, 0x5e, 0xf0, 0xa3, 0x6f, 0xd8, 0xad, 0xa8, 0x58, +0xb2, 0xdb, 0x4a, 0x7f, 0xe9, 0x94, 0xdf, 0xea, 0xa5, 0xef, 0xfe, 0xad, 0x88, 0xe2, 0xbf, 0x4c, +0xcb, 0x78, 0x9b, 0x07, 0x8d, 0x5f, 0xec, 0xd5, 0x93, 0x7d, 0x9e, 0x8f, 0xee, 0x7a, 0xfe, 0x87, +0xe4, 0x39, 0xaf, 0x87, 0xb2, 0xc1, 0x3f, 0xf6, 0xac, 0x2b, 0x4b, 0xba, 0xbf, 0x2f, 0xde, 0x9d, +0xbe, 0xfd, 0x7f, 0x10, 0xff, 0x00, 0x85, 0xb9, 0x1f, 0xfd, 0x03, 0x26, 0xff, 0x00, 0xbf, 0xa3, +0xff, 0x00, 0x88, 0xa8, 0xe6, 0xf8, 0xb4, 0xce, 0x7f, 0xe4, 0x1e, 0xab, 0xfe, 0xfd, 0xc6, 0x73, +0xf8, 0x6d, 0xe2, 0xb9, 0x10, 0xd9, 0x14, 0x67, 0x15, 0xec, 0xfd, 0x62, 0xa7, 0x73, 0xc1, 0x5c, +0x39, 0x97, 0xf5, 0x85, 0xfe, 0x72, 0xff, 0x00, 0x33, 0xa6, 0x9f, 0xe2, 0xad, 0xdb, 0xa3, 0x08, +0xed, 0xed, 0xe1, 0xdd, 0xff, 0x00, 0x3d, 0x0b, 0xc9, 0x8f, 0xc8, 0xaf, 0x35, 0x4a, 0xeb, 0xe2, +0x0e, 0xaf, 0x71, 0x9d, 0xb7, 0x31, 0xc6, 0x84, 0xf2, 0xb0, 0x40, 0x83, 0xf5, 0x60, 0x5b, 0xf5, +0xac, 0x6a, 0x33, 0x52, 0xea, 0xcd, 0xf5, 0x3a, 0x69, 0xe4, 0xd8, 0x28, 0x3b, 0xaa, 0x4b, 0xee, +0xbf, 0xe7, 0x72, 0x5b, 0xed, 0x46, 0xe3, 0x53, 0xff, 0x00, 0x8f, 0xab, 0xab, 0xc9, 0xb9, 0xe9, +0x34, 0xc6, 0x41, 0xf8, 0x03, 0xc0, 0xa8, 0x80, 0xc0, 0xa2, 0x8a, 0xcc, 0xf4, 0x63, 0x08, 0xc5, +0x5a, 0x2a, 0xcb, 0xc8, 0x28, 0xa2, 0x8a, 0x0a, 0x0a, 0x28, 0xcd, 0x14, 0x00, 0x51, 0x9c, 0x52, +0x33, 0x05, 0x1c, 0xf1, 0x5e, 0x91, 0xf0, 0x23, 0xf6, 0x3e, 0xf8, 0xa1, 0xfb, 0x4e, 0x5c, 0xa2, +0x78, 0x13, 0xc0, 0x7a, 0xe7, 0x88, 0x2d, 0x5c, 0xed, 0xfb, 0x7a, 0x5a, 0xf9, 0x56, 0x20, 0xfb, +0xdc, 0xcc, 0x56, 0x10, 0x7d, 0x8b, 0xe7, 0x83, 0xd6, 0xb1, 0xaf, 0x88, 0xa5, 0x46, 0x3c, 0xf5, +0xa4, 0xa2, 0xbb, 0xb6, 0x92, 0xfc, 0x4d, 0xb0, 0xf8, 0x6a, 0xd5, 0xe6, 0xa9, 0xd0, 0x8b, 0x93, +0xec, 0x93, 0x6f, 0xee, 0x47, 0x9c, 0x1a, 0xb1, 0xa1, 0xe8, 0x97, 0xde, 0x26, 0xd6, 0x2d, 0x74, +0xdd, 0x2e, 0xce, 0xe3, 0x52, 0xd4, 0x2f, 0xdc, 0x47, 0x67, 0x63, 0x63, 0x13, 0x5d, 0x5d, 0x4c, +0xe7, 0xf8, 0x51, 0x14, 0x16, 0x66, 0x3d, 0x80, 0x19, 0x35, 0xfa, 0x53, 0xfb, 0x36, 0x7f, 0xc1, +0xba, 0xfa, 0xa6, 0xa6, 0xf6, 0xf7, 0xdf, 0x16, 0x3c, 0x69, 0x0e, 0x9f, 0x06, 0x03, 0x1d, 0x2b, +0xc3, 0xa3, 0xcf, 0xb8, 0x6c, 0xf3, 0x86, 0xba, 0x95, 0x7c, 0xb8, 0xc8, 0xe8, 0x42, 0x44, 0xf9, +0xcf, 0x0e, 0x3a, 0x9f, 0xd0, 0xbf, 0xd9, 0xc3, 0xf6, 0x2f, 0xf8, 0x67, 0xfb, 0x25, 0x69, 0x0d, +0x6b, 0xe0, 0x2f, 0x08, 0xe9, 0x7a, 0x1c, 0xf2, 0x26, 0xc9, 0xaf, 0xf6, 0x9b, 0x8d, 0x42, 0xe8, +0x70, 0x71, 0x25, 0xc4, 0x84, 0xc8, 0xc3, 0x23, 0x3b, 0x37, 0x04, 0x07, 0xa0, 0x02, 0xbe, 0x1f, +0x35, 0xf1, 0x07, 0x01, 0x87, 0x4e, 0x38, 0x5f, 0xde, 0x4b, 0xcb, 0x48, 0xfd, 0xef, 0xf4, 0x4f, +0xd5, 0x1f, 0x7d, 0x94, 0xf8, 0x6f, 0x98, 0x62, 0x5a, 0x9e, 0x31, 0xfb, 0x28, 0xfd, 0xf2, 0xfb, +0x96, 0xdf, 0x37, 0xf2, 0x67, 0xe5, 0xef, 0xec, 0x7d, 0xff, 0x00, 0x04, 0x14, 0xf1, 0xd7, 0xc5, +0x89, 0x2d, 0x35, 0x6f, 0x8a, 0x57, 0x92, 0x78, 0x03, 0xc3, 0xad, 0xb5, 0xff, 0x00, 0xb3, 0x60, +0xd9, 0x2e, 0xb5, 0x78, 0xa7, 0x9e, 0x47, 0x31, 0x5b, 0x67, 0xd6, 0x4d, 0xee, 0x08, 0xc1, 0x8c, +0x75, 0xaf, 0xd5, 0x2f, 0xd9, 0xdb, 0xf6, 0x56, 0xf0, 0x0f, 0xec, 0xa1, 0xe0, 0xbf, 0xec, 0x1f, +0x00, 0xf8, 0x73, 0x4f, 0xd0, 0x6c, 0xe4, 0xc1, 0xba, 0x96, 0x35, 0x32, 0x5d, 0x5f, 0xb8, 0xce, +0x1e, 0x79, 0x9b, 0x2f, 0x2b, 0x72, 0x71, 0xb8, 0x90, 0xa3, 0x85, 0x00, 0x60, 0x57, 0xa4, 0x51, +0x5f, 0x96, 0xe7, 0x1c, 0x45, 0x8e, 0xcc, 0x9f, 0xfb, 0x44, 0xfd, 0xde, 0x91, 0x5a, 0x2f, 0xbb, +0xab, 0xf3, 0x67, 0xeb, 0x59, 0x2f, 0x0d, 0x65, 0xf9, 0x5c, 0x7f, 0xd9, 0xa1, 0xef, 0x75, 0x93, +0xd6, 0x4f, 0xe7, 0xd1, 0x79, 0x2b, 0x20, 0xa2, 0x8a, 0x2b, 0xc3, 0x3d, 0xe0, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xaa, 0xba, 0xa6, +0x99, 0x06, 0xb3, 0x63, 0x25, 0xad, 0xdc, 0x10, 0xdd, 0x5a, 0xdc, 0x2e, 0xc9, 0x61, 0x96, 0x31, +0x24, 0x72, 0x29, 0xea, 0x19, 0x4f, 0x04, 0x7d, 0x6a, 0xd5, 0x14, 0x80, 0xf9, 0x9f, 0xe3, 0x07, +0xfc, 0x12, 0x3b, 0xf6, 0x7d, 0xf8, 0xce, 0xf3, 0x4d, 0x79, 0xf0, 0xf3, 0x4c, 0xd0, 0xef, 0xa4, +0x1f, 0xf1, 0xf5, 0xe1, 0xf6, 0x7d, 0x29, 0x94, 0xf1, 0x93, 0xe5, 0xc2, 0x56, 0x16, 0x3c, 0x75, +0x78, 0xcf, 0x52, 0x7a, 0x92, 0x6b, 0xe6, 0x7f, 0x89, 0xbf, 0xf0, 0x6d, 0xf7, 0x85, 0xef, 0x99, +0xe4, 0xf0, 0x6f, 0xc4, 0xef, 0x10, 0x69, 0x39, 0xe5, 0x63, 0xd6, 0xf4, 0xd8, 0x75, 0x1d, 0xc7, +0x1f, 0x77, 0x7c, 0x46, 0x0c, 0x0c, 0xf7, 0xda, 0xd8, 0x1d, 0x89, 0xe6, 0xbf, 0x4c, 0x28, 0xc5, +0x7b, 0x78, 0x3e, 0x23, 0xcd, 0x30, 0xda, 0x51, 0xaf, 0x2b, 0x76, 0x7a, 0xaf, 0xb9, 0xdc, 0xf0, +0xf1, 0xbc, 0x33, 0x95, 0x62, 0xdd, 0xeb, 0xd0, 0x8d, 0xfb, 0xa5, 0x67, 0xf7, 0xab, 0x33, 0xf1, +0x67, 0xc6, 0xdf, 0xf0, 0x6f, 0x47, 0xc6, 0xaf, 0x0e, 0x34, 0x92, 0x68, 0xfa, 0xf7, 0xc3, 0xdf, +0x10, 0x5b, 0x29, 0x1b, 0x40, 0xbe, 0xb8, 0xb5, 0xba, 0x6f, 0x7d, 0xb2, 0x42, 0x63, 0x1f, 0xf7, +0xf2, 0xbc, 0xbb, 0xc4, 0x7f, 0xf0, 0x46, 0x9f, 0xda, 0x53, 0xc3, 0x0f, 0x3b, 0x3f, 0xc3, 0x57, +0xbf, 0xb7, 0x4f, 0xe3, 0xb1, 0xd5, 0xf4, 0xf9, 0xf7, 0xfd, 0x17, 0xcf, 0xf3, 0x3f, 0xf1, 0xda, +0xfd, 0xf7, 0xa2, 0xbd, 0xfa, 0x3e, 0x21, 0x66, 0xb0, 0x56, 0x9f, 0x2c, 0xbd, 0x63, 0xfe, 0x4d, +0x1f, 0x3b, 0x5b, 0xc3, 0x7c, 0xa2, 0x7f, 0x07, 0x3c, 0x7d, 0x25, 0xfe, 0x69, 0x9f, 0xce, 0xce, +0xa5, 0xff, 0x00, 0x04, 0xd5, 0xf8, 0xfd, 0xa4, 0x03, 0xe7, 0x7c, 0x21, 0xf1, 0xa3, 0x60, 0xe3, +0xf7, 0x76, 0x1f, 0x68, 0xff, 0x00, 0xd1, 0x79, 0xaa, 0x3f, 0xf0, 0xef, 0x5f, 0x8f, 0x1f, 0xf4, +0x48, 0xfe, 0x22, 0x7f, 0xe0, 0x8e, 0x7f, 0xfe, 0x22, 0xbf, 0xa3, 0x4a, 0x2b, 0xb6, 0x3e, 0x24, +0x63, 0x7a, 0xd2, 0x87, 0xe3, 0xfe, 0x67, 0x0c, 0xbc, 0x2f, 0xcb, 0xfa, 0x55, 0x9f, 0xe1, 0xfe, +0x47, 0xf3, 0xb9, 0xa6, 0xff, 0x00, 0xc1, 0x33, 0xff, 0x00, 0x68, 0x1d, 0x56, 0x35, 0x68, 0x7e, +0x11, 0xf8, 0xc4, 0x6e, 0xe9, 0xe6, 0x59, 0x8b, 0x6f, 0xcf, 0xcc, 0x23, 0x15, 0xda, 0xf8, 0x6f, +0xfe, 0x08, 0xaf, 0xfb, 0x49, 0xf8, 0x8a, 0x58, 0x55, 0xfe, 0x1f, 0x2e, 0x97, 0x6e, 0xc3, 0x3e, +0x65, 0xfe, 0xbd, 0xa7, 0x85, 0x1f, 0x50, 0x93, 0x34, 0x83, 0xfe, 0xf8, 0xaf, 0xde, 0xea, 0x2b, +0x1a, 0x9e, 0x23, 0x66, 0x2f, 0xe0, 0x84, 0x17, 0xc9, 0xbf, 0xfd, 0xb8, 0xda, 0x9f, 0x86, 0x39, +0x62, 0xf8, 0xea, 0x4d, 0xfc, 0xd2, 0xff, 0x00, 0xdb, 0x6f, 0xf8, 0x9f, 0x8c, 0xbe, 0x05, 0xff, +0x00, 0x83, 0x77, 0x3e, 0x2f, 0x6b, 0x2d, 0x1c, 0x9a, 0xff, 0x00, 0x8a, 0xbe, 0x1f, 0xe8, 0x31, +0x48, 0x32, 0x7c, 0x99, 0xee, 0x6f, 0xee, 0x63, 0xf6, 0x2b, 0xe5, 0x22, 0x7e, 0x52, 0x1a, 0xf7, +0xaf, 0x86, 0x3f, 0xf0, 0x6e, 0x37, 0x80, 0xb4, 0x56, 0x59, 0x3c, 0x61, 0xf1, 0x07, 0xc5, 0x5e, +0x22, 0x74, 0x39, 0xd9, 0xa6, 0x59, 0xc1, 0xa4, 0xc6, 0xfc, 0xf4, 0x21, 0xbc, 0xf6, 0xc6, 0x38, +0xf9, 0x58, 0x1f, 0x71, 0xd2, 0xbf, 0x48, 0x28, 0xaf, 0x27, 0x15, 0xc6, 0xb9, 0xc5, 0x6d, 0x3d, +0xaf, 0x2a, 0xfe, 0xea, 0x4b, 0xf1, 0xdf, 0xf1, 0x3d, 0x8c, 0x2f, 0x02, 0xe4, 0xb4, 0x35, 0x54, +0x79, 0x9f, 0xf7, 0x9b, 0x7f, 0x86, 0xdf, 0x81, 0xf3, 0xef, 0xc1, 0x8f, 0xf8, 0x26, 0x07, 0xc0, +0x7f, 0x81, 0x4d, 0x0c, 0xfa, 0x27, 0xc3, 0x7d, 0x06, 0xea, 0xfa, 0x2c, 0x15, 0xbd, 0xd6, 0x11, +0xb5, 0x6b, 0x95, 0x71, 0x8f, 0x9d, 0x5e, 0xe4, 0xbf, 0x96, 0x78, 0xff, 0x00, 0x96, 0x61, 0x40, +0xc9, 0xc6, 0x32, 0x6b, 0xdf, 0x62, 0x84, 0x42, 0x9e, 0x5a, 0x61, 0x51, 0x46, 0x14, 0x0e, 0xc3, +0xd2, 0xa5, 0xa2, 0xbe, 0x6f, 0x11, 0x88, 0xad, 0x5e, 0x5c, 0xf5, 0xe6, 0xe4, 0xfc, 0xdb, 0x7f, +0x99, 0xf5, 0x18, 0x7c, 0x2d, 0x1c, 0x3c, 0x79, 0x28, 0x41, 0x45, 0x76, 0x49, 0x2f, 0xc8, 0x28, +0xa2, 0x8a, 0xc4, 0xd8, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0xbf, 0x3a, 0xff, 0x00, 0xe0, 0xae, 0x5f, 0xf0, 0x70, 0x5f, 0x80, 0x7f, 0xe0, 0x9d, +0xba, 0x85, 0xc7, 0x81, 0xbc, 0x2d, 0x61, 0x6d, 0xf1, 0x1f, 0xe2, 0xf2, 0x44, 0x4c, 0xfa, 0x54, +0x77, 0x7e, 0x56, 0x9d, 0xe1, 0xbd, 0xca, 0x0a, 0x35, 0xfc, 0xca, 0x09, 0xf3, 0x08, 0x21, 0xc5, +0xb4, 0x7f, 0xbc, 0x65, 0x00, 0xbb, 0x40, 0xb2, 0x46, 0xee, 0x5c, 0x0f, 0xd1, 0x4a, 0xa7, 0x75, +0xab, 0x5b, 0x58, 0x36, 0xcb, 0x8b, 0x8b, 0x78, 0x59, 0x86, 0x54, 0x49, 0x20, 0x52, 0x47, 0xae, +0x09, 0xaf, 0xe4, 0x97, 0xf6, 0xad, 0xff, 0x00, 0x82, 0xc2, 0x7e, 0xd2, 0x5f, 0xb6, 0x5e, 0xa7, +0x70, 0xfe, 0x30, 0xf8, 0xa9, 0xe2, 0x4b, 0x1d, 0x26, 0x7c, 0xaa, 0xe8, 0x3e, 0x1b, 0xb8, 0x7d, +0x0f, 0x48, 0x8e, 0x32, 0x73, 0xe5, 0x98, 0x6d, 0xd9, 0x5a, 0x75, 0x07, 0x90, 0x6e, 0x5e, 0x67, +0x18, 0x1f, 0x37, 0x03, 0x1f, 0x2f, 0xcd, 0xa2, 0xd9, 0xdc, 0xcf, 0x24, 0xb2, 0xda, 0xdb, 0xc9, +0x2c, 0xce, 0x64, 0x91, 0xde, 0x30, 0xcd, 0x23, 0x1e, 0x4b, 0x31, 0x23, 0x24, 0x9e, 0xe4, 0xf5, +0xa8, 0x72, 0x0e, 0x64, 0x8f, 0xed, 0xdb, 0xfe, 0x12, 0x3d, 0x3f, 0xfe, 0x7f, 0xb4, 0xff, 0x00, +0xfb, 0xfc, 0x9f, 0xe3, 0x47, 0xfc, 0x24, 0x7a, 0x7f, 0xfc, 0xff, 0x00, 0x69, 0xff, 0x00, 0xf7, +0xf9, 0x3f, 0xc6, 0xbf, 0x88, 0x7f, 0xf8, 0x47, 0xec, 0x3f, 0xe7, 0xc6, 0xcf, 0xfe, 0xfc, 0xaf, +0xf8, 0x51, 0xff, 0x00, 0x08, 0xfd, 0x87, 0xfc, 0xf8, 0xd9, 0xff, 0x00, 0xdf, 0x95, 0xff, 0x00, +0x0a, 0x5a, 0x87, 0x3a, 0xec, 0x7f, 0x6f, 0x1f, 0xf0, 0x91, 0xe9, 0xff, 0x00, 0xf3, 0xfd, 0xa7, +0xff, 0x00, 0xdf, 0xe4, 0xff, 0x00, 0x1a, 0x3f, 0xe1, 0x23, 0xd3, 0xff, 0x00, 0xe7, 0xfb, 0x4f, +0xff, 0x00, 0xbf, 0xc9, 0xfe, 0x35, 0xfc, 0x43, 0xff, 0x00, 0xc2, 0x3f, 0x61, 0xff, 0x00, 0x3e, +0x36, 0x7f, 0xf7, 0xe5, 0x7f, 0xc2, 0x83, 0xe1, 0xfb, 0x0c, 0x7f, 0xc7, 0x8d, 0x9f, 0xfd, 0xf9, +0x5f, 0xf0, 0xa3, 0x50, 0xe7, 0x5d, 0x8f, 0xee, 0x0a, 0xca, 0xfe, 0x3d, 0x42, 0x2d, 0xf0, 0xc9, +0x1c, 0xa9, 0x9c, 0x6e, 0x47, 0x0c, 0xb9, 0xf4, 0xc8, 0xae, 0x0b, 0xf6, 0xa5, 0xfd, 0xa8, 0x7c, +0x17, 0xfb, 0x19, 0xfc, 0x0b, 0xd6, 0xbe, 0x24, 0x7c, 0x44, 0xd5, 0xa5, 0xd1, 0x3c, 0x1f, 0xe1, +0xd6, 0xb6, 0x5d, 0x42, 0xf6, 0x2b, 0x29, 0xaf, 0x1a, 0x13, 0x71, 0x73, 0x15, 0xac, 0x58, 0x8a, +0x14, 0x79, 0x1b, 0x74, 0xd3, 0xc6, 0xbf, 0x2a, 0x9c, 0x6e, 0xc9, 0xc0, 0x04, 0xd7, 0xc4, 0x3f, +0xf0, 0x6a, 0xa5, 0xb4, 0x76, 0xbf, 0xf0, 0x49, 0x6d, 0x2d, 0x22, 0x8d, 0x23, 0x5f, 0xf8, 0x4a, +0xf5, 0x9f, 0x95, 0x17, 0x68, 0xff, 0x00, 0x5e, 0x2b, 0xb4, 0xff, 0x00, 0x83, 0x97, 0x3f, 0xe5, +0x0a, 0xbf, 0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x75, 0x5d, 0x02, 0xfd, 0x4a, +0x5f, 0xf1, 0x13, 0x4f, 0xec, 0x67, 0xff, 0x00, 0x45, 0x3b, 0x57, 0xff, 0x00, 0xc2, 0x27, 0x5c, +0xff, 0x00, 0xe4, 0x4a, 0xbd, 0xe1, 0xaf, 0xf8, 0x39, 0x1f, 0xf6, 0x3d, 0xf1, 0x7f, 0x89, 0x74, +0xdd, 0x23, 0x4f, 0xf8, 0x93, 0xab, 0x4f, 0xa8, 0x6a, 0xd7, 0x70, 0xd8, 0xda, 0xc6, 0x7c, 0x19, +0xad, 0x46, 0x24, 0x9a, 0x57, 0x58, 0xd1, 0x4b, 0x35, 0xa8, 0x55, 0xcb, 0x30, 0x19, 0x24, 0x01, +0x9e, 0x4d, 0x7f, 0x2d, 0xf5, 0xd8, 0x7e, 0xce, 0xff, 0x00, 0xf2, 0x71, 0x3f, 0x0f, 0x7f, 0xec, +0x6a, 0xd2, 0x7f, 0xf4, 0xb6, 0x2a, 0x90, 0xe7, 0x3f, 0xb4, 0xca, 0x28, 0xa2, 0xb4, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x02, 0x1b, +0xdb, 0xf8, 0xf4, 0xf8, 0xb7, 0xcd, 0x24, 0x71, 0x26, 0x71, 0xb9, 0xdc, 0x2a, 0xe7, 0xd3, 0x26, +0xaa, 0xff, 0x00, 0xc2, 0x47, 0xa7, 0xff, 0x00, 0xcf, 0xf6, 0x9f, 0xff, 0x00, 0x7f, 0x93, 0xfc, +0x6b, 0xf3, 0xbb, 0xfe, 0x0e, 0xab, 0xb6, 0x8e, 0xeb, 0xfe, 0x09, 0x2d, 0xaa, 0x24, 0xb1, 0xa4, +0x8b, 0xff, 0x00, 0x09, 0x5e, 0x8d, 0xf2, 0xba, 0xee, 0x1f, 0xeb, 0xcd, 0x7f, 0x33, 0x03, 0xc3, +0xf6, 0x18, 0xff, 0x00, 0x8f, 0x1b, 0x3f, 0xfb, 0xf2, 0xbf, 0xe1, 0x53, 0x20, 0xe6, 0x48, 0xfe, +0xde, 0x3f, 0xe1, 0x23, 0xd3, 0xff, 0x00, 0xe7, 0xfb, 0x4f, 0xff, 0x00, 0xbf, 0xc9, 0xfe, 0x34, +0x7f, 0xc2, 0x47, 0xa7, 0xff, 0x00, 0xcf, 0xf6, 0x9f, 0xff, 0x00, 0x7f, 0x93, 0xfc, 0x6b, 0xf8, +0x87, 0xff, 0x00, 0x84, 0x7e, 0xc3, 0xfe, 0x7c, 0x6c, 0xff, 0x00, 0xef, 0xca, 0xff, 0x00, 0x85, +0x1f, 0xf0, 0x8f, 0xd8, 0x7f, 0xcf, 0x8d, 0x9f, 0xfd, 0xf9, 0x5f, 0xf0, 0xa9, 0xd4, 0x39, 0xd7, +0x63, 0xfb, 0x78, 0xff, 0x00, 0x84, 0x93, 0x4f, 0xff, 0x00, 0x9f, 0xed, 0x3f, 0xfe, 0xff, 0x00, +0x2f, 0xf8, 0xd4, 0x96, 0xba, 0xb5, 0xad, 0xfe, 0xe4, 0xb7, 0x9a, 0x0b, 0x86, 0x51, 0x92, 0x23, +0x91, 0x58, 0x8f, 0xc8, 0xd7, 0xf1, 0x07, 0xff, 0x00, 0x08, 0xfd, 0x87, 0xfc, 0xf8, 0xd9, 0xff, +0x00, 0xdf, 0x95, 0xff, 0x00, 0x0a, 0x74, 0x3a, 0x2d, 0x9d, 0xb4, 0xf1, 0xcb, 0x15, 0xad, 0xbc, +0x72, 0xc2, 0xe2, 0x48, 0xdd, 0x23, 0x0a, 0xd1, 0xb0, 0xe4, 0x32, 0x90, 0x32, 0x08, 0xec, 0x47, +0x4a, 0x2e, 0x1c, 0xeb, 0xb1, 0xfd, 0xc3, 0x51, 0x5f, 0xc8, 0xbf, 0xec, 0xa7, 0xff, 0x00, 0x05, +0x81, 0xfd, 0xa4, 0xbf, 0x63, 0x4d, 0x4e, 0xde, 0x4f, 0x07, 0xfc, 0x56, 0xf1, 0x2d, 0xe6, 0x93, +0x6e, 0x54, 0x36, 0x85, 0xe2, 0x3b, 0x86, 0xd6, 0xf4, 0x99, 0x63, 0x0d, 0xbb, 0xca, 0x10, 0xdc, +0x16, 0x30, 0x29, 0x3d, 0x4d, 0xb3, 0xc2, 0xe7, 0x27, 0xe7, 0x19, 0xaf, 0xdc, 0xcf, 0xf8, 0x24, +0x8f, 0xfc, 0x1c, 0x3d, 0xe0, 0x1f, 0xf8, 0x28, 0x26, 0xa9, 0x67, 0xe0, 0x4f, 0x1a, 0x58, 0x5a, +0xfc, 0x36, 0xf8, 0xb7, 0x70, 0x15, 0x2d, 0x2c, 0x1e, 0xe4, 0xc9, 0xa5, 0x78, 0x99, 0x82, 0x9d, +0xc6, 0xc6, 0x66, 0x00, 0xac, 0xdc, 0x16, 0x36, 0xb2, 0xfc, 0xe1, 0x58, 0x79, 0x6f, 0x3e, 0xd9, +0x19, 0x2b, 0x98, 0x15, 0x99, 0xfa, 0x39, 0x45, 0x14, 0x55, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, +0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, +0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x57, 0x33, 0xf1, 0x9f, 0xe2, +0xfe, 0x83, 0xfb, 0x3f, 0xfc, 0x25, 0xf1, 0x37, 0x8e, 0x3c, 0x55, 0x78, 0xfa, 0x7f, 0x86, 0x7c, +0x21, 0xa5, 0xdc, 0xeb, 0x3a, 0xad, 0xd2, 0x41, 0x24, 0xed, 0x6d, 0x6b, 0x6f, 0x1b, 0x4b, 0x2b, +0x88, 0xe3, 0x56, 0x77, 0xc2, 0x29, 0x3b, 0x54, 0x12, 0x71, 0xc0, 0x35, 0xd3, 0x57, 0xce, 0xbf, +0xf0, 0x57, 0x2f, 0xf9, 0x45, 0x97, 0xed, 0x1b, 0xff, 0x00, 0x64, 0xdb, 0xc4, 0x1f, 0xfa, 0x6f, +0x9a, 0x93, 0x1c, 0x77, 0x3c, 0x3f, 0xfe, 0x22, 0x69, 0xfd, 0x8c, 0xbf, 0xe8, 0xa7, 0x6a, 0xff, +0x00, 0xf8, 0x44, 0xeb, 0x9f, 0xfc, 0x89, 0x4d, 0x9b, 0xfe, 0x0e, 0x6e, 0xfd, 0x8c, 0x2d, 0xe1, +0x69, 0x1f, 0xe2, 0x7e, 0xac, 0xab, 0x18, 0x2c, 0xc4, 0xf8, 0x27, 0x5b, 0xe0, 0x0f, 0xfb, 0x74, +0xaf, 0xe5, 0xfe, 0xa9, 0xf8, 0x83, 0xfe, 0x40, 0x37, 0xdf, 0xf5, 0xef, 0x27, 0xfe, 0x82, 0x6a, +0x09, 0xf6, 0x87, 0xf7, 0x07, 0x67, 0x78, 0x97, 0xd6, 0xe9, 0x34, 0x67, 0x74, 0x72, 0x28, 0x75, +0x38, 0x23, 0x20, 0x8c, 0x8e, 0x0f, 0x3d, 0x2a, 0x5a, 0xa3, 0xe1, 0x8e, 0x7c, 0x39, 0x61, 0xff, +0x00, 0x5e, 0xd1, 0xff, 0x00, 0xe8, 0x02, 0xaf, 0x55, 0xad, 0x8a, 0x96, 0xe1, 0x45, 0x14, 0x53, +0x10, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, +0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xf9, 0xf9, 0xff, 0x00, 0x07, 0x01, 0x7f, +0xc1, 0x58, 0x6e, 0x7f, 0xe0, 0x9c, 0x1f, 0xb3, 0x5d, 0x9e, 0x8d, 0xe0, 0xd9, 0xe0, 0x8f, 0xe2, +0xc7, 0xc4, 0xa1, 0x3d, 0x96, 0x85, 0x2b, 0x2f, 0x9b, 0xfd, 0x85, 0x6b, 0x18, 0x51, 0x73, 0xa9, +0x15, 0x23, 0x69, 0x78, 0xfc, 0xc4, 0x48, 0x51, 0xf2, 0xad, 0x2c, 0x8a, 0xc5, 0x64, 0x48, 0xa4, +0x43, 0xfc, 0xc6, 0x6a, 0x3a, 0x8d, 0xd6, 0xb5, 0xa9, 0xdd, 0x5f, 0x5f, 0x5d, 0x5d, 0x5f, 0xdf, +0xdf, 0x4e, 0xf7, 0x57, 0x57, 0x57, 0x53, 0x34, 0xf3, 0xdd, 0x4d, 0x23, 0x17, 0x92, 0x59, 0x24, +0x62, 0x59, 0xe4, 0x76, 0x2c, 0xcc, 0xcc, 0x4b, 0x33, 0x31, 0x24, 0x92, 0x6b, 0xeb, 0x9f, 0xf8, +0x2f, 0x37, 0xed, 0x39, 0x75, 0xfb, 0x53, 0x7f, 0xc1, 0x55, 0x3e, 0x2a, 0x5f, 0x34, 0xd3, 0x49, +0xa5, 0x78, 0x27, 0x50, 0x3e, 0x07, 0xd2, 0x61, 0x93, 0xfe, 0x5d, 0xa1, 0xd3, 0x59, 0xa0, 0x9c, +0x0e, 0x07, 0x0f, 0x7b, 0xf6, 0xd9, 0x41, 0xf4, 0x94, 0x0c, 0x9c, 0x66, 0xbe, 0x40, 0xac, 0xc9, +0x93, 0xd6, 0xc1, 0x9c, 0x57, 0x6d, 0xf0, 0x4f, 0xf6, 0x6a, 0xf8, 0x91, 0xfb, 0x4a, 0xdf, 0x5c, +0x5b, 0xfc, 0x3a, 0xf8, 0x7f, 0xe3, 0x6f, 0x1e, 0x4b, 0x67, 0x20, 0x8a, 0xe8, 0xf8, 0x7f, 0x44, +0xb9, 0xd4, 0x63, 0xb3, 0x62, 0x01, 0x02, 0x67, 0x89, 0x19, 0x22, 0xe0, 0x83, 0xfb, 0xc2, 0xbd, +0x47, 0xa8, 0xaf, 0xb2, 0x3f, 0xe0, 0x82, 0x5f, 0xf0, 0x47, 0xfb, 0x7f, 0xf8, 0x29, 0x8f, 0xc6, +0x3d, 0x57, 0xc4, 0xbe, 0x39, 0x17, 0xb6, 0xff, 0x00, 0x07, 0xbc, 0x03, 0x34, 0x71, 0xea, 0xa9, +0x6f, 0x23, 0xc1, 0x2f, 0x88, 0xef, 0x98, 0x09, 0x13, 0x4e, 0x8e, 0x65, 0x20, 0xc6, 0x8b, 0x19, +0x59, 0x27, 0x74, 0x22, 0x45, 0x47, 0x89, 0x17, 0x6b, 0x4a, 0x25, 0x8b, 0xfa, 0x60, 0xf8, 0x65, +0xf0, 0xc3, 0xc3, 0xbf, 0x06, 0x3c, 0x0d, 0xa6, 0xf8, 0x5f, 0xc2, 0x7a, 0x1e, 0x91, 0xe1, 0xaf, +0x0d, 0xe8, 0xf0, 0x8b, 0x7b, 0x0d, 0x2f, 0x4b, 0xb3, 0x4b, 0x4b, 0x4b, 0x28, 0xc1, 0x27, 0x6c, +0x71, 0xa0, 0x0a, 0xa3, 0x24, 0x9e, 0x07, 0x24, 0x92, 0x72, 0x4d, 0x0b, 0x50, 0x51, 0xea, 0xcf, +0xe4, 0xef, 0xfe, 0x1c, 0xbb, 0xfb, 0x58, 0x1f, 0xf9, 0xa0, 0x1f, 0x10, 0xff, 0x00, 0xf0, 0x12, +0x2f, 0xfe, 0x39, 0x4b, 0xff, 0x00, 0x0e, 0x5c, 0xfd, 0xac, 0x3f, 0xe8, 0xdf, 0xfe, 0x21, 0xff, +0x00, 0xe0, 0x2c, 0x5f, 0xfc, 0x72, 0xbf, 0xae, 0x1a, 0x2a, 0xb9, 0x47, 0xca, 0x8f, 0xe4, 0x7b, +0xfe, 0x1c, 0xb9, 0xfb, 0x58, 0x7f, 0xd1, 0xbf, 0xfc, 0x43, 0xff, 0x00, 0xc0, 0x58, 0xbf, 0xf8, +0xe5, 0x1f, 0xf0, 0xe5, 0xbf, 0xda, 0xc3, 0xfe, 0x8d, 0xff, 0x00, 0xe2, 0x1f, 0xfe, 0x02, 0xc5, +0xff, 0x00, 0xc7, 0x2b, 0xfa, 0xe1, 0xa2, 0x8e, 0x50, 0xe5, 0x47, 0xc2, 0x7f, 0xf0, 0x6e, 0x87, +0xec, 0xf5, 0xe3, 0x8f, 0xd9, 0x8b, 0xfe, 0x09, 0xaf, 0xa7, 0xf8, 0x57, 0xe2, 0x17, 0x85, 0xf5, +0x6f, 0x07, 0xf8, 0x92, 0x3f, 0x11, 0xea, 0x97, 0x4f, 0xa7, 0x6a, 0x31, 0x84, 0x9d, 0x62, 0x92, +0x60, 0xc8, 0xe4, 0x02, 0x78, 0x61, 0xc8, 0xe6, 0xba, 0x8f, 0xf8, 0x2f, 0x97, 0xc1, 0x0f, 0x17, +0x7e, 0xd1, 0xdf, 0xf0, 0x4a, 0x1f, 0x89, 0xfe, 0x0d, 0xf0, 0x27, 0x87, 0xf5, 0x1f, 0x14, 0xf8, +0xab, 0x57, 0x9f, 0x43, 0x6b, 0x2d, 0x2e, 0xc1, 0x03, 0xdc, 0x5c, 0x88, 0x75, 0xcd, 0x3e, 0x79, +0x76, 0x82, 0x40, 0x3b, 0x62, 0x8a, 0x47, 0x3c, 0xf4, 0x43, 0x5f, 0x62, 0x56, 0x2f, 0x8f, 0xfe, +0x22, 0xe8, 0x3f, 0x0a, 0xfc, 0x33, 0x26, 0xb5, 0xe2, 0x6d, 0x6b, 0x47, 0xf0, 0xee, 0x8d, 0x0c, +0xb0, 0xc3, 0x2d, 0xfe, 0xa9, 0x7b, 0x1d, 0x9d, 0xac, 0x4f, 0x34, 0xa9, 0x0c, 0x48, 0xd2, 0x48, +0x42, 0x86, 0x92, 0x59, 0x23, 0x8d, 0x41, 0x39, 0x67, 0x75, 0x51, 0x92, 0x40, 0xa7, 0xd0, 0x67, +0xf2, 0x71, 0xff, 0x00, 0x0e, 0x5c, 0xfd, 0xac, 0x3f, 0xe8, 0xdf, 0xfe, 0x21, 0xff, 0x00, 0xe0, +0x2c, 0x5f, 0xfc, 0x72, 0xba, 0x7f, 0x81, 0xff, 0x00, 0xf0, 0x47, 0x3f, 0xda, 0x9f, 0xc3, 0xdf, +0x1c, 0x3c, 0x13, 0xa8, 0x5f, 0x7c, 0x07, 0xf8, 0x81, 0x6b, 0x63, 0xa7, 0xf8, 0x8b, 0x4e, 0xba, +0xb9, 0x99, 0xed, 0x62, 0xdb, 0x0c, 0x51, 0xdd, 0x44, 0xee, 0xe7, 0xe7, 0xe8, 0x14, 0x12, 0x7e, +0x95, 0xfd, 0x5a, 0x69, 0xda, 0x8c, 0x3a, 0xb5, 0x8c, 0x37, 0x56, 0xb2, 0xc5, 0x71, 0x6d, 0x70, +0x8b, 0x2c, 0x53, 0x44, 0xe1, 0xe3, 0x95, 0x18, 0x64, 0x32, 0xb0, 0xe0, 0x82, 0x30, 0x41, 0x1d, +0x6a, 0x6a, 0x5c, 0xa2, 0xe5, 0x41, 0x45, 0x14, 0x55, 0x0c, 0x28, 0xa2, 0xb0, 0x7e, 0x22, 0x7c, +0x53, 0xf0, 0xd7, 0xc2, 0x3d, 0x04, 0xea, 0x9e, 0x2a, 0xf1, 0x0e, 0x85, 0xe1, 0xad, 0x31, 0x4e, +0xd3, 0x79, 0xab, 0x6a, 0x11, 0x58, 0xdb, 0x83, 0xd7, 0x1b, 0xe5, 0x65, 0x5f, 0xd6, 0x80, 0x37, +0xa8, 0xaf, 0x00, 0x97, 0xfe, 0x0a, 0xb1, 0xfb, 0x30, 0x5b, 0xca, 0xd1, 0xc9, 0xfb, 0x49, 0x7c, +0x04, 0x8e, 0x48, 0xd8, 0xab, 0x2b, 0x7c, 0x41, 0xd2, 0x01, 0x52, 0x3a, 0x82, 0x3e, 0xd1, 0xd6, +0x99, 0xff, 0x00, 0x0f, 0x5b, 0xfd, 0x96, 0xff, 0x00, 0xe8, 0xe4, 0xbe, 0x00, 0xff, 0x00, 0xe1, +0xc2, 0xd2, 0x3f, 0xf8, 0xfd, 0x17, 0x03, 0xe8, 0x2a, 0x2b, 0xe7, 0xdf, 0xf8, 0x7a, 0xdf, 0xec, +0xb7, 0xff, 0x00, 0x47, 0x27, 0xf0, 0x07, 0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xe8, +0xff, 0x00, 0x87, 0xad, 0xfe, 0xcb, 0x7f, 0xf4, 0x72, 0x7f, 0x00, 0x7f, 0xf0, 0xe1, 0x69, 0x1f, +0xfc, 0x7e, 0x80, 0x3e, 0x82, 0xa2, 0xbc, 0xcf, 0xe0, 0xa7, 0xed, 0x99, 0xf0, 0x8f, 0xf6, 0x94, +0xd5, 0xaf, 0xac, 0x3e, 0x1c, 0xfc, 0x54, 0xf8, 0x6d, 0xf1, 0x02, 0xfb, 0x4c, 0x84, 0x5c, 0x5e, +0x5b, 0x78, 0x6f, 0xc4, 0xd6, 0x5a, 0xb4, 0xd6, 0x91, 0x13, 0xb4, 0x49, 0x22, 0x5b, 0xca, 0xe5, +0x14, 0xb7, 0x00, 0xb0, 0x00, 0x9e, 0x33, 0x9a, 0xf4, 0xca, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, +0xaf, 0x23, 0xf8, 0x91, 0xfb, 0x7c, 0xfc, 0x0e, 0xf8, 0x35, 0xab, 0xb6, 0x9f, 0xe3, 0x1f, 0x8c, +0xdf, 0x09, 0x7c, 0x27, 0xa8, 0x23, 0x14, 0x6b, 0x6d, 0x67, 0xc5, 0xfa, 0x7d, 0x8c, 0xca, 0xc3, +0x39, 0x52, 0xb2, 0xcc, 0xa7, 0x23, 0x07, 0x8c, 0x76, 0x35, 0xcc, 0xff, 0x00, 0xc3, 0xd6, 0xff, +0x00, 0x65, 0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, 0xfe, 0x3f, 0x4a, 0xe1, +0xb1, 0xf4, 0x15, 0x15, 0xf3, 0xef, 0xfc, 0x3d, 0x6f, 0xf6, 0x5b, 0xff, 0x00, 0xa3, 0x93, 0xf8, +0x03, 0xff, 0x00, 0x87, 0x0b, 0x48, 0xff, 0x00, 0xe3, 0xf4, 0x7f, 0xc3, 0xd6, 0xff, 0x00, 0x65, +0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, 0xfe, 0x3f, 0x4c, 0x0f, 0xa0, 0xa8, +0xaf, 0x9f, 0x4f, 0xfc, 0x15, 0x6f, 0xf6, 0x5b, 0x1f, 0xf3, 0x72, 0x7f, 0x00, 0x7f, 0xf0, 0xe1, +0x69, 0x1f, 0xfc, 0x7e, 0xbd, 0xd3, 0xc3, 0x5e, 0x24, 0xb1, 0xf1, 0x86, 0x83, 0x67, 0xaa, 0x69, +0x77, 0x96, 0x7a, 0x96, 0x9b, 0xa9, 0x41, 0x1d, 0xd5, 0xa5, 0xdd, 0xa4, 0xcb, 0x3d, 0xbd, 0xd4, +0x32, 0x28, 0x74, 0x92, 0x37, 0x5c, 0xab, 0xa3, 0x29, 0x0c, 0x19, 0x49, 0x04, 0x10, 0x41, 0x22, +0x80, 0x3f, 0x3b, 0xff, 0x00, 0xe0, 0xea, 0x3f, 0xf9, 0x44, 0xd6, 0xa9, 0xff, 0x00, 0x63, 0x5e, +0x8d, 0xff, 0x00, 0xa3, 0xcd, 0x7f, 0x34, 0x23, 0xa5, 0x7f, 0x4b, 0xdf, 0xf0, 0x75, 0x1f, 0xfc, +0xa2, 0x6b, 0x54, 0xff, 0x00, 0xb1, 0xaf, 0x46, 0xff, 0x00, 0xd1, 0xe6, 0xbf, 0x9a, 0x11, 0xd2, +0xa6, 0x44, 0xc8, 0xd2, 0xf0, 0x6f, 0x84, 0x35, 0x4f, 0x88, 0x7e, 0x33, 0xd1, 0xfc, 0x3b, 0xa1, +0xd8, 0xcd, 0xaa, 0x6b, 0x9e, 0x21, 0xbf, 0xb7, 0xd2, 0xf4, 0xdb, 0x28, 0x40, 0xf3, 0x6f, 0x2e, +0xa7, 0x95, 0x62, 0x86, 0x14, 0xc9, 0x03, 0x73, 0xc8, 0xea, 0xa3, 0x24, 0x0c, 0xb0, 0xaf, 0xa2, +0x7f, 0xe1, 0xcb, 0x9f, 0xb5, 0x87, 0xfd, 0x1b, 0xff, 0x00, 0xc4, 0x3f, 0xfc, 0x05, 0x8b, 0xff, +0x00, 0x8e, 0x57, 0x0d, 0xff, 0x00, 0x04, 0xea, 0xff, 0x00, 0x94, 0x8a, 0xfe, 0xcf, 0x3f, 0xf6, +0x55, 0x3c, 0x29, 0xff, 0x00, 0xa7, 0xab, 0x4a, 0xfe, 0xc6, 0xa9, 0x28, 0xdc, 0x12, 0x4f, 0x73, +0xf9, 0x1f, 0x1f, 0xf0, 0x45, 0xbf, 0xda, 0xc0, 0x9f, 0xf9, 0x20, 0x1f, 0x10, 0xff, 0x00, 0xf0, +0x16, 0x2f, 0xfe, 0x39, 0x5e, 0x37, 0xf1, 0xbb, 0xf6, 0x60, 0xf8, 0x99, 0xfb, 0x33, 0xdd, 0x5b, +0xc3, 0xf1, 0x1b, 0xe1, 0xdf, 0x8e, 0x3c, 0x06, 0x6e, 0xe4, 0xf2, 0x6d, 0xa4, 0xd7, 0xb4, 0x3b, +0x9d, 0x3e, 0x1b, 0xb7, 0xc6, 0xed, 0xb0, 0xcb, 0x22, 0x04, 0x94, 0xe3, 0xfb, 0x8c, 0xdd, 0x0f, +0xa1, 0xc7, 0xf6, 0x89, 0x58, 0xbf, 0x10, 0x7e, 0x1d, 0xe8, 0x7f, 0x16, 0x3c, 0x1f, 0x7f, 0xe1, +0xdf, 0x13, 0x68, 0xda, 0x4f, 0x88, 0xbc, 0x3f, 0xab, 0x42, 0x6d, 0xef, 0xf4, 0xbd, 0x52, 0xce, +0x3b, 0xcb, 0x3b, 0xe8, 0x8e, 0x32, 0x92, 0xc3, 0x20, 0x28, 0xeb, 0xc7, 0x46, 0x04, 0x53, 0xe5, +0x1f, 0x2a, 0x3f, 0x89, 0xd0, 0x73, 0x4e, 0x86, 0x69, 0x2d, 0x2e, 0x23, 0x9a, 0x19, 0x24, 0x82, +0x68, 0x1d, 0x65, 0x8a, 0x58, 0x9c, 0xc7, 0x24, 0x4e, 0xa7, 0x72, 0xba, 0x30, 0xc1, 0x56, 0x56, +0x00, 0x86, 0x04, 0x10, 0x40, 0x20, 0x83, 0x5f, 0xa2, 0x5f, 0xf0, 0x5f, 0xbf, 0xf8, 0x23, 0x65, +0x9f, 0xfc, 0x13, 0x7b, 0xe2, 0x26, 0x93, 0xe3, 0x9f, 0x87, 0xcb, 0x70, 0xdf, 0x08, 0x7c, 0x75, +0x78, 0xf6, 0x76, 0xf6, 0x73, 0x4a, 0xd3, 0x49, 0xe1, 0x8d, 0x44, 0x23, 0x4b, 0xf6, 0x33, 0x23, +0x92, 0xd2, 0x41, 0x2c, 0x69, 0x23, 0xc2, 0xcc, 0x59, 0x87, 0x93, 0x2a, 0x31, 0xe2, 0x36, 0x7f, +0xce, 0xba, 0x92, 0x5a, 0xb1, 0xfd, 0x32, 0x7f, 0xc1, 0xbc, 0xff, 0x00, 0xf0, 0x56, 0x5b, 0xaf, +0xf8, 0x28, 0x4f, 0xec, 0xf1, 0x7d, 0xe1, 0x0f, 0x1c, 0x5d, 0x47, 0x71, 0xf1, 0x6b, 0xe1, 0xb4, +0x50, 0xc5, 0xa9, 0x5c, 0xb3, 0x85, 0x93, 0xc4, 0x7a, 0x7b, 0xe5, 0x20, 0xd4, 0x76, 0xff, 0x00, +0xcf, 0x60, 0x54, 0xc5, 0x38, 0x5c, 0x80, 0xe1, 0x24, 0xf9, 0x05, 0xc2, 0x46, 0xbf, 0xa3, 0x15, +0xfc, 0x91, 0x7f, 0xc1, 0x19, 0x3f, 0x6a, 0x8b, 0xbf, 0xd8, 0xf7, 0xfe, 0x0a, 0x63, 0xf0, 0xa7, +0xc5, 0x11, 0xdc, 0xb5, 0xbe, 0x93, 0xad, 0x6a, 0xf1, 0x78, 0x57, 0x5d, 0x5d, 0xfb, 0x23, 0x9b, +0x4e, 0xd4, 0x5d, 0x2d, 0xa4, 0xf3, 0x4f, 0x78, 0xe1, 0x91, 0xa0, 0xb9, 0xc7, 0xf7, 0xad, 0x53, +0xae, 0x30, 0x7f, 0xad, 0xda, 0xa8, 0x97, 0x7b, 0xa0, 0xa2, 0x8a, 0x2a, 0x80, 0x28, 0xae, 0x6f, +0xe2, 0x4f, 0xc6, 0x2f, 0x09, 0xfc, 0x1b, 0xd1, 0xd7, 0x51, 0xf1, 0x7f, 0x89, 0xbc, 0x3b, 0xe1, +0x5d, 0x3d, 0xb7, 0x01, 0x75, 0xac, 0x6a, 0x70, 0xd8, 0xc2, 0x71, 0x82, 0x7e, 0x79, 0x59, 0x47, +0x19, 0xe7, 0x9e, 0x2b, 0xc8, 0x8f, 0xfc, 0x15, 0x6b, 0xf6, 0x5b, 0x07, 0xfe, 0x4e, 0x4b, 0xe0, +0x0f, 0xfe, 0x1c, 0x2d, 0x23, 0xff, 0x00, 0x8f, 0xd1, 0x70, 0x3e, 0x81, 0xa2, 0xbc, 0x13, 0x4f, +0xff, 0x00, 0x82, 0xa7, 0x7e, 0xcc, 0xda, 0xb5, 0xec, 0x76, 0xd6, 0x9f, 0xb4, 0x5f, 0xc0, 0x7b, +0xab, 0x99, 0x9b, 0x6c, 0x71, 0x43, 0xe3, 0xfd, 0x25, 0xe4, 0x73, 0xe8, 0x14, 0x5c, 0x64, 0x9f, +0xa5, 0x7b, 0x5f, 0x85, 0x7c, 0x5b, 0xa6, 0x78, 0xe3, 0x43, 0x83, 0x54, 0xd1, 0xb5, 0x1b, 0x0d, +0x5b, 0x4d, 0xba, 0x1b, 0xa0, 0xbb, 0xb2, 0xb8, 0x4b, 0x88, 0x26, 0x19, 0xc6, 0x55, 0xd0, 0x95, +0x6e, 0x41, 0x1c, 0x1e, 0xd4, 0xae, 0x06, 0x85, 0x14, 0x51, 0x4c, 0x02, 0x8a, 0xf2, 0x1f, 0x8a, +0xdf, 0xb7, 0xe7, 0xc0, 0xdf, 0x80, 0xfe, 0x33, 0x9b, 0xc3, 0x9e, 0x3a, 0xf8, 0xcd, 0xf0, 0x97, +0xc1, 0x5e, 0x22, 0xb7, 0x8d, 0x26, 0x97, 0x4b, 0xd7, 0xbc, 0x5f, 0xa7, 0xe9, 0xb7, 0xb1, 0xa3, +0x8d, 0xc8, 0xed, 0x0c, 0xd3, 0x2b, 0xaa, 0xb2, 0xe0, 0x82, 0x46, 0x08, 0x39, 0x15, 0xcd, 0xff, +0x00, 0xc3, 0xd6, 0xff, 0x00, 0x65, 0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, +0xfe, 0x3f, 0x4a, 0xe0, 0x7d, 0x05, 0x45, 0x79, 0xef, 0xc0, 0xcf, 0xda, 0xc7, 0xe1, 0x7f, 0xed, +0x3a, 0xba, 0xa1, 0xf8, 0x6d, 0xf1, 0x1b, 0xc0, 0x3f, 0x10, 0xbf, 0xb0, 0xcc, 0x43, 0x51, 0xff, +0x00, 0x84, 0x67, 0xc4, 0x56, 0x9a, 0xbf, 0xd8, 0x3c, 0xdd, 0xfe, 0x57, 0x9d, 0xf6, 0x79, 0x1f, +0xcb, 0xdf, 0xe5, 0xc9, 0xb7, 0x76, 0x37, 0x6c, 0x6c, 0x67, 0x69, 0xc7, 0xa1, 0x53, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0xbc, 0xc3, 0xe3, 0x5f, 0xed, 0xa3, 0xf0, 0x7b, 0xf6, 0x6d, 0xd7, 0x6c, +0xf4, 0x9f, 0x88, 0xdf, 0x15, 0x7e, 0x1a, 0xf8, 0x03, 0x53, 0xbe, 0xb7, 0xfb, 0x55, 0xad, 0xa7, +0x89, 0x3c, 0x51, 0x63, 0xa4, 0xdc, 0x5c, 0xc3, 0xb8, 0xa7, 0x9a, 0x89, 0x3c, 0xa8, 0xcc, 0x9b, +0x95, 0x97, 0x70, 0x18, 0xca, 0x91, 0xda, 0xb8, 0xcf, 0xf8, 0x7a, 0xdf, 0xec, 0xb7, 0xff, 0x00, +0x47, 0x25, 0xf0, 0x07, 0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xe8, 0x03, 0xe8, 0x2a, +0xf0, 0xcf, 0xf8, 0x29, 0x9f, 0x80, 0xb5, 0xaf, 0x8a, 0xbf, 0xf0, 0x4e, 0xef, 0x8e, 0x9e, 0x17, +0xf0, 0xde, 0x9b, 0x75, 0xad, 0x78, 0x8b, 0xc4, 0x5e, 0x03, 0xd6, 0xf4, 0xdd, 0x33, 0x4f, 0xb6, +0x50, 0xd3, 0x5e, 0xdc, 0xcb, 0x65, 0x2a, 0x45, 0x12, 0x02, 0x46, 0x59, 0x99, 0x80, 0x1e, 0xe6, +0xba, 0x1f, 0x82, 0xff, 0x00, 0xb6, 0xd7, 0xc1, 0xdf, 0xda, 0x47, 0xc4, 0x77, 0x5a, 0x3f, 0xc3, +0xaf, 0x8b, 0x1f, 0x0c, 0x7e, 0x20, 0x6a, 0xf6, 0x56, 0xa6, 0xf6, 0xe2, 0xc7, 0xc3, 0x7e, 0x29, +0xb1, 0xd5, 0x6e, 0xa0, 0x80, 0x3a, 0xa1, 0x95, 0xe3, 0x82, 0x57, 0x65, 0x8f, 0x73, 0xa2, 0xee, +0x20, 0x0c, 0xb2, 0x8c, 0xe4, 0x8a, 0xef, 0xfc, 0x63, 0xe3, 0x2d, 0x2b, 0xe1, 0xf7, 0x86, 0x2f, +0xf5, 0xbd, 0x77, 0x52, 0xd3, 0xf4, 0x6d, 0x17, 0x49, 0xb7, 0x92, 0xee, 0xfb, 0x50, 0xbf, 0xb9, +0x4b, 0x6b, 0x5b, 0x28, 0x51, 0x77, 0x3c, 0xb2, 0xc8, 0xe4, 0x2a, 0x22, 0xa8, 0x24, 0xb3, 0x10, +0x00, 0x19, 0x26, 0xa4, 0xa4, 0x7f, 0x26, 0x3f, 0xf0, 0xe5, 0xcf, 0xda, 0xc3, 0xfe, 0x8d, 0xff, +0x00, 0xe2, 0x1f, 0xfe, 0x02, 0xc5, 0xff, 0x00, 0xc7, 0x2a, 0xb6, 0xb3, 0xff, 0x00, 0x04, 0x56, +0xfd, 0xac, 0xae, 0x34, 0x7b, 0xa8, 0xd3, 0xf6, 0x7f, 0xf8, 0x88, 0xcf, 0x24, 0x2e, 0xaa, 0x3e, +0xcb, 0x17, 0x24, 0xa9, 0xff, 0x00, 0xa6, 0x95, 0xfd, 0x6e, 0x78, 0x73, 0xc4, 0x76, 0x3e, 0x2e, +0xd1, 0xad, 0xf5, 0x2d, 0x2e, 0xf2, 0xcf, 0x52, 0xd3, 0xee, 0xd3, 0xcc, 0xb7, 0xba, 0xb4, 0x9d, +0x67, 0x86, 0x75, 0xfe, 0xf2, 0xba, 0x92, 0xac, 0x3d, 0xc1, 0xab, 0xd4, 0x72, 0x91, 0xca, 0x8a, +0x3e, 0x1e, 0x89, 0xa1, 0xd1, 0x6c, 0xe3, 0x91, 0x4a, 0xbc, 0x76, 0xe8, 0xac, 0xa7, 0xa8, 0x21, +0x40, 0x20, 0xfd, 0x2a, 0xf5, 0x14, 0x55, 0x2d, 0x06, 0xf5, 0x0a, 0x28, 0xaa, 0x3e, 0x24, 0xf1, +0x36, 0x9f, 0xe0, 0xfd, 0x16, 0x7d, 0x4b, 0x56, 0xbe, 0xb2, 0xd3, 0x34, 0xfb, 0x51, 0xba, 0x7b, +0xab, 0xb9, 0xd6, 0x08, 0x21, 0x04, 0x80, 0x0b, 0x3b, 0x10, 0xaa, 0x32, 0x40, 0xe4, 0xf5, 0x22, +0x80, 0x2f, 0x51, 0x5e, 0x0d, 0xaa, 0x7f, 0xc1, 0x52, 0xbf, 0x66, 0x7d, 0x0e, 0xfe, 0x4b, 0x5b, +0xef, 0xda, 0x27, 0xe0, 0x4d, 0x9d, 0xd4, 0x24, 0x09, 0x21, 0x9f, 0xc7, 0xda, 0x54, 0x72, 0x46, +0x71, 0x9c, 0x15, 0x37, 0x19, 0x1c, 0x10, 0x79, 0xf5, 0x15, 0x5b, 0xfe, 0x1e, 0xb7, 0xfb, 0x2d, +0xff, 0x00, 0xd1, 0xc9, 0xfc, 0x01, 0xff, 0x00, 0xc3, 0x85, 0xa4, 0x7f, 0xf1, 0xfa, 0x57, 0x03, +0xe8, 0x2a, 0x2b, 0xe7, 0xdf, 0xf8, 0x7a, 0xdf, 0xec, 0xb7, 0xff, 0x00, 0x47, 0x27, 0xf0, 0x07, +0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xeb, 0xbf, 0xf8, 0x1d, 0xfb, 0x59, 0xfc, 0x2f, +0xfd, 0xa7, 0x4e, 0xa9, 0xff, 0x00, 0x0a, 0xd7, 0xe2, 0x57, 0xc3, 0xff, 0x00, 0x88, 0x5f, 0xd8, +0x7e, 0x57, 0xf6, 0x8f, 0xfc, 0x23, 0x3e, 0x21, 0xb4, 0xd5, 0xff, 0x00, 0xb3, 0xfc, 0xdd, 0xfe, +0x57, 0x9d, 0xf6, 0x79, 0x1f, 0xcb, 0xdf, 0xe5, 0x49, 0xb7, 0x76, 0x37, 0x79, 0x6f, 0x8c, 0xed, +0x38, 0x2e, 0x07, 0xa1, 0xd1, 0x45, 0x14, 0xc0, 0x28, 0xac, 0x8f, 0x1b, 0x78, 0xf7, 0x45, 0xf8, +0x6d, 0xa0, 0xc9, 0xaa, 0x78, 0x83, 0x58, 0xd2, 0x74, 0x2d, 0x2e, 0x22, 0x16, 0x4b, 0xcd, 0x46, +0xf2, 0x3b, 0x4b, 0x74, 0x27, 0xa0, 0x2f, 0x21, 0x0a, 0x33, 0x83, 0xde, 0xbc, 0x6a, 0xeb, 0xfe, +0x0a, 0xa7, 0xfb, 0x31, 0x58, 0x5c, 0xbc, 0x33, 0xfe, 0xd1, 0xff, 0x00, 0x01, 0x21, 0x9a, 0x33, +0xb5, 0xd1, 0xfe, 0x20, 0x69, 0x2a, 0xca, 0x7d, 0x08, 0x37, 0x19, 0x06, 0x80, 0x3d, 0xf2, 0x8a, +0xf9, 0xfe, 0x3f, 0xf8, 0x2a, 0xcf, 0xec, 0xc1, 0x34, 0x8a, 0x91, 0xfe, 0xd2, 0x5f, 0x00, 0xe4, +0x76, 0x21, 0x55, 0x57, 0xe2, 0x0e, 0x90, 0x58, 0x93, 0xc0, 0x00, 0x7d, 0xa2, 0xbd, 0x83, 0xe1, +0xd7, 0xc5, 0x5f, 0x0c, 0xfc, 0x5e, 0xd0, 0xbf, 0xb5, 0x3c, 0x2b, 0xe2, 0x2d, 0x07, 0xc4, 0xda, +0x69, 0x20, 0x0b, 0xbd, 0x27, 0x50, 0x86, 0xfa, 0x02, 0x48, 0xc8, 0x1b, 0xe2, 0x66, 0x5e, 0x84, +0x1e, 0xbd, 0x0d, 0x2b, 0x81, 0xd0, 0x51, 0x45, 0x14, 0xc0, 0xfe, 0x2b, 0xfe, 0x3f, 0x6a, 0xd2, +0x6b, 0xff, 0x00, 0x1f, 0xbc, 0x79, 0xa8, 0x4d, 0xbb, 0xce, 0xd4, 0x3c, 0x4b, 0xa9, 0xdd, 0x3e, +0x5b, 0x77, 0xcc, 0xf7, 0x92, 0xb1, 0xe7, 0xbf, 0x24, 0xf3, 0xde, 0xb9, 0x33, 0xd2, 0xba, 0x2f, +0x8c, 0x1f, 0xf2, 0x57, 0xbc, 0x59, 0xff, 0x00, 0x61, 0xcb, 0xff, 0x00, 0xfd, 0x29, 0x92, 0xb9, +0xda, 0xcc, 0x89, 0x6e, 0x7f, 0x50, 0xdf, 0xf0, 0x6c, 0xff, 0x00, 0x80, 0x34, 0xff, 0x00, 0x04, +0x7f, 0xc1, 0x1d, 0xfe, 0x1b, 0x5d, 0xda, 0x5b, 0xc3, 0x1d, 0xe7, 0x89, 0xaf, 0x75, 0x8d, 0x5f, +0x51, 0x95, 0x17, 0x69, 0xb9, 0x98, 0xea, 0x97, 0x50, 0x23, 0x37, 0xa9, 0x58, 0x20, 0x82, 0x3c, +0xfa, 0x44, 0x2b, 0xef, 0x6a, 0xf8, 0x9f, 0xfe, 0x0d, 0xd4, 0xff, 0x00, 0x94, 0x34, 0xfc, 0x15, +0xff, 0x00, 0xaf, 0x6d, 0x53, 0xff, 0x00, 0x4f, 0x17, 0xd5, 0xf6, 0xc5, 0x5c, 0x76, 0x2c, 0x28, +0xa2, 0x8a, 0x60, 0x14, 0x51, 0x45, 0x00, 0x15, 0xf0, 0x8f, 0xfc, 0x1c, 0xbe, 0x82, 0x4f, 0xf8, +0x22, 0x9f, 0xc6, 0x15, 0x61, 0xb9, 0x5a, 0xe3, 0xc3, 0xa0, 0x83, 0xdf, 0xfe, 0x2a, 0x2d, 0x32, +0xbe, 0xee, 0xaf, 0x84, 0xbf, 0xe0, 0xe5, 0xcf, 0xf9, 0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, +0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x26, 0x07, 0xf3, 0x45, 0xf0, 0x4f, 0xf6, 0x8d, 0xf8, 0x89, 0xfb, +0x35, 0x5f, 0x7d, 0xa3, 0xe1, 0xd7, 0x8f, 0x7c, 0x67, 0xe0, 0x39, 0x1a, 0x4f, 0x36, 0x41, 0xe1, +0xfd, 0x6a, 0xe7, 0x4e, 0x8e, 0x76, 0xc8, 0x3f, 0xbc, 0x8e, 0x27, 0x54, 0x90, 0x1d, 0xab, 0x90, +0xe1, 0x81, 0x0a, 0x01, 0x04, 0x57, 0xdd, 0x9f, 0xb1, 0xbf, 0xfc, 0x1c, 0x8b, 0xfb, 0x55, 0xf8, +0x57, 0xe2, 0x87, 0x84, 0xfc, 0x37, 0xe2, 0x0f, 0x15, 0x78, 0x6b, 0xe2, 0x26, 0x93, 0xac, 0xeb, +0x16, 0x3a, 0x54, 0xa3, 0xc4, 0x7a, 0x0c, 0x42, 0xe2, 0x18, 0x66, 0x9e, 0x38, 0x58, 0xa4, 0xd6, +0x66, 0xdd, 0xcc, 0x81, 0x58, 0x90, 0xd2, 0xf9, 0x9f, 0x31, 0xc9, 0xdc, 0x38, 0xaf, 0xce, 0x1a, +0xec, 0x3f, 0x67, 0x7f, 0xf9, 0x38, 0x9f, 0x87, 0xbf, 0xf6, 0x35, 0x69, 0x3f, 0xfa, 0x5b, 0x15, +0x41, 0x2a, 0x4c, 0xfe, 0xd3, 0x2a, 0x39, 0xe6, 0xf2, 0x17, 0x71, 0xc6, 0xdc, 0x12, 0x49, 0x38, +0x00, 0x54, 0x95, 0xf9, 0x1b, 0xff, 0x00, 0x07, 0x54, 0x7f, 0xc1, 0x47, 0xaf, 0x7e, 0x06, 0x7c, +0x0f, 0xd0, 0xfe, 0x03, 0xf8, 0x4b, 0x52, 0x92, 0xc3, 0xc4, 0x7f, 0x14, 0x2d, 0x65, 0xbc, 0xf1, +0x34, 0xd0, 0x4a, 0x56, 0x6b, 0x5d, 0x00, 0x31, 0x87, 0xec, 0xfc, 0x60, 0x81, 0x7b, 0x30, 0x92, +0x32, 0x41, 0x20, 0xc5, 0x6b, 0x72, 0x8c, 0x31, 0x20, 0x35, 0x6d, 0x94, 0x78, 0xff, 0x00, 0xfc, +0x15, 0xd7, 0xfe, 0x0e, 0x7a, 0xd5, 0x0f, 0x8b, 0x35, 0x3f, 0x87, 0x7f, 0xb3, 0x0e, 0xa1, 0x63, +0x0e, 0x9f, 0xa7, 0xb3, 0x5a, 0xea, 0x3f, 0x10, 0xcc, 0x29, 0x74, 0xd7, 0xb2, 0x03, 0xf3, 0xa6, +0x95, 0x1b, 0x83, 0x17, 0x92, 0x31, 0xb7, 0xed, 0x72, 0x2b, 0x89, 0x32, 0xc6, 0x15, 0x0a, 0x23, +0x9e, 0x4f, 0xc6, 0xbf, 0x89, 0x1f, 0x10, 0x3c, 0x41, 0xf1, 0x9b, 0xc6, 0x53, 0xf8, 0x8b, 0xc6, +0x5a, 0xf6, 0xb7, 0xe2, 0xef, 0x10, 0x5d, 0x00, 0xb2, 0xea, 0x9a, 0xdd, 0xfc, 0xba, 0x85, 0xe4, +0x80, 0x64, 0x80, 0x66, 0x99, 0x99, 0xf0, 0x32, 0x70, 0x33, 0x81, 0xd8, 0x0a, 0xc9, 0x03, 0x02, +0xb4, 0xfc, 0x15, 0xe0, 0x9d, 0x6b, 0xe2, 0x5f, 0x8b, 0xf4, 0xdf, 0x0f, 0x78, 0x6f, 0x47, 0xd5, +0x3c, 0x41, 0xaf, 0xeb, 0x33, 0x0b, 0x6b, 0x0d, 0x37, 0x4c, 0xb4, 0x92, 0xee, 0xf2, 0xf6, 0x52, +0x09, 0xd9, 0x14, 0x51, 0x82, 0xce, 0xd8, 0x56, 0x38, 0x03, 0x80, 0xa4, 0x9e, 0x01, 0xa8, 0x25, +0xc9, 0xb3, 0x30, 0x0c, 0x0a, 0x2b, 0xed, 0xbd, 0x0f, 0xfe, 0x0d, 0xcc, 0xfd, 0xb3, 0x35, 0xcd, +0x32, 0x3b, 0xaf, 0xf8, 0x53, 0xbf, 0x63, 0x59, 0x80, 0x65, 0x8a, 0xeb, 0xc5, 0x3a, 0x34, 0x72, +0x80, 0x40, 0x20, 0x95, 0x17, 0x64, 0xaf, 0x5e, 0x8d, 0x86, 0x1c, 0x82, 0x01, 0xab, 0x7f, 0xf1, +0x0d, 0xb7, 0xed, 0x99, 0xff, 0x00, 0x44, 0x9a, 0xcf, 0xff, 0x00, 0x0a, 0xdd, 0x1f, 0xff, 0x00, +0x92, 0x68, 0x17, 0x2b, 0x3e, 0x19, 0xa2, 0xbd, 0x63, 0xf6, 0xc2, 0xfd, 0x87, 0xbe, 0x27, 0x7e, +0xc1, 0x1f, 0x11, 0x74, 0xdf, 0x09, 0xfc, 0x56, 0xf0, 0xec, 0x3e, 0x1b, 0xd7, 0xb5, 0x6d, 0x35, +0x75, 0x7b, 0x5b, 0x68, 0xf5, 0x2b, 0x6b, 0xe1, 0x25, 0xb3, 0x4b, 0x24, 0x41, 0xf7, 0xdb, 0xc8, +0xea, 0x32, 0xf1, 0x38, 0xc1, 0x20, 0xf1, 0xe8, 0x6b, 0xc9, 0xe8, 0x11, 0xfa, 0xf5, 0xff, 0x00, +0x06, 0x7c, 0x1f, 0xf8, 0xca, 0xcf, 0x8c, 0xbf, 0xf6, 0x29, 0x59, 0x7f, 0xe9, 0x63, 0x57, 0xf4, +0x05, 0x5f, 0xcf, 0xef, 0xfc, 0x19, 0xf1, 0xff, 0x00, 0x27, 0x59, 0xf1, 0x9b, 0xfe, 0xc5, 0x2b, +0x2f, 0xfd, 0x2c, 0x6a, 0xfd, 0xeb, 0xf1, 0xf7, 0x8e, 0xf4, 0x9f, 0x85, 0xfe, 0x08, 0xd6, 0x3c, +0x49, 0xaf, 0xdf, 0x41, 0xa5, 0xe8, 0x3e, 0x1f, 0xb1, 0x9f, 0x53, 0xd4, 0xaf, 0x67, 0x38, 0x8a, +0xce, 0xda, 0x08, 0xda, 0x49, 0x65, 0x63, 0xfd, 0xd5, 0x45, 0x66, 0x3e, 0xc0, 0xd5, 0x47, 0x63, +0x45, 0xb1, 0xf3, 0xf7, 0xfc, 0x14, 0xcf, 0xfe, 0x0a, 0x87, 0xf0, 0xf7, 0xfe, 0x09, 0x77, 0xf0, +0x30, 0x78, 0xab, 0xc5, 0xe6, 0x4d, 0x5b, 0xc4, 0x1a, 0xc1, 0x92, 0xdf, 0xc3, 0x3e, 0x19, 0xb3, +0x99, 0x56, 0xfb, 0xc4, 0x17, 0x2a, 0x01, 0x6c, 0x12, 0x08, 0x86, 0xde, 0x3d, 0xc8, 0x66, 0xb8, +0x60, 0x56, 0x35, 0x65, 0x00, 0x3c, 0x8f, 0x14, 0x52, 0x7f, 0x37, 0xbf, 0xb7, 0x8f, 0xfc, 0x16, +0x33, 0xe3, 0xd7, 0xfc, 0x14, 0x27, 0x59, 0xd4, 0x23, 0xf1, 0x6f, 0x8c, 0x2f, 0x34, 0x1f, 0x06, +0xdd, 0x16, 0x48, 0xbc, 0x1f, 0xe1, 0xe9, 0xa4, 0xb1, 0xd1, 0xd2, 0x13, 0x81, 0xb2, 0x75, 0x56, +0xdf, 0x78, 0x4e, 0x01, 0x2d, 0x72, 0xce, 0x37, 0x16, 0x28, 0xb1, 0xa9, 0xd8, 0x38, 0x7f, 0xf8, +0x28, 0x57, 0xed, 0xc9, 0xe2, 0x4f, 0xf8, 0x28, 0xaf, 0xed, 0x63, 0xe2, 0x6f, 0x8a, 0x3e, 0x22, +0x37, 0x16, 0xf0, 0xea, 0x72, 0x7d, 0x97, 0x42, 0xd2, 0xe5, 0x7d, 0xc3, 0x42, 0xd2, 0xa3, 0x66, +0xfb, 0x2d, 0xa0, 0xe4, 0x8d, 0xc1, 0x58, 0xbc, 0x85, 0x78, 0x79, 0xa4, 0x99, 0xc0, 0x01, 0xb0, +0x3c, 0x54, 0x9c, 0x54, 0x93, 0x29, 0x76, 0x23, 0xb7, 0xb4, 0x8a, 0xd1, 0x36, 0xc5, 0x1c, 0x71, +0xaf, 0x4c, 0x2a, 0x85, 0xa9, 0x2b, 0xde, 0xff, 0x00, 0x64, 0x9f, 0xf8, 0x25, 0xe7, 0xc7, 0xff, +0x00, 0xdb, 0xab, 0x43, 0xb8, 0xd5, 0xbe, 0x15, 0xfc, 0x32, 0xd6, 0xbc, 0x4b, 0xa1, 0x5a, 0xca, +0xd0, 0x49, 0xab, 0xcb, 0x71, 0x6d, 0xa6, 0xe9, 0xc5, 0xd5, 0x8a, 0xba, 0xc7, 0x71, 0x75, 0x2c, +0x49, 0x33, 0x23, 0x0c, 0x32, 0xc4, 0x5d, 0x94, 0xf0, 0x40, 0xaf, 0x6b, 0xff, 0x00, 0x88, 0x6d, +0xbf, 0x6c, 0xcf, 0xfa, 0x24, 0xd6, 0x7f, 0xf8, 0x56, 0xe8, 0xff, 0x00, 0xfc, 0x93, 0x40, 0xb9, +0x59, 0xf0, 0xcd, 0x15, 0xf6, 0x67, 0xc4, 0x8f, 0xf8, 0x37, 0xe3, 0xf6, 0xb5, 0xf8, 0x49, 0xf0, +0xf3, 0x5e, 0xf1, 0x57, 0x88, 0x3e, 0x18, 0xd9, 0xd8, 0xe8, 0x3e, 0x19, 0xd3, 0x6e, 0x75, 0x7d, +0x4a, 0xe0, 0x78, 0xa3, 0x4a, 0x94, 0xdb, 0xdb, 0x5b, 0xc4, 0xd2, 0xca, 0xe1, 0x12, 0xe0, 0xb3, +0x6d, 0x44, 0x27, 0x0a, 0x09, 0x3d, 0x07, 0x35, 0xf1, 0x9a, 0xb6, 0xe5, 0x07, 0xd7, 0x9a, 0x05, +0x6b, 0x11, 0xde, 0x7f, 0xc7, 0x9c, 0xdf, 0xee, 0x1f, 0xe5, 0x5f, 0xd9, 0x5f, 0xec, 0x2f, 0xff, +0x00, 0x26, 0x57, 0xf0, 0x7f, 0xfe, 0xc4, 0x7d, 0x13, 0xff, 0x00, 0x48, 0x21, 0xaf, 0xe3, 0x52, +0xf3, 0xfe, 0x3c, 0xe6, 0xff, 0x00, 0x70, 0xff, 0x00, 0x2a, 0xfe, 0xca, 0xff, 0x00, 0x61, 0x7f, +0xf9, 0x32, 0xbf, 0x83, 0xff, 0x00, 0xf6, 0x23, 0xe8, 0x9f, 0xfa, 0x41, 0x0d, 0x1d, 0x4d, 0x23, +0xb3, 0x3e, 0x36, 0xff, 0x00, 0x83, 0xa8, 0xff, 0x00, 0xe5, 0x13, 0x5a, 0xa7, 0xfd, 0x8d, 0x7a, +0x37, 0xfe, 0x8f, 0x35, 0xfc, 0xd0, 0x8e, 0x95, 0xfd, 0x2f, 0x7f, 0xc1, 0xd4, 0x7f, 0xf2, 0x89, +0xad, 0x53, 0xfe, 0xc6, 0xbd, 0x1b, 0xff, 0x00, 0x47, 0x9a, 0xfe, 0x68, 0x47, 0x4a, 0xa9, 0x13, +0x23, 0xd8, 0xbf, 0xe0, 0x9d, 0x5f, 0xf2, 0x91, 0x5f, 0xd9, 0xe7, 0xfe, 0xca, 0xa7, 0x85, 0x3f, +0xf4, 0xf5, 0x69, 0x5f, 0xd8, 0xd5, 0x7f, 0x1c, 0xbf, 0xf0, 0x4e, 0xaf, 0xf9, 0x48, 0xaf, 0xec, +0xf3, 0xff, 0x00, 0x65, 0x53, 0xc2, 0x9f, 0xfa, 0x7a, 0xb4, 0xaf, 0xec, 0x6a, 0x88, 0xec, 0x11, +0x0a, 0x28, 0xa2, 0xa8, 0xa3, 0xe3, 0x3f, 0xf8, 0x38, 0x2b, 0xe1, 0xf6, 0x9f, 0xf1, 0x13, 0xfe, +0x09, 0x05, 0xf1, 0xa2, 0x1d, 0x42, 0x3d, 0xdf, 0xd8, 0xfa, 0x65, 0xbe, 0xb5, 0x6a, 0xe1, 0x41, +0x78, 0x6e, 0x2d, 0x2f, 0x20, 0x9e, 0x32, 0xa4, 0xf4, 0xc9, 0x42, 0x84, 0x8e, 0x4a, 0xbb, 0x0e, +0xf5, 0xfc, 0xa7, 0x8a, 0xfe, 0xb3, 0x7f, 0xe0, 0xb9, 0xbf, 0xf2, 0x88, 0xef, 0x8f, 0x9f, 0xf6, +0x2a, 0xcd, 0xff, 0x00, 0xa1, 0xa5, 0x7f, 0x26, 0x55, 0x9b, 0xdc, 0x99, 0x10, 0xea, 0x1a, 0xa5, +0xce, 0x85, 0x65, 0x35, 0xf5, 0x9c, 0xcd, 0x6f, 0x79, 0x62, 0x86, 0xe2, 0xde, 0x64, 0xfb, 0xd1, +0x48, 0x9f, 0x32, 0x30, 0xf7, 0x0c, 0x01, 0x1f, 0x4a, 0xfe, 0xe0, 0x07, 0xde, 0xfc, 0xeb, 0xf8, +0x77, 0xf1, 0x2f, 0xfc, 0x8b, 0x9a, 0x87, 0xfd, 0x7b, 0x49, 0xff, 0x00, 0xa0, 0x9a, 0xfe, 0xe1, +0xdb, 0xef, 0x1f, 0xf3, 0xd8, 0xd3, 0x41, 0x12, 0xb6, 0xbf, 0xaf, 0xd9, 0xf8, 0x5f, 0x47, 0xba, +0xd4, 0x35, 0x0b, 0x9b, 0x7b, 0x2d, 0x3e, 0xc6, 0x17, 0xb8, 0xb9, 0xb9, 0xb8, 0x95, 0x62, 0x86, +0xda, 0x34, 0x52, 0xcf, 0x23, 0xbb, 0x10, 0xaa, 0x8a, 0xa0, 0x92, 0xc4, 0x80, 0x00, 0x24, 0xf1, +0x5f, 0x82, 0xbf, 0xf0, 0x55, 0xbf, 0xf8, 0x3a, 0x03, 0xc4, 0xbe, 0x3a, 0xf1, 0x1e, 0xa5, 0xe0, +0x5f, 0xd9, 0x9e, 0xf3, 0xfe, 0x11, 0xbf, 0x0c, 0xd9, 0xbc, 0x96, 0xd7, 0x7e, 0x3a, 0x92, 0xdd, +0x24, 0xd4, 0x35, 0x9f, 0xe1, 0x3f, 0x60, 0x8e, 0x45, 0x2b, 0x6f, 0x01, 0x1b, 0xb1, 0x33, 0xa9, +0x99, 0xf7, 0x06, 0x41, 0x06, 0xd0, 0xcf, 0xea, 0x9f, 0xf0, 0x75, 0xd7, 0xfc, 0x14, 0x7a, 0xff, +0x00, 0xc0, 0xde, 0x17, 0xd0, 0x7f, 0x66, 0xff, 0x00, 0x09, 0xdf, 0x49, 0x67, 0x37, 0x8b, 0xac, +0x86, 0xbb, 0xe3, 0x59, 0xa1, 0x6c, 0x3b, 0x69, 0xde, 0x63, 0x25, 0xa5, 0x86, 0xe1, 0xc8, 0x59, +0xe5, 0x8a, 0x59, 0x25, 0x5f, 0x94, 0xf9, 0x70, 0x44, 0xa7, 0x74, 0x73, 0xba, 0x9f, 0xc2, 0x51, +0xd2, 0x86, 0xca, 0x93, 0xb6, 0x88, 0xd0, 0xf1, 0xc7, 0x8b, 0xb5, 0x8f, 0x8a, 0x1e, 0x2d, 0xb9, +0xf1, 0x07, 0x8a, 0x35, 0x8d, 0x5b, 0xc4, 0xfe, 0x20, 0xbd, 0x39, 0xb9, 0xd5, 0x35, 0x8b, 0xd9, +0x75, 0x0b, 0xeb, 0x93, 0xea, 0xf3, 0xcc, 0xcd, 0x23, 0x77, 0xea, 0xc7, 0xa9, 0xf5, 0xac, 0xfa, +0xde, 0xf8, 0x61, 0xf0, 0xbb, 0xc4, 0xdf, 0x1b, 0x7c, 0x7f, 0xa6, 0x78, 0x53, 0xc1, 0xbe, 0x1f, +0xd6, 0x3c, 0x55, 0xe2, 0x6d, 0x66, 0x43, 0x15, 0x8e, 0x97, 0xa5, 0x5a, 0x3d, 0xd5, 0xd5, 0xc9, +0x0a, 0x59, 0xb6, 0xa2, 0x02, 0x76, 0xaa, 0x86, 0x66, 0x63, 0x85, 0x45, 0x56, 0x66, 0x21, 0x41, +0x23, 0xec, 0x1d, 0x37, 0xfe, 0x0d, 0xc3, 0xfd, 0xb3, 0x75, 0x1b, 0x28, 0xe6, 0x6f, 0x83, 0xf1, +0xda, 0x99, 0x06, 0x7c, 0xa9, 0xfc, 0x59, 0xa2, 0x89, 0x17, 0x9e, 0x32, 0x16, 0xec, 0x81, 0x9e, +0xb8, 0xce, 0x79, 0xe7, 0x07, 0x20, 0x22, 0x35, 0x67, 0xc3, 0xec, 0xbb, 0xd7, 0x07, 0x9f, 0xad, +0x77, 0x1f, 0xb3, 0xaf, 0xed, 0x31, 0xf1, 0x13, 0xf6, 0x43, 0xf1, 0xca, 0xf8, 0x97, 0xe1, 0x7f, +0x8d, 0x3c, 0x43, 0xe0, 0x3d, 0x6b, 0x72, 0xb4, 0xb3, 0x69, 0x17, 0x46, 0x28, 0xef, 0x02, 0x9c, +0xaa, 0x5c, 0x42, 0x73, 0x0d, 0xcc, 0x60, 0xe0, 0xf9, 0x73, 0xa3, 0xa1, 0x23, 0x25, 0x4d, 0x7d, +0x2f, 0xe3, 0x8f, 0xf8, 0x37, 0xa7, 0xf6, 0xc6, 0xf0, 0x0f, 0x87, 0x6e, 0x35, 0x4b, 0x9f, 0x83, +0x17, 0x9a, 0x85, 0xb5, 0xa2, 0x34, 0x92, 0xc7, 0xa5, 0xeb, 0xfa, 0x55, 0xf5, 0xc8, 0x50, 0x33, +0xf2, 0x41, 0x1d, 0xc9, 0x96, 0x53, 0xe8, 0xb1, 0xab, 0x31, 0xf4, 0xaf, 0x8d, 0xf5, 0x2d, 0x36, +0xeb, 0x44, 0xd5, 0x2e, 0xac, 0x6f, 0xad, 0x6e, 0xac, 0x6f, 0xec, 0x27, 0x92, 0xd6, 0xea, 0xd6, +0xe6, 0x16, 0x86, 0x7b, 0x59, 0xa3, 0x62, 0x92, 0x45, 0x22, 0x30, 0x0c, 0x8e, 0x8c, 0x0a, 0xb2, +0xb0, 0x0c, 0xa4, 0x10, 0x40, 0x22, 0x80, 0xd5, 0x1f, 0xd1, 0x07, 0xfc, 0x11, 0x67, 0xfe, 0x0e, +0x2d, 0xd3, 0x7f, 0x6c, 0xfd, 0x7b, 0x4b, 0xf8, 0x55, 0xf1, 0x8a, 0xdf, 0x4b, 0xf0, 0xbf, 0xc5, +0x4b, 0xc0, 0x2d, 0xf4, 0x8d, 0x5a, 0xd7, 0xf7, 0x3a, 0x57, 0x8b, 0x1c, 0x67, 0x11, 0x84, 0x62, +0x7e, 0xcd, 0x78, 0x57, 0xfe, 0x59, 0x64, 0xc7, 0x2b, 0x06, 0xf2, 0xca, 0x33, 0x2c, 0x03, 0xf5, +0x5a, 0xbf, 0x88, 0x5b, 0x7b, 0x89, 0xac, 0x6e, 0xa1, 0xb8, 0xb7, 0x9a, 0x7b, 0x5b, 0x8b, 0x79, +0x16, 0x68, 0x67, 0x82, 0x56, 0x8a, 0x68, 0x24, 0x52, 0x19, 0x1d, 0x1d, 0x48, 0x65, 0x65, 0x60, +0x08, 0x60, 0x41, 0x04, 0x02, 0x30, 0x40, 0xaf, 0xea, 0x9b, 0xfe, 0x08, 0x3f, 0xff, 0x00, 0x05, +0x1a, 0xb8, 0xff, 0x00, 0x82, 0x8e, 0x7e, 0xc3, 0xf6, 0x3a, 0xc7, 0x88, 0xae, 0x62, 0x9b, 0xe2, +0x37, 0x82, 0xae, 0x3f, 0xe1, 0x1e, 0xf1, 0x51, 0x55, 0x48, 0xfe, 0xd9, 0x3a, 0x22, 0xb4, 0x37, +0xc1, 0x17, 0x18, 0x5b, 0x88, 0x59, 0x5d, 0xb0, 0xaa, 0xa2, 0x65, 0xb8, 0x45, 0x01, 0x50, 0x53, +0x4c, 0xb8, 0xbb, 0x9f, 0x9b, 0x7f, 0xf0, 0x77, 0xd7, 0xec, 0xef, 0xff, 0x00, 0x08, 0xef, 0xed, +0x01, 0xf0, 0x97, 0xe2, 0xb5, 0xa4, 0x0d, 0xe4, 0xf8, 0xa7, 0x43, 0xb9, 0xf0, 0xc6, 0xa3, 0x22, +0x28, 0x58, 0xd2, 0x6b, 0x29, 0xbe, 0xd1, 0x6e, 0x5b, 0xd5, 0xe4, 0x8e, 0xf2, 0x70, 0x0f, 0xf7, +0x6d, 0x71, 0xd1, 0x54, 0x57, 0xe3, 0xd8, 0xaf, 0xe9, 0xdb, 0xfe, 0x0e, 0x6a, 0xfd, 0x9d, 0xff, +0x00, 0xe1, 0x7d, 0x7f, 0xc1, 0x28, 0x3c, 0x55, 0xaa, 0x5b, 0x5b, 0xc9, 0x71, 0xaa, 0x7c, 0x32, +0xd4, 0xec, 0xbc, 0x61, 0x6a, 0x88, 0x39, 0xd9, 0x13, 0x9b, 0x6b, 0xa6, 0x27, 0x23, 0xe5, 0x4b, +0x3b, 0xbb, 0x99, 0x3b, 0xff, 0x00, 0xab, 0x1c, 0x77, 0x1f, 0xcc, 0x48, 0xe9, 0x48, 0x99, 0x6e, +0x7e, 0x9d, 0x7f, 0xc1, 0xa8, 0x9f, 0xb4, 0x59, 0xf8, 0x57, 0xff, 0x00, 0x05, 0x18, 0xd6, 0x3c, +0x07, 0x73, 0x75, 0xe5, 0x69, 0xdf, 0x15, 0xbc, 0x33, 0x35, 0xbc, 0x50, 0x67, 0xfe, 0x3e, 0x35, +0x1d, 0x3c, 0x9b, 0xb8, 0x38, 0xe8, 0x76, 0xdb, 0x7f, 0x68, 0x9e, 0x99, 0xf9, 0xb8, 0xc7, 0x39, +0xfe, 0x90, 0xab, 0xf8, 0xd0, 0xfd, 0x8a, 0xff, 0x00, 0x68, 0x77, 0xfd, 0x92, 0xbf, 0x6c, 0x0f, +0x86, 0x3f, 0x13, 0x04, 0xd2, 0x43, 0x6f, 0xe0, 0x9f, 0x12, 0x59, 0x6a, 0x57, 0xe6, 0x3f, 0xbc, +0xf6, 0x22, 0x50, 0xb7, 0x91, 0x8c, 0x02, 0x72, 0xf6, 0xcd, 0x32, 0x70, 0x0f, 0xdf, 0xe8, 0x7a, +0x57, 0xf6, 0x59, 0x0c, 0xeb, 0x70, 0xbb, 0x94, 0xab, 0x21, 0x00, 0xab, 0x03, 0x90, 0xc0, 0xd5, +0x44, 0xa8, 0xec, 0x3e, 0x8a, 0x2b, 0x99, 0xf8, 0xcd, 0xf1, 0x57, 0x4b, 0xf8, 0x17, 0xf0, 0x87, +0xc5, 0x5e, 0x36, 0xd7, 0x24, 0xf2, 0x74, 0x5f, 0x07, 0xe8, 0xf7, 0x9a, 0xe6, 0xa1, 0x26, 0x71, +0xe5, 0xdb, 0xda, 0xc0, 0xf3, 0x4a, 0x7f, 0x04, 0x46, 0xaa, 0x03, 0xf9, 0x85, 0xff, 0x00, 0x83, +0x89, 0xff, 0x00, 0x68, 0x85, 0xfd, 0xa2, 0x7f, 0xe0, 0xad, 0x5f, 0x11, 0x8d, 0xbd, 0xc4, 0x77, +0x5a, 0x5f, 0x80, 0x62, 0xb4, 0xf0, 0x5d, 0x83, 0xaf, 0xf0, 0x8b, 0x44, 0x32, 0x5c, 0xa1, 0xf7, +0x5b, 0xeb, 0x8b, 0xd5, 0xff, 0x00, 0x80, 0x8f, 0xa0, 0xf8, 0x8c, 0xf4, 0xad, 0x2f, 0x19, 0xf8, +0xe7, 0x56, 0xf8, 0xa5, 0xe3, 0x5d, 0x6b, 0xc5, 0x3a, 0xf4, 0xdf, 0x68, 0xd7, 0xbc, 0x51, 0xa8, +0xdc, 0xeb, 0x3a, 0x9c, 0xbc, 0xfe, 0xf6, 0xee, 0xe6, 0x56, 0x9e, 0x66, 0xe4, 0x93, 0xcc, 0x8e, +0xc7, 0x92, 0x4f, 0x35, 0x97, 0x2c, 0x8b, 0x14, 0x6c, 0xcc, 0x70, 0xaa, 0x09, 0x27, 0xd0, 0x56, +0x64, 0x3d, 0xcf, 0xde, 0x6f, 0xf8, 0x33, 0xf3, 0xf6, 0x74, 0xfe, 0xc5, 0xf8, 0x29, 0xf1, 0x77, +0xe2, 0xb5, 0xd4, 0x6c, 0xb3, 0x78, 0x9b, 0x5a, 0xb5, 0xf0, 0xbe, 0x9e, 0x64, 0x8f, 0x05, 0x60, +0xb1, 0x84, 0xdc, 0x4b, 0x24, 0x67, 0x1f, 0x76, 0x49, 0x6f, 0x55, 0x0e, 0x09, 0xf9, 0xad, 0x31, +0xc1, 0x53, 0x9f, 0xd0, 0xef, 0xf8, 0x2b, 0x9f, 0x3f, 0xf0, 0x4b, 0x2f, 0xda, 0x3b, 0xfe, 0xc9, +0xaf, 0x88, 0x3f, 0xf4, 0xdf, 0x35, 0x60, 0xff, 0x00, 0xc1, 0x15, 0x7f, 0x67, 0x36, 0xfd, 0x97, +0x3f, 0xe0, 0x97, 0x5f, 0x06, 0xfc, 0x2b, 0x71, 0x6e, 0xd6, 0xba, 0xa5, 0xc6, 0x81, 0x1e, 0xbd, +0xaa, 0x47, 0x22, 0x01, 0x2c, 0x77, 0x9a, 0x8b, 0x35, 0xf4, 0xd1, 0xb9, 0x1d, 0x5a, 0x36, 0xb8, +0xf2, 0xb3, 0x93, 0x81, 0x10, 0x03, 0x80, 0x2b, 0x7b, 0xfe, 0x0a, 0xe7, 0xff, 0x00, 0x28, 0xb2, +0xfd, 0xa3, 0x7f, 0xec, 0x9b, 0x78, 0x83, 0xff, 0x00, 0x4d, 0xf3, 0x53, 0x35, 0x8e, 0x87, 0xf2, +0x5d, 0xf0, 0xa3, 0xe2, 0xff, 0x00, 0x8c, 0x3e, 0x02, 0x6b, 0x32, 0x6a, 0x5e, 0x03, 0xf1, 0x77, +0x8a, 0xfc, 0x0b, 0xa8, 0x4d, 0xfe, 0xb2, 0xeb, 0xc3, 0x9a, 0xc5, 0xce, 0x93, 0x34, 0x83, 0x04, +0x61, 0x9e, 0xdd, 0xd0, 0x91, 0x83, 0x8c, 0x12, 0x46, 0x09, 0xf5, 0xaf, 0xb1, 0x7e, 0x0d, 0x7f, +0xc1, 0xca, 0x7f, 0xb5, 0xcf, 0xc0, 0x1d, 0x39, 0xda, 0xe3, 0xc7, 0x5a, 0x37, 0xc4, 0x3b, 0x1b, +0x38, 0x49, 0x8e, 0xcf, 0xc5, 0xfa, 0x24, 0x37, 0x4a, 0x30, 0x18, 0xf3, 0x3d, 0xb7, 0xd9, 0xee, +0x58, 0x9c, 0xf5, 0x79, 0x9b, 0x18, 0x18, 0xe3, 0x20, 0xfc, 0x33, 0x54, 0xfc, 0x41, 0xff, 0x00, +0x20, 0x1b, 0xef, 0xfa, 0xf7, 0x93, 0xff, 0x00, 0x41, 0x34, 0x8c, 0xae, 0xd1, 0xfd, 0xbf, 0x68, +0xd7, 0x2d, 0x7d, 0xa5, 0xdb, 0xdc, 0x30, 0x0a, 0xd3, 0xc4, 0x92, 0x10, 0x3a, 0x02, 0x54, 0x1e, +0x3f, 0x3a, 0xb5, 0x54, 0x7c, 0x33, 0xff, 0x00, 0x22, 0xe5, 0x87, 0xfd, 0x7b, 0x47, 0xff, 0x00, +0xa0, 0x0a, 0xf8, 0xcf, 0xfe, 0x0b, 0xdf, 0xff, 0x00, 0x05, 0x11, 0xba, 0xff, 0x00, 0x82, 0x77, +0xfe, 0xc2, 0xba, 0x86, 0xa7, 0xe1, 0xbb, 0xb5, 0xb5, 0xf8, 0x87, 0xe3, 0xab, 0x8f, 0xf8, 0x46, +0xfc, 0x31, 0x20, 0x01, 0x9e, 0xc2, 0x59, 0x23, 0x66, 0x9e, 0xf8, 0x2f, 0xad, 0xbc, 0x0b, 0x23, +0x21, 0x21, 0x97, 0xce, 0x6b, 0x70, 0xca, 0x43, 0x10, 0x6a, 0xfa, 0x1a, 0xcb, 0x73, 0xe7, 0x9f, +0xf8, 0x2d, 0x1f, 0xfc, 0x1c, 0x6d, 0x63, 0xfb, 0x20, 0x78, 0x9b, 0x54, 0xf8, 0x53, 0xf0, 0x56, +0xdf, 0x48, 0xf1, 0x47, 0xc4, 0xcd, 0x3c, 0x3d, 0xae, 0xb5, 0xae, 0xdd, 0x7f, 0xa4, 0x69, 0x5e, +0x14, 0x9f, 0xa3, 0x40, 0xa8, 0x08, 0x17, 0x37, 0xa9, 0xce, 0xe4, 0x24, 0x45, 0x0b, 0xe0, 0x3f, +0x98, 0xcb, 0x24, 0x0b, 0xf8, 0x37, 0xfb, 0x45, 0xfe, 0xd3, 0x3f, 0x11, 0x3f, 0x6b, 0xbf, 0x1b, +0x37, 0x88, 0xbe, 0x28, 0x78, 0xd7, 0xc4, 0x5e, 0x3c, 0xd6, 0x37, 0x33, 0xc7, 0x2e, 0xaf, 0x76, +0x66, 0x8a, 0xd3, 0x71, 0x24, 0xad, 0xbc, 0x03, 0x10, 0xdb, 0x21, 0xc9, 0xfd, 0xdc, 0x08, 0x88, +0x32, 0x70, 0xa3, 0x35, 0xc3, 0xbc, 0x8f, 0x3c, 0x8d, 0x24, 0x92, 0x49, 0x34, 0xb2, 0x31, 0x77, +0x92, 0x47, 0x2e, 0xf2, 0x31, 0x39, 0x2c, 0xcc, 0x79, 0x2c, 0x49, 0x24, 0x93, 0xc9, 0x27, 0x26, +0x9d, 0x14, 0x4f, 0x71, 0x3c, 0x71, 0x46, 0x8f, 0x24, 0xb3, 0x38, 0x8e, 0x34, 0x45, 0x2c, 0xd2, +0x31, 0x38, 0x0a, 0x00, 0xe4, 0x92, 0x48, 0x00, 0x0e, 0x49, 0x20, 0x54, 0x99, 0xb9, 0x36, 0x31, +0x54, 0x22, 0xe1, 0x40, 0x03, 0xd0, 0x0a, 0x5a, 0xfb, 0x23, 0xe1, 0xb7, 0xfc, 0x1b, 0xf3, 0xfb, +0x61, 0x7c, 0x52, 0xf0, 0xa5, 0xae, 0xb5, 0x63, 0xf0, 0x57, 0x54, 0xd3, 0xac, 0x6f, 0xa3, 0x59, +0x60, 0x4d, 0x67, 0x58, 0xd3, 0xb4, 0xbb, 0xb6, 0x53, 0x9f, 0xbf, 0x6d, 0x71, 0x70, 0x93, 0xc4, +0xc3, 0x1c, 0xac, 0xb1, 0xa3, 0x72, 0x38, 0xad, 0xef, 0xf8, 0x86, 0xdb, 0xf6, 0xcc, 0xff, 0x00, +0xa2, 0x4d, 0x67, 0xff, 0x00, 0x85, 0x6e, 0x8f, 0xff, 0x00, 0xc9, 0x34, 0x07, 0x2b, 0x3e, 0x19, +0x3d, 0x2b, 0xfa, 0x40, 0xff, 0x00, 0x83, 0x50, 0xff, 0x00, 0x67, 0x1f, 0xf8, 0x55, 0x1f, 0xf0, +0x4e, 0x0b, 0xef, 0x1c, 0xdd, 0x40, 0xab, 0xa9, 0x7c, 0x56, 0xf1, 0x25, 0xde, 0xa5, 0x1c, 0x8d, +0x19, 0x59, 0x45, 0x85, 0xa1, 0xfb, 0x0c, 0x11, 0xb6, 0x7a, 0x8f, 0x3a, 0x0b, 0xb9, 0x54, 0xe0, +0x64, 0x5c, 0x67, 0x91, 0x82, 0x7f, 0x28, 0x6e, 0x7f, 0xe0, 0xdb, 0x8f, 0xdb, 0x3d, 0x6d, 0xa4, +0x31, 0xfc, 0x24, 0xb3, 0x69, 0x02, 0x92, 0xab, 0xff, 0x00, 0x09, 0x6e, 0x8f, 0xc9, 0xc7, 0x03, +0xfe, 0x3e, 0xab, 0xfa, 0x54, 0xfd, 0x92, 0xbe, 0x03, 0xd9, 0xfe, 0xcb, 0x3f, 0xb3, 0x07, 0xc3, +0xef, 0x86, 0xf6, 0x32, 0x24, 0xd6, 0xde, 0x05, 0xf0, 0xf5, 0x86, 0x86, 0x26, 0x50, 0x07, 0xda, +0x5e, 0xde, 0x04, 0x8d, 0xe6, 0x3c, 0x0c, 0xb4, 0x8e, 0xac, 0xe4, 0xe0, 0x64, 0xb1, 0x3c, 0x66, +0x84, 0x38, 0xa3, 0xd1, 0xab, 0xf1, 0x77, 0xfe, 0x0b, 0x11, 0xff, 0x00, 0x07, 0x36, 0x4b, 0xf0, +0xbf, 0xc5, 0x7a, 0xb7, 0xc3, 0x1f, 0xd9, 0xbe, 0x5d, 0x36, 0xfb, 0x5c, 0xd2, 0xa5, 0x6b, 0x4d, +0x5b, 0xc7, 0xb3, 0x47, 0x1d, 0xed, 0x9d, 0x94, 0xab, 0x90, 0xf0, 0xe9, 0xd0, 0xb0, 0x68, 0xa7, +0x91, 0x5b, 0x86, 0x9e, 0x50, 0xd1, 0x29, 0x42, 0xab, 0x1c, 0xbb, 0xb7, 0xa7, 0xb9, 0x7f, 0xc1, +0xcc, 0xdf, 0xf0, 0x52, 0x3d, 0x47, 0xf6, 0x38, 0xfd, 0x92, 0x34, 0xdf, 0x87, 0xfe, 0x0d, 0xd4, +0xa6, 0xd3, 0x7c, 0x7b, 0xf1, 0x81, 0xae, 0x74, 0xf1, 0x79, 0x6e, 0xfb, 0x67, 0xd2, 0x74, 0x78, +0x95, 0x45, 0xec, 0xf1, 0xb0, 0xe5, 0x26, 0x93, 0xcd, 0x8a, 0x08, 0xdb, 0x86, 0x02, 0x69, 0xa4, +0x46, 0x57, 0x84, 0x1a, 0xfe, 0x6c, 0x62, 0x89, 0x60, 0x89, 0x51, 0x15, 0x51, 0x54, 0x05, 0x55, +0x51, 0x80, 0xa0, 0x74, 0x02, 0xa9, 0xb0, 0x93, 0xb1, 0xd2, 0xfc, 0x63, 0xf8, 0xc3, 0xe2, 0xef, +0xda, 0x27, 0xc6, 0xd2, 0xf8, 0x93, 0xe2, 0x07, 0x8a, 0x3c, 0x41, 0xe3, 0x6d, 0x7e, 0x6d, 0xd9, +0xbf, 0xd7, 0x35, 0x09, 0x6f, 0xe7, 0x40, 0x4e, 0x76, 0x23, 0x48, 0x4f, 0x96, 0x83, 0x8c, 0x22, +0x6d, 0x45, 0x00, 0x00, 0x00, 0x02, 0xb9, 0xc0, 0x36, 0x8e, 0x2a, 0xd6, 0x83, 0xa0, 0xea, 0x1e, +0x2c, 0xd7, 0xec, 0x74, 0x9d, 0x23, 0x4f, 0xd4, 0x35, 0x7d, 0x5b, 0x54, 0xb8, 0x4b, 0x4b, 0x2b, +0x0b, 0x0b, 0x67, 0xba, 0xba, 0xbd, 0x9d, 0xce, 0xd4, 0x8a, 0x28, 0xa3, 0x05, 0xe4, 0x91, 0x98, +0x85, 0x55, 0x50, 0x58, 0x92, 0x00, 0x04, 0xd7, 0xd9, 0x5e, 0x14, 0xff, 0x00, 0x83, 0x76, 0xff, +0x00, 0x6c, 0x9f, 0x17, 0x68, 0x70, 0x6a, 0x11, 0xfc, 0x19, 0x9a, 0xc6, 0x2b, 0x94, 0x59, 0x23, +0x8a, 0xff, 0x00, 0xc4, 0x9a, 0x45, 0xb5, 0xc6, 0xd2, 0x01, 0x05, 0xa2, 0x6b, 0xad, 0xf1, 0x9e, +0x71, 0xb5, 0xc2, 0xb0, 0x20, 0x82, 0x05, 0x49, 0x3a, 0xb3, 0xe2, 0xb2, 0x33, 0x5a, 0xdf, 0x0e, +0xbc, 0x7b, 0xaf, 0x7c, 0x1e, 0xf1, 0x84, 0x1e, 0x22, 0xf0, 0x7e, 0xbd, 0xad, 0x78, 0x4b, 0xc4, +0x16, 0xa3, 0x10, 0xea, 0x9a, 0x25, 0xfc, 0xba, 0x7d, 0xec, 0x40, 0xf5, 0x0b, 0x34, 0x2c, 0xae, +0x01, 0xc7, 0x23, 0x38, 0x35, 0xf6, 0x2e, 0xb7, 0xff, 0x00, 0x06, 0xe6, 0x7e, 0xd9, 0x9a, 0x1e, +0x9b, 0x25, 0xd1, 0xf8, 0x3a, 0x2e, 0xd6, 0x10, 0x58, 0xc5, 0x6d, 0xe2, 0xad, 0x1a, 0x49, 0x48, +0x03, 0x27, 0x6a, 0x9b, 0xb0, 0x5b, 0xe8, 0xb9, 0x63, 0xd0, 0x02, 0x78, 0xaf, 0x8e, 0xbc, 0x7b, +0xe0, 0x2d, 0x77, 0xe1, 0x57, 0x8d, 0x75, 0x3f, 0x0d, 0x78, 0xa3, 0x45, 0xd5, 0xbc, 0x39, 0xe2, +0x2d, 0x16, 0x6f, 0xb3, 0xea, 0x1a, 0x5e, 0xa7, 0x68, 0xf6, 0x97, 0x96, 0x52, 0x6d, 0x0c, 0x16, +0x48, 0x9c, 0x06, 0x5c, 0xab, 0x2b, 0x0c, 0x8c, 0x32, 0xb0, 0x61, 0x90, 0x41, 0x20, 0x6a, 0x8f, +0xd8, 0xaf, 0xf8, 0x24, 0xa7, 0xfc, 0x1c, 0xff, 0x00, 0xab, 0xe9, 0x9e, 0x25, 0xd3, 0x7e, 0x1f, +0xfe, 0xd3, 0xd7, 0xd6, 0xf7, 0xda, 0x45, 0xe9, 0x4b, 0x6b, 0x0f, 0x88, 0x31, 0xc0, 0x96, 0xf3, +0x69, 0xf2, 0x16, 0xc2, 0x8d, 0x52, 0x38, 0xc2, 0xc6, 0xd0, 0x90, 0x71, 0xf6, 0xa8, 0xd5, 0x4c, +0x7b, 0x54, 0xca, 0x8e, 0xad, 0x24, 0xd1, 0xfe, 0xec, 0x5a, 0xdd, 0x2d, 0xdc, 0x61, 0xd0, 0xab, +0x23, 0x00, 0xca, 0xca, 0xdb, 0x95, 0xc1, 0xe8, 0x41, 0xf4, 0xf7, 0xaf, 0xe2, 0x1c, 0x8c, 0xd7, +0xf4, 0x01, 0xff, 0x00, 0x06, 0xa8, 0xff, 0x00, 0xc1, 0x47, 0xb5, 0x0f, 0x8d, 0x5f, 0x07, 0xf5, +0xcf, 0xd9, 0xff, 0x00, 0xc5, 0x9a, 0x84, 0x97, 0xfa, 0xe7, 0xc3, 0x2b, 0x28, 0xf5, 0x2f, 0x0b, +0x4f, 0x71, 0x31, 0x69, 0x66, 0xd0, 0x8b, 0xac, 0x2d, 0x6b, 0xce, 0x4e, 0xdb, 0x39, 0x9e, 0x24, +0x52, 0x4e, 0x04, 0x57, 0x50, 0x46, 0xaa, 0xa2, 0x1e, 0x5a, 0x2e, 0x2e, 0xfa, 0x1f, 0x84, 0x3f, +0x18, 0x3f, 0xe4, 0xaf, 0x78, 0xb3, 0xfe, 0xc3, 0x97, 0xff, 0x00, 0xfa, 0x53, 0x25, 0x73, 0xb5, +0xd1, 0x7c, 0x60, 0xff, 0x00, 0x92, 0xbd, 0xe2, 0xcf, 0xfb, 0x0e, 0x5f, 0xff, 0x00, 0xe9, 0x4c, +0x95, 0xce, 0xd2, 0x22, 0x5b, 0x9f, 0xd5, 0x27, 0xfc, 0x1b, 0xa9, 0xff, 0x00, 0x28, 0x69, 0xf8, +0x2b, 0xff, 0x00, 0x5e, 0xda, 0xa7, 0xfe, 0x9e, 0x2f, 0xab, 0xed, 0x8a, 0xf8, 0x9f, 0xfe, 0x0d, +0xd4, 0xff, 0x00, 0x94, 0x34, 0xfc, 0x15, 0xff, 0x00, 0xaf, 0x6d, 0x53, 0xff, 0x00, 0x4f, 0x17, +0xd5, 0xf6, 0xc5, 0x54, 0x76, 0x34, 0x61, 0x45, 0x14, 0x55, 0x08, 0xe6, 0x7c, 0x11, 0xf1, 0x9b, +0xc2, 0x7f, 0x13, 0x75, 0x1d, 0x5a, 0xcf, 0xc3, 0x7e, 0x26, 0xf0, 0xef, 0x88, 0x6f, 0x34, 0x1b, +0xb9, 0x74, 0xfd, 0x4e, 0x0d, 0x33, 0x53, 0x86, 0xee, 0x4d, 0x36, 0xe6, 0x19, 0x1a, 0x29, 0x60, +0x9d, 0x63, 0x62, 0x63, 0x92, 0x39, 0x11, 0xd1, 0x91, 0x80, 0x2a, 0xca, 0x41, 0x00, 0x82, 0x2b, +0xa6, 0xaf, 0xe3, 0xa3, 0xfe, 0x0a, 0x05, 0x77, 0x36, 0x87, 0xff, 0x00, 0x05, 0x2e, 0xf8, 0xff, +0x00, 0xa9, 0x58, 0xcd, 0x35, 0x8e, 0xa5, 0x69, 0xf1, 0x5b, 0xc5, 0x6f, 0x05, 0xdd, 0xb4, 0x86, +0x1b, 0x88, 0x1b, 0xfb, 0x66, 0xf0, 0x65, 0x24, 0x52, 0x19, 0x4e, 0x09, 0x19, 0x04, 0x75, 0xaf, +0x42, 0xf8, 0x0f, 0xff, 0x00, 0x05, 0xb8, 0xfd, 0xab, 0x7f, 0x67, 0x35, 0x86, 0x2d, 0x0f, 0xe3, +0x67, 0x8b, 0xb5, 0x5b, 0x18, 0x98, 0x16, 0xb2, 0xf1, 0x33, 0xc7, 0xe2, 0x18, 0xa5, 0x51, 0xfc, +0x1b, 0xef, 0x56, 0x59, 0x91, 0x7d, 0xa3, 0x91, 0x08, 0x1c, 0x02, 0x07, 0x15, 0x3c, 0xc2, 0xe6, +0x47, 0xf5, 0xab, 0x5f, 0x09, 0x7f, 0xc1, 0xcb, 0x9f, 0xf2, 0x85, 0x5f, 0x8c, 0x1f, 0xf5, 0xf3, +0xe1, 0xdf, 0xfd, 0x48, 0xb4, 0xba, 0xec, 0x7f, 0xe0, 0x88, 0xff, 0x00, 0xb7, 0x37, 0x8c, 0xbf, +0xe0, 0xa1, 0x9f, 0xb0, 0x8e, 0x9d, 0xf1, 0x1b, 0xc7, 0xd6, 0xbe, 0x1d, 0xb5, 0xf1, 0x14, 0xda, +0xc5, 0xfe, 0x97, 0x28, 0xd1, 0x2d, 0x25, 0xb5, 0xb5, 0x92, 0x3b, 0x77, 0x08, 0xaf, 0xb2, 0x49, +0x65, 0x21, 0xd8, 0x72, 0xd8, 0x60, 0xb9, 0x3c, 0x2a, 0x8e, 0x2b, 0x8e, 0xff, 0x00, 0x83, 0x97, +0x3f, 0xe5, 0x0a, 0xbf, 0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x74, 0x0d, 0xec, +0x7f, 0x2e, 0x15, 0xd8, 0x7e, 0xce, 0xff, 0x00, 0xf2, 0x71, 0x3f, 0x0f, 0x7f, 0xec, 0x6a, 0xd2, +0x7f, 0xf4, 0xb6, 0x2a, 0xe3, 0xeb, 0xb0, 0xfd, 0x9d, 0xff, 0x00, 0xe4, 0xe2, 0x7e, 0x1e, 0xff, +0x00, 0xd8, 0xd5, 0xa4, 0xff, 0x00, 0xe9, 0x6c, 0x55, 0x26, 0x67, 0xf6, 0x99, 0x5f, 0xca, 0x9f, +0xfc, 0x1c, 0x2f, 0xf1, 0x5a, 0xeb, 0xe2, 0xc7, 0xfc, 0x16, 0x03, 0xe2, 0xf3, 0x4d, 0x71, 0x24, +0xd6, 0x7e, 0x19, 0x9a, 0xc3, 0xc3, 0xd6, 0x08, 0xe3, 0xfe, 0x3d, 0xe2, 0xb7, 0xb0, 0xb7, 0x32, +0x20, 0xf6, 0x37, 0x32, 0x5c, 0xbf, 0xfd, 0xb4, 0xaf, 0xea, 0xb2, 0xbf, 0x92, 0x3f, 0xf8, 0x2d, +0x67, 0xfc, 0xa5, 0x9f, 0xe3, 0xef, 0xfd, 0x8d, 0x52, 0x7f, 0xe8, 0x88, 0x6a, 0xa4, 0x5c, 0xb6, +0x3e, 0x5f, 0x3d, 0x2b, 0xf7, 0x63, 0xfe, 0x0d, 0x02, 0xfd, 0x99, 0x3c, 0x3b, 0x37, 0xc1, 0xff, +0x00, 0x8a, 0x9f, 0x19, 0x66, 0x81, 0x66, 0xf1, 0x6c, 0xbe, 0x21, 0x3e, 0x08, 0xb5, 0x9e, 0x44, +0x05, 0xac, 0x2c, 0x61, 0xb4, 0xb3, 0xbd, 0x94, 0x46, 0x7a, 0x8f, 0x3e, 0x4b, 0xa8, 0xb7, 0xfa, +0x8b, 0x48, 0xb1, 0x8e, 0x73, 0xf8, 0x4e, 0x7a, 0x57, 0xf4, 0x41, 0xff, 0x00, 0x06, 0x7f, 0xff, +0x00, 0xca, 0x3a, 0xfe, 0x25, 0x7f, 0xd9, 0x54, 0xbd, 0xff, 0x00, 0xd3, 0x2e, 0x8b, 0x49, 0x6a, +0x28, 0xee, 0x7e, 0xae, 0x51, 0x45, 0x15, 0x65, 0x1f, 0xce, 0xbf, 0xfc, 0x1d, 0xdf, 0xff, 0x00, +0x29, 0x0e, 0xf8, 0x7d, 0xff, 0x00, 0x64, 0xe6, 0xdb, 0xff, 0x00, 0x4e, 0x7a, 0x85, 0x7e, 0x55, +0xd7, 0xea, 0xa7, 0xfc, 0x1d, 0xdf, 0xff, 0x00, 0x29, 0x0e, 0xf8, 0x7d, 0xff, 0x00, 0x64, 0xe6, +0xdb, 0xff, 0x00, 0x4e, 0x7a, 0x85, 0x7e, 0x55, 0xd6, 0x64, 0xcb, 0x73, 0xf5, 0xeb, 0xfe, 0x0c, +0xf8, 0xff, 0x00, 0x93, 0xac, 0xf8, 0xcd, 0xff, 0x00, 0x62, 0x95, 0x97, 0xfe, 0x96, 0x35, 0x7e, +0x8e, 0x7f, 0xc1, 0xc7, 0xdf, 0x15, 0xae, 0xbe, 0x14, 0xff, 0x00, 0xc1, 0x1f, 0xbe, 0x2a, 0x1b, +0x1b, 0xaf, 0xb2, 0xde, 0xf8, 0x9b, 0xfb, 0x3b, 0xc3, 0xa8, 0xc0, 0xff, 0x00, 0xac, 0x86, 0xee, +0xfe, 0xde, 0x3b, 0x94, 0xea, 0x3e, 0xf5, 0xaf, 0xda, 0x17, 0x8f, 0x5f, 0x4c, 0xd7, 0xe7, 0x1f, +0xfc, 0x19, 0xf1, 0xff, 0x00, 0x27, 0x59, 0xf1, 0x9b, 0xfe, 0xc5, 0x2b, 0x2f, 0xfd, 0x2c, 0x6a, +0xfb, 0x93, 0xfe, 0x0e, 0xa3, 0xff, 0x00, 0x94, 0x4d, 0x6a, 0x9f, 0xf6, 0x35, 0xe8, 0xdf, 0xfa, +0x3c, 0xd1, 0x1d, 0x8a, 0xe8, 0x7f, 0x34, 0x23, 0xa5, 0x76, 0x5f, 0xb3, 0x7f, 0xc2, 0x88, 0xbe, +0x3e, 0x7e, 0xd2, 0x5f, 0x0e, 0x3c, 0x03, 0x3d, 0xd4, 0xb6, 0x10, 0x78, 0xf3, 0xc5, 0x7a, 0x4f, +0x86, 0xa4, 0xba, 0x8b, 0x1e, 0x65, 0xb2, 0x5f, 0x5f, 0x43, 0x6a, 0x64, 0x5c, 0xe4, 0x65, 0x44, +0xa5, 0x86, 0x41, 0xe4, 0x74, 0x35, 0xc6, 0x8e, 0x95, 0xec, 0x5f, 0xf0, 0x4e, 0xaf, 0xf9, 0x48, +0xaf, 0xec, 0xf3, 0xff, 0x00, 0x65, 0x53, 0xc2, 0x9f, 0xfa, 0x7a, 0xb4, 0xa0, 0xcc, 0xfe, 0xbe, +0xfe, 0x18, 0x7c, 0x30, 0xd0, 0x7e, 0x0b, 0xf8, 0x03, 0x47, 0xf0, 0xaf, 0x85, 0xb4, 0xbb, 0x3d, +0x0f, 0xc3, 0x7e, 0x1e, 0xb2, 0x8b, 0x4e, 0xd3, 0x34, 0xeb, 0x48, 0xfc, 0xb8, 0x6c, 0xad, 0xe2, +0x50, 0xa9, 0x1a, 0x8f, 0x40, 0x00, 0xeb, 0xc9, 0xea, 0x79, 0x24, 0xd6, 0xfd, 0x14, 0x56, 0x86, +0x87, 0x8c, 0xff, 0x00, 0xc1, 0x46, 0xff, 0x00, 0xe5, 0x1e, 0x9f, 0x1e, 0x3f, 0xec, 0x9d, 0xf8, +0x83, 0xff, 0x00, 0x4d, 0xb7, 0x15, 0xfc, 0x73, 0xc1, 0xfe, 0xa1, 0x3f, 0xdd, 0x15, 0xfd, 0x8c, +0x7f, 0xc1, 0x46, 0xff, 0x00, 0xe5, 0x1e, 0x9f, 0x1e, 0x3f, 0xec, 0x9d, 0xf8, 0x83, 0xff, 0x00, +0x4d, 0xb7, 0x15, 0xfc, 0x73, 0xc1, 0xfe, 0xa1, 0x3f, 0xdd, 0x15, 0x0c, 0x99, 0x0d, 0xbc, 0xff, +0x00, 0x8f, 0x39, 0xbf, 0xdc, 0x3f, 0xca, 0xbf, 0xb2, 0xbf, 0xd8, 0x5f, 0xfe, 0x4c, 0xaf, 0xe0, +0xff, 0x00, 0xfd, 0x88, 0xfa, 0x27, 0xfe, 0x90, 0x43, 0x5f, 0xc6, 0xa5, 0xe7, 0xfc, 0x79, 0xcd, +0xfe, 0xe1, 0xfe, 0x55, 0xfd, 0x95, 0xfe, 0xc2, 0xff, 0x00, 0xf2, 0x65, 0x7f, 0x07, 0xff, 0x00, +0xec, 0x47, 0xd1, 0x3f, 0xf4, 0x82, 0x1a, 0x5d, 0x4a, 0x8e, 0xcc, 0xf8, 0xdb, 0xfe, 0x0e, 0xa3, +0xff, 0x00, 0x94, 0x4d, 0x6a, 0x9f, 0xf6, 0x35, 0xe8, 0xdf, 0xfa, 0x3c, 0xd7, 0xf3, 0x42, 0x3a, +0x57, 0xf4, 0xbd, 0xff, 0x00, 0x07, 0x51, 0xff, 0x00, 0xca, 0x26, 0xb5, 0x4f, 0xfb, 0x1a, 0xf4, +0x6f, 0xfd, 0x1e, 0x6b, 0xf9, 0xa1, 0x1d, 0x2a, 0xa4, 0x4c, 0x8f, 0x62, 0xff, 0x00, 0x82, 0x75, +0x7f, 0xca, 0x45, 0x7f, 0x67, 0x9f, 0xfb, 0x2a, 0x9e, 0x14, 0xff, 0x00, 0xd3, 0xd5, 0xa5, 0x7f, +0x63, 0x55, 0xfc, 0x72, 0xff, 0x00, 0xc1, 0x3a, 0xbf, 0xe5, 0x22, 0xbf, 0xb3, 0xcf, 0xfd, 0x95, +0x4f, 0x0a, 0x7f, 0xe9, 0xea, 0xd2, 0xbf, 0xb1, 0xaa, 0x23, 0xb0, 0x44, 0x28, 0xa2, 0x8a, 0xa2, +0x8f, 0x94, 0x3f, 0xe0, 0xb9, 0xbf, 0xf2, 0x88, 0xef, 0x8f, 0x9f, 0xf6, 0x2a, 0xcd, 0xff, 0x00, +0xa1, 0xa5, 0x7f, 0x26, 0x55, 0xfd, 0x66, 0xff, 0x00, 0xc1, 0x73, 0x7f, 0xe5, 0x11, 0xdf, 0x1f, +0x3f, 0xec, 0x55, 0x9b, 0xff, 0x00, 0x43, 0x4a, 0xfe, 0x4c, 0xab, 0x37, 0xb9, 0x32, 0x28, 0xf8, +0x97, 0xfe, 0x45, 0xcd, 0x43, 0xfe, 0xbd, 0xa4, 0xff, 0x00, 0xd0, 0x4d, 0x7f, 0x70, 0xed, 0xf7, +0xcf, 0xf9, 0xec, 0x6b, 0xf8, 0x78, 0xf1, 0x2f, 0xfc, 0x8b, 0x9a, 0x87, 0xfd, 0x7b, 0x49, 0xff, +0x00, 0xa0, 0x9a, 0xfe, 0xe1, 0x9f, 0xef, 0x37, 0xf9, 0xec, 0x69, 0xa0, 0x89, 0xfc, 0x92, 0xff, +0x00, 0xc1, 0x6a, 0x3e, 0x2e, 0x5c, 0x7c, 0x6c, 0xff, 0x00, 0x82, 0xaf, 0x7c, 0x78, 0xd6, 0x2e, +0x26, 0xf3, 0x97, 0x4f, 0xf1, 0x4c, 0xfe, 0x1f, 0x84, 0x07, 0xdc, 0xb1, 0x47, 0xa6, 0xa2, 0x69, +0xe1, 0x54, 0x64, 0x85, 0x19, 0xb6, 0x62, 0x40, 0xc7, 0xcc, 0xce, 0x48, 0xc9, 0x35, 0xf3, 0x09, +0xaf, 0x62, 0xff, 0x00, 0x82, 0x8a, 0xff, 0x00, 0xca, 0x45, 0x7f, 0x68, 0x6f, 0xfb, 0x2a, 0x9e, +0x2b, 0xff, 0x00, 0xd3, 0xd5, 0xdd, 0x78, 0xed, 0x22, 0x4f, 0xe8, 0x33, 0xfe, 0x0d, 0x23, 0xfd, +0x97, 0x3c, 0x3b, 0xe1, 0x8f, 0xd8, 0xf7, 0xc5, 0xdf, 0x17, 0x1a, 0xce, 0xd6, 0x7f, 0x18, 0xf8, +0xd3, 0xc4, 0x17, 0x1a, 0x22, 0xdf, 0x98, 0xf7, 0x4d, 0x65, 0xa6, 0x5a, 0x2c, 0x41, 0x6d, 0x95, +0x8f, 0xdd, 0x0f, 0x70, 0x65, 0x95, 0xf6, 0xe0, 0x38, 0x10, 0x06, 0xc9, 0x89, 0x71, 0xfa, 0xe1, +0x5f, 0xc9, 0x4f, 0xec, 0x85, 0xff, 0x00, 0x05, 0x9e, 0xfd, 0xa1, 0x3f, 0x61, 0x5f, 0x83, 0x71, +0xf8, 0x07, 0xe1, 0xaf, 0x8a, 0xb4, 0x8d, 0x1f, 0xc3, 0x30, 0xde, 0xcf, 0x7e, 0xb6, 0xf7, 0x3a, +0x15, 0xad, 0xe4, 0x9e, 0x74, 0xc4, 0x19, 0x09, 0x92, 0x44, 0x2c, 0x72, 0x40, 0xe3, 0x3c, 0x57, +0xa8, 0x7f, 0xc4, 0x4c, 0x7f, 0xb6, 0x27, 0xfd, 0x0f, 0xde, 0x1d, 0xff, 0x00, 0xc2, 0x52, 0xc3, +0xff, 0x00, 0x8d, 0xd3, 0x52, 0x34, 0x4d, 0x58, 0xfe, 0xa1, 0xab, 0xf9, 0xf9, 0xff, 0x00, 0x83, +0xba, 0xff, 0x00, 0x66, 0x3d, 0x03, 0xe1, 0xbf, 0xed, 0x1b, 0xf0, 0xbb, 0xe2, 0x7e, 0x8f, 0x67, +0x15, 0xae, 0xaf, 0xf1, 0x27, 0x4e, 0xd4, 0x34, 0xff, 0x00, 0x10, 0x3c, 0x4a, 0xa8, 0xb7, 0x93, +0xe9, 0xdf, 0x63, 0x5b, 0x6b, 0x87, 0x03, 0x96, 0x95, 0xa1, 0xb9, 0x31, 0x33, 0x1f, 0xe0, 0xb5, +0x85, 0x73, 0xc0, 0xaf, 0x9f, 0xff, 0x00, 0xe2, 0x26, 0x3f, 0xdb, 0x13, 0xfe, 0x87, 0xef, 0x0e, +0xff, 0x00, 0xe1, 0x29, 0x61, 0xff, 0x00, 0xc6, 0xeb, 0xc1, 0xff, 0x00, 0x6d, 0xff, 0x00, 0xf8, +0x29, 0xc7, 0xc6, 0x4f, 0xf8, 0x28, 0xad, 0xb7, 0x86, 0x61, 0xf8, 0xb1, 0xaf, 0xe9, 0xba, 0xe2, +0x78, 0x3d, 0xee, 0x5f, 0x4b, 0xfb, 0x2e, 0x93, 0x6f, 0x62, 0x61, 0x37, 0x02, 0x21, 0x2e, 0x7c, +0xa5, 0x1b, 0xb3, 0xe4, 0xc7, 0xd7, 0xa6, 0x0f, 0xad, 0x0e, 0x40, 0xda, 0xb1, 0xe0, 0x35, 0xfa, +0x9b, 0xff, 0x00, 0x06, 0x92, 0xfc, 0x69, 0xba, 0xf0, 0x4f, 0xfc, 0x14, 0x0f, 0xc6, 0x9e, 0x09, +0x69, 0xf6, 0x69, 0x3e, 0x3d, 0xf0, 0x64, 0x97, 0x2f, 0x16, 0xdc, 0xf9, 0xb7, 0xba, 0x7d, 0xcc, +0x4f, 0x6e, 0x4f, 0x3c, 0x05, 0x82, 0xe6, 0xfb, 0xd7, 0x96, 0x1e, 0xf5, 0xf9, 0x65, 0x5f, 0xa1, +0x5f, 0xf0, 0x6b, 0xd7, 0xfc, 0xa5, 0xd3, 0xc3, 0xbf, 0xf6, 0x2c, 0x6b, 0x1f, 0xfa, 0x29, 0x29, +0x13, 0x1d, 0xcf, 0xe9, 0x33, 0xe3, 0x3f, 0xc2, 0xad, 0x2f, 0xe3, 0xa7, 0xc2, 0x1f, 0x15, 0x78, +0x27, 0x5c, 0x8f, 0xce, 0xd1, 0x7c, 0x61, 0xa3, 0x5e, 0x68, 0x7a, 0x84, 0x78, 0xcf, 0x99, 0x6f, +0x75, 0x03, 0xc3, 0x28, 0xfc, 0x51, 0xcd, 0x7f, 0x17, 0x7e, 0x32, 0xf0, 0x3e, 0xab, 0xf0, 0xbf, +0xc6, 0x9a, 0xd7, 0x85, 0xf5, 0xe8, 0x7e, 0xcf, 0xaf, 0x78, 0x63, 0x50, 0xb9, 0xd1, 0xf5, 0x38, +0x79, 0xfd, 0xcd, 0xd5, 0xb4, 0xad, 0x04, 0xc9, 0xcf, 0x3c, 0x48, 0x8c, 0x39, 0x00, 0xf1, 0x5f, +0xdb, 0x55, 0x7f, 0x2b, 0xdf, 0xf0, 0x71, 0x27, 0xec, 0xee, 0xbf, 0xb3, 0xaf, 0xfc, 0x15, 0xa3, +0xe2, 0x32, 0xdb, 0x5b, 0xad, 0xae, 0x95, 0xe3, 0xe8, 0xed, 0x7c, 0x6b, 0x60, 0x8a, 0x3a, 0x8b, +0xc4, 0x29, 0x72, 0xe7, 0xdd, 0xaf, 0xad, 0xef, 0x5b, 0xf1, 0xef, 0xd4, 0xd4, 0x87, 0x2d, 0x8f, +0x88, 0xa5, 0x8d, 0x65, 0x8d, 0x95, 0x86, 0xe5, 0x60, 0x41, 0x1e, 0xa2, 0xbf, 0xad, 0x8f, 0xf8, +0x22, 0xc7, 0xed, 0x17, 0xff, 0x00, 0x0d, 0x4b, 0xff, 0x00, 0x04, 0xba, 0xf8, 0x37, 0xe2, 0xab, +0x8b, 0x86, 0xba, 0xd5, 0x21, 0xd0, 0x23, 0xd0, 0x75, 0x49, 0x1d, 0x81, 0x96, 0x4b, 0xcd, 0x39, +0xda, 0xc6, 0x69, 0x1c, 0x76, 0x69, 0x1a, 0xdc, 0xcb, 0xd0, 0x64, 0x48, 0x08, 0xe0, 0x8a, 0xfe, +0x4a, 0x4f, 0x4a, 0xfd, 0xe4, 0xff, 0x00, 0x83, 0x3f, 0x3f, 0x68, 0xaf, 0xed, 0x9f, 0x82, 0x5f, +0x17, 0x7e, 0x14, 0xdd, 0x4c, 0x5a, 0x6f, 0x0c, 0xeb, 0x56, 0xde, 0x28, 0xd3, 0xd6, 0x49, 0x3e, +0x63, 0x05, 0xf4, 0x26, 0xde, 0x54, 0x8c, 0x67, 0xee, 0x47, 0x2d, 0x92, 0xb9, 0xc0, 0x1f, 0x35, +0xd6, 0x79, 0x2d, 0x52, 0x28, 0xf6, 0x3f, 0x66, 0x2b, 0xf3, 0xef, 0xfe, 0x0e, 0x69, 0xfd, 0xa2, +0x5b, 0xe0, 0x2f, 0xfc, 0x12, 0x83, 0xc5, 0x5a, 0x5d, 0xb5, 0xc4, 0x96, 0xfa, 0xa7, 0xc4, 0xdd, +0x4a, 0xcb, 0xc1, 0xf6, 0x8c, 0x87, 0xf8, 0x25, 0x63, 0x73, 0x74, 0xa4, 0x63, 0x95, 0x7b, 0x3b, +0x5b, 0x98, 0xfb, 0x7f, 0xac, 0x1c, 0xf6, 0x3f, 0xa0, 0x95, 0xf8, 0x11, 0xff, 0x00, 0x07, 0x7d, +0x7e, 0xd1, 0x1f, 0xf0, 0x90, 0xfc, 0x7f, 0xf8, 0x4b, 0xf0, 0xa6, 0xd6, 0x76, 0xf2, 0x7c, 0x2d, +0xa2, 0x5c, 0xf8, 0xa3, 0x51, 0x89, 0x58, 0x34, 0x6f, 0x35, 0xec, 0xbf, 0x67, 0xb7, 0x0c, 0x3b, +0x3c, 0x71, 0xd9, 0xce, 0x40, 0xeb, 0xb6, 0xe7, 0x27, 0x86, 0x53, 0x55, 0x22, 0x8f, 0xc7, 0xa1, +0x5e, 0x99, 0xfb, 0x16, 0xfe, 0xcf, 0x4f, 0xfb, 0x59, 0xfe, 0xd7, 0xdf, 0x0c, 0x7e, 0x19, 0xf9, +0x33, 0x4d, 0x6f, 0xe3, 0x6f, 0x12, 0xd8, 0xe9, 0x97, 0xe2, 0x2f, 0xbf, 0x1d, 0x8b, 0x4a, 0x1a, +0xf2, 0x41, 0xc8, 0xfb, 0x96, 0xcb, 0x33, 0xf5, 0x1f, 0x73, 0xa8, 0xaf, 0x33, 0xaf, 0xd3, 0xaf, +0xf8, 0x35, 0x13, 0xf6, 0x75, 0x3f, 0x15, 0x3f, 0xe0, 0xa3, 0x3a, 0xc7, 0x8f, 0x2e, 0x2d, 0x4c, +0xba, 0x77, 0xc2, 0x9f, 0x0c, 0xcf, 0x71, 0x14, 0xe0, 0x7f, 0xc7, 0xbe, 0xa3, 0xa8, 0x13, 0x69, +0x00, 0xf6, 0xdd, 0x6d, 0xfd, 0xa3, 0xef, 0xf2, 0xfd, 0x6a, 0x48, 0x8e, 0xac, 0xfe, 0x8f, 0xa0, +0x81, 0x6d, 0xd7, 0x6a, 0x05, 0x54, 0x00, 0x05, 0x50, 0x30, 0x14, 0x0e, 0xc2, 0xbe, 0x79, 0xff, +0x00, 0x82, 0xb9, 0xff, 0x00, 0xca, 0x2c, 0xbf, 0x68, 0xdf, 0xfb, 0x26, 0xde, 0x20, 0xff, 0x00, +0xd3, 0x7c, 0xd5, 0xf4, 0x55, 0x7c, 0xeb, 0xff, 0x00, 0x05, 0x73, 0xff, 0x00, 0x94, 0x59, 0x7e, +0xd1, 0xbf, 0xf6, 0x4d, 0xbc, 0x41, 0xff, 0x00, 0xa6, 0xf9, 0xaa, 0x99, 0xac, 0x77, 0x3f, 0x90, +0xda, 0xa7, 0xe2, 0x0f, 0xf9, 0x00, 0xdf, 0x7f, 0xd7, 0xbc, 0x9f, 0xfa, 0x09, 0xab, 0x95, 0x4f, +0xc4, 0x1f, 0xf2, 0x01, 0xbe, 0xff, 0x00, 0xaf, 0x79, 0x3f, 0xf4, 0x13, 0x52, 0x62, 0x7f, 0x6f, +0x5e, 0x19, 0xff, 0x00, 0x91, 0x72, 0xc7, 0xfe, 0xbd, 0xa3, 0xff, 0x00, 0xd0, 0x05, 0x7f, 0x3e, +0xdf, 0xf0, 0x77, 0xc7, 0xc5, 0x0b, 0xdd, 0x6b, 0xf6, 0xdc, 0xf8, 0x5b, 0xe0, 0xa9, 0x37, 0x7f, +0x66, 0xf8, 0x67, 0xc0, 0xcd, 0xad, 0xdb, 0x8e, 0xde, 0x6e, 0xa1, 0xa8, 0x5c, 0x43, 0x2f, 0xbe, +0x76, 0xe9, 0x90, 0xfb, 0x7e, 0xb5, 0xfd, 0x04, 0xf8, 0x63, 0xfe, 0x45, 0xdb, 0x0f, 0xfa, 0xf7, +0x8f, 0xff, 0x00, 0x40, 0x15, 0xfc, 0xe8, 0xff, 0x00, 0xc1, 0xdc, 0x3f, 0xf2, 0x94, 0x4f, 0x09, +0x7f, 0xd9, 0x2b, 0xd2, 0xbf, 0xf4, 0xed, 0xad, 0x53, 0xe8, 0x6b, 0x3e, 0xa7, 0xe5, 0xf8, 0xaf, +0xd4, 0x4f, 0xf8, 0x35, 0x23, 0xf6, 0x5c, 0xf0, 0xef, 0xc6, 0xef, 0xdb, 0x9b, 0xc5, 0x5e, 0x37, +0xf1, 0x0d, 0x9d, 0xbe, 0xa4, 0xdf, 0x0a, 0x74, 0x38, 0x6f, 0x34, 0x7b, 0x79, 0xd3, 0x72, 0x43, +0xa8, 0x5d, 0xcc, 0xd1, 0xc7, 0x75, 0x8e, 0x85, 0xe2, 0x8a, 0x19, 0xc2, 0xe7, 0x3b, 0x5a, 0x60, +0xe3, 0x0c, 0x8a, 0x47, 0xe5, 0xdd, 0x7e, 0xca, 0x7f, 0xc1, 0x9c, 0xbf, 0xf2, 0x5b, 0x7e, 0x3e, +0x7f, 0xd8, 0x0f, 0x44, 0xff, 0x00, 0xd2, 0x8b, 0xea, 0x92, 0x23, 0xb9, 0xfb, 0xd1, 0x45, 0x14, +0x56, 0xa5, 0x05, 0x14, 0x51, 0x40, 0x1f, 0xcc, 0x8f, 0xfc, 0x1d, 0x0d, 0xf1, 0x66, 0xe3, 0xe2, +0x37, 0xfc, 0x15, 0x9f, 0x5c, 0xd1, 0xa4, 0x98, 0x35, 0xbf, 0x80, 0x7c, 0x35, 0xa4, 0xe8, 0x70, +0xc4, 0xaf, 0xf2, 0xc4, 0x65, 0x84, 0xea, 0x2e, 0x4a, 0xe4, 0x80, 0xcd, 0xf6, 0xe5, 0xc9, 0xe0, +0x95, 0x54, 0xce, 0x40, 0x5a, 0xfc, 0xf1, 0x3d, 0x2b, 0xed, 0x0f, 0xf8, 0x38, 0x93, 0xfe, 0x53, +0x55, 0xf1, 0xdf, 0xfe, 0xbe, 0x74, 0x2f, 0xfd, 0x47, 0x34, 0xaa, 0xf8, 0xbe, 0xb3, 0x22, 0x5b, +0x9f, 0xb3, 0x9f, 0xf0, 0x68, 0x4f, 0xec, 0xb9, 0xe1, 0xdf, 0x15, 0xf8, 0xdf, 0xe2, 0xb7, 0xc5, +0xed, 0x52, 0xce, 0xd6, 0xfb, 0xc4, 0x1e, 0x13, 0xfb, 0x27, 0x87, 0xbc, 0x3f, 0x24, 0xb1, 0xef, +0x6d, 0x2b, 0xed, 0x11, 0xcb, 0x25, 0xe4, 0xc8, 0x0f, 0x02, 0x49, 0x10, 0x43, 0x10, 0x71, 0x86, +0x54, 0xf3, 0xd7, 0x3b, 0x65, 0x60, 0x7f, 0x78, 0x2b, 0xf9, 0x0b, 0xfd, 0x89, 0x3f, 0xe0, 0xaa, +0x3f, 0x1b, 0x3f, 0xe0, 0x9d, 0xfe, 0x1a, 0xd7, 0xf4, 0x8f, 0x85, 0x3e, 0x22, 0xd3, 0x34, 0x3b, +0x1f, 0x13, 0x5d, 0xc7, 0x7b, 0xa8, 0x25, 0xd6, 0x8f, 0x6f, 0x7c, 0xd2, 0xcb, 0x1a, 0x79, 0x6a, +0x41, 0x95, 0x49, 0x5c, 0x2f, 0x18, 0x1c, 0x57, 0xb7, 0x7f, 0xc4, 0x4c, 0x7f, 0xb6, 0x27, 0xfd, +0x0f, 0xde, 0x1d, 0xff, 0x00, 0xc2, 0x52, 0xc3, 0xff, 0x00, 0x8d, 0xd3, 0x52, 0x2e, 0xea, 0xc7, +0xf5, 0x0d, 0x5f, 0x8d, 0x3f, 0xf0, 0x77, 0xc7, 0xec, 0xc7, 0xa0, 0x5c, 0xfc, 0x05, 0xf8, 0x67, +0xf1, 0x8a, 0x0b, 0x38, 0x62, 0xf1, 0x76, 0x95, 0xe2, 0x04, 0xf0, 0x75, 0xdd, 0xda, 0x20, 0x57, +0xbc, 0xd3, 0xae, 0x2d, 0xae, 0xee, 0xa3, 0x49, 0x1b, 0xab, 0x79, 0x33, 0xc0, 0x7c, 0xb1, 0xfc, +0x3f, 0x6a, 0x9c, 0x8f, 0xbc, 0x73, 0xf0, 0x7f, 0xfc, 0x44, 0xc9, 0xfb, 0x62, 0x7f, 0xd0, 0xfd, +0xe1, 0xdf, 0xfc, 0x25, 0x2c, 0x3f, 0xf8, 0xdd, 0x79, 0x37, 0xed, 0x97, 0xff, 0x00, 0x05, 0x85, +0xf8, 0xf9, 0xfb, 0x7e, 0x7c, 0x29, 0xb5, 0xf0, 0x57, 0xc5, 0x0f, 0x13, 0xe9, 0x3a, 0xd7, 0x87, +0xac, 0x75, 0x48, 0xb5, 0x88, 0x60, 0xb6, 0xd1, 0x2d, 0xac, 0x9d, 0x6e, 0x63, 0x8e, 0x58, 0xd1, +0xb7, 0xc4, 0xa1, 0x88, 0x0b, 0x34, 0x9c, 0x67, 0x19, 0x23, 0xd2, 0x93, 0x90, 0x5d, 0x58, 0xf9, +0x8a, 0xbe, 0xb2, 0xff, 0x00, 0x82, 0x1b, 0xfc, 0x7a, 0xb8, 0xfd, 0x9b, 0xff, 0x00, 0xe0, 0xa8, +0x7f, 0x0d, 0xbc, 0x48, 0x8b, 0x71, 0x35, 0x9b, 0x45, 0xaa, 0xd9, 0xea, 0x16, 0xd1, 0x30, 0x5f, +0xb6, 0x40, 0xfa, 0x5d, 0xd3, 0x04, 0x24, 0x83, 0x80, 0x26, 0x48, 0x5f, 0xeb, 0x18, 0xaf, 0x93, +0x45, 0x7b, 0x67, 0xfc, 0x13, 0x8f, 0xfe, 0x4f, 0x77, 0xc0, 0x5f, 0xf5, 0xd2, 0xff, 0x00, 0xff, +0x00, 0x4d, 0xd7, 0x54, 0x89, 0x87, 0xc4, 0x8f, 0x35, 0xf8, 0xc1, 0xff, 0x00, 0x25, 0x7b, 0xc5, +0x9f, 0xf6, 0x1c, 0xbf, 0xff, 0x00, 0xd2, 0x99, 0x2b, 0x9d, 0xae, 0xf3, 0xf6, 0xaa, 0xf0, 0x94, +0xde, 0x00, 0xfd, 0xaa, 0xfe, 0x29, 0x78, 0x7e, 0xe1, 0x04, 0x73, 0xe8, 0x3e, 0x32, 0xd6, 0xb4, +0xc9, 0x50, 0x36, 0xe0, 0x8f, 0x06, 0xa1, 0x3c, 0x4c, 0x33, 0xdf, 0x05, 0x08, 0xcd, 0x70, 0x67, +0xa5, 0x31, 0x4b, 0x73, 0xfa, 0xa4, 0xff, 0x00, 0x83, 0x75, 0x3f, 0xe5, 0x0d, 0x3f, 0x05, 0x7f, +0xeb, 0xdb, 0x54, 0xff, 0x00, 0xd3, 0xc5, 0xf5, 0x7d, 0xb1, 0x5f, 0x9b, 0x3f, 0xf0, 0x6b, 0x2f, +0xed, 0x0f, 0xa4, 0xfc, 0x5b, 0xff, 0x00, 0x82, 0x5d, 0xe9, 0xbe, 0x0b, 0x8a, 0xe1, 0x7f, 0xb7, +0xbe, 0x15, 0xeb, 0x5a, 0x86, 0x95, 0xa8, 0xc0, 0xce, 0xbe, 0x69, 0x8a, 0xea, 0xea, 0x6b, 0xfb, +0x69, 0x82, 0x8e, 0x44, 0x65, 0x2e, 0x5a, 0x25, 0x27, 0xab, 0x5b, 0x48, 0x39, 0x2a, 0x6b, 0xf4, +0x9a, 0xaa, 0x3b, 0x16, 0x14, 0x51, 0x45, 0x50, 0x1f, 0xc7, 0x2f, 0xfc, 0x14, 0x57, 0xfe, 0x52, +0x2b, 0xfb, 0x43, 0x7f, 0xd9, 0x54, 0xf1, 0x5f, 0xfe, 0x9e, 0xae, 0xeb, 0xc7, 0x4f, 0x4a, 0xf6, +0x2f, 0xf8, 0x28, 0xaf, 0xfc, 0xa4, 0x57, 0xf6, 0x86, 0xff, 0x00, 0xb2, 0xa9, 0xe2, 0xbf, 0xfd, +0x3d, 0x5d, 0xd7, 0x8e, 0x9e, 0x95, 0x99, 0x99, 0xfd, 0x2f, 0x7f, 0xc1, 0xab, 0x9f, 0xf2, 0x89, +0xad, 0x2f, 0xfe, 0xc6, 0xbd, 0x67, 0xff, 0x00, 0x47, 0x8a, 0xec, 0x7f, 0xe0, 0xe5, 0xcf, 0xf9, +0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, 0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x71, 0xdf, 0xf0, 0x6a, +0xe7, 0xfc, 0xa2, 0x6b, 0x4b, 0xff, 0x00, 0xb1, 0xaf, 0x59, 0xff, 0x00, 0xd1, 0xe2, 0xbb, 0x1f, +0xf8, 0x39, 0x73, 0xfe, 0x50, 0xab, 0xf1, 0x83, 0xfe, 0xbe, 0x7c, 0x3b, 0xff, 0x00, 0xa9, 0x16, +0x97, 0x55, 0xd0, 0xd3, 0xa1, 0xfc, 0xb8, 0x57, 0x61, 0xfb, 0x3b, 0xff, 0x00, 0xc9, 0xc4, 0xfc, +0x3d, 0xff, 0x00, 0xb1, 0xab, 0x49, 0xff, 0x00, 0xd2, 0xd8, 0xab, 0x8f, 0xae, 0xc3, 0xf6, 0x77, +0xff, 0x00, 0x93, 0x89, 0xf8, 0x7b, 0xff, 0x00, 0x63, 0x56, 0x93, 0xff, 0x00, 0xa5, 0xb1, 0x54, +0x99, 0x9f, 0xda, 0x65, 0x7f, 0x24, 0x7f, 0xf0, 0x5a, 0xcf, 0xf9, 0x4b, 0x37, 0xc7, 0xdf, 0xfb, +0x1a, 0xa4, 0xff, 0x00, 0xd1, 0x10, 0xd7, 0xf5, 0xb9, 0x5f, 0xc9, 0x27, 0xfc, 0x16, 0xc2, 0x36, +0x8b, 0xfe, 0x0a, 0xd1, 0xf1, 0xf0, 0x32, 0xb2, 0x9f, 0xf8, 0x4a, 0x5c, 0xe1, 0x86, 0x0e, 0x0c, +0x10, 0x11, 0xf9, 0x82, 0x08, 0xf5, 0x04, 0x1e, 0x95, 0x52, 0x2a, 0x47, 0xcb, 0xc7, 0xa5, 0x7f, +0x44, 0x1f, 0xf0, 0x67, 0xff, 0x00, 0xfc, 0xa3, 0xaf, 0xe2, 0x57, 0xfd, 0x95, 0x4b, 0xdf, 0xfd, +0x32, 0xe8, 0xb5, 0xfc, 0xef, 0x9e, 0x95, 0xfd, 0x10, 0x7f, 0xc1, 0x9f, 0xff, 0x00, 0xf2, 0x8e, +0xbf, 0x89, 0x5f, 0xf6, 0x55, 0x2f, 0x7f, 0xf4, 0xcb, 0xa2, 0xd1, 0x10, 0x89, 0xfa, 0xb9, 0x45, +0x14, 0x55, 0x14, 0x7f, 0x3a, 0xff, 0x00, 0xf0, 0x77, 0x7f, 0xfc, 0xa4, 0x3b, 0xe1, 0xf7, 0xfd, +0x93, 0x9b, 0x6f, 0xfd, 0x39, 0xea, 0x15, 0xf9, 0x57, 0x5f, 0xaa, 0x9f, 0xf0, 0x77, 0x7f, 0xfc, +0xa4, 0x3b, 0xe1, 0xf7, 0xfd, 0x93, 0x9b, 0x6f, 0xfd, 0x39, 0xea, 0x15, 0xf9, 0x57, 0x59, 0x93, +0x2d, 0xcf, 0xd7, 0xaf, 0xf8, 0x33, 0xe3, 0xfe, 0x4e, 0xb3, 0xe3, 0x37, 0xfd, 0x8a, 0x56, 0x5f, +0xfa, 0x58, 0xd5, 0xf7, 0x27, 0xfc, 0x1d, 0x47, 0xff, 0x00, 0x28, 0x9a, 0xd5, 0x3f, 0xec, 0x6b, +0xd1, 0xbf, 0xf4, 0x79, 0xaf, 0x86, 0xff, 0x00, 0xe0, 0xcf, 0x8f, 0xf9, 0x3a, 0xcf, 0x8c, 0xdf, +0xf6, 0x29, 0x59, 0x7f, 0xe9, 0x63, 0x57, 0xdd, 0x1f, 0xf0, 0x74, 0xf5, 0xac, 0x93, 0xff, 0x00, +0xc1, 0x25, 0x35, 0xa9, 0x11, 0x19, 0x92, 0xdf, 0xc5, 0x1a, 0x34, 0x92, 0x91, 0xfc, 0x0a, 0x6e, +0x76, 0x82, 0x7f, 0xe0, 0x4c, 0xa3, 0xea, 0x45, 0x38, 0xec, 0x57, 0xd9, 0x3f, 0x99, 0xd1, 0xd2, +0xbd, 0x8b, 0xfe, 0x09, 0xd5, 0xff, 0x00, 0x29, 0x15, 0xfd, 0x9e, 0x7f, 0xec, 0xaa, 0x78, 0x53, +0xff, 0x00, 0x4f, 0x56, 0x95, 0xe3, 0xa3, 0xa5, 0x7b, 0x17, 0xfc, 0x13, 0xab, 0xfe, 0x52, 0x2b, +0xfb, 0x3c, 0xff, 0x00, 0xd9, 0x54, 0xf0, 0xa7, 0xfe, 0x9e, 0xad, 0x29, 0x19, 0x9f, 0xd8, 0xd5, +0x14, 0x51, 0x5a, 0x1a, 0x1e, 0x33, 0xff, 0x00, 0x05, 0x1b, 0xff, 0x00, 0x94, 0x7a, 0x7c, 0x78, +0xff, 0x00, 0xb2, 0x77, 0xe2, 0x0f, 0xfd, 0x36, 0xdc, 0x57, 0xf1, 0xcf, 0x07, 0xfa, 0x84, 0xff, +0x00, 0x74, 0x57, 0xf6, 0x31, 0xff, 0x00, 0x05, 0x1b, 0xff, 0x00, 0x94, 0x7a, 0x7c, 0x78, 0xff, +0x00, 0xb2, 0x77, 0xe2, 0x0f, 0xfd, 0x36, 0xdc, 0x57, 0xf1, 0xcf, 0x07, 0xfa, 0x84, 0xff, 0x00, +0x74, 0x54, 0x32, 0x64, 0x36, 0xf3, 0xfe, 0x3c, 0xe6, 0xff, 0x00, 0x70, 0xff, 0x00, 0x2a, 0xfe, +0xca, 0xff, 0x00, 0x61, 0x7f, 0xf9, 0x32, 0xbf, 0x83, 0xff, 0x00, 0xf6, 0x23, 0xe8, 0x9f, 0xfa, +0x41, 0x0d, 0x7f, 0x1a, 0x97, 0x9f, 0xf1, 0xe7, 0x37, 0xfb, 0x87, 0xf9, 0x57, 0xf6, 0x57, 0xfb, +0x0b, 0xff, 0x00, 0xc9, 0x95, 0xfc, 0x1f, 0xff, 0x00, 0xb1, 0x1f, 0x44, 0xff, 0x00, 0xd2, 0x08, +0x69, 0x75, 0x2a, 0x3b, 0x33, 0xe3, 0x6f, 0xf8, 0x3a, 0x8f, 0xfe, 0x51, 0x35, 0xaa, 0x7f, 0xd8, +0xd7, 0xa3, 0x7f, 0xe8, 0xf3, 0x5f, 0xcd, 0x08, 0xe9, 0x5f, 0xd2, 0xf7, 0xfc, 0x1d, 0x47, 0xff, +0x00, 0x28, 0x9a, 0xd5, 0x3f, 0xec, 0x6b, 0xd1, 0xbf, 0xf4, 0x79, 0xaf, 0xe6, 0x84, 0x74, 0xaa, +0x91, 0x32, 0x3d, 0x8b, 0xfe, 0x09, 0xd5, 0xff, 0x00, 0x29, 0x15, 0xfd, 0x9e, 0x7f, 0xec, 0xaa, +0x78, 0x53, 0xff, 0x00, 0x4f, 0x56, 0x95, 0xfd, 0x8d, 0x57, 0xf1, 0xcb, 0xff, 0x00, 0x04, 0xea, +0xff, 0x00, 0x94, 0x8a, 0xfe, 0xcf, 0x3f, 0xf6, 0x55, 0x3c, 0x29, 0xff, 0x00, 0xa7, 0xab, 0x4a, +0xfe, 0xc6, 0xa8, 0x8e, 0xc1, 0x10, 0xa2, 0x8a, 0x2a, 0x8a, 0x3e, 0x50, 0xff, 0x00, 0x82, 0xe6, +0xff, 0x00, 0xca, 0x23, 0xbe, 0x3e, 0x7f, 0xd8, 0xab, 0x37, 0xfe, 0x86, 0x95, 0xfc, 0x99, 0x57, +0xf4, 0xfd, 0xff, 0x00, 0x07, 0x2c, 0xfe, 0xd2, 0x1a, 0x5f, 0xc0, 0xaf, 0xf8, 0x25, 0x3f, 0x8c, +0xf4, 0x7b, 0x8b, 0x88, 0xd7, 0x5c, 0xf8, 0x99, 0x71, 0x6b, 0xe1, 0x6d, 0x26, 0xd8, 0x8d, 0xc6, +0x63, 0x24, 0xc9, 0x35, 0xd3, 0x11, 0x9c, 0x85, 0x4b, 0x48, 0x6e, 0x0e, 0xee, 0x81, 0xcc, 0x4a, +0x71, 0xbc, 0x57, 0xf3, 0x02, 0x2b, 0x3e, 0xa4, 0xc8, 0xa3, 0xe2, 0x6f, 0xf9, 0x17, 0x35, 0x0f, +0xfa, 0xf6, 0x93, 0xff, 0x00, 0x41, 0x35, 0xfd, 0xc3, 0x3f, 0xde, 0x6f, 0xf3, 0xd8, 0xd7, 0xf1, +0x2b, 0xe1, 0x7f, 0x02, 0x5e, 0x7c, 0x54, 0xf1, 0x56, 0x95, 0xe1, 0x6d, 0x3c, 0x33, 0x6a, 0x1e, +0x27, 0xbd, 0x83, 0x47, 0xb4, 0x01, 0x77, 0x13, 0x35, 0xcc, 0x8b, 0x0a, 0x71, 0xd4, 0xfc, 0xce, +0x38, 0x1d, 0x6b, 0xfb, 0x6e, 0x03, 0x06, 0xaa, 0x21, 0x13, 0xf8, 0xe5, 0xff, 0x00, 0x82, 0x8a, +0xff, 0x00, 0xca, 0x45, 0x7f, 0x68, 0x6f, 0xfb, 0x2a, 0x9e, 0x2b, 0xff, 0x00, 0xd3, 0xd5, 0xdd, +0x78, 0xed, 0x7b, 0x37, 0xfc, 0x14, 0x82, 0xce, 0x5b, 0x0f, 0xf8, 0x28, 0xdf, 0xed, 0x0d, 0x1c, +0xc9, 0xe5, 0xbf, 0xfc, 0x2d, 0x1f, 0x14, 0x49, 0x83, 0xfd, 0xd7, 0xd5, 0xee, 0x9d, 0x4f, 0xe2, +0xac, 0x0f, 0xe3, 0x5e, 0x32, 0x7a, 0x54, 0x92, 0x19, 0xa3, 0x75, 0x7f, 0x40, 0x9f, 0xf0, 0x6d, +0xc7, 0xec, 0x2b, 0xf0, 0x4b, 0xf6, 0x80, 0xff, 0x00, 0x82, 0x67, 0x58, 0xf8, 0x8b, 0xc7, 0xdf, +0x07, 0x7e, 0x15, 0xf8, 0xe3, 0xc4, 0x12, 0x78, 0x9f, 0x55, 0xb7, 0x6d, 0x4f, 0xc4, 0x1e, 0x13, +0xb0, 0xd4, 0xaf, 0x1a, 0x24, 0x91, 0x42, 0x27, 0x9b, 0x3c, 0x4c, 0xfb, 0x54, 0x70, 0x17, 0x38, +0x1d, 0xab, 0xef, 0xaf, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, +0x00, 0x0d, 0xee, 0x91, 0xff, 0x00, 0xc8, 0xf4, 0xec, 0x57, 0x29, 0xfc, 0x80, 0xee, 0xa3, 0x75, +0x7f, 0x5f, 0xdf, 0xf0, 0xea, 0x5f, 0xd9, 0x77, 0xfe, 0x8d, 0xb7, 0xe0, 0x1f, 0xfe, 0x1b, 0xdd, +0x27, 0xff, 0x00, 0x91, 0xe8, 0xff, 0x00, 0x87, 0x52, 0xfe, 0xcb, 0xbf, 0xf4, 0x6d, 0xbf, 0x00, +0xff, 0x00, 0xf0, 0xde, 0xe9, 0x3f, 0xfc, 0x8f, 0x4f, 0x94, 0x39, 0x4f, 0xe4, 0x07, 0x75, 0x7e, +0x85, 0x7f, 0xc1, 0xaf, 0x27, 0x3f, 0xf0, 0x57, 0x4f, 0x0e, 0xff, 0x00, 0xd8, 0xb1, 0xac, 0x7f, +0xe8, 0xa4, 0xaf, 0xdf, 0x4f, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, +0xff, 0x00, 0x0d, 0xee, 0x93, 0xff, 0x00, 0xc8, 0xf5, 0xd1, 0xfc, 0x27, 0xfd, 0x83, 0xbe, 0x07, +0x7c, 0x05, 0xf1, 0x74, 0x7e, 0x23, 0xf0, 0x2f, 0xc1, 0xbf, 0x85, 0x3e, 0x08, 0xf1, 0x04, 0x31, +0x3c, 0x11, 0xea, 0x9a, 0x07, 0x84, 0x74, 0xfd, 0x36, 0xf5, 0x23, 0x71, 0x87, 0x41, 0x34, 0x31, +0x2b, 0x85, 0x61, 0xc1, 0x00, 0xe0, 0xf7, 0xa5, 0xca, 0x54, 0x63, 0xa9, 0xeb, 0x75, 0xf8, 0x9f, +0xff, 0x00, 0x07, 0x85, 0x7e, 0xce, 0xdf, 0x68, 0xf0, 0x5f, 0xc1, 0x9f, 0x8b, 0x76, 0xb0, 0xaf, +0xfc, 0x4b, 0xaf, 0xaf, 0x3c, 0x1f, 0xa9, 0x4a, 0xa9, 0x97, 0x71, 0x71, 0x1f, 0xdb, 0x2d, 0x37, +0x1c, 0xfc, 0xaa, 0x86, 0xd6, 0xf0, 0x67, 0x18, 0xcc, 0xe0, 0x13, 0x9c, 0x67, 0xf6, 0xc2, 0xbe, +0x41, 0xff, 0x00, 0x82, 0xef, 0x7e, 0xce, 0xdf, 0xf0, 0xd3, 0x1f, 0xf0, 0x4a, 0x3f, 0x8b, 0xfa, +0x3d, 0xbc, 0x2d, 0x36, 0xa9, 0xa1, 0x69, 0x1f, 0xf0, 0x94, 0xe9, 0xdb, 0x23, 0xdf, 0x2f, 0x9d, +0xa6, 0xba, 0xde, 0x94, 0x8c, 0x60, 0x92, 0xf2, 0x45, 0x0c, 0xb0, 0xe0, 0x0c, 0x91, 0x29, 0x03, +0x04, 0x83, 0x4e, 0x41, 0xe4, 0x7f, 0x28, 0x22, 0xbe, 0xf4, 0xff, 0x00, 0x83, 0x6b, 0x3f, 0x68, +0x5f, 0xf8, 0x50, 0xbf, 0xf0, 0x56, 0x5f, 0x06, 0xd8, 0xcf, 0x32, 0xc1, 0xa6, 0xfc, 0x48, 0xd3, +0x6f, 0xfc, 0x23, 0x74, 0xce, 0xc7, 0x62, 0xbc, 0x91, 0x8b, 0xbb, 0x6e, 0x3f, 0xbc, 0xd7, 0x36, +0x70, 0xc4, 0xa7, 0xb7, 0x9e, 0x79, 0x00, 0x9a, 0xf8, 0x29, 0x1c, 0x3a, 0x82, 0xbc, 0x82, 0x32, +0x31, 0x5b, 0xbf, 0x0c, 0x7e, 0x26, 0xea, 0x7f, 0x04, 0x7e, 0x28, 0x78, 0x63, 0xc6, 0xda, 0x2a, +0xab, 0x6b, 0x5e, 0x0b, 0xd6, 0x2c, 0xfc, 0x41, 0xa7, 0xab, 0xfd, 0xd6, 0xb9, 0xb4, 0x9d, 0x2e, +0x22, 0x07, 0x83, 0xc1, 0x78, 0xd7, 0x3c, 0x1a, 0x92, 0x16, 0xe7, 0xf6, 0xc1, 0x5f, 0xc8, 0xdf, +0xfc, 0x16, 0x43, 0xf6, 0x87, 0xff, 0x00, 0x86, 0xa2, 0xff, 0x00, 0x82, 0xa0, 0x7c, 0x68, 0xf1, +0x54, 0x33, 0x79, 0xda, 0x6c, 0x1e, 0x21, 0x93, 0x41, 0xd3, 0x76, 0xc9, 0xbe, 0x2f, 0xb2, 0xe9, +0xca, 0xb6, 0x08, 0xf1, 0x9c, 0x91, 0xb2, 0x43, 0x6e, 0xd3, 0x71, 0xc1, 0x33, 0xb1, 0xc0, 0xcd, +0x7f, 0x4e, 0x5f, 0xb5, 0x47, 0xed, 0x8b, 0xa4, 0xfc, 0x1f, 0xff, 0x00, 0x82, 0x7d, 0x78, 0xcf, +0xe3, 0x86, 0x8f, 0x75, 0x6f, 0x75, 0xa7, 0x69, 0x9e, 0x0a, 0x9f, 0xc4, 0xfa, 0x24, 0x92, 0x7d, +0xcb, 0xe7, 0x92, 0xd3, 0xcd, 0xb2, 0x4e, 0xe3, 0xf7, 0xb2, 0x3c, 0x2a, 0x3a, 0x8c, 0xb8, 0xed, +0x5f, 0xc7, 0x95, 0xba, 0x3c, 0x70, 0xa8, 0x92, 0x49, 0x26, 0x90, 0x01, 0xba, 0x47, 0x62, 0xcd, +0x21, 0xee, 0xc4, 0x9e, 0x49, 0x3d, 0x49, 0x3d, 0x4d, 0x36, 0xcb, 0x96, 0x88, 0x79, 0xe9, 0x5f, +0xd1, 0x57, 0xfc, 0x1a, 0x51, 0xfb, 0x3b, 0x2f, 0xc3, 0x9f, 0xd8, 0x03, 0xc4, 0xbf, 0x11, 0x2e, +0x20, 0x55, 0xbf, 0xf8, 0xa1, 0xe2, 0x89, 0xda, 0xde, 0x70, 0x3e, 0x69, 0x74, 0xfd, 0x3c, 0x7d, +0x8e, 0x25, 0x3d, 0xfe, 0x5b, 0xa1, 0xa8, 0x1f, 0x4f, 0x9f, 0xa7, 0x52, 0x7f, 0x9d, 0x1b, 0x89, +0x1a, 0x28, 0x1d, 0x96, 0x37, 0x95, 0x95, 0x49, 0x54, 0x45, 0x2c, 0xce, 0x7b, 0x00, 0x07, 0x24, +0x9e, 0x98, 0xf5, 0x35, 0xfd, 0x90, 0x7e, 0xc1, 0x3f, 0xb3, 0x92, 0xfe, 0xc9, 0x3f, 0xb1, 0x7f, +0xc2, 0xff, 0x00, 0x86, 0xac, 0xb0, 0xad, 0xdf, 0x83, 0x7c, 0x33, 0x65, 0xa7, 0x5f, 0x34, 0x43, +0xe5, 0x9a, 0xf1, 0x61, 0x53, 0x75, 0x2f, 0x04, 0x8f, 0x9e, 0xe0, 0xca, 0xfc, 0x12, 0x3e, 0x6a, +0x48, 0x98, 0xa3, 0xd8, 0x2b, 0xe7, 0x5f, 0xf8, 0x2b, 0x9f, 0xfc, 0xa2, 0xcb, 0xf6, 0x8d, 0xff, +0x00, 0xb2, 0x6d, 0xe2, 0x0f, 0xfd, 0x37, 0xcd, 0x5f, 0x45, 0x57, 0xce, 0xbf, 0xf0, 0x57, 0x3f, +0xf9, 0x45, 0x97, 0xed, 0x1b, 0xff, 0x00, 0x64, 0xdb, 0xc4, 0x1f, 0xfa, 0x6f, 0x9a, 0xad, 0x9a, +0x47, 0x73, 0xf9, 0x0d, 0xaa, 0x7e, 0x20, 0xff, 0x00, 0x90, 0x0d, 0xf7, 0xfd, 0x7b, 0xc9, 0xff, +0x00, 0xa0, 0x9a, 0xb9, 0x54, 0xfc, 0x41, 0xff, 0x00, 0x20, 0x1b, 0xef, 0xfa, 0xf7, 0x93, 0xff, +0x00, 0x41, 0x35, 0x06, 0x27, 0xf6, 0xf5, 0xe1, 0x8f, 0xf9, 0x17, 0x6c, 0x3f, 0xeb, 0xde, 0x3f, +0xfd, 0x00, 0x57, 0xf3, 0xa3, 0xff, 0x00, 0x07, 0x70, 0xff, 0x00, 0xca, 0x51, 0x3c, 0x25, 0xff, +0x00, 0x64, 0xaf, 0x4a, 0xff, 0x00, 0xd3, 0xb6, 0xb5, 0x5f, 0xd1, 0x77, 0x86, 0x3f, 0xe4, 0x5d, +0xb0, 0xff, 0x00, 0xaf, 0x78, 0xff, 0x00, 0xf4, 0x01, 0x5f, 0xce, 0x8f, 0xfc, 0x1d, 0xc0, 0x7f, +0xe3, 0x68, 0xbe, 0x13, 0xff, 0x00, 0xb2, 0x57, 0xa5, 0x7f, 0xe9, 0xdb, 0x5b, 0xa7, 0xd0, 0xd2, +0x67, 0xe5, 0xfd, 0x7e, 0xca, 0x7f, 0xc1, 0x9c, 0xbf, 0xf2, 0x5b, 0x7e, 0x3e, 0x7f, 0xd8, 0x0f, +0x44, 0xff, 0x00, 0xd2, 0x8b, 0xea, 0xfc, 0x6b, 0xaf, 0xd9, 0x4f, 0xf8, 0x33, 0x9b, 0xfe, 0x4b, +0x5f, 0xc7, 0xcf, 0xfb, 0x02, 0x68, 0x7f, 0xfa, 0x51, 0x7d, 0x52, 0x4c, 0x77, 0x3f, 0x7a, 0x28, +0xa2, 0x8a, 0xd4, 0xa0, 0xa2, 0x8a, 0x28, 0x03, 0xf9, 0x53, 0xff, 0x00, 0x83, 0x89, 0x3f, 0xe5, +0x35, 0x5f, 0x1d, 0xff, 0x00, 0xeb, 0xe7, 0x42, 0xff, 0x00, 0xd4, 0x73, 0x4a, 0xaf, 0x8b, 0xeb, +0xed, 0x6f, 0xf8, 0x38, 0xb2, 0xc6, 0x6b, 0x2f, 0xf8, 0x2d, 0x27, 0xc6, 0xe7, 0x96, 0x32, 0x8b, +0x75, 0x26, 0x87, 0x34, 0x44, 0xff, 0x00, 0x1a, 0x7f, 0xc2, 0x3f, 0xa6, 0x26, 0x7f, 0xef, 0xa4, +0x61, 0xf8, 0x57, 0xc5, 0x35, 0x99, 0x9b, 0x0c, 0xd1, 0xba, 0xbf, 0x69, 0x3f, 0xe0, 0xd5, 0x8f, +0xd9, 0x03, 0xe1, 0x37, 0xed, 0x31, 0xf0, 0x43, 0xe2, 0xfd, 0xef, 0xc4, 0x8f, 0x85, 0xdf, 0x0e, +0xfe, 0x21, 0x5e, 0x69, 0x7e, 0x21, 0xb2, 0xb7, 0xb1, 0xb8, 0xf1, 0x2f, 0x86, 0xec, 0xf5, 0x69, +0x2d, 0x23, 0x6b, 0x52, 0xcc, 0x91, 0xb5, 0xc4, 0x6e, 0x51, 0x4b, 0x72, 0x42, 0xe0, 0x13, 0x8c, +0xd7, 0xea, 0xd7, 0xfc, 0x3a, 0x97, 0xf6, 0x5d, 0xff, 0x00, 0xa3, 0x6d, 0xf8, 0x07, 0xff, 0x00, +0x86, 0xf7, 0x49, 0xff, 0x00, 0xe4, 0x7a, 0x76, 0x2b, 0x94, 0xfe, 0x40, 0x77, 0x51, 0xba, 0xbf, +0xaf, 0xef, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, 0x00, 0x0d, +0xee, 0x93, 0xff, 0x00, 0xc8, 0xf4, 0x7f, 0xc3, 0xa9, 0x7f, 0x65, 0xdf, 0xfa, 0x36, 0xdf, 0x80, +0x7f, 0xf8, 0x6f, 0x74, 0x9f, 0xfe, 0x47, 0xa7, 0xca, 0x1c, 0xa7, 0xf2, 0x03, 0xba, 0xbd, 0xb3, +0xfe, 0x09, 0xc4, 0x73, 0xfb, 0x6e, 0xf8, 0x0b, 0xfe, 0xba, 0x5f, 0xff, 0x00, 0xe9, 0xba, 0xea, +0xbf, 0xa9, 0x2f, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, 0x00, +0x0d, 0xee, 0x91, 0xff, 0x00, 0xc8, 0xf5, 0x77, 0xc2, 0xff, 0x00, 0xf0, 0x4d, 0x2f, 0xd9, 0xcb, +0xc0, 0xfa, 0xf5, 0xbe, 0xab, 0xa2, 0x7e, 0xcf, 0xff, 0x00, 0x04, 0xf4, 0x7d, 0x52, 0xd3, 0x77, +0x93, 0x79, 0x63, 0xe0, 0x4d, 0x2e, 0xde, 0xe2, 0x1d, 0xca, 0x51, 0xb6, 0xba, 0x42, 0x19, 0x72, +0xac, 0xca, 0x70, 0x79, 0x04, 0x8e, 0x84, 0xd4, 0xb8, 0x95, 0x18, 0xd9, 0xdc, 0xfc, 0x02, 0xff, +0x00, 0x83, 0x9a, 0x7f, 0x63, 0x9b, 0xbf, 0xd9, 0xab, 0xfe, 0x0a, 0x43, 0xa9, 0x78, 0xd2, 0xd6, +0xcc, 0xc3, 0xe1, 0x4f, 0x8c, 0xd6, 0xab, 0xaf, 0xd9, 0x4a, 0x89, 0x88, 0x93, 0x50, 0x89, 0x23, +0x83, 0x50, 0x83, 0xae, 0x77, 0xf9, 0x82, 0x2b, 0x92, 0x4f, 0x1f, 0xe9, 0xb8, 0x1f, 0x74, 0x81, +0xf9, 0xe3, 0x5f, 0xd7, 0xa7, 0xfc, 0x14, 0xf3, 0xfe, 0x09, 0xeb, 0xe1, 0x5f, 0xf8, 0x29, 0x8f, +0xec, 0xb3, 0xaa, 0x7c, 0x39, 0xf1, 0x24, 0xed, 0xa5, 0x5f, 0xac, 0x83, 0x51, 0xf0, 0xf6, 0xb7, +0x1c, 0x3e, 0x6c, 0xba, 0x16, 0xa7, 0x1a, 0xb2, 0xc5, 0x70, 0x13, 0x23, 0xcc, 0x8c, 0xab, 0xbc, +0x72, 0x47, 0x95, 0xdf, 0x1c, 0xae, 0x03, 0x23, 0x6d, 0x75, 0xfe, 0x53, 0x7f, 0x6a, 0x6f, 0xd9, +0x5b, 0xc7, 0x9f, 0xb1, 0x67, 0xc6, 0xfd, 0x5b, 0xe1, 0xdf, 0xc4, 0x8d, 0x0a, 0x6d, 0x03, 0xc4, +0xda, 0x4e, 0x1f, 0x61, 0x25, 0xed, 0xb5, 0x0b, 0x76, 0x66, 0x11, 0xdd, 0xda, 0xcb, 0x80, 0x26, +0xb7, 0x93, 0x6b, 0x6d, 0x90, 0x01, 0xca, 0xb2, 0x30, 0x49, 0x11, 0xd1, 0x42, 0x65, 0x1e, 0xa7, +0x7b, 0xff, 0x00, 0x04, 0xdb, 0xff, 0x00, 0x82, 0x8c, 0xf8, 0xe3, 0xfe, 0x09, 0x93, 0xfb, 0x45, +0xdb, 0xf8, 0xf3, 0xc1, 0xeb, 0x0e, 0xa9, 0xa7, 0xde, 0x44, 0xb6, 0x3e, 0x22, 0xf0, 0xf5, 0xdc, +0xc6, 0x2b, 0x3f, 0x10, 0xd9, 0x06, 0xdd, 0xe5, 0x33, 0x00, 0xde, 0x54, 0xc8, 0x72, 0xd0, 0xce, +0x15, 0x8c, 0x4e, 0x4e, 0x55, 0xe3, 0x79, 0x62, 0x93, 0xfa, 0x2f, 0xfd, 0x92, 0xbf, 0xe0, 0xbe, +0xdf, 0xb3, 0x0f, 0xed, 0x6b, 0xe1, 0x5b, 0x5b, 0x98, 0x7e, 0x25, 0x68, 0x7f, 0x0f, 0xf5, 0xe9, +0x11, 0x7e, 0xd3, 0xa0, 0xf8, 0xd6, 0xee, 0x2d, 0x12, 0xf2, 0xde, 0x42, 0x71, 0xe5, 0xa4, 0x93, +0x30, 0x82, 0xe0, 0xf4, 0x20, 0xdb, 0xcb, 0x27, 0x07, 0x9c, 0x1c, 0x81, 0xfc, 0xa8, 0xe7, 0x34, +0x15, 0x0c, 0x30, 0x46, 0x68, 0x05, 0x2b, 0x1f, 0xd9, 0x41, 0xfd, 0xba, 0x3e, 0x0a, 0x03, 0xff, +0x00, 0x25, 0x83, 0xe1, 0x6f, 0xfe, 0x15, 0x96, 0x1f, 0xfc, 0x76, 0x8f, 0xf8, 0x6e, 0x8f, 0x82, +0x7f, 0xf4, 0x58, 0x3e, 0x16, 0xff, 0x00, 0xe1, 0x59, 0x61, 0xff, 0x00, 0xc7, 0x6b, 0xf8, 0xd3, +0xfb, 0x1c, 0x3f, 0xf3, 0xc6, 0x3f, 0xfb, 0xe4, 0x51, 0xf6, 0x38, 0x7f, 0xe7, 0x8c, 0x7f, 0xf7, +0xc8, 0xa3, 0x52, 0xb9, 0x97, 0x63, 0xd7, 0x3f, 0x6f, 0xdd, 0x62, 0xd3, 0xc4, 0x5f, 0xb7, 0xf7, +0xc7, 0xcd, 0x43, 0x4f, 0xba, 0xb7, 0xbe, 0xd3, 0xf5, 0x0f, 0x89, 0x9e, 0x27, 0xba, 0xb5, 0xb9, +0xb7, 0x90, 0x49, 0x0d, 0xcc, 0x32, 0x6b, 0x17, 0x4e, 0x92, 0x23, 0xa9, 0x21, 0x91, 0x94, 0x86, +0x0c, 0x09, 0x04, 0x10, 0x47, 0x06, 0xbc, 0x9c, 0xf4, 0xa1, 0x54, 0x28, 0xc0, 0x18, 0x03, 0x80, +0x05, 0x07, 0xa5, 0x06, 0x67, 0xf4, 0xbd, 0xff, 0x00, 0x06, 0xae, 0x7f, 0xca, 0x26, 0xb4, 0xbf, +0xfb, 0x1a, 0xf5, 0x9f, 0xfd, 0x1e, 0x2b, 0xb1, 0xff, 0x00, 0x83, 0x97, 0x3f, 0xe5, 0x0a, 0xbf, +0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x75, 0xc7, 0x7f, 0xc1, 0xab, 0x9f, 0xf2, +0x89, 0xad, 0x2f, 0xfe, 0xc6, 0xbd, 0x67, 0xff, 0x00, 0x47, 0x8a, 0xec, 0x7f, 0xe0, 0xe5, 0xcf, +0xf9, 0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, 0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x57, 0x43, 0x4e, +0x87, 0xf2, 0xe1, 0x5d, 0x87, 0xec, 0xef, 0xff, 0x00, 0x27, 0x13, 0xf0, 0xf7, 0xfe, 0xc6, 0xad, +0x27, 0xff, 0x00, 0x4b, 0x62, 0xae, 0x3e, 0xbb, 0x0f, 0xd9, 0xdf, 0xfe, 0x4e, 0x27, 0xe1, 0xef, +0xfd, 0x8d, 0x5a, 0x4f, 0xfe, 0x96, 0xc5, 0x52, 0x66, 0x7f, 0x69, 0x95, 0xfc, 0xce, 0xff, 0x00, +0xc1, 0xd1, 0x9f, 0xb3, 0x6d, 0xef, 0xc1, 0x9f, 0xf8, 0x2a, 0x05, 0xf7, 0x8c, 0xfe, 0xcf, 0x30, +0xd1, 0x7e, 0x2e, 0xe8, 0x96, 0x7a, 0xcd, 0xad, 0xc1, 0x4d, 0xb0, 0x9b, 0xbb, 0x48, 0x63, 0xb0, +0xba, 0x81, 0x4e, 0x06, 0x59, 0x16, 0x0b, 0x59, 0x5f, 0xaf, 0xfc, 0x7d, 0xa9, 0xcf, 0x38, 0x1f, +0xd3, 0x15, 0x7c, 0x87, 0xff, 0x00, 0x05, 0x9c, 0xff, 0x00, 0x82, 0x66, 0x58, 0xff, 0x00, 0xc1, +0x4f, 0x7f, 0x64, 0x5b, 0x8f, 0x0b, 0xd9, 0xcf, 0x65, 0xa6, 0x78, 0xfb, 0xc3, 0x53, 0x36, 0xb3, +0xe1, 0x0d, 0x4e, 0xe4, 0x62, 0x38, 0xaf, 0x15, 0x0a, 0xb5, 0xac, 0xce, 0x06, 0xe5, 0xb7, 0xb8, +0x42, 0x63, 0x72, 0x33, 0xb1, 0x84, 0x52, 0xec, 0x73, 0x0a, 0xa1, 0xa9, 0x1a, 0x6e, 0x8f, 0xe4, +0xfe, 0xbf, 0x4b, 0xbf, 0xe0, 0xdd, 0xaf, 0xf8, 0x2c, 0x2f, 0x86, 0x7f, 0xe0, 0x9e, 0x5e, 0x33, +0xf1, 0x47, 0xc3, 0xdf, 0x8a, 0x17, 0x57, 0x5a, 0x7f, 0xc3, 0x3f, 0x1e, 0x5d, 0x47, 0xaa, 0x5b, +0xea, 0xf1, 0x40, 0xd3, 0xc7, 0xe1, 0xfd, 0x55, 0x63, 0x58, 0x5a, 0x49, 0xa3, 0x40, 0x5f, 0xc8, +0x9e, 0x14, 0x85, 0x1a, 0x45, 0x0c, 0x63, 0x6b, 0x78, 0x89, 0x5d, 0x8f, 0x23, 0xc7, 0xf9, 0xd7, +0xf1, 0x2f, 0xe1, 0xa7, 0x88, 0xbe, 0x0b, 0xfc, 0x44, 0xd6, 0xbc, 0x21, 0xe2, 0xed, 0x17, 0x50, +0xf0, 0xdf, 0x8a, 0x3c, 0x37, 0x74, 0xd6, 0x3a, 0xa6, 0x97, 0x7c, 0x9b, 0x2e, 0x2c, 0xa6, 0x5c, +0x12, 0xac, 0x01, 0x20, 0x82, 0x08, 0x65, 0x65, 0x25, 0x5d, 0x59, 0x5d, 0x59, 0x95, 0x95, 0x8e, +0x2f, 0x5a, 0x92, 0x36, 0x67, 0xf6, 0x39, 0xa2, 0x7f, 0xc1, 0x41, 0x7e, 0x03, 0xf8, 0x97, 0x4c, +0x8a, 0xfb, 0x4f, 0xf8, 0xd5, 0xf0, 0x96, 0xfa, 0xce, 0xe0, 0x66, 0x29, 0xe0, 0xf1, 0x86, 0x9f, +0x24, 0x72, 0x0e, 0x87, 0x04, 0x4d, 0x8e, 0x0f, 0x1f, 0x5a, 0xb9, 0xff, 0x00, 0x0d, 0xd1, 0xf0, +0x4f, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, 0xed, 0x7f, 0x1a, 0x6d, 0x6b, +0x1b, 0xb6, 0x5a, 0x38, 0xd8, 0xfa, 0x95, 0x14, 0x7d, 0x8e, 0x1f, 0xf9, 0xe3, 0x1f, 0xfd, 0xf2, +0x28, 0xd4, 0xbe, 0x65, 0xd8, 0xfd, 0x3a, 0xff, 0x00, 0x83, 0xaa, 0xbe, 0x2b, 0x78, 0x5f, 0xe2, +0xff, 0x00, 0xed, 0xe9, 0xe0, 0x3d, 0x4b, 0xc2, 0x7e, 0x24, 0xd0, 0x3c, 0x51, 0xa7, 0xdb, 0xf8, +0x02, 0xde, 0xda, 0x5b, 0x9d, 0x23, 0x51, 0x86, 0xfa, 0x18, 0xa5, 0x1a, 0x8d, 0xfb, 0x18, 0xd9, +0xe2, 0x66, 0x01, 0x82, 0xb2, 0x9d, 0xa4, 0xe7, 0x04, 0x7a, 0xd7, 0xe6, 0x4d, 0x36, 0x38, 0x96, +0x21, 0x85, 0x55, 0x5f, 0xa0, 0xc5, 0x3a, 0x82, 0x24, 0xee, 0xcf, 0xd7, 0xaf, 0xf8, 0x33, 0xdc, +0xe3, 0xf6, 0xad, 0xf8, 0xcb, 0xff, 0x00, 0x62, 0x95, 0x97, 0xfe, 0x96, 0x35, 0x7e, 0xb3, 0x7f, +0xc1, 0x64, 0x3f, 0x66, 0x6d, 0x43, 0xf6, 0xbe, 0xff, 0x00, 0x82, 0x68, 0x7c, 0x5f, 0xf0, 0x26, +0x8b, 0x6b, 0x71, 0xa8, 0x6b, 0xd7, 0xda, 0x2f, 0xf6, 0x96, 0x93, 0x67, 0x6e, 0x33, 0x35, 0xed, +0xed, 0x84, 0xd1, 0x5f, 0xdb, 0xc0, 0x83, 0xbb, 0x4b, 0x2d, 0xb2, 0x46, 0x07, 0x7d, 0xf8, 0x3c, +0x66, 0xbf, 0x26, 0x7f, 0xe0, 0xcf, 0x8f, 0xf9, 0x3a, 0xcf, 0x8c, 0xdf, 0xf6, 0x29, 0x59, 0x7f, +0xe9, 0x63, 0x57, 0xf4, 0x05, 0x4e, 0x3b, 0x17, 0x1d, 0x8f, 0xe2, 0x02, 0xda, 0xe1, 0x2e, 0xed, +0xe3, 0x96, 0x36, 0x0f, 0x1c, 0x8a, 0x19, 0x58, 0x1e, 0x08, 0x3c, 0x83, 0x5a, 0x7e, 0x10, 0xf1, +0x76, 0xa9, 0xf0, 0xfb, 0xc5, 0xfa, 0x47, 0x88, 0x74, 0x3b, 0xc6, 0xd3, 0xf5, 0xbf, 0x0f, 0xdf, +0x41, 0xa9, 0xe9, 0xd7, 0x4a, 0xa1, 0x9a, 0xd6, 0xea, 0x09, 0x56, 0x58, 0x65, 0x00, 0xf0, 0x4a, +0xc8, 0x8a, 0xd8, 0x3e, 0x95, 0xfa, 0x2b, 0xff, 0x00, 0x07, 0x0c, 0x7f, 0xc1, 0x21, 0x35, 0x4f, +0xd8, 0xa7, 0xe3, 0xa6, 0xab, 0xf1, 0x73, 0xc1, 0x7a, 0x6b, 0x5c, 0x7c, 0x1d, 0xf8, 0x81, 0xa8, +0xbd, 0xdd, 0xc0, 0xb5, 0x80, 0xf9, 0x7e, 0x0f, 0xd4, 0xe7, 0x7d, 0xd2, 0x5a, 0xca, 0x17, 0x84, +0xb5, 0x9a, 0x57, 0x2d, 0x03, 0x8c, 0x2a, 0x97, 0x30, 0x61, 0x4a, 0xc3, 0xe7, 0x7e, 0x6d, 0x66, +0x91, 0x2d, 0x34, 0xcf, 0xea, 0x7b, 0xfe, 0x09, 0xff, 0x00, 0xff, 0x00, 0x05, 0xe4, 0xf8, 0x07, +0xfb, 0x69, 0x7c, 0x26, 0xd2, 0xef, 0x35, 0x5f, 0x1c, 0x78, 0x57, 0xe1, 0xc7, 0x8f, 0x3e, 0xcf, +0x1a, 0x6b, 0x5e, 0x18, 0xf1, 0x1e, 0xa9, 0x16, 0x9b, 0x24, 0x17, 0x61, 0x49, 0x97, 0xec, 0x92, +0x4c, 0xca, 0x97, 0x70, 0x12, 0x0b, 0x2b, 0xc6, 0x4b, 0x04, 0x2b, 0xe6, 0x24, 0x6f, 0xb9, 0x07, +0xd1, 0x5f, 0xf0, 0xdd, 0x1f, 0x04, 0xff, 0x00, 0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, +0xc3, 0xff, 0x00, 0x8e, 0xd7, 0xf1, 0xaa, 0xf1, 0xac, 0x8b, 0x86, 0x55, 0x61, 0xe8, 0x45, 0x37, +0xec, 0x70, 0xff, 0x00, 0xcf, 0x18, 0xff, 0x00, 0xef, 0x91, 0x46, 0xa5, 0x73, 0x1f, 0xd6, 0x87, +0xed, 0xfd, 0xfb, 0x65, 0xfc, 0x21, 0xf1, 0x47, 0xec, 0x1f, 0xf1, 0xb3, 0x4d, 0xd3, 0x7e, 0x2a, +0x7c, 0x37, 0xd4, 0x35, 0x0d, 0x43, 0xc0, 0x5a, 0xed, 0xb5, 0xb5, 0xb5, 0xb7, 0x89, 0xec, 0xa5, +0x9a, 0xe2, 0x57, 0xd3, 0xa7, 0x54, 0x44, 0x45, 0x94, 0x96, 0x66, 0x62, 0x00, 0x51, 0xc9, 0x26, +0xbf, 0x93, 0x18, 0x78, 0x85, 0x7f, 0xdd, 0x14, 0xd1, 0x69, 0x12, 0x9c, 0x88, 0xa3, 0xff, 0x00, +0xbe, 0x45, 0x49, 0x41, 0x32, 0x95, 0xc8, 0xef, 0x3f, 0xe3, 0xce, 0x6f, 0xf7, 0x0f, 0xf2, 0xaf, +0xec, 0xaf, 0xf6, 0x17, 0xff, 0x00, 0x93, 0x2b, 0xf8, 0x3f, 0xff, 0x00, 0x62, 0x3e, 0x89, 0xff, +0x00, 0xa4, 0x10, 0xd7, 0xf1, 0xa9, 0x79, 0xff, 0x00, 0x1e, 0x73, 0x7f, 0xb8, 0x7f, 0x95, 0x7f, +0x65, 0x7f, 0xb0, 0xbf, 0xfc, 0x99, 0x5f, 0xc1, 0xff, 0x00, 0xfb, 0x11, 0xf4, 0x4f, 0xfd, 0x20, +0x86, 0x8e, 0xa5, 0x47, 0x66, 0x7c, 0x6d, 0xff, 0x00, 0x07, 0x51, 0xff, 0x00, 0xca, 0x26, 0xb5, +0x4f, 0xfb, 0x1a, 0xf4, 0x6f, 0xfd, 0x1e, 0x6b, 0xf9, 0xa1, 0x1d, 0x2b, 0xfa, 0x5e, 0xff, 0x00, +0x83, 0xa8, 0xff, 0x00, 0xe5, 0x13, 0x5a, 0xa7, 0xfd, 0x8d, 0x7a, 0x37, 0xfe, 0x8f, 0x35, 0xfc, +0xd0, 0x8e, 0x95, 0x52, 0x26, 0x47, 0xac, 0x7e, 0xc0, 0x5a, 0xc5, 0xa7, 0x87, 0x7f, 0x6f, 0xef, +0x80, 0x7a, 0x86, 0xa1, 0x75, 0x6f, 0x63, 0xa7, 0xe9, 0xff, 0x00, 0x13, 0x3c, 0x31, 0x75, 0x75, +0x73, 0x71, 0x20, 0x8e, 0x1b, 0x68, 0x63, 0xd6, 0x2d, 0x5d, 0xe4, 0x77, 0x62, 0x02, 0xa2, 0xa8, +0x2c, 0x58, 0x90, 0x00, 0x04, 0x9e, 0x05, 0x7f, 0x5a, 0x1f, 0xf0, 0xdd, 0x1f, 0x04, 0xff, 0x00, +0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, 0xc3, 0xff, 0x00, 0x8e, 0xd7, 0xf1, 0xae, 0xca, +0x18, 0x60, 0x8c, 0x83, 0xc1, 0x06, 0xa3, 0xfb, 0x1c, 0x3f, 0xf3, 0xc6, 0x3f, 0xfb, 0xe4, 0x54, +0x84, 0x65, 0x63, 0xfb, 0x2c, 0x1f, 0xb7, 0x47, 0xc1, 0x43, 0xff, 0x00, 0x35, 0x83, 0xe1, 0x6f, +0xfe, 0x15, 0x96, 0x1f, 0xfc, 0x76, 0xbc, 0x3f, 0xf6, 0xaa, 0xff, 0x00, 0x82, 0xf3, 0x7e, 0xcb, +0xbf, 0xb2, 0x77, 0x86, 0x2e, 0xae, 0xaf, 0xbe, 0x28, 0x78, 0x7f, 0xc7, 0x1a, 0xc4, 0x20, 0x88, +0x74, 0x2f, 0x05, 0x5d, 0xc5, 0xae, 0xea, 0x17, 0x12, 0x0f, 0xf9, 0x66, 0x7c, 0x97, 0x30, 0xc0, +0xdd, 0xf3, 0x73, 0x2c, 0x4b, 0xef, 0x92, 0x01, 0xfe, 0x50, 0xfe, 0xc7, 0x0f, 0xfc, 0xf1, 0x8f, +0xfe, 0xf9, 0x14, 0xf0, 0xa1, 0x46, 0x00, 0x00, 0x7a, 0x62, 0x8b, 0xb1, 0xf3, 0x23, 0xe8, 0xdf, +0xf8, 0x29, 0xb7, 0xfc, 0x14, 0xc7, 0xc7, 0x5f, 0xf0, 0x54, 0x1f, 0x8f, 0xff, 0x00, 0xf0, 0x97, +0xf8, 0xa9, 0x17, 0x47, 0xd0, 0x74, 0x74, 0x92, 0xd3, 0xc3, 0x1e, 0x1a, 0xb7, 0x9c, 0xcb, 0x6b, +0xa0, 0x5a, 0xbb, 0x29, 0x70, 0x18, 0x85, 0xf3, 0x27, 0x94, 0xa2, 0x34, 0xb3, 0x15, 0x52, 0xe5, +0x10, 0x05, 0x54, 0x8e, 0x35, 0x5f, 0x9c, 0xfa, 0x0a, 0x3a, 0x57, 0x75, 0xfb, 0x35, 0x7e, 0xcd, +0x1e, 0x39, 0xfd, 0xb0, 0x7e, 0x34, 0x69, 0x3f, 0x0f, 0xbe, 0x1c, 0xe8, 0x17, 0x5e, 0x23, 0xf1, +0x56, 0xb2, 0x49, 0x8e, 0x08, 0xfe, 0x58, 0xad, 0x21, 0x52, 0xa2, 0x4b, 0x9b, 0x89, 0x31, 0xb6, +0x1b, 0x78, 0xf7, 0x2e, 0xe9, 0x1b, 0x81, 0xb9, 0x54, 0x65, 0x99, 0x55, 0x82, 0x75, 0x67, 0xd7, +0x5f, 0xf0, 0x6e, 0x2f, 0xec, 0x55, 0x75, 0xfb, 0x5a, 0xff, 0x00, 0xc1, 0x49, 0x7c, 0x3b, 0xe2, +0x0b, 0xab, 0x3f, 0x37, 0xc2, 0x3f, 0x06, 0x8c, 0x7e, 0x2e, 0xd5, 0xa6, 0x74, 0x26, 0x3f, 0xb6, +0x23, 0x30, 0xd3, 0x20, 0x0c, 0x01, 0xdb, 0x2b, 0x5d, 0x28, 0x9d, 0x73, 0xc1, 0x4b, 0x19, 0x86, +0x41, 0xc5, 0x7f, 0x51, 0x15, 0xf3, 0x4f, 0xfc, 0x12, 0xb3, 0xfe, 0x09, 0xc3, 0xe1, 0x7f, 0xf8, +0x26, 0x47, 0xec, 0xb1, 0xa7, 0xf8, 0x13, 0x45, 0x91, 0x35, 0x4f, 0x10, 0x5e, 0x38, 0xd4, 0xbc, +0x4f, 0xae, 0x98, 0xf6, 0x3e, 0xb7, 0xa8, 0xba, 0x80, 0xee, 0x14, 0xfd, 0xc8, 0x23, 0x50, 0x23, +0x8a, 0x3f, 0xe1, 0x44, 0x05, 0x8b, 0x3b, 0x48, 0xef, 0xf4, 0xb5, 0x54, 0x4b, 0xb5, 0xb4, 0x3f, +0x96, 0xdf, 0xf8, 0x38, 0xef, 0xf6, 0x6f, 0xbc, 0xfd, 0x9f, 0x7f, 0xe0, 0xab, 0xde, 0x3a, 0xd4, +0x1a, 0xdd, 0xe2, 0xd1, 0x7e, 0x25, 0x41, 0x6b, 0xe2, 0xdd, 0x2a, 0x4e, 0x59, 0x5c, 0x4b, 0x12, +0xc1, 0x74, 0xbb, 0xba, 0x6f, 0x17, 0x76, 0xf7, 0x0c, 0x57, 0xaa, 0xa4, 0x91, 0x12, 0x30, 0xc0, +0xb7, 0xc2, 0xb5, 0xfd, 0x4c, 0xff, 0x00, 0xc1, 0x75, 0xbf, 0xe0, 0x96, 0x0b, 0xff, 0x00, 0x05, +0x35, 0xfd, 0x95, 0xad, 0xe0, 0xf0, 0xe8, 0xb7, 0x87, 0xe2, 0x97, 0x80, 0x64, 0x9b, 0x52, 0xf0, +0x94, 0xd3, 0x48, 0xb1, 0x47, 0x79, 0xe6, 0x2a, 0x0b, 0x9d, 0x3a, 0x46, 0x6e, 0x16, 0x3b, 0x85, +0x8e, 0x3c, 0x3f, 0xcb, 0xb6, 0x58, 0x20, 0x66, 0x6d, 0x81, 0xc3, 0x7f, 0x2e, 0x9e, 0x27, 0xf0, +0xc6, 0xa9, 0xe0, 0x6f, 0x13, 0xea, 0x5a, 0x1e, 0xb9, 0xa6, 0xea, 0x1a, 0x2e, 0xb5, 0xa3, 0xdc, +0xc9, 0x65, 0xa8, 0x69, 0xf7, 0xf6, 0xed, 0x6f, 0x75, 0x63, 0x3c, 0x6d, 0xb5, 0xe2, 0x96, 0x36, +0x01, 0x91, 0xd5, 0x81, 0x05, 0x48, 0x04, 0x11, 0x52, 0x4c, 0x96, 0xb7, 0x3f, 0x51, 0x3f, 0xe0, +0xdc, 0x6f, 0xf8, 0x2c, 0xbf, 0x84, 0x7f, 0x61, 0x6f, 0xf8, 0x48, 0x3e, 0x11, 0x7c, 0x58, 0xbe, +0x6d, 0x17, 0xc0, 0x7e, 0x2a, 0xd4, 0xc6, 0xb3, 0xa3, 0x78, 0x81, 0xa3, 0x79, 0x61, 0xd1, 0x75, +0x07, 0x8e, 0x38, 0x66, 0x86, 0xe4, 0x28, 0x66, 0x4b, 0x79, 0x56, 0x28, 0x4a, 0xc8, 0x06, 0xd8, +0x9d, 0x64, 0x69, 0x3e, 0x59, 0x0b, 0xa7, 0xee, 0x76, 0x95, 0xfb, 0x7e, 0x7c, 0x0b, 0xd7, 0x34, +0xe8, 0x6f, 0x2c, 0xfe, 0x34, 0x7c, 0x25, 0xbb, 0xb4, 0xb8, 0x5d, 0xf0, 0xcf, 0x07, 0x8c, 0x34, +0xf9, 0x23, 0x95, 0x7d, 0x55, 0x84, 0xb8, 0x23, 0xdc, 0x57, 0xf1, 0xbf, 0x51, 0xb5, 0xac, 0x4e, +0xd9, 0x68, 0xe3, 0x27, 0xd4, 0xa8, 0xa3, 0x50, 0x52, 0xee, 0x7f, 0x65, 0x9f, 0xf0, 0xdd, 0x1f, +0x05, 0x3f, 0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, 0xc3, 0xff, 0x00, 0x8e, 0xd1, 0xff, +0x00, 0x0d, 0xd1, 0xf0, 0x53, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, 0xed, +0x7f, 0x1a, 0x7f, 0x63, 0x87, 0xfe, 0x78, 0xc7, 0xff, 0x00, 0x7c, 0x8a, 0x3e, 0xc7, 0x0f, 0xfc, +0xf1, 0x8f, 0xfe, 0xf9, 0x14, 0x5d, 0x95, 0xcc, 0xbb, 0x1f, 0xd9, 0x67, 0xfc, 0x37, 0x47, 0xc1, +0x3f, 0xfa, 0x2c, 0x1f, 0x0b, 0x7f, 0xf0, 0xac, 0xb0, 0xff, 0x00, 0xe3, 0xb5, 0xe8, 0x5e, 0x12, +0xf1, 0x7e, 0x97, 0xe3, 0xcf, 0x0f, 0x5a, 0xea, 0xda, 0x2e, 0xa3, 0xa7, 0xea, 0xfa, 0x4e, 0xa1, +0x18, 0x9a, 0xd6, 0xf6, 0xc6, 0xe5, 0x2e, 0x6d, 0xee, 0x63, 0x3d, 0x19, 0x24, 0x42, 0x55, 0x94, +0xe3, 0xa8, 0x24, 0x57, 0xf1, 0x47, 0xe0, 0xbf, 0x87, 0x5a, 0x87, 0xc5, 0x0f, 0x1b, 0x68, 0xbe, +0x17, 0xd0, 0x2c, 0xe3, 0xba, 0xd7, 0xbc, 0x4f, 0xa8, 0xdb, 0x68, 0xfa, 0x64, 0x3b, 0x3f, 0xd7, +0x5d, 0xdc, 0xca, 0xb0, 0xc0, 0x9c, 0x02, 0x7e, 0x69, 0x1d, 0x47, 0x00, 0x9e, 0x7a, 0x57, 0xf6, +0x89, 0xf0, 0x33, 0xe1, 0x16, 0x97, 0xf0, 0x03, 0xe0, 0xbf, 0x84, 0x7c, 0x0b, 0xa1, 0x86, 0x5d, +0x17, 0xc1, 0x7a, 0x25, 0x96, 0x83, 0x60, 0xad, 0xf7, 0x85, 0xbd, 0xac, 0x09, 0x04, 0x79, 0xf7, +0xda, 0x82, 0xaa, 0x37, 0x0b, 0xa6, 0x8e, 0xaa, 0xab, 0xea, 0x7a, 0x64, 0x1a, 0xcd, 0x84, 0xd6, +0xb7, 0x50, 0xc3, 0x71, 0x6b, 0x70, 0x8d, 0x14, 0xd0, 0xca, 0x81, 0xe3, 0x95, 0x18, 0x61, 0x95, +0x94, 0xf0, 0x41, 0x04, 0x82, 0x0f, 0x50, 0x6a, 0xc5, 0x15, 0x40, 0x7f, 0x17, 0xbf, 0xb5, 0x07, +0xc0, 0x9b, 0x8f, 0xd9, 0x77, 0xf6, 0x96, 0xf8, 0x81, 0xf0, 0xda, 0xe3, 0xcf, 0x66, 0xf0, 0x1f, +0x88, 0xaf, 0xf4, 0x28, 0xa4, 0x9b, 0xef, 0xdc, 0x41, 0x6f, 0x3b, 0xc7, 0x0c, 0xdf, 0x49, 0x22, +0x11, 0xc8, 0x3a, 0x70, 0xe3, 0x81, 0xd0, 0x70, 0xa6, 0xbf, 0x4f, 0xbf, 0xe0, 0xea, 0x5f, 0xd8, +0xe7, 0x51, 0xf8, 0x39, 0xfb, 0x78, 0x5a, 0xfc, 0x5c, 0xb4, 0xb3, 0x95, 0xbc, 0x29, 0xf1, 0x83, +0x4f, 0xb7, 0x59, 0xaf, 0x14, 0x16, 0x8e, 0x1d, 0x62, 0xca, 0x05, 0xb7, 0x96, 0x06, 0xec, 0x85, +0xed, 0x62, 0xb5, 0x91, 0x01, 0xc1, 0x90, 0xad, 0xc6, 0x01, 0xf2, 0xdc, 0xd7, 0xe6, 0x08, 0x35, +0x99, 0x12, 0xd1, 0x9f, 0xa3, 0x1f, 0x1e, 0xbf, 0xe0, 0xaf, 0x5a, 0x0f, 0xc5, 0x0f, 0xf8, 0x37, +0xf7, 0xe1, 0xbf, 0xec, 0xe9, 0x0e, 0xa5, 0x79, 0x71, 0xf1, 0x2f, 0x4f, 0xd4, 0xad, 0x34, 0x3f, +0x10, 0xd9, 0xc9, 0x61, 0x34, 0x76, 0xf0, 0x68, 0x3a, 0x6d, 0xcc, 0xb7, 0x16, 0x12, 0x47, 0x70, +0xca, 0x63, 0x72, 0x44, 0x3a, 0x6c, 0x7e, 0x5a, 0xb0, 0x70, 0x63, 0x9b, 0x2a, 0xaa, 0x17, 0x7f, +0xe7, 0x38, 0xe9, 0x46, 0x28, 0x26, 0x80, 0x6e, 0xe7, 0xd2, 0x3f, 0xf0, 0x47, 0xff, 0x00, 0xd9, +0xdf, 0xfe, 0x1a, 0x9b, 0xfe, 0x0a, 0x71, 0xf0, 0x5f, 0xc2, 0x33, 0x43, 0xe7, 0x69, 0xff, 0x00, +0xf0, 0x91, 0xc3, 0xad, 0x6a, 0x4a, 0x53, 0x74, 0x6d, 0x69, 0xa7, 0xab, 0x5f, 0xca, 0x92, 0x70, +0x40, 0x49, 0x05, 0xbf, 0x92, 0x49, 0xc7, 0x33, 0x01, 0x90, 0x48, 0xaf, 0xeb, 0xae, 0xbf, 0x07, +0xff, 0x00, 0xe0, 0xd1, 0x7f, 0xd8, 0xe7, 0x51, 0xbe, 0xf8, 0x8b, 0xf1, 0x0b, 0xe3, 0xe6, 0xa7, +0x66, 0xf0, 0xe8, 0xd6, 0x1a, 0x7b, 0x78, 0x2f, 0xc3, 0xf2, 0x4a, 0x8a, 0x56, 0xf2, 0xe2, 0x59, +0x21, 0xb8, 0xbe, 0x96, 0x3c, 0xf3, 0xfb, 0x95, 0x86, 0xda, 0x20, 0xeb, 0xc3, 0x1b, 0x89, 0xd3, +0x39, 0x47, 0x15, 0xfb, 0xc1, 0x55, 0x12, 0xd6, 0xc1, 0x5f, 0x3a, 0xff, 0x00, 0xc1, 0x5c, 0xff, +0x00, 0xe5, 0x16, 0x5f, 0xb4, 0x6f, 0xfd, 0x93, 0x6f, 0x10, 0x7f, 0xe9, 0xbe, 0x6a, 0xfa, 0x2a, +0xbe, 0x75, 0xff, 0x00, 0x82, 0xb9, 0xff, 0x00, 0xca, 0x2c, 0xbf, 0x68, 0xdf, 0xfb, 0x26, 0xde, +0x20, 0xff, 0x00, 0xd3, 0x7c, 0xd4, 0xd9, 0x51, 0xdc, 0xfe, 0x43, 0x6a, 0x9f, 0x88, 0x3f, 0xe4, +0x03, 0x7d, 0xff, 0x00, 0x5e, 0xf2, 0x7f, 0xe8, 0x26, 0xae, 0x55, 0x3f, 0x10, 0x7f, 0xc8, 0x06, +0xfb, 0xfe, 0xbd, 0xe4, 0xff, 0x00, 0xd0, 0x4d, 0x41, 0x89, 0xfd, 0xbd, 0x78, 0x67, 0xfe, 0x45, +0xcb, 0x1f, 0xfa, 0xf6, 0x8f, 0xff, 0x00, 0x40, 0x15, 0xf8, 0x7f, 0xff, 0x00, 0x07, 0x83, 0x7e, +0xcd, 0x37, 0x36, 0xfa, 0xf7, 0xc1, 0xdf, 0x8c, 0x56, 0x76, 0xfb, 0xec, 0xe5, 0x86, 0xe7, 0xc1, +0x5a, 0xb4, 0xfd, 0xe3, 0x90, 0x33, 0x5e, 0x58, 0xaf, 0xd1, 0x81, 0xd4, 0x32, 0x4e, 0x30, 0x55, +0x47, 0x3b, 0xb8, 0xfd, 0xc0, 0xf0, 0xc7, 0xfc, 0x8b, 0x96, 0x1f, 0xf5, 0xed, 0x1f, 0xfe, 0x80, +0x2b, 0xcc, 0xff, 0x00, 0x6d, 0xff, 0x00, 0xd8, 0xf3, 0xc2, 0xff, 0x00, 0xb7, 0x7f, 0xec, 0xbd, +0xe2, 0xef, 0x85, 0xbe, 0x2e, 0x0e, 0x9a, 0x5f, 0x8a, 0x2c, 0xfc, 0xa8, 0xae, 0xe3, 0x5c, 0xcd, +0xa5, 0xdd, 0xa1, 0x12, 0x5b, 0x5e, 0x45, 0xc8, 0xfd, 0xe4, 0x33, 0x2a, 0x48, 0x01, 0x3b, 0x5b, +0x69, 0x56, 0x05, 0x59, 0x81, 0x7d, 0x0d, 0xa5, 0xab, 0xb1, 0xfc, 0x6e, 0xd7, 0xd6, 0xdf, 0xf0, +0x45, 0xef, 0xf8, 0x29, 0x4c, 0x7f, 0xf0, 0x4c, 0x4f, 0xdb, 0x0d, 0x7c, 0x59, 0xac, 0x58, 0x5d, +0x6a, 0xde, 0x07, 0xf1, 0x46, 0x9c, 0x74, 0x0f, 0x12, 0xdb, 0x5a, 0x8d, 0xd7, 0x10, 0x40, 0xd2, +0xc7, 0x2c, 0x77, 0x90, 0xae, 0x40, 0x79, 0x20, 0x91, 0x3e, 0xe1, 0x3f, 0x34, 0x72, 0xcc, 0x00, +0xdc, 0x54, 0x8f, 0x18, 0xfd, 0xb1, 0xbf, 0x63, 0xbf, 0x1e, 0x7e, 0xc1, 0xdf, 0xb4, 0x06, 0xb3, +0xf0, 0xd7, 0xe2, 0x36, 0x97, 0xfd, 0x9d, 0xaf, 0x69, 0x27, 0xcd, 0xb7, 0xb9, 0x88, 0x31, 0xb2, +0xd6, 0xad, 0x18, 0x91, 0x15, 0xf5, 0xa4, 0x84, 0x0f, 0x32, 0xde, 0x4c, 0x1c, 0x1f, 0xbc, 0x8c, +0xaf, 0x1b, 0x84, 0x92, 0x37, 0x45, 0xf3, 0x0e, 0xb4, 0x8c, 0xb6, 0x67, 0xf6, 0x0d, 0xf0, 0xc3, +0xfe, 0x0a, 0x73, 0xfb, 0x3b, 0xfc, 0x63, 0xf0, 0x8d, 0xbe, 0xb7, 0xa0, 0x7c, 0x6c, 0xf8, 0x5b, +0x79, 0x61, 0x72, 0xaa, 0xc0, 0x4b, 0xe2, 0x4b, 0x5b, 0x5b, 0x88, 0x49, 0x19, 0xd9, 0x2c, 0x13, +0x3a, 0x4b, 0x0c, 0x80, 0x11, 0x94, 0x91, 0x15, 0x86, 0x79, 0x02, 0xba, 0x2f, 0xf8, 0x6e, 0x8f, +0x82, 0x7f, 0xf4, 0x58, 0x3e, 0x16, 0xff, 0x00, 0xe1, 0x59, 0x61, 0xff, 0x00, 0xc7, 0x6b, 0xf8, +0xd4, 0x7b, 0x78, 0xe5, 0x3f, 0x34, 0x68, 0xdf, 0x55, 0xcd, 0x27, 0xd8, 0xe1, 0xff, 0x00, 0x9e, +0x31, 0xff, 0x00, 0xdf, 0x22, 0x8b, 0xb2, 0xf9, 0x91, 0xfd, 0x96, 0x7f, 0xc3, 0x74, 0x7c, 0x14, +0xff, 0x00, 0xa2, 0xc1, 0xf0, 0xb7, 0xff, 0x00, 0x0a, 0xcb, 0x0f, 0xfe, 0x3b, 0x5d, 0x47, 0xc3, +0x2f, 0x8f, 0x3e, 0x08, 0xf8, 0xd5, 0x25, 0xf2, 0x78, 0x3b, 0xc6, 0x3e, 0x14, 0xf1, 0x63, 0x69, +0x62, 0x33, 0x78, 0x34, 0x6d, 0x5e, 0xde, 0xfc, 0xda, 0x09, 0x37, 0xf9, 0x66, 0x4f, 0x29, 0xdb, +0x66, 0xef, 0x2d, 0xf6, 0xee, 0xc6, 0xed, 0x8d, 0x8c, 0xe0, 0xe3, 0xf8, 0xaa, 0x36, 0x70, 0xe3, +0xfd, 0x54, 0x7f, 0xf7, 0xc8, 0xaf, 0xe8, 0xe7, 0xfe, 0x0d, 0x33, 0xfd, 0x9a, 0x13, 0xe1, 0x47, +0xfc, 0x13, 0xc7, 0x5a, 0xf8, 0x81, 0x71, 0x6d, 0x0c, 0x7a, 0x87, 0xc5, 0x8f, 0x12, 0xdc, 0xdd, +0x41, 0x2a, 0xa0, 0x57, 0x3a, 0x7d, 0x89, 0x36, 0x50, 0xa3, 0x0e, 0xbc, 0x5c, 0x47, 0x7c, 0xe0, +0x9c, 0x64, 0x4c, 0x38, 0xc7, 0x25, 0xa6, 0xc3, 0x99, 0x33, 0xe2, 0x3f, 0xf8, 0x3b, 0x63, 0xf6, +0x6f, 0xbb, 0xf0, 0x0f, 0xed, 0xbb, 0xe0, 0xbf, 0x89, 0xd0, 0x5b, 0xb0, 0xd1, 0x3e, 0x23, 0x78, +0x65, 0x74, 0xe9, 0x65, 0x00, 0xb0, 0x1a, 0x8e, 0x9d, 0x2b, 0x09, 0x03, 0x1f, 0xe1, 0xdd, 0x6d, +0x71, 0x69, 0xb4, 0x1f, 0xbd, 0xe4, 0xca, 0x47, 0x43, 0x8f, 0xca, 0x7e, 0xa2, 0xbf, 0xae, 0xef, +0xf8, 0x2a, 0x97, 0xfc, 0x13, 0xfb, 0x45, 0xff, 0x00, 0x82, 0x94, 0xfe, 0xc7, 0xba, 0xe7, 0xc3, +0x6d, 0x4a, 0x78, 0xf4, 0xfd, 0x60, 0xc8, 0xba, 0xaf, 0x86, 0xb5, 0x47, 0x52, 0xc3, 0x48, 0xd5, +0xa1, 0x57, 0x58, 0x67, 0x60, 0x33, 0x98, 0xd9, 0x64, 0x92, 0x29, 0x00, 0x19, 0x31, 0x4f, 0x28, +0x5c, 0x36, 0xd6, 0x1f, 0xc9, 0xe7, 0xc7, 0x3f, 0x81, 0x9e, 0x2e, 0xfd, 0x99, 0x7e, 0x2e, 0x6b, +0x9e, 0x03, 0xf1, 0xe6, 0x85, 0x79, 0xe1, 0xbf, 0x16, 0x78, 0x6e, 0xe0, 0xdb, 0x5f, 0xd8, 0x5c, +0xaf, 0x2a, 0x7f, 0x86, 0x44, 0x6e, 0x92, 0x42, 0xeb, 0x87, 0x49, 0x57, 0x29, 0x22, 0x32, 0xb2, +0x92, 0x0d, 0x26, 0x4c, 0xbb, 0x9f, 0x65, 0xff, 0x00, 0xc1, 0x02, 0x3f, 0xe0, 0xab, 0xda, 0x3f, +0xfc, 0x13, 0x3b, 0xf6, 0x84, 0xd7, 0xf4, 0xff, 0x00, 0x1d, 0x2d, 0xd1, 0xf8, 0x63, 0xf1, 0x22, +0x1b, 0x6b, 0x7d, 0x5e, 0xee, 0xda, 0x17, 0xb8, 0x9b, 0x42, 0xba, 0xb7, 0x69, 0x3e, 0xcf, 0x7a, +0x22, 0x5c, 0xb3, 0xc5, 0xb6, 0x69, 0x92, 0x54, 0x8d, 0x4c, 0x84, 0x34, 0x6c, 0xa1, 0x8c, 0x7b, +0x1f, 0xfa, 0x1f, 0xf0, 0x97, 0xfc, 0x14, 0x57, 0xe0, 0x1f, 0x8e, 0xf4, 0x1b, 0x7d, 0x53, 0x49, +0xf8, 0xd9, 0xf0, 0x9a, 0xfa, 0xc2, 0xe8, 0x6e, 0x8e, 0x68, 0xfc, 0x5b, 0x61, 0xf8, 0xa9, 0x06, +0x5c, 0xab, 0x0e, 0x85, 0x58, 0x06, 0x53, 0xc1, 0x00, 0xf1, 0x5f, 0xc7, 0x57, 0x5a, 0x63, 0xdb, +0x47, 0x23, 0x65, 0xa3, 0x46, 0x3e, 0xa5, 0x68, 0xd4, 0x14, 0xbb, 0x9f, 0xd9, 0x5f, 0xfc, 0x37, +0x47, 0xc1, 0x4f, 0xfa, 0x2c, 0x1f, 0x0b, 0x7f, 0xf0, 0xac, 0xb0, 0xff, 0x00, 0xe3, 0xb4, 0x7f, +0xc3, 0x74, 0x7c, 0x14, 0xff, 0x00, 0xa2, 0xc1, 0xf0, 0xb7, 0xff, 0x00, 0x0a, 0xcb, 0x0f, 0xfe, +0x3b, 0x5f, 0xc6, 0x9f, 0xd8, 0xe1, 0xff, 0x00, 0x9e, 0x31, 0xff, 0x00, 0xdf, 0x22, 0x8f, 0xb1, +0xc3, 0xff, 0x00, 0x3c, 0x63, 0xff, 0x00, 0xbe, 0x45, 0x17, 0x65, 0x73, 0x2e, 0xc7, 0xf6, 0x59, +0xff, 0x00, 0x0d, 0xd1, 0xf0, 0x4f, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, +0xed, 0x77, 0x1f, 0x0f, 0xfe, 0x25, 0x78, 0x7f, 0xe2, 0xbf, 0x87, 0x97, 0x58, 0xf0, 0xc6, 0xb9, +0xa2, 0xf8, 0x8f, 0x49, 0x91, 0xda, 0x34, 0xbe, 0xd2, 0xaf, 0xa2, 0xbd, 0xb6, 0x77, 0x53, 0x86, +0x51, 0x24, 0x6c, 0x57, 0x2a, 0x78, 0x23, 0x3c, 0x57, 0xf1, 0x2f, 0x75, 0x1d, 0xbd, 0xa5, 0xb4, +0x92, 0xc9, 0x1c, 0x4a, 0x91, 0xa9, 0x76, 0x3b, 0x47, 0x00, 0x72, 0x6b, 0xfa, 0xfc, 0xff, 0x00, +0x82, 0x51, 0xfe, 0xcc, 0x72, 0x7e, 0xc7, 0x5f, 0xf0, 0x4e, 0x6f, 0x84, 0x3f, 0x0f, 0x6e, 0xed, +0x5a, 0xcb, 0x54, 0xd1, 0x7c, 0x3d, 0x0d, 0xce, 0xaf, 0x6e, 0xd9, 0xcc, 0x3a, 0x95, 0xdb, 0x35, +0xe5, 0xea, 0xf3, 0x83, 0x81, 0x75, 0x71, 0x30, 0xed, 0xc0, 0x1c, 0x0e, 0x94, 0xd3, 0x60, 0x9a, +0x67, 0xd1, 0x15, 0xe2, 0xbf, 0xb6, 0xbf, 0xfc, 0x13, 0xfb, 0xe1, 0x4f, 0xfc, 0x14, 0x17, 0xe1, +0x9a, 0x78, 0x5b, 0xe2, 0x9f, 0x85, 0xed, 0x75, 0xeb, 0x5b, 0x53, 0x23, 0xe9, 0xb7, 0xc8, 0xe6, +0xdf, 0x52, 0xd1, 0x65, 0x70, 0x01, 0x96, 0xd6, 0xe1, 0x08, 0x78, 0xc9, 0x2a, 0x9b, 0x97, 0x25, +0x24, 0x08, 0x16, 0x44, 0x75, 0xf9, 0x6b, 0xda, 0xa8, 0xab, 0x03, 0xf9, 0xff, 0x00, 0xfd, 0xaa, +0xff, 0x00, 0xe0, 0xd1, 0x6f, 0x88, 0xfe, 0x14, 0xd6, 0x2e, 0xaf, 0x7e, 0x0b, 0xfc, 0x44, 0xf0, +0xe7, 0x8c, 0xb4, 0x5c, 0xb3, 0xc5, 0xa6, 0xf8, 0xab, 0x7e, 0x95, 0xaa, 0xc0, 0x99, 0xf9, 0x63, +0x13, 0xc3, 0x1c, 0x96, 0xf7, 0x0f, 0xd0, 0x96, 0x2b, 0x6c, 0xbd, 0x7e, 0x5e, 0x39, 0xf9, 0x66, +0xf7, 0xfe, 0x0d, 0xd2, 0xfd, 0xb4, 0xed, 0x6f, 0x25, 0x8a, 0x3f, 0x81, 0xf3, 0xdd, 0x2c, 0x6c, +0x54, 0x4b, 0x0f, 0x8b, 0xfc, 0x3f, 0xb2, 0x41, 0xea, 0x37, 0x5f, 0xab, 0x63, 0xea, 0x01, 0xf6, +0x15, 0xfd, 0x53, 0x51, 0x53, 0xca, 0x16, 0x47, 0xf2, 0xa7, 0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, +0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, 0x2c, 0x28, 0xff, 0x00, 0x88, +0x76, 0x7f, 0x6d, 0x6f, 0xfa, 0x20, 0xf7, 0xdf, 0xf8, 0x57, 0xf8, 0x77, 0xff, 0x00, 0x96, 0x15, +0xfd, 0x56, 0x51, 0x47, 0x29, 0x3c, 0xa7, 0xf2, 0xa7, 0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, +0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, 0x2c, 0x28, 0x3f, 0xf0, 0x6e, 0xcf, +0xed, 0xac, 0x7f, 0xe6, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x57, 0xf5, 0x59, +0x45, 0x1c, 0xa1, 0xca, 0x7c, 0x47, 0xff, 0x00, 0x06, 0xfe, 0xfe, 0xca, 0x1f, 0x11, 0x3f, 0x62, +0xff, 0x00, 0xf8, 0x27, 0x65, 0x8f, 0x81, 0xfe, 0x28, 0x78, 0x6a, 0x4f, 0x09, 0xf8, 0xae, 0x1d, +0x7f, 0x53, 0xbe, 0x7b, 0x07, 0xbf, 0xb4, 0xbe, 0x2b, 0x0c, 0xd2, 0x86, 0x8d, 0xbc, 0xcb, 0x59, +0x65, 0x8b, 0x91, 0xd8, 0x3e, 0x46, 0x39, 0x02, 0xba, 0x6f, 0xf8, 0x2e, 0x4f, 0xec, 0xd7, 0xe3, +0x6f, 0xda, 0xef, 0xfe, 0x09, 0x75, 0xf1, 0x2b, 0xe1, 0xef, 0xc3, 0x7d, 0x0d, 0xbc, 0x4d, 0xe3, +0x2d, 0x7a, 0x6d, 0x1a, 0x4d, 0x3f, 0x4d, 0x5b, 0xcb, 0x7b, 0x33, 0x72, 0x2d, 0xf5, 0xab, 0x0b, +0xa9, 0xbf, 0x7b, 0x71, 0x24, 0x71, 0x2e, 0xd8, 0x61, 0x91, 0xbe, 0x67, 0x19, 0xdb, 0x81, 0x92, +0x40, 0x3f, 0x5b, 0x51, 0x4e, 0xc5, 0x74, 0xb1, 0xfc, 0xa9, 0xff, 0x00, 0xc4, 0x3b, 0x3f, 0xb6, +0xb7, 0xfd, 0x10, 0x7b, 0xef, 0xfc, 0x2b, 0xfc, 0x3b, 0xff, 0x00, 0xcb, 0x0a, 0xe9, 0x7e, 0x0b, +0xff, 0x00, 0xc1, 0xbe, 0xbf, 0xb6, 0x57, 0x85, 0xbe, 0x33, 0xf8, 0x37, 0x54, 0xd4, 0x7e, 0x07, +0xde, 0x5a, 0xe9, 0xfa, 0x5e, 0xbf, 0xa7, 0xde, 0xdd, 0x4c, 0x7c, 0x59, 0xe1, 0xf7, 0xf2, 0xa1, +0x8a, 0xe6, 0x39, 0x1d, 0xb6, 0xad, 0xf9, 0x63, 0x85, 0x52, 0x70, 0xa0, 0x93, 0x8e, 0x01, 0xaf, +0xea, 0x1e, 0x8a, 0x5c, 0xa4, 0xf2, 0x85, 0x14, 0x51, 0x54, 0x51, 0xf2, 0x7f, 0xfc, 0x14, 0x97, +0xfe, 0x08, 0xe1, 0xf0, 0x87, 0xfe, 0x0a, 0x73, 0xe1, 0xf8, 0x66, 0xf1, 0x8d, 0x8d, 0xce, 0x85, +0xe3, 0x8d, 0x32, 0xdb, 0xec, 0xda, 0x5f, 0x8b, 0xb4, 0x60, 0x90, 0xea, 0x76, 0xa8, 0x0e, 0xe5, +0x86, 0x6d, 0xc0, 0xa5, 0xcd, 0xb8, 0x62, 0x4f, 0x95, 0x28, 0x3b, 0x37, 0xc8, 0x63, 0x68, 0x99, +0xcb, 0xd7, 0xe3, 0x2f, 0xed, 0x1f, 0xff, 0x00, 0x06, 0xa8, 0x7e, 0xd2, 0x1f, 0x0a, 0x35, 0x1b, +0xa9, 0x3c, 0x05, 0x7f, 0xe0, 0xbf, 0x8b, 0x1a, 0x3a, 0x93, 0xf6, 0x53, 0x6b, 0x7e, 0x34, 0x4d, +0x52, 0x50, 0x31, 0xfe, 0xb2, 0xde, 0xec, 0x88, 0x10, 0x9e, 0xdb, 0x6e, 0x9f, 0xa1, 0xc9, 0x1c, +0x67, 0xfa, 0x4a, 0xa2, 0xa7, 0x94, 0x34, 0xea, 0x7f, 0x2a, 0x7f, 0xf1, 0x0e, 0xcf, 0xed, 0xad, +0xff, 0x00, 0x44, 0x1e, 0xfb, 0xff, 0x00, 0x0a, 0xff, 0x00, 0x0e, 0xff, 0x00, 0xf2, 0xc2, 0x8f, +0xf8, 0x87, 0x67, 0xf6, 0xd6, 0xff, 0x00, 0xa2, 0x0f, 0x7d, 0xff, 0x00, 0x85, 0x7f, 0x87, 0x7f, +0xf9, 0x61, 0x5f, 0xd5, 0x65, 0x14, 0x72, 0x93, 0xca, 0x7f, 0x1a, 0x7f, 0xb5, 0x8f, 0xec, 0x59, +0xf1, 0x4b, 0xf6, 0x17, 0xf8, 0x81, 0xa7, 0xf8, 0x57, 0xe2, 0xd7, 0x84, 0x65, 0xf0, 0x6f, 0x88, +0x35, 0x4d, 0x3d, 0x75, 0x5b, 0x5b, 0x39, 0x35, 0x2b, 0x2b, 0xf3, 0x35, 0xab, 0x4b, 0x24, 0x4b, +0x2e, 0xfb, 0x49, 0xa6, 0x41, 0x97, 0x8a, 0x41, 0xb5, 0x98, 0x37, 0xcb, 0x9c, 0x60, 0x82, 0x7c, +0xbe, 0xbf, 0x48, 0xbf, 0xe0, 0xea, 0x0f, 0x8e, 0x1a, 0x1f, 0xc5, 0xcf, 0xf8, 0x2a, 0x05, 0xbe, +0x93, 0xa1, 0xde, 0x43, 0x7c, 0xdf, 0x0f, 0xbc, 0x1d, 0x63, 0xa0, 0x6a, 0xcd, 0x18, 0x27, 0xc8, +0xd4, 0x1a, 0xe2, 0xee, 0xee, 0x48, 0x77, 0x67, 0x0d, 0xb2, 0x1b, 0x9b, 0x6c, 0xe3, 0xee, 0xbb, +0x3a, 0x9e, 0x54, 0x81, 0xf9, 0xbb, 0x52, 0x27, 0xb9, 0xfa, 0xf5, 0xff, 0x00, 0x06, 0x7c, 0x7f, +0xc9, 0xd6, 0x7c, 0x66, 0xff, 0x00, 0xb1, 0x4a, 0xcb, 0xff, 0x00, 0x4b, 0x1a, 0xbf, 0xa0, 0x2a, +0xfc, 0x19, 0xff, 0x00, 0x83, 0x3a, 0xfe, 0x1f, 0xdd, 0xde, 0xfc, 0x5c, 0xf8, 0xef, 0xe2, 0xac, +0x14, 0xb1, 0xd3, 0xf4, 0x7d, 0x1f, 0x48, 0x04, 0xc6, 0x71, 0x34, 0xb3, 0xcf, 0x75, 0x29, 0x0a, +0xdd, 0x3e, 0x45, 0xb7, 0x5d, 0xc3, 0xaf, 0xef, 0x50, 0xfd, 0x7f, 0x79, 0xaa, 0xa2, 0x5a, 0xd8, +0xcb, 0xf1, 0x97, 0x83, 0x34, 0xaf, 0x88, 0x7e, 0x18, 0xd4, 0x34, 0x3d, 0x7b, 0x4d, 0xd3, 0xb5, +0xad, 0x0f, 0x57, 0xb6, 0x92, 0xce, 0xff, 0x00, 0x4e, 0xbf, 0xb6, 0x4b, 0xab, 0x4b, 0xe8, 0x24, +0x52, 0xaf, 0x14, 0xb1, 0x38, 0x29, 0x24, 0x6c, 0xa4, 0xab, 0x2b, 0x02, 0x08, 0x24, 0x11, 0x5f, +0x8e, 0xdf, 0xb7, 0xa7, 0xfc, 0x1a, 0x51, 0xa0, 0xf8, 0xcf, 0x5e, 0xbc, 0xf1, 0x07, 0xec, 0xf7, +0xe3, 0x2b, 0x5f, 0x05, 0xc9, 0x74, 0xc6, 0x43, 0xe1, 0x4f, 0x13, 0x19, 0xae, 0x34, 0xa8, 0xdc, +0x91, 0xff, 0x00, 0x1e, 0xf7, 0xa8, 0x1e, 0xe2, 0x08, 0xff, 0x00, 0xd8, 0x92, 0x3b, 0x8e, 0x4f, +0x0c, 0x8a, 0x02, 0xd7, 0xec, 0xed, 0x14, 0xec, 0x1e, 0xa7, 0xf2, 0xcf, 0xe2, 0xff, 0x00, 0xf8, +0x36, 0xe7, 0xf6, 0xcc, 0xf0, 0xbe, 0xb9, 0x25, 0x9d, 0xa7, 0xc2, 0x5b, 0x3f, 0x11, 0xc3, 0x1f, +0x4b, 0xed, 0x2f, 0xc5, 0xba, 0x32, 0xdb, 0x49, 0xfe, 0xe8, 0xb9, 0xba, 0x86, 0x5f, 0xce, 0x31, +0x59, 0x7f, 0xf1, 0x0e, 0xcf, 0xed, 0xad, 0xff, 0x00, 0x44, 0x1e, 0xfb, 0xff, 0x00, 0x0a, 0xff, +0x00, 0x0e, 0xff, 0x00, 0xf2, 0xc2, 0xbf, 0xaa, 0xca, 0x29, 0x72, 0x8b, 0x95, 0x1f, 0xca, 0x9f, +0xfc, 0x43, 0xb3, 0xfb, 0x6b, 0x7f, 0xd1, 0x07, 0xbe, 0xff, 0x00, 0xc2, 0xbf, 0xc3, 0xbf, 0xfc, +0xb0, 0xa3, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, +0xfe, 0x58, 0x57, 0xf5, 0x59, 0x45, 0x1c, 0xa2, 0xe5, 0x3f, 0x95, 0x1b, 0x8f, 0xf8, 0x37, 0x5b, +0xf6, 0xd7, 0x96, 0xde, 0x45, 0x1f, 0x01, 0xef, 0xb2, 0xca, 0x40, 0xff, 0x00, 0x8a, 0xbf, 0xc3, +0xbf, 0xfc, 0xb0, 0xaf, 0xe9, 0xb3, 0xf6, 0x4d, 0xf0, 0x66, 0xa9, 0xf0, 0xe3, 0xf6, 0x5e, 0xf8, +0x6f, 0xe1, 0xdd, 0x6e, 0xd7, 0xec, 0x3a, 0xd6, 0x83, 0xe1, 0x5d, 0x2f, 0x4d, 0xbf, 0xb6, 0x32, +0x24, 0x9f, 0x67, 0xb8, 0x86, 0xd2, 0x28, 0xe4, 0x4d, 0xe8, 0x59, 0x1b, 0x6b, 0xab, 0x0c, 0xa9, +0x2a, 0x71, 0xc1, 0x23, 0x9a, 0xf4, 0x2a, 0x28, 0xe5, 0x29, 0x68, 0x7c, 0x47, 0xff, 0x00, 0x07, +0x01, 0x7e, 0xca, 0x1f, 0x10, 0xff, 0x00, 0x6d, 0x0f, 0xf8, 0x27, 0x65, 0xf7, 0x81, 0xfe, 0x17, +0xf8, 0x6a, 0x4f, 0x16, 0x78, 0xaa, 0x6d, 0x7f, 0x4c, 0xbe, 0x8f, 0x4f, 0x4b, 0xfb, 0x4b, 0x12, +0xd0, 0xc3, 0x29, 0x69, 0x1b, 0xcc, 0xba, 0x96, 0x28, 0xb8, 0x1d, 0x8b, 0xe4, 0xe7, 0x80, 0x6b, +0xf0, 0xbc, 0x7f, 0xc1, 0xbb, 0x3f, 0xb6, 0xb0, 0xff, 0x00, 0x9a, 0x0f, 0x7d, 0xff, 0x00, 0x85, +0x7f, 0x87, 0x7f, 0xf9, 0x61, 0x5f, 0xd5, 0x65, 0x14, 0x72, 0x85, 0x8f, 0xe5, 0x4f, 0xfe, 0x21, +0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, 0xff, +0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, +0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x52, 0x79, 0x4f, 0xe5, 0x4f, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, +0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x54, 0xb6, 0x5f, 0xf0, 0x6e, +0x97, 0xed, 0xa7, 0x75, 0x77, 0x1c, 0x52, 0x7c, 0x0f, 0x9e, 0xd5, 0x64, 0x60, 0xa6, 0x69, 0xbc, +0x5f, 0xe1, 0xfd, 0x91, 0xfb, 0x9d, 0xb7, 0xec, 0xd8, 0xfa, 0x02, 0x7d, 0x8d, 0x7f, 0x54, 0xf4, +0x51, 0xca, 0x1c, 0xa7, 0xf3, 0xfb, 0xfb, 0x29, 0xff, 0x00, 0xc1, 0xa2, 0xff, 0x00, 0x12, 0x3c, +0x5d, 0xac, 0xda, 0xde, 0x7c, 0x66, 0xf8, 0x89, 0xe1, 0xbf, 0x06, 0xe8, 0x79, 0x57, 0x97, 0x4e, +0xf0, 0xae, 0xfd, 0x57, 0x55, 0x9d, 0x33, 0x86, 0x8c, 0xcd, 0x34, 0x71, 0xdb, 0xdb, 0xbf, 0x70, +0xe1, 0x6e, 0x57, 0xd5, 0x79, 0xe3, 0xf6, 0x53, 0xf6, 0x28, 0xff, 0x00, 0x82, 0x79, 0x7c, 0x27, +0xff, 0x00, 0x82, 0x79, 0xfc, 0x36, 0x93, 0xc3, 0x5f, 0x0b, 0x3c, 0x31, 0x6f, 0xa1, 0xc5, 0x7c, +0x23, 0x6d, 0x53, 0x51, 0x99, 0x8d, 0xce, 0xa7, 0xad, 0xca, 0x80, 0x85, 0x92, 0xea, 0xe1, 0xbe, +0x79, 0x08, 0x2c, 0xe5, 0x50, 0x62, 0x38, 0xfc, 0xc7, 0x11, 0xa2, 0x03, 0x8a, 0xf6, 0xea, 0x28, +0xe5, 0x29, 0x68, 0x14, 0x51, 0x45, 0x50, 0x05, 0x7c, 0x67, 0xff, 0x00, 0x05, 0x2f, 0xff, 0x00, +0x82, 0x20, 0xfc, 0x1b, 0xff, 0x00, 0x82, 0x98, 0x5a, 0x36, 0xb1, 0xae, 0x5a, 0xcf, 0xe1, 0x0f, +0x88, 0xf0, 0xc4, 0x21, 0xb6, 0xf1, 0x86, 0x8b, 0x1a, 0xad, 0xe4, 0xaa, 0xab, 0x84, 0x8a, 0xf2, +0x26, 0xf9, 0x2e, 0xe2, 0x18, 0x5c, 0x07, 0xc4, 0x88, 0xab, 0xb6, 0x39, 0x63, 0x04, 0xe7, 0xec, +0xca, 0x28, 0xb0, 0x1f, 0xcd, 0x57, 0xed, 0x0d, 0xff, 0x00, 0x06, 0xae, 0xfe, 0xd3, 0x7f, 0x09, +0xf5, 0x4b, 0xa3, 0xe0, 0x96, 0xf0, 0x5f, 0xc5, 0x8d, 0x25, 0x5c, 0x8b, 0x59, 0x34, 0xed, 0x51, +0x34, 0x7d, 0x42, 0x64, 0xe3, 0x06, 0x4b, 0x7b, 0xd2, 0x90, 0xc4, 0xc7, 0x9f, 0x95, 0x6e, 0x64, +0x03, 0x1f, 0x7a, 0xbc, 0xa3, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, +0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x57, 0xf5, 0x59, 0x45, 0x4f, 0x28, 0xac, 0x8f, 0xe5, 0x4f, 0xfe, +0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, +0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, +0x00, 0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x51, 0x72, 0x9f, 0xcf, 0x5f, 0xfc, 0x11, 0xeb, 0xfe, +0x08, 0x27, 0xfb, 0x42, 0x7c, 0x26, 0xff, 0x00, 0x82, 0x8b, 0x7c, 0x39, 0xf1, 0xb7, 0xc6, 0x3f, +0x85, 0xe7, 0xc2, 0xbe, 0x06, 0xf0, 0x3d, 0xcc, 0xda, 0xec, 0xb7, 0x37, 0x1a, 0xf6, 0x91, 0x7d, +0xe7, 0xde, 0x43, 0x03, 0xfd, 0x8e, 0x35, 0x8e, 0xd6, 0xee, 0x59, 0x03, 0x2d, 0xcb, 0x43, 0x2e, +0xe2, 0x9b, 0x40, 0x84, 0x8c, 0x82, 0x45, 0x7f, 0x42, 0x94, 0x51, 0x4d, 0x2b, 0x14, 0x14, 0x51, +0x45, 0x30, 0x3c, 0xcf, 0xf6, 0xb8, 0xfd, 0x91, 0xfc, 0x0b, 0xfb, 0x6f, 0x7c, 0x0b, 0xd6, 0x3e, +0x1d, 0xfc, 0x44, 0xd1, 0xd3, 0x58, 0xf0, 0xd6, 0xb0, 0xaa, 0x59, 0x43, 0x18, 0xee, 0x2c, 0xe6, +0x43, 0x98, 0xae, 0x60, 0x94, 0x7c, 0xd1, 0x4d, 0x1b, 0x72, 0xac, 0x3d, 0xd4, 0x86, 0x56, 0x65, +0x3f, 0x82, 0x7f, 0xb6, 0x0f, 0xfc, 0x1a, 0x9f, 0xf1, 0xd7, 0xe1, 0x1f, 0x89, 0xaf, 0x2e, 0x3e, +0x10, 0xea, 0x3a, 0x17, 0xc5, 0xbf, 0x0b, 0xbb, 0x96, 0xb2, 0xb7, 0x9e, 0xf6, 0x0d, 0x1b, 0x5e, +0x89, 0x49, 0x38, 0x49, 0x92, 0x76, 0x4b, 0x57, 0x2a, 0xb8, 0x1e, 0x6a, 0x4c, 0x9b, 0xc8, 0x63, +0xe5, 0x47, 0x90, 0xb5, 0xfd, 0x1c, 0x51, 0x4b, 0x94, 0x3d, 0x4f, 0xe5, 0x4c, 0xff, 0x00, 0xc1, +0xbb, 0x5f, 0xb6, 0xb0, 0xff, 0x00, 0x9a, 0x0f, 0x7d, 0xff, 0x00, 0x85, 0x7f, 0x87, 0x7f, 0xf9, +0x61, 0x5f, 0x4e, 0x7e, 0xc4, 0x3f, 0xf0, 0x69, 0xef, 0xc4, 0xdf, 0x88, 0x3e, 0x26, 0xb2, 0xd5, +0x3e, 0x3d, 0x78, 0x83, 0x4a, 0xf8, 0x7f, 0xe1, 0x78, 0xc8, 0x92, 0xe3, 0x43, 0xd0, 0xef, 0x13, +0x52, 0xd7, 0x6f, 0x31, 0xd6, 0x16, 0x99, 0x41, 0xb5, 0xb5, 0x1c, 0xff, 0x00, 0xad, 0x47, 0xb8, +0x6e, 0x19, 0x42, 0x2e, 0x44, 0x83, 0xfa, 0x10, 0xa2, 0x97, 0x28, 0x24, 0x8e, 0x57, 0xe0, 0x9f, +0xc1, 0x4f, 0x0b, 0x7e, 0xce, 0x7f, 0x0a, 0xb4, 0x3f, 0x03, 0xf8, 0x27, 0x45, 0xb1, 0xf0, 0xef, +0x85, 0x3c, 0x35, 0x68, 0xb6, 0x5a, 0x6e, 0x9d, 0x68, 0xa4, 0x47, 0x6d, 0x1a, 0xe4, 0xf5, 0x24, +0xb3, 0xbb, 0x31, 0x2c, 0xce, 0xe4, 0xbb, 0xb3, 0x33, 0x33, 0x33, 0x31, 0x27, 0xaa, 0xa2, 0x8a, +0xa0, 0x0a, 0xf1, 0x5f, 0xf8, 0x28, 0xdf, 0xc2, 0xdf, 0x10, 0x7c, 0x72, 0xfd, 0x81, 0x7e, 0x34, +0xf8, 0x27, 0xc2, 0xba, 0x7f, 0xf6, 0xb7, 0x8a, 0x3c, 0x5d, 0xe0, 0x8d, 0x63, 0x47, 0xd2, 0x6c, +0x84, 0xf1, 0x41, 0xf6, 0xbb, 0xb9, 0xec, 0xe4, 0x8e, 0x18, 0xfc, 0xc9, 0x59, 0x63, 0x4d, 0xce, +0xca, 0x37, 0x3b, 0x2a, 0x8c, 0xe4, 0x90, 0x39, 0xaf, 0x6a, 0xa2, 0x81, 0xa7, 0x63, 0xf9, 0x53, +0xff, 0x00, 0x88, 0x76, 0x7f, 0x6d, 0x6f, 0xfa, 0x20, 0xf7, 0xdf, 0xf8, 0x57, 0xf8, 0x77, 0xff, +0x00, 0x96, 0x15, 0x06, 0xa9, 0xff, 0x00, 0x06, 0xe8, 0x7e, 0xdb, 0x17, 0xba, 0x65, 0xc4, 0x2b, +0xf0, 0x22, 0xf3, 0x74, 0xd1, 0x32, 0x0c, 0xf8, 0xbf, 0xc3, 0xb8, 0xc9, 0x04, 0x7f, 0xd0, 0x42, +0xbf, 0xab, 0x3a, 0x2a, 0x79, 0x48, 0xe5, 0x28, 0xf8, 0x7e, 0x17, 0xb7, 0xd1, 0xac, 0xe1, 0x91, +0x76, 0xc9, 0x14, 0x08, 0x8e, 0xb9, 0x07, 0x04, 0x28, 0x04, 0x71, 0xc7, 0xe5, 0x57, 0xa8, 0xa2, +0xa9, 0x68, 0x56, 0xe7, 0x88, 0x7e, 0xdc, 0x9f, 0xf0, 0x4f, 0x5f, 0x85, 0x7f, 0xf0, 0x50, 0xff, +0x00, 0x85, 0x4b, 0xe1, 0x3f, 0x8a, 0x1e, 0x1d, 0x8f, 0x56, 0x8a, 0xcf, 0xcc, 0x7d, 0x2f, 0x53, +0xb7, 0x7f, 0xb3, 0xea, 0x9a, 0x14, 0xce, 0xa0, 0x19, 0xad, 0x67, 0x1c, 0xa1, 0xf9, 0x50, 0xb2, +0x30, 0x68, 0xe4, 0xd8, 0xa2, 0x44, 0x91, 0x46, 0xda, 0xfc, 0x54, 0xfd, 0xaa, 0x3f, 0xe0, 0xd2, +0x9f, 0x8c, 0x1f, 0x0f, 0xb5, 0x7b, 0x9b, 0xaf, 0x84, 0x5e, 0x34, 0xf0, 0xaf, 0xc4, 0x6d, 0x0b, +0x2e, 0xf0, 0xd9, 0x6b, 0x0e, 0x74, 0x5d, 0x62, 0x21, 0x9f, 0x96, 0x3e, 0x8f, 0x6d, 0x31, 0x03, +0xac, 0x86, 0x48, 0x32, 0x7a, 0x46, 0x07, 0x4f, 0xe8, 0x6a, 0x8a, 0x9e, 0x50, 0xdf, 0x73, 0xf9, +0x55, 0x7f, 0xf8, 0x37, 0x67, 0xf6, 0xd4, 0x59, 0x19, 0x57, 0xe0, 0x55, 0xe3, 0xed, 0x38, 0xdc, +0xbe, 0x2f, 0xf0, 0xee, 0x0f, 0xbf, 0x3a, 0x86, 0x7f, 0x3a, 0x6f, 0xfc, 0x43, 0xb3, 0xfb, 0x6b, +0x7f, 0xd1, 0x07, 0xbe, 0xff, 0x00, 0xc2, 0xbf, 0xc3, 0xbf, 0xfc, 0xb0, 0xaf, 0xea, 0xb2, 0x8a, +0x39, 0x49, 0xe5, 0x3f, 0x95, 0x19, 0x7f, 0xe0, 0xdd, 0xaf, 0xdb, 0x63, 0xca, 0x6d, 0xbf, 0x01, +0xef, 0x0b, 0x60, 0xed, 0x07, 0xc5, 0xfe, 0x1d, 0xc1, 0x3f, 0xf8, 0x30, 0xaf, 0xe9, 0x8b, 0xf6, +0x35, 0xfd, 0x9f, 0x2d, 0x7f, 0x64, 0xff, 0x00, 0xd9, 0x53, 0xe1, 0xdf, 0xc3, 0x4b, 0x39, 0x23, +0xb8, 0x8f, 0xc0, 0xde, 0x1d, 0xb1, 0xd1, 0xa4, 0xb8, 0x8c, 0x60, 0x5d, 0xcd, 0x0c, 0x2a, 0x92, +0xcd, 0xd0, 0x73, 0x24, 0x81, 0xe4, 0x27, 0x03, 0x25, 0xc9, 0xc0, 0xe9, 0x5e, 0x99, 0x45, 0x1c, +0xa5, 0x2d, 0x02, 0xbe, 0x6b, 0xff, 0x00, 0x82, 0x85, 0x7f, 0xc1, 0x29, 0xfe, 0x10, 0xff, 0x00, +0xc1, 0x4b, 0x3c, 0x11, 0x0e, 0x9d, 0xf1, 0x13, 0x45, 0x96, 0x3d, 0x7b, 0x4d, 0x88, 0xc7, 0xa4, +0x78, 0x9f, 0x4b, 0x75, 0xb6, 0xd6, 0xb4, 0x80, 0x49, 0x25, 0x63, 0x94, 0x86, 0x59, 0x22, 0x24, +0x92, 0x61, 0x99, 0x64, 0x88, 0x93, 0xbb, 0x68, 0x60, 0xac, 0xbf, 0x4a, 0x51, 0x4d, 0xab, 0x81, +0xfc, 0xe4, 0x7e, 0xd2, 0xff, 0x00, 0xf0, 0x69, 0xf7, 0xc7, 0xdf, 0x86, 0x1a, 0x9d, 0xd4, 0xff, +0x00, 0x0d, 0x7c, 0x45, 0xe0, 0xbf, 0x8a, 0x9a, 0x22, 0x8c, 0xc0, 0x92, 0x4e, 0x74, 0x1d, 0x5d, +0x8e, 0x32, 0x55, 0xa0, 0x9c, 0xb5, 0xbf, 0x1f, 0x77, 0x77, 0xda, 0x46, 0xe3, 0xce, 0xd4, 0xe8, +0x3c, 0x28, 0x7f, 0xc1, 0xbb, 0x5f, 0xb6, 0xb1, 0x1f, 0xf2, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, +0xef, 0xff, 0x00, 0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x97, 0x28, 0xac, 0x8f, 0xe5, 0x4f, 0xfe, 0x21, +0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, 0xff, +0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, +0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x51, 0x72, 0x9f, 0xcc, 0xbf, 0xec, 0x8b, 0xff, 0x00, 0x06, +0xe6, 0x7e, 0xd3, 0xd7, 0xff, 0x00, 0xb5, 0x3f, 0xc3, 0xa5, 0xf8, 0x97, 0xf0, 0x85, 0xb4, 0x1f, +0x87, 0xb0, 0xf8, 0x8a, 0xc6, 0xe7, 0xc4, 0x97, 0x97, 0x3e, 0x23, 0xd1, 0x2e, 0xe3, 0x5d, 0x3a, +0x29, 0x96, 0x5b, 0x88, 0xfc, 0xa8, 0x2f, 0x64, 0x95, 0xbc, 0xc8, 0xd1, 0xa2, 0x1b, 0x51, 0xb0, +0x64, 0x04, 0x8c, 0x03, 0x5f, 0xd3, 0x45, 0x14, 0x53, 0x4a, 0xc5, 0x05, 0x14, 0x51, 0x4c, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0f, 0xc7, 0x7f, 0xf8, 0x2d, 0x4f, 0xfc, 0x17, 0x47, +0xf6, 0x8a, 0xff, 0x00, 0x82, 0x66, 0x7e, 0xdb, 0x93, 0x78, 0x07, 0xc2, 0xfe, 0x1d, 0xf8, 0x41, +0xa8, 0x78, 0x3b, 0x54, 0xd0, 0x6c, 0xb5, 0xfd, 0x12, 0xe7, 0x59, 0xd0, 0xf5, 0x19, 0xef, 0x4c, +0x52, 0xf9, 0x90, 0x4c, 0x92, 0xcb, 0x0e, 0xa1, 0x14, 0x6c, 0xcb, 0x71, 0x6f, 0x31, 0x01, 0x63, +0x5c, 0x23, 0xc6, 0x08, 0x27, 0xe6, 0x6f, 0x92, 0xff, 0x00, 0xe2, 0x2e, 0x1f, 0xda, 0x8b, 0xfe, +0x85, 0x2f, 0x80, 0x5f, 0xf8, 0x4e, 0xea, 0xff, 0x00, 0xfc, 0xb4, 0xaf, 0xab, 0x3f, 0xe0, 0xef, +0xff, 0x00, 0xd9, 0xbb, 0xfe, 0x12, 0x0f, 0x80, 0x5f, 0x09, 0xfe, 0x2b, 0x59, 0xc2, 0xcf, 0x37, +0x84, 0x75, 0xbb, 0x8f, 0x0d, 0xea, 0x0d, 0x1a, 0x0c, 0xfd, 0x9a, 0xfe, 0x21, 0x2c, 0x72, 0x48, +0x71, 0xf7, 0x52, 0x7b, 0x30, 0x83, 0x9e, 0x1a, 0xec, 0xf0, 0x73, 0x91, 0xf8, 0x26, 0x0f, 0x15, +0x9e, 0xa2, 0x93, 0x77, 0x3f, 0x50, 0x3f, 0xe2, 0x2e, 0x1f, 0xda, 0x8b, 0xfe, 0x85, 0x2f, 0x80, +0x5f, 0xf8, 0x4e, 0xea, 0xff, 0x00, 0xfc, 0xb4, 0xae, 0x4f, 0xe3, 0x37, 0xfc, 0x1d, 0x25, 0xfb, +0x56, 0xfc, 0x5e, 0xf0, 0x3d, 0xd6, 0x89, 0x69, 0x71, 0xf0, 0xd7, 0xc0, 0x6f, 0x78, 0xa6, 0x36, +0xd5, 0x3c, 0x2f, 0xa0, 0x5c, 0x47, 0xa8, 0x22, 0x9e, 0x18, 0x24, 0x97, 0x97, 0x57, 0x28, 0x84, +0x8c, 0x8d, 0xca, 0x81, 0xd7, 0x39, 0x56, 0x56, 0x00, 0x8f, 0xce, 0xbd, 0xd4, 0x66, 0x81, 0x73, +0x32, 0x6d, 0x47, 0x52, 0xba, 0xd6, 0xb5, 0x4b, 0xab, 0xeb, 0xeb, 0xab, 0xab, 0xeb, 0xfb, 0xf9, +0xe4, 0xba, 0xba, 0xba, 0xba, 0x99, 0xa6, 0x9e, 0xea, 0x69, 0x18, 0xbc, 0x92, 0xc9, 0x23, 0x12, +0xce, 0xee, 0xc5, 0x99, 0x99, 0x89, 0x2c, 0xcc, 0x49, 0x24, 0x9a, 0x84, 0xee, 0x3c, 0x2a, 0xbb, +0xb3, 0x70, 0xaa, 0x8a, 0x59, 0x98, 0x9e, 0x00, 0x00, 0x72, 0x49, 0xf4, 0x1c, 0xd6, 0xd7, 0xc3, +0x6f, 0x87, 0x1e, 0x22, 0xf8, 0xcd, 0xe3, 0xbb, 0x1f, 0x0b, 0xf8, 0x3f, 0x41, 0xd6, 0xbc, 0x55, +0xe2, 0x4d, 0x48, 0xe2, 0xd7, 0x4a, 0xd2, 0x2c, 0xa4, 0xbd, 0xbc, 0x9c, 0x0c, 0x65, 0x84, 0x51, +0x82, 0xdb, 0x46, 0x41, 0x2d, 0x8d, 0xaa, 0x39, 0x24, 0x0e, 0x6b, 0xf7, 0x8b, 0xfe, 0x08, 0x71, +0xff, 0x00, 0x06, 0xea, 0xcd, 0xfb, 0x34, 0x78, 0xb7, 0x4d, 0xf8, 0xc5, 0xf1, 0xfa, 0xd7, 0x4e, +0xba, 0xf8, 0x81, 0xa5, 0x3a, 0x5d, 0x78, 0x6f, 0xc2, 0x71, 0xca, 0x97, 0x76, 0xbe, 0x19, 0x9c, +0x60, 0xad, 0xe5, 0xd4, 0xa8, 0x5a, 0x39, 0xef, 0x10, 0xff, 0x00, 0xaa, 0x48, 0xcb, 0x45, 0x01, +0x1e, 0x60, 0x69, 0x24, 0x31, 0xb4, 0x00, 0x28, 0xb6, 0x7d, 0x65, 0xff, 0x00, 0x04, 0x1d, 0xfd, +0x80, 0xae, 0xbf, 0xe0, 0x9e, 0xbf, 0xb0, 0x06, 0x83, 0xe1, 0xff, 0x00, 0x10, 0x5a, 0xfd, 0x97, +0xc7, 0xde, 0x31, 0xb8, 0x6f, 0x14, 0xf8, 0xaa, 0x26, 0x6d, 0xcd, 0x67, 0x77, 0x70, 0x88, 0xb1, +0x5a, 0x7a, 0x03, 0x6f, 0x6d, 0x14, 0x11, 0x38, 0x52, 0xc8, 0x65, 0x49, 0x99, 0x49, 0x0f, 0x9a, +0xfb, 0x3a, 0x8a, 0x2b, 0x42, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0f, 0x8e, 0x7f, +0xe0, 0xbe, 0x7a, 0x55, 0xae, 0xb5, 0xff, 0x00, 0x04, 0xa6, 0xf8, 0xa1, 0x05, 0xe5, 0xad, 0xbd, +0xdc, 0x3b, 0xf4, 0x67, 0xf2, 0xe6, 0x8c, 0x48, 0xbb, 0x86, 0xb5, 0x61, 0x83, 0x83, 0xc6, 0x47, +0xad, 0x7f, 0x3b, 0xbf, 0xf0, 0xaf, 0xb4, 0x1f, 0xfa, 0x01, 0xe8, 0xff, 0x00, 0xf8, 0x07, 0x1f, +0xf8, 0x51, 0x45, 0x67, 0x2d, 0xca, 0x03, 0xf0, 0xfb, 0x41, 0xc7, 0xfc, 0x80, 0xf4, 0x7f, 0xfc, +0x03, 0x8f, 0xfc, 0x2b, 0xd4, 0x3f, 0x64, 0x3f, 0x83, 0x3e, 0x0f, 0xf1, 0x5f, 0xc5, 0xa8, 0xad, +0x75, 0x4f, 0x09, 0xf8, 0x6b, 0x52, 0xb5, 0x68, 0xdc, 0x98, 0x6e, 0xb4, 0xc8, 0x26, 0x8c, 0xfc, +0x8e, 0x7e, 0xeb, 0x29, 0x1d, 0x40, 0xfc, 0xa8, 0xa2, 0xa4, 0x3a, 0x1f, 0xd2, 0x87, 0xec, 0xdf, +0xfb, 0x3e, 0xf8, 0x07, 0xf6, 0x7b, 0xf8, 0x63, 0x63, 0x63, 0xe0, 0x1f, 0x03, 0xf8, 0x43, 0xc0, +0xf6, 0x7a, 0x85, 0xbc, 0x37, 0x17, 0x56, 0xfe, 0x1f, 0xd1, 0xad, 0xf4, 0xc8, 0xae, 0x64, 0x31, +0xe4, 0xbb, 0xac, 0x28, 0xa1, 0x9b, 0x24, 0x9c, 0x9c, 0x9e, 0x4d, 0x7a, 0x45, 0x14, 0x56, 0x91, +0x09, 0x05, 0x14, 0x51, 0x54, 0x48, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x01, 0xff, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..d17c7b6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config (void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config (void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config (void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/internal_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/internal_flash_if.c new file mode 100644 index 0000000..9399635 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/internal_flash_if.c @@ -0,0 +1,92 @@ +/*! + \file internal_flash_if.c + \brief flash access functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "internal_flash_if.h" + +/* pages 0 and 1 base and end addresses */ +uint32_t bak[128]; + +/*! + \brief initialize the nand flash + \param[in] none + \param[out] none + \retval status + */ +uint32_t flash_init (void) +{ + fmc_unlock(); + + return 0U; +} + +/*! + \brief read data from multiple blocks of nand flash + \param[in] pBuf: pointer to user buffer + \param[in] read_addr: address to be read + \param[in] block_size: size of block + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_read_multi_blocks (uint8_t *pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num) +{ + uint32_t i; + uint8_t *pSource = (uint8_t *)(read_addr + NAND_FLASH_BASE_ADDRESS); + + /* Data transfer */ + while (block_num--) { + for (i = 0U; i < block_size; i++) { + *pBuf++ = *pSource++; + } + } + + return 0U; +} + +/*! + \brief write data to multiple blocks of flash + \param[in] pBuf: pointer to user buffer + \param[in] write_addr: address to be write + \param[in] block_size: block size + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_write_multi_blocks (uint8_t *pBuf, + uint32_t write_addr, + uint16_t block_size, + uint32_t block_num) +{ + return 0U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/main.c new file mode 100644 index 0000000..ed2c5d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/main.c @@ -0,0 +1,77 @@ +/*! + \file main.c + \brief USB device main routine + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_msc_core.h" +#include "usbd_hw.h" + +usb_dev usb_msc; +uint8_t flag = 0U; +extern uint8_t Flash_Data[]; + +/*! + \brief main routine will construct a MSC device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t flag = 0U; + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usb_msc, &msc_desc, &msc_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + gpio_bit_set(USB_PULLUP, USB_PULLUP_PIN); + + usbd_connect(&usb_msc); + + while(usb_msc.cur_status != USBD_CONFIGURED){ + } + + flag = Flash_Data[0]; + + (void)flag; + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/msc_mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/msc_mem.c new file mode 100644 index 0000000..e972c05 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/msc_mem.c @@ -0,0 +1,175 @@ +/*! + \file msc_mem.c + \brief msc memories operation functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_msc_mem.h" +#include "internal_flash_if.h" + +uint8_t mem_inquiry_data[] = +{ + /* LUN 0 */ + 0x05, /* 0x05 for CD-ROM; 0x00 for usb mass storage */ + 0x80, /* RMB BYTE is set by inquiry data */ + 0x02, /* ANSI SCSI 2 */ + 0x00, /* Data format = 0 */ + 0x1F, /* Additional length */ + 0x00, + 0x00, + 0x00, + /* vendor information = GD32 */ + 'G', 'D', '3', '2', 0x20, 0x20, 0x20, 0x20 , + /* product identification = CDROM DEMO */ + 'C', 'D', 'R', 'O', 'M', 0x20,'D', 'E', 'M','0',0x20,0x20,0x20, 0x20, 0x20, 0x20, + /* Product revision = 1.0 */ + 0x31, 0x2E, 0x30, 0x20 +}; + +/* USB CDROM TOC(Table Of Content) Data */ +uint8_t usbcdrom_read_toc_data[] = { + 0x00, + 0x12, /* number of bytes below */ + 0x01, /* first track */ + 0x01, /* last track */ + 0x00, /* reserved */ + 0x14, /* (adr, control) */ + 0x01, /* (track being described) */ + 0x00, /* (reserved) */ + 00, 00, 00, 00, /* (start logical block address 0) */ + 0x00, /* (reserved) */ + 0x14, /* (adr, control) */ + 0xAA, /* (track being described (leadout)) */ + 0x00, /* (reserved) */ + 00, 00, 0xA2, 0x8A /* (start logical block address 41610) */ +}; + +static int8_t mem_init (uint8_t lun); +static int8_t mem_ready (uint8_t lun); +static int8_t mem_protected (uint8_t lun); +static int8_t mem_maxlun (void); +static int8_t mem_read (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen); +static int8_t mem_write (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen); + +usbd_mem_cb usbd_mem_opera = +{ + .mem_init = mem_init, + .mem_ready = mem_ready, + .mem_protected = mem_protected, + .mem_read = mem_read, + .mem_write = mem_write, + .mem_maxlun = mem_maxlun, + + .mem_toc_data = usbcdrom_read_toc_data, + .mem_inquiry_data = {(uint8_t *)mem_inquiry_data}, + .mem_block_size = {BLOCK_SIZE}, + .mem_block_len = {BLOCK_NUM} +}; + +usbd_mem_cb *usbd_mem_fops = &usbd_mem_opera; + +/*! + \brief initialize the storage medium + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_init (uint8_t lun) +{ + flash_init(); + + return 0; +} + +/*! + \brief check whether the medium is ready + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_ready (uint8_t lun) +{ + return 0; +} + +/*! + \brief check whether the medium is write-protected + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_protected (uint8_t lun) +{ + return 0; +} + +/*! + \brief read data from the medium + \param[in] lun: logical unit number + \param[in] buf: pointer to the buffer to save data + \param[in] blkaddr: address of 1st block to be read + \param[in] blklen: number of blocks to be read + \param[out] none + \retval status +*/ +static int8_t mem_read (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen) +{ + flash_read_multi_blocks(buf, blkaddr, BLOCK_SIZE, (uint32_t)blklen); + + return 0; +} + +/*! + \brief write data to the medium + \param[in] lun: logical unit number + \param[in] buf: pointer to the buffer to save data + \param[in] blkaddr: address of 1st block to be read + \param[in] blklen: number of blocks to be read + \param[out] none + \retval status +*/ +static int8_t mem_write (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen) +{ + flash_write_multi_blocks (buf, blkaddr, BLOCK_SIZE, (uint32_t)blklen); + + return 0; +} + +/*! + \brief get number of supported logical unit + \param[in] none + \param[out] none + \retval status +*/ +static int8_t mem_maxlun (void) +{ + return ((int8_t)MEM_LUN_NUM - 1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/system_gd32f10x.c new file mode 100644 index 0000000..d9151e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_cdrom/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series + + \version 2020-07-01, V3.0.0, firmware for GD32F10x +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewd new file mode 100644 index 0000000..860344f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewp new file mode 100644 index 0000000..0ed2ef0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewp @@ -0,0 +1,1064 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\internal_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\msc_mem.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewt new file mode 100644 index 0000000..11272a5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.ewt @@ -0,0 +1,1168 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\internal_flash_if.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\msc_mem.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.eww new file mode 100644 index 0000000..6c1059a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/EWARM/msc_udisk.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\msc_udisk.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvopt new file mode 100644 index 0000000..46f130d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvopt @@ -0,0 +1,715 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + msc_udisk + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + + + + 0 + 1 + bbb_data + + + 1 + 1 + bbb_cbw + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 33 + 0 + 0 + 0 + 0 + ..\src\internal_flash_if.c + internal_flash_if.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\msc_mem.c + msc_mem.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 17 + 1 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 8 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 24 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 25 + 1 + 0 + 0 + 5 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 23 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 27 + 2 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 28 + 5 + 0 + 0 + 4329148 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvoptx new file mode 100644 index 0000000..59c7531 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvoptx @@ -0,0 +1,626 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + msc_udisk + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + bbb_data + + + 1 + 1 + bbb_cbw + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\internal_flash_if.c + internal_flash_if.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\msc_mem.c + msc_mem.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 27 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 28 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvproj new file mode 100644 index 0000000..299c7fd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvproj @@ -0,0 +1,594 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_udisk + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_udisk + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + internal_flash_if.c + 1 + ..\src\internal_flash_if.c + + + msc_mem.c + 1 + ..\src\msc_mem.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvprojx new file mode 100644 index 0000000..6b13029 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/MDK-ARM/msc_udisk.uvprojx @@ -0,0 +1,587 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_udisk + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_udisk + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + internal_flash_if.c + 1 + ..\src\internal_flash_if.c + + + msc_mem.c + 1 + ..\src\msc_mem.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_i2c.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/internal_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/internal_flash_if.h new file mode 100644 index 0000000..a8e83e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/internal_flash_if.h @@ -0,0 +1,48 @@ +/*! + \file internal_flash_if.h + \brief the header file of internal_flash_if.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __INTER_FLASH_ACCESS_H +#define __INTER_FLASH_ACCESS_H + +#include "usbd_conf.h" + +/* function declarations */ +/* initialize the nand flash */ +uint32_t flash_init(void); +/* read data from multiple blocks of nand flash */ +uint32_t flash_read_multi_blocks(uint8_t* pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num); +/* write data to multiple blocks of flash */ +uint32_t flash_write_multi_blocks(uint8_t* pBuf, uint32_t write_addr, uint16_t block_size, uint32_t block_num); + +#endif /* __INTER_FLASH_ACCESS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_conf.h new file mode 100644 index 0000000..d710616 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_conf.h @@ -0,0 +1,86 @@ +/*! + /file usbd_conf.h + /brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +#define USB_DEVICE_LOW_PWR_MODE_SUPPORT + +//#define USE_EXTERNAL_MEDIA +#define USE_INTERNAL_MEDIA + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STRING_COUNT 4U + +#define USBD_MSC_INTERFACE 0U + +#define PAGE_SIZE ((uint32_t)(2048U)) +#define NAND_FLASH_BASE_ADDRESS ((uint32_t)(0x08000000U + 0x06000U)) +#define NAND_FLASH_END_ADDRESS ((uint32_t)(0x08000000U + 0x40000U)) + +#define MSC_IN_EP EP_IN(1U) +#define MSC_OUT_EP EP_OUT(2U) + +#define EP0_TX_ADDR 0x40U +#define EP0_RX_ADDR 0x80U + +#define BULK_TX_ADDR 0xC0U +#define BULK_RX_ADDR 0x100U + +#define MEM_LUN_NUM 1U + +#define MSC_DATA_PACKET_SIZE 64U +#define MSC_MEDIA_PACKET_SIZE PAGE_SIZE + +#define BLOCK_SIZE PAGE_SIZE +#define BLOCK_NUM ((NAND_FLASH_END_ADDRESS - NAND_FLASH_BASE_ADDRESS) / BLOCK_SIZE) + + +/* endpoint count used by the MSC device */ +#define EP_COUNT (3U) + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_hw.h new file mode 100644 index 0000000..2dc2051 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure the different system clocks */ +void rcu_config(void); +/* configure the gpio peripheral */ +void gpio_config(void); +/* configure interrupt priority */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/readme.txt new file mode 100644 index 0000000..1a364a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/readme.txt @@ -0,0 +1,46 @@ +/*! + \file readme.txt + \brief description of the MSC demo. + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + + The Mass Storage example gives a typical example of how to use the +USB device peripheral to communicate with a PC Host using the bulk transfer +while the internal flash is used as storage media. + +This example supports the BBB (bulk bulk bulk) protocol and all needed SCSI +(small computer system interface) commands, and is compatible with windows platform. + + After running the example, the user just has to plug the USB cable into a PC host +and the device is automatically detected. A new removable drive appears in the +system window and write/read/format operations can be performed as with any other +removable drive. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..de8ea47 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config (void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config (void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config (void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/internal_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/internal_flash_if.c new file mode 100644 index 0000000..9563a4c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/internal_flash_if.c @@ -0,0 +1,107 @@ +/*! + \file internal_flash_if.c + \brief flash access functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "internal_flash_if.h" + +/*! + \brief initialize the nand flash + \param[in] none + \param[out] none + \retval status +*/ +uint32_t flash_init (void) +{ + fmc_unlock(); + + return 0U; +} + +/*! + \brief read data from multiple blocks of nand flash + \param[in] pBuf: pointer to user buffer + \param[in] read_addr: address to be read + \param[in] block_size: size of block + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_read_multi_blocks (uint8_t *pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num) +{ + uint32_t i; + uint8_t *pSource = (uint8_t *)(read_addr + NAND_FLASH_BASE_ADDRESS); + + /* Data transfer */ + while (block_num--) { + for (i = 0U; i < block_size; i++) { + *pBuf++ = *pSource++; + } + } + + return 0U; +} + +/*! + \brief write data to multiple blocks of flash + \param[in] pBuf: pointer to user buffer + \param[in] write_addr: address to be write + \param[in] block_size: block size + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_write_multi_blocks (uint8_t *pbuf, + uint32_t write_addr, + uint16_t block_size, + uint32_t block_num) +{ + uint32_t i = 0U, page = 0U, word_count = 0U; + uint32_t start_page = (write_addr / PAGE_SIZE) * PAGE_SIZE + NAND_FLASH_BASE_ADDRESS; + uint32_t *ptrs = (uint32_t *)pbuf; + + page = block_num; + word_count = PAGE_SIZE / 4U; + + for(; page > 0U; page--){ + fmc_page_erase(start_page); + + i = 0U; + + do{ + fmc_word_program(start_page, *ptrs++); + start_page += 4U; + } while(++i < word_count); + } + + return 0U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/main.c new file mode 100644 index 0000000..ca01e38 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/main.c @@ -0,0 +1,68 @@ +/*! + \file main.c + \brief USB device main routine + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_msc_core.h" +#include "usbd_hw.h" + +usb_dev usb_msc; + +/*! + \brief main routine will construct a MSC device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usb_msc, &msc_desc, &msc_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usb_msc); + + while(usb_msc.cur_status != USBD_CONFIGURED){ + } + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/msc_mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/msc_mem.c new file mode 100644 index 0000000..43d16ef --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/msc_mem.c @@ -0,0 +1,155 @@ +/*! + \file msc_mem.c + \brief msc memories operation functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_msc_mem.h" +#include "internal_flash_if.h" + +/* USB mass storage standard inquiry data */ +const uint8_t mem_inquiry_data[] = +{ + /* LUN 0 */ + 0x00, + 0x80, + 0x00, + 0x01, + (USBD_STD_INQUIRY_LENGTH - 5U), + 0x00, + 0x00, + 0x00, + 'G', 'D', '3', '2', ' ', ' ', ' ', ' ', /* Manufacturer: 8 bytes */ + 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', /* Product: 16 Bytes */ + ' ', 'F', 'L', 'A', 'S', 'H', ' ', ' ', + '1', '.', '0' ,'0', /* Version: 4 Bytes */ +}; + +static int8_t mem_init (uint8_t lun); +static int8_t mem_ready (uint8_t lun); +static int8_t mem_protected (uint8_t lun); +static int8_t mem_maxlun (void); +static int8_t mem_read (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen); +static int8_t mem_write (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen); + +usbd_mem_cb usbd_mem_opera = +{ + .mem_init = mem_init, + .mem_ready = mem_ready, + .mem_protected = mem_protected, + .mem_read = mem_read, + .mem_write = mem_write, + .mem_maxlun = mem_maxlun, + + .mem_inquiry_data = {(uint8_t *)mem_inquiry_data}, + .mem_block_size = {BLOCK_SIZE}, + .mem_block_len = {BLOCK_NUM} +}; + +usbd_mem_cb *usbd_mem_fops = &usbd_mem_opera; + +/*! + \brief initialize the storage medium + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_init (uint8_t lun) +{ + flash_init(); + + return 0; +} + +/*! + \brief check whether the medium is ready + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_ready (uint8_t lun) +{ + return 0; +} + +/*! + \brief check whether the medium is write-protected + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t mem_protected (uint8_t Lun) +{ + return 0; +} + +/*! + \brief read data from the medium + \param[in] lun: logical unit number + \param[in] buf: pointer to the buffer to save data + \param[in] blkaddr: address of 1st block to be read + \param[in] blklen: number of blocks to be read + \param[out] none + \retval Status +*/ +static int8_t mem_read (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen) +{ + flash_read_multi_blocks(buf, blkaddr, BLOCK_SIZE, blklen); + + return 0; +} + +/*! + \brief write data to the medium + \param[in] lun: logical unit number + \param[in] buf: pointer to the buffer to write + \param[in] blkaddr: address of 1st block to be read + \param[in] blkaddr: address of blocks to be written + \param[out] none + \retval Status +*/ +static int8_t mem_write (uint8_t lun, uint8_t *buf, uint32_t blkaddr, uint16_t blklen) +{ + flash_write_multi_blocks (buf, blkaddr, BLOCK_SIZE, blklen); + + return 0; +} + +/*! + \brief get number of supported logical unit + \param[in] none + \param[out] none + \retval Number of logical unit +*/ +static int8_t mem_maxlun (void) +{ + return (MEM_LUN_NUM - 1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/msc_udisk/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewd new file mode 100644 index 0000000..860344f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewp new file mode 100644 index 0000000..4272e54 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewp @@ -0,0 +1,1058 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\hid_keyboard_itf.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewt new file mode 100644 index 0000000..81278aa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.ewt @@ -0,0 +1,1162 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\hid_keyboard_itf.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.eww new file mode 100644 index 0000000..d48e4ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/EWARM/hid_keyboard.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\hid_keyboard.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt new file mode 100644 index 0000000..1faacd8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt @@ -0,0 +1,666 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + standard_hid + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + + + + 1 + 0 + 0x40021004 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + System Viewer\RCC + 35904 + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 61 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\hid_keyboard_itf.c + hid_keyboard_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + standard_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 24 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 65 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx new file mode 100644 index 0000000..98a3f36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx @@ -0,0 +1,590 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + standard_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 1 + 0 + 0x40021004 + 0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + System Viewer\RCC + 35904 + + + System Viewer\USB + 35905 + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\hid_keyboard_itf.c + hid_keyboard_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + standard_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 24 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 25 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj new file mode 100644 index 0000000..671e9cf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj @@ -0,0 +1,579 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + standard_hid + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_keyboard + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + hid_keyboard_itf.c + 1 + ..\src\hid_keyboard_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + standard_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx new file mode 100644 index 0000000..09cfead --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx @@ -0,0 +1,572 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + standard_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_keyboard + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + hid_keyboard_itf.c + 1 + ..\src\hid_keyboard_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_dma.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + standard_hid_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\hid\Source\standard_hid_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_conf.h new file mode 100644 index 0000000..3ee5411 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_conf.h @@ -0,0 +1,79 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* define if low power mode is enabled; it allows entering the device into DEEP_SLEEP mode + following USB suspend event and wakes up after the USB wakeup event is received. */ +#define USBD_LOWPWR_MODE_ENABLE + +/* USB feature -- Self Powered */ +/* #define USBD_SELF_POWERED */ + +/* link power mode support */ +/* #define LPM_ENABLED */ + +#define USBD_CFG_MAX_NUM 1 +#define USBD_ITF_MAX_NUM 1 + +#define USBD_HID_INTERFACE 0 + +/* endpoint count used by the HID device */ +#define EP_COUNT (2) + +#define USB_STRING_COUNT 4 + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_TX_ADDR 0x20 +#define EP0_RX_ADDR 0x40 + +#define INT_TX_ADDR 0x50 +#define INT_RX_ADDR 0x60 + +#define HID_IN_EP EP_IN(1) + +#define HID_IN_PACKET 8 + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ +#define BTABLE_OFFSET (0x0000) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_hw.h new file mode 100644 index 0000000..4855482 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/inc/usbd_hw.h @@ -0,0 +1,53 @@ +/*! + \file usbd_hw.h + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure the different system clocks */ +void rcu_config(void); +/* configure the gpio peripheral */ +void gpio_config(void); +/* configure interrupt priority */ +void nvic_config(void); + +#ifdef USE_IRC48M +/* configure the CTC peripheral */ +void ctc_config(void); +#endif + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/readme.txt new file mode 100644 index 0000000..fa432df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/readme.txt @@ -0,0 +1,52 @@ +/*! + \file readme.txt + \brief description of the USB keyboard demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB_Device peripheral. + + The GD32 device is enumerated as an USB keyboard, that uses the native PC Host +HID driver. + + The USB keyboard use three key(wakeup key, tamper key and user1 key) to print 3 +characters('b', 'a' and 'c'). + + This demo supports remote wakeup (which is the ability of a USB device to +bring a suspended bus back to the active condition), and the tamper key is +used as the remote wakeup source. + + In order to test USB remote wakeup function, you can do as follows: + - Manually switch PC to standby mode + - Wait for PC to fully enter the standby mode + - Push the tamper key + - If PC is ON, remote wakeup is OK, else failed. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_it.c new file mode 100644 index 0000000..190285e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_it.c @@ -0,0 +1,188 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" +#include "usbd_lld_core.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +/*! + \brief this function handles EXTI110_15_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) { + /* check if the remote wakeup feature is enabled */ + if (usbd_core.dev->pm.remote_wakeup) { + /* exit low power mode and re-configure clocks */ + usbd_remote_wakeup_active(usbd_core.dev); + + usbd_core.dev->cur_status = usbd_core.dev->backup_status; + + /* disable Remote wakeup feature*/ + usbd_core.dev->pm.remote_wakeup = 0U; + } + + /* clear the EXTI line pending bit */ + exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE); + } +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..860817e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/gd32f10x_usbd_hw.c @@ -0,0 +1,90 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usb device hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config (void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* enable the power clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config (void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config (void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); + + /* enable the USB Wake-up interrupt */ + nvic_irq_enable((uint8_t)USBD_WKUP_IRQn, 0U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/hid_keyboard_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/hid_keyboard_itf.c new file mode 100644 index 0000000..0462d04 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/hid_keyboard_itf.c @@ -0,0 +1,120 @@ +/*! + \file hid_keyboard_itf.c + \brief standard HID keyboard interface driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "standard_hid_core.h" + +typedef enum +{ + CHAR_A = 1, + CHAR_B, + CHAR_C +} key_char; + +static void key_config(void); +static uint8_t key_state(void); +static void hid_key_data_send(usb_dev *udev); + +hid_fop_handler fop_handler = { + .hid_itf_config = key_config, + .hid_itf_data_process = hid_key_data_send +}; + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +static void key_config (void) +{ + /* keys configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO); + gd_eval_key_init(KEY_USER, KEY_MODE_GPIO); + + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); +} + +/*! + \brief to get usb keyboard state + \param[in] none + \param[out] none + \retval the char +*/ +static uint8_t key_state (void) +{ + /* have pressed tamper key */ + if (!gd_eval_key_state_get(KEY_TAMPER)) { + return CHAR_A; + } + + /* have pressed wakeup key */ + if (!gd_eval_key_state_get(KEY_WAKEUP)) { + return CHAR_B; + } + + /* have pressed user key */ + + if (!gd_eval_key_state_get(KEY_USER)) { + return CHAR_C; + } + + /* no pressed any key */ + return 0U; +} + +static void hid_key_data_send(usb_dev *udev) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->class_data[USBD_HID_INTERFACE]; + + if (hid->prev_transfer_complete) { + switch (key_state()) { + case CHAR_A: + hid->data[2] = 0x04U; + break; + case CHAR_B: + hid->data[2] = 0x05U; + break; + case CHAR_C: + hid->data[2] = 0x06U; + break; + default: + break; + } + + if (0U != hid->data[2]) { + hid_report_send(udev, hid->data, HID_IN_PACKET); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/main.c new file mode 100644 index 0000000..7604a86 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/main.c @@ -0,0 +1,72 @@ +/*! + \file main.c + \brief construct a USB keyboard + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "standard_hid_core.h" +#include "usbd_hw.h" + +usb_dev usb_hid; + +extern hid_fop_handler fop_handler; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + hid_itfop_register (&usb_hid, &fop_handler); + + /* USB device configuration */ + usbd_init(&usb_hid, &hid_desc, &hid_class); + + /* NVIC configuration */ + nvic_config(); + + usbd_connect(&usb_hid); + + while(usb_hid.cur_status != USBD_CONFIGURED){ + } + + while (1) { + fop_handler.hid_itf_data_process(&usb_hid); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/standard_hid_keyboard/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewd new file mode 100644 index 0000000..860344f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewp new file mode 100644 index 0000000..7a53e86 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewp @@ -0,0 +1,1052 @@ + + + + 2 + + USBD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewt new file mode 100644 index 0000000..38d87cf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.ewt @@ -0,0 +1,1156 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usbd_hw.c + + + $PROJ_DIR$\..\src\main.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + + USBD_Class + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + USBD_Device + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + USBD_Drivers + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + $PROJ_DIR$\..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.eww new file mode 100644 index 0000000..b053855 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/EWARM/usb_printer.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\usb_printer.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvopt new file mode 100644 index 0000000..a40fd9a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvopt @@ -0,0 +1,618 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + usb_printer + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 + + + 0 + UL2CM3 + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + gd32f10x_rtc.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvoptx new file mode 100644 index 0000000..368d78f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvoptx @@ -0,0 +1,545 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + usb_printer + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + + + 0 + JL2CM3 + -U -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usbd_hw.c + gd32f10x_usbd_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + gd32f10x_rtc.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USBD_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + usbd_lld_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + usbd_lld_int.c + 0 + 0 + + + + + USBD_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + usbd_pwr.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USBD_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvproj new file mode 100644 index 0000000..71fce93 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvproj @@ -0,0 +1,574 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + usb_printer + 0x4 + ARM-ADS + + + GD32F103VC + GigaDevice + IRAM(0x20000000-0x2000BFFF) IROM(0x08000000-0x0803FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_hd.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_HD + + + SFD\GD\GD32F10x\GD32F10x_HD.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usb_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_rtc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + printer_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvprojx new file mode 100644 index 0000000..f7a468a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/MDK-ARM/usb_printer.uvprojx @@ -0,0 +1,567 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + usb_printer + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F103VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x0000C000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_HD -FS08000000 -FL040000 -FP0($$Device:GD32F103VC$Flash\GD32F10x_HD.FLM)) + 0 + $$Device:GD32F103VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F103VC$SVD\GD32F10x\GD32F10x_HD.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usb_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0xc000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_HD + + ..\inc;..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\device\Include;..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Include;..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usbd_hw.c + 1 + ..\src\gd32f10x_usbd_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_rtc.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USBD_Drivers + + + usbd_lld_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_core.c + + + usbd_lld_int.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\usbd\Source\usbd_lld_int.c + + + + + USBD_Device + + + usbd_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_enum.c + + + usbd_pwr.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_pwr.c + + + usbd_transc.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\device\Source\usbd_transc.c + + + + + USBD_Class + + + printer_core.c + 1 + ..\..\..\..\Firmware\GD32F10x_usbd_library\class\device\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_hd.s + 2 + ..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..1b881c2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_conf.h new file mode 100644 index 0000000..71ae81d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_conf.h @@ -0,0 +1,77 @@ +/*! + \file usbd_conf.h + \brief usb device driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +/* class layer parameter */ +#define PRINTER_IN_EP EP_IN(1U) +#define PRINTER_OUT_EP EP_OUT(1U) +#define PRINTER_DATA_PACKET_SIZE 64U +#define PRINTER_IN_PACKET PRINTER_DATA_PACKET_SIZE +#define PRINTER_OUT_PACKET PRINTER_DATA_PACKET_SIZE + +/* USB user string supported */ +#define USB_SUPPORT_USER_STRING_DESC + +/* endpoint0, Rx/Tx buffers address offset */ +#define EP0_RX_ADDR (0x40U) +#define EP0_TX_ADDR (0x80U) + +/* CDC data Tx buffer address offset */ +#define BULK_TX_ADDR (0x140U) + +/* CDC data Rx buffer address offset */ +#define BULK_RX_ADDR (0x100U) + +/* endpoint count used by the Printer device */ +#define EP_COUNT (2) + +#define USB_STRING_COUNT 4U + +/* base address of the allocation buffer, used for buffer descriptor table and packet memory */ + +#define BTABLE_OFFSET (0x0000U) + +#define USB_PULLUP GPIOD +#define USB_PULLUP_PIN GPIO_PIN_13 +#define RCU_AHBPeriph_GPIO_PULLUP RCU_GPIOD + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_hw.h new file mode 100644 index 0000000..4e2148b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/inc/usbd_hw.h @@ -0,0 +1,48 @@ +/*! + \file usbd_hw.h + \brief usbd hardware configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_HW_H +#define __USBD_HW_H + +#include "usbd_conf.h" + +/* function declarations */ +/* configure rcu clock */ +void rcu_config(void); +/* configure gpio port */ +void gpio_config(void); +/* configure nvic */ +void nvic_config(void); + +#endif /* __USBD_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/readme.txt new file mode 100644 index 0000000..43fa502 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/readme.txt @@ -0,0 +1,41 @@ +/*! + \file readme.txt + \brief description of the USB device printer example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32F103C-EVAL board,it provides a description of +how to use the USB_Device peripheral. + + The GD32 device is enumerated as an printer device, that uses the native PC Host +printer driver. + + To test the demo, you can run printer demo, then you check it from device manager. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_it.c new file mode 100644 index 0000000..54e0d8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_it.c @@ -0,0 +1,162 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "usbd_lld_int.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBD_LP_CAN0_RX0_IRQHandler (void) +{ + usbd_isr(); +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBD_WKUP_IRQHandler (void) +{ + exti_interrupt_flag_clear(EXTI_18); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_usbd_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_usbd_hw.c new file mode 100644 index 0000000..b12f8af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/gd32f10x_usbd_hw.c @@ -0,0 +1,80 @@ +/*! + \file gd32f10x_usbd_hw.c + \brief usbd hardware configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_hw.h" + +/*! + \brief configure the different system clocks + \param[in] none + \param[out] none + \retval none +*/ +void rcu_config(void) +{ + /* enable USB pull-up pin clock */ + rcu_periph_clock_enable(RCU_AHBPeriph_GPIO_PULLUP); + + /* configure USB model clock from PLL clock */ + rcu_usb_clock_config(RCU_CKUSB_CKPLL_DIV2); + + /* enable USB APB1 clock */ + rcu_periph_clock_enable(RCU_USBD); +} + +/*! + \brief configure the gpio peripheral + \param[in] none + \param[out] none + \retval none +*/ +void gpio_config(void) +{ + /* configure usb pull-up pin */ + gpio_init(USB_PULLUP, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, USB_PULLUP_PIN); +} + +/*! + \brief configure interrupt priority + \param[in] none + \param[out] none + \retval none +*/ +void nvic_config(void) +{ + /* 1 bit for pre-emption priority, 3 bits for subpriority */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE1_SUB3); + + /* enable the USB low priority interrupt */ + nvic_irq_enable((uint8_t)USBD_LP_CAN0_RX0_IRQn, 1U, 0U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/main.c new file mode 100644 index 0000000..d29d84f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/main.c @@ -0,0 +1,69 @@ +/*! + \file main.c + \brief main routine will construct a printer device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "printer_core.h" +#include "usbd_hw.h" + +usb_dev usbd_printer; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* system clocks configuration */ + rcu_config(); + + /* GPIO configuration */ + gpio_config(); + + /* USB device configuration */ + usbd_init(&usbd_printer, &printer_desc, &printer_class); + + /* NVIC configuration */ + nvic_config(); + + /* enabled USB pull-up */ + usbd_connect(&usbd_printer); + + while (USBD_CONFIGURED != usbd_printer.cur_status) { + /* wait for standard USB enumeration is finished */ + } + + while (1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBD/usb_printer/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewd new file mode 100644 index 0000000..cc9763e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewp new file mode 100644 index 0000000..65eb5e3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewp @@ -0,0 +1,1064 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Appliaction + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_audio_codec.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_out_itf.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewt new file mode 100644 index 0000000..cfceb37 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.ewt @@ -0,0 +1,1165 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Appliaction + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_audio_codec.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\class\audio\Source\audio_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\class\audio\Source\audio_out_itf.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.eww new file mode 100644 index 0000000..778937f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/EWARM/audio.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\audio.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvopt new file mode 100644 index 0000000..a94d71d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvopt @@ -0,0 +1,710 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + audio + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U59701280 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0100000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + 0 + 0 + 309 + 1 +
134223630
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + +
+
+ + + 0 + 1 + device_descripter + + + 1 + 1 + dfu_status + + + 2 + 1 + IsocOutWrPtr + + + 3 + 1 + IsocOutBuff + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + System Viewer\SPI1 + 35905 + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 23 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_audio_codec.c + gd32f10x_audio_codec.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 40 + 0 + 22 + 42 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_core.c + audio_core.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 26 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_out_itf.c + audio_out_itf.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 25 + 2 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 26 + 5 + 0 + 0 + 53415988 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvoptx new file mode 100644 index 0000000..748a111 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvoptx @@ -0,0 +1,624 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + audio + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59701280 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0100000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + 0 + 309 + 1 +
134223630
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + +
+
+ + + 0 + 1 + device_descripter + + + 1 + 1 + dfu_status + + + 2 + 1 + IsocOutWrPtr + + + 3 + 1 + IsocOutBuff + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + System Viewer\SPI1 + 35905 + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_audio_codec.c + gd32f10x_audio_codec.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_core.c + audio_core.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_out_itf.c + audio_out_itf.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 25 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 26 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvproj new file mode 100644 index 0000000..4fb7ec7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvproj @@ -0,0 +1,584 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + audio + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + audio + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_USB_FS,GD32F10X_CL,USE_USB_AD_SPEAKER + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Utilities;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + .\GD32F10X_OBJ\HID_DFU.sct + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_audio_codec.c + 1 + ..\src\gd32f10x_audio_codec.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_dma.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + audio_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_core.c + + + audio_out_itf.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_out_itf.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvprojx new file mode 100644 index 0000000..8a051b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/MDK-ARM/audio.uvprojx @@ -0,0 +1,577 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + audio + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + audio + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_USB_FS,GD32F10X_CL,USE_USB_AD_SPEAKER + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Utilities;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + .\GD32F10X_OBJ\HID_DFU.sct + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_audio_codec.c + 1 + ..\src\gd32f10x_audio_codec.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_dma.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + audio_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_core.c + + + audio_out_itf.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\audio\Source\audio_out_itf.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_audio_codec.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_audio_codec.h new file mode 100644 index 0000000..92767ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_audio_codec.h @@ -0,0 +1,132 @@ +/*! + \file gd32f10x_usb_audio_codec.h + \brief This file contains all the functions prototypes for the audio codec + low layer driver. + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_AUDIO_CODEC_H +#define __GD32F10X_AUDIO_CODEC_H + +#include "usbd_conf.h" + +/* select the interrupt preemption priority and sub-priority for DMA interrupt */ +#define AD_IRQ_PREPRIO 2 +#define AD_IRQ_SUBRIO 0 + +/* uncomment the defines below to select if the master clock mode should be enabled or not */ +#define IIS_MCLK_ENABLED +//#define IIS_MCLK_DISABLED + +/* hardware configuration defines parameters */ +/* I2S peripheral configuration defines (data and control interface of the audio codec) */ +#define AD_I2S SPI1 +#define AD_I2S_CLK RCU_SPI1 +#define AD_I2S_ADDRESS (SPI1+0x0C) +#define AD_I2S_IRQ SPI1_IRQn +#define AD_I2S_WS_PIN GPIO_PIN_12 +#define AD_I2S_SCK_PIN GPIO_PIN_13 +#define AD_I2S_SD_PIN GPIO_PIN_15 +#define AD_I2S_MCK_PIN GPIO_PIN_6 +#define AD_I2S_GPIO_CLK RCU_GPIOB +#define AD_I2S_MCK_CLK RCU_GPIOC +#define AD_I2S_GPIO GPIOB +#define AD_I2S_MCK_GPIO GPIOC + +/* I2S DMA Stream definitions */ +#define AD_DMA_CLOCK RCU_DMA0 +#define AD_DMA_CHANNEL DMA_CH4 +#define AD_DMA_IRQ DMA0_Channel4_IRQn +#define AD_DMA_FLAG_TC DMA_FLAG_FTF +#define AD_DMA_FLAG_HT DMA_FLAG_HTF +#define AD_DMA_FLAG_TE DMA_FLAG_ERR +#define AD_DMA_FLAG_GL DMA_INT_FLAG_G +#define AD_DMA_FLAG_ALL DMA_INT_FLAG_G +#define AD_DMA DMA0 + +#define AD_DMA_IRQHandler DMA0_Channel4_IRQHandler + +/* mask for the bit en of the i2s cfgr register */ +#define I2S_ENABLE_MASK (0x0400) + +/* audio state */ +typedef enum _audio_status +{ + AD_OK = 0, + AD_FAIL, +} audio_status; + +typedef enum _audio_ctl +{ + AD_PAUSE = 0, + AD_RESUME, +} audio_ctl; + +/* audio machine states */ +typedef enum _audio_state +{ + AD_STATE_INACTIVE = 0, + AD_STATE_ACTIVE, + AD_STATE_PLAYING, + AD_STATE_PAUSED, + AD_STATE_STOPPED, + AD_STATE_ERROR, +} audio_state_enum; + +/* audio commands enumeration */ +typedef enum +{ + AD_CMD_PLAY = 1U, + AD_CMD_PAUSE, + AD_CMD_STOP, +}audio_cmd_enum; + +/* function declarations */ +/* initializes the audio codec audio interface (i2s) */ +void codec_audio_interface_init(uint32_t audio_freq); +/* deinitialize the audio codec audio interface */ +void codec_audio_interface_deinit(void); +/* initializes IOs used by the audio codec */ +void codec_gpio_init(void); +/* deinitialize IOs used by the audio codec interface */ +void codec_gpio_deinit(void); +/* initializes dma to prepare for audio data transfer */ +void codec_i2s_dma_init(void); +/* restore default state of the used media */ +void codec_i2s_dma_deinit(void); +/* starts playing audio stream from the audio media */ +void audio_play(uint32_t addr, uint32_t size); +/* pauses or resumes the audio stream playing from the media */ +void audio_pause_resume(uint32_t cmd, uint32_t addr, uint32_t size); +/* stops audio stream playing on the used media */ +void audio_stop(void); + +#endif /* __GD32F10X_AUDIO_CODEC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..87a668e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/gd32f10x_libopt.h @@ -0,0 +1,63 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2020-07-17, V3.0.0, firmware for GD32F10x + \version 2022-06-10, V3.1.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usb_conf.h new file mode 100644 index 0000000..ba824aa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usb_conf.h @@ -0,0 +1,126 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "gd32f10x_audio_codec.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128 + #define TX0_FIFO_FS_SIZE 64 + #define TX1_FIFO_FS_SIZE 64 + #define TX2_FIFO_FS_SIZE 64 + #define TX3_FIFO_FS_SIZE 0 +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1 +#define USB_LOW_POWER 0 + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usbd_conf.h new file mode 100644 index 0000000..662ecf6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/usbd_conf.h @@ -0,0 +1,126 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +/* USB configure exported defines */ +#define USBD_CFG_MAX_NUM 1 +#define USBD_ITF_MAX_NUM 2 + +#define USBD_AD_INTERFACE 0 + +#define USB_STR_DESC_MAX_SIZE 255 + +/* Audio class layer parameter */ +#define AD_OUT_EP EP_OUT(3) +#define AD_IN_EP EP_IN(1) +#define AD_FEEDBACK_IN_EP EP_IN(2) + +#define USB_STRING_COUNT 4U + +/* micro-phone parameter */ +#define USBD_MIC_FREQ USBD_AD_FREQ_8K +#define MIC_IN_BIT_RESOLUTION 16 +#define MIC_IN_CHANNEL_NBR 2 /* Mono = 1, Stereo = 2 */ +#define MIC_IN_PACKET (uint32_t)(((USBD_MIC_FREQ * \ + (MIC_IN_BIT_RESOLUTION/8) *\ + MIC_IN_CHANNEL_NBR) /1000)) + +/* speaker parameter */ +#define USBD_SPEAKER_FREQ USBD_AD_FREQ_48K +#define SPEAKER_OUT_BIT_RESOLUTION 16 +#define SPEAKER_OUT_CHANNEL_NBR 2 /* Mono = 1, Stereo = 2 */ +#define SPEAKER_OUT_PACKET (uint32_t)(((USBD_SPEAKER_FREQ * \ + (SPEAKER_OUT_BIT_RESOLUTION/8) *\ + SPEAKER_OUT_CHANNEL_NBR) /1000)) + +/* feedback parameter */ +#define FEEDBACK_FREQ_OFFSET (USBD_SPEAKER_FREQ/100) +#define FEEDBACK_IN_PACKET 3 +#define FEEDBACK_IN_INTERVAL 5 + +#define SPEAKER_OUT_MAX_PACKET (SPEAKER_OUT_PACKET + 20) + +/* audio frequency in Hz */ +#define USBD_AD_FREQ_48K 48000U +#define USBD_AD_FREQ_44K 44100U +#define USBD_AD_FREQ_22K 22000U +#define USBD_AD_FREQ_16K 16000U +#define USBD_AD_FREQ_8K 8000U + +#define DEFAULT_VOLUME 65U /* Default volume in % (Mute=0%, Max = 100%) in Logarithmic values. + To get accurate volume variations, it is possible to use a logarithmic + coversion table to convert from percentage to logarithmic law. + In order to keep this example code simple, this conversion is not used.*/ + +/*! + \brief get the calculate value of i2s sample frequency + \param[in] set_freq: setting sample frequence + \param[out] none + \retval i2s sample frequency + \note Users need to calculate the actual sampling frequency + of I2S module at different frequency points by themselves. +*/ +__STATIC_INLINE uint32_t I2S_ACTUAL_SAM_FREQ(uint32_t set_freq) +{ + uint32_t actual_freq; + + switch(set_freq){ + case USBD_AD_FREQ_48K: + actual_freq = 46875; + break; + + case USBD_AD_FREQ_44K: + actual_freq = 41600; + break; + case USBD_AD_FREQ_16K: + actual_freq = 16300; + break; + + case USBD_AD_FREQ_8K: + actual_freq = 7900; + break; + + default: + actual_freq = set_freq; + break; + } + + return actual_freq; +} + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/wave_data.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/wave_data.h new file mode 100644 index 0000000..1c8ca50 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/inc/wave_data.h @@ -0,0 +1,3537 @@ +/*! + \file wave_data.h + \brief wave data + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __WAVE_DATA_H_ +#define __WAVE_DATA_H_ + +/* wave data */ +const char wavetestdata[]={ +0x52 , 0x49 , 0x46 , 0x46 , 0x64 , 0xDA , 0x00 , 0x00 , 0x57 , 0x41 , 0x56 , 0x45 , 0x66 , 0x6D , 0x74 , 0x20 , +0x10 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x02 , 0x00 , 0x40 , 0x1F , 0x00 , 0x00 , 0x00 , 0x7D , 0x00 , 0x00 , +0x04 , 0x00 , 0x10 , 0x00 , 0x64 , 0x61 , 0x74 , 0x61 , 0x40 , 0xDA , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x03 , 0x00 , 0x03 , 0x00 , 0x06 , 0x00 , 0x06 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , +0x06 , 0x00 , 0x06 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0x0B , 0x00 , 0x0B , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , +0xF0 , 0xFF , 0xF0 , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , +0xF3 , 0xFF , 0xF3 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xE4 , 0xFF , 0xE4 , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , +0xE3 , 0xFF , 0xE3 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xF3 , 0xFF , 0xF3 , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , 0x26 , 0x00 , 0x26 , 0x00 , +0x1C , 0x00 , 0x1C , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , +0x58 , 0x00 , 0x58 , 0x00 , 0x5B , 0x00 , 0x5B , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x53 , 0x00 , 0x53 , 0x00 , +0x23 , 0x00 , 0x23 , 0x00 , 0xFB , 0xFF , 0xFB , 0xFF , 0x0E , 0x00 , 0x0E , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , +0x15 , 0x00 , 0x15 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0x7C , 0x00 , 0x7C , 0x00 , +0x82 , 0x00 , 0x82 , 0x00 , 0x88 , 0x00 , 0x88 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , 0x87 , 0x00 , 0x87 , 0x00 , +0x7B , 0x00 , 0x7B , 0x00 , 0x5A , 0x00 , 0x5A , 0x00 , 0x44 , 0x00 , 0x44 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , +0x21 , 0x00 , 0x21 , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0xC8 , 0xFF , 0xC8 , 0xFF , 0x3C , 0xFF , 0x3C , 0xFF , +0xFE , 0xFE , 0xFE , 0xFE , 0xEB , 0xFE , 0xEB , 0xFE , 0xAD , 0xFE , 0xAD , 0xFE , 0x3E , 0xFE , 0x3E , 0xFE , +0x15 , 0xFE , 0x15 , 0xFE , 0xDC , 0xFD , 0xDC , 0xFD , 0xAE , 0xFD , 0xAE , 0xFD , 0x73 , 0xFD , 0x73 , 0xFD , +0x93 , 0xFD , 0x93 , 0xFD , 0xAE , 0xFD , 0xAE , 0xFD , 0xEB , 0xFD , 0xEB , 0xFD , 0x01 , 0xFE , 0x01 , 0xFE , +0xDF , 0xFD , 0xDF , 0xFD , 0x05 , 0xFE , 0x05 , 0xFE , 0x25 , 0xFE , 0x25 , 0xFE , 0x1F , 0xFE , 0x1F , 0xFE , +0x37 , 0xFE , 0x37 , 0xFE , 0x32 , 0xFE , 0x32 , 0xFE , 0x5F , 0xFE , 0x5F , 0xFE , 0x83 , 0xFE , 0x83 , 0xFE , +0xD8 , 0xFE , 0xD8 , 0xFE , 0x8E , 0xFF , 0x8E , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x0A , 0x01 , 0x0A , 0x01 , +0x10 , 0x02 , 0x10 , 0x02 , 0x1D , 0x03 , 0x1D , 0x03 , 0x47 , 0x04 , 0x47 , 0x04 , 0x23 , 0x05 , 0x23 , 0x05 , +0x9B , 0x05 , 0x9B , 0x05 , 0x01 , 0x06 , 0x01 , 0x06 , 0x4E , 0x06 , 0x4E , 0x06 , 0x5D , 0x06 , 0x5D , 0x06 , +0x0F , 0x06 , 0x0F , 0x06 , 0xEE , 0x05 , 0xEE , 0x05 , 0x91 , 0x05 , 0x91 , 0x05 , 0xF9 , 0x04 , 0xF9 , 0x04 , +0x60 , 0x04 , 0x60 , 0x04 , 0xA3 , 0x03 , 0xA3 , 0x03 , 0x0C , 0x03 , 0x0C , 0x03 , 0x12 , 0x02 , 0x12 , 0x02 , +0xAE , 0x00 , 0xAE , 0x00 , 0xB9 , 0xFF , 0xB9 , 0xFF , 0x0D , 0xFF , 0x0D , 0xFF , 0x0F , 0xFE , 0x0F , 0xFE , +0xEC , 0xFC , 0xEC , 0xFC , 0x38 , 0xFC , 0x38 , 0xFC , 0x69 , 0xFB , 0x69 , 0xFB , 0x88 , 0xFA , 0x88 , 0xFA , +0xF9 , 0xF9 , 0xF9 , 0xF9 , 0x56 , 0xF9 , 0x56 , 0xF9 , 0x99 , 0xF8 , 0x99 , 0xF8 , 0x37 , 0xF8 , 0x37 , 0xF8 , +0x86 , 0xF7 , 0x86 , 0xF7 , 0x59 , 0xF7 , 0x59 , 0xF7 , 0x45 , 0xF7 , 0x45 , 0xF7 , 0x32 , 0xF7 , 0x32 , 0xF7 , +0x81 , 0xF7 , 0x81 , 0xF7 , 0x4F , 0xF7 , 0x4F , 0xF7 , 0x89 , 0xF7 , 0x89 , 0xF7 , 0xF9 , 0xF7 , 0xF9 , 0xF7 , +0x51 , 0xF8 , 0x51 , 0xF8 , 0xA5 , 0xF8 , 0xA5 , 0xF8 , 0x3C , 0xF9 , 0x3C , 0xF9 , 0xDA , 0xF9 , 0xDA , 0xF9 , +0x9D , 0xFA , 0x9D , 0xFA , 0x71 , 0xFB , 0x71 , 0xFB , 0xB7 , 0xFC , 0xB7 , 0xFC , 0xB4 , 0xFD , 0xB4 , 0xFD , +0xBE , 0xFF , 0xBE , 0xFF , 0x1E , 0x01 , 0x1E , 0x01 , 0xBB , 0x02 , 0xBB , 0x02 , 0xFA , 0x04 , 0xFA , 0x04 , +0x90 , 0x06 , 0x90 , 0x06 , 0x77 , 0x08 , 0x77 , 0x08 , 0x15 , 0x0A , 0x15 , 0x0A , 0x4B , 0x0B , 0x4B , 0x0B , +0x30 , 0x0C , 0x30 , 0x0C , 0xB4 , 0x0C , 0xB4 , 0x0C , 0xD2 , 0x0C , 0xD2 , 0x0C , 0xAC , 0x0C , 0xAC , 0x0C , +0xFD , 0x0B , 0xFD , 0x0B , 0x77 , 0x0B , 0x77 , 0x0B , 0x49 , 0x0A , 0x49 , 0x0A , 0x45 , 0x09 , 0x45 , 0x09 , +0xF7 , 0x07 , 0xF7 , 0x07 , 0xE2 , 0x06 , 0xE2 , 0x06 , 0x99 , 0x05 , 0x99 , 0x05 , 0xDE , 0x03 , 0xDE , 0x03 , +0xA2 , 0x02 , 0xA2 , 0x02 , 0x0B , 0x02 , 0x0B , 0x02 , 0x31 , 0x00 , 0x31 , 0x00 , 0xC4 , 0xFE , 0xC4 , 0xFE , +0xAD , 0xFD , 0xAD , 0xFD , 0x03 , 0xFD , 0x03 , 0xFD , 0x37 , 0xFC , 0x37 , 0xFC , 0xCA , 0xFA , 0xCA , 0xFA , +0x8A , 0xFA , 0x8A , 0xFA , 0xB8 , 0xF9 , 0xB8 , 0xF9 , 0x77 , 0xF9 , 0x77 , 0xF9 , 0x06 , 0xF9 , 0x06 , 0xF9 , +0x04 , 0xF9 , 0x04 , 0xF9 , 0x5D , 0xF9 , 0x5D , 0xF9 , 0x2F , 0xF9 , 0x2F , 0xF9 , 0xF4 , 0xF8 , 0xF4 , 0xF8 , +0x86 , 0xF9 , 0x86 , 0xF9 , 0xDB , 0xF9 , 0xDB , 0xF9 , 0xE0 , 0xF9 , 0xE0 , 0xF9 , 0x7C , 0xFA , 0x7C , 0xFA , +0xA4 , 0xFA , 0xA4 , 0xFA , 0xFF , 0xFA , 0xFF , 0xFA , 0x92 , 0xFB , 0x92 , 0xFB , 0xB8 , 0xFB , 0xB8 , 0xFB , +0x37 , 0xFC , 0x37 , 0xFC , 0x74 , 0xFC , 0x74 , 0xFC , 0x38 , 0xFD , 0x38 , 0xFD , 0xA9 , 0xFD , 0xA9 , 0xFD , +0x4A , 0xFE , 0x4A , 0xFE , 0x7C , 0xFF , 0x7C , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , 0x66 , 0x01 , 0x66 , 0x01 , +0x6A , 0x02 , 0x6A , 0x02 , 0x93 , 0x03 , 0x93 , 0x03 , 0x21 , 0x05 , 0x21 , 0x05 , 0x59 , 0x06 , 0x59 , 0x06 , +0x6E , 0x07 , 0x6E , 0x07 , 0x84 , 0x08 , 0x84 , 0x08 , 0x52 , 0x09 , 0x52 , 0x09 , 0xFF , 0x09 , 0xFF , 0x09 , +0x39 , 0x0A , 0x39 , 0x0A , 0x6C , 0x0A , 0x6C , 0x0A , 0x3E , 0x0A , 0x3E , 0x0A , 0xBA , 0x09 , 0xBA , 0x09 , +0x5F , 0x09 , 0x5F , 0x09 , 0x55 , 0x08 , 0x55 , 0x08 , 0xB8 , 0x07 , 0xB8 , 0x07 , 0x94 , 0x06 , 0x94 , 0x06 , +0xCA , 0x05 , 0xCA , 0x05 , 0xBA , 0x04 , 0xBA , 0x04 , 0x8C , 0x03 , 0x8C , 0x03 , 0xAB , 0x02 , 0xAB , 0x02 , +0x29 , 0x02 , 0x29 , 0x02 , 0x82 , 0x00 , 0x82 , 0x00 , 0xF8 , 0xFF , 0xF8 , 0xFF , 0x0C , 0xFF , 0x0C , 0xFF , +0x6F , 0xFE , 0x6F , 0xFE , 0xE9 , 0xFD , 0xE9 , 0xFD , 0x47 , 0xFD , 0x47 , 0xFD , 0x38 , 0xFD , 0x38 , 0xFD , +0x7D , 0xFC , 0x7D , 0xFC , 0x5C , 0xFC , 0x5C , 0xFC , 0xE1 , 0xFB , 0xE1 , 0xFB , 0xB7 , 0xFB , 0xB7 , 0xFB , +0x28 , 0xFB , 0x28 , 0xFB , 0x62 , 0xFB , 0x62 , 0xFB , 0x9B , 0xFA , 0x9B , 0xFA , 0xB1 , 0xFA , 0xB1 , 0xFA , +0xE1 , 0xFA , 0xE1 , 0xFA , 0x06 , 0xFB , 0x06 , 0xFB , 0xD6 , 0xFA , 0xD6 , 0xFA , 0x65 , 0xFB , 0x65 , 0xFB , +0x43 , 0xFB , 0x43 , 0xFB , 0xC7 , 0xFB , 0xC7 , 0xFB , 0xCB , 0xFB , 0xCB , 0xFB , 0xFD , 0xFB , 0xFD , 0xFB , +0x4C , 0xFC , 0x4C , 0xFC , 0x5D , 0xFC , 0x5D , 0xFC , 0xEC , 0xFC , 0xEC , 0xFC , 0xF1 , 0xFC , 0xF1 , 0xFC , +0xD8 , 0xFD , 0xD8 , 0xFD , 0xEE , 0xFD , 0xEE , 0xFD , 0x16 , 0xFF , 0x16 , 0xFF , 0x64 , 0xFF , 0x64 , 0xFF , +0x85 , 0x00 , 0x85 , 0x00 , 0x5D , 0x01 , 0x5D , 0x01 , 0x30 , 0x02 , 0x30 , 0x02 , 0x8C , 0x03 , 0x8C , 0x03 , +0x36 , 0x04 , 0x36 , 0x04 , 0x33 , 0x05 , 0x33 , 0x05 , 0x0E , 0x06 , 0x0E , 0x06 , 0x6B , 0x06 , 0x6B , 0x06 , +0x24 , 0x07 , 0x24 , 0x07 , 0x07 , 0x07 , 0x07 , 0x07 , 0x50 , 0x07 , 0x50 , 0x07 , 0x0D , 0x07 , 0x0D , 0x07 , +0xA4 , 0x06 , 0xA4 , 0x06 , 0x5C , 0x06 , 0x5C , 0x06 , 0x82 , 0x05 , 0x82 , 0x05 , 0x10 , 0x05 , 0x10 , 0x05 , +0x19 , 0x04 , 0x19 , 0x04 , 0x37 , 0x03 , 0x37 , 0x03 , 0x6C , 0x02 , 0x6C , 0x02 , 0xA1 , 0x01 , 0xA1 , 0x01 , +0xAB , 0x00 , 0xAB , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0x18 , 0xFF , 0x18 , 0xFF , 0x0E , 0xFF , 0x0E , 0xFF , +0x23 , 0xFE , 0x23 , 0xFE , 0x26 , 0xFE , 0x26 , 0xFE , 0x9A , 0xFD , 0x9A , 0xFD , 0x6A , 0xFD , 0x6A , 0xFD , +0xFF , 0xFC , 0xFF , 0xFC , 0x50 , 0xFD , 0x50 , 0xFD , 0x45 , 0xFD , 0x45 , 0xFD , 0x9F , 0xFC , 0x9F , 0xFC , +0xD4 , 0xFD , 0xD4 , 0xFD , 0xAF , 0xFC , 0xAF , 0xFC , 0x6E , 0xFD , 0x6E , 0xFD , 0x28 , 0xFD , 0x28 , 0xFD , +0xFE , 0xFC , 0xFE , 0xFC , 0x32 , 0xFD , 0x32 , 0xFD , 0xC0 , 0xFC , 0xC0 , 0xFC , 0x57 , 0xFD , 0x57 , 0xFD , +0xC7 , 0xFC , 0xC7 , 0xFC , 0x43 , 0xFD , 0x43 , 0xFD , 0x29 , 0xFD , 0x29 , 0xFD , 0x04 , 0xFD , 0x04 , 0xFD , +0xAC , 0xFD , 0xAC , 0xFD , 0x09 , 0xFD , 0x09 , 0xFD , 0x13 , 0xFE , 0x13 , 0xFE , 0xB4 , 0xFD , 0xB4 , 0xFD , +0x5F , 0xFE , 0x5F , 0xFE , 0x42 , 0xFE , 0x42 , 0xFE , 0x43 , 0xFF , 0x43 , 0xFF , 0x32 , 0xFF , 0x32 , 0xFF , +0x0B , 0x00 , 0x0B , 0x00 , 0xBA , 0x00 , 0xBA , 0x00 , 0x98 , 0x00 , 0x98 , 0x00 , 0x91 , 0x02 , 0x91 , 0x02 , +0xEA , 0x01 , 0xEA , 0x01 , 0x09 , 0x04 , 0x09 , 0x04 , 0x84 , 0x04 , 0x84 , 0x04 , 0x64 , 0x05 , 0x64 , 0x05 , +0x62 , 0x06 , 0x62 , 0x06 , 0x05 , 0x07 , 0x05 , 0x07 , 0x49 , 0x07 , 0x49 , 0x07 , 0xE1 , 0x07 , 0xE1 , 0x07 , +0x9B , 0x07 , 0x9B , 0x07 , 0xB2 , 0x07 , 0xB2 , 0x07 , 0x3A , 0x07 , 0x3A , 0x07 , 0xC3 , 0x06 , 0xC3 , 0x06 , +0x22 , 0x06 , 0x22 , 0x06 , 0x4D , 0x05 , 0x4D , 0x05 , 0xA2 , 0x04 , 0xA2 , 0x04 , 0x77 , 0x03 , 0x77 , 0x03 , +0xA9 , 0x02 , 0xA9 , 0x02 , 0xAC , 0x01 , 0xAC , 0x01 , 0xD8 , 0x00 , 0xD8 , 0x00 , 0x6F , 0x00 , 0x6F , 0x00 , +0xA2 , 0xFF , 0xA2 , 0xFF , 0xB4 , 0xFE , 0xB4 , 0xFE , 0x8B , 0xFE , 0x8B , 0xFE , 0xB7 , 0xFD , 0xB7 , 0xFD , +0x0C , 0xFE , 0x0C , 0xFE , 0x9A , 0xFC , 0x9A , 0xFC , 0x6A , 0xFD , 0x6A , 0xFD , 0xEC , 0xFB , 0xEC , 0xFB , +0xD7 , 0xFC , 0xD7 , 0xFC , 0x31 , 0xFB , 0x31 , 0xFB , 0x2D , 0xFC , 0x2D , 0xFC , 0x11 , 0xFB , 0x11 , 0xFB , +0xBF , 0xFA , 0xBF , 0xFA , 0xFB , 0xFB , 0xFB , 0xFB , 0x8F , 0xF9 , 0x8F , 0xF9 , 0x25 , 0xFC , 0x25 , 0xFC , +0x64 , 0xFA , 0x64 , 0xFA , 0x5A , 0xFB , 0x5A , 0xFB , 0x48 , 0xFC , 0x48 , 0xFC , 0xF6 , 0xFA , 0xF6 , 0xFA , +0x64 , 0xFC , 0x64 , 0xFC , 0x09 , 0xFC , 0x09 , 0xFC , 0xF1 , 0xFB , 0xF1 , 0xFB , 0xAA , 0xFC , 0xAA , 0xFC , +0x75 , 0xFC , 0x75 , 0xFC , 0x44 , 0xFD , 0x44 , 0xFD , 0x46 , 0xFD , 0x46 , 0xFD , 0x02 , 0xFE , 0x02 , 0xFE , +0xF0 , 0xFD , 0xF0 , 0xFD , 0xAE , 0xFF , 0xAE , 0xFF , 0xCB , 0xFE , 0xCB , 0xFE , 0x22 , 0x01 , 0x22 , 0x01 , +0x3C , 0x00 , 0x3C , 0x00 , 0xDA , 0x01 , 0xDA , 0x01 , 0xC0 , 0x02 , 0xC0 , 0x02 , 0x6D , 0x02 , 0x6D , 0x02 , +0x75 , 0x05 , 0x75 , 0x05 , 0x3B , 0x04 , 0x3B , 0x04 , 0x33 , 0x07 , 0x33 , 0x07 , 0xF9 , 0x06 , 0xF9 , 0x06 , +0x1C , 0x08 , 0x1C , 0x08 , 0xAD , 0x08 , 0xAD , 0x08 , 0xB9 , 0x08 , 0xB9 , 0x08 , 0xB7 , 0x08 , 0xB7 , 0x08 , +0x6A , 0x08 , 0x6A , 0x08 , 0xD4 , 0x07 , 0xD4 , 0x07 , 0xA5 , 0x07 , 0xA5 , 0x07 , 0x1F , 0x06 , 0x1F , 0x06 , +0x13 , 0x06 , 0x13 , 0x06 , 0x74 , 0x04 , 0x74 , 0x04 , 0xBE , 0x03 , 0xBE , 0x03 , 0xB9 , 0x02 , 0xB9 , 0x02 , +0x7D , 0x01 , 0x7D , 0x01 , 0xB6 , 0x00 , 0xB6 , 0x00 , 0xB5 , 0xFF , 0xB5 , 0xFF , 0x2C , 0xFF , 0x2C , 0xFF , +0xDE , 0xFD , 0xDE , 0xFD , 0x24 , 0xFE , 0x24 , 0xFE , 0x52 , 0xFC , 0x52 , 0xFC , 0xE5 , 0xFC , 0xE5 , 0xFC , +0xCF , 0xFB , 0xCF , 0xFB , 0xE4 , 0xFB , 0xE4 , 0xFB , 0xB9 , 0xFA , 0xB9 , 0xFA , 0x81 , 0xFB , 0x81 , 0xFB , +0x76 , 0xF9 , 0x76 , 0xF9 , 0xE9 , 0xFA , 0xE9 , 0xFA , 0x33 , 0xF9 , 0x33 , 0xF9 , 0x2D , 0xFA , 0x2D , 0xFA , +0x75 , 0xF9 , 0x75 , 0xF9 , 0x19 , 0xFA , 0x19 , 0xFA , 0x22 , 0xFA , 0x22 , 0xFA , 0xCB , 0xF9 , 0xCB , 0xF9 , +0x62 , 0xFB , 0x62 , 0xFB , 0xBD , 0xF9 , 0xBD , 0xF9 , 0x28 , 0xFC , 0x28 , 0xFC , 0x51 , 0xFB , 0x51 , 0xFB , +0x64 , 0xFB , 0x64 , 0xFB , 0x97 , 0xFC , 0x97 , 0xFC , 0xA2 , 0xFC , 0xA2 , 0xFC , 0x4A , 0xFC , 0x4A , 0xFC , +0x05 , 0xFF , 0x05 , 0xFF , 0x9B , 0xFC , 0x9B , 0xFC , 0x39 , 0xFF , 0x39 , 0xFF , 0x45 , 0xFE , 0x45 , 0xFE , +0x9E , 0xFF , 0x9E , 0xFF , 0xBE , 0xFF , 0xBE , 0xFF , 0xDF , 0x00 , 0xDF , 0x00 , 0xFE , 0x00 , 0xFE , 0x00 , +0x50 , 0x02 , 0x50 , 0x02 , 0x71 , 0x03 , 0x71 , 0x03 , 0xF6 , 0x02 , 0xF6 , 0x02 , 0x57 , 0x06 , 0x57 , 0x06 , +0xBE , 0x04 , 0xBE , 0x04 , 0x8C , 0x07 , 0x8C , 0x07 , 0xD5 , 0x07 , 0xD5 , 0x07 , 0xDB , 0x07 , 0xDB , 0x07 , +0x0B , 0x09 , 0x0B , 0x09 , 0xD1 , 0x08 , 0xD1 , 0x08 , 0x27 , 0x08 , 0x27 , 0x08 , 0xA7 , 0x08 , 0xA7 , 0x08 , +0xF7 , 0x06 , 0xF7 , 0x06 , 0x83 , 0x07 , 0x83 , 0x07 , 0x4A , 0x05 , 0x4A , 0x05 , 0xD2 , 0x05 , 0xD2 , 0x05 , +0x6D , 0x03 , 0x6D , 0x03 , 0xC3 , 0x03 , 0xC3 , 0x03 , 0x21 , 0x01 , 0x21 , 0x01 , 0xC0 , 0x00 , 0xC0 , 0x00 , +0x95 , 0xFF , 0x95 , 0xFF , 0x4E , 0xFD , 0x4E , 0xFD , 0xFD , 0xFE , 0xFD , 0xFE , 0xAD , 0xFA , 0xAD , 0xFA , +0xAA , 0xFD , 0xAA , 0xFD , 0x2A , 0xFA , 0x2A , 0xFA , 0xCC , 0xFB , 0xCC , 0xFB , 0x79 , 0xFA , 0x79 , 0xFA , +0x21 , 0xFB , 0x21 , 0xFB , 0xD1 , 0xF9 , 0xD1 , 0xF9 , 0xA6 , 0xFA , 0xA6 , 0xFA , 0x32 , 0xFA , 0x32 , 0xFA , +0x51 , 0xF9 , 0x51 , 0xF9 , 0x21 , 0xFB , 0x21 , 0xFB , 0xCB , 0xF9 , 0xCB , 0xF9 , 0x57 , 0xFA , 0x57 , 0xFA , +0xF7 , 0xFA , 0xF7 , 0xFA , 0xB5 , 0xFA , 0xB5 , 0xFA , 0xB8 , 0xFA , 0xB8 , 0xFA , 0x67 , 0xFB , 0x67 , 0xFB , +0xE3 , 0xFA , 0xE3 , 0xFA , 0x27 , 0xFB , 0x27 , 0xFB , 0xF5 , 0xFB , 0xF5 , 0xFB , 0x54 , 0xFA , 0x54 , 0xFA , +0xE3 , 0xFB , 0xE3 , 0xFB , 0xF5 , 0xFB , 0xF5 , 0xFB , 0xDA , 0xFA , 0xDA , 0xFA , 0x2A , 0xFE , 0x2A , 0xFE , +0x3F , 0xFB , 0x3F , 0xFB , 0xE0 , 0xFD , 0xE0 , 0xFD , 0x34 , 0xFD , 0x34 , 0xFD , 0xF9 , 0xFD , 0xF9 , 0xFD , +0x9A , 0xFF , 0x9A , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0x77 , 0x01 , 0x77 , 0x01 , 0x63 , 0x03 , 0x63 , 0x03 , +0xFD , 0x03 , 0xFD , 0x03 , 0xE3 , 0x05 , 0xE3 , 0x05 , 0xFF , 0x07 , 0xFF , 0x07 , 0x2A , 0x08 , 0x2A , 0x08 , +0x20 , 0x0A , 0x20 , 0x0A , 0xFD , 0x0A , 0xFD , 0x0A , 0x7D , 0x0A , 0x7D , 0x0A , 0x9C , 0x0B , 0x9C , 0x0B , +0xB9 , 0x0A , 0xB9 , 0x0A , 0xD9 , 0x09 , 0xD9 , 0x09 , 0x85 , 0x09 , 0x85 , 0x09 , 0x99 , 0x07 , 0x99 , 0x07 , +0x33 , 0x07 , 0x33 , 0x07 , 0x2B , 0x05 , 0x2B , 0x05 , 0x43 , 0x04 , 0x43 , 0x04 , 0xE9 , 0x02 , 0xE9 , 0x02 , +0x57 , 0x01 , 0x57 , 0x01 , 0xDF , 0x00 , 0xDF , 0x00 , 0xFE , 0xFE , 0xFE , 0xFE , 0xB1 , 0xFF , 0xB1 , 0xFF , +0xD1 , 0xFD , 0xD1 , 0xFD , 0x5B , 0xFE , 0x5B , 0xFE , 0xDD , 0xFD , 0xDD , 0xFD , 0xAE , 0xFC , 0xAE , 0xFC , +0x76 , 0xFD , 0x76 , 0xFD , 0xA3 , 0xFB , 0xA3 , 0xFB , 0xB8 , 0xFC , 0xB8 , 0xFC , 0xCF , 0xFA , 0xCF , 0xFA , +0x78 , 0xFC , 0x78 , 0xFC , 0xB3 , 0xFA , 0xB3 , 0xFA , 0x8E , 0xF9 , 0x8E , 0xF9 , 0x17 , 0xFB , 0x17 , 0xFB , +0x50 , 0xF8 , 0x50 , 0xF8 , 0x06 , 0xF9 , 0x06 , 0xF9 , 0x8A , 0xF8 , 0x8A , 0xF8 , 0xE9 , 0xF7 , 0xE9 , 0xF7 , +0xE0 , 0xF7 , 0xE0 , 0xF7 , 0x8C , 0xF8 , 0x8C , 0xF8 , 0xE6 , 0xF6 , 0xE6 , 0xF6 , 0x8D , 0xF9 , 0x8D , 0xF9 , +0x71 , 0xF8 , 0x71 , 0xF8 , 0xE6 , 0xF8 , 0xE6 , 0xF8 , 0x6F , 0xFB , 0x6F , 0xFB , 0xA2 , 0xF9 , 0xA2 , 0xF9 , +0xBF , 0xFB , 0xBF , 0xFB , 0x6E , 0xFC , 0x6E , 0xFC , 0x1E , 0xFC , 0x1E , 0xFC , 0x33 , 0xFE , 0x33 , 0xFE , +0xA9 , 0xFF , 0xA9 , 0xFF , 0xA6 , 0xFF , 0xA6 , 0xFF , 0x43 , 0x03 , 0x43 , 0x03 , 0x67 , 0x03 , 0x67 , 0x03 , +0x3C , 0x05 , 0x3C , 0x05 , 0x49 , 0x07 , 0x49 , 0x07 , 0x3C , 0x08 , 0x3C , 0x08 , 0xDB , 0x09 , 0xDB , 0x09 , +0xE5 , 0x09 , 0xE5 , 0x09 , 0xA9 , 0x0B , 0xA9 , 0x0B , 0xD3 , 0x0A , 0xD3 , 0x0A , 0x56 , 0x0B , 0x56 , 0x0B , +0xA4 , 0x0B , 0xA4 , 0x0B , 0x66 , 0x0A , 0x66 , 0x0A , 0x57 , 0x0A , 0x57 , 0x0A , 0x42 , 0x09 , 0x42 , 0x09 , +0x1B , 0x08 , 0x1B , 0x08 , 0xFE , 0x06 , 0xFE , 0x06 , 0x99 , 0x05 , 0x99 , 0x05 , 0xA0 , 0x03 , 0xA0 , 0x03 , +0x91 , 0x02 , 0x91 , 0x02 , 0x53 , 0x00 , 0x53 , 0x00 , 0xB2 , 0xFF , 0xB2 , 0xFF , 0xD5 , 0xFD , 0xD5 , 0xFD , +0x5F , 0xFD , 0x5F , 0xFD , 0xBC , 0xFB , 0xBC , 0xFB , 0x03 , 0xFC , 0x03 , 0xFC , 0xF2 , 0xFA , 0xF2 , 0xFA , +0x9E , 0xFB , 0x9E , 0xFB , 0x1C , 0xFC , 0x1C , 0xFC , 0xF0 , 0xFB , 0xF0 , 0xFB , 0x96 , 0xFC , 0x96 , 0xFC , +0xB2 , 0xFB , 0xB2 , 0xFB , 0xEB , 0xFC , 0xEB , 0xFC , 0xC0 , 0xFA , 0xC0 , 0xFA , 0xC4 , 0xFB , 0xC4 , 0xFB , +0xE1 , 0xF9 , 0xE1 , 0xF9 , 0x2C , 0xFA , 0x2C , 0xFA , 0x2C , 0xFA , 0x2C , 0xFA , 0x62 , 0xF7 , 0x62 , 0xF7 , +0x6C , 0xF9 , 0x6C , 0xF9 , 0x75 , 0xF7 , 0x75 , 0xF7 , 0xB4 , 0xF6 , 0xB4 , 0xF6 , 0x4E , 0xF8 , 0x4E , 0xF8 , +0x7F , 0xF6 , 0x7F , 0xF6 , 0x48 , 0xF7 , 0x48 , 0xF7 , 0x92 , 0xF8 , 0x92 , 0xF8 , 0xAB , 0xF6 , 0xAB , 0xF6 , +0x68 , 0xF9 , 0x68 , 0xF9 , 0x67 , 0xF9 , 0x67 , 0xF9 , 0x30 , 0xFA , 0x30 , 0xFA , 0xB4 , 0xFD , 0xB4 , 0xFD , +0xE7 , 0xFD , 0xE7 , 0xFD , 0x52 , 0x01 , 0x52 , 0x01 , 0x15 , 0x04 , 0x15 , 0x04 , 0xE3 , 0x05 , 0xE3 , 0x05 , +0xC9 , 0x08 , 0xC9 , 0x08 , 0x7D , 0x0B , 0x7D , 0x0B , 0x65 , 0x0D , 0x65 , 0x0D , 0x59 , 0x0E , 0x59 , 0x0E , +0x77 , 0x10 , 0x77 , 0x10 , 0x45 , 0x10 , 0x45 , 0x10 , 0x36 , 0x10 , 0x36 , 0x10 , 0x41 , 0x10 , 0x41 , 0x10 , +0x17 , 0x0E , 0x17 , 0x0E , 0x82 , 0x0D , 0x82 , 0x0D , 0xAB , 0x0A , 0xAB , 0x0A , 0xFF , 0x08 , 0xFF , 0x08 , +0x6C , 0x06 , 0x6C , 0x06 , 0x22 , 0x04 , 0x22 , 0x04 , 0x22 , 0x01 , 0x22 , 0x01 , 0x87 , 0xFF , 0x87 , 0xFF , +0x7B , 0xFC , 0x7B , 0xFC , 0x60 , 0xFB , 0x60 , 0xFB , 0xC6 , 0xF9 , 0xC6 , 0xF9 , 0xDB , 0xF8 , 0xDB , 0xF8 , +0xED , 0xF7 , 0xED , 0xF7 , 0xEA , 0xF7 , 0xEA , 0xF7 , 0x49 , 0xF7 , 0x49 , 0xF7 , 0xC3 , 0xF7 , 0xC3 , 0xF7 , +0x67 , 0xF8 , 0x67 , 0xF8 , 0xE6 , 0xF8 , 0xE6 , 0xF8 , 0xFC , 0xF7 , 0xFC , 0xF7 , 0x84 , 0xF9 , 0x84 , 0xF9 , +0x09 , 0xF9 , 0x09 , 0xF9 , 0x2D , 0xF8 , 0x2D , 0xF8 , 0x53 , 0xFA , 0x53 , 0xFA , 0xA2 , 0xF7 , 0xA2 , 0xF7 , +0x0B , 0xF9 , 0x0B , 0xF9 , 0x3E , 0xF8 , 0x3E , 0xF8 , 0x23 , 0xF8 , 0x23 , 0xF8 , 0x0A , 0xF8 , 0x0A , 0xF8 , +0x5A , 0xF8 , 0x5A , 0xF8 , 0x30 , 0xF7 , 0x30 , 0xF7 , 0x7B , 0xF9 , 0x7B , 0xF9 , 0x12 , 0xF9 , 0x12 , 0xF9 , +0x93 , 0xF8 , 0x93 , 0xF8 , 0x98 , 0xFB , 0x98 , 0xFB , 0x15 , 0xFB , 0x15 , 0xFB , 0xE8 , 0xFB , 0xE8 , 0xFB , +0x0C , 0x00 , 0x0C , 0x00 , 0xF7 , 0xFE , 0xF7 , 0xFE , 0x94 , 0x03 , 0x94 , 0x03 , 0x13 , 0x06 , 0x13 , 0x06 , +0xC3 , 0x06 , 0xC3 , 0x06 , 0x7A , 0x0B , 0x7A , 0x0B , 0x7F , 0x0C , 0x7F , 0x0C , 0x7B , 0x0E , 0x7B , 0x0E , +0x7B , 0x11 , 0x7B , 0x11 , 0x16 , 0x12 , 0x16 , 0x12 , 0xB1 , 0x12 , 0xB1 , 0x12 , 0x88 , 0x14 , 0x88 , 0x14 , +0xD5 , 0x12 , 0xD5 , 0x12 , 0x5E , 0x12 , 0x5E , 0x12 , 0x02 , 0x11 , 0x02 , 0x11 , 0x44 , 0x0E , 0x44 , 0x0E , +0xDE , 0x0B , 0xDE , 0x0B , 0x3D , 0x09 , 0x3D , 0x09 , 0xDD , 0x05 , 0xDD , 0x05 , 0xD2 , 0x02 , 0xD2 , 0x02 , +0xDF , 0xFF , 0xDF , 0xFF , 0x30 , 0xFD , 0x30 , 0xFD , 0x75 , 0xFA , 0x75 , 0xFA , 0x6A , 0xF9 , 0x6A , 0xF9 , +0x6B , 0xF7 , 0x6B , 0xF7 , 0x1C , 0xF7 , 0x1C , 0xF7 , 0x2C , 0xF6 , 0x2C , 0xF6 , 0xB9 , 0xF6 , 0xB9 , 0xF6 , +0xFD , 0xF5 , 0xFD , 0xF5 , 0x64 , 0xF8 , 0x64 , 0xF8 , 0x42 , 0xF7 , 0x42 , 0xF7 , 0x7A , 0xF7 , 0x7A , 0xF7 , +0x64 , 0xFA , 0x64 , 0xFA , 0x7D , 0xF7 , 0x7D , 0xF7 , 0x75 , 0xF9 , 0x75 , 0xF9 , 0x78 , 0xF8 , 0x78 , 0xF8 , +0x0A , 0xF8 , 0x0A , 0xF8 , 0xD2 , 0xF6 , 0xD2 , 0xF6 , 0xDE , 0xF6 , 0xDE , 0xF6 , 0xC8 , 0xF5 , 0xC8 , 0xF5 , +0x4E , 0xF4 , 0x4E , 0xF4 , 0xFB , 0xF4 , 0xFB , 0xF4 , 0x58 , 0xF4 , 0x58 , 0xF4 , 0x76 , 0xF4 , 0x76 , 0xF4 , +0xED , 0xF4 , 0xED , 0xF4 , 0x7B , 0xF5 , 0x7B , 0xF5 , 0xDF , 0xF6 , 0xDF , 0xF6 , 0x6F , 0xF7 , 0x6F , 0xF7 , +0x93 , 0xFA , 0x93 , 0xFA , 0xA9 , 0xFB , 0xA9 , 0xFB , 0x18 , 0xFF , 0x18 , 0xFF , 0x09 , 0x03 , 0x09 , 0x03 , +0xEF , 0x04 , 0xEF , 0x04 , 0x8F , 0x09 , 0x8F , 0x09 , 0x47 , 0x0C , 0x47 , 0x0C , 0xE2 , 0x0E , 0xE2 , 0x0E , +0x6E , 0x12 , 0x6E , 0x12 , 0xAA , 0x14 , 0xAA , 0x14 , 0x33 , 0x15 , 0x33 , 0x15 , 0xC0 , 0x17 , 0xC0 , 0x17 , +0xF3 , 0x16 , 0xF3 , 0x16 , 0x02 , 0x16 , 0x02 , 0x16 , 0xD3 , 0x14 , 0xD3 , 0x14 , 0xFC , 0x11 , 0xFC , 0x11 , +0xE2 , 0x0E , 0xE2 , 0x0E , 0xA3 , 0x0B , 0xA3 , 0x0B , 0xCC , 0x07 , 0xCC , 0x07 , 0xD8 , 0x03 , 0xD8 , 0x03 , +0xFE , 0x00 , 0xFE , 0x00 , 0x83 , 0xFD , 0x83 , 0xFD , 0xFC , 0xF9 , 0xFC , 0xF9 , 0x5F , 0xF9 , 0x5F , 0xF9 , +0xF7 , 0xF6 , 0xF7 , 0xF6 , 0x79 , 0xF6 , 0x79 , 0xF6 , 0x72 , 0xF6 , 0x72 , 0xF6 , 0x47 , 0xF6 , 0x47 , 0xF6 , +0x8F , 0xF6 , 0x8F , 0xF6 , 0xF2 , 0xF7 , 0xF2 , 0xF7 , 0x14 , 0xF9 , 0x14 , 0xF9 , 0x0B , 0xF8 , 0x0B , 0xF8 , +0x60 , 0xFA , 0x60 , 0xFA , 0x78 , 0xF9 , 0x78 , 0xF9 , 0xCC , 0xF9 , 0xCC , 0xF9 , 0x03 , 0xF9 , 0x03 , 0xF9 , +0x18 , 0xF8 , 0x18 , 0xF8 , 0xA8 , 0xF8 , 0xA8 , 0xF8 , 0x5D , 0xF5 , 0x5D , 0xF5 , 0xED , 0xF4 , 0xED , 0xF4 , +0x77 , 0xF5 , 0x77 , 0xF5 , 0xCE , 0xF1 , 0xCE , 0xF1 , 0xE9 , 0xF1 , 0xE9 , 0xF1 , 0xF2 , 0xF2 , 0xF2 , 0xF2 , +0x30 , 0xF0 , 0x30 , 0xF0 , 0xDD , 0xEF , 0xDD , 0xEF , 0xC5 , 0xF3 , 0xC5 , 0xF3 , 0xF2 , 0xF1 , 0xF2 , 0xF1 , +0x78 , 0xF4 , 0x78 , 0xF4 , 0x54 , 0xF9 , 0x54 , 0xF9 , 0xDA , 0xF9 , 0xDA , 0xF9 , 0xB3 , 0xFF , 0xB3 , 0xFF , +0x24 , 0x04 , 0x24 , 0x04 , 0x77 , 0x07 , 0x77 , 0x07 , 0x9F , 0x0C , 0x9F , 0x0C , 0x82 , 0x10 , 0x82 , 0x10 , +0x70 , 0x13 , 0x70 , 0x13 , 0xED , 0x17 , 0xED , 0x17 , 0xD1 , 0x18 , 0xD1 , 0x18 , 0xA1 , 0x1A , 0xA1 , 0x1A , +0xBA , 0x1B , 0xBA , 0x1B , 0xF0 , 0x19 , 0xF0 , 0x19 , 0x74 , 0x17 , 0x74 , 0x17 , 0x6E , 0x15 , 0x6E , 0x15 , +0x87 , 0x10 , 0x87 , 0x10 , 0x89 , 0x0B , 0x89 , 0x0B , 0x86 , 0x08 , 0x86 , 0x08 , 0x78 , 0x02 , 0x78 , 0x02 , +0x4A , 0xFF , 0x4A , 0xFF , 0x24 , 0xFC , 0x24 , 0xFC , 0x2D , 0xF8 , 0x2D , 0xF8 , 0x8E , 0xF7 , 0x8E , 0xF7 , +0x3B , 0xF6 , 0x3B , 0xF6 , 0x0B , 0xF5 , 0x0B , 0xF5 , 0x00 , 0xF6 , 0x00 , 0xF6 , 0x88 , 0xF6 , 0x88 , 0xF6 , +0x7A , 0xF6 , 0x7A , 0xF6 , 0xB7 , 0xF9 , 0xB7 , 0xF9 , 0xCA , 0xF9 , 0xCA , 0xF9 , 0xD2 , 0xF9 , 0xD2 , 0xF9 , +0x61 , 0xFC , 0x61 , 0xFC , 0x70 , 0xFA , 0x70 , 0xFA , 0xF4 , 0xF9 , 0xF4 , 0xF9 , 0x47 , 0xF9 , 0x47 , 0xF9 , +0xE5 , 0xF7 , 0xE5 , 0xF7 , 0xDC , 0xF6 , 0xDC , 0xF6 , 0xD5 , 0xF3 , 0xD5 , 0xF3 , 0xF3 , 0xF2 , 0xF3 , 0xF2 , +0xED , 0xF2 , 0xED , 0xF2 , 0xAC , 0xEF , 0xAC , 0xEF , 0xF9 , 0xEF , 0xF9 , 0xEF , 0x5C , 0xF1 , 0x5C , 0xF1 , +0xA5 , 0xEE , 0xA5 , 0xEE , 0xE7 , 0xEF , 0xE7 , 0xEF , 0x52 , 0xF4 , 0x52 , 0xF4 , 0x85 , 0xF2 , 0x85 , 0xF2 , +0x65 , 0xF6 , 0x65 , 0xF6 , 0xEB , 0xFB , 0xEB , 0xFB , 0x4E , 0xFD , 0x4E , 0xFD , 0x3D , 0x03 , 0x3D , 0x03 , +0xD9 , 0x08 , 0xD9 , 0x08 , 0x94 , 0x0B , 0x94 , 0x0B , 0x5C , 0x11 , 0x5C , 0x11 , 0x6D , 0x16 , 0x6D , 0x16 , +0xF2 , 0x18 , 0xF2 , 0x18 , 0xCB , 0x1C , 0xCB , 0x1C , 0xB1 , 0x1E , 0xB1 , 0x1E , 0x24 , 0x1F , 0x24 , 0x1F , +0x06 , 0x1F , 0x06 , 0x1F , 0x20 , 0x1C , 0x20 , 0x1C , 0xEF , 0x18 , 0xEF , 0x18 , 0xB1 , 0x14 , 0xB1 , 0x14 , +0x51 , 0x0E , 0x51 , 0x0E , 0xC9 , 0x09 , 0xC9 , 0x09 , 0xB5 , 0x03 , 0xB5 , 0x03 , 0x8F , 0xFE , 0x8F , 0xFE , +0xD9 , 0xF9 , 0xD9 , 0xF9 , 0x48 , 0xF6 , 0x48 , 0xF6 , 0x07 , 0xF3 , 0x07 , 0xF3 , 0x2E , 0xF1 , 0x2E , 0xF1 , +0xE9 , 0xF0 , 0xE9 , 0xF0 , 0xB2 , 0xF0 , 0xB2 , 0xF0 , 0xB6 , 0xF1 , 0xB6 , 0xF1 , 0x91 , 0xF3 , 0x91 , 0xF3 , +0xA1 , 0xF6 , 0xA1 , 0xF6 , 0xE4 , 0xF7 , 0xE4 , 0xF7 , 0xB6 , 0xFA , 0xB6 , 0xFA , 0xEC , 0xFC , 0xEC , 0xFC , +0x4D , 0xFD , 0x4D , 0xFD , 0x6B , 0xFD , 0x6B , 0xFD , 0xFD , 0xFC , 0xFD , 0xFC , 0xE2 , 0xFB , 0xE2 , 0xFB , +0x0D , 0xF9 , 0x0D , 0xF9 , 0x50 , 0xF6 , 0x50 , 0xF6 , 0x10 , 0xF5 , 0x10 , 0xF5 , 0x2C , 0xF1 , 0x2C , 0xF1 , +0x23 , 0xEE , 0x23 , 0xEE , 0xB9 , 0xED , 0xB9 , 0xED , 0x89 , 0xEB , 0x89 , 0xEB , 0x56 , 0xEA , 0x56 , 0xEA , +0xBC , 0xEA , 0xBC , 0xEA , 0x7F , 0xEC , 0x7F , 0xEC , 0x04 , 0xED , 0x04 , 0xED , 0x9C , 0xF0 , 0x9C , 0xF0 , +0xB1 , 0xF7 , 0xB1 , 0xF7 , 0x42 , 0xFD , 0x42 , 0xFD , 0x7A , 0x01 , 0x7A , 0x01 , 0xEB , 0x0A , 0xEB , 0x0A , +0xA2 , 0x12 , 0xA2 , 0x12 , 0x39 , 0x15 , 0x39 , 0x15 , 0xC0 , 0x1C , 0xC0 , 0x1C , 0xB6 , 0x22 , 0xB6 , 0x22 , +0x80 , 0x22 , 0x80 , 0x22 , 0xFD , 0x24 , 0xFD , 0x24 , 0x14 , 0x27 , 0x14 , 0x27 , 0x29 , 0x22 , 0x29 , 0x22 , +0x6A , 0x1E , 0x6A , 0x1E , 0x34 , 0x1B , 0x34 , 0x1B , 0x1F , 0x13 , 0x1F , 0x13 , 0x0D , 0x0C , 0x0D , 0x0C , +0xF2 , 0x06 , 0xF2 , 0x06 , 0x05 , 0xFF , 0x05 , 0xFF , 0xCB , 0xF8 , 0xCB , 0xF8 , 0xB4 , 0xF4 , 0xB4 , 0xF4 , +0x30 , 0xF1 , 0x30 , 0xF1 , 0xDE , 0xED , 0xDE , 0xED , 0xEA , 0xED , 0xEA , 0xED , 0xD3 , 0xEE , 0xD3 , 0xEE , +0xA1 , 0xEF , 0xA1 , 0xEF , 0x2D , 0xF2 , 0x2D , 0xF2 , 0xBD , 0xF5 , 0xBD , 0xF5 , 0x21 , 0xF9 , 0x21 , 0xF9 , +0x55 , 0xFB , 0x55 , 0xFB , 0x7C , 0xFF , 0x7C , 0xFF , 0x3B , 0x01 , 0x3B , 0x01 , 0x49 , 0x02 , 0x49 , 0x02 , +0x49 , 0x02 , 0x49 , 0x02 , 0x29 , 0x01 , 0x29 , 0x01 , 0xA3 , 0xFF , 0xA3 , 0xFF , 0xEA , 0xFB , 0xEA , 0xFB , +0x3D , 0xF8 , 0x3D , 0xF8 , 0xAF , 0xF6 , 0xAF , 0xF6 , 0x36 , 0xF1 , 0x36 , 0xF1 , 0xC4 , 0xED , 0xC4 , 0xED , +0x2D , 0xED , 0x2D , 0xED , 0xFB , 0xE9 , 0xFB , 0xE9 , 0x03 , 0xE9 , 0x03 , 0xE9 , 0x85 , 0xE9 , 0x85 , 0xE9 , +0x22 , 0xEB , 0x22 , 0xEB , 0xC5 , 0xEB , 0xC5 , 0xEB , 0x4E , 0xEF , 0x4E , 0xEF , 0x0A , 0xF7 , 0x0A , 0xF7 , +0x99 , 0xFC , 0x99 , 0xFC , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xB0 , 0x0A , 0xB0 , 0x0A , 0x6F , 0x12 , 0x6F , 0x12 , +0x78 , 0x13 , 0x78 , 0x13 , 0xED , 0x1B , 0xED , 0x1B , 0x94 , 0x22 , 0x94 , 0x22 , 0x71 , 0x20 , 0x71 , 0x20 , +0xFA , 0x23 , 0xFA , 0x23 , 0x94 , 0x26 , 0x94 , 0x26 , 0x7B , 0x20 , 0x7B , 0x20 , 0x0E , 0x1D , 0x0E , 0x1D , +0x00 , 0x1B , 0x00 , 0x1B , 0x12 , 0x12 , 0x12 , 0x12 , 0x42 , 0x0B , 0x42 , 0x0B , 0x41 , 0x07 , 0x41 , 0x07 , +0xC4 , 0xFE , 0xC4 , 0xFE , 0x67 , 0xF8 , 0x67 , 0xF8 , 0x8F , 0xF5 , 0x8F , 0xF5 , 0xD4 , 0xF1 , 0xD4 , 0xF1 , +0x78 , 0xEE , 0x78 , 0xEE , 0x47 , 0xEF , 0x47 , 0xEF , 0x91 , 0xF0 , 0x91 , 0xF0 , 0x69 , 0xF0 , 0x69 , 0xF0 , +0x29 , 0xF3 , 0x29 , 0xF3 , 0x42 , 0xF7 , 0x42 , 0xF7 , 0x7B , 0xF9 , 0x7B , 0xF9 , 0xD1 , 0xFB , 0xD1 , 0xFB , +0x26 , 0x00 , 0x26 , 0x00 , 0xC8 , 0x01 , 0xC8 , 0x01 , 0x97 , 0x01 , 0x97 , 0x01 , 0x05 , 0x03 , 0x05 , 0x03 , +0xEE , 0x00 , 0xEE , 0x00 , 0x7B , 0xFE , 0x7B , 0xFE , 0xE8 , 0xFB , 0xE8 , 0xFB , 0x55 , 0xF7 , 0x55 , 0xF7 , +0xD7 , 0xF4 , 0xD7 , 0xF4 , 0x18 , 0xF1 , 0x18 , 0xF1 , 0x82 , 0xEC , 0x82 , 0xEC , 0xC8 , 0xEB , 0xC8 , 0xEB , +0x95 , 0xE9 , 0x95 , 0xE9 , 0xA2 , 0xE8 , 0xA2 , 0xE8 , 0x13 , 0xE9 , 0x13 , 0xE9 , 0xD1 , 0xEA , 0xD1 , 0xEA , +0xBD , 0xEC , 0xBD , 0xEC , 0xF1 , 0xEE , 0xF1 , 0xEE , 0x49 , 0xF6 , 0x49 , 0xF6 , 0x45 , 0xFE , 0x45 , 0xFE , +0xB8 , 0x00 , 0xB8 , 0x00 , 0x4E , 0x09 , 0x4E , 0x09 , 0x3B , 0x14 , 0x3B , 0x14 , 0xC5 , 0x14 , 0xC5 , 0x14 , +0x2E , 0x1A , 0x2E , 0x1A , 0xDB , 0x23 , 0xDB , 0x23 , 0xE1 , 0x21 , 0xE1 , 0x21 , 0x74 , 0x22 , 0x74 , 0x22 , +0x6B , 0x27 , 0x6B , 0x27 , 0xFC , 0x21 , 0xFC , 0x21 , 0x58 , 0x1C , 0x58 , 0x1C , 0x69 , 0x1B , 0x69 , 0x1B , +0xAE , 0x13 , 0xAE , 0x13 , 0xBD , 0x0A , 0xBD , 0x0A , 0x9E , 0x07 , 0x9E , 0x07 , 0x44 , 0x00 , 0x44 , 0x00 , +0x1E , 0xF8 , 0x1E , 0xF8 , 0x96 , 0xF5 , 0x96 , 0xF5 , 0xA9 , 0xF2 , 0xA9 , 0xF2 , 0x43 , 0xEE , 0x43 , 0xEE , +0x51 , 0xEE , 0x51 , 0xEE , 0x35 , 0xF0 , 0x35 , 0xF0 , 0xA3 , 0xF0 , 0xA3 , 0xF0 , 0x1B , 0xF2 , 0x1B , 0xF2 , +0x80 , 0xF6 , 0x80 , 0xF6 , 0x05 , 0xFA , 0x05 , 0xFA , 0x68 , 0xFB , 0x68 , 0xFB , 0xF0 , 0xFE , 0xF0 , 0xFE , +0xCF , 0x02 , 0xCF , 0x02 , 0xAB , 0x01 , 0xAB , 0x01 , 0x72 , 0x02 , 0x72 , 0x02 , 0x94 , 0x02 , 0x94 , 0x02 , +0x2C , 0xFF , 0x2C , 0xFF , 0xB6 , 0xFC , 0xB6 , 0xFC , 0x5B , 0xF9 , 0x5B , 0xF9 , 0x80 , 0xF5 , 0x80 , 0xF5 , +0xDE , 0xF2 , 0xDE , 0xF2 , 0x7A , 0xEE , 0x7A , 0xEE , 0x08 , 0xED , 0x08 , 0xED , 0xFD , 0xEA , 0xFD , 0xEA , +0x30 , 0xE9 , 0x30 , 0xE9 , 0xE0 , 0xE9 , 0xE0 , 0xE9 , 0xD4 , 0xEA , 0xD4 , 0xEA , 0x26 , 0xEC , 0x26 , 0xEC , +0x95 , 0xEE , 0x95 , 0xEE , 0x4E , 0xF3 , 0x4E , 0xF3 , 0x6B , 0xFB , 0x6B , 0xFB , 0x18 , 0x00 , 0x18 , 0x00 , +0x10 , 0x05 , 0x10 , 0x05 , 0x91 , 0x10 , 0x91 , 0x10 , 0xF3 , 0x14 , 0xF3 , 0x14 , 0xF3 , 0x16 , 0xF3 , 0x16 , +0x7F , 0x20 , 0x7F , 0x20 , 0x6B , 0x23 , 0x6B , 0x23 , 0xFA , 0x1F , 0xFA , 0x1F , 0xFE , 0x25 , 0xFE , 0x25 , +0x17 , 0x25 , 0x17 , 0x25 , 0xD1 , 0x1D , 0xD1 , 0x1D , 0x6E , 0x1C , 0x6E , 0x1C , 0xF2 , 0x18 , 0xF2 , 0x18 , +0x6A , 0x0E , 0x6A , 0x0E , 0xB1 , 0x09 , 0xB1 , 0x09 , 0x74 , 0x05 , 0x74 , 0x05 , 0xE3 , 0xFC , 0xE3 , 0xFC , +0xD4 , 0xF7 , 0xD4 , 0xF7 , 0x19 , 0xF6 , 0x19 , 0xF6 , 0xAF , 0xF1 , 0xAF , 0xF1 , 0x0F , 0xF0 , 0x0F , 0xF0 , +0xEF , 0xF0 , 0xEF , 0xF0 , 0x3A , 0xF1 , 0x3A , 0xF1 , 0x4C , 0xF3 , 0x4C , 0xF3 , 0x1F , 0xF6 , 0x1F , 0xF6 , +0x87 , 0xF8 , 0x87 , 0xF8 , 0x28 , 0xFC , 0x28 , 0xFC , 0xF6 , 0xFE , 0xF6 , 0xFE , 0x14 , 0x00 , 0x14 , 0x00 , +0x7A , 0x03 , 0x7A , 0x03 , 0x73 , 0x03 , 0x73 , 0x03 , 0x80 , 0x02 , 0x80 , 0x02 , 0xB4 , 0x02 , 0xB4 , 0x02 , +0x39 , 0x00 , 0x39 , 0x00 , 0xB9 , 0xFC , 0xB9 , 0xFC , 0x9E , 0xFA , 0x9E , 0xFA , 0x29 , 0xF6 , 0x29 , 0xF6 , +0x6E , 0xF3 , 0x6E , 0xF3 , 0x21 , 0xF0 , 0x21 , 0xF0 , 0x28 , 0xEE , 0x28 , 0xEE , 0x18 , 0xEC , 0x18 , 0xEC , +0x38 , 0xEB , 0x38 , 0xEB , 0x73 , 0xEB , 0x73 , 0xEB , 0x90 , 0xEC , 0x90 , 0xEC , 0x21 , 0xEE , 0x21 , 0xEE , +0xCD , 0xF0 , 0xCD , 0xF0 , 0x5C , 0xF3 , 0x5C , 0xF3 , 0x1B , 0xFB , 0x1B , 0xFB , 0x25 , 0x00 , 0x25 , 0x00 , +0xFD , 0x02 , 0xFD , 0x02 , 0xE8 , 0x0C , 0xE8 , 0x0C , 0xDB , 0x11 , 0xDB , 0x11 , 0x18 , 0x13 , 0x18 , 0x13 , +0xE3 , 0x1A , 0xE3 , 0x1A , 0xC2 , 0x1E , 0xC2 , 0x1E , 0x3F , 0x1B , 0x3F , 0x1B , 0x48 , 0x20 , 0x48 , 0x20 , +0xB6 , 0x1F , 0xB6 , 0x1F , 0x1E , 0x19 , 0x1E , 0x19 , 0x5F , 0x17 , 0x5F , 0x17 , 0x50 , 0x14 , 0x50 , 0x14 , +0x60 , 0x0A , 0x60 , 0x0A , 0x2C , 0x06 , 0x2C , 0x06 , 0x0E , 0x02 , 0x0E , 0x02 , 0x1C , 0xFA , 0x1C , 0xFA , +0xEB , 0xF5 , 0xEB , 0xF5 , 0xCE , 0xF4 , 0xCE , 0xF4 , 0x6B , 0xF0 , 0x6B , 0xF0 , 0x67 , 0xEF , 0x67 , 0xEF , +0x41 , 0xF1 , 0x41 , 0xF1 , 0x49 , 0xF1 , 0x49 , 0xF1 , 0x15 , 0xF3 , 0x15 , 0xF3 , 0xC7 , 0xF6 , 0xC7 , 0xF6 , +0x29 , 0xFA , 0x29 , 0xFA , 0x33 , 0xFC , 0x33 , 0xFC , 0xB5 , 0xFF , 0xB5 , 0xFF , 0xFB , 0x01 , 0xFB , 0x01 , +0xE5 , 0x03 , 0xE5 , 0x03 , 0x82 , 0x03 , 0x82 , 0x03 , 0xF8 , 0x03 , 0xF8 , 0x03 , 0xDD , 0x02 , 0xDD , 0x02 , +0xCE , 0xFF , 0xCE , 0xFF , 0x3F , 0xFD , 0x3F , 0xFD , 0x69 , 0xFA , 0x69 , 0xFA , 0x57 , 0xF5 , 0x57 , 0xF5 , +0xFB , 0xF2 , 0xFB , 0xF2 , 0x6F , 0xEF , 0x6F , 0xEF , 0x8E , 0xEC , 0x8E , 0xEC , 0x8D , 0xEA , 0x8D , 0xEA , +0x05 , 0xE9 , 0x05 , 0xE9 , 0x75 , 0xE9 , 0x75 , 0xE9 , 0x34 , 0xEA , 0x34 , 0xEA , 0x93 , 0xEB , 0x93 , 0xEB , +0x0D , 0xEF , 0x0D , 0xEF , 0x1D , 0xF1 , 0x1D , 0xF1 , 0xF0 , 0xF5 , 0xF0 , 0xF5 , 0x59 , 0xFF , 0x59 , 0xFF , +0x0A , 0x01 , 0x0A , 0x01 , 0xC7 , 0x07 , 0xC7 , 0x07 , 0x83 , 0x11 , 0x83 , 0x11 , 0xB3 , 0x12 , 0xB3 , 0x12 , +0x02 , 0x16 , 0x02 , 0x16 , 0x27 , 0x1F , 0x27 , 0x1F , 0xD6 , 0x1C , 0xD6 , 0x1C , 0x96 , 0x1C , 0x96 , 0x1C , +0x82 , 0x21 , 0x82 , 0x21 , 0x46 , 0x1C , 0x46 , 0x1C , 0x0B , 0x17 , 0x0B , 0x17 , 0x1C , 0x17 , 0x1C , 0x17 , +0xCB , 0x0F , 0xCB , 0x0F , 0x94 , 0x07 , 0x94 , 0x07 , 0xC1 , 0x05 , 0xC1 , 0x05 , 0x2A , 0xFF , 0x2A , 0xFF , +0x30 , 0xF8 , 0x30 , 0xF8 , 0x1E , 0xF7 , 0x1E , 0xF7 , 0x93 , 0xF4 , 0x93 , 0xF4 , 0x69 , 0xF0 , 0x69 , 0xF0 , +0x5D , 0xF2 , 0x5D , 0xF2 , 0x2C , 0xF3 , 0x2C , 0xF3 , 0x09 , 0xF3 , 0x09 , 0xF3 , 0xD6 , 0xF5 , 0xD6 , 0xF5 , +0x3C , 0xFA , 0x3C , 0xFA , 0xF7 , 0xFB , 0xF7 , 0xFB , 0x39 , 0xFE , 0x39 , 0xFE , 0xEA , 0x01 , 0xEA , 0x01 , +0x8B , 0x03 , 0x8B , 0x03 , 0xC0 , 0x03 , 0xC0 , 0x03 , 0xE9 , 0x03 , 0xE9 , 0x03 , 0x12 , 0x04 , 0x12 , 0x04 , +0xAE , 0x01 , 0xAE , 0x01 , 0x83 , 0xFE , 0x83 , 0xFE , 0xFB , 0xFC , 0xFB , 0xFC , 0x9C , 0xF9 , 0x9C , 0xF9 , +0x94 , 0xF4 , 0x94 , 0xF4 , 0xC3 , 0xF3 , 0xC3 , 0xF3 , 0xB2 , 0xF0 , 0xB2 , 0xF0 , 0x9F , 0xED , 0x9F , 0xED , +0x91 , 0xED , 0x91 , 0xED , 0xE6 , 0xEC , 0xE6 , 0xEC , 0x94 , 0xEC , 0x94 , 0xEC , 0xC9 , 0xEE , 0xC9 , 0xEE , +0xAC , 0xF0 , 0xAC , 0xF0 , 0x7F , 0xF2 , 0x7F , 0xF2 , 0x37 , 0xF5 , 0x37 , 0xF5 , 0x7D , 0xF9 , 0x7D , 0xF9 , +0xBD , 0x00 , 0xBD , 0x00 , 0x28 , 0x02 , 0x28 , 0x02 , 0xD7 , 0x07 , 0xD7 , 0x07 , 0xD7 , 0x0F , 0xD7 , 0x0F , +0x4E , 0x10 , 0x4E , 0x10 , 0xD6 , 0x12 , 0xD6 , 0x12 , 0xD3 , 0x1A , 0xD3 , 0x1A , 0x8A , 0x18 , 0x8A , 0x18 , +0xBF , 0x17 , 0xBF , 0x17 , 0x32 , 0x1D , 0x32 , 0x1D , 0x72 , 0x18 , 0x72 , 0x18 , 0xD8 , 0x13 , 0xD8 , 0x13 , +0x01 , 0x15 , 0x01 , 0x15 , 0xA5 , 0x0E , 0xA5 , 0x0E , 0x48 , 0x07 , 0x48 , 0x07 , 0xA3 , 0x06 , 0xA3 , 0x06 , +0xE2 , 0x00 , 0xE2 , 0x00 , 0x52 , 0xFA , 0x52 , 0xFA , 0x12 , 0xFA , 0x12 , 0xFA , 0xCE , 0xF7 , 0xCE , 0xF7 , +0xA9 , 0xF3 , 0xA9 , 0xF3 , 0x90 , 0xF5 , 0x90 , 0xF5 , 0x5E , 0xF6 , 0x5E , 0xF6 , 0xA5 , 0xF5 , 0xA5 , 0xF5 , +0xF4 , 0xF7 , 0xF4 , 0xF7 , 0xF2 , 0xFA , 0xF2 , 0xFA , 0x9B , 0xFC , 0x9B , 0xFC , 0xB1 , 0xFE , 0xB1 , 0xFE , +0x6A , 0x00 , 0x6A , 0x00 , 0x49 , 0x02 , 0x49 , 0x02 , 0x34 , 0x02 , 0x34 , 0x02 , 0xF8 , 0x01 , 0xF8 , 0x01 , +0xB1 , 0x01 , 0xB1 , 0x01 , 0x95 , 0x00 , 0x95 , 0x00 , 0xE5 , 0xFD , 0xE5 , 0xFD , 0xEB , 0xFB , 0xEB , 0xFB , +0xA1 , 0xFA , 0xA1 , 0xFA , 0xF8 , 0xF6 , 0xF8 , 0xF6 , 0xB5 , 0xF4 , 0xB5 , 0xF4 , 0x23 , 0xF4 , 0x23 , 0xF4 , +0x35 , 0xF1 , 0x35 , 0xF1 , 0xAC , 0xF0 , 0xAC , 0xF0 , 0x5B , 0xF1 , 0x5B , 0xF1 , 0xE4 , 0xF0 , 0xE4 , 0xF0 , +0xA8 , 0xF1 , 0xA8 , 0xF1 , 0x19 , 0xF4 , 0x19 , 0xF4 , 0x30 , 0xF5 , 0x30 , 0xF5 , 0xB0 , 0xF6 , 0xB0 , 0xF6 , +0xB3 , 0xF8 , 0xB3 , 0xF8 , 0x78 , 0xFD , 0x78 , 0xFD , 0x26 , 0x02 , 0x26 , 0x02 , 0x00 , 0x02 , 0x00 , 0x02 , +0xCD , 0x08 , 0xCD , 0x08 , 0xEB , 0x0D , 0xEB , 0x0D , 0xA4 , 0x0C , 0xA4 , 0x0C , 0x3D , 0x11 , 0x3D , 0x11 , +0x36 , 0x17 , 0x36 , 0x17 , 0x04 , 0x13 , 0x04 , 0x13 , 0xE0 , 0x15 , 0xE0 , 0x15 , 0xD2 , 0x19 , 0xD2 , 0x19 , +0x87 , 0x13 , 0x87 , 0x13 , 0x1D , 0x12 , 0x1D , 0x12 , 0xE7 , 0x12 , 0xE7 , 0x12 , 0x45 , 0x0B , 0x45 , 0x0B , +0xF6 , 0x06 , 0xF6 , 0x06 , 0xF7 , 0x05 , 0xF7 , 0x05 , 0xF7 , 0xFF , 0xF7 , 0xFF , 0x1C , 0xFC , 0x1C , 0xFC , +0x13 , 0xFB , 0x13 , 0xFB , 0xC8 , 0xF8 , 0xC8 , 0xF8 , 0xAA , 0xF6 , 0xAA , 0xF6 , 0x3C , 0xF7 , 0x3C , 0xF7 , +0x6E , 0xF7 , 0x6E , 0xF7 , 0x5A , 0xF8 , 0x5A , 0xF8 , 0x07 , 0xF9 , 0x07 , 0xF9 , 0xAA , 0xFA , 0xAA , 0xFA , +0x54 , 0xFD , 0x54 , 0xFD , 0x10 , 0xFF , 0x10 , 0xFF , 0x72 , 0xFF , 0x72 , 0xFF , 0xF5 , 0x01 , 0xF5 , 0x01 , +0x1A , 0x02 , 0x1A , 0x02 , 0x33 , 0x01 , 0x33 , 0x01 , 0xC8 , 0x01 , 0xC8 , 0x01 , 0xBF , 0x00 , 0xBF , 0x00 , +0xCD , 0xFE , 0xCD , 0xFE , 0x2E , 0xFD , 0x2E , 0xFD , 0x8E , 0xFB , 0x8E , 0xFB , 0x31 , 0xF9 , 0x31 , 0xF9 , +0xE2 , 0xF6 , 0xE2 , 0xF6 , 0x68 , 0xF5 , 0x68 , 0xF5 , 0xC4 , 0xF3 , 0xC4 , 0xF3 , 0xE5 , 0xF2 , 0xE5 , 0xF2 , +0xDF , 0xF2 , 0xDF , 0xF2 , 0xC2 , 0xF2 , 0xC2 , 0xF2 , 0x54 , 0xF3 , 0x54 , 0xF3 , 0x69 , 0xF4 , 0x69 , 0xF4 , +0x41 , 0xF5 , 0x41 , 0xF5 , 0x68 , 0xF6 , 0x68 , 0xF6 , 0x4E , 0xF7 , 0x4E , 0xF7 , 0x2C , 0xF9 , 0x2C , 0xF9 , +0x9E , 0x00 , 0x9E , 0x00 , 0xC8 , 0xFF , 0xC8 , 0xFF , 0x7D , 0x02 , 0x7D , 0x02 , 0xB6 , 0x0B , 0xB6 , 0x0B , +0x54 , 0x0B , 0x54 , 0x0B , 0x96 , 0x0B , 0x96 , 0x0B , 0x78 , 0x15 , 0x78 , 0x15 , 0x95 , 0x14 , 0x95 , 0x14 , +0xBB , 0x11 , 0xBB , 0x11 , 0xD0 , 0x19 , 0xD0 , 0x19 , 0xF7 , 0x16 , 0xF7 , 0x16 , 0x34 , 0x11 , 0x34 , 0x11 , +0x4D , 0x13 , 0x4D , 0x13 , 0x00 , 0x10 , 0x00 , 0x10 , 0x10 , 0x08 , 0x10 , 0x08 , 0x2D , 0x07 , 0x2D , 0x07 , +0xB2 , 0x03 , 0xB2 , 0x03 , 0xAB , 0xFD , 0xAB , 0xFD , 0x92 , 0xFB , 0x92 , 0xFB , 0xEB , 0xFA , 0xEB , 0xFA , +0xED , 0xF7 , 0xED , 0xF7 , 0x3B , 0xF7 , 0x3B , 0xF7 , 0x8C , 0xF8 , 0x8C , 0xF8 , 0x6B , 0xF8 , 0x6B , 0xF8 , +0x87 , 0xF8 , 0x87 , 0xF8 , 0x32 , 0xFA , 0x32 , 0xFA , 0x2A , 0xFC , 0x2A , 0xFC , 0xBE , 0xFC , 0xBE , 0xFC , +0x2C , 0xFE , 0x2C , 0xFE , 0x53 , 0xFF , 0x53 , 0xFF , 0xA8 , 0xFF , 0xA8 , 0xFF , 0xF4 , 0xFE , 0xF4 , 0xFE , +0x26 , 0x00 , 0x26 , 0x00 , 0xDB , 0xFE , 0xDB , 0xFE , 0x9B , 0xFD , 0x9B , 0xFD , 0xDE , 0xFC , 0xDE , 0xFC , +0x64 , 0xFB , 0x64 , 0xFB , 0x2A , 0xF9 , 0x2A , 0xF9 , 0x20 , 0xF8 , 0x20 , 0xF8 , 0x5C , 0xF6 , 0x5C , 0xF6 , +0x4D , 0xF4 , 0x4D , 0xF4 , 0xEE , 0xF3 , 0xEE , 0xF3 , 0xF3 , 0xF3 , 0xF3 , 0xF3 , 0x99 , 0xF2 , 0x99 , 0xF2 , +0xD4 , 0xF2 , 0xD4 , 0xF2 , 0x30 , 0xF4 , 0x30 , 0xF4 , 0xA5 , 0xF3 , 0xA5 , 0xF3 , 0xD1 , 0xF3 , 0xD1 , 0xF3 , +0xCF , 0xF5 , 0xCF , 0xF5 , 0x5F , 0xF5 , 0x5F , 0xF5 , 0x41 , 0xF9 , 0x41 , 0xF9 , 0xE4 , 0xFF , 0xE4 , 0xFF , +0x74 , 0xFD , 0x74 , 0xFD , 0xE0 , 0x04 , 0xE0 , 0x04 , 0x49 , 0x0C , 0x49 , 0x0C , 0x7B , 0x0A , 0x7B , 0x0A , +0x37 , 0x0F , 0x37 , 0x0F , 0xAC , 0x18 , 0xAC , 0x18 , 0x03 , 0x14 , 0x03 , 0x14 , 0x4F , 0x16 , 0x4F , 0x16 , +0x69 , 0x1C , 0x69 , 0x1C , 0x76 , 0x16 , 0x76 , 0x16 , 0x04 , 0x13 , 0x04 , 0x13 , 0x33 , 0x14 , 0x33 , 0x14 , +0x84 , 0x0D , 0x84 , 0x0D , 0x13 , 0x07 , 0x13 , 0x07 , 0x1A , 0x06 , 0x1A , 0x06 , 0x64 , 0x00 , 0x64 , 0x00 , +0xED , 0xFB , 0xED , 0xFB , 0x71 , 0xFA , 0x71 , 0xFA , 0x85 , 0xF9 , 0x85 , 0xF9 , 0xDC , 0xF7 , 0xDC , 0xF7 , +0x1B , 0xF9 , 0x1B , 0xF9 , 0x15 , 0xFA , 0x15 , 0xFA , 0x90 , 0xFB , 0x90 , 0xFB , 0x49 , 0xFC , 0x49 , 0xFC , +0xF7 , 0xFE , 0xF7 , 0xFE , 0x97 , 0x00 , 0x97 , 0x00 , 0x53 , 0x01 , 0x53 , 0x01 , 0x1E , 0x02 , 0x1E , 0x02 , +0xEB , 0x02 , 0xEB , 0x02 , 0x23 , 0x01 , 0x23 , 0x01 , 0x99 , 0x00 , 0x99 , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , +0xA1 , 0xFD , 0xA1 , 0xFD , 0x3A , 0xFC , 0x3A , 0xFC , 0x9F , 0xFA , 0x9F , 0xFA , 0x9C , 0xF8 , 0x9C , 0xF8 , +0x97 , 0xF6 , 0x97 , 0xF6 , 0x79 , 0xF5 , 0x79 , 0xF5 , 0xAE , 0xF3 , 0xAE , 0xF3 , 0xF9 , 0xF1 , 0xF9 , 0xF1 , +0x8D , 0xF1 , 0x8D , 0xF1 , 0x19 , 0xF2 , 0x19 , 0xF2 , 0xB2 , 0xF0 , 0xB2 , 0xF0 , 0x1C , 0xF1 , 0x1C , 0xF1 , +0x3A , 0xF2 , 0x3A , 0xF2 , 0x4D , 0xF2 , 0x4D , 0xF2 , 0x06 , 0xF2 , 0x06 , 0xF2 , 0x84 , 0xF4 , 0x84 , 0xF4 , +0x26 , 0xF6 , 0x26 , 0xF6 , 0x38 , 0xFE , 0x38 , 0xFE , 0xDA , 0xFF , 0xDA , 0xFF , 0x05 , 0x03 , 0x05 , 0x03 , +0x03 , 0x0E , 0x03 , 0x0E , 0x5B , 0x10 , 0x5B , 0x10 , 0xD6 , 0x10 , 0xD6 , 0x10 , 0xE6 , 0x19 , 0xE6 , 0x19 , +0x77 , 0x1B , 0x77 , 0x1B , 0x12 , 0x17 , 0x12 , 0x17 , 0x1A , 0x1C , 0x1A , 0x1C , 0xBF , 0x18 , 0xBF , 0x18 , +0xC9 , 0x11 , 0xC9 , 0x11 , 0x0E , 0x0F , 0x0E , 0x0F , 0xB9 , 0x0A , 0xB9 , 0x0A , 0x0B , 0x03 , 0x0B , 0x03 , +0xA0 , 0x00 , 0xA0 , 0x00 , 0xA7 , 0xFC , 0xA7 , 0xFC , 0x1A , 0xF9 , 0x1A , 0xF9 , 0x76 , 0xF8 , 0x76 , 0xF8 , +0x91 , 0xF9 , 0x91 , 0xF9 , 0x4F , 0xF9 , 0x4F , 0xF9 , 0x11 , 0xFC , 0x11 , 0xFC , 0xEA , 0xFE , 0xEA , 0xFE , +0xFC , 0xFF , 0xFC , 0xFF , 0x7B , 0x02 , 0x7B , 0x02 , 0x57 , 0x05 , 0x57 , 0x05 , 0x9F , 0x05 , 0x9F , 0x05 , +0xEE , 0x05 , 0xEE , 0x05 , 0x46 , 0x06 , 0x46 , 0x06 , 0x0F , 0x04 , 0x0F , 0x04 , 0x7F , 0x01 , 0x7F , 0x01 , +0x8D , 0x00 , 0x8D , 0x00 , 0xA3 , 0xFD , 0xA3 , 0xFD , 0xC7 , 0xFA , 0xC7 , 0xFA , 0x29 , 0xF9 , 0x29 , 0xF9 , +0xAB , 0xF6 , 0xAB , 0xF6 , 0x10 , 0xF5 , 0x10 , 0xF5 , 0x37 , 0xF3 , 0x37 , 0xF3 , 0x6F , 0xF2 , 0x6F , 0xF2 , +0xB5 , 0xF1 , 0xB5 , 0xF1 , 0x26 , 0xF0 , 0x26 , 0xF0 , 0x63 , 0xF0 , 0x63 , 0xF0 , 0x4A , 0xF1 , 0x4A , 0xF1 , +0xE7 , 0xEF , 0xE7 , 0xEF , 0x46 , 0xF0 , 0x46 , 0xF0 , 0x12 , 0xF2 , 0x12 , 0xF2 , 0x37 , 0xF1 , 0x37 , 0xF1 , +0x81 , 0xF1 , 0x81 , 0xF1 , 0x41 , 0xF3 , 0x41 , 0xF3 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0x71 , 0x01 , 0x71 , 0x01 , +0xDA , 0xFF , 0xDA , 0xFF , 0xFC , 0x09 , 0xFC , 0x09 , 0x68 , 0x13 , 0x68 , 0x13 , 0xE2 , 0x11 , 0xE2 , 0x11 , +0x99 , 0x15 , 0x99 , 0x15 , 0xAB , 0x1B , 0xAB , 0x1B , 0x60 , 0x17 , 0x60 , 0x17 , 0xA1 , 0x16 , 0xA1 , 0x16 , +0x83 , 0x15 , 0x83 , 0x15 , 0xFF , 0x0E , 0xFF , 0x0E , 0xC5 , 0x0A , 0xC5 , 0x0A , 0xC0 , 0x05 , 0xC0 , 0x05 , +0x7F , 0x00 , 0x7F , 0x00 , 0xF4 , 0xFD , 0xF4 , 0xFD , 0x15 , 0xFC , 0x15 , 0xFC , 0x0D , 0xF9 , 0x0D , 0xF9 , +0x2A , 0xFA , 0x2A , 0xFA , 0xBE , 0xFB , 0xBE , 0xFB , 0x16 , 0xFD , 0x16 , 0xFD , 0x95 , 0xFE , 0x95 , 0xFE , +0x13 , 0x02 , 0x13 , 0x02 , 0xC1 , 0x02 , 0xC1 , 0x02 , 0xBE , 0x03 , 0xBE , 0x03 , 0xB5 , 0x04 , 0xB5 , 0x04 , +0x9A , 0x04 , 0x9A , 0x04 , 0x72 , 0x03 , 0x72 , 0x03 , 0xA2 , 0x02 , 0xA2 , 0x02 , 0xD9 , 0x00 , 0xD9 , 0x00 , +0xE3 , 0xFE , 0xE3 , 0xFE , 0xA9 , 0xFD , 0xA9 , 0xFD , 0xE1 , 0xFC , 0xE1 , 0xFC , 0xBA , 0xFB , 0xBA , 0xFB , +0x92 , 0xFB , 0x92 , 0xFB , 0x64 , 0xFB , 0x64 , 0xFB , 0xA4 , 0xFB , 0xA4 , 0xFB , 0xF4 , 0xFB , 0xF4 , 0xFB , +0x36 , 0xFC , 0x36 , 0xFC , 0xC0 , 0xFC , 0xC0 , 0xFC , 0xF2 , 0xFC , 0xF2 , 0xFC , 0x55 , 0xFD , 0x55 , 0xFD , +0xD5 , 0xFD , 0xD5 , 0xFD , 0x66 , 0xFE , 0x66 , 0xFE , 0x9B , 0xFE , 0x9B , 0xFE , 0x43 , 0xFF , 0x43 , 0xFF , +0xBF , 0xFF , 0xBF , 0xFF , 0x0E , 0x00 , 0x0E , 0x00 , 0xDF , 0xFF , 0xDF , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xE1 , 0xFF , 0xE1 , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x57 , 0x00 , 0x57 , 0x00 , 0xB0 , 0x00 , 0xB0 , 0x00 , +0x0F , 0x01 , 0x0F , 0x01 , 0xEA , 0x01 , 0xEA , 0x01 , 0x74 , 0x02 , 0x74 , 0x02 , 0x23 , 0x03 , 0x23 , 0x03 , +0x1E , 0x04 , 0x1E , 0x04 , 0x85 , 0x04 , 0x85 , 0x04 , 0xB2 , 0x04 , 0xB2 , 0x04 , 0x1A , 0x05 , 0x1A , 0x05 , +0xB6 , 0x04 , 0xB6 , 0x04 , 0xF9 , 0x03 , 0xF9 , 0x03 , 0x76 , 0x03 , 0x76 , 0x03 , 0x62 , 0x02 , 0x62 , 0x02 , +0xEF , 0x00 , 0xEF , 0x00 , 0x23 , 0x00 , 0x23 , 0x00 , 0x4A , 0xFF , 0x4A , 0xFF , 0x47 , 0xFE , 0x47 , 0xFE , +0x36 , 0xFE , 0x36 , 0xFE , 0xFE , 0xFD , 0xFE , 0xFD , 0x80 , 0xFD , 0x80 , 0xFD , 0xDF , 0xFD , 0xDF , 0xFD , +0xE0 , 0xFD , 0xE0 , 0xFD , 0x83 , 0xFD , 0x83 , 0xFD , 0xE6 , 0xFD , 0xE6 , 0xFD , 0xCB , 0xFD , 0xCB , 0xFD , +0x43 , 0xFD , 0x43 , 0xFD , 0x89 , 0xFD , 0x89 , 0xFD , 0x60 , 0xFD , 0x60 , 0xFD , 0xC8 , 0xFC , 0xC8 , 0xFC , +0x03 , 0xFD , 0x03 , 0xFD , 0xF4 , 0xFC , 0xF4 , 0xFC , 0x7B , 0xFC , 0x7B , 0xFC , 0xCD , 0xFC , 0xCD , 0xFC , +0xE0 , 0xFC , 0xE0 , 0xFC , 0xA3 , 0xFC , 0xA3 , 0xFC , 0x02 , 0xFD , 0x02 , 0xFD , 0xE0 , 0xFC , 0xE0 , 0xFC , +0xED , 0xFC , 0xED , 0xFC , 0x4F , 0xFD , 0x4F , 0xFD , 0x17 , 0xFD , 0x17 , 0xFD , 0x46 , 0xFD , 0x46 , 0xFD , +0x82 , 0xFD , 0x82 , 0xFD , 0x31 , 0xFD , 0x31 , 0xFD , 0x15 , 0xFD , 0x15 , 0xFD , 0x26 , 0xFD , 0x26 , 0xFD , +0x3D , 0xFD , 0x3D , 0xFD , 0xBD , 0xFD , 0xBD , 0xFD , 0xCD , 0xFE , 0xCD , 0xFE , 0x91 , 0xFF , 0x91 , 0xFF , +0x0A , 0x01 , 0x0A , 0x01 , 0xDB , 0x02 , 0xDB , 0x02 , 0x18 , 0x04 , 0x18 , 0x04 , 0xCF , 0x05 , 0xCF , 0x05 , +0xA5 , 0x07 , 0xA5 , 0x07 , 0xC3 , 0x08 , 0xC3 , 0x08 , 0x0E , 0x0A , 0x0E , 0x0A , 0x3C , 0x0B , 0x3C , 0x0B , +0x15 , 0x0B , 0x15 , 0x0B , 0xD6 , 0x0A , 0xD6 , 0x0A , 0x5F , 0x0A , 0x5F , 0x0A , 0xE0 , 0x08 , 0xE0 , 0x08 , +0x15 , 0x07 , 0x15 , 0x07 , 0xA8 , 0x05 , 0xA8 , 0x05 , 0xEC , 0x03 , 0xEC , 0x03 , 0xE7 , 0x01 , 0xE7 , 0x01 , +0xCE , 0x00 , 0xCE , 0x00 , 0xD5 , 0xFF , 0xD5 , 0xFF , 0xAA , 0xFE , 0xAA , 0xFE , 0x73 , 0xFE , 0x73 , 0xFE , +0x1E , 0xFE , 0x1E , 0xFE , 0x76 , 0xFD , 0x76 , 0xFD , 0x81 , 0xFD , 0x81 , 0xFD , 0x41 , 0xFD , 0x41 , 0xFD , +0xC8 , 0xFC , 0xC8 , 0xFC , 0xCF , 0xFC , 0xCF , 0xFC , 0x8F , 0xFC , 0x8F , 0xFC , 0x1C , 0xFC , 0x1C , 0xFC , +0x12 , 0xFC , 0x12 , 0xFC , 0xEC , 0xFB , 0xEC , 0xFB , 0x98 , 0xFB , 0x98 , 0xFB , 0xB0 , 0xFB , 0xB0 , 0xFB , +0xC0 , 0xFB , 0xC0 , 0xFB , 0xB5 , 0xFB , 0xB5 , 0xFB , 0xFB , 0xFB , 0xFB , 0xFB , 0x39 , 0xFC , 0x39 , 0xFC , +0x43 , 0xFC , 0x43 , 0xFC , 0xA7 , 0xFC , 0xA7 , 0xFC , 0xC5 , 0xFC , 0xC5 , 0xFC , 0xBA , 0xFC , 0xBA , 0xFC , +0x29 , 0xFD , 0x29 , 0xFD , 0x2D , 0xFD , 0x2D , 0xFD , 0x2A , 0xFD , 0x2A , 0xFD , 0x7D , 0xFD , 0x7D , 0xFD , +0x6E , 0xFD , 0x6E , 0xFD , 0x4C , 0xFD , 0x4C , 0xFD , 0x4A , 0xFD , 0x4A , 0xFD , 0x33 , 0xFD , 0x33 , 0xFD , +0x2E , 0xFD , 0x2E , 0xFD , 0xD9 , 0xFD , 0xD9 , 0xFD , 0x80 , 0xFE , 0x80 , 0xFE , 0x38 , 0xFF , 0x38 , 0xFF , +0xE1 , 0x00 , 0xE1 , 0x00 , 0x34 , 0x02 , 0x34 , 0x02 , 0x7D , 0x03 , 0x7D , 0x03 , 0x53 , 0x05 , 0x53 , 0x05 , +0xC4 , 0x06 , 0xC4 , 0x06 , 0xAF , 0x07 , 0xAF , 0x07 , 0xF7 , 0x08 , 0xF7 , 0x08 , 0x89 , 0x09 , 0x89 , 0x09 , +0x2B , 0x09 , 0x2B , 0x09 , 0x01 , 0x09 , 0x01 , 0x09 , 0x5F , 0x08 , 0x5F , 0x08 , 0xD5 , 0x06 , 0xD5 , 0x06 , +0x75 , 0x05 , 0x75 , 0x05 , 0x44 , 0x04 , 0x44 , 0x04 , 0x72 , 0x02 , 0x72 , 0x02 , 0xF7 , 0x00 , 0xF7 , 0x00 , +0x1C , 0x00 , 0x1C , 0x00 , 0xE4 , 0xFE , 0xE4 , 0xFE , 0x12 , 0xFE , 0x12 , 0xFE , 0xDF , 0xFD , 0xDF , 0xFD , +0x39 , 0xFD , 0x39 , 0xFD , 0xE1 , 0xFC , 0xE1 , 0xFC , 0xF6 , 0xFC , 0xF6 , 0xFC , 0xDC , 0xFC , 0xDC , 0xFC , +0xCD , 0xFC , 0xCD , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0xF2 , 0xFC , 0xF2 , 0xFC , +0xF8 , 0xFC , 0xF8 , 0xFC , 0xF7 , 0xFC , 0xF7 , 0xFC , 0xE4 , 0xFC , 0xE4 , 0xFC , 0xE2 , 0xFC , 0xE2 , 0xFC , +0xE6 , 0xFC , 0xE6 , 0xFC , 0xE2 , 0xFC , 0xE2 , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0x0C , 0xFD , 0x0C , 0xFD , +0x11 , 0xFD , 0x11 , 0xFD , 0x2C , 0xFD , 0x2C , 0xFD , 0x53 , 0xFD , 0x53 , 0xFD , 0x30 , 0xFD , 0x30 , 0xFD , +0x5D , 0xFD , 0x5D , 0xFD , 0x8B , 0xFD , 0x8B , 0xFD , 0x6D , 0xFD , 0x6D , 0xFD , 0xA2 , 0xFD , 0xA2 , 0xFD , +0xC5 , 0xFD , 0xC5 , 0xFD , 0xA9 , 0xFD , 0xA9 , 0xFD , 0xA9 , 0xFD , 0xA9 , 0xFD , 0xA3 , 0xFD , 0xA3 , 0xFD , +0x7F , 0xFD , 0x7F , 0xFD , 0xBD , 0xFD , 0xBD , 0xFD , 0x80 , 0xFE , 0x80 , 0xFE , 0xDA , 0xFE , 0xDA , 0xFE , +0xDC , 0xFF , 0xDC , 0xFF , 0x48 , 0x01 , 0x48 , 0x01 , 0x30 , 0x02 , 0x30 , 0x02 , 0x75 , 0x03 , 0x75 , 0x03 , +0xFD , 0x04 , 0xFD , 0x04 , 0xD6 , 0x05 , 0xD6 , 0x05 , 0x9E , 0x06 , 0x9E , 0x06 , 0x96 , 0x07 , 0x96 , 0x07 , +0x8A , 0x07 , 0x8A , 0x07 , 0x2C , 0x07 , 0x2C , 0x07 , 0xEB , 0x06 , 0xEB , 0x06 , 0xF4 , 0x05 , 0xF4 , 0x05 , +0xB8 , 0x04 , 0xB8 , 0x04 , 0xD8 , 0x03 , 0xD8 , 0x03 , 0x9B , 0x02 , 0x9B , 0x02 , 0x56 , 0x01 , 0x56 , 0x01 , +0x98 , 0x00 , 0x98 , 0x00 , 0xBE , 0xFF , 0xBE , 0xFF , 0xFC , 0xFE , 0xFC , 0xFE , 0xAD , 0xFE , 0xAD , 0xFE , +0x33 , 0xFE , 0x33 , 0xFE , 0xDE , 0xFD , 0xDE , 0xFD , 0xD4 , 0xFD , 0xD4 , 0xFD , 0xCC , 0xFD , 0xCC , 0xFD , +0xB6 , 0xFD , 0xB6 , 0xFD , 0xBB , 0xFD , 0xBB , 0xFD , 0xCE , 0xFD , 0xCE , 0xFD , 0xDE , 0xFD , 0xDE , 0xFD , +0xE9 , 0xFD , 0xE9 , 0xFD , 0x04 , 0xFE , 0x04 , 0xFE , 0x17 , 0xFE , 0x17 , 0xFE , 0x20 , 0xFE , 0x20 , 0xFE , +0x31 , 0xFE , 0x31 , 0xFE , 0x3E , 0xFE , 0x3E , 0xFE , 0x48 , 0xFE , 0x48 , 0xFE , 0x4B , 0xFE , 0x4B , 0xFE , +0x42 , 0xFE , 0x42 , 0xFE , 0x3E , 0xFE , 0x3E , 0xFE , 0x40 , 0xFE , 0x40 , 0xFE , 0x25 , 0xFE , 0x25 , 0xFE , +0x3F , 0xFE , 0x3F , 0xFE , 0x34 , 0xFE , 0x34 , 0xFE , 0x13 , 0xFE , 0x13 , 0xFE , 0x31 , 0xFE , 0x31 , 0xFE , +0x17 , 0xFE , 0x17 , 0xFE , 0xF2 , 0xFD , 0xF2 , 0xFD , 0xE6 , 0xFD , 0xE6 , 0xFD , 0xBF , 0xFD , 0xBF , 0xFD , +0x9A , 0xFD , 0x9A , 0xFD , 0xEB , 0xFD , 0xEB , 0xFD , 0xE1 , 0xFE , 0xE1 , 0xFE , 0x4A , 0xFF , 0x4A , 0xFF , +0x4C , 0x00 , 0x4C , 0x00 , 0x01 , 0x02 , 0x01 , 0x02 , 0xE2 , 0x02 , 0xE2 , 0x02 , 0xF1 , 0x03 , 0xF1 , 0x03 , +0x87 , 0x05 , 0x87 , 0x05 , 0x4F , 0x06 , 0x4F , 0x06 , 0xAB , 0x06 , 0xAB , 0x06 , 0x85 , 0x07 , 0x85 , 0x07 , +0x52 , 0x07 , 0x52 , 0x07 , 0x6B , 0x06 , 0x6B , 0x06 , 0xE6 , 0x05 , 0xE6 , 0x05 , 0xBF , 0x04 , 0xBF , 0x04 , +0x35 , 0x03 , 0x35 , 0x03 , 0x2B , 0x02 , 0x2B , 0x02 , 0xDA , 0x00 , 0xDA , 0x00 , 0x7A , 0xFF , 0x7A , 0xFF , +0xBD , 0xFE , 0xBD , 0xFE , 0x10 , 0xFE , 0x10 , 0xFE , 0x62 , 0xFD , 0x62 , 0xFD , 0x69 , 0xFD , 0x69 , 0xFD , +0x4F , 0xFD , 0x4F , 0xFD , 0x1E , 0xFD , 0x1E , 0xFD , 0x81 , 0xFD , 0x81 , 0xFD , 0xB9 , 0xFD , 0xB9 , 0xFD , +0xC4 , 0xFD , 0xC4 , 0xFD , 0x02 , 0xFE , 0x02 , 0xFE , 0x3C , 0xFE , 0x3C , 0xFE , 0x3F , 0xFE , 0x3F , 0xFE , +0x6E , 0xFE , 0x6E , 0xFE , 0x78 , 0xFE , 0x78 , 0xFE , 0x74 , 0xFE , 0x74 , 0xFE , 0x45 , 0xFE , 0x45 , 0xFE , +0x32 , 0xFE , 0x32 , 0xFE , 0x29 , 0xFE , 0x29 , 0xFE , 0xFD , 0xFD , 0xFD , 0xFD , 0xE8 , 0xFD , 0xE8 , 0xFD , +0x1A , 0xFE , 0x1A , 0xFE , 0xFD , 0xFD , 0xFD , 0xFD , 0xDD , 0xFD , 0xDD , 0xFD , 0xF1 , 0xFD , 0xF1 , 0xFD , +0xB5 , 0xFD , 0xB5 , 0xFD , 0x76 , 0xFD , 0x76 , 0xFD , 0x88 , 0xFD , 0x88 , 0xFD , 0x45 , 0xFD , 0x45 , 0xFD , +0x0C , 0xFD , 0x0C , 0xFD , 0xFD , 0xFC , 0xFD , 0xFC , 0x90 , 0xFC , 0x90 , 0xFC , 0x55 , 0xFC , 0x55 , 0xFC , +0xE8 , 0xFC , 0xE8 , 0xFC , 0x92 , 0xFE , 0x92 , 0xFE , 0x3D , 0xFF , 0x3D , 0xFF , 0x94 , 0x00 , 0x94 , 0x00 , +0x8F , 0x03 , 0x8F , 0x03 , 0x9B , 0x05 , 0x9B , 0x05 , 0xFD , 0x06 , 0xFD , 0x06 , 0xC3 , 0x09 , 0xC3 , 0x09 , +0xF4 , 0x0B , 0xF4 , 0x0B , 0x5B , 0x0C , 0x5B , 0x0C , 0x5A , 0x0D , 0x5A , 0x0D , 0x8A , 0x0D , 0x8A , 0x0D , +0x81 , 0x0B , 0x81 , 0x0B , 0xCC , 0x09 , 0xCC , 0x09 , 0xAB , 0x07 , 0xAB , 0x07 , 0x44 , 0x04 , 0x44 , 0x04 , +0x7D , 0x01 , 0x7D , 0x01 , 0xE6 , 0xFE , 0xE6 , 0xFE , 0x38 , 0xFC , 0x38 , 0xFC , 0x98 , 0xFA , 0x98 , 0xFA , +0xBE , 0xF9 , 0xBE , 0xF9 , 0x12 , 0xF9 , 0x12 , 0xF9 , 0xAA , 0xF9 , 0xAA , 0xF9 , 0xB6 , 0xFA , 0xB6 , 0xFA , +0x6C , 0xFB , 0x6C , 0xFB , 0xE7 , 0xFC , 0xE7 , 0xFC , 0x93 , 0xFE , 0x93 , 0xFE , 0x70 , 0xFF , 0x70 , 0xFF , +0x44 , 0x00 , 0x44 , 0x00 , 0x63 , 0x00 , 0x63 , 0x00 , 0xD3 , 0xFF , 0xD3 , 0xFF , 0x1B , 0xFF , 0x1B , 0xFF , +0xFC , 0xFD , 0xFC , 0xFD , 0x71 , 0xFC , 0x71 , 0xFC , 0xDA , 0xFA , 0xDA , 0xFA , 0xA4 , 0xF9 , 0xA4 , 0xF9 , +0xCD , 0xF8 , 0xCD , 0xF8 , 0xA8 , 0xF8 , 0xA8 , 0xF8 , 0x7F , 0xF8 , 0x7F , 0xF8 , 0x89 , 0xF8 , 0x89 , 0xF8 , +0x93 , 0xF8 , 0x93 , 0xF8 , 0x9E , 0xF7 , 0x9E , 0xF7 , 0x52 , 0xF7 , 0x52 , 0xF7 , 0x95 , 0xF7 , 0x95 , 0xF7 , +0x2F , 0xF6 , 0x2F , 0xF6 , 0x44 , 0xF5 , 0x44 , 0xF5 , 0xD5 , 0xF4 , 0xD5 , 0xF4 , 0x94 , 0xF3 , 0x94 , 0xF3 , +0xE9 , 0xF2 , 0xE9 , 0xF2 , 0x1A , 0xF6 , 0x1A , 0xF6 , 0x33 , 0xFC , 0x33 , 0xFC , 0xC5 , 0xFE , 0xC5 , 0xFE , +0xFE , 0x02 , 0xFE , 0x02 , 0xDD , 0x0B , 0xDD , 0x0B , 0x8D , 0x10 , 0x8D , 0x10 , 0x8D , 0x12 , 0x8D , 0x12 , +0x7D , 0x17 , 0x7D , 0x17 , 0xCA , 0x19 , 0xCA , 0x19 , 0xC0 , 0x17 , 0xC0 , 0x17 , 0x96 , 0x16 , 0x96 , 0x16 , +0x0A , 0x13 , 0x0A , 0x13 , 0x77 , 0x0D , 0x77 , 0x0D , 0x44 , 0x08 , 0x44 , 0x08 , 0x87 , 0x01 , 0x87 , 0x01 , +0x23 , 0xFC , 0x23 , 0xFC , 0xE8 , 0xF8 , 0xE8 , 0xF8 , 0x85 , 0xF5 , 0x85 , 0xF5 , 0x5E , 0xF4 , 0x5E , 0xF4 , +0xC1 , 0xF5 , 0xC1 , 0xF5 , 0xDC , 0xF6 , 0xDC , 0xF6 , 0xD8 , 0xF9 , 0xD8 , 0xF9 , 0x55 , 0xFD , 0x55 , 0xFD , +0x71 , 0xFF , 0x71 , 0xFF , 0x76 , 0x02 , 0x76 , 0x02 , 0x97 , 0x04 , 0x97 , 0x04 , 0xA2 , 0x04 , 0xA2 , 0x04 , +0x48 , 0x04 , 0x48 , 0x04 , 0xA4 , 0x02 , 0xA4 , 0x02 , 0x37 , 0x00 , 0x37 , 0x00 , 0x03 , 0xFE , 0x03 , 0xFE , +0xA1 , 0xFB , 0xA1 , 0xFB , 0xE0 , 0xF8 , 0xE0 , 0xF8 , 0x52 , 0xF7 , 0x52 , 0xF7 , 0x99 , 0xF6 , 0x99 , 0xF6 , +0xB9 , 0xF6 , 0xB9 , 0xF6 , 0x69 , 0xF7 , 0x69 , 0xF7 , 0x21 , 0xF8 , 0x21 , 0xF8 , 0x1D , 0xF9 , 0x1D , 0xF9 , +0xDA , 0xF8 , 0xDA , 0xF8 , 0xBB , 0xF7 , 0xBB , 0xF7 , 0x24 , 0xF8 , 0x24 , 0xF8 , 0xB7 , 0xF7 , 0xB7 , 0xF7 , +0x73 , 0xF5 , 0x73 , 0xF5 , 0x9C , 0xF4 , 0x9C , 0xF4 , 0x9F , 0xF3 , 0x9F , 0xF3 , 0xFD , 0xF1 , 0xFD , 0xF1 , +0x37 , 0xF3 , 0x37 , 0xF3 , 0x2D , 0xFB , 0x2D , 0xFB , 0x0D , 0x01 , 0x0D , 0x01 , 0xB9 , 0x03 , 0xB9 , 0x03 , +0xDA , 0x0C , 0xDA , 0x0C , 0xCB , 0x15 , 0xCB , 0x15 , 0x4E , 0x17 , 0x4E , 0x17 , 0x66 , 0x1A , 0x66 , 0x1A , +0x0D , 0x1D , 0x0D , 0x1D , 0xC8 , 0x1A , 0xC8 , 0x1A , 0x72 , 0x17 , 0x72 , 0x17 , 0x44 , 0x11 , 0x44 , 0x11 , +0x77 , 0x0B , 0x77 , 0x0B , 0x56 , 0x05 , 0x56 , 0x05 , 0xF9 , 0xFC , 0xF9 , 0xFC , 0x31 , 0xF8 , 0x31 , 0xF8 , +0x0D , 0xF7 , 0x0D , 0xF7 , 0x57 , 0xF4 , 0x57 , 0xF4 , 0xF3 , 0xF4 , 0xF3 , 0xF4 , 0xA6 , 0xF8 , 0xA6 , 0xF8 , +0x21 , 0xFB , 0x21 , 0xFB , 0xDC , 0xFE , 0xDC , 0xFE , 0x3E , 0x02 , 0x3E , 0x02 , 0xFC , 0x03 , 0xFC , 0x03 , +0x30 , 0x06 , 0x30 , 0x06 , 0x51 , 0x06 , 0x51 , 0x06 , 0x38 , 0x04 , 0x38 , 0x04 , 0x00 , 0x02 , 0x00 , 0x02 , +0x1B , 0xFF , 0x1B , 0xFF , 0xB6 , 0xFB , 0xB6 , 0xFB , 0x6D , 0xF9 , 0x6D , 0xF9 , 0x76 , 0xF7 , 0x76 , 0xF7 , +0x86 , 0xF5 , 0x86 , 0xF5 , 0xBE , 0xF5 , 0xBE , 0xF5 , 0x66 , 0xF6 , 0x66 , 0xF6 , 0x6B , 0xF7 , 0x6B , 0xF7 , +0xEF , 0xF8 , 0xEF , 0xF8 , 0x41 , 0xFA , 0x41 , 0xFA , 0x23 , 0xFA , 0x23 , 0xFA , 0x0F , 0xF8 , 0x0F , 0xF8 , +0x1F , 0xF6 , 0x1F , 0xF6 , 0xDA , 0xF5 , 0xDA , 0xF5 , 0x23 , 0xF3 , 0x23 , 0xF3 , 0x55 , 0xF0 , 0x55 , 0xF0 , +0xB5 , 0xEF , 0xB5 , 0xEF , 0xCE , 0xEE , 0xCE , 0xEE , 0x92 , 0xED , 0x92 , 0xED , 0xCC , 0xF3 , 0xCC , 0xF3 , +0x7E , 0x00 , 0x7E , 0x00 , 0x9D , 0x05 , 0x9D , 0x05 , 0xEA , 0x0A , 0xEA , 0x0A , 0x70 , 0x17 , 0x70 , 0x17 , +0xA8 , 0x1D , 0xA8 , 0x1D , 0xDD , 0x1C , 0xDD , 0x1C , 0xEC , 0x1D , 0xEC , 0x1D , 0x63 , 0x1B , 0x63 , 0x1B , +0x28 , 0x17 , 0x28 , 0x17 , 0xD4 , 0x0F , 0xD4 , 0x0F , 0x84 , 0x06 , 0x84 , 0x06 , 0x07 , 0x02 , 0x07 , 0x02 , +0x35 , 0xFC , 0x35 , 0xFC , 0x19 , 0xF5 , 0x19 , 0xF5 , 0x18 , 0xF5 , 0x18 , 0xF5 , 0xE7 , 0xF6 , 0xE7 , 0xF6 , +0x53 , 0xF7 , 0x53 , 0xF7 , 0xFB , 0xFB , 0xFB , 0xFB , 0xA7 , 0xFF , 0xA7 , 0xFF , 0xB3 , 0x02 , 0xB3 , 0x02 , +0x58 , 0x06 , 0x58 , 0x06 , 0x36 , 0x06 , 0x36 , 0x06 , 0x99 , 0x05 , 0x99 , 0x05 , 0xB7 , 0x05 , 0xB7 , 0x05 , +0xEB , 0x01 , 0xEB , 0x01 , 0xB1 , 0xFD , 0xB1 , 0xFD , 0x2C , 0xFB , 0x2C , 0xFB , 0x2E , 0xF8 , 0x2E , 0xF8 , +0xCB , 0xF5 , 0xCB , 0xF5 , 0xFD , 0xF5 , 0xFD , 0xF5 , 0x9E , 0xF5 , 0x9E , 0xF5 , 0x9F , 0xF6 , 0x9F , 0xF6 , +0x19 , 0xF9 , 0x19 , 0xF9 , 0x83 , 0xFA , 0x83 , 0xFA , 0x56 , 0xFC , 0x56 , 0xFC , 0xCB , 0xFD , 0xCB , 0xFD , +0x2A , 0xFD , 0x2A , 0xFD , 0x02 , 0xFA , 0x02 , 0xFA , 0x47 , 0xF5 , 0x47 , 0xF5 , 0x2A , 0xF3 , 0x2A , 0xF3 , +0x5A , 0xF1 , 0x5A , 0xF1 , 0x1E , 0xED , 0x1E , 0xED , 0xE1 , 0xEB , 0xE1 , 0xEB , 0xC5 , 0xEC , 0xC5 , 0xEC , +0xD8 , 0xEC , 0xD8 , 0xEC , 0x85 , 0xEF , 0x85 , 0xEF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0x7D , 0x0E , 0x7D , 0x0E , +0xA9 , 0x11 , 0xA9 , 0x11 , 0x3E , 0x1B , 0x3E , 0x1B , 0x1A , 0x27 , 0x1A , 0x27 , 0xD6 , 0x25 , 0xD6 , 0x25 , +0x49 , 0x21 , 0x49 , 0x21 , 0x50 , 0x1C , 0x50 , 0x1C , 0xB6 , 0x15 , 0xB6 , 0x15 , 0x86 , 0x0F , 0x86 , 0x0F , +0xCF , 0x02 , 0xCF , 0x02 , 0x52 , 0xFB , 0x52 , 0xFB , 0x1B , 0xFB , 0x1B , 0xFB , 0x78 , 0xF6 , 0x78 , 0xF6 , +0xCA , 0xF3 , 0xCA , 0xF3 , 0x8E , 0xF9 , 0x8E , 0xF9 , 0x36 , 0xFD , 0x36 , 0xFD , 0xEA , 0x00 , 0xEA , 0x00 , +0xDD , 0x04 , 0xDD , 0x04 , 0x45 , 0x06 , 0x45 , 0x06 , 0xEF , 0x08 , 0xEF , 0x08 , 0x15 , 0x08 , 0x15 , 0x08 , +0x62 , 0x03 , 0x62 , 0x03 , 0xC5 , 0x01 , 0xC5 , 0x01 , 0xF8 , 0xFE , 0xF8 , 0xFE , 0x36 , 0xF9 , 0x36 , 0xF9 , +0x1E , 0xF6 , 0x1E , 0xF6 , 0x48 , 0xF5 , 0x48 , 0xF5 , 0x49 , 0xF4 , 0x49 , 0xF4 , 0x75 , 0xF5 , 0x75 , 0xF5 , +0xB4 , 0xF7 , 0xB4 , 0xF7 , 0x59 , 0xF9 , 0x59 , 0xF9 , 0x8E , 0xFC , 0x8E , 0xFC , 0x90 , 0xFD , 0x90 , 0xFD , +0x50 , 0xFE , 0x50 , 0xFE , 0x33 , 0xFF , 0x33 , 0xFF , 0xF4 , 0xFD , 0xF4 , 0xFD , 0xC2 , 0xF9 , 0xC2 , 0xF9 , +0x19 , 0xF3 , 0x19 , 0xF3 , 0xF8 , 0xEE , 0xF8 , 0xEE , 0x44 , 0xEF , 0x44 , 0xEF , 0xEA , 0xEB , 0xEA , 0xEB , +0xBE , 0xE9 , 0xBE , 0xE9 , 0xFA , 0xEB , 0xFA , 0xEB , 0x8C , 0xEE , 0x8C , 0xEE , 0x47 , 0xEF , 0x47 , 0xEF , +0x3F , 0xFA , 0x3F , 0xFA , 0x17 , 0x0F , 0x17 , 0x0F , 0xB9 , 0x16 , 0xB9 , 0x16 , 0xED , 0x18 , 0xED , 0x18 , +0xF3 , 0x22 , 0xF3 , 0x22 , 0xDD , 0x26 , 0xDD , 0x26 , 0x04 , 0x20 , 0x04 , 0x20 , 0x2E , 0x18 , 0x2E , 0x18 , +0xAB , 0x0E , 0xAB , 0x0E , 0x42 , 0x0B , 0x42 , 0x0B , 0xED , 0x04 , 0xED , 0x04 , 0xEC , 0xF9 , 0xEC , 0xF9 , +0x13 , 0xFA , 0x13 , 0xFA , 0x88 , 0xFD , 0x88 , 0xFD , 0x27 , 0xFB , 0x27 , 0xFB , 0x98 , 0xFD , 0x98 , 0xFD , +0x7D , 0x03 , 0x7D , 0x03 , 0x8E , 0x06 , 0x8E , 0x06 , 0x82 , 0x09 , 0x82 , 0x09 , 0x06 , 0x08 , 0x06 , 0x08 , +0x1B , 0x07 , 0x1B , 0x07 , 0x20 , 0x07 , 0x20 , 0x07 , 0x86 , 0x01 , 0x86 , 0x01 , 0x0A , 0xFC , 0x0A , 0xFC , +0x10 , 0xFB , 0x10 , 0xFB , 0xC2 , 0xF8 , 0xC2 , 0xF8 , 0x63 , 0xF6 , 0x63 , 0xF6 , 0xD2 , 0xF6 , 0xD2 , 0xF6 , +0x48 , 0xF8 , 0x48 , 0xF8 , 0x9A , 0xF9 , 0x9A , 0xF9 , 0x0E , 0xFC , 0x0E , 0xFC , 0x7D , 0xFD , 0x7D , 0xFD , +0xEA , 0xFD , 0xEA , 0xFD , 0x12 , 0xFF , 0x12 , 0xFF , 0x1C , 0xFD , 0x1C , 0xFD , 0x9B , 0xFB , 0x9B , 0xFB , +0xDD , 0xFA , 0xDD , 0xFA , 0x6B , 0xF8 , 0x6B , 0xF8 , 0x97 , 0xF4 , 0x97 , 0xF4 , 0x58 , 0xEE , 0x58 , 0xEE , +0x13 , 0xEB , 0x13 , 0xEB , 0xB2 , 0xED , 0xB2 , 0xED , 0x84 , 0xEC , 0x84 , 0xEC , 0x53 , 0xEB , 0x53 , 0xEB , +0x9B , 0xEE , 0x9B , 0xEE , 0x05 , 0xF2 , 0x05 , 0xF2 , 0x39 , 0xF3 , 0x39 , 0xF3 , 0x55 , 0xFE , 0x55 , 0xFE , +0x83 , 0x12 , 0x83 , 0x12 , 0x6C , 0x19 , 0x6C , 0x19 , 0xE1 , 0x19 , 0xE1 , 0x19 , 0xC5 , 0x20 , 0xC5 , 0x20 , +0x7F , 0x23 , 0x7F , 0x23 , 0xCB , 0x1C , 0xCB , 0x1C , 0x7C , 0x13 , 0x7C , 0x13 , 0xD7 , 0x08 , 0xD7 , 0x08 , +0x36 , 0x07 , 0x36 , 0x07 , 0x8C , 0x04 , 0x8C , 0x04 , 0xC0 , 0xFB , 0xC0 , 0xFB , 0x70 , 0xFC , 0x70 , 0xFC , +0xDE , 0x01 , 0xDE , 0x01 , 0xF3 , 0x01 , 0xF3 , 0x01 , 0xAB , 0x03 , 0xAB , 0x03 , 0x30 , 0x07 , 0x30 , 0x07 , +0x6C , 0x08 , 0x6C , 0x08 , 0x7C , 0x09 , 0x7C , 0x09 , 0x99 , 0x05 , 0x99 , 0x05 , 0x18 , 0x02 , 0x18 , 0x02 , +0x6D , 0x01 , 0x6D , 0x01 , 0xC0 , 0xFD , 0xC0 , 0xFD , 0x2A , 0xF9 , 0x2A , 0xF9 , 0x21 , 0xF8 , 0x21 , 0xF8 , +0x8F , 0xF8 , 0x8F , 0xF8 , 0xBE , 0xF9 , 0xBE , 0xF9 , 0xA2 , 0xFA , 0xA2 , 0xFA , 0x47 , 0xFB , 0x47 , 0xFB , +0xB8 , 0xFC , 0xB8 , 0xFC , 0x14 , 0xFF , 0x14 , 0xFF , 0xB5 , 0xFE , 0xB5 , 0xFE , 0xDE , 0xFC , 0xDE , 0xFC , +0xB9 , 0xFC , 0xB9 , 0xFC , 0xB6 , 0xFA , 0xB6 , 0xFA , 0xFD , 0xF8 , 0xFD , 0xF8 , 0x90 , 0xF7 , 0x90 , 0xF7 , +0xD3 , 0xF5 , 0xD3 , 0xF5 , 0x9E , 0xF3 , 0x9E , 0xF3 , 0x7C , 0xEE , 0x7C , 0xEE , 0xE1 , 0xEB , 0xE1 , 0xEB , +0x98 , 0xEE , 0x98 , 0xEE , 0x43 , 0xEE , 0x43 , 0xEE , 0x95 , 0xED , 0x95 , 0xED , 0x81 , 0xEF , 0x81 , 0xEF , +0x17 , 0xF2 , 0x17 , 0xF2 , 0x0E , 0xF4 , 0x0E , 0xF4 , 0x34 , 0x00 , 0x34 , 0x00 , 0x61 , 0x13 , 0x61 , 0x13 , +0x87 , 0x19 , 0x87 , 0x19 , 0x13 , 0x1A , 0x13 , 0x1A , 0x52 , 0x1F , 0x52 , 0x1F , 0x69 , 0x20 , 0x69 , 0x20 , +0x6B , 0x1A , 0x6B , 0x1A , 0x78 , 0x10 , 0x78 , 0x10 , 0x75 , 0x05 , 0x75 , 0x05 , 0x4C , 0x05 , 0x4C , 0x05 , +0x4C , 0x04 , 0x4C , 0x04 , 0x21 , 0xFE , 0x21 , 0xFE , 0x52 , 0xFF , 0x52 , 0xFF , 0x8A , 0x03 , 0x8A , 0x03 , +0x28 , 0x05 , 0x28 , 0x05 , 0x5C , 0x07 , 0x5C , 0x07 , 0x11 , 0x07 , 0x11 , 0x07 , 0x5F , 0x06 , 0x5F , 0x06 , +0x91 , 0x06 , 0x91 , 0x06 , 0xEA , 0x01 , 0xEA , 0x01 , 0x49 , 0xFE , 0x49 , 0xFE , 0xBC , 0xFC , 0xBC , 0xFC , +0x45 , 0xFA , 0x45 , 0xFA , 0x6A , 0xF8 , 0x6A , 0xF8 , 0xB0 , 0xF7 , 0xB0 , 0xF7 , 0x5A , 0xF8 , 0x5A , 0xF8 , +0x19 , 0xFB , 0x19 , 0xFB , 0x44 , 0xFC , 0x44 , 0xFC , 0x3A , 0xFC , 0x3A , 0xFC , 0xB1 , 0xFC , 0xB1 , 0xFC , +0x2C , 0xFE , 0x2C , 0xFE , 0x68 , 0xFD , 0x68 , 0xFD , 0x94 , 0xFB , 0x94 , 0xFB , 0x1D , 0xFA , 0x1D , 0xFA , +0x6B , 0xF8 , 0x6B , 0xF8 , 0x1B , 0xF8 , 0x1B , 0xF8 , 0xE1 , 0xF6 , 0xE1 , 0xF6 , 0x69 , 0xF5 , 0x69 , 0xF5 , +0x2A , 0xF3 , 0x2A , 0xF3 , 0x7A , 0xEE , 0x7A , 0xEE , 0x85 , 0xED , 0x85 , 0xED , 0x5F , 0xEF , 0x5F , 0xEF , +0xC0 , 0xEE , 0xC0 , 0xEE , 0x31 , 0xEF , 0x31 , 0xEF , 0x76 , 0xF0 , 0x76 , 0xF0 , 0xD0 , 0xF1 , 0xD0 , 0xF1 , +0xCA , 0xF4 , 0xCA , 0xF4 , 0xA4 , 0x03 , 0xA4 , 0x03 , 0x72 , 0x15 , 0x72 , 0x15 , 0xFE , 0x19 , 0xFE , 0x19 , +0x72 , 0x1A , 0x72 , 0x1A , 0x0D , 0x1E , 0x0D , 0x1E , 0xE1 , 0x1D , 0xE1 , 0x1D , 0xC8 , 0x18 , 0xC8 , 0x18 , +0xA0 , 0x0C , 0xA0 , 0x0C , 0x48 , 0x03 , 0x48 , 0x03 , 0xA0 , 0x05 , 0xA0 , 0x05 , 0x83 , 0x05 , 0x83 , 0x05 , +0xD8 , 0x02 , 0xD8 , 0x02 , 0x6F , 0x02 , 0x6F , 0x02 , 0x52 , 0x04 , 0x52 , 0x04 , 0x8D , 0x08 , 0x8D , 0x08 , +0x34 , 0x0A , 0x34 , 0x0A , 0x67 , 0x06 , 0x67 , 0x06 , 0xE7 , 0x04 , 0xE7 , 0x04 , 0x90 , 0x03 , 0x90 , 0x03 , +0x6F , 0x00 , 0x6F , 0x00 , 0x89 , 0xFD , 0x89 , 0xFD , 0x01 , 0xFA , 0x01 , 0xFA , 0xB4 , 0xF8 , 0xB4 , 0xF8 , +0x5C , 0xF9 , 0x5C , 0xF9 , 0x12 , 0xF9 , 0x12 , 0xF9 , 0xE0 , 0xF9 , 0xE0 , 0xF9 , 0xF0 , 0xFB , 0xF0 , 0xFB , +0x35 , 0xFD , 0x35 , 0xFD , 0x57 , 0xFD , 0x57 , 0xFD , 0xE6 , 0xFC , 0xE6 , 0xFC , 0x0C , 0xFD , 0x0C , 0xFD , +0xFF , 0xFB , 0xFF , 0xFB , 0xED , 0xFA , 0xED , 0xFA , 0xAD , 0xF8 , 0xAD , 0xF8 , 0x94 , 0xF7 , 0x94 , 0xF7 , +0xC9 , 0xF7 , 0xC9 , 0xF7 , 0x15 , 0xF7 , 0x15 , 0xF7 , 0xA9 , 0xF5 , 0xA9 , 0xF5 , 0x8F , 0xF1 , 0x8F , 0xF1 , +0xF1 , 0xED , 0xF1 , 0xED , 0xB4 , 0xEF , 0xB4 , 0xEF , 0x2F , 0xF0 , 0x2F , 0xF0 , 0xB0 , 0xEF , 0xB0 , 0xEF , +0x8D , 0xF0 , 0x8D , 0xF0 , 0xC3 , 0xF1 , 0xC3 , 0xF1 , 0xE7 , 0xF2 , 0xE7 , 0xF2 , 0x2D , 0xFA , 0x2D , 0xFA , +0x4A , 0x0D , 0x4A , 0x0D , 0x36 , 0x1B , 0x36 , 0x1B , 0x69 , 0x1C , 0x69 , 0x1C , 0x35 , 0x1B , 0x35 , 0x1B , +0xEB , 0x1C , 0xEB , 0x1C , 0xB5 , 0x1C , 0xB5 , 0x1C , 0xFE , 0x13 , 0xFE , 0x13 , 0x9A , 0x04 , 0x9A , 0x04 , +0xAB , 0x00 , 0xAB , 0x00 , 0xD1 , 0x04 , 0xD1 , 0x04 , 0xCC , 0x04 , 0xCC , 0x04 , 0xBB , 0x02 , 0xBB , 0x02 , +0xC0 , 0x01 , 0xC0 , 0x01 , 0xB9 , 0x06 , 0xB9 , 0x06 , 0x32 , 0x0D , 0x32 , 0x0D , 0x8C , 0x0B , 0x8C , 0x0B , +0xD3 , 0x05 , 0xD3 , 0x05 , 0x43 , 0x04 , 0x43 , 0x04 , 0x53 , 0x03 , 0x53 , 0x03 , 0xEB , 0x00 , 0xEB , 0x00 , +0xDB , 0xFB , 0xDB , 0xFB , 0xF3 , 0xF7 , 0xF3 , 0xF7 , 0xEB , 0xF8 , 0xEB , 0xF8 , 0x26 , 0xFA , 0x26 , 0xFA , +0x66 , 0xF9 , 0x66 , 0xF9 , 0x01 , 0xFA , 0x01 , 0xFA , 0x0D , 0xFC , 0x0D , 0xFC , 0xE6 , 0xFD , 0xE6 , 0xFD , +0x44 , 0xFD , 0x44 , 0xFD , 0x4B , 0xFC , 0x4B , 0xFC , 0x17 , 0xFC , 0x17 , 0xFC , 0x92 , 0xFB , 0x92 , 0xFB , +0x64 , 0xFA , 0x64 , 0xFA , 0xBA , 0xF7 , 0xBA , 0xF7 , 0x61 , 0xF7 , 0x61 , 0xF7 , 0xC7 , 0xF7 , 0xC7 , 0xF7 , +0x46 , 0xF7 , 0x46 , 0xF7 , 0x86 , 0xF4 , 0x86 , 0xF4 , 0xFB , 0xEE , 0xFB , 0xEE , 0x9C , 0xED , 0x9C , 0xED , +0x18 , 0xF0 , 0x18 , 0xF0 , 0x4E , 0xEF , 0x4E , 0xEF , 0x27 , 0xEF , 0x27 , 0xEF , 0x1E , 0xF0 , 0x1E , 0xF0 , +0x1A , 0xF2 , 0x1A , 0xF2 , 0xF2 , 0xF3 , 0xF2 , 0xF3 , 0x1C , 0xFB , 0x1C , 0xFB , 0x11 , 0x0D , 0x11 , 0x0D , +0x5F , 0x1A , 0x5F , 0x1A , 0x74 , 0x1C , 0x74 , 0x1C , 0x6E , 0x1B , 0x6E , 0x1B , 0xA5 , 0x1B , 0xA5 , 0x1B , +0x6C , 0x1A , 0x6C , 0x1A , 0x4B , 0x12 , 0x4B , 0x12 , 0x71 , 0x05 , 0x71 , 0x05 , 0x41 , 0x02 , 0x41 , 0x02 , +0x96 , 0x05 , 0x96 , 0x05 , 0x13 , 0x07 , 0x13 , 0x07 , 0x24 , 0x05 , 0x24 , 0x05 , 0xDF , 0x02 , 0xDF , 0x02 , +0x4F , 0x06 , 0x4F , 0x06 , 0x10 , 0x0B , 0x10 , 0x0B , 0x96 , 0x08 , 0x96 , 0x08 , 0x81 , 0x02 , 0x81 , 0x02 , +0xF8 , 0xFF , 0xF8 , 0xFF , 0x59 , 0x00 , 0x59 , 0x00 , 0xB3 , 0xFF , 0xB3 , 0xFF , 0x52 , 0xFB , 0x52 , 0xFB , +0x4D , 0xF8 , 0x4D , 0xF8 , 0x0B , 0xFA , 0x0B , 0xFA , 0x67 , 0xFC , 0x67 , 0xFC , 0xB1 , 0xFC , 0xB1 , 0xFC , +0x17 , 0xFC , 0x17 , 0xFC , 0x14 , 0xFD , 0x14 , 0xFD , 0x02 , 0xFF , 0x02 , 0xFF , 0x52 , 0xFE , 0x52 , 0xFE , +0x5C , 0xFB , 0x5C , 0xFB , 0x00 , 0xF9 , 0x00 , 0xF9 , 0x11 , 0xF9 , 0x11 , 0xF9 , 0x52 , 0xF9 , 0x52 , 0xF9 , +0x74 , 0xF8 , 0x74 , 0xF8 , 0xC7 , 0xF6 , 0xC7 , 0xF6 , 0xC5 , 0xF6 , 0xC5 , 0xF6 , 0x5F , 0xF5 , 0x5F , 0xF5 , +0xC6 , 0xF0 , 0xC6 , 0xF0 , 0x27 , 0xEE , 0x27 , 0xEE , 0x6C , 0xED , 0x6C , 0xED , 0xD6 , 0xEE , 0xD6 , 0xEE , +0xC7 , 0xF0 , 0xC7 , 0xF0 , 0xBD , 0xF0 , 0xBD , 0xF0 , 0x57 , 0xF1 , 0x57 , 0xF1 , 0xDA , 0xF4 , 0xDA , 0xF4 , +0x1E , 0x03 , 0x1E , 0x03 , 0xF1 , 0x12 , 0xF1 , 0x12 , 0xBD , 0x18 , 0xBD , 0x18 , 0x78 , 0x18 , 0x78 , 0x18 , +0xA5 , 0x17 , 0xA5 , 0x17 , 0xE7 , 0x17 , 0xE7 , 0x17 , 0x03 , 0x15 , 0x03 , 0x15 , 0xE0 , 0x0A , 0xE0 , 0x0A , +0x58 , 0x03 , 0x58 , 0x03 , 0x8D , 0x04 , 0x8D , 0x04 , 0x82 , 0x08 , 0x82 , 0x08 , 0x57 , 0x0A , 0x57 , 0x0A , +0xBC , 0x06 , 0xBC , 0x06 , 0x30 , 0x05 , 0x30 , 0x05 , 0xA6 , 0x08 , 0xA6 , 0x08 , 0xAE , 0x0A , 0xAE , 0x0A , +0xB7 , 0x06 , 0xB7 , 0x06 , 0x18 , 0x01 , 0x18 , 0x01 , 0xA7 , 0xFE , 0xA7 , 0xFE , 0x24 , 0x00 , 0x24 , 0x00 , +0x53 , 0xFF , 0x53 , 0xFF , 0x4B , 0xFB , 0x4B , 0xFB , 0xB2 , 0xF9 , 0xB2 , 0xF9 , 0x52 , 0xFB , 0x52 , 0xFB , +0x4E , 0xFE , 0x4E , 0xFE , 0xC7 , 0xFE , 0xC7 , 0xFE , 0xF0 , 0xFC , 0xF0 , 0xFC , 0xE3 , 0xFC , 0xE3 , 0xFC , +0xB3 , 0xFD , 0xB3 , 0xFD , 0xAF , 0xFC , 0xAF , 0xFC , 0x9A , 0xF9 , 0x9A , 0xF9 , 0xC8 , 0xF7 , 0xC8 , 0xF7 , +0xDD , 0xF7 , 0xDD , 0xF7 , 0x9A , 0xF8 , 0x9A , 0xF8 , 0xE3 , 0xF7 , 0xE3 , 0xF7 , 0x96 , 0xF6 , 0x96 , 0xF6 , +0x55 , 0xF6 , 0x55 , 0xF6 , 0xBC , 0xF3 , 0xBC , 0xF3 , 0x72 , 0xF0 , 0x72 , 0xF0 , 0x1D , 0xEE , 0x1D , 0xEE , +0x60 , 0xED , 0x60 , 0xED , 0x1C , 0xF0 , 0x1C , 0xF0 , 0x57 , 0xF1 , 0x57 , 0xF1 , 0xAE , 0xF1 , 0xAE , 0xF1 , +0xFA , 0xF1 , 0xFA , 0xF1 , 0x41 , 0xFA , 0x41 , 0xFA , 0xA7 , 0x0B , 0xA7 , 0x0B , 0xF9 , 0x16 , 0xF9 , 0x16 , +0xB3 , 0x19 , 0xB3 , 0x19 , 0x18 , 0x18 , 0x18 , 0x18 , 0x6C , 0x17 , 0x6C , 0x17 , 0x8E , 0x17 , 0x8E , 0x17 , +0xC9 , 0x11 , 0xC9 , 0x11 , 0xAC , 0x07 , 0xAC , 0x07 , 0x21 , 0x04 , 0x21 , 0x04 , 0x7B , 0x06 , 0x7B , 0x06 , +0xF7 , 0x0A , 0xF7 , 0x0A , 0x4A , 0x0A , 0x4A , 0x0A , 0x02 , 0x06 , 0x02 , 0x06 , 0x02 , 0x06 , 0x02 , 0x06 , +0x19 , 0x09 , 0x19 , 0x09 , 0x18 , 0x09 , 0x18 , 0x09 , 0x72 , 0x04 , 0x72 , 0x04 , 0x06 , 0xFF , 0x06 , 0xFF , +0x18 , 0xFE , 0x18 , 0xFE , 0x67 , 0xFF , 0x67 , 0xFF , 0xE6 , 0xFC , 0xE6 , 0xFC , 0xAC , 0xF9 , 0xAC , 0xF9 , +0xF9 , 0xF8 , 0xF9 , 0xF8 , 0x67 , 0xFB , 0x67 , 0xFB , 0x38 , 0xFE , 0x38 , 0xFE , 0x99 , 0xFD , 0x99 , 0xFD , +0x46 , 0xFC , 0x46 , 0xFC , 0x94 , 0xFC , 0x94 , 0xFC , 0xFA , 0xFC , 0xFA , 0xFC , 0xBC , 0xFB , 0xBC , 0xFB , +0x95 , 0xF9 , 0x95 , 0xF9 , 0xB0 , 0xF8 , 0xB0 , 0xF8 , 0xB4 , 0xF8 , 0xB4 , 0xF8 , 0xDD , 0xF8 , 0xDD , 0xF8 , +0x0F , 0xF7 , 0x0F , 0xF7 , 0xC9 , 0xF5 , 0xC9 , 0xF5 , 0x7B , 0xF4 , 0x7B , 0xF4 , 0x52 , 0xF1 , 0x52 , 0xF1 , +0x1A , 0xEF , 0x1A , 0xEF , 0x12 , 0xED , 0x12 , 0xED , 0xFC , 0xED , 0xFC , 0xED , 0x4E , 0xF0 , 0x4E , 0xF0 , +0x14 , 0xF1 , 0x14 , 0xF1 , 0x63 , 0xF1 , 0x63 , 0xF1 , 0x6B , 0xF3 , 0x6B , 0xF3 , 0x60 , 0x00 , 0x60 , 0x00 , +0x08 , 0x0F , 0x08 , 0x0F , 0x21 , 0x16 , 0x21 , 0x16 , 0xF9 , 0x16 , 0xF9 , 0x16 , 0x33 , 0x16 , 0x33 , 0x16 , +0x9D , 0x17 , 0x9D , 0x17 , 0xF4 , 0x16 , 0xF4 , 0x16 , 0x6E , 0x0F , 0x6E , 0x0F , 0x8E , 0x08 , 0x8E , 0x08 , +0xE3 , 0x07 , 0xE3 , 0x07 , 0x80 , 0x0A , 0x80 , 0x0A , 0x74 , 0x0B , 0x74 , 0x0B , 0x0E , 0x08 , 0x0E , 0x08 , +0xCB , 0x05 , 0xCB , 0x05 , 0x83 , 0x07 , 0x83 , 0x07 , 0x5A , 0x09 , 0x5A , 0x09 , 0x27 , 0x07 , 0x27 , 0x07 , +0x4D , 0x02 , 0x4D , 0x02 , 0x76 , 0xFF , 0x76 , 0xFF , 0x9F , 0xFF , 0x9F , 0xFF , 0xDC , 0xFD , 0xDC , 0xFD , +0x0F , 0xFB , 0x0F , 0xFB , 0x61 , 0xF9 , 0x61 , 0xF9 , 0x7A , 0xFA , 0x7A , 0xFA , 0x0A , 0xFD , 0x0A , 0xFD , +0x6A , 0xFD , 0x6A , 0xFD , 0x76 , 0xFC , 0x76 , 0xFC , 0x09 , 0xFC , 0x09 , 0xFC , 0x09 , 0xFC , 0x09 , 0xFC , +0x66 , 0xFB , 0x66 , 0xFB , 0x17 , 0xFA , 0x17 , 0xFA , 0x2A , 0xF9 , 0x2A , 0xF9 , 0xA8 , 0xF8 , 0xA8 , 0xF8 , +0xB3 , 0xF8 , 0xB3 , 0xF8 , 0x43 , 0xF7 , 0x43 , 0xF7 , 0xEE , 0xF5 , 0xEE , 0xF5 , 0x4C , 0xF4 , 0x4C , 0xF4 , +0x21 , 0xF1 , 0x21 , 0xF1 , 0xA3 , 0xEF , 0xA3 , 0xEF , 0x4D , 0xEE , 0x4D , 0xEE , 0x3B , 0xEF , 0x3B , 0xEF , +0xDE , 0xF0 , 0xDE , 0xF0 , 0xA4 , 0xF1 , 0xA4 , 0xF1 , 0x2F , 0xF2 , 0x2F , 0xF2 , 0x55 , 0xF4 , 0x55 , 0xF4 , +0xA8 , 0xFF , 0xA8 , 0xFF , 0xD6 , 0x0C , 0xD6 , 0x0C , 0x0A , 0x14 , 0x0A , 0x14 , 0x33 , 0x16 , 0x33 , 0x16 , +0x41 , 0x16 , 0x41 , 0x16 , 0x11 , 0x18 , 0x11 , 0x18 , 0xE7 , 0x16 , 0xE7 , 0x16 , 0xFA , 0x0F , 0xFA , 0x0F , +0x70 , 0x0A , 0x70 , 0x0A , 0x90 , 0x09 , 0x90 , 0x09 , 0x26 , 0x0B , 0x26 , 0x0B , 0xC4 , 0x0A , 0xC4 , 0x0A , +0xF4 , 0x06 , 0xF4 , 0x06 , 0x81 , 0x04 , 0x81 , 0x04 , 0xF8 , 0x05 , 0xF8 , 0x05 , 0x8B , 0x07 , 0x8B , 0x07 , +0xA4 , 0x05 , 0xA4 , 0x05 , 0xAF , 0x01 , 0xAF , 0x01 , 0xAF , 0xFF , 0xAF , 0xFF , 0x25 , 0xFF , 0x25 , 0xFF , +0x0A , 0xFE , 0x0A , 0xFE , 0x2F , 0xFC , 0x2F , 0xFC , 0xCA , 0xFA , 0xCA , 0xFA , 0xE3 , 0xFB , 0xE3 , 0xFB , +0x8C , 0xFD , 0x8C , 0xFD , 0xCC , 0xFD , 0xCC , 0xFD , 0xF7 , 0xFC , 0xF7 , 0xFC , 0xF8 , 0xFB , 0xF8 , 0xFB , +0x87 , 0xFB , 0x87 , 0xFB , 0x23 , 0xFB , 0x23 , 0xFB , 0x8C , 0xFA , 0x8C , 0xFA , 0x64 , 0xF9 , 0x64 , 0xF9 , +0xDA , 0xF8 , 0xDA , 0xF8 , 0x08 , 0xF9 , 0x08 , 0xF9 , 0x55 , 0xF8 , 0x55 , 0xF8 , 0xE7 , 0xF6 , 0xE7 , 0xF6 , +0x6E , 0xF3 , 0x6E , 0xF3 , 0x40 , 0xF1 , 0x40 , 0xF1 , 0xA4 , 0xF0 , 0xA4 , 0xF0 , 0xC6 , 0xF0 , 0xC6 , 0xF0 , +0xA7 , 0xF1 , 0xA7 , 0xF1 , 0xD2 , 0xF1 , 0xD2 , 0xF1 , 0x88 , 0xF2 , 0x88 , 0xF2 , 0xD5 , 0xF3 , 0xD5 , 0xF3 , +0xAE , 0xFA , 0xAE , 0xFA , 0xA9 , 0x06 , 0xA9 , 0x06 , 0x09 , 0x0F , 0x09 , 0x0F , 0x36 , 0x13 , 0x36 , 0x13 , +0x82 , 0x14 , 0x82 , 0x14 , 0xFE , 0x15 , 0xFE , 0x15 , 0x98 , 0x16 , 0x98 , 0x16 , 0x10 , 0x12 , 0x10 , 0x12 , +0x91 , 0x0C , 0x91 , 0x0C , 0x64 , 0x0A , 0x64 , 0x0A , 0xBC , 0x0A , 0xBC , 0x0A , 0xC2 , 0x0A , 0xC2 , 0x0A , +0xCA , 0x07 , 0xCA , 0x07 , 0x76 , 0x04 , 0x76 , 0x04 , 0xF3 , 0x04 , 0xF3 , 0x04 , 0xB4 , 0x06 , 0xB4 , 0x06 , +0xFD , 0x05 , 0xFD , 0x05 , 0xD1 , 0x02 , 0xD1 , 0x02 , 0x4A , 0x00 , 0x4A , 0x00 , 0x6F , 0xFF , 0x6F , 0xFF , +0xFD , 0xFE , 0xFD , 0xFE , 0x84 , 0xFD , 0x84 , 0xFD , 0xA4 , 0xFB , 0xA4 , 0xFB , 0x74 , 0xFB , 0x74 , 0xFB , +0x96 , 0xFC , 0x96 , 0xFC , 0x50 , 0xFD , 0x50 , 0xFD , 0x1E , 0xFD , 0x1E , 0xFD , 0x2D , 0xFC , 0x2D , 0xFC , +0xB1 , 0xFB , 0xB1 , 0xFB , 0xB8 , 0xFB , 0xB8 , 0xFB , 0x84 , 0xFB , 0x84 , 0xFB , 0x01 , 0xFA , 0x01 , 0xFA , +0xD0 , 0xF8 , 0xD0 , 0xF8 , 0xC0 , 0xF8 , 0xC0 , 0xF8 , 0x7F , 0xF8 , 0x7F , 0xF8 , 0x09 , 0xF7 , 0x09 , 0xF7 , +0x78 , 0xF3 , 0x78 , 0xF3 , 0x15 , 0xF1 , 0x15 , 0xF1 , 0xAA , 0xF0 , 0xAA , 0xF0 , 0xFD , 0xF0 , 0xFD , 0xF0 , +0x93 , 0xF1 , 0x93 , 0xF1 , 0x64 , 0xF1 , 0x64 , 0xF1 , 0xFA , 0xF1 , 0xFA , 0xF1 , 0x2B , 0xF3 , 0x2B , 0xF3 , +0xBF , 0xF6 , 0xBF , 0xF6 , 0xAB , 0xFF , 0xAB , 0xFF , 0x04 , 0x09 , 0x04 , 0x09 , 0xF3 , 0x0F , 0xF3 , 0x0F , +0xFC , 0x13 , 0xFC , 0x13 , 0xF5 , 0x15 , 0xF5 , 0x15 , 0xBA , 0x17 , 0xBA , 0x17 , 0x68 , 0x16 , 0x68 , 0x16 , +0x41 , 0x12 , 0x41 , 0x12 , 0xFF , 0x0E , 0xFF , 0x0E , 0x46 , 0x0D , 0x46 , 0x0D , 0x55 , 0x0C , 0x55 , 0x0C , +0x51 , 0x0A , 0x51 , 0x0A , 0xB9 , 0x06 , 0xB9 , 0x06 , 0xEC , 0x04 , 0xEC , 0x04 , 0x50 , 0x05 , 0x50 , 0x05 , +0x54 , 0x05 , 0x54 , 0x05 , 0xD7 , 0x03 , 0xD7 , 0x03 , 0xB2 , 0x01 , 0xB2 , 0x01 , 0x4F , 0x00 , 0x4F , 0x00 , +0x9E , 0xFF , 0x9E , 0xFF , 0xC2 , 0xFE , 0xC2 , 0xFE , 0x67 , 0xFD , 0x67 , 0xFD , 0x38 , 0xFC , 0x38 , 0xFC , +0xE1 , 0xFB , 0xE1 , 0xFB , 0x01 , 0xFC , 0x01 , 0xFC , 0x36 , 0xFC , 0x36 , 0xFC , 0x00 , 0xFC , 0x00 , 0xFC , +0x7A , 0xFB , 0x7A , 0xFB , 0x2E , 0xFB , 0x2E , 0xFB , 0x55 , 0xFB , 0x55 , 0xFB , 0xED , 0xFA , 0xED , 0xFA , +0xDF , 0xF9 , 0xDF , 0xF9 , 0x48 , 0xF9 , 0x48 , 0xF9 , 0x63 , 0xF8 , 0x63 , 0xF8 , 0x32 , 0xF7 , 0x32 , 0xF7 , +0xD4 , 0xF4 , 0xD4 , 0xF4 , 0x22 , 0xF2 , 0x22 , 0xF2 , 0x32 , 0xF1 , 0x32 , 0xF1 , 0x3F , 0xF1 , 0x3F , 0xF1 , +0x3B , 0xF2 , 0x3B , 0xF2 , 0x13 , 0xF3 , 0x13 , 0xF3 , 0x5E , 0xF3 , 0x5E , 0xF3 , 0x07 , 0xF4 , 0x07 , 0xF4 , +0x19 , 0xF7 , 0x19 , 0xF7 , 0xA7 , 0xFE , 0xA7 , 0xFE , 0x09 , 0x07 , 0x09 , 0x07 , 0x2D , 0x0D , 0x2D , 0x0D , +0x3B , 0x11 , 0x3B , 0x11 , 0x57 , 0x14 , 0x57 , 0x14 , 0x27 , 0x17 , 0x27 , 0x17 , 0xFD , 0x16 , 0xFD , 0x16 , +0x6E , 0x13 , 0x6E , 0x13 , 0xE5 , 0x0F , 0xE5 , 0x0F , 0xD2 , 0x0D , 0xD2 , 0x0D , 0x94 , 0x0C , 0x94 , 0x0C , +0x7D , 0x0A , 0x7D , 0x0A , 0xD6 , 0x06 , 0xD6 , 0x06 , 0x90 , 0x04 , 0x90 , 0x04 , 0x7F , 0x04 , 0x7F , 0x04 , +0x6B , 0x04 , 0x6B , 0x04 , 0x38 , 0x03 , 0x38 , 0x03 , 0x5E , 0x01 , 0x5E , 0x01 , 0x49 , 0x00 , 0x49 , 0x00 , +0x5A , 0x00 , 0x5A , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0xEE , 0xFE , 0xEE , 0xFE , 0x4E , 0xFD , 0x4E , 0xFD , +0x68 , 0xFC , 0x68 , 0xFC , 0x34 , 0xFC , 0x34 , 0xFC , 0x15 , 0xFC , 0x15 , 0xFC , 0x66 , 0xFB , 0x66 , 0xFB , +0x99 , 0xFA , 0x99 , 0xFA , 0x5D , 0xFA , 0x5D , 0xFA , 0xB9 , 0xFA , 0xB9 , 0xFA , 0xA4 , 0xFA , 0xA4 , 0xFA , +0xD7 , 0xF9 , 0xD7 , 0xF9 , 0x88 , 0xF9 , 0x88 , 0xF9 , 0xB3 , 0xF8 , 0xB3 , 0xF8 , 0x0D , 0xF7 , 0x0D , 0xF7 , +0x15 , 0xF5 , 0x15 , 0xF5 , 0xD2 , 0xF2 , 0xD2 , 0xF2 , 0xD3 , 0xF1 , 0xD3 , 0xF1 , 0x98 , 0xF1 , 0x98 , 0xF1 , +0x99 , 0xF1 , 0x99 , 0xF1 , 0xC2 , 0xF2 , 0xC2 , 0xF2 , 0xEA , 0xF3 , 0xEA , 0xF3 , 0xFA , 0xF4 , 0xFA , 0xF4 , +0x58 , 0xF6 , 0x58 , 0xF6 , 0xCB , 0xF9 , 0xCB , 0xF9 , 0x17 , 0x00 , 0x17 , 0x00 , 0x43 , 0x06 , 0x43 , 0x06 , +0xDD , 0x0A , 0xDD , 0x0A , 0x4D , 0x0E , 0x4D , 0x0E , 0x9D , 0x11 , 0x9D , 0x11 , 0x8A , 0x14 , 0x8A , 0x14 , +0xCE , 0x14 , 0xCE , 0x14 , 0xC4 , 0x12 , 0xC4 , 0x12 , 0x96 , 0x10 , 0x96 , 0x10 , 0xDF , 0x0E , 0xDF , 0x0E , +0x59 , 0x0D , 0x59 , 0x0D , 0xA0 , 0x0A , 0xA0 , 0x0A , 0x12 , 0x07 , 0x12 , 0x07 , 0xE7 , 0x04 , 0xE7 , 0x04 , +0xFE , 0x03 , 0xFE , 0x03 , 0x1F , 0x03 , 0x1F , 0x03 , 0xB6 , 0x01 , 0xB6 , 0x01 , 0x2F , 0x00 , 0x2F , 0x00 , +0xA3 , 0xFF , 0xA3 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , 0xA1 , 0xFE , 0xA1 , 0xFE , +0x8E , 0xFD , 0x8E , 0xFD , 0x1C , 0xFD , 0x1C , 0xFD , 0xDA , 0xFC , 0xDA , 0xFC , 0x43 , 0xFC , 0x43 , 0xFC , +0x53 , 0xFB , 0x53 , 0xFB , 0xAF , 0xFA , 0xAF , 0xFA , 0xA8 , 0xFA , 0xA8 , 0xFA , 0xD0 , 0xFA , 0xD0 , 0xFA , +0x8F , 0xFA , 0x8F , 0xFA , 0xD0 , 0xF9 , 0xD0 , 0xF9 , 0x87 , 0xF9 , 0x87 , 0xF9 , 0xFA , 0xF8 , 0xFA , 0xF8 , +0xAB , 0xF7 , 0xAB , 0xF7 , 0x43 , 0xF6 , 0x43 , 0xF6 , 0x25 , 0xF5 , 0x25 , 0xF5 , 0x08 , 0xF5 , 0x08 , 0xF5 , +0x42 , 0xF5 , 0x42 , 0xF5 , 0x26 , 0xF5 , 0x26 , 0xF5 , 0xBD , 0xF5 , 0xBD , 0xF5 , 0xAF , 0xF6 , 0xAF , 0xF6 , +0x80 , 0xF7 , 0x80 , 0xF7 , 0x5B , 0xF8 , 0x5B , 0xF8 , 0x71 , 0xFA , 0x71 , 0xFA , 0x90 , 0xFE , 0x90 , 0xFE , +0x03 , 0x03 , 0x03 , 0x03 , 0x96 , 0x06 , 0x96 , 0x06 , 0x7D , 0x09 , 0x7D , 0x09 , 0x8E , 0x0C , 0x8E , 0x0C , +0x74 , 0x0F , 0x74 , 0x0F , 0x97 , 0x10 , 0x97 , 0x10 , 0x0B , 0x10 , 0x0B , 0x10 , 0xE4 , 0x0E , 0xE4 , 0x0E , +0xA5 , 0x0D , 0xA5 , 0x0D , 0x92 , 0x0C , 0x92 , 0x0C , 0xA3 , 0x0A , 0xA3 , 0x0A , 0x0D , 0x08 , 0x0D , 0x08 , +0x19 , 0x06 , 0x19 , 0x06 , 0xC5 , 0x04 , 0xC5 , 0x04 , 0x89 , 0x03 , 0x89 , 0x03 , 0x1B , 0x02 , 0x1B , 0x02 , +0xB3 , 0x00 , 0xB3 , 0x00 , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xD6 , 0xFF , 0xD6 , 0xFF , 0xA8 , 0xFF , 0xA8 , 0xFF , +0x15 , 0xFF , 0x15 , 0xFF , 0x58 , 0xFE , 0x58 , 0xFE , 0xA6 , 0xFD , 0xA6 , 0xFD , 0x2B , 0xFD , 0x2B , 0xFD , +0x86 , 0xFC , 0x86 , 0xFC , 0xD3 , 0xFB , 0xD3 , 0xFB , 0x74 , 0xFB , 0x74 , 0xFB , 0xF4 , 0xFA , 0xF4 , 0xFA , +0x7E , 0xFA , 0x7E , 0xFA , 0x47 , 0xFA , 0x47 , 0xFA , 0x38 , 0xFA , 0x38 , 0xFA , 0xF4 , 0xF9 , 0xF4 , 0xF9 , +0xDA , 0xF9 , 0xDA , 0xF9 , 0xBF , 0xF9 , 0xBF , 0xF9 , 0x81 , 0xF9 , 0x81 , 0xF9 , 0xB5 , 0xF9 , 0xB5 , 0xF9 , +0xFA , 0xF9 , 0xFA , 0xF9 , 0x89 , 0xFA , 0x89 , 0xFA , 0x2C , 0xFB , 0x2C , 0xFB , 0x66 , 0xFB , 0x66 , 0xFB , +0xD4 , 0xFB , 0xD4 , 0xFB , 0x5F , 0xFC , 0x5F , 0xFC , 0x27 , 0xFD , 0x27 , 0xFD , 0xE4 , 0xFD , 0xE4 , 0xFD , +0xAB , 0xFE , 0xAB , 0xFE , 0xFB , 0xFF , 0xFB , 0xFF , 0xE9 , 0x00 , 0xE9 , 0x00 , 0xA4 , 0x01 , 0xA4 , 0x01 , +0x4C , 0x02 , 0x4C , 0x02 , 0xDF , 0x02 , 0xDF , 0x02 , 0xCC , 0x03 , 0xCC , 0x03 , 0x87 , 0x04 , 0x87 , 0x04 , +0xF4 , 0x04 , 0xF4 , 0x04 , 0x2B , 0x05 , 0x2B , 0x05 , 0x33 , 0x05 , 0x33 , 0x05 , 0x09 , 0x05 , 0x09 , 0x05 , +0xB3 , 0x04 , 0xB3 , 0x04 , 0x58 , 0x04 , 0x58 , 0x04 , 0xDD , 0x03 , 0xDD , 0x03 , 0x70 , 0x03 , 0x70 , 0x03 , +0x04 , 0x03 , 0x04 , 0x03 , 0x6A , 0x02 , 0x6A , 0x02 , 0xD7 , 0x01 , 0xD7 , 0x01 , 0x82 , 0x01 , 0x82 , 0x01 , +0x27 , 0x01 , 0x27 , 0x01 , 0xE8 , 0x00 , 0xE8 , 0x00 , 0xB2 , 0x00 , 0xB2 , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , +0x3E , 0x00 , 0x3E , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , 0xA8 , 0xFF , 0xA8 , 0xFF , +0x8C , 0xFF , 0x8C , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , 0x7D , 0xFF , 0x7D , 0xFF , 0x6C , 0xFF , 0x6C , 0xFF , +0x73 , 0xFF , 0x73 , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0xA6 , 0xFF , 0xA6 , 0xFF , 0xC3 , 0xFF , 0xC3 , 0xFF , +0xDF , 0xFF , 0xDF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0xFD , 0xFF , 0xFD , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , 0xBF , 0x00 , 0xBF , 0x00 , +0x3B , 0x01 , 0x3B , 0x01 , 0xC0 , 0x01 , 0xC0 , 0x01 , 0x47 , 0x02 , 0x47 , 0x02 , 0xCD , 0x02 , 0xCD , 0x02 , +0x55 , 0x03 , 0x55 , 0x03 , 0xBC , 0x03 , 0xBC , 0x03 , 0x14 , 0x04 , 0x14 , 0x04 , 0x56 , 0x04 , 0x56 , 0x04 , +0x63 , 0x04 , 0x63 , 0x04 , 0x58 , 0x04 , 0x58 , 0x04 , 0x25 , 0x04 , 0x25 , 0x04 , 0xB7 , 0x03 , 0xB7 , 0x03 , +0x35 , 0x03 , 0x35 , 0x03 , 0xA0 , 0x02 , 0xA0 , 0x02 , 0xE2 , 0x01 , 0xE2 , 0x01 , 0x0C , 0x01 , 0x0C , 0x01 , +0x1E , 0x00 , 0x1E , 0x00 , 0x31 , 0xFF , 0x31 , 0xFF , 0x3C , 0xFE , 0x3C , 0xFE , 0x49 , 0xFD , 0x49 , 0xFD , +0x66 , 0xFC , 0x66 , 0xFC , 0x8A , 0xFB , 0x8A , 0xFB , 0xE0 , 0xFA , 0xE0 , 0xFA , 0x45 , 0xFA , 0x45 , 0xFA , +0xCC , 0xF9 , 0xCC , 0xF9 , 0x72 , 0xF9 , 0x72 , 0xF9 , 0x43 , 0xF9 , 0x43 , 0xF9 , 0x3F , 0xF9 , 0x3F , 0xF9 , +0x50 , 0xF9 , 0x50 , 0xF9 , 0x6D , 0xF9 , 0x6D , 0xF9 , 0xB7 , 0xF9 , 0xB7 , 0xF9 , 0x02 , 0xFA , 0x02 , 0xFA , +0x4A , 0xFA , 0x4A , 0xFA , 0x8F , 0xFA , 0x8F , 0xFA , 0xC9 , 0xFA , 0xC9 , 0xFA , 0xF8 , 0xFA , 0xF8 , 0xFA , +0x16 , 0xFB , 0x16 , 0xFB , 0x61 , 0xFB , 0x61 , 0xFB , 0xB7 , 0xFB , 0xB7 , 0xFB , 0x39 , 0xFC , 0x39 , 0xFC , +0xB2 , 0xFC , 0xB2 , 0xFC , 0x43 , 0xFD , 0x43 , 0xFD , 0x3D , 0xFE , 0x3D , 0xFE , 0x74 , 0xFF , 0x74 , 0xFF , +0xB4 , 0x00 , 0xB4 , 0x00 , 0x39 , 0x02 , 0x39 , 0x02 , 0xC4 , 0x03 , 0xC4 , 0x03 , 0x5C , 0x05 , 0x5C , 0x05 , +0xDD , 0x06 , 0xDD , 0x06 , 0x26 , 0x08 , 0x26 , 0x08 , 0x2C , 0x09 , 0x2C , 0x09 , 0x05 , 0x0A , 0x05 , 0x0A , +0x8E , 0x0A , 0x8E , 0x0A , 0xBC , 0x0A , 0xBC , 0x0A , 0xBD , 0x0A , 0xBD , 0x0A , 0x4F , 0x0A , 0x4F , 0x0A , +0xC9 , 0x09 , 0xC9 , 0x09 , 0x19 , 0x09 , 0x19 , 0x09 , 0x19 , 0x08 , 0x19 , 0x08 , 0xE3 , 0x06 , 0xE3 , 0x06 , +0xBA , 0x05 , 0xBA , 0x05 , 0x5E , 0x04 , 0x5E , 0x04 , 0xD8 , 0x02 , 0xD8 , 0x02 , 0x37 , 0x01 , 0x37 , 0x01 , +0xA1 , 0xFF , 0xA1 , 0xFF , 0x1D , 0xFE , 0x1D , 0xFE , 0xA7 , 0xFC , 0xA7 , 0xFC , 0x52 , 0xFB , 0x52 , 0xFB , +0x29 , 0xFA , 0x29 , 0xFA , 0x2F , 0xF9 , 0x2F , 0xF9 , 0x70 , 0xF8 , 0x70 , 0xF8 , 0xED , 0xF7 , 0xED , 0xF7 , +0x9B , 0xF7 , 0x9B , 0xF7 , 0x84 , 0xF7 , 0x84 , 0xF7 , 0x99 , 0xF7 , 0x99 , 0xF7 , 0xE0 , 0xF7 , 0xE0 , 0xF7 , +0x4A , 0xF8 , 0x4A , 0xF8 , 0xC7 , 0xF8 , 0xC7 , 0xF8 , 0x56 , 0xF9 , 0x56 , 0xF9 , 0xFB , 0xF9 , 0xFB , 0xF9 , +0x87 , 0xFA , 0x87 , 0xFA , 0x15 , 0xFB , 0x15 , 0xFB , 0x8C , 0xFB , 0x8C , 0xFB , 0xED , 0xFB , 0xED , 0xFB , +0x1E , 0xFC , 0x1E , 0xFC , 0x5B , 0xFC , 0x5B , 0xFC , 0x9F , 0xFC , 0x9F , 0xFC , 0xEA , 0xFC , 0xEA , 0xFC , +0x4C , 0xFD , 0x4C , 0xFD , 0xAD , 0xFD , 0xAD , 0xFD , 0x45 , 0xFE , 0x45 , 0xFE , 0x35 , 0xFF , 0x35 , 0xFF , +0x42 , 0x00 , 0x42 , 0x00 , 0x7C , 0x01 , 0x7C , 0x01 , 0xEC , 0x02 , 0xEC , 0x02 , 0x5A , 0x04 , 0x5A , 0x04 , +0xD1 , 0x05 , 0xD1 , 0x05 , 0x24 , 0x07 , 0x24 , 0x07 , 0x39 , 0x08 , 0x39 , 0x08 , 0x09 , 0x09 , 0x09 , 0x09 , +0xB0 , 0x09 , 0xB0 , 0x09 , 0xF0 , 0x09 , 0xF0 , 0x09 , 0xFE , 0x09 , 0xFE , 0x09 , 0xC6 , 0x09 , 0xC6 , 0x09 , +0x49 , 0x09 , 0x49 , 0x09 , 0xC4 , 0x08 , 0xC4 , 0x08 , 0x08 , 0x08 , 0x08 , 0x08 , 0x0E , 0x07 , 0x0E , 0x07 , +0xFC , 0x05 , 0xFC , 0x05 , 0xF9 , 0x04 , 0xF9 , 0x04 , 0xD6 , 0x03 , 0xD6 , 0x03 , 0x88 , 0x02 , 0x88 , 0x02 , +0x3E , 0x01 , 0x3E , 0x01 , 0xF5 , 0xFF , 0xF5 , 0xFF , 0xB0 , 0xFE , 0xB0 , 0xFE , 0x79 , 0xFD , 0x79 , 0xFD , +0x66 , 0xFC , 0x66 , 0xFC , 0x7A , 0xFB , 0x7A , 0xFB , 0xB0 , 0xFA , 0xB0 , 0xFA , 0x0D , 0xFA , 0x0D , 0xFA , +0xA0 , 0xF9 , 0xA0 , 0xF9 , 0x58 , 0xF9 , 0x58 , 0xF9 , 0x36 , 0xF9 , 0x36 , 0xF9 , 0x3A , 0xF9 , 0x3A , 0xF9 , +0x5C , 0xF9 , 0x5C , 0xF9 , 0xA1 , 0xF9 , 0xA1 , 0xF9 , 0x00 , 0xFA , 0x00 , 0xFA , 0x65 , 0xFA , 0x65 , 0xFA , +0xD5 , 0xFA , 0xD5 , 0xFA , 0x3D , 0xFB , 0x3D , 0xFB , 0x9C , 0xFB , 0x9C , 0xFB , 0xF1 , 0xFB , 0xF1 , 0xFB , +0x30 , 0xFC , 0x30 , 0xFC , 0x54 , 0xFC , 0x54 , 0xFC , 0x66 , 0xFC , 0x66 , 0xFC , 0x8E , 0xFC , 0x8E , 0xFC , +0xB6 , 0xFC , 0xB6 , 0xFC , 0xFC , 0xFC , 0xFC , 0xFC , 0x51 , 0xFD , 0x51 , 0xFD , 0xBA , 0xFD , 0xBA , 0xFD , +0x69 , 0xFE , 0x69 , 0xFE , 0x54 , 0xFF , 0x54 , 0xFF , 0x5D , 0x00 , 0x5D , 0x00 , 0xA0 , 0x01 , 0xA0 , 0x01 , +0xF4 , 0x02 , 0xF4 , 0x02 , 0x52 , 0x04 , 0x52 , 0x04 , 0xA7 , 0x05 , 0xA7 , 0x05 , 0xCC , 0x06 , 0xCC , 0x06 , +0xAE , 0x07 , 0xAE , 0x07 , 0x61 , 0x08 , 0x61 , 0x08 , 0xCF , 0x08 , 0xCF , 0x08 , 0xFB , 0x08 , 0xFB , 0x08 , +0x06 , 0x09 , 0x06 , 0x09 , 0xC5 , 0x08 , 0xC5 , 0x08 , 0x71 , 0x08 , 0x71 , 0x08 , 0x02 , 0x08 , 0x02 , 0x08 , +0x67 , 0x07 , 0x67 , 0x07 , 0xA2 , 0x06 , 0xA2 , 0x06 , 0xCF , 0x05 , 0xCF , 0x05 , 0xE6 , 0x04 , 0xE6 , 0x04 , +0xC9 , 0x03 , 0xC9 , 0x03 , 0x92 , 0x02 , 0x92 , 0x02 , 0x4D , 0x01 , 0x4D , 0x01 , 0xFE , 0xFF , 0xFE , 0xFF , +0xA5 , 0xFE , 0xA5 , 0xFE , 0x50 , 0xFD , 0x50 , 0xFD , 0x1E , 0xFC , 0x1E , 0xFC , 0x0F , 0xFB , 0x0F , 0xFB , +0x1E , 0xFA , 0x1E , 0xFA , 0x5C , 0xF9 , 0x5C , 0xF9 , 0xCC , 0xF8 , 0xCC , 0xF8 , 0x6A , 0xF8 , 0x6A , 0xF8 , +0x34 , 0xF8 , 0x34 , 0xF8 , 0x26 , 0xF8 , 0x26 , 0xF8 , 0x49 , 0xF8 , 0x49 , 0xF8 , 0x9B , 0xF8 , 0x9B , 0xF8 , +0x04 , 0xF9 , 0x04 , 0xF9 , 0x83 , 0xF9 , 0x83 , 0xF9 , 0x14 , 0xFA , 0x14 , 0xFA , 0xA5 , 0xFA , 0xA5 , 0xFA , +0x31 , 0xFB , 0x31 , 0xFB , 0xA7 , 0xFB , 0xA7 , 0xFB , 0x06 , 0xFC , 0x06 , 0xFC , 0x48 , 0xFC , 0x48 , 0xFC , +0x87 , 0xFC , 0x87 , 0xFC , 0xBB , 0xFC , 0xBB , 0xFC , 0xF9 , 0xFC , 0xF9 , 0xFC , 0x44 , 0xFD , 0x44 , 0xFD , +0x8E , 0xFD , 0x8E , 0xFD , 0xFF , 0xFD , 0xFF , 0xFD , 0x9A , 0xFE , 0x9A , 0xFE , 0x6F , 0xFF , 0x6F , 0xFF , +0x63 , 0x00 , 0x63 , 0x00 , 0x80 , 0x01 , 0x80 , 0x01 , 0xB0 , 0x02 , 0xB0 , 0x02 , 0xDE , 0x03 , 0xDE , 0x03 , +0x09 , 0x05 , 0x09 , 0x05 , 0x0F , 0x06 , 0x0F , 0x06 , 0xD3 , 0x06 , 0xD3 , 0x06 , 0x69 , 0x07 , 0x69 , 0x07 , +0xD1 , 0x07 , 0xD1 , 0x07 , 0xF8 , 0x07 , 0xF8 , 0x07 , 0x02 , 0x08 , 0x02 , 0x08 , 0xD4 , 0x07 , 0xD4 , 0x07 , +0x7F , 0x07 , 0x7F , 0x07 , 0x13 , 0x07 , 0x13 , 0x07 , 0x85 , 0x06 , 0x85 , 0x06 , 0xDE , 0x05 , 0xDE , 0x05 , +0x1C , 0x05 , 0x1C , 0x05 , 0x4E , 0x04 , 0x4E , 0x04 , 0x5B , 0x03 , 0x5B , 0x03 , 0x50 , 0x02 , 0x50 , 0x02 , +0x39 , 0x01 , 0x39 , 0x01 , 0x1B , 0x00 , 0x1B , 0x00 , 0xFC , 0xFE , 0xFC , 0xFE , 0xDC , 0xFD , 0xDC , 0xFD , +0xD6 , 0xFC , 0xD6 , 0xFC , 0xF3 , 0xFB , 0xF3 , 0xFB , 0x2C , 0xFB , 0x2C , 0xFB , 0x88 , 0xFA , 0x88 , 0xFA , +0x0A , 0xFA , 0x0A , 0xFA , 0xB2 , 0xF9 , 0xB2 , 0xF9 , 0x80 , 0xF9 , 0x80 , 0xF9 , 0x6F , 0xF9 , 0x6F , 0xF9 , +0x7F , 0xF9 , 0x7F , 0xF9 , 0xBA , 0xF9 , 0xBA , 0xF9 , 0x0D , 0xFA , 0x0D , 0xFA , 0x71 , 0xFA , 0x71 , 0xFA , +0xE8 , 0xFA , 0xE8 , 0xFA , 0x67 , 0xFB , 0x67 , 0xFB , 0xE7 , 0xFB , 0xE7 , 0xFB , 0x55 , 0xFC , 0x55 , 0xFC , +0xB3 , 0xFC , 0xB3 , 0xFC , 0xF4 , 0xFC , 0xF4 , 0xFC , 0x26 , 0xFD , 0x26 , 0xFD , 0x52 , 0xFD , 0x52 , 0xFD , +0x75 , 0xFD , 0x75 , 0xFD , 0xAD , 0xFD , 0xAD , 0xFD , 0xDC , 0xFD , 0xDC , 0xFD , 0x20 , 0xFE , 0x20 , 0xFE , +0x90 , 0xFE , 0x90 , 0xFE , 0x2B , 0xFF , 0x2B , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0xC6 , 0x00 , 0xC6 , 0x00 , +0xC2 , 0x01 , 0xC2 , 0x01 , 0xBF , 0x02 , 0xBF , 0x02 , 0xBC , 0x03 , 0xBC , 0x03 , 0xAC , 0x04 , 0xAC , 0x04 , +0x6E , 0x05 , 0x6E , 0x05 , 0xFF , 0x05 , 0xFF , 0x05 , 0x73 , 0x06 , 0x73 , 0x06 , 0xAC , 0x06 , 0xAC , 0x06 , +0xC4 , 0x06 , 0xC4 , 0x06 , 0xBD , 0x06 , 0xBD , 0x06 , 0x87 , 0x06 , 0x87 , 0x06 , 0x41 , 0x06 , 0x41 , 0x06 , +0xDD , 0x05 , 0xDD , 0x05 , 0x66 , 0x05 , 0x66 , 0x05 , 0xD5 , 0x04 , 0xD5 , 0x04 , 0x34 , 0x04 , 0x34 , 0x04 , +0x7E , 0x03 , 0x7E , 0x03 , 0xAE , 0x02 , 0xAE , 0x02 , 0xD0 , 0x01 , 0xD0 , 0x01 , 0xE3 , 0x00 , 0xE3 , 0x00 , +0xF1 , 0xFF , 0xF1 , 0xFF , 0xFC , 0xFE , 0xFC , 0xFE , 0x0C , 0xFE , 0x0C , 0xFE , 0x39 , 0xFD , 0x39 , 0xFD , +0x7A , 0xFC , 0x7A , 0xFC , 0xDA , 0xFB , 0xDA , 0xFB , 0x57 , 0xFB , 0x57 , 0xFB , 0xF6 , 0xFA , 0xF6 , 0xFA , +0xB8 , 0xFA , 0xB8 , 0xFA , 0x99 , 0xFA , 0x99 , 0xFA , 0x97 , 0xFA , 0x97 , 0xFA , 0xAE , 0xFA , 0xAE , 0xFA , +0xE1 , 0xFA , 0xE1 , 0xFA , 0x30 , 0xFB , 0x30 , 0xFB , 0x89 , 0xFB , 0x89 , 0xFB , 0xEA , 0xFB , 0xEA , 0xFB , +0x4E , 0xFC , 0x4E , 0xFC , 0xAA , 0xFC , 0xAA , 0xFC , 0x09 , 0xFD , 0x09 , 0xFD , 0x57 , 0xFD , 0x57 , 0xFD , +0x98 , 0xFD , 0x98 , 0xFD , 0xBF , 0xFD , 0xBF , 0xFD , 0xE0 , 0xFD , 0xE0 , 0xFD , 0xF9 , 0xFD , 0xF9 , 0xFD , +0x17 , 0xFE , 0x17 , 0xFE , 0x4D , 0xFE , 0x4D , 0xFE , 0x7A , 0xFE , 0x7A , 0xFE , 0xB7 , 0xFE , 0xB7 , 0xFE , +0x13 , 0xFF , 0x13 , 0xFF , 0x94 , 0xFF , 0x94 , 0xFF , 0x37 , 0x00 , 0x37 , 0x00 , 0xF6 , 0x00 , 0xF6 , 0x00 , +0xCF , 0x01 , 0xCF , 0x01 , 0xA9 , 0x02 , 0xA9 , 0x02 , 0x86 , 0x03 , 0x86 , 0x03 , 0x55 , 0x04 , 0x55 , 0x04 , +0xF6 , 0x04 , 0xF6 , 0x04 , 0x73 , 0x05 , 0x73 , 0x05 , 0xD4 , 0x05 , 0xD4 , 0x05 , 0xFD , 0x05 , 0xFD , 0x05 , +0x12 , 0x06 , 0x12 , 0x06 , 0x06 , 0x06 , 0x06 , 0x06 , 0xD7 , 0x05 , 0xD7 , 0x05 , 0x97 , 0x05 , 0x97 , 0x05 , +0x2D , 0x05 , 0x2D , 0x05 , 0xB3 , 0x04 , 0xB3 , 0x04 , 0x28 , 0x04 , 0x28 , 0x04 , 0x8E , 0x03 , 0x8E , 0x03 , +0xE4 , 0x02 , 0xE4 , 0x02 , 0x29 , 0x02 , 0x29 , 0x02 , 0x68 , 0x01 , 0x68 , 0x01 , 0x99 , 0x00 , 0x99 , 0x00 , +0xC8 , 0xFF , 0xC8 , 0xFF , 0xF7 , 0xFE , 0xF7 , 0xFE , 0x30 , 0xFE , 0x30 , 0xFE , 0x86 , 0xFD , 0x86 , 0xFD , +0xEC , 0xFC , 0xEC , 0xFC , 0x71 , 0xFC , 0x71 , 0xFC , 0x0D , 0xFC , 0x0D , 0xFC , 0xC4 , 0xFB , 0xC4 , 0xFB , +0x9C , 0xFB , 0x9C , 0xFB , 0x8F , 0xFB , 0x8F , 0xFB , 0x9B , 0xFB , 0x9B , 0xFB , 0xB7 , 0xFB , 0xB7 , 0xFB , +0xE8 , 0xFB , 0xE8 , 0xFB , 0x2A , 0xFC , 0x2A , 0xFC , 0x77 , 0xFC , 0x77 , 0xFC , 0xD4 , 0xFC , 0xD4 , 0xFC , +0x2F , 0xFD , 0x2F , 0xFD , 0x84 , 0xFD , 0x84 , 0xFD , 0xD7 , 0xFD , 0xD7 , 0xFD , 0x1F , 0xFE , 0x1F , 0xFE , +0x56 , 0xFE , 0x56 , 0xFE , 0x76 , 0xFE , 0x76 , 0xFE , 0x95 , 0xFE , 0x95 , 0xFE , 0xA7 , 0xFE , 0xA7 , 0xFE , +0xBD , 0xFE , 0xBD , 0xFE , 0xD7 , 0xFE , 0xD7 , 0xFE , 0xE8 , 0xFE , 0xE8 , 0xFE , 0x0E , 0xFF , 0x0E , 0xFF , +0x4C , 0xFF , 0x4C , 0xFF , 0xA9 , 0xFF , 0xA9 , 0xFF , 0x22 , 0x00 , 0x22 , 0x00 , 0xB6 , 0x00 , 0xB6 , 0x00 , +0x58 , 0x01 , 0x58 , 0x01 , 0x04 , 0x02 , 0x04 , 0x02 , 0xB6 , 0x02 , 0xB6 , 0x02 , 0x5B , 0x03 , 0x5B , 0x03 , +0xDB , 0x03 , 0xDB , 0x03 , 0x4D , 0x04 , 0x4D , 0x04 , 0xA4 , 0x04 , 0xA4 , 0x04 , 0xCB , 0x04 , 0xCB , 0x04 , +0xEA , 0x04 , 0xEA , 0x04 , 0xE5 , 0x04 , 0xE5 , 0x04 , 0xC9 , 0x04 , 0xC9 , 0x04 , 0x9A , 0x04 , 0x9A , 0x04 , +0x49 , 0x04 , 0x49 , 0x04 , 0xF6 , 0x03 , 0xF6 , 0x03 , 0x90 , 0x03 , 0x90 , 0x03 , 0x18 , 0x03 , 0x18 , 0x03 , +0x90 , 0x02 , 0x90 , 0x02 , 0xFB , 0x01 , 0xFB , 0x01 , 0x59 , 0x01 , 0x59 , 0x01 , 0xAF , 0x00 , 0xAF , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0x5C , 0xFF , 0x5C , 0xFF , 0xBB , 0xFE , 0xBB , 0xFE , 0x2D , 0xFE , 0x2D , 0xFE , +0xA7 , 0xFD , 0xA7 , 0xFD , 0x35 , 0xFD , 0x35 , 0xFD , 0xD0 , 0xFC , 0xD0 , 0xFC , 0x7C , 0xFC , 0x7C , 0xFC , +0x47 , 0xFC , 0x47 , 0xFC , 0x27 , 0xFC , 0x27 , 0xFC , 0x23 , 0xFC , 0x23 , 0xFC , 0x34 , 0xFC , 0x34 , 0xFC , +0x59 , 0xFC , 0x59 , 0xFC , 0x8A , 0xFC , 0x8A , 0xFC , 0xC8 , 0xFC , 0xC8 , 0xFC , 0x13 , 0xFD , 0x13 , 0xFD , +0x64 , 0xFD , 0x64 , 0xFD , 0xB7 , 0xFD , 0xB7 , 0xFD , 0x14 , 0xFE , 0x14 , 0xFE , 0x5E , 0xFE , 0x5E , 0xFE , +0xA6 , 0xFE , 0xA6 , 0xFE , 0xE7 , 0xFE , 0xE7 , 0xFE , 0x13 , 0xFF , 0x13 , 0xFF , 0x2F , 0xFF , 0x2F , 0xFF , +0x40 , 0xFF , 0x40 , 0xFF , 0x51 , 0xFF , 0x51 , 0xFF , 0x58 , 0xFF , 0x58 , 0xFF , 0x76 , 0xFF , 0x76 , 0xFF , +0x8F , 0xFF , 0x8F , 0xFF , 0xAA , 0xFF , 0xAA , 0xFF , 0xDE , 0xFF , 0xDE , 0xFF , 0x25 , 0x00 , 0x25 , 0x00 , +0x82 , 0x00 , 0x82 , 0x00 , 0xF2 , 0x00 , 0xF2 , 0x00 , 0x70 , 0x01 , 0x70 , 0x01 , 0xEF , 0x01 , 0xEF , 0x01 , +0x6B , 0x02 , 0x6B , 0x02 , 0xE6 , 0x02 , 0xE6 , 0x02 , 0x42 , 0x03 , 0x42 , 0x03 , 0x7A , 0x03 , 0x7A , 0x03 , +0xB0 , 0x03 , 0xB0 , 0x03 , 0xCB , 0x03 , 0xCB , 0x03 , 0xBC , 0x03 , 0xBC , 0x03 , 0xB1 , 0x03 , 0xB1 , 0x03 , +0x80 , 0x03 , 0x80 , 0x03 , 0x51 , 0x03 , 0x51 , 0x03 , 0x0F , 0x03 , 0x0F , 0x03 , 0xB9 , 0x02 , 0xB9 , 0x02 , +0x60 , 0x02 , 0x60 , 0x02 , 0xE0 , 0x01 , 0xE0 , 0x01 , 0x7C , 0x01 , 0x7C , 0x01 , 0x0A , 0x01 , 0x0A , 0x01 , +0x9A , 0x00 , 0x9A , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0xAC , 0xFF , 0xAC , 0xFF , 0x34 , 0xFF , 0x34 , 0xFF , +0xC8 , 0xFE , 0xC8 , 0xFE , 0x6A , 0xFE , 0x6A , 0xFE , 0x10 , 0xFE , 0x10 , 0xFE , 0xCA , 0xFD , 0xCA , 0xFD , +0x9A , 0xFD , 0x9A , 0xFD , 0x67 , 0xFD , 0x67 , 0xFD , 0x4E , 0xFD , 0x4E , 0xFD , 0x2E , 0xFD , 0x2E , 0xFD , +0x28 , 0xFD , 0x28 , 0xFD , 0x31 , 0xFD , 0x31 , 0xFD , 0x4A , 0xFD , 0x4A , 0xFD , 0x6F , 0xFD , 0x6F , 0xFD , +0xAA , 0xFD , 0xAA , 0xFD , 0xDF , 0xFD , 0xDF , 0xFD , 0x26 , 0xFE , 0x26 , 0xFE , 0x60 , 0xFE , 0x60 , 0xFE , +0xA3 , 0xFE , 0xA3 , 0xFE , 0xCE , 0xFE , 0xCE , 0xFE , 0x03 , 0xFF , 0x03 , 0xFF , 0x3B , 0xFF , 0x3B , 0xFF , +0x6A , 0xFF , 0x6A , 0xFF , 0x8B , 0xFF , 0x8B , 0xFF , 0xA9 , 0xFF , 0xA9 , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , +0xBC , 0xFF , 0xBC , 0xFF , 0xC3 , 0xFF , 0xC3 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , +0x15 , 0x00 , 0x15 , 0x00 , 0x5C , 0x00 , 0x5C , 0x00 , 0x93 , 0x00 , 0x93 , 0x00 , 0xFA , 0x00 , 0xFA , 0x00 , +0x28 , 0x01 , 0x28 , 0x01 , 0xBC , 0x01 , 0xBC , 0x01 , 0x38 , 0x02 , 0x38 , 0x02 , 0x8A , 0x02 , 0x8A , 0x02 , +0x9E , 0x02 , 0x9E , 0x02 , 0x22 , 0x03 , 0x22 , 0x03 , 0x95 , 0x03 , 0x95 , 0x03 , 0xA3 , 0x03 , 0xA3 , 0x03 , +0x34 , 0x03 , 0x34 , 0x03 , 0xF5 , 0x02 , 0xF5 , 0x02 , 0x84 , 0x02 , 0x84 , 0x02 , 0x3B , 0x02 , 0x3B , 0x02 , +0xB6 , 0x01 , 0xB6 , 0x01 , 0x88 , 0x01 , 0x88 , 0x01 , 0x93 , 0x00 , 0x93 , 0x00 , 0xBE , 0xFF , 0xBE , 0xFF , +0x09 , 0xFF , 0x09 , 0xFF , 0x8B , 0xFE , 0x8B , 0xFE , 0xC4 , 0xFD , 0xC4 , 0xFD , 0xC1 , 0xFD , 0xC1 , 0xFD , +0x6D , 0xFE , 0x6D , 0xFE , 0xE6 , 0xFD , 0xE6 , 0xFD , 0x77 , 0xFD , 0x77 , 0xFD , 0x46 , 0xFD , 0x46 , 0xFD , +0x8C , 0xFD , 0x8C , 0xFD , 0x60 , 0xFD , 0x60 , 0xFD , 0xCD , 0xFD , 0xCD , 0xFD , 0xF1 , 0xFD , 0xF1 , 0xFD , +0x2E , 0xFE , 0x2E , 0xFE , 0x5D , 0xFE , 0x5D , 0xFE , 0xB6 , 0xFE , 0xB6 , 0xFE , 0xE9 , 0xFE , 0xE9 , 0xFE , +0x26 , 0xFF , 0x26 , 0xFF , 0x66 , 0xFF , 0x66 , 0xFF , 0xE3 , 0xFE , 0xE3 , 0xFE , 0xEB , 0xFE , 0xEB , 0xFE , +0xF2 , 0xFE , 0xF2 , 0xFE , 0xD1 , 0xFE , 0xD1 , 0xFE , 0xDC , 0xFE , 0xDC , 0xFE , 0xCA , 0xFE , 0xCA , 0xFE , +0xDC , 0xFE , 0xDC , 0xFE , 0xB5 , 0xFE , 0xB5 , 0xFE , 0x0D , 0xFF , 0x0D , 0xFF , 0x69 , 0xFE , 0x69 , 0xFE , +0x29 , 0xFE , 0x29 , 0xFE , 0x50 , 0xFD , 0x50 , 0xFD , 0x5F , 0xFD , 0x5F , 0xFD , 0xC2 , 0xFD , 0xC2 , 0xFD , +0x66 , 0xFE , 0x66 , 0xFE , 0x23 , 0xFF , 0x23 , 0xFF , 0x8C , 0xFF , 0x8C , 0xFF , 0x2A , 0x00 , 0x2A , 0x00 , +0x9F , 0x00 , 0x9F , 0x00 , 0x68 , 0x01 , 0x68 , 0x01 , 0xE3 , 0x01 , 0xE3 , 0x01 , 0x0A , 0x02 , 0x0A , 0x02 , +0xE2 , 0x02 , 0xE2 , 0x02 , 0xF9 , 0x03 , 0xF9 , 0x03 , 0xF3 , 0x04 , 0xF3 , 0x04 , 0x09 , 0x05 , 0x09 , 0x05 , +0x0B , 0x05 , 0x0B , 0x05 , 0x20 , 0x05 , 0x20 , 0x05 , 0xD8 , 0x04 , 0xD8 , 0x04 , 0x7C , 0x04 , 0x7C , 0x04 , +0x0D , 0x04 , 0x0D , 0x04 , 0x93 , 0x03 , 0x93 , 0x03 , 0x72 , 0x02 , 0x72 , 0x02 , 0xD2 , 0x01 , 0xD2 , 0x01 , +0x08 , 0x01 , 0x08 , 0x01 , 0x6A , 0x00 , 0x6A , 0x00 , 0x88 , 0xFF , 0x88 , 0xFF , 0xE1 , 0xFF , 0xE1 , 0xFF , +0x85 , 0xFF , 0x85 , 0xFF , 0xDD , 0xFE , 0xDD , 0xFE , 0x5D , 0xFE , 0x5D , 0xFE , 0x7F , 0xFF , 0x7F , 0xFF , +0xC6 , 0xFE , 0xC6 , 0xFE , 0x40 , 0xFE , 0x40 , 0xFE , 0x01 , 0xFE , 0x01 , 0xFE , 0x3A , 0xFD , 0x3A , 0xFD , +0x5E , 0xFC , 0x5E , 0xFC , 0x31 , 0xFC , 0x31 , 0xFC , 0x89 , 0xFC , 0x89 , 0xFC , 0x3B , 0xFC , 0x3B , 0xFC , +0xCC , 0xFB , 0xCC , 0xFB , 0x19 , 0xFC , 0x19 , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0x7F , 0xFC , 0x7F , 0xFC , +0xC7 , 0xFC , 0xC7 , 0xFC , 0x55 , 0xFD , 0x55 , 0xFD , 0x2F , 0xFD , 0x2F , 0xFD , 0xCF , 0xFC , 0xCF , 0xFC , +0xB6 , 0xFD , 0xB6 , 0xFD , 0xD0 , 0xFC , 0xD0 , 0xFC , 0x8B , 0xFC , 0x8B , 0xFC , 0xB1 , 0xFB , 0xB1 , 0xFB , +0xAD , 0xFB , 0xAD , 0xFB , 0x28 , 0xFC , 0x28 , 0xFC , 0xF7 , 0xFC , 0xF7 , 0xFC , 0x3A , 0xFE , 0x3A , 0xFE , +0xF0 , 0xFE , 0xF0 , 0xFE , 0xAC , 0x00 , 0xAC , 0x00 , 0x41 , 0x02 , 0x41 , 0x02 , 0xF7 , 0x03 , 0xF7 , 0x03 , +0x52 , 0x05 , 0x52 , 0x05 , 0xCA , 0x06 , 0xCA , 0x06 , 0xF2 , 0x07 , 0xF2 , 0x07 , 0xFE , 0x08 , 0xFE , 0x08 , +0x63 , 0x0A , 0x63 , 0x0A , 0x69 , 0x0A , 0x69 , 0x0A , 0x15 , 0x0A , 0x15 , 0x0A , 0xE2 , 0x09 , 0xE2 , 0x09 , +0xE0 , 0x08 , 0xE0 , 0x08 , 0xCF , 0x07 , 0xCF , 0x07 , 0x93 , 0x06 , 0x93 , 0x06 , 0x73 , 0x05 , 0x73 , 0x05 , +0xA0 , 0x03 , 0xA0 , 0x03 , 0x62 , 0x02 , 0x62 , 0x02 , 0x0D , 0x01 , 0x0D , 0x01 , 0xE5 , 0xFF , 0xE5 , 0xFF , +0xDF , 0xFE , 0xDF , 0xFE , 0x36 , 0xFE , 0x36 , 0xFE , 0x28 , 0xFD , 0x28 , 0xFD , 0x25 , 0xFD , 0x25 , 0xFD , +0x5F , 0xFD , 0x5F , 0xFD , 0x21 , 0xFC , 0x21 , 0xFC , 0x52 , 0xFC , 0x52 , 0xFC , 0x13 , 0xFC , 0x13 , 0xFC , +0x5C , 0xFB , 0x5C , 0xFB , 0x1F , 0xFB , 0x1F , 0xFB , 0xA6 , 0xFB , 0xA6 , 0xFB , 0x7E , 0xFB , 0x7E , 0xFB , +0x38 , 0xFB , 0x38 , 0xFB , 0x47 , 0xFB , 0x47 , 0xFB , 0xD0 , 0xFB , 0xD0 , 0xFB , 0x34 , 0xFC , 0x34 , 0xFC , +0xE9 , 0xFB , 0xE9 , 0xFB , 0xED , 0xFB , 0xED , 0xFB , 0xEE , 0xFB , 0xEE , 0xFB , 0xD3 , 0xFA , 0xD3 , 0xFA , +0x65 , 0xFA , 0x65 , 0xFA , 0x18 , 0xFA , 0x18 , 0xFA , 0x32 , 0xF9 , 0x32 , 0xF9 , 0xB5 , 0xF8 , 0xB5 , 0xF8 , +0xD9 , 0xF7 , 0xD9 , 0xF7 , 0xBA , 0xF7 , 0xBA , 0xF7 , 0x2A , 0xF7 , 0x2A , 0xF7 , 0x26 , 0xF8 , 0x26 , 0xF8 , +0x13 , 0xFA , 0x13 , 0xFA , 0x92 , 0xFB , 0x92 , 0xFB , 0xDC , 0xFE , 0xDC , 0xFE , 0xB4 , 0x02 , 0xB4 , 0x02 , +0x1F , 0x06 , 0x1F , 0x06 , 0xDF , 0x09 , 0xDF , 0x09 , 0xC6 , 0x0D , 0xC6 , 0x0D , 0x6C , 0x10 , 0x6C , 0x10 , +0xF7 , 0x12 , 0xF7 , 0x12 , 0x24 , 0x15 , 0x24 , 0x15 , 0x33 , 0x15 , 0x33 , 0x15 , 0xF7 , 0x14 , 0xF7 , 0x14 , +0xD9 , 0x13 , 0xD9 , 0x13 , 0x53 , 0x11 , 0x53 , 0x11 , 0x2D , 0x0E , 0x2D , 0x0E , 0xC3 , 0x0A , 0xC3 , 0x0A , +0x94 , 0x06 , 0x94 , 0x06 , 0x6B , 0x02 , 0x6B , 0x02 , 0x6A , 0xFE , 0x6A , 0xFE , 0x00 , 0xFB , 0x00 , 0xFB , +0x33 , 0xF8 , 0x33 , 0xF8 , 0x1C , 0xF5 , 0x1C , 0xF5 , 0xA1 , 0xF3 , 0xA1 , 0xF3 , 0xCC , 0xF2 , 0xCC , 0xF2 , +0x45 , 0xF2 , 0x45 , 0xF2 , 0x8A , 0xF2 , 0x8A , 0xF2 , 0xEC , 0xF3 , 0xEC , 0xF3 , 0x74 , 0xF5 , 0x74 , 0xF5 , +0xC8 , 0xF6 , 0xC8 , 0xF6 , 0xD8 , 0xF8 , 0xD8 , 0xF8 , 0x15 , 0xFB , 0x15 , 0xFB , 0x80 , 0xFC , 0x80 , 0xFC , +0xE1 , 0xFD , 0xE1 , 0xFD , 0xC3 , 0xFE , 0xC3 , 0xFE , 0x08 , 0xFF , 0x08 , 0xFF , 0x79 , 0xFE , 0x79 , 0xFE , +0xCB , 0xFD , 0xCB , 0xFD , 0xAC , 0xFC , 0xAC , 0xFC , 0x97 , 0xFA , 0x97 , 0xFA , 0xFF , 0xF8 , 0xFF , 0xF8 , +0xD1 , 0xF6 , 0xD1 , 0xF6 , 0xAF , 0xF4 , 0xAF , 0xF4 , 0xD7 , 0xF2 , 0xD7 , 0xF2 , 0xB8 , 0xF1 , 0xB8 , 0xF1 , +0x7E , 0xF1 , 0x7E , 0xF1 , 0x40 , 0xF1 , 0x40 , 0xF1 , 0x49 , 0xF3 , 0x49 , 0xF3 , 0x70 , 0xF7 , 0x70 , 0xF7 , +0x99 , 0xFA , 0x99 , 0xFA , 0x5F , 0xFF , 0x5F , 0xFF , 0xAE , 0x05 , 0xAE , 0x05 , 0x27 , 0x0A , 0x27 , 0x0A , +0x68 , 0x0E , 0x68 , 0x0E , 0x17 , 0x14 , 0x17 , 0x14 , 0x52 , 0x17 , 0x52 , 0x17 , 0x71 , 0x19 , 0x71 , 0x19 , +0xDE , 0x1B , 0xDE , 0x1B , 0xFA , 0x1B , 0xFA , 0x1B , 0x79 , 0x1A , 0x79 , 0x1A , 0x35 , 0x18 , 0x35 , 0x18 , +0x16 , 0x15 , 0x16 , 0x15 , 0x74 , 0x10 , 0x74 , 0x10 , 0x37 , 0x0B , 0x37 , 0x0B , 0x79 , 0x06 , 0x79 , 0x06 , +0x8C , 0x01 , 0x8C , 0x01 , 0x36 , 0xFC , 0x36 , 0xFC , 0xE7 , 0xF8 , 0xE7 , 0xF8 , 0xCD , 0xF5 , 0xCD , 0xF5 , +0xA4 , 0xF2 , 0xA4 , 0xF2 , 0xCA , 0xF1 , 0xCA , 0xF1 , 0xD4 , 0xF1 , 0xD4 , 0xF1 , 0xA2 , 0xF1 , 0xA2 , 0xF1 , +0xDE , 0xF2 , 0xDE , 0xF2 , 0x6C , 0xF5 , 0x6C , 0xF5 , 0x5A , 0xF7 , 0x5A , 0xF7 , 0x1E , 0xF9 , 0x1E , 0xF9 , +0x17 , 0xFC , 0x17 , 0xFC , 0x4B , 0xFE , 0x4B , 0xFE , 0x39 , 0xFF , 0x39 , 0xFF , 0x98 , 0x00 , 0x98 , 0x00 , +0x50 , 0x01 , 0x50 , 0x01 , 0xA4 , 0x00 , 0xA4 , 0x00 , 0xBC , 0xFF , 0xBC , 0xFF , 0x06 , 0xFF , 0x06 , 0xFF , +0xCF , 0xFC , 0xCF , 0xFC , 0x5F , 0xFA , 0x5F , 0xFA , 0xB5 , 0xF8 , 0xB5 , 0xF8 , 0x6B , 0xF6 , 0x6B , 0xF6 , +0x25 , 0xF4 , 0x25 , 0xF4 , 0xB2 , 0xF2 , 0xB2 , 0xF2 , 0xED , 0xF1 , 0xED , 0xF1 , 0x1E , 0xF1 , 0x1E , 0xF1 , +0x39 , 0xF1 , 0x39 , 0xF1 , 0x0F , 0xF5 , 0x0F , 0xF5 , 0x18 , 0xF8 , 0x18 , 0xF8 , 0x6B , 0xFA , 0x6B , 0xFA , +0x37 , 0x01 , 0x37 , 0x01 , 0x9C , 0x06 , 0x9C , 0x06 , 0xE8 , 0x08 , 0xE8 , 0x08 , 0x52 , 0x0F , 0x52 , 0x0F , +0x5C , 0x14 , 0x5C , 0x14 , 0x2E , 0x15 , 0x2E , 0x15 , 0x3C , 0x18 , 0x3C , 0x18 , 0x6E , 0x1A , 0x6E , 0x1A , +0x74 , 0x18 , 0x74 , 0x18 , 0x99 , 0x16 , 0x99 , 0x16 , 0x7D , 0x15 , 0x7D , 0x15 , 0xF5 , 0x10 , 0xF5 , 0x10 , +0x56 , 0x0B , 0x56 , 0x0B , 0xD0 , 0x07 , 0xD0 , 0x07 , 0x3B , 0x03 , 0x3B , 0x03 , 0x03 , 0xFD , 0x03 , 0xFD , +0xE0 , 0xF9 , 0xE0 , 0xF9 , 0x38 , 0xF7 , 0x38 , 0xF7 , 0x3D , 0xF3 , 0x3D , 0xF3 , 0x01 , 0xF2 , 0x01 , 0xF2 , +0x63 , 0xF2 , 0x63 , 0xF2 , 0x6E , 0xF1 , 0x6E , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xBA , 0xF4 , 0xBA , 0xF4 , +0x48 , 0xF6 , 0x48 , 0xF6 , 0x94 , 0xF7 , 0x94 , 0xF7 , 0xBD , 0xFA , 0xBD , 0xFA , 0x1D , 0xFD , 0x1D , 0xFD , +0xE3 , 0xFD , 0xE3 , 0xFD , 0x71 , 0xFF , 0x71 , 0xFF , 0xB7 , 0x00 , 0xB7 , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , +0x61 , 0xFF , 0x61 , 0xFF , 0x0F , 0xFF , 0x0F , 0xFF , 0xCF , 0xFC , 0xCF , 0xFC , 0x80 , 0xFA , 0x80 , 0xFA , +0x54 , 0xF9 , 0x54 , 0xF9 , 0xE6 , 0xF6 , 0xE6 , 0xF6 , 0xAB , 0xF4 , 0xAB , 0xF4 , 0x9C , 0xF3 , 0x9C , 0xF3 , +0xA7 , 0xF2 , 0xA7 , 0xF2 , 0x68 , 0xF1 , 0x68 , 0xF1 , 0x84 , 0xF2 , 0x84 , 0xF2 , 0x5F , 0xF6 , 0x5F , 0xF6 , +0x2A , 0xF8 , 0x2A , 0xF8 , 0x70 , 0xFB , 0x70 , 0xFB , 0x55 , 0x02 , 0x55 , 0x02 , 0x08 , 0x06 , 0x08 , 0x06 , +0x52 , 0x09 , 0x52 , 0x09 , 0x52 , 0x10 , 0x52 , 0x10 , 0x7D , 0x13 , 0x7D , 0x13 , 0xEB , 0x14 , 0xEB , 0x14 , +0xA4 , 0x18 , 0xA4 , 0x18 , 0x7F , 0x19 , 0x7F , 0x19 , 0x52 , 0x17 , 0x52 , 0x17 , 0x98 , 0x16 , 0x98 , 0x16 , +0xEF , 0x14 , 0xEF , 0x14 , 0xC3 , 0x0F , 0xC3 , 0x0F , 0x31 , 0x0B , 0x31 , 0x0B , 0x04 , 0x08 , 0x04 , 0x08 , +0x7D , 0x02 , 0x7D , 0x02 , 0x05 , 0xFD , 0x05 , 0xFD , 0x9B , 0xFA , 0x9B , 0xFA , 0xE7 , 0xF6 , 0xE7 , 0xF6 , +0x4F , 0xF3 , 0x4F , 0xF3 , 0xD3 , 0xF2 , 0xD3 , 0xF2 , 0x5A , 0xF2 , 0x5A , 0xF2 , 0x35 , 0xF1 , 0x35 , 0xF1 , +0x91 , 0xF2 , 0x91 , 0xF2 , 0x80 , 0xF4 , 0x80 , 0xF4 , 0x51 , 0xF5 , 0x51 , 0xF5 , 0x3D , 0xF7 , 0x3D , 0xF7 , +0x21 , 0xFA , 0x21 , 0xFA , 0x8D , 0xFB , 0x8D , 0xFB , 0xCB , 0xFC , 0xCB , 0xFC , 0x8C , 0xFE , 0x8C , 0xFE , +0x8C , 0xFF , 0x8C , 0xFF , 0x6A , 0xFF , 0x6A , 0xFF , 0x37 , 0xFF , 0x37 , 0xFF , 0x0F , 0xFF , 0x0F , 0xFF , +0x16 , 0xFD , 0x16 , 0xFD , 0x3C , 0xFB , 0x3C , 0xFB , 0x7D , 0xFA , 0x7D , 0xFA , 0x65 , 0xF8 , 0x65 , 0xF8 , +0xA3 , 0xF6 , 0xA3 , 0xF6 , 0x1A , 0xF6 , 0x1A , 0xF6 , 0x25 , 0xF5 , 0x25 , 0xF5 , 0x31 , 0xF4 , 0x31 , 0xF4 , +0xFA , 0xF4 , 0xFA , 0xF4 , 0x77 , 0xF8 , 0x77 , 0xF8 , 0x68 , 0xFA , 0x68 , 0xFA , 0xAD , 0xFC , 0xAD , 0xFC , +0xC8 , 0x02 , 0xC8 , 0x02 , 0xCA , 0x06 , 0xCA , 0x06 , 0x06 , 0x09 , 0x06 , 0x09 , 0x33 , 0x0F , 0x33 , 0x0F , +0xE8 , 0x12 , 0xE8 , 0x12 , 0xD1 , 0x13 , 0xD1 , 0x13 , 0x0A , 0x17 , 0x0A , 0x17 , 0x5E , 0x18 , 0x5E , 0x18 , +0x62 , 0x16 , 0x62 , 0x16 , 0x70 , 0x15 , 0x70 , 0x15 , 0x4D , 0x14 , 0x4D , 0x14 , 0xF8 , 0x0F , 0xF8 , 0x0F , +0x73 , 0x0B , 0x73 , 0x0B , 0x58 , 0x08 , 0x58 , 0x08 , 0xB9 , 0x03 , 0xB9 , 0x03 , 0x5C , 0xFE , 0x5C , 0xFE , +0x96 , 0xFB , 0x96 , 0xFB , 0xA6 , 0xF8 , 0xA6 , 0xF8 , 0x0C , 0xF5 , 0x0C , 0xF5 , 0xF1 , 0xF3 , 0xF1 , 0xF3 , +0xED , 0xF3 , 0xED , 0xF3 , 0xF6 , 0xF2 , 0xF6 , 0xF2 , 0x8C , 0xF3 , 0x8C , 0xF3 , 0xA2 , 0xF5 , 0xA2 , 0xF5 , +0xA2 , 0xF6 , 0xA2 , 0xF6 , 0xD7 , 0xF7 , 0xD7 , 0xF7 , 0x79 , 0xFA , 0x79 , 0xFA , 0x0E , 0xFC , 0x0E , 0xFC , +0xC0 , 0xFC , 0xC0 , 0xFC , 0x57 , 0xFE , 0x57 , 0xFE , 0x53 , 0xFF , 0x53 , 0xFF , 0xD5 , 0xFE , 0xD5 , 0xFE , +0xFA , 0xFE , 0xFA , 0xFE , 0xDA , 0xFE , 0xDA , 0xFE , 0x2F , 0xFD , 0x2F , 0xFD , 0xE5 , 0xFB , 0xE5 , 0xFB , +0xC3 , 0xFA , 0xC3 , 0xFA , 0xC0 , 0xF8 , 0xC0 , 0xF8 , 0x98 , 0xF7 , 0x98 , 0xF7 , 0x07 , 0xF7 , 0x07 , 0xF7 , +0x20 , 0xF6 , 0x20 , 0xF6 , 0x80 , 0xF5 , 0x80 , 0xF5 , 0xFA , 0xF5 , 0xFA , 0xF5 , 0x06 , 0xF6 , 0x06 , 0xF6 , +0x0B , 0xF7 , 0x0B , 0xF7 , 0xC3 , 0xFA , 0xC3 , 0xFA , 0xCD , 0xFC , 0xCD , 0xFC , 0xF4 , 0xFE , 0xF4 , 0xFE , +0x47 , 0x04 , 0x47 , 0x04 , 0x50 , 0x07 , 0x50 , 0x07 , 0x46 , 0x09 , 0x46 , 0x09 , 0x66 , 0x0E , 0x66 , 0x0E , +0x06 , 0x11 , 0x06 , 0x11 , 0xA8 , 0x11 , 0xA8 , 0x11 , 0x28 , 0x14 , 0x28 , 0x14 , 0xEA , 0x14 , 0xEA , 0x14 , +0xAA , 0x12 , 0xAA , 0x12 , 0xFC , 0x11 , 0xFC , 0x11 , 0xDD , 0x10 , 0xDD , 0x10 , 0xAF , 0x0C , 0xAF , 0x0C , +0x41 , 0x09 , 0x41 , 0x09 , 0xC6 , 0x06 , 0xC6 , 0x06 , 0x5E , 0x02 , 0x5E , 0x02 , 0x3D , 0xFE , 0x3D , 0xFE , +0x14 , 0xFC , 0x14 , 0xFC , 0x2D , 0xF9 , 0x2D , 0xF9 , 0x46 , 0xF6 , 0x46 , 0xF6 , 0xAB , 0xF5 , 0xAB , 0xF5 , +0x31 , 0xF5 , 0x31 , 0xF5 , 0x48 , 0xF4 , 0x48 , 0xF4 , 0x31 , 0xF5 , 0x31 , 0xF5 , 0xB6 , 0xF6 , 0xB6 , 0xF6 , +0x1C , 0xF7 , 0x1C , 0xF7 , 0x82 , 0xF8 , 0x82 , 0xF8 , 0x9E , 0xFA , 0x9E , 0xFA , 0x71 , 0xFB , 0x71 , 0xFB , +0x47 , 0xFC , 0x47 , 0xFC , 0xC5 , 0xFD , 0xC5 , 0xFD , 0x3A , 0xFE , 0x3A , 0xFE , 0x27 , 0xFE , 0x27 , 0xFE , +0xCA , 0xFE , 0xCA , 0xFE , 0x55 , 0xFE , 0x55 , 0xFE , 0x74 , 0xFD , 0x74 , 0xFD , 0x93 , 0xFC , 0x93 , 0xFC , +0x62 , 0xFB , 0x62 , 0xFB , 0x4D , 0xFA , 0x4D , 0xFA , 0x87 , 0xF9 , 0x87 , 0xF9 , 0x9E , 0xF8 , 0x9E , 0xF8 , +0x19 , 0xF8 , 0x19 , 0xF8 , 0x82 , 0xF7 , 0x82 , 0xF7 , 0x72 , 0xF7 , 0x72 , 0xF7 , 0x7A , 0xF7 , 0x7A , 0xF7 , +0x74 , 0xF8 , 0x74 , 0xF8 , 0xAB , 0xFB , 0xAB , 0xFB , 0x6A , 0xFD , 0x6A , 0xFD , 0x56 , 0xFF , 0x56 , 0xFF , +0x3D , 0x04 , 0x3D , 0x04 , 0xFE , 0x06 , 0xFE , 0x06 , 0xCD , 0x08 , 0xCD , 0x08 , 0xBE , 0x0D , 0xBE , 0x0D , +0x42 , 0x10 , 0x42 , 0x10 , 0xE9 , 0x10 , 0xE9 , 0x10 , 0x99 , 0x13 , 0x99 , 0x13 , 0xB7 , 0x14 , 0xB7 , 0x14 , +0xAB , 0x12 , 0xAB , 0x12 , 0x10 , 0x12 , 0x10 , 0x12 , 0x61 , 0x11 , 0x61 , 0x11 , 0x3C , 0x0D , 0x3C , 0x0D , +0x78 , 0x09 , 0x78 , 0x09 , 0x71 , 0x07 , 0x71 , 0x07 , 0x42 , 0x03 , 0x42 , 0x03 , 0x98 , 0xFE , 0x98 , 0xFE , +0xBA , 0xFC , 0xBA , 0xFC , 0x1C , 0xFA , 0x1C , 0xFA , 0x9C , 0xF6 , 0x9C , 0xF6 , 0xEE , 0xF5 , 0xEE , 0xF5 , +0xB9 , 0xF5 , 0xB9 , 0xF5 , 0x4B , 0xF4 , 0x4B , 0xF4 , 0xF4 , 0xF4 , 0xF4 , 0xF4 , 0xB5 , 0xF6 , 0xB5 , 0xF6 , +0xF3 , 0xF6 , 0xF3 , 0xF6 , 0x17 , 0xF8 , 0x17 , 0xF8 , 0x78 , 0xFA , 0x78 , 0xFA , 0x71 , 0xFB , 0x71 , 0xFB , +0xFE , 0xFB , 0xFE , 0xFB , 0x8A , 0xFD , 0x8A , 0xFD , 0x62 , 0xFE , 0x62 , 0xFE , 0x23 , 0xFE , 0x23 , 0xFE , +0xB9 , 0xFE , 0xB9 , 0xFE , 0xCF , 0xFE , 0xCF , 0xFE , 0xE4 , 0xFD , 0xE4 , 0xFD , 0x18 , 0xFD , 0x18 , 0xFD , +0x20 , 0xFC , 0x20 , 0xFC , 0xF8 , 0xFA , 0xF8 , 0xFA , 0x1F , 0xFA , 0x1F , 0xFA , 0x53 , 0xF9 , 0x53 , 0xF9 , +0xAD , 0xF8 , 0xAD , 0xF8 , 0x2A , 0xF8 , 0x2A , 0xF8 , 0xB5 , 0xF7 , 0xB5 , 0xF7 , 0xF5 , 0xF7 , 0xF5 , 0xF7 , +0x1B , 0xF8 , 0x1B , 0xF8 , 0x1F , 0xFA , 0x1F , 0xFA , 0x2F , 0xFD , 0x2F , 0xFD , 0x85 , 0xFE , 0x85 , 0xFE , +0x85 , 0x01 , 0x85 , 0x01 , 0x10 , 0x06 , 0x10 , 0x06 , 0xE6 , 0x07 , 0xE6 , 0x07 , 0xAA , 0x0A , 0xAA , 0x0A , +0xDF , 0x0E , 0xDF , 0x0E , 0x55 , 0x10 , 0x55 , 0x10 , 0x56 , 0x11 , 0x56 , 0x11 , 0x8F , 0x13 , 0x8F , 0x13 , +0x7B , 0x13 , 0x7B , 0x13 , 0x68 , 0x11 , 0x68 , 0x11 , 0xDC , 0x10 , 0xDC , 0x10 , 0x36 , 0x0F , 0x36 , 0x0F , +0x08 , 0x0B , 0x08 , 0x0B , 0xE6 , 0x07 , 0xE6 , 0x07 , 0x98 , 0x05 , 0x98 , 0x05 , 0x54 , 0x01 , 0x54 , 0x01 , +0x9A , 0xFD , 0x9A , 0xFD , 0xDF , 0xFB , 0xDF , 0xFB , 0x7E , 0xF9 , 0x7E , 0xF9 , 0x11 , 0xF7 , 0x11 , 0xF7 , +0x9A , 0xF6 , 0x9A , 0xF6 , 0x68 , 0xF6 , 0x68 , 0xF6 , 0xD8 , 0xF5 , 0xD8 , 0xF5 , 0x8D , 0xF6 , 0x8D , 0xF6 , +0x03 , 0xF8 , 0x03 , 0xF8 , 0xD4 , 0xF8 , 0xD4 , 0xF8 , 0xEC , 0xF9 , 0xEC , 0xF9 , 0x83 , 0xFB , 0x83 , 0xFB , +0x9C , 0xFC , 0x9C , 0xFC , 0x06 , 0xFD , 0x06 , 0xFD , 0x8D , 0xFD , 0x8D , 0xFD , 0x2D , 0xFE , 0x2D , 0xFE , +0x16 , 0xFE , 0x16 , 0xFE , 0xF4 , 0xFD , 0xF4 , 0xFD , 0xB6 , 0xFD , 0xB6 , 0xFD , 0x3C , 0xFD , 0x3C , 0xFD , +0x48 , 0xFC , 0x48 , 0xFC , 0x2D , 0xFB , 0x2D , 0xFB , 0x85 , 0xFA , 0x85 , 0xFA , 0x17 , 0xFA , 0x17 , 0xFA , +0x4D , 0xF9 , 0x4D , 0xF9 , 0xD7 , 0xF8 , 0xD7 , 0xF8 , 0xDB , 0xF8 , 0xDB , 0xF8 , 0xAF , 0xF8 , 0xAF , 0xF8 , +0xD3 , 0xF8 , 0xD3 , 0xF8 , 0x61 , 0xF9 , 0x61 , 0xF9 , 0xA9 , 0xFB , 0xA9 , 0xFB , 0x6D , 0xFE , 0x6D , 0xFE , +0xDD , 0xFF , 0xDD , 0xFF , 0xAE , 0x02 , 0xAE , 0x02 , 0xC4 , 0x06 , 0xC4 , 0x06 , 0xCB , 0x08 , 0xCB , 0x08 , +0x00 , 0x0B , 0x00 , 0x0B , 0x5E , 0x0E , 0x5E , 0x0E , 0x30 , 0x10 , 0x30 , 0x10 , 0xAF , 0x10 , 0xAF , 0x10 , +0x95 , 0x11 , 0x95 , 0x11 , 0x92 , 0x11 , 0x92 , 0x11 , 0x89 , 0x0F , 0x89 , 0x0F , 0xA9 , 0x0D , 0xA9 , 0x0D , +0xD8 , 0x0B , 0xD8 , 0x0B , 0xA6 , 0x08 , 0xA6 , 0x08 , 0x29 , 0x05 , 0x29 , 0x05 , 0x90 , 0x02 , 0x90 , 0x02 , +0xB0 , 0xFF , 0xB0 , 0xFF , 0x97 , 0xFC , 0x97 , 0xFC , 0xA6 , 0xFA , 0xA6 , 0xFA , 0x5E , 0xF9 , 0x5E , 0xF9 , +0x31 , 0xF8 , 0x31 , 0xF8 , 0xBC , 0xF7 , 0xBC , 0xF7 , 0xAF , 0xF7 , 0xAF , 0xF7 , 0xE2 , 0xF7 , 0xE2 , 0xF7 , +0x8E , 0xF8 , 0x8E , 0xF8 , 0x70 , 0xF9 , 0x70 , 0xF9 , 0x78 , 0xFA , 0x78 , 0xFA , 0xA6 , 0xFB , 0xA6 , 0xFB , +0x92 , 0xFC , 0x92 , 0xFC , 0x4D , 0xFD , 0x4D , 0xFD , 0x00 , 0xFE , 0x00 , 0xFE , 0x20 , 0xFE , 0x20 , 0xFE , +0x08 , 0xFE , 0x08 , 0xFE , 0x0F , 0xFE , 0x0F , 0xFE , 0xDA , 0xFD , 0xDA , 0xFD , 0x79 , 0xFD , 0x79 , 0xFD , +0xD9 , 0xFC , 0xD9 , 0xFC , 0x23 , 0xFC , 0x23 , 0xFC , 0x54 , 0xFB , 0x54 , 0xFB , 0xC2 , 0xFA , 0xC2 , 0xFA , +0x68 , 0xFA , 0x68 , 0xFA , 0x2D , 0xFA , 0x2D , 0xFA , 0xF2 , 0xF9 , 0xF2 , 0xF9 , 0xF1 , 0xF9 , 0xF1 , 0xF9 , +0x07 , 0xFA , 0x07 , 0xFA , 0x42 , 0xFA , 0x42 , 0xFA , 0xB0 , 0xFA , 0xB0 , 0xFA , 0x6D , 0xFB , 0x6D , 0xFB , +0xBE , 0xFD , 0xBE , 0xFD , 0x0F , 0x00 , 0x0F , 0x00 , 0x31 , 0x01 , 0x31 , 0x01 , 0x6C , 0x03 , 0x6C , 0x03 , +0x8A , 0x06 , 0x8A , 0x06 , 0x7E , 0x08 , 0x7E , 0x08 , 0x48 , 0x0A , 0x48 , 0x0A , 0x64 , 0x0C , 0x64 , 0x0C , +0xF7 , 0x0D , 0xF7 , 0x0D , 0x99 , 0x0E , 0x99 , 0x0E , 0xAF , 0x0E , 0xAF , 0x0E , 0x5B , 0x0E , 0x5B , 0x0E , +0x4D , 0x0D , 0x4D , 0x0D , 0x4F , 0x0B , 0x4F , 0x0B , 0x3A , 0x09 , 0x3A , 0x09 , 0x1D , 0x07 , 0x1D , 0x07 , +0xA2 , 0x04 , 0xA2 , 0x04 , 0x32 , 0x02 , 0x32 , 0x02 , 0x34 , 0x00 , 0x34 , 0x00 , 0x97 , 0xFE , 0x97 , 0xFE , +0x1D , 0xFD , 0x1D , 0xFD , 0x0E , 0xFC , 0x0E , 0xFC , 0x4B , 0xFB , 0x4B , 0xFB , 0xE3 , 0xFA , 0xE3 , 0xFA , +0xAE , 0xFA , 0xAE , 0xFA , 0x89 , 0xFA , 0x89 , 0xFA , 0x9F , 0xFA , 0x9F , 0xFA , 0xFE , 0xFA , 0xFE , 0xFA , +0x61 , 0xFB , 0x61 , 0xFB , 0xE5 , 0xFB , 0xE5 , 0xFB , 0x73 , 0xFC , 0x73 , 0xFC , 0xD1 , 0xFC , 0xD1 , 0xFC , +0x1C , 0xFD , 0x1C , 0xFD , 0x60 , 0xFD , 0x60 , 0xFD , 0x44 , 0xFD , 0x44 , 0xFD , 0x2A , 0xFD , 0x2A , 0xFD , +0x27 , 0xFD , 0x27 , 0xFD , 0x10 , 0xFD , 0x10 , 0xFD , 0xF3 , 0xFC , 0xF3 , 0xFC , 0x9E , 0xFC , 0x9E , 0xFC , +0x2F , 0xFC , 0x2F , 0xFC , 0xCF , 0xFB , 0xCF , 0xFB , 0xC3 , 0xFB , 0xC3 , 0xFB , 0xCF , 0xFB , 0xCF , 0xFB , +0xBB , 0xFB , 0xBB , 0xFB , 0xA9 , 0xFB , 0xA9 , 0xFB , 0xEE , 0xFB , 0xEE , 0xFB , 0x06 , 0xFC , 0x06 , 0xFC , +0x09 , 0xFC , 0x09 , 0xFC , 0x3F , 0xFC , 0x3F , 0xFC , 0xC9 , 0xFC , 0xC9 , 0xFC , 0x67 , 0xFE , 0x67 , 0xFE , +0x00 , 0x00 , 0x00 , 0x00 , 0xCE , 0x00 , 0xCE , 0x00 , 0x03 , 0x02 , 0x03 , 0x02 , 0xCB , 0x03 , 0xCB , 0x03 , +0x73 , 0x05 , 0x73 , 0x05 , 0xDE , 0x06 , 0xDE , 0x06 , 0xED , 0x07 , 0xED , 0x07 , 0xE2 , 0x08 , 0xE2 , 0x08 , +0xA7 , 0x09 , 0xA7 , 0x09 , 0xD1 , 0x09 , 0xD1 , 0x09 , 0x66 , 0x09 , 0x66 , 0x09 , 0xC4 , 0x08 , 0xC4 , 0x08 , +0xCF , 0x07 , 0xCF , 0x07 , 0xBB , 0x06 , 0xBB , 0x06 , 0x79 , 0x05 , 0x79 , 0x05 , 0x19 , 0x04 , 0x19 , 0x04 , +0xCC , 0x02 , 0xCC , 0x02 , 0xC0 , 0x01 , 0xC0 , 0x01 , 0xEC , 0x00 , 0xEC , 0x00 , 0x26 , 0x00 , 0x26 , 0x00 , +0x77 , 0xFF , 0x77 , 0xFF , 0xC2 , 0xFE , 0xC2 , 0xFE , 0x32 , 0xFE , 0x32 , 0xFE , 0xCE , 0xFD , 0xCE , 0xFD , +0x6B , 0xFD , 0x6B , 0xFD , 0xF9 , 0xFC , 0xF9 , 0xFC , 0xC1 , 0xFC , 0xC1 , 0xFC , 0xA4 , 0xFC , 0xA4 , 0xFC , +0xA2 , 0xFC , 0xA2 , 0xFC , 0xA0 , 0xFC , 0xA0 , 0xFC , 0x9B , 0xFC , 0x9B , 0xFC , 0x92 , 0xFC , 0x92 , 0xFC , +0xA4 , 0xFC , 0xA4 , 0xFC , 0xA5 , 0xFC , 0xA5 , 0xFC , 0xBE , 0xFC , 0xBE , 0xFC , 0xCA , 0xFC , 0xCA , 0xFC , +0xDF , 0xFC , 0xDF , 0xFC , 0x03 , 0xFD , 0x03 , 0xFD , 0xFF , 0xFC , 0xFF , 0xFC , 0xE4 , 0xFC , 0xE4 , 0xFC , +0xCE , 0xFC , 0xCE , 0xFC , 0xBA , 0xFC , 0xBA , 0xFC , 0xA6 , 0xFC , 0xA6 , 0xFC , 0xB0 , 0xFC , 0xB0 , 0xFC , +0xA6 , 0xFC , 0xA6 , 0xFC , 0x98 , 0xFC , 0x98 , 0xFC , 0x9D , 0xFC , 0x9D , 0xFC , 0xAF , 0xFC , 0xAF , 0xFC , +0x96 , 0xFC , 0x96 , 0xFC , 0xA5 , 0xFC , 0xA5 , 0xFC , 0xC7 , 0xFC , 0xC7 , 0xFC , 0x85 , 0xFD , 0x85 , 0xFD , +0xCE , 0xFE , 0xCE , 0xFE , 0xC9 , 0xFF , 0xC9 , 0xFF , 0x98 , 0x00 , 0x98 , 0x00 , 0xC2 , 0x01 , 0xC2 , 0x01 , +0x0C , 0x03 , 0x0C , 0x03 , 0x5A , 0x04 , 0x5A , 0x04 , 0x76 , 0x05 , 0x76 , 0x05 , 0x42 , 0x06 , 0x42 , 0x06 , +0xF0 , 0x06 , 0xF0 , 0x06 , 0x65 , 0x07 , 0x65 , 0x07 , 0x65 , 0x07 , 0x65 , 0x07 , 0x11 , 0x07 , 0x11 , 0x07 , +0x8F , 0x06 , 0x8F , 0x06 , 0x01 , 0x06 , 0x01 , 0x06 , 0x77 , 0x05 , 0x77 , 0x05 , 0xB7 , 0x04 , 0xB7 , 0x04 , +0xCE , 0x03 , 0xCE , 0x03 , 0xF2 , 0x02 , 0xF2 , 0x02 , 0x55 , 0x02 , 0x55 , 0x02 , 0xC7 , 0x01 , 0xC7 , 0x01 , +0x3E , 0x01 , 0x3E , 0x01 , 0x94 , 0x00 , 0x94 , 0x00 , 0xDD , 0xFF , 0xDD , 0xFF , 0x4E , 0xFF , 0x4E , 0xFF , +0xE6 , 0xFE , 0xE6 , 0xFE , 0x61 , 0xFE , 0x61 , 0xFE , 0xE2 , 0xFD , 0xE2 , 0xFD , 0x7F , 0xFD , 0x7F , 0xFD , +0x2D , 0xFD , 0x2D , 0xFD , 0xF8 , 0xFC , 0xF8 , 0xFC , 0xE2 , 0xFC , 0xE2 , 0xFC , 0xCF , 0xFC , 0xCF , 0xFC , +0xC4 , 0xFC , 0xC4 , 0xFC , 0xC5 , 0xFC , 0xC5 , 0xFC , 0xCC , 0xFC , 0xCC , 0xFC , 0xDB , 0xFC , 0xDB , 0xFC , +0x06 , 0xFD , 0x06 , 0xFD , 0x28 , 0xFD , 0x28 , 0xFD , 0x44 , 0xFD , 0x44 , 0xFD , 0x63 , 0xFD , 0x63 , 0xFD , +0x79 , 0xFD , 0x79 , 0xFD , 0x98 , 0xFD , 0x98 , 0xFD , 0xBA , 0xFD , 0xBA , 0xFD , 0xCF , 0xFD , 0xCF , 0xFD , +0xDC , 0xFD , 0xDC , 0xFD , 0xEB , 0xFD , 0xEB , 0xFD , 0xF3 , 0xFD , 0xF3 , 0xFD , 0x07 , 0xFE , 0x07 , 0xFE , +0x1B , 0xFE , 0x1B , 0xFE , 0x29 , 0xFE , 0x29 , 0xFE , 0x18 , 0xFE , 0x18 , 0xFE , 0x23 , 0xFE , 0x23 , 0xFE , +0x3C , 0xFE , 0x3C , 0xFE , 0xC1 , 0xFE , 0xC1 , 0xFE , 0x97 , 0xFF , 0x97 , 0xFF , 0x3F , 0x00 , 0x3F , 0x00 , +0xD5 , 0x00 , 0xD5 , 0x00 , 0x9A , 0x01 , 0x9A , 0x01 , 0x70 , 0x02 , 0x70 , 0x02 , 0x55 , 0x03 , 0x55 , 0x03 , +0x23 , 0x04 , 0x23 , 0x04 , 0xB9 , 0x04 , 0xB9 , 0x04 , 0x37 , 0x05 , 0x37 , 0x05 , 0x8E , 0x05 , 0x8E , 0x05 , +0x9D , 0x05 , 0x9D , 0x05 , 0x75 , 0x05 , 0x75 , 0x05 , 0x29 , 0x05 , 0x29 , 0x05 , 0xD3 , 0x04 , 0xD3 , 0x04 , +0x8C , 0x04 , 0x8C , 0x04 , 0x1F , 0x04 , 0x1F , 0x04 , 0x88 , 0x03 , 0x88 , 0x03 , 0xEE , 0x02 , 0xEE , 0x02 , +0x65 , 0x02 , 0x65 , 0x02 , 0xD7 , 0x01 , 0xD7 , 0x01 , 0x4E , 0x01 , 0x4E , 0x01 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0x18 , 0x00 , 0x18 , 0x00 , 0x90 , 0xFF , 0x90 , 0xFF , 0x1E , 0xFF , 0x1E , 0xFF , 0xA0 , 0xFE , 0xA0 , 0xFE , +0x2E , 0xFE , 0x2E , 0xFE , 0xCF , 0xFD , 0xCF , 0xFD , 0x7B , 0xFD , 0x7B , 0xFD , 0x42 , 0xFD , 0x42 , 0xFD , +0x20 , 0xFD , 0x20 , 0xFD , 0xFF , 0xFC , 0xFF , 0xFC , 0xED , 0xFC , 0xED , 0xFC , 0xE9 , 0xFC , 0xE9 , 0xFC , +0xE9 , 0xFC , 0xE9 , 0xFC , 0xF5 , 0xFC , 0xF5 , 0xFC , 0x17 , 0xFD , 0x17 , 0xFD , 0x3C , 0xFD , 0x3C , 0xFD , +0x5F , 0xFD , 0x5F , 0xFD , 0x85 , 0xFD , 0x85 , 0xFD , 0xAA , 0xFD , 0xAA , 0xFD , 0xE0 , 0xFD , 0xE0 , 0xFD , +0x14 , 0xFE , 0x14 , 0xFE , 0x3A , 0xFE , 0x3A , 0xFE , 0x5A , 0xFE , 0x5A , 0xFE , 0x79 , 0xFE , 0x79 , 0xFE , +0x96 , 0xFE , 0x96 , 0xFE , 0xBC , 0xFE , 0xBC , 0xFE , 0xD8 , 0xFE , 0xD8 , 0xFE , 0xEF , 0xFE , 0xEF , 0xFE , +0xF9 , 0xFE , 0xF9 , 0xFE , 0x0C , 0xFF , 0x0C , 0xFF , 0x19 , 0xFF , 0x19 , 0xFF , 0x39 , 0xFF , 0x39 , 0xFF , +0x5E , 0xFF , 0x5E , 0xFF , 0x98 , 0xFF , 0x98 , 0xFF , 0x1A , 0x00 , 0x1A , 0x00 , 0x9C , 0x00 , 0x9C , 0x00 , +0x00 , 0x01 , 0x00 , 0x01 , 0x6D , 0x01 , 0x6D , 0x01 , 0xDF , 0x01 , 0xDF , 0x01 , 0x53 , 0x02 , 0x53 , 0x02 , +0xD7 , 0x02 , 0xD7 , 0x02 , 0x4F , 0x03 , 0x4F , 0x03 , 0xBA , 0x03 , 0xBA , 0x03 , 0x0F , 0x04 , 0x0F , 0x04 , +0x3C , 0x04 , 0x3C , 0x04 , 0x44 , 0x04 , 0x44 , 0x04 , 0x37 , 0x04 , 0x37 , 0x04 , 0x0C , 0x04 , 0x0C , 0x04 , +0xDB , 0x03 , 0xDB , 0x03 , 0x95 , 0x03 , 0x95 , 0x03 , 0x2D , 0x03 , 0x2D , 0x03 , 0xB6 , 0x02 , 0xB6 , 0x02 , +0x42 , 0x02 , 0x42 , 0x02 , 0xC2 , 0x01 , 0xC2 , 0x01 , 0x39 , 0x01 , 0x39 , 0x01 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0x31 , 0x00 , 0x31 , 0x00 , 0xA7 , 0xFF , 0xA7 , 0xFF , 0x2E , 0xFF , 0x2E , 0xFF , 0xBB , 0xFE , 0xBB , 0xFE , +0x55 , 0xFE , 0x55 , 0xFE , 0x0F , 0xFE , 0x0F , 0xFE , 0xCE , 0xFD , 0xCE , 0xFD , 0x91 , 0xFD , 0x91 , 0xFD , +0x6F , 0xFD , 0x6F , 0xFD , 0x5C , 0xFD , 0x5C , 0xFD , 0x52 , 0xFD , 0x52 , 0xFD , 0x55 , 0xFD , 0x55 , 0xFD , +0x5D , 0xFD , 0x5D , 0xFD , 0x6C , 0xFD , 0x6C , 0xFD , 0x8C , 0xFD , 0x8C , 0xFD , 0xB7 , 0xFD , 0xB7 , 0xFD , +0xDC , 0xFD , 0xDC , 0xFD , 0x08 , 0xFE , 0x08 , 0xFE , 0x30 , 0xFE , 0x30 , 0xFE , 0x61 , 0xFE , 0x61 , 0xFE , +0x93 , 0xFE , 0x93 , 0xFE , 0xBC , 0xFE , 0xBC , 0xFE , 0xDB , 0xFE , 0xDB , 0xFE , 0xFF , 0xFE , 0xFF , 0xFE , +0x1D , 0xFF , 0x1D , 0xFF , 0x3A , 0xFF , 0x3A , 0xFF , 0x57 , 0xFF , 0x57 , 0xFF , 0x6B , 0xFF , 0x6B , 0xFF , +0x7D , 0xFF , 0x7D , 0xFF , 0x92 , 0xFF , 0x92 , 0xFF , 0xA0 , 0xFF , 0xA0 , 0xFF , 0xA2 , 0xFF , 0xA2 , 0xFF , +0xAF , 0xFF , 0xAF , 0xFF , 0xBA , 0xFF , 0xBA , 0xFF , 0xE0 , 0xFF , 0xE0 , 0xFF , 0x17 , 0x00 , 0x17 , 0x00 , +0x3E , 0x00 , 0x3E , 0x00 , 0x64 , 0x00 , 0x64 , 0x00 , 0x9A , 0x00 , 0x9A , 0x00 , 0xCE , 0x00 , 0xCE , 0x00 , +0x0B , 0x01 , 0x0B , 0x01 , 0x51 , 0x01 , 0x51 , 0x01 , 0x9C , 0x01 , 0x9C , 0x01 , 0xE7 , 0x01 , 0xE7 , 0x01 , +0x23 , 0x02 , 0x23 , 0x02 , 0x49 , 0x02 , 0x49 , 0x02 , 0x66 , 0x02 , 0x66 , 0x02 , 0x74 , 0x02 , 0x74 , 0x02 , +0x74 , 0x02 , 0x74 , 0x02 , 0x67 , 0x02 , 0x67 , 0x02 , 0x43 , 0x02 , 0x43 , 0x02 , 0x0E , 0x02 , 0x0E , 0x02 , +0xD5 , 0x01 , 0xD5 , 0x01 , 0x92 , 0x01 , 0x92 , 0x01 , 0x45 , 0x01 , 0x45 , 0x01 , 0xF1 , 0x00 , 0xF1 , 0x00 , +0x95 , 0x00 , 0x95 , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , 0xF3 , 0xFF , 0xF3 , 0xFF , 0xA2 , 0xFF , 0xA2 , 0xFF , +0x5B , 0xFF , 0x5B , 0xFF , 0x24 , 0xFF , 0x24 , 0xFF , 0xE0 , 0xFE , 0xE0 , 0xFE , 0xA5 , 0xFE , 0xA5 , 0xFE , +0x7D , 0xFE , 0x7D , 0xFE , 0x59 , 0xFE , 0x59 , 0xFE , 0x44 , 0xFE , 0x44 , 0xFE , 0x3D , 0xFE , 0x3D , 0xFE , +0x30 , 0xFE , 0x30 , 0xFE , 0x33 , 0xFE , 0x33 , 0xFE , 0x48 , 0xFE , 0x48 , 0xFE , 0x59 , 0xFE , 0x59 , 0xFE , +0x68 , 0xFE , 0x68 , 0xFE , 0x79 , 0xFE , 0x79 , 0xFE , 0x8D , 0xFE , 0x8D , 0xFE , 0xA4 , 0xFE , 0xA4 , 0xFE , +0xC0 , 0xFE , 0xC0 , 0xFE , 0xD6 , 0xFE , 0xD6 , 0xFE , 0xED , 0xFE , 0xED , 0xFE , 0x06 , 0xFF , 0x06 , 0xFF , +0x1C , 0xFF , 0x1C , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , 0x4C , 0xFF , 0x4C , 0xFF , 0x5B , 0xFF , 0x5B , 0xFF , +0x6F , 0xFF , 0x6F , 0xFF , 0x86 , 0xFF , 0x86 , 0xFF , 0x96 , 0xFF , 0x96 , 0xFF , 0xAC , 0xFF , 0xAC , 0xFF , +0xC2 , 0xFF , 0xC2 , 0xFF , 0xD5 , 0xFF , 0xD5 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0x03 , 0x00 , 0x03 , 0x00 , +0x13 , 0x00 , 0x13 , 0x00 , 0x28 , 0x00 , 0x28 , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , 0x5D , 0x00 , 0x5D , 0x00 , +0x9B , 0x00 , 0x9B , 0x00 , 0xC4 , 0x00 , 0xC4 , 0x00 , 0xDB , 0x00 , 0xDB , 0x00 , 0xFD , 0x00 , 0xFD , 0x00 , +0x22 , 0x01 , 0x22 , 0x01 , 0x3C , 0x01 , 0x3C , 0x01 , 0x56 , 0x01 , 0x56 , 0x01 , 0x73 , 0x01 , 0x73 , 0x01 , +0x95 , 0x01 , 0x95 , 0x01 , 0xA5 , 0x01 , 0xA5 , 0x01 , 0x9F , 0x01 , 0x9F , 0x01 , 0x96 , 0x01 , 0x96 , 0x01 , +0x90 , 0x01 , 0x90 , 0x01 , 0x77 , 0x01 , 0x77 , 0x01 , 0x5E , 0x01 , 0x5E , 0x01 , 0x3D , 0x01 , 0x3D , 0x01 , +0x0D , 0x01 , 0x0D , 0x01 , 0xD9 , 0x00 , 0xD9 , 0x00 , 0xA2 , 0x00 , 0xA2 , 0x00 , 0x66 , 0x00 , 0x66 , 0x00 , +0x35 , 0x00 , 0x35 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0xC4 , 0xFF , 0xC4 , 0xFF , 0x8B , 0xFF , 0x8B , 0xFF , +0x56 , 0xFF , 0x56 , 0xFF , 0x24 , 0xFF , 0x24 , 0xFF , 0x04 , 0xFF , 0x04 , 0xFF , 0xEC , 0xFE , 0xEC , 0xFE , +0xC2 , 0xFE , 0xC2 , 0xFE , 0xB5 , 0xFE , 0xB5 , 0xFE , 0xA9 , 0xFE , 0xA9 , 0xFE , 0x9E , 0xFE , 0x9E , 0xFE , +0xA1 , 0xFE , 0xA1 , 0xFE , 0xA8 , 0xFE , 0xA8 , 0xFE , 0xA5 , 0xFE , 0xA5 , 0xFE , 0xAF , 0xFE , 0xAF , 0xFE , +0xB2 , 0xFE , 0xB2 , 0xFE , 0xB8 , 0xFE , 0xB8 , 0xFE , 0xC8 , 0xFE , 0xC8 , 0xFE , 0xDA , 0xFE , 0xDA , 0xFE , +0xF7 , 0xFE , 0xF7 , 0xFE , 0x11 , 0xFF , 0x11 , 0xFF , 0x38 , 0xFF , 0x38 , 0xFF , 0x0E , 0xFF , 0x0E , 0xFF , +0xD5 , 0xFE , 0xD5 , 0xFE , 0xF9 , 0xFE , 0xF9 , 0xFE , 0x26 , 0xFF , 0x26 , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , +0x39 , 0xFF , 0x39 , 0xFF , 0x58 , 0xFF , 0x58 , 0xFF , 0x88 , 0xFF , 0x88 , 0xFF , 0xA9 , 0xFF , 0xA9 , 0xFF , +0xC5 , 0xFF , 0xC5 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , 0x1D , 0x00 , 0x1D , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , +0x62 , 0x00 , 0x62 , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0xC3 , 0x00 , 0xC3 , 0x00 , 0x10 , 0x01 , 0x10 , 0x01 , +0x35 , 0x01 , 0x35 , 0x01 , 0x4B , 0x01 , 0x4B , 0x01 , 0x76 , 0x01 , 0x76 , 0x01 , 0x8D , 0x01 , 0x8D , 0x01 , +0xA3 , 0x01 , 0xA3 , 0x01 , 0xAA , 0x01 , 0xAA , 0x01 , 0xC8 , 0x01 , 0xC8 , 0x01 , 0xD4 , 0x01 , 0xD4 , 0x01 , +0xD1 , 0x01 , 0xD1 , 0x01 , 0xA8 , 0x01 , 0xA8 , 0x01 , 0xA8 , 0x01 , 0xA8 , 0x01 , 0x78 , 0x01 , 0x78 , 0x01 , +0x02 , 0x02 , 0x02 , 0x02 , 0x32 , 0x03 , 0x32 , 0x03 , 0x18 , 0x02 , 0x18 , 0x02 , 0x1D , 0x00 , 0x1D , 0x00 , +0x41 , 0xFF , 0x41 , 0xFF , 0x5F , 0xFF , 0x5F , 0xFF , 0x09 , 0xFF , 0x09 , 0xFF , 0xC9 , 0xFE , 0xC9 , 0xFE , +0x9A , 0xFE , 0x9A , 0xFE , 0x5F , 0xFE , 0x5F , 0xFE , 0x7E , 0xFE , 0x7E , 0xFE , 0xCC , 0xFE , 0xCC , 0xFE , +0xB4 , 0xFE , 0xB4 , 0xFE , 0x58 , 0xFE , 0x58 , 0xFE , 0x80 , 0xFE , 0x80 , 0xFE , 0xC4 , 0xFE , 0xC4 , 0xFE , +0xE9 , 0xFE , 0xE9 , 0xFE , 0x2F , 0xFF , 0x2F , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , 0x2B , 0xFF , 0x2B , 0xFF , +0xE5 , 0xFE , 0xE5 , 0xFE , 0xDC , 0xFE , 0xDC , 0xFE , 0xF2 , 0xFE , 0xF2 , 0xFE , 0x02 , 0xFF , 0x02 , 0xFF , +0x03 , 0xFF , 0x03 , 0xFF , 0x1B , 0xFF , 0x1B , 0xFF , 0xD9 , 0xFE , 0xD9 , 0xFE , 0x98 , 0xFE , 0x98 , 0xFE , +0xC0 , 0xFE , 0xC0 , 0xFE , 0xE6 , 0xFE , 0xE6 , 0xFE , 0xFB , 0xFE , 0xFB , 0xFE , 0xCC , 0xFE , 0xCC , 0xFE , +0xAD , 0xFE , 0xAD , 0xFE , 0xEA , 0xFE , 0xEA , 0xFE , 0x1C , 0xFF , 0x1C , 0xFF , 0x31 , 0xFF , 0x31 , 0xFF , +0x4B , 0xFF , 0x4B , 0xFF , 0x8C , 0xFF , 0x8C , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , +0x42 , 0x00 , 0x42 , 0x00 , 0xCE , 0x00 , 0xCE , 0x00 , 0x5F , 0x01 , 0x5F , 0x01 , 0xBF , 0x01 , 0xBF , 0x01 , +0xE5 , 0x01 , 0xE5 , 0x01 , 0x1F , 0x02 , 0x1F , 0x02 , 0x9F , 0x02 , 0x9F , 0x02 , 0xB5 , 0x02 , 0xB5 , 0x02 , +0x04 , 0x03 , 0x04 , 0x03 , 0x88 , 0x03 , 0x88 , 0x03 , 0xFD , 0x03 , 0xFD , 0x03 , 0xEC , 0x03 , 0xEC , 0x03 , +0xAC , 0x03 , 0xAC , 0x03 , 0x72 , 0x03 , 0x72 , 0x03 , 0x34 , 0x03 , 0x34 , 0x03 , 0xDC , 0x02 , 0xDC , 0x02 , +0x7C , 0x02 , 0x7C , 0x02 , 0x0F , 0x02 , 0x0F , 0x02 , 0xA3 , 0x01 , 0xA3 , 0x01 , 0x27 , 0x01 , 0x27 , 0x01 , +0xD7 , 0x00 , 0xD7 , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , 0xCE , 0xFF , 0xCE , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , +0xA3 , 0xFF , 0xA3 , 0xFF , 0x0E , 0xFF , 0x0E , 0xFF , 0x62 , 0xFE , 0x62 , 0xFE , 0x44 , 0xFE , 0x44 , 0xFE , +0x41 , 0xFE , 0x41 , 0xFE , 0x85 , 0xFE , 0x85 , 0xFE , 0x29 , 0xFE , 0x29 , 0xFE , 0xB2 , 0xFD , 0xB2 , 0xFD , +0xFF , 0xFD , 0xFF , 0xFD , 0xF2 , 0xFD , 0xF2 , 0xFD , 0x97 , 0xFD , 0x97 , 0xFD , 0x88 , 0xFD , 0x88 , 0xFD , +0xDD , 0xFD , 0xDD , 0xFD , 0xA7 , 0xFD , 0xA7 , 0xFD , 0x62 , 0xFD , 0x62 , 0xFD , 0xD1 , 0xFD , 0xD1 , 0xFD , +0xC0 , 0xFD , 0xC0 , 0xFD , 0x5A , 0xFD , 0x5A , 0xFD , 0x6C , 0xFD , 0x6C , 0xFD , 0x91 , 0xFD , 0x91 , 0xFD , +0x26 , 0xFD , 0x26 , 0xFD , 0x3D , 0xFD , 0x3D , 0xFD , 0x2D , 0xFD , 0x2D , 0xFD , 0x16 , 0xFD , 0x16 , 0xFD , +0x21 , 0xFD , 0x21 , 0xFD , 0x3A , 0xFD , 0x3A , 0xFD , 0x5A , 0xFD , 0x5A , 0xFD , 0x85 , 0xFD , 0x85 , 0xFD , +0xDF , 0xFD , 0xDF , 0xFD , 0x34 , 0xFE , 0x34 , 0xFE , 0xF1 , 0xFE , 0xF1 , 0xFE , 0x17 , 0x00 , 0x17 , 0x00 , +0x5C , 0x01 , 0x5C , 0x01 , 0x44 , 0x02 , 0x44 , 0x02 , 0xE3 , 0x02 , 0xE3 , 0x02 , 0x74 , 0x03 , 0x74 , 0x03 , +0x46 , 0x04 , 0x46 , 0x04 , 0xD7 , 0x04 , 0xD7 , 0x04 , 0xA4 , 0x05 , 0xA4 , 0x05 , 0x02 , 0x06 , 0x02 , 0x06 , +0x29 , 0x06 , 0x29 , 0x06 , 0x09 , 0x06 , 0x09 , 0x06 , 0xC9 , 0x05 , 0xC9 , 0x05 , 0x56 , 0x05 , 0x56 , 0x05 , +0xD2 , 0x04 , 0xD2 , 0x04 , 0x22 , 0x04 , 0x22 , 0x04 , 0x6B , 0x03 , 0x6B , 0x03 , 0x9F , 0x02 , 0x9F , 0x02 , +0xE1 , 0x01 , 0xE1 , 0x01 , 0x08 , 0x01 , 0x08 , 0x01 , 0x6D , 0x00 , 0x6D , 0x00 , 0xC4 , 0xFF , 0xC4 , 0xFF , +0x14 , 0xFF , 0x14 , 0xFF , 0xC1 , 0xFE , 0xC1 , 0xFE , 0x66 , 0xFE , 0x66 , 0xFE , 0x05 , 0xFE , 0x05 , 0xFE , +0x7C , 0xFD , 0x7C , 0xFD , 0x32 , 0xFD , 0x32 , 0xFD , 0xEA , 0xFC , 0xEA , 0xFC , 0x19 , 0xFD , 0x19 , 0xFD , +0xFF , 0xFC , 0xFF , 0xFC , 0xEA , 0xFC , 0xEA , 0xFC , 0x1F , 0xFD , 0x1F , 0xFD , 0x69 , 0xFD , 0x69 , 0xFD , +0xDD , 0xFD , 0xDD , 0xFD , 0x09 , 0xFE , 0x09 , 0xFE , 0xC5 , 0xFD , 0xC5 , 0xFD , 0xF2 , 0xFD , 0xF2 , 0xFD , +0xFB , 0xFD , 0xFB , 0xFD , 0xB5 , 0xFD , 0xB5 , 0xFD , 0x8F , 0xFD , 0x8F , 0xFD , 0x6F , 0xFD , 0x6F , 0xFD , +0xE7 , 0xFC , 0xE7 , 0xFC , 0xAC , 0xFC , 0xAC , 0xFC , 0x63 , 0xFC , 0x63 , 0xFC , 0x3F , 0xFC , 0x3F , 0xFC , +0x49 , 0xFC , 0x49 , 0xFC , 0xFE , 0xFB , 0xFE , 0xFB , 0xB0 , 0xFB , 0xB0 , 0xFB , 0x7E , 0xFB , 0x7E , 0xFB , +0xB6 , 0xFB , 0xB6 , 0xFB , 0x24 , 0xFC , 0x24 , 0xFC , 0xFA , 0xFC , 0xFA , 0xFC , 0x10 , 0xFF , 0x10 , 0xFF , +0xE4 , 0x01 , 0xE4 , 0x01 , 0x2B , 0x04 , 0x2B , 0x04 , 0x7D , 0x05 , 0x7D , 0x05 , 0x0A , 0x06 , 0x0A , 0x06 , +0xAB , 0x06 , 0xAB , 0x06 , 0x70 , 0x07 , 0x70 , 0x07 , 0x8D , 0x08 , 0x8D , 0x08 , 0xDF , 0x08 , 0xDF , 0x08 , +0x73 , 0x08 , 0x73 , 0x08 , 0xAB , 0x07 , 0xAB , 0x07 , 0xFC , 0x06 , 0xFC , 0x06 , 0x6D , 0x06 , 0x6D , 0x06 , +0x8E , 0x05 , 0x8E , 0x05 , 0x6F , 0x04 , 0x6F , 0x04 , 0x2B , 0x03 , 0x2B , 0x03 , 0xF3 , 0x01 , 0xF3 , 0x01 , +0xCD , 0x00 , 0xCD , 0x00 , 0xE3 , 0xFF , 0xE3 , 0xFF , 0x71 , 0xFF , 0x71 , 0xFF , 0x1C , 0xFF , 0x1C , 0xFF , +0xEA , 0xFE , 0xEA , 0xFE , 0xD9 , 0xFE , 0xD9 , 0xFE , 0xC4 , 0xFE , 0xC4 , 0xFE , 0x9F , 0xFE , 0x9F , 0xFE , +0x4A , 0xFE , 0x4A , 0xFE , 0xD2 , 0xFD , 0xD2 , 0xFD , 0x32 , 0xFD , 0x32 , 0xFD , 0xD8 , 0xFC , 0xD8 , 0xFC , +0xA9 , 0xFC , 0xA9 , 0xFC , 0xB1 , 0xFC , 0xB1 , 0xFC , 0xB4 , 0xFC , 0xB4 , 0xFC , 0xAF , 0xFC , 0xAF , 0xFC , +0x99 , 0xFC , 0x99 , 0xFC , 0x76 , 0xFC , 0x76 , 0xFC , 0x10 , 0xFC , 0x10 , 0xFC , 0x9F , 0xFB , 0x9F , 0xFB , +0x5B , 0xFB , 0x5B , 0xFB , 0x14 , 0xFB , 0x14 , 0xFB , 0xC4 , 0xFA , 0xC4 , 0xFA , 0x60 , 0xFA , 0x60 , 0xFA , +0x91 , 0xF9 , 0x91 , 0xF9 , 0x3A , 0xF8 , 0x3A , 0xF8 , 0x47 , 0xF7 , 0x47 , 0xF7 , 0xE6 , 0xF6 , 0xE6 , 0xF6 , +0x5E , 0xF7 , 0x5E , 0xF7 , 0x12 , 0xF8 , 0x12 , 0xF8 , 0x22 , 0xF8 , 0x22 , 0xF8 , 0x73 , 0xF7 , 0x73 , 0xF7 , +0xA2 , 0xF6 , 0xA2 , 0xF6 , 0xDC , 0xF5 , 0xDC , 0xF5 , 0x9B , 0xF6 , 0x9B , 0xF6 , 0xB8 , 0xFC , 0xB8 , 0xFC , +0x32 , 0x08 , 0x32 , 0x08 , 0x9E , 0x13 , 0x9E , 0x13 , 0xCA , 0x19 , 0xCA , 0x19 , 0xFD , 0x19 , 0xFD , 0x19 , +0xA7 , 0x17 , 0xA7 , 0x17 , 0x55 , 0x16 , 0x55 , 0x16 , 0x80 , 0x15 , 0x80 , 0x15 , 0x44 , 0x11 , 0x44 , 0x11 , +0xF1 , 0x08 , 0xF1 , 0x08 , 0x78 , 0x00 , 0x78 , 0x00 , 0x01 , 0xFC , 0x01 , 0xFC , 0x7A , 0xFC , 0x7A , 0xFC , +0xEF , 0xFE , 0xEF , 0xFE , 0x52 , 0x00 , 0x52 , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , +0x18 , 0x02 , 0x18 , 0x02 , 0x31 , 0x04 , 0x31 , 0x04 , 0xA2 , 0x04 , 0xA2 , 0x04 , 0x7E , 0x02 , 0x7E , 0x02 , +0x6F , 0xFF , 0x6F , 0xFF , 0x93 , 0xFD , 0x93 , 0xFD , 0x0B , 0xFD , 0x0B , 0xFD , 0xD0 , 0xFC , 0xD0 , 0xFC , +0x28 , 0xFC , 0x28 , 0xFC , 0xE8 , 0xFA , 0xE8 , 0xFA , 0x89 , 0xFA , 0x89 , 0xFA , 0x4D , 0xFB , 0x4D , 0xFB , +0x7F , 0xFC , 0x7F , 0xFC , 0x6B , 0xFD , 0x6B , 0xFD , 0x6D , 0xFD , 0x6D , 0xFD , 0x2C , 0xFD , 0x2C , 0xFD , +0x10 , 0xFD , 0x10 , 0xFD , 0x76 , 0xFC , 0x76 , 0xFC , 0xD1 , 0xFB , 0xD1 , 0xFB , 0xCF , 0xFA , 0xCF , 0xFA , +0x06 , 0xF9 , 0x06 , 0xF9 , 0xF5 , 0xF6 , 0xF5 , 0xF6 , 0xA2 , 0xF4 , 0xA2 , 0xF4 , 0xB1 , 0xF1 , 0xB1 , 0xF1 , +0xC1 , 0xEF , 0xC1 , 0xEF , 0x84 , 0xEF , 0x84 , 0xEF , 0x0E , 0xF1 , 0x0E , 0xF1 , 0x99 , 0xF3 , 0x99 , 0xF3 , +0x55 , 0xF5 , 0x55 , 0xF5 , 0xAA , 0xF5 , 0xAA , 0xF5 , 0xB9 , 0xF5 , 0xB9 , 0xF5 , 0x21 , 0xF6 , 0x21 , 0xF6 , +0xD4 , 0xF7 , 0xD4 , 0xF7 , 0x67 , 0xFE , 0x67 , 0xFE , 0x3E , 0x0A , 0x3E , 0x0A , 0x44 , 0x16 , 0x44 , 0x16 , +0x0F , 0x1D , 0x0F , 0x1D , 0x17 , 0x1D , 0x17 , 0x1D , 0x21 , 0x19 , 0x21 , 0x19 , 0xA7 , 0x15 , 0xA7 , 0x15 , +0xCE , 0x13 , 0xCE , 0x13 , 0x21 , 0x10 , 0x21 , 0x10 , 0xD2 , 0x08 , 0xD2 , 0x08 , 0xB1 , 0x00 , 0xB1 , 0x00 , +0xDA , 0xFB , 0xDA , 0xFB , 0x5C , 0xFC , 0x5C , 0xFC , 0x22 , 0x00 , 0x22 , 0x00 , 0x7F , 0x03 , 0x7F , 0x03 , +0x75 , 0x04 , 0x75 , 0x04 , 0xAD , 0x04 , 0xAD , 0x04 , 0x7E , 0x05 , 0x7E , 0x05 , 0xE1 , 0x06 , 0xE1 , 0x06 , +0xC7 , 0x06 , 0xC7 , 0x06 , 0xB3 , 0x03 , 0xB3 , 0x03 , 0xF2 , 0xFE , 0xF2 , 0xFE , 0x34 , 0xFB , 0x34 , 0xFB , +0xC2 , 0xF9 , 0xC2 , 0xF9 , 0x12 , 0xFA , 0x12 , 0xFA , 0xE0 , 0xFA , 0xE0 , 0xFA , 0xD7 , 0xFA , 0xD7 , 0xFA , +0x13 , 0xFB , 0x13 , 0xFB , 0x84 , 0xFC , 0x84 , 0xFC , 0x57 , 0xFE , 0x57 , 0xFE , 0x82 , 0xFF , 0x82 , 0xFF , +0x44 , 0xFF , 0x44 , 0xFF , 0x6C , 0xFD , 0x6C , 0xFD , 0xAC , 0xFB , 0xAC , 0xFB , 0x54 , 0xFA , 0x54 , 0xFA , +0x5F , 0xF9 , 0x5F , 0xF9 , 0xA8 , 0xF8 , 0xA8 , 0xF8 , 0x55 , 0xF7 , 0x55 , 0xF7 , 0x58 , 0xF5 , 0x58 , 0xF5 , +0xA0 , 0xF3 , 0xA0 , 0xF3 , 0x33 , 0xF2 , 0x33 , 0xF2 , 0xAD , 0xF1 , 0xAD , 0xF1 , 0x3B , 0xF2 , 0x3B , 0xF2 , +0x2E , 0xF3 , 0x2E , 0xF3 , 0x95 , 0xF4 , 0x95 , 0xF4 , 0xF3 , 0xF5 , 0xF3 , 0xF5 , 0x10 , 0xF7 , 0x10 , 0xF7 , +0x0D , 0xF8 , 0x0D , 0xF8 , 0xD9 , 0xF8 , 0xD9 , 0xF8 , 0x72 , 0xF9 , 0x72 , 0xF9 , 0x74 , 0xFD , 0x74 , 0xFD , +0xA4 , 0x07 , 0xA4 , 0x07 , 0xB5 , 0x14 , 0xB5 , 0x14 , 0x1C , 0x1E , 0x1C , 0x1E , 0x86 , 0x1F , 0x86 , 0x1F , +0x11 , 0x1A , 0x11 , 0x1A , 0x58 , 0x13 , 0x58 , 0x13 , 0x84 , 0x0F , 0x84 , 0x0F , 0xCE , 0x0C , 0xCE , 0x0C , +0xD2 , 0x07 , 0xD2 , 0x07 , 0x30 , 0x01 , 0x30 , 0x01 , 0x85 , 0xFC , 0x85 , 0xFC , 0x19 , 0xFD , 0x19 , 0xFD , +0x1A , 0x02 , 0x1A , 0x02 , 0x8E , 0x07 , 0x8E , 0x07 , 0xCD , 0x09 , 0xCD , 0x09 , 0xF5 , 0x08 , 0xF5 , 0x08 , +0x5A , 0x07 , 0x5A , 0x07 , 0xB6 , 0x06 , 0xB6 , 0x06 , 0x54 , 0x06 , 0x54 , 0x06 , 0xA4 , 0x03 , 0xA4 , 0x03 , +0xCE , 0xFE , 0xCE , 0xFE , 0x53 , 0xFA , 0x53 , 0xFA , 0x4C , 0xF8 , 0x4C , 0xF8 , 0xD7 , 0xF8 , 0xD7 , 0xF8 , +0x52 , 0xFB , 0x52 , 0xFB , 0x51 , 0xFD , 0x51 , 0xFD , 0x6D , 0xFE , 0x6D , 0xFE , 0xCD , 0xFF , 0xCD , 0xFF , +0xF4 , 0x00 , 0xF4 , 0x00 , 0x56 , 0x01 , 0x56 , 0x01 , 0xAF , 0x00 , 0xAF , 0x00 , 0x2E , 0xFE , 0x2E , 0xFE , +0x5E , 0xFB , 0x5E , 0xFB , 0x7C , 0xF9 , 0x7C , 0xF9 , 0x79 , 0xF8 , 0x79 , 0xF8 , 0x76 , 0xF8 , 0x76 , 0xF8 , +0x16 , 0xF8 , 0x16 , 0xF8 , 0x7A , 0xF6 , 0x7A , 0xF6 , 0x98 , 0xF4 , 0x98 , 0xF4 , 0x1A , 0xF3 , 0x1A , 0xF3 , +0x9A , 0xF2 , 0x9A , 0xF2 , 0x86 , 0xF3 , 0x86 , 0xF3 , 0x33 , 0xF4 , 0x33 , 0xF4 , 0x47 , 0xF4 , 0x47 , 0xF4 , +0x06 , 0xF4 , 0x06 , 0xF4 , 0x39 , 0xF4 , 0x39 , 0xF4 , 0x65 , 0xF5 , 0x65 , 0xF5 , 0x5D , 0xF7 , 0x5D , 0xF7 , +0x9F , 0xF8 , 0x9F , 0xF8 , 0x62 , 0xFB , 0x62 , 0xFB , 0x4D , 0x04 , 0x4D , 0x04 , 0x68 , 0x12 , 0x68 , 0x12 , +0x2F , 0x1F , 0x2F , 0x1F , 0x8C , 0x23 , 0x8C , 0x23 , 0xFD , 0x1D , 0xFD , 0x1D , 0x04 , 0x14 , 0x04 , 0x14 , +0x91 , 0x0C , 0x91 , 0x0C , 0xBF , 0x08 , 0xBF , 0x08 , 0x35 , 0x05 , 0x35 , 0x05 , 0x46 , 0x00 , 0x46 , 0x00 , +0x37 , 0xFC , 0x37 , 0xFC , 0x2F , 0xFD , 0x2F , 0xFD , 0xD4 , 0x03 , 0xD4 , 0x03 , 0x3F , 0x0C , 0x3F , 0x0C , +0x40 , 0x11 , 0x40 , 0x11 , 0x52 , 0x10 , 0x52 , 0x10 , 0x3A , 0x0B , 0x3A , 0x0B , 0x56 , 0x05 , 0x56 , 0x05 , +0x09 , 0x01 , 0x09 , 0x01 , 0x33 , 0xFD , 0x33 , 0xFD , 0x3C , 0xF9 , 0x3C , 0xF9 , 0x89 , 0xF6 , 0x89 , 0xF6 , +0xED , 0xF6 , 0xED , 0xF6 , 0x17 , 0xFA , 0x17 , 0xFA , 0x3C , 0xFF , 0x3C , 0xFF , 0x96 , 0x03 , 0x96 , 0x03 , +0x25 , 0x05 , 0x25 , 0x05 , 0xC5 , 0x04 , 0xC5 , 0x04 , 0x95 , 0x02 , 0x95 , 0x02 , 0x99 , 0xFF , 0x99 , 0xFF , +0x14 , 0xFD , 0x14 , 0xFD , 0x77 , 0xFA , 0x77 , 0xFA , 0x6A , 0xF8 , 0x6A , 0xF8 , 0xED , 0xF7 , 0xED , 0xF7 , +0x3E , 0xF8 , 0x3E , 0xF8 , 0xCF , 0xF9 , 0xCF , 0xF9 , 0xF6 , 0xFA , 0xF6 , 0xFA , 0x16 , 0xFA , 0x16 , 0xFA , +0xA7 , 0xF7 , 0xA7 , 0xF7 , 0xAF , 0xF4 , 0xAF , 0xF4 , 0x65 , 0xF2 , 0x65 , 0xF2 , 0x65 , 0xF2 , 0x65 , 0xF2 , +0x18 , 0xF3 , 0x18 , 0xF3 , 0x17 , 0xF3 , 0x17 , 0xF3 , 0x2C , 0xF2 , 0x2C , 0xF2 , 0x8A , 0xF1 , 0x8A , 0xF1 , +0xD4 , 0xF2 , 0xD4 , 0xF2 , 0x11 , 0xF6 , 0x11 , 0xF6 , 0xF6 , 0xF8 , 0xF6 , 0xF8 , 0x96 , 0xFA , 0x96 , 0xFA , +0x92 , 0x00 , 0x92 , 0x00 , 0x8C , 0x0D , 0x8C , 0x0D , 0xA9 , 0x1C , 0xA9 , 0x1C , 0xD3 , 0x24 , 0xD3 , 0x24 , +0xDC , 0x20 , 0xDC , 0x20 , 0xC6 , 0x14 , 0xC6 , 0x14 , 0x88 , 0x09 , 0x88 , 0x09 , 0x35 , 0x04 , 0x35 , 0x04 , +0xB5 , 0x02 , 0xB5 , 0x02 , 0xF7 , 0x00 , 0xF7 , 0x00 , 0x8D , 0xFE , 0x8D , 0xFE , 0xA3 , 0xFE , 0xA3 , 0xFE , +0xFD , 0x03 , 0xFD , 0x03 , 0x47 , 0x0C , 0x47 , 0x0C , 0x26 , 0x12 , 0x26 , 0x12 , 0x85 , 0x11 , 0x85 , 0x11 , +0x37 , 0x0B , 0x37 , 0x0B , 0xEB , 0x02 , 0xEB , 0x02 , 0xC9 , 0xFC , 0xC9 , 0xFC , 0x47 , 0xF9 , 0x47 , 0xF9 , +0xB7 , 0xF6 , 0xB7 , 0xF6 , 0x39 , 0xF5 , 0x39 , 0xF5 , 0x5F , 0xF6 , 0x5F , 0xF6 , 0x40 , 0xFA , 0x40 , 0xFA , +0xB3 , 0xFF , 0xB3 , 0xFF , 0xE8 , 0x04 , 0xE8 , 0x04 , 0xAE , 0x06 , 0xAE , 0x06 , 0xA6 , 0x05 , 0xA6 , 0x05 , +0xA0 , 0x02 , 0xA0 , 0x02 , 0x86 , 0xFE , 0x86 , 0xFE , 0x5D , 0xFB , 0x5D , 0xFB , 0x70 , 0xF9 , 0x70 , 0xF9 , +0x64 , 0xF8 , 0x64 , 0xF8 , 0x26 , 0xF9 , 0x26 , 0xF9 , 0x5C , 0xFA , 0x5C , 0xFA , 0xCB , 0xFB , 0xCB , 0xFB , +0x0E , 0xFD , 0x0E , 0xFD , 0x5F , 0xFC , 0x5F , 0xFC , 0x79 , 0xF9 , 0x79 , 0xF9 , 0x52 , 0xF5 , 0x52 , 0xF5 , +0x41 , 0xF1 , 0x41 , 0xF1 , 0x3B , 0xEF , 0x3B , 0xEF , 0xD1 , 0xEF , 0xD1 , 0xEF , 0xF8 , 0xF0 , 0xF8 , 0xF0 , +0xBE , 0xF1 , 0xBE , 0xF1 , 0xBB , 0xF1 , 0xBB , 0xF1 , 0x5A , 0xF2 , 0x5A , 0xF2 , 0x19 , 0xF5 , 0x19 , 0xF5 , +0x4B , 0xF9 , 0x4B , 0xF9 , 0x01 , 0xFC , 0x01 , 0xFC , 0x3B , 0xFD , 0x3B , 0xFD , 0x0F , 0x03 , 0x0F , 0x03 , +0x51 , 0x10 , 0x51 , 0x10 , 0x15 , 0x1F , 0x15 , 0x1F , 0xF6 , 0x25 , 0xF6 , 0x25 , 0x8A , 0x20 , 0x8A , 0x20 , +0x93 , 0x13 , 0x93 , 0x13 , 0x2C , 0x08 , 0x2C , 0x08 , 0xC6 , 0x03 , 0xC6 , 0x03 , 0xB5 , 0x03 , 0xB5 , 0x03 , +0x6B , 0x03 , 0x6B , 0x03 , 0x05 , 0x02 , 0x05 , 0x02 , 0x53 , 0x02 , 0x53 , 0x02 , 0xD7 , 0x06 , 0xD7 , 0x06 , +0x76 , 0x0D , 0x76 , 0x0D , 0xD7 , 0x10 , 0xD7 , 0x10 , 0xD3 , 0x0D , 0xD3 , 0x0D , 0x1E , 0x06 , 0x1E , 0x06 , +0x02 , 0xFE , 0x02 , 0xFE , 0x4E , 0xF9 , 0x4E , 0xF9 , 0xC5 , 0xF7 , 0xC5 , 0xF7 , 0x77 , 0xF7 , 0x77 , 0xF7 , +0xEF , 0xF7 , 0xEF , 0xF7 , 0x15 , 0xFA , 0x15 , 0xFA , 0x92 , 0xFD , 0x92 , 0xFD , 0xC0 , 0x01 , 0xC0 , 0x01 , +0x0D , 0x05 , 0x0D , 0x05 , 0xA0 , 0x04 , 0xA0 , 0x04 , 0x90 , 0x01 , 0x90 , 0x01 , 0x59 , 0xFE , 0x59 , 0xFE , +0xA9 , 0xFB , 0xA9 , 0xFB , 0x67 , 0xFA , 0x67 , 0xFA , 0x5B , 0xFA , 0x5B , 0xFA , 0x38 , 0xFA , 0x38 , 0xFA , +0x31 , 0xFB , 0x31 , 0xFB , 0xC7 , 0xFC , 0xC7 , 0xFC , 0xB8 , 0xFD , 0xB8 , 0xFD , 0xFC , 0xFD , 0xFC , 0xFD , +0x87 , 0xFC , 0x87 , 0xFC , 0x35 , 0xF9 , 0x35 , 0xF9 , 0x1A , 0xF5 , 0x1A , 0xF5 , 0x4C , 0xF1 , 0x4C , 0xF1 , +0x32 , 0xEF , 0x32 , 0xEF , 0x9C , 0xEF , 0x9C , 0xEF , 0xE6 , 0xF0 , 0xE6 , 0xF0 , 0xE9 , 0xF1 , 0xE9 , 0xF1 , +0x36 , 0xF2 , 0x36 , 0xF2 , 0x81 , 0xF2 , 0x81 , 0xF2 , 0x7D , 0xF4 , 0x7D , 0xF4 , 0x6F , 0xF8 , 0x6F , 0xF8 , +0xEF , 0xFB , 0xEF , 0xFB , 0x01 , 0xFD , 0x01 , 0xFD , 0x24 , 0x00 , 0x24 , 0x00 , 0xB3 , 0x0A , 0xB3 , 0x0A , +0xDA , 0x19 , 0xDA , 0x19 , 0x69 , 0x24 , 0x69 , 0x24 , 0x07 , 0x23 , 0x07 , 0x23 , 0x1B , 0x17 , 0x1B , 0x17 , +0x53 , 0x09 , 0x53 , 0x09 , 0x1D , 0x02 , 0x1D , 0x02 , 0xFE , 0x01 , 0xFE , 0x01 , 0xC2 , 0x03 , 0xC2 , 0x03 , +0x08 , 0x04 , 0x08 , 0x04 , 0xE9 , 0x03 , 0xE9 , 0x03 , 0x95 , 0x06 , 0x95 , 0x06 , 0x31 , 0x0C , 0x31 , 0x0C , +0x6D , 0x10 , 0x6D , 0x10 , 0xEE , 0x0E , 0xEE , 0x0E , 0xF5 , 0x07 , 0xF5 , 0x07 , 0x2D , 0xFF , 0x2D , 0xFF , +0x05 , 0xF9 , 0x05 , 0xF9 , 0x4E , 0xF7 , 0x4E , 0xF7 , 0x0C , 0xF8 , 0x0C , 0xF8 , 0x46 , 0xF9 , 0x46 , 0xF9 , +0x2B , 0xFB , 0x2B , 0xFB , 0x66 , 0xFE , 0x66 , 0xFE , 0xD1 , 0x01 , 0xD1 , 0x01 , 0x70 , 0x04 , 0x70 , 0x04 , +0xB2 , 0x04 , 0xB2 , 0x04 , 0x77 , 0x01 , 0x77 , 0x01 , 0x8F , 0xFD , 0x8F , 0xFD , 0x20 , 0xFB , 0x20 , 0xFB , +0xFD , 0xF9 , 0xFD , 0xF9 , 0x53 , 0xFA , 0x53 , 0xFA , 0xE3 , 0xFA , 0xE3 , 0xFA , 0x0B , 0xFB , 0x0B , 0xFB , +0x52 , 0xFC , 0x52 , 0xFC , 0x9A , 0xFD , 0x9A , 0xFD , 0xDF , 0xFD , 0xDF , 0xFD , 0xDB , 0xFC , 0xDB , 0xFC , +0xEB , 0xF9 , 0xEB , 0xF9 , 0xF3 , 0xF5 , 0xF3 , 0xF5 , 0x44 , 0xF2 , 0x44 , 0xF2 , 0x95 , 0xEF , 0x95 , 0xEF , +0xEF , 0xEE , 0xEF , 0xEE , 0x3B , 0xF0 , 0x3B , 0xF0 , 0xA8 , 0xF1 , 0xA8 , 0xF1 , 0x87 , 0xF2 , 0x87 , 0xF2 , +0xCC , 0xF2 , 0xCC , 0xF2 , 0x9D , 0xF3 , 0x9D , 0xF3 , 0xFB , 0xF5 , 0xFB , 0xF5 , 0x61 , 0xF9 , 0x61 , 0xF9 , +0x8E , 0xFB , 0x8E , 0xFB , 0x18 , 0xFC , 0x18 , 0xFC , 0x15 , 0x01 , 0x15 , 0x01 , 0x6B , 0x0E , 0x6B , 0x0E , +0xB9 , 0x1E , 0xB9 , 0x1E , 0x0F , 0x27 , 0x0F , 0x27 , 0x9D , 0x21 , 0x9D , 0x21 , 0x7A , 0x12 , 0x7A , 0x12 , +0x8C , 0x04 , 0x8C , 0x04 , 0xAE , 0xFF , 0xAE , 0xFF , 0xD5 , 0x01 , 0xD5 , 0x01 , 0x10 , 0x05 , 0x10 , 0x05 , +0xF6 , 0x05 , 0xF6 , 0x05 , 0x24 , 0x06 , 0x24 , 0x06 , 0xEA , 0x08 , 0xEA , 0x08 , 0xD6 , 0x0D , 0xD6 , 0x0D , +0x2E , 0x10 , 0x2E , 0x10 , 0x4E , 0x0C , 0x4E , 0x0C , 0x3A , 0x03 , 0x3A , 0x03 , 0xB3 , 0xF9 , 0xB3 , 0xF9 , +0x1D , 0xF5 , 0x1D , 0xF5 , 0x21 , 0xF6 , 0x21 , 0xF6 , 0x71 , 0xF9 , 0x71 , 0xF9 , 0x4C , 0xFC , 0x4C , 0xFC , +0x8C , 0xFE , 0x8C , 0xFE , 0xB4 , 0x00 , 0xB4 , 0x00 , 0xF7 , 0x02 , 0xF7 , 0x02 , 0xD7 , 0x04 , 0xD7 , 0x04 , +0xA1 , 0x03 , 0xA1 , 0x03 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0x94 , 0xFC , 0x94 , 0xFC , 0xB8 , 0xFA , 0xB8 , 0xFA , +0xDF , 0xFA , 0xDF , 0xFA , 0x52 , 0xFC , 0x52 , 0xFC , 0xAA , 0xFC , 0xAA , 0xFC , 0xDB , 0xFC , 0xDB , 0xFC , +0x60 , 0xFD , 0x60 , 0xFD , 0x7C , 0xFD , 0x7C , 0xFD , 0x40 , 0xFD , 0x40 , 0xFD , 0x8E , 0xFB , 0x8E , 0xFB , +0x61 , 0xF8 , 0x61 , 0xF8 , 0xD5 , 0xF4 , 0xD5 , 0xF4 , 0x98 , 0xF1 , 0x98 , 0xF1 , 0xF5 , 0xEF , 0xF5 , 0xEF , +0xBC , 0xF0 , 0xBC , 0xF0 , 0x94 , 0xF2 , 0x94 , 0xF2 , 0xE6 , 0xF3 , 0xE6 , 0xF3 , 0x2A , 0xF4 , 0x2A , 0xF4 , +0xD8 , 0xF3 , 0xD8 , 0xF3 , 0xB0 , 0xF4 , 0xB0 , 0xF4 , 0x24 , 0xF7 , 0x24 , 0xF7 , 0xE5 , 0xF9 , 0xE5 , 0xF9 , +0x1F , 0xFB , 0x1F , 0xFB , 0x39 , 0xFB , 0x39 , 0xFB , 0xE8 , 0x00 , 0xE8 , 0x00 , 0x08 , 0x0F , 0x08 , 0x0F , +0xCE , 0x1E , 0xCE , 0x1E , 0x01 , 0x25 , 0x01 , 0x25 , 0x4C , 0x1D , 0x4C , 0x1D , 0x4F , 0x0D , 0x4F , 0x0D , +0x5F , 0x00 , 0x5F , 0x00 , 0x5F , 0xFD , 0x5F , 0xFD , 0xF8 , 0x00 , 0xF8 , 0x00 , 0x2A , 0x05 , 0x2A , 0x05 , +0xAA , 0x06 , 0xAA , 0x06 , 0x1F , 0x07 , 0x1F , 0x07 , 0xA9 , 0x09 , 0xA9 , 0x09 , 0xE8 , 0x0D , 0xE8 , 0x0D , +0x86 , 0x0F , 0x86 , 0x0F , 0x79 , 0x0B , 0x79 , 0x0B , 0xB6 , 0x02 , 0xB6 , 0x02 , 0xCA , 0xF9 , 0xCA , 0xF9 , +0xB6 , 0xF5 , 0xB6 , 0xF5 , 0xF5 , 0xF6 , 0xF5 , 0xF6 , 0x62 , 0xFA , 0x62 , 0xFA , 0x80 , 0xFD , 0x80 , 0xFD , +0xD6 , 0xFF , 0xD6 , 0xFF , 0xA1 , 0x01 , 0xA1 , 0x01 , 0x31 , 0x03 , 0x31 , 0x03 , 0x46 , 0x04 , 0x46 , 0x04 , +0x9B , 0x02 , 0x9B , 0x02 , 0x2F , 0xFF , 0x2F , 0xFF , 0xB8 , 0xFC , 0xB8 , 0xFC , 0xBE , 0xFB , 0xBE , 0xFB , +0x80 , 0xFC , 0x80 , 0xFC , 0x87 , 0xFD , 0x87 , 0xFD , 0xD5 , 0xFC , 0xD5 , 0xFC , 0xA3 , 0xFB , 0xA3 , 0xFB , +0xF6 , 0xFB , 0xF6 , 0xFB , 0xAD , 0xFC , 0xAD , 0xFC , 0x3D , 0xFD , 0x3D , 0xFD , 0x65 , 0xFC , 0x65 , 0xFC , +0x99 , 0xF9 , 0x99 , 0xF9 , 0x5D , 0xF6 , 0x5D , 0xF6 , 0x18 , 0xF3 , 0x18 , 0xF3 , 0xB5 , 0xF0 , 0xB5 , 0xF0 , +0x9E , 0xF0 , 0x9E , 0xF0 , 0x9A , 0xF2 , 0x9A , 0xF2 , 0x15 , 0xF5 , 0x15 , 0xF5 , 0xAB , 0xF6 , 0xAB , 0xF6 , +0xB3 , 0xF6 , 0xB3 , 0xF6 , 0x0E , 0xF6 , 0x0E , 0xF6 , 0x2A , 0xF6 , 0x2A , 0xF6 , 0x22 , 0xF7 , 0x22 , 0xF7 , +0xC0 , 0xF8 , 0xC0 , 0xF8 , 0xCB , 0xF9 , 0xCB , 0xF9 , 0xA8 , 0xFD , 0xA8 , 0xFD , 0x9F , 0x09 , 0x9F , 0x09 , +0x50 , 0x1A , 0x50 , 0x1A , 0x20 , 0x25 , 0x20 , 0x25 , 0xD0 , 0x21 , 0xD0 , 0x21 , 0xC6 , 0x12 , 0xC6 , 0x12 , +0x98 , 0x02 , 0x98 , 0x02 , 0x91 , 0xFB , 0x91 , 0xFB , 0x9B , 0xFD , 0x9B , 0xFD , 0xC4 , 0x01 , 0xC4 , 0x01 , +0x4D , 0x04 , 0x4D , 0x04 , 0xB3 , 0x06 , 0xB3 , 0x06 , 0x21 , 0x0B , 0x21 , 0x0B , 0x19 , 0x10 , 0x19 , 0x10 , +0x1C , 0x11 , 0x1C , 0x11 , 0x83 , 0x0B , 0x83 , 0x0B , 0xFB , 0x01 , 0xFB , 0x01 , 0xEA , 0xF9 , 0xEA , 0xF9 , +0x64 , 0xF6 , 0x64 , 0xF6 , 0xDE , 0xF6 , 0xDE , 0xF6 , 0x11 , 0xF9 , 0x11 , 0xF9 , 0xB3 , 0xFB , 0xB3 , 0xFB , +0x0D , 0xFF , 0x0D , 0xFF , 0x25 , 0x03 , 0x25 , 0x03 , 0x2F , 0x06 , 0x2F , 0x06 , 0x53 , 0x05 , 0x53 , 0x05 , +0x26 , 0x01 , 0x26 , 0x01 , 0x7B , 0xFD , 0x7B , 0xFD , 0xA1 , 0xFB , 0xA1 , 0xFB , 0x09 , 0xFC , 0x09 , 0xFC , +0x96 , 0xFD , 0x96 , 0xFD , 0xF4 , 0xFD , 0xF4 , 0xFD , 0xFD , 0xFD , 0xFD , 0xFD , 0xF0 , 0xFE , 0xF0 , 0xFE , +0xAB , 0xFF , 0xAB , 0xFF , 0xAB , 0xFF , 0xAB , 0xFF , 0x04 , 0xFF , 0x04 , 0xFF , 0xE0 , 0xFC , 0xE0 , 0xFC , +0xE6 , 0xFA , 0xE6 , 0xFA , 0xD2 , 0xF9 , 0xD2 , 0xF9 , 0x9A , 0xF8 , 0x9A , 0xF8 , 0xAF , 0xF6 , 0xAF , 0xF6 , +0x99 , 0xF3 , 0x99 , 0xF3 , 0x19 , 0xF1 , 0x19 , 0xF1 , 0xD7 , 0xF1 , 0xD7 , 0xF1 , 0x45 , 0xF5 , 0x45 , 0xF5 , +0x4E , 0xF8 , 0x4E , 0xF8 , 0xE8 , 0xF8 , 0xE8 , 0xF8 , 0x6B , 0xF7 , 0x6B , 0xF7 , 0x1B , 0xF6 , 0x1B , 0xF6 , +0x95 , 0xF6 , 0x95 , 0xF6 , 0x10 , 0xF8 , 0x10 , 0xF8 , 0x87 , 0xF9 , 0x87 , 0xF9 , 0x08 , 0xFA , 0x08 , 0xFA , +0xFD , 0xFD , 0xFD , 0xFD , 0x13 , 0x0B , 0x13 , 0x0B , 0x90 , 0x1C , 0x90 , 0x1C , 0x67 , 0x26 , 0x67 , 0x26 , +0xD2 , 0x20 , 0xD2 , 0x20 , 0x1A , 0x10 , 0x1A , 0x10 , 0x46 , 0x00 , 0x46 , 0x00 , 0xD1 , 0xFA , 0xD1 , 0xFA , +0xE2 , 0xFD , 0xE2 , 0xFD , 0x91 , 0x01 , 0x91 , 0x01 , 0x82 , 0x03 , 0x82 , 0x03 , 0xD6 , 0x06 , 0xD6 , 0x06 , +0xEF , 0x0C , 0xEF , 0x0C , 0x1F , 0x12 , 0x1F , 0x12 , 0x1B , 0x11 , 0x1B , 0x11 , 0x1A , 0x09 , 0x1A , 0x09 , +0x48 , 0xFF , 0x48 , 0xFF , 0x1F , 0xF9 , 0x1F , 0xF9 , 0x71 , 0xF7 , 0x71 , 0xF7 , 0xDF , 0xF7 , 0xDF , 0xF7 , +0xEB , 0xF8 , 0xEB , 0xF8 , 0x21 , 0xFB , 0x21 , 0xFB , 0x85 , 0xFF , 0x85 , 0xFF , 0xC8 , 0x04 , 0xC8 , 0x04 , +0xB0 , 0x07 , 0xB0 , 0x07 , 0x60 , 0x05 , 0x60 , 0x05 , 0x27 , 0x00 , 0x27 , 0x00 , 0xAA , 0xFC , 0xAA , 0xFC , +0xC4 , 0xFB , 0xC4 , 0xFB , 0x36 , 0xFC , 0x36 , 0xFC , 0x32 , 0xFD , 0x32 , 0xFD , 0x66 , 0xFD , 0x66 , 0xFD , +0x8A , 0xFD , 0x8A , 0xFD , 0x04 , 0xFF , 0x04 , 0xFF , 0x16 , 0x00 , 0x16 , 0x00 , 0x17 , 0xFF , 0x17 , 0xFF , +0x3D , 0xFD , 0x3D , 0xFD , 0x90 , 0xFB , 0x90 , 0xFB , 0xAE , 0xFA , 0xAE , 0xFA , 0xED , 0xFA , 0xED , 0xFA , +0x2B , 0xFA , 0x2B , 0xFA , 0x07 , 0xF8 , 0x07 , 0xF8 , 0x17 , 0xF5 , 0x17 , 0xF5 , 0x9E , 0xF2 , 0x9E , 0xF2 , +0x1F , 0xF3 , 0x1F , 0xF3 , 0x39 , 0xF6 , 0x39 , 0xF6 , 0xDD , 0xF8 , 0xDD , 0xF8 , 0xCF , 0xF8 , 0xCF , 0xF8 , +0xB8 , 0xF6 , 0xB8 , 0xF6 , 0x15 , 0xF5 , 0x15 , 0xF5 , 0xB4 , 0xF5 , 0xB4 , 0xF5 , 0x89 , 0xF7 , 0x89 , 0xF7 , +0x15 , 0xF9 , 0x15 , 0xF9 , 0x3C , 0xF9 , 0x3C , 0xF9 , 0xC6 , 0xF9 , 0xC6 , 0xF9 , 0x51 , 0x02 , 0x51 , 0x02 , +0x89 , 0x13 , 0x89 , 0x13 , 0xC2 , 0x22 , 0xC2 , 0x22 , 0x1D , 0x24 , 0x1D , 0x24 , 0xE6 , 0x16 , 0xE6 , 0x16 , +0x84 , 0x05 , 0x84 , 0x05 , 0x0B , 0xFC , 0x0B , 0xFC , 0x03 , 0xFD , 0x03 , 0xFD , 0xBD , 0x00 , 0xBD , 0x00 , +0x32 , 0x02 , 0x32 , 0x02 , 0x5D , 0x04 , 0x5D , 0x04 , 0x6B , 0x0A , 0x6B , 0x0A , 0xAB , 0x11 , 0xAB , 0x11 , +0x51 , 0x13 , 0x51 , 0x13 , 0x8D , 0x0C , 0x8D , 0x0C , 0x12 , 0x02 , 0x12 , 0x02 , 0x2B , 0xFB , 0x2B , 0xFB , +0x0C , 0xFA , 0x0C , 0xFA , 0x80 , 0xFA , 0x80 , 0xFA , 0x48 , 0xF9 , 0x48 , 0xF9 , 0x63 , 0xF8 , 0x63 , 0xF8 , +0x47 , 0xFB , 0x47 , 0xFB , 0x6F , 0x01 , 0x6F , 0x01 , 0x4C , 0x06 , 0x4C , 0x06 , 0x59 , 0x06 , 0x59 , 0x06 , +0x7A , 0x02 , 0x7A , 0x02 , 0x3D , 0xFE , 0x3D , 0xFE , 0x9F , 0xFD , 0x9F , 0xFD , 0xD6 , 0xFE , 0xD6 , 0xFE , +0x5A , 0xFE , 0x5A , 0xFE , 0x53 , 0xFD , 0x53 , 0xFD , 0x32 , 0xFE , 0x32 , 0xFE , 0x84 , 0x00 , 0x84 , 0x00 , +0x4F , 0x02 , 0x4F , 0x02 , 0x84 , 0x01 , 0x84 , 0x01 , 0x40 , 0xFE , 0x40 , 0xFE , 0xC8 , 0xFB , 0xC8 , 0xFB , +0x32 , 0xFC , 0x32 , 0xFC , 0x28 , 0xFD , 0x28 , 0xFD , 0xF7 , 0xFC , 0xF7 , 0xFC , 0xE0 , 0xFA , 0xE0 , 0xFA , +0x04 , 0xF8 , 0x04 , 0xF8 , 0x5C , 0xF6 , 0x5C , 0xF6 , 0xE9 , 0xF4 , 0xE9 , 0xF4 , 0x40 , 0xF4 , 0x40 , 0xF4 , +0x98 , 0xF5 , 0x98 , 0xF5 , 0xE2 , 0xF7 , 0xE2 , 0xF7 , 0xF7 , 0xF8 , 0xF7 , 0xF8 , 0xC1 , 0xF7 , 0xC1 , 0xF7 , +0x9F , 0xF5 , 0x9F , 0xF5 , 0x16 , 0xF5 , 0x16 , 0xF5 , 0xF5 , 0xF6 , 0xF5 , 0xF6 , 0xAD , 0xF9 , 0xAD , 0xF9 , +0x7C , 0xFB , 0x7C , 0xFB , 0x0A , 0xFB , 0x0A , 0xFB , 0xFB , 0xFD , 0xFB , 0xFD , 0x89 , 0x0A , 0x89 , 0x0A , +0x56 , 0x1B , 0x56 , 0x1B , 0x29 , 0x23 , 0x29 , 0x23 , 0x77 , 0x1B , 0x77 , 0x1B , 0xCF , 0x0B , 0xCF , 0x0B , +0x51 , 0x00 , 0x51 , 0x00 , 0x9C , 0xFE , 0x9C , 0xFE , 0x84 , 0x00 , 0x84 , 0x00 , 0xD7 , 0xFF , 0xD7 , 0xFF , +0x1F , 0x00 , 0x1F , 0x00 , 0x40 , 0x06 , 0x40 , 0x06 , 0x8A , 0x0F , 0x8A , 0x0F , 0xAB , 0x13 , 0xAB , 0x13 , +0x3C , 0x0E , 0x3C , 0x0E , 0x53 , 0x04 , 0x53 , 0x04 , 0x50 , 0xFD , 0x50 , 0xFD , 0x30 , 0xFC , 0x30 , 0xFC , +0x96 , 0xFC , 0x96 , 0xFC , 0xD3 , 0xFA , 0xD3 , 0xFA , 0xAE , 0xF9 , 0xAE , 0xF9 , 0xCD , 0xFC , 0xCD , 0xFC , +0x9F , 0x02 , 0x9F , 0x02 , 0x6E , 0x06 , 0x6E , 0x06 , 0x23 , 0x05 , 0x23 , 0x05 , 0x2D , 0x01 , 0x2D , 0x01 , +0xE6 , 0xFD , 0xE6 , 0xFD , 0x3D , 0xFD , 0x3D , 0xFD , 0x31 , 0xFE , 0x31 , 0xFE , 0x8D , 0xFD , 0x8D , 0xFD , +0xBD , 0xFC , 0xBD , 0xFC , 0xA2 , 0xFE , 0xA2 , 0xFE , 0xAA , 0x01 , 0xAA , 0x01 , 0xC2 , 0x02 , 0xC2 , 0x02 , +0x47 , 0x01 , 0x47 , 0x01 , 0x88 , 0xFE , 0x88 , 0xFE , 0x91 , 0xFC , 0x91 , 0xFC , 0x92 , 0xFC , 0x92 , 0xFC , +0xE0 , 0xFC , 0xE0 , 0xFC , 0xD4 , 0xFB , 0xD4 , 0xFB , 0xDC , 0xFA , 0xDC , 0xFA , 0xF4 , 0xF9 , 0xF4 , 0xF9 , +0x75 , 0xF9 , 0x75 , 0xF9 , 0xB2 , 0xF8 , 0xB2 , 0xF8 , 0x78 , 0xF6 , 0x78 , 0xF6 , 0xB9 , 0xF3 , 0xB9 , 0xF3 , +0xDC , 0xF3 , 0xDC , 0xF3 , 0x50 , 0xF6 , 0x50 , 0xF6 , 0x04 , 0xF8 , 0x04 , 0xF8 , 0x87 , 0xF6 , 0x87 , 0xF6 , +0xAF , 0xF3 , 0xAF , 0xF3 , 0xDE , 0xF2 , 0xDE , 0xF2 , 0xCF , 0xF4 , 0xCF , 0xF4 , 0x7C , 0xF7 , 0x7C , 0xF7 , +0x90 , 0xF9 , 0x90 , 0xF9 , 0x86 , 0xFA , 0x86 , 0xFA , 0x3E , 0xFC , 0x3E , 0xFC , 0xDC , 0x04 , 0xDC , 0x04 , +0xDE , 0x12 , 0xDE , 0x12 , 0x86 , 0x1D , 0x86 , 0x1D , 0x11 , 0x1C , 0x11 , 0x1C , 0xCA , 0x10 , 0xCA , 0x10 , +0x8A , 0x05 , 0x8A , 0x05 , 0x1D , 0x01 , 0x1D , 0x01 , 0xA0 , 0x01 , 0xA0 , 0x01 , 0x38 , 0x01 , 0x38 , 0x01 , +0x16 , 0x01 , 0x16 , 0x01 , 0xF6 , 0x05 , 0xF6 , 0x05 , 0x8E , 0x0E , 0x8E , 0x0E , 0xDE , 0x13 , 0xDE , 0x13 , +0xB6 , 0x10 , 0xB6 , 0x10 , 0x28 , 0x08 , 0x28 , 0x08 , 0xB8 , 0x00 , 0xB8 , 0x00 , 0x27 , 0xFD , 0x27 , 0xFD , +0xC6 , 0xFB , 0xC6 , 0xFB , 0x88 , 0xF9 , 0x88 , 0xF9 , 0xB6 , 0xF8 , 0xB6 , 0xF8 , 0x60 , 0xFC , 0x60 , 0xFC , +0x8A , 0x02 , 0x8A , 0x02 , 0x0A , 0x06 , 0x0A , 0x06 , 0xF3 , 0x04 , 0xF3 , 0x04 , 0x2C , 0x01 , 0x2C , 0x01 , +0xC3 , 0xFE , 0xC3 , 0xFE , 0xEB , 0xFD , 0xEB , 0xFD , 0x4D , 0xFC , 0x4D , 0xFC , 0x12 , 0xFB , 0x12 , 0xFB , +0x46 , 0xFB , 0x46 , 0xFB , 0xD3 , 0xFD , 0xD3 , 0xFD , 0xEE , 0x01 , 0xEE , 0x01 , 0xFB , 0x03 , 0xFB , 0x03 , +0x4E , 0x02 , 0x4E , 0x02 , 0x98 , 0xFF , 0x98 , 0xFF , 0x3C , 0xFE , 0x3C , 0xFE , 0x76 , 0xFD , 0x76 , 0xFD , +0x97 , 0xFC , 0x97 , 0xFC , 0xF8 , 0xFB , 0xF8 , 0xFB , 0x48 , 0xFB , 0x48 , 0xFB , 0xF3 , 0xFB , 0xF3 , 0xFB , +0xB0 , 0xFC , 0xB0 , 0xFC , 0xD1 , 0xFB , 0xD1 , 0xFB , 0xD1 , 0xF9 , 0xD1 , 0xF9 , 0x85 , 0xF7 , 0x85 , 0xF7 , +0x43 , 0xF5 , 0x43 , 0xF5 , 0x9C , 0xF4 , 0x9C , 0xF4 , 0x77 , 0xF5 , 0x77 , 0xF5 , 0xA4 , 0xF6 , 0xA4 , 0xF6 , +0xDC , 0xF6 , 0xDC , 0xF6 , 0xF1 , 0xF5 , 0xF1 , 0xF5 , 0x46 , 0xF5 , 0x46 , 0xF5 , 0x7B , 0xF5 , 0x7B , 0xF5 , +0xA2 , 0xF6 , 0xA2 , 0xF6 , 0xA9 , 0xF8 , 0xA9 , 0xF8 , 0x93 , 0xFB , 0x93 , 0xFB , 0x5F , 0xFD , 0x5F , 0xFD , +0xD3 , 0x01 , 0xD3 , 0x01 , 0x52 , 0x0C , 0x52 , 0x0C , 0x06 , 0x18 , 0x06 , 0x18 , 0xA9 , 0x1B , 0xA9 , 0x1B , +0x56 , 0x14 , 0x56 , 0x14 , 0x95 , 0x09 , 0x95 , 0x09 , 0x27 , 0x03 , 0x27 , 0x03 , 0x1A , 0x02 , 0x1A , 0x02 , +0xBF , 0x01 , 0xBF , 0x01 , 0xE8 , 0x00 , 0xE8 , 0x00 , 0x79 , 0x04 , 0x79 , 0x04 , 0x92 , 0x0C , 0x92 , 0x0C , +0xBD , 0x12 , 0xBD , 0x12 , 0x99 , 0x11 , 0x99 , 0x11 , 0xE8 , 0x0A , 0xE8 , 0x0A , 0xED , 0x04 , 0xED , 0x04 , +0x5B , 0x01 , 0x5B , 0x01 , 0xFF , 0xFD , 0xFF , 0xFD , 0xDA , 0xF9 , 0xDA , 0xF9 , 0xF6 , 0xF7 , 0xF6 , 0xF7 , +0xB0 , 0xFB , 0xB0 , 0xFB , 0x1B , 0x02 , 0x1B , 0x02 , 0x70 , 0x05 , 0x70 , 0x05 , 0xA5 , 0x04 , 0xA5 , 0x04 , +0xCC , 0x02 , 0xCC , 0x02 , 0xEC , 0x01 , 0xEC , 0x01 , 0x3E , 0x01 , 0x3E , 0x01 , 0x23 , 0xFE , 0x23 , 0xFE , +0xF1 , 0xFA , 0xF1 , 0xFA , 0xF3 , 0xFA , 0xF3 , 0xFA , 0x23 , 0xFD , 0x23 , 0xFD , 0xAB , 0xFF , 0xAB , 0xFF , +0x02 , 0x01 , 0x02 , 0x01 , 0xF7 , 0x00 , 0xF7 , 0x00 , 0xC7 , 0x00 , 0xC7 , 0x00 , 0xC1 , 0x00 , 0xC1 , 0x00 , +0x66 , 0xFF , 0x66 , 0xFF , 0xF3 , 0xFC , 0xF3 , 0xFC , 0xF7 , 0xFB , 0xF7 , 0xFB , 0x22 , 0xFC , 0x22 , 0xFC , +0x38 , 0xFC , 0x38 , 0xFC , 0x10 , 0xFC , 0x10 , 0xFC , 0x0E , 0xFB , 0x0E , 0xFB , 0x79 , 0xFA , 0x79 , 0xFA , +0x49 , 0xFA , 0x49 , 0xFA , 0x07 , 0xF9 , 0x07 , 0xF9 , 0xD8 , 0xF6 , 0xD8 , 0xF6 , 0xF5 , 0xF5 , 0xF5 , 0xF5 , +0x6E , 0xF6 , 0x6E , 0xF6 , 0x40 , 0xF7 , 0x40 , 0xF7 , 0xDD , 0xF6 , 0xDD , 0xF6 , 0xA1 , 0xF5 , 0xA1 , 0xF5 , +0x5F , 0xF5 , 0x5F , 0xF5 , 0x0C , 0xF6 , 0x0C , 0xF6 , 0xFE , 0xF6 , 0xFE , 0xF6 , 0x6D , 0xF8 , 0x6D , 0xF8 , +0x10 , 0xFB , 0x10 , 0xFB , 0x5B , 0xFD , 0x5B , 0xFD , 0xF7 , 0x01 , 0xF7 , 0x01 , 0x91 , 0x0B , 0x91 , 0x0B , +0x1D , 0x15 , 0x1D , 0x15 , 0x92 , 0x17 , 0x92 , 0x17 , 0x6D , 0x12 , 0x6D , 0x12 , 0xBA , 0x0B , 0xBA , 0x0B , +0x53 , 0x07 , 0x53 , 0x07 , 0xAB , 0x04 , 0xAB , 0x04 , 0x73 , 0x01 , 0x73 , 0x01 , 0x8C , 0xFF , 0x8C , 0xFF , +0x85 , 0x03 , 0x85 , 0x03 , 0xB5 , 0x0A , 0xB5 , 0x0A , 0x70 , 0x0E , 0x70 , 0x0E , 0x12 , 0x0D , 0x12 , 0x0D , +0xBB , 0x09 , 0xBB , 0x09 , 0x4F , 0x07 , 0x4F , 0x07 , 0x1D , 0x04 , 0x1D , 0x04 , 0x88 , 0xFE , 0x88 , 0xFE , +0x5C , 0xF9 , 0x5C , 0xF9 , 0x62 , 0xF8 , 0x62 , 0xF8 , 0xD9 , 0xFB , 0xD9 , 0xFB , 0xD8 , 0xFF , 0xD8 , 0xFF , +0xBF , 0x01 , 0xBF , 0x01 , 0xF7 , 0x02 , 0xF7 , 0x02 , 0xA5 , 0x04 , 0xA5 , 0x04 , 0xE8 , 0x04 , 0xE8 , 0x04 , +0x6B , 0x02 , 0x6B , 0x02 , 0x64 , 0xFE , 0x64 , 0xFE , 0x7B , 0xFC , 0x7B , 0xFC , 0xE7 , 0xFC , 0xE7 , 0xFC , +0x1F , 0xFD , 0x1F , 0xFD , 0x09 , 0xFD , 0x09 , 0xFD , 0x65 , 0xFE , 0x65 , 0xFE , 0xFE , 0x00 , 0xFE , 0x00 , +0xAC , 0x02 , 0xAC , 0x02 , 0xFE , 0x01 , 0xFE , 0x01 , 0x48 , 0x00 , 0x48 , 0x00 , 0xA2 , 0xFE , 0xA2 , 0xFE , +0x65 , 0xFD , 0x65 , 0xFD , 0x60 , 0xFC , 0x60 , 0xFC , 0x50 , 0xFA , 0x50 , 0xFA , 0xAA , 0xF9 , 0xAA , 0xF9 , +0xD8 , 0xFA , 0xD8 , 0xFA , 0x71 , 0xFB , 0x71 , 0xFB , 0x21 , 0xFB , 0x21 , 0xFB , 0x37 , 0xFA , 0x37 , 0xFA , +0x51 , 0xF8 , 0x51 , 0xF8 , 0xC9 , 0xF6 , 0xC9 , 0xF6 , 0x11 , 0xF6 , 0x11 , 0xF6 , 0xCE , 0xF5 , 0xCE , 0xF5 , +0x15 , 0xF6 , 0x15 , 0xF6 , 0xF4 , 0xF5 , 0xF4 , 0xF5 , 0x31 , 0xF6 , 0x31 , 0xF6 , 0xF4 , 0xF6 , 0xF4 , 0xF6 , +0xAE , 0xF7 , 0xAE , 0xF7 , 0xBC , 0xF8 , 0xBC , 0xF8 , 0x16 , 0xFB , 0x16 , 0xFB , 0x67 , 0xFD , 0x67 , 0xFD , +0xA1 , 0xFF , 0xA1 , 0xFF , 0x8D , 0x06 , 0x8D , 0x06 , 0xD5 , 0x10 , 0xD5 , 0x10 , 0xCF , 0x16 , 0xCF , 0x16 , +0xFD , 0x14 , 0xFD , 0x14 , 0x96 , 0x0F , 0x96 , 0x0F , 0x05 , 0x0B , 0x05 , 0x0B , 0x2C , 0x07 , 0x2C , 0x07 , +0x99 , 0x02 , 0x99 , 0x02 , 0x59 , 0xFE , 0x59 , 0xFE , 0x51 , 0xFF , 0x51 , 0xFF , 0x3C , 0x05 , 0x3C , 0x05 , +0xD4 , 0x09 , 0xD4 , 0x09 , 0xAC , 0x0A , 0xAC , 0x0A , 0xA7 , 0x0A , 0xA7 , 0x0A , 0x90 , 0x0A , 0x90 , 0x0A , +0x5D , 0x08 , 0x5D , 0x08 , 0xB4 , 0x02 , 0xB4 , 0x02 , 0xC7 , 0xFC , 0xC7 , 0xFC , 0x6F , 0xFA , 0x6F , 0xFA , +0x72 , 0xFA , 0x72 , 0xFA , 0xF2 , 0xFA , 0xF2 , 0xFA , 0x80 , 0xFC , 0x80 , 0xFC , 0xE2 , 0xFF , 0xE2 , 0xFF , +0x8D , 0x03 , 0x8D , 0x03 , 0xDA , 0x04 , 0xDA , 0x04 , 0x41 , 0x03 , 0x41 , 0x03 , 0x70 , 0x01 , 0x70 , 0x01 , +0xEC , 0xFF , 0xEC , 0xFF , 0x74 , 0xFE , 0x74 , 0xFE , 0x89 , 0xFC , 0x89 , 0xFC , 0x4E , 0xFB , 0x4E , 0xFB , +0x92 , 0xFC , 0x92 , 0xFC , 0xBD , 0xFE , 0xBD , 0xFE , 0xD5 , 0xFF , 0xD5 , 0xFF , 0xB3 , 0x00 , 0xB3 , 0x00 , +0xCC , 0x01 , 0xCC , 0x01 , 0x44 , 0x02 , 0x44 , 0x02 , 0xB7 , 0x00 , 0xB7 , 0x00 , 0xAF , 0xFD , 0xAF , 0xFD , +0x4D , 0xFC , 0x4D , 0xFC , 0x77 , 0xFB , 0x77 , 0xFB , 0x5A , 0xFA , 0x5A , 0xFA , 0x07 , 0xFA , 0x07 , 0xFA , +0x7E , 0xFA , 0x7E , 0xFA , 0x85 , 0xFB , 0x85 , 0xFB , 0x1C , 0xFC , 0x1C , 0xFC , 0x48 , 0xFA , 0x48 , 0xFA , +0xBE , 0xF7 , 0xBE , 0xF7 , 0xC5 , 0xF6 , 0xC5 , 0xF6 , 0x8E , 0xF6 , 0x8E , 0xF6 , 0x51 , 0xF6 , 0x51 , 0xF6 , +0x1E , 0xF5 , 0x1E , 0xF5 , 0xB0 , 0xF4 , 0xB0 , 0xF4 , 0xB1 , 0xF5 , 0xB1 , 0xF5 , 0x59 , 0xF6 , 0x59 , 0xF6 , +0x07 , 0xF7 , 0x07 , 0xF7 , 0x6D , 0xF9 , 0x6D , 0xF9 , 0x80 , 0xFC , 0x80 , 0xFC , 0x23 , 0xFE , 0x23 , 0xFE , +0x82 , 0x02 , 0x82 , 0x02 , 0xA0 , 0x0B , 0xA0 , 0x0B , 0x1D , 0x13 , 0x1D , 0x13 , 0x81 , 0x13 , 0x81 , 0x13 , +0x03 , 0x10 , 0x03 , 0x10 , 0x44 , 0x0D , 0x44 , 0x0D , 0xDC , 0x09 , 0xDC , 0x09 , 0xE7 , 0x04 , 0xE7 , 0x04 , +0x27 , 0x00 , 0x27 , 0x00 , 0x00 , 0xFF , 0x00 , 0xFF , 0xD5 , 0x01 , 0xD5 , 0x01 , 0xDE , 0x04 , 0xDE , 0x04 , +0x4E , 0x06 , 0x4E , 0x06 , 0xEB , 0x07 , 0xEB , 0x07 , 0x70 , 0x09 , 0x70 , 0x09 , 0xB8 , 0x08 , 0xB8 , 0x08 , +0x6F , 0x05 , 0x6F , 0x05 , 0x47 , 0x01 , 0x47 , 0x01 , 0xFC , 0xFD , 0xFC , 0xFD , 0x8A , 0xFB , 0x8A , 0xFB , +0x27 , 0xFA , 0x27 , 0xFA , 0x9E , 0xFA , 0x9E , 0xFA , 0xC6 , 0xFC , 0xC6 , 0xFC , 0x60 , 0xFF , 0x60 , 0xFF , +0x89 , 0x01 , 0x89 , 0x01 , 0x1A , 0x03 , 0x1A , 0x03 , 0xE8 , 0x03 , 0xE8 , 0x03 , 0x3B , 0x03 , 0x3B , 0x03 , +0xC5 , 0x01 , 0xC5 , 0x01 , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xC5 , 0xFD , 0xC5 , 0xFD , 0x6C , 0xFC , 0x6C , 0xFC , +0x0F , 0xFC , 0x0F , 0xFC , 0x7B , 0xFC , 0x7B , 0xFC , 0x85 , 0xFD , 0x85 , 0xFD , 0xAE , 0xFE , 0xAE , 0xFE , +0xCC , 0xFF , 0xCC , 0xFF , 0xCA , 0x00 , 0xCA , 0x00 , 0x5D , 0x00 , 0x5D , 0x00 , 0x47 , 0xFF , 0x47 , 0xFF , +0xA8 , 0xFE , 0xA8 , 0xFE , 0x31 , 0xFD , 0x31 , 0xFD , 0x9C , 0xFB , 0x9C , 0xFB , 0x0A , 0xFB , 0x0A , 0xFB , +0xB2 , 0xFA , 0xB2 , 0xFA , 0x70 , 0xFA , 0x70 , 0xFA , 0xF0 , 0xF9 , 0xF0 , 0xF9 , 0x8B , 0xF8 , 0x8B , 0xF8 , +0x80 , 0xF7 , 0x80 , 0xF7 , 0x24 , 0xF7 , 0x24 , 0xF7 , 0x15 , 0xF7 , 0x15 , 0xF7 , 0xF2 , 0xF6 , 0xF2 , 0xF6 , +0x01 , 0xF7 , 0x01 , 0xF7 , 0x70 , 0xF7 , 0x70 , 0xF7 , 0xAC , 0xF7 , 0xAC , 0xF7 , 0x3E , 0xF8 , 0x3E , 0xF8 , +0x20 , 0xF9 , 0x20 , 0xF9 , 0x94 , 0xFA , 0x94 , 0xFA , 0xD2 , 0xFB , 0xD2 , 0xFB , 0x0E , 0xFF , 0x0E , 0xFF , +0x45 , 0x06 , 0x45 , 0x06 , 0x8E , 0x0D , 0x8E , 0x0D , 0xCA , 0x10 , 0xCA , 0x10 , 0x31 , 0x11 , 0x31 , 0x11 , +0x6D , 0x11 , 0x6D , 0x11 , 0x4A , 0x0F , 0x4A , 0x0F , 0x4D , 0x0A , 0x4D , 0x0A , 0x96 , 0x05 , 0x96 , 0x05 , +0xDD , 0x02 , 0xDD , 0x02 , 0x4A , 0x01 , 0x4A , 0x01 , 0x10 , 0x00 , 0x10 , 0x00 , 0x7B , 0x00 , 0x7B , 0x00 , +0x8A , 0x02 , 0x8A , 0x02 , 0x86 , 0x04 , 0x86 , 0x04 , 0xD7 , 0x05 , 0xD7 , 0x05 , 0xD0 , 0x06 , 0xD0 , 0x06 , +0x77 , 0x06 , 0x77 , 0x06 , 0x9C , 0x04 , 0x9C , 0x04 , 0x1C , 0x02 , 0x1C , 0x02 , 0x88 , 0xFF , 0x88 , 0xFF , +0x4E , 0xFD , 0x4E , 0xFD , 0xF1 , 0xFB , 0xF1 , 0xFB , 0xA4 , 0xFB , 0xA4 , 0xFB , 0x76 , 0xFC , 0x76 , 0xFC , +0x10 , 0xFE , 0x10 , 0xFE , 0xC8 , 0xFF , 0xC8 , 0xFF , 0x6C , 0x01 , 0x6C , 0x01 , 0x91 , 0x02 , 0x91 , 0x02 , +0x15 , 0x03 , 0x15 , 0x03 , 0x6B , 0x02 , 0x6B , 0x02 , 0x53 , 0x01 , 0x53 , 0x01 , 0x69 , 0x00 , 0x69 , 0x00 , +0x4C , 0xFF , 0x4C , 0xFF , 0x32 , 0xFE , 0x32 , 0xFE , 0xE0 , 0xFD , 0xE0 , 0xFD , 0xFB , 0xFD , 0xFB , 0xFD , +0x03 , 0xFE , 0x03 , 0xFE , 0x57 , 0xFE , 0x57 , 0xFE , 0x1E , 0xFF , 0x1E , 0xFF , 0x7A , 0xFF , 0x7A , 0xFF , +0x22 , 0xFF , 0x22 , 0xFF , 0x45 , 0xFF , 0x45 , 0xFF , 0x22 , 0xFF , 0x22 , 0xFF , 0x04 , 0xFE , 0x04 , 0xFE , +0x2E , 0xFD , 0x2E , 0xFD , 0xAF , 0xFC , 0xAF , 0xFC , 0xD1 , 0xFB , 0xD1 , 0xFB , 0xD7 , 0xFA , 0xD7 , 0xFA , +0xA6 , 0xF9 , 0xA6 , 0xF9 , 0x3F , 0xF8 , 0x3F , 0xF8 , 0x47 , 0xF7 , 0x47 , 0xF7 , 0xD7 , 0xF6 , 0xD7 , 0xF6 , +0x0D , 0xF7 , 0x0D , 0xF7 , 0x50 , 0xF7 , 0x50 , 0xF7 , 0xC3 , 0xF7 , 0xC3 , 0xF7 , 0x51 , 0xF8 , 0x51 , 0xF8 , +0xBF , 0xF8 , 0xBF , 0xF8 , 0x36 , 0xF9 , 0x36 , 0xF9 , 0xAC , 0xF9 , 0xAC , 0xF9 , 0xA3 , 0xFA , 0xA3 , 0xFA , +0xF7 , 0xFB , 0xF7 , 0xFB , 0x0B , 0x00 , 0x0B , 0x00 , 0xDF , 0x06 , 0xDF , 0x06 , 0xA4 , 0x0C , 0xA4 , 0x0C , +0x71 , 0x0F , 0x71 , 0x0F , 0xF8 , 0x10 , 0xF8 , 0x10 , 0x7A , 0x11 , 0x7A , 0x11 , 0xFE , 0x0E , 0xFE , 0x0E , +0xE9 , 0x0A , 0xE9 , 0x0A , 0x91 , 0x07 , 0x91 , 0x07 , 0xF8 , 0x04 , 0xF8 , 0x04 , 0x96 , 0x02 , 0x96 , 0x02 , +0xAE , 0x00 , 0xAE , 0x00 , 0x61 , 0x00 , 0x61 , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0xCB , 0x01 , 0xCB , 0x01 , +0xE5 , 0x02 , 0xE5 , 0x02 , 0xA4 , 0x04 , 0xA4 , 0x04 , 0x1E , 0x05 , 0x1E , 0x05 , 0x3E , 0x04 , 0x3E , 0x04 , +0x5A , 0x03 , 0x5A , 0x03 , 0xDB , 0x01 , 0xDB , 0x01 , 0x9B , 0xFF , 0x9B , 0xFF , 0xC4 , 0xFD , 0xC4 , 0xFD , +0xBC , 0xFC , 0xBC , 0xFC , 0x25 , 0xFC , 0x25 , 0xFC , 0x29 , 0xFC , 0x29 , 0xFC , 0xBF , 0xFC , 0xBF , 0xFC , +0x08 , 0xFE , 0x08 , 0xFE , 0x5B , 0xFF , 0x5B , 0xFF , 0x8C , 0x00 , 0x8C , 0x00 , 0x5C , 0x01 , 0x5C , 0x01 , +0xCD , 0x01 , 0xCD , 0x01 , 0xC5 , 0x01 , 0xC5 , 0x01 , 0xEA , 0x00 , 0xEA , 0x00 , 0xE7 , 0xFF , 0xE7 , 0xFF , +0x06 , 0xFF , 0x06 , 0xFF , 0x09 , 0xFE , 0x09 , 0xFE , 0x17 , 0xFD , 0x17 , 0xFD , 0xE5 , 0xFC , 0xE5 , 0xFC , +0x49 , 0xFD , 0x49 , 0xFD , 0xC6 , 0xFD , 0xC6 , 0xFD , 0xDE , 0xFD , 0xDE , 0xFD , 0x93 , 0xFE , 0x93 , 0xFE , +0x54 , 0xFF , 0x54 , 0xFF , 0xDA , 0xFE , 0xDA , 0xFE , 0x46 , 0xFE , 0x46 , 0xFE , 0x07 , 0xFE , 0x07 , 0xFE , +0x18 , 0xFD , 0x18 , 0xFD , 0xDE , 0xFB , 0xDE , 0xFB , 0xAB , 0xFA , 0xAB , 0xFA , 0x07 , 0xF9 , 0x07 , 0xF9 , +0x8F , 0xF7 , 0x8F , 0xF7 , 0xE9 , 0xF6 , 0xE9 , 0xF6 , 0xF1 , 0xF6 , 0xF1 , 0xF6 , 0xE7 , 0xF6 , 0xE7 , 0xF6 , +0x77 , 0xF7 , 0x77 , 0xF7 , 0x19 , 0xF8 , 0x19 , 0xF8 , 0xD0 , 0xF8 , 0xD0 , 0xF8 , 0x6A , 0xF9 , 0x6A , 0xF9 , +0x0D , 0xFA , 0x0D , 0xFA , 0x22 , 0xFB , 0x22 , 0xFB , 0x25 , 0xFD , 0x25 , 0xFD , 0x44 , 0x02 , 0x44 , 0x02 , +0x2B , 0x08 , 0x2B , 0x08 , 0x2A , 0x0C , 0x2A , 0x0C , 0x0B , 0x0F , 0x0B , 0x0F , 0x34 , 0x11 , 0x34 , 0x11 , +0x1B , 0x11 , 0x1B , 0x11 , 0xA0 , 0x0E , 0xA0 , 0x0E , 0xE5 , 0x0B , 0xE5 , 0x0B , 0x0B , 0x09 , 0x0B , 0x09 , +0xEE , 0x05 , 0xEE , 0x05 , 0x16 , 0x03 , 0x16 , 0x03 , 0xF4 , 0x00 , 0xF4 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , +0xE7 , 0xFF , 0xE7 , 0xFF , 0x42 , 0x00 , 0x42 , 0x00 , 0xDD , 0x01 , 0xDD , 0x01 , 0x93 , 0x03 , 0x93 , 0x03 , +0xF6 , 0x03 , 0xF6 , 0x03 , 0x38 , 0x04 , 0x38 , 0x04 , 0x3A , 0x04 , 0x3A , 0x04 , 0xFC , 0x02 , 0xFC , 0x02 , +0x7D , 0x01 , 0x7D , 0x01 , 0x1F , 0x00 , 0x1F , 0x00 , 0x8A , 0xFE , 0x8A , 0xFE , 0x77 , 0xFD , 0x77 , 0xFD , +0xD4 , 0xFC , 0xD4 , 0xFC , 0xBB , 0xFC , 0xBB , 0xFC , 0x3C , 0xFD , 0x3C , 0xFD , 0x06 , 0xFE , 0x06 , 0xFE , +0x05 , 0xFF , 0x05 , 0xFF , 0x63 , 0x00 , 0x63 , 0x00 , 0x1F , 0x01 , 0x1F , 0x01 , 0xA7 , 0x01 , 0xA7 , 0x01 , +0xEF , 0x01 , 0xEF , 0x01 , 0x4A , 0x01 , 0x4A , 0x01 , 0x8F , 0x00 , 0x8F , 0x00 , 0xB0 , 0xFF , 0xB0 , 0xFF , +0x69 , 0xFE , 0x69 , 0xFE , 0x79 , 0xFD , 0x79 , 0xFD , 0xFE , 0xFC , 0xFE , 0xFC , 0xDF , 0xFC , 0xDF , 0xFC , +0x15 , 0xFD , 0x15 , 0xFD , 0x1C , 0xFD , 0x1C , 0xFD , 0xFD , 0xFD , 0xFD , 0xFD , 0xC2 , 0xFE , 0xC2 , 0xFE , +0x7D , 0xFE , 0x7D , 0xFE , 0xC1 , 0xFE , 0xC1 , 0xFE , 0xD4 , 0xFE , 0xD4 , 0xFE , 0x6D , 0xFD , 0x6D , 0xFD , +0x38 , 0xFC , 0x38 , 0xFC , 0xF6 , 0xFA , 0xF6 , 0xFA , 0x08 , 0xF9 , 0x08 , 0xF9 , 0x3F , 0xF8 , 0x3F , 0xF8 , +0x08 , 0xF8 , 0x08 , 0xF8 , 0x50 , 0xF7 , 0x50 , 0xF7 , 0x3D , 0xF7 , 0x3D , 0xF7 , 0xCC , 0xF7 , 0xCC , 0xF7 , +0x36 , 0xF8 , 0x36 , 0xF8 , 0x25 , 0xF9 , 0x25 , 0xF9 , 0xC8 , 0xF9 , 0xC8 , 0xF9 , 0xC4 , 0xFA , 0xC4 , 0xFA , +0x1C , 0xFC , 0x1C , 0xFC , 0x99 , 0xFD , 0x99 , 0xFD , 0x8B , 0x02 , 0x8B , 0x02 , 0x58 , 0x07 , 0x58 , 0x07 , +0x5A , 0x0A , 0x5A , 0x0A , 0xA0 , 0x0D , 0xA0 , 0x0D , 0x58 , 0x10 , 0x58 , 0x10 , 0x5E , 0x10 , 0x5E , 0x10 , +0x16 , 0x0F , 0x16 , 0x0F , 0x71 , 0x0D , 0x71 , 0x0D , 0xDB , 0x0A , 0xDB , 0x0A , 0xF5 , 0x07 , 0xF5 , 0x07 , +0xDF , 0x04 , 0xDF , 0x04 , 0xC5 , 0x02 , 0xC5 , 0x02 , 0xCD , 0x00 , 0xCD , 0x00 , 0x44 , 0xFF , 0x44 , 0xFF , +0x5E , 0xFF , 0x5E , 0xFF , 0xBA , 0xFF , 0xBA , 0xFF , 0xC2 , 0xFF , 0xC2 , 0xFF , 0x6B , 0x01 , 0x6B , 0x01 , +0x89 , 0x02 , 0x89 , 0x02 , 0xDE , 0x02 , 0xDE , 0x02 , 0x86 , 0x03 , 0x86 , 0x03 , 0x64 , 0x03 , 0x64 , 0x03 , +0x70 , 0x02 , 0x70 , 0x02 , 0x77 , 0x01 , 0x77 , 0x01 , 0x06 , 0x00 , 0x06 , 0x00 , 0xFB , 0xFE , 0xFB , 0xFE , +0x1B , 0xFE , 0x1B , 0xFE , 0x48 , 0xFD , 0x48 , 0xFD , 0x5A , 0xFD , 0x5A , 0xFD , 0x98 , 0xFD , 0x98 , 0xFD , +0xE9 , 0xFD , 0xE9 , 0xFD , 0xED , 0xFE , 0xED , 0xFE , 0xDC , 0xFF , 0xDC , 0xFF , 0x49 , 0x00 , 0x49 , 0x00 , +0x0B , 0x01 , 0x0B , 0x01 , 0x03 , 0x01 , 0x03 , 0x01 , 0x90 , 0x00 , 0x90 , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , +0x44 , 0xFF , 0x44 , 0xFF , 0x43 , 0xFE , 0x43 , 0xFE , 0xB5 , 0xFD , 0xB5 , 0xFD , 0x33 , 0xFD , 0x33 , 0xFD , +0x4D , 0xFD , 0x4D , 0xFD , 0x45 , 0xFD , 0x45 , 0xFD , 0xCD , 0xFD , 0xCD , 0xFD , 0xBC , 0xFE , 0xBC , 0xFE , +0xEC , 0xFE , 0xEC , 0xFE , 0xF2 , 0xFE , 0xF2 , 0xFE , 0xF9 , 0xFE , 0xF9 , 0xFE , 0x62 , 0xFE , 0x62 , 0xFE , +0xD5 , 0xFC , 0xD5 , 0xFC , 0x84 , 0xFB , 0x84 , 0xFB , 0xB1 , 0xFA , 0xB1 , 0xFA , 0xC5 , 0xF8 , 0xC5 , 0xF8 , +0x07 , 0xF7 , 0x07 , 0xF7 , 0xDB , 0xF6 , 0xDB , 0xF6 , 0x5F , 0xF6 , 0x5F , 0xF6 , 0x9A , 0xF6 , 0x9A , 0xF6 , +0x93 , 0xF7 , 0x93 , 0xF7 , 0x98 , 0xF8 , 0x98 , 0xF8 , 0x31 , 0xFA , 0x31 , 0xFA , 0x2A , 0xFB , 0x2A , 0xFB , +0xB9 , 0xFF , 0xB9 , 0xFF , 0x20 , 0x05 , 0x20 , 0x05 , 0xBD , 0x07 , 0xBD , 0x07 , 0xA8 , 0x0B , 0xA8 , 0x0B , +0xAB , 0x0F , 0xAB , 0x0F , 0xB5 , 0x10 , 0xB5 , 0x10 , 0x39 , 0x10 , 0x39 , 0x10 , 0xE4 , 0x0F , 0xE4 , 0x0F , +0xCC , 0x0D , 0xCC , 0x0D , 0xF7 , 0x0A , 0xF7 , 0x0A , 0xD7 , 0x07 , 0xD7 , 0x07 , 0x3A , 0x05 , 0x3A , 0x05 , +0xAB , 0x02 , 0xAB , 0x02 , 0x32 , 0x00 , 0x32 , 0x00 , 0xAD , 0xFF , 0xAD , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , +0x12 , 0xFF , 0x12 , 0xFF , 0x20 , 0x00 , 0x20 , 0x00 , 0xDC , 0x01 , 0xDC , 0x01 , 0xFB , 0x01 , 0xFB , 0x01 , +0xAB , 0x02 , 0xAB , 0x02 , 0x9F , 0x03 , 0x9F , 0x03 , 0x2C , 0x03 , 0x2C , 0x03 , 0x30 , 0x02 , 0x30 , 0x02 , +0x52 , 0x01 , 0x52 , 0x01 , 0xA8 , 0xFF , 0xA8 , 0xFF , 0x06 , 0xFE , 0x06 , 0xFE , 0x8F , 0xFC , 0x8F , 0xFC , +0x9D , 0xFB , 0x9D , 0xFB , 0x05 , 0xFB , 0x05 , 0xFB , 0xEF , 0xFA , 0xEF , 0xFA , 0x69 , 0xFB , 0x69 , 0xFB , +0x9F , 0xFC , 0x9F , 0xFC , 0xBF , 0xFD , 0xBF , 0xFD , 0x32 , 0xFF , 0x32 , 0xFF , 0x6F , 0x00 , 0x6F , 0x00 , +0x2E , 0x01 , 0x2E , 0x01 , 0xBC , 0x01 , 0xBC , 0x01 , 0x8D , 0x01 , 0x8D , 0x01 , 0xFC , 0x00 , 0xFC , 0x00 , +0x5D , 0x00 , 0x5D , 0x00 , 0x31 , 0xFF , 0x31 , 0xFF , 0x17 , 0xFE , 0x17 , 0xFE , 0x77 , 0xFD , 0x77 , 0xFD , +0x0C , 0xFD , 0x0C , 0xFD , 0xD3 , 0xFC , 0xD3 , 0xFC , 0xCD , 0xFC , 0xCD , 0xFC , 0x91 , 0xFD , 0x91 , 0xFD , +0xD1 , 0xFD , 0xD1 , 0xFD , 0xDD , 0xFD , 0xDD , 0xFD , 0xFD , 0xFD , 0xFD , 0xFD , 0xE2 , 0xFD , 0xE2 , 0xFD , +0x26 , 0xFD , 0x26 , 0xFD , 0xBE , 0xFB , 0xBE , 0xFB , 0xC9 , 0xFA , 0xC9 , 0xFA , 0x87 , 0xF9 , 0x87 , 0xF9 , +0x4C , 0xF7 , 0x4C , 0xF7 , 0x83 , 0xF6 , 0x83 , 0xF6 , 0x3F , 0xF6 , 0x3F , 0xF6 , 0x97 , 0xF5 , 0x97 , 0xF5 , +0x8A , 0xF6 , 0x8A , 0xF6 , 0x6A , 0xF7 , 0x6A , 0xF7 , 0x99 , 0xF8 , 0x99 , 0xF8 , 0xA7 , 0xF9 , 0xA7 , 0xF9 , +0x40 , 0xFD , 0x40 , 0xFD , 0x39 , 0x03 , 0x39 , 0x03 , 0x5B , 0x06 , 0x5B , 0x06 , 0xBC , 0x09 , 0xBC , 0x09 , +0xBA , 0x0E , 0xBA , 0x0E , 0xC8 , 0x10 , 0xC8 , 0x10 , 0x2F , 0x10 , 0x2F , 0x10 , 0xBB , 0x10 , 0xBB , 0x10 , +0x8C , 0x0F , 0x8C , 0x0F , 0x66 , 0x0C , 0x66 , 0x0C , 0xD8 , 0x09 , 0xD8 , 0x09 , 0x3A , 0x07 , 0x3A , 0x07 , +0x1B , 0x04 , 0x1B , 0x04 , 0x52 , 0x01 , 0x52 , 0x01 , 0x15 , 0x00 , 0x15 , 0x00 , 0xB9 , 0xFF , 0xB9 , 0xFF , +0xC3 , 0xFE , 0xC3 , 0xFE , 0xD9 , 0xFE , 0xD9 , 0xFE , 0x68 , 0x00 , 0x68 , 0x00 , 0xF6 , 0x00 , 0xF6 , 0x00 , +0x5F , 0x01 , 0x5F , 0x01 , 0xEE , 0x02 , 0xEE , 0x02 , 0x74 , 0x03 , 0x74 , 0x03 , 0x01 , 0x03 , 0x01 , 0x03 , +0xDE , 0x02 , 0xDE , 0x02 , 0x2B , 0x02 , 0x2B , 0x02 , 0xB0 , 0x00 , 0xB0 , 0x00 , 0x51 , 0xFF , 0x51 , 0xFF , +0x22 , 0xFE , 0x22 , 0xFE , 0xF2 , 0xFC , 0xF2 , 0xFC , 0x1C , 0xFC , 0x1C , 0xFC , 0xB5 , 0xFB , 0xB5 , 0xFB , +0xDC , 0xFB , 0xDC , 0xFB , 0x1E , 0xFC , 0x1E , 0xFC , 0xC1 , 0xFC , 0xC1 , 0xFC , 0xC0 , 0xFD , 0xC0 , 0xFD , +0x9B , 0xFE , 0x9B , 0xFE , 0x09 , 0xFF , 0x09 , 0xFF , 0xA7 , 0xFF , 0xA7 , 0xFF , 0xCB , 0xFF , 0xCB , 0xFF , +0x7A , 0xFF , 0x7A , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , 0xD4 , 0xFE , 0xD4 , 0xFE , 0x5A , 0xFE , 0x5A , 0xFE , +0x09 , 0xFE , 0x09 , 0xFE , 0xA9 , 0xFD , 0xA9 , 0xFD , 0x81 , 0xFD , 0x81 , 0xFD , 0xBD , 0xFD , 0xBD , 0xFD , +0x87 , 0xFD , 0x87 , 0xFD , 0x8D , 0xFD , 0x8D , 0xFD , 0x72 , 0xFD , 0x72 , 0xFD , 0x29 , 0xFD , 0x29 , 0xFD , +0xE2 , 0xFC , 0xE2 , 0xFC , 0x0F , 0xFC , 0x0F , 0xFC , 0x73 , 0xFB , 0x73 , 0xFB , 0xD8 , 0xFA , 0xD8 , 0xFA , +0x84 , 0xF9 , 0x84 , 0xF9 , 0x28 , 0xF9 , 0x28 , 0xF9 , 0x04 , 0xF9 , 0x04 , 0xF9 , 0xA3 , 0xF8 , 0xA3 , 0xF8 , +0x22 , 0xF9 , 0x22 , 0xF9 , 0x8D , 0xF9 , 0x8D , 0xF9 , 0xF9 , 0xF9 , 0xF9 , 0xF9 , 0x88 , 0xFA , 0x88 , 0xFA , +0xF5 , 0xFD , 0xF5 , 0xFD , 0x32 , 0x02 , 0x32 , 0x02 , 0x2D , 0x04 , 0x2D , 0x04 , 0x98 , 0x07 , 0x98 , 0x07 , +0xD2 , 0x0B , 0xD2 , 0x0B , 0xCF , 0x0C , 0xCF , 0x0C , 0xF4 , 0x0C , 0xF4 , 0x0C , 0x46 , 0x0E , 0x46 , 0x0E , +0x31 , 0x0D , 0x31 , 0x0D , 0x45 , 0x0B , 0x45 , 0x0B , 0xE7 , 0x09 , 0xE7 , 0x09 , 0xAB , 0x07 , 0xAB , 0x07 , +0xE7 , 0x04 , 0xE7 , 0x04 , 0x85 , 0x02 , 0x85 , 0x02 , 0x0F , 0x01 , 0x0F , 0x01 , 0x36 , 0x00 , 0x36 , 0x00 , +0x12 , 0xFF , 0x12 , 0xFF , 0xB7 , 0xFE , 0xB7 , 0xFE , 0x86 , 0xFF , 0x86 , 0xFF , 0xC8 , 0xFF , 0xC8 , 0xFF , +0x02 , 0x00 , 0x02 , 0x00 , 0x1C , 0x01 , 0x1C , 0x01 , 0xAE , 0x01 , 0xAE , 0x01 , 0x62 , 0x01 , 0x62 , 0x01 , +0x81 , 0x01 , 0x81 , 0x01 , 0x46 , 0x01 , 0x46 , 0x01 , 0x4F , 0x00 , 0x4F , 0x00 , 0x62 , 0xFF , 0x62 , 0xFF , +0xAA , 0xFE , 0xAA , 0xFE , 0xBB , 0xFD , 0xBB , 0xFD , 0xE8 , 0xFC , 0xE8 , 0xFC , 0x64 , 0xFC , 0x64 , 0xFC , +0x59 , 0xFC , 0x59 , 0xFC , 0x42 , 0xFC , 0x42 , 0xFC , 0x48 , 0xFC , 0x48 , 0xFC , 0xB4 , 0xFC , 0xB4 , 0xFC , +0x0B , 0xFD , 0x0B , 0xFD , 0x6C , 0xFD , 0x6C , 0xFD , 0x11 , 0xFE , 0x11 , 0xFE , 0x77 , 0xFE , 0x77 , 0xFE , +0x9B , 0xFE , 0x9B , 0xFE , 0xCD , 0xFE , 0xCD , 0xFE , 0x88 , 0xFE , 0x88 , 0xFE , 0x39 , 0xFE , 0x39 , 0xFE , +0xE3 , 0xFD , 0xE3 , 0xFD , 0x7F , 0xFD , 0x7F , 0xFD , 0x3F , 0xFD , 0x3F , 0xFD , 0xFF , 0xFC , 0xFF , 0xFC , +0xA2 , 0xFC , 0xA2 , 0xFC , 0xDD , 0xFC , 0xDD , 0xFC , 0x92 , 0xFC , 0x92 , 0xFC , 0x39 , 0xFC , 0x39 , 0xFC , +0x8E , 0xFC , 0x8E , 0xFC , 0x30 , 0xFC , 0x30 , 0xFC , 0xDE , 0xFB , 0xDE , 0xFB , 0x76 , 0xFC , 0x76 , 0xFC , +0x2F , 0xFC , 0x2F , 0xFC , 0x13 , 0xFC , 0x13 , 0xFC , 0x95 , 0xFC , 0x95 , 0xFC , 0x60 , 0xFD , 0x60 , 0xFD , +0x73 , 0x00 , 0x73 , 0x00 , 0xA8 , 0x02 , 0xA8 , 0x02 , 0x1E , 0x04 , 0x1E , 0x04 , 0x6F , 0x07 , 0x6F , 0x07 , +0xAA , 0x09 , 0xAA , 0x09 , 0x9A , 0x09 , 0x9A , 0x09 , 0xEC , 0x0A , 0xEC , 0x0A , 0xA3 , 0x0B , 0xA3 , 0x0B , +0x58 , 0x0A , 0x58 , 0x0A , 0xDF , 0x09 , 0xDF , 0x09 , 0x02 , 0x09 , 0x02 , 0x09 , 0xFF , 0x06 , 0xFF , 0x06 , +0x40 , 0x05 , 0x40 , 0x05 , 0xAE , 0x03 , 0xAE , 0x03 , 0x15 , 0x02 , 0x15 , 0x02 , 0x00 , 0x01 , 0x00 , 0x01 , +0xD7 , 0xFF , 0xD7 , 0xFF , 0x35 , 0xFF , 0x35 , 0xFF , 0x4A , 0xFF , 0x4A , 0xFF , 0x07 , 0xFF , 0x07 , 0xFF , +0x18 , 0xFF , 0x18 , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , 0xCB , 0xFF , 0xCB , 0xFF , 0xB8 , 0xFF , 0xB8 , 0xFF , +0x20 , 0x00 , 0x20 , 0x00 , 0xB8 , 0xFF , 0xB8 , 0xFF , 0x28 , 0xFF , 0x28 , 0xFF , 0xF6 , 0xFE , 0xF6 , 0xFE , +0x51 , 0xFE , 0x51 , 0xFE , 0xA8 , 0xFD , 0xA8 , 0xFD , 0x50 , 0xFD , 0x50 , 0xFD , 0xF2 , 0xFC , 0xF2 , 0xFC , +0xA7 , 0xFC , 0xA7 , 0xFC , 0x5F , 0xFC , 0x5F , 0xFC , 0x5A , 0xFC , 0x5A , 0xFC , 0x53 , 0xFC , 0x53 , 0xFC , +0x13 , 0xFC , 0x13 , 0xFC , 0x32 , 0xFC , 0x32 , 0xFC , 0x5C , 0xFC , 0x5C , 0xFC , 0x2C , 0xFC , 0x2C , 0xFC , +0x57 , 0xFC , 0x57 , 0xFC , 0x71 , 0xFC , 0x71 , 0xFC , 0x47 , 0xFC , 0x47 , 0xFC , 0x77 , 0xFC , 0x77 , 0xFC , +0x8E , 0xFC , 0x8E , 0xFC , 0x72 , 0xFC , 0x72 , 0xFC , 0xC1 , 0xFC , 0xC1 , 0xFC , 0x03 , 0xFD , 0x03 , 0xFD , +0x10 , 0xFD , 0x10 , 0xFD , 0xCC , 0xFD , 0xCC , 0xFD , 0x4A , 0xFE , 0x4A , 0xFE , 0xB9 , 0xFE , 0xB9 , 0xFE , +0x0F , 0x00 , 0x0F , 0x00 , 0xD1 , 0x00 , 0xD1 , 0x00 , 0x61 , 0x01 , 0x61 , 0x01 , 0x0E , 0x03 , 0x0E , 0x03 , +0xF1 , 0x03 , 0xF1 , 0x03 , 0x5C , 0x04 , 0x5C , 0x04 , 0x9E , 0x05 , 0x9E , 0x05 , 0x29 , 0x06 , 0x29 , 0x06 , +0x19 , 0x06 , 0x19 , 0x06 , 0x82 , 0x06 , 0x82 , 0x06 , 0x6E , 0x06 , 0x6E , 0x06 , 0xF5 , 0x05 , 0xF5 , 0x05 , +0xB9 , 0x05 , 0xB9 , 0x05 , 0x1C , 0x05 , 0x1C , 0x05 , 0x6E , 0x04 , 0x6E , 0x04 , 0xD3 , 0x03 , 0xD3 , 0x03 , +0x0C , 0x03 , 0x0C , 0x03 , 0x7B , 0x02 , 0x7B , 0x02 , 0xFE , 0x01 , 0xFE , 0x01 , 0x45 , 0x01 , 0x45 , 0x01 , +0xE9 , 0x00 , 0xE9 , 0x00 , 0xCA , 0x00 , 0xCA , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x4E , 0x00 , 0x4E , 0x00 , +0x43 , 0x00 , 0x43 , 0x00 , 0x1E , 0x00 , 0x1E , 0x00 , 0xDF , 0xFF , 0xDF , 0xFF , 0xAA , 0xFF , 0xAA , 0xFF , +0x95 , 0xFF , 0x95 , 0xFF , 0x4D , 0xFF , 0x4D , 0xFF , 0xF4 , 0xFE , 0xF4 , 0xFE , 0xED , 0xFE , 0xED , 0xFE , +0xA0 , 0xFE , 0xA0 , 0xFE , 0x2D , 0xFE , 0x2D , 0xFE , 0x21 , 0xFE , 0x21 , 0xFE , 0xE7 , 0xFD , 0xE7 , 0xFD , +0x6F , 0xFD , 0x6F , 0xFD , 0x4F , 0xFD , 0x4F , 0xFD , 0xFE , 0xFC , 0xFE , 0xFC , 0x8E , 0xFC , 0x8E , 0xFC , +0x5C , 0xFC , 0x5C , 0xFC , 0x1B , 0xFC , 0x1B , 0xFC , 0xE3 , 0xFB , 0xE3 , 0xFB , 0xCD , 0xFB , 0xCD , 0xFB , +0xBE , 0xFB , 0xBE , 0xFB , 0xD1 , 0xFB , 0xD1 , 0xFB , 0x08 , 0xFC , 0x08 , 0xFC , 0x57 , 0xFC , 0x57 , 0xFC , +0xD3 , 0xFC , 0xD3 , 0xFC , 0x47 , 0xFD , 0x47 , 0xFD , 0xDF , 0xFD , 0xDF , 0xFD , 0x82 , 0xFE , 0x82 , 0xFE , +0xDB , 0xFE , 0xDB , 0xFE , 0x89 , 0xFF , 0x89 , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , 0x7F , 0x00 , 0x7F , 0x00 , +0x31 , 0x01 , 0x31 , 0x01 , 0x1C , 0x02 , 0x1C , 0x02 , 0x85 , 0x02 , 0x85 , 0x02 , 0x4A , 0x03 , 0x4A , 0x03 , +0x54 , 0x04 , 0x54 , 0x04 , 0xC4 , 0x04 , 0xC4 , 0x04 , 0x60 , 0x05 , 0x60 , 0x05 , 0x34 , 0x06 , 0x34 , 0x06 , +0x7D , 0x06 , 0x7D , 0x06 , 0xB0 , 0x06 , 0xB0 , 0x06 , 0xC2 , 0x06 , 0xC2 , 0x06 , 0x71 , 0x06 , 0x71 , 0x06 , +0xE4 , 0x05 , 0xE4 , 0x05 , 0x01 , 0x05 , 0x01 , 0x05 , 0xF4 , 0x03 , 0xF4 , 0x03 , 0xF6 , 0x02 , 0xF6 , 0x02 , +0xBA , 0x01 , 0xBA , 0x01 , 0x94 , 0x00 , 0x94 , 0x00 , 0xB8 , 0xFF , 0xB8 , 0xFF , 0xCB , 0xFE , 0xCB , 0xFE , +0x28 , 0xFE , 0x28 , 0xFE , 0xFB , 0xFD , 0xFB , 0xFD , 0xB2 , 0xFD , 0xB2 , 0xFD , 0xA7 , 0xFD , 0xA7 , 0xFD , +0xEC , 0xFD , 0xEC , 0xFD , 0x22 , 0xFE , 0x22 , 0xFE , 0x49 , 0xFE , 0x49 , 0xFE , 0x88 , 0xFE , 0x88 , 0xFE , +0xBE , 0xFE , 0xBE , 0xFE , 0xBF , 0xFE , 0xBF , 0xFE , 0xBB , 0xFE , 0xBB , 0xFE , 0xBF , 0xFE , 0xBF , 0xFE , +0x8E , 0xFE , 0x8E , 0xFE , 0x4B , 0xFE , 0x4B , 0xFE , 0x1A , 0xFE , 0x1A , 0xFE , 0xBB , 0xFD , 0xBB , 0xFD , +0x79 , 0xFD , 0x79 , 0xFD , 0x57 , 0xFD , 0x57 , 0xFD , 0x16 , 0xFD , 0x16 , 0xFD , 0x16 , 0xFD , 0x16 , 0xFD , +0x51 , 0xFD , 0x51 , 0xFD , 0x47 , 0xFD , 0x47 , 0xFD , 0x67 , 0xFD , 0x67 , 0xFD , 0x9C , 0xFD , 0x9C , 0xFD , +0x93 , 0xFD , 0x93 , 0xFD , 0x90 , 0xFD , 0x90 , 0xFD , 0x8A , 0xFD , 0x8A , 0xFD , 0x52 , 0xFD , 0x52 , 0xFD , +0x2A , 0xFD , 0x2A , 0xFD , 0x12 , 0xFD , 0x12 , 0xFD , 0xFE , 0xFC , 0xFE , 0xFC , 0xFF , 0xFC , 0xFF , 0xFC , +0xEC , 0xFC , 0xEC , 0xFC , 0x01 , 0xFD , 0x01 , 0xFD , 0x3E , 0xFD , 0x3E , 0xFD , 0x5B , 0xFD , 0x5B , 0xFD , +0x8E , 0xFD , 0x8E , 0xFD , 0xF9 , 0xFD , 0xF9 , 0xFD , 0x49 , 0xFE , 0x49 , 0xFE , 0x72 , 0xFE , 0x72 , 0xFE , +0xFB , 0xFE , 0xFB , 0xFE , 0x78 , 0xFF , 0x78 , 0xFF , 0xA2 , 0xFF , 0xA2 , 0xFF , 0x24 , 0x00 , 0x24 , 0x00 , +0xE4 , 0x00 , 0xE4 , 0x00 , 0x6B , 0x01 , 0x6B , 0x01 , 0x08 , 0x02 , 0x08 , 0x02 , 0x10 , 0x03 , 0x10 , 0x03 , +0xF8 , 0x03 , 0xF8 , 0x03 , 0x9F , 0x04 , 0x9F , 0x04 , 0x70 , 0x05 , 0x70 , 0x05 , 0x3A , 0x06 , 0x3A , 0x06 , +0x87 , 0x06 , 0x87 , 0x06 , 0xDF , 0x06 , 0xDF , 0x06 , 0x20 , 0x07 , 0x20 , 0x07 , 0x0D , 0x07 , 0x0D , 0x07 , +0xD7 , 0x06 , 0xD7 , 0x06 , 0x73 , 0x06 , 0x73 , 0x06 , 0xE8 , 0x05 , 0xE8 , 0x05 , 0x33 , 0x05 , 0x33 , 0x05 , +0x3F , 0x04 , 0x3F , 0x04 , 0x65 , 0x03 , 0x65 , 0x03 , 0x98 , 0x02 , 0x98 , 0x02 , 0xA3 , 0x01 , 0xA3 , 0x01 , +0xE0 , 0x00 , 0xE0 , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , 0xB4 , 0xFF , 0xB4 , 0xFF , 0x48 , 0xFF , 0x48 , 0xFF , +0xFB , 0xFE , 0xFB , 0xFE , 0xCB , 0xFE , 0xCB , 0xFE , 0xB5 , 0xFE , 0xB5 , 0xFE , 0x7A , 0xFE , 0x7A , 0xFE , +0x71 , 0xFE , 0x71 , 0xFE , 0x6F , 0xFE , 0x6F , 0xFE , 0x3D , 0xFE , 0x3D , 0xFE , 0x33 , 0xFE , 0x33 , 0xFE , +0x36 , 0xFE , 0x36 , 0xFE , 0xF1 , 0xFD , 0xF1 , 0xFD , 0xC5 , 0xFD , 0xC5 , 0xFD , 0xA3 , 0xFD , 0xA3 , 0xFD , +0x6B , 0xFD , 0x6B , 0xFD , 0x4B , 0xFD , 0x4B , 0xFD , 0x25 , 0xFD , 0x25 , 0xFD , 0x1D , 0xFD , 0x1D , 0xFD , +0x3E , 0xFD , 0x3E , 0xFD , 0x0F , 0xFD , 0x0F , 0xFD , 0x0B , 0xFD , 0x0B , 0xFD , 0x4D , 0xFD , 0x4D , 0xFD , +0x3E , 0xFD , 0x3E , 0xFD , 0x33 , 0xFD , 0x33 , 0xFD , 0x7B , 0xFD , 0x7B , 0xFD , 0x91 , 0xFD , 0x91 , 0xFD , +0x9B , 0xFD , 0x9B , 0xFD , 0x96 , 0xFD , 0x96 , 0xFD , 0x90 , 0xFD , 0x90 , 0xFD , 0xED , 0xFD , 0xED , 0xFD , +0x0A , 0xFE , 0x0A , 0xFE , 0x04 , 0xFE , 0x04 , 0xFE , 0x6F , 0xFE , 0x6F , 0xFE , 0xA8 , 0xFE , 0xA8 , 0xFE , +0xB1 , 0xFE , 0xB1 , 0xFE , 0xC4 , 0xFE , 0xC4 , 0xFE , 0x92 , 0xFE , 0x92 , 0xFE , 0xD1 , 0xFE , 0xD1 , 0xFE , +0xF0 , 0xFE , 0xF0 , 0xFE , 0xA5 , 0xFE , 0xA5 , 0xFE , 0xF1 , 0xFE , 0xF1 , 0xFE , 0x75 , 0xFF , 0x75 , 0xFF , +0x7A , 0xFF , 0x7A , 0xFF , 0x9B , 0xFF , 0x9B , 0xFF , 0x13 , 0x00 , 0x13 , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , +0xB5 , 0x00 , 0xB5 , 0x00 , 0xF1 , 0x00 , 0xF1 , 0x00 , 0x8A , 0x01 , 0x8A , 0x01 , 0x1F , 0x02 , 0x1F , 0x02 , +0x75 , 0x02 , 0x75 , 0x02 , 0xF3 , 0x02 , 0xF3 , 0x02 , 0x9D , 0x03 , 0x9D , 0x03 , 0xED , 0x03 , 0xED , 0x03 , +0xFA , 0x03 , 0xFA , 0x03 , 0x31 , 0x04 , 0x31 , 0x04 , 0x47 , 0x04 , 0x47 , 0x04 , 0x2C , 0x04 , 0x2C , 0x04 , +0xEA , 0x03 , 0xEA , 0x03 , 0xB4 , 0x03 , 0xB4 , 0x03 , 0x69 , 0x03 , 0x69 , 0x03 , 0xDC , 0x02 , 0xDC , 0x02 , +0x5D , 0x02 , 0x5D , 0x02 , 0xF0 , 0x01 , 0xF0 , 0x01 , 0x64 , 0x01 , 0x64 , 0x01 , 0x10 , 0x01 , 0x10 , 0x01 , +0xC6 , 0x00 , 0xC6 , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , 0xD2 , 0xFF , 0xD2 , 0xFF , 0xB2 , 0xFF , 0xB2 , 0xFF , +0x5C , 0xFF , 0x5C , 0xFF , 0x00 , 0xFF , 0x00 , 0xFF , 0x02 , 0xFF , 0x02 , 0xFF , 0xF7 , 0xFE , 0xF7 , 0xFE , +0x87 , 0xFE , 0x87 , 0xFE , 0x38 , 0xFE , 0x38 , 0xFE , 0x05 , 0xFE , 0x05 , 0xFE , 0xCA , 0xFD , 0xCA , 0xFD , +0x94 , 0xFD , 0x94 , 0xFD , 0x9C , 0xFD , 0x9C , 0xFD , 0x5D , 0xFD , 0x5D , 0xFD , 0xFA , 0xFC , 0xFA , 0xFC , +0x22 , 0xFD , 0x22 , 0xFD , 0x40 , 0xFD , 0x40 , 0xFD , 0x01 , 0xFD , 0x01 , 0xFD , 0x53 , 0xFD , 0x53 , 0xFD , +0x00 , 0xFE , 0x00 , 0xFE , 0xF3 , 0xFD , 0xF3 , 0xFD , 0xF8 , 0xFD , 0xF8 , 0xFD , 0x25 , 0xFE , 0x25 , 0xFE , +0x3F , 0xFE , 0x3F , 0xFE , 0xCE , 0xFE , 0xCE , 0xFE , 0x23 , 0xFF , 0x23 , 0xFF , 0x27 , 0xFF , 0x27 , 0xFF , +0x8E , 0xFF , 0x8E , 0xFF , 0xE2 , 0xFF , 0xE2 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0x6E , 0xFF , 0x6E , 0xFF , +0x80 , 0xFF , 0x80 , 0xFF , 0x2E , 0x00 , 0x2E , 0x00 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0x90 , 0xFF , 0x90 , 0xFF , +0xEC , 0xFF , 0xEC , 0xFF , 0xB6 , 0xFF , 0xB6 , 0xFF , 0xFF , 0xFE , 0xFF , 0xFE , 0xEE , 0xFE , 0xEE , 0xFE , +0x6C , 0xFF , 0x6C , 0xFF , 0x93 , 0xFF , 0x93 , 0xFF , 0xFC , 0xFE , 0xFC , 0xFE , 0x01 , 0xFF , 0x01 , 0xFF , +0x80 , 0xFF , 0x80 , 0xFF , 0x02 , 0xFF , 0x02 , 0xFF , 0x95 , 0xFE , 0x95 , 0xFE , 0x50 , 0xFF , 0x50 , 0xFF , +0x54 , 0xFF , 0x54 , 0xFF , 0x84 , 0xFE , 0x84 , 0xFE , 0x13 , 0xFF , 0x13 , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , +0x3C , 0xFF , 0x3C , 0xFF , 0xB7 , 0xFE , 0xB7 , 0xFE , 0x18 , 0xFF , 0x18 , 0xFF , 0x81 , 0xFF , 0x81 , 0xFF , +0x07 , 0xFF , 0x07 , 0xFF , 0xCE , 0xFE , 0xCE , 0xFE , 0x1C , 0xFF , 0x1C , 0xFF , 0x28 , 0xFF , 0x28 , 0xFF , +0x34 , 0xFF , 0x34 , 0xFF , 0x99 , 0xFF , 0x99 , 0xFF , 0x84 , 0xFF , 0x84 , 0xFF , 0xA7 , 0xFF , 0xA7 , 0xFF , +0x17 , 0x00 , 0x17 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , 0xA9 , 0x00 , 0xA9 , 0x00 , +0x0A , 0x01 , 0x0A , 0x01 , 0x5D , 0x01 , 0x5D , 0x01 , 0x54 , 0x01 , 0x54 , 0x01 , 0x39 , 0x01 , 0x39 , 0x01 , +0x8E , 0x01 , 0x8E , 0x01 , 0xB8 , 0x01 , 0xB8 , 0x01 , 0x7D , 0x01 , 0x7D , 0x01 , 0xE7 , 0x00 , 0xE7 , 0x00 , +0x59 , 0x00 , 0x59 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , 0xBD , 0x00 , 0xBD , 0x00 , 0x78 , 0x00 , 0x78 , 0x00 , +0x89 , 0xFF , 0x89 , 0xFF , 0xAC , 0xFF , 0xAC , 0xFF , 0x14 , 0x00 , 0x14 , 0x00 , 0x18 , 0xFF , 0x18 , 0xFF , +0xAA , 0xFE , 0xAA , 0xFE , 0xA9 , 0xFF , 0xA9 , 0xFF , 0x32 , 0xFF , 0x32 , 0xFF , 0x17 , 0xFE , 0x17 , 0xFE , +0x42 , 0xFF , 0x42 , 0xFF , 0xCD , 0xFF , 0xCD , 0xFF , 0xC1 , 0xFE , 0xC1 , 0xFE , 0x41 , 0xFE , 0x41 , 0xFE , +0x42 , 0xFF , 0x42 , 0xFF , 0xB6 , 0xFF , 0xB6 , 0xFF , 0xAF , 0xFE , 0xAF , 0xFE , 0xBB , 0xFE , 0xBB , 0xFE , +0x69 , 0xFF , 0x69 , 0xFF , 0x76 , 0xFF , 0x76 , 0xFF , 0x87 , 0xFF , 0x87 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0xC0 , 0xFF , 0xC0 , 0xFF , 0x30 , 0x00 , 0x30 , 0x00 , 0xAB , 0x00 , 0xAB , 0x00 , 0x5E , 0x00 , 0x5E , 0x00 , +0xB6 , 0x00 , 0xB6 , 0x00 , 0x1C , 0x01 , 0x1C , 0x01 , 0x7B , 0x01 , 0x7B , 0x01 , 0x84 , 0x01 , 0x84 , 0x01 , +0x30 , 0x01 , 0x30 , 0x01 , 0x21 , 0x01 , 0x21 , 0x01 , 0x8A , 0x01 , 0x8A , 0x01 , 0x69 , 0x01 , 0x69 , 0x01 , +0xD9 , 0x00 , 0xD9 , 0x00 , 0x5D , 0x00 , 0x5D , 0x00 , 0xD7 , 0x00 , 0xD7 , 0x00 , 0xFB , 0x00 , 0xFB , 0x00 , +0xA0 , 0xFF , 0xA0 , 0xFF , 0x70 , 0xFF , 0x70 , 0xFF , 0x51 , 0x00 , 0x51 , 0x00 , 0x27 , 0x00 , 0x27 , 0x00 , +0x0D , 0xFF , 0x0D , 0xFF , 0xFE , 0xFE , 0xFE , 0xFE , 0x5C , 0xFF , 0x5C , 0xFF , 0xAA , 0xFE , 0xAA , 0xFE , +0x67 , 0xFE , 0x67 , 0xFE , 0x6D , 0xFF , 0x6D , 0xFF , 0xB4 , 0xFF , 0xB4 , 0xFF , 0x73 , 0xFE , 0x73 , 0xFE , +0x1F , 0xFF , 0x1F , 0xFF , 0x3B , 0x00 , 0x3B , 0x00 , 0x25 , 0xFF , 0x25 , 0xFF , 0xDF , 0xFE , 0xDF , 0xFE , +0x87 , 0x00 , 0x87 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xCB , 0xFE , 0xCB , 0xFE , 0x89 , 0x00 , 0x89 , 0x00 , +0xFE , 0x00 , 0xFE , 0x00 , 0x95 , 0xFF , 0x95 , 0xFF , 0x07 , 0xFF , 0x07 , 0xFF , 0x81 , 0x00 , 0x81 , 0x00 , +0xB9 , 0x00 , 0xB9 , 0x00 , 0x06 , 0xFF , 0x06 , 0xFF , 0x3B , 0xFF , 0x3B , 0xFF , 0x16 , 0x00 , 0x16 , 0x00 , +0xF0 , 0xFF , 0xF0 , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0xBA , 0xFF , 0xBA , 0xFF , +0x5E , 0x00 , 0x5E , 0x00 , 0x81 , 0x00 , 0x81 , 0x00 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0x8D , 0x00 , 0x8D , 0x00 , +0xDB , 0x00 , 0xDB , 0x00 , 0x1F , 0x01 , 0x1F , 0x01 , 0xF5 , 0x00 , 0xF5 , 0x00 , 0x2E , 0x01 , 0x2E , 0x01 , +0x40 , 0x01 , 0x40 , 0x01 , 0xC9 , 0x01 , 0xC9 , 0x01 , 0xC1 , 0x00 , 0xC1 , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , +0x2D , 0x01 , 0x2D , 0x01 , 0xC6 , 0x00 , 0xC6 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0x34 , 0xFF , 0x34 , 0xFF , 0xEF , 0xFE , 0xEF , 0xFE , 0xA3 , 0xFF , 0xA3 , 0xFF , +0x76 , 0x00 , 0x76 , 0x00 , 0xBF , 0xFE , 0xBF , 0xFE , 0xEB , 0xFE , 0xEB , 0xFE , 0x9B , 0x00 , 0x9B , 0x00 , +0x5D , 0xFF , 0x5D , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0x3C , 0x00 , 0x3C , 0x00 , 0x4E , 0x00 , 0x4E , 0x00 , +0x9E , 0x00 , 0x9E , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , 0x5B , 0x00 , 0x5B , 0x00 , 0x2E , 0x00 , 0x2E , 0x00 , +0x47 , 0x00 , 0x47 , 0x00 , 0xAF , 0x00 , 0xAF , 0x00 , 0x4C , 0xFF , 0x4C , 0xFF , 0x7B , 0xFF , 0x7B , 0xFF , +0x70 , 0x00 , 0x70 , 0x00 , 0x68 , 0xFF , 0x68 , 0xFF , 0x1D , 0xFF , 0x1D , 0xFF , 0x13 , 0x00 , 0x13 , 0x00 , +0xFD , 0x00 , 0xFD , 0x00 , 0xBE , 0xFF , 0xBE , 0xFF , 0xD5 , 0xFE , 0xD5 , 0xFE , 0xBC , 0x00 , 0xBC , 0x00 , +0xC8 , 0x00 , 0xC8 , 0x00 , 0x6C , 0xFF , 0x6C , 0xFF , 0x46 , 0xFF , 0x46 , 0xFF , 0x20 , 0x00 , 0x20 , 0x00 , +0x6A , 0x01 , 0x6A , 0x01 , 0xED , 0xFF , 0xED , 0xFF , 0x5F , 0x00 , 0x5F , 0x00 , 0x6F , 0x00 , 0x6F , 0x00 , +0x44 , 0x00 , 0x44 , 0x00 , 0x8F , 0x00 , 0x8F , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , +0x30 , 0x00 , 0x30 , 0x00 , 0xC3 , 0xFF , 0xC3 , 0xFF , 0x16 , 0xFF , 0x16 , 0xFF , 0x6B , 0xFF , 0x6B , 0xFF , +0x0F , 0x00 , 0x0F , 0x00 , 0xB8 , 0x00 , 0xB8 , 0x00 , 0xD2 , 0xFE , 0xD2 , 0xFE , 0x6F , 0xFF , 0x6F , 0xFF , +0xE5 , 0x00 , 0xE5 , 0x00 , 0x63 , 0xFF , 0x63 , 0xFF , 0x2E , 0x00 , 0x2E , 0x00 , 0x4C , 0x00 , 0x4C , 0x00 , +0x56 , 0x00 , 0x56 , 0x00 , 0xA7 , 0x00 , 0xA7 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , +0xEF , 0xFF , 0xEF , 0xFF , 0x31 , 0x00 , 0x31 , 0x00 , 0x85 , 0x00 , 0x85 , 0x00 , 0xF9 , 0xFE , 0xF9 , 0xFE , +0x72 , 0xFF , 0x72 , 0xFF , 0x72 , 0x00 , 0x72 , 0x00 , 0x55 , 0xFF , 0x55 , 0xFF , 0x32 , 0xFF , 0x32 , 0xFF , +0x3E , 0x00 , 0x3E , 0x00 , 0x3E , 0x01 , 0x3E , 0x01 , 0xCC , 0xFF , 0xCC , 0xFF , 0xC0 , 0xFE , 0xC0 , 0xFE , +0xF0 , 0x00 , 0xF0 , 0x00 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0x99 , 0xFF , 0x99 , 0xFF , 0x7D , 0xFF , 0x7D , 0xFF , +0x7C , 0x00 , 0x7C , 0x00 , 0x96 , 0x00 , 0x96 , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , 0xC2 , 0xFF , 0xC2 , 0xFF , +0xC2 , 0xFF , 0xC2 , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , 0xE9 , 0xFF , 0xE9 , 0xFF , +0x85 , 0xFF , 0x85 , 0xFF , 0xB3 , 0xFF , 0xB3 , 0xFF , 0x3E , 0xFF , 0x3E , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , +0xF3 , 0xFF , 0xF3 , 0xFF , 0xBB , 0x00 , 0xBB , 0x00 , 0x81 , 0xFF , 0x81 , 0xFF , 0x32 , 0xFF , 0x32 , 0xFF , +0xA0 , 0x00 , 0xA0 , 0x00 , 0xF5 , 0xFF , 0xF5 , 0xFF , 0xF6 , 0xFE , 0xF6 , 0xFE , 0x18 , 0x00 , 0x18 , 0x00 , +0xA1 , 0x00 , 0xA1 , 0x00 , 0xE3 , 0xFE , 0xE3 , 0xFE , 0xE1 , 0xFF , 0xE1 , 0xFF , 0xE8 , 0x00 , 0xE8 , 0x00 , +0x04 , 0x00 , 0x04 , 0x00 , 0xE3 , 0xFE , 0xE3 , 0xFE , 0x31 , 0xFF , 0x31 , 0xFF , 0x03 , 0x01 , 0x03 , 0x01 , +0xB7 , 0xFF , 0xB7 , 0xFF , 0xE6 , 0xFE , 0xE6 , 0xFE , 0x66 , 0xFF , 0x66 , 0xFF , 0x6A , 0x00 , 0x6A , 0x00 , +0x64 , 0x00 , 0x64 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , 0x80 , 0xFF , 0x80 , 0xFF , 0x4D , 0x00 , 0x4D , 0x00 , +0x36 , 0x01 , 0x36 , 0x01 , 0x76 , 0xFF , 0x76 , 0xFF , 0x51 , 0x00 , 0x51 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , +0x3C , 0xFF , 0x3C , 0xFF , 0x5B , 0xFF , 0x5B , 0xFF , 0x3D , 0x00 , 0x3D , 0x00 , 0x25 , 0x01 , 0x25 , 0x01 , +0x08 , 0xFF , 0x08 , 0xFF , 0x79 , 0xFF , 0x79 , 0xFF , 0xBF , 0x00 , 0xBF , 0x00 , 0xA4 , 0xFF , 0xA4 , 0xFF , +0x7C , 0x00 , 0x7C , 0x00 , 0xDD , 0xFF , 0xDD , 0xFF , 0x4C , 0x00 , 0x4C , 0x00 , 0xBE , 0x00 , 0xBE , 0x00 , +0xCD , 0xFF , 0xCD , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , 0x4F , 0x00 , 0x4F , 0x00 , +0x5F , 0x00 , 0x5F , 0x00 , 0xE6 , 0xFE , 0xE6 , 0xFE , 0x9D , 0xFF , 0x9D , 0xFF , 0x83 , 0x00 , 0x83 , 0x00 , +0x7A , 0xFF , 0x7A , 0xFF , 0x94 , 0xFF , 0x94 , 0xFF , 0x46 , 0x00 , 0x46 , 0x00 , 0x49 , 0x01 , 0x49 , 0x01 , +0xCF , 0xFF , 0xCF , 0xFF , 0xF8 , 0xFE , 0xF8 , 0xFE , 0x81 , 0x00 , 0x81 , 0x00 , 0xA9 , 0x00 , 0xA9 , 0x00 , +0x8F , 0xFF , 0x8F , 0xFF , 0x9B , 0xFF , 0x9B , 0xFF , 0x3D , 0x00 , 0x3D , 0x00 , 0xB1 , 0x00 , 0xB1 , 0x00 , +0xDA , 0xFF , 0xDA , 0xFF , 0x17 , 0xFF , 0x17 , 0xFF , 0x30 , 0x00 , 0x30 , 0x00 , 0xB3 , 0x00 , 0xB3 , 0x00 , +0x01 , 0x00 , 0x01 , 0x00 , 0x20 , 0xFF , 0x20 , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , +0xAA , 0xFF , 0xAA , 0xFF , 0xB6 , 0xFF , 0xB6 , 0xFF , 0x9C , 0x00 , 0x9C , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , +0x91 , 0xFF , 0x91 , 0xFF , 0x3E , 0x00 , 0x3E , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0x81 , 0xFF , 0x81 , 0xFF , +0x12 , 0x00 , 0x12 , 0x00 , 0x25 , 0x00 , 0x25 , 0x00 , 0x19 , 0xFF , 0x19 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , +0xE1 , 0xFF , 0xE1 , 0xFF , 0xB0 , 0x00 , 0xB0 , 0x00 , 0x14 , 0x00 , 0x14 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , +0xAB , 0x00 , 0xAB , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , +0x1D , 0x00 , 0x1D , 0x00 , 0x55 , 0x00 , 0x55 , 0x00 , 0x16 , 0xFF , 0x16 , 0xFF , 0x9F , 0xFF , 0x9F , 0xFF , +0x4A , 0x00 , 0x4A , 0x00 , 0x91 , 0xFF , 0x91 , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0x4B , 0x00 , 0x4B , 0x00 , +0x0F , 0x01 , 0x0F , 0x01 , 0xFB , 0xFF , 0xFB , 0xFF , 0x53 , 0xFF , 0x53 , 0xFF , 0x4D , 0x00 , 0x4D , 0x00 , +0x4B , 0x00 , 0x4B , 0x00 , 0xAC , 0xFF , 0xAC , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0x7C , 0x00 , 0x7C , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0x59 , 0xFF , 0x59 , 0xFF , 0x06 , 0x00 , 0x06 , 0x00 , +0x82 , 0x00 , 0x82 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x75 , 0xFF , 0x75 , 0xFF , 0x78 , 0xFF , 0x78 , 0xFF , +0x4F , 0xFF , 0x4F , 0xFF , 0x68 , 0xFF , 0x68 , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , 0xCA , 0x00 , 0xCA , 0x00 , +0xD7 , 0xFF , 0xD7 , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , 0x85 , 0x00 , 0x85 , 0x00 , 0xD4 , 0xFF , 0xD4 , 0xFF , +0xFA , 0xFF , 0xFA , 0xFF , 0x73 , 0x00 , 0x73 , 0x00 , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0xD6 , 0xFF , 0xD6 , 0xFF , 0xC2 , 0xFF , 0xC2 , 0xFF , 0x66 , 0x00 , 0x66 , 0x00 , 0xBE , 0xFF , 0xBE , 0xFF , +0x5C , 0xFF , 0x5C , 0xFF , 0x40 , 0x00 , 0x40 , 0x00 , 0xC2 , 0xFF , 0xC2 , 0xFF , 0xD2 , 0xFF , 0xD2 , 0xFF , +0x21 , 0x00 , 0x21 , 0x00 , 0x8E , 0x00 , 0x8E , 0x00 , 0x8C , 0x00 , 0x8C , 0x00 , 0x81 , 0xFF , 0x81 , 0xFF , +0xD8 , 0xFF , 0xD8 , 0xFF , 0x49 , 0x00 , 0x49 , 0x00 , 0xD9 , 0xFF , 0xD9 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x1D , 0x00 , 0x1D , 0x00 , 0x53 , 0x00 , 0x53 , 0x00 , 0xA6 , 0xFF , 0xA6 , 0xFF , +0xB8 , 0xFF , 0xB8 , 0xFF , 0x39 , 0x00 , 0x39 , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , 0xD6 , 0xFF , 0xD6 , 0xFF , +0x9B , 0xFF , 0x9B , 0xFF , 0x73 , 0xFF , 0x73 , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , +0x8B , 0x00 , 0x8B , 0x00 , 0x64 , 0x00 , 0x64 , 0x00 , 0x98 , 0xFF , 0x98 , 0xFF , 0x2E , 0x00 , 0x2E , 0x00 , +0x22 , 0x00 , 0x22 , 0x00 , 0x5B , 0xFF , 0x5B , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , +0x24 , 0xFF , 0x24 , 0xFF , 0x78 , 0xFF , 0x78 , 0xFF , 0x49 , 0x00 , 0x49 , 0x00 , 0xC7 , 0xFF , 0xC7 , 0xFF , +0xE7 , 0xFF , 0xE7 , 0xFF , 0x91 , 0xFF , 0x91 , 0xFF , 0xDE , 0xFF , 0xDE , 0xFF , 0x9E , 0x00 , 0x9E , 0x00 , +0xB2 , 0x00 , 0xB2 , 0x00 , 0xAA , 0xFF , 0xAA , 0xFF , 0x14 , 0x00 , 0x14 , 0x00 , 0x9B , 0x00 , 0x9B , 0x00 , +0x9A , 0xFF , 0x9A , 0xFF , 0x7E , 0x00 , 0x7E , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , 0x96 , 0x00 , 0x96 , 0x00 , +0xCC , 0x00 , 0xCC , 0x00 , 0xD7 , 0xFF , 0xD7 , 0xFF , 0x76 , 0xFF , 0x76 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0x34 , 0x00 , 0x34 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0x5A , 0xFF , 0x5A , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , +0x23 , 0x00 , 0x23 , 0x00 , 0x9E , 0xFF , 0x9E , 0xFF , 0x7B , 0x00 , 0x7B , 0x00 , 0x12 , 0x01 , 0x12 , 0x01 , +0x55 , 0x00 , 0x55 , 0x00 , 0x9E , 0xFF , 0x9E , 0xFF , 0xFB , 0xFF , 0xFB , 0xFF , 0x2B , 0x00 , 0x2B , 0x00 , +0xB7 , 0xFF , 0xB7 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x6B , 0x00 , 0x6B , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , +0x7C , 0x00 , 0x7C , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0xE5 , 0xFF , 0xE5 , 0xFF , +0x4C , 0x00 , 0x4C , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0x3E , 0xFF , 0x3E , 0xFF , 0x46 , 0xFF , 0x46 , 0xFF , +0x4F , 0x00 , 0x4F , 0x00 , 0xDF , 0xFF , 0xDF , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , 0x8D , 0xFF , 0x8D , 0xFF , +0xCD , 0xFF , 0xCD , 0xFF , 0x9F , 0x00 , 0x9F , 0x00 , 0xB6 , 0x00 , 0xB6 , 0x00 , 0xAE , 0xFF , 0xAE , 0xFF , +0x03 , 0x00 , 0x03 , 0x00 , 0x8E , 0x00 , 0x8E , 0x00 , 0x9D , 0xFF , 0x9D , 0xFF , 0x81 , 0x00 , 0x81 , 0x00 , +0x27 , 0x00 , 0x27 , 0x00 , 0xA9 , 0x00 , 0xA9 , 0x00 , 0xD4 , 0x00 , 0xD4 , 0x00 , 0xD3 , 0xFF , 0xD3 , 0xFF , +0x6C , 0xFF , 0x6C , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0x3C , 0x00 , 0x3C , 0x00 , 0x22 , 0x00 , 0x22 , 0x00 , +0x5D , 0xFF , 0x5D , 0xFF , 0xC6 , 0xFF , 0xC6 , 0xFF , 0x21 , 0x00 , 0x21 , 0x00 , 0x9E , 0xFF , 0x9E , 0xFF , +0x7F , 0x00 , 0x7F , 0x00 , 0x1A , 0x01 , 0x1A , 0x01 , 0x62 , 0x00 , 0x62 , 0x00 , 0x8A , 0xFF , 0x8A , 0xFF , +0xDD , 0xFF , 0xDD , 0xFF , 0x23 , 0x00 , 0x23 , 0x00 , 0xD1 , 0xFF , 0xD1 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0x8E , 0x00 , 0x8E , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , +0xC4 , 0xFF , 0xC4 , 0xFF , 0x29 , 0x00 , 0x29 , 0x00 , 0x26 , 0x00 , 0x26 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , +0x8E , 0xFF , 0x8E , 0xFF , 0xD1 , 0xFF , 0xD1 , 0xFF , 0x6D , 0x00 , 0x6D , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , +0xA4 , 0xFF , 0xA4 , 0xFF , 0x6A , 0xFF , 0x6A , 0xFF , 0x1B , 0xFF , 0x1B , 0xFF , 0x7B , 0xFF , 0x7B , 0xFF , +0x40 , 0x00 , 0x40 , 0x00 , 0xFA , 0x00 , 0xFA , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , 0x88 , 0xFF , 0x88 , 0xFF , +0xFB , 0xFF , 0xFB , 0xFF , 0x85 , 0xFF , 0x85 , 0xFF , 0x67 , 0xFF , 0x67 , 0xFF , 0x4D , 0x00 , 0x4D , 0x00 , +0x46 , 0x00 , 0x46 , 0x00 , 0x69 , 0xFF , 0x69 , 0xFF , 0x34 , 0x00 , 0x34 , 0x00 , 0x72 , 0x00 , 0x72 , 0x00 , +0x13 , 0x00 , 0x13 , 0x00 , 0x49 , 0xFF , 0x49 , 0xFF , 0x12 , 0xFF , 0x12 , 0xFF , 0x5F , 0x00 , 0x5F , 0x00 , +0x0F , 0x00 , 0x0F , 0x00 , 0xB8 , 0xFF , 0xB8 , 0xFF , 0x96 , 0xFF , 0x96 , 0xFF , 0xD4 , 0xFF , 0xD4 , 0xFF , +0x94 , 0x00 , 0x94 , 0x00 , 0xA5 , 0x00 , 0xA5 , 0x00 , 0xA8 , 0xFF , 0xA8 , 0xFF , 0xF3 , 0xFF , 0xF3 , 0xFF , +0x82 , 0x00 , 0x82 , 0x00 , 0xC5 , 0xFF , 0xC5 , 0xFF , 0x57 , 0x00 , 0x57 , 0x00 , 0xCD , 0xFF , 0xCD , 0xFF , +0x8D , 0xFF , 0x8D , 0xFF , 0x29 , 0x00 , 0x29 , 0x00 , 0xA9 , 0xFF , 0xA9 , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , +0x2F , 0x00 , 0x2F , 0x00 , 0x8F , 0x00 , 0x8F , 0x00 , 0xB7 , 0x00 , 0xB7 , 0x00 , 0x6A , 0xFF , 0x6A , 0xFF , +0x8D , 0xFF , 0x8D , 0xFF , 0x21 , 0x00 , 0x21 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , +0xFA , 0xFF , 0xFA , 0xFF , 0x2C , 0x00 , 0x2C , 0x00 , 0x63 , 0x00 , 0x63 , 0x00 , 0x99 , 0xFF , 0x99 , 0xFF , +0x97 , 0xFF , 0x97 , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , +0x7A , 0xFF , 0x7A , 0xFF , 0x55 , 0xFF , 0x55 , 0xFF , 0x33 , 0xFF , 0x33 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , +0xEB , 0xFF , 0xEB , 0xFF , 0x9F , 0xFF , 0x9F , 0xFF , 0xBB , 0xFF , 0xBB , 0xFF , 0x3B , 0x00 , 0x3B , 0x00 , +0x6D , 0x00 , 0x6D , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , 0x31 , 0x00 , 0x31 , 0x00 , +0x87 , 0x00 , 0x87 , 0x00 , 0xC1 , 0xFF , 0xC1 , 0xFF , 0x8E , 0xFF , 0x8E , 0xFF , 0xC3 , 0xFF , 0xC3 , 0xFF , +0xF0 , 0xFF , 0xF0 , 0xFF , 0x6E , 0x00 , 0x6E , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , 0x77 , 0x00 , 0x77 , 0x00 , +0x89 , 0x00 , 0x89 , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , +0x2C , 0x00 , 0x2C , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , 0xC4 , 0xFF , 0xC4 , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , +0x70 , 0xFF , 0x70 , 0xFF , 0xC4 , 0xFF , 0xC4 , 0xFF , 0x86 , 0x00 , 0x86 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , +0xC2 , 0xFF , 0xC2 , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , 0xEB , 0xFF , 0xEB , 0xFF , 0x5A , 0x00 , 0x5A , 0x00 , +0x23 , 0x00 , 0x23 , 0x00 , 0xE5 , 0xFF , 0xE5 , 0xFF , 0x28 , 0x00 , 0x28 , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , +0x69 , 0x00 , 0x69 , 0x00 , 0x6E , 0x00 , 0x6E , 0x00 , 0x6B , 0x00 , 0x6B , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , +0x13 , 0x00 , 0x13 , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , 0x2B , 0x00 , 0x2B , 0x00 , 0xEE , 0xFF , 0xEE , 0xFF , +0xA0 , 0xFF , 0xA0 , 0xFF , 0x25 , 0x00 , 0x25 , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , 0xEA , 0xFF , 0xEA , 0xFF , +0xC1 , 0xFF , 0xC1 , 0xFF , 0xDD , 0xFF , 0xDD , 0xFF , 0x5D , 0x00 , 0x5D , 0x00 , 0x3E , 0x00 , 0x3E , 0x00 , +0xFE , 0xFF , 0xFE , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , 0x59 , 0x00 , 0x59 , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , +0xA9 , 0xFF , 0xA9 , 0xFF , 0xC5 , 0xFF , 0xC5 , 0xFF , 0xB4 , 0xFF , 0xB4 , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , +0x5A , 0x00 , 0x5A , 0x00 , 0x40 , 0x00 , 0x40 , 0x00 , 0x9F , 0x00 , 0x9F , 0x00 , 0x3D , 0x00 , 0x3D , 0x00 , +0x22 , 0x00 , 0x22 , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , +0x0C , 0x00 , 0x0C , 0x00 , 0x9F , 0xFF , 0x9F , 0xFF , 0x80 , 0xFF , 0x80 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , +0x0C , 0x00 , 0x0C , 0x00 , 0x5D , 0x00 , 0x5D , 0x00 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , +0xEB , 0xFF , 0xEB , 0xFF , 0x29 , 0x00 , 0x29 , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0xA8 , 0xFF , 0xA8 , 0xFF , +0xEB , 0xFF , 0xEB , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xC3 , 0xFF , 0xC3 , 0xFF , 0xD2 , 0xFF , 0xD2 , 0xFF , 0x19 , 0x00 , 0x19 , 0x00 , 0x23 , 0x00 , 0x23 , 0x00 , +0x2E , 0x00 , 0x2E , 0x00 , 0x40 , 0x00 , 0x40 , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , 0x63 , 0x00 , 0x63 , 0x00 , +0x27 , 0x00 , 0x27 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0xDD , 0xFF , 0xDD , 0xFF , +0xDD , 0xFF , 0xDD , 0xFF , 0xE0 , 0xFF , 0xE0 , 0xFF , 0xDE , 0xFF , 0xDE , 0xFF , 0x46 , 0x00 , 0x46 , 0x00 , +0x11 , 0x00 , 0x11 , 0x00 , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , +0x22 , 0x00 , 0x22 , 0x00 , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xBB , 0xFF , 0xBB , 0xFF , 0xCB , 0xFF , 0xCB , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x0C , 0x00 , 0x0C , 0x00 , 0xF3 , 0xFF , 0xF3 , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , +0x33 , 0x00 , 0x33 , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , +0xED , 0xFF , 0xED , 0xFF , 0x30 , 0x00 , 0x30 , 0x00 , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , +0xED , 0xFF , 0xED , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , +0xEC , 0xFF , 0xEC , 0xFF , 0x0F , 0x00 , 0x0F , 0x00 , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xE1 , 0xFF , 0xE1 , 0xFF , +0x17 , 0x00 , 0x17 , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , +0xEE , 0xFF , 0xEE , 0xFF , 0x06 , 0x00 , 0x06 , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , 0xE3 , 0xFF , 0xE3 , 0xFF , +0xD4 , 0xFF , 0xD4 , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xCF , 0xFF , 0xCF , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0x08 , 0x00 , 0x08 , 0x00 , 0xEC , 0xFF , 0xEC , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0xC1 , 0xFF , 0xC1 , 0xFF , 0x13 , 0x00 , 0x13 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , +0xD2 , 0xFF , 0xD2 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0x0F , 0x00 , 0x0F , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , +0xEC , 0xFF , 0xEC , 0xFF , 0xBF , 0xFF , 0xBF , 0xFF , 0x06 , 0x00 , 0x06 , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , +0x19 , 0x00 , 0x19 , 0x00 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , +0x12 , 0x00 , 0x12 , 0x00 , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xC8 , 0xFF , 0xC8 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , +0x19 , 0x00 , 0x19 , 0x00 , 0xEC , 0xFF , 0xEC , 0xFF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , +0xF9 , 0xFF , 0xF9 , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , +0x00 , 0x00 , 0x00 , 0x00 , 0x1E , 0x00 , 0x1E , 0x00 , 0x27 , 0x00 , 0x27 , 0x00 , 0x23 , 0x00 , 0x23 , 0x00 , +0x11 , 0x00 , 0x11 , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , +0xFF , 0xFF , 0xFF , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , +0xED , 0xFF , 0xED , 0xFF , 0x24 , 0x00 , 0x24 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , 0xF3 , 0xFF , 0xF3 , 0xFF , +0xEE , 0xFF , 0xEE , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0xE0 , 0xFF , 0xE0 , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0x05 , 0x00 , 0x05 , 0x00 , +0xFD , 0xFF , 0xFD , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0x16 , 0x00 , 0x16 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , 0x15 , 0x00 , 0x15 , 0x00 , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0x04 , 0x00 , 0x04 , 0x00 , +0x19 , 0x00 , 0x19 , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0x17 , 0x00 , 0x17 , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0x2F , 0x00 , 0x2F , 0x00 , +0x3C , 0x00 , 0x3C , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , +0x0A , 0x00 , 0x0A , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0xD8 , 0xFF , 0xD8 , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , +0xD7 , 0xFF , 0xD7 , 0xFF , 0xD8 , 0xFF , 0xD8 , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0x2D , 0x00 , 0x2D , 0x00 , +0x2D , 0x00 , 0x2D , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , 0x1E , 0x00 , 0x1E , 0x00 , +0x0E , 0x00 , 0x0E , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , +0x2D , 0x00 , 0x2D , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , +0x4E , 0x00 , 0x4E , 0x00 , 0x2E , 0x00 , 0x2E , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , 0xF1 , 0xFF , 0xF1 , 0xFF , +0xDC , 0xFF , 0xDC , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xD6 , 0xFF , 0xD6 , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , +0xDC , 0xFF , 0xDC , 0xFF , 0xC4 , 0xFF , 0xC4 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , +0x06 , 0x00 , 0x06 , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xD8 , 0xFF , 0xD8 , 0xFF , +0xFD , 0xFF , 0xFD , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0x1A , 0x00 , 0x1A , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , +0x24 , 0x00 , 0x24 , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0x03 , 0x00 , 0x03 , 0x00 , +0x24 , 0x00 , 0x24 , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , +0xFC , 0xFF , 0xFC , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0xC3 , 0xFF , 0xC3 , 0xFF , +0xBC , 0xFF , 0xBC , 0xFF , 0xB7 , 0xFF , 0xB7 , 0xFF , 0x9D , 0xFF , 0x9D , 0xFF , 0xBE , 0xFF , 0xBE , 0xFF , +0xDE , 0xFF , 0xDE , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , 0xF2 , 0xFF , 0xF2 , 0xFF , 0x0E , 0x00 , 0x0E , 0x00 , +0x28 , 0x00 , 0x28 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , 0x4F , 0x00 , 0x4F , 0x00 , +0x52 , 0x00 , 0x52 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , 0x28 , 0x00 , 0x28 , 0x00 , +0x17 , 0x00 , 0x17 , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0xF8 , 0xFF , 0xF8 , 0xFF , 0x05 , 0x00 , 0x05 , 0x00 , +0x04 , 0x00 , 0x04 , 0x00 , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , +0xF2 , 0xFF , 0xF2 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , 0xDE , 0xFF , 0xDE , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0xD3 , 0xFF , 0xD3 , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , +0xC7 , 0xFF , 0xC7 , 0xFF , 0xD3 , 0xFF , 0xD3 , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , 0xB7 , 0xFF , 0xB7 , 0xFF , +0xC1 , 0xFF , 0xC1 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , +0x1C , 0x00 , 0x1C , 0x00 , 0x40 , 0x00 , 0x40 , 0x00 , 0x4F , 0x00 , 0x4F , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , +0x6A , 0x00 , 0x6A , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , 0x47 , 0x00 , 0x47 , 0x00 , +0x38 , 0x00 , 0x38 , 0x00 , 0x50 , 0x00 , 0x50 , 0x00 , 0x47 , 0x00 , 0x47 , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , +0x15 , 0x00 , 0x15 , 0x00 , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0xD3 , 0xFF , 0xD3 , 0xFF , 0xB9 , 0xFF , 0xB9 , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , +0xAC , 0xFF , 0xAC , 0xFF , 0x9C , 0xFF , 0x9C , 0xFF , 0xBA , 0xFF , 0xBA , 0xFF , 0xC1 , 0xFF , 0xC1 , 0xFF , +0xC9 , 0xFF , 0xC9 , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , +0xF6 , 0xFF , 0xF6 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0xFD , 0xFF , 0xFD , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , +0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , +0xFE , 0xFF , 0xFE , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , +0xFD , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , 0x08 , 0x00 , 0x08 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0xDB , 0xFF , 0xDB , 0xFF , 0x26 , 0x00 , 0x26 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , +0xEC , 0xFF , 0xEC , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0xC5 , 0xFF , 0xC5 , 0xFF , +0xFB , 0xFF , 0xFB , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , 0x23 , 0x00 , 0x23 , 0x00 , +0x59 , 0x00 , 0x59 , 0x00 , 0xC8 , 0xFF , 0xC8 , 0xFF , 0x24 , 0x00 , 0x24 , 0x00 , 0x6C , 0x00 , 0x6C , 0x00 , +0xA4 , 0xFF , 0xA4 , 0xFF , 0x34 , 0x00 , 0x34 , 0x00 , 0x4A , 0x00 , 0x4A , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , +0x73 , 0x00 , 0x73 , 0x00 , 0x0B , 0x00 , 0x0B , 0x00 , 0xE5 , 0xFF , 0xE5 , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , +0x26 , 0x00 , 0x26 , 0x00 , 0x97 , 0xFF , 0x97 , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0x4C , 0xFF , 0x4C , 0xFF , +0xD3 , 0xFF , 0xD3 , 0xFF , 0xAD , 0x00 , 0xAD , 0x00 , 0x0B , 0x01 , 0x0B , 0x01 , 0x3E , 0xFF , 0x3E , 0xFF , +0xA7 , 0x00 , 0xA7 , 0x00 , 0x81 , 0x01 , 0x81 , 0x01 , 0x9C , 0xFE , 0x9C , 0xFE , 0xD6 , 0x00 , 0xD6 , 0x00 , +0xFE , 0x00 , 0xFE , 0x00 , 0xD0 , 0x00 , 0xD0 , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0x4E , 0x00 , 0x4E , 0x00 , +0x67 , 0xFF , 0x67 , 0xFF , 0x31 , 0x00 , 0x31 , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0xC1 , 0xFF , 0xC1 , 0xFF , +0xC5 , 0xFE , 0xC5 , 0xFE , 0x29 , 0x00 , 0x29 , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0x8D , 0xFE , 0x8D , 0xFE , +0x05 , 0x01 , 0x05 , 0x01 , 0x9C , 0x02 , 0x9C , 0x02 , 0x00 , 0x00 , 0x00 , 0x00 , 0x40 , 0xFF , 0x40 , 0xFF , +0x3C , 0x01 , 0x3C , 0x01 , 0x5D , 0x00 , 0x5D , 0x00 , 0x35 , 0xFE , 0x35 , 0xFE , 0x62 , 0x00 , 0x62 , 0x00 , +0xBA , 0x01 , 0xBA , 0x01 , 0x5C , 0xFF , 0x5C , 0xFF , 0xAB , 0x00 , 0xAB , 0x00 , 0x5D , 0x02 , 0x5D , 0x02 , +0x10 , 0x00 , 0x10 , 0x00 , 0x8F , 0xFF , 0x8F , 0xFF , 0xD8 , 0x02 , 0xD8 , 0x02 , 0xB1 , 0xFF , 0xB1 , 0xFF , +0x5A , 0xFF , 0x5A , 0xFF , 0xE4 , 0xFF , 0xE4 , 0xFF , 0x2D , 0x00 , 0x2D , 0x00 , 0x29 , 0x01 , 0x29 , 0x01 , +0xE2 , 0xFF , 0xE2 , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0x12 , 0xFE , 0x12 , 0xFE , 0xAE , 0xFD , 0xAE , 0xFD , +0x69 , 0xFF , 0x69 , 0xFF , 0x00 , 0x03 , 0x00 , 0x03 , 0xCA , 0xFF , 0xCA , 0xFF , 0x89 , 0xFD , 0x89 , 0xFD , +0xA6 , 0x03 , 0xA6 , 0x03 , 0x30 , 0xFD , 0x30 , 0xFD , 0x50 , 0xFF , 0x50 , 0xFF , 0x90 , 0x03 , 0x90 , 0x03 , +0xAA , 0xFE , 0xAA , 0xFE , 0x72 , 0x01 , 0x72 , 0x01 , 0xF2 , 0x00 , 0xF2 , 0x00 , 0x8B , 0xFF , 0x8B , 0xFF , +0x2B , 0xFF , 0x2B , 0xFF , 0x2D , 0xFF , 0x2D , 0xFF , 0x18 , 0x02 , 0x18 , 0x02 , 0x5C , 0xFE , 0x5C , 0xFE , +0x1B , 0xFD , 0x1B , 0xFD , 0xBE , 0x02 , 0xBE , 0x02 , 0x16 , 0xFE , 0x16 , 0xFE , 0x04 , 0xFE , 0x04 , 0xFE , +0xDC , 0x01 , 0xDC , 0x01 , 0xC9 , 0x02 , 0xC9 , 0x02 , 0x51 , 0x00 , 0x51 , 0x00 , 0x87 , 0xFD , 0x87 , 0xFD , +0x3C , 0x01 , 0x3C , 0x01 , 0xFC , 0x00 , 0xFC , 0x00 , 0x46 , 0xFD , 0x46 , 0xFD , 0xEB , 0x00 , 0xEB , 0x00 , +0x86 , 0x01 , 0x86 , 0x01 , 0x6A , 0xFF , 0x6A , 0xFF , 0xAA , 0x00 , 0xAA , 0x00 , 0x54 , 0xFF , 0x54 , 0xFF , +0x16 , 0xFF , 0x16 , 0xFF , 0x88 , 0x00 , 0x88 , 0x00 , 0x06 , 0x00 , 0x06 , 0x00 , 0x30 , 0xFF , 0x30 , 0xFF , +0x94 , 0x00 , 0x94 , 0x00 , 0x4C , 0x00 , 0x4C , 0x00 , 0x36 , 0xFF , 0x36 , 0xFF , 0x90 , 0xFF , 0x90 , 0xFF , +0xB9 , 0x00 , 0xB9 , 0x00 , 0x68 , 0xFF , 0x68 , 0xFF , 0x9E , 0xFF , 0x9E , 0xFF , 0x6A , 0x01 , 0x6A , 0x01 , +0x89 , 0x00 , 0x89 , 0x00 , 0x05 , 0xFF , 0x05 , 0xFF , 0x36 , 0x00 , 0x36 , 0x00 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0x5F , 0xFF , 0x5F , 0xFF , 0x9F , 0xFF , 0x9F , 0xFF , 0x19 , 0x01 , 0x19 , 0x01 , 0xEF , 0xFF , 0xEF , 0xFF , +0xA3 , 0xFF , 0xA3 , 0xFF , 0x12 , 0x01 , 0x12 , 0x01 , 0x75 , 0x00 , 0x75 , 0x00 , 0x26 , 0xFF , 0x26 , 0xFF , +0x07 , 0x01 , 0x07 , 0x01 , 0xD8 , 0x00 , 0xD8 , 0x00 , 0xEA , 0xFE , 0xEA , 0xFE , 0x4F , 0x00 , 0x4F , 0x00 , +0xD7 , 0xFF , 0xD7 , 0xFF , 0xAF , 0xFF , 0xAF , 0xFF , 0x74 , 0x00 , 0x74 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , +0xDB , 0xFF , 0xDB , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , 0x6B , 0xFF , 0x6B , 0xFF , 0x5F , 0x00 , 0x5F , 0x00 , +0x24 , 0x00 , 0x24 , 0x00 , 0xED , 0xFE , 0xED , 0xFE , 0xDD , 0xFF , 0xDD , 0xFF , 0x12 , 0x01 , 0x12 , 0x01 , +0xF9 , 0xFF , 0xF9 , 0xFF , 0xD3 , 0xFE , 0xD3 , 0xFE , 0xA2 , 0x01 , 0xA2 , 0x01 , 0x0A , 0x01 , 0x0A , 0x01 , +0x0E , 0xFF , 0x0E , 0xFF , 0xAD , 0x00 , 0xAD , 0x00 , 0x8C , 0x00 , 0x8C , 0x00 , 0x62 , 0xFE , 0x62 , 0xFE , +0x4C , 0x00 , 0x4C , 0x00 , 0x50 , 0x01 , 0x50 , 0x01 , 0x24 , 0xFF , 0x24 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , +0xD6 , 0x00 , 0xD6 , 0x00 , 0x8C , 0xFF , 0x8C , 0xFF , 0x3E , 0xFF , 0x3E , 0xFF , 0xD6 , 0x00 , 0xD6 , 0x00 , +0x0C , 0x00 , 0x0C , 0x00 , 0xE1 , 0xFE , 0xE1 , 0xFE , 0x18 , 0x00 , 0x18 , 0x00 , 0x9C , 0x01 , 0x9C , 0x01 , +0x90 , 0xFF , 0x90 , 0xFF , 0xF1 , 0xFE , 0xF1 , 0xFE , 0x8F , 0x00 , 0x8F , 0x00 , 0x3E , 0x01 , 0x3E , 0x01 , +0x54 , 0xFF , 0x54 , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , 0x8C , 0x01 , 0x8C , 0x01 , 0xEE , 0xFE , 0xEE , 0xFE , +0xFC , 0xFE , 0xFC , 0xFE , 0x82 , 0x01 , 0x82 , 0x01 , 0xEE , 0xFF , 0xEE , 0xFF , 0x6D , 0xFE , 0x6D , 0xFE , +0xD5 , 0x00 , 0xD5 , 0x00 , 0x71 , 0x00 , 0x71 , 0x00 , 0xEB , 0xFE , 0xEB , 0xFE , 0x8A , 0xFF , 0x8A , 0xFF , +0xF2 , 0x00 , 0xF2 , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0xFD , 0xFE , 0xFD , 0xFE , 0xD6 , 0x00 , 0xD6 , 0x00 , +0xE5 , 0x00 , 0xE5 , 0x00 , 0x27 , 0xFF , 0x27 , 0xFF , 0xAC , 0xFF , 0xAC , 0xFF , 0x7B , 0x00 , 0x7B , 0x00 , +0xD4 , 0xFF , 0xD4 , 0xFF , 0x2D , 0xFF , 0x2D , 0xFF , 0xE4 , 0x00 , 0xE4 , 0x00 , 0x7C , 0x00 , 0x7C , 0x00 , +0xF8 , 0xFE , 0xF8 , 0xFE , 0x26 , 0x00 , 0x26 , 0x00 , 0xD4 , 0x00 , 0xD4 , 0x00 , 0x28 , 0xFF , 0x28 , 0xFF , +0x67 , 0xFF , 0x67 , 0xFF , 0xC5 , 0x00 , 0xC5 , 0x00 , 0xA1 , 0xFF , 0xA1 , 0xFF , 0xE0 , 0xFE , 0xE0 , 0xFE , +0x0F , 0x00 , 0x0F , 0x00 , 0xC5 , 0x00 , 0xC5 , 0x00 , 0x7D , 0xFF , 0x7D , 0xFF , 0x73 , 0xFF , 0x73 , 0xFF , +0x12 , 0x01 , 0x12 , 0x01 , 0x5E , 0x00 , 0x5E , 0x00 , 0x47 , 0xFF , 0x47 , 0xFF , 0x6A , 0x00 , 0x6A , 0x00 , +0x1B , 0x01 , 0x1B , 0x01 , 0xFE , 0xFF , 0xFE , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , 0xF0 , 0x00 , 0xF0 , 0x00 , +0x39 , 0x00 , 0x39 , 0x00 , 0x44 , 0xFF , 0x44 , 0xFF , 0x3D , 0x00 , 0x3D , 0x00 , 0x7B , 0x00 , 0x7B , 0x00 , +0x4D , 0xFF , 0x4D , 0xFF , 0xDD , 0xFF , 0xDD , 0xFF , 0x7A , 0x00 , 0x7A , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , +0x03 , 0x00 , 0x03 , 0x00 , 0x51 , 0x00 , 0x51 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0xA0 , 0xFF , 0xA0 , 0xFF , +0x98 , 0xFF , 0x98 , 0xFF , 0xE0 , 0xFE , 0xE0 , 0xFE , 0x90 , 0xFE , 0x90 , 0xFE , 0xF6 , 0xFE , 0xF6 , 0xFE , +0x89 , 0xFF , 0x89 , 0xFF , 0x53 , 0xFF , 0x53 , 0xFF , 0xD6 , 0xFF , 0xD6 , 0xFF , 0x6A , 0x00 , 0x6A , 0x00 , +0x8D , 0xFF , 0x8D , 0xFF , 0xF3 , 0xFE , 0xF3 , 0xFE , 0x6F , 0x00 , 0x6F , 0x00 , 0xA9 , 0x00 , 0xA9 , 0x00 , +0xF7 , 0xFE , 0xF7 , 0xFE , 0x18 , 0x00 , 0x18 , 0x00 , 0xC5 , 0x01 , 0xC5 , 0x01 , 0x04 , 0x00 , 0x04 , 0x00 , +0x52 , 0xFF , 0x52 , 0xFF , 0x8E , 0x01 , 0x8E , 0x01 , 0x50 , 0x01 , 0x50 , 0x01 , 0xA8 , 0x00 , 0xA8 , 0x00 , +0xF3 , 0x02 , 0xF3 , 0x02 , 0x87 , 0x03 , 0x87 , 0x03 , 0x6B , 0x01 , 0x6B , 0x01 , 0x24 , 0x01 , 0x24 , 0x01 , +0xCA , 0x02 , 0xCA , 0x02 , 0x78 , 0x01 , 0x78 , 0x01 , 0xF7 , 0xFD , 0xF7 , 0xFD , 0xEF , 0xFD , 0xEF , 0xFD , +0x63 , 0xFF , 0x63 , 0xFF , 0xCD , 0xFD , 0xCD , 0xFD , 0xE9 , 0xFB , 0xE9 , 0xFB , 0x8A , 0xFD , 0x8A , 0xFD , +0x68 , 0xFE , 0x68 , 0xFE , 0xA5 , 0xFD , 0xA5 , 0xFD , 0xDD , 0xFE , 0xDD , 0xFE , 0x2A , 0x00 , 0x2A , 0x00 , +0x74 , 0xFF , 0x74 , 0xFF , 0xC7 , 0xFE , 0xC7 , 0xFE , 0x28 , 0xFF , 0x28 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0x17 , 0xFF , 0x17 , 0xFF , 0x45 , 0xFE , 0x45 , 0xFE , 0x28 , 0x00 , 0x28 , 0x00 , 0x54 , 0x02 , 0x54 , 0x02 , +0x97 , 0x02 , 0x97 , 0x02 , 0x4E , 0x01 , 0x4E , 0x01 , 0x29 , 0x01 , 0x29 , 0x01 , 0x92 , 0x02 , 0x92 , 0x02 , +0x94 , 0x05 , 0x94 , 0x05 , 0x90 , 0x08 , 0x90 , 0x08 , 0x63 , 0x09 , 0x63 , 0x09 , 0xAA , 0x08 , 0xAA , 0x08 , +0x00 , 0x07 , 0x00 , 0x07 , 0xCD , 0x04 , 0xCD , 0x04 , 0xD5 , 0xFF , 0xD5 , 0xFF , 0xD7 , 0xF9 , 0xD7 , 0xF9 , +0x33 , 0xF8 , 0x33 , 0xF8 , 0x85 , 0xFA , 0x85 , 0xFA , 0x61 , 0xFA , 0x61 , 0xFA , 0xB8 , 0xFA , 0xB8 , 0xFA , +0xB2 , 0xFF , 0xB2 , 0xFF , 0xD8 , 0x01 , 0xD8 , 0x01 , 0x07 , 0x00 , 0x07 , 0x00 , 0xAC , 0xFD , 0xAC , 0xFD , +0xA7 , 0xFD , 0xA7 , 0xFD , 0x73 , 0xFD , 0x73 , 0xFD , 0x1C , 0xFA , 0x1C , 0xFA , 0x82 , 0xF8 , 0x82 , 0xF8 , +0xB9 , 0xFB , 0xB9 , 0xFB , 0x28 , 0xFE , 0x28 , 0xFE , 0x5F , 0xFE , 0x5F , 0xFE , 0x07 , 0xFF , 0x07 , 0xFF , +0x07 , 0x00 , 0x07 , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0x29 , 0xFF , 0x29 , 0xFF , 0x54 , 0x00 , 0x54 , 0x00 , +0x4C , 0x02 , 0x4C , 0x02 , 0xE5 , 0x01 , 0xE5 , 0x01 , 0x0B , 0x02 , 0x0B , 0x02 , 0x5B , 0x07 , 0x5B , 0x07 , +0xDD , 0x0D , 0xDD , 0x0D , 0xF8 , 0x0D , 0xF8 , 0x0D , 0xFA , 0x0A , 0xFA , 0x0A , 0xBE , 0x07 , 0xBE , 0x07 , +0x88 , 0x01 , 0x88 , 0x01 , 0x66 , 0xF9 , 0x66 , 0xF9 , 0x9F , 0xF4 , 0x9F , 0xF4 , 0x32 , 0xF4 , 0x32 , 0xF4 , +0x94 , 0xF6 , 0x94 , 0xF6 , 0xAE , 0xFB , 0xAE , 0xFB , 0xD0 , 0x00 , 0xD0 , 0x00 , 0x7E , 0x04 , 0x7E , 0x04 , +0x3A , 0x05 , 0x3A , 0x05 , 0x22 , 0x03 , 0x22 , 0x03 , 0x89 , 0xFF , 0x89 , 0xFF , 0x25 , 0xFB , 0x25 , 0xFB , +0xE4 , 0xF7 , 0xE4 , 0xF7 , 0x5B , 0xF7 , 0x5B , 0xF7 , 0x9F , 0xF8 , 0x9F , 0xF8 , 0x09 , 0xFC , 0x09 , 0xFC , +0xD2 , 0xFF , 0xD2 , 0xFF , 0xF3 , 0x01 , 0xF3 , 0x01 , 0x7C , 0x03 , 0x7C , 0x03 , 0xD0 , 0x02 , 0xD0 , 0x02 , +0x85 , 0xFF , 0x85 , 0xFF , 0xD3 , 0xFC , 0xD3 , 0xFC , 0xC5 , 0xFB , 0xC5 , 0xFB , 0x06 , 0xFE , 0x06 , 0xFE , +0x9D , 0x00 , 0x9D , 0x00 , 0x5A , 0x01 , 0x5A , 0x01 , 0x51 , 0x05 , 0x51 , 0x05 , 0x79 , 0x0C , 0x79 , 0x0C , +0x7C , 0x0F , 0x7C , 0x0F , 0x4E , 0x0B , 0x4E , 0x0B , 0x80 , 0x05 , 0x80 , 0x05 , 0x22 , 0x00 , 0x22 , 0x00 , +0x37 , 0xFA , 0x37 , 0xFA , 0x80 , 0xF5 , 0x80 , 0xF5 , 0xDC , 0xF4 , 0xDC , 0xF4 , 0x64 , 0xF8 , 0x64 , 0xF8 , +0x41 , 0xFE , 0x41 , 0xFE , 0x7D , 0x03 , 0x7D , 0x03 , 0x1C , 0x06 , 0x1C , 0x06 , 0x85 , 0x05 , 0x85 , 0x05 , +0x04 , 0x02 , 0x04 , 0x02 , 0x8E , 0xFD , 0x8E , 0xFD , 0xED , 0xF9 , 0xED , 0xF9 , 0x29 , 0xF8 , 0x29 , 0xF8 , +0xDA , 0xF8 , 0xDA , 0xF8 , 0xFE , 0xFA , 0xFE , 0xFA , 0xCA , 0xFD , 0xCA , 0xFD , 0x27 , 0x01 , 0x27 , 0x01 , +0x68 , 0x03 , 0x68 , 0x03 , 0x36 , 0x03 , 0x36 , 0x03 , 0x12 , 0x01 , 0x12 , 0x01 , 0x85 , 0xFF , 0x85 , 0xFF , +0xFE , 0xFD , 0xFE , 0xFD , 0x72 , 0xFC , 0x72 , 0xFC , 0x48 , 0xFC , 0x48 , 0xFC , 0x9C , 0xFE , 0x9C , 0xFE , +0xD0 , 0x02 , 0xD0 , 0x02 , 0x56 , 0x05 , 0x56 , 0x05 , 0x53 , 0x09 , 0x53 , 0x09 , 0x90 , 0x0E , 0x90 , 0x0E , +0x35 , 0x0D , 0x35 , 0x0D , 0xBB , 0x06 , 0xBB , 0x06 , 0x32 , 0x00 , 0x32 , 0x00 , 0x64 , 0xFA , 0x64 , 0xFA , +0x3A , 0xF7 , 0x3A , 0xF7 , 0xE8 , 0xF5 , 0xE8 , 0xF5 , 0x9A , 0xF7 , 0x9A , 0xF7 , 0xD2 , 0xFD , 0xD2 , 0xFD , +0x62 , 0x04 , 0x62 , 0x04 , 0xE9 , 0x07 , 0xE9 , 0x07 , 0xCC , 0x06 , 0xCC , 0x06 , 0xCF , 0x01 , 0xCF , 0x01 , +0x3D , 0xFD , 0x3D , 0xFD , 0x6C , 0xF9 , 0x6C , 0xF9 , 0xC3 , 0xF6 , 0xC3 , 0xF6 , 0xAD , 0xF7 , 0xAD , 0xF7 , +0xDB , 0xFA , 0xDB , 0xFA , 0x44 , 0xFE , 0x44 , 0xFE , 0xDC , 0x01 , 0xDC , 0x01 , 0x76 , 0x04 , 0x76 , 0x04 , +0xF3 , 0x04 , 0xF3 , 0x04 , 0xA0 , 0x02 , 0xA0 , 0x02 , 0x05 , 0xFF , 0x05 , 0xFF , 0x4F , 0xFD , 0x4F , 0xFD , +0x1B , 0xFC , 0x1B , 0xFC , 0x14 , 0xFC , 0x14 , 0xFC , 0x94 , 0xFD , 0x94 , 0xFD , 0xBE , 0x00 , 0xBE , 0x00 , +0x0A , 0x04 , 0x0A , 0x04 , 0x34 , 0x08 , 0x34 , 0x08 , 0xEF , 0x0E , 0xEF , 0x0E , 0x8E , 0x11 , 0x8E , 0x11 , +0x3A , 0x0B , 0x3A , 0x0B , 0xC0 , 0x01 , 0xC0 , 0x01 , 0x00 , 0xFB , 0x00 , 0xFB , 0xD2 , 0xF6 , 0xD2 , 0xF6 , +0x4A , 0xF4 , 0x4A , 0xF4 , 0xE3 , 0xF4 , 0xE3 , 0xF4 , 0xDA , 0xFA , 0xDA , 0xFA , 0xDA , 0x04 , 0xDA , 0x04 , +0xA9 , 0x0C , 0xA9 , 0x0C , 0x39 , 0x0C , 0x39 , 0x0C , 0x64 , 0x05 , 0x64 , 0x05 , 0xD2 , 0xFD , 0xD2 , 0xFD , +0x98 , 0xF9 , 0x98 , 0xF9 , 0x94 , 0xF6 , 0x94 , 0xF6 , 0xBB , 0xF3 , 0xBB , 0xF3 , 0x80 , 0xF6 , 0x80 , 0xF6 , +0x6B , 0xFD , 0x6B , 0xFD , 0x89 , 0x03 , 0x89 , 0x03 , 0x56 , 0x07 , 0x56 , 0x07 , 0x3E , 0x07 , 0x3E , 0x07 , +0x01 , 0x05 , 0x01 , 0x05 , 0x74 , 0x01 , 0x74 , 0x01 , 0xEA , 0xFC , 0xEA , 0xFC , 0x99 , 0xF9 , 0x99 , 0xF9 , +0xE2 , 0xF7 , 0xE2 , 0xF7 , 0x07 , 0xF9 , 0x07 , 0xF9 , 0x97 , 0xFC , 0x97 , 0xFC , 0x6D , 0x00 , 0x6D , 0x00 , +0xA8 , 0x03 , 0xA8 , 0x03 , 0x37 , 0x07 , 0x37 , 0x07 , 0x93 , 0x0F , 0x93 , 0x0F , 0xFA , 0x16 , 0xFA , 0x16 , +0xA8 , 0x13 , 0xA8 , 0x13 , 0x8B , 0x05 , 0x8B , 0x05 , 0x74 , 0xF7 , 0x74 , 0xF7 , 0x04 , 0xF1 , 0x04 , 0xF1 , +0xD0 , 0xEF , 0xD0 , 0xEF , 0xC7 , 0xF1 , 0xC7 , 0xF1 , 0x6F , 0xF7 , 0x6F , 0xF7 , 0x71 , 0x02 , 0x71 , 0x02 , +0xCC , 0x0E , 0xCC , 0x0E , 0x83 , 0x12 , 0x83 , 0x12 , 0xDB , 0x09 , 0xDB , 0x09 , 0xCA , 0xFC , 0xCA , 0xFC , +0xA5 , 0xF5 , 0xA5 , 0xF5 , 0xD1 , 0xF5 , 0xD1 , 0xF5 , 0xC3 , 0xF4 , 0xC3 , 0xF4 , 0x04 , 0xF3 , 0x04 , 0xF3 , +0xC3 , 0xF7 , 0xC3 , 0xF7 , 0x5F , 0x01 , 0x5F , 0x01 , 0x83 , 0x09 , 0x83 , 0x09 , 0xC1 , 0x09 , 0xC1 , 0x09 , +0xB7 , 0x03 , 0xB7 , 0x03 , 0xFF , 0xFE , 0xFF , 0xFE , 0x30 , 0xFD , 0x30 , 0xFD , 0x00 , 0xFC , 0x00 , 0xFC , +0x16 , 0xF9 , 0x16 , 0xF9 , 0x31 , 0xF7 , 0x31 , 0xF7 , 0xE3 , 0xF9 , 0xE3 , 0xF9 , 0x44 , 0xFF , 0x44 , 0xFF , +0x87 , 0x03 , 0x87 , 0x03 , 0x0F , 0x05 , 0x0F , 0x05 , 0x39 , 0x0A , 0x39 , 0x0A , 0xFF , 0x14 , 0xFF , 0x14 , +0x2B , 0x19 , 0x2B , 0x19 , 0x6E , 0x0F , 0x6E , 0x0F , 0xDA , 0xFB , 0xDA , 0xFB , 0xF6 , 0xEC , 0xF6 , 0xEC , +0x81 , 0xEA , 0x81 , 0xEA , 0x12 , 0xEF , 0x12 , 0xEF , 0x6F , 0xF6 , 0x6F , 0xF6 , 0x33 , 0xFF , 0x33 , 0xFF , +0xFF , 0x09 , 0xFF , 0x09 , 0x02 , 0x13 , 0x02 , 0x13 , 0xE9 , 0x11 , 0xE9 , 0x11 , 0xB7 , 0x04 , 0xB7 , 0x04 , +0xD5 , 0xF4 , 0xD5 , 0xF4 , 0xDA , 0xED , 0xDA , 0xED , 0x28 , 0xF2 , 0x28 , 0xF2 , 0x79 , 0xF7 , 0x79 , 0xF7 , +0xEA , 0xF9 , 0xEA , 0xF9 , 0x67 , 0xFE , 0x67 , 0xFE , 0x75 , 0x05 , 0x75 , 0x05 , 0x22 , 0x0B , 0x22 , 0x0B , +0x92 , 0x08 , 0x92 , 0x08 , 0x48 , 0xFF , 0x48 , 0xFF , 0x89 , 0xF8 , 0x89 , 0xF8 , 0xA9 , 0xF8 , 0xA9 , 0xF8 , +0x05 , 0xFD , 0x05 , 0xFD , 0xAC , 0xFE , 0xAC , 0xFE , 0x87 , 0xFC , 0x87 , 0xFC , 0x85 , 0xFB , 0x85 , 0xFB , +0x14 , 0xFE , 0x14 , 0xFE , 0x90 , 0x02 , 0x90 , 0x02 , 0xBF , 0x04 , 0xBF , 0x04 , 0x16 , 0x09 , 0x16 , 0x09 , +0xE7 , 0x12 , 0xE7 , 0x12 , 0xC9 , 0x18 , 0xC9 , 0x18 , 0x78 , 0x11 , 0x78 , 0x11 , 0x33 , 0xFD , 0x33 , 0xFD , +0x9B , 0xEB , 0x9B , 0xEB , 0x03 , 0xE8 , 0x03 , 0xE8 , 0x78 , 0xEF , 0x78 , 0xEF , 0x58 , 0xFA , 0x58 , 0xFA , +0x60 , 0x03 , 0x60 , 0x03 , 0x82 , 0x0C , 0x82 , 0x0C , 0x10 , 0x13 , 0x10 , 0x13 , 0x94 , 0x11 , 0x94 , 0x11 , +0x77 , 0x05 , 0x77 , 0x05 , 0x3E , 0xF4 , 0x3E , 0xF4 , 0x84 , 0xEA , 0x84 , 0xEA , 0x14 , 0xEE , 0x14 , 0xEE , +0x20 , 0xF8 , 0x20 , 0xF8 , 0x9A , 0xFE , 0x9A , 0xFE , 0x85 , 0x01 , 0x85 , 0x01 , 0xB2 , 0x04 , 0xB2 , 0x04 , +0x14 , 0x08 , 0x14 , 0x08 , 0xBE , 0x07 , 0xBE , 0x07 , 0x00 , 0x01 , 0x00 , 0x01 , 0x76 , 0xF9 , 0x76 , 0xF9 , +0xB9 , 0xF7 , 0xB9 , 0xF7 , 0x28 , 0xFC , 0x28 , 0xFC , 0x3F , 0x01 , 0x3F , 0x01 , 0xD9 , 0x00 , 0xD9 , 0x00 , +0x9B , 0xFC , 0x9B , 0xFC , 0xD6 , 0xF9 , 0xD6 , 0xF9 , 0xFD , 0xFB , 0xFD , 0xFB , 0x08 , 0x01 , 0x08 , 0x01 , +0x2B , 0x06 , 0x2B , 0x06 , 0x82 , 0x0F , 0x82 , 0x0F , 0x87 , 0x19 , 0x87 , 0x19 , 0x49 , 0x1A , 0x49 , 0x1A , +0xC3 , 0x0B , 0xC3 , 0x0B , 0xD7 , 0xF3 , 0xD7 , 0xF3 , 0x56 , 0xE4 , 0x56 , 0xE4 , 0xFD , 0xE4 , 0xFD , 0xE4 , +0x10 , 0xF2 , 0x10 , 0xF2 , 0xE9 , 0x00 , 0xE9 , 0x00 , 0xD8 , 0x0B , 0xD8 , 0x0B , 0x96 , 0x13 , 0x96 , 0x13 , +0x04 , 0x15 , 0x04 , 0x15 , 0x49 , 0x0D , 0x49 , 0x0D , 0x9C , 0xFC , 0x9C , 0xFC , 0x33 , 0xEC , 0x33 , 0xEC , +0x7C , 0xE7 , 0x7C , 0xE7 , 0x3F , 0xEF , 0x3F , 0xEF , 0xEF , 0xFB , 0xEF , 0xFB , 0x55 , 0x03 , 0x55 , 0x03 , +0x75 , 0x04 , 0x75 , 0x04 , 0x7D , 0x04 , 0x7D , 0x04 , 0x5D , 0x04 , 0x5D , 0x04 , 0xED , 0x03 , 0xED , 0x03 , +0x22 , 0x00 , 0x22 , 0x00 , 0x7E , 0xFB , 0x7E , 0xFB , 0xCC , 0xFA , 0xCC , 0xFA , 0x02 , 0xFE , 0x02 , 0xFE , +0x4E , 0x02 , 0x4E , 0x02 , 0xB2 , 0x01 , 0xB2 , 0x01 , 0x49 , 0xFC , 0x49 , 0xFC , 0x32 , 0xF7 , 0x32 , 0xF7 , +0x8E , 0xF7 , 0x8E , 0xF7 , 0xA7 , 0xFE , 0xA7 , 0xFE , 0xDB , 0x07 , 0xDB , 0x07 , 0xA7 , 0x13 , 0xA7 , 0x13 , +0x47 , 0x1E , 0x47 , 0x1E , 0x71 , 0x1E , 0x71 , 0x1E , 0x1D , 0x0F , 0x1D , 0x0F , 0x17 , 0xF4 , 0x17 , 0xF4 , +0x50 , 0xDF , 0x50 , 0xDF , 0x31 , 0xDD , 0x31 , 0xDD , 0x32 , 0xED , 0x32 , 0xED , 0x7D , 0x03 , 0x7D , 0x03 , +0xC1 , 0x12 , 0xC1 , 0x12 , 0xA3 , 0x18 , 0xA3 , 0x18 , 0x7B , 0x15 , 0x7B , 0x15 , 0x76 , 0x0B , 0x76 , 0x0B , +0xCA , 0xFB , 0xCA , 0xFB , 0xF9 , 0xEA , 0xF9 , 0xEA , 0x07 , 0xE3 , 0x07 , 0xE3 , 0x4D , 0xE9 , 0x4D , 0xE9 , +0x7A , 0xF9 , 0x7A , 0xF9 , 0xE6 , 0x07 , 0xE6 , 0x07 , 0xF5 , 0x0C , 0xF5 , 0x0C , 0x1C , 0x0B , 0x1C , 0x0B , +0xE8 , 0x05 , 0xE8 , 0x05 , 0x2F , 0x01 , 0x2F , 0x01 , 0xD2 , 0xFE , 0xD2 , 0xFE , 0x39 , 0xFD , 0x39 , 0xFD , +0x35 , 0xFD , 0x35 , 0xFD , 0x2F , 0xFE , 0x2F , 0xFE , 0xB5 , 0xFE , 0xB5 , 0xFE , 0x47 , 0xFE , 0x47 , 0xFE , +0xDE , 0xFB , 0xDE , 0xFB , 0x8D , 0xF8 , 0x8D , 0xF8 , 0x04 , 0xF7 , 0x04 , 0xF7 , 0xEC , 0xF8 , 0xEC , 0xF8 , +0xBC , 0xFF , 0xBC , 0xFF , 0x57 , 0x09 , 0x57 , 0x09 , 0xD2 , 0x15 , 0xD2 , 0x15 , 0xF7 , 0x20 , 0xF7 , 0x20 , +0x77 , 0x20 , 0x77 , 0x20 , 0x60 , 0x0F , 0x60 , 0x0F , 0x01 , 0xF3 , 0x01 , 0xF3 , 0xB6 , 0xDC , 0xB6 , 0xDC , +0xDE , 0xD9 , 0xDE , 0xD9 , 0x14 , 0xEB , 0x14 , 0xEB , 0x70 , 0x05 , 0x70 , 0x05 , 0xFB , 0x17 , 0xFB , 0x17 , +0xA4 , 0x1C , 0xA4 , 0x1C , 0x50 , 0x15 , 0x50 , 0x15 , 0xF0 , 0x07 , 0xF0 , 0x07 , 0x3F , 0xF9 , 0x3F , 0xF9 , +0x18 , 0xEB , 0x18 , 0xEB , 0x79 , 0xE3 , 0x79 , 0xE3 , 0xC3 , 0xE7 , 0xC3 , 0xE7 , 0x32 , 0xF7 , 0x32 , 0xF7 , +0xFE , 0x08 , 0xFE , 0x08 , 0x29 , 0x12 , 0x29 , 0x12 , 0xA4 , 0x0F , 0xA4 , 0x0F , 0x98 , 0x05 , 0x98 , 0x05 , +0xF4 , 0xFB , 0xF4 , 0xFB , 0xB8 , 0xF9 , 0xB8 , 0xF9 , 0xF2 , 0xFB , 0xF2 , 0xFB , 0xAA , 0xFE , 0xAA , 0xFE , +0xA6 , 0xFF , 0xA6 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0x87 , 0xFF , 0x87 , 0xFF , 0x34 , 0xFD , 0x34 , 0xFD , +0xDB , 0xF9 , 0xDB , 0xF9 , 0xC9 , 0xF7 , 0xC9 , 0xF7 , 0x41 , 0xF9 , 0x41 , 0xF9 , 0xF9 , 0xFD , 0xF9 , 0xFD , +0x63 , 0x04 , 0x63 , 0x04 , 0xCF , 0x0A , 0xCF , 0x0A , 0x13 , 0x14 , 0x13 , 0x14 , 0x35 , 0x1D , 0x35 , 0x1D , +0x6F , 0x1C , 0x6F , 0x1C , 0x98 , 0x0B , 0x98 , 0x0B , 0xF7 , 0xEF , 0xF7 , 0xEF , 0x08 , 0xDB , 0x08 , 0xDB , +0xFB , 0xD9 , 0xFB , 0xD9 , 0xFB , 0xEC , 0xFB , 0xEC , 0x62 , 0x08 , 0x62 , 0x08 , 0xA5 , 0x1A , 0xA5 , 0x1A , +0xF2 , 0x1D , 0xF2 , 0x1D , 0xAB , 0x14 , 0xAB , 0x14 , 0x45 , 0x05 , 0x45 , 0x05 , 0x97 , 0xF5 , 0x97 , 0xF5 , +0x5C , 0xE8 , 0x5C , 0xE8 , 0xAF , 0xE2 , 0xAF , 0xE2 , 0xC2 , 0xE8 , 0xC2 , 0xE8 , 0x3C , 0xF9 , 0x3C , 0xF9 , +0xA2 , 0x0B , 0xA2 , 0x0B , 0xC1 , 0x15 , 0xC1 , 0x15 , 0x38 , 0x14 , 0x38 , 0x14 , 0x59 , 0x09 , 0x59 , 0x09 , +0x15 , 0xFD , 0x15 , 0xFD , 0x08 , 0xF7 , 0x08 , 0xF7 , 0x5B , 0xF6 , 0x5B , 0xF6 , 0xA0 , 0xF8 , 0xA0 , 0xF8 , +0x6F , 0xFC , 0x6F , 0xFC , 0x0C , 0x01 , 0x0C , 0x01 , 0xE5 , 0x03 , 0xE5 , 0x03 , 0x1C , 0x02 , 0x1C , 0x02 , +0x91 , 0xFC , 0x91 , 0xFC , 0xFE , 0xF8 , 0xFE , 0xF8 , 0x7F , 0xFA , 0x7F , 0xFA , 0x59 , 0xFF , 0x59 , 0xFF , +0xF0 , 0x03 , 0xF0 , 0x03 , 0x64 , 0x05 , 0x64 , 0x05 , 0x12 , 0x06 , 0x12 , 0x06 , 0x47 , 0x0D , 0x47 , 0x0D , +0xF0 , 0x18 , 0xF0 , 0x18 , 0xDB , 0x1B , 0xDB , 0x1B , 0xA1 , 0x0C , 0xA1 , 0x0C , 0x7E , 0xF0 , 0x7E , 0xF0 , +0x7E , 0xDB , 0x7E , 0xDB , 0x72 , 0xDC , 0x72 , 0xDC , 0x40 , 0xF1 , 0x40 , 0xF1 , 0xB7 , 0x0A , 0xB7 , 0x0A , +0x36 , 0x18 , 0x36 , 0x18 , 0xEF , 0x16 , 0xEF , 0x16 , 0xA0 , 0x0D , 0xA0 , 0x0D , 0xB0 , 0x02 , 0xB0 , 0x02 , +0x3C , 0xF8 , 0x3C , 0xF8 , 0xB3 , 0xED , 0xB3 , 0xED , 0x0F , 0xE7 , 0x0F , 0xE7 , 0x48 , 0xEA , 0x48 , 0xEA , +0xAE , 0xF8 , 0xAE , 0xF8 , 0x76 , 0x0A , 0x76 , 0x0A , 0x4D , 0x15 , 0x4D , 0x15 , 0xEC , 0x14 , 0xEC , 0x14 , +0x82 , 0x0B , 0x82 , 0x0B , 0x31 , 0x00 , 0x31 , 0x00 , 0x86 , 0xF8 , 0x86 , 0xF8 , 0x5B , 0xF4 , 0x5B , 0xF4 , +0x2F , 0xF3 , 0x2F , 0xF3 , 0xB7 , 0xF6 , 0xB7 , 0xF6 , 0xBD , 0xFE , 0xBD , 0xFE , 0x66 , 0x06 , 0x66 , 0x06 , +0xF6 , 0x07 , 0xF6 , 0x07 , 0xA7 , 0x02 , 0xA7 , 0x02 , 0xF2 , 0xFC , 0xF2 , 0xFC , 0xB8 , 0xFB , 0xB8 , 0xFB , +0x0C , 0xFE , 0x0C , 0xFE , 0xC0 , 0x00 , 0xC0 , 0x00 , 0xAF , 0x01 , 0xAF , 0x01 , 0xA5 , 0x01 , 0xA5 , 0x01 , +0x89 , 0x02 , 0x89 , 0x02 , 0xA0 , 0x09 , 0xA0 , 0x09 , 0xC4 , 0x16 , 0xC4 , 0x16 , 0xDA , 0x1D , 0xDA , 0x1D , +0x2F , 0x13 , 0x2F , 0x13 , 0x5D , 0xF8 , 0x5D , 0xF8 , 0x9D , 0xDE , 0x9D , 0xDE , 0xEC , 0xD8 , 0xEC , 0xD8 , +0xF8 , 0xE9 , 0xF8 , 0xE9 , 0xA1 , 0x04 , 0xA1 , 0x04 , 0x1E , 0x17 , 0x1E , 0x17 , 0x98 , 0x19 , 0x98 , 0x19 , +0x68 , 0x11 , 0x68 , 0x11 , 0x08 , 0x06 , 0x08 , 0x06 , 0x98 , 0xFB , 0x98 , 0xFB , 0x49 , 0xF1 , 0x49 , 0xF1 , +0xE2 , 0xE8 , 0xE2 , 0xE8 , 0x78 , 0xE8 , 0x78 , 0xE8 , 0xAF , 0xF3 , 0xAF , 0xF3 , 0x36 , 0x06 , 0x36 , 0x06 , +0x66 , 0x14 , 0x66 , 0x14 , 0xAF , 0x16 , 0xAF , 0x16 , 0x92 , 0x0D , 0x92 , 0x0D , 0x66 , 0x00 , 0x66 , 0x00 , +0x3B , 0xF7 , 0x3B , 0xF7 , 0x48 , 0xF3 , 0x48 , 0xF3 , 0x25 , 0xF2 , 0x25 , 0xF2 , 0x1A , 0xF4 , 0x1A , 0xF4 , +0x03 , 0xFB , 0x03 , 0xFB , 0x70 , 0x04 , 0x70 , 0x04 , 0x3E , 0x0A , 0x3E , 0x0A , 0x21 , 0x08 , 0x21 , 0x08 , +0x5F , 0x01 , 0x5F , 0x01 , 0xFE , 0xFB , 0xFE , 0xFB , 0x69 , 0xFA , 0x69 , 0xFA , 0x41 , 0xFB , 0x41 , 0xFB , +0x3E , 0xFD , 0x3E , 0xFD , 0xCF , 0xFF , 0xCF , 0xFF , 0x5D , 0x02 , 0x5D , 0x02 , 0x40 , 0x05 , 0x40 , 0x05 , +0x7D , 0x0D , 0x7D , 0x0D , 0x16 , 0x1B , 0x16 , 0x1B , 0x97 , 0x20 , 0x97 , 0x20 , 0x80 , 0x12 , 0x80 , 0x12 , +0xE2 , 0xF3 , 0xE2 , 0xF3 , 0x90 , 0xD8 , 0x90 , 0xD8 , 0xAC , 0xD4 , 0xAC , 0xD4 , 0xCC , 0xE9 , 0xCC , 0xE9 , +0x03 , 0x08 , 0x03 , 0x08 , 0x70 , 0x1B , 0x70 , 0x1B , 0x58 , 0x1B , 0x58 , 0x1B , 0xAE , 0x10 , 0xAE , 0x10 , +0x5B , 0x05 , 0x5B , 0x05 , 0xE3 , 0xFC , 0xE3 , 0xFC , 0x33 , 0xF4 , 0x33 , 0xF4 , 0xBB , 0xEA , 0xBB , 0xEA , +0xC4 , 0xE7 , 0xC4 , 0xE7 , 0x0C , 0xF1 , 0x0C , 0xF1 , 0x2C , 0x03 , 0x2C , 0x03 , 0xAC , 0x11 , 0xAC , 0x11 , +0x7A , 0x14 , 0x7A , 0x14 , 0x25 , 0x0C , 0x25 , 0x0C , 0x7C , 0x00 , 0x7C , 0x00 , 0x27 , 0xF9 , 0x27 , 0xF9 , +0xAC , 0xF6 , 0xAC , 0xF6 , 0x20 , 0xF5 , 0x20 , 0xF5 , 0xD6 , 0xF4 , 0xD6 , 0xF4 , 0xD9 , 0xF8 , 0xD9 , 0xF8 , +0x7A , 0x01 , 0x7A , 0x01 , 0xAC , 0x09 , 0xAC , 0x09 , 0xFF , 0x0A , 0xFF , 0x0A , 0x48 , 0x05 , 0x48 , 0x05 , +0x1A , 0xFE , 0x1A , 0xFE , 0x61 , 0xFA , 0x61 , 0xFA , 0x99 , 0xFA , 0x99 , 0xFA , 0xCD , 0xFC , 0xCD , 0xFC , +0x3D , 0xFF , 0x3D , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0x6A , 0xFE , 0x6A , 0xFE , 0x45 , 0xFE , 0x45 , 0xFE , +0x70 , 0x08 , 0x70 , 0x08 , 0x79 , 0x1C , 0x79 , 0x1C , 0x6D , 0x27 , 0x6D , 0x27 , 0x0C , 0x19 , 0x0C , 0x19 , +0xD9 , 0xF5 , 0xD9 , 0xF5 , 0xAC , 0xD6 , 0xAC , 0xD6 , 0x8C , 0xD2 , 0x8C , 0xD2 , 0x3C , 0xE9 , 0x3C , 0xE9 , +0xE6 , 0x07 , 0xE6 , 0x07 , 0x79 , 0x19 , 0x79 , 0x19 , 0xF4 , 0x16 , 0xF4 , 0x16 , 0x9B , 0x0D , 0x9B , 0x0D , +0x1D , 0x07 , 0x1D , 0x07 , 0xE9 , 0x02 , 0xE9 , 0x02 , 0xB0 , 0xFA , 0xB0 , 0xFA , 0x33 , 0xED , 0x33 , 0xED , +0xC0 , 0xE4 , 0xC0 , 0xE4 , 0x96 , 0xEA , 0x96 , 0xEA , 0xA1 , 0xFC , 0xA1 , 0xFC , 0x61 , 0x0D , 0x61 , 0x0D , +0xE6 , 0x13 , 0xE6 , 0x13 , 0x41 , 0x0F , 0x41 , 0x0F , 0xC3 , 0x05 , 0xC3 , 0x05 , 0x4D , 0xFE , 0x4D , 0xFE , +0xA7 , 0xF9 , 0xA7 , 0xF9 , 0x1A , 0xF5 , 0x1A , 0xF5 , 0x7A , 0xF2 , 0x7A , 0xF2 , 0xA4 , 0xF5 , 0xA4 , 0xF5 , +0x49 , 0xFE , 0x49 , 0xFE , 0x29 , 0x08 , 0x29 , 0x08 , 0xBB , 0x0B , 0xBB , 0x0B , 0xC0 , 0x07 , 0xC0 , 0x07 , +0xB1 , 0x00 , 0xB1 , 0x00 , 0xEB , 0xFB , 0xEB , 0xFB , 0xC4 , 0xFA , 0xC4 , 0xFA , 0x15 , 0xFC , 0x15 , 0xFC , +0x53 , 0xFE , 0x53 , 0xFE , 0xD9 , 0xFE , 0xD9 , 0xFE , 0x1B , 0xFD , 0x1B , 0xFD , 0xDF , 0xFA , 0xDF , 0xFA , +0x90 , 0xFF , 0x90 , 0xFF , 0x35 , 0x13 , 0x35 , 0x13 , 0xE6 , 0x28 , 0xE6 , 0x28 , 0x25 , 0x28 , 0x25 , 0x28 , +0xBC , 0x09 , 0xBC , 0x09 , 0x62 , 0xE1 , 0x62 , 0xE1 , 0x33 , 0xCE , 0x33 , 0xCE , 0x39 , 0xDB , 0x39 , 0xDB , +0x70 , 0xF8 , 0x70 , 0xF8 , 0xF7 , 0x0F , 0xF7 , 0x0F , 0xB9 , 0x14 , 0xB9 , 0x14 , 0xC0 , 0x0E , 0xC0 , 0x0E , +0x23 , 0x0C , 0x23 , 0x0C , 0xDE , 0x0A , 0xDE , 0x0A , 0x07 , 0x05 , 0x07 , 0x05 , 0x75 , 0xF6 , 0x75 , 0xF6 , +0x4D , 0xE7 , 0x4D , 0xE7 , 0xC6 , 0xE3 , 0xC6 , 0xE3 , 0x9E , 0xEF , 0x9E , 0xEF , 0x99 , 0x01 , 0x99 , 0x01 , +0xB0 , 0x0D , 0xB0 , 0x0D , 0xDC , 0x10 , 0xDC , 0x10 , 0xF1 , 0x0C , 0xF1 , 0x0C , 0x1E , 0x07 , 0x1E , 0x07 , +0x3D , 0x01 , 0x3D , 0x01 , 0x03 , 0xFA , 0x03 , 0xFA , 0x48 , 0xF2 , 0x48 , 0xF2 , 0x35 , 0xF0 , 0x35 , 0xF0 , +0x7A , 0xF5 , 0x7A , 0xF5 , 0x3A , 0xFF , 0x3A , 0xFF , 0xCB , 0x07 , 0xCB , 0x07 , 0xCE , 0x09 , 0xCE , 0x09 , +0x55 , 0x07 , 0x55 , 0x07 , 0x94 , 0x02 , 0x94 , 0x02 , 0x77 , 0xFE , 0x77 , 0xFE , 0xBA , 0xFB , 0xBA , 0xFB , +0xC9 , 0xFB , 0xC9 , 0xFB , 0x4C , 0xFD , 0x4C , 0xFD , 0xDA , 0xFD , 0xDA , 0xFD , 0x0C , 0xFE , 0x0C , 0xFE , +0xE4 , 0xFC , 0xE4 , 0xFC , 0xF2 , 0xFD , 0xF2 , 0xFD , 0xEA , 0x09 , 0xEA , 0x09 , 0x3F , 0x1F , 0x3F , 0x1F , +0x38 , 0x29 , 0x38 , 0x29 , 0x64 , 0x18 , 0x64 , 0x18 , 0xA3 , 0xF4 , 0xA3 , 0xF4 , 0xF1 , 0xD8 , 0xF1 , 0xD8 , +0x0E , 0xD8 , 0x0E , 0xD8 , 0xD0 , 0xEA , 0xD0 , 0xEA , 0x5D , 0xFF , 0x5D , 0xFF , 0x6B , 0x0A , 0x6B , 0x0A , +0xD2 , 0x0B , 0xD2 , 0x0B , 0xE3 , 0x0E , 0xE3 , 0x0E , 0x06 , 0x13 , 0x06 , 0x13 , 0x0E , 0x0F , 0x0E , 0x0F , +0x06 , 0x01 , 0x06 , 0x01 , 0x10 , 0xEE , 0x10 , 0xEE , 0xF7 , 0xE3 , 0xF7 , 0xE3 , 0xB6 , 0xE8 , 0xB6 , 0xE8 , +0xD1 , 0xF7 , 0xD1 , 0xF7 , 0xA6 , 0x04 , 0xA6 , 0x04 , 0x78 , 0x0A , 0x78 , 0x0A , 0xA9 , 0x0C , 0xA9 , 0x0C , +0xB7 , 0x0C , 0xB7 , 0x0C , 0x75 , 0x0A , 0x75 , 0x0A , 0x68 , 0x03 , 0x68 , 0x03 , 0xB1 , 0xF7 , 0xB1 , 0xF7 , +0xDD , 0xEE , 0xDD , 0xEE , 0x7F , 0xEF , 0x7F , 0xEF , 0x7F , 0xF7 , 0x7F , 0xF7 , 0xF0 , 0x01 , 0xF0 , 0x01 , +0xF1 , 0x07 , 0xF1 , 0x07 , 0xB9 , 0x08 , 0xB9 , 0x08 , 0xF6 , 0x06 , 0xF6 , 0x06 , 0x4F , 0x03 , 0x4F , 0x03 , +0x8F , 0xFF , 0x8F , 0xFF , 0xFA , 0xFB , 0xFA , 0xFB , 0x25 , 0xFB , 0x25 , 0xFB , 0x25 , 0xFD , 0x25 , 0xFD , +0x84 , 0xFE , 0x84 , 0xFE , 0xFC , 0xFF , 0xFC , 0xFF , 0x56 , 0x00 , 0x56 , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , +0xC1 , 0x05 , 0xC1 , 0x05 , 0xE4 , 0x14 , 0xE4 , 0x14 , 0xD9 , 0x1F , 0xD9 , 0x1F , 0xCA , 0x17 , 0xCA , 0x17 , +0xEB , 0xFD , 0xEB , 0xFD , 0x28 , 0xE6 , 0x28 , 0xE6 , 0x7F , 0xE1 , 0x7F , 0xE1 , 0x00 , 0xEC , 0x00 , 0xEC , +0x7C , 0xF8 , 0x7C , 0xF8 , 0x19 , 0x00 , 0x19 , 0x00 , 0x3D , 0x04 , 0x3D , 0x04 , 0xDD , 0x0B , 0xDD , 0x0B , +0x7C , 0x15 , 0x7C , 0x15 , 0x0B , 0x15 , 0x0B , 0x15 , 0xD1 , 0x07 , 0xD1 , 0x07 , 0xF9 , 0xF4 , 0xF9 , 0xF4 , +0x65 , 0xE9 , 0x65 , 0xE9 , 0x7F , 0xEA , 0x7F , 0xEA , 0xCF , 0xF3 , 0xCF , 0xF3 , 0xDC , 0xFA , 0xDC , 0xFA , +0x92 , 0xFD , 0x92 , 0xFD , 0x31 , 0x03 , 0x31 , 0x03 , 0x02 , 0x0C , 0x02 , 0x0C , 0x34 , 0x12 , 0x34 , 0x12 , +0xB6 , 0x0E , 0xB6 , 0x0E , 0xFE , 0x01 , 0xFE , 0x01 , 0xC5 , 0xF4 , 0xC5 , 0xF4 , 0x25 , 0xF1 , 0x25 , 0xF1 , +0x68 , 0xF5 , 0x68 , 0xF5 , 0x77 , 0xFB , 0x77 , 0xFB , 0x89 , 0xFE , 0x89 , 0xFE , 0xCE , 0xFF , 0xCE , 0xFF , +0xD8 , 0x03 , 0xD8 , 0x03 , 0xE2 , 0x07 , 0xE2 , 0x07 , 0x6D , 0x09 , 0x6D , 0x09 , 0x53 , 0x05 , 0x53 , 0x05 , +0xB1 , 0xFD , 0xB1 , 0xFD , 0x96 , 0xF9 , 0x96 , 0xF9 , 0x68 , 0xFA , 0x68 , 0xFA , 0x3D , 0xFD , 0x3D , 0xFD , +0x31 , 0xFF , 0x31 , 0xFF , 0x95 , 0xFE , 0x95 , 0xFE , 0x51 , 0xFE , 0x51 , 0xFE , 0xAB , 0x05 , 0xAB , 0x05 , +0x91 , 0x17 , 0x91 , 0x17 , 0xCC , 0x21 , 0xCC , 0x21 , 0x34 , 0x16 , 0x34 , 0x16 , 0xCE , 0xFB , 0xCE , 0xFB , +0x74 , 0xE7 , 0x74 , 0xE7 , 0x13 , 0xE7 , 0x13 , 0xE7 , 0x20 , 0xF0 , 0x20 , 0xF0 , 0xF7 , 0xF5 , 0xF7 , 0xF5 , +0x22 , 0xF9 , 0x22 , 0xF9 , 0x2C , 0xFF , 0x2C , 0xFF , 0xB6 , 0x0C , 0xB6 , 0x0C , 0x7A , 0x18 , 0x7A , 0x18 , +0x37 , 0x15 , 0x37 , 0x15 , 0xFA , 0x05 , 0xFA , 0x05 , 0x6C , 0xF5 , 0x6C , 0xF5 , 0xE3 , 0xEF , 0xE3 , 0xEF , +0xCB , 0xF1 , 0xCB , 0xF1 , 0x32 , 0xF4 , 0x32 , 0xF4 , 0x3D , 0xF3 , 0x3D , 0xF3 , 0x1E , 0xF4 , 0x1E , 0xF4 , +0x8A , 0xFF , 0x8A , 0xFF , 0xFE , 0x0D , 0xFE , 0x0D , 0x62 , 0x13 , 0x62 , 0x13 , 0x34 , 0x0D , 0x34 , 0x0D , +0x2E , 0x01 , 0x2E , 0x01 , 0x5D , 0xFA , 0x5D , 0xFA , 0x91 , 0xFB , 0x91 , 0xFB , 0xFD , 0xFB , 0xFD , 0xFB , +0xE5 , 0xF8 , 0xE5 , 0xF8 , 0xED , 0xF4 , 0xED , 0xF4 , 0x9F , 0xF7 , 0x9F , 0xF7 , 0xFA , 0x01 , 0xFA , 0x01 , +0x83 , 0x08 , 0x83 , 0x08 , 0x1D , 0x08 , 0x1D , 0x08 , 0x00 , 0x04 , 0x00 , 0x04 , 0x79 , 0x01 , 0x79 , 0x01 , +0xA6 , 0x02 , 0xA6 , 0x02 , 0xBF , 0x00 , 0xBF , 0x00 , 0xAC , 0xFB , 0xAC , 0xFB , 0xE4 , 0xF7 , 0xE4 , 0xF7 , +0xFD , 0xF8 , 0xFD , 0xF8 , 0x2F , 0xFE , 0x2F , 0xFE , 0xD6 , 0x01 , 0xD6 , 0x01 , 0x10 , 0x0A , 0x10 , 0x0A , +0x68 , 0x17 , 0x68 , 0x17 , 0x13 , 0x1A , 0x13 , 0x1A , 0x3E , 0x0E , 0x3E , 0x0E , 0x65 , 0xFA , 0x65 , 0xFA , +0x3C , 0xEE , 0x3C , 0xEE , 0x02 , 0xEF , 0x02 , 0xEF , 0xBE , 0xF1 , 0xBE , 0xF1 , 0xBD , 0xF3 , 0xBD , 0xF3 , +0xCC , 0xF7 , 0xCC , 0xF7 , 0xA5 , 0xFF , 0xA5 , 0xFF , 0x30 , 0x0B , 0x30 , 0x0B , 0xCE , 0x0F , 0xCE , 0x0F , +0x6B , 0x0B , 0x6B , 0x0B , 0xDC , 0x02 , 0xDC , 0x02 , 0xED , 0xFB , 0xED , 0xFB , 0x21 , 0xFA , 0x21 , 0xFA , +0x13 , 0xF7 , 0x13 , 0xF7 , 0xAF , 0xF3 , 0xAF , 0xF3 , 0xFD , 0xF1 , 0xFD , 0xF1 , 0x6C , 0xF6 , 0x6C , 0xF6 , +0x5C , 0x01 , 0x5C , 0x01 , 0xEE , 0x08 , 0xEE , 0x08 , 0xC7 , 0x09 , 0xC7 , 0x09 , 0x12 , 0x08 , 0x12 , 0x08 , +0xC3 , 0x05 , 0xC3 , 0x05 , 0xC0 , 0x05 , 0xC0 , 0x05 , 0x93 , 0x02 , 0x93 , 0x02 , 0x8F , 0xFA , 0x8F , 0xFA , +0xD4 , 0xF4 , 0xD4 , 0xF4 , 0x7E , 0xF4 , 0x7E , 0xF4 , 0x18 , 0xFB , 0x18 , 0xFB , 0x94 , 0x00 , 0x94 , 0x00 , +0x61 , 0x01 , 0x61 , 0x01 , 0x81 , 0x03 , 0x81 , 0x03 , 0x7B , 0x06 , 0x7B , 0x06 , 0x28 , 0x09 , 0x28 , 0x09 , +0x4C , 0x06 , 0x4C , 0x06 , 0x4A , 0xFD , 0x4A , 0xFD , 0x88 , 0xF8 , 0x88 , 0xF8 , 0x20 , 0xFA , 0x20 , 0xFA , +0x27 , 0xFE , 0x27 , 0xFE , 0x05 , 0xFF , 0x05 , 0xFF , 0x17 , 0xFF , 0x17 , 0xFF , 0x63 , 0x0B , 0x63 , 0x0B , +0x4F , 0x18 , 0x4F , 0x18 , 0x2E , 0x15 , 0x2E , 0x15 , 0xD2 , 0x05 , 0xD2 , 0x05 , 0x4E , 0xF7 , 0x4E , 0xF7 , +0x0E , 0xF5 , 0x0E , 0xF5 , 0x38 , 0xF7 , 0x38 , 0xF7 , 0x07 , 0xF3 , 0x07 , 0xF3 , 0x50 , 0xF0 , 0x50 , 0xF0 , +0x98 , 0xF5 , 0x98 , 0xF5 , 0x2B , 0x01 , 0x2B , 0x01 , 0xC9 , 0x0A , 0xC9 , 0x0A , 0xCB , 0x08 , 0xCB , 0x08 , +0xF8 , 0x03 , 0xF8 , 0x03 , 0x01 , 0x02 , 0x01 , 0x02 , 0x65 , 0x03 , 0x65 , 0x03 , 0x66 , 0x01 , 0x66 , 0x01 , +0xC8 , 0xF8 , 0xC8 , 0xF8 , 0x1F , 0xF3 , 0x1F , 0xF3 , 0xA3 , 0xF4 , 0xA3 , 0xF4 , 0xC8 , 0xFA , 0xC8 , 0xFA , +0x09 , 0x00 , 0x09 , 0x00 , 0x8C , 0x00 , 0x8C , 0x00 , 0xAD , 0x02 , 0xAD , 0x02 , 0x7C , 0x08 , 0x7C , 0x08 , +0xBB , 0x0A , 0xBB , 0x0A , 0x29 , 0x08 , 0x29 , 0x08 , 0xAF , 0x01 , 0xAF , 0x01 , 0xB8 , 0xFC , 0xB8 , 0xFC , +0x79 , 0xFA , 0x79 , 0xFA , 0x27 , 0xF9 , 0x27 , 0xF9 , 0x78 , 0xF9 , 0x78 , 0xF9 , 0x26 , 0xFB , 0x26 , 0xFB , +0x72 , 0xFF , 0x72 , 0xFF , 0xBB , 0x03 , 0xBB , 0x03 , 0xEB , 0x04 , 0xEB , 0x04 , 0x76 , 0x04 , 0x76 , 0x04 , +0xC9 , 0x01 , 0xC9 , 0x01 , 0xF4 , 0xFE , 0xF4 , 0xFE , 0x00 , 0xFF , 0x00 , 0xFF , 0x47 , 0xFF , 0x47 , 0xFF , +0x15 , 0xFF , 0x15 , 0xFF , 0x1A , 0xFE , 0x1A , 0xFE , 0xB6 , 0x03 , 0xB6 , 0x03 , 0x05 , 0x10 , 0x05 , 0x10 , +0xA7 , 0x11 , 0xA7 , 0x11 , 0xC7 , 0x07 , 0xC7 , 0x07 , 0x2C , 0xFF , 0x2C , 0xFF , 0x33 , 0xFD , 0x33 , 0xFD , +0x3C , 0xFD , 0x3C , 0xFD , 0x7C , 0xF7 , 0x7C , 0xF7 , 0x6B , 0xF0 , 0x6B , 0xF0 , 0x47 , 0xF4 , 0x47 , 0xF4 , +0xDA , 0xFC , 0xDA , 0xFC , 0x58 , 0x02 , 0x58 , 0x02 , 0xC0 , 0x01 , 0xC0 , 0x01 , 0xFE , 0xFF , 0xFE , 0xFF , +0xA9 , 0x03 , 0xA9 , 0x03 , 0x2F , 0x07 , 0x2F , 0x07 , 0x45 , 0x05 , 0x45 , 0x05 , 0xC1 , 0xFE , 0xC1 , 0xFE , +0x70 , 0xFB , 0x70 , 0xFB , 0x84 , 0xFC , 0x84 , 0xFC , 0xE9 , 0xFB , 0xE9 , 0xFB , 0xCD , 0xF8 , 0xCD , 0xF8 , +0x1C , 0xF9 , 0x1C , 0xF9 , 0xDD , 0xFD , 0xDD , 0xFD , 0xD9 , 0x03 , 0xD9 , 0x03 , 0xFE , 0x04 , 0xFE , 0x04 , +0x67 , 0x04 , 0x67 , 0x04 , 0x84 , 0x05 , 0x84 , 0x05 , 0xC1 , 0x04 , 0xC1 , 0x04 , 0x55 , 0x00 , 0x55 , 0x00 , +0x10 , 0xFB , 0x10 , 0xFB , 0x6A , 0xFA , 0x6A , 0xFA , 0xE1 , 0xFB , 0xE1 , 0xFB , 0xF2 , 0xFC , 0xF2 , 0xFC , +0x63 , 0xFD , 0x63 , 0xFD , 0x3D , 0xFF , 0x3D , 0xFF , 0xFE , 0x02 , 0xFE , 0x02 , 0x97 , 0x03 , 0x97 , 0x03 , +0x5E , 0x00 , 0x5E , 0x00 , 0xC8 , 0xFF , 0xC8 , 0xFF , 0xF5 , 0x01 , 0xF5 , 0x01 , 0x9A , 0x02 , 0x9A , 0x02 , +0xD4 , 0xFF , 0xD4 , 0xFF , 0x95 , 0xFF , 0x95 , 0xFF , 0xBC , 0x09 , 0xBC , 0x09 , 0x90 , 0x0F , 0x90 , 0x0F , +0x78 , 0x07 , 0x78 , 0x07 , 0xD8 , 0x00 , 0xD8 , 0x00 , 0xFF , 0x01 , 0xFF , 0x01 , 0x83 , 0x00 , 0x83 , 0x00 , +0xB9 , 0xF9 , 0xB9 , 0xF9 , 0x93 , 0xF2 , 0x93 , 0xF2 , 0x6D , 0xF5 , 0x6D , 0xF5 , 0xEF , 0xFB , 0xEF , 0xFB , +0x1C , 0xFB , 0x1C , 0xFB , 0x83 , 0xFA , 0x83 , 0xFA , 0x4B , 0xFE , 0x4B , 0xFE , 0x6E , 0x04 , 0x6E , 0x04 , +0x64 , 0x05 , 0x64 , 0x05 , 0x2C , 0x02 , 0x2C , 0x02 , 0x03 , 0x02 , 0x03 , 0x02 , 0x6D , 0x04 , 0x6D , 0x04 , +0xAE , 0x01 , 0xAE , 0x01 , 0x72 , 0xFB , 0x72 , 0xFB , 0x56 , 0xFA , 0x56 , 0xFA , 0x0F , 0xFD , 0x0F , 0xFD , +0x98 , 0xFB , 0x98 , 0xFB , 0xE1 , 0xFA , 0xE1 , 0xFA , 0x82 , 0xFF , 0x82 , 0xFF , 0xB3 , 0x03 , 0xB3 , 0x03 , +0x21 , 0x04 , 0x21 , 0x04 , 0x4F , 0x01 , 0x4F , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x30 , 0x01 , 0x30 , 0x01 , +0x77 , 0xFF , 0x77 , 0xFF , 0x45 , 0xFC , 0x45 , 0xFC , 0xC8 , 0xFC , 0xC8 , 0xFC , 0x9A , 0xFF , 0x9A , 0xFF , +0x53 , 0xFF , 0x53 , 0xFF , 0x66 , 0xFF , 0x66 , 0xFF , 0x90 , 0x00 , 0x90 , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , +0xC7 , 0xFF , 0xC7 , 0xFF , 0xD5 , 0x00 , 0xD5 , 0x00 , 0x8F , 0x01 , 0x8F , 0x01 , 0x5A , 0x01 , 0x5A , 0x01 , +0xF5 , 0x00 , 0xF5 , 0x00 , 0x98 , 0x08 , 0x98 , 0x08 , 0x3E , 0x0F , 0x3E , 0x0F , 0xDD , 0x07 , 0xDD , 0x07 , +0x33 , 0x02 , 0x33 , 0x02 , 0x6B , 0x06 , 0x6B , 0x06 , 0xAD , 0x01 , 0xAD , 0x01 , 0x20 , 0xF8 , 0x20 , 0xF8 , +0xC7 , 0xF5 , 0xC7 , 0xF5 , 0x49 , 0xF9 , 0x49 , 0xF9 , 0xEE , 0xF9 , 0xEE , 0xF9 , 0xD3 , 0xF5 , 0xD3 , 0xF5 , +0x30 , 0xFA , 0x30 , 0xFA , 0xCD , 0x00 , 0xCD , 0x00 , 0xC2 , 0xFF , 0xC2 , 0xFF , 0x8B , 0xFE , 0x8B , 0xFE , +0x1C , 0x03 , 0x1C , 0x03 , 0x86 , 0x06 , 0x86 , 0x06 , 0xFF , 0x03 , 0xFF , 0x03 , 0x8D , 0x00 , 0x8D , 0x00 , +0x1D , 0x01 , 0x1D , 0x01 , 0x89 , 0x01 , 0x89 , 0x01 , 0x25 , 0xFF , 0x25 , 0xFF , 0x30 , 0xFD , 0x30 , 0xFD , +0xAC , 0xFE , 0xAC , 0xFE , 0x3B , 0xFF , 0x3B , 0xFF , 0xF4 , 0xFE , 0xF4 , 0xFE , 0x83 , 0xFE , 0x83 , 0xFE , +0xCE , 0xFE , 0xCE , 0xFE , 0xA8 , 0xFE , 0xA8 , 0xFE , 0x2E , 0xFE , 0x2E , 0xFE , 0xD3 , 0xFE , 0xD3 , 0xFE , +0xF5 , 0xFE , 0xF5 , 0xFE , 0x60 , 0x00 , 0x60 , 0x00 , 0xA7 , 0x00 , 0xA7 , 0x00 , 0x6B , 0x01 , 0x6B , 0x01 , +0x12 , 0x02 , 0x12 , 0x02 , 0x68 , 0x00 , 0x68 , 0x00 , 0xFD , 0xFE , 0xFD , 0xFE , 0xAA , 0x00 , 0xAA , 0x00 , +0xA6 , 0x00 , 0xA6 , 0x00 , 0x8A , 0xFF , 0x8A , 0xFF , 0x2F , 0xFF , 0x2F , 0xFF , 0x7A , 0x04 , 0x7A , 0x04 , +0x2C , 0x0D , 0x2C , 0x0D , 0xC9 , 0x09 , 0xC9 , 0x09 , 0x2D , 0x03 , 0x2D , 0x03 , 0x6F , 0x08 , 0x6F , 0x08 , +0xD0 , 0x06 , 0xD0 , 0x06 , 0x15 , 0xFB , 0x15 , 0xFB , 0xE1 , 0xF9 , 0xE1 , 0xF9 , 0xEC , 0xFC , 0xEC , 0xFC , +0x15 , 0xFA , 0x15 , 0xFA , 0xD1 , 0xF5 , 0xD1 , 0xF5 , 0xA4 , 0xF9 , 0xA4 , 0xF9 , 0x6D , 0xFC , 0x6D , 0xFC , +0x04 , 0xF8 , 0x04 , 0xF8 , 0xA1 , 0xF9 , 0xA1 , 0xF9 , 0xB6 , 0xFF , 0xB6 , 0xFF , 0x77 , 0xFF , 0x77 , 0xFF , +0x82 , 0xFF , 0x82 , 0xFF , 0x51 , 0x03 , 0x51 , 0x03 , 0xE8 , 0x03 , 0xE8 , 0x03 , 0xBF , 0x01 , 0xBF , 0x01 , +0x43 , 0x03 , 0x43 , 0x03 , 0x91 , 0x03 , 0x91 , 0x03 , 0x27 , 0x00 , 0x27 , 0x00 , 0xC9 , 0xFF , 0xC9 , 0xFF , +0x24 , 0x01 , 0x24 , 0x01 , 0xB9 , 0xFF , 0xB9 , 0xFF , 0xEB , 0xFC , 0xEB , 0xFC , 0x58 , 0xFD , 0x58 , 0xFD , +0xD1 , 0xFD , 0xD1 , 0xFD , 0x2F , 0xFD , 0x2F , 0xFD , 0x77 , 0xFC , 0x77 , 0xFC , 0xD0 , 0xFD , 0xD0 , 0xFD , +0x01 , 0xFF , 0x01 , 0xFF , 0x78 , 0xFF , 0x78 , 0xFF , 0xAB , 0x00 , 0xAB , 0x00 , 0x54 , 0x01 , 0x54 , 0x01 , +0xAC , 0x00 , 0xAC , 0x00 , 0x22 , 0x01 , 0x22 , 0x01 , 0xEB , 0x01 , 0xEB , 0x01 , 0x77 , 0x01 , 0x77 , 0x01 , +0xB7 , 0x00 , 0xB7 , 0x00 , 0x8F , 0x01 , 0x8F , 0x01 , 0xAD , 0x07 , 0xAD , 0x07 , 0xC4 , 0x08 , 0xC4 , 0x08 , +0xF9 , 0x02 , 0xF9 , 0x02 , 0x71 , 0x04 , 0x71 , 0x04 , 0xAD , 0x06 , 0xAD , 0x06 , 0x0C , 0xFF , 0x0C , 0xFF , +0x31 , 0xFC , 0x31 , 0xFC , 0x9F , 0xFE , 0x9F , 0xFE , 0xB3 , 0xFC , 0xB3 , 0xFC , 0xB7 , 0xFA , 0xB7 , 0xFA , +0xDD , 0xFC , 0xDD , 0xFC , 0x1E , 0xFD , 0x1E , 0xFD , 0x9E , 0xF9 , 0x9E , 0xF9 , 0x37 , 0xFA , 0x37 , 0xFA , +0x4B , 0xFD , 0x4B , 0xFD , 0x3C , 0xFC , 0x3C , 0xFC , 0xB4 , 0xFC , 0xB4 , 0xFC , 0xA7 , 0x00 , 0xA7 , 0x00 , +0xD7 , 0x00 , 0xD7 , 0x00 , 0x66 , 0x00 , 0x66 , 0x00 , 0x5A , 0x03 , 0x5A , 0x03 , 0xDF , 0x03 , 0xDF , 0x03 , +0xA1 , 0x00 , 0xA1 , 0x00 , 0xDF , 0x01 , 0xDF , 0x01 , 0x66 , 0x03 , 0x66 , 0x03 , 0x6F , 0x01 , 0x6F , 0x01 , +0x63 , 0x00 , 0x63 , 0x00 , 0x86 , 0x00 , 0x86 , 0x00 , 0xF8 , 0xFE , 0xF8 , 0xFE , 0xB6 , 0xFD , 0xB6 , 0xFD , +0xB5 , 0xFD , 0xB5 , 0xFD , 0x0E , 0xFD , 0x0E , 0xFD , 0x4F , 0xFC , 0x4F , 0xFC , 0x36 , 0xFD , 0x36 , 0xFD , +0xBD , 0xFE , 0xBD , 0xFE , 0x0E , 0xFF , 0x0E , 0xFF , 0xB2 , 0xFF , 0xB2 , 0xFF , 0xC7 , 0x00 , 0xC7 , 0x00 , +0x9E , 0x01 , 0x9E , 0x01 , 0xBD , 0x01 , 0xBD , 0x01 , 0x26 , 0x02 , 0x26 , 0x02 , 0x31 , 0x02 , 0x31 , 0x02 , +0x4A , 0x05 , 0x4A , 0x05 , 0xB3 , 0x08 , 0xB3 , 0x08 , 0x6A , 0x05 , 0x6A , 0x05 , 0xD3 , 0x04 , 0xD3 , 0x04 , +0x3F , 0x06 , 0x3F , 0x06 , 0x59 , 0x01 , 0x59 , 0x01 , 0x30 , 0xFE , 0x30 , 0xFE , 0xA0 , 0xFE , 0xA0 , 0xFE , +0x36 , 0xFC , 0x36 , 0xFC , 0xAD , 0xFA , 0xAD , 0xFA , 0x9D , 0xFB , 0x9D , 0xFB , 0x2C , 0xFB , 0x2C , 0xFB , +0x12 , 0xF9 , 0x12 , 0xF9 , 0xA8 , 0xF9 , 0xA8 , 0xF9 , 0x5C , 0xFB , 0x5C , 0xFB , 0x5B , 0xFB , 0x5B , 0xFB , +0x13 , 0xFD , 0x13 , 0xFD , 0x6A , 0xFE , 0x6A , 0xFE , 0x81 , 0xFF , 0x81 , 0xFF , 0x72 , 0x01 , 0x72 , 0x01 , +0x13 , 0x03 , 0x13 , 0x03 , 0xD4 , 0x02 , 0xD4 , 0x02 , 0xF9 , 0x02 , 0xF9 , 0x02 , 0xF2 , 0x03 , 0xF2 , 0x03 , +0x6F , 0x03 , 0x6F , 0x03 , 0x23 , 0x03 , 0x23 , 0x03 , 0xC2 , 0x02 , 0xC2 , 0x02 , 0x15 , 0x01 , 0x15 , 0x01 , +0xB8 , 0xFF , 0xB8 , 0xFF , 0x10 , 0xFF , 0x10 , 0xFF , 0xA5 , 0xFE , 0xA5 , 0xFE , 0xDA , 0xFD , 0xDA , 0xFD , +0x25 , 0xFD , 0x25 , 0xFD , 0xD9 , 0xFD , 0xD9 , 0xFD , 0x06 , 0xFE , 0x06 , 0xFE , 0x5C , 0xFE , 0x5C , 0xFE , +0x43 , 0xFF , 0x43 , 0xFF , 0xCC , 0xFF , 0xCC , 0xFF , 0x53 , 0x00 , 0x53 , 0x00 , 0x0A , 0x01 , 0x0A , 0x01 , +0x6E , 0x01 , 0x6E , 0x01 , 0x26 , 0x03 , 0x26 , 0x03 , 0xE6 , 0x06 , 0xE6 , 0x06 , 0xFE , 0x06 , 0xFE , 0x06 , +0x04 , 0x07 , 0x04 , 0x07 , 0x57 , 0x08 , 0x57 , 0x08 , 0xB2 , 0x05 , 0xB2 , 0x05 , 0x54 , 0x03 , 0x54 , 0x03 , +0x3C , 0x02 , 0x3C , 0x02 , 0x2C , 0xFF , 0x2C , 0xFF , 0x3B , 0xFD , 0x3B , 0xFD , 0x7C , 0xFC , 0x7C , 0xFC , +0xAF , 0xFB , 0xAF , 0xFB , 0x79 , 0xFA , 0x79 , 0xFA , 0xCC , 0xF9 , 0xCC , 0xF9 , 0x6C , 0xFA , 0x6C , 0xFA , +0x63 , 0xFA , 0x63 , 0xFA , 0x55 , 0xFB , 0x55 , 0xFB , 0x0B , 0xFC , 0x0B , 0xFC , 0x8E , 0xFC , 0x8E , 0xFC , +0xF6 , 0xFD , 0xF6 , 0xFD , 0x31 , 0x00 , 0x31 , 0x00 , 0x7A , 0x01 , 0x7A , 0x01 , 0x56 , 0x02 , 0x56 , 0x02 , +0xDB , 0x03 , 0xDB , 0x03 , 0x48 , 0x04 , 0x48 , 0x04 , 0x9E , 0x03 , 0x9E , 0x03 , 0x60 , 0x03 , 0x60 , 0x03 , +0x87 , 0x02 , 0x87 , 0x02 , 0x0C , 0x01 , 0x0C , 0x01 , 0x3D , 0x00 , 0x3D , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , +0x2A , 0xFF , 0x2A , 0xFF , 0x45 , 0xFE , 0x45 , 0xFE , 0x7F , 0xFE , 0x7F , 0xFE , 0x40 , 0xFE , 0x40 , 0xFE , +0x3B , 0xFE , 0x3B , 0xFE , 0xBF , 0xFE , 0xBF , 0xFE , 0x03 , 0xFF , 0x03 , 0xFF , 0x53 , 0xFF , 0x53 , 0xFF , +0xE9 , 0xFF , 0xE9 , 0xFF , 0xE3 , 0x00 , 0xE3 , 0x00 , 0xCF , 0x02 , 0xCF , 0x02 , 0x7A , 0x04 , 0x7A , 0x04 , +0xE0 , 0x04 , 0xE0 , 0x04 , 0xCF , 0x05 , 0xCF , 0x05 , 0xBC , 0x05 , 0xBC , 0x05 , 0x43 , 0x04 , 0x43 , 0x04 , +0x4D , 0x03 , 0x4D , 0x03 , 0xE2 , 0x01 , 0xE2 , 0x01 , 0x41 , 0x00 , 0x41 , 0x00 , 0x44 , 0xFF , 0x44 , 0xFF , +0xA1 , 0xFE , 0xA1 , 0xFE , 0x8C , 0xFD , 0x8C , 0xFD , 0x4C , 0xFD , 0x4C , 0xFD , 0x5F , 0xFD , 0x5F , 0xFD , +0x3E , 0xFD , 0x3E , 0xFD , 0x73 , 0xFD , 0x73 , 0xFD , 0xBE , 0xFD , 0xBE , 0xFD , 0x0F , 0xFE , 0x0F , 0xFE , +0x96 , 0xFE , 0x96 , 0xFE , 0x1E , 0xFF , 0x1E , 0xFF , 0x7B , 0xFF , 0x7B , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , +0x69 , 0x00 , 0x69 , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x7E , 0x00 , 0x7E , 0x00 , +0x4D , 0x00 , 0x4D , 0x00 , 0x2C , 0x00 , 0x2C , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , +0xFF , 0xFF , 0xFF , 0xFF , 0x03 , 0x00 , 0x03 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , +0xC1 , 0xFF , 0xC1 , 0xFF , 0xA3 , 0xFF , 0xA3 , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , +0x58 , 0xFF , 0x58 , 0xFF , 0x70 , 0xFF , 0x70 , 0xFF , 0x71 , 0xFF , 0x71 , 0xFF , 0x90 , 0xFF , 0x90 , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , +0x9D , 0x00 , 0x9D , 0x00 , 0xC7 , 0x00 , 0xC7 , 0x00 , 0xEE , 0x00 , 0xEE , 0x00 , 0x07 , 0x01 , 0x07 , 0x01 , +0x20 , 0x01 , 0x20 , 0x01 , 0x2B , 0x01 , 0x2B , 0x01 , 0x2F , 0x01 , 0x2F , 0x01 , 0x27 , 0x01 , 0x27 , 0x01 , +0x16 , 0x01 , 0x16 , 0x01 , 0x12 , 0x01 , 0x12 , 0x01 , 0x25 , 0x01 , 0x25 , 0x01 , 0x3A , 0x01 , 0x3A , 0x01 , +0x36 , 0x01 , 0x36 , 0x01 , 0x50 , 0x01 , 0x50 , 0x01 , 0x27 , 0x01 , 0x27 , 0x01 , 0xEE , 0x00 , 0xEE , 0x00 , +0xEB , 0x00 , 0xEB , 0x00 , 0xB9 , 0x00 , 0xB9 , 0x00 , 0x67 , 0x00 , 0x67 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x9F , 0xFF , 0x9F , 0xFF , 0x5E , 0xFF , 0x5E , 0xFF , 0x24 , 0xFF , 0x24 , 0xFF , 0x38 , 0xFF , 0x38 , 0xFF , +0xD8 , 0xFE , 0xD8 , 0xFE , 0x44 , 0xFE , 0x44 , 0xFE , 0x60 , 0xFD , 0x60 , 0xFD , 0x90 , 0xFC , 0x90 , 0xFC , +0x12 , 0xFC , 0x12 , 0xFC , 0xD5 , 0xFB , 0xD5 , 0xFB , 0xA5 , 0xFB , 0xA5 , 0xFB , 0xEF , 0xFB , 0xEF , 0xFB , +0xA9 , 0xFC , 0xA9 , 0xFC , 0x0A , 0xFD , 0x0A , 0xFD , 0xA7 , 0xFD , 0xA7 , 0xFD , 0x60 , 0xFE , 0x60 , 0xFE , +0xF8 , 0xFE , 0xF8 , 0xFE , 0x80 , 0xFF , 0x80 , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , 0x7E , 0x00 , 0x7E , 0x00 , +0xE7 , 0x00 , 0xE7 , 0x00 , 0x32 , 0x01 , 0x32 , 0x01 , 0x8A , 0x01 , 0x8A , 0x01 , 0x00 , 0x02 , 0x00 , 0x02 , +0x18 , 0x02 , 0x18 , 0x02 , 0x55 , 0x02 , 0x55 , 0x02 , 0x3C , 0x02 , 0x3C , 0x02 , 0x18 , 0x02 , 0x18 , 0x02 , +0xE0 , 0x01 , 0xE0 , 0x01 , 0xAB , 0x01 , 0xAB , 0x01 , 0x6D , 0x01 , 0x6D , 0x01 , 0xA7 , 0x01 , 0xA7 , 0x01 , +0xD1 , 0x01 , 0xD1 , 0x01 , 0xF8 , 0x01 , 0xF8 , 0x01 , 0x28 , 0x02 , 0x28 , 0x02 , 0xF2 , 0x01 , 0xF2 , 0x01 , +0xDE , 0x01 , 0xDE , 0x01 , 0xBF , 0x01 , 0xBF , 0x01 , 0x77 , 0x01 , 0x77 , 0x01 , 0x20 , 0x01 , 0x20 , 0x01 , +0xE1 , 0x00 , 0xE1 , 0x00 , 0x6B , 0x00 , 0x6B , 0x00 , 0x17 , 0x00 , 0x17 , 0x00 , 0x8E , 0xFF , 0x8E , 0xFF , +0x60 , 0xFF , 0x60 , 0xFF , 0xD0 , 0xFE , 0xD0 , 0xFE , 0x54 , 0xFE , 0x54 , 0xFE , 0x78 , 0xFD , 0x78 , 0xFD , +0xC7 , 0xFC , 0xC7 , 0xFC , 0x45 , 0xFC , 0x45 , 0xFC , 0xF5 , 0xFB , 0xF5 , 0xFB , 0xD6 , 0xFB , 0xD6 , 0xFB , +0x21 , 0xFC , 0x21 , 0xFC , 0xB0 , 0xFC , 0xB0 , 0xFC , 0x2E , 0xFD , 0x2E , 0xFD , 0xD3 , 0xFD , 0xD3 , 0xFD , +0x62 , 0xFE , 0x62 , 0xFE , 0xF0 , 0xFE , 0xF0 , 0xFE , 0x6F , 0xFF , 0x6F , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , +0x4B , 0x00 , 0x4B , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , 0xE3 , 0x00 , 0xE3 , 0x00 , 0x31 , 0x01 , 0x31 , 0x01 , +0x9F , 0x01 , 0x9F , 0x01 , 0xD1 , 0x01 , 0xD1 , 0x01 , 0x10 , 0x02 , 0x10 , 0x02 , 0xF8 , 0x01 , 0xF8 , 0x01 , +0xF0 , 0x01 , 0xF0 , 0x01 , 0xE8 , 0x01 , 0xE8 , 0x01 , 0xBA , 0x01 , 0xBA , 0x01 , 0x8F , 0x01 , 0x8F , 0x01 , +0x74 , 0x01 , 0x74 , 0x01 , 0x98 , 0x01 , 0x98 , 0x01 , 0x8A , 0x01 , 0x8A , 0x01 , 0xC2 , 0x01 , 0xC2 , 0x01 , +0x95 , 0x01 , 0x95 , 0x01 , 0x97 , 0x01 , 0x97 , 0x01 , 0x75 , 0x01 , 0x75 , 0x01 , 0x51 , 0x01 , 0x51 , 0x01 , +0x09 , 0x01 , 0x09 , 0x01 , 0xEF , 0x00 , 0xEF , 0x00 , 0x9C , 0x00 , 0x9C , 0x00 , 0x6D , 0x00 , 0x6D , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0xA3 , 0xFF , 0xA3 , 0xFF , 0x11 , 0xFF , 0x11 , 0xFF , 0x99 , 0xFE , 0x99 , 0xFE , +0xFA , 0xFD , 0xFA , 0xFD , 0x5E , 0xFD , 0x5E , 0xFD , 0x17 , 0xFD , 0x17 , 0xFD , 0xBF , 0xFC , 0xBF , 0xFC , +0x9D , 0xFC , 0x9D , 0xFC , 0xAC , 0xFC , 0xAC , 0xFC , 0x0A , 0xFD , 0x0A , 0xFD , 0x62 , 0xFD , 0x62 , 0xFD , +0xF7 , 0xFD , 0xF7 , 0xFD , 0x75 , 0xFE , 0x75 , 0xFE , 0x04 , 0xFF , 0x04 , 0xFF , 0x7C , 0xFF , 0x7C , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0x4F , 0x00 , 0x4F , 0x00 , 0xA8 , 0x00 , 0xA8 , 0x00 , 0xD8 , 0x00 , 0xD8 , 0x00 , +0x0C , 0x01 , 0x0C , 0x01 , 0x5B , 0x01 , 0x5B , 0x01 , 0x7F , 0x01 , 0x7F , 0x01 , 0xB2 , 0x01 , 0xB2 , 0x01 , +0xD0 , 0x01 , 0xD0 , 0x01 , 0xAD , 0x01 , 0xAD , 0x01 , 0xC7 , 0x01 , 0xC7 , 0x01 , 0x86 , 0x01 , 0x86 , 0x01 , +0x72 , 0x01 , 0x72 , 0x01 , 0x40 , 0x01 , 0x40 , 0x01 , 0x69 , 0x01 , 0x69 , 0x01 , 0x61 , 0x01 , 0x61 , 0x01 , +0x75 , 0x01 , 0x75 , 0x01 , 0x7B , 0x01 , 0x7B , 0x01 , 0x5E , 0x01 , 0x5E , 0x01 , 0x61 , 0x01 , 0x61 , 0x01 , +0x38 , 0x01 , 0x38 , 0x01 , 0x0F , 0x01 , 0x0F , 0x01 , 0xE6 , 0x00 , 0xE6 , 0x00 , 0xBB , 0x00 , 0xBB , 0x00 , +0x5B , 0x00 , 0x5B , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0x9F , 0xFF , 0x9F , 0xFF , 0x28 , 0xFF , 0x28 , 0xFF , +0x92 , 0xFE , 0x92 , 0xFE , 0x2E , 0xFE , 0x2E , 0xFE , 0x9D , 0xFD , 0x9D , 0xFD , 0x51 , 0xFD , 0x51 , 0xFD , +0x04 , 0xFD , 0x04 , 0xFD , 0xE6 , 0xFC , 0xE6 , 0xFC , 0xEA , 0xFC , 0xEA , 0xFC , 0x3B , 0xFD , 0x3B , 0xFD , +0x85 , 0xFD , 0x85 , 0xFD , 0xED , 0xFD , 0xED , 0xFD , 0x6A , 0xFE , 0x6A , 0xFE , 0xDB , 0xFE , 0xDB , 0xFE , +0x56 , 0xFF , 0x56 , 0xFF , 0xC8 , 0xFF , 0xC8 , 0xFF , 0x28 , 0x00 , 0x28 , 0x00 , 0x7B , 0x00 , 0x7B , 0x00 , +0xD2 , 0x00 , 0xD2 , 0x00 , 0x08 , 0x01 , 0x08 , 0x01 , 0x3C , 0x01 , 0x3C , 0x01 , 0x86 , 0x01 , 0x86 , 0x01 , +0xB1 , 0x01 , 0xB1 , 0x01 , 0xD8 , 0x01 , 0xD8 , 0x01 , 0x00 , 0x02 , 0x00 , 0x02 , 0xDE , 0x01 , 0xDE , 0x01 , +0xEF , 0x01 , 0xEF , 0x01 , 0xB2 , 0x01 , 0xB2 , 0x01 , 0xA8 , 0x01 , 0xA8 , 0x01 , 0x76 , 0x01 , 0x76 , 0x01 , +0xAD , 0x01 , 0xAD , 0x01 , 0x9A , 0x01 , 0x9A , 0x01 , 0xB2 , 0x01 , 0xB2 , 0x01 , 0xBA , 0x01 , 0xBA , 0x01 , +0x8F , 0x01 , 0x8F , 0x01 , 0x7E , 0x01 , 0x7E , 0x01 , 0x4C , 0x01 , 0x4C , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , +0xD0 , 0x00 , 0xD0 , 0x00 , 0x86 , 0x00 , 0x86 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , 0xCA , 0xFF , 0xCA , 0xFF , +0x3D , 0xFF , 0x3D , 0xFF , 0xC2 , 0xFE , 0xC2 , 0xFE , 0x34 , 0xFE , 0x34 , 0xFE , 0xD1 , 0xFD , 0xD1 , 0xFD , +0x59 , 0xFD , 0x59 , 0xFD , 0x11 , 0xFD , 0x11 , 0xFD , 0xD5 , 0xFC , 0xD5 , 0xFC , 0xC7 , 0xFC , 0xC7 , 0xFC , +0xE0 , 0xFC , 0xE0 , 0xFC , 0x3F , 0xFD , 0x3F , 0xFD , 0x92 , 0xFD , 0x92 , 0xFD , 0x05 , 0xFE , 0x05 , 0xFE , +0x8E , 0xFE , 0x8E , 0xFE , 0x03 , 0xFF , 0x03 , 0xFF , 0x85 , 0xFF , 0x85 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , +0x52 , 0x00 , 0x52 , 0x00 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0xFA , 0x00 , 0xFA , 0x00 , 0x24 , 0x01 , 0x24 , 0x01 , +0x63 , 0x01 , 0x63 , 0x01 , 0xAD , 0x01 , 0xAD , 0x01 , 0xA5 , 0x01 , 0xA5 , 0x01 , 0xF4 , 0x01 , 0xF4 , 0x01 , +0xCB , 0x01 , 0xCB , 0x01 , 0xC1 , 0x01 , 0xC1 , 0x01 , 0xA7 , 0x01 , 0xA7 , 0x01 , 0x74 , 0x01 , 0x74 , 0x01 , +0x5E , 0x01 , 0x5E , 0x01 , 0x4D , 0x01 , 0x4D , 0x01 , 0xB4 , 0x01 , 0xB4 , 0x01 , 0x79 , 0x01 , 0x79 , 0x01 , +0xD7 , 0x01 , 0xD7 , 0x01 , 0xBA , 0x01 , 0xBA , 0x01 , 0x90 , 0x01 , 0x90 , 0x01 , 0x84 , 0x01 , 0x84 , 0x01 , +0x35 , 0x01 , 0x35 , 0x01 , 0xD5 , 0x00 , 0xD5 , 0x00 , 0xBD , 0x00 , 0xBD , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , +0xDA , 0xFF , 0xDA , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , 0xD2 , 0xFE , 0xD2 , 0xFE , 0x57 , 0xFE , 0x57 , 0xFE , +0xD7 , 0xFD , 0xD7 , 0xFD , 0x4C , 0xFD , 0x4C , 0xFD , 0xE7 , 0xFC , 0xE7 , 0xFC , 0x92 , 0xFC , 0x92 , 0xFC , +0x58 , 0xFC , 0x58 , 0xFC , 0x61 , 0xFC , 0x61 , 0xFC , 0x8C , 0xFC , 0x8C , 0xFC , 0xFD , 0xFC , 0xFD , 0xFC , +0x7A , 0xFD , 0x7A , 0xFD , 0x12 , 0xFE , 0x12 , 0xFE , 0xC7 , 0xFE , 0xC7 , 0xFE , 0x3B , 0xFF , 0x3B , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0x4E , 0x00 , 0x4E , 0x00 , 0xA4 , 0x00 , 0xA4 , 0x00 , 0x07 , 0x01 , 0x07 , 0x01 , +0x0E , 0x01 , 0x0E , 0x01 , 0x36 , 0x01 , 0x36 , 0x01 , 0x80 , 0x01 , 0x80 , 0x01 , 0x77 , 0x01 , 0x77 , 0x01 , +0x85 , 0x01 , 0x85 , 0x01 , 0xBC , 0x01 , 0xBC , 0x01 , 0x3E , 0x01 , 0x3E , 0x01 , 0x82 , 0x01 , 0x82 , 0x01 , +0xFB , 0x00 , 0xFB , 0x00 , 0x21 , 0x01 , 0x21 , 0x01 , 0xD5 , 0x00 , 0xD5 , 0x00 , 0x53 , 0x01 , 0x53 , 0x01 , +0x8C , 0x01 , 0x8C , 0x01 , 0x92 , 0x01 , 0x92 , 0x01 , 0x2C , 0x02 , 0x2C , 0x02 , 0xDE , 0x01 , 0xDE , 0x01 , +0xFA , 0x01 , 0xFA , 0x01 , 0xEE , 0x01 , 0xEE , 0x01 , 0x75 , 0x01 , 0x75 , 0x01 , 0x52 , 0x01 , 0x52 , 0x01 , +0x0E , 0x01 , 0x0E , 0x01 , 0x51 , 0x00 , 0x51 , 0x00 , 0x27 , 0x00 , 0x27 , 0x00 , 0x60 , 0xFF , 0x60 , 0xFF , +0xC2 , 0xFE , 0xC2 , 0xFE , 0x3C , 0xFE , 0x3C , 0xFE , 0xA9 , 0xFD , 0xA9 , 0xFD , 0x13 , 0xFD , 0x13 , 0xFD , +0xD3 , 0xFC , 0xD3 , 0xFC , 0x6B , 0xFC , 0x6B , 0xFC , 0x63 , 0xFC , 0x63 , 0xFC , 0x88 , 0xFC , 0x88 , 0xFC , +0xCF , 0xFC , 0xCF , 0xFC , 0x5D , 0xFD , 0x5D , 0xFD , 0xCA , 0xFD , 0xCA , 0xFD , 0x8E , 0xFE , 0x8E , 0xFE , +0x44 , 0xFF , 0x44 , 0xFF , 0x91 , 0xFF , 0x91 , 0xFF , 0x74 , 0x00 , 0x74 , 0x00 , 0x88 , 0x00 , 0x88 , 0x00 , +0xFF , 0x00 , 0xFF , 0x00 , 0x34 , 0x01 , 0x34 , 0x01 , 0x16 , 0x01 , 0x16 , 0x01 , 0x4D , 0x01 , 0x4D , 0x01 , +0x87 , 0x01 , 0x87 , 0x01 , 0x32 , 0x01 , 0x32 , 0x01 , 0x99 , 0x01 , 0x99 , 0x01 , 0x4E , 0x01 , 0x4E , 0x01 , +0x2A , 0x01 , 0x2A , 0x01 , 0x5E , 0x01 , 0x5E , 0x01 , 0xC0 , 0x00 , 0xC0 , 0x00 , 0x26 , 0x01 , 0x26 , 0x01 , +0xC4 , 0x00 , 0xC4 , 0x00 , 0xAC , 0x01 , 0xAC , 0x01 , 0x9A , 0x01 , 0x9A , 0x01 , 0xFF , 0x01 , 0xFF , 0x01 , +0x83 , 0x02 , 0x83 , 0x02 , 0x3E , 0x02 , 0x3E , 0x02 , 0x79 , 0x02 , 0x79 , 0x02 , 0x6E , 0x02 , 0x6E , 0x02 , +0xCC , 0x01 , 0xCC , 0x01 , 0xFC , 0x01 , 0xFC , 0x01 , 0x24 , 0x01 , 0x24 , 0x01 , 0x8F , 0x00 , 0x8F , 0x00 , +0x29 , 0x00 , 0x29 , 0x00 , 0xE8 , 0xFE , 0xE8 , 0xFE , 0x47 , 0xFE , 0x47 , 0xFE , 0x86 , 0xFD , 0x86 , 0xFD , +0xB4 , 0xFC , 0xB4 , 0xFC , 0x3D , 0xFC , 0x3D , 0xFC , 0xE6 , 0xFB , 0xE6 , 0xFB , 0x8F , 0xFB , 0x8F , 0xFB , +0xD7 , 0xFB , 0xD7 , 0xFB , 0x0C , 0xFC , 0x0C , 0xFC , 0xB0 , 0xFC , 0xB0 , 0xFC , 0x46 , 0xFD , 0x46 , 0xFD , +0xF2 , 0xFD , 0xF2 , 0xFD , 0x85 , 0xFE , 0x85 , 0xFE , 0x81 , 0xFF , 0x81 , 0xFF , 0xD2 , 0xFF , 0xD2 , 0xFF , +0xA4 , 0x00 , 0xA4 , 0x00 , 0x06 , 0x01 , 0x06 , 0x01 , 0x44 , 0x01 , 0x44 , 0x01 , 0xD4 , 0x01 , 0xD4 , 0x01 , +0x94 , 0x01 , 0x94 , 0x01 , 0xC9 , 0x01 , 0xC9 , 0x01 , 0xD7 , 0x01 , 0xD7 , 0x01 , 0xD6 , 0x01 , 0xD6 , 0x01 , +0x84 , 0x01 , 0x84 , 0x01 , 0xB3 , 0x01 , 0xB3 , 0x01 , 0x1F , 0x01 , 0x1F , 0x01 , 0x60 , 0x01 , 0x60 , 0x01 , +0xCE , 0x00 , 0xCE , 0x00 , 0xE5 , 0x00 , 0xE5 , 0x00 , 0xA2 , 0x00 , 0xA2 , 0x00 , 0xF7 , 0x00 , 0xF7 , 0x00 , +0xB5 , 0x01 , 0xB5 , 0x01 , 0x4E , 0x01 , 0x4E , 0x01 , 0x71 , 0x02 , 0x71 , 0x02 , 0x3F , 0x02 , 0x3F , 0x02 , +0x46 , 0x02 , 0x46 , 0x02 , 0xB4 , 0x02 , 0xB4 , 0x02 , 0x15 , 0x02 , 0x15 , 0x02 , 0xFD , 0x01 , 0xFD , 0x01 , +0xE5 , 0x01 , 0xE5 , 0x01 , 0xA8 , 0x00 , 0xA8 , 0x00 , 0xAF , 0x00 , 0xAF , 0x00 , 0x6D , 0xFF , 0x6D , 0xFF , +0x7B , 0xFE , 0x7B , 0xFE , 0xD8 , 0xFD , 0xD8 , 0xFD , 0xD9 , 0xFC , 0xD9 , 0xFC , 0x3D , 0xFC , 0x3D , 0xFC , +0xE5 , 0xFB , 0xE5 , 0xFB , 0x6C , 0xFB , 0x6C , 0xFB , 0x98 , 0xFB , 0x98 , 0xFB , 0xBC , 0xFB , 0xBC , 0xFB , +0x36 , 0xFC , 0x36 , 0xFC , 0x27 , 0xFD , 0x27 , 0xFD , 0xC2 , 0xFD , 0xC2 , 0xFD , 0xA7 , 0xFE , 0xA7 , 0xFE , +0x61 , 0xFF , 0x61 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0xB7 , 0x00 , 0xB7 , 0x00 , 0x36 , 0x01 , 0x36 , 0x01 , +0x8F , 0x01 , 0x8F , 0x01 , 0xDF , 0x01 , 0xDF , 0x01 , 0x23 , 0x02 , 0x23 , 0x02 , 0xF7 , 0x01 , 0xF7 , 0x01 , +0x0D , 0x02 , 0x0D , 0x02 , 0xB6 , 0x01 , 0xB6 , 0x01 , 0xC9 , 0x01 , 0xC9 , 0x01 , 0x38 , 0x01 , 0x38 , 0x01 , +0x00 , 0x01 , 0x00 , 0x01 , 0xB6 , 0x00 , 0xB6 , 0x00 , 0x65 , 0x00 , 0x65 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , +0x27 , 0x00 , 0x27 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , 0x69 , 0x00 , 0x69 , 0x00 , 0x67 , 0x01 , 0x67 , 0x01 , +0x04 , 0x01 , 0x04 , 0x01 , 0x53 , 0x02 , 0x53 , 0x02 , 0x31 , 0x02 , 0x31 , 0x02 , 0x79 , 0x02 , 0x79 , 0x02 , +0xDD , 0x02 , 0xDD , 0x02 , 0x79 , 0x02 , 0x79 , 0x02 , 0x3C , 0x02 , 0x3C , 0x02 , 0x3E , 0x02 , 0x3E , 0x02 , +0xF5 , 0x00 , 0xF5 , 0x00 , 0xDF , 0x00 , 0xDF , 0x00 , 0xA9 , 0xFF , 0xA9 , 0xFF , 0xA2 , 0xFE , 0xA2 , 0xFE , +0xE7 , 0xFD , 0xE7 , 0xFD , 0xDE , 0xFC , 0xDE , 0xFC , 0x40 , 0xFC , 0x40 , 0xFC , 0xBB , 0xFB , 0xBB , 0xFB , +0x61 , 0xFB , 0x61 , 0xFB , 0x42 , 0xFB , 0x42 , 0xFB , 0x96 , 0xFB , 0x96 , 0xFB , 0xC1 , 0xFB , 0xC1 , 0xFB , +0xC5 , 0xFC , 0xC5 , 0xFC , 0x6F , 0xFD , 0x6F , 0xFD , 0x7F , 0xFE , 0x7F , 0xFE , 0x50 , 0xFF , 0x50 , 0xFF , +0x1B , 0x00 , 0x1B , 0x00 , 0xBF , 0x00 , 0xBF , 0x00 , 0x7F , 0x01 , 0x7F , 0x01 , 0xC4 , 0x01 , 0xC4 , 0x01 , +0x54 , 0x02 , 0x54 , 0x02 , 0x38 , 0x02 , 0x38 , 0x02 , 0x97 , 0x02 , 0x97 , 0x02 , 0x1F , 0x02 , 0x1F , 0x02 , +0x18 , 0x02 , 0x18 , 0x02 , 0x81 , 0x01 , 0x81 , 0x01 , 0x60 , 0x01 , 0x60 , 0x01 , 0x97 , 0x00 , 0x97 , 0x00 , +0x56 , 0x00 , 0x56 , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , 0xA1 , 0xFF , 0xA1 , 0xFF , 0x79 , 0xFF , 0x79 , 0xFF , +0x7A , 0xFF , 0x7A , 0xFF , 0x91 , 0xFF , 0x91 , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0x22 , 0x01 , 0x22 , 0x01 , +0xD8 , 0x00 , 0xD8 , 0x00 , 0x50 , 0x02 , 0x50 , 0x02 , 0x2D , 0x02 , 0x2D , 0x02 , 0xB4 , 0x02 , 0xB4 , 0x02 , +0x01 , 0x03 , 0x01 , 0x03 , 0xC6 , 0x02 , 0xC6 , 0x02 , 0x6E , 0x02 , 0x6E , 0x02 , 0x7D , 0x02 , 0x7D , 0x02 , +0x13 , 0x01 , 0x13 , 0x01 , 0x03 , 0x01 , 0x03 , 0x01 , 0xA3 , 0xFF , 0xA3 , 0xFF , 0xBE , 0xFE , 0xBE , 0xFE , +0x01 , 0xFE , 0x01 , 0xFE , 0xBF , 0xFC , 0xBF , 0xFC , 0x12 , 0xFC , 0x12 , 0xFC , 0xBE , 0xFB , 0xBE , 0xFB , +0x3C , 0xFB , 0x3C , 0xFB , 0x6F , 0xFB , 0x6F , 0xFB , 0xD9 , 0xFB , 0xD9 , 0xFB , 0xF4 , 0xFB , 0xF4 , 0xFB , +0x32 , 0xFD , 0x32 , 0xFD , 0x8A , 0xFD , 0x8A , 0xFD , 0xE7 , 0xFE , 0xE7 , 0xFE , 0xB6 , 0xFF , 0xB6 , 0xFF , +0xFB , 0x00 , 0xFB , 0x00 , 0x73 , 0x01 , 0x73 , 0x01 , 0x84 , 0x02 , 0x84 , 0x02 , 0x82 , 0x02 , 0x82 , 0x02 , +0x32 , 0x03 , 0x32 , 0x03 , 0x0C , 0x03 , 0x0C , 0x03 , 0x14 , 0x03 , 0x14 , 0x03 , 0xBA , 0x02 , 0xBA , 0x02 , +0x6E , 0x02 , 0x6E , 0x02 , 0x9F , 0x01 , 0x9F , 0x01 , 0x37 , 0x01 , 0x37 , 0x01 , 0x4C , 0x00 , 0x4C , 0x00 , +0xCF , 0xFF , 0xCF , 0xFF , 0x11 , 0xFF , 0x11 , 0xFF , 0x91 , 0xFE , 0x91 , 0xFE , 0x6B , 0xFE , 0x6B , 0xFE , +0x19 , 0xFE , 0x19 , 0xFE , 0x5A , 0xFE , 0x5A , 0xFE , 0x93 , 0xFE , 0x93 , 0xFE , 0xFE , 0xFE , 0xFE , 0xFE , +0xD9 , 0xFF , 0xD9 , 0xFF , 0x6A , 0x01 , 0x6A , 0x01 , 0xD6 , 0x00 , 0xD6 , 0x00 , 0xFB , 0x02 , 0xFB , 0x02 , +0x80 , 0x02 , 0x80 , 0x02 , 0x18 , 0x03 , 0x18 , 0x03 , 0x66 , 0x03 , 0x66 , 0x03 , 0xEC , 0x02 , 0xEC , 0x02 , +0x77 , 0x02 , 0x77 , 0x02 , 0x7F , 0x02 , 0x7F , 0x02 , 0x10 , 0x01 , 0x10 , 0x01 , 0xA6 , 0x00 , 0xA6 , 0x00 , +0xD1 , 0xFF , 0xD1 , 0xFF , 0x16 , 0xFE , 0x16 , 0xFE , 0x1C , 0xFE , 0x1C , 0xFE , 0x53 , 0xFC , 0x53 , 0xFC , +0x2C , 0xFC , 0x2C , 0xFC , 0x7C , 0xFB , 0x7C , 0xFB , 0x6A , 0xFB , 0x6A , 0xFB , 0x54 , 0xFB , 0x54 , 0xFB , +0x37 , 0xFC , 0x37 , 0xFC , 0x0C , 0xFC , 0x0C , 0xFC , 0x92 , 0xFD , 0x92 , 0xFD , 0xBE , 0xFD , 0xBE , 0xFD , +0x4A , 0xFF , 0x4A , 0xFF , 0x11 , 0x00 , 0x11 , 0x00 , 0xF3 , 0x00 , 0xF3 , 0x00 , 0x62 , 0x02 , 0x62 , 0x02 , +0x25 , 0x02 , 0x25 , 0x02 , 0x75 , 0x03 , 0x75 , 0x03 , 0xDB , 0x02 , 0xDB , 0x02 , 0x96 , 0x03 , 0x96 , 0x03 , +0xEB , 0x02 , 0xEB , 0x02 , 0x0D , 0x03 , 0x0D , 0x03 , 0x18 , 0x02 , 0x18 , 0x02 , 0x02 , 0x02 , 0x02 , 0x02 , +0x9B , 0x00 , 0x9B , 0x00 , 0x4E , 0x00 , 0x4E , 0x00 , 0x2E , 0xFF , 0x2E , 0xFF , 0x97 , 0xFE , 0x97 , 0xFE , +0xE1 , 0xFD , 0xE1 , 0xFD , 0xA0 , 0xFD , 0xA0 , 0xFD , 0x70 , 0xFD , 0x70 , 0xFD , 0x64 , 0xFD , 0x64 , 0xFD , +0x0B , 0xFE , 0x0B , 0xFE , 0x21 , 0xFE , 0x21 , 0xFE , 0x58 , 0xFF , 0x58 , 0xFF , 0xB3 , 0xFF , 0xB3 , 0xFF , +0x7E , 0x02 , 0x7E , 0x02 , 0x32 , 0x01 , 0x32 , 0x01 , 0xEF , 0x03 , 0xEF , 0x03 , 0x8B , 0x03 , 0x8B , 0x03 , +0x85 , 0x03 , 0x85 , 0x03 , 0x44 , 0x04 , 0x44 , 0x04 , 0x39 , 0x03 , 0x39 , 0x03 , 0x9E , 0x02 , 0x9E , 0x02 , +0x90 , 0x02 , 0x90 , 0x02 , 0xF5 , 0x00 , 0xF5 , 0x00 , 0x23 , 0x00 , 0x23 , 0x00 , 0xC7 , 0xFF , 0xC7 , 0xFF , +0xFD , 0xFC , 0xFD , 0xFC , 0xAA , 0xFD , 0xAA , 0xFD , 0x5F , 0xFB , 0x5F , 0xFB , 0x46 , 0xFB , 0x46 , 0xFB , +0xDF , 0xFA , 0xDF , 0xFA , 0x9E , 0xFA , 0x9E , 0xFA , 0xD5 , 0xFA , 0xD5 , 0xFA , 0xF1 , 0xFB , 0xF1 , 0xFB , +0xD8 , 0xFB , 0xD8 , 0xFB , 0x98 , 0xFD , 0x98 , 0xFD , 0x13 , 0xFE , 0x13 , 0xFE , 0x6B , 0xFF , 0x6B , 0xFF , +0xFF , 0x00 , 0xFF , 0x00 , 0x45 , 0x01 , 0x45 , 0x01 , 0xF1 , 0x02 , 0xF1 , 0x02 , 0xE8 , 0x02 , 0xE8 , 0x02 , +0x76 , 0x03 , 0x76 , 0x03 , 0x4D , 0x03 , 0x4D , 0x03 , 0x7D , 0x03 , 0x7D , 0x03 , 0xB6 , 0x02 , 0xB6 , 0x02 , +0xD0 , 0x02 , 0xD0 , 0x02 , 0x72 , 0x01 , 0x72 , 0x01 , 0x2A , 0x01 , 0x2A , 0x01 , 0x39 , 0x00 , 0x39 , 0x00 , +0x13 , 0xFF , 0x13 , 0xFF , 0xDF , 0xFE , 0xDF , 0xFE , 0xC5 , 0xFD , 0xC5 , 0xFD , 0x1E , 0xFD , 0x1E , 0xFD , +0x51 , 0xFD , 0x51 , 0xFD , 0x47 , 0xFC , 0x47 , 0xFC , 0x4E , 0xFD , 0x4E , 0xFD , 0x24 , 0xFD , 0x24 , 0xFD , +0x41 , 0xFE , 0x41 , 0xFE , 0xD8 , 0xFE , 0xD8 , 0xFE , 0x40 , 0x00 , 0x40 , 0x00 , 0x99 , 0x00 , 0x99 , 0x00 , +0x3E , 0x03 , 0x3E , 0x03 , 0x01 , 0x04 , 0x01 , 0x04 , 0xBC , 0x03 , 0xBC , 0x03 , 0x8F , 0x06 , 0x8F , 0x06 , +0x1D , 0x04 , 0x1D , 0x04 , 0x6D , 0x05 , 0x6D , 0x05 , 0x4B , 0x04 , 0x4B , 0x04 , 0xF8 , 0x02 , 0xF8 , 0x02 , +0x21 , 0x02 , 0x21 , 0x02 , 0x88 , 0x01 , 0x88 , 0x01 , 0xE7 , 0xFE , 0xE7 , 0xFE , 0x75 , 0xFF , 0x75 , 0xFF , +0xDE , 0xFC , 0xDE , 0xFC , 0xD0 , 0xFB , 0xD0 , 0xFB , 0xCE , 0xFB , 0xCE , 0xFB , 0xA6 , 0xF9 , 0xA6 , 0xF9 , +0x86 , 0xFA , 0x86 , 0xFA , 0x07 , 0xFA , 0x07 , 0xFA , 0x4F , 0xFA , 0x4F , 0xFA , 0x65 , 0xFB , 0x65 , 0xFB , +0x51 , 0xFC , 0x51 , 0xFC , 0xDD , 0xFC , 0xDD , 0xFC , 0x31 , 0xFF , 0x31 , 0xFF , 0x5D , 0xFF , 0x5D , 0xFF , +0x53 , 0x01 , 0x53 , 0x01 , 0x76 , 0x02 , 0x76 , 0x02 , 0xC7 , 0x02 , 0xC7 , 0x02 , 0x40 , 0x04 , 0x40 , 0x04 , +0x5B , 0x04 , 0x5B , 0x04 , 0x65 , 0x04 , 0x65 , 0x04 , 0xF7 , 0x04 , 0xF7 , 0x04 , 0xD9 , 0x03 , 0xD9 , 0x03 , +0x6B , 0x03 , 0x6B , 0x03 , 0x04 , 0x03 , 0x04 , 0x03 , 0x33 , 0x01 , 0x33 , 0x01 , 0x89 , 0x00 , 0x89 , 0x00 , +0x81 , 0xFF , 0x81 , 0xFF , 0x32 , 0xFE , 0x32 , 0xFE , 0x8E , 0xFD , 0x8E , 0xFD , 0x70 , 0xFD , 0x70 , 0xFD , +0x06 , 0xFC , 0x06 , 0xFC , 0xE7 , 0xFC , 0xE7 , 0xFC , 0x54 , 0xFC , 0x54 , 0xFC , 0x9B , 0xFC , 0x9B , 0xFC , +0xC4 , 0xFD , 0xC4 , 0xFD , 0x0E , 0xFE , 0x0E , 0xFE , 0x9C , 0xFF , 0x9C , 0xFF , 0x70 , 0x00 , 0x70 , 0x00 , +0xDF , 0x01 , 0xDF , 0x01 , 0x57 , 0x02 , 0x57 , 0x02 , 0xAD , 0x05 , 0xAD , 0x05 , 0x77 , 0x04 , 0x77 , 0x04 , +0x5E , 0x06 , 0x5E , 0x06 , 0xCB , 0x06 , 0xCB , 0x06 , 0xDF , 0x04 , 0xDF , 0x04 , 0xEF , 0x05 , 0xEF , 0x05 , +0x79 , 0x03 , 0x79 , 0x03 , 0x40 , 0x02 , 0x40 , 0x02 , 0x84 , 0x01 , 0x84 , 0x01 , 0x6A , 0xFF , 0x6A , 0xFF , +0x39 , 0xFE , 0x39 , 0xFE , 0x7F , 0xFD , 0x7F , 0xFD , 0xFF , 0xFA , 0xFF , 0xFA , 0xF9 , 0xFA , 0xF9 , 0xFA , +0xCF , 0xF9 , 0xCF , 0xF9 , 0xF7 , 0xF8 , 0xF7 , 0xF8 , 0x7F , 0xF9 , 0x7F , 0xF9 , 0x8C , 0xF9 , 0x8C , 0xF9 , +0x3C , 0xFA , 0x3C , 0xFA , 0xFD , 0xFB , 0xFD , 0xFB , 0xC0 , 0xFC , 0xC0 , 0xFC , 0x8F , 0xFE , 0x8F , 0xFE , +0x48 , 0x00 , 0x48 , 0x00 , 0xF9 , 0x00 , 0xF9 , 0x00 , 0xA4 , 0x02 , 0xA4 , 0x02 , 0x06 , 0x03 , 0x06 , 0x03 , +0xA5 , 0x03 , 0xA5 , 0x03 , 0xB9 , 0x03 , 0xB9 , 0x03 , 0xF8 , 0x03 , 0xF8 , 0x03 , 0xAB , 0x03 , 0xAB , 0x03 , +0xB2 , 0x03 , 0xB2 , 0x03 , 0x28 , 0x03 , 0x28 , 0x03 , 0x4E , 0x02 , 0x4E , 0x02 , 0xE6 , 0x01 , 0xE6 , 0x01 , +0x87 , 0x00 , 0x87 , 0x00 , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xB3 , 0xFE , 0xB3 , 0xFE , 0x27 , 0xFE , 0x27 , 0xFE , +0x9A , 0xFD , 0x9A , 0xFD , 0xFB , 0xFC , 0xFB , 0xFC , 0x71 , 0xFD , 0x71 , 0xFD , 0xDE , 0xFC , 0xDE , 0xFC , +0x7B , 0xFD , 0x7B , 0xFD , 0xCB , 0xFD , 0xCB , 0xFD , 0xF2 , 0xFD , 0xF2 , 0xFD , 0x0F , 0xFF , 0x0F , 0xFF , +0x54 , 0xFF , 0x54 , 0xFF , 0x90 , 0x00 , 0x90 , 0x00 , 0xC7 , 0x00 , 0xC7 , 0x00 , 0x82 , 0x02 , 0x82 , 0x02 , +0x85 , 0x02 , 0x85 , 0x02 , 0x44 , 0x05 , 0x44 , 0x05 , 0xB6 , 0x04 , 0xB6 , 0x04 , 0xFC , 0x04 , 0xFC , 0x04 , +0x3A , 0x06 , 0x3A , 0x06 , 0x62 , 0x03 , 0x62 , 0x03 , 0x56 , 0x04 , 0x56 , 0x04 , 0x08 , 0x02 , 0x08 , 0x02 , +0xA6 , 0x00 , 0xA6 , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0x59 , 0xFE , 0x59 , 0xFE , 0x04 , 0xFD , 0x04 , 0xFD , +0x81 , 0xFC , 0x81 , 0xFC , 0xED , 0xFA , 0xED , 0xFA , 0x41 , 0xFA , 0x41 , 0xFA , 0x74 , 0xFA , 0x74 , 0xFA , +0xF9 , 0xF9 , 0xF9 , 0xF9 , 0x4C , 0xFA , 0x4C , 0xFA , 0x96 , 0xFB , 0x96 , 0xFB , 0xF5 , 0xFB , 0xF5 , 0xFB , +0xAC , 0xFD , 0xAC , 0xFD , 0x63 , 0xFF , 0x63 , 0xFF , 0x1E , 0x00 , 0x1E , 0x00 , 0x4E , 0x02 , 0x4E , 0x02 , +0xBB , 0x02 , 0xBB , 0x02 , 0x80 , 0x03 , 0x80 , 0x03 , 0x03 , 0x04 , 0x03 , 0x04 , 0xBF , 0x03 , 0xBF , 0x03 , +0x78 , 0x03 , 0x78 , 0x03 , 0x13 , 0x03 , 0x13 , 0x03 , 0x83 , 0x02 , 0x83 , 0x02 , 0x9A , 0x01 , 0x9A , 0x01 , +0x31 , 0x01 , 0x31 , 0x01 , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xC0 , 0xFF , 0xC0 , 0xFF , 0x6A , 0xFE , 0x6A , 0xFE , +0xE5 , 0xFD , 0xE5 , 0xFD , 0x92 , 0xFD , 0x92 , 0xFD , 0x91 , 0xFC , 0x91 , 0xFC , 0x5A , 0xFD , 0x5A , 0xFD , +0xFD , 0xFC , 0xFD , 0xFC , 0xAA , 0xFD , 0xAA , 0xFD , 0x57 , 0xFE , 0x57 , 0xFE , 0x9F , 0xFE , 0x9F , 0xFE , +0x93 , 0xFF , 0x93 , 0xFF , 0xD3 , 0xFF , 0xD3 , 0xFF , 0x94 , 0x00 , 0x94 , 0x00 , 0xC2 , 0x00 , 0xC2 , 0x00 , +0x75 , 0x01 , 0x75 , 0x01 , 0x3D , 0x01 , 0x3D , 0x01 , 0xFD , 0x01 , 0xFD , 0x01 , 0xF8 , 0x01 , 0xF8 , 0x01 , +0x78 , 0x02 , 0x78 , 0x02 , 0xF5 , 0x02 , 0xF5 , 0x02 , 0x01 , 0x04 , 0x01 , 0x04 , 0xE9 , 0x03 , 0xE9 , 0x03 , +0x28 , 0x03 , 0x28 , 0x03 , 0x6C , 0x04 , 0x6C , 0x04 , 0x14 , 0x02 , 0x14 , 0x02 , 0x26 , 0x02 , 0x26 , 0x02 , +0x79 , 0x01 , 0x79 , 0x01 , 0x96 , 0xFF , 0x96 , 0xFF , 0x9F , 0xFF , 0x9F , 0xFF , 0x63 , 0xFE , 0x63 , 0xFE , +0x11 , 0xFD , 0x11 , 0xFD , 0xF4 , 0xFC , 0xF4 , 0xFC , 0xC6 , 0xFB , 0xC6 , 0xFB , 0x59 , 0xFB , 0x59 , 0xFB , +0x88 , 0xFB , 0x88 , 0xFB , 0x9D , 0xFB , 0x9D , 0xFB , 0xAF , 0xFB , 0xAF , 0xFB , 0x26 , 0xFD , 0x26 , 0xFD , +0xAC , 0xFD , 0xAC , 0xFD , 0xB1 , 0xFE , 0xB1 , 0xFE , 0x8D , 0x00 , 0x8D , 0x00 , 0xD8 , 0x00 , 0xD8 , 0x00 , +0x49 , 0x02 , 0x49 , 0x02 , 0xDE , 0x02 , 0xDE , 0x02 , 0xF0 , 0x02 , 0xF0 , 0x02 , 0x47 , 0x03 , 0x47 , 0x03 , +0xED , 0x02 , 0xED , 0x02 , 0x8B , 0x02 , 0x8B , 0x02 , 0xED , 0x01 , 0xED , 0x01 , 0x64 , 0x01 , 0x64 , 0x01 , +0x93 , 0x00 , 0x93 , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0x46 , 0xFF , 0x46 , 0xFF , 0x70 , 0xFF , 0x70 , 0xFF , +0x64 , 0xFE , 0x64 , 0xFE , 0x51 , 0xFE , 0x51 , 0xFE , 0x90 , 0xFE , 0x90 , 0xFE , 0x9D , 0xFD , 0x9D , 0xFD , +0x9F , 0xFE , 0x9F , 0xFE , 0x61 , 0xFE , 0x61 , 0xFE , 0xBC , 0xFE , 0xBC , 0xFE , 0x8C , 0xFF , 0x8C , 0xFF , +0xB2 , 0xFF , 0xB2 , 0xFF , 0x51 , 0x00 , 0x51 , 0x00 , 0x92 , 0x00 , 0x92 , 0x00 , 0xD6 , 0x00 , 0xD6 , 0x00 , +0xDB , 0x00 , 0xDB , 0x00 , 0xD4 , 0x00 , 0xD4 , 0x00 , 0xE5 , 0x00 , 0xE5 , 0x00 , 0x81 , 0x00 , 0x81 , 0x00 , +0xD1 , 0x00 , 0xD1 , 0x00 , 0x70 , 0x00 , 0x70 , 0x00 , 0x91 , 0x00 , 0x91 , 0x00 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0xE9 , 0x00 , 0xE9 , 0x00 , 0x3A , 0x01 , 0x3A , 0x01 , 0x68 , 0x02 , 0x68 , 0x02 , 0xA7 , 0x01 , 0xA7 , 0x01 , +0x18 , 0x02 , 0x18 , 0x02 , 0x73 , 0x02 , 0x73 , 0x02 , 0x2E , 0x01 , 0x2E , 0x01 , 0x73 , 0x01 , 0x73 , 0x01 , +0xD6 , 0x00 , 0xD6 , 0x00 , 0xF5 , 0xFF , 0xF5 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , 0x14 , 0xFF , 0x14 , 0xFF , +0x0B , 0xFE , 0x0B , 0xFE , 0xAE , 0xFD , 0xAE , 0xFD , 0x64 , 0xFD , 0x64 , 0xFD , 0xC7 , 0xFC , 0xC7 , 0xFC , +0xEA , 0xFC , 0xEA , 0xFC , 0x3F , 0xFD , 0x3F , 0xFD , 0x19 , 0xFD , 0x19 , 0xFD , 0x18 , 0xFE , 0x18 , 0xFE , +0x98 , 0xFE , 0x98 , 0xFE , 0x21 , 0xFF , 0x21 , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0x99 , 0x00 , 0x99 , 0x00 , +0xDF , 0x00 , 0xDF , 0x00 , 0x6D , 0x01 , 0x6D , 0x01 , 0x93 , 0x01 , 0x93 , 0x01 , 0x6C , 0x01 , 0x6C , 0x01 , +0x9D , 0x01 , 0x9D , 0x01 , 0x48 , 0x01 , 0x48 , 0x01 , 0xFA , 0x00 , 0xFA , 0x00 , 0xD5 , 0x00 , 0xD5 , 0x00 , +0x7F , 0x00 , 0x7F , 0x00 , 0x44 , 0x00 , 0x44 , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , +0xF7 , 0xFF , 0xF7 , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0x22 , 0x00 , 0x22 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , +0x34 , 0x00 , 0x34 , 0x00 , 0x6C , 0x00 , 0x6C , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0x2F , 0x00 , 0x2F , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0x90 , 0xFF , 0x90 , 0xFF , 0xAF , 0xFF , 0xAF , 0xFF , 0x62 , 0xFF , 0x62 , 0xFF , +0x38 , 0xFF , 0x38 , 0xFF , 0x68 , 0xFF , 0x68 , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0x14 , 0x00 , 0x14 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x98 , 0x00 , 0x98 , 0x00 , +0xB9 , 0x00 , 0xB9 , 0x00 , 0xF8 , 0x00 , 0xF8 , 0x00 , 0xF0 , 0x00 , 0xF0 , 0x00 , 0xFD , 0x00 , 0xFD , 0x00 , +0x0C , 0x01 , 0x0C , 0x01 , 0xC4 , 0x00 , 0xC4 , 0x00 , 0xBF , 0x00 , 0xBF , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , +0x29 , 0x00 , 0x29 , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , 0x8D , 0xFF , 0x8D , 0xFF , 0x62 , 0xFF , 0x62 , 0xFF , +0x33 , 0xFF , 0x33 , 0xFF , 0x37 , 0xFF , 0x37 , 0xFF , 0x34 , 0xFF , 0x34 , 0xFF , 0x59 , 0xFF , 0x59 , 0xFF , +0x7F , 0xFF , 0x7F , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , +0x2B , 0x00 , 0x2B , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , 0x27 , 0x00 , 0x27 , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0xE4 , 0xFF , 0xE4 , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , 0xC2 , 0xFF , 0xC2 , 0xFF , +0x90 , 0xFF , 0x90 , 0xFF , 0xAA , 0xFF , 0xAA , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0x94 , 0xFF , 0x94 , 0xFF , +0xAF , 0xFF , 0xAF , 0xFF , 0xB7 , 0xFF , 0xB7 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0x1E , 0x00 , 0x1E , 0x00 , +0x39 , 0x00 , 0x39 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , 0x79 , 0x00 , 0x79 , 0x00 , 0x94 , 0x00 , 0x94 , 0x00 , +0xA4 , 0x00 , 0xA4 , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , 0x82 , 0x00 , 0x82 , 0x00 , 0x76 , 0x00 , 0x76 , 0x00 , +0x65 , 0x00 , 0x65 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , 0x7F , 0x00 , 0x7F , 0x00 , 0x67 , 0x00 , 0x67 , 0x00 , +0x81 , 0x00 , 0x81 , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , 0xAB , 0x00 , 0xAB , 0x00 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0xD0 , 0x00 , 0xD0 , 0x00 , 0xBA , 0x00 , 0xBA , 0x00 , 0xA8 , 0x00 , 0xA8 , 0x00 , 0x98 , 0x00 , 0x98 , 0x00 , +0x6C , 0x00 , 0x6C , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xBB , 0xFF , 0xBB , 0xFF , 0x81 , 0xFF , 0x81 , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , 0x40 , 0xFF , 0x40 , 0xFF , +0x37 , 0xFF , 0x37 , 0xFF , 0x49 , 0xFF , 0x49 , 0xFF , 0x49 , 0xFF , 0x49 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , +0xAA , 0xFF , 0xAA , 0xFF , 0xD5 , 0xFF , 0xD5 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , +0x43 , 0x00 , 0x43 , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , +0x1E , 0x00 , 0x1E , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , +0xA1 , 0xFF , 0xA1 , 0xFF , 0x82 , 0xFF , 0x82 , 0xFF , 0x90 , 0xFF , 0x90 , 0xFF , 0x98 , 0xFF , 0x98 , 0xFF , +0xB9 , 0xFF , 0xB9 , 0xFF , 0xE3 , 0xFF , 0xE3 , 0xFF , 0x0D , 0x00 , 0x0D , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , +0x61 , 0x00 , 0x61 , 0x00 , 0x7C , 0x00 , 0x7C , 0x00 , 0x9A , 0x00 , 0x9A , 0x00 , 0x98 , 0x00 , 0x98 , 0x00 , +0x95 , 0x00 , 0x95 , 0x00 , 0x93 , 0x00 , 0x93 , 0x00 , 0x67 , 0x00 , 0x67 , 0x00 , 0x58 , 0x00 , 0x58 , 0x00 , +0x31 , 0x00 , 0x31 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , 0xF3 , 0xFF , 0xF3 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , +0xC7 , 0xFF , 0xC7 , 0xFF , 0xBF , 0xFF , 0xBF , 0xFF , 0xC4 , 0xFF , 0xC4 , 0xFF , 0xB9 , 0xFF , 0xB9 , 0xFF , +0xC8 , 0xFF , 0xC8 , 0xFF , 0xD3 , 0xFF , 0xD3 , 0xFF , 0xC1 , 0xFF , 0xC1 , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , +0xD3 , 0xFF , 0xD3 , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xD4 , 0xFF , 0xD4 , 0xFF , +0xE3 , 0xFF , 0xE3 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xE1 , 0xFF , 0xE1 , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x16 , 0x00 , 0x16 , 0x00 , +0x26 , 0x00 , 0x26 , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0x4C , 0x00 , 0x4C , 0x00 , 0x4B , 0x00 , 0x4B , 0x00 , +0x53 , 0x00 , 0x53 , 0x00 , 0x53 , 0x00 , 0x53 , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , +0x29 , 0x00 , 0x29 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , +0xD4 , 0xFF , 0xD4 , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , 0xC2 , 0xFF , 0xC2 , 0xFF , +0xC2 , 0xFF , 0xC2 , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , +0x01 , 0x00 , 0x01 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0x2F , 0x00 , 0x2F , 0x00 , +0x2F , 0x00 , 0x2F , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , 0x26 , 0x00 , 0x26 , 0x00 , +0x1D , 0x00 , 0x1D , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , 0xF9 , 0xFF , 0xF9 , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , +0xDD , 0xFF , 0xDD , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xD6 , 0xFF , 0xD6 , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , +0xE2 , 0xFF , 0xE2 , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , +0x07 , 0x00 , 0x07 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , +0x1C , 0x00 , 0x1C , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0x14 , 0x00 , 0x14 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , +0xDC , 0xFF , 0xDC , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , 0xD1 , 0xFF , 0xD1 , 0xFF , 0xD2 , 0xFF , 0xD2 , 0xFF , +0xD6 , 0xFF , 0xD6 , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xE4 , 0xFF , 0xE4 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xFF , 0xFF , 0xFF , 0xFF , 0x08 , 0x00 , 0x08 , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , +0x2D , 0x00 , 0x2D , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , 0x35 , 0x00 , 0x35 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , +0x33 , 0x00 , 0x33 , 0x00 , 0x2C , 0x00 , 0x2C , 0x00 , 0x22 , 0x00 , 0x22 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0xFB , 0xFF , 0xFB , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xFC , 0xFF , 0xFC , 0xFF , 0x04 , 0x00 , 0x04 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , +0x1A , 0x00 , 0x1A , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , 0x22 , 0x00 , 0x22 , 0x00 , +0x21 , 0x00 , 0x21 , 0x00 , 0x1B , 0x00 , 0x1B , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0xFA , 0xFF , 0xFA , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0x05 , 0x00 , 0x05 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , +0x0C , 0x00 , 0x0C , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0xFD , 0xFF , 0xFD , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xEE , 0xFF , 0xEE , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xFF , 0xFF , 0xFF , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x06 , 0x00 , 0x06 , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xED , 0xFF , 0xED , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , +0xFC , 0xFF , 0xFC , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xFB , 0xFF , 0xFB , 0xFF , 0x04 , 0x00 , 0x04 , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x06 , 0x00 , 0x06 , 0x00 , +0xFD , 0xFF , 0xFD , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , +0x13 , 0x00 , 0x13 , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , +0xFB , 0xFF , 0xFB , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , +0xFB , 0xFF , 0xFB , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , +0x0B , 0x00 , 0x0B , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , +0xF9 , 0xFF , 0xF9 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , +0xBA , 0xFF , 0xBA , 0xFF , 0x33 , 0x00 , 0x33 , 0x00 , 0x52 , 0x00 , 0x52 , 0x00 , 0xDC , 0xFF , 0xDC , 0xFF , +0x0F , 0x00 , 0x0F , 0x00 , 0xD9 , 0xFF , 0xD9 , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0x2E , 0x00 , 0x2E , 0x00 , +0x13 , 0x00 , 0x13 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0xF7 , 0xFF , 0xF7 , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0x0C , 0x00 , 0x0C , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , +0xFB , 0xFF , 0xFB , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0x05 , 0x00 , 0x05 , 0x00 , 0xFB , 0xFF , 0xFB , 0xFF , +0x05 , 0x00 , 0x05 , 0x00 , 0xF4 , 0xFF , 0xF4 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0x06 , 0x00 , 0x06 , 0x00 , +0x18 , 0x00 , 0x18 , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0xF6 , 0xFF , 0xF6 , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , +0x1E , 0x00 , 0x1E , 0x00 , 0xE3 , 0xFF , 0xE3 , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , 0x92 , 0x00 , 0x92 , 0x00 , +0x92 , 0xFF , 0x92 , 0xFF , 0x6A , 0xFF , 0x6A , 0xFF , 0x63 , 0x00 , 0x63 , 0x00 , 0xF4 , 0xFF , 0xF4 , 0xFF , +0x21 , 0xFF , 0x21 , 0xFF , 0x7C , 0x00 , 0x7C , 0x00 , 0xF3 , 0xFE , 0xF3 , 0xFE , 0xAC , 0x00 , 0xAC , 0x00 , +0x19 , 0x01 , 0x19 , 0x01 , 0x22 , 0x00 , 0x22 , 0x00 , 0x7B , 0x01 , 0x7B , 0x01 , 0x84 , 0xFF , 0x84 , 0xFF , +0x13 , 0x00 , 0x13 , 0x00 , 0xE9 , 0x00 , 0xE9 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xFB , 0xFE , 0xFB , 0xFE , +0x21 , 0xFF , 0x21 , 0xFF , 0xBA , 0x01 , 0xBA , 0x01 , 0xDD , 0xFE , 0xDD , 0xFE , 0x10 , 0xFF , 0x10 , 0xFF , +0x2A , 0x00 , 0x2A , 0x00 , 0xE3 , 0xFF , 0xE3 , 0xFF , 0x0B , 0x01 , 0x0B , 0x01 , 0xCE , 0xFF , 0xCE , 0xFF , +0xBA , 0x00 , 0xBA , 0x00 , 0x9E , 0xFF , 0x9E , 0xFF , 0xE3 , 0x01 , 0xE3 , 0x01 , 0xBB , 0xFE , 0xBB , 0xFE , +0xDA , 0xFE , 0xDA , 0xFE , 0x49 , 0x01 , 0x49 , 0x01 , 0x85 , 0xFD , 0x85 , 0xFD , 0x3F , 0x01 , 0x3F , 0x01 , +0xA4 , 0x01 , 0xA4 , 0x01 , 0x6A , 0x00 , 0x6A , 0x00 , 0x5F , 0x02 , 0x5F , 0x02 , 0x5B , 0xFE , 0x5B , 0xFE , +0x5C , 0x01 , 0x5C , 0x01 , 0x9C , 0xFF , 0x9C , 0xFF , 0xC0 , 0xFD , 0xC0 , 0xFD , 0x73 , 0x00 , 0x73 , 0x00 , +0x7B , 0x00 , 0x7B , 0x00 , 0xA0 , 0xFE , 0xA0 , 0xFE , 0xFD , 0xFF , 0xFD , 0xFF , 0xF3 , 0xFF , 0xF3 , 0xFF , +0x33 , 0xFF , 0x33 , 0xFF , 0x50 , 0x02 , 0x50 , 0x02 , 0xAC , 0xFF , 0xAC , 0xFF , 0x8C , 0x01 , 0x8C , 0x01 , +0x64 , 0x00 , 0x64 , 0x00 , 0xC2 , 0xFE , 0xC2 , 0xFE , 0x1B , 0x01 , 0x1B , 0x01 , 0x4B , 0x00 , 0x4B , 0x00 , +0x7D , 0xFF , 0x7D , 0xFF , 0xAB , 0xFE , 0xAB , 0xFE , 0x1E , 0x01 , 0x1E , 0x01 , 0x26 , 0x01 , 0x26 , 0x01 , +0xC7 , 0xFD , 0xC7 , 0xFD , 0x59 , 0x00 , 0x59 , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , 0xC5 , 0x00 , 0xC5 , 0x00 , +0xC6 , 0xFF , 0xC6 , 0xFF , 0x4C , 0x00 , 0x4C , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , 0x5E , 0x00 , 0x5E , 0x00 , +0xA2 , 0x00 , 0xA2 , 0x00 , 0xB7 , 0xFD , 0xB7 , 0xFD , 0x2D , 0x01 , 0x2D , 0x01 , 0x7C , 0xFF , 0x7C , 0xFF , +0xBF , 0xFE , 0xBF , 0xFE , 0x97 , 0x02 , 0x97 , 0x02 , 0xEB , 0xFF , 0xEB , 0xFF , 0xE3 , 0x01 , 0xE3 , 0x01 , +0x76 , 0xFF , 0x76 , 0xFF , 0x64 , 0xFF , 0x64 , 0xFF , 0x1B , 0x01 , 0x1B , 0x01 , 0xAB , 0xFF , 0xAB , 0xFF , +0x68 , 0x00 , 0x68 , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , 0x6C , 0xFF , 0x6C , 0xFF , 0x1E , 0xFF , 0x1E , 0xFF , +0x28 , 0x00 , 0x28 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , 0xC8 , 0x00 , 0xC8 , 0x00 , 0x44 , 0xFF , 0x44 , 0xFF , +0xDB , 0x00 , 0xDB , 0x00 , 0xC0 , 0xFF , 0xC0 , 0xFF , 0x36 , 0x01 , 0x36 , 0x01 , 0xB8 , 0xFE , 0xB8 , 0xFE , +0xAD , 0xFE , 0xAD , 0xFE , 0xC4 , 0x01 , 0xC4 , 0x01 , 0x20 , 0xFE , 0x20 , 0xFE , 0xD4 , 0x00 , 0xD4 , 0x00 , +0xC4 , 0x01 , 0xC4 , 0x01 , 0xA8 , 0x00 , 0xA8 , 0x00 , 0x1A , 0x01 , 0x1A , 0x01 , 0x22 , 0xFE , 0x22 , 0xFE , +0xE1 , 0x00 , 0xE1 , 0x00 , 0x8F , 0x00 , 0x8F , 0x00 , 0xC3 , 0xFF , 0xC3 , 0xFF , 0x60 , 0x00 , 0x60 , 0x00 , +0xC0 , 0xFF , 0xC0 , 0xFF , 0x9C , 0xFE , 0x9C , 0xFE , 0x84 , 0xFE , 0x84 , 0xFE , 0xAC , 0xFF , 0xAC , 0xFF , +0x1C , 0x02 , 0x1C , 0x02 , 0x87 , 0x00 , 0x87 , 0x00 , 0x8A , 0xFD , 0x8A , 0xFD , 0x1E , 0x02 , 0x1E , 0x02 , +0x17 , 0xFF , 0x17 , 0xFF , 0x95 , 0xFF , 0x95 , 0xFF , 0xF7 , 0x01 , 0xF7 , 0x01 , 0xFD , 0xFE , 0xFD , 0xFE , +0x68 , 0x01 , 0x68 , 0x01 , 0x3A , 0x00 , 0x3A , 0x00 , 0x61 , 0xFF , 0x61 , 0xFF , 0xD1 , 0xFF , 0xD1 , 0xFF , +0x7D , 0xFF , 0x7D , 0xFF , 0x6E , 0x00 , 0x6E , 0x00 , 0x8E , 0xFF , 0x8E , 0xFF , 0xEB , 0x01 , 0xEB , 0x01 , +0x5D , 0x00 , 0x5D , 0x00 , 0x1B , 0xFE , 0x1B , 0xFE , 0xA6 , 0x00 , 0xA6 , 0x00 , 0xEF , 0xFF , 0xEF , 0xFF , +0xC7 , 0xFD , 0xC7 , 0xFD , 0x57 , 0x00 , 0x57 , 0x00 , 0x90 , 0x01 , 0x90 , 0x01 , 0x89 , 0xFD , 0x89 , 0xFD , +0xDD , 0xFF , 0xDD , 0xFF , 0xFC , 0x02 , 0xFC , 0x02 , 0x3A , 0x00 , 0x3A , 0x00 , 0x30 , 0xFD , 0x30 , 0xFD , +0xBE , 0xFD , 0xBE , 0xFD , 0xAD , 0x02 , 0xAD , 0x02 , 0x86 , 0x00 , 0x86 , 0x00 , 0x46 , 0xFD , 0x46 , 0xFD , +0x62 , 0xFE , 0x62 , 0xFE , 0x61 , 0x01 , 0x61 , 0x01 , 0x5D , 0x02 , 0x5D , 0x02 , 0xC7 , 0x00 , 0xC7 , 0x00 , +0x3F , 0xFE , 0x3F , 0xFE , 0xFA , 0xFF , 0xFA , 0xFF , 0x94 , 0x03 , 0x94 , 0x03 , 0x21 , 0xFF , 0x21 , 0xFF , +0x88 , 0xFE , 0x88 , 0xFE , 0xD0 , 0x00 , 0xD0 , 0x00 , 0x6B , 0x02 , 0x6B , 0x02 , 0x90 , 0x01 , 0x90 , 0x01 , +0x6B , 0xFE , 0x6B , 0xFE , 0x16 , 0xFE , 0x16 , 0xFE , 0xFA , 0x00 , 0xFA , 0x00 , 0x96 , 0x01 , 0x96 , 0x01 , +0xD5 , 0xFE , 0xD5 , 0xFE , 0x2E , 0xFD , 0x2E , 0xFD , 0xE9 , 0xFF , 0xE9 , 0xFF , 0x36 , 0x02 , 0x36 , 0x02 , +0xE6 , 0xFE , 0xE6 , 0xFE , 0x52 , 0xFE , 0x52 , 0xFE , 0x70 , 0xFF , 0x70 , 0xFF , 0xD7 , 0x02 , 0xD7 , 0x02 , +0xCB , 0x01 , 0xCB , 0x01 , 0x65 , 0xFE , 0x65 , 0xFE , 0xEE , 0xFF , 0xEE , 0xFF , 0x76 , 0x01 , 0x76 , 0x01 , +0x9C , 0x00 , 0x9C , 0x00 , 0xE5 , 0xFD , 0xE5 , 0xFD , 0x87 , 0xFE , 0x87 , 0xFE , 0xD3 , 0x01 , 0xD3 , 0x01 , +0xDB , 0xFF , 0xDB , 0xFF , 0x83 , 0xFD , 0x83 , 0xFD , 0xC6 , 0xFF , 0xC6 , 0xFF , 0xEA , 0x00 , 0xEA , 0x00 , +0x9E , 0x00 , 0x9E , 0x00 , 0xD0 , 0xFF , 0xD0 , 0xFF , 0x91 , 0x01 , 0x91 , 0x01 , 0x46 , 0x01 , 0x46 , 0x01 , +0x6A , 0xFE , 0x6A , 0xFE , 0x2A , 0xFF , 0x2A , 0xFF , 0x07 , 0x01 , 0x07 , 0x01 , 0x1E , 0x00 , 0x1E , 0x00 , +0x02 , 0xFF , 0x02 , 0xFF , 0x4B , 0xFF , 0x4B , 0xFF , 0x33 , 0x01 , 0x33 , 0x01 , 0x11 , 0x01 , 0x11 , 0x01 , +0x65 , 0xFE , 0x65 , 0xFE , 0xC0 , 0xFE , 0xC0 , 0xFE , 0x99 , 0x01 , 0x99 , 0x01 , 0xB6 , 0x01 , 0xB6 , 0x01 , +0x6C , 0xFE , 0x6C , 0xFE , 0x62 , 0xFD , 0x62 , 0xFD , 0x19 , 0xFF , 0x19 , 0xFF , 0x46 , 0x00 , 0x46 , 0x00 , +0x3E , 0x00 , 0x3E , 0x00 , 0xFF , 0x00 , 0xFF , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , 0x54 , 0xFF , 0x54 , 0xFF , +0xED , 0x00 , 0xED , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , 0xBB , 0xFF , 0xBB , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , +0x55 , 0xFF , 0x55 , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0x96 , 0x00 , 0x96 , 0x00 , +0x39 , 0x00 , 0x39 , 0x00 , 0xBD , 0xFF , 0xBD , 0xFF , 0x23 , 0x00 , 0x23 , 0x00 , 0x8D , 0x00 , 0x8D , 0x00 , +0xC3 , 0x00 , 0xC3 , 0x00 , 0xB3 , 0xFE , 0xB3 , 0xFE , 0x0E , 0xFF , 0x0E , 0xFF , 0x90 , 0x00 , 0x90 , 0x00 , +0x24 , 0x00 , 0x24 , 0x00 , 0x63 , 0x00 , 0x63 , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , 0x2C , 0x01 , 0x2C , 0x01 , +0x7C , 0x00 , 0x7C , 0x00 , 0xF8 , 0xFE , 0xF8 , 0xFE , 0xBB , 0xFF , 0xBB , 0xFF , 0x84 , 0x00 , 0x84 , 0x00 , +0x94 , 0x00 , 0x94 , 0x00 , 0x70 , 0xFF , 0x70 , 0xFF , 0xD8 , 0xFE , 0xD8 , 0xFE , 0x1A , 0xFF , 0x1A , 0xFF , +0xC4 , 0xFF , 0xC4 , 0xFF , 0x6D , 0x00 , 0x6D , 0x00 , 0x57 , 0x01 , 0x57 , 0x01 , 0xE5 , 0xFF , 0xE5 , 0xFF , +0x17 , 0xFF , 0x17 , 0xFF , 0xB9 , 0x00 , 0xB9 , 0x00 , 0x44 , 0x00 , 0x44 , 0x00 , 0x61 , 0x00 , 0x61 , 0x00 , +0xD9 , 0xFF , 0xD9 , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , 0xC0 , 0x00 , 0xC0 , 0x00 , 0x49 , 0x00 , 0x49 , 0x00 , +0x63 , 0xFF , 0x63 , 0xFF , 0x0F , 0xFF , 0x0F , 0xFF , 0x9C , 0xFF , 0x9C , 0xFF , 0xCD , 0xFF , 0xCD , 0xFF , +0xD3 , 0x00 , 0xD3 , 0x00 , 0xA4 , 0x00 , 0xA4 , 0x00 , 0xA4 , 0xFF , 0xA4 , 0xFF , 0x88 , 0xFE , 0x88 , 0xFE , +0x8D , 0xFF , 0x8D , 0xFF , 0x34 , 0x01 , 0x34 , 0x01 , 0x2C , 0x00 , 0x2C , 0x00 , 0xB8 , 0xFE , 0xB8 , 0xFE , +0xCD , 0xFE , 0xCD , 0xFE , 0xF5 , 0x00 , 0xF5 , 0x00 , 0x27 , 0x02 , 0x27 , 0x02 , 0xC8 , 0x00 , 0xC8 , 0x00 , +0x31 , 0xFE , 0x31 , 0xFE , 0xBC , 0xFF , 0xBC , 0xFF , 0xD0 , 0x01 , 0xD0 , 0x01 , 0x95 , 0x00 , 0x95 , 0x00 , +0xE1 , 0xFE , 0xE1 , 0xFE , 0x1D , 0xFF , 0x1D , 0xFF , 0xB6 , 0x01 , 0xB6 , 0x01 , 0x00 , 0x02 , 0x00 , 0x02 , +0x09 , 0xFF , 0x09 , 0xFF , 0x68 , 0xFD , 0x68 , 0xFD , 0xF9 , 0xFF , 0xF9 , 0xFF , 0x2F , 0x02 , 0x2F , 0x02 , +0x3B , 0x00 , 0x3B , 0x00 , 0x2E , 0xFD , 0x2E , 0xFD , 0xD4 , 0xFE , 0xD4 , 0xFE , 0xF3 , 0x01 , 0xF3 , 0x01 , +0x6D , 0x01 , 0x6D , 0x01 , 0xB1 , 0xFF , 0xB1 , 0xFF , 0x19 , 0x00 , 0x19 , 0x00 , 0x16 , 0x01 , 0x16 , 0x01 , +0x57 , 0x00 , 0x57 , 0x00 , 0x61 , 0xFF , 0x61 , 0xFF , 0x23 , 0xFF , 0x23 , 0xFF , 0x8C , 0xFF , 0x8C , 0xFF , +0x54 , 0x00 , 0x54 , 0x00 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0xA2 , 0xFF , 0xA2 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , +0xBF , 0x00 , 0xBF , 0x00 , 0x30 , 0x01 , 0x30 , 0x01 , 0xDA , 0x00 , 0xDA , 0x00 , 0xBA , 0xFF , 0xBA , 0xFF , +0xC6 , 0xFE , 0xC6 , 0xFE , 0x4D , 0xFF , 0x4D , 0xFF , 0x72 , 0x00 , 0x72 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , +0x11 , 0xFF , 0x11 , 0xFF , 0xFE , 0xFE , 0xFE , 0xFE , 0x95 , 0x00 , 0x95 , 0x00 , 0xBC , 0x00 , 0xBC , 0x00 , +0x34 , 0x00 , 0x34 , 0x00 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0x3B , 0x01 , 0x3B , 0x01 , 0xF1 , 0xFF , 0xF1 , 0xFF , +0xFD , 0xFE , 0xFD , 0xFE , 0x8E , 0xFF , 0x8E , 0xFF , 0x04 , 0x00 , 0x04 , 0x00 , 0xC9 , 0xFF , 0xC9 , 0xFF , +0x17 , 0x00 , 0x17 , 0x00 , 0x50 , 0x00 , 0x50 , 0x00 , 0xB7 , 0x00 , 0xB7 , 0x00 , 0x07 , 0x01 , 0x07 , 0x01 , +0x83 , 0x00 , 0x83 , 0x00 , 0x7A , 0xFF , 0x7A , 0xFF , 0x5B , 0x00 , 0x5B , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , +0x9C , 0xFF , 0x9C , 0xFF , 0xCA , 0xFE , 0xCA , 0xFE , 0xC7 , 0xFE , 0xC7 , 0xFE , 0x5E , 0x00 , 0x5E , 0x00 , +0x21 , 0x01 , 0x21 , 0x01 , 0x48 , 0x00 , 0x48 , 0x00 , 0xA4 , 0xFF , 0xA4 , 0xFF , 0xD8 , 0xFF , 0xD8 , 0xFF , +0xF2 , 0xFF , 0xF2 , 0xFF , 0x7A , 0x00 , 0x7A , 0x00 , 0xD9 , 0xFF , 0xD9 , 0xFF , 0x53 , 0xFF , 0x53 , 0xFF , +0xFE , 0xFF , 0xFE , 0xFF , 0x6C , 0x01 , 0x6C , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x08 , 0xFF , 0x08 , 0xFF , +0xCC , 0xFE , 0xCC , 0xFE , 0x09 , 0x00 , 0x09 , 0x00 , 0x94 , 0x00 , 0x94 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , +0x93 , 0xFF , 0x93 , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , 0xC0 , 0x00 , 0xC0 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , +0x3D , 0xFF , 0x3D , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , 0x9F , 0x00 , 0x9F , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , +0x29 , 0xFF , 0x29 , 0xFF , 0x7C , 0xFE , 0x7C , 0xFE , 0x07 , 0xFF , 0x07 , 0xFF , 0x7A , 0x00 , 0x7A , 0x00 , +0xBC , 0x01 , 0xBC , 0x01 , 0xF7 , 0x00 , 0xF7 , 0x00 , 0x59 , 0xFF , 0x59 , 0xFF , 0x9B , 0xFF , 0x9B , 0xFF , +0xFA , 0xFF , 0xFA , 0xFF , 0x6A , 0xFF , 0x6A , 0xFF , 0x5D , 0xFF , 0x5D , 0xFF , 0x2D , 0x00 , 0x2D , 0x00 , +0xB9 , 0xFF , 0xB9 , 0xFF , 0x15 , 0x00 , 0x15 , 0x00 , 0xE6 , 0x00 , 0xE6 , 0x00 , 0xBA , 0x00 , 0xBA , 0x00 , +0x74 , 0xFF , 0x74 , 0xFF , 0x7D , 0xFE , 0x7D , 0xFE , 0x8E , 0xFF , 0x8E , 0xFF , 0x87 , 0x00 , 0x87 , 0x00 , +0x2A , 0x00 , 0x2A , 0x00 , 0x51 , 0xFF , 0x51 , 0xFF , 0x3D , 0xFF , 0x3D , 0xFF , 0x15 , 0x00 , 0x15 , 0x00 , +0xD0 , 0x00 , 0xD0 , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , 0x60 , 0x00 , 0x60 , 0x00 , +0xCC , 0x00 , 0xCC , 0x00 , 0x97 , 0x00 , 0x97 , 0x00 , 0x55 , 0xFF , 0x55 , 0xFF , 0xF9 , 0xFE , 0xF9 , 0xFE , +0xBF , 0xFF , 0xBF , 0xFF , 0x80 , 0x00 , 0x80 , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , 0x7F , 0xFF , 0x7F , 0xFF , +0x65 , 0x00 , 0x65 , 0x00 , 0x82 , 0x00 , 0x82 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x8D , 0xFF , 0x8D , 0xFF , +0xEC , 0xFF , 0xEC , 0xFF , 0x6A , 0x00 , 0x6A , 0x00 , 0x6B , 0x00 , 0x6B , 0x00 , 0xF9 , 0xFF , 0xF9 , 0xFF , +0xA3 , 0xFF , 0xA3 , 0xFF , 0x2C , 0x00 , 0x2C , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , 0xA3 , 0xFF , 0xA3 , 0xFF , +0xC1 , 0xFF , 0xC1 , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0x9B , 0x00 , 0x9B , 0x00 , 0x0B , 0x01 , 0x0B , 0x01 , +0x15 , 0x01 , 0x15 , 0x01 , 0x2C , 0x00 , 0x2C , 0x00 , 0x20 , 0xFF , 0x20 , 0xFF , 0x50 , 0xFF , 0x50 , 0xFF , +0xF4 , 0xFF , 0xF4 , 0xFF , 0x69 , 0x00 , 0x69 , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0x8C , 0xFF , 0x8C , 0xFF , +0x1E , 0xFF , 0x1E , 0xFF , 0x33 , 0xFF , 0x33 , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , 0x8B , 0x00 , 0x8B , 0x00 , +0x32 , 0x00 , 0x32 , 0x00 , 0x2C , 0x00 , 0x2C , 0x00 , 0x17 , 0x00 , 0x17 , 0x00 , 0xB1 , 0x00 , 0xB1 , 0x00 , +0x0F , 0x01 , 0x0F , 0x01 , 0x73 , 0x00 , 0x73 , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , 0xEE , 0xFF , 0xEE , 0xFF , +0x23 , 0xFF , 0x23 , 0xFF , 0xF5 , 0xFE , 0xF5 , 0xFE , 0xA5 , 0xFF , 0xA5 , 0xFF , 0x4B , 0x00 , 0x4B , 0x00 , +0x40 , 0x00 , 0x40 , 0x00 , 0xA3 , 0xFF , 0xA3 , 0xFF , 0x5D , 0xFF , 0x5D , 0xFF , 0xDD , 0xFF , 0xDD , 0xFF , +0x97 , 0x00 , 0x97 , 0x00 , 0x66 , 0x01 , 0x66 , 0x01 , 0x74 , 0x01 , 0x74 , 0x01 , 0x84 , 0x00 , 0x84 , 0x00 , +0x0D , 0xFF , 0x0D , 0xFF , 0xB5 , 0xFE , 0xB5 , 0xFE , 0x85 , 0xFF , 0x85 , 0xFF , 0x30 , 0x00 , 0x30 , 0x00 , +0xBA , 0xFF , 0xBA , 0xFF , 0x69 , 0xFF , 0x69 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0x6B , 0x00 , 0x6B , 0x00 , +0x24 , 0x01 , 0x24 , 0x01 , 0xB9 , 0x01 , 0xB9 , 0x01 , 0x4F , 0x01 , 0x4F , 0x01 , 0x9C , 0xFF , 0x9C , 0xFF , +0x5A , 0xFE , 0x5A , 0xFE , 0x61 , 0xFE , 0x61 , 0xFE , 0x4B , 0xFF , 0x4B , 0xFF , 0x4A , 0x00 , 0x4A , 0x00 , +0xE2 , 0x00 , 0xE2 , 0x00 , 0xA4 , 0x00 , 0xA4 , 0x00 , 0x50 , 0x00 , 0x50 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , +0x0E , 0x00 , 0x0E , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , 0xAF , 0xFF , 0xAF , 0xFF , +0xA2 , 0xFF , 0xA2 , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , 0x04 , 0x00 , 0x04 , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , +0x29 , 0x00 , 0x29 , 0x00 , 0xA6 , 0xFF , 0xA6 , 0xFF , 0x2E , 0xFF , 0x2E , 0xFF , 0x39 , 0xFF , 0x39 , 0xFF , +0xFD , 0xFF , 0xFD , 0xFF , 0xFA , 0x00 , 0xFA , 0x00 , 0xFE , 0x00 , 0xFE , 0x00 , 0x50 , 0x00 , 0x50 , 0x00 , +0x9D , 0xFF , 0x9D , 0xFF , 0x13 , 0xFF , 0x13 , 0xFF , 0x83 , 0xFF , 0x83 , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , +0xC4 , 0xFF , 0xC4 , 0xFF , 0x1D , 0x00 , 0x1D , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x51 , 0x00 , 0x51 , 0x00 , +0xF7 , 0x00 , 0xF7 , 0x00 , 0x79 , 0x01 , 0x79 , 0x01 , 0x11 , 0x01 , 0x11 , 0x01 , 0xD8 , 0xFF , 0xD8 , 0xFF , +0xDA , 0xFE , 0xDA , 0xFE , 0xB2 , 0xFE , 0xB2 , 0xFE , 0xB5 , 0xFE , 0xB5 , 0xFE , 0x4B , 0xFF , 0x4B , 0xFF , +0x25 , 0x00 , 0x25 , 0x00 , 0xF5 , 0x00 , 0xF5 , 0x00 , 0xD3 , 0x00 , 0xD3 , 0x00 , 0xE6 , 0xFF , 0xE6 , 0xFF , +0x82 , 0xFF , 0x82 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , 0x4F , 0x00 , 0x4F , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x74 , 0xFF , 0x74 , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0x5E , 0x00 , 0x5E , 0x00 , 0xF3 , 0x00 , 0xF3 , 0x00 , +0xED , 0x00 , 0xED , 0x00 , 0xE2 , 0xFF , 0xE2 , 0xFF , 0xFC , 0xFE , 0xFC , 0xFE , 0x2D , 0xFF , 0x2D , 0xFF , +0x9A , 0xFF , 0x9A , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , 0x65 , 0x00 , 0x65 , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , +0x52 , 0x00 , 0x52 , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , 0xA0 , 0x00 , 0xA0 , 0x00 , 0x8B , 0x00 , 0x8B , 0x00 , +0x14 , 0x00 , 0x14 , 0x00 , 0x99 , 0xFF , 0x99 , 0xFF , 0x57 , 0xFF , 0x57 , 0xFF , 0x6D , 0xFF , 0x6D , 0xFF , +0xB0 , 0xFF , 0xB0 , 0xFF , 0x93 , 0x00 , 0x93 , 0x00 , 0x41 , 0x01 , 0x41 , 0x01 , 0x26 , 0x01 , 0x26 , 0x01 , +0x80 , 0x00 , 0x80 , 0x00 , 0xC0 , 0xFF , 0xC0 , 0xFF , 0x64 , 0xFF , 0x64 , 0xFF , 0x85 , 0xFF , 0x85 , 0xFF , +0x33 , 0x00 , 0x33 , 0x00 , 0x8D , 0x00 , 0x8D , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , 0xF5 , 0xFF , 0xF5 , 0xFF , +0x46 , 0xFF , 0x46 , 0xFF , 0x0F , 0xFF , 0x0F , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , +0x58 , 0x00 , 0x58 , 0x00 , 0x99 , 0x00 , 0x99 , 0x00 , 0x6C , 0x00 , 0x6C , 0x00 , 0xC5 , 0xFF , 0xC5 , 0xFF , +0x4E , 0xFF , 0x4E , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , 0xBF , 0xFF , 0xBF , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , +0x96 , 0xFF , 0x96 , 0xFF , 0x69 , 0xFF , 0x69 , 0xFF , 0x9A , 0xFF , 0x9A , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , +0x24 , 0x01 , 0x24 , 0x01 , 0x3C , 0x01 , 0x3C , 0x01 , 0x7B , 0x00 , 0x7B , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , +0xFB , 0xFF , 0xFB , 0xFF , 0x2C , 0x00 , 0x2C , 0x00 , 0x50 , 0x00 , 0x50 , 0x00 , 0x95 , 0x00 , 0x95 , 0x00 , +0xB7 , 0x00 , 0xB7 , 0x00 , 0x8C , 0x00 , 0x8C , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , 0x86 , 0x00 , 0x86 , 0x00 , +0x14 , 0x01 , 0x14 , 0x01 , 0x6A , 0x01 , 0x6A , 0x01 , 0x24 , 0x01 , 0x24 , 0x01 , 0x2A , 0x00 , 0x2A , 0x00 , +0x44 , 0xFF , 0x44 , 0xFF , 0xDA , 0xFE , 0xDA , 0xFE , 0xEC , 0xFE , 0xEC , 0xFE , 0x4A , 0xFF , 0x4A , 0xFF , +0xE5 , 0xFF , 0xE5 , 0xFF , 0x12 , 0x00 , 0x12 , 0x00 , 0xB1 , 0xFF , 0xB1 , 0xFF , 0xF1 , 0xFE , 0xF1 , 0xFE , +0x5D , 0xFE , 0x5D , 0xFE , 0xFF , 0xFD , 0xFF , 0xFD , 0xC0 , 0xFD , 0xC0 , 0xFD , 0xC6 , 0xFD , 0xC6 , 0xFD , +0xA4 , 0xFE , 0xA4 , 0xFE , 0x9C , 0xFF , 0x9C , 0xFF , 0x3B , 0x00 , 0x3B , 0x00 , 0x60 , 0x00 , 0x60 , 0x00 , +0x79 , 0x00 , 0x79 , 0x00 , 0xCA , 0x00 , 0xCA , 0x00 , 0x6F , 0x00 , 0x6F , 0x00 , 0xFD , 0xFF , 0xFD , 0xFF , +0x1B , 0x00 , 0x1B , 0x00 , 0xB4 , 0x00 , 0xB4 , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0x7A , 0x01 , 0x7A , 0x01 , +0x64 , 0x02 , 0x64 , 0x02 , 0x7F , 0x03 , 0x7F , 0x03 , 0xC2 , 0x03 , 0xC2 , 0x03 , 0xA5 , 0x03 , 0xA5 , 0x03 , +0xCA , 0x03 , 0xCA , 0x03 , 0xBE , 0x03 , 0xBE , 0x03 , 0x43 , 0x03 , 0x43 , 0x03 , 0xD6 , 0x01 , 0xD6 , 0x01 , +0xB7 , 0xFF , 0xB7 , 0xFF , 0x84 , 0xFD , 0x84 , 0xFD , 0x73 , 0xFB , 0x73 , 0xFB , 0xC2 , 0xFA , 0xC2 , 0xFA , +0x40 , 0xFB , 0x40 , 0xFB , 0x01 , 0xFD , 0x01 , 0xFD , 0xD1 , 0xFE , 0xD1 , 0xFE , 0xB6 , 0xFF , 0xB6 , 0xFF , +0x48 , 0xFF , 0x48 , 0xFF , 0x20 , 0xFE , 0x20 , 0xFE , 0xCE , 0xFC , 0xCE , 0xFC , 0xBC , 0xFB , 0xBC , 0xFB , +0x24 , 0xFB , 0x24 , 0xFB , 0xF2 , 0xFB , 0xF2 , 0xFB , 0x35 , 0xFE , 0x35 , 0xFE , 0x93 , 0x00 , 0x93 , 0x00 , +0x20 , 0x02 , 0x20 , 0x02 , 0x02 , 0x02 , 0x02 , 0x02 , 0xA0 , 0x01 , 0xA0 , 0x01 , 0x13 , 0x00 , 0x13 , 0x00 , +0xB7 , 0xFE , 0xB7 , 0xFE , 0x56 , 0xFF , 0x56 , 0xFF , 0xBB , 0x02 , 0xBB , 0x02 , 0x19 , 0x07 , 0x19 , 0x07 , +0xA5 , 0x0A , 0xA5 , 0x0A , 0x99 , 0x0C , 0x99 , 0x0C , 0x56 , 0x0C , 0x56 , 0x0C , 0xDA , 0x08 , 0xDA , 0x08 , +0x1D , 0x03 , 0x1D , 0x03 , 0xE3 , 0xFC , 0xE3 , 0xFC , 0x6F , 0xF8 , 0x6F , 0xF8 , 0xE6 , 0xF6 , 0xE6 , 0xF6 , +0xC5 , 0xF7 , 0xC5 , 0xF7 , 0x2F , 0xFA , 0x2F , 0xFA , 0xCD , 0xFC , 0xCD , 0xFC , 0x5A , 0xFF , 0x5A , 0xFF , +0xEC , 0xFF , 0xEC , 0xFF , 0x35 , 0xFE , 0x35 , 0xFE , 0xAB , 0xFB , 0xAB , 0xFB , 0xBD , 0xF9 , 0xBD , 0xF9 , +0x45 , 0xF9 , 0x45 , 0xF9 , 0x72 , 0xF9 , 0x72 , 0xF9 , 0xA7 , 0xFA , 0xA7 , 0xFA , 0x59 , 0xFC , 0x59 , 0xFC , +0xD7 , 0xFD , 0xD7 , 0xFD , 0x45 , 0xFF , 0x45 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0x44 , 0x02 , 0x44 , 0x02 , +0x0A , 0x03 , 0x0A , 0x03 , 0x62 , 0x02 , 0x62 , 0x02 , 0xA1 , 0x01 , 0xA1 , 0x01 , 0x5A , 0x02 , 0x5A , 0x02 , +0x82 , 0x06 , 0x82 , 0x06 , 0x2F , 0x0D , 0x2F , 0x0D , 0xC3 , 0x13 , 0xC3 , 0x13 , 0x4B , 0x16 , 0x4B , 0x16 , +0x4E , 0x11 , 0x4E , 0x11 , 0x03 , 0x06 , 0x03 , 0x06 , 0xA1 , 0xF9 , 0xA1 , 0xF9 , 0x7C , 0xF1 , 0x7C , 0xF1 , +0xB9 , 0xF0 , 0xB9 , 0xF0 , 0xDC , 0xF5 , 0xDC , 0xF5 , 0xDF , 0xFC , 0xDF , 0xFC , 0xCD , 0x01 , 0xCD , 0x01 , +0x68 , 0x02 , 0x68 , 0x02 , 0x3B , 0x00 , 0x3B , 0x00 , 0x24 , 0xFE , 0x24 , 0xFE , 0xB7 , 0xFB , 0xB7 , 0xFB , +0x66 , 0xF9 , 0x66 , 0xF9 , 0x40 , 0xF7 , 0x40 , 0xF7 , 0xA6 , 0xF6 , 0xA6 , 0xF6 , 0x00 , 0xF8 , 0x00 , 0xF8 , +0x7A , 0xFA , 0x7A , 0xFA , 0xF1 , 0xFD , 0xF1 , 0xFD , 0x84 , 0xFF , 0x84 , 0xFF , 0x14 , 0xFF , 0x14 , 0xFF , +0xE9 , 0xFC , 0xE9 , 0xFC , 0xB3 , 0xFC , 0xB3 , 0xFC , 0x6A , 0x00 , 0x6A , 0x00 , 0x50 , 0x04 , 0x50 , 0x04 , +0x45 , 0x06 , 0x45 , 0x06 , 0x25 , 0x04 , 0x25 , 0x04 , 0x7B , 0x01 , 0x7B , 0x01 , 0x99 , 0x03 , 0x99 , 0x03 , +0x87 , 0x0B , 0x87 , 0x0B , 0x5D , 0x15 , 0x5D , 0x15 , 0xB3 , 0x18 , 0xB3 , 0x18 , 0x34 , 0x10 , 0x34 , 0x10 , +0x7E , 0xFF , 0x7E , 0xFF , 0xB7 , 0xEF , 0xB7 , 0xEF , 0x2C , 0xE9 , 0x2C , 0xE9 , 0x28 , 0xEE , 0x28 , 0xEE , +0x2A , 0xFA , 0x2A , 0xFA , 0x2F , 0x05 , 0x2F , 0x05 , 0x6F , 0x09 , 0x6F , 0x09 , 0x2E , 0x06 , 0x2E , 0x06 , +0x66 , 0x00 , 0x66 , 0x00 , 0xEC , 0xFA , 0xEC , 0xFA , 0x03 , 0xF7 , 0x03 , 0xF7 , 0x0C , 0xF5 , 0x0C , 0xF5 , +0xC4 , 0xF4 , 0xC4 , 0xF4 , 0x36 , 0xF6 , 0x36 , 0xF6 , 0x64 , 0xF9 , 0x64 , 0xF9 , 0x57 , 0xFE , 0x57 , 0xFE , +0x35 , 0x03 , 0x35 , 0x03 , 0x9B , 0x04 , 0x9B , 0x04 , 0x51 , 0x01 , 0x51 , 0x01 , 0xDE , 0xFA , 0xDE , 0xFA , +0xD7 , 0xF7 , 0xD7 , 0xF7 , 0x32 , 0xFB , 0x32 , 0xFB , 0xE4 , 0x01 , 0xE4 , 0x01 , 0xD1 , 0x06 , 0xD1 , 0x06 , +0xA5 , 0x05 , 0xA5 , 0x05 , 0xD7 , 0x02 , 0xD7 , 0x02 , 0x19 , 0x05 , 0x19 , 0x05 , 0x72 , 0x0E , 0x72 , 0x0E , +0xEB , 0x18 , 0xEB , 0x18 , 0x7F , 0x19 , 0x7F , 0x19 , 0xBE , 0x0B , 0xBE , 0x0B , 0xC9 , 0xF6 , 0xC9 , 0xF6 , +0x18 , 0xE7 , 0x18 , 0xE7 , 0x82 , 0xE5 , 0x82 , 0xE5 , 0x68 , 0xF1 , 0x68 , 0xF1 , 0x9A , 0x02 , 0x9A , 0x02 , +0xFD , 0x0E , 0xFD , 0x0E , 0x98 , 0x10 , 0x98 , 0x10 , 0x9B , 0x08 , 0x9B , 0x08 , 0xD9 , 0xFD , 0xD9 , 0xFD , +0x92 , 0xF4 , 0x92 , 0xF4 , 0x7D , 0xEF , 0x7D , 0xEF , 0xC3 , 0xEE , 0xC3 , 0xEE , 0xB0 , 0xF1 , 0xB0 , 0xF1 , +0xA3 , 0xF7 , 0xA3 , 0xF7 , 0xC9 , 0xFE , 0xC9 , 0xFE , 0x59 , 0x05 , 0x59 , 0x05 , 0x49 , 0x08 , 0x49 , 0x08 , +0xEB , 0x05 , 0xEB , 0x05 , 0x02 , 0xFF , 0x02 , 0xFF , 0x7D , 0xF7 , 0x7D , 0xF7 , 0x34 , 0xF5 , 0x34 , 0xF5 , +0x3D , 0xF9 , 0x3D , 0xF9 , 0x7B , 0x00 , 0x7B , 0x00 , 0xDB , 0x06 , 0xDB , 0x06 , 0x3D , 0x09 , 0x3D , 0x09 , +0x73 , 0x07 , 0x73 , 0x07 , 0xCC , 0x07 , 0xCC , 0x07 , 0xE9 , 0x0D , 0xE9 , 0x0D , 0x87 , 0x16 , 0x87 , 0x16 , +0x86 , 0x18 , 0x86 , 0x18 , 0xE3 , 0x0C , 0xE3 , 0x0C , 0x6E , 0xF8 , 0x6E , 0xF8 , 0x03 , 0xE7 , 0x03 , 0xE7 , +0x48 , 0xE3 , 0x48 , 0xE3 , 0xDE , 0xED , 0xDE , 0xED , 0xF2 , 0xFF , 0xF2 , 0xFF , 0x90 , 0x0F , 0x90 , 0x0F , +0xE4 , 0x15 , 0xE4 , 0x15 , 0x65 , 0x10 , 0x65 , 0x10 , 0x9A , 0x03 , 0x9A , 0x03 , 0xCB , 0xF5 , 0xCB , 0xF5 , +0xD0 , 0xEB , 0xD0 , 0xEB , 0x5E , 0xE9 , 0x5E , 0xE9 , 0x0A , 0xEE , 0x0A , 0xEE , 0xF1 , 0xF7 , 0xF1 , 0xF7 , +0xB9 , 0x02 , 0xB9 , 0x02 , 0x53 , 0x0A , 0x53 , 0x0A , 0x70 , 0x0C , 0x70 , 0x0C , 0x03 , 0x08 , 0x03 , 0x08 , +0x9A , 0xFF , 0x9A , 0xFF , 0xEC , 0xF6 , 0xEC , 0xF6 , 0xD9 , 0xF2 , 0xD9 , 0xF2 , 0x06 , 0xF6 , 0x06 , 0xF6 , +0x05 , 0xFE , 0x05 , 0xFE , 0x02 , 0x06 , 0x02 , 0x06 , 0xAF , 0x09 , 0xAF , 0x09 , 0xBE , 0x06 , 0xBE , 0x06 , +0xD1 , 0x02 , 0xD1 , 0x02 , 0xA5 , 0x06 , 0xA5 , 0x06 , 0x7A , 0x12 , 0x7A , 0x12 , 0x17 , 0x1D , 0x17 , 0x1D , +0xE3 , 0x19 , 0xE3 , 0x19 , 0xAF , 0x06 , 0xAF , 0x06 , 0x3D , 0xEF , 0x3D , 0xEF , 0xFC , 0xE1 , 0xFC , 0xE1 , +0xE5 , 0xE5 , 0xE5 , 0xE5 , 0xF8 , 0xF5 , 0xF8 , 0xF5 , 0x15 , 0x07 , 0x15 , 0x07 , 0xE3 , 0x10 , 0xE3 , 0x10 , +0x83 , 0x11 , 0x83 , 0x11 , 0x27 , 0x0B , 0x27 , 0x0B , 0xA2 , 0x00 , 0xA2 , 0x00 , 0x22 , 0xF6 , 0x22 , 0xF6 , +0x12 , 0xEE , 0x12 , 0xEE , 0xF4 , 0xEB , 0xF4 , 0xEB , 0xF7 , 0xF0 , 0xF7 , 0xF0 , 0x1B , 0xFB , 0x1B , 0xFB , +0xE9 , 0x05 , 0xE9 , 0x05 , 0x12 , 0x0C , 0x12 , 0x0C , 0x50 , 0x0B , 0x50 , 0x0B , 0x64 , 0x04 , 0x64 , 0x04 , +0x0F , 0xFB , 0x0F , 0xFB , 0xBB , 0xF4 , 0xBB , 0xF4 , 0x5E , 0xF4 , 0x5E , 0xF4 , 0xA7 , 0xF9 , 0xA7 , 0xF9 , +0x12 , 0x01 , 0x12 , 0x01 , 0x48 , 0x06 , 0x48 , 0x06 , 0x6E , 0x07 , 0x6E , 0x07 , 0x09 , 0x04 , 0x09 , 0x04 , +0x4A , 0xFE , 0x4A , 0xFE , 0x77 , 0xFD , 0x77 , 0xFD , 0xD9 , 0x06 , 0xD9 , 0x06 , 0xF0 , 0x15 , 0xF0 , 0x15 , +0x79 , 0x1E , 0x79 , 0x1E , 0x45 , 0x16 , 0x45 , 0x16 , 0x21 , 0x00 , 0x21 , 0x00 , 0x07 , 0xEA , 0x07 , 0xEA , +0x11 , 0xE2 , 0x11 , 0xE2 , 0xE1 , 0xEA , 0xE1 , 0xEA , 0x61 , 0xFC , 0x61 , 0xFC , 0x66 , 0x0B , 0x66 , 0x0B , +0xDA , 0x11 , 0xDA , 0x11 , 0x8C , 0x0F , 0x8C , 0x0F , 0xB8 , 0x08 , 0xB8 , 0x08 , 0xAA , 0xFF , 0xAA , 0xFF , +0x3C , 0xF6 , 0x3C , 0xF6 , 0x89 , 0xEF , 0x89 , 0xEF , 0x8E , 0xED , 0x8E , 0xED , 0xF9 , 0xF1 , 0xF9 , 0xF1 , +0xF6 , 0xFA , 0xF6 , 0xFA , 0x46 , 0x04 , 0x46 , 0x04 , 0x94 , 0x09 , 0x94 , 0x09 , 0x76 , 0x08 , 0x76 , 0x08 , +0x19 , 0x02 , 0x19 , 0x02 , 0x5E , 0xFA , 0x5E , 0xFA , 0x74 , 0xF5 , 0x74 , 0xF5 , 0xC5 , 0xF6 , 0xC5 , 0xF6 , +0xB0 , 0xFC , 0xB0 , 0xFC , 0xC2 , 0x02 , 0xC2 , 0x02 , 0x2D , 0x05 , 0x2D , 0x05 , 0x4B , 0x03 , 0x4B , 0x03 , +0x4C , 0x00 , 0x4C , 0x00 , 0xBC , 0xFD , 0xBC , 0xFD , 0x21 , 0xFC , 0x21 , 0xFC , 0x3A , 0xFF , 0x3A , 0xFF , +0x2C , 0x0A , 0x2C , 0x0A , 0x0C , 0x19 , 0x0C , 0x19 , 0xB6 , 0x20 , 0xB6 , 0x20 , 0x6F , 0x17 , 0x6F , 0x17 , +0x82 , 0xFF , 0x82 , 0xFF , 0x70 , 0xE7 , 0x70 , 0xE7 , 0xB2 , 0xDE , 0xB2 , 0xDE , 0x96 , 0xE8 , 0x96 , 0xE8 , +0x2F , 0xFC , 0x2F , 0xFC , 0x0F , 0x0D , 0x0F , 0x0D , 0xFB , 0x13 , 0xFB , 0x13 , 0xE7 , 0x10 , 0xE7 , 0x10 , +0x98 , 0x08 , 0x98 , 0x08 , 0x8E , 0xFE , 0x8E , 0xFE , 0x1A , 0xF5 , 0x1A , 0xF5 , 0x1B , 0xEF , 0x1B , 0xEF , +0xD8 , 0xED , 0xD8 , 0xED , 0xFA , 0xF2 , 0xFA , 0xF2 , 0xF1 , 0xFB , 0xF1 , 0xFB , 0xF4 , 0x04 , 0xF4 , 0x04 , +0x15 , 0x09 , 0x15 , 0x09 , 0xCC , 0x06 , 0xCC , 0x06 , 0x4B , 0x00 , 0x4B , 0x00 , 0x16 , 0xF9 , 0x16 , 0xF9 , +0xD6 , 0xF5 , 0xD6 , 0xF5 , 0x95 , 0xF7 , 0x95 , 0xF7 , 0x9C , 0xFD , 0x9C , 0xFD , 0xFE , 0x02 , 0xFE , 0x02 , +0x13 , 0x04 , 0x13 , 0x04 , 0xD8 , 0x00 , 0xD8 , 0x00 , 0x4F , 0xFC , 0x4F , 0xFC , 0x89 , 0xFB , 0x89 , 0xFB , +0x9B , 0xFE , 0x9B , 0xFE , 0x54 , 0x02 , 0x54 , 0x02 , 0xB4 , 0x06 , 0xB4 , 0x06 , 0x72 , 0x0D , 0x72 , 0x0D , +0x6C , 0x16 , 0x6C , 0x16 , 0x3E , 0x1B , 0x3E , 0x1B , 0xEE , 0x13 , 0xEE , 0x13 , 0x56 , 0x00 , 0x56 , 0x00 , +0x82 , 0xEA , 0x82 , 0xEA , 0x8A , 0xE0 , 0x8A , 0xE0 , 0xDE , 0xE7 , 0xDE , 0xE7 , 0x41 , 0xFA , 0x41 , 0xFA , +0x61 , 0x0B , 0x61 , 0x0B , 0x2B , 0x12 , 0x2B , 0x12 , 0x25 , 0x0E , 0x25 , 0x0E , 0x5F , 0x05 , 0x5F , 0x05 , +0x34 , 0xFD , 0x34 , 0xFD , 0x75 , 0xF7 , 0x75 , 0xF7 , 0x35 , 0xF4 , 0x35 , 0xF4 , 0xCD , 0xF1 , 0xCD , 0xF1 , +0xFA , 0xF1 , 0xFA , 0xF1 , 0x98 , 0xF6 , 0x98 , 0xF6 , 0x31 , 0xFF , 0x31 , 0xFF , 0x3E , 0x07 , 0x3E , 0x07 , +0xA4 , 0x09 , 0xA4 , 0x09 , 0xFC , 0x05 , 0xFC , 0x05 , 0xCD , 0xFE , 0xCD , 0xFE , 0x0A , 0xF9 , 0x0A , 0xF9 , +0xDB , 0xF7 , 0xDB , 0xF7 , 0x53 , 0xFB , 0x53 , 0xFB , 0x9D , 0x00 , 0x9D , 0x00 , 0xBF , 0x03 , 0xBF , 0x03 , +0x66 , 0x02 , 0x66 , 0x02 , 0x0A , 0xFF , 0x0A , 0xFF , 0xE4 , 0xFC , 0xE4 , 0xFC , 0x7E , 0xFE , 0x7E , 0xFE , +0xF8 , 0x02 , 0xF8 , 0x02 , 0x96 , 0x05 , 0x96 , 0x05 , 0x13 , 0x06 , 0x13 , 0x06 , 0x03 , 0x08 , 0x03 , 0x08 , +0x1A , 0x0E , 0x1A , 0x0E , 0x32 , 0x15 , 0x32 , 0x15 , 0x82 , 0x14 , 0x82 , 0x14 , 0xE5 , 0x07 , 0xE5 , 0x07 , +0x89 , 0xF4 , 0x89 , 0xF4 , 0xAC , 0xE6 , 0xAC , 0xE6 , 0x65 , 0xE7 , 0x65 , 0xE7 , 0xC8 , 0xF4 , 0xC8 , 0xF4 , +0x33 , 0x05 , 0x33 , 0x05 , 0x2F , 0x0E , 0x2F , 0x0E , 0x03 , 0x0C , 0x03 , 0x0C , 0x2D , 0x03 , 0x2D , 0x03 , +0xED , 0xFA , 0xED , 0xFA , 0x14 , 0xF7 , 0x14 , 0xF7 , 0x03 , 0xF8 , 0x03 , 0xF8 , 0x5D , 0xF9 , 0x5D , 0xF9 , +0x9F , 0xF8 , 0x9F , 0xF8 , 0x17 , 0xF8 , 0x17 , 0xF8 , 0xE7 , 0xFA , 0xE7 , 0xFA , 0xD1 , 0x00 , 0xD1 , 0x00 , +0x0C , 0x05 , 0x0C , 0x05 , 0xCC , 0x04 , 0xCC , 0x04 , 0xBA , 0x00 , 0xBA , 0x00 , 0x91 , 0xFC , 0x91 , 0xFC , +0x80 , 0xFB , 0x80 , 0xFB , 0x18 , 0xFE , 0x18 , 0xFE , 0xF2 , 0x01 , 0xF2 , 0x01 , 0xD5 , 0x03 , 0xD5 , 0x03 , +0xF0 , 0x02 , 0xF0 , 0x02 , 0x4A , 0x00 , 0x4A , 0x00 , 0xBA , 0xFD , 0xBA , 0xFD , 0x6F , 0xFD , 0x6F , 0xFD , +0x9E , 0xFF , 0x9E , 0xFF , 0x5F , 0x03 , 0x5F , 0x03 , 0xF0 , 0x05 , 0xF0 , 0x05 , 0xC3 , 0x04 , 0xC3 , 0x04 , +0xB5 , 0x02 , 0xB5 , 0x02 , 0xBB , 0x04 , 0xBB , 0x04 , 0x01 , 0x0C , 0x01 , 0x0C , 0x03 , 0x13 , 0x03 , 0x13 , +0x31 , 0x11 , 0x31 , 0x11 , 0x8F , 0x04 , 0x8F , 0x04 , 0xF4 , 0xF3 , 0xF4 , 0xF3 , 0x61 , 0xEA , 0x61 , 0xEA , +0xC2 , 0xED , 0xC2 , 0xED , 0xD9 , 0xF9 , 0xD9 , 0xF9 , 0x45 , 0x06 , 0x45 , 0x06 , 0x69 , 0x0B , 0x69 , 0x0B , +0xE9 , 0x07 , 0xE9 , 0x07 , 0x85 , 0x00 , 0x85 , 0x00 , 0xA0 , 0xFA , 0xA0 , 0xFA , 0xB3 , 0xF8 , 0xB3 , 0xF8 , +0xA2 , 0xFA , 0xA2 , 0xFA , 0x7D , 0xFC , 0x7D , 0xFC , 0x7C , 0xFC , 0x7C , 0xFC , 0x13 , 0xFC , 0x13 , 0xFC , +0xF2 , 0xFC , 0xF2 , 0xFC , 0x2F , 0xFF , 0x2F , 0xFF , 0x71 , 0x00 , 0x71 , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , +0xF5 , 0xFE , 0xF5 , 0xFE , 0x34 , 0xFE , 0x34 , 0xFE , 0xCC , 0xFE , 0xCC , 0xFE , 0xA6 , 0x00 , 0xA6 , 0x00 , +0x3F , 0x02 , 0x3F , 0x02 , 0x12 , 0x02 , 0x12 , 0x02 , 0xD2 , 0xFF , 0xD2 , 0xFF , 0x3B , 0xFD , 0x3B , 0xFD , +0x37 , 0xFC , 0x37 , 0xFC , 0x18 , 0xFD , 0x18 , 0xFD , 0xC6 , 0xFF , 0xC6 , 0xFF , 0xEF , 0x02 , 0xEF , 0x02 , +0xB3 , 0x05 , 0xB3 , 0x05 , 0x39 , 0x06 , 0x39 , 0x06 , 0x58 , 0x03 , 0x58 , 0x03 , 0x58 , 0x00 , 0x58 , 0x00 , +0x2F , 0x02 , 0x2F , 0x02 , 0xCD , 0x09 , 0xCD , 0x09 , 0x90 , 0x11 , 0x90 , 0x11 , 0x29 , 0x11 , 0x29 , 0x11 , +0xA4 , 0x06 , 0xA4 , 0x06 , 0x38 , 0xF8 , 0x38 , 0xF8 , 0x89 , 0xEF , 0x89 , 0xEF , 0xBD , 0xF1 , 0xBD , 0xF1 , +0x93 , 0xFA , 0x93 , 0xFA , 0x7D , 0x03 , 0x7D , 0x03 , 0x02 , 0x07 , 0x02 , 0x07 , 0x8B , 0x04 , 0x8B , 0x04 , +0x1B , 0x00 , 0x1B , 0x00 , 0xD3 , 0xFC , 0xD3 , 0xFC , 0x7D , 0xFB , 0x7D , 0xFB , 0x0B , 0xFC , 0x0B , 0xFC , +0x58 , 0xFC , 0x58 , 0xFC , 0x28 , 0xFC , 0x28 , 0xFC , 0xC0 , 0xFC , 0xC0 , 0xFC , 0x34 , 0xFE , 0x34 , 0xFE , +0x97 , 0xFF , 0x97 , 0xFF , 0x34 , 0xFF , 0x34 , 0xFF , 0xC6 , 0xFD , 0xC6 , 0xFD , 0xA5 , 0xFC , 0xA5 , 0xFC , +0x0A , 0xFD , 0x0A , 0xFD , 0xDC , 0xFE , 0xDC , 0xFE , 0x2A , 0x01 , 0x2A , 0x01 , 0x3A , 0x02 , 0x3A , 0x02 , +0x46 , 0x01 , 0x46 , 0x01 , 0xF3 , 0xFE , 0xF3 , 0xFE , 0xC5 , 0xFC , 0xC5 , 0xFC , 0x6D , 0xFC , 0x6D , 0xFC , +0xDF , 0xFD , 0xDF , 0xFD , 0x0A , 0x00 , 0x0A , 0x00 , 0x19 , 0x01 , 0x19 , 0x01 , 0x13 , 0x01 , 0x13 , 0x01 , +0x4D , 0x01 , 0x4D , 0x01 , 0x97 , 0x02 , 0x97 , 0x02 , 0x2C , 0x04 , 0x2C , 0x04 , 0x5F , 0x03 , 0x5F , 0x03 , +0x1F , 0x01 , 0x1F , 0x01 , 0xA1 , 0x01 , 0xA1 , 0x01 , 0xB9 , 0x07 , 0xB9 , 0x07 , 0x2E , 0x10 , 0x2E , 0x10 , +0x20 , 0x13 , 0x20 , 0x13 , 0xED , 0x0B , 0xED , 0x0B , 0x5A , 0xFE , 0x5A , 0xFE , 0xB1 , 0xF2 , 0xB1 , 0xF2 , +0x78 , 0xF0 , 0x78 , 0xF0 , 0xA4 , 0xF6 , 0xA4 , 0xF6 , 0x66 , 0xFF , 0x66 , 0xFF , 0x60 , 0x05 , 0x60 , 0x05 , +0x3A , 0x05 , 0x3A , 0x05 , 0xB8 , 0x01 , 0xB8 , 0x01 , 0x45 , 0xFE , 0x45 , 0xFE , 0x02 , 0xFC , 0x02 , 0xFC , +0x60 , 0xFB , 0x60 , 0xFB , 0x44 , 0xFB , 0x44 , 0xFB , 0xED , 0xFA , 0xED , 0xFA , 0xD2 , 0xFB , 0xD2 , 0xFB , +0x1E , 0xFE , 0x1E , 0xFE , 0x6F , 0x01 , 0x6F , 0x01 , 0xEB , 0x02 , 0xEB , 0x02 , 0x19 , 0x01 , 0x19 , 0x01 , +0xAF , 0xFC , 0xAF , 0xFC , 0xA5 , 0xF8 , 0xA5 , 0xF8 , 0x0C , 0xF8 , 0x0C , 0xF8 , 0xAE , 0xFB , 0xAE , 0xFB , +0x5A , 0x01 , 0x5A , 0x01 , 0xD0 , 0x04 , 0xD0 , 0x04 , 0x09 , 0x04 , 0x09 , 0x04 , 0x45 , 0x00 , 0x45 , 0x00 , +0xCC , 0xFC , 0xCC , 0xFC , 0x5D , 0xFC , 0x5D , 0xFC , 0x7D , 0xFE , 0x7D , 0xFE , 0xE3 , 0x00 , 0xE3 , 0x00 , +0x5A , 0x01 , 0x5A , 0x01 , 0x7F , 0x00 , 0x7F , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , 0x5E , 0x02 , 0x5E , 0x02 , +0x0E , 0x05 , 0x0E , 0x05 , 0xBD , 0x04 , 0xBD , 0x04 , 0x1A , 0x02 , 0x1A , 0x02 , 0xB0 , 0x01 , 0xB0 , 0x01 , +0x37 , 0x07 , 0x37 , 0x07 , 0x96 , 0x0F , 0x96 , 0x0F , 0xCE , 0x12 , 0xCE , 0x12 , 0xB6 , 0x0B , 0xB6 , 0x0B , +0x28 , 0xFE , 0x28 , 0xFE , 0xB7 , 0xF2 , 0xB7 , 0xF2 , 0xEF , 0xF0 , 0xEF , 0xF0 , 0x44 , 0xF7 , 0x44 , 0xF7 , +0x66 , 0xFF , 0x66 , 0xFF , 0x52 , 0x04 , 0x52 , 0x04 , 0xFC , 0x02 , 0xFC , 0x02 , 0x40 , 0xFF , 0x40 , 0xFF , +0x7B , 0xFC , 0x7B , 0xFC , 0x9D , 0xFB , 0x9D , 0xFB , 0x58 , 0xFC , 0x58 , 0xFC , 0xE5 , 0xFC , 0xE5 , 0xFC , +0x72 , 0xFC , 0x72 , 0xFC , 0xAC , 0xFC , 0xAC , 0xFC , 0xE3 , 0xFD , 0xE3 , 0xFD , 0x2F , 0x00 , 0x2F , 0x00 , +0x4C , 0x01 , 0x4C , 0x01 , 0x02 , 0x00 , 0x02 , 0x00 , 0x02 , 0xFD , 0x02 , 0xFD , 0xBE , 0xFA , 0xBE , 0xFA , +0x99 , 0xFB , 0x99 , 0xFB , 0x4F , 0xFF , 0x4F , 0xFF , 0xA2 , 0x03 , 0xA2 , 0x03 , 0x43 , 0x04 , 0x43 , 0x04 , +0x10 , 0x02 , 0x10 , 0x02 , 0x6A , 0xFF , 0x6A , 0xFF , 0xE6 , 0xFE , 0xE6 , 0xFE , 0x18 , 0x00 , 0x18 , 0x00 , +0x49 , 0x01 , 0x49 , 0x01 , 0x15 , 0x01 , 0x15 , 0x01 , 0xD0 , 0xFF , 0xD0 , 0xFF , 0xDB , 0xFE , 0xDB , 0xFE , +0x35 , 0xFF , 0x35 , 0xFF , 0x7B , 0x00 , 0x7B , 0x00 , 0xF7 , 0x01 , 0xF7 , 0x01 , 0x42 , 0x03 , 0x42 , 0x03 , +0xF4 , 0x03 , 0xF4 , 0x03 , 0x97 , 0x04 , 0x97 , 0x04 , 0x48 , 0x03 , 0x48 , 0x03 , 0x3D , 0x01 , 0x3D , 0x01 , +0x5F , 0x01 , 0x5F , 0x01 , 0x4F , 0x06 , 0x4F , 0x06 , 0x31 , 0x0D , 0x31 , 0x0D , 0xEC , 0x0F , 0xEC , 0x0F , +0x33 , 0x0A , 0x33 , 0x0A , 0x34 , 0xFF , 0x34 , 0xFF , 0xC5 , 0xF5 , 0xC5 , 0xF5 , 0xA4 , 0xF3 , 0xA4 , 0xF3 , +0xB7 , 0xF7 , 0xB7 , 0xF7 , 0x36 , 0xFD , 0x36 , 0xFD , 0xD3 , 0x00 , 0xD3 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , +0x7E , 0xFE , 0x7E , 0xFE , 0xFF , 0xFC , 0xFF , 0xFC , 0x92 , 0xFC , 0x92 , 0xFC , 0x2F , 0xFD , 0x2F , 0xFD , +0xC1 , 0xFD , 0xC1 , 0xFD , 0x4D , 0xFD , 0x4D , 0xFD , 0x32 , 0xFD , 0x32 , 0xFD , 0x73 , 0xFD , 0x73 , 0xFD , +0xAC , 0xFE , 0xAC , 0xFE , 0x50 , 0xFF , 0x50 , 0xFF , 0xA7 , 0xFE , 0xA7 , 0xFE , 0x92 , 0xFD , 0x92 , 0xFD , +0xF8 , 0xFC , 0xF8 , 0xFC , 0xE6 , 0xFD , 0xE6 , 0xFD , 0xFA , 0xFF , 0xFA , 0xFF , 0x15 , 0x02 , 0x15 , 0x02 , +0x83 , 0x03 , 0x83 , 0x03 , 0x62 , 0x02 , 0x62 , 0x02 , 0x71 , 0xFF , 0x71 , 0xFF , 0x5F , 0xFD , 0x5F , 0xFD , +0xC6 , 0xFD , 0xC6 , 0xFD , 0x26 , 0x00 , 0x26 , 0x00 , 0xE4 , 0x01 , 0xE4 , 0x01 , 0x46 , 0x02 , 0x46 , 0x02 , +0xE5 , 0x00 , 0xE5 , 0x00 , 0x67 , 0xFF , 0x67 , 0xFF , 0x8D , 0xFE , 0x8D , 0xFE , 0x43 , 0xFF , 0x43 , 0xFF , +0xA2 , 0x00 , 0xA2 , 0x00 , 0x70 , 0x02 , 0x70 , 0x02 , 0x8B , 0x03 , 0x8B , 0x03 , 0x36 , 0x04 , 0x36 , 0x04 , +0xB6 , 0x03 , 0xB6 , 0x03 , 0xA7 , 0x01 , 0xA7 , 0x01 , 0x8C , 0x00 , 0x8C , 0x00 , 0x98 , 0x03 , 0x98 , 0x03 , +0x33 , 0x0A , 0x33 , 0x0A , 0xFB , 0x0E , 0xFB , 0x0E , 0xFB , 0x0C , 0xFB , 0x0C , 0x10 , 0x04 , 0x10 , 0x04 , +0x7D , 0xFA , 0x7D , 0xFA , 0x6D , 0xF5 , 0x6D , 0xF5 , 0xB5 , 0xF6 , 0xB5 , 0xF6 , 0x71 , 0xFA , 0x71 , 0xFA , +0xE9 , 0xFD , 0xE9 , 0xFD , 0x1C , 0xFF , 0x1C , 0xFF , 0x67 , 0xFE , 0x67 , 0xFE , 0x8D , 0xFD , 0x8D , 0xFD , +0xD7 , 0xFC , 0xD7 , 0xFC , 0xBD , 0xFC , 0xBD , 0xFC , 0xD2 , 0xFC , 0xD2 , 0xFC , 0x0A , 0xFD , 0x0A , 0xFD , +0xF9 , 0xFD , 0xF9 , 0xFD , 0x62 , 0xFE , 0x62 , 0xFE , 0xA4 , 0xFE , 0xA4 , 0xFE , 0x73 , 0xFE , 0x73 , 0xFE , +0x59 , 0xFE , 0x59 , 0xFE , 0xAA , 0xFE , 0xAA , 0xFE , 0xB6 , 0xFE , 0xB6 , 0xFE , 0x44 , 0xFF , 0x44 , 0xFF , +0xB4 , 0xFF , 0xB4 , 0xFF , 0x45 , 0x00 , 0x45 , 0x00 , 0xB2 , 0x00 , 0xB2 , 0x00 , 0x11 , 0x01 , 0x11 , 0x01 , +0x90 , 0x01 , 0x90 , 0x01 , 0xCD , 0x01 , 0xCD , 0x01 , 0xC6 , 0x00 , 0xC6 , 0x00 , 0x5D , 0xFF , 0x5D , 0xFF , +0x3F , 0xFE , 0x3F , 0xFE , 0x59 , 0xFE , 0x59 , 0xFE , 0x54 , 0xFF , 0x54 , 0xFF , 0xD2 , 0x00 , 0xD2 , 0x00 , +0xD8 , 0x01 , 0xD8 , 0x01 , 0xC0 , 0x01 , 0xC0 , 0x01 , 0xB2 , 0x00 , 0xB2 , 0x00 , 0xA0 , 0xFF , 0xA0 , 0xFF , +0x66 , 0xFF , 0x66 , 0xFF , 0x22 , 0x00 , 0x22 , 0x00 , 0x6B , 0x01 , 0x6B , 0x01 , 0x6F , 0x02 , 0x6F , 0x02 , +0xE7 , 0x02 , 0xE7 , 0x02 , 0x06 , 0x02 , 0x06 , 0x02 , 0x0F , 0x01 , 0x0F , 0x01 , 0x19 , 0x02 , 0x19 , 0x02 , +0x0A , 0x06 , 0x0A , 0x06 , 0xC5 , 0x09 , 0xC5 , 0x09 , 0x13 , 0x0A , 0x13 , 0x0A , 0x6A , 0x05 , 0x6A , 0x05 , +0xF9 , 0xFE , 0xF9 , 0xFE , 0x96 , 0xFA , 0x96 , 0xFA , 0xD7 , 0xF9 , 0xD7 , 0xF9 , 0x33 , 0xFB , 0x33 , 0xFB , +0x66 , 0xFC , 0x66 , 0xFC , 0x36 , 0xFD , 0x36 , 0xFD , 0xB7 , 0xFD , 0xB7 , 0xFD , 0xAA , 0xFE , 0xAA , 0xFE , +0x56 , 0xFF , 0x56 , 0xFF , 0x14 , 0xFF , 0x14 , 0xFF , 0x3F , 0xFE , 0x3F , 0xFE , 0x60 , 0xFD , 0x60 , 0xFD , +0x92 , 0xFD , 0x92 , 0xFD , 0x79 , 0xFE , 0x79 , 0xFE , 0x04 , 0xFF , 0x04 , 0xFF , 0x37 , 0xFF , 0x37 , 0xFF , +0xE6 , 0xFE , 0xE6 , 0xFE , 0x02 , 0xFF , 0x02 , 0xFF , 0x2A , 0xFF , 0x2A , 0xFF , 0x7D , 0xFF , 0x7D , 0xFF , +0xDD , 0xFF , 0xDD , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , 0x9F , 0x00 , 0x9F , 0x00 , +0xDF , 0x00 , 0xDF , 0x00 , 0x25 , 0x01 , 0x25 , 0x01 , 0xDF , 0x00 , 0xDF , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , +0xC8 , 0xFF , 0xC8 , 0xFF , 0x94 , 0xFF , 0x94 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , +0x3E , 0x00 , 0x3E , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0x9F , 0xFF , 0x9F , 0xFF , 0x7A , 0xFF , 0x7A , 0xFF , +0xEC , 0xFF , 0xEC , 0xFF , 0xA4 , 0x00 , 0xA4 , 0x00 , 0x89 , 0x01 , 0x89 , 0x01 , 0xE5 , 0x01 , 0xE5 , 0x01 , +0xF3 , 0x01 , 0xF3 , 0x01 , 0x5D , 0x01 , 0x5D , 0x01 , 0x66 , 0x00 , 0x66 , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , +0x13 , 0x02 , 0x13 , 0x02 , 0x09 , 0x06 , 0x09 , 0x06 , 0xD8 , 0x08 , 0xD8 , 0x08 , 0x4A , 0x08 , 0x4A , 0x08 , +0xDA , 0x03 , 0xDA , 0x03 , 0xD0 , 0xFE , 0xD0 , 0xFE , 0xC1 , 0xFB , 0xC1 , 0xFB , 0x2F , 0xFB , 0x2F , 0xFB , +0xAF , 0xFB , 0xAF , 0xFB , 0x1F , 0xFC , 0x1F , 0xFC , 0xFF , 0xFC , 0xFF , 0xFC , 0x4C , 0xFE , 0x4C , 0xFE , +0xA6 , 0xFF , 0xA6 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xB7 , 0xFE , 0xB7 , 0xFE , 0x3D , 0xFD , 0x3D , 0xFD , +0x58 , 0xFC , 0x58 , 0xFC , 0x07 , 0xFD , 0x07 , 0xFD , 0x85 , 0xFE , 0x85 , 0xFE , 0x34 , 0xFF , 0x34 , 0xFF , +0x3A , 0xFF , 0x3A , 0xFF , 0xC3 , 0xFE , 0xC3 , 0xFE , 0xF2 , 0xFE , 0xF2 , 0xFE , 0x60 , 0xFF , 0x60 , 0xFF , +0xAF , 0xFF , 0xAF , 0xFF , 0xFB , 0xFF , 0xFB , 0xFF , 0x1E , 0x00 , 0x1E , 0x00 , 0x86 , 0x00 , 0x86 , 0x00 , +0xF1 , 0x00 , 0xF1 , 0x00 , 0xF8 , 0x00 , 0xF8 , 0x00 , 0xDF , 0x00 , 0xDF , 0x00 , 0x3E , 0x00 , 0x3E , 0x00 , +0xBD , 0xFF , 0xBD , 0xFF , 0xD1 , 0xFF , 0xD1 , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x61 , 0x00 , 0x61 , 0x00 , +0x6F , 0x00 , 0x6F , 0x00 , 0x30 , 0x00 , 0x30 , 0x00 , 0xCF , 0xFF , 0xCF , 0xFF , 0x6F , 0xFF , 0x6F , 0xFF , +0xAF , 0xFF , 0xAF , 0xFF , 0x56 , 0x00 , 0x56 , 0x00 , 0x41 , 0x01 , 0x41 , 0x01 , 0x21 , 0x02 , 0x21 , 0x02 , +0x91 , 0x02 , 0x91 , 0x02 , 0x8F , 0x02 , 0x8F , 0x02 , 0x94 , 0x01 , 0x94 , 0x01 , 0x8F , 0x00 , 0x8F , 0x00 , +0x2E , 0x01 , 0x2E , 0x01 , 0x2E , 0x05 , 0x2E , 0x05 , 0x8C , 0x09 , 0x8C , 0x09 , 0x94 , 0x0A , 0x94 , 0x0A , +0xB6 , 0x06 , 0xB6 , 0x06 , 0x51 , 0x00 , 0x51 , 0x00 , 0xDF , 0xFB , 0xDF , 0xFB , 0x62 , 0xFA , 0x62 , 0xFA , +0xE9 , 0xFA , 0xE9 , 0xFA , 0x51 , 0xFB , 0x51 , 0xFB , 0xD0 , 0xFB , 0xD0 , 0xFB , 0x26 , 0xFD , 0x26 , 0xFD , +0xCF , 0xFE , 0xCF , 0xFE , 0xB0 , 0xFF , 0xB0 , 0xFF , 0xAB , 0xFE , 0xAB , 0xFE , 0xC5 , 0xFC , 0xC5 , 0xFC , +0xD3 , 0xFB , 0xD3 , 0xFB , 0x43 , 0xFC , 0x43 , 0xFC , 0x38 , 0xFE , 0x38 , 0xFE , 0x31 , 0xFF , 0x31 , 0xFF , +0xDA , 0xFE , 0xDA , 0xFE , 0x23 , 0xFE , 0x23 , 0xFE , 0x3C , 0xFE , 0x3C , 0xFE , 0x87 , 0xFF , 0x87 , 0xFF , +0x46 , 0x00 , 0x46 , 0x00 , 0x88 , 0x00 , 0x88 , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , 0x92 , 0x00 , 0x92 , 0x00 , +0x18 , 0x01 , 0x18 , 0x01 , 0x4E , 0x01 , 0x4E , 0x01 , 0xEB , 0x00 , 0xEB , 0x00 , 0x5B , 0x00 , 0x5B , 0x00 , +0xD2 , 0xFF , 0xD2 , 0xFF , 0x10 , 0x00 , 0x10 , 0x00 , 0x51 , 0x00 , 0x51 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , +0xDD , 0xFF , 0xDD , 0xFF , 0xBF , 0xFF , 0xBF , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , +0xB4 , 0xFF , 0xB4 , 0xFF , 0x08 , 0x00 , 0x08 , 0x00 , 0xC3 , 0x00 , 0xC3 , 0x00 , 0xD9 , 0x01 , 0xD9 , 0x01 , +0x90 , 0x02 , 0x90 , 0x02 , 0xD8 , 0x02 , 0xD8 , 0x02 , 0x50 , 0x02 , 0x50 , 0x02 , 0x26 , 0x01 , 0x26 , 0x01 , +0x69 , 0x00 , 0x69 , 0x00 , 0x79 , 0x02 , 0x79 , 0x02 , 0x30 , 0x07 , 0x30 , 0x07 , 0x30 , 0x0A , 0x30 , 0x0A , +0xBC , 0x08 , 0xBC , 0x08 , 0xDB , 0x02 , 0xDB , 0x02 , 0x42 , 0xFD , 0x42 , 0xFD , 0xBE , 0xFA , 0xBE , 0xFA , +0xB9 , 0xFA , 0xB9 , 0xFA , 0x0E , 0xFB , 0x0E , 0xFB , 0xFF , 0xFA , 0xFF , 0xFA , 0x29 , 0xFC , 0x29 , 0xFC , +0x5D , 0xFE , 0x5D , 0xFE , 0x12 , 0x00 , 0x12 , 0x00 , 0xB6 , 0xFF , 0xB6 , 0xFF , 0x7C , 0xFD , 0x7C , 0xFD , +0x11 , 0xFC , 0x11 , 0xFC , 0x89 , 0xFC , 0x89 , 0xFC , 0x67 , 0xFE , 0x67 , 0xFE , 0xC7 , 0xFF , 0xC7 , 0xFF , +0xD8 , 0xFE , 0xD8 , 0xFE , 0xA3 , 0xFD , 0xA3 , 0xFD , 0x53 , 0xFD , 0x53 , 0xFD , 0xC3 , 0xFE , 0xC3 , 0xFE , +0x5A , 0x00 , 0x5A , 0x00 , 0x58 , 0x00 , 0x58 , 0x00 , 0xDC , 0xFF , 0xDC , 0xFF , 0xC9 , 0xFF , 0xC9 , 0xFF , +0x8C , 0x00 , 0x8C , 0x00 , 0x22 , 0x01 , 0x22 , 0x01 , 0xB2 , 0x00 , 0xB2 , 0x00 , 0xBC , 0xFF , 0xBC , 0xFF , +0xA0 , 0xFF , 0xA0 , 0xFF , 0x60 , 0x00 , 0x60 , 0x00 , 0x3F , 0x01 , 0x3F , 0x01 , 0x0C , 0x01 , 0x0C , 0x01 , +0xE3 , 0xFF , 0xE3 , 0xFF , 0x00 , 0xFF , 0x00 , 0xFF , 0x0E , 0xFF , 0x0E , 0xFF , 0xC4 , 0xFF , 0xC4 , 0xFF , +0x0C , 0x00 , 0x0C , 0x00 , 0xCC , 0xFF , 0xCC , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , 0xA5 , 0x00 , 0xA5 , 0x00 , +0x04 , 0x02 , 0x04 , 0x02 , 0xC0 , 0x02 , 0xC0 , 0x02 , 0x99 , 0x02 , 0x99 , 0x02 , 0xB3 , 0x01 , 0xB3 , 0x01 , +0xBD , 0x00 , 0xBD , 0x00 , 0x60 , 0x00 , 0x60 , 0x00 , 0x4D , 0x02 , 0x4D , 0x02 , 0x04 , 0x06 , 0x04 , 0x06 , +0x3B , 0x08 , 0x3B , 0x08 , 0x15 , 0x07 , 0x15 , 0x07 , 0xA9 , 0x02 , 0xA9 , 0x02 , 0x7E , 0xFE , 0x7E , 0xFE , +0x79 , 0xFC , 0x79 , 0xFC , 0xC4 , 0xFB , 0xC4 , 0xFB , 0x10 , 0xFB , 0x10 , 0xFB , 0xD2 , 0xFA , 0xD2 , 0xFA , +0x94 , 0xFC , 0x94 , 0xFC , 0x4C , 0xFF , 0x4C , 0xFF , 0x8F , 0x00 , 0x8F , 0x00 , 0x2E , 0xFF , 0x2E , 0xFF , +0xD8 , 0xFC , 0xD8 , 0xFC , 0x5C , 0xFC , 0x5C , 0xFC , 0xA1 , 0xFD , 0xA1 , 0xFD , 0x03 , 0xFF , 0x03 , 0xFF , +0x92 , 0xFE , 0x92 , 0xFE , 0x42 , 0xFD , 0x42 , 0xFD , 0x4D , 0xFD , 0x4D , 0xFD , 0xA4 , 0xFE , 0xA4 , 0xFE , +0x24 , 0x00 , 0x24 , 0x00 , 0x1E , 0x00 , 0x1E , 0x00 , 0x73 , 0xFF , 0x73 , 0xFF , 0x8B , 0xFF , 0x8B , 0xFF , +0x75 , 0x00 , 0x75 , 0x00 , 0xFD , 0x00 , 0xFD , 0x00 , 0x49 , 0x00 , 0x49 , 0x00 , 0x09 , 0xFF , 0x09 , 0xFF , +0xCF , 0xFE , 0xCF , 0xFE , 0xE3 , 0xFF , 0xE3 , 0xFF , 0xF8 , 0x00 , 0xF8 , 0x00 , 0x18 , 0x01 , 0x18 , 0x01 , +0x37 , 0x00 , 0x37 , 0x00 , 0xA9 , 0xFF , 0xA9 , 0xFF , 0xC0 , 0xFF , 0xC0 , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xD0 , 0xFF , 0xD0 , 0xFF , 0x59 , 0xFF , 0x59 , 0xFF , 0x5B , 0xFF , 0x5B , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , +0x36 , 0x01 , 0x36 , 0x01 , 0xFF , 0x01 , 0xFF , 0x01 , 0x46 , 0x02 , 0x46 , 0x02 , 0x4E , 0x02 , 0x4E , 0x02 , +0xEB , 0x01 , 0xEB , 0x01 , 0x40 , 0x01 , 0x40 , 0x01 , 0x2C , 0x01 , 0x2C , 0x01 , 0x65 , 0x03 , 0x65 , 0x03 , +0x42 , 0x06 , 0x42 , 0x06 , 0xE1 , 0x06 , 0xE1 , 0x06 , 0x81 , 0x04 , 0x81 , 0x04 , 0x08 , 0x01 , 0x08 , 0x01 , +0x3D , 0xFF , 0x3D , 0xFF , 0x43 , 0xFE , 0x43 , 0xFE , 0xA6 , 0xFC , 0xA6 , 0xFC , 0xE2 , 0xFA , 0xE2 , 0xFA , +0x31 , 0xFB , 0x31 , 0xFB , 0x9F , 0xFD , 0x9F , 0xFD , 0x87 , 0xFF , 0x87 , 0xFF , 0x24 , 0xFF , 0x24 , 0xFF , +0x6E , 0xFD , 0x6E , 0xFD , 0x23 , 0xFD , 0x23 , 0xFD , 0x3B , 0xFE , 0x3B , 0xFE , 0x17 , 0xFF , 0x17 , 0xFF , +0x57 , 0xFE , 0x57 , 0xFE , 0x2C , 0xFD , 0x2C , 0xFD , 0x89 , 0xFD , 0x89 , 0xFD , 0xDD , 0xFE , 0xDD , 0xFE , +0xD8 , 0xFF , 0xD8 , 0xFF , 0xB3 , 0xFF , 0xB3 , 0xFF , 0x80 , 0xFF , 0x80 , 0xFF , 0x1D , 0x00 , 0x1D , 0x00 , +0xED , 0x00 , 0xED , 0x00 , 0xDB , 0x00 , 0xDB , 0x00 , 0xDB , 0xFF , 0xDB , 0xFF , 0x25 , 0xFF , 0x25 , 0xFF , +0x7C , 0xFF , 0x7C , 0xFF , 0x75 , 0x00 , 0x75 , 0x00 , 0xE3 , 0x00 , 0xE3 , 0x00 , 0xC4 , 0x00 , 0xC4 , 0x00 , +0x71 , 0x00 , 0x71 , 0x00 , 0x7B , 0x00 , 0x7B , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , +0xC2 , 0xFF , 0xC2 , 0xFF , 0xA2 , 0xFF , 0xA2 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , 0x35 , 0x00 , 0x35 , 0x00 , +0xA0 , 0x00 , 0xA0 , 0x00 , 0x34 , 0x01 , 0x34 , 0x01 , 0xB9 , 0x01 , 0xB9 , 0x01 , 0x08 , 0x02 , 0x08 , 0x02 , +0x1D , 0x02 , 0x1D , 0x02 , 0xE6 , 0x01 , 0xE6 , 0x01 , 0x72 , 0x01 , 0x72 , 0x01 , 0x7E , 0x01 , 0x7E , 0x01 , +0x34 , 0x03 , 0x34 , 0x03 , 0x64 , 0x05 , 0x64 , 0x05 , 0xAD , 0x05 , 0xAD , 0x05 , 0x94 , 0x03 , 0x94 , 0x03 , +0xEC , 0x00 , 0xEC , 0x00 , 0xC3 , 0xFF , 0xC3 , 0xFF , 0x15 , 0xFF , 0x15 , 0xFF , 0x89 , 0xFD , 0x89 , 0xFD , +0xCD , 0xFB , 0xCD , 0xFB , 0xD8 , 0xFB , 0xD8 , 0xFB , 0x6E , 0xFD , 0x6E , 0xFD , 0x71 , 0xFE , 0x71 , 0xFE , +0xE0 , 0xFD , 0xE0 , 0xFD , 0x01 , 0xFD , 0x01 , 0xFD , 0x83 , 0xFD , 0x83 , 0xFD , 0xA4 , 0xFE , 0xA4 , 0xFE , +0x01 , 0xFF , 0x01 , 0xFF , 0x45 , 0xFE , 0x45 , 0xFE , 0xD2 , 0xFD , 0xD2 , 0xFD , 0x83 , 0xFE , 0x83 , 0xFE , +0x32 , 0xFF , 0x32 , 0xFF , 0x26 , 0xFF , 0x26 , 0xFF , 0xDE , 0xFE , 0xDE , 0xFE , 0x56 , 0xFF , 0x56 , 0xFF , +0x3D , 0x00 , 0x3D , 0x00 , 0x8F , 0x00 , 0x8F , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , 0x9D , 0xFF , 0x9D , 0xFF , +0xEA , 0xFF , 0xEA , 0xFF , 0x80 , 0x00 , 0x80 , 0x00 , 0xAA , 0x00 , 0xAA , 0x00 , 0x58 , 0x00 , 0x58 , 0x00 , +0x72 , 0x00 , 0x72 , 0x00 , 0xF6 , 0x00 , 0xF6 , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0xB5 , 0x00 , 0xB5 , 0x00 , +0x3A , 0x00 , 0x3A , 0x00 , 0x60 , 0x00 , 0x60 , 0x00 , 0x8F , 0x00 , 0x8F , 0x00 , 0x64 , 0x00 , 0x64 , 0x00 , +0x56 , 0x00 , 0x56 , 0x00 , 0xE1 , 0x00 , 0xE1 , 0x00 , 0xB9 , 0x01 , 0xB9 , 0x01 , 0xF3 , 0x01 , 0xF3 , 0x01 , +0xB3 , 0x01 , 0xB3 , 0x01 , 0x9A , 0x01 , 0x9A , 0x01 , 0xA0 , 0x01 , 0xA0 , 0x01 , 0x5D , 0x01 , 0x5D , 0x01 , +0x13 , 0x01 , 0x13 , 0x01 , 0xF7 , 0x01 , 0xF7 , 0x01 , 0x4D , 0x03 , 0x4D , 0x03 , 0x6C , 0x03 , 0x6C , 0x03 , +0x12 , 0x02 , 0x12 , 0x02 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0x52 , 0x00 , 0x52 , 0x00 , 0xA9 , 0xFF , 0xA9 , 0xFF , +0x4C , 0xFE , 0x4C , 0xFE , 0x3C , 0xFD , 0x3C , 0xFD , 0x61 , 0xFD , 0x61 , 0xFD , 0xD7 , 0xFD , 0xD7 , 0xFD , +0xAC , 0xFD , 0xAC , 0xFD , 0x2B , 0xFD , 0x2B , 0xFD , 0x3B , 0xFD , 0x3B , 0xFD , 0xF8 , 0xFD , 0xF8 , 0xFD , +0x68 , 0xFE , 0x68 , 0xFE , 0x69 , 0xFE , 0x69 , 0xFE , 0x4F , 0xFE , 0x4F , 0xFE , 0xA4 , 0xFE , 0xA4 , 0xFE , +0x24 , 0xFF , 0x24 , 0xFF , 0x42 , 0xFF , 0x42 , 0xFF , 0x1D , 0xFF , 0x1D , 0xFF , 0x5D , 0xFF , 0x5D , 0xFF , +0xBA , 0xFF , 0xBA , 0xFF , 0xE1 , 0xFF , 0xE1 , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , +0x26 , 0x00 , 0x26 , 0x00 , 0x55 , 0x00 , 0x55 , 0x00 , 0x53 , 0x00 , 0x53 , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , +0x69 , 0x00 , 0x69 , 0x00 , 0xCF , 0x00 , 0xCF , 0x00 , 0xF3 , 0x00 , 0xF3 , 0x00 , 0xA5 , 0x00 , 0xA5 , 0x00 , +0x63 , 0x00 , 0x63 , 0x00 , 0x87 , 0x00 , 0x87 , 0x00 , 0xAA , 0x00 , 0xAA , 0x00 , 0x75 , 0x00 , 0x75 , 0x00 , +0xAC , 0x00 , 0xAC , 0x00 , 0x18 , 0x01 , 0x18 , 0x01 , 0x74 , 0x01 , 0x74 , 0x01 , 0x72 , 0x01 , 0x72 , 0x01 , +0x4E , 0x01 , 0x4E , 0x01 , 0x6E , 0x01 , 0x6E , 0x01 , 0x69 , 0x01 , 0x69 , 0x01 , 0x1D , 0x01 , 0x1D , 0x01 , +0x9B , 0x00 , 0x9B , 0x00 , 0xFF , 0x00 , 0xFF , 0x00 , 0xE5 , 0x01 , 0xE5 , 0x01 , 0xE3 , 0x01 , 0xE3 , 0x01 , +0x27 , 0x01 , 0x27 , 0x01 , 0xC8 , 0x00 , 0xC8 , 0x00 , 0xE3 , 0x00 , 0xE3 , 0x00 , 0x7F , 0x00 , 0x7F , 0x00 , +0x7D , 0xFF , 0x7D , 0xFF , 0xF2 , 0xFE , 0xF2 , 0xFE , 0x2E , 0xFF , 0x2E , 0xFF , 0xF1 , 0xFE , 0xF1 , 0xFE , +0x25 , 0xFE , 0x25 , 0xFE , 0xD3 , 0xFD , 0xD3 , 0xFD , 0x12 , 0xFE , 0x12 , 0xFE , 0x50 , 0xFE , 0x50 , 0xFE , +0x00 , 0xFE , 0x00 , 0xFE , 0xDC , 0xFD , 0xDC , 0xFD , 0x53 , 0xFE , 0x53 , 0xFE , 0xAE , 0xFE , 0xAE , 0xFE , +0x95 , 0xFE , 0x95 , 0xFE , 0xBB , 0xFE , 0xBB , 0xFE , 0x29 , 0xFF , 0x29 , 0xFF , 0x4E , 0xFF , 0x4E , 0xFF , +0x91 , 0xFF , 0x91 , 0xFF , 0xA9 , 0xFF , 0xA9 , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , 0x4C , 0x00 , 0x4C , 0x00 , +0x4E , 0x00 , 0x4E , 0x00 , 0x37 , 0x00 , 0x37 , 0x00 , 0x4F , 0x00 , 0x4F , 0x00 , 0xB2 , 0x00 , 0xB2 , 0x00 , +0xE8 , 0x00 , 0xE8 , 0x00 , 0xD0 , 0x00 , 0xD0 , 0x00 , 0x95 , 0x00 , 0x95 , 0x00 , 0xC0 , 0x00 , 0xC0 , 0x00 , +0x31 , 0x01 , 0x31 , 0x01 , 0x99 , 0x00 , 0x99 , 0x00 , 0x7E , 0x00 , 0x7E , 0x00 , 0x64 , 0x01 , 0x64 , 0x01 , +0xA9 , 0x01 , 0xA9 , 0x01 , 0x66 , 0x01 , 0x66 , 0x01 , 0x2D , 0x01 , 0x2D , 0x01 , 0x7C , 0x01 , 0x7C , 0x01 , +0x9A , 0x01 , 0x9A , 0x01 , 0x38 , 0x01 , 0x38 , 0x01 , 0x16 , 0x01 , 0x16 , 0x01 , 0x3E , 0x01 , 0x3E , 0x01 , +0x57 , 0x01 , 0x57 , 0x01 , 0x27 , 0x01 , 0x27 , 0x01 , 0xE9 , 0x00 , 0xE9 , 0x00 , 0xEB , 0x00 , 0xEB , 0x00 , +0x15 , 0x01 , 0x15 , 0x01 , 0x0D , 0x01 , 0x0D , 0x01 , 0x5F , 0x00 , 0x5F , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , +0x66 , 0x00 , 0x66 , 0x00 , 0x22 , 0x00 , 0x22 , 0x00 , 0x5E , 0xFF , 0x5E , 0xFF , 0xE4 , 0xFE , 0xE4 , 0xFE , +0x22 , 0xFF , 0x22 , 0xFF , 0xE1 , 0xFE , 0xE1 , 0xFE , 0xA5 , 0xFE , 0xA5 , 0xFE , 0x5E , 0xFE , 0x5E , 0xFE , +0x71 , 0xFE , 0x71 , 0xFE , 0x4B , 0xFE , 0x4B , 0xFE , 0x49 , 0xFE , 0x49 , 0xFE , 0x4C , 0xFE , 0x4C , 0xFE , +0x71 , 0xFE , 0x71 , 0xFE , 0xA4 , 0xFE , 0xA4 , 0xFE , 0xAB , 0xFE , 0xAB , 0xFE , 0xD1 , 0xFE , 0xD1 , 0xFE , +0x4A , 0xFF , 0x4A , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x22 , 0x00 , 0x22 , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , +0x71 , 0x00 , 0x71 , 0x00 , 0xC1 , 0x00 , 0xC1 , 0x00 , 0xA2 , 0x00 , 0xA2 , 0x00 , 0xEA , 0x00 , 0xEA , 0x00 , +0x01 , 0x01 , 0x01 , 0x01 , 0xE0 , 0x00 , 0xE0 , 0x00 , 0x78 , 0x01 , 0x78 , 0x01 , 0xBA , 0x01 , 0xBA , 0x01 , +0x8D , 0x01 , 0x8D , 0x01 , 0x95 , 0x01 , 0x95 , 0x01 , 0xB6 , 0x01 , 0xB6 , 0x01 , 0xD5 , 0x01 , 0xD5 , 0x01 , +0x37 , 0x01 , 0x37 , 0x01 , 0x08 , 0x01 , 0x08 , 0x01 , 0x4C , 0x01 , 0x4C , 0x01 , 0x44 , 0x01 , 0x44 , 0x01 , +0xC7 , 0x00 , 0xC7 , 0x00 , 0x44 , 0x00 , 0x44 , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , +0x1B , 0x00 , 0x1B , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0xEB , 0xFF , 0xEB , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xBA , 0xFF , 0xBA , 0xFF , 0xBB , 0xFF , 0xBB , 0xFF , 0x10 , 0xFF , 0x10 , 0xFF , +0x11 , 0xFF , 0x11 , 0xFF , 0x3D , 0xFF , 0x3D , 0xFF , 0x0A , 0xFF , 0x0A , 0xFF , 0xFF , 0xFE , 0xFF , 0xFE , +0x7A , 0xFE , 0x7A , 0xFE , 0x8B , 0xFE , 0x8B , 0xFE , 0x98 , 0xFE , 0x98 , 0xFE , 0xF5 , 0xFE , 0xF5 , 0xFE , +0xC3 , 0xFE , 0xC3 , 0xFE , 0xE7 , 0xFE , 0xE7 , 0xFE , 0xE2 , 0xFE , 0xE2 , 0xFE , 0xBE , 0xFE , 0xBE , 0xFE , +0xE2 , 0xFE , 0xE2 , 0xFE , 0x8F , 0xFF , 0x8F , 0xFF , 0xD5 , 0xFF , 0xD5 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , +0xAD , 0xFF , 0xAD , 0xFF , 0xC3 , 0xFF , 0xC3 , 0xFF , 0x17 , 0x00 , 0x17 , 0x00 , 0xD3 , 0xFF , 0xD3 , 0xFF , +0xE9 , 0xFF , 0xE9 , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0x4E , 0x00 , 0x4E , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , +0x4D , 0x00 , 0x4D , 0x00 , 0x82 , 0x00 , 0x82 , 0x00 , 0xDF , 0x00 , 0xDF , 0x00 , 0x40 , 0x01 , 0x40 , 0x01 , +0x50 , 0x01 , 0x50 , 0x01 , 0x6F , 0x01 , 0x6F , 0x01 , 0x6B , 0x01 , 0x6B , 0x01 , 0x88 , 0x01 , 0x88 , 0x01 , +0x38 , 0x01 , 0x38 , 0x01 , 0x3E , 0x01 , 0x3E , 0x01 , 0x2C , 0x01 , 0x2C , 0x01 , 0xFA , 0x00 , 0xFA , 0x00 , +0xC1 , 0x00 , 0xC1 , 0x00 , 0x6E , 0x00 , 0x6E , 0x00 , 0x6A , 0x00 , 0x6A , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , +0x16 , 0x00 , 0x16 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0xD1 , 0xFF , 0xD1 , 0xFF , 0xC0 , 0xFF , 0xC0 , 0xFF , +0x2A , 0x00 , 0x2A , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0xC5 , 0xFF , 0xC5 , 0xFF , 0x2A , 0xFF , 0x2A , 0xFF , +0xFB , 0xFE , 0xFB , 0xFE , 0x0C , 0xFF , 0x0C , 0xFF , 0xEC , 0xFE , 0xEC , 0xFE , 0xE7 , 0xFE , 0xE7 , 0xFE , +0x8C , 0xFE , 0x8C , 0xFE , 0x84 , 0xFE , 0x84 , 0xFE , 0x9B , 0xFE , 0x9B , 0xFE , 0xD8 , 0xFE , 0xD8 , 0xFE , +0xDD , 0xFE , 0xDD , 0xFE , 0xB8 , 0xFE , 0xB8 , 0xFE , 0x8C , 0xFE , 0x8C , 0xFE , 0x8C , 0xFE , 0x8C , 0xFE , +0xAF , 0xFE , 0xAF , 0xFE , 0x29 , 0xFF , 0x29 , 0xFF , 0x4E , 0xFF , 0x4E , 0xFF , 0x74 , 0xFF , 0x74 , 0xFF , +0x52 , 0xFF , 0x52 , 0xFF , 0x81 , 0xFF , 0x81 , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0xCE , 0xFF , 0xCE , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , +0x81 , 0x00 , 0x81 , 0x00 , 0xA9 , 0x00 , 0xA9 , 0x00 , 0xB6 , 0x00 , 0xB6 , 0x00 , 0xD0 , 0x00 , 0xD0 , 0x00 , +0x28 , 0x01 , 0x28 , 0x01 , 0x6D , 0x01 , 0x6D , 0x01 , 0x91 , 0x01 , 0x91 , 0x01 , 0x6C , 0x01 , 0x6C , 0x01 , +0x61 , 0x01 , 0x61 , 0x01 , 0x35 , 0x01 , 0x35 , 0x01 , 0xFD , 0x00 , 0xFD , 0x00 , 0x1B , 0x01 , 0x1B , 0x01 , +0xFE , 0x00 , 0xFE , 0x00 , 0xD5 , 0x00 , 0xD5 , 0x00 , 0x8D , 0x00 , 0x8D , 0x00 , 0x9A , 0x00 , 0x9A , 0x00 , +0x57 , 0x00 , 0x57 , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , 0x3B , 0x00 , 0x3B , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0xD2 , 0xFF , 0xD2 , 0xFF , 0x87 , 0xFF , 0x87 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , 0x71 , 0xFF , 0x71 , 0xFF , +0x6F , 0xFF , 0x6F , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , 0x3C , 0xFF , 0x3C , 0xFF , 0x40 , 0xFF , 0x40 , 0xFF , +0x40 , 0xFF , 0x40 , 0xFF , 0x38 , 0xFF , 0x38 , 0xFF , 0x43 , 0xFF , 0x43 , 0xFF , 0x19 , 0xFF , 0x19 , 0xFF , +0x14 , 0xFF , 0x14 , 0xFF , 0x12 , 0xFF , 0x12 , 0xFF , 0x3E , 0xFF , 0x3E , 0xFF , 0x2A , 0xFF , 0x2A , 0xFF , +0x46 , 0xFF , 0x46 , 0xFF , 0x68 , 0xFF , 0x68 , 0xFF , 0x6E , 0xFF , 0x6E , 0xFF , 0xC6 , 0xFF , 0xC6 , 0xFF , +0xD4 , 0xFF , 0xD4 , 0xFF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0xF3 , 0xFF , 0xF3 , 0xFF , 0x31 , 0x00 , 0x31 , 0x00 , +0x45 , 0x00 , 0x45 , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , 0x65 , 0x00 , 0x65 , 0x00 , 0x94 , 0x00 , 0x94 , 0x00 , +0xEC , 0x00 , 0xEC , 0x00 , 0x06 , 0x01 , 0x06 , 0x01 , 0xD9 , 0x00 , 0xD9 , 0x00 , 0x3F , 0x01 , 0x3F , 0x01 , +0x48 , 0x01 , 0x48 , 0x01 , 0x2F , 0x01 , 0x2F , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0xEA , 0x00 , 0xEA , 0x00 , +0xD6 , 0x00 , 0xD6 , 0x00 , 0xCD , 0x00 , 0xCD , 0x00 , 0x07 , 0x01 , 0x07 , 0x01 , 0xB2 , 0x00 , 0xB2 , 0x00 , +0x99 , 0x00 , 0x99 , 0x00 , 0x47 , 0x00 , 0x47 , 0x00 , 0x39 , 0x00 , 0x39 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , +0x56 , 0x00 , 0x56 , 0x00 , 0x6D , 0x00 , 0x6D , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , +0xE8 , 0xFF , 0xE8 , 0xFF , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xDD , 0xFF , 0xDD , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , +0xCF , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , 0xCD , 0xFF , 0xCD , 0xFF , 0xCA , 0xFF , 0xCA , 0xFF , +0x9E , 0xFF , 0x9E , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , 0x91 , 0xFF , 0x91 , 0xFF , 0xA9 , 0xFF , 0xA9 , 0xFF , +0x79 , 0xFF , 0x79 , 0xFF , 0x40 , 0xFF , 0x40 , 0xFF , 0x87 , 0xFF , 0x87 , 0xFF , 0xC6 , 0xFF , 0xC6 , 0xFF , +0x9B , 0xFF , 0x9B , 0xFF , 0xA3 , 0xFF , 0xA3 , 0xFF , 0xA2 , 0xFF , 0xA2 , 0xFF , 0x9C , 0xFF , 0x9C , 0xFF , +0x91 , 0xFF , 0x91 , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , 0xC0 , 0xFF , 0xC0 , 0xFF , 0xA8 , 0xFF , 0xA8 , 0xFF , +0xCA , 0xFF , 0xCA , 0xFF , 0x77 , 0xFF , 0x77 , 0xFF , 0xB2 , 0xFF , 0xB2 , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , +0x55 , 0x00 , 0x55 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , +0x5C , 0x00 , 0x5C , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , 0x72 , 0x00 , 0x72 , 0x00 , 0xA1 , 0x00 , 0xA1 , 0x00 , +0xE3 , 0x00 , 0xE3 , 0x00 , 0xAF , 0x00 , 0xAF , 0x00 , 0xBD , 0x00 , 0xBD , 0x00 , 0x04 , 0x01 , 0x04 , 0x01 , +0x8A , 0x00 , 0x8A , 0x00 , 0xE9 , 0x00 , 0xE9 , 0x00 , 0xB0 , 0x00 , 0xB0 , 0x00 , 0xB5 , 0x00 , 0xB5 , 0x00 , +0x5A , 0x00 , 0x5A , 0x00 , 0xDF , 0x00 , 0xDF , 0x00 , 0x97 , 0x00 , 0x97 , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , +0x41 , 0x00 , 0x41 , 0x00 , 0x3D , 0x00 , 0x3D , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0x48 , 0x00 , 0x48 , 0x00 , +0x73 , 0x00 , 0x73 , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0xD9 , 0xFF , 0xD9 , 0xFF , +0xF0 , 0xFF , 0xF0 , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , 0x50 , 0x00 , 0x50 , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , +0x19 , 0x00 , 0x19 , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0xA8 , 0xFF , 0xA8 , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , +0xA8 , 0xFF , 0xA8 , 0xFF , 0x2C , 0x00 , 0x2C , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , +0xA6 , 0xFF , 0xA6 , 0xFF , 0xAF , 0xFF , 0xAF , 0xFF , 0x9D , 0xFF , 0x9D , 0xFF , 0x20 , 0x00 , 0x20 , 0x00 , +0xEC , 0xFF , 0xEC , 0xFF , 0x0E , 0x00 , 0x0E , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0xD2 , 0xFF , 0xD2 , 0xFF , +0x2D , 0x00 , 0x2D , 0x00 , 0xED , 0xFF , 0xED , 0xFF , 0x83 , 0x00 , 0x83 , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , +0x49 , 0x00 , 0x49 , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , 0x6A , 0x00 , 0x6A , 0x00 , +0x37 , 0x00 , 0x37 , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , 0xB3 , 0xFF , 0xB3 , 0xFF , 0x67 , 0x00 , 0x67 , 0x00 , +0x49 , 0x00 , 0x49 , 0x00 , 0x68 , 0x00 , 0x68 , 0x00 , 0x48 , 0x00 , 0x48 , 0x00 , 0x40 , 0x00 , 0x40 , 0x00 , +0xC9 , 0x00 , 0xC9 , 0x00 , 0xB1 , 0xFF , 0xB1 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xDD , 0xFF , 0xDD , 0xFF , +0x6F , 0xFF , 0x6F , 0xFF , 0x35 , 0x00 , 0x35 , 0x00 , 0x85 , 0x00 , 0x85 , 0x00 , 0x53 , 0x01 , 0x53 , 0x01 , +0xD9 , 0x00 , 0xD9 , 0x00 , 0x6F , 0x00 , 0x6F , 0x00 , 0x7F , 0x00 , 0x7F , 0x00 , 0x76 , 0x00 , 0x76 , 0x00 , +0xE9 , 0x00 , 0xE9 , 0x00 , 0xB4 , 0x00 , 0xB4 , 0x00 , 0x96 , 0x00 , 0x96 , 0x00 , 0x59 , 0xFF , 0x59 , 0xFF , +0x0A , 0xFF , 0x0A , 0xFF , 0xE3 , 0xFE , 0xE3 , 0xFE , 0x6D , 0x00 , 0x6D , 0x00 , 0xFB , 0xFF , 0xFB , 0xFF , +0xA6 , 0xFF , 0xA6 , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , 0x1E , 0xFF , 0x1E , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , +0x45 , 0x00 , 0x45 , 0x00 , 0x89 , 0x00 , 0x89 , 0x00 , 0x93 , 0x00 , 0x93 , 0x00 , 0xA5 , 0x00 , 0xA5 , 0x00 , +0x6A , 0x00 , 0x6A , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , +0xEB , 0xFF , 0xEB , 0xFF , 0x27 , 0xFF , 0x27 , 0xFF , 0x65 , 0xFF , 0x65 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , +0x02 , 0x00 , 0x02 , 0x00 , 0x9E , 0x00 , 0x9E , 0x00 , 0x4F , 0x00 , 0x4F , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , +0x1B , 0x00 , 0x1B , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0xF9 , 0xFF , 0xF9 , 0xFF , 0x0E , 0x00 , 0x0E , 0x00 , +0x1A , 0x00 , 0x1A , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , +0xCD , 0xFF , 0xCD , 0xFF , 0x23 , 0x00 , 0x23 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , 0xCE , 0xFF , 0xCE , 0xFF , +0x69 , 0xFF , 0x69 , 0xFF , 0xD8 , 0xFE , 0xD8 , 0xFE , 0xC0 , 0xFE , 0xC0 , 0xFE , 0x6A , 0xFF , 0x6A , 0xFF , +0x41 , 0x00 , 0x41 , 0x00 , 0xE0 , 0xFF , 0xE0 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , 0x15 , 0x00 , 0x15 , 0x00 , +0xA0 , 0xFF , 0xA0 , 0xFF , 0x5F , 0xFF , 0x5F , 0xFF , 0x0F , 0x00 , 0x0F , 0x00 , 0xE6 , 0xFF , 0xE6 , 0xFF , +0x47 , 0xFF , 0x47 , 0xFF , 0x24 , 0x00 , 0x24 , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , 0x3E , 0x00 , 0x3E , 0x00 , +0x50 , 0xFF , 0x50 , 0xFF , 0x8C , 0xFF , 0x8C , 0xFF , 0x8E , 0xFF , 0x8E , 0xFF , 0x9A , 0xFF , 0x9A , 0xFF , +0x82 , 0xFF , 0x82 , 0xFF , 0x61 , 0xFF , 0x61 , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , +0x5A , 0x00 , 0x5A , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0xD5 , 0xFF , 0xD5 , 0xFF , 0x21 , 0x00 , 0x21 , 0x00 , +0x2F , 0x00 , 0x2F , 0x00 , 0x39 , 0xFF , 0x39 , 0xFF , 0xAB , 0xFF , 0xAB , 0xFF , 0x54 , 0xFF , 0x54 , 0xFF , +0x43 , 0xFF , 0x43 , 0xFF , 0x6B , 0xFF , 0x6B , 0xFF , 0x3D , 0x00 , 0x3D , 0x00 , 0xF6 , 0x00 , 0xF6 , 0x00 , +0x5F , 0x00 , 0x5F , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , 0x17 , 0x00 , 0x17 , 0x00 , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x28 , 0x00 , 0x28 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x6F , 0x00 , 0x6F , 0x00 , +0xFA , 0xFF , 0xFA , 0xFF , 0xBB , 0xFF , 0xBB , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , 0x34 , 0x00 , 0x34 , 0x00 , +0xF7 , 0xFF , 0xF7 , 0xFF , 0xC9 , 0xFF , 0xC9 , 0xFF , 0x23 , 0xFF , 0x23 , 0xFF , 0x77 , 0xFE , 0x77 , 0xFE , +0x3E , 0xFE , 0x3E , 0xFE , 0x34 , 0xFF , 0x34 , 0xFF , 0x1F , 0x00 , 0x1F , 0x00 , 0xC2 , 0xFF , 0xC2 , 0xFF , +0x04 , 0x00 , 0x04 , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , 0x7B , 0xFF , 0x7B , 0xFF , 0x59 , 0xFF , 0x59 , 0xFF , +0x19 , 0x00 , 0x19 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0xBD , 0xFF , 0xBD , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , +0xD1 , 0xFF , 0xD1 , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , 0x19 , 0x00 , 0x19 , 0x00 , 0x2F , 0x00 , 0x2F , 0x00 , +0x01 , 0x00 , 0x01 , 0x00 , 0x56 , 0xFF , 0x56 , 0xFF , 0x67 , 0xFF , 0x67 , 0xFF , 0xCF , 0xFF , 0xCF , 0xFF , +0xF1 , 0xFF , 0xF1 , 0xFF , 0xB2 , 0xFF , 0xB2 , 0xFF , 0x66 , 0x00 , 0x66 , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , +0xA8 , 0xFF , 0xA8 , 0xFF , 0x03 , 0x00 , 0x03 , 0x00 , 0x15 , 0x00 , 0x15 , 0x00 , 0x76 , 0xFF , 0x76 , 0xFF , +0xF1 , 0xFF , 0xF1 , 0xFF , 0x31 , 0xFF , 0x31 , 0xFF , 0x9A , 0xFF , 0x9A , 0xFF , 0x50 , 0x00 , 0x50 , 0x00 , +0x45 , 0x00 , 0x45 , 0x00 , 0x32 , 0x01 , 0x32 , 0x01 , 0x99 , 0x00 , 0x99 , 0x00 , 0x99 , 0x00 , 0x99 , 0x00 , +0xC3 , 0x00 , 0xC3 , 0x00 , 0xF3 , 0x00 , 0xF3 , 0x00 , 0x73 , 0x00 , 0x73 , 0x00 , 0xEB , 0xFF , 0xEB , 0xFF , +0xAC , 0x00 , 0xAC , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0xD6 , 0xFF , 0xD6 , 0xFF , 0xC0 , 0xFF , 0xC0 , 0xFF , +0xAB , 0xFF , 0xAB , 0xFF , 0x0B , 0x00 , 0x0B , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0x30 , 0x00 , 0x30 , 0x00 , +0x11 , 0x00 , 0x11 , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0x17 , 0x00 , 0x17 , 0x00 , 0xD4 , 0x00 , 0xD4 , 0x00 , +0x50 , 0x01 , 0x50 , 0x01 , 0xC2 , 0x00 , 0xC2 , 0x00 , 0x97 , 0x00 , 0x97 , 0x00 , 0xB2 , 0x00 , 0xB2 , 0x00 , +0x4B , 0x00 , 0x4B , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x6B , 0x00 , 0x6B , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , +0xA1 , 0x00 , 0xA1 , 0x00 , 0x28 , 0x00 , 0x28 , 0x00 , 0xD9 , 0xFF , 0xD9 , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , +0x1F , 0x00 , 0x1F , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0xD1 , 0xFF , 0xD1 , 0xFF , 0x26 , 0xFF , 0x26 , 0xFF , +0x61 , 0xFE , 0x61 , 0xFE , 0x2B , 0xFE , 0x2B , 0xFE , 0xB4 , 0xFE , 0xB4 , 0xFE , 0x69 , 0xFF , 0x69 , 0xFF , +0xEF , 0xFE , 0xEF , 0xFE , 0x49 , 0xFF , 0x49 , 0xFF , 0x47 , 0xFF , 0x47 , 0xFF , 0xC6 , 0xFE , 0xC6 , 0xFE , +0xE3 , 0xFE , 0xE3 , 0xFE , 0x9B , 0xFF , 0x9B , 0xFF , 0x0F , 0xFF , 0x0F , 0xFF , 0xDC , 0xFE , 0xDC , 0xFE , +0xD0 , 0xFF , 0xD0 , 0xFF , 0x8F , 0xFF , 0x8F , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , 0x18 , 0xFF , 0x18 , 0xFF , +0x0B , 0xFF , 0x0B , 0xFF , 0x42 , 0xFF , 0x42 , 0xFF , 0x18 , 0xFF , 0x18 , 0xFF , 0x0A , 0xFF , 0x0A , 0xFF , +0xC3 , 0xFE , 0xC3 , 0xFE , 0x9E , 0xFE , 0x9E , 0xFE , 0x82 , 0xFE , 0x82 , 0xFE , 0xDE , 0xFD , 0xDE , 0xFD , +0xF6 , 0xFC , 0xF6 , 0xFC , 0xD1 , 0xFC , 0xD1 , 0xFC , 0xB3 , 0xFD , 0xB3 , 0xFD , 0xED , 0xFE , 0xED , 0xFE , +0x67 , 0xFE , 0x67 , 0xFE , 0xF5 , 0xFE , 0xF5 , 0xFE , 0xE3 , 0xFE , 0xE3 , 0xFE , 0x32 , 0xFE , 0x32 , 0xFE , +0x48 , 0xFE , 0x48 , 0xFE , 0x53 , 0xFF , 0x53 , 0xFF , 0xA7 , 0xFE , 0xA7 , 0xFE , 0x5D , 0xFE , 0x5D , 0xFE , +0xA2 , 0xFF , 0xA2 , 0xFF , 0x53 , 0xFF , 0x53 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , 0xA1 , 0xFE , 0xA1 , 0xFE , +0x94 , 0xFE , 0x94 , 0xFE , 0xD5 , 0xFE , 0xD5 , 0xFE , 0xA4 , 0xFE , 0xA4 , 0xFE , 0xB4 , 0xFE , 0xB4 , 0xFE , +0x3A , 0xFE , 0x3A , 0xFE , 0x6D , 0xFE , 0x6D , 0xFE , 0x50 , 0xFF , 0x50 , 0xFF , 0x20 , 0x00 , 0x20 , 0x00 , +0x5E , 0xFF , 0x5E , 0xFF , 0x8E , 0x00 , 0x8E , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , 0x3B , 0x00 , 0x3B , 0x00 , +0x25 , 0x01 , 0x25 , 0x01 , 0xD9 , 0x00 , 0xD9 , 0x00 , 0x08 , 0x02 , 0x08 , 0x02 , 0x50 , 0x02 , 0x50 , 0x02 , +0xE9 , 0x01 , 0xE9 , 0x01 , 0x23 , 0x01 , 0x23 , 0x01 , 0x62 , 0x01 , 0x62 , 0x01 , 0x15 , 0x01 , 0x15 , 0x01 , +0x05 , 0x01 , 0x05 , 0x01 , 0xB9 , 0x00 , 0xB9 , 0x00 , 0xAE , 0xFF , 0xAE , 0xFF , 0xDA , 0xFF , 0xDA , 0xFF , +0xB4 , 0xFF , 0xB4 , 0xFF , 0xA1 , 0xFF , 0xA1 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , +0x40 , 0x00 , 0x40 , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , 0x81 , 0xFF , 0x81 , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , +0xE0 , 0xFF , 0xE0 , 0xFF , 0x4E , 0x00 , 0x4E , 0x00 , 0xD0 , 0xFF , 0xD0 , 0xFF , 0x70 , 0xFF , 0x70 , 0xFF , +0xEF , 0xFD , 0xEF , 0xFD , 0x55 , 0xFD , 0x55 , 0xFD , 0x9D , 0xFD , 0x9D , 0xFD , 0x6E , 0xFF , 0x6E , 0xFF , +0x69 , 0xFF , 0x69 , 0xFF , 0xFE , 0xFE , 0xFE , 0xFE , 0xA0 , 0xFF , 0xA0 , 0xFF , 0x90 , 0xFE , 0x90 , 0xFE , +0x12 , 0xFE , 0x12 , 0xFE , 0xCC , 0xFE , 0xCC , 0xFE , 0x8E , 0xFF , 0x8E , 0xFF , 0xCF , 0xFD , 0xCF , 0xFD , +0x54 , 0xFF , 0x54 , 0xFF , 0x81 , 0xFF , 0x81 , 0xFF , 0xBD , 0xFF , 0xBD , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , +0x07 , 0xFE , 0x07 , 0xFE , 0xAB , 0xFE , 0xAB , 0xFE , 0x85 , 0xFE , 0x85 , 0xFE , 0x83 , 0xFE , 0x83 , 0xFE , +0x68 , 0xFE , 0x68 , 0xFE , 0xDC , 0xFD , 0xDC , 0xFD , 0xFC , 0xFE , 0xFC , 0xFE , 0xD0 , 0xFF , 0xD0 , 0xFF , +0x27 , 0x00 , 0x27 , 0x00 , 0x5D , 0xFF , 0x5D , 0xFF , 0xF6 , 0x00 , 0xF6 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , +0xA3 , 0xFF , 0xA3 , 0xFF , 0xD4 , 0xFF , 0xD4 , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , 0xA9 , 0x00 , 0xA9 , 0x00 , +0xF7 , 0xFF , 0xF7 , 0xFF , 0xF0 , 0x00 , 0xF0 , 0x00 , 0xB9 , 0xFF , 0xB9 , 0xFF , 0x3A , 0x01 , 0x3A , 0x01 , +0x01 , 0x00 , 0x01 , 0x00 , 0x57 , 0xFF , 0x57 , 0xFF , 0x96 , 0x00 , 0x96 , 0x00 , 0xBD , 0xFE , 0xBD , 0xFE , +0x38 , 0x00 , 0x38 , 0x00 , 0xC0 , 0x00 , 0xC0 , 0x00 , 0xFF , 0x00 , 0xFF , 0x00 , 0x17 , 0x02 , 0x17 , 0x02 , +0x2C , 0x00 , 0x2C , 0x00 , 0xF9 , 0x00 , 0xF9 , 0x00 , 0x56 , 0x00 , 0x56 , 0x00 , 0xF1 , 0x00 , 0xF1 , 0x00 , +0x05 , 0x01 , 0x05 , 0x01 , 0xEB , 0x00 , 0xEB , 0x00 , 0xD4 , 0xFF , 0xD4 , 0xFF , 0xF7 , 0xFE , 0xF7 , 0xFE , +0xAE , 0xFE , 0xAE , 0xFE , 0xDC , 0xFF , 0xDC , 0xFF , 0xEE , 0x00 , 0xEE , 0x00 , 0x14 , 0xFF , 0x14 , 0xFF , +0xF5 , 0x00 , 0xF5 , 0x00 , 0xE5 , 0xFE , 0xE5 , 0xFE , 0x91 , 0xFF , 0x91 , 0xFF , 0xCF , 0x00 , 0xCF , 0x00 , +0xE4 , 0xFF , 0xE4 , 0xFF , 0x15 , 0x01 , 0x15 , 0x01 , 0xCB , 0x00 , 0xCB , 0x00 , 0x70 , 0x00 , 0x70 , 0x00 , +0x4D , 0x00 , 0x4D , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , 0x8A , 0x00 , 0x8A , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , +0xEB , 0xFE , 0xEB , 0xFE , 0x3E , 0x00 , 0x3E , 0x00 , 0x34 , 0xFF , 0x34 , 0xFF , 0x34 , 0xFF , 0x34 , 0xFF , +0xC0 , 0xFF , 0xC0 , 0xFF , 0x61 , 0x00 , 0x61 , 0x00 , 0x3D , 0x01 , 0x3D , 0x01 , 0xC0 , 0xFF , 0xC0 , 0xFF , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x1E , 0x00 , 0x1E , 0x00 , 0xB9 , 0xFF , 0xB9 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , +0x5A , 0x00 , 0x5A , 0x00 , 0xF4 , 0xFF , 0xF4 , 0xFF , 0xC4 , 0x00 , 0xC4 , 0x00 , 0xD6 , 0xFF , 0xD6 , 0xFF , +0x9C , 0xFF , 0x9C , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0x5C , 0x00 , 0x5C , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , +0xB6 , 0xFF , 0xB6 , 0xFF , 0x16 , 0xFF , 0x16 , 0xFF , 0x04 , 0xFE , 0x04 , 0xFE , 0x62 , 0xFE , 0x62 , 0xFE , +0x6C , 0xFF , 0x6C , 0xFF , 0x80 , 0x00 , 0x80 , 0x00 , 0x0A , 0xFF , 0x0A , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , +0x8A , 0xFF , 0x8A , 0xFF , 0x95 , 0xFE , 0x95 , 0xFE , 0xC4 , 0xFE , 0xC4 , 0xFE , 0x52 , 0x00 , 0x52 , 0x00 , +0xE1 , 0xFE , 0xE1 , 0xFE , 0xB6 , 0xFE , 0xB6 , 0xFE , 0x8F , 0x00 , 0x8F , 0x00 , 0xA8 , 0xFF , 0xA8 , 0xFF , +0xB0 , 0xFF , 0xB0 , 0xFF , 0x86 , 0xFF , 0x86 , 0xFF , 0x66 , 0x00 , 0x66 , 0x00 , 0x78 , 0x00 , 0x78 , 0x00 , +0xA1 , 0xFF , 0xA1 , 0xFF , 0x66 , 0x00 , 0x66 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0xE9 , 0xFE , 0xE9 , 0xFE , +0x93 , 0xFF , 0x93 , 0xFF , 0x86 , 0x00 , 0x86 , 0x00 , 0x1B , 0xFF , 0x1B , 0xFF , 0x0E , 0xFF , 0x0E , 0xFF , +0x2A , 0x01 , 0x2A , 0x01 , 0x43 , 0xFF , 0x43 , 0xFF , 0x18 , 0x00 , 0x18 , 0x00 , 0x1E , 0xFF , 0x1E , 0xFF , +0x56 , 0xFF , 0x56 , 0xFF , 0x89 , 0xFF , 0x89 , 0xFF , 0x3F , 0xFF , 0x3F , 0xFF , 0x9B , 0xFF , 0x9B , 0xFF , +0xD2 , 0xFE , 0xD2 , 0xFE , 0xC4 , 0xFF , 0xC4 , 0xFF , 0xD6 , 0xFF , 0xD6 , 0xFF , 0xA9 , 0x00 , 0xA9 , 0x00 , +0x04 , 0xFF , 0x04 , 0xFF , 0x1A , 0x01 , 0x1A , 0x01 , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xBC , 0xFF , 0xBC , 0xFF , +0x02 , 0x01 , 0x02 , 0x01 , 0x2F , 0x00 , 0x2F , 0x00 , 0x34 , 0x01 , 0x34 , 0x01 , 0x30 , 0x01 , 0x30 , 0x01 , +0x99 , 0x00 , 0x99 , 0x00 , 0xE2 , 0xFF , 0xE2 , 0xFF , 0xD9 , 0x00 , 0xD9 , 0x00 , 0x39 , 0x00 , 0x39 , 0x00 , +0x31 , 0x00 , 0x31 , 0x00 , 0xB2 , 0xFF , 0xB2 , 0xFF , 0x42 , 0x00 , 0x42 , 0x00 , 0x96 , 0xFF , 0x96 , 0xFF , +0xA3 , 0xFF , 0xA3 , 0xFF , 0x60 , 0x00 , 0x60 , 0x00 , 0x3F , 0x00 , 0x3F , 0x00 , 0x7D , 0x00 , 0x7D , 0x00 , +0x9D , 0x00 , 0x9D , 0x00 , 0x97 , 0xFF , 0x97 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0xC7 , 0x00 , 0xC7 , 0x00 , +0xB4 , 0xFF , 0xB4 , 0xFF , 0x72 , 0x00 , 0x72 , 0x00 , 0x55 , 0x00 , 0x55 , 0x00 , 0x7D , 0x00 , 0x7D , 0x00 , +0x2F , 0xFF , 0x2F , 0xFF , 0x0F , 0x00 , 0x0F , 0x00 , 0x0B , 0x00 , 0x0B , 0x00 , 0xB3 , 0xFF , 0xB3 , 0xFF , +0x5B , 0x00 , 0x5B , 0x00 , 0x9A , 0xFF , 0x9A , 0xFF , 0xAF , 0xFF , 0xAF , 0xFF , 0x74 , 0xFF , 0x74 , 0xFF , +0x58 , 0xFF , 0x58 , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0xA4 , 0x00 , 0xA4 , 0x00 , 0x08 , 0xFF , 0x08 , 0xFF , +0x0C , 0x01 , 0x0C , 0x01 , 0xEB , 0xFF , 0xEB , 0xFF , 0x11 , 0xFF , 0x11 , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , +0x71 , 0x00 , 0x71 , 0x00 , 0x12 , 0xFF , 0x12 , 0xFF , 0x9E , 0xFF , 0x9E , 0xFF , 0x16 , 0x01 , 0x16 , 0x01 , +0xF8 , 0xFE , 0xF8 , 0xFE , 0xD9 , 0x00 , 0xD9 , 0x00 , 0xFA , 0xFF , 0xFA , 0xFF , 0x0F , 0x00 , 0x0F , 0x00 , +0xB5 , 0x00 , 0xB5 , 0x00 , 0xF4 , 0xFF , 0xF4 , 0xFF , 0xB4 , 0xFF , 0xB4 , 0xFF , 0xAD , 0x00 , 0xAD , 0x00 , +0xBF , 0xFF , 0xBF , 0xFF , 0xE4 , 0xFF , 0xE4 , 0xFF , 0x33 , 0x00 , 0x33 , 0x00 , 0x65 , 0xFE , 0x65 , 0xFE , +0xCA , 0x00 , 0xCA , 0x00 , 0x82 , 0x00 , 0x82 , 0x00 , 0x06 , 0x00 , 0x06 , 0x00 , 0xDB , 0xFF , 0xDB , 0xFF , +0x77 , 0xFF , 0x77 , 0xFF , 0x8A , 0xFF , 0x8A , 0xFF , 0x80 , 0xFF , 0x80 , 0xFF , 0x4E , 0x00 , 0x4E , 0x00 , +0xFA , 0xFD , 0xFA , 0xFD , 0xED , 0xFE , 0xED , 0xFE , 0x49 , 0xFF , 0x49 , 0xFF , 0x75 , 0xFD , 0x75 , 0xFD , +0x0F , 0xFF , 0x0F , 0xFF , 0x29 , 0xFF , 0x29 , 0xFF , 0x44 , 0xFF , 0x44 , 0xFF , 0x68 , 0x00 , 0x68 , 0x00 , +0x45 , 0xFF , 0x45 , 0xFF , 0xCD , 0xFF , 0xCD , 0xFF , 0xB3 , 0xFF , 0xB3 , 0xFF , 0x84 , 0xFF , 0x84 , 0xFF , +0xCA , 0xFF , 0xCA , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , +0x12 , 0x00 , 0x12 , 0x00 , 0xC4 , 0xFF , 0xC4 , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , +0xDA , 0xFF , 0xDA , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , 0xFB , 0xFF , 0xFB , 0xFF , +0xB9 , 0xFF , 0xB9 , 0xFF , 0x2F , 0x00 , 0x2F , 0x00 , 0xD6 , 0xFF , 0xD6 , 0xFF , 0x2A , 0x00 , 0x2A , 0x00 , +0xFB , 0xFF , 0xFB , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0xD1 , 0xFF , 0xD1 , 0xFF , 0xC7 , 0xFF , 0xC7 , 0xFF , +0x3E , 0x00 , 0x3E , 0x00 , 0xCD , 0xFF , 0xCD , 0xFF , 0xD4 , 0xFF , 0xD4 , 0xFF , 0xB0 , 0xFF , 0xB0 , 0xFF , +0x29 , 0x00 , 0x29 , 0x00 , 0x3B , 0xFF , 0x3B , 0xFF , 0x61 , 0x00 , 0x61 , 0x00 , 0x75 , 0x00 , 0x75 , 0x00 , +0x3C , 0x00 , 0x3C , 0x00 , 0xE6 , 0xFF , 0xE6 , 0xFF , 0x50 , 0x00 , 0x50 , 0x00 , 0xFB , 0xFF , 0xFB , 0xFF , +0xC9 , 0xFF , 0xC9 , 0xFF , 0x32 , 0x00 , 0x32 , 0x00 , 0x6D , 0x00 , 0x6D , 0x00 , 0xD8 , 0xFF , 0xD8 , 0xFF , +0x98 , 0x00 , 0x98 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , +0x38 , 0x01 , 0x38 , 0x01 , 0xCC , 0xFF , 0xCC , 0xFF , 0x73 , 0x00 , 0x73 , 0x00 , 0x62 , 0x00 , 0x62 , 0x00 , +0x5F , 0xFF , 0x5F , 0xFF , 0xA5 , 0x00 , 0xA5 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , +0x29 , 0x00 , 0x29 , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , 0x65 , 0xFF , 0x65 , 0xFF , 0xBA , 0x00 , 0xBA , 0x00 , +0x7C , 0xFF , 0x7C , 0xFF , 0xAD , 0xFF , 0xAD , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , 0x83 , 0x00 , 0x83 , 0x00 , +0x91 , 0xFF , 0x91 , 0xFF , 0xC9 , 0xFF , 0xC9 , 0xFF , 0x9E , 0xFF , 0x9E , 0xFF , 0x51 , 0xFF , 0x51 , 0xFF , +0xD7 , 0xFF , 0xD7 , 0xFF , 0xA0 , 0x00 , 0xA0 , 0x00 , 0x6E , 0xFF , 0x6E , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , +0x65 , 0x00 , 0x65 , 0x00 , 0xA1 , 0xFE , 0xA1 , 0xFE , 0x3C , 0x01 , 0x3C , 0x01 , 0x59 , 0xFF , 0x59 , 0xFF , +0x5F , 0x00 , 0x5F , 0x00 , 0x4D , 0x00 , 0x4D , 0x00 , 0xC5 , 0xFF , 0xC5 , 0xFF , 0x3F , 0x00 , 0x3F , 0x00 , +0x93 , 0xFF , 0x93 , 0xFF , 0x44 , 0x00 , 0x44 , 0x00 , 0x20 , 0x00 , 0x20 , 0x00 , 0x9B , 0xFF , 0x9B , 0xFF , +0xED , 0xFF , 0xED , 0xFF , 0x1B , 0x00 , 0x1B , 0x00 , 0x5C , 0xFF , 0x5C , 0xFF , 0x42 , 0x00 , 0x42 , 0x00 , +0xD0 , 0xFF , 0xD0 , 0xFF , 0xA3 , 0x00 , 0xA3 , 0x00 , 0xDD , 0xFF , 0xDD , 0xFF , 0xC1 , 0xFF , 0xC1 , 0xFF , +0x30 , 0x00 , 0x30 , 0x00 , 0xCE , 0xFF , 0xCE , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0x36 , 0x00 , 0x36 , 0x00 , +0xE2 , 0xFF , 0xE2 , 0xFF , 0x41 , 0x00 , 0x41 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0xCC , 0xFF , 0xCC , 0xFF , +0xE3 , 0xFF , 0xE3 , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , 0xDC , 0xFF , 0xDC , 0xFF , 0x2B , 0x00 , 0x2B , 0x00 , +0x68 , 0xFF , 0x68 , 0xFF , 0x42 , 0x00 , 0x42 , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0x8A , 0x00 , 0x8A , 0x00 , +0x45 , 0x00 , 0x45 , 0x00 , 0xA1 , 0xFF , 0xA1 , 0xFF , 0xE0 , 0x00 , 0xE0 , 0x00 , 0x42 , 0xFF , 0x42 , 0xFF , +0x25 , 0x01 , 0x25 , 0x01 , 0x82 , 0xFF , 0x82 , 0xFF , 0x89 , 0x00 , 0x89 , 0x00 , 0x36 , 0xFF , 0x36 , 0xFF , +0xCB , 0xFF , 0xCB , 0xFF , 0xA1 , 0xFF , 0xA1 , 0xFF , 0x80 , 0x00 , 0x80 , 0x00 , 0xB9 , 0xFF , 0xB9 , 0xFF , +0xC5 , 0xFF , 0xC5 , 0xFF , 0xBA , 0x00 , 0xBA , 0x00 , 0x7C , 0xFE , 0x7C , 0xFE , 0x7D , 0x01 , 0x7D , 0x01 , +0x2B , 0xFF , 0x2B , 0xFF , 0x8B , 0x00 , 0x8B , 0x00 , 0x79 , 0x00 , 0x79 , 0x00 , 0xB3 , 0xFF , 0xB3 , 0xFF , +0xA3 , 0x00 , 0xA3 , 0x00 , 0x68 , 0xFF , 0x68 , 0xFF , 0x65 , 0x00 , 0x65 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , +0x9F , 0xFF , 0x9F , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , 0x63 , 0xFF , 0x63 , 0xFF , +0x16 , 0x00 , 0x16 , 0x00 , 0xD4 , 0xFF , 0xD4 , 0xFF , 0x80 , 0x00 , 0x80 , 0x00 , 0x30 , 0x00 , 0x30 , 0x00 , +0x92 , 0xFF , 0x92 , 0xFF , 0x89 , 0x00 , 0x89 , 0x00 , 0x7F , 0xFF , 0x7F , 0xFF , 0x59 , 0x00 , 0x59 , 0x00 , +0xB5 , 0xFF , 0xB5 , 0xFF , 0xBB , 0x00 , 0xBB , 0x00 , 0xB8 , 0xFF , 0xB8 , 0xFF , 0x8F , 0x00 , 0x8F , 0x00 , +0x52 , 0x00 , 0x52 , 0x00 , 0x2E , 0x00 , 0x2E , 0x00 , 0x2D , 0x01 , 0x2D , 0x01 , 0x16 , 0x00 , 0x16 , 0x00 , +0xDE , 0x00 , 0xDE , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x97 , 0x00 , 0x97 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , +0x15 , 0x00 , 0x15 , 0x00 , 0xB0 , 0xFF , 0xB0 , 0xFF , 0xDC , 0xFF , 0xDC , 0xFF , 0x6A , 0xFF , 0x6A , 0xFF , +0xA9 , 0xFF , 0xA9 , 0xFF , 0x08 , 0x00 , 0x08 , 0x00 , 0xEB , 0xFF , 0xEB , 0xFF , 0x17 , 0x00 , 0x17 , 0x00 , +0x1A , 0x00 , 0x1A , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0x34 , 0x00 , 0x34 , 0x00 , +0x65 , 0x00 , 0x65 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , 0x80 , 0x00 , 0x80 , 0x00 , 0x78 , 0x00 , 0x78 , 0x00 , +0x88 , 0x00 , 0x88 , 0x00 , 0x5A , 0x00 , 0x5A , 0x00 , 0xE0 , 0x00 , 0xE0 , 0x00 , 0x6F , 0x00 , 0x6F , 0x00 , +0x6E , 0x00 , 0x6E , 0x00 , 0x96 , 0x00 , 0x96 , 0x00 , 0x89 , 0xFF , 0x89 , 0xFF , 0x7E , 0x00 , 0x7E , 0x00 , +0x8C , 0xFF , 0x8C , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0xC5 , 0xFF , 0xC5 , 0xFF , 0xB5 , 0xFF , 0xB5 , 0xFF , +0x7A , 0xFF , 0x7A , 0xFF , 0x0A , 0x00 , 0x0A , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , 0x14 , 0x00 , 0x14 , 0x00 , +0xBA , 0x00 , 0xBA , 0x00 , 0x54 , 0x00 , 0x54 , 0x00 , 0xC3 , 0x00 , 0xC3 , 0x00 , 0xA6 , 0x00 , 0xA6 , 0x00 , +0x04 , 0x00 , 0x04 , 0x00 , 0x9C , 0x00 , 0x9C , 0x00 , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , +0x24 , 0x00 , 0x24 , 0x00 , 0x16 , 0xFF , 0x16 , 0xFF , 0x90 , 0xFF , 0x90 , 0xFF , 0x52 , 0xFF , 0x52 , 0xFF , +0x16 , 0xFF , 0x16 , 0xFF , 0xD4 , 0xFE , 0xD4 , 0xFE , 0x63 , 0xFF , 0x63 , 0xFF , 0xD0 , 0xFE , 0xD0 , 0xFE , +0x75 , 0xFF , 0x75 , 0xFF , 0x7E , 0xFF , 0x7E , 0xFF , 0x97 , 0xFF , 0x97 , 0xFF , 0xFD , 0xFF , 0xFD , 0xFF , +0x1E , 0x00 , 0x1E , 0x00 , 0x33 , 0x00 , 0x33 , 0x00 , 0x6D , 0x00 , 0x6D , 0x00 , 0xB9 , 0x00 , 0xB9 , 0x00 , +0xA7 , 0x00 , 0xA7 , 0x00 , 0xE2 , 0x00 , 0xE2 , 0x00 , 0xCF , 0x00 , 0xCF , 0x00 , 0x84 , 0x01 , 0x84 , 0x01 , +0xC2 , 0x00 , 0xC2 , 0x00 , 0x4A , 0x01 , 0x4A , 0x01 , 0xB0 , 0x00 , 0xB0 , 0x00 , 0xA9 , 0x01 , 0xA9 , 0x01 , +0x6C , 0x01 , 0x6C , 0x01 , 0x40 , 0x02 , 0x40 , 0x02 , 0xA5 , 0x01 , 0xA5 , 0x01 , 0xA4 , 0x01 , 0xA4 , 0x01 , +0x9D , 0x01 , 0x9D , 0x01 , 0xC1 , 0x00 , 0xC1 , 0x00 , 0x0B , 0x01 , 0x0B , 0x01 , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xF3 , 0xFF , 0xF3 , 0xFF , 0x72 , 0xFF , 0x72 , 0xFF , 0xEA , 0xFE , 0xEA , 0xFE , 0xEF , 0xFD , 0xEF , 0xFD , +0xCC , 0xFD , 0xCC , 0xFD , 0xD4 , 0xFC , 0xD4 , 0xFC , 0xC6 , 0xFC , 0xC6 , 0xFC , 0xC3 , 0xFB , 0xC3 , 0xFB , +0xB9 , 0xFB , 0xB9 , 0xFB , 0x52 , 0xFB , 0x52 , 0xFB , 0x01 , 0xFC , 0x01 , 0xFC , 0x06 , 0xFC , 0x06 , 0xFC , +0x21 , 0xFD , 0x21 , 0xFD , 0xDF , 0xFD , 0xDF , 0xFD , 0xA1 , 0xFE , 0xA1 , 0xFE , 0xDE , 0xFF , 0xDE , 0xFF , +0x8B , 0x00 , 0x8B , 0x00 , 0xE8 , 0x01 , 0xE8 , 0x01 , 0x33 , 0x02 , 0x33 , 0x02 , 0x3C , 0x03 , 0x3C , 0x03 , +0xFB , 0x02 , 0xFB , 0x02 , 0x74 , 0x04 , 0x74 , 0x04 , 0x36 , 0x04 , 0x36 , 0x04 , 0x8D , 0x06 , 0x8D , 0x06 , +0xAE , 0x05 , 0xAE , 0x05 , 0xCF , 0x05 , 0xCF , 0x05 , 0x73 , 0x06 , 0x73 , 0x06 , 0xC8 , 0x03 , 0xC8 , 0x03 , +0xC4 , 0x04 , 0xC4 , 0x04 , 0xD8 , 0x02 , 0xD8 , 0x02 , 0xA8 , 0x01 , 0xA8 , 0x01 , 0x0D , 0x01 , 0x0D , 0x01 , +0xD7 , 0xFF , 0xD7 , 0xFF , 0x16 , 0xFE , 0x16 , 0xFE , 0x23 , 0xFD , 0x23 , 0xFD , 0xC6 , 0xFC , 0xC6 , 0xFC , +0x5A , 0xFA , 0x5A , 0xFA , 0xB5 , 0xFA , 0xB5 , 0xFA , 0xFD , 0xFA , 0xFD , 0xFA , 0xA2 , 0xF9 , 0xA2 , 0xF9 , +0x0C , 0xFB , 0x0C , 0xFB , 0x6B , 0xFA , 0x6B , 0xFA , 0x3A , 0xFA , 0x3A , 0xFA , 0xD1 , 0xFA , 0xD1 , 0xFA , +0xCD , 0xFB , 0xCD , 0xFB , 0xB7 , 0xFB , 0xB7 , 0xFB , 0x88 , 0xFD , 0x88 , 0xFD , 0xA9 , 0xFE , 0xA9 , 0xFE , +0x02 , 0xFF , 0x02 , 0xFF , 0xF2 , 0x00 , 0xF2 , 0x00 , 0x22 , 0x01 , 0x22 , 0x01 , 0x03 , 0x02 , 0x03 , 0x02 , +0xD6 , 0x02 , 0xD6 , 0x02 , 0xD5 , 0x02 , 0xD5 , 0x02 , 0x28 , 0x03 , 0x28 , 0x03 , 0xBB , 0x03 , 0xBB , 0x03 , +0xDF , 0x03 , 0xDF , 0x03 , 0xC6 , 0x06 , 0xC6 , 0x06 , 0x00 , 0x05 , 0x00 , 0x05 , 0xC0 , 0x06 , 0xC0 , 0x06 , +0x2C , 0x07 , 0x2C , 0x07 , 0x03 , 0x06 , 0x03 , 0x06 , 0x03 , 0x06 , 0x03 , 0x06 , 0x4B , 0x05 , 0x4B , 0x05 , +0x19 , 0x04 , 0x19 , 0x04 , 0x39 , 0x02 , 0x39 , 0x02 , 0xD0 , 0x02 , 0xD0 , 0x02 , 0x43 , 0xFF , 0x43 , 0xFF , +0x44 , 0xFF , 0x44 , 0xFF , 0x4A , 0xFE , 0x4A , 0xFE , 0x90 , 0xFC , 0x90 , 0xFC , 0xE7 , 0xFB , 0xE7 , 0xFB , +0x6D , 0xFB , 0x6D , 0xFB , 0x5D , 0xFA , 0x5D , 0xFA , 0xA3 , 0xF9 , 0xA3 , 0xF9 , 0x50 , 0xFA , 0x50 , 0xFA , +0x68 , 0xF9 , 0x68 , 0xF9 , 0x3E , 0xFA , 0x3E , 0xFA , 0x58 , 0xFB , 0x58 , 0xFB , 0x7F , 0xFB , 0x7F , 0xFB , +0x3C , 0xFD , 0x3C , 0xFD , 0x19 , 0xFE , 0x19 , 0xFE , 0x7F , 0xFF , 0x7F , 0xFF , 0xD0 , 0xFF , 0xD0 , 0xFF , +0xF3 , 0x00 , 0xF3 , 0x00 , 0xC6 , 0x01 , 0xC6 , 0x01 , 0x12 , 0x02 , 0x12 , 0x02 , 0x74 , 0x02 , 0x74 , 0x02 , +0x5A , 0x03 , 0x5A , 0x03 , 0xEE , 0x02 , 0xEE , 0x02 , 0x18 , 0x04 , 0x18 , 0x04 , 0xB6 , 0x07 , 0xB6 , 0x07 , +0xCD , 0x03 , 0xCD , 0x03 , 0x7C , 0x07 , 0x7C , 0x07 , 0xF8 , 0x06 , 0xF8 , 0x06 , 0x31 , 0x05 , 0x31 , 0x05 , +0x54 , 0x06 , 0x54 , 0x06 , 0x48 , 0x05 , 0x48 , 0x05 , 0xDA , 0x03 , 0xDA , 0x03 , 0x82 , 0x02 , 0x82 , 0x02 , +0x31 , 0x03 , 0x31 , 0x03 , 0x3D , 0xFF , 0x3D , 0xFF , 0xAC , 0xFF , 0xAC , 0xFF , 0x9F , 0xFE , 0x9F , 0xFE , +0x16 , 0xFC , 0x16 , 0xFC , 0xCA , 0xFC , 0xCA , 0xFC , 0x44 , 0xFB , 0x44 , 0xFB , 0xB3 , 0xFA , 0xB3 , 0xFA , +0xC8 , 0xF9 , 0xC8 , 0xF9 , 0x58 , 0xFA , 0x58 , 0xFA , 0x63 , 0xF9 , 0x63 , 0xF9 , 0x1C , 0xFA , 0x1C , 0xFA , +0xEF , 0xFB , 0xEF , 0xFB , 0xE8 , 0xFA , 0xE8 , 0xFA , 0xDA , 0xFD , 0xDA , 0xFD , 0xCC , 0xFD , 0xCC , 0xFD , +0xB1 , 0xFF , 0xB1 , 0xFF , 0x3D , 0xFF , 0x3D , 0xFF , 0x8D , 0x00 , 0x8D , 0x00 , 0xC7 , 0x00 , 0xC7 , 0x00 , +0x40 , 0x01 , 0x40 , 0x01 , 0x40 , 0x01 , 0x40 , 0x01 , 0x83 , 0x02 , 0x83 , 0x02 , 0x88 , 0x01 , 0x88 , 0x01 , +0x23 , 0x04 , 0x23 , 0x04 , 0x0F , 0x08 , 0x0F , 0x08 , 0xD9 , 0x02 , 0xD9 , 0x02 , 0xBC , 0x08 , 0xBC , 0x08 , +0x7C , 0x06 , 0x7C , 0x06 , 0xDC , 0x04 , 0xDC , 0x04 , 0xAF , 0x06 , 0xAF , 0x06 , 0x46 , 0x05 , 0x46 , 0x05 , +0x53 , 0x03 , 0x53 , 0x03 , 0xE6 , 0x02 , 0xE6 , 0x02 , 0x08 , 0x03 , 0x08 , 0x03 , 0x09 , 0xFF , 0x09 , 0xFF , +0xC0 , 0xFF , 0xC0 , 0xFF , 0xC6 , 0xFE , 0xC6 , 0xFE , 0x7C , 0xFB , 0x7C , 0xFB , 0x63 , 0xFD , 0x63 , 0xFD , +0xA3 , 0xFA , 0xA3 , 0xFA , 0x8F , 0xFA , 0x8F , 0xFA , 0x51 , 0xFA , 0x51 , 0xFA , 0xF1 , 0xF9 , 0xF1 , 0xF9 , +0xD6 , 0xF9 , 0xD6 , 0xF9 , 0x6F , 0xFA , 0x6F , 0xFA , 0x6F , 0xFC , 0x6F , 0xFC , 0x2C , 0xFB , 0x2C , 0xFB , +0x96 , 0xFE , 0x96 , 0xFE , 0x50 , 0xFE , 0x50 , 0xFE , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xDF , 0xFF , 0xDF , 0xFF , +0x69 , 0x00 , 0x69 , 0x00 , 0xAC , 0xFF , 0xAC , 0xFF , 0xB3 , 0x00 , 0xB3 , 0x00 , 0xDB , 0xFF , 0xDB , 0xFF , +0xFB , 0x00 , 0xFB , 0x00 , 0xEB , 0xFF , 0xEB , 0xFF , 0x25 , 0x04 , 0x25 , 0x04 , 0x58 , 0x06 , 0x58 , 0x06 , +0x67 , 0x02 , 0x67 , 0x02 , 0xCF , 0x09 , 0xCF , 0x09 , 0xE7 , 0x05 , 0xE7 , 0x05 , 0xF0 , 0x04 , 0xF0 , 0x04 , +0xF9 , 0x07 , 0xF9 , 0x07 , 0x3F , 0x05 , 0x3F , 0x05 , 0x51 , 0x03 , 0x51 , 0x03 , 0x64 , 0x04 , 0x64 , 0x04 , +0xE8 , 0x02 , 0xE8 , 0x02 , 0x62 , 0xFF , 0x62 , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xAB , 0xFE , 0xAB , 0xFE , +0xE6 , 0xFA , 0xE6 , 0xFA , 0x1B , 0xFD , 0x1B , 0xFD , 0x90 , 0xF9 , 0x90 , 0xF9 , 0xCB , 0xF9 , 0xCB , 0xF9 , +0x2C , 0xFA , 0x2C , 0xFA , 0x67 , 0xF8 , 0x67 , 0xF8 , 0x90 , 0xF9 , 0x90 , 0xF9 , 0x29 , 0xFA , 0x29 , 0xFA , +0x6D , 0xFB , 0x6D , 0xFB , 0x62 , 0xFB , 0x62 , 0xFB , 0x84 , 0xFE , 0x84 , 0xFE , 0x89 , 0xFE , 0x89 , 0xFE , +0x1B , 0x00 , 0x1B , 0x00 , 0xFD , 0x00 , 0xFD , 0x00 , 0xBD , 0x00 , 0xBD , 0x00 , 0x91 , 0xFF , 0x91 , 0xFF , +0x43 , 0x01 , 0x43 , 0x01 , 0xDD , 0xFF , 0xDD , 0xFF , 0x54 , 0x00 , 0x54 , 0x00 , 0x6C , 0x00 , 0x6C , 0x00 , +0x10 , 0x06 , 0x10 , 0x06 , 0x3F , 0x04 , 0x3F , 0x04 , 0x59 , 0x04 , 0x59 , 0x04 , 0x1F , 0x0A , 0x1F , 0x0A , +0x5A , 0x04 , 0x5A , 0x04 , 0x82 , 0x06 , 0x82 , 0x06 , 0x58 , 0x07 , 0x58 , 0x07 , 0x80 , 0x04 , 0x80 , 0x04 , +0x04 , 0x03 , 0x04 , 0x03 , 0x80 , 0x04 , 0x80 , 0x04 , 0xCA , 0x00 , 0xCA , 0x00 , 0x9B , 0xFE , 0x9B , 0xFE , +0x1F , 0xFF , 0x1F , 0xFF , 0x22 , 0xFC , 0x22 , 0xFC , 0xB4 , 0xF9 , 0xB4 , 0xF9 , 0x04 , 0xFC , 0x04 , 0xFC , +0x8C , 0xF7 , 0x8C , 0xF7 , 0xE3 , 0xF8 , 0xE3 , 0xF8 , 0x7F , 0xFA , 0x7F , 0xFA , 0xFB , 0xF6 , 0xFB , 0xF6 , +0xAB , 0xF9 , 0xAB , 0xF9 , 0x5C , 0xFB , 0x5C , 0xFB , 0xDE , 0xFA , 0xDE , 0xFA , 0x82 , 0xFC , 0x82 , 0xFC , +0xEB , 0xFF , 0xEB , 0xFF , 0x4F , 0xFF , 0x4F , 0xFF , 0xFD , 0x00 , 0xFD , 0x00 , 0xF1 , 0x02 , 0xF1 , 0x02 , +0x76 , 0x01 , 0x76 , 0x01 , 0x03 , 0x00 , 0x03 , 0x00 , 0x55 , 0x02 , 0x55 , 0x02 , 0x44 , 0x00 , 0x44 , 0x00 , +0x5B , 0x00 , 0x5B , 0x00 , 0x48 , 0x01 , 0x48 , 0x01 , 0x42 , 0x07 , 0x42 , 0x07 , 0x4F , 0x03 , 0x4F , 0x03 , +0x9A , 0x05 , 0x9A , 0x05 , 0xA8 , 0x0A , 0xA8 , 0x0A , 0x91 , 0x04 , 0x91 , 0x04 , 0xD1 , 0x07 , 0xD1 , 0x07 , +0x1E , 0x08 , 0x1E , 0x08 , 0x28 , 0x05 , 0x28 , 0x05 , 0xC6 , 0x03 , 0xC6 , 0x03 , 0x68 , 0x05 , 0x68 , 0x05 , +0xAF , 0x00 , 0xAF , 0x00 , 0x7D , 0xFE , 0x7D , 0xFE , 0x7F , 0xFF , 0x7F , 0xFF , 0x5A , 0xFB , 0x5A , 0xFB , +0x82 , 0xF9 , 0x82 , 0xF9 , 0xB8 , 0xFB , 0xB8 , 0xFB , 0x11 , 0xF8 , 0x11 , 0xF8 , 0x13 , 0xF8 , 0x13 , 0xF8 , +0x1F , 0xFA , 0x1F , 0xFA , 0x04 , 0xF8 , 0x04 , 0xF8 , 0x73 , 0xF8 , 0x73 , 0xF8 , 0xDE , 0xFB , 0xDE , 0xFB , +0x44 , 0xFB , 0x44 , 0xFB , 0x53 , 0xFC , 0x53 , 0xFC , 0xD7 , 0xFF , 0xD7 , 0xFF , 0x34 , 0x00 , 0x34 , 0x00 , +0x7D , 0x00 , 0x7D , 0x00 , 0x2F , 0x02 , 0x2F , 0x02 , 0xC3 , 0x01 , 0xC3 , 0x01 , 0x4C , 0xFF , 0x4C , 0xFF , +0xF3 , 0x00 , 0xF3 , 0x00 , 0x87 , 0x00 , 0x87 , 0x00 , 0x71 , 0xFF , 0x71 , 0xFF , 0x87 , 0x00 , 0x87 , 0x00 , +0x74 , 0x07 , 0x74 , 0x07 , 0x0E , 0x02 , 0x0E , 0x02 , 0x6F , 0x05 , 0x6F , 0x05 , 0x26 , 0x0A , 0x26 , 0x0A , +0xCD , 0x04 , 0xCD , 0x04 , 0x24 , 0x07 , 0x24 , 0x07 , 0xF3 , 0x08 , 0xF3 , 0x08 , 0xC0 , 0x05 , 0xC0 , 0x05 , +0x75 , 0x03 , 0x75 , 0x03 , 0x32 , 0x06 , 0x32 , 0x06 , 0x81 , 0x01 , 0x81 , 0x01 , 0xBB , 0xFD , 0xBB , 0xFD , +0xBD , 0xFF , 0xBD , 0xFF , 0xC9 , 0xFB , 0xC9 , 0xFB , 0x97 , 0xF8 , 0x97 , 0xF8 , 0x71 , 0xFB , 0x71 , 0xFB , +0xFD , 0xF7 , 0xFD , 0xF7 , 0xEA , 0xF7 , 0xEA , 0xF7 , 0xD1 , 0xF8 , 0xD1 , 0xF8 , 0xC9 , 0xF8 , 0xC9 , 0xF8 , +0x7D , 0xF8 , 0x7D , 0xF8 , 0x6F , 0xFB , 0x6F , 0xFB , 0x6C , 0xFC , 0x6C , 0xFC , 0xEA , 0xFC , 0xEA , 0xFC , +0xB7 , 0xFF , 0xB7 , 0xFF , 0x69 , 0x01 , 0x69 , 0x01 , 0xB8 , 0x00 , 0xB8 , 0x00 , 0xDA , 0x01 , 0xDA , 0x01 , +0xD0 , 0x01 , 0xD0 , 0x01 , 0x40 , 0x00 , 0x40 , 0x00 , 0x85 , 0x00 , 0x85 , 0x00 , 0x34 , 0x01 , 0x34 , 0x01 , +0x29 , 0x00 , 0x29 , 0x00 , 0x92 , 0x01 , 0x92 , 0x01 , 0x21 , 0x08 , 0x21 , 0x08 , 0x2C , 0x02 , 0x2C , 0x02 , +0x4E , 0x06 , 0x4E , 0x06 , 0x2A , 0x09 , 0x2A , 0x09 , 0x96 , 0x04 , 0x96 , 0x04 , 0xE7 , 0x05 , 0xE7 , 0x05 , +0xD6 , 0x07 , 0xD6 , 0x07 , 0x18 , 0x04 , 0x18 , 0x04 , 0x10 , 0x02 , 0x10 , 0x02 , 0x5C , 0x04 , 0x5C , 0x04 , +0x20 , 0x00 , 0x20 , 0x00 , 0xCD , 0xFB , 0xCD , 0xFB , 0xF7 , 0xFD , 0xF7 , 0xFD , 0x4D , 0xFB , 0x4D , 0xFB , +0x07 , 0xF8 , 0x07 , 0xF8 , 0xAD , 0xFA , 0xAD , 0xFA , 0x2B , 0xF9 , 0x2B , 0xF9 , 0x10 , 0xF8 , 0x10 , 0xF8 , +0x3F , 0xF9 , 0x3F , 0xF9 , 0x35 , 0xFA , 0x35 , 0xFA , 0xBF , 0xF9 , 0xBF , 0xF9 , 0xDF , 0xFB , 0xDF , 0xFB , +0xD4 , 0xFD , 0xD4 , 0xFD , 0x52 , 0xFE , 0x52 , 0xFE , 0xBF , 0xFF , 0xBF , 0xFF , 0x51 , 0x02 , 0x51 , 0x02 , +0x04 , 0x01 , 0x04 , 0x01 , 0x30 , 0x01 , 0x30 , 0x01 , 0x3F , 0x01 , 0x3F , 0x01 , 0xC0 , 0x00 , 0xC0 , 0x00 , +0x07 , 0x00 , 0x07 , 0x00 , 0x7E , 0x01 , 0x7E , 0x01 , 0xEA , 0xFF , 0xEA , 0xFF , 0x86 , 0x05 , 0x86 , 0x05 , +0x0C , 0x07 , 0x0C , 0x07 , 0xCE , 0x02 , 0xCE , 0x02 , 0xA0 , 0x09 , 0xA0 , 0x09 , 0x57 , 0x07 , 0x57 , 0x07 , +0x60 , 0x05 , 0x60 , 0x05 , 0xF4 , 0x06 , 0xF4 , 0x06 , 0x87 , 0x06 , 0x87 , 0x06 , 0xDD , 0x02 , 0xDD , 0x02 , +0x52 , 0x02 , 0x52 , 0x02 , 0x35 , 0x03 , 0x35 , 0x03 , 0xD2 , 0xFD , 0xD2 , 0xFD , 0x6F , 0xFB , 0x6F , 0xFB , +0x5E , 0xFD , 0x5E , 0xFD , 0xB8 , 0xF9 , 0xB8 , 0xF9 , 0x8D , 0xF8 , 0x8D , 0xF8 , 0xCC , 0xF9 , 0xCC , 0xF9 , +0x0A , 0xF9 , 0x0A , 0xF9 , 0xAE , 0xF7 , 0xAE , 0xF7 , 0x6E , 0xF9 , 0x6E , 0xF9 , 0xAF , 0xFA , 0xAF , 0xFA , +0x82 , 0xFA , 0x82 , 0xFA , 0xB9 , 0xFC , 0xB9 , 0xFC , 0x3E , 0xFF , 0x3E , 0xFF , 0x85 , 0xFF , 0x85 , 0xFF , +0x3E , 0x01 , 0x3E , 0x01 , 0xEB , 0x02 , 0xEB , 0x02 , 0x9D , 0x01 , 0x9D , 0x01 , 0x5D , 0x01 , 0x5D , 0x01 , +0x6D , 0x01 , 0x6D , 0x01 , 0xF6 , 0x00 , 0xF6 , 0x00 , 0x2B , 0x00 , 0x2B , 0x00 , 0xEE , 0x00 , 0xEE , 0x00 , +0xE7 , 0x00 , 0xE7 , 0x00 , 0x3F , 0x08 , 0x3F , 0x08 , 0x9C , 0x04 , 0x9C , 0x04 , 0x4A , 0x05 , 0x4A , 0x05 , +0x77 , 0x0A , 0x77 , 0x0A , 0xFC , 0x05 , 0xFC , 0x05 , 0x55 , 0x06 , 0x55 , 0x06 , 0xD8 , 0x06 , 0xD8 , 0x06 , +0xAB , 0x05 , 0xAB , 0x05 , 0xF8 , 0x01 , 0xF8 , 0x01 , 0x92 , 0x02 , 0x92 , 0x02 , 0x54 , 0x02 , 0x54 , 0x02 , +0xFF , 0xFB , 0xFF , 0xFB , 0xE3 , 0xFB , 0xE3 , 0xFB , 0xCE , 0xFC , 0xCE , 0xFC , 0x06 , 0xF9 , 0x06 , 0xF9 , +0xA3 , 0xF8 , 0xA3 , 0xF8 , 0xA9 , 0xF9 , 0xA9 , 0xF9 , 0xFD , 0xF8 , 0xFD , 0xF8 , 0x80 , 0xF7 , 0x80 , 0xF7 , +0x29 , 0xFA , 0x29 , 0xFA , 0x29 , 0xFB , 0x29 , 0xFB , 0x27 , 0xFB , 0x27 , 0xFB , 0xAA , 0xFD , 0xAA , 0xFD , +0x66 , 0x00 , 0x66 , 0x00 , 0x27 , 0x00 , 0x27 , 0x00 , 0x38 , 0x02 , 0x38 , 0x02 , 0xC5 , 0x02 , 0xC5 , 0x02 , +0x13 , 0x01 , 0x13 , 0x01 , 0x83 , 0x00 , 0x83 , 0x00 , 0xDD , 0x00 , 0xDD , 0x00 , 0x93 , 0xFF , 0x93 , 0xFF , +0xFF , 0xFF , 0xFF , 0xFF , 0x7C , 0xFF , 0x7C , 0xFF , 0x55 , 0x03 , 0x55 , 0x03 , 0x3E , 0x08 , 0x3E , 0x08 , +0xEA , 0x02 , 0xEA , 0x02 , 0x2D , 0x08 , 0x2D , 0x08 , 0x2C , 0x09 , 0x2C , 0x09 , 0xC9 , 0x05 , 0xC9 , 0x05 , +0x5A , 0x06 , 0x5A , 0x06 , 0x9A , 0x06 , 0x9A , 0x06 , 0x04 , 0x05 , 0x04 , 0x05 , 0x22 , 0x01 , 0x22 , 0x01 , +0x27 , 0x03 , 0x27 , 0x03 , 0xBE , 0x00 , 0xBE , 0x00 , 0x94 , 0xFA , 0x94 , 0xFA , 0x6A , 0xFC , 0x6A , 0xFC , +0x9E , 0xFB , 0x9E , 0xFB , 0x8B , 0xF8 , 0x8B , 0xF8 , 0x83 , 0xF8 , 0x83 , 0xF8 , 0xFB , 0xF9 , 0xFB , 0xF9 , +0x03 , 0xF9 , 0x03 , 0xF9 , 0xC0 , 0xF7 , 0xC0 , 0xF7 , 0x2B , 0xFB , 0x2B , 0xFB , 0xEE , 0xFB , 0xEE , 0xFB , +0xFF , 0xFB , 0xFF , 0xFB , 0x51 , 0xFF , 0x51 , 0xFF , 0x7E , 0x01 , 0x7E , 0x01 , 0x57 , 0x01 , 0x57 , 0x01 , +0x70 , 0x02 , 0x70 , 0x02 , 0x7C , 0x02 , 0x7C , 0x02 , 0x8F , 0x00 , 0x8F , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , +0x1F , 0x00 , 0x1F , 0x00 , 0x7B , 0xFF , 0x7B , 0xFF , 0x82 , 0xFF , 0x82 , 0xFF , 0x1D , 0xFF , 0x1D , 0xFF , +0x97 , 0x06 , 0x97 , 0x06 , 0xAA , 0x06 , 0xAA , 0x06 , 0x6B , 0x03 , 0x6B , 0x03 , 0x3E , 0x0A , 0x3E , 0x0A , +0x70 , 0x08 , 0x70 , 0x08 , 0x83 , 0x05 , 0x83 , 0x05 , 0x08 , 0x06 , 0x08 , 0x06 , 0x57 , 0x06 , 0x57 , 0x06 , +0x68 , 0x02 , 0x68 , 0x02 , 0xDD , 0xFF , 0xDD , 0xFF , 0x58 , 0x02 , 0x58 , 0x02 , 0x8F , 0xFD , 0x8F , 0xFD , +0xCF , 0xF9 , 0xCF , 0xF9 , 0xEB , 0xFB , 0xEB , 0xFB , 0x44 , 0xFA , 0x44 , 0xFA , 0x0C , 0xF8 , 0x0C , 0xF8 , +0x37 , 0xF8 , 0x37 , 0xF8 , 0x30 , 0xFA , 0x30 , 0xFA , 0xC2 , 0xF8 , 0xC2 , 0xF8 , 0x57 , 0xF8 , 0x57 , 0xF8 , +0x02 , 0xFC , 0x02 , 0xFC , 0xAB , 0xFC , 0xAB , 0xFC , 0x65 , 0xFD , 0x65 , 0xFD , 0x2B , 0x00 , 0x2B , 0x00 , +0x46 , 0x02 , 0x46 , 0x02 , 0x12 , 0x02 , 0x12 , 0x02 , 0xBA , 0x01 , 0xBA , 0x01 , 0xD2 , 0x01 , 0xD2 , 0x01 , +0x4D , 0x00 , 0x4D , 0x00 , 0x71 , 0xFF , 0x71 , 0xFF , 0x31 , 0xFF , 0x31 , 0xFF , 0x25 , 0x00 , 0x25 , 0x00 , +0x1E , 0xFF , 0x1E , 0xFF , 0x98 , 0x00 , 0x98 , 0x00 , 0x93 , 0x08 , 0x93 , 0x08 , 0xAF , 0x05 , 0xAF , 0x05 , +0x87 , 0x05 , 0x87 , 0x05 , 0xD8 , 0x0A , 0xD8 , 0x0A , 0xB2 , 0x08 , 0xB2 , 0x08 , 0xF6 , 0x05 , 0xF6 , 0x05 , +0x23 , 0x05 , 0x23 , 0x05 , 0xFA , 0x05 , 0xFA , 0x05 , 0x25 , 0x01 , 0x25 , 0x01 , 0x1C , 0xFF , 0x1C , 0xFF , +0x80 , 0x00 , 0x80 , 0x00 , 0x79 , 0xFB , 0x79 , 0xFB , 0x09 , 0xF9 , 0x09 , 0xF9 , 0x4D , 0xFA , 0x4D , 0xFA , +0x9E , 0xF9 , 0x9E , 0xF9 , 0xAC , 0xF7 , 0xAC , 0xF7 , 0x68 , 0xF7 , 0x68 , 0xF7 , 0xF9 , 0xF9 , 0xF9 , 0xF9 , +0xEF , 0xF8 , 0xEF , 0xF8 , 0x88 , 0xF8 , 0x88 , 0xF8 , 0xCD , 0xFB , 0xCD , 0xFB , 0x19 , 0xFD , 0x19 , 0xFD , +0xE2 , 0xFD , 0xE2 , 0xFD , 0x93 , 0xFF , 0x93 , 0xFF , 0x1F , 0x02 , 0x1F , 0x02 , 0x05 , 0x02 , 0x05 , 0x02 , +0xC8 , 0x00 , 0xC8 , 0x00 , 0xF9 , 0x00 , 0xF9 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x2A , 0xFF , 0x2A , 0xFF , +0x7F , 0xFE , 0x7F , 0xFE , 0x08 , 0x00 , 0x08 , 0x00 , 0x3D , 0xFF , 0x3D , 0xFF , 0xA4 , 0x00 , 0xA4 , 0x00 , +0x0C , 0x08 , 0x0C , 0x08 , 0x30 , 0x06 , 0x30 , 0x06 , 0x22 , 0x06 , 0x22 , 0x06 , 0x26 , 0x0A , 0x26 , 0x0A , +0x94 , 0x09 , 0x94 , 0x09 , 0xBF , 0x06 , 0xBF , 0x06 , 0xA3 , 0x04 , 0xA3 , 0x04 , 0xB9 , 0x05 , 0xB9 , 0x05 , +0x22 , 0x02 , 0x22 , 0x02 , 0xD5 , 0xFE , 0xD5 , 0xFE , 0x1F , 0xFF , 0x1F , 0xFF , 0x65 , 0xFC , 0x65 , 0xFC , +0x6B , 0xF9 , 0x6B , 0xF9 , 0x21 , 0xF9 , 0x21 , 0xF9 , 0xE9 , 0xF9 , 0xE9 , 0xF9 , 0x7E , 0xF8 , 0x7E , 0xF8 , +0x95 , 0xF7 , 0x95 , 0xF7 , 0x08 , 0xFA , 0x08 , 0xFA , 0x19 , 0xFA , 0x19 , 0xFA , 0xD1 , 0xF9 , 0xD1 , 0xF9 , +0xF9 , 0xFB , 0xF9 , 0xFB , 0x78 , 0xFE , 0x78 , 0xFE , 0xEA , 0xFE , 0xEA , 0xFE , 0xAE , 0xFF , 0xAE , 0xFF , +0xE5 , 0x01 , 0xE5 , 0x01 , 0xA0 , 0x01 , 0xA0 , 0x01 , 0x0B , 0x00 , 0x0B , 0x00 , 0x76 , 0xFF , 0x76 , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0x30 , 0xFF , 0x30 , 0xFF , 0xB1 , 0xFE , 0xB1 , 0xFE , 0x64 , 0x00 , 0x64 , 0x00 , +0xC8 , 0xFF , 0xC8 , 0xFF , 0x59 , 0x04 , 0x59 , 0x04 , 0xEB , 0x07 , 0xEB , 0x07 , 0xD5 , 0x05 , 0xD5 , 0x05 , +0x69 , 0x08 , 0x69 , 0x08 , 0xCD , 0x09 , 0xCD , 0x09 , 0xDB , 0x08 , 0xDB , 0x08 , 0xCA , 0x05 , 0xCA , 0x05 , +0xD0 , 0x04 , 0xD0 , 0x04 , 0x64 , 0x04 , 0x64 , 0x04 , 0xB2 , 0x00 , 0xB2 , 0x00 , 0xDA , 0xFE , 0xDA , 0xFE , +0x91 , 0xFD , 0x91 , 0xFD , 0x72 , 0xFB , 0x72 , 0xFB , 0xE6 , 0xF9 , 0xE6 , 0xF9 , 0x94 , 0xF9 , 0x94 , 0xF9 , +0x01 , 0xFA , 0x01 , 0xFA , 0xA1 , 0xF8 , 0xA1 , 0xF8 , 0xD7 , 0xF8 , 0xD7 , 0xF8 , 0x43 , 0xFA , 0x43 , 0xFA , +0x8E , 0xFA , 0x8E , 0xFA , 0x20 , 0xFB , 0x20 , 0xFB , 0x09 , 0xFD , 0x09 , 0xFD , 0x64 , 0xFF , 0x64 , 0xFF , +0xA3 , 0xFF , 0xA3 , 0xFF , 0x99 , 0x00 , 0x99 , 0x00 , 0xDB , 0x01 , 0xDB , 0x01 , 0xF0 , 0x00 , 0xF0 , 0x00 , +0xF9 , 0xFF , 0xF9 , 0xFF , 0xA0 , 0xFF , 0xA0 , 0xFF , 0xDE , 0xFF , 0xDE , 0xFF , 0x5B , 0xFF , 0x5B , 0xFF , +0x96 , 0xFF , 0x96 , 0xFF , 0x4A , 0x00 , 0x4A , 0x00 , 0x08 , 0x01 , 0x08 , 0x01 , 0xE3 , 0x06 , 0xE3 , 0x06 , +0x34 , 0x07 , 0x34 , 0x07 , 0x65 , 0x06 , 0x65 , 0x06 , 0x37 , 0x09 , 0x37 , 0x09 , 0xA8 , 0x09 , 0xA8 , 0x09 , +0xD0 , 0x07 , 0xD0 , 0x07 , 0xF8 , 0x04 , 0xF8 , 0x04 , 0xCB , 0x04 , 0xCB , 0x04 , 0xF1 , 0x02 , 0xF1 , 0x02 , +0xF7 , 0xFF , 0xF7 , 0xFF , 0x4F , 0xFE , 0x4F , 0xFE , 0x6E , 0xFC , 0x6E , 0xFC , 0x08 , 0xFB , 0x08 , 0xFB , +0xE2 , 0xF9 , 0xE2 , 0xF9 , 0xAF , 0xF9 , 0xAF , 0xF9 , 0x7E , 0xF9 , 0x7E , 0xF9 , 0x94 , 0xF8 , 0x94 , 0xF8 , +0x56 , 0xF9 , 0x56 , 0xF9 , 0x3D , 0xFA , 0x3D , 0xFA , 0xDD , 0xFA , 0xDD , 0xFA , 0x89 , 0xFB , 0x89 , 0xFB , +0xBA , 0xFD , 0xBA , 0xFD , 0x8C , 0xFF , 0x8C , 0xFF , 0x7C , 0xFF , 0x7C , 0xFF , 0x6A , 0x00 , 0x6A , 0x00 , +0x09 , 0x01 , 0x09 , 0x01 , 0x0D , 0x00 , 0x0D , 0x00 , 0x4A , 0xFF , 0x4A , 0xFF , 0x21 , 0xFF , 0x21 , 0xFF , +0xC6 , 0xFF , 0xC6 , 0xFF , 0x36 , 0xFF , 0x36 , 0xFF , 0x37 , 0x00 , 0x37 , 0x00 , 0x46 , 0x00 , 0x46 , 0x00 , +0x36 , 0x03 , 0x36 , 0x03 , 0x27 , 0x08 , 0x27 , 0x08 , 0xC1 , 0x06 , 0xC1 , 0x06 , 0xC4 , 0x07 , 0xC4 , 0x07 , +0x5B , 0x09 , 0x5B , 0x09 , 0xD0 , 0x08 , 0xD0 , 0x08 , 0x55 , 0x06 , 0x55 , 0x06 , 0x30 , 0x04 , 0x30 , 0x04 , +0xD5 , 0x03 , 0xD5 , 0x03 , 0x24 , 0x01 , 0x24 , 0x01 , 0xD5 , 0xFE , 0xD5 , 0xFE , 0x5B , 0xFD , 0x5B , 0xFD , +0x79 , 0xFB , 0x79 , 0xFB , 0xC8 , 0xFA , 0xC8 , 0xFA , 0x1B , 0xFA , 0x1B , 0xFA , 0x12 , 0xFA , 0x12 , 0xFA , +0x8B , 0xF9 , 0x8B , 0xF9 , 0x60 , 0xF9 , 0x60 , 0xF9 , 0x23 , 0xFA , 0x23 , 0xFA , 0x7B , 0xFA , 0x7B , 0xFA , +0x05 , 0xFB , 0x05 , 0xFB , 0x0A , 0xFC , 0x0A , 0xFC , 0x3D , 0xFE , 0x3D , 0xFE , 0x3A , 0xFF , 0x3A , 0xFF , +0x4C , 0xFF , 0x4C , 0xFF , 0x76 , 0x00 , 0x76 , 0x00 , 0x83 , 0x00 , 0x83 , 0x00 , 0xA4 , 0xFF , 0xA4 , 0xFF , +0x0C , 0xFF , 0x0C , 0xFF , 0x75 , 0xFF , 0x75 , 0xFF , 0x13 , 0x00 , 0x13 , 0x00 , 0xDB , 0xFF , 0xDB , 0xFF , +0xF9 , 0x00 , 0xF9 , 0x00 , 0xFB , 0x00 , 0xFB , 0x00 , 0x27 , 0x05 , 0x27 , 0x05 , 0x24 , 0x08 , 0x24 , 0x08 , +0xAC , 0x06 , 0xAC , 0x06 , 0x31 , 0x08 , 0x31 , 0x08 , 0xF9 , 0x08 , 0xF9 , 0x08 , 0x12 , 0x08 , 0x12 , 0x08 , +0x72 , 0x05 , 0x72 , 0x05 , 0x15 , 0x04 , 0x15 , 0x04 , 0x92 , 0x03 , 0x92 , 0x03 , 0x78 , 0x00 , 0x78 , 0x00 , +0xDE , 0xFE , 0xDE , 0xFE , 0xB7 , 0xFD , 0xB7 , 0xFD , 0xE2 , 0xFB , 0xE2 , 0xFB , 0x4B , 0xFB , 0x4B , 0xFB , +0xBE , 0xFA , 0xBE , 0xFA , 0x19 , 0xFB , 0x19 , 0xFB , 0x33 , 0xFA , 0x33 , 0xFA , 0xFA , 0xF9 , 0xFA , 0xF9 , +0xB9 , 0xFA , 0xB9 , 0xFA , 0xB3 , 0xFA , 0xB3 , 0xFA , 0x21 , 0xFB , 0x21 , 0xFB , 0x02 , 0xFC , 0x02 , 0xFC , +0x3A , 0xFE , 0x3A , 0xFE , 0x2E , 0xFF , 0x2E , 0xFF , 0x39 , 0xFF , 0x39 , 0xFF , 0x7F , 0x00 , 0x7F , 0x00 , +0x6A , 0x00 , 0x6A , 0x00 , 0xC0 , 0xFF , 0xC0 , 0xFF , 0xBB , 0xFE , 0xBB , 0xFE , 0xA1 , 0xFE , 0xA1 , 0xFE , +0x22 , 0xFF , 0x22 , 0xFF , 0x06 , 0xFF , 0x06 , 0xFF , 0x67 , 0x00 , 0x67 , 0x00 , 0xCB , 0x00 , 0xCB , 0x00 , +0x41 , 0x05 , 0x41 , 0x05 , 0x88 , 0x08 , 0x88 , 0x08 , 0xB9 , 0x07 , 0xB9 , 0x07 , 0x3F , 0x09 , 0x3F , 0x09 , +0x8A , 0x09 , 0x8A , 0x09 , 0x5C , 0x08 , 0x5C , 0x08 , 0xA7 , 0x04 , 0xA7 , 0x04 , 0x8C , 0x02 , 0x8C , 0x02 , +0xD8 , 0x01 , 0xD8 , 0x01 , 0x34 , 0xFE , 0x34 , 0xFE , 0xB3 , 0xFC , 0xB3 , 0xFC , 0xC8 , 0xFB , 0xC8 , 0xFB , +0x4A , 0xFB , 0x4A , 0xFB , 0xCA , 0xFA , 0xCA , 0xFA , 0x68 , 0xFA , 0x68 , 0xFA , 0x71 , 0xFB , 0x71 , 0xFB , +0xA9 , 0xFA , 0xA9 , 0xFA , 0x9C , 0xFA , 0x9C , 0xFA , 0x0D , 0xFB , 0x0D , 0xFB , 0x61 , 0xFB , 0x61 , 0xFB , +0xDF , 0xFB , 0xDF , 0xFB , 0xBC , 0xFC , 0xBC , 0xFC , 0x84 , 0xFE , 0x84 , 0xFE , 0xED , 0xFE , 0xED , 0xFE , +0x16 , 0xFF , 0x16 , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0xC6 , 0xFF , 0xC6 , 0xFF , 0x75 , 0xFF , 0x75 , 0xFF , +0x9A , 0xFE , 0x9A , 0xFE , 0xE5 , 0xFE , 0xE5 , 0xFE , 0x3A , 0xFF , 0x3A , 0xFF , 0xBC , 0xFF , 0xBC , 0xFF , +0x91 , 0x00 , 0x91 , 0x00 , 0x9A , 0x02 , 0x9A , 0x02 , 0xEE , 0x07 , 0xEE , 0x07 , 0xFE , 0x08 , 0xFE , 0x08 , +0x00 , 0x09 , 0x00 , 0x09 , 0x9E , 0x0A , 0x9E , 0x0A , 0x2C , 0x0A , 0x2C , 0x0A , 0xA0 , 0x07 , 0xA0 , 0x07 , +0xB4 , 0x03 , 0xB4 , 0x03 , 0x97 , 0x02 , 0x97 , 0x02 , 0x87 , 0x00 , 0x87 , 0x00 , 0x0B , 0xFD , 0x0B , 0xFD , +0xD3 , 0xFB , 0xD3 , 0xFB , 0x76 , 0xFB , 0x76 , 0xFB , 0xC8 , 0xFB , 0xC8 , 0xFB , 0xBD , 0xFA , 0xBD , 0xFA , +0x5A , 0xFB , 0x5A , 0xFB , 0xC9 , 0xFB , 0xC9 , 0xFB , 0x0A , 0xFB , 0x0A , 0xFB , 0x16 , 0xFB , 0x16 , 0xFB , +0x39 , 0xFB , 0x39 , 0xFB , 0xE0 , 0xFB , 0xE0 , 0xFB , 0x2B , 0xFC , 0x2B , 0xFC , 0x33 , 0xFD , 0x33 , 0xFD , +0x4C , 0xFE , 0x4C , 0xFE , 0x09 , 0xFE , 0x09 , 0xFE , 0x80 , 0xFE , 0x80 , 0xFE , 0xEE , 0xFE , 0xEE , 0xFE , +0xBF , 0xFE , 0xBF , 0xFE , 0x94 , 0xFE , 0x94 , 0xFE , 0x40 , 0xFE , 0x40 , 0xFE , 0x0A , 0xFF , 0x0A , 0xFF , +0x67 , 0xFF , 0x67 , 0xFF , 0x3C , 0x00 , 0x3C , 0x00 , 0x2E , 0x01 , 0x2E , 0x01 , 0xD1 , 0x04 , 0xD1 , 0x04 , +0x17 , 0x09 , 0x17 , 0x09 , 0x18 , 0x09 , 0x18 , 0x09 , 0xE1 , 0x09 , 0xE1 , 0x09 , 0xFE , 0x0A , 0xFE , 0x0A , +0xD3 , 0x09 , 0xD3 , 0x09 , 0xB4 , 0x06 , 0xB4 , 0x06 , 0xAE , 0x03 , 0xAE , 0x03 , 0xC2 , 0x02 , 0xC2 , 0x02 , +0x18 , 0x00 , 0x18 , 0x00 , 0x28 , 0xFD , 0x28 , 0xFD , 0xBA , 0xFB , 0xBA , 0xFB , 0xC1 , 0xFB , 0xC1 , 0xFB , +0x74 , 0xFB , 0x74 , 0xFB , 0x85 , 0xFA , 0x85 , 0xFA , 0x92 , 0xFB , 0x92 , 0xFB , 0xD7 , 0xFB , 0xD7 , 0xFB , +0xCF , 0xFA , 0xCF , 0xFA , 0x48 , 0xFA , 0x48 , 0xFA , 0xB4 , 0xFA , 0xB4 , 0xFA , 0x21 , 0xFB , 0x21 , 0xFB , +0x22 , 0xFB , 0x22 , 0xFB , 0xC5 , 0xFB , 0xC5 , 0xFB , 0x01 , 0xFD , 0x01 , 0xFD , 0x89 , 0xFD , 0x89 , 0xFD , +0xE9 , 0xFD , 0xE9 , 0xFD , 0xD9 , 0xFD , 0xD9 , 0xFD , 0x51 , 0xFE , 0x51 , 0xFE , 0x62 , 0xFE , 0x62 , 0xFE , +0x47 , 0xFE , 0x47 , 0xFE , 0xF6 , 0xFE , 0xF6 , 0xFE , 0xF2 , 0xFF , 0xF2 , 0xFF , 0xC9 , 0x00 , 0xC9 , 0x00 , +0x57 , 0x02 , 0x57 , 0x02 , 0xB3 , 0x06 , 0xB3 , 0x06 , 0x23 , 0x09 , 0x23 , 0x09 , 0x30 , 0x09 , 0x30 , 0x09 , +0x32 , 0x0A , 0x32 , 0x0A , 0x4E , 0x0A , 0x4E , 0x0A , 0x92 , 0x08 , 0x92 , 0x08 , 0x5B , 0x05 , 0x5B , 0x05 , +0x66 , 0x03 , 0x66 , 0x03 , 0x19 , 0x02 , 0x19 , 0x02 , 0x73 , 0xFF , 0x73 , 0xFF , 0x23 , 0xFD , 0x23 , 0xFD , +0x1D , 0xFC , 0x1D , 0xFC , 0x65 , 0xFC , 0x65 , 0xFC , 0xCB , 0xFB , 0xCB , 0xFB , 0x86 , 0xFB , 0x86 , 0xFB , +0xED , 0xFB , 0xED , 0xFB , 0x91 , 0xFB , 0x91 , 0xFB , 0x9C , 0xFA , 0x9C , 0xFA , 0x23 , 0xFA , 0x23 , 0xFA , +0x67 , 0xFA , 0x67 , 0xFA , 0xCA , 0xFA , 0xCA , 0xFA , 0x2B , 0xFB , 0x2B , 0xFB , 0xED , 0xFB , 0xED , 0xFB , +0x20 , 0xFD , 0x20 , 0xFD , 0x49 , 0xFE , 0x49 , 0xFE , 0x6E , 0xFE , 0x6E , 0xFE , 0x6C , 0xFE , 0x6C , 0xFE , +0xD9 , 0xFE , 0xD9 , 0xFE , 0xFB , 0xFE , 0xFB , 0xFE , 0x5B , 0xFF , 0x5B , 0xFF , 0xD7 , 0xFF , 0xD7 , 0xFF , +0xF6 , 0x00 , 0xF6 , 0x00 , 0xCE , 0x01 , 0xCE , 0x01 , 0x46 , 0x04 , 0x46 , 0x04 , 0xE3 , 0x07 , 0xE3 , 0x07 , +0x0C , 0x09 , 0x0C , 0x09 , 0xBE , 0x09 , 0xBE , 0x09 , 0x4A , 0x0A , 0x4A , 0x0A , 0x9B , 0x09 , 0x9B , 0x09 , +0xBC , 0x07 , 0xBC , 0x07 , 0x1F , 0x05 , 0x1F , 0x05 , 0xB0 , 0x03 , 0xB0 , 0x03 , 0xE9 , 0x01 , 0xE9 , 0x01 , +0x7D , 0xFF , 0x7D , 0xFF , 0x8B , 0xFD , 0x8B , 0xFD , 0xC4 , 0xFC , 0xC4 , 0xFC , 0xA1 , 0xFC , 0xA1 , 0xFC , +0xF5 , 0xFB , 0xF5 , 0xFB , 0xBF , 0xFB , 0xBF , 0xFB , 0x9C , 0xFB , 0x9C , 0xFB , 0xBE , 0xFA , 0xBE , 0xFA , +0xD2 , 0xF9 , 0xD2 , 0xF9 , 0xA6 , 0xF9 , 0xA6 , 0xF9 , 0xC7 , 0xF9 , 0xC7 , 0xF9 , 0x31 , 0xFA , 0x31 , 0xFA , +0xE1 , 0xFA , 0xE1 , 0xFA , 0xC5 , 0xFB , 0xC5 , 0xFB , 0x1F , 0xFD , 0x1F , 0xFD , 0xFC , 0xFD , 0xFC , 0xFD , +0x11 , 0xFE , 0x11 , 0xFE , 0x56 , 0xFE , 0x56 , 0xFE , 0x81 , 0xFE , 0x81 , 0xFE , 0xEA , 0xFE , 0xEA , 0xFE , +0x3B , 0xFF , 0x3B , 0xFF , 0x02 , 0x00 , 0x02 , 0x00 , 0x26 , 0x01 , 0x26 , 0x01 , 0x63 , 0x02 , 0x63 , 0x02 , +0xC9 , 0x05 , 0xC9 , 0x05 , 0x79 , 0x08 , 0x79 , 0x08 , 0x2E , 0x09 , 0x2E , 0x09 , 0x08 , 0x0A , 0x08 , 0x0A , +0x03 , 0x0A , 0x03 , 0x0A , 0xE7 , 0x08 , 0xE7 , 0x08 , 0xBE , 0x06 , 0xBE , 0x06 , 0x97 , 0x04 , 0x97 , 0x04 , +0x1B , 0x03 , 0x1B , 0x03 , 0x01 , 0x01 , 0x01 , 0x01 , 0xAD , 0xFE , 0xAD , 0xFE , 0x0F , 0xFD , 0x0F , 0xFD , +0xC4 , 0xFC , 0xC4 , 0xFC , 0x6C , 0xFC , 0x6C , 0xFC , 0xD7 , 0xFB , 0xD7 , 0xFB , 0xAA , 0xFB , 0xAA , 0xFB , +0x56 , 0xFB , 0x56 , 0xFB , 0x6C , 0xFA , 0x6C , 0xFA , 0xC8 , 0xF9 , 0xC8 , 0xF9 , 0xCC , 0xF9 , 0xCC , 0xF9 , +0xF2 , 0xF9 , 0xF2 , 0xF9 , 0xA0 , 0xFA , 0xA0 , 0xFA , 0x63 , 0xFB , 0x63 , 0xFB , 0x75 , 0xFC , 0x75 , 0xFC , +0xB3 , 0xFD , 0xB3 , 0xFD , 0x1C , 0xFE , 0x1C , 0xFE , 0x4D , 0xFE , 0x4D , 0xFE , 0x7D , 0xFE , 0x7D , 0xFE , +0xA8 , 0xFE , 0xA8 , 0xFE , 0xFD , 0xFE , 0xFD , 0xFE , 0x47 , 0xFF , 0x47 , 0xFF , 0x47 , 0x00 , 0x47 , 0x00 , +0x25 , 0x01 , 0x25 , 0x01 , 0x0C , 0x03 , 0x0C , 0x03 , 0x4C , 0x06 , 0x4C , 0x06 , 0xF9 , 0x07 , 0xF9 , 0x07 , +0xFB , 0x08 , 0xFB , 0x08 , 0xBB , 0x09 , 0xBB , 0x09 , 0x6F , 0x09 , 0x6F , 0x09 , 0x10 , 0x08 , 0x10 , 0x08 , +0xE2 , 0x05 , 0xE2 , 0x05 , 0x53 , 0x04 , 0x53 , 0x04 , 0xB0 , 0x02 , 0xB0 , 0x02 , 0x86 , 0x00 , 0x86 , 0x00 , +0x90 , 0xFE , 0x90 , 0xFE , 0x95 , 0xFD , 0x95 , 0xFD , 0x6B , 0xFD , 0x6B , 0xFD , 0xC0 , 0xFC , 0xC0 , 0xFC , +0x17 , 0xFC , 0x17 , 0xFC , 0xC9 , 0xFB , 0xC9 , 0xFB , 0x46 , 0xFB , 0x46 , 0xFB , 0x4C , 0xFA , 0x4C , 0xFA , +0xC5 , 0xF9 , 0xC5 , 0xF9 , 0xB9 , 0xF9 , 0xB9 , 0xF9 , 0x07 , 0xFA , 0x07 , 0xFA , 0xAF , 0xFA , 0xAF , 0xFA , +0x67 , 0xFB , 0x67 , 0xFB , 0x9E , 0xFC , 0x9E , 0xFC , 0x92 , 0xFD , 0x92 , 0xFD , 0xDD , 0xFD , 0xDD , 0xFD , +0x05 , 0xFE , 0x05 , 0xFE , 0x19 , 0xFE , 0x19 , 0xFE , 0x78 , 0xFE , 0x78 , 0xFE , 0xE2 , 0xFE , 0xE2 , 0xFE , +0x91 , 0xFF , 0x91 , 0xFF , 0xAB , 0x00 , 0xAB , 0x00 , 0xD2 , 0x01 , 0xD2 , 0x01 , 0x6D , 0x04 , 0x6D , 0x04 , +0xF7 , 0x06 , 0xF7 , 0x06 , 0x3A , 0x08 , 0x3A , 0x08 , 0x58 , 0x09 , 0x58 , 0x09 , 0x91 , 0x09 , 0x91 , 0x09 , +0xDE , 0x08 , 0xDE , 0x08 , 0x51 , 0x07 , 0x51 , 0x07 , 0xAD , 0x05 , 0xAD , 0x05 , 0x4F , 0x04 , 0x4F , 0x04 , +0x5E , 0x02 , 0x5E , 0x02 , 0x63 , 0x00 , 0x63 , 0x00 , 0xC5 , 0xFE , 0xC5 , 0xFE , 0x0C , 0xFE , 0x0C , 0xFE , +0x7F , 0xFD , 0x7F , 0xFD , 0xB1 , 0xFC , 0xB1 , 0xFC , 0x2D , 0xFC , 0x2D , 0xFC , 0xA6 , 0xFB , 0xA6 , 0xFB , +0xCA , 0xFA , 0xCA , 0xFA , 0x09 , 0xFA , 0x09 , 0xFA , 0xD2 , 0xF9 , 0xD2 , 0xF9 , 0xD6 , 0xF9 , 0xD6 , 0xF9 , +0x53 , 0xFA , 0x53 , 0xFA , 0x0F , 0xFB , 0x0F , 0xFB , 0xF9 , 0xFB , 0xF9 , 0xFB , 0x1B , 0xFD , 0x1B , 0xFD , +0xCD , 0xFD , 0xCD , 0xFD , 0x0E , 0xFE , 0x0E , 0xFE , 0x13 , 0xFE , 0x13 , 0xFE , 0x24 , 0xFE , 0x24 , 0xFE , +0x96 , 0xFE , 0x96 , 0xFE , 0x11 , 0xFF , 0x11 , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0x06 , 0x01 , 0x06 , 0x01 , +0xAE , 0x02 , 0xAE , 0x02 , 0x87 , 0x05 , 0x87 , 0x05 , 0x8A , 0x07 , 0x8A , 0x07 , 0xC4 , 0x08 , 0xC4 , 0x08 , +0x9C , 0x09 , 0x9C , 0x09 , 0x63 , 0x09 , 0x63 , 0x09 , 0x4F , 0x08 , 0x4F , 0x08 , 0x9A , 0x06 , 0x9A , 0x06 , +0x2E , 0x05 , 0x2E , 0x05 , 0xB1 , 0x03 , 0xB1 , 0x03 , 0xCC , 0x01 , 0xCC , 0x01 , 0x02 , 0x00 , 0x02 , 0x00 , +0xC8 , 0xFE , 0xC8 , 0xFE , 0x4D , 0xFE , 0x4D , 0xFE , 0x95 , 0xFD , 0x95 , 0xFD , 0xCB , 0xFC , 0xCB , 0xFC , +0x22 , 0xFC , 0x22 , 0xFC , 0x42 , 0xFB , 0x42 , 0xFB , 0x25 , 0xFA , 0x25 , 0xFA , 0x84 , 0xF9 , 0x84 , 0xF9 , +0x6E , 0xF9 , 0x6E , 0xF9 , 0x9F , 0xF9 , 0x9F , 0xF9 , 0x49 , 0xFA , 0x49 , 0xFA , 0x1A , 0xFB , 0x1A , 0xFB , +0x33 , 0xFC , 0x33 , 0xFC , 0x3C , 0xFD , 0x3C , 0xFD , 0xC8 , 0xFD , 0xC8 , 0xFD , 0x21 , 0xFE , 0x21 , 0xFE , +0x4E , 0xFE , 0x4E , 0xFE , 0xAF , 0xFE , 0xAF , 0xFE , 0x34 , 0xFF , 0x34 , 0xFF , 0xC6 , 0xFF , 0xC6 , 0xFF , +0xA8 , 0x00 , 0xA8 , 0x00 , 0xA6 , 0x01 , 0xA6 , 0x01 , 0x9B , 0x03 , 0x9B , 0x03 , 0xD2 , 0x05 , 0xD2 , 0x05 , +0x21 , 0x07 , 0x21 , 0x07 , 0x1C , 0x08 , 0x1C , 0x08 , 0x6B , 0x08 , 0x6B , 0x08 , 0xE2 , 0x07 , 0xE2 , 0x07 , +0xA6 , 0x06 , 0xA6 , 0x06 , 0x37 , 0x05 , 0x37 , 0x05 , 0x12 , 0x04 , 0x12 , 0x04 , 0x9E , 0x02 , 0x9E , 0x02 , +0xF9 , 0x00 , 0xF9 , 0x00 , 0x92 , 0xFF , 0x92 , 0xFF , 0xD8 , 0xFE , 0xD8 , 0xFE , 0x57 , 0xFE , 0x57 , 0xFE , +0x8A , 0xFD , 0x8A , 0xFD , 0xDF , 0xFC , 0xDF , 0xFC , 0x3D , 0xFC , 0x3D , 0xFC , 0x46 , 0xFB , 0x46 , 0xFB , +0x62 , 0xFA , 0x62 , 0xFA , 0x11 , 0xFA , 0x11 , 0xFA , 0x04 , 0xFA , 0x04 , 0xFA , 0x46 , 0xFA , 0x46 , 0xFA , +0xD1 , 0xFA , 0xD1 , 0xFA , 0x97 , 0xFB , 0x97 , 0xFB , 0x94 , 0xFC , 0x94 , 0xFC , 0x47 , 0xFD , 0x47 , 0xFD , +0xAA , 0xFD , 0xAA , 0xFD , 0xF3 , 0xFD , 0xF3 , 0xFD , 0x5E , 0xFE , 0x5E , 0xFE , 0x03 , 0xFF , 0x03 , 0xFF , +0x9B , 0xFF , 0x9B , 0xFF , 0x5B , 0x00 , 0x5B , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0xBB , 0x02 , 0xBB , 0x02 , +0xBB , 0x04 , 0xBB , 0x04 , 0x13 , 0x06 , 0x13 , 0x06 , 0x18 , 0x07 , 0x18 , 0x07 , 0x9D , 0x07 , 0x9D , 0x07 , +0x67 , 0x07 , 0x67 , 0x07 , 0x84 , 0x06 , 0x84 , 0x06 , 0x58 , 0x05 , 0x58 , 0x05 , 0x49 , 0x04 , 0x49 , 0x04 , +0xF9 , 0x02 , 0xF9 , 0x02 , 0x6A , 0x01 , 0x6A , 0x01 , 0x0A , 0x00 , 0x0A , 0x00 , 0x46 , 0xFF , 0x46 , 0xFF , +0xC1 , 0xFE , 0xC1 , 0xFE , 0x00 , 0xFE , 0x00 , 0xFE , 0x50 , 0xFD , 0x50 , 0xFD , 0xB8 , 0xFC , 0xB8 , 0xFC , +0xD7 , 0xFB , 0xD7 , 0xFB , 0xE6 , 0xFA , 0xE6 , 0xFA , 0x81 , 0xFA , 0x81 , 0xFA , 0x67 , 0xFA , 0x67 , 0xFA , +0x8C , 0xFA , 0x8C , 0xFA , 0xFB , 0xFA , 0xFB , 0xFA , 0xA9 , 0xFB , 0xA9 , 0xFB , 0x96 , 0xFC , 0x96 , 0xFC , +0x52 , 0xFD , 0x52 , 0xFD , 0xBC , 0xFD , 0xBC , 0xFD , 0x03 , 0xFE , 0x03 , 0xFE , 0x68 , 0xFE , 0x68 , 0xFE , +0x0C , 0xFF , 0x0C , 0xFF , 0xB4 , 0xFF , 0xB4 , 0xFF , 0x82 , 0x00 , 0x82 , 0x00 , 0x4F , 0x01 , 0x4F , 0x01 , +0x87 , 0x02 , 0x87 , 0x02 , 0x69 , 0x04 , 0x69 , 0x04 , 0xD9 , 0x05 , 0xD9 , 0x05 , 0xD3 , 0x06 , 0xD3 , 0x06 , +0x66 , 0x07 , 0x66 , 0x07 , 0x4D , 0x07 , 0x4D , 0x07 , 0x90 , 0x06 , 0x90 , 0x06 , 0x72 , 0x05 , 0x72 , 0x05 , +0x61 , 0x04 , 0x61 , 0x04 , 0x37 , 0x03 , 0x37 , 0x03 , 0xBF , 0x01 , 0xBF , 0x01 , 0x4C , 0x00 , 0x4C , 0x00 , +0x69 , 0xFF , 0x69 , 0xFF , 0xDB , 0xFE , 0xDB , 0xFE , 0x23 , 0xFE , 0x23 , 0xFE , 0x61 , 0xFD , 0x61 , 0xFD , +0xC4 , 0xFC , 0xC4 , 0xFC , 0x04 , 0xFC , 0x04 , 0xFC , 0x1B , 0xFB , 0x1B , 0xFB , 0xA1 , 0xFA , 0xA1 , 0xFA , +0x80 , 0xFA , 0x80 , 0xFA , 0xA0 , 0xFA , 0xA0 , 0xFA , 0x02 , 0xFB , 0x02 , 0xFB , 0x9C , 0xFB , 0x9C , 0xFB , +0x76 , 0xFC , 0x76 , 0xFC , 0x3D , 0xFD , 0x3D , 0xFD , 0xC4 , 0xFD , 0xC4 , 0xFD , 0x10 , 0xFE , 0x10 , 0xFE , +0x60 , 0xFE , 0x60 , 0xFE , 0xFB , 0xFE , 0xFB , 0xFE , 0xAB , 0xFF , 0xAB , 0xFF , 0x72 , 0x00 , 0x72 , 0x00 , +0x36 , 0x01 , 0x36 , 0x01 , 0x41 , 0x02 , 0x41 , 0x02 , 0xF5 , 0x03 , 0xF5 , 0x03 , 0x70 , 0x05 , 0x70 , 0x05 , +0x73 , 0x06 , 0x73 , 0x06 , 0x06 , 0x07 , 0x06 , 0x07 , 0x07 , 0x07 , 0x07 , 0x07 , 0x73 , 0x06 , 0x73 , 0x06 , +0x73 , 0x05 , 0x73 , 0x05 , 0x79 , 0x04 , 0x79 , 0x04 , 0x6E , 0x03 , 0x6E , 0x03 , 0x20 , 0x02 , 0x20 , 0x02 , +0xB5 , 0x00 , 0xB5 , 0x00 , 0xBB , 0xFF , 0xBB , 0xFF , 0x1C , 0xFF , 0x1C , 0xFF , 0x61 , 0xFE , 0x61 , 0xFE , +0x98 , 0xFD , 0x98 , 0xFD , 0xF9 , 0xFC , 0xF9 , 0xFC , 0x53 , 0xFC , 0x53 , 0xFC , 0x84 , 0xFB , 0x84 , 0xFB , +0x0B , 0xFB , 0x0B , 0xFB , 0xE1 , 0xFA , 0xE1 , 0xFA , 0xF6 , 0xFA , 0xF6 , 0xFA , 0x45 , 0xFB , 0x45 , 0xFB , +0xBC , 0xFB , 0xBC , 0xFB , 0x6F , 0xFC , 0x6F , 0xFC , 0x21 , 0xFD , 0x21 , 0xFD , 0xA8 , 0xFD , 0xA8 , 0xFD , +0xEE , 0xFD , 0xEE , 0xFD , 0x3C , 0xFE , 0x3C , 0xFE , 0xEA , 0xFE , 0xEA , 0xFE , 0xA3 , 0xFF , 0xA3 , 0xFF , +0x5F , 0x00 , 0x5F , 0x00 , 0x16 , 0x01 , 0x16 , 0x01 , 0x19 , 0x02 , 0x19 , 0x02 , 0xB9 , 0x03 , 0xB9 , 0x03 , +0x2F , 0x05 , 0x2F , 0x05 , 0x39 , 0x06 , 0x39 , 0x06 , 0xD3 , 0x06 , 0xD3 , 0x06 , 0xDF , 0x06 , 0xDF , 0x06 , +0x56 , 0x06 , 0x56 , 0x06 , 0x71 , 0x05 , 0x71 , 0x05 , 0x90 , 0x04 , 0x90 , 0x04 , 0x8E , 0x03 , 0x8E , 0x03 , +0x46 , 0x02 , 0x46 , 0x02 , 0xD4 , 0x00 , 0xD4 , 0x00 , 0xC0 , 0xFF , 0xC0 , 0xFF , 0x06 , 0xFF , 0x06 , 0xFF , +0x31 , 0xFE , 0x31 , 0xFE , 0x66 , 0xFD , 0x66 , 0xFD , 0xC3 , 0xFC , 0xC3 , 0xFC , 0x1D , 0xFC , 0x1D , 0xFC , +0x5B , 0xFB , 0x5B , 0xFB , 0xF5 , 0xFA , 0xF5 , 0xFA , 0xDC , 0xFA , 0xDC , 0xFA , 0xF4 , 0xFA , 0xF4 , 0xFA , +0x4A , 0xFB , 0x4A , 0xFB , 0xBC , 0xFB , 0xBC , 0xFB , 0x5F , 0xFC , 0x5F , 0xFC , 0x09 , 0xFD , 0x09 , 0xFD , +0x8F , 0xFD , 0x8F , 0xFD , 0xE3 , 0xFD , 0xE3 , 0xFD , 0x53 , 0xFE , 0x53 , 0xFE , 0x22 , 0xFF , 0x22 , 0xFF , +0xEE , 0xFF , 0xEE , 0xFF , 0xB5 , 0x00 , 0xB5 , 0x00 , 0x6D , 0x01 , 0x6D , 0x01 , 0x55 , 0x02 , 0x55 , 0x02 , +0xC1 , 0x03 , 0xC1 , 0x03 , 0x04 , 0x05 , 0x04 , 0x05 , 0xE5 , 0x05 , 0xE5 , 0x05 , 0x69 , 0x06 , 0x69 , 0x06 , +0x66 , 0x06 , 0x66 , 0x06 , 0xE8 , 0x05 , 0xE8 , 0x05 , 0x26 , 0x05 , 0x26 , 0x05 , 0x5E , 0x04 , 0x5E , 0x04 , +0x69 , 0x03 , 0x69 , 0x03 , 0x34 , 0x02 , 0x34 , 0x02 , 0xD7 , 0x00 , 0xD7 , 0x00 , 0xC9 , 0xFF , 0xC9 , 0xFF , +0x0E , 0xFF , 0x0E , 0xFF , 0x45 , 0xFE , 0x45 , 0xFE , 0x90 , 0xFD , 0x90 , 0xFD , 0xF5 , 0xFC , 0xF5 , 0xFC , +0x54 , 0xFC , 0x54 , 0xFC , 0xBD , 0xFB , 0xBD , 0xFB , 0x82 , 0xFB , 0x82 , 0xFB , 0x78 , 0xFB , 0x78 , 0xFB , +0x94 , 0xFB , 0x94 , 0xFB , 0xED , 0xFB , 0xED , 0xFB , 0x59 , 0xFC , 0x59 , 0xFC , 0xDF , 0xFC , 0xDF , 0xFC , +0x5D , 0xFD , 0x5D , 0xFD , 0xCE , 0xFD , 0xCE , 0xFD , 0x2B , 0xFE , 0x2B , 0xFE , 0xCD , 0xFE , 0xCD , 0xFE , +0xA7 , 0xFF , 0xA7 , 0xFF , 0x69 , 0x00 , 0x69 , 0x00 , 0x2F , 0x01 , 0x2F , 0x01 , 0xDB , 0x01 , 0xDB , 0x01 , +0xE9 , 0x02 , 0xE9 , 0x02 , 0x45 , 0x04 , 0x45 , 0x04 , 0x44 , 0x05 , 0x44 , 0x05 , 0xF8 , 0x05 , 0xF8 , 0x05 , +0x3C , 0x06 , 0x3C , 0x06 , 0x03 , 0x06 , 0x03 , 0x06 , 0x6B , 0x05 , 0x6B , 0x05 , 0xB7 , 0x04 , 0xB7 , 0x04 , +0xEC , 0x03 , 0xEC , 0x03 , 0xDE , 0x02 , 0xDE , 0x02 , 0x99 , 0x01 , 0x99 , 0x01 , 0x4F , 0x00 , 0x4F , 0x00 , +0x70 , 0xFF , 0x70 , 0xFF , 0xB6 , 0xFE , 0xB6 , 0xFE , 0xE5 , 0xFD , 0xE5 , 0xFD , 0x08 , 0xFD , 0x08 , 0xFD , +0x37 , 0xFC , 0x37 , 0xFC , 0x86 , 0xFB , 0x86 , 0xFB , 0x20 , 0xFB , 0x20 , 0xFB , 0x0C , 0xFB , 0x0C , 0xFB , +0x0B , 0xFB , 0x0B , 0xFB , 0x4C , 0xFB , 0x4C , 0xFB , 0xBD , 0xFB , 0xBD , 0xFB , 0x3D , 0xFC , 0x3D , 0xFC , +0xCA , 0xFC , 0xCA , 0xFC , 0x4C , 0xFD , 0x4C , 0xFD , 0xAE , 0xFD , 0xAE , 0xFD , 0x10 , 0xFE , 0x10 , 0xFE , +0xE1 , 0xFE , 0xE1 , 0xFE , 0xE3 , 0xFF , 0xE3 , 0xFF , 0xC6 , 0x00 , 0xC6 , 0x00 , 0x83 , 0x01 , 0x83 , 0x01 , +0x2D , 0x02 , 0x2D , 0x02 , 0x38 , 0x03 , 0x38 , 0x03 , 0x70 , 0x04 , 0x70 , 0x04 , 0x54 , 0x05 , 0x54 , 0x05 , +0xDD , 0x05 , 0xDD , 0x05 , 0x05 , 0x06 , 0x05 , 0x06 , 0xB7 , 0x05 , 0xB7 , 0x05 , 0x19 , 0x05 , 0x19 , 0x05 , +0x69 , 0x04 , 0x69 , 0x04 , 0x9E , 0x03 , 0x9E , 0x03 , 0x98 , 0x02 , 0x98 , 0x02 , 0x5E , 0x01 , 0x5E , 0x01 , +0x20 , 0x00 , 0x20 , 0x00 , 0x4A , 0xFF , 0x4A , 0xFF , 0x9E , 0xFE , 0x9E , 0xFE , 0xD9 , 0xFD , 0xD9 , 0xFD , +0xF7 , 0xFC , 0xF7 , 0xFC , 0x28 , 0xFC , 0x28 , 0xFC , 0x8C , 0xFB , 0x8C , 0xFB , 0x3E , 0xFB , 0x3E , 0xFB , +0x3F , 0xFB , 0x3F , 0xFB , 0x4A , 0xFB , 0x4A , 0xFB , 0x8A , 0xFB , 0x8A , 0xFB , 0xEE , 0xFB , 0xEE , 0xFB , +0x66 , 0xFC , 0x66 , 0xFC , 0xFB , 0xFC , 0xFB , 0xFC , 0x88 , 0xFD , 0x88 , 0xFD , 0xF8 , 0xFD , 0xF8 , 0xFD , +0x6A , 0xFE , 0x6A , 0xFE , 0x49 , 0xFF , 0x49 , 0xFF , 0x55 , 0x00 , 0x55 , 0x00 , 0x2A , 0x01 , 0x2A , 0x01 , +0xDA , 0x01 , 0xDA , 0x01 , 0x61 , 0x02 , 0x61 , 0x02 , 0x1C , 0x03 , 0x1C , 0x03 , 0xFB , 0x03 , 0xFB , 0x03 , +0x95 , 0x04 , 0x95 , 0x04 , 0xE3 , 0x04 , 0xE3 , 0x04 , 0xE2 , 0x04 , 0xE2 , 0x04 , 0x8B , 0x04 , 0x8B , 0x04 , +0xFB , 0x03 , 0xFB , 0x03 , 0x53 , 0x03 , 0x53 , 0x03 , 0x83 , 0x02 , 0x83 , 0x02 , 0x88 , 0x01 , 0x88 , 0x01 , +0x6C , 0x00 , 0x6C , 0x00 , 0x78 , 0xFF , 0x78 , 0xFF , 0xD0 , 0xFE , 0xD0 , 0xFE , 0x32 , 0xFE , 0x32 , 0xFE , +0x87 , 0xFD , 0x87 , 0xFD , 0xE1 , 0xFC , 0xE1 , 0xFC , 0x5F , 0xFC , 0x5F , 0xFC , 0xFA , 0xFB , 0xFA , 0xFB , +0xDB , 0xFB , 0xDB , 0xFB , 0xEA , 0xFB , 0xEA , 0xFB , 0x0E , 0xFC , 0x0E , 0xFC , 0x5B , 0xFC , 0x5B , 0xFC , +0xAF , 0xFC , 0xAF , 0xFC , 0x21 , 0xFD , 0x21 , 0xFD , 0x9E , 0xFD , 0x9E , 0xFD , 0x1A , 0xFE , 0x1A , 0xFE , +0x91 , 0xFE , 0x91 , 0xFE , 0x2E , 0xFF , 0x2E , 0xFF , 0x21 , 0x00 , 0x21 , 0x00 , 0xFB , 0x00 , 0xFB , 0x00 , +0xB6 , 0x01 , 0xB6 , 0x01 , 0x4B , 0x02 , 0x4B , 0x02 , 0xB8 , 0x02 , 0xB8 , 0x02 , 0x50 , 0x03 , 0x50 , 0x03 , +0xF3 , 0x03 , 0xF3 , 0x03 , 0x70 , 0x04 , 0x70 , 0x04 , 0x9A , 0x04 , 0x9A , 0x04 , 0x6C , 0x04 , 0x6C , 0x04 , +0x0B , 0x04 , 0x0B , 0x04 , 0x89 , 0x03 , 0x89 , 0x03 , 0xEC , 0x02 , 0xEC , 0x02 , 0x2A , 0x02 , 0x2A , 0x02 , +0x46 , 0x01 , 0x46 , 0x01 , 0x46 , 0x00 , 0x46 , 0x00 , 0x76 , 0xFF , 0x76 , 0xFF , 0xDF , 0xFE , 0xDF , 0xFE , +0x4F , 0xFE , 0x4F , 0xFE , 0xB8 , 0xFD , 0xB8 , 0xFD , 0x3B , 0xFD , 0x3B , 0xFD , 0xD9 , 0xFC , 0xD9 , 0xFC , +0x7C , 0xFC , 0x7C , 0xFC , 0x5D , 0xFC , 0x5D , 0xFC , 0x6C , 0xFC , 0x6C , 0xFC , 0x8D , 0xFC , 0x8D , 0xFC , +0xC1 , 0xFC , 0xC1 , 0xFC , 0x08 , 0xFD , 0x08 , 0xFD , 0x62 , 0xFD , 0x62 , 0xFD , 0xC2 , 0xFD , 0xC2 , 0xFD , +0x3C , 0xFE , 0x3C , 0xFE , 0xCB , 0xFE , 0xCB , 0xFE , 0x73 , 0xFF , 0x73 , 0xFF , 0x48 , 0x00 , 0x48 , 0x00 , +0x0D , 0x01 , 0x0D , 0x01 , 0xBF , 0x01 , 0xBF , 0x01 , 0x49 , 0x02 , 0x49 , 0x02 , 0xA7 , 0x02 , 0xA7 , 0x02 , +0x0B , 0x03 , 0x0B , 0x03 , 0x73 , 0x03 , 0x73 , 0x03 , 0xC2 , 0x03 , 0xC2 , 0x03 , 0xDF , 0x03 , 0xDF , 0x03 , +0xCE , 0x03 , 0xCE , 0x03 , 0x90 , 0x03 , 0x90 , 0x03 , 0x22 , 0x03 , 0x22 , 0x03 , 0x91 , 0x02 , 0x91 , 0x02 , +0xE6 , 0x01 , 0xE6 , 0x01 , 0x26 , 0x01 , 0x26 , 0x01 , 0x4A , 0x00 , 0x4A , 0x00 , 0x8C , 0xFF , 0x8C , 0xFF , +0xEE , 0xFE , 0xEE , 0xFE , 0x5D , 0xFE , 0x5D , 0xFE , 0xD2 , 0xFD , 0xD2 , 0xFD , 0x5B , 0xFD , 0x5B , 0xFD , +0x04 , 0xFD , 0x04 , 0xFD , 0xB2 , 0xFC , 0xB2 , 0xFC , 0x9B , 0xFC , 0x9B , 0xFC , 0xA7 , 0xFC , 0xA7 , 0xFC , +0xC6 , 0xFC , 0xC6 , 0xFC , 0xF4 , 0xFC , 0xF4 , 0xFC , 0x32 , 0xFD , 0x32 , 0xFD , 0x84 , 0xFD , 0x84 , 0xFD , +0xDA , 0xFD , 0xDA , 0xFD , 0x57 , 0xFE , 0x57 , 0xFE , 0xF7 , 0xFE , 0xF7 , 0xFE , 0xA8 , 0xFF , 0xA8 , 0xFF , +0x6D , 0x00 , 0x6D , 0x00 , 0x23 , 0x01 , 0x23 , 0x01 , 0xC5 , 0x01 , 0xC5 , 0x01 , 0x3B , 0x02 , 0x3B , 0x02 , +0x8A , 0x02 , 0x8A , 0x02 , 0xD9 , 0x02 , 0xD9 , 0x02 , 0x1F , 0x03 , 0x1F , 0x03 , 0x4C , 0x03 , 0x4C , 0x03 , +0x61 , 0x03 , 0x61 , 0x03 , 0x6D , 0x03 , 0x6D , 0x03 , 0x52 , 0x03 , 0x52 , 0x03 , 0xFE , 0x02 , 0xFE , 0x02 , +0x82 , 0x02 , 0x82 , 0x02 , 0xE9 , 0x01 , 0xE9 , 0x01 , 0x38 , 0x01 , 0x38 , 0x01 , 0x79 , 0x00 , 0x79 , 0x00 , +0xB0 , 0xFF , 0xB0 , 0xFF , 0xEE , 0xFE , 0xEE , 0xFE , 0x4C , 0xFE , 0x4C , 0xFE , 0xC4 , 0xFD , 0xC4 , 0xFD , +0x5F , 0xFD , 0x5F , 0xFD , 0x25 , 0xFD , 0x25 , 0xFD , 0xFF , 0xFC , 0xFF , 0xFC , 0xEC , 0xFC , 0xEC , 0xFC , +0xE7 , 0xFC , 0xE7 , 0xFC , 0xFB , 0xFC , 0xFB , 0xFC , 0x2A , 0xFD , 0x2A , 0xFD , 0x74 , 0xFD , 0x74 , 0xFD , +0xF5 , 0xFD , 0xF5 , 0xFD , 0x8D , 0xFE , 0x8D , 0xFE , 0x3D , 0xFF , 0x3D , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , +0x93 , 0x00 , 0x93 , 0x00 , 0x28 , 0x01 , 0x28 , 0x01 , 0xAD , 0x01 , 0xAD , 0x01 , 0x25 , 0x02 , 0x25 , 0x02 , +0x76 , 0x02 , 0x76 , 0x02 , 0xBB , 0x02 , 0xBB , 0x02 , 0xEE , 0x02 , 0xEE , 0x02 , 0xF9 , 0x02 , 0xF9 , 0x02 , +0xF2 , 0x02 , 0xF2 , 0x02 , 0xE8 , 0x02 , 0xE8 , 0x02 , 0xDB , 0x02 , 0xDB , 0x02 , 0x99 , 0x02 , 0x99 , 0x02 , +0x2F , 0x02 , 0x2F , 0x02 , 0xAE , 0x01 , 0xAE , 0x01 , 0x15 , 0x01 , 0x15 , 0x01 , 0x70 , 0x00 , 0x70 , 0x00 , +0xB4 , 0xFF , 0xB4 , 0xFF , 0x07 , 0xFF , 0x07 , 0xFF , 0x77 , 0xFE , 0x77 , 0xFE , 0x0A , 0xFE , 0x0A , 0xFE , +0xB9 , 0xFD , 0xB9 , 0xFD , 0x93 , 0xFD , 0x93 , 0xFD , 0x83 , 0xFD , 0x83 , 0xFD , 0x74 , 0xFD , 0x74 , 0xFD , +0x77 , 0xFD , 0x77 , 0xFD , 0x7E , 0xFD , 0x7E , 0xFD , 0x9F , 0xFD , 0x9F , 0xFD , 0xCA , 0xFD , 0xCA , 0xFD , +0x1B , 0xFE , 0x1B , 0xFE , 0x8B , 0xFE , 0x8B , 0xFE , 0x03 , 0xFF , 0x03 , 0xFF , 0x88 , 0xFF , 0x88 , 0xFF , +0x06 , 0x00 , 0x06 , 0x00 , 0x7A , 0x00 , 0x7A , 0x00 , 0xD8 , 0x00 , 0xD8 , 0x00 , 0x3A , 0x01 , 0x3A , 0x01 , +0x8F , 0x01 , 0x8F , 0x01 , 0xC9 , 0x01 , 0xC9 , 0x01 , 0x01 , 0x02 , 0x01 , 0x02 , 0x28 , 0x02 , 0x28 , 0x02 , +0x3D , 0x02 , 0x3D , 0x02 , 0x4B , 0x02 , 0x4B , 0x02 , 0x5F , 0x02 , 0x5F , 0x02 , 0x63 , 0x02 , 0x63 , 0x02 , +0x39 , 0x02 , 0x39 , 0x02 , 0xF9 , 0x01 , 0xF9 , 0x01 , 0xA5 , 0x01 , 0xA5 , 0x01 , 0x40 , 0x01 , 0x40 , 0x01 , +0xC6 , 0x00 , 0xC6 , 0x00 , 0x38 , 0x00 , 0x38 , 0x00 , 0xA8 , 0xFF , 0xA8 , 0xFF , 0x28 , 0xFF , 0x28 , 0xFF , +0xBB , 0xFE , 0xBB , 0xFE , 0x64 , 0xFE , 0x64 , 0xFE , 0x2A , 0xFE , 0x2A , 0xFE , 0x00 , 0xFE , 0x00 , 0xFE , +0xEA , 0xFD , 0xEA , 0xFD , 0xE2 , 0xFD , 0xE2 , 0xFD , 0xEB , 0xFD , 0xEB , 0xFD , 0x01 , 0xFE , 0x01 , 0xFE , +0x23 , 0xFE , 0x23 , 0xFE , 0x63 , 0xFE , 0x63 , 0xFE , 0xBA , 0xFE , 0xBA , 0xFE , 0x19 , 0xFF , 0x19 , 0xFF , +0x7F , 0xFF , 0x7F , 0xFF , 0xE2 , 0xFF , 0xE2 , 0xFF , 0x41 , 0x00 , 0x41 , 0x00 , 0x9A , 0x00 , 0x9A , 0x00 , +0xEC , 0x00 , 0xEC , 0x00 , 0x27 , 0x01 , 0x27 , 0x01 , 0x52 , 0x01 , 0x52 , 0x01 , 0x7A , 0x01 , 0x7A , 0x01 , +0x8E , 0x01 , 0x8E , 0x01 , 0x9A , 0x01 , 0x9A , 0x01 , 0xA4 , 0x01 , 0xA4 , 0x01 , 0xB0 , 0x01 , 0xB0 , 0x01 , +0xA4 , 0x01 , 0xA4 , 0x01 , 0x86 , 0x01 , 0x86 , 0x01 , 0x64 , 0x01 , 0x64 , 0x01 , 0x2F , 0x01 , 0x2F , 0x01 , +0xEF , 0x00 , 0xEF , 0x00 , 0x9B , 0x00 , 0x9B , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0xF0 , 0xFF , 0xF0 , 0xFF , +0x91 , 0xFF , 0x91 , 0xFF , 0x40 , 0xFF , 0x40 , 0xFF , 0xFA , 0xFE , 0xFA , 0xFE , 0xBF , 0xFE , 0xBF , 0xFE , +0x98 , 0xFE , 0x98 , 0xFE , 0x7C , 0xFE , 0x7C , 0xFE , 0x64 , 0xFE , 0x64 , 0xFE , 0x5A , 0xFE , 0x5A , 0xFE , +0x5E , 0xFE , 0x5E , 0xFE , 0x73 , 0xFE , 0x73 , 0xFE , 0x92 , 0xFE , 0x92 , 0xFE , 0xBB , 0xFE , 0xBB , 0xFE , +0xF3 , 0xFE , 0xF3 , 0xFE , 0x30 , 0xFF , 0x30 , 0xFF , 0x7D , 0xFF , 0x7D , 0xFF , 0xC9 , 0xFF , 0xC9 , 0xFF , +0x13 , 0x00 , 0x13 , 0x00 , 0x59 , 0x00 , 0x59 , 0x00 , 0x9A , 0x00 , 0x9A , 0x00 , 0xCD , 0x00 , 0xCD , 0x00 , +0xE9 , 0x00 , 0xE9 , 0x00 , 0x03 , 0x01 , 0x03 , 0x01 , 0x0F , 0x01 , 0x0F , 0x01 , 0x0D , 0x01 , 0x0D , 0x01 , +0x03 , 0x01 , 0x03 , 0x01 , 0xFB , 0x00 , 0xFB , 0x00 , 0xE9 , 0x00 , 0xE9 , 0x00 , 0xCE , 0x00 , 0xCE , 0x00 , +0xBD , 0x00 , 0xBD , 0x00 , 0xA4 , 0x00 , 0xA4 , 0x00 , 0x86 , 0x00 , 0x86 , 0x00 , 0x61 , 0x00 , 0x61 , 0x00 , +0x3A , 0x00 , 0x3A , 0x00 , 0x1F , 0x00 , 0x1F , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0xE1 , 0xFF , 0xE1 , 0xFF , +0xC9 , 0xFF , 0xC9 , 0xFF , 0xB6 , 0xFF , 0xB6 , 0xFF , 0xA5 , 0xFF , 0xA5 , 0xFF , 0x99 , 0xFF , 0x99 , 0xFF , +0x99 , 0xFF , 0x99 , 0xFF , 0x9D , 0xFF , 0x9D , 0xFF , 0xA5 , 0xFF , 0xA5 , 0xFF , 0xB1 , 0xFF , 0xB1 , 0xFF , +0xBE , 0xFF , 0xBE , 0xFF , 0xCE , 0xFF , 0xCE , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , 0xED , 0xFF , 0xED , 0xFF , +0x03 , 0x00 , 0x03 , 0x00 , 0x19 , 0x00 , 0x19 , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , +0x41 , 0x00 , 0x41 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x44 , 0x00 , 0x44 , 0x00 , 0x43 , 0x00 , 0x43 , 0x00 , +0x3F , 0x00 , 0x3F , 0x00 , 0x39 , 0x00 , 0x39 , 0x00 , 0x36 , 0x00 , 0x36 , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , +0x2D , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , 0x2D , 0x00 , 0x2C , 0x00 , 0x2C , 0x00 , 0x29 , 0x00 , 0x29 , 0x00 , +0x22 , 0x00 , 0x22 , 0x00 , 0x1A , 0x00 , 0x1A , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , +0xF3 , 0xFF , 0xF3 , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0xE6 , 0xFF , 0xE6 , 0xFF , 0xE1 , 0xFF , 0xE1 , 0xFF , +0xE4 , 0xFF , 0xE4 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , +0xEA , 0xFF , 0xEA , 0xFF , 0xEC , 0xFF , 0xEC , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , 0xF3 , 0xFF , 0xF3 , 0xFF , +0xF9 , 0xFF , 0xF9 , 0xFF , 0x03 , 0x00 , 0x03 , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , +0x0F , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0x0F , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , 0x09 , 0x00 , 0x09 , 0x00 , +0x05 , 0x00 , 0x05 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , 0x02 , 0x00 , 0x02 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0xF8 , 0xFF , 0xF8 , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE5 , 0xFF , 0xE5 , 0xFF , +0xE9 , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xE9 , 0xFF , 0xEB , 0xFF , 0xEB , 0xFF , 0xF0 , 0xFF , 0xF0 , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0xEE , 0xFF , 0xEE , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , +0xF5 , 0xFF , 0xF5 , 0xFF , 0xFC , 0xFF , 0xFC , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , 0x01 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0x07 , 0x00 , 0x07 , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x07 , 0x00 , 0x07 , 0x00 , 0x05 , 0x00 , 0x05 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , +0x01 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x01 , 0x00 , 0x01 , 0x00 , 0xFE , 0xFF , 0xFE , 0xFF , 0x19 , 0x00 , 0x19 , 0x00 , 0x26 , 0x00 , 0x26 , 0x00 , +0x23 , 0x00 , 0x23 , 0x00 , 0x2B , 0x00 , 0x2B , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , 0x0C , 0x00 , 0x0C , 0x00 , +0x22 , 0x00 , 0x22 , 0x00 , 0x26 , 0x00 , 0x26 , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0x2B , 0x00 , 0x2B , 0x00 , +0x1D , 0x00 , 0x1D , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0x0D , 0x00 , 0x0D , 0x00 , +0xFA , 0xFF , 0xFA , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xE0 , 0xFF , 0xE0 , 0xFF , 0xDB , 0xFF , 0xDB , 0xFF , +0xCD , 0xFF , 0xCD , 0xFF , 0xC3 , 0xFF , 0xC3 , 0xFF , 0xBE , 0xFF , 0xBE , 0xFF , 0xBA , 0xFF , 0xBA , 0xFF , +0xBD , 0xFF , 0xBD , 0xFF , 0xC6 , 0xFF , 0xC6 , 0xFF , 0xC9 , 0xFF , 0xC9 , 0xFF , 0xD9 , 0xFF , 0xD9 , 0xFF , +0xE1 , 0xFF , 0xE1 , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0x09 , 0x00 , 0x09 , 0x00 , +0x1E , 0x00 , 0x1E , 0x00 , 0x28 , 0x00 , 0x28 , 0x00 , 0x31 , 0x00 , 0x31 , 0x00 , 0x3A , 0x00 , 0x3A , 0x00 , +0x40 , 0x00 , 0x40 , 0x00 , 0x45 , 0x00 , 0x45 , 0x00 , 0x41 , 0x00 , 0x41 , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , +0x46 , 0x00 , 0x46 , 0x00 , 0x42 , 0x00 , 0x42 , 0x00 , 0x3C , 0x00 , 0x3C , 0x00 , 0x32 , 0x00 , 0x32 , 0x00 , +0x2E , 0x00 , 0x2E , 0x00 , 0x21 , 0x00 , 0x21 , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , 0x1C , 0x00 , +0x16 , 0x00 , 0x16 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0x03 , 0x00 , 0x03 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , +0x00 , 0x00 , 0x00 , 0x00 , 0xFC , 0xFF , 0xFC , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , +0xE9 , 0xFF , 0xE9 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , +0xE9 , 0xFF , 0xE9 , 0xFF , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xFE , 0xFF , 0xFE , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , +0xEE , 0xFF , 0xEE , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , +0xFE , 0xFF , 0xFE , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xED , 0xFF , 0xED , 0xFF , +0xFA , 0xFF , 0xFA , 0xFF , 0xFB , 0xFF , 0xFB , 0xFF , 0xF7 , 0xFF , 0xF7 , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , +0xEF , 0xFF , 0xEF , 0xFF , 0xE7 , 0xFF , 0xE7 , 0xFF , 0xE8 , 0xFF , 0xE8 , 0xFF , 0xEA , 0xFF , 0xEA , 0xFF , +0xF1 , 0xFF , 0xF1 , 0xFF , 0xF8 , 0xFF , 0xF8 , 0xFF , 0xF5 , 0xFF , 0xF5 , 0xFF , 0xEF , 0xFF , 0xEF , 0xFF , +0xF3 , 0xFF , 0xF3 , 0xFF , 0xF9 , 0xFF , 0xF9 , 0xFF , 0x06 , 0x00 , 0x06 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , +0x0D , 0x00 , 0x0D , 0x00 , 0x14 , 0x00 , 0x14 , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , 0x1D , 0x00 , 0x1D , 0x00 , +0x23 , 0x00 , 0x23 , 0x00 , 0x28 , 0x00 , 0x28 , 0x00 , 0x2A , 0x00 , 0x2A , 0x00 , 0x24 , 0x00 , 0x24 , 0x00 , +0x21 , 0x00 , 0x21 , 0x00 , 0x16 , 0x00 , 0x16 , 0x00 , 0x11 , 0x00 , 0x11 , 0x00 , 0x0E , 0x00 , 0x0E , 0x00 , +0x06 , 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xF6 , 0xFF , 0xF6 , 0xFF , 0xF4 , 0xFF , 0xF4 , 0xFF , +0xF0 , 0xFF , 0xF0 , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0xED , 0xFF , 0xF1 , 0xFF , 0xF1 , 0xFF , +0xF6 , 0xFF , 0xF6 , 0xFF , 0xFA , 0xFF , 0xFA , 0xFF , 0x01 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , +0x08 , 0x00 , 0x08 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x10 , 0x00 , 0x10 , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , +0x1A , 0x00 , 0x1A , 0x00 , 0x18 , 0x00 , 0x18 , 0x00 , 0x13 , 0x00 , 0x13 , 0x00 , 0x12 , 0x00 , 0x12 , 0x00 , +0x10 , 0x00 , 0x10 , 0x00 , 0x0A , 0x00 , 0x0A , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 +}; + +#endif /* __WAVE_DATA_H_ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/readme.txt new file mode 100644 index 0000000..138e2d0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/readme.txt @@ -0,0 +1,70 @@ +/*! + \file readme.txt + \brief This file provides the Audio Out (playback) interface API + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USBFS. + + The Audio device example allows device to communicate with host (PC) as USB headphone +using isochronous pipe for audio data transfer along with some control commands (i.e. +Mute). + + It follows the "Universal Serial Bus Device Class Definition for Audio Devices +Release 1.0 March 18, 1998" defined by the USB Implementers Forum for reprogramming +an application through USB-FS-Device. + + Following this specification, it is possible to manage only Full Speed USB mode +(High Speed is not supported). + + This class is natively supported by most Operating Systems (no need for specific +driver setup). + + This example uses the I2S interface to stream audio data from USB Host to the audio +codec implemented on the evaluation board. Then audio stream is output to the Headphone. + + For the GD32F105/7xx board, it possible to use one of the two quartz below: + - 14.7456MHz which provides best audio quality + - Standard 25MHz which provides lesser quality. + + The device supports one audio frequency (the host driver manages the sampling rate +conversion from original audio file sampling rate to the sampling rate supported +by the device). It is possible to configure this audio frequency by modifying the +usbd_conf.h file (define USBD_AD_FREQ). It is advised to set high frequencies +to guarantee a high audio quality. + + It is also possible to modify the default volume through define DEFAULT_VOLUME in file +usbd_conf.h. + +Note: The audio frequencies leading to non integer number of data (44.1KHz, 22.05KHz, + 11.025KHz...) will not allow an optimum audio quality since one data will be lost + every two/more frames. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/app.c new file mode 100644 index 0000000..814140c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/app.c @@ -0,0 +1,77 @@ +/*! + \file app.c + \brief USB main routine for Audio device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "audio_core.h" +#include "audio_out_itf.h" + +#ifdef USE_USB_AD_MICPHONE + #include "wave_data.h" + + volatile uint32_t count_data = 0; +#endif /* USE_USB_AD_MICPHONE */ + +usb_core_driver usb_audio; + +/*! + \brief main routine will construct a USB audio device + \param[in] none + \param[out] none + \retval int +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + usbd_init (&usb_audio, USB_CORE_ENUM_FS, &audio_desc, &usbd_audio_cb); + + usb_intr_config(); + + while(usb_audio.dev.cur_status != USBD_CONFIGURED); + +#ifdef USE_USB_AD_MICPHONE + for(__IO uint32_t i = 0; i < 2000; i++){ + for(__IO uint32_t j = 0; j < 10000; j++); + } + + usbd_ep_send(&usb_audio, AD_IN_EP, (uint8_t*)wavetestdata, MIC_IN_PACKET); + count_data = MIC_IN_PACKET; +#endif /* USE_USB_AD_MICPHONE */ + + /* Main loop */ + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_audio_codec.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_audio_codec.c new file mode 100644 index 0000000..40dae2f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_audio_codec.c @@ -0,0 +1,340 @@ +/*! + \file gd32f10x_audio_codec.c + \brief This file includes the low layer driver for CS4344 Audio Codec + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_audio_codec.h" +#include "audio_out_itf.h" +#include "audio_core.h" + +uint32_t i2s_audiofreq = 0; +dma_parameter_struct dma_initstructure; + +/*! + \brief initializes the audio codec audio interface (i2s) + \note this function assumes that the i2s input clock (through pll_r in + devices reva/z and through dedicated plli2s_r in devices revb/y) + is already configured and ready to be used + \param[in] audio_freq: audio frequency to be configured for the i2s peripheral + \param[out] none + \retval none +*/ +void codec_audio_interface_init(uint32_t audio_freq) +{ + i2s_audiofreq = audio_freq; + + /* enable the AD_I2S peripheral clock */ + rcu_periph_clock_enable(AD_I2S_CLK); + + /* AD_I2S peripheral configuration */ + spi_i2s_deinit(AD_I2S); + + /* initialize the I2S peripheral with the structure above */ + i2s_psc_config(AD_I2S, audio_freq, I2S_FRAMEFORMAT_DT16B_CH16B, +#ifdef IIS_MCLK_ENABLED + I2S_MCKOUT_ENABLE +#elif defined(IIS_MCLK_DISABLED) + I2S_MCKOUT_DISABLE +#endif + ); + + i2s_init(AD_I2S, I2S_MODE_MASTERTX, I2S_STD_MSB, I2S_CKPL_HIGH); + + /* enable the I2S DMA TX request */ + spi_dma_enable(AD_I2S, SPI_DMA_TRANSMIT); +} + +/*! + \brief deinitialize the audio codec audio interface + \param[in] none + \param[out] none + \retval none +*/ +void codec_audio_interface_deinit(void) +{ + /* disable the codec_i2s peripheral */ + i2s_disable(AD_I2S); + + /* deinitialize the codec_i2s peripheral */ + spi_i2s_deinit(AD_I2S); + + /* disable the codec_i2s peripheral clock */ + rcu_periph_clock_disable(AD_I2S_CLK); +} + +/*! + \brief initializes IOs used by the audio codec + \param[in] none + \param[out] none + \retval none +*/ +void codec_gpio_init(void) +{ + /* enable GPIO clock */ + rcu_periph_clock_enable(RCU_AF); + rcu_periph_clock_enable(AD_I2S_GPIO_CLK); + rcu_periph_clock_enable(AD_I2S_MCK_CLK); + + /* AD_I2S pins configuraiton: WS, SCK and SD pins */ + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_WS_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_SCK_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_SD_PIN); + +#ifdef IIS_MCLK_ENABLED + /* codec_i2s pins configuraiton: mck pin */ + gpio_init(AD_I2S_MCK_GPIO, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, AD_I2S_MCK_PIN); +#endif /* IIS_MCLK_ENABLED */ +} + +/*! + \brief deinitialize IOs used by the audio codec interface + \param[in] none + \param[out] none + \retval none +*/ +void codec_gpio_deinit(void) +{ + /* deinitialize all the GPIOs used by the driver */ + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_WS_PIN ); + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_SCK_PIN); + gpio_init(AD_I2S_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_SD_PIN); + +#ifdef IIS_MCLK_ENABLED + /* AD_I2S pins deinitialization: MCK pin */ + gpio_init(AD_I2S_MCK_GPIO, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, AD_I2S_MCK_PIN); +#endif /* IIS_MCLK_ENABLED */ +} + +/*! + \brief initializes dma to prepare for audio data transfer + from Media to the I2S peripheral + \param[in] none + \param[out] none + \retval none +*/ +void codec_i2s_dma_init(void) +{ + /* enable the DMA clock */ + rcu_periph_clock_enable(AD_DMA_CLOCK); + + /* configure the DMA Stream */ + dma_deinit(AD_DMA, AD_DMA_CHANNEL); + + /* set the parameters to be configured */ + dma_initstructure.periph_addr = AD_I2S_ADDRESS; + dma_initstructure.memory_addr = (uint32_t)0; + dma_initstructure.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_initstructure.number = (uint32_t)0xFFFF; + dma_initstructure.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_initstructure.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_initstructure.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_initstructure.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_circulation_disable(AD_DMA, AD_DMA_CHANNEL); + dma_initstructure.priority = DMA_PRIORITY_HIGH; + + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the selected dma interrupts */ + dma_interrupt_enable(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FTF); + + /* I2S DMA IRQ channel configuration */ + nvic_irq_enable(AD_DMA_IRQ, AD_IRQ_PREPRIO, AD_IRQ_SUBRIO); +} + +/*! + \brief restore default state of the used media + \param[in] none + \param[out] none + \retval none +*/ +void codec_i2s_dma_deinit(void) +{ + /* deinitialize the NVIC interrupt for the I2S DMA Stream */ + nvic_irq_disable(AD_DMA_IRQ); + + /* disable the DMA channel before the deinitialization */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* deinitialize the DMA channel */ + dma_deinit(AD_DMA, AD_DMA_CHANNEL); +} + +/*! + \brief starts playing audio stream from the audio media + \param[in] addr: pointer to the audio stream buffer + \param[in] size: number of data in the audio stream buffer + \param[out] none + \retval none +*/ +void audio_play(uint32_t addr, uint32_t size) +{ + /* disable the I2S DMA Stream*/ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_FTF); + + /* configure the buffer address and size */ + dma_initstructure.memory_addr = (uint32_t)addr; + dma_initstructure.number = (uint32_t)size; + + /* configure the DMA Stream with the new parameters */ + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the I2S DMA Stream*/ + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + + /* if the i2s peripheral is still not enabled, enable it */ + if ((SPI_I2SCTL(AD_I2S) & I2S_ENABLE_MASK) == 0) { + i2s_enable(AD_I2S); + } +} + +/*! + \brief pauses or resumes the audio stream playing from the media + \param[in] cmd: AD_PAUSE (or 0) to pause, AD_RESUME (or any value different + from 0) to resume + \param[in] addr: address from/at which the audio stream should resume/pause + \param[in] size: number of data to be configured for next resume + \param[out] none + \retval none +*/ +void audio_pause_resume(uint32_t cmd, uint32_t addr, uint32_t size) +{ + /* pause the audio file playing */ + if (cmd == AD_PAUSE) { + /* stop the current DMA request by resetting the I2S peripherals */ + codec_audio_interface_deinit(); + + /* re-configure the I2S interface for the next resume operation */ + codec_audio_interface_init(i2s_audiofreq); + + /* disable the DMA Stream */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_ALL); + } else { + /* configure the buffer address and size */ + dma_initstructure.memory_addr = (uint32_t)addr; + dma_initstructure.number = (uint32_t)size; + + /* configure the DMA Stream with the new parameters */ + dma_init(AD_DMA, AD_DMA_CHANNEL, &dma_initstructure); + + /* enable the I2S DMA Stream*/ + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + + /* if the I2S peripheral is still not enabled, enable it */ + if (0U == (SPI_I2SCTL(AD_I2S) & I2S_ENABLE_MASK)) { + i2s_enable(AD_I2S); + } + } +} + +/*! + \brief stops audio stream playing on the used media + \param[in] none + \param[out] none + \retval none +*/ +void audio_stop(void) +{ + /* stop the current DMA request by resetting the I2S cell */ + codec_audio_interface_deinit(); + + /* re-configure the I2S interface for the next play operation */ + codec_audio_interface_init(i2s_audiofreq); + + /* stop the transfer on the I2S side: Stop and disable the DMA stream */ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear all the DMA flags for the next transfer */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_ALL); +} + +/*! + \brief this function handles main media layer interrupt + \param[in] none + \param[out] none + \retval 0 if correct communication, else wrong communication +*/ +void AD_DMA_IRQHandler(void) +{ + uint16_t remain_size = 0; + + /* transfer complete interrupt */ + if(dma_flag_get(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_TC) != RESET){ + /* increment to the next sub-buffer */ + audio_handler.isoc_out_rdptr += audio_handler.dam_tx_len; + + if (audio_handler.isoc_out_rdptr >= (audio_handler.isoc_out_buff + TOTAL_OUT_BUF_SIZE)) { + /* roll back to the start of buffer */ + audio_handler.isoc_out_rdptr = audio_handler.isoc_out_buff; + } + + if(audio_handler.isoc_out_wrptr >= audio_handler.isoc_out_rdptr){ + remain_size = audio_handler.isoc_out_wrptr - audio_handler.isoc_out_rdptr; + }else{ + remain_size = TOTAL_OUT_BUF_SIZE + audio_handler.isoc_out_buff - audio_handler.isoc_out_rdptr; + } + + /* check if the end of file has been reached */ + if(remain_size > 0){ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_flag_clear(AD_DMA, AD_DMA_CHANNEL, AD_DMA_FLAG_TC); + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_ERR); + + DMA_CHMADDR(AD_DMA, AD_DMA_CHANNEL) = (uint32_t)audio_handler.isoc_out_rdptr; + + DMA_CHCNT(AD_DMA, AD_DMA_CHANNEL) = (uint32_t)((remain_size / 2) & DMA_CHANNEL_CNT_MASK); + + /* update the current DMA tx data length */ + audio_handler.dam_tx_len = (remain_size / 2) * 2; + + dma_channel_enable(AD_DMA, AD_DMA_CHANNEL); + }else{ + /* disable the I2S DMA Stream*/ + dma_channel_disable(AD_DMA, AD_DMA_CHANNEL); + + /* clear the Interrupt flag */ + dma_interrupt_flag_clear(AD_DMA, AD_DMA_CHANNEL, DMA_INT_FLAG_FTF); + + /* clear flag */ + audio_handler.dam_tx_len = 0; + audio_handler.play_flag = 0U; + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_hw.c new file mode 100644 index 0000000..c60b2f3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_hw.c @@ -0,0 +1,214 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + +#ifdef USB_LOW_POWER + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +#endif /* USB_LOW_POWER */ +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in microseconds + \param[in] usec: value of delay required in microseconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_it.c new file mode 100644 index 0000000..29afe57 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/gd32f10x_it.c @@ -0,0 +1,235 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver usb_audio; +extern uint32_t usbfs_prescaler; + +void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + +} + +/*! + \brief this function handles USBD interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&usb_audio); +} + +/*! + \brief this function handles USBD wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usb_audio.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&usb_audio); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/audio/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewp new file mode 100644 index 0000000..3fbce3d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewp @@ -0,0 +1,1049 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewt new file mode 100644 index 0000000..c671364 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.ewt @@ -0,0 +1,1150 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.eww new file mode 100644 index 0000000..560e364 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/EWARM/cdc_acm.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\CDC_ACM.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvopt new file mode 100644 index 0000000..5272186 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvopt @@ -0,0 +1,618 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + cdc_acm + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0100000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + 0 + 0 + 741 + 1 +
134222314
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\system_gd32f10x.c + + +
+ + 1 + 0 + 151 + 1 +
134218718
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\gd32f10x_it.c + + +
+
+ + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 17 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 13 + 1 + 0 + 0 + 77 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 14 + 1 + 0 + 0 + 19 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 16 + 1 + 0 + 0 + 28 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 17 + 1 + 0 + 0 + 50 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 61 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + cdc_acm_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 20 + 2 + 0 + 0 + 41 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 21 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvoptx new file mode 100644 index 0000000..9cbf55a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvoptx @@ -0,0 +1,552 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + cdc_acm + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0100000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + 0 + 741 + 1 +
134222314
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\system_gd32f10x.c + + +
+ + 1 + 0 + 151 + 1 +
134218718
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\gd32f10x_it.c + + +
+
+ + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + cdc_acm_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 20 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 21 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvproj new file mode 100644 index 0000000..8534eeb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvproj @@ -0,0 +1,559 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + cdc_acm + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + cdc_acm + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_CL,USE_USB_FS + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\cdc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + cdc_acm_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvprojx new file mode 100644 index 0000000..1176b62 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/MDK-ARM/cdc_acm.uvprojx @@ -0,0 +1,552 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + cdc_acm + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + cdc_acm + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,GD32F10X_CL,USE_USB_FS + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\cdc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + cdc_acm_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\cdc\Source\cdc_acm_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usb_conf.h new file mode 100644 index 0000000..844832f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usb_conf.h @@ -0,0 +1,126 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "stdlib.h" +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128 + #define TX0_FIFO_FS_SIZE 64 + #define TX1_FIFO_FS_SIZE 128 + #define TX2_FIFO_FS_SIZE 0 + #define TX3_FIFO_FS_SIZE 0 +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1 +#define USB_LOW_POWER 0 + +/* if uncomment it, need jump to USB JP */ +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usbd_conf.h new file mode 100644 index 0000000..3b2c606 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/inc/usbd_conf.h @@ -0,0 +1,62 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1 +#define USBD_ITF_MAX_NUM 1 + +#define CDC_COM_INTERFACE 0 + +#define USB_STR_DESC_MAX_SIZE 255 + +#define CDC_DATA_IN_EP EP1_IN /* EP1 for data IN */ +#define CDC_DATA_OUT_EP EP3_OUT /* EP3 for data OUT */ +#define CDC_CMD_EP EP2_IN /* EP2 for CDC commands */ + +#define USB_STRING_COUNT 4U + +#define USB_CDC_CMD_PACKET_SIZE 8 /* Control Endpoint Packet size */ + +#define APP_RX_DATA_SIZE 2048 /* Total size of IN buffer: + APP_RX_DATA_SIZE*8 / MAX_BAUDARATE * 1000 should be > CDC_IN_FRAME_INTERVAL*8 */ + +/* CDC Endpoints parameters: you can fine tune these values depending on the needed baud rate and performance. */ +#define USB_CDC_DATA_PACKET_SIZE 64 /* Endpoint IN & OUT Packet size */ +#define CDC_IN_FRAME_INTERVAL 5 /* Number of frames between IN transfers */ + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/readme.txt new file mode 100644 index 0000000..072a474 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/readme.txt @@ -0,0 +1,56 @@ +/*! + \file readme.txt + \brief description of the USB CDC_ACM demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL board,it provides a description of + how to use the USBFS. + + The target of this example is to read data from and write data to USB devices using +the CDC protocol. + + It makes the USB device look like a serial port (NO serial cable connectors: You +can see the data transferred to and from via USB instead of USB-to-USART bridge connection). + + This example loops back the contents of a text file over usb port. To run the example, +Type a message using the PC's keyboard. Any data that shows in HyperTerminal is received +from the device. + + This CDC_ACM Demo provides the firmware examples for the GD32F10xxx families. + + - OUT transfers (receive the data from the PC to GD32): + When a packet is received from the PC on the OUT pipe (EP3),by calling cdc_acm_data_receive() + it will be stored in the usb_data_buffer[]. + + - IN transfers (to send the data received from the GD32 to the PC): + When a packet is sent from the GD32 on the IN pipe (EP1), by calling cdc_acm_data_send(), + put the data into the usb_data_buffer[] buffer for sending data to the host. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/app.c new file mode 100644 index 0000000..121357f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/app.c @@ -0,0 +1,66 @@ +/*! + \file app.c + \brief USB main routine for CDC device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "cdc_acm_core.h" + +usb_core_driver cdc_acm; + +/*! + \brief main routine will construct a USB mass storage device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + usbd_init (&cdc_acm, USB_CORE_ENUM_FS, &cdc_desc, &cdc_class); + + usb_intr_config(); + + /* main loop */ + while (1) { + if (USBD_CONFIGURED == cdc_acm.dev.cur_status) { + if (0U == cdc_acm_check_ready(&cdc_acm)) { + cdc_acm_data_receive(&cdc_acm); + } else { + cdc_acm_data_send(&cdc_acm); + } + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_hw.c new file mode 100644 index 0000000..1082b64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_it.c new file mode 100644 index 0000000..6aa8aa7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/gd32f10x_it.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver cdc_acm; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&cdc_acm); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (cdc_acm.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&cdc_acm); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/system_gd32f10x.c new file mode 100644 index 0000000..290e971 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/cdc_acm/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* + Copyright (c) 2012 ARM LIMITED + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewp new file mode 100644 index 0000000..b2bcde8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewp @@ -0,0 +1,1059 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\hid_printer_wrapper.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewt new file mode 100644 index 0000000..d3ddf06 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.ewt @@ -0,0 +1,1159 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\hid_printer_wrapper.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.eww new file mode 100644 index 0000000..f79c39f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/EWARM/hid_printer.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\hid_printer.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt new file mode 100644 index 0000000..a630106 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvopt @@ -0,0 +1,640 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + composite_hid_printer + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -U -O207 -S0 -C0 -P00 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO23 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + + 0 + 1 + device_descripter + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 23 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\hid_printer_wrapper.c + hid_printer_wrapper.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 25 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx new file mode 100644 index 0000000..983a3fe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvoptx @@ -0,0 +1,562 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + composite_hid_printer + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + device_descripter + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\hid_printer_wrapper.c + hid_printer_wrapper.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 23 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 24 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj new file mode 100644 index 0000000..0c38ff5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvproj @@ -0,0 +1,574 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + composite_hid_printer + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + hid_printer_wrapper.c + 1 + ..\src\hid_printer_wrapper.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + custom_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + printer_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx new file mode 100644 index 0000000..89cec52 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/MDK-ARM/hid_printer.uvprojx @@ -0,0 +1,567 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + composite_hid_printer + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + hid_printer_wrapper.c + 1 + ..\src\hid_printer_wrapper.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + custom_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + printer_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/hid_printer_wrapper.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/hid_printer_wrapper.h new file mode 100644 index 0000000..8b49915 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/hid_printer_wrapper.h @@ -0,0 +1,59 @@ +/*! + \file hid_printer_wrapper.h + \brief header file for the hid_printer_wrapper.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __HID_PRINTER_WRAPPER_H +#define __HID_PRINTER_WRAPPER_H + +#include "custom_hid_core.h" +#include "printer_core.h" + +#define HID_INTERFACE 0x00 +#define PRINTER_INTERFACE 0x01 + +typedef struct +{ + usb_desc_config config; + usb_desc_itf hid_interface; + usb_desc_hid hid_vendorhid; + usb_desc_ep hid_ep_report_in; + usb_desc_ep hid_ep_report_out; + usb_desc_itf printer_interface; + usb_desc_ep printer_ep_data_in; + usb_desc_ep printer_ep_data_out; +} usb_hid_printer_desc_config_set; + +extern usb_desc hid_printer_desc; +extern usb_class_core usbd_hid_printer_cb; + +#endif /* __HID_PRINTER_WRAPPER_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usb_conf.h new file mode 100644 index 0000000..ef33c67 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usb_conf.h @@ -0,0 +1,130 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +/****************** USB OTG FS CONFIGURATION **********************************/ +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128 + #define TX0_FIFO_FS_SIZE 32 + #define TX1_FIFO_FS_SIZE 32 + #define TX2_FIFO_FS_SIZE 32 + #define TX3_FIFO_FS_SIZE 32 +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1 +#define USB_LOW_POWER 0 + +/****************** USB OTG MISC CONFIGURATION ********************************/ +//#define VBUS_SENSING_ENABLED + +/****************** USB OTG MODE CONFIGURATION ********************************/ +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usbd_conf.h new file mode 100644 index 0000000..eee56c3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/inc/usbd_conf.h @@ -0,0 +1,65 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +/* USB configure exported defines */ +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 2U + +#define CUSTOM_HID_INTERFACE 0x00U +#define CDC_COM_INTERFACE 0x01U + +#define USB_STR_DESC_MAX_SIZE 255U + +/* endpoint used by the custom HID device */ +#define CUSTOMHID_IN_EP EP_IN(1U) +#define CUSTOMHID_OUT_EP EP_OUT(1U) + +/* endpoint used by the USB printer device */ +#define PRINTER_IN_EP EP_IN(2U) +#define PRINTER_OUT_EP EP_OUT(2U) + +#define USB_STRING_COUNT 4U + +#define CUSTOMHID_OUT_PACKET 2U +#define CUSTOMHID_IN_PACKET 2U + +#define PRINTER_IN_PACKET 64U +#define PRINTER_OUT_PACKET 64U + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/readme.txt new file mode 100644 index 0000000..7620201 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/readme.txt @@ -0,0 +1,56 @@ +/*! + \file readme.txt + \brief description of the the USB HID/printer composite demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USBFS. + + The demo provide a composite device. + + A composite device is one that has multiple interfaces controlled independently +of each other. Using composite device, multiple functions are combined into a single +device. In this Example the independent interfaces are : custom HID and USB Printer. + + This demo was created by combining the code in the HID and USB Printer. + + The implementation of the composite HID-Printer device is done by creating a wrapping +class (see folder hid_printer_wrapper ) that makes calls to the separate HID and USB +Printer class layer handlers (files custom_hid_core.c and printer_core.c files). + + To test the demo, you can run HID demo and at same time you can select the +USB Printer. + + When even one of the interface class of the device is changed, it should be handled +differently by Windows. However, it doesn't recognize the modification. To avoid conflict +on Windows, we suggest to assign another VID/PID to the device or delete device instance +from device manager. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/app.c new file mode 100644 index 0000000..413b90e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/app.c @@ -0,0 +1,66 @@ +/*! + \file app.c + \brief USB main routine for HID/printer composite device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "hid_printer_wrapper.h" +#include "drv_usb_hw.h" + +usb_core_driver usbd_hid_printer; + +extern hid_fop_handler fop_handler; + +/*! + \brief main routine will construct a USB HID&Printer device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure USB clock */ + usb_rcu_config(); + + /* timer initialization */ + usb_timer_init(); + + custom_hid_itfop_register(&usbd_hid_printer, &fop_handler); + + /* USB device stack configure */ + usbd_init (&usbd_hid_printer, USB_CORE_ENUM_FS, &hid_printer_desc, &usbd_hid_printer_cb); + + /* USB interrupt configure */ + usb_intr_config(); + + while(1){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/custom_hid_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/custom_hid_itf.c new file mode 100644 index 0000000..ba91e82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/custom_hid_itf.c @@ -0,0 +1,71 @@ +/*! + \file custom_hid_itf.c + \brief custom HID interface driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "custom_hid_core.h" + +static void key_config(void); +static void led_config(void); + +hid_fop_handler fop_handler = +{ + .periph_config = {key_config, led_config} +}; + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +void key_config(void) +{ + /* keys configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); +} + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + /* initialize LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_hw.c new file mode 100644 index 0000000..ce23346 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_hw.c @@ -0,0 +1,214 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; + +uint32_t usbfs_prescaler = 0; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + +#ifdef USB_LOW_POWER + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +#endif +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIM2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in microseconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* timer2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* timer2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_it.c new file mode 100644 index 0000000..29b8873 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/gd32f10x_it.c @@ -0,0 +1,294 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" +#include "custom_hid_core.h" + +uint8_t send_buffer1[4] = {0x00, 0x01, 0x00, 0x00}; +uint8_t send_buffer2[4] = {0x00, 0x01, 0x00, 0x00}; + +extern usb_core_driver usbd_hid_printer; +extern uint32_t usbfs_prescaler; + +void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles EXTI0_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == usbd_hid_printer.dev.cur_status) { + send_buffer1[0] = 0x15; + + if (RESET == gd_eval_key_state_get(KEY_WAKEUP)) { + if(send_buffer1[1]) { + send_buffer1[1] = 0x00; + } else { + send_buffer1[1] = 0x01; + } + } + + custom_hid_report_send (&usbd_hid_printer, send_buffer1, 2); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles EXTI10_15_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == usbd_hid_printer.dev.cur_status) { + send_buffer2[0] = 0x16; + + if (RESET == gd_eval_key_state_get(KEY_TAMPER)) { + if(send_buffer2[1]) { + send_buffer2[1] = 0x00; + } else { + send_buffer2[1] = 0x01; + } + } + + custom_hid_report_send (&usbd_hid_printer, send_buffer2, 2); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&usbd_hid_printer); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usbd_hid_printer.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&usbd_hid_printer); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/hid_printer_wrapper.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/hid_printer_wrapper.c new file mode 100644 index 0000000..1afde08 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/hid_printer_wrapper.c @@ -0,0 +1,335 @@ +/*! + \file hid_printer_wrapper.c + \brief this file calls to the separate HID and printer class layer handlers + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "hid_printer_wrapper.h" + +#define USBD_VID 0x28E9 +#define USBD_PID 0x325A + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +__ALIGN_BEGIN const usb_desc_dev hid_printer_dev_desc __ALIGN_END = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200, + .bDeviceClass = 0x00, + .bDeviceSubClass = 0x00, + .bDeviceProtocol = 0x00, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +__ALIGN_BEGIN const usb_hid_printer_desc_config_set hid_printer_config_desc __ALIGN_END = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG, + }, + .wTotalLength = sizeof(usb_hid_printer_desc_config_set), + .bNumInterfaces = 0x02, + .bConfigurationValue = 0x01, + .iConfiguration = 0x00, + .bmAttributes = 0x80, + .bMaxPower = 0x32 + }, + + .hid_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x03, + .bInterfaceSubClass = 0x00, + .bInterfaceProtocol = 0x00, + .iInterface = 0x00 + }, + + .hid_vendorhid = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111, + .bCountryCode = 0x00, + .bNumDescriptors = 0x01, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = DESC_LEN_REPORT, + }, + + .hid_ep_report_in = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_IN_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CUSTOMHID_IN_PACKET, + .bInterval = 0x20 + }, + + .hid_ep_report_out = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_OUT_EP, + .bmAttributes = 0x03, + .wMaxPacketSize = CUSTOMHID_OUT_PACKET, + .bInterval = 0x20 + }, + + .printer_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01, + .bAlternateSetting = 0x00, + .bNumEndpoints = 0x02, + .bInterfaceClass = 0x07, + .bInterfaceSubClass = 0x01, + .bInterfaceProtocol = 0x02, + .iInterface = 0x00 + }, + + .printer_ep_data_in = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_IN_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = PRINTER_IN_PACKET, + .bInterval = 0x00 + }, + + .printer_ep_data_out = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_OUT_EP, + .bmAttributes = 0x02, + .wMaxPacketSize = PRINTER_OUT_PACKET, + .bInterval = 0x00 + } +}; + +/* USB language ID Descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(16), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'H', 'I', 'D', '_', 'P', 'R', 'I', 'N', 'T', 'E', 'R'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +void *const usbd_cdc_hid_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc hid_printer_desc = { + .dev_desc = (uint8_t *)&hid_printer_dev_desc, + .config_desc = (uint8_t *)&hid_printer_config_desc, + .strings = usbd_cdc_hid_strings +}; + +/* local function prototypes ('static') */ +static uint8_t hid_printer_init (usb_dev *udev, uint8_t config_index); +static uint8_t hid_printer_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t hid_printer_req_handler (usb_dev *udev, usb_req *req); + +static uint8_t hid_printer_data_in (usb_dev *udev, uint8_t ep_num); +static uint8_t hid_printer_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class_core usbd_hid_printer_cb = { + .init = hid_printer_init, + .deinit = hid_printer_deinit, + .req_proc = hid_printer_req_handler, + .data_in = hid_printer_data_in, + .data_out = hid_printer_data_out, +}; + +/*! + \brief initialize the HID/printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_init (usb_dev *udev, uint8_t config_index) +{ + /* HID initialization */ + usbd_custom_hid_cb.init(udev, config_index); + + /* printer initialization */ + usbd_printer_cb.init(udev, config_index); + + return USBD_OK; +} + +/*! + \brief deinitialize the HID/printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_deinit (usb_dev *udev, uint8_t config_index) +{ + /* HID De-initialization */ + usbd_custom_hid_cb.deinit (udev, config_index); + + /* printer De-initialization */ + usbd_printer_cb.deinit (udev, config_index); + + return USBD_OK; +} + +/*! + \brief handle the custom HID/printer class-specific request + \param[in] udev: pointer to USB device instance + \param[in] req: device class request + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_req_handler (usb_dev *udev, usb_req *req) +{ + if ((req->wIndex & 0xFF) == HID_INTERFACE) { + return usbd_custom_hid_cb.req_proc(udev, req); + } else { + return usbd_printer_cb.req_proc(udev, req); + } +} + +/*! + \brief handle data IN stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_data_in (usb_dev *udev, uint8_t ep_num) +{ + if ((CUSTOMHID_IN_EP & 0x7F) == ep_num) { + return usbd_custom_hid_cb.data_in(udev, ep_num); + } else { + return usbd_printer_cb.data_in(udev, ep_num); + } +} + +/*! + \brief handle data OUT stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_printer_data_out (usb_dev *udev, uint8_t ep_num) +{ + if ((CUSTOMHID_OUT_EP & 0x7F) == ep_num) { + return usbd_custom_hid_cb.data_out(udev, ep_num); + } else { + return usbd_printer_cb.data_out(udev, ep_num); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/system_gd32f10x.c new file mode 100644 index 0000000..d91e7d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/composite_dev_hid_printer/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series + + \version 2020-07-01, V3.0.0, firmware for GD32F10x +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewp new file mode 100644 index 0000000..630ecaf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewp @@ -0,0 +1,1052 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewt new file mode 100644 index 0000000..9e973f9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.ewt @@ -0,0 +1,1153 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\custom_hid_itf.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.eww new file mode 100644 index 0000000..1205c87 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/EWARM/custom_hid.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\custom_hid.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvopt new file mode 100644 index 0000000..309dbd0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvopt @@ -0,0 +1,608 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + custom_hid + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -U -O207 -S0 -C0 -P00 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO23 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + + 0 + 1 + device_descripter + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 46 + 0 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 44 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 21 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvoptx new file mode 100644 index 0000000..a0d6501 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvoptx @@ -0,0 +1,538 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + custom_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + device_descripter + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\custom_hid_itf.c + custom_hid_itf.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + custom_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 21 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvproj new file mode 100644 index 0000000..4a56e21 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvproj @@ -0,0 +1,564 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + custom_hid + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + custom_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + custom_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvprojx new file mode 100644 index 0000000..7cb220e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/MDK-ARM/custom_hid.uvprojx @@ -0,0 +1,557 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + custom_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + custom_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + custom_hid_itf.c + 1 + ..\src\custom_hid_itf.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + custom_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\custom_hid_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usb_conf.h new file mode 100644 index 0000000..3a9f87e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usb_conf.h @@ -0,0 +1,122 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "stdlib.h" +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128 + #define TX0_FIFO_FS_SIZE 64 + #define TX1_FIFO_FS_SIZE 128 + #define TX2_FIFO_FS_SIZE 0 + #define TX3_FIFO_FS_SIZE 0 +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1 +#define USB_LOW_POWER 0 + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usbd_conf.h new file mode 100644 index 0000000..e0574f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/inc/usbd_conf.h @@ -0,0 +1,57 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1 +#define USBD_ITF_MAX_NUM 1 + +#define CUSTOM_HID_INTERFACE 0 + +#define USB_STR_DESC_MAX_SIZE 64 + +/* USB user string supported */ +/* #define USB_SUPPORT_USER_STRING_DESC */ +#define USB_STRING_COUNT 4U + +#define CUSTOMHID_IN_EP EP1_IN /* EP1 for data IN */ +#define CUSTOMHID_OUT_EP EP1_OUT /* EP1 for data OUT */ + +#define CUSTOMHID_IN_PACKET 2 +#define CUSTOMHID_OUT_PACKET 2 + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/readme.txt new file mode 100644 index 0000000..5835902 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/readme.txt @@ -0,0 +1,55 @@ +/*! + \file readme.txt + \brief description of the USB Custom HID device demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USBFS. + + The GD32 device is enumerated as an USB Custom HID device, that uses the +native PC Host HID driver. + + To test the demo, you need to: + - Download the "Custom_HID Client" PC applet + + - Start the "Custom_HID Client" PC applet and connect GD32 USB to PC + + - The device should be detected and shown in the PC applet + + - Make sure that following report ID are configured: LED2 ID (0x11), + LED3 ID(0x12), LED4 ID(0x13), LED5 ID(0x14), BUTTON1_ID(0x15) and + BUTTON2_ID(0x16). + + - Select LEDs in the applet to switch on/off on the EVAL board + + - Press the Wakeup key and Tamper key on the EVAL board to switch on + /off the button1/button2 status in the PC applet diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/app.c new file mode 100644 index 0000000..821877c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/app.c @@ -0,0 +1,62 @@ +/*! + \file app.c + \brief USB main routine for HID device(USB keyboard) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "custom_hid_core.h" + +usb_core_driver custom_hid; + +extern hid_fop_handler fop_handler; + +/*! + \brief main routine will construct a USB keyboard + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + custom_hid_itfop_register(&custom_hid, &fop_handler); + + usbd_init (&custom_hid, USB_CORE_ENUM_FS, &custom_hid_desc, &usbd_custom_hid_cb); + + usb_intr_config(); + + while(1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/custom_hid_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/custom_hid_itf.c new file mode 100644 index 0000000..ba91e82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/custom_hid_itf.c @@ -0,0 +1,71 @@ +/*! + \file custom_hid_itf.c + \brief custom HID interface driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "custom_hid_core.h" + +static void key_config(void); +static void led_config(void); + +hid_fop_handler fop_handler = +{ + .periph_config = {key_config, led_config} +}; + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +void key_config(void) +{ + /* keys configuration */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); +} + +/*! + \brief configure the LEDs + \param[in] none + \param[out] none + \retval none +*/ +void led_config(void) +{ + /* initialize LEDs */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + gd_eval_led_init(LED4); + gd_eval_led_init(LED5); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_hw.c new file mode 100644 index 0000000..f4e0cf7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_it.c new file mode 100644 index 0000000..15b7ee7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/gd32f10x_it.c @@ -0,0 +1,293 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" +#include "custom_hid_core.h" + +uint8_t send_buffer1[4] = {0x00, 0x01, 0x00, 0x00}; +uint8_t send_buffer2[4] = {0x00, 0x01, 0x00, 0x00}; + +extern usb_core_driver custom_hid; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles EXTI0_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == custom_hid.dev.cur_status) { + send_buffer1[0] = 0x15U; + + if (RESET == gd_eval_key_state_get(KEY_WAKEUP)) { + if(send_buffer1[1]) { + send_buffer1[1] = 0x00U; + } else { + send_buffer1[1] = 0x01U; + } + } + + custom_hid_report_send (&custom_hid, send_buffer1, 2U); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles EXTI10_15_IRQ Handler. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI10_15_IRQHandler (void) +{ + if (RESET != exti_interrupt_flag_get(TAMPER_KEY_EXTI_LINE)) { + if (USBD_CONFIGURED == custom_hid.dev.cur_status) { + send_buffer2[0] = 0x16U; + + if (RESET == gd_eval_key_state_get(KEY_TAMPER)) { + if(send_buffer2[1]) { + send_buffer2[1] = 0x00U; + } else { + send_buffer2[1] = 0x01U; + } + } + + custom_hid_report_send (&custom_hid, send_buffer2, 2U); + } + + /* clear the EXTI line interrupt flag */ + exti_interrupt_flag_clear(TAMPER_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&custom_hid); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (custom_hid.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&custom_hid); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/custom_hid/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewd new file mode 100644 index 0000000..cc9763e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewp new file mode 100644 index 0000000..6cca5b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewp @@ -0,0 +1,1075 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + App + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\exmc_nandflash.c + + + $PROJ_DIR$\..\src\gd25qxx.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\inter_flash_if.c + + + $PROJ_DIR$\..\src\nand_flash_if.c + + + $PROJ_DIR$\..\src\nor_flash_if.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewt new file mode 100644 index 0000000..eccaf81 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.ewt @@ -0,0 +1,1177 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + App + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\exmc_nandflash.c + + + $PROJ_DIR$\..\src\gd25qxx.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\inter_flash_if.c + + + $PROJ_DIR$\..\src\nand_flash_if.c + + + $PROJ_DIR$\..\src\nor_flash_if.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.eww new file mode 100644 index 0000000..0753ebf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/EWARM/dfu.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\dfu.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvopt new file mode 100644 index 0000000..52f1932 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvopt @@ -0,0 +1,775 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + dfu + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + 0 + JL2CM3 + -U59701280 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + 0 + 0 + 130 + 1 +
134224502
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\nand_flash_if.c + + +
+
+ + + 0 + 1 + usb_dfu_dev + + + 1 + 1 + src_buf + + + + + 0 + 2 + transc->xfer_buf[3] + + + 1 + 2 + transc->xfer_buf[4] + + + 2 + 2 + transc->xfer_buf[5] + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 22 + 0 + 30 + 54 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\src\exmc_nandflash.c + exmc_nandflash.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\src\gd25qxx.c + gd25qxx.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\inter_flash_if.c + inter_flash_if.c + 0 + 0 + + + 1 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\nand_flash_if.c + nand_flash_if.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 29 + 0 + 0 + 0 + 0 + ..\src\nor_flash_if.c + nor_flash_if.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 9 + 1 + 0 + 0 + 69 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 11 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 24 + 1 + 0 + 0 + 14 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 25 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 26 + 1 + 0 + 0 + 23 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 27 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + dfu_core.c + 0 + 0 + + + 7 + 28 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + dfu_mem.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 29 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 30 + 5 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvoptx new file mode 100644 index 0000000..1fdc735 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvoptx @@ -0,0 +1,673 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + dfu + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59701280 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + + + 0 + 0 + 130 + 1 +
134224502
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\nand_flash_if.c + + +
+
+ + + 0 + 1 + usb_dfu_dev + + + 1 + 1 + src_buf + + + + + 0 + 2 + transc->xfer_buf[3] + + + 1 + 2 + transc->xfer_buf[4] + + + 2 + 2 + transc->xfer_buf[5] + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\exmc_nandflash.c + exmc_nandflash.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\gd25qxx.c + gd25qxx.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + ..\src\inter_flash_if.c + inter_flash_if.c + 0 + 0 + + + 1 + 7 + 1 + 0 + 0 + 0 + ..\src\nand_flash_if.c + nand_flash_if.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 0 + ..\src\nor_flash_if.c + nor_flash_if.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 9 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + dfu_core.c + 0 + 0 + + + 7 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + dfu_mem.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 29 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 30 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvproj new file mode 100644 index 0000000..8b1579b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvproj @@ -0,0 +1,604 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + dfu + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 1 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dfu + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 1 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + exmc_nandflash.c + 1 + ..\src\exmc_nandflash.c + + + gd25qxx.c + 1 + ..\src\gd25qxx.c + + + inter_flash_if.c + 1 + ..\src\inter_flash_if.c + + + nand_flash_if.c + 1 + ..\src\nand_flash_if.c + + + nor_flash_if.c + 1 + ..\src\nor_flash_if.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + dfu_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + + + dfu_mem.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvprojx new file mode 100644 index 0000000..8a7064e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/MDK-ARM/dfu.uvprojx @@ -0,0 +1,597 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + dfu + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 1 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + dfu + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 1 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + exmc_nandflash.c + 1 + ..\src\exmc_nandflash.c + + + gd25qxx.c + 1 + ..\src\gd25qxx.c + + + inter_flash_if.c + 1 + ..\src\inter_flash_if.c + + + nand_flash_if.c + 1 + ..\src\nand_flash_if.c + + + nor_flash_if.c + 1 + ..\src\nor_flash_if.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + gd32f10x_spi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + dfu_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_core.c + + + dfu_mem.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\dfu\Source\dfu_mem.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/exmc_nandflash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/exmc_nandflash.h new file mode 100644 index 0000000..ebd8a0d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/exmc_nandflash.h @@ -0,0 +1,148 @@ +/*! + \file exmc_nandflash.h + \brief the header file of nandflash(GD9FU1G8F2AMG) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __EXMC_NANDFLASH_H +#define __EXMC_NANDFLASH_H + +#include "gd32f10x.h" +#include "string.h" + +/* NAND area definition */ +/* A16 = CLE high command area */ +#define EXMC_CMD_AREA (uint32_t)(1<<16) +/* A17 = ALE high address area */ +#define EXMC_ADDR_AREA (uint32_t)(1<<17) +/* data area */ +#define EXMC_DATA_AREA ((uint32_t)0x00000000) + +/* NAND memory command (hynix GD9FU1G8F2AMG) */ +#define NAND_CMD_READ1_1ST ((uint8_t)0x00) +#define NAND_CMD_READ1_2ND ((uint8_t)0x30) +#define NAND_CMD_WRITE_1ST ((uint8_t)0x80) +#define NAND_CMD_WRITE_2ND ((uint8_t)0x10) +#define NAND_CMD_ERASE_1ST ((uint8_t)0x60) +#define NAND_CMD_ERASE_2ND ((uint8_t)0xD0) +#define NAND_CMD_READID ((uint8_t)0x90) +#define NAND_CMD_STATUS ((uint8_t)0x70) +#define NAND_CMD_LOCK_STATUS ((uint8_t)0x7A) +#define NAND_CMD_RESET ((uint8_t)0xFF) + +/* NAND memory status */ +#define NAND_BUSY ((uint8_t)0x00) +#define NAND_ERROR ((uint8_t)0x01) +#define NAND_READY ((uint8_t)0x40) +#define NAND_TIMEOUT_ERROR ((uint8_t)0x80) + +/* NAND memory parameters */ +#define NAND_ZONE_COUNT ((uint16_t)0x0001) /* NAND zone count */ +#define NAND_PAGE_SIZE ((uint16_t)0x0800) /* 2 * 1024 bytes per page */ +#define NAND_BLOCK_SIZE ((uint16_t)0x0040) /* 64 pages per block */ +#define NAND_ZONE_SIZE ((uint16_t)0x0400) /* 1024 block per zone */ +#define NAND_SPARE_AREA_SIZE ((uint16_t)0x0080) /* last 128 bytes as spare area */ + +#define NAND_BLOCK_COUNT 1024 /* block count */ +#define NAND_PAGE_TOTAL_SIZE (NAND_PAGE_SIZE + NAND_SPARE_AREA_SIZE) /* total page size = page size + spare are size */ + +/* command code type define */ +#define NAND_CMD_COPYBACK_A ((uint8_t)0x00) /* PAGE COPY-BACK command sequence */ +#define NAND_CMD_COPYBACK_B ((uint8_t)0x35) +#define NAND_CMD_COPYBACK_C ((uint8_t)0x85) +#define NAND_CMD_COPYBACK_D ((uint8_t)0x10) + +#define NAND_CMD_STATUS ((uint8_t)0x70) /* Read NAND Flash status */ + +#define MAX_PHY_BLOCKS_PER_ZONE 1024 +#define MAX_LOG_BLOCKS_PER_ZONE 1000 + +#define NAND_BAD_BLOCK_FLAG 0x00 +#define NAND_USED_BLOCK_FLAG 0xFE + +#define BI_OFFSET 0 +#define USED_OFFSET 1 +#define LBN0_OFFSET 2 +#define LBN1_OFFSET 3 +#define VALID_SPARE_SIZE 4 + +#define NAND_OK 0 +#define NAND_FAIL 1 + +#define BLOCK_ODD 0 +#define BLOCK_EVEN 1 + +#define FREE_BLOCK (1 << 12) +#define BAD_BLOCK (1 << 13) +#define VALID_BLOCK (1 << 14) +#define USED_BLOCK (1 << 15) + +#define EXCHANGE_BLOCKS_NUM 2 + +#define BAD_BALOK_TEST_CYCLE 5 +#define DATA_BLOCK_PERCENT 98 + +#define ADDR_1ST_CYCLE(ADDR) (uint8_t)((ADDR)& 0xFF) /* 1st addressing cycle */ +#define ADDR_2ND_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF00) >> 8) /* 2nd addressing cycle */ +#define ADDR_3RD_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF0000) >> 16) /* 3rd addressing cycle */ +#define ADDR_4TH_CYCLE(ADDR) (uint8_t)(((ADDR)& 0xFF000000) >> 24) /* 4th addressing cycle */ + +/* NAND id structure */ +typedef struct { + uint8_t maker_id; + uint8_t device_id; + uint8_t third_id; + uint8_t fourth_id; +} nand_id_struct; + +/* NAND address structure */ +typedef struct { + uint16_t zone; + uint16_t block; + uint16_t page; + uint16_t page_in_offset; +} nand_address_struct; + +/* function declarations */ +/* nand flash peripheral initialize */ +uint8_t exmc_nandflash_init(uint32_t nand_bank); +/* read NAND flash ID */ +void nand_read_id(nand_id_struct *nand_id); +/* write data to nand flash */ +uint8_t nand_write(uint32_t memaddr, uint8_t *pwritebuf, uint16_t bytecount); +/* read data from nand flash */ +uint8_t nand_read(uint32_t mem_addr, uint8_t *preadbuf, uint16_t bytecount); +/* scan and test specific block */ +uint8_t nand_scan_block(uint32_t pagenum); +/* check block is free block */ +uint8_t nand_judge_free_block(uint32_t blocknum); + +#endif /* __EXMC_NANDFLASH_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd25qxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd25qxx.h new file mode 100644 index 0000000..cee536a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd25qxx.h @@ -0,0 +1,74 @@ +/*! + \file gd25qxx.h + \brief the header file of SPI flash gd25qxx driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD25QXX_H +#define __GD25QXX_H + +#include "gd32f10x.h" + +#define SPI_FLASH_PAGE_SIZE 0x100 +#define SPI_FLASH_CS_LOW() gpio_bit_reset(GPIOE, GPIO_PIN_3) +#define SPI_FLASH_CS_HIGH() gpio_bit_set(GPIOE, GPIO_PIN_3) + +/* initialize SPI0 GPIO and parameter */ +void spi_flash_init(void); +/* erase the specified flash sector */ +void spi_flash_sector_erase(uint32_t sector_addr); +/* erase the entire flash */ +void spi_flash_bulk_erase(void); +/* write more than one byte to the flash */ +void spi_flash_page_write(uint8_t* pbuffer,uint32_t write_addr,uint16_t num_byte_to_write); +/* write block of data to the flash */ +void spi_flash_buffer_write(uint8_t* pbuffer,uint32_t write_addr,uint16_t num_byte_to_write); +/* read a block of data from the flash */ +void spi_flash_buffer_read(uint8_t* pbuffer,uint32_t read_addr,uint16_t num_byte_to_read); +/* read flash identification */ +uint32_t spi_flash_read_id(void); +/* initiate a read data byte (read) sequence from the flash */ +void spi_flash_start_read_sequence(uint32_t read_addr); +/* read a byte from the SPI flash */ +uint8_t spi_flash_read_byte(void); +/* send a byte through the SPI interface and return the byte received from the SPI bus */ +uint8_t spi_flash_send_byte(uint8_t byte); +/* send a half word through the SPI interface and return the half word received from the SPI bus */ +uint16_t spi_flash_send_halfword(uint16_t half_word); +/* enable the write access to the flash */ +void spi_flash_write_enable(void); +/* poll the status of the write in progress (wip) flag in the flash's status register */ +void spi_flash_wait_for_write_end(void); +void spi_flash_block_erase(uint32_t block_addr); + +#endif /* __GD25QXX_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/inter_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/inter_flash_if.h new file mode 100644 index 0000000..6c60abf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/inter_flash_if.h @@ -0,0 +1,54 @@ +/*! + \file inter_flash_if.h + \brief USB DFU device internal flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __INTER_FLASH_IF_H +#define __INTER_FLASH_IF_H + +#include "dfu_mem.h" + +#define FLASH_START_ADDR 0x08000000 +#define FLASH_END_ADDR 0x08300000 + +#define OB_RDPT 0x1ffff800 +#define MAL_MASK_OB 0xFFFFFF00 + +#define INTER_FLASH_IF_STR "@Internal Flash /0x08000000/16*002Ka,112*002Kg" + +extern dfu_mem_prop dfu_inter_flash_cb; + +/* local function prototypes ('static') */ +/* write option byte */ +fmc_state_enum option_byte_write(uint32_t mem_add, uint8_t *data); + +#endif /* __INTER_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nand_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nand_flash_if.h new file mode 100644 index 0000000..6909956 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nand_flash_if.h @@ -0,0 +1,47 @@ +/*! + \file nand_flash_if.h + \brief USB DFU device nand flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nand the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __NAND_FLASH_IF_H +#define __NAND_FLASH_IF_H + +#include "dfu_mem.h" + +#define NAND_FLASH_START_ADDR 0x70000000 +#define NAND_FLASH_END_ADDR 0x78000000 + +#define NAND_FLASH_IF_STR "@Nand Flash /0x70000000/4096*032Kg" + +extern dfu_mem_prop dfu_nand_flash_cb; + +#endif /* __NAND_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nor_flash_if.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nor_flash_if.h new file mode 100644 index 0000000..29b8479 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/nor_flash_if.h @@ -0,0 +1,47 @@ +/*! + \file nor_flash_if.h + \brief USB DFU device nor flash interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __NOR_FLASH_IF_H +#define __NOR_FLASH_IF_H + +#include "dfu_mem.h" + +#define NOR_FLASH_START_ADDR 0x00000000U +#define NOR_FLASH_END_ADDR 0x00200000U + +#define NOR_FLASH_IF_STR "@Nor Flash /0x00000000/64*032Kg" + +extern dfu_mem_prop dfu_nor_flash_cb; + +#endif /* __NOR_FLASH_IF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usb_conf.h new file mode 100644 index 0000000..33f4bb6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usb_conf.h @@ -0,0 +1,125 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "stdlib.h" +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1U +#define USB_LOW_POWER 0U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usbd_conf.h new file mode 100644 index 0000000..be67a62 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/inc/usbd_conf.h @@ -0,0 +1,83 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" +#include "dfu_mem.h" +#include "exmc_nandflash.h" +#include "nor_flash_if.h" +#include "nand_flash_if.h" +#include "inter_flash_if.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STR_DESC_MAX_SIZE 64U + +#define DFU_MAX_ALT_ITF_NUM 3 +#define STR_IDX_ALT_ITF0 5 +#define STR_IDX_ALT_ITF1 6 +#define STR_IDX_ALT_ITF2 7 +#define USBD_DFU_INTERFACE 0U + +/* USB feature -- Self Powered */ +//#define USBD_SELF_POWERED + +/* USB user string supported */ +/* #define USB_SUPPORT_USER_STRING_DESC */ + +//#define USBD_DYNAMIC_DESCRIPTOR_CHANGE_ENABLED + +/* Maximum number of supported media (Flash) */ +#define MAX_USED_MEMORY_MEDIA 3U + +#define USB_STRING_COUNT 6U + +/* DFU maximum data packet size */ +#define TRANSFER_SIZE 2048U + +/* memory address from where user application will be loaded, which represents + the dfu code protected against write and erase operations.*/ +#define APP_LOADED_ADDR 0x08008000U + +/* Make sure the corresponding memory where the DFU code should not be loaded + cannot be erased or overwritten by DFU application. */ +#define IS_PROTECTED_AREA(addr) (uint8_t)(((addr >= 0x08000000U) && (addr < (APP_LOADED_ADDR)))? 1U : 0U) + +/* DFU endpoint define */ +#define DFU_IN_EP EP0_IN +#define DFU_OUT_EP EP0_OUT + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/readme.txt new file mode 100644 index 0000000..b33218b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/readme.txt @@ -0,0 +1,62 @@ +/*! + \file readme.txt + \brief description of the USB DFU device demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board,it presents the implementation +of a device firmware upgrade (DFU) capability in the GD32 USB device. + + It follows the DFU class specification defined by the USB Implementers Forum for +reprogramming an application through USBFS. + + The DFU principle is particularly well suited to USBFS applications that +need to be reprogrammed in the field. + + The supported memorys of this example are the internal flash memory, the external +nand flash memory and the external nor flash memory. + + To test the demo, the internal flash is used as an example: + + Step 1: User need a configuration hex image or bin image. The hex image and the bin image +should set application address at APP_LOADED_ADDR in the internal flash memory. User can refer to +"../Test_Images" folder and use the hex images and bin images in it. + + Step 2: User need install the corresponding GD DFU Driver with your PC operation system. + + Step 3: Once the configuration *.hex image is generated, it can be downloaded into the +internal flash memory or the external falsh memory using the GD tool "GD32 MCU DFUEx Tool +" available for download from http://www.gd32mcu.com/cn/download. + + The GD tool "GD32AllInOneProgrammer" can operate the option Byte in the internal flash. + + Step 4: After each device reset, hold down the TAMPER key on the GD32207i-EVAL board into app +routine in the internal flash. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/app.c new file mode 100644 index 0000000..e62a0ed --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/app.c @@ -0,0 +1,88 @@ +/*! + \file app.c + \brief USB main routine for HID device(USB keyboard) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_core.h" +#include "drv_usb_hw.h" + +usb_core_driver usb_dfu_dev; + +#define SRAM_SIZE REG16(0x1ffff7e2)*1024 +#define SRAM_START_ADDRESS SRAM_BASE +#define SRAM_END_ADDRESS SRAM_BASE+SRAM_SIZE + +/*! + \brief main routine will construct a USB keyboard + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + app_func application; + uint32_t app_addr; + uint32_t sram_sect = REG32(APP_LOADED_ADDR); + + /* configure tamper key to run firmware */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + if(1U == gd_eval_key_state_get(KEY_TAMPER)){ + /* test if user code is programmed starting from address 0x08008000 */ + if ((sram_sect >= SRAM_START_ADDRESS)&&((sram_sect < SRAM_END_ADDRESS))) { + app_addr = *(__IO uint32_t*) (APP_LOADED_ADDR + 4U); + application = (app_func) app_addr; + + /* initialize user application's stack pointer */ + __set_MSP(*(__IO uint32_t*) APP_LOADED_ADDR); + + /* jump to user application */ + application(); + } + } + + usb_rcu_config(); + + usb_timer_init(); + + /* USB device stack configure */ + usbd_init(&usb_dfu_dev, USB_CORE_ENUM_FS, &dfu_desc, &dfu_class); + + usb_intr_config(); + + /* check if USB device is enumerated successfully */ + while (USBD_CONFIGURED != usb_dfu_dev.dev.cur_status) { + } + + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/exmc_nandflash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/exmc_nandflash.c new file mode 100644 index 0000000..d6f10d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/exmc_nandflash.c @@ -0,0 +1,1078 @@ +/*! + \file exmc_nandflash.c + \brief nandflash(GD9FU1G8F2AMG) driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "exmc_nandflash.h" + +/* define the physical address of nand flash, and it is determined by the hardware */ +#define BANK1_NAND_ADDR ((uint32_t)0x70000000) +#define BANK_NAND_ADDR BANK1_NAND_ADDR + +/* define operating nand flash macro */ +#define NAND_CMD_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_CMD_AREA) +#define NAND_ADDR_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_ADDR_AREA) +#define NAND_DATA_AREA *(__IO uint8_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA) + +/* the macro of calculate nand flash operating address */ +#define ROW_ADDRESS (addr.page + (addr.block + (addr.zone * NAND_ZONE_SIZE)) * NAND_BLOCK_SIZE) + +/* define NWATI operation */ +#define NWAIT_OPERA_FUNC() while(gpio_input_bit_get(GPIOD, GPIO_PIN_6) == 0) + +/* static variable definition */ +static uint16_t cur_zone = 0; +static uint16_t LUT_tab[NAND_BLOCK_COUNT]; +static uint8_t temp_buf[NAND_PAGE_TOTAL_SIZE]; + +/* local function prototypes ('static') */ +static uint8_t exmc_nand_page_copyback(uint32_t src_pageno, uint32_t dest_pageno); +static uint8_t exmc_nand_page_copyback_ex(uint32_t src_pageno, uint32_t dest_pageno, uint8_t *pbuf, uint16_t offset, uint16_t size); +static uint8_t exmc_nand_write_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_write_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_write_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_read_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt); +static uint8_t exmc_nand_erase_block(uint32_t blocknum); +static uint8_t exmc_nand_read_status(void); +static uint8_t exmc_nand_get_status(void); +static uint8_t nand_write_new_block(nand_address_struct addr, nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size); +static uint8_t nand_write_block(nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size); +static uint8_t nand_read_block(nand_address_struct logaddr, uint8_t *preadbuf, uint16_t size); +static uint8_t nand_build_LUT(uint16_t zone); +static uint16_t nand_find_free_block(uint8_t odd_even); +static uint8_t nand_judge_buf_ok(uint8_t *pbuf, uint32_t len, uint8_t value); +static uint8_t nand_isbad_block(uint32_t blocknum); +static uint8_t nand_mark_used_block(uint32_t blocknum); +static void nand_mark_bad_block(uint32_t blocknum); +static uint8_t nand_mark_logic_block(uint32_t blocknum, uint16_t logblock); + +/*! + \brief initialize nand flash peripheral + \param[in] none + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t exmc_nandflash_init(uint32_t nand_bank) +{ + exmc_nand_parameter_struct nand_init_struct; + exmc_nand_pccard_timing_parameter_struct nand_timing_init_struct; + + /* enable EXMC clock*/ + rcu_periph_clock_enable(RCU_EXMC); + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* common GPIO configuration */ + /* D2(PD0),D3(PD1),D0(PD14) and D1(PD15) pins configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_14 | GPIO_PIN_15); + + /* D4(PE7),D5(PE8),D6(PE9) and D7(PE10) pins configuration */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10); + + /* CLE(PD11)and ALE(PD12) pins configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11 | GPIO_PIN_12); + + /* NOE(PD4) and NWE(PD5) pins configuration*/ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); + + /* NWAIT(PD6) pin configuration */ + gpio_init(GPIOD, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + + /* NCE1(PD7) pin configuration */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); /* EXMC configuration */ + nand_timing_init_struct.setuptime = 1U; + nand_timing_init_struct.waittime = 3U; + nand_timing_init_struct.holdtime = 2U; + nand_timing_init_struct.databus_hiztime = 2U; + + nand_init_struct.nand_bank = EXMC_BANK1_NAND; + nand_init_struct.ecc_size = EXMC_ECC_SIZE_2048BYTES; + nand_init_struct.atr_latency = EXMC_ALE_RE_DELAY_1_HCLK; + nand_init_struct.ctr_latency = EXMC_CLE_RE_DELAY_1_HCLK; + nand_init_struct.ecc_logic = ENABLE; + nand_init_struct.databus_width = EXMC_NAND_DATABUS_WIDTH_8B; + nand_init_struct.wait_feature = ENABLE; + nand_init_struct.common_space_timing = &nand_timing_init_struct; + nand_init_struct.attribute_space_timing = &nand_timing_init_struct; + + exmc_nand_init(&nand_init_struct); + + /* enable EXMC NAND bank1 */ + exmc_nand_enable(EXMC_BANK1_NAND); + + /* build LUT(Look up table) */ + return nand_build_LUT(0); +} + +/*! + \brief read NAND flash ID + \param[in] nand_id: structure of nand flash ID + \param[out] none + \retval none +*/ +void nand_read_id(nand_id_struct *nand_id) +{ + uint32_t data = 0; + + /* send command to the command area */ + NAND_CMD_AREA = NAND_CMD_READID; + + /* send address to the address area */ + NAND_ADDR_AREA = 0x00; + + + + /* sequence to read ID from NAND flash */ + data = *(__IO uint32_t *)(BANK_NAND_ADDR | EXMC_DATA_AREA); + + nand_id->maker_id = ADDR_1ST_CYCLE(data); + nand_id->device_id = ADDR_2ND_CYCLE(data); + nand_id->third_id = ADDR_3RD_CYCLE(data); + nand_id->fourth_id = ADDR_4TH_CYCLE(data); +} + +/*! + \brief write data to nand flash + \param[in] mem_addr: logic page number to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_write(uint32_t mem_addr, uint8_t *pwritebuf, uint16_t size) +{ + uint32_t temp; + uint32_t block_remain_size; + nand_address_struct logaddr; + + temp = mem_addr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + logaddr.zone = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + logaddr.block = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + logaddr.page = temp / NAND_PAGE_SIZE; + logaddr.page_in_offset = temp % NAND_PAGE_SIZE; + + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE) - \ + (NAND_PAGE_SIZE * logaddr.page + logaddr.page_in_offset); + + while(size > block_remain_size) { + if(NAND_FAIL == nand_write_block(logaddr, pwritebuf, block_remain_size)) { + return NAND_FAIL; + } + + logaddr.block++; + pwritebuf += block_remain_size; + size -= block_remain_size; + logaddr.page = 0; + logaddr.page_in_offset = 0; + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(size > 0) { + if(NAND_FAIL == nand_write_block(logaddr, pwritebuf, size)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read data from nand flash + \param[in] mem_addr: logic page number to be read + \param[in] preadbuf: pointer to the data buffer to be read + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_read(uint32_t mem_addr, uint8_t *preadbuf, uint16_t size) +{ + uint32_t temp; + uint32_t block_remain_size; + nand_address_struct logaddr; + + temp = mem_addr % (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + + logaddr.zone = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE * NAND_ZONE_SIZE); + logaddr.block = mem_addr / (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + logaddr.page = temp / NAND_PAGE_SIZE; + logaddr.page_in_offset = temp % NAND_PAGE_SIZE; + + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE) - \ + (NAND_PAGE_SIZE * logaddr.page + logaddr.page_in_offset); + + while(size > block_remain_size) { + if(NAND_FAIL == nand_read_block(logaddr, preadbuf, block_remain_size)) { + return NAND_FAIL; + } + + logaddr.block++; + preadbuf += block_remain_size; + size -= block_remain_size; + logaddr.page = 0; + logaddr.page_in_offset = 0; + block_remain_size = (NAND_BLOCK_SIZE * NAND_PAGE_SIZE); + } + + if(size > 0) { + if(NAND_FAIL == nand_read_block(logaddr, preadbuf, size)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief scan and test specific block + \param[in] blocknum: block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +uint8_t nand_scan_block(uint32_t blocknum) +{ + uint32_t i, k; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE; + + memset(temp_buf, 0x00, NAND_PAGE_TOTAL_SIZE); + + for(i = 0; i < BAD_BALOK_TEST_CYCLE; i++) { + if(NAND_READY != exmc_nand_erase_block(blocknum)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page = 0; + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0xFF)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + + addr.page = 0; + + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + memset(temp_buf, 0x00, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != exmc_nand_write_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0x00)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + } + + if(NAND_READY != exmc_nand_erase_block(blocknum)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page = 0; + + for(k = 0; k < NAND_BLOCK_SIZE; k++) { + exmc_nand_read_page(temp_buf, addr, NAND_PAGE_TOTAL_SIZE); + + if(NAND_OK != nand_judge_buf_ok(temp_buf, NAND_PAGE_TOTAL_SIZE, 0xFF)) { + nand_mark_bad_block(blocknum); + return NAND_FAIL; + } + + addr.page++; + } + + return NAND_OK; +} + +/*! + \brief check block is free block + \param[in] blocknum: block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ + uint8_t nand_judge_free_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + USED_OFFSET; + + if(nand_isbad_block(blocknum)) { + return 0; + } + + exmc_nand_read_page(&flag, addr, 1); + + if(0xFF == flag) { + return 1; + } + + return 0; +} + +/*! + \brief copy data from a page to another page + \param[in] src_pageno: source page number + \param[in] dest_pageno: destination page number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_page_copyback(uint32_t src_pageno, uint32_t dest_pageno) +{ + NAND_CMD_AREA = NAND_CMD_COPYBACK_A; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = src_pageno; + NAND_ADDR_AREA = (src_pageno & 0xFF00) >> 8; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_B; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = dest_pageno; + NAND_ADDR_AREA = (dest_pageno & 0xFF00) >> 8; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_D; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief copy data from a page to another page and update some data in target page + \param[in] src_pageno: source page number + \param[in] dest_pageno: destination page number + \param[in] pbuf: data buffer + \param[in] offset: offset in the page, data buffer will write data from it + \param[in] size: data buffer size + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_page_copyback_ex(uint32_t src_pageno, uint32_t dest_pageno, uint8_t *pbuf, uint16_t offset, uint16_t size) +{ + uint16_t i; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_A; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = src_pageno; + NAND_ADDR_AREA = (src_pageno & 0xFF00U) >> 8U; + + NAND_CMD_AREA = NAND_CMD_COPYBACK_B; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = 0; + NAND_ADDR_AREA = dest_pageno; + NAND_ADDR_AREA = (dest_pageno & 0xFF00U) >> 8U; + + /* need no data, need no wait */ + NAND_CMD_AREA = NAND_CMD_COPYBACK_C; + + NAND_ADDR_AREA = offset; + NAND_ADDR_AREA = offset >> 8U; + + /* send data */ + for(i = 0; i < size; i++) { + NAND_DATA_AREA = pbuf[i]; + } + + NAND_CMD_AREA = NAND_CMD_COPYBACK_D; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief write data to page + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: the address of the data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint16_t i; + + /* send write page command */ + NAND_CMD_AREA = NAND_CMD_WRITE_1ST; + + NAND_ADDR_AREA = addr.page_in_offset; + NAND_ADDR_AREA = addr.page_in_offset >> 8U; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + /* write data */ + for(i = 0; i < bytecnt; i++) { + NAND_DATA_AREA = pbuf[i]; + } + + NAND_CMD_AREA = NAND_CMD_WRITE_2ND; + + /* check operation status */ + if(NAND_READY == exmc_nand_get_status()) { + return NAND_OK; + } + + return NAND_FAIL; +} + +/*! + \brief read data from page + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the address of the data to be read + \param[in] bytecnt: byte count to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_page(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint16_t i; + + /* send read page command */ + NAND_CMD_AREA = NAND_CMD_READ1_1ST; + + NAND_ADDR_AREA = addr.page_in_offset; + NAND_ADDR_AREA = addr.page_in_offset >> 8; + NAND_ADDR_AREA = ADDR_1ST_CYCLE(ROW_ADDRESS); + NAND_ADDR_AREA = ADDR_2ND_CYCLE(ROW_ADDRESS); + + NAND_CMD_AREA = NAND_CMD_READ1_2ND; + + /* must wait, or read data wrong */ + NWAIT_OPERA_FUNC(); + + /* read data to buffer */ + for(i = 0; i < bytecnt; i++) { + pbuf[i] = NAND_DATA_AREA; + } + + return NAND_OK; +} + +/*! + \brief write the spare area of one page data + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: the address of the data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + if(addr.page_in_offset < NAND_PAGE_SIZE) { + return NAND_FAIL; + } + + if(bytecnt + addr.page_in_offset > NAND_PAGE_TOTAL_SIZE) { + return NAND_FAIL; + } + + return exmc_nand_write_page(pbuf, addr, bytecnt); +} + +/*! + \brief read data from the spare area of 1 page + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the address of the data to be read + \param[in] bytecnt: count of spare area to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_spare(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + if(addr.page_in_offset < NAND_PAGE_SIZE) { + return NAND_FAIL; + } + + if(bytecnt + addr.page_in_offset > NAND_PAGE_TOTAL_SIZE) { + return NAND_FAIL; + } + + return exmc_nand_read_page(pbuf, addr, bytecnt); +} + +/*! + \brief write data to the page main data area + \param[in] pbuf: pointer on the buffer containing data to be written + \param[in] addr: physical address data to be written + \param[in] bytecnt: byte count to be written + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_write_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint8_t *temppbuf = pbuf; + + while(bytecnt + addr.page_in_offset > NAND_PAGE_SIZE) { + if(NAND_OK != exmc_nand_write_page(temppbuf, + addr, + NAND_PAGE_SIZE - addr.page_in_offset)) { + return NAND_FAIL; + } + + bytecnt -= NAND_PAGE_SIZE - addr.page_in_offset; + temppbuf += NAND_PAGE_SIZE - addr.page_in_offset; + addr.page++; + addr.page_in_offset = 0; + } + + if(bytecnt > 0) { + if(NAND_OK != exmc_nand_write_page(temppbuf, addr, bytecnt)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief read data from the page main data area + \param[in] pbuf: pointer on the buffer filling data to be read + \param[in] addr: the physical address of the data to be read + \param[in] bytecnt: byte count to be read + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t exmc_nand_read_data(uint8_t *pbuf, nand_address_struct addr, uint16_t bytecnt) +{ + uint8_t *temppbuf = pbuf; + + while(bytecnt + addr.page_in_offset > NAND_PAGE_SIZE) { + if(NAND_OK != exmc_nand_read_page(temppbuf, addr, NAND_PAGE_SIZE - addr.page_in_offset)) { + return NAND_FAIL; + } + + addr.page++; + temppbuf += NAND_PAGE_SIZE - addr.page_in_offset; + bytecnt -= NAND_PAGE_SIZE - addr.page_in_offset; + addr.page_in_offset = 0; + } + + if(bytecnt > 0) { + if(NAND_OK != exmc_nand_read_page(temppbuf, addr, bytecnt)) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief erase complete block of NAND flash + \param[in] blocknum: block number to be erased + \param[out] none + \retval NAND_TIMEOUT_ERROR, NAND_READY +*/ +static uint8_t exmc_nand_erase_block(uint32_t blocknum) +{ + /* send erase command */ + NAND_CMD_AREA = NAND_CMD_ERASE_1ST; + + blocknum <<= 6; + NAND_ADDR_AREA = blocknum; + NAND_ADDR_AREA = blocknum >> 8; + + NAND_CMD_AREA = NAND_CMD_ERASE_2ND; + + return (exmc_nand_get_status()); +} + +/*! + \brief read the NAND flash status + \param[in] none + \param[out] none + \retval NAND_BUSY, NAND_READY, NAND_ERROR +*/ +static uint8_t exmc_nand_read_status(void) +{ + uint8_t data; + uint8_t status = NAND_BUSY; + + /* read operation status */ + NAND_CMD_AREA = NAND_CMD_STATUS; + data = *(__IO uint8_t *)(BANK_NAND_ADDR); + + if(NAND_ERROR == (data & NAND_ERROR)) { + status = NAND_ERROR; + } else if(NAND_READY == (data & NAND_READY)) { + status = NAND_READY; + } else { + status = NAND_BUSY; + } + + return (status); +} + +/*! + \brief get NAND flash operation status + \param[in] none + \param[out] none + \retval NAND_TIMEOUT_ERROR, NAND_READY +*/ +static uint8_t exmc_nand_get_status(void) +{ + uint32_t timeout = 0x10000; + uint8_t status = NAND_READY; + + status = exmc_nand_read_status(); + + /* wait for operation is over, exit when time out */ + while((NAND_READY != status) && (0x00U != timeout)) { + status = exmc_nand_read_status(); + timeout--; + } + + if(0x00 == timeout) { + status = NAND_TIMEOUT_ERROR; + } + + return status; +} + +/*! + \brief copy data from old block to new block and write new data to the new block + \param[in] addr: physical address data to be written + \param[in] logaddr: logic address data to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_write_new_block(nand_address_struct addr, nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size) +{ + uint16_t n, i, offset; + uint16_t newblock; + + for(n = 0; n < 5; n++) { + if(addr.block & 0x0001) { + newblock = nand_find_free_block(BLOCK_EVEN); + } else { + newblock = nand_find_free_block(BLOCK_ODD); + } + + if(newblock >= NAND_BLOCK_COUNT) { + return NAND_FAIL; + } + + for(i = 0; i < NAND_BLOCK_SIZE; i++) { + if(i == addr.page) { + offset = addr.page_in_offset; + while(offset + size > NAND_PAGE_SIZE) { + if(exmc_nand_page_copyback_ex(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i, + pwritebuf, offset, + NAND_PAGE_SIZE - offset) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + + break; + } + + pwritebuf += NAND_PAGE_SIZE - offset; + size -= NAND_PAGE_SIZE - offset; + offset = 0; + i++; + } + + if(size > 0) { + if(exmc_nand_page_copyback_ex(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i, + pwritebuf, offset, size) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + break; + } + } + } else { + if(exmc_nand_page_copyback(addr.block * NAND_BLOCK_SIZE + i, + newblock * NAND_BLOCK_SIZE + i) == NAND_FAIL) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + break; + } + } + } + + if(i == NAND_BLOCK_SIZE) { + if(NAND_FAIL == nand_mark_used_block(newblock)) { + nand_mark_bad_block(newblock); + nand_build_LUT(addr.zone); + continue; + } else { + nand_mark_logic_block(newblock, logaddr.block); + } + + if(NAND_READY != exmc_nand_erase_block(addr.block)) { + nand_mark_bad_block(addr.block); + nand_build_LUT(addr.zone); + continue; + } + + nand_build_LUT(addr.zone); + break; + } + } + + return NAND_OK; +} + +/*! + \brief write data to block + \param[in] logaddr: logic address to be written + \param[in] pwritebuf: pointer to write data buffer + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_write_block(nand_address_struct logaddr, uint8_t *pwritebuf, uint16_t size) +{ + uint16_t PBN; + nand_address_struct addr; + + if(cur_zone != logaddr.zone) { + nand_build_LUT(logaddr.zone); + } + + PBN = LUT_tab[logaddr.block]; + + if(0xFFFFU == PBN) { + return NAND_FAIL; + } + + addr.zone = logaddr.zone; + addr.block = PBN & 0x03FF; + addr.page = logaddr.page; + addr.page_in_offset = logaddr.page_in_offset; + + if(PBN & USED_BLOCK) { + return nand_write_new_block(addr, logaddr, (uint8_t *)pwritebuf, size); + } else { + if(NAND_FAIL == exmc_nand_write_data((uint8_t *)pwritebuf, addr, size)) { + return NAND_FAIL; + } + + if(NAND_FAIL == nand_mark_used_block(addr.block)) { + return NAND_FAIL; + } else { + if(NAND_FAIL == nand_mark_logic_block(addr.block, logaddr.block)) { + return NAND_FAIL; + } + } + + return NAND_OK; + } +} + + +/*! + \brief read data from block + \param[in] logaddr: logic address to be read + \param[in] preadbuf: pointer to the data buffer to be read + \param[in] size: data count + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_read_block(nand_address_struct logaddr, uint8_t *preadbuf, uint16_t size) +{ + uint16_t PBN; + nand_address_struct addr; + + if(cur_zone != logaddr.zone) { + nand_build_LUT(logaddr.zone); + } + + PBN = LUT_tab[logaddr.block]; + addr.block = PBN & 0x03FF; + + if(addr.block >= NAND_BLOCK_COUNT) { + return NAND_FAIL; + } + + addr.zone = logaddr.zone; + addr.page = logaddr.page; + addr.page_in_offset = logaddr.page_in_offset; + + if(NAND_FAIL == exmc_nand_read_data((uint8_t *)preadbuf, addr, size)) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief build NAND flash look up table + \param[in] zone: bulid zone + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_build_LUT(uint16_t zone) +{ + uint16_t logic_blockID; + uint16_t bad_block, cur_block, free_block; + uint8_t spare_area[NAND_SPARE_AREA_SIZE]; + nand_address_struct addr; + + cur_zone = zone; + addr.zone = cur_zone; + addr.block = 0x00; + addr.page = 0x00; + addr.page_in_offset = NAND_PAGE_SIZE; + + /* 1st step : init */ + for(cur_block = 0; cur_block < NAND_ZONE_SIZE; cur_block++) { + LUT_tab[cur_block] = FREE_BLOCK; + } + + /* init Pointers */ + bad_block = NAND_ZONE_SIZE - 1; + cur_block = 0; + + /* 2nd step : locate used and bad blocks */ + while(cur_block < NAND_ZONE_SIZE) { + addr.block = cur_block; + exmc_nand_read_spare(spare_area, addr, NAND_SPARE_AREA_SIZE); + + if(spare_area[BI_OFFSET] != 0xFF) { + LUT_tab[bad_block--] |= cur_block | (uint16_t)BAD_BLOCK; + LUT_tab[cur_block] &= (uint16_t)~FREE_BLOCK; + + if(bad_block <= MAX_LOG_BLOCKS_PER_ZONE + EXCHANGE_BLOCKS_NUM) { + return NAND_FAIL; + } + } else if(spare_area[USED_OFFSET] == 0xFE) { + logic_blockID = (spare_area[LBN0_OFFSET] + (spare_area[LBN1_OFFSET] * 256)) & 0x03FF; + LUT_tab[logic_blockID] |= cur_block | VALID_BLOCK | USED_BLOCK; + LUT_tab[cur_block] &= (uint16_t)(~FREE_BLOCK); + } + + cur_block++; + } + + /* 3rd step : locate free blocks by scanning the LUT already built partially */ + free_block = 0; + for(cur_block = 0; cur_block < NAND_ZONE_SIZE; cur_block++) { + if(cur_block == 81) { + } + + if(!(LUT_tab[cur_block] & USED_BLOCK)) { + do { + if(LUT_tab[free_block] & FREE_BLOCK) { + LUT_tab [cur_block] |= free_block; + LUT_tab [free_block] &= ~FREE_BLOCK; + break; + } + + free_block++; + } while(free_block < NAND_ZONE_SIZE); + } + } + + return NAND_OK; +} + +/*! + \brief find free exchange block, according the block number(odd number select 1001, even number select 1000) + \param[in] odd_even: block number is odd or even + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint16_t nand_find_free_block(uint8_t odd_even) +{ + if(BLOCK_ODD == odd_even) { + return LUT_tab[MAX_LOG_BLOCKS_PER_ZONE] & 0x03FF; + } else if(BLOCK_EVEN == odd_even) { + return LUT_tab[MAX_LOG_BLOCKS_PER_ZONE + 1] & 0x03FF; + } + + return 0xFFFF; +} + +/*! + \brief check NAND data is right + \param[in] pbuf: input buffer + \param[in] len: buffer length + \param[in] value: right value in buffer + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_judge_buf_ok(uint8_t *pbuf, uint32_t len, uint8_t value) +{ + uint32_t i; + + for(i = 0; i < len; i++) { + if(pbuf[i] != value) { + return NAND_FAIL; + } + } + + return NAND_OK; +} + +/*! + \brief check block is bad block + \param[in] blocknum: physical block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_isbad_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + BI_OFFSET; + + exmc_nand_read_spare(&flag, addr, 1); + + if(0xFFU != flag) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief mark used block + \param[in] blocknum: physical block number + \param[out] none + \retval NAND_OK, NAND_FAIL +*/ +static uint8_t nand_mark_used_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + USED_OFFSET; + + flag = NAND_USED_BLOCK_FLAG; + + if(NAND_FAIL == exmc_nand_write_spare(&flag, addr, 1)) { + return NAND_FAIL; + } + + return NAND_OK; +} + +/*! + \brief mark bad block + \param[in] blocknum: block number + \param[out] none + \retval none +*/ +static void nand_mark_bad_block(uint32_t blocknum) +{ + uint8_t flag; + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + BI_OFFSET; + + flag = NAND_BAD_BLOCK_FLAG; + + if(NAND_FAIL == exmc_nand_write_spare(&flag, addr, 1)) { + addr.page = 1; + exmc_nand_write_spare(&flag, addr, 1); + } +} + +/*! + \brief mark logic block to specific block + \param[in] blocknum: physical block number + \param[in] logblock: logic block number + \param[out] none + \retval none +*/ +static uint8_t nand_mark_logic_block(uint32_t blocknum, uint16_t logblock) +{ + nand_address_struct addr; + + addr.zone = cur_zone; + addr.block = blocknum; + addr.page = 0; + addr.page_in_offset = NAND_PAGE_SIZE + LBN0_OFFSET; + + if(NAND_FAIL == exmc_nand_write_spare((uint8_t *)&logblock, addr, 2)) { + return NAND_FAIL; + } + + return NAND_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd25qxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd25qxx.c new file mode 100644 index 0000000..bf42894 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd25qxx.c @@ -0,0 +1,467 @@ +/*! + \file gd25qxx.c + \brief SPI flash gd25qxx driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd25qxx.h" +#include "gd32f10x.h" +#include + +#define WRITE 0x02 /* write to memory instruction */ +#define WRSR 0x01 /* write status register instruction */ +#define WREN 0x06 /* write enable instruction */ + +#define READ 0x03 /* read from memory instruction */ +#define RDSR 0x05 /* read status register instruction */ +#define RDID 0x9F /* read identification */ +#define SE 0x20 /* sector erase instruction */ +#define BE (0x52U) /* block erase instruction */ +#define CE (0xC7U) /* chip erase instruction */ + + +#define WIP_FLAG 0x01 /* write in progress(wip)flag */ +#define DUMMY_BYTE 0xA5 + +/*! + \brief initialize SPI0 GPIO and parameter + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_init(void) +{ + spi_parameter_struct spi_init_struct; + + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOE); + rcu_periph_clock_enable(RCU_SPI0); + + /* SPI0_SCK(PA5), SPI0_MISO(PA6) and SPI0_MOSI(PA7) GPIO pin configuration */ + gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + /* SPI0_CS(PE3) GPIO pin configuration */ + gpio_init(GPIOE, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_3); + + /* chip select invalid*/ + SPI_FLASH_CS_HIGH(); + + /* SPI0 parameter config */ + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_struct.device_mode = SPI_MASTER;; + spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT;; + spi_init_struct.clock_polarity_phase = SPI_CK_PL_LOW_PH_1EDGE; + spi_init_struct.nss = SPI_NSS_SOFT; + spi_init_struct.prescale = SPI_PSC_8 ; + spi_init_struct.endian = SPI_ENDIAN_MSB;; + spi_init(SPI0, &spi_init_struct); + + /* set crc polynomial */ + spi_crc_polynomial_set(SPI0,7); + /* enable SPI0 */ + spi_enable(SPI0); +} + +/*! + \brief erase the specified flash sector + \param[in] sector_addr: address of the sector to erase + \param[out] none + \retval none +*/ +void spi_flash_sector_erase(uint32_t sector_addr) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* sector erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send sector erase instruction */ + spi_flash_send_byte(SE); + /* send sector_addr high nibble address byte */ + spi_flash_send_byte((sector_addr & 0xFF0000) >> 16); + /* send sector_addr medium nibble address byte */ + spi_flash_send_byte((sector_addr & 0xFF00) >> 8); + /* send sector_addr low nibble address byte */ + spi_flash_send_byte(sector_addr & 0xFF); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + + +/*! + \brief erase the specified flash block(unit: 32KB) + \param[in] block_addr: address of the block to erase + \param[out] none + \retval none +*/ +void spi_flash_block_erase(uint32_t block_addr) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* block erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send block erase instruction */ + spi_flash_send_byte(BE); + /* send block_addr high nibble address byte */ + spi_flash_send_byte((block_addr & 0xFF0000U) >> 16U); + /* send block_addr medium nibble address byte */ + spi_flash_send_byte((block_addr & 0xFF00U) >> 8U); + /* send block_addr low nibble address byte */ + spi_flash_send_byte(block_addr & 0xFFU); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/* + \brief erase the entire flash + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_bulk_erase(void) +{ + /* send write enable instruction */ + spi_flash_write_enable(); + + /* bulk erase */ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + /* send bulk erase instruction */ + spi_flash_send_byte(CE); + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/*! + \brief write more than one byte to the flash + \param[in] pbuffer: pointer to the buffer + \param[in] write_addr: flash's internal address to write + \param[in] num_byte_to_write: number of bytes to write to the flash + \param[out] none + \retval none +*/ +void spi_flash_page_write(uint8_t* pbuffer, uint32_t write_addr, uint16_t num_byte_to_write) +{ + /* enable the write access to the flash */ + spi_flash_write_enable(); + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "write to memory" instruction */ + spi_flash_send_byte(WRITE); + /* send write_addr high nibble address byte to write to */ + spi_flash_send_byte((write_addr & 0xFF0000) >> 16); + /* send write_addr medium nibble address byte to write to */ + spi_flash_send_byte((write_addr & 0xFF00) >> 8); + /* send write_addr low nibble address byte to write to */ + spi_flash_send_byte(write_addr & 0xFF); + + /* while there is data to be written on the flash */ + while(num_byte_to_write--){ + /* send the current byte */ + spi_flash_send_byte(*pbuffer); + /* point on the next byte to be written */ + pbuffer++; + } + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + /* wait the end of flash writing */ + spi_flash_wait_for_write_end(); +} + +/*! + \brief write block of data to the flash + \param[in] pbuffer: pointer to the buffer + \param[in] write_addr: flash's internal address to write + \param[in] num_byte_to_write: number of bytes to write to the flash + \param[out] none + \retval none +*/ +void spi_flash_buffer_write(uint8_t* pbuffer, uint32_t write_addr, uint16_t num_byte_to_write) +{ + uint8_t num_of_page = 0, num_of_single = 0, addr = 0, count = 0, temp = 0; + + addr = write_addr % SPI_FLASH_PAGE_SIZE; + count = SPI_FLASH_PAGE_SIZE - addr; + num_of_page = num_byte_to_write / SPI_FLASH_PAGE_SIZE; + num_of_single = num_byte_to_write % SPI_FLASH_PAGE_SIZE; + + /* write_addr is SPI_FLASH_PAGE_SIZE aligned */ + if(0 == addr){ + /* num_byte_to_write < SPI_FLASH_PAGE_SIZE */ + if(0 == num_of_page) + spi_flash_page_write(pbuffer,write_addr,num_byte_to_write); + /* num_byte_to_write > SPI_FLASH_PAGE_SIZE */ + else{ + while(num_of_page--){ + spi_flash_page_write(pbuffer,write_addr,SPI_FLASH_PAGE_SIZE); + write_addr += SPI_FLASH_PAGE_SIZE; + pbuffer += SPI_FLASH_PAGE_SIZE; + } + spi_flash_page_write(pbuffer,write_addr,num_of_single); + } + }else{ + /* write_addr is not SPI_FLASH_PAGE_SIZE aligned */ + if(0 == num_of_page){ + /* (num_byte_to_write + write_addr) > SPI_FLASH_PAGE_SIZE */ + if(num_of_single > count){ + temp = num_of_single - count; + spi_flash_page_write(pbuffer,write_addr,count); + write_addr += count; + pbuffer += count; + spi_flash_page_write(pbuffer,write_addr,temp); + }else + spi_flash_page_write(pbuffer,write_addr,num_byte_to_write); + }else{ + /* num_byte_to_write > SPI_FLASH_PAGE_SIZE */ + num_byte_to_write -= count; + num_of_page = num_byte_to_write / SPI_FLASH_PAGE_SIZE; + num_of_single = num_byte_to_write % SPI_FLASH_PAGE_SIZE; + + spi_flash_page_write(pbuffer,write_addr, count); + write_addr += count; + pbuffer += count; + + while(num_of_page--){ + spi_flash_page_write(pbuffer,write_addr,SPI_FLASH_PAGE_SIZE); + write_addr += SPI_FLASH_PAGE_SIZE; + pbuffer += SPI_FLASH_PAGE_SIZE; + } + + if(0 != num_of_single) + spi_flash_page_write(pbuffer,write_addr,num_of_single); + } + } +} + +/*! + \brief read a block of data from the flash + \param[in] pbuffer: pointer to the buffer that receives the data read from the flash + \param[in] read_addr: flash's internal address to read from + \param[in] num_byte_to_read: number of bytes to read from the flash + \param[out] none + \retval none +*/ +void spi_flash_buffer_read(uint8_t* pbuffer, uint32_t read_addr, uint16_t num_byte_to_read) +{ + /* select the flash: chip slect low */ + SPI_FLASH_CS_LOW(); + + /* send "read from memory " instruction */ + spi_flash_send_byte(READ); + + /* send read_addr high nibble address byte to read from */ + spi_flash_send_byte((read_addr & 0xFF0000) >> 16); + /* send read_addr medium nibble address byte to read from */ + spi_flash_send_byte((read_addr& 0xFF00) >> 8); + /* send read_addr low nibble address byte to read from */ + spi_flash_send_byte(read_addr & 0xFF); + + /* while there is data to be read */ + while(num_byte_to_read--){ + /* read a byte from the flash */ + *pbuffer = spi_flash_send_byte(DUMMY_BYTE); + /* point to the next location where the byte read will be saved */ + pbuffer++; + } + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} + +/*! + \brief read flash identification + \param[in] none + \param[out] none + \retval flash identification +*/ +uint32_t spi_flash_read_id(void) +{ + uint32_t temp = 0, temp0 = 0, temp1 = 0, temp2 = 0; + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "RDID " instruction */ + spi_flash_send_byte(0x9F); + + /* read a byte from the flash */ + temp0 = spi_flash_send_byte(DUMMY_BYTE); + + /* read a byte from the flash */ + temp1 = spi_flash_send_byte(DUMMY_BYTE); + + /* read a byte from the flash */ + temp2 = spi_flash_send_byte(DUMMY_BYTE); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); + + temp = (temp0 << 16) | (temp1 << 8) | temp2; + + return temp; +} + +/*! + \brief initiate a read data byte (read) sequence from the flash + \param[in] read_addr: flash's internal address to read from + \param[out] none + \retval none +*/ +void spi_flash_start_read_sequence(uint32_t read_addr) +{ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "read from memory " instruction */ + spi_flash_send_byte(READ); + + /* send the 24-bit address of the address to read from */ + /* send read_addr high nibble address byte */ + spi_flash_send_byte((read_addr & 0xFF0000) >> 16); + /* send read_addr medium nibble address byte */ + spi_flash_send_byte((read_addr& 0xFF00) >> 8); + /* send read_addr low nibble address byte */ + spi_flash_send_byte(read_addr & 0xFF); +} + +/*! + \brief read a byte from the SPI flash + \param[in] none + \param[out] none + \retval byte read from the SPI flash +*/ +uint8_t spi_flash_read_byte(void) +{ + return(spi_flash_send_byte(DUMMY_BYTE)); +} + +/*! + \brief send a byte through the SPI interface and return the byte received from the SPI bus + \param[in] byte: byte to send + \param[out] none + \retval the value of the received byte +*/ +uint8_t spi_flash_send_byte(uint8_t byte) +{ + /* loop while data register in not emplty */ + while (RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_TBE)); + + /* send byte through the SPI0 peripheral */ + spi_i2s_data_transmit(SPI0,byte); + + /* wait to receive a byte */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_RBNE)); + + /* return the byte read from the SPI bus */ + return(spi_i2s_data_receive(SPI0)); +} + +/*! + \brief send a half word through the SPI interface and return the half word received from the SPI bus + \param[in] half_word: half word to send + \param[out] none + \retval the value of the received byte +*/ +uint16_t spi_flash_send_halfword(uint16_t half_word) +{ + /* loop while data register in not emplty */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_TBE)); + + /* send half word through the SPI0 peripheral */ + spi_i2s_data_transmit(SPI0,half_word); + + /* wait to receive a half word */ + while(RESET == spi_i2s_flag_get(SPI0,SPI_FLAG_RBNE)); + + /* return the half word read from the SPI bus */ + return spi_i2s_data_receive(SPI0); +} + +/*! + \brief enable the write access to the flash + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_write_enable(void) +{ + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "write enable" instruction */ + spi_flash_send_byte(WREN); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} + +/*! + \brief poll the status of the write in progress(wip) flag in the flash's status register + \param[in] none + \param[out] none + \retval none +*/ +void spi_flash_wait_for_write_end(void) +{ + uint8_t flash_status = 0; + + /* select the flash: chip select low */ + SPI_FLASH_CS_LOW(); + + /* send "read status register" instruction */ + spi_flash_send_byte(RDSR); + + /* loop as long as the memory is busy with a write cycle */ + do{ + /* send a dummy byte to generate the clock needed by the flash + and put the value of the status register in flash_status variable */ + flash_status = spi_flash_send_byte(DUMMY_BYTE); + }while((flash_status & WIP_FLAG) == SET); + + /* deselect the flash: chip select high */ + SPI_FLASH_CS_HIGH(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_hw.c new file mode 100644 index 0000000..baee630 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_it.c new file mode 100644 index 0000000..486f83b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/gd32f10x_it.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver usb_dfu_dev; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq(void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&usb_dfu_dev); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usb_dfu_dev.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&usb_dfu_dev); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/inter_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/inter_flash_if.c new file mode 100644 index 0000000..4e85072 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/inter_flash_if.c @@ -0,0 +1,262 @@ +/*! + \file inter_flash_if.c + \brief USB DFU device flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "inter_flash_if.h" + +/* local function prototypes ('static') */ +static uint8_t flash_if_init(void); +static uint8_t flash_if_deinit(void); +static uint8_t flash_if_erase(uint32_t addr); +static uint8_t flash_if_write(uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t *flash_if_read(uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t flash_if_checkaddr(uint32_t addr); +static fmc_state_enum fmc_bank0_state_get(void); +static fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout); + +dfu_mem_prop dfu_inter_flash_cb = { + (const uint8_t *)INTER_FLASH_IF_STR, + + flash_if_init, + flash_if_deinit, + flash_if_erase, + flash_if_write, + flash_if_read, + flash_if_checkaddr, + 60, /* flash erase timeout in ms */ + 80 /* flash programming timeout in ms (80us * RAM Buffer size (1024 Bytes) */ +}; + +/*! + \brief program option byte + \param[in] Mem_Add: target address + \param[in] data: pointer to target data + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum option_byte_write(uint32_t mem_add, uint8_t *data) +{ + uint8_t index; + + fmc_state_enum status ; + + /* unlock the flash program erase controller */ + fmc_unlock(); + + /* clear pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + /* authorize the small information block programming */ + ob_unlock(); + + /* start erase the option byte */ + FMC_CTL0 |= FMC_CTL0_OBER; + FMC_CTL0 |= FMC_CTL0_START; + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + FMC_CTL0 &= ~FMC_CTL0_OBER; + /* set the OBPG bit */ + FMC_CTL0 |= FMC_CTL0_OBPG; + + /* option bytes always have 16 bytes */ + for (index = 0U; index < 15U; index = index + 2U) { + *(__IO uint16_t *)mem_add = data[index] & 0xffU; + + mem_add = mem_add + 2U; + + status = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + } + + /* if the program operation is completed, disable the OBPG Bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + + fmc_lock(); + + return status; +} + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_init(void) +{ + /* unlock the internal flash */ + fmc_unlock(); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_deinit(void) +{ + /* lock the internal flash */ + fmc_lock(); + + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_erase(uint32_t addr) +{ + fmc_page_erase(addr); + + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_write(uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t idx = 0U; + + /* unlock the flash program erase controller */ + fmc_unlock(); + + /* not an aligned data */ + if (len & 0x03U) { + for(idx = len; idx < ((len & 0xFFFCU) + 4U); idx++) { + buf[idx] = 0xFFU; + } + } + + /* data received are word multiple */ + for (idx = 0U; idx < len; idx += 4U) { + fmc_word_program(addr, *(uint32_t *)(buf + idx)); + + addr += 4U; + } + + fmc_lock(); + + return MEM_OK; +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *flash_if_read(uint8_t *buf, uint32_t addr, uint32_t len) +{ + return (uint8_t *)(addr); +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t flash_if_checkaddr(uint32_t addr) +{ + if((addr >= FLASH_START_ADDR) && (addr < FLASH_END_ADDR)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} + +/*! + \brief get the FMC bank0 state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_bank0_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_BUSY)) { + fmc_state = FMC_BUSY; + } else { + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_WPERR)) { + fmc_state = FMC_WPERR; + } else { + if((uint32_t)0x00U != (FMC_STAT0 & (FMC_STAT0_PGERR))) { + fmc_state = FMC_PGERR; + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC bank0 is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do { + /* get FMC state */ + fmc_state = fmc_bank0_state_get(); + timeout--; + } while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state) { + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nand_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nand_flash_if.c new file mode 100644 index 0000000..d19f7e5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nand_flash_if.c @@ -0,0 +1,148 @@ +/*! + \file nand_flash_if.c + \brief USB DFU device nand flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nand the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "nand_flash_if.h" +#include "exmc_nandflash.h" + +/* local function prototypes ('static') */ +static uint8_t nand_flash_if_init (void); +static uint8_t nand_flash_if_deinit (void); +static uint8_t nand_flash_if_erase (uint32_t addr); +static uint8_t nand_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t* nand_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t nand_flash_if_checkaddr (uint32_t addr); + +dfu_mem_prop dfu_nand_flash_cb = +{ + (const uint8_t *)NAND_FLASH_IF_STR, + + nand_flash_if_init, + nand_flash_if_deinit, + nand_flash_if_erase, + nand_flash_if_write, + nand_flash_if_read, + nand_flash_if_checkaddr, + 20, /* flash erase timeout in ms */ + 40 /* flash programming timeout in ms */ +}; + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_init (void) +{ + /* configure the EXMC access mode */ + exmc_nandflash_init(EXMC_BANK1_NAND); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_deinit (void) +{ + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_erase (uint32_t addr) +{ + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* calculate actual address */ + uint32_t addr_actual = addr - NAND_FLASH_START_ADDR; + + /* write block of data to the flash */ + if(NAND_OK == nand_write(addr_actual, buf, len)){ + return MEM_OK; + }else{ + return MEM_FAIL; + } +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *nand_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* calculate actual address */ + uint32_t addr_actual = addr - NAND_FLASH_START_ADDR; + + nand_read(addr_actual, buf, len); + + return buf; +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nand_flash_if_checkaddr (uint32_t addr) +{ + if ((addr >= NAND_FLASH_START_ADDR) && (addr < NAND_FLASH_END_ADDR)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nor_flash_if.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nor_flash_if.c new file mode 100644 index 0000000..52dbcb8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/nor_flash_if.c @@ -0,0 +1,143 @@ +/*! + \file nor_flash_if.c + \brief USB DFU device nor flash interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd25qxx.h" +#include "nor_flash_if.h" + +/* local function prototypes ('static') */ +static uint8_t nor_flash_if_init (void); +static uint8_t nor_flash_if_deinit (void); +static uint8_t nor_flash_if_erase (uint32_t addr); +static uint8_t nor_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t* nor_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len); +static uint8_t nor_flash_if_checkaddr (uint32_t addr); + +dfu_mem_prop dfu_nor_flash_cb = +{ + (const uint8_t *)NOR_FLASH_IF_STR, + + nor_flash_if_init, + nor_flash_if_deinit, + nor_flash_if_erase, + nor_flash_if_write, + nor_flash_if_read, + nor_flash_if_checkaddr, + 400, /* flash erase timeout in ms */ + 20 /* flash programming timeout in ms */ +}; + +/*! + \brief flash memory interface initialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_init (void) +{ + /* initialize spi interface*/ + spi_flash_init(); + + return MEM_OK; +} + +/*! + \brief flash memory interface deinitialization routine + \param[in] none + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_deinit (void) +{ + return MEM_OK; +} + +/*! + \brief erase flash sector + \param[in] addr: flash address to be erased + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_erase (uint32_t addr) +{ + /* erase the specified flash sector */ + spi_flash_block_erase(addr); + + return MEM_OK; +} + +/*! + \brief flash memory write routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be written + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + /* write block of data to the flash */ + spi_flash_buffer_write(buf, addr, len); + + return MEM_OK; +} + +/*! + \brief flash memory read routine + \param[in] buf: data buffer pointer + \param[in] addr: flash address to be read from + \param[in] len: length of data to be read (in bytes) + \param[out] none + \retval pointer to the physical address where data should be read +*/ +static uint8_t *nor_flash_if_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + spi_flash_buffer_read(buf, addr, len); + + return buf; +} + +/*! + \brief check if the address is an allowed address for this memory + \param[in] addr: flash address to be checked + \param[out] none + \retval MEM_OK if the operation is right, MEM_FAIL else +*/ +static uint8_t nor_flash_if_checkaddr (uint32_t addr) +{ + if (((addr > NOR_FLASH_START_ADDR) && (addr < NOR_FLASH_END_ADDR)) || (NOR_FLASH_START_ADDR == addr)) { + return MEM_OK; + } else { + return MEM_FAIL; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/dev_firmware_update/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewp new file mode 100644 index 0000000..db53da2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewp @@ -0,0 +1,1055 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_operation.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Source\usb_iap_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewt new file mode 100644 index 0000000..2e336e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.ewt @@ -0,0 +1,1156 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_operation.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\class\iap\Source\usb_iap_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.eww new file mode 100644 index 0000000..5d17e90 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/EWARM/iap.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\iap.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvopt new file mode 100644 index 0000000..b6bb37f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvopt @@ -0,0 +1,636 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + iap_hid + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + + 0 + 1 + device_descripter + + + 1 + 1 + base_address,0x0A + + + + + 1 + 0 + 0x08004000 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 8 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\flash_operation.c + flash_operation.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Source\usb_iap_core.c + usb_iap_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 22 + 2 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 23 + 5 + 0 + 0 + 49483884 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvoptx new file mode 100644 index 0000000..9868930 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvoptx @@ -0,0 +1,563 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + iap_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + device_descripter + + + 1 + 1 + base_address,0x0A + + + + + 1 + 0 + 0x08004000 + 0 + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\flash_operation.c + flash_operation.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Source\usb_iap_core.c + usb_iap_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 22 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 23 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvproj new file mode 100644 index 0000000..67426f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvproj @@ -0,0 +1,569 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + iap_hid + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + iap_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_operation.c + 1 + ..\src\flash_operation.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usb_iap_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Source\usb_iap_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvprojx new file mode 100644 index 0000000..30080cf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/MDK-ARM/iap.uvprojx @@ -0,0 +1,562 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + iap_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + iap_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_operation.c + 1 + ..\src\flash_operation.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usb_iap_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\iap\Source\usb_iap_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/flash_operation.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/flash_operation.h new file mode 100644 index 0000000..b3c0dfc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/flash_operation.h @@ -0,0 +1,46 @@ +/*! + \file flash_operation.h + \brief the header file of the flash_operation.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __FLASH_OPERATION_H +#define __FLASH_OPERATION_H + +#include "drv_usb_hw.h" + +/* function declarations */ +/* erase flash */ +void flash_erase(uint32_t address, uint32_t file_length, uint8_t* report_buffer); +/* write data to sectors of memory */ +void iap_data_write(uint8_t *data, uint32_t addr, uint32_t len); + +#endif /* __FLASH_OPERATION_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usb_conf.h new file mode 100644 index 0000000..a3cffb1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usb_conf.h @@ -0,0 +1,125 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "stdlib.h" +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1U +#define USB_LOW_POWER 0U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __GNUC__ */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usbd_conf.h new file mode 100644 index 0000000..45c647c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/inc/usbd_conf.h @@ -0,0 +1,79 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1 +#define USBD_ITF_MAX_NUM 1 +#define USB_STR_DESC_MAX_SIZE 64 + +#define USBD_IAP_INTERFACE 0 + +/* USB user string supported */ +/* #define USB_SUPPORT_USER_STRING_DESC */ + +//#define USBD_DYNAMIC_DESCRIPTOR_CHANGE_ENABLED + +#define USB_STRING_COUNT 4U + +#define IAP_IN_EP EP1_IN +#define IAP_OUT_EP EP1_OUT + +#define IAP_IN_PACKET 24U +#define IAP_OUT_PACKET 64U +#define TRANSFER_SIZE 62U + +/* maximum number of supported memory media (Flash, RAM or EEPROM and so on) */ +#define MAX_USED_MEMORY_MEDIA 1U + +/* MCU page size */ +#define PAGE_SIZE 2048U +#define OPT_BYTE_ADDR1 0x1FFFF800U + +#define REPORT_IN_COUNT 0x17U +#define REPORT_OUT_COUNT ((TRANSFER_SIZE) + 1U) + +/* memory address from where user application will be loaded, which represents + the DFU code protected against write and erase operations.*/ +#define APP_LOADED_ADDR 0x08008000U + +/* make sure the corresponding memory where the DFU code should not be loaded + cannot be erased or overwritten by DFU application. */ +#define IS_PROTECTED_AREA(addr) (uint8_t)(((addr >= 0x08000000U) && \ + (addr < (APP_LOADED_ADDR)))? 1U : 0U) + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/readme.txt new file mode 100644 index 0000000..8b22bd3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/readme.txt @@ -0,0 +1,53 @@ +/*! + \file readme.txt + \brief description of the USB Custom HID device demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board,it provides a description of +how to use the USBFS peripheral. + + The GD32 device is enumerated as an USB Custom HID device for IAP, that uses the +native PC Host HID driver. + + To test the demo, you need a configuration hex image or bin image. The hex image +or the bin image should set application address at 0x8008000. You can refer to +"Utilities/Binary/DFU_Images" folder and use the hex images or bin images in it. + + To test the demo, you need to: + - Download the "USB IAP Client" PC applet + - Start the "USB IAP Client" PC applet and connect GD32 USB to PC (Note: maybe + the driver installing is failed in the first time, try reseting again.) + - The device should be detected and shown in the PC applet + - Select the hex image and download it to the flash + - After each device reset, the mcu will run the new application + - After each device reset, hold down the TAMPER key on the GD32 board + to enter IAP mode \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/app.c new file mode 100644 index 0000000..bb78561 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/app.c @@ -0,0 +1,88 @@ +/*! + \file app.c + \brief USB main routine for HID device(USB keyboard) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usb_iap_core.h" + +usb_core_driver usb_iap_dev; + +#define SRAM_SIZE REG16(0x1ffff7e2)*1024 +#define SRAM_START_ADDRESS SRAM_BASE +#define SRAM_END_ADDRESS SRAM_BASE+SRAM_SIZE + +/*! + \brief main routine will construct a USB keyboard + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + app_func application; + uint32_t app_address; + uint32_t sram_sect = REG32(APP_LOADED_ADDR); + + /* configure Tamper key to run firmware */ + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + + if (0U != gd_eval_key_state_get(KEY_TAMPER)) { + /* test if user code is programmed starting from address 0x8008000 */ + if ((sram_sect >= SRAM_START_ADDRESS)&&((sram_sect < SRAM_END_ADDRESS))) { + app_address = *(__IO uint32_t*) (APP_LOADED_ADDR + 4U); + application = (app_func) app_address; + + /* initialize user application's stack pointer */ + __set_MSP(*(__IO uint32_t*) APP_LOADED_ADDR); + + /* jump to user application */ + application(); + } + } + + usb_rcu_config(); + + usb_timer_init(); + + /* USB device stack configure */ + usbd_init(&usb_iap_dev, USB_CORE_ENUM_FS, &iap_desc, &iap_class); + + usb_intr_config(); + + /* check if USB device is enumerated successfully */ + while (USBD_CONFIGURED != usb_iap_dev.dev.cur_status) { + } + + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/flash_operation.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/flash_operation.c new file mode 100644 index 0000000..ecb4f36 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/flash_operation.c @@ -0,0 +1,97 @@ +/*! + \file flash_operation.c + \brief flash operation driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "flash_operation.h" +#include "usbd_conf.h" + +/*! + \brief erase flash + \param[in] address: erase start address + \param[in] file_length: file length + \param[in] report_buffer: report buffer + \param[out] none + \retval MAL_OK if all operations are OK, MAL_FAIL else +*/ +void flash_erase(uint32_t address, uint32_t file_length, uint8_t* report_buffer) +{ + uint16_t page_count = 0U, i = 0U; + + page_count = report_buffer[6]; + + /* clear pending flags */ + fmc_flag_clear (FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + for (i = 0U; i < page_count; i ++) { + /* call the standard flash erase-page function */ + fmc_page_erase(address); + + address += PAGE_SIZE; + } +} + +/*! + \brief write data to sectors of memory + \param[in] data: data to be written + \param[in] addr: sector address/code + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval MAL_OK if all operations are OK, MAL_FAIL else +*/ +void iap_data_write (uint8_t *data, uint32_t addr, uint32_t len) +{ + uint32_t idx = 0U; + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return; + } + + /* unlock the flash program erase controller */ + fmc_unlock(); + + /* clear pending flags */ + fmc_flag_clear(FMC_FLAG_BANK0_PGERR | FMC_FLAG_BANK0_WPERR | FMC_FLAG_BANK0_END); + + /* data received are word multiple */ + for (idx = 0U; idx < len; idx += 2) { + if (FMC_READY == fmc_halfword_program(addr, *(uint32_t *)(data + idx))) { + addr += 2U; + } else { + while(1){ + } + } + } + + fmc_lock(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_hw.c new file mode 100644 index 0000000..74e1bb9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIM2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief timer base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_it.c new file mode 100644 index 0000000..8945835 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/gd32f10x_it.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver usb_iap_dev; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq(void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&usb_iap_dev); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usb_iap_dev.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&usb_iap_dev); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/in_application_program_hid/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewd new file mode 100644 index 0000000..cc9763e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewp new file mode 100644 index 0000000..73f03e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewp @@ -0,0 +1,1067 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_data.c + + + $PROJ_DIR$\..\src\flash_msd.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\usbd_storage_msd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewt new file mode 100644 index 0000000..a642322 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.ewt @@ -0,0 +1,1168 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_data.c + + + $PROJ_DIR$\..\src\flash_msd.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\usbd_storage_msd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.eww new file mode 100644 index 0000000..c7ad0a1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/EWARM/msc_cdrom.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\msc_cdrom.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvopt new file mode 100644 index 0000000..3a95d70 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvopt @@ -0,0 +1,681 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + msc_cdrom + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 8 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 35 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 53 + 0 + 0 + 0 + 0 + ..\src\flash_data.c + flash_data.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\flash_msd.c + flash_msd.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\usbd_storage_msd.c + usbd_storage_msd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 25 + 1 + 0 + 0 + 26 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 26 + 2 + 0 + 0 + 16 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 27 + 5 + 0 + 0 + 46 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx new file mode 100644 index 0000000..4947b4a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvoptx @@ -0,0 +1,591 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + msc_cdrom + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U59400616 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\flash_data.c + flash_data.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\flash_msd.c + flash_msd.c + 0 + 0 + + + 1 + 6 + 1 + 0 + 0 + 0 + ..\src\usbd_storage_msd.c + usbd_storage_msd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 7 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 26 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 27 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvproj new file mode 100644 index 0000000..85edc3d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvproj @@ -0,0 +1,632 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_cdrom + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_cdrom + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_data.c + 1 + ..\src\flash_data.c + + + 2 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + + + + + + + + + + + + flash_msd.c + 1 + ..\src\flash_msd.c + + + usbd_storage_msd.c + 1 + ..\src\usbd_storage_msd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx new file mode 100644 index 0000000..28671ae --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/MDK-ARM/msc_cdrom.uvprojx @@ -0,0 +1,633 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_cdrom + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_cdrom + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_data.c + 1 + ..\src\flash_data.c + + + 2 + 0 + 0 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + 11 + + + 1 + + + + 2 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 0 + 2 + 2 + 2 + 2 + 2 + 0 + 0 + 2 + 2 + 2 + 2 + 2 + + + + + + + + + + + + flash_msd.c + 1 + ..\src\flash_msd.c + + + usbd_storage_msd.c + 1 + ..\src\usbd_storage_msd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/flash_msd.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/flash_msd.h new file mode 100644 index 0000000..c52bb78 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/flash_msd.h @@ -0,0 +1,60 @@ +/*! + \file flash_msd.h + \brief the header file of flash_msd.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __FLASH_MSD_H +#define __FLASH_MSD_H + +#include "usbd_conf.h" + +#define FLASH_BASE_ADDR ((uint32_t)(0x08000000U + 0x04000U)) +#define FLASH_END_ADDR ((uint32_t)(0x08000000U + 0x40000U)) + +#define BLOCK_SIZE (uint32_t)512U +#define BLOCK_NUM (uint32_t)((FLASH_END_ADDR - FLASH_BASE_ADDR) / BLOCK_SIZE) + +/* function declarations */ +/* initialize flash */ +uint32_t flash_init (void); +/* read data from multiple blocks of flash */ +uint32_t flash_read_multi_blocks (uint8_t* buf, + uint32_t read_addr, + uint16_t blk_size, + uint32_t blk_num); +/* write data to multiple blocks of flash */ +uint32_t flash_write_multi_blocks (uint8_t* buf, + uint32_t write_addr, + uint16_t blk_size, + uint32_t blk_num); + +#endif /* __FLASH_MSD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usb_conf.h new file mode 100644 index 0000000..a3c9495 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usb_conf.h @@ -0,0 +1,125 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + + +#define USB_SOF_OUTPUT 1U +#define USB_LOW_POWER 0U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #define __packed __attribute__ ((__packed__)) +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usbd_conf.h new file mode 100644 index 0000000..da990ad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/inc/usbd_conf.h @@ -0,0 +1,58 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STR_DESC_MAX_SIZE 64U + +#define USBD_MSC_INTERFACE 0U + +/* Class Layer Parameter */ +#define MSC_IN_EP EP1_IN +#define MSC_OUT_EP EP1_OUT + +#define MSC_DATA_PACKET_SIZE 64U + +#define MSC_MEDIA_PACKET_SIZE 4096U + +#define MEM_LUN_NUM 1U + +#define USB_STRING_COUNT 4U + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/readme.txt new file mode 100644 index 0000000..fb6a344 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/readme.txt @@ -0,0 +1,48 @@ +/*! + \file readme.txt + \brief description of the USB MSC device(Udisk) demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board,it provides a description of +how to use the USB device application based on the Mass Storage Class (MSC). + + This demo is provides a description of how to use the USB-FS-Device peripheral. + + It illustrates an implementation of the CD-ROM which uses the bulk transfer while +the internal Flash is used as storage media. + + This example supports the BBB (bulk only transfer) protocol and all needed SCSI +(small computer system interface) commands, and is compatible with Windows platform. + + After running the example, the user just has to plug the USB cable into a PC host +and the device is automatically detected. A new CDROM appears in the system window +and the user can open it to read the contents. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/app.c new file mode 100644 index 0000000..61e0f92 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/app.c @@ -0,0 +1,65 @@ +/*! + \file main.c + \brief USB main routine for MSC device(Udisk) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usbd_msc_core.h" + +usb_core_driver msc_cdrom; +extern uint8_t Flash_Data[]; + +/*! + \brief main routine will construct a USB mass storage device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + uint8_t flag = 0U; + + usb_rcu_config(); + + usb_timer_init(); + + usbd_init(&msc_cdrom, USB_CORE_ENUM_FS, &msc_desc, &msc_class); + + usb_intr_config(); + + flag = Flash_Data[0]; + + (void)flag; + + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_data.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_data.c new file mode 100644 index 0000000..a2d6a96 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_data.c @@ -0,0 +1,2999 @@ +/*! + \file flash_data.c + \brief the data will be store in flash + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_conf.h" + +#if defined ( __ICCARM__ ) +const __root uint8_t Flash_Data[] @0x8004000 = +#else +const uint8_t Flash_Data[] __attribute__((at(0x8004000))) = +#endif +{ +0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31, 0x00, 0x02, 0x04, 0x01, 0x00, +0x02, 0xe0, 0x00, 0x60, 0x00, 0xf8, 0x01, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x0a, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, +0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, +0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 0x16, +0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, 0x06, +0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x38, 0x4e, 0x24, 0x7d, 0x20, 0x8b, 0xc1, 0x99, +0xe8, 0x7e, 0x01, 0x83, 0xeb, 0x3a, 0x66, 0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, +0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0xfe, +0x06, 0xd8, 0x7d, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, +0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11, 0x60, 0x89, 0x46, 0xfc, 0x89, 0x56, 0xfe, 0xb8, +0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, +0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x28, 0x01, 0x72, 0x3e, 0x38, 0x2d, 0x74, 0x17, 0x60, +0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x3d, 0x4e, 0x74, 0x09, 0x83, 0xc7, 0x20, +0x3b, 0xfb, 0x72, 0xe7, 0xeb, 0xdd, 0xfe, 0x0e, 0xd8, 0x7d, 0x7b, 0xa7, 0xbe, 0x7f, 0x7d, 0xac, +0x98, 0x03, 0xf0, 0xac, 0x98, 0x40, 0x74, 0x0c, 0x48, 0x74, 0x13, 0xb4, 0x0e, 0xbb, 0x07, 0x00, +0xcd, 0x10, 0xeb, 0xef, 0xbe, 0x82, 0x7d, 0xeb, 0xe6, 0xbe, 0x80, 0x7d, 0xeb, 0xe1, 0xcd, 0x16, +0x5e, 0x1f, 0x66, 0x8f, 0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, 0xfe, +0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1, 0x04, 0xe8, 0xc2, 0x00, +0x72, 0xd7, 0xea, 0x00, 0x02, 0x70, 0x00, 0x52, 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x91, +0x8b, 0x46, 0x18, 0xa2, 0x26, 0x05, 0x96, 0x92, 0x33, 0xd2, 0xf7, 0xf6, 0x91, 0xf7, 0xf6, 0x42, +0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, +0x02, 0x80, 0x7e, 0x02, 0x0e, 0x75, 0x04, 0xb4, 0x42, 0x8b, 0xf4, 0x8a, 0x56, 0x24, 0xcd, 0x13, +0x61, 0x61, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03, +0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x79, 0x73, +0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, +0x49, 0x2f, 0x4f, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, +0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c, 0x20, 0x61, 0x6e, +0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, +0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, +0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 0x59, 0x53, 0x7f, 0x01, +0x00, 0x41, 0xbb, 0x00, 0x07, 0x60, 0x66, 0x6a, 0x00, 0xe9, 0x3b, 0xff, 0x00, 0x00, 0x55, 0xaa, +0xf8, 0xff, 0xff, 0x03, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xa0, 0x00, 0x0b, +0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13, 0xf0, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xf8, 0xff, 0xff, 0x03, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xa0, 0x00, 0x0b, +0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13, 0xf0, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x41, 0x47, 0x00, 0x44, 0x00, 0x5f, 0x00, 0x4c, 0x00, 0x6f, 0x00, 0x0f, 0x00, 0xc8, 0x67, 0x00, +0x6f, 0x00, 0x2e, 0x00, 0x6a, 0x00, 0x70, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0x47, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x4f, 0x20, 0x4a, 0x50, 0x47, 0x00, 0x10, 0xb3, 0x0b, 0x4f, +0x94, 0x4f, 0x00, 0x00, 0x00, 0x00, 0xb3, 0x50, 0x94, 0x4f, 0x02, 0x00, 0xc4, 0x8c, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x01, 0x2c, +0x01, 0x2c, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x04, +0x04, 0x03, 0x05, 0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x08, +0x08, 0x0a, 0x08, 0x07, 0x07, 0x0a, 0x0d, 0x0a, 0x0a, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x09, +0x0e, 0x0f, 0x0d, 0x0c, 0x0e, 0x0b, 0x0c, 0x0c, 0x0c, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x02, 0x02, +0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, +0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, +0x00, 0x11, 0x08, 0x01, 0xe2, 0x02, 0x5f, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, +0x01, 0xff, 0xc4, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, +0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, +0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, +0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, +0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, +0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, +0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, +0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, +0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, +0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, +0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, +0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 0x01, 0x00, 0x03, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x11, 0x00, +0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, +0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, +0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, +0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, +0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, +0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, +0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, +0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, +0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, +0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, +0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, +0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xfd, +0xfc, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x85, 0xab, 0xe4, 0xff, 0x00, +0xda, 0x7b, 0xfe, 0x0b, 0x1f, 0xf0, 0x53, 0xf6, 0x67, 0xba, 0xba, 0xd3, 0x86, 0xb8, 0xfe, 0x34, +0xf1, 0x0d, 0xb6, 0x55, 0xb4, 0xdf, 0x0f, 0x6d, 0xba, 0x58, 0x98, 0x71, 0x89, 0x6e, 0x32, 0x20, +0x42, 0x0f, 0x05, 0x43, 0xb3, 0xa9, 0xea, 0xbc, 0x57, 0x56, 0x0f, 0x05, 0x88, 0xc5, 0x54, 0xf6, +0x58, 0x68, 0x39, 0xcb, 0xb2, 0x5f, 0x9f, 0x63, 0x93, 0x1b, 0x8f, 0xc3, 0x60, 0xe9, 0xfb, 0x6c, +0x54, 0xd4, 0x23, 0xdd, 0xbb, 0x7d, 0xdd, 0xfd, 0x11, 0xf5, 0x8e, 0x6b, 0x9d, 0xf8, 0x81, 0xf1, +0x37, 0xc3, 0x7f, 0x0b, 0x74, 0x9f, 0xb7, 0x78, 0x9b, 0x5e, 0xd1, 0xfc, 0x3f, 0x67, 0x82, 0x44, +0xda, 0x8d, 0xec, 0x76, 0xa8, 0xd8, 0xec, 0x0b, 0x11, 0x93, 0xec, 0x39, 0xaf, 0xc6, 0xff, 0x00, +0xda, 0x1f, 0xfe, 0x0b, 0xd9, 0xf1, 0x6b, 0xe2, 0xb9, 0xb8, 0xb5, 0xf0, 0x8d, 0x9e, 0x91, 0xf0, +0xf7, 0x4a, 0x6c, 0xa8, 0x36, 0xce, 0x6f, 0x6f, 0xd8, 0x7a, 0x19, 0x98, 0x28, 0x07, 0xdd, 0x15, +0x0f, 0xd7, 0x38, 0xaf, 0x91, 0x7c, 0x5f, 0xf1, 0xb7, 0xc5, 0x9e, 0x3f, 0xd6, 0x6e, 0x35, 0x3d, +0x6b, 0x5e, 0xbe, 0xd5, 0xb5, 0x0b, 0xbf, 0xbd, 0x71, 0x7a, 0x7c, 0xf9, 0xcf, 0xfd, 0xb5, 0x93, +0x2f, 0xff, 0x00, 0x8f, 0x57, 0xde, 0xe5, 0xbe, 0x1c, 0x62, 0x6a, 0xda, 0x58, 0xda, 0x8a, 0x9a, +0xec, 0xbd, 0xe7, 0xf7, 0xe8, 0x97, 0xde, 0xcf, 0xcd, 0x33, 0x7f, 0x14, 0x68, 0xd2, 0xbc, 0x32, +0xda, 0x2e, 0xa3, 0xef, 0x27, 0xc9, 0x1f, 0x92, 0xb3, 0x93, 0xf4, 0x69, 0x1f, 0xb6, 0xdf, 0x15, +0x3f, 0xe0, 0xb3, 0x1f, 0x06, 0x7c, 0x00, 0x66, 0x87, 0x49, 0xbc, 0xd6, 0xbc, 0x63, 0x74, 0xa0, +0x80, 0x34, 0xbb, 0x23, 0x1c, 0x3b, 0xb9, 0xeb, 0x2c, 0xe6, 0x30, 0x47, 0x1d, 0x50, 0x3f, 0x5e, +0xfc, 0xd7, 0xcf, 0xbf, 0x10, 0xff, 0x00, 0xe0, 0xbd, 0x3e, 0x22, 0xbd, 0x66, 0x8f, 0xc2, 0x9e, +0x00, 0xd1, 0x74, 0xe0, 0x3e, 0xeb, 0xea, 0xf7, 0x92, 0xdf, 0x33, 0x7b, 0x98, 0xe2, 0xf2, 0x71, +0xc7, 0x6d, 0xc7, 0xea, 0x6b, 0xf2, 0xd7, 0xfe, 0x13, 0x4d, 0x60, 0x7f, 0xcb, 0xfd, 0xcf, 0xfd, +0xf2, 0x9f, 0xe1, 0x52, 0x43, 0xe3, 0x9d, 0x62, 0x35, 0xc2, 0xdf, 0x33, 0x7b, 0xbd, 0xb4, 0x6e, +0x7f, 0x36, 0x43, 0x5f, 0x73, 0x82, 0xe0, 0x4c, 0x8f, 0x0f, 0xac, 0xe9, 0xca, 0xa3, 0xfe, 0xf3, +0xfd, 0x15, 0x97, 0xde, 0x7e, 0x61, 0x9a, 0x71, 0xe7, 0x17, 0xe2, 0xdb, 0x54, 0x6b, 0x53, 0xa2, +0xbb, 0x46, 0x3f, 0xac, 0x94, 0x9f, 0xdc, 0xd1, 0xf7, 0x17, 0x8c, 0x3f, 0xe0, 0xae, 0xff, 0x00, +0x1e, 0x3c, 0x52, 0xec, 0xb1, 0x78, 0xa2, 0xc7, 0x41, 0x85, 0x86, 0x19, 0x74, 0xdd, 0x2e, 0xdb, +0x18, 0xf6, 0x79, 0x11, 0xd8, 0x7d, 0x43, 0x03, 0x5e, 0x75, 0xaf, 0x7e, 0xdc, 0x5f, 0x19, 0x7c, +0x4b, 0x36, 0xf9, 0xbe, 0x29, 0xf8, 0xed, 0x71, 0xff, 0x00, 0x3e, 0x9a, 0xa4, 0xb6, 0xc3, 0xf2, +0x89, 0x94, 0x57, 0xcd, 0x96, 0x9f, 0x13, 0x75, 0x3b, 0x76, 0x1e, 0x6a, 0xd8, 0xcc, 0xb8, 0xc1, +0xf3, 0x21, 0xd8, 0xd8, 0xf6, 0x28, 0x40, 0x07, 0xf0, 0xfc, 0x2b, 0x5b, 0x4e, 0xf8, 0xa1, 0x67, +0x2b, 0x2f, 0xda, 0xa0, 0xb9, 0xb6, 0x73, 0xc1, 0x91, 0x1b, 0xcf, 0x8c, 0x7a, 0x93, 0x80, 0x18, +0x7d, 0x00, 0x35, 0xf4, 0xd8, 0x5c, 0xa7, 0x29, 0xa5, 0xa5, 0x2a, 0x10, 0x8f, 0xfd, 0xba, 0xbf, +0x3b, 0x33, 0xf3, 0xdc, 0xcf, 0x1b, 0xc5, 0x55, 0x2f, 0x2a, 0xd8, 0xaa, 0x93, 0x5d, 0x6d, 0x52, +0x5f, 0x92, 0x6b, 0xf2, 0x3d, 0x52, 0xf7, 0xe3, 0x97, 0x8e, 0x35, 0x19, 0x7c, 0xcb, 0x9f, 0x19, +0xf8, 0xba, 0xeb, 0xdd, 0xf5, 0x69, 0x9b, 0x1f, 0x9b, 0xd5, 0x76, 0xf8, 0xbf, 0xe2, 0xd3, 0xff, +0x00, 0x33, 0x57, 0x88, 0x7f, 0xf0, 0x69, 0x37, 0xff, 0x00, 0x17, 0x5c, 0xbd, 0x95, 0xfd, 0xbe, +0xa5, 0x00, 0x9a, 0xd6, 0x68, 0x25, 0x87, 0x20, 0x16, 0x89, 0xf7, 0x6d, 0x27, 0xb3, 0x0e, 0xaa, +0x7d, 0x88, 0x06, 0xa6, 0xcd, 0x7a, 0xd1, 0xc1, 0xe1, 0x9a, 0xba, 0x84, 0x7e, 0xe4, 0x7c, 0x85, +0x4c, 0xcf, 0x1f, 0x19, 0x38, 0xce, 0xac, 0xef, 0xe7, 0x29, 0x7e, 0xae, 0xe7, 0x59, 0xa6, 0x7e, +0xd0, 0x1e, 0x3e, 0xd1, 0x6e, 0x7c, 0xcb, 0x3f, 0x1b, 0x78, 0xc6, 0xd2, 0xe1, 0x4f, 0x5b, 0x6d, +0x5e, 0xe5, 0x48, 0xfc, 0x9e, 0xba, 0xdf, 0x0e, 0x7e, 0xde, 0x5f, 0x1a, 0x3c, 0x32, 0x3f, 0xd1, +0xfe, 0x29, 0x78, 0xbe, 0x4e, 0x73, 0xfe, 0x99, 0xa9, 0xc9, 0x75, 0xff, 0x00, 0xa3, 0x77, 0xd7, +0x93, 0x51, 0x59, 0xd4, 0xca, 0xb0, 0x75, 0x15, 0xaa, 0x52, 0x8b, 0xf5, 0x8a, 0x7f, 0xa1, 0xad, +0x0e, 0x20, 0xcd, 0x28, 0xbe, 0x6a, 0x38, 0x9a, 0x91, 0xf4, 0x9c, 0x97, 0xe4, 0xcf, 0xa9, 0x3c, +0x1b, 0xff, 0x00, 0x05, 0x8d, 0xf8, 0xe9, 0xe1, 0x5d, 0xa2, 0xf3, 0x5a, 0xd2, 0x7c, 0x40, 0xaa, +0x46, 0x17, 0x53, 0xd2, 0x21, 0x5c, 0x8f, 0x43, 0xf6, 0x71, 0x13, 0x7e, 0x3d, 0x7d, 0xeb, 0xd9, +0x7e, 0x1d, 0xff, 0x00, 0xc1, 0x7a, 0xb5, 0x08, 0xbc, 0xa8, 0xfc, 0x5d, 0xf0, 0xf6, 0xce, 0x70, +0xd8, 0xdd, 0x73, 0xa4, 0x6a, 0x4d, 0x0e, 0x38, 0xe7, 0xf7, 0x52, 0xab, 0xe7, 0x3f, 0xf5, 0xd0, +0x63, 0xde, 0xbf, 0x3d, 0xa8, 0xaf, 0x17, 0x17, 0xc1, 0x39, 0x2e, 0x21, 0x7b, 0xf8, 0x78, 0xaf, +0xf0, 0xde, 0x3f, 0x93, 0x48, 0xfa, 0x7c, 0xbf, 0xc5, 0x0e, 0x27, 0xc1, 0xb5, 0xc9, 0x8b, 0x94, +0x97, 0x69, 0xda, 0x77, 0xff, 0x00, 0xc0, 0x93, 0x7f, 0x73, 0x4f, 0xcc, 0xfd, 0x92, 0xf8, 0x59, +0xff, 0x00, 0x05, 0x77, 0xf8, 0x25, 0xf1, 0x31, 0xe3, 0x8a, 0xe3, 0x5e, 0xbf, 0xf0, 0x9d, 0xdc, +0xa7, 0x02, 0x0d, 0x76, 0xcc, 0xc2, 0x3f, 0x19, 0x63, 0x32, 0x44, 0x3e, 0xac, 0xe3, 0xad, 0x7d, +0x15, 0xe1, 0x5f, 0x18, 0xe9, 0x5e, 0x38, 0xd1, 0xd7, 0x51, 0xd0, 0xf5, 0x5d, 0x3b, 0x5a, 0xd3, +0xe4, 0xfb, 0x97, 0x56, 0x37, 0x31, 0xdc, 0x40, 0xdd, 0xf8, 0x74, 0x24, 0x1e, 0x08, 0xfc, 0xeb, +0xf9, 0xe3, 0x23, 0x35, 0xb7, 0xe0, 0x3f, 0x89, 0x5e, 0x24, 0xf8, 0x53, 0xae, 0xff, 0x00, 0x69, +0x78, 0x63, 0x5c, 0xd4, 0xfc, 0x3f, 0xa8, 0x77, 0xb9, 0xd3, 0x2e, 0xe4, 0xb7, 0x2d, 0xec, 0x76, +0x75, 0x1d, 0x78, 0x3c, 0x72, 0x6b, 0xe3, 0x73, 0x2f, 0x0a, 0x70, 0xd3, 0x5c, 0xd8, 0x2a, 0xce, +0x2f, 0xb4, 0xac, 0xd7, 0xde, 0xac, 0xd7, 0xe2, 0x7e, 0x93, 0x93, 0x7d, 0x20, 0x31, 0x94, 0xda, +0x8e, 0x69, 0x87, 0x8c, 0xd7, 0x78, 0x37, 0x17, 0xf7, 0x3b, 0xa7, 0xf7, 0xc5, 0x1f, 0xd0, 0xce, +0x68, 0xaf, 0xc9, 0xcf, 0x80, 0xdf, 0xf0, 0x5b, 0x3f, 0x88, 0x5f, 0x0f, 0xfe, 0xcf, 0x67, 0xe3, +0x6d, 0x3f, 0x4f, 0xf1, 0xc6, 0x9a, 0x3e, 0x53, 0x74, 0x80, 0x58, 0x6a, 0x0a, 0x3a, 0x7d, 0xf4, +0x06, 0x37, 0xc6, 0x3a, 0x32, 0x06, 0x63, 0xd5, 0xb9, 0xcd, 0x7d, 0xdd, 0xfb, 0x38, 0x7f, 0xc1, +0x43, 0xbe, 0x17, 0x7e, 0xd3, 0xef, 0x0d, 0xae, 0x85, 0xaf, 0x0d, 0x3f, 0x5d, 0xb8, 0x1c, 0x68, +0xfa, 0xaa, 0x8b, 0x5b, 0xc2, 0x7a, 0x61, 0x32, 0x4a, 0x4b, 0xff, 0x00, 0x6c, 0xd9, 0xbd, 0xeb, +0xf3, 0x8c, 0xe3, 0x84, 0x73, 0x4c, 0xb6, 0xf3, 0xaf, 0x4e, 0xf0, 0xfe, 0x68, 0xea, 0xbe, 0x7d, +0x57, 0xcd, 0x23, 0xf6, 0x9e, 0x1b, 0xf1, 0x13, 0x21, 0xce, 0x9a, 0xa7, 0x85, 0xac, 0xa3, 0x51, +0xfd, 0x89, 0xfb, 0xb2, 0xf9, 0x5f, 0x49, 0x7f, 0xdb, 0xad, 0x9e, 0xeb, 0x45, 0x14, 0x66, 0xbe, +0x68, 0xfb, 0x80, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x66, 0xb0, 0x7e, +0x20, 0x78, 0xff, 0x00, 0x45, 0xf8, 0x55, 0xe1, 0x0b, 0xef, 0x10, 0xf8, 0x8b, 0x54, 0xb1, 0xd1, +0x74, 0x3d, 0x2e, 0x2f, 0x3a, 0xf2, 0xf6, 0xf2, 0x51, 0x14, 0x30, 0x2e, 0x40, 0x19, 0x63, 0xea, +0x48, 0x00, 0x75, 0x24, 0x80, 0x01, 0x24, 0x02, 0x6a, 0xda, 0x8c, 0x55, 0xdb, 0x06, 0xd2, 0x57, +0x7b, 0x1b, 0xd9, 0xaf, 0x99, 0x3f, 0x6d, 0x8f, 0xf8, 0x2a, 0x87, 0xc3, 0x3f, 0xd8, 0xae, 0x0b, +0x8d, 0x3b, 0x50, 0xbc, 0x6f, 0x13, 0x78, 0xd4, 0x46, 0x0c, 0x7e, 0x1d, 0xd2, 0xe4, 0x56, 0x9a, +0x22, 0x46, 0x41, 0xb9, 0x93, 0x94, 0xb7, 0x5e, 0x41, 0xf9, 0xb2, 0xe4, 0x1c, 0xac, 0x6e, 0x2b, +0xe1, 0x3f, 0xdb, 0xef, 0xfe, 0x0b, 0xa7, 0xaf, 0x7c, 0x52, 0x92, 0xf3, 0xc2, 0x9f, 0x06, 0x64, +0xd4, 0x3c, 0x2d, 0xe1, 0xd3, 0xba, 0x39, 0x7c, 0x46, 0x54, 0xc5, 0xab, 0x6a, 0x4b, 0xd3, 0xfd, +0x1c, 0x75, 0xb5, 0x8c, 0xf3, 0x86, 0x3f, 0xbe, 0x3f, 0x29, 0xfd, 0xd1, 0x0c, 0xa7, 0xf3, 0xd2, +0x79, 0x64, 0xbc, 0xba, 0x69, 0xa6, 0x66, 0x91, 0xe4, 0x62, 0xee, 0xec, 0x4b, 0x33, 0xb1, 0x24, +0x92, 0x4f, 0x52, 0x49, 0xe4, 0x93, 0xde, 0xbf, 0x49, 0xc8, 0x3c, 0x3f, 0xa9, 0x59, 0x2a, 0xf9, +0x97, 0xbb, 0x1d, 0xf9, 0x56, 0xef, 0xd5, 0xf4, 0xf4, 0xdf, 0xd0, 0xfc, 0xbf, 0x88, 0xbc, 0x46, +0xa5, 0x41, 0xba, 0x19, 0x67, 0xbf, 0x2d, 0xb9, 0x9f, 0xc2, 0xbd, 0x3b, 0xfa, 0xed, 0xea, 0x7d, +0x17, 0xfb, 0x60, 0x7f, 0xc1, 0x52, 0xfe, 0x2c, 0x7e, 0xd8, 0xe6, 0xef, 0x4f, 0xd4, 0xb5, 0x66, +0xf0, 0xef, 0x83, 0xe6, 0xca, 0x7f, 0xc2, 0x3f, 0xa2, 0x48, 0xd6, 0xf6, 0xd2, 0x21, 0xed, 0x70, +0xf9, 0xf3, 0x6e, 0x38, 0xc6, 0x44, 0x87, 0xcb, 0x24, 0x64, 0x46, 0x95, 0xf3, 0x8a, 0xa8, 0x55, +0xc0, 0x1c, 0x52, 0xd1, 0x5f, 0xac, 0x60, 0xf0, 0x38, 0x7c, 0x25, 0x3f, 0x65, 0x86, 0x82, 0x8c, +0x7c, 0xbf, 0x5e, 0xef, 0xcc, 0xfc, 0x7f, 0x1d, 0x98, 0x62, 0x71, 0x95, 0x3d, 0xb6, 0x2a, 0x6e, +0x52, 0xf3, 0xfd, 0x3b, 0x2f, 0x20, 0xa3, 0x34, 0x51, 0x5d, 0x67, 0x18, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0xfb, 0x5b, 0xb9, 0x2c, 0x2e, 0x16, 0x6b, 0x79, 0x26, 0x8e, 0xe1, 0x06, +0x04, 0xb1, 0x39, 0x56, 0xfa, 0x71, 0xdb, 0xd8, 0xf1, 0x5d, 0x7f, 0x87, 0xfe, 0x27, 0x2b, 0xba, +0x47, 0xaa, 0x2a, 0x46, 0xcd, 0xc0, 0x9e, 0x24, 0xc2, 0xff, 0x00, 0xdb, 0x44, 0x1d, 0x3e, 0xaa, +0x31, 0xfe, 0xc8, 0x1c, 0xd7, 0x1b, 0x41, 0xaa, 0xa7, 0x37, 0x07, 0x78, 0x9c, 0x18, 0xec, 0xb6, +0x86, 0x2e, 0x3c, 0xb5, 0x96, 0xbd, 0x1f, 0x55, 0xf3, 0xff, 0x00, 0x33, 0xd7, 0xd4, 0xf9, 0x8c, +0xbf, 0x32, 0xc9, 0x1b, 0x80, 0xca, 0xca, 0xc1, 0x95, 0x81, 0xee, 0x08, 0xe0, 0x8f, 0x7a, 0x5a, +0xf3, 0x6f, 0x09, 0xf8, 0xc2, 0x6f, 0x0b, 0xc8, 0xb1, 0xb7, 0x99, 0x2d, 0xac, 0x84, 0x97, 0x83, +0x39, 0x68, 0xb3, 0xd5, 0xa3, 0xcf, 0x4e, 0xb9, 0x2b, 0xd1, 0xbd, 0xba, 0xd7, 0xa2, 0xd9, 0x5f, +0x47, 0xa9, 0x5b, 0x89, 0xa1, 0x29, 0x3c, 0x77, 0x0b, 0xba, 0x39, 0x17, 0xf8, 0x87, 0x4f, 0xc0, +0x8c, 0x74, 0xea, 0x0e, 0x45, 0x7a, 0x54, 0x6b, 0x29, 0xaf, 0x33, 0xf3, 0x7c, 0xd3, 0x28, 0xab, +0x82, 0x9d, 0xa5, 0xac, 0x5e, 0xcf, 0xf4, 0x7d, 0x9f, 0x91, 0x25, 0x14, 0x51, 0x5d, 0x07, 0x94, +0x14, 0x51, 0x45, 0x00, 0x14, 0x84, 0x64, 0xfa, 0x7d, 0x0e, 0x29, 0x68, 0xa0, 0x0f, 0xa9, 0x3f, +0x65, 0x9f, 0xf8, 0x2b, 0x1f, 0xc4, 0x8f, 0xd9, 0xed, 0xad, 0xf4, 0xdd, 0x6a, 0xe1, 0xbc, 0x75, +0xe1, 0x75, 0xc2, 0xfd, 0x97, 0x53, 0xba, 0xff, 0x00, 0x4a, 0xb5, 0x51, 0xda, 0x2b, 0x92, 0x0b, +0x71, 0xfd, 0xd9, 0x37, 0xae, 0x3e, 0xe8, 0x5a, 0xfd, 0x30, 0xfd, 0x98, 0xbf, 0x6d, 0x8f, 0x87, +0xff, 0x00, 0xb5, 0xb6, 0x90, 0x65, 0xf0, 0xae, 0xac, 0x06, 0xa9, 0x6e, 0x9b, 0xee, 0xf4, 0x8b, +0xcc, 0x43, 0x7f, 0x6b, 0xee, 0x63, 0xcf, 0xce, 0x9c, 0xfd, 0xf4, 0x2c, 0xbd, 0x89, 0x07, 0x81, +0xf8, 0x57, 0x57, 0xbc, 0x3f, 0xe2, 0x3d, 0x43, 0xc2, 0x7a, 0xe5, 0xb6, 0xa9, 0xa5, 0xdf, 0x5f, +0x69, 0xba, 0x85, 0x9b, 0x07, 0xb6, 0xba, 0xb5, 0xb9, 0x36, 0xf3, 0xdb, 0x11, 0xd0, 0xc7, 0x20, +0x20, 0x8f, 0xa8, 0xe6, 0xbf, 0x3f, 0xe2, 0x2f, 0x0f, 0xf0, 0x19, 0x82, 0x75, 0x70, 0xeb, 0xd9, +0x54, 0xee, 0x96, 0x8f, 0xd5, 0x7e, 0xaa, 0xcf, 0xbd, 0xcf, 0xd7, 0x78, 0x3b, 0xc5, 0xfc, 0xdb, +0x28, 0x6a, 0x86, 0x31, 0xba, 0xf4, 0x7b, 0x49, 0xfb, 0xd1, 0x5f, 0xdd, 0x96, 0xff, 0x00, 0x29, +0x5f, 0xb2, 0xb2, 0xd4, 0xfe, 0x89, 0xb3, 0x45, 0x7e, 0x76, 0xfe, 0xc2, 0x7f, 0xf0, 0x58, 0x95, +0xd6, 0xee, 0x2c, 0xbc, 0x23, 0xf1, 0x7a, 0x48, 0x2d, 0x2e, 0xa4, 0x3e, 0x45, 0xa7, 0x89, 0xc0, +0x09, 0x1c, 0xad, 0xc0, 0x02, 0xed, 0x40, 0xc2, 0x7f, 0xd7, 0x65, 0xc2, 0x74, 0xdc, 0x06, 0x19, +0xcf, 0xe8, 0x64, 0x13, 0x0b, 0x84, 0x0e, 0xb8, 0x65, 0x61, 0x95, 0x61, 0xdf, 0xdc, 0x1a, 0xfc, +0x33, 0x38, 0xc9, 0x71, 0x79, 0x5d, 0x7f, 0x61, 0x8b, 0x8d, 0xbb, 0x3d, 0xd3, 0x5d, 0xd3, 0xfe, +0x9a, 0xea, 0x7f, 0x55, 0xf0, 0xdf, 0x13, 0xe5, 0xd9, 0xee, 0x17, 0xeb, 0x79, 0x7c, 0xf9, 0x97, +0x54, 0xf4, 0x94, 0x5f, 0x69, 0x2e, 0x8f, 0xf0, 0x7d, 0x1b, 0x26, 0xa2, 0x8a, 0x2b, 0xca, 0x3e, +0x80, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, +0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xcd, 0x15, +0xe2, 0x3f, 0xb6, 0xf7, 0xed, 0xbb, 0xe1, 0x1f, 0xd8, 0x6f, 0xe1, 0x23, 0xf8, 0x93, 0xc4, 0x8d, +0xf6, 0xcd, 0x52, 0xf3, 0x74, 0x1a, 0x26, 0x89, 0x04, 0x81, 0x6e, 0xb5, 0x8b, 0x80, 0x3e, 0xea, +0xf5, 0xd9, 0x1a, 0xe5, 0x4c, 0x92, 0x90, 0x42, 0x06, 0x1c, 0x33, 0x32, 0x23, 0x6b, 0x42, 0x85, +0x5a, 0xf5, 0x63, 0x46, 0x8c, 0x5c, 0xa5, 0x27, 0x64, 0x91, 0x8e, 0x23, 0x11, 0x4a, 0x85, 0x29, +0x56, 0xad, 0x25, 0x18, 0xc5, 0x5d, 0xb7, 0xd0, 0xda, 0xfd, 0xab, 0x7f, 0x6b, 0x8f, 0x04, 0xfe, +0xc6, 0x7f, 0x0c, 0x26, 0xf1, 0x47, 0x8d, 0x75, 0x2f, 0xb3, 0x42, 0x77, 0x25, 0x8d, 0x8c, 0x58, +0x7b, 0xcd, 0x56, 0x60, 0x32, 0x21, 0x82, 0x3c, 0x8d, 0xcc, 0x72, 0x32, 0x49, 0x0a, 0x80, 0xe5, +0x99, 0x47, 0x35, 0xf8, 0x6b, 0xfb, 0x72, 0xff, 0x00, 0xc1, 0x42, 0x3c, 0x71, 0xfb, 0x77, 0xf8, +0xd7, 0xed, 0x1a, 0xed, 0xc3, 0x69, 0x7e, 0x16, 0xd3, 0xe5, 0x32, 0x69, 0x7e, 0x1c, 0xb4, 0x90, +0xb5, 0xa5, 0x86, 0x46, 0x03, 0xb9, 0xc0, 0x33, 0xcf, 0x8c, 0xe6, 0x56, 0x1c, 0x65, 0xb6, 0x04, +0x56, 0x20, 0xf1, 0x7f, 0xb4, 0xe7, 0xed, 0x45, 0xe3, 0x1f, 0xda, 0xfb, 0xe2, 0xc5, 0xdf, 0x8c, +0xbc, 0x67, 0x7a, 0xb7, 0x97, 0xd7, 0x23, 0xcb, 0xb3, 0xb3, 0x88, 0x15, 0xb3, 0xd3, 0x2d, 0xc1, +0xc8, 0xb7, 0x81, 0x32, 0x76, 0xc6, 0x39, 0x3c, 0x92, 0x58, 0x92, 0xcc, 0x4b, 0x12, 0x4f, 0x9e, +0x8e, 0x2b, 0xf7, 0x0e, 0x17, 0xe0, 0xfa, 0x39, 0x74, 0x55, 0x7c, 0x45, 0xa5, 0x5b, 0xbf, 0x48, +0xf9, 0x2f, 0x3f, 0x3f, 0xbb, 0x4d, 0xff, 0x00, 0x05, 0xe2, 0xce, 0x34, 0xad, 0x99, 0x49, 0xe1, +0xf0, 0xd7, 0x8d, 0x1f, 0xb9, 0xcb, 0xcd, 0xf9, 0x7f, 0x77, 0xef, 0xd7, 0x62, 0x8a, 0x28, 0xaf, +0xb7, 0x3e, 0x0c, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, +0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x2b, 0x63, 0xc1, 0x5e, 0x2c, 0xff, 0x00, 0x84, 0x72, +0xeb, 0xc9, 0x9a, 0x46, 0x6b, 0x39, 0x5b, 0xf7, 0xa3, 0xaf, 0x90, 0xdf, 0xf3, 0xd5, 0x7f, 0x21, +0xb8, 0x0e, 0xa0, 0x0e, 0xea, 0x05, 0x63, 0xd1, 0xd2, 0x9c, 0x64, 0xd3, 0xba, 0x39, 0xf1, 0x58, +0x5a, 0x78, 0x8a, 0x4e, 0x95, 0x55, 0x74, 0xff, 0x00, 0xad, 0x3c, 0xcf, 0x5e, 0x47, 0x0e, 0x37, +0x29, 0x0c, 0xad, 0xc8, 0x60, 0x72, 0x18, 0x7a, 0x8a, 0x75, 0x72, 0xdf, 0x0d, 0x7c, 0x4a, 0xd7, +0x96, 0xd2, 0x69, 0xf2, 0x49, 0xb9, 0xad, 0xe3, 0xdf, 0x6c, 0x58, 0xfd, 0xe8, 0x7b, 0xa6, 0x7f, +0xd9, 0x24, 0x63, 0xd9, 0xb1, 0xd1, 0x6b, 0xa9, 0xaf, 0x5e, 0x95, 0x45, 0x38, 0xf3, 0x23, 0xf2, +0x7c, 0x76, 0x0e, 0x78, 0x5a, 0xf2, 0xa1, 0x3e, 0x9f, 0x8a, 0xe8, 0xc2, 0x8a, 0x28, 0xad, 0x0e, +0x30, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, 0x51, 0x40, 0x06, 0x33, 0x5f, 0x73, 0x7f, 0xc1, 0x2f, +0xbf, 0xe0, 0xa5, 0x37, 0x1f, 0x0b, 0x75, 0x3d, 0x3f, 0xe1, 0xcf, 0xc4, 0x0d, 0x41, 0xee, 0x3c, +0x2f, 0x70, 0x45, 0xbe, 0x91, 0xaa, 0x4e, 0x79, 0xd1, 0x5b, 0xb4, 0x32, 0xb1, 0xff, 0x00, 0x97, +0x73, 0xd0, 0x1f, 0xf9, 0x65, 0xc7, 0xf0, 0x67, 0x67, 0xc3, 0x34, 0x11, 0x91, 0x5e, 0x3e, 0x77, +0x92, 0xe1, 0xb3, 0x4c, 0x33, 0xc3, 0x62, 0x56, 0x9d, 0x1f, 0x54, 0xfa, 0x35, 0xfd, 0x6b, 0xb3, +0x3e, 0x8b, 0x85, 0xf8, 0x9f, 0x1b, 0x90, 0xe3, 0xa3, 0x8e, 0xc1, 0x4b, 0x55, 0xf1, 0x47, 0xa4, +0xa3, 0xd6, 0x2d, 0x7e, 0x4f, 0x74, 0xf5, 0x47, 0xf4, 0x69, 0x9a, 0x2b, 0xe1, 0xef, 0xf8, 0x23, +0xc7, 0xed, 0xad, 0x27, 0xc6, 0x4f, 0x00, 0x3f, 0xc3, 0xaf, 0x12, 0x5e, 0x7d, 0xa3, 0xc4, 0x9e, +0x17, 0xb6, 0x57, 0xd3, 0xae, 0x5d, 0xbe, 0x6b, 0xeb, 0x11, 0x80, 0x23, 0x27, 0xbc, 0x90, 0xfc, +0xaa, 0x4f, 0x52, 0x85, 0x3a, 0x95, 0x63, 0x5f, 0x70, 0xe6, 0xbf, 0x98, 0x33, 0x6c, 0xae, 0xb6, +0x5d, 0x8b, 0x9e, 0x0e, 0xbf, 0xc5, 0x17, 0xf2, 0x6b, 0xa3, 0x5e, 0x4d, 0x1f, 0xdd, 0x9c, 0x3f, +0x9e, 0xe1, 0xb3, 0x8c, 0xbe, 0x9e, 0x63, 0x84, 0x7e, 0xec, 0xd6, 0xdd, 0x53, 0xea, 0x9f, 0x9a, +0x7a, 0x05, 0x14, 0x51, 0x5e, 0x71, 0xed, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x56, 0x0f, 0xc4, +0x0f, 0x1f, 0xe8, 0xff, 0x00, 0x0a, 0xfc, 0x13, 0xa9, 0xf8, 0x93, 0xc4, 0x1a, 0x84, 0x3a, 0x5e, +0x87, 0xa2, 0xda, 0xbd, 0xe5, 0xf5, 0xe4, 0xc7, 0x09, 0x04, 0x48, 0x32, 0xcc, 0x71, 0x92, 0x7a, +0x70, 0x00, 0x24, 0x92, 0x00, 0x04, 0x90, 0x28, 0xd5, 0xb4, 0x92, 0xbb, 0x14, 0xa4, 0x92, 0xbc, +0xb6, 0x38, 0x8f, 0xda, 0xef, 0xf6, 0xae, 0xf0, 0xbf, 0xec, 0x65, 0xf0, 0x4b, 0x52, 0xf1, 0xa7, +0x8a, 0x26, 0xcc, 0x56, 0xff, 0x00, 0xba, 0xb1, 0xb1, 0x47, 0x02, 0xe3, 0x55, 0xba, 0x60, 0x4c, +0x76, 0xf1, 0x03, 0xd5, 0x9b, 0x04, 0x96, 0xc1, 0x08, 0xaa, 0xcc, 0x78, 0x53, 0x5f, 0x80, 0x5f, +0xb5, 0x17, 0xed, 0x37, 0xe2, 0xcf, 0xda, 0xf3, 0xe3, 0x15, 0xef, 0x8d, 0x3c, 0x63, 0x74, 0xb7, +0x57, 0xd7, 0x80, 0x45, 0x67, 0x67, 0x18, 0x22, 0xd7, 0x4d, 0xb6, 0x04, 0x94, 0xb6, 0x80, 0x76, +0x8c, 0x64, 0x9f, 0x56, 0x25, 0x9d, 0x89, 0x62, 0x49, 0xed, 0x3f, 0xe0, 0xa0, 0xff, 0x00, 0xb7, +0x2e, 0xb5, 0xfb, 0x76, 0xfc, 0x72, 0x9f, 0x5e, 0xba, 0xfb, 0x45, 0x87, 0x85, 0xf4, 0xc2, 0xf6, +0x9e, 0x1d, 0xd2, 0xe4, 0x61, 0xfe, 0x81, 0x6c, 0x48, 0xcb, 0xb0, 0x1c, 0x79, 0xf2, 0xe1, 0x5a, +0x42, 0x09, 0xe8, 0xa9, 0x92, 0xb1, 0x83, 0x5e, 0x13, 0x5f, 0xba, 0xf0, 0x7f, 0x0b, 0xc7, 0x2e, +0xa3, 0xf5, 0x8a, 0xeb, 0xf7, 0xd2, 0x5a, 0xff, 0x00, 0x75, 0x3e, 0x8b, 0xcf, 0xbf, 0xdd, 0xb6, +0xff, 0x00, 0x80, 0x71, 0xa7, 0x16, 0x4b, 0x32, 0xad, 0xf5, 0x6c, 0x3b, 0xfd, 0xcc, 0x5f, 0xfe, +0x04, 0xd7, 0x57, 0xe5, 0xfc, 0xbf, 0x7e, 0xfb, 0x14, 0x51, 0x45, 0x7d, 0xb9, 0xf0, 0x61, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x04, 0xda, 0x5e, 0xa2, 0xda, 0x26, +0xa5, 0x6f, 0x75, 0x1f, 0xcd, 0x24, 0x52, 0x79, 0x9b, 0x73, 0x8f, 0x31, 0x7a, 0x32, 0xff, 0x00, +0xc0, 0x94, 0x95, 0xfc, 0x6b, 0xd6, 0x45, 0xc2, 0xcc, 0x9e, 0x64, 0x6d, 0xbe, 0x19, 0xd1, 0x65, +0x8d, 0xbf, 0xbc, 0xac, 0x03, 0x29, 0xfc, 0x41, 0x06, 0xbc, 0x82, 0xbd, 0x0b, 0xe1, 0xd6, 0xa3, +0xfd, 0xa1, 0xe1, 0x78, 0x63, 0x6f, 0xf5, 0x96, 0x72, 0xb5, 0xb1, 0xcf, 0x52, 0xbf, 0x7d, 0x0f, +0xe4, 0xdb, 0x47, 0xfb, 0xbf, 0x89, 0xea, 0xc2, 0x4a, 0xd2, 0xe5, 0x3e, 0x47, 0x8b, 0x70, 0x8a, +0x54, 0x63, 0x88, 0x8e, 0xf1, 0x76, 0xf9, 0x3f, 0xf8, 0x3f, 0x99, 0xbd, 0x45, 0x14, 0x57, 0xa4, +0x7c, 0x08, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xd5, 0x7c, +0x11, 0xf8, 0xc5, 0xa9, 0x7c, 0x03, 0xf8, 0xbb, 0xe1, 0xdf, 0x18, 0xe8, 0xb9, 0xfe, 0xd0, 0xd0, +0x6f, 0x05, 0xd6, 0x01, 0xc0, 0xba, 0x5e, 0x92, 0xc2, 0x4f, 0xf7, 0x24, 0x42, 0xe8, 0xc4, 0x7f, +0x0c, 0x86, 0xbf, 0x7a, 0xbe, 0x1e, 0xf8, 0xff, 0x00, 0x4d, 0xf8, 0xa1, 0xe0, 0x4d, 0x1f, 0xc4, +0x9a, 0x44, 0xbf, 0x68, 0xd2, 0xf5, 0xdb, 0x38, 0xaf, 0x6d, 0x64, 0xc7, 0x25, 0x24, 0x50, 0xc0, +0x1f, 0x42, 0x33, 0x82, 0x3b, 0x10, 0x6b, 0xf9, 0xeb, 0xaf, 0xd5, 0xbf, 0xf8, 0x22, 0x07, 0xc6, +0x96, 0xf1, 0xc7, 0xec, 0xdd, 0xab, 0x78, 0x46, 0xea, 0x4d, 0xd7, 0x3e, 0x07, 0xd4, 0x4a, 0xdb, +0x8f, 0xee, 0xd9, 0xdd, 0x6e, 0x96, 0x3f, 0xfc, 0x8a, 0xb7, 0x18, 0xf6, 0xc0, 0xed, 0x5f, 0x93, +0xf8, 0xa5, 0x93, 0xaa, 0x98, 0x58, 0x66, 0x30, 0x5e, 0xf4, 0x1d, 0x9f, 0xf8, 0x5e, 0xdf, 0x73, +0xfc, 0xcf, 0xe8, 0x0f, 0x01, 0xb8, 0x8e, 0x54, 0x71, 0xf5, 0x72, 0x6a, 0xaf, 0xdd, 0xaa, 0xb9, +0xa3, 0xe5, 0x28, 0xad, 0x6d, 0xeb, 0x1d, 0x5f, 0xf8, 0x4f, 0xb6, 0x68, 0xa2, 0x8a, 0xfc, 0x3c, +0xfe, 0xa8, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, +0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfc, 0x77, 0xff, 0x00, 0x82, 0xe8, 0xfe, 0xdf, 0xad, +0xf1, 0x53, 0xc7, 0xcf, 0xf0, 0x6f, 0xc2, 0xb7, 0xdb, 0xbc, 0x37, 0xe1, 0x5b, 0xb0, 0x7c, 0x47, +0x24, 0x6d, 0xf2, 0xea, 0x5a, 0x92, 0x1e, 0x2d, 0xce, 0x3a, 0xc5, 0x6e, 0x7a, 0x8e, 0x86, 0x6c, +0xf0, 0x0c, 0x2a, 0x4f, 0xdd, 0x5f, 0xf0, 0x55, 0x7f, 0xdb, 0x61, 0x7f, 0x62, 0xdf, 0xd9, 0x92, +0xea, 0xfb, 0x4b, 0xb8, 0x8d, 0x7c, 0x6d, 0xe2, 0x72, 0xfa, 0x5f, 0x87, 0xa3, 0xc8, 0x2d, 0x14, +0x85, 0x47, 0x9b, 0x75, 0x83, 0xd4, 0x42, 0x87, 0x70, 0xc8, 0x20, 0xc8, 0xd1, 0x29, 0x18, 0x6a, +0xfc, 0x09, 0x96, 0x59, 0x2e, 0x6e, 0x1a, 0x59, 0x99, 0xdd, 0x99, 0x8b, 0x33, 0x3b, 0x6e, 0x67, +0x27, 0x92, 0x49, 0x3c, 0x92, 0x7a, 0x92, 0x79, 0xaf, 0xd2, 0xbc, 0x3f, 0xc8, 0x15, 0x6a, 0x9f, +0xda, 0x55, 0xd7, 0xbb, 0x1d, 0x23, 0xe6, 0xfa, 0xbf, 0x96, 0xcb, 0xcf, 0xd0, 0xfc, 0xbb, 0xc4, +0x6e, 0x22, 0x74, 0x29, 0x2c, 0xb3, 0x0e, 0xfd, 0xe9, 0xeb, 0x2b, 0x74, 0x8f, 0x45, 0xf3, 0xeb, +0xe5, 0xe4, 0xc2, 0x8a, 0x28, 0xaf, 0xd8, 0x8f, 0xc5, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0xba, 0xaf, 0x84, 0xd7, 0x3b, 0x2e, +0xef, 0xad, 0xf3, 0xc4, 0xd0, 0x47, 0x71, 0x8c, 0x7f, 0x71, 0xb6, 0xf5, 0xed, 0x9f, 0x30, 0x7d, +0x78, 0xf4, 0xae, 0x56, 0xba, 0x0f, 0x85, 0xe1, 0x93, 0xc4, 0xfb, 0x54, 0xed, 0x59, 0x22, 0x95, +0x5b, 0xdc, 0x65, 0x4f, 0xe8, 0x40, 0x3f, 0x85, 0x69, 0x49, 0xda, 0x68, 0xf2, 0xb3, 0xba, 0x7c, +0xf8, 0x1a, 0x8b, 0xca, 0xff, 0x00, 0x75, 0x8f, 0x40, 0xa2, 0x8a, 0x2b, 0xd8, 0x3f, 0x28, 0x0a, +0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfb, 0x2b, 0xfe, 0x08, +0x87, 0xe3, 0xb9, 0x3c, 0x39, 0xfb, 0x58, 0xea, 0x3a, 0x2c, 0x84, 0xfd, 0x9f, 0xc4, 0x9a, 0x04, +0xf1, 0x05, 0xcf, 0xfc, 0xb7, 0x86, 0x48, 0xe5, 0x53, 0xff, 0x00, 0x7c, 0x09, 0x46, 0x3d, 0xfd, +0xab, 0xe3, 0x5a, 0xf7, 0xff, 0x00, 0xf8, 0x25, 0xbe, 0xad, 0xfd, 0x8b, 0xfb, 0x7b, 0xfc, 0x3b, +0x98, 0x8e, 0x3e, 0xd1, 0x73, 0x6c, 0x47, 0xfd, 0x74, 0xb3, 0xb8, 0x8f, 0xff, 0x00, 0x67, 0xaf, +0x9e, 0xe2, 0xcc, 0x3a, 0xad, 0x93, 0xe2, 0x20, 0xff, 0x00, 0x92, 0x4f, 0xe6, 0x95, 0xd7, 0xe2, +0x8f, 0xb1, 0xf0, 0xfb, 0x19, 0x2c, 0x37, 0x12, 0x60, 0xaa, 0xc7, 0xfe, 0x7e, 0x46, 0x3f, 0x29, +0x3e, 0x57, 0xf8, 0x36, 0x7e, 0xda, 0xd1, 0x45, 0x15, 0xfc, 0xb0, 0x7f, 0x7b, 0x85, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, +0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x35, 0x9f, +0x69, 0x1f, 0xe7, 0x14, 0xea, 0xf9, 0x1f, 0xfe, 0x0b, 0x31, 0xfb, 0x54, 0xc9, 0xfb, 0x33, 0xfe, +0xc6, 0x5a, 0xa5, 0xae, 0x9d, 0x70, 0x21, 0xf1, 0x27, 0x8f, 0x18, 0xf8, 0x7b, 0x4e, 0x2a, 0xdf, +0x3c, 0x31, 0x48, 0xa7, 0xed, 0x33, 0x0e, 0xe3, 0x6c, 0x3b, 0x90, 0x30, 0xfb, 0xb2, 0x4b, 0x19, +0xae, 0xac, 0x16, 0x12, 0xa6, 0x2b, 0x11, 0x0c, 0x35, 0x2f, 0x8a, 0x4d, 0x2f, 0xf8, 0x3f, 0x23, +0x97, 0x1d, 0x8c, 0xa7, 0x84, 0xc3, 0xcf, 0x13, 0x57, 0xe1, 0x82, 0x6d, 0xfc, 0x8f, 0xca, 0xbf, +0xf8, 0x2a, 0x27, 0xed, 0x84, 0xdf, 0xb6, 0x57, 0xed, 0x61, 0xab, 0xea, 0xd6, 0x37, 0x5e, 0x6f, +0x83, 0xbc, 0x3e, 0x4e, 0x8b, 0xe1, 0xe0, 0xad, 0x94, 0x7b, 0x78, 0xd8, 0x96, 0xb9, 0x03, 0xd6, +0x79, 0x73, 0x26, 0x70, 0x0f, 0x97, 0xe5, 0x29, 0xfb, 0x95, 0xf3, 0xbd, 0x00, 0x6d, 0x18, 0xf4, +0xa2, 0xbf, 0xa6, 0x30, 0x38, 0x3a, 0x78, 0x4c, 0x3c, 0x30, 0xd4, 0x97, 0xbb, 0x14, 0x92, 0xff, +0x00, 0x3f, 0x57, 0xd4, 0xfe, 0x59, 0xcc, 0x31, 0xb5, 0x71, 0x98, 0x99, 0xe2, 0xab, 0x3b, 0xca, +0x4e, 0xff, 0x00, 0xf0, 0x3d, 0x17, 0x40, 0xa2, 0x8a, 0x2b, 0xa8, 0xe3, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xe8, 0x3e, 0x18, +0x92, 0xbe, 0x2b, 0x53, 0x8c, 0xe2, 0x39, 0x73, 0xed, 0xf7, 0x6b, 0x9f, 0xae, 0xa3, 0xe1, 0x4d, +0xbb, 0x3e, 0xa9, 0x75, 0x30, 0x56, 0x2b, 0x0c, 0x6b, 0x09, 0xf4, 0xcc, 0x8e, 0x18, 0x7e, 0x3f, +0xba, 0x3f, 0xad, 0x69, 0x49, 0x5e, 0x68, 0xf2, 0xf3, 0xa9, 0xa8, 0xe0, 0xaa, 0xb7, 0xda, 0xdf, +0x7d, 0x8e, 0xe0, 0x70, 0x28, 0xa3, 0xa5, 0x15, 0xec, 0x1f, 0x93, 0x85, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x7b, 0xdf, 0xfc, 0x13, 0x03, 0x4b, 0x7d, 0x5b, +0xf6, 0xf7, 0xf8, 0x75, 0x0a, 0x36, 0x3f, 0xd2, 0xae, 0x2e, 0x0f, 0xd2, 0x3b, 0x49, 0xa4, 0x3f, +0xa4, 0x66, 0xbc, 0x12, 0xbe, 0xbb, 0xff, 0x00, 0x82, 0x28, 0xf8, 0x15, 0xbc, 0x51, 0xfb, 0x64, +0x36, 0xa8, 0xd0, 0xaf, 0xd9, 0xfc, 0x33, 0xa1, 0x5d, 0x5d, 0x06, 0x20, 0xf0, 0xf2, 0x98, 0xed, +0xc0, 0xcf, 0xa9, 0x12, 0x48, 0x7f, 0x06, 0xaf, 0x03, 0x8a, 0xab, 0xaa, 0x39, 0x46, 0x26, 0xa3, +0xfe, 0x49, 0x2f, 0x9b, 0x56, 0x5f, 0x8b, 0x3e, 0xbb, 0x80, 0x70, 0xb2, 0xc4, 0x71, 0x1e, 0x0a, +0x94, 0x7f, 0xe7, 0xe4, 0x1f, 0xca, 0x2f, 0x99, 0xfe, 0x09, 0x9f, 0xaf, 0x34, 0x51, 0x45, 0x7f, +0x2b, 0x1f, 0xdf, 0x41, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x9a, 0xfc, 0x35, 0xff, 0x00, 0x82, 0xe6, 0xfe, 0xd1, 0xbf, 0xf0, 0xbb, +0x3f, 0x6d, 0x4b, 0x9f, 0x0e, 0xd9, 0xdd, 0x79, 0x9a, 0x1f, 0xc3, 0x5b, 0x3f, 0xec, 0x68, 0xc2, +0x9c, 0xa1, 0xbb, 0x7d, 0xb2, 0xde, 0x38, 0xff, 0x00, 0x6b, 0x3e, 0x5c, 0x27, 0xde, 0xdb, 0xf1, +0xaf, 0xd9, 0xcf, 0x8d, 0xff, 0x00, 0x14, 0xac, 0x7e, 0x07, 0x7c, 0x21, 0xf1, 0x47, 0x8c, 0xb5, +0x2f, 0x9a, 0xc7, 0xc2, 0xba, 0x55, 0xce, 0xa9, 0x2a, 0x64, 0x29, 0x90, 0x43, 0x11, 0x7f, 0x2c, +0x1f, 0xef, 0x31, 0x1b, 0x40, 0xee, 0x58, 0x77, 0xc5, 0x7f, 0x34, 0x7e, 0x26, 0xf1, 0x1e, 0xa1, +0xe3, 0x4f, 0x13, 0x6a, 0x5a, 0xd6, 0xad, 0x72, 0x6f, 0x35, 0x7d, 0x6a, 0xf2, 0x7b, 0xfb, 0xe9, +0x4f, 0x59, 0x6e, 0x26, 0x62, 0xee, 0xc7, 0xea, 0xcc, 0x4f, 0xe3, 0x5f, 0xa3, 0x78, 0x73, 0x97, +0xaa, 0xb8, 0x99, 0xe3, 0x25, 0xb4, 0x15, 0x97, 0xab, 0xff, 0x00, 0x24, 0xad, 0xf3, 0x3f, 0x31, +0xf1, 0x3b, 0x34, 0x74, 0xb0, 0x94, 0xf0, 0x50, 0xde, 0xa3, 0xbb, 0xff, 0x00, 0x0c, 0x7f, 0xcd, +0xb4, 0xfe, 0x4c, 0xab, 0x45, 0x14, 0x57, 0xec, 0xc7, 0xe2, 0x21, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0xd6, +0xbb, 0xcf, 0x86, 0x36, 0x1f, 0x67, 0xd0, 0x24, 0x99, 0x97, 0xe6, 0xbc, 0x9c, 0xb8, 0x38, 0xea, +0x89, 0xf2, 0x0f, 0xfc, 0x78, 0x3f, 0xf9, 0xcd, 0x70, 0xd6, 0x96, 0xb2, 0x5f, 0x5c, 0xc7, 0x6f, +0x0a, 0x6e, 0xb8, 0x92, 0x45, 0x8a, 0x31, 0xee, 0xc7, 0x03, 0x3f, 0xd6, 0xbd, 0x62, 0xc6, 0xc5, +0x74, 0xdb, 0x38, 0x6d, 0xe2, 0xe6, 0x18, 0xe2, 0x58, 0x50, 0x90, 0x01, 0x60, 0xa3, 0x19, 0x3e, +0xe7, 0xad, 0x74, 0xe1, 0x63, 0x79, 0xf3, 0x76, 0x3e, 0x4f, 0x8b, 0x31, 0x4a, 0x18, 0x78, 0xd0, +0x5b, 0xc9, 0xdf, 0xe4, 0xbf, 0xe0, 0xe8, 0x4b, 0x45, 0x14, 0x57, 0xa6, 0x7e, 0x7e, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x04, 0xe2, 0xbf, 0x52, 0x3f, 0xe0, +0x86, 0x3f, 0x05, 0xe4, 0xf0, 0xb7, 0xc1, 0x1f, 0x11, 0xf8, 0xe2, 0xea, 0x1f, 0x2e, 0xe3, 0xc5, +0xb7, 0xeb, 0x6b, 0x68, 0x4a, 0xfd, 0xfb, 0x6b, 0x60, 0xc0, 0xba, 0x9f, 0xf6, 0xa5, 0x92, 0x45, +0x3e, 0xf0, 0x8a, 0xfc, 0xd7, 0xf8, 0x59, 0xf0, 0xd7, 0x54, 0xf8, 0xc5, 0xf1, 0x1f, 0x43, 0xf0, +0xa6, 0x89, 0x07, 0xda, 0x75, 0x2d, 0x7a, 0xee, 0x3b, 0x4b, 0x70, 0x7f, 0x87, 0x7f, 0x56, 0x3e, +0x91, 0xa0, 0xcb, 0xb1, 0xec, 0xa2, 0xbf, 0x7a, 0x3e, 0x10, 0xfc, 0x2f, 0xd3, 0x7e, 0x0b, 0x7c, +0x2e, 0xd0, 0x3c, 0x27, 0xa4, 0xff, 0x00, 0xc8, 0x3b, 0xc3, 0xf6, 0x51, 0x59, 0xc4, 0xc5, 0x70, +0xd2, 0xed, 0x18, 0x69, 0x1b, 0x1f, 0xc4, 0xed, 0x97, 0x3e, 0xec, 0x6b, 0xf2, 0xbf, 0x14, 0x33, +0x85, 0x4b, 0x07, 0x1c, 0xbe, 0x0f, 0xde, 0xa8, 0xee, 0xff, 0x00, 0xc2, 0xbf, 0xcd, 0xdb, 0xee, +0x67, 0xef, 0x9e, 0x03, 0xf0, 0xec, 0xab, 0xe6, 0x55, 0x33, 0x8a, 0x8b, 0xdc, 0xa4, 0x9c, 0x63, +0xe7, 0x39, 0x6f, 0x6f, 0x48, 0xdf, 0xff, 0x00, 0x02, 0x47, 0x59, 0x45, 0x14, 0x57, 0xe1, 0x67, +0xf5, 0x60, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x01, 0xf1, 0x0f, 0xfc, 0x17, 0xc3, 0xe3, 0x01, 0xf8, 0x71, 0xfb, 0x0d, 0xb6, 0x83, 0x6f, +0x37, 0x97, 0x75, 0xe3, 0xcd, 0x6a, 0xd7, 0x4c, 0x60, 0xa7, 0x0c, 0x2d, 0xe2, 0x26, 0xea, 0x53, +0xfe, 0xe9, 0x30, 0x47, 0x19, 0xf5, 0xf3, 0x71, 0xd0, 0x9a, 0xfc, 0x49, 0xaf, 0xd1, 0xaf, 0xf8, +0x38, 0xeb, 0xe2, 0x67, 0xf6, 0xa7, 0xc7, 0x0f, 0x87, 0x3e, 0x0e, 0x47, 0x3b, 0x74, 0x3d, 0x0e, +0xe3, 0x56, 0x70, 0x3a, 0x16, 0xbc, 0x9f, 0xc9, 0x19, 0xec, 0x48, 0x16, 0x67, 0xe8, 0x1c, 0xff, +0x00, 0x7a, 0xbf, 0x39, 0x6b, 0xf7, 0xae, 0x03, 0xc1, 0xaa, 0x19, 0x44, 0x25, 0xd6, 0x6d, 0xc9, +0xfe, 0x4b, 0xf0, 0x48, 0xfe, 0x7a, 0xf1, 0x0b, 0x1a, 0xeb, 0xe7, 0x13, 0x87, 0x4a, 0x69, 0x45, +0x7d, 0xd7, 0x7f, 0x8b, 0x61, 0x45, 0x14, 0x57, 0xd9, 0x1f, 0x10, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x4e, 0xb7, 0xb7, +0x92, 0xfe, 0x78, 0xe1, 0x85, 0x77, 0x5c, 0x49, 0x2a, 0xc3, 0x18, 0xf5, 0x66, 0x38, 0x1f, 0xad, +0x02, 0x94, 0x92, 0x57, 0x67, 0x59, 0xf0, 0xbb, 0x42, 0xf3, 0x1d, 0xf5, 0x19, 0x97, 0x84, 0xdd, +0x6f, 0x16, 0x47, 0x72, 0x31, 0x23, 0xfe, 0x00, 0xed, 0x07, 0xdd, 0xbd, 0x2b, 0xb2, 0xa8, 0x6c, +0x34, 0xf8, 0xf4, 0xbd, 0x3e, 0x1b, 0x58, 0x7f, 0xd4, 0xc7, 0x1a, 0xc4, 0x87, 0x18, 0x2d, 0x8e, +0xac, 0x7d, 0xc9, 0xc9, 0x3e, 0xe4, 0xd4, 0xd5, 0xeb, 0x50, 0x87, 0x24, 0x2c, 0x7e, 0x49, 0x9a, +0x63, 0x9e, 0x2b, 0x13, 0x2a, 0xaf, 0x6e, 0x9e, 0x8b, 0x6f, 0xf3, 0xf9, 0x85, 0x14, 0x51, 0x5b, +0x1e, 0x78, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x50, 0x4e, 0x28, 0x27, 0x02, 0xbe, +0xd2, 0xff, 0x00, 0x82, 0x61, 0x7f, 0xc1, 0x38, 0x2e, 0x3e, 0x38, 0xeb, 0x96, 0x1e, 0x3f, 0xf1, +0xbe, 0x9e, 0xd6, 0xfe, 0x09, 0xd3, 0x4f, 0x99, 0x63, 0x65, 0x72, 0xbf, 0x36, 0xbd, 0x28, 0xe8, +0x48, 0xff, 0x00, 0x9f, 0x75, 0xee, 0x4f, 0x0e, 0x46, 0xde, 0x46, 0xec, 0x79, 0x39, 0xd6, 0x73, +0x87, 0xcb, 0x30, 0xd2, 0xc5, 0x62, 0x5e, 0x8b, 0x65, 0xd5, 0xbe, 0x89, 0x79, 0xbf, 0xc3, 0x76, +0x7d, 0x07, 0x0c, 0xf0, 0xde, 0x37, 0x3c, 0xc7, 0x47, 0x03, 0x82, 0x8d, 0xdb, 0xdd, 0xf4, 0x8a, +0xeb, 0x26, 0xfa, 0x25, 0xf8, 0xec, 0xb5, 0x67, 0xb6, 0x7f, 0xc1, 0x1b, 0xbf, 0x62, 0x79, 0x3e, +0x1e, 0xf8, 0x57, 0xfe, 0x16, 0xa7, 0x89, 0x6d, 0x3e, 0xcf, 0xad, 0x6b, 0xd6, 0xc1, 0x34, 0x2b, +0x57, 0x5e, 0x6d, 0x2c, 0x9c, 0x02, 0x6e, 0x08, 0x3d, 0x1e, 0x6f, 0xe1, 0x3d, 0xa3, 0xe9, 0xc3, +0xe0, 0x7d, 0xed, 0x50, 0xc5, 0x10, 0x8d, 0x36, 0xae, 0xd5, 0x55, 0x18, 0x00, 0x74, 0x15, 0x35, +0x7f, 0x2f, 0xe7, 0x19, 0xb5, 0x6c, 0xcb, 0x17, 0x3c, 0x65, 0x7d, 0xe5, 0xb2, 0xec, 0xba, 0x25, +0xe9, 0xff, 0x00, 0x04, 0xfe, 0xec, 0xe1, 0xbe, 0x1f, 0xc3, 0x64, 0xb9, 0x75, 0x3c, 0xbb, 0x0b, +0xf0, 0xc1, 0x6a, 0xfa, 0xc9, 0xbd, 0xe4, 0xfc, 0xdb, 0xfb, 0xb6, 0x5a, 0x24, 0x14, 0x51, 0x45, +0x79, 0xa7, 0xb8, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, +0x51, 0x45, 0x00, 0x7e, 0x07, 0xff, 0x00, 0xc1, 0x68, 0x7c, 0x70, 0xde, 0x37, 0xff, 0x00, 0x82, +0x8e, 0xf8, 0xf5, 0x56, 0x45, 0x92, 0xd7, 0x42, 0x4b, 0x1d, 0x32, 0x23, 0xed, 0x1d, 0xa4, 0x2d, +0x20, 0xfc, 0x25, 0x79, 0x47, 0xe1, 0x5f, 0x2d, 0xd7, 0xaa, 0x7e, 0xdc, 0xfe, 0x24, 0x6f, 0x16, +0xfe, 0xda, 0xdf, 0x17, 0x75, 0x06, 0x94, 0x5c, 0x6e, 0xf1, 0x86, 0xa9, 0x12, 0x91, 0xd0, 0xc3, +0x1d, 0xd4, 0xb1, 0xc7, 0x8f, 0xfb, 0x66, 0xa2, 0xbc, 0xae, 0xbf, 0xa6, 0x32, 0x5a, 0x3e, 0xc7, +0x01, 0x46, 0x92, 0xe9, 0x08, 0xfe, 0x48, 0xfe, 0x58, 0xcf, 0x2b, 0xba, 0xd9, 0x8d, 0x7a, 0xaf, +0xac, 0xe5, 0xf9, 0xb4, 0x14, 0x51, 0x45, 0x7a, 0x87, 0x94, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x15, 0xbf, 0xf0, 0xd7, 0x4d, 0x17, +0x9e, 0x22, 0xf3, 0x5c, 0x7c, 0x96, 0x70, 0x34, 0xbf, 0xf0, 0x36, 0xf9, 0x00, 0xfc, 0x8b, 0x1f, +0xf8, 0x0f, 0xe0, 0x70, 0x2b, 0xb6, 0xf8, 0x4d, 0x07, 0x97, 0xa5, 0xde, 0x4d, 0xd3, 0xed, 0x12, +0x2c, 0x39, 0xcf, 0xf7, 0x10, 0x1f, 0xfd, 0xa8, 0x6b, 0x4a, 0x31, 0xbc, 0xd2, 0x3c, 0x7c, 0xfa, +0xbf, 0xb2, 0xc0, 0xce, 0x4b, 0xae, 0x9f, 0x79, 0xd5, 0x51, 0x46, 0x68, 0xaf, 0x60, 0xfc, 0xac, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa3, 0x35, 0x6f, 0x40, 0xd0, 0x6f, 0xfc, 0x57, 0xac, 0xc1, 0xa7, +0xe9, 0x96, 0x57, 0xda, 0xa6, 0xa1, 0x74, 0x71, 0x6f, 0x6b, 0x6b, 0x6e, 0x6e, 0x26, 0x6f, 0xa2, +0x28, 0x24, 0xfe, 0x15, 0x33, 0x9a, 0x82, 0xe6, 0x93, 0xb2, 0x2e, 0x9d, 0x39, 0x54, 0x92, 0x84, +0x13, 0x6d, 0xec, 0x96, 0xad, 0x95, 0x2a, 0x6d, 0x3b, 0x4c, 0xba, 0xd6, 0xb5, 0x2b, 0x7b, 0x3b, +0x4b, 0x79, 0x2f, 0x2e, 0xaf, 0x18, 0x25, 0xb5, 0xb5, 0xb0, 0x2c, 0xce, 0xc4, 0xe0, 0x00, 0x07, +0x24, 0x9e, 0x80, 0x0e, 0x49, 0xaf, 0xac, 0x3f, 0x67, 0x8f, 0xf8, 0x23, 0xa7, 0xc5, 0x0f, 0x8b, +0xc6, 0x0b, 0xcf, 0x13, 0x2a, 0x78, 0x0b, 0x45, 0x6c, 0x36, 0x75, 0x01, 0xe6, 0x6a, 0x0c, 0x3f, +0xd9, 0xb6, 0x53, 0x91, 0xf4, 0x95, 0x90, 0xfb, 0x11, 0x5f, 0xa1, 0xdf, 0xb2, 0xe7, 0xec, 0x0f, +0xf0, 0xef, 0xf6, 0x4d, 0xb5, 0x59, 0xbc, 0x3d, 0xa6, 0xb5, 0xf6, 0xbc, 0xd1, 0xec, 0x97, 0x5d, +0xd4, 0x48, 0x9e, 0xfd, 0x81, 0x18, 0x21, 0x1b, 0x00, 0x44, 0x84, 0x1c, 0x6d, 0x8c, 0x2e, 0x46, +0x33, 0xb8, 0xf3, 0x5f, 0x05, 0x9f, 0x78, 0x85, 0x97, 0x60, 0x53, 0x85, 0x07, 0xed, 0x6a, 0x76, +0x8b, 0xd1, 0x7a, 0xcb, 0x6f, 0xba, 0xec, 0xfd, 0x67, 0x85, 0x3c, 0x1d, 0xce, 0x73, 0x49, 0x46, +0xae, 0x32, 0x2f, 0x0f, 0x4b, 0xab, 0x92, 0xf7, 0x9a, 0xf2, 0x8e, 0xff, 0x00, 0xf8, 0x15, 0x97, +0x5d, 0x76, 0x3e, 0x4b, 0xfd, 0x83, 0x3f, 0xe0, 0x8f, 0x33, 0xcf, 0x71, 0x63, 0xe2, 0xdf, 0x8b, +0xd6, 0xc2, 0x18, 0x54, 0xad, 0xc5, 0xa7, 0x85, 0xf2, 0x09, 0x98, 0xf5, 0x0d, 0x7a, 0x7a, 0x01, +0xdf, 0xc9, 0x07, 0x9c, 0xe1, 0xf1, 0xf3, 0x46, 0x7f, 0x46, 0xad, 0x6d, 0x22, 0xd3, 0xed, 0x92, +0x18, 0x63, 0x48, 0x61, 0x85, 0x42, 0x47, 0x1a, 0x2e, 0xd5, 0x45, 0x03, 0x00, 0x01, 0xd8, 0x0f, +0x4a, 0xb5, 0x45, 0x7e, 0x1b, 0x9d, 0x67, 0x98, 0xcc, 0xd6, 0xbf, 0xb7, 0xc5, 0xca, 0xfd, 0x92, +0xd9, 0x2e, 0xc9, 0x7e, 0xbb, 0xbe, 0xa7, 0xf5, 0x57, 0x0c, 0xf0, 0xb6, 0x5d, 0x90, 0xe1, 0x7e, +0xab, 0x97, 0xc2, 0xdd, 0xe4, 0xf5, 0x94, 0x9f, 0x76, 0xff, 0x00, 0x24, 0xac, 0x97, 0x44, 0x14, +0x51, 0x46, 0x6b, 0xc8, 0x3e, 0x88, 0x33, 0x45, 0x50, 0xd5, 0x35, 0x5b, 0x5d, 0x06, 0xc1, 0xae, +0xaf, 0xae, 0x6d, 0xac, 0xed, 0xe3, 0x1f, 0x3c, 0xd7, 0x12, 0x2c, 0x48, 0xbf, 0x52, 0xdc, 0x57, +0x3d, 0x0f, 0xc7, 0x7f, 0x03, 0xdc, 0x5c, 0x18, 0x63, 0xf1, 0x97, 0x84, 0xe4, 0x9c, 0x1c, 0x6c, +0x5d, 0x5e, 0xdc, 0xb7, 0xe5, 0xbf, 0x34, 0xe3, 0x09, 0xcb, 0x58, 0xc5, 0xbf, 0x91, 0x33, 0xa9, +0x4e, 0x0e, 0xd3, 0x92, 0x5e, 0xad, 0x1d, 0x85, 0x15, 0x0c, 0x52, 0x2d, 0xc4, 0x2b, 0x22, 0xed, +0x64, 0x75, 0xca, 0x90, 0x78, 0x23, 0xd6, 0xa6, 0xcd, 0x4d, 0xca, 0x0a, 0x28, 0xa2, 0x98, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x1f, 0xcc, 0x6f, 0xc6, 0x6b, 0xc3, 0xa8, 0xfc, 0x64, +0xf1, 0x6d, 0xcb, 0x7d, 0xe9, 0xb5, 0xeb, 0xd7, 0x39, 0x1d, 0x73, 0x70, 0xe7, 0xfa, 0xd7, 0x3b, +0x5a, 0x5e, 0x33, 0x12, 0xc3, 0xe3, 0x1d, 0x62, 0x39, 0xb7, 0x0b, 0xa1, 0xa8, 0x5c, 0x87, 0xdd, +0xf7, 0xb3, 0xbd, 0x81, 0xcf, 0xbe, 0x6b, 0x36, 0xbf, 0xa9, 0xb0, 0xd1, 0xe5, 0xa5, 0x15, 0xe4, +0xbf, 0x23, 0xf9, 0x2f, 0x15, 0x2b, 0xd7, 0x9b, 0xf3, 0x7f, 0x98, 0x51, 0x45, 0x15, 0xb1, 0xce, +0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, +0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x50, 0x5b, 0x15, +0xa9, 0xa6, 0xf8, 0x2b, 0x54, 0xd5, 0x55, 0x59, 0x6d, 0x1e, 0x38, 0x5b, 0xa4, 0xb2, 0x1f, 0x25, +0x7f, 0x23, 0xf3, 0x1f, 0xa8, 0x06, 0x9a, 0x4d, 0xbb, 0x23, 0x1a, 0xd8, 0x8a, 0x54, 0x63, 0xcd, +0x56, 0x4a, 0x2b, 0xcc, 0xcb, 0xcd, 0x7a, 0x17, 0xc3, 0x24, 0x58, 0xfc, 0x29, 0x13, 0x0d, 0xaa, +0x5d, 0xe6, 0x66, 0xf7, 0xe4, 0x0f, 0xe4, 0x2b, 0x3f, 0x4d, 0xf8, 0x51, 0x12, 0x6d, 0x6b, 0xcb, +0xa9, 0xa4, 0xf5, 0x8d, 0x10, 0x20, 0x1f, 0xf0, 0x26, 0xce, 0x7f, 0xef, 0x91, 0x5f, 0xab, 0x1f, +0xf0, 0x46, 0x4f, 0xd9, 0x6b, 0xe1, 0x6f, 0x8d, 0x3f, 0x66, 0x39, 0x75, 0xad, 0x4b, 0xc1, 0x3a, +0x1e, 0xb3, 0xad, 0x58, 0xeb, 0xb7, 0x36, 0x4f, 0x73, 0xaa, 0x41, 0xf6, 0xd6, 0x3b, 0x52, 0x19, +0x17, 0xe5, 0x97, 0x28, 0xa4, 0x09, 0x06, 0x30, 0xa3, 0x9e, 0x7a, 0xd7, 0x9b, 0x9d, 0x67, 0x0b, +0x27, 0xc3, 0x7d, 0x76, 0xb4, 0x1c, 0x95, 0xd2, 0xb2, 0xb6, 0xee, 0xff, 0x00, 0x81, 0x8e, 0x57, +0x96, 0x53, 0xe2, 0xac, 0x57, 0xf6, 0x4e, 0x0e, 0xaa, 0x8c, 0xad, 0xcd, 0x76, 0x9d, 0xac, 0xad, +0xb7, 0x77, 0xaf, 0x91, 0xf9, 0xc5, 0xe1, 0xff, 0x00, 0x0d, 0x6a, 0x3e, 0x28, 0xd4, 0x0d, 0xb6, +0x97, 0x63, 0xa8, 0x6a, 0x97, 0x40, 0x67, 0x6d, 0xa5, 0xa9, 0xb8, 0x6f, 0xc8, 0x0a, 0xf5, 0x3f, +0x07, 0xfe, 0xc0, 0x1f, 0x1b, 0x3c, 0x76, 0x17, 0xec, 0x7f, 0x0d, 0x3c, 0x59, 0x18, 0x73, 0x85, +0x37, 0xd6, 0xdf, 0xd9, 0xea, 0x7d, 0x0f, 0xfa, 0x46, 0xce, 0x3d, 0xfa, 0x57, 0xee, 0x26, 0x87, +0xa2, 0xd9, 0xf8, 0x72, 0xc5, 0x6d, 0x74, 0xfb, 0x5b, 0x5b, 0x1b, 0x54, 0xc9, 0x58, 0x6d, 0xe1, +0x58, 0x63, 0x1f, 0x45, 0x5c, 0x0f, 0xd2, 0xb4, 0x2b, 0xf3, 0xac, 0x47, 0x8a, 0xd8, 0x99, 0x7f, +0xbb, 0xd0, 0x8c, 0x7f, 0xc4, 0xdb, 0xfc, 0xb9, 0x4f, 0xd1, 0xf0, 0x3f, 0x47, 0xfc, 0x04, 0x17, +0xfb, 0x5e, 0x2e, 0x72, 0xff, 0x00, 0x0a, 0x51, 0xfc, 0xf9, 0xcf, 0xc7, 0xff, 0x00, 0x08, 0x7f, +0xc1, 0x16, 0x7e, 0x36, 0xf8, 0x91, 0x15, 0xaf, 0xa1, 0xf0, 0x8f, 0x87, 0x06, 0x32, 0x46, 0xa1, +0xaa, 0x79, 0x8c, 0x3d, 0xbf, 0xd1, 0xd2, 0x51, 0x9f, 0xc7, 0x1e, 0xf5, 0xeb, 0xde, 0x0c, 0xff, +0x00, 0x82, 0x07, 0xcf, 0x36, 0x24, 0xf1, 0x27, 0xc4, 0x85, 0x89, 0x7b, 0xdb, 0x69, 0x9a, 0x5f, +0x99, 0x9f, 0xfb, 0x6b, 0x23, 0x8f, 0xfd, 0x17, 0xf8, 0xd7, 0xe9, 0x17, 0x5a, 0x2b, 0xc1, 0xc4, +0xf8, 0x89, 0x9d, 0xd5, 0xd2, 0x35, 0x14, 0x3f, 0xc3, 0x15, 0xfa, 0xdd, 0x9f, 0x5d, 0x81, 0xf0, +0x6b, 0x85, 0xf0, 0xfa, 0xce, 0x8c, 0xaa, 0x7f, 0x8a, 0x6f, 0xf2, 0x8f, 0x2a, 0xfc, 0x2c, 0x7c, +0x9d, 0xf0, 0xd7, 0xfe, 0x08, 0xdb, 0xf0, 0x4f, 0xc0, 0x6f, 0x1c, 0x9a, 0x86, 0x9f, 0xae, 0x78, +0xae, 0xe1, 0x39, 0xdd, 0xab, 0xea, 0x2c, 0x13, 0x3c, 0x7f, 0x04, 0x02, 0x25, 0x61, 0xec, 0xdb, +0xba, 0xf3, 0x9a, 0xfa, 0x1f, 0xe1, 0xdf, 0xc2, 0x1f, 0x0a, 0xfc, 0x25, 0xd3, 0x1a, 0xcf, 0xc2, +0xbe, 0x1d, 0xd1, 0x7c, 0x3b, 0x6d, 0x8c, 0x32, 0x69, 0xd6, 0x51, 0xdb, 0xef, 0xc7, 0xf7, 0x8a, +0x80, 0x58, 0xfb, 0x9c, 0x9a, 0xea, 0xb1, 0x46, 0x2b, 0xe5, 0xb1, 0xd9, 0xb6, 0x3b, 0x18, 0xff, +0x00, 0xda, 0xaa, 0xca, 0x7e, 0x4d, 0xb6, 0xbe, 0xed, 0x8f, 0xbc, 0xca, 0xf8, 0x7f, 0x2c, 0xcb, +0x95, 0xb0, 0x38, 0x78, 0x53, 0xf3, 0x8c, 0x52, 0x7f, 0x37, 0x6b, 0xbf, 0x98, 0x51, 0x45, 0x15, +0xc0, 0x7a, 0xe1, 0x45, 0x14, 0x50, 0x04, 0x33, 0x4c, 0x20, 0x5d, 0xce, 0x55, 0x55, 0x46, 0x4b, +0x1e, 0xdf, 0x5a, 0xfc, 0xf2, 0xfd, 0xb7, 0x3f, 0xe0, 0xb2, 0x4d, 0xa1, 0xea, 0x97, 0x9e, 0x19, +0xf8, 0x40, 0x6c, 0x2e, 0xa4, 0xb4, 0xca, 0x5d, 0xf8, 0x9a, 0x75, 0x13, 0xc4, 0xad, 0xdc, 0x5a, +0xc6, 0x7e, 0x49, 0x07, 0xfd, 0x34, 0x70, 0xca, 0x79, 0xc2, 0x11, 0xb5, 0xeb, 0x7f, 0xfe, 0x0b, +0x3d, 0xfb, 0x63, 0xdd, 0x7c, 0x3b, 0xf0, 0xb5, 0x97, 0xc2, 0xdf, 0x0f, 0xde, 0x7d, 0x97, 0x52, +0xf1, 0x45, 0xb9, 0xb8, 0xd6, 0xee, 0x11, 0xbe, 0x6b, 0x6b, 0x2c, 0xed, 0x48, 0x78, 0xe8, 0x66, +0x2a, 0xdb, 0xba, 0x1d, 0x89, 0x8c, 0x61, 0xeb, 0xf2, 0xfc, 0x0c, 0x0a, 0xfd, 0x6b, 0x80, 0xf8, +0x26, 0x8e, 0x2a, 0x92, 0xcc, 0x73, 0x05, 0xcd, 0x17, 0xf0, 0xc5, 0xec, 0xd7, 0x77, 0xdf, 0xc9, +0x7c, 0xdd, 0xd1, 0xfc, 0xf3, 0xe2, 0xc7, 0x8a, 0x18, 0x8c, 0x0d, 0x77, 0x92, 0xe5, 0x12, 0xe5, +0x9a, 0xfe, 0x24, 0xd6, 0xe9, 0xb5, 0x7e, 0x58, 0xf6, 0x76, 0x6a, 0xef, 0xa6, 0xca, 0xcd, 0x36, +0xb7, 0xfe, 0x23, 0xfc, 0x55, 0xf1, 0x37, 0xc5, 0xed, 0x73, 0xfb, 0x4b, 0xc4, 0xfa, 0xf6, 0xa9, +0xaf, 0x5f, 0x67, 0x2b, 0x71, 0x79, 0x77, 0x24, 0xfb, 0x3d, 0x80, 0x7e, 0x14, 0x76, 0xc0, 0xc0, +0xae, 0x7f, 0x60, 0x34, 0xb4, 0x57, 0xed, 0x34, 0x68, 0xd3, 0xa5, 0x15, 0x0a, 0x71, 0x49, 0x2d, +0x92, 0x56, 0x3f, 0x99, 0x31, 0x18, 0xaa, 0xd5, 0xea, 0x3a, 0xb5, 0xe6, 0xe5, 0x27, 0xbb, 0x6d, +0xb6, 0xfe, 0x6c, 0xee, 0xbe, 0x0a, 0xfe, 0xd3, 0x5e, 0x3e, 0xfd, 0x9e, 0x75, 0x55, 0xba, 0xf0, +0x6f, 0x8a, 0xb5, 0x2d, 0x0d, 0x15, 0xb7, 0x1b, 0x4f, 0xb4, 0x6e, 0xb4, 0xb8, 0xe7, 0xfe, 0x5a, +0x42, 0xff, 0x00, 0xbb, 0x7e, 0xfc, 0xb2, 0xf7, 0x35, 0xfa, 0x65, 0xfb, 0x05, 0x7f, 0xc1, 0x54, +0xf4, 0x7f, 0xda, 0x62, 0xf6, 0xd3, 0xc2, 0x9e, 0x2f, 0xb7, 0xb4, 0xf0, 0xef, 0x8d, 0xee, 0x06, +0xdb, 0x66, 0x8d, 0xb1, 0x65, 0xac, 0x11, 0xff, 0x00, 0x3c, 0xf7, 0x64, 0xc7, 0x2f, 0x5f, 0xdd, +0xb1, 0x21, 0xbf, 0x84, 0x93, 0xf2, 0x0f, 0xc9, 0x3c, 0x66, 0xa4, 0xb3, 0xbb, 0x92, 0xc6, 0xe6, +0x0b, 0x8b, 0x79, 0xda, 0xd6, 0xea, 0xd4, 0x86, 0x47, 0x53, 0x86, 0x42, 0x39, 0x04, 0x1e, 0xc4, +0x7e, 0x95, 0xf3, 0x1c, 0x45, 0xc2, 0x38, 0x1c, 0xd2, 0x93, 0xe7, 0x8a, 0x8d, 0x4e, 0x93, 0x4b, +0x5b, 0xf9, 0xf7, 0x5e, 0xbf, 0x2b, 0x1f, 0x73, 0xc1, 0xbe, 0x23, 0x66, 0xb9, 0x0d, 0x78, 0xf2, +0x4d, 0xce, 0x8f, 0xda, 0xa7, 0x27, 0x74, 0xd7, 0x5e, 0x5b, 0xfc, 0x2e, 0xdb, 0x5b, 0x4e, 0xe9, +0x9f, 0xd1, 0x85, 0x15, 0xf3, 0x7f, 0xfc, 0x13, 0x37, 0xf6, 0xba, 0x93, 0xf6, 0xb4, 0xfd, 0x9f, +0x63, 0xb9, 0xd5, 0x66, 0x56, 0xf1, 0x67, 0x86, 0xa4, 0x5d, 0x3b, 0x58, 0xc7, 0x06, 0xe4, 0xe3, +0x31, 0x5c, 0xe3, 0xfe, 0x9a, 0xa8, 0x39, 0xc7, 0xf1, 0xa4, 0x98, 0x00, 0x62, 0xbe, 0x90, 0xaf, +0xe6, 0xdc, 0x76, 0x0a, 0xae, 0x0f, 0x11, 0x3c, 0x2d, 0x75, 0x69, 0x41, 0xd9, 0xff, 0x00, 0x5e, +0x7b, 0xa3, 0xfb, 0x63, 0x2a, 0xcc, 0xf0, 0xf9, 0x8e, 0x0e, 0x9e, 0x3b, 0x0a, 0xef, 0x0a, 0x89, +0x49, 0x3f, 0x27, 0xdf, 0xcd, 0x6c, 0xfc, 0xc2, 0x8a, 0x28, 0xae, 0x53, 0xd0, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x3f, 0x99, 0x1f, 0x8d, 0x5a, 0x5b, 0x68, 0xff, 0x00, 0x1a, 0x7c, 0x69, 0x68, 0xcb, 0xb5, +0xad, 0xf5, 0xfb, 0xd8, 0x88, 0x3f, 0xc2, 0x56, 0xe5, 0xc1, 0xf7, 0xed, 0xde, 0xb9, 0x9a, 0xf5, +0xaf, 0xdb, 0xdf, 0xc3, 0x72, 0x78, 0x4f, 0xf6, 0xe2, 0xf8, 0xbd, 0x63, 0x26, 0xd5, 0xdd, 0xe2, +0xfd, 0x4e, 0x75, 0x51, 0xd1, 0x56, 0x7b, 0x89, 0x27, 0x8f, 0x1f, 0x83, 0x8a, 0xf2, 0x5a, 0xfe, +0xa0, 0xcb, 0xea, 0x73, 0xe1, 0xa9, 0xcd, 0x75, 0x8a, 0x7f, 0x82, 0x3f, 0x94, 0x33, 0x2a, 0x7e, +0xcf, 0x17, 0x56, 0x1d, 0xa5, 0x25, 0xf8, 0xb0, 0xa2, 0x8a, 0x2b, 0xb0, 0xe2, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x29, 0xc9, 0x1c, 0x93, 0xcd, 0x1c, 0x70, 0xf9, 0xb3, 0xcd, 0x29, 0xda, 0x91, 0xc6, +0x9b, 0x99, 0x8f, 0xb0, 0x1c, 0xd7, 0x4d, 0xa1, 0xfc, 0x33, 0x92, 0x66, 0x8e, 0x4d, 0x4a, 0x63, +0x0c, 0x3d, 0x7e, 0xcd, 0x0b, 0x06, 0x99, 0xbf, 0xde, 0x6e, 0x55, 0x7f, 0x0c, 0x9f, 0xa7, 0x5a, +0xa8, 0x46, 0x52, 0x76, 0x89, 0xc7, 0x8c, 0xcc, 0x30, 0xf8, 0x58, 0xf3, 0x57, 0x95, 0xbf, 0x3f, +0xb8, 0xe6, 0xed, 0xac, 0xe4, 0xbe, 0x9d, 0x61, 0xb7, 0x8e, 0x69, 0x2e, 0x1b, 0xa4, 0x70, 0xa1, +0x66, 0xfc, 0x87, 0xf3, 0xae, 0x93, 0x47, 0xf8, 0x61, 0x25, 0xd6, 0xd6, 0xd4, 0x26, 0x10, 0xa7, +0x53, 0x6f, 0x6f, 0x87, 0x94, 0x8f, 0x77, 0xfb, 0xab, 0xf8, 0x6e, 0xff, 0x00, 0x0e, 0xbb, 0x4d, +0xd2, 0x2d, 0xf4, 0x6b, 0x7f, 0x2a, 0xde, 0x18, 0x63, 0x8b, 0xf8, 0x82, 0x0f, 0x99, 0xff, 0x00, +0xde, 0x6e, 0xad, 0xf8, 0x93, 0x56, 0xab, 0xb6, 0x9e, 0x0d, 0x2d, 0x67, 0xa9, 0xf1, 0x38, 0xee, +0x2a, 0xaf, 0x53, 0xdc, 0xc3, 0x2e, 0x45, 0xdd, 0xea, 0xff, 0x00, 0xc9, 0x14, 0x74, 0x8f, 0x0e, +0x58, 0xe8, 0x8a, 0xbf, 0x64, 0xb6, 0x86, 0x19, 0x47, 0x3e, 0x73, 0xfc, 0xf2, 0x9f, 0xf8, 0x11, +0xe4, 0x7d, 0x06, 0x07, 0xd2, 0xaf, 0x75, 0xa2, 0x8a, 0xeb, 0x8c, 0x54, 0x74, 0x47, 0xcc, 0xd5, +0xad, 0x3a, 0x92, 0xe7, 0xa8, 0xdb, 0x7d, 0xd8, 0x57, 0xe9, 0xaf, 0xfc, 0x10, 0x4f, 0xc6, 0xeb, +0x79, 0xf0, 0xaf, 0xe2, 0x17, 0x87, 0x04, 0x9b, 0x9b, 0x4d, 0xd5, 0xe0, 0xd4, 0xc2, 0x9f, 0x4b, +0x88, 0x4c, 0x79, 0xff, 0x00, 0xc9, 0x50, 0x0f, 0xa7, 0x1e, 0xb5, 0xf9, 0x95, 0x5f, 0x5b, 0xff, +0x00, 0xc1, 0x18, 0xbe, 0x2e, 0x27, 0xc3, 0xff, 0x00, 0xda, 0xfe, 0x3d, 0x0e, 0xe2, 0x70, 0x2d, +0xbc, 0x65, 0xa5, 0xcd, 0xa6, 0x8c, 0xf0, 0xa2, 0xe2, 0x3c, 0x5c, 0x44, 0x7f, 0x28, 0xe4, 0x40, +0x3b, 0x99, 0x07, 0xb5, 0x7c, 0x8f, 0x1e, 0x60, 0x9e, 0x27, 0x24, 0xad, 0x18, 0xef, 0x14, 0xa5, +0xff, 0x00, 0x80, 0xb4, 0xdf, 0xe1, 0x73, 0xf4, 0x2f, 0x09, 0xf3, 0x38, 0xe0, 0xb8, 0xa3, 0x0d, +0x29, 0xbb, 0x29, 0xb7, 0x07, 0xff, 0x00, 0x6f, 0x26, 0x97, 0xfe, 0x4d, 0x63, 0xf5, 0xf6, 0x8a, +0x33, 0x45, 0x7f, 0x33, 0x9f, 0xdc, 0x41, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x01, 0x46, 0x68, 0xac, 0xfd, 0x6f, 0x5a, 0x87, 0xc3, 0x9a, 0x35, 0xd6, 0xa1, 0x75, +0xf2, 0xda, 0xd8, 0xc1, 0x25, 0xc4, 0xcc, 0x07, 0x44, 0x45, 0x2c, 0x7f, 0x40, 0x68, 0xeb, 0x60, +0xd1, 0x2b, 0xb3, 0xf0, 0xcf, 0xf6, 0xe8, 0xf8, 0x8f, 0x27, 0xc5, 0xbf, 0xdb, 0x03, 0xe2, 0x2e, +0xb2, 0xd2, 0x79, 0xca, 0xba, 0xbc, 0xf6, 0x76, 0xa7, 0xb1, 0x82, 0xdb, 0xfd, 0x1e, 0x2c, 0x0e, +0xd9, 0x48, 0xd4, 0xfd, 0x49, 0x3d, 0x72, 0x6b, 0xc9, 0xea, 0xc6, 0xb3, 0xac, 0xdc, 0x78, 0x83, +0x56, 0xbc, 0xd4, 0x2f, 0x0e, 0x6e, 0x2e, 0xee, 0x5a, 0xe6, 0x7c, 0x0e, 0x33, 0x21, 0xc9, 0xfe, +0x75, 0x5c, 0xd7, 0xf5, 0xe6, 0x5f, 0x87, 0x58, 0x7c, 0x35, 0x3a, 0x0b, 0xec, 0xc5, 0x2f, 0xb9, +0x24, 0x7f, 0x9d, 0x39, 0xc6, 0x35, 0xe3, 0x31, 0xf5, 0xb1, 0x72, 0xde, 0xa4, 0xe5, 0x2f, 0xbe, +0x4d, 0xff, 0x00, 0xc0, 0xf9, 0x05, 0x14, 0x51, 0x5d, 0x87, 0x9a, 0x14, 0x1a, 0x28, 0xa0, 0x0f, +0xb0, 0xbf, 0xe0, 0x89, 0xff, 0x00, 0x12, 0x26, 0xf0, 0x97, 0xed, 0x71, 0x75, 0xa0, 0x99, 0x89, +0xb3, 0xf1, 0x76, 0x91, 0x3c, 0x0c, 0x99, 0xe0, 0xcd, 0x0f, 0xfa, 0x44, 0x6d, 0xf5, 0x11, 0xa4, +0xbf, 0xf7, 0xf0, 0xd7, 0xeb, 0x95, 0x7e, 0x30, 0xff, 0x00, 0xc1, 0x22, 0x74, 0x59, 0xf5, 0x3f, +0xdb, 0xe7, 0xc1, 0xf7, 0x11, 0x0f, 0x97, 0x4b, 0xb7, 0xd4, 0x2e, 0xae, 0x7e, 0x86, 0xca, 0x78, +0xbf, 0xf4, 0x39, 0x45, 0x7e, 0xcf, 0x57, 0xf3, 0xcf, 0x89, 0x94, 0xe1, 0x1c, 0xe6, 0xf1, 0xde, +0x50, 0x8b, 0x7e, 0xb7, 0x6b, 0xf2, 0x48, 0xfe, 0xc7, 0xf0, 0x3a, 0xb5, 0x49, 0xf0, 0xd7, 0x24, +0xf6, 0x8d, 0x49, 0xa8, 0xfa, 0x5a, 0x2f, 0xf3, 0x6f, 0xe6, 0x14, 0x51, 0x45, 0x7e, 0x7a, 0x7e, +0xc2, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, +0x00, 0x14, 0x51, 0x45, 0x00, 0x7e, 0x0d, 0x7f, 0xc1, 0x6d, 0xbc, 0x06, 0xde, 0x0a, 0xff, 0x00, +0x82, 0x8d, 0x78, 0xd2, 0xe0, 0xa8, 0x8e, 0xdb, 0xc4, 0x76, 0x5a, 0x76, 0xab, 0x10, 0x55, 0xc0, +0xc1, 0xb6, 0x8e, 0x07, 0x3e, 0xf9, 0x92, 0x09, 0x49, 0x3e, 0xa4, 0xd7, 0xca, 0x15, 0xfa, 0x51, +0xff, 0x00, 0x07, 0x1f, 0xfc, 0x31, 0x36, 0x3f, 0x12, 0xbe, 0x19, 0xf8, 0xda, 0x38, 0xf7, 0x7f, +0x69, 0xe9, 0x97, 0x5a, 0x14, 0xee, 0x07, 0xdd, 0x6b, 0x79, 0x96, 0x78, 0x81, 0xfa, 0xfd, 0xa6, +0x62, 0x3f, 0xdd, 0x6a, 0xfc, 0xd7, 0xaf, 0xe8, 0xae, 0x13, 0xc5, 0x7b, 0x7c, 0xa2, 0x84, 0xfb, +0x46, 0xdf, 0xf8, 0x0e, 0x9f, 0xa1, 0xfc, 0xd1, 0xc6, 0x38, 0x57, 0x87, 0xce, 0x6b, 0xc3, 0xbb, +0xe6, 0xff, 0x00, 0xc0, 0xbd, 0xef, 0xd4, 0x28, 0xa2, 0x8a, 0xfa, 0x23, 0xe6, 0x82, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0x8d, 0x0b, 0xb4, 0x6a, +0xb1, 0xb4, 0x92, 0xca, 0xc1, 0x11, 0x15, 0x77, 0x33, 0xb1, 0xe8, 0x00, 0x1d, 0x49, 0xa0, 0x1b, +0xb6, 0xac, 0x33, 0x5b, 0x5e, 0x1c, 0xf0, 0x3d, 0xd6, 0xbc, 0xb1, 0xce, 0xfb, 0xad, 0xac, 0xcf, +0x22, 0x67, 0x5f, 0x9e, 0x61, 0xff, 0x00, 0x4c, 0xd7, 0xbf, 0xfb, 0xc7, 0x03, 0xeb, 0xd2, 0xb6, +0xbc, 0x27, 0xf0, 0xe9, 0x6d, 0x04, 0x77, 0x5a, 0x8a, 0x24, 0xf3, 0x70, 0xc9, 0x11, 0xf9, 0xa3, +0x84, 0xff, 0x00, 0xb7, 0xd4, 0x33, 0x7b, 0x7d, 0xd1, 0xef, 0xdb, 0xac, 0xc7, 0x3f, 0xa5, 0x75, +0xd1, 0xc2, 0xb7, 0xac, 0xcf, 0x8d, 0xcd, 0xb8, 0x9d, 0x41, 0xba, 0x58, 0x3d, 0x5f, 0xf3, 0x74, +0xf9, 0x77, 0xf5, 0x28, 0xe8, 0xfe, 0x1f, 0xb3, 0xd0, 0xa1, 0x29, 0x6d, 0x1a, 0xc6, 0xcc, 0x3e, +0x79, 0x9b, 0xe6, 0x96, 0x4f, 0xab, 0x75, 0xfc, 0x06, 0x07, 0xb5, 0x5e, 0xa2, 0x8a, 0xef, 0x8c, +0x54, 0x55, 0x91, 0xf1, 0x35, 0x2a, 0x4e, 0xa4, 0x9c, 0xea, 0x3b, 0xb7, 0xd5, 0x85, 0x14, 0x51, +0x54, 0x66, 0x14, 0x51, 0x45, 0x00, 0x15, 0xad, 0xe0, 0x3f, 0x19, 0xea, 0x1f, 0x0d, 0x7c, 0x6f, +0xa4, 0xf8, 0x8b, 0x4b, 0x9b, 0xec, 0xfa, 0x96, 0x83, 0x79, 0x0d, 0xe5, 0xa9, 0x3f, 0xf3, 0xd6, +0x39, 0x04, 0x88, 0x0f, 0xb1, 0xc7, 0xf3, 0xac, 0x9a, 0x2b, 0x3a, 0x94, 0xe3, 0x52, 0x2e, 0x12, +0xd5, 0x3d, 0x19, 0xad, 0x1a, 0xd3, 0xa3, 0x51, 0x55, 0xa6, 0xed, 0x28, 0xb4, 0xd3, 0xec, 0xd6, +0xa9, 0xfc, 0x99, 0xfd, 0x04, 0x7c, 0x1f, 0xf8, 0xa7, 0xa6, 0xfc, 0x6c, 0xf8, 0x5b, 0xa0, 0x78, +0xb3, 0x47, 0x6c, 0xe9, 0xfa, 0xfd, 0x94, 0x77, 0x91, 0x8d, 0xd9, 0x31, 0x16, 0x1f, 0x34, 0x6c, +0x7f, 0xbc, 0x8c, 0x19, 0x1b, 0xdd, 0x4d, 0x75, 0x95, 0xf9, 0xa9, 0xff, 0x00, 0x04, 0x4d, 0xfd, +0xae, 0x23, 0xd2, 0xb5, 0x0b, 0xdf, 0x84, 0x7a, 0xd5, 0xd0, 0x58, 0x75, 0x02, 0xfa, 0x9f, 0x87, +0x9d, 0xcf, 0x0b, 0x2e, 0x37, 0x5c, 0x5a, 0xff, 0x00, 0xc0, 0xb1, 0xe6, 0xa8, 0xf5, 0x12, 0x77, +0x61, 0x5f, 0xa5, 0x79, 0xaf, 0xe5, 0x5e, 0x20, 0xc9, 0xa7, 0x95, 0xe3, 0xea, 0x61, 0x25, 0xb2, +0x77, 0x8b, 0xef, 0x17, 0xb3, 0xfd, 0x1f, 0x9a, 0x67, 0xf7, 0xdf, 0x07, 0x71, 0x25, 0x2c, 0xf7, +0x29, 0xa5, 0x98, 0x53, 0xdd, 0xab, 0x49, 0x76, 0x92, 0xf8, 0x97, 0xdf, 0xaa, 0xf2, 0x69, 0x85, +0x14, 0x51, 0x5e, 0x29, 0xf5, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x5e, 0x2b, +0xff, 0x00, 0x05, 0x0d, 0xf1, 0xfa, 0xfc, 0x31, 0xfd, 0x8a, 0xbe, 0x22, 0x6a, 0x45, 0xb6, 0xbc, +0xda, 0x43, 0xe9, 0xa8, 0x7b, 0xee, 0xba, 0x2b, 0x6c, 0x31, 0xef, 0xfb, 0xdc, 0xfb, 0x63, 0x3d, +0xab, 0xda, 0xab, 0xe0, 0xbf, 0xf8, 0x2e, 0xcf, 0xc5, 0x65, 0xd1, 0xbe, 0x0b, 0xf8, 0x47, 0xc1, +0xb1, 0x48, 0x05, 0xc7, 0x88, 0x35, 0x47, 0xd4, 0x6e, 0x14, 0x1e, 0x7e, 0xcf, 0x6c, 0x84, 0x60, +0x8f, 0xf6, 0x9e, 0x55, 0x23, 0xd4, 0xc6, 0x7d, 0x0d, 0x7b, 0x5c, 0x37, 0x81, 0x78, 0xbc, 0xd6, +0x85, 0x0e, 0x8e, 0x49, 0xbf, 0x45, 0xab, 0xfc, 0x13, 0x3e, 0x5f, 0x8d, 0x73, 0x45, 0x97, 0x64, +0x58, 0xac, 0x67, 0x58, 0xc1, 0xa5, 0xfe, 0x29, 0x7b, 0xb1, 0xfc, 0x5a, 0x3f, 0x2f, 0xd4, 0x60, +0x51, 0x45, 0x15, 0xfd, 0x5c, 0x7f, 0x9f, 0xe1, 0x45, 0x14, 0x50, 0x01, 0x45, 0x15, 0x06, 0xa5, +0x7f, 0x0e, 0x8f, 0xa7, 0x49, 0x71, 0x31, 0xc4, 0x11, 0xa6, 0xf6, 0x00, 0xf2, 0xe7, 0xa0, 0x51, +0xee, 0x49, 0x00, 0x7d, 0x6a, 0x65, 0x24, 0x95, 0xd9, 0x50, 0x84, 0xa7, 0x25, 0x08, 0x2b, 0xb6, +0x7d, 0xb1, 0xff, 0x00, 0x04, 0x29, 0xf0, 0xfb, 0x6b, 0xdf, 0xb5, 0x77, 0x8a, 0xb5, 0x28, 0xe3, +0xdd, 0x6b, 0xe1, 0xff, 0x00, 0x0b, 0x79, 0x72, 0x70, 0x7f, 0x77, 0x3d, 0xcd, 0xc4, 0x42, 0x2e, +0x7b, 0x1f, 0x2e, 0x09, 0xf8, 0x3d, 0x43, 0x83, 0xda, 0xbf, 0x58, 0xeb, 0xf3, 0xaf, 0xfe, 0x0d, +0xdd, 0xf8, 0x7d, 0x25, 0xaf, 0xc0, 0xaf, 0x88, 0x9e, 0x39, 0xbb, 0x8f, 0x6d, 0xdf, 0x8b, 0x3c, +0x43, 0x15, 0x8e, 0x71, 0xf7, 0xa2, 0xb3, 0x80, 0x11, 0x8f, 0xf6, 0x56, 0x4b, 0xa9, 0x54, 0x7a, +0x6c, 0x3e, 0xd5, 0xfa, 0x29, 0x5f, 0xcc, 0xbc, 0x71, 0x8c, 0xfa, 0xce, 0x75, 0x5a, 0x4b, 0x68, +0xda, 0x3f, 0x72, 0x5f, 0xad, 0xcf, 0xee, 0xbf, 0x0d, 0x72, 0x9f, 0xec, 0xee, 0x1c, 0xc3, 0xd0, +0x96, 0xed, 0x39, 0x3f, 0x59, 0x36, 0xff, 0x00, 0x2b, 0x05, 0x14, 0x51, 0x5f, 0x26, 0x7d, 0xd8, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x01, 0xf1, 0x8f, 0xfc, 0x17, 0x6b, 0xe0, 0xe1, 0xf8, 0xa7, 0xfb, 0x03, 0x6a, +0x9a, 0xac, 0x30, 0x89, 0x6f, 0x3c, 0x0b, 0xa9, 0xda, 0xeb, 0xa9, 0xb5, 0x7e, 0x63, 0x16, 0x4d, +0xbc, 0xc3, 0x3f, 0xdd, 0x11, 0xdc, 0x34, 0x84, 0x74, 0xfd, 0xd0, 0x3d, 0x40, 0xaf, 0xc3, 0x90, +0x73, 0x5f, 0xd3, 0x97, 0xc4, 0xbf, 0x87, 0xda, 0x7f, 0xc5, 0x7f, 0x87, 0x3a, 0xff, 0x00, 0x85, +0xf5, 0x65, 0x66, 0xd3, 0x3c, 0x49, 0xa6, 0xdc, 0x69, 0x77, 0x8a, 0xa7, 0x05, 0xa2, 0x9e, 0x26, +0x89, 0xf1, 0xef, 0xb5, 0x8e, 0x2b, 0xf9, 0xa3, 0xf1, 0xff, 0x00, 0x81, 0xf5, 0x2f, 0x85, 0xde, +0x3e, 0xd7, 0x7c, 0x2f, 0xac, 0x2a, 0xae, 0xb1, 0xe1, 0xdd, 0x42, 0xe3, 0x4d, 0xbe, 0x0b, 0xf7, +0x7c, 0xf8, 0x25, 0x31, 0x36, 0x3d, 0xb2, 0xbc, 0x7a, 0x8c, 0x57, 0xec, 0x1e, 0x1a, 0xe6, 0x1c, +0xf8, 0x6a, 0x98, 0x37, 0xbc, 0x5d, 0xd7, 0xa3, 0xff, 0x00, 0x82, 0xbf, 0x14, 0x7e, 0x2b, 0xe2, +0x86, 0x5f, 0xc9, 0x89, 0xa5, 0x8d, 0x4b, 0x49, 0x2e, 0x57, 0xea, 0xb5, 0x5f, 0x7a, 0x7f, 0x83, +0x32, 0x68, 0xa2, 0x8a, 0xfd, 0x30, 0xfc, 0xb4, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x9d, 0x04, 0x0d, 0x71, 0x2c, 0x51, 0xc7, 0x1b, 0xcd, 0x34, 0xcc, 0x23, 0x8d, 0x11, +0x72, 0xce, 0xc7, 0x80, 0x00, 0xa0, 0x2f, 0x6d, 0x58, 0xb6, 0xb6, 0xb2, 0xdd, 0xdc, 0x88, 0x61, +0x59, 0x2e, 0x1a, 0x76, 0xd8, 0x91, 0xa7, 0x57, 0x3f, 0xe7, 0xf0, 0x15, 0xe8, 0x3e, 0x13, 0xf0, +0x74, 0x5e, 0x1b, 0x89, 0x66, 0x93, 0x63, 0x5e, 0x4a, 0xbf, 0x3c, 0xa0, 0x65, 0x61, 0x07, 0xaa, +0x27, 0xf2, 0x2d, 0xd4, 0xfd, 0x38, 0x2e, 0xf0, 0x7f, 0x83, 0xd3, 0xc3, 0x16, 0x85, 0xa4, 0xf2, +0xe6, 0xbb, 0x65, 0x02, 0x79, 0x01, 0xca, 0xc4, 0x0f, 0x3e, 0x5a, 0x7b, 0x7a, 0x9e, 0xe7, 0xdb, +0x15, 0xb5, 0x5d, 0xf8, 0x7c, 0x3a, 0x5e, 0xf4, 0xb7, 0xfe, 0xbf, 0x13, 0xf3, 0xbc, 0xfb, 0x3e, +0x95, 0x76, 0xf0, 0xf8, 0x77, 0x68, 0x75, 0x7d, 0xff, 0x00, 0xe0, 0x07, 0x41, 0x45, 0x14, 0x57, +0x69, 0xf2, 0xe1, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, +0x14, 0x50, 0x05, 0xcd, 0x03, 0x5f, 0xbc, 0xf0, 0xa6, 0xbd, 0x65, 0xaa, 0x69, 0x77, 0x52, 0x59, +0x6a, 0x1a, 0x65, 0xca, 0xdd, 0x5b, 0x5c, 0xdb, 0x1d, 0xad, 0x6f, 0x34, 0x64, 0x34, 0x72, 0x03, +0xea, 0x18, 0x03, 0xf8, 0x57, 0xed, 0x27, 0xfc, 0x13, 0xfb, 0xf6, 0xd9, 0xd3, 0x7f, 0x6c, 0x5f, +0x84, 0x8b, 0x71, 0x2b, 0x43, 0x67, 0xe3, 0x0d, 0x15, 0x12, 0x1d, 0x72, 0xc7, 0xa0, 0xdf, 0xc8, +0x17, 0x11, 0x7a, 0xc5, 0x26, 0x09, 0xff, 0x00, 0x61, 0xb7, 0x29, 0xe8, 0x09, 0xfc, 0x4f, 0x15, +0xd8, 0x7c, 0x0d, 0xf8, 0xe5, 0xe2, 0x4f, 0xd9, 0xcf, 0xe2, 0x6e, 0x9f, 0xe2, 0xaf, 0x0a, 0xdf, +0x1b, 0x3d, 0x4a, 0xcf, 0x82, 0x09, 0xfd, 0xc5, 0xdc, 0x3c, 0x79, 0x90, 0xca, 0x9f, 0xc7, 0x1b, +0xe0, 0x71, 0xeb, 0xca, 0xe1, 0x80, 0x61, 0xf1, 0xbc, 0x61, 0xc2, 0xd0, 0xce, 0x30, 0xd6, 0x8e, +0x95, 0x63, 0xf0, 0xbf, 0xfd, 0xb5, 0xf9, 0x3f, 0xc3, 0xef, 0xbf, 0xe9, 0x1e, 0x1c, 0x71, 0xe5, +0x5e, 0x1c, 0xc7, 0x5e, 0xa5, 0xe5, 0x87, 0xa9, 0x65, 0x38, 0xae, 0x9d, 0xa4, 0x97, 0x75, 0xf8, +0xa7, 0x67, 0xd2, 0xdf, 0xd0, 0x26, 0x68, 0xaf, 0x0d, 0xfd, 0x8d, 0x3f, 0x6d, 0xef, 0x0a, 0xfe, +0xd8, 0xfe, 0x0a, 0x5b, 0xad, 0x26, 0x41, 0xa7, 0xf8, 0x86, 0xce, 0x25, 0x3a, 0xa6, 0x87, 0x71, +0x20, 0xfb, 0x45, 0xa3, 0x1e, 0x37, 0xa9, 0xff, 0x00, 0x96, 0x90, 0x93, 0xd1, 0xc7, 0xa8, 0x0c, +0x14, 0xf1, 0x5e, 0xe5, 0x5f, 0xce, 0x18, 0xac, 0x2d, 0x6c, 0x35, 0x69, 0x50, 0xc4, 0x45, 0xc6, +0x51, 0xdd, 0x33, 0xfb, 0x53, 0x01, 0x98, 0x61, 0xb1, 0xb8, 0x78, 0xe2, 0xb0, 0x93, 0x53, 0xa7, +0x25, 0x74, 0xd6, 0xcf, 0xfa, 0xea, 0xb7, 0x4f, 0x46, 0x14, 0x51, 0x9a, 0x2b, 0x03, 0xb0, 0x28, +0xa2, 0x8a, 0x00, 0x33, 0x5f, 0x8c, 0x9f, 0xf0, 0x56, 0xaf, 0x8d, 0x7f, 0xf0, 0xb7, 0xbf, 0x6c, +0xad, 0x6a, 0xd6, 0xde, 0x7d, 0xda, 0x7f, 0x83, 0x51, 0x74, 0x1b, 0x7e, 0x78, 0x2f, 0x1e, 0x4d, +0xc9, 0xfa, 0xf9, 0xf2, 0x48, 0x9f, 0xf6, 0xc8, 0x7a, 0x60, 0x7e, 0xaa, 0xfe, 0xd4, 0x5f, 0x1b, +0xad, 0x7f, 0x66, 0xff, 0x00, 0x80, 0x7e, 0x28, 0xf1, 0x95, 0xc6, 0xc6, 0x93, 0x48, 0xb3, 0x66, +0xb5, 0x8d, 0xba, 0x5c, 0x5d, 0x3e, 0x23, 0x82, 0x3f, 0xf8, 0x14, 0xac, 0x80, 0xfa, 0x0c, 0x9e, +0xd5, 0xf8, 0x2f, 0xa9, 0xea, 0x17, 0x1a, 0xce, 0xa1, 0x71, 0x79, 0x79, 0x70, 0xd7, 0x57, 0x57, +0x8c, 0x6e, 0x6e, 0x59, 0xba, 0xbb, 0x13, 0x92, 0x4f, 0xb9, 0x26, 0xbf, 0x56, 0xf0, 0xb7, 0x2b, +0x75, 0x31, 0x15, 0x33, 0x09, 0xad, 0x22, 0xb9, 0x57, 0xab, 0xdf, 0xee, 0x5f, 0x99, 0xfc, 0xfd, +0xe3, 0xd7, 0x10, 0x2a, 0x58, 0x2a, 0x39, 0x3d, 0x37, 0xef, 0x54, 0x7c, 0xf2, 0xff, 0x00, 0x0c, +0x7e, 0x1b, 0xfa, 0xcb, 0x5f, 0xfb, 0x76, 0xfd, 0x08, 0x47, 0x02, 0x8a, 0x28, 0xaf, 0xdc, 0x8f, +0xe5, 0x80, 0xa2, 0x8a, 0x59, 0x24, 0x52, 0x85, 0x43, 0x2a, 0xaa, 0x82, 0xc4, 0xb1, 0xc0, 0x00, +0x7f, 0x4a, 0x4d, 0x80, 0xd2, 0x7e, 0x80, 0x01, 0x92, 0x4f, 0x61, 0x5e, 0x79, 0xe3, 0xcf, 0x16, +0x2e, 0xb7, 0x72, 0x21, 0x82, 0x4f, 0xf8, 0x97, 0xdb, 0xb1, 0x2a, 0xdd, 0xae, 0x64, 0xe8, 0x64, +0xfa, 0x0c, 0xe0, 0x7b, 0x12, 0x7b, 0xe0, 0x5a, 0xf1, 0xbf, 0x8d, 0xff, 0x00, 0xb5, 0x56, 0x4b, +0x3b, 0x29, 0x5b, 0xec, 0xb9, 0xdb, 0x3d, 0xc0, 0xeb, 0x75, 0xfe, 0xca, 0xfa, 0x27, 0x5c, 0xff, +0x00, 0x7b, 0x3e, 0x9d, 0x7a, 0x7f, 0xd8, 0xbf, 0xe0, 0x1f, 0xfc, 0x34, 0xe7, 0xed, 0x55, 0xe0, +0x1f, 0x02, 0x98, 0xfc, 0xcb, 0x3d, 0x7b, 0x54, 0x4f, 0xed, 0x05, 0xce, 0x3f, 0xd0, 0xe1, 0xcc, +0xd7, 0x3c, 0xf6, 0x3e, 0x44, 0x52, 0xe3, 0xdc, 0x81, 0xde, 0xbc, 0x8c, 0xc7, 0x1d, 0x0a, 0x74, +0xa5, 0x52, 0x4f, 0xdd, 0x8a, 0x6d, 0xfc, 0x95, 0xcf, 0xd1, 0x38, 0x53, 0x86, 0xea, 0xca, 0xbc, +0x27, 0x51, 0x7b, 0xf2, 0x69, 0x45, 0x76, 0xbb, 0x4a, 0xef, 0xef, 0xf9, 0x1f, 0xb9, 0x7f, 0xf0, +0x4c, 0xdf, 0x83, 0x6d, 0xf0, 0x1b, 0xf6, 0x14, 0xf8, 0x6f, 0xa0, 0xcd, 0x09, 0x82, 0xfa, 0x5d, +0x29, 0x35, 0x5b, 0xe5, 0x2b, 0x87, 0x4b, 0x8b, 0xc6, 0x6b, 0xa9, 0x15, 0xbd, 0x4a, 0x19, 0xb6, +0x7b, 0x04, 0x03, 0xa0, 0x15, 0xef, 0x94, 0xd5, 0x4d, 0x9f, 0x4e, 0xc3, 0x1d, 0x29, 0xd5, 0xfc, +0xab, 0x88, 0xad, 0x2a, 0xd5, 0xa7, 0x5e, 0x7b, 0xc9, 0xb6, 0xfe, 0x6e, 0xe7, 0xf6, 0xf6, 0x1b, +0x0f, 0x1a, 0x14, 0x61, 0x42, 0x1b, 0x45, 0x24, 0xbe, 0x4a, 0xc1, 0x45, 0x14, 0x56, 0x26, 0xc1, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, 0x45, 0x14, 0x50, 0x01, +0x45, 0x14, 0x50, 0x01, 0x5f, 0x89, 0xff, 0x00, 0xf0, 0x5e, 0xff, 0x00, 0xd9, 0xc1, 0xbe, 0x13, +0x7e, 0xd7, 0x76, 0xbe, 0x35, 0xb3, 0xb7, 0xdb, 0xa3, 0xfc, 0x48, 0xb2, 0x17, 0x2c, 0x54, 0x61, +0x53, 0x51, 0xb6, 0x54, 0x86, 0x61, 0x8e, 0xd9, 0x43, 0x6f, 0x26, 0x7a, 0xb3, 0x49, 0x29, 0xe7, +0x04, 0xd7, 0xed, 0x85, 0x7c, 0xcb, 0xff, 0x00, 0x05, 0x60, 0xfd, 0x94, 0x9b, 0xf6, 0xb5, 0xfd, +0x8e, 0x35, 0xed, 0x2f, 0x4e, 0xb4, 0xfb, 0x57, 0x8a, 0x3c, 0x34, 0x7f, 0xb7, 0xf4, 0x25, 0x55, +0xdd, 0x24, 0xb7, 0x10, 0x2b, 0x6f, 0x81, 0x40, 0xe4, 0x99, 0x61, 0x69, 0x63, 0x03, 0xa6, 0xf6, +0x42, 0x7e, 0xed, 0x7d, 0x17, 0x0a, 0xe6, 0xab, 0x01, 0x99, 0x42, 0xa4, 0x9f, 0xbb, 0x2f, 0x76, +0x5e, 0x8f, 0xaf, 0xc9, 0xd9, 0x9f, 0x33, 0xc5, 0xd9, 0x4b, 0xcc, 0x32, 0xca, 0x94, 0xa0, 0xbd, +0xf8, 0xfb, 0xd1, 0xf5, 0x5d, 0x3e, 0x6a, 0xeb, 0xe6, 0x7e, 0x02, 0xd1, 0x4d, 0x8e, 0x41, 0x2a, +0x2b, 0x29, 0xca, 0xb0, 0xc8, 0x22, 0x9d, 0x5f, 0xd1, 0x47, 0xf3, 0x48, 0x51, 0x45, 0x14, 0x00, +0x51, 0x45, 0x14, 0x00, 0x31, 0xf9, 0x79, 0xe9, 0x5d, 0xd7, 0xc3, 0xdf, 0x08, 0xff, 0x00, 0x67, +0x5b, 0x2d, 0xf5, 0xcc, 0x67, 0xed, 0x52, 0x2e, 0x60, 0x46, 0x1c, 0xdb, 0x46, 0x47, 0x52, 0x3f, +0xbe, 0xdf, 0xa0, 0xe3, 0xa9, 0x22, 0xb1, 0x7e, 0x1f, 0x78, 0x65, 0x75, 0xad, 0x40, 0xdd, 0x4e, +0x9b, 0xad, 0x6d, 0x5c, 0x61, 0x58, 0x71, 0x71, 0x2f, 0x04, 0x2f, 0xfb, 0xa3, 0x82, 0x7f, 0xe0, +0x23, 0xa1, 0x35, 0xe8, 0x04, 0xe4, 0xf3, 0xd7, 0xb9, 0xf5, 0xae, 0xcc, 0x2d, 0x1b, 0xfb, 0xec, +0xf8, 0xbe, 0x26, 0xcd, 0xad, 0xfe, 0xc7, 0x49, 0xff, 0x00, 0x8b, 0xfc, 0xbf, 0xcc, 0x28, 0xa2, +0x8a, 0xf4, 0x0f, 0x87, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, +0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x05, 0x14, 0x50, 0x06, 0xd7, 0x80, 0x7c, +0x7f, 0xad, 0xfc, 0x2a, 0xf1, 0x7d, 0x8f, 0x88, 0x3c, 0x39, 0xaa, 0xdf, 0x69, 0x3a, 0xd6, 0x9a, +0xd9, 0xb5, 0xbb, 0xb5, 0x6c, 0x32, 0xfa, 0x8f, 0x42, 0x08, 0xe0, 0xa1, 0x05, 0x58, 0x64, 0x1c, +0x82, 0x45, 0x7e, 0x97, 0x7e, 0xc6, 0x9f, 0xf0, 0x59, 0x5f, 0x0e, 0xfc, 0x43, 0x86, 0xd7, 0x43, +0xf8, 0xa1, 0xf6, 0x5f, 0x0b, 0xeb, 0x98, 0x54, 0x4d, 0x61, 0x78, 0xd3, 0x6f, 0x0f, 0xac, 0xbf, +0xf3, 0xee, 0xe7, 0xbe, 0x73, 0x1f, 0x53, 0x94, 0xe1, 0x6b, 0xf2, 0xdf, 0x34, 0x11, 0x9a, 0xf9, +0xbc, 0xfb, 0x85, 0xf0, 0x39, 0xb4, 0x2d, 0x89, 0x8d, 0xa4, 0xb6, 0x92, 0xf8, 0x97, 0xf9, 0xaf, +0x27, 0xf2, 0x3e, 0xd3, 0x84, 0x78, 0xf3, 0x34, 0xe1, 0xea, 0xbc, 0xd8, 0x29, 0x5e, 0x9b, 0xf8, +0xa1, 0x2d, 0x62, 0xfc, 0xfb, 0xa7, 0xe6, 0xad, 0xe7, 0x73, 0xfa, 0x26, 0xb0, 0xd4, 0x61, 0xd5, +0xac, 0xa1, 0xb8, 0xb5, 0x9a, 0x3b, 0x9b, 0x7b, 0x84, 0xdf, 0x14, 0xd1, 0x30, 0x78, 0xdd, 0x4f, +0x20, 0x82, 0x0e, 0x08, 0x3e, 0xbc, 0x8a, 0xbd, 0x9a, 0xfc, 0x1c, 0xfd, 0x9f, 0x3f, 0x6c, 0xdf, +0x89, 0x1f, 0xb3, 0x0d, 0xc7, 0xfc, 0x52, 0x3e, 0x26, 0xbc, 0xb6, 0xd3, 0x98, 0xee, 0x7d, 0x2e, +0xe4, 0x0b, 0x8d, 0x3d, 0xf3, 0xd7, 0xf7, 0x4f, 0xc0, 0x27, 0xbb, 0x26, 0xd6, 0xff, 0x00, 0x6a, +0xbe, 0xd7, 0xf8, 0x2f, 0xff, 0x00, 0x05, 0xdc, 0xd2, 0x6f, 0x21, 0x8e, 0xdf, 0xc7, 0xfe, 0x0b, +0xbe, 0xb3, 0xb8, 0xe0, 0x3d, 0xf6, 0x82, 0xc2, 0x78, 0x5c, 0xfa, 0xf9, 0x12, 0x30, 0x64, 0x1f, +0x49, 0x1c, 0xfe, 0x3c, 0x57, 0xe3, 0x39, 0xb7, 0x87, 0x39, 0xa6, 0x11, 0xb9, 0x61, 0xd2, 0xab, +0x1f, 0x2d, 0x1f, 0xce, 0x2f, 0xf4, 0xb9, 0xfd, 0x31, 0xc3, 0xfe, 0x34, 0x64, 0x39, 0x84, 0x54, +0x31, 0x6d, 0xe1, 0xea, 0x76, 0x96, 0xb1, 0xf9, 0x49, 0x69, 0x6f, 0xf1, 0x28, 0x9f, 0xa1, 0x99, +0xa3, 0x35, 0xe0, 0xbf, 0x0f, 0xff, 0x00, 0xe0, 0xa5, 0x5f, 0x03, 0xfe, 0x24, 0x47, 0x1f, 0xd8, +0xfe, 0x20, 0xe8, 0xf6, 0x12, 0x30, 0xe6, 0x3d, 0x55, 0x64, 0xd3, 0x76, 0x1e, 0xa4, 0x17, 0x9d, +0x55, 0x0f, 0xd4, 0x31, 0x1e, 0xf5, 0xb3, 0xf1, 0xaf, 0xf6, 0xc9, 0xf0, 0x1f, 0xc2, 0x4f, 0x82, +0xba, 0xd7, 0x8c, 0xa1, 0xf1, 0x27, 0x87, 0xb5, 0xc8, 0xb4, 0xcb, 0x62, 0xf6, 0xd6, 0xf6, 0x1a, +0x9c, 0x33, 0x35, 0xfc, 0xe7, 0xe5, 0x8e, 0x24, 0xd8, 0xc7, 0x3b, 0x9c, 0xa8, 0x24, 0x74, 0x19, +0x3d, 0x05, 0x7c, 0x7c, 0xb2, 0xbc, 0x6c, 0x6a, 0xaa, 0x33, 0xa3, 0x25, 0x26, 0xd2, 0x49, 0xa6, +0xb5, 0x7e, 0xa8, 0xfd, 0x1e, 0x9e, 0x7b, 0x96, 0xd4, 0xa1, 0x2c, 0x4d, 0x3a, 0xf0, 0x94, 0x22, +0x9b, 0x6d, 0x49, 0x35, 0x64, 0xae, 0xde, 0x8d, 0x9f, 0x15, 0x7f, 0xc1, 0x71, 0x7f, 0x69, 0x55, +0xd6, 0x3c, 0x51, 0xa2, 0xfc, 0x2c, 0xd2, 0xee, 0x07, 0x93, 0xa4, 0x6d, 0xd5, 0xf5, 0x9d, 0xa7, +0xfe, 0x5b, 0xba, 0x9f, 0x22, 0x23, 0xfe, 0xe4, 0x64, 0xc8, 0x47, 0x4f, 0xde, 0xa1, 0xea, 0xb5, +0xf0, 0x08, 0xad, 0x6f, 0x88, 0x3e, 0x3c, 0xd4, 0x7e, 0x24, 0xf8, 0xd3, 0x55, 0xf1, 0x26, 0xb5, +0x78, 0x97, 0x3a, 0xb6, 0xb9, 0x77, 0x2d, 0xdd, 0xdb, 0x96, 0x01, 0x7c, 0xd9, 0x39, 0x3d, 0xf8, +0x1e, 0xdd, 0x00, 0xe3, 0xa0, 0xae, 0x76, 0x7f, 0x10, 0x69, 0xf6, 0x4b, 0x99, 0x6f, 0xad, 0xe3, +0xe3, 0x85, 0xfb, 0x4a, 0x16, 0x3f, 0xf0, 0x10, 0x73, 0xfa, 0x57, 0xf4, 0xe7, 0x0e, 0xe5, 0x30, +0xca, 0xf2, 0xfa, 0x78, 0x45, 0xba, 0x57, 0x93, 0xef, 0x27, 0xbb, 0xfd, 0x17, 0x95, 0x8f, 0xe1, +0x9e, 0x32, 0xcf, 0xab, 0xe7, 0xf9, 0xcd, 0x6c, 0xc2, 0xcf, 0x96, 0x4e, 0xd1, 0x56, 0x7a, 0x41, +0x7c, 0x2b, 0xc9, 0xdb, 0x57, 0xe6, 0xd9, 0x72, 0x8c, 0xd6, 0x05, 0xf7, 0xc4, 0xad, 0x2e, 0xd1, +0x58, 0x45, 0x25, 0xd5, 0xd4, 0x9d, 0x00, 0x86, 0x22, 0xa9, 0x9f, 0xf7, 0x9f, 0x1f, 0x98, 0x06, +0xb9, 0xed, 0x5b, 0xe2, 0x5d, 0xf5, 0xda, 0x30, 0xb5, 0x8e, 0x1b, 0x08, 0x9b, 0xf8, 0x93, 0xf7, +0x93, 0x7f, 0xdf, 0x4c, 0x30, 0x3e, 0xaa, 0xa0, 0x8f, 0x5a, 0xf5, 0xa5, 0x8a, 0x82, 0x3c, 0xcc, +0x2f, 0x0f, 0xe3, 0x6b, 0x3f, 0x87, 0x95, 0x77, 0x7a, 0x7f, 0xc1, 0x3b, 0x2d, 0x63, 0x5f, 0xb3, +0xd0, 0x62, 0xdd, 0x73, 0x22, 0xc4, 0xc4, 0x65, 0x21, 0x5f, 0x9a, 0x69, 0x7f, 0xdd, 0x5f, 0xea, +0x70, 0x3d, 0xeb, 0x84, 0xf1, 0x27, 0x8d, 0xe7, 0xf1, 0x2e, 0xe8, 0x46, 0x60, 0xb1, 0xcf, 0x16, +0xe8, 0xd9, 0x69, 0x7d, 0x0c, 0x87, 0xbf, 0xae, 0x3a, 0x0f, 0x7e, 0xb5, 0x93, 0x2c, 0xcd, 0x34, +0xb2, 0x49, 0x24, 0xb2, 0x4d, 0x34, 0x87, 0x2f, 0x24, 0x8c, 0x59, 0xdc, 0xfa, 0x92, 0x79, 0x26, +0x92, 0xb8, 0x6a, 0x62, 0x25, 0x3d, 0x36, 0x47, 0xd9, 0x65, 0x9c, 0x3f, 0x43, 0x0a, 0xd4, 0xe5, +0xef, 0x4f, 0xbb, 0x5a, 0x2f, 0x44, 0x19, 0xaf, 0xd3, 0x6f, 0xf8, 0x37, 0x57, 0xf6, 0x70, 0x6d, +0x47, 0x5f, 0xf1, 0xb7, 0xc5, 0x9b, 0xeb, 0x75, 0xf2, 0x6c, 0xd0, 0x78, 0x6b, 0x4a, 0x2d, 0xce, +0x65, 0x6d, 0x93, 0x5d, 0xb8, 0xf4, 0x2a, 0xbe, 0x42, 0x86, 0x1d, 0x7c, 0xd9, 0x47, 0x1c, 0x83, +0xf9, 0xa7, 0xa1, 0xe8, 0x37, 0xbe, 0x29, 0xd7, 0xac, 0xf4, 0xad, 0x32, 0xce, 0x5d, 0x43, 0x51, +0xd4, 0xae, 0xd2, 0xc6, 0xc6, 0xce, 0x31, 0x97, 0x9e, 0xe2, 0x56, 0x0a, 0x88, 0xa3, 0xb9, 0x66, +0x20, 0x01, 0x5f, 0xd1, 0xaf, 0xec, 0x6d, 0xfb, 0x39, 0xd9, 0x7e, 0xc9, 0x9f, 0xb3, 0x67, 0x84, +0x7c, 0x03, 0x66, 0xd1, 0x4d, 0x26, 0x85, 0x64, 0x05, 0xf4, 0xf1, 0xfd, 0xdb, 0xbb, 0xc9, 0x09, +0x92, 0xe2, 0x61, 0xdf, 0x0d, 0x33, 0x39, 0x5c, 0xf2, 0x17, 0x03, 0xb0, 0xaf, 0xce, 0x7c, 0x42, +0xcd, 0x95, 0x0c, 0x02, 0xc2, 0xc5, 0xfb, 0xd5, 0x5f, 0xfe, 0x4a, 0xb5, 0x7f, 0xa2, 0xfb, 0xcf, +0xd9, 0x3c, 0x37, 0xca, 0x5e, 0x23, 0x30, 0x78, 0xc9, 0xaf, 0x76, 0x92, 0xff, 0x00, 0xc9, 0x9e, +0x8b, 0xee, 0x57, 0x7f, 0x75, 0xd1, 0xea, 0xb4, 0x51, 0x45, 0x7e, 0x26, 0x7e, 0xf0, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, +0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x14, 0x51, 0x45, 0x00, 0x7e, 0x0b, 0x7f, 0xc1, 0x60, 0xbf, +0x63, 0xe6, 0xfd, 0x94, 0xbf, 0x6b, 0x1d, 0x42, 0xfb, 0x4d, 0xb3, 0x11, 0x78, 0x43, 0xc7, 0xcd, +0x26, 0xb7, 0xa4, 0x6c, 0x5c, 0x47, 0x04, 0xa5, 0x81, 0xba, 0xb5, 0x1d, 0x87, 0x97, 0x2b, 0x06, +0x00, 0x70, 0x23, 0x9e, 0x21, 0xd8, 0xd7, 0xca, 0x9d, 0xab, 0xfa, 0x16, 0xff, 0x00, 0x82, 0x8d, +0x7e, 0xc7, 0x56, 0x9f, 0xb6, 0xd7, 0xec, 0xcb, 0xaa, 0xf8, 0x59, 0x7c, 0x98, 0x7c, 0x49, 0x64, +0x4e, 0xa3, 0xe1, 0xeb, 0xb7, 0x38, 0xf2, 0x2f, 0x51, 0x4e, 0xd5, 0x63, 0xda, 0x39, 0x41, 0x68, +0x9f, 0xa8, 0x02, 0x4d, 0xd8, 0x25, 0x16, 0xbf, 0x9f, 0x1d, 0x67, 0x47, 0xbc, 0xf0, 0xde, 0xb1, +0x79, 0xa7, 0x6a, 0x36, 0x92, 0xe9, 0xfa, 0x86, 0x9b, 0x2b, 0xd9, 0x5e, 0xd9, 0x4a, 0x85, 0x24, +0x82, 0x74, 0x62, 0xae, 0x8c, 0x0f, 0x46, 0x56, 0x04, 0x11, 0xd8, 0x83, 0x5f, 0xbc, 0x70, 0x4e, +0x7a, 0xb1, 0xf8, 0x15, 0x4a, 0xa3, 0xfd, 0xe5, 0x3b, 0x27, 0xe6, 0xba, 0x3f, 0xd1, 0xf9, 0xaf, +0x33, 0xf9, 0xef, 0x8e, 0xb2, 0x07, 0x97, 0xe3, 0x9d, 0x6a, 0x6b, 0xf7, 0x75, 0x2e, 0xd7, 0x93, +0xdd, 0xaf, 0xd5, 0x79, 0x6d, 0x7b, 0x32, 0xbd, 0x14, 0x51, 0x5f, 0x68, 0x7c, 0x38, 0x54, 0x96, +0x36, 0x92, 0xdf, 0xde, 0x47, 0x6b, 0x02, 0xee, 0xb8, 0x92, 0x41, 0x1c, 0x79, 0xe8, 0x3d, 0xcf, +0xb0, 0x19, 0x27, 0xd0, 0x03, 0x51, 0xd7, 0x63, 0xf0, 0xb7, 0x43, 0xda, 0x24, 0xd4, 0x24, 0x5f, +0x99, 0xf3, 0x6d, 0x1f, 0xa8, 0x03, 0xfd, 0x63, 0x8f, 0xc7, 0x0a, 0x0f, 0xb3, 0x7a, 0xd5, 0x53, +0x87, 0x3c, 0xb9, 0x4f, 0x3f, 0x33, 0xc7, 0x2c, 0x26, 0x1e, 0x55, 0xba, 0xec, 0xbd, 0x5e, 0xdf, +0xe7, 0xf2, 0x3a, 0x7d, 0x1f, 0x4d, 0x87, 0x48, 0xb1, 0x8e, 0xda, 0x35, 0xfd, 0xca, 0xa6, 0xdc, +0x91, 0xf3, 0x3b, 0x75, 0x66, 0x3e, 0xe4, 0x92, 0x7f, 0x1f, 0x4a, 0xb1, 0x45, 0x15, 0xec, 0x46, +0x29, 0x2b, 0x23, 0xf2, 0x59, 0xd4, 0x94, 0xe4, 0xe7, 0x37, 0x76, 0xf5, 0x6f, 0xd4, 0x28, 0xa2, +0x8a, 0xa2, 0x42, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x00, 0x0d, 0xe7, 0x6f, 0x5e, 0xc2, 0xbc, 0xef, 0xe2, 0x17, 0x88, 0x17, 0x5c, 0xd4, +0xc5, 0xac, 0x6e, 0xaf, 0x67, 0x66, 0xe4, 0x06, 0x53, 0x95, 0x9e, 0x5e, 0x8c, 0xfe, 0x84, 0x0e, +0x54, 0x1e, 0x9f, 0x78, 0x8e, 0x1a, 0xb7, 0xbe, 0x20, 0xf8, 0xaf, 0xfb, 0x36, 0xcb, 0xec, 0x76, +0xf2, 0x1f, 0xb6, 0x4c, 0x9f, 0xbc, 0x65, 0x3c, 0xdb, 0x44, 0x7f, 0xf6, 0x66, 0xe8, 0x3d, 0x06, +0x4f, 0x70, 0x6b, 0x85, 0x03, 0x02, 0xbc, 0xfc, 0x55, 0x5b, 0xfb, 0x8b, 0xe6, 0x7d, 0xb7, 0x0b, +0xe5, 0x56, 0xff, 0x00, 0x6c, 0xa8, 0xbf, 0xc3, 0xe9, 0xdf, 0xfc, 0x86, 0xf9, 0x29, 0xfd, 0xd5, +0xfc, 0xa9, 0xc1, 0x71, 0xda, 0x8a, 0x2b, 0x8c, 0xfb, 0x60, 0xa2, 0x8a, 0x28, 0x00, 0xa3, 0x34, +0x57, 0x45, 0xf0, 0x83, 0xe1, 0x3e, 0xbd, 0xf1, 0xdb, 0xe2, 0x86, 0x83, 0xe0, 0xdf, 0x0b, 0xda, +0xfd, 0xbb, 0x5c, 0xf1, 0x15, 0xe8, 0xb2, 0xb2, 0x43, 0x90, 0xa0, 0x9e, 0x4b, 0x31, 0x19, 0xc4, +0x71, 0xa8, 0x69, 0x1c, 0xf3, 0x84, 0x52, 0x7b, 0x56, 0x75, 0x2a, 0x46, 0x9c, 0x5c, 0xe6, 0xec, +0x96, 0xad, 0xf6, 0x48, 0xd2, 0x9d, 0x39, 0xd4, 0x9a, 0xa7, 0x05, 0x76, 0xdd, 0x92, 0x5b, 0xb6, +0xf4, 0x47, 0xdb, 0x9f, 0xf0, 0x41, 0x2f, 0xd8, 0xfd, 0xbe, 0x2b, 0x7c, 0x71, 0xbc, 0xf8, 0xab, +0xac, 0x5a, 0xee, 0xf0, 0xf7, 0x80, 0xdb, 0xec, 0xfa, 0x66, 0xf5, 0xca, 0xdd, 0xea, 0xae, 0x9d, +0x7d, 0x0f, 0x91, 0x0b, 0x6f, 0x23, 0xa8, 0x79, 0xa1, 0x20, 0xfc, 0xa6, 0xbf, 0x65, 0xab, 0xce, +0x7f, 0x65, 0xaf, 0xd9, 0xdb, 0x44, 0xfd, 0x94, 0x3e, 0x03, 0xf8, 0x77, 0xc0, 0x3e, 0x1f, 0x1b, +0xac, 0x74, 0x1b, 0x51, 0x14, 0x97, 0x2c, 0xa1, 0x64, 0xbf, 0xb8, 0x63, 0xba, 0x6b, 0x87, 0x19, +0x38, 0x69, 0x24, 0x66, 0x62, 0x33, 0x81, 0x90, 0xa3, 0x80, 0x05, 0x7a, 0x35, 0x7f, 0x39, 0x71, +0x16, 0x70, 0xf3, 0x2c, 0x74, 0xf1, 0x1f, 0x67, 0x68, 0xae, 0xd1, 0x5b, 0x7c, 0xde, 0xec, 0xfe, +0x9a, 0xe1, 0xac, 0x96, 0x39, 0x66, 0x5f, 0x0c, 0x37, 0xda, 0xde, 0x4f, 0xbc, 0x9e, 0xff, 0x00, +0x25, 0xb2, 0xf2, 0x0a, 0x28, 0xa2, 0xbc, 0x43, 0xde, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, +0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0xfc, 0xa5, 0xff, 0x00, 0x82, 0xf0, 0xff, 0x00, 0xc1, 0x3f, +0x1a, 0xc2, 0xf6, 0x4f, 0x8e, 0x7e, 0x11, 0xb3, 0x5f, 0xb2, 0xdc, 0x18, 0xe0, 0xf1, 0x85, 0xa4, +0x43, 0x84, 0x6e, 0x12, 0x2b, 0xf0, 0x3d, 0x1b, 0xe5, 0x8e, 0x5c, 0x77, 0xf2, 0xdf, 0x1c, 0xc8, +0xd5, 0xfa, 0xb5, 0x59, 0xbe, 0x21, 0xd1, 0x2c, 0xfc, 0x51, 0xa3, 0x5e, 0x69, 0xba, 0x8d, 0xad, +0xbd, 0xf6, 0x9b, 0xa8, 0x41, 0x25, 0xad, 0xdd, 0xb4, 0xf1, 0x89, 0x22, 0xb8, 0x89, 0xd4, 0xa3, +0xa3, 0xa9, 0xe0, 0xa9, 0x52, 0x41, 0x07, 0x82, 0x09, 0xaf, 0x53, 0x27, 0xcd, 0xea, 0xe5, 0xb8, +0xb8, 0xe2, 0x69, 0x74, 0xd1, 0xae, 0xeb, 0xaa, 0xff, 0x00, 0x2f, 0x3b, 0x1e, 0x4e, 0x79, 0x93, +0xd1, 0xcc, 0xf0, 0x92, 0xc2, 0xd6, 0xeb, 0xaa, 0x7d, 0x9f, 0x47, 0xfe, 0x7d, 0xd5, 0xd1, 0xfc, +0xbe, 0x83, 0x45, 0x7d, 0x3b, 0xff, 0x00, 0x05, 0x3d, 0xff, 0x00, 0x82, 0x79, 0x6a, 0x1f, 0xb0, +0xbf, 0xc6, 0x1f, 0x3b, 0x4d, 0xb7, 0x9a, 0xf3, 0xe1, 0xdf, 0x89, 0x24, 0x66, 0xd0, 0x6f, 0xdb, +0x2d, 0xf6, 0x26, 0xe5, 0x8d, 0x84, 0xcc, 0x72, 0x7c, 0xd8, 0xd7, 0x95, 0x27, 0xfd, 0x64, 0x63, +0x76, 0x4b, 0x2c, 0x81, 0x3e, 0x62, 0xaf, 0xe8, 0xcc, 0xbf, 0x1d, 0x47, 0x19, 0x42, 0x38, 0x9a, +0x0e, 0xf1, 0x92, 0xfe, 0x93, 0xf3, 0x5d, 0x4f, 0xe6, 0x7c, 0xc7, 0x2f, 0xaf, 0x81, 0xc4, 0x4b, +0x0d, 0x88, 0x56, 0x94, 0x5f, 0xf4, 0xd7, 0x93, 0xe8, 0x3a, 0xd6, 0x07, 0xbb, 0x9e, 0x38, 0x63, +0x5d, 0xd3, 0x3c, 0x8b, 0x0c, 0x60, 0x9e, 0x37, 0x31, 0xc0, 0xcf, 0xe7, 0x5e, 0xaf, 0xa6, 0xd9, +0xa6, 0x9f, 0x61, 0x0d, 0xac, 0x3c, 0x43, 0x14, 0x6b, 0x12, 0x71, 0xc9, 0xc7, 0x52, 0x7d, 0xcf, +0x53, 0xee, 0x4d, 0x70, 0xff, 0x00, 0x0c, 0xf4, 0xd1, 0x79, 0xae, 0x4d, 0x71, 0xb7, 0x74, 0x76, +0x71, 0x65, 0x78, 0xff, 0x00, 0x96, 0x8f, 0x95, 0x5f, 0xfc, 0x77, 0x79, 0xfc, 0xbd, 0xab, 0xbf, +0xaf, 0x6f, 0x07, 0x4f, 0xdd, 0x72, 0x3f, 0x31, 0xe2, 0xcc, 0x63, 0x9d, 0x68, 0xe1, 0xe2, 0xf4, +0x8a, 0xbb, 0xf5, 0x7f, 0xf0, 0x02, 0x8a, 0x28, 0xae, 0xd3, 0xe4, 0xc2, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x03, 0x35, 0x93, 0xe2, 0xff, +0x00, 0x14, 0x47, 0xe1, 0xbb, 0x35, 0x6f, 0x96, 0x5b, 0xbb, 0x80, 0x45, 0xb4, 0x07, 0xff, 0x00, +0x43, 0x6f, 0xf6, 0x47, 0xea, 0x78, 0xf5, 0x21, 0xde, 0x24, 0xf1, 0x4c, 0x3e, 0x19, 0xb7, 0x0c, +0xdb, 0x6e, 0x2e, 0x26, 0x04, 0xdb, 0xda, 0x86, 0xe5, 0xba, 0x8d, 0xcd, 0xe8, 0x80, 0xf7, 0xea, +0x7a, 0x0e, 0xe4, 0x79, 0xbe, 0xa1, 0x7f, 0x36, 0xa9, 0x78, 0xd7, 0x37, 0x33, 0x19, 0xde, 0xe0, +0xe5, 0xdb, 0x18, 0x03, 0x1d, 0x14, 0x0e, 0xc0, 0x74, 0x02, 0xb8, 0xf1, 0x15, 0xed, 0xee, 0xc7, +0x73, 0xe9, 0x32, 0x3c, 0x91, 0xe2, 0x5f, 0xb7, 0xac, 0xbd, 0xc5, 0xf8, 0xff, 0x00, 0xc0, 0x1b, +0x2c, 0xd2, 0x5d, 0xdc, 0x4b, 0x24, 0xf2, 0x34, 0xed, 0x3b, 0x17, 0x92, 0x46, 0xea, 0xec, 0x7a, +0xd3, 0x68, 0xa2, 0xbc, 0xf3, 0xf4, 0x78, 0xc5, 0x25, 0x64, 0x14, 0x51, 0x45, 0x03, 0x0a, 0x28, +0xa3, 0x38, 0xa0, 0x01, 0x9b, 0x68, 0xc9, 0xe2, 0xbf, 0x62, 0xbf, 0xe0, 0x87, 0x3f, 0xf0, 0x4f, +0xa9, 0x3e, 0x07, 0xfc, 0x3c, 0x5f, 0x8b, 0x1e, 0x2d, 0xb3, 0x11, 0x78, 0xbb, 0xc6, 0x16, 0x61, +0x74, 0x8b, 0x59, 0x57, 0xe6, 0xd2, 0x74, 0xd6, 0xc3, 0x06, 0x23, 0xf8, 0x66, 0x9f, 0xe5, 0x63, +0xdd, 0x63, 0x08, 0x3e, 0x52, 0xf2, 0x2d, 0x7c, 0xb1, 0xff, 0x00, 0x04, 0x74, 0xff, 0x00, 0x82, +0x6b, 0xc9, 0xfb, 0x4f, 0xf8, 0xf2, 0x1f, 0x88, 0xde, 0x32, 0xd3, 0x54, 0xfc, 0x39, 0xf0, 0xdd, +0xde, 0xeb, 0x28, 0x26, 0x4f, 0x97, 0xc4, 0x77, 0x88, 0x7f, 0xd5, 0x63, 0xf8, 0xad, 0xe2, 0x60, +0x3c, 0xc2, 0x7e, 0x57, 0x60, 0x23, 0xf9, 0xbf, 0x7a, 0x17, 0xf6, 0xc4, 0x0e, 0x6b, 0xf2, 0x7e, +0x3c, 0xe2, 0x45, 0x2b, 0xe5, 0x98, 0x67, 0xfe, 0x36, 0xbf, 0xf4, 0x9f, 0xf3, 0xfb, 0xbb, 0x9f, +0xb0, 0x78, 0x7b, 0xc2, 0xee, 0x36, 0xcd, 0x71, 0x4b, 0xfc, 0x09, 0xff, 0x00, 0xe9, 0x5f, 0xfc, +0x8f, 0x96, 0xbd, 0x82, 0x8a, 0x28, 0xaf, 0xca, 0xcf, 0xd7, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, +0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0e, 0x17, +0xf6, 0x82, 0xf8, 0x07, 0xe1, 0x9f, 0xda, 0x77, 0xe1, 0x36, 0xad, 0xe0, 0xbf, 0x17, 0x58, 0x8b, +0xfd, 0x17, 0x58, 0x8f, 0x0f, 0xb4, 0xed, 0x9a, 0xda, 0x41, 0xca, 0x4d, 0x13, 0x60, 0xec, 0x95, +0x1b, 0x0c, 0xad, 0x83, 0xc8, 0xc1, 0x04, 0x12, 0x0f, 0xe0, 0x47, 0xed, 0xc5, 0xfb, 0x14, 0x78, +0xa3, 0xf6, 0x18, 0xf8, 0xc9, 0x71, 0xe1, 0x9d, 0x79, 0x5e, 0xf3, 0x49, 0xbe, 0xdd, 0x26, 0x83, +0xae, 0x08, 0xf6, 0xdb, 0x6a, 0xd6, 0xc3, 0x1c, 0x81, 0xce, 0xd9, 0x97, 0x20, 0x49, 0x11, 0x39, +0x46, 0x39, 0xe5, 0x19, 0x1d, 0xbf, 0xa3, 0x1a, 0xf3, 0x3f, 0xda, 0x8b, 0xf6, 0x5a, 0xf0, 0x87, +0xed, 0x81, 0xf0, 0x96, 0xf3, 0xc1, 0xbe, 0x34, 0xb1, 0xfb, 0x55, 0x85, 0xc1, 0xf3, 0xad, 0xae, +0x63, 0xc2, 0xdd, 0x69, 0xb7, 0x00, 0x10, 0x97, 0x10, 0x3e, 0x0e, 0xd9, 0x17, 0x24, 0x74, 0x2a, +0xc0, 0xb2, 0xb0, 0x65, 0x2c, 0xa7, 0xea, 0x38, 0x5f, 0x89, 0x6a, 0x65, 0x55, 0xb9, 0x67, 0x79, +0x52, 0x96, 0xeb, 0xb7, 0x9a, 0xf3, 0x5d, 0x7b, 0xa3, 0xe4, 0xf8, 0xb3, 0x85, 0xe9, 0xe6, 0xf4, +0x2f, 0x0f, 0x76, 0xac, 0x7e, 0x17, 0xdf, 0xfb, 0xaf, 0xc9, 0xfe, 0x0f, 0x54, 0x7f, 0x3f, 0x1f, +0x0d, 0xec, 0x05, 0x8f, 0x85, 0xe3, 0x97, 0x6f, 0xef, 0x2e, 0xa6, 0x79, 0xce, 0x7f, 0xba, 0x3e, +0x45, 0x1f, 0xf8, 0xe9, 0x3f, 0xf0, 0x2a, 0xdf, 0xaf, 0x56, 0xfd, 0xab, 0x3f, 0x62, 0x7f, 0x14, +0x7e, 0xc4, 0xfe, 0x31, 0x87, 0x44, 0xd6, 0xe2, 0xfb, 0x7e, 0x8f, 0x24, 0x4d, 0xfd, 0x95, 0xac, +0xdb, 0x29, 0x58, 0x35, 0x48, 0x91, 0x40, 0xe4, 0x73, 0xe5, 0xca, 0x38, 0x2d, 0x19, 0x24, 0xae, +0x78, 0x2c, 0xa5, 0x58, 0xf9, 0x4d, 0x7f, 0x49, 0x65, 0xd8, 0xaa, 0x18, 0x8c, 0x3c, 0x6b, 0x61, +0xe4, 0xa5, 0x16, 0xb4, 0x68, 0xfe, 0x1b, 0xe2, 0x0c, 0x1e, 0x2b, 0x0d, 0x98, 0xd5, 0xa3, 0x8d, +0x83, 0x84, 0xd4, 0x9d, 0xd3, 0xfc, 0x3d, 0x53, 0x56, 0xb3, 0x5a, 0x3d, 0xd6, 0x81, 0x45, 0x14, +0x57, 0x71, 0xe3, 0x85, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, +0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x40, 0x05, 0x14, 0x51, 0x9c, 0x50, 0x01, 0x45, 0x15, 0x1d, +0xd5, 0xd4, 0x3a, 0x7d, 0xb4, 0x93, 0xcc, 0xd1, 0xac, 0x71, 0xfd, 0xf9, 0x64, 0x60, 0xaa, 0xbf, +0x8f, 0xaf, 0xb7, 0x53, 0xda, 0x93, 0x76, 0x1c, 0x62, 0xdb, 0xb2, 0x24, 0xcd, 0x60, 0xf8, 0xc3, +0xc6, 0xd1, 0x68, 0x29, 0x24, 0x30, 0xaa, 0xcd, 0xa8, 0xf4, 0xd9, 0xd6, 0x3b, 0x6f, 0x77, 0xf7, +0xff, 0x00, 0x67, 0xaf, 0xae, 0x3b, 0xe2, 0xf8, 0x8f, 0xe2, 0x34, 0x97, 0x7b, 0xe1, 0xd3, 0xfc, +0xc4, 0x5e, 0x43, 0xcc, 0xc3, 0x6c, 0xd2, 0x7f, 0xb8, 0x3f, 0x80, 0x63, 0xbf, 0xde, 0xff, 0x00, +0x76, 0xb9, 0x70, 0x3f, 0x3e, 0xa7, 0x3d, 0xcd, 0x70, 0xd6, 0xc5, 0x5f, 0x48, 0x7d, 0xe7, 0xd8, +0xe5, 0x3c, 0x32, 0xe5, 0x6a, 0xd8, 0xcd, 0x17, 0x48, 0xff, 0x00, 0x9f, 0x6f, 0x4f, 0xbf, 0xa0, +0xfb, 0xbb, 0xd9, 0x2f, 0xef, 0x26, 0x9a, 0x76, 0x92, 0xe6, 0x49, 0x8e, 0xe9, 0x24, 0x6e, 0xad, +0xff, 0x00, 0xd6, 0x1d, 0x00, 0x1c, 0x00, 0x30, 0x29, 0x94, 0x51, 0x5c, 0x47, 0xdc, 0xc6, 0x29, +0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x61, 0x45, 0x14, 0x50, 0x01, 0x9a, 0xfa, 0x63, 0xfe, 0x09, +0xa7, 0xff, 0x00, 0x04, 0xe4, 0xd6, 0xbf, 0x6f, 0x1f, 0x89, 0xbe, 0x75, 0xe7, 0xda, 0x34, 0xbf, +0x87, 0x7a, 0x0c, 0x83, 0xfb, 0x73, 0x54, 0x45, 0xda, 0xd2, 0xb7, 0x04, 0x59, 0xdb, 0x92, 0x30, +0x67, 0x60, 0x79, 0x38, 0x22, 0x24, 0x21, 0x8f, 0x26, 0x35, 0x90, 0xff, 0x00, 0x82, 0x73, 0x7f, +0xc1, 0x35, 0x3c, 0x4d, 0xfb, 0x78, 0x78, 0xd7, 0xed, 0x92, 0x79, 0xda, 0x0f, 0xc3, 0xbd, 0x2e, +0x60, 0xba, 0xa6, 0xb8, 0x07, 0xcd, 0x31, 0x18, 0x26, 0xd6, 0xd7, 0x20, 0x89, 0x27, 0x23, 0x19, +0x27, 0xe5, 0x88, 0x1d, 0xcd, 0x93, 0xb2, 0x39, 0x3f, 0x74, 0x7e, 0x10, 0x7c, 0x20, 0xf0, 0xef, +0xc0, 0x6f, 0x87, 0x1a, 0x4f, 0x84, 0xbc, 0x25, 0xa4, 0xdb, 0x68, 0xbe, 0x1f, 0xd1, 0x61, 0xf2, +0x6c, 0xed, 0x21, 0x07, 0x08, 0x32, 0x59, 0x99, 0x98, 0x92, 0x5d, 0xd9, 0x89, 0x66, 0x76, 0x25, +0x99, 0x99, 0x98, 0x92, 0x49, 0x35, 0xf9, 0xef, 0x17, 0xf1, 0x84, 0x70, 0x71, 0x78, 0x3c, 0x1b, +0xbd, 0x57, 0xbb, 0xfe, 0x5f, 0xfe, 0xdb, 0xf2, 0xdd, 0x9f, 0xa3, 0xf0, 0x5f, 0x05, 0xcb, 0x1b, +0x25, 0x8d, 0xc6, 0xab, 0x52, 0x5a, 0xa4, 0xfe, 0xdf, 0xff, 0x00, 0x6b, 0xf9, 0xec, 0x5e, 0xf0, +0x07, 0x80, 0xb4, 0x8f, 0x85, 0x9e, 0x0c, 0xd3, 0x3c, 0x3d, 0xe1, 0xfd, 0x3e, 0xdf, 0x49, 0xd1, +0x74, 0x6b, 0x74, 0xb3, 0xb1, 0xb3, 0x81, 0x76, 0xc7, 0x6f, 0x12, 0x00, 0x15, 0x47, 0x52, 0x7a, +0x75, 0x24, 0x92, 0x49, 0x27, 0x24, 0x93, 0x5b, 0xb4, 0x51, 0x5f, 0x8a, 0xea, 0xdd, 0xde, 0xe7, +0xee, 0xb1, 0x49, 0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x0e, 0x4f, 0xe2, 0xdf, 0xc1, 0xff, 0x00, 0x0e, 0x7c, 0x78, 0xf0, 0x1d, 0xe7, 0x86, 0xfc, +0x55, 0xa5, 0xdb, 0x6a, 0xda, 0x35, 0xf0, 0xf9, 0xe2, 0x94, 0x7c, 0xd1, 0x9c, 0x70, 0xe8, 0xc3, +0x06, 0x37, 0x19, 0x38, 0x65, 0x20, 0x8c, 0xf5, 0xaf, 0xc8, 0xdf, 0xdb, 0x9f, 0xfe, 0x09, 0xb5, +0xe2, 0x8f, 0xd9, 0x17, 0x52, 0xba, 0xd6, 0x34, 0xcf, 0x37, 0xc4, 0x3e, 0x01, 0x95, 0xc7, 0x93, +0xa9, 0xec, 0xfd, 0xfd, 0x86, 0x7a, 0x47, 0x72, 0x07, 0xdc, 0xf4, 0xf3, 0x06, 0x11, 0xb8, 0xfb, +0x8c, 0x42, 0x0f, 0xd9, 0xea, 0xa5, 0xa8, 0x69, 0xd1, 0x6a, 0xd6, 0x93, 0x5b, 0x5c, 0x43, 0x1d, +0xc5, 0xad, 0xc2, 0x18, 0xa5, 0x8a, 0x55, 0x0d, 0x1c, 0xa8, 0xc3, 0x05, 0x4a, 0x9e, 0x08, 0x20, +0xf4, 0x3d, 0x6b, 0xe9, 0x38, 0x73, 0x8a, 0x31, 0x79, 0x3d, 0x5b, 0xd2, 0x7c, 0xd4, 0xdf, 0xc5, +0x17, 0xb3, 0xf3, 0x5d, 0x9f, 0x9a, 0xf9, 0xdc, 0xf8, 0x9e, 0x34, 0xe0, 0x3c, 0xbb, 0x88, 0xe8, +0x72, 0xe2, 0x17, 0x2d, 0x58, 0xfc, 0x35, 0x16, 0xeb, 0xc9, 0xf7, 0x8f, 0x93, 0xf9, 0x59, 0x9f, +0xce, 0xc0, 0x39, 0xa2, 0xbf, 0x47, 0xbf, 0x6e, 0xdf, 0xf8, 0x23, 0x8a, 0x6a, 0x1f, 0x6b, 0xf1, +0x57, 0xc1, 0xcb, 0x58, 0x61, 0xbd, 0x62, 0x67, 0xba, 0xf0, 0xcc, 0x93, 0xac, 0x51, 0xcc, 0x7a, +0x9f, 0xb1, 0xc8, 0xe4, 0x2a, 0x37, 0x5f, 0xdd, 0x48, 0xc1, 0x39, 0xf9, 0x5d, 0x00, 0x0a, 0x7f, +0x37, 0x75, 0xb9, 0x9b, 0xc2, 0x7e, 0x27, 0xbc, 0xd1, 0x75, 0xa8, 0x6f, 0x74, 0x1d, 0x7b, 0x4f, +0x7f, 0x2e, 0xf7, 0x4c, 0xd5, 0x23, 0x6b, 0x3b, 0x88, 0x5b, 0xd1, 0x96, 0x40, 0x30, 0x70, 0x41, +0xea, 0x72, 0x0d, 0x7f, 0x41, 0xe4, 0x9c, 0x4d, 0x81, 0xcd, 0x69, 0x73, 0xe1, 0xa7, 0xef, 0x75, +0x8b, 0xd1, 0xaf, 0x97, 0x6f, 0x35, 0xa1, 0xfc, 0x7f, 0xc4, 0xfc, 0x07, 0x9c, 0x64, 0x55, 0x9c, +0x31, 0x74, 0x9b, 0x87, 0x49, 0xc6, 0xee, 0x2f, 0xe7, 0xd1, 0xf9, 0x3b, 0x3e, 0xd7, 0x24, 0xcd, +0x14, 0x44, 0xdb, 0x51, 0x5d, 0x79, 0x56, 0x19, 0x04, 0x74, 0x3f, 0x8d, 0x19, 0xc5, 0x7d, 0x09, +0xf1, 0xa1, 0x45, 0x19, 0xa3, 0x34, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x46, 0x68, 0xcd, 0x00, +0x14, 0x50, 0x73, 0x8c, 0xf6, 0xee, 0x7d, 0x2b, 0x37, 0x51, 0xf1, 0x8e, 0x99, 0xa6, 0x1d, 0xb3, +0x5c, 0xdb, 0xbc, 0x83, 0x83, 0x1c, 0x07, 0xce, 0x7c, 0xfa, 0x61, 0x72, 0x07, 0xfc, 0x08, 0x8a, +0x99, 0x4d, 0x47, 0x56, 0x6b, 0x46, 0x85, 0x4a, 0xaf, 0x96, 0x94, 0x5b, 0x7e, 0x49, 0xb3, 0x4a, +0x9a, 0xcd, 0xe4, 0x87, 0x63, 0x22, 0xc5, 0x1c, 0x63, 0x2c, 0xec, 0xdb, 0x55, 0x47, 0xb9, 0xe9, +0x5c, 0x6e, 0xab, 0xf1, 0x4d, 0xe4, 0xdd, 0xf6, 0x2b, 0x3f, 0x2f, 0xb7, 0x9b, 0x29, 0xcb, 0x0f, +0xf8, 0x02, 0x9c, 0x67, 0xfe, 0x04, 0x7e, 0x95, 0xcd, 0xea, 0x7a, 0xad, 0xe6, 0xb6, 0x73, 0x75, +0x71, 0x3c, 0x98, 0x39, 0x54, 0x63, 0x88, 0xd7, 0xe8, 0xa3, 0x81, 0xf5, 0xc5, 0x72, 0xd4, 0xc5, +0x45, 0x7c, 0x3a, 0x9f, 0x43, 0x83, 0xe1, 0x7c, 0x55, 0x5f, 0x7a, 0xb7, 0xb8, 0xbf, 0x1f, 0xbb, +0xfe, 0x09, 0xd9, 0xeb, 0x9f, 0x13, 0x2d, 0x6c, 0x83, 0x2d, 0x8c, 0x7f, 0x6c, 0x91, 0x78, 0xf3, +0x0e, 0x55, 0x10, 0xfd, 0x7a, 0xb7, 0xe1, 0x80, 0x7b, 0x35, 0x71, 0xba, 0xd6, 0xb3, 0x77, 0xad, +0xdc, 0x09, 0x2e, 0xa6, 0x92, 0x7d, 0xa4, 0x94, 0x8f, 0xee, 0xc7, 0x17, 0xfb, 0xab, 0xd0, 0x7f, +0x33, 0xdc, 0x9a, 0xac, 0x3a, 0x51, 0x5c, 0x75, 0x2a, 0x4a, 0x5b, 0x9f, 0x65, 0x81, 0xc9, 0xf0, +0xd8, 0x45, 0xfb, 0xb5, 0xef, 0x77, 0x7b, 0xff, 0x00, 0xc0, 0x0a, 0x28, 0xa2, 0xb3, 0x3d, 0x40, +0xa2, 0x8a, 0x33, 0x40, 0x05, 0x14, 0x57, 0x45, 0xf0, 0xa7, 0xe1, 0x17, 0x89, 0xfe, 0x39, 0xf8, +0xea, 0xd3, 0xc3, 0x5e, 0x0d, 0xd0, 0x75, 0x4f, 0x11, 0x6b, 0x97, 0xdc, 0xa5, 0x95, 0x8a, 0x6e, +0x60, 0x01, 0x00, 0xb3, 0x1e, 0x15, 0x22, 0x19, 0x19, 0x91, 0x88, 0x51, 0x9e, 0x48, 0xac, 0xea, +0x54, 0x85, 0x38, 0xb9, 0xcd, 0xd9, 0x2d, 0xdb, 0xd1, 0x23, 0x4a, 0x74, 0xa7, 0x52, 0x6a, 0x14, +0xd3, 0x6d, 0xec, 0x92, 0xbb, 0x7e, 0x89, 0x1c, 0xe9, 0x6d, 0xa3, 0xe9, 0x5f, 0x70, 0x7f, 0xc1, +0x36, 0x3f, 0xe0, 0x8e, 0x9a, 0xf7, 0xed, 0x43, 0x36, 0x9f, 0xe3, 0x3f, 0x88, 0x90, 0xea, 0x1e, +0x18, 0xf8, 0x73, 0xb5, 0x67, 0x82, 0xd8, 0x9f, 0x2f, 0x50, 0xf1, 0x22, 0x9e, 0x9e, 0x57, 0x78, +0x2d, 0xcf, 0x53, 0x36, 0x37, 0x3a, 0x91, 0xe5, 0x8f, 0x98, 0x4a, 0x9f, 0x54, 0x7f, 0xc1, 0x3e, +0xff, 0x00, 0xe0, 0x86, 0xfe, 0x1f, 0xf8, 0x2b, 0x35, 0x9f, 0x8a, 0xbe, 0x2c, 0x7f, 0x66, 0xf8, +0xbb, 0xc5, 0x51, 0x85, 0x92, 0xd7, 0x46, 0x54, 0xf3, 0x34, 0x8d, 0x29, 0xba, 0xfe, 0xf0, 0x37, +0xfc, 0x7d, 0x4c, 0x3d, 0x58, 0x08, 0xd4, 0x9e, 0x15, 0xc8, 0x12, 0x57, 0xe8, 0x60, 0xaf, 0xca, +0xf8, 0x93, 0x8f, 0x53, 0x4f, 0x0d, 0x96, 0x3f, 0x27, 0x3f, 0xfe, 0x47, 0xfc, 0xfe, 0xee, 0xe7, +0xeb, 0x9c, 0x2f, 0xe1, 0xef, 0x2b, 0x58, 0xac, 0xd5, 0x79, 0xa8, 0x7f, 0xf2, 0x4f, 0xf4, 0x5f, +0x3e, 0xc6, 0x0f, 0x80, 0x7e, 0x1f, 0xe8, 0xbf, 0x0b, 0x3c, 0x23, 0x61, 0xe1, 0xff, 0x00, 0x0e, +0xe9, 0x96, 0x7a, 0x3e, 0x87, 0xa4, 0xc2, 0x20, 0xb2, 0xb1, 0xb4, 0x8c, 0x47, 0x0d, 0xbc, 0x63, +0x3c, 0x2a, 0x8f, 0x52, 0x49, 0x27, 0xa9, 0x24, 0x92, 0x49, 0x24, 0xd6, 0xf5, 0x14, 0x57, 0xe5, +0x7a, 0xb7, 0x77, 0xb9, 0xfa, 0xe2, 0x49, 0x2b, 0x2d, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0xbc, 0x5f, +0xf6, 0xb0, 0xfd, 0x83, 0xfe, 0x1a, 0xfe, 0xda, 0x5e, 0x1d, 0x5b, 0x3f, 0x1b, 0x68, 0x4b, 0x26, +0xa1, 0x04, 0x46, 0x3b, 0x2d, 0x66, 0xc4, 0x8b, 0x7d, 0x53, 0x4f, 0x1c, 0xff, 0x00, 0xab, 0x9b, +0x07, 0x2a, 0x09, 0x27, 0xcb, 0x90, 0x3c, 0x64, 0xf2, 0x50, 0x91, 0x5e, 0xd1, 0x45, 0x6b, 0x42, +0xbd, 0x5a, 0x35, 0x15, 0x5a, 0x32, 0x71, 0x92, 0xd9, 0xad, 0x19, 0x8e, 0x23, 0x0f, 0x4a, 0xbd, +0x37, 0x4a, 0xb4, 0x54, 0xa2, 0xf7, 0x4d, 0x5d, 0x1f, 0x87, 0xff, 0x00, 0xb5, 0xa7, 0xfc, 0x11, +0x3f, 0xe2, 0xd7, 0xec, 0xcf, 0x25, 0xd6, 0xad, 0xe0, 0x76, 0xba, 0xf8, 0x8d, 0xe1, 0x75, 0x25, +0xf7, 0xe9, 0x11, 0xb4, 0x3a, 0xb5, 0xaa, 0xf0, 0x7f, 0x7b, 0x6a, 0xac, 0x4c, 0x83, 0xb6, 0x61, +0x32, 0x13, 0x82, 0x4a, 0x20, 0xe2, 0xbe, 0x45, 0x8f, 0xc7, 0x7a, 0xc6, 0x99, 0x70, 0xd6, 0xf2, +0x4d, 0xfb, 0xe8, 0x9b, 0x63, 0xc7, 0x71, 0x6e, 0x8c, 0xc8, 0x54, 0xe0, 0x83, 0xc0, 0x6c, 0xe7, +0x83, 0x93, 0x9e, 0x2b, 0xfa, 0x7a, 0xaf, 0x0b, 0xfd, 0xa8, 0xbf, 0xe0, 0x9d, 0x9f, 0x08, 0xff, +0x00, 0x6c, 0x0b, 0x69, 0x64, 0xf1, 0x87, 0x85, 0xad, 0xff, 0x00, 0xb6, 0xd9, 0x42, 0x26, 0xb9, +0xa7, 0x1f, 0xb1, 0xea, 0x91, 0xe0, 0x60, 0x66, 0x65, 0x1f, 0xbd, 0x00, 0x74, 0x59, 0x43, 0xa8, +0xcf, 0x4c, 0xf3, 0x5f, 0xa4, 0x64, 0xde, 0x23, 0xd6, 0xa5, 0x6a, 0x79, 0x84, 0x79, 0x97, 0xf3, +0x47, 0x47, 0xf3, 0x5b, 0x3f, 0x95, 0x8f, 0xca, 0x78, 0x83, 0xc2, 0x8c, 0x16, 0x29, 0xba, 0xb8, +0x1b, 0x27, 0xfc, 0xb2, 0x57, 0x5f, 0x27, 0x67, 0x25, 0xf8, 0x9f, 0x80, 0x90, 0x7c, 0x53, 0xbc, +0x8c, 0x01, 0x25, 0x9d, 0xbc, 0xde, 0xa5, 0x3c, 0xc8, 0xc9, 0xfc, 0xd8, 0xff, 0x00, 0x9e, 0xd5, +0x3c, 0x5f, 0x16, 0x5c, 0x75, 0xd2, 0xd1, 0x86, 0x31, 0xc4, 0xe4, 0x7f, 0xec, 0xa6, 0xbe, 0xe6, +0xfd, 0xa3, 0xbf, 0xe0, 0xde, 0x5f, 0x1b, 0x78, 0x45, 0xae, 0xaf, 0xbe, 0x17, 0x78, 0xa3, 0x4d, +0xf1, 0x75, 0x8a, 0x82, 0xc9, 0xa6, 0x6a, 0xdb, 0x74, 0xfd, 0x47, 0x1d, 0x94, 0x4b, 0xcc, 0x13, +0x37, 0xfb, 0x4c, 0x61, 0x1e, 0xdc, 0x73, 0xf0, 0xff, 0x00, 0xc6, 0x5f, 0xd9, 0xd7, 0xc7, 0xbf, +0xb3, 0xc6, 0xab, 0xf6, 0x4f, 0x1d, 0x78, 0x37, 0x5e, 0xf0, 0xa3, 0x6f, 0xd8, 0xad, 0xa8, 0x58, +0xb2, 0xdb, 0x4a, 0x7f, 0xe9, 0x94, 0xdf, 0xea, 0xa5, 0xef, 0xfe, 0xad, 0x88, 0xe2, 0xbf, 0x4c, +0xcb, 0x78, 0x9b, 0x07, 0x8d, 0x5f, 0xec, 0xd5, 0x93, 0x7d, 0x9e, 0x8f, 0xee, 0x7a, 0xfe, 0x87, +0xe4, 0x39, 0xaf, 0x87, 0xb2, 0xc1, 0x3f, 0xf6, 0xac, 0x2b, 0x4b, 0xba, 0xbf, 0x2f, 0xde, 0x9d, +0xbe, 0xfd, 0x7f, 0x10, 0xff, 0x00, 0x85, 0xb9, 0x1f, 0xfd, 0x03, 0x26, 0xff, 0x00, 0xbf, 0xa3, +0xff, 0x00, 0x88, 0xa8, 0xe6, 0xf8, 0xb4, 0xce, 0x7f, 0xe4, 0x1e, 0xab, 0xfe, 0xfd, 0xc6, 0x73, +0xf8, 0x6d, 0xe2, 0xb9, 0x10, 0xd9, 0x14, 0x67, 0x15, 0xec, 0xfd, 0x62, 0xa7, 0x73, 0xc1, 0x5c, +0x39, 0x97, 0xf5, 0x85, 0xfe, 0x72, 0xff, 0x00, 0x33, 0xa6, 0x9f, 0xe2, 0xad, 0xdb, 0xa3, 0x08, +0xed, 0xed, 0xe1, 0xdd, 0xff, 0x00, 0x3d, 0x0b, 0xc9, 0x8f, 0xc8, 0xaf, 0x35, 0x4a, 0xeb, 0xe2, +0x0e, 0xaf, 0x71, 0x9d, 0xb7, 0x31, 0xc6, 0x84, 0xf2, 0xb0, 0x40, 0x83, 0xf5, 0x60, 0x5b, 0xf5, +0xac, 0x6a, 0x33, 0x52, 0xea, 0xcd, 0xf5, 0x3a, 0x69, 0xe4, 0xd8, 0x28, 0x3b, 0xaa, 0x4b, 0xee, +0xbf, 0xe7, 0x72, 0x5b, 0xed, 0x46, 0xe3, 0x53, 0xff, 0x00, 0x8f, 0xab, 0xab, 0xc9, 0xb9, 0xe9, +0x34, 0xc6, 0x41, 0xf8, 0x03, 0xc0, 0xa8, 0x80, 0xc0, 0xa2, 0x8a, 0xcc, 0xf4, 0x63, 0x08, 0xc5, +0x5a, 0x2a, 0xcb, 0xc8, 0x28, 0xa2, 0x8a, 0x0a, 0x0a, 0x28, 0xcd, 0x14, 0x00, 0x51, 0x9c, 0x52, +0x33, 0x05, 0x1c, 0xf1, 0x5e, 0x91, 0xf0, 0x23, 0xf6, 0x3e, 0xf8, 0xa1, 0xfb, 0x4e, 0x5c, 0xa2, +0x78, 0x13, 0xc0, 0x7a, 0xe7, 0x88, 0x2d, 0x5c, 0xed, 0xfb, 0x7a, 0x5a, 0xf9, 0x56, 0x20, 0xfb, +0xdc, 0xcc, 0x56, 0x10, 0x7d, 0x8b, 0xe7, 0x83, 0xd6, 0xb1, 0xaf, 0x88, 0xa5, 0x46, 0x3c, 0xf5, +0xa4, 0xa2, 0xbb, 0xb6, 0x92, 0xfc, 0x4d, 0xb0, 0xf8, 0x6a, 0xd5, 0xe6, 0xa9, 0xd0, 0x8b, 0x93, +0xec, 0x93, 0x6f, 0xee, 0x47, 0x9c, 0x1a, 0xb1, 0xa1, 0xe8, 0x97, 0xde, 0x26, 0xd6, 0x2d, 0x74, +0xdd, 0x2e, 0xce, 0xe3, 0x52, 0xd4, 0x2f, 0xdc, 0x47, 0x67, 0x63, 0x63, 0x13, 0x5d, 0x5d, 0x4c, +0xe7, 0xf8, 0x51, 0x14, 0x16, 0x66, 0x3d, 0x80, 0x19, 0x35, 0xfa, 0x53, 0xfb, 0x36, 0x7f, 0xc1, +0xba, 0xfa, 0xa6, 0xa6, 0xf6, 0xf7, 0xdf, 0x16, 0x3c, 0x69, 0x0e, 0x9f, 0x06, 0x03, 0x1d, 0x2b, +0xc3, 0xa3, 0xcf, 0xb8, 0x6c, 0xf3, 0x86, 0xba, 0x95, 0x7c, 0xb8, 0xc8, 0xe8, 0x42, 0x44, 0xf9, +0xcf, 0x0e, 0x3a, 0x9f, 0xd0, 0xbf, 0xd9, 0xc3, 0xf6, 0x2f, 0xf8, 0x67, 0xfb, 0x25, 0x69, 0x0d, +0x6b, 0xe0, 0x2f, 0x08, 0xe9, 0x7a, 0x1c, 0xf2, 0x26, 0xc9, 0xaf, 0xf6, 0x9b, 0x8d, 0x42, 0xe8, +0x70, 0x71, 0x25, 0xc4, 0x84, 0xc8, 0xc3, 0x23, 0x3b, 0x37, 0x04, 0x07, 0xa0, 0x02, 0xbe, 0x1f, +0x35, 0xf1, 0x07, 0x01, 0x87, 0x4e, 0x38, 0x5f, 0xde, 0x4b, 0xcb, 0x48, 0xfd, 0xef, 0xf4, 0x4f, +0xd5, 0x1f, 0x7d, 0x94, 0xf8, 0x6f, 0x98, 0x62, 0x5a, 0x9e, 0x31, 0xfb, 0x28, 0xfd, 0xf2, 0xfb, +0x96, 0xdf, 0x37, 0xf2, 0x67, 0xe5, 0xef, 0xec, 0x7d, 0xff, 0x00, 0x04, 0x14, 0xf1, 0xd7, 0xc5, +0x89, 0x2d, 0x35, 0x6f, 0x8a, 0x57, 0x92, 0x78, 0x03, 0xc3, 0xad, 0xb5, 0xff, 0x00, 0xb3, 0x60, +0xd9, 0x2e, 0xb5, 0x78, 0xa7, 0x9e, 0x47, 0x31, 0x5b, 0x67, 0xd6, 0x4d, 0xee, 0x08, 0xc1, 0x8c, +0x75, 0xaf, 0xd5, 0x2f, 0xd9, 0xdb, 0xf6, 0x56, 0xf0, 0x0f, 0xec, 0xa1, 0xe0, 0xbf, 0xec, 0x1f, +0x00, 0xf8, 0x73, 0x4f, 0xd0, 0x6c, 0xe4, 0xc1, 0xba, 0x96, 0x35, 0x32, 0x5d, 0x5f, 0xb8, 0xce, +0x1e, 0x79, 0x9b, 0x2f, 0x2b, 0x72, 0x71, 0xb8, 0x90, 0xa3, 0x85, 0x00, 0x60, 0x57, 0xa4, 0x51, +0x5f, 0x96, 0xe7, 0x1c, 0x45, 0x8e, 0xcc, 0x9f, 0xfb, 0x44, 0xfd, 0xde, 0x91, 0x5a, 0x2f, 0xbb, +0xab, 0xf3, 0x67, 0xeb, 0x59, 0x2f, 0x0d, 0x65, 0xf9, 0x5c, 0x7f, 0xd9, 0xa1, 0xef, 0x75, 0x93, +0xd6, 0x4f, 0xe7, 0xd1, 0x79, 0x2b, 0x20, 0xa2, 0x8a, 0x2b, 0xc3, 0x3d, 0xe0, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, +0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xaa, 0xba, 0xa6, +0x99, 0x06, 0xb3, 0x63, 0x25, 0xad, 0xdc, 0x10, 0xdd, 0x5a, 0xdc, 0x2e, 0xc9, 0x61, 0x96, 0x31, +0x24, 0x72, 0x29, 0xea, 0x19, 0x4f, 0x04, 0x7d, 0x6a, 0xd5, 0x14, 0x80, 0xf9, 0x9f, 0xe3, 0x07, +0xfc, 0x12, 0x3b, 0xf6, 0x7d, 0xf8, 0xce, 0xf3, 0x4d, 0x79, 0xf0, 0xf3, 0x4c, 0xd0, 0xef, 0xa4, +0x1f, 0xf1, 0xf5, 0xe1, 0xf6, 0x7d, 0x29, 0x94, 0xf1, 0x93, 0xe5, 0xc2, 0x56, 0x16, 0x3c, 0x75, +0x78, 0xcf, 0x52, 0x7a, 0x92, 0x6b, 0xe6, 0x7f, 0x89, 0xbf, 0xf0, 0x6d, 0xf7, 0x85, 0xef, 0x99, +0xe4, 0xf0, 0x6f, 0xc4, 0xef, 0x10, 0x69, 0x39, 0xe5, 0x63, 0xd6, 0xf4, 0xd8, 0x75, 0x1d, 0xc7, +0x1f, 0x77, 0x7c, 0x46, 0x0c, 0x0c, 0xf7, 0xda, 0xd8, 0x1d, 0x89, 0xe6, 0xbf, 0x4c, 0x28, 0xc5, +0x7b, 0x78, 0x3e, 0x23, 0xcd, 0x30, 0xda, 0x51, 0xaf, 0x2b, 0x76, 0x7a, 0xaf, 0xb9, 0xdc, 0xf0, +0xf1, 0xbc, 0x33, 0x95, 0x62, 0xdd, 0xeb, 0xd0, 0x8d, 0xfb, 0xa5, 0x67, 0xf7, 0xab, 0x33, 0xf1, +0x67, 0xc6, 0xdf, 0xf0, 0x6f, 0x47, 0xc6, 0xaf, 0x0e, 0x34, 0x92, 0x68, 0xfa, 0xf7, 0xc3, 0xdf, +0x10, 0x5b, 0x29, 0x1b, 0x40, 0xbe, 0xb8, 0xb5, 0xba, 0x6f, 0x7d, 0xb2, 0x42, 0x63, 0x1f, 0xf7, +0xf2, 0xbc, 0xbb, 0xc4, 0x7f, 0xf0, 0x46, 0x9f, 0xda, 0x53, 0xc3, 0x0f, 0x3b, 0x3f, 0xc3, 0x57, +0xbf, 0xb7, 0x4f, 0xe3, 0xb1, 0xd5, 0xf4, 0xf9, 0xf7, 0xfd, 0x17, 0xcf, 0xf3, 0x3f, 0xf1, 0xda, +0xfd, 0xf7, 0xa2, 0xbd, 0xfa, 0x3e, 0x21, 0x66, 0xb0, 0x56, 0x9f, 0x2c, 0xbd, 0x63, 0xfe, 0x4d, +0x1f, 0x3b, 0x5b, 0xc3, 0x7c, 0xa2, 0x7f, 0x07, 0x3c, 0x7d, 0x25, 0xfe, 0x69, 0x9f, 0xce, 0xce, +0xa5, 0xff, 0x00, 0x04, 0xd5, 0xf8, 0xfd, 0xa4, 0x03, 0xe7, 0x7c, 0x21, 0xf1, 0xa3, 0x60, 0xe3, +0xf7, 0x76, 0x1f, 0x68, 0xff, 0x00, 0xd1, 0x79, 0xaa, 0x3f, 0xf0, 0xef, 0x5f, 0x8f, 0x1f, 0xf4, +0x48, 0xfe, 0x22, 0x7f, 0xe0, 0x8e, 0x7f, 0xfe, 0x22, 0xbf, 0xa3, 0x4a, 0x2b, 0xb6, 0x3e, 0x24, +0x63, 0x7a, 0xd2, 0x87, 0xe3, 0xfe, 0x67, 0x0c, 0xbc, 0x2f, 0xcb, 0xfa, 0x55, 0x9f, 0xe1, 0xfe, +0x47, 0xf3, 0xb9, 0xa6, 0xff, 0x00, 0xc1, 0x33, 0xff, 0x00, 0x68, 0x1d, 0x56, 0x35, 0x68, 0x7e, +0x11, 0xf8, 0xc4, 0x6e, 0xe9, 0xe6, 0x59, 0x8b, 0x6f, 0xcf, 0xcc, 0x23, 0x15, 0xda, 0xf8, 0x6f, +0xfe, 0x08, 0xaf, 0xfb, 0x49, 0xf8, 0x8a, 0x58, 0x55, 0xfe, 0x1f, 0x2e, 0x97, 0x6e, 0xc3, 0x3e, +0x65, 0xfe, 0xbd, 0xa7, 0x85, 0x1f, 0x50, 0x93, 0x34, 0x83, 0xfe, 0xf8, 0xaf, 0xde, 0xea, 0x2b, +0x1a, 0x9e, 0x23, 0x66, 0x2f, 0xe0, 0x84, 0x17, 0xc9, 0xbf, 0xfd, 0xb8, 0xda, 0x9f, 0x86, 0x39, +0x62, 0xf8, 0xea, 0x4d, 0xfc, 0xd2, 0xff, 0x00, 0xdb, 0x6f, 0xf8, 0x9f, 0x8c, 0xbe, 0x05, 0xff, +0x00, 0x83, 0x77, 0x3e, 0x2f, 0x6b, 0x2d, 0x1c, 0x9a, 0xff, 0x00, 0x8a, 0xbe, 0x1f, 0xe8, 0x31, +0x48, 0x32, 0x7c, 0x99, 0xee, 0x6f, 0xee, 0x63, 0xf6, 0x2b, 0xe5, 0x22, 0x7e, 0x52, 0x1a, 0xf7, +0xaf, 0x86, 0x3f, 0xf0, 0x6e, 0x37, 0x80, 0xb4, 0x56, 0x59, 0x3c, 0x61, 0xf1, 0x07, 0xc5, 0x5e, +0x22, 0x74, 0x39, 0xd9, 0xa6, 0x59, 0xc1, 0xa4, 0xc6, 0xfc, 0xf4, 0x21, 0xbc, 0xf6, 0xc6, 0x38, +0xf9, 0x58, 0x1f, 0x71, 0xd2, 0xbf, 0x48, 0x28, 0xaf, 0x27, 0x15, 0xc6, 0xb9, 0xc5, 0x6d, 0x3d, +0xaf, 0x2a, 0xfe, 0xea, 0x4b, 0xf1, 0xdf, 0xf1, 0x3d, 0x8c, 0x2f, 0x02, 0xe4, 0xb4, 0x35, 0x54, +0x79, 0x9f, 0xf7, 0x9b, 0x7f, 0x86, 0xdf, 0x81, 0xf3, 0xef, 0xc1, 0x8f, 0xf8, 0x26, 0x07, 0xc0, +0x7f, 0x81, 0x4d, 0x0c, 0xfa, 0x27, 0xc3, 0x7d, 0x06, 0xea, 0xfa, 0x2c, 0x15, 0xbd, 0xd6, 0x11, +0xb5, 0x6b, 0x95, 0x71, 0x8f, 0x9d, 0x5e, 0xe4, 0xbf, 0x96, 0x78, 0xff, 0x00, 0x96, 0x61, 0x40, +0xc9, 0xc6, 0x32, 0x6b, 0xdf, 0x62, 0x84, 0x42, 0x9e, 0x5a, 0x61, 0x51, 0x46, 0x14, 0x0e, 0xc3, +0xd2, 0xa5, 0xa2, 0xbe, 0x6f, 0x11, 0x88, 0xad, 0x5e, 0x5c, 0xf5, 0xe6, 0xe4, 0xfc, 0xdb, 0x7f, +0x99, 0xf5, 0x18, 0x7c, 0x2d, 0x1c, 0x3c, 0x79, 0x28, 0x41, 0x45, 0x76, 0x49, 0x2f, 0xc8, 0x28, +0xa2, 0x8a, 0xc4, 0xd8, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, 0xa2, 0x8a, 0x00, +0x28, 0xa2, 0xbf, 0x3a, 0xff, 0x00, 0xe0, 0xae, 0x5f, 0xf0, 0x70, 0x5f, 0x80, 0x7f, 0xe0, 0x9d, +0xba, 0x85, 0xc7, 0x81, 0xbc, 0x2d, 0x61, 0x6d, 0xf1, 0x1f, 0xe2, 0xf2, 0x44, 0x4c, 0xfa, 0x54, +0x77, 0x7e, 0x56, 0x9d, 0xe1, 0xbd, 0xca, 0x0a, 0x35, 0xfc, 0xca, 0x09, 0xf3, 0x08, 0x21, 0xc5, +0xb4, 0x7f, 0xbc, 0x65, 0x00, 0xbb, 0x40, 0xb2, 0x46, 0xee, 0x5c, 0x0f, 0xd1, 0x4a, 0xa7, 0x75, +0xab, 0x5b, 0x58, 0x36, 0xcb, 0x8b, 0x8b, 0x78, 0x59, 0x86, 0x54, 0x49, 0x20, 0x52, 0x47, 0xae, +0x09, 0xaf, 0xe4, 0x97, 0xf6, 0xad, 0xff, 0x00, 0x82, 0xc2, 0x7e, 0xd2, 0x5f, 0xb6, 0x5e, 0xa7, +0x70, 0xfe, 0x30, 0xf8, 0xa9, 0xe2, 0x4b, 0x1d, 0x26, 0x7c, 0xaa, 0xe8, 0x3e, 0x1b, 0xb8, 0x7d, +0x0f, 0x48, 0x8e, 0x32, 0x73, 0xe5, 0x98, 0x6d, 0xd9, 0x5a, 0x75, 0x07, 0x90, 0x6e, 0x5e, 0x67, +0x18, 0x1f, 0x37, 0x03, 0x1f, 0x2f, 0xcd, 0xa2, 0xd9, 0xdc, 0xcf, 0x24, 0xb2, 0xda, 0xdb, 0xc9, +0x2c, 0xce, 0x64, 0x91, 0xde, 0x30, 0xcd, 0x23, 0x1e, 0x4b, 0x31, 0x23, 0x24, 0x9e, 0xe4, 0xf5, +0xa8, 0x72, 0x0e, 0x64, 0x8f, 0xed, 0xdb, 0xfe, 0x12, 0x3d, 0x3f, 0xfe, 0x7f, 0xb4, 0xff, 0x00, +0xfb, 0xfc, 0x9f, 0xe3, 0x47, 0xfc, 0x24, 0x7a, 0x7f, 0xfc, 0xff, 0x00, 0x69, 0xff, 0x00, 0xf7, +0xf9, 0x3f, 0xc6, 0xbf, 0x88, 0x7f, 0xf8, 0x47, 0xec, 0x3f, 0xe7, 0xc6, 0xcf, 0xfe, 0xfc, 0xaf, +0xf8, 0x51, 0xff, 0x00, 0x08, 0xfd, 0x87, 0xfc, 0xf8, 0xd9, 0xff, 0x00, 0xdf, 0x95, 0xff, 0x00, +0x0a, 0x5a, 0x87, 0x3a, 0xec, 0x7f, 0x6f, 0x1f, 0xf0, 0x91, 0xe9, 0xff, 0x00, 0xf3, 0xfd, 0xa7, +0xff, 0x00, 0xdf, 0xe4, 0xff, 0x00, 0x1a, 0x3f, 0xe1, 0x23, 0xd3, 0xff, 0x00, 0xe7, 0xfb, 0x4f, +0xff, 0x00, 0xbf, 0xc9, 0xfe, 0x35, 0xfc, 0x43, 0xff, 0x00, 0xc2, 0x3f, 0x61, 0xff, 0x00, 0x3e, +0x36, 0x7f, 0xf7, 0xe5, 0x7f, 0xc2, 0x83, 0xe1, 0xfb, 0x0c, 0x7f, 0xc7, 0x8d, 0x9f, 0xfd, 0xf9, +0x5f, 0xf0, 0xa3, 0x50, 0xe7, 0x5d, 0x8f, 0xee, 0x0a, 0xca, 0xfe, 0x3d, 0x42, 0x2d, 0xf0, 0xc9, +0x1c, 0xa9, 0x9c, 0x6e, 0x47, 0x0c, 0xb9, 0xf4, 0xc8, 0xae, 0x0b, 0xf6, 0xa5, 0xfd, 0xa8, 0x7c, +0x17, 0xfb, 0x19, 0xfc, 0x0b, 0xd6, 0xbe, 0x24, 0x7c, 0x44, 0xd5, 0xa5, 0xd1, 0x3c, 0x1f, 0xe1, +0xd6, 0xb6, 0x5d, 0x42, 0xf6, 0x2b, 0x29, 0xaf, 0x1a, 0x13, 0x71, 0x73, 0x15, 0xac, 0x58, 0x8a, +0x14, 0x79, 0x1b, 0x74, 0xd3, 0xc6, 0xbf, 0x2a, 0x9c, 0x6e, 0xc9, 0xc0, 0x04, 0xd7, 0xc4, 0x3f, +0xf0, 0x6a, 0xa5, 0xb4, 0x76, 0xbf, 0xf0, 0x49, 0x6d, 0x2d, 0x22, 0x8d, 0x23, 0x5f, 0xf8, 0x4a, +0xf5, 0x9f, 0x95, 0x17, 0x68, 0xff, 0x00, 0x5e, 0x2b, 0xb4, 0xff, 0x00, 0x83, 0x97, 0x3f, 0xe5, +0x0a, 0xbf, 0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x75, 0x5d, 0x02, 0xfd, 0x4a, +0x5f, 0xf1, 0x13, 0x4f, 0xec, 0x67, 0xff, 0x00, 0x45, 0x3b, 0x57, 0xff, 0x00, 0xc2, 0x27, 0x5c, +0xff, 0x00, 0xe4, 0x4a, 0xbd, 0xe1, 0xaf, 0xf8, 0x39, 0x1f, 0xf6, 0x3d, 0xf1, 0x7f, 0x89, 0x74, +0xdd, 0x23, 0x4f, 0xf8, 0x93, 0xab, 0x4f, 0xa8, 0x6a, 0xd7, 0x70, 0xd8, 0xda, 0xc6, 0x7c, 0x19, +0xad, 0x46, 0x24, 0x9a, 0x57, 0x58, 0xd1, 0x4b, 0x35, 0xa8, 0x55, 0xcb, 0x30, 0x19, 0x24, 0x01, +0x9e, 0x4d, 0x7f, 0x2d, 0xf5, 0xd8, 0x7e, 0xce, 0xff, 0x00, 0xf2, 0x71, 0x3f, 0x0f, 0x7f, 0xec, +0x6a, 0xd2, 0x7f, 0xf4, 0xb6, 0x2a, 0x90, 0xe7, 0x3f, 0xb4, 0xca, 0x28, 0xa2, 0xb4, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x00, 0xa2, 0x8a, 0x28, 0x02, 0x1b, +0xdb, 0xf8, 0xf4, 0xf8, 0xb7, 0xcd, 0x24, 0x71, 0x26, 0x71, 0xb9, 0xdc, 0x2a, 0xe7, 0xd3, 0x26, +0xaa, 0xff, 0x00, 0xc2, 0x47, 0xa7, 0xff, 0x00, 0xcf, 0xf6, 0x9f, 0xff, 0x00, 0x7f, 0x93, 0xfc, +0x6b, 0xf3, 0xbb, 0xfe, 0x0e, 0xab, 0xb6, 0x8e, 0xeb, 0xfe, 0x09, 0x2d, 0xaa, 0x24, 0xb1, 0xa4, +0x8b, 0xff, 0x00, 0x09, 0x5e, 0x8d, 0xf2, 0xba, 0xee, 0x1f, 0xeb, 0xcd, 0x7f, 0x33, 0x03, 0xc3, +0xf6, 0x18, 0xff, 0x00, 0x8f, 0x1b, 0x3f, 0xfb, 0xf2, 0xbf, 0xe1, 0x53, 0x20, 0xe6, 0x48, 0xfe, +0xde, 0x3f, 0xe1, 0x23, 0xd3, 0xff, 0x00, 0xe7, 0xfb, 0x4f, 0xff, 0x00, 0xbf, 0xc9, 0xfe, 0x34, +0x7f, 0xc2, 0x47, 0xa7, 0xff, 0x00, 0xcf, 0xf6, 0x9f, 0xff, 0x00, 0x7f, 0x93, 0xfc, 0x6b, 0xf8, +0x87, 0xff, 0x00, 0x84, 0x7e, 0xc3, 0xfe, 0x7c, 0x6c, 0xff, 0x00, 0xef, 0xca, 0xff, 0x00, 0x85, +0x1f, 0xf0, 0x8f, 0xd8, 0x7f, 0xcf, 0x8d, 0x9f, 0xfd, 0xf9, 0x5f, 0xf0, 0xa9, 0xd4, 0x39, 0xd7, +0x63, 0xfb, 0x78, 0xff, 0x00, 0x84, 0x93, 0x4f, 0xff, 0x00, 0x9f, 0xed, 0x3f, 0xfe, 0xff, 0x00, +0x2f, 0xf8, 0xd4, 0x96, 0xba, 0xb5, 0xad, 0xfe, 0xe4, 0xb7, 0x9a, 0x0b, 0x86, 0x51, 0x92, 0x23, +0x91, 0x58, 0x8f, 0xc8, 0xd7, 0xf1, 0x07, 0xff, 0x00, 0x08, 0xfd, 0x87, 0xfc, 0xf8, 0xd9, 0xff, +0x00, 0xdf, 0x95, 0xff, 0x00, 0x0a, 0x74, 0x3a, 0x2d, 0x9d, 0xb4, 0xf1, 0xcb, 0x15, 0xad, 0xbc, +0x72, 0xc2, 0xe2, 0x48, 0xdd, 0x23, 0x0a, 0xd1, 0xb0, 0xe4, 0x32, 0x90, 0x32, 0x08, 0xec, 0x47, +0x4a, 0x2e, 0x1c, 0xeb, 0xb1, 0xfd, 0xc3, 0x51, 0x5f, 0xc8, 0xbf, 0xec, 0xa7, 0xff, 0x00, 0x05, +0x81, 0xfd, 0xa4, 0xbf, 0x63, 0x4d, 0x4e, 0xde, 0x4f, 0x07, 0xfc, 0x56, 0xf1, 0x2d, 0xe6, 0x93, +0x6e, 0x54, 0x36, 0x85, 0xe2, 0x3b, 0x86, 0xd6, 0xf4, 0x99, 0x63, 0x0d, 0xbb, 0xca, 0x10, 0xdc, +0x16, 0x30, 0x29, 0x3d, 0x4d, 0xb3, 0xc2, 0xe7, 0x27, 0xe7, 0x19, 0xaf, 0xdc, 0xcf, 0xf8, 0x24, +0x8f, 0xfc, 0x1c, 0x3d, 0xe0, 0x1f, 0xf8, 0x28, 0x26, 0xa9, 0x67, 0xe0, 0x4f, 0x1a, 0x58, 0x5a, +0xfc, 0x36, 0xf8, 0xb7, 0x70, 0x15, 0x2d, 0x2c, 0x1e, 0xe4, 0xc9, 0xa5, 0x78, 0x99, 0x82, 0x9d, +0xc6, 0xc6, 0x66, 0x00, 0xac, 0xdc, 0x16, 0x36, 0xb2, 0xfc, 0xe1, 0x58, 0x79, 0x6f, 0x3e, 0xd9, +0x19, 0x2b, 0x98, 0x15, 0x99, 0xfa, 0x39, 0x45, 0x14, 0x55, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, +0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, +0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x57, 0x33, 0xf1, 0x9f, 0xe2, +0xfe, 0x83, 0xfb, 0x3f, 0xfc, 0x25, 0xf1, 0x37, 0x8e, 0x3c, 0x55, 0x78, 0xfa, 0x7f, 0x86, 0x7c, +0x21, 0xa5, 0xdc, 0xeb, 0x3a, 0xad, 0xd2, 0x41, 0x24, 0xed, 0x6d, 0x6b, 0x6f, 0x1b, 0x4b, 0x2b, +0x88, 0xe3, 0x56, 0x77, 0xc2, 0x29, 0x3b, 0x54, 0x12, 0x71, 0xc0, 0x35, 0xd3, 0x57, 0xce, 0xbf, +0xf0, 0x57, 0x2f, 0xf9, 0x45, 0x97, 0xed, 0x1b, 0xff, 0x00, 0x64, 0xdb, 0xc4, 0x1f, 0xfa, 0x6f, +0x9a, 0x93, 0x1c, 0x77, 0x3c, 0x3f, 0xfe, 0x22, 0x69, 0xfd, 0x8c, 0xbf, 0xe8, 0xa7, 0x6a, 0xff, +0x00, 0xf8, 0x44, 0xeb, 0x9f, 0xfc, 0x89, 0x4d, 0x9b, 0xfe, 0x0e, 0x6e, 0xfd, 0x8c, 0x2d, 0xe1, +0x69, 0x1f, 0xe2, 0x7e, 0xac, 0xab, 0x18, 0x2c, 0xc4, 0xf8, 0x27, 0x5b, 0xe0, 0x0f, 0xfb, 0x74, +0xaf, 0xe5, 0xfe, 0xa9, 0xf8, 0x83, 0xfe, 0x40, 0x37, 0xdf, 0xf5, 0xef, 0x27, 0xfe, 0x82, 0x6a, +0x09, 0xf6, 0x87, 0xf7, 0x07, 0x67, 0x78, 0x97, 0xd6, 0xe9, 0x34, 0x67, 0x74, 0x72, 0x28, 0x75, +0x38, 0x23, 0x20, 0x8c, 0x8e, 0x0f, 0x3d, 0x2a, 0x5a, 0xa3, 0xe1, 0x8e, 0x7c, 0x39, 0x61, 0xff, +0x00, 0x5e, 0xd1, 0xff, 0x00, 0xe8, 0x02, 0xaf, 0x55, 0xad, 0x8a, 0x96, 0xe1, 0x45, 0x14, 0x53, +0x10, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, +0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xf9, 0xf9, 0xff, 0x00, 0x07, 0x01, 0x7f, +0xc1, 0x58, 0x6e, 0x7f, 0xe0, 0x9c, 0x1f, 0xb3, 0x5d, 0x9e, 0x8d, 0xe0, 0xd9, 0xe0, 0x8f, 0xe2, +0xc7, 0xc4, 0xa1, 0x3d, 0x96, 0x85, 0x2b, 0x2f, 0x9b, 0xfd, 0x85, 0x6b, 0x18, 0x51, 0x73, 0xa9, +0x15, 0x23, 0x69, 0x78, 0xfc, 0xc4, 0x48, 0x51, 0xf2, 0xad, 0x2c, 0x8a, 0xc5, 0x64, 0x48, 0xa4, +0x43, 0xfc, 0xc6, 0x6a, 0x3a, 0x8d, 0xd6, 0xb5, 0xa9, 0xdd, 0x5f, 0x5f, 0x5d, 0x5d, 0x5f, 0xdf, +0xdf, 0x4e, 0xf7, 0x57, 0x57, 0x57, 0x53, 0x34, 0xf3, 0xdd, 0x4d, 0x23, 0x17, 0x92, 0x59, 0x24, +0x62, 0x59, 0xe4, 0x76, 0x2c, 0xcc, 0xcc, 0x4b, 0x33, 0x31, 0x24, 0x92, 0x6b, 0xeb, 0x9f, 0xf8, +0x2f, 0x37, 0xed, 0x39, 0x75, 0xfb, 0x53, 0x7f, 0xc1, 0x55, 0x3e, 0x2a, 0x5f, 0x34, 0xd3, 0x49, +0xa5, 0x78, 0x27, 0x50, 0x3e, 0x07, 0xd2, 0x61, 0x93, 0xfe, 0x5d, 0xa1, 0xd3, 0x59, 0xa0, 0x9c, +0x0e, 0x07, 0x0f, 0x7b, 0xf6, 0xd9, 0x41, 0xf4, 0x94, 0x0c, 0x9c, 0x66, 0xbe, 0x40, 0xac, 0xc9, +0x93, 0xd6, 0xc1, 0x9c, 0x57, 0x6d, 0xf0, 0x4f, 0xf6, 0x6a, 0xf8, 0x91, 0xfb, 0x4a, 0xdf, 0x5c, +0x5b, 0xfc, 0x3a, 0xf8, 0x7f, 0xe3, 0x6f, 0x1e, 0x4b, 0x67, 0x20, 0x8a, 0xe8, 0xf8, 0x7f, 0x44, +0xb9, 0xd4, 0x63, 0xb3, 0x62, 0x01, 0x02, 0x67, 0x89, 0x19, 0x22, 0xe0, 0x83, 0xfb, 0xc2, 0xbd, +0x47, 0xa8, 0xaf, 0xb2, 0x3f, 0xe0, 0x82, 0x5f, 0xf0, 0x47, 0xfb, 0x7f, 0xf8, 0x29, 0x8f, 0xc6, +0x3d, 0x57, 0xc4, 0xbe, 0x39, 0x17, 0xb6, 0xff, 0x00, 0x07, 0xbc, 0x03, 0x34, 0x71, 0xea, 0xa9, +0x6f, 0x23, 0xc1, 0x2f, 0x88, 0xef, 0x98, 0x09, 0x13, 0x4e, 0x8e, 0x65, 0x20, 0xc6, 0x8b, 0x19, +0x59, 0x27, 0x74, 0x22, 0x45, 0x47, 0x89, 0x17, 0x6b, 0x4a, 0x25, 0x8b, 0xfa, 0x60, 0xf8, 0x65, +0xf0, 0xc3, 0xc3, 0xbf, 0x06, 0x3c, 0x0d, 0xa6, 0xf8, 0x5f, 0xc2, 0x7a, 0x1e, 0x91, 0xe1, 0xaf, +0x0d, 0xe8, 0xf0, 0x8b, 0x7b, 0x0d, 0x2f, 0x4b, 0xb3, 0x4b, 0x4b, 0x4b, 0x28, 0xc1, 0x27, 0x6c, +0x71, 0xa0, 0x0a, 0xa3, 0x24, 0x9e, 0x07, 0x24, 0x92, 0x72, 0x4d, 0x0b, 0x50, 0x51, 0xea, 0xcf, +0xe4, 0xef, 0xfe, 0x1c, 0xbb, 0xfb, 0x58, 0x1f, 0xf9, 0xa0, 0x1f, 0x10, 0xff, 0x00, 0xf0, 0x12, +0x2f, 0xfe, 0x39, 0x4b, 0xff, 0x00, 0x0e, 0x5c, 0xfd, 0xac, 0x3f, 0xe8, 0xdf, 0xfe, 0x21, 0xff, +0x00, 0xe0, 0x2c, 0x5f, 0xfc, 0x72, 0xbf, 0xae, 0x1a, 0x2a, 0xb9, 0x47, 0xca, 0x8f, 0xe4, 0x7b, +0xfe, 0x1c, 0xb9, 0xfb, 0x58, 0x7f, 0xd1, 0xbf, 0xfc, 0x43, 0xff, 0x00, 0xc0, 0x58, 0xbf, 0xf8, +0xe5, 0x1f, 0xf0, 0xe5, 0xbf, 0xda, 0xc3, 0xfe, 0x8d, 0xff, 0x00, 0xe2, 0x1f, 0xfe, 0x02, 0xc5, +0xff, 0x00, 0xc7, 0x2b, 0xfa, 0xe1, 0xa2, 0x8e, 0x50, 0xe5, 0x47, 0xc2, 0x7f, 0xf0, 0x6e, 0x87, +0xec, 0xf5, 0xe3, 0x8f, 0xd9, 0x8b, 0xfe, 0x09, 0xaf, 0xa7, 0xf8, 0x57, 0xe2, 0x17, 0x85, 0xf5, +0x6f, 0x07, 0xf8, 0x92, 0x3f, 0x11, 0xea, 0x97, 0x4f, 0xa7, 0x6a, 0x31, 0x84, 0x9d, 0x62, 0x92, +0x60, 0xc8, 0xe4, 0x02, 0x78, 0x61, 0xc8, 0xe6, 0xba, 0x8f, 0xf8, 0x2f, 0x97, 0xc1, 0x0f, 0x17, +0x7e, 0xd1, 0xdf, 0xf0, 0x4a, 0x1f, 0x89, 0xfe, 0x0d, 0xf0, 0x27, 0x87, 0xf5, 0x1f, 0x14, 0xf8, +0xab, 0x57, 0x9f, 0x43, 0x6b, 0x2d, 0x2e, 0xc1, 0x03, 0xdc, 0x5c, 0x88, 0x75, 0xcd, 0x3e, 0x79, +0x76, 0x82, 0x40, 0x3b, 0x62, 0x8a, 0x47, 0x3c, 0xf4, 0x43, 0x5f, 0x62, 0x56, 0x2f, 0x8f, 0xfe, +0x22, 0xe8, 0x3f, 0x0a, 0xfc, 0x33, 0x26, 0xb5, 0xe2, 0x6d, 0x6b, 0x47, 0xf0, 0xee, 0x8d, 0x0c, +0xb0, 0xc3, 0x2d, 0xfe, 0xa9, 0x7b, 0x1d, 0x9d, 0xac, 0x4f, 0x34, 0xa9, 0x0c, 0x48, 0xd2, 0x48, +0x42, 0x86, 0x92, 0x59, 0x23, 0x8d, 0x41, 0x39, 0x67, 0x75, 0x51, 0x92, 0x40, 0xa7, 0xd0, 0x67, +0xf2, 0x71, 0xff, 0x00, 0x0e, 0x5c, 0xfd, 0xac, 0x3f, 0xe8, 0xdf, 0xfe, 0x21, 0xff, 0x00, 0xe0, +0x2c, 0x5f, 0xfc, 0x72, 0xba, 0x7f, 0x81, 0xff, 0x00, 0xf0, 0x47, 0x3f, 0xda, 0x9f, 0xc3, 0xdf, +0x1c, 0x3c, 0x13, 0xa8, 0x5f, 0x7c, 0x07, 0xf8, 0x81, 0x6b, 0x63, 0xa7, 0xf8, 0x8b, 0x4e, 0xba, +0xb9, 0x99, 0xed, 0x62, 0xdb, 0x0c, 0x51, 0xdd, 0x44, 0xee, 0xe7, 0xe7, 0xe8, 0x14, 0x12, 0x7e, +0x95, 0xfd, 0x5a, 0x69, 0xda, 0x8c, 0x3a, 0xb5, 0x8c, 0x37, 0x56, 0xb2, 0xc5, 0x71, 0x6d, 0x70, +0x8b, 0x2c, 0x53, 0x44, 0xe1, 0xe3, 0x95, 0x18, 0x64, 0x32, 0xb0, 0xe0, 0x82, 0x30, 0x41, 0x1d, +0x6a, 0x6a, 0x5c, 0xa2, 0xe5, 0x41, 0x45, 0x14, 0x55, 0x0c, 0x28, 0xa2, 0xb0, 0x7e, 0x22, 0x7c, +0x53, 0xf0, 0xd7, 0xc2, 0x3d, 0x04, 0xea, 0x9e, 0x2a, 0xf1, 0x0e, 0x85, 0xe1, 0xad, 0x31, 0x4e, +0xd3, 0x79, 0xab, 0x6a, 0x11, 0x58, 0xdb, 0x83, 0xd7, 0x1b, 0xe5, 0x65, 0x5f, 0xd6, 0x80, 0x37, +0xa8, 0xaf, 0x00, 0x97, 0xfe, 0x0a, 0xb1, 0xfb, 0x30, 0x5b, 0xca, 0xd1, 0xc9, 0xfb, 0x49, 0x7c, +0x04, 0x8e, 0x48, 0xd8, 0xab, 0x2b, 0x7c, 0x41, 0xd2, 0x01, 0x52, 0x3a, 0x82, 0x3e, 0xd1, 0xd6, +0x99, 0xff, 0x00, 0x0f, 0x5b, 0xfd, 0x96, 0xff, 0x00, 0xe8, 0xe4, 0xbe, 0x00, 0xff, 0x00, 0xe1, +0xc2, 0xd2, 0x3f, 0xf8, 0xfd, 0x17, 0x03, 0xe8, 0x2a, 0x2b, 0xe7, 0xdf, 0xf8, 0x7a, 0xdf, 0xec, +0xb7, 0xff, 0x00, 0x47, 0x27, 0xf0, 0x07, 0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xe8, +0xff, 0x00, 0x87, 0xad, 0xfe, 0xcb, 0x7f, 0xf4, 0x72, 0x7f, 0x00, 0x7f, 0xf0, 0xe1, 0x69, 0x1f, +0xfc, 0x7e, 0x80, 0x3e, 0x82, 0xa2, 0xbc, 0xcf, 0xe0, 0xa7, 0xed, 0x99, 0xf0, 0x8f, 0xf6, 0x94, +0xd5, 0xaf, 0xac, 0x3e, 0x1c, 0xfc, 0x54, 0xf8, 0x6d, 0xf1, 0x02, 0xfb, 0x4c, 0x84, 0x5c, 0x5e, +0x5b, 0x78, 0x6f, 0xc4, 0xd6, 0x5a, 0xb4, 0xd6, 0x91, 0x13, 0xb4, 0x49, 0x22, 0x5b, 0xca, 0xe5, +0x14, 0xb7, 0x00, 0xb0, 0x00, 0x9e, 0x33, 0x9a, 0xf4, 0xca, 0x00, 0x28, 0xa2, 0x8a, 0x00, 0x28, +0xaf, 0x23, 0xf8, 0x91, 0xfb, 0x7c, 0xfc, 0x0e, 0xf8, 0x35, 0xab, 0xb6, 0x9f, 0xe3, 0x1f, 0x8c, +0xdf, 0x09, 0x7c, 0x27, 0xa8, 0x23, 0x14, 0x6b, 0x6d, 0x67, 0xc5, 0xfa, 0x7d, 0x8c, 0xca, 0xc3, +0x39, 0x52, 0xb2, 0xcc, 0xa7, 0x23, 0x07, 0x8c, 0x76, 0x35, 0xcc, 0xff, 0x00, 0xc3, 0xd6, 0xff, +0x00, 0x65, 0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, 0xfe, 0x3f, 0x4a, 0xe1, +0xb1, 0xf4, 0x15, 0x15, 0xf3, 0xef, 0xfc, 0x3d, 0x6f, 0xf6, 0x5b, 0xff, 0x00, 0xa3, 0x93, 0xf8, +0x03, 0xff, 0x00, 0x87, 0x0b, 0x48, 0xff, 0x00, 0xe3, 0xf4, 0x7f, 0xc3, 0xd6, 0xff, 0x00, 0x65, +0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, 0xfe, 0x3f, 0x4c, 0x0f, 0xa0, 0xa8, +0xaf, 0x9f, 0x4f, 0xfc, 0x15, 0x6f, 0xf6, 0x5b, 0x1f, 0xf3, 0x72, 0x7f, 0x00, 0x7f, 0xf0, 0xe1, +0x69, 0x1f, 0xfc, 0x7e, 0xbd, 0xd3, 0xc3, 0x5e, 0x24, 0xb1, 0xf1, 0x86, 0x83, 0x67, 0xaa, 0x69, +0x77, 0x96, 0x7a, 0x96, 0x9b, 0xa9, 0x41, 0x1d, 0xd5, 0xa5, 0xdd, 0xa4, 0xcb, 0x3d, 0xbd, 0xd4, +0x32, 0x28, 0x74, 0x92, 0x37, 0x5c, 0xab, 0xa3, 0x29, 0x0c, 0x19, 0x49, 0x04, 0x10, 0x41, 0x22, +0x80, 0x3f, 0x3b, 0xff, 0x00, 0xe0, 0xea, 0x3f, 0xf9, 0x44, 0xd6, 0xa9, 0xff, 0x00, 0x63, 0x5e, +0x8d, 0xff, 0x00, 0xa3, 0xcd, 0x7f, 0x34, 0x23, 0xa5, 0x7f, 0x4b, 0xdf, 0xf0, 0x75, 0x1f, 0xfc, +0xa2, 0x6b, 0x54, 0xff, 0x00, 0xb1, 0xaf, 0x46, 0xff, 0x00, 0xd1, 0xe6, 0xbf, 0x9a, 0x11, 0xd2, +0xa6, 0x44, 0xc8, 0xd2, 0xf0, 0x6f, 0x84, 0x35, 0x4f, 0x88, 0x7e, 0x33, 0xd1, 0xfc, 0x3b, 0xa1, +0xd8, 0xcd, 0xaa, 0x6b, 0x9e, 0x21, 0xbf, 0xb7, 0xd2, 0xf4, 0xdb, 0x28, 0x40, 0xf3, 0x6f, 0x2e, +0xa7, 0x95, 0x62, 0x86, 0x14, 0xc9, 0x03, 0x73, 0xc8, 0xea, 0xa3, 0x24, 0x0c, 0xb0, 0xaf, 0xa2, +0x7f, 0xe1, 0xcb, 0x9f, 0xb5, 0x87, 0xfd, 0x1b, 0xff, 0x00, 0xc4, 0x3f, 0xfc, 0x05, 0x8b, 0xff, +0x00, 0x8e, 0x57, 0x0d, 0xff, 0x00, 0x04, 0xea, 0xff, 0x00, 0x94, 0x8a, 0xfe, 0xcf, 0x3f, 0xf6, +0x55, 0x3c, 0x29, 0xff, 0x00, 0xa7, 0xab, 0x4a, 0xfe, 0xc6, 0xa9, 0x28, 0xdc, 0x12, 0x4f, 0x73, +0xf9, 0x1f, 0x1f, 0xf0, 0x45, 0xbf, 0xda, 0xc0, 0x9f, 0xf9, 0x20, 0x1f, 0x10, 0xff, 0x00, 0xf0, +0x16, 0x2f, 0xfe, 0x39, 0x5e, 0x37, 0xf1, 0xbb, 0xf6, 0x60, 0xf8, 0x99, 0xfb, 0x33, 0xdd, 0x5b, +0xc3, 0xf1, 0x1b, 0xe1, 0xdf, 0x8e, 0x3c, 0x06, 0x6e, 0xe4, 0xf2, 0x6d, 0xa4, 0xd7, 0xb4, 0x3b, +0x9d, 0x3e, 0x1b, 0xb7, 0xc6, 0xed, 0xb0, 0xcb, 0x22, 0x04, 0x94, 0xe3, 0xfb, 0x8c, 0xdd, 0x0f, +0xa1, 0xc7, 0xf6, 0x89, 0x58, 0xbf, 0x10, 0x7e, 0x1d, 0xe8, 0x7f, 0x16, 0x3c, 0x1f, 0x7f, 0xe1, +0xdf, 0x13, 0x68, 0xda, 0x4f, 0x88, 0xbc, 0x3f, 0xab, 0x42, 0x6d, 0xef, 0xf4, 0xbd, 0x52, 0xce, +0x3b, 0xcb, 0x3b, 0xe8, 0x8e, 0x32, 0x92, 0xc3, 0x20, 0x28, 0xeb, 0xc7, 0x46, 0x04, 0x53, 0xe5, +0x1f, 0x2a, 0x3f, 0x89, 0xd0, 0x73, 0x4e, 0x86, 0x69, 0x2d, 0x2e, 0x23, 0x9a, 0x19, 0x24, 0x82, +0x68, 0x1d, 0x65, 0x8a, 0x58, 0x9c, 0xc7, 0x24, 0x4e, 0xa7, 0x72, 0xba, 0x30, 0xc1, 0x56, 0x56, +0x00, 0x86, 0x04, 0x10, 0x40, 0x20, 0x83, 0x5f, 0xa2, 0x5f, 0xf0, 0x5f, 0xbf, 0xf8, 0x23, 0x65, +0x9f, 0xfc, 0x13, 0x7b, 0xe2, 0x26, 0x93, 0xe3, 0x9f, 0x87, 0xcb, 0x70, 0xdf, 0x08, 0x7c, 0x75, +0x78, 0xf6, 0x76, 0xf6, 0x73, 0x4a, 0xd3, 0x49, 0xe1, 0x8d, 0x44, 0x23, 0x4b, 0xf6, 0x33, 0x23, +0x92, 0xd2, 0x41, 0x2c, 0x69, 0x23, 0xc2, 0xcc, 0x59, 0x87, 0x93, 0x2a, 0x31, 0xe2, 0x36, 0x7f, +0xce, 0xba, 0x92, 0x5a, 0xb1, 0xfd, 0x32, 0x7f, 0xc1, 0xbc, 0xff, 0x00, 0xf0, 0x56, 0x5b, 0xaf, +0xf8, 0x28, 0x4f, 0xec, 0xf1, 0x7d, 0xe1, 0x0f, 0x1c, 0x5d, 0x47, 0x71, 0xf1, 0x6b, 0xe1, 0xb4, +0x50, 0xc5, 0xa9, 0x5c, 0xb3, 0x85, 0x93, 0xc4, 0x7a, 0x7b, 0xe5, 0x20, 0xd4, 0x76, 0xff, 0x00, +0xcf, 0x60, 0x54, 0xc5, 0x38, 0x5c, 0x80, 0xe1, 0x24, 0xf9, 0x05, 0xc2, 0x46, 0xbf, 0xa3, 0x15, +0xfc, 0x91, 0x7f, 0xc1, 0x19, 0x3f, 0x6a, 0x8b, 0xbf, 0xd8, 0xf7, 0xfe, 0x0a, 0x63, 0xf0, 0xa7, +0xc5, 0x11, 0xdc, 0xb5, 0xbe, 0x93, 0xad, 0x6a, 0xf1, 0x78, 0x57, 0x5d, 0x5d, 0xfb, 0x23, 0x9b, +0x4e, 0xd4, 0x5d, 0x2d, 0xa4, 0xf3, 0x4f, 0x78, 0xe1, 0x91, 0xa0, 0xb9, 0xc7, 0xf7, 0xad, 0x53, +0xae, 0x30, 0x7f, 0xad, 0xda, 0xa8, 0x97, 0x7b, 0xa0, 0xa2, 0x8a, 0x2a, 0x80, 0x28, 0xae, 0x6f, +0xe2, 0x4f, 0xc6, 0x2f, 0x09, 0xfc, 0x1b, 0xd1, 0xd7, 0x51, 0xf1, 0x7f, 0x89, 0xbc, 0x3b, 0xe1, +0x5d, 0x3d, 0xb7, 0x01, 0x75, 0xac, 0x6a, 0x70, 0xd8, 0xc2, 0x71, 0x82, 0x7e, 0x79, 0x59, 0x47, +0x19, 0xe7, 0x9e, 0x2b, 0xc8, 0x8f, 0xfc, 0x15, 0x6b, 0xf6, 0x5b, 0x07, 0xfe, 0x4e, 0x4b, 0xe0, +0x0f, 0xfe, 0x1c, 0x2d, 0x23, 0xff, 0x00, 0x8f, 0xd1, 0x70, 0x3e, 0x81, 0xa2, 0xbc, 0x13, 0x4f, +0xff, 0x00, 0x82, 0xa7, 0x7e, 0xcc, 0xda, 0xb5, 0xec, 0x76, 0xd6, 0x9f, 0xb4, 0x5f, 0xc0, 0x7b, +0xab, 0x99, 0x9b, 0x6c, 0x71, 0x43, 0xe3, 0xfd, 0x25, 0xe4, 0x73, 0xe8, 0x14, 0x5c, 0x64, 0x9f, +0xa5, 0x7b, 0x5f, 0x85, 0x7c, 0x5b, 0xa6, 0x78, 0xe3, 0x43, 0x83, 0x54, 0xd1, 0xb5, 0x1b, 0x0d, +0x5b, 0x4d, 0xba, 0x1b, 0xa0, 0xbb, 0xb2, 0xb8, 0x4b, 0x88, 0x26, 0x19, 0xc6, 0x55, 0xd0, 0x95, +0x6e, 0x41, 0x1c, 0x1e, 0xd4, 0xae, 0x06, 0x85, 0x14, 0x51, 0x4c, 0x02, 0x8a, 0xf2, 0x1f, 0x8a, +0xdf, 0xb7, 0xe7, 0xc0, 0xdf, 0x80, 0xfe, 0x33, 0x9b, 0xc3, 0x9e, 0x3a, 0xf8, 0xcd, 0xf0, 0x97, +0xc1, 0x5e, 0x22, 0xb7, 0x8d, 0x26, 0x97, 0x4b, 0xd7, 0xbc, 0x5f, 0xa7, 0xe9, 0xb7, 0xb1, 0xa3, +0x8d, 0xc8, 0xed, 0x0c, 0xd3, 0x2b, 0xaa, 0xb2, 0xe0, 0x82, 0x46, 0x08, 0x39, 0x15, 0xcd, 0xff, +0x00, 0xc3, 0xd6, 0xff, 0x00, 0x65, 0xbf, 0xfa, 0x39, 0x3f, 0x80, 0x3f, 0xf8, 0x70, 0xb4, 0x8f, +0xfe, 0x3f, 0x4a, 0xe0, 0x7d, 0x05, 0x45, 0x79, 0xef, 0xc0, 0xcf, 0xda, 0xc7, 0xe1, 0x7f, 0xed, +0x3a, 0xba, 0xa1, 0xf8, 0x6d, 0xf1, 0x1b, 0xc0, 0x3f, 0x10, 0xbf, 0xb0, 0xcc, 0x43, 0x51, 0xff, +0x00, 0x84, 0x67, 0xc4, 0x56, 0x9a, 0xbf, 0xd8, 0x3c, 0xdd, 0xfe, 0x57, 0x9d, 0xf6, 0x79, 0x1f, +0xcb, 0xdf, 0xe5, 0xc9, 0xb7, 0x76, 0x37, 0x6c, 0x6c, 0x67, 0x69, 0xc7, 0xa1, 0x53, 0x00, 0xa2, +0x8a, 0x28, 0x00, 0xa2, 0xbc, 0xc3, 0xe3, 0x5f, 0xed, 0xa3, 0xf0, 0x7b, 0xf6, 0x6d, 0xd7, 0x6c, +0xf4, 0x9f, 0x88, 0xdf, 0x15, 0x7e, 0x1a, 0xf8, 0x03, 0x53, 0xbe, 0xb7, 0xfb, 0x55, 0xad, 0xa7, +0x89, 0x3c, 0x51, 0x63, 0xa4, 0xdc, 0x5c, 0xc3, 0xb8, 0xa7, 0x9a, 0x89, 0x3c, 0xa8, 0xcc, 0x9b, +0x95, 0x97, 0x70, 0x18, 0xca, 0x91, 0xda, 0xb8, 0xcf, 0xf8, 0x7a, 0xdf, 0xec, 0xb7, 0xff, 0x00, +0x47, 0x25, 0xf0, 0x07, 0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xe8, 0x03, 0xe8, 0x2a, +0xf0, 0xcf, 0xf8, 0x29, 0x9f, 0x80, 0xb5, 0xaf, 0x8a, 0xbf, 0xf0, 0x4e, 0xef, 0x8e, 0x9e, 0x17, +0xf0, 0xde, 0x9b, 0x75, 0xad, 0x78, 0x8b, 0xc4, 0x5e, 0x03, 0xd6, 0xf4, 0xdd, 0x33, 0x4f, 0xb6, +0x50, 0xd3, 0x5e, 0xdc, 0xcb, 0x65, 0x2a, 0x45, 0x12, 0x02, 0x46, 0x59, 0x99, 0x80, 0x1e, 0xe6, +0xba, 0x1f, 0x82, 0xff, 0x00, 0xb6, 0xd7, 0xc1, 0xdf, 0xda, 0x47, 0xc4, 0x77, 0x5a, 0x3f, 0xc3, +0xaf, 0x8b, 0x1f, 0x0c, 0x7e, 0x20, 0x6a, 0xf6, 0x56, 0xa6, 0xf6, 0xe2, 0xc7, 0xc3, 0x7e, 0x29, +0xb1, 0xd5, 0x6e, 0xa0, 0x80, 0x3a, 0xa1, 0x95, 0xe3, 0x82, 0x57, 0x65, 0x8f, 0x73, 0xa2, 0xee, +0x20, 0x0c, 0xb2, 0x8c, 0xe4, 0x8a, 0xef, 0xfc, 0x63, 0xe3, 0x2d, 0x2b, 0xe1, 0xf7, 0x86, 0x2f, +0xf5, 0xbd, 0x77, 0x52, 0xd3, 0xf4, 0x6d, 0x17, 0x49, 0xb7, 0x92, 0xee, 0xfb, 0x50, 0xbf, 0xb9, +0x4b, 0x6b, 0x5b, 0x28, 0x51, 0x77, 0x3c, 0xb2, 0xc8, 0xe4, 0x2a, 0x22, 0xa8, 0x24, 0xb3, 0x10, +0x00, 0x19, 0x26, 0xa4, 0xa4, 0x7f, 0x26, 0x3f, 0xf0, 0xe5, 0xcf, 0xda, 0xc3, 0xfe, 0x8d, 0xff, +0x00, 0xe2, 0x1f, 0xfe, 0x02, 0xc5, 0xff, 0x00, 0xc7, 0x2a, 0xb6, 0xb3, 0xff, 0x00, 0x04, 0x56, +0xfd, 0xac, 0xae, 0x34, 0x7b, 0xa8, 0xd3, 0xf6, 0x7f, 0xf8, 0x88, 0xcf, 0x24, 0x2e, 0xaa, 0x3e, +0xcb, 0x17, 0x24, 0xa9, 0xff, 0x00, 0xa6, 0x95, 0xfd, 0x6e, 0x78, 0x73, 0xc4, 0x76, 0x3e, 0x2e, +0xd1, 0xad, 0xf5, 0x2d, 0x2e, 0xf2, 0xcf, 0x52, 0xd3, 0xee, 0xd3, 0xcc, 0xb7, 0xba, 0xb4, 0x9d, +0x67, 0x86, 0x75, 0xfe, 0xf2, 0xba, 0x92, 0xac, 0x3d, 0xc1, 0xab, 0xd4, 0x72, 0x91, 0xca, 0x8a, +0x3e, 0x1e, 0x89, 0xa1, 0xd1, 0x6c, 0xe3, 0x91, 0x4a, 0xbc, 0x76, 0xe8, 0xac, 0xa7, 0xa8, 0x21, +0x40, 0x20, 0xfd, 0x2a, 0xf5, 0x14, 0x55, 0x2d, 0x06, 0xf5, 0x0a, 0x28, 0xaa, 0x3e, 0x24, 0xf1, +0x36, 0x9f, 0xe0, 0xfd, 0x16, 0x7d, 0x4b, 0x56, 0xbe, 0xb2, 0xd3, 0x34, 0xfb, 0x51, 0xba, 0x7b, +0xab, 0xb9, 0xd6, 0x08, 0x21, 0x04, 0x80, 0x0b, 0x3b, 0x10, 0xaa, 0x32, 0x40, 0xe4, 0xf5, 0x22, +0x80, 0x2f, 0x51, 0x5e, 0x0d, 0xaa, 0x7f, 0xc1, 0x52, 0xbf, 0x66, 0x7d, 0x0e, 0xfe, 0x4b, 0x5b, +0xef, 0xda, 0x27, 0xe0, 0x4d, 0x9d, 0xd4, 0x24, 0x09, 0x21, 0x9f, 0xc7, 0xda, 0x54, 0x72, 0x46, +0x71, 0x9c, 0x15, 0x37, 0x19, 0x1c, 0x10, 0x79, 0xf5, 0x15, 0x5b, 0xfe, 0x1e, 0xb7, 0xfb, 0x2d, +0xff, 0x00, 0xd1, 0xc9, 0xfc, 0x01, 0xff, 0x00, 0xc3, 0x85, 0xa4, 0x7f, 0xf1, 0xfa, 0x57, 0x03, +0xe8, 0x2a, 0x2b, 0xe7, 0xdf, 0xf8, 0x7a, 0xdf, 0xec, 0xb7, 0xff, 0x00, 0x47, 0x27, 0xf0, 0x07, +0xff, 0x00, 0x0e, 0x16, 0x91, 0xff, 0x00, 0xc7, 0xeb, 0xbf, 0xf8, 0x1d, 0xfb, 0x59, 0xfc, 0x2f, +0xfd, 0xa7, 0x4e, 0xa9, 0xff, 0x00, 0x0a, 0xd7, 0xe2, 0x57, 0xc3, 0xff, 0x00, 0x88, 0x5f, 0xd8, +0x7e, 0x57, 0xf6, 0x8f, 0xfc, 0x23, 0x3e, 0x21, 0xb4, 0xd5, 0xff, 0x00, 0xb3, 0xfc, 0xdd, 0xfe, +0x57, 0x9d, 0xf6, 0x79, 0x1f, 0xcb, 0xdf, 0xe5, 0x49, 0xb7, 0x76, 0x37, 0x79, 0x6f, 0x8c, 0xed, +0x38, 0x2e, 0x07, 0xa1, 0xd1, 0x45, 0x14, 0xc0, 0x28, 0xac, 0x8f, 0x1b, 0x78, 0xf7, 0x45, 0xf8, +0x6d, 0xa0, 0xc9, 0xaa, 0x78, 0x83, 0x58, 0xd2, 0x74, 0x2d, 0x2e, 0x22, 0x16, 0x4b, 0xcd, 0x46, +0xf2, 0x3b, 0x4b, 0x74, 0x27, 0xa0, 0x2f, 0x21, 0x0a, 0x33, 0x83, 0xde, 0xbc, 0x6a, 0xeb, 0xfe, +0x0a, 0xa7, 0xfb, 0x31, 0x58, 0x5c, 0xbc, 0x33, 0xfe, 0xd1, 0xff, 0x00, 0x01, 0x21, 0x9a, 0x33, +0xb5, 0xd1, 0xfe, 0x20, 0x69, 0x2a, 0xca, 0x7d, 0x08, 0x37, 0x19, 0x06, 0x80, 0x3d, 0xf2, 0x8a, +0xf9, 0xfe, 0x3f, 0xf8, 0x2a, 0xcf, 0xec, 0xc1, 0x34, 0x8a, 0x91, 0xfe, 0xd2, 0x5f, 0x00, 0xe4, +0x76, 0x21, 0x55, 0x57, 0xe2, 0x0e, 0x90, 0x58, 0x93, 0xc0, 0x00, 0x7d, 0xa2, 0xbd, 0x83, 0xe1, +0xd7, 0xc5, 0x5f, 0x0c, 0xfc, 0x5e, 0xd0, 0xbf, 0xb5, 0x3c, 0x2b, 0xe2, 0x2d, 0x07, 0xc4, 0xda, +0x69, 0x20, 0x0b, 0xbd, 0x27, 0x50, 0x86, 0xfa, 0x02, 0x48, 0xc8, 0x1b, 0xe2, 0x66, 0x5e, 0x84, +0x1e, 0xbd, 0x0d, 0x2b, 0x81, 0xd0, 0x51, 0x45, 0x14, 0xc0, 0xfe, 0x2b, 0xfe, 0x3f, 0x6a, 0xd2, +0x6b, 0xff, 0x00, 0x1f, 0xbc, 0x79, 0xa8, 0x4d, 0xbb, 0xce, 0xd4, 0x3c, 0x4b, 0xa9, 0xdd, 0x3e, +0x5b, 0x77, 0xcc, 0xf7, 0x92, 0xb1, 0xe7, 0xbf, 0x24, 0xf3, 0xde, 0xb9, 0x33, 0xd2, 0xba, 0x2f, +0x8c, 0x1f, 0xf2, 0x57, 0xbc, 0x59, 0xff, 0x00, 0x61, 0xcb, 0xff, 0x00, 0xfd, 0x29, 0x92, 0xb9, +0xda, 0xcc, 0x89, 0x6e, 0x7f, 0x50, 0xdf, 0xf0, 0x6c, 0xff, 0x00, 0x80, 0x34, 0xff, 0x00, 0x04, +0x7f, 0xc1, 0x1d, 0xfe, 0x1b, 0x5d, 0xda, 0x5b, 0xc3, 0x1d, 0xe7, 0x89, 0xaf, 0x75, 0x8d, 0x5f, +0x51, 0x95, 0x17, 0x69, 0xb9, 0x98, 0xea, 0x97, 0x50, 0x23, 0x37, 0xa9, 0x58, 0x20, 0x82, 0x3c, +0xfa, 0x44, 0x2b, 0xef, 0x6a, 0xf8, 0x9f, 0xfe, 0x0d, 0xd4, 0xff, 0x00, 0x94, 0x34, 0xfc, 0x15, +0xff, 0x00, 0xaf, 0x6d, 0x53, 0xff, 0x00, 0x4f, 0x17, 0xd5, 0xf6, 0xc5, 0x5c, 0x76, 0x2c, 0x28, +0xa2, 0x8a, 0x60, 0x14, 0x51, 0x45, 0x00, 0x15, 0xf0, 0x8f, 0xfc, 0x1c, 0xbe, 0x82, 0x4f, 0xf8, +0x22, 0x9f, 0xc6, 0x15, 0x61, 0xb9, 0x5a, 0xe3, 0xc3, 0xa0, 0x83, 0xdf, 0xfe, 0x2a, 0x2d, 0x32, +0xbe, 0xee, 0xaf, 0x84, 0xbf, 0xe0, 0xe5, 0xcf, 0xf9, 0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, +0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x26, 0x07, 0xf3, 0x45, 0xf0, 0x4f, 0xf6, 0x8d, 0xf8, 0x89, 0xfb, +0x35, 0x5f, 0x7d, 0xa3, 0xe1, 0xd7, 0x8f, 0x7c, 0x67, 0xe0, 0x39, 0x1a, 0x4f, 0x36, 0x41, 0xe1, +0xfd, 0x6a, 0xe7, 0x4e, 0x8e, 0x76, 0xc8, 0x3f, 0xbc, 0x8e, 0x27, 0x54, 0x90, 0x1d, 0xab, 0x90, +0xe1, 0x81, 0x0a, 0x01, 0x04, 0x57, 0xdd, 0x9f, 0xb1, 0xbf, 0xfc, 0x1c, 0x8b, 0xfb, 0x55, 0xf8, +0x57, 0xe2, 0x87, 0x84, 0xfc, 0x37, 0xe2, 0x0f, 0x15, 0x78, 0x6b, 0xe2, 0x26, 0x93, 0xac, 0xeb, +0x16, 0x3a, 0x54, 0xa3, 0xc4, 0x7a, 0x0c, 0x42, 0xe2, 0x18, 0x66, 0x9e, 0x38, 0x58, 0xa4, 0xd6, +0x66, 0xdd, 0xcc, 0x81, 0x58, 0x90, 0xd2, 0xf9, 0x9f, 0x31, 0xc9, 0xdc, 0x38, 0xaf, 0xce, 0x1a, +0xec, 0x3f, 0x67, 0x7f, 0xf9, 0x38, 0x9f, 0x87, 0xbf, 0xf6, 0x35, 0x69, 0x3f, 0xfa, 0x5b, 0x15, +0x41, 0x2a, 0x4c, 0xfe, 0xd3, 0x2a, 0x39, 0xe6, 0xf2, 0x17, 0x71, 0xc6, 0xdc, 0x12, 0x49, 0x38, +0x00, 0x54, 0x95, 0xf9, 0x1b, 0xff, 0x00, 0x07, 0x54, 0x7f, 0xc1, 0x47, 0xaf, 0x7e, 0x06, 0x7c, +0x0f, 0xd0, 0xfe, 0x03, 0xf8, 0x4b, 0x52, 0x92, 0xc3, 0xc4, 0x7f, 0x14, 0x2d, 0x65, 0xbc, 0xf1, +0x34, 0xd0, 0x4a, 0x56, 0x6b, 0x5d, 0x00, 0x31, 0x87, 0xec, 0xfc, 0x60, 0x81, 0x7b, 0x30, 0x92, +0x32, 0x41, 0x20, 0xc5, 0x6b, 0x72, 0x8c, 0x31, 0x20, 0x35, 0x6d, 0x94, 0x78, 0xff, 0x00, 0xfc, +0x15, 0xd7, 0xfe, 0x0e, 0x7a, 0xd5, 0x0f, 0x8b, 0x35, 0x3f, 0x87, 0x7f, 0xb3, 0x0e, 0xa1, 0x63, +0x0e, 0x9f, 0xa7, 0xb3, 0x5a, 0xea, 0x3f, 0x10, 0xcc, 0x29, 0x74, 0xd7, 0xb2, 0x03, 0xf3, 0xa6, +0x95, 0x1b, 0x83, 0x17, 0x92, 0x31, 0xb7, 0xed, 0x72, 0x2b, 0x89, 0x32, 0xc6, 0x15, 0x0a, 0x23, +0x9e, 0x4f, 0xc6, 0xbf, 0x89, 0x1f, 0x10, 0x3c, 0x41, 0xf1, 0x9b, 0xc6, 0x53, 0xf8, 0x8b, 0xc6, +0x5a, 0xf6, 0xb7, 0xe2, 0xef, 0x10, 0x5d, 0x00, 0xb2, 0xea, 0x9a, 0xdd, 0xfc, 0xba, 0x85, 0xe4, +0x80, 0x64, 0x80, 0x66, 0x99, 0x99, 0xf0, 0x32, 0x70, 0x33, 0x81, 0xd8, 0x0a, 0xc9, 0x03, 0x02, +0xb4, 0xfc, 0x15, 0xe0, 0x9d, 0x6b, 0xe2, 0x5f, 0x8b, 0xf4, 0xdf, 0x0f, 0x78, 0x6f, 0x47, 0xd5, +0x3c, 0x41, 0xaf, 0xeb, 0x33, 0x0b, 0x6b, 0x0d, 0x37, 0x4c, 0xb4, 0x92, 0xee, 0xf2, 0xf6, 0x52, +0x09, 0xd9, 0x14, 0x51, 0x82, 0xce, 0xd8, 0x56, 0x38, 0x03, 0x80, 0xa4, 0x9e, 0x01, 0xa8, 0x25, +0xc9, 0xb3, 0x30, 0x0c, 0x0a, 0x2b, 0xed, 0xbd, 0x0f, 0xfe, 0x0d, 0xcc, 0xfd, 0xb3, 0x35, 0xcd, +0x32, 0x3b, 0xaf, 0xf8, 0x53, 0xbf, 0x63, 0x59, 0x80, 0x65, 0x8a, 0xeb, 0xc5, 0x3a, 0x34, 0x72, +0x80, 0x40, 0x20, 0x95, 0x17, 0x64, 0xaf, 0x5e, 0x8d, 0x86, 0x1c, 0x82, 0x01, 0xab, 0x7f, 0xf1, +0x0d, 0xb7, 0xed, 0x99, 0xff, 0x00, 0x44, 0x9a, 0xcf, 0xff, 0x00, 0x0a, 0xdd, 0x1f, 0xff, 0x00, +0x92, 0x68, 0x17, 0x2b, 0x3e, 0x19, 0xa2, 0xbd, 0x63, 0xf6, 0xc2, 0xfd, 0x87, 0xbe, 0x27, 0x7e, +0xc1, 0x1f, 0x11, 0x74, 0xdf, 0x09, 0xfc, 0x56, 0xf0, 0xec, 0x3e, 0x1b, 0xd7, 0xb5, 0x6d, 0x35, +0x75, 0x7b, 0x5b, 0x68, 0xf5, 0x2b, 0x6b, 0xe1, 0x25, 0xb3, 0x4b, 0x24, 0x41, 0xf7, 0xdb, 0xc8, +0xea, 0x32, 0xf1, 0x38, 0xc1, 0x20, 0xf1, 0xe8, 0x6b, 0xc9, 0xe8, 0x11, 0xfa, 0xf5, 0xff, 0x00, +0x06, 0x7c, 0x1f, 0xf8, 0xca, 0xcf, 0x8c, 0xbf, 0xf6, 0x29, 0x59, 0x7f, 0xe9, 0x63, 0x57, 0xf4, +0x05, 0x5f, 0xcf, 0xef, 0xfc, 0x19, 0xf1, 0xff, 0x00, 0x27, 0x59, 0xf1, 0x9b, 0xfe, 0xc5, 0x2b, +0x2f, 0xfd, 0x2c, 0x6a, 0xfd, 0xeb, 0xf1, 0xf7, 0x8e, 0xf4, 0x9f, 0x85, 0xfe, 0x08, 0xd6, 0x3c, +0x49, 0xaf, 0xdf, 0x41, 0xa5, 0xe8, 0x3e, 0x1f, 0xb1, 0x9f, 0x53, 0xd4, 0xaf, 0x67, 0x38, 0x8a, +0xce, 0xda, 0x08, 0xda, 0x49, 0x65, 0x63, 0xfd, 0xd5, 0x45, 0x66, 0x3e, 0xc0, 0xd5, 0x47, 0x63, +0x45, 0xb1, 0xf3, 0xf7, 0xfc, 0x14, 0xcf, 0xfe, 0x0a, 0x87, 0xf0, 0xf7, 0xfe, 0x09, 0x77, 0xf0, +0x30, 0x78, 0xab, 0xc5, 0xe6, 0x4d, 0x5b, 0xc4, 0x1a, 0xc1, 0x92, 0xdf, 0xc3, 0x3e, 0x19, 0xb3, +0x99, 0x56, 0xfb, 0xc4, 0x17, 0x2a, 0x01, 0x6c, 0x12, 0x08, 0x86, 0xde, 0x3d, 0xc8, 0x66, 0xb8, +0x60, 0x56, 0x35, 0x65, 0x00, 0x3c, 0x8f, 0x14, 0x52, 0x7f, 0x37, 0xbf, 0xb7, 0x8f, 0xfc, 0x16, +0x33, 0xe3, 0xd7, 0xfc, 0x14, 0x27, 0x59, 0xd4, 0x23, 0xf1, 0x6f, 0x8c, 0x2f, 0x34, 0x1f, 0x06, +0xdd, 0x16, 0x48, 0xbc, 0x1f, 0xe1, 0xe9, 0xa4, 0xb1, 0xd1, 0xd2, 0x13, 0x81, 0xb2, 0x75, 0x56, +0xdf, 0x78, 0x4e, 0x01, 0x2d, 0x72, 0xce, 0x37, 0x16, 0x28, 0xb1, 0xa9, 0xd8, 0x38, 0x7f, 0xf8, +0x28, 0x57, 0xed, 0xc9, 0xe2, 0x4f, 0xf8, 0x28, 0xaf, 0xed, 0x63, 0xe2, 0x6f, 0x8a, 0x3e, 0x22, +0x37, 0x16, 0xf0, 0xea, 0x72, 0x7d, 0x97, 0x42, 0xd2, 0xe5, 0x7d, 0xc3, 0x42, 0xd2, 0xa3, 0x66, +0xfb, 0x2d, 0xa0, 0xe4, 0x8d, 0xc1, 0x58, 0xbc, 0x85, 0x78, 0x79, 0xa4, 0x99, 0xc0, 0x01, 0xb0, +0x3c, 0x54, 0x9c, 0x54, 0x93, 0x29, 0x76, 0x23, 0xb7, 0xb4, 0x8a, 0xd1, 0x36, 0xc5, 0x1c, 0x71, +0xaf, 0x4c, 0x2a, 0x85, 0xa9, 0x2b, 0xde, 0xff, 0x00, 0x64, 0x9f, 0xf8, 0x25, 0xe7, 0xc7, 0xff, +0x00, 0xdb, 0xab, 0x43, 0xb8, 0xd5, 0xbe, 0x15, 0xfc, 0x32, 0xd6, 0xbc, 0x4b, 0xa1, 0x5a, 0xca, +0xd0, 0x49, 0xab, 0xcb, 0x71, 0x6d, 0xa6, 0xe9, 0xc5, 0xd5, 0x8a, 0xba, 0xc7, 0x71, 0x75, 0x2c, +0x49, 0x33, 0x23, 0x0c, 0x32, 0xc4, 0x5d, 0x94, 0xf0, 0x40, 0xaf, 0x6b, 0xff, 0x00, 0x88, 0x6d, +0xbf, 0x6c, 0xcf, 0xfa, 0x24, 0xd6, 0x7f, 0xf8, 0x56, 0xe8, 0xff, 0x00, 0xfc, 0x93, 0x40, 0xb9, +0x59, 0xf0, 0xcd, 0x15, 0xf6, 0x67, 0xc4, 0x8f, 0xf8, 0x37, 0xe3, 0xf6, 0xb5, 0xf8, 0x49, 0xf0, +0xf3, 0x5e, 0xf1, 0x57, 0x88, 0x3e, 0x18, 0xd9, 0xd8, 0xe8, 0x3e, 0x19, 0xd3, 0x6e, 0x75, 0x7d, +0x4a, 0xe0, 0x78, 0xa3, 0x4a, 0x94, 0xdb, 0xdb, 0x5b, 0xc4, 0xd2, 0xca, 0xe1, 0x12, 0xe0, 0xb3, +0x6d, 0x44, 0x27, 0x0a, 0x09, 0x3d, 0x07, 0x35, 0xf1, 0x9a, 0xb6, 0xe5, 0x07, 0xd7, 0x9a, 0x05, +0x6b, 0x11, 0xde, 0x7f, 0xc7, 0x9c, 0xdf, 0xee, 0x1f, 0xe5, 0x5f, 0xd9, 0x5f, 0xec, 0x2f, 0xff, +0x00, 0x26, 0x57, 0xf0, 0x7f, 0xfe, 0xc4, 0x7d, 0x13, 0xff, 0x00, 0x48, 0x21, 0xaf, 0xe3, 0x52, +0xf3, 0xfe, 0x3c, 0xe6, 0xff, 0x00, 0x70, 0xff, 0x00, 0x2a, 0xfe, 0xca, 0xff, 0x00, 0x61, 0x7f, +0xf9, 0x32, 0xbf, 0x83, 0xff, 0x00, 0xf6, 0x23, 0xe8, 0x9f, 0xfa, 0x41, 0x0d, 0x1d, 0x4d, 0x23, +0xb3, 0x3e, 0x36, 0xff, 0x00, 0x83, 0xa8, 0xff, 0x00, 0xe5, 0x13, 0x5a, 0xa7, 0xfd, 0x8d, 0x7a, +0x37, 0xfe, 0x8f, 0x35, 0xfc, 0xd0, 0x8e, 0x95, 0xfd, 0x2f, 0x7f, 0xc1, 0xd4, 0x7f, 0xf2, 0x89, +0xad, 0x53, 0xfe, 0xc6, 0xbd, 0x1b, 0xff, 0x00, 0x47, 0x9a, 0xfe, 0x68, 0x47, 0x4a, 0xa9, 0x13, +0x23, 0xd8, 0xbf, 0xe0, 0x9d, 0x5f, 0xf2, 0x91, 0x5f, 0xd9, 0xe7, 0xfe, 0xca, 0xa7, 0x85, 0x3f, +0xf4, 0xf5, 0x69, 0x5f, 0xd8, 0xd5, 0x7f, 0x1c, 0xbf, 0xf0, 0x4e, 0xaf, 0xf9, 0x48, 0xaf, 0xec, +0xf3, 0xff, 0x00, 0x65, 0x53, 0xc2, 0x9f, 0xfa, 0x7a, 0xb4, 0xaf, 0xec, 0x6a, 0x88, 0xec, 0x11, +0x0a, 0x28, 0xa2, 0xa8, 0xa3, 0xe3, 0x3f, 0xf8, 0x38, 0x2b, 0xe1, 0xf6, 0x9f, 0xf1, 0x13, 0xfe, +0x09, 0x05, 0xf1, 0xa2, 0x1d, 0x42, 0x3d, 0xdf, 0xd8, 0xfa, 0x65, 0xbe, 0xb5, 0x6a, 0xe1, 0x41, +0x78, 0x6e, 0x2d, 0x2f, 0x20, 0x9e, 0x32, 0xa4, 0xf4, 0xc9, 0x42, 0x84, 0x8e, 0x4a, 0xbb, 0x0e, +0xf5, 0xfc, 0xa7, 0x8a, 0xfe, 0xb3, 0x7f, 0xe0, 0xb9, 0xbf, 0xf2, 0x88, 0xef, 0x8f, 0x9f, 0xf6, +0x2a, 0xcd, 0xff, 0x00, 0xa1, 0xa5, 0x7f, 0x26, 0x55, 0x9b, 0xdc, 0x99, 0x10, 0xea, 0x1a, 0xa5, +0xce, 0x85, 0x65, 0x35, 0xf5, 0x9c, 0xcd, 0x6f, 0x79, 0x62, 0x86, 0xe2, 0xde, 0x64, 0xfb, 0xd1, +0x48, 0x9f, 0x32, 0x30, 0xf7, 0x0c, 0x01, 0x1f, 0x4a, 0xfe, 0xe0, 0x07, 0xde, 0xfc, 0xeb, 0xf8, +0x77, 0xf1, 0x2f, 0xfc, 0x8b, 0x9a, 0x87, 0xfd, 0x7b, 0x49, 0xff, 0x00, 0xa0, 0x9a, 0xfe, 0xe1, +0xdb, 0xef, 0x1f, 0xf3, 0xd8, 0xd3, 0x41, 0x12, 0xb6, 0xbf, 0xaf, 0xd9, 0xf8, 0x5f, 0x47, 0xba, +0xd4, 0x35, 0x0b, 0x9b, 0x7b, 0x2d, 0x3e, 0xc6, 0x17, 0xb8, 0xb9, 0xb9, 0xb8, 0x95, 0x62, 0x86, +0xda, 0x34, 0x52, 0xcf, 0x23, 0xbb, 0x10, 0xaa, 0x8a, 0xa0, 0x92, 0xc4, 0x80, 0x00, 0x24, 0xf1, +0x5f, 0x82, 0xbf, 0xf0, 0x55, 0xbf, 0xf8, 0x3a, 0x03, 0xc4, 0xbe, 0x3a, 0xf1, 0x1e, 0xa5, 0xe0, +0x5f, 0xd9, 0x9e, 0xf3, 0xfe, 0x11, 0xbf, 0x0c, 0xd9, 0xbc, 0x96, 0xd7, 0x7e, 0x3a, 0x92, 0xdd, +0x24, 0xd4, 0x35, 0x9f, 0xe1, 0x3f, 0x60, 0x8e, 0x45, 0x2b, 0x6f, 0x01, 0x1b, 0xb1, 0x33, 0xa9, +0x99, 0xf7, 0x06, 0x41, 0x06, 0xd0, 0xcf, 0xea, 0x9f, 0xf0, 0x75, 0xd7, 0xfc, 0x14, 0x7a, 0xff, +0x00, 0xc0, 0xde, 0x17, 0xd0, 0x7f, 0x66, 0xff, 0x00, 0x09, 0xdf, 0x49, 0x67, 0x37, 0x8b, 0xac, +0x86, 0xbb, 0xe3, 0x59, 0xa1, 0x6c, 0x3b, 0x69, 0xde, 0x63, 0x25, 0xa5, 0x86, 0xe1, 0xc8, 0x59, +0xe5, 0x8a, 0x59, 0x25, 0x5f, 0x94, 0xf9, 0x70, 0x44, 0xa7, 0x74, 0x73, 0xba, 0x9f, 0xc2, 0x51, +0xd2, 0x86, 0xca, 0x93, 0xb6, 0x88, 0xd0, 0xf1, 0xc7, 0x8b, 0xb5, 0x8f, 0x8a, 0x1e, 0x2d, 0xb9, +0xf1, 0x07, 0x8a, 0x35, 0x8d, 0x5b, 0xc4, 0xfe, 0x20, 0xbd, 0x39, 0xb9, 0xd5, 0x35, 0x8b, 0xd9, +0x75, 0x0b, 0xeb, 0x93, 0xea, 0xf3, 0xcc, 0xcd, 0x23, 0x77, 0xea, 0xc7, 0xa9, 0xf5, 0xac, 0xfa, +0xde, 0xf8, 0x61, 0xf0, 0xbb, 0xc4, 0xdf, 0x1b, 0x7c, 0x7f, 0xa6, 0x78, 0x53, 0xc1, 0xbe, 0x1f, +0xd6, 0x3c, 0x55, 0xe2, 0x6d, 0x66, 0x43, 0x15, 0x8e, 0x97, 0xa5, 0x5a, 0x3d, 0xd5, 0xd5, 0xc9, +0x0a, 0x59, 0xb6, 0xa2, 0x02, 0x76, 0xaa, 0x86, 0x66, 0x63, 0x85, 0x45, 0x56, 0x66, 0x21, 0x41, +0x23, 0xec, 0x1d, 0x37, 0xfe, 0x0d, 0xc3, 0xfd, 0xb3, 0x75, 0x1b, 0x28, 0xe6, 0x6f, 0x83, 0xf1, +0xda, 0x99, 0x06, 0x7c, 0xa9, 0xfc, 0x59, 0xa2, 0x89, 0x17, 0x9e, 0x32, 0x16, 0xec, 0x81, 0x9e, +0xb8, 0xce, 0x79, 0xe7, 0x07, 0x20, 0x22, 0x35, 0x67, 0xc3, 0xec, 0xbb, 0xd7, 0x07, 0x9f, 0xad, +0x77, 0x1f, 0xb3, 0xaf, 0xed, 0x31, 0xf1, 0x13, 0xf6, 0x43, 0xf1, 0xca, 0xf8, 0x97, 0xe1, 0x7f, +0x8d, 0x3c, 0x43, 0xe0, 0x3d, 0x6b, 0x72, 0xb4, 0xb3, 0x69, 0x17, 0x46, 0x28, 0xef, 0x02, 0x9c, +0xaa, 0x5c, 0x42, 0x73, 0x0d, 0xcc, 0x60, 0xe0, 0xf9, 0x73, 0xa3, 0xa1, 0x23, 0x25, 0x4d, 0x7d, +0x2f, 0xe3, 0x8f, 0xf8, 0x37, 0xa7, 0xf6, 0xc6, 0xf0, 0x0f, 0x87, 0x6e, 0x35, 0x4b, 0x9f, 0x83, +0x17, 0x9a, 0x85, 0xb5, 0xa2, 0x34, 0x92, 0xc7, 0xa5, 0xeb, 0xfa, 0x55, 0xf5, 0xc8, 0x50, 0x33, +0xf2, 0x41, 0x1d, 0xc9, 0x96, 0x53, 0xe8, 0xb1, 0xab, 0x31, 0xf4, 0xaf, 0x8d, 0xf5, 0x2d, 0x36, +0xeb, 0x44, 0xd5, 0x2e, 0xac, 0x6f, 0xad, 0x6e, 0xac, 0x6f, 0xec, 0x27, 0x92, 0xd6, 0xea, 0xd6, +0xe6, 0x16, 0x86, 0x7b, 0x59, 0xa3, 0x62, 0x92, 0x45, 0x22, 0x30, 0x0c, 0x8e, 0x8c, 0x0a, 0xb2, +0xb0, 0x0c, 0xa4, 0x10, 0x40, 0x22, 0x80, 0xd5, 0x1f, 0xd1, 0x07, 0xfc, 0x11, 0x67, 0xfe, 0x0e, +0x2d, 0xd3, 0x7f, 0x6c, 0xfd, 0x7b, 0x4b, 0xf8, 0x55, 0xf1, 0x8a, 0xdf, 0x4b, 0xf0, 0xbf, 0xc5, +0x4b, 0xc0, 0x2d, 0xf4, 0x8d, 0x5a, 0xd7, 0xf7, 0x3a, 0x57, 0x8b, 0x1c, 0x67, 0x11, 0x84, 0x62, +0x7e, 0xcd, 0x78, 0x57, 0xfe, 0x59, 0x64, 0xc7, 0x2b, 0x06, 0xf2, 0xca, 0x33, 0x2c, 0x03, 0xf5, +0x5a, 0xbf, 0x88, 0x5b, 0x7b, 0x89, 0xac, 0x6e, 0xa1, 0xb8, 0xb7, 0x9a, 0x7b, 0x5b, 0x8b, 0x79, +0x16, 0x68, 0x67, 0x82, 0x56, 0x8a, 0x68, 0x24, 0x52, 0x19, 0x1d, 0x1d, 0x48, 0x65, 0x65, 0x60, +0x08, 0x60, 0x41, 0x04, 0x02, 0x30, 0x40, 0xaf, 0xea, 0x9b, 0xfe, 0x08, 0x3f, 0xff, 0x00, 0x05, +0x1a, 0xb8, 0xff, 0x00, 0x82, 0x8e, 0x7e, 0xc3, 0xf6, 0x3a, 0xc7, 0x88, 0xae, 0x62, 0x9b, 0xe2, +0x37, 0x82, 0xae, 0x3f, 0xe1, 0x1e, 0xf1, 0x51, 0x55, 0x48, 0xfe, 0xd9, 0x3a, 0x22, 0xb4, 0x37, +0xc1, 0x17, 0x18, 0x5b, 0x88, 0x59, 0x5d, 0xb0, 0xaa, 0xa2, 0x65, 0xb8, 0x45, 0x01, 0x50, 0x53, +0x4c, 0xb8, 0xbb, 0x9f, 0x9b, 0x7f, 0xf0, 0x77, 0xd7, 0xec, 0xef, 0xff, 0x00, 0x08, 0xef, 0xed, +0x01, 0xf0, 0x97, 0xe2, 0xb5, 0xa4, 0x0d, 0xe4, 0xf8, 0xa7, 0x43, 0xb9, 0xf0, 0xc6, 0xa3, 0x22, +0x28, 0x58, 0xd2, 0x6b, 0x29, 0xbe, 0xd1, 0x6e, 0x5b, 0xd5, 0xe4, 0x8e, 0xf2, 0x70, 0x0f, 0xf7, +0x6d, 0x71, 0xd1, 0x54, 0x57, 0xe3, 0xd8, 0xaf, 0xe9, 0xdb, 0xfe, 0x0e, 0x6a, 0xfd, 0x9d, 0xff, +0x00, 0xe1, 0x7d, 0x7f, 0xc1, 0x28, 0x3c, 0x55, 0xaa, 0x5b, 0x5b, 0xc9, 0x71, 0xaa, 0x7c, 0x32, +0xd4, 0xec, 0xbc, 0x61, 0x6a, 0x88, 0x39, 0xd9, 0x13, 0x9b, 0x6b, 0xa6, 0x27, 0x23, 0xe5, 0x4b, +0x3b, 0xbb, 0x99, 0x3b, 0xff, 0x00, 0xab, 0x1c, 0x77, 0x1f, 0xcc, 0x48, 0xe9, 0x48, 0x99, 0x6e, +0x7e, 0x9d, 0x7f, 0xc1, 0xa8, 0x9f, 0xb4, 0x59, 0xf8, 0x57, 0xff, 0x00, 0x05, 0x18, 0xd6, 0x3c, +0x07, 0x73, 0x75, 0xe5, 0x69, 0xdf, 0x15, 0xbc, 0x33, 0x35, 0xbc, 0x50, 0x67, 0xfe, 0x3e, 0x35, +0x1d, 0x3c, 0x9b, 0xb8, 0x38, 0xe8, 0x76, 0xdb, 0x7f, 0x68, 0x9e, 0x99, 0xf9, 0xb8, 0xc7, 0x39, +0xfe, 0x90, 0xab, 0xf8, 0xd0, 0xfd, 0x8a, 0xff, 0x00, 0x68, 0x77, 0xfd, 0x92, 0xbf, 0x6c, 0x0f, +0x86, 0x3f, 0x13, 0x04, 0xd2, 0x43, 0x6f, 0xe0, 0x9f, 0x12, 0x59, 0x6a, 0x57, 0xe6, 0x3f, 0xbc, +0xf6, 0x22, 0x50, 0xb7, 0x91, 0x8c, 0x02, 0x72, 0xf6, 0xcd, 0x32, 0x70, 0x0f, 0xdf, 0xe8, 0x7a, +0x57, 0xf6, 0x59, 0x0c, 0xeb, 0x70, 0xbb, 0x94, 0xab, 0x21, 0x00, 0xab, 0x03, 0x90, 0xc0, 0xd5, +0x44, 0xa8, 0xec, 0x3e, 0x8a, 0x2b, 0x99, 0xf8, 0xcd, 0xf1, 0x57, 0x4b, 0xf8, 0x17, 0xf0, 0x87, +0xc5, 0x5e, 0x36, 0xd7, 0x24, 0xf2, 0x74, 0x5f, 0x07, 0xe8, 0xf7, 0x9a, 0xe6, 0xa1, 0x26, 0x71, +0xe5, 0xdb, 0xda, 0xc0, 0xf3, 0x4a, 0x7f, 0x04, 0x46, 0xaa, 0x03, 0xf9, 0x85, 0xff, 0x00, 0x83, +0x89, 0xff, 0x00, 0x68, 0x85, 0xfd, 0xa2, 0x7f, 0xe0, 0xad, 0x5f, 0x11, 0x8d, 0xbd, 0xc4, 0x77, +0x5a, 0x5f, 0x80, 0x62, 0xb4, 0xf0, 0x5d, 0x83, 0xaf, 0xf0, 0x8b, 0x44, 0x32, 0x5c, 0xa1, 0xf7, +0x5b, 0xeb, 0x8b, 0xd5, 0xff, 0x00, 0x80, 0x8f, 0xa0, 0xf8, 0x8c, 0xf4, 0xad, 0x2f, 0x19, 0xf8, +0xe7, 0x56, 0xf8, 0xa5, 0xe3, 0x5d, 0x6b, 0xc5, 0x3a, 0xf4, 0xdf, 0x68, 0xd7, 0xbc, 0x51, 0xa8, +0xdc, 0xeb, 0x3a, 0x9c, 0xbc, 0xfe, 0xf6, 0xee, 0xe6, 0x56, 0x9e, 0x66, 0xe4, 0x93, 0xcc, 0x8e, +0xc7, 0x92, 0x4f, 0x35, 0x97, 0x2c, 0x8b, 0x14, 0x6c, 0xcc, 0x70, 0xaa, 0x09, 0x27, 0xd0, 0x56, +0x64, 0x3d, 0xcf, 0xde, 0x6f, 0xf8, 0x33, 0xf3, 0xf6, 0x74, 0xfe, 0xc5, 0xf8, 0x29, 0xf1, 0x77, +0xe2, 0xb5, 0xd4, 0x6c, 0xb3, 0x78, 0x9b, 0x5a, 0xb5, 0xf0, 0xbe, 0x9e, 0x64, 0x8f, 0x05, 0x60, +0xb1, 0x84, 0xdc, 0x4b, 0x24, 0x67, 0x1f, 0x76, 0x49, 0x6f, 0x55, 0x0e, 0x09, 0xf9, 0xad, 0x31, +0xc1, 0x53, 0x9f, 0xd0, 0xef, 0xf8, 0x2b, 0x9f, 0x3f, 0xf0, 0x4b, 0x2f, 0xda, 0x3b, 0xfe, 0xc9, +0xaf, 0x88, 0x3f, 0xf4, 0xdf, 0x35, 0x60, 0xff, 0x00, 0xc1, 0x15, 0x7f, 0x67, 0x36, 0xfd, 0x97, +0x3f, 0xe0, 0x97, 0x5f, 0x06, 0xfc, 0x2b, 0x71, 0x6e, 0xd6, 0xba, 0xa5, 0xc6, 0x81, 0x1e, 0xbd, +0xaa, 0x47, 0x22, 0x01, 0x2c, 0x77, 0x9a, 0x8b, 0x35, 0xf4, 0xd1, 0xb9, 0x1d, 0x5a, 0x36, 0xb8, +0xf2, 0xb3, 0x93, 0x81, 0x10, 0x03, 0x80, 0x2b, 0x7b, 0xfe, 0x0a, 0xe7, 0xff, 0x00, 0x28, 0xb2, +0xfd, 0xa3, 0x7f, 0xec, 0x9b, 0x78, 0x83, 0xff, 0x00, 0x4d, 0xf3, 0x53, 0x35, 0x8e, 0x87, 0xf2, +0x5d, 0xf0, 0xa3, 0xe2, 0xff, 0x00, 0x8c, 0x3e, 0x02, 0x6b, 0x32, 0x6a, 0x5e, 0x03, 0xf1, 0x77, +0x8a, 0xfc, 0x0b, 0xa8, 0x4d, 0xfe, 0xb2, 0xeb, 0xc3, 0x9a, 0xc5, 0xce, 0x93, 0x34, 0x83, 0x04, +0x61, 0x9e, 0xdd, 0xd0, 0x91, 0x83, 0x8c, 0x12, 0x46, 0x09, 0xf5, 0xaf, 0xb1, 0x7e, 0x0d, 0x7f, +0xc1, 0xca, 0x7f, 0xb5, 0xcf, 0xc0, 0x1d, 0x39, 0xda, 0xe3, 0xc7, 0x5a, 0x37, 0xc4, 0x3b, 0x1b, +0x38, 0x49, 0x8e, 0xcf, 0xc5, 0xfa, 0x24, 0x37, 0x4a, 0x30, 0x18, 0xf3, 0x3d, 0xb7, 0xd9, 0xee, +0x58, 0x9c, 0xf5, 0x79, 0x9b, 0x18, 0x18, 0xe3, 0x20, 0xfc, 0x33, 0x54, 0xfc, 0x41, 0xff, 0x00, +0x20, 0x1b, 0xef, 0xfa, 0xf7, 0x93, 0xff, 0x00, 0x41, 0x34, 0x8c, 0xae, 0xd1, 0xfd, 0xbf, 0x68, +0xd7, 0x2d, 0x7d, 0xa5, 0xdb, 0xdc, 0x30, 0x0a, 0xd3, 0xc4, 0x92, 0x10, 0x3a, 0x02, 0x54, 0x1e, +0x3f, 0x3a, 0xb5, 0x54, 0x7c, 0x33, 0xff, 0x00, 0x22, 0xe5, 0x87, 0xfd, 0x7b, 0x47, 0xff, 0x00, +0xa0, 0x0a, 0xf8, 0xcf, 0xfe, 0x0b, 0xdf, 0xff, 0x00, 0x05, 0x11, 0xba, 0xff, 0x00, 0x82, 0x77, +0xfe, 0xc2, 0xba, 0x86, 0xa7, 0xe1, 0xbb, 0xb5, 0xb5, 0xf8, 0x87, 0xe3, 0xab, 0x8f, 0xf8, 0x46, +0xfc, 0x31, 0x20, 0x01, 0x9e, 0xc2, 0x59, 0x23, 0x66, 0x9e, 0xf8, 0x2f, 0xad, 0xbc, 0x0b, 0x23, +0x21, 0x21, 0x97, 0xce, 0x6b, 0x70, 0xca, 0x43, 0x10, 0x6a, 0xfa, 0x1a, 0xcb, 0x73, 0xe7, 0x9f, +0xf8, 0x2d, 0x1f, 0xfc, 0x1c, 0x6d, 0x63, 0xfb, 0x20, 0x78, 0x9b, 0x54, 0xf8, 0x53, 0xf0, 0x56, +0xdf, 0x48, 0xf1, 0x47, 0xc4, 0xcd, 0x3c, 0x3d, 0xae, 0xb5, 0xae, 0xdd, 0x7f, 0xa4, 0x69, 0x5e, +0x14, 0x9f, 0xa3, 0x40, 0xa8, 0x08, 0x17, 0x37, 0xa9, 0xce, 0xe4, 0x24, 0x45, 0x0b, 0xe0, 0x3f, +0x98, 0xcb, 0x24, 0x0b, 0xf8, 0x37, 0xfb, 0x45, 0xfe, 0xd3, 0x3f, 0x11, 0x3f, 0x6b, 0xbf, 0x1b, +0x37, 0x88, 0xbe, 0x28, 0x78, 0xd7, 0xc4, 0x5e, 0x3c, 0xd6, 0x37, 0x33, 0xc7, 0x2e, 0xaf, 0x76, +0x66, 0x8a, 0xd3, 0x71, 0x24, 0xad, 0xbc, 0x03, 0x10, 0xdb, 0x21, 0xc9, 0xfd, 0xdc, 0x08, 0x88, +0x32, 0x70, 0xa3, 0x35, 0xc3, 0xbc, 0x8f, 0x3c, 0x8d, 0x24, 0x92, 0x49, 0x34, 0xb2, 0x31, 0x77, +0x92, 0x47, 0x2e, 0xf2, 0x31, 0x39, 0x2c, 0xcc, 0x79, 0x2c, 0x49, 0x24, 0x93, 0xc9, 0x27, 0x26, +0x9d, 0x14, 0x4f, 0x71, 0x3c, 0x71, 0x46, 0x8f, 0x24, 0xb3, 0x38, 0x8e, 0x34, 0x45, 0x2c, 0xd2, +0x31, 0x38, 0x0a, 0x00, 0xe4, 0x92, 0x48, 0x00, 0x0e, 0x49, 0x20, 0x54, 0x99, 0xb9, 0x36, 0x31, +0x54, 0x22, 0xe1, 0x40, 0x03, 0xd0, 0x0a, 0x5a, 0xfb, 0x23, 0xe1, 0xb7, 0xfc, 0x1b, 0xf3, 0xfb, +0x61, 0x7c, 0x52, 0xf0, 0xa5, 0xae, 0xb5, 0x63, 0xf0, 0x57, 0x54, 0xd3, 0xac, 0x6f, 0xa3, 0x59, +0x60, 0x4d, 0x67, 0x58, 0xd3, 0xb4, 0xbb, 0xb6, 0x53, 0x9f, 0xbf, 0x6d, 0x71, 0x70, 0x93, 0xc4, +0xc3, 0x1c, 0xac, 0xb1, 0xa3, 0x72, 0x38, 0xad, 0xef, 0xf8, 0x86, 0xdb, 0xf6, 0xcc, 0xff, 0x00, +0xa2, 0x4d, 0x67, 0xff, 0x00, 0x85, 0x6e, 0x8f, 0xff, 0x00, 0xc9, 0x34, 0x07, 0x2b, 0x3e, 0x19, +0x3d, 0x2b, 0xfa, 0x40, 0xff, 0x00, 0x83, 0x50, 0xff, 0x00, 0x67, 0x1f, 0xf8, 0x55, 0x1f, 0xf0, +0x4e, 0x0b, 0xef, 0x1c, 0xdd, 0x40, 0xab, 0xa9, 0x7c, 0x56, 0xf1, 0x25, 0xde, 0xa5, 0x1c, 0x8d, +0x19, 0x59, 0x45, 0x85, 0xa1, 0xfb, 0x0c, 0x11, 0xb6, 0x7a, 0x8f, 0x3a, 0x0b, 0xb9, 0x54, 0xe0, +0x64, 0x5c, 0x67, 0x91, 0x82, 0x7f, 0x28, 0x6e, 0x7f, 0xe0, 0xdb, 0x8f, 0xdb, 0x3d, 0x6d, 0xa4, +0x31, 0xfc, 0x24, 0xb3, 0x69, 0x02, 0x92, 0xab, 0xff, 0x00, 0x09, 0x6e, 0x8f, 0xc9, 0xc7, 0x03, +0xfe, 0x3e, 0xab, 0xfa, 0x54, 0xfd, 0x92, 0xbe, 0x03, 0xd9, 0xfe, 0xcb, 0x3f, 0xb3, 0x07, 0xc3, +0xef, 0x86, 0xf6, 0x32, 0x24, 0xd6, 0xde, 0x05, 0xf0, 0xf5, 0x86, 0x86, 0x26, 0x50, 0x07, 0xda, +0x5e, 0xde, 0x04, 0x8d, 0xe6, 0x3c, 0x0c, 0xb4, 0x8e, 0xac, 0xe4, 0xe0, 0x64, 0xb1, 0x3c, 0x66, +0x84, 0x38, 0xa3, 0xd1, 0xab, 0xf1, 0x77, 0xfe, 0x0b, 0x11, 0xff, 0x00, 0x07, 0x36, 0x4b, 0xf0, +0xbf, 0xc5, 0x7a, 0xb7, 0xc3, 0x1f, 0xd9, 0xbe, 0x5d, 0x36, 0xfb, 0x5c, 0xd2, 0xa5, 0x6b, 0x4d, +0x5b, 0xc7, 0xb3, 0x47, 0x1d, 0xed, 0x9d, 0x94, 0xab, 0x90, 0xf0, 0xe9, 0xd0, 0xb0, 0x68, 0xa7, +0x91, 0x5b, 0x86, 0x9e, 0x50, 0xd1, 0x29, 0x42, 0xab, 0x1c, 0xbb, 0xb7, 0xa7, 0xb9, 0x7f, 0xc1, +0xcc, 0xdf, 0xf0, 0x52, 0x3d, 0x47, 0xf6, 0x38, 0xfd, 0x92, 0x34, 0xdf, 0x87, 0xfe, 0x0d, 0xd4, +0xa6, 0xd3, 0x7c, 0x7b, 0xf1, 0x81, 0xae, 0x74, 0xf1, 0x79, 0x6e, 0xfb, 0x67, 0xd2, 0x74, 0x78, +0x95, 0x45, 0xec, 0xf1, 0xb0, 0xe5, 0x26, 0x93, 0xcd, 0x8a, 0x08, 0xdb, 0x86, 0x02, 0x69, 0xa4, +0x46, 0x57, 0x84, 0x1a, 0xfe, 0x6c, 0x62, 0x89, 0x60, 0x89, 0x51, 0x15, 0x51, 0x54, 0x05, 0x55, +0x51, 0x80, 0xa0, 0x74, 0x02, 0xa9, 0xb0, 0x93, 0xb1, 0xd2, 0xfc, 0x63, 0xf8, 0xc3, 0xe2, 0xef, +0xda, 0x27, 0xc6, 0xd2, 0xf8, 0x93, 0xe2, 0x07, 0x8a, 0x3c, 0x41, 0xe3, 0x6d, 0x7e, 0x6d, 0xd9, +0xbf, 0xd7, 0x35, 0x09, 0x6f, 0xe7, 0x40, 0x4e, 0x76, 0x23, 0x48, 0x4f, 0x96, 0x83, 0x8c, 0x22, +0x6d, 0x45, 0x00, 0x00, 0x00, 0x02, 0xb9, 0xc0, 0x36, 0x8e, 0x2a, 0xd6, 0x83, 0xa0, 0xea, 0x1e, +0x2c, 0xd7, 0xec, 0x74, 0x9d, 0x23, 0x4f, 0xd4, 0x35, 0x7d, 0x5b, 0x54, 0xb8, 0x4b, 0x4b, 0x2b, +0x0b, 0x0b, 0x67, 0xba, 0xba, 0xbd, 0x9d, 0xce, 0xd4, 0x8a, 0x28, 0xa3, 0x05, 0xe4, 0x91, 0x98, +0x85, 0x55, 0x50, 0x58, 0x92, 0x00, 0x04, 0xd7, 0xd9, 0x5e, 0x14, 0xff, 0x00, 0x83, 0x76, 0xff, +0x00, 0x6c, 0x9f, 0x17, 0x68, 0x70, 0x6a, 0x11, 0xfc, 0x19, 0x9a, 0xc6, 0x2b, 0x94, 0x59, 0x23, +0x8a, 0xff, 0x00, 0xc4, 0x9a, 0x45, 0xb5, 0xc6, 0xd2, 0x01, 0x05, 0xa2, 0x6b, 0xad, 0xf1, 0x9e, +0x71, 0xb5, 0xc2, 0xb0, 0x20, 0x82, 0x05, 0x49, 0x3a, 0xb3, 0xe2, 0xb2, 0x33, 0x5a, 0xdf, 0x0e, +0xbc, 0x7b, 0xaf, 0x7c, 0x1e, 0xf1, 0x84, 0x1e, 0x22, 0xf0, 0x7e, 0xbd, 0xad, 0x78, 0x4b, 0xc4, +0x16, 0xa3, 0x10, 0xea, 0x9a, 0x25, 0xfc, 0xba, 0x7d, 0xec, 0x40, 0xf5, 0x0b, 0x34, 0x2c, 0xae, +0x01, 0xc7, 0x23, 0x38, 0x35, 0xf6, 0x2e, 0xb7, 0xff, 0x00, 0x06, 0xe6, 0x7e, 0xd9, 0x9a, 0x1e, +0x9b, 0x25, 0xd1, 0xf8, 0x3a, 0x2e, 0xd6, 0x10, 0x58, 0xc5, 0x6d, 0xe2, 0xad, 0x1a, 0x49, 0x48, +0x03, 0x27, 0x6a, 0x9b, 0xb0, 0x5b, 0xe8, 0xb9, 0x63, 0xd0, 0x02, 0x78, 0xaf, 0x8e, 0xbc, 0x7b, +0xe0, 0x2d, 0x77, 0xe1, 0x57, 0x8d, 0x75, 0x3f, 0x0d, 0x78, 0xa3, 0x45, 0xd5, 0xbc, 0x39, 0xe2, +0x2d, 0x16, 0x6f, 0xb3, 0xea, 0x1a, 0x5e, 0xa7, 0x68, 0xf6, 0x97, 0x96, 0x52, 0x6d, 0x0c, 0x16, +0x48, 0x9c, 0x06, 0x5c, 0xab, 0x2b, 0x0c, 0x8c, 0x32, 0xb0, 0x61, 0x90, 0x41, 0x20, 0x6a, 0x8f, +0xd8, 0xaf, 0xf8, 0x24, 0xa7, 0xfc, 0x1c, 0xff, 0x00, 0xab, 0xe9, 0x9e, 0x25, 0xd3, 0x7e, 0x1f, +0xfe, 0xd3, 0xd7, 0xd6, 0xf7, 0xda, 0x45, 0xe9, 0x4b, 0x6b, 0x0f, 0x88, 0x31, 0xc0, 0x96, 0xf3, +0x69, 0xf2, 0x16, 0xc2, 0x8d, 0x52, 0x38, 0xc2, 0xc6, 0xd0, 0x90, 0x71, 0xf6, 0xa8, 0xd5, 0x4c, +0x7b, 0x54, 0xca, 0x8e, 0xad, 0x24, 0xd1, 0xfe, 0xec, 0x5a, 0xdd, 0x2d, 0xdc, 0x61, 0xd0, 0xab, +0x23, 0x00, 0xca, 0xca, 0xdb, 0x95, 0xc1, 0xe8, 0x41, 0xf4, 0xf7, 0xaf, 0xe2, 0x1c, 0x8c, 0xd7, +0xf4, 0x01, 0xff, 0x00, 0x06, 0xa8, 0xff, 0x00, 0xc1, 0x47, 0xb5, 0x0f, 0x8d, 0x5f, 0x07, 0xf5, +0xcf, 0xd9, 0xff, 0x00, 0xc5, 0x9a, 0x84, 0x97, 0xfa, 0xe7, 0xc3, 0x2b, 0x28, 0xf5, 0x2f, 0x0b, +0x4f, 0x71, 0x31, 0x69, 0x66, 0xd0, 0x8b, 0xac, 0x2d, 0x6b, 0xce, 0x4e, 0xdb, 0x39, 0x9e, 0x24, +0x52, 0x4e, 0x04, 0x57, 0x50, 0x46, 0xaa, 0xa2, 0x1e, 0x5a, 0x2e, 0x2e, 0xfa, 0x1f, 0x84, 0x3f, +0x18, 0x3f, 0xe4, 0xaf, 0x78, 0xb3, 0xfe, 0xc3, 0x97, 0xff, 0x00, 0xfa, 0x53, 0x25, 0x73, 0xb5, +0xd1, 0x7c, 0x60, 0xff, 0x00, 0x92, 0xbd, 0xe2, 0xcf, 0xfb, 0x0e, 0x5f, 0xff, 0x00, 0xe9, 0x4c, +0x95, 0xce, 0xd2, 0x22, 0x5b, 0x9f, 0xd5, 0x27, 0xfc, 0x1b, 0xa9, 0xff, 0x00, 0x28, 0x69, 0xf8, +0x2b, 0xff, 0x00, 0x5e, 0xda, 0xa7, 0xfe, 0x9e, 0x2f, 0xab, 0xed, 0x8a, 0xf8, 0x9f, 0xfe, 0x0d, +0xd4, 0xff, 0x00, 0x94, 0x34, 0xfc, 0x15, 0xff, 0x00, 0xaf, 0x6d, 0x53, 0xff, 0x00, 0x4f, 0x17, +0xd5, 0xf6, 0xc5, 0x54, 0x76, 0x34, 0x61, 0x45, 0x14, 0x55, 0x08, 0xe6, 0x7c, 0x11, 0xf1, 0x9b, +0xc2, 0x7f, 0x13, 0x75, 0x1d, 0x5a, 0xcf, 0xc3, 0x7e, 0x26, 0xf0, 0xef, 0x88, 0x6f, 0x34, 0x1b, +0xb9, 0x74, 0xfd, 0x4e, 0x0d, 0x33, 0x53, 0x86, 0xee, 0x4d, 0x36, 0xe6, 0x19, 0x1a, 0x29, 0x60, +0x9d, 0x63, 0x62, 0x63, 0x92, 0x39, 0x11, 0xd1, 0x91, 0x80, 0x2a, 0xca, 0x41, 0x00, 0x82, 0x2b, +0xa6, 0xaf, 0xe3, 0xa3, 0xfe, 0x0a, 0x05, 0x77, 0x36, 0x87, 0xff, 0x00, 0x05, 0x2e, 0xf8, 0xff, +0x00, 0xa9, 0x58, 0xcd, 0x35, 0x8e, 0xa5, 0x69, 0xf1, 0x5b, 0xc5, 0x6f, 0x05, 0xdd, 0xb4, 0x86, +0x1b, 0x88, 0x1b, 0xfb, 0x66, 0xf0, 0x65, 0x24, 0x52, 0x19, 0x4e, 0x09, 0x19, 0x04, 0x75, 0xaf, +0x42, 0xf8, 0x0f, 0xff, 0x00, 0x05, 0xb8, 0xfd, 0xab, 0x7f, 0x67, 0x35, 0x86, 0x2d, 0x0f, 0xe3, +0x67, 0x8b, 0xb5, 0x5b, 0x18, 0x98, 0x16, 0xb2, 0xf1, 0x33, 0xc7, 0xe2, 0x18, 0xa5, 0x51, 0xfc, +0x1b, 0xef, 0x56, 0x59, 0x91, 0x7d, 0xa3, 0x91, 0x08, 0x1c, 0x02, 0x07, 0x15, 0x3c, 0xc2, 0xe6, +0x47, 0xf5, 0xab, 0x5f, 0x09, 0x7f, 0xc1, 0xcb, 0x9f, 0xf2, 0x85, 0x5f, 0x8c, 0x1f, 0xf5, 0xf3, +0xe1, 0xdf, 0xfd, 0x48, 0xb4, 0xba, 0xec, 0x7f, 0xe0, 0x88, 0xff, 0x00, 0xb7, 0x37, 0x8c, 0xbf, +0xe0, 0xa1, 0x9f, 0xb0, 0x8e, 0x9d, 0xf1, 0x1b, 0xc7, 0xd6, 0xbe, 0x1d, 0xb5, 0xf1, 0x14, 0xda, +0xc5, 0xfe, 0x97, 0x28, 0xd1, 0x2d, 0x25, 0xb5, 0xb5, 0x92, 0x3b, 0x77, 0x08, 0xaf, 0xb2, 0x49, +0x65, 0x21, 0xd8, 0x72, 0xd8, 0x60, 0xb9, 0x3c, 0x2a, 0x8e, 0x2b, 0x8e, 0xff, 0x00, 0x83, 0x97, +0x3f, 0xe5, 0x0a, 0xbf, 0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x74, 0x0d, 0xec, +0x7f, 0x2e, 0x15, 0xd8, 0x7e, 0xce, 0xff, 0x00, 0xf2, 0x71, 0x3f, 0x0f, 0x7f, 0xec, 0x6a, 0xd2, +0x7f, 0xf4, 0xb6, 0x2a, 0xe3, 0xeb, 0xb0, 0xfd, 0x9d, 0xff, 0x00, 0xe4, 0xe2, 0x7e, 0x1e, 0xff, +0x00, 0xd8, 0xd5, 0xa4, 0xff, 0x00, 0xe9, 0x6c, 0x55, 0x26, 0x67, 0xf6, 0x99, 0x5f, 0xca, 0x9f, +0xfc, 0x1c, 0x2f, 0xf1, 0x5a, 0xeb, 0xe2, 0xc7, 0xfc, 0x16, 0x03, 0xe2, 0xf3, 0x4d, 0x71, 0x24, +0xd6, 0x7e, 0x19, 0x9a, 0xc3, 0xc3, 0xd6, 0x08, 0xe3, 0xfe, 0x3d, 0xe2, 0xb7, 0xb0, 0xb7, 0x32, +0x20, 0xf6, 0x37, 0x32, 0x5c, 0xbf, 0xfd, 0xb4, 0xaf, 0xea, 0xb2, 0xbf, 0x92, 0x3f, 0xf8, 0x2d, +0x67, 0xfc, 0xa5, 0x9f, 0xe3, 0xef, 0xfd, 0x8d, 0x52, 0x7f, 0xe8, 0x88, 0x6a, 0xa4, 0x5c, 0xb6, +0x3e, 0x5f, 0x3d, 0x2b, 0xf7, 0x63, 0xfe, 0x0d, 0x02, 0xfd, 0x99, 0x3c, 0x3b, 0x37, 0xc1, 0xff, +0x00, 0x8a, 0x9f, 0x19, 0x66, 0x81, 0x66, 0xf1, 0x6c, 0xbe, 0x21, 0x3e, 0x08, 0xb5, 0x9e, 0x44, +0x05, 0xac, 0x2c, 0x61, 0xb4, 0xb3, 0xbd, 0x94, 0x46, 0x7a, 0x8f, 0x3e, 0x4b, 0xa8, 0xb7, 0xfa, +0x8b, 0x48, 0xb1, 0x8e, 0x73, 0xf8, 0x4e, 0x7a, 0x57, 0xf4, 0x41, 0xff, 0x00, 0x06, 0x7f, 0xff, +0x00, 0xca, 0x3a, 0xfe, 0x25, 0x7f, 0xd9, 0x54, 0xbd, 0xff, 0x00, 0xd3, 0x2e, 0x8b, 0x49, 0x6a, +0x28, 0xee, 0x7e, 0xae, 0x51, 0x45, 0x15, 0x65, 0x1f, 0xce, 0xbf, 0xfc, 0x1d, 0xdf, 0xff, 0x00, +0x29, 0x0e, 0xf8, 0x7d, 0xff, 0x00, 0x64, 0xe6, 0xdb, 0xff, 0x00, 0x4e, 0x7a, 0x85, 0x7e, 0x55, +0xd7, 0xea, 0xa7, 0xfc, 0x1d, 0xdf, 0xff, 0x00, 0x29, 0x0e, 0xf8, 0x7d, 0xff, 0x00, 0x64, 0xe6, +0xdb, 0xff, 0x00, 0x4e, 0x7a, 0x85, 0x7e, 0x55, 0xd6, 0x64, 0xcb, 0x73, 0xf5, 0xeb, 0xfe, 0x0c, +0xf8, 0xff, 0x00, 0x93, 0xac, 0xf8, 0xcd, 0xff, 0x00, 0x62, 0x95, 0x97, 0xfe, 0x96, 0x35, 0x7e, +0x8e, 0x7f, 0xc1, 0xc7, 0xdf, 0x15, 0xae, 0xbe, 0x14, 0xff, 0x00, 0xc1, 0x1f, 0xbe, 0x2a, 0x1b, +0x1b, 0xaf, 0xb2, 0xde, 0xf8, 0x9b, 0xfb, 0x3b, 0xc3, 0xa8, 0xc0, 0xff, 0x00, 0xac, 0x86, 0xee, +0xfe, 0xde, 0x3b, 0x94, 0xea, 0x3e, 0xf5, 0xaf, 0xda, 0x17, 0x8f, 0x5f, 0x4c, 0xd7, 0xe7, 0x1f, +0xfc, 0x19, 0xf1, 0xff, 0x00, 0x27, 0x59, 0xf1, 0x9b, 0xfe, 0xc5, 0x2b, 0x2f, 0xfd, 0x2c, 0x6a, +0xfb, 0x93, 0xfe, 0x0e, 0xa3, 0xff, 0x00, 0x94, 0x4d, 0x6a, 0x9f, 0xf6, 0x35, 0xe8, 0xdf, 0xfa, +0x3c, 0xd1, 0x1d, 0x8a, 0xe8, 0x7f, 0x34, 0x23, 0xa5, 0x76, 0x5f, 0xb3, 0x7f, 0xc2, 0x88, 0xbe, +0x3e, 0x7e, 0xd2, 0x5f, 0x0e, 0x3c, 0x03, 0x3d, 0xd4, 0xb6, 0x10, 0x78, 0xf3, 0xc5, 0x7a, 0x4f, +0x86, 0xa4, 0xba, 0x8b, 0x1e, 0x65, 0xb2, 0x5f, 0x5f, 0x43, 0x6a, 0x64, 0x5c, 0xe4, 0x65, 0x44, +0xa5, 0x86, 0x41, 0xe4, 0x74, 0x35, 0xc6, 0x8e, 0x95, 0xec, 0x5f, 0xf0, 0x4e, 0xaf, 0xf9, 0x48, +0xaf, 0xec, 0xf3, 0xff, 0x00, 0x65, 0x53, 0xc2, 0x9f, 0xfa, 0x7a, 0xb4, 0xa0, 0xcc, 0xfe, 0xbe, +0xfe, 0x18, 0x7c, 0x30, 0xd0, 0x7e, 0x0b, 0xf8, 0x03, 0x47, 0xf0, 0xaf, 0x85, 0xb4, 0xbb, 0x3d, +0x0f, 0xc3, 0x7e, 0x1e, 0xb2, 0x8b, 0x4e, 0xd3, 0x34, 0xeb, 0x48, 0xfc, 0xb8, 0x6c, 0xad, 0xe2, +0x50, 0xa9, 0x1a, 0x8f, 0x40, 0x00, 0xeb, 0xc9, 0xea, 0x79, 0x24, 0xd6, 0xfd, 0x14, 0x56, 0x86, +0x87, 0x8c, 0xff, 0x00, 0xc1, 0x46, 0xff, 0x00, 0xe5, 0x1e, 0x9f, 0x1e, 0x3f, 0xec, 0x9d, 0xf8, +0x83, 0xff, 0x00, 0x4d, 0xb7, 0x15, 0xfc, 0x73, 0xc1, 0xfe, 0xa1, 0x3f, 0xdd, 0x15, 0xfd, 0x8c, +0x7f, 0xc1, 0x46, 0xff, 0x00, 0xe5, 0x1e, 0x9f, 0x1e, 0x3f, 0xec, 0x9d, 0xf8, 0x83, 0xff, 0x00, +0x4d, 0xb7, 0x15, 0xfc, 0x73, 0xc1, 0xfe, 0xa1, 0x3f, 0xdd, 0x15, 0x0c, 0x99, 0x0d, 0xbc, 0xff, +0x00, 0x8f, 0x39, 0xbf, 0xdc, 0x3f, 0xca, 0xbf, 0xb2, 0xbf, 0xd8, 0x5f, 0xfe, 0x4c, 0xaf, 0xe0, +0xff, 0x00, 0xfd, 0x88, 0xfa, 0x27, 0xfe, 0x90, 0x43, 0x5f, 0xc6, 0xa5, 0xe7, 0xfc, 0x79, 0xcd, +0xfe, 0xe1, 0xfe, 0x55, 0xfd, 0x95, 0xfe, 0xc2, 0xff, 0x00, 0xf2, 0x65, 0x7f, 0x07, 0xff, 0x00, +0xec, 0x47, 0xd1, 0x3f, 0xf4, 0x82, 0x1a, 0x5d, 0x4a, 0x8e, 0xcc, 0xf8, 0xdb, 0xfe, 0x0e, 0xa3, +0xff, 0x00, 0x94, 0x4d, 0x6a, 0x9f, 0xf6, 0x35, 0xe8, 0xdf, 0xfa, 0x3c, 0xd7, 0xf3, 0x42, 0x3a, +0x57, 0xf4, 0xbd, 0xff, 0x00, 0x07, 0x51, 0xff, 0x00, 0xca, 0x26, 0xb5, 0x4f, 0xfb, 0x1a, 0xf4, +0x6f, 0xfd, 0x1e, 0x6b, 0xf9, 0xa1, 0x1d, 0x2a, 0xa4, 0x4c, 0x8f, 0x62, 0xff, 0x00, 0x82, 0x75, +0x7f, 0xca, 0x45, 0x7f, 0x67, 0x9f, 0xfb, 0x2a, 0x9e, 0x14, 0xff, 0x00, 0xd3, 0xd5, 0xa5, 0x7f, +0x63, 0x55, 0xfc, 0x72, 0xff, 0x00, 0xc1, 0x3a, 0xbf, 0xe5, 0x22, 0xbf, 0xb3, 0xcf, 0xfd, 0x95, +0x4f, 0x0a, 0x7f, 0xe9, 0xea, 0xd2, 0xbf, 0xb1, 0xaa, 0x23, 0xb0, 0x44, 0x28, 0xa2, 0x8a, 0xa2, +0x8f, 0x94, 0x3f, 0xe0, 0xb9, 0xbf, 0xf2, 0x88, 0xef, 0x8f, 0x9f, 0xf6, 0x2a, 0xcd, 0xff, 0x00, +0xa1, 0xa5, 0x7f, 0x26, 0x55, 0xfd, 0x66, 0xff, 0x00, 0xc1, 0x73, 0x7f, 0xe5, 0x11, 0xdf, 0x1f, +0x3f, 0xec, 0x55, 0x9b, 0xff, 0x00, 0x43, 0x4a, 0xfe, 0x4c, 0xab, 0x37, 0xb9, 0x32, 0x28, 0xf8, +0x97, 0xfe, 0x45, 0xcd, 0x43, 0xfe, 0xbd, 0xa4, 0xff, 0x00, 0xd0, 0x4d, 0x7f, 0x70, 0xed, 0xf7, +0xcf, 0xf9, 0xec, 0x6b, 0xf8, 0x78, 0xf1, 0x2f, 0xfc, 0x8b, 0x9a, 0x87, 0xfd, 0x7b, 0x49, 0xff, +0x00, 0xa0, 0x9a, 0xfe, 0xe1, 0x9f, 0xef, 0x37, 0xf9, 0xec, 0x69, 0xa0, 0x89, 0xfc, 0x92, 0xff, +0x00, 0xc1, 0x6a, 0x3e, 0x2e, 0x5c, 0x7c, 0x6c, 0xff, 0x00, 0x82, 0xaf, 0x7c, 0x78, 0xd6, 0x2e, +0x26, 0xf3, 0x97, 0x4f, 0xf1, 0x4c, 0xfe, 0x1f, 0x84, 0x07, 0xdc, 0xb1, 0x47, 0xa6, 0xa2, 0x69, +0xe1, 0x54, 0x64, 0x85, 0x19, 0xb6, 0x62, 0x40, 0xc7, 0xcc, 0xce, 0x48, 0xc9, 0x35, 0xf3, 0x09, +0xaf, 0x62, 0xff, 0x00, 0x82, 0x8a, 0xff, 0x00, 0xca, 0x45, 0x7f, 0x68, 0x6f, 0xfb, 0x2a, 0x9e, +0x2b, 0xff, 0x00, 0xd3, 0xd5, 0xdd, 0x78, 0xed, 0x22, 0x4f, 0xe8, 0x33, 0xfe, 0x0d, 0x23, 0xfd, +0x97, 0x3c, 0x3b, 0xe1, 0x8f, 0xd8, 0xf7, 0xc5, 0xdf, 0x17, 0x1a, 0xce, 0xd6, 0x7f, 0x18, 0xf8, +0xd3, 0xc4, 0x17, 0x1a, 0x22, 0xdf, 0x98, 0xf7, 0x4d, 0x65, 0xa6, 0x5a, 0x2c, 0x41, 0x6d, 0x95, +0x8f, 0xdd, 0x0f, 0x70, 0x65, 0x95, 0xf6, 0xe0, 0x38, 0x10, 0x06, 0xc9, 0x89, 0x71, 0xfa, 0xe1, +0x5f, 0xc9, 0x4f, 0xec, 0x85, 0xff, 0x00, 0x05, 0x9e, 0xfd, 0xa1, 0x3f, 0x61, 0x5f, 0x83, 0x71, +0xf8, 0x07, 0xe1, 0xaf, 0x8a, 0xb4, 0x8d, 0x1f, 0xc3, 0x30, 0xde, 0xcf, 0x7e, 0xb6, 0xf7, 0x3a, +0x15, 0xad, 0xe4, 0x9e, 0x74, 0xc4, 0x19, 0x09, 0x92, 0x44, 0x2c, 0x72, 0x40, 0xe3, 0x3c, 0x57, +0xa8, 0x7f, 0xc4, 0x4c, 0x7f, 0xb6, 0x27, 0xfd, 0x0f, 0xde, 0x1d, 0xff, 0x00, 0xc2, 0x52, 0xc3, +0xff, 0x00, 0x8d, 0xd3, 0x52, 0x34, 0x4d, 0x58, 0xfe, 0xa1, 0xab, 0xf9, 0xf9, 0xff, 0x00, 0x83, +0xba, 0xff, 0x00, 0x66, 0x3d, 0x03, 0xe1, 0xbf, 0xed, 0x1b, 0xf0, 0xbb, 0xe2, 0x7e, 0x8f, 0x67, +0x15, 0xae, 0xaf, 0xf1, 0x27, 0x4e, 0xd4, 0x34, 0xff, 0x00, 0x10, 0x3c, 0x4a, 0xa8, 0xb7, 0x93, +0xe9, 0xdf, 0x63, 0x5b, 0x6b, 0x87, 0x03, 0x96, 0x95, 0xa1, 0xb9, 0x31, 0x33, 0x1f, 0xe0, 0xb5, +0x85, 0x73, 0xc0, 0xaf, 0x9f, 0xff, 0x00, 0xe2, 0x26, 0x3f, 0xdb, 0x13, 0xfe, 0x87, 0xef, 0x0e, +0xff, 0x00, 0xe1, 0x29, 0x61, 0xff, 0x00, 0xc6, 0xeb, 0xc1, 0xff, 0x00, 0x6d, 0xff, 0x00, 0xf8, +0x29, 0xc7, 0xc6, 0x4f, 0xf8, 0x28, 0xad, 0xb7, 0x86, 0x61, 0xf8, 0xb1, 0xaf, 0xe9, 0xba, 0xe2, +0x78, 0x3d, 0xee, 0x5f, 0x4b, 0xfb, 0x2e, 0x93, 0x6f, 0x62, 0x61, 0x37, 0x02, 0x21, 0x2e, 0x7c, +0xa5, 0x1b, 0xb3, 0xe4, 0xc7, 0xd7, 0xa6, 0x0f, 0xad, 0x0e, 0x40, 0xda, 0xb1, 0xe0, 0x35, 0xfa, +0x9b, 0xff, 0x00, 0x06, 0x92, 0xfc, 0x69, 0xba, 0xf0, 0x4f, 0xfc, 0x14, 0x0f, 0xc6, 0x9e, 0x09, +0x69, 0xf6, 0x69, 0x3e, 0x3d, 0xf0, 0x64, 0x97, 0x2f, 0x16, 0xdc, 0xf9, 0xb7, 0xba, 0x7d, 0xcc, +0x4f, 0x6e, 0x4f, 0x3c, 0x05, 0x82, 0xe6, 0xfb, 0xd7, 0x96, 0x1e, 0xf5, 0xf9, 0x65, 0x5f, 0xa1, +0x5f, 0xf0, 0x6b, 0xd7, 0xfc, 0xa5, 0xd3, 0xc3, 0xbf, 0xf6, 0x2c, 0x6b, 0x1f, 0xfa, 0x29, 0x29, +0x13, 0x1d, 0xcf, 0xe9, 0x33, 0xe3, 0x3f, 0xc2, 0xad, 0x2f, 0xe3, 0xa7, 0xc2, 0x1f, 0x15, 0x78, +0x27, 0x5c, 0x8f, 0xce, 0xd1, 0x7c, 0x61, 0xa3, 0x5e, 0x68, 0x7a, 0x84, 0x78, 0xcf, 0x99, 0x6f, +0x75, 0x03, 0xc3, 0x28, 0xfc, 0x51, 0xcd, 0x7f, 0x17, 0x7e, 0x32, 0xf0, 0x3e, 0xab, 0xf0, 0xbf, +0xc6, 0x9a, 0xd7, 0x85, 0xf5, 0xe8, 0x7e, 0xcf, 0xaf, 0x78, 0x63, 0x50, 0xb9, 0xd1, 0xf5, 0x38, +0x79, 0xfd, 0xcd, 0xd5, 0xb4, 0xad, 0x04, 0xc9, 0xcf, 0x3c, 0x48, 0x8c, 0x39, 0x00, 0xf1, 0x5f, +0xdb, 0x55, 0x7f, 0x2b, 0xdf, 0xf0, 0x71, 0x27, 0xec, 0xee, 0xbf, 0xb3, 0xaf, 0xfc, 0x15, 0xa3, +0xe2, 0x32, 0xdb, 0x5b, 0xad, 0xae, 0x95, 0xe3, 0xe8, 0xed, 0x7c, 0x6b, 0x60, 0x8a, 0x3a, 0x8b, +0xc4, 0x29, 0x72, 0xe7, 0xdd, 0xaf, 0xad, 0xef, 0x5b, 0xf1, 0xef, 0xd4, 0xd4, 0x87, 0x2d, 0x8f, +0x88, 0xa5, 0x8d, 0x65, 0x8d, 0x95, 0x86, 0xe5, 0x60, 0x41, 0x1e, 0xa2, 0xbf, 0xad, 0x8f, 0xf8, +0x22, 0xc7, 0xed, 0x17, 0xff, 0x00, 0x0d, 0x4b, 0xff, 0x00, 0x04, 0xba, 0xf8, 0x37, 0xe2, 0xab, +0x8b, 0x86, 0xba, 0xd5, 0x21, 0xd0, 0x23, 0xd0, 0x75, 0x49, 0x1d, 0x81, 0x96, 0x4b, 0xcd, 0x39, +0xda, 0xc6, 0x69, 0x1c, 0x76, 0x69, 0x1a, 0xdc, 0xcb, 0xd0, 0x64, 0x48, 0x08, 0xe0, 0x8a, 0xfe, +0x4a, 0x4f, 0x4a, 0xfd, 0xe4, 0xff, 0x00, 0x83, 0x3f, 0x3f, 0x68, 0xaf, 0xed, 0x9f, 0x82, 0x5f, +0x17, 0x7e, 0x14, 0xdd, 0x4c, 0x5a, 0x6f, 0x0c, 0xeb, 0x56, 0xde, 0x28, 0xd3, 0xd6, 0x49, 0x3e, +0x63, 0x05, 0xf4, 0x26, 0xde, 0x54, 0x8c, 0x67, 0xee, 0x47, 0x2d, 0x92, 0xb9, 0xc0, 0x1f, 0x35, +0xd6, 0x79, 0x2d, 0x52, 0x28, 0xf6, 0x3f, 0x66, 0x2b, 0xf3, 0xef, 0xfe, 0x0e, 0x69, 0xfd, 0xa2, +0x5b, 0xe0, 0x2f, 0xfc, 0x12, 0x83, 0xc5, 0x5a, 0x5d, 0xb5, 0xc4, 0x96, 0xfa, 0xa7, 0xc4, 0xdd, +0x4a, 0xcb, 0xc1, 0xf6, 0x8c, 0x87, 0xf8, 0x25, 0x63, 0x73, 0x74, 0xa4, 0x63, 0x95, 0x7b, 0x3b, +0x5b, 0x98, 0xfb, 0x7f, 0xac, 0x1c, 0xf6, 0x3f, 0xa0, 0x95, 0xf8, 0x11, 0xff, 0x00, 0x07, 0x7d, +0x7e, 0xd1, 0x1f, 0xf0, 0x90, 0xfc, 0x7f, 0xf8, 0x4b, 0xf0, 0xa6, 0xd6, 0x76, 0xf2, 0x7c, 0x2d, +0xa2, 0x5c, 0xf8, 0xa3, 0x51, 0x89, 0x58, 0x34, 0x6f, 0x35, 0xec, 0xbf, 0x67, 0xb7, 0x0c, 0x3b, +0x3c, 0x71, 0xd9, 0xce, 0x40, 0xeb, 0xb6, 0xe7, 0x27, 0x86, 0x53, 0x55, 0x22, 0x8f, 0xc7, 0xa1, +0x5e, 0x99, 0xfb, 0x16, 0xfe, 0xcf, 0x4f, 0xfb, 0x59, 0xfe, 0xd7, 0xdf, 0x0c, 0x7e, 0x19, 0xf9, +0x33, 0x4d, 0x6f, 0xe3, 0x6f, 0x12, 0xd8, 0xe9, 0x97, 0xe2, 0x2f, 0xbf, 0x1d, 0x8b, 0x4a, 0x1a, +0xf2, 0x41, 0xc8, 0xfb, 0x96, 0xcb, 0x33, 0xf5, 0x1f, 0x73, 0xa8, 0xaf, 0x33, 0xaf, 0xd3, 0xaf, +0xf8, 0x35, 0x13, 0xf6, 0x75, 0x3f, 0x15, 0x3f, 0xe0, 0xa3, 0x3a, 0xc7, 0x8f, 0x2e, 0x2d, 0x4c, +0xba, 0x77, 0xc2, 0x9f, 0x0c, 0xcf, 0x71, 0x14, 0xe0, 0x7f, 0xc7, 0xbe, 0xa3, 0xa8, 0x13, 0x69, +0x00, 0xf6, 0xdd, 0x6d, 0xfd, 0xa3, 0xef, 0xf2, 0xfd, 0x6a, 0x48, 0x8e, 0xac, 0xfe, 0x8f, 0xa0, +0x81, 0x6d, 0xd7, 0x6a, 0x05, 0x54, 0x00, 0x05, 0x50, 0x30, 0x14, 0x0e, 0xc2, 0xbe, 0x79, 0xff, +0x00, 0x82, 0xb9, 0xff, 0x00, 0xca, 0x2c, 0xbf, 0x68, 0xdf, 0xfb, 0x26, 0xde, 0x20, 0xff, 0x00, +0xd3, 0x7c, 0xd5, 0xf4, 0x55, 0x7c, 0xeb, 0xff, 0x00, 0x05, 0x73, 0xff, 0x00, 0x94, 0x59, 0x7e, +0xd1, 0xbf, 0xf6, 0x4d, 0xbc, 0x41, 0xff, 0x00, 0xa6, 0xf9, 0xaa, 0x99, 0xac, 0x77, 0x3f, 0x90, +0xda, 0xa7, 0xe2, 0x0f, 0xf9, 0x00, 0xdf, 0x7f, 0xd7, 0xbc, 0x9f, 0xfa, 0x09, 0xab, 0x95, 0x4f, +0xc4, 0x1f, 0xf2, 0x01, 0xbe, 0xff, 0x00, 0xaf, 0x79, 0x3f, 0xf4, 0x13, 0x52, 0x62, 0x7f, 0x6f, +0x5e, 0x19, 0xff, 0x00, 0x91, 0x72, 0xc7, 0xfe, 0xbd, 0xa3, 0xff, 0x00, 0xd0, 0x05, 0x7f, 0x3e, +0xdf, 0xf0, 0x77, 0xc7, 0xc5, 0x0b, 0xdd, 0x6b, 0xf6, 0xdc, 0xf8, 0x5b, 0xe0, 0xa9, 0x37, 0x7f, +0x66, 0xf8, 0x67, 0xc0, 0xcd, 0xad, 0xdb, 0x8e, 0xde, 0x6e, 0xa1, 0xa8, 0x5c, 0x43, 0x2f, 0xbe, +0x76, 0xe9, 0x90, 0xfb, 0x7e, 0xb5, 0xfd, 0x04, 0xf8, 0x63, 0xfe, 0x45, 0xdb, 0x0f, 0xfa, 0xf7, +0x8f, 0xff, 0x00, 0x40, 0x15, 0xfc, 0xe8, 0xff, 0x00, 0xc1, 0xdc, 0x3f, 0xf2, 0x94, 0x4f, 0x09, +0x7f, 0xd9, 0x2b, 0xd2, 0xbf, 0xf4, 0xed, 0xad, 0x53, 0xe8, 0x6b, 0x3e, 0xa7, 0xe5, 0xf8, 0xaf, +0xd4, 0x4f, 0xf8, 0x35, 0x23, 0xf6, 0x5c, 0xf0, 0xef, 0xc6, 0xef, 0xdb, 0x9b, 0xc5, 0x5e, 0x37, +0xf1, 0x0d, 0x9d, 0xbe, 0xa4, 0xdf, 0x0a, 0x74, 0x38, 0x6f, 0x34, 0x7b, 0x79, 0xd3, 0x72, 0x43, +0xa8, 0x5d, 0xcc, 0xd1, 0xc7, 0x75, 0x8e, 0x85, 0xe2, 0x8a, 0x19, 0xc2, 0xe7, 0x3b, 0x5a, 0x60, +0xe3, 0x0c, 0x8a, 0x47, 0xe5, 0xdd, 0x7e, 0xca, 0x7f, 0xc1, 0x9c, 0xbf, 0xf2, 0x5b, 0x7e, 0x3e, +0x7f, 0xd8, 0x0f, 0x44, 0xff, 0x00, 0xd2, 0x8b, 0xea, 0x92, 0x23, 0xb9, 0xfb, 0xd1, 0x45, 0x14, +0x56, 0xa5, 0x05, 0x14, 0x51, 0x40, 0x1f, 0xcc, 0x8f, 0xfc, 0x1d, 0x0d, 0xf1, 0x66, 0xe3, 0xe2, +0x37, 0xfc, 0x15, 0x9f, 0x5c, 0xd1, 0xa4, 0x98, 0x35, 0xbf, 0x80, 0x7c, 0x35, 0xa4, 0xe8, 0x70, +0xc4, 0xaf, 0xf2, 0xc4, 0x65, 0x84, 0xea, 0x2e, 0x4a, 0xe4, 0x80, 0xcd, 0xf6, 0xe5, 0xc9, 0xe0, +0x95, 0x54, 0xce, 0x40, 0x5a, 0xfc, 0xf1, 0x3d, 0x2b, 0xed, 0x0f, 0xf8, 0x38, 0x93, 0xfe, 0x53, +0x55, 0xf1, 0xdf, 0xfe, 0xbe, 0x74, 0x2f, 0xfd, 0x47, 0x34, 0xaa, 0xf8, 0xbe, 0xb3, 0x22, 0x5b, +0x9f, 0xb3, 0x9f, 0xf0, 0x68, 0x4f, 0xec, 0xb9, 0xe1, 0xdf, 0x15, 0xf8, 0xdf, 0xe2, 0xb7, 0xc5, +0xed, 0x52, 0xce, 0xd6, 0xfb, 0xc4, 0x1e, 0x13, 0xfb, 0x27, 0x87, 0xbc, 0x3f, 0x24, 0xb1, 0xef, +0x6d, 0x2b, 0xed, 0x11, 0xcb, 0x25, 0xe4, 0xc8, 0x0f, 0x02, 0x49, 0x10, 0x43, 0x10, 0x71, 0x86, +0x54, 0xf3, 0xd7, 0x3b, 0x65, 0x60, 0x7f, 0x78, 0x2b, 0xf9, 0x0b, 0xfd, 0x89, 0x3f, 0xe0, 0xaa, +0x3f, 0x1b, 0x3f, 0xe0, 0x9d, 0xfe, 0x1a, 0xd7, 0xf4, 0x8f, 0x85, 0x3e, 0x22, 0xd3, 0x34, 0x3b, +0x1f, 0x13, 0x5d, 0xc7, 0x7b, 0xa8, 0x25, 0xd6, 0x8f, 0x6f, 0x7c, 0xd2, 0xcb, 0x1a, 0x79, 0x6a, +0x41, 0x95, 0x49, 0x5c, 0x2f, 0x18, 0x1c, 0x57, 0xb7, 0x7f, 0xc4, 0x4c, 0x7f, 0xb6, 0x27, 0xfd, +0x0f, 0xde, 0x1d, 0xff, 0x00, 0xc2, 0x52, 0xc3, 0xff, 0x00, 0x8d, 0xd3, 0x52, 0x2e, 0xea, 0xc7, +0xf5, 0x0d, 0x5f, 0x8d, 0x3f, 0xf0, 0x77, 0xc7, 0xec, 0xc7, 0xa0, 0x5c, 0xfc, 0x05, 0xf8, 0x67, +0xf1, 0x8a, 0x0b, 0x38, 0x62, 0xf1, 0x76, 0x95, 0xe2, 0x04, 0xf0, 0x75, 0xdd, 0xda, 0x20, 0x57, +0xbc, 0xd3, 0xae, 0x2d, 0xae, 0xee, 0xa3, 0x49, 0x1b, 0xab, 0x79, 0x33, 0xc0, 0x7c, 0xb1, 0xfc, +0x3f, 0x6a, 0x9c, 0x8f, 0xbc, 0x73, 0xf0, 0x7f, 0xfc, 0x44, 0xc9, 0xfb, 0x62, 0x7f, 0xd0, 0xfd, +0xe1, 0xdf, 0xfc, 0x25, 0x2c, 0x3f, 0xf8, 0xdd, 0x79, 0x37, 0xed, 0x97, 0xff, 0x00, 0x05, 0x85, +0xf8, 0xf9, 0xfb, 0x7e, 0x7c, 0x29, 0xb5, 0xf0, 0x57, 0xc5, 0x0f, 0x13, 0xe9, 0x3a, 0xd7, 0x87, +0xac, 0x75, 0x48, 0xb5, 0x88, 0x60, 0xb6, 0xd1, 0x2d, 0xac, 0x9d, 0x6e, 0x63, 0x8e, 0x58, 0xd1, +0xb7, 0xc4, 0xa1, 0x88, 0x0b, 0x34, 0x9c, 0x67, 0x19, 0x23, 0xd2, 0x93, 0x90, 0x5d, 0x58, 0xf9, +0x8a, 0xbe, 0xb2, 0xff, 0x00, 0x82, 0x1b, 0xfc, 0x7a, 0xb8, 0xfd, 0x9b, 0xff, 0x00, 0xe0, 0xa8, +0x7f, 0x0d, 0xbc, 0x48, 0x8b, 0x71, 0x35, 0x9b, 0x45, 0xaa, 0xd9, 0xea, 0x16, 0xd1, 0x30, 0x5f, +0xb6, 0x40, 0xfa, 0x5d, 0xd3, 0x04, 0x24, 0x83, 0x80, 0x26, 0x48, 0x5f, 0xeb, 0x18, 0xaf, 0x93, +0x45, 0x7b, 0x67, 0xfc, 0x13, 0x8f, 0xfe, 0x4f, 0x77, 0xc0, 0x5f, 0xf5, 0xd2, 0xff, 0x00, 0xff, +0x00, 0x4d, 0xd7, 0x54, 0x89, 0x87, 0xc4, 0x8f, 0x35, 0xf8, 0xc1, 0xff, 0x00, 0x25, 0x7b, 0xc5, +0x9f, 0xf6, 0x1c, 0xbf, 0xff, 0x00, 0xd2, 0x99, 0x2b, 0x9d, 0xae, 0xf3, 0xf6, 0xaa, 0xf0, 0x94, +0xde, 0x00, 0xfd, 0xaa, 0xfe, 0x29, 0x78, 0x7e, 0xe1, 0x04, 0x73, 0xe8, 0x3e, 0x32, 0xd6, 0xb4, +0xc9, 0x50, 0x36, 0xe0, 0x8f, 0x06, 0xa1, 0x3c, 0x4c, 0x33, 0xdf, 0x05, 0x08, 0xcd, 0x70, 0x67, +0xa5, 0x31, 0x4b, 0x73, 0xfa, 0xa4, 0xff, 0x00, 0x83, 0x75, 0x3f, 0xe5, 0x0d, 0x3f, 0x05, 0x7f, +0xeb, 0xdb, 0x54, 0xff, 0x00, 0xd3, 0xc5, 0xf5, 0x7d, 0xb1, 0x5f, 0x9b, 0x3f, 0xf0, 0x6b, 0x2f, +0xed, 0x0f, 0xa4, 0xfc, 0x5b, 0xff, 0x00, 0x82, 0x5d, 0xe9, 0xbe, 0x0b, 0x8a, 0xe1, 0x7f, 0xb7, +0xbe, 0x15, 0xeb, 0x5a, 0x86, 0x95, 0xa8, 0xc0, 0xce, 0xbe, 0x69, 0x8a, 0xea, 0xea, 0x6b, 0xfb, +0x69, 0x82, 0x8e, 0x44, 0x65, 0x2e, 0x5a, 0x25, 0x27, 0xab, 0x5b, 0x48, 0x39, 0x2a, 0x6b, 0xf4, +0x9a, 0xaa, 0x3b, 0x16, 0x14, 0x51, 0x45, 0x50, 0x1f, 0xc7, 0x2f, 0xfc, 0x14, 0x57, 0xfe, 0x52, +0x2b, 0xfb, 0x43, 0x7f, 0xd9, 0x54, 0xf1, 0x5f, 0xfe, 0x9e, 0xae, 0xeb, 0xc7, 0x4f, 0x4a, 0xf6, +0x2f, 0xf8, 0x28, 0xaf, 0xfc, 0xa4, 0x57, 0xf6, 0x86, 0xff, 0x00, 0xb2, 0xa9, 0xe2, 0xbf, 0xfd, +0x3d, 0x5d, 0xd7, 0x8e, 0x9e, 0x95, 0x99, 0x99, 0xfd, 0x2f, 0x7f, 0xc1, 0xab, 0x9f, 0xf2, 0x89, +0xad, 0x2f, 0xfe, 0xc6, 0xbd, 0x67, 0xff, 0x00, 0x47, 0x8a, 0xec, 0x7f, 0xe0, 0xe5, 0xcf, 0xf9, +0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, 0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x71, 0xdf, 0xf0, 0x6a, +0xe7, 0xfc, 0xa2, 0x6b, 0x4b, 0xff, 0x00, 0xb1, 0xaf, 0x59, 0xff, 0x00, 0xd1, 0xe2, 0xbb, 0x1f, +0xf8, 0x39, 0x73, 0xfe, 0x50, 0xab, 0xf1, 0x83, 0xfe, 0xbe, 0x7c, 0x3b, 0xff, 0x00, 0xa9, 0x16, +0x97, 0x55, 0xd0, 0xd3, 0xa1, 0xfc, 0xb8, 0x57, 0x61, 0xfb, 0x3b, 0xff, 0x00, 0xc9, 0xc4, 0xfc, +0x3d, 0xff, 0x00, 0xb1, 0xab, 0x49, 0xff, 0x00, 0xd2, 0xd8, 0xab, 0x8f, 0xae, 0xc3, 0xf6, 0x77, +0xff, 0x00, 0x93, 0x89, 0xf8, 0x7b, 0xff, 0x00, 0x63, 0x56, 0x93, 0xff, 0x00, 0xa5, 0xb1, 0x54, +0x99, 0x9f, 0xda, 0x65, 0x7f, 0x24, 0x7f, 0xf0, 0x5a, 0xcf, 0xf9, 0x4b, 0x37, 0xc7, 0xdf, 0xfb, +0x1a, 0xa4, 0xff, 0x00, 0xd1, 0x10, 0xd7, 0xf5, 0xb9, 0x5f, 0xc9, 0x27, 0xfc, 0x16, 0xc2, 0x36, +0x8b, 0xfe, 0x0a, 0xd1, 0xf1, 0xf0, 0x32, 0xb2, 0x9f, 0xf8, 0x4a, 0x5c, 0xe1, 0x86, 0x0e, 0x0c, +0x10, 0x11, 0xf9, 0x82, 0x08, 0xf5, 0x04, 0x1e, 0x95, 0x52, 0x2a, 0x47, 0xcb, 0xc7, 0xa5, 0x7f, +0x44, 0x1f, 0xf0, 0x67, 0xff, 0x00, 0xfc, 0xa3, 0xaf, 0xe2, 0x57, 0xfd, 0x95, 0x4b, 0xdf, 0xfd, +0x32, 0xe8, 0xb5, 0xfc, 0xef, 0x9e, 0x95, 0xfd, 0x10, 0x7f, 0xc1, 0x9f, 0xff, 0x00, 0xf2, 0x8e, +0xbf, 0x89, 0x5f, 0xf6, 0x55, 0x2f, 0x7f, 0xf4, 0xcb, 0xa2, 0xd1, 0x10, 0x89, 0xfa, 0xb9, 0x45, +0x14, 0x55, 0x14, 0x7f, 0x3a, 0xff, 0x00, 0xf0, 0x77, 0x7f, 0xfc, 0xa4, 0x3b, 0xe1, 0xf7, 0xfd, +0x93, 0x9b, 0x6f, 0xfd, 0x39, 0xea, 0x15, 0xf9, 0x57, 0x5f, 0xaa, 0x9f, 0xf0, 0x77, 0x7f, 0xfc, +0xa4, 0x3b, 0xe1, 0xf7, 0xfd, 0x93, 0x9b, 0x6f, 0xfd, 0x39, 0xea, 0x15, 0xf9, 0x57, 0x59, 0x93, +0x2d, 0xcf, 0xd7, 0xaf, 0xf8, 0x33, 0xe3, 0xfe, 0x4e, 0xb3, 0xe3, 0x37, 0xfd, 0x8a, 0x56, 0x5f, +0xfa, 0x58, 0xd5, 0xf7, 0x27, 0xfc, 0x1d, 0x47, 0xff, 0x00, 0x28, 0x9a, 0xd5, 0x3f, 0xec, 0x6b, +0xd1, 0xbf, 0xf4, 0x79, 0xaf, 0x86, 0xff, 0x00, 0xe0, 0xcf, 0x8f, 0xf9, 0x3a, 0xcf, 0x8c, 0xdf, +0xf6, 0x29, 0x59, 0x7f, 0xe9, 0x63, 0x57, 0xdd, 0x1f, 0xf0, 0x74, 0xf5, 0xac, 0x93, 0xff, 0x00, +0xc1, 0x25, 0x35, 0xa9, 0x11, 0x19, 0x92, 0xdf, 0xc5, 0x1a, 0x34, 0x92, 0x91, 0xfc, 0x0a, 0x6e, +0x76, 0x82, 0x7f, 0xe0, 0x4c, 0xa3, 0xea, 0x45, 0x38, 0xec, 0x57, 0xd9, 0x3f, 0x99, 0xd1, 0xd2, +0xbd, 0x8b, 0xfe, 0x09, 0xd5, 0xff, 0x00, 0x29, 0x15, 0xfd, 0x9e, 0x7f, 0xec, 0xaa, 0x78, 0x53, +0xff, 0x00, 0x4f, 0x56, 0x95, 0xe3, 0xa3, 0xa5, 0x7b, 0x17, 0xfc, 0x13, 0xab, 0xfe, 0x52, 0x2b, +0xfb, 0x3c, 0xff, 0x00, 0xd9, 0x54, 0xf0, 0xa7, 0xfe, 0x9e, 0xad, 0x29, 0x19, 0x9f, 0xd8, 0xd5, +0x14, 0x51, 0x5a, 0x1a, 0x1e, 0x33, 0xff, 0x00, 0x05, 0x1b, 0xff, 0x00, 0x94, 0x7a, 0x7c, 0x78, +0xff, 0x00, 0xb2, 0x77, 0xe2, 0x0f, 0xfd, 0x36, 0xdc, 0x57, 0xf1, 0xcf, 0x07, 0xfa, 0x84, 0xff, +0x00, 0x74, 0x57, 0xf6, 0x31, 0xff, 0x00, 0x05, 0x1b, 0xff, 0x00, 0x94, 0x7a, 0x7c, 0x78, 0xff, +0x00, 0xb2, 0x77, 0xe2, 0x0f, 0xfd, 0x36, 0xdc, 0x57, 0xf1, 0xcf, 0x07, 0xfa, 0x84, 0xff, 0x00, +0x74, 0x54, 0x32, 0x64, 0x36, 0xf3, 0xfe, 0x3c, 0xe6, 0xff, 0x00, 0x70, 0xff, 0x00, 0x2a, 0xfe, +0xca, 0xff, 0x00, 0x61, 0x7f, 0xf9, 0x32, 0xbf, 0x83, 0xff, 0x00, 0xf6, 0x23, 0xe8, 0x9f, 0xfa, +0x41, 0x0d, 0x7f, 0x1a, 0x97, 0x9f, 0xf1, 0xe7, 0x37, 0xfb, 0x87, 0xf9, 0x57, 0xf6, 0x57, 0xfb, +0x0b, 0xff, 0x00, 0xc9, 0x95, 0xfc, 0x1f, 0xff, 0x00, 0xb1, 0x1f, 0x44, 0xff, 0x00, 0xd2, 0x08, +0x69, 0x75, 0x2a, 0x3b, 0x33, 0xe3, 0x6f, 0xf8, 0x3a, 0x8f, 0xfe, 0x51, 0x35, 0xaa, 0x7f, 0xd8, +0xd7, 0xa3, 0x7f, 0xe8, 0xf3, 0x5f, 0xcd, 0x08, 0xe9, 0x5f, 0xd2, 0xf7, 0xfc, 0x1d, 0x47, 0xff, +0x00, 0x28, 0x9a, 0xd5, 0x3f, 0xec, 0x6b, 0xd1, 0xbf, 0xf4, 0x79, 0xaf, 0xe6, 0x84, 0x74, 0xaa, +0x91, 0x32, 0x3d, 0x8b, 0xfe, 0x09, 0xd5, 0xff, 0x00, 0x29, 0x15, 0xfd, 0x9e, 0x7f, 0xec, 0xaa, +0x78, 0x53, 0xff, 0x00, 0x4f, 0x56, 0x95, 0xfd, 0x8d, 0x57, 0xf1, 0xcb, 0xff, 0x00, 0x04, 0xea, +0xff, 0x00, 0x94, 0x8a, 0xfe, 0xcf, 0x3f, 0xf6, 0x55, 0x3c, 0x29, 0xff, 0x00, 0xa7, 0xab, 0x4a, +0xfe, 0xc6, 0xa8, 0x8e, 0xc1, 0x10, 0xa2, 0x8a, 0x2a, 0x8a, 0x3e, 0x50, 0xff, 0x00, 0x82, 0xe6, +0xff, 0x00, 0xca, 0x23, 0xbe, 0x3e, 0x7f, 0xd8, 0xab, 0x37, 0xfe, 0x86, 0x95, 0xfc, 0x99, 0x57, +0xf4, 0xfd, 0xff, 0x00, 0x07, 0x2c, 0xfe, 0xd2, 0x1a, 0x5f, 0xc0, 0xaf, 0xf8, 0x25, 0x3f, 0x8c, +0xf4, 0x7b, 0x8b, 0x88, 0xd7, 0x5c, 0xf8, 0x99, 0x71, 0x6b, 0xe1, 0x6d, 0x26, 0xd8, 0x8d, 0xc6, +0x63, 0x24, 0xc9, 0x35, 0xd3, 0x11, 0x9c, 0x85, 0x4b, 0x48, 0x6e, 0x0e, 0xee, 0x81, 0xcc, 0x4a, +0x71, 0xbc, 0x57, 0xf3, 0x02, 0x2b, 0x3e, 0xa4, 0xc8, 0xa3, 0xe2, 0x6f, 0xf9, 0x17, 0x35, 0x0f, +0xfa, 0xf6, 0x93, 0xff, 0x00, 0x41, 0x35, 0xfd, 0xc3, 0x3f, 0xde, 0x6f, 0xf3, 0xd8, 0xd7, 0xf1, +0x2b, 0xe1, 0x7f, 0x02, 0x5e, 0x7c, 0x54, 0xf1, 0x56, 0x95, 0xe1, 0x6d, 0x3c, 0x33, 0x6a, 0x1e, +0x27, 0xbd, 0x83, 0x47, 0xb4, 0x01, 0x77, 0x13, 0x35, 0xcc, 0x8b, 0x0a, 0x71, 0xd4, 0xfc, 0xce, +0x38, 0x1d, 0x6b, 0xfb, 0x6e, 0x03, 0x06, 0xaa, 0x21, 0x13, 0xf8, 0xe5, 0xff, 0x00, 0x82, 0x8a, +0xff, 0x00, 0xca, 0x45, 0x7f, 0x68, 0x6f, 0xfb, 0x2a, 0x9e, 0x2b, 0xff, 0x00, 0xd3, 0xd5, 0xdd, +0x78, 0xed, 0x7b, 0x37, 0xfc, 0x14, 0x82, 0xce, 0x5b, 0x0f, 0xf8, 0x28, 0xdf, 0xed, 0x0d, 0x1c, +0xc9, 0xe5, 0xbf, 0xfc, 0x2d, 0x1f, 0x14, 0x49, 0x83, 0xfd, 0xd7, 0xd5, 0xee, 0x9d, 0x4f, 0xe2, +0xac, 0x0f, 0xe3, 0x5e, 0x32, 0x7a, 0x54, 0x92, 0x19, 0xa3, 0x75, 0x7f, 0x40, 0x9f, 0xf0, 0x6d, +0xc7, 0xec, 0x2b, 0xf0, 0x4b, 0xf6, 0x80, 0xff, 0x00, 0x82, 0x67, 0x58, 0xf8, 0x8b, 0xc7, 0xdf, +0x07, 0x7e, 0x15, 0xf8, 0xe3, 0xc4, 0x12, 0x78, 0x9f, 0x55, 0xb7, 0x6d, 0x4f, 0xc4, 0x1e, 0x13, +0xb0, 0xd4, 0xaf, 0x1a, 0x24, 0x91, 0x42, 0x27, 0x9b, 0x3c, 0x4c, 0xfb, 0x54, 0x70, 0x17, 0x38, +0x1d, 0xab, 0xef, 0xaf, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, +0x00, 0x0d, 0xee, 0x91, 0xff, 0x00, 0xc8, 0xf4, 0xec, 0x57, 0x29, 0xfc, 0x80, 0xee, 0xa3, 0x75, +0x7f, 0x5f, 0xdf, 0xf0, 0xea, 0x5f, 0xd9, 0x77, 0xfe, 0x8d, 0xb7, 0xe0, 0x1f, 0xfe, 0x1b, 0xdd, +0x27, 0xff, 0x00, 0x91, 0xe8, 0xff, 0x00, 0x87, 0x52, 0xfe, 0xcb, 0xbf, 0xf4, 0x6d, 0xbf, 0x00, +0xff, 0x00, 0xf0, 0xde, 0xe9, 0x3f, 0xfc, 0x8f, 0x4f, 0x94, 0x39, 0x4f, 0xe4, 0x07, 0x75, 0x7e, +0x85, 0x7f, 0xc1, 0xaf, 0x27, 0x3f, 0xf0, 0x57, 0x4f, 0x0e, 0xff, 0x00, 0xd8, 0xb1, 0xac, 0x7f, +0xe8, 0xa4, 0xaf, 0xdf, 0x4f, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, +0xff, 0x00, 0x0d, 0xee, 0x93, 0xff, 0x00, 0xc8, 0xf5, 0xd1, 0xfc, 0x27, 0xfd, 0x83, 0xbe, 0x07, +0x7c, 0x05, 0xf1, 0x74, 0x7e, 0x23, 0xf0, 0x2f, 0xc1, 0xbf, 0x85, 0x3e, 0x08, 0xf1, 0x04, 0x31, +0x3c, 0x11, 0xea, 0x9a, 0x07, 0x84, 0x74, 0xfd, 0x36, 0xf5, 0x23, 0x71, 0x87, 0x41, 0x34, 0x31, +0x2b, 0x85, 0x61, 0xc1, 0x00, 0xe0, 0xf7, 0xa5, 0xca, 0x54, 0x63, 0xa9, 0xeb, 0x75, 0xf8, 0x9f, +0xff, 0x00, 0x07, 0x85, 0x7e, 0xce, 0xdf, 0x68, 0xf0, 0x5f, 0xc1, 0x9f, 0x8b, 0x76, 0xb0, 0xaf, +0xfc, 0x4b, 0xaf, 0xaf, 0x3c, 0x1f, 0xa9, 0x4a, 0xa9, 0x97, 0x71, 0x71, 0x1f, 0xdb, 0x2d, 0x37, +0x1c, 0xfc, 0xaa, 0x86, 0xd6, 0xf0, 0x67, 0x18, 0xcc, 0xe0, 0x13, 0x9c, 0x67, 0xf6, 0xc2, 0xbe, +0x41, 0xff, 0x00, 0x82, 0xef, 0x7e, 0xce, 0xdf, 0xf0, 0xd3, 0x1f, 0xf0, 0x4a, 0x3f, 0x8b, 0xfa, +0x3d, 0xbc, 0x2d, 0x36, 0xa9, 0xa1, 0x69, 0x1f, 0xf0, 0x94, 0xe9, 0xdb, 0x23, 0xdf, 0x2f, 0x9d, +0xa6, 0xba, 0xde, 0x94, 0x8c, 0x60, 0x92, 0xf2, 0x45, 0x0c, 0xb0, 0xe0, 0x0c, 0x91, 0x29, 0x03, +0x04, 0x83, 0x4e, 0x41, 0xe4, 0x7f, 0x28, 0x22, 0xbe, 0xf4, 0xff, 0x00, 0x83, 0x6b, 0x3f, 0x68, +0x5f, 0xf8, 0x50, 0xbf, 0xf0, 0x56, 0x5f, 0x06, 0xd8, 0xcf, 0x32, 0xc1, 0xa6, 0xfc, 0x48, 0xd3, +0x6f, 0xfc, 0x23, 0x74, 0xce, 0xc7, 0x62, 0xbc, 0x91, 0x8b, 0xbb, 0x6e, 0x3f, 0xbc, 0xd7, 0x36, +0x70, 0xc4, 0xa7, 0xb7, 0x9e, 0x79, 0x00, 0x9a, 0xf8, 0x29, 0x1c, 0x3a, 0x82, 0xbc, 0x82, 0x32, +0x31, 0x5b, 0xbf, 0x0c, 0x7e, 0x26, 0xea, 0x7f, 0x04, 0x7e, 0x28, 0x78, 0x63, 0xc6, 0xda, 0x2a, +0xab, 0x6b, 0x5e, 0x0b, 0xd6, 0x2c, 0xfc, 0x41, 0xa7, 0xab, 0xfd, 0xd6, 0xb9, 0xb4, 0x9d, 0x2e, +0x22, 0x07, 0x83, 0xc1, 0x78, 0xd7, 0x3c, 0x1a, 0x92, 0x16, 0xe7, 0xf6, 0xc1, 0x5f, 0xc8, 0xdf, +0xfc, 0x16, 0x43, 0xf6, 0x87, 0xff, 0x00, 0x86, 0xa2, 0xff, 0x00, 0x82, 0xa0, 0x7c, 0x68, 0xf1, +0x54, 0x33, 0x79, 0xda, 0x6c, 0x1e, 0x21, 0x93, 0x41, 0xd3, 0x76, 0xc9, 0xbe, 0x2f, 0xb2, 0xe9, +0xca, 0xb6, 0x08, 0xf1, 0x9c, 0x91, 0xb2, 0x43, 0x6e, 0xd3, 0x71, 0xc1, 0x33, 0xb1, 0xc0, 0xcd, +0x7f, 0x4e, 0x5f, 0xb5, 0x47, 0xed, 0x8b, 0xa4, 0xfc, 0x1f, 0xff, 0x00, 0x82, 0x7d, 0x78, 0xcf, +0xe3, 0x86, 0x8f, 0x75, 0x6f, 0x75, 0xa7, 0x69, 0x9e, 0x0a, 0x9f, 0xc4, 0xfa, 0x24, 0x92, 0x7d, +0xcb, 0xe7, 0x92, 0xd3, 0xcd, 0xb2, 0x4e, 0xe3, 0xf7, 0xb2, 0x3c, 0x2a, 0x3a, 0x8c, 0xb8, 0xed, +0x5f, 0xc7, 0x95, 0xba, 0x3c, 0x70, 0xa8, 0x92, 0x49, 0x26, 0x90, 0x01, 0xba, 0x47, 0x62, 0xcd, +0x21, 0xee, 0xc4, 0x9e, 0x49, 0x3d, 0x49, 0x3d, 0x4d, 0x36, 0xcb, 0x96, 0x88, 0x79, 0xe9, 0x5f, +0xd1, 0x57, 0xfc, 0x1a, 0x51, 0xfb, 0x3b, 0x2f, 0xc3, 0x9f, 0xd8, 0x03, 0xc4, 0xbf, 0x11, 0x2e, +0x20, 0x55, 0xbf, 0xf8, 0xa1, 0xe2, 0x89, 0xda, 0xde, 0x70, 0x3e, 0x69, 0x74, 0xfd, 0x3c, 0x7d, +0x8e, 0x25, 0x3d, 0xfe, 0x5b, 0xa1, 0xa8, 0x1f, 0x4f, 0x9f, 0xa7, 0x52, 0x7f, 0x9d, 0x1b, 0x89, +0x1a, 0x28, 0x1d, 0x96, 0x37, 0x95, 0x95, 0x49, 0x54, 0x45, 0x2c, 0xce, 0x7b, 0x00, 0x07, 0x24, +0x9e, 0x98, 0xf5, 0x35, 0xfd, 0x90, 0x7e, 0xc1, 0x3f, 0xb3, 0x92, 0xfe, 0xc9, 0x3f, 0xb1, 0x7f, +0xc2, 0xff, 0x00, 0x86, 0xac, 0xb0, 0xad, 0xdf, 0x83, 0x7c, 0x33, 0x65, 0xa7, 0x5f, 0x34, 0x43, +0xe5, 0x9a, 0xf1, 0x61, 0x53, 0x75, 0x2f, 0x04, 0x8f, 0x9e, 0xe0, 0xca, 0xfc, 0x12, 0x3e, 0x6a, +0x48, 0x98, 0xa3, 0xd8, 0x2b, 0xe7, 0x5f, 0xf8, 0x2b, 0x9f, 0xfc, 0xa2, 0xcb, 0xf6, 0x8d, 0xff, +0x00, 0xb2, 0x6d, 0xe2, 0x0f, 0xfd, 0x37, 0xcd, 0x5f, 0x45, 0x57, 0xce, 0xbf, 0xf0, 0x57, 0x3f, +0xf9, 0x45, 0x97, 0xed, 0x1b, 0xff, 0x00, 0x64, 0xdb, 0xc4, 0x1f, 0xfa, 0x6f, 0x9a, 0xad, 0x9a, +0x47, 0x73, 0xf9, 0x0d, 0xaa, 0x7e, 0x20, 0xff, 0x00, 0x90, 0x0d, 0xf7, 0xfd, 0x7b, 0xc9, 0xff, +0x00, 0xa0, 0x9a, 0xb9, 0x54, 0xfc, 0x41, 0xff, 0x00, 0x20, 0x1b, 0xef, 0xfa, 0xf7, 0x93, 0xff, +0x00, 0x41, 0x35, 0x06, 0x27, 0xf6, 0xf5, 0xe1, 0x8f, 0xf9, 0x17, 0x6c, 0x3f, 0xeb, 0xde, 0x3f, +0xfd, 0x00, 0x57, 0xf3, 0xa3, 0xff, 0x00, 0x07, 0x70, 0xff, 0x00, 0xca, 0x51, 0x3c, 0x25, 0xff, +0x00, 0x64, 0xaf, 0x4a, 0xff, 0x00, 0xd3, 0xb6, 0xb5, 0x5f, 0xd1, 0x77, 0x86, 0x3f, 0xe4, 0x5d, +0xb0, 0xff, 0x00, 0xaf, 0x78, 0xff, 0x00, 0xf4, 0x01, 0x5f, 0xce, 0x8f, 0xfc, 0x1d, 0xc0, 0x7f, +0xe3, 0x68, 0xbe, 0x13, 0xff, 0x00, 0xb2, 0x57, 0xa5, 0x7f, 0xe9, 0xdb, 0x5b, 0xa7, 0xd0, 0xd2, +0x67, 0xe5, 0xfd, 0x7e, 0xca, 0x7f, 0xc1, 0x9c, 0xbf, 0xf2, 0x5b, 0x7e, 0x3e, 0x7f, 0xd8, 0x0f, +0x44, 0xff, 0x00, 0xd2, 0x8b, 0xea, 0xfc, 0x6b, 0xaf, 0xd9, 0x4f, 0xf8, 0x33, 0x9b, 0xfe, 0x4b, +0x5f, 0xc7, 0xcf, 0xfb, 0x02, 0x68, 0x7f, 0xfa, 0x51, 0x7d, 0x52, 0x4c, 0x77, 0x3f, 0x7a, 0x28, +0xa2, 0x8a, 0xd4, 0xa0, 0xa2, 0x8a, 0x28, 0x03, 0xf9, 0x53, 0xff, 0x00, 0x83, 0x89, 0x3f, 0xe5, +0x35, 0x5f, 0x1d, 0xff, 0x00, 0xeb, 0xe7, 0x42, 0xff, 0x00, 0xd4, 0x73, 0x4a, 0xaf, 0x8b, 0xeb, +0xed, 0x6f, 0xf8, 0x38, 0xb2, 0xc6, 0x6b, 0x2f, 0xf8, 0x2d, 0x27, 0xc6, 0xe7, 0x96, 0x32, 0x8b, +0x75, 0x26, 0x87, 0x34, 0x44, 0xff, 0x00, 0x1a, 0x7f, 0xc2, 0x3f, 0xa6, 0x26, 0x7f, 0xef, 0xa4, +0x61, 0xf8, 0x57, 0xc5, 0x35, 0x99, 0x9b, 0x0c, 0xd1, 0xba, 0xbf, 0x69, 0x3f, 0xe0, 0xd5, 0x8f, +0xd9, 0x03, 0xe1, 0x37, 0xed, 0x31, 0xf0, 0x43, 0xe2, 0xfd, 0xef, 0xc4, 0x8f, 0x85, 0xdf, 0x0e, +0xfe, 0x21, 0x5e, 0x69, 0x7e, 0x21, 0xb2, 0xb7, 0xb1, 0xb8, 0xf1, 0x2f, 0x86, 0xec, 0xf5, 0x69, +0x2d, 0x23, 0x6b, 0x52, 0xcc, 0x91, 0xb5, 0xc4, 0x6e, 0x51, 0x4b, 0x72, 0x42, 0xe0, 0x13, 0x8c, +0xd7, 0xea, 0xd7, 0xfc, 0x3a, 0x97, 0xf6, 0x5d, 0xff, 0x00, 0xa3, 0x6d, 0xf8, 0x07, 0xff, 0x00, +0x86, 0xf7, 0x49, 0xff, 0x00, 0xe4, 0x7a, 0x76, 0x2b, 0x94, 0xfe, 0x40, 0x77, 0x51, 0xba, 0xbf, +0xaf, 0xef, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, 0x00, 0x0d, +0xee, 0x93, 0xff, 0x00, 0xc8, 0xf4, 0x7f, 0xc3, 0xa9, 0x7f, 0x65, 0xdf, 0xfa, 0x36, 0xdf, 0x80, +0x7f, 0xf8, 0x6f, 0x74, 0x9f, 0xfe, 0x47, 0xa7, 0xca, 0x1c, 0xa7, 0xf2, 0x03, 0xba, 0xbd, 0xb3, +0xfe, 0x09, 0xc4, 0x73, 0xfb, 0x6e, 0xf8, 0x0b, 0xfe, 0xba, 0x5f, 0xff, 0x00, 0xe9, 0xba, 0xea, +0xbf, 0xa9, 0x2f, 0xf8, 0x75, 0x2f, 0xec, 0xbb, 0xff, 0x00, 0x46, 0xdb, 0xf0, 0x0f, 0xff, 0x00, +0x0d, 0xee, 0x91, 0xff, 0x00, 0xc8, 0xf5, 0x77, 0xc2, 0xff, 0x00, 0xf0, 0x4d, 0x2f, 0xd9, 0xcb, +0xc0, 0xfa, 0xf5, 0xbe, 0xab, 0xa2, 0x7e, 0xcf, 0xff, 0x00, 0x04, 0xf4, 0x7d, 0x52, 0xd3, 0x77, +0x93, 0x79, 0x63, 0xe0, 0x4d, 0x2e, 0xde, 0xe2, 0x1d, 0xca, 0x51, 0xb6, 0xba, 0x42, 0x19, 0x72, +0xac, 0xca, 0x70, 0x79, 0x04, 0x8e, 0x84, 0xd4, 0xb8, 0x95, 0x18, 0xd9, 0xdc, 0xfc, 0x02, 0xff, +0x00, 0x83, 0x9a, 0x7f, 0x63, 0x9b, 0xbf, 0xd9, 0xab, 0xfe, 0x0a, 0x43, 0xa9, 0x78, 0xd2, 0xd6, +0xcc, 0xc3, 0xe1, 0x4f, 0x8c, 0xd6, 0xab, 0xaf, 0xd9, 0x4a, 0x89, 0x88, 0x93, 0x50, 0x89, 0x23, +0x83, 0x50, 0x83, 0xae, 0x77, 0xf9, 0x82, 0x2b, 0x92, 0x4f, 0x1f, 0xe9, 0xb8, 0x1f, 0x74, 0x81, +0xf9, 0xe3, 0x5f, 0xd7, 0xa7, 0xfc, 0x14, 0xf3, 0xfe, 0x09, 0xeb, 0xe1, 0x5f, 0xf8, 0x29, 0x8f, +0xec, 0xb3, 0xaa, 0x7c, 0x39, 0xf1, 0x24, 0xed, 0xa5, 0x5f, 0xac, 0x83, 0x51, 0xf0, 0xf6, 0xb7, +0x1c, 0x3e, 0x6c, 0xba, 0x16, 0xa7, 0x1a, 0xb2, 0xc5, 0x70, 0x13, 0x23, 0xcc, 0x8c, 0xab, 0xbc, +0x72, 0x47, 0x95, 0xdf, 0x1c, 0xae, 0x03, 0x23, 0x6d, 0x75, 0xfe, 0x53, 0x7f, 0x6a, 0x6f, 0xd9, +0x5b, 0xc7, 0x9f, 0xb1, 0x67, 0xc6, 0xfd, 0x5b, 0xe1, 0xdf, 0xc4, 0x8d, 0x0a, 0x6d, 0x03, 0xc4, +0xda, 0x4e, 0x1f, 0x61, 0x25, 0xed, 0xb5, 0x0b, 0x76, 0x66, 0x11, 0xdd, 0xda, 0xcb, 0x80, 0x26, +0xb7, 0x93, 0x6b, 0x6d, 0x90, 0x01, 0xca, 0xb2, 0x30, 0x49, 0x11, 0xd1, 0x42, 0x65, 0x1e, 0xa7, +0x7b, 0xff, 0x00, 0x04, 0xdb, 0xff, 0x00, 0x82, 0x8c, 0xf8, 0xe3, 0xfe, 0x09, 0x93, 0xfb, 0x45, +0xdb, 0xf8, 0xf3, 0xc1, 0xeb, 0x0e, 0xa9, 0xa7, 0xde, 0x44, 0xb6, 0x3e, 0x22, 0xf0, 0xf5, 0xdc, +0xc6, 0x2b, 0x3f, 0x10, 0xd9, 0x06, 0xdd, 0xe5, 0x33, 0x00, 0xde, 0x54, 0xc8, 0x72, 0xd0, 0xce, +0x15, 0x8c, 0x4e, 0x4e, 0x55, 0xe3, 0x79, 0x62, 0x93, 0xfa, 0x2f, 0xfd, 0x92, 0xbf, 0xe0, 0xbe, +0xdf, 0xb3, 0x0f, 0xed, 0x6b, 0xe1, 0x5b, 0x5b, 0x98, 0x7e, 0x25, 0x68, 0x7f, 0x0f, 0xf5, 0xe9, +0x11, 0x7e, 0xd3, 0xa0, 0xf8, 0xd6, 0xee, 0x2d, 0x12, 0xf2, 0xde, 0x42, 0x71, 0xe5, 0xa4, 0x93, +0x30, 0x82, 0xe0, 0xf4, 0x20, 0xdb, 0xcb, 0x27, 0x07, 0x9c, 0x1c, 0x81, 0xfc, 0xa8, 0xe7, 0x34, +0x15, 0x0c, 0x30, 0x46, 0x68, 0x05, 0x2b, 0x1f, 0xd9, 0x41, 0xfd, 0xba, 0x3e, 0x0a, 0x03, 0xff, +0x00, 0x25, 0x83, 0xe1, 0x6f, 0xfe, 0x15, 0x96, 0x1f, 0xfc, 0x76, 0x8f, 0xf8, 0x6e, 0x8f, 0x82, +0x7f, 0xf4, 0x58, 0x3e, 0x16, 0xff, 0x00, 0xe1, 0x59, 0x61, 0xff, 0x00, 0xc7, 0x6b, 0xf8, 0xd3, +0xfb, 0x1c, 0x3f, 0xf3, 0xc6, 0x3f, 0xfb, 0xe4, 0x51, 0xf6, 0x38, 0x7f, 0xe7, 0x8c, 0x7f, 0xf7, +0xc8, 0xa3, 0x52, 0xb9, 0x97, 0x63, 0xd7, 0x3f, 0x6f, 0xdd, 0x62, 0xd3, 0xc4, 0x5f, 0xb7, 0xf7, +0xc7, 0xcd, 0x43, 0x4f, 0xba, 0xb7, 0xbe, 0xd3, 0xf5, 0x0f, 0x89, 0x9e, 0x27, 0xba, 0xb5, 0xb9, +0xb7, 0x90, 0x49, 0x0d, 0xcc, 0x32, 0x6b, 0x17, 0x4e, 0x92, 0x23, 0xa9, 0x21, 0x91, 0x94, 0x86, +0x0c, 0x09, 0x04, 0x10, 0x47, 0x06, 0xbc, 0x9c, 0xf4, 0xa1, 0x54, 0x28, 0xc0, 0x18, 0x03, 0x80, +0x05, 0x07, 0xa5, 0x06, 0x67, 0xf4, 0xbd, 0xff, 0x00, 0x06, 0xae, 0x7f, 0xca, 0x26, 0xb4, 0xbf, +0xfb, 0x1a, 0xf5, 0x9f, 0xfd, 0x1e, 0x2b, 0xb1, 0xff, 0x00, 0x83, 0x97, 0x3f, 0xe5, 0x0a, 0xbf, +0x18, 0x3f, 0xeb, 0xe7, 0xc3, 0xbf, 0xfa, 0x91, 0x69, 0x75, 0xc7, 0x7f, 0xc1, 0xab, 0x9f, 0xf2, +0x89, 0xad, 0x2f, 0xfe, 0xc6, 0xbd, 0x67, 0xff, 0x00, 0x47, 0x8a, 0xec, 0x7f, 0xe0, 0xe5, 0xcf, +0xf9, 0x42, 0xaf, 0xc6, 0x0f, 0xfa, 0xf9, 0xf0, 0xef, 0xfe, 0xa4, 0x5a, 0x5d, 0x57, 0x43, 0x4e, +0x87, 0xf2, 0xe1, 0x5d, 0x87, 0xec, 0xef, 0xff, 0x00, 0x27, 0x13, 0xf0, 0xf7, 0xfe, 0xc6, 0xad, +0x27, 0xff, 0x00, 0x4b, 0x62, 0xae, 0x3e, 0xbb, 0x0f, 0xd9, 0xdf, 0xfe, 0x4e, 0x27, 0xe1, 0xef, +0xfd, 0x8d, 0x5a, 0x4f, 0xfe, 0x96, 0xc5, 0x52, 0x66, 0x7f, 0x69, 0x95, 0xfc, 0xce, 0xff, 0x00, +0xc1, 0xd1, 0x9f, 0xb3, 0x6d, 0xef, 0xc1, 0x9f, 0xf8, 0x2a, 0x05, 0xf7, 0x8c, 0xfe, 0xcf, 0x30, +0xd1, 0x7e, 0x2e, 0xe8, 0x96, 0x7a, 0xcd, 0xad, 0xc1, 0x4d, 0xb0, 0x9b, 0xbb, 0x48, 0x63, 0xb0, +0xba, 0x81, 0x4e, 0x06, 0x59, 0x16, 0x0b, 0x59, 0x5f, 0xaf, 0xfc, 0x7d, 0xa9, 0xcf, 0x38, 0x1f, +0xd3, 0x15, 0x7c, 0x87, 0xff, 0x00, 0x05, 0x9c, 0xff, 0x00, 0x82, 0x66, 0x58, 0xff, 0x00, 0xc1, +0x4f, 0x7f, 0x64, 0x5b, 0x8f, 0x0b, 0xd9, 0xcf, 0x65, 0xa6, 0x78, 0xfb, 0xc3, 0x53, 0x36, 0xb3, +0xe1, 0x0d, 0x4e, 0xe4, 0x62, 0x38, 0xaf, 0x15, 0x0a, 0xb5, 0xac, 0xce, 0x06, 0xe5, 0xb7, 0xb8, +0x42, 0x63, 0x72, 0x33, 0xb1, 0x84, 0x52, 0xec, 0x73, 0x0a, 0xa1, 0xa9, 0x1a, 0x6e, 0x8f, 0xe4, +0xfe, 0xbf, 0x4b, 0xbf, 0xe0, 0xdd, 0xaf, 0xf8, 0x2c, 0x2f, 0x86, 0x7f, 0xe0, 0x9e, 0x5e, 0x33, +0xf1, 0x47, 0xc3, 0xdf, 0x8a, 0x17, 0x57, 0x5a, 0x7f, 0xc3, 0x3f, 0x1e, 0x5d, 0x47, 0xaa, 0x5b, +0xea, 0xf1, 0x40, 0xd3, 0xc7, 0xe1, 0xfd, 0x55, 0x63, 0x58, 0x5a, 0x49, 0xa3, 0x40, 0x5f, 0xc8, +0x9e, 0x14, 0x85, 0x1a, 0x45, 0x0c, 0x63, 0x6b, 0x78, 0x89, 0x5d, 0x8f, 0x23, 0xc7, 0xf9, 0xd7, +0xf1, 0x2f, 0xe1, 0xa7, 0x88, 0xbe, 0x0b, 0xfc, 0x44, 0xd6, 0xbc, 0x21, 0xe2, 0xed, 0x17, 0x50, +0xf0, 0xdf, 0x8a, 0x3c, 0x37, 0x74, 0xd6, 0x3a, 0xa6, 0x97, 0x7c, 0x9b, 0x2e, 0x2c, 0xa6, 0x5c, +0x12, 0xac, 0x01, 0x20, 0x82, 0x08, 0x65, 0x65, 0x25, 0x5d, 0x59, 0x5d, 0x59, 0x95, 0x95, 0x8e, +0x2f, 0x5a, 0x92, 0x36, 0x67, 0xf6, 0x39, 0xa2, 0x7f, 0xc1, 0x41, 0x7e, 0x03, 0xf8, 0x97, 0x4c, +0x8a, 0xfb, 0x4f, 0xf8, 0xd5, 0xf0, 0x96, 0xfa, 0xce, 0xe0, 0x66, 0x29, 0xe0, 0xf1, 0x86, 0x9f, +0x24, 0x72, 0x0e, 0x87, 0x04, 0x4d, 0x8e, 0x0f, 0x1f, 0x5a, 0xb9, 0xff, 0x00, 0x0d, 0xd1, 0xf0, +0x4f, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, 0xed, 0x7f, 0x1a, 0x6d, 0x6b, +0x1b, 0xb6, 0x5a, 0x38, 0xd8, 0xfa, 0x95, 0x14, 0x7d, 0x8e, 0x1f, 0xf9, 0xe3, 0x1f, 0xfd, 0xf2, +0x28, 0xd4, 0xbe, 0x65, 0xd8, 0xfd, 0x3a, 0xff, 0x00, 0x83, 0xaa, 0xbe, 0x2b, 0x78, 0x5f, 0xe2, +0xff, 0x00, 0xed, 0xe9, 0xe0, 0x3d, 0x4b, 0xc2, 0x7e, 0x24, 0xd0, 0x3c, 0x51, 0xa7, 0xdb, 0xf8, +0x02, 0xde, 0xda, 0x5b, 0x9d, 0x23, 0x51, 0x86, 0xfa, 0x18, 0xa5, 0x1a, 0x8d, 0xfb, 0x18, 0xd9, +0xe2, 0x66, 0x01, 0x82, 0xb2, 0x9d, 0xa4, 0xe7, 0x04, 0x7a, 0xd7, 0xe6, 0x4d, 0x36, 0x38, 0x96, +0x21, 0x85, 0x55, 0x5f, 0xa0, 0xc5, 0x3a, 0x82, 0x24, 0xee, 0xcf, 0xd7, 0xaf, 0xf8, 0x33, 0xdc, +0xe3, 0xf6, 0xad, 0xf8, 0xcb, 0xff, 0x00, 0x62, 0x95, 0x97, 0xfe, 0x96, 0x35, 0x7e, 0xb3, 0x7f, +0xc1, 0x64, 0x3f, 0x66, 0x6d, 0x43, 0xf6, 0xbe, 0xff, 0x00, 0x82, 0x68, 0x7c, 0x5f, 0xf0, 0x26, +0x8b, 0x6b, 0x71, 0xa8, 0x6b, 0xd7, 0xda, 0x2f, 0xf6, 0x96, 0x93, 0x67, 0x6e, 0x33, 0x35, 0xed, +0xed, 0x84, 0xd1, 0x5f, 0xdb, 0xc0, 0x83, 0xbb, 0x4b, 0x2d, 0xb2, 0x46, 0x07, 0x7d, 0xf8, 0x3c, +0x66, 0xbf, 0x26, 0x7f, 0xe0, 0xcf, 0x8f, 0xf9, 0x3a, 0xcf, 0x8c, 0xdf, 0xf6, 0x29, 0x59, 0x7f, +0xe9, 0x63, 0x57, 0xf4, 0x05, 0x4e, 0x3b, 0x17, 0x1d, 0x8f, 0xe2, 0x02, 0xda, 0xe1, 0x2e, 0xed, +0xe3, 0x96, 0x36, 0x0f, 0x1c, 0x8a, 0x19, 0x58, 0x1e, 0x08, 0x3c, 0x83, 0x5a, 0x7e, 0x10, 0xf1, +0x76, 0xa9, 0xf0, 0xfb, 0xc5, 0xfa, 0x47, 0x88, 0x74, 0x3b, 0xc6, 0xd3, 0xf5, 0xbf, 0x0f, 0xdf, +0x41, 0xa9, 0xe9, 0xd7, 0x4a, 0xa1, 0x9a, 0xd6, 0xea, 0x09, 0x56, 0x58, 0x65, 0x00, 0xf0, 0x4a, +0xc8, 0x8a, 0xd8, 0x3e, 0x95, 0xfa, 0x2b, 0xff, 0x00, 0x07, 0x0c, 0x7f, 0xc1, 0x21, 0x35, 0x4f, +0xd8, 0xa7, 0xe3, 0xa6, 0xab, 0xf1, 0x73, 0xc1, 0x7a, 0x6b, 0x5c, 0x7c, 0x1d, 0xf8, 0x81, 0xa8, +0xbd, 0xdd, 0xc0, 0xb5, 0x80, 0xf9, 0x7e, 0x0f, 0xd4, 0xe7, 0x7d, 0xd2, 0x5a, 0xca, 0x17, 0x84, +0xb5, 0x9a, 0x57, 0x2d, 0x03, 0x8c, 0x2a, 0x97, 0x30, 0x61, 0x4a, 0xc3, 0xe7, 0x7e, 0x6d, 0x66, +0x91, 0x2d, 0x34, 0xcf, 0xea, 0x7b, 0xfe, 0x09, 0xff, 0x00, 0xff, 0x00, 0x05, 0xe4, 0xf8, 0x07, +0xfb, 0x69, 0x7c, 0x26, 0xd2, 0xef, 0x35, 0x5f, 0x1c, 0x78, 0x57, 0xe1, 0xc7, 0x8f, 0x3e, 0xcf, +0x1a, 0x6b, 0x5e, 0x18, 0xf1, 0x1e, 0xa9, 0x16, 0x9b, 0x24, 0x17, 0x61, 0x49, 0x97, 0xec, 0x92, +0x4c, 0xca, 0x97, 0x70, 0x12, 0x0b, 0x2b, 0xc6, 0x4b, 0x04, 0x2b, 0xe6, 0x24, 0x6f, 0xb9, 0x07, +0xd1, 0x5f, 0xf0, 0xdd, 0x1f, 0x04, 0xff, 0x00, 0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, +0xc3, 0xff, 0x00, 0x8e, 0xd7, 0xf1, 0xaa, 0xf1, 0xac, 0x8b, 0x86, 0x55, 0x61, 0xe8, 0x45, 0x37, +0xec, 0x70, 0xff, 0x00, 0xcf, 0x18, 0xff, 0x00, 0xef, 0x91, 0x46, 0xa5, 0x73, 0x1f, 0xd6, 0x87, +0xed, 0xfd, 0xfb, 0x65, 0xfc, 0x21, 0xf1, 0x47, 0xec, 0x1f, 0xf1, 0xb3, 0x4d, 0xd3, 0x7e, 0x2a, +0x7c, 0x37, 0xd4, 0x35, 0x0d, 0x43, 0xc0, 0x5a, 0xed, 0xb5, 0xb5, 0xb5, 0xb7, 0x89, 0xec, 0xa5, +0x9a, 0xe2, 0x57, 0xd3, 0xa7, 0x54, 0x44, 0x45, 0x94, 0x96, 0x66, 0x62, 0x00, 0x51, 0xc9, 0x26, +0xbf, 0x93, 0x18, 0x78, 0x85, 0x7f, 0xdd, 0x14, 0xd1, 0x69, 0x12, 0x9c, 0x88, 0xa3, 0xff, 0x00, +0xbe, 0x45, 0x49, 0x41, 0x32, 0x95, 0xc8, 0xef, 0x3f, 0xe3, 0xce, 0x6f, 0xf7, 0x0f, 0xf2, 0xaf, +0xec, 0xaf, 0xf6, 0x17, 0xff, 0x00, 0x93, 0x2b, 0xf8, 0x3f, 0xff, 0x00, 0x62, 0x3e, 0x89, 0xff, +0x00, 0xa4, 0x10, 0xd7, 0xf1, 0xa9, 0x79, 0xff, 0x00, 0x1e, 0x73, 0x7f, 0xb8, 0x7f, 0x95, 0x7f, +0x65, 0x7f, 0xb0, 0xbf, 0xfc, 0x99, 0x5f, 0xc1, 0xff, 0x00, 0xfb, 0x11, 0xf4, 0x4f, 0xfd, 0x20, +0x86, 0x8e, 0xa5, 0x47, 0x66, 0x7c, 0x6d, 0xff, 0x00, 0x07, 0x51, 0xff, 0x00, 0xca, 0x26, 0xb5, +0x4f, 0xfb, 0x1a, 0xf4, 0x6f, 0xfd, 0x1e, 0x6b, 0xf9, 0xa1, 0x1d, 0x2b, 0xfa, 0x5e, 0xff, 0x00, +0x83, 0xa8, 0xff, 0x00, 0xe5, 0x13, 0x5a, 0xa7, 0xfd, 0x8d, 0x7a, 0x37, 0xfe, 0x8f, 0x35, 0xfc, +0xd0, 0x8e, 0x95, 0x52, 0x26, 0x47, 0xac, 0x7e, 0xc0, 0x5a, 0xc5, 0xa7, 0x87, 0x7f, 0x6f, 0xef, +0x80, 0x7a, 0x86, 0xa1, 0x75, 0x6f, 0x63, 0xa7, 0xe9, 0xff, 0x00, 0x13, 0x3c, 0x31, 0x75, 0x75, +0x73, 0x71, 0x20, 0x8e, 0x1b, 0x68, 0x63, 0xd6, 0x2d, 0x5d, 0xe4, 0x77, 0x62, 0x02, 0xa2, 0xa8, +0x2c, 0x58, 0x90, 0x00, 0x04, 0x9e, 0x05, 0x7f, 0x5a, 0x1f, 0xf0, 0xdd, 0x1f, 0x04, 0xff, 0x00, +0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, 0xc3, 0xff, 0x00, 0x8e, 0xd7, 0xf1, 0xae, 0xca, +0x18, 0x60, 0x8c, 0x83, 0xc1, 0x06, 0xa3, 0xfb, 0x1c, 0x3f, 0xf3, 0xc6, 0x3f, 0xfb, 0xe4, 0x54, +0x84, 0x65, 0x63, 0xfb, 0x2c, 0x1f, 0xb7, 0x47, 0xc1, 0x43, 0xff, 0x00, 0x35, 0x83, 0xe1, 0x6f, +0xfe, 0x15, 0x96, 0x1f, 0xfc, 0x76, 0xbc, 0x3f, 0xf6, 0xaa, 0xff, 0x00, 0x82, 0xf3, 0x7e, 0xcb, +0xbf, 0xb2, 0x77, 0x86, 0x2e, 0xae, 0xaf, 0xbe, 0x28, 0x78, 0x7f, 0xc7, 0x1a, 0xc4, 0x20, 0x88, +0x74, 0x2f, 0x05, 0x5d, 0xc5, 0xae, 0xea, 0x17, 0x12, 0x0f, 0xf9, 0x66, 0x7c, 0x97, 0x30, 0xc0, +0xdd, 0xf3, 0x73, 0x2c, 0x4b, 0xef, 0x92, 0x01, 0xfe, 0x50, 0xfe, 0xc7, 0x0f, 0xfc, 0xf1, 0x8f, +0xfe, 0xf9, 0x14, 0xf0, 0xa1, 0x46, 0x00, 0x00, 0x7a, 0x62, 0x8b, 0xb1, 0xf3, 0x23, 0xe8, 0xdf, +0xf8, 0x29, 0xb7, 0xfc, 0x14, 0xc7, 0xc7, 0x5f, 0xf0, 0x54, 0x1f, 0x8f, 0xff, 0x00, 0xf0, 0x97, +0xf8, 0xa9, 0x17, 0x47, 0xd0, 0x74, 0x74, 0x92, 0xd3, 0xc3, 0x1e, 0x1a, 0xb7, 0x9c, 0xcb, 0x6b, +0xa0, 0x5a, 0xbb, 0x29, 0x70, 0x18, 0x85, 0xf3, 0x27, 0x94, 0xa2, 0x34, 0xb3, 0x15, 0x52, 0xe5, +0x10, 0x05, 0x54, 0x8e, 0x35, 0x5f, 0x9c, 0xfa, 0x0a, 0x3a, 0x57, 0x75, 0xfb, 0x35, 0x7e, 0xcd, +0x1e, 0x39, 0xfd, 0xb0, 0x7e, 0x34, 0x69, 0x3f, 0x0f, 0xbe, 0x1c, 0xe8, 0x17, 0x5e, 0x23, 0xf1, +0x56, 0xb2, 0x49, 0x8e, 0x08, 0xfe, 0x58, 0xad, 0x21, 0x52, 0xa2, 0x4b, 0x9b, 0x89, 0x31, 0xb6, +0x1b, 0x78, 0xf7, 0x2e, 0xe9, 0x1b, 0x81, 0xb9, 0x54, 0x65, 0x99, 0x55, 0x82, 0x75, 0x67, 0xd7, +0x5f, 0xf0, 0x6e, 0x2f, 0xec, 0x55, 0x75, 0xfb, 0x5a, 0xff, 0x00, 0xc1, 0x49, 0x7c, 0x3b, 0xe2, +0x0b, 0xab, 0x3f, 0x37, 0xc2, 0x3f, 0x06, 0x8c, 0x7e, 0x2e, 0xd5, 0xa6, 0x74, 0x26, 0x3f, 0xb6, +0x23, 0x30, 0xd3, 0x20, 0x0c, 0x01, 0xdb, 0x2b, 0x5d, 0x28, 0x9d, 0x73, 0xc1, 0x4b, 0x19, 0x86, +0x41, 0xc5, 0x7f, 0x51, 0x15, 0xf3, 0x4f, 0xfc, 0x12, 0xb3, 0xfe, 0x09, 0xc3, 0xe1, 0x7f, 0xf8, +0x26, 0x47, 0xec, 0xb1, 0xa7, 0xf8, 0x13, 0x45, 0x91, 0x35, 0x4f, 0x10, 0x5e, 0x38, 0xd4, 0xbc, +0x4f, 0xae, 0x98, 0xf6, 0x3e, 0xb7, 0xa8, 0xba, 0x80, 0xee, 0x14, 0xfd, 0xc8, 0x23, 0x50, 0x23, +0x8a, 0x3f, 0xe1, 0x44, 0x05, 0x8b, 0x3b, 0x48, 0xef, 0xf4, 0xb5, 0x54, 0x4b, 0xb5, 0xb4, 0x3f, +0x96, 0xdf, 0xf8, 0x38, 0xef, 0xf6, 0x6f, 0xbc, 0xfd, 0x9f, 0x7f, 0xe0, 0xab, 0xde, 0x3a, 0xd4, +0x1a, 0xdd, 0xe2, 0xd1, 0x7e, 0x25, 0x41, 0x6b, 0xe2, 0xdd, 0x2a, 0x4e, 0x59, 0x5c, 0x4b, 0x12, +0xc1, 0x74, 0xbb, 0xba, 0x6f, 0x17, 0x76, 0xf7, 0x0c, 0x57, 0xaa, 0xa4, 0x91, 0x12, 0x30, 0xc0, +0xb7, 0xc2, 0xb5, 0xfd, 0x4c, 0xff, 0x00, 0xc1, 0x75, 0xbf, 0xe0, 0x96, 0x0b, 0xff, 0x00, 0x05, +0x35, 0xfd, 0x95, 0xad, 0xe0, 0xf0, 0xe8, 0xb7, 0x87, 0xe2, 0x97, 0x80, 0x64, 0x9b, 0x52, 0xf0, +0x94, 0xd3, 0x48, 0xb1, 0x47, 0x79, 0xe6, 0x2a, 0x0b, 0x9d, 0x3a, 0x46, 0x6e, 0x16, 0x3b, 0x85, +0x8e, 0x3c, 0x3f, 0xcb, 0xb6, 0x58, 0x20, 0x66, 0x6d, 0x81, 0xc3, 0x7f, 0x2e, 0x9e, 0x27, 0xf0, +0xc6, 0xa9, 0xe0, 0x6f, 0x13, 0xea, 0x5a, 0x1e, 0xb9, 0xa6, 0xea, 0x1a, 0x2e, 0xb5, 0xa3, 0xdc, +0xc9, 0x65, 0xa8, 0x69, 0xf7, 0xf6, 0xed, 0x6f, 0x75, 0x63, 0x3c, 0x6d, 0xb5, 0xe2, 0x96, 0x36, +0x01, 0x91, 0xd5, 0x81, 0x05, 0x48, 0x04, 0x11, 0x52, 0x4c, 0x96, 0xb7, 0x3f, 0x51, 0x3f, 0xe0, +0xdc, 0x6f, 0xf8, 0x2c, 0xbf, 0x84, 0x7f, 0x61, 0x6f, 0xf8, 0x48, 0x3e, 0x11, 0x7c, 0x58, 0xbe, +0x6d, 0x17, 0xc0, 0x7e, 0x2a, 0xd4, 0xc6, 0xb3, 0xa3, 0x78, 0x81, 0xa3, 0x79, 0x61, 0xd1, 0x75, +0x07, 0x8e, 0x38, 0x66, 0x86, 0xe4, 0x28, 0x66, 0x4b, 0x79, 0x56, 0x28, 0x4a, 0xc8, 0x06, 0xd8, +0x9d, 0x64, 0x69, 0x3e, 0x59, 0x0b, 0xa7, 0xee, 0x76, 0x95, 0xfb, 0x7e, 0x7c, 0x0b, 0xd7, 0x34, +0xe8, 0x6f, 0x2c, 0xfe, 0x34, 0x7c, 0x25, 0xbb, 0xb4, 0xb8, 0x5d, 0xf0, 0xcf, 0x07, 0x8c, 0x34, +0xf9, 0x23, 0x95, 0x7d, 0x55, 0x84, 0xb8, 0x23, 0xdc, 0x57, 0xf1, 0xbf, 0x51, 0xb5, 0xac, 0x4e, +0xd9, 0x68, 0xe3, 0x27, 0xd4, 0xa8, 0xa3, 0x50, 0x52, 0xee, 0x7f, 0x65, 0x9f, 0xf0, 0xdd, 0x1f, +0x05, 0x3f, 0xe8, 0xb0, 0x7c, 0x2d, 0xff, 0x00, 0xc2, 0xb2, 0xc3, 0xff, 0x00, 0x8e, 0xd1, 0xff, +0x00, 0x0d, 0xd1, 0xf0, 0x53, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, 0xed, +0x7f, 0x1a, 0x7f, 0x63, 0x87, 0xfe, 0x78, 0xc7, 0xff, 0x00, 0x7c, 0x8a, 0x3e, 0xc7, 0x0f, 0xfc, +0xf1, 0x8f, 0xfe, 0xf9, 0x14, 0x5d, 0x95, 0xcc, 0xbb, 0x1f, 0xd9, 0x67, 0xfc, 0x37, 0x47, 0xc1, +0x3f, 0xfa, 0x2c, 0x1f, 0x0b, 0x7f, 0xf0, 0xac, 0xb0, 0xff, 0x00, 0xe3, 0xb5, 0xe8, 0x5e, 0x12, +0xf1, 0x7e, 0x97, 0xe3, 0xcf, 0x0f, 0x5a, 0xea, 0xda, 0x2e, 0xa3, 0xa7, 0xea, 0xfa, 0x4e, 0xa1, +0x18, 0x9a, 0xd6, 0xf6, 0xc6, 0xe5, 0x2e, 0x6d, 0xee, 0x63, 0x3d, 0x19, 0x24, 0x42, 0x55, 0x94, +0xe3, 0xa8, 0x24, 0x57, 0xf1, 0x47, 0xe0, 0xbf, 0x87, 0x5a, 0x87, 0xc5, 0x0f, 0x1b, 0x68, 0xbe, +0x17, 0xd0, 0x2c, 0xe3, 0xba, 0xd7, 0xbc, 0x4f, 0xa8, 0xdb, 0x68, 0xfa, 0x64, 0x3b, 0x3f, 0xd7, +0x5d, 0xdc, 0xca, 0xb0, 0xc0, 0x9c, 0x02, 0x7e, 0x69, 0x1d, 0x47, 0x00, 0x9e, 0x7a, 0x57, 0xf6, +0x89, 0xf0, 0x33, 0xe1, 0x16, 0x97, 0xf0, 0x03, 0xe0, 0xbf, 0x84, 0x7c, 0x0b, 0xa1, 0x86, 0x5d, +0x17, 0xc1, 0x7a, 0x25, 0x96, 0x83, 0x60, 0xad, 0xf7, 0x85, 0xbd, 0xac, 0x09, 0x04, 0x79, 0xf7, +0xda, 0x82, 0xaa, 0x37, 0x0b, 0xa6, 0x8e, 0xaa, 0xab, 0xea, 0x7a, 0x64, 0x1a, 0xcd, 0x84, 0xd6, +0xb7, 0x50, 0xc3, 0x71, 0x6b, 0x70, 0x8d, 0x14, 0xd0, 0xca, 0x81, 0xe3, 0x95, 0x18, 0x61, 0x95, +0x94, 0xf0, 0x41, 0x04, 0x82, 0x0f, 0x50, 0x6a, 0xc5, 0x15, 0x40, 0x7f, 0x17, 0xbf, 0xb5, 0x07, +0xc0, 0x9b, 0x8f, 0xd9, 0x77, 0xf6, 0x96, 0xf8, 0x81, 0xf0, 0xda, 0xe3, 0xcf, 0x66, 0xf0, 0x1f, +0x88, 0xaf, 0xf4, 0x28, 0xa4, 0x9b, 0xef, 0xdc, 0x41, 0x6f, 0x3b, 0xc7, 0x0c, 0xdf, 0x49, 0x22, +0x11, 0xc8, 0x3a, 0x70, 0xe3, 0x81, 0xd0, 0x70, 0xa6, 0xbf, 0x4f, 0xbf, 0xe0, 0xea, 0x5f, 0xd8, +0xe7, 0x51, 0xf8, 0x39, 0xfb, 0x78, 0x5a, 0xfc, 0x5c, 0xb4, 0xb3, 0x95, 0xbc, 0x29, 0xf1, 0x83, +0x4f, 0xb7, 0x59, 0xaf, 0x14, 0x16, 0x8e, 0x1d, 0x62, 0xca, 0x05, 0xb7, 0x96, 0x06, 0xec, 0x85, +0xed, 0x62, 0xb5, 0x91, 0x01, 0xc1, 0x90, 0xad, 0xc6, 0x01, 0xf2, 0xdc, 0xd7, 0xe6, 0x08, 0x35, +0x99, 0x12, 0xd1, 0x9f, 0xa3, 0x1f, 0x1e, 0xbf, 0xe0, 0xaf, 0x5a, 0x0f, 0xc5, 0x0f, 0xf8, 0x37, +0xf7, 0xe1, 0xbf, 0xec, 0xe9, 0x0e, 0xa5, 0x79, 0x71, 0xf1, 0x2f, 0x4f, 0xd4, 0xad, 0x34, 0x3f, +0x10, 0xd9, 0xc9, 0x61, 0x34, 0x76, 0xf0, 0x68, 0x3a, 0x6d, 0xcc, 0xb7, 0x16, 0x12, 0x47, 0x70, +0xca, 0x63, 0x72, 0x44, 0x3a, 0x6c, 0x7e, 0x5a, 0xb0, 0x70, 0x63, 0x9b, 0x2a, 0xaa, 0x17, 0x7f, +0xe7, 0x38, 0xe9, 0x46, 0x28, 0x26, 0x80, 0x6e, 0xe7, 0xd2, 0x3f, 0xf0, 0x47, 0xff, 0x00, 0xd9, +0xdf, 0xfe, 0x1a, 0x9b, 0xfe, 0x0a, 0x71, 0xf0, 0x5f, 0xc2, 0x33, 0x43, 0xe7, 0x69, 0xff, 0x00, +0xf0, 0x91, 0xc3, 0xad, 0x6a, 0x4a, 0x53, 0x74, 0x6d, 0x69, 0xa7, 0xab, 0x5f, 0xca, 0x92, 0x70, +0x40, 0x49, 0x05, 0xbf, 0x92, 0x49, 0xc7, 0x33, 0x01, 0x90, 0x48, 0xaf, 0xeb, 0xae, 0xbf, 0x07, +0xff, 0x00, 0xe0, 0xd1, 0x7f, 0xd8, 0xe7, 0x51, 0xbe, 0xf8, 0x8b, 0xf1, 0x0b, 0xe3, 0xe6, 0xa7, +0x66, 0xf0, 0xe8, 0xd6, 0x1a, 0x7b, 0x78, 0x2f, 0xc3, 0xf2, 0x4a, 0x8a, 0x56, 0xf2, 0xe2, 0x59, +0x21, 0xb8, 0xbe, 0x96, 0x3c, 0xf3, 0xfb, 0x95, 0x86, 0xda, 0x20, 0xeb, 0xc3, 0x1b, 0x89, 0xd3, +0x39, 0x47, 0x15, 0xfb, 0xc1, 0x55, 0x12, 0xd6, 0xc1, 0x5f, 0x3a, 0xff, 0x00, 0xc1, 0x5c, 0xff, +0x00, 0xe5, 0x16, 0x5f, 0xb4, 0x6f, 0xfd, 0x93, 0x6f, 0x10, 0x7f, 0xe9, 0xbe, 0x6a, 0xfa, 0x2a, +0xbe, 0x75, 0xff, 0x00, 0x82, 0xb9, 0xff, 0x00, 0xca, 0x2c, 0xbf, 0x68, 0xdf, 0xfb, 0x26, 0xde, +0x20, 0xff, 0x00, 0xd3, 0x7c, 0xd4, 0xd9, 0x51, 0xdc, 0xfe, 0x43, 0x6a, 0x9f, 0x88, 0x3f, 0xe4, +0x03, 0x7d, 0xff, 0x00, 0x5e, 0xf2, 0x7f, 0xe8, 0x26, 0xae, 0x55, 0x3f, 0x10, 0x7f, 0xc8, 0x06, +0xfb, 0xfe, 0xbd, 0xe4, 0xff, 0x00, 0xd0, 0x4d, 0x41, 0x89, 0xfd, 0xbd, 0x78, 0x67, 0xfe, 0x45, +0xcb, 0x1f, 0xfa, 0xf6, 0x8f, 0xff, 0x00, 0x40, 0x15, 0xf8, 0x7f, 0xff, 0x00, 0x07, 0x83, 0x7e, +0xcd, 0x37, 0x36, 0xfa, 0xf7, 0xc1, 0xdf, 0x8c, 0x56, 0x76, 0xfb, 0xec, 0xe5, 0x86, 0xe7, 0xc1, +0x5a, 0xb4, 0xfd, 0xe3, 0x90, 0x33, 0x5e, 0x58, 0xaf, 0xd1, 0x81, 0xd4, 0x32, 0x4e, 0x30, 0x55, +0x47, 0x3b, 0xb8, 0xfd, 0xc0, 0xf0, 0xc7, 0xfc, 0x8b, 0x96, 0x1f, 0xf5, 0xed, 0x1f, 0xfe, 0x80, +0x2b, 0xcc, 0xff, 0x00, 0x6d, 0xff, 0x00, 0xd8, 0xf3, 0xc2, 0xff, 0x00, 0xb7, 0x7f, 0xec, 0xbd, +0xe2, 0xef, 0x85, 0xbe, 0x2e, 0x0e, 0x9a, 0x5f, 0x8a, 0x2c, 0xfc, 0xa8, 0xae, 0xe3, 0x5c, 0xcd, +0xa5, 0xdd, 0xa1, 0x12, 0x5b, 0x5e, 0x45, 0xc8, 0xfd, 0xe4, 0x33, 0x2a, 0x48, 0x01, 0x3b, 0x5b, +0x69, 0x56, 0x05, 0x59, 0x81, 0x7d, 0x0d, 0xa5, 0xab, 0xb1, 0xfc, 0x6e, 0xd7, 0xd6, 0xdf, 0xf0, +0x45, 0xef, 0xf8, 0x29, 0x4c, 0x7f, 0xf0, 0x4c, 0x4f, 0xdb, 0x0d, 0x7c, 0x59, 0xac, 0x58, 0x5d, +0x6a, 0xde, 0x07, 0xf1, 0x46, 0x9c, 0x74, 0x0f, 0x12, 0xdb, 0x5a, 0x8d, 0xd7, 0x10, 0x40, 0xd2, +0xc7, 0x2c, 0x77, 0x90, 0xae, 0x40, 0x79, 0x20, 0x91, 0x3e, 0xe1, 0x3f, 0x34, 0x72, 0xcc, 0x00, +0xdc, 0x54, 0x8f, 0x18, 0xfd, 0xb1, 0xbf, 0x63, 0xbf, 0x1e, 0x7e, 0xc1, 0xdf, 0xb4, 0x06, 0xb3, +0xf0, 0xd7, 0xe2, 0x36, 0x97, 0xfd, 0x9d, 0xaf, 0x69, 0x27, 0xcd, 0xb7, 0xb9, 0x88, 0x31, 0xb2, +0xd6, 0xad, 0x18, 0x91, 0x15, 0xf5, 0xa4, 0x84, 0x0f, 0x32, 0xde, 0x4c, 0x1c, 0x1f, 0xbc, 0x8c, +0xaf, 0x1b, 0x84, 0x92, 0x37, 0x45, 0xf3, 0x0e, 0xb4, 0x8c, 0xb6, 0x67, 0xf6, 0x0d, 0xf0, 0xc3, +0xfe, 0x0a, 0x73, 0xfb, 0x3b, 0xfc, 0x63, 0xf0, 0x8d, 0xbe, 0xb7, 0xa0, 0x7c, 0x6c, 0xf8, 0x5b, +0x79, 0x61, 0x72, 0xaa, 0xc0, 0x4b, 0xe2, 0x4b, 0x5b, 0x5b, 0x88, 0x49, 0x19, 0xd9, 0x2c, 0x13, +0x3a, 0x4b, 0x0c, 0x80, 0x11, 0x94, 0x91, 0x15, 0x86, 0x79, 0x02, 0xba, 0x2f, 0xf8, 0x6e, 0x8f, +0x82, 0x7f, 0xf4, 0x58, 0x3e, 0x16, 0xff, 0x00, 0xe1, 0x59, 0x61, 0xff, 0x00, 0xc7, 0x6b, 0xf8, +0xd4, 0x7b, 0x78, 0xe5, 0x3f, 0x34, 0x68, 0xdf, 0x55, 0xcd, 0x27, 0xd8, 0xe1, 0xff, 0x00, 0x9e, +0x31, 0xff, 0x00, 0xdf, 0x22, 0x8b, 0xb2, 0xf9, 0x91, 0xfd, 0x96, 0x7f, 0xc3, 0x74, 0x7c, 0x14, +0xff, 0x00, 0xa2, 0xc1, 0xf0, 0xb7, 0xff, 0x00, 0x0a, 0xcb, 0x0f, 0xfe, 0x3b, 0x5d, 0x47, 0xc3, +0x2f, 0x8f, 0x3e, 0x08, 0xf8, 0xd5, 0x25, 0xf2, 0x78, 0x3b, 0xc6, 0x3e, 0x14, 0xf1, 0x63, 0x69, +0x62, 0x33, 0x78, 0x34, 0x6d, 0x5e, 0xde, 0xfc, 0xda, 0x09, 0x37, 0xf9, 0x66, 0x4f, 0x29, 0xdb, +0x66, 0xef, 0x2d, 0xf6, 0xee, 0xc6, 0xed, 0x8d, 0x8c, 0xe0, 0xe3, 0xf8, 0xaa, 0x36, 0x70, 0xe3, +0xfd, 0x54, 0x7f, 0xf7, 0xc8, 0xaf, 0xe8, 0xe7, 0xfe, 0x0d, 0x33, 0xfd, 0x9a, 0x13, 0xe1, 0x47, +0xfc, 0x13, 0xc7, 0x5a, 0xf8, 0x81, 0x71, 0x6d, 0x0c, 0x7a, 0x87, 0xc5, 0x8f, 0x12, 0xdc, 0xdd, +0x41, 0x2a, 0xa0, 0x57, 0x3a, 0x7d, 0x89, 0x36, 0x50, 0xa3, 0x0e, 0xbc, 0x5c, 0x47, 0x7c, 0xe0, +0x9c, 0x64, 0x4c, 0x38, 0xc7, 0x25, 0xa6, 0xc3, 0x99, 0x33, 0xe2, 0x3f, 0xf8, 0x3b, 0x63, 0xf6, +0x6f, 0xbb, 0xf0, 0x0f, 0xed, 0xbb, 0xe0, 0xbf, 0x89, 0xd0, 0x5b, 0xb0, 0xd1, 0x3e, 0x23, 0x78, +0x65, 0x74, 0xe9, 0x65, 0x00, 0xb0, 0x1a, 0x8e, 0x9d, 0x2b, 0x09, 0x03, 0x1f, 0xe1, 0xdd, 0x6d, +0x71, 0x69, 0xb4, 0x1f, 0xbd, 0xe4, 0xca, 0x47, 0x43, 0x8f, 0xca, 0x7e, 0xa2, 0xbf, 0xae, 0xef, +0xf8, 0x2a, 0x97, 0xfc, 0x13, 0xfb, 0x45, 0xff, 0x00, 0x82, 0x94, 0xfe, 0xc7, 0xba, 0xe7, 0xc3, +0x6d, 0x4a, 0x78, 0xf4, 0xfd, 0x60, 0xc8, 0xba, 0xaf, 0x86, 0xb5, 0x47, 0x52, 0xc3, 0x48, 0xd5, +0xa1, 0x57, 0x58, 0x67, 0x60, 0x33, 0x98, 0xd9, 0x64, 0x92, 0x29, 0x00, 0x19, 0x31, 0x4f, 0x28, +0x5c, 0x36, 0xd6, 0x1f, 0xc9, 0xe7, 0xc7, 0x3f, 0x81, 0x9e, 0x2e, 0xfd, 0x99, 0x7e, 0x2e, 0x6b, +0x9e, 0x03, 0xf1, 0xe6, 0x85, 0x79, 0xe1, 0xbf, 0x16, 0x78, 0x6e, 0xe0, 0xdb, 0x5f, 0xd8, 0x5c, +0xaf, 0x2a, 0x7f, 0x86, 0x44, 0x6e, 0x92, 0x42, 0xeb, 0x87, 0x49, 0x57, 0x29, 0x22, 0x32, 0xb2, +0x92, 0x0d, 0x26, 0x4c, 0xbb, 0x9f, 0x65, 0xff, 0x00, 0xc1, 0x02, 0x3f, 0xe0, 0xab, 0xda, 0x3f, +0xfc, 0x13, 0x3b, 0xf6, 0x84, 0xd7, 0xf4, 0xff, 0x00, 0x1d, 0x2d, 0xd1, 0xf8, 0x63, 0xf1, 0x22, +0x1b, 0x6b, 0x7d, 0x5e, 0xee, 0xda, 0x17, 0xb8, 0x9b, 0x42, 0xba, 0xb7, 0x69, 0x3e, 0xcf, 0x7a, +0x22, 0x5c, 0xb3, 0xc5, 0xb6, 0x69, 0x92, 0x54, 0x8d, 0x4c, 0x84, 0x34, 0x6c, 0xa1, 0x8c, 0x7b, +0x1f, 0xfa, 0x1f, 0xf0, 0x97, 0xfc, 0x14, 0x57, 0xe0, 0x1f, 0x8e, 0xf4, 0x1b, 0x7d, 0x53, 0x49, +0xf8, 0xd9, 0xf0, 0x9a, 0xfa, 0xc2, 0xe8, 0x6e, 0x8e, 0x68, 0xfc, 0x5b, 0x61, 0xf8, 0xa9, 0x06, +0x5c, 0xab, 0x0e, 0x85, 0x58, 0x06, 0x53, 0xc1, 0x00, 0xf1, 0x5f, 0xc7, 0x57, 0x5a, 0x63, 0xdb, +0x47, 0x23, 0x65, 0xa3, 0x46, 0x3e, 0xa5, 0x68, 0xd4, 0x14, 0xbb, 0x9f, 0xd9, 0x5f, 0xfc, 0x37, +0x47, 0xc1, 0x4f, 0xfa, 0x2c, 0x1f, 0x0b, 0x7f, 0xf0, 0xac, 0xb0, 0xff, 0x00, 0xe3, 0xb4, 0x7f, +0xc3, 0x74, 0x7c, 0x14, 0xff, 0x00, 0xa2, 0xc1, 0xf0, 0xb7, 0xff, 0x00, 0x0a, 0xcb, 0x0f, 0xfe, +0x3b, 0x5f, 0xc6, 0x9f, 0xd8, 0xe1, 0xff, 0x00, 0x9e, 0x31, 0xff, 0x00, 0xdf, 0x22, 0x8f, 0xb1, +0xc3, 0xff, 0x00, 0x3c, 0x63, 0xff, 0x00, 0xbe, 0x45, 0x17, 0x65, 0x73, 0x2e, 0xc7, 0xf6, 0x59, +0xff, 0x00, 0x0d, 0xd1, 0xf0, 0x4f, 0xfe, 0x8b, 0x07, 0xc2, 0xdf, 0xfc, 0x2b, 0x2c, 0x3f, 0xf8, +0xed, 0x77, 0x1f, 0x0f, 0xfe, 0x25, 0x78, 0x7f, 0xe2, 0xbf, 0x87, 0x97, 0x58, 0xf0, 0xc6, 0xb9, +0xa2, 0xf8, 0x8f, 0x49, 0x91, 0xda, 0x34, 0xbe, 0xd2, 0xaf, 0xa2, 0xbd, 0xb6, 0x77, 0x53, 0x86, +0x51, 0x24, 0x6c, 0x57, 0x2a, 0x78, 0x23, 0x3c, 0x57, 0xf1, 0x2f, 0x75, 0x1d, 0xbd, 0xa5, 0xb4, +0x92, 0xc9, 0x1c, 0x4a, 0x91, 0xa9, 0x76, 0x3b, 0x47, 0x00, 0x72, 0x6b, 0xfa, 0xfc, 0xff, 0x00, +0x82, 0x51, 0xfe, 0xcc, 0x72, 0x7e, 0xc7, 0x5f, 0xf0, 0x4e, 0x6f, 0x84, 0x3f, 0x0f, 0x6e, 0xed, +0x5a, 0xcb, 0x54, 0xd1, 0x7c, 0x3d, 0x0d, 0xce, 0xaf, 0x6e, 0xd9, 0xcc, 0x3a, 0x95, 0xdb, 0x35, +0xe5, 0xea, 0xf3, 0x83, 0x81, 0x75, 0x71, 0x30, 0xed, 0xc0, 0x1c, 0x0e, 0x94, 0xd3, 0x60, 0x9a, +0x67, 0xd1, 0x15, 0xe2, 0xbf, 0xb6, 0xbf, 0xfc, 0x13, 0xfb, 0xe1, 0x4f, 0xfc, 0x14, 0x17, 0xe1, +0x9a, 0x78, 0x5b, 0xe2, 0x9f, 0x85, 0xed, 0x75, 0xeb, 0x5b, 0x53, 0x23, 0xe9, 0xb7, 0xc8, 0xe6, +0xdf, 0x52, 0xd1, 0x65, 0x70, 0x01, 0x96, 0xd6, 0xe1, 0x08, 0x78, 0xc9, 0x2a, 0x9b, 0x97, 0x25, +0x24, 0x08, 0x16, 0x44, 0x75, 0xf9, 0x6b, 0xda, 0xa8, 0xab, 0x03, 0xf9, 0xff, 0x00, 0xfd, 0xaa, +0xff, 0x00, 0xe0, 0xd1, 0x6f, 0x88, 0xfe, 0x14, 0xd6, 0x2e, 0xaf, 0x7e, 0x0b, 0xfc, 0x44, 0xf0, +0xe7, 0x8c, 0xb4, 0x5c, 0xb3, 0xc5, 0xa6, 0xf8, 0xab, 0x7e, 0x95, 0xaa, 0xc0, 0x99, 0xf9, 0x63, +0x13, 0xc3, 0x1c, 0x96, 0xf7, 0x0f, 0xd0, 0x96, 0x2b, 0x6c, 0xbd, 0x7e, 0x5e, 0x39, 0xf9, 0x66, +0xf7, 0xfe, 0x0d, 0xd2, 0xfd, 0xb4, 0xed, 0x6f, 0x25, 0x8a, 0x3f, 0x81, 0xf3, 0xdd, 0x2c, 0x6c, +0x54, 0x4b, 0x0f, 0x8b, 0xfc, 0x3f, 0xb2, 0x41, 0xea, 0x37, 0x5f, 0xab, 0x63, 0xea, 0x01, 0xf6, +0x15, 0xfd, 0x53, 0x51, 0x53, 0xca, 0x16, 0x47, 0xf2, 0xa7, 0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, +0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, 0x2c, 0x28, 0xff, 0x00, 0x88, +0x76, 0x7f, 0x6d, 0x6f, 0xfa, 0x20, 0xf7, 0xdf, 0xf8, 0x57, 0xf8, 0x77, 0xff, 0x00, 0x96, 0x15, +0xfd, 0x56, 0x51, 0x47, 0x29, 0x3c, 0xa7, 0xf2, 0xa7, 0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, +0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, 0x2c, 0x28, 0x3f, 0xf0, 0x6e, 0xcf, +0xed, 0xac, 0x7f, 0xe6, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x57, 0xf5, 0x59, +0x45, 0x1c, 0xa1, 0xca, 0x7c, 0x47, 0xff, 0x00, 0x06, 0xfe, 0xfe, 0xca, 0x1f, 0x11, 0x3f, 0x62, +0xff, 0x00, 0xf8, 0x27, 0x65, 0x8f, 0x81, 0xfe, 0x28, 0x78, 0x6a, 0x4f, 0x09, 0xf8, 0xae, 0x1d, +0x7f, 0x53, 0xbe, 0x7b, 0x07, 0xbf, 0xb4, 0xbe, 0x2b, 0x0c, 0xd2, 0x86, 0x8d, 0xbc, 0xcb, 0x59, +0x65, 0x8b, 0x91, 0xd8, 0x3e, 0x46, 0x39, 0x02, 0xba, 0x6f, 0xf8, 0x2e, 0x4f, 0xec, 0xd7, 0xe3, +0x6f, 0xda, 0xef, 0xfe, 0x09, 0x75, 0xf1, 0x2b, 0xe1, 0xef, 0xc3, 0x7d, 0x0d, 0xbc, 0x4d, 0xe3, +0x2d, 0x7a, 0x6d, 0x1a, 0x4d, 0x3f, 0x4d, 0x5b, 0xcb, 0x7b, 0x33, 0x72, 0x2d, 0xf5, 0xab, 0x0b, +0xa9, 0xbf, 0x7b, 0x71, 0x24, 0x71, 0x2e, 0xd8, 0x61, 0x91, 0xbe, 0x67, 0x19, 0xdb, 0x81, 0x92, +0x40, 0x3f, 0x5b, 0x51, 0x4e, 0xc5, 0x74, 0xb1, 0xfc, 0xa9, 0xff, 0x00, 0xc4, 0x3b, 0x3f, 0xb6, +0xb7, 0xfd, 0x10, 0x7b, 0xef, 0xfc, 0x2b, 0xfc, 0x3b, 0xff, 0x00, 0xcb, 0x0a, 0xe9, 0x7e, 0x0b, +0xff, 0x00, 0xc1, 0xbe, 0xbf, 0xb6, 0x57, 0x85, 0xbe, 0x33, 0xf8, 0x37, 0x54, 0xd4, 0x7e, 0x07, +0xde, 0x5a, 0xe9, 0xfa, 0x5e, 0xbf, 0xa7, 0xde, 0xdd, 0x4c, 0x7c, 0x59, 0xe1, 0xf7, 0xf2, 0xa1, +0x8a, 0xe6, 0x39, 0x1d, 0xb6, 0xad, 0xf9, 0x63, 0x85, 0x52, 0x70, 0xa0, 0x93, 0x8e, 0x01, 0xaf, +0xea, 0x1e, 0x8a, 0x5c, 0xa4, 0xf2, 0x85, 0x14, 0x51, 0x54, 0x51, 0xf2, 0x7f, 0xfc, 0x14, 0x97, +0xfe, 0x08, 0xe1, 0xf0, 0x87, 0xfe, 0x0a, 0x73, 0xe1, 0xf8, 0x66, 0xf1, 0x8d, 0x8d, 0xce, 0x85, +0xe3, 0x8d, 0x32, 0xdb, 0xec, 0xda, 0x5f, 0x8b, 0xb4, 0x60, 0x90, 0xea, 0x76, 0xa8, 0x0e, 0xe5, +0x86, 0x6d, 0xc0, 0xa5, 0xcd, 0xb8, 0x62, 0x4f, 0x95, 0x28, 0x3b, 0x37, 0xc8, 0x63, 0x68, 0x99, +0xcb, 0xd7, 0xe3, 0x2f, 0xed, 0x1f, 0xff, 0x00, 0x06, 0xa8, 0x7e, 0xd2, 0x1f, 0x0a, 0x35, 0x1b, +0xa9, 0x3c, 0x05, 0x7f, 0xe0, 0xbf, 0x8b, 0x1a, 0x3a, 0x93, 0xf6, 0x53, 0x6b, 0x7e, 0x34, 0x4d, +0x52, 0x50, 0x31, 0xfe, 0xb2, 0xde, 0xec, 0x88, 0x10, 0x9e, 0xdb, 0x6e, 0x9f, 0xa1, 0xc9, 0x1c, +0x67, 0xfa, 0x4a, 0xa2, 0xa7, 0x94, 0x34, 0xea, 0x7f, 0x2a, 0x7f, 0xf1, 0x0e, 0xcf, 0xed, 0xad, +0xff, 0x00, 0x44, 0x1e, 0xfb, 0xff, 0x00, 0x0a, 0xff, 0x00, 0x0e, 0xff, 0x00, 0xf2, 0xc2, 0x8f, +0xf8, 0x87, 0x67, 0xf6, 0xd6, 0xff, 0x00, 0xa2, 0x0f, 0x7d, 0xff, 0x00, 0x85, 0x7f, 0x87, 0x7f, +0xf9, 0x61, 0x5f, 0xd5, 0x65, 0x14, 0x72, 0x93, 0xca, 0x7f, 0x1a, 0x7f, 0xb5, 0x8f, 0xec, 0x59, +0xf1, 0x4b, 0xf6, 0x17, 0xf8, 0x81, 0xa7, 0xf8, 0x57, 0xe2, 0xd7, 0x84, 0x65, 0xf0, 0x6f, 0x88, +0x35, 0x4d, 0x3d, 0x75, 0x5b, 0x5b, 0x39, 0x35, 0x2b, 0x2b, 0xf3, 0x35, 0xab, 0x4b, 0x24, 0x4b, +0x2e, 0xfb, 0x49, 0xa6, 0x41, 0x97, 0x8a, 0x41, 0xb5, 0x98, 0x37, 0xcb, 0x9c, 0x60, 0x82, 0x7c, +0xbe, 0xbf, 0x48, 0xbf, 0xe0, 0xea, 0x0f, 0x8e, 0x1a, 0x1f, 0xc5, 0xcf, 0xf8, 0x2a, 0x05, 0xbe, +0x93, 0xa1, 0xde, 0x43, 0x7c, 0xdf, 0x0f, 0xbc, 0x1d, 0x63, 0xa0, 0x6a, 0xcd, 0x18, 0x27, 0xc8, +0xd4, 0x1a, 0xe2, 0xee, 0xee, 0x48, 0x77, 0x67, 0x0d, 0xb2, 0x1b, 0x9b, 0x6c, 0xe3, 0xee, 0xbb, +0x3a, 0x9e, 0x54, 0x81, 0xf9, 0xbb, 0x52, 0x27, 0xb9, 0xfa, 0xf5, 0xff, 0x00, 0x06, 0x7c, 0x7f, +0xc9, 0xd6, 0x7c, 0x66, 0xff, 0x00, 0xb1, 0x4a, 0xcb, 0xff, 0x00, 0x4b, 0x1a, 0xbf, 0xa0, 0x2a, +0xfc, 0x19, 0xff, 0x00, 0x83, 0x3a, 0xfe, 0x1f, 0xdd, 0xde, 0xfc, 0x5c, 0xf8, 0xef, 0xe2, 0xac, +0x14, 0xb1, 0xd3, 0xf4, 0x7d, 0x1f, 0x48, 0x04, 0xc6, 0x71, 0x34, 0xb3, 0xcf, 0x75, 0x29, 0x0a, +0xdd, 0x3e, 0x45, 0xb7, 0x5d, 0xc3, 0xaf, 0xef, 0x50, 0xfd, 0x7f, 0x79, 0xaa, 0xa2, 0x5a, 0xd8, +0xcb, 0xf1, 0x97, 0x83, 0x34, 0xaf, 0x88, 0x7e, 0x18, 0xd4, 0x34, 0x3d, 0x7b, 0x4d, 0xd3, 0xb5, +0xad, 0x0f, 0x57, 0xb6, 0x92, 0xce, 0xff, 0x00, 0x4e, 0xbf, 0xb6, 0x4b, 0xab, 0x4b, 0xe8, 0x24, +0x52, 0xaf, 0x14, 0xb1, 0x38, 0x29, 0x24, 0x6c, 0xa4, 0xab, 0x2b, 0x02, 0x08, 0x24, 0x11, 0x5f, +0x8e, 0xdf, 0xb7, 0xa7, 0xfc, 0x1a, 0x51, 0xa0, 0xf8, 0xcf, 0x5e, 0xbc, 0xf1, 0x07, 0xec, 0xf7, +0xe3, 0x2b, 0x5f, 0x05, 0xc9, 0x74, 0xc6, 0x43, 0xe1, 0x4f, 0x13, 0x19, 0xae, 0x34, 0xa8, 0xdc, +0x91, 0xff, 0x00, 0x1e, 0xf7, 0xa8, 0x1e, 0xe2, 0x08, 0xff, 0x00, 0xd8, 0x92, 0x3b, 0x8e, 0x4f, +0x0c, 0x8a, 0x02, 0xd7, 0xec, 0xed, 0x14, 0xec, 0x1e, 0xa7, 0xf2, 0xcf, 0xe2, 0xff, 0x00, 0xf8, +0x36, 0xe7, 0xf6, 0xcc, 0xf0, 0xbe, 0xb9, 0x25, 0x9d, 0xa7, 0xc2, 0x5b, 0x3f, 0x11, 0xc3, 0x1f, +0x4b, 0xed, 0x2f, 0xc5, 0xba, 0x32, 0xdb, 0x49, 0xfe, 0xe8, 0xb9, 0xba, 0x86, 0x5f, 0xce, 0x31, +0x59, 0x7f, 0xf1, 0x0e, 0xcf, 0xed, 0xad, 0xff, 0x00, 0x44, 0x1e, 0xfb, 0xff, 0x00, 0x0a, 0xff, +0x00, 0x0e, 0xff, 0x00, 0xf2, 0xc2, 0xbf, 0xaa, 0xca, 0x29, 0x72, 0x8b, 0x95, 0x1f, 0xca, 0x9f, +0xfc, 0x43, 0xb3, 0xfb, 0x6b, 0x7f, 0xd1, 0x07, 0xbe, 0xff, 0x00, 0xc2, 0xbf, 0xc3, 0xbf, 0xfc, +0xb0, 0xa3, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, +0xfe, 0x58, 0x57, 0xf5, 0x59, 0x45, 0x1c, 0xa2, 0xe5, 0x3f, 0x95, 0x1b, 0x8f, 0xf8, 0x37, 0x5b, +0xf6, 0xd7, 0x96, 0xde, 0x45, 0x1f, 0x01, 0xef, 0xb2, 0xca, 0x40, 0xff, 0x00, 0x8a, 0xbf, 0xc3, +0xbf, 0xfc, 0xb0, 0xaf, 0xe9, 0xb3, 0xf6, 0x4d, 0xf0, 0x66, 0xa9, 0xf0, 0xe3, 0xf6, 0x5e, 0xf8, +0x6f, 0xe1, 0xdd, 0x6e, 0xd7, 0xec, 0x3a, 0xd6, 0x83, 0xe1, 0x5d, 0x2f, 0x4d, 0xbf, 0xb6, 0x32, +0x24, 0x9f, 0x67, 0xb8, 0x86, 0xd2, 0x28, 0xe4, 0x4d, 0xe8, 0x59, 0x1b, 0x6b, 0xab, 0x0c, 0xa9, +0x2a, 0x71, 0xc1, 0x23, 0x9a, 0xf4, 0x2a, 0x28, 0xe5, 0x29, 0x68, 0x7c, 0x47, 0xff, 0x00, 0x07, +0x01, 0x7e, 0xca, 0x1f, 0x10, 0xff, 0x00, 0x6d, 0x0f, 0xf8, 0x27, 0x65, 0xf7, 0x81, 0xfe, 0x17, +0xf8, 0x6a, 0x4f, 0x16, 0x78, 0xaa, 0x6d, 0x7f, 0x4c, 0xbe, 0x8f, 0x4f, 0x4b, 0xfb, 0x4b, 0x12, +0xd0, 0xc3, 0x29, 0x69, 0x1b, 0xcc, 0xba, 0x96, 0x28, 0xb8, 0x1d, 0x8b, 0xe4, 0xe7, 0x80, 0x6b, +0xf0, 0xbc, 0x7f, 0xc1, 0xbb, 0x3f, 0xb6, 0xb0, 0xff, 0x00, 0x9a, 0x0f, 0x7d, 0xff, 0x00, 0x85, +0x7f, 0x87, 0x7f, 0xf9, 0x61, 0x5f, 0xd5, 0x65, 0x14, 0x72, 0x85, 0x8f, 0xe5, 0x4f, 0xfe, 0x21, +0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, 0xff, +0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, +0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x52, 0x79, 0x4f, 0xe5, 0x4f, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, +0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x54, 0xb6, 0x5f, 0xf0, 0x6e, +0x97, 0xed, 0xa7, 0x75, 0x77, 0x1c, 0x52, 0x7c, 0x0f, 0x9e, 0xd5, 0x64, 0x60, 0xa6, 0x69, 0xbc, +0x5f, 0xe1, 0xfd, 0x91, 0xfb, 0x9d, 0xb7, 0xec, 0xd8, 0xfa, 0x02, 0x7d, 0x8d, 0x7f, 0x54, 0xf4, +0x51, 0xca, 0x1c, 0xa7, 0xf3, 0xfb, 0xfb, 0x29, 0xff, 0x00, 0xc1, 0xa2, 0xff, 0x00, 0x12, 0x3c, +0x5d, 0xac, 0xda, 0xde, 0x7c, 0x66, 0xf8, 0x89, 0xe1, 0xbf, 0x06, 0xe8, 0x79, 0x57, 0x97, 0x4e, +0xf0, 0xae, 0xfd, 0x57, 0x55, 0x9d, 0x33, 0x86, 0x8c, 0xcd, 0x34, 0x71, 0xdb, 0xdb, 0xbf, 0x70, +0xe1, 0x6e, 0x57, 0xd5, 0x79, 0xe3, 0xf6, 0x53, 0xf6, 0x28, 0xff, 0x00, 0x82, 0x79, 0x7c, 0x27, +0xff, 0x00, 0x82, 0x79, 0xfc, 0x36, 0x93, 0xc3, 0x5f, 0x0b, 0x3c, 0x31, 0x6f, 0xa1, 0xc5, 0x7c, +0x23, 0x6d, 0x53, 0x51, 0x99, 0x8d, 0xce, 0xa7, 0xad, 0xca, 0x80, 0x85, 0x92, 0xea, 0xe1, 0xbe, +0x79, 0x08, 0x2c, 0xe5, 0x50, 0x62, 0x38, 0xfc, 0xc7, 0x11, 0xa2, 0x03, 0x8a, 0xf6, 0xea, 0x28, +0xe5, 0x29, 0x68, 0x14, 0x51, 0x45, 0x50, 0x05, 0x7c, 0x67, 0xff, 0x00, 0x05, 0x2f, 0xff, 0x00, +0x82, 0x20, 0xfc, 0x1b, 0xff, 0x00, 0x82, 0x98, 0x5a, 0x36, 0xb1, 0xae, 0x5a, 0xcf, 0xe1, 0x0f, +0x88, 0xf0, 0xc4, 0x21, 0xb6, 0xf1, 0x86, 0x8b, 0x1a, 0xad, 0xe4, 0xaa, 0xab, 0x84, 0x8a, 0xf2, +0x26, 0xf9, 0x2e, 0xe2, 0x18, 0x5c, 0x07, 0xc4, 0x88, 0xab, 0xb6, 0x39, 0x63, 0x04, 0xe7, 0xec, +0xca, 0x28, 0xb0, 0x1f, 0xcd, 0x57, 0xed, 0x0d, 0xff, 0x00, 0x06, 0xae, 0xfe, 0xd3, 0x7f, 0x09, +0xf5, 0x4b, 0xa3, 0xe0, 0x96, 0xf0, 0x5f, 0xc5, 0x8d, 0x25, 0x5c, 0x8b, 0x59, 0x34, 0xed, 0x51, +0x34, 0x7d, 0x42, 0x64, 0xe3, 0x06, 0x4b, 0x7b, 0xd2, 0x90, 0xc4, 0xc7, 0x9f, 0x95, 0x6e, 0x64, +0x03, 0x1f, 0x7a, 0xbc, 0xa3, 0xfe, 0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, +0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x57, 0xf5, 0x59, 0x45, 0x4f, 0x28, 0xac, 0x8f, 0xe5, 0x4f, 0xfe, +0x21, 0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, +0xff, 0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, +0x00, 0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x51, 0x72, 0x9f, 0xcf, 0x5f, 0xfc, 0x11, 0xeb, 0xfe, +0x08, 0x27, 0xfb, 0x42, 0x7c, 0x26, 0xff, 0x00, 0x82, 0x8b, 0x7c, 0x39, 0xf1, 0xb7, 0xc6, 0x3f, +0x85, 0xe7, 0xc2, 0xbe, 0x06, 0xf0, 0x3d, 0xcc, 0xda, 0xec, 0xb7, 0x37, 0x1a, 0xf6, 0x91, 0x7d, +0xe7, 0xde, 0x43, 0x03, 0xfd, 0x8e, 0x35, 0x8e, 0xd6, 0xee, 0x59, 0x03, 0x2d, 0xcb, 0x43, 0x2e, +0xe2, 0x9b, 0x40, 0x84, 0x8c, 0x82, 0x45, 0x7f, 0x42, 0x94, 0x51, 0x4d, 0x2b, 0x14, 0x14, 0x51, +0x45, 0x30, 0x3c, 0xcf, 0xf6, 0xb8, 0xfd, 0x91, 0xfc, 0x0b, 0xfb, 0x6f, 0x7c, 0x0b, 0xd6, 0x3e, +0x1d, 0xfc, 0x44, 0xd1, 0xd3, 0x58, 0xf0, 0xd6, 0xb0, 0xaa, 0x59, 0x43, 0x18, 0xee, 0x2c, 0xe6, +0x43, 0x98, 0xae, 0x60, 0x94, 0x7c, 0xd1, 0x4d, 0x1b, 0x72, 0xac, 0x3d, 0xd4, 0x86, 0x56, 0x65, +0x3f, 0x82, 0x7f, 0xb6, 0x0f, 0xfc, 0x1a, 0x9f, 0xf1, 0xd7, 0xe1, 0x1f, 0x89, 0xaf, 0x2e, 0x3e, +0x10, 0xea, 0x3a, 0x17, 0xc5, 0xbf, 0x0b, 0xbb, 0x96, 0xb2, 0xb7, 0x9e, 0xf6, 0x0d, 0x1b, 0x5e, +0x89, 0x49, 0x38, 0x49, 0x92, 0x76, 0x4b, 0x57, 0x2a, 0xb8, 0x1e, 0x6a, 0x4c, 0x9b, 0xc8, 0x63, +0xe5, 0x47, 0x90, 0xb5, 0xfd, 0x1c, 0x51, 0x4b, 0x94, 0x3d, 0x4f, 0xe5, 0x4c, 0xff, 0x00, 0xc1, +0xbb, 0x5f, 0xb6, 0xb0, 0xff, 0x00, 0x9a, 0x0f, 0x7d, 0xff, 0x00, 0x85, 0x7f, 0x87, 0x7f, 0xf9, +0x61, 0x5f, 0x4e, 0x7e, 0xc4, 0x3f, 0xf0, 0x69, 0xef, 0xc4, 0xdf, 0x88, 0x3e, 0x26, 0xb2, 0xd5, +0x3e, 0x3d, 0x78, 0x83, 0x4a, 0xf8, 0x7f, 0xe1, 0x78, 0xc8, 0x92, 0xe3, 0x43, 0xd0, 0xef, 0x13, +0x52, 0xd7, 0x6f, 0x31, 0xd6, 0x16, 0x99, 0x41, 0xb5, 0xb5, 0x1c, 0xff, 0x00, 0xad, 0x47, 0xb8, +0x6e, 0x19, 0x42, 0x2e, 0x44, 0x83, 0xfa, 0x10, 0xa2, 0x97, 0x28, 0x24, 0x8e, 0x57, 0xe0, 0x9f, +0xc1, 0x4f, 0x0b, 0x7e, 0xce, 0x7f, 0x0a, 0xb4, 0x3f, 0x03, 0xf8, 0x27, 0x45, 0xb1, 0xf0, 0xef, +0x85, 0x3c, 0x35, 0x68, 0xb6, 0x5a, 0x6e, 0x9d, 0x68, 0xa4, 0x47, 0x6d, 0x1a, 0xe4, 0xf5, 0x24, +0xb3, 0xbb, 0x31, 0x2c, 0xce, 0xe4, 0xbb, 0xb3, 0x33, 0x33, 0x33, 0x31, 0x27, 0xaa, 0xa2, 0x8a, +0xa0, 0x0a, 0xf1, 0x5f, 0xf8, 0x28, 0xdf, 0xc2, 0xdf, 0x10, 0x7c, 0x72, 0xfd, 0x81, 0x7e, 0x34, +0xf8, 0x27, 0xc2, 0xba, 0x7f, 0xf6, 0xb7, 0x8a, 0x3c, 0x5d, 0xe0, 0x8d, 0x63, 0x47, 0xd2, 0x6c, +0x84, 0xf1, 0x41, 0xf6, 0xbb, 0xb9, 0xec, 0xe4, 0x8e, 0x18, 0xfc, 0xc9, 0x59, 0x63, 0x4d, 0xce, +0xca, 0x37, 0x3b, 0x2a, 0x8c, 0xe4, 0x90, 0x39, 0xaf, 0x6a, 0xa2, 0x81, 0xa7, 0x63, 0xf9, 0x53, +0xff, 0x00, 0x88, 0x76, 0x7f, 0x6d, 0x6f, 0xfa, 0x20, 0xf7, 0xdf, 0xf8, 0x57, 0xf8, 0x77, 0xff, +0x00, 0x96, 0x15, 0x06, 0xa9, 0xff, 0x00, 0x06, 0xe8, 0x7e, 0xdb, 0x17, 0xba, 0x65, 0xc4, 0x2b, +0xf0, 0x22, 0xf3, 0x74, 0xd1, 0x32, 0x0c, 0xf8, 0xbf, 0xc3, 0xb8, 0xc9, 0x04, 0x7f, 0xd0, 0x42, +0xbf, 0xab, 0x3a, 0x2a, 0x79, 0x48, 0xe5, 0x28, 0xf8, 0x7e, 0x17, 0xb7, 0xd1, 0xac, 0xe1, 0x91, +0x76, 0xc9, 0x14, 0x08, 0x8e, 0xb9, 0x07, 0x04, 0x28, 0x04, 0x71, 0xc7, 0xe5, 0x57, 0xa8, 0xa2, +0xa9, 0x68, 0x56, 0xe7, 0x88, 0x7e, 0xdc, 0x9f, 0xf0, 0x4f, 0x5f, 0x85, 0x7f, 0xf0, 0x50, 0xff, +0x00, 0x85, 0x4b, 0xe1, 0x3f, 0x8a, 0x1e, 0x1d, 0x8f, 0x56, 0x8a, 0xcf, 0xcc, 0x7d, 0x2f, 0x53, +0xb7, 0x7f, 0xb3, 0xea, 0x9a, 0x14, 0xce, 0xa0, 0x19, 0xad, 0x67, 0x1c, 0xa1, 0xf9, 0x50, 0xb2, +0x30, 0x68, 0xe4, 0xd8, 0xa2, 0x44, 0x91, 0x46, 0xda, 0xfc, 0x54, 0xfd, 0xaa, 0x3f, 0xe0, 0xd2, +0x9f, 0x8c, 0x1f, 0x0f, 0xb5, 0x7b, 0x9b, 0xaf, 0x84, 0x5e, 0x34, 0xf0, 0xaf, 0xc4, 0x6d, 0x0b, +0x2e, 0xf0, 0xd9, 0x6b, 0x0e, 0x74, 0x5d, 0x62, 0x21, 0x9f, 0x96, 0x3e, 0x8f, 0x6d, 0x31, 0x03, +0xac, 0x86, 0x48, 0x32, 0x7a, 0x46, 0x07, 0x4f, 0xe8, 0x6a, 0x8a, 0x9e, 0x50, 0xdf, 0x73, 0xf9, +0x55, 0x7f, 0xf8, 0x37, 0x67, 0xf6, 0xd4, 0x59, 0x19, 0x57, 0xe0, 0x55, 0xe3, 0xed, 0x38, 0xdc, +0xbe, 0x2f, 0xf0, 0xee, 0x0f, 0xbf, 0x3a, 0x86, 0x7f, 0x3a, 0x6f, 0xfc, 0x43, 0xb3, 0xfb, 0x6b, +0x7f, 0xd1, 0x07, 0xbe, 0xff, 0x00, 0xc2, 0xbf, 0xc3, 0xbf, 0xfc, 0xb0, 0xaf, 0xea, 0xb2, 0x8a, +0x39, 0x49, 0xe5, 0x3f, 0x95, 0x19, 0x7f, 0xe0, 0xdd, 0xaf, 0xdb, 0x63, 0xca, 0x6d, 0xbf, 0x01, +0xef, 0x0b, 0x60, 0xed, 0x07, 0xc5, 0xfe, 0x1d, 0xc1, 0x3f, 0xf8, 0x30, 0xaf, 0xe9, 0x8b, 0xf6, +0x35, 0xfd, 0x9f, 0x2d, 0x7f, 0x64, 0xff, 0x00, 0xd9, 0x53, 0xe1, 0xdf, 0xc3, 0x4b, 0x39, 0x23, +0xb8, 0x8f, 0xc0, 0xde, 0x1d, 0xb1, 0xd1, 0xa4, 0xb8, 0x8c, 0x60, 0x5d, 0xcd, 0x0c, 0x2a, 0x92, +0xcd, 0xd0, 0x73, 0x24, 0x81, 0xe4, 0x27, 0x03, 0x25, 0xc9, 0xc0, 0xe9, 0x5e, 0x99, 0x45, 0x1c, +0xa5, 0x2d, 0x02, 0xbe, 0x6b, 0xff, 0x00, 0x82, 0x85, 0x7f, 0xc1, 0x29, 0xfe, 0x10, 0xff, 0x00, +0xc1, 0x4b, 0x3c, 0x11, 0x0e, 0x9d, 0xf1, 0x13, 0x45, 0x96, 0x3d, 0x7b, 0x4d, 0x88, 0xc7, 0xa4, +0x78, 0x9f, 0x4b, 0x75, 0xb6, 0xd6, 0xb4, 0x80, 0x49, 0x25, 0x63, 0x94, 0x86, 0x59, 0x22, 0x24, +0x92, 0x61, 0x99, 0x64, 0x88, 0x93, 0xbb, 0x68, 0x60, 0xac, 0xbf, 0x4a, 0x51, 0x4d, 0xab, 0x81, +0xfc, 0xe4, 0x7e, 0xd2, 0xff, 0x00, 0xf0, 0x69, 0xf7, 0xc7, 0xdf, 0x86, 0x1a, 0x9d, 0xd4, 0xff, +0x00, 0x0d, 0x7c, 0x45, 0xe0, 0xbf, 0x8a, 0x9a, 0x22, 0x8c, 0xc0, 0x92, 0x4e, 0x74, 0x1d, 0x5d, +0x8e, 0x32, 0x55, 0xa0, 0x9c, 0xb5, 0xbf, 0x1f, 0x77, 0x77, 0xda, 0x46, 0xe3, 0xce, 0xd4, 0xe8, +0x3c, 0x28, 0x7f, 0xc1, 0xbb, 0x5f, 0xb6, 0xb1, 0x1f, 0xf2, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, +0xef, 0xff, 0x00, 0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x97, 0x28, 0xac, 0x8f, 0xe5, 0x4f, 0xfe, 0x21, +0xd9, 0xfd, 0xb5, 0xbf, 0xe8, 0x83, 0xdf, 0x7f, 0xe1, 0x5f, 0xe1, 0xdf, 0xfe, 0x58, 0x51, 0xff, +0x00, 0x10, 0xec, 0xfe, 0xda, 0xdf, 0xf4, 0x41, 0xef, 0xbf, 0xf0, 0xaf, 0xf0, 0xef, 0xff, 0x00, +0x2c, 0x2b, 0xfa, 0xac, 0xa2, 0x8e, 0x51, 0x72, 0x9f, 0xcc, 0xbf, 0xec, 0x8b, 0xff, 0x00, 0x06, +0xe6, 0x7e, 0xd3, 0xd7, 0xff, 0x00, 0xb5, 0x3f, 0xc3, 0xa5, 0xf8, 0x97, 0xf0, 0x85, 0xb4, 0x1f, +0x87, 0xb0, 0xf8, 0x8a, 0xc6, 0xe7, 0xc4, 0x97, 0x97, 0x3e, 0x23, 0xd1, 0x2e, 0xe3, 0x5d, 0x3a, +0x29, 0x96, 0x5b, 0x88, 0xfc, 0xa8, 0x2f, 0x64, 0x95, 0xbc, 0xc8, 0xd1, 0xa2, 0x1b, 0x51, 0xb0, +0x64, 0x04, 0x8c, 0x03, 0x5f, 0xd3, 0x45, 0x14, 0x53, 0x4a, 0xc5, 0x05, 0x14, 0x51, 0x4c, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, +0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0f, 0xc7, 0x7f, 0xf8, 0x2d, 0x4f, 0xfc, 0x17, 0x47, +0xf6, 0x8a, 0xff, 0x00, 0x82, 0x66, 0x7e, 0xdb, 0x93, 0x78, 0x07, 0xc2, 0xfe, 0x1d, 0xf8, 0x41, +0xa8, 0x78, 0x3b, 0x54, 0xd0, 0x6c, 0xb5, 0xfd, 0x12, 0xe7, 0x59, 0xd0, 0xf5, 0x19, 0xef, 0x4c, +0x52, 0xf9, 0x90, 0x4c, 0x92, 0xcb, 0x0e, 0xa1, 0x14, 0x6c, 0xcb, 0x71, 0x6f, 0x31, 0x01, 0x63, +0x5c, 0x23, 0xc6, 0x08, 0x27, 0xe6, 0x6f, 0x92, 0xff, 0x00, 0xe2, 0x2e, 0x1f, 0xda, 0x8b, 0xfe, +0x85, 0x2f, 0x80, 0x5f, 0xf8, 0x4e, 0xea, 0xff, 0x00, 0xfc, 0xb4, 0xaf, 0xab, 0x3f, 0xe0, 0xef, +0xff, 0x00, 0xd9, 0xbb, 0xfe, 0x12, 0x0f, 0x80, 0x5f, 0x09, 0xfe, 0x2b, 0x59, 0xc2, 0xcf, 0x37, +0x84, 0x75, 0xbb, 0x8f, 0x0d, 0xea, 0x0d, 0x1a, 0x0c, 0xfd, 0x9a, 0xfe, 0x21, 0x2c, 0x72, 0x48, +0x71, 0xf7, 0x52, 0x7b, 0x30, 0x83, 0x9e, 0x1a, 0xec, 0xf0, 0x73, 0x91, 0xf8, 0x26, 0x0f, 0x15, +0x9e, 0xa2, 0x93, 0x77, 0x3f, 0x50, 0x3f, 0xe2, 0x2e, 0x1f, 0xda, 0x8b, 0xfe, 0x85, 0x2f, 0x80, +0x5f, 0xf8, 0x4e, 0xea, 0xff, 0x00, 0xfc, 0xb4, 0xae, 0x4f, 0xe3, 0x37, 0xfc, 0x1d, 0x25, 0xfb, +0x56, 0xfc, 0x5e, 0xf0, 0x3d, 0xd6, 0x89, 0x69, 0x71, 0xf0, 0xd7, 0xc0, 0x6f, 0x78, 0xa6, 0x36, +0xd5, 0x3c, 0x2f, 0xa0, 0x5c, 0x47, 0xa8, 0x22, 0x9e, 0x18, 0x24, 0x97, 0x97, 0x57, 0x28, 0x84, +0x8c, 0x8d, 0xca, 0x81, 0xd7, 0x39, 0x56, 0x56, 0x00, 0x8f, 0xce, 0xbd, 0xd4, 0x66, 0x81, 0x73, +0x32, 0x6d, 0x47, 0x52, 0xba, 0xd6, 0xb5, 0x4b, 0xab, 0xeb, 0xeb, 0xab, 0xab, 0xeb, 0xfb, 0xf9, +0xe4, 0xba, 0xba, 0xba, 0xba, 0x99, 0xa6, 0x9e, 0xea, 0x69, 0x18, 0xbc, 0x92, 0xc9, 0x23, 0x12, +0xce, 0xee, 0xc5, 0x99, 0x99, 0x89, 0x2c, 0xcc, 0x49, 0x24, 0x9a, 0x84, 0xee, 0x3c, 0x2a, 0xbb, +0xb3, 0x70, 0xaa, 0x8a, 0x59, 0x98, 0x9e, 0x00, 0x00, 0x72, 0x49, 0xf4, 0x1c, 0xd6, 0xd7, 0xc3, +0x6f, 0x87, 0x1e, 0x22, 0xf8, 0xcd, 0xe3, 0xbb, 0x1f, 0x0b, 0xf8, 0x3f, 0x41, 0xd6, 0xbc, 0x55, +0xe2, 0x4d, 0x48, 0xe2, 0xd7, 0x4a, 0xd2, 0x2c, 0xa4, 0xbd, 0xbc, 0x9c, 0x0c, 0x65, 0x84, 0x51, +0x82, 0xdb, 0x46, 0x41, 0x2d, 0x8d, 0xaa, 0x39, 0x24, 0x0e, 0x6b, 0xf7, 0x8b, 0xfe, 0x08, 0x71, +0xff, 0x00, 0x06, 0xea, 0xcd, 0xfb, 0x34, 0x78, 0xb7, 0x4d, 0xf8, 0xc5, 0xf1, 0xfa, 0xd7, 0x4e, +0xba, 0xf8, 0x81, 0xa5, 0x3a, 0x5d, 0x78, 0x6f, 0xc2, 0x71, 0xca, 0x97, 0x76, 0xbe, 0x19, 0x9c, +0x60, 0xad, 0xe5, 0xd4, 0xa8, 0x5a, 0x39, 0xef, 0x10, 0xff, 0x00, 0xaa, 0x48, 0xcb, 0x45, 0x01, +0x1e, 0x60, 0x69, 0x24, 0x31, 0xb4, 0x00, 0x28, 0xb6, 0x7d, 0x65, 0xff, 0x00, 0x04, 0x1d, 0xfd, +0x80, 0xae, 0xbf, 0xe0, 0x9e, 0xbf, 0xb0, 0x06, 0x83, 0xe1, 0xff, 0x00, 0x10, 0x5a, 0xfd, 0x97, +0xc7, 0xde, 0x31, 0xb8, 0x6f, 0x14, 0xf8, 0xaa, 0x26, 0x6d, 0xcd, 0x67, 0x77, 0x70, 0x88, 0xb1, +0x5a, 0x7a, 0x03, 0x6f, 0x6d, 0x14, 0x11, 0x38, 0x52, 0xc8, 0x65, 0x49, 0x99, 0x49, 0x0f, 0x9a, +0xfb, 0x3a, 0x8a, 0x2b, 0x42, 0x82, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, +0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x02, 0x8a, 0x28, 0xa0, 0x0f, 0x8e, 0x7f, +0xe0, 0xbe, 0x7a, 0x55, 0xae, 0xb5, 0xff, 0x00, 0x04, 0xa6, 0xf8, 0xa1, 0x05, 0xe5, 0xad, 0xbd, +0xdc, 0x3b, 0xf4, 0x67, 0xf2, 0xe6, 0x8c, 0x48, 0xbb, 0x86, 0xb5, 0x61, 0x83, 0x83, 0xc6, 0x47, +0xad, 0x7f, 0x3b, 0xbf, 0xf0, 0xaf, 0xb4, 0x1f, 0xfa, 0x01, 0xe8, 0xff, 0x00, 0xf8, 0x07, 0x1f, +0xf8, 0x51, 0x45, 0x67, 0x2d, 0xca, 0x03, 0xf0, 0xfb, 0x41, 0xc7, 0xfc, 0x80, 0xf4, 0x7f, 0xfc, +0x03, 0x8f, 0xfc, 0x2b, 0xd4, 0x3f, 0x64, 0x3f, 0x83, 0x3e, 0x0f, 0xf1, 0x5f, 0xc5, 0xa8, 0xad, +0x75, 0x4f, 0x09, 0xf8, 0x6b, 0x52, 0xb5, 0x68, 0xdc, 0x98, 0x6e, 0xb4, 0xc8, 0x26, 0x8c, 0xfc, +0x8e, 0x7e, 0xeb, 0x29, 0x1d, 0x40, 0xfc, 0xa8, 0xa2, 0xa4, 0x3a, 0x1f, 0xd2, 0x87, 0xec, 0xdf, +0xfb, 0x3e, 0xf8, 0x07, 0xf6, 0x7b, 0xf8, 0x63, 0x63, 0x63, 0xe0, 0x1f, 0x03, 0xf8, 0x43, 0xc0, +0xf6, 0x7a, 0x85, 0xbc, 0x37, 0x17, 0x56, 0xfe, 0x1f, 0xd1, 0xad, 0xf4, 0xc8, 0xae, 0x64, 0x31, +0xe4, 0xbb, 0xac, 0x28, 0xa1, 0x9b, 0x24, 0x9c, 0x9c, 0x9e, 0x4d, 0x7a, 0x45, 0x14, 0x56, 0x91, +0x09, 0x05, 0x14, 0x51, 0x54, 0x48, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, +0x14, 0x01, 0xff, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_msd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_msd.c new file mode 100644 index 0000000..a26e642 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/flash_msd.c @@ -0,0 +1,93 @@ +/*! + \file flash_msd.c + \brief flash access functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "flash_msd.h" + +/*! + \brief initialize flash + \param[in] none + \param[out] none + \retval status + */ +uint32_t flash_init ( ) +{ + fmc_unlock(); + return 0U; +} + +/*! + \brief read data from multiple blocks of flash + \param[in] pBuf: pointer to user buffer + \param[in] read_addr: address to be read + \param[in] blk_size: size of block + \param[in] blk_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_read_multi_blocks (uint8_t *buf, + uint32_t read_addr, + uint16_t blk_size, + uint32_t blk_num) +{ + uint32_t i; + uint8_t *source = (uint8_t *)(read_addr + FLASH_BASE_ADDR); + + /* Data transfer */ + while (blk_num--) + { + for (i = 0U; i < blk_size; i++) + { + *buf++ = *source++; + } + } + + return 0U; +} + +/*! + \brief write data to multiple blocks of flash + \param[in] pBuf: pointer to user buffer + \param[in] write_addr: address to be write + \param[in] blk_size: block size + \param[in] blk_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_write_multi_blocks (uint8_t *buf, + uint32_t write_addr, + uint16_t blk_size, + uint32_t blk_num) +{ + return 0U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_hw.c new file mode 100644 index 0000000..98958fa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief timer base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_it.c new file mode 100644 index 0000000..ce8c7f9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/gd32f10x_it.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver msc_cdrom; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq(void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&msc_cdrom); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (msc_cdrom.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&msc_cdrom); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/system_gd32f10x.c new file mode 100644 index 0000000..c688b8c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV8; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/usbd_storage_msd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/usbd_storage_msd.c new file mode 100644 index 0000000..a020d12 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_cdrom/src/usbd_storage_msd.c @@ -0,0 +1,183 @@ +/*! + \file usbd_storage_msd.c + \brief this file provides the disk operations functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "flash_msd.h" +#include "usbd_msc_mem.h" + +/* USB mass storage standard inquiry data */ +const int8_t STORAGE_InquiryData[] = +{ + /* LUN 0 */ + 0x05, /* 0x05 for CD-ROM; 0x00 for usb mass storage */ + 0x80, /* RMB BYTE is set by inquiry data */ + 0x02, /* ANSI SCSI 2 */ + 0x00, /* Data format = 0 */ + 0x1F, /* Additional length */ + 0x00, + 0x00, + 0x00, + /* vendor information = GD32 */ + 'G', 'D', '3', '2', 0x20, 0x20, 0x20, 0x20 , + /* product identification = CDROM DEMO */ + 'C', 'D', 'R', 'O', 'M', 0x20,'D', 'E', 'M','0',0x20,0x20,0x20, 0x20, 0x20, 0x20, + /* Product revision = 1.0 */ + 0x31, 0x2E, 0x30, 0x20 +}; + +/* USB CDROM TOC(Table Of Content) data */ +const int8_t usbcdrom_read_toc_data[] = { + 0x00, + 0x12, /* number of bytes below */ + 0x01, /* first track */ + 0x01, /* last track */ + 0x00, /* reserved */ + 0x14, /* (adr, control) */ + 0x01, /* (track being described) */ + 0x00, /* (reserved) */ + 00, 00, 00, 00, /* (start logical block address 0) */ + 0x00, /* (reserved) */ + 0x14, /* (adr, control) */ + 0xAA, /* (track being described (leadout)) */ + 0x00, /* (reserved) */ + 00, 00, 0xA2, 0x8A /* (start logical block address 41610) */ +}; + +static int8_t STORAGE_Init (uint8_t Lun); +static int8_t STORAGE_IsReady (uint8_t Lun); +static int8_t STORAGE_IsWriteProtected (uint8_t Lun); +static int8_t STORAGE_GetMaxLun (void); +static int8_t STORAGE_Read (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen); +static int8_t STORAGE_Write (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen); + +usbd_mem_cb USBD_Internal_Flash_fops = +{ + .mem_init = STORAGE_Init, + .mem_ready = STORAGE_IsReady, + .mem_protected = STORAGE_IsWriteProtected, + .mem_read = STORAGE_Read, + .mem_write = STORAGE_Write, + .mem_maxlun = STORAGE_GetMaxLun, + + .mem_inquiry_data = {(uint8_t *)STORAGE_InquiryData}, + .mem_toc_data = (uint8_t *)usbcdrom_read_toc_data, + .mem_block_len = BLOCK_NUM, + .mem_block_size = BLOCK_SIZE +}; + +usbd_mem_cb *usbd_mem_fops = &USBD_Internal_Flash_fops; + +/*! + \brief initialize the storage medium + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_Init (uint8_t Lun) +{ + return 0; +} + +/*! + \brief check whether the medium is ready + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_IsReady (uint8_t Lun) +{ + return 0; +} + +/*! + \brief check whether the medium is write-protected + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_IsWriteProtected (uint8_t Lun) +{ + return 0; +} + +/*! + \brief read data from the medium + \param[in] Lun: logical unit number + \param[in] buf: pointer to the buffer to save data + \param[in] BlkAddr: address of 1st block to be read + \param[in] BlkLen: number of blocks to be read + \param[out] none + \retval status +*/ +static int8_t STORAGE_Read (uint8_t Lun, uint8_t *buf, uint32_t BlkAddr, uint16_t BlkLen) +{ + flash_read_multi_blocks (buf, BlkAddr, BLOCK_SIZE, BlkLen); + + return 0; +} + +/*! + \brief write data to the medium + \param[in] Lun: logical unit number + \param[in] buf: pointer to the buffer to write + \param[in] BlkAddr: address of 1st block to be written + \param[in] BlkLen: number of blocks to be write + \param[out] none + \retval status +*/ +static int8_t STORAGE_Write (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen) +{ + flash_write_multi_blocks (buf, BlkAddr, BLOCK_SIZE, BlkLen); + + return (0); +} + +/*! + \brief get number of supported logical unit + \param[in] none + \param[out] none + \retval number of logical unit +*/ +static int8_t STORAGE_GetMaxLun (void) +{ + return (MEM_LUN_NUM - 1U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewp new file mode 100644 index 0000000..c206f3d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewp @@ -0,0 +1,1064 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_msd.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\usbd_storage_msd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewt new file mode 100644 index 0000000..9ce6cca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.ewt @@ -0,0 +1,1165 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\flash_msd.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\usbd_storage_msd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.eww new file mode 100644 index 0000000..6c1059a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/EWARM/msc_udisk.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\msc_udisk.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvopt new file mode 100644 index 0000000..aa8b522 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvopt @@ -0,0 +1,665 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + msc_udisk + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 2 + 0 + 16 + 34 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 14 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\flash_msd.c + flash_msd.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 38 + 0 + 0 + 0 + 0 + ..\src\usbd_storage_msd.c + usbd_storage_msd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 25 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 26 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvoptx new file mode 100644 index 0000000..0170742 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvoptx @@ -0,0 +1,579 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + msc_udisk + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\flash_msd.c + flash_msd.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\usbd_storage_msd.c + usbd_storage_msd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + usbd_msc_bbb.c + 0 + 0 + + + 7 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + usbd_msc_core.c + 0 + 0 + + + 7 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + usbd_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 25 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 26 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvproj new file mode 100644 index 0000000..d7cf572 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvproj @@ -0,0 +1,584 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_udisk + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_udisk + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_msd.c + 1 + ..\src\flash_msd.c + + + usbd_storage_msd.c + 1 + ..\src\usbd_storage_msd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvprojx new file mode 100644 index 0000000..5158f69 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/MDK-ARM/msc_udisk.uvprojx @@ -0,0 +1,577 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + msc_udisk + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + msc_udisk + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + flash_msd.c + 1 + ..\src\flash_msd.c + + + usbd_storage_msd.c + 1 + ..\src\usbd_storage_msd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_fmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + usbd_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_bbb.c + + + usbd_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_core.c + + + usbd_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\msc\Source\usbd_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/flash_msd.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/flash_msd.h new file mode 100644 index 0000000..ef4bc73 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/flash_msd.h @@ -0,0 +1,52 @@ +/*! + \file flash_msd.h + \brief the header file of flash_msd.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __FLASH_MSD_H +#define __FLASH_MSD_H + +#include "stdlib.h" +#include "usb_conf.h" + +#define ISFLASH_BLOCK_SIZE 2048U +#define ISFLASH_BLOCK_NUM 64U + +/* function declarations */ +/* initialize flash */ +uint32_t flash_init (void); +/* read data from multiple blocks of flash */ +uint32_t flash_multi_blocks_read (uint8_t* pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num); +/* write data to multiple blocks of flash */ +uint32_t flash_multi_blocks_write (uint8_t* pBuf, uint32_t write_addr, uint16_t block_size, uint32_t block_num); + +#endif /* __FLASH_MSD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usb_conf.h new file mode 100644 index 0000000..1eb4871 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usb_conf.h @@ -0,0 +1,126 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "stdlib.h" +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 0U +#define USB_LOW_POWER 0U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usbd_conf.h new file mode 100644 index 0000000..714727c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/inc/usbd_conf.h @@ -0,0 +1,58 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U +#define USB_STR_DESC_MAX_SIZE 64U + +#define USBD_MSC_INTERFACE 0U + +/* class layer parameter */ +#define MSC_IN_EP EP1_IN +#define MSC_OUT_EP EP1_OUT + +#define MSC_DATA_PACKET_SIZE 64U + +#define MSC_MEDIA_PACKET_SIZE 4096U + +#define MEM_LUN_NUM 1U + +#define USB_STRING_COUNT 4U + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/readme.txt new file mode 100644 index 0000000..9b031f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/readme.txt @@ -0,0 +1,60 @@ +/*! + \file readme.txt + \brief description of the USB MSC device(Udisk) demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USB device application based on the Mass Storage Class (MSC). + + The GD32 MCU is enumerated as a MSC device using the native PC Host MSC driver +to which the GD32107C-EVAL board is connected. + + It illustrates an implementation of the MSC class which uses the bulk transfer +while the internal flash is used as storage media. + + This example supports the BOT (bulk only transfer) protocol and all needed SCSI +(small computer system interface) commands, and is compatible with Windows platform. + + After running the example, the user just has to plug the USB cable into a PC host +and the device is automatically detected. One new removable drives appear in the +system window and write/read/format operations can be performed as with any other +removable drive. + + To select the appropriate USB Core to work with, user must add the following macro +defines within the compiler preprocessor (already done in the pre-configured projects +provided with this application): + - "USE_USB_FS" when using USB Full Speed (FS) Core + + In order to make the program work, you must do the following : + - Open your preferred tool-chain + - Rebuild all files and load your image into target memory + - Run the application diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/app.c new file mode 100644 index 0000000..088754d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/app.c @@ -0,0 +1,58 @@ +/*! + \file main.c + \brief USB main routine for MSC device(Udisk) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usbd_msc_core.h" + +usb_core_driver msc_udisk; + +/*! + \brief main routine will construct a USB mass storage device + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + usbd_init (&msc_udisk, USB_CORE_ENUM_FS, &msc_desc, &msc_class); + + usb_intr_config(); + + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/flash_msd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/flash_msd.c new file mode 100644 index 0000000..e6be8df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/flash_msd.c @@ -0,0 +1,111 @@ +/*! + \file flash_msd.c + \brief flash access functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_conf.h" +#include "flash_msd.h" + +/* pages 0 and 1 base and end addresses */ +#define NAND_FLASH_BASE_ADDRESS 0x8010000U +#define PAGE_SIZE 0x800U + +/*! + \brief initialize the nand flash + \param[in] none + \param[out] none + \retval status + */ +uint32_t flash_init (void) +{ + fmc_unlock(); + + return 0U; +} + +/*! + \brief read data from multiple blocks of nand flash + \param[in] pBuf: pointer to user buffer + \param[in] read_addr: address to be read + \param[in] block_size: size of block + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_multi_blocks_read (uint8_t *pBuf, uint32_t read_addr, uint16_t block_size, uint32_t block_num) +{ + uint32_t i; + uint8_t *pSource = (uint8_t *)(read_addr + NAND_FLASH_BASE_ADDRESS); + + /* Data transfer */ + while (block_num--) { + for (i = 0U; i < block_size; i++) { + *pBuf++ = *pSource++; + } + } + + return 0U; +} + +/*! + \brief write data to multiple blocks of flash + \param[in] pBuf: pointer to user buffer + \param[in] write_addr: address to be write + \param[in] block_size: block size + \param[in] block_num: number of block + \param[out] none + \retval status +*/ +uint32_t flash_multi_blocks_write (uint8_t *pBuf, + uint32_t write_addr, + uint16_t block_size, + uint32_t block_num) +{ + uint32_t i, page; + uint32_t start_page = (write_addr / PAGE_SIZE) * PAGE_SIZE + NAND_FLASH_BASE_ADDRESS; + uint32_t *ptrs = (uint32_t *)pBuf; + + page = block_num; + + for(; page > 0U; page--){ + fmc_page_erase(start_page); + + i = 0U; + + do{ + fmc_word_program(start_page, *ptrs++); + start_page += 4U; + }while(++i < 512U); + } + + return 0U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_hw.c new file mode 100644 index 0000000..a569729 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_hw.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIM2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief timer base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMERE2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_it.c new file mode 100644 index 0000000..80708cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/gd32f10x_it.c @@ -0,0 +1,233 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver msc_udisk; +extern uint32_t usbfs_prescaler; +extern void usb_timer_irq(void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&msc_udisk); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (msc_udisk.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&msc_udisk); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/system_gd32f10x.c new file mode 100644 index 0000000..50568cb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV8; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/usbd_storage_msd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/usbd_storage_msd.c new file mode 100644 index 0000000..878dc5d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/msc_udisk/src/usbd_storage_msd.c @@ -0,0 +1,174 @@ +/*! + \file usbd_storage_msd.c + \brief this file provides the disk operations functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usb_conf.h" +#include "flash_msd.h" +#include "usbd_msc_mem.h" + +/* USB mass storage standard inquiry data */ +const int8_t STORAGE_InquiryData[] = +{ + /* LUN 0 */ + 0x00, + 0x80, + 0x00, + 0x01, + (USBD_STD_INQUIRY_LENGTH - 5U), + 0x00, + 0x00, + 0x00, + 'G', 'D', '3', '2', ' ', ' ', ' ', ' ', /* manufacturer : 8 bytes */ + 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', /* product : 16 Bytes */ + ' ', 'f', 'l', 'a', 's', 'h', ' ', ' ', + '1', '.', '0' ,'0', /* version : 4 Bytes */ +}; + +static int8_t STORAGE_Init (uint8_t Lun); +static int8_t STORAGE_IsReady (uint8_t Lun); +static int8_t STORAGE_IsWriteProtected (uint8_t Lun); +static int8_t STORAGE_GetMaxLun (void); +static int8_t STORAGE_Read (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen); +static int8_t STORAGE_Write (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen); + +usbd_mem_cb USBD_Internal_Storage_fops = +{ + .mem_init = STORAGE_Init, + .mem_ready = STORAGE_IsReady, + .mem_protected = STORAGE_IsWriteProtected, + .mem_read = STORAGE_Read, + .mem_write = STORAGE_Write, + .mem_maxlun = STORAGE_GetMaxLun, + + .mem_inquiry_data = {(uint8_t *)STORAGE_InquiryData}, + .mem_block_size = {ISFLASH_BLOCK_SIZE}, + .mem_block_len = {ISFLASH_BLOCK_NUM} +}; + +usbd_mem_cb *usbd_mem_fops = &USBD_Internal_Storage_fops; + +/*! + \brief initialize the storage medium + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_Init (uint8_t Lun) +{ + return 0; +} + +/*! + \brief check whether the medium is ready + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_IsReady (uint8_t Lun) +{ + flash_init (); + + return 0; +} + +/*! + \brief check whether the medium is write-protected + \param[in] Lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t STORAGE_IsWriteProtected (uint8_t Lun) +{ + return 0; +} + +/*! + \brief read data from the medium + \param[in] Lun: logical unit number + \param[in] buf: pointer to the buffer to save data + \param[in] BlkAddr: address of 1st block to be read + \param[in] BlkLen: number of blocks to be read + \param[out] none + \retval status +*/ +static int8_t STORAGE_Read (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen) +{ + + if (0U != flash_multi_blocks_read (buf, BlkAddr, ISFLASH_BLOCK_SIZE, BlkLen)) { + return 5; + } + + return 0; +} + +/*! + \brief write data to the medium + \param[in] Lun: logical unit number + \param[in] buf: pointer to the buffer to write + \param[in] BlkAddr: address of 1st block to be written + \param[in] BlkLen: number of blocks to be write + \param[out] none + \retval status +*/ +static int8_t STORAGE_Write (uint8_t Lun, + uint8_t *buf, + uint32_t BlkAddr, + uint16_t BlkLen) +{ + + if (0U != flash_multi_blocks_write (buf, BlkAddr, ISFLASH_BLOCK_SIZE, BlkLen)) { + return 5; + } + + return (0); +} + +/*! + \brief get number of supported logical unit + \param[in] none + \param[out] none + \retval number of logical unit +*/ +static int8_t STORAGE_GetMaxLun (void) +{ + return (MEM_LUN_NUM - 1); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewp new file mode 100644 index 0000000..9902f79 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewp @@ -0,0 +1,1053 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\hid_keyboard_itf.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\standard_hid_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewt new file mode 100644 index 0000000..1c7ca1d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.ewt @@ -0,0 +1,1153 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\hid_keyboard_itf.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\class\hid\Source\standard_hid_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.eww new file mode 100644 index 0000000..d48e4ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/EWARM/hid_keyboard.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\hid_keyboard.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt new file mode 100644 index 0000000..501aa56 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvopt @@ -0,0 +1,633 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + standard_hid + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U20080643 -O74 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + + 0 + 1 + device_descripter + + + 1 + 1 + system_clock,0x0A + + + 2 + 1 + ctl_status + + + 3 + 1 + usbhs_core_dev + + + 4 + 1 + system_clock,0x0A + + + 5 + 1 + usec,0x0A + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 11 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\hid_keyboard_itf.c + hid_keyboard_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\standard_hid_core.c + standard_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 21 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx new file mode 100644 index 0000000..475f5d9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvoptx @@ -0,0 +1,563 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + standard_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O74 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO31 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + + 0 + 1 + device_descripter + + + 1 + 1 + system_clock,0x0A + + + 2 + 1 + ctl_status + + + 3 + 1 + usbhs_core_dev + + + 4 + 1 + system_clock,0x0A + + + 5 + 1 + usec,0x0A + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\hid_keyboard_itf.c + hid_keyboard_itf.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\standard_hid_core.c + standard_hid_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 21 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 22 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj new file mode 100644 index 0000000..cb6f6e8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvproj @@ -0,0 +1,564 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + standard_hid + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_keyboard + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + hid_keyboard_itf.c + 1 + ..\src\hid_keyboard_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + standard_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\standard_hid_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx new file mode 100644 index 0000000..41d0e82 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/MDK-ARM/hid_keyboard.uvprojx @@ -0,0 +1,557 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + standard_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + hid_keyboard + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + hid_keyboard_itf.c + 1 + ..\src\hid_keyboard_itf.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + standard_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\hid\Source\standard_hid_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..56681e8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usb_conf.h new file mode 100644 index 0000000..4797068 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usb_conf.h @@ -0,0 +1,125 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1U +#define USB_LOW_POWER 1U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usbd_conf.h new file mode 100644 index 0000000..f5f3100 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/inc/usbd_conf.h @@ -0,0 +1,56 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +#define USBD_HID_INTERFACE 0U + +#define USB_STR_DESC_MAX_SIZE 64U + +/* USB user string supported */ +/* #define USB_SUPPORT_USER_STRING_DESC */ + +#define USB_STRING_COUNT 4U + +#define HID_IN_EP EP1_IN /* EP1 for data IN */ + +#define HID_IN_PACKET 8U + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/readme.txt new file mode 100644 index 0000000..18ff241 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/readme.txt @@ -0,0 +1,60 @@ +/*! + \file readme.txt + \brief description of the USB HID device(USB-Keyboard) demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USB_FS device application based on the Human Interface Device (HID). + + The Full Speed (FS) USB module uses a 48MHz clock, which is generated +from an integrated PLL. + + The GD32 device is enumerated as an USB keyboard, that uses the native PC Host +HID driver to which the GD32F20X-EVAL board is connected. + + The USB keyboard use three key(wakeup key, tamper key and user1 key) to print 3 +characters('b', 'a' and 'c'). + + This demo supports remote wakeup (which is the ability of a USB device to +bring a suspended bus back to the active condition), and the wakeup key is +used as the remote wakeup source. + + In order to test USB remote wakeup function, you can do as follows: + - Manually switch PC to standby mode + - Wait for PC to fully enter the standby mode + - Push the wakeup key + - If PC is ON, remote wakeup is OK, else failed + + In order to make the program work, you must do the following: + - Open your preferred tool-chain + - Rebuild all files and load your image into target memory + - Run the application diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/app.c new file mode 100644 index 0000000..c369385 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/app.c @@ -0,0 +1,67 @@ +/*! + \file main.c + \brief USB main routine for HID device(USB keyboard) + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "standard_hid_core.h" + +extern hid_fop_handler fop_handler; + +usb_core_driver hid_keyboard; + +/*! + \brief main routine will construct a USB keyboard + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + hid_itfop_register (&hid_keyboard, &fop_handler); + + usbd_init (&hid_keyboard, USB_CORE_ENUM_FS, &hid_desc, &usbd_hid_cb); + + usb_intr_config(); + + /* check if USB device is enumerated successfully */ + while (USBD_CONFIGURED != hid_keyboard.dev.cur_status) { + } + + while (1) { + fop_handler.hid_itf_data_process(&hid_keyboard); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_hw.c new file mode 100644 index 0000000..59bd19a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_hw.c @@ -0,0 +1,251 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler; +__IO uint32_t usbfs_prescaler = 0U; + +extern enum +{ + CHAR_A = 1, + CHAR_B, + CHAR_C +}key_char_enum; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief to get usb keyboard state + \param[in] none + \param[out] none + \retval the char +*/ +uint8_t key_state (void) +{ + /* have pressed tamper key */ + if (!gd_eval_key_state_get(KEY_TAMPER)) { + usb_mdelay(100U); + + if (!gd_eval_key_state_get(KEY_TAMPER)) { + return CHAR_A; + } + } + + /* have pressed wakeup key */ + if (!gd_eval_key_state_get(KEY_WAKEUP)) { + usb_mdelay(100U); + + if (!gd_eval_key_state_get(KEY_WAKEUP)) { + return CHAR_B; + } + } + + /* have pressed user key */ + if (!gd_eval_key_state_get(KEY_USER)) { + usb_mdelay(100U); + + if (!gd_eval_key_state_get(KEY_USER)) { + return CHAR_C; + } + } + + /* no pressed any key */ + return 0U; +} + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_irq_enable((uint8_t)USBFS_IRQn, 3U, 0U); + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 0U, 0U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_initpara; + + rcu_periph_clock_enable(RCU_TIMER2); + timer_deinit(TIMER2); + + if(TIM_USEC_DELAY == unit) { + timer_initpara.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_initpara.period = 11999U; + } + + timer_initpara.prescaler = timer_prescaler; + timer_initpara.alignedmode = TIMER_COUNTER_EDGE; + timer_initpara.counterdirection = TIMER_COUNTER_UP; + timer_initpara.clockdivision = TIMER_CKDIV_DIV1; + timer_initpara.repetitioncounter = 0U; + timer_init(TIMER2, &timer_initpara); + + timer_update_event_enable(TIMER2); + timer_interrupt_enable(TIMER2,TIMER_INT_UP); + timer_flag_clear(TIMER2, TIMER_FLAG_UP); + timer_update_source_config(TIMER2, TIMER_UPDATE_SRC_GLOBAL); + + /* TIMER2 counter enable */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_it.c new file mode 100644 index 0000000..967159d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/gd32f10x_it.c @@ -0,0 +1,272 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" +#include "drv_usb_hw.h" + +extern usb_core_driver hid_keyboard; +extern uint32_t usbfs_prescaler; + +extern void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&hid_keyboard); +} + +/*! + \brief this function handles EXTI0_IRQ Handler + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler(void) +{ + if (exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE) != RESET) { + if (hid_keyboard.dev.pm.dev_remote_wakeup) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&hid_keyboard); + + usb_rwkup_set(&hid_keyboard); + + /* add delay time */ + for(__IO uint16_t i = 0; i < 1000; i++){ + for(__IO uint16_t i =0; i < 100; i++); + } + + usb_rwkup_reset(&hid_keyboard); + + hid_keyboard.dev.cur_status = hid_keyboard.dev.backup_status; + + hid_keyboard.dev.pm.dev_remote_wakeup = 0U; + } + + /* clear the exti line pending bit */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (hid_keyboard.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&hid_keyboard); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/hid_keyboard_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/hid_keyboard_itf.c new file mode 100644 index 0000000..5151778 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/hid_keyboard_itf.c @@ -0,0 +1,134 @@ +/*! + \file hid_keyboard_itf.c + \brief standard HID keyboard interface driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "standard_hid_core.h" +#include "drv_usb_hw.h" + +typedef enum +{ + CHAR_A = 1, + CHAR_B, + CHAR_C +} key_char; + +static void key_config(void); +static uint8_t key_state(void); +static void hid_key_data_send(usb_dev *udev); + +hid_fop_handler fop_handler = +{ + .hid_itf_config = key_config, + .hid_itf_data_process = hid_key_data_send +}; + +/*! + \brief configure the keys + \param[in] none + \param[out] none + \retval none +*/ +static void key_config (void) +{ + /* configure the wakeup key in EXTI mode to remote wakeup */ + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); + + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + gd_eval_key_init(KEY_USER, KEY_MODE_GPIO); + + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); +} + +/*! + \brief to get usb keyboard state + \param[in] none + \param[out] none + \retval the char +*/ +static uint8_t key_state (void) +{ + /* have pressed tamper key */ + if (!gd_eval_key_state_get(KEY_TAMPER)) { + usb_mdelay(50U); + + if (!gd_eval_key_state_get(KEY_TAMPER)) { + return CHAR_A; + } + } + + /* have pressed wakeup key */ + if (!gd_eval_key_state_get(KEY_WAKEUP)) { + usb_mdelay(50U); + + if (!gd_eval_key_state_get(KEY_WAKEUP)) { + return CHAR_B; + } + } + + /* have pressed user key */ + if (!gd_eval_key_state_get(KEY_USER)) { + usb_mdelay(50U); + + if (!gd_eval_key_state_get(KEY_USER)) { + return CHAR_C; + } + } + + /* no pressed any key */ + return 0U; +} + +static void hid_key_data_send(usb_dev *udev) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->dev.class_data[USBD_HID_INTERFACE]; + + if (hid->prev_transfer_complete) { + switch (key_state()) { + case CHAR_A: + hid->data[2] = 0x04; + break; + case CHAR_B: + hid->data[2] = 0x05; + break; + case CHAR_C: + hid->data[2] = 0x06; + break; + default: + break; + } + + if (0 != hid->data[2]) { + hid_report_send(udev, hid->data, HID_IN_PACKET); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/standard_hid_keyboard/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewd new file mode 100644 index 0000000..2918d2a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewp new file mode 100644 index 0000000..c9cc57d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewp @@ -0,0 +1,1048 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewt new file mode 100644 index 0000000..d1c7e73 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.ewt @@ -0,0 +1,1150 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\app.c + + + $PROJ_DIR$\..\src\gd32f10x_hw.c + + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + GD32F10x_StdPeriph + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\class\printer\Source\printer_core.c + + + + USB_Device + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\device\core\Source\usbd_transc.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_dev.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usbd_int.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.eww new file mode 100644 index 0000000..b053855 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/EWARM/usb_printer.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\usb_printer.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvopt new file mode 100644 index 0000000..2a9a7af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvopt @@ -0,0 +1,585 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + printer + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 26 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 23 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 20 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 21 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvoptx new file mode 100644 index 0000000..d762df0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvoptx @@ -0,0 +1,519 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + printer + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + JL2CM3 + -U20080643 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + / + + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\app.c + app.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_hw.c + gd32f10x_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Drivers + 0 + 0 + 0 + 0 + + 5 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + drv_usb_dev.c + 0 + 0 + + + 5 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + drv_usbd_int.c + 0 + 0 + + + + + USB_Device + 0 + 0 + 0 + 0 + + 6 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + usbd_core.c + 0 + 0 + + + 6 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + usbd_enum.c + 0 + 0 + + + 6 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + usbd_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + printer_core.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 20 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 21 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvproj new file mode 100644 index 0000000..f901fdf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvproj @@ -0,0 +1,559 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + printer + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 0 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbd_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + printer_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvprojx new file mode 100644 index 0000000..21fc72a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/MDK-ARM/usb_printer.uvprojx @@ -0,0 +1,552 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + printer + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbd_printer + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + app.c + 1 + ..\src\app.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_hw.c + 1 + ..\src\gd32f10x_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Drivers + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_dev.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_dev.c + + + drv_usbd_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbd_int.c + + + + + USB_Device + + + usbd_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_core.c + + + usbd_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_enum.c + + + usbd_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\core\Source\usbd_transc.c + + + + + USB_Class + + + printer_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\device\class\printer\Source\printer_core.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usb_conf.h new file mode 100644 index 0000000..5fe56e5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usb_conf.h @@ -0,0 +1,126 @@ +/*! + \file usb_conf.h + \brief USB core driver basic configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include +#include "gd32f10x.h" +#include "gd32f10x_eval.h" + +/* USB Core and PHY interface configuration */ + +/****************** USB FS PHY CONFIGURATION ******************************* + * The USB FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Device mode + * + * (i) Receive data FIFO size = RAM for setup packets + + * OUT endpoint control information + + * data OUT packets + miscellaneous + * Space = ONE 32-bits words + * --> RAM for setup packets = 10 spaces + * (n is the nbr of CTRL EPs the device core supports) + * --> OUT EP CTRL info = 1 space + * (one space for status information written to the FIFO along with each + * received packet) + * --> Data OUT packets = (Largest Packet Size / 4) + 1 spaces + * (MINIMUM to receive packets) + * --> OR data OUT packets = at least 2* (Largest Packet Size / 4) + 1 spaces + * (if high-bandwidth EP is enabled or multiple isochronous EPs) + * --> Miscellaneous = 1 space per OUT EP + * (one space for transfer complete status information also pushed to the + * FIFO with each endpoint's last packet) + * + * (ii) MINIMUM RAM space required for each IN EP Tx FIFO = MAX packet size for + * that particular IN EP. More space allocated in the IN EP Tx FIFO results + * in a better performance on the USB and can hide latencies on the AHB. + * + * (iii) TXn min size = 16 words. (n:Transmit FIFO index) + * + * (iv) When a TxFIFO is not used, the Configuration should be as follows: + * case 1: n > m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txm can use the space allocated for Txn. + * case 2: n < m and Txn is not used (n,m:Transmit FIFO indexes) + * --> Txn should be configured with the minimum space of 16 words + * + * (v) The FIFO is used optimally when used TxFIFOs are allocated in the top + * of the FIFO.Ex: use EP1 and EP2 as IN instead of EP1 and EP3 as IN ones. +*******************************************************************************/ + +#ifdef USB_FS_CORE + #define RX_FIFO_FS_SIZE 128U + #define TX0_FIFO_FS_SIZE 64U + #define TX1_FIFO_FS_SIZE 128U + #define TX2_FIFO_FS_SIZE 0U + #define TX3_FIFO_FS_SIZE 0U +#endif /* USB_FS_CORE */ + +#define USB_SOF_OUTPUT 1U +#define USB_LOW_POWER 0U + +//#define VBUS_SENSING_ENABLED + +//#define USE_HOST_MODE +#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined!" + #endif +#endif + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined (__GNUC__) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usbd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usbd_conf.h new file mode 100644 index 0000000..dc28e3a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/inc/usbd_conf.h @@ -0,0 +1,54 @@ +/*! + \file usbd_conf.h + \brief the header file of USB device configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CONF_H +#define __USBD_CONF_H + +#include "usb_conf.h" + +#define USBD_CFG_MAX_NUM 1U +#define USBD_ITF_MAX_NUM 1U + +#define USB_STR_DESC_MAX_SIZE 255U + +#define PRINTER_IN_EP EP_IN(1) +#define PRINTER_OUT_EP EP_OUT(1) + +#define USB_STRING_COUNT 4U + +#define PRINTER_DATA_PACKET_SIZE 64 +#define PRINTER_IN_PACKET PRINTER_DATA_PACKET_SIZE +#define PRINTER_OUT_PACKET PRINTER_DATA_PACKET_SIZE + +#endif /* __USBD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/readme.txt new file mode 100644 index 0000000..0e4f7e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/readme.txt @@ -0,0 +1,40 @@ +/*! + \file readme.txt + \brief description of the USB device printer example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, it provides a description of +how to use the USBFS. + + The demo provide a printer device. + + To test the demo, you can run printer demo,then you check it from device manager. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/app.c new file mode 100644 index 0000000..14a4e47 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/app.c @@ -0,0 +1,59 @@ +/*! + \file main.c + \brief main routine will construct a Printer device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "printer_core.h" + +usb_core_driver usbd_printer; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + usbd_init (&usbd_printer, USB_CORE_ENUM_FS, &printer_desc, &usbd_printer_cb); + + usb_intr_config(); + + /* Main loop */ + while (1) { + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_hw.c new file mode 100644 index 0000000..114cb4f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_hw.c @@ -0,0 +1,215 @@ +/*! + \file gd32f10x_hw.c + \brief USB hardware configuration for GD32F10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U + +__IO uint32_t delay_time = 0U; +__IO uint16_t timer_prescaler = 5U; + +uint32_t usbfs_prescaler = 0U; + +static void hw_time_set (uint8_t unit); +static void hw_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config(void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + +#ifdef USB_LOW_POWER + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); +#endif +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIMER2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hw_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hw_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief time base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x0U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] nTime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hw_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + + hw_time_set(unit); + + while (0U != delay_time) { + } + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hw_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* TIMER2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* TIMER2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_it.c new file mode 100644 index 0000000..ae79fc6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/gd32f10x_it.c @@ -0,0 +1,234 @@ +/*! + \file gd32f10x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbd_int.h" + +extern usb_core_driver usbd_printer; +extern uint32_t usbfs_prescaler; + +void usb_timer_irq (void); + +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbd_isr (&usbd_printer); +} + +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usbd_printer.bp.low_power) { + resume_mcu_clk(); + + rcu_usb_clock_config(usbfs_prescaler); + + rcu_periph_clock_enable(RCU_USBFS); + + usb_clock_active(&usbd_printer); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HSE */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HSE is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL1 */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL1 is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Device/usb_printer/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewd new file mode 100644 index 0000000..cd11256 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewp new file mode 100644 index 0000000..c9c6552 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewp @@ -0,0 +1,1074 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usb_hw.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\usbh_usr.c + + + $PROJ_DIR$\..\src\usbh_usr_lcd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + USB_Host + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewt new file mode 100644 index 0000000..e840855 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.ewt @@ -0,0 +1,1174 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usb_hw.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\usbh_usr.c + + + $PROJ_DIR$\..\src\usbh_usr_lcd.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + + + + USB_Drivers + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + USB_Host + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.eww new file mode 100644 index 0000000..16dbe3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/EWARM/usbh_hid.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\usbh_hid.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvopt new file mode 100644 index 0000000..e1614a4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvopt @@ -0,0 +1,737 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + usbh_hid + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U260106173 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_CL -FL040000 -FS08000000 + + + + + 0 + 0 + 90 + 1 +
134227328
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\main.c + + +
+
+ + + 0 + 1 + itf_desc + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usb_hw.c + gd32f10x_usb_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 29 + 0 + 0 + 0 + 0 + ..\src\usbh_usr.c + usbh_usr.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\usbh_usr_lcd.c + usbh_usr_lcd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + lcd_font.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + lcd_log.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + gd32f10x_lcd_eval.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + drv_usb_host.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + drv_usbh_int.c + 0 + 0 + + + + + USB_Host + 0 + 0 + 0 + 0 + + 6 + 22 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + usbh_core.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + usbh_enum.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + usbh_pipe.c + 0 + 0 + + + 6 + 25 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + usbh_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 26 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + usbh_hid_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + usbh_standard_hid.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 28 + 2 + 0 + 0 + 2101540 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 29 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvoptx new file mode 100644 index 0000000..70e7935 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvoptx @@ -0,0 +1,644 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + usbh_hid + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + + + 0 + JL2CM3 + -U260106173 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + 0 + 90 + 1 +
134227328
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\main.c + + +
+
+ + + 0 + 1 + itf_desc + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usb_hw.c + gd32f10x_usb_hw.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\usbh_usr.c + usbh_usr.c + 0 + 0 + + + 1 + 5 + 1 + 0 + 0 + 0 + ..\src\usbh_usr_lcd.c + usbh_usr_lcd.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 6 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_Peripherals + 0 + 0 + 0 + 0 + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + lcd_font.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + lcd_log.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + gd32f10x_lcd_eval.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + drv_usb_host.c + 0 + 0 + + + 5 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + drv_usbh_int.c + 0 + 0 + + + + + USB_Host + 0 + 0 + 0 + 0 + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + usbh_core.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + usbh_enum.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + usbh_pipe.c + 0 + 0 + + + 6 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + usbh_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + usbh_hid_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + usbh_standard_hid.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 28 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 9 + 29 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvproj new file mode 100644 index 0000000..1180dae --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvproj @@ -0,0 +1,599 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + usbh_hid + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 1 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbh_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + + + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities\LCD_common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usb_hw.c + 1 + ..\src\gd32f10x_usb_hw.c + + + usbh_usr.c + 1 + ..\src\usbh_usr.c + + + usbh_usr_lcd.c + 1 + ..\src\usbh_usr_lcd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + lcd_font.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + lcd_log.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + gd32f10x_lcd_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_host.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + drv_usbh_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + + USB_Host + + + usbh_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + usbh_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + usbh_pipe.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + usbh_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + USB_Class + + + usbh_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + + + usbh_standard_hid.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvprojx new file mode 100644 index 0000000..5984995 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/MDK-ARM/usbh_hid.uvprojx @@ -0,0 +1,592 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + usbh_hid + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 1 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbh_hid + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\hid;..\..\..\..\..\Utilities\LCD_common;..\..\..\..\..\Utilities + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usb_hw.c + 1 + ..\src\gd32f10x_usb_hw.c + + + usbh_usr.c + 1 + ..\src\usbh_usr.c + + + usbh_usr_lcd.c + 1 + ..\src\usbh_usr_lcd.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_Peripherals + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + lcd_font.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + lcd_log.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + gd32f10x_lcd_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_host.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + drv_usbh_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + + USB_Host + + + usbh_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + usbh_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + usbh_pipe.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + usbh_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + USB_Class + + + usbh_hid_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_hid_core.c + + + usbh_standard_hid.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\hid\Source\usbh_standard_hid.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_conf.h new file mode 100644 index 0000000..8c3c23a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_conf.h @@ -0,0 +1,111 @@ +/*! + \file usb_conf.h + \brief general low level driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "gd32f10x_lcd_eval.h" + +/****************** USB OTG FS PHY CONFIGURATION ******************************* + * The USB OTG FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ + +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + + +/******************************************************************************* + * FIFO Size Configuration in Host mode + * + * (i) Receive data FIFO size = (Largest Packet Size / 4) + 1 or + * 2x (Largest Packet Size / 4) + 1, If a + * high-bandwidth channel or multiple isochronous + * channels are enabled + * + * (ii) For the host non-periodic Transmit FIFO is the largest maximum packet size + * for all supported non-periodic OUT channels. Typically, a space + * corresponding to two Largest Packet Size is recommended. + * + * (iii) The minimum amount of RAM required for Host periodic Transmit FIFO is + * the largest maximum packet size for all supported periodic OUT channels. + * If there is at least one High Bandwidth Isochronous OUT endpoint, + * then the space must be at least two times the maximum packet size for + * that channel. +*******************************************************************************/ + +/****************** USB OTG FS CONFIGURATION **********************************/ +#ifdef USB_FS_CORE + #define USB_RX_FIFO_FS_SIZE 128U + #define USB_HTX_NPFIFO_FS_SIZE 96U + #define USB_HTX_PFIFO_FS_SIZE 96U +#endif + +#define USB_SOF_OUTPUT 0U +#define USB_LOW_POWER 0U /* if you want to test the host suspend and wakeup function, please set 1 */ + +//#define USB_FS_LOW_PWR_ENABLE + +/****************** USB OTG MODE CONFIGURATION ********************************/ +#define USE_HOST_MODE +//#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined" + #endif +#endif + +/****************** C Compilers dependent keywords ****************************/ +/* In HS mode and when the DMA is used, all variables and data structures dealing + with the DMA during the transaction process should be 4-bytes aligned */ + + #define __ALIGN_BEGIN + #define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined ( __GNUC__ ) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __CC_ARM */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_lcd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_lcd_conf.h new file mode 100644 index 0000000..24f6dd2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usb_lcd_conf.h @@ -0,0 +1,79 @@ +/*! + \file usb_lcd_conf.h + \brief LCD driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_LCD_CONF_H +#define __USB_LCD_CONF_H + +#include +#include "usb_conf.h" + +#define LCD_LOG_TEXT_COLOR LCD_COLOR_WHITE +#define LCD_LOG_DEFAULT_COLOR LCD_COLOR_WHITE + +#define YWINDOW_MIN 3U +#define YWINDOW_SIZE 8U + +#define LCD_HEADER_X 210U +#define LCD_HEADER_Y 0U + +#define LCD_FLAG_WIDTH 30U +#define LCD_FLAG_HEIGHT 320U + +#define LCD_FOOTER_X 0U +#define LCD_FOOTER_Y 0U + +#define LCD_TEXT_ZONE_X LCD_FLAG_WIDTH +#define LCD_TEXT_ZONE_Y 0U +#define LCD_TEXT_ZONE_WIDTH LCD_PIXEL_WIDTH - 2 * LCD_FLAG_WIDTH +#define LCD_TEXT_ZONE_HEIGHT LCD_PIXEL_HEIGHT + +#define LCD_TEXT_OFFSET 20U + +#define LCD_HEADER_LINE LCD_HEADER_X + LCD_TEXT_OFFSET +#define LCD_FOOTER_LINE LCD_FOOTER_X + LCD_TEXT_OFFSET + +#define LCD_HINT_LINE0 180U +#define LCD_HINT_LINE1 190U +#define LCD_HINT_LINE2 210U + +/* Redirect the printf to the LCD */ +#ifdef __GNUC__ + /* With GCC, small printf (option LD Linker->Libraries->Small printf + set to 'Yes') calls __io_putchar() */ + #define LCD_LOG_PUTCHAR int __io_putchar(int ch) +#else + #define LCD_LOG_PUTCHAR int fputc(int ch, FILE *f) +#endif /* __GNUC__ */ + +#endif /* __USB_LCD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_conf.h new file mode 100644 index 0000000..3c21363 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_conf.h @@ -0,0 +1,46 @@ +/*! + \file usbh_conf.h + \brief USB host driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_CONF_H +#define __USBH_CONF_H + +#define USBH_MAX_EP_NUM 2U +#define USBH_MAX_INTERFACES_NUM 2U +#define USBH_MAX_ALT_SETTING 2U +#define USBH_MAX_SUPPORTED_CLASS 2U + +#define USBH_DATA_BUF_MAX_LEN 0x200U +#define USBH_CFGSET_MAX_LEN 0x200U + +#endif /* __USBH_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr.h new file mode 100644 index 0000000..9382d15 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr.h @@ -0,0 +1,85 @@ +/*! + \file usbh_usr.h + \brief user application layer header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_USR_H +#define __USBH_USR_H + +#include "usbh_core.h" +#include "usbh_usr_lcd.h" +#include "usb_conf.h" +#include + +extern usbh_user_cb usr_cb; + +/* function declarations */ +/* user operation for host-mode initialization */ +void usbh_user_init (void); +/* deinitialize user state and associated variables */ +void usbh_user_deinit (void); +/* user operation for device attached */ +void usbh_user_device_connected (void); +/* user operation for unrecovered error happens */ +void usbh_user_unrecovered_error (void); +/* user operation for device disconnect event */ +void usbh_user_device_disconnected (void); +/* user operation for reset USB Device */ +void usbh_user_device_reset (void); +/* user action for device over current detection event */ +void usbh_user_over_current_detected (void); +/* user operation for detecting device speed */ +void usbh_user_device_speed_detected (uint32_t DeviceSpeed); +/* user operation when device descriptor is available */ +void usbh_user_device_desc_available (void *); +/* USB device is successfully assigned the address */ +void usbh_user_device_address_assigned (void); +/* user operation when configuration descriptor is available */ +void usbh_user_configuration_descavailable (usb_desc_config *cfgDesc, + usb_desc_itf *itfDesc, + usb_desc_ep *epDesc); +/* user operation when manufacturer string exists */ +void usbh_user_manufacturer_string (void *); +/* user operation when product string exists */ +void usbh_user_product_string (void *); +/* user operation when serial string exists */ +void usbh_user_serialnum_string (void *); +/* user response request is displayed to ask for application jump to class */ +void usbh_user_enumeration_finish (void); +/* user action for application state entry */ +usbh_user_status usbh_user_userinput (void); +/* user operation when device is not supported */ +void usbh_user_device_not_supported (void); +/* user operation for unrecovered error happens */ +void usbh_user_unrecovered_error (void); + +#endif /*__USBH_USR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr_lcd.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr_lcd.h new file mode 100644 index 0000000..51d94f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/inc/usbh_usr_lcd.h @@ -0,0 +1,119 @@ +/*! + \file usbh_usr_lcd.h + \brief the declarations for user routines for LCD + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_USR_LCD_H +#define __USBH_USR_LCD_H + +#include "usbh_hid_core.h" + +/* left button: report data: 0x00*/ +#define HID_MOUSE_LEFTBUTTON 0x00U + +/* right button: report data: 0x01*/ +#define HID_MOUSE_RIGHTBUTTON 0x01U + +/* middle button: report data: 0x02*/ +#define HID_MOUSE_MIDDLEBUTTON 0x02U + +/* mouse directions */ +#define MOUSE_TOP_DIR 0x80U +#define MOUSE_BOTTOM_DIR 0x00U +#define MOUSE_LEFT_DIR 0x80U +#define MOUSE_RIGHT_DIR 0x00U + +#define MOUSE_WINDOW_X 80U +#define MOUSE_WINDOW_Y 40U +#define MOUSE_WINDOW_HEIGHT 240U +#define MOUSE_WINDOW_WIDTH 110U +#define MOUSE_WINDOW_X_MAX MOUSE_WINDOW_HEIGHT +#define MOUSE_WINDOW_Y_MAX MOUSE_WINDOW_WIDTH + +#define MOUSE_BUTTON_HEIGHT 60U +#define MOUSE_BUTTON_WIDTH 30U +#define MOUSE_BUTTON_XCHORD 40U +#define MOUSE_BUTTON1_YCHORD 40U +#define MOUSE_BUTTON3_YCHORD 130U +#define MOUSE_BUTTON2_YCHORD 220U + +#define MOUSE_SPL_X 190U +#define MOUSE_SPL_Y 40U + +#define COMPUTE_XLOC(xloc, x) (xloc) += ((x) / 2) +#define COMPUTE_YLOC(yloc, y) (yloc) += ((y) / 2) + +#define Y_MIN 2U +#define X_MIN 2U + +#define MPL_X(x) MOUSE_SPL_Y + (x) +#define MPL_Y(y) MOUSE_SPL_X - (y) + +#define KYBRD_WINDOW_X 40U +#define KYBRD_WINDOW_Y 0U +#define KYBRD_WINDOW_WIDTH 150U +#define KYBRD_WINDOW_HEIGHT 320U + +#define KYBRD_FIRST_COLUMN (uint16_t)0 +#define KYBRD_LAST_COLUMN (uint16_t)320 +#define KYBRD_FIRST_LINE (uint16_t)185 +#define KYBRD_LAST_LINE (uint16_t)50 + +#define UPDATE_XP(xpos) (xpos) -= SMALL_FONT_LINE_WIDTH +#define UPDATE_YP(ypos) (ypos) += SMALL_FONT_COLUMN_WIDTH + +#define KYBRD_LINE_LIMIT(xline) ((xline) <= KYBRD_LAST_LINE) + +#define CHAR_CURSOR(x, y) (x), (y) + +#define MOUSE_LEFT_MOVE 1U +#define MOUSE_RIGHT_MOVE 2U +#define MOUSE_UP_MOVE 3U +#define MOUSE_DOWN_MOVE 4U + +#define HID_MOUSE_HEIGHTLSB 2U +#define HID_MOUSE_WIDTHLSB 2U +#define HID_MOUSE_RES_X 4U +#define HID_MOUSE_RES_Y 4U + +#define SMALL_FONT_COLUMN_WIDTH 8U +#define SMALL_FONT_LINE_WIDTH 16U + +/* function declarations */ +/* the function is to handle mouse scroll to update the mouse position on display window */ +void HID_MOUSE_UpdatePosition (int8_t X, int8_t Y); +/* the function is to handle mouse button press */ +void HID_MOUSE_ButtonPressed (uint8_t ButtonIdx); +/* the function is to handle mouse button release */ +void HID_MOUSE_ButtonReleased (uint8_t ButtonIdx); + +#endif /* __USBH_USR_LCD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/readme.txt new file mode 100644 index 0000000..d91427b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/readme.txt @@ -0,0 +1,60 @@ +/*! + \file readme.txt + \brief description of the usb host mode to control hid device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, and it provides a description of +how to use the USBFS host peripheral on the GD32F10x devices. + + When an USB Device is attached to the Host port, the device is enumerated and checked +whether it can support HID device, if the attached device is HID one, when the user +press the user key, the mouse or the keyboard application is launched. + + If a mouse has been attached, moving the mouse will print the position of the mouse and +the state of button through the serial port. + + If a keyboard has been attached, pressing the keyboard will print the state of the button +through the serial port. + +Note: In the USB Host HID class, two layouts are defined in the usbh_hid_keybd.h file + and could be used (Azerty and Querty) + //#define QWERTY_KEYBOARD + #define AZERTY_KEYBOARD + + The User can eventually add his own layout by editing the HID_KEYBRD_Key array + in the usbh_hid_keybd.c file. + + The demo support the functions of host suspend and wakup. The macro of USB_LOW_POWER can +be set to 1 to test the suspend and wakeup. If you want to use the general wakeup mode, please +press the CET key. If you want to use the remote wakeup mode, please operating device, such as +move the mouse or press the keyboard. If you want the program to continue running, please press +the CET key. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_it.c new file mode 100644 index 0000000..c51907c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_it.c @@ -0,0 +1,265 @@ +/*! + \file gd32f20x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbh_int.h" +#include "drv_usb_hw.h" + +extern usbh_host usb_host; +extern usb_core_driver usbh_core; + +extern void usb_timer_irq (void); + +#if USB_LOW_POWER +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); +#endif /* USB_LOW_POWER */ + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler (void) +{ + usbh_isr (&usbh_core); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +#if USB_LOW_POWER + +/*! + \brief this function handles external line 0 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler(void) +{ + if (exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE) != RESET) { + if (usb_host.suspend_flag == 1) { + usb_host.suspend_flag = 0; + usb_host.wakeup_mode = 1; /* general wakeup mode */ + + /* configure system clock */ + resume_mcu_clk(); + } + + /* clear the EXTI line pending bit */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} + +#endif /* USB_LOW_POWER */ + +#if USB_LOW_POWER + +/*! + \brief this function handles USBHS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usb_host.suspend_flag == 1) { + usb_host.suspend_flag = 0; + usb_host.wakeup_mode = 2; /* remote wakeup mode */ + + /* configure system clock */ + resume_mcu_clk(); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HXTAL */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HXTAL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} + +#endif /* USB_LOW_POWER */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_usb_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_usb_hw.c new file mode 100644 index 0000000..f6bc918 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/gd32f10x_usb_hw.c @@ -0,0 +1,296 @@ +/*! + \file gd32f10x_usb_hw.c + \brief this file implements the board support package for the USB host library + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U +#define HOST_OVRCURR_PORT GPIOE +#define HOST_OVRCURR_LINE GPIO_PIN_1 +#define HOST_OVRCURR_PORT_SOURCE GPIO_PORT_SOURCE_GPIOE +#define HOST_OVRCURR_PIN_SOURCE GPIO_PINSOURCE1 +#define HOST_OVRCURR_PORT_RCC RCC_APB2PERIPH_GPIOE +#define HOST_OVRCURR_EXTI_LINE EXTI_LINE1 +#define HOST_OVRCURR_IRQn EXTI1_IRQn + +#define HOST_POWERSW_PORT_RCC RCU_GPIOD +#define HOST_POWERSW_PORT GPIOD +#define HOST_POWERSW_VBUS GPIO_PIN_13 + +#define HOST_SOF_OUTPUT_RCC RCC_APB2PERIPH_GPIOA +#define HOST_SOF_PORT GPIOA +#define HOST_SOF_SIGNAL GPIO_PIN_8 + +__IO uint32_t delay_time = 0U; +__IO uint32_t usbfs_prescaler = 0U; +__IO uint16_t timer_prescaler = 5U; + +static void hwp_time_set (uint8_t unit); +static void hwp_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB GPIO + \param[in] none + \param[out] none + \retval none +*/ +void usb_gpio_config (void) +{ +#ifdef USB_OTG_FS_LOW_PWR_MGMT_SUPPORT + EXTI_InitPara EXTI_InitStructure; +#endif + +#ifdef USB_OTG_FS_LOW_PWR_MGMT_SUPPORT + + EXTI_ClearIntBitState(EXTI_LINE18); + + /* USB wakeup EXTI line configuration */ + EXTI_InitStructure.EXTI_LINE = EXTI_LINE18; + EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; + EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; + EXTI_InitStructure.EXTI_LINEEnable = ENABLE; + EXTI_Init(&EXTI_InitStructure); + +#endif +} + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB global interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config (void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + +#ifdef USB_LOW_POWER + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); + +#endif /* USB_LOW_POWER */ +} + +/*! + \brief drives the VBUS signal through GPIO + \param[in] state: VBUS states + \param[out] none + \retval none +*/ +void usb_vbus_drive (uint8_t state) +{ + if (0U == state){ + /* disable is needed on output of the power switch */ + gpio_bit_set(HOST_POWERSW_PORT, HOST_POWERSW_VBUS); + }else{ + /* enable the power switch by driving the enable low */ + gpio_bit_reset(HOST_POWERSW_PORT, HOST_POWERSW_VBUS); + } +} + +/*! + \brief configures the GPIO for the VBUS + \param[in] none + \param[out] none + \retval none +*/ +void usb_vbus_config (void) +{ + rcu_periph_clock_enable(HOST_POWERSW_PORT_RCC); + + gpio_init(HOST_POWERSW_PORT, GPIO_MODE_OUT_OD, GPIO_OSPEED_50MHZ, HOST_POWERSW_VBUS); + + /* by default, disable is needed on output of the power switch */ + usb_vbus_drive(0U); + + /* Delay is need for stabilizing the Vbus Low in Reset Condition, + * when Vbus=1 and Reset-button is pressed by user + */ + usb_mdelay (200U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* set the vector table base address at 0x08000000 */ + nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x00U); + + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the Timer2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hwp_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milliseconds + \param[in] msec: value of delay required in milliseconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hwp_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief timer base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x00U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] ntime: delay Time + \param[in] unit: delay Time unit = milliseconds / microseconds + \param[out] none + \retval none +*/ +static void hwp_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + hwp_time_set(unit); + + while(delay_time != 0); + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hwp_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (TIM_USEC_DELAY == unit) { + timer_basestructure.period = 11U; + } else if(TIM_MSEC_DELAY == unit) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* timer2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* timer2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/main.c new file mode 100644 index 0000000..386b93d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/main.c @@ -0,0 +1,69 @@ +/*! + \file main.c + \brief this file realizes the HID host + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "drv_usb_core.h" +#include "usbh_usr.h" +#include "usbh_hid_core.h" + +usbh_host usb_host; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + /* configure GPIO pin used for switching VBUS power and charge pump I/O */ + usb_vbus_config (); + + /* register device class */ + usbh_class_register (&usb_host, &usbh_hid); + + usbh_init (&usb_host, &usr_cb); + + /* enable interrupts */ + usb_intr_config (); + + while (1) { + /* Host state handler */ + usbh_core_task (&usb_host); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/system_gd32f10x.c new file mode 100644 index 0000000..1cebf90 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the micro-controller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr.c new file mode 100644 index 0000000..4f4957f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr.c @@ -0,0 +1,484 @@ +/*! + \file usbh_usr.c + \brief some user routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "lcd_log.h" +#include "usbh_usr.h" +#include "usbh_standard_hid.h" +#include "usb_lcd_conf.h" +#include "drv_usb_hw.h" +#include + +extern int16_t XLoc, YLoc; +extern __IO int16_t PrevX, PrevY; + +uint16_t keyboard_char_xpos = 0; +uint16_t keyboard_char_ypos = 0; + +extern usbh_host usb_host; +extern usb_core_driver usb_hid_core; + +/* Points to the usbh_user_cb structure of current device */ +usbh_user_cb usr_cb = +{ + usbh_user_init, + usbh_user_deinit, + usbh_user_device_connected, + usbh_user_device_reset, + usbh_user_device_disconnected, + usbh_user_over_current_detected, + usbh_user_device_speed_detected, + usbh_user_device_desc_available, + usbh_user_device_address_assigned, + usbh_user_configuration_descavailable, + usbh_user_manufacturer_string, + usbh_user_product_string, + usbh_user_serialnum_string, + usbh_user_enumeration_finish, + usbh_user_userinput, + NULL, + usbh_user_device_not_supported, + usbh_user_unrecovered_error +}; + +const uint8_t MSG_HOST_HEADER[] = "USB OTG FS HID Host"; +const uint8_t MSG_HOST_FOOTER[] = "USB Host Library v2.1.0"; + +/*! + \brief user operation for host-mode initialization + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_init(void) +{ + static uint8_t startup = 0U; + + if(0U == startup){ + startup = 1U; + + /* configure the User key */ + gd_eval_key_init(KEY_USER, KEY_MODE_GPIO); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); + + gd_eval_lcd_init(); + + lcd_log_init(); + + lcd_log_header_set((uint8_t *)MSG_HOST_HEADER, 60U); + + LCD_UsrLog("USB host library started\n"); + + lcd_log_footer_set((uint8_t *)MSG_HOST_FOOTER, 40U); + } +} + +/*! + \brief deinitialize user state and associated variables + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_deinit(void) +{ + +} + +/*! + \brief user operation for device attached + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_connected(void) +{ + LCD_UsrLog("> Device Attached.\n"); +} + +/*! + \brief user operation for unrecovered error happens + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_unrecovered_error (void) +{ + LCD_ErrLog("> UNRECOVERED ERROR STATE.\n"); +} + +/*! + \brief user operation for device disconnect event + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_disconnected (void) +{ + lcd_background_color_set(LCD_COLOR_BLACK); + lcd_text_color_set(LCD_COLOR_BLACK); + + lcd_log_textzone_clear (LCD_TEXT_ZONE_X, + LCD_TEXT_ZONE_Y, + LCD_TEXT_ZONE_WIDTH, + LCD_TEXT_ZONE_HEIGHT); + + LCD_UsrLog("> Device Disconnected.\n"); +} + +/*! + \brief user operation for reset USB Device + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_reset(void) +{ + /* users can do their application actions here for the USB-Reset */ + LCD_UsrLog("> Reset the USB device.\n"); +} + +/*! + \brief user operation for detecting device speed + \param[in] DeviceSpeed: device speed + \param[out] none + \retval none +*/ +void usbh_user_device_speed_detected(uint32_t device_speed) +{ + if (PORT_SPEED_HIGH == device_speed) { + LCD_UsrLog("> High speed device detected.\r\n"); + } else if(PORT_SPEED_FULL == device_speed) { + LCD_UsrLog("> Full speed device detected.\r\n"); + } else if(PORT_SPEED_LOW == device_speed) { + LCD_UsrLog("> Low speed device detected.\r\n"); + } else { + LCD_ErrLog("> Device Fault.\r\n"); + } +} + +/*! + \brief user operation when device descriptor is available + \param[in] DeviceDesc: device descriptor + \param[out] none + \retval none +*/ +void usbh_user_device_desc_available(void *device_desc) +{ + usb_desc_dev *pDevStr = device_desc; + + LCD_DevInformation("VID: %04Xh\n", (uint32_t)pDevStr->idVendor); + LCD_DevInformation("PID: %04Xh\n", (uint32_t)pDevStr->idProduct); +} + +/*! + \brief USB device is successfully assigned the address + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_address_assigned(void) +{ + +} + +/*! + \brief user operation when configuration descriptor is available + \param[in] cfg_desc: pointer to configuration descriptor + \param[in] itf_desc: pointer to interface descriptor + \param[in] ep_desc: pointer to endpoint descriptor + \param[out] none + \retval none +*/ +void usbh_user_configuration_descavailable(usb_desc_config *cfg_desc, + usb_desc_itf *itf_desc, + usb_desc_ep *ep_desc) +{ + usb_desc_itf *id = itf_desc; + + if (0x08U == (*id).bInterfaceClass) { + LCD_UsrLog("> Mass storage device connected.\n"); + } else if (0x03U == (*id).bInterfaceClass) { + LCD_UsrLog("> HID device connected.\n"); + } +} + +/*! + \brief user operation when manufacturer string exists + \param[in] manufacturer_string: manufacturer string of usb device + \param[out] none + \retval none +*/ +void usbh_user_manufacturer_string(void *manufacturer_string) +{ + LCD_DevInformation("Manufacturer: %s\r\n", (char *)manufacturer_string); +} + +/*! + \brief user operation when product string exists + \param[in] product_string: product string of usb device + \param[out] none + \retval none +*/ +void usbh_user_product_string(void *product_string) +{ + LCD_DevInformation("Product: %s\r\n", (char *)product_string); +} + +/*! + \brief user operation when serial string exists + \param[in] serial_num_string: serialNum string of usb device + \param[out] none + \retval none +*/ +void usbh_user_serialnum_string(void *serial_num_string) +{ + LCD_DevInformation("Serial Number: %s\r\n", (char *)serial_num_string); +} + +/*! + \brief user response request is displayed to ask for application jump to class + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_enumeration_finish(void) +{ + LCD_UsrLog("> Enumeration completed.\n"); + + lcd_text_color_set(LCD_COLOR_RED); + lcd_vertical_string_display(LCD_HINT_LINE0, 0, (uint8_t *)"---------------------------------------"); + lcd_text_color_set(LCD_COLOR_GREEN); + lcd_vertical_string_display(LCD_HINT_LINE1, 0, (uint8_t *)"To start the HID class operations: "); + lcd_vertical_string_display(LCD_HINT_LINE2, 0, (uint8_t *)"Press User Key... "); +} + +/*! + \brief user operation when device is not supported + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_not_supported(void) +{ + LCD_ErrLog("> Device not supported.\n"); +} + +/*! + \brief user action for application state entry + \param[in] none + \param[out] none + \retval user response for user key +*/ +usbh_user_status usbh_user_userinput(void) +{ + usbh_user_status usbh_usr_status = USR_IN_NO_RESP; + +#if USB_LOW_POWER + + if(usb_host.suspend_flag){ + LCD_UsrLog("> Host in suspend status.\n"); + LCD_UsrLog("> Pls press KEY_WAKEUP key (General wakeup).\n"); + LCD_UsrLog("> Or operate device (Remote wakeup).\n"); + }else{ + if(usb_host.wakeup_mode == 1){ + usb_host.wakeup_mode = 0; + LCD_UsrLog("> General wakeup success.\n"); + }else if(usb_host.wakeup_mode == 2){ + usb_host.wakeup_mode = 0; + LCD_UsrLog("> Remote wakeup success.\n"); + }else{ + } + } +#endif /* USB_LOW_POWER */ + + /*Key B3 is in polling mode to detect user action */ + if(RESET == gd_eval_key_state_get(KEY_USER)){ + usbh_usr_status = USR_IN_RESP_OK; + } + + return usbh_usr_status; +} + +/*! + \brief user action for device over current detection event + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_over_current_detected (void) +{ + LCD_ErrLog("> Over current detected.\n"); +} + +/*! + \brief initialize mouse window + \param[in] none + \param[out] none + \retval none +*/ +void usr_mouse_init (void) +{ + LCD_UsrLog("> HID Demo Device : Mouse.\n"); + + lcd_text_color_set(LCD_COLOR_BLACK); + + lcd_log_textzone_clear (LCD_TEXT_ZONE_X, + LCD_TEXT_ZONE_Y, + LCD_TEXT_ZONE_WIDTH, + LCD_TEXT_ZONE_HEIGHT); + + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(MOUSE_WINDOW_X, MOUSE_WINDOW_Y, MOUSE_WINDOW_WIDTH, MOUSE_WINDOW_HEIGHT); + + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, MOUSE_BUTTON1_YCHORD, MOUSE_BUTTON_WIDTH, MOUSE_BUTTON_HEIGHT); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, MOUSE_BUTTON3_YCHORD, MOUSE_BUTTON_WIDTH, MOUSE_BUTTON_HEIGHT); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, MOUSE_BUTTON2_YCHORD, MOUSE_BUTTON_WIDTH, MOUSE_BUTTON_HEIGHT); + + lcd_text_color_set(LCD_COLOR_BLACK); + lcd_background_color_set(LCD_COLOR_WHITE); + lcd_vertical_char_display(MOUSE_SPL_X, MOUSE_SPL_Y, 'x'); + + HID_MOUSE_ButtonReleased(0U); + HID_MOUSE_ButtonReleased(1U); + HID_MOUSE_ButtonReleased(2U); + + XLoc = 0U; + YLoc = 0U; + PrevX = 0U; + PrevY = 0U; +} + +/*! + \brief process mouse data + \param[in] none + \param[out] none + \retval none +*/ +void usr_mouse_process_data (hid_mouse_info *data) +{ + if ((0U != data->x) && (0U != data->y)) { + HID_MOUSE_UpdatePosition(data->x, data->y); + } + + for (uint8_t index = 0U; index < 3U; index++) { + if (data->buttons[index]) { + HID_MOUSE_ButtonPressed(index); + } else { + HID_MOUSE_ButtonReleased(index); + } + } +} + +/*! + \brief initialize keyboard window + \param[in] none + \param[out] none + \retval none +*/ +void usr_keyboard_init (void) +{ + LCD_UsrLog("> HID Demo Device : Keyboard.\n"); + LCD_UsrLog("> Use Keyboard to tape characters: \n"); + + lcd_text_color_set(LCD_COLOR_BLACK); + + lcd_log_textzone_clear (LCD_TEXT_ZONE_X, + LCD_TEXT_ZONE_Y, + LCD_TEXT_ZONE_WIDTH, + LCD_TEXT_ZONE_HEIGHT); + + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(KYBRD_WINDOW_X, KYBRD_WINDOW_Y, KYBRD_WINDOW_WIDTH, KYBRD_WINDOW_HEIGHT); + + keyboard_char_xpos = KYBRD_FIRST_LINE; + keyboard_char_ypos = KYBRD_FIRST_COLUMN; +} + +/*! + \brief process keyboard data + \param[in] data: keyboard data to be displayed + \param[out] none + \retval none +*/ +void usr_keybrd_process_data (uint8_t data) +{ + if('\n' == data){ + keyboard_char_ypos = KYBRD_FIRST_COLUMN; + + /* increment char X position */ + UPDATE_XP(keyboard_char_xpos); + }else if('\r' == data) { + /* manage deletion of character and update cursor location */ + if(KYBRD_FIRST_COLUMN == keyboard_char_ypos){ + /* first character of first line to be deleted */ + if(KYBRD_FIRST_LINE == keyboard_char_xpos){ + keyboard_char_ypos = KYBRD_FIRST_COLUMN; + }else{ + UPDATE_XP(keyboard_char_xpos); + keyboard_char_ypos =(KYBRD_LAST_COLUMN + SMALL_FONT_COLUMN_WIDTH); + } + }else{ + UPDATE_YP(keyboard_char_ypos); + } + + lcd_text_color_set(LCD_COLOR_BLACK); + lcd_background_color_set(LCD_COLOR_WHITE); + lcd_vertical_char_display(CHAR_CURSOR(keyboard_char_xpos, keyboard_char_ypos), '\0'); + }else{ + lcd_text_color_set(LCD_COLOR_BLACK); + lcd_background_color_set(LCD_COLOR_WHITE); + lcd_vertical_char_display(CHAR_CURSOR(keyboard_char_xpos, keyboard_char_ypos), data); + + /* update the cursor position on LCD */ + + /* increment char Y position */ + UPDATE_YP(keyboard_char_ypos); + + /*check if the Y position has reached the last column*/ + if(KYBRD_LAST_COLUMN == keyboard_char_ypos) + { + keyboard_char_ypos = KYBRD_FIRST_COLUMN; + + /*Increment char X position*/ + UPDATE_XP(keyboard_char_xpos); + } + } + + if(KYBRD_LINE_LIMIT(keyboard_char_xpos)) + { + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(KYBRD_WINDOW_X, KYBRD_WINDOW_Y, KYBRD_WINDOW_WIDTH, KYBRD_WINDOW_HEIGHT); + + keyboard_char_xpos = KYBRD_FIRST_LINE; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr_lcd.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr_lcd.c new file mode 100644 index 0000000..da16546 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_hid_keyboard_mouse/src/usbh_usr_lcd.c @@ -0,0 +1,168 @@ +/*! + \file usbh_usr_lcd.c + \brief some user routines for LCD + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_usr_lcd.h" +#include "usb_conf.h" +#include "lcd_log.h" + +int16_t XLoc = 0, YLoc = 0; +int16_t PrevX = 0, PrevY = 0; + +/*! + \brief the function is to handle mouse scroll to update the mouse position on display window + \param[in] X: USB HID mouse X co-ordinate + \param[in] Y: USB HID mouse Y co-ordinate + \param[out] none + \retval none +*/ +void HID_MOUSE_UpdatePosition (int8_t X, int8_t Y) +{ + if ((0 != X) || (0 != Y)) { + COMPUTE_XLOC(XLoc, X); + COMPUTE_YLOC(YLoc, Y); + + if(YLoc > MOUSE_WINDOW_Y_MAX - 16) { + YLoc = MOUSE_WINDOW_Y_MAX - 16; + } + + if(XLoc > MOUSE_WINDOW_X_MAX - 8) { + XLoc = MOUSE_WINDOW_X_MAX - 8; + } + + if(YLoc < Y_MIN) { + YLoc = Y_MIN; + } + + if(XLoc < X_MIN) { + XLoc = X_MIN; + } + + lcd_text_color_set(LCD_COLOR_WHITE); + lcd_background_color_set(LCD_COLOR_WHITE); + lcd_vertical_char_display(MPL_Y(PrevY), MPL_X(PrevX), 'x'); + + lcd_text_color_set(LCD_COLOR_BLACK); + lcd_background_color_set(LCD_COLOR_WHITE); + lcd_vertical_char_display(MPL_Y(YLoc), MPL_X(XLoc), 'x'); + + PrevX = XLoc; + PrevY = YLoc; + } +} + +/*! + \brief the function is to handle mouse button press + \param[in] button_idx: mouse button pressed + \param[in] none + \param[out] none + \retval none +*/ +void HID_MOUSE_ButtonPressed(uint8_t button_idx) +{ + /* change the color of button pressed to indicate button press*/ + switch (button_idx){ + /* left button pressed */ + case HID_MOUSE_LEFTBUTTON: + lcd_text_color_set(LCD_COLOR_MAGENTA); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON2_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + /* right button pressed */ + case HID_MOUSE_RIGHTBUTTON: + lcd_text_color_set(LCD_COLOR_MAGENTA); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON1_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + /* middle button pressed */ + case HID_MOUSE_MIDDLEBUTTON: + lcd_text_color_set(LCD_COLOR_MAGENTA); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON3_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + default: + break; + } +} + +/*! + \brief the function is to handle mouse button release + \param[in] button_idx: mouse button released + \param[in] none + \param[out] none + \retval none +*/ +void HID_MOUSE_ButtonReleased(uint8_t button_idx) +{ + /* change the color of button released to default button color*/ + switch (button_idx){ + /* left button released */ + case HID_MOUSE_LEFTBUTTON: + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON2_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + /* right button released */ + case HID_MOUSE_RIGHTBUTTON: + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON1_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + /* middle button released */ + case HID_MOUSE_MIDDLEBUTTON: + lcd_text_color_set(LCD_COLOR_GREY); + lcd_rectangle_fill(MOUSE_BUTTON_XCHORD, + MOUSE_BUTTON3_YCHORD, + MOUSE_BUTTON_WIDTH, + MOUSE_BUTTON_HEIGHT); + break; + + default: + break; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewd new file mode 100644 index 0000000..6c4728d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewd @@ -0,0 +1,1374 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewp new file mode 100644 index 0000000..38f8faa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewp @@ -0,0 +1,1087 @@ + + + + 2 + + USBFS + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usb_hw.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\usbh_usr.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + FAT_FS + + $PROJ_DIR$\..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_fatfs.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_scsi.c + + + + USB_Driver + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + USB_Host + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewt new file mode 100644 index 0000000..cbfe3e8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.ewt @@ -0,0 +1,1186 @@ + + + + 2 + + USBFS + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\src\gd32f10x_it.c + + + $PROJ_DIR$\..\src\gd32f10x_usb_hw.c + + + $PROJ_DIR$\..\src\main.c + + + $PROJ_DIR$\..\src\usbh_usr.c + + + + CMSIS + + $PROJ_DIR$\..\src\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + FAT_FS + + $PROJ_DIR$\..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + + + + GD32F10x_EVAL + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + $PROJ_DIR$\..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + + GD32F10x_Peripherals + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + Startup + + $PROJ_DIR$\..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + + USB_Class + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\class\msc\Source\usbh_msc_bbb.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\class\msc\Source\usbh_msc_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\class\msc\Source\usbh_msc_fatfs.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\class\msc\Source\usbh_msc_scsi.c + + + + USB_Driver + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usb_host.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\driver\Source\drv_usbh_int.c + + + + USB_Host + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\core\Source\usbh_core.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\core\Source\usbh_enum.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\core\Source\usbh_pipe.c + + + $PROJ_DIR$\..\..\..\..\..\Firmware\GD32F10x_usbfs_driver\host\core\Source\usbh_transc.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.eww new file mode 100644 index 0000000..6537ede --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/EWARM/usbh_msc.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\usbh_msc.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvopt new file mode 100644 index 0000000..50395ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvopt @@ -0,0 +1,818 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + + + + 0 + 0 + + + + usbh_msc + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + JL2CM3 + -U59701280 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + + + + + 0 + 0 + 408 + 1 +
134245736
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+ + 1 + 0 + 390 + 1 +
134245662
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+ + 2 + 0 + 335 + 1 +
134245498
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+
+ + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 10 + 0 + 0 + 0 + 0 + ..\src\usbh_usr.c + usbh_usr.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 20 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 26 + 0 + 0 + 0 + 0 + ..\src\gd32f10x_usb_hw.c + gd32f10x_usb_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + lcd_font.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + lcd_log.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + gd32f10x_lcd_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 18 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + drv_usb_host.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 9 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + drv_usbh_int.c + 0 + 0 + + + + + USB_Host + 0 + 0 + 0 + 0 + + 6 + 21 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + usbh_core.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + usbh_enum.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + usbh_pipe.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + usbh_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 25 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_bbb.c + usbh_msc_bbb.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_core.c + usbh_msc_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_fatfs.c + usbh_msc_fatfs.c + 0 + 0 + + + 7 + 28 + 1 + 0 + 0 + 54 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_scsi.c + usbh_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 29 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + FAT_FS + 0 + 0 + 0 + 0 + + 9 + 30 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + ff.c + 0 + 0 + + + 9 + 31 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + ffunicode.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 10 + 32 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvoptx new file mode 100644 index 0000000..279377b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvoptx @@ -0,0 +1,713 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + usbh_msc + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + + + 0 + JL2CM3 + -U59701280 -O207 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + + + 0 + 0 + 408 + 1 +
134245736
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+ + 1 + 0 + 390 + 1 +
134245662
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+ + 2 + 0 + 335 + 1 +
134245498
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\src\usbh_usr.c + + +
+
+ + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\src\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\src\usbh_usr.c + usbh_usr.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\src\gd32f10x_usb_hw.c + gd32f10x_usb_hw.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\src\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + GD32F10x_StdPeriph_Driver + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + + + GD32F10x_EVAL + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + lcd_font.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + lcd_log.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + gd32f10x_lcd_eval.c + 0 + 0 + + + + + USB_Driver + 0 + 0 + 0 + 0 + + 5 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + drv_usb_core.c + 0 + 0 + + + 5 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + drv_usb_host.c + 0 + 0 + + + 5 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + drv_usbh_int.c + 0 + 0 + + + + + USB_Host + 0 + 0 + 0 + 0 + + 6 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + usbh_core.c + 0 + 0 + + + 6 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + usbh_enum.c + 0 + 0 + + + 6 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + usbh_pipe.c + 0 + 0 + + + 6 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + usbh_transc.c + 0 + 0 + + + + + USB_Class + 0 + 0 + 0 + 0 + + 7 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_bbb.c + usbh_msc_bbb.c + 0 + 0 + + + 7 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_core.c + usbh_msc_core.c + 0 + 0 + + + 7 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_fatfs.c + usbh_msc_fatfs.c + 0 + 0 + + + 7 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_scsi.c + usbh_msc_scsi.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 8 + 29 + 2 + 0 + 0 + 0 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + + + FAT_FS + 0 + 0 + 0 + 0 + + 9 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + ff.c + 0 + 0 + + + 9 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + ffunicode.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 10 + 32 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvproj new file mode 100644 index 0000000..7063707 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvproj @@ -0,0 +1,619 @@ + + + + 1.1 + +
### uVision Project, (C) Keil Software
+ + + + usbh_msc + 0x4 + ARM-ADS + + + GD32F107VC + GigaDevice + IRAM(0x20000000-0x20017FFF) IROM(0x08000000-0x0803FFFF) CLOCK(25000000) CPUTYPE("Cortex-M3") + + "Startup\GD\GD32F10x\startup_gd32f10x_cl.s" ("GD32F10xStartup Code") + UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + 0 + gd32f10x.h + + + + + + + -DGD32F10X_CL + + + SFD\GD\GD32F10x\GD32F10x_CL.SFR + 1 + 0 + + + + GD\GD32F10x\ + GD\GD32F10x\ + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbh_msc + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 4 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + + + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities;..\..\..\..\..\Utilities\LCD_common;..\..\..\..\..\Utilities\Third_Party\fat_fs\inc + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + usbh_usr.c + 1 + ..\src\usbh_usr.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usb_hw.c + 1 + ..\src\gd32f10x_usb_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + lcd_font.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + lcd_log.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + gd32f10x_lcd_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_host.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + drv_usbh_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + + USB_Host + + + usbh_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + usbh_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + usbh_pipe.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + usbh_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + USB_Class + + + usbh_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_bbb.c + + + usbh_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_core.c + + + usbh_msc_fatfs.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_fatfs.c + + + usbh_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + FAT_FS + + + ff.c + 1 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + + + ffunicode.c + 1 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvprojx new file mode 100644 index 0000000..fbc6166 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/MDK-ARM/usbh_msc.uvprojx @@ -0,0 +1,612 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + usbh_msc + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + GD32F107VC + GigaDevice + GigaDevice.GD32F10x_DFP.2.0.1 + http://gd32mcu.com/data/documents/pack/ + IRAM(0x20000000,0x00018000) IROM(0x08000000,0x00040000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000 -FP0($$Device:GD32F107VC$Flash\GD32F10x_CL.FLM)) + 0 + $$Device:GD32F107VC$Device\Include\gd32f10x.h + + + + + + + + + + $$Device:GD32F107VC$SVD\GD32F10x\GD32F10x_CL.svd + 1 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\object\ + usbh_msc + 1 + 0 + 1 + 1 + 1 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP + DCM.DLL + -pCM3 + SARMCM3.DLL + + TCM.DLL + -pCM3 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M3" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x18000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 4 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_STDPERIPH_DRIVER,USE_USB_FS,GD32F10X_CL + + ..\inc;..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Include;..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Include;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\common;..\..\..\..\..\Firmware\GD32F10x_usbfs_library\ustd\class\msc;..\..\..\..\..\Utilities;..\..\..\..\..\Utilities\LCD_common;..\..\..\..\..\Utilities\Third_Party\fat_fs\inc + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x8000000 + 0x20000000 + + + + + + + + + + + + + Application + + + main.c + 1 + ..\src\main.c + + + usbh_usr.c + 1 + ..\src\usbh_usr.c + + + gd32f10x_it.c + 1 + ..\src\gd32f10x_it.c + + + gd32f10x_usb_hw.c + 1 + ..\src\gd32f10x_usb_hw.c + + + + + CMSIS + + + system_gd32f10x.c + 1 + ..\src\system_gd32f10x.c + + + + + GD32F10x_StdPeriph_Driver + + + gd32f10x_exmc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + gd32f10x_exti.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + gd32f10x_gpio.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + gd32f10x_misc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + gd32f10x_pmu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + gd32f10x_rcu.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + gd32f10x_timer.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + gd32f10x_usart.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + + + GD32F10x_EVAL + + + lcd_font.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_font.c + + + lcd_log.c + 1 + ..\..\..\..\..\Utilities\LCD_common\lcd_log.c + + + gd32f10x_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_eval.c + + + gd32f10x_lcd_eval.c + 1 + ..\..\..\..\..\Utilities\gd32f10x_lcd_eval.c + + + + + USB_Driver + + + drv_usb_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_core.c + + + drv_usb_host.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usb_host.c + + + drv_usbh_int.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\driver\Source\drv_usbh_int.c + + + + + USB_Host + + + usbh_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_core.c + + + usbh_enum.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_enum.c + + + usbh_pipe.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_pipe.c + + + usbh_transc.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\core\Source\usbh_transc.c + + + + + USB_Class + + + usbh_msc_bbb.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_bbb.c + + + usbh_msc_core.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_core.c + + + usbh_msc_fatfs.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_fatfs.c + + + usbh_msc_scsi.c + 1 + ..\..\..\..\..\Firmware\GD32F10x_usbfs_library\host\class\msc\Source\usbh_msc_scsi.c + + + + + Startup + + + startup_gd32f10x_cl.s + 2 + ..\..\..\..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + + + + + FAT_FS + + + ff.c + 1 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ff.c + + + ffunicode.c + 1 + ..\..\..\..\..\Utilities\Third_Party\fat_fs\src\ffunicode.c + + + + + Doc + + + readme.txt + 5 + ..\readme.txt + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_it.h new file mode 100644 index 0000000..8cb3788 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_IT_H +#define __GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* __GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_libopt.h new file mode 100644 index 0000000..92dd1e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __GD32F10X_LIBOPT_H +#define __GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* __GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_conf.h new file mode 100644 index 0000000..caf62b2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_conf.h @@ -0,0 +1,109 @@ +/*! + \file usb_conf.h + \brief general low level driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CONF_H +#define __USB_CONF_H + +#include "gd32f10x.h" +#include "gd32f10x_eval.h" +#include "gd32f10x_lcd_eval.h" +#include "lcd_log.h" +#include "usb_lcd_conf.h" + +/****************** USBFS PHY CONFIGURATION ******************************* + * The USB OTG FS Core supports one on-chip Full Speed PHY. + * The USE_EMBEDDED_PHY symbol is defined in the project compiler preprocessor + * when FS core is used. +*******************************************************************************/ +#ifdef USE_USB_FS + #define USB_FS_CORE +#endif + +/******************************************************************************* + * FIFO Size Configuration in Host mode + * + * (i) Receive data FIFO size = (Largest Packet Size / 4) + 1 or + * 2x (Largest Packet Size / 4) + 1, If a + * high-bandwidth channel or multiple isochronous + * channels are enabled. + * + * (ii) For the host non periodic Transmit FIFO is the largest maximum packet size + * for all supported non periodic OUT channels. Typically, a space + * corresponding to two Largest Packet Size is recommended. + * + * (iii) The minimum amount of RAM required for Host periodic Transmit FIFO is + * the largest maximum packet size for all supported periodic OUT channels. + * If there is at least one High Bandwidth Isochronous OUT endpoint, + * then the space must be at least two times the maximum packet size for + * that channel. +*******************************************************************************/ + +/****************** USBFS CONFIGURATION **********************************/ +#ifdef USB_FS_CORE + #define USB_RX_FIFO_FS_SIZE 128U + #define USB_HTX_NPFIFO_FS_SIZE 96U + #define USB_HTX_PFIFO_FS_SIZE 96U +#endif + +#define USB_SOF_OUTPUT 0U +#define USB_LOW_POWER 0U /* if you want to test the host suspend and wakeup function, please set 1 */ + +/****************** USB OTG MODE CONFIGURATION ********************************/ +#define USE_HOST_MODE +//#define USE_DEVICE_MODE +//#define USE_OTG_MODE + +#ifndef USE_DEVICE_MODE + #ifndef USE_HOST_MODE + #error "USE_DEVICE_MODE or USE_HOST_MODE should be defined" + #endif +#endif + +/****************** C Compilers dependent keywords ****************************/ +/* In HS mode and when the DMA is used, all variables and data structures dealing + with the DMA during the transaction process should be 4-bytes aligned */ + +#define __ALIGN_BEGIN +#define __ALIGN_END + +/* __packed keyword used to decrease the data type alignment to 1-byte */ +#if defined ( __GNUC__ ) /* GNU Compiler */ + #ifndef __packed + #define __packed __attribute__ ((__packed__)) + #endif +#elif defined (__TASKING__) /* TASKING Compiler */ + #define __packed __unaligned +#endif /* __GNUC__ */ + +#endif /* __USB_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_lcd_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_lcd_conf.h new file mode 100644 index 0000000..0deb018 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usb_lcd_conf.h @@ -0,0 +1,82 @@ +/*! + \file usb_lcd_conf.h + \brief LCD driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_LCD_CONF_H +#define __USB_LCD_CONF_H + +#include +#include "usb_conf.h" + +#define LCD_LOG_TEXT_COLOR LCD_COLOR_WHITE +#define LCD_LOG_DEFAULT_COLOR LCD_COLOR_WHITE + +/* define the cache depth */ +#define CACHE_SIZE 100U + +#define YWINDOW_MIN 3U +#define YWINDOW_SIZE 8U + +#define LCD_HEADER_X 0U +#define LCD_HEADER_Y 0U + +#define LCD_FLAG_WIDTH 30U +#define LCD_FLAG_HEIGHT 320U + +#define LCD_FOOTER_X 210U +#define LCD_FOOTER_Y 0U + +#define LCD_TEXT_ZONE_X LCD_FLAG_WIDTH +#define LCD_TEXT_ZONE_Y 0 +#define LCD_TEXT_ZONE_WIDTH LCD_PIXEL_WIDTH - 2 * LCD_FLAG_WIDTH +#define LCD_TEXT_ZONE_HEIGHT LCD_PIXEL_HEIGHT + +#define LCD_TEXT_OFFSET 20U + +#define LCD_HEADER_LINE LCD_HEADER_X + LCD_TEXT_OFFSET +#define LCD_FOOTER_LINE LCD_FOOTER_X + LCD_TEXT_OFFSET + +#define LCD_HINT_LINE0 180U +#define LCD_HINT_LINE1 190U +#define LCD_HINT_LINE2 210U + +/* redirect the printf to the LCD */ +#ifdef __GNUC__ + /* With GCC, small printf (option LD Linker->Libraries->Small printf + set to 'Yes') calls __io_putchar() */ + #define LCD_LOG_PUTCHAR int __io_putchar(int ch) +#else + #define LCD_LOG_PUTCHAR int fputc(int ch, FILE *f) +#endif /* __GNUC__ */ + +#endif /* __USB_LCD_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_conf.h new file mode 100644 index 0000000..ca9133a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_conf.h @@ -0,0 +1,46 @@ +/*! + \file usbh_conf.h + \brief USB host driver configuration + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_CONF_H +#define __USBH_CONF_H + +#define USBH_MAX_EP_NUM 7U +#define USBH_MAX_INTERFACES_NUM 2U +#define USBH_MAX_ALT_SETTING 2U +#define USBH_MAX_SUPPORTED_CLASS 2U + +#define USBH_DATA_BUF_MAX_LEN 0x200U +#define USBH_CFGSET_MAX_LEN 0x200U + +#endif /* __USBH_CONF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_usr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_usr.h new file mode 100644 index 0000000..f542922 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/inc/usbh_usr.h @@ -0,0 +1,94 @@ +/*! + \file usbh_usr.c + \brief USB host user callbacks + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_USR_H +#define __USBH_USR_H + +#include "ff.h" +#include "usbh_core.h" +#include "usb_conf.h" +#include "usbh_core.h" +#include + +extern usbh_user_cb usr_cb; + +/* State Machine for the USBH_USR_ApplicationState */ +#define USBH_USR_FS_INIT 0U +#define USBH_USR_FS_READLIST 1U +#define USBH_USR_FS_WRITEFILE 2U +#define USBH_USR_FS_DRAW 3U +#define USBH_USR_FS_DEMOEND 4U + +extern uint8_t USBH_USR_ApplicationState; + +/* user operation for host-mode initialization */ +void usbh_user_init (void); +/* deinitialize user state and associated variables */ +void usbh_user_deinit (void); +/* user operation for device attached */ +void usbh_user_device_connected (void); +/* user operation for reset USB Device */ +void usbh_user_device_reset (void); +/* user operation for device disconnect event */ +void usbh_user_device_disconnected (void); +/* user operation for device over current detection event */ +void usbh_user_over_current_detected (void); +/* user operation for detecting device speed */ +void usbh_user_device_speed_detected (uint32_t DeviceSpeed); +/* user operation when device descriptor is available */ +void usbh_user_device_desc_available (void *); +/* usb device is successfully assigned the address */ +void usbh_user_device_address_assigned (void); +/* user operation when configuration descriptor is available */ +void usbh_user_configuration_descavailable (usb_desc_config *cfgDesc, + usb_desc_itf *itfDesc, + usb_desc_ep *epDesc); +/* user operation when manufacturer string exists */ +void usbh_user_manufacturer_string (void *); +/* user operation when product string exists */ +void usbh_user_product_string (void *); +/* user operation when serialNum string exists */ +void usbh_user_serialnum_string (void *); +/* user response request is displayed to ask for application jump to class */ +void usbh_user_enumeration_finish (void); +/* user action for application state entry */ +usbh_user_status usbh_user_userinput (void); +/* user operation when device is not supported */ +void usbh_user_device_not_supported (void); +/* user operation when unrecovered error happens */ +void usbh_user_unrecovered_error (void); +/* demo application for mass storage */ +int usbh_usr_msc_application (void); + +#endif /*__USBH_USR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/readme.txt new file mode 100644 index 0000000..9503521 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/readme.txt @@ -0,0 +1,43 @@ +/*! + \file readme.txt + \brief Description of the USB host mode to control MSC device + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL board, and it provides a description of how +to use the USBFS host peripheral on the GD32F10X devices. + + Insert the OTG cable to the USB_FS port. Then download it to the EVAL board and run. + + If an U-disk has been attached, the user will see the information of U-disk enumeration. +First pressing the user key will see the U-disk information, next pressing the tamper key +will see the root content of the U-disk, then press the wakeup key will write file to the +U-disk, finally the user will see information that the msc host demo is end. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_it.c new file mode 100644 index 0000000..b1dbea5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_it.c @@ -0,0 +1,263 @@ +/*! + \file gd32f20x_it.c + \brief main interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "drv_usbh_int.h" +#include "drv_usb_hw.h" + +extern usbh_host usb_host; +extern usb_core_driver usbh_core; + +extern void usb_timer_irq (void); + +#if USB_LOW_POWER +/* local function prototypes ('static') */ +static void resume_mcu_clk(void); +#endif /* USB_LOW_POWER */ +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1); +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ +} + +/*! + \brief this function handles USBFS interrupt + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_IRQHandler(void) +{ + usbh_isr (&usbh_core); +} + +/*! + \brief this function handles Timer2 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void TIMER2_IRQHandler(void) +{ + usb_timer_irq(); +} + +#if USB_LOW_POWER +/*! + \brief this function handles external line 0 interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void EXTI0_IRQHandler(void) +{ + if (exti_interrupt_flag_get(WAKEUP_KEY_EXTI_LINE) != RESET) { + if (usb_host.suspend_flag == 1) { + usb_host.suspend_flag = 0; + /* general wakeup mode */ + usb_host.wakeup_mode = 1; + + /* configure system clock */ + resume_mcu_clk(); + } + + /* clear the EXTI line pending bit */ + exti_interrupt_flag_clear(WAKEUP_KEY_EXTI_LINE); + } +} +#endif /* USB_LOW_POWER */ + +#if USB_LOW_POWER +/*! + \brief this function handles USBFS wakeup interrupt request. + \param[in] none + \param[out] none + \retval none +*/ +void USBFS_WKUP_IRQHandler(void) +{ + if (usb_host.suspend_flag == 1) { + usb_host.suspend_flag = 0; + /* remote wakeup mode */ + usb_host.wakeup_mode = 2; + + /* configure system clock */ + resume_mcu_clk(); + } + + exti_interrupt_flag_clear(EXTI_18); +} + +/*! + \brief resume mcu clock + \param[in] none + \param[out] none + \retval none +*/ +static void resume_mcu_clk(void) +{ + /* enable HXTAL */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HXTAL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL1_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLL1STB)){ + } + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)){ + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(RCU_SCSS_PLL != rcu_system_clock_source_get()){ + } +} + +#endif /* USB_LOW_POWER */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_usb_hw.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_usb_hw.c new file mode 100644 index 0000000..4e547fd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/gd32f10x_usb_hw.c @@ -0,0 +1,296 @@ +/*! + \file gd32f10x_usb_hw.c + \brief this file implements the board support package for the USB host library + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" + +#define TIM_MSEC_DELAY 0x01U +#define TIM_USEC_DELAY 0x02U +#define HOST_OVRCURR_PORT GPIOE +#define HOST_OVRCURR_LINE GPIO_PIN_1 +#define HOST_OVRCURR_PORT_SOURCE GPIO_PORT_SOURCE_GPIOE +#define HOST_OVRCURR_PIN_SOURCE GPIO_PINSOURCE1 +#define HOST_OVRCURR_PORT_RCC RCC_APB2PERIPH_GPIOE +#define HOST_OVRCURR_EXTI_LINE EXTI_LINE1 +#define HOST_OVRCURR_IRQn EXTI1_IRQn + +#define HOST_POWERSW_PORT_RCC RCU_GPIOD +#define HOST_POWERSW_PORT GPIOD +#define HOST_POWERSW_VBUS GPIO_PIN_13 + +#define HOST_SOF_OUTPUT_RCC RCC_APB2PERIPH_GPIOA +#define HOST_SOF_PORT GPIOA +#define HOST_SOF_SIGNAL GPIO_PIN_8 + +__IO uint32_t delay_time = 0U; +__IO uint32_t usbfs_prescaler = 0U; +__IO uint16_t timer_prescaler = 5U; + +static void hwp_time_set (uint8_t unit); +static void hwp_delay (uint32_t ntime, uint8_t unit); + +/*! + \brief configure USB GPIO + \param[in] none + \param[out] none + \retval none +*/ +void usb_gpio_config (void) +{ +#ifdef USB_OTG_FS_LOW_PWR_MGMT_SUPPORT + EXTI_InitPara EXTI_InitStructure; +#endif + +#ifdef USB_OTG_FS_LOW_PWR_MGMT_SUPPORT + + EXTI_ClearIntBitState(EXTI_LINE18); + + /* USB wakeup EXTI line configuration */ + EXTI_InitStructure.EXTI_LINE = EXTI_LINE18; + EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; + EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; + EXTI_InitStructure.EXTI_LINEEnable = ENABLE; + EXTI_Init(&EXTI_InitStructure); + +#endif +} + +/*! + \brief configure USB clock + \param[in] none + \param[out] none + \retval none +*/ +void usb_rcu_config(void) +{ + uint32_t system_clock = rcu_clock_freq_get(CK_SYS); + + if (48000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1; + timer_prescaler = 3U; + } else if (72000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV1_5; + timer_prescaler = 5U; + } else if (96000000U == system_clock) { + usbfs_prescaler = RCU_CKUSB_CKPLL_DIV2; + timer_prescaler = 7U; + } else { + /* reserved */ + } + + rcu_usb_clock_config(usbfs_prescaler); + rcu_periph_clock_enable(RCU_USBFS); +} + +/*! + \brief configure USB global interrupt + \param[in] none + \param[out] none + \retval none +*/ +void usb_intr_config (void) +{ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + nvic_irq_enable((uint8_t)USBFS_IRQn, 2U, 0U); + +#ifdef USB_LOW_POWER + + /* enable the power module clock */ + rcu_periph_clock_enable(RCU_PMU); + + /* USB wakeup EXTI line configuration */ + exti_interrupt_flag_clear(EXTI_18); + exti_init(EXTI_18, EXTI_INTERRUPT, EXTI_TRIG_RISING); + exti_interrupt_enable(EXTI_18); + + nvic_irq_enable((uint8_t)USBFS_WKUP_IRQn, 1U, 0U); + +#endif /* USB_LOW_POWER */ +} + +/*! + \brief drives the VBUS signal through GPIO + \param[in] state: VBUS states + \param[out] none + \retval none +*/ +void usb_vbus_drive (uint8_t state) +{ + if (0U == state) { + /* disable is needed on output of the power switch */ + gpio_bit_set(HOST_POWERSW_PORT, HOST_POWERSW_VBUS); + } else { + /* enable the power switch by driving the enable low */ + gpio_bit_reset(HOST_POWERSW_PORT, HOST_POWERSW_VBUS); + } +} + +/*! + \brief configures the GPIO for the VBUS + \param[in] none + \param[out] none + \retval none +*/ +void usb_vbus_config (void) +{ + rcu_periph_clock_enable(HOST_POWERSW_PORT_RCC); + + gpio_init(HOST_POWERSW_PORT, GPIO_MODE_OUT_OD, GPIO_OSPEED_50MHZ, HOST_POWERSW_VBUS); + + /* by default, disable is needed on output of the power switch */ + usb_vbus_drive(0U); + + /* delay is need for stabilizing the vbus low in reset condition, + * when vbus=1 and reset-button is pressed by user + */ + usb_mdelay (200U); +} + +/*! + \brief initializes delay unit using Timer2 + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_init (void) +{ + /* set the vector table base address at 0x08000000 */ + nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x00U); + + /* configure the priority group to 2 bits */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + + /* enable the TIM2 global interrupt */ + nvic_irq_enable((uint8_t)TIMER2_IRQn, 1U, 0U); + + rcu_periph_clock_enable(RCU_TIMER2); +} + +/*! + \brief delay in micro seconds + \param[in] usec: value of delay required in micro seconds + \param[out] none + \retval none +*/ +void usb_udelay (const uint32_t usec) +{ + hwp_delay(usec, TIM_USEC_DELAY); +} + +/*! + \brief delay in milli seconds + \param[in] msec: value of delay required in milli seconds + \param[out] none + \retval none +*/ +void usb_mdelay (const uint32_t msec) +{ + hwp_delay(msec, TIM_MSEC_DELAY); +} + +/*! + \brief timer base IRQ + \param[in] none + \param[out] none + \retval none +*/ +void usb_timer_irq (void) +{ + if (RESET != timer_interrupt_flag_get(TIMER2, TIMER_INT_UP)){ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + if (delay_time > 0x0U){ + delay_time--; + } else { + timer_disable(TIMER2); + } + } +} + +/*! + \brief delay routine based on TIMER2 + \param[in] ntime: delay Time + \param[in] unit: delay Time unit = mili sec / micro sec + \param[out] none + \retval none +*/ +static void hwp_delay(uint32_t ntime, uint8_t unit) +{ + delay_time = ntime; + hwp_time_set(unit); + + while(0U != delay_time); + + timer_disable(TIMER2); +} + +/*! + \brief configures TIMER2 for delay routine based on TIMER2 + \param[in] unit: msec /usec + \param[out] none + \retval none +*/ +static void hwp_time_set(uint8_t unit) +{ + timer_parameter_struct timer_basestructure; + + timer_disable(TIMER2); + timer_interrupt_disable(TIMER2, TIMER_INT_UP); + + if (unit == TIM_USEC_DELAY) { + timer_basestructure.period = 11U; + } else if(unit == TIM_MSEC_DELAY) { + timer_basestructure.period = 11999U; + } else { + /* no operation */ + } + + timer_basestructure.prescaler = timer_prescaler; + timer_basestructure.alignedmode = TIMER_COUNTER_EDGE; + timer_basestructure.counterdirection = TIMER_COUNTER_UP; + timer_basestructure.clockdivision = TIMER_CKDIV_DIV1; + timer_basestructure.repetitioncounter = 0U; + + timer_init(TIMER2, &timer_basestructure); + + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + + timer_auto_reload_shadow_enable(TIMER2); + + /* timer2 interrupt enable */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* timer2 enable counter */ + timer_enable(TIMER2); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/main.c new file mode 100644 index 0000000..0f20c99 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/main.c @@ -0,0 +1,71 @@ +/*! + \file main.c + \brief this file realizes the MSC host + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usbh_core.h" +#include "usbh_usr.h" +#include "usbh_msc_core.h" + +extern usb_core_driver usbh_core; + +usbh_host usb_host; + +/*! + \brief main routine + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + usb_rcu_config(); + + usb_timer_init(); + + /* configure GPIO pin used for switching VBUS power and charge pump I/O */ + usb_vbus_config (); + + usbh_class_register (&usb_host, &usbh_msc); + + /* initialize host library */ + usbh_init (&usb_host, &usr_cb); + + /* enable interrupts */ + usb_intr_config (); + + while (1) { + /* host task handler */ + usbh_core_task (&usb_host); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/system_gd32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/system_gd32f10x.c new file mode 100644 index 0000000..cc252e0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/system_gd32f10x.c @@ -0,0 +1,1028 @@ +/*! + \file system_gd32f10x.c + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Source File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32f10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) + +/* use HXTAL (XD series CK_HXTAL = 8M, CL series CK_HXTAL = 25M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_24M_PLL_HXTAL (uint32_t)(24000000) +//#define __SYSTEM_CLOCK_36M_PLL_HXTAL (uint32_t)(36000000) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_56M_PLL_HXTAL (uint32_t)(56000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +#define __SYSTEM_CLOCK_96M_PLL_HXTAL (uint32_t)(96000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_48M_PLL_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_24M_PLL_HXTAL; +static void system_clock_24m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_36M_PLL_HXTAL; +static void system_clock_36m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_56M_PLL_HXTAL; +static void system_clock_56m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_96M_PLL_HXTAL; +static void system_clock_96m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#endif /* __SYSTEM_CLOCK_48M_PLL_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_HXTAL + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) + system_clock_24m_hxtal(); +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) + system_clock_36m_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) + system_clock_56m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) + system_clock_96m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#endif /* __SYSTEM_CLOCK_HXTAL */ +} + +/*! + \brief setup the microcontroller system, initialize the system + \param[in] none + \param[out] none + \retval none +*/ +void SystemInit(void) +{ + /* reset the RCC clock configuration to the default reset state */ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* reset SCS, AHBPSC, APB1PSC, APB2PSC, ADCPSC, CKOUT0SEL bits */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_ADCPSC_2 | RCU_CFG0_CKOUT0SEL); + + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* Reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + +#ifdef GD32F10X_CL + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4); + + RCU_CFG1 = 0x00000000U; +#else + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_CL */ + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* reset HXTALEN, CKMEN and PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x009F0000U; +#elif defined(GD32F10X_CL) + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN | RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00FF0000U; +#endif + + /* Configure the System clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); +} + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate(void) +{ + uint32_t scss; + uint32_t pllsel, predv0sel, pllmf, ck_src; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + scss = GET_BITS(RCU_CFG0, 2, 3); + + switch (scss) + { + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + + if(RCU_PLLSRC_IRC8M_DIV2 == pllsel){ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE / 2U; + }else{ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE / 2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + + if(pllmf >= 15U){ + pllmf += 1U; + }else{ + pllmf += 2U; + } + + SystemCoreClock = ck_src * pllmf; + +#ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + SystemCoreClock = ck_src * 6U + ck_src / 2U; + } +#endif /* GD32F10X_CL */ + + break; + + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } +} + +#ifdef __SYSTEM_CLOCK_HXTAL +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* select HXTAL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_HXTAL; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_24M_PLL_HXTAL) +/*! + \brief configure the system clock to 24M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_24m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL6; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 6 = 24 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL6); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_36M_PLL_HXTAL) +/*! + \brief configure the system clock to 36M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_36m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL9; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 9 = 36 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL9); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL12); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_56M_PLL_HXTAL) +/*! + \brief configure the system clock to 56M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_56m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL14; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 14 = 56 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL14); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL18); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_96M_PLL_HXTAL) +/*! + \brief configure the system clock to 96M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_96m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL24; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 24 = 96 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL24); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(MD/HD/XD:8M; CL:25M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + /* select HXTAL/2 as clock source */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_CFG0_PREDV0); + + /* CK_PLL = (CK_HXTAL/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + +#elif defined(GD32F10X_CL) + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL | RCU_PLL_MUL27); + + /* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */ + RCU_CFG1 &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + RCU_CFG1 |= (RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL8 | RCU_PREDV1_DIV5 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + /* select PLL as system clock */ + RCU_CFG0 &= ~RCU_CFG0_SCS; + RCU_CFG0 |= RCU_CKSYSSRC_PLL; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/usbh_usr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/usbh_usr.c new file mode 100644 index 0000000..d4831b8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/USBFS/USB_Host/usb_host_msc_udisk/src/usbh_usr.c @@ -0,0 +1,546 @@ +/*! + \file usbh_usr.c + \brief user application layer for USBFS host-mode MSC class operation + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include +#include "usbh_usr.h" +#include "drv_usb_hw.h" +#include "ff.h" +#include "usbh_msc_core.h" +#include "usbh_msc_scsi.h" +#include "usbh_msc_bbb.h" + +extern usb_core_driver usbh_core; +extern usbh_host usb_host; + +FATFS fatfs; +FIL file; +FRESULT res; + +char ReadTextBuff[100]; +char WriteTextBuff[] = "GD32 USB Host Demo application using FAT_FS "; +uint16_t bytesWritten, bytesToWrite, bytesRead; + +uint8_t line_idx; +uint8_t usbh_usr_application_state = USBH_USR_FS_INIT; + +/* points to the usbh_user_cb structure of current device */ +usbh_user_cb usr_cb = +{ + usbh_user_init, + usbh_user_deinit, + usbh_user_device_connected, + usbh_user_device_reset, + usbh_user_device_disconnected, + usbh_user_over_current_detected, + usbh_user_device_speed_detected, + usbh_user_device_desc_available, + usbh_user_device_address_assigned, + usbh_user_configuration_descavailable, + usbh_user_manufacturer_string, + usbh_user_product_string, + usbh_user_serialnum_string, + usbh_user_enumeration_finish, + usbh_user_userinput, + usbh_usr_msc_application, + usbh_user_device_not_supported, + usbh_user_unrecovered_error +}; + +const uint8_t MSG_HOST_HEADER[] = "USBFS MSC Host"; +const uint8_t MSG_HOST_FOOTER[] = "USB Host Library v2.0.0"; + +static uint8_t explore_disk (char* path, uint8_t recu_level); +static void toggle_leds (void); + +/*! + \brief user operation for host-mode initialization + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_init(void) +{ + static uint8_t startup = 0U; + + if (0U == startup) { + startup = 1U; + + /* configure the LEDs and KEYs*/ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + gd_eval_key_init(KEY_USER, KEY_MODE_GPIO); + gd_eval_key_init(KEY_TAMPER, KEY_MODE_GPIO); + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_GPIO); + + gd_eval_lcd_init(); + + lcd_log_init(); + + lcd_log_header_set((uint8_t *)MSG_HOST_HEADER, 60U); + + LCD_UsrLog("USB host library started\n"); + + lcd_log_footer_set((uint8_t *)MSG_HOST_FOOTER, 40U); + } +} + +/*! + \brief deinitialize user state and associated variables + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_deinit(void) +{ + usbh_usr_application_state = USBH_USR_FS_INIT; +} + +/*! + \brief user operation for device attached + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_connected(void) +{ + LCD_UsrLog("> Device Attached.\r\n"); +} + +/*! + \brief user operation when unrecovered error happens + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_unrecovered_error (void) +{ + LCD_ErrLog("> Unrecovered error state .\r\n"); +} + +/*! + \brief user operation for device disconnect event + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_disconnected (void) +{ + LCD_UsrLog("> Device Disconnected.\r\n"); +} + +/*! + \brief user operation for reset USB Device + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_reset(void) +{ + LCD_UsrLog("> Reset the USB device.\r\n"); +} + +/*! + \brief user operation for detecting device speed + \param[in] device_speed: device speed + \param[out] none + \retval none +*/ +void usbh_user_device_speed_detected(uint32_t device_speed) +{ + if (PORT_SPEED_HIGH == device_speed) { + LCD_UsrLog("> High speed device detected.\r\n"); + } else if(PORT_SPEED_FULL == device_speed) { + LCD_UsrLog("> Full speed device detected.\r\n"); + } else if(PORT_SPEED_LOW == device_speed) { + LCD_UsrLog("> Low speed device detected.\r\n"); + } else { + LCD_ErrLog("> Device Fault.\r\n"); + } +} + +/*! + \brief user operation when device descriptor is available + \param[in] device_desc: device descriptor + \param[out] none + \retval none +*/ +void usbh_user_device_desc_available(void *device_desc) +{ + usb_desc_dev *pDevStr = device_desc; + + LCD_DevInformation("VID: %04Xh\r\n", (uint32_t)pDevStr->idVendor); + LCD_DevInformation("PID: %04Xh\r\n", (uint32_t)pDevStr->idProduct); +} + +/*! + \brief usb device is successfully assigned the address + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_address_assigned(void) +{ +} + +/*! + \brief user operation when configuration descriptor is available + \param[in] cfg_desc: pointer to configuration descriptor + \param[in] itf_desc: pointer to interface descriptor + \param[in] ep_desc: pointer to endpoint descriptor + \param[out] none + \retval none +*/ +void usbh_user_configuration_descavailable(usb_desc_config *cfg_desc, + usb_desc_itf *itf_desc, + usb_desc_ep *ep_desc) +{ + usb_desc_itf *id = itf_desc; + + if (0x08U == (*id).bInterfaceClass) { + LCD_UsrLog("> Mass storage device connected.\r\n"); + } else if (0x03U == (*id).bInterfaceClass) { + LCD_UsrLog("> HID device connected.\r\n"); + } +} + +/*! + \brief user operation when manufacturer string exists + \param[in] manufacturer_string: manufacturer string of usb device + \param[out] none + \retval none +*/ +void usbh_user_manufacturer_string(void *manufacturer_string) +{ + LCD_DevInformation("Manufacturer: %s\r\n", (char *)manufacturer_string); +} + +/*! + \brief user operation when product string exists + \param[in] product_string: product string of usb device + \param[out] none + \retval none +*/ +void usbh_user_product_string(void *product_string) +{ + LCD_DevInformation("Product: %s\r\n", (char *)product_string); +} + +/*! + \brief user operation when serialNum string exists + \param[in] serial_num_string: serialNum string of usb device + \param[out] none + \retval none +*/ +void usbh_user_serialnum_string(void *serial_num_string) +{ + LCD_DevInformation("Serial Number: %s\r\n", (char *)serial_num_string); +} + +/*! + \brief user response request is displayed to ask for application jump to class + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_enumeration_finish(void) +{ + LCD_UsrLog("> Enumeration completed.\r\n"); + + lcd_text_color_set(LCD_COLOR_RED); + lcd_vertical_string_display(LCD_HINT_LINE0, 0, (uint8_t *)"---------------------------------------"); + lcd_text_color_set(LCD_COLOR_GREEN); + lcd_vertical_string_display(LCD_HINT_LINE1, 0, (uint8_t *)"To see the disk information: "); + lcd_vertical_string_display(LCD_HINT_LINE2, 0, (uint8_t *)"Press User Key... "); +} + +/*! + \brief user operation when device is not supported + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_device_not_supported(void) +{ + LCD_ErrLog("> Device not supported.\r\n"); +} + +/*! + \brief user action for application state entry + \param[in] none + \param[out] none + \retval user response for user key +*/ +usbh_user_status usbh_user_userinput(void) +{ + usbh_user_status usbh_usr_status = USR_IN_NO_RESP; + +#if USB_LOW_POWER + gd_eval_key_init(KEY_WAKEUP, KEY_MODE_EXTI); + + if(usb_host.suspend_flag){ + LCD_UsrLog("> Host in suspend status.\n"); + LCD_UsrLog("> Pls press KEY_WAKEUP key (General wakeup).\n"); + + if(usb_host.dev_supp_remote_wkup){ + LCD_UsrLog("> Or operate device (Remote wakeup).\n"); + } + }else{ + if(usb_host.wakeup_mode == 1){ + usb_host.wakeup_mode = 0; + LCD_UsrLog("> General wakeup success.\n"); + }else if(usb_host.wakeup_mode == 2){ + usb_host.wakeup_mode = 0; + LCD_UsrLog("> Remote wakeup success.\n"); + }else{ + } + } +#endif /* USB_LOW_POWER */ + + /*key B3 is in polling mode to detect user action */ + + if (RESET == gd_eval_key_state_get(KEY_USER)) { + usbh_usr_status = USR_IN_RESP_OK; + } + + return usbh_usr_status; +} + +/*! + \brief user operation for device over current detection event + \param[in] none + \param[out] none + \retval none +*/ +void usbh_user_over_current_detected (void) +{ + LCD_ErrLog("> Overcurrent detected.\r\n"); +} + +/*! + \brief demo application for mass storage + \param[in] none + \param[out] none + \retval status +*/ +int usbh_usr_msc_application(void) +{ + msc_lun info; + + switch(usbh_usr_application_state){ + case USBH_USR_FS_INIT: + /* initializes the file system */ + if (FR_OK != f_mount(&fatfs, "0:/", 0)) { + LCD_ErrLog("> Cannot initialize File System.\r\n"); + + return(-1); + } + + LCD_UsrLog("> File System initialized.\r\n"); + if (USBH_OK == usbh_msc_lun_info_get(&usb_host, 0U, &info)) + { + LCD_UsrLog("> Disk capacity: %llud Bytes.\r\n", (uint64_t)info.capacity.block_nbr * info.capacity.block_size); + } + + usbh_usr_application_state = USBH_USR_FS_READLIST; + break; + + case USBH_USR_FS_READLIST: + LCD_UsrLog("> Exploring disk flash ...\r\n"); + + lcd_text_color_set(LCD_COLOR_GREEN); + lcd_vertical_string_display(LCD_HINT_LINE1, 0U, (uint8_t *)"To see the root content of disk"); + lcd_vertical_string_display(LCD_HINT_LINE2, 0U, (uint8_t *)"Press Tamper Key... "); + + /* key TAMPER in polling */ + while ((usbh_core.host.connect_status) && \ + (SET == gd_eval_key_state_get (KEY_TAMPER))) { + toggle_leds(); + } + + explore_disk("0:/", 1); + line_idx = 0U; + usbh_usr_application_state = USBH_USR_FS_WRITEFILE; + break; + + case USBH_USR_FS_WRITEFILE: + usb_mdelay(100U); + + lcd_text_color_set(LCD_COLOR_GREEN); + lcd_vertical_string_display(LCD_HINT_LINE1, 0U, (uint8_t *)" "); + lcd_vertical_string_display(LCD_HINT_LINE2, 0U, (uint8_t *)"Press Wakeup Key to write file"); + + /* key WAKEUP in polling */ + while ((usbh_core.host.connect_status) && \ + (SET == gd_eval_key_state_get (KEY_WAKEUP))) { + toggle_leds(); + } + + LCD_UsrLog("> Writing File to disk flash ...\r\n"); + + /* register work area for logical drives */ + f_mount(&fatfs, "0:/", 1); + + if (FR_OK == f_open(&file, "0:GD32.TXT", FA_CREATE_ALWAYS | FA_WRITE)) { + /* write buffer to file */ + bytesToWrite = strlen(WriteTextBuff); + res = f_write (&file, WriteTextBuff, bytesToWrite, (void *)&bytesWritten); + f_sync(&file); + /* EOF or error */ + if ((0U == bytesWritten) || (FR_OK != res)) { + LCD_ErrLog("> GD32.TXT CANNOT be written.\r\n"); + } else { + if (FR_OK == f_open(&file, "0:GD32.TXT", FA_READ)) { + res = f_read(&file, ReadTextBuff, sizeof(ReadTextBuff), (void *)&bytesRead); + /* EOF or error */ + if ((0U == bytesRead) || (FR_OK != res)) { + LCD_ErrLog("> GD32.TXT CANNOT be read.\r\n"); + } else { + /* compare file content */ + if ((bytesRead == bytesWritten) && (0 == strncmp(ReadTextBuff, WriteTextBuff, bytesRead))) { + LCD_UsrLog("> File content compare: SUCCESS.\r\n"); + } else { + LCD_ErrLog("> File content compare: ERROR.\r\n"); + } + } + } else { + LCD_ErrLog("> GD32.TXT CANNOT be opened for read.\r\n"); + } + } + + /* close file */ + f_close(&file); + } else { + LCD_ErrLog("> GD32.TXT CANNOT be opened.\r\n"); + } + + /* unmount file system */ + f_mount(NULL, "0:/", 1); + + usbh_usr_application_state = USBH_USR_FS_DEMOEND; + LCD_UsrLog("> The MSC host demo is end.\r\n"); + break; + + case USBH_USR_FS_DEMOEND: + break; + + default: + break; + } + + return(0); +} + +/*! + \brief displays disk content + \param[in] path: pointer to root path + \param[in] recu_level: recursive level + \param[out] none + \retval status +*/ +static uint8_t explore_disk (char* path, uint8_t recu_level) +{ + FRESULT res; + FILINFO fno; + DIR dir; + char *fn; + + res = f_opendir(&dir, path); + + if (res == FR_OK) { + while ((usbh_core.host.connect_status)) { + res = f_readdir(&dir, &fno); + if (FR_OK != res || 0U == fno.fname[0]) { + break; + } + + if ('.' == fno.fname[0]) { + continue; + } + + fn = fno.fname; + + line_idx++; + + if (line_idx > 4) { + line_idx = 0; + + lcd_text_color_set(LCD_COLOR_GREEN); + lcd_vertical_string_display(LCD_HINT_LINE1, 0, (uint8_t *)" "); + lcd_vertical_string_display(LCD_HINT_LINE2, 0, (uint8_t *)"Press User Key to continue"); + + /*key B3 in polling*/ + while ((usbh_core.host.connect_status) && \ + (SET == gd_eval_key_state_get (KEY_USER))) { + toggle_leds(); + } + } + + if (1U == recu_level) { + LCD_UsrLog(" |__"); + } else if (2U == recu_level) { + LCD_UsrLog(" | |__"); + } + + if (AM_DIR == fno.fattrib) { + LCD_UsrLog("%s\r\n", fno.fname); + } else { + LCD_UsrLog("%s\r\n", fno.fname); + } + + if ((AM_DIR == fno.fattrib) && (1U == recu_level)) { + explore_disk(fn, 2); + } + } + } + + return res; +} + +/*! + \brief toggle leds to shows user input state + \param[in] none + \param[out] none + \retval none +*/ +static void toggle_leds(void) +{ + static uint32_t i; + + if (0x10000U == i++) { + gd_eval_led_toggle(LED2); + gd_eval_led_toggle(LED3); + i = 0; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.c new file mode 100644 index 0000000..f399cf6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.c @@ -0,0 +1,151 @@ +/*! + \file gd32f10x_it.c + \brief interrupt service routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_it.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ + /* if NMI exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while(1) { + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ + /* if SVC exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ + /* if DebugMon exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ + /* if PendSV exception occurs, go to infinite loop */ + while(1){ + } +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.h new file mode 100644 index 0000000..55362d6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_libopt.h new file mode 100644 index 0000000..bc30970 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_adc.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_can.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_fmc.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_misc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_wwdgt.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/main.c new file mode 100644 index 0000000..00c9126 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/main.c @@ -0,0 +1,90 @@ +/*! + \file main.c + \brief WWDGT delay feed demo + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" +#include "gd32f10x_eval.h" + +/*! + \brief main function + \param[in] none + \param[out] none + \retval none +*/ +int main(void) +{ + /* configure systick */ + systick_config(); + + /* configure LED2 and LED3 */ + gd_eval_led_init(LED2); + gd_eval_led_init(LED3); + + /* turn off LED2 and LED3 */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + + /* delay */ + delay_1ms(150); + + /* check if the system has resumed from WWDGT reset */ + if(RESET != rcu_flag_get(RCU_FLAG_WWDGTRST)) { + /* WWDGTRST flag set */ + gd_eval_led_on(LED2); + /* clear the WWDGTRST flag */ + rcu_all_reset_flag_clear(); + while(1) { + } + } + /* enable WWDGT clock */ + rcu_periph_clock_enable(RCU_WWDGT); + + /* + * set WWDGT clock = (PCLK1 (54MHz)/4096)/8 = 1648Hz (~606.8 us) + * set counter value to 127 + * set window value to 80 + * refresh window is: ~606.8 * (127-80)= 28.5ms < refresh window < ~606.8 * (127-63) =38.8ms. + */ + wwdgt_config(127, 80, WWDGT_CFG_PSC_DIV8); + wwdgt_enable(); + + while(1) { + /* toggle LED3 */ + gd_eval_led_toggle(LED3); + /* insert 30 ms delay */ + delay_1ms(30); + /* update WWDGT counter */ + wwdgt_counter_update(127); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/readme.txt new file mode 100644 index 0000000..58184c6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/readme.txt @@ -0,0 +1,47 @@ +/*! + \file readme.txt + \brief description of the WWDGT_delay_feed example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This demo is based on the GD32107C-EVAL-V1.3 board, it shows the WWDGT with different +counter value and window value make the different WWDGT timeout. As a result, LED2 +and LED3 display a different phenomenon. + + In this demo, the WWDGT counter value is set to 127, the refresh window is set to +80. In this case the WWDGT timeout is set to 38.8ms(the timeout may varies due to +APB1 frequency dispersion), the value in the delay function is set to 30ms, the WWDGT +counter can reloaded normally, the LED2 is turn off, LED3 is blinking fast. + + If the value in the delay function is not set properly, the WWDGT counter is not +reloaded. As a result, the system reset and only the LED2 is remain illuminated. + + In this example the system clock is set to 108 MHz , and the APB1 is set to 54MHz. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.c new file mode 100644 index 0000000..db9fcaa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.c @@ -0,0 +1,83 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x.h" +#include "systick.h" + +volatile static uint32_t delay; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) +{ + /* setup systick timer for 1000Hz interrupts */ + if(SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while(1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) +{ + delay = count; + + while(0U != delay) { + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) +{ + if(0U != delay) { + delay--; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.h new file mode 100644 index 0000000..2e54b93 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Examples/WWDGT/WWDGT_delay_feed/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYS_TICK_H +#define SYS_TICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYS_TICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/gd32f10x.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/gd32f10x.h new file mode 100644 index 0000000..8b04102 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/gd32f10x.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/system_gd32f10x.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/system_gd32f10x.h new file mode 100644 index 0000000..63d0649 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Include/system_gd32f10x.h @@ -0,0 +1,60 @@ +/*! + \file system_gd32f10x.h + \brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File for + GD32F10x Device Series +*/ + +/* Copyright (c) 2012 ARM LIMITED + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#ifndef SYSTEM_GD32F10X_H +#define SYSTEM_GD32F10X_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* system clock frequency (core clock) */ +extern uint32_t SystemCoreClock; + +/* function declarations */ +/* initialize the system and update the SystemCoreClock variable */ +extern void SystemInit(void); +/* update the SystemCoreClock with current core clock retrieved from cpu registers */ +extern void SystemCoreClockUpdate(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTEM_GD32F10X_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s new file mode 100644 index 0000000..a55ac3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s @@ -0,0 +1,388 @@ +;/*! +; \file startup_gd32f10x_cl.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN = 3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000200 + + AREA HEAP, NOINIT, READWRITE, ALIGN = 3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper Interrupt + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_IRQHandler ; 21:RCU + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD CAN0_TX_IRQHandler ; 35:CAN0 TX + DCD CAN0_RX0_IRQHandler ; 36:CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; 40:TIMER0 Break + DCD TIMER0_UP_IRQHandler ; 41:TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; 42:TIMER0 Trigger and Commutation + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm through EXTI Line + DCD USBFS_WKUP_IRQHandler ; 58:USBFS WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_IRQHandler ; 59:TIMER7 Break Interrupt + DCD TIMER7_UP_IRQHandler ; 60:TIMER7 Update Interrupt + DCD TIMER7_TRG_CMT_IRQHandler ; 61:TIMER7 Trigger + DCD TIMER7_Channel_IRQHandler ; 62:TIMER7 Channel Capture Compare + DCD 0 ; Reserved + DCD EXMC_IRQHandler ; 64:EXMC + DCD 0 ; Reserved + DCD TIMER4_IRQHandler ; 66:TIMER4 + DCD SPI2_IRQHandler ; 67:SPI2 + DCD UART3_IRQHandler ; 68:UART3 + DCD UART4_IRQHandler ; 69:UART4 + DCD TIMER5_IRQHandler ; 70:TIMER5 + DCD TIMER6_IRQHandler ; 71:TIMER6 + DCD DMA1_Channel0_IRQHandler ; 72:DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; 73:DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; 74:DMA1 Channel2 + DCD DMA1_Channel3_IRQHandler ; 75:DMA1 Channel3 + DCD DMA1_Channel4_IRQHandler ; 76:DMA1 Channel4 + DCD ENET_IRQHandler ; 77:Ethernet + DCD ENET_WKUP_IRQHandler ; 78:Ethernet Wakeup through EXTI line + DCD CAN1_TX_IRQHandler ; 79:CAN1 TX + DCD CAN1_RX0_IRQHandler ; 80:CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; 81:CAN1 RX1 + DCD CAN1_EWMC_IRQHandler ; 82:CAN1 EWMC + DCD USBFS_IRQHandler ; 83:USBFS + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT __main + IMPORT SystemInit + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP + +HardFault_Handler PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP + +MemManage_Handler PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP + +BusFault_Handler PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP + +UsageFault_Handler PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP + +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP + +DebugMon_Handler PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP + +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP + +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT CAN0_TX_IRQHandler [WEAK] + EXPORT CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_IRQHandler [WEAK] + EXPORT TIMER0_UP_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBFS_WKUP_IRQHandler [WEAK] + EXPORT TIMER7_BRK_IRQHandler [WEAK] + EXPORT TIMER7_UP_IRQHandler [WEAK] + EXPORT TIMER7_TRG_CMT_IRQHandler [WEAK] + EXPORT TIMER7_Channel_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + EXPORT TIMER4_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT UART3_IRQHandler [WEAK] + EXPORT UART4_IRQHandler [WEAK] + EXPORT TIMER5_IRQHandler [WEAK] + EXPORT TIMER6_IRQHandler [WEAK] + EXPORT DMA1_Channel0_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT ENET_IRQHandler [WEAK] + EXPORT ENET_WKUP_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_EWMC_IRQHandler [WEAK] + EXPORT USBFS_IRQHandler [WEAK] + + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +CAN0_TX_IRQHandler +CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_IRQHandler +TIMER0_UP_IRQHandler +TIMER0_TRG_CMT_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBFS_WKUP_IRQHandler +TIMER7_BRK_IRQHandler +TIMER7_UP_IRQHandler +TIMER7_TRG_CMT_IRQHandler +TIMER7_Channel_IRQHandler +EXMC_IRQHandler +TIMER4_IRQHandler +SPI2_IRQHandler +UART3_IRQHandler +UART4_IRQHandler +TIMER5_IRQHandler +TIMER6_IRQHandler +DMA1_Channel0_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +ENET_IRQHandler +ENET_WKUP_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_EWMC_IRQHandler +USBFS_IRQHandler + + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_hd.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_hd.s new file mode 100644 index 0000000..440f308 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_hd.s @@ -0,0 +1,369 @@ +;/*! +; \file startup_gd32f10x_hd.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN = 3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000200 + + AREA HEAP, NOINIT, READWRITE, ALIGN = 3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper Interrupt + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_IRQHandler ; 21:RCU + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; 35:USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; 36:USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; 40:TIMER0 Break + DCD TIMER0_UP_IRQHandler ; 41:TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; 42:TIMER0 Trigger and Commutation + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; 58:USBD WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_IRQHandler ; 59:TIMER7 Break Interrupt + DCD TIMER7_UP_IRQHandler ; 60:TIMER7 Update Interrupt + DCD TIMER7_TRG_CMT_IRQHandler ; 61:TIMER7 Trigger and Commutation Interrupt + DCD TIMER7_Channel_IRQHandler ; 62:TIMER7 Channel Capture Compare + DCD ADC2_IRQHandler ; 63:ADC2 + DCD EXMC_IRQHandler ; 64:EXMC + DCD SDIO_IRQHandler ; 65:SDIO + DCD TIMER4_IRQHandler ; 66:TIMER4 + DCD SPI2_IRQHandler ; 67:SPI2 + DCD UART3_IRQHandler ; 68:UART3 + DCD UART4_IRQHandler ; 69:UART4 + DCD TIMER5_IRQHandler ; 70:TIMER5 + DCD TIMER6_IRQHandler ; 71:TIMER6 + DCD DMA1_Channel0_IRQHandler ; 72:DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; 73:DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; 74:DMA1 Channel2 + DCD DMA1_Channel3_4_IRQHandler ; 75:DMA1 Channel3 and Channel4 + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT __main + IMPORT SystemInit + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP + +HardFault_Handler PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP + +MemManage_Handler PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP + +BusFault_Handler PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP + +UsageFault_Handler PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP + +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP + +DebugMon_Handler PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP + +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP + +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT USBD_HP_CAN0_TX_IRQHandler [WEAK] + EXPORT USBD_LP_CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_IRQHandler [WEAK] + EXPORT TIMER0_UP_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBD_WKUP_IRQHandler [WEAK] + EXPORT TIMER7_BRK_IRQHandler [WEAK] + EXPORT TIMER7_UP_IRQHandler [WEAK] + EXPORT TIMER7_TRG_CMT_IRQHandler [WEAK] + EXPORT TIMER7_Channel_IRQHandler [WEAK] + EXPORT ADC2_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + EXPORT SDIO_IRQHandler [WEAK] + EXPORT TIMER4_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT UART3_IRQHandler [WEAK] + EXPORT UART4_IRQHandler [WEAK] + EXPORT TIMER5_IRQHandler [WEAK] + EXPORT TIMER6_IRQHandler [WEAK] + EXPORT DMA1_Channel0_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_4_IRQHandler [WEAK] + + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +USBD_HP_CAN0_TX_IRQHandler +USBD_LP_CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_IRQHandler +TIMER0_UP_IRQHandler +TIMER0_TRG_CMT_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBD_WKUP_IRQHandler +TIMER7_BRK_IRQHandler +TIMER7_UP_IRQHandler +TIMER7_TRG_CMT_IRQHandler +TIMER7_Channel_IRQHandler +ADC2_IRQHandler +EXMC_IRQHandler +SDIO_IRQHandler +TIMER4_IRQHandler +SPI2_IRQHandler +UART3_IRQHandler +UART4_IRQHandler +TIMER5_IRQHandler +TIMER6_IRQHandler +DMA1_Channel0_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_4_IRQHandler + + + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_md.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_md.s new file mode 100644 index 0000000..3c02759 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_md.s @@ -0,0 +1,326 @@ +;/*! +; \file startup_gd32f10x_md.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN = 3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000200 + + AREA HEAP, NOINIT, READWRITE, ALIGN = 3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper Interrupt + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_IRQHandler ; 21:RCU + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; 35:USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; 36:USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; 40:TIMER0 Break + DCD TIMER0_UP_IRQHandler ; 41:TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; 42:TIMER0 Trigger + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; 58:USBD WakeUp from suspend through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD EXMC_IRQHandler ; 64:EXMC + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT __main + IMPORT SystemInit + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP + +HardFault_Handler PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP + +MemManage_Handler PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP + +BusFault_Handler PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP + +UsageFault_Handler PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP + +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP + +DebugMon_Handler PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP + +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP + +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT USBD_HP_CAN0_TX_IRQHandler [WEAK] + EXPORT USBD_LP_CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_IRQHandler [WEAK] + EXPORT TIMER0_UP_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBD_WKUP_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +USBD_HP_CAN0_TX_IRQHandler +USBD_LP_CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_IRQHandler +TIMER0_UP_IRQHandler +TIMER0_TRG_CMT_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBD_WKUP_IRQHandler +EXMC_IRQHandler + + + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_xd.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_xd.s new file mode 100644 index 0000000..b32be29 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_xd.s @@ -0,0 +1,369 @@ +;/*! +; \file startup_gd32f10x_xd.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN = 3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000200 + + AREA HEAP, NOINIT, READWRITE, ALIGN = 3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper Interrupt + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_IRQHandler ; 21:RCU + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; 35:USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; 36:USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_TIMER8_IRQHandler ; 40:TIMER0 Break and TIMER8 global + DCD TIMER0_UP_TIMER9_IRQHandler ; 41:TIMER0 Update and TIMER9 global + DCD TIMER0_TRG_CMT_TIMER10_IRQHandler ; 42:TIMER0 Trigger and Commutation and TIMER10 global + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; 58:USBD WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_TIMER11_IRQHandler ; 59:TIMER7 Break Interrupt and TIMER11 global + DCD TIMER7_UP_TIMER12_IRQHandler ; 60:TIMER7 Update Interrupt and TIMER12 global + DCD TIMER7_TRG_CMT_TIMER13_IRQHandler ; 61:TIMER7 Trigger and Commutation Interrupt and TIMER13 global + DCD TIMER7_Channel_IRQHandler ; 62:TIMER7 Channel Capture Compare + DCD ADC2_IRQHandler ; 63:ADC2 + DCD EXMC_IRQHandler ; 64:EXMC + DCD SDIO_IRQHandler ; 65:SDIO + DCD TIMER4_IRQHandler ; 66:TIMER4 + DCD SPI2_IRQHandler ; 67:SPI2 + DCD UART3_IRQHandler ; 68:UART3 + DCD UART4_IRQHandler ; 69:UART4 + DCD TIMER5_IRQHandler ; 70:TIMER5 + DCD TIMER6_IRQHandler ; 71:TIMER6 + DCD DMA1_Channel0_IRQHandler ; 72:DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; 73:DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; 74:DMA1 Channel2 + DCD DMA1_Channel3_4_IRQHandler ; 75:DMA1 Channel3 and Channel4 + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT __main + IMPORT SystemInit + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP + +HardFault_Handler PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP + +MemManage_Handler PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP + +BusFault_Handler PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP + +UsageFault_Handler PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP + +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP + +DebugMon_Handler PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP + +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP + +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT USBD_HP_CAN0_TX_IRQHandler [WEAK] + EXPORT USBD_LP_CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_TIMER8_IRQHandler [WEAK] + EXPORT TIMER0_UP_TIMER9_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_TIMER10_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBD_WKUP_IRQHandler [WEAK] + EXPORT TIMER7_BRK_TIMER11_IRQHandler [WEAK] + EXPORT TIMER7_UP_TIMER12_IRQHandler [WEAK] + EXPORT TIMER7_TRG_CMT_TIMER13_IRQHandler [WEAK] + EXPORT TIMER7_Channel_IRQHandler [WEAK] + EXPORT ADC2_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + EXPORT SDIO_IRQHandler [WEAK] + EXPORT TIMER4_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT UART3_IRQHandler [WEAK] + EXPORT UART4_IRQHandler [WEAK] + EXPORT TIMER5_IRQHandler [WEAK] + EXPORT TIMER6_IRQHandler [WEAK] + EXPORT DMA1_Channel0_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_4_IRQHandler [WEAK] + + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +USBD_HP_CAN0_TX_IRQHandler +USBD_LP_CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_TIMER8_IRQHandler +TIMER0_UP_TIMER9_IRQHandler +TIMER0_TRG_CMT_TIMER10_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBD_WKUP_IRQHandler +TIMER7_BRK_TIMER11_IRQHandler +TIMER7_UP_TIMER12_IRQHandler +TIMER7_TRG_CMT_TIMER13_IRQHandler +TIMER7_Channel_IRQHandler +ADC2_IRQHandler +EXMC_IRQHandler +SDIO_IRQHandler +TIMER4_IRQHandler +SPI2_IRQHandler +UART3_IRQHandler +UART4_IRQHandler +TIMER5_IRQHandler +TIMER6_IRQHandler +DMA1_Channel0_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_4_IRQHandler + + + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_stm32f10x_cl.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_stm32f10x_cl.s new file mode 100644 index 0000000..a9815cc Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_stm32f10x_cl.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_cl.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_cl.s new file mode 100644 index 0000000..9a281f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_cl.s @@ -0,0 +1,527 @@ +;/*! +; \file startup_gd32f10x_cl.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ + +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + + DATA +__vector_table + DCD sfe(CSTACK) ; top of stack + DCD Reset_Handler ; Reset Handler + + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDGT_IRQHandler ; Vector Number 16,Window Watchdog Timer + DCD LVD_IRQHandler ; Vector Number 17,LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; Vector Number 18,Tamper Interrupt + DCD RTC_IRQHandler ; Vector Number 19,RTC through EXTI Line + DCD FMC_IRQHandler ; Vector Number 20,FMC + DCD RCU_IRQHandler ; Vector Number 21,RCU + DCD EXTI0_IRQHandler ; Vector Number 22,EXTI Line 0 + DCD EXTI1_IRQHandler ; Vector Number 23,EXTI Line 1 + DCD EXTI2_IRQHandler ; Vector Number 24,EXTI Line 2 + DCD EXTI3_IRQHandler ; Vector Number 25,EXTI Line 3 + DCD EXTI4_IRQHandler ; Vector Number 26,EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; Vector Number 27,DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; Vector Number 28,DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; Vector Number 29,DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; Vector Number 30,DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; Vector Number 31,DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; Vector Number 32,DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; Vector Number 33,DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; Vector Number 34,ADC0 and ADC1 + DCD CAN0_TX_IRQHandler ; Vector Number 35,CAN0 TX + DCD CAN0_RX0_IRQHandler ; Vector Number 36,CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; Vector Number 37,CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; Vector Number 38,CAN0 EWMC + DCD EXTI5_9_IRQHandler ; Vector Number 39,EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; Vector Number 40,TIMER0 Break + DCD TIMER0_UP_IRQHandler ; Vector Number 41,TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; Vector Number 42,TIMER0 Trigger and Commutation + DCD TIMER0_Channel_IRQHandler ; Vector Number 43,TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; Vector Number 44,TIMER1 + DCD TIMER2_IRQHandler ; Vector Number 45,TIMER2 + DCD TIMER3_IRQHandler ; Vector Number 46,TIMER3 + DCD I2C0_EV_IRQHandler ; Vector Number 47,I2C0 Event + DCD I2C0_ER_IRQHandler ; Vector Number 48,I2C0 Error + DCD I2C1_EV_IRQHandler ; Vector Number 49,I2C1 Event + DCD I2C1_ER_IRQHandler ; Vector Number 50,I2C1 Error + DCD SPI0_IRQHandler ; Vector Number 51,SPI0 + DCD SPI1_IRQHandler ; Vector Number 52,SPI1 + DCD USART0_IRQHandler ; Vector Number 53,USART0 + DCD USART1_IRQHandler ; Vector Number 54,USART1 + DCD USART2_IRQHandler ; Vector Number 55,USART2 + DCD EXTI10_15_IRQHandler ; Vector Number 56,EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; Vector Number 57,RTC Alarm through EXTI Line + DCD USBFS_WKUP_IRQHandler ; Vector Number 58,USBFS WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_IRQHandler ; Vector Number 59,TIMER7 Break Interrupt + DCD TIMER7_UP_IRQHandler ; Vector Number 60,TIMER7 Update Interrupt + DCD TIMER7_TRG_CMT_IRQHandler ; Vector Number 61,TIMER7 Trigger and Commutation Interrupt + DCD TIMER7_Channel_IRQHandler ; Vector Number 62,TIMER7 Channel Capture Compare + DCD 0 ; Reserved + DCD EXMC_IRQHandler ; Vector Number 64,EXMC + DCD 0 ; Reserved + DCD TIMER4_IRQHandler ; Vector Number 66,TIMER4 + DCD SPI2_IRQHandler ; Vector Number 67,SPI2 + DCD UART3_IRQHandler ; Vector Number 68,UART3 + DCD UART4_IRQHandler ; Vector Number 69,UART4 + DCD TIMER5_IRQHandler ; Vector Number 70,TIMER5 + DCD TIMER6_IRQHandler ; Vector Number 71,TIMER6 + DCD DMA1_Channel0_IRQHandler ; Vector Number 72,DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; Vector Number 73,DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; Vector Number 74,DMA1 Channel2 + DCD DMA1_Channel3_IRQHandler ; Vector Number 75,DMA1 Channel3 + DCD DMA1_Channel4_IRQHandler ; Vector Number 76,DMA1 Channel4 + DCD ENET_IRQHandler ; Vector Number 77,Ethernet + DCD ENET_WKUP_IRQHandler ; Vector Number 78,Ethernet Wakeup through EXTI line + DCD CAN1_TX_IRQHandler ; Vector Number 79,CAN1 TX + DCD CAN1_RX0_IRQHandler ; Vector Number 80,CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; Vector Number 81,CAN1 RX1 + DCD CAN1_EWMC_IRQHandler ; Vector Number 82,CAN1 EWMC + DCD USBFS_IRQHandler ; Vector Number 83,USBFS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Default interrupt handlers. +;; + THUMB + + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(2) +Reset_Handler + LDR R0, = SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +NMI_Handler + B NMI_Handler + + PUBWEAK HardFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +HardFault_Handler + B HardFault_Handler + + PUBWEAK MemManage_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +MemManage_Handler + B MemManage_Handler + + PUBWEAK BusFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +BusFault_Handler + B BusFault_Handler + + PUBWEAK UsageFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +UsageFault_Handler + B UsageFault_Handler + + PUBWEAK SVC_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SVC_Handler + B SVC_Handler + + PUBWEAK DebugMon_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +DebugMon_Handler + B DebugMon_Handler + + PUBWEAK PendSV_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +PendSV_Handler + B PendSV_Handler + + PUBWEAK SysTick_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SysTick_Handler + B SysTick_Handler + + PUBWEAK WWDGT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +WWDGT_IRQHandler + B WWDGT_IRQHandler + + PUBWEAK LVD_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +LVD_IRQHandler + B LVD_IRQHandler + + PUBWEAK TAMPER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TAMPER_IRQHandler + B TAMPER_IRQHandler + + PUBWEAK RTC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_IRQHandler + B RTC_IRQHandler + + PUBWEAK FMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +FMC_IRQHandler + B FMC_IRQHandler + + PUBWEAK RCU_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RCU_IRQHandler + B RCU_IRQHandler + + PUBWEAK EXTI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI0_IRQHandler + B EXTI0_IRQHandler + + PUBWEAK EXTI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI1_IRQHandler + B EXTI1_IRQHandler + + PUBWEAK EXTI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI2_IRQHandler + B EXTI2_IRQHandler + + PUBWEAK EXTI3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI3_IRQHandler + B EXTI3_IRQHandler + + PUBWEAK EXTI4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI4_IRQHandler + B EXTI4_IRQHandler + + PUBWEAK DMA0_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel0_IRQHandler + B DMA0_Channel0_IRQHandler + + PUBWEAK DMA0_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel1_IRQHandler + B DMA0_Channel1_IRQHandler + + PUBWEAK DMA0_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel2_IRQHandler + B DMA0_Channel2_IRQHandler + + PUBWEAK DMA0_Channel3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel3_IRQHandler + B DMA0_Channel3_IRQHandler + + PUBWEAK DMA0_Channel4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel4_IRQHandler + B DMA0_Channel4_IRQHandler + + PUBWEAK DMA0_Channel5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel5_IRQHandler + B DMA0_Channel5_IRQHandler + + PUBWEAK DMA0_Channel6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel6_IRQHandler + B DMA0_Channel6_IRQHandler + + PUBWEAK ADC0_1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC0_1_IRQHandler + B ADC0_1_IRQHandler + + PUBWEAK CAN0_TX_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_TX_IRQHandler + B CAN0_TX_IRQHandler + + PUBWEAK CAN0_RX0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_RX0_IRQHandler + B CAN0_RX0_IRQHandler + + PUBWEAK CAN0_RX1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_RX1_IRQHandler + B CAN0_RX1_IRQHandler + + PUBWEAK CAN0_EWMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_EWMC_IRQHandler + B CAN0_EWMC_IRQHandler + + PUBWEAK EXTI5_9_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI5_9_IRQHandler + B EXTI5_9_IRQHandler + + PUBWEAK TIMER0_BRK_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_BRK_IRQHandler + B TIMER0_BRK_IRQHandler + + PUBWEAK TIMER0_UP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_UP_IRQHandler + B TIMER0_UP_IRQHandler + + PUBWEAK TIMER0_TRG_CMT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_TRG_CMT_IRQHandler + B TIMER0_TRG_CMT_IRQHandler + + PUBWEAK TIMER0_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_Channel_IRQHandler + B TIMER0_Channel_IRQHandler + + PUBWEAK TIMER1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER1_IRQHandler + B TIMER1_IRQHandler + + PUBWEAK TIMER2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER2_IRQHandler + B TIMER2_IRQHandler + + PUBWEAK TIMER3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER3_IRQHandler + B TIMER3_IRQHandler + + PUBWEAK I2C0_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_EV_IRQHandler + B I2C0_EV_IRQHandler + + PUBWEAK I2C0_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_ER_IRQHandler + B I2C0_ER_IRQHandler + + PUBWEAK I2C1_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_EV_IRQHandler + B I2C1_EV_IRQHandler + + PUBWEAK I2C1_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_ER_IRQHandler + B I2C1_ER_IRQHandler + + PUBWEAK SPI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI0_IRQHandler + B SPI0_IRQHandler + + PUBWEAK SPI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI1_IRQHandler + B SPI1_IRQHandler + + PUBWEAK USART0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART0_IRQHandler + B USART0_IRQHandler + + PUBWEAK USART1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART1_IRQHandler + B USART1_IRQHandler + + PUBWEAK USART2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART2_IRQHandler + B USART2_IRQHandler + + PUBWEAK EXTI10_15_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI10_15_IRQHandler + B EXTI10_15_IRQHandler + + PUBWEAK RTC_Alarm_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_Alarm_IRQHandler + B RTC_Alarm_IRQHandler + + PUBWEAK USBFS_WKUP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBFS_WKUP_IRQHandler + B USBFS_WKUP_IRQHandler + + PUBWEAK TIMER7_BRK_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_BRK_IRQHandler + B TIMER7_BRK_IRQHandler + + PUBWEAK TIMER7_UP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_UP_IRQHandler + B TIMER7_UP_IRQHandler + + PUBWEAK TIMER7_TRG_CMT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_TRG_CMT_IRQHandler + B TIMER7_TRG_CMT_IRQHandler + + PUBWEAK TIMER7_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_Channel_IRQHandler + B TIMER7_Channel_IRQHandler + + PUBWEAK EXMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXMC_IRQHandler + B EXMC_IRQHandler + + PUBWEAK TIMER4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER4_IRQHandler + B TIMER4_IRQHandler + + PUBWEAK SPI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI2_IRQHandler + B SPI2_IRQHandler + + PUBWEAK UART3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART3_IRQHandler + B UART3_IRQHandler + + PUBWEAK UART4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART4_IRQHandler + B UART4_IRQHandler + + PUBWEAK TIMER5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER5_IRQHandler + B TIMER5_IRQHandler + + PUBWEAK TIMER6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER6_IRQHandler + B TIMER6_IRQHandler + + PUBWEAK DMA1_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel0_IRQHandler + B DMA1_Channel0_IRQHandler + + PUBWEAK DMA1_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel1_IRQHandler + B DMA1_Channel1_IRQHandler + + PUBWEAK DMA1_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel2_IRQHandler + B DMA1_Channel2_IRQHandler + + PUBWEAK DMA1_Channel3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel3_IRQHandler + B DMA1_Channel3_IRQHandler + + PUBWEAK DMA1_Channel4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel4_IRQHandler + B DMA1_Channel4_IRQHandler + + PUBWEAK ENET_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ENET_IRQHandler + B ENET_IRQHandler + + PUBWEAK ENET_WKUP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ENET_WKUP_IRQHandler + B ENET_WKUP_IRQHandler + + PUBWEAK CAN1_TX_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN1_TX_IRQHandler + B CAN1_TX_IRQHandler + + PUBWEAK CAN1_RX0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN1_RX0_IRQHandler + B CAN1_RX0_IRQHandler + + PUBWEAK CAN1_RX1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN1_RX1_IRQHandler + B CAN1_RX1_IRQHandler + + PUBWEAK CAN1_EWMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN1_EWMC_IRQHandler + B CAN1_EWMC_IRQHandler + + PUBWEAK USBFS_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBFS_IRQHandler + B USBFS_IRQHandler + + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_hd.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_hd.s new file mode 100644 index 0000000..2b5ce4e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_hd.s @@ -0,0 +1,489 @@ +;/*! +; \file startup_gd32f10x_hd.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ + +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + + DATA +__vector_table + DCD sfe(CSTACK) ; top of stack + DCD Reset_Handler ; Reset Handler + + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDGT_IRQHandler ; Vector Number 16,Window Watchdog Timer + DCD LVD_IRQHandler ; Vector Number 17,LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; Vector Number 18,Tamper Interrupt + DCD RTC_IRQHandler ; Vector Number 19,RTC through EXTI Line + DCD FMC_IRQHandler ; Vector Number 20,FMC + DCD RCU_IRQHandler ; Vector Number 21,RCU + DCD EXTI0_IRQHandler ; Vector Number 22,EXTI Line 0 + DCD EXTI1_IRQHandler ; Vector Number 23,EXTI Line 1 + DCD EXTI2_IRQHandler ; Vector Number 24,EXTI Line 2 + DCD EXTI3_IRQHandler ; Vector Number 25,EXTI Line 3 + DCD EXTI4_IRQHandler ; Vector Number 26,EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; Vector Number 27,DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; Vector Number 28,DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; Vector Number 29,DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; Vector Number 30,DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; Vector Number 31,DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; Vector Number 32,DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; Vector Number 33,DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; Vector Number 34,ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; Vector Number 35,USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; Vector Number 36,USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; Vector Number 37,CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; Vector Number 38,CAN0 EWMC + DCD EXTI5_9_IRQHandler ; Vector Number 39,EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; Vector Number 40,TIMER0 Break + DCD TIMER0_UP_IRQHandler ; Vector Number 41,TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; Vector Number 42,TIMER0 Trigger and Commutation + DCD TIMER0_Channel_IRQHandler ; Vector Number 43,TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; Vector Number 44,TIMER1 + DCD TIMER2_IRQHandler ; Vector Number 45,TIMER2 + DCD TIMER3_IRQHandler ; Vector Number 46,TIMER3 + DCD I2C0_EV_IRQHandler ; Vector Number 47,I2C0 Event + DCD I2C0_ER_IRQHandler ; Vector Number 48,I2C0 Error + DCD I2C1_EV_IRQHandler ; Vector Number 49,I2C1 Event + DCD I2C1_ER_IRQHandler ; Vector Number 50,I2C1 Error + DCD SPI0_IRQHandler ; Vector Number 51,SPI0 + DCD SPI1_IRQHandler ; Vector Number 52,SPI1 + DCD USART0_IRQHandler ; Vector Number 53,USART0 + DCD USART1_IRQHandler ; Vector Number 54,USART1 + DCD USART2_IRQHandler ; Vector Number 55,USART2 + DCD EXTI10_15_IRQHandler ; Vector Number 56,EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; Vector Number 57,RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; Vector Number 58,USBD WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_IRQHandler ; Vector Number 59,TIMER7 Break Interrupt + DCD TIMER7_UP_IRQHandler ; Vector Number 60,TIMER7 Update Interrupt + DCD TIMER7_TRG_CMT_IRQHandler ; Vector Number 61,TIMER7 Trigger and Commutation Interrupt + DCD TIMER7_Channel_IRQHandler ; Vector Number 62,TIMER7 Channel Capture Compare + DCD ADC2_IRQHandler ; Vector Number 63,ADC2 + DCD EXMC_IRQHandler ; Vector Number 64,EXMC + DCD SDIO_IRQHandler ; Vector Number 65,SDIO + DCD TIMER4_IRQHandler ; Vector Number 66,TIMER4 + DCD SPI2_IRQHandler ; Vector Number 67,SPI2 + DCD UART3_IRQHandler ; Vector Number 68,UART3 + DCD UART4_IRQHandler ; Vector Number 69,UART4 + DCD TIMER5_IRQHandler ; Vector Number 70,TIMER5 + DCD TIMER6_IRQHandler ; Vector Number 71,TIMER6 + DCD DMA1_Channel0_IRQHandler ; Vector Number 72,DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; Vector Number 73,DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; Vector Number 74,DMA1 Channel2 + DCD DMA1_Channel3_4_IRQHandler ; Vector Number 75,DMA1 Channel4 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Default interrupt handlers. +;; + THUMB + + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(2) +Reset_Handler + LDR R0, = SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +NMI_Handler + B NMI_Handler + + PUBWEAK HardFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +HardFault_Handler + B HardFault_Handler + + PUBWEAK MemManage_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +MemManage_Handler + B MemManage_Handler + + PUBWEAK BusFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +BusFault_Handler + B BusFault_Handler + + PUBWEAK UsageFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +UsageFault_Handler + B UsageFault_Handler + + PUBWEAK SVC_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SVC_Handler + B SVC_Handler + + PUBWEAK DebugMon_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +DebugMon_Handler + B DebugMon_Handler + + PUBWEAK PendSV_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +PendSV_Handler + B PendSV_Handler + + PUBWEAK SysTick_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SysTick_Handler + B SysTick_Handler + + PUBWEAK WWDGT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +WWDGT_IRQHandler + B WWDGT_IRQHandler + + PUBWEAK LVD_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +LVD_IRQHandler + B LVD_IRQHandler + + PUBWEAK TAMPER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TAMPER_IRQHandler + B TAMPER_IRQHandler + + PUBWEAK RTC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_IRQHandler + B RTC_IRQHandler + + PUBWEAK FMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +FMC_IRQHandler + B FMC_IRQHandler + + PUBWEAK RCU_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RCU_IRQHandler + B RCU_IRQHandler + + PUBWEAK EXTI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI0_IRQHandler + B EXTI0_IRQHandler + + PUBWEAK EXTI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI1_IRQHandler + B EXTI1_IRQHandler + + PUBWEAK EXTI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI2_IRQHandler + B EXTI2_IRQHandler + + PUBWEAK EXTI3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI3_IRQHandler + B EXTI3_IRQHandler + + PUBWEAK EXTI4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI4_IRQHandler + B EXTI4_IRQHandler + + PUBWEAK DMA0_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel0_IRQHandler + B DMA0_Channel0_IRQHandler + + + PUBWEAK DMA0_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel1_IRQHandler + B DMA0_Channel1_IRQHandler + + PUBWEAK DMA0_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel2_IRQHandler + B DMA0_Channel2_IRQHandler + + PUBWEAK DMA0_Channel3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel3_IRQHandler + B DMA0_Channel3_IRQHandler + + PUBWEAK DMA0_Channel4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel4_IRQHandler + B DMA0_Channel4_IRQHandler + + PUBWEAK DMA0_Channel5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel5_IRQHandler + B DMA0_Channel5_IRQHandler + + PUBWEAK DMA0_Channel6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel6_IRQHandler + B DMA0_Channel6_IRQHandler + + PUBWEAK ADC0_1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC0_1_IRQHandler + B ADC0_1_IRQHandler + + PUBWEAK USBD_HP_CAN0_TX_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_HP_CAN0_TX_IRQHandler + B USBD_HP_CAN0_TX_IRQHandler + + PUBWEAK USBD_LP_CAN0_RX0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_LP_CAN0_RX0_IRQHandler + B USBD_LP_CAN0_RX0_IRQHandler + + PUBWEAK CAN0_RX1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_RX1_IRQHandler + B CAN0_RX1_IRQHandler + + PUBWEAK CAN0_EWMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_EWMC_IRQHandler + B CAN0_EWMC_IRQHandler + + PUBWEAK EXTI5_9_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI5_9_IRQHandler + B EXTI5_9_IRQHandler + + PUBWEAK TIMER0_BRK_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_BRK_IRQHandler + B TIMER0_BRK_IRQHandler + + PUBWEAK TIMER0_UP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_UP_IRQHandler + B TIMER0_UP_IRQHandler + + PUBWEAK TIMER0_TRG_CMT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_TRG_CMT_IRQHandler + B TIMER0_TRG_CMT_IRQHandler + + PUBWEAK TIMER0_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_Channel_IRQHandler + B TIMER0_Channel_IRQHandler + + PUBWEAK TIMER1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER1_IRQHandler + B TIMER1_IRQHandler + + PUBWEAK TIMER2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER2_IRQHandler + B TIMER2_IRQHandler + + PUBWEAK TIMER3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER3_IRQHandler + B TIMER3_IRQHandler + + PUBWEAK I2C0_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_EV_IRQHandler + B I2C0_EV_IRQHandler + + PUBWEAK I2C0_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_ER_IRQHandler + B I2C0_ER_IRQHandler + + PUBWEAK I2C1_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_EV_IRQHandler + B I2C1_EV_IRQHandler + + PUBWEAK I2C1_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_ER_IRQHandler + B I2C1_ER_IRQHandler + + PUBWEAK SPI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI0_IRQHandler + B SPI0_IRQHandler + + PUBWEAK SPI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI1_IRQHandler + B SPI1_IRQHandler + + PUBWEAK USART0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART0_IRQHandler + B USART0_IRQHandler + + PUBWEAK USART1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART1_IRQHandler + B USART1_IRQHandler + + PUBWEAK USART2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART2_IRQHandler + B USART2_IRQHandler + + PUBWEAK EXTI10_15_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI10_15_IRQHandler + B EXTI10_15_IRQHandler + + PUBWEAK RTC_Alarm_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_Alarm_IRQHandler + B RTC_Alarm_IRQHandler + + PUBWEAK USBD_WKUP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_WKUP_IRQHandler + B USBD_WKUP_IRQHandler + + PUBWEAK TIMER7_BRK_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_BRK_IRQHandler + B TIMER7_BRK_IRQHandler + + PUBWEAK TIMER7_UP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_UP_IRQHandler + B TIMER7_UP_IRQHandler + + PUBWEAK TIMER7_TRG_CMT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_TRG_CMT_IRQHandler + B TIMER7_TRG_CMT_IRQHandler + + PUBWEAK TIMER7_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_Channel_IRQHandler + B TIMER7_Channel_IRQHandler + + PUBWEAK ADC2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC2_IRQHandler + B ADC2_IRQHandler + + PUBWEAK EXMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXMC_IRQHandler + B EXMC_IRQHandler + + PUBWEAK SDIO_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SDIO_IRQHandler + B SDIO_IRQHandler + + PUBWEAK TIMER4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER4_IRQHandler + B TIMER4_IRQHandler + + PUBWEAK SPI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI2_IRQHandler + B SPI2_IRQHandler + + PUBWEAK UART3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART3_IRQHandler + B UART3_IRQHandler + + PUBWEAK UART4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART4_IRQHandler + B UART4_IRQHandler + + PUBWEAK TIMER5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER5_IRQHandler + B TIMER5_IRQHandler + + PUBWEAK TIMER6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER6_IRQHandler + B TIMER6_IRQHandler + + PUBWEAK DMA1_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel0_IRQHandler + B DMA1_Channel0_IRQHandler + + PUBWEAK DMA1_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel1_IRQHandler + B DMA1_Channel1_IRQHandler + + PUBWEAK DMA1_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel2_IRQHandler + B DMA1_Channel2_IRQHandler + + PUBWEAK DMA1_Channel3_4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel3_4_IRQHandler + B DMA1_Channel3_4_IRQHandler + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_md.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_md.s new file mode 100644 index 0000000..5fb94f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_md.s @@ -0,0 +1,398 @@ +;/*! +; \file startup_gd32f10x_md.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ + +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + + DATA +__vector_table + DCD sfe(CSTACK) ; top of stack + DCD Reset_Handler ; Reset Handler + + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDGT_IRQHandler ; Vector Number 16,Window Watchdog Timer + DCD LVD_IRQHandler ; Vector Number 17,LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; Vector Number 18,Tamper Interrupt + DCD RTC_IRQHandler ; Vector Number 19,RTC through EXTI Line + DCD FMC_IRQHandler ; Vector Number 20,FMC + DCD RCU_IRQHandler ; Vector Number 21,RCU + DCD EXTI0_IRQHandler ; Vector Number 22,EXTI Line 0 + DCD EXTI1_IRQHandler ; Vector Number 23,EXTI Line 1 + DCD EXTI2_IRQHandler ; Vector Number 24,EXTI Line 2 + DCD EXTI3_IRQHandler ; Vector Number 25,EXTI Line 3 + DCD EXTI4_IRQHandler ; Vector Number 26,EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; Vector Number 27,DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; Vector Number 28,DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; Vector Number 29,DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; Vector Number 30,DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; Vector Number 31,DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; Vector Number 32,DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; Vector Number 33,DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; Vector Number 34,ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; Vector Number 35,USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; Vector Number 36,USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; Vector Number 37,CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; Vector Number 38,CAN0 EWMC + DCD EXTI5_9_IRQHandler ; Vector Number 39,EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_IRQHandler ; Vector Number 40,TIMER0 Break + DCD TIMER0_UP_IRQHandler ; Vector Number 41,TIMER0 Update + DCD TIMER0_TRG_CMT_IRQHandler ; Vector Number 42,TIMER0 Trigger and Commutation + DCD TIMER0_Channel_IRQHandler ; Vector Number 43,TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; Vector Number 44,TIMER1 + DCD TIMER2_IRQHandler ; Vector Number 45,TIMER2 + DCD TIMER3_IRQHandler ; Vector Number 46,TIMER3 + DCD I2C0_EV_IRQHandler ; Vector Number 47,I2C0 Event + DCD I2C0_ER_IRQHandler ; Vector Number 48,I2C0 Error + DCD I2C1_EV_IRQHandler ; Vector Number 49,I2C1 Event + DCD I2C1_ER_IRQHandler ; Vector Number 50,I2C1 Error + DCD SPI0_IRQHandler ; Vector Number 51,SPI0 + DCD SPI1_IRQHandler ; Vector Number 52,SPI1 + DCD USART0_IRQHandler ; Vector Number 53,USART0 + DCD USART1_IRQHandler ; Vector Number 54,USART1 + DCD USART2_IRQHandler ; Vector Number 55,USART2 + DCD EXTI10_15_IRQHandler ; Vector Number 56,EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; Vector Number 57,RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; Vector Number 58,USBD WakeUp from suspend through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD EXMC_IRQHandler ; Vector Number 64,EXMC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Default interrupt handlers. +;; + THUMB + + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(2) +Reset_Handler + LDR R0, = SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +NMI_Handler + B NMI_Handler + + PUBWEAK HardFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +HardFault_Handler + B HardFault_Handler + + PUBWEAK MemManage_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +MemManage_Handler + B MemManage_Handler + + PUBWEAK BusFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +BusFault_Handler + B BusFault_Handler + + PUBWEAK UsageFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +UsageFault_Handler + B UsageFault_Handler + + PUBWEAK SVC_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SVC_Handler + B SVC_Handler + + PUBWEAK DebugMon_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +DebugMon_Handler + B DebugMon_Handler + + PUBWEAK PendSV_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +PendSV_Handler + B PendSV_Handler + + PUBWEAK SysTick_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SysTick_Handler + B SysTick_Handler + + PUBWEAK WWDGT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +WWDGT_IRQHandler + B WWDGT_IRQHandler + + PUBWEAK LVD_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +LVD_IRQHandler + B LVD_IRQHandler + + PUBWEAK TAMPER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TAMPER_IRQHandler + B TAMPER_IRQHandler + + PUBWEAK RTC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_IRQHandler + B RTC_IRQHandler + + PUBWEAK FMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +FMC_IRQHandler + B FMC_IRQHandler + + PUBWEAK RCU_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RCU_IRQHandler + B RCU_IRQHandler + + PUBWEAK EXTI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI0_IRQHandler + B EXTI0_IRQHandler + + PUBWEAK EXTI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI1_IRQHandler + B EXTI1_IRQHandler + + PUBWEAK EXTI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI2_IRQHandler + B EXTI2_IRQHandler + + PUBWEAK EXTI3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI3_IRQHandler + B EXTI3_IRQHandler + + PUBWEAK EXTI4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI4_IRQHandler + B EXTI4_IRQHandler + + PUBWEAK DMA0_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel0_IRQHandler + B DMA0_Channel0_IRQHandler + + + PUBWEAK DMA0_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel1_IRQHandler + B DMA0_Channel1_IRQHandler + + PUBWEAK DMA0_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel2_IRQHandler + B DMA0_Channel2_IRQHandler + + PUBWEAK DMA0_Channel3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel3_IRQHandler + B DMA0_Channel3_IRQHandler + + PUBWEAK DMA0_Channel4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel4_IRQHandler + B DMA0_Channel4_IRQHandler + + PUBWEAK DMA0_Channel5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel5_IRQHandler + B DMA0_Channel5_IRQHandler + + PUBWEAK DMA0_Channel6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel6_IRQHandler + B DMA0_Channel6_IRQHandler + + PUBWEAK ADC0_1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC0_1_IRQHandler + B ADC0_1_IRQHandler + + PUBWEAK USBD_HP_CAN0_TX_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_HP_CAN0_TX_IRQHandler + B USBD_HP_CAN0_TX_IRQHandler + + PUBWEAK USBD_LP_CAN0_RX0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_LP_CAN0_RX0_IRQHandler + B USBD_LP_CAN0_RX0_IRQHandler + + PUBWEAK CAN0_RX1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_RX1_IRQHandler + B CAN0_RX1_IRQHandler + + PUBWEAK CAN0_EWMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_EWMC_IRQHandler + B CAN0_EWMC_IRQHandler + + PUBWEAK EXTI5_9_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI5_9_IRQHandler + B EXTI5_9_IRQHandler + + PUBWEAK TIMER0_BRK_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_BRK_IRQHandler + B TIMER0_BRK_IRQHandler + + PUBWEAK TIMER0_UP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_UP_IRQHandler + B TIMER0_UP_IRQHandler + + PUBWEAK TIMER0_TRG_CMT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_TRG_CMT_IRQHandler + B TIMER0_TRG_CMT_IRQHandler + + PUBWEAK TIMER0_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_Channel_IRQHandler + B TIMER0_Channel_IRQHandler + + PUBWEAK TIMER1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER1_IRQHandler + B TIMER1_IRQHandler + + PUBWEAK TIMER2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER2_IRQHandler + B TIMER2_IRQHandler + + PUBWEAK TIMER3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER3_IRQHandler + B TIMER3_IRQHandler + + PUBWEAK I2C0_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_EV_IRQHandler + B I2C0_EV_IRQHandler + + PUBWEAK I2C0_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_ER_IRQHandler + B I2C0_ER_IRQHandler + + PUBWEAK I2C1_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_EV_IRQHandler + B I2C1_EV_IRQHandler + + PUBWEAK I2C1_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_ER_IRQHandler + B I2C1_ER_IRQHandler + + PUBWEAK SPI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI0_IRQHandler + B SPI0_IRQHandler + + PUBWEAK SPI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI1_IRQHandler + B SPI1_IRQHandler + + PUBWEAK USART0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART0_IRQHandler + B USART0_IRQHandler + + PUBWEAK USART1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART1_IRQHandler + B USART1_IRQHandler + + PUBWEAK USART2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART2_IRQHandler + B USART2_IRQHandler + + PUBWEAK EXTI10_15_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI10_15_IRQHandler + B EXTI10_15_IRQHandler + + PUBWEAK RTC_Alarm_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_Alarm_IRQHandler + B RTC_Alarm_IRQHandler + + PUBWEAK USBD_WKUP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_WKUP_IRQHandler + B USBD_WKUP_IRQHandler + + PUBWEAK EXMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXMC_IRQHandler + B EXMC_IRQHandler + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_xd.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_xd.s new file mode 100644 index 0000000..74bd753 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_xd.s @@ -0,0 +1,489 @@ +;/*! +; \file startup_gd32f10x_xd.s +; \brief start up file +; +; \version 2024-01-05, V2.3.0, firmware for GD32F10x +;*/ + +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2024, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - 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. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + + DATA +__vector_table + DCD sfe(CSTACK) ; top of stack + DCD Reset_Handler ; Reset Handler + + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDGT_IRQHandler ; Vector Number 16,Window Watchdog Timer + DCD LVD_IRQHandler ; Vector Number 17,LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; Vector Number 18,Tamper Interrupt + DCD RTC_IRQHandler ; Vector Number 19,RTC through EXTI Line + DCD FMC_IRQHandler ; Vector Number 20,FMC + DCD RCU_IRQHandler ; Vector Number 21,RCU + DCD EXTI0_IRQHandler ; Vector Number 22,EXTI Line 0 + DCD EXTI1_IRQHandler ; Vector Number 23,EXTI Line 1 + DCD EXTI2_IRQHandler ; Vector Number 24,EXTI Line 2 + DCD EXTI3_IRQHandler ; Vector Number 25,EXTI Line 3 + DCD EXTI4_IRQHandler ; Vector Number 26,EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; Vector Number 27,DMA0 Channel 0 + DCD DMA0_Channel1_IRQHandler ; Vector Number 28,DMA0 Channel 1 + DCD DMA0_Channel2_IRQHandler ; Vector Number 29,DMA0 Channel 2 + DCD DMA0_Channel3_IRQHandler ; Vector Number 30,DMA0 Channel 3 + DCD DMA0_Channel4_IRQHandler ; Vector Number 31,DMA0 Channel 4 + DCD DMA0_Channel5_IRQHandler ; Vector Number 32,DMA0 Channel 5 + DCD DMA0_Channel6_IRQHandler ; Vector Number 33,DMA0 Channel 6 + DCD ADC0_1_IRQHandler ; Vector Number 34,ADC0 and ADC1 + DCD USBD_HP_CAN0_TX_IRQHandler ; Vector Number 35,USBD and CAN0 TX + DCD USBD_LP_CAN0_RX0_IRQHandler ; Vector Number 36,USBD and CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; Vector Number 37,CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; Vector Number 38,CAN0 EWMC + DCD EXTI5_9_IRQHandler ; Vector Number 39,EXTI Line 5 to EXTI Line 9 + DCD TIMER0_BRK_TIMER8_IRQHandler ; Vector Number 40,TIMER0 Break and TIMER8 global + DCD TIMER0_UP_TIMER9_IRQHandler ; Vector Number 41,TIMER0 Update and TIMER9 global + DCD TIMER0_TRG_CMT_TIMER10_IRQHandler ; Vector Number 42,TIMER0 Trigger and Commutation and TIMER10 global + DCD TIMER0_Channel_IRQHandler ; Vector Number 43,TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; Vector Number 44,TIMER1 + DCD TIMER2_IRQHandler ; Vector Number 45,TIMER2 + DCD TIMER3_IRQHandler ; Vector Number 46,TIMER3 + DCD I2C0_EV_IRQHandler ; Vector Number 47,I2C0 Event + DCD I2C0_ER_IRQHandler ; Vector Number 48,I2C0 Error + DCD I2C1_EV_IRQHandler ; Vector Number 49,I2C1 Event + DCD I2C1_ER_IRQHandler ; Vector Number 50,I2C1 Error + DCD SPI0_IRQHandler ; Vector Number 51,SPI0 + DCD SPI1_IRQHandler ; Vector Number 52,SPI1 + DCD USART0_IRQHandler ; Vector Number 53,USART0 + DCD USART1_IRQHandler ; Vector Number 54,USART1 + DCD USART2_IRQHandler ; Vector Number 55,USART2 + DCD EXTI10_15_IRQHandler ; Vector Number 56,EXTI Line 10 to EXTI Line 15 + DCD RTC_Alarm_IRQHandler ; Vector Number 57,RTC Alarm through EXTI Line + DCD USBD_WKUP_IRQHandler ; Vector Number 58,USBD WakeUp from suspend through EXTI Line + DCD TIMER7_BRK_TIMER11_IRQHandler ; Vector Number 59,TIMER7 Break Interrupt and TIMER11 global + DCD TIMER7_UP_TIMER12_IRQHandler ; Vector Number 60,TIMER7 Update Interrupt and TIMER12 global + DCD TIMER7_TRG_CMT_TIMER13_IRQHandler ; Vector Number 61,TIMER7 Trigger and Commutation Interrupt and TIMER13 global + DCD TIMER7_Channel_IRQHandler ; Vector Number 62,TIMER7 Channel Capture Compare + DCD ADC2_IRQHandler ; Vector Number 63,ADC2 + DCD EXMC_IRQHandler ; Vector Number 64,EXMC + DCD SDIO_IRQHandler ; Vector Number 65,SDIO + DCD TIMER4_IRQHandler ; Vector Number 66,TIMER4 + DCD SPI2_IRQHandler ; Vector Number 67,SPI2 + DCD UART3_IRQHandler ; Vector Number 68,UART3 + DCD UART4_IRQHandler ; Vector Number 69,UART4 + DCD TIMER5_IRQHandler ; Vector Number 70,TIMER5 + DCD TIMER6_IRQHandler ; Vector Number 71,TIMER6 + DCD DMA1_Channel0_IRQHandler ; Vector Number 72,DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; Vector Number 73,DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; Vector Number 74,DMA1 Channel2 + DCD DMA1_Channel3_4_IRQHandler ; Vector Number 75,DMA1 Channel4 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Default interrupt handlers. +;; + THUMB + + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(2) +Reset_Handler + LDR R0, = SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +NMI_Handler + B NMI_Handler + + PUBWEAK HardFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +HardFault_Handler + B HardFault_Handler + + PUBWEAK MemManage_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +MemManage_Handler + B MemManage_Handler + + PUBWEAK BusFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +BusFault_Handler + B BusFault_Handler + + PUBWEAK UsageFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +UsageFault_Handler + B UsageFault_Handler + + PUBWEAK SVC_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SVC_Handler + B SVC_Handler + + PUBWEAK DebugMon_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +DebugMon_Handler + B DebugMon_Handler + + PUBWEAK PendSV_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +PendSV_Handler + B PendSV_Handler + + PUBWEAK SysTick_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SysTick_Handler + B SysTick_Handler + + PUBWEAK WWDGT_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +WWDGT_IRQHandler + B WWDGT_IRQHandler + + PUBWEAK LVD_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +LVD_IRQHandler + B LVD_IRQHandler + + PUBWEAK TAMPER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TAMPER_IRQHandler + B TAMPER_IRQHandler + + PUBWEAK RTC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_IRQHandler + B RTC_IRQHandler + + PUBWEAK FMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +FMC_IRQHandler + B FMC_IRQHandler + + PUBWEAK RCU_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RCU_IRQHandler + B RCU_IRQHandler + + PUBWEAK EXTI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI0_IRQHandler + B EXTI0_IRQHandler + + PUBWEAK EXTI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI1_IRQHandler + B EXTI1_IRQHandler + + PUBWEAK EXTI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI2_IRQHandler + B EXTI2_IRQHandler + + PUBWEAK EXTI3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI3_IRQHandler + B EXTI3_IRQHandler + + PUBWEAK EXTI4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI4_IRQHandler + B EXTI4_IRQHandler + + PUBWEAK DMA0_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel0_IRQHandler + B DMA0_Channel0_IRQHandler + + + PUBWEAK DMA0_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel1_IRQHandler + B DMA0_Channel1_IRQHandler + + PUBWEAK DMA0_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel2_IRQHandler + B DMA0_Channel2_IRQHandler + + PUBWEAK DMA0_Channel3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel3_IRQHandler + B DMA0_Channel3_IRQHandler + + PUBWEAK DMA0_Channel4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel4_IRQHandler + B DMA0_Channel4_IRQHandler + + PUBWEAK DMA0_Channel5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel5_IRQHandler + B DMA0_Channel5_IRQHandler + + PUBWEAK DMA0_Channel6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA0_Channel6_IRQHandler + B DMA0_Channel6_IRQHandler + + PUBWEAK ADC0_1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC0_1_IRQHandler + B ADC0_1_IRQHandler + + PUBWEAK USBD_HP_CAN0_TX_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_HP_CAN0_TX_IRQHandler + B USBD_HP_CAN0_TX_IRQHandler + + PUBWEAK USBD_LP_CAN0_RX0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_LP_CAN0_RX0_IRQHandler + B USBD_LP_CAN0_RX0_IRQHandler + + PUBWEAK CAN0_RX1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_RX1_IRQHandler + B CAN0_RX1_IRQHandler + + PUBWEAK CAN0_EWMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +CAN0_EWMC_IRQHandler + B CAN0_EWMC_IRQHandler + + PUBWEAK EXTI5_9_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI5_9_IRQHandler + B EXTI5_9_IRQHandler + + PUBWEAK TIMER0_BRK_TIMER8_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_BRK_TIMER8_IRQHandler + B TIMER0_BRK_TIMER8_IRQHandler + + PUBWEAK TIMER0_UP_TIMER9_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_UP_TIMER9_IRQHandler + B TIMER0_UP_TIMER9_IRQHandler + + PUBWEAK TIMER0_TRG_CMT_TIMER10_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_TRG_CMT_TIMER10_IRQHandler + B TIMER0_TRG_CMT_TIMER10_IRQHandler + + PUBWEAK TIMER0_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER0_Channel_IRQHandler + B TIMER0_Channel_IRQHandler + + PUBWEAK TIMER1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER1_IRQHandler + B TIMER1_IRQHandler + + PUBWEAK TIMER2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER2_IRQHandler + B TIMER2_IRQHandler + + PUBWEAK TIMER3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER3_IRQHandler + B TIMER3_IRQHandler + + PUBWEAK I2C0_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_EV_IRQHandler + B I2C0_EV_IRQHandler + + PUBWEAK I2C0_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C0_ER_IRQHandler + B I2C0_ER_IRQHandler + + PUBWEAK I2C1_EV_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_EV_IRQHandler + B I2C1_EV_IRQHandler + + PUBWEAK I2C1_ER_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +I2C1_ER_IRQHandler + B I2C1_ER_IRQHandler + + PUBWEAK SPI0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI0_IRQHandler + B SPI0_IRQHandler + + PUBWEAK SPI1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI1_IRQHandler + B SPI1_IRQHandler + + PUBWEAK USART0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART0_IRQHandler + B USART0_IRQHandler + + PUBWEAK USART1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART1_IRQHandler + B USART1_IRQHandler + + PUBWEAK USART2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USART2_IRQHandler + B USART2_IRQHandler + + PUBWEAK EXTI10_15_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXTI10_15_IRQHandler + B EXTI10_15_IRQHandler + + PUBWEAK RTC_Alarm_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +RTC_Alarm_IRQHandler + B RTC_Alarm_IRQHandler + + PUBWEAK USBD_WKUP_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +USBD_WKUP_IRQHandler + B USBD_WKUP_IRQHandler + + PUBWEAK TIMER7_BRK_TIMER11_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_BRK_TIMER11_IRQHandler + B TIMER7_BRK_TIMER11_IRQHandler + + PUBWEAK TIMER7_UP_TIMER12_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_UP_TIMER12_IRQHandler + B TIMER7_UP_TIMER12_IRQHandler + + PUBWEAK TIMER7_TRG_CMT_TIMER13_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_TRG_CMT_TIMER13_IRQHandler + B TIMER7_TRG_CMT_TIMER13_IRQHandler + + PUBWEAK TIMER7_Channel_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER7_Channel_IRQHandler + B TIMER7_Channel_IRQHandler + + PUBWEAK ADC2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +ADC2_IRQHandler + B ADC2_IRQHandler + + PUBWEAK EXMC_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +EXMC_IRQHandler + B EXMC_IRQHandler + + PUBWEAK SDIO_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SDIO_IRQHandler + B SDIO_IRQHandler + + PUBWEAK TIMER4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER4_IRQHandler + B TIMER4_IRQHandler + + PUBWEAK SPI2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +SPI2_IRQHandler + B SPI2_IRQHandler + + PUBWEAK UART3_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART3_IRQHandler + B UART3_IRQHandler + + PUBWEAK UART4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +UART4_IRQHandler + B UART4_IRQHandler + + PUBWEAK TIMER5_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER5_IRQHandler + B TIMER5_IRQHandler + + PUBWEAK TIMER6_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +TIMER6_IRQHandler + B TIMER6_IRQHandler + + PUBWEAK DMA1_Channel0_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel0_IRQHandler + B DMA1_Channel0_IRQHandler + + PUBWEAK DMA1_Channel1_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel1_IRQHandler + B DMA1_Channel1_IRQHandler + + PUBWEAK DMA1_Channel2_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel2_IRQHandler + B DMA1_Channel2_IRQHandler + + PUBWEAK DMA1_Channel3_4_IRQHandler + SECTION .text:CODE:NOROOT:REORDER(1) +DMA1_Channel3_4_IRQHandler + B DMA1_Channel3_4_IRQHandler + + END diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/system_gd32f10x.c_ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/system_gd32f10x.c_ new file mode 100644 index 0000000..d4f31b0 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/GD/GD32F10x/Source/system_gd32f10x.c_ differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cm3.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cm3.h new file mode 100644 index 0000000..1b661b4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cm3.h @@ -0,0 +1,1638 @@ +/**************************************************************************//** + * @file core_cm3.h + * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File + * @version V3.30 + * @date 17. February 2014 + * + * @note + * + ******************************************************************************/ +/* Copyright (c) 2009 - 2014 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - 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. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef __CORE_CM3_H_GENERIC +#define __CORE_CM3_H_GENERIC + +/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** \ingroup Cortex_M3 + @{ + */ + +/* CMSIS CM3 definitions */ +#define __CM3_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (0x20) /*!< [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | \ + __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ + +#define __CORTEX_M (0x03) /*!< Cortex-M Core */ + + +#if defined ( __CC_ARM ) + #define __ASM __asm /*!< asm keyword for ARM Compiler */ + #define __INLINE __inline /*!< inline keyword for ARM Compiler */ + #define __STATIC_INLINE static __inline + +#elif defined ( __GNUC__ ) + #define __ASM __asm /*!< asm keyword for GNU Compiler */ + #define __INLINE inline /*!< inline keyword for GNU Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __ICCARM__ ) + #define __ASM __asm /*!< asm keyword for IAR Compiler */ + #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ + #define __STATIC_INLINE static inline + +#elif defined ( __TMS470__ ) + #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __TASKING__ ) + #define __ASM __asm /*!< asm keyword for TASKING Compiler */ + #define __INLINE inline /*!< inline keyword for TASKING Compiler */ + #define __STATIC_INLINE static inline + +#elif defined ( __CSMC__ ) /* Cosmic */ + #define __packed + #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ + #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ + #define __STATIC_INLINE static inline + +#endif + +/** __FPU_USED indicates whether an FPU is used or not. This core does not support an FPU at all +*/ +#define __FPU_USED 0 + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TMS470__ ) + #if defined __TI__VFP_SUPPORT____ + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) /* Cosmic */ + #if ( __CSMC__ & 0x400) // FPU present for parser + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif +#endif + +#include /* standard types definitions */ +#include /* Core Instruction Access */ +#include /* Core Function Access */ + +#endif /* __CORE_CM3_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM3_H_DEPENDANT +#define __CORE_CM3_H_DEPENDANT + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM3_REV + #define __CM3_REV 0x0200 + #warning "__CM3_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0 + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 4 + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0 + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#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 */ + +/*@} end of group Cortex_M3 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { +#if (__CORTEX_M != 0x04) + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ +#else + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ +#endif + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + + +/** \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + + +/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ +#if (__CORTEX_M != 0x04) + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ +#else + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ +#endif + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + + +/** \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/*@} end of group CMSIS_CORE */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24]; + __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24]; + __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24]; + __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24]; + __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56]; + __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644]; + __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL << NVIC_STIR_INTID_Pos) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5]; + __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#if (__CM3_REV < 0x0201) /* core r2p1 */ +#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#else +#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Registers Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* SCB Hard Fault Status Registers Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1]; + __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ +#if ((defined __CM3_REV) && (__CM3_REV >= 0x200)) + __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +#else + uint32_t RESERVED1[1]; +#endif +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __O union + { + __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864]; + __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15]; + __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15]; + __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29]; + __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43]; + __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6]; + __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL << ITM_IWR_ATVALIDM_Pos) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL << ITM_IRR_ATREADYM_Pos) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL << ITM_IMCR_INTEGRATION_Pos) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL << ITM_LSR_Present_Pos) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1]; + __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1]; + __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1]; + __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL << DWT_CTRL_CYCCNTENA_Pos) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL << DWT_CPICNT_CPICNT_Pos) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL << DWT_EXCCNT_EXCCNT_Pos) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL << DWT_SLEEPCNT_SLEEPCNT_Pos) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL << DWT_LSUCNT_LSUCNT_Pos) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL << DWT_FOLDCNT_FOLDCNT_Pos) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL << DWT_MASK_MASK_Pos) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL << DWT_FUNCTION_FUNCTION_Pos) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2]; + __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55]; + __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131]; + __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759]; + __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ + __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1]; + __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39]; + __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8]; + __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL << TPI_ACPR_PRESCALER_Pos) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL << TPI_SPPR_TXMODE_Pos) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL << TPI_FFSR_FlInProg_Pos) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL << TPI_TRIGGER_TRIGGER_Pos) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL << TPI_FIFO0_ETM0_Pos) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ +#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL << TPI_ITATBCTR2_ATREADY_Pos) /*!< TPI ITATBCTR2: ATREADY Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL << TPI_FIFO1_ITM0_Pos) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ +#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL << TPI_ITATBCTR0_ATREADY_Pos) /*!< TPI ITATBCTR0: ATREADY Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x1UL << TPI_ITCTRL_Mode_Pos) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL << TPI_DEVID_NrTraceInput_Pos) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL << TPI_DEVTYPE_SubType_Pos) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if (__MPU_PRESENT == 1) +/** \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register */ +#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register */ +#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register */ +#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register */ +#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register */ +#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL << MPU_RASR_ENABLE_Pos) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register */ +#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Cortex-M3 Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if (__MPU_PRESENT == 1) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +/** \brief Set Priority Grouping + + The function sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8)); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** \brief Get Priority Grouping + + The function reads the priority grouping field from the NVIC Interrupt Controller. + + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) +{ + return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */ +} + + +/** \brief Enable External Interrupt + + The function enables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) +{ + NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */ +} + + +/** \brief Disable External Interrupt + + The function disables a device-specific interrupt in the NVIC interrupt controller. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) +{ + NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */ +} + + +/** \brief Get Pending Interrupt + + The function reads the pending register in the NVIC and returns the pending bit + for the specified interrupt. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + */ +__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */ +} + + +/** \brief Set Pending Interrupt + + The function sets the pending bit of an external interrupt. + + \param [in] IRQn Interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */ +} + + +/** \brief Clear Pending Interrupt + + The function clears the pending bit of an external interrupt. + + \param [in] IRQn External interrupt number. Value cannot be negative. + */ +__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */ +} + + +/** \brief Get Active Interrupt + + The function reads the active register in NVIC and returns the active bit. + + \param [in] IRQn Interrupt number. + + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + */ +__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) +{ + return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */ +} + + +/** \brief Set Interrupt Priority + + The function sets the priority of an interrupt. + + \note The priority cannot be set for every core interrupt. + + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + */ +__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if(IRQn < 0) { + SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */ + else { + NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */ +} + + +/** \brief Get Interrupt Priority + + The function reads the priority of an interrupt. The interrupt + number can be positive to specify an external (device specific) + interrupt, or negative to specify an internal (core) interrupt. + + + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented + priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) +{ + + if(IRQn < 0) { + return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M system interrupts */ + else { + return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */ +} + + +/** \brief Encode Priority + + The function encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the samllest possible priority group is set. + + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp; + SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS; + + return ( + ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) | + ((SubPriority & ((1 << (SubPriorityBits )) - 1))) + ); +} + + +/** \brief Decode Priority + + The function decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set. + + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp; + SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS; + + *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1); + *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1); +} + + +/** \brief System Reset + + The function initiates a system reset request to reset the MCU. + */ +__STATIC_INLINE void NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + while(1); /* wait until reset */ +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if (__Vendor_SysTickConfig == 0) + +/** \brief System Tick Configuration + + The function initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + + \param [in] ticks Number of ticks between two interrupts. + + \return 0 Function succeeded. + \return 1 Function failed. + + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */ + + SysTick->LOAD = ticks - 1; /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** \brief ITM Send Character + + The function transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + + \param [in] ch Character to transmit. + + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if ((ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */ + (ITM->TER & (1UL << 0) ) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0].u32 == 0); + ITM->PORT[0].u8 = (uint8_t) ch; + } + return (ch); +} + + +/** \brief ITM Receive Character + + The function inputs a character via the external variable \ref ITM_RxBuffer. + + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) { + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** \brief ITM Check Character + + The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) { + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) { + return (0); /* no character available */ + } else { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + +#endif /* __CORE_CM3_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ + +#ifdef __cplusplus +} +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmFunc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmFunc.h new file mode 100644 index 0000000..2c2af69 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmFunc.h @@ -0,0 +1,637 @@ +/**************************************************************************//** + * @file core_cmFunc.h + * @brief CMSIS Cortex-M Core Function Access Header File + * @version V3.30 + * @date 17. February 2014 + * + * @note + * + ******************************************************************************/ +/* Copyright (c) 2009 - 2014 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - 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. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + + +#ifndef __CORE_CMFUNC_H +#define __CORE_CMFUNC_H + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ +/* ARM armcc specific functions */ + +#if (__ARMCC_VERSION < 400677) + #error "Please use ARM Compiler Toolchain V4.0.677 or later!" +#endif + +/* intrinsic void __enable_irq(); */ +/* intrinsic void __disable_irq(); */ + +/** \brief Get Control Register + + This function returns the content of the Control Register. + + \return Control Register value + */ +__STATIC_INLINE uint32_t __get_CONTROL(void) +{ + register uint32_t __regControl __ASM("control"); + return(__regControl); +} + + +/** \brief Set Control Register + + This function writes the given value to the Control Register. + + \param [in] control Control Register value to set + */ +__STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + register uint32_t __regControl __ASM("control"); + __regControl = control; +} + + +/** \brief Get IPSR Register + + This function returns the content of the IPSR Register. + + \return IPSR Register value + */ +__STATIC_INLINE uint32_t __get_IPSR(void) +{ + register uint32_t __regIPSR __ASM("ipsr"); + return(__regIPSR); +} + + +/** \brief Get APSR Register + + This function returns the content of the APSR Register. + + \return APSR Register value + */ +__STATIC_INLINE uint32_t __get_APSR(void) +{ + register uint32_t __regAPSR __ASM("apsr"); + return(__regAPSR); +} + + +/** \brief Get xPSR Register + + This function returns the content of the xPSR Register. + + \return xPSR Register value + */ +__STATIC_INLINE uint32_t __get_xPSR(void) +{ + register uint32_t __regXPSR __ASM("xpsr"); + return(__regXPSR); +} + + +/** \brief Get Process Stack Pointer + + This function returns the current value of the Process Stack Pointer (PSP). + + \return PSP Register value + */ +__STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + return(__regProcessStackPointer); +} + + +/** \brief Set Process Stack Pointer + + This function assigns the given value to the Process Stack Pointer (PSP). + + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + __regProcessStackPointer = topOfProcStack; +} + + +/** \brief Get Main Stack Pointer + + This function returns the current value of the Main Stack Pointer (MSP). + + \return MSP Register value + */ +__STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + return(__regMainStackPointer); +} + + +/** \brief Set Main Stack Pointer + + This function assigns the given value to the Main Stack Pointer (MSP). + + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + __regMainStackPointer = topOfMainStack; +} + + +/** \brief Get Priority Mask + + This function returns the current state of the priority mask bit from the Priority Mask Register. + + \return Priority Mask value + */ +__STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + register uint32_t __regPriMask __ASM("primask"); + return(__regPriMask); +} + + +/** \brief Set Priority Mask + + This function assigns the given value to the Priority Mask Register. + + \param [in] priMask Priority Mask + */ +__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + register uint32_t __regPriMask __ASM("primask"); + __regPriMask = (priMask); +} + + +#if (__CORTEX_M >= 0x03) + +/** \brief Enable FIQ + + This function enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq + + +/** \brief Disable FIQ + + This function disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq + + +/** \brief Get Base Priority + + This function returns the current value of the Base Priority register. + + \return Base Priority register value + */ +__STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + register uint32_t __regBasePri __ASM("basepri"); + return(__regBasePri); +} + + +/** \brief Set Base Priority + + This function assigns the given value to the Base Priority register. + + \param [in] basePri Base Priority value to set + */ +__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) +{ + register uint32_t __regBasePri __ASM("basepri"); + __regBasePri = (basePri & 0xff); +} + + +/** \brief Get Fault Mask + + This function returns the current value of the Fault Mask register. + + \return Fault Mask register value + */ +__STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + return(__regFaultMask); +} + + +/** \brief Set Fault Mask + + This function assigns the given value to the Fault Mask register. + + \param [in] faultMask Fault Mask value to set + */ +__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + __regFaultMask = (faultMask & (uint32_t)1); +} + +#endif /* (__CORTEX_M >= 0x03) */ + + +#if (__CORTEX_M == 0x04) + +/** \brief Get FPSCR + + This function returns the current value of the Floating Point Status/Control register. + + \return Floating Point Status/Control register value + */ +__STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + register uint32_t __regfpscr __ASM("fpscr"); + return(__regfpscr); +#else + return(0); +#endif +} + + +/** \brief Set FPSCR + + This function assigns the given value to the Floating Point Status/Control register. + + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + register uint32_t __regfpscr __ASM("fpscr"); + __regfpscr = (fpscr); +#endif +} + +#endif /* (__CORTEX_M == 0x04) */ + + +#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ +/* GNU gcc specific functions */ + +/** \brief Enable IRQ Interrupts + + This function enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} + + +/** \brief Disable IRQ Interrupts + + This function disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} + + +/** \brief Get Control Register + + This function returns the content of the Control Register. + + \return Control Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +/** \brief Set Control Register + + This function writes the given value to the Control Register. + + \param [in] control Control Register value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +/** \brief Get IPSR Register + + This function returns the content of the IPSR Register. + + \return IPSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get APSR Register + + This function returns the content of the APSR Register. + + \return APSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get xPSR Register + + This function returns the content of the xPSR Register. + + \return xPSR Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** \brief Get Process Stack Pointer + + This function returns the current value of the Process Stack Pointer (PSP). + + \return PSP Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); + return(result); +} + + +/** \brief Set Process Stack Pointer + + This function assigns the given value to the Process Stack Pointer (PSP). + + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); +} + + +/** \brief Get Main Stack Pointer + + This function returns the current value of the Main Stack Pointer (MSP). + + \return MSP Register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); + return(result); +} + + +/** \brief Set Main Stack Pointer + + This function assigns the given value to the Main Stack Pointer (MSP). + + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp"); +} + + +/** \brief Get Priority Mask + + This function returns the current state of the priority mask bit from the Priority Mask Register. + + \return Priority Mask value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +/** \brief Set Priority Mask + + This function assigns the given value to the Priority Mask Register. + + \param [in] priMask Priority Mask + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (__CORTEX_M >= 0x03) + +/** \brief Enable FIQ + + This function enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} + + +/** \brief Disable FIQ + + This function disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} + + +/** \brief Get Base Priority + + This function returns the current value of the Base Priority register. + + \return Base Priority register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_max" : "=r" (result) ); + return(result); +} + + +/** \brief Set Base Priority + + This function assigns the given value to the Base Priority register. + + \param [in] basePri Base Priority value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); +} + + +/** \brief Get Fault Mask + + This function returns the current value of the Fault Mask register. + + \return Fault Mask register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +/** \brief Set Fault Mask + + This function assigns the given value to the Fault Mask register. + + \param [in] faultMask Fault Mask value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + +#endif /* (__CORTEX_M >= 0x03) */ + + +#if (__CORTEX_M == 0x04) + +/** \brief Get FPSCR + + This function returns the current value of the Floating Point Status/Control register. + + \return Floating Point Status/Control register value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + uint32_t result; + + /* Empty asm statement works as a scheduling barrier */ + __ASM volatile (""); + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + __ASM volatile (""); + return(result); +#else + return(0); +#endif +} + + +/** \brief Set FPSCR + + This function assigns the given value to the Floating Point Status/Control register. + + \param [in] fpscr Floating Point Status/Control value to set + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + /* Empty asm statement works as a scheduling barrier */ + __ASM volatile (""); + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); + __ASM volatile (""); +#endif +} + +#endif /* (__CORTEX_M == 0x04) */ + + +#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ +/* IAR iccarm specific functions */ +#include + + +#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ +/* TI CCS specific functions */ +#include + + +#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ +/* TASKING carm specific functions */ +/* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + +#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/ +/* Cosmic specific functions */ +#include + +#endif + +/*@} end of CMSIS_Core_RegAccFunctions */ + +#endif /* __CORE_CMFUNC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmInstr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmInstr.h new file mode 100644 index 0000000..d2ec262 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/CMSIS/core_cmInstr.h @@ -0,0 +1,687 @@ +/**************************************************************************//** + * @file core_cmInstr.h + * @brief CMSIS Cortex-M Core Instruction Access Header File + * @version V3.30 + * @date 17. February 2014 + * + * @note + * + ******************************************************************************/ +/* Copyright (c) 2009 - 2014 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - 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. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + + +#ifndef __CORE_CMINSTR_H +#define __CORE_CMINSTR_H + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ +/* ARM armcc specific functions */ + +#if (__ARMCC_VERSION < 400677) + #error "Please use ARM Compiler Toolchain V4.0.677 or later!" +#endif + + +/** \brief No Operation + + No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __nop + + +/** \brief Wait For Interrupt + + Wait For Interrupt is a hint instruction that suspends execution + until one of a number of events occurs. + */ +#define __WFI __wfi + + +/** \brief Wait For Event + + Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __wfe + + +/** \brief Send Event + + Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __sev + + +/** \brief Instruction Synchronization Barrier + + Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or + memory, after the instruction has been completed. + */ +#define __ISB() __isb(0xF) + + +/** \brief Data Synchronization Barrier + + This function acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __dsb(0xF) + + +/** \brief Data Memory Barrier + + This function ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __dmb(0xF) + + +/** \brief Reverse byte order (32 bit) + + This function reverses the byte order in integer value. + + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV __rev + + +/** \brief Reverse byte order (16 bit) + + This function reverses the byte order in two unsigned short values. + + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) +{ + rev16 r0, r0 + bx lr +} +#endif + +/** \brief Reverse byte order in signed short value + + This function reverses the byte order in a signed short value with sign extension to integer. + + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value) +{ + revsh r0, r0 + bx lr +} +#endif + + +/** \brief Rotate Right in unsigned value (32 bit) + + This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + + \param [in] value Value to rotate + \param [in] value Number of Bits to rotate + \return Rotated value + */ +#define __ROR __ror + + +/** \brief Breakpoint + + This function causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __breakpoint(value) + + +#if (__CORTEX_M >= 0x03) + +/** \brief Reverse bit order of value + + This function reverses the bit order of the given value. + + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __rbit + + +/** \brief LDR Exclusive (8 bit) + + This function performs a exclusive LDR command for 8 bit value. + + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) + + +/** \brief LDR Exclusive (16 bit) + + This function performs a exclusive LDR command for 16 bit values. + + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) + + +/** \brief LDR Exclusive (32 bit) + + This function performs a exclusive LDR command for 32 bit values. + + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) + + +/** \brief STR Exclusive (8 bit) + + This function performs a exclusive STR command for 8 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB(value, ptr) __strex(value, ptr) + + +/** \brief STR Exclusive (16 bit) + + This function performs a exclusive STR command for 16 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH(value, ptr) __strex(value, ptr) + + +/** \brief STR Exclusive (32 bit) + + This function performs a exclusive STR command for 32 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW(value, ptr) __strex(value, ptr) + + +/** \brief Remove the exclusive lock + + This function removes the exclusive lock which is created by LDREX. + + */ +#define __CLREX __clrex + + +/** \brief Signed Saturate + + This function saturates a signed value. + + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __ssat + + +/** \brief Unsigned Saturate + + This function saturates an unsigned value. + + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __usat + + +/** \brief Count leading zeros + + This function counts the number of leading zeros of a data value. + + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ __clz + +#endif /* (__CORTEX_M >= 0x03) */ + + +#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ +/* GNU gcc specific functions */ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constrant "l" + * Otherwise, use general registers, specified by constrant "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** \brief No Operation + + No Operation does nothing. This instruction can be used for code alignment purposes. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void) +{ + __ASM volatile ("nop"); +} + + +/** \brief Wait For Interrupt + + Wait For Interrupt is a hint instruction that suspends execution + until one of a number of events occurs. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void) +{ + __ASM volatile ("wfi"); +} + + +/** \brief Wait For Event + + Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void) +{ + __ASM volatile ("wfe"); +} + + +/** \brief Send Event + + Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void) +{ + __ASM volatile ("sev"); +} + + +/** \brief Instruction Synchronization Barrier + + Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or + memory, after the instruction has been completed. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void) +{ + __ASM volatile ("isb"); +} + + +/** \brief Data Synchronization Barrier + + This function acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void) +{ + __ASM volatile ("dsb"); +} + + +/** \brief Data Memory Barrier + + This function ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void) +{ + __ASM volatile ("dmb"); +} + + +/** \brief Reverse byte order (32 bit) + + This function reverses the byte order in integer value. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else + uint32_t result; + + __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +#endif +} + + +/** \brief Reverse byte order (16 bit) + + This function reverses the byte order in two unsigned short values. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** \brief Reverse byte order in signed short value + + This function reverses the byte order in a signed short value with sign extension to integer. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (short)__builtin_bswap16(value); +#else + uint32_t result; + + __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +#endif +} + + +/** \brief Rotate Right in unsigned value (32 bit) + + This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + + \param [in] value Value to rotate + \param [in] value Number of Bits to rotate + \return Rotated value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + return (op1 >> op2) | (op1 << (32 - op2)); +} + + +/** \brief Breakpoint + + This function causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +#if (__CORTEX_M >= 0x03) + +/** \brief Reverse bit order of value + + This function reverses the bit order of the given value. + + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); + return(result); +} + + +/** \brief LDR Exclusive (8 bit) + + This function performs a exclusive LDR command for 8 bit value. + + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** \brief LDR Exclusive (16 bit) + + This function performs a exclusive LDR command for 16 bit values. + + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** \brief LDR Exclusive (32 bit) + + This function performs a exclusive LDR command for 32 bit values. + + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); +} + + +/** \brief STR Exclusive (8 bit) + + This function performs a exclusive STR command for 8 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** \brief STR Exclusive (16 bit) + + This function performs a exclusive STR command for 16 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** \brief STR Exclusive (32 bit) + + This function performs a exclusive STR command for 32 bit values. + + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); +} + + +/** \brief Remove the exclusive lock + + This function removes the exclusive lock which is created by LDREX. + + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void) +{ + __ASM volatile ("clrex" ::: "memory"); +} + + +/** \brief Signed Saturate + + This function saturates a signed value. + + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** \brief Unsigned Saturate + + This function saturates an unsigned value. + + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** \brief Count leading zeros + + This function counts the number of leading zeros of a data value. + + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + +#endif /* (__CORTEX_M >= 0x03) */ + + +#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ +/* IAR iccarm specific functions */ +#include + + +#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ +/* TI CCS specific functions */ +#include + + +#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ +/* TASKING carm specific functions */ +/* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + +#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/ +/* Cosmic specific functions */ +#include + +#endif + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + +#endif /* __CORE_CMINSTR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.c new file mode 100644 index 0000000..fdaed02 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.h new file mode 100644 index 0000000..e610a02 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/ADC/adc.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.c new file mode 100644 index 0000000..8c1660f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.c @@ -0,0 +1,324 @@ +/*********************************************************************** +* @file name: canbusdrv.c +* @create date: 2022-11-12 +* @author +* @version: V 1.0.0 +* @remark: + ģcanͳһMCUӿڵIJͬһͳһĽӿ + MCUĸ漰 +************************************************************************/ +#include +#include +#include "canbusdrv.h" +#include "candrvctrl.h" + +/** + * ģcanͳһMCUӿڵIJͬһͳһĽӿ + * MCUĸ漰 + */ +/** + * ģͳһɣߵжշ쳣 + */ + +static st_cancb tpcb[2]; + +/***************************************************************************************** + * can շͶеĴ + *****************************************************************************************/ + + +typedef struct{ + bsp_can_cfg_t bsp_cfg; /* can */ + unsigned int open_flg; /* 򿪱־ 0 - ر 1- 2-Ѵ*/ + unsigned int sending; /* ڷ͵flag */ + can_frame_t tmp_frame; /* ʱ */ +}can_bus_t; + + +static can_bus_t canbus[BSP_CAN_CHANNEL_NUM]={0}; + + +static __inline void can_bus_ready_hook(unsigned char channel) +{ + if (channel >= BSP_CAN_CHANNEL_NUM) { + return; + } +} + + +/** + * @brief: յϢHOOK + * + * @param channel: ͨ + * @param pt_fram[IN]: յϢ + * + * @return: + */ +void bsp_can_msg_receive_hook(unsigned char channel, const can_frame_t * pt_fram) +{ + + if (channel >= BSP_CAN_CHANNEL_NUM) + { + return; + } + if(tpcb[channel].hdlFrmReceve != NULL) + { + tpcb[channel].hdlFrmReceve(channel,(pt_fram->IDE == CAN_ID_EXT)?pt_fram->ExtId:pt_fram->StdId, pt_fram->Data, pt_fram->DLC); + } + can_bus_ready_hook(channel); +} + + +/** + * @brief: Ϣɵhook + * + * @param channel: ͨ + * @param fifo_id: ϢյID + * @param success: true ͳɹ false ʧ + * + * @return: void + * + * @remark: FIFOյhook + */ +void bsp_can_msg_sent_hook(unsigned char channel, unsigned char fifo_id, bool success) +{ + unsigned char ret_id; + + if (channel >= BSP_CAN_CHANNEL_NUM) + { + return; + } + + /* жǷڷ */ + if (canbus[channel].sending&(0x00000001<= BSP_CAN_CHANNEL_NUM) { + return; + } + + SYS_ENTER_CRITICAL(); + if(tpcb[channel].BusOffCb != NULL) + { + tpcb[channel].BusOffCb(channel); + } + SYS_EXIT_CRITICAL(); + if (canbus[channel].sending > 0) + { + /* ˵зʧܵģԷʧܵĺ */ + canbus[channel].sending = 0; + } +} + + +/** + * @brief: лӦ״̬hook + * + * @param channel: can ͨ, + * + * @return: void + * + * @remark: ӦлδӦʱһ + */ +void can_bus_err_passive_hook(unsigned char channel) +{ + if (channel >= BSP_CAN_CHANNEL_NUM) { + return; + } + + if(tpcb[channel].BusErrorStsCb != NULL) + { + tpcb[channel].BusErrorStsCb(channel, canbus[channel].sending > 0?true:false); + } +} + + + +/** + * @brief: 첽ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return Ƿɹ + * true: ɹ false: ʧ + */ +bool can_bus_send(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len) +{ + can_frame_t tmp; + + if (chan >= BSP_CAN_CHANNEL_NUM) + { + return false; + } + + CAN_FRAME_INIT(&tmp, canid, data, len); + + + bsp_can_msg_sent_hook(chan, 0, true); + + + return true; +} + + + +/** + * @brief: ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return رʶţ0xFF ʶʧ + */ +unsigned char can_bus_send_rt(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len) +{ + unsigned char ret_id; + + if (chan >= BSP_CAN_CHANNEL_NUM || canbus[chan].open_flg != 2) + { + return false; + } + + CAN_FRAME_INIT(&canbus[chan].tmp_frame, canid, data, len); + + ret_id = bsp_can_msg_send(chan, &canbus[chan].tmp_frame); + + if (ret_id != 0xFF) + { + canbus[chan].sending |= (0x00000001<= BSP_CAN_CHANNEL_NUM) + { + return false; + } + + canbus[chan].open_flg = 1; + canbus[chan].bsp_cfg.abom = false; + canbus[chan].bsp_cfg.sleep = listen; + canbus[chan].bsp_cfg.domain_h = highdomain; + canbus[chan].bsp_cfg.krate = krate; + + canbus[chan].sending = 0; + if (bsp_can_open(chan, &canbus[chan].bsp_cfg)) + { + canbus[chan].open_flg = 2; + } + else + { + canbus[chan].open_flg = 0; + } + return canbus[chan].open_flg == 2; +} + + +/** + * @brief: رսӿ + * + * @return: + * ؽ: true - open ɹ false - open ʧ + */ +bool can_bus_close(unsigned char channel) +{ + canbus[channel].open_flg = 0; + bsp_can_close(channel); +} + + + +static const st_canif tpchan[] = +{ + { + 0, //chan1 + can_bus_open, //ConfigCan + can_bus_send_rt, //canSend + can_bus_close, //canClose + NULL, //canHwPowerDown + NULL, //canHwPowerUp + NULL, //canBusFilterInit + NULL, //canCloseFilter + }, + + { + 1, //chan2 + can_bus_open, //ConfigCan + can_bus_send_rt, //canSend + can_bus_close, //canClose + NULL, //canHwPowerDown + NULL, //canHwPowerUp + NULL, //canBusFilterInit + NULL, //canCloseFilter + }, +}; + + + +void InitCanifToCanDrvCtrl(void) +{ + st_cancb *pcb; + + memset(&canbus[0], 0x00, sizeof(canbus)); + memset(&tpcb[0], 0x00, sizeof(tpcb)); + + pcb = RegisterCanIF(&tpchan[0]); + if(pcb!=NULL) + memcpy(&tpcb[0],pcb,sizeof(st_cancb)); /* ±Ҫst_canif.chan һ */ + + pcb = RegisterCanIF(&tpchan[1]); + if(pcb!=NULL) + memcpy(&tpcb[1],pcb,sizeof(st_cancb)); /* ±Ҫst_canif.chan һ */ +} + + + +//#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.h new file mode 100644 index 0000000..a657ba8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanBusDrv.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.c new file mode 100644 index 0000000..1b37cb0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.c @@ -0,0 +1,845 @@ +/*********************************************************************** +* @file name: candrvctrl.c +* @create date: 2022-11-19 +* @author +* @version: V 1.0.0 +* @remark: + ģcanͳһMCUӿڵIJͬһͳһĽӿ + MCUĸ漰 +************************************************************************/ + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// CAN<------> +////////////////////////////////////////////////////////////////////////////////////////////////////// +//canͨidcanϢ֡id֮ͬcanidʾ׳ֻ +// chanʾcanͨ +// frmidʾcanϢ֡id +// +// +//can㽫ҪƵĽӿͨst_cancb * RegisterCanIF(st_canif *if) ӿڴģ +//st_cancb * RegisterCanIF(st_canif *if) 㽫ijӿڵĿȨCanDrvCtrlģ +//st_canif ͳһCanDrvCtrl Ľӿб,ConfigCan ,canSendcanidṩ +//ػصʵʱе +*********************************************************************************************************************/ + +#include "porting.h" +#include "candrvctrl.h" + +#if 0 +#define M_DEBUGF printf +#else +#define M_DEBUGF(...) ; +#endif + +#define MAX_CAN_IF_NUM 2 +#define PROTOCOL_VALID(PL) (PL.prompt[0] !=0) //жǷЭ鰲װijӿڣͨЭ +#define SET_PROTOCOL_INVALID(PL) (PL.prompt[0] =0) + +typedef enum +{ + e_step_send_idle=0, //еȴe_step_send,ͨʱ + e_step_send, //зȻe_step_waitackȴ //ͨϢ + e_step_waitack, //ͨʱ + e_step_resend, //ط,ʱӦ̳쳣ʱ + e_step_fail, //Ѿʧ + e_step_suc, //ͳɹ +}st_sendstep; + + +typedef struct +{ + unsigned int frmid; //canϢid + unsigned char sendindex; + unsigned char datalen; + unsigned char data[8]; + unsigned int msgident; + void(*cb)(unsigned int msgident,unsigned int result); +}st_senditem; +typedef struct +{ + unsigned int frmid; //canϢid + unsigned char datalen; + unsigned char data[8]; +}st_recitem; + + +typedef struct +{ + unsigned char stimes; + st_sendstep step; + st_senditem sending; //ǰڷ͵ + unsigned char waittime; //ȴʱ + unsigned char retrytimes; +}st_sendmsg; + + +typedef struct +{ + st_canif canif; + st_pl pl; + unsigned char linkSts; + st_fifo_t rec; + st_fifo_t send; + unsigned char *prec; + unsigned char *psend; + st_sendmsg smsg; //ǰϢ +}st_if; + +static void hdlIfSendSuccessCb(unsigned char chan,unsigned int index); +static void hdlIfBusErrorCb(unsigned char chan,bool sending); +static void hdlIfBusErrorStsCb(unsigned char chan,bool sending); +static bool hdlIfFrmReceve(unsigned char chan,unsigned int canid,const unsigned char *data,unsigned char len); +static void HdlSendMsgSuccess(st_if* pif,unsigned char index); +static void hdlIfBusOffCb(unsigned char chan); + +static st_if CanIF[MAX_CAN_IF_NUM]; +static st_cancb canifcb ={ + hdlIfSendSuccessCb, + hdlIfBusErrorCb, + hdlIfBusErrorStsCb, + hdlIfBusOffCb, + hdlIfFrmReceve}; + + +static st_if* GetIfFromChanel(unsigned char chan) +{ + unsigned char i; + + for(i=0;(ilinkSts <= e_sts_closed) + { + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + } + else if(pif->linkSts == e_err_sending && sending) + { + M_DEBUGF("[CDCtrl]hdlIfBusErrorStsCb: ⵽߷쳣!\n"); + pif->linkSts = e_err_sending; + can_kill( E_CAN_MSG_SIG,e_err_sending,chan); + } + else if(pif->linkSts != e_err_sending && sending == false) + { + M_DEBUGF("[CDCtrl]hdlIfBusErrorStsCb: ⵽߽쳣!\n"); + pif->linkSts = e_err_receive; + can_kill( E_CAN_MSG_SIG,e_err_receive,chan); + } + else + { + /* */ + } + } +} +static void hdlIfBusErrorStsCb(unsigned char chan,bool sending) +{ + hdlIfBusErrorCb(chan,sending); +} + + + +static void hdlIfBusOffCb(unsigned char chan) +{ + st_if* pif; + + pif=GetIfFromChanel(chan); + if(pif != NULL) + { + if(pif->linkSts <= e_sts_closed) + { + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + } + else + { + M_DEBUGF("[CDCtrl]hdlIfBusOffCb: ⵽BUSOFF!\n"); + pif->linkSts = e_err_bussoff; + can_kill( E_CAN_MSG_SIG,e_err_bussoff,chan); + } + } +} +static st_recitem tmpRItem; +static bool hdlIfFrmReceve(unsigned char chan,unsigned int canid,const unsigned char *data,unsigned char len) +{ + st_if* pif; + + pif = GetIfFromChanel(chan); + + if(pif != NULL && pif->linkSts >= e_sts_working) + { + if(e_err_receive == pif->linkSts) + { + pif->linkSts=e_sts_working; + } + + if(pif->pl.flg&CAN_FLG_SYNCRECEIVE) + { + if(pif->pl.hdlRecCanMsg!=NULL) pif->pl.hdlRecCanMsg(canid,data,len); + } + else + { + tmpRItem.frmid = canid; + tmpRItem.datalen = len; + if(tmpRItem.datalen > 0 && tmpRItem.datalen<=8) CAN_COPY(tmpRItem.data,data,tmpRItem.datalen); + + sfifo_write(&pif->rec,&tmpRItem); + if(sfifo_full(&pif->rec)) + { + M_DEBUGF("[CDCtrl]hdlIfFrmReceve: ջ\n"); + pif->linkSts=e_err_overfllow; + can_kill( E_CAN_MSG_SIG,e_err_overfllow,chan); + } + } + } + + return true; +} + + +//עͨŽӿںͳʼ +st_cancb * RegisterCanIF(const st_canif *IF) +{ + unsigned char i; + + if(IF == NULL || IF->ConfigCan == NULL || IF->canSend==NULL ) return NULL; + + for(i=0;ichan) return NULL; + } + + for(i=0;i= WAIT_ACK_TIME) + { + CanIF[i].smsg.step = e_step_resend; + can_kill( E_CAN_MSG_SIG,e_sts_needsend,CanIF[i].canif.chan); + } + } + } +} + + +static void StartResendMsgTmr(void) +{ + if(waitSendAck == 0) waitSendAck = can_timer_create(waitSendMsgAck); + if(can_timer_switch(waitSendAck) == false) can_timer_start(waitSendAck, WAIT_ACK_INTERVAL); +} + + +static void HdlAllSengMsgSts(st_if* pif) +{ + bool flg = false; + +#if CAN_SEND_FASET_MODE > 0 + do { + flg = false; +#endif + switch(pif->smsg.step) + { + case e_step_send_idle: //еȴe_step_send,ͨʱ + if(pif->linkSts >= e_sts_working) + { + if(sfifo_empty(&(pif->send))==false) + { + if(sfifo_read(&(pif->send),&(pif->smsg.sending))) + { + pif->smsg.step=e_step_send; + pif->smsg.stimes = 0; + pif->smsg.waittime = 0; + } + flg = true; + } + } + break; + + case e_step_send: //зȻe_step_waitackȴ //ͨϢ + pif->smsg.sending.sendindex = pif->canif.canSend(pif->canif.chan,pif->smsg.sending.frmid,pif->smsg.sending.data,pif->smsg.sending.datalen); + + pif->smsg.stimes++; + if(pif->smsg.sending.sendindex != 0xFF) + { + pif->smsg.step=e_step_waitack; + pif->smsg.waittime = 0; + flg = true; + if(pif->linkSts == e_err_sending) pif->linkSts = e_sts_working; + } + else + { + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step=e_step_fail; + flg = true; + } + } + break; + #if 1 + case e_step_waitack: //ͨʱ + break; + case e_step_resend: //ط,ʱӦ̳쳣ʱ + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step=e_step_fail; + } + else + { + pif->smsg.step=e_step_send; + } + flg = true; + break; + case e_step_fail: //Ѿʧ + pif->smsg.step=e_step_send_idle; + if(pif->smsg.sending.cb != NULL) {pif->smsg.sending.cb(pif->smsg.sending.msgident,_FAILURE);} + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_FAILURE);} + flg = true; + break; + case e_step_suc: //ͳɹ + pif->smsg.step=e_step_send_idle; + #if CAN_SEND_FASET_MODE > 0 + if(pif->smsg.sending.cb != NULL) {can_kill(E_CAN_MSG_CB_SIG, (unsigned int)(pif->smsg.sending.cb),pif->smsg.sending.msgident);} + else if (pif->pl.hdlCommSent != NULL) {can_kill(E_CAN_MSG_CB_SIG, (unsigned int)(pif->pl.hdlCommSent),pif->smsg.sending.msgident);} + #else + if(pif->smsg.sending.cb != NULL) {pif->smsg.sending.cb(pif->smsg.sending.msgident,_SUCCESS);} + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_SUCCESS);} + #endif + flg = true; + break; + #endif + } +#if CAN_SEND_FASET_MODE > 0 + }while(flg == true && (pif->smsg.step != e_step_fail)); +#endif + if(flg) can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + +} + + +static void HdlSendMsgError(st_if* pif) +{ + if(pif->smsg.step == e_step_waitack) + { + M_DEBUGF("[CDCtrl]chan%d%d(%d)ηʧ\n",pif->canif.chan,pif->smsg.stimes,pif->pl.resendTimes); + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step = e_step_fail; + } + else + { + pif->smsg.step = e_step_resend; + } + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + } + else + { + M_DEBUGF("[CDCtrl]HdlSendError,ǰͲ%d!=%d\n",pif->smsg.step,e_step_waitack); + } +} + +static void HdlSendMsgSuccess(st_if* pif,unsigned char index) +{ + //M_DEBUGF("[CDCtrl]chan=%d,%o sendOK(%d)\n",pif->canif.chan,index,pif->smsg.step); + + if(pif->smsg.step == e_step_waitack||pif->smsg.step ==e_step_resend) + { + if(pif->smsg.sending.sendindex == index) + { + pif->smsg.step = e_step_suc; + + #if CAN_SEND_FASET_MODE > 0 + if(pif->linkSts >= e_sts_working) HdlAllSengMsgSts(pif); + #else + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + #endif + } + else + { + M_DEBUGF("[CDCtrl]chan %d,index :%o#%o\n",pif->canif.chan,index,pif->smsg.sending.sendindex); + } + } +} + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// <------> Э ************************** +////////////////////////////////////////////////////////////////////////////////////////////////////// +//bool InstallProtocalToIF(unsigned char canid, st_pl* pif, st_cl * pcanif); ijӿЭ֮ +// ͬһʱ䣬һӿڽһЭ +//st_pl ЭҪṩĽӿڣЩϢҪʱCANDRVCTRL +//st_cl, CANDRVCTRL ṩĽӿڣ ЭͨЩӿڽݷ͵ +*********************************************************************************************************************/ + +static bool plSend(unsigned char chan,unsigned int frmid,unsigned char *data,unsigned char len,unsigned int msgident,void(*cb)(unsigned int msgident,unsigned int result))//Ϊ0ʾԶ֡ +{ + st_senditem send; + st_if* pif=NULL; + + pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed|| len>8 || sfifo_full(&pif->send)) return false; + + SYS_ENTER_CRITICAL(); + if (pif->linkSts == e_err_bussoff || pif->linkSts < e_sts_working) + { + SYS_EXIT_CRITICAL(); + return false; + } + + send.cb = cb; + send.frmid = frmid; + send.datalen = len; + send.msgident = msgident; + if(data == NULL) send.datalen = 0; + if(send.datalen>0 && send.datalen<=8) CAN_COPY(send.data,data,send.datalen); + send.sendindex = 0xFF; + + sfifo_write(&pif->send,&send); + + if(pif->smsg.step == e_step_send_idle) + { + #if CAN_SEND_FASET_MODE > 0 + HdlAllSengMsgSts(pif); + #else + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + #endif + } + SYS_EXIT_CRITICAL(); + return true; +} + +static bool plReceive(unsigned char chan,unsigned int* frmid,unsigned char *data,unsigned char* len)//Ϊ0ʾԶ֡ +{ + st_recitem rec; + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed || data==NULL || (pif->pl.flg&CAN_FLG_SYNCRECEIVE)) return false; + + if(sfifo_empty(&pif->rec)) return false; + + if(sfifo_read(&pif->rec,&rec)==0) return false; + *frmid = rec.frmid; + *len = rec.datalen; + if(rec.datalen > 0 && rec.datalen<=8) CAN_COPY(data,rec.data,rec.datalen); + + if (pif->linkSts == e_err_overfllow) + { + pif->linkSts = e_sts_working; + } + return true; +} + +static unsigned int plGetCurrentLinkSts(unsigned char chan) //ȡǰ״̬ +{ + st_if* pif=NULL; + + + pif=GetIfFromChanel(chan); + + if(pif !=NULL) return pif->linkSts; + + return 0; +} + +static bool plConfigBus(unsigned char chan,unsigned short krate, bool highdomain,bool listen) +{ + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_unused) return false; + + if(pif->canif.ConfigCan != NULL) + { + if(pif->canif.ConfigCan(chan,krate,highdomain,listen)) + { + if(pif->psend != NULL) + { + sfifo_init(&pif->send,pif->psend,sizeof(st_senditem),pif->pl.msgNumber); + } + if((pif->pl.flg&CAN_FLG_SYNCRECEIVE)==0 && (pif->prec != NULL)) + { + sfifo_init(&pif->rec,pif->prec,sizeof(st_recitem),pif->pl.msgNumber); + } + pif->linkSts = e_sts_working; + return true; + } + } + return false; +} + +static bool plcanBusFilterInit(unsigned char chan,unsigned int *filterID_array, unsigned short filterID_total) +{ + return false; +} + +static bool plCloseLink(unsigned char chan) +{ + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed) return false; + pif->linkSts = e_sts_closed; + + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + + if(pif->smsg.step != e_step_send_idle) + { + if(pif->smsg.sending.cb != NULL) + { + if(pif->smsg.step == e_step_suc) + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_SUCCESS); + } + else if(pif->smsg.step == e_step_fail) + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_FAILURE); + } + else + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_ABANDON); + } + } + else if (pif->pl.hdlCommSent != NULL) + { + if(pif->smsg.step == e_step_suc) + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_SUCCESS); + } + else if(pif->smsg.step == e_step_fail) + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_FAILURE); + } + else + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_ABANDON); + } + } + } + + while(sfifo_empty(&(pif->send))==false) + { + if(sfifo_read(&(pif->send),&(pif->smsg.sending))) + { + if(pif->smsg.sending.cb != NULL) pif->smsg.sending.cb(pif->smsg.sending.msgident,_ABANDON); + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_ABANDON);} + } + } + + + memset(&pif->smsg,0x00,sizeof(pif->smsg)); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////// +//CanDrvCtrl ģϢ +//////////////////////////////////////////////////////////////////////////////////////////// +static void hdlCanCtrlMsg(e_link_sts msg,unsigned char chan) +{ + st_if* pif=GetIfFromChanel(chan); + if(pif == NULL) return; + + switch(msg) + { + case e_sts_needsend: + if(pif->linkSts >= e_sts_working) HdlAllSengMsgSts(pif); + break; + case e_err_overfllow: + if(pif->linkSts >= e_sts_working && pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_overfllow); + } + break; + case e_err_receive: + + if(pif->linkSts >= e_sts_working && pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_receive); + } + + break; + case e_err_sending: + if(pif->linkSts >= e_sts_working) + { + HdlSendMsgError(pif); + if(pif->pl.hdlBusError!= NULL)pif->pl.hdlBusError(e_err_sending); + } + break; + case e_err_bussoff: + if(pif->linkSts >= e_sts_working) + { + if(pif->smsg.step == e_step_waitack) + { + pif->smsg.step = e_step_fail; + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + } + + if(pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_bussoff); + } + else + { + plCloseLink(pif->canif.chan); + plConfigBus(pif->canif.chan, 0, 0, 0); + } + } + break; + default: + //ﵽ + break; + } +} + +static void CAN_MSG_SIG_FUNC(unsigned int signal, int para1, int para2) +{ + hdlCanCtrlMsg(para1, para2); +} + + +static void CAN_MSG_CB_SIG_FUNC(unsigned int signal, int para1, int para2) +{ + void (*hdlCommSent)(unsigned int canid, unsigned int result); + + hdlCommSent = (void *)para1; + + if (hdlCommSent != NULL) + { + hdlCommSent(para2, _SUCCESS); + } +} + + +//ЭҪṩܽӿ + +bool InstallProtocalToIF(unsigned char chan, st_pl* ppl, st_cl * pcl) +{ + st_if* pif = NULL; + st_pl *p_pl; + + pif=GetIfFromChanel(chan); + + if(pif == NULL || ppl == NULL||pcl==NULL) return false; + + if(ppl->prompt[0]== 0 || pif->linkSts != e_sts_unused) + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ЭΪջӿѰװЭ(%d)\n",pif->linkSts); + return false; + } + + if((ppl->flg&CAN_FLG_SYNCRECEIVE) && ppl->hdlRecCanMsg == NULL) + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF: δṩhdlRecCanMsg ӿ\n"); + return false; + } + + pif->pl.msgNumber = ppl->msgNumber; + if(pif->pl.msgNumber == 0) pif->pl.msgNumber=50; //Ĭ50 + + pif->psend = CAN_MALLOC(sizeof(st_senditem)*pif->pl.msgNumber); + if(pif->psend != NULL) + { + sfifo_init(&pif->send,pif->psend,sizeof(st_senditem),pif->pl.msgNumber); + } + else + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ڴʧ,ڴռ%d*%d\n",sizeof(st_senditem),pif->pl.msgNumber); + return false; + } + + if((ppl->flg&CAN_FLG_SYNCRECEIVE)==0) + { + pif->prec = CAN_MALLOC(sizeof(st_recitem)*pif->pl.msgNumber); + if(pif->prec != NULL) + { + sfifo_init(&pif->rec,pif->prec,sizeof(st_recitem),pif->pl.msgNumber); + } + else + { + CAN_FREE(pif->psend); + pif->psend = NULL; + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ڴʧ,ڴռ%d*%d\n",sizeof(st_senditem),pif->pl.msgNumber); + return false; + } + } + + pif->pl.flg = ppl->flg; + p_pl = &(pif->pl); + + memset(p_pl->prompt,0x00,sizeof(ppl->prompt)); + CAN_COPY(p_pl->prompt,ppl->prompt,sizeof(ppl->prompt)-1); + p_pl->hdlBusError = ppl->hdlBusError; + p_pl->hdlRecCanMsg= ppl->hdlRecCanMsg; + p_pl->resendTimes = ppl->resendTimes; + p_pl->hdlCommSent = ppl->hdlCommSent; + + pcl->canBusFilterInit = plcanBusFilterInit; + pcl->ConfigBus = plConfigBus; + pcl->GetCurrentLinkSts = plGetCurrentLinkSts; + pcl->REC = plReceive; + pcl->SEND = plSend; + pcl->CloseLink = plCloseLink; + + pif->linkSts = e_sts_closed; + + + return true; + +} + + +bool UninstallProtocalToIF(unsigned char chan, st_pl* ppl) +{ + st_if* pif=NULL; + + pif=GetIfFromChanel(chan); + + if(ppl == NULL || pif == NULL) return false; + + if(CAN_CMPY(ppl->prompt,pif->pl.prompt,sizeof(ppl->prompt)-1) != 0) + { + M_DEBUGF("Эӿָ벻ƥ\n"); + return false; + } + + //״̬лδʹ״̬ + pif->linkSts = e_sts_unused; + + if(pif->canif.canCloseFilter != NULL) + { + pif->canif.canCloseFilter(chan); + } + if(pif->canif.canClose != NULL) + { + pif->canif.canClose(chan); + } + + //ͷſռ + if((pif->pl.flg&CAN_FLG_SYNCRECEIVE)==0 && pif->prec != NULL) + { + CAN_FREE(pif->prec); + pif->prec = NULL; + } + if(pif->psend != NULL) + { + CAN_FREE(pif->psend); + pif->psend = NULL; + } + + + memset(&pif->pl,0x00,sizeof(st_pl)); + memset(&pif->smsg,0x00,sizeof(st_sendmsg)); + + return true; +} + + + +void InitCanDrvCtrlMode(void) +{ + unsigned char i; + + for(i=0;i 0 +#if 0 +const static char* stsprompt[]={ + "e_sts_empty", + "e_sts_unused", + "e_sts_closed", + "e_sts_working", +}; +const static char* errprompt[]={ + "e_err_receive", + "e_err_sending", + "e_err_overfllow", +}; + +void DprintCanDrvCtrl(void) +{ + unsigned char i; + + for(i=0;i e_sts_unused) + { + M_DEBUGF("\tprotocol:%s\n",CanIF[i].pl.prompt); + } + M_DEBUGF("\tMsg Step:%d\n",CanIF[i].smsg.step); + + } +} + +#endif + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.h new file mode 100644 index 0000000..e08b867 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/CanDrvCtrl.h @@ -0,0 +1,111 @@ +#ifndef __CANDRVCTRL_H__ +#define __CANDRVCTRL_H__ +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// CAN<------> +////////////////////////////////////////////////////////////////////////////////////////////////////// +//canͨidcanϢ֡id֮ͬcanidʾ׳ֻ +// chanʾcanͨ +// frmidʾcanϢ֡id +// +// +//can㽫ҪƵĽӿͨst_cancb * RegisterCanIF(st_canif *if) ӿڴģ +//st_cancb * RegisterCanIF(st_canif *if) 㽫ijӿڵĿȨCanDrvCtrlģ +//st_canif ͳһCanDrvCtrl Ľӿб,ConfigCan ,canSendcanidṩ +//ػصʵʱе +*********************************************************************************************************************/ +#include "porting.h" + + +typedef struct{ + unsigned char chan; //canӿڱʶ + + bool (*ConfigCan)(unsigned char chan,unsigned short krate, bool highdomain,bool listen); + unsigned char (*canSend)(unsigned char chan,unsigned int canid,unsigned char *data,unsigned char len);//ijcan msgشϢˮ,0xFFFFFFFFΪʧ + bool (*canClose)(unsigned char chan); + bool (*canHwPowerDown)(unsigned char chan); + bool (*canHwPowerUp)(unsigned char chan); + bool (*canBusFilterInit) (unsigned char chan ,unsigned int *filterID_array, unsigned short filterID_total); + bool (*canCloseFilter) (unsigned char chan); +}st_canif; + +//ЩӿҪcan㡱ʵ֡hdlRemoteFrmΪNULL򲻽Զ֡. +typedef struct{ + void (*SendSuccessCb)(unsigned char chan,unsigned int index); //ijϢͳɹ + void (*BusErrorCb)(unsigned char chan,bool sending); //ߴ + void (*BusErrorStsCb)(unsigned char chan,bool sending); //ߴ״̬ı + void (*BusOffCb)(unsigned char chan); //߽BUS OFF Ļص + bool (*hdlFrmReceve)(unsigned char chan,unsigned int canid, const unsigned char *data,unsigned char len); //len = 0ʾԶ֡ +}st_cancb; +st_cancb * RegisterCanIF(const st_canif *IF); + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// <------> Э ************************** +////////////////////////////////////////////////////////////////////////////////////////////////////// +//bool InstallProtocalToIF(unsigned char canid, st_pl* pif, st_cl * pcanif); ijӿЭ֮ +// ͬһʱ䣬һӿڽһЭ +//st_pl ЭҪṩĽӿڣЩϢҪʱCANDRVCTRL +//st_cl, CANDRVCTRL ṩĽӿڣ ЭͨЩӿڽݷ͵ +*********************************************************************************************************************/ + +//ƲṩЭĽӿ +typedef struct{ + //void(*cb)(unsigned int result) result :#define _SUCCESS 0 #define _FAILURE 1 #define _OVERTIME 2 #define _ABANDON 3 + bool (*SEND)(unsigned char chan,unsigned int frmid,unsigned char *data,unsigned char len,unsigned int msgident,void(*cb)(unsigned int msgident,unsigned int result));//Ϊ0ʾԶ֡ + bool (*REC)(unsigned char chan,unsigned int* frmid,unsigned char *data,unsigned char* len);//Ϊ0ʾԶ֡ + unsigned int (*GetCurrentLinkSts)(unsigned char chan); //ȡǰ״̬ + bool (*ConfigBus)(unsigned char chan,unsigned short krate, bool highdomain,bool listen); + bool (*canBusFilterInit) (unsigned char chan,unsigned int *filterID_array, unsigned short filterID_total); + bool (*CloseLink)(unsigned char chan); +}st_cl; + + +#define CAN_SEND_FASET_MODE 1 +//ЭҪṩӿ +#define CAN_FLG_SYNCRECEIVE 1 //պͨhdlRecCanMsgӿڷظӦò + //ЭͨRECӿֶȡ +typedef enum +{ + e_sts_empty=0, //˽ӿǿδнӿƥ,RegisterCanIFunused + e_sts_unused, + e_sts_closed, + e_sts_working, //ǰڹδ + e_sts_needsend, //ǰڷ + e_err_receive=0x80, + e_err_sending, + e_err_overfllow, + e_err_bussoff, +}e_link_sts; + + +typedef struct{ + char prompt[32]; //ʾ + unsigned int flg; //bit0 = canϢշʽ + unsigned char resendTimes; //ط + unsigned char msgNumber; //աͻи + void (*hdlRecCanMsg)(unsigned int id, const unsigned char *data,unsigned char len); //len0ʾԶ֡ + void (*hdlBusError)(e_link_sts err); + void (*hdlCommSent)(unsigned int msgident, unsigned int result); //ͨ÷ͽĻص +}st_pl; + + +//st_pl* ppl, st_cl * pcl ַռķӦЭõʱ +bool InstallProtocalToIF(unsigned char chan, st_pl* ppl, st_cl * pcl); +bool UninstallProtocalToIF(unsigned char chan, st_pl* ppl); + + +//ڴеһЩϢ + +void hdlCanCtrlMsg(e_link_sts msg,unsigned char chan); + +void InitCanDrvCtrlMode(void); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.c new file mode 100644 index 0000000..89d89ca Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.h new file mode 100644 index 0000000..71b32af Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/bsp_can.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.c new file mode 100644 index 0000000..8eae8e0 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.h new file mode 100644 index 0000000..a87b78c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_app.c new file mode 100644 index 0000000..4630409 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_app.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.c new file mode 100644 index 0000000..3a8cb4c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.h new file mode 100644 index 0000000..8ed6978 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/can_nm.h @@ -0,0 +1,68 @@ + +/******************** (C) COPYRIGHT 2011 Ƕʽ ******************** + * ļ can_nm.h + * + * + * 汾 V1.0 +**********************************************************************************/ +#include "Sys.h" +#include "can.h" + +/* */ +typedef enum +{ + E_QR_NC_WU = 0, /* WAKE UP REAUEST */ + E_QR_NC_SA, /* (system Stay Active response) */ + E_QR_NC_SLEEP, /* Not used,MASTER */ + E_QR_NC_MULTIMASTER, /* MultiMaster */ +} qr_nc_e; + +/* +0 = The CAN controller is in Error Active State. +1 = The CAN controller is in Error Passive State. +2 = Reserved (In future to management Bus Off State). +3 = Not Used +*/ +/* CAN״̬ */ +typedef enum +{ + E_QR_CS_ACTIVE = 0, /* Error Active State */ + E_QR_CS_PASSIVE, /* Error Passive State */ + E_QR_CS_BUSSOFF, /* In future to management Bus Off State */ + E_QR_CS_RESERVE, /* Not Used */ +} qr_cs_e; + + + + +/*************************************APP ʹýӿ************************************************************/ +typedef enum +{ + E_QR_CMD_APP_NETON = 0, /* 缤ɹָ */ + E_QR_CMD_APP_NETOFF, /* رյָ */ + E_QR_CMD_APP_NETCHK, /* ָ */ + E_QR_CMD_APP_UNUSED, /* δʹãЧ */ +} app_qr_cmd_e; + + +/** + * @brief: Ӧó⵽״̬ı󴥷 + * + * @param CMD ״ָ̬ + * @param active ǰǷҪӦ(1-Ҫݣ0-Ҫͣ 0xFF-δ֪/Ч) + * @param dtc_staus: DTC״̬(1 : DTCStatus = present 0 - ǣ 0xFF-δ֪/Ч) + * @param acc_active: acc ״̬(1 : acc on 0 - acc off 0xFF-δ֪/Ч) + */ +void app_qr_nm_req(app_qr_cmd_e CMD, uint8_t active, uint8_t dtc_staus, uint8_t acc_active); + +/** + * @brief: Ĵ + */ +void app_qirui_nm_handle_2(void); + + +/** + * @breif: ģʼ + */ +void app_qirui_nm_init(void); + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.c new file mode 100644 index 0000000..a21fca0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.c @@ -0,0 +1,539 @@ +/********************************************************** +** porting.c * +** 2022-11-15 * +** V1.0 * +**********************************************************/ + +#include "porting.h" + + + +/** + * @brief: ʼһFIFO + * + * + */ +void sfifo_init(st_fifo_t *stfifo, void *array, unsigned short stsize, unsigned short deepth) +{ + stfifo->deepth = deepth; + stfifo->occupy = 0; + stfifo->array = array; + stfifo->stsize = stsize; + stfifo->limit = (void*)((unsigned int)array + stsize*deepth); + stfifo->wp = stfifo->array; + stfifo->rp = stfifo->array; +} + +void sfifo_reset(st_fifo_t *stfifo) +{ + stfifo->occupy = 0; + stfifo->rp = stfifo->array; + stfifo->wp = stfifo->array; +} + + +bool sfifo_write(st_fifo_t *stfifo, const void *stunit) +{ + if (stfifo->occupy >= stfifo->deepth || stfifo->array == NULL) return false; + + memcpy((unsigned char*)stfifo->wp,(unsigned char*)stunit,stfifo->stsize); + stfifo->wp = (void*)((unsigned int)stfifo->wp + stfifo->stsize); + if (stfifo->wp >= stfifo->limit) stfifo->wp = stfifo->array; + + stfifo->occupy++; + + return true; +} + +bool sfifo_empty(st_fifo_t *stfifo) +{ + if (stfifo->occupy == 0 || stfifo->array == NULL) return true; + else return false; +} + +bool sfifo_full(st_fifo_t *stfifo) +{ + if (stfifo->occupy >= stfifo->deepth) return true; + else return false; +} + + +unsigned int sfifo_read(st_fifo_t *stfifo,void *stunit) +{ + + if (stfifo->occupy == 0 || stfifo->array == NULL) return 0x0; + + memcpy((unsigned char*)stunit,(unsigned char*)stfifo->rp,stfifo->stsize); + stfifo->rp = (void*)((unsigned int)stfifo->rp + stfifo->stsize); + if (stfifo->rp >= stfifo->limit) stfifo->rp = stfifo->array; + + + stfifo->occupy--; + + return stfifo->stsize; +} + +unsigned int sfifo_occupy_get(st_fifo_t *stfifo) +{ + return stfifo->occupy; +} + + + + + + +/****************************************************************** + QUEUE +******************************************************************/ +bool CreateQueue(QUEUE *que) +{ + if (que == 0) return FALSE; + que->head = 0; + que->tail = 0; + que->item = 0; + return TRUE; +} + +unsigned short QueueItem(QUEUE *que) +{ + if (que == 0) return 0; + else return (que->item); +} + +QUEUEMEM *QueueHead(QUEUE *que) +{ + if (que == 0 || que->item == 0) return 0; + else return ((QUEUEMEM *)que->head);// + sizeof(NODE)); +} + +QUEUEMEM *QueueTail(QUEUE *que) +{ + if (que == 0 || que->item == 0) return 0; + else return ((QUEUEMEM *)que->tail);// + sizeof(NODE)); +} + +QUEUEMEM *QueueNext(QUEUEMEM *element) +{ + QUEUENODE *curnode; + + if (element == 0) return 0; + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + if ((curnode = curnode->next) == 0) return 0; + else return ((QUEUEMEM *)curnode);// + sizeof(NODE)); +} + +QUEUEMEM *DelQueueElement(QUEUE *que, QUEUEMEM *element) +{ + QUEUENODE *curnode, *prenode, *nextnode; + + if (que == 0 || element == 0) return 0; + if (que->item == 0) return 0; + + que->item--; + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + + if (curnode == que->head) { + que->head = curnode->next; + if (que->item == 0) { + que->tail = 0; + return 0; + } else { + return (QUEUEMEM *)(que->head);// + sizeof(NODE); + } + } + + nextnode = curnode->next; + prenode = que->head; + while (prenode != 0) { + if (prenode->next == curnode) { + break; + } else { + prenode = prenode->next; + } + } + if (prenode == 0) return 0; + + prenode->next = nextnode; + if (curnode == que->tail) { + que->tail = prenode; + return 0; + } else { + return ((QUEUEMEM *)nextnode);// + sizeof(NODE)); + } +} + +// Return: Queue head +QUEUEMEM *DelQueueHead(QUEUE *que) +{ + QUEUEMEM *element; + + if (que == 0 || que->item == 0) return 0; + + element = (QUEUEMEM *)que->head;//+ sizeof(NODE); + DelQueueElement(que, element); + return element; +} + +// Return: Queue tail +QUEUEMEM *DelQueueTail(QUEUE *que) +{ + QUEUEMEM *element; + + if (que == 0 || que->item == 0) return 0; + + element = (QUEUEMEM *)que->tail;// + sizeof(NODE); + DelQueueElement(que, element); + return element; +} + +bool AppendQueue(QUEUE *que, QUEUEMEM *element) +{ + QUEUENODE *curnode; + + if (que == 0 || element == 0) return FALSE; + + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + if (que->item == 0) { + que->head = curnode; + } else { + que->tail->next = curnode; + } + curnode->next = 0; + que->tail = curnode; + que->item++; + return TRUE; +} + + +//intsert element before curelement +bool InsertBeforeQueue(QUEUE *que, QUEUEMEM *element,QUEUEMEM *curelement) +{ + QUEUENODE *curnode, *prenode, *node; + + if (que == 0 || element == 0 || curelement == 0) return FALSE; + node = (QUEUENODE*)element; + curnode = (QUEUENODE*)curelement; + + if (que->head == curnode) { + que->head = node; + node->next = curnode; + } else { + prenode = que->head; + while (prenode != 0) { + if (prenode->next == curnode) { + break; + } else { + prenode = prenode->next; + } + } + if (prenode == 0) return false; + prenode->next = node; + node->next = curnode; + } + que->item++; + return true; + } + + + + + + + +/*********************************************źصIJ*******************************************************/ +typedef struct { + unsigned int signal_id; + unsigned int para1; + unsigned int para2; +} signal_cell_t; + +typedef struct { + unsigned int signal; + signal_callback cb; +}signal_callback_t; + +typedef struct { + signal_callback_t signal_map[20]; /* 洢my_kill עźźͻص */ + signal_cell_t signal[40]; + st_fifo_t queue; +} signal_queue_t; + + +static signal_queue_t can_signal_queue = {0}; + + + +/* + * \brief: һϢPID + * \para: + * signal: my_signal_e ͵źֵ + * para1,para2: my_kill ӦϢص֮䴫ݲ + * + * ˽Ϣŵ⣬鵱ǰеϢ + * һֵʱ뾯ʾ + */ +int can_kill(unsigned int signal, unsigned int para1, unsigned int para2) +{ + signal_cell_t signal_cell; + + + signal_cell.signal_id = signal; + signal_cell.para1 = para1; + signal_cell.para2 = para2; + + return sfifo_write(&can_signal_queue.queue, (void *)&signal_cell); +} + + +/* + * \brief: PID Ϣsignal + * \para: + * signal: ҪϢ + * cb: + * \return: + * 0-ɹ <0 ʧ + * + *ҪϢǷpSQueue->mass б򷵻ʧ + *ӵpSQueue->signal_map + */ +int can_signal(unsigned int signal, signal_callback cb) +{ + unsigned int i; + + if (signal == E_CAN_SIGNAL_NULL) return -1; + + + /*ѾµĻص滻֮ǰĻص*/ + for (i=0; iholdtime = 0; + pCur->optime = 0; + pCur->tmrfunc = NULL; + return; +} + +void can_timer_start(TIMER tmr,unsigned int ms) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return; + + pCur->holdtime = ms; + + TickOut(&(pCur->optime), 0); +} + + +void can_timer_stop(TIMER tmr) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return; + + pCur->holdtime = 0; +} + +bool can_timer_switch(TIMER tmr) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return false; + + if (pCur->holdtime > 0) { + return true; + } else { + return false; + } +} + + + + +/* ʱܵijʼ */ +int can_timer_init(void) +{ + memset(can_timer, 0x00, sizeof(can_timer)); + return 0; +} + + +/* ʱܵijʼ */ +int can_timer_schedule(void) +{ + unsigned int tick, i, holdtime, last_tick = 0; + can_tmr_func cb; + + TickOut(&tick, 0); + + if (tick == last_tick || tick == (last_tick+1)) + { + return 0; + } + + last_tick = tick; + + for (i = 0; i < NELEMENTS(can_timer); i++) + { + cb = can_timer[i].tmrfunc; + holdtime = can_timer[i].holdtime; + + if (holdtime > 0 && cb != NULL) + { + + if (TickOut(&can_timer[i].optime,holdtime) == TRUE) + { + if (can_timer[i].tmrfunc != NULL) + { + can_timer[i].optime += ((tick - can_timer[i].optime)/holdtime*holdtime); + } + + if (cb != NULL) + { + cb((TIMER)&can_timer[i]); + } + } + } + } + + return 0; +} + + + +/** + * @brief: ʼcan ЭĻ + */ +void can_porting_init(void) +{ + can_timer_init(); + can_signal_queue_init(); +} + + +/** + * @brief: ʼcan ЭĻܵĵ + */ +void can_porting_schedule(void) +{ + can_signal_schedule(); + can_timer_schedule(); +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.h new file mode 100644 index 0000000..a5130d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/porting.h @@ -0,0 +1,170 @@ +/**************************************************************** +* porting.h * +* 2022-11-15 * +****************************************************************/ + +#ifndef _PROTOCOL_PORTING_H_ + +#define _PROTOCOL_PORTING_H_ + +/* Ͷ */ +#include +#include "stdint.h" +#include +#include "sys.h" + +#define NELEMENTS(x) (sizeof(x)/sizeof((x)[0])) + +#define _SUCCESS 0 +#define _FAILURE 1 +#define _OVERTIME 2 +#define _ABANDON 3 + + + + +typedef struct { + unsigned short deepth; /* ܹжԪ */ + unsigned short occupy; /* ռԪظ */ + unsigned short stsize; /* ÿԪصĴС */ + void *array; /* ŵĻ */ + void *limit; /* ĩβ */ + void *wp; /* дָ */ + void *rp; /* ָ */ +} st_fifo_t; + + +/** + * @brief: ʼһFIFO + * + * + */ +void sfifo_init(st_fifo_t *stfifo, void *array, unsigned short stsize, unsigned short deepth); + +void sfifo_reset(st_fifo_t *stfifo); + + +bool sfifo_write(st_fifo_t *stfifo, const void *stunit); + +bool sfifo_empty(st_fifo_t *stfifo); + +bool sfifo_full(st_fifo_t *stfifo); + +unsigned int sfifo_read(st_fifo_t *stfifo,void *stunit); + +unsigned int sfifo_occupy_get(st_fifo_t *stfifo); + + + + + +#define QUEUEMEM unsigned char +#define QUEUENODE struct node + +typedef struct node{ + QUEUENODE *next; +} NODE; + +typedef struct { + QUEUENODE *head; + QUEUENODE *tail; + unsigned short item; +} QUEUE; + +bool CreateQueue(QUEUE *que); +unsigned short QueueItem(QUEUE *que); +QUEUEMEM *QueueHead(QUEUE *que); +QUEUEMEM *QueueTail(QUEUE *que); +QUEUEMEM *QueueNext(QUEUEMEM *element); +QUEUEMEM *DelQueueElement(QUEUE *que, QUEUEMEM *element); +QUEUEMEM *DelQueueHead(QUEUE *que); +QUEUEMEM *DelQueueTail(QUEUE *que); +bool AppendQueue(QUEUE *que, QUEUEMEM *element); +bool InsertBeforeQueue(QUEUE *que, QUEUEMEM *element,QUEUEMEM *curelement); + + + + + + +/* ڴصĽӿֲ */ +/* + * void mem_cpy (void* dst, const void* src, int cnt); CAN_COPY + * void mem_set (void* dst, int val, int cnt); + * int mem_cmp (const void* dst, const void* src, int cnt); + * void *mem_malloc(mem_size_t size); + * void mem_free(void *mem); + */ +#define CAN_MALLOC(size) malloc(size) +#define CAN_COPY(p_des, p_src, size) memcpy((p_des), (p_src), (size)) +#define CAN_CMPY(p_des, p_src, size) memcmp((p_des), (p_src), (size)) +#define CAN_FREE(p) free(p) + + + + +/* + * źŵĻص + * para: + * signal: źű־ + * para1: 뷢߶ + * para2: 뷢߶ + */ +typedef void (*signal_callback)(unsigned int signal, int para1, int para2); + +/* + * \brief: һϢPID + * \para: + * signal: my_signal_e ͵źֵ + * para1,para2: my_kill ӦϢص֮䴫ݲ + */ +int can_kill(unsigned int signal, unsigned int para1, unsigned int para2); + +/* + * \brief: PID Ϣsignal + * \para: + * signal: ҪϢ + * cb: + * \return: + * 0-ɹ <0 ʧ + * \remark: + * 1) my_signal_queue_create ϢIDmy_signal + * 2) ͬһϢԶmy_signalֻһЧ + * DzҪô + */ +int can_signal(unsigned int signal, signal_callback cb); + + + +/* + * CANź + */ +typedef enum { + E_CAN_SIGNAL_NULL = 0, + E_CAN_MSG_SIG, + E_CAN_MSG_CB_SIG, /* źŵķͻص */ + E_CAN_15765_NET_SIG, + E_CAN_15765_SS_SIG, +} can_signal_e; + + + + +/*************************************ʱ********************************************************/ +typedef unsigned int TIMER; +typedef void (*can_tmr_func)(TIMER tmr_id); //ʱִָ +TIMER can_timer_create(can_tmr_func cb); + +void can_timer_remove(TIMER tmr); + +void can_timer_start(TIMER tmr,unsigned int ms); + + +void can_timer_stop(TIMER tmr); + +bool can_timer_switch(TIMER tmr); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/readme.txt new file mode 100644 index 0000000..c3597b8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/CAN/readme.txt @@ -0,0 +1,2 @@ +bsp_can 是对MCU的接口部分,相当于是MCU的移植部分 +CanBusDrv 提供对can的统一处理, 完成总线的异常处理等 \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.c new file mode 100644 index 0000000..dbbdf66 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.h new file mode 100644 index 0000000..323cf8f Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/DC300/dc300.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.c new file mode 100644 index 0000000..37e3b7c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.c @@ -0,0 +1,463 @@ +#include "24cxx.h" +#include "bsp_i2c_gpio.h" +#include "led.h" + +//ʼIIC +void ee_Init(void) +{ + bsp_InitI2C(); + +} +//AT24CXXַָȡһ +//ReadAddr :ʼĵַ +//ֵ ȡ +u8 ee_ReadOneByte(u16 ReadAddr) +{ + u8 temp = 0; + IIC_Start(); + + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR);//д + IIC_Wait_Ack(); + IIC_Send_Byte(ReadAddr / 256); //͸ߵַ + } else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR + ((ReadAddr / 256) << 1)); //ַ0xA0,д + + IIC_Wait_Ack(); + IIC_Send_Byte(ReadAddr % 256); //͵͵ַ + IIC_Wait_Ack(); + IIC_Start(); + + if (1)IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_RD); //ģʽ + else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_RD + ((ReadAddr / 256) << 1)); //ģʽ + + IIC_Wait_Ack(); + temp = IIC_Read_Byte(1); + IIC_Stop();//һֹͣ + return temp; +} + +//AT24CXXַָдһ +//WriteAddr:дݵĿĵַ +//data :Ҫд +void ee_WriteOneByte(u16 WriteAddr, u8 data) +{ + IIC_Start(); + + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR); + IIC_Wait_Ack(); + IIC_Send_Byte(WriteAddr / 256); //͸ߵַ + } else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR + ((WriteAddr / 256) << 1)); + + IIC_Wait_Ack(); + IIC_Send_Byte(WriteAddr % 256); //͵͵ַ + IIC_Wait_Ack(); + IIC_Send_Byte(data); + IIC_Wait_Ack(); + IIC_Stop();//һֹͣ + Delay_MS(6); +} +#if 1 +//EEPROMдֽ +uint8_t ee_WriteBytes(uint8_t *_pWriteBuf, uint16_t _usAddress, uint16_t _usSize) +{ + uint16_t i, m; + uint16_t addr; + addr = _usAddress; + + for (i = 0; i < _usSize; i++) { + //һλߵַ뵽8Ҫ·ʼźźEEPROMַ + //Ϊ˽8ַ + if (i == 0 || (addr % EE_PAGE_SIZE) == 0) { + if (i != 0) { + IIC_Stop(); + Delay_MS(6); + } + //ʼַ + IIC_Start(); + + //豸дַ + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR); + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + IIC_Send_Byte(addr / 256); //͸ߵַ + } else IIC_Send_Byte((EE_DEV_ADDR + ((addr / 256) << 1)) | EEPROM_I2C_WR); + + //ȴӻӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + //EEPROMӦEEPROMڲ洢ַ + IIC_Send_Byte((uint8_t)addr); + + //ȴӻӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + } + + // + IIC_Send_Byte(_pWriteBuf[i]); + + //ȴӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + //дַ1 + addr++; + } + + IIC_Stop(); + return 1; + +cmd_fail: + IIC_Stop(); + return 0; +} + + +uint8_t ee_ReadBytes(uint8_t *_pReadBuf, uint16_t _usAddress, uint16_t _usSize) +{ + uint16_t i; + + //ʼַ + IIC_Start(); + + //豸дַ + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR); + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + IIC_Send_Byte(_usAddress / 256); //͸ߵַ + } else IIC_Send_Byte((EE_DEV_ADDR + ((_usAddress / 256) << 1)) | EEPROM_I2C_WR); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + IIC_Send_Byte((uint8_t)_usAddress); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + IIC_Start(); + if (EE_TYPE > AT24C16) IIC_Send_Byte(EE_DEV_ADDR | EEPROM_I2C_RD); + else IIC_Send_Byte((EE_DEV_ADDR + ((_usAddress / 256) << 1)) | EEPROM_I2C_RD); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + for (i = 0; i < _usSize; i++) { + /* ÿ1ֽںҪAck һֽڲҪAckNack */ + _pReadBuf[i] = IIC_Read_Byte(i != _usSize - 1?1:0); + } + + IIC_Stop(); + return 1; + +cmd_fail: + IIC_Stop(); + return 0; +} +#endif +#if 0 +static void IIC1_Start(void); //ʼź +static void IIC1_Stop(void); //ֹͣź +static void IIC1_Write_Byte(u8 dat);//һֽ +static u8 IIC1_Read_Byte(unsigned char ack);//һֽ +static u8 IIC1_Wait_Ack(void);//ȴACKź +static void IIC1_Ack(void);//ACKź +static void IIC1_NAck(void);//ACKź + +void I2C_delay(uint16_t n) +{ + u8 i = 100 * n; //Żٶ ͵5д + + while (i) { + i--; + } +} + +//ʼIIC +void AT24cxx_init(void) +{ + GPIO_InitTypeDef GPIO_InitStructure; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); /* GPIOʱ */ + + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11; //SDA,SCL + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_Init(GPIOB, &GPIO_InitStructure); + IIC_SDA1; + IIC_SCL1; + +} + +//AT24CXXַָȡһ +//ReadAddr :ʼĵַ +//ֵ ȡ +u8 AT24cxx_ReadOneByte(u16 ReadAddr) +{ + u8 temp = 0; + IIC1_Start(); + + if (EE_TYPE > AT24C16) { + IIC1_Write_Byte(0xa0);//д + IIC1_Wait_Ack(); + IIC1_Write_Byte(ReadAddr / 256); //͸ߵַ + } else IIC1_Write_Byte(0xa0 + ((ReadAddr / 256) << 1)); //ַ0xA0,д + + IIC1_Wait_Ack(); + IIC1_Write_Byte(ReadAddr % 256); //͵͵ַ + IIC1_Wait_Ack(); + IIC1_Start(); + + if (EE_TYPE > AT24C16)IIC1_Write_Byte(0xa1); //ģʽ + else IIC1_Write_Byte(0xa1 + ((ReadAddr / 256) << 1)); //ģʽ + + IIC1_Wait_Ack(); + temp = IIC1_Read_Byte(1); + IIC1_Stop();//һֹͣ + return temp; +} +//AT24CXXַָдһ +//WriteAddr:дݵĿĵַ +//data :Ҫд +void AT24cxx_WriteOneByte(u16 WriteAddr, u8 data) +{ + IIC1_Start(); + + if (EE_TYPE > AT24C16) { + IIC1_Write_Byte(0xa0); + IIC1_Wait_Ack(); + IIC1_Write_Byte(WriteAddr / 256); //͸ߵַ + } else IIC1_Write_Byte(0xa0 + ((WriteAddr / 256) << 1)); + + IIC1_Wait_Ack(); + IIC1_Write_Byte(WriteAddr % 256); //͵͵ַ + IIC1_Wait_Ack(); + IIC1_Write_Byte(data); + IIC1_Wait_Ack(); + IIC1_Stop();//һֹͣ + I2C_delay(2); +} +//AT24CXXַָʼдָȵ +//úд16λ32λ +//WriteAddr:ʼдĵַ +//data :Ҫд +//len :Ҫдݵij24 +void AT24cxx_WriteLenByte(u16 WriteAddr, u32 data, u8 len) +{ + u8 i; + + for (i = 0; i < len; i++) { + AT24cxx_WriteOneByte(WriteAddr + i, (data >> (8 * i)) & 0xff); + } +} +//AT24CXXַָʼָȵ +//úڶ16bit32bit. +//ReadAddr :ʼĵַ +//ֵ : +//len :Ҫݵij2,4 +u32 AT24cxx_ReadLenByte(u16 ReadAddr, u8 len) +{ + u8 i; + u32 temp = 0; + + for (i = 0; i < len; i++) { + temp <<= 8; + temp += AT24cxx_ReadOneByte(ReadAddr + len - i - 1); + } + + return temp; +} + +//AT24CXXַָʼдָȵ +//úдָֽ +//WriteAddr:ʼдĵַ +//buf :׵ַ +//len :Ҫдݵĸ +void AT24cxx_Write(u16 WriteAddr, u8 *buf, u16 len) +{ + u16 i; + + for (i = 0; i < len; i++) { + IWDG_Feed(); + AT24cxx_WriteOneByte(WriteAddr, *buf); + WriteAddr++; + buf++; + } +} +//AT24CXXַָʼָȵ +//úڶָֽ +//ReadAddr:ʼݵĵַ +//len :Ҫдݵĸ +//buf :׵ַ +void AT24cxx_Read(u16 ReadAddr, u8 *buf, u16 len) +{ + while (len--) { + IWDG_Feed(); + *buf++ = AT24cxx_ReadOneByte(ReadAddr++); + } +} +//AT24CXXǷ +//24XXĵһַ(0)洢־. +//1ʧ +//0ɹ +u8 AT24cxx_Check(void) +{ + u8 temp1, temp2; + AT24cxx_WriteOneByte(0x010, 0x55); + temp1 = AT24cxx_ReadOneByte(0x010); //ÿοдAT24CXX + temp2 = temp1; + + if (temp2 == 0x55)return 0; + else { + AT24cxx_WriteOneByte(0x010, 0x55); + temp1 = AT24cxx_ReadOneByte(0x010); + temp2 = temp1; + + if (temp2 == 0x55)return 0; + } + + return 1; +} + +//IICʼź +static void IIC1_Start(void) +{ + + IIC_SDA1; + IIC_SCL1; + I2C_delay(4); + IIC_SDA0; + I2C_delay(4); + IIC_SCL0; + I2C_delay(4); +} +//IICֹͣź +static void IIC1_Stop(void) +{ + IIC_SDA0; + IIC_SCL1; + I2C_delay(2); + IIC_SDA1; + I2C_delay(4); +// IIC_SCL0; +} +//1Ӧʧܣ0Ӧɹ +static u8 IIC1_Wait_Ack(void) +{ + u8 i; + SDA_IN(); + IIC_SCL0; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + + while (Read_IIC_SDA()) { + i++; + + if (i > 250) { + + IIC1_Stop(); + return 1; + } + } + + IIC_SCL0; + I2C_delay(2); + return 0; +} +//ACKӦ +static void IIC1_Ack(void) +{ + IIC_SCL0; + SDA_OUT(); + IIC_SDA0; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + IIC_SCL0; +} +//ACKӦ +static void IIC1_NAck(void) +{ + IIC_SCL0; + SDA_OUT(); + IIC_SDA1; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + IIC_SCL0; +} +//IICһֽ +//شӻӦ +//0Ӧ +//1Ӧ +void IIC1_Write_Byte(u8 dat) +{ + u8 t; + SDA_OUT(); + I2C_delay(2); + + for (t = 0; t < 8; t++) { + IIC_SCL0; + + if (dat & 0x80) { + IIC_SDA1; + } else { + IIC_SDA0; + } + + I2C_delay(2); + IIC_SCL1; + dat <<= 1; + I2C_delay(2); + + } + + IIC_SCL0; + I2C_delay(2); +} +//1ֽڣack=0ʱACK,ack=1NACK +u8 IIC1_Read_Byte(unsigned char ack) +{ + u8 i, receive; + SDA_IN();//SDAΪ + IIC_SDA0; + I2C_delay(2); + + for (i = 0; i < 8; i++) { + IIC_SCL0; + I2C_delay(2); + IIC_SCL1; + receive <<= 1; + I2C_delay(2); + + if (Read_IIC_SDA())receive++; + + I2C_delay(2); + } + + IIC_SDA1; + I2C_delay(2); + IIC_SCL0; + I2C_delay(2); + + if (!ack) + IIC1_Ack(); + else + IIC1_NAck(); + + return receive; +} +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.h new file mode 100644 index 0000000..c5ada86 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/EEPROM/24cxx.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.c new file mode 100644 index 0000000..a8ce1d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.c @@ -0,0 +1,174 @@ +#include "led.h" +#include "stm32f10x_iwdg.h" +#include "sd.h" + +#define WWDG_REFRESH (0x7F) +uint8_t wwdg_int_cnt = 0; + +//LED IOʼ +void LED_Init(void) +{ + GPIO_InitTypeDef GPIO_InitStructure; + + + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC, ENABLE); //ʹPB,PE,PD˿ʱ + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //LED0-->PB.5 ˿ + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IOٶΪ50MHz + GPIO_Init(GPIOA, &GPIO_InitStructure); //趨ʼGPIOB.5 + GPIO_SetBits(GPIOA,GPIO_Pin_9); //PB.5 + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; //LED0-->PB.5 ˿ + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IOٶΪ50MHz + GPIO_Init(GPIOA, &GPIO_InitStructure); //趨ʼGPIOB.5 + GPIO_SetBits(GPIOA,GPIO_Pin_0); //PB.5 + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_10; //LED0-->PB.5 ˿ + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IOٶΪ50MHz + GPIO_Init(GPIOA, &GPIO_InitStructure); //趨ʼGPIOB.5 + GPIO_SetBits(GPIOA,GPIO_Pin_1); //PB.5 + + GPIO_ResetBits(GPIOA,GPIO_Pin_10); // pwr5v open + + //KC 1 2 3 4 5 + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_7; // + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IOٶΪ50MHz + GPIO_Init(GPIOC, &GPIO_InitStructure); + GPIO_ResetBits(GPIOC,GPIO_Pin_5); //PB.5 + + GPIO_SetBits(GPIOC,GPIO_Pin_7); // 1043 ENable +// GPIO_ResetBits(GPIOC,GPIO_Pin_7); // 1043 DISENable + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2 |GPIO_Pin_14|GPIO_Pin_9|GPIO_Pin_5; // + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IOٶΪ50MHz + GPIO_Init(GPIOB, &GPIO_InitStructure); + + GPIO_SetBits(GPIOB,GPIO_Pin_9); // pwr3.3v close + GPIO_ResetBits(GPIOB,GPIO_Pin_0); + GPIO_ResetBits(GPIOB,GPIO_Pin_1); + GPIO_ResetBits(GPIOB,GPIO_Pin_2); + GPIO_ResetBits(GPIOB,GPIO_Pin_14); + ////GPIO_SetBits(GPIOB,GPIO_Pin_9); // pwr3.3v close +// GPIO_ResetBits(GPIOB,GPIO_Pin_9); // pwr3.3v open + GPIO_ResetBits(GPIOB,GPIO_Pin_5); // can_en open + +// //SDǷ +// GPIO_InitStructure.GPIO_Pin = SD_INSERT_PIN; +// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; //PC4 +// GPIO_Init(SD_INSERT_PORT, &GPIO_InitStructure);//ʼGPIOC + + + + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; // A+ detect + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; // + GPIO_Init(GPIOA, &GPIO_InitStructure);//ʼGPIOC + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; // Relay detect + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; // + GPIO_Init(GPIOC, &GPIO_InitStructure);//ʼGPIOC + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; // Acc detect + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; // + GPIO_Init(GPIOC, &GPIO_InitStructure);//ʼGPIOC + + + + RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); + GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE); // ͷPB4 + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 ; // + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; + GPIO_Init(GPIOB, &GPIO_InitStructure); + + GPIO_SetBits(GPIOB,GPIO_Pin_4); // 1043 work + + BKP_TamperPinCmd(DISABLE); /* رּ⹦,PC13ͨIO*/ + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13; // 1043 Can_int + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; // + GPIO_Init(GPIOC, &GPIO_InitStructure);//ʼGPIOC + + + +} + + +/* + * IWDG ijʱʱ + * Tout = prv/40 * rlv (s) + * prv[4,8,16,32,64,128,256] + * prv:ԤƵֵȡֵ£ + * @arg IWDG_Prescaler_4: IWDG prescaler set to 4 + * @arg IWDG_Prescaler_8: IWDG prescaler set to 8 + * @arg IWDG_Prescaler_16: IWDG prescaler set to 16 + * @arg IWDG_Prescaler_32: IWDG prescaler set to 32 + * @arg IWDG_Prescaler_64: IWDG prescaler set to 64 + * @arg IWDG_Prescaler_128: IWDG prescaler set to 128 + * @arg IWDG_Prescaler_256: IWDG prescaler set to 256 + * + * rlv:ԤƵֵȡֵΧΪ0-0XFFF + * þ + * IWDG_Config(IWDG_Prescaler_64 ,625); // IWDG 1s ʱ + */ + +void IWDG_Config(uint8_t prv ,uint16_t rlv) +{ + // ʹ ԤƵĴPRװؼĴRLRд + IWDG_WriteAccessCmd( IWDG_WriteAccess_Enable ); + + // ԤƵֵ + IWDG_SetPrescaler( prv ); + + // װؼĴֵ + IWDG_SetReload( rlv ); + + // װؼĴֵŵ + IWDG_ReloadCounter(); + + // ʹ IWDG + IWDG_Enable(); +} + +// ι +void IWDG_Feed(void) +{ + // װؼĴֵŵУιֹIWDGλ + // ֵ0ʱϵͳλ + //IWDG_ReloadCounter(); + WWDG->CR = WWDG_REFRESH; + wwdg_int_cnt = 0; +} +void IWDG_Init(void) // use window dog +{ + // IWDG 1s ʱ + + //IWDG_Config(IWDG_Prescaler_64 ,625); + + RCC->APB1ENR |= RCC_APB1ENR_WWDGEN; + WWDG->CFR = WWDG_CFR_EWI | WWDG_CFR_WDGTB | 0x7f; //ʹEWIжϣ8Ƶ// + WWDG->CR = WWDG_REFRESH; + WWDG->CR |= WWDG_CR_WDGA; + NVIC_SetPriority(WWDG_IRQn, 0); + NVIC_EnableIRQ(WWDG_IRQn); + ////DebugOut("WWDG init ok\r\n",0, PCPRINTF); + +} + +void WWDG_IRQHandler(void)//// +{ + WWDG->SR = 0; +//#if (WDG_TYPE == WDG_WWDG) + wwdg_int_cnt++; + if (wwdg_int_cnt <= 30) // 15 + { + WWDG->CR = WWDG_REFRESH; + } +//#endif +} + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.h new file mode 100644 index 0000000..cbbe758 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LED/led.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.c new file mode 100644 index 0000000..b1d70d7 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.h new file mode 100644 index 0000000..41c9645 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/LOWPOWER/app_pwr_manage.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.c new file mode 100644 index 0000000..ce3d706 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.c @@ -0,0 +1,77 @@ +#include "timer.h" +#include "led.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEKսSTM32 +//ʱ +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/3 +//汾V1.0 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +////////////////////////////////////////////////////////////////////////////////// + +//ͨöʱ3жϳʼ +//ʱѡΪAPB12APB1Ϊ36M +//arrԶװֵ +//pscʱԤƵ +//719Ƶ50k, 500ֵ֮100hz +//7199Ƶ5k, 500ֵ֮1000hz +//ʹõǶʱ3!//TIM3ʼԶװֵʱԤƵϵ +//Tout= ((arr+1)*(psc+1))/Tclk +// ΪAPB1 ʱӷƵΪ 1 TIM2~7 +// ʱƵʽΪ APB1 ʱӵҲ72 +//ʵTout=500*7200/72=500 000us +//һʱʱ + +void TIM3_Int_Init(u16 arr,u16 psc) +{ + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + NVIC_InitTypeDef NVIC_InitStructure; + + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); //ʱʹ + + //ʱTIM3ʼ + TIM_TimeBaseStructure.TIM_Period = arr; //һ¼װԶװؼĴڵֵ + TIM_TimeBaseStructure.TIM_Prescaler =psc; //ΪTIMxʱƵʳԤƵֵ + TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; //ʱӷָ:TDTS = Tck_tim + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIMϼģʽ + TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); //ָIJʼTIMxʱλ + + TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE ); //ʹָTIM3ж,ж + + //жȼNVIC + NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; //TIM3ж + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; //ռȼ0 + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //ȼ3 + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQͨʹ + NVIC_Init(&NVIC_InitStructure); //ʼNVICĴ + + + TIM_Cmd(TIM3, ENABLE); //ʹTIMx +} +//ʱ3жϷ +extern int8_t QIRUI_DCDCSendBms2(void); + +void TIM3_IRQHandler(void) //TIM3ж +{ + if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //TIM3жϷ + { + QIRUI_DCDCSendBms2(); + TIM_ClearITPendingBit(TIM3, TIM_IT_Update ); //TIMxжϱ־ + } +} + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.h new file mode 100644 index 0000000..a2637c4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/HARDWARE/TIMER/timer.h @@ -0,0 +1,20 @@ +#ifndef __TIMER_H +#define __TIMER_H +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEKսSTM32 +//ʱ +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/3 +//汾V1.0 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +////////////////////////////////////////////////////////////////////////////////// + + +void TIM3_Int_Init(u16 arr,u16 psc); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.c new file mode 100644 index 0000000..da62fb7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.c @@ -0,0 +1,182 @@ +#include "delay.h" +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ʹucos,ͷļ. +#if SYSTEM_SUPPORT_UCOS +#include "includes.h" //ucos ʹ +#endif +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEK STM32 +//ʹSysTickͨģʽӳٽй +//delay_us,delay_ms +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/2 +//汾V1.5 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +//******************************************************************************** +//V1.2޸˵ +//жеóѭĴ +//ֹʱ׼ȷ,do whileṹ! + +//V1.3޸˵ +//˶UCOSIIʱ֧. +//ʹucosII,delay_initԶSYSTICKֵ,ʹ֮ucosTICKS_PER_SECӦ. +//delay_msdelay_usҲucosĸ. +//delay_usucosʹ,׼ȷȺܸ,ҪûռöĶʱ. +//delay_msucos,ԵOSTimeDly,δucosʱ,delay_usʵ,Ӷ׼ȷʱ +//ʼ,ucos֮delay_msʱij,ѡOSTimeDlyʵֻdelay_usʵ. + +//V1.4޸˵ 20110929 +//޸ʹucos,ucosδʱ,delay_msж޷Ӧbug. +//V1.5޸˵ 20120902 +//delay_usucosֹucosdelay_usִУܵµʱ׼ +////////////////////////////////////////////////////////////////////////////////// +static u8 fac_us=0;//usʱ +static u16 fac_ms=0;//msʱ +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. +//systickжϷ,ʹucosʱõ +void SysTick_Handler(void) +{ + OSIntEnter(); //ж + OSTimeTick(); //ucosʱӷ + OSIntExit(); //лж +} +#endif + +//ʼӳٺ +//ʹucosʱ,˺ʼucosʱӽ +//SYSTICKʱӹ̶ΪHCLKʱӵ1/8 +//SYSCLK:ϵͳʱ +void delay_init() +{ + +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. + u32 reload; +#endif + SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8); //ѡⲿʱ HCLK/8 + fac_us=SystemCoreClock/8000000; //Ϊϵͳʱӵ1/8 + +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. + reload=SystemCoreClock/8000000; //ÿӵļ λΪK + reload*=1000000/OS_TICKS_PER_SEC;//OS_TICKS_PER_SEC趨ʱ + //reloadΪ24λĴ,ֵ:16777216,72M,Լ1.86s + fac_ms=1000/OS_TICKS_PER_SEC;//ucosʱٵλ + SysTick->CTRL|=SysTick_CTRL_TICKINT_Msk; //SYSTICKж + SysTick->LOAD=reload; //ÿ1/OS_TICKS_PER_SECжһ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk; //SYSTICK +#else + fac_ms=(u16)fac_us*1000;//ucos,ÿmsҪsystickʱ +#endif +} + +#ifdef OS_CRITICAL_METHOD //ʹucos +//ʱnus +//nusΪҪʱus. +void delay_us(u32 nus) +{ + u32 ticks; + u32 told,tnow,tcnt=0; + u32 reload=SysTick->LOAD; //LOADֵ + ticks=nus*fac_us; //ҪĽ + tcnt=0; + told=SysTick->VAL; //սʱļֵ + while(1) + { + tnow=SysTick->VAL; + if(tnow!=told) + { + if(tnow=ticks)break;//ʱ䳬/Ҫӳٵʱ,˳. + } + }; +} +//ʱnms +//nms:Ҫʱms +void delay_ms(u16 nms) +{ + if(OSRunning==TRUE)//osѾ + { + if(nms>=fac_ms)//ʱʱucosʱ + { + OSTimeDly(nms/fac_ms);//ucosʱ + } + nms%=fac_ms; //ucosѾ޷ṩôСʱ,ͨʽʱ + } + delay_us((u32)(nms*1000)); //ͨʽʱ,ʱucos޷. +} +#else//ucosʱ +//ʱnus +//nusΪҪʱus. +void delay_us(u32 nus) +{ + u32 temp; + SysTick->LOAD=nus*fac_us; //ʱ + SysTick->VAL=0x00; //ռ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk ; //ʼ + do + { + temp=SysTick->CTRL; + } + while(temp&0x01&&!(temp&(1<<16)));//ȴʱ䵽 + SysTick->CTRL&=~SysTick_CTRL_ENABLE_Msk; //رռ + SysTick->VAL =0X00; //ռ +} +//ʱnms +//עnmsķΧ +//SysTick->LOADΪ24λĴ,,ʱΪ: +//nms<=0xffffff*8*1000/SYSCLK +//SYSCLKλΪHz,nmsλΪms +//72M,nms<=1864 +void delay_ms(u16 nms) +{ + u32 temp; + SysTick->LOAD=(u32)nms*fac_ms;//ʱ(SysTick->LOADΪ24bit) + SysTick->VAL =0x00; //ռ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk ; //ʼ + do + { + temp=SysTick->CTRL; + } + while(temp&0x01&&!(temp&(1<<16)));//ȴʱ䵽 + SysTick->CTRL&=~SysTick_CTRL_ENABLE_Msk; //رռ + SysTick->VAL =0X00; //ռ +} +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.h new file mode 100644 index 0000000..f3101dd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/delay/delay.h @@ -0,0 +1,67 @@ +#ifndef __DELAY_H +#define __DELAY_H +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEK STM32 +//ʹSysTickͨģʽӳٽй +//delay_us,delay_ms +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/2 +//汾V1.5 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +//******************************************************************************** +//V1.2޸˵ +//жеóѭĴ +//ֹʱ׼ȷ,do whileṹ! + +//V1.3޸˵ +//˶UCOSIIʱ֧. +//ʹucosII,delay_initԶSYSTICKֵ,ʹ֮ucosTICKS_PER_SECӦ. +//delay_msdelay_usҲucosĸ. +//delay_usucosʹ,׼ȷȺܸ,ҪûռöĶʱ. +//delay_msucos,ԵOSTimeDly,δucosʱ,delay_usʵ,Ӷ׼ȷʱ +//ʼ,ucos֮delay_msʱij,ѡOSTimeDlyʵֻdelay_usʵ. + +//V1.4޸˵ 20110929 +//޸ʹucos,ucosδʱ,delay_msж޷Ӧbug. +//V1.5޸˵ 20120902 +//delay_usucosֹucosdelay_usִУܵµʱ׼ +////////////////////////////////////////////////////////////////////////////////// +void delay_init(void); +void delay_ms(u16 nms); +void delay_us(u32 nus); + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.c new file mode 100644 index 0000000..b99e841 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.h new file mode 100644 index 0000000..7a4ba9b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/sys/sys.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.c new file mode 100644 index 0000000..831a1b1 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.h new file mode 100644 index 0000000..8c100f3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/SYSTEM/usart/usart.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.c new file mode 100644 index 0000000..3311406 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.h new file mode 100644 index 0000000..12c7da6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/bootloader.h @@ -0,0 +1,35 @@ +#ifndef __BOOTLOADER_H__ +#define __BOOTLOADER_H__ + + +#include "uds_config.h" + + +#define BOOTLOADER_PROGRAMMING_FLAG 0xAA55BA5C + + +typedef enum +{ + /* Generic error codes */ + STATUS_SUCCESS = 0x000U, /*!< Generic operation success status */ + STATUS_ERROR = 0x001U, /*!< Generic operation failure status */ + STATUS_BUSY = 0x002U, /*!< Generic operation busy status */ + STATUS_TIMEOUT = 0x003U, /*!< Generic operation timeout status */ +} status_t; + + +extern void JumpToApplicationSW(void); +extern status_t EraseApplicationSoftwareCode(uint32_t address, uint32_t length); +extern status_t ProgramApplicationSoftware(uint32_t address, uint8_t *pdata, uint32_t length); + +extern void BootloaderInit(void); +extern uint8_t GetUdsUpdataFlag(void); + +void ClearExternProgrammingRequest(void); +void SetExternProgrammingRequest(void); +void SetBootloaderSwVersionAddress(void); +uint32_t GetBootloaderSwVersionAddress(void); +bool IsExternProgrammingRequestValid(void); + + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.c new file mode 100644 index 0000000..078ff7a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.c @@ -0,0 +1,97 @@ +#include "crc.h" + + +const unsigned short crc16tab[256] = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, + 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, + 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, + 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, + 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, + 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, + 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, + 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, + 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, + 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, + 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, + 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, + 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, + 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, + 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, + 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, + 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, + 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, + 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, + 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, + 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, + 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, + 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 +}; + +/* Calculate checksum */ +void CalcCheckSum(uint32_t *sum, uint8_t *data, uint32_t size) +{ + int i; + for(i=0;i>8)^pData[i]; + *crc=(*crc<<8)^crc16tab[tmp]; + } +} + +uint32_t CRC_Cal16_WithCfg( const uint8_t *pData, uint32_t size) +{ + uint8_t cnt,temp; + uint16_t crc=0xFFFF; + uint16_t poly=0x8005; + + while(size) + { + size--; + temp = * pData++; + crc ^=temp<<8; + for( cnt=0; cnt<8; cnt++ ) + { + if(crc &0x8000){crc<<=1; crc^=poly;} + else crc<<=1; + } + } + return crc; + +} + +uint32_t CRC16_DataCheck( const u8 *pData, u32 size ) +{ + uint32_t CRCData; + uint32_t CRC16; + //polynome 0x8005 + CRC16 = CRC_Cal16_WithCfg((u8*)pData, size); + CRCData = (u16)(pData[size+1]<<8)|pData[size]; + + return (CRCData^CRC16); +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.h new file mode 100644 index 0000000..ba09bf4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/crc.h @@ -0,0 +1,17 @@ +#ifndef _CRC_H +#define _CRC_H + +#include "sys.h" + + +uint32_t crc32( uint8_t *buf, int len); //crc32 ʵֺ +uint32_t crc32MultSegment( uint8_t *seg1, int len1, uint8_t *seg2, int len2); +void CalcCheckSum(uint32_t *sum, uint8_t *data, uint32_t size); +void CRC16_CCITT_1021_Init(uint16_t *crc); +void CRC16_CCITT_1021_Update(uint16_t *crc, uint8_t *pData ,uint32_t len); +uint32_t CRC16_DataCheck( const u8 *pData, u32 size ); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.c new file mode 100644 index 0000000..358f698 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.h new file mode 100644 index 0000000..3a2d56c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/diagnosis_mid.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_15765_2.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_15765_2.h new file mode 100644 index 0000000..2230497 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_15765_2.h @@ -0,0 +1,127 @@ +#ifndef TP_15765_2_H +#define TP_15765_2_H +/*! + * @file tp_15765_2.h + * @brief TP layer file according to the 15765-2. + * + */ + +#include "uds_types.h" + +#define FRAME_TYPE_MASK 0xF0 /*!< FRAME TYPE MASK */ +#define FLOW_STATUS_MASK 0x0F /*!< FLOW STATUS MASK */ +#define SEQUENCE_NUMBER_MASK 0x0F /*!< SEQUENCE NUMBER MASK */ +#define SINGLE_FRAME_DATA_LENGTH_MASK 0x0F /*!< SINGLE FRAME DATA LENGTH MASK */ +#define FIRST_FRAME_DATA_LENGTH_MSB_NIBBLE_MASK 0x0F /*!< FIRST FRAME DATA LENGTH MSB NIBBLE MASK */ +#define SEQUENCE_NUMBER_MAX 0x10 /*!< SEQUENCE NUMBER MAX */ +#define CAN_FRAME_BYTES_UPPER_RANGE 7 /*!< CAN FRAME BYTES UPPER RANGEK */ +#define ZERO_LOOP_COUNT 0 /*!< SEQUENCE NUMBER MASK */ +#define ONE_LOOP_COUNT 1 /*!< SEQUENCE NUMBER MASK */ +#define TWO_LOOP_COUNT 2 /*!< SEQUENCE NUMBER MASK */ + +#ifdef RX_MULTI_BUFFER_SUPPORT + #define RECEIVE_MULTI_BUFFER_SUPPORT TRUE +#else + #define RECEIVE_MULTI_BUFFER_SUPPORT FALSE +#endif + +/*! + * Enum Type. TP Layer State + */ +typedef enum TPState_Tag +{ + TP_Idle_State = 0, /*!< Idle State */ + TP_Wait_For_SFORFF_TxConf_State, /*!< Wait for TXConf State */ + TP_Wait_For_FCFrame_Rx_State, /*!< Wait for Flow Control State */ + TP_Transmit_CF_State, /*!< Transmit CF State */ + TP_Wait_For_CF_TxConf_State, /*!< Wait For CF TxConf State */ + TP_Wait_For_STmin_State, /*!< Wait For STmin State */ + TP_Wait_For_FC_TXconf_State, /*!< Wait For FC_TXconf State */ + TP_Rx_CF_State, /*!< Receive CF State */ + TP_Wait_For_DataRead_State /*!< Wait For DataRead State */ + }TPState_T; + +/*! + * Enum Type. Parameters + */ +typedef enum TPParameters_Tag +{ + N_BLOCKSIZE = 0, + N_SEPERATIONTIME +}TPParameters_T; + + +/*! + * Enum Type. Result for change parameter + */ +typedef enum TPResultChangePara_Tag +{ + N_OK_R = 0, + N_RX_ON, + N_WRONG_PARAMETER, + N_WRONG_VALUE +}TPResultChangePara_T; + +/*! + * Enum Type. Transmit sub state + */ +typedef enum TPTransmitSubState_Tag +{ + TP_TX_LOAD_CF_DATA = 0, + TP_TX_LOAD_REMAINING_BYTES_OF_CF, + TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF +}TPTransmitSubState_T; +/*! + * Enum Type. Receive sub state + */ +typedef enum TPReceiveSubState_Tag +{ + TP_RX_UNLOAD_CF_DATA = 0, + TP_RX_UNLOAD_REMAINING_BYTES_OF_CF, + TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF +}TPReceiveSubState_T; +/*! + * Enum Type. Transmit Status + */ +typedef enum TPTransmitStatus_Tag +{ + TP_TRANSMIT_IDLE = 0, + TP_TRANSMIT_START, + WAITINGFORFLOWCONTROL +}TPTransmitStatus_T; +/*! + * Enum Type. Receive Status + */ +typedef enum TPReceiveStatus_Tag +{ + TP_RECEIVE_IDLE = 0, + TP_RECEIVE_START +}TPReceiveStatus_T; +/*! + * Enum Type. Timer control + */ +typedef enum TPTimerControl_Tag +{ + TIMER_STOP = 0, + TIMER_RUN +}TPTimerControl_T; +/*! + * Enum Type. Flow control + */ +typedef enum TPFlowControlStatus_Tag +{ + CLEAR_TO_SEND = 0, + WAIT, + OVERFLOW, + RESERVED +}TPFlowControlStatus_T; +/*! + * Enum Type. Buffer Status + */ +typedef enum TPBufferStatus_Tag +{ + EMPTY = 0, + FILLED +}TPBufferStatus_T; + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_cca.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_cca.c new file mode 100644 index 0000000..2560e88 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_cca.c @@ -0,0 +1,1781 @@ +/*! + * @file tp_cca.c + * @brief TP layer file according to the 15765-2. + * + */ +#include "uds_config.h" + +/*! + * Macro. Minumum of the first frame data length + */ +#define MINIMUM_FIRST_FRAME_DATA_LENGTH 8 +/*! + * Macro. Dynamic tp para update enable + */ +#define DYNAMIC_TP_PARA_UPDATE_ENABLE 0 + +static uint8_t TP_Tx_Message_Status; /*!< Transmit Message Status */ +static uint8_t TP_Tx_Block_Size; /*!< Transmit Block Size */ +static uint8_t TP_Tx_Block_Size_Constant; /*!< Transmit Block Size Constant */ +static uint8_t TP_Tx_Separation_Time_Min_Constant; /*!< Min of Transmit Separation time constant */ +static uint8_t TP_Tx_Separation_Time_min; /*!< Min of Transmit Separation time */ +static uint8_t TP_Tx_Sequence_Number; /*!< Transmit sequence number */ +static uint8_t TP_Transmit_Sub_State; /*!< Transmit sub state */ +uint16_t TP_Tx_Message_DLC; /*!< Transmit Message DLC */ +static uint8_t TP_Tx_Frame_Type; /*!< Transmit Frame Type */ +static uint16_t TP_Tx_Index; /*!< Transmit Index */ +static uint8_t TP_Tx_Frame_DLC; /*!< Transmit Frame DLC */ +//static uint8_t TP_Transmit_Message_Number_Physical; /*!< Transmit transmit message physical number */ + +static uint8_t TP_Rx_Message_Status; /*!< Receive message Status */ +static uint16_t TP_Rx_Block_Size; /*!< Receive Block Size */ +//static uint16_t TP_Rx_Block_Size_Parameter; /*!< Receive Block size Parameter */ +//static uint8_t TP_Rx_Seperation_Time_Parameter; /*!< Receive Seperation Time Parameter */ +static uint8_t TP_Rx_Sequence_Number; /*!< Receive sequence number */ +static uint8_t TP_Receive_Sub_State; /*!< Receive sub state */ +static uint16_t TP_Rx_Message_DLC; /*!< Receive Message DLC */ +static uint8_t TP_Rx_Frame_Type; /*!< Receive Frame type */ +uint16_t TP_Rx_Index; /*!< Receive Index */ +static uint16_t TP_Rx_Frame_DLC; /*!< Receive Frame DLC */ +//static uint8_t TP_Receive_Message_Number_Physical; /*!< Receive Message Number Physical */ +//static uint8_t TP_Receivet_Message_Number_Functional; /*!< Receive Message Number Functional */ + uint16_t TP_Rx_Message_Length; /*!< Receive Message Length */ + +static uint16_t TPN_As_Timer; /*!< AS Timer */ +static uint16_t TPN_Ar_Timer; /*!< Ar Timer */ +static uint16_t TPN_Bs_Timer; /*!< Bs Timer */ +static uint16_t TPN_Cr_Timer; /*!< Cr Timer */ +static uint8_t TP_State; /*!< State of tp layer */ +static uint16_t TP_Data_Count; /*!< Data Count */ +static uint16_t TP_Next_Loop_Count; /*!< Next Loop Count */ +static uint8_t Flow_Status; /*!< Flow Status */ +static uint8_t TP_Result; /*!< Result */ +static uint8_t TP_Change_Parameter_Result; /*!< Change parameter Result */ +static uint8_t TP_Request_Type; /*!< Request type */ + +bool Frame_Tx_Complete; /*!< Frame transmit complete flag */ +static bool Frame_Available; /*!< Frame available flag */ + +static bool Load_Consecutive_Frame; /*!< Load CF flag */ + +static uint8_t TP_Tx_Buffer_Status; /*!< Tx Buffer Status */ +static uint8_t TP_Rx_Buffer_Status; /*!< Rx Buffer Status */ +static uint8_t TP_N_As_Timer_Control; /*!< As Timer Control */ +static uint8_t TP_N_Ar_Timer_Control; /*!< Ar Timer Control */ +static uint8_t TP_N_Bs_Timer_Control; /*!< Bs Timer Control */ +static uint8_t TP_N_Cr_Timer_Control; /*!< Cr Timer Control */ + +static bool Update_Tp_Parameter_Req = DYNAMIC_TP_PARA_UPDATE_ENABLE; +uint8_t TP_Buffer[TP_BUFFER_SIZE]; /*!< TP Buffer */ +//uint8_t TP_Tx_Buffer[TP_BUFFER_SIZE]; + +static uint8_t TP_Frame_Array[FRAME_DATA_SIZE]; /*!< Frame Buffer */ + +/* functions local to TP Module */ +static void TP_Transmit_Single_OR_First_Frame (void); +static void TP_Receive_Single_OR_First_Frame (void); +static void TP_Transmit_Consecutive_Frame (void); +static void TP_Receive_Consecutive_Frame (void); +static void TP_Check_Rx_Message_Length (void); +static void TP_Transmit_Flow_Control (void); +static void TP_Update_Timers (void); +static bool TP_Received_DLC_Check (void); +static uint8_t TP_STmin_Calculate (void); +static void TP_Idle_State_Process (void); +static void TP_Wait_For_SFORFF_TxConf_State_Process (void); +static void TP_Wait_For_FCFrame_Rx_State_Process (void); +static void TP_Transmit_CF_State_Process (void); +static void TP_Wait_For_CF_TxConf_State_Process (void); +static void TP_Wait_For_STmin_State_Process (void); +static void TP_Wait_For_FC_TXconf_State_Process (void); +static void TP_Rx_CF_State_Process (void); +static void TP_Wait_For_DataRead_State_Process (void); +static void TP_Tx_To_Idle_Init (uint8_t TP_Result); +static void TP_FC_Frame_Process (void); +static void TP_Rx_To_Idle_Init (uint8_t TP_Result); +static void TP_Transmit_Single_Frame (void); +static void TP_Transmit_First_Frame (void); +static void TP_Receive_Single_Frame (void); +static void TP_Receive_First_Frame (void); +static void TP_Tx_Load_CF_Data_Process (void); +static void TP_Tx_Load_Remaining_Bytes_OF_CF_Process (void); +static void TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process (void); +static void TP_Load_TL_Buffer_Start_NAs_Timer (void); +static void TP_Update_SN_and_BS (void); +static void TP_Tx_CF_Data_Process (void); +static void TP_Tx_Last_CF_Data_Process (void); +static void TP_Rx_Unload_CF_Data_Process (void); +static void TP_Rx_Unload_Remaining_Bytes_OF_CF_Process (void); +static void TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process (void); +static void TP_Rx_CF_Data_Process (void); +static void TP_Rx_Last_CF_Data_Process (void); + +/*! + * @brief TP_Init + * Read the message numbers from the TL config table, Initialize + * the state to idle, transmit and recieve status init, buffer status init, + * Timers disabling, loads the default value's of BS and STmin to + * variables. + */ +void TP_Init (void) +{ + /* Reads the Message number/Index from the TL config table */ +#ifdef TP_DIAG_PHYSICAL_MSG_SUPPORT + // TP_Transmit_Message_Number_Physical = 8; + // TP_Receive_Message_Number_Physical = 8; +#endif +#ifdef TP_DIAG_FUNCTIONAL_MSG_SUPPORT + // TP_Receivet_Message_Number_Functional = 8; +#endif + TP_State = TP_Idle_State; + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Tx_Buffer_Status = EMPTY; + TP_Rx_Buffer_Status = EMPTY; + Frame_Tx_Complete = false; +// Frame_Tx_Complete_Flag_For_Reset = false; + Frame_Available = false; + TP_N_As_Timer_Control = TIMER_STOP; + TP_N_Ar_Timer_Control = TIMER_STOP; + TP_N_Bs_Timer_Control = TIMER_STOP; + TP_N_Cr_Timer_Control = TIMER_STOP; + Flow_Status = CLEAR_TO_SEND; + /* default block size for receive. */ +// TP_Rx_Block_Size_Parameter = TP_RX_BLOCK_SIZE_MAX; + /* default STmin for receive. */ +// TP_Rx_Seperation_Time_Parameter = TP_RX_SEPARATION_TIME_MIN; + Load_Consecutive_Frame = false; +}/* End of TP_Init*/ +void TP_Task(void) +{ + //U32 context = hwi_disable_interrupts_savestate(); + switch (TP_State) + { + case TP_Idle_State: + TP_Idle_State_Process(); + break; + + case TP_Wait_For_SFORFF_TxConf_State: + TP_Wait_For_SFORFF_TxConf_State_Process(); + break; + + case TP_Wait_For_FCFrame_Rx_State: + TP_Wait_For_FCFrame_Rx_State_Process(); + break; + + case TP_Transmit_CF_State: + TP_Transmit_CF_State_Process(); + break; + + case TP_Wait_For_CF_TxConf_State: + TP_Wait_For_CF_TxConf_State_Process(); + break; + + case TP_Wait_For_STmin_State: + TP_Wait_For_STmin_State_Process(); + break; + + case TP_Wait_For_FC_TXconf_State: + TP_Wait_For_FC_TXconf_State_Process(); + break; + + case TP_Rx_CF_State: + TP_Rx_CF_State_Process(); + break; + + case TP_Wait_For_DataRead_State: + TP_Wait_For_DataRead_State_Process(); + break; + + default: + break; + } + + //hwi_restore_interrupts( context ); + +} +/*! + * @brief TP_Periodic_Task + * Main task which handles both transmit and receive portion of + * Network Layer + */ +void TP_Periodic_Task (void) +{ + TP_Update_Timers(); + TP_Task(); +}/* End of TP_Periodic_Task*/ +/*! + * @brief TP_Idle_State_Process + * This function handles TP_Idle_State + * + */ +static void TP_Idle_State_Process (void) +{ + if (Frame_Available == true) + { + Frame_Available = false; + TP_Receive_Single_OR_First_Frame(); + } +} +/*! + * @brief TP_Wait_For_SFORFF_TxConf_State_Process + * This function handles TP_Wait_For_SFORFF_TxConf_State + */ +static void TP_Wait_For_SFORFF_TxConf_State_Process (void) +{ + if (TPN_As_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (Frame_Tx_Complete == true) + { + Frame_Tx_Complete = false; + TP_N_As_Timer_Control = TIMER_STOP; + + if (TP_Tx_Frame_Type == SINGLE_FRAME) + { + TP_Result = N_OK; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (TP_Tx_Frame_Type == FIRST_FRAME) + { + Update_Tp_Parameter_Req = TRUE; + TP_State = TP_Wait_For_FCFrame_Rx_State; + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_FCFrame_Rx_State_Process + * This function handles TP_Wait_For_FCFrame_Rx_State + */ +static void TP_Wait_For_FCFrame_Rx_State_Process (void) +{ + uint8_t FlowControlStatus; + + if (TPN_Bs_Timer == 0) + { + TP_Result = N_TIMEOUTBs; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + + if (TP_Rx_Frame_Type == FLOW_CONTROL_FRAME) + { + TP_N_Bs_Timer_Control = TIMER_STOP; + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + TP_Tx_To_Idle_Init (TP_Result); + } + else + { + if (FlowControlStatus >= RESERVED) + { + TP_Result = N_INVALID_FS; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (FlowControlStatus == OVERFLOW) + { + TP_Result = N_BUFFER_OVFLW; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (FlowControlStatus == WAIT) + { + if (N_WAIT_FRAME_TX_MAX == 0) + { + TP_Result = N_WFT_OVRN; + TP_Tx_To_Idle_Init (TP_Result); + } + + /* A count of 1 less is loaded as Bs timeout was exceeding max set */ + TPN_Bs_Timer = (N_Bs_TIMER_COUNT) - 1; + TP_N_Bs_Timer_Control = TIMER_RUN; + } + else if (FlowControlStatus == CLEAR_TO_SEND) + { + TP_FC_Frame_Process(); + } + else + { + /* do nothing */ + } + } + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Transmit_CF_State_Process + * This function handles TP_Transmit_CF_State + */ +static void TP_Transmit_CF_State_Process (void) +{ + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + TP_State = TP_Wait_For_CF_TxConf_State; + } +} +/*! + * @brief TP_Wait_For_CF_TxConf_State_Process + * This function handles TP_Wait_For_CF_TxConf_State + */ +static void TP_Wait_For_CF_TxConf_State_Process (void) +{ + if (TPN_As_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Tx_To_Idle_Init (TP_Result); + } + else if ( (Frame_Tx_Complete == true) || (Load_Consecutive_Frame == true)) + { + TP_N_As_Timer_Control = TIMER_STOP; + Frame_Tx_Complete = false; + + if (TP_Tx_Message_DLC == 0) + { + TP_Result = N_OK; + TP_Tx_To_Idle_Init (TP_Result); + } + else if ( (TP_Tx_Block_Size_Constant != 0) && (TP_Tx_Block_Size == 0)) + { + Update_Tp_Parameter_Req = DYNAMIC_TP_PARA_UPDATE_ENABLE; + TP_State = TP_Wait_For_FCFrame_Rx_State; + } + else if ( (TP_Tx_Separation_Time_Min_Constant == ZERO_LOOP_COUNT) || + (TP_Tx_Separation_Time_Min_Constant == ONE_LOOP_COUNT)) + { + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + Load_Consecutive_Frame = false; + } + else + { + Load_Consecutive_Frame = true; + } + } + else if (TP_Tx_Separation_Time_Min_Constant == TWO_LOOP_COUNT) + { + TP_State = TP_Transmit_CF_State; + } + else if (TP_Tx_Separation_Time_Min_Constant > TWO_LOOP_COUNT) + { + TP_Tx_Separation_Time_min--; + TP_State = TP_Wait_For_STmin_State; + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_STmin_State_Process + * This function handles TP_Wait_For_STmin_State + */ +static void TP_Wait_For_STmin_State_Process (void) +{ + TP_Tx_Separation_Time_min--; + + if (TP_Tx_Separation_Time_min <= 1) + { + TP_State = TP_Transmit_CF_State; + TP_Tx_Separation_Time_min = TP_Tx_Separation_Time_Min_Constant; + } +} +/*! + * @brief TP_Wait_For_FC_TXconf_State_Process + * This function handles TP_Wait_For_FC_TXconf_State + */ +static void TP_Wait_For_FC_TXconf_State_Process (void) +{ + if (Frame_Tx_Complete == true) + { + Frame_Tx_Complete = false; + TP_N_Ar_Timer_Control = TIMER_STOP; + TP_State = TP_Rx_CF_State; + TPN_Cr_Timer = N_Cr_TIMER_COUNT; + TP_N_Cr_Timer_Control = TIMER_RUN; + } + else if (TPN_Ar_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_CF_State_Process + * This function handles TP_Rx_CF_State + */ +static void TP_Rx_CF_State_Process (void) +{ + if (TPN_Cr_Timer == 0) + { + TP_Result = N_TIMEOUTCr; + TP_Rx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_N_Cr_Timer_Control = TIMER_STOP; + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + + if ( (TP_Rx_Frame_Type == SINGLE_FRAME) || + (TP_Rx_Frame_Type == FIRST_FRAME)) + { + TP_Result = N_UNEXP_PDU; + TP_Rx_To_Idle_Init (TP_Result); + TP_Receive_Single_OR_First_Frame(); + } + else if (TP_Rx_Frame_Type == CONSECUTIVE_FRAME) + { + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + if (TP_Rx_Sequence_Number == (TP_Frame_Array[0] & + SEQUENCE_NUMBER_MASK)) + { + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_Receive_Consecutive_Frame(); + TPN_Cr_Timer = N_Cr_TIMER_COUNT; + TP_N_Cr_Timer_Control = TIMER_RUN; + + if (TP_Receive_Sub_State == TP_RX_UNLOAD_CF_DATA) + { + TP_Check_Rx_Message_Length(); + } + } + else + { + TP_Result = N_WRONG_SN; + TP_Rx_To_Idle_Init (TP_Result); + } + } + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_DataRead_State_Process + * This function handles TP_Wait_For_DataRead_State + */ +static void TP_Wait_For_DataRead_State_Process (void) +{ + if (TPN_Cr_Timer == 0) + { + TP_Result = N_TIMEOUTCr; + TP_Rx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_Result = TP_BUFFER_OVER_FLOW; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + TP_Receive_Consecutive_Frame(); + + if (TP_Receive_Sub_State == TP_RX_UNLOAD_CF_DATA) + { + TP_Check_Rx_Message_Length(); + } + } +} +/*! + * @brief TP_Tx_To_Idle_Init + * This function handles TP transmit variables initialization + * when transmit operation is completed suceesfully / unsuceesfully + * + * @param TP_Result TP Result + */ +static void TP_Tx_To_Idle_Init (uint8_t TP_Result) +{ + UCB_TP_N_USData_Confirm (TP_Result); + TP_State = TP_Idle_State; + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + TP_Tx_Buffer_Status = EMPTY; + Frame_Tx_Complete = false; +} +/*! + * @brief TP_FC_Frame_Process + * This function handles flow control parameter processing + */ +static void TP_FC_Frame_Process (void) +{ + if (Update_Tp_Parameter_Req) + { + TP_Tx_Block_Size_Constant = TP_Frame_Array[1]; + /* function to calcualte stmin */ + TP_Tx_Separation_Time_Min_Constant = + TP_STmin_Calculate(); + } + + TP_Tx_Block_Size = TP_Tx_Block_Size_Constant; + TP_Tx_Separation_Time_min = + TP_Tx_Separation_Time_Min_Constant; + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + TP_State = TP_Wait_For_CF_TxConf_State; + } + else + { + TP_State = TP_Transmit_CF_State; + } +} +/*! + * @brief TP_Rx_To_Idle_Init + * This function handles TP receive variables initialization + * when receive operation is completed suceesfully / unsuceesfully + */ +static void TP_Rx_To_Idle_Init (uint8_t TP_Result) +{ + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + TP_State = TP_Idle_State; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Rx_Buffer_Status = EMPTY; +} +/*! + * @brief TP_Transmit_Single_OR_First_Frame + * This function handles transmission of 'single' or 'first' + * frame + */ +static void TP_Transmit_Single_OR_First_Frame (void) +{ + if (TP_Tx_Frame_Type == SINGLE_FRAME) + { + TP_Transmit_Single_Frame(); + } + else if (TP_Tx_Frame_Type == FIRST_FRAME) + { + TP_Transmit_First_Frame(); + } + else + { + /* do nothing */ + } + + /* for CF1 count starts with '1'. Becomes '0' if it reaches 16 */ + TP_Tx_Sequence_Number = 1; + /* TL API is called to set DLC */ + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + /* TL API is called to transmit a frame */ + TP_State = TP_Wait_For_SFORFF_TxConf_State; + TPN_As_Timer = N_As_TIMER_COUNT; + TP_N_As_Timer_Control = TIMER_RUN; +}/* End of TP_Transmit_Single_OR_First_Frame*/ +/*! + * @brief TP_Transmit_Single_Frame + * This function handles transmission of 'single' frame + */ +static void TP_Transmit_Single_Frame (void) +{ + uint8_t Frame_Array_Index, Data_Count ; + /* store N_PCI and message length in the first byte of Frame buffer */ + TP_Frame_Array[0] = (uint8_t) (SINGLE_FRAME | TP_Tx_Message_DLC); + Data_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= TP_Tx_Message_DLC; + Frame_Array_Index++) + { + /* copy the data bytes from TP buffer to frame buffer */ + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + Data_Count++; + } + + /* DLC of the frame to be transmitted: Data bytes + N_PCI */ + TP_Tx_Frame_DLC = (uint8_t) (TP_Tx_Message_DLC + 1); + + if (PADDING_OPERATION == true) + { + if (Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE) + { + /* padd the remaining space in the frame buffer */ + for (; Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE; + Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + /* DLC of the frame to be transmitted: DLC Max bytes */ + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + } +} +/*! + * @brief TP_Transmit_First_Frame + * This function handles transmission of 'first' frame + */ +static void TP_Transmit_First_Frame (void) +{ + uint8_t Frame_Array_Index; + /*store N_PCI and message length in the first and second byte of Frame buffer*/ + TP_Frame_Array[0] = (uint8_t) (FIRST_FRAME | ( (TP_Tx_Message_DLC & 0X0F00) >> 8)); + TP_Frame_Array[1] = (uint8_t) (TP_Tx_Message_DLC & 0X00FF); + + for (Frame_Array_Index = 2; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + /* DLC of the frame to be transmitted: DLC Max bytes */ + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; +} +/*! + * @brief TP_Receive_Single_OR_First_Frame + * This function handles reception of 'single' or 'first' frame + */ +static void TP_Receive_Single_OR_First_Frame (void) +{ + /* first byte: MSB Nibble indicates frame type :-N_PCI */ + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + TP_Rx_Index = 0; + TP_Request_Type = PHYSICAL_ADDRESS_TYPE; + + UdsService.FrameType=TP_Rx_Frame_Type; + + if (TP_Rx_Frame_Type == SINGLE_FRAME) + { + TP_Receive_Single_Frame(); + } + else if (TP_Rx_Frame_Type == FIRST_FRAME) + { + TP_Receive_First_Frame(); + } + else + { + /* do nothing */ + } +}/* End of TP_Receive_Single_OR_First_Frame*/ +/*! + * @brief TP_Receive_Single_Frame + * This function handles reception of 'single' frame + */ +static void TP_Receive_Single_Frame (void)//THT +{ + uint8_t Frame_Array_Index; + /* first byte: LSB Nibble indicates data length */ + TP_Rx_Message_DLC = TP_Frame_Array[0] & SINGLE_FRAME_DATA_LENGTH_MASK; + //UdsService.RxDlc = TP_Rx_Message_DLC; + for (Frame_Array_Index = 1; Frame_Array_Index <= TP_Rx_Message_DLC; + Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + } + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } +} +/*! + * @brief TP_Receive_First_Frame + * This function handles reception of 'first' frame + */ +static void TP_Receive_First_Frame (void) +{ + uint8_t Frame_Array_Index; + TP_Rx_Message_DLC = ( (uint16_t) ( (TP_Frame_Array[0] & + FIRST_FRAME_DATA_LENGTH_MSB_NIBBLE_MASK) << 8) | TP_Frame_Array[1]); + TP_Rx_Message_Length = TP_Rx_Message_DLC; + if ( (RECEIVE_MULTI_BUFFER_SUPPORT == false) && + (TP_Rx_Message_DLC > TP_BUFFER_SIZE)) + { + TP_Result = TP_RX_LENGTH_INVALID; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + Flow_Status = OVERFLOW; + TP_Transmit_Flow_Control(); + Flow_Status = CLEAR_TO_SEND; + TP_State = TP_Idle_State; + } + else + { + if (TP_Rx_Message_DLC >= MINIMUM_FIRST_FRAME_DATA_LENGTH) + { + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + for (Frame_Array_Index = 2; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Message_Length--; + TP_Rx_Index++; + } + + TP_Rx_Sequence_Number = 1; + /* User call back function to notify the first frame of multiframe message + arrival */ + UCB_TP_N_USData_FF_Indication (TP_Rx_Message_DLC); + TP_Rx_Message_Status = TP_RECEIVE_START; + /* After receiveing first frame this API is called to transmit flow control + frame */ + TP_Transmit_Flow_Control(); + } + } + } +} +/*! + * @brief TP_Transmit_Consecutive_Frame + * Handles the consecutive frame transmission with respect to + * total message length and the TP buffer + */ +static void TP_Transmit_Consecutive_Frame (void) +{ + switch (TP_Transmit_Sub_State) + { + case TP_TX_LOAD_CF_DATA: + TP_Tx_Load_CF_Data_Process(); + break; + + case TP_TX_LOAD_REMAINING_BYTES_OF_CF: + TP_Tx_Load_Remaining_Bytes_OF_CF_Process(); + break; + + case TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF: + TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process(); + break; + + default: + break; + }/* end of TP_Transmit_Sub_State switch */ +}/* End of TP_Transmit_Consecutive_Frame*/ +/*! + * @brief TP_Tx_Load_CF_Data_Process + * Handles the consecutive frame transmission with respect to + * total message length and the TP buffer + */ +static void TP_Tx_Load_CF_Data_Process (void) +{ + TP_Frame_Array[0] = CONSECUTIVE_FRAME | TP_Tx_Sequence_Number; + TP_Data_Count = TP_BUFFER_SIZE - TP_Tx_Index; + + if (TP_Tx_Message_DLC >= CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Tx_CF_Data_Process(); + } + else if (TP_Tx_Message_DLC < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Tx_Last_CF_Data_Process(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_CF_Data_Process + * Checks the data availability in TP buffer and loads the CF + * accordingly when CF is other than last CF + */ +static void TP_Tx_CF_Data_Process (void) +{ + uint8_t Frame_Array_Index; + + if (TP_Data_Count < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + TP_Next_Loop_Count++; + } + + TP_Transmit_Sub_State = TP_TX_LOAD_REMAINING_BYTES_OF_CF; + TP_Tx_Buffer_Status = EMPTY; + UCB_TP_Transmit_Buffer_Empty(); + TP_Tx_Index = 0; + } + else if (TP_Data_Count >= CONSECUTIVE_FRAME_DATA_BYTE) + { + for (Frame_Array_Index = 1; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_State = TP_Wait_For_CF_TxConf_State; + TP_Update_SN_and_BS(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_Last_CF_Data_Process + * Checks the data availability in TP buffer and loads the CF + * accordingly for last CF + */ +static void TP_Tx_Last_CF_Data_Process (void)//THT +{ + uint8_t Frame_Array_Index, Data_Count, TempLoopCount; + + if (TP_Data_Count >= TP_Tx_Message_DLC) + { + Data_Count = 1; + TempLoopCount = (uint8_t) TP_Tx_Message_DLC; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TempLoopCount; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + Data_Count++; + } + + TP_Tx_Frame_DLC = TempLoopCount; + + if (PADDING_OPERATION == true) + { + for (; Data_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_State = TP_Wait_For_CF_TxConf_State; + } + else if (TP_Data_Count < TP_Tx_Message_DLC) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + TP_Next_Loop_Count++; + } + + TP_Transmit_Sub_State = TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF; + TP_Tx_Buffer_Status = EMPTY; + UCB_TP_Transmit_Buffer_Empty(); + TP_Tx_Index = 0; + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_Load_Remaining_Bytes_OF_CF_Process + * Handles the consecutive frame transmission with respect to + * remaining bytes of CF + */ +static void TP_Tx_Load_Remaining_Bytes_OF_CF_Process (void) +{ + if (TP_Tx_Buffer_Status == FILLED) + { + for (; TP_Next_Loop_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; TP_Next_Loop_Count++) + { + TP_Frame_Array[TP_Next_Loop_Count] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_State = TP_Wait_For_CF_TxConf_State; + TP_Update_SN_and_BS(); + } +} +/*! + * @brief TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process + * Handles the consecutive frame transmission with respect to + * remaining bytes of last CF + */ +static void TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process (void) +{ + uint8_t Data_Count; + //uint8_t TempLoopCount; + + if (TP_Tx_Buffer_Status == FILLED) + { + Data_Count = (uint8_t) TP_Next_Loop_Count; + //TempLoopCount = (uint8_t) TP_Tx_Message_DLC; + TP_Tx_Frame_DLC = (uint8_t) (TP_Next_Loop_Count + TP_Tx_Message_DLC); + + for (; TP_Next_Loop_Count < TP_Tx_Frame_DLC + ; TP_Next_Loop_Count++) + { + TP_Frame_Array[TP_Next_Loop_Count] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + Data_Count++; + } + + if (PADDING_OPERATION == true) + { + for (; Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE; + Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_State = TP_Wait_For_CF_TxConf_State; + } +} +/*! + * @brief TP_Load_TL_Buffer_Start_NAs_Timer + * Loads the frame into TL s/w buffer and starts the NAs timer + * counter. + */ +static void TP_Load_TL_Buffer_Start_NAs_Timer (void) +{ + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + TPN_As_Timer = N_As_TIMER_COUNT; + TP_N_As_Timer_Control = TIMER_RUN; +} +/*! + * @brief TP_Update_SN_and_BS + * updates the sequence number and the block size parameters + */ +static void TP_Update_SN_and_BS (void) +{ + TP_Tx_Sequence_Number++; + + if (TP_Tx_Sequence_Number == SEQUENCE_NUMBER_MAX) + { + TP_Tx_Sequence_Number = 0; + } + + if (TP_Tx_Block_Size_Constant != 0) + { + TP_Tx_Block_Size--; + } +} +/*! + * @brief TP_Receive_Consecutive_Frame + * Handles the consecutive frame reception with respect to total + * message length and the TP buffer + */ +static void TP_Receive_Consecutive_Frame (void) +{ + switch (TP_Receive_Sub_State) + { + case TP_RX_UNLOAD_CF_DATA: + TP_Rx_Unload_CF_Data_Process(); + break; + + case TP_RX_UNLOAD_REMAINING_BYTES_OF_CF: + TP_Rx_Unload_Remaining_Bytes_OF_CF_Process(); + break; + + case TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF: + TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process(); + break; + + default: + break; + }/* end of TP_Receive_Sub_State switch */ +}/* End of TP_Receive_Consecutive_Frame */ +/*! + * @brief TP_Rx_Unload_CF_Data_Process + * Handles the consecutive frame reception with respect to total + * message length and the TP buffer + */ +static void TP_Rx_Unload_CF_Data_Process (void) +{ + TP_Data_Count = TP_BUFFER_SIZE - TP_Rx_Index; + + if (TP_Rx_Message_Length >= CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Rx_CF_Data_Process(); + } + else if (TP_Rx_Message_Length < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Rx_Last_CF_Data_Process(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_CF_Data_Process + * Checks the memory availability in TP buffer and unloads the CF + * accordingly when CF is other than last CF ( From TL to TP Buffer) + */ +static void TP_Rx_CF_Data_Process (void) +{ + uint8_t Frame_Array_Index; + + if (TP_Data_Count < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + TP_Next_Loop_Count++; + } + if(!TP_Rx_Message_Length) + { + UdsService.MultFrameComp=1; + } + TP_Receive_Sub_State = TP_RX_UNLOAD_REMAINING_BYTES_OF_CF; + TP_State = TP_Wait_For_DataRead_State; + TP_Rx_Buffer_Status = FILLED; +#ifdef RX_MULTI_BUFFER_SUPPORT + UCB_TP_Receive_Buffer_Filled(); +#endif + TP_Rx_Index = 0; + } + else if (TP_Data_Count >= CONSECUTIVE_FRAME_DATA_BYTE) + { + for (Frame_Array_Index = 1; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; // THT + } + if(!TP_Rx_Message_Length) + { + UdsService.MultFrameComp=1; + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_Last_CF_Data_Process + * Checks the memory availability in TP buffer and unloads the CF + * accordingly for last CF ( From TL to TP Buffer) + */ +static void TP_Rx_Last_CF_Data_Process (void) +{ + uint8_t TempLoopCount, Frame_Array_Index; + + if (TP_Data_Count >= TP_Rx_Message_Length) + { + TempLoopCount = (uint8_t) TP_Rx_Message_Length; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TempLoopCount; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + if(!TP_Rx_Message_Length)//THT + { + UdsService.MultFrameComp=1; + } + } + else if (TP_Data_Count < TP_Rx_Message_Length) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + TP_Next_Loop_Count++; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF; + TP_State = TP_Wait_For_DataRead_State; + TP_Rx_Buffer_Status = FILLED; +#ifdef RX_MULTI_BUFFER_SUPPORT + UCB_TP_Receive_Buffer_Filled(); +#endif + TP_Rx_Index = 0; + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_Unload_Remaining_Bytes_Of_CFProcess + * Handles the consecutive frame reception with respect to + * remaining bytes of CF + */ +static void TP_Rx_Unload_Remaining_Bytes_OF_CF_Process (void) +{ + if (TP_Rx_Buffer_Status == EMPTY) + { + for (; TP_Next_Loop_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; TP_Next_Loop_Count++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[TP_Next_Loop_Count]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_State = TP_Rx_CF_State; + } +} +/*! + * @brief TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process + * Handles the consecutive frame reception with respect to + * remaining bytes of last CF + */ +static void TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process (void) +{ + uint8_t TempLoopCount; + //uint8_t Data_Count; + + if (TP_Rx_Buffer_Status == EMPTY) + { + // Data_Count = 0; + TempLoopCount = (uint8_t) TP_Rx_Message_Length; + + for (; TP_Next_Loop_Count <= + (TempLoopCount + 1); TP_Next_Loop_Count++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[TP_Next_Loop_Count]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_State = TP_Rx_CF_State; + } +} +/*! + * @brief TP_Transmit_Buffer_Filled + * Sets the TP buffer to true state. After filling the buffer, + * application will call the function to indicate TP layer that buffer has + * been filled. + */ +void TP_Transmit_Buffer_Filled (void) +{ + TP_Tx_Buffer_Status = FILLED; +}/* End of TP_Transmit_Buffer_Filled*/ +/*! + * @brief TP_Receive_Buffer_Read + * Clears the TP buffer to false state. After emptying the buffer, + * application will call the function to indicate TP layer that buffer is + * emptied. + */ +void TP_Receive_Buffer_Read (void) +{ + TP_Rx_Buffer_Status = EMPTY; +}/* End of TP_Receive_Buffer_Read */ +/*! + * @brief TP_Check_Rx_Message_Length + * This API checks for the remaining length. If all the bytes are + * received it goes to idle stste. Otherwise it goes to a state to receive + * next CF + */ +static void TP_Check_Rx_Message_Length (void) +{ + if (TP_Rx_Message_Length == 0) + { + TP_N_Cr_Timer_Control = TIMER_STOP; + TP_State = TP_Idle_State; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Rx_Buffer_Status = EMPTY; + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + if (TP_RX_BLOCK_SIZE_MAX == 0) + { + TP_State = TP_Rx_CF_State; + } + else + { + TP_Rx_Block_Size--; + + if (TP_Rx_Block_Size == 0) + { + TP_Transmit_Flow_Control(); + TP_State = TP_Wait_For_FC_TXconf_State; + } + } + + TP_Rx_Sequence_Number++; + + if (TP_Rx_Sequence_Number == SEQUENCE_NUMBER_MAX) + { + TP_Rx_Sequence_Number = 0; + } + } +}/* End of TP_Check_Rx_Message_Length */ +/*! + * @brief TP_Transmit_Flow_Control + * This API is responsible for framing the flowcontrol message + * and transmitting to the transmitter using TL API's + */ +static void TP_Transmit_Flow_Control (void) +{ + uint8_t Frame_Array_Index; + /* frame a control-frame using modifiable parameters */ + /* store N_PCI and flow status, as first byte */ + TP_Frame_Array[0] = FLOW_CONTROL_FRAME | Flow_Status; + /* store ECU's BS parameter for receiving, as second byte */ + TP_Frame_Array[1] = TP_RX_BLOCK_SIZE_MAX; // 20190315 lbin + /* store ECU's STmin parameter for receiving, as third byte */ + TP_Frame_Array[2] = TP_RX_SEPARATION_TIME_MIN;//TP_Rx_Seperation_Time_Parameter; + /* store BS to another variable */ + TP_Rx_Block_Size = TP_RX_BLOCK_SIZE_MAX; + TP_Tx_Frame_DLC = FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE; + + if (PADDING_OPERATION == true) + { + for (Frame_Array_Index = 3; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + HAL_UDS_Set_Tx_ID(0); + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + TP_State = TP_Wait_For_FC_TXconf_State; + TPN_Ar_Timer = N_Ar_TIMER_COUNT; + TP_N_Ar_Timer_Control = TIMER_RUN; +}/* End of TP_Transmit_Flow_Control */ +/*! + * @brief TP_Received_DLC_Check + * This API checks for the received DLC.If the received DLC is + * less than the expected DLC it returns false. Otherwise it returns true. + */ +static bool TP_Received_DLC_Check (void) +{ + bool ReceivedDLCResult = false; + //uint8_t len=0; + switch (TP_Rx_Frame_Type)//THT + { + case SINGLE_FRAME: + //len = (TP_Rx_Message_DLC + SINGLE_FRAME_N_PCI_BYTE); + if (TP_Rx_Message_DLC != 0) + { + if (TP_Rx_Frame_DLC < (TP_Rx_Message_DLC + SINGLE_FRAME_N_PCI_BYTE)) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + break; + + case FIRST_FRAME: + if (TP_Rx_Frame_DLC < FIRST_FRAME_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + + break; + + case CONSECUTIVE_FRAME: + if (TP_Rx_Message_Length >= CONSECUTIVE_FRAME_DATA_BYTE) + { + if (TP_Rx_Frame_DLC < CONSECUTIVE_FRAME_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + else + { + if (TP_Rx_Frame_DLC < (TP_Rx_Message_Length + + CONSECUTIVE_FRAME_N_PCI_BYTE)) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + + break; + + case FLOW_CONTROL_FRAME: + if (TP_Rx_Frame_DLC < FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + + break; + + default: + break; + } + + return (ReceivedDLCResult); +}/* End of TP_Received_DLC_Check */ +/*! + * @brief TP_Update_Timers + * If the timers are enabled, timercount for each timer is + * decremented. Timers are: N_As, N_Ar, N_Bs and N_Cr + */ +static void TP_Update_Timers (void) +{ + if (TP_N_As_Timer_Control == TIMER_RUN) + { + if (TPN_As_Timer > 0) + { + TPN_As_Timer--; + } + else + { + // _P101 = 0x00; TBD-PVD : Timer needs to be identified. + } + } + + if (TP_N_Ar_Timer_Control == TIMER_RUN) + { + if (TPN_Ar_Timer > 0) + { + TPN_Ar_Timer--; + } + } + + if (TP_N_Bs_Timer_Control == TIMER_RUN) + { + if (TPN_Bs_Timer > 0) + { + TPN_Bs_Timer--; + } + } + + if (TP_N_Cr_Timer_Control == TIMER_RUN) + { + if (TPN_Cr_Timer > 0) + { + TPN_Cr_Timer--; + } + } +}/* End of TP_Update_Timers */ +/*! + * @brief TP_GetBufferSize + * User calls this API to get the size of the buffer. + * decremented. Timers are: N_As, N_Ar, N_Bs and N_Cr + * + * @return TP Buffer size + */ +uint16_t TP_Get_Message_Buffer_Size (void) +{ + return (TP_BUFFER_SIZE); /* size of the TP_Buffer as configured in the + config file */ +}/* End of TP_Get_Message_Buffer_Size */ +/*! + * @brief TP_GetBufferPointer + * User calls this API to get the pointer(address)of the + * TP_Buffer. + * + * @return Address of the TP buffer + */ + +uint8_t *TP_Get_Message_Buffer_Pointer (void) +{ + //memset(TP_Tx_Buffer,0x0,TP_BUFFER_SIZE); + // memcpy(TP_Tx_Buffer,TP_Buffer,TP_BUFFER_SIZE); + // memset(TP_Buffer,0x0,TP_BUFFER_SIZE); + return (TP_Buffer); /* returns the starting address of the TP buffer */ +}/* End of TP_Get_Message_Buffer_Pointer */ +/*! + * @brief TP_Get_Request_Type + * User calls this API to get the type of + * request(physical/functional). + * + * @return Address of the TP buffer + */ +uint8_t TP_Get_Request_Type (void) +{ + return (TP_Request_Type); /* returns the type of request */ +}/* End of TP_Get_Request_Type */ +/*! + * @brief TP_N_USData_Request + * User calls this API to transmit a message. It passes the length + * of the message to be transmitted. + * + * @param TPTransmitMessageLength Transmit message length + */ +void TP_N_USData_Request (uint16_t TPTransmitMessageLength) +{ + TP_Tx_Message_DLC = TPTransmitMessageLength; + + if (TP_Tx_Message_DLC <= MAXIMUM_SINGLE_FRAME_DATA_BYTE) + { + TP_Tx_Frame_Type = SINGLE_FRAME; + } + else + { + TP_Tx_Frame_Type = FIRST_FRAME; + } + + TP_Tx_Message_Status = TP_TRANSMIT_START; + TP_Tx_Index = 0; + + if (TP_Tx_Buffer_Status == FILLED) + { + TP_Transmit_Single_OR_First_Frame(); + } + else + { + TP_Result = TP_BUFFER_NOT_FILLED; + UCB_TP_N_USData_Confirm (TP_Result); + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + } + +}/* End of TP_N_USData_Request */ +/*! + * @brief TP_D_UUData_Confirm + * This is a callback function called by TL after transmitting + * a message corresponding to TP. Flag is set to inform the TP about frame + * transmission completion. + * + */ +void TP_D_UUData_Confirm (void) +{ + Frame_Tx_Complete = true; + TP_N_As_Timer_Control = TIMER_STOP; + + if ( (TP_State == TP_Wait_For_SFORFF_TxConf_State) && + (TP_Tx_Frame_Type == FIRST_FRAME)) + { + UCB_TP_N_USData_FF_Confirmation(); + } + + if ( ( (TP_State == TP_Wait_For_SFORFF_TxConf_State) && + (TP_Tx_Frame_Type == FIRST_FRAME)) || + ( (TP_Tx_Block_Size_Constant != 0) && (TP_Tx_Block_Size == 0))) + { + TPN_Bs_Timer = N_Bs_TIMER_COUNT; + TP_N_Bs_Timer_Control = TIMER_RUN; + TP_Tx_Message_Status = WAITINGFORFLOWCONTROL; + } + + if ( ( (TP_Tx_Message_Status == TP_TRANSMIT_START) && + (TP_Tx_Separation_Time_Min_Constant == 0)) || + (SINGLE_FRAME == TP_Tx_Frame_Type) || + ( (TP_State == TP_Wait_For_CF_TxConf_State) && (0 == TP_Tx_Message_DLC))) + { + /* to transmit 2nd CF onwards if stmin =0......*/ + /* to handle next request within loop time of response */ + TP_Task(); + } + + if ( (TP_Rx_Message_Status == TP_RECEIVE_START) && + (TP_State == TP_Wait_For_FC_TXconf_State)) + { + /* to notify flow control tx so that cf's can be received(any time)*/ + TP_Task(); + } +}/* End of TP_D_UUData_Confirm */ +/*! + * @brief TP_D_UUData_Indication_Physical + * This is a callback function called by TL after receiving + * a message(Physical) corresponding to TP. If the ECU is transmitting, + * and if it receives a frame it is ignored. Flag is set to inform the TP about + * frame arrival.Data is copied from the software buffer to TP's Frame buffer. + * + */ +bool TpRxFlg=false; +uint8_t g_ucTpRxStatusCnt; +void TP_D_UUData_Indication_Physical (void) +{ + //uint8_t Frame_Array_Index; + uint8_t FlowControlStatus; + + if (TP_Tx_Message_Status != TP_TRANSMIT_START) + { + Frame_Available = true; + TP_Rx_Frame_DLC = HAL_UDS_Rx_DLC(); + HAL_UDS_Get_Buf(TP_Frame_Array); + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if ( (TP_Tx_Message_Status == WAITINGFORFLOWCONTROL) && + (FlowControlStatus == CLEAR_TO_SEND)) + { + TP_Tx_Message_Status = TP_TRANSMIT_START; + } + + if ( (TP_Rx_Message_Status == TP_RECEIVE_START)) + { + TP_Task(); /* to receive cf's......*/ + } + g_ucTpRxStatusCnt=0; + TpRxFlg=true; + UdsService.PhyFlg = true; + //Debug("UDS REC:\r\n"); // + } + else + { + if(++g_ucTpRxStatusCnt>=2) + { + UDS_Service_Init(); + TP_Init(); + //TP_Rx_To_Idle_Init(TP_Result); + //Debug("UDS g_ucTpRxStatusCnt:\r\n"); + g_ucTpRxStatusCnt=0; + TP_Tx_Message_Status=TP_TRANSMIT_IDLE; + TP_State =TP_Idle_State; + HAL_Response_Pocessing = false; + } + } +}/* End of TP_D_UUData_Indication_Physical */ +#ifdef TP_DIAG_FUNCTIONAL_MSG_SUPPORT +/*! + * @brief TP_D_UUData_Indication_Functional + * This is a callback function called by TL after receiving + * a message(functional) corresponding to TP. If the ECU is transmitting, + * and if it receives a frame it is ignored. Flag is set to inform the TP about + * frame arrival. Data is copied from the software buffer to TP's Frame buffer + */ +void TP_D_UUData_Indication_Functional (void) +{ + // uint8_t *ReceivedMessageAddress; + uint8_t Frame_Array_Index; + uint8_t FlowControlStatus; + + if (TP_Tx_Message_Status != TP_TRANSMIT_START) //if ((TP_Tx_Message_Status == TP_TRANSMIT_IDLE)||(TP_Tx_Message_Status != TP_TRANSMIT_START)) + { + if ((UdsService.PhyFlg == true) && (TP_Rx_Message_Status == TP_RECEIVE_START)) { + return; + } + TP_Rx_Frame_DLC = HAL_UDS_Rx_DLC(); + HAL_UDS_Get_Buf(TP_Frame_Array); + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + TP_Rx_Index = 0; + UdsService.RxDlc = TP_Rx_Message_DLC; + + UdsService.PhyFlg = false; + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if ( (TP_Tx_Message_Status == WAITINGFORFLOWCONTROL) && + (FlowControlStatus == CLEAR_TO_SEND)) + { + TP_Tx_Message_Status = TP_TRANSMIT_START; + } + if ( (TP_Rx_Message_Status == TP_RECEIVE_START)) + { + TP_Task(); /* to receive cf's......*/ + } + + if (TP_Rx_Frame_Type == SINGLE_FRAME) + { + TP_Rx_Message_DLC = TP_Frame_Array[0] & + SINGLE_FRAME_DATA_LENGTH_MASK; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Rx_Message_DLC; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + } + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + TP_Request_Type = FUNCTIONAL_ADDRESS_TYPE; + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + } + } +}/* End of TP_D_UUData_Indication_Functional */ +#endif +/*! + * @brief TP_N_Change_Parameters_Request + * This API is called by user to change the parameter values of + * the parameters BlockSize and the Minimum SeparationTime + * + * @param Parameter Parameter + * @param ParameterValue Parameter Value + */ +void TP_N_Change_Parameters_Request (uint8_t Parameter, uint16_t ParameterValue) +{ + /* if it is in the multiframe receive mode, change is not permitted */ + if (TP_Rx_Message_Status != TP_RECEIVE_START) + { + switch (Parameter) + { + case N_BLOCKSIZE: + if ((ParameterValue <= 0xff)) + { +// TP_Rx_Block_Size_Parameter = (uint8_t) ParameterValue; + TP_Change_Parameter_Result = N_OK_R; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + else + { + TP_Change_Parameter_Result = N_WRONG_VALUE; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + + break; + + case N_SEPERATIONTIME: + if ((ParameterValue <= 0xff)) + { +// TP_Rx_Seperation_Time_Parameter = (uint8_t) ParameterValue; + TP_Change_Parameter_Result = N_OK_R; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + //Debug("TP_Rx_Seperation_Time_Parameter=%d",TP_Rx_Seperation_Time_Parameter); + } + else + { + TP_Change_Parameter_Result = N_WRONG_VALUE; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + + break; + + default: + TP_Change_Parameter_Result = N_WRONG_PARAMETER; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + break; + } + } + else + { + TP_Change_Parameter_Result = N_RX_ON; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } +}/* End of TP_N_Change_Parameters_Request */ +static uint8_t TP_STmin_Calculate (void) +{ + uint8_t TP_STmin_Result,TP_FC_STmin; + TP_FC_STmin = TP_Frame_Array[2]; + + if (TP_FC_STmin != 0) + { + if (TP_FC_STmin > 0x7F) + { + TP_FC_STmin = 0x7F; + } + + TP_STmin_Result = TP_FC_STmin / CALL_RATE_TP; + + TP_STmin_Result += 1; + + } + else + { + if (STmin_ZERO == CALL_RATE_TP) + { + TP_STmin_Result = 1; + } + else + { + TP_STmin_Result = 0; + } + } + + return (TP_STmin_Result); +}/*/TP_STmin_Calculate*/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_config.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_config.h new file mode 100644 index 0000000..6b76c13 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/tp_config.h @@ -0,0 +1,235 @@ +#ifndef TP_CONFIG_H +#define TP_CONFIG_H + +#include +#include +#include +#include "uds_config.h" +#include "uds_did.h" +#include "uds_dtc.h" +#include "uds_can_interface.h" +#include "diagnosis_mid.h" +#include "tp_15765_2.h" +#include "tp_config.h" +#include "uds_interface.h" +#include "uds_manage.h" +#include "uds_services.h" +#include "uds_types.h" + +/*! + * @file tp_config.h + * @brief TP layer file according to the 15765-2. + * + */ + +#include "uds_types.h" +// lbin_20190117 +#define CALL_RATE_TP 1 /*!< Call rate of the periodic task */ + +#define N_As_TIME_OUT 70 /*!< default value : max as per standard = 1000msec */ +#define N_Ar_TIME_OUT 70 /*!< default value : max as per standard = 1000msec */ +#define N_Bs_TIME_OUT 150 /*!< default value : max as per standard = 1000msec */ +#define N_Cr_TIME_OUT 150 /*!< default value : max as per standard = 1000msec */ + +#define N_As_TIMER_COUNT N_As_TIME_OUT/CALL_RATE_TP /*!< As TIMER COUNT*/ +#define N_Ar_TIMER_COUNT N_Ar_TIME_OUT/CALL_RATE_TP /*!< Ar TIMER COUNT */ +#define N_Bs_TIMER_COUNT N_Bs_TIME_OUT/CALL_RATE_TP /*!< Bs TIMER COUNT */ +#define N_Cr_TIMER_COUNT N_Cr_TIME_OUT/CALL_RATE_TP /*!< Cr TIMER COUNT */ + +#if (BOOTLOADER_CODE_FLAG == 0) +#define TP_RX_BLOCK_SIZE_MAX 0 /*!< default block size for receive. */ +#define TP_RX_SEPARATION_TIME_MIN 0 /*!< default STmin for receive. lbin */ +#else +#define TP_RX_BLOCK_SIZE_MAX 0 /*!< default block size for receive. */ +#define TP_RX_SEPARATION_TIME_MIN 0 /*!< default STmin for receive. lbin */ +#endif + + + +#define TP_BUFFER_SIZE 2050//255 /*!< TP buffer(common for both Rx & RX) size */ +#define FRAME_DATA_SIZE 8 /*!< Frame buffer size */ + +/*! + * Macro. Wait frame Transmit support: if 0 no wait frame tx supported + * otherwise configure max wait frame tx count + */ +#define N_WAIT_FRAME_TX_MAX 0 +/*! + * Macro. If the Padding is required select as 'TRUE'. Otherwise 'FALSE' + */ +#define PADDING_OPERATION true +/*! + * Macro. Default selected as -xaa; change it to required value + */ +#define PADDING_BYTE 0x00 +/* maximum dlc value for one CAN frame */ + +/* #define RX_MULTI_BUFFER_SUPPORT */ + +#define STmin_ZERO CALL_RATE_TP + +#define TP_DIAG_PHYSICAL_MSG_SUPPORT +#define TP_DIAG_FUNCTIONAL_MSG_SUPPORT + +/*! + * Macro. Max number of bytes + */ + +#define NW_DLC_MAX_BYTES 8 +/*! + * Macro. number of bytes to represent N_PCI in a sinlge frame + */ +#define SINGLE_FRAME_N_PCI_BYTE 1 +/*! + * Macro. maximum number of data bytes in a single frame + */ +#define MAXIMUM_SINGLE_FRAME_DATA_BYTE 7 +/*! + * Macro. Two N_PCI + six data bytes in a first frame + */ +#define FIRST_FRAME_N_PCI_PLUS_DATA_BYTE 8 +/*! + * Macro. maximum number of data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_N_PCI_BYTE 1 +/*! + * Macro. data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_DATA_BYTE 7 +/*! + * Macro. One N_PCI + seven data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_N_PCI_PLUS_DATA_BYTE 8 +/*! + * Macro. Three N_PCI bytes in a flow control frame + */ +#define FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE 3 +/*! + * Enum Type. PCI Type + */ +typedef enum TPN_PCI_Type_Tag +{ + SINGLE_FRAME = 0x00, /*!< N_PCI type for single frame */ + FIRST_FRAME = 0x10, /*!< N_PCI type for first frame */ + CONSECUTIVE_FRAME = 0x20, /*!< N_PCI type for consecutive frame */ + FLOW_CONTROL_FRAME = 0x30 /*!< N_PCI type for flow control frame */ +}TPN_PCI_Type_T; +/*! + * Enum Type. TP Request Tpye + */ +typedef enum TPRequestTpye_Tag +{ + PHYSICAL_ADDRESS_TYPE = 0, /*!< PHYSICAL ADDRESS TYPE */ + FUNCTIONAL_ADDRESS_TYPE /*!< FUNCTIONAL ADDRESS TYPE */ +}TPRequestTpye_T; +/*! + * Enum Type. TP Result Tpye + */ +typedef enum TPResult_Tag +{ + N_OK = 0, /*!< Result OK */ + N_TIMEOUT_A, /*!< Timeout A */ + N_TIMEOUTBs, /*!< Timeout Bs */ + N_TIMEOUTCr, /*!< Timeout Cr */ + N_WRONG_SN, /*!< Wrong SN */ + N_INVALID_FS, /*!< Invaild FS */ + N_UNEXP_PDU, /*!< Unexpected PDU */ + N_WFT_OVRN, /*!< WFT Overrun */ + N_BUFFER_OVFLW, /*!< Buffer Overflow */ + N_WRONG_DLC, /*!< Wrong DLC */ + N_ERROR, /*!< ERROR */ + TP_BUFFER_OVER_FLOW, /*!< TP Buffer Overflow */ + TP_BUFFER_NOT_FILLED, /*!< TP BUFFER not filled */ + TP_RX_LENGTH_INVALID /*!< TP Invalid RX Length */ + } TPResult_T; +extern bool TpRxFlg; + +extern uint16_t TP_Rx_Message_Length; /*!< Receive Message Length */ +extern uint16_t TP_Rx_Index; +extern uint8_t TP_Buffer[TP_BUFFER_SIZE]; /*!< TP Buffer */ +extern void TP_Init( void ); +extern void TP_Periodic_Task( void ); +extern void TP_Transmit_Buffer_Filled(void); +extern void TP_Receive_Buffer_Read(void); +extern uint16_t TP_Get_Message_Buffer_Size(void); +extern uint8_t * TP_Get_Message_Buffer_Pointer(void); +extern uint8_t TP_Get_Request_Type(void); +extern void TP_N_USData_Request(uint16_t TPTransmitMessageLength); +extern void TP_N_Change_Parameters_Request(uint8_t Parameter, + uint16_t ParameterValue); +uint8_t *TP_Get_Tx_Message_Buffer_Pointer (void); + +extern void TP_D_UUData_Confirm(void); +extern void TP_D_UUData_Indication_Physical(void); +extern void TP_D_UUData_Indication_Functional(void); + +#define UCB_TP_Transmit_Buffer_Empty HAL_UDS_Transmit_Buffer_Empty +#ifdef RX_MULTI_BUFFER_SUPPORT +#define UCB_TP_Receive_Buffer_Filled DG_TP_Receive_Buffer_Filled +#endif +#define UCB_TP_N_USData_Confirm HAL_UDS_Response_Confirm +#define UCB_TP_N_USData_FF_Indication HAL_UDS_FF_Indication +#define UCB_TP_N_USData_Indication HAL_UDS_Indication +#define UCB_TP_N_Change_Parameter_Confirm HAL_UDS_Change_Parameter_Confirm +#define UCB_TP_N_USData_FF_Confirmation HAL_UDS_FF_Confirmation + + +extern void UCB_TP_Transmit_Buffer_Empty(void); +#ifdef RX_MULTI_BUFFER_SUPPORT +extern void UCB_TP_Receive_Buffer_Filled(void); +#endif +extern void UCB_TP_N_USData_Confirm(uint8_t N_Result); +extern void UCB_TP_N_USData_FF_Indication(uint16_t + TPReceivexMessageLength); +extern void UCB_TP_N_USData_Indication(uint16_t TPReceivexMessageLength, + uint8_t N_Result); +extern void UCB_TP_N_Change_Parameter_Confirm(uint8_t Parameter, + uint8_t ParameterChangeResult); +extern void UCB_TP_N_USData_FF_Confirmation(void); +void TP_Task(void); + +#endif +/*============================================================================*/ +/* CAN : Controller Area Network */ +/* DLC : Data Length Code (number of data bytes in a CAN message) */ +/* ID : Identifier */ +/* BS : Block Size */ +/* CF : Consecutive frame */ +/* confirm : Confirmation service primitive */ +/* ECU : Electronic Control Unit - generic term for any electronic control */ +/* unit */ +/* FC : Flow Control */ +/* FF : First frame */ +/* FF_DL : First frame data length */ +/* FS : Flow Status */ +/*indication : Indication service primitive */ +/* Mtype : Message Type */ +/*N : Network */ +/* N_AE : Network Address Extension */ +/* N_AI : Address Information */ +/* N_Ar : Network layer timing parameter Ar */ +/* N_As : Network layer timing parameter As */ +/* N_Br : Network layer timing parameter Br */ +/* N_Bs : Network layer timing parameter Bs */ +/* N_ChangeParameter : Network layer service name */ +/* N_Cr : Network layer timing parameter Cr */ +/* N_Cs : Network layer timing parameter Cs */ +/* N_Data : Network Data */ +/* N_PCI : Network Protocol Control Information */ +/* N_PCItype : Network Protocol Control Information Type */ +/* N_PDU : Network Protocol Data Unit */ +/* N_USData : Network layer Unacknowledged Segmented Data transfer service */ +/* name */ +/* NWL : Network Layer */ +/* request : Request service primitive */ +/* SF : Single frame */ +/* SF_DL : Single frame data length */ +/* SN : Sequence Number */ +/* STmin : Separation Time min. */ +/* N_As : Time for transmission of the CAN frame(anu N_PDU) on the sender side*/ +/* N_Ar : Time for transmission of the CAN frame(anu N_PDU) on the receiver */ +/*side */ +/* N_Bs : Time until reception of the next flow control N_PDU */ +/* N_Cr : Time until reception of the next consecutive frame N_PDU */ +/*============================================================================*/ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.c new file mode 100644 index 0000000..1297156 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.h new file mode 100644 index 0000000..b80b703 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_api.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.c new file mode 100644 index 0000000..be0162c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.h new file mode 100644 index 0000000..432b558 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_can_interface.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_config.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_config.h new file mode 100644 index 0000000..1d7c557 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_config.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.c new file mode 100644 index 0000000..be94475 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.c @@ -0,0 +1,68 @@ +#include "uds_did.h" +#include + +const uint16_t DIDOffset[] = { + DID_FOREACH(GENERATE_DID_OFFSETS) +}; + +const uint8_t DIDSize[] = { + DID_FOREACH(GENERATE_DID_SIZE) +}; + +const uint16_t DIDId[] = { + DID_FOREACH(GENERATE_DID_ID) +}; + +const uint8_t DIDIsStoreInFlashTable[] = { + DID_FOREACH(GENERATE_DID_STORE_FLAG) +}; + +const uint16_t DIDStoreInFlashOffset[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_OFFSETS) +}; + +const uint16_t DIDStoreInFlashSize[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_SIZE) +}; + +const uint16_t DIDStoreInFlashId[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_ID) +}; + + +uint8_t GetDIDIndexByID(uint16_t id) +{ + uint8_t ret = 0xFF; + uint8_t i; + + for( i = 0; i < sizeof(DIDId)/sizeof(uint16_t); i++) + { + if (DIDId[i] == id) + { + ret = i; + break; + } + } + + return ret; +} + + +uint8_t GetDIDStoreInFlashIndexByID(uint16_t id) +{ + uint8_t ret = 0xFF; + uint8_t i; + + for( i = 0; i < sizeof(DIDStoreInFlashId)/sizeof(uint16_t); i++) + { + if (DIDStoreInFlashId[i] == id) + { + ret = i; + break; + } + } + + return ret; +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.h new file mode 100644 index 0000000..b3c1f63 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_did.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_dtc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_dtc.h new file mode 100644 index 0000000..e2f0cfe Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_dtc.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.c new file mode 100644 index 0000000..2fd31f2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.h new file mode 100644 index 0000000..4808d6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_interface.h @@ -0,0 +1,216 @@ +/*! + * @file uds_interface.h + * @brief customized service sequence definition. Modify the file according to the requirements. + * + */ + + +#ifndef UDS_INTERFACE_H +#define UDS_INTERFACE_H + +#include "uds_types.h" + + + +#if BOOTLOADER_CODE_FLAG == 0 +#define UDS_SERVICE_FOREACH(func)\ +/*00*/ func(0x10,UDS_10_Service_Session_Control,0)\ +/*01*/ func(0x11,UDS_11_Service_Ecu_Reset,0)\ +/*02*/ func(0x14,UDS_14_Service_Clear_DTC,0)\ +/*03*/ func(0x19,UDS_19_Service_Read_DTC,0) \ +/*04*/ func(0x22,UDS_22_Service_Read_Data,0)\ +/*05*/ func(0x2E,UDS_2E_Service_Write_Data,1) \ +/*06*/ func(0x27,UDS_27_Service_Security_Access,0) \ +/*07*/ func(0x3E,UDS_3E_Service_Tester_Present,0) \ +/*08*/ func(0x31,UDS_31_Service_Routine_Ctrl,0) \ +/*09*/ func(0x28,UDS_28_Service_Communication_Control,0) \ +/*10*/ func(0x85,UDS_85_Service_Control_DTC,0) \ +/*12*/ func(0x7F,UDS_Service_NRC,0) + +#else +#define UDS_SERVICE_FOREACH(func)\ +/*00*/ func(0x10,UDS_10_Service_Session_Control,0)\ +/*01*/ func(0x11,UDS_11_Service_Ecu_Reset,0)\ +/*02*/ func(0x22,UDS_22_Service_Read_Data,0)\ +/*03*/ func(0x2E,UDS_2E_Service_Write_Data,1) \ +/*04*/ func(0x27,UDS_27_Service_Security_Access,0) \ +/*05*/ func(0x3E,UDS_3E_Service_Tester_Present,0) \ +/*06*/ func(0x31,UDS_31_Service_Routine_Ctrl,0) \ +/*07*/ func(0x28,UDS_28_Service_Communication_Control,0) \ +/*08*/ func(0x85,UDS_85_Service_Control_DTC,0) \ +/*09*/ func(0x34,UDS_34_Service_Request_Download,1) \ +/*10*/ func(0x36,UDS_36_Service_Transfer_Data,1) \ +/*11*/ func(0x37,UDS_37_Service_Transfer_Exit,0) \ +/*12*/ func(0x7F,UDS_Service_NRC,0) + + +#endif + +#define GENERATE_UDS_SERVICE_INDEX(sid,service,rx_end_flag) Index_Sid_##sid, +#define GENERATE_UDS_SERVICE_TABLE(sid,service,rx_end_flag) service, +#define GENERATE_UDS_SERVICE_ID(sid,name,rx_end_flag) sid , + + +typedef enum _UDS_SERVICE_INDEX { + UDS_SERVICE_FOREACH(GENERATE_UDS_SERVICE_INDEX) + UDS_SERVICE_NUM, +}UDS_SERVICE_INDEX; + + +typedef enum{ + _UDS_DEFAULT_SESSION=0x01, + _UDS_PROGRAM_SESSION=0x02, + _UDS_EXT_SESSION=0x03, +// _UDS_STD_DIAG_SESSION=0x81, +// _UDS_PRO_DIAG_SESSION=0x85, +// _UDS_EXT_DIAG_SESSION=0x90, +}UDS_SESSION; + +typedef enum { + DOWNLOAD_SEQUENCE_IDLE, + DOWNLOAD_SEQUENCE_34, + DOWNLOAD_SEQUENCE_36, + DOWNLOAD_SEQUENCE_37, +}DownloadSequenceType; + +#define UDS_UP_LEN (FMC_PAGE_SIZE) + +typedef struct +{ + bool start; /*!< Sequence start state */ + uint8_t index; /*!< Sequence index to be serviced */ +}UDS_Demo_Service_Ctrl_T; + +typedef struct{ + bool RxEraseFlg; + bool RxProgramFlag; + bool UpCompFlg; + bool UpChkProgIntegFlg; + bool UpModleFlg; + bool EraseMemoryFlg; + //bool SecureFlg; + //bool SecureSw; + uint8_t EraseMemorySts; + uint32_t OffSetAdd; + uint32_t EraseAddress; + uint32_t EraseLength; + uint16_t GetCrc; + uint16_t CalcCrc; + uint32_t dLen; + uint32_t StackTopAdr; + uint32_t checksum; +#if BOOTLOADER_CODE_FLAG + uint8_t Buf[UDS_UP_LEN]; +#endif + + bool RoutineEraseMemoryFlg; + bool RoutineChkProgIntegrityFlg; + bool RoutineChkProgIntegrityPass; + bool PrintFingerFlg; + bool RoutineEraseMemoryErr; + //uint16_t FlashDriverDlength; + uint8_t Sn; + uint32_t totalRecvLength; + DownloadSequenceType DownloadSeq; +}_UdsUpData; + +typedef struct{ + bool ResetMcuFlg; + bool UdsTxFlg; + bool UdsTxCompFlg; + bool KeyLockFlg; + bool PhyFlg; + bool TxCompFlg; + bool AlreadSendSeed; + bool StartFlg; + bool IsUdsFlg; + bool BattErrFlg; + bool HsCanErrFlg; + bool TypeVech; + bool UpDataFlg; + bool CanRxOkFlg; + bool BusOffNoSendFlg; + bool ChkProgPreconditionFlg; + bool Sid2FWaitResFlg; + uint8_t IOCP; + uint16_t IOCS; + uint8_t SwErrCnt; + uint8_t VersionMod; + uint8_t CheckDtc5S; + uint8_t DtcFlg; + uint8_t DtcErr; + uint8_t FrameType; + uint8_t RequestFlg; + uint8_t SessionDiagModel; + uint8_t RxSessionDiagModel; + uint8_t Id; + uint8_t RstTimer; + uint8_t MultFrameComp; + uint8_t SeedKeyIsOK; + uint8_t SeedKeyLevel; + uint8_t NcmDisRxAndTx; + uint8_t NmcmDisRxAndTx; + uint8_t EnRxAndTx0x29; + uint8_t DisDTCRecord; + uint8_t KeyErrCnt; + uint8_t KeyErrLockTimer; + uint8_t TxUdsChann; + uint8_t ReqCmdBuf[20]; + uint16_t SessionTimer;//ĬϻỰ£ʱתһʱصĬϻỰ + uint16_t RxDlc; + uint16_t RxMulDlc; + uint16_t TxTimerOut; + uint16_t RxBlockCnt; + uint16_t SwImageErrTimer; + uint16_t BusOffNoSendTimer; + uint16_t CanID; + uint16_t IoDid; + uint16_t Nrc78Timer; +}__UDSService; +extern uint8_t UDS_SeedKeyBuf[8]; +extern __UDSService UdsService; +extern _UdsUpData UdsUpData; +extern const uint8_t UDSsid[]; + +extern UDS_Demo_Service_Ctrl_T Service_Ctrl; +void GotoDefaultSession(void); +bool CheckIsBeyonSession(INT8U CurSession,INT8U SelfSession,INT8U Type); +bool CheckUdsDlcIsOk(INT16U RxDlc,INT16U rDlc); +bool CheckSubSidNeedPosResp(INT8U SubSID); +bool CheckIsKeyOk(void); +bool CanRxConStatus(void); +bool CheckIsSupportBootloaderRead_Sid22(uint16_t did); +bool CheckIsSupportSubFunc_Sid19(uint8_t sub); +bool CheckIsSupportSubFunc_Sid11(uint8_t sub); + + +/*! + * @brief Demo Service Function to start service sequencce + * This function is used to start service sequencce + */ +void UDS_Demo_Services_Start(void); +/*! + * @brief Demo Service Function to call the services in sequencce + * This function is used to call the services in sequencce + */ +void UDS_Demo_Services_Sequence(void); +/*! + * @brief Demo service function to calculate key according to seed. + * The function is used to calculate key according to seed. + * + * @param rsp_buf Response buf pointer + */ +void UDS_Demo_Calculate_Key(uint8_t* rsp_buf); +/*! + * @brief Demo Service Function for positive response callback + * This function is used for positive response callback + */ +void UDS_Pos_Response_Callback(void); +/*! + * @brief Demo Service Function for negtive response callback + * This function is used for negtive response callback + */ +void UDS_Neg_Response_Callback(void); + +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_manage.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_manage.c new file mode 100644 index 0000000..d38355e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_manage.c @@ -0,0 +1,312 @@ +/*! +* @file uds_manage.c +* @brief interaction layer between UDS service and TP layer. +* +*/ +#include "uds_config.h" + +static uint8_t HAL_UDS_Rx_Buffer[8]; /*!< UDS Receive Buffer */ +bool HAL_Response_Pocessing; /*!< UDS Response Processing */ +static uint8_t HAL_UDS_RECEIVE_LENGTH; /*!< UDS Receive Length */ +static uint8_t HAL_UDS_TRANSMIT_LENGTH; /*!< UDS Transmit Length */ +static uint32_t HAL_UDS_TRANSMIT_ID; /*!< UDS Transmit ID */ + +//extern flexcan_state_t canCom0_State[3]; +//flexcan_msgbuff_t recvBuff; +/*! + * @brief HAL_UDS_CallBack + * UDS Transmit and Receive interrupt callback + * + * @param instance instance + * @param eventType interrupt event type + * @param state flexCAN state + */ +/*! + * @brief HAL_UDS_Init + * Initialize function for CAN UDS + * + */ + +/*! + * @brief HAL_UDS_Rx_DLC + * Return the DLC of the Rx Msg + * + * @return the DLC of the Rx Msg + */ +uint8_t HAL_UDS_Rx_DLC(void) +{ + return HAL_UDS_RECEIVE_LENGTH; +} + +/*! + * @brief HAL_UDS_Get_Buf + * Copy the rx msg data from the temp buffer to appl_data_ptr + * + * @param appl_data_ptr pointer to the destination buffer + */ +void HAL_UDS_Get_Buf(uint8_t* appl_data_ptr) +{ + uint8_t index; + + for(index = 0;index (uint8_t*)NVM_ADDR_END) || (pImage < (uint8_t*)NVM_ADDR_STR)) { + return -1; + } + + if (pData) { + for (i = 0; i < Len; ++i) { + pImage[i] = pData[i]; + } + } + addr = pImage - (uint8_t *)&NvmImage + NVM_ADDRESS_START; + UdsApi_EE_WriteBytes(pImage, addr, Len); + return 0; +} + +int32_t uds_service_nvm_write(uint8_t *pImage, const uint8_t *pData, uint32_t Len, void (*pCbFn)(uint32_t)) +{ + int32_t result; + + result = nvm_write(pImage, pData, Len, pCbFn); + return result; +} + +void NVM_Init(void) +{ + UdsApi_EE_ReadBytes((uint8_t *)&NvmImage, NVM_ADDRESS_START, NVM_SIZE); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_nvm.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_nvm.h new file mode 100644 index 0000000..fa15b03 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_nvm.h @@ -0,0 +1,57 @@ +#ifndef _UDS_NVM_H +#define _UDS_NVM_H + +#include "sys.h" +#include "uds_did.h" +#include "uds_dtc.h" + + + +#define NVM_SIZE (512u) +#define NVM_ADDR_STR ((u32)&NvmImage) +#define NVM_ADDR_END (NVM_ADDR_STR+NVM_SIZE) + +#define SIZE_UDS (NVM_SIZE) +#define NVM_IMAGE_DTC_ADDR ((uint8_t*)&NvmImage.UDS.DTCs) +#define NVM_IMAGE_DID_ADDR ((uint8_t*)&NvmImage.UDS.DIDs) + +#define NVM_ADDRESS_START 0 + + +typedef struct { + DTC_StatusType DTC_Status; +}DTCS_NvmType; + +typedef union +{ + struct { + DIDS_NvmType DIDs; + DTCS_NvmType DTCs; + uint8_t reverse; + }; + uint8_t UDS_Data[SIZE_UDS]; + +}NvmData_UDS_t; + +typedef union +{ + u8 D8[NVM_SIZE]; + u32 D32[NVM_SIZE>>2]; + + struct + { + NvmData_UDS_t UDS; + }; + +}NvmImage_t; + + +extern NvmImage_t NvmImage; +#define pNvmImage ((NvmImage_t *)&NvmImage) + +void NVM_Init(void); +int32_t uds_service_nvm_write(u8 *pImage, const u8 *pData, u32 Len, void (*pCbFn)(u32)); + + +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.c new file mode 100644 index 0000000..2da2eed Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.h new file mode 100644 index 0000000..51e8bb3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_services.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_types.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_types.h new file mode 100644 index 0000000..e74e068 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/Driver/UDS/uds_types.h @@ -0,0 +1,94 @@ + /*! + * @file uds_types.h + * @brief user defined types for UDS + * + */ + +#ifndef UDS_TYPES_H_ +#define UDS_TYPES_H_ + + + +//typedef signed char int8_t; +//typedef unsigned char uint8_t; + +typedef volatile signed char vint8_t; +typedef volatile unsigned char vuint8_t; + +//typedef signed short int16_t; +//typedef unsigned short uint16_t; +typedef volatile signed short vint16_t; +typedef volatile unsigned short vuint16_t; + +//typedef signed int int32_t; +//typedef unsigned int uint32_t; +typedef volatile signed int vint32_t; +typedef volatile unsigned int vuint32_t; + +typedef unsigned char BOOLEAN; +typedef unsigned char INT8U; +typedef signed char INT8S; +typedef unsigned short INT16U; +typedef signed short INT16S; +typedef unsigned int INT32U; +typedef signed int INT32S; +typedef unsigned long INT64U; +typedef signed long INT64S; + + +typedef unsigned char U8; +#define U8_DISP U8 +#define U8_CAL volatile const U8 +#define U8_MIN (0U) +#define U8_MAX (255U) + +typedef signed char S8; +#define S8_DISP S8 +#define S8_CAL volatile const S8 +#define S8_MIN (-128) +#define S8_MAX (127) + +typedef unsigned short int U16; +#define U16_DISP U16 +#define U16_CAL volatile const U16 +#define U16_MIN (0U) +#define U16_MAX (65535U) + +typedef signed short int S16; +#define S16_DISP S16 +#define S16_CAL volatile const S16 +#define S16_MIN (-32768) +#define S16_MAX (32767) + +typedef unsigned long U32; +#define U32_DISP U32 +#define U32_CAL volatile const U32 +#define U32_MIN (0UL) +#define U32_MAX (4294967295UL) + +typedef signed long S32; +#define S32_DISP S32 +#define S32_CAL volatile const S32 +#define S32_MIN (-2147483648L) +#define S32_MAX (2147483647L) + +#if 0 +typedef enum BOOL_TYPE_ +{ + FALSE = 0, + TRUE +} BOOL_TYPE; +#endif +typedef U8 UINT8; +//typedef U8 BYTE; +typedef U16 UINT16; +typedef U16 WORD; +typedef U32 UINT32; +typedef S32 INT32; + +#define LSB(WORD) (uint8_t)WORD +#define MSB(WORD) (uint8_t)(WORD>>8) +#define WORD(MSB,LSB) (uint16_t)(((uint16_t) MSB << 8) + LSB) + + +#endif /* UDS_TYPES_H_ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_adc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_adc.h new file mode 100644 index 0000000..b039162 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_adc.h @@ -0,0 +1,364 @@ +/*! + \file gd32f10x_adc.h + \brief definitions for the ADC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10x_ADC_H +#define GD32F10x_ADC_H + +#include "gd32f10x.h" + +/* ADC definitions */ +#define ADC0 ADC_BASE +#define ADC1 (ADC_BASE + 0x400U) +#define ADC2 (ADC_BASE + 0x1800U) + +/* registers definitions */ +#define ADC_STAT(adcx) REG32((adcx) + 0x00U) /*!< ADC status register */ +#define ADC_CTL0(adcx) REG32((adcx) + 0x04U) /*!< ADC control register 0 */ +#define ADC_CTL1(adcx) REG32((adcx) + 0x08U) /*!< ADC control register 1 */ +#define ADC_SAMPT0(adcx) REG32((adcx) + 0x0CU) /*!< ADC sampling time register 0 */ +#define ADC_SAMPT1(adcx) REG32((adcx) + 0x10U) /*!< ADC sampling time register 1 */ +#define ADC_IOFF0(adcx) REG32((adcx) + 0x14U) /*!< ADC inserted channel data offset register 0 */ +#define ADC_IOFF1(adcx) REG32((adcx) + 0x18U) /*!< ADC inserted channel data offset register 1 */ +#define ADC_IOFF2(adcx) REG32((adcx) + 0x1CU) /*!< ADC inserted channel data offset register 2 */ +#define ADC_IOFF3(adcx) REG32((adcx) + 0x20U) /*!< ADC inserted channel data offset register 3 */ +#define ADC_WDHT(adcx) REG32((adcx) + 0x24U) /*!< ADC watchdog high threshold register */ +#define ADC_WDLT(adcx) REG32((adcx) + 0x28U) /*!< ADC watchdog low threshold register */ +#define ADC_RSQ0(adcx) REG32((adcx) + 0x2CU) /*!< ADC regular sequence register 0 */ +#define ADC_RSQ1(adcx) REG32((adcx) + 0x30U) /*!< ADC regular sequence register 1 */ +#define ADC_RSQ2(adcx) REG32((adcx) + 0x34U) /*!< ADC regular sequence register 2 */ +#define ADC_ISQ(adcx) REG32((adcx) + 0x38U) /*!< ADC inserted sequence register */ +#define ADC_IDATA0(adcx) REG32((adcx) + 0x3CU) /*!< ADC inserted data register 0 */ +#define ADC_IDATA1(adcx) REG32((adcx) + 0x40U) /*!< ADC inserted data register 1 */ +#define ADC_IDATA2(adcx) REG32((adcx) + 0x44U) /*!< ADC inserted data register 2 */ +#define ADC_IDATA3(adcx) REG32((adcx) + 0x48U) /*!< ADC inserted data register 3 */ +#define ADC_RDATA(adcx) REG32((adcx) + 0x4CU) /*!< ADC regular data register */ + +/* bits definitions */ +/* ADC_STAT */ +#define ADC_STAT_WDE BIT(0) /*!< analog watchdog event flag */ +#define ADC_STAT_EOC BIT(1) /*!< end of conversion */ +#define ADC_STAT_EOIC BIT(2) /*!< inserted channel end of conversion */ +#define ADC_STAT_STIC BIT(3) /*!< inserted channel start flag */ +#define ADC_STAT_STRC BIT(4) /*!< regular channel start flag */ + +/* ADC_CTL0 */ +#define ADC_CTL0_WDCHSEL BITS(0,4) /*!< analog watchdog channel select bits */ +#define ADC_CTL0_EOCIE BIT(5) /*!< interrupt enable for EOC */ +#define ADC_CTL0_WDEIE BIT(6) /*!< analog watchdog interrupt enable */ +#define ADC_CTL0_EOICIE BIT(7) /*!< interrupt enable for inserted channels */ +#define ADC_CTL0_SM BIT(8) /*!< scan mode */ +#define ADC_CTL0_WDSC BIT(9) /*!< when in scan mode, analog watchdog is effective on a single channel */ +#define ADC_CTL0_ICA BIT(10) /*!< automatic inserted group conversion */ +#define ADC_CTL0_DISRC BIT(11) /*!< discontinuous mode on regular channels */ +#define ADC_CTL0_DISIC BIT(12) /*!< discontinuous mode on inserted channels */ +#define ADC_CTL0_DISNUM BITS(13,15) /*!< discontinuous mode channel count */ +#define ADC_CTL0_SYNCM BITS(16,19) /*!< sync mode selection */ +#define ADC_CTL0_IWDEN BIT(22) /*!< analog watchdog enable on inserted channels */ +#define ADC_CTL0_RWDEN BIT(23) /*!< analog watchdog enable on regular channels */ +#define ADC_CTL0_DRES BITS(24,25) /*!< ADC data resolution */ + +/* ADC_CTL1 */ +#define ADC_CTL1_ADCON BIT(0) /*!< ADC converter on */ +#define ADC_CTL1_CTN BIT(1) /*!< continuous conversion */ +#define ADC_CTL1_CLB BIT(2) /*!< ADC calibration */ +#define ADC_CTL1_RSTCLB BIT(3) /*!< reset calibration */ +#define ADC_CTL1_DMA BIT(8) /*!< direct memory access mode */ +#define ADC_CTL1_DAL BIT(11) /*!< data alignment */ +#define ADC_CTL1_ETSIC BITS(12,14) /*!< external trigger select for inserted channel */ +#define ADC_CTL1_ETEIC BIT(15) /*!< external trigger enable for inserted channel */ +#define ADC_CTL1_ETSRC BITS(17,19) /*!< external trigger select for regular channel */ +#define ADC_CTL1_ETERC BIT(20) /*!< external trigger conversion mode for inserted channels */ +#define ADC_CTL1_SWICST BIT(21) /*!< start on inserted channel */ +#define ADC_CTL1_SWRCST BIT(22) /*!< start on regular channel */ +#define ADC_CTL1_TSVREN BIT(23) /*!< channel 16 and 17 enable of ADC0 */ + +/* ADC_SAMPTx x=0..1 */ +#define ADC_SAMPTX_SPTN BITS(0,2) /*!< channel n sample time selection */ + +/* ADC_IOFFx x=0..3 */ +#define ADC_IOFFX_IOFF BITS(0,11) /*!< data offset for inserted channel x */ + +/* ADC_WDHT */ +#define ADC_WDHT_WDHT BITS(0,11) /*!< analog watchdog high threshold */ + +/* ADC_WDLT */ +#define ADC_WDLT_WDLT BITS(0,11) /*!< analog watchdog low threshold */ + +/* ADC_RSQx x=0..2 */ +#define ADC_RSQX_RSQN BITS(0,4) /*!< nth conversion in regular sequence */ +#define ADC_RSQ0_RL BITS(20,23) /*!< regular channel sequence length */ + +/* ADC_ISQ */ +#define ADC_ISQ_ISQN BITS(0,4) /*!< nth conversion in inserted sequence */ +#define ADC_ISQ_IL BITS(20,21) /*!< inserted sequence length */ + +/* ADC_IDATAx x=0..3*/ +#define ADC_IDATAX_IDATAN BITS(0,15) /*!< inserted data n */ + +/* ADC_RDATA */ +#define ADC_RDATA_RDATA BITS(0,15) /*!< regular data */ +#define ADC_RDATA_ADC1RDTR BITS(16,31) /*!< ADC1 regular channel data */ + +/* constants definitions */ +/* adc_stat register value */ +#define ADC_FLAG_WDE ADC_STAT_WDE /*!< analog watchdog event flag */ +#define ADC_FLAG_EOC ADC_STAT_EOC /*!< end of conversion */ +#define ADC_FLAG_EOIC ADC_STAT_EOIC /*!< inserted channel end of conversion */ +#define ADC_FLAG_STIC ADC_STAT_STIC /*!< inserted channel start flag */ +#define ADC_FLAG_STRC ADC_STAT_STRC /*!< regular channel start flag */ + +/* adc_ctl0 register value */ +#define CTL0_DISNUM(regval) (BITS(13,15) & ((uint32_t)(regval) << 13)) /*!< write value to ADC_CTL0_DISNUM bit field */ + +/* scan mode */ +#define ADC_SCAN_MODE ADC_CTL0_SM /*!< scan mode */ + +/* inserted channel group convert automatically */ +#define ADC_INSERTED_CHANNEL_AUTO ADC_CTL0_ICA /*!< inserted channel group convert automatically */ + +/* ADC sync mode */ +#define CTL0_SYNCM(regval) (BITS(16,19) & ((uint32_t)(regval) << 16)) /*!< write value to ADC_CTL0_SYNCM bit field */ +#define ADC_MODE_FREE CTL0_SYNCM(0) /*!< all the ADCs work independently */ +#define ADC_DAUL_REGULAL_PARALLEL_INSERTED_PARALLEL CTL0_SYNCM(1) /*!< ADC0 and ADC1 work in combined regular parallel + inserted parallel mode */ +#define ADC_DAUL_REGULAL_PARALLEL_INSERTED_ROTATION CTL0_SYNCM(2) /*!< ADC0 and ADC1 work in combined regular parallel + trigger rotation mode */ +#define ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_FAST CTL0_SYNCM(3) /*!< ADC0 and ADC1 work in combined inserted parallel + follow-up fast mode */ +#define ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_SLOW CTL0_SYNCM(4) /*!< ADC0 and ADC1 work in combined inserted parallel + follow-up slow mode */ +#define ADC_DAUL_INSERTED_PARALLEL CTL0_SYNCM(5) /*!< ADC0 and ADC1 work in inserted parallel mode only */ +#define ADC_DAUL_REGULAL_PARALLEL CTL0_SYNCM(6) /*!< ADC0 and ADC1 work in regular parallel mode only */ +#define ADC_DAUL_REGULAL_FOLLOWUP_FAST CTL0_SYNCM(7) /*!< ADC0 and ADC1 work in follow-up fast mode only */ +#define ADC_DAUL_REGULAL_FOLLOWUP_SLOW CTL0_SYNCM(8) /*!< ADC0 and ADC1 work in follow-up slow mode only */ +#define ADC_DAUL_INSERTED_TRIGGER_ROTATION CTL0_SYNCM(9) /*!< ADC0 and ADC1 work in trigger rotation mode only */ + +/* adc_ctl1 register value */ +#define ADC_DATAALIGN_RIGHT ((uint32_t)0x00000000U) /*!< LSB alignment */ +#define ADC_DATAALIGN_LEFT ADC_CTL1_DAL /*!< MSB alignment */ + +/* continuous mode */ +#define ADC_CONTINUOUS_MODE ADC_CTL1_CTN /*!< continuous mode */ + +/* external trigger select for regular channel */ +#define CTL1_ETSRC(regval) (BITS(17,19) & ((uint32_t)(regval) << 17)) /*!< write value to ADC_CTL1_ETSRC bit field */ +/* for ADC0 and ADC1 regular channel */ +#define ADC0_1_EXTTRIG_REGULAR_T0_CH0 CTL1_ETSRC(0) /*!< TIMER0 CH0 event select */ +#define ADC0_1_EXTTRIG_REGULAR_T0_CH1 CTL1_ETSRC(1) /*!< TIMER0 CH1 event select */ +#define ADC0_1_EXTTRIG_REGULAR_T0_CH2 CTL1_ETSRC(2) /*!< TIMER0 CH2 event select */ +#define ADC0_1_EXTTRIG_REGULAR_T1_CH1 CTL1_ETSRC(3) /*!< TIMER1 CH1 event select */ +#define ADC0_1_EXTTRIG_REGULAR_T2_TRGO CTL1_ETSRC(4) /*!< TIMER2 TRGO event select */ +#define ADC0_1_EXTTRIG_REGULAR_T3_CH3 CTL1_ETSRC(5) /*!< TIMER3 CH3 event select */ +#define ADC0_1_EXTTRIG_REGULAR_T7_TRGO CTL1_ETSRC(6) /*!< TIMER7 TRGO event select */ +#define ADC0_1_EXTTRIG_REGULAR_EXTI_11 CTL1_ETSRC(6) /*!< external interrupt line 11 */ +#define ADC0_1_2_EXTTRIG_REGULAR_NONE CTL1_ETSRC(7) /*!< software trigger */ +/* for ADC2 regular channel */ +#define ADC2_EXTTRIG_REGULAR_T2_CH0 CTL1_ETSRC(0) /*!< TIMER2 CH0 event select */ +#define ADC2_EXTTRIG_REGULAR_T1_CH2 CTL1_ETSRC(1) /*!< TIMER1 CH2 event select */ +#define ADC2_EXTTRIG_REGULAR_T0_CH2 CTL1_ETSRC(2) /*!< TIMER0 CH2 event select */ +#define ADC2_EXTTRIG_REGULAR_T7_CH0 CTL1_ETSRC(3) /*!< TIMER7 CH0 event select */ +#define ADC2_EXTTRIG_REGULAR_T7_TRGO CTL1_ETSRC(4) /*!< TIMER7 TRGO event select */ +#define ADC2_EXTTRIG_REGULAR_T4_CH0 CTL1_ETSRC(5) /*!< TIMER4 CH0 event select */ +#define ADC2_EXTTRIG_REGULAR_T4_CH2 CTL1_ETSRC(6) /*!< TIMER4 CH2 event select */ + +/* external trigger mode for inserted channel */ +#define CTL1_ETSIC(regval) (BITS(12,14) & ((uint32_t)(regval) << 12)) /*!< write value to ADC_CTL1_ETSIC bit field */ +/* for ADC0 and ADC1 inserted channel */ +#define ADC0_1_EXTTRIG_INSERTED_T0_TRGO CTL1_ETSIC(0) /*!< TIMER0 TRGO event select */ +#define ADC0_1_EXTTRIG_INSERTED_T0_CH3 CTL1_ETSIC(1) /*!< TIMER0 CH3 event select */ +#define ADC0_1_EXTTRIG_INSERTED_T1_TRGO CTL1_ETSIC(2) /*!< TIMER1 TRGO event select */ +#define ADC0_1_EXTTRIG_INSERTED_T1_CH0 CTL1_ETSIC(3) /*!< TIMER1 CH0 event select */ +#define ADC0_1_EXTTRIG_INSERTED_T2_CH3 CTL1_ETSIC(4) /*!< TIMER2 CH3 event select */ +#define ADC0_1_EXTTRIG_INSERTED_T3_TRGO CTL1_ETSIC(5) /*!< TIMER3 TRGO event select */ +#define ADC0_1_EXTTRIG_INSERTED_EXTI_15 CTL1_ETSIC(6) /*!< external interrupt line 15 */ +#define ADC0_1_EXTTRIG_INSERTED_T7_CH3 CTL1_ETSIC(6) /*!< TIMER7 CH3 event select */ +#define ADC0_1_2_EXTTRIG_INSERTED_NONE CTL1_ETSIC(7) /*!< software trigger */ +/* for ADC2 inserted channel */ +#define ADC2_EXTTRIG_INSERTED_T0_TRGO CTL1_ETSIC(0) /*!< TIMER0 TRGO event select */ +#define ADC2_EXTTRIG_INSERTED_T0_CH3 CTL1_ETSIC(1) /*!< TIMER0 CH3 event select */ +#define ADC2_EXTTRIG_INSERTED_T3_CH2 CTL1_ETSIC(2) /*!< TIMER3 CH2 event select */ +#define ADC2_EXTTRIG_INSERTED_T7_CH1 CTL1_ETSIC(3) /*!< TIMER7 CH1 event select */ +#define ADC2_EXTTRIG_INSERTED_T7_CH3 CTL1_ETSIC(4) /*!< TIMER7 CH3 event select */ +#define ADC2_EXTTRIG_INSERTED_T4_TRGO CTL1_ETSIC(5) /*!< TIMER4 TRGO event select */ +#define ADC2_EXTTRIG_INSERTED_T4_CH3 CTL1_ETSIC(6) /*!< TIMER4 CH3 event select */ + +/* adc_samptx register value */ +#define SAMPTX_SPT(regval) (BITS(0,2) & ((uint32_t)(regval) << 0)) /*!< write value to ADC_SAMPTX_SPT bit field */ +#define ADC_SAMPLETIME_1POINT5 SAMPTX_SPT(0) /*!< 1.5 sampling cycles */ +#define ADC_SAMPLETIME_7POINT5 SAMPTX_SPT(1) /*!< 7.5 sampling cycles */ +#define ADC_SAMPLETIME_13POINT5 SAMPTX_SPT(2) /*!< 13.5 sampling cycles */ +#define ADC_SAMPLETIME_28POINT5 SAMPTX_SPT(3) /*!< 28.5 sampling cycles */ +#define ADC_SAMPLETIME_41POINT5 SAMPTX_SPT(4) /*!< 41.5 sampling cycles */ +#define ADC_SAMPLETIME_55POINT5 SAMPTX_SPT(5) /*!< 55.5 sampling cycles */ +#define ADC_SAMPLETIME_71POINT5 SAMPTX_SPT(6) /*!< 71.5 sampling cycles */ +#define ADC_SAMPLETIME_239POINT5 SAMPTX_SPT(7) /*!< 239.5 sampling cycles */ + +/* adc_ioffx register value */ +#define IOFFX_IOFF(regval) (BITS(0,11) & ((uint32_t)(regval) << 0)) /*!< write value to ADC_IOFFX_IOFF bit field */ + +/* adc_wdht register value */ +#define WDHT_WDHT(regval) (BITS(0,11) & ((uint32_t)(regval) << 0)) /*!< write value to ADC_WDHT_WDHT bit field */ + +/* adc_wdlt register value */ +#define WDLT_WDLT(regval) (BITS(0,11) & ((uint32_t)(regval) << 0)) /*!< write value to ADC_WDLT_WDLT bit field */ + +/* adc_rsqx register value */ +#define RSQ0_RL(regval) (BITS(20,23) & ((uint32_t)(regval) << 20)) /*!< write value to ADC_RSQ0_RL bit field */ + +/* adc_isq register value */ +#define ISQ_IL(regval) (BITS(20,21) & ((uint32_t)(regval) << 20)) /*!< write value to ADC_ISQ_IL bit field */ + +/* ADC channel group definitions */ +#define ADC_REGULAR_CHANNEL ((uint8_t)0x01U) /*!< adc regular channel group */ +#define ADC_INSERTED_CHANNEL ((uint8_t)0x02U) /*!< adc inserted channel group */ +#define ADC_REGULAR_INSERTED_CHANNEL ((uint8_t)0x03U) /*!< both regular and inserted channel group */ + +#define ADC_CHANNEL_DISCON_DISABLE ((uint8_t)0x04U) /*!< disable discontinuous mode of regular & inserted channel */ + +/* ADC inserted channel definitions */ +#define ADC_INSERTED_CHANNEL_0 ((uint8_t)0x00U) /*!< adc inserted channel 0 */ +#define ADC_INSERTED_CHANNEL_1 ((uint8_t)0x01U) /*!< adc inserted channel 1 */ +#define ADC_INSERTED_CHANNEL_2 ((uint8_t)0x02U) /*!< adc inserted channel 2 */ +#define ADC_INSERTED_CHANNEL_3 ((uint8_t)0x03U) /*!< adc inserted channel 3 */ + +/* ADC channel definitions */ +#define ADC_CHANNEL_0 ((uint8_t)0x00U) /*!< ADC channel 0 */ +#define ADC_CHANNEL_1 ((uint8_t)0x01U) /*!< ADC channel 1 */ +#define ADC_CHANNEL_2 ((uint8_t)0x02U) /*!< ADC channel 2 */ +#define ADC_CHANNEL_3 ((uint8_t)0x03U) /*!< ADC channel 3 */ +#define ADC_CHANNEL_4 ((uint8_t)0x04U) /*!< ADC channel 4 */ +#define ADC_CHANNEL_5 ((uint8_t)0x05U) /*!< ADC channel 5 */ +#define ADC_CHANNEL_6 ((uint8_t)0x06U) /*!< ADC channel 6 */ +#define ADC_CHANNEL_7 ((uint8_t)0x07U) /*!< ADC channel 7 */ +#define ADC_CHANNEL_8 ((uint8_t)0x08U) /*!< ADC channel 8 */ +#define ADC_CHANNEL_9 ((uint8_t)0x09U) /*!< ADC channel 9 */ +#define ADC_CHANNEL_10 ((uint8_t)0x0AU) /*!< ADC channel 10 */ +#define ADC_CHANNEL_11 ((uint8_t)0x0BU) /*!< ADC channel 11 */ +#define ADC_CHANNEL_12 ((uint8_t)0x0CU) /*!< ADC channel 12 */ +#define ADC_CHANNEL_13 ((uint8_t)0x0DU) /*!< ADC channel 13 */ +#define ADC_CHANNEL_14 ((uint8_t)0x0EU) /*!< ADC channel 14 */ +#define ADC_CHANNEL_15 ((uint8_t)0x0FU) /*!< ADC channel 15 */ +#define ADC_CHANNEL_16 ((uint8_t)0x10U) /*!< ADC channel 16 */ +#define ADC_CHANNEL_17 ((uint8_t)0x11U) /*!< ADC channel 17 */ + +/* ADC interrupt */ +#define ADC_INT_WDE ADC_STAT_WDE /*!< analog watchdog event interrupt */ +#define ADC_INT_EOC ADC_STAT_EOC /*!< end of group conversion interrupt */ +#define ADC_INT_EOIC ADC_STAT_EOIC /*!< end of inserted group conversion interrupt */ + +/* ADC interrupt flag */ +#define ADC_INT_FLAG_WDE ADC_STAT_WDE /*!< analog watchdog event interrupt flag */ +#define ADC_INT_FLAG_EOC ADC_STAT_EOC /*!< end of group conversion interrupt flag */ +#define ADC_INT_FLAG_EOIC ADC_STAT_EOIC /*!< end of inserted group conversion interrupt flag */ + +/* function declarations */ +/* initialization config */ +/* reset ADC */ +void adc_deinit(uint32_t adc_periph); +/* configure the ADC sync mode */ +void adc_mode_config(uint32_t mode); +/* enable or disable ADC special function */ +void adc_special_function_config(uint32_t adc_periph, uint32_t function, ControlStatus newvalue); +/* configure ADC data alignment */ +void adc_data_alignment_config(uint32_t adc_periph, uint32_t data_alignment); +/* enable ADC interface */ +void adc_enable(uint32_t adc_periph); +/* disable ADC interface */ +void adc_disable(uint32_t adc_periph); +/* ADC calibration and reset calibration(GD32F10x_MD series without this function) */ +void adc_calibration_enable(uint32_t adc_periph); +/* enable the temperature sensor and Vrefint channel */ +void adc_tempsensor_vrefint_enable(void); +/* disable the temperature sensor and Vrefint channel */ +void adc_tempsensor_vrefint_disable(void); + +/* DMA config */ +/* enable DMA request */ +void adc_dma_mode_enable(uint32_t adc_periph); +/* disable DMA request */ +void adc_dma_mode_disable(uint32_t adc_periph); + +/* regular group and inserted group config */ +/* configure ADC discontinuous mode */ +void adc_discontinuous_mode_config(uint32_t adc_periph, uint8_t adc_channel_group, uint8_t length); + +/* configure the length of regular channel group or inserted channel group */ +void adc_channel_length_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t length); +/* configure ADC regular channel */ +void adc_regular_channel_config(uint32_t adc_periph, uint8_t rank, uint8_t adc_channel, uint32_t sample_time); +/* configure ADC inserted channel */ +void adc_inserted_channel_config(uint32_t adc_periph, uint8_t rank, uint8_t adc_channel, uint32_t sample_time); +/* configure ADC inserted channel offset */ +void adc_inserted_channel_offset_config(uint32_t adc_periph, uint8_t inserted_channel, uint16_t offset); + +/* configure ADC external trigger source */ +void adc_external_trigger_source_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t external_trigger_source); +/* configure ADC external trigger */ +void adc_external_trigger_config(uint32_t adc_periph, uint8_t adc_channel_group, ControlStatus newvalue); +/* enable ADC software trigger */ +void adc_software_trigger_enable(uint32_t adc_periph, uint8_t adc_channel_group); + +/* get channel data */ +/* read ADC regular group data register */ +uint16_t adc_regular_data_read(uint32_t adc_periph); +/* read ADC inserted group data register */ +uint16_t adc_inserted_data_read(uint32_t adc_periph, uint8_t inserted_channel); +/* read the last ADC0 and ADC1 conversion result data in sync mode */ +uint32_t adc_sync_mode_convert_value_read(void); + +/* watchdog config */ +/* configure ADC analog watchdog single channel */ +void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel); +/* configure ADC analog watchdog group channel */ +void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_group); +/* disable ADC analog watchdog */ +void adc_watchdog_disable(uint32_t adc_periph); +/* configure ADC analog watchdog threshold */ +void adc_watchdog_threshold_config(uint32_t adc_periph, uint16_t low_threshold, uint16_t high_threshold); + +/* interrupt & flag functions */ +/* get the ADC flag bits */ +FlagStatus adc_flag_get(uint32_t adc_periph, uint32_t adc_flag); +/* clear the ADC flag bits */ +void adc_flag_clear(uint32_t adc_periph, uint32_t adc_flag); +/* get the bit state of ADCx software start conversion */ +FlagStatus adc_regular_software_startconv_flag_get(uint32_t adc_periph); +/* get the bit state of ADCx software inserted channel start conversion */ +FlagStatus adc_inserted_software_startconv_flag_get(uint32_t adc_periph); +/* get the ADC interrupt bits */ +FlagStatus adc_interrupt_flag_get(uint32_t adc_periph, uint32_t adc_interrupt); +/* clear the ADC flag */ +void adc_interrupt_flag_clear(uint32_t adc_periph, uint32_t adc_interrupt); +/* enable ADC interrupt */ +void adc_interrupt_enable(uint32_t adc_periph, uint32_t adc_interrupt); +/* disable ADC interrupt */ +void adc_interrupt_disable(uint32_t adc_periph, uint32_t adc_interrupt); + +#endif /* GD32F10x_ADC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_bkp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_bkp.h new file mode 100644 index 0000000..465810d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_bkp.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_can.h new file mode 100644 index 0000000..8b4b831 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_can.h @@ -0,0 +1,754 @@ +/*! + \file gd32f10x_can.h + \brief definitions for the CAN + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10x_CAN_H +#define GD32F10x_CAN_H + +#include "gd32f10x.h" + +/* CAN definitions */ +#define CAN0 CAN_BASE /*!< CAN0 base address */ +#define CAN1 (CAN0 + 0x00000400U) /*!< CAN1 base address */ + +/* registers definitions */ +#define CAN_CTL(canx) REG32((canx) + 0x00U) /*!< CAN control register */ +#define CAN_STAT(canx) REG32((canx) + 0x04U) /*!< CAN status register */ +#define CAN_TSTAT(canx) REG32((canx) + 0x08U) /*!< CAN transmit status register*/ +#define CAN_RFIFO0(canx) REG32((canx) + 0x0CU) /*!< CAN receive FIFO0 register */ +#define CAN_RFIFO1(canx) REG32((canx) + 0x10U) /*!< CAN receive FIFO1 register */ +#define CAN_INTEN(canx) REG32((canx) + 0x14U) /*!< CAN interrupt enable register */ +#define CAN_ERR(canx) REG32((canx) + 0x18U) /*!< CAN error register */ +#define CAN_BT(canx) REG32((canx) + 0x1CU) /*!< CAN bit timing register */ +#define CAN_TMI0(canx) REG32((canx) + 0x180U) /*!< CAN transmit mailbox0 identifier register */ +#define CAN_TMP0(canx) REG32((canx) + 0x184U) /*!< CAN transmit mailbox0 property register */ +#define CAN_TMDATA00(canx) REG32((canx) + 0x188U) /*!< CAN transmit mailbox0 data0 register */ +#define CAN_TMDATA10(canx) REG32((canx) + 0x18CU) /*!< CAN transmit mailbox0 data1 register */ +#define CAN_TMI1(canx) REG32((canx) + 0x190U) /*!< CAN transmit mailbox1 identifier register */ +#define CAN_TMP1(canx) REG32((canx) + 0x194U) /*!< CAN transmit mailbox1 property register */ +#define CAN_TMDATA01(canx) REG32((canx) + 0x198U) /*!< CAN transmit mailbox1 data0 register */ +#define CAN_TMDATA11(canx) REG32((canx) + 0x19CU) /*!< CAN transmit mailbox1 data1 register */ +#define CAN_TMI2(canx) REG32((canx) + 0x1A0U) /*!< CAN transmit mailbox2 identifier register */ +#define CAN_TMP2(canx) REG32((canx) + 0x1A4U) /*!< CAN transmit mailbox2 property register */ +#define CAN_TMDATA02(canx) REG32((canx) + 0x1A8U) /*!< CAN transmit mailbox2 data0 register */ +#define CAN_TMDATA12(canx) REG32((canx) + 0x1ACU) /*!< CAN transmit mailbox2 data1 register */ +#define CAN_RFIFOMI0(canx) REG32((canx) + 0x1B0U) /*!< CAN receive FIFO0 mailbox identifier register */ +#define CAN_RFIFOMP0(canx) REG32((canx) + 0x1B4U) /*!< CAN receive FIFO0 mailbox property register */ +#define CAN_RFIFOMDATA00(canx) REG32((canx) + 0x1B8U) /*!< CAN receive FIFO0 mailbox data0 register */ +#define CAN_RFIFOMDATA10(canx) REG32((canx) + 0x1BCU) /*!< CAN receive FIFO0 mailbox data1 register */ +#define CAN_RFIFOMI1(canx) REG32((canx) + 0x1C0U) /*!< CAN receive FIFO1 mailbox identifier register */ +#define CAN_RFIFOMP1(canx) REG32((canx) + 0x1C4U) /*!< CAN receive FIFO1 mailbox property register */ +#define CAN_RFIFOMDATA01(canx) REG32((canx) + 0x1C8U) /*!< CAN receive FIFO1 mailbox data0 register */ +#define CAN_RFIFOMDATA11(canx) REG32((canx) + 0x1CCU) /*!< CAN receive FIFO1 mailbox data1 register */ +#define CAN_FCTL(canx) REG32((canx) + 0x200U) /*!< CAN filter control register */ +#define CAN_FMCFG(canx) REG32((canx) + 0x204U) /*!< CAN filter mode register */ +#define CAN_FSCFG(canx) REG32((canx) + 0x20CU) /*!< CAN filter scale register */ +#define CAN_FAFIFO(canx) REG32((canx) + 0x214U) /*!< CAN filter associated FIFO register */ +#define CAN_FW(canx) REG32((canx) + 0x21CU) /*!< CAN filter working register */ +#define CAN_F0DATA0(canx) REG32((canx) + 0x240U) /*!< CAN filter 0 data 0 register */ +#define CAN_F1DATA0(canx) REG32((canx) + 0x248U) /*!< CAN filter 1 data 0 register */ +#define CAN_F2DATA0(canx) REG32((canx) + 0x250U) /*!< CAN filter 2 data 0 register */ +#define CAN_F3DATA0(canx) REG32((canx) + 0x258U) /*!< CAN filter 3 data 0 register */ +#define CAN_F4DATA0(canx) REG32((canx) + 0x260U) /*!< CAN filter 4 data 0 register */ +#define CAN_F5DATA0(canx) REG32((canx) + 0x268U) /*!< CAN filter 5 data 0 register */ +#define CAN_F6DATA0(canx) REG32((canx) + 0x270U) /*!< CAN filter 6 data 0 register */ +#define CAN_F7DATA0(canx) REG32((canx) + 0x278U) /*!< CAN filter 7 data 0 register */ +#define CAN_F8DATA0(canx) REG32((canx) + 0x280U) /*!< CAN filter 8 data 0 register */ +#define CAN_F9DATA0(canx) REG32((canx) + 0x288U) /*!< CAN filter 9 data 0 register */ +#define CAN_F10DATA0(canx) REG32((canx) + 0x290U) /*!< CAN filter 10 data 0 register */ +#define CAN_F11DATA0(canx) REG32((canx) + 0x298U) /*!< CAN filter 11 data 0 register */ +#define CAN_F12DATA0(canx) REG32((canx) + 0x2A0U) /*!< CAN filter 12 data 0 register */ +#define CAN_F13DATA0(canx) REG32((canx) + 0x2A8U) /*!< CAN filter 13 data 0 register */ +#define CAN_F14DATA0(canx) REG32((canx) + 0x2B0U) /*!< CAN filter 14 data 0 register */ +#define CAN_F15DATA0(canx) REG32((canx) + 0x2B8U) /*!< CAN filter 15 data 0 register */ +#define CAN_F16DATA0(canx) REG32((canx) + 0x2C0U) /*!< CAN filter 16 data 0 register */ +#define CAN_F17DATA0(canx) REG32((canx) + 0x2C8U) /*!< CAN filter 17 data 0 register */ +#define CAN_F18DATA0(canx) REG32((canx) + 0x2D0U) /*!< CAN filter 18 data 0 register */ +#define CAN_F19DATA0(canx) REG32((canx) + 0x2D8U) /*!< CAN filter 19 data 0 register */ +#define CAN_F20DATA0(canx) REG32((canx) + 0x2E0U) /*!< CAN filter 20 data 0 register */ +#define CAN_F21DATA0(canx) REG32((canx) + 0x2E8U) /*!< CAN filter 21 data 0 register */ +#define CAN_F22DATA0(canx) REG32((canx) + 0x2F0U) /*!< CAN filter 22 data 0 register */ +#define CAN_F23DATA0(canx) REG32((canx) + 0x3F8U) /*!< CAN filter 23 data 0 register */ +#define CAN_F24DATA0(canx) REG32((canx) + 0x300U) /*!< CAN filter 24 data 0 register */ +#define CAN_F25DATA0(canx) REG32((canx) + 0x308U) /*!< CAN filter 25 data 0 register */ +#define CAN_F26DATA0(canx) REG32((canx) + 0x310U) /*!< CAN filter 26 data 0 register */ +#define CAN_F27DATA0(canx) REG32((canx) + 0x318U) /*!< CAN filter 27 data 0 register */ +#define CAN_F0DATA1(canx) REG32((canx) + 0x244U) /*!< CAN filter 0 data 1 register */ +#define CAN_F1DATA1(canx) REG32((canx) + 0x24CU) /*!< CAN filter 1 data 1 register */ +#define CAN_F2DATA1(canx) REG32((canx) + 0x254U) /*!< CAN filter 2 data 1 register */ +#define CAN_F3DATA1(canx) REG32((canx) + 0x25CU) /*!< CAN filter 3 data 1 register */ +#define CAN_F4DATA1(canx) REG32((canx) + 0x264U) /*!< CAN filter 4 data 1 register */ +#define CAN_F5DATA1(canx) REG32((canx) + 0x26CU) /*!< CAN filter 5 data 1 register */ +#define CAN_F6DATA1(canx) REG32((canx) + 0x274U) /*!< CAN filter 6 data 1 register */ +#define CAN_F7DATA1(canx) REG32((canx) + 0x27CU) /*!< CAN filter 7 data 1 register */ +#define CAN_F8DATA1(canx) REG32((canx) + 0x284U) /*!< CAN filter 8 data 1 register */ +#define CAN_F9DATA1(canx) REG32((canx) + 0x28CU) /*!< CAN filter 9 data 1 register */ +#define CAN_F10DATA1(canx) REG32((canx) + 0x294U) /*!< CAN filter 10 data 1 register */ +#define CAN_F11DATA1(canx) REG32((canx) + 0x29CU) /*!< CAN filter 11 data 1 register */ +#define CAN_F12DATA1(canx) REG32((canx) + 0x2A4U) /*!< CAN filter 12 data 1 register */ +#define CAN_F13DATA1(canx) REG32((canx) + 0x2ACU) /*!< CAN filter 13 data 1 register */ +#define CAN_F14DATA1(canx) REG32((canx) + 0x2B4U) /*!< CAN filter 14 data 1 register */ +#define CAN_F15DATA1(canx) REG32((canx) + 0x2BCU) /*!< CAN filter 15 data 1 register */ +#define CAN_F16DATA1(canx) REG32((canx) + 0x2C4U) /*!< CAN filter 16 data 1 register */ +#define CAN_F17DATA1(canx) REG32((canx) + 0x24CU) /*!< CAN filter 17 data 1 register */ +#define CAN_F18DATA1(canx) REG32((canx) + 0x2D4U) /*!< CAN filter 18 data 1 register */ +#define CAN_F19DATA1(canx) REG32((canx) + 0x2DCU) /*!< CAN filter 19 data 1 register */ +#define CAN_F20DATA1(canx) REG32((canx) + 0x2E4U) /*!< CAN filter 20 data 1 register */ +#define CAN_F21DATA1(canx) REG32((canx) + 0x2ECU) /*!< CAN filter 21 data 1 register */ +#define CAN_F22DATA1(canx) REG32((canx) + 0x2F4U) /*!< CAN filter 22 data 1 register */ +#define CAN_F23DATA1(canx) REG32((canx) + 0x2FCU) /*!< CAN filter 23 data 1 register */ +#define CAN_F24DATA1(canx) REG32((canx) + 0x304U) /*!< CAN filter 24 data 1 register */ +#define CAN_F25DATA1(canx) REG32((canx) + 0x30CU) /*!< CAN filter 25 data 1 register */ +#define CAN_F26DATA1(canx) REG32((canx) + 0x314U) /*!< CAN filter 26 data 1 register */ +#define CAN_F27DATA1(canx) REG32((canx) + 0x31CU) /*!< CAN filter 27 data 1 register */ + +/* CAN transmit mailbox bank */ +#define CAN_TMI(canx, bank) REG32((canx) + 0x180U + ((bank) * 0x10U)) /*!< CAN transmit mailbox identifier register */ +#define CAN_TMP(canx, bank) REG32((canx) + 0x184U + ((bank) * 0x10U)) /*!< CAN transmit mailbox property register */ +#define CAN_TMDATA0(canx, bank) REG32((canx) + 0x188U + ((bank) * 0x10U)) /*!< CAN transmit mailbox data0 register */ +#define CAN_TMDATA1(canx, bank) REG32((canx) + 0x18CU + ((bank) * 0x10U)) /*!< CAN transmit mailbox data1 register */ + +/* CAN filter bank */ +#define CAN_FDATA0(canx, bank) REG32((canx) + 0x240U + ((bank) * 0x8U) + 0x0U) /*!< CAN filter data 0 register */ +#define CAN_FDATA1(canx, bank) REG32((canx) + 0x240U + ((bank) * 0x8U) + 0x4U) /*!< CAN filter data 1 register */ + +/* CAN receive fifo mailbox bank */ +#define CAN_RFIFOMI(canx, bank) REG32((canx) + 0x1B0U + ((bank) * 0x10U)) /*!< CAN receive FIFO mailbox identifier register */ +#define CAN_RFIFOMP(canx, bank) REG32((canx) + 0x1B4U + ((bank) * 0x10U)) /*!< CAN receive FIFO mailbox property register */ +#define CAN_RFIFOMDATA0(canx, bank) REG32((canx) + 0x1B8U + ((bank) * 0x10U)) /*!< CAN receive FIFO mailbox data0 register */ +#define CAN_RFIFOMDATA1(canx, bank) REG32((canx) + 0x1BCU + ((bank) * 0x10U)) /*!< CAN receive FIFO mailbox data1 register */ + +/* bits definitions */ +/* CAN_CTL */ +#define CAN_CTL_IWMOD BIT(0) /*!< initial working mode */ +#define CAN_CTL_SLPWMOD BIT(1) /*!< sleep working mode */ +#define CAN_CTL_TFO BIT(2) /*!< transmit FIFO order */ +#define CAN_CTL_RFOD BIT(3) /*!< receive FIFO overwrite disable */ +#define CAN_CTL_ARD BIT(4) /*!< automatic retransmission disable */ +#define CAN_CTL_AWU BIT(5) /*!< automatic wakeup */ +#define CAN_CTL_ABOR BIT(6) /*!< automatic bus-off recovery */ +#define CAN_CTL_TTC BIT(7) /*!< time triggered communication */ +#define CAN_CTL_SWRST BIT(15) /*!< CAN software reset */ +#define CAN_CTL_DFZ BIT(16) /*!< CAN debug freeze */ + +/* CAN_STAT */ +#define CAN_STAT_IWS BIT(0) /*!< initial working state */ +#define CAN_STAT_SLPWS BIT(1) /*!< sleep working state */ +#define CAN_STAT_ERRIF BIT(2) /*!< error interrupt flag*/ +#define CAN_STAT_WUIF BIT(3) /*!< status change interrupt flag of wakeup from sleep working mode */ +#define CAN_STAT_SLPIF BIT(4) /*!< status change interrupt flag of sleep working mode entering */ +#define CAN_STAT_TS BIT(8) /*!< transmitting state */ +#define CAN_STAT_RS BIT(9) /*!< receiving state */ +#define CAN_STAT_LASTRX BIT(10) /*!< last sample value of rx pin */ +#define CAN_STAT_RXL BIT(11) /*!< CAN rx signal */ + +/* CAN_TSTAT */ +#define CAN_TSTAT_MTF0 BIT(0) /*!< mailbox0 transmit finished */ +#define CAN_TSTAT_MTFNERR0 BIT(1) /*!< mailbox0 transmit finished and no error */ +#define CAN_TSTAT_MAL0 BIT(2) /*!< mailbox0 arbitration lost */ +#define CAN_TSTAT_MTE0 BIT(3) /*!< mailbox0 transmit error */ +#define CAN_TSTAT_MST0 BIT(7) /*!< mailbox0 stop transmitting */ +#define CAN_TSTAT_MTF1 BIT(8) /*!< mailbox1 transmit finished */ +#define CAN_TSTAT_MTFNERR1 BIT(9) /*!< mailbox1 transmit finished and no error */ +#define CAN_TSTAT_MAL1 BIT(10) /*!< mailbox1 arbitration lost */ +#define CAN_TSTAT_MTE1 BIT(11) /*!< mailbox1 transmit error */ +#define CAN_TSTAT_MST1 BIT(15) /*!< mailbox1 stop transmitting */ +#define CAN_TSTAT_MTF2 BIT(16) /*!< mailbox2 transmit finished */ +#define CAN_TSTAT_MTFNERR2 BIT(17) /*!< mailbox2 transmit finished and no error */ +#define CAN_TSTAT_MAL2 BIT(18) /*!< mailbox2 arbitration lost */ +#define CAN_TSTAT_MTE2 BIT(19) /*!< mailbox2 transmit error */ +#define CAN_TSTAT_MST2 BIT(23) /*!< mailbox2 stop transmitting */ +#define CAN_TSTAT_NUM BITS(24,25) /*!< mailbox number */ +#define CAN_TSTAT_TME0 BIT(26) /*!< transmit mailbox0 empty */ +#define CAN_TSTAT_TME1 BIT(27) /*!< transmit mailbox1 empty */ +#define CAN_TSTAT_TME2 BIT(28) /*!< transmit mailbox2 empty */ +#define CAN_TSTAT_TMLS0 BIT(29) /*!< last sending priority flag for mailbox0 */ +#define CAN_TSTAT_TMLS1 BIT(30) /*!< last sending priority flag for mailbox1 */ +#define CAN_TSTAT_TMLS2 BIT(31) /*!< last sending priority flag for mailbox2 */ + +/* CAN_RFIFO0 */ +#define CAN_RFIFO0_RFL0 BITS(0,1) /*!< receive FIFO0 length */ +#define CAN_RFIFO0_RFF0 BIT(3) /*!< receive FIFO0 full */ +#define CAN_RFIFO0_RFO0 BIT(4) /*!< receive FIFO0 overfull */ +#define CAN_RFIFO0_RFD0 BIT(5) /*!< receive FIFO0 dequeue */ + +/* CAN_RFIFO1 */ +#define CAN_RFIFO1_RFL1 BITS(0,1) /*!< receive FIFO1 length */ +#define CAN_RFIFO1_RFF1 BIT(3) /*!< receive FIFO1 full */ +#define CAN_RFIFO1_RFO1 BIT(4) /*!< receive FIFO1 overfull */ +#define CAN_RFIFO1_RFD1 BIT(5) /*!< receive FIFO1 dequeue */ + +/* CAN_INTEN */ +#define CAN_INTEN_TMEIE BIT(0) /*!< transmit mailbox empty interrupt enable */ +#define CAN_INTEN_RFNEIE0 BIT(1) /*!< receive FIFO0 not empty interrupt enable */ +#define CAN_INTEN_RFFIE0 BIT(2) /*!< receive FIFO0 full interrupt enable */ +#define CAN_INTEN_RFOIE0 BIT(3) /*!< receive FIFO0 overfull interrupt enable */ +#define CAN_INTEN_RFNEIE1 BIT(4) /*!< receive FIFO1 not empty interrupt enable */ +#define CAN_INTEN_RFFIE1 BIT(5) /*!< receive FIFO1 full interrupt enable */ +#define CAN_INTEN_RFOIE1 BIT(6) /*!< receive FIFO1 overfull interrupt enable */ +#define CAN_INTEN_WERRIE BIT(8) /*!< warning error interrupt enable */ +#define CAN_INTEN_PERRIE BIT(9) /*!< passive error interrupt enable */ +#define CAN_INTEN_BOIE BIT(10) /*!< bus-off interrupt enable */ +#define CAN_INTEN_ERRNIE BIT(11) /*!< error number interrupt enable */ +#define CAN_INTEN_ERRIE BIT(15) /*!< error interrupt enable */ +#define CAN_INTEN_WIE BIT(16) /*!< wakeup interrupt enable */ +#define CAN_INTEN_SLPWIE BIT(17) /*!< sleep working interrupt enable */ + +/* CAN_ERR */ +#define CAN_ERR_WERR BIT(0) /*!< warning error */ +#define CAN_ERR_PERR BIT(1) /*!< passive error */ +#define CAN_ERR_BOERR BIT(2) /*!< bus-off error */ +#define CAN_ERR_ERRN BITS(4,6) /*!< error number */ +#define CAN_ERR_TECNT BITS(16,23) /*!< transmit error count */ +#define CAN_ERR_RECNT BITS(24,31) /*!< receive error count */ + +/* CAN_BT */ +#define CAN_BT_BAUDPSC BITS(0,9) /*!< baudrate prescaler */ +#define CAN_BT_BS1 BITS(16,19) /*!< bit segment 1 */ +#define CAN_BT_BS2 BITS(20,22) /*!< bit segment 2 */ +#define CAN_BT_SJW BITS(24,25) /*!< resynchronization jump width */ +#define CAN_BT_LCMOD BIT(30) /*!< loopback communication mode */ +#define CAN_BT_SCMOD BIT(31) /*!< silent communication mode */ + +/* CAN_TMIx */ +#define CAN_TMI_TEN BIT(0) /*!< transmit enable */ +#define CAN_TMI_FT BIT(1) /*!< frame type */ +#define CAN_TMI_FF BIT(2) /*!< frame format */ +#define CAN_TMI_EFID BITS(3,31) /*!< the frame identifier */ +#define CAN_TMI_SFID BITS(21,31) /*!< the frame identifier */ + +/* CAN_TMPx */ +#define CAN_TMP_DLENC BITS(0,3) /*!< data length code */ +#define CAN_TMP_TSEN BIT(8) /*!< time stamp enable */ +#define CAN_TMP_TS BITS(16,31) /*!< time stamp */ + +/* CAN_TMDATA0x */ +#define CAN_TMDATA0_DB0 BITS(0,7) /*!< transmit data byte 0 */ +#define CAN_TMDATA0_DB1 BITS(8,15) /*!< transmit data byte 1 */ +#define CAN_TMDATA0_DB2 BITS(16,23) /*!< transmit data byte 2 */ +#define CAN_TMDATA0_DB3 BITS(24,31) /*!< transmit data byte 3 */ + +/* CAN_TMDATA1x */ +#define CAN_TMDATA1_DB4 BITS(0,7) /*!< transmit data byte 4 */ +#define CAN_TMDATA1_DB5 BITS(8,15) /*!< transmit data byte 5 */ +#define CAN_TMDATA1_DB6 BITS(16,23) /*!< transmit data byte 6 */ +#define CAN_TMDATA1_DB7 BITS(24,31) /*!< transmit data byte 7 */ + +/* CAN_RFIFOMIx */ +#define CAN_RFIFOMI_FT BIT(1) /*!< frame type */ +#define CAN_RFIFOMI_FF BIT(2) /*!< frame format */ +#define CAN_RFIFOMI_EFID BITS(3,31) /*!< the frame identifier */ +#define CAN_RFIFOMI_SFID BITS(21,31) /*!< the frame identifier */ + +/* CAN_RFIFOMPx */ +#define CAN_RFIFOMP_DLENC BITS(0,3) /*!< receive data length code */ +#define CAN_RFIFOMP_FI BITS(8,15) /*!< filter index */ +#define CAN_RFIFOMP_TS BITS(16,31) /*!< time stamp */ + +/* CAN_RFIFOMDATA0x */ +#define CAN_RFIFOMDATA0_DB0 BITS(0,7) /*!< receive data byte 0 */ +#define CAN_RFIFOMDATA0_DB1 BITS(8,15) /*!< receive data byte 1 */ +#define CAN_RFIFOMDATA0_DB2 BITS(16,23) /*!< receive data byte 2 */ +#define CAN_RFIFOMDATA0_DB3 BITS(24,31) /*!< receive data byte 3 */ + +/* CAN_RFIFOMDATA1x */ +#define CAN_RFIFOMDATA1_DB4 BITS(0,7) /*!< receive data byte 4 */ +#define CAN_RFIFOMDATA1_DB5 BITS(8,15) /*!< receive data byte 5 */ +#define CAN_RFIFOMDATA1_DB6 BITS(16,23) /*!< receive data byte 6 */ +#define CAN_RFIFOMDATA1_DB7 BITS(24,31) /*!< receive data byte 7 */ + +/* CAN_FCTL */ +#define CAN_FCTL_FLD BIT(0) /*!< filter lock disable */ +#define CAN_FCTL_HBC1F BITS(8,13) /*!< header bank of CAN1 filter */ + +/* CAN_FMCFG */ +#define CAN_FMCFG_FMOD(regval) BIT(regval) /*!< filter mode, list or mask*/ + +/* CAN_FSCFG */ +#define CAN_FSCFG_FS(regval) BIT(regval) /*!< filter scale, 32 bits or 16 bits*/ + +/* CAN_FAFIFO */ +#define CAN_FAFIFOR_FAF(regval) BIT(regval) /*!< filter associated with FIFO */ + +/* CAN_FW */ +#define CAN_FW_FW(regval) BIT(regval) /*!< filter working */ + +/* CAN_FxDATAy */ +#define CAN_FDATA_FD(regval) BIT(regval) /*!< filter data */ + +/* constants definitions */ +/* define the CAN bit position and its register index offset */ +#define CAN_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define CAN_REG_VAL(canx, offset) (REG32((canx) + ((uint32_t)(offset) >> 6))) +#define CAN_BIT_POS(val) ((uint32_t)(val) & 0x1FU) + +#define CAN_REGIDX_BITS(regidx, bitpos0, bitpos1) (((uint32_t)(regidx) << 12) | ((uint32_t)(bitpos0) << 6) | (uint32_t)(bitpos1)) +#define CAN_REG_VALS(canx, offset) (REG32((canx) + ((uint32_t)(offset) >> 12))) +#define CAN_BIT_POS0(val) (((uint32_t)(val) >> 6) & 0x1FU) +#define CAN_BIT_POS1(val) ((uint32_t)(val) & 0x1FU) + +/* register offset */ +#define STAT_REG_OFFSET ((uint8_t)0x04U) /*!< STAT register offset */ +#define TSTAT_REG_OFFSET ((uint8_t)0x08U) /*!< TSTAT register offset */ +#define RFIFO0_REG_OFFSET ((uint8_t)0x0CU) /*!< RFIFO0 register offset */ +#define RFIFO1_REG_OFFSET ((uint8_t)0x10U) /*!< RFIFO1 register offset */ +#define ERR_REG_OFFSET ((uint8_t)0x18U) /*!< ERR register offset */ + +/* CAN flags */ +typedef enum +{ + /* flags in STAT register */ + CAN_FLAG_RXL = CAN_REGIDX_BIT(STAT_REG_OFFSET, 11U), /*!< RX level */ + CAN_FLAG_LASTRX = CAN_REGIDX_BIT(STAT_REG_OFFSET, 10U), /*!< last sample value of RX pin */ + CAN_FLAG_RS = CAN_REGIDX_BIT(STAT_REG_OFFSET, 9U), /*!< receiving state */ + CAN_FLAG_TS = CAN_REGIDX_BIT(STAT_REG_OFFSET, 8U), /*!< transmitting state */ + CAN_FLAG_SLPIF = CAN_REGIDX_BIT(STAT_REG_OFFSET, 4U), /*!< status change flag of entering sleep working mode */ + CAN_FLAG_WUIF = CAN_REGIDX_BIT(STAT_REG_OFFSET, 3U), /*!< status change flag of wakeup from sleep working mode */ + CAN_FLAG_ERRIF = CAN_REGIDX_BIT(STAT_REG_OFFSET, 2U), /*!< error flag */ + CAN_FLAG_SLPWS = CAN_REGIDX_BIT(STAT_REG_OFFSET, 1U), /*!< sleep working state */ + CAN_FLAG_IWS = CAN_REGIDX_BIT(STAT_REG_OFFSET, 0U), /*!< initial working state */ + /* flags in TSTAT register */ + CAN_FLAG_TMLS2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 31U), /*!< transmit mailbox 2 last sending in Tx FIFO */ + CAN_FLAG_TMLS1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 30U), /*!< transmit mailbox 1 last sending in Tx FIFO */ + CAN_FLAG_TMLS0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 29U), /*!< transmit mailbox 0 last sending in Tx FIFO */ + CAN_FLAG_TME2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 28U), /*!< transmit mailbox 2 empty */ + CAN_FLAG_TME1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 27U), /*!< transmit mailbox 1 empty */ + CAN_FLAG_TME0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 26U), /*!< transmit mailbox 0 empty */ + CAN_FLAG_MTE2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 19U), /*!< mailbox 2 transmit error */ + CAN_FLAG_MTE1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 11U), /*!< mailbox 1 transmit error */ + CAN_FLAG_MTE0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 3U), /*!< mailbox 0 transmit error */ + CAN_FLAG_MAL2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 18U), /*!< mailbox 2 arbitration lost */ + CAN_FLAG_MAL1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 10U), /*!< mailbox 1 arbitration lost */ + CAN_FLAG_MAL0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 2U), /*!< mailbox 0 arbitration lost */ + CAN_FLAG_MTFNERR2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 17U), /*!< mailbox 2 transmit finished with no error */ + CAN_FLAG_MTFNERR1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 9U), /*!< mailbox 1 transmit finished with no error */ + CAN_FLAG_MTFNERR0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 1U), /*!< mailbox 0 transmit finished with no error */ + CAN_FLAG_MTF2 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 16U), /*!< mailbox 2 transmit finished */ + CAN_FLAG_MTF1 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 8U), /*!< mailbox 1 transmit finished */ + CAN_FLAG_MTF0 = CAN_REGIDX_BIT(TSTAT_REG_OFFSET, 0U), /*!< mailbox 0 transmit finished */ + /* flags in RFIFO0 register */ + CAN_FLAG_RFO0 = CAN_REGIDX_BIT(RFIFO0_REG_OFFSET, 4U), /*!< receive FIFO0 overfull */ + CAN_FLAG_RFF0 = CAN_REGIDX_BIT(RFIFO0_REG_OFFSET, 3U), /*!< receive FIFO0 full */ + /* flags in RFIFO1 register */ + CAN_FLAG_RFO1 = CAN_REGIDX_BIT(RFIFO1_REG_OFFSET, 4U), /*!< receive FIFO1 overfull */ + CAN_FLAG_RFF1 = CAN_REGIDX_BIT(RFIFO1_REG_OFFSET, 3U), /*!< receive FIFO1 full */ + /* flags in ERR register */ + CAN_FLAG_BOERR = CAN_REGIDX_BIT(ERR_REG_OFFSET, 2U), /*!< bus-off error */ + CAN_FLAG_PERR = CAN_REGIDX_BIT(ERR_REG_OFFSET, 1U), /*!< passive error */ + CAN_FLAG_WERR = CAN_REGIDX_BIT(ERR_REG_OFFSET, 0U), /*!< warning error */ +}can_flag_enum; + +/* CAN interrupt flags */ +typedef enum +{ + /* interrupt flags in STAT register */ + CAN_INT_FLAG_SLPIF = CAN_REGIDX_BITS(STAT_REG_OFFSET, 4U, 17U), /*!< status change interrupt flag of sleep working mode entering */ + CAN_INT_FLAG_WUIF = CAN_REGIDX_BITS(STAT_REG_OFFSET, 3U, 16), /*!< status change interrupt flag of wakeup from sleep working mode */ + CAN_INT_FLAG_ERRIF = CAN_REGIDX_BITS(STAT_REG_OFFSET, 2U, 15), /*!< error interrupt flag */ + /* interrupt flags in TSTAT register */ + CAN_INT_FLAG_MTF2 = CAN_REGIDX_BITS(TSTAT_REG_OFFSET, 16U, 0U), /*!< mailbox 2 transmit finished interrupt flag */ + CAN_INT_FLAG_MTF1 = CAN_REGIDX_BITS(TSTAT_REG_OFFSET, 8U, 0U), /*!< mailbox 1 transmit finished interrupt flag */ + CAN_INT_FLAG_MTF0 = CAN_REGIDX_BITS(TSTAT_REG_OFFSET, 0U, 0U), /*!< mailbox 0 transmit finished interrupt flag */ + /* interrupt flags in RFIFO0 register */ + CAN_INT_FLAG_RFO0 = CAN_REGIDX_BITS(RFIFO0_REG_OFFSET, 4U, 3U), /*!< receive FIFO0 overfull interrupt flag */ + CAN_INT_FLAG_RFF0 = CAN_REGIDX_BITS(RFIFO0_REG_OFFSET, 3U, 2U), /*!< receive FIFO0 full interrupt flag */ + CAN_INT_FLAG_RFL0 = CAN_REGIDX_BITS(RFIFO0_REG_OFFSET, 2U, 1U), /*!< receive FIFO0 not empty interrupt flag */ + /* interrupt flags in RFIFO0 register */ + CAN_INT_FLAG_RFO1 = CAN_REGIDX_BITS(RFIFO1_REG_OFFSET, 4U, 6U), /*!< receive FIFO1 overfull interrupt flag */ + CAN_INT_FLAG_RFF1 = CAN_REGIDX_BITS(RFIFO1_REG_OFFSET, 3U, 5U), /*!< receive FIFO1 full interrupt flag */ + CAN_INT_FLAG_RFL1 = CAN_REGIDX_BITS(RFIFO1_REG_OFFSET, 2U, 4U), /*!< receive FIFO1 not empty interrupt flag */ + /* interrupt flags in ERR register */ + CAN_INT_FLAG_ERRN = CAN_REGIDX_BITS(ERR_REG_OFFSET, 3U, 11U), /*!< error number interrupt flag */ + CAN_INT_FLAG_BOERR = CAN_REGIDX_BITS(ERR_REG_OFFSET, 2U, 10U), /*!< bus-off error interrupt flag */ + CAN_INT_FLAG_PERR = CAN_REGIDX_BITS(ERR_REG_OFFSET, 1U, 9U), /*!< passive error interrupt flag */ + CAN_INT_FLAG_WERR = CAN_REGIDX_BITS(ERR_REG_OFFSET, 0U, 8U), /*!< warning error interrupt flag */ +}can_interrupt_flag_enum; + +/* CAN initiliaze parameters structure */ +typedef struct +{ + uint8_t working_mode; /*!< CAN working mode */ + uint8_t resync_jump_width; /*!< CAN resynchronization jump width */ + uint8_t time_segment_1; /*!< time segment 1 */ + uint8_t time_segment_2; /*!< time segment 2 */ + ControlStatus time_triggered; /*!< time triggered communication mode */ + ControlStatus auto_bus_off_recovery; /*!< automatic bus-off recovery */ + ControlStatus auto_wake_up; /*!< automatic wake-up mode */ + ControlStatus auto_retrans; /*!< automatic retransmission mode */ + ControlStatus rec_fifo_overwrite; /*!< receive FIFO overwrite mode */ + ControlStatus trans_fifo_order; /*!< transmit FIFO order */ + uint16_t prescaler; /*!< baudrate prescaler */ +}can_parameter_struct; + +/* CAN transmit message structure */ +typedef struct +{ + uint32_t tx_sfid; /*!< standard format frame identifier */ + uint32_t tx_efid; /*!< extended format frame identifier */ + uint8_t tx_ff; /*!< format of frame, standard or extended format */ + uint8_t tx_ft; /*!< type of frame, data or remote */ + uint8_t tx_dlen; /*!< data length */ + uint8_t tx_data[64]; /*!< transmit data */ +}can_trasnmit_message_struct; + +/* CAN receive message structure */ +typedef struct +{ + uint32_t rx_sfid; /*!< standard format frame identifier */ + uint32_t rx_efid; /*!< extended format frame identifier */ + uint8_t rx_ff; /*!< format of frame, standard or extended format */ + uint8_t rx_ft; /*!< type of frame, data or remote */ + uint8_t rx_dlen; /*!< data length */ + uint8_t rx_data[64]; /*!< receive data */ + uint8_t rx_fi; /*!< filtering index */ +} can_receive_message_struct; + +/* CAN filter parameters structure */ +typedef struct +{ + uint16_t filter_list_high; /*!< filter list number high bits*/ + uint16_t filter_list_low; /*!< filter list number low bits */ + uint16_t filter_mask_high; /*!< filter mask number high bits */ + uint16_t filter_mask_low; /*!< filter mask number low bits */ + uint16_t filter_fifo_number; /*!< receive FIFO associated with the filter */ + uint16_t filter_number; /*!< filter number */ + uint16_t filter_mode; /*!< filter mode, list or mask */ + uint16_t filter_bits; /*!< filter scale */ + ControlStatus filter_enable; /*!< filter work or not */ +}can_filter_parameter_struct; + +/* CAN errors */ +typedef enum +{ + CAN_ERROR_NONE = 0, /*!< no error */ + CAN_ERROR_FILL, /*!< fill error */ + CAN_ERROR_FORMATE, /*!< format error */ + CAN_ERROR_ACK, /*!< ACK error */ + CAN_ERROR_BITRECESSIVE, /*!< bit recessive error */ + CAN_ERROR_BITDOMINANTER, /*!< bit dominant error */ + CAN_ERROR_CRC, /*!< CRC error */ + CAN_ERROR_SOFTWARECFG, /*!< software configure */ +}can_error_enum; + +/* transmit states */ +typedef enum +{ + CAN_TRANSMIT_FAILED = 0U, /*!< CAN transmitted failure */ + CAN_TRANSMIT_OK = 1U, /*!< CAN transmitted success */ + CAN_TRANSMIT_PENDING = 2U, /*!< CAN transmitted pending */ + CAN_TRANSMIT_NOMAILBOX = 4U, /*!< no empty mailbox to be used for CAN */ +}can_transmit_state_enum; + +typedef enum +{ + CAN_INIT_STRUCT = 0, /* CAN initiliaze parameters struct */ + CAN_FILTER_STRUCT, /* CAN filter parameters struct */ + CAN_TX_MESSAGE_STRUCT, /* CAN transmit message struct */ + CAN_RX_MESSAGE_STRUCT, /* CAN receive message struct */ +}can_struct_type_enum; + +/* CAN baudrate prescaler*/ +#define BT_BAUDPSC(regval) (BITS(0,9) & ((uint32_t)(regval) << 0)) + +/* CAN bit segment 1*/ +#define BT_BS1(regval) (BITS(16,19) & ((uint32_t)(regval) << 16)) + +/* CAN bit segment 2*/ +#define BT_BS2(regval) (BITS(20,22) & ((uint32_t)(regval) << 20)) + +/* CAN resynchronization jump width*/ +#define BT_SJW(regval) (BITS(24,25) & ((uint32_t)(regval) << 24)) + +/* CAN communication mode*/ +#define BT_MODE(regval) (BITS(30,31) & ((uint32_t)(regval) << 30)) + +/* CAN FDATA high 16 bits */ +#define FDATA_MASK_HIGH(regval) (BITS(16,31) & ((uint32_t)(regval) << 16)) + +/* CAN FDATA low 16 bits */ +#define FDATA_MASK_LOW(regval) (BITS(0,15) & ((uint32_t)(regval) << 0)) + +/* CAN1 filter start bank_number*/ +#define FCTL_HBC1F(regval) (BITS(8,13) & ((uint32_t)(regval) << 8)) + +/* CAN transmit mailbox extended identifier*/ +#define TMI_EFID(regval) (BITS(3,31) & ((uint32_t)(regval) << 3)) + +/* CAN transmit mailbox standard identifier*/ +#define TMI_SFID(regval) (BITS(21,31) & ((uint32_t)(regval) << 21)) + +/* transmit data byte 0 */ +#define TMDATA0_DB0(regval) (BITS(0,7) & ((uint32_t)(regval) << 0)) + +/* transmit data byte 1 */ +#define TMDATA0_DB1(regval) (BITS(8,15) & ((uint32_t)(regval) << 8)) + +/* transmit data byte 2 */ +#define TMDATA0_DB2(regval) (BITS(16,23) & ((uint32_t)(regval) << 16)) + +/* transmit data byte 3 */ +#define TMDATA0_DB3(regval) (BITS(24,31) & ((uint32_t)(regval) << 24)) + +/* transmit data byte 4 */ +#define TMDATA1_DB4(regval) (BITS(0,7) & ((uint32_t)(regval) << 0)) + +/* transmit data byte 5 */ +#define TMDATA1_DB5(regval) (BITS(8,15) & ((uint32_t)(regval) << 8)) + +/* transmit data byte 6 */ +#define TMDATA1_DB6(regval) (BITS(16,23) & ((uint32_t)(regval) << 16)) + +/* transmit data byte 7 */ +#define TMDATA1_DB7(regval) (BITS(24,31) & ((uint32_t)(regval) << 24)) + +/* receive mailbox extended identifier*/ +#define GET_RFIFOMI_EFID(regval) GET_BITS((uint32_t)(regval), 3U, 31U) + +/* receive mailbox standrad identifier*/ +#define GET_RFIFOMI_SFID(regval) GET_BITS((uint32_t)(regval), 21U, 31U) + +/* receive data length */ +#define GET_RFIFOMP_DLENC(regval) GET_BITS((uint32_t)(regval), 0U, 3U) + +/* the index of the filter by which the frame is passed */ +#define GET_RFIFOMP_FI(regval) GET_BITS((uint32_t)(regval), 8U, 15U) + +/* receive data byte 0 */ +#define GET_RFIFOMDATA0_DB0(regval) GET_BITS((uint32_t)(regval), 0U, 7U) + +/* receive data byte 1 */ +#define GET_RFIFOMDATA0_DB1(regval) GET_BITS((uint32_t)(regval), 8U, 15U) + +/* receive data byte 2 */ +#define GET_RFIFOMDATA0_DB2(regval) GET_BITS((uint32_t)(regval), 16U, 23U) + +/* receive data byte 3 */ +#define GET_RFIFOMDATA0_DB3(regval) GET_BITS((uint32_t)(regval), 24U, 31U) + +/* receive data byte 4 */ +#define GET_RFIFOMDATA1_DB4(regval) GET_BITS((uint32_t)(regval), 0U, 7U) + +/* receive data byte 5 */ +#define GET_RFIFOMDATA1_DB5(regval) GET_BITS((uint32_t)(regval), 8U, 15U) + +/* receive data byte 6 */ +#define GET_RFIFOMDATA1_DB6(regval) GET_BITS((uint32_t)(regval), 16U, 23U) + +/* receive data byte 7 */ +#define GET_RFIFOMDATA1_DB7(regval) GET_BITS((uint32_t)(regval), 24U, 31U) + +/* error number */ +#define GET_ERR_ERRN(regval) GET_BITS((uint32_t)(regval), 4U, 6U) + +/* transmit error count */ +#define GET_ERR_TECNT(regval) GET_BITS((uint32_t)(regval), 16U, 23U) + +/* receive error count */ +#define GET_ERR_RECNT(regval) GET_BITS((uint32_t)(regval), 24U, 31U) + +/* CAN errors */ +#define ERR_ERRN(regval) (BITS(4,6) & ((uint32_t)(regval) << 4)) +#define CAN_ERRN_0 ERR_ERRN(0U) /*!< no error */ +#define CAN_ERRN_1 ERR_ERRN(1U) /*!< fill error */ +#define CAN_ERRN_2 ERR_ERRN(2U) /*!< format error */ +#define CAN_ERRN_3 ERR_ERRN(3U) /*!< ACK error */ +#define CAN_ERRN_4 ERR_ERRN(4U) /*!< bit recessive error */ +#define CAN_ERRN_5 ERR_ERRN(5U) /*!< bit dominant error */ +#define CAN_ERRN_6 ERR_ERRN(6U) /*!< CRC error */ +#define CAN_ERRN_7 ERR_ERRN(7U) /*!< software error */ + +#define CAN_STATE_PENDING ((uint32_t)0x00000000U) /*!< CAN pending */ + +/* CAN communication mode */ +#define CAN_NORMAL_MODE ((uint8_t)0x00U) /*!< normal communication mode */ +#define CAN_LOOPBACK_MODE ((uint8_t)0x01U) /*!< loopback communication mode */ +#define CAN_SILENT_MODE ((uint8_t)0x02U) /*!< silent communication mode */ +#define CAN_SILENT_LOOPBACK_MODE ((uint8_t)0x03U) /*!< loopback and silent communication mode */ + +/* CAN resynchronisation jump width */ +#define CAN_BT_SJW_1TQ ((uint8_t)0x00U) /*!< 1 time quanta */ +#define CAN_BT_SJW_2TQ ((uint8_t)0x01U) /*!< 2 time quanta */ +#define CAN_BT_SJW_3TQ ((uint8_t)0x02U) /*!< 3 time quanta */ +#define CAN_BT_SJW_4TQ ((uint8_t)0x03U) /*!< 4 time quanta */ + +/* CAN time segment 1 */ +#define CAN_BT_BS1_1TQ ((uint8_t)0x00U) /*!< 1 time quanta */ +#define CAN_BT_BS1_2TQ ((uint8_t)0x01U) /*!< 2 time quanta */ +#define CAN_BT_BS1_3TQ ((uint8_t)0x02U) /*!< 3 time quanta */ +#define CAN_BT_BS1_4TQ ((uint8_t)0x03U) /*!< 4 time quanta */ +#define CAN_BT_BS1_5TQ ((uint8_t)0x04U) /*!< 5 time quanta */ +#define CAN_BT_BS1_6TQ ((uint8_t)0x05U) /*!< 6 time quanta */ +#define CAN_BT_BS1_7TQ ((uint8_t)0x06U) /*!< 7 time quanta */ +#define CAN_BT_BS1_8TQ ((uint8_t)0x07U) /*!< 8 time quanta */ +#define CAN_BT_BS1_9TQ ((uint8_t)0x08U) /*!< 9 time quanta */ +#define CAN_BT_BS1_10TQ ((uint8_t)0x09U) /*!< 10 time quanta */ +#define CAN_BT_BS1_11TQ ((uint8_t)0x0AU) /*!< 11 time quanta */ +#define CAN_BT_BS1_12TQ ((uint8_t)0x0BU) /*!< 12 time quanta */ +#define CAN_BT_BS1_13TQ ((uint8_t)0x0CU) /*!< 13 time quanta */ +#define CAN_BT_BS1_14TQ ((uint8_t)0x0DU) /*!< 14 time quanta */ +#define CAN_BT_BS1_15TQ ((uint8_t)0x0EU) /*!< 15 time quanta */ +#define CAN_BT_BS1_16TQ ((uint8_t)0x0FU) /*!< 16 time quanta */ + +/* CAN time segment 2 */ +#define CAN_BT_BS2_1TQ ((uint8_t)0x00U) /*!< 1 time quanta */ +#define CAN_BT_BS2_2TQ ((uint8_t)0x01U) /*!< 2 time quanta */ +#define CAN_BT_BS2_3TQ ((uint8_t)0x02U) /*!< 3 time quanta */ +#define CAN_BT_BS2_4TQ ((uint8_t)0x03U) /*!< 4 time quanta */ +#define CAN_BT_BS2_5TQ ((uint8_t)0x04U) /*!< 5 time quanta */ +#define CAN_BT_BS2_6TQ ((uint8_t)0x05U) /*!< 6 time quanta */ +#define CAN_BT_BS2_7TQ ((uint8_t)0x06U) /*!< 7 time quanta */ +#define CAN_BT_BS2_8TQ ((uint8_t)0x07U) /*!< 8 time quanta */ + +/* CAN mailbox number */ +#define CAN_MAILBOX0 ((uint8_t)0x00U) /*!< mailbox0 */ +#define CAN_MAILBOX1 ((uint8_t)0x01U) /*!< mailbox1 */ +#define CAN_MAILBOX2 ((uint8_t)0x02U) /*!< mailbox2 */ +#define CAN_NOMAILBOX ((uint8_t)0x03U) /*!< no mailbox empty */ + +/* CAN frame format */ +#define CAN_FF_STANDARD ((uint32_t)0x00000000U) /*!< standard frame */ +#define CAN_FF_EXTENDED ((uint32_t)0x00000004U) /*!< extended frame */ + +/* CAN receive fifo */ +#define CAN_FIFO0 ((uint8_t)0x00U) /*!< receive FIFO0 */ +#define CAN_FIFO1 ((uint8_t)0x01U) /*!< receive FIFO1 */ + +/* frame number of receive fifo */ +#define CAN_RFIF_RFL_MASK ((uint32_t)0x00000003U) /*!< mask for frame number in receive FIFOx */ + +#define CAN_SFID_MASK ((uint32_t)0x000007FFU) /*!< mask of standard identifier */ +#define CAN_EFID_MASK ((uint32_t)0x1FFFFFFFU) /*!< mask of extended identifier */ + +/* CAN working mode */ +#define CAN_MODE_INITIALIZE ((uint8_t)0x01U) /*!< CAN initialize mode */ +#define CAN_MODE_NORMAL ((uint8_t)0x02U) /*!< CAN normal mode */ +#define CAN_MODE_SLEEP ((uint8_t)0x04U) /*!< CAN sleep mode */ + +/* filter bits */ +#define CAN_FILTERBITS_16BIT ((uint8_t)0x00U) /*!< CAN filter 16 bits */ +#define CAN_FILTERBITS_32BIT ((uint8_t)0x01U) /*!< CAN filter 32 bits */ + +/* filter mode */ +#define CAN_FILTERMODE_MASK ((uint8_t)0x00U) /*!< mask mode */ +#define CAN_FILTERMODE_LIST ((uint8_t)0x01U) /*!< list mode */ + +/* filter 16 bits mask */ +#define CAN_FILTER_MASK_16BITS ((uint32_t)0x0000FFFFU) /*!< can filter 16 bits mask */ + +/* frame type */ +#define CAN_FT_DATA ((uint32_t)0x00000000U) /*!< data frame */ +#define CAN_FT_REMOTE ((uint32_t)0x00000002U) /*!< remote frame */ + +/* CAN timeout */ +#define CAN_TIMEOUT ((uint32_t)0x0000FFFFU) /*!< timeout value */ + +/* interrupt enable bits */ +#define CAN_INT_TME CAN_INTEN_TMEIE /*!< transmit mailbox empty interrupt enable */ +#define CAN_INT_RFNE0 CAN_INTEN_RFNEIE0 /*!< receive FIFO0 not empty interrupt enable */ +#define CAN_INT_RFF0 CAN_INTEN_RFFIE0 /*!< receive FIFO0 full interrupt enable */ +#define CAN_INT_RFO0 CAN_INTEN_RFOIE0 /*!< receive FIFO0 overfull interrupt enable */ +#define CAN_INT_RFNE1 CAN_INTEN_RFNEIE1 /*!< receive FIFO1 not empty interrupt enable */ +#define CAN_INT_RFF1 CAN_INTEN_RFFIE1 /*!< receive FIFO1 full interrupt enable */ +#define CAN_INT_RFO1 CAN_INTEN_RFOIE1 /*!< receive FIFO1 overfull interrupt enable */ +#define CAN_INT_WERR CAN_INTEN_WERRIE /*!< warning error interrupt enable */ +#define CAN_INT_PERR CAN_INTEN_PERRIE /*!< passive error interrupt enable */ +#define CAN_INT_BO CAN_INTEN_BOIE /*!< bus-off interrupt enable */ +#define CAN_INT_ERRN CAN_INTEN_ERRNIE /*!< error number interrupt enable */ +#define CAN_INT_ERR CAN_INTEN_ERRIE /*!< error interrupt enable */ +#define CAN_INT_WAKEUP CAN_INTEN_WIE /*!< wakeup interrupt enable */ +#define CAN_INT_SLPW CAN_INTEN_SLPWIE /*!< sleep working interrupt enable */ + +/* function declarations */ +/* initialization functions */ +/* deinitialize CAN */ +void can_deinit(uint32_t can_periph); +/* initialize CAN structure */ +void can_struct_para_init(can_struct_type_enum type, void* p_struct); +/* initialize CAN */ +ErrStatus can_init(uint32_t can_periph, can_parameter_struct* can_parameter_init); +/* CAN filter initialization */ +void can_filter_init(can_filter_parameter_struct* can_filter_parameter_init); + +/* function configuration */ +/* set can1 filter start bank number */ +void can1_filter_start_bank(uint8_t start_bank); +/* enable functions */ +/* CAN debug freeze enable */ +void can_debug_freeze_enable(uint32_t can_periph); +/* CAN debug freeze disable */ +void can_debug_freeze_disable(uint32_t can_periph); +/* CAN time trigger mode enable */ +void can_time_trigger_mode_enable(uint32_t can_periph); +/* CAN time trigger mode disable */ +void can_time_trigger_mode_disable(uint32_t can_periph); + +/* transmit functions */ +/* transmit CAN message */ +uint8_t can_message_transmit(uint32_t can_periph, can_trasnmit_message_struct* transmit_message); +/* get CAN transmit state */ +can_transmit_state_enum can_transmit_states(uint32_t can_periph, uint8_t mailbox_number); +/* stop CAN transmission */ +void can_transmission_stop(uint32_t can_periph, uint8_t mailbox_number); +/* CAN receive message */ +void can_message_receive(uint32_t can_periph, uint8_t fifo_number, can_receive_message_struct* receive_message); +/* CAN release fifo */ +void can_fifo_release(uint32_t can_periph, uint8_t fifo_number); +/* CAN receive message length */ +uint8_t can_receive_message_length_get(uint32_t can_periph, uint8_t fifo_number); +/* CAN working mode */ +ErrStatus can_working_mode_set(uint32_t can_periph, uint8_t working_mode); +/* CAN wakeup from sleep mode */ +ErrStatus can_wakeup(uint32_t can_periph); + +/* CAN get error */ +can_error_enum can_error_get(uint32_t can_periph); +/* get CAN receive error number */ +uint8_t can_receive_error_number_get(uint32_t can_periph); +/* get CAN transmit error number */ +uint8_t can_transmit_error_number_get(uint32_t can_periph); + +/* interrupt & flag functions */ +/* CAN interrupt enable */ +void can_interrupt_enable(uint32_t can_periph, uint32_t interrupt); +/* CAN interrupt disable */ +void can_interrupt_disable(uint32_t can_periph, uint32_t interrupt); +/* CAN get flag state */ +FlagStatus can_flag_get(uint32_t can_periph, can_flag_enum flag); +/* CAN clear flag state */ +void can_flag_clear(uint32_t can_periph, can_flag_enum flag); +/* CAN get interrupt flag state */ +FlagStatus can_interrupt_flag_get(uint32_t can_periph, can_interrupt_flag_enum flag); +/* CAN clear interrupt flag state */ +void can_interrupt_flag_clear(uint32_t can_periph, can_interrupt_flag_enum flag); + +#endif /* GD32F10x_CAN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_crc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_crc.h new file mode 100644 index 0000000..bf8c66b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_crc.h @@ -0,0 +1,77 @@ +/*! + \file gd32f10x_crc.h + \brief definitions for the CRC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_CRC_H +#define GD32F10X_CRC_H + +#include "gd32f10x.h" + +/* CRC definitions */ +#define CRC CRC_BASE + +/* registers definitions */ +#define CRC_DATA REG32(CRC + 0x00U) /*!< CRC data register */ +#define CRC_FDATA REG32(CRC + 0x04U) /*!< CRC free data register */ +#define CRC_CTL REG32(CRC + 0x08U) /*!< CRC control register */ + +/* bits definitions */ +/* CRC_DATA */ +#define CRC_DATA_DATA BITS(0,31) /*!< CRC calculation result bits */ + +/* CRC_FDATA */ +#define CRC_FDATA_FDATA BITS(0,7) /*!< CRC free data bits */ + +/* CRC_CTL */ +#define CRC_CTL_RST BIT(0) /*!< CRC reset CRC_DATA register bit */ + +/* function declarations */ +/* deinit CRC calculation unit */ +void crc_deinit(void); + +/* reset data register to the value of initializaiton data register */ +void crc_data_register_reset(void); +/* read the value of the data register */ +uint32_t crc_data_register_read(void); + +/* read the value of the free data register */ +uint8_t crc_free_data_register_read(void); +/* write data to the free data register */ +void crc_free_data_register_write(uint8_t free_data); + +/* calculate the CRC value of a 32-bit data */ +uint32_t crc_single_data_calculate(uint32_t sdata); +/* calculate the CRC value of an array of 32-bit values */ +uint32_t crc_block_data_calculate(uint32_t array[], uint32_t size); + +#endif /* GD32F10X_CRC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dac.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dac.h new file mode 100644 index 0000000..787838f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dac.h @@ -0,0 +1,249 @@ +/*! + \file gd32f10x_dac.h + \brief definitions for the DAC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_DAC_H +#define GD32F10X_DAC_H + +#include "gd32f10x.h" + +/* DACx(x=0) definitions */ +#define DAC0 (DAC_BASE) + +/* registers definitions */ +#define DAC_CTL0(dacx) REG32((dacx) + 0x00000000U) /*!< DACx control register 0 */ +#define DAC_SWT(dacx) REG32((dacx) + 0x00000004U) /*!< DACx software trigger register */ + +#define DAC_OUT0_R12DH(dacx) REG32((dacx) + 0x00000008U) /*!< DACx_OUT0 12-bit right-aligned data holding register */ +#define DAC_OUT0_L12DH(dacx) REG32((dacx) + 0x0000000CU) /*!< DACx_OUT0 12-bit left-aligned data holding register */ +#define DAC_OUT0_R8DH(dacx) REG32((dacx) + 0x00000010U) /*!< DACx_OUT0 8-bit right-aligned data holding register */ +#define DAC_OUT1_R12DH(dacx) REG32((dacx) + 0x00000014U) /*!< DACx_OUT1 12-bit right-aligned data holding register */ +#define DAC_OUT1_L12DH(dacx) REG32((dacx) + 0x00000018U) /*!< DACx_OUT1 12-bit left-aligned data holding register */ +#define DAC_OUT1_R8DH(dacx) REG32((dacx) + 0x0000001CU) /*!< DACx_OUT1 8-bit right-aligned data holding register */ +#define DACC_R12DH(dacx) REG32((dacx) + 0x00000020U) /*!< DACx concurrent mode 12-bit right-aligned data holding register */ +#define DACC_L12DH(dacx) REG32((dacx) + 0x00000024U) /*!< DACx concurrent mode 12-bit left-aligned data holding register */ +#define DACC_R8DH(dacx) REG32((dacx) + 0x00000028U) /*!< DACx concurrent mode 8-bit right-aligned data holding register */ +#define DAC_OUT0_DO(dacx) REG32((dacx) + 0x0000002CU) /*!< DACx_OUT0 data output register */ +#define DAC_OUT1_DO(dacx) REG32((dacx) + 0x00000030U) /*!< DACx_OUT1 data output register */ + +/* bits definitions */ +/* DAC_CTL0 */ +#define DAC_CTL0_DEN0 BIT(0) /*!< DACx_OUT0 enable */ +#define DAC_CTL0_DBOFF0 BIT(1) /*!< DACx_OUT0 output buffer turn off */ +#define DAC_CTL0_DTEN0 BIT(2) /*!< DACx_OUT0 trigger enable */ +#define DAC_CTL0_DTSEL0 BITS(3,5) /*!< DACx_OUT0 trigger selection */ +#define DAC_CTL0_DWM0 BITS(6,7) /*!< DACx_OUT0 noise wave mode */ +#define DAC_CTL0_DWBW0 BITS(8,11) /*!< DACx_OUT0 noise wave bit width */ +#define DAC_CTL0_DDMAEN0 BIT(12) /*!< DACx_OUT0 DMA enable */ + +#define DAC_CTL0_DEN1 BIT(16) /*!< DACx_OUT1 enable */ +#define DAC_CTL0_DBOFF1 BIT(17) /*!< DACx_OUT1 output buffer turn off */ +#define DAC_CTL0_DTEN1 BIT(18) /*!< DACx_OUT1 trigger enable */ +#define DAC_CTL0_DTSEL1 BITS(19,21) /*!< DACx_OUT1 trigger selection */ +#define DAC_CTL0_DWM1 BITS(22,23) /*!< DACx_OUT1 noise wave mode */ +#define DAC_CTL0_DWBW1 BITS(24,27) /*!< DACx_OUT1 noise wave bit width */ +#define DAC_CTL0_DDMAEN1 BIT(28) /*!< DACx_OUT1 DMA enable */ + +/* DAC_SWT */ +#define DAC_SWT_SWTR0 BIT(0) /*!< DACx_OUT0 software trigger */ +#define DAC_SWT_SWTR1 BIT(1) /*!< DACx_OUT1 software trigger */ + +/* DAC_OUT0_R12DH */ +#define DAC_OUT0_DH_R12 BITS(0,11) /*!< DACx_OUT0 12-bit right-aligned data */ + +/* DAC_OUT0_L12DH */ +#define DAC_OUT0_DH_L12 BITS(4,15) /*!< DACx_OUT0 12-bit left-aligned data */ + +/* DAC_OUT0_R8DH */ +#define DAC_OUT0_DH_R8 BITS(0,7) /*!< DACx_OUT0 8-bit right-aligned data */ + +/* DAC_OUT1_R12DH */ +#define DAC_OUT1_DH_R12 BITS(0,11) /*!< DACx_OUT1 12-bit right-aligned data */ + +/* DAC_OUT1_L12DH */ +#define DAC_OUT1_DH_L12 BITS(4,15) /*!< DACx_OUT1 12-bit left-aligned data */ + +/* DAC_OUT1_R8DH */ +#define DAC_OUT1_DH_R8 BITS(0,7) /*!< DACx_OUT1 8-bit right-aligned data */ + +/* DACC_R12DH */ +#define DACC_OUT0_DH_R12 BITS(0,11) /*!< DAC concurrent mode DACx_OUT0 12-bit right-aligned data */ +#define DACC_OUT1_DH_R12 BITS(16,27) /*!< DAC concurrent mode DACx_OUT1 12-bit right-aligned data */ + +/* DACC_L12DH */ +#define DACC_OUT0_DH_L12 BITS(4,15) /*!< DAC concurrent mode DACx_OUT0 12-bit left-aligned data */ +#define DACC_OUT1_DH_L12 BITS(20,31) /*!< DAC concurrent mode DACx_OUT1 12-bit left-aligned data */ + +/* DACC_R8DH */ +#define DACC_OUT0_DH_R8 BITS(0,7) /*!< DAC concurrent mode DACx_OUT0 8-bit right-aligned data */ +#define DACC_OUT1_DH_R8 BITS(8,15) /*!< DAC concurrent mode DACx_OUT1 8-bit right-aligned data */ + +/* DAC_OUT0_DO */ +#define DAC_OUT0_DO_BITS BITS(0,11) /*!< DACx_OUT0 12-bit output data */ + +/* DAC_OUT1_DO */ +#define DAC_OUT1_DO_BITS BITS(0,11) /*!< DACx_OUT1 12-bit output data */ + +/* constants definitions */ +/* DAC trigger source */ +#define CTL0_DTSEL(regval) (BITS(3,5) & ((uint32_t)(regval) << 3)) +#define DAC_TRIGGER_T5_TRGO CTL0_DTSEL(0) /*!< TIMER5 TRGO */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define DAC_TRIGGER_T7_TRGO CTL0_DTSEL(1) /*!< TIMER7 TRGO */ +#elif defined(GD32F10X_CL) +#define DAC_TRIGGER_T2_TRGO CTL0_DTSEL(1) /*!< TIMER2 TRGO */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ +#define DAC_TRIGGER_T6_TRGO CTL0_DTSEL(2) /*!< TIMER6 TRGO */ +#define DAC_TRIGGER_T4_TRGO CTL0_DTSEL(3) /*!< TIMER4 TRGO */ +#define DAC_TRIGGER_T1_TRGO CTL0_DTSEL(4) /*!< TIMER1 TRGO */ +#define DAC_TRIGGER_T3_TRGO CTL0_DTSEL(5) /*!< TIMER3 TRGO */ +#define DAC_TRIGGER_EXTI_9 CTL0_DTSEL(6) /*!< EXTI interrupt line9 event */ +#define DAC_TRIGGER_SOFTWARE CTL0_DTSEL(7) /*!< software trigger */ + +/* DAC noise wave mode */ +#define CTL0_DWM(regval) (BITS(6,7) & ((uint32_t)(regval) << 6)) +#define DAC_WAVE_DISABLE CTL0_DWM(0) /*!< wave disabled */ +#define DAC_WAVE_MODE_LFSR CTL0_DWM(1) /*!< LFSR noise mode */ +#define DAC_WAVE_MODE_TRIANGLE CTL0_DWM(2) /*!< triangle noise mode */ + +/* DAC noise wave bit width */ +#define DWBW(regval) (BITS(8, 11) & ((uint32_t)(regval) << 8)) +#define DAC_WAVE_BIT_WIDTH_1 DWBW(0) /*!< bit width of the wave signal is 1 */ +#define DAC_WAVE_BIT_WIDTH_2 DWBW(1) /*!< bit width of the wave signal is 2 */ +#define DAC_WAVE_BIT_WIDTH_3 DWBW(2) /*!< bit width of the wave signal is 3 */ +#define DAC_WAVE_BIT_WIDTH_4 DWBW(3) /*!< bit width of the wave signal is 4 */ +#define DAC_WAVE_BIT_WIDTH_5 DWBW(4) /*!< bit width of the wave signal is 5 */ +#define DAC_WAVE_BIT_WIDTH_6 DWBW(5) /*!< bit width of the wave signal is 6 */ +#define DAC_WAVE_BIT_WIDTH_7 DWBW(6) /*!< bit width of the wave signal is 7 */ +#define DAC_WAVE_BIT_WIDTH_8 DWBW(7) /*!< bit width of the wave signal is 8 */ +#define DAC_WAVE_BIT_WIDTH_9 DWBW(8) /*!< bit width of the wave signal is 9 */ +#define DAC_WAVE_BIT_WIDTH_10 DWBW(9) /*!< bit width of the wave signal is 10 */ +#define DAC_WAVE_BIT_WIDTH_11 DWBW(10) /*!< bit width of the wave signal is 11 */ +#define DAC_WAVE_BIT_WIDTH_12 DWBW(11) /*!< bit width of the wave signal is 12 */ + +/* unmask LFSR bits in DAC LFSR noise mode */ +#define DAC_LFSR_BIT0 DAC_WAVE_BIT_WIDTH_1 /*!< unmask the LFSR bit0 */ +#define DAC_LFSR_BITS1_0 DAC_WAVE_BIT_WIDTH_2 /*!< unmask the LFSR bits[1:0] */ +#define DAC_LFSR_BITS2_0 DAC_WAVE_BIT_WIDTH_3 /*!< unmask the LFSR bits[2:0] */ +#define DAC_LFSR_BITS3_0 DAC_WAVE_BIT_WIDTH_4 /*!< unmask the LFSR bits[3:0] */ +#define DAC_LFSR_BITS4_0 DAC_WAVE_BIT_WIDTH_5 /*!< unmask the LFSR bits[4:0] */ +#define DAC_LFSR_BITS5_0 DAC_WAVE_BIT_WIDTH_6 /*!< unmask the LFSR bits[5:0] */ +#define DAC_LFSR_BITS6_0 DAC_WAVE_BIT_WIDTH_7 /*!< unmask the LFSR bits[6:0] */ +#define DAC_LFSR_BITS7_0 DAC_WAVE_BIT_WIDTH_8 /*!< unmask the LFSR bits[7:0] */ +#define DAC_LFSR_BITS8_0 DAC_WAVE_BIT_WIDTH_9 /*!< unmask the LFSR bits[8:0] */ +#define DAC_LFSR_BITS9_0 DAC_WAVE_BIT_WIDTH_10 /*!< unmask the LFSR bits[9:0] */ +#define DAC_LFSR_BITS10_0 DAC_WAVE_BIT_WIDTH_11 /*!< unmask the LFSR bits[10:0] */ +#define DAC_LFSR_BITS11_0 DAC_WAVE_BIT_WIDTH_12 /*!< unmask the LFSR bits[11:0] */ + +/* triangle amplitude in DAC triangle noise mode */ +#define DAC_TRIANGLE_AMPLITUDE_1 DAC_WAVE_BIT_WIDTH_1 /*!< triangle amplitude is 1 */ +#define DAC_TRIANGLE_AMPLITUDE_3 DAC_WAVE_BIT_WIDTH_2 /*!< triangle amplitude is 3 */ +#define DAC_TRIANGLE_AMPLITUDE_7 DAC_WAVE_BIT_WIDTH_3 /*!< triangle amplitude is 7 */ +#define DAC_TRIANGLE_AMPLITUDE_15 DAC_WAVE_BIT_WIDTH_4 /*!< triangle amplitude is 15 */ +#define DAC_TRIANGLE_AMPLITUDE_31 DAC_WAVE_BIT_WIDTH_5 /*!< triangle amplitude is 31 */ +#define DAC_TRIANGLE_AMPLITUDE_63 DAC_WAVE_BIT_WIDTH_6 /*!< triangle amplitude is 63 */ +#define DAC_TRIANGLE_AMPLITUDE_127 DAC_WAVE_BIT_WIDTH_7 /*!< triangle amplitude is 127 */ +#define DAC_TRIANGLE_AMPLITUDE_255 DAC_WAVE_BIT_WIDTH_8 /*!< triangle amplitude is 255 */ +#define DAC_TRIANGLE_AMPLITUDE_511 DAC_WAVE_BIT_WIDTH_9 /*!< triangle amplitude is 511 */ +#define DAC_TRIANGLE_AMPLITUDE_1023 DAC_WAVE_BIT_WIDTH_10 /*!< triangle amplitude is 1023 */ +#define DAC_TRIANGLE_AMPLITUDE_2047 DAC_WAVE_BIT_WIDTH_11 /*!< triangle amplitude is 2047 */ +#define DAC_TRIANGLE_AMPLITUDE_4095 DAC_WAVE_BIT_WIDTH_12 /*!< triangle amplitude is 4095 */ + +/* DAC data alignment */ +#define DATA_ALIGN(regval) (BITS(0,1) & ((uint32_t)(regval) << 0)) +#define DAC_ALIGN_12B_R DATA_ALIGN(0) /*!< 12-bit right-aligned data */ +#define DAC_ALIGN_12B_L DATA_ALIGN(1) /*!< 12-bit left-aligned data */ +#define DAC_ALIGN_8B_R DATA_ALIGN(2) /*!< 8-bit right-aligned data */ + +/* DAC output channel definitions */ +#define DAC_OUT0 ((uint8_t)0x00U) /*!< DACx_OUT0 channel */ +#define DAC_OUT1 ((uint8_t)0x01U) /*!< DACx_OUT1 channel */ + +/* function declarations */ +/* DAC initialization functions */ +/* deinitialize DAC */ +void dac_deinit(uint32_t dac_periph); +/* enable DAC */ +void dac_enable(uint32_t dac_periph, uint8_t dac_out); +/* disable DAC */ +void dac_disable(uint32_t dac_periph, uint8_t dac_out); +/* enable DAC DMA function */ +void dac_dma_enable(uint32_t dac_periph, uint8_t dac_out); +/* disable DAC DMA function */ +void dac_dma_disable(uint32_t dac_periph, uint8_t dac_out); + +/* DAC buffer functions */ +/* enable DAC output buffer */ +void dac_output_buffer_enable(uint32_t dac_periph, uint8_t dac_out); +/* disable DAC output buffer */ +void dac_output_buffer_disable(uint32_t dac_periph, uint8_t dac_out); + +/* read and write operation functions */ +/* get DAC output value */ +uint16_t dac_output_value_get(uint32_t dac_periph, uint8_t dac_out); +/* set DAC data holding register value */ +void dac_data_set(uint32_t dac_periph, uint8_t dac_out, uint32_t dac_align, uint16_t data); + +/* DAC trigger configuration */ +/* enable DAC trigger */ +void dac_trigger_enable(uint32_t dac_periph, uint8_t dac_out); +/* disable DAC trigger */ +void dac_trigger_disable(uint32_t dac_periph, uint8_t dac_out); +/* configure DAC trigger source */ +void dac_trigger_source_config(uint32_t dac_periph, uint8_t dac_out, uint32_t triggersource); +/* enable DAC software trigger */ +void dac_software_trigger_enable(uint32_t dac_periph, uint8_t dac_out); + +/* DAC wave mode configuration */ +/* configure DAC wave mode */ +void dac_wave_mode_config(uint32_t dac_periph, uint8_t dac_out, uint32_t wave_mode); +/* configure DAC LFSR noise mode */ +void dac_lfsr_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t unmask_bits); +/* configure DAC triangle noise mode */ +void dac_triangle_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t amplitude); + +/* DAC concurrent mode configuration */ +/* enable DAC concurrent mode */ +void dac_concurrent_enable(uint32_t dac_periph); +/* disable DAC concurrent mode */ +void dac_concurrent_disable(uint32_t dac_periph); +/* enable DAC concurrent software trigger */ +void dac_concurrent_software_trigger_enable(uint32_t dac_periph); +/* enable DAC concurrent buffer function */ +void dac_concurrent_output_buffer_enable(uint32_t dac_periph); +/* disable DAC concurrent buffer function */ +void dac_concurrent_output_buffer_disable(uint32_t dac_periph); +/* set DAC concurrent mode data holding register value */ +void dac_concurrent_data_set(uint32_t dac_periph, uint32_t dac_align, uint16_t data0, uint16_t data1); + +#endif /* GD32F10X_DAC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dbg.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dbg.h new file mode 100644 index 0000000..00095a4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dbg.h @@ -0,0 +1,148 @@ +/*! + \file gd32f10x_dbg.h + \brief definitions for the DBG + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_DBG_H +#define GD32F10X_DBG_H + +#include "gd32f10x.h" + +/* DBG definitions */ +#define DBG DBG_BASE + +/* registers definitions */ +#define DBG_ID REG32(DBG + 0x00U) /*!< DBG_ID code register */ +#define DBG_CTL REG32(DBG + 0x04U) /*!< DBG control register */ + +/* bits definitions */ +/* DBG_ID */ +#define DBG_ID_ID_CODE BITS(0,31) /*!< DBG ID code values */ + +/* DBG_CTL */ +#define DBG_CTL_SLP_HOLD BIT(0) /*!< keep debugger connection during sleep mode */ +#define DBG_CTL_DSLP_HOLD BIT(1) /*!< keep debugger connection during deepsleep mode */ +#define DBG_CTL_STB_HOLD BIT(2) /*!< keep debugger connection during standby mode */ +#define DBG_CTL_TRACE_IOEN BIT(5) /*!< enable trace pin assignment */ +#define DBG_CTL_TRACE_MODE BITS(6,7) /*!< trace pin mode selection */ +#define DBG_CTL_FWDGT_HOLD BIT(8) /*!< debug FWDGT kept when core is halted */ +#define DBG_CTL_WWDGT_HOLD BIT(9) /*!< debug WWDGT kept when core is halted */ +#define DBG_CTL_TIMER0_HOLD BIT(10) /*!< hold TIMER0 counter when core is halted */ +#define DBG_CTL_TIMER1_HOLD BIT(11) /*!< hold TIMER1 counter when core is halted */ +#define DBG_CTL_TIMER2_HOLD BIT(12) /*!< hold TIMER2 counter when core is halted */ +#define DBG_CTL_TIMER3_HOLD BIT(13) /*!< hold TIMER3 counter when core is halted */ +#define DBG_CTL_CAN0_HOLD BIT(14) /*!< debug CAN0 kept when core is halted */ +#define DBG_CTL_I2C0_HOLD BIT(15) /*!< hold I2C0 smbus when core is halted */ +#define DBG_CTL_I2C1_HOLD BIT(16) /*!< hold I2C1 smbus when core is halted */ +#define DBG_CTL_TIMER7_HOLD BIT(17) /*!< hold TIMER7 counter when core is halted */ +#define DBG_CTL_TIMER4_HOLD BIT(18) /*!< hold TIMER4 counter when core is halted */ +#define DBG_CTL_TIMER5_HOLD BIT(19) /*!< hold TIMER5 counter when core is halted */ +#define DBG_CTL_TIMER6_HOLD BIT(20) /*!< hold TIMER6 counter when core is halted */ +#ifdef GD32F10X_CL +#define DBG_CTL_CAN1_HOLD BIT(21) /*!< debug CAN1 kept when core is halted */ +#endif /* GD32F10X_CL */ +#ifdef GD32F10X_XD +#define DBG_CTL_TIMER11_HOLD BIT(25) /*!< hold TIMER11 counter when core is halted */ +#define DBG_CTL_TIMER12_HOLD BIT(26) /*!< hold TIMER12 counter when core is halted */ +#define DBG_CTL_TIMER13_HOLD BIT(27) /*!< hold TIMER13 counter when core is halted */ +#define DBG_CTL_TIMER8_HOLD BIT(28) /*!< hold TIMER8 counter when core is halted */ +#define DBG_CTL_TIMER9_HOLD BIT(29) /*!< hold TIMER9 counter when core is halted */ +#define DBG_CTL_TIMER10_HOLD BIT(30) /*!< hold TIMER10 counter when core is halted */ +#endif /* GD32F10X_XD */ + +/* constants definitions */ +/* debug hold when core is halted */ +typedef enum +{ + DBG_FWDGT_HOLD = BIT(8), /*!< debug FWDGT kept when core is halted */ + DBG_WWDGT_HOLD = BIT(9), /*!< debug WWDGT kept when core is halted */ + DBG_TIMER0_HOLD = BIT(10), /*!< hold TIMER0 counter when core is halted */ + DBG_TIMER1_HOLD = BIT(11), /*!< hold TIMER1 counter when core is halted */ + DBG_TIMER2_HOLD = BIT(12), /*!< hold TIMER2 counter when core is halted */ + DBG_TIMER3_HOLD = BIT(13), /*!< hold TIMER3 counter when core is halted */ + DBG_CAN0_HOLD = BIT(14), /*!< debug CAN0 kept when core is halted */ + DBG_I2C0_HOLD = BIT(15), /*!< hold I2C0 smbus when core is halted */ + DBG_I2C1_HOLD = BIT(16), /*!< hold I2C1 smbus when core is halted */ + DBG_TIMER7_HOLD = BIT(17), /*!< hold TIMER7 counter when core is halted */ + DBG_TIMER4_HOLD = BIT(18), /*!< hold TIMER4 counter when core is halted */ + DBG_TIMER5_HOLD = BIT(19), /*!< hold TIMER5 counter when core is halted */ + DBG_TIMER6_HOLD = BIT(20), /*!< hold TIMER6 counter when core is halted */ +#ifdef GD32F10X_CL + DBG_CAN1_HOLD = BIT(21), /*!< debug CAN1 kept when core is halted */ +#endif /* GD32F10X_CL */ +#if (defined(GD32F10X_XD) || defined(GD32F10X_CL)) + DBG_TIMER11_HOLD = BIT(25), /*!< hold TIMER11 counter when core is halted */ + DBG_TIMER12_HOLD = BIT(26), /*!< hold TIMER12 counter when core is halted */ + DBG_TIMER13_HOLD = BIT(27), /*!< hold TIMER13 counter when core is halted */ + DBG_TIMER8_HOLD = BIT(28), /*!< hold TIMER8 counter when core is halted */ + DBG_TIMER9_HOLD = BIT(29), /*!< hold TIMER9 counter when core is halted */ + DBG_TIMER10_HOLD = BIT(30), /*!< hold TIMER10 counter when core is halted */ +#endif /* GD32F10X_XD || GD32F10X_CL*/ +}dbg_periph_enum; + +/* DBG low power mode configurations */ +#define DBG_LOW_POWER_SLEEP DBG_CTL_SLP_HOLD /*!< keep debugger connection during sleep mode */ +#define DBG_LOW_POWER_DEEPSLEEP DBG_CTL_DSLP_HOLD /*!< keep debugger connection during deepsleep mode */ +#define DBG_LOW_POWER_STANDBY DBG_CTL_STB_HOLD /*!< keep debugger connection during standby mode */ + +/* DBG_CTL0_TRACE_MODE configurations */ +#define CTL_TRACE_MODE(regval) (BITS(6,7) & ((uint32_t)(regval) << 6U)) +#define TRACE_MODE_ASYNC CTL_TRACE_MODE(0) /*!< trace pin used for async mode */ +#define TRACE_MODE_SYNC_DATASIZE_1 CTL_TRACE_MODE(1) /*!< trace pin used for sync mode and data size is 1 */ +#define TRACE_MODE_SYNC_DATASIZE_2 CTL_TRACE_MODE(2) /*!< trace pin used for sync mode and data size is 2 */ +#define TRACE_MODE_SYNC_DATASIZE_4 CTL_TRACE_MODE(3) /*!< trace pin used for sync mode and data size is 4 */ + +/* function declarations */ +/* read DBG_ID code register */ +uint32_t dbg_id_get(void); + +/* low power behavior configuration */ +/* enable low power behavior when the MCU is in debug mode */ +void dbg_low_power_enable(uint32_t dbg_low_power); +/* disable low power behavior when the MCU is in debug mode */ +void dbg_low_power_disable(uint32_t dbg_low_power); + +/* peripheral behavior configuration */ +/* enable peripheral behavior when the MCU is in debug mode */ +void dbg_periph_enable(dbg_periph_enum dbg_periph); +/* disable peripheral behavior when the MCU is in debug mode */ +void dbg_periph_disable(dbg_periph_enum dbg_periph); + +/* trace pin assignment configuration */ +/* enable trace pin assignment */ +void dbg_trace_pin_enable(void); +/* disable trace pin assignment */ +void dbg_trace_pin_disable(void); +/* set trace pin mode */ +void dbg_trace_pin_mode_set(uint32_t trace_mode); + +#endif /* GD32F10X_DBG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dma.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dma.h new file mode 100644 index 0000000..e80bfa0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_dma.h @@ -0,0 +1,285 @@ +/*! + \file gd32f10x_dma.h + \brief definitions for the DMA + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_DMA_H +#define GD32F10X_DMA_H + +#include "gd32f10x.h" + +/* DMA definitions */ +#define DMA0 (DMA_BASE) /*!< DMA0 base address */ +#define DMA1 (DMA_BASE + 0x0400U) /*!< DMA1 base address */ + +/* registers definitions */ +#define DMA_INTF(dmax) REG32((dmax) + 0x00U) /*!< DMA interrupt flag register */ +#define DMA_INTC(dmax) REG32((dmax) + 0x04U) /*!< DMA interrupt flag clear register */ + +#define DMA_CH0CTL(dmax) REG32((dmax) + 0x08U) /*!< DMA channel 0 control register */ +#define DMA_CH0CNT(dmax) REG32((dmax) + 0x0CU) /*!< DMA channel 0 counter register */ +#define DMA_CH0PADDR(dmax) REG32((dmax) + 0x10U) /*!< DMA channel 0 peripheral base address register */ +#define DMA_CH0MADDR(dmax) REG32((dmax) + 0x14U) /*!< DMA channel 0 memory base address register */ + +#define DMA_CH1CTL(dmax) REG32((dmax) + 0x1CU) /*!< DMA channel 1 control register */ +#define DMA_CH1CNT(dmax) REG32((dmax) + 0x20U) /*!< DMA channel 1 counter register */ +#define DMA_CH1PADDR(dmax) REG32((dmax) + 0x24U) /*!< DMA channel 1 peripheral base address register */ +#define DMA_CH1MADDR(dmax) REG32((dmax) + 0x28U) /*!< DMA channel 1 memory base address register */ + +#define DMA_CH2CTL(dmax) REG32((dmax) + 0x30U) /*!< DMA channel 2 control register */ +#define DMA_CH2CNT(dmax) REG32((dmax) + 0x34U) /*!< DMA channel 2 counter register */ +#define DMA_CH2PADDR(dmax) REG32((dmax) + 0x38U) /*!< DMA channel 2 peripheral base address register */ +#define DMA_CH2MADDR(dmax) REG32((dmax) + 0x3CU) /*!< DMA channel 2 memory base address register */ + +#define DMA_CH3CTL(dmax) REG32((dmax) + 0x44U) /*!< DMA channel 3 control register */ +#define DMA_CH3CNT(dmax) REG32((dmax) + 0x48U) /*!< DMA channel 3 counter register */ +#define DMA_CH3PADDR(dmax) REG32((dmax) + 0x4CU) /*!< DMA channel 3 peripheral base address register */ +#define DMA_CH3MADDR(dmax) REG32((dmax) + 0x50U) /*!< DMA channel 3 memory base address register */ + +#define DMA_CH4CTL(dmax) REG32((dmax) + 0x58U) /*!< DMA channel 4 control register */ +#define DMA_CH4CNT(dmax) REG32((dmax) + 0x5CU) /*!< DMA channel 4 counter register */ +#define DMA_CH4PADDR(dmax) REG32((dmax) + 0x60U) /*!< DMA channel 4 peripheral base address register */ +#define DMA_CH4MADDR(dmax) REG32((dmax) + 0x64U) /*!< DMA channel 4 memory base address register */ + +#define DMA_CH5CTL(dmax) REG32((dmax) + 0x6CU) /*!< DMA channel 5 control register */ +#define DMA_CH5CNT(dmax) REG32((dmax) + 0x70U) /*!< DMA channel 5 counter register */ +#define DMA_CH5PADDR(dmax) REG32((dmax) + 0x74U) /*!< DMA channel 5 peripheral base address register */ +#define DMA_CH5MADDR(dmax) REG32((dmax) + 0x78U) /*!< DMA channel 5 memory base address register */ + +#define DMA_CH6CTL(dmax) REG32((dmax) + 0x80U) /*!< DMA channel 6 control register */ +#define DMA_CH6CNT(dmax) REG32((dmax) + 0x84U) /*!< DMA channel 6 counter register */ +#define DMA_CH6PADDR(dmax) REG32((dmax) + 0x88U) /*!< DMA channel 6 peripheral base address register */ +#define DMA_CH6MADDR(dmax) REG32((dmax) + 0x8CU) /*!< DMA channel 6 memory base address register */ + +/* bits definitions */ +/* DMA_INTF */ +#define DMA_INTF_GIF BIT(0) /*!< global interrupt flag of channel */ +#define DMA_INTF_FTFIF BIT(1) /*!< full transfer finish flag of channel */ +#define DMA_INTF_HTFIF BIT(2) /*!< half transfer finish flag of channel */ +#define DMA_INTF_ERRIF BIT(3) /*!< error flag of channel */ + +/* DMA_INTC */ +#define DMA_INTC_GIFC BIT(0) /*!< clear global interrupt flag of channel */ +#define DMA_INTC_FTFIFC BIT(1) /*!< clear transfer finish flag of channel */ +#define DMA_INTC_HTFIFC BIT(2) /*!< clear half transfer finish flag of channel */ +#define DMA_INTC_ERRIFC BIT(3) /*!< clear error flag of channel */ + +/* DMA_CHxCTL, x=0..6 */ +#define DMA_CHXCTL_CHEN BIT(0) /*!< channel enable */ +#define DMA_CHXCTL_FTFIE BIT(1) /*!< enable bit for channel full transfer finish interrupt */ +#define DMA_CHXCTL_HTFIE BIT(2) /*!< enable bit for channel half transfer finish interrupt */ +#define DMA_CHXCTL_ERRIE BIT(3) /*!< enable bit for channel error interrupt */ +#define DMA_CHXCTL_DIR BIT(4) /*!< transfer direction */ +#define DMA_CHXCTL_CMEN BIT(5) /*!< circular mode enable */ +#define DMA_CHXCTL_PNAGA BIT(6) /*!< next address generation algorithm of peripheral */ +#define DMA_CHXCTL_MNAGA BIT(7) /*!< next address generation algorithm of memory */ +#define DMA_CHXCTL_PWIDTH BITS(8,9) /*!< transfer data width of peripheral */ +#define DMA_CHXCTL_MWIDTH BITS(10,11) /*!< transfer data width of memory */ +#define DMA_CHXCTL_PRIO BITS(12,13) /*!< priority level */ +#define DMA_CHXCTL_M2M BIT(14) /*!< memory to memory mode */ + +/* DMA_CHxCNT, x=0..6 */ +#define DMA_CHXCNT_CNT BITS(0,15) /*!< transfer counter */ + +/* DMA_CHxPADDR, x=0..6 */ +#define DMA_CHXPADDR_PADDR BITS(0,31) /*!< peripheral base address */ + +/* DMA_CHxMADDR, x=0..6 */ +#define DMA_CHXMADDR_MADDR BITS(0,31) /*!< memory base address */ + +/* constants definitions */ +/* DMA channel select */ +typedef enum +{ + DMA_CH0 = 0, /*!< DMA channel 0 */ + DMA_CH1, /*!< DMA channel 1 */ + DMA_CH2, /*!< DMA channel 2 */ + DMA_CH3, /*!< DMA channel 3 */ + DMA_CH4, /*!< DMA channel 4 */ + DMA_CH5, /*!< DMA channel 5 */ + DMA_CH6 /*!< DMA channel 6 */ +} dma_channel_enum; + +/* DMA initialize struct */ +typedef struct +{ + uint32_t periph_addr; /*!< peripheral base address */ + uint32_t periph_width; /*!< transfer data size of peripheral */ + uint32_t memory_addr; /*!< memory base address */ + uint32_t memory_width; /*!< transfer data size of memory */ + uint32_t number; /*!< channel transfer number */ + uint32_t priority; /*!< channel priority level */ + uint8_t periph_inc; /*!< peripheral increasing mode */ + uint8_t memory_inc; /*!< memory increasing mode */ + uint8_t direction; /*!< channel data transfer direction */ + +} dma_parameter_struct; + +#define DMA_FLAG_ADD(flag, shift) ((flag) << ((shift) * 4U)) /*!< DMA channel flag shift */ + +/* DMA_register address */ +#define DMA_CHCTL(dma, channel) REG32(((dma) + 0x08U) + 0x14U * (uint32_t)(channel)) /*!< the address of DMA channel CHXCTL register */ +#define DMA_CHCNT(dma, channel) REG32(((dma) + 0x0CU) + 0x14U * (uint32_t)(channel)) /*!< the address of DMA channel CHXCNT register */ +#define DMA_CHPADDR(dma, channel) REG32(((dma) + 0x10U) + 0x14U * (uint32_t)(channel)) /*!< the address of DMA channel CHXPADDR register */ +#define DMA_CHMADDR(dma, channel) REG32(((dma) + 0x14U) + 0x14U * (uint32_t)(channel)) /*!< the address of DMA channel CHXMADDR register */ + +/* DMA reset value */ +#define DMA_CHCTL_RESET_VALUE ((uint32_t)0x00000000U) /*!< the reset value of DMA channel CHXCTL register */ +#define DMA_CHCNT_RESET_VALUE ((uint32_t)0x00000000U) /*!< the reset value of DMA channel CHXCNT register */ +#define DMA_CHPADDR_RESET_VALUE ((uint32_t)0x00000000U) /*!< the reset value of DMA channel CHXPADDR register */ +#define DMA_CHMADDR_RESET_VALUE ((uint32_t)0x00000000U) /*!< the reset value of DMA channel CHXMADDR register */ +#define DMA_CHINTF_RESET_VALUE (DMA_INTF_GIF | DMA_INTF_FTFIF | \ + DMA_INTF_HTFIF | DMA_INTF_ERRIF) /*!< clear DMA channel DMA_INTF register */ + +/* DMA_INTF register */ +/* interrupt flag bits */ +#define DMA_INT_FLAG_G DMA_INTF_GIF /*!< global interrupt flag of channel */ +#define DMA_INT_FLAG_FTF DMA_INTF_FTFIF /*!< full transfer finish interrupt flag of channel */ +#define DMA_INT_FLAG_HTF DMA_INTF_HTFIF /*!< half transfer finish interrupt flag of channel */ +#define DMA_INT_FLAG_ERR DMA_INTF_ERRIF /*!< error interrupt flag of channel */ + +/* flag bits */ +#define DMA_FLAG_G DMA_INTF_GIF /*!< global interrupt flag of channel */ +#define DMA_FLAG_FTF DMA_INTF_FTFIF /*!< full transfer finish flag of channel */ +#define DMA_FLAG_HTF DMA_INTF_HTFIF /*!< half transfer finish flag of channel */ +#define DMA_FLAG_ERR DMA_INTF_ERRIF /*!< error flag of channel */ + +/* DMA_CHxCTL register */ +/* interrupt enable bits */ +#define DMA_INT_FTF DMA_CHXCTL_FTFIE /*!< enable bit for channel full transfer finish interrupt */ +#define DMA_INT_HTF DMA_CHXCTL_HTFIE /*!< enable bit for channel half transfer finish interrupt */ +#define DMA_INT_ERR DMA_CHXCTL_ERRIE /*!< enable bit for channel error interrupt */ + +/* transfer direction */ +#define DMA_PERIPHERAL_TO_MEMORY ((uint8_t)0x00U) /*!< read from peripheral and write to memory */ +#define DMA_MEMORY_TO_PERIPHERAL ((uint8_t)0x01U) /*!< read from memory and write to peripheral */ +/* circular mode */ +#define DMA_CIRCULAR_MODE_DISABLE ((uint32_t)0x00000000U) /*!< circular mode disable */ +#define DMA_CIRCULAR_MODE_ENABLE ((uint32_t)0x00000001U) /*!< circular mode enable */ + +/* peripheral increasing mode */ +#define DMA_PERIPH_INCREASE_DISABLE ((uint8_t)0x00U) /*!< next address of peripheral is fixed address mode */ +#define DMA_PERIPH_INCREASE_ENABLE ((uint8_t)0x01U) /*!< next address of peripheral is increasing address mode */ + +/* memory increasing mode */ +#define DMA_MEMORY_INCREASE_DISABLE ((uint8_t)0x00U) /*!< next address of memory is fixed address mode */ +#define DMA_MEMORY_INCREASE_ENABLE ((uint8_t)0x01U) /*!< next address of memory is increasing address mode */ + +/* transfer data size of peripheral */ +#define CHCTL_PWIDTH(regval) (BITS(8,9) & ((regval) << 8)) /*!< transfer data size of peripheral */ +#define DMA_PERIPHERAL_WIDTH_8BIT CHCTL_PWIDTH(0U) /*!< transfer data size of peripheral is 8-bit */ +#define DMA_PERIPHERAL_WIDTH_16BIT CHCTL_PWIDTH(1U) /*!< transfer data size of peripheral is 16-bit */ +#define DMA_PERIPHERAL_WIDTH_32BIT CHCTL_PWIDTH(2U) /*!< transfer data size of peripheral is 32-bit */ + +/* transfer data size of memory */ +#define CHCTL_MWIDTH(regval) (BITS(10,11) & ((regval) << 10)) /*!< transfer data size of memory */ +#define DMA_MEMORY_WIDTH_8BIT CHCTL_MWIDTH(0U) /*!< transfer data size of memory is 8-bit */ +#define DMA_MEMORY_WIDTH_16BIT CHCTL_MWIDTH(1U) /*!< transfer data size of memory is 16-bit */ +#define DMA_MEMORY_WIDTH_32BIT CHCTL_MWIDTH(2U) /*!< transfer data size of memory is 32-bit */ + +/* channel priority level */ +#define CHCTL_PRIO(regval) (BITS(12,13) & ((regval) << 12)) /*!< DMA channel priority level */ +#define DMA_PRIORITY_LOW CHCTL_PRIO(0U) /*!< low priority */ +#define DMA_PRIORITY_MEDIUM CHCTL_PRIO(1U) /*!< medium priority */ +#define DMA_PRIORITY_HIGH CHCTL_PRIO(2U) /*!< high priority */ +#define DMA_PRIORITY_ULTRA_HIGH CHCTL_PRIO(3U) /*!< ultra high priority */ + +/* memory to memory mode */ +#define DMA_MEMORY_TO_MEMORY_DISABLE ((uint32_t)0x00000000U) /*!< disable memory to memory mode */ +#define DMA_MEMORY_TO_MEMORY_ENABLE ((uint32_t)0x00000001U) /*!< enable memory to memory mode */ + +/* DMA_CHxCNT register */ +/* transfer counter */ +#define DMA_CHANNEL_CNT_MASK DMA_CHXCNT_CNT /*!< transfer counter mask */ + +/* function declarations */ +/* DMA deinitialization and initialization functions */ +/* deinitialize DMA a channel registers */ +void dma_deinit(uint32_t dma_periph, dma_channel_enum channelx); +/* initialize the parameters of DMA struct with the default values */ +void dma_struct_para_init(dma_parameter_struct* init_struct); +/* initialize DMA channel */ +void dma_init(uint32_t dma_periph, dma_channel_enum channelx, dma_parameter_struct *init_struct); +/* enable DMA circulation mode */ +void dma_circulation_enable(uint32_t dma_periph, dma_channel_enum channelx); +/* disable DMA circulation mode */ +void dma_circulation_disable(uint32_t dma_periph, dma_channel_enum channelx); +/* enable memory to memory mode */ +void dma_memory_to_memory_enable(uint32_t dma_periph, dma_channel_enum channelx); +/* disable memory to memory mode */ +void dma_memory_to_memory_disable(uint32_t dma_periph, dma_channel_enum channelx); +/* enable DMA channel */ +void dma_channel_enable(uint32_t dma_periph, dma_channel_enum channelx); +/* disable DMA channel */ +void dma_channel_disable(uint32_t dma_periph, dma_channel_enum channelx); + +/* DMA configuration functions */ +/* set DMA peripheral base address */ +void dma_periph_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address); +/* set DMA memory base address */ +void dma_memory_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address); +/* set the number of remaining data to be transferred by the DMA */ +void dma_transfer_number_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t number); +/* get the number of remaining data to be transferred by the DMA */ +uint32_t dma_transfer_number_get(uint32_t dma_periph, dma_channel_enum channelx); +/* configure priority level of DMA channel */ +void dma_priority_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t priority); +/* configure transfer data size of memory */ +void dma_memory_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t mwidth); +/* configure transfer data size of peripheral */ +void dma_periph_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t pwidth); +/* enable next address increasement algorithm of memory */ +void dma_memory_increase_enable(uint32_t dma_periph, dma_channel_enum channelx); +/* disable next address increasement algorithm of memory */ +void dma_memory_increase_disable(uint32_t dma_periph, dma_channel_enum channelx); +/* enable next address increasement algorithm of peripheral */ +void dma_periph_increase_enable(uint32_t dma_periph, dma_channel_enum channelx); +/* disable next address increasement algorithm of peripheral */ +void dma_periph_increase_disable(uint32_t dma_periph, dma_channel_enum channelx); +/* configure the direction of data transfer on the channel */ +void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint8_t direction); + +/* flag and interrupt functions */ +/* check DMA flag is set or not */ +FlagStatus dma_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag); +/* clear the flag of a DMA channel */ +void dma_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag); +/* check DMA flag and interrupt enable bit is set or not */ +FlagStatus dma_interrupt_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag); +/* clear the interrupt flag of a DMA channel */ +void dma_interrupt_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag); +/* enable DMA interrupt */ +void dma_interrupt_enable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source); +/* disable DMA interrupt */ +void dma_interrupt_disable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source); + +#endif /* GD32F10X_DMA_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_enet.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_enet.h new file mode 100644 index 0000000..be14eab --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_enet.h @@ -0,0 +1,1494 @@ +/*! + \file gd32f10x_enet.h + \brief definitions for the ENET + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10x_ENET_H +#define GD32F10x_ENET_H + +#include "gd32f10x.h" +#include + +#define IF_USE_EXTERNPHY_LIB 0 +#if (1 == IF_USE_EXTERNPHY_LIB) +#include "phy.h" +#endif + +#ifndef ENET_RXBUF_NUM +#define ENET_RXBUF_NUM 5U /*!< ethernet Rx DMA descriptor number */ +#endif + +#ifndef ENET_TXBUF_NUM +#define ENET_TXBUF_NUM 5U /*!< ethernet Tx DMA descriptor number */ +#endif + +#ifndef ENET_RXBUF_SIZE +#define ENET_RXBUF_SIZE ENET_MAX_FRAME_SIZE /*!< ethernet receive buffer size */ +#endif + +#ifndef ENET_TXBUF_SIZE +#define ENET_TXBUF_SIZE ENET_MAX_FRAME_SIZE /*!< ethernet transmit buffer size */ +#endif + +/* #define USE_DELAY */ + +#ifndef _PHY_H_ +#define DP83848 0 +#define LAN8700 1 +#define PHY_TYPE DP83848 + +#define PHY_ADDRESS ((uint16_t)1U) /*!< phy address determined by the hardware */ + +/* PHY read write timeouts */ +#define PHY_READ_TO ((uint32_t)0x0004FFFFU) /*!< PHY read timeout */ +#define PHY_WRITE_TO ((uint32_t)0x0004FFFFU) /*!< PHY write timeout */ + +/* PHY delay */ +#define PHY_RESETDELAY ((uint32_t)0x008FFFFFU) /*!< PHY reset delay */ +#define PHY_CONFIGDELAY ((uint32_t)0x00FFFFFFU) /*!< PHY configure delay */ + +/* PHY register address */ +#define PHY_REG_BCR 0U /*!< tranceiver basic control register */ +#define PHY_REG_BSR 1U /*!< tranceiver basic status register */ + +/* PHY basic control register */ +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< enable phy loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< configure speed to 100 Mbit/s and the full-duplex mode */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< configure speed to 100 Mbit/s and the half-duplex mode */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< configure speed to 10 Mbit/s and the full-duplex mode */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< configure speed to 10 Mbit/s and the half-duplex mode */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< enable the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< isolate PHY from MII */ + +/* PHY basic status register */ +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< auto-negotioation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< jabber condition detected */ + +#if(PHY_TYPE == LAN8700) +#define PHY_SR 31U /*!< tranceiver status register */ +#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< configured information of speed: 10Mbit/s */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< configured information of duplex: full-duplex */ +#elif(PHY_TYPE == DP83848) +#define PHY_SR 16U /*!< tranceiver status register */ +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< configured information of speed: 10Mbit/s */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< configured information of duplex: full-duplex */ +#endif /* PHY_TYPE */ + +#endif /* _PHY_H_ */ + + +/* ENET definitions */ +#define ENET ENET_BASE + +/* registers definitions */ +#define ENET_MAC_CFG REG32((ENET) + 0x00U) /*!< ethernet MAC configuration register */ +#define ENET_MAC_FRMF REG32((ENET) + 0x04U) /*!< ethernet MAC frame filter register */ +#define ENET_MAC_HLH REG32((ENET) + 0x08U) /*!< ethernet MAC hash list high register */ +#define ENET_MAC_HLL REG32((ENET) + 0x0CU) /*!< ethernet MAC hash list low register */ +#define ENET_MAC_PHY_CTL REG32((ENET) + 0x10U) /*!< ethernet MAC PHY control register */ +#define ENET_MAC_PHY_DATA REG32((ENET) + 0x14U) /*!< ethernet MAC PHY data register */ +#define ENET_MAC_FCTL REG32((ENET) + 0x18U) /*!< ethernet MAC flow control register */ +#define ENET_MAC_FCTH REG32((ENET) + 0x1080U) /*!< ethernet MAC flow control threshold register */ +#define ENET_MAC_VLT REG32((ENET) + 0x1CU) /*!< ethernet MAC VLAN tag register */ +#define ENET_MAC_RWFF REG32((ENET) + 0x28U) /*!< ethernet MAC remote wakeup frame filter register */ +#define ENET_MAC_WUM REG32((ENET) + 0x2CU) /*!< ethernet MAC wakeup management register */ +#define ENET_MAC_INTF REG32((ENET) + 0x38U) /*!< ethernet MAC interrupt flag register */ +#define ENET_MAC_INTMSK REG32((ENET) + 0x3CU) /*!< ethernet MAC interrupt mask register */ +#define ENET_MAC_ADDR0H REG32((ENET) + 0x40U) /*!< ethernet MAC address 0 high register */ +#define ENET_MAC_ADDR0L REG32((ENET) + 0x44U) /*!< ethernet MAC address 0 low register */ +#define ENET_MAC_ADDR1H REG32((ENET) + 0x48U) /*!< ethernet MAC address 1 high register */ +#define ENET_MAC_ADDR1L REG32((ENET) + 0x4CU) /*!< ethernet MAC address 1 low register */ +#define ENET_MAC_ADDT2H REG32((ENET) + 0x50U) /*!< ethernet MAC address 2 high register */ +#define ENET_MAC_ADDR2L REG32((ENET) + 0x54U) /*!< ethernet MAC address 2 low register */ +#define ENET_MAC_ADDR3H REG32((ENET) + 0x58U) /*!< ethernet MAC address 3 high register */ +#define ENET_MAC_ADDR3L REG32((ENET) + 0x5CU) /*!< ethernet MAC address 3 low register */ + +#define ENET_MSC_CTL REG32((ENET) + 0x100U) /*!< ethernet MSC control register */ +#define ENET_MSC_RINTF REG32((ENET) + 0x104U) /*!< ethernet MSC receive interrupt flag register */ +#define ENET_MSC_TINTF REG32((ENET) + 0x108U) /*!< ethernet MSC transmit interrupt flag register */ +#define ENET_MSC_RINTMSK REG32((ENET) + 0x10CU) /*!< ethernet MSC receive interrupt mask register */ +#define ENET_MSC_TINTMSK REG32((ENET) + 0x110U) /*!< ethernet MSC transmit interrupt mask register */ +#define ENET_MSC_SCCNT REG32((ENET) + 0x14CU) /*!< ethernet MSC transmitted good frames after a single collision counter register */ +#define ENET_MSC_MSCCNT REG32((ENET) + 0x150U) /*!< ethernet MSC transmitted good frames after more than a single collision counter register */ +#define ENET_MSC_TGFCNT REG32((ENET) + 0x168U) /*!< ethernet MSC transmitted good frames counter register */ +#define ENET_MSC_RFCECNT REG32((ENET) + 0x194U) /*!< ethernet MSC received frames with CRC error counter register */ +#define ENET_MSC_RFAECNT REG32((ENET) + 0x198U) /*!< ethernet MSC received frames with alignment error counter register */ +#define ENET_MSC_RGUFCNT REG32((ENET) + 0x1C4U) /*!< ethernet MSC received good unicast frames counter register */ + +#define ENET_PTP_TSCTL REG32((ENET) + 0x700U) /*!< ethernet PTP time stamp control register */ +#define ENET_PTP_SSINC REG32((ENET) + 0x704U) /*!< ethernet PTP subsecond increment register */ +#define ENET_PTP_TSH REG32((ENET) + 0x708U) /*!< ethernet PTP time stamp high register */ +#define ENET_PTP_TSL REG32((ENET) + 0x70CU) /*!< ethernet PTP time stamp low register */ +#define ENET_PTP_TSUH REG32((ENET) + 0x710U) /*!< ethernet PTP time stamp update high register */ +#define ENET_PTP_TSUL REG32((ENET) + 0x714U) /*!< ethernet PTP time stamp update low register */ +#define ENET_PTP_TSADDEND REG32((ENET) + 0x718U) /*!< ethernet PTP time stamp addend register */ +#define ENET_PTP_ETH REG32((ENET) + 0x71CU) /*!< ethernet PTP expected time high register */ +#define ENET_PTP_ETL REG32((ENET) + 0x720U) /*!< ethernet PTP expected time low register */ + +#define ENET_DMA_BCTL REG32((ENET) + 0x1000U) /*!< ethernet DMA bus control register */ +#define ENET_DMA_TPEN REG32((ENET) + 0x1004U) /*!< ethernet DMA transmit poll enable register */ +#define ENET_DMA_RPEN REG32((ENET) + 0x1008U) /*!< ethernet DMA receive poll enable register */ +#define ENET_DMA_RDTADDR REG32((ENET) + 0x100CU) /*!< ethernet DMA receive descriptor table address register */ +#define ENET_DMA_TDTADDR REG32((ENET) + 0x1010U) /*!< ethernet DMA transmit descriptor table address register */ +#define ENET_DMA_STAT REG32((ENET) + 0x1014U) /*!< ethernet DMA status register */ +#define ENET_DMA_CTL REG32((ENET) + 0x1018U) /*!< ethernet DMA control register */ +#define ENET_DMA_INTEN REG32((ENET) + 0x101CU) /*!< ethernet DMA interrupt enable register */ +#define ENET_DMA_MFBOCNT REG32((ENET) + 0x1020U) /*!< ethernet DMA missed frame and buffer overflow counter register */ +#define ENET_DMA_CTDADDR REG32((ENET) + 0x1048U) /*!< ethernet DMA current transmit descriptor address register */ +#define ENET_DMA_CRDADDR REG32((ENET) + 0x104CU) /*!< ethernet DMA current receive descriptor address register */ +#define ENET_DMA_CTBADDR REG32((ENET) + 0x1050U) /*!< ethernet DMA current transmit buffer address register */ +#define ENET_DMA_CRBADDR REG32((ENET) + 0x1054U) /*!< ethernet DMA current receive buffer address register */ + +/* bits definitions */ +/* ENET_MAC_CFG */ +#define ENET_MAC_CFG_REN BIT(2) /*!< receiver enable */ +#define ENET_MAC_CFG_TEN BIT(3) /*!< transmitter enable */ +#define ENET_MAC_CFG_DFC BIT(4) /*!< defferal check */ +#define ENET_MAC_CFG_BOL BITS(5,6) /*!< back-off limit */ +#define ENET_MAC_CFG_APCD BIT(7) /*!< automatic pad/CRC drop */ +#define ENET_MAC_CFG_RTD BIT(9) /*!< retry disable */ +#define ENET_MAC_CFG_IPFCO BIT(10) /*!< IP frame checksum offload */ +#define ENET_MAC_CFG_DPM BIT(11) /*!< duplex mode */ +#define ENET_MAC_CFG_LBM BIT(12) /*!< loopback mode */ +#define ENET_MAC_CFG_ROD BIT(13) /*!< receive own disable */ +#define ENET_MAC_CFG_SPD BIT(14) /*!< fast eneternet speed */ +#define ENET_MAC_CFG_CSD BIT(16) /*!< carrier sense disable */ +#define ENET_MAC_CFG_IGBS BITS(17,19) /*!< inter-frame gap bit selection */ +#define ENET_MAC_CFG_JBD BIT(22) /*!< jabber disable */ +#define ENET_MAC_CFG_WDD BIT(23) /*!< watchdog disable */ + +/* ENET_MAC_FRMF */ +#define ENET_MAC_FRMF_PM BIT(0) /*!< promiscuous mode */ +#define ENET_MAC_FRMF_HUF BIT(1) /*!< hash unicast filter */ +#define ENET_MAC_FRMF_HMF BIT(2) /*!< hash multicast filter */ +#define ENET_MAC_FRMF_DAIFLT BIT(3) /*!< destination address inverse filtering enable */ +#define ENET_MAC_FRMF_MFD BIT(4) /*!< multicast filter disable */ +#define ENET_MAC_FRMF_BFRMD BIT(5) /*!< broadcast frame disable */ +#define ENET_MAC_FRMF_PCFRM BITS(6,7) /*!< pass control frames */ +#define ENET_MAC_FRMF_SAIFLT BIT(8) /*!< source address inverse filtering */ +#define ENET_MAC_FRMF_SAFLT BIT(9) /*!< source address filter */ +#define ENET_MAC_FRMF_HPFLT BIT(10) /*!< hash or perfect filter */ +#define ENET_MAC_FRMF_FAR BIT(31) /*!< frames all receive */ + +/* ENET_MAC_HLH */ +#define ENET_MAC_HLH_HLH BITS(0,31) /*!< hash list high */ + +/* ENET_MAC_HLL */ +#define ENET_MAC_HLL_HLL BITS(0,31) /*!< hash list low */ + +/* ENET_MAC_PHY_CTL */ +#define ENET_MAC_PHY_CTL_PB BIT(0) /*!< PHY busy */ +#define ENET_MAC_PHY_CTL_PW BIT(1) /*!< PHY write */ +#define ENET_MAC_PHY_CTL_CLR BITS(2,4) /*!< clock range */ +#define ENET_MAC_PHY_CTL_PR BITS(6,10) /*!< PHY register */ +#define ENET_MAC_PHY_CTL_PA BITS(11,15) /*!< PHY address */ + +/* ENET_MAC_PHY_DATA */ +#define ENET_MAC_PHY_DATA_PD BITS(0,15) /*!< PHY data */ + +/* ENET_MAC_FCTL */ +#define ENET_MAC_FCTL_FLCBBKPA BIT(0) /*!< flow control busy(in full duplex mode)/backpressure activate(in half duplex mode) */ +#define ENET_MAC_FCTL_TFCEN BIT(1) /*!< transmit flow control enable */ +#define ENET_MAC_FCTL_RFCEN BIT(2) /*!< receive flow control enable */ +#define ENET_MAC_FCTL_UPFDT BIT(3) /*!< unicast pause frame detect */ +#define ENET_MAC_FCTL_PLTS BITS(4,5) /*!< pause low threshold */ +#define ENET_MAC_FCTL_DZQP BIT(7) /*!< disable zero-quanta pause */ +#define ENET_MAC_FCTL_PTM BITS(16,31) /*!< pause time */ + +/* ENET_MAC_FCTH */ +#define ENET_MAC_FCTH_RFA BITS(0,2) /*!< threshold of active flow control */ +#define ENET_MAC_FCTH_RFD BITS(4,6) /*!< threshold of deactive flow control */ + +/* ENET_MAC_VLT */ +#define ENET_MAC_VLT_VLTI BITS(0,15) /*!< VLAN tag identifier(for receive frames) */ +#define ENET_MAC_VLT_VLTC BIT(16) /*!< 12-bit VLAN tag comparison */ + +/* ENET_MAC_RWFF */ +#define ENET_MAC_RWFF_DATA BITS(0,31) /*!< wakeup frame filter register data */ + +/* ENET_MAC_WUM */ +#define ENET_MAC_WUM_PWD BIT(0) /*!< power down */ +#define ENET_MAC_WUM_MPEN BIT(1) /*!< magic packet enable */ +#define ENET_MAC_WUM_WFEN BIT(2) /*!< wakeup frame enable */ +#define ENET_MAC_WUM_MPKR BIT(5) /*!< magic packet received */ +#define ENET_MAC_WUM_WUFR BIT(6) /*!< wakeup frame received */ +#define ENET_MAC_WUM_GU BIT(9) /*!< global unicast */ +#define ENET_MAC_WUM_WUFFRPR BIT(31) /*!< wakeup frame filter register pointer reset */ + +/* ENET_MAC_INTF */ +#define ENET_MAC_INTF_WUM BIT(3) /*!< WUM status */ +#define ENET_MAC_INTF_MSC BIT(4) /*!< MSC status */ +#define ENET_MAC_INTF_MSCR BIT(5) /*!< MSC receive status */ +#define ENET_MAC_INTF_MSCT BIT(6) /*!< MSC transmit status */ +#define ENET_MAC_INTF_TMST BIT(9) /*!< timestamp trigger status */ + +/* ENET_MAC_INTMSK */ +#define ENET_MAC_INTMSK_WUMIM BIT(3) /*!< WUM interrupt mask */ +#define ENET_MAC_INTMSK_TMSTIM BIT(9) /*!< timestamp trigger interrupt mask */ + +/* ENET_MAC_ADDR0H */ +#define ENET_MAC_ADDR0H_ADDR0H BITS(0,15) /*!< MAC address0 high */ +#define ENET_MAC_ADDR0H_MO BIT(31) /*!< always read 1 and must be kept */ + +/* ENET_MAC_ADDR0L */ +#define ENET_MAC_ADDR0L_ADDR0L BITS(0,31) /*!< MAC address0 low */ + +/* ENET_MAC_ADDR1H */ +#define ENET_MAC_ADDR1H_ADDR1H BITS(0,15) /*!< MAC address1 high */ +#define ENET_MAC_ADDR1H_MB BITS(24,29) /*!< mask byte */ +#define ENET_MAC_ADDR1H_SAF BIT(30) /*!< source address filter */ +#define ENET_MAC_ADDR1H_AFE BIT(31) /*!< address filter enable */ + +/* ENET_MAC_ADDR1L */ +#define ENET_MAC_ADDR1L_ADDR1L BITS(0,31) /*!< MAC address1 low */ + +/* ENET_MAC_ADDR2H */ +#define ENET_MAC_ADDR2H_ADDR2H BITS(0,15) /*!< MAC address2 high */ +#define ENET_MAC_ADDR2H_MB BITS(24,29) /*!< mask byte */ +#define ENET_MAC_ADDR2H_SAF BIT(30) /*!< source address filter */ +#define ENET_MAC_ADDR2H_AFE BIT(31) /*!< address filter enable */ + +/* ENET_MAC_ADDR2L */ +#define ENET_MAC_ADDR2L_ADDR2L BITS(0,31) /*!< MAC address2 low */ + +/* ENET_MAC_ADDR3H */ +#define ENET_MAC_ADDR3H_ADDR3H BITS(0,15) /*!< MAC address3 high */ +#define ENET_MAC_ADDR3H_MB BITS(24,29) /*!< mask byte */ +#define ENET_MAC_ADDR3H_SAF BIT(30) /*!< source address filter */ +#define ENET_MAC_ADDR3H_AFE BIT(31) /*!< address filter enable */ + +/* ENET_MAC_ADDR3L */ +#define ENET_MAC_ADDR3L_ADDR3L BITS(0,31) /*!< MAC address3 low */ + +/* ENET_MSC_CTL */ +#define ENET_MSC_CTL_CTR BIT(0) /*!< counter reset */ +#define ENET_MSC_CTL_CTSR BIT(1) /*!< counter stop rollover */ +#define ENET_MSC_CTL_RTOR BIT(2) /*!< reset on read */ +#define ENET_MSC_CTL_MCFZ BIT(3) /*!< MSC counter freeze */ + +/* ENET_MSC_RINTF */ +#define ENET_MSC_RINTF_RFCE BIT(5) /*!< received frames CRC error */ +#define ENET_MSC_RINTF_RFAE BIT(6) /*!< received frames alignment error */ +#define ENET_MSC_RINTF_RGUF BIT(17) /*!< receive good unicast frames */ + +/* ENET_MSC_TINTF */ +#define ENET_MSC_TINTF_TGFSC BIT(14) /*!< transmitted good frames single collision */ +#define ENET_MSC_TINTF_TGFMSC BIT(15) /*!< transmitted good frames more single collision */ +#define ENET_MSC_TINTF_TGF BIT(21) /*!< transmitted good frames */ + +/* ENET_MSC_RINTMSK */ +#define ENET_MSC_RINTMSK_RFCEIM BIT(5) /*!< received frame CRC error interrupt mask */ +#define ENET_MSC_RINTMSK_RFAEIM BIT(6) /*!< received frames alignment error interrupt mask */ +#define ENET_MSC_RINTMSK_RGUFIM BIT(17) /*!< received good unicast frames interrupt mask */ + +/* ENET_MSC_TINTMSK */ +#define ENET_MSC_TINTMSK_TGFSCIM BIT(14) /*!< transmitted good frames single collision interrupt mask */ +#define ENET_MSC_TINTMSK_TGFMSCIM BIT(15) /*!< transmitted good frames more single collision interrupt mask */ +#define ENET_MSC_TINTMSK_TGFIM BIT(21) /*!< transmitted good frames interrupt mask */ + +/* ENET_MSC_SCCNT */ +#define ENET_MSC_SCCNT_SCC BITS(0,31) /*!< transmitted good frames single collision counter */ + +/* ENET_MSC_MSCCNT */ +#define ENET_MSC_MSCCNT_MSCC BITS(0,31) /*!< transmitted good frames more one single collision counter */ + +/* ENET_MSC_TGFCNT */ +#define ENET_MSC_TGFCNT_TGF BITS(0,31) /*!< transmitted good frames counter */ + +/* ENET_MSC_RFCECNT */ +#define ENET_MSC_RFCECNT_RFCER BITS(0,31) /*!< received frames with CRC error counter */ + +/* ENET_MSC_RFAECNT */ +#define ENET_MSC_RFAECNT_RFAER BITS(0,31) /*!< received frames alignment error counter */ + +/* ENET_MSC_RGUFCNT */ +#define ENET_MSC_RGUFCNT_RGUF BITS(0,31) /*!< received good unicast frames counter */ + +/* ENET_PTP_TSCTL */ +#define ENET_PTP_TSCTL_TMSEN BIT(0) /*!< timestamp enable */ +#define ENET_PTP_TSCTL_TMSFCU BIT(1) /*!< timestamp fine or coarse update */ +#define ENET_PTP_TSCTL_TMSSTI BIT(2) /*!< timestamp system time initialize */ +#define ENET_PTP_TSCTL_TMSSTU BIT(3) /*!< timestamp system time update */ +#define ENET_PTP_TSCTL_TMSITEN BIT(4) /*!< timestamp interrupt trigger enable */ +#define ENET_PTP_TSCTL_TMSARU BIT(5) /*!< timestamp addend register update */ + +/* ENET_PTP_SSINC */ +#define ENET_PTP_SSINC_STMSSI BITS(0,7) /*!< system time subsecond increment */ + +/* ENET_PTP_TSH */ +#define ENET_PTP_TSH_STMS BITS(0,31) /*!< system time second */ + +/* ENET_PTP_TSL */ +#define ENET_PTP_TSL_STMSS BITS(0,30) /*!< system time subseconds */ +#define ENET_PTP_TSL_STS BIT(31) /*!< system time sign */ + +/* ENET_PTP_TSUH */ +#define ENET_PTP_TSUH_TMSUS BITS(0,31) /*!< timestamp update seconds */ + +/* ENET_PTP_TSUL */ +#define ENET_PTP_TSUL_TMSUSS BITS(0,30) /*!< timestamp update subseconds */ +#define ENET_PTP_TSUL_TMSUPNS BIT(31) /*!< timestamp update positive or negative sign */ + +/* ENET_PTP_TSADDEND */ +#define ENET_PTP_TSADDEND_TMSA BITS(0,31) /*!< timestamp addend */ + +/* ENET_PTP_ETH */ +#define ENET_PTP_ETH_ETSH BITS(0,31) /*!< expected time high */ + +/* ENET_PTP_ETL */ +#define ENET_PTP_ETL_ETSL BITS(0,31) /*!< expected time low */ + +/* ENET_DMA_BCTL */ +#define ENET_DMA_BCTL_SWR BIT(0) /*!< software reset */ +#define ENET_DMA_BCTL_DAB BIT(1) /*!< DMA arbitration */ +#define ENET_DMA_BCTL_DPSL BITS(2,6) /*!< descriptor skip length */ +#define ENET_DMA_BCTL_PGBL BITS(8,13) /*!< programmable burst length */ +#define ENET_DMA_BCTL_RTPR BITS(14,15) /*!< RxDMA and TxDMA transfer priority ratio */ +#define ENET_DMA_BCTL_FB BIT(16) /*!< fixed Burst */ +#define ENET_DMA_BCTL_RXDP BITS(17,22) /*!< RxDMA PGBL */ +#define ENET_DMA_BCTL_UIP BIT(23) /*!< use independent PGBL */ +#define ENET_DMA_BCTL_FPBL BIT(24) /*!< four times PGBL mode */ +#define ENET_DMA_BCTL_AA BIT(25) /*!< address-aligned */ + +/* ENET_DMA_TPEN */ +#define ENET_DMA_TPEN_TPE BITS(0,31) /*!< transmit poll enable */ + +/* ENET_DMA_RPEN */ +#define ENET_DMA_RPEN_RPE BITS(0,31) /*!< receive poll enable */ + +/* ENET_DMA_RDTADDR */ +#define ENET_DMA_RDTADDR_SRT BITS(0,31) /*!< start address of receive table */ + +/* ENET_DMA_TDTADDR */ +#define ENET_DMA_TDTADDR_STT BITS(0,31) /*!< start address of transmit table */ + +/* ENET_DMA_STAT */ +#define ENET_DMA_STAT_TS BIT(0) /*!< transmit status */ +#define ENET_DMA_STAT_TPS BIT(1) /*!< transmit process stopped status */ +#define ENET_DMA_STAT_TBU BIT(2) /*!< transmit buffer unavailable status */ +#define ENET_DMA_STAT_TJT BIT(3) /*!< transmit jabber timeout status */ +#define ENET_DMA_STAT_RO BIT(4) /*!< receive overflow status */ +#define ENET_DMA_STAT_TU BIT(5) /*!< transmit underflow status */ +#define ENET_DMA_STAT_RS BIT(6) /*!< receive status */ +#define ENET_DMA_STAT_RBU BIT(7) /*!< receive buffer unavailable status */ +#define ENET_DMA_STAT_RPS BIT(8) /*!< receive process stopped status */ +#define ENET_DMA_STAT_RWT BIT(9) /*!< receive watchdog timeout status */ +#define ENET_DMA_STAT_ET BIT(10) /*!< early transmit status */ +#define ENET_DMA_STAT_FBE BIT(13) /*!< fatal bus error status */ +#define ENET_DMA_STAT_ER BIT(14) /*!< early receive status */ +#define ENET_DMA_STAT_AI BIT(15) /*!< abnormal interrupt summary */ +#define ENET_DMA_STAT_NI BIT(16) /*!< normal interrupt summary */ +#define ENET_DMA_STAT_RP BITS(17,19) /*!< receive process state */ +#define ENET_DMA_STAT_TP BITS(20,22) /*!< transmit process state */ +#define ENET_DMA_STAT_EB BITS(23,25) /*!< error bits status */ +#define ENET_DMA_STAT_MSC BIT(27) /*!< MSC status */ +#define ENET_DMA_STAT_WUM BIT(28) /*!< WUM status */ +#define ENET_DMA_STAT_TST BIT(29) /*!< timestamp trigger status */ + +/* ENET_DMA_CTL */ +#define ENET_DMA_CTL_SRE BIT(1) /*!< start/stop receive enable */ +#define ENET_DMA_CTL_OSF BIT(2) /*!< operate on second frame */ +#define ENET_DMA_CTL_RTHC BITS(3,4) /*!< receive threshold control */ +#define ENET_DMA_CTL_FUF BIT(6) /*!< forward undersized good frames */ +#define ENET_DMA_CTL_FERF BIT(7) /*!< forward error frames */ +#define ENET_DMA_CTL_STE BIT(13) /*!< start/stop transmission enable */ +#define ENET_DMA_CTL_TTHC BITS(14,16) /*!< transmit threshold control */ +#define ENET_DMA_CTL_FTF BIT(20) /*!< flush transmit FIFO */ +#define ENET_DMA_CTL_TSFD BIT(21) /*!< transmit store-and-forward */ +#define ENET_DMA_CTL_DAFRF BIT(24) /*!< disable flushing of received frames */ +#define ENET_DMA_CTL_RSFD BIT(25) /*!< receive store-and-forward */ +#define ENET_DMA_CTL_DTCERFD BIT(26) /*!< dropping of TCP/IP checksum error frames disable */ + +/* ENET_DMA_INTEN */ +#define ENET_DMA_INTEN_TIE BIT(0) /*!< transmit interrupt enable */ +#define ENET_DMA_INTEN_TPSIE BIT(1) /*!< transmit process stopped interrupt enable */ +#define ENET_DMA_INTEN_TBUIE BIT(2) /*!< transmit buffer unavailable interrupt enable */ +#define ENET_DMA_INTEN_TJTIE BIT(3) /*!< transmit jabber timeout interrupt enable */ +#define ENET_DMA_INTEN_ROIE BIT(4) /*!< receive overflow interrupt enable */ +#define ENET_DMA_INTEN_TUIE BIT(5) /*!< transmit underflow interrupt enable */ +#define ENET_DMA_INTEN_RIE BIT(6) /*!< receive interrupt enable */ +#define ENET_DMA_INTEN_RBUIE BIT(7) /*!< receive buffer unavailable interrupt enable */ +#define ENET_DMA_INTEN_RPSIE BIT(8) /*!< receive process stopped interrupt enable */ +#define ENET_DMA_INTEN_RWTIE BIT(9) /*!< receive watchdog timeout interrupt enable */ +#define ENET_DMA_INTEN_ETIE BIT(10) /*!< early transmit interrupt enable */ +#define ENET_DMA_INTEN_FBEIE BIT(13) /*!< fatal bus error interrupt enable */ +#define ENET_DMA_INTEN_ERIE BIT(14) /*!< early receive interrupt enable */ +#define ENET_DMA_INTEN_AIE BIT(15) /*!< abnormal interrupt summary enable */ +#define ENET_DMA_INTEN_NIE BIT(16) /*!< normal interrupt summary enable */ + +/* ENET_DMA_MFBOCNT */ +#define ENET_DMA_MFBOCNT_MSFC BITS(0,15) /*!< missed frames by the controller */ +#define ENET_DMA_MFBOCNT_OBMFC BIT(16) /* Overflow bit for missed frame counter */ +#define ENET_DMA_MFBOCNT_MSFA BITS(17,27) /*!< missed frames by the application */ +#define ENET_DMA_MFBOCNT_OBFOC BIT(28) /*!< Overflow bit for FIFO overflow counter */ + +/* ENET_DMA_CTDADDR */ +#define ENET_DMA_CTDADDR_TDAP BITS(0,31) /*!< transmit descriptor address pointer */ + +/* ENET_DMA_CRDADDR */ +#define ENET_DMA_CRDADDR_RDAP BITS(0,31) /*!< receive descriptor address pointer */ + +/* ENET_DMA_CTBADDR */ +#define ENET_DMA_CTBADDR_TBAP BITS(0,31) /*!< transmit buffer address pointer */ + +/* ENET_DMA_CRBADDR */ +#define ENET_DMA_CRBADDR_RBAP BITS(0,31) /*!< receive buffer address pointer */ + +/* ENET DMA Tx descriptor TDES0 */ +#define ENET_TDES0_DB BIT(0) /*!< deferred */ +#define ENET_TDES0_UFE BIT(1) /*!< underflow error */ +#define ENET_TDES0_EXD BIT(2) /*!< excessive deferral */ +#define ENET_TDES0_COCNT BITS(3,6) /*!< collision count */ +#define ENET_TDES0_VFRM BIT(7) /*!< VLAN frame */ +#define ENET_TDES0_ECO BIT(8) /*!< excessive collision */ +#define ENET_TDES0_LCO BIT(9) /*!< late collision */ +#define ENET_TDES0_NCA BIT(10) /*!< no carrier */ +#define ENET_TDES0_LCA BIT(11) /*!< loss of carrier */ +#define ENET_TDES0_IPPE BIT(12) /*!< IP payload error */ +#define ENET_TDES0_FRMF BIT(13) /*!< frame flushed */ +#define ENET_TDES0_JT BIT(14) /*!< jabber timeout */ +#define ENET_TDES0_ES BIT(15) /*!< error summary */ +#define ENET_TDES0_IPHE BIT(16) /*!< IP header error */ +#define ENET_TDES0_TTMSS BIT(17) /*!< transmit timestamp status */ +#define ENET_TDES0_TCHM BIT(20) /*!< the second address chained mode */ +#define ENET_TDES0_TERM BIT(21) /*!< transmit end of ring mode*/ +#define ENET_TDES0_CM BITS(22,23) /*!< checksum mode */ +#define ENET_TDES0_TTSEN BIT(25) /*!< transmit timestamp function enable */ +#define ENET_TDES0_DPAD BIT(26) /*!< disable adding pad */ +#define ENET_TDES0_DCRC BIT(27) /*!< disable CRC */ +#define ENET_TDES0_FSG BIT(28) /*!< first segment */ +#define ENET_TDES0_LSG BIT(29) /*!< last segment */ +#define ENET_TDES0_INTC BIT(30) /*!< interrupt on completion */ +#define ENET_TDES0_DAV BIT(31) /*!< DAV bit */ + +/* ENET DMA Tx descriptor TDES1 */ +#define ENET_TDES1_TB1S BITS(0,12) /*!< transmit buffer 1 size */ +#define ENET_TDES1_TB2S BITS(16,28) /*!< transmit buffer 2 size */ + +/* ENET DMA Tx descriptor TDES2 */ +#define ENET_TDES2_TB1AP BITS(0,31) /*!< transmit buffer 1 address pointer/transmit frame timestamp low 32-bit value */ + +/* ENET DMA Tx descriptor TDES3 */ +#define ENET_TDES3_TB2AP BITS(0,31) /*!< transmit buffer 2 address pointer (or next descriptor address) / transmit frame timestamp high 32-bit value */ + +/* ENET DMA Rx descriptor RDES0 */ +#define ENET_RDES0_PCERR BIT(0) /*!< payload checksum error */ +#define ENET_RDES0_CERR BIT(1) /*!< CRC error */ +#define ENET_RDES0_DBERR BIT(2) /*!< dribble bit error */ +#define ENET_RDES0_RERR BIT(3) /*!< receive error */ +#define ENET_RDES0_RWDT BIT(4) /*!< receive watchdog timeout */ +#define ENET_RDES0_FRMT BIT(5) /*!< frame type */ +#define ENET_RDES0_LCO BIT(6) /*!< late collision */ +#define ENET_RDES0_IPHERR BIT(7) /*!< IP frame header error */ +#define ENET_RDES0_LDES BIT(8) /*!< last descriptor */ +#define ENET_RDES0_FDES BIT(9) /*!< first descriptor */ +#define ENET_RDES0_VTAG BIT(10) /*!< VLAN tag */ +#define ENET_RDES0_OERR BIT(11) /*!< overflow Error */ +#define ENET_RDES0_LERR BIT(12) /*!< length error */ +#define ENET_RDES0_SAFF BIT(13) /*!< SA filter fail */ +#define ENET_RDES0_DERR BIT(14) /*!< descriptor error */ +#define ENET_RDES0_ERRS BIT(15) /*!< error summary */ +#define ENET_RDES0_FRML BITS(16,29) /*!< frame length */ +#define ENET_RDES0_DAFF BIT(30) /*!< destination address filter fail */ +#define ENET_RDES0_DAV BIT(31) /*!< descriptor available */ + +/* ENET DMA Rx descriptor RDES1 */ +#define ENET_RDES1_RB1S BITS(0,12) /*!< receive buffer 1 size */ +#define ENET_RDES1_RCHM BIT(14) /*!< receive chained mode for second address */ +#define ENET_RDES1_RERM BIT(15) /*!< receive end of ring mode*/ +#define ENET_RDES1_RB2S BITS(16,28) /*!< receive buffer 2 size */ +#define ENET_RDES1_DINTC BIT(31) /*!< disable interrupt on completion */ + +/* ENET DMA Rx descriptor RDES2 */ +#define ENET_RDES2_RB1AP BITS(0,31) /*!< receive buffer 1 address pointer / receive frame timestamp low 32-bit */ + +/* ENET DMA Rx descriptor RDES3 */ +#define ENET_RDES3_RB2AP BITS(0,31) /*!< receive buffer 2 address pointer (next descriptor address)/receive frame timestamp high 32-bit value */ + +/* constants definitions */ +/* define bit position and its register index offset */ +#define ENET_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define ENET_REG_VAL(periph) (REG32(ENET + ((uint32_t)(periph)>>6))) +#define ENET_BIT_POS(val) ((uint32_t)(val) & 0x1FU) + +/* ENET clock range judgement */ +#define ENET_RANGE(hclk, n, m) (((hclk) >= (n))&&((hclk) < (m))) + +/* define MAC address configuration and reference address */ +#define ENET_SET_MACADDRH(p) (((uint32_t)(p)[5] << 8) | (uint32_t)(p)[4]) +#define ENET_SET_MACADDRL(p) (((uint32_t)(p)[3] << 24) | ((uint32_t)(p)[2] << 16) | ((uint32_t)(p)[1] << 8) | (uint32_t)(p)[0]) +#define ENET_ADDRH_BASE ((ENET) + 0x40U) +#define ENET_ADDRL_BASE ((ENET) + 0x44U) +#define ENET_GET_MACADDR(offset, n) ((uint8_t)((REG32((ENET_ADDRL_BASE + (offset)) - (((n) / 4U) * 4U)) >> (8U * ((n) % 4U))) & 0xFFU)) + +/* register offset */ +#define MAC_FCTL_REG_OFFSET 0x0018U /*!< MAC flow control register offset */ +#define MAC_WUM_REG_OFFSET 0x002CU /*!< MAC wakeup management register offset */ +#define MAC_INTF_REG_OFFSET 0x0038U /*!< MAC interrupt flag register offset */ +#define MAC_INTMSK_REG_OFFSET 0x003CU /*!< MAC interrupt mask register offset */ + +#define MSC_RINTF_REG_OFFSET 0x0104U /*!< MSC receive interrupt flag register offset */ +#define MSC_TINTF_REG_OFFSET 0x0108U /*!< MSC transmit interrupt flag register offset */ +#define MSC_RINTMSK_REG_OFFSET 0x010CU /*!< MSC receive interrupt mask register offset */ +#define MSC_TINTMSK_REG_OFFSET 0x0110U /*!< MSC transmit interrupt mask register offset */ +#define MSC_SCCNT_REG_OFFSET 0x014CU /*!< MSC transmitted good frames after a single collision counter register offset */ +#define MSC_MSCCNT_REG_OFFSET 0x0150U /*!< MSC transmitted good frames after more than a single collision counter register offset */ +#define MSC_TGFCNT_REG_OFFSET 0x0168U /*!< MSC transmitted good frames counter register offset */ +#define MSC_RFCECNT_REG_OFFSET 0x0194U /*!< MSC received frames with CRC error counter register offset */ +#define MSC_RFAECNT_REG_OFFSET 0x0198U /*!< MSC received frames with alignment error counter register offset */ +#define MSC_RGUFCNT_REG_OFFSET 0x01C4U /*!< MSC received good unicast frames counter register offset */ + +#define DMA_STAT_REG_OFFSET 0x1014U /*!< DMA status register offset */ +#define DMA_INTEN_REG_OFFSET 0x101CU /*!< DMA interrupt enable register offset */ +#define DMA_TDTADDR_REG_OFFSET 0x1010U /*!< DMA transmit descriptor table address register offset */ +#define DMA_CTDADDR_REG_OFFSET 0x1048U /*!< DMA current transmit descriptor address register */ +#define DMA_CTBADDR_REG_OFFSET 0x1050U /*!< DMA current transmit buffer address register */ +#define DMA_RDTADDR_REG_OFFSET 0x100CU /*!< DMA receive descriptor table address register */ +#define DMA_CRDADDR_REG_OFFSET 0x104CU /*!< DMA current receive descriptor address register */ +#define DMA_CRBADDR_REG_OFFSET 0x1054U /*!< DMA current receive buffer address register */ + +/* ENET status flag get */ +typedef enum +{ + /* ENET_MAC_WUM register */ + ENET_MAC_FLAG_MPKR = ENET_REGIDX_BIT(MAC_WUM_REG_OFFSET, 5U), /*!< magic packet received flag */ + ENET_MAC_FLAG_WUFR = ENET_REGIDX_BIT(MAC_WUM_REG_OFFSET, 6U), /*!< wakeup frame received flag */ + /* ENET_MAC_FCTL register */ + ENET_MAC_FLAG_FLOWCONTROL = ENET_REGIDX_BIT(MAC_FCTL_REG_OFFSET, 0U), /*!< flow control status flag */ + /* ENET_MAC_INTF register */ + ENET_MAC_FLAG_WUM = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 3U), /*!< WUM status flag */ + ENET_MAC_FLAG_MSC = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 4U), /*!< MSC status flag */ + ENET_MAC_FLAG_MSCR = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 5U), /*!< MSC receive status flag */ + ENET_MAC_FLAG_MSCT = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 6U), /*!< MSC transmit status flag */ + ENET_MAC_FLAG_TMST = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 9U), /*!< timestamp trigger status flag */ + /* ENET_MSC_RINTF register */ + ENET_MSC_FLAG_RFCE = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 5U), /*!< received frames CRC error flag */ + ENET_MSC_FLAG_RFAE = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 6U), /*!< received frames alignment error flag */ + ENET_MSC_FLAG_RGUF = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 17U), /*!< received good unicast frames flag */ + /* ENET_MSC_TINTF register */ + ENET_MSC_FLAG_TGFSC = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 14U), /*!< transmitted good frames single collision flag */ + ENET_MSC_FLAG_TGFMSC = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 15U), /*!< transmitted good frames more single collision flag */ + ENET_MSC_FLAG_TGF = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 21U), /*!< transmitted good frames flag */ + /* ENET_DMA_STAT register */ + ENET_DMA_FLAG_TS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 0U), /*!< transmit status flag */ + ENET_DMA_FLAG_TPS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 1U), /*!< transmit process stopped status flag */ + ENET_DMA_FLAG_TBU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 2U), /*!< transmit buffer unavailable status flag */ + ENET_DMA_FLAG_TJT = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 3U), /*!< transmit jabber timeout status flag */ + ENET_DMA_FLAG_RO = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 4U), /*!< receive overflow status flag */ + ENET_DMA_FLAG_TU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 5U), /*!< transmit underflow status flag */ + ENET_DMA_FLAG_RS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 6U), /*!< receive status flag */ + ENET_DMA_FLAG_RBU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 7U), /*!< receive buffer unavailable status flag */ + ENET_DMA_FLAG_RPS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 8U), /*!< receive process stopped status flag */ + ENET_DMA_FLAG_RWT = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 9U), /*!< receive watchdog timeout status flag */ + ENET_DMA_FLAG_ET = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 10U), /*!< early transmit status flag */ + ENET_DMA_FLAG_FBE = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 13U), /*!< fatal bus error status flag */ + ENET_DMA_FLAG_ER = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 14U), /*!< early receive status flag */ + ENET_DMA_FLAG_AI = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 15U), /*!< abnormal interrupt summary flag */ + ENET_DMA_FLAG_NI = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 16U), /*!< normal interrupt summary flag */ + ENET_DMA_FLAG_EB_DMA_ERROR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 23U), /*!< error during data transfer by RxDMA/TxDMA flag */ + ENET_DMA_FLAG_EB_TRANSFER_ERROR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 24U), /*!< error during write/read transfer flag */ + ENET_DMA_FLAG_EB_ACCESS_ERROR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 25U), /*!< error during data buffer/descriptor access flag */ + ENET_DMA_FLAG_MSC = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 27U), /*!< MSC status flag */ + ENET_DMA_FLAG_WUM = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 28U), /*!< WUM status flag */ + ENET_DMA_FLAG_TST = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 29U), /*!< timestamp trigger status flag */ +}enet_flag_enum; + +/* ENET stutus flag clear */ +typedef enum +{ + /* ENET_DMA_STAT register */ + ENET_DMA_FLAG_TS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 0U), /*!< transmit status flag */ + ENET_DMA_FLAG_TPS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 1U), /*!< transmit process stopped status flag */ + ENET_DMA_FLAG_TBU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 2U), /*!< transmit buffer unavailable status flag */ + ENET_DMA_FLAG_TJT_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 3U), /*!< transmit jabber timeout status flag */ + ENET_DMA_FLAG_RO_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 4U), /*!< receive overflow status flag */ + ENET_DMA_FLAG_TU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 5U), /*!< transmit underflow status flag */ + ENET_DMA_FLAG_RS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 6U), /*!< receive status flag */ + ENET_DMA_FLAG_RBU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 7U), /*!< receive buffer unavailable status flag */ + ENET_DMA_FLAG_RPS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 8U), /*!< receive process stopped status flag */ + ENET_DMA_FLAG_RWT_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 9U), /*!< receive watchdog timeout status flag */ + ENET_DMA_FLAG_ET_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 10U), /*!< early transmit status flag */ + ENET_DMA_FLAG_FBE_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 13U), /*!< fatal bus error status flag */ + ENET_DMA_FLAG_ER_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 14U), /*!< early receive status flag */ + ENET_DMA_FLAG_AI_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 15U), /*!< abnormal interrupt summary flag */ + ENET_DMA_FLAG_NI_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 16U), /*!< normal interrupt summary flag */ +}enet_flag_clear_enum; + +/* ENET interrupt enable/disable */ +typedef enum +{ + /* ENET_MAC_INTMSK register */ + ENET_MAC_INT_WUMIM = ENET_REGIDX_BIT(MAC_INTMSK_REG_OFFSET, 3U), /*!< WUM interrupt mask */ + ENET_MAC_INT_TMSTIM = ENET_REGIDX_BIT(MAC_INTMSK_REG_OFFSET, 9U), /*!< timestamp trigger interrupt mask */ + /* ENET_MSC_RINTMSK register */ + ENET_MSC_INT_RFCEIM = ENET_REGIDX_BIT(MSC_RINTMSK_REG_OFFSET, 5U), /*!< received frame CRC error interrupt mask */ + ENET_MSC_INT_RFAEIM = ENET_REGIDX_BIT(MSC_RINTMSK_REG_OFFSET, 6U), /*!< received frames alignment error interrupt mask */ + ENET_MSC_INT_RGUFIM = ENET_REGIDX_BIT(MSC_RINTMSK_REG_OFFSET, 17U), /*!< received good unicast frames interrupt mask */ + /* ENET_MSC_TINTMSK register */ + ENET_MSC_INT_TGFSCIM = ENET_REGIDX_BIT(MSC_TINTMSK_REG_OFFSET, 14U), /*!< transmitted good frames single collision interrupt mask */ + ENET_MSC_INT_TGFMSCIM = ENET_REGIDX_BIT(MSC_TINTMSK_REG_OFFSET, 15U), /*!< transmitted good frames more single collision interrupt mask */ + ENET_MSC_INT_TGFIM = ENET_REGIDX_BIT(MSC_TINTMSK_REG_OFFSET, 21U), /*!< transmitted good frames interrupt mask */ + /* ENET_DMA_INTEN register */ + ENET_DMA_INT_TIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 0U), /*!< transmit interrupt enable */ + ENET_DMA_INT_TPSIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 1U), /*!< transmit process stopped interrupt enable */ + ENET_DMA_INT_TBUIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 2U), /*!< transmit buffer unavailable interrupt enable */ + ENET_DMA_INT_TJTIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 3U), /*!< transmit jabber timeout interrupt enable */ + ENET_DMA_INT_ROIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 4U), /*!< receive overflow interrupt enable */ + ENET_DMA_INT_TUIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 5U), /*!< transmit underflow interrupt enable */ + ENET_DMA_INT_RIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 6U), /*!< receive interrupt enable */ + ENET_DMA_INT_RBUIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 7U), /*!< receive buffer unavailable interrupt enable */ + ENET_DMA_INT_RPSIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 8U), /*!< receive process stopped interrupt enable */ + ENET_DMA_INT_RWTIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 9U), /*!< receive watchdog timeout interrupt enable */ + ENET_DMA_INT_ETIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 10U), /*!< early transmit interrupt enable */ + ENET_DMA_INT_FBEIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 13U), /*!< fatal bus error interrupt enable */ + ENET_DMA_INT_ERIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 14U), /*!< early receive interrupt enable */ + ENET_DMA_INT_AIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 15U), /*!< abnormal interrupt summary enable */ + ENET_DMA_INT_NIE = ENET_REGIDX_BIT(DMA_INTEN_REG_OFFSET, 16U), /*!< normal interrupt summary enable */ +}enet_int_enum; + +/* ENET interrupt flag get */ +typedef enum +{ + /* ENET_MAC_INTF register */ + ENET_MAC_INT_FLAG_WUM = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 3U), /*!< WUM status flag */ + ENET_MAC_INT_FLAG_MSC = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 4U), /*!< MSC status flag */ + ENET_MAC_INT_FLAG_MSCR = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 5U), /*!< MSC receive status flag */ + ENET_MAC_INT_FLAG_MSCT = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 6U), /*!< MSC transmit status flag */ + ENET_MAC_INT_FLAG_TMST = ENET_REGIDX_BIT(MAC_INTF_REG_OFFSET, 9U), /*!< timestamp trigger status flag */ + /* ENET_MSC_RINTF register */ + ENET_MSC_INT_FLAG_RFCE = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 5U), /*!< received frames CRC error flag */ + ENET_MSC_INT_FLAG_RFAE = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 6U), /*!< received frames alignment error flag */ + ENET_MSC_INT_FLAG_RGUF = ENET_REGIDX_BIT(MSC_RINTF_REG_OFFSET, 17U), /*!< received good unicast frames flag */ + /* ENET_MSC_TINTF register */ + ENET_MSC_INT_FLAG_TGFSC = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 14U), /*!< transmitted good frames single collision flag */ + ENET_MSC_INT_FLAG_TGFMSC = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 15U), /*!< transmitted good frames more single collision flag */ + ENET_MSC_INT_FLAG_TGF = ENET_REGIDX_BIT(MSC_TINTF_REG_OFFSET, 21U), /*!< transmitted good frames flag */ + /* ENET_DMA_STAT register */ + ENET_DMA_INT_FLAG_TS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 0U), /*!< transmit status flag */ + ENET_DMA_INT_FLAG_TPS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 1U), /*!< transmit process stopped status flag */ + ENET_DMA_INT_FLAG_TBU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 2U), /*!< transmit buffer unavailable status flag */ + ENET_DMA_INT_FLAG_TJT = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 3U), /*!< transmit jabber timeout status flag */ + ENET_DMA_INT_FLAG_RO = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 4U), /*!< receive overflow status flag */ + ENET_DMA_INT_FLAG_TU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 5U), /*!< transmit underflow status flag */ + ENET_DMA_INT_FLAG_RS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 6U), /*!< receive status flag */ + ENET_DMA_INT_FLAG_RBU = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 7U), /*!< receive buffer unavailable status flag */ + ENET_DMA_INT_FLAG_RPS = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 8U), /*!< receive process stopped status flag */ + ENET_DMA_INT_FLAG_RWT = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 9U), /*!< receive watchdog timeout status flag */ + ENET_DMA_INT_FLAG_ET = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 10U), /*!< early transmit status flag */ + ENET_DMA_INT_FLAG_FBE = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 13U), /*!< fatal bus error status flag */ + ENET_DMA_INT_FLAG_ER = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 14U), /*!< early receive status flag */ + ENET_DMA_INT_FLAG_AI = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 15U), /*!< abnormal interrupt summary flag */ + ENET_DMA_INT_FLAG_NI = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 16U), /*!< normal interrupt summary flag */ + ENET_DMA_INT_FLAG_MSC = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 27U), /*!< MSC status flag */ + ENET_DMA_INT_FLAG_WUM = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 28U), /*!< WUM status flag */ + ENET_DMA_INT_FLAG_TST = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 29U), /*!< timestamp trigger status flag */ +}enet_int_flag_enum; + +/* ENET interrupt flag clear */ +typedef enum +{ + /* ENET_DMA_STAT register */ + ENET_DMA_INT_FLAG_TS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 0U), /*!< transmit status flag */ + ENET_DMA_INT_FLAG_TPS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 1U), /*!< transmit process stopped status flag */ + ENET_DMA_INT_FLAG_TBU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 2U), /*!< transmit buffer unavailable status flag */ + ENET_DMA_INT_FLAG_TJT_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 3U), /*!< transmit jabber timeout status flag */ + ENET_DMA_INT_FLAG_RO_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 4U), /*!< receive overflow status flag */ + ENET_DMA_INT_FLAG_TU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 5U), /*!< transmit underflow status flag */ + ENET_DMA_INT_FLAG_RS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 6U), /*!< receive status flag */ + ENET_DMA_INT_FLAG_RBU_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 7U), /*!< receive buffer unavailable status flag */ + ENET_DMA_INT_FLAG_RPS_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 8U), /*!< receive process stopped status flag */ + ENET_DMA_INT_FLAG_RWT_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 9U), /*!< receive watchdog timeout status flag */ + ENET_DMA_INT_FLAG_ET_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 10U), /*!< early transmit status flag */ + ENET_DMA_INT_FLAG_FBE_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 13U), /*!< fatal bus error status flag */ + ENET_DMA_INT_FLAG_ER_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 14U), /*!< early receive status flag */ + ENET_DMA_INT_FLAG_AI_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 15U), /*!< abnormal interrupt summary flag */ + ENET_DMA_INT_FLAG_NI_CLR = ENET_REGIDX_BIT(DMA_STAT_REG_OFFSET, 16U), /*!< normal interrupt summary flag */ +}enet_int_flag_clear_enum; + +/* current RX/TX descriptor/buffer/descriptor table address get */ +typedef enum +{ + ENET_RX_DESC_TABLE = DMA_RDTADDR_REG_OFFSET, /*!< RX descriptor table */ + ENET_RX_CURRENT_DESC = DMA_CRDADDR_REG_OFFSET, /*!< current RX descriptor */ + ENET_RX_CURRENT_BUFFER = DMA_CRBADDR_REG_OFFSET, /*!< current RX buffer */ + ENET_TX_DESC_TABLE = DMA_TDTADDR_REG_OFFSET, /*!< TX descriptor table */ + ENET_TX_CURRENT_DESC = DMA_CTDADDR_REG_OFFSET, /*!< current TX descriptor */ + ENET_TX_CURRENT_BUFFER = DMA_CTBADDR_REG_OFFSET /*!< current TX buffer */ +}enet_desc_reg_enum; + +/* MAC statistics counter get */ +typedef enum +{ + ENET_MSC_TX_SCCNT = MSC_SCCNT_REG_OFFSET, /*!< MSC transmitted good frames after a single collision counter */ + ENET_MSC_TX_MSCCNT = MSC_MSCCNT_REG_OFFSET, /*!< MSC transmitted good frames after more than a single collision counter */ + ENET_MSC_TX_TGFCNT = MSC_TGFCNT_REG_OFFSET, /*!< MSC transmitted good frames counter */ + ENET_MSC_RX_RFCECNT = MSC_RFCECNT_REG_OFFSET, /*!< MSC received frames with CRC error counter */ + ENET_MSC_RX_RFAECNT = MSC_RFAECNT_REG_OFFSET, /*!< MSC received frames with alignment error counter */ + ENET_MSC_RX_RGUFCNT = MSC_RGUFCNT_REG_OFFSET /*!< MSC received good unicast frames counter */ +}enet_msc_counter_enum; + +/* function option, used for ENET initialization */ +typedef enum +{ + FORWARD_OPTION = BIT(0), /*!< configure the frame forward related parameters */ + DMABUS_OPTION = BIT(1), /*!< configure the DMA bus mode related parameters */ + DMA_MAXBURST_OPTION = BIT(2), /*!< configure the DMA max burst related parameters */ + DMA_ARBITRATION_OPTION = BIT(3), /*!< configure the DMA arbitration related parameters */ + STORE_OPTION = BIT(4), /*!< configure the store forward mode related parameters */ + DMA_OPTION = BIT(5), /*!< configure the DMA control related parameters */ + VLAN_OPTION = BIT(6), /*!< configure the VLAN tag related parameters */ + FLOWCTL_OPTION = BIT(7), /*!< configure the flow control related parameters */ + HASHH_OPTION = BIT(8), /*!< configure the hash list high 32-bit related parameters */ + HASHL_OPTION = BIT(9), /*!< configure the hash list low 32-bit related parameters */ + FILTER_OPTION = BIT(10), /*!< configure the frame filter control related parameters */ + HALFDUPLEX_OPTION = BIT(11), /*!< configure the halfduplex related parameters */ + TIMER_OPTION = BIT(12), /*!< configure the frame timer related parameters */ + INTERFRAMEGAP_OPTION = BIT(13), /*!< configure the inter frame gap related parameters */ +}enet_option_enum; + +/* phy mode and mac loopback configurations */ +typedef enum +{ + ENET_AUTO_NEGOTIATION = 0x01u, /*!< PHY auto negotiation */ + ENET_100M_FULLDUPLEX = (ENET_MAC_CFG_SPD | ENET_MAC_CFG_DPM), /*!< 100Mbit/s, full-duplex */ + ENET_100M_HALFDUPLEX = ENET_MAC_CFG_SPD , /*!< 100Mbit/s, half-duplex */ + ENET_10M_FULLDUPLEX = ENET_MAC_CFG_DPM, /*!< 10Mbit/s, full-duplex */ + ENET_10M_HALFDUPLEX = (uint32_t)0x00000000U, /*!< 10Mbit/s, half-duplex */ + ENET_LOOPBACKMODE = (ENET_MAC_CFG_LBM | ENET_MAC_CFG_DPM) /*!< MAC in loopback mode at the MII */ +}enet_mediamode_enum; + +/* IP frame checksum function */ +typedef enum +{ + ENET_NO_AUTOCHECKSUM = (uint32_t)0x00000000U, /*!< disable IP frame checksum function */ + ENET_AUTOCHECKSUM_DROP_FAILFRAMES = ENET_MAC_CFG_IPFCO, /*!< enable IP frame checksum function */ + ENET_AUTOCHECKSUM_ACCEPT_FAILFRAMES = (ENET_MAC_CFG_IPFCO|ENET_DMA_CTL_DTCERFD) /*!< enable IP frame checksum function, and the received frame + with only payload error but no other errors will not be dropped */ +}enet_chksumconf_enum; + +/* received frame filter function */ +typedef enum +{ + ENET_PROMISCUOUS_MODE = ENET_MAC_FRMF_PM, /*!< promiscuous mode enabled */ + ENET_RECEIVEALL = (int32_t)ENET_MAC_FRMF_FAR, /*!< all received frame are forwarded to application */ + ENET_BROADCAST_FRAMES_PASS = (uint32_t)0x00000000U, /*!< the address filters pass all received broadcast frames */ + ENET_BROADCAST_FRAMES_DROP = ENET_MAC_FRMF_BFRMD /*!< the address filters filter all incoming broadcast frames */ +}enet_frmrecept_enum; + +/* register group value get */ +typedef enum +{ + ALL_MAC_REG = 0, /*!< MAC register group */ + ALL_MSC_REG = 22, /*!< MSC register group */ + ALL_PTP_REG = 33, /*!< PTP register group */ + ALL_DMA_REG = 44, /*!< DMA register group */ +}enet_registers_type_enum; + +/* dma direction select */ +typedef enum +{ + ENET_DMA_TX = ENET_DMA_STAT_TP, /*!< DMA transmit direction */ + ENET_DMA_RX = ENET_DMA_STAT_RP /*!< DMA receive direction */ +}enet_dmadirection_enum; + +/* PHY operation direction select */ +typedef enum +{ + ENET_PHY_READ = (uint32_t)0x00000000, /*!< read PHY */ + ENET_PHY_WRITE = ENET_MAC_PHY_CTL_PW /*!< write PHY */ +}enet_phydirection_enum; + +/* register operation direction select */ +typedef enum +{ + ENET_REG_READ, /*!< read register */ + ENET_REG_WRITE /*!< write register */ +}enet_regdirection_enum; + +/* ENET MAC addresses */ +typedef enum +{ + ENET_MAC_ADDRESS0 = ((uint32_t)0x00000000), /*!< MAC address0 */ + ENET_MAC_ADDRESS1 = ((uint32_t)0x00000008), /*!< MAC address1 */ + ENET_MAC_ADDRESS2 = ((uint32_t)0x00000010), /*!< MAC address2 */ + ENET_MAC_ADDRESS3 = ((uint32_t)0x00000018) /*!< MAC address3 */ +}enet_macaddress_enum; + +/* descriptor information */ +typedef enum +{ + TXDESC_COLLISION_COUNT, /*!< the number of collisions occurred before the frame was transmitted */ + TXDESC_BUFFER_1_ADDR, /*!< transmit frame buffer 1 address */ + RXDESC_FRAME_LENGTH, /*!< the byte length of the received frame that was transferred to the buffer */ + RXDESC_BUFFER_1_SIZE, /*!< receive buffer 1 size */ + RXDESC_BUFFER_2_SIZE, /*!< receive buffer 2 size */ + RXDESC_BUFFER_1_ADDR /*!< receive frame buffer 1 address */ +}enet_descstate_enum; + +/* structure for initialization of the ENET */ +typedef struct +{ + uint32_t option_enable; /*!< select which function to configure */ + uint32_t forward_frame; /*!< frame forward related parameters */ + uint32_t dmabus_mode; /*!< DMA bus mode related parameters */ + uint32_t dma_maxburst; /*!< DMA max burst related parameters */ + uint32_t dma_arbitration; /*!< DMA Tx and Rx arbitration related parameters */ + uint32_t store_forward_mode; /*!< store forward mode related parameters */ + uint32_t dma_function; /*!< DMA control related parameters */ + uint32_t vlan_config; /*!< VLAN tag related parameters */ + uint32_t flow_control; /*!< flow control related parameters */ + uint32_t hashtable_high; /*!< hash list high 32-bit related parameters */ + uint32_t hashtable_low; /*!< hash list low 32-bit related parameters */ + uint32_t framesfilter_mode; /*!< frame filter control related parameters */ + uint32_t halfduplex_param; /*!< halfduplex related parameters */ + uint32_t timer_config; /*!< frame timer related parameters */ + uint32_t interframegap; /*!< inter frame gap related parameters */ +}enet_initpara_struct; + +/* structure for ENET DMA desciptors */ +typedef struct +{ + uint32_t status; /*!< status */ + uint32_t control_buffer_size; /*!< control and buffer1, buffer2 lengths */ + uint32_t buffer1_addr; /*!< buffer1 address pointer/timestamp low */ + uint32_t buffer2_next_desc_addr; /*!< buffer2 or next descriptor address pointer/timestamp high */ +} enet_descriptors_struct; + +/* structure of PTP system time */ +typedef struct +{ + uint32_t second; /*!< second of system time */ + uint32_t nanosecond; /*!< nanosecond of system time */ + uint32_t sign; /*!< sign of system time */ +}enet_ptp_systime_struct; + +/* mac_cfg register value */ +#define MAC_CFG_BOL(regval) (BITS(5,6) & ((uint32_t)(regval) << 5)) /*!< write value to ENET_MAC_CFG_BOL bit field */ +#define ENET_BACKOFFLIMIT_10 MAC_CFG_BOL(0) /*!< min (n, 10) */ +#define ENET_BACKOFFLIMIT_8 MAC_CFG_BOL(1) /*!< min (n, 8) */ +#define ENET_BACKOFFLIMIT_4 MAC_CFG_BOL(2) /*!< min (n, 4) */ +#define ENET_BACKOFFLIMIT_1 MAC_CFG_BOL(3) /*!< min (n, 1) */ + +#define MAC_CFG_IGBS(regval) (BITS(17,19) & ((uint32_t)(regval) << 17)) /*!< write value to ENET_MAC_CFG_IGBS bit field */ +#define ENET_INTERFRAMEGAP_96BIT MAC_CFG_IGBS(0) /*!< minimum 96 bit times */ +#define ENET_INTERFRAMEGAP_88BIT MAC_CFG_IGBS(1) /*!< minimum 88 bit times */ +#define ENET_INTERFRAMEGAP_80BIT MAC_CFG_IGBS(2) /*!< minimum 80 bit times */ +#define ENET_INTERFRAMEGAP_72BIT MAC_CFG_IGBS(3) /*!< minimum 72 bit times */ +#define ENET_INTERFRAMEGAP_64BIT MAC_CFG_IGBS(4) /*!< minimum 64 bit times */ +#define ENET_INTERFRAMEGAP_56BIT MAC_CFG_IGBS(5) /*!< minimum 56 bit times */ +#define ENET_INTERFRAMEGAP_48BIT MAC_CFG_IGBS(6) /*!< minimum 48 bit times */ +#define ENET_INTERFRAMEGAP_40BIT MAC_CFG_IGBS(7) /*!< minimum 40 bit times */ + +#define ENET_WATCHDOG_ENABLE ((uint32_t)0x00000000U) /*!< the MAC allows no more than 2048 bytes of the frame being received */ +#define ENET_WATCHDOG_DISABLE ENET_MAC_CFG_WDD /*!< the MAC disables the watchdog timer on the receiver, and can receive frames of up to 16384 bytes */ + +#define ENET_JABBER_ENABLE ((uint32_t)0x00000000U) /*!< the maximum transmission byte is 2048 */ +#define ENET_JABBER_DISABLE ENET_MAC_CFG_JBD /*!< the maximum transmission byte can be 16384 */ + +#define ENET_CARRIERSENSE_ENABLE ((uint32_t)0x00000000U) /*!< the MAC transmitter generates carrier sense error and aborts the transmission */ +#define ENET_CARRIERSENSE_DISABLE ENET_MAC_CFG_CSD /*!< the MAC transmitter ignores the MII CRS signal during frame transmission in half-duplex mode */ + +#define ENET_SPEEDMODE_10M ((uint32_t)0x00000000U) /*!< 10 Mbit/s */ +#define ENET_SPEEDMODE_100M ENET_MAC_CFG_SPD /*!< 100 Mbit/s */ + +#define ENET_RECEIVEOWN_ENABLE ((uint32_t)0x00000000U) /*!< the MAC receives all packets that are given by the PHY while transmitting */ +#define ENET_RECEIVEOWN_DISABLE ENET_MAC_CFG_ROD /*!< the MAC disables the reception of frames in half-duplex mode */ + +#define ENET_LOOPBACKMODE_ENABLE ENET_MAC_CFG_LBM /*!< the MAC operates in loopback mode at the MII */ +#define ENET_LOOPBACKMODE_DISABLE ((uint32_t)0x00000000U) /*!< the MAC operates in normal mode */ + +#define ENET_MODE_FULLDUPLEX ENET_MAC_CFG_DPM /*!< full-duplex mode enable */ +#define ENET_MODE_HALFDUPLEX ((uint32_t)0x00000000U) /*!< half-duplex mode enable */ + +#define ENET_CHECKSUMOFFLOAD_ENABLE ENET_MAC_CFG_IPFCO /*!< IP frame checksum offload function enabled for received IP frame */ +#define ENET_CHECKSUMOFFLOAD_DISABLE ((uint32_t)0x00000000U) /*!< the checksum offload function in the receiver is disabled */ + +#define ENET_RETRYTRANSMISSION_ENABLE ((uint32_t)0x00000000U) /*!< the MAC attempts retries up to 16 times based on the settings of BOL*/ +#define ENET_RETRYTRANSMISSION_DISABLE ENET_MAC_CFG_RTD /*!< the MAC attempts only 1 transmission */ + +#define ENET_AUTO_PADCRC_DROP_ENABLE ENET_MAC_CFG_APCD /*!< the MAC strips the Pad/FCS field on received frames */ +#define ENET_AUTO_PADCRC_DROP_DISABLE ((uint32_t)0x00000000U) /*!< the MAC forwards all received frames without modify it */ +#define ENET_AUTO_PADCRC_DROP ENET_MAC_CFG_APCD /*!< the function of the MAC strips the Pad/FCS field on received frames */ + +#define ENET_DEFERRALCHECK_ENABLE ENET_MAC_CFG_DFC /*!< the deferral check function is enabled in the MAC */ +#define ENET_DEFERRALCHECK_DISABLE ((uint32_t)0x00000000U) /*!< the deferral check function is disabled */ + +/* mac_frmf register value */ +#define MAC_FRMF_PCFRM(regval) (BITS(6,7) & ((uint32_t)(regval) << 6)) /*!< write value to ENET_MAC_FRMF_PCFRM bit field */ +#define ENET_PCFRM_PREVENT_ALL MAC_FRMF_PCFRM(0) /*!< MAC prevents all control frames from reaching the application */ +#define ENET_PCFRM_PREVENT_PAUSEFRAME MAC_FRMF_PCFRM(1) /*!< MAC only forwards all other control frames except pause control frame */ +#define ENET_PCFRM_FORWARD_ALL MAC_FRMF_PCFRM(2) /*!< MAC forwards all control frames to application even if they fail the address filter */ +#define ENET_PCFRM_FORWARD_FILTERED MAC_FRMF_PCFRM(3) /*!< MAC forwards control frames that only pass the address filter */ + +#define ENET_RX_FILTER_DISABLE ENET_MAC_FRMF_FAR /*!< all received frame are forwarded to application */ +#define ENET_RX_FILTER_ENABLE ((uint32_t)0x00000000U) /*!< only the frame passed the filter can be forwarded to application */ + +#define ENET_SRC_FILTER_NORMAL_ENABLE ENET_MAC_FRMF_SAFLT /*!< filter source address */ +#define ENET_SRC_FILTER_INVERSE_ENABLE (ENET_MAC_FRMF_SAFLT | ENET_MAC_FRMF_SAIFLT) /*!< inverse source address filtering result */ +#define ENET_SRC_FILTER_DISABLE ((uint32_t)0x00000000U) /*!< source address function in filter disable */ +#define ENET_SRC_FILTER ENET_MAC_FRMF_SAFLT /*!< filter source address function */ +#define ENET_SRC_FILTER_INVERSE ENET_MAC_FRMF_SAIFLT /*!< inverse source address filtering result function */ + +#define ENET_BROADCASTFRAMES_ENABLE ((uint32_t)0x00000000U) /*!< the address filters pass all received broadcast frames */ +#define ENET_BROADCASTFRAMES_DISABLE ENET_MAC_FRMF_BFRMD /*!< the address filters filter all incoming broadcast frames */ + +#define ENET_DEST_FILTER_INVERSE_ENABLE ENET_MAC_FRMF_DAIFLT /*!< inverse DA filtering result */ +#define ENET_DEST_FILTER_INVERSE_DISABLE ((uint32_t)0x00000000U) /*!< not inverse DA filtering result */ +#define ENET_DEST_FILTER_INVERSE ENET_MAC_FRMF_DAIFLT /*!< inverse DA filtering result function */ + +#define ENET_PROMISCUOUS_ENABLE ENET_MAC_FRMF_PM /*!< promiscuous mode enabled */ +#define ENET_PROMISCUOUS_DISABLE ((uint32_t)0x00000000U) /*!< promiscuous mode disabled */ + +#define ENET_MULTICAST_FILTER_HASH_OR_PERFECT (ENET_MAC_FRMF_HMF | ENET_MAC_FRMF_HPFLT) /*!< pass multicast frames that match either the perfect or the hash filtering */ +#define ENET_MULTICAST_FILTER_HASH ENET_MAC_FRMF_HMF /*!< pass multicast frames that match the hash filtering */ +#define ENET_MULTICAST_FILTER_PERFECT ((uint32_t)0x00000000U) /*!< pass multicast frames that match the perfect filtering */ +#define ENET_MULTICAST_FILTER_NONE ENET_MAC_FRMF_MFD /*!< all multicast frames are passed */ +#define ENET_MULTICAST_FILTER_PASS ENET_MAC_FRMF_MFD /*!< pass all multicast frames function */ +#define ENET_MULTICAST_FILTER_HASH_MODE ENET_MAC_FRMF_HMF /*!< HASH multicast filter function */ +#define ENET_FILTER_MODE_EITHER ENET_MAC_FRMF_HPFLT /*!< HASH or perfect filter function */ + +#define ENET_UNICAST_FILTER_EITHER (ENET_MAC_FRMF_HUF | ENET_MAC_FRMF_HPFLT) /*!< pass unicast frames that match either the perfect or the hash filtering */ +#define ENET_UNICAST_FILTER_HASH ENET_MAC_FRMF_HUF /*!< pass unicast frames that match the hash filtering */ +#define ENET_UNICAST_FILTER_PERFECT ((uint32_t)0x00000000U) /*!< pass unicast frames that match the perfect filtering */ +#define ENET_UNICAST_FILTER_HASH_MODE ENET_MAC_FRMF_HUF /*!< HASH unicast filter function */ + +/* mac_phy_ctl register value */ +#define MAC_PHY_CTL_CLR(regval) (BITS(2,4) & ((uint32_t)(regval) << 2)) /*!< write value to ENET_MAC_PHY_CTL_CLR bit field */ +#define ENET_MDC_HCLK_DIV42 MAC_PHY_CTL_CLR(0) /*!< HCLK:60-100 MHz; MDC clock= HCLK/42 */ +#define ENET_MDC_HCLK_DIV62 MAC_PHY_CTL_CLR(1) /*!< HCLK:100-120 MHz; MDC clock= HCLK/62 */ +#define ENET_MDC_HCLK_DIV16 MAC_PHY_CTL_CLR(2) /*!< HCLK:20-35 MHz; MDC clock= HCLK/16 */ +#define ENET_MDC_HCLK_DIV26 MAC_PHY_CTL_CLR(3) /*!< HCLK:35-60 MHz; MDC clock= HCLK/26 */ + +#define MAC_PHY_CTL_PR(regval) (BITS(6,10) & ((uint32_t)(regval) << 6)) /*!< write value to ENET_MAC_PHY_CTL_PR bit field */ + +#define MAC_PHY_CTL_PA(regval) (BITS(11,15) & ((uint32_t)(regval) << 11)) /*!< write value to ENET_MAC_PHY_CTL_PA bit field */ + +/* mac_phy_data register value */ +#define MAC_PHY_DATA_PD(regval) (BITS(0,15) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_MAC_PHY_DATA_PD bit field */ + +/* mac_fctl register value */ +#define MAC_FCTL_PLTS(regval) (BITS(4,5) & ((uint32_t)(regval) << 4)) /*!< write value to ENET_MAC_FCTL_PLTS bit field */ +#define ENET_PAUSETIME_MINUS4 MAC_FCTL_PLTS(0) /*!< pause time minus 4 slot times */ +#define ENET_PAUSETIME_MINUS28 MAC_FCTL_PLTS(1) /*!< pause time minus 28 slot times */ +#define ENET_PAUSETIME_MINUS144 MAC_FCTL_PLTS(2) /*!< pause time minus 144 slot times */ +#define ENET_PAUSETIME_MINUS256 MAC_FCTL_PLTS(3) /*!< pause time minus 256 slot times */ + +#define ENET_ZERO_QUANTA_PAUSE_ENABLE ((uint32_t)0x00000000U) /*!< enable the automatic zero-quanta generation function */ +#define ENET_ZERO_QUANTA_PAUSE_DISABLE ENET_MAC_FCTL_DZQP /*!< disable the automatic zero-quanta generation function */ +#define ENET_ZERO_QUANTA_PAUSE ENET_MAC_FCTL_DZQP /*!< the automatic zero-quanta generation function */ + +#define ENET_MAC0_AND_UNIQUE_ADDRESS_PAUSEDETECT ENET_MAC_FCTL_UPFDT /*!< besides the unique multicast address, MAC also use the MAC0 address to detect pause frame */ +#define ENET_UNIQUE_PAUSEDETECT ((uint32_t)0x00000000U) /*!< only the unique multicast address for pause frame which is specified in IEEE802.3 can be detected */ + +#define ENET_RX_FLOWCONTROL_ENABLE ENET_MAC_FCTL_RFCEN /*!< enable decoding function for the received pause frame and process it */ +#define ENET_RX_FLOWCONTROL_DISABLE ((uint32_t)0x00000000U) /*!< decode function for pause frame is disabled */ +#define ENET_RX_FLOWCONTROL ENET_MAC_FCTL_RFCEN /*!< decoding function for the received pause frame and process it */ + +#define ENET_TX_FLOWCONTROL_ENABLE ENET_MAC_FCTL_TFCEN /*!< enable the flow control operation in the MAC */ +#define ENET_TX_FLOWCONTROL_DISABLE ((uint32_t)0x00000000U) /*!< disable the flow control operation in the MAC */ +#define ENET_TX_FLOWCONTROL ENET_MAC_FCTL_TFCEN /*!< the flow control operation in the MAC */ + +#define ENET_BACK_PRESSURE_ENABLE ENET_MAC_FCTL_FLCBBKPA /*!< enable the back pressure operation in the MAC */ +#define ENET_BACK_PRESSURE_DISABLE ((uint32_t)0x00000000U) /*!< disable the back pressure operation in the MAC */ +#define ENET_BACK_PRESSURE ENET_MAC_FCTL_FLCBBKPA /*!< the back pressure operation in the MAC */ + +#define MAC_FCTL_PTM(regval) (BITS(16,31) & ((uint32_t)(regval) << 16)) /*!< write value to ENET_MAC_FCTL_PTM bit field */ +/* mac_vlt register value */ +#define MAC_VLT_VLTI(regval) (BITS(0,15) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_MAC_VLT_VLTI bit field */ + +#define ENET_VLANTAGCOMPARISON_12BIT ENET_MAC_VLT_VLTC /*!< only low 12 bits of the VLAN tag are used for comparison */ +#define ENET_VLANTAGCOMPARISON_16BIT ((uint32_t)0x00000000U) /*!< all 16 bits of the VLAN tag are used for comparison */ + +/* mac_wum register value */ +#define ENET_WUM_FLAG_WUFFRPR ENET_MAC_WUM_WUFFRPR /*!< wakeup frame filter register poniter reset */ +#define ENET_WUM_FLAG_WUFR ENET_MAC_WUM_WUFR /*!< wakeup frame received */ +#define ENET_WUM_FLAG_MPKR ENET_MAC_WUM_MPKR /*!< magic packet received */ +#define ENET_WUM_POWER_DOWN ENET_MAC_WUM_PWD /*!< power down mode */ +#define ENET_WUM_MAGIC_PACKET_FRAME ENET_MAC_WUM_MPEN /*!< enable a wakeup event due to magic packet reception */ +#define ENET_WUM_WAKE_UP_FRAME ENET_MAC_WUM_WFEN /*!< enable a wakeup event due to wakeup frame reception */ +#define ENET_WUM_GLOBAL_UNICAST ENET_MAC_WUM_GU /*!< any received unicast frame passed filter is considered to be a wakeup frame */ + +/* mac_addr0h register value */ +#define MAC_ADDR0H_ADDR0H(regval) (BITS(0,15) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_MAC_ADDR0H_ADDR0H bit field */ + +/* mac_addrxh register value, x = 1,2,3 */ +#define MAC_ADDR123H_ADDR123H(regval) (BITS(0,15) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_MAC_ADDRxH_ADDRxH(x=1,2,3) bit field */ + +#define ENET_ADDRESS_MASK_BYTE0 BIT(24) /*!< low register bits [7:0] */ +#define ENET_ADDRESS_MASK_BYTE1 BIT(25) /*!< low register bits [15:8] */ +#define ENET_ADDRESS_MASK_BYTE2 BIT(26) /*!< low register bits [23:16] */ +#define ENET_ADDRESS_MASK_BYTE3 BIT(27) /*!< low register bits [31:24] */ +#define ENET_ADDRESS_MASK_BYTE4 BIT(28) /*!< high register bits [7:0] */ +#define ENET_ADDRESS_MASK_BYTE5 BIT(29) /*!< high register bits [15:8] */ + +#define ENET_ADDRESS_FILTER_SA BIT(30) /*!< use MAC address[47:0] is to compare with the SA fields of the received frame */ +#define ENET_ADDRESS_FILTER_DA ((uint32_t)0x00000000) /*!< use MAC address[47:0] is to compare with the DA fields of the received frame */ + +/* mac_fcth register value */ +#define MAC_FCTH_RFA(regval) ((BITS(0,2) & ((uint32_t)(regval) << 0))<<8) /*!< write value to ENET_MAC_FCTH_RFA bit field */ +#define ENET_ACTIVE_THRESHOLD_256BYTES MAC_FCTH_RFA(0) /*!< threshold level is 256 bytes */ +#define ENET_ACTIVE_THRESHOLD_512BYTES MAC_FCTH_RFA(1) /*!< threshold level is 512 bytes */ +#define ENET_ACTIVE_THRESHOLD_768BYTES MAC_FCTH_RFA(2) /*!< threshold level is 768 bytes */ +#define ENET_ACTIVE_THRESHOLD_1024BYTES MAC_FCTH_RFA(3) /*!< threshold level is 1024 bytes */ +#define ENET_ACTIVE_THRESHOLD_1280BYTES MAC_FCTH_RFA(4) /*!< threshold level is 1280 bytes */ +#define ENET_ACTIVE_THRESHOLD_1536BYTES MAC_FCTH_RFA(5) /*!< threshold level is 1536 bytes */ +#define ENET_ACTIVE_THRESHOLD_1792BYTES MAC_FCTH_RFA(6) /*!< threshold level is 1792 bytes */ + +#define MAC_FCTH_RFD(regval) ((BITS(4,6) & ((uint32_t)(regval) << 4))<<8) /*!< write value to ENET_MAC_FCTH_RFD bit field */ +#define ENET_DEACTIVE_THRESHOLD_256BYTES MAC_FCTH_RFD(0) /*!< threshold level is 256 bytes */ +#define ENET_DEACTIVE_THRESHOLD_512BYTES MAC_FCTH_RFD(1) /*!< threshold level is 512 bytes */ +#define ENET_DEACTIVE_THRESHOLD_768BYTES MAC_FCTH_RFD(2) /*!< threshold level is 768 bytes */ +#define ENET_DEACTIVE_THRESHOLD_1024BYTES MAC_FCTH_RFD(3) /*!< threshold level is 1024 bytes */ +#define ENET_DEACTIVE_THRESHOLD_1280BYTES MAC_FCTH_RFD(4) /*!< threshold level is 1280 bytes */ +#define ENET_DEACTIVE_THRESHOLD_1536BYTES MAC_FCTH_RFD(5) /*!< threshold level is 1536 bytes */ +#define ENET_DEACTIVE_THRESHOLD_1792BYTES MAC_FCTH_RFD(6) /*!< threshold level is 1792 bytes */ + +/* msc_ctl register value */ +#define ENET_MSC_COUNTER_STOP_ROLLOVER ENET_MSC_CTL_CTSR /*!< counter stop rollover */ +#define ENET_MSC_RESET_ON_READ ENET_MSC_CTL_RTOR /*!< reset on read */ +#define ENET_MSC_COUNTERS_FREEZE ENET_MSC_CTL_MCFZ /*!< MSC counter freeze */ + +/* ptp_tsctl register value */ +#define ENET_RXTX_TIMESTAMP ENET_PTP_TSCTL_TMSEN /*!< enable timestamp function for transmit and receive frames */ +#define ENET_PTP_TIMESTAMP_INT ENET_PTP_TSCTL_TMSITEN /*!< timestamp interrupt trigger enable */ + +/* ptp_ssinc register value */ +#define PTP_SSINC_STMSSI(regval) (BITS(0,7) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_PTP_SSINC_STMSSI bit field */ + +/* ptp_tsl register value */ +#define GET_PTP_TSL_STMSS(regval) GET_BITS((uint32_t)(regval),0,30) /*!< get value of ENET_PTP_TSL_STMSS bit field */ + +#define ENET_PTP_TIME_POSITIVE ((uint32_t)0x00000000) /*!< time value is positive */ +#define ENET_PTP_TIME_NEGATIVE ENET_PTP_TSL_STS /*!< time value is negative */ + +#define GET_PTP_TSL_STS(regval) (((regval) & BIT(31)) >> (31U)) /*!< get value of ENET_PTP_TSL_STS bit field */ + +/* ptp_tsul register value */ +#define PTP_TSUL_TMSUSS(regval) (BITS(0,30) & ((uint32_t)(regval) << 0)) /*!< write value to ENET_PTP_TSUL_TMSUSS bit field */ + +#define ENET_PTP_ADD_TO_TIME ((uint32_t)0x00000000) /*!< timestamp update value is added to system time */ +#define ENET_PTP_SUBSTRACT_FROM_TIME ENET_PTP_TSUL_TMSUPNS /*!< timestamp update value is subtracted from system time */ + +/* dma_bctl register value */ +#define DMA_BCTL_DPSL(regval) (BITS(2,6) & ((uint32_t)(regval) << 2)) /*!< write value to ENET_DMA_BCTL_DPSL bit field */ +#define GET_DMA_BCTL_DPSL(regval) GET_BITS((regval),2,6) /*!< get value of ENET_DMA_BCTL_DPSL bit field */ + +#define DMA_BCTL_PGBL(regval) (BITS(8,13) & ((uint32_t)(regval) << 8)) /*!< write value to ENET_DMA_BCTL_PGBL bit field */ +#define ENET_PGBL_1BEAT DMA_BCTL_PGBL(1) /*!< maximum number of beats is 1 */ +#define ENET_PGBL_2BEAT DMA_BCTL_PGBL(2) /*!< maximum number of beats is 2 */ +#define ENET_PGBL_4BEAT DMA_BCTL_PGBL(4) /*!< maximum number of beats is 4 */ +#define ENET_PGBL_8BEAT DMA_BCTL_PGBL(8) /*!< maximum number of beats is 8 */ +#define ENET_PGBL_16BEAT DMA_BCTL_PGBL(16) /*!< maximum number of beats is 16 */ +#define ENET_PGBL_32BEAT DMA_BCTL_PGBL(32) /*!< maximum number of beats is 32 */ +#define ENET_PGBL_4xPGBL_4BEAT (DMA_BCTL_PGBL(1)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 4 */ +#define ENET_PGBL_4xPGBL_8BEAT (DMA_BCTL_PGBL(2)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 8 */ +#define ENET_PGBL_4xPGBL_16BEAT (DMA_BCTL_PGBL(4)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 16 */ +#define ENET_PGBL_4xPGBL_32BEAT (DMA_BCTL_PGBL(8)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 32 */ +#define ENET_PGBL_4xPGBL_64BEAT (DMA_BCTL_PGBL(16)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 64 */ +#define ENET_PGBL_4xPGBL_128BEAT (DMA_BCTL_PGBL(32)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats is 128 */ + +#define DMA_BCTL_RTPR(regval) (BITS(14,15) & ((uint32_t)(regval) << 14)) /*!< write value to ENET_DMA_BCTL_RTPR bit field */ +#define ENET_ARBITRATION_RXTX_1_1 DMA_BCTL_RTPR(0) /*!< receive and transmit priority ratio is 1:1*/ +#define ENET_ARBITRATION_RXTX_2_1 DMA_BCTL_RTPR(1) /*!< receive and transmit priority ratio is 2:1*/ +#define ENET_ARBITRATION_RXTX_3_1 DMA_BCTL_RTPR(2) /*!< receive and transmit priority ratio is 3:1 */ +#define ENET_ARBITRATION_RXTX_4_1 DMA_BCTL_RTPR(3) /*!< receive and transmit priority ratio is 4:1 */ +#define ENET_ARBITRATION_RXPRIORTX ENET_DMA_BCTL_DAB /*!< RxDMA has higher priority than TxDMA */ + +#define ENET_FIXED_BURST_ENABLE ENET_DMA_BCTL_FB /*!< AHB can only use SINGLE/INCR4/INCR8/INCR16 during start of normal burst transfers */ +#define ENET_FIXED_BURST_DISABLE ((uint32_t)0x00000000) /*!< AHB can use SINGLE/INCR burst transfer operations */ + +#define DMA_BCTL_RXDP(regval) (BITS(17,22) & ((uint32_t)(regval) << 17)) /*!< write value to ENET_DMA_BCTL_RXDP bit field */ +#define ENET_RXDP_1BEAT DMA_BCTL_RXDP(1) /*!< maximum number of beats 1 */ +#define ENET_RXDP_2BEAT DMA_BCTL_RXDP(2) /*!< maximum number of beats 2 */ +#define ENET_RXDP_4BEAT DMA_BCTL_RXDP(4) /*!< maximum number of beats 4 */ +#define ENET_RXDP_8BEAT DMA_BCTL_RXDP(8) /*!< maximum number of beats 8 */ +#define ENET_RXDP_16BEAT DMA_BCTL_RXDP(16) /*!< maximum number of beats 16 */ +#define ENET_RXDP_32BEAT DMA_BCTL_RXDP(32) /*!< maximum number of beats 32 */ +#define ENET_RXDP_4xPGBL_4BEAT (DMA_BCTL_RXDP(1)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 4 */ +#define ENET_RXDP_4xPGBL_8BEAT (DMA_BCTL_RXDP(2)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 8 */ +#define ENET_RXDP_4xPGBL_16BEAT (DMA_BCTL_RXDP(4)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 16 */ +#define ENET_RXDP_4xPGBL_32BEAT (DMA_BCTL_RXDP(8)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 32 */ +#define ENET_RXDP_4xPGBL_64BEAT (DMA_BCTL_RXDP(16)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 64 */ +#define ENET_RXDP_4xPGBL_128BEAT (DMA_BCTL_RXDP(32)|ENET_DMA_BCTL_FPBL) /*!< maximum number of beats 128 */ + +#define ENET_RXTX_DIFFERENT_PGBL ENET_DMA_BCTL_UIP /*!< RxDMA uses the RXDP[5:0], while TxDMA uses the PGBL[5:0] */ +#define ENET_RXTX_SAME_PGBL ((uint32_t)0x00000000) /*!< RxDMA/TxDMA uses PGBL[5:0] */ + +#define ENET_ADDRESS_ALIGN_ENABLE ENET_DMA_BCTL_AA /*!< enabled address-aligned */ +#define ENET_ADDRESS_ALIGN_DISABLE ((uint32_t)0x00000000) /*!< disable address-aligned */ + +/* dma_stat register value */ +#define GET_DMA_STAT_RP(regval) GET_BITS((uint32_t)(regval),17,19) /*!< get value of ENET_DMA_STAT_RP bit field */ +#define ENET_RX_STATE_STOPPED ((uint32_t)0x00000000) /*!< reset or stop rx command issued */ +#define ENET_RX_STATE_FETCHING BIT(17) /*!< fetching the Rx descriptor */ +#define ENET_RX_STATE_WAITING (BIT(17)|BIT(18)) /*!< waiting for receive packet */ +#define ENET_RX_STATE_SUSPENDED BIT(19) /*!< Rx descriptor unavailable */ +#define ENET_RX_STATE_CLOSING (BIT(17)|BIT(19)) /*!< closing receive descriptor */ +#define ENET_RX_STATE_QUEUING ENET_DMA_STAT_RP /*!< transferring the receive packet data from recevie buffer to host memory */ + +#define GET_DMA_STAT_TP(regval) GET_BITS((uint32_t)(regval),20,22) /*!< get value of ENET_DMA_STAT_TP bit field */ +#define ENET_TX_STATE_STOPPED ((uint32_t)0x00000000) /*!< reset or stop Tx Command issued */ +#define ENET_TX_STATE_FETCHING BIT(20) /*!< fetching the Tx descriptor */ +#define ENET_TX_STATE_WAITING BIT(21) /*!< waiting for status */ +#define ENET_TX_STATE_READING (BIT(20)|BIT(21)) /*!< reading the data from host memory buffer and queuing it to transmit buffer */ +#define ENET_TX_STATE_SUSPENDED (BIT(21)|BIT(22)) /*!< Tx descriptor unavailabe or transmit buffer underflow */ +#define ENET_TX_STATE_CLOSING ENET_DMA_STAT_TP /*!< closing Tx descriptor */ + +#define GET_DMA_STAT_EB(regval) GET_BITS((uint32_t)(regval),23,25) /*!< get value of ENET_DMA_STAT_EB bit field */ +#define ENET_ERROR_TXDATA_TRANSFER BIT(23) /*!< error during data transfer by TxDMA or RxDMA */ +#define ENET_ERROR_READ_TRANSFER BIT(24) /*!< error during write transfer or read transfer */ +#define ENET_ERROR_DESC_ACCESS BIT(25) /*!< error during descriptor or buffer access */ + +/* dma_ctl register value */ +#define DMA_CTL_RTHC(regval) (BITS(3,4) & ((uint32_t)(regval) << 3)) /*!< write value to ENET_DMA_CTL_RTHC bit field */ +#define ENET_RX_THRESHOLD_64BYTES DMA_CTL_RTHC(0) /*!< threshold level is 64 Bytes */ +#define ENET_RX_THRESHOLD_32BYTES DMA_CTL_RTHC(1) /*!< threshold level is 32 Bytes */ +#define ENET_RX_THRESHOLD_96BYTES DMA_CTL_RTHC(2) /*!< threshold level is 96 Bytes */ +#define ENET_RX_THRESHOLD_128BYTES DMA_CTL_RTHC(3) /*!< threshold level is 128 Bytes */ + +#define DMA_CTL_TTHC(regval) (BITS(14,16) & ((uint32_t)(regval) << 14)) /*!< write value to ENET_DMA_CTL_TTHC bit field */ +#define ENET_TX_THRESHOLD_64BYTES DMA_CTL_TTHC(0) /*!< threshold level is 64 Bytes */ +#define ENET_TX_THRESHOLD_128BYTES DMA_CTL_TTHC(1) /*!< threshold level is 128 Bytes */ +#define ENET_TX_THRESHOLD_192BYTES DMA_CTL_TTHC(2) /*!< threshold level is 192 Bytes */ +#define ENET_TX_THRESHOLD_256BYTES DMA_CTL_TTHC(3) /*!< threshold level is 256 Bytes */ +#define ENET_TX_THRESHOLD_40BYTES DMA_CTL_TTHC(4) /*!< threshold level is 40 Bytes */ +#define ENET_TX_THRESHOLD_32BYTES DMA_CTL_TTHC(5) /*!< threshold level is 32 Bytes */ +#define ENET_TX_THRESHOLD_24BYTES DMA_CTL_TTHC(6) /*!< threshold level is 24 Bytes */ +#define ENET_TX_THRESHOLD_16BYTES DMA_CTL_TTHC(7) /*!< threshold level is 16 Bytes */ + +#define ENET_TCPIP_CKSUMERROR_ACCEPT ENET_DMA_CTL_DTCERFD /*!< Rx frame with only payload error but no other errors will not be dropped */ +#define ENET_TCPIP_CKSUMERROR_DROP ((uint32_t)0x00000000) /*!< all error frames will be dropped when FERF = 0 */ + +#define ENET_RX_MODE_STOREFORWARD ENET_DMA_CTL_RSFD /*!< RxFIFO operates in store-and-forward mode */ +#define ENET_RX_MODE_CUTTHROUGH ((uint32_t)0x00000000) /*!< RxFIFO operates in cut-through mode */ + +#define ENET_FLUSH_RXFRAME_ENABLE ((uint32_t)0x00000000) /*!< RxDMA flushes all frames */ +#define ENET_FLUSH_RXFRAME_DISABLE ENET_DMA_CTL_DAFRF /*!< RxDMA does not flush any frames */ +#define ENET_NO_FLUSH_RXFRAME ENET_DMA_CTL_DAFRF /*!< RxDMA does not flush frames function */ + +#define ENET_TX_MODE_STOREFORWARD ENET_DMA_CTL_TSFD /*!< TxFIFO operates in store-and-forward mode */ +#define ENET_TX_MODE_CUTTHROUGH ((uint32_t)0x00000000) /*!< TxFIFO operates in cut-through mode */ + +#define ENET_FORWARD_ERRFRAMES_ENABLE (ENET_DMA_CTL_FERF << 2) /*!< all frame received with error except runt error are forwarded to memory */ +#define ENET_FORWARD_ERRFRAMES_DISABLE ((uint32_t)0x00000000) /*!< RxFIFO drop error frame */ +#define ENET_FORWARD_ERRFRAMES (ENET_DMA_CTL_FERF << 2) /*!< the function that all frame received with error except runt error are forwarded to memory */ + +#define ENET_FORWARD_UNDERSZ_GOODFRAMES_ENABLE (ENET_DMA_CTL_FUF << 2) /*!< forward undersized good frames */ +#define ENET_FORWARD_UNDERSZ_GOODFRAMES_DISABLE ((uint32_t)0x00000000) /*!< RxFIFO drops all frames whose length is less than 64 bytes */ +#define ENET_FORWARD_UNDERSZ_GOODFRAMES (ENET_DMA_CTL_FUF << 2) /*!< the function that forwarding undersized good frames */ + +#define ENET_SECONDFRAME_OPT_ENABLE ENET_DMA_CTL_OSF /*!< TxDMA controller operate on second frame mode enable*/ +#define ENET_SECONDFRAME_OPT_DISABLE ((uint32_t)0x00000000) /*!< TxDMA controller operate on second frame mode disable */ +#define ENET_SECONDFRAME_OPT ENET_DMA_CTL_OSF /*!< TxDMA controller operate on second frame function */ + +/* dma_mfbocnt register value */ +#define GET_DMA_MFBOCNT_MSFC(regval) GET_BITS((regval),0,15) /*!< get value of ENET_DMA_MFBOCNT_MSFC bit field */ + +#define GET_DMA_MFBOCNT_MSFA(regval) GET_BITS((regval),17,27) /*!< get value of ENET_DMA_MFBOCNT_MSFA bit field */ + +/* dma tx descriptor tdes0 register value */ +#define TDES0_CONT(regval) (BITS(3,6) & ((uint32_t)(regval) << 3)) /*!< write value to ENET DMA TDES0 CONT bit field */ +#define GET_TDES0_COCNT(regval) GET_BITS((regval),3,6) /*!< get value of ENET DMA TDES0 CONT bit field */ + +#define TDES0_CM(regval) (BITS(22,23) & ((uint32_t)(regval) << 22)) /*!< write value to ENET DMA TDES0 CM bit field */ +#define ENET_CHECKSUM_DISABLE TDES0_CM(0) /*!< checksum insertion disabled */ +#define ENET_CHECKSUM_IPV4HEADER TDES0_CM(1) /*!< only IP header checksum calculation and insertion are enabled */ +#define ENET_CHECKSUM_TCPUDPICMP_SEGMENT TDES0_CM(2) /*!< TCP/UDP/ICMP checksum insertion calculated but pseudo-header */ +#define ENET_CHECKSUM_TCPUDPICMP_FULL TDES0_CM(3) /*!< TCP/UDP/ICMP checksum insertion fully calculated */ + +/* dma tx descriptor tdes1 register value */ +#define TDES1_TB1S(regval) (BITS(0,12) & ((uint32_t)(regval) << 0)) /*!< write value to ENET DMA TDES1 TB1S bit field */ + +#define TDES1_TB2S(regval) (BITS(16,28) & ((uint32_t)(regval) << 16)) /*!< write value to ENET DMA TDES1 TB2S bit field */ + +/* dma rx descriptor rdes0 register value */ +#define RDES0_FRML(regval) (BITS(16,29) & ((uint32_t)(regval) << 16)) /*!< write value to ENET DMA RDES0 FRML bit field */ +#define GET_RDES0_FRML(regval) GET_BITS((regval),16,29) /*!< get value of ENET DMA RDES0 FRML bit field */ + +/* dma rx descriptor rdes1 register value */ +#define ENET_RECEIVE_COMPLETE_INT_ENABLE ((uint32_t)0x00000000U) /*!< RS bit immediately set after Rx completed */ +#define ENET_RECEIVE_COMPLETE_INT_DISABLE ENET_RDES1_DINTC /*!< RS bit not immediately set after Rx completed */ + +#define GET_RDES1_RB1S(regval) GET_BITS((regval),0,12) /*!< get value of ENET DMA RDES1 RB1S bit field */ + +#define GET_RDES1_RB2S(regval) GET_BITS((regval),16,28) /*!< get value of ENET DMA RDES1 RB2S bit field */ + +/* dma rx descriptor rdes4 register value */ +#define RDES4_IPPLDT(regval) (BITS(0,2) & ((uint32_t)(regval) << 0)) /*!< write value to ENET DMA RDES4 IPPLDT bit field */ +#define GET_RDES4_IPPLDT(regval) GET_BITS((regval),0,2) /*!< get value of ENET DMA RDES4 IPPLDT bit field */ + +#define RDES4_PTPMT(regval) (BITS(8,11) & ((uint32_t)(regval) << 8)) /*!< write value to ENET DMA RDES4 PTPMT bit field */ +#define GET_RDES4_PTPMT(regval) GET_BITS((regval),8,11) /*!< get value of ENET DMA RDES4 PTPMT bit field */ + +/* ENET register mask value */ +#define MAC_CFG_MASK ((uint32_t)0xFD30810FU) /*!< ENET_MAC_CFG register mask */ +#define MAC_FCTL_MASK ((uint32_t)0x0000FF41U) /*!< ENET_MAC_FCTL register mask */ +#define DMA_CTL_MASK ((uint32_t)0xF8DE3F23U) /*!< ENET_DMA_CTL register mask */ +#define DMA_BCTL_MASK ((uint32_t)0xF800007DU) /*!< ENET_DMA_BCTL register mask */ + +#define ETH_DMATXDESC_SIZE 0x10U /*!< TxDMA descriptor size */ +#define ETH_DMARXDESC_SIZE 0x10U /*!< RxDMA descriptor size */ + +typedef enum{ + ENET_PTP_SYSTIME_INIT = ENET_PTP_TSCTL_TMSSTI, /*!< timestamp initialize */ + ENET_PTP_SYSTIME_UPDATE = ENET_PTP_TSCTL_TMSSTU, /*!< timestamp update */ + ENET_PTP_ADDEND_UPDATE = ENET_PTP_TSCTL_TMSARU, /*!< addend register update */ + ENET_PTP_FINEMODE = (int32_t)(ENET_PTP_TSCTL_TMSFCU| BIT(31)), /*!< the system timestamp uses the fine method for updating */ + ENET_PTP_COARSEMODE = ENET_PTP_TSCTL_TMSFCU, /*!< the system timestamp uses the coarse method for updating */ +}enet_ptp_function_enum; + + +/* ENET remote wake-up frame register length */ +#define ETH_WAKEUP_REGISTER_LENGTH 8U /*!< remote wake-up frame register length */ + +/* ENET frame size */ +#define ENET_MAX_FRAME_SIZE 1524U /*!< header + frame_extra + payload + CRC */ + +/* ENET delay timeout */ +#define ENET_DELAY_TO ((uint32_t)0x0004FFFFU) /*!< ENET delay timeout */ +#define ENET_RESET_TO ((uint32_t)0x000004FFU) /*!< ENET reset timeout */ + +/* function declarations */ +/* main function */ +/* deinitialize the ENET, and reset structure parameters for ENET initialization */ +void enet_deinit(void); +/* configure the parameters which are usually less cared for initialization */ +void enet_initpara_config(enet_option_enum option, uint32_t para); +/* initialize ENET peripheral with generally concerned parameters and the less cared parameters */ +ErrStatus enet_init(enet_mediamode_enum mediamode, enet_chksumconf_enum checksum, enet_frmrecept_enum recept); +/* reset all core internal registers located in CLK_TX and CLK_RX */ +ErrStatus enet_software_reset(void); +/* check receive frame valid and return frame size */ +uint32_t enet_rxframe_size_get(void); +/* initialize the dma tx/rx descriptors's parameters in chain mode */ +void enet_descriptors_chain_init(enet_dmadirection_enum direction); +/* initialize the dma tx/rx descriptors's parameters in ring mode */ +void enet_descriptors_ring_init(enet_dmadirection_enum direction); +/* handle current received frame data to application buffer */ +ErrStatus enet_frame_receive(uint8_t *buffer, uint32_t bufsize); +/* handle current received frame but without data copy to application buffer */ +#define ENET_NOCOPY_FRAME_RECEIVE() enet_frame_receive(NULL, 0U) +/* handle application buffer data to transmit it */ +ErrStatus enet_frame_transmit(uint8_t *buffer, uint32_t length); +/* handle current transmit frame but without data copy from application buffer */ +#define ENET_NOCOPY_FRAME_TRANSMIT(len) enet_frame_transmit(NULL, (len)) +/* configure the transmit IP frame checksum offload calculation and insertion */ +void enet_transmit_checksum_config(enet_descriptors_struct *desc, uint32_t checksum); +/* ENET Tx and Rx function enable (include MAC and DMA module) */ +void enet_enable(void); +/* ENET Tx and Rx function disable (include MAC and DMA module) */ +void enet_disable(void); +/* configure MAC address */ +void enet_mac_address_set(enet_macaddress_enum mac_addr, uint8_t paddr[]); +/* get MAC address */ +void enet_mac_address_get(enet_macaddress_enum mac_addr, uint8_t paddr[]); + +/* get the ENET MAC/MSC/PTP/DMA status flag */ +FlagStatus enet_flag_get(enet_flag_enum enet_flag); +/* clear the ENET DMA status flag */ +void enet_flag_clear(enet_flag_clear_enum enet_flag); +/* enable ENET MAC/MSC/DMA interrupt */ +void enet_interrupt_enable(enet_int_enum enet_int); +/* disable ENET MAC/MSC/DMA interrupt */ +void enet_interrupt_disable(enet_int_enum enet_int); +/* get ENET MAC/MSC/DMA interrupt flag */ +FlagStatus enet_interrupt_flag_get(enet_int_flag_enum int_flag); +/* clear ENET DMA interrupt flag */ +void enet_interrupt_flag_clear(enet_int_flag_clear_enum int_flag_clear); + +/* MAC function */ +/* ENET Tx function enable (include MAC and DMA module) */ +void enet_tx_enable(void); +/* ENET Tx function disable (include MAC and DMA module) */ +void enet_tx_disable(void); +/* ENET Rx function enable (include MAC and DMA module) */ +void enet_rx_enable(void); +/* ENET Rx function disable (include MAC and DMA module) */ +void enet_rx_disable(void); +/* put registers value into the application buffer */ +void enet_registers_get(enet_registers_type_enum type, uint32_t *preg, uint32_t num); +/* enable the MAC address filter */ +void enet_address_filter_enable(enet_macaddress_enum mac_addr); +/* disable the MAC address filter */ +void enet_address_filter_disable(enet_macaddress_enum mac_addr); +/* configure the MAC address filter */ +void enet_address_filter_config(enet_macaddress_enum mac_addr, uint32_t addr_mask, uint32_t filter_type); +/* PHY interface configuration (configure SMI clock and reset PHY chip) */ +ErrStatus enet_phy_config(void); +/* write to/read from a PHY register */ +ErrStatus enet_phy_write_read(enet_phydirection_enum direction, uint16_t phy_address, uint16_t phy_reg, uint16_t *pvalue); +/* enable the loopback function of phy chip */ +ErrStatus enet_phyloopback_enable(void); +/* disable the loopback function of phy chip */ +ErrStatus enet_phyloopback_disable(void); +/* enable ENET forward feature */ +void enet_forward_feature_enable(uint32_t feature); +/* disable ENET forward feature */ +void enet_forward_feature_disable(uint32_t feature); +/* enable ENET filter feature */ +void enet_fliter_feature_enable(uint32_t feature); +/* disable ENET filter feature */ +void enet_fliter_feature_disable(uint32_t feature); + +/* flow control function */ +/* generate the pause frame, ENET will send pause frame after enable transmit flow control */ +ErrStatus enet_pauseframe_generate(void); +/* configure the pause frame detect type */ +void enet_pauseframe_detect_config(uint32_t detect); +/* configure the pause frame parameters */ +void enet_pauseframe_config(uint32_t pausetime, uint32_t pause_threshold); +/* configure the threshold of the flow control(deactive and active threshold) */ +void enet_flowcontrol_threshold_config(uint32_t deactive, uint32_t active); +/* enable ENET flow control feature */ +void enet_flowcontrol_feature_enable(uint32_t feature); +/* disable ENET flow control feature */ +void enet_flowcontrol_feature_disable(uint32_t feature); + +/* DMA function */ +/* get the dma transmit/receive process state */ +uint32_t enet_dmaprocess_state_get(enet_dmadirection_enum direction); +/* poll the dma transmission/reception enable */ +void enet_dmaprocess_resume(enet_dmadirection_enum direction); +/* check and recover the Rx process */ +void enet_rxprocess_check_recovery(void); +/* flush the ENET transmit fifo, and wait until the flush operation completes */ +ErrStatus enet_txfifo_flush(void); +/* get the transmit/receive address of current descriptor, or current buffer, or descriptor table */ +uint32_t enet_current_desc_address_get(enet_desc_reg_enum addr_get); +/* get the Tx or Rx descriptor information */ +uint32_t enet_desc_information_get(enet_descriptors_struct *desc, enet_descstate_enum info_get); +/* get the number of missed frames during receiving */ +void enet_missed_frame_counter_get(uint32_t *rxfifo_drop, uint32_t *rxdma_drop); + +/* descriptor function */ +/* get the bit flag of ENET dma descriptor */ +FlagStatus enet_desc_flag_get(enet_descriptors_struct *desc, uint32_t desc_flag); +/* set the bit flag of ENET dma tx descriptor */ +void enet_desc_flag_set(enet_descriptors_struct *desc, uint32_t desc_flag); +/* clear the bit flag of ENET dma tx descriptor */ +void enet_desc_flag_clear(enet_descriptors_struct *desc, uint32_t desc_flag); +/* when receiving the completed, set RS bit in ENET_DMA_STAT register will set */ +void enet_desc_receive_complete_bit_enable(enet_descriptors_struct *desc); +/* when receiving the completed, set RS bit in ENET_DMA_STAT register will not set */ +void enet_desc_receive_complete_bit_disable(enet_descriptors_struct *desc); +/* drop current receive frame */ +void enet_rxframe_drop(void); +/* enable DMA feature */ +void enet_dma_feature_enable(uint32_t feature); +/* disable DMA feature */ +void enet_dma_feature_disable(uint32_t feature); + +/* initialize the dma Tx/Rx descriptors's parameters in normal chain mode with ptp function */ +void enet_ptp_normal_descriptors_chain_init(enet_dmadirection_enum direction, enet_descriptors_struct *desc_ptptab); +/* initialize the dma Tx/Rx descriptors's parameters in normal ring mode with ptp function */ +void enet_ptp_normal_descriptors_ring_init(enet_dmadirection_enum direction, enet_descriptors_struct *desc_ptptab); +/* receive a packet data with timestamp values to application buffer, when the DMA is in normal mode */ +ErrStatus enet_ptpframe_receive_normal_mode(uint8_t *buffer, uint32_t bufsize, uint32_t timestamp[]); +/* handle current received frame but without data copy to application buffer in PTP normal mode */ +#define ENET_NOCOPY_PTPFRAME_RECEIVE_NORMAL_MODE(ptr) enet_ptpframe_receive_normal_mode(NULL, 0U, (ptr)) +/* send data with timestamp values in application buffer as a transmit packet, when the DMA is in normal mode */ +ErrStatus enet_ptpframe_transmit_normal_mode(uint8_t *buffer, uint32_t length, uint32_t timestamp[]); +/* handle current transmit frame but without data copy from application buffer in PTP normal mode */ +#define ENET_NOCOPY_PTPFRAME_TRANSMIT_NORMAL_MODE(len, ptr) enet_ptpframe_transmit_normal_mode(NULL, (len), (ptr)) + +/* WUM function */ +/* wakeup frame filter register pointer reset */ +void enet_wum_filter_register_pointer_reset(void); +/* set the remote wakeup frame registers */ +void enet_wum_filter_config(uint32_t pdata[]); +/* enable wakeup management features */ +void enet_wum_feature_enable(uint32_t feature); +/* disable wakeup management features */ +void enet_wum_feature_disable(uint32_t feature); + +/* MSC function */ +/* reset the MAC statistics counters */ +void enet_msc_counters_reset(void); +/* enable the MAC statistics counter features */ +void enet_msc_feature_enable(uint32_t feature); +/* disable the MAC statistics counter features */ +void enet_msc_feature_disable(uint32_t feature); +/* get MAC statistics counter */ +uint32_t enet_msc_counters_get(enet_msc_counter_enum counter); + +/* PTP function */ +/* change subsecond to nanosecond */ +uint32_t enet_ptp_subsecond_2_nanosecond(uint32_t subsecond); +/* change nanosecond to subsecond */ +uint32_t enet_ptp_nanosecond_2_subsecond(uint32_t nanosecond); +/* enable the PTP features */ +void enet_ptp_feature_enable(uint32_t feature); +/* disable the PTP features */ +void enet_ptp_feature_disable(uint32_t feature); +/* configure the PTP timestamp function */ +ErrStatus enet_ptp_timestamp_function_config(enet_ptp_function_enum func); +/* configure the PTP system time subsecond increment value */ +void enet_ptp_subsecond_increment_config(uint32_t subsecond); +/* adjusting the PTP clock frequency only in fine update mode */ +void enet_ptp_timestamp_addend_config(uint32_t add); +/* initializing or adding/subtracting to second of the PTP system time */ +void enet_ptp_timestamp_update_config(uint32_t sign, uint32_t second, uint32_t subsecond); +/* configure the PTP expected target time */ +void enet_ptp_expected_time_config(uint32_t second, uint32_t nanosecond); +/* get the PTP current system time */ +void enet_ptp_system_time_get(enet_ptp_systime_struct *systime_struct); +/* configure and start PTP timestamp counter */ +void enet_ptp_start(int32_t updatemethod, uint32_t init_sec, uint32_t init_subsec, uint32_t carry_cfg, uint32_t accuracy_cfg); +/* adjust frequency in fine method by configure addend register */ +void enet_ptp_finecorrection_adjfreq(int32_t carry_cfg); +/* update system time in coarse method */ +void enet_ptp_coarsecorrection_systime_update(enet_ptp_systime_struct *systime_struct); +/* set system time in fine method */ +void enet_ptp_finecorrection_settime(enet_ptp_systime_struct * systime_struct); +/* get the ptp flag status */ +FlagStatus enet_ptp_flag_get(uint32_t flag); + +/* internal function */ +/* reset the ENET initpara struct, call it before using enet_initpara_config() */ +void enet_initpara_reset(void); +/* initialize ENET peripheral with generally concerned parameters, call it by enet_init() */ +static void enet_default_init(void); +#ifdef USE_DELAY +/* user can provide more timing precise _ENET_DELAY_ function */ +#define _ENET_DELAY_ delay_ms +#else +/* insert a delay time */ +static void enet_delay(uint32_t ncount); +/* default _ENET_DELAY_ function with less precise timing */ +#define _ENET_DELAY_ enet_delay +#endif + +#endif /* GD32F10X_ENET_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exmc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exmc.h new file mode 100644 index 0000000..3116d95 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exmc.h @@ -0,0 +1,428 @@ +/*! + \file gd32f10x_exmc.h + \brief definitions for the EXMC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_EXMC_H +#define GD32F10X_EXMC_H + +#include "gd32f10x.h" + +/* EXMC definitions */ +#define EXMC (EXMC_BASE) /*!< EXMC register base address */ + +/* registers definitions */ +/* NOR/PSRAM */ +#define EXMC_SNCTL0 REG32(EXMC + 0x00U) /*!< EXMC SRAM/NOR flash control register 0 */ +#define EXMC_SNTCFG0 REG32(EXMC + 0x04U) /*!< EXMC SRAM/NOR flash timing configuration register 0 */ +#define EXMC_SNWTCFG0 REG32(EXMC + 0x104U) /*!< EXMC SRAM/NOR flash write timing configuration register 0 */ + +#define EXMC_SNCTL1 REG32(EXMC + 0x08U) /*!< EXMC SRAM/NOR flash control register 1 */ +#define EXMC_SNTCFG1 REG32(EXMC + 0x0CU) /*!< EXMC SRAM/NOR flash timing configuration register 1 */ +#define EXMC_SNWTCFG1 REG32(EXMC + 0x10CU) /*!< EXMC SRAM/NOR flash write timing configuration register 1 */ + +#define EXMC_SNCTL2 REG32(EXMC + 0x10U) /*!< EXMC SRAM/NOR flash control register 2 */ +#define EXMC_SNTCFG2 REG32(EXMC + 0x14U) /*!< EXMC SRAM/NOR flash timing configuration register 2 */ +#define EXMC_SNWTCFG2 REG32(EXMC + 0x114U) /*!< EXMC SRAM/NOR flash write timing configuration register 2 */ + +#define EXMC_SNCTL3 REG32(EXMC + 0x18U) /*!< EXMC SRAM/NOR flash control register 3 */ +#define EXMC_SNTCFG3 REG32(EXMC + 0x1CU) /*!< EXMC SRAM/NOR flash timing configuration register 3 */ +#define EXMC_SNWTCFG3 REG32(EXMC + 0x11CU) /*!< EXMC SRAM/NOR flash write timing configuration register 3 */ + +/* NAND/PC card */ +#define EXMC_NPCTL1 REG32(EXMC + 0x60U) /*!< EXMC NAND/PC card control register 1 */ +#define EXMC_NPINTEN1 REG32(EXMC + 0x64U) /*!< EXMC NAND/PC card interrupt enable register 1 */ +#define EXMC_NPCTCFG1 REG32(EXMC + 0x68U) /*!< EXMC NAND/PC card common space timing configuration register 1 */ +#define EXMC_NPATCFG1 REG32(EXMC + 0x6CU) /*!< EXMC NAND/PC card attribute space timing configuration register 1 */ +#define EXMC_NECC1 REG32(EXMC + 0x74U) /*!< EXMC NAND ECC register 1 */ + +#define EXMC_NPCTL2 REG32(EXMC + 0x80U) /*!< EXMC NAND/PC card control register 2 */ +#define EXMC_NPINTEN2 REG32(EXMC + 0x84U) /*!< EXMC NAND/PC card interrupt enable register 2 */ +#define EXMC_NPCTCFG2 REG32(EXMC + 0x88U) /*!< EXMC NAND/PC card common space timing configuration register 2 */ +#define EXMC_NPATCFG2 REG32(EXMC + 0x8CU) /*!< EXMC NAND/PC card attribute space timing configuration register 2 */ +#define EXMC_NECC2 REG32(EXMC + 0x94U) /*!< EXMC NAND ECC register 2 */ + +#define EXMC_NPCTL3 REG32(EXMC + 0xA0U) /*!< EXMC NAND/PC card control register 3 */ +#define EXMC_NPINTEN3 REG32(EXMC + 0xA4U) /*!< EXMC NAND/PC card interrupt enable register 3 */ +#define EXMC_NPCTCFG3 REG32(EXMC + 0xA8U) /*!< EXMC NAND/PC card common space timing configuration register 3 */ +#define EXMC_NPATCFG3 REG32(EXMC + 0xACU) /*!< EXMC NAND/PC card attribute space timing configuration register 3 */ +#define EXMC_PIOTCFG3 REG32(EXMC + 0xB0U) /*!< EXMC PC card I/O space timing configuration register */ + +/* bits definitions */ +/* NOR/PSRAM */ +/* EXMC_SNCTLx,x=0..3 */ +#define EXMC_SNCTL_NRBKEN BIT(0) /*!< NOR bank enable */ +#define EXMC_SNCTL_NRMUX BIT(1) /*!< NOR bank memory address/data multiplexing */ +#define EXMC_SNCTL_NRTP BITS(2,3) /*!< NOR bank memory type */ +#define EXMC_SNCTL_NRW BITS(4,5) /*!< NOR bank memory data bus width */ +#define EXMC_SNCTL_NREN BIT(6) /*!< NOR flash access enable */ +#define EXMC_SNCTL_SBRSTEN BIT(8) /*!< synchronous burst enable */ +#define EXMC_SNCTL_NRWTPOL BIT(9) /*!< NWAIT signal polarity */ +#define EXMC_SNCTL_WRAPEN BIT(10) /*!< wrapped burst mode enable */ +#define EXMC_SNCTL_NRWTCFG BIT(11) /*!< NWAIT signal configuration, only work in synchronous mode */ +#define EXMC_SNCTL_WREN BIT(12) /*!< write enable */ +#define EXMC_SNCTL_NRWTEN BIT(13) /*!< NWAIT signal enable */ +#define EXMC_SNCTL_EXMODEN BIT(14) /*!< extended mode enable */ +#define EXMC_SNCTL_ASYNCWAIT BIT(15) /*!< asynchronous wait */ +#define EXMC_SNCTL_SYNCWR BIT(19) /*!< synchronous write */ + +/* EXMC_SNTCFGx,x=0..3 */ +#define EXMC_SNTCFG_ASET BITS(0,3) /*!< address setup time */ +#define EXMC_SNTCFG_AHLD BITS(4,7) /*!< address hold time */ +#define EXMC_SNTCFG_DSET BITS(8,15) /*!< data setup time */ +#define EXMC_SNTCFG_BUSLAT BITS(16,19) /*!< bus latency */ +#define EXMC_SNTCFG_CKDIV BITS(20,23) /*!< synchronous clock divide ratio */ +#define EXMC_SNTCFG_DLAT BITS(24,27) /*!< data latency for NOR flash */ +#define EXMC_SNTCFG_ASYNCMOD BITS(28,29) /*!< asynchronous access mode */ + +/* EXMC_SNWTCFGx,x=0..3 */ +#define EXMC_SNWTCFG_WASET BITS(0,3) /*!< address setup time */ +#define EXMC_SNWTCFG_WAHLD BITS(4,7) /*!< address hold time */ +#define EXMC_SNWTCFG_WDSET BITS(8,15) /*!< data setup time */ +#define EXMC_SNWTCFG_CKDIV BITS(20,23) /*!< synchronous clock divide ratio */ +#define EXMC_SNWTCFG_DLAT BITS(24,27) /*!< data latency for NOR flash */ +#define EXMC_SNWTCFG_WASYNCMOD BITS(28,29) /*!< asynchronous access mode */ + +/* NAND/PC card */ +/* EXMC_NPCTLx,x=1..3 */ +#define EXMC_NPCTL_NDWTEN BIT(1) /*!< wait feature enable */ +#define EXMC_NPCTL_NDBKEN BIT(2) /*!< NAND bank enable */ +#define EXMC_NPCTL_NDTP BIT(3) /*!< NAND bank memory type */ +#define EXMC_NPCTL_NDW BITS(4,5) /*!< NAND bank memory data bus width */ +#define EXMC_NPCTL_ECCEN BIT(6) /*!< ECC enable */ +#define EXMC_NPCTL_CTR BITS(9,12) /*!< CLE to RE delay */ +#define EXMC_NPCTL_ATR BITS(13,16) /*!< ALE to RE delay */ +#define EXMC_NPCTL_ECCSZ BITS(17,19) /*!< ECC size */ + +/* EXMC_NPINTENx,x=1..3 */ +#define EXMC_NPINTEN_INTRS BIT(0) /*!< interrupt rising edge status */ +#define EXMC_NPINTEN_INTHS BIT(1) /*!< interrupt high-level status */ +#define EXMC_NPINTEN_INTFS BIT(2) /*!< interrupt falling edge status */ +#define EXMC_NPINTEN_INTREN BIT(3) /*!< interrupt rising edge detection enable */ +#define EXMC_NPINTEN_INTHEN BIT(4) /*!< interrupt high-level detection enable */ +#define EXMC_NPINTEN_INTFEN BIT(5) /*!< interrupt falling edge detection enable */ +#define EXMC_NPINTEN_FFEPT BIT(6) /*!< FIFO empty flag */ + +/* EXMC_NPCTCFGx,x=1..3 */ +#define EXMC_NPCTCFG_COMSET BITS(0,7) /*!< common memory setup time */ +#define EXMC_NPCTCFG_COMWAIT BITS(8,15) /*!< common memory wait time */ +#define EXMC_NPCTCFG_COMHLD BITS(16,23) /*!< common memory hold time */ +#define EXMC_NPCTCFG_COMHIZ BITS(24,31) /*!< common memory data bus HiZ time */ + +/* EXMC_NPATCFGx,x=1..3 */ +#define EXMC_NPATCFG_ATTSET BITS(0,7) /*!< attribute memory setup time */ +#define EXMC_NPATCFG_ATTWAIT BITS(8,15) /*!< attribute memory wait time */ +#define EXMC_NPATCFG_ATTHLD BITS(16,23) /*!< attribute memory hold time */ +#define EXMC_NPATCFG_ATTHIZ BITS(24,31) /*!< attribute memory data bus HiZ time */ + +/* EXMC_PIOTCFG3 */ +#define EXMC_PIOTCFG3_IOSET BITS(0,7) /*!< IO space setup time */ +#define EXMC_PIOTCFG3_IOWAIT BITS(8,15) /*!< IO space wait time */ +#define EXMC_PIOTCFG3_IOHLD BITS(16,23) /*!< IO space hold time */ +#define EXMC_PIOTCFG3_IOHIZ BITS(24,31) /*!< IO space data bus HiZ time */ + +/* EXMC_NECCx,x=1,2 */ +#define EXMC_NECC_ECC BITS(0,31) /*!< ECC result */ + +/* constants definitions */ +/* EXMC NOR/SRAM timing initialize struct */ +typedef struct +{ + uint32_t asyn_access_mode; /*!< asynchronous access mode */ + uint32_t syn_data_latency; /*!< configure the data latency */ + uint32_t syn_clk_division; /*!< configure the clock divide ratio */ + uint32_t bus_latency; /*!< configure the bus latency */ + uint32_t asyn_data_setuptime; /*!< configure the data setup time,asynchronous access mode valid */ + uint32_t asyn_address_holdtime; /*!< configure the address hold time,asynchronous access mode valid */ + uint32_t asyn_address_setuptime; /*!< configure the data setup time,asynchronous access mode valid */ +}exmc_norsram_timing_parameter_struct; + +/* EXMC NOR/SRAM initialize struct */ +typedef struct +{ + uint32_t norsram_region; /*!< select the region of EXMC NOR/SRAM bank */ + uint32_t write_mode; /*!< the write mode, synchronous mode or asynchronous mode */ + uint32_t extended_mode; /*!< enable or disable the extended mode */ + uint32_t asyn_wait; /*!< enable or disable the asynchronous wait function */ + uint32_t nwait_signal; /*!< enable or disable the NWAIT signal while in synchronous bust mode */ + uint32_t memory_write; /*!< enable or disable the write operation */ + uint32_t nwait_config; /*!< NWAIT signal configuration */ + uint32_t wrap_burst_mode; /*!< enable or disable the wrap burst mode */ + uint32_t nwait_polarity; /*!< specifies the polarity of NWAIT signal from memory */ + uint32_t burst_mode; /*!< enable or disable the burst mode */ + uint32_t databus_width; /*!< specifies the databus width of external memory */ + uint32_t memory_type; /*!< specifies the type of external memory */ + uint32_t address_data_mux; /*!< specifies whether the data bus and address bus are multiplexed */ + exmc_norsram_timing_parameter_struct* read_write_timing; /*!< timing parameters for read and write if the extended mode is not used or the timing + parameters for read if the extended mode is used */ + exmc_norsram_timing_parameter_struct* write_timing; /*!< timing parameters for write when the extended mode is used */ +}exmc_norsram_parameter_struct; + +/* EXMC NAND/PC card timing initialize struct */ +typedef struct +{ + uint32_t databus_hiztime; /*!< configure the dadtabus HiZ time for write operation */ + uint32_t holdtime; /*!< configure the address hold time(or the data hold time for write operation) */ + uint32_t waittime; /*!< configure the minimum wait time */ + uint32_t setuptime; /*!< configure the address setup time */ +}exmc_nand_pccard_timing_parameter_struct; + +/* EXMC NAND initialize struct */ +typedef struct +{ + uint32_t nand_bank; /*!< select the bank of NAND */ + uint32_t ecc_size; /*!< the page size for the ECC calculation */ + uint32_t atr_latency; /*!< configure the latency of ALE low to RB low */ + uint32_t ctr_latency; /*!< configure the latency of CLE low to RB low */ + uint32_t ecc_logic; /*!< enable or disable the ECC calculation logic */ + uint32_t databus_width; /*!< the NAND flash databus width */ + uint32_t wait_feature; /*!< enables or disables the wait feature */ + exmc_nand_pccard_timing_parameter_struct* common_space_timing; /*!< the timing parameters for NAND flash common space */ + exmc_nand_pccard_timing_parameter_struct* attribute_space_timing; /*!< the timing parameters for NAND flash attribute space */ +}exmc_nand_parameter_struct; + +/* EXMC PC card initialize struct */ +typedef struct +{ + uint32_t atr_latency; /*!< configure the latency of ALE low to RB low */ + uint32_t ctr_latency; /*!< configure the latency of CLE low to RB low */ + uint32_t wait_feature; /*!< enables or disables the Wait feature */ + exmc_nand_pccard_timing_parameter_struct* common_space_timing; /*!< the timing parameters for NAND flash common space */ + exmc_nand_pccard_timing_parameter_struct* attribute_space_timing; /*!< the timing parameters for NAND flash attribute space */ + exmc_nand_pccard_timing_parameter_struct* io_space_timing; /*!< the timing parameters for NAND flash IO space */ +}exmc_pccard_parameter_struct;; + +/* EXMC register address */ +#define EXMC_SNCTL(region) REG32(EXMC + 0x08U * (region)) /*!< EXMC SRAM/NOR flash control register */ +#define EXMC_SNTCFG(region) REG32(EXMC + 0x04U + 0x08U * (region)) /*!< EXMC SRAM/NOR flash timing configuration register */ +#define EXMC_SNWTCFG(region) REG32(EXMC + 0x104U + 0x08U * (region)) /*!< EXMC SRAM/NOR flash write timing configuration register */ + +#define EXMC_NPCTL(bank) REG32(EXMC + 0x40U + 0x20U * (bank)) /*!< EXMC NAND/PC card control register */ +#define EXMC_NPINTEN(bank) REG32(EXMC + 0x44U + 0x20U * (bank)) /*!< EXMC NAND/PC card interrupt enable register */ +#define EXMC_NPCTCFG(bank) REG32(EXMC + 0x48U + 0x20U * (bank)) /*!< EXMC NAND/PC card common space timing configuration register */ +#define EXMC_NPATCFG(bank) REG32(EXMC + 0x4CU + 0x20U * (bank)) /*!< EXMC NAND/PC card attribute space timing configuration register */ +#define EXMC_NECC(bank) REG32(EXMC + 0x54U + 0x20U * (bank)) /*!< EXMC NAND ECC register */ + +/* NOR bank memory data bus width */ +#define SNCTL_NRW(regval) (BITS(4,5) & ((uint32_t)(regval) << 4)) +#define EXMC_NOR_DATABUS_WIDTH_8B SNCTL_NRW(0) /*!< NOR data width 8 bits */ +#define EXMC_NOR_DATABUS_WIDTH_16B SNCTL_NRW(1) /*!< NOR data width 16 bits */ + +/* NOR bank memory type */ +#define SNCTL_NRTP(regval) (BITS(2,3) & ((uint32_t)(regval) << 2)) +#define EXMC_MEMORY_TYPE_SRAM SNCTL_NRTP(0) /*!< SRAM,ROM */ +#define EXMC_MEMORY_TYPE_PSRAM SNCTL_NRTP(1) /*!< PSRAM,CRAM */ +#define EXMC_MEMORY_TYPE_NOR SNCTL_NRTP(2) /*!< NOR flash */ + +/* asynchronous access mode */ +#define SNTCFG_ASYNCMOD(regval) (BITS(28,29) & ((uint32_t)(regval) << 28)) +#define EXMC_ACCESS_MODE_A SNTCFG_ASYNCMOD(0) /*!< mode A access */ +#define EXMC_ACCESS_MODE_B SNTCFG_ASYNCMOD(1) /*!< mode B access */ +#define EXMC_ACCESS_MODE_C SNTCFG_ASYNCMOD(2) /*!< mode C access */ +#define EXMC_ACCESS_MODE_D SNTCFG_ASYNCMOD(3) /*!< mode D access */ + +/* data latency for NOR flash */ +#define SNTCFG_DLAT(regval) (BITS(24,27) & ((uint32_t)(regval) << 24)) +#define EXMC_DATALAT_2_CLK SNTCFG_DLAT(0) /*!< data latency 2 EXMC_CLK */ +#define EXMC_DATALAT_3_CLK SNTCFG_DLAT(1) /*!< data latency 3 EXMC_CLK */ +#define EXMC_DATALAT_4_CLK SNTCFG_DLAT(2) /*!< data latency 4 EXMC_CLK */ +#define EXMC_DATALAT_5_CLK SNTCFG_DLAT(3) /*!< data latency 5 EXMC_CLK */ +#define EXMC_DATALAT_6_CLK SNTCFG_DLAT(4) /*!< data latency 6 EXMC_CLK */ +#define EXMC_DATALAT_7_CLK SNTCFG_DLAT(5) /*!< data latency 7 EXMC_CLK */ +#define EXMC_DATALAT_8_CLK SNTCFG_DLAT(6) /*!< data latency 8 EXMC_CLK */ +#define EXMC_DATALAT_9_CLK SNTCFG_DLAT(7) /*!< data latency 9 EXMC_CLK */ +#define EXMC_DATALAT_10_CLK SNTCFG_DLAT(8) /*!< data latency 10 EXMC_CLK */ +#define EXMC_DATALAT_11_CLK SNTCFG_DLAT(9) /*!< data latency 11 EXMC_CLK */ +#define EXMC_DATALAT_12_CLK SNTCFG_DLAT(10) /*!< data latency 12 EXMC_CLK */ +#define EXMC_DATALAT_13_CLK SNTCFG_DLAT(11) /*!< data latency 13 EXMC_CLK */ +#define EXMC_DATALAT_14_CLK SNTCFG_DLAT(12) /*!< data latency 14 EXMC_CLK */ +#define EXMC_DATALAT_15_CLK SNTCFG_DLAT(13) /*!< data latency 15 EXMC_CLK */ +#define EXMC_DATALAT_16_CLK SNTCFG_DLAT(14) /*!< data latency 16 EXMC_CLK */ +#define EXMC_DATALAT_17_CLK SNTCFG_DLAT(15) /*!< data latency 17 EXMC_CLK */ + +/* synchronous clock divide ratio */ +#define SNTCFG_CKDIV(regval) (BITS(20,23) & ((uint32_t)(regval) << 20)) +#define EXMC_SYN_CLOCK_RATIO_DISABLE SNTCFG_CKDIV(0) /*!< EXMC_CLK disable */ +#define EXMC_SYN_CLOCK_RATIO_2_CLK SNTCFG_CKDIV(1) /*!< frequency EXMC_CLK = HCLK/2 */ +#define EXMC_SYN_CLOCK_RATIO_3_CLK SNTCFG_CKDIV(2) /*!< frequency EXMC_CLK = HCLK/3 */ +#define EXMC_SYN_CLOCK_RATIO_4_CLK SNTCFG_CKDIV(3) /*!< frequency EXMC_CLK = HCLK/4 */ +#define EXMC_SYN_CLOCK_RATIO_5_CLK SNTCFG_CKDIV(4) /*!< frequency EXMC_CLK = HCLK/5 */ +#define EXMC_SYN_CLOCK_RATIO_6_CLK SNTCFG_CKDIV(5) /*!< frequency EXMC_CLK = HCLK/6 */ +#define EXMC_SYN_CLOCK_RATIO_7_CLK SNTCFG_CKDIV(6) /*!< frequency EXMC_CLK = HCLK/7 */ +#define EXMC_SYN_CLOCK_RATIO_8_CLK SNTCFG_CKDIV(7) /*!< frequency EXMC_CLK = HCLK/8 */ +#define EXMC_SYN_CLOCK_RATIO_9_CLK SNTCFG_CKDIV(8) /*!< frequency EXMC_CLK = HCLK/9 */ +#define EXMC_SYN_CLOCK_RATIO_10_CLK SNTCFG_CKDIV(9) /*!< frequency EXMC_CLK = HCLK/10 */ +#define EXMC_SYN_CLOCK_RATIO_11_CLK SNTCFG_CKDIV(10) /*!< frequency EXMC_CLK = HCLK/11 */ +#define EXMC_SYN_CLOCK_RATIO_12_CLK SNTCFG_CKDIV(11) /*!< frequency EXMC_CLK = HCLK/12 */ +#define EXMC_SYN_CLOCK_RATIO_13_CLK SNTCFG_CKDIV(12) /*!< frequency EXMC_CLK = HCLK/13 */ +#define EXMC_SYN_CLOCK_RATIO_14_CLK SNTCFG_CKDIV(13) /*!< frequency EXMC_CLK = HCLK/14 */ +#define EXMC_SYN_CLOCK_RATIO_15_CLK SNTCFG_CKDIV(14) /*!< frequency EXMC_CLK = HCLK/15 */ +#define EXMC_SYN_CLOCK_RATIO_16_CLK SNTCFG_CKDIV(15) /*!< frequency EXMC_CLK = HCLK/16 */ + +/* ECC size */ +#define NPCTL_ECCSZ(regval) (BITS(17,19) & ((uint32_t)(regval) << 17)) +#define EXMC_ECC_SIZE_256BYTES NPCTL_ECCSZ(0) /* 256 bytes */ +#define EXMC_ECC_SIZE_512BYTES NPCTL_ECCSZ(1) /* 512 bytes */ +#define EXMC_ECC_SIZE_1024BYTES NPCTL_ECCSZ(2) /* 1024 bytes */ +#define EXMC_ECC_SIZE_2048BYTES NPCTL_ECCSZ(3) /* 2048 bytes */ +#define EXMC_ECC_SIZE_4096BYTES NPCTL_ECCSZ(4) /* 4096 bytes */ +#define EXMC_ECC_SIZE_8192BYTES NPCTL_ECCSZ(5) /* 8192 bytes */ + +/* ALE to RE delay */ +#define NPCTL_ATR(regval) (BITS(13,16) & ((uint32_t)(regval) << 13)) +#define EXMC_ALE_RE_DELAY_1_HCLK NPCTL_ATR(0) /* ALE to RE delay = 1*HCLK */ +#define EXMC_ALE_RE_DELAY_2_HCLK NPCTL_ATR(1) /* ALE to RE delay = 2*HCLK */ +#define EXMC_ALE_RE_DELAY_3_HCLK NPCTL_ATR(2) /* ALE to RE delay = 3*HCLK */ +#define EXMC_ALE_RE_DELAY_4_HCLK NPCTL_ATR(3) /* ALE to RE delay = 4*HCLK */ +#define EXMC_ALE_RE_DELAY_5_HCLK NPCTL_ATR(4) /* ALE to RE delay = 5*HCLK */ +#define EXMC_ALE_RE_DELAY_6_HCLK NPCTL_ATR(5) /* ALE to RE delay = 6*HCLK */ +#define EXMC_ALE_RE_DELAY_7_HCLK NPCTL_ATR(6) /* ALE to RE delay = 7*HCLK */ +#define EXMC_ALE_RE_DELAY_8_HCLK NPCTL_ATR(7) /* ALE to RE delay = 8*HCLK */ +#define EXMC_ALE_RE_DELAY_9_HCLK NPCTL_ATR(8) /* ALE to RE delay = 9*HCLK */ +#define EXMC_ALE_RE_DELAY_10_HCLK NPCTL_ATR(9) /* ALE to RE delay = 10*HCLK */ +#define EXMC_ALE_RE_DELAY_11_HCLK NPCTL_ATR(10) /* ALE to RE delay = 11*HCLK */ +#define EXMC_ALE_RE_DELAY_12_HCLK NPCTL_ATR(11) /* ALE to RE delay = 12*HCLK */ +#define EXMC_ALE_RE_DELAY_13_HCLK NPCTL_ATR(12) /* ALE to RE delay = 13*HCLK */ +#define EXMC_ALE_RE_DELAY_14_HCLK NPCTL_ATR(13) /* ALE to RE delay = 14*HCLK */ +#define EXMC_ALE_RE_DELAY_15_HCLK NPCTL_ATR(14) /* ALE to RE delay = 15*HCLK */ +#define EXMC_ALE_RE_DELAY_16_HCLK NPCTL_ATR(15) /* ALE to RE delay = 16*HCLK */ + +/* CLE to RE delay */ +#define NPCTL_CTR(regval) (BITS(9,12) & ((uint32_t)(regval) << 9)) +#define EXMC_CLE_RE_DELAY_1_HCLK NPCTL_CTR(0) /* CLE to RE delay = 1*HCLK */ +#define EXMC_CLE_RE_DELAY_2_HCLK NPCTL_CTR(1) /* CLE to RE delay = 2*HCLK */ +#define EXMC_CLE_RE_DELAY_3_HCLK NPCTL_CTR(2) /* CLE to RE delay = 3*HCLK */ +#define EXMC_CLE_RE_DELAY_4_HCLK NPCTL_CTR(3) /* CLE to RE delay = 4*HCLK */ +#define EXMC_CLE_RE_DELAY_5_HCLK NPCTL_CTR(4) /* CLE to RE delay = 5*HCLK */ +#define EXMC_CLE_RE_DELAY_6_HCLK NPCTL_CTR(5) /* CLE to RE delay = 6*HCLK */ +#define EXMC_CLE_RE_DELAY_7_HCLK NPCTL_CTR(6) /* CLE to RE delay = 7*HCLK */ +#define EXMC_CLE_RE_DELAY_8_HCLK NPCTL_CTR(7) /* CLE to RE delay = 8*HCLK */ +#define EXMC_CLE_RE_DELAY_9_HCLK NPCTL_CTR(8) /* CLE to RE delay = 9*HCLK */ +#define EXMC_CLE_RE_DELAY_10_HCLK NPCTL_CTR(9) /* CLE to RE delay = 10*HCLK */ +#define EXMC_CLE_RE_DELAY_11_HCLK NPCTL_CTR(10) /* CLE to RE delay = 11*HCLK */ +#define EXMC_CLE_RE_DELAY_12_HCLK NPCTL_CTR(11) /* CLE to RE delay = 12*HCLK */ +#define EXMC_CLE_RE_DELAY_13_HCLK NPCTL_CTR(12) /* CLE to RE delay = 13*HCLK */ +#define EXMC_CLE_RE_DELAY_14_HCLK NPCTL_CTR(13) /* CLE to RE delay = 14*HCLK */ +#define EXMC_CLE_RE_DELAY_15_HCLK NPCTL_CTR(14) /* CLE to RE delay = 15*HCLK */ +#define EXMC_CLE_RE_DELAY_16_HCLK NPCTL_CTR(15) /* CLE to RE delay = 16*HCLK */ + +/* NAND bank memory data bus width */ +#define NPCTL_NDW(regval) (BITS(4,5) & ((uint32_t)(regval) << 4)) +#define EXMC_NAND_DATABUS_WIDTH_8B NPCTL_NDW(0) /*!< NAND data width 8 bits */ +#define EXMC_NAND_DATABUS_WIDTH_16B NPCTL_NDW(1) /*!< NAND data width 16 bits */ + +/* EXMC NOR/SRAM bank region definition */ +#define EXMC_BANK0_NORSRAM_REGION0 ((uint32_t)0x00000000U) /*!< bank0 NOR/SRAM region0 */ +#define EXMC_BANK0_NORSRAM_REGION1 ((uint32_t)0x00000001U) /*!< bank0 NOR/SRAM region1 */ +#define EXMC_BANK0_NORSRAM_REGION2 ((uint32_t)0x00000002U) /*!< bank0 NOR/SRAM region2 */ +#define EXMC_BANK0_NORSRAM_REGION3 ((uint32_t)0x00000003U) /*!< bank0 NOR/SRAM region3 */ + +/* EXMC NOR/SRAM write mode */ +#define EXMC_ASYN_WRITE ((uint32_t)0x00000000U) /*!< asynchronous write mode */ +#define EXMC_SYN_WRITE ((uint32_t)0x00080000U) /*!< synchronous write mode */ + +/* EXMC NWAIT signal configuration */ +#define EXMC_NWAIT_CONFIG_BEFORE ((uint32_t)0x00000000U) /*!< NWAIT signal is active one data cycle before wait state */ +#define EXMC_NWAIT_CONFIG_DURING ((uint32_t)0x00000800U) /*!< NWAIT signal is active during wait state */ + +/* EXMC NWAIT signal polarity configuration */ +#define EXMC_NWAIT_POLARITY_LOW ((uint32_t)0x00000000U) /*!< low level is active of NWAIT */ +#define EXMC_NWAIT_POLARITY_HIGH ((uint32_t)0x00000200U) /*!< high level is active of NWAIT */ + +/* EXMC NAND/PC card bank definition */ +#define EXMC_BANK1_NAND ((uint32_t)0x00000001U) /*!< bank1 NAND flash */ +#define EXMC_BANK2_NAND ((uint32_t)0x00000002U) /*!< bank2 NAND flash */ +#define EXMC_BANK3_PCCARD ((uint32_t)0x00000003U) /*!< bank3 PC card */ + +/* EXMC flag bits */ +#define EXMC_NAND_PCCARD_FLAG_RISE EXMC_NPINTEN_INTRS /*!< interrupt rising edge status */ +#define EXMC_NAND_PCCARD_FLAG_LEVEL EXMC_NPINTEN_INTHS /*!< interrupt high-level status */ +#define EXMC_NAND_PCCARD_FLAG_FALL EXMC_NPINTEN_INTFS /*!< interrupt falling edge status */ +#define EXMC_NAND_PCCARD_FLAG_FIFOE EXMC_NPINTEN_FFEPT /*!< FIFO empty flag */ + +/* EXMC interrupt flag bits */ +#define EXMC_NAND_PCCARD_INT_RISE EXMC_NPINTEN_INTREN /*!< interrupt rising edge detection enable */ +#define EXMC_NAND_PCCARD_INT_LEVEL EXMC_NPINTEN_INTHEN /*!< interrupt high-level detection enable */ +#define EXMC_NAND_PCCARD_INT_FALL EXMC_NPINTEN_INTFEN /*!< interrupt falling edge detection enable */ + +/* function declarations */ +/* deinitialize EXMC NOR/SRAM region */ +void exmc_norsram_deinit(uint32_t norsram_region); +/* exmc_norsram_parameter_struct parameter initialize */ +void exmc_norsram_struct_para_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct); +/* initialize EXMC NOR/SRAM region */ +void exmc_norsram_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct); +/* EXMC NOR/SRAM bank enable */ +void exmc_norsram_enable(uint32_t norsram_region); +/* EXMC NOR/SRAM bank disable */ +void exmc_norsram_disable(uint32_t norsram_region); + +/* deinitialize EXMC NAND bank */ +void exmc_nand_deinit(uint32_t nand_bank); +/* initialize EXMC NAND bank */ +void exmc_nand_init(exmc_nand_parameter_struct* exmc_nand_init_struct); +/* exmc_nand_init_struct parameter initialize */ +void exmc_nand_struct_para_init(exmc_nand_parameter_struct* exmc_nand_init_struct); +/* EXMC NAND bank enable */ +void exmc_nand_enable(uint32_t nand_bank); +/* EXMC NAND bank disable */ +void exmc_nand_disable(uint32_t nand_bank); +/* enable or disable the EXMC NAND ECC function */ +void exmc_nand_ecc_config(uint32_t nand_bank, ControlStatus newvalue); +/* get the EXMC ECC value */ +uint32_t exmc_ecc_get(uint32_t nand_bank); + +/* deinitialize EXMC PC card bank */ +void exmc_pccard_deinit(void); +/* initialize EXMC PC card bank */ +void exmc_pccard_init(exmc_pccard_parameter_struct* exmc_pccard_init_struct); +/* exmc_pccard_parameter_struct parameter initialize */ +void exmc_pccard_struct_para_init(exmc_pccard_parameter_struct* exmc_pccard_init_struct); +/* EXMC PC card bank enable */ +void exmc_pccard_enable(void); +/* EXMC PC card bank disable */ +void exmc_pccard_disable(void); + +/* enable EXMC interrupt */ +void exmc_interrupt_enable(uint32_t bank, uint32_t interrupt_source); +/* disable EXMC interrupt */ +void exmc_interrupt_disable(uint32_t bank, uint32_t interrupt_source); +/* check EXMC flag is set or not */ +FlagStatus exmc_flag_get(uint32_t bank, uint32_t flag); +/* clear EXMC flag */ +void exmc_flag_clear(uint32_t bank, uint32_t flag); +/* check EXMC flag is set or not */ +FlagStatus exmc_interrupt_flag_get(uint32_t bank, uint32_t interrupt_source); +/* clear EXMC flag */ +void exmc_interrupt_flag_clear(uint32_t bank, uint32_t interrupt_source); + +#endif /* GD32F10X_EXMC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exti.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exti.h new file mode 100644 index 0000000..ebb07da --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_exti.h @@ -0,0 +1,252 @@ +/*! + \file gd32f10x_exti.h + \brief definitions for the EXTI + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_EXTI_H +#define GD32F10X_EXTI_H + +#include "gd32f10x.h" + +/* EXTI definitions */ +#define EXTI EXTI_BASE + +/* registers definitions */ +#define EXTI_INTEN REG32(EXTI + 0x00000000U) /*!< interrupt enable register */ +#define EXTI_EVEN REG32(EXTI + 0x00000004U) /*!< event enable register */ +#define EXTI_RTEN REG32(EXTI + 0x00000008U) /*!< rising edge trigger enable register */ +#define EXTI_FTEN REG32(EXTI + 0x0000000CU) /*!< falling edge trigger enable register */ +#define EXTI_SWIEV REG32(EXTI + 0x00000010U) /*!< software interrupt event register */ +#define EXTI_PD REG32(EXTI + 0x00000014U) /*!< pending register */ + +/* bits definitions */ +/* EXTI_INTEN */ +#define EXTI_INTEN_INTEN0 BIT(0) /*!< interrupt from line 0 */ +#define EXTI_INTEN_INTEN1 BIT(1) /*!< interrupt from line 1 */ +#define EXTI_INTEN_INTEN2 BIT(2) /*!< interrupt from line 2 */ +#define EXTI_INTEN_INTEN3 BIT(3) /*!< interrupt from line 3 */ +#define EXTI_INTEN_INTEN4 BIT(4) /*!< interrupt from line 4 */ +#define EXTI_INTEN_INTEN5 BIT(5) /*!< interrupt from line 5 */ +#define EXTI_INTEN_INTEN6 BIT(6) /*!< interrupt from line 6 */ +#define EXTI_INTEN_INTEN7 BIT(7) /*!< interrupt from line 7 */ +#define EXTI_INTEN_INTEN8 BIT(8) /*!< interrupt from line 8 */ +#define EXTI_INTEN_INTEN9 BIT(9) /*!< interrupt from line 9 */ +#define EXTI_INTEN_INTEN10 BIT(10) /*!< interrupt from line 10 */ +#define EXTI_INTEN_INTEN11 BIT(11) /*!< interrupt from line 11 */ +#define EXTI_INTEN_INTEN12 BIT(12) /*!< interrupt from line 12 */ +#define EXTI_INTEN_INTEN13 BIT(13) /*!< interrupt from line 13 */ +#define EXTI_INTEN_INTEN14 BIT(14) /*!< interrupt from line 14 */ +#define EXTI_INTEN_INTEN15 BIT(15) /*!< interrupt from line 15 */ +#define EXTI_INTEN_INTEN16 BIT(16) /*!< interrupt from line 16 */ +#define EXTI_INTEN_INTEN17 BIT(17) /*!< interrupt from line 17 */ +#define EXTI_INTEN_INTEN18 BIT(18) /*!< interrupt from line 18 */ +#define EXTI_INTEN_INTEN19 BIT(19) /*!< interrupt from line 19 */ + +/* EXTI_EVEN */ +#define EXTI_EVEN_EVEN0 BIT(0) /*!< event from line 0 */ +#define EXTI_EVEN_EVEN1 BIT(1) /*!< event from line 1 */ +#define EXTI_EVEN_EVEN2 BIT(2) /*!< event from line 2 */ +#define EXTI_EVEN_EVEN3 BIT(3) /*!< event from line 3 */ +#define EXTI_EVEN_EVEN4 BIT(4) /*!< event from line 4 */ +#define EXTI_EVEN_EVEN5 BIT(5) /*!< event from line 5 */ +#define EXTI_EVEN_EVEN6 BIT(6) /*!< event from line 6 */ +#define EXTI_EVEN_EVEN7 BIT(7) /*!< event from line 7 */ +#define EXTI_EVEN_EVEN8 BIT(8) /*!< event from line 8 */ +#define EXTI_EVEN_EVEN9 BIT(9) /*!< event from line 9 */ +#define EXTI_EVEN_EVEN10 BIT(10) /*!< event from line 10 */ +#define EXTI_EVEN_EVEN11 BIT(11) /*!< event from line 11 */ +#define EXTI_EVEN_EVEN12 BIT(12) /*!< event from line 12 */ +#define EXTI_EVEN_EVEN13 BIT(13) /*!< event from line 13 */ +#define EXTI_EVEN_EVEN14 BIT(14) /*!< event from line 14 */ +#define EXTI_EVEN_EVEN15 BIT(15) /*!< event from line 15 */ +#define EXTI_EVEN_EVEN16 BIT(16) /*!< event from line 16 */ +#define EXTI_EVEN_EVEN17 BIT(17) /*!< event from line 17 */ +#define EXTI_EVEN_EVEN18 BIT(18) /*!< event from line 18 */ +#define EXTI_EVEN_EVEN19 BIT(19) /*!< event from line 19 */ + +/* EXTI_RTEN */ +#define EXTI_RTEN_RTEN0 BIT(0) /*!< rising edge from line 0 */ +#define EXTI_RTEN_RTEN1 BIT(1) /*!< rising edge from line 1 */ +#define EXTI_RTEN_RTEN2 BIT(2) /*!< rising edge from line 2 */ +#define EXTI_RTEN_RTEN3 BIT(3) /*!< rising edge from line 3 */ +#define EXTI_RTEN_RTEN4 BIT(4) /*!< rising edge from line 4 */ +#define EXTI_RTEN_RTEN5 BIT(5) /*!< rising edge from line 5 */ +#define EXTI_RTEN_RTEN6 BIT(6) /*!< rising edge from line 6 */ +#define EXTI_RTEN_RTEN7 BIT(7) /*!< rising edge from line 7 */ +#define EXTI_RTEN_RTEN8 BIT(8) /*!< rising edge from line 8 */ +#define EXTI_RTEN_RTEN9 BIT(9) /*!< rising edge from line 9 */ +#define EXTI_RTEN_RTEN10 BIT(10) /*!< rising edge from line 10 */ +#define EXTI_RTEN_RTEN11 BIT(11) /*!< rising edge from line 11 */ +#define EXTI_RTEN_RTEN12 BIT(12) /*!< rising edge from line 12 */ +#define EXTI_RTEN_RTEN13 BIT(13) /*!< rising edge from line 13 */ +#define EXTI_RTEN_RTEN14 BIT(14) /*!< rising edge from line 14 */ +#define EXTI_RTEN_RTEN15 BIT(15) /*!< rising edge from line 15 */ +#define EXTI_RTEN_RTEN16 BIT(16) /*!< rising edge from line 16 */ +#define EXTI_RTEN_RTEN17 BIT(17) /*!< rising edge from line 17 */ +#define EXTI_RTEN_RTEN18 BIT(18) /*!< rising edge from line 18 */ +#define EXTI_RTEN_RTEN19 BIT(19) /*!< rising edge from line 19 */ + +/* EXTI_FTEN */ +#define EXTI_FTEN_FTEN0 BIT(0) /*!< falling edge from line 0 */ +#define EXTI_FTEN_FTEN1 BIT(1) /*!< falling edge from line 1 */ +#define EXTI_FTEN_FTEN2 BIT(2) /*!< falling edge from line 2 */ +#define EXTI_FTEN_FTEN3 BIT(3) /*!< falling edge from line 3 */ +#define EXTI_FTEN_FTEN4 BIT(4) /*!< falling edge from line 4 */ +#define EXTI_FTEN_FTEN5 BIT(5) /*!< falling edge from line 5 */ +#define EXTI_FTEN_FTEN6 BIT(6) /*!< falling edge from line 6 */ +#define EXTI_FTEN_FTEN7 BIT(7) /*!< falling edge from line 7 */ +#define EXTI_FTEN_FTEN8 BIT(8) /*!< falling edge from line 8 */ +#define EXTI_FTEN_FTEN9 BIT(9) /*!< falling edge from line 9 */ +#define EXTI_FTEN_FTEN10 BIT(10) /*!< falling edge from line 10 */ +#define EXTI_FTEN_FTEN11 BIT(11) /*!< falling edge from line 11 */ +#define EXTI_FTEN_FTEN12 BIT(12) /*!< falling edge from line 12 */ +#define EXTI_FTEN_FTEN13 BIT(13) /*!< falling edge from line 13 */ +#define EXTI_FTEN_FTEN14 BIT(14) /*!< falling edge from line 14 */ +#define EXTI_FTEN_FTEN15 BIT(15) /*!< falling edge from line 15 */ +#define EXTI_FTEN_FTEN16 BIT(16) /*!< falling edge from line 16 */ +#define EXTI_FTEN_FTEN17 BIT(17) /*!< falling edge from line 17 */ +#define EXTI_FTEN_FTEN18 BIT(18) /*!< falling edge from line 18 */ +#define EXTI_FTEN_FTEN19 BIT(19) /*!< falling edge from line 19 */ + +/* EXTI_SWIEV */ +#define EXTI_SWIEV_SWIEV0 BIT(0) /*!< software interrupt/event request from line 0 */ +#define EXTI_SWIEV_SWIEV1 BIT(1) /*!< software interrupt/event request from line 1 */ +#define EXTI_SWIEV_SWIEV2 BIT(2) /*!< software interrupt/event request from line 2 */ +#define EXTI_SWIEV_SWIEV3 BIT(3) /*!< software interrupt/event request from line 3 */ +#define EXTI_SWIEV_SWIEV4 BIT(4) /*!< software interrupt/event request from line 4 */ +#define EXTI_SWIEV_SWIEV5 BIT(5) /*!< software interrupt/event request from line 5 */ +#define EXTI_SWIEV_SWIEV6 BIT(6) /*!< software interrupt/event request from line 6 */ +#define EXTI_SWIEV_SWIEV7 BIT(7) /*!< software interrupt/event request from line 7 */ +#define EXTI_SWIEV_SWIEV8 BIT(8) /*!< software interrupt/event request from line 8 */ +#define EXTI_SWIEV_SWIEV9 BIT(9) /*!< software interrupt/event request from line 9 */ +#define EXTI_SWIEV_SWIEV10 BIT(10) /*!< software interrupt/event request from line 10 */ +#define EXTI_SWIEV_SWIEV11 BIT(11) /*!< software interrupt/event request from line 11 */ +#define EXTI_SWIEV_SWIEV12 BIT(12) /*!< software interrupt/event request from line 12 */ +#define EXTI_SWIEV_SWIEV13 BIT(13) /*!< software interrupt/event request from line 13 */ +#define EXTI_SWIEV_SWIEV14 BIT(14) /*!< software interrupt/event request from line 14 */ +#define EXTI_SWIEV_SWIEV15 BIT(15) /*!< software interrupt/event request from line 15 */ +#define EXTI_SWIEV_SWIEV16 BIT(16) /*!< software interrupt/event request from line 16 */ +#define EXTI_SWIEV_SWIEV17 BIT(17) /*!< software interrupt/event request from line 17 */ +#define EXTI_SWIEV_SWIEV18 BIT(18) /*!< software interrupt/event request from line 18 */ +#define EXTI_SWIEV_SWIEV19 BIT(19) /*!< software interrupt/event request from line 19 */ + +/* EXTI_PD */ +#define EXTI_PD_PD0 BIT(0) /*!< interrupt pending status from line 0 */ +#define EXTI_PD_PD1 BIT(1) /*!< interrupt pending status from line 1 */ +#define EXTI_PD_PD2 BIT(2) /*!< interrupt pending status from line 2 */ +#define EXTI_PD_PD3 BIT(3) /*!< interrupt pending status from line 3 */ +#define EXTI_PD_PD4 BIT(4) /*!< interrupt pending status from line 4 */ +#define EXTI_PD_PD5 BIT(5) /*!< interrupt pending status from line 5 */ +#define EXTI_PD_PD6 BIT(6) /*!< interrupt pending status from line 6 */ +#define EXTI_PD_PD7 BIT(7) /*!< interrupt pending status from line 7 */ +#define EXTI_PD_PD8 BIT(8) /*!< interrupt pending status from line 8 */ +#define EXTI_PD_PD9 BIT(9) /*!< interrupt pending status from line 9 */ +#define EXTI_PD_PD10 BIT(10) /*!< interrupt pending status from line 10 */ +#define EXTI_PD_PD11 BIT(11) /*!< interrupt pending status from line 11 */ +#define EXTI_PD_PD12 BIT(12) /*!< interrupt pending status from line 12 */ +#define EXTI_PD_PD13 BIT(13) /*!< interrupt pending status from line 13 */ +#define EXTI_PD_PD14 BIT(14) /*!< interrupt pending status from line 14 */ +#define EXTI_PD_PD15 BIT(15) /*!< interrupt pending status from line 15 */ +#define EXTI_PD_PD16 BIT(16) /*!< interrupt pending status from line 16 */ +#define EXTI_PD_PD17 BIT(17) /*!< interrupt pending status from line 17 */ +#define EXTI_PD_PD18 BIT(18) /*!< interrupt pending status from line 18 */ +#define EXTI_PD_PD19 BIT(19) /*!< interrupt pending status from line 19 */ + +/* constants definitions */ +/* EXTI line number */ +typedef enum { + EXTI_0 = BIT(0), /*!< EXTI line 0 */ + EXTI_1 = BIT(1), /*!< EXTI line 1 */ + EXTI_2 = BIT(2), /*!< EXTI line 2 */ + EXTI_3 = BIT(3), /*!< EXTI line 3 */ + EXTI_4 = BIT(4), /*!< EXTI line 4 */ + EXTI_5 = BIT(5), /*!< EXTI line 5 */ + EXTI_6 = BIT(6), /*!< EXTI line 6 */ + EXTI_7 = BIT(7), /*!< EXTI line 7 */ + EXTI_8 = BIT(8), /*!< EXTI line 8 */ + EXTI_9 = BIT(9), /*!< EXTI line 9 */ + EXTI_10 = BIT(10), /*!< EXTI line 10 */ + EXTI_11 = BIT(11), /*!< EXTI line 11 */ + EXTI_12 = BIT(12), /*!< EXTI line 12 */ + EXTI_13 = BIT(13), /*!< EXTI line 13 */ + EXTI_14 = BIT(14), /*!< EXTI line 14 */ + EXTI_15 = BIT(15), /*!< EXTI line 15 */ + EXTI_16 = BIT(16), /*!< EXTI line 16 */ + EXTI_17 = BIT(17), /*!< EXTI line 17 */ + EXTI_18 = BIT(18), /*!< EXTI line 18 */ + EXTI_19 = BIT(19) /*!< EXTI line 19 */ +} exti_line_enum; + +/* external interrupt and event */ +typedef enum { + EXTI_INTERRUPT = 0, /*!< EXTI interrupt mode */ + EXTI_EVENT /*!< EXTI event mode */ +} exti_mode_enum; + +/* interrupt and event trigger mode */ +typedef enum { + EXTI_TRIG_RISING = 0, /*!< EXTI rising edge trigger */ + EXTI_TRIG_FALLING, /*!< EXTI falling edge trigger */ + EXTI_TRIG_BOTH, /*!< EXTI rising and falling edge trigger */ + EXTI_TRIG_NONE /*!< without rising edge or falling edge trigger */ +} exti_trig_type_enum; + +/* function declarations */ +/* initialization, EXTI lines configuration functions */ +/* deinitialize the EXTI */ +void exti_deinit(void); +/* initialize the EXTI line x */ +void exti_init(exti_line_enum linex, exti_mode_enum mode, exti_trig_type_enum trig_type); +/* enable the interrupts from EXTI line x */ +void exti_interrupt_enable(exti_line_enum linex); +/* disable the interrupts from EXTI line x */ +void exti_interrupt_disable(exti_line_enum linex); +/* enable the events from EXTI line x */ +void exti_event_enable(exti_line_enum linex); +/* disable the events from EXTI line x */ +void exti_event_disable(exti_line_enum linex); +/* enable the software interrupt event from EXTI line x */ +void exti_software_interrupt_enable(exti_line_enum linex); +/* disable the software interrupt event from EXTI line x */ +void exti_software_interrupt_disable(exti_line_enum linex); + +/* interrupt & flag functions */ +/* get EXTI line x interrupt pending flag */ +FlagStatus exti_flag_get(exti_line_enum linex); +/* clear EXTI line x interrupt pending flag */ +void exti_flag_clear(exti_line_enum linex); +/* get EXTI line x interrupt pending flag */ +FlagStatus exti_interrupt_flag_get(exti_line_enum linex); +/* clear EXTI line x interrupt pending flag */ +void exti_interrupt_flag_clear(exti_line_enum linex); + +#endif /* GD32F10X_EXTI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fmc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fmc.h new file mode 100644 index 0000000..035d6ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fmc.h @@ -0,0 +1,366 @@ +/*! + \file gd32f10x_fmc.h + \brief definitions for the FMC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_FMC_H +#define GD32F10X_FMC_H + +#include "gd32f10x.h" + +/* FMC and option byte definition */ +#define FMC FMC_BASE /*!< FMC register base address */ +#define OB OB_BASE /*!< option bytes base address */ + +/* registers definitions */ +#define FMC_WS REG32((FMC) + 0x00U) /*!< FMC wait state register */ +#define FMC_KEY0 REG32((FMC) + 0x04U) /*!< FMC unlock key register 0 */ +#define FMC_OBKEY REG32((FMC) + 0x08U) /*!< FMC option bytes unlock key register */ +#define FMC_STAT0 REG32((FMC) + 0x0CU) /*!< FMC status register 0 */ +#define FMC_CTL0 REG32((FMC) + 0x10U) /*!< FMC control register 0 */ +#define FMC_ADDR0 REG32((FMC) + 0x14U) /*!< FMC address register 0 */ +#define FMC_OBSTAT REG32((FMC) + 0x1CU) /*!< FMC option bytes status register */ +#define FMC_WP REG32((FMC) + 0x20U) /*!< FMC erase/program protection register */ +#define FMC_KEY1 REG32((FMC) + 0x44U) /*!< FMC unlock key register 1 */ +#define FMC_STAT1 REG32((FMC) + 0x4CU) /*!< FMC status register 1 */ +#define FMC_CTL1 REG32((FMC) + 0x50U) /*!< FMC control register 1 */ +#define FMC_ADDR1 REG32((FMC) + 0x54U) /*!< FMC address register 1 */ +#define FMC_WSEN REG32((FMC) + 0xFCU) /*!< FMC wait state enable register */ +#define FMC_PID REG32((FMC) + 0x100U) /*!< FMC product ID register */ + +#define OB_SPC REG16((OB) + 0x00U) /*!< option byte security protection value */ +#define OB_USER REG16((OB) + 0x02U) /*!< option byte user value*/ +#define OB_WP0 REG16((OB) + 0x08U) /*!< option byte write protection 0 */ +#define OB_WP1 REG16((OB) + 0x0AU) /*!< option byte write protection 1 */ +#define OB_WP2 REG16((OB) + 0x0CU) /*!< option byte write protection 2 */ +#define OB_WP3 REG16((OB) + 0x0EU) /*!< option byte write protection 3 */ + +/* bits definitions */ +/* FMC_WS */ +#define FMC_WS_WSCNT BITS(0,2) /*!< wait state counter */ + +/* FMC_KEY0 */ +#define FMC_KEY0_KEY BITS(0,31) /*!< FMC_CTL0 unlock key bits */ + +/* FMC_OBKEY */ +#define FMC_OBKEY_OBKEY BITS(0,31) /*!< option bytes unlock key bits */ + +/* FMC_STAT0 */ +#define FMC_STAT0_BUSY BIT(0) /*!< flash busy flag bit */ +#define FMC_STAT0_PGERR BIT(2) /*!< flash program error flag bit */ +#define FMC_STAT0_WPERR BIT(4) /*!< erase/program protection error flag bit */ +#define FMC_STAT0_ENDF BIT(5) /*!< end of operation flag bit */ + +/* FMC_CTL0 */ +#define FMC_CTL0_PG BIT(0) /*!< main flash program for bank0 command bit */ +#define FMC_CTL0_PER BIT(1) /*!< main flash page erase for bank0 command bit */ +#define FMC_CTL0_MER BIT(2) /*!< main flash mass erase for bank0 command bit */ +#define FMC_CTL0_OBPG BIT(4) /*!< option bytes program command bit */ +#define FMC_CTL0_OBER BIT(5) /*!< option bytes erase command bit */ +#define FMC_CTL0_START BIT(6) /*!< send erase command to FMC bit */ +#define FMC_CTL0_LK BIT(7) /*!< FMC_CTL0 lock bit */ +#define FMC_CTL0_OBWEN BIT(9) /*!< option bytes erase/program enable bit */ +#define FMC_CTL0_ERRIE BIT(10) /*!< error interrupt enable bit */ +#define FMC_CTL0_ENDIE BIT(12) /*!< end of operation interrupt enable bit */ + +/* FMC_ADDR0 */ +#define FMC_ADDR0_ADDR BITS(0,31) /*!< flash erase/program command address bits */ + +/* FMC_OBSTAT */ +#define FMC_OBSTAT_OBERR BIT(0) /*!< option bytes read error bit. */ +#define FMC_OBSTAT_SPC BIT(1) /*!< option bytes security protection code */ +#define FMC_OBSTAT_USER BITS(2,9) /*!< store USER of option bytes block after system reset */ +#define FMC_OBSTAT_DATA BITS(10,25) /*!< store DATA of option bytes block after system reset. */ + +/* FMC_WP */ +#define FMC_WP_WP BITS(0,31) /*!< store WP of option bytes block after system reset */ + +/* FMC_KEY1 */ +#define FMC_KEY1_KEY BITS(0,31) /*!< FMC_CTL1 unlock key bits */ + +/* FMC_STAT1 */ +#define FMC_STAT1_BUSY BIT(0) /*!< flash busy flag bit */ +#define FMC_STAT1_PGERR BIT(2) /*!< flash program error flag bit */ +#define FMC_STAT1_WPERR BIT(4) /*!< erase/program protection error flag bit */ +#define FMC_STAT1_ENDF BIT(5) /*!< end of operation flag bit */ + +/* FMC_CTL1 */ +#define FMC_CTL1_PG BIT(0) /*!< main flash program for bank1 command bit */ +#define FMC_CTL1_PER BIT(1) /*!< main flash page erase for bank1 command bit */ +#define FMC_CTL1_MER BIT(2) /*!< main flash mass erase for bank1 command bit */ +#define FMC_CTL1_START BIT(6) /*!< send erase command to FMC bit */ +#define FMC_CTL1_LK BIT(7) /*!< FMC_CTL1 lock bit */ +#define FMC_CTL1_ERRIE BIT(10) /*!< error interrupt enable bit */ +#define FMC_CTL1_ENDIE BIT(12) /*!< end of operation interrupt enable bit */ + +/* FMC_ADDR1 */ +#define FMC_ADDR1_ADDR BITS(0,31) /*!< flash erase/program command address bits */ + +/* FMC_WSEN */ +#define FMC_WSEN_WSEN BIT(0) /*!< FMC wait state enable bit */ + +/* FMC_PID */ +#define FMC_PID_PID BITS(0,31) /*!< product ID bits */ + +/* constants definitions */ +/* define the FMC bit position and its register index offset */ +#define FMC_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define FMC_REG_VAL(offset) (REG32(FMC + ((uint32_t)(offset) >> 6))) +#define FMC_BIT_POS(val) ((uint32_t)(val) & 0x1FU) +#define FMC_REGIDX_BITS(regidx, bitpos0, bitpos1) (((uint32_t)(regidx) << 12) | ((uint32_t)(bitpos0) << 6) | (uint32_t)(bitpos1)) +#define FMC_REG_VALS(offset) (REG32(FMC + ((uint32_t)(offset) >> 12))) +#define FMC_BIT_POS0(val) (((uint32_t)(val) >> 6) & 0x1FU) +#define FMC_BIT_POS1(val) ((uint32_t)(val) & 0x1FU) +#define FMC_REG_OFFSET_GET(flag) ((uint32_t)(flag) >> 12) + +/* configuration register */ +#define FMC_STAT0_REG_OFFSET 0x0CU /*!< status register 0 offset */ +#define FMC_CTL0_REG_OFFSET 0x10U /*!< control register 0 offset */ +#define FMC_STAT1_REG_OFFSET 0x4CU /*!< status register 1 offset */ +#define FMC_CTL1_REG_OFFSET 0x50U /*!< control register 1 offset */ +#define FMC_OBSTAT_REG_OFFSET 0x1CU /*!< option byte status register offset */ + +/* fmc state */ +typedef enum +{ + FMC_READY, /*!< the operation has been completed */ + FMC_BUSY, /*!< the operation is in progress */ + FMC_PGERR, /*!< program error */ + FMC_WPERR, /*!< erase/program protection error */ + FMC_TOERR, /*!< timeout error */ +}fmc_state_enum; + +/* FMC interrupt enable */ +typedef enum +{ + FMC_INT_BANK0_END = FMC_REGIDX_BIT(FMC_CTL0_REG_OFFSET, 12U), /*!< enable FMC end of program interrupt */ + FMC_INT_BANK0_ERR = FMC_REGIDX_BIT(FMC_CTL0_REG_OFFSET, 10U), /*!< enable FMC error interrupt */ + FMC_INT_BANK1_END = FMC_REGIDX_BIT(FMC_CTL1_REG_OFFSET, 12U), /*!< enable FMC bank1 end of program interrupt */ + FMC_INT_BANK1_ERR = FMC_REGIDX_BIT(FMC_CTL1_REG_OFFSET, 10U), /*!< enable FMC bank1 error interrupt */ +}fmc_int_enum; + +/* FMC flags */ +typedef enum +{ + FMC_FLAG_BANK0_BUSY = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 0U), /*!< FMC bank0 busy flag */ + FMC_FLAG_BANK0_PGERR = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 2U), /*!< FMC bank0 operation error flag bit */ + FMC_FLAG_BANK0_WPERR = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 4U), /*!< FMC bank0 erase/program protection error flag bit */ + FMC_FLAG_BANK0_END = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 5U), /*!< FMC bank0 end of operation flag bit */ + FMC_FLAG_OBERR = FMC_REGIDX_BIT(FMC_OBSTAT_REG_OFFSET, 0U), /*!< FMC option bytes read error flag */ + FMC_FLAG_BANK1_BUSY = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 0U), /*!< FMC bank1 busy flag */ + FMC_FLAG_BANK1_PGERR = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 2U), /*!< FMC bank1 operation error flag bit */ + FMC_FLAG_BANK1_WPERR = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 4U), /*!< FMC bank1 erase/program protection error flag bit */ + FMC_FLAG_BANK1_END = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 5U), /*!< FMC bank1 end of operation flag bit */ +}fmc_flag_enum; + +/* FMC interrupt flags */ +typedef enum +{ + FMC_INT_FLAG_BANK0_PGERR = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 2U, 10U), /*!< FMC bank0 operation error interrupt flag bit */ + FMC_INT_FLAG_BANK0_WPERR = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 4U, 10U), /*!< FMC bank0 erase/program protection error interrupt flag bit */ + FMC_INT_FLAG_BANK0_END = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 5U, 12U), /*!< FMC bank0 end of operation interrupt flag bit */ + FMC_INT_FLAG_BANK1_PGERR = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 2U, 10U), /*!< FMC bank1 operation error interrupt flag bit */ + FMC_INT_FLAG_BANK1_WPERR = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 4U, 10U), /*!< FMC bank1 erase/program protection error interrupt flag bit */ + FMC_INT_FLAG_BANK1_END = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 5U, 12U), /*!< FMC bank1 end of operation interrupt flag bit */ +}fmc_interrupt_flag_enum; + +/* unlock key */ +#define UNLOCK_KEY0 ((uint32_t)0x45670123U) /*!< unlock key 0 */ +#define UNLOCK_KEY1 ((uint32_t)0xCDEF89ABU) /*!< unlock key 1 */ + +/* FMC wait state counter */ +#define WS_WSCNT(regval) (BITS(0,2) & ((uint32_t)(regval))) +#define WS_WSCNT_0 WS_WSCNT(0) /*!< FMC 0 wait */ +#define WS_WSCNT_1 WS_WSCNT(1) /*!< FMC 1 wait */ +#define WS_WSCNT_2 WS_WSCNT(2) /*!< FMC 2 wait */ + +/* option bytes software/hardware free watch dog timer */ +#define OB_FWDGT_SW ((uint8_t)0x01U) /*!< software free watchdog */ +#define OB_FWDGT_HW ((uint8_t)0x00U) /*!< hardware free watchdog */ + +/* option bytes reset or not entering deep sleep mode */ +#define OB_DEEPSLEEP_NRST ((uint8_t)0x02U) /*!< no reset when entering deepsleep mode */ +#define OB_DEEPSLEEP_RST ((uint8_t)0x00U) /*!< generate a reset instead of entering deepsleep mode */ + +/* option bytes reset or not entering standby mode */ +#define OB_STDBY_NRST ((uint8_t)0x04U) /*!< no reset when entering deepsleep mode */ +#define OB_STDBY_RST ((uint8_t)0x00U) /*!< generate a reset instead of entering standby mode */ + +/* option bytes boot bank value */ +#define OB_BOOT_B0 ((uint8_t)0x08U) /*!< boot from bank0 */ +#define OB_BOOT_B1 ((uint8_t)0x00U) /*!< boot from bank1 */ + +#define OB_USER_MASK ((uint8_t)0xF0U) /*!< MASK value */ + +/* read protect configure */ +#define FMC_NSPC ((uint8_t)0xA5U) /*!< no security protection */ +#define FMC_USPC ((uint8_t)0xBBU) /*!< under security protection */ + +/* OB_SPC */ +#define OB_SPC_SPC ((uint32_t)0x000000FFU) /*!< option byte security protection value */ +#define OB_SPC_SPC_N ((uint32_t)0x0000FF00U) /*!< option byte security protection complement value */ + +/* OB_USER */ +#define OB_USER_USER ((uint32_t)0x00FF0000U) /*!< user option value */ +#define OB_USER_USER_N ((uint32_t)0xFF000000U) /*!< user option complement value */ + +/* OB_WP0 */ +#define OB_WP0_WP0 ((uint32_t)0x000000FFU) /*!< FMC write protection option value */ + +/* OB_WP1 */ +#define OB_WP1_WP1 ((uint32_t)0x0000FF00U) /*!< FMC write protection option complement value */ + +/* OB_WP2 */ +#define OB_WP2_WP2 ((uint32_t)0x00FF0000U) /*!< FMC write protection option value */ + +/* OB_WP3 */ +#define OB_WP3_WP3 ((uint32_t)0xFF000000U) /*!< FMC write protection option complement value */ + +/* option bytes write protection */ +#define OB_WP_0 ((uint32_t)0x00000001U) /*!< erase/program protection of sector 0 */ +#define OB_WP_1 ((uint32_t)0x00000002U) /*!< erase/program protection of sector 1 */ +#define OB_WP_2 ((uint32_t)0x00000004U) /*!< erase/program protection of sector 2 */ +#define OB_WP_3 ((uint32_t)0x00000008U) /*!< erase/program protection of sector 3 */ +#define OB_WP_4 ((uint32_t)0x00000010U) /*!< erase/program protection of sector 4 */ +#define OB_WP_5 ((uint32_t)0x00000020U) /*!< erase/program protection of sector 5 */ +#define OB_WP_6 ((uint32_t)0x00000040U) /*!< erase/program protection of sector 6 */ +#define OB_WP_7 ((uint32_t)0x00000080U) /*!< erase/program protection of sector 7 */ +#define OB_WP_8 ((uint32_t)0x00000100U) /*!< erase/program protection of sector 8 */ +#define OB_WP_9 ((uint32_t)0x00000200U) /*!< erase/program protection of sector 9 */ +#define OB_WP_10 ((uint32_t)0x00000400U) /*!< erase/program protection of sector 10 */ +#define OB_WP_11 ((uint32_t)0x00000800U) /*!< erase/program protection of sector 11 */ +#define OB_WP_12 ((uint32_t)0x00001000U) /*!< erase/program protection of sector 12 */ +#define OB_WP_13 ((uint32_t)0x00002000U) /*!< erase/program protection of sector 13 */ +#define OB_WP_14 ((uint32_t)0x00004000U) /*!< erase/program protection of sector 14 */ +#define OB_WP_15 ((uint32_t)0x00008000U) /*!< erase/program protection of sector 15 */ +#define OB_WP_16 ((uint32_t)0x00010000U) /*!< erase/program protection of sector 16 */ +#define OB_WP_17 ((uint32_t)0x00020000U) /*!< erase/program protection of sector 17 */ +#define OB_WP_18 ((uint32_t)0x00040000U) /*!< erase/program protection of sector 18 */ +#define OB_WP_19 ((uint32_t)0x00080000U) /*!< erase/program protection of sector 19 */ +#define OB_WP_20 ((uint32_t)0x00100000U) /*!< erase/program protection of sector 20 */ +#define OB_WP_21 ((uint32_t)0x00200000U) /*!< erase/program protection of sector 21 */ +#define OB_WP_22 ((uint32_t)0x00400000U) /*!< erase/program protection of sector 22 */ +#define OB_WP_23 ((uint32_t)0x00800000U) /*!< erase/program protection of sector 23 */ +#define OB_WP_24 ((uint32_t)0x01000000U) /*!< erase/program protection of sector 24 */ +#define OB_WP_25 ((uint32_t)0x02000000U) /*!< erase/program protection of sector 25 */ +#define OB_WP_26 ((uint32_t)0x04000000U) /*!< erase/program protection of sector 26 */ +#define OB_WP_27 ((uint32_t)0x08000000U) /*!< erase/program protection of sector 27 */ +#define OB_WP_28 ((uint32_t)0x10000000U) /*!< erase/program protection of sector 28 */ +#define OB_WP_29 ((uint32_t)0x20000000U) /*!< erase/program protection of sector 29 */ +#define OB_WP_30 ((uint32_t)0x40000000U) /*!< erase/program protection of sector 30 */ +#define OB_WP_31 ((uint32_t)0x80000000U) /*!< erase/program protection of sector 31 */ +#define OB_WP_ALL ((uint32_t)0xFFFFFFFFU) /*!< erase/program protection of all sectors */ + +/* FMC timeout */ +#define FMC_TIMEOUT_COUNT ((uint32_t)0x000F0000U) /*!< FMC timeout count value */ + +/* FMC BANK address */ +#define FMC_BANK0_END_ADDRESS ((uint32_t)0x0807FFFFU) /*!< FMC bank0 end address */ +#define FMC_BANK0_SIZE ((uint32_t)0x00000200U) /*!< FMC bank0 size */ +#define FMC_SIZE (*(uint16_t *)0x1FFFF7E0U) /*!< FMC size */ + +/* function declarations */ +/* FMC main memory programming functions */ +/* set the FMC wait state counter */ +void fmc_wscnt_set(uint32_t wscnt); +/* unlock the main FMC operation */ +void fmc_unlock(void); +/* unlock the FMC bank0 operation */ +void fmc_bank0_unlock(void); +/* unlock the FMC bank1 operation */ +void fmc_bank1_unlock(void); +/* lock the main FMC operation */ +void fmc_lock(void); +/* lock the bank0 FMC operation */ +void fmc_bank0_lock(void); +/* lock the bank1 FMC operation */ +void fmc_bank1_lock(void); +/* FMC erase page */ +fmc_state_enum fmc_page_erase(uint32_t page_address); +/* FMC erase whole chip */ +fmc_state_enum fmc_mass_erase(void); +/* FMC erase whole bank0 */ +fmc_state_enum fmc_bank0_erase(void); +/* FMC erase whole bank1 */ +fmc_state_enum fmc_bank1_erase(void); +/* FMC program a word at the corresponding address */ +fmc_state_enum fmc_word_program(uint32_t address, uint32_t data); +/* FMC program a half word at the corresponding address */ +fmc_state_enum fmc_halfword_program(uint32_t address, uint16_t data); + +/* FMC option bytes programming functions */ +/* unlock the option byte operation */ +void ob_unlock(void); +/* lock the option byte operation */ +void ob_lock(void); +/* erase the option byte */ +fmc_state_enum ob_erase(void); +/* enable write protect */ +fmc_state_enum ob_write_protection_enable(uint32_t ob_wp); +/* configure the option byte security protection */ +fmc_state_enum ob_security_protection_config(uint8_t ob_spc); +/* write the FMC option byte */ +fmc_state_enum ob_user_write(uint8_t ob_fwdgt, uint8_t ob_deepsleep, uint8_t ob_stdby, uint8_t ob_boot); +/* program option bytes data */ +fmc_state_enum ob_data_program(uint32_t address, uint8_t data); +/* get the FMC option byte user */ +uint8_t ob_user_get(void); +/* get OB_DATA in register FMC_OBSTAT */ +uint16_t ob_data_get(void); +/* get the FMC option byte write protection */ +uint32_t ob_write_protection_get(void); +/* get option byte security protection code value */ +FlagStatus ob_spc_get(void); + +/* FMC interrupts and flags management functions */ +/* enable FMC interrupt */ +void fmc_interrupt_enable(uint32_t interrupt); +/* disable FMC interrupt */ +void fmc_interrupt_disable(uint32_t interrupt); +/* check flag is set or not */ +FlagStatus fmc_flag_get(uint32_t flag); +/* clear the FMC flag */ +void fmc_flag_clear(uint32_t flag); +/* get FMC interrupt flag state */ +FlagStatus fmc_interrupt_flag_get(fmc_interrupt_flag_enum flag); +/* clear FMC interrupt flag state */ +void fmc_interrupt_flag_clear(fmc_interrupt_flag_enum flag); +/* return the FMC bank0 state */ +fmc_state_enum fmc_bank0_state_get(void); +/* return the FMC bank1 state */ +fmc_state_enum fmc_bank1_state_get(void); +/* check FMC bank0 ready or not */ +fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout); +/* check FMC bank1 ready or not */ +fmc_state_enum fmc_bank1_ready_wait(uint32_t timeout); + +#endif /* GD32F10X_FMC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fwdgt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fwdgt.h new file mode 100644 index 0000000..8b48cad --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_fwdgt.h @@ -0,0 +1,111 @@ +/*! + \file gd32f10x_fwdgt.h + \brief definitions for the FWDGT + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_FWDGT_H +#define GD32F10X_FWDGT_H + +#include "gd32f10x.h" + +/* FWDGT definitions */ +#define FWDGT FWDGT_BASE /*!< FWDGT base address */ + +/* registers definitions */ +#define FWDGT_CTL REG32((FWDGT) + 0x00U) /*!< FWDGT control register */ +#define FWDGT_PSC REG32((FWDGT) + 0x04U) /*!< FWDGT prescaler register */ +#define FWDGT_RLD REG32((FWDGT) + 0x08U) /*!< FWDGT reload register */ +#define FWDGT_STAT REG32((FWDGT) + 0x0CU) /*!< FWDGT status register */ + +/* bits definitions */ +/* FWDGT_CTL */ +#define FWDGT_CTL_CMD BITS(0,15) /*!< FWDGT command value */ + +/* FWDGT_PSC */ +#define FWDGT_PSC_PSC BITS(0,2) /*!< FWDGT prescaler divider value */ + +/* FWDGT_RLD */ +#define FWDGT_RLD_RLD BITS(0,11) /*!< FWDGT counter reload value */ + +/* FWDGT_STAT */ +#define FWDGT_STAT_PUD BIT(0) /*!< FWDGT prescaler divider value update */ +#define FWDGT_STAT_RUD BIT(1) /*!< FWDGT counter reload value update */ + +/* constants definitions */ +/* psc register value */ +#define PSC_PSC(regval) (BITS(0,2) & ((uint32_t)(regval) << 0)) +#define FWDGT_PSC_DIV4 ((uint8_t)PSC_PSC(0)) /*!< FWDGT prescaler set to 4 */ +#define FWDGT_PSC_DIV8 ((uint8_t)PSC_PSC(1)) /*!< FWDGT prescaler set to 8 */ +#define FWDGT_PSC_DIV16 ((uint8_t)PSC_PSC(2)) /*!< FWDGT prescaler set to 16 */ +#define FWDGT_PSC_DIV32 ((uint8_t)PSC_PSC(3)) /*!< FWDGT prescaler set to 32 */ +#define FWDGT_PSC_DIV64 ((uint8_t)PSC_PSC(4)) /*!< FWDGT prescaler set to 64 */ +#define FWDGT_PSC_DIV128 ((uint8_t)PSC_PSC(5)) /*!< FWDGT prescaler set to 128 */ +#define FWDGT_PSC_DIV256 ((uint8_t)PSC_PSC(6)) /*!< FWDGT prescaler set to 256 */ + +/* control value */ +#define FWDGT_WRITEACCESS_ENABLE ((uint16_t)0x5555U) /*!< FWDGT_CTL bits write access enable value */ +#define FWDGT_WRITEACCESS_DISABLE ((uint16_t)0x0000U) /*!< FWDGT_CTL bits write access disable value */ +#define FWDGT_KEY_RELOAD ((uint16_t)0xAAAAU) /*!< FWDGT_CTL bits fwdgt counter reload value */ +#define FWDGT_KEY_ENABLE ((uint16_t)0xCCCCU) /*!< FWDGT_CTL bits fwdgt counter enable value */ + +/* FWDGT timeout value */ +#define FWDGT_PSC_TIMEOUT ((uint32_t)0x000FFFFFU) /*!< FWDGT_PSC register write operation state flag timeout */ +#define FWDGT_RLD_TIMEOUT ((uint32_t)0x000FFFFFU) /*!< FWDGT_RLD register write operation state flag timeout */ + +/* FWDGT flag definitions */ +#define FWDGT_FLAG_PUD FWDGT_STAT_PUD /*!< FWDGT prescaler divider value update flag */ +#define FWDGT_FLAG_RUD FWDGT_STAT_RUD /*!< FWDGT counter reload value update flag */ + +/* write value to FWDGT_RLD_RLD bit field */ +#define RLD_RLD(regval) (BITS(0,11) & ((uint32_t)(regval) << 0)) + +/* function declarations */ +/* enable write access to FWDGT_PSC and FWDGT_RLD */ +void fwdgt_write_enable(void); +/* disable write access to FWDGT_PSC and FWDGT_RLD */ +void fwdgt_write_disable(void); +/* start the free watchdog timer counter */ +void fwdgt_enable(void); + +/* configure the free watchdog timer counter prescaler value */ +ErrStatus fwdgt_prescaler_value_config(uint16_t prescaler_value); +/* configure the free watchdog timer counter reload value */ +ErrStatus fwdgt_reload_value_config(uint16_t reload_value); +/* reload the counter of FWDGT */ +void fwdgt_counter_reload(void); +/* configure counter reload value, and prescaler divider value */ +ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div); + +/* get flag state of FWDGT */ +FlagStatus fwdgt_flag_get(uint16_t flag); + +#endif /* GD32F10X_FWDGT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_gpio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_gpio.h new file mode 100644 index 0000000..76e19c4 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_gpio.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_i2c.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_i2c.h new file mode 100644 index 0000000..0de0d0d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_i2c.h @@ -0,0 +1,345 @@ +/*! + \file gd32f10x_i2c.h + \brief definitions for the I2C + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_I2C_H +#define GD32F10X_I2C_H + +#include "gd32f10x.h" + +/* I2Cx(x=0,1) definitions */ +#define I2C0 I2C_BASE /*!< I2C0 base address */ +#define I2C1 (I2C_BASE + 0x00000400U) /*!< I2C1 base address */ + +/* registers definitions */ +#define I2C_CTL0(i2cx) REG32((i2cx) + 0x00000000U) /*!< I2C control register 0 */ +#define I2C_CTL1(i2cx) REG32((i2cx) + 0x00000004U) /*!< I2C control register 1 */ +#define I2C_SADDR0(i2cx) REG32((i2cx) + 0x00000008U) /*!< I2C slave address register 0*/ +#define I2C_SADDR1(i2cx) REG32((i2cx) + 0x0000000CU) /*!< I2C slave address register */ +#define I2C_DATA(i2cx) REG32((i2cx) + 0x00000010U) /*!< I2C transfer buffer register */ +#define I2C_STAT0(i2cx) REG32((i2cx) + 0x00000014U) /*!< I2C transfer status register 0 */ +#define I2C_STAT1(i2cx) REG32((i2cx) + 0x00000018U) /*!< I2C transfer status register */ +#define I2C_CKCFG(i2cx) REG32((i2cx) + 0x0000001CU) /*!< I2C clock configure register */ +#define I2C_RT(i2cx) REG32((i2cx) + 0x00000020U) /*!< I2C rise time register */ + +/* bits definitions */ +/* I2Cx_CTL0 */ +#define I2C_CTL0_I2CEN BIT(0) /*!< peripheral enable */ +#define I2C_CTL0_SMBEN BIT(1) /*!< SMBus mode */ +#define I2C_CTL0_SMBSEL BIT(3) /*!< SMBus type */ +#define I2C_CTL0_ARPEN BIT(4) /*!< ARP enable */ +#define I2C_CTL0_PECEN BIT(5) /*!< PEC enable */ +#define I2C_CTL0_GCEN BIT(6) /*!< general call enable */ +#define I2C_CTL0_SS BIT(7) /*!< clock stretching disable (slave mode) */ +#define I2C_CTL0_START BIT(8) /*!< start generation */ +#define I2C_CTL0_STOP BIT(9) /*!< stop generation */ +#define I2C_CTL0_ACKEN BIT(10) /*!< acknowledge enable */ +#define I2C_CTL0_POAP BIT(11) /*!< acknowledge/PEC position (for data reception) */ +#define I2C_CTL0_PECTRANS BIT(12) /*!< packet error checking */ +#define I2C_CTL0_SALT BIT(13) /*!< SMBus alert */ +#define I2C_CTL0_SRESET BIT(15) /*!< software reset */ + +/* I2Cx_CTL1 */ +#define I2C_CTL1_I2CCLK BITS(0,5) /*!< I2CCLK[5:0] bits (peripheral clock frequency) */ +#define I2C_CTL1_ERRIE BIT(8) /*!< error interrupt enable */ +#define I2C_CTL1_EVIE BIT(9) /*!< event interrupt enable */ +#define I2C_CTL1_BUFIE BIT(10) /*!< buffer interrupt enable */ +#define I2C_CTL1_DMAON BIT(11) /*!< DMA requests enable */ +#define I2C_CTL1_DMALST BIT(12) /*!< DMA last transfer */ + +/* I2Cx_SADDR0 */ +#define I2C_SADDR0_ADDRESS0 BIT(0) /*!< bit 0 of a 10-bit address */ +#define I2C_SADDR0_ADDRESS BITS(1,7) /*!< 7-bit address or bits 7:1 of a 10-bit address */ +#define I2C_SADDR0_ADDRESS_H BITS(8,9) /*!< highest two bits of a 10-bit address */ +#define I2C_SADDR0_ADDFORMAT BIT(15) /*!< address mode for the I2C slave */ + +/* I2Cx_SADDR1 */ +#define I2C_SADDR1_DUADEN BIT(0) /*!< aual-address mode switch */ +#define I2C_SADDR1_ADDRESS2 BITS(1,7) /*!< second I2C address for the slave in dual-address mode */ + +/* I2Cx_DATA */ +#define I2C_DATA_TRB BITS(0,7) /*!< 8-bit data register */ + +/* I2Cx_STAT0 */ +#define I2C_STAT0_SBSEND BIT(0) /*!< start bit (master mode) */ +#define I2C_STAT0_ADDSEND BIT(1) /*!< address sent (master mode)/matched (slave mode) */ +#define I2C_STAT0_BTC BIT(2) /*!< byte transfer finished */ +#define I2C_STAT0_ADD10SEND BIT(3) /*!< 10-bit header sent (master mode) */ +#define I2C_STAT0_STPDET BIT(4) /*!< stop detection (slave mode) */ +#define I2C_STAT0_RBNE BIT(6) /*!< data register not empty (receivers) */ +#define I2C_STAT0_TBE BIT(7) /*!< data register empty (transmitters) */ +#define I2C_STAT0_BERR BIT(8) /*!< bus error */ +#define I2C_STAT0_LOSTARB BIT(9) /*!< arbitration lost (master mode) */ +#define I2C_STAT0_AERR BIT(10) /*!< acknowledge failure */ +#define I2C_STAT0_OUERR BIT(11) /*!< overrun/underrun */ +#define I2C_STAT0_PECERR BIT(12) /*!< PEC error in reception */ +#define I2C_STAT0_SMBTO BIT(14) /*!< timeout signal in SMBus mode */ +#define I2C_STAT0_SMBALT BIT(15) /*!< SMBus alert status */ + +/* I2Cx_STAT1 */ +#define I2C_STAT1_MASTER BIT(0) /*!< master/slave */ +#define I2C_STAT1_I2CBSY BIT(1) /*!< bus busy */ +#define I2C_STAT1_TR BIT(2) /*!< transmitter/receiver */ +#define I2C_STAT1_RXGC BIT(4) /*!< general call address (slave mode) */ +#define I2C_STAT1_DEFSMB BIT(5) /*!< SMBus device default address (slave mode) */ +#define I2C_STAT1_HSTSMB BIT(6) /*!< SMBus host header (slave mode) */ +#define I2C_STAT1_DUMODF BIT(7) /*!< dual flag (slave mode) */ +#define I2C_STAT1_PECV BITS(8,15) /*!< packet error checking value */ + +/* I2Cx_CKCFG */ +#define I2C_CKCFG_CLKC BITS(0,11) /*!< clock control register in fast/standard mode (master mode) */ +#define I2C_CKCFG_DTCY BIT(14) /*!< fast mode duty cycle */ +#define I2C_CKCFG_FAST BIT(15) /*!< I2C speed selection in master mode */ + +/* I2Cx_RT */ +#define I2C_RT_RISETIME BITS(0,5) /*!< maximum rise time in fast/standard mode (Master mode) */ + +/* constants definitions */ +/* define the I2C bit position and its register index offset */ +#define I2C_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define I2C_REG_VAL(i2cx, offset) (REG32((i2cx) + (((uint32_t)(offset) & 0xFFFFU) >> 6))) +#define I2C_BIT_POS(val) ((uint32_t)(val) & 0x1FU) +#define I2C_REGIDX_BIT2(regidx, bitpos, regidx2, bitpos2) (((uint32_t)(regidx2) << 22) | (uint32_t)((bitpos2) << 16)\ + | (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos))) +#define I2C_REG_VAL2(i2cx, offset) (REG32((i2cx) + ((uint32_t)(offset) >> 22))) +#define I2C_BIT_POS2(val) (((uint32_t)(val) & 0x1F0000U) >> 16) + +/* register offset */ +#define I2C_CTL1_REG_OFFSET 0x04U /*!< CTL1 register offset */ +#define I2C_STAT0_REG_OFFSET 0x14U /*!< STAT0 register offset */ +#define I2C_STAT1_REG_OFFSET 0x18U /*!< STAT1 register offset */ + +/* I2C flags */ +typedef enum +{ + /* flags in STAT0 register */ + I2C_FLAG_SBSEND = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 0U), /*!< start condition sent out in master mode */ + I2C_FLAG_ADDSEND = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 1U), /*!< address is sent in master mode or received and matches in slave mode */ + I2C_FLAG_BTC = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 2U), /*!< byte transmission finishes */ + I2C_FLAG_ADD10SEND = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 3U), /*!< header of 10-bit address is sent in master mode */ + I2C_FLAG_STPDET = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 4U), /*!< stop condition detected in slave mode */ + I2C_FLAG_RBNE = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 6U), /*!< I2C_DATA is not Empty during receiving */ + I2C_FLAG_TBE = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 7U), /*!< I2C_DATA is empty during transmitting */ + I2C_FLAG_BERR = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 8U), /*!< a bus error occurs indication a unexpected start or stop condition on I2C bus */ + I2C_FLAG_LOSTARB = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 9U), /*!< arbitration lost in master mode */ + I2C_FLAG_AERR = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 10U), /*!< acknowledge error */ + I2C_FLAG_OUERR = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 11U), /*!< over-run or under-run situation occurs in slave mode */ + I2C_FLAG_PECERR = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 12U), /*!< PEC error when receiving data */ + I2C_FLAG_SMBTO = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 14U), /*!< timeout signal in SMBus mode */ + I2C_FLAG_SMBALT = I2C_REGIDX_BIT(I2C_STAT0_REG_OFFSET, 15U), /*!< SMBus alert status */ + /* flags in STAT1 register */ + I2C_FLAG_MASTER = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 0U), /*!< a flag indicating whether I2C block is in master or slave mode */ + I2C_FLAG_I2CBSY = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 1U), /*!< busy flag */ + I2C_FLAG_TRS = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 2U), /*!< whether the I2C is a transmitter or a receiver */ + I2C_FLAG_RXGC = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 4U), /*!< general call address (00h) received */ + I2C_FLAG_DEFSMB = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 5U), /*!< default address of SMBus device */ + I2C_FLAG_HSTSMB = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 6U), /*!< SMBus host header detected in slave mode */ + I2C_FLAG_DUMOD = I2C_REGIDX_BIT(I2C_STAT1_REG_OFFSET, 7U), /*!< dual flag in slave mode indicating which address is matched in dual-address mode */ +}i2c_flag_enum; + +/* I2C interrupt flags */ +typedef enum +{ + /* interrupt flags in CTL1 register */ + I2C_INT_FLAG_SBSEND = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 0U), /*!< start condition sent out in master mode interrupt flag */ + I2C_INT_FLAG_ADDSEND = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 1U), /*!< address is sent in master mode or received and matches in slave mode interrupt flag */ + I2C_INT_FLAG_BTC = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 2U), /*!< byte transmission finishes */ + I2C_INT_FLAG_ADD10SEND = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 3U), /*!< header of 10-bit address is sent in master mode interrupt flag */ + I2C_INT_FLAG_STPDET = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 4U), /*!< stop condition detected in slave mode interrupt flag */ + I2C_INT_FLAG_RBNE = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 6U), /*!< I2C_DATA is not Empty during receiving interrupt flag */ + I2C_INT_FLAG_TBE = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 9U, I2C_STAT0_REG_OFFSET, 7U), /*!< I2C_DATA is empty during transmitting interrupt flag */ + I2C_INT_FLAG_BERR = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 8U), /*!< a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag */ + I2C_INT_FLAG_LOSTARB = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 9U), /*!< arbitration lost in master mode interrupt flag */ + I2C_INT_FLAG_AERR = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 10U), /*!< acknowledge error interrupt flag */ + I2C_INT_FLAG_OUERR = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 11U), /*!< over-run or under-run situation occurs in slave mode interrupt flag */ + I2C_INT_FLAG_PECERR = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 12U), /*!< PEC error when receiving data interrupt flag */ + I2C_INT_FLAG_SMBTO = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 14U), /*!< timeout signal in SMBus mode interrupt flag */ + I2C_INT_FLAG_SMBALT = I2C_REGIDX_BIT2(I2C_CTL1_REG_OFFSET, 8U, I2C_STAT0_REG_OFFSET, 15U), /*!< SMBus Alert status interrupt flag */ +}i2c_interrupt_flag_enum; + +/* I2C interrupt enable or disable */ +typedef enum +{ + /* interrupt in CTL1 register */ + I2C_INT_ERR = I2C_REGIDX_BIT(I2C_CTL1_REG_OFFSET, 8U), /*!< error interrupt enable */ + I2C_INT_EV = I2C_REGIDX_BIT(I2C_CTL1_REG_OFFSET, 9U), /*!< event interrupt enable */ + I2C_INT_BUF = I2C_REGIDX_BIT(I2C_CTL1_REG_OFFSET, 10U), /*!< buffer interrupt enable */ +}i2c_interrupt_enum; + +/* SMBus/I2C mode switch and SMBus type selection */ +#define I2C_I2CMODE_ENABLE ((uint32_t)0x00000000U) /*!< I2C mode */ +#define I2C_SMBUSMODE_ENABLE I2C_CTL0_SMBEN /*!< SMBus mode */ + +/* SMBus/I2C mode switch and SMBus type selection */ +#define I2C_SMBUS_DEVICE ((uint32_t)0x00000000U) /*!< SMBus mode device type */ +#define I2C_SMBUS_HOST I2C_CTL0_SMBSEL /*!< SMBus mode host type */ + +/* I2C transfer direction */ +#define I2C_RECEIVER ((uint32_t)0x00000001U) /*!< receiver */ +#define I2C_TRANSMITTER ((uint32_t)0xFFFFFFFEU) /*!< transmitter */ + +/* whether or not to send an ACK */ +#define I2C_ACK_DISABLE ((uint32_t)0x00000000U) /*!< ACK will be not sent */ +#define I2C_ACK_ENABLE I2C_CTL0_ACKEN /*!< ACK will be sent */ + +/* I2C POAP position*/ +#define I2C_ACKPOS_CURRENT ((uint32_t)0x00000000U) /*!< ACKEN bit decides whether or not to send ACK or not for the current byte */ +#define I2C_ACKPOS_NEXT I2C_CTL0_POAP /*!< ACKEN bit decides whether or not to send ACK for the next byte */ + +/* I2C dual-address mode switch */ +#define I2C_DUADEN_DISABLE ((uint32_t)0x00000000U) /*!< dual-address mode disabled */ +#define I2C_DUADEN_ENABLE ((uint32_t)0x00000001U) /*!< dual-address mode enabled */ + +/* whether or not to stretch SCL low */ +#define I2C_SCLSTRETCH_ENABLE ((uint32_t)0x00000000U) /*!< SCL stretching is enabled */ +#define I2C_SCLSTRETCH_DISABLE I2C_CTL0_SS /*!< SCL stretching is disabled */ + +/* whether or not to response to a general call */ +#define I2C_GCEN_ENABLE I2C_CTL0_GCEN /*!< slave will response to a general call */ +#define I2C_GCEN_DISABLE ((uint32_t)0x00000000U) /*!< slave will not response to a general call */ + +/* software reset I2C */ +#define I2C_SRESET_SET I2C_CTL0_SRESET /*!< I2C is under reset */ +#define I2C_SRESET_RESET ((uint32_t)0x00000000U) /*!< I2C is not under reset */ + +/* I2C DMA mode configure */ +/* DMA mode switch */ +#define I2C_DMA_ON I2C_CTL1_DMAON /*!< DMA mode enabled */ +#define I2C_DMA_OFF ((uint32_t)0x00000000U) /*!< DMA mode disabled */ + +/* flag indicating DMA last transfer */ +#define I2C_DMALST_ON I2C_CTL1_DMALST /*!< next DMA EOT is the last transfer */ +#define I2C_DMALST_OFF ((uint32_t)0x00000000U) /*!< next DMA EOT is not the last transfer */ + +/* I2C PEC configure */ +/* PEC enable */ +#define I2C_PEC_ENABLE I2C_CTL0_PECEN /*!< PEC calculation on */ +#define I2C_PEC_DISABLE ((uint32_t)0x00000000U) /*!< PEC calculation off */ + +/* PEC transfer */ +#define I2C_PECTRANS_ENABLE I2C_CTL0_PECTRANS /*!< transfer PEC */ +#define I2C_PECTRANS_DISABLE ((uint32_t)0x00000000U) /*!< not transfer PEC value */ + +/* I2C SMBus configure */ +/* issue or not alert through SMBA pin */ +#define I2C_SALTSEND_ENABLE I2C_CTL0_SALT /*!< issue alert through SMBA pin */ +#define I2C_SALTSEND_DISABLE ((uint32_t)0x00000000U) /*!< not issue alert through SMBA */ + +/* ARP protocol in SMBus switch */ +#define I2C_ARP_ENABLE I2C_CTL0_ARPEN /*!< ARP is enabled */ +#define I2C_ARP_DISABLE ((uint32_t)0x00000000U) /*!< ARP is disabled */ + +/* transmit I2C data */ +#define DATA_TRANS(regval) (BITS(0,7) & ((uint32_t)(regval) << 0)) + +/* receive I2C data */ +#define DATA_RECV(regval) GET_BITS((uint32_t)(regval), 0, 7) + +/* I2C duty cycle in fast mode */ +#define I2C_DTCY_2 ((uint32_t)0x00000000U) /*!< I2C fast mode Tlow/Thigh = 2 */ +#define I2C_DTCY_16_9 I2C_CKCFG_DTCY /*!< I2C fast mode Tlow/Thigh = 16/9 */ + +/* address mode for the I2C slave */ +#define I2C_ADDFORMAT_7BITS ((uint32_t)0x00000000U) /*!< address:7 bits */ +#define I2C_ADDFORMAT_10BITS I2C_SADDR0_ADDFORMAT /*!< address:10 bits */ + +/* function declarations */ +/* initialization functions */ +/* reset I2C */ +void i2c_deinit(uint32_t i2c_periph); +/* configure I2C clock */ +void i2c_clock_config(uint32_t i2c_periph, uint32_t clkspeed, uint32_t dutycyc); +/* configure I2C address */ +void i2c_mode_addr_config(uint32_t i2c_periph, uint32_t mode, uint32_t addformat, uint32_t addr); + +/* application function declarations */ +/* select SMBus type */ +void i2c_smbus_type_config(uint32_t i2c_periph, uint32_t type); +/* whether or not to send an ACK */ +void i2c_ack_config(uint32_t i2c_periph, uint32_t ack); +/* configure I2C POAP position */ +void i2c_ackpos_config(uint32_t i2c_periph, uint32_t pos); +/* master sends slave address */ +void i2c_master_addressing(uint32_t i2c_periph, uint32_t addr, uint32_t trandirection); +/* enable dual-address mode */ +void i2c_dualaddr_enable(uint32_t i2c_periph, uint32_t addr); +/* disable dual-address mode */ +void i2c_dualaddr_disable(uint32_t i2c_periph); +/* enable I2C */ +void i2c_enable(uint32_t i2c_periph); +/* disable I2C */ +void i2c_disable(uint32_t i2c_periph); +/* generate a START condition on I2C bus */ +void i2c_start_on_bus(uint32_t i2c_periph); +/* generate a STOP condition on I2C bus */ +void i2c_stop_on_bus(uint32_t i2c_periph); +/* I2C transmit data function */ +void i2c_data_transmit(uint32_t i2c_periph, uint8_t data); +/* I2C receive data function */ +uint8_t i2c_data_receive(uint32_t i2c_periph); +/* configure I2C DMA mode */ +void i2c_dma_config(uint32_t i2c_periph, uint32_t dmastate); +/* configure whether next DMA EOT is DMA last transfer or not */ +void i2c_dma_last_transfer_config(uint32_t i2c_periph, uint32_t dmalast); +/* whether to stretch SCL low when data is not ready in slave mode */ +void i2c_stretch_scl_low_config(uint32_t i2c_periph, uint32_t stretchpara); +/* whether or not to response to a general call */ +void i2c_slave_response_to_gcall_config(uint32_t i2c_periph, uint32_t gcallpara); +/* configure software reset of I2C */ +void i2c_software_reset_config(uint32_t i2c_periph, uint32_t sreset); +/* configure I2C PEC calculation */ +void i2c_pec_config(uint32_t i2c_periph, uint32_t pecstate); +/* configure whether to transfer PEC value */ +void i2c_pec_transfer_config(uint32_t i2c_periph, uint32_t pecpara); +/* get packet error checking value */ +uint8_t i2c_pec_value_get(uint32_t i2c_periph); +/* configure I2C alert through SMBA pin */ +void i2c_smbus_alert_config(uint32_t i2c_periph, uint32_t smbuspara); +/* configure I2C ARP protocol in SMBus */ +void i2c_smbus_arp_config(uint32_t i2c_periph, uint32_t arpstate); + +/* interrupt & flag functions */ +/* get I2C flag status */ +FlagStatus i2c_flag_get(uint32_t i2c_periph, i2c_flag_enum flag); +/* clear I2C flag status */ +void i2c_flag_clear(uint32_t i2c_periph, i2c_flag_enum flag); +/* enable I2C interrupt */ +void i2c_interrupt_enable(uint32_t i2c_periph, i2c_interrupt_enum interrupt); +/* disable I2C interrupt */ +void i2c_interrupt_disable(uint32_t i2c_periph, i2c_interrupt_enum interrupt); +/* get I2C interrupt flag status */ +FlagStatus i2c_interrupt_flag_get(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag); +/* clear I2C interrupt flag status */ +void i2c_interrupt_flag_clear(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag); + +#endif /* GD32E10X_I2C_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_misc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_misc.h new file mode 100644 index 0000000..3d63018 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_misc.h @@ -0,0 +1,91 @@ +/*! + \file gd32f10x_misc.h + \brief definitions for the MISC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_MISC_H +#define GD32F10X_MISC_H + +#include "gd32f10x.h" + +/* constants definitions */ +/* set the RAM and FLASH base address */ +#define NVIC_VECTTAB_RAM ((uint32_t)0x20000000U) /*!< RAM base address */ +#define NVIC_VECTTAB_FLASH ((uint32_t)0x08000000U) /*!< Flash base address */ + +/* set the NVIC vector table offset mask */ +#define NVIC_VECTTAB_OFFSET_MASK ((uint32_t)0x1FFFFF80U) + +/* the register key mask, if you want to do the write operation, you should write 0x5FA to VECTKEY bits */ +#define NVIC_AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000U) + +/* priority group - define the pre-emption priority and the subpriority */ +#define NVIC_PRIGROUP_PRE0_SUB4 ((uint32_t)0x00000700U) /*!< 0 bits for pre-emption priority, 4 bits for subpriority */ +#define NVIC_PRIGROUP_PRE1_SUB3 ((uint32_t)0x00000600U) /*!< 1 bits for pre-emption priority, 3 bits for subpriority */ +#define NVIC_PRIGROUP_PRE2_SUB2 ((uint32_t)0x00000500U) /*!< 2 bits for pre-emption priority, 2 bits for subpriority */ +#define NVIC_PRIGROUP_PRE3_SUB1 ((uint32_t)0x00000400U) /*!< 3 bits for pre-emption priority, 1 bits for subpriority */ +#define NVIC_PRIGROUP_PRE4_SUB0 ((uint32_t)0x00000300U) /*!< 4 bits for pre-emption priority, 0 bits for subpriority */ + +/* choose the method to enter or exit the low power mode */ +#define SCB_SCR_SLEEPONEXIT ((uint8_t)0x02U) /*!< choose the system whether enter low power mode by exiting from ISR */ +#define SCB_SCR_SLEEPDEEP ((uint8_t)0x04U) /*!< choose the system enter the DEEPSLEEP mode or SLEEP mode */ +#define SCB_SCR_SEVONPEND ((uint8_t)0x10U) /*!< choose the interrupt source that can wake up the low power mode */ + +#define SCB_LPM_SLEEP_EXIT_ISR SCB_SCR_SLEEPONEXIT +#define SCB_LPM_DEEPSLEEP SCB_SCR_SLEEPDEEP +#define SCB_LPM_WAKE_BY_ALL_INT SCB_SCR_SEVONPEND + +/* choose the systick clock source */ +#define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0xFFFFFFFBU) /*!< systick clock source is from HCLK/8 */ +#define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004U) /*!< systick clock source is from HCLK */ + +/* function declarations */ +/* set the priority group */ +void nvic_priority_group_set(uint32_t nvic_prigroup); + +/* enable NVIC interrupt request */ +void nvic_irq_enable(uint8_t nvic_irq, uint8_t nvic_irq_pre_priority, uint8_t nvic_irq_sub_priority); +/* disable NVIC interrupt request */ +void nvic_irq_disable(uint8_t nvic_irq); + +/* set the NVIC vector table base address */ +void nvic_vector_table_set(uint32_t nvic_vict_tab, uint32_t offset); + +/* set the state of the low power mode */ +void system_lowpower_set(uint8_t lowpower_mode); +/* reset the state of the low power mode */ +void system_lowpower_reset(uint8_t lowpower_mode); + +/* set the systick clock source */ +void systick_clksource_set(uint32_t systick_clksource); + +#endif /* GD32F10X_MISC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_pmu.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_pmu.h new file mode 100644 index 0000000..65a1d3f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_pmu.h @@ -0,0 +1,126 @@ +/*! + \file gd32f10x_pmu.h + \brief definitions for the PMU + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_PMU_H +#define GD32F10X_PMU_H + +#include "gd32f10x.h" + +/* PMU definitions */ +#define PMU PMU_BASE /*!< PMU base address */ + +/* registers definitions */ +#define PMU_CTL REG32((PMU) + 0x00000000U) /*!< PMU control register */ +#define PMU_CS REG32((PMU) + 0x00000004U) /*!< PMU control and status register */ + +/* bits definitions */ +/* PMU_CTL */ +#define PMU_CTL_LDOLP BIT(0) /*!< LDO low power mode */ +#define PMU_CTL_STBMOD BIT(1) /*!< standby mode */ +#define PMU_CTL_WURST BIT(2) /*!< wakeup flag reset */ +#define PMU_CTL_STBRST BIT(3) /*!< standby flag reset */ +#define PMU_CTL_LVDEN BIT(4) /*!< low voltage detector enable */ +#define PMU_CTL_LVDT BITS(5,7) /*!< low voltage detector threshold */ +#define PMU_CTL_BKPWEN BIT(8) /*!< backup domain write enable */ + +/* PMU_CS */ +#define PMU_CS_WUF BIT(0) /*!< wakeup flag */ +#define PMU_CS_STBF BIT(1) /*!< standby flag */ +#define PMU_CS_LVDF BIT(2) /*!< low voltage detector status flag */ +#define PMU_CS_WUPEN BIT(8) /*!< wakeup pin enable */ + +/* constants definitions */ +/* PMU ldo definitions */ +#define PMU_LDO_NORMAL ((uint32_t)0x00000000U) /*!< LDO normal work when PMU enter deepsleep mode */ +#define PMU_LDO_LOWPOWER PMU_CTL_LDOLP /*!< LDO work at low power status when PMU enter deepsleep mode */ + +/* PMU low voltage detector threshold definitions */ +#define CTL_LVDT(regval) (BITS(5,7)&((uint32_t)(regval) << 5)) +#define PMU_LVDT_0 CTL_LVDT(0) /*!< voltage threshold is 2.2V */ +#define PMU_LVDT_1 CTL_LVDT(1) /*!< voltage threshold is 2.3V */ +#define PMU_LVDT_2 CTL_LVDT(2) /*!< voltage threshold is 2.4V */ +#define PMU_LVDT_3 CTL_LVDT(3) /*!< voltage threshold is 2.5V */ +#define PMU_LVDT_4 CTL_LVDT(4) /*!< voltage threshold is 2.6V */ +#define PMU_LVDT_5 CTL_LVDT(5) /*!< voltage threshold is 2.7V */ +#define PMU_LVDT_6 CTL_LVDT(6) /*!< voltage threshold is 2.8V */ +#define PMU_LVDT_7 CTL_LVDT(7) /*!< voltage threshold is 2.9V */ + +/* PMU flag definitions */ +#define PMU_FLAG_WAKEUP PMU_CS_WUF /*!< wakeup flag status */ +#define PMU_FLAG_STANDBY PMU_CS_STBF /*!< standby flag status */ +#define PMU_FLAG_LVD PMU_CS_LVDF /*!< lvd flag status */ + +/* PMU flag reset definitions */ +#define PMU_FLAG_RESET_WAKEUP ((uint8_t)0x00U) /*!< wakeup flag reset */ +#define PMU_FLAG_RESET_STANDBY ((uint8_t)0x01U) /*!< standby flag reset */ + +/* PMU command constants definitions */ +#define WFI_CMD ((uint8_t)0x00U) /*!< use WFI command */ +#define WFE_CMD ((uint8_t)0x01U) /*!< use WFE command */ + +/* function declarations */ +/* reset PMU registers */ +void pmu_deinit(void); + +/* LVD functions */ +/* select low voltage detector threshold */ +void pmu_lvd_select(uint32_t lvdt_n); +/* disable PMU lvd */ +void pmu_lvd_disable(void); + +/* set PMU mode */ +/* PMU work in sleep mode */ +void pmu_to_sleepmode(uint8_t sleepmodecmd); +/* PMU work in deepsleep mode */ +void pmu_to_deepsleepmode(uint32_t ldo, uint8_t deepsleepmodecmd); +/* PMU work in standby mode */ +void pmu_to_standbymode(void); +/* enable PMU wakeup pin */ +void pmu_wakeup_pin_enable(void); +/* disable PMU wakeup pin */ +void pmu_wakeup_pin_disable(void); + +/* backup related functions */ +/* enable write access to the registers in backup domain */ +void pmu_backup_write_enable(void); +/* disable write access to the registers in backup domain */ +void pmu_backup_write_disable(void); + +/* flag functions */ +/* get flag state */ +FlagStatus pmu_flag_get(uint32_t flag); +/* clear flag bit */ +void pmu_flag_clear(uint32_t flag); + +#endif /* GD32F10X_PMU_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rcu.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rcu.h new file mode 100644 index 0000000..b9aa80f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rcu.h @@ -0,0 +1,919 @@ +/*! + \file gd32f10x_rcu.h + \brief definitions for the RCU + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_RCU_H +#define GD32F10X_RCU_H + +#include "gd32f10x.h" + +/* RCU definitions */ +#define RCU RCU_BASE + +/* registers definitions */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_CTL REG32(RCU + 0x00U) /*!< control register */ +#define RCU_CFG0 REG32(RCU + 0x04U) /*!< clock configuration register 0 */ +#define RCU_INT REG32(RCU + 0x08U) /*!< clock interrupt register */ +#define RCU_APB2RST REG32(RCU + 0x0CU) /*!< APB2 reset register */ +#define RCU_APB1RST REG32(RCU + 0x10U) /*!< APB1 reset register */ +#define RCU_AHBEN REG32(RCU + 0x14U) /*!< AHB enable register */ +#define RCU_APB2EN REG32(RCU + 0x18U) /*!< APB2 enable register */ +#define RCU_APB1EN REG32(RCU + 0x1CU) /*!< APB1 enable register */ +#define RCU_BDCTL REG32(RCU + 0x20U) /*!< backup domain control register */ +#define RCU_RSTSCK REG32(RCU + 0x24U) /*!< reset source / clock register */ +#define RCU_DSV REG32(RCU + 0x34U) /*!< deep-sleep mode voltage register */ +#elif defined(GD32F10X_CL) +#define RCU_CTL REG32(RCU + 0x00U) /*!< control register */ +#define RCU_CFG0 REG32(RCU + 0x04U) /*!< clock configuration register 0 */ +#define RCU_INT REG32(RCU + 0x08U) /*!< clock interrupt register */ +#define RCU_APB2RST REG32(RCU + 0x0CU) /*!< APB2 reset register */ +#define RCU_APB1RST REG32(RCU + 0x10U) /*!< APB1 reset register */ +#define RCU_AHBEN REG32(RCU + 0x14U) /*!< AHB1 enable register */ +#define RCU_APB2EN REG32(RCU + 0x18U) /*!< APB2 enable register */ +#define RCU_APB1EN REG32(RCU + 0x1CU) /*!< APB1 enable register */ +#define RCU_BDCTL REG32(RCU + 0x20U) /*!< backup domain control register */ +#define RCU_RSTSCK REG32(RCU + 0x24U) /*!< reset source / clock register */ +#define RCU_AHBRST REG32(RCU + 0x28U) /*!< AHB reset register */ +#define RCU_CFG1 REG32(RCU + 0x2CU) /*!< clock configuration register 1 */ +#define RCU_DSV REG32(RCU + 0x34U) /*!< deep-sleep mode voltage register */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* bits definitions */ +/* RCU_CTL */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_CTL_IRC8MEN BIT(0) /*!< internal high speed oscillator enable */ +#define RCU_CTL_IRC8MSTB BIT(1) /*!< IRC8M high speed internal oscillator stabilization flag */ +#define RCU_CTL_IRC8MADJ BITS(3,7) /*!< high speed internal oscillator clock trim adjust value */ +#define RCU_CTL_IRC8MCALIB BITS(8,15) /*!< high speed internal oscillator calibration value register */ +#define RCU_CTL_HXTALEN BIT(16) /*!< external high speed oscillator enable */ +#define RCU_CTL_HXTALSTB BIT(17) /*!< external crystal oscillator clock stabilization flag */ +#define RCU_CTL_HXTALBPS BIT(18) /*!< external crystal oscillator clock bypass mode enable */ +#define RCU_CTL_CKMEN BIT(19) /*!< HXTAL clock monitor enable */ +#define RCU_CTL_PLLEN BIT(24) /*!< PLL enable */ +#define RCU_CTL_PLLSTB BIT(25) /*!< PLL clock stabilization flag */ +#elif defined(GD32F10X_CL) +#define RCU_CTL_IRC8MEN BIT(0) /*!< internal high speed oscillator enable */ +#define RCU_CTL_IRC8MSTB BIT(1) /*!< IRC8M high speed internal oscillator stabilization flag */ +#define RCU_CTL_IRC8MADJ BITS(3,7) /*!< high speed internal oscillator clock trim adjust value */ +#define RCU_CTL_IRC8MCALIB BITS(8,15) /*!< high speed internal oscillator calibration value register */ +#define RCU_CTL_HXTALEN BIT(16) /*!< external high speed oscillator enable */ +#define RCU_CTL_HXTALSTB BIT(17) /*!< external crystal oscillator clock stabilization flag */ +#define RCU_CTL_HXTALBPS BIT(18) /*!< external crystal oscillator clock bypass mode enable */ +#define RCU_CTL_CKMEN BIT(19) /*!< HXTAL clock monitor enable */ +#define RCU_CTL_PLLEN BIT(24) /*!< PLL enable */ +#define RCU_CTL_PLLSTB BIT(25) /*!< PLL clock stabilization flag */ +#define RCU_CTL_PLL1EN BIT(26) /*!< PLL1 enable */ +#define RCU_CTL_PLL1STB BIT(27) /*!< PLL1 clock stabilization flag */ +#define RCU_CTL_PLL2EN BIT(28) /*!< PLL2 enable */ +#define RCU_CTL_PLL2STB BIT(29) /*!< PLL2 clock stabilization flag */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* RCU_CFG0 */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_CFG0_SCS BITS(0,1) /*!< system clock switch */ +#define RCU_CFG0_SCSS BITS(2,3) /*!< system clock switch status */ +#define RCU_CFG0_AHBPSC BITS(4,7) /*!< AHB prescaler selection */ +#define RCU_CFG0_APB1PSC BITS(8,10) /*!< APB1 prescaler selection */ +#define RCU_CFG0_APB2PSC BITS(11,13) /*!< APB2 prescaler selection */ +#define RCU_CFG0_ADCPSC BITS(14,15) /*!< ADC prescaler selection */ +#define RCU_CFG0_PLLSEL BIT(16) /*!< PLL clock source selection */ +#define RCU_CFG0_PREDV0 BIT(17) /*!< PREDV0 division factor */ +#define RCU_CFG0_PLLMF BITS(18,21) /*!< PLL clock multiplication factor */ +#define RCU_CFG0_USBDPSC BITS(22,23) /*!< USBD clock prescaler selection */ +#define RCU_CFG0_CKOUT0SEL BITS(24,26) /*!< CKOUT0 clock source selection */ +#define RCU_CFG0_PLLMF_4 BIT(27) /*!< bit 4 of PLLMF */ +#define RCU_CFG0_ADCPSC_2 BIT(28) /*!< bit 2 of ADCPSC */ +#elif defined(GD32F10X_CL) +#define RCU_CFG0_SCS BITS(0,1) /*!< system clock switch */ +#define RCU_CFG0_SCSS BITS(2,3) /*!< system clock switch status */ +#define RCU_CFG0_AHBPSC BITS(4,7) /*!< AHB prescaler selection */ +#define RCU_CFG0_APB1PSC BITS(8,10) /*!< APB1 prescaler selection */ +#define RCU_CFG0_APB2PSC BITS(11,13) /*!< APB2 prescaler selection */ +#define RCU_CFG0_ADCPSC BITS(14,15) /*!< ADC prescaler selection */ +#define RCU_CFG0_PLLSEL BIT(16) /*!< PLL clock source selection */ +#define RCU_CFG0_PREDV0_LSB BIT(17) /*!< the LSB of PREDV0 division factor */ +#define RCU_CFG0_PLLMF BITS(18,21) /*!< PLL clock multiplication factor */ +#define RCU_CFG0_USBFSPSC BITS(22,23) /*!< USBFS clock prescaler selection */ +#define RCU_CFG0_CKOUT0SEL BITS(24,27) /*!< CKOUT0 clock source selection */ +#define RCU_CFG0_ADCPSC_2 BIT(28) /*!< bit 2 of ADCPSC */ +#define RCU_CFG0_PLLMF_4 BIT(29) /*!< bit 4 of PLLMF */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* RCU_INT */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_INT_IRC40KSTBIF BIT(0) /*!< IRC40K stabilization interrupt flag */ +#define RCU_INT_LXTALSTBIF BIT(1) /*!< LXTAL stabilization interrupt flag */ +#define RCU_INT_IRC8MSTBIF BIT(2) /*!< IRC8M stabilization interrupt flag */ +#define RCU_INT_HXTALSTBIF BIT(3) /*!< HXTAL stabilization interrupt flag */ +#define RCU_INT_PLLSTBIF BIT(4) /*!< PLL stabilization interrupt flag */ +#define RCU_INT_CKMIF BIT(7) /*!< HXTAL clock stuck interrupt flag */ +#define RCU_INT_IRC40KSTBIE BIT(8) /*!< IRC40K stabilization interrupt enable */ +#define RCU_INT_LXTALSTBIE BIT(9) /*!< LXTAL stabilization interrupt enable */ +#define RCU_INT_IRC8MSTBIE BIT(10) /*!< IRC8M stabilization interrupt enable */ +#define RCU_INT_HXTALSTBIE BIT(11) /*!< HXTAL stabilization interrupt enable */ +#define RCU_INT_PLLSTBIE BIT(12) /*!< PLL stabilization interrupt enable */ +#define RCU_INT_IRC40KSTBIC BIT(16) /*!< IRC40K Stabilization interrupt clear */ +#define RCU_INT_LXTALSTBIC BIT(17) /*!< LXTAL Stabilization interrupt clear */ +#define RCU_INT_IRC8MSTBIC BIT(18) /*!< IRC8M Stabilization interrupt clear */ +#define RCU_INT_HXTALSTBIC BIT(19) /*!< HXTAL Stabilization interrupt clear */ +#define RCU_INT_PLLSTBIC BIT(20) /*!< PLL stabilization interrupt clear */ +#define RCU_INT_CKMIC BIT(23) /*!< HXTAL clock stuck interrupt clear */ +#elif defined(GD32F10X_CL) +#define RCU_INT_IRC40KSTBIF BIT(0) /*!< IRC40K stabilization interrupt flag */ +#define RCU_INT_LXTALSTBIF BIT(1) /*!< LXTAL stabilization interrupt flag */ +#define RCU_INT_IRC8MSTBIF BIT(2) /*!< IRC8M stabilization interrupt flag */ +#define RCU_INT_HXTALSTBIF BIT(3) /*!< HXTAL stabilization interrupt flag */ +#define RCU_INT_PLLSTBIF BIT(4) /*!< PLL stabilization interrupt flag */ +#define RCU_INT_PLL1STBIF BIT(5) /*!< PLL1 stabilization interrupt flag */ +#define RCU_INT_PLL2STBIF BIT(6) /*!< PLL2 stabilization interrupt flag */ +#define RCU_INT_CKMIF BIT(7) /*!< HXTAL clock stuck interrupt flag */ +#define RCU_INT_IRC40KSTBIE BIT(8) /*!< IRC40K stabilization interrupt enable */ +#define RCU_INT_LXTALSTBIE BIT(9) /*!< LXTAL stabilization interrupt enable */ +#define RCU_INT_IRC8MSTBIE BIT(10) /*!< IRC8M stabilization interrupt enable */ +#define RCU_INT_HXTALSTBIE BIT(11) /*!< HXTAL stabilization interrupt enable */ +#define RCU_INT_PLLSTBIE BIT(12) /*!< PLL stabilization interrupt enable */ +#define RCU_INT_PLL1STBIE BIT(13) /*!< PLL1 stabilization interrupt enable */ +#define RCU_INT_PLL2STBIE BIT(14) /*!< PLL2 stabilization interrupt enable */ +#define RCU_INT_IRC40KSTBIC BIT(16) /*!< IRC40K stabilization interrupt clear */ +#define RCU_INT_LXTALSTBIC BIT(17) /*!< LXTAL stabilization interrupt clear */ +#define RCU_INT_IRC8MSTBIC BIT(18) /*!< IRC8M stabilization interrupt clear */ +#define RCU_INT_HXTALSTBIC BIT(19) /*!< HXTAL stabilization interrupt clear */ +#define RCU_INT_PLLSTBIC BIT(20) /*!< PLL stabilization interrupt clear */ +#define RCU_INT_PLL1STBIC BIT(21) /*!< PLL1 stabilization interrupt clear */ +#define RCU_INT_PLL2STBIC BIT(22) /*!< PLL2 stabilization interrupt clear */ +#define RCU_INT_CKMIC BIT(23) /*!< HXTAL clock stuck interrupt clear */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* RCU_APB2RST */ +#define RCU_APB2RST_AFRST BIT(0) /*!< alternate function I/O reset */ +#define RCU_APB2RST_PARST BIT(2) /*!< GPIO port A reset */ +#define RCU_APB2RST_PBRST BIT(3) /*!< GPIO port B reset */ +#define RCU_APB2RST_PCRST BIT(4) /*!< GPIO port C reset */ +#define RCU_APB2RST_PDRST BIT(5) /*!< GPIO port D reset */ +#define RCU_APB2RST_PERST BIT(6) /*!< GPIO port E reset */ +#define RCU_APB2RST_PFRST BIT(7) /*!< GPIO port F reset */ +#define RCU_APB2RST_PGRST BIT(8) /*!< GPIO port G reset */ +#define RCU_APB2RST_ADC0RST BIT(9) /*!< ADC0 reset */ +#define RCU_APB2RST_ADC1RST BIT(10) /*!< ADC1 reset */ +#define RCU_APB2RST_TIMER0RST BIT(11) /*!< TIMER0 reset */ +#define RCU_APB2RST_SPI0RST BIT(12) /*!< SPI0 reset */ +#define RCU_APB2RST_TIMER7RST BIT(13) /*!< TIMER7 reset */ +#define RCU_APB2RST_USART0RST BIT(14) /*!< USART0 reset */ +#ifndef GD32F10X_CL +#define RCU_APB2RST_ADC2RST BIT(15) /*!< ADC2 reset */ +#endif /* GD32F10X_CL */ +#ifdef GD32F10X_XD +#define RCU_APB2RST_TIMER8RST BIT(19) /*!< TIMER8 reset */ +#define RCU_APB2RST_TIMER9RST BIT(20) /*!< TIMER9 reset */ +#define RCU_APB2RST_TIMER10RST BIT(21) /*!< TIMER10 reset */ +#endif /* GD32F10X_XD */ + +/* RCU_APB1RST */ +#define RCU_APB1RST_TIMER1RST BIT(0) /*!< TIMER1 reset */ +#define RCU_APB1RST_TIMER2RST BIT(1) /*!< TIMER2 reset */ +#define RCU_APB1RST_TIMER3RST BIT(2) /*!< TIMER3 reset */ +#define RCU_APB1RST_TIMER4RST BIT(3) /*!< TIMER4 reset */ +#define RCU_APB1RST_TIMER5RST BIT(4) /*!< TIMER5 reset */ +#define RCU_APB1RST_TIMER6RST BIT(5) /*!< TIMER6 reset */ +#ifdef GD32F10X_XD +#define RCU_APB1RST_TIMER11RST BIT(6) /*!< TIMER11 reset */ +#define RCU_APB1RST_TIMER12RST BIT(7) /*!< TIMER12 reset */ +#define RCU_APB1RST_TIMER13RST BIT(8) /*!< TIMER13 reset */ +#endif /* GD32F10X_XD */ +#define RCU_APB1RST_WWDGTRST BIT(11) /*!< WWDGT reset */ +#define RCU_APB1RST_SPI1RST BIT(14) /*!< SPI1 reset */ +#define RCU_APB1RST_SPI2RST BIT(15) /*!< SPI2 reset */ +#define RCU_APB1RST_USART1RST BIT(17) /*!< USART1 reset */ +#define RCU_APB1RST_USART2RST BIT(18) /*!< USART2 reset */ +#define RCU_APB1RST_UART3RST BIT(19) /*!< UART3 reset */ +#define RCU_APB1RST_UART4RST BIT(20) /*!< UART4 reset */ +#define RCU_APB1RST_I2C0RST BIT(21) /*!< I2C0 reset */ +#define RCU_APB1RST_I2C1RST BIT(22) /*!< I2C1 reset */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_APB1RST_USBDRST BIT(23) /*!< USBD reset */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ +#define RCU_APB1RST_CAN0RST BIT(25) /*!< CAN0 reset */ +#ifdef GD32F10X_CL +#define RCU_APB1RST_CAN1RST BIT(26) /*!< CAN1 reset */ +#endif /* GD32F10X_CL */ +#define RCU_APB1RST_BKPIRST BIT(27) /*!< backup interface reset */ +#define RCU_APB1RST_PMURST BIT(28) /*!< PMU reset */ +#define RCU_APB1RST_DACRST BIT(29) /*!< DAC reset */ + +/* RCU_AHBEN */ +#define RCU_AHBEN_DMA0EN BIT(0) /*!< DMA0 clock enable */ +#define RCU_AHBEN_DMA1EN BIT(1) /*!< DMA1 clock enable */ +#define RCU_AHBEN_SRAMSPEN BIT(2) /*!< SRAM clock enable when sleep mode */ +#define RCU_AHBEN_FMCSPEN BIT(4) /*!< FMC clock enable when sleep mode */ +#define RCU_AHBEN_CRCEN BIT(6) /*!< CRC clock enable */ +#define RCU_AHBEN_EXMCEN BIT(8) /*!< EXMC clock enable */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_AHBEN_SDIOEN BIT(10) /*!< SDIO clock enable */ +#elif defined(GD32F10X_CL) +#define RCU_AHBEN_USBFSEN BIT(12) /*!< USBFS clock enable */ +#define RCU_AHBEN_ENETEN BIT(14) /*!< ENET clock enable */ +#define RCU_AHBEN_ENETTXEN BIT(15) /*!< Ethernet TX clock enable */ +#define RCU_AHBEN_ENETRXEN BIT(16) /*!< Ethernet RX clock enable */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* RCU_APB2EN */ +#define RCU_APB2EN_AFEN BIT(0) /*!< alternate function IO clock enable */ +#define RCU_APB2EN_PAEN BIT(2) /*!< GPIO port A clock enable */ +#define RCU_APB2EN_PBEN BIT(3) /*!< GPIO port B clock enable */ +#define RCU_APB2EN_PCEN BIT(4) /*!< GPIO port C clock enable */ +#define RCU_APB2EN_PDEN BIT(5) /*!< GPIO port D clock enable */ +#define RCU_APB2EN_PEEN BIT(6) /*!< GPIO port E clock enable */ +#define RCU_APB2EN_PFEN BIT(7) /*!< GPIO port F clock enable */ +#define RCU_APB2EN_PGEN BIT(8) /*!< GPIO port G clock enable */ +#define RCU_APB2EN_ADC0EN BIT(9) /*!< ADC0 clock enable */ +#define RCU_APB2EN_ADC1EN BIT(10) /*!< ADC1 clock enable */ +#define RCU_APB2EN_TIMER0EN BIT(11) /*!< TIMER0 clock enable */ +#define RCU_APB2EN_SPI0EN BIT(12) /*!< SPI0 clock enable */ +#define RCU_APB2EN_TIMER7EN BIT(13) /*!< TIMER7 clock enable */ +#define RCU_APB2EN_USART0EN BIT(14) /*!< USART0 clock enable */ +#ifndef GD32F10X_CL +#define RCU_APB2EN_ADC2EN BIT(15) /*!< ADC2 clock enable */ +#endif /* GD32F10X_CL */ +#ifdef GD32F10X_XD +#define RCU_APB2EN_TIMER8EN BIT(19) /*!< TIMER8 clock enable */ +#define RCU_APB2EN_TIMER9EN BIT(20) /*!< TIMER9 clock enable */ +#define RCU_APB2EN_TIMER10EN BIT(21) /*!< TIMER10 clock enable */ +#endif /* GD32F10X_XD */ + +/* RCU_APB1EN */ +#define RCU_APB1EN_TIMER1EN BIT(0) /*!< TIMER1 clock enable */ +#define RCU_APB1EN_TIMER2EN BIT(1) /*!< TIMER2 clock enable */ +#define RCU_APB1EN_TIMER3EN BIT(2) /*!< TIMER3 clock enable */ +#define RCU_APB1EN_TIMER4EN BIT(3) /*!< TIMER4 clock enable */ +#define RCU_APB1EN_TIMER5EN BIT(4) /*!< TIMER5 clock enable */ +#define RCU_APB1EN_TIMER6EN BIT(5) /*!< TIMER6 clock enable */ +#ifdef GD32F10X_XD +#define RCU_APB1EN_TIMER11EN BIT(6) /*!< TIMER11 clock enable */ +#define RCU_APB1EN_TIMER12EN BIT(7) /*!< TIMER12 clock enable */ +#define RCU_APB1EN_TIMER13EN BIT(8) /*!< TIMER13 clock enable */ +#endif /* GD32F10X_XD */ +#define RCU_APB1EN_WWDGTEN BIT(11) /*!< WWDGT clock enable */ +#define RCU_APB1EN_SPI1EN BIT(14) /*!< SPI1 clock enable */ +#define RCU_APB1EN_SPI2EN BIT(15) /*!< SPI2 clock enable */ +#define RCU_APB1EN_USART1EN BIT(17) /*!< USART1 clock enable */ +#define RCU_APB1EN_USART2EN BIT(18) /*!< USART2 clock enable */ +#define RCU_APB1EN_UART3EN BIT(19) /*!< UART3 clock enable */ +#define RCU_APB1EN_UART4EN BIT(20) /*!< UART4 clock enable */ +#define RCU_APB1EN_I2C0EN BIT(21) /*!< I2C0 clock enable */ +#define RCU_APB1EN_I2C1EN BIT(22) /*!< I2C1 clock enable */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_APB1EN_USBDEN BIT(23) /*!< USBD clock enable */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ +#define RCU_APB1EN_CAN0EN BIT(25) /*!< CAN0 clock enable */ +#ifdef GD32F10X_CL +#define RCU_APB1EN_CAN1EN BIT(26) /*!< CAN1 clock enable */ +#endif /* GD32F10X_CL */ +#define RCU_APB1EN_BKPIEN BIT(27) /*!< backup interface clock enable */ +#define RCU_APB1EN_PMUEN BIT(28) /*!< PMU clock enable */ +#define RCU_APB1EN_DACEN BIT(29) /*!< DAC clock enable */ + +/* RCU_BDCTL */ +#define RCU_BDCTL_LXTALEN BIT(0) /*!< LXTAL enable */ +#define RCU_BDCTL_LXTALSTB BIT(1) /*!< low speed crystal oscillator stabilization flag */ +#define RCU_BDCTL_LXTALBPS BIT(2) /*!< LXTAL bypass mode enable */ +#define RCU_BDCTL_RTCSRC BITS(8,9) /*!< RTC clock entry selection */ +#define RCU_BDCTL_RTCEN BIT(15) /*!< RTC clock enable */ +#define RCU_BDCTL_BKPRST BIT(16) /*!< backup domain reset */ + +/* RCU_RSTSCK */ +#define RCU_RSTSCK_IRC40KEN BIT(0) /*!< IRC40K enable */ +#define RCU_RSTSCK_IRC40KSTB BIT(1) /*!< IRC40K stabilization flag */ +#define RCU_RSTSCK_RSTFC BIT(24) /*!< reset flag clear */ +#define RCU_RSTSCK_EPRSTF BIT(26) /*!< external pin reset flag */ +#define RCU_RSTSCK_PORRSTF BIT(27) /*!< power reset flag */ +#define RCU_RSTSCK_SWRSTF BIT(28) /*!< software reset flag */ +#define RCU_RSTSCK_FWDGTRSTF BIT(29) /*!< free watchdog timer reset flag */ +#define RCU_RSTSCK_WWDGTRSTF BIT(30) /*!< window watchdog timer reset flag */ +#define RCU_RSTSCK_LPRSTF BIT(31) /*!< low-power reset flag */ + +#ifdef GD32F10X_CL +/* RCU_AHBRST */ +#define RCU_AHBRST_USBFSRST BIT(12) /*!< USBFS reset */ +#define RCU_AHBRST_ENETRST BIT(14) /*!< ENET reset */ +#endif /* GD32F10X_CL */ + +#if defined(GD32F10X_CL) +/* RCU_CFG1 */ +#define RCU_CFG1_PREDV0 BITS(0,3) /*!< PREDV0 division factor */ +#define RCU_CFG1_PREDV1 BITS(4,7) /*!< PREDV1 division factor */ +#define RCU_CFG1_PLL1MF BITS(8,11) /*!< PLL1 clock multiplication factor */ +#define RCU_CFG1_PLL2MF BITS(12,15) /*!< PLL2 clock multiplication factor */ +#define RCU_CFG1_PREDV0SEL BIT(16) /*!< PREDV0 input clock source selection */ +#define RCU_CFG1_I2S1SEL BIT(17) /*!< I2S1 clock source selection */ +#define RCU_CFG1_I2S2SEL BIT(18) /*!< I2S2 clock source selection */ +#endif /* GD32F10X_CL */ + +/* RCU_DSV */ +#define RCU_DSV_DSLPVS BITS(0,2) /*!< deep-sleep mode voltage select */ + +/* constants definitions */ +/* define the peripheral clock enable bit position and its register index offset */ +#define RCU_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define RCU_REG_VAL(periph) (REG32(RCU + ((uint32_t)(periph) >> 6))) +#define RCU_BIT_POS(val) ((uint32_t)(val) & 0x1FU) + +/* register offset */ +/* peripherals enable */ +#define AHBEN_REG_OFFSET 0x14U /*!< AHB enable register offset */ +#define APB1EN_REG_OFFSET 0x1CU /*!< APB1 enable register offset */ +#define APB2EN_REG_OFFSET 0x18U /*!< APB2 enable register offset */ + +/* peripherals reset */ +#define AHBRST_REG_OFFSET 0x28U /*!< AHB reset register offset */ +#define APB1RST_REG_OFFSET 0x10U /*!< APB1 reset register offset */ +#define APB2RST_REG_OFFSET 0x0CU /*!< APB2 reset register offset */ +#define RSTSCK_REG_OFFSET 0x24U /*!< reset source/clock register offset */ + +/* clock control */ +#define CTL_REG_OFFSET 0x00U /*!< control register offset */ +#define BDCTL_REG_OFFSET 0x20U /*!< backup domain control register offset */ + +/* clock stabilization and stuck interrupt */ +#define INT_REG_OFFSET 0x08U /*!< clock interrupt register offset */ + +/* configuration register */ +#define CFG0_REG_OFFSET 0x04U /*!< clock configuration register 0 offset */ +#define CFG1_REG_OFFSET 0x2CU /*!< clock configuration register 1 offset */ + +/* peripheral clock enable */ +typedef enum +{ + /* AHB peripherals */ + RCU_DMA0 = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 0U), /*!< DMA0 clock */ + RCU_DMA1 = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 1U), /*!< DMA1 clock */ + RCU_CRC = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 6U), /*!< CRC clock */ + RCU_EXMC = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 8U), /*!< EXMC clock */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + RCU_SDIO = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 10U), /*!< SDIO clock */ +#elif defined(GD32F10X_CL) + RCU_USBFS = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 12U), /*!< USBFS clock */ + RCU_ENET = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 14U), /*!< ENET clock */ + RCU_ENETTX = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 15U), /*!< ENETTX clock */ + RCU_ENETRX = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 16U), /*!< ENETRX clock */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* APB1 peripherals */ + RCU_TIMER1 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 0U), /*!< TIMER1 clock */ + RCU_TIMER2 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 1U), /*!< TIMER2 clock */ + RCU_TIMER3 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 2U), /*!< TIMER3 clock */ + RCU_TIMER4 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 3U), /*!< TIMER4 clock */ + RCU_TIMER5 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 4U), /*!< TIMER5 clock */ + RCU_TIMER6 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 5U), /*!< TIMER6 clock */ +#if defined(GD32F10X_XD) + RCU_TIMER11 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 6U), /*!< TIMER11 clock */ + RCU_TIMER12 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 7U), /*!< TIMER12 clock */ + RCU_TIMER13 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 8U), /*!< TIMER13 clock */ +#endif /* GD32F10X_XD */ + RCU_WWDGT = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 11U), /*!< WWDGT clock */ + RCU_SPI1 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 14U), /*!< SPI1 clock */ + RCU_SPI2 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 15U), /*!< SPI2 clock */ + RCU_USART1 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 17U), /*!< USART1 clock */ + RCU_USART2 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 18U), /*!< USART2 clock */ + RCU_UART3 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 19U), /*!< UART3 clock */ + RCU_UART4 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 20U), /*!< UART4 clock */ + RCU_I2C0 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 21U), /*!< I2C0 clock */ + RCU_I2C1 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 22U), /*!< I2C1 clock */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + RCU_USBD = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 23U), /*!< USBD clock */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + RCU_CAN0 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 25U), /*!< CAN0 clock */ +#ifdef GD32F10X_CL + RCU_CAN1 = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 26U), /*!< CAN1 clock */ +#endif /* GD32F10X_CL */ + RCU_BKPI = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 27U), /*!< BKPI clock */ + RCU_PMU = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 28U), /*!< PMU clock */ + RCU_DAC = RCU_REGIDX_BIT(APB1EN_REG_OFFSET, 29U), /*!< DAC clock */ + RCU_RTC = RCU_REGIDX_BIT(BDCTL_REG_OFFSET, 15U), /*!< RTC clock */ + + /* APB2 peripherals */ + RCU_AF = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 0U), /*!< alternate function clock */ + RCU_GPIOA = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 2U), /*!< GPIOA clock */ + RCU_GPIOB = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 3U), /*!< GPIOB clock */ + RCU_GPIOC = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 4U), /*!< GPIOC clock */ + RCU_GPIOD = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 5U), /*!< GPIOD clock */ + RCU_GPIOE = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 6U), /*!< GPIOE clock */ + RCU_GPIOF = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 7U), /*!< GPIOF clock */ + RCU_GPIOG = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 8U), /*!< GPIOG clock */ + RCU_ADC0 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 9U), /*!< ADC0 clock */ + RCU_ADC1 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 10U), /*!< ADC1 clock */ + RCU_TIMER0 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 11U), /*!< TIMER0 clock */ + RCU_SPI0 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 12U), /*!< SPI0 clock */ + RCU_TIMER7 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 13U), /*!< TIMER7 clock */ + RCU_USART0 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 14U), /*!< USART0 clock */ +#ifndef GD32F10X_CL + RCU_ADC2 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 15U), /*!< ADC2 clock */ +#endif /* GD32F10X_CL */ +#ifdef GD32F10X_XD + RCU_TIMER8 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 19U), /*!< TIMER8 clock */ + RCU_TIMER9 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 20U), /*!< TIMER9 clock */ + RCU_TIMER10 = RCU_REGIDX_BIT(APB2EN_REG_OFFSET, 21U), /*!< TIMER10 clock */ +#endif /* GD32F10X_XD */ +}rcu_periph_enum; + +/* peripheral clock enable when sleep mode*/ +typedef enum +{ + /* AHB peripherals */ + RCU_SRAM_SLP = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 2U), /*!< SRAM clock */ + RCU_FMC_SLP = RCU_REGIDX_BIT(AHBEN_REG_OFFSET, 4U), /*!< FMC clock */ +}rcu_periph_sleep_enum; + +/* peripherals reset */ +typedef enum +{ + /* AHB peripherals */ +#ifdef GD32F10X_CL + RCU_USBFSRST = RCU_REGIDX_BIT(AHBRST_REG_OFFSET, 12U), /*!< USBFS clock reset */ + RCU_ENETRST = RCU_REGIDX_BIT(AHBRST_REG_OFFSET, 14U), /*!< ENET clock reset */ +#endif /* GD32F10X_CL */ + + /* APB1 peripherals */ + RCU_TIMER1RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 0U), /*!< TIMER1 clock reset */ + RCU_TIMER2RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 1U), /*!< TIMER2 clock reset */ + RCU_TIMER3RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 2U), /*!< TIMER3 clock reset */ + RCU_TIMER4RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 3U), /*!< TIMER4 clock reset */ + RCU_TIMER5RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 4U), /*!< TIMER5 clock reset */ + RCU_TIMER6RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 5U), /*!< TIMER6 clock reset */ +#ifdef GD32F10X_XD + RCU_TIMER11RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 6U), /*!< TIMER11 clock reset */ + RCU_TIMER12RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 7U), /*!< TIMER12 clock reset */ + RCU_TIMER13RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 8U), /*!< TIMER13 clock reset */ +#endif /* GD32F10X_XD */ + RCU_WWDGTRST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 11U), /*!< WWDGT clock reset */ + RCU_SPI1RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 14U), /*!< SPI1 clock reset */ + RCU_SPI2RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 15U), /*!< SPI2 clock reset */ + RCU_USART1RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 17U), /*!< USART1 clock reset */ + RCU_USART2RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 18U), /*!< USART2 clock reset */ + RCU_UART3RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 19U), /*!< UART3 clock reset */ + RCU_UART4RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 20U), /*!< UART4 clock reset */ + RCU_I2C0RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 21U), /*!< I2C0 clock reset */ + RCU_I2C1RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 22U), /*!< I2C1 clock reset */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + RCU_USBDRST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 23U), /*!< USBD clock reset */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + RCU_CAN0RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 25U), /*!< CAN0 clock reset */ +#ifdef GD32F10X_CL + RCU_CAN1RST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 26U), /*!< CAN1 clock reset */ +#endif /* GD32F10X_CL */ + RCU_BKPIRST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 27U), /*!< BKPI clock reset */ + RCU_PMURST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 28U), /*!< PMU clock reset */ + RCU_DACRST = RCU_REGIDX_BIT(APB1RST_REG_OFFSET, 29U), /*!< DAC clock reset */ + + /* APB2 peripherals */ + RCU_AFRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 0U), /*!< alternate function clock reset */ + RCU_GPIOARST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 2U), /*!< GPIOA clock reset */ + RCU_GPIOBRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 3U), /*!< GPIOB clock reset */ + RCU_GPIOCRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 4U), /*!< GPIOC clock reset */ + RCU_GPIODRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 5U), /*!< GPIOD clock reset */ + RCU_GPIOERST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 6U), /*!< GPIOE clock reset */ + RCU_GPIOFRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 7U), /*!< GPIOF clock reset */ + RCU_GPIOGRST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 8U), /*!< GPIOG clock reset */ + RCU_ADC0RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 9U), /*!< ADC0 clock reset */ + RCU_ADC1RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 10U), /*!< ADC1 clock reset */ + RCU_TIMER0RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 11U), /*!< TIMER0 clock reset */ + RCU_SPI0RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 12U), /*!< SPI0 clock reset */ + RCU_TIMER7RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 13U), /*!< TIMER7 clock reset */ + RCU_USART0RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 14U), /*!< USART0 clock reset */ +#ifndef GD32F10X_CL + RCU_ADC2RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 15U), /*!< ADC2 clock reset */ +#endif /* GD32F10X_CL */ +#ifdef GD32F10X_XD + RCU_TIMER8RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 19U), /*!< TIMER8 clock reset */ + RCU_TIMER9RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 20U), /*!< TIMER9 clock reset */ + RCU_TIMER10RST = RCU_REGIDX_BIT(APB2RST_REG_OFFSET, 21U), /*!< TIMER10 clock reset */ +#endif /* GD32F10X_XD */ +}rcu_periph_reset_enum; + +/* clock stabilization and peripheral reset flags */ +typedef enum +{ + /* clock stabilization flags */ + RCU_FLAG_IRC8MSTB = RCU_REGIDX_BIT(CTL_REG_OFFSET, 1U), /*!< IRC8M stabilization flags */ + RCU_FLAG_HXTALSTB = RCU_REGIDX_BIT(CTL_REG_OFFSET, 17U), /*!< HXTAL stabilization flags */ + RCU_FLAG_PLLSTB = RCU_REGIDX_BIT(CTL_REG_OFFSET, 25U), /*!< PLL stabilization flags */ +#ifdef GD32F10X_CL + RCU_FLAG_PLL1STB = RCU_REGIDX_BIT(CTL_REG_OFFSET, 27U), /*!< PLL1 stabilization flags */ + RCU_FLAG_PLL2STB = RCU_REGIDX_BIT(CTL_REG_OFFSET, 29U), /*!< PLL2 stabilization flags */ +#endif /* GD32F10X_CL */ + RCU_FLAG_LXTALSTB = RCU_REGIDX_BIT(BDCTL_REG_OFFSET, 1U), /*!< LXTAL stabilization flags */ + RCU_FLAG_IRC40KSTB = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 1U), /*!< IRC40K stabilization flags */ + /* reset source flags */ + RCU_FLAG_EPRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 26U), /*!< external PIN reset flags */ + RCU_FLAG_PORRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 27U), /*!< power reset flags */ + RCU_FLAG_SWRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 28U), /*!< software reset flags */ + RCU_FLAG_FWDGTRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 29U), /*!< FWDGT reset flags */ + RCU_FLAG_WWDGTRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 30U), /*!< WWDGT reset flags */ + RCU_FLAG_LPRST = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 31U), /*!< low-power reset flags */ +}rcu_flag_enum; + +/* clock stabilization and ckm interrupt flags */ +typedef enum +{ + RCU_INT_FLAG_IRC40KSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 0U), /*!< IRC40K stabilization interrupt flag */ + RCU_INT_FLAG_LXTALSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 1U), /*!< LXTAL stabilization interrupt flag */ + RCU_INT_FLAG_IRC8MSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 2U), /*!< IRC8M stabilization interrupt flag */ + RCU_INT_FLAG_HXTALSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 3U), /*!< HXTAL stabilization interrupt flag */ + RCU_INT_FLAG_PLLSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 4U), /*!< PLL stabilization interrupt flag */ +#ifdef GD32F10X_CL + RCU_INT_FLAG_PLL1STB = RCU_REGIDX_BIT(INT_REG_OFFSET, 5U), /*!< PLL1 stabilization interrupt flag */ + RCU_INT_FLAG_PLL2STB = RCU_REGIDX_BIT(INT_REG_OFFSET, 6U), /*!< PLL2 stabilization interrupt flag */ +#endif /* GD32F10X_CL */ + RCU_INT_FLAG_CKM = RCU_REGIDX_BIT(INT_REG_OFFSET, 7U), /*!< HXTAL clock stuck interrupt flag */ +}rcu_int_flag_enum; + +/* clock stabilization and stuck interrupt flags clear */ +typedef enum +{ + RCU_INT_FLAG_IRC40KSTB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 16U), /*!< IRC40K stabilization interrupt flags clear */ + RCU_INT_FLAG_LXTALSTB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 17U), /*!< LXTAL stabilization interrupt flags clear */ + RCU_INT_FLAG_IRC8MSTB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 18U), /*!< IRC8M stabilization interrupt flags clear */ + RCU_INT_FLAG_HXTALSTB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 19U), /*!< HXTAL stabilization interrupt flags clear */ + RCU_INT_FLAG_PLLSTB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 20U), /*!< PLL stabilization interrupt flags clear */ +#ifdef GD32F10X_CL + RCU_INT_FLAG_PLL1STB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 21U), /*!< PLL1 stabilization interrupt flags clear */ + RCU_INT_FLAG_PLL2STB_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 22U), /*!< PLL2 stabilization interrupt flags clear */ +#endif /* GD32F10X_CL */ + RCU_INT_FLAG_CKM_CLR = RCU_REGIDX_BIT(INT_REG_OFFSET, 23U), /*!< CKM interrupt flags clear */ +}rcu_int_flag_clear_enum; + +/* clock stabilization interrupt enable or disable */ +typedef enum +{ + RCU_INT_IRC40KSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 8U), /*!< IRC40K stabilization interrupt */ + RCU_INT_LXTALSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 9U), /*!< LXTAL stabilization interrupt */ + RCU_INT_IRC8MSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 10U), /*!< IRC8M stabilization interrupt */ + RCU_INT_HXTALSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 11U), /*!< HXTAL stabilization interrupt */ + RCU_INT_PLLSTB = RCU_REGIDX_BIT(INT_REG_OFFSET, 12U), /*!< PLL stabilization interrupt */ +#ifdef GD32F10X_CL + RCU_INT_PLL1STB = RCU_REGIDX_BIT(INT_REG_OFFSET, 13U), /*!< PLL1 stabilization interrupt */ + RCU_INT_PLL2STB = RCU_REGIDX_BIT(INT_REG_OFFSET, 14U), /*!< PLL2 stabilization interrupt */ +#endif /* GD32F10X_CL */ +}rcu_int_enum; + +/* oscillator types */ +typedef enum +{ + RCU_HXTAL = RCU_REGIDX_BIT(CTL_REG_OFFSET, 16U), /*!< HXTAL */ + RCU_LXTAL = RCU_REGIDX_BIT(BDCTL_REG_OFFSET, 0U), /*!< LXTAL */ + RCU_IRC8M = RCU_REGIDX_BIT(CTL_REG_OFFSET, 0U), /*!< IRC8M */ + RCU_IRC40K = RCU_REGIDX_BIT(RSTSCK_REG_OFFSET, 0U), /*!< IRC40K */ + RCU_PLL_CK = RCU_REGIDX_BIT(CTL_REG_OFFSET, 24U), /*!< PLL */ +#ifdef GD32F10X_CL + RCU_PLL1_CK = RCU_REGIDX_BIT(CTL_REG_OFFSET, 26U), /*!< PLL1 */ + RCU_PLL2_CK = RCU_REGIDX_BIT(CTL_REG_OFFSET, 28U), /*!< PLL2 */ +#endif /* GD32F10X_CL */ +}rcu_osci_type_enum; + +/* rcu clock frequency */ +typedef enum +{ + CK_SYS = 0, /*!< system clock */ + CK_AHB, /*!< AHB clock */ + CK_APB1, /*!< APB1 clock */ + CK_APB2, /*!< APB2 clock */ +}rcu_clock_freq_enum; + +/* RCU_CFG0 register bit define */ +/* system clock source select */ +#define CFG0_SCS(regval) (BITS(0,1) & ((uint32_t)(regval) << 0)) +#define RCU_CKSYSSRC_IRC8M CFG0_SCS(0) /*!< system clock source select IRC8M */ +#define RCU_CKSYSSRC_HXTAL CFG0_SCS(1) /*!< system clock source select HXTAL */ +#define RCU_CKSYSSRC_PLL CFG0_SCS(2) /*!< system clock source select PLL */ + +/* system clock source select status */ +#define CFG0_SCSS(regval) (BITS(2,3) & ((uint32_t)(regval) << 2)) +#define RCU_SCSS_IRC8M CFG0_SCSS(0) /*!< system clock source select IRC8M */ +#define RCU_SCSS_HXTAL CFG0_SCSS(1) /*!< system clock source select HXTAL */ +#define RCU_SCSS_PLL CFG0_SCSS(2) /*!< system clock source select PLLP */ + +/* AHB prescaler selection */ +#define CFG0_AHBPSC(regval) (BITS(4,7) & ((uint32_t)(regval) << 4)) +#define RCU_AHB_CKSYS_DIV1 CFG0_AHBPSC(0) /*!< AHB prescaler select CK_SYS */ +#define RCU_AHB_CKSYS_DIV2 CFG0_AHBPSC(8) /*!< AHB prescaler select CK_SYS/2 */ +#define RCU_AHB_CKSYS_DIV4 CFG0_AHBPSC(9) /*!< AHB prescaler select CK_SYS/4 */ +#define RCU_AHB_CKSYS_DIV8 CFG0_AHBPSC(10) /*!< AHB prescaler select CK_SYS/8 */ +#define RCU_AHB_CKSYS_DIV16 CFG0_AHBPSC(11) /*!< AHB prescaler select CK_SYS/16 */ +#define RCU_AHB_CKSYS_DIV64 CFG0_AHBPSC(12) /*!< AHB prescaler select CK_SYS/64 */ +#define RCU_AHB_CKSYS_DIV128 CFG0_AHBPSC(13) /*!< AHB prescaler select CK_SYS/128 */ +#define RCU_AHB_CKSYS_DIV256 CFG0_AHBPSC(14) /*!< AHB prescaler select CK_SYS/256 */ +#define RCU_AHB_CKSYS_DIV512 CFG0_AHBPSC(15) /*!< AHB prescaler select CK_SYS/512 */ + +/* APB1 prescaler selection */ +#define CFG0_APB1PSC(regval) (BITS(8,10) & ((uint32_t)(regval) << 8)) +#define RCU_APB1_CKAHB_DIV1 CFG0_APB1PSC(0) /*!< APB1 prescaler select CK_AHB */ +#define RCU_APB1_CKAHB_DIV2 CFG0_APB1PSC(4) /*!< APB1 prescaler select CK_AHB/2 */ +#define RCU_APB1_CKAHB_DIV4 CFG0_APB1PSC(5) /*!< APB1 prescaler select CK_AHB/4 */ +#define RCU_APB1_CKAHB_DIV8 CFG0_APB1PSC(6) /*!< APB1 prescaler select CK_AHB/8 */ +#define RCU_APB1_CKAHB_DIV16 CFG0_APB1PSC(7) /*!< APB1 prescaler select CK_AHB/16 */ + +/* APB2 prescaler selection */ +#define CFG0_APB2PSC(regval) (BITS(11,13) & ((uint32_t)(regval) << 11)) +#define RCU_APB2_CKAHB_DIV1 CFG0_APB2PSC(0) /*!< APB2 prescaler select CK_AHB */ +#define RCU_APB2_CKAHB_DIV2 CFG0_APB2PSC(4) /*!< APB2 prescaler select CK_AHB/2 */ +#define RCU_APB2_CKAHB_DIV4 CFG0_APB2PSC(5) /*!< APB2 prescaler select CK_AHB/4 */ +#define RCU_APB2_CKAHB_DIV8 CFG0_APB2PSC(6) /*!< APB2 prescaler select CK_AHB/8 */ +#define RCU_APB2_CKAHB_DIV16 CFG0_APB2PSC(7) /*!< APB2 prescaler select CK_AHB/16 */ + +/* ADC prescaler select */ +#define RCU_CKADC_CKAPB2_DIV2 ((uint32_t)0x00000000U) /*!< ADC prescaler select CK_APB2/2 */ +#define RCU_CKADC_CKAPB2_DIV4 ((uint32_t)0x00000001U) /*!< ADC prescaler select CK_APB2/4 */ +#define RCU_CKADC_CKAPB2_DIV6 ((uint32_t)0x00000002U) /*!< ADC prescaler select CK_APB2/6 */ +#define RCU_CKADC_CKAPB2_DIV8 ((uint32_t)0x00000003U) /*!< ADC prescaler select CK_APB2/8 */ +#define RCU_CKADC_CKAPB2_DIV12 ((uint32_t)0x00000005U) /*!< ADC prescaler select CK_APB2/12 */ +#define RCU_CKADC_CKAPB2_DIV16 ((uint32_t)0x00000007U) /*!< ADC prescaler select CK_APB2/16 */ + +/* PLL clock source selection */ +#define RCU_PLLSRC_IRC8M_DIV2 ((uint32_t)0x00000000U) /*!< IRC8M/2 clock selected as source clock of PLL */ +#define RCU_PLLSRC_HXTAL RCU_CFG0_PLLSEL /*!< HXTAL clock selected as source clock of PLL */ + +/* PLL clock multiplication factor */ +#define PLLMF_4 RCU_CFG0_PLLMF_4 /* bit 4 of PLLMF */ + +#define CFG0_PLLMF(regval) (BITS(18,21) & ((uint32_t)(regval) << 18)) +#define RCU_PLL_MUL2 CFG0_PLLMF(0) /*!< PLL source clock multiply by 2 */ +#define RCU_PLL_MUL3 CFG0_PLLMF(1) /*!< PLL source clock multiply by 3 */ +#define RCU_PLL_MUL4 CFG0_PLLMF(2) /*!< PLL source clock multiply by 4 */ +#define RCU_PLL_MUL5 CFG0_PLLMF(3) /*!< PLL source clock multiply by 5 */ +#define RCU_PLL_MUL6 CFG0_PLLMF(4) /*!< PLL source clock multiply by 6 */ +#define RCU_PLL_MUL7 CFG0_PLLMF(5) /*!< PLL source clock multiply by 7 */ +#define RCU_PLL_MUL8 CFG0_PLLMF(6) /*!< PLL source clock multiply by 8 */ +#define RCU_PLL_MUL9 CFG0_PLLMF(7) /*!< PLL source clock multiply by 9 */ +#define RCU_PLL_MUL10 CFG0_PLLMF(8) /*!< PLL source clock multiply by 10 */ +#define RCU_PLL_MUL11 CFG0_PLLMF(9) /*!< PLL source clock multiply by 11 */ +#define RCU_PLL_MUL12 CFG0_PLLMF(10) /*!< PLL source clock multiply by 12 */ +#define RCU_PLL_MUL13 CFG0_PLLMF(11) /*!< PLL source clock multiply by 13 */ +#define RCU_PLL_MUL14 CFG0_PLLMF(12) /*!< PLL source clock multiply by 14 */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +#define RCU_PLL_MUL15 CFG0_PLLMF(13) /*!< PLL source clock multiply by 15 */ +#elif defined(GD32F10X_CL) +#define RCU_PLL_MUL6_5 CFG0_PLLMF(13) /*!< PLL source clock multiply by 6.5 */ +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ +#define RCU_PLL_MUL16 CFG0_PLLMF(14) /*!< PLL source clock multiply by 16 */ +#define RCU_PLL_MUL17 (PLLMF_4 | CFG0_PLLMF(0)) /*!< PLL source clock multiply by 17 */ +#define RCU_PLL_MUL18 (PLLMF_4 | CFG0_PLLMF(1)) /*!< PLL source clock multiply by 18 */ +#define RCU_PLL_MUL19 (PLLMF_4 | CFG0_PLLMF(2)) /*!< PLL source clock multiply by 19 */ +#define RCU_PLL_MUL20 (PLLMF_4 | CFG0_PLLMF(3)) /*!< PLL source clock multiply by 20 */ +#define RCU_PLL_MUL21 (PLLMF_4 | CFG0_PLLMF(4)) /*!< PLL source clock multiply by 21 */ +#define RCU_PLL_MUL22 (PLLMF_4 | CFG0_PLLMF(5)) /*!< PLL source clock multiply by 22 */ +#define RCU_PLL_MUL23 (PLLMF_4 | CFG0_PLLMF(6)) /*!< PLL source clock multiply by 23 */ +#define RCU_PLL_MUL24 (PLLMF_4 | CFG0_PLLMF(7)) /*!< PLL source clock multiply by 24 */ +#define RCU_PLL_MUL25 (PLLMF_4 | CFG0_PLLMF(8)) /*!< PLL source clock multiply by 25 */ +#define RCU_PLL_MUL26 (PLLMF_4 | CFG0_PLLMF(9)) /*!< PLL source clock multiply by 26 */ +#define RCU_PLL_MUL27 (PLLMF_4 | CFG0_PLLMF(10)) /*!< PLL source clock multiply by 27 */ +#define RCU_PLL_MUL28 (PLLMF_4 | CFG0_PLLMF(11)) /*!< PLL source clock multiply by 28 */ +#define RCU_PLL_MUL29 (PLLMF_4 | CFG0_PLLMF(12)) /*!< PLL source clock multiply by 29 */ +#define RCU_PLL_MUL30 (PLLMF_4 | CFG0_PLLMF(13)) /*!< PLL source clock multiply by 30 */ +#define RCU_PLL_MUL31 (PLLMF_4 | CFG0_PLLMF(14)) /*!< PLL source clock multiply by 31 */ +#define RCU_PLL_MUL32 (PLLMF_4 | CFG0_PLLMF(15)) /*!< PLL source clock multiply by 32 */ + +/* USBD/USBFS prescaler select */ +#define CFG0_USBPSC(regval) (BITS(22,23) & ((uint32_t)(regval) << 22)) +#define RCU_CKUSB_CKPLL_DIV1_5 CFG0_USBPSC(0) /*!< USBD/USBFS prescaler select CK_PLL/1.5 */ +#define RCU_CKUSB_CKPLL_DIV1 CFG0_USBPSC(1) /*!< USBD/USBFS prescaler select CK_PLL/1 */ +#define RCU_CKUSB_CKPLL_DIV2_5 CFG0_USBPSC(2) /*!< USBD/USBFS prescaler select CK_PLL/2.5 */ +#define RCU_CKUSB_CKPLL_DIV2 CFG0_USBPSC(3) /*!< USBD/USBFS prescaler select CK_PLL/2 */ + +/* CKOUT0 clock source selection */ +#define CFG0_CKOUT0SEL(regval) (BITS(24,27) & ((uint32_t)(regval) << 24)) +#define RCU_CKOUT0SRC_NONE CFG0_CKOUT0SEL(0) /*!< no clock selected */ +#define RCU_CKOUT0SRC_CKSYS CFG0_CKOUT0SEL(4) /*!< system clock selected */ +#define RCU_CKOUT0SRC_IRC8M CFG0_CKOUT0SEL(5) /*!< internal 8M RC oscillator clock selected */ +#define RCU_CKOUT0SRC_HXTAL CFG0_CKOUT0SEL(6) /*!< high speed crystal oscillator clock (HXTAL) selected */ +#define RCU_CKOUT0SRC_CKPLL_DIV2 CFG0_CKOUT0SEL(7) /*!< CK_PLL/2 clock selected */ +#ifdef GD32F10X_CL +#define RCU_CKOUT0SRC_CKPLL1 CFG0_CKOUT0SEL(8) /*!< CK_PLL1 clock selected */ +#define RCU_CKOUT0SRC_CKPLL2_DIV2 CFG0_CKOUT0SEL(9) /*!< CK_PLL2/2 clock selected */ +#define RCU_CKOUT0SRC_EXT1 CFG0_CKOUT0SEL(10) /*!< EXT1 selected, to provide the external clock for ENET */ +#define RCU_CKOUT0SRC_CKPLL2 CFG0_CKOUT0SEL(11) /*!< CK_PLL2 clock selected */ +#endif /* GD32F10X_CL */ + +/* RTC clock entry selection */ +#define BDCTL_RTCSRC(regval) (BITS(8,9) & ((uint32_t)(regval) << 8)) +#define RCU_RTCSRC_NONE BDCTL_RTCSRC(0) /*!< no clock selected */ +#define RCU_RTCSRC_LXTAL BDCTL_RTCSRC(1) /*!< RTC source clock select LXTAL */ +#define RCU_RTCSRC_IRC40K BDCTL_RTCSRC(2) /*!< RTC source clock select IRC40K */ +#define RCU_RTCSRC_HXTAL_DIV_128 BDCTL_RTCSRC(3) /*!< RTC source clock select HXTAL/128 */ + +/* PREDV0 division factor */ +#define CFG1_PREDV0(regval) (BITS(0,3) & ((uint32_t)(regval) << 0)) +#define RCU_PREDV0_DIV1 CFG1_PREDV0(0) /*!< PREDV0 input source clock not divided */ +#define RCU_PREDV0_DIV2 CFG1_PREDV0(1) /*!< PREDV0 input source clock divided by 2 */ +#define RCU_PREDV0_DIV3 CFG1_PREDV0(2) /*!< PREDV0 input source clock divided by 3 */ +#define RCU_PREDV0_DIV4 CFG1_PREDV0(3) /*!< PREDV0 input source clock divided by 4 */ +#define RCU_PREDV0_DIV5 CFG1_PREDV0(4) /*!< PREDV0 input source clock divided by 5 */ +#define RCU_PREDV0_DIV6 CFG1_PREDV0(5) /*!< PREDV0 input source clock divided by 6 */ +#define RCU_PREDV0_DIV7 CFG1_PREDV0(6) /*!< PREDV0 input source clock divided by 7 */ +#define RCU_PREDV0_DIV8 CFG1_PREDV0(7) /*!< PREDV0 input source clock divided by 8 */ +#define RCU_PREDV0_DIV9 CFG1_PREDV0(8) /*!< PREDV0 input source clock divided by 9 */ +#define RCU_PREDV0_DIV10 CFG1_PREDV0(9) /*!< PREDV0 input source clock divided by 10 */ +#define RCU_PREDV0_DIV11 CFG1_PREDV0(10) /*!< PREDV0 input source clock divided by 11 */ +#define RCU_PREDV0_DIV12 CFG1_PREDV0(11) /*!< PREDV0 input source clock divided by 12 */ +#define RCU_PREDV0_DIV13 CFG1_PREDV0(12) /*!< PREDV0 input source clock divided by 13 */ +#define RCU_PREDV0_DIV14 CFG1_PREDV0(13) /*!< PREDV0 input source clock divided by 14 */ +#define RCU_PREDV0_DIV15 CFG1_PREDV0(14) /*!< PREDV0 input source clock divided by 15 */ +#define RCU_PREDV0_DIV16 CFG1_PREDV0(15) /*!< PREDV0 input source clock divided by 16 */ + +/* PREDV1 division factor */ +#define CFG1_PREDV1(regval) (BITS(4,7) & ((uint32_t)(regval) << 4)) +#define RCU_PREDV1_DIV1 CFG1_PREDV1(0) /*!< PREDV1 input source clock not divided */ +#define RCU_PREDV1_DIV2 CFG1_PREDV1(1) /*!< PREDV1 input source clock divided by 2 */ +#define RCU_PREDV1_DIV3 CFG1_PREDV1(2) /*!< PREDV1 input source clock divided by 3 */ +#define RCU_PREDV1_DIV4 CFG1_PREDV1(3) /*!< PREDV1 input source clock divided by 4 */ +#define RCU_PREDV1_DIV5 CFG1_PREDV1(4) /*!< PREDV1 input source clock divided by 5 */ +#define RCU_PREDV1_DIV6 CFG1_PREDV1(5) /*!< PREDV1 input source clock divided by 6 */ +#define RCU_PREDV1_DIV7 CFG1_PREDV1(6) /*!< PREDV1 input source clock divided by 7 */ +#define RCU_PREDV1_DIV8 CFG1_PREDV1(7) /*!< PREDV1 input source clock divided by 8 */ +#define RCU_PREDV1_DIV9 CFG1_PREDV1(8) /*!< PREDV1 input source clock divided by 9 */ +#define RCU_PREDV1_DIV10 CFG1_PREDV1(9) /*!< PREDV1 input source clock divided by 10 */ +#define RCU_PREDV1_DIV11 CFG1_PREDV1(10) /*!< PREDV1 input source clock divided by 11 */ +#define RCU_PREDV1_DIV12 CFG1_PREDV1(11) /*!< PREDV1 input source clock divided by 12 */ +#define RCU_PREDV1_DIV13 CFG1_PREDV1(12) /*!< PREDV1 input source clock divided by 13 */ +#define RCU_PREDV1_DIV14 CFG1_PREDV1(13) /*!< PREDV1 input source clock divided by 14 */ +#define RCU_PREDV1_DIV15 CFG1_PREDV1(14) /*!< PREDV1 input source clock divided by 15 */ +#define RCU_PREDV1_DIV16 CFG1_PREDV1(15) /*!< PREDV1 input source clock divided by 16 */ + +/* PLL1 clock multiplication factor */ +#define CFG1_PLL1MF(regval) (BITS(8,11) & ((uint32_t)(regval) << 8)) +#define RCU_PLL1_MUL8 CFG1_PLL1MF(6) /*!< PLL1 source clock multiply by 8 */ +#define RCU_PLL1_MUL9 CFG1_PLL1MF(7) /*!< PLL1 source clock multiply by 9 */ +#define RCU_PLL1_MUL10 CFG1_PLL1MF(8) /*!< PLL1 source clock multiply by 10 */ +#define RCU_PLL1_MUL11 CFG1_PLL1MF(9) /*!< PLL1 source clock multiply by 11 */ +#define RCU_PLL1_MUL12 CFG1_PLL1MF(10) /*!< PLL1 source clock multiply by 12 */ +#define RCU_PLL1_MUL13 CFG1_PLL1MF(11) /*!< PLL1 source clock multiply by 13 */ +#define RCU_PLL1_MUL14 CFG1_PLL1MF(12) /*!< PLL1 source clock multiply by 14 */ +#define RCU_PLL1_MUL15 CFG1_PLL1MF(13) /*!< PLL1 source clock multiply by 15 */ +#define RCU_PLL1_MUL16 CFG1_PLL1MF(14) /*!< PLL1 source clock multiply by 16 */ +#define RCU_PLL1_MUL20 CFG1_PLL1MF(15) /*!< PLL1 source clock multiply by 20 */ + +/* PLL2 clock multiplication factor */ +#define CFG1_PLL2MF(regval) (BITS(12,15) & ((uint32_t)(regval) << 12)) +#define RCU_PLL2_MUL8 CFG1_PLL2MF(6) /*!< PLL2 source clock multiply by 8 */ +#define RCU_PLL2_MUL9 CFG1_PLL2MF(7) /*!< PLL2 source clock multiply by 9 */ +#define RCU_PLL2_MUL10 CFG1_PLL2MF(8) /*!< PLL2 source clock multiply by 10 */ +#define RCU_PLL2_MUL11 CFG1_PLL2MF(9) /*!< PLL2 source clock multiply by 11 */ +#define RCU_PLL2_MUL12 CFG1_PLL2MF(10) /*!< PLL2 source clock multiply by 12 */ +#define RCU_PLL2_MUL13 CFG1_PLL2MF(11) /*!< PLL2 source clock multiply by 13 */ +#define RCU_PLL2_MUL14 CFG1_PLL2MF(12) /*!< PLL2 source clock multiply by 14 */ +#define RCU_PLL2_MUL15 CFG1_PLL2MF(13) /*!< PLL2 source clock multiply by 15 */ +#define RCU_PLL2_MUL16 CFG1_PLL2MF(14) /*!< PLL2 source clock multiply by 16 */ +#define RCU_PLL2_MUL20 CFG1_PLL2MF(15) /*!< PLL2 source clock multiply by 20 */ + +#ifdef GD32F10X_CL +/* PREDV0 input clock source selection */ +#define RCU_PREDV0SRC_HXTAL ((uint32_t)0x00000000U) /*!< HXTAL selected as PREDV0 input source clock */ +#define RCU_PREDV0SRC_CKPLL1 RCU_CFG1_PREDV0SEL /*!< CK_PLL1 selected as PREDV0 input source clock */ + +/* I2S1 clock source selection */ +#define RCU_I2S1SRC_CKSYS ((uint32_t)0x00000000U) /*!< system clock selected as I2S1 source clock */ +#define RCU_I2S1SRC_CKPLL2_MUL2 RCU_CFG1_I2S1SEL /*!< (CK_PLL2 x 2) selected as I2S1 source clock */ + +/* I2S2 clock source selection */ +#define RCU_I2S2SRC_CKSYS ((uint32_t)0x00000000U) /*!< system clock selected as I2S2 source clock */ +#define RCU_I2S2SRC_CKPLL2_MUL2 RCU_CFG1_I2S2SEL /*!< (CK_PLL2 x 2) selected as I2S2 source clock */ +#endif /* GD32F10X_CL */ + +/* deep-sleep mode voltage */ +#define DSV_DSLPVS(regval) (BITS(0,2) & ((uint32_t)(regval) << 0)) +#define RCU_DEEPSLEEP_V_1_2 DSV_DSLPVS(0) /*!< core voltage is 1.2V in deep-sleep mode */ +#define RCU_DEEPSLEEP_V_1_1 DSV_DSLPVS(1) /*!< core voltage is 1.1V in deep-sleep mode */ +#define RCU_DEEPSLEEP_V_1_0 DSV_DSLPVS(2) /*!< core voltage is 1.0V in deep-sleep mode */ +#define RCU_DEEPSLEEP_V_0_9 DSV_DSLPVS(3) /*!< core voltage is 0.9V in deep-sleep mode */ + +/* function declarations */ +/* initialization, peripheral clock enable/disable functions */ +/* deinitialize the RCU */ +void rcu_deinit(void); +/* enable the peripherals clock */ +void rcu_periph_clock_enable(rcu_periph_enum periph); +/* disable the peripherals clock */ +void rcu_periph_clock_disable(rcu_periph_enum periph); +/* enable the peripherals clock when sleep mode */ +void rcu_periph_clock_sleep_enable(rcu_periph_sleep_enum periph); +/* disable the peripherals clock when sleep mode */ +void rcu_periph_clock_sleep_disable(rcu_periph_sleep_enum periph); +/* reset the peripherals */ +void rcu_periph_reset_enable(rcu_periph_reset_enum periph_reset); +/* disable reset the peripheral */ +void rcu_periph_reset_disable(rcu_periph_reset_enum periph_reset); +/* reset the BKP domain */ +void rcu_bkp_reset_enable(void); +/* disable the BKP domain reset */ +void rcu_bkp_reset_disable(void); + +/* clock configuration functions */ +/* configure the system clock source */ +void rcu_system_clock_source_config(uint32_t ck_sys); +/* get the system clock source */ +uint32_t rcu_system_clock_source_get(void); +/* configure the AHB prescaler selection */ +void rcu_ahb_clock_config(uint32_t ck_ahb); +/* configure the APB1 prescaler selection */ +void rcu_apb1_clock_config(uint32_t ck_apb1); +/* configure the APB2 prescaler selection */ +void rcu_apb2_clock_config(uint32_t ck_apb2); +/* configure the CK_OUT0 clock source and divider */ +void rcu_ckout0_config(uint32_t ckout0_src); +/* configure the PLL clock source selection and PLL multiply factor */ +void rcu_pll_config(uint32_t pll_src, uint32_t pll_mul); +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +/* configure the PREDV0 division factor and clock source */ +void rcu_predv0_config(uint32_t predv0_div); +#elif defined(GD32F10X_CL) +/* configure the PREDV0 division factor and clock source */ +void rcu_predv0_config(uint32_t predv0_source, uint32_t predv0_div); +/* configure the PREDV1 division factor */ +void rcu_predv1_config(uint32_t predv1_div); +/* configure the PLL1 clock */ +void rcu_pll1_config(uint32_t pll_mul); +/* configure the PLL2 clock */ +void rcu_pll2_config(uint32_t pll_mul); +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/* peripheral clock configuration functions */ +/* configure the ADC division factor */ +void rcu_adc_clock_config(uint32_t adc_psc); +/* configure the USBD/USBFS prescaler factor */ +void rcu_usb_clock_config(uint32_t usb_psc); +/* configure the RTC clock source selection */ +void rcu_rtc_clock_config(uint32_t rtc_clock_source); +#ifdef GD32F10X_CL +/* configure the I2S1 clock source selection */ +void rcu_i2s1_clock_config(uint32_t i2s_clock_source); +/* configure the I2S2 clock source selection */ +void rcu_i2s2_clock_config(uint32_t i2s_clock_source); +#endif /* GD32F10X_CL */ + +/* oscillator configuration functions */ +/* wait for oscillator stabilization flags is SET or oscillator startup is timeout */ +ErrStatus rcu_osci_stab_wait(rcu_osci_type_enum osci); +/* turn on the oscillator */ +void rcu_osci_on(rcu_osci_type_enum osci); +/* turn off the oscillator */ +void rcu_osci_off(rcu_osci_type_enum osci); +/* enable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it */ +void rcu_osci_bypass_mode_enable(rcu_osci_type_enum osci); +/* disable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it */ +void rcu_osci_bypass_mode_disable(rcu_osci_type_enum osci); +/* enable the HXTAL clock monitor */ +void rcu_hxtal_clock_monitor_enable(void); +/* disable the HXTAL clock monitor */ +void rcu_hxtal_clock_monitor_disable(void); + +/* set the IRC8M adjust value */ +void rcu_irc8m_adjust_value_set(uint8_t irc8m_adjval); +/* set the deep sleep mode voltage */ +void rcu_deepsleep_voltage_set(uint32_t dsvol); +/* get the system clock, bus and peripheral clock frequency */ +uint32_t rcu_clock_freq_get(rcu_clock_freq_enum clock); + +/* interrupt & flag functions */ +/* get the clock stabilization and periphral reset flags */ +FlagStatus rcu_flag_get(rcu_flag_enum flag); +/* clear the reset flag */ +void rcu_all_reset_flag_clear(void); +/* get the clock stabilization interrupt and ckm flags */ +FlagStatus rcu_interrupt_flag_get(rcu_int_flag_enum int_flag); +/* clear the interrupt flags */ +void rcu_interrupt_flag_clear(rcu_int_flag_clear_enum int_flag_clear); +/* enable the stabilization interrupt */ +void rcu_interrupt_enable(rcu_int_enum stab_int); +/* disable the stabilization interrupt */ +void rcu_interrupt_disable(rcu_int_enum stab_int); + +#endif /* GD32F10X_RCU_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rtc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rtc.h new file mode 100644 index 0000000..08ce561 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_rtc.h @@ -0,0 +1,148 @@ +/*! + \file gd32f10x_rtc.h + \brief definitions for the RTC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_RTC_H +#define GD32F10X_RTC_H + +#include "gd32f10x.h" + +/* RTC definitions */ +#define RTC RTC_BASE + +/* registers definitions */ +#define RTC_INTEN REG32(RTC + 0x00U) /*!< interrupt enable register */ +#define RTC_CTL REG32(RTC + 0x04U) /*!< control register */ +#define RTC_PSCH REG32(RTC + 0x08U) /*!< prescaler high register */ +#define RTC_PSCL REG32(RTC + 0x0CU) /*!< prescaler low register */ +#define RTC_DIVH REG32(RTC + 0x10U) /*!< divider high register */ +#define RTC_DIVL REG32(RTC + 0x14U) /*!< divider low register */ +#define RTC_CNTH REG32(RTC + 0x18U) /*!< counter high register */ +#define RTC_CNTL REG32(RTC + 0x1CU) /*!< counter low register */ +#define RTC_ALRMH REG32(RTC + 0x20U) /*!< alarm high register */ +#define RTC_ALRML REG32(RTC + 0x24U) /*!< alarm low register */ + +/* bits definitions */ +/* RTC_INTEN */ +#define RTC_INTEN_SCIE BIT(0) /*!< second interrupt enable */ +#define RTC_INTEN_ALRMIE BIT(1) /*!< alarm interrupt enable */ +#define RTC_INTEN_OVIE BIT(2) /*!< overflow interrupt enable */ + +/* RTC_CTL */ +#define RTC_CTL_SCIF BIT(0) /*!< second interrupt flag */ +#define RTC_CTL_ALRMIF BIT(1) /*!< alarm interrupt flag */ +#define RTC_CTL_OVIF BIT(2) /*!< overflow interrupt flag */ +#define RTC_CTL_RSYNF BIT(3) /*!< registers synchronized flag */ +#define RTC_CTL_CMF BIT(4) /*!< configuration mode flag */ +#define RTC_CTL_LWOFF BIT(5) /*!< last write operation finished flag */ + +/* RTC_PSCH */ +#define RTC_PSCH_PSC BITS(0,3) /*!< prescaler high value */ + +/* RTC_PSCL */ +#define RTC_PSCL_PSC BITS(0,15) /*!< prescaler low value */ + +/* RTC_DIVH */ +#define RTC_DIVH_DIV BITS(0,3) /*!< divider high value */ + +/* RTC_DIVL */ +#define RTC_DIVL_DIV BITS(0,15) /*!< divider low value */ + +/* RTC_CNTH */ +#define RTC_CNTH_CNT BITS(0,15) /*!< counter high value */ + +/* RTC_CNTL */ +#define RTC_CNTL_CNT BITS(0,15) /*!< counter low value */ + +/* RTC_ALRMH */ +#define RTC_ALRMH_ALRM BITS(0,15) /*!< alarm high value */ + +/* RTC_ALRML */ +#define RTC_ALRML_ALRM BITS(0,15) /*!< alarm low value */ + +/* constants definitions */ +/* RTC interrupt enable or disable definitions */ +#define RTC_INT_SECOND RTC_INTEN_SCIE /*!< second interrupt enable */ +#define RTC_INT_ALARM RTC_INTEN_ALRMIE /*!< alarm interrupt enable */ +#define RTC_INT_OVERFLOW RTC_INTEN_OVIE /*!< overflow interrupt enable */ + +/* RTC interrupt flag definitions */ +#define RTC_INT_FLAG_SECOND RTC_CTL_SCIF /*!< second interrupt flag */ +#define RTC_INT_FLAG_ALARM RTC_CTL_ALRMIF /*!< alarm interrupt flag */ +#define RTC_INT_FLAG_OVERFLOW RTC_CTL_OVIF /*!< overflow interrupt flag */ + +/* RTC flag definitions */ +#define RTC_FLAG_SECOND RTC_CTL_SCIF /*!< second interrupt flag */ +#define RTC_FLAG_ALARM RTC_CTL_ALRMIF /*!< alarm interrupt flag */ +#define RTC_FLAG_OVERFLOW RTC_CTL_OVIF /*!< overflow interrupt flag */ +#define RTC_FLAG_RSYN RTC_CTL_RSYNF /*!< registers synchronized flag */ +#define RTC_FLAG_LWOF RTC_CTL_LWOFF /*!< last write operation finished flag */ + +/* function declarations */ +/* initialization functions */ +/* enter RTC configuration mode */ +void rtc_configuration_mode_enter(void); +/* exit RTC configuration mode */ +void rtc_configuration_mode_exit(void); +/* set RTC counter value */ +void rtc_counter_set(uint32_t cnt); +/* set RTC prescaler value */ +void rtc_prescaler_set(uint32_t psc); + +/* operation functions */ +/* wait RTC last write operation finished flag set */ +void rtc_lwoff_wait(void); +/* wait RTC registers synchronized flag set */ +void rtc_register_sync_wait(void); +/* set RTC alarm value */ +void rtc_alarm_config(uint32_t alarm); +/* get RTC counter value */ +uint32_t rtc_counter_get(void); +/* get RTC divider value */ +uint32_t rtc_divider_get(void); + +/* flag & interrupt functions */ +/* get RTC flag status */ +FlagStatus rtc_flag_get(uint32_t flag); +/* clear RTC flag status */ +void rtc_flag_clear(uint32_t flag); +/* get RTC interrupt flag status */ +FlagStatus rtc_interrupt_flag_get(uint32_t flag); +/* clear RTC interrupt flag status */ +void rtc_interrupt_flag_clear(uint32_t flag); +/* enable RTC interrupt */ +void rtc_interrupt_enable(uint32_t interrupt); +/* disable RTC interrupt */ +void rtc_interrupt_disable(uint32_t interrupt); + +#endif /* GD32F10X_RTC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_sdio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_sdio.h new file mode 100644 index 0000000..4ba9e25 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_sdio.h @@ -0,0 +1,430 @@ +/*! + \file gd32f10x_sdio.h + \brief definitions for the SDIO + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_SDIO_H +#define GD32F10X_SDIO_H + +#include "gd32f10x.h" + +/* SDIO definitions */ +#define SDIO SDIO_BASE + +/* registers definitions */ +#define SDIO_PWRCTL REG32(SDIO + 0x00U) /*!< SDIO power control register */ +#define SDIO_CLKCTL REG32(SDIO + 0x04U) /*!< SDIO clock control register */ +#define SDIO_CMDAGMT REG32(SDIO + 0x08U) /*!< SDIO command argument register */ +#define SDIO_CMDCTL REG32(SDIO + 0x0CU) /*!< SDIO command control register */ +#define SDIO_RSPCMDIDX REG32(SDIO + 0x10U) /*!< SDIO command index response register */ +#define SDIO_RESP0 REG32(SDIO + 0x14U) /*!< SDIO response register 0 */ +#define SDIO_RESP1 REG32(SDIO + 0x18U) /*!< SDIO response register 1 */ +#define SDIO_RESP2 REG32(SDIO + 0x1CU) /*!< SDIO response register 2 */ +#define SDIO_RESP3 REG32(SDIO + 0x20U) /*!< SDIO response register 3 */ +#define SDIO_DATATO REG32(SDIO + 0x24U) /*!< SDIO data timeout register */ +#define SDIO_DATALEN REG32(SDIO + 0x28U) /*!< SDIO data length register */ +#define SDIO_DATACTL REG32(SDIO + 0x2CU) /*!< SDIO data control register */ +#define SDIO_DATACNT REG32(SDIO + 0x30U) /*!< SDIO data counter register */ +#define SDIO_STAT REG32(SDIO + 0x34U) /*!< SDIO status register */ +#define SDIO_INTC REG32(SDIO + 0x38U) /*!< SDIO interrupt clear register */ +#define SDIO_INTEN REG32(SDIO + 0x3CU) /*!< SDIO interrupt enable register */ +#define SDIO_FIFOCNT REG32(SDIO + 0x48U) /*!< SDIO FIFO counter register */ +#define SDIO_FIFO REG32(SDIO + 0x80U) /*!< SDIO FIFO data register */ + +/* bits definitions */ +/* SDIO_PWRCTL */ +#define SDIO_PWRCTL_PWRCTL BITS(0,1) /*!< SDIO power control bits */ + +/* SDIO_CLKCTL */ +#define SDIO_CLKCTL_DIV BITS(0,7) /*!< clock division */ +#define SDIO_CLKCTL_CLKEN BIT(8) /*!< SDIO_CLK clock output enable bit */ +#define SDIO_CLKCTL_CLKPWRSAV BIT(9) /*!< SDIO_CLK clock dynamic switch on/off for power saving */ +#define SDIO_CLKCTL_CLKBYP BIT(10) /*!< clock bypass enable bit */ +#define SDIO_CLKCTL_BUSMODE BITS(11,12) /*!< SDIO card bus mode control bit */ +#define SDIO_CLKCTL_CLKEDGE BIT(13) /*!< SDIO_CLK clock edge selection bit */ +#define SDIO_CLKCTL_HWCLKEN BIT(14) /*!< hardware clock control enable bit */ + +/* SDIO_CMDAGMT */ +#define SDIO_CMDAGMT_CMDAGMT BITS(0,31) /*!< SDIO card command argument */ + +/* SDIO_CMDCTL */ +#define SDIO_CMDCTL_CMDIDX BITS(0,5) /*!< command index */ +#define SDIO_CMDCTL_CMDRESP BITS(6,7) /*!< command response type bits */ +#define SDIO_CMDCTL_INTWAIT BIT(8) /*!< interrupt wait instead of timeout */ +#define SDIO_CMDCTL_WAITDEND BIT(9) /*!< wait for ends of data transfer */ +#define SDIO_CMDCTL_CSMEN BIT(10) /*!< command state machine(CSM) enable bit */ +#define SDIO_CMDCTL_SUSPEND BIT(11) /*!< SD I/O suspend command(SD I/O only) */ +#define SDIO_CMDCTL_ENCMDC BIT(12) /*!< CMD completion signal enabled (CE-ATA only) */ +#define SDIO_CMDCTL_NINTEN BIT(13) /*!< no CE-ATA interrupt (CE-ATA only) */ +#define SDIO_CMDCTL_ATAEN BIT(14) /*!< CE-ATA command enable(CE-ATA only) */ + +/* SDIO_DATATO */ +#define SDIO_DATATO_DATATO BITS(0,31) /*!< data timeout period */ + +/* SDIO_DATALEN */ +#define SDIO_DATALEN_DATALEN BITS(0,24) /*!< data transfer length */ + +/* SDIO_DATACTL */ +#define SDIO_DATACTL_DATAEN BIT(0) /*!< data transfer enabled bit */ +#define SDIO_DATACTL_DATADIR BIT(1) /*!< data transfer direction */ +#define SDIO_DATACTL_TRANSMOD BIT(2) /*!< data transfer mode */ +#define SDIO_DATACTL_DMAEN BIT(3) /*!< DMA enable bit */ +#define SDIO_DATACTL_BLKSZ BITS(4,7) /*!< data block size */ +#define SDIO_DATACTL_RWEN BIT(8) /*!< read wait mode enabled(SD I/O only) */ +#define SDIO_DATACTL_RWSTOP BIT(9) /*!< read wait stop(SD I/O only) */ +#define SDIO_DATACTL_RWTYPE BIT(10) /*!< read wait type(SD I/O only) */ +#define SDIO_DATACTL_IOEN BIT(11) /*!< SD I/O specific function enable(SD I/O only) */ + +/* SDIO_STAT */ +#define SDIO_STAT_CCRCERR BIT(0) /*!< command response received (CRC check failed) */ +#define SDIO_STAT_DTCRCERR BIT(1) /*!< data block sent/received (CRC check failed) */ +#define SDIO_STAT_CMDTMOUT BIT(2) /*!< command response timeout */ +#define SDIO_STAT_DTTMOUT BIT(3) /*!< data timeout */ +#define SDIO_STAT_TXURE BIT(4) /*!< transmit FIFO underrun error occurs */ +#define SDIO_STAT_RXORE BIT(5) /*!< received FIFO overrun error occurs */ +#define SDIO_STAT_CMDRECV BIT(6) /*!< command response received (CRC check passed) */ +#define SDIO_STAT_CMDSEND BIT(7) /*!< command sent (no response required) */ +#define SDIO_STAT_DTEND BIT(8) /*!< data end (data counter, SDIO_DATACNT, is zero) */ +#define SDIO_STAT_STBITE BIT(9) /*!< start bit error in the bus */ +#define SDIO_STAT_DTBLKEND BIT(10) /*!< data block sent/received (CRC check passed) */ +#define SDIO_STAT_CMDRUN BIT(11) /*!< command transmission in progress */ +#define SDIO_STAT_TXRUN BIT(12) /*!< data transmission in progress */ +#define SDIO_STAT_RXRUN BIT(13) /*!< data reception in progress */ +#define SDIO_STAT_TFH BIT(14) /*!< transmit FIFO is half empty: at least 8 words can be written into the FIFO */ +#define SDIO_STAT_RFH BIT(15) /*!< receive FIFO is half full: at least 8 words can be read in the FIFO */ +#define SDIO_STAT_TFF BIT(16) /*!< transmit FIFO is full */ +#define SDIO_STAT_RFF BIT(17) /*!< receive FIFO is full */ +#define SDIO_STAT_TFE BIT(18) /*!< transmit FIFO is empty */ +#define SDIO_STAT_RFE BIT(19) /*!< receive FIFO is empty */ +#define SDIO_STAT_TXDTVAL BIT(20) /*!< data is valid in transmit FIFO */ +#define SDIO_STAT_RXDTVAL BIT(21) /*!< data is valid in receive FIFO */ +#define SDIO_STAT_SDIOINT BIT(22) /*!< SD I/O interrupt received */ +#define SDIO_STAT_ATAEND BIT(23) /*!< CE-ATA command completion signal received (only for CMD61) */ + +/* SDIO_INTC */ +#define SDIO_INTC_CCRCERRC BIT(0) /*!< CCRCERR flag clear bit */ +#define SDIO_INTC_DTCRCERRC BIT(1) /*!< DTCRCERR flag clear bit */ +#define SDIO_INTC_CMDTMOUTC BIT(2) /*!< CMDTMOUT flag clear bit */ +#define SDIO_INTC_DTTMOUTC BIT(3) /*!< DTTMOUT flag clear bit */ +#define SDIO_INTC_TXUREC BIT(4) /*!< TXURE flag clear bit */ +#define SDIO_INTC_RXOREC BIT(5) /*!< RXORE flag clear bit */ +#define SDIO_INTC_CMDRECVC BIT(6) /*!< CMDRECV flag clear bit */ +#define SDIO_INTC_CMDSENDC BIT(7) /*!< CMDSEND flag clear bit */ +#define SDIO_INTC_DTENDC BIT(8) /*!< DTEND flag clear bit */ +#define SDIO_INTC_STBITEC BIT(9) /*!< STBITE flag clear bit */ +#define SDIO_INTC_DTBLKENDC BIT(10) /*!< DTBLKEND flag clear bit */ +#define SDIO_INTC_SDIOINTC BIT(22) /*!< SDIOINT flag clear bit */ +#define SDIO_INTC_ATAENDC BIT(23) /*!< ATAEND flag clear bit */ + +/* SDIO_INTEN */ +#define SDIO_INTEN_CCRCERRIE BIT(0) /*!< command response CRC fail interrupt enable */ +#define SDIO_INTEN_DTCRCERRIE BIT(1) /*!< data CRC fail interrupt enable */ +#define SDIO_INTEN_CMDTMOUTIE BIT(2) /*!< command response timeout interrupt enable */ +#define SDIO_INTEN_DTTMOUTIE BIT(3) /*!< data timeout interrupt enable */ +#define SDIO_INTEN_TXUREIE BIT(4) /*!< transmit FIFO underrun error interrupt enable */ +#define SDIO_INTEN_RXOREIE BIT(5) /*!< received FIFO overrun error interrupt enable */ +#define SDIO_INTEN_CMDRECVIE BIT(6) /*!< command response received interrupt enable */ +#define SDIO_INTEN_CMDSENDIE BIT(7) /*!< command sent interrupt enable */ +#define SDIO_INTEN_DTENDIE BIT(8) /*!< data end interrupt enable */ +#define SDIO_INTEN_STBITEIE BIT(9) /*!< start bit error interrupt enable */ +#define SDIO_INTEN_DTBLKENDIE BIT(10) /*!< data block end interrupt enable */ +#define SDIO_INTEN_CMDRUNIE BIT(11) /*!< command transmission interrupt enable */ +#define SDIO_INTEN_TXRUNIE BIT(12) /*!< data transmission interrupt enable */ +#define SDIO_INTEN_RXRUNIE BIT(13) /*!< data reception interrupt enable */ +#define SDIO_INTEN_TFHIE BIT(14) /*!< transmit FIFO half empty interrupt enable */ +#define SDIO_INTEN_RFHIE BIT(15) /*!< receive FIFO half full interrupt enable */ +#define SDIO_INTEN_TFFIE BIT(16) /*!< transmit FIFO full interrupt enable */ +#define SDIO_INTEN_RFFIE BIT(17) /*!< receive FIFO full interrupt enable */ +#define SDIO_INTEN_TFEIE BIT(18) /*!< transmit FIFO empty interrupt enable */ +#define SDIO_INTEN_RFEIE BIT(19) /*!< receive FIFO empty interrupt enable */ +#define SDIO_INTEN_TXDTVALIE BIT(20) /*!< data valid in transmit FIFO interrupt enable */ +#define SDIO_INTEN_RXDTVALIE BIT(21) /*!< data valid in receive FIFO interrupt enable */ +#define SDIO_INTEN_SDIOINTIE BIT(22) /*!< SD I/O interrupt received interrupt enable */ +#define SDIO_INTEN_ATAENDIE BIT(23) /*!< CE-ATA command completion signal received interrupt enable */ + +/* SDIO_FIFO */ +#define SDIO_FIFO_FIFODT BITS(0,31) /*!< receive FIFO data or transmit FIFO data */ + +/* constants definitions */ +/* SDIO flags */ +#define SDIO_FLAG_CCRCERR BIT(0) /*!< command response received (CRC check failed) flag */ +#define SDIO_FLAG_DTCRCERR BIT(1) /*!< data block sent/received (CRC check failed) flag */ +#define SDIO_FLAG_CMDTMOUT BIT(2) /*!< command response timeout flag */ +#define SDIO_FLAG_DTTMOUT BIT(3) /*!< data timeout flag */ +#define SDIO_FLAG_TXURE BIT(4) /*!< transmit FIFO underrun error occurs flag */ +#define SDIO_FLAG_RXORE BIT(5) /*!< received FIFO overrun error occurs flag */ +#define SDIO_FLAG_CMDRECV BIT(6) /*!< command response received (CRC check passed) flag */ +#define SDIO_FLAG_CMDSEND BIT(7) /*!< command sent (no response required) flag */ +#define SDIO_FLAG_DTEND BIT(8) /*!< data end (data counter, SDIO_DATACNT, is zero) flag */ +#define SDIO_FLAG_STBITE BIT(9) /*!< start bit error in the bus flag */ +#define SDIO_FLAG_DTBLKEND BIT(10) /*!< data block sent/received (CRC check passed) flag */ +#define SDIO_FLAG_CMDRUN BIT(11) /*!< command transmission in progress flag */ +#define SDIO_FLAG_TXRUN BIT(12) /*!< data transmission in progress flag */ +#define SDIO_FLAG_RXRUN BIT(13) /*!< data reception in progress flag */ +#define SDIO_FLAG_TFH BIT(14) /*!< transmit FIFO is half empty flag: at least 8 words can be written into the FIFO */ +#define SDIO_FLAG_RFH BIT(15) /*!< receive FIFO is half full flag: at least 8 words can be read in the FIFO */ +#define SDIO_FLAG_TFF BIT(16) /*!< transmit FIFO is full flag */ +#define SDIO_FLAG_RFF BIT(17) /*!< receive FIFO is full flag */ +#define SDIO_FLAG_TFE BIT(18) /*!< transmit FIFO is empty flag */ +#define SDIO_FLAG_RFE BIT(19) /*!< receive FIFO is empty flag */ +#define SDIO_FLAG_TXDTVAL BIT(20) /*!< data is valid in transmit FIFO flag */ +#define SDIO_FLAG_RXDTVAL BIT(21) /*!< data is valid in receive FIFO flag */ +#define SDIO_FLAG_SDIOINT BIT(22) /*!< SD I/O interrupt received flag */ +#define SDIO_FLAG_ATAEND BIT(23) /*!< CE-ATA command completion signal received (only for CMD61) flag */ + +/* SDIO interrupt enable or disable */ +#define SDIO_INT_CCRCERR BIT(0) /*!< SDIO CCRCERR interrupt */ +#define SDIO_INT_DTCRCERR BIT(1) /*!< SDIO DTCRCERR interrupt */ +#define SDIO_INT_CMDTMOUT BIT(2) /*!< SDIO CMDTMOUT interrupt */ +#define SDIO_INT_DTTMOUT BIT(3) /*!< SDIO DTTMOUT interrupt */ +#define SDIO_INT_TXURE BIT(4) /*!< SDIO TXURE interrupt */ +#define SDIO_INT_RXORE BIT(5) /*!< SDIO RXORE interrupt */ +#define SDIO_INT_CMDRECV BIT(6) /*!< SDIO CMDRECV interrupt */ +#define SDIO_INT_CMDSEND BIT(7) /*!< SDIO CMDSEND interrupt */ +#define SDIO_INT_DTEND BIT(8) /*!< SDIO DTEND interrupt */ +#define SDIO_INT_STBITE BIT(9) /*!< SDIO STBITE interrupt */ +#define SDIO_INT_DTBLKEND BIT(10) /*!< SDIO DTBLKEND interrupt */ +#define SDIO_INT_CMDRUN BIT(11) /*!< SDIO CMDRUN interrupt */ +#define SDIO_INT_TXRUN BIT(12) /*!< SDIO TXRUN interrupt */ +#define SDIO_INT_RXRUN BIT(13) /*!< SDIO RXRUN interrupt */ +#define SDIO_INT_TFH BIT(14) /*!< SDIO TFH interrupt */ +#define SDIO_INT_RFH BIT(15) /*!< SDIO RFH interrupt */ +#define SDIO_INT_TFF BIT(16) /*!< SDIO TFF interrupt */ +#define SDIO_INT_RFF BIT(17) /*!< SDIO RFF interrupt */ +#define SDIO_INT_TFE BIT(18) /*!< SDIO TFE interrupt */ +#define SDIO_INT_RFE BIT(19) /*!< SDIO RFE interrupt */ +#define SDIO_INT_TXDTVAL BIT(20) /*!< SDIO TXDTVAL interrupt */ +#define SDIO_INT_RXDTVAL BIT(21) /*!< SDIO RXDTVAL interrupt */ +#define SDIO_INT_SDIOINT BIT(22) /*!< SDIO SDIOINT interrupt */ +#define SDIO_INT_ATAEND BIT(23) /*!< SDIO ATAEND interrupt */ + +/* SDIO interrupt flags */ +#define SDIO_INT_FLAG_CCRCERR BIT(0) /*!< SDIO CCRCERR interrupt flag */ +#define SDIO_INT_FLAG_DTCRCERR BIT(1) /*!< SDIO DTCRCERR interrupt flag */ +#define SDIO_INT_FLAG_CMDTMOUT BIT(2) /*!< SDIO CMDTMOUT interrupt flag */ +#define SDIO_INT_FLAG_DTTMOUT BIT(3) /*!< SDIO DTTMOUT interrupt flag */ +#define SDIO_INT_FLAG_TXURE BIT(4) /*!< SDIO TXURE interrupt flag */ +#define SDIO_INT_FLAG_RXORE BIT(5) /*!< SDIO RXORE interrupt flag */ +#define SDIO_INT_FLAG_CMDRECV BIT(6) /*!< SDIO CMDRECV interrupt flag */ +#define SDIO_INT_FLAG_CMDSEND BIT(7) /*!< SDIO CMDSEND interrupt flag */ +#define SDIO_INT_FLAG_DTEND BIT(8) /*!< SDIO DTEND interrupt flag */ +#define SDIO_INT_FLAG_STBITE BIT(9) /*!< SDIO STBITE interrupt flag */ +#define SDIO_INT_FLAG_DTBLKEND BIT(10) /*!< SDIO DTBLKEND interrupt flag */ +#define SDIO_INT_FLAG_CMDRUN BIT(11) /*!< SDIO CMDRUN interrupt flag */ +#define SDIO_INT_FLAG_TXRUN BIT(12) /*!< SDIO TXRUN interrupt flag */ +#define SDIO_INT_FLAG_RXRUN BIT(13) /*!< SDIO RXRUN interrupt flag */ +#define SDIO_INT_FLAG_TFH BIT(14) /*!< SDIO TFH interrupt flag */ +#define SDIO_INT_FLAG_RFH BIT(15) /*!< SDIO RFH interrupt flag */ +#define SDIO_INT_FLAG_TFF BIT(16) /*!< SDIO TFF interrupt flag */ +#define SDIO_INT_FLAG_RFF BIT(17) /*!< SDIO RFF interrupt flag */ +#define SDIO_INT_FLAG_TFE BIT(18) /*!< SDIO TFE interrupt flag */ +#define SDIO_INT_FLAG_RFE BIT(19) /*!< SDIO RFE interrupt flag */ +#define SDIO_INT_FLAG_TXDTVAL BIT(20) /*!< SDIO TXDTVAL interrupt flag */ +#define SDIO_INT_FLAG_RXDTVAL BIT(21) /*!< SDIO RXDTVAL interrupt flag */ +#define SDIO_INT_FLAG_SDIOINT BIT(22) /*!< SDIO SDIOINT interrupt flag */ +#define SDIO_INT_FLAG_ATAEND BIT(23) /*!< SDIO ATAEND interrupt flag */ + +/* SDIO power control */ +#define PWRCTL_PWRCTL(regval) (BITS(0,1) & ((uint32_t)(regval) << 0)) +#define SDIO_POWER_OFF PWRCTL_PWRCTL(0) /*!< SDIO power off */ +#define SDIO_POWER_ON PWRCTL_PWRCTL(3) /*!< SDIO power on */ + +/* SDIO card bus mode control */ +#define CLKCTL_BUSMODE(regval) (BITS(11,12) & ((uint32_t)(regval) << 11)) +#define SDIO_BUSMODE_1BIT CLKCTL_BUSMODE(0) /*!< 1-bit SDIO card bus mode */ +#define SDIO_BUSMODE_4BIT CLKCTL_BUSMODE(1) /*!< 4-bit SDIO card bus mode */ +#define SDIO_BUSMODE_8BIT CLKCTL_BUSMODE(2) /*!< 8-bit SDIO card bus mode */ + +/* SDIO_CLK clock edge selection */ +#define SDIO_SDIOCLKEDGE_RISING ((uint32_t)0x00000000U)/*!< select the rising edge of the SDIOCLK to generate SDIO_CLK */ +#define SDIO_SDIOCLKEDGE_FALLING SDIO_CLKCTL_CLKEDGE /*!< select the falling edge of the SDIOCLK to generate SDIO_CLK */ + +/* clock bypass enable or disable */ +#define SDIO_CLOCKBYPASS_DISABLE ((uint32_t)0x00000000U)/*!< no bypass */ +#define SDIO_CLOCKBYPASS_ENABLE SDIO_CLKCTL_CLKBYP /*!< clock bypass */ + +/* SDIO_CLK clock dynamic switch on/off for power saving */ +#define SDIO_CLOCKPWRSAVE_DISABLE ((uint32_t)0x00000000U)/*!< SDIO_CLK clock is always on */ +#define SDIO_CLOCKPWRSAVE_ENABLE SDIO_CLKCTL_CLKPWRSAV /*!< SDIO_CLK closed when bus is idle */ + +/* SDIO command response type */ +#define CMDCTL_CMDRESP(regval) (BITS(6,7) & ((uint32_t)(regval) << 6)) +#define SDIO_RESPONSETYPE_NO CMDCTL_CMDRESP(0) /*!< no response */ +#define SDIO_RESPONSETYPE_SHORT CMDCTL_CMDRESP(1) /*!< short response */ +#define SDIO_RESPONSETYPE_LONG CMDCTL_CMDRESP(3) /*!< long response */ + +/* command state machine wait type */ +#define SDIO_WAITTYPE_NO ((uint32_t)0x00000000U)/*!< not wait interrupt */ +#define SDIO_WAITTYPE_INTERRUPT SDIO_CMDCTL_INTWAIT /*!< wait interrupt */ +#define SDIO_WAITTYPE_DATAEND SDIO_CMDCTL_WAITDEND /*!< wait the end of data transfer */ + +#define SDIO_RESPONSE0 ((uint32_t)0x00000000U)/*!< card response[31:0]/card response[127:96] */ +#define SDIO_RESPONSE1 ((uint32_t)0x00000001U)/*!< card response[95:64] */ +#define SDIO_RESPONSE2 ((uint32_t)0x00000002U)/*!< card response[63:32] */ +#define SDIO_RESPONSE3 ((uint32_t)0x00000003U)/*!< card response[31:1], plus bit 0 */ + +/* SDIO data block size */ +#define DATACTL_BLKSZ(regval) (BITS(4,7) & ((uint32_t)(regval) << 4)) +#define SDIO_DATABLOCKSIZE_1BYTE DATACTL_BLKSZ(0) /*!< block size = 1 byte */ +#define SDIO_DATABLOCKSIZE_2BYTES DATACTL_BLKSZ(1) /*!< block size = 2 bytes */ +#define SDIO_DATABLOCKSIZE_4BYTES DATACTL_BLKSZ(2) /*!< block size = 4 bytes */ +#define SDIO_DATABLOCKSIZE_8BYTES DATACTL_BLKSZ(3) /*!< block size = 8 bytes */ +#define SDIO_DATABLOCKSIZE_16BYTES DATACTL_BLKSZ(4) /*!< block size = 16 bytes */ +#define SDIO_DATABLOCKSIZE_32BYTES DATACTL_BLKSZ(5) /*!< block size = 32 bytes */ +#define SDIO_DATABLOCKSIZE_64BYTES DATACTL_BLKSZ(6) /*!< block size = 64 bytes */ +#define SDIO_DATABLOCKSIZE_128BYTES DATACTL_BLKSZ(7) /*!< block size = 128 bytes */ +#define SDIO_DATABLOCKSIZE_256BYTES DATACTL_BLKSZ(8) /*!< block size = 256 bytes */ +#define SDIO_DATABLOCKSIZE_512BYTES DATACTL_BLKSZ(9) /*!< block size = 512 bytes */ +#define SDIO_DATABLOCKSIZE_1024BYTES DATACTL_BLKSZ(10) /*!< block size = 1024 bytes */ +#define SDIO_DATABLOCKSIZE_2048BYTES DATACTL_BLKSZ(11) /*!< block size = 2048 bytes */ +#define SDIO_DATABLOCKSIZE_4096BYTES DATACTL_BLKSZ(12) /*!< block size = 4096 bytes */ +#define SDIO_DATABLOCKSIZE_8192BYTES DATACTL_BLKSZ(13) /*!< block size = 8192 bytes */ +#define SDIO_DATABLOCKSIZE_16384BYTES DATACTL_BLKSZ(14) /*!< block size = 16384 bytes */ + +/* SDIO data transfer mode */ +#define SDIO_TRANSMODE_BLOCK ((uint32_t)0x00000000U)/*!< block transfer */ +#define SDIO_TRANSMODE_STREAM SDIO_DATACTL_TRANSMOD /*!< stream transfer or SDIO multibyte transfer */ + +/* SDIO data transfer direction */ +#define SDIO_TRANSDIRECTION_TOCARD ((uint32_t)0x00000000U)/*!< write data to card */ +#define SDIO_TRANSDIRECTION_TOSDIO SDIO_DATACTL_DATADIR /*!< read data from card */ + +/* SDIO read wait type */ +#define SDIO_READWAITTYPE_DAT2 ((uint32_t)0x00000000U)/*!< read wait control using SDIO_DAT[2] */ +#define SDIO_READWAITTYPE_CLK SDIO_DATACTL_RWTYPE /*!< read wait control by stopping SDIO_CLK */ + +/* function declarations */ +/* de/initialization functions, hardware clock, bus mode, power_state and SDIO clock configuration */ +/* deinitialize the SDIO */ +void sdio_deinit(void); +/* configure the SDIO clock */ +void sdio_clock_config(uint32_t clock_edge, uint32_t clock_bypass, uint32_t clock_powersave, uint16_t clock_division); +/* enable hardware clock control */ +void sdio_hardware_clock_enable(void); +/* disable hardware clock control */ +void sdio_hardware_clock_disable(void); +/* set different SDIO card bus mode */ +void sdio_bus_mode_set(uint32_t bus_mode); +/* set the SDIO power state */ +void sdio_power_state_set(uint32_t power_state); +/* get the SDIO power state */ +uint32_t sdio_power_state_get(void); +/* enable SDIO_CLK clock output */ +void sdio_clock_enable(void); +/* disable SDIO_CLK clock output */ +void sdio_clock_disable(void); + +/* configure the command index, argument, response type, wait type and CSM to send command functions */ +/* configure the command and response */ +void sdio_command_response_config(uint32_t cmd_index, uint32_t cmd_argument, uint32_t response_type); +/* set the command state machine wait type */ +void sdio_wait_type_set(uint32_t wait_type); +/* enable the CSM(command state machine) */ +void sdio_csm_enable(void); +/* disable the CSM(command state machine) */ +void sdio_csm_disable(void); +/* get the last response command index */ +uint8_t sdio_command_index_get(void); +/* get the response for the last received command */ +uint32_t sdio_response_get(uint32_t responsex); + +/* configure the data timeout, length, block size, transfer mode, direction and DSM for data transfer functions */ +/* configure the data timeout, data length and data block size */ +void sdio_data_config(uint32_t data_timeout, uint32_t data_length, uint32_t data_blocksize); +/* configure the data transfer mode and direction */ +void sdio_data_transfer_config(uint32_t transfer_mode, uint32_t transfer_direction); +/* enable the DSM(data state machine) for data transfer */ +void sdio_dsm_enable(void); +/* disable the DSM(data state machine) */ +void sdio_dsm_disable(void); +/* write data(one word) to the transmit FIFO */ +void sdio_data_write(uint32_t data); +/* read data(one word) from the receive FIFO */ +uint32_t sdio_data_read(void); +/* get the number of remaining data bytes to be transferred to card */ +uint32_t sdio_data_counter_get(void); +/* get the number of words remaining to be written or read from FIFO */ +uint32_t sdio_fifo_counter_get(void); +/* enable the DMA request for SDIO */ +void sdio_dma_enable(void); +/* disable the DMA request for SDIO */ +void sdio_dma_disable(void); + +/* flag and interrupt functions */ +/* get the flags state of SDIO */ +FlagStatus sdio_flag_get(uint32_t flag); +/* clear the pending flags of SDIO */ +void sdio_flag_clear(uint32_t flag); +/* enable the SDIO interrupt */ +void sdio_interrupt_enable(uint32_t int_flag); +/* disable the SDIO interrupt */ +void sdio_interrupt_disable(uint32_t int_flag); +/* get the interrupt flags state of SDIO */ +FlagStatus sdio_interrupt_flag_get(uint32_t int_flag); +/* clear the interrupt pending flags of SDIO */ +void sdio_interrupt_flag_clear(uint32_t int_flag); + +/* SD I/O card functions */ +/* enable the read wait mode(SD I/O only) */ +void sdio_readwait_enable(void); +/* disable the read wait mode(SD I/O only) */ +void sdio_readwait_disable(void); +/* enable the function that stop the read wait process(SD I/O only) */ +void sdio_stop_readwait_enable(void); +/* disable the function that stop the read wait process(SD I/O only) */ +void sdio_stop_readwait_disable(void); +/* set the read wait type(SD I/O only) */ +void sdio_readwait_type_set(uint32_t readwait_type); +/* enable the SD I/O mode specific operation(SD I/O only) */ +void sdio_operation_enable(void); +/* disable the SD I/O mode specific operation(SD I/O only) */ +void sdio_operation_disable(void); +/* enable the SD I/O suspend operation(SD I/O only) */ +void sdio_suspend_enable(void); +/* disable the SD I/O suspend operation(SD I/O only) */ +void sdio_suspend_disable(void); + +/* CE-ATA functions */ +/* enable the CE-ATA command(CE-ATA only) */ +void sdio_ceata_command_enable(void); +/* disable the CE-ATA command(CE-ATA only) */ +void sdio_ceata_command_disable(void); +/* enable the CE-ATA interrupt(CE-ATA only) */ +void sdio_ceata_interrupt_enable(void); +/* disable the CE-ATA interrupt(CE-ATA only) */ +void sdio_ceata_interrupt_disable(void); +/* enable the CE-ATA command completion signal(CE-ATA only) */ +void sdio_ceata_command_completion_enable(void); +/* disable the CE-ATA command completion signal(CE-ATA only) */ +void sdio_ceata_command_completion_disable(void); + +#endif /* GD32F10X_SDIO_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_spi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_spi.h new file mode 100644 index 0000000..e7a86bf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_spi.h @@ -0,0 +1,324 @@ +/*! + \file gd32f10x_spi.h + \brief definitions for the SPI + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_SPI_H +#define GD32F10X_SPI_H + +#include "gd32f10x.h" + +/* SPIx(x=0,1,2) definitions */ +#define SPI0 (SPI_BASE + 0x0000F800U) +#define SPI1 SPI_BASE +#define SPI2 (SPI_BASE + 0x00000400U) + +/* registers definitions */ +#define SPI_CTL0(spix) REG32((spix) + 0x00000000U) /*!< SPI control register 0 */ +#define SPI_CTL1(spix) REG32((spix) + 0x00000004U) /*!< SPI control register 1*/ +#define SPI_STAT(spix) REG32((spix) + 0x00000008U) /*!< SPI status register */ +#define SPI_DATA(spix) REG32((spix) + 0x0000000CU) /*!< SPI data register */ +#define SPI_CRCPOLY(spix) REG32((spix) + 0x00000010U) /*!< SPI CRC polynomial register */ +#define SPI_RCRC(spix) REG32((spix) + 0x00000014U) /*!< SPI receive CRC register */ +#define SPI_TCRC(spix) REG32((spix) + 0x00000018U) /*!< SPI transmit CRC register */ +#define SPI_I2SCTL(spix) REG32((spix) + 0x0000001CU) /*!< SPI I2S control register */ +#define SPI_I2SPSC(spix) REG32((spix) + 0x00000020U) /*!< SPI I2S clock prescaler register */ + +/* bits definitions */ +/* SPI_CTL0 */ +#define SPI_CTL0_CKPH BIT(0) /*!< clock phase selection*/ +#define SPI_CTL0_CKPL BIT(1) /*!< clock polarity selection */ +#define SPI_CTL0_MSTMOD BIT(2) /*!< master mode enable */ +#define SPI_CTL0_PSC BITS(3,5) /*!< master clock prescaler selection */ +#define SPI_CTL0_SPIEN BIT(6) /*!< SPI enable*/ +#define SPI_CTL0_LF BIT(7) /*!< LSB first mode */ +#define SPI_CTL0_SWNSS BIT(8) /*!< NSS pin selection in NSS software mode */ +#define SPI_CTL0_SWNSSEN BIT(9) /*!< NSS software mode selection */ +#define SPI_CTL0_RO BIT(10) /*!< receive only */ +#define SPI_CTL0_FF16 BIT(11) /*!< data frame size */ +#define SPI_CTL0_CRCNT BIT(12) /*!< CRC next transfer */ +#define SPI_CTL0_CRCEN BIT(13) /*!< CRC calculation enable */ +#define SPI_CTL0_BDOEN BIT(14) /*!< bidirectional transmit output enable*/ +#define SPI_CTL0_BDEN BIT(15) /*!< bidirectional enable */ + +/* SPI_CTL1 */ +#define SPI_CTL1_DMAREN BIT(0) /*!< receive buffer DMA enable */ +#define SPI_CTL1_DMATEN BIT(1) /*!< transmit buffer DMA enable */ +#define SPI_CTL1_NSSDRV BIT(2) /*!< drive NSS output */ +#define SPI_CTL1_ERRIE BIT(5) /*!< errors interrupt enable */ +#define SPI_CTL1_RBNEIE BIT(6) /*!< receive buffer not empty interrupt enable */ +#define SPI_CTL1_TBEIE BIT(7) /*!< transmit buffer empty interrupt enable */ + +/* SPI_STAT */ +#define SPI_STAT_RBNE BIT(0) /*!< receive buffer not empty */ +#define SPI_STAT_TBE BIT(1) /*!< transmit buffer empty */ +#define SPI_STAT_I2SCH BIT(2) /*!< I2S channel side */ +#define SPI_STAT_TXURERR BIT(3) /*!< I2S transmission underrun error bit */ +#define SPI_STAT_CRCERR BIT(4) /*!< SPI CRC error bit */ +#define SPI_STAT_CONFERR BIT(5) /*!< SPI configuration error bit */ +#define SPI_STAT_RXORERR BIT(6) /*!< SPI reception overrun error bit */ +#define SPI_STAT_TRANS BIT(7) /*!< transmitting on-going bit */ + +/* SPI_DATA */ +#define SPI_DATA_DATA BITS(0,15) /*!< data transfer register */ + +/* SPI_CRCPOLY */ +#define SPI_CRCPOLY_CRCPOLY BITS(0,15) /*!< CRC polynomial value */ + +/* SPI_RCRC */ +#define SPI_RCRC_RCRC BITS(0,15) /*!< RX CRC value */ + +/* SPI_TCRC */ +#define SPI_TCRC_TCRC BITS(0,15) /*!< TX CRC value */ + +/* SPI_I2SCTL */ +#define SPI_I2SCTL_CHLEN BIT(0) /*!< channel length */ +#define SPI_I2SCTL_DTLEN BITS(1,2) /*!< data length */ +#define SPI_I2SCTL_CKPL BIT(3) /*!< idle state clock polarity */ +#define SPI_I2SCTL_I2SSTD BITS(4,5) /*!< I2S standard selection */ +#define SPI_I2SCTL_PCMSMOD BIT(7) /*!< PCM frame synchronization mode */ +#define SPI_I2SCTL_I2SOPMOD BITS(8,9) /*!< I2S operation mode */ +#define SPI_I2SCTL_I2SEN BIT(10) /*!< I2S enable */ +#define SPI_I2SCTL_I2SSEL BIT(11) /*!< I2S mode selection */ + +/* SPI_I2SPSC */ +#define SPI_I2SPSC_DIV BITS(0,7) /*!< dividing factor for the prescaler */ +#define SPI_I2SPSC_OF BIT(8) /*!< odd factor for the prescaler */ +#define SPI_I2SPSC_MCKOEN BIT(9) /*!< I2S MCK output enable */ + +/* constants definitions */ +/* SPI and I2S parameter struct definitions */ +typedef struct { + uint32_t device_mode; /*!< SPI master or slave */ + uint32_t trans_mode; /*!< SPI transfer type */ + uint32_t frame_size; /*!< SPI frame size */ + uint32_t nss; /*!< SPI NSS control by handware or software */ + uint32_t endian; /*!< SPI big endian or little endian */ + uint32_t clock_polarity_phase; /*!< SPI clock phase and polarity */ + uint32_t prescale; /*!< SPI prescaler factor */ +} spi_parameter_struct; + +/* SPI mode definitions */ +#define SPI_MASTER (SPI_CTL0_MSTMOD | SPI_CTL0_SWNSS) /*!< SPI as master */ +#define SPI_SLAVE ((uint32_t)0x00000000U) /*!< SPI as slave */ + +/* SPI bidirectional transfer direction */ +#define SPI_BIDIRECTIONAL_TRANSMIT SPI_CTL0_BDOEN /*!< SPI work in transmit-only mode */ +#define SPI_BIDIRECTIONAL_RECEIVE (~SPI_CTL0_BDOEN) /*!< SPI work in receive-only mode */ + +/* SPI transmit type */ +#define SPI_TRANSMODE_FULLDUPLEX ((uint32_t)0x00000000U) /*!< SPI receive and send data at fullduplex communication */ +#define SPI_TRANSMODE_RECEIVEONLY SPI_CTL0_RO /*!< SPI only receive data */ +#define SPI_TRANSMODE_BDRECEIVE SPI_CTL0_BDEN /*!< bidirectional receive data */ +#define SPI_TRANSMODE_BDTRANSMIT (SPI_CTL0_BDEN | SPI_CTL0_BDOEN) /*!< bidirectional transmit data*/ + +/* SPI frame size */ +#define SPI_FRAMESIZE_16BIT SPI_CTL0_FF16 /*!< SPI frame size is 16 bits */ +#define SPI_FRAMESIZE_8BIT ((uint32_t)0x00000000U) /*!< SPI frame size is 8 bits */ + +/* SPI NSS control mode */ +#define SPI_NSS_SOFT SPI_CTL0_SWNSSEN /*!< SPI NSS control by sofrware */ +#define SPI_NSS_HARD ((uint32_t)0x00000000U) /*!< SPI NSS control by hardware */ + +/* SPI transmit way */ +#define SPI_ENDIAN_MSB ((uint32_t)0x00000000U) /*!< SPI transmit way is big endian: transmit MSB first */ +#define SPI_ENDIAN_LSB SPI_CTL0_LF /*!< SPI transmit way is little endian: transmit LSB first */ + +/* SPI clock phase and polarity */ +#define SPI_CK_PL_LOW_PH_1EDGE ((uint32_t)0x00000000U) /*!< SPI clock polarity is low level and phase is first edge */ +#define SPI_CK_PL_HIGH_PH_1EDGE SPI_CTL0_CKPL /*!< SPI clock polarity is high level and phase is first edge */ +#define SPI_CK_PL_LOW_PH_2EDGE SPI_CTL0_CKPH /*!< SPI clock polarity is low level and phase is second edge */ +#define SPI_CK_PL_HIGH_PH_2EDGE (SPI_CTL0_CKPL | SPI_CTL0_CKPH) /*!< SPI clock polarity is high level and phase is second edge */ + +/* SPI clock prescaler factor */ +#define CTL0_PSC(regval) (BITS(3,5) & ((uint32_t)(regval) << 3)) +#define SPI_PSC_2 CTL0_PSC(0) /*!< SPI clock prescaler factor is 2 */ +#define SPI_PSC_4 CTL0_PSC(1) /*!< SPI clock prescaler factor is 4 */ +#define SPI_PSC_8 CTL0_PSC(2) /*!< SPI clock prescaler factor is 8 */ +#define SPI_PSC_16 CTL0_PSC(3) /*!< SPI clock prescaler factor is 16 */ +#define SPI_PSC_32 CTL0_PSC(4) /*!< SPI clock prescaler factor is 32 */ +#define SPI_PSC_64 CTL0_PSC(5) /*!< SPI clock prescaler factor is 64 */ +#define SPI_PSC_128 CTL0_PSC(6) /*!< SPI clock prescaler factor is 128 */ +#define SPI_PSC_256 CTL0_PSC(7) /*!< SPI clock prescaler factor is 256 */ + +/* I2S audio sample rate */ +#define I2S_AUDIOSAMPLE_8K ((uint32_t)8000U) /*!< I2S audio sample rate is 8KHz */ +#define I2S_AUDIOSAMPLE_11K ((uint32_t)11025U) /*!< I2S audio sample rate is 11KHz */ +#define I2S_AUDIOSAMPLE_16K ((uint32_t)16000U) /*!< I2S audio sample rate is 16KHz */ +#define I2S_AUDIOSAMPLE_22K ((uint32_t)22050U) /*!< I2S audio sample rate is 22KHz */ +#define I2S_AUDIOSAMPLE_32K ((uint32_t)32000U) /*!< I2S audio sample rate is 32KHz */ +#define I2S_AUDIOSAMPLE_44K ((uint32_t)44100U) /*!< I2S audio sample rate is 44KHz */ +#define I2S_AUDIOSAMPLE_48K ((uint32_t)48000U) /*!< I2S audio sample rate is 48KHz */ +#define I2S_AUDIOSAMPLE_96K ((uint32_t)96000U) /*!< I2S audio sample rate is 96KHz */ +#define I2S_AUDIOSAMPLE_192K ((uint32_t)192000U) /*!< I2S audio sample rate is 192KHz */ + +/* I2S frame format */ +#define I2SCTL_DTLEN(regval) (BITS(1,2) & ((uint32_t)(regval) << 1)) +#define I2S_FRAMEFORMAT_DT16B_CH16B I2SCTL_DTLEN(0) /*!< I2S data length is 16 bit and channel length is 16 bit */ +#define I2S_FRAMEFORMAT_DT16B_CH32B (I2SCTL_DTLEN(0) | SPI_I2SCTL_CHLEN) /*!< I2S data length is 16 bit and channel length is 32 bit */ +#define I2S_FRAMEFORMAT_DT24B_CH32B (I2SCTL_DTLEN(1) | SPI_I2SCTL_CHLEN) /*!< I2S data length is 24 bit and channel length is 32 bit */ +#define I2S_FRAMEFORMAT_DT32B_CH32B (I2SCTL_DTLEN(2) | SPI_I2SCTL_CHLEN) /*!< I2S data length is 32 bit and channel length is 32 bit */ + +/* I2S master clock output */ +#define I2S_MCKOUT_DISABLE ((uint32_t)0x00000000U) /*!< I2S master clock output disable */ +#define I2S_MCKOUT_ENABLE SPI_I2SPSC_MCKOEN /*!< I2S master clock output enable */ + +/* I2S operation mode */ +#define I2SCTL_I2SOPMOD(regval) (BITS(8,9) & ((uint32_t)(regval) << 8)) +#define I2S_MODE_SLAVETX I2SCTL_I2SOPMOD(0) /*!< I2S slave transmit mode */ +#define I2S_MODE_SLAVERX I2SCTL_I2SOPMOD(1) /*!< I2S slave receive mode */ +#define I2S_MODE_MASTERTX I2SCTL_I2SOPMOD(2) /*!< I2S master transmit mode */ +#define I2S_MODE_MASTERRX I2SCTL_I2SOPMOD(3) /*!< I2S master receive mode */ + +/* I2S standard */ +#define I2SCTL_I2SSTD(regval) (BITS(4,5) & ((uint32_t)(regval) << 4)) +#define I2S_STD_PHILLIPS I2SCTL_I2SSTD(0) /*!< I2S phillips standard */ +#define I2S_STD_MSB I2SCTL_I2SSTD(1) /*!< I2S MSB standard */ +#define I2S_STD_LSB I2SCTL_I2SSTD(2) /*!< I2S LSB standard */ +#define I2S_STD_PCMSHORT I2SCTL_I2SSTD(3) /*!< I2S PCM short standard */ +#define I2S_STD_PCMLONG (I2SCTL_I2SSTD(3) | SPI_I2SCTL_PCMSMOD) /*!< I2S PCM long standard */ + +/* I2S clock polarity */ +#define I2S_CKPL_LOW ((uint32_t)0x00000000U) /*!< I2S clock polarity low level */ +#define I2S_CKPL_HIGH SPI_I2SCTL_CKPL /*!< I2S clock polarity high level */ + +/* SPI DMA constants definitions */ +#define SPI_DMA_TRANSMIT ((uint8_t)0x00U) /*!< SPI transmit data use DMA */ +#define SPI_DMA_RECEIVE ((uint8_t)0x01U) /*!< SPI receive data use DMA */ + +/* SPI CRC constants definitions */ +#define SPI_CRC_TX ((uint8_t)0x00U) /*!< SPI transmit CRC value */ +#define SPI_CRC_RX ((uint8_t)0x01U) /*!< SPI receive CRC value */ + +/* SPI/I2S interrupt enable/disable constants definitions */ +#define SPI_I2S_INT_TBE SPI_CTL1_TBEIE /*!< transmit buffer empty interrupt */ +#define SPI_I2S_INT_RBNE SPI_CTL1_RBNEIE /*!< receive buffer not empty interrupt */ +#define SPI_I2S_INT_ERR SPI_CTL1_ERRIE /*!< error interrupt */ + +/* SPI/I2S interrupt flag constants definitions */ +#define SPI_I2S_INT_FLAG_TBE ((uint8_t)0x00U) /*!< transmit buffer empty interrupt flag */ +#define SPI_I2S_INT_FLAG_RBNE ((uint8_t)0x01U) /*!< receive buffer not empty interrupt flag */ +#define SPI_I2S_INT_FLAG_RXORERR ((uint8_t)0x02U) /*!< overrun interrupt flag */ +#define SPI_INT_FLAG_CONFERR ((uint8_t)0x03U) /*!< config error interrupt flag */ +#define SPI_INT_FLAG_CRCERR ((uint8_t)0x04U) /*!< CRC error interrupt flag */ +#define I2S_INT_FLAG_TXURERR ((uint8_t)0x05U) /*!< underrun error interrupt flag */ + +/* SPI/I2S flag definitions */ +#define SPI_FLAG_RBNE SPI_STAT_RBNE /*!< receive buffer not empty flag */ +#define SPI_FLAG_TBE SPI_STAT_TBE /*!< transmit buffer empty flag */ +#define SPI_FLAG_CRCERR SPI_STAT_CRCERR /*!< CRC error flag */ +#define SPI_FLAG_CONFERR SPI_STAT_CONFERR /*!< mode config error flag */ +#define SPI_FLAG_RXORERR SPI_STAT_RXORERR /*!< receive overrun error flag */ +#define SPI_FLAG_TRANS SPI_STAT_TRANS /*!< transmit on-going flag */ +#define I2S_FLAG_RBNE SPI_STAT_RBNE /*!< receive buffer not empty flag */ +#define I2S_FLAG_TBE SPI_STAT_TBE /*!< transmit buffer empty flag */ +#define I2S_FLAG_CH SPI_STAT_I2SCH /*!< channel side flag */ +#define I2S_FLAG_TXURERR SPI_STAT_TXURERR /*!< underrun error flag */ +#define I2S_FLAG_RXORERR SPI_STAT_RXORERR /*!< overrun error flag */ +#define I2S_FLAG_TRANS SPI_STAT_TRANS /*!< transmit on-going flag */ + +/* function declarations */ +/* SPI deinitialization and initialization functions */ +/* reset SPI and I2S */ +void spi_i2s_deinit(uint32_t spi_periph); +/* initialize the parameters of SPI structure with the default values */ +void spi_struct_para_init(spi_parameter_struct *spi_struct); +/* initialize SPI parameters */ +void spi_init(uint32_t spi_periph, spi_parameter_struct *spi_struct); +/* enable SPI */ +void spi_enable(uint32_t spi_periph); +/* disable SPI */ +void spi_disable(uint32_t spi_periph); + +/* I2S initialization functions */ +/* initialize I2S parameters */ +void i2s_init(uint32_t spi_periph, uint32_t mode, uint32_t standard, uint32_t ckpl); +/* configure I2S prescaler */ +void i2s_psc_config(uint32_t spi_periph, uint32_t audiosample, uint32_t frameformat, uint32_t mckout); +/* enable I2S */ +void i2s_enable(uint32_t spi_periph); +/* disable I2S */ +void i2s_disable(uint32_t spi_periph); + +/* NSS functions */ +/* enable SPI NSS output */ +void spi_nss_output_enable(uint32_t spi_periph); +/* disable SPI NSS output */ +void spi_nss_output_disable(uint32_t spi_periph); +/* SPI NSS pin high level in software mode */ +void spi_nss_internal_high(uint32_t spi_periph); +/* SPI NSS pin low level in software mode */ +void spi_nss_internal_low(uint32_t spi_periph); + +/* DMA functions */ +/* enable SPI DMA send or receive */ +void spi_dma_enable(uint32_t spi_periph, uint8_t dma); +/* disable SPI DMA send or receive */ +void spi_dma_disable(uint32_t spi_periph, uint8_t dma); + +/* communication functions */ +/* configure SPI data frame format */ +void spi_i2s_data_frame_format_config(uint32_t spi_periph, uint16_t frame_format); +/* configure SPI bidirectional transfer direction */ +void spi_bidirectional_transfer_config(uint32_t spi_periph, uint32_t transfer_direction); +/* SPI transmit data */ +void spi_i2s_data_transmit(uint32_t spi_periph, uint16_t data); +/* SPI receive data */ +uint16_t spi_i2s_data_receive(uint32_t spi_periph); + +/* SPI CRC functions */ +/* set SPI CRC polynomial */ +void spi_crc_polynomial_set(uint32_t spi_periph, uint16_t crc_poly); +/* get SPI CRC polynomial */ +uint16_t spi_crc_polynomial_get(uint32_t spi_periph); +/* turn on SPI CRC function */ +void spi_crc_on(uint32_t spi_periph); +/* turn off SPI CRC function */ +void spi_crc_off(uint32_t spi_periph); +/* SPI next data is CRC value */ +void spi_crc_next(uint32_t spi_periph); +/* get SPI CRC send value or receive value */ +uint16_t spi_crc_get(uint32_t spi_periph, uint8_t crc); +/* clear SPI CRC error flag status */ +void spi_crc_error_clear(uint32_t spi_periph); + +/* flag and interrupt functions */ +/* get SPI and I2S flag status */ +FlagStatus spi_i2s_flag_get(uint32_t spi_periph, uint32_t flag); +/* enable SPI and I2S interrupt */ +void spi_i2s_interrupt_enable(uint32_t spi_periph, uint8_t interrupt); +/* disable SPI and I2S interrupt */ +void spi_i2s_interrupt_disable(uint32_t spi_periph, uint8_t interrupt); +/* get SPI and I2S interrupt status */ +FlagStatus spi_i2s_interrupt_flag_get(uint32_t spi_periph, uint8_t interrupt); + +#endif /* GD32F10X_SPI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_timer.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_timer.h new file mode 100644 index 0000000..561858b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_timer.h @@ -0,0 +1,725 @@ +/*! + \file gd32f10x_timer.h + \brief definitions for the TIMER + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_TIMER_H +#define GD32F10X_TIMER_H + +#include "gd32f10x.h" + +/* TIMERx(x=0..13) definitions */ +#define TIMER0 (TIMER_BASE + 0x00012C00U) +#define TIMER1 (TIMER_BASE + 0x00000000U) +#define TIMER2 (TIMER_BASE + 0x00000400U) +#define TIMER3 (TIMER_BASE + 0x00000800U) +#define TIMER4 (TIMER_BASE + 0x00000C00U) +#define TIMER5 (TIMER_BASE + 0x00001000U) +#define TIMER6 (TIMER_BASE + 0x00001400U) +#define TIMER7 (TIMER_BASE + 0x00013400U) +#define TIMER8 (TIMER_BASE + 0x00014C00U) +#define TIMER9 (TIMER_BASE + 0x00015000U) +#define TIMER10 (TIMER_BASE + 0x00015400U) +#define TIMER11 (TIMER_BASE + 0x00001800U) +#define TIMER12 (TIMER_BASE + 0x00001C00U) +#define TIMER13 (TIMER_BASE + 0x00002000U) + +/* registers definitions */ +#define TIMER_CTL0(timerx) REG32((timerx) + 0x00U) /*!< TIMER control register 0 */ +#define TIMER_CTL1(timerx) REG32((timerx) + 0x04U) /*!< TIMER control register 1 */ +#define TIMER_SMCFG(timerx) REG32((timerx) + 0x08U) /*!< TIMER slave mode configuration register */ +#define TIMER_DMAINTEN(timerx) REG32((timerx) + 0x0CU) /*!< TIMER DMA and interrupt enable register */ +#define TIMER_INTF(timerx) REG32((timerx) + 0x10U) /*!< TIMER interrupt flag register */ +#define TIMER_SWEVG(timerx) REG32((timerx) + 0x14U) /*!< TIMER software event generation register */ +#define TIMER_CHCTL0(timerx) REG32((timerx) + 0x18U) /*!< TIMER channel control register 0 */ +#define TIMER_CHCTL1(timerx) REG32((timerx) + 0x1CU) /*!< TIMER channel control register 1 */ +#define TIMER_CHCTL2(timerx) REG32((timerx) + 0x20U) /*!< TIMER channel control register 2 */ +#define TIMER_CNT(timerx) REG32((timerx) + 0x24U) /*!< TIMER counter register */ +#define TIMER_PSC(timerx) REG32((timerx) + 0x28U) /*!< TIMER prescaler register */ +#define TIMER_CAR(timerx) REG32((timerx) + 0x2CU) /*!< TIMER counter auto reload register */ +#define TIMER_CREP(timerx) REG32((timerx) + 0x30U) /*!< TIMER counter repetition register */ +#define TIMER_CH0CV(timerx) REG32((timerx) + 0x34U) /*!< TIMER channel 0 capture/compare value register */ +#define TIMER_CH1CV(timerx) REG32((timerx) + 0x38U) /*!< TIMER channel 1 capture/compare value register */ +#define TIMER_CH2CV(timerx) REG32((timerx) + 0x3CU) /*!< TIMER channel 2 capture/compare value register */ +#define TIMER_CH3CV(timerx) REG32((timerx) + 0x40U) /*!< TIMER channel 3 capture/compare value register */ +#define TIMER_CCHP(timerx) REG32((timerx) + 0x44U) /*!< TIMER channel complementary protection register */ +#define TIMER_DMACFG(timerx) REG32((timerx) + 0x48U) /*!< TIMER DMA configuration register */ +#define TIMER_DMATB(timerx) REG32((timerx) + 0x4CU) /*!< TIMER DMA transfer buffer register */ + +/* bits definitions */ +/* TIMER_CTL0 */ +#define TIMER_CTL0_CEN BIT(0) /*!< TIMER counter enable */ +#define TIMER_CTL0_UPDIS BIT(1) /*!< update disable */ +#define TIMER_CTL0_UPS BIT(2) /*!< update source */ +#define TIMER_CTL0_SPM BIT(3) /*!< single pulse mode */ +#define TIMER_CTL0_DIR BIT(4) /*!< timer counter direction */ +#define TIMER_CTL0_CAM BITS(5,6) /*!< center-aligned mode selection */ +#define TIMER_CTL0_ARSE BIT(7) /*!< auto-reload shadow enable */ +#define TIMER_CTL0_CKDIV BITS(8,9) /*!< clock division */ + +/* TIMER_CTL1 */ +#define TIMER_CTL1_CCSE BIT(0) /*!< commutation control shadow enable */ +#define TIMER_CTL1_CCUC BIT(2) /*!< commutation control shadow register update control */ +#define TIMER_CTL1_DMAS BIT(3) /*!< DMA request source selection */ +#define TIMER_CTL1_MMC BITS(4,6) /*!< master mode control */ +#define TIMER_CTL1_TI0S BIT(7) /*!< channel 0 trigger input selection(hall mode selection) */ +#define TIMER_CTL1_ISO0 BIT(8) /*!< idle state of channel 0 output */ +#define TIMER_CTL1_ISO0N BIT(9) /*!< idle state of channel 0 complementary output */ +#define TIMER_CTL1_ISO1 BIT(10) /*!< idle state of channel 1 output */ +#define TIMER_CTL1_ISO1N BIT(11) /*!< idle state of channel 1 complementary output */ +#define TIMER_CTL1_ISO2 BIT(12) /*!< idle state of channel 2 output */ +#define TIMER_CTL1_ISO2N BIT(13) /*!< idle state of channel 2 complementary output */ +#define TIMER_CTL1_ISO3 BIT(14) /*!< idle state of channel 3 output */ + +/* TIMER_SMCFG */ +#define TIMER_SMCFG_SMC BITS(0,2) /*!< slave mode control */ +#define TIMER_SMCFG_TRGS BITS(4,6) /*!< trigger selection */ +#define TIMER_SMCFG_MSM BIT(7) /*!< master-slave mode */ +#define TIMER_SMCFG_ETFC BITS(8,11) /*!< external trigger filter control */ +#define TIMER_SMCFG_ETPSC BITS(12,13) /*!< external trigger prescaler */ +#define TIMER_SMCFG_SMC1 BIT(14) /*!< part of SMC for enable external clock mode 1 */ +#define TIMER_SMCFG_ETP BIT(15) /*!< external trigger polarity */ + +/* TIMER_DMAINTEN */ +#define TIMER_DMAINTEN_UPIE BIT(0) /*!< update interrupt enable */ +#define TIMER_DMAINTEN_CH0IE BIT(1) /*!< channel 0 capture/compare interrupt enable */ +#define TIMER_DMAINTEN_CH1IE BIT(2) /*!< channel 1 capture/compare interrupt enable */ +#define TIMER_DMAINTEN_CH2IE BIT(3) /*!< channel 2 capture/compare interrupt enable */ +#define TIMER_DMAINTEN_CH3IE BIT(4) /*!< channel 3 capture/compare interrupt enable */ +#define TIMER_DMAINTEN_CMTIE BIT(5) /*!< commutation interrupt request enable */ +#define TIMER_DMAINTEN_TRGIE BIT(6) /*!< trigger interrupt enable */ +#define TIMER_DMAINTEN_BRKIE BIT(7) /*!< break interrupt enable */ +#define TIMER_DMAINTEN_UPDEN BIT(8) /*!< update DMA request enable */ +#define TIMER_DMAINTEN_CH0DEN BIT(9) /*!< channel 0 capture/compare DMA request enable */ +#define TIMER_DMAINTEN_CH1DEN BIT(10) /*!< channel 1 capture/compare DMA request enable */ +#define TIMER_DMAINTEN_CH2DEN BIT(11) /*!< channel 2 capture/compare DMA request enable */ +#define TIMER_DMAINTEN_CH3DEN BIT(12) /*!< channel 3 capture/compare DMA request enable */ +#define TIMER_DMAINTEN_CMTDEN BIT(13) /*!< commutation DMA request enable */ +#define TIMER_DMAINTEN_TRGDEN BIT(14) /*!< trigger DMA request enable */ + +/* TIMER_INTF */ +#define TIMER_INTF_UPIF BIT(0) /*!< update interrupt flag */ +#define TIMER_INTF_CH0IF BIT(1) /*!< channel 0 capture/compare interrupt flag */ +#define TIMER_INTF_CH1IF BIT(2) /*!< channel 1 capture/compare interrupt flag */ +#define TIMER_INTF_CH2IF BIT(3) /*!< channel 2 capture/compare interrupt flag */ +#define TIMER_INTF_CH3IF BIT(4) /*!< channel 3 capture/compare interrupt flag */ +#define TIMER_INTF_CMTIF BIT(5) /*!< channel commutation interrupt flag */ +#define TIMER_INTF_TRGIF BIT(6) /*!< trigger interrupt flag */ +#define TIMER_INTF_BRKIF BIT(7) /*!< break interrupt flag */ +#define TIMER_INTF_CH0OF BIT(9) /*!< channel 0 over capture flag */ +#define TIMER_INTF_CH1OF BIT(10) /*!< channel 1 over capture flag */ +#define TIMER_INTF_CH2OF BIT(11) /*!< channel 2 over capture flag */ +#define TIMER_INTF_CH3OF BIT(12) /*!< channel 3 over capture flag */ + +/* TIMER_SWEVG */ +#define TIMER_SWEVG_UPG BIT(0) /*!< update event generate */ +#define TIMER_SWEVG_CH0G BIT(1) /*!< channel 0 capture or compare event generation */ +#define TIMER_SWEVG_CH1G BIT(2) /*!< channel 1 capture or compare event generation */ +#define TIMER_SWEVG_CH2G BIT(3) /*!< channel 2 capture or compare event generation */ +#define TIMER_SWEVG_CH3G BIT(4) /*!< channel 3 capture or compare event generation */ +#define TIMER_SWEVG_CMTG BIT(5) /*!< channel commutation event generation */ +#define TIMER_SWEVG_TRGG BIT(6) /*!< trigger event generation */ +#define TIMER_SWEVG_BRKG BIT(7) /*!< break event generation */ + +/* TIMER_CHCTL0 */ +/* output compare mode */ +#define TIMER_CHCTL0_CH0MS BITS(0,1) /*!< channel 0 mode selection */ +#define TIMER_CHCTL0_CH0COMFEN BIT(2) /*!< channel 0 output compare fast enable */ +#define TIMER_CHCTL0_CH0COMSEN BIT(3) /*!< channel 0 output compare shadow enable */ +#define TIMER_CHCTL0_CH0COMCTL BITS(4,6) /*!< channel 0 output compare control */ +#define TIMER_CHCTL0_CH0COMCEN BIT(7) /*!< channel 0 output compare clear enable */ +#define TIMER_CHCTL0_CH1MS BITS(8,9) /*!< channel 1 mode selection */ +#define TIMER_CHCTL0_CH1COMFEN BIT(10) /*!< channel 1 output compare fast enable */ +#define TIMER_CHCTL0_CH1COMSEN BIT(11) /*!< channel 1 output compare shadow enable */ +#define TIMER_CHCTL0_CH1COMCTL BITS(12,14) /*!< channel 1 output compare control */ +#define TIMER_CHCTL0_CH1COMCEN BIT(15) /*!< channel 1 output compare clear enable */ +/* input capture mode */ +#define TIMER_CHCTL0_CH0CAPPSC BITS(2,3) /*!< channel 0 input capture prescaler */ +#define TIMER_CHCTL0_CH0CAPFLT BITS(4,7) /*!< channel 0 input capture filter control */ +#define TIMER_CHCTL0_CH1CAPPSC BITS(10,11) /*!< channel 1 input capture prescaler */ +#define TIMER_CHCTL0_CH1CAPFLT BITS(12,15) /*!< channel 1 input capture filter control */ + +/* TIMER_CHCTL1 */ +/* output compare mode */ +#define TIMER_CHCTL1_CH2MS BITS(0,1) /*!< channel 2 mode selection */ +#define TIMER_CHCTL1_CH2COMFEN BIT(2) /*!< channel 2 output compare fast enable */ +#define TIMER_CHCTL1_CH2COMSEN BIT(3) /*!< channel 2 output compare shadow enable */ +#define TIMER_CHCTL1_CH2COMCTL BITS(4,6) /*!< channel 2 output compare control */ +#define TIMER_CHCTL1_CH2COMCEN BIT(7) /*!< channel 2 output compare clear enable */ +#define TIMER_CHCTL1_CH3MS BITS(8,9) /*!< channel 3 mode selection */ +#define TIMER_CHCTL1_CH3COMFEN BIT(10) /*!< channel 3 output compare fast enable */ +#define TIMER_CHCTL1_CH3COMSEN BIT(11) /*!< channel 3 output compare shadow enable */ +#define TIMER_CHCTL1_CH3COMCTL BITS(12,14) /*!< channel 3 output compare control */ +#define TIMER_CHCTL1_CH3COMCEN BIT(15) /*!< channel 3 output compare clear enable */ +/* input capture mode */ +#define TIMER_CHCTL1_CH2CAPPSC BITS(2,3) /*!< channel 2 input capture prescaler */ +#define TIMER_CHCTL1_CH2CAPFLT BITS(4,7) /*!< channel 2 input capture filter control */ +#define TIMER_CHCTL1_CH3CAPPSC BITS(10,11) /*!< channel 3 input capture prescaler */ +#define TIMER_CHCTL1_CH3CAPFLT BITS(12,15) /*!< channel 3 input capture filter control */ + +/* TIMER_CHCTL2 */ +#define TIMER_CHCTL2_CH0EN BIT(0) /*!< channel 0 capture/compare function enable */ +#define TIMER_CHCTL2_CH0P BIT(1) /*!< channel 0 capture/compare function polarity */ +#define TIMER_CHCTL2_CH0NEN BIT(2) /*!< channel 0 complementary output enable */ +#define TIMER_CHCTL2_CH0NP BIT(3) /*!< channel 0 complementary output polarity */ +#define TIMER_CHCTL2_CH1EN BIT(4) /*!< channel 1 capture/compare function enable */ +#define TIMER_CHCTL2_CH1P BIT(5) /*!< channel 1 capture/compare function polarity */ +#define TIMER_CHCTL2_CH1NEN BIT(6) /*!< channel 1 complementary output enable */ +#define TIMER_CHCTL2_CH1NP BIT(7) /*!< channel 1 complementary output polarity */ +#define TIMER_CHCTL2_CH2EN BIT(8) /*!< channel 2 capture/compare function enable */ +#define TIMER_CHCTL2_CH2P BIT(9) /*!< channel 2 capture/compare function polarity */ +#define TIMER_CHCTL2_CH2NEN BIT(10) /*!< channel 2 complementary output enable */ +#define TIMER_CHCTL2_CH2NP BIT(11) /*!< channel 2 complementary output polarity */ +#define TIMER_CHCTL2_CH3EN BIT(12) /*!< channel 3 capture/compare function enable */ +#define TIMER_CHCTL2_CH3P BIT(13) /*!< channel 3 capture/compare function polarity */ + +/* TIMER_CNT */ +#define TIMER_CNT_CNT BITS(0,15) /*!< 16 bit timer counter */ + +/* TIMER_PSC */ +#define TIMER_PSC_PSC BITS(0,15) /*!< prescaler value of the counter clock */ + +/* TIMER_CAR */ +#define TIMER_CAR_CARL BITS(0,15) /*!< 16 bit counter auto reload value */ + +/* TIMER_CREP */ +#define TIMER_CREP_CREP BITS(0,7) /*!< counter repetition value */ + +/* TIMER_CH0CV */ +#define TIMER_CH0CV_CH0VAL BITS(0,15) /*!< 16 bit capture/compare value of channel 0 */ + +/* TIMER_CH1CV */ +#define TIMER_CH1CV_CH1VAL BITS(0,15) /*!< 16 bit capture/compare value of channel 1 */ + +/* TIMER_CH2CV */ +#define TIMER_CH2CV_CH2VAL BITS(0,15) /*!< 16 bit capture/compare value of channel 2 */ + +/* TIMER_CH3CV */ +#define TIMER_CH3CV_CH3VAL BITS(0,15) /*!< 16 bit capture/compare value of channel 3 */ + +/* TIMER_CCHP */ +#define TIMER_CCHP_DTCFG BITS(0,7) /*!< dead time configure */ +#define TIMER_CCHP_PROT BITS(8,9) /*!< complementary register protect control */ +#define TIMER_CCHP_IOS BIT(10) /*!< idle mode off-state configure */ +#define TIMER_CCHP_ROS BIT(11) /*!< run mode off-state configure */ +#define TIMER_CCHP_BRKEN BIT(12) /*!< break enable */ +#define TIMER_CCHP_BRKP BIT(13) /*!< break polarity */ +#define TIMER_CCHP_OAEN BIT(14) /*!< output automatic enable */ +#define TIMER_CCHP_POEN BIT(15) /*!< primary output enable */ + +/* TIMER_DMACFG */ +#define TIMER_DMACFG_DMATA BITS(0,4) /*!< DMA transfer access start address */ +#define TIMER_DMACFG_DMATC BITS(8,12) /*!< DMA transfer count */ + +/* TIMER_DMATB */ +#define TIMER_DMATB_DMATB BITS(0,15) /*!< DMA transfer buffer address */ + +/* constants definitions */ +/* TIMER init parameter struct definitions */ +typedef struct +{ + uint16_t prescaler; /*!< prescaler value */ + uint16_t alignedmode; /*!< aligned mode */ + uint16_t counterdirection; /*!< counter direction */ + uint32_t period; /*!< period value */ + uint16_t clockdivision; /*!< clock division value */ + uint8_t repetitioncounter; /*!< the counter repetition value */ +}timer_parameter_struct; + +/* break parameter struct definitions*/ +typedef struct +{ + uint16_t runoffstate; /*!< run mode off-state */ + uint16_t ideloffstate; /*!< idle mode off-state */ + uint16_t deadtime; /*!< dead time */ + uint16_t breakpolarity; /*!< break polarity */ + uint16_t outputautostate; /*!< output automatic enable */ + uint16_t protectmode; /*!< complementary register protect control */ + uint16_t breakstate; /*!< break enable */ +}timer_break_parameter_struct; + +/* channel output parameter struct definitions */ +typedef struct +{ + uint16_t outputstate; /*!< channel output state */ + uint16_t outputnstate; /*!< channel complementary output state */ + uint16_t ocpolarity; /*!< channel output polarity */ + uint16_t ocnpolarity; /*!< channel complementary output polarity */ + uint16_t ocidlestate; /*!< idle state of channel output */ + uint16_t ocnidlestate; /*!< idle state of channel complementary output */ +}timer_oc_parameter_struct; + +/* channel input parameter struct definitions */ +typedef struct +{ + uint16_t icpolarity; /*!< channel input polarity */ + uint16_t icselection; /*!< channel input mode selection */ + uint16_t icprescaler; /*!< channel input capture prescaler */ + uint16_t icfilter; /*!< channel input capture filter control */ +}timer_ic_parameter_struct; + +/* TIMER interrupt enable or disable */ +#define TIMER_INT_UP TIMER_DMAINTEN_UPIE /*!< update interrupt */ +#define TIMER_INT_CH0 TIMER_DMAINTEN_CH0IE /*!< channel 0 interrupt */ +#define TIMER_INT_CH1 TIMER_DMAINTEN_CH1IE /*!< channel 1 interrupt */ +#define TIMER_INT_CH2 TIMER_DMAINTEN_CH2IE /*!< channel 2 interrupt */ +#define TIMER_INT_CH3 TIMER_DMAINTEN_CH3IE /*!< channel 3 interrupt */ +#define TIMER_INT_CMT TIMER_DMAINTEN_CMTIE /*!< channel commutation interrupt flag */ +#define TIMER_INT_TRG TIMER_DMAINTEN_TRGIE /*!< trigger interrupt */ +#define TIMER_INT_BRK TIMER_DMAINTEN_BRKIE /*!< break interrupt */ + +/* TIMER interrupt flag */ +#define TIMER_INT_FLAG_UP TIMER_INT_UP /*!< update interrupt */ +#define TIMER_INT_FLAG_CH0 TIMER_INT_CH0 /*!< channel 0 interrupt */ +#define TIMER_INT_FLAG_CH1 TIMER_INT_CH1 /*!< channel 1 interrupt */ +#define TIMER_INT_FLAG_CH2 TIMER_INT_CH2 /*!< channel 2 interrupt */ +#define TIMER_INT_FLAG_CH3 TIMER_INT_CH3 /*!< channel 3 interrupt */ +#define TIMER_INT_FLAG_CMT TIMER_INT_CMT /*!< channel commutation interrupt flag */ +#define TIMER_INT_FLAG_TRG TIMER_INT_TRG /*!< trigger interrupt */ +#define TIMER_INT_FLAG_BRK TIMER_INT_BRK + +/* TIMER flag */ +#define TIMER_FLAG_UP TIMER_INTF_UPIF /*!< update flag */ +#define TIMER_FLAG_CH0 TIMER_INTF_CH0IF /*!< channel 0 flag */ +#define TIMER_FLAG_CH1 TIMER_INTF_CH1IF /*!< channel 1 flag */ +#define TIMER_FLAG_CH2 TIMER_INTF_CH2IF /*!< channel 2 flag */ +#define TIMER_FLAG_CH3 TIMER_INTF_CH3IF /*!< channel 3 flag */ +#define TIMER_FLAG_CMT TIMER_INTF_CMTIF /*!< channel commutation flag */ +#define TIMER_FLAG_TRG TIMER_INTF_TRGIF /*!< trigger flag */ +#define TIMER_FLAG_BRK TIMER_INTF_BRKIF /*!< break flag */ +#define TIMER_FLAG_CH0O TIMER_INTF_CH0OF /*!< channel 0 overcapture flag */ +#define TIMER_FLAG_CH1O TIMER_INTF_CH1OF /*!< channel 1 overcapture flag */ +#define TIMER_FLAG_CH2O TIMER_INTF_CH2OF /*!< channel 2 overcapture flag */ +#define TIMER_FLAG_CH3O TIMER_INTF_CH3OF /*!< channel 3 overcapture flag */ +/* TIMER DMA source enable */ +#define TIMER_DMA_UPD ((uint16_t)TIMER_DMAINTEN_UPDEN) /*!< update DMA enable */ +#define TIMER_DMA_CH0D ((uint16_t)TIMER_DMAINTEN_CH0DEN) /*!< channel 0 DMA enable */ +#define TIMER_DMA_CH1D ((uint16_t)TIMER_DMAINTEN_CH1DEN) /*!< channel 1 DMA enable */ +#define TIMER_DMA_CH2D ((uint16_t)TIMER_DMAINTEN_CH2DEN) /*!< channel 2 DMA enable */ +#define TIMER_DMA_CH3D ((uint16_t)TIMER_DMAINTEN_CH3DEN) /*!< channel 3 DMA enable */ +#define TIMER_DMA_CMTD ((uint16_t)TIMER_DMAINTEN_CMTDEN) /*!< commutation DMA request enable */ +#define TIMER_DMA_TRGD ((uint16_t)TIMER_DMAINTEN_TRGDEN) /*!< trigger DMA enable */ + +/* channel DMA request source selection */ +#define TIMER_DMAREQUEST_UPDATEEVENT TIMER_CTL1_DMAS /*!< DMA request of channel n is sent when update event occurs */ +#define TIMER_DMAREQUEST_CHANNELEVENT ((uint32_t)0x00000000U) /*!< DMA request of channel n is sent when channel n event occurs */ + +/* DMA access base address */ +#define DMACFG_DMATA(regval) (BITS(0, 4) & ((uint32_t)(regval) << 0U)) +#define TIMER_DMACFG_DMATA_CTL0 DMACFG_DMATA(0) /*!< DMA transfer address is TIMER_CTL0 */ +#define TIMER_DMACFG_DMATA_CTL1 DMACFG_DMATA(1) /*!< DMA transfer address is TIMER_CTL1 */ +#define TIMER_DMACFG_DMATA_SMCFG DMACFG_DMATA(2) /*!< DMA transfer address is TIMER_SMCFG */ +#define TIMER_DMACFG_DMATA_DMAINTEN DMACFG_DMATA(3) /*!< DMA transfer address is TIMER_DMAINTEN */ +#define TIMER_DMACFG_DMATA_INTF DMACFG_DMATA(4) /*!< DMA transfer address is TIMER_INTF */ +#define TIMER_DMACFG_DMATA_SWEVG DMACFG_DMATA(5) /*!< DMA transfer address is TIMER_SWEVG */ +#define TIMER_DMACFG_DMATA_CHCTL0 DMACFG_DMATA(6) /*!< DMA transfer address is TIMER_CHCTL0 */ +#define TIMER_DMACFG_DMATA_CHCTL1 DMACFG_DMATA(7) /*!< DMA transfer address is TIMER_CHCTL1 */ +#define TIMER_DMACFG_DMATA_CHCTL2 DMACFG_DMATA(8) /*!< DMA transfer address is TIMER_CHCTL2 */ +#define TIMER_DMACFG_DMATA_CNT DMACFG_DMATA(9) /*!< DMA transfer address is TIMER_CNT */ +#define TIMER_DMACFG_DMATA_PSC DMACFG_DMATA(10) /*!< DMA transfer address is TIMER_PSC */ +#define TIMER_DMACFG_DMATA_CAR DMACFG_DMATA(11) /*!< DMA transfer address is TIMER_CAR */ +#define TIMER_DMACFG_DMATA_CREP DMACFG_DMATA(12) /*!< DMA transfer address is TIMER_CREP */ +#define TIMER_DMACFG_DMATA_CH0CV DMACFG_DMATA(13) /*!< DMA transfer address is TIMER_CH0CV */ +#define TIMER_DMACFG_DMATA_CH1CV DMACFG_DMATA(14) /*!< DMA transfer address is TIMER_CH1CV */ +#define TIMER_DMACFG_DMATA_CH2CV DMACFG_DMATA(15) /*!< DMA transfer address is TIMER_CH2CV */ +#define TIMER_DMACFG_DMATA_CH3CV DMACFG_DMATA(16) /*!< DMA transfer address is TIMER_CH3CV */ +#define TIMER_DMACFG_DMATA_CCHP DMACFG_DMATA(17) /*!< DMA transfer address is TIMER_CCHP */ +#define TIMER_DMACFG_DMATA_DMACFG DMACFG_DMATA(18) /*!< DMA transfer address is TIMER_DMACFG */ + +/* DMA access burst length */ +#define DMACFG_DMATC(regval) (BITS(8, 12) & ((uint32_t)(regval) << 8U)) +#define TIMER_DMACFG_DMATC_1TRANSFER DMACFG_DMATC(0) /*!< DMA transfer 1 time */ +#define TIMER_DMACFG_DMATC_2TRANSFER DMACFG_DMATC(1) /*!< DMA transfer 2 times */ +#define TIMER_DMACFG_DMATC_3TRANSFER DMACFG_DMATC(2) /*!< DMA transfer 3 times */ +#define TIMER_DMACFG_DMATC_4TRANSFER DMACFG_DMATC(3) /*!< DMA transfer 4 times */ +#define TIMER_DMACFG_DMATC_5TRANSFER DMACFG_DMATC(4) /*!< DMA transfer 5 times */ +#define TIMER_DMACFG_DMATC_6TRANSFER DMACFG_DMATC(5) /*!< DMA transfer 6 times */ +#define TIMER_DMACFG_DMATC_7TRANSFER DMACFG_DMATC(6) /*!< DMA transfer 7 times */ +#define TIMER_DMACFG_DMATC_8TRANSFER DMACFG_DMATC(7) /*!< DMA transfer 8 times */ +#define TIMER_DMACFG_DMATC_9TRANSFER DMACFG_DMATC(8) /*!< DMA transfer 9 times */ +#define TIMER_DMACFG_DMATC_10TRANSFER DMACFG_DMATC(9) /*!< DMA transfer 10 times */ +#define TIMER_DMACFG_DMATC_11TRANSFER DMACFG_DMATC(10) /*!< DMA transfer 11 times */ +#define TIMER_DMACFG_DMATC_12TRANSFER DMACFG_DMATC(11) /*!< DMA transfer 12 times */ +#define TIMER_DMACFG_DMATC_13TRANSFER DMACFG_DMATC(12) /*!< DMA transfer 13 times */ +#define TIMER_DMACFG_DMATC_14TRANSFER DMACFG_DMATC(13) /*!< DMA transfer 14 times */ +#define TIMER_DMACFG_DMATC_15TRANSFER DMACFG_DMATC(14) /*!< DMA transfer 15 times */ +#define TIMER_DMACFG_DMATC_16TRANSFER DMACFG_DMATC(15) /*!< DMA transfer 16 times */ +#define TIMER_DMACFG_DMATC_17TRANSFER DMACFG_DMATC(16) /*!< DMA transfer 17 times */ +#define TIMER_DMACFG_DMATC_18TRANSFER DMACFG_DMATC(17) /*!< DMA transfer 18 times */ + +/* TIMER software event generation source */ +#define TIMER_EVENT_SRC_UPG ((uint16_t)0x0001U) /*!< update event generation */ +#define TIMER_EVENT_SRC_CH0G ((uint16_t)0x0002U) /*!< channel 0 capture or compare event generation */ +#define TIMER_EVENT_SRC_CH1G ((uint16_t)0x0004U) /*!< channel 1 capture or compare event generation */ +#define TIMER_EVENT_SRC_CH2G ((uint16_t)0x0008U) /*!< channel 2 capture or compare event generation */ +#define TIMER_EVENT_SRC_CH3G ((uint16_t)0x0010U) /*!< channel 3 capture or compare event generation */ +#define TIMER_EVENT_SRC_CMTG ((uint16_t)0x0020U) /*!< channel commutation event generation */ +#define TIMER_EVENT_SRC_TRGG ((uint16_t)0x0040U) /*!< trigger event generation */ +#define TIMER_EVENT_SRC_BRKG ((uint16_t)0x0080U) /*!< break event generation */ + +/* center-aligned mode selection */ +#define CTL0_CAM(regval) ((uint16_t)(BITS(5, 6) & ((uint32_t)(regval) << 5U))) +#define TIMER_COUNTER_EDGE CTL0_CAM(0) /*!< edge-aligned mode */ +#define TIMER_COUNTER_CENTER_DOWN CTL0_CAM(1) /*!< center-aligned and counting down assert mode */ +#define TIMER_COUNTER_CENTER_UP CTL0_CAM(2) /*!< center-aligned and counting up assert mode */ +#define TIMER_COUNTER_CENTER_BOTH CTL0_CAM(3) /*!< center-aligned and counting up/down assert mode */ + +/* TIMER prescaler reload mode */ +#define TIMER_PSC_RELOAD_NOW TIMER_SWEVG_UPG /*!< the prescaler is loaded right now */ +#define TIMER_PSC_RELOAD_UPDATE ((uint32_t)0x00000000U) /*!< the prescaler is loaded at the next update event */ + +/* count direction */ +#define TIMER_COUNTER_UP ((uint16_t)0x0000U) /*!< counter up direction */ +#define TIMER_COUNTER_DOWN ((uint16_t)TIMER_CTL0_DIR) /*!< counter down direction */ + +/* specify division ratio between TIMER clock and dead-time and sampling clock */ +#define CTL0_CKDIV(regval) ((uint16_t)(BITS(8, 9) & ((uint32_t)(regval) << 8U))) +#define TIMER_CKDIV_DIV1 CTL0_CKDIV(0) /*!< clock division value is 1,fDTS=fTIMER_CK */ +#define TIMER_CKDIV_DIV2 CTL0_CKDIV(1) /*!< clock division value is 2,fDTS= fTIMER_CK/2 */ +#define TIMER_CKDIV_DIV4 CTL0_CKDIV(2) /*!< clock division value is 4, fDTS= fTIMER_CK/4 */ + +/* single pulse mode */ +#define TIMER_SP_MODE_SINGLE TIMER_CTL0_SPM /*!< single pulse mode */ +#define TIMER_SP_MODE_REPETITIVE ((uint32_t)0x00000000U) /*!< repetitive pulse mode */ + +/* update source */ +#define TIMER_UPDATE_SRC_REGULAR TIMER_CTL0_UPS /*!< update generate only by counter overflow/underflow */ +#define TIMER_UPDATE_SRC_GLOBAL ((uint32_t)0x00000000U) /*!< update generate by setting of UPG bit or the counter overflow/underflow,or the slave mode controller trigger */ + +/* run mode off-state configure */ +#define TIMER_ROS_STATE_ENABLE ((uint16_t)TIMER_CCHP_ROS) /*!< when POEN bit is set, the channel output signals(CHx_O/CHx_ON) are enabled, with relationship to CHxEN/CHxNEN bits */ +#define TIMER_ROS_STATE_DISABLE ((uint16_t)0x0000U) /*!< when POEN bit is set, the channel output signals(CHx_O/CHx_ON) are disabled */ + +/* idle mode off-state configure */ +#define TIMER_IOS_STATE_ENABLE ((uint16_t)TIMER_CCHP_IOS) /*!< when POEN bit is reset, he channel output signals(CHx_O/CHx_ON) are enabled, with relationship to CHxEN/CHxNEN bits */ +#define TIMER_IOS_STATE_DISABLE ((uint16_t)0x0000U) /*!< when POEN bit is reset, the channel output signals(CHx_O/CHx_ON) are disabled */ + +/* break input polarity */ +#define TIMER_BREAK_POLARITY_LOW ((uint16_t)0x0000U) /*!< break input polarity is low */ +#define TIMER_BREAK_POLARITY_HIGH ((uint16_t)TIMER_CCHP_BRKP) /*!< break input polarity is high */ + +/* output automatic enable */ +#define TIMER_OUTAUTO_ENABLE ((uint16_t)TIMER_CCHP_OAEN) /*!< output automatic enable */ +#define TIMER_OUTAUTO_DISABLE ((uint16_t)0x0000U) /*!< output automatic disable */ + +/* complementary register protect control */ +#define CCHP_PROT(regval) ((uint16_t)(BITS(8, 9) & ((uint32_t)(regval) << 8U))) +#define TIMER_CCHP_PROT_OFF CCHP_PROT(0) /*!< protect disable */ +#define TIMER_CCHP_PROT_0 CCHP_PROT(1) /*!< PROT mode 0 */ +#define TIMER_CCHP_PROT_1 CCHP_PROT(2) /*!< PROT mode 1 */ +#define TIMER_CCHP_PROT_2 CCHP_PROT(3) /*!< PROT mode 2 */ + +/* break input enable */ +#define TIMER_BREAK_ENABLE ((uint16_t)TIMER_CCHP_BRKEN) /*!< break input enable */ +#define TIMER_BREAK_DISABLE ((uint16_t)0x0000U) /*!< break input disable */ + +/* TIMER channel n(n=0,1,2,3) */ +#define TIMER_CH_0 ((uint16_t)0x0000U) /*!< TIMER channel 0(TIMERx(x=0..4,7..13)) */ +#define TIMER_CH_1 ((uint16_t)0x0001U) /*!< TIMER channel 1(TIMERx(x=0..4,7,8,11)) */ +#define TIMER_CH_2 ((uint16_t)0x0002U) /*!< TIMER channel 2(TIMERx(x=0..4,7)) */ +#define TIMER_CH_3 ((uint16_t)0x0003U) /*!< TIMER channel 3(TIMERx(x=0..4,7)) */ + +/* channel enable state */ +#define TIMER_CCX_ENABLE ((uint16_t)0x0001U) /*!< channel enable */ +#define TIMER_CCX_DISABLE ((uint16_t)0x0000U) /*!< channel disable */ + +/* channel complementary output enable state */ +#define TIMER_CCXN_ENABLE ((uint16_t)0x0004U) /*!< channel complementary enable */ +#define TIMER_CCXN_DISABLE ((uint16_t)0x0000U) /*!< channel complementary disable */ + +/* channel output polarity */ +#define TIMER_OC_POLARITY_HIGH ((uint16_t)0x0000U) /*!< channel output polarity is high */ +#define TIMER_OC_POLARITY_LOW ((uint16_t)0x0002U) /*!< channel output polarity is low */ + +/* channel complementary output polarity */ +#define TIMER_OCN_POLARITY_HIGH ((uint16_t)0x0000U) /*!< channel complementary output polarity is high */ +#define TIMER_OCN_POLARITY_LOW ((uint16_t)0x0008U) /*!< channel complementary output polarity is low */ + +/* idle state of channel output */ +#define TIMER_OC_IDLE_STATE_HIGH ((uint16_t)0x0100) /*!< idle state of channel output is high */ +#define TIMER_OC_IDLE_STATE_LOW ((uint16_t)0x0000) /*!< idle state of channel output is low */ + +/* idle state of channel complementary output */ +#define TIMER_OCN_IDLE_STATE_HIGH ((uint16_t)0x0200U) /*!< idle state of channel complementary output is high */ +#define TIMER_OCN_IDLE_STATE_LOW ((uint16_t)0x0000U) /*!< idle state of channel complementary output is low */ + +/* channel output compare mode */ +#define TIMER_OC_MODE_TIMING ((uint16_t)0x0000U) /*!< frozen mode */ +#define TIMER_OC_MODE_ACTIVE ((uint16_t)0x0010U) /*!< set the channel output */ +#define TIMER_OC_MODE_INACTIVE ((uint16_t)0x0020U) /*!< clear the channel output */ +#define TIMER_OC_MODE_TOGGLE ((uint16_t)0x0030U) /*!< toggle on match */ +#define TIMER_OC_MODE_LOW ((uint16_t)0x0040U) /*!< force low mode */ +#define TIMER_OC_MODE_HIGH ((uint16_t)0x0050U) /*!< force high mode */ +#define TIMER_OC_MODE_PWM0 ((uint16_t)0x0060U) /*!< PWM0 mode */ +#define TIMER_OC_MODE_PWM1 ((uint16_t)0x0070U) /*!< PWM1 mode*/ + +/* channel output compare shadow enable */ +#define TIMER_OC_SHADOW_ENABLE ((uint16_t)0x0008U) /*!< channel output shadow state enable */ +#define TIMER_OC_SHADOW_DISABLE ((uint16_t)0x0000U) /*!< channel output shadow state disable */ + +/* channel output compare fast enable */ +#define TIMER_OC_FAST_ENABLE ((uint16_t)0x0004) /*!< channel output fast function enable */ +#define TIMER_OC_FAST_DISABLE ((uint16_t)0x0000) /*!< channel output fast function disable */ + +/* channel output compare clear enable */ +#define TIMER_OC_CLEAR_ENABLE ((uint16_t)0x0080U) /*!< channel output clear function enable */ +#define TIMER_OC_CLEAR_DISABLE ((uint16_t)0x0000U) /*!< channel output clear function disable */ + +/* channel control shadow register update control */ +#define TIMER_UPDATECTL_CCU ((uint32_t)0x00000000U) /*!< the shadow registers update by when CMTG bit is set */ +#define TIMER_UPDATECTL_CCUTRI TIMER_CTL1_CCUC /*!< the shadow registers update by when CMTG bit is set or an rising edge of TRGI occurs */ + +/* channel input capture polarity */ +#define TIMER_IC_POLARITY_RISING ((uint16_t)0x0000U) /*!< input capture rising edge */ +#define TIMER_IC_POLARITY_FALLING ((uint16_t)0x0002U) /*!< input capture falling edge */ + +/* timer input capture selection */ +#define TIMER_IC_SELECTION_DIRECTTI ((uint16_t)0x0001U) /*!< channel y is configured as input and icy is mapped on CIy */ +#define TIMER_IC_SELECTION_INDIRECTTI ((uint16_t)0x0002U) /*!< channel y is configured as input and icy is mapped on opposite input */ +#define TIMER_IC_SELECTION_ITS ((uint16_t)0x0003U) /*!< channel y is configured as input and icy is mapped on ITS */ + +/* channel input capture prescaler */ +#define TIMER_IC_PSC_DIV1 ((uint16_t)0x0000U) /*!< no prescaler */ +#define TIMER_IC_PSC_DIV2 ((uint16_t)0x0004U) /*!< divided by 2 */ +#define TIMER_IC_PSC_DIV4 ((uint16_t)0x0008U) /*!< divided by 4 */ +#define TIMER_IC_PSC_DIV8 ((uint16_t)0x000CU) /*!< divided by 8 */ + +/* trigger selection */ +#define SMCFG_TRGSEL(regval) (BITS(4, 6) & ((uint32_t)(regval) << 4U)) +#define TIMER_SMCFG_TRGSEL_ITI0 SMCFG_TRGSEL(0) /*!< internal trigger 0 */ +#define TIMER_SMCFG_TRGSEL_ITI1 SMCFG_TRGSEL(1) /*!< internal trigger 1 */ +#define TIMER_SMCFG_TRGSEL_ITI2 SMCFG_TRGSEL(2) /*!< internal trigger 2 */ +#define TIMER_SMCFG_TRGSEL_ITI3 SMCFG_TRGSEL(3) /*!< internal trigger 3 */ +#define TIMER_SMCFG_TRGSEL_CI0F_ED SMCFG_TRGSEL(4) /*!< TI0 Edge Detector */ +#define TIMER_SMCFG_TRGSEL_CI0FE0 SMCFG_TRGSEL(5) /*!< filtered TIMER input 0 */ +#define TIMER_SMCFG_TRGSEL_CI1FE1 SMCFG_TRGSEL(6) /*!< filtered TIMER input 1 */ +#define TIMER_SMCFG_TRGSEL_ETIFP SMCFG_TRGSEL(7) /*!< external trigger */ + +/* master mode control */ +#define CTL1_MMC(regval) (BITS(4, 6) & ((uint32_t)(regval) << 4U)) +#define TIMER_TRI_OUT_SRC_RESET CTL1_MMC(0) /*!< the UPG bit as trigger output */ +#define TIMER_TRI_OUT_SRC_ENABLE CTL1_MMC(1) /*!< the counter enable signal TIMER_CTL0_CEN as trigger output */ +#define TIMER_TRI_OUT_SRC_UPDATE CTL1_MMC(2) /*!< update event as trigger output */ +#define TIMER_TRI_OUT_SRC_CH0 CTL1_MMC(3) /*!< a capture or a compare match occurred in channel 0 as trigger output TRGO */ +#define TIMER_TRI_OUT_SRC_O0CPRE CTL1_MMC(4) /*!< O0CPRE as trigger output */ +#define TIMER_TRI_OUT_SRC_O1CPRE CTL1_MMC(5) /*!< O1CPRE as trigger output */ +#define TIMER_TRI_OUT_SRC_O2CPRE CTL1_MMC(6) /*!< O2CPRE as trigger output */ +#define TIMER_TRI_OUT_SRC_O3CPRE CTL1_MMC(7) /*!< O3CPRE as trigger output */ + +/* slave mode control */ +#define SMCFG_SMC(regval) (BITS(0, 2) & ((uint32_t)(regval) << 0U)) +#define TIMER_SLAVE_MODE_DISABLE SMCFG_SMC(0) /*!< slave mode disable */ +#define TIMER_QUAD_DECODER_MODE0 SMCFG_SMC(1) /*!< quadrature decoder mode 0 */ +#define TIMER_QUAD_DECODER_MODE1 SMCFG_SMC(2) /*!< quadrature decoder mode 1 */ +#define TIMER_QUAD_DECODER_MODE2 SMCFG_SMC(3) /*!< quadrature decoder mode 2 */ +#define TIMER_SLAVE_MODE_RESTART SMCFG_SMC(4) /*!< restart mode */ +#define TIMER_SLAVE_MODE_PAUSE SMCFG_SMC(5) /*!< pause mode */ +#define TIMER_SLAVE_MODE_EVENT SMCFG_SMC(6) /*!< event mode */ +#define TIMER_SLAVE_MODE_EXTERNAL0 SMCFG_SMC(7) /*!< external clock mode 0 */ + +/* master slave mode selection */ +#define TIMER_MASTER_SLAVE_MODE_ENABLE TIMER_SMCFG_MSM /*!< master slave mode enable */ +#define TIMER_MASTER_SLAVE_MODE_DISABLE ((uint32_t)0x00000000U) /*!< master slave mode disable */ + +/* external trigger prescaler */ +#define SMCFG_ETPSC(regval) (BITS(12, 13) & ((uint32_t)(regval) << 12U)) +#define TIMER_EXT_TRI_PSC_OFF SMCFG_ETPSC(0) /*!< no divided */ +#define TIMER_EXT_TRI_PSC_DIV2 SMCFG_ETPSC(1) /*!< divided by 2 */ +#define TIMER_EXT_TRI_PSC_DIV4 SMCFG_ETPSC(2) /*!< divided by 4 */ +#define TIMER_EXT_TRI_PSC_DIV8 SMCFG_ETPSC(3) /*!< divided by 8 */ + +/* external trigger polarity */ +#define TIMER_ETP_FALLING TIMER_SMCFG_ETP /*!< active low or falling edge active */ +#define TIMER_ETP_RISING ((uint32_t)0x00000000U) /*!< active high or rising edge active */ + +/* channel 0 trigger input selection */ +#define TIMER_HALLINTERFACE_ENABLE TIMER_CTL1_TI0S /*!< TIMER hall sensor mode enable */ +#define TIMER_HALLINTERFACE_DISABLE ((uint32_t)0x00000000U) /*!< TIMER hall sensor mode disable */ + +/* TIMERx(x=0..4,7..13) write CHxVAL register selection */ +#define TIMER_CHVSEL_ENABLE ((uint16_t)TIMER_CFG_OUTSEL) /*!< write CHxVAL register selection enable */ +#define TIMER_CHVSEL_DISABLE ((uint16_t)0x0000U) /*!< write CHxVAL register selection disable */ + +/* function declarations */ +/* TIMER timebase */ +/* deinit a TIMER */ +void timer_deinit(uint32_t timer_periph); +/* initialize TIMER init parameter struct */ +void timer_struct_para_init(timer_parameter_struct* initpara); +/* initialize TIMER counter */ +void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara); +/* enable a TIMER */ +void timer_enable(uint32_t timer_periph); +/* disable a TIMER */ +void timer_disable(uint32_t timer_periph); +/* enable the auto reload shadow function */ +void timer_auto_reload_shadow_enable(uint32_t timer_periph); +/* disable the auto reload shadow function */ +void timer_auto_reload_shadow_disable(uint32_t timer_periph); +/* enable the update event */ +void timer_update_event_enable(uint32_t timer_periph); +/* disable the update event */ +void timer_update_event_disable(uint32_t timer_periph); +/* set TIMER counter alignment mode */ +void timer_counter_alignment(uint32_t timer_periph, uint16_t aligned); +/* set TIMER counter up direction */ +void timer_counter_up_direction(uint32_t timer_periph); +/* set TIMER counter down direction */ +void timer_counter_down_direction(uint32_t timer_periph); +/* configure TIMER prescaler */ +void timer_prescaler_config(uint32_t timer_periph, uint16_t prescaler, uint32_t pscreload); +/* configure TIMER repetition register value */ +void timer_repetition_value_config(uint32_t timer_periph, uint8_t repetition); +/* configure TIMER autoreload register value */ +void timer_autoreload_value_config(uint32_t timer_periph, uint32_t autoreload); +/* configure TIMER counter register value */ +void timer_counter_value_config(uint32_t timer_periph, uint32_t counter); +/* read TIMER counter value */ +uint32_t timer_counter_read(uint32_t timer_periph); +/* read TIMER prescaler value */ +uint16_t timer_prescaler_read(uint32_t timer_periph); +/* configure TIMER single pulse mode */ +void timer_single_pulse_mode_config(uint32_t timer_periph, uint32_t spmode); +/* configure TIMER update source */ +void timer_update_source_config(uint32_t timer_periph, uint32_t update); + +/* timer DMA and event */ +/* enable the TIMER DMA */ +void timer_dma_enable(uint32_t timer_periph, uint16_t dma); +/* disable the TIMER DMA */ +void timer_dma_disable(uint32_t timer_periph, uint16_t dma); +/* channel DMA request source selection */ +void timer_channel_dma_request_source_select(uint32_t timer_periph, uint32_t dma_request); +/* configure the TIMER DMA transfer */ +void timer_dma_transfer_config(uint32_t timer_periph, uint32_t dma_baseaddr, uint32_t dma_lenth); +/* software generate events */ +void timer_event_software_generate(uint32_t timer_periph, uint16_t event); + +/* TIMER channel complementary protection */ +/* initialize TIMER break parameter struct */ +void timer_break_struct_para_init(timer_break_parameter_struct* breakpara); +/* configure TIMER break function */ +void timer_break_config(uint32_t timer_periph, timer_break_parameter_struct* breakpara); +/* enable TIMER break function */ +void timer_break_enable(uint32_t timer_periph); +/* disable TIMER break function */ +void timer_break_disable(uint32_t timer_periph); +/* enable TIMER output automatic function */ +void timer_automatic_output_enable(uint32_t timer_periph); +/* disable TIMER output automatic function */ +void timer_automatic_output_disable(uint32_t timer_periph); +/* enable or disable TIMER primary output function */ +void timer_primary_output_config(uint32_t timer_periph, ControlStatus newvalue); +/* enable or disable channel capture/compare control shadow register */ +void timer_channel_control_shadow_config(uint32_t timer_periph, ControlStatus newvalue); +/* configure TIMER channel control shadow register update control */ +void timer_channel_control_shadow_update_config(uint32_t timer_periph, uint32_t ccuctl); + +/* TIMER channel output */ +/* initialize TIMER channel output parameter struct */ +void timer_channel_output_struct_para_init(timer_oc_parameter_struct* ocpara); +/* configure TIMER channel output function */ +void timer_channel_output_config(uint32_t timer_periph, uint16_t channel, timer_oc_parameter_struct* ocpara); +/* configure TIMER channel output compare mode */ +void timer_channel_output_mode_config(uint32_t timer_periph, uint16_t channel, uint16_t ocmode); +/* configure TIMER channel output pulse value */ +void timer_channel_output_pulse_value_config(uint32_t timer_periph, uint16_t channel, uint16_t pulse); +/* configure TIMER channel output shadow function */ +void timer_channel_output_shadow_config(uint32_t timer_periph, uint16_t channel, uint16_t ocshadow); +/* configure TIMER channel output fast function */ +void timer_channel_output_fast_config(uint32_t timer_periph, uint16_t channel, uint16_t ocfast); +/* configure TIMER channel output clear function */ +void timer_channel_output_clear_config(uint32_t timer_periph, uint16_t channel, uint16_t occlear); +/* configure TIMER channel output polarity */ +void timer_channel_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocpolarity); +/* configure TIMER channel complementary output polarity */ +void timer_channel_complementary_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnpolarity); +/* configure TIMER channel enable state */ +void timer_channel_output_state_config(uint32_t timer_periph, uint16_t channel, uint32_t state); +/* configure TIMER channel complementary output enable state */ +void timer_channel_complementary_output_state_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnstate); + +/* TIMER channel input */ +/* initialize TIMER channel input parameter struct */ +void timer_channel_input_struct_para_init(timer_ic_parameter_struct* icpara); +/* configure TIMER input capture parameter */ +void timer_input_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpara); +/* configure TIMER channel input capture prescaler value */ +void timer_channel_input_capture_prescaler_config(uint32_t timer_periph, uint16_t channel, uint16_t prescaler); +/* read TIMER channel capture compare register value */ +uint32_t timer_channel_capture_value_register_read(uint32_t timer_periph, uint16_t channel); +/* configure TIMER input pwm capture function */ +void timer_input_pwm_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpwm); +/* configure TIMER hall sensor mode */ +void timer_hall_mode_config(uint32_t timer_periph, uint32_t hallmode); + +/* TIMER master and slave */ +/* select TIMER input trigger source */ +void timer_input_trigger_source_select(uint32_t timer_periph, uint32_t intrigger); +/* select TIMER master mode output trigger source */ +void timer_master_output_trigger_source_select(uint32_t timer_periph, uint32_t outrigger); +/* select TIMER slave mode */ +void timer_slave_mode_select(uint32_t timer_periph, uint32_t slavemode); +/* configure TIMER master slave mode */ +void timer_master_slave_mode_config(uint32_t timer_periph, uint32_t masterslave); +/* configure TIMER external trigger input */ +void timer_external_trigger_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter); +/* configure TIMER quadrature decoder mode */ +void timer_quadrature_decoder_mode_config(uint32_t timer_periph, uint32_t decomode, uint16_t ic0polarity, uint16_t ic1polarity); +/* configure TIMER internal clock mode */ +void timer_internal_clock_config(uint32_t timer_periph); +/* configure TIMER the internal trigger as external clock input */ +void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger); +/* configure TIMER the external trigger as external clock input */ +void timer_external_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t extrigger, uint16_t extpolarity, uint8_t extfilter); +/* configure TIMER the external clock mode 0 */ +void timer_external_clock_mode0_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter); +/* configure TIMER the external clock mode 1 */ +void timer_external_clock_mode1_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter); +/* disable TIMER the external clock mode 1 */ +void timer_external_clock_mode1_disable(uint32_t timer_periph); + +/* TIMER interrupt and flag */ +/* enable the TIMER interrupt */ +void timer_interrupt_enable(uint32_t timer_periph, uint32_t interrupt); +/* disable the TIMER interrupt */ +void timer_interrupt_disable(uint32_t timer_periph, uint32_t interrupt); +/* get TIMER interrupt flag */ +FlagStatus timer_interrupt_flag_get(uint32_t timer_periph, uint32_t interrupt); +/* clear TIMER interrupt flag */ +void timer_interrupt_flag_clear(uint32_t timer_periph, uint32_t interrupt); +/* get TIMER flag */ +FlagStatus timer_flag_get(uint32_t timer_periph, uint32_t flag); +/* clear TIMER flag */ +void timer_flag_clear(uint32_t timer_periph, uint32_t flag); + +#endif /* GD32E10X_TIMER_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_usart.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_usart.h new file mode 100644 index 0000000..206dab1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_usart.h @@ -0,0 +1,373 @@ +/*! + \file gd32f10x_usart.h + \brief definitions for the USART + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_USART_H +#define GD32F10X_USART_H + +#include "gd32f10x.h" + +/* USARTx(x=0,1,2)/UARTx(x=3,4) definitions */ +#define USART1 USART_BASE /*!< USART1 base address */ +#define USART2 (USART_BASE+(0x00000400U)) /*!< USART2 base address */ +#define UART3 (USART_BASE+(0x00000800U)) /*!< UART3 base address */ +#define UART4 (USART_BASE+(0x00000C00U)) /*!< UART4 base address */ +#define USART0 (USART_BASE+(0x0000F400U)) /*!< USART0 base address */ + +/* registers definitions */ +#define USART_STAT(usartx) REG32((usartx) + (0x00000000U)) /*!< USART status register */ +#define USART_DATA(usartx) REG32((usartx) + (0x00000004U)) /*!< USART data register */ +#define USART_BAUD(usartx) REG32((usartx) + (0x00000008U)) /*!< USART baud rate register */ +#define USART_CTL0(usartx) REG32((usartx) + (0x0000000CU)) /*!< USART control register 0 */ +#define USART_CTL1(usartx) REG32((usartx) + (0x00000010U)) /*!< USART control register 1 */ +#define USART_CTL2(usartx) REG32((usartx) + (0x00000014U)) /*!< USART control register 2 */ +#define USART_GP(usartx) REG32((usartx) + (0x00000018U)) /*!< USART guard time and prescaler register */ + +/* bits definitions */ +/* USARTx_STAT */ +#define USART_STAT_PERR BIT(0) /*!< parity error flag */ +#define USART_STAT_FERR BIT(1) /*!< frame error flag */ +#define USART_STAT_NERR BIT(2) /*!< noise error flag */ +#define USART_STAT_ORERR BIT(3) /*!< overrun error */ +#define USART_STAT_IDLEF BIT(4) /*!< IDLE frame detected flag */ +#define USART_STAT_RBNE BIT(5) /*!< read data buffer not empty */ +#define USART_STAT_TC BIT(6) /*!< transmission complete */ +#define USART_STAT_TBE BIT(7) /*!< transmit data buffer empty */ +#define USART_STAT_LBDF BIT(8) /*!< LIN break detected flag */ +#define USART_STAT_CTSF BIT(9) /*!< CTS change flag */ + +/* USARTx_DATA */ +#define USART_DATA_DATA BITS(0,8) /*!< transmit or read data value */ + +/* USARTx_BAUD */ +#define USART_BAUD_FRADIV BITS(0,3) /*!< fraction part of baud-rate divider */ +#define USART_BAUD_INTDIV BITS(4,15) /*!< integer part of baud-rate divider */ + +/* USARTx_CTL0 */ +#define USART_CTL0_SBKCMD BIT(0) /*!< send break command */ +#define USART_CTL0_RWU BIT(1) /*!< receiver wakeup from mute mode */ +#define USART_CTL0_REN BIT(2) /*!< enable receiver */ +#define USART_CTL0_TEN BIT(3) /*!< enable transmitter */ +#define USART_CTL0_IDLEIE BIT(4) /*!< enable idle line detected interrupt */ +#define USART_CTL0_RBNEIE BIT(5) /*!< enable read data buffer not empty interrupt and overrun error interrupt */ +#define USART_CTL0_TCIE BIT(6) /*!< enable transmission complete interrupt */ +#define USART_CTL0_TBEIE BIT(7) /*!< enable transmitter buffer empty interrupt */ +#define USART_CTL0_PERRIE BIT(8) /*!< enable parity error interrupt */ +#define USART_CTL0_PM BIT(9) /*!< parity mode */ +#define USART_CTL0_PCEN BIT(10) /*!< enable parity check function */ +#define USART_CTL0_WM BIT(11) /*!< wakeup method in mute mode */ +#define USART_CTL0_WL BIT(12) /*!< word length */ +#define USART_CTL0_UEN BIT(13) /*!< enable USART */ + +/* USARTx_CTL1 */ +#define USART_CTL1_ADDR BITS(0,3) /*!< address of USART */ +#define USART_CTL1_LBLEN BIT(5) /*!< LIN break frame length */ +#define USART_CTL1_LBDIE BIT(6) /*!< enable LIN break detected interrupt */ +#define USART_CTL1_CLEN BIT(8) /*!< CK length */ +#define USART_CTL1_CPH BIT(9) /*!< CK phase */ +#define USART_CTL1_CPL BIT(10) /*!< CK polarity */ +#define USART_CTL1_CKEN BIT(11) /*!< CK pin enable */ +#define USART_CTL1_STB BITS(12,13) /*!< STOP bits length */ +#define USART_CTL1_LMEN BIT(14) /*!< enable LIN mode */ + +/* USARTx_CTL2 */ +#define USART_CTL2_ERRIE BIT(0) /*!< enable error interrupt */ +#define USART_CTL2_IREN BIT(1) /*!< enable IrDA mode */ +#define USART_CTL2_IRLP BIT(2) /*!< IrDA low-power */ +#define USART_CTL2_HDEN BIT(3) /*!< half-duplex enable */ +#define USART_CTL2_NKEN BIT(4) /*!< NACK enable in smartcard mode */ +#define USART_CTL2_SCEN BIT(5) /*!< enable smartcard mode */ +#define USART_CTL2_DENR BIT(6) /*!< DMA request enable for reception */ +#define USART_CTL2_DENT BIT(7) /*!< DMA request enable for transmission */ +#define USART_CTL2_RTSEN BIT(8) /*!< enable RTS */ +#define USART_CTL2_CTSEN BIT(9) /*!< enable CTS */ +#define USART_CTL2_CTSIE BIT(10) /*!< enable CTS interrupt */ + +/* USARTx_GP */ +#define USART_GP_PSC BITS(0,7) /*!< prescaler value for dividing the system clock */ +#define USART_GP_GUAT BITS(8,15) /*!< guard time value in smartcard mode */ + +/* constants definitions */ +/* define the USART bit position and its register index offset */ +#define USART_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos)) +#define USART_REG_VAL(usartx, offset) (REG32((usartx) + (((uint32_t)(offset) & (0x0000FFFFU)) >> 6))) +#define USART_BIT_POS(val) ((uint32_t)(val) & (0x0000001FU)) +#define USART_REGIDX_BIT2(regidx, bitpos, regidx2, bitpos2) (((uint32_t)(regidx2) << 22) | (uint32_t)((bitpos2) << 16)\ + | (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos))) +#define USART_REG_VAL2(usartx, offset) (REG32((usartx) + ((uint32_t)(offset) >> 22))) +#define USART_BIT_POS2(val) (((uint32_t)(val) & (0x001F0000U)) >> 16) + +/* register offset */ +#define USART_STAT_REG_OFFSET (0x00000000U) /*!< STAT register offset */ +#define USART_CTL0_REG_OFFSET (0x0000000CU) /*!< CTL0 register offset */ +#define USART_CTL1_REG_OFFSET (0x00000010U) /*!< CTL1 register offset */ +#define USART_CTL2_REG_OFFSET (0x00000014U) /*!< CTL2 register offset */ + +/* USART flags */ +typedef enum +{ + /* flags in STAT register */ + USART_FLAG_CTSF = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 9U), /*!< CTS change flag */ + USART_FLAG_LBDF = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 8U), /*!< LIN break detected flag */ + USART_FLAG_TBE = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 7U), /*!< transmit data buffer empty */ + USART_FLAG_TC = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 6U), /*!< transmission complete */ + USART_FLAG_RBNE = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 5U), /*!< read data buffer not empty */ + USART_FLAG_IDLEF = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 4U), /*!< IDLE frame detected flag */ + USART_FLAG_ORERR = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 3U), /*!< overrun error */ + USART_FLAG_NERR = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 2U), /*!< noise error flag */ + USART_FLAG_FERR = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 1U), /*!< frame error flag */ + USART_FLAG_PERR = USART_REGIDX_BIT(USART_STAT_REG_OFFSET, 0U), /*!< parity error flag */ +}usart_flag_enum; + +/* USART interrupt flags */ +typedef enum +{ + /* interrupt flags in CTL0 register */ + USART_INT_FLAG_PERR = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 8U, USART_STAT_REG_OFFSET, 0U), /*!< parity error interrupt and flag */ + USART_INT_FLAG_TBE = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 7U, USART_STAT_REG_OFFSET, 7U), /*!< transmitter buffer empty interrupt and flag */ + USART_INT_FLAG_TC = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 6U, USART_STAT_REG_OFFSET, 6U), /*!< transmission complete interrupt and flag */ + USART_INT_FLAG_RBNE = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 5U, USART_STAT_REG_OFFSET, 5U), /*!< read data buffer not empty interrupt and flag */ + USART_INT_FLAG_RBNE_ORERR = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 5U, USART_STAT_REG_OFFSET, 3U), /*!< read data buffer not empty interrupt and overrun error flag */ + USART_INT_FLAG_IDLE = USART_REGIDX_BIT2(USART_CTL0_REG_OFFSET, 4U, USART_STAT_REG_OFFSET, 4U), /*!< IDLE line detected interrupt and flag */ + /* interrupt flags in CTL1 register */ + USART_INT_FLAG_LBD = USART_REGIDX_BIT2(USART_CTL1_REG_OFFSET, 6U, USART_STAT_REG_OFFSET, 8U), /*!< LIN break detected interrupt and flag */ + /* interrupt flags in CTL2 register */ + USART_INT_FLAG_CTS = USART_REGIDX_BIT2(USART_CTL2_REG_OFFSET, 10U, USART_STAT_REG_OFFSET, 9U), /*!< CTS interrupt and flag */ + USART_INT_FLAG_ERR_ORERR = USART_REGIDX_BIT2(USART_CTL2_REG_OFFSET, 0U, USART_STAT_REG_OFFSET, 3U), /*!< error interrupt and overrun error */ + USART_INT_FLAG_ERR_NERR = USART_REGIDX_BIT2(USART_CTL2_REG_OFFSET, 0U, USART_STAT_REG_OFFSET, 2U), /*!< error interrupt and noise error flag */ + USART_INT_FLAG_ERR_FERR = USART_REGIDX_BIT2(USART_CTL2_REG_OFFSET, 0U, USART_STAT_REG_OFFSET, 1U), /*!< error interrupt and frame error flag */ +}usart_interrupt_flag_enum; + +/* USART interrupt enable or disable */ +typedef enum +{ + /* interrupt in CTL0 register */ + USART_INT_PERR = USART_REGIDX_BIT(USART_CTL0_REG_OFFSET, 8U), /*!< parity error interrupt */ + USART_INT_TBE = USART_REGIDX_BIT(USART_CTL0_REG_OFFSET, 7U), /*!< transmitter buffer empty interrupt */ + USART_INT_TC = USART_REGIDX_BIT(USART_CTL0_REG_OFFSET, 6U), /*!< transmission complete interrupt */ + USART_INT_RBNE = USART_REGIDX_BIT(USART_CTL0_REG_OFFSET, 5U), /*!< read data buffer not empty interrupt and overrun error interrupt */ + USART_INT_IDLE = USART_REGIDX_BIT(USART_CTL0_REG_OFFSET, 4U), /*!< IDLE line detected interrupt */ + /* interrupt in CTL1 register */ + USART_INT_LBD = USART_REGIDX_BIT(USART_CTL1_REG_OFFSET, 6U), /*!< LIN break detected interrupt */ + /* interrupt in CTL2 register */ + USART_INT_CTS = USART_REGIDX_BIT(USART_CTL2_REG_OFFSET, 10U), /*!< CTS interrupt */ + USART_INT_ERR = USART_REGIDX_BIT(USART_CTL2_REG_OFFSET, 0U), /*!< error interrupt */ +}usart_interrupt_enum; + +/* configure USART receiver */ +#define CTL0_REN(regval) (BIT(2) & ((uint32_t)(regval) << 2)) +#define USART_RECEIVE_ENABLE CTL0_REN(1) /*!< enable receiver */ +#define USART_RECEIVE_DISABLE CTL0_REN(0) /*!< disable receiver */ + +/* configure USART transmitter */ +#define CTL0_TEN(regval) (BIT(3) & ((uint32_t)(regval) << 3)) +#define USART_TRANSMIT_ENABLE CTL0_TEN(1) /*!< enable transmitter */ +#define USART_TRANSMIT_DISABLE CTL0_TEN(0) /*!< disable transmitter */ + +/* USART parity bits definitions */ +#define CTL0_PM(regval) (BITS(9,10) & ((uint32_t)(regval) << 9)) +#define USART_PM_NONE CTL0_PM(0) /*!< no parity */ +#define USART_PM_EVEN CTL0_PM(2) /*!< even parity */ +#define USART_PM_ODD CTL0_PM(3) /*!< odd parity */ + +/* USART wakeup method in mute mode */ +#define CTL0_WM(regval) (BIT(11) & ((uint32_t)(regval) << 11)) +#define USART_WM_IDLE CTL0_WM(0) /*!< idle line */ +#define USART_WM_ADDR CTL0_WM(1) /*!< address match */ + +/* USART word length definitions */ +#define CTL0_WL(regval) (BIT(12) & ((uint32_t)(regval) << 12)) +#define USART_WL_8BIT CTL0_WL(0) /*!< 8 bits */ +#define USART_WL_9BIT CTL0_WL(1) /*!< 9 bits */ + +/* USART stop bits definitions */ +#define CTL1_STB(regval) (BITS(12,13) & ((uint32_t)(regval) << 12)) +#define USART_STB_1BIT CTL1_STB(0) /*!< 1 bit */ +#define USART_STB_0_5BIT CTL1_STB(1) /*!< 0.5 bit */ +#define USART_STB_2BIT CTL1_STB(2) /*!< 2 bits */ +#define USART_STB_1_5BIT CTL1_STB(3) /*!< 1.5 bits */ + +/* USART LIN break frame length */ +#define CTL1_LBLEN(regval) (BIT(5) & ((uint32_t)(regval) << 5)) +#define USART_LBLEN_10B CTL1_LBLEN(0) /*!< 10 bits */ +#define USART_LBLEN_11B CTL1_LBLEN(1) /*!< 11 bits */ + +/* USART CK length */ +#define CTL1_CLEN(regval) (BIT(8) & ((uint32_t)(regval) << 8)) +#define USART_CLEN_NONE CTL1_CLEN(0) /*!< there are 7 CK pulses for an 8 bit frame and 8 CK pulses for a 9 bit frame */ +#define USART_CLEN_EN CTL1_CLEN(1) /*!< there are 8 CK pulses for an 8 bit frame and 9 CK pulses for a 9 bit frame */ + +/* USART clock phase */ +#define CTL1_CPH(regval) (BIT(9) & ((uint32_t)(regval) << 9)) +#define USART_CPH_1CK CTL1_CPH(0) /*!< first clock transition is the first data capture edge */ +#define USART_CPH_2CK CTL1_CPH(1) /*!< second clock transition is the first data capture edge */ + +/* USART clock polarity */ +#define CTL1_CPL(regval) (BIT(10) & ((uint32_t)(regval) << 10)) +#define USART_CPL_LOW CTL1_CPL(0) /*!< steady low value on CK pin */ +#define USART_CPL_HIGH CTL1_CPL(1) /*!< steady high value on CK pin */ + +/* configure USART DMA */ +#define CLT2_RECEIVE_DMAEN(regval) (BIT(6) & ((uint32_t)(regval) << 6)) +#define CTL2_TRANSMIT_DMAEN(regval) (BIT(7) & ((uint32_t)(regval) << 7)) +#define USART_RECEIVE_DMA_ENABLE CLT2_RECEIVE_DMAEN(1) /* enable DMA request for reception */ +#define USART_RECEIVE_DMA_DISABLE CLT2_RECEIVE_DMAEN(0) /* disable DMA request for reception */ +#define USART_TRANSMIT_DMA_ENABLE CTL2_TRANSMIT_DMAEN(1) /* enable DMA request for transmission */ +#define USART_TRANSMIT_DMA_DISABLE CTL2_TRANSMIT_DMAEN(0) /* disable DMA request for transmission */ + +/* configure USART RTS */ +#define CLT2_RTSEN(regval) (BIT(8) & ((uint32_t)(regval) << 8)) +#define USART_RTS_ENABLE CLT2_RTSEN(1) /*!< enable RTS */ +#define USART_RTS_DISABLE CLT2_RTSEN(0) /*!< disable RTS */ + +/* configure USART CTS */ +#define CLT2_CTSEN(regval) (BIT(9) & ((uint32_t)(regval) << 9)) +#define USART_CTS_ENABLE CLT2_CTSEN(1) /*!< enable CTS */ +#define USART_CTS_DISABLE CLT2_CTSEN(0) /*!< disable CTS */ + +/* enable USART IrDA low-power */ +#define CTL2_IRLP(regval) (BIT(2) & ((uint32_t)(regval) << 2)) +#define USART_IRLP_LOW CTL2_IRLP(1) /*!< low-power */ +#define USART_IRLP_NORMAL CTL2_IRLP(0) /*!< normal */ + +/* function declarations */ +/* initialization functions */ +/* reset USART */ +void usart_deinit(uint32_t usart_periph); +/* configure USART baud rate value */ +void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval); +/* configure USART parity function */ +void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg); +/* configure USART word length */ +void usart_word_length_set(uint32_t usart_periph, uint32_t wlen); +/* configure USART stop bit length */ +void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen); + +/* USART normal mode communication */ +/* enable USART */ +void usart_enable(uint32_t usart_periph); +/* disable USART */ +void usart_disable(uint32_t usart_periph); +/* configure USART transmitter */ +void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig); +/* configure USART receiver */ +void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig); +/* USART transmit data function */ +void usart_data_transmit(uint32_t usart_periph, uint16_t data); +/* USART receive data function */ +uint16_t usart_data_receive(uint32_t usart_periph); + +/* multi-processor communication */ +/* configure address of the USART */ +void usart_address_config(uint32_t usart_periph, uint8_t addr); +/* enable mute mode */ +void usart_mute_mode_enable(uint32_t usart_periph); +/* disable mute mode */ +void usart_mute_mode_disable(uint32_t usart_periph); +/* configure wakeup method in mute mode */ +void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmethod); + +/* LIN mode communication */ +/* enable LIN mode */ +void usart_lin_mode_enable(uint32_t usart_periph); +/* disable LIN mode */ +void usart_lin_mode_disable(uint32_t usart_periph); +/* configure LIN break frame length */ +void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen); +/* send break frame */ +void usart_send_break(uint32_t usart_periph); + +/* half-duplex communication */ +/* enable half-duplex */ +void usart_halfduplex_enable(uint32_t usart_periph); +/* disable half-duplex */ +void usart_halfduplex_disable(uint32_t usart_periph); + +/* synchronous communication */ +/* enable CK pin in synchronous mode */ +void usart_synchronous_clock_enable(uint32_t usart_periph); +/* disable CK pin in synchronous mode */ +void usart_synchronous_clock_disable(uint32_t usart_periph); +/* configure usart synchronous mode parameters */ +void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cpl); + +/* smartcard communication */ +/* configure guard time value in smartcard mode */ +void usart_guard_time_config(uint32_t usart_periph,uint8_t gaut); +/* enable smartcard mode */ +void usart_smartcard_mode_enable(uint32_t usart_periph); +/* disable smartcard mode */ +void usart_smartcard_mode_disable(uint32_t usart_periph); +/* enable NACK in smartcard mode */ +void usart_smartcard_mode_nack_enable(uint32_t usart_periph); +/* disable NACK in smartcard mode */ +void usart_smartcard_mode_nack_disable(uint32_t usart_periph); + +/* IrDA communication */ +/* enable IrDA mode */ +void usart_irda_mode_enable(uint32_t usart_periph); +/* disable IrDA mode */ +void usart_irda_mode_disable(uint32_t usart_periph); +/* configure the peripheral clock prescaler */ +void usart_prescaler_config(uint32_t usart_periph, uint8_t psc); +/* configure IrDA low-power */ +void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp); + +/* hardware flow communication */ +/* configure hardware flow control RTS */ +void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig); +/* configure hardware flow control CTS */ +void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig); + +/* DMA communication */ +/* configure USART DMA for reception */ +void usart_dma_receive_config(uint32_t usart_periph, uint8_t dmaconfig); +/* configure USART DMA for transmission */ +void usart_dma_transmit_config(uint32_t usart_periph, uint8_t dmaconfig); + +/* flag functions */ +/* get flag in STAT register */ +FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag); +/* clear flag in STAT register */ +void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag); + +/* interrupt functions */ +/* enable USART interrupt */ +void usart_interrupt_enable(uint32_t usart_periph, uint32_t interrupt); +/* disable USART interrupt */ +void usart_interrupt_disable(uint32_t usart_periph, uint32_t interrupt); +/* get USART interrupt and flag status */ +FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, uint32_t int_flag); +/* clear interrupt flag in STAT register */ +void usart_interrupt_flag_clear(uint32_t usart_periph, uint32_t int_flag); +#endif /* GD32F10X_USART_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_wwdgt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_wwdgt.h new file mode 100644 index 0000000..c9e6109 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Include/gd32f10x_wwdgt.h @@ -0,0 +1,91 @@ +/*! + \file gd32f10x_wwdgt.h + \brief definitions for the WWDGT + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_WWDGT_H +#define GD32F10X_WWDGT_H + +#include "gd32f10x.h" + +/* WWDGT definitions */ +#define WWDGT WWDGT_BASE /*!< WWDGT base address */ + +/* registers definitions */ +#define WWDGT_CTL REG32((WWDGT) + 0x00U) /*!< WWDGT control register */ +#define WWDGT_CFG REG32((WWDGT) + 0x04U) /*!< WWDGT configuration register */ +#define WWDGT_STAT REG32((WWDGT) + 0x08U) /*!< WWDGT status register */ + +/* bits definitions */ +/* WWDGT_CTL */ +#define WWDGT_CTL_CNT BITS(0,6) /*!< WWDGT counter value */ +#define WWDGT_CTL_WDGTEN BIT(7) /*!< WWDGT counter enable */ + +/* WWDGT_CFG */ +#define WWDGT_CFG_WIN BITS(0,6) /*!< WWDGT counter window value */ +#define WWDGT_CFG_PSC BITS(7,8) /*!< WWDGT prescaler divider value */ +#define WWDGT_CFG_EWIE BIT(9) /*!< early wakeup interrupt enable */ + +/* WWDGT_STAT */ +#define WWDGT_STAT_EWIF BIT(0) /*!< early wakeup interrupt flag */ + +/* constants definitions */ +#define CFG_PSC(regval) (BITS(7,8) & ((uint32_t)(regval) << 7)) /*!< write value to WWDGT_CFG_PSC bit field */ +#define WWDGT_CFG_PSC_DIV1 CFG_PSC(0) /*!< the time base of WWDGT = (PCLK1/4096)/1 */ +#define WWDGT_CFG_PSC_DIV2 CFG_PSC(1) /*!< the time base of WWDGT = (PCLK1/4096)/2 */ +#define WWDGT_CFG_PSC_DIV4 CFG_PSC(2) /*!< the time base of WWDGT = (PCLK1/4096)/4 */ +#define WWDGT_CFG_PSC_DIV8 CFG_PSC(3) /*!< the time base of WWDGT = (PCLK1/4096)/8 */ + +/* write value to WWDGT_CTL_CNT bit field */ +#define CTL_CNT(regval) (BITS(0,6) & ((uint32_t)(regval) << 0)) +/* write value to WWDGT_CFG_WIN bit field */ +#define CFG_WIN(regval) (BITS(0,6) & ((uint32_t)(regval) << 0)) + +/* function declarations */ +/* reset the window watchdog timer configuration */ +void wwdgt_deinit(void); +/* start the window watchdog timer counter */ +void wwdgt_enable(void); + +/* configure the window watchdog timer counter value */ +void wwdgt_counter_update(uint16_t counter_value); +/* configure counter value, window value, and prescaler divider value */ +void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler); + +/* check early wakeup interrupt state of WWDGT */ +FlagStatus wwdgt_flag_get(void); +/* clear early wakeup interrupt state of WWDGT */ +void wwdgt_flag_clear(void); +/* enable early wakeup interrupt of WWDGT */ +void wwdgt_interrupt_enable(void); + +#endif /* GD32F10X_WWDGT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_adc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_adc.c new file mode 100644 index 0000000..33d5bf0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_adc.c @@ -0,0 +1,929 @@ +/*! + \file gd32f10x_adc.c + \brief ADC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_adc.h" + +/* discontinuous mode macro*/ +#define ADC_CHANNEL_LENGTH_SUBTRACT_ONE ((uint8_t)1U) + +/* ADC regular channel macro */ +#define ADC_REGULAR_CHANNEL_RANK_SIX ((uint8_t)6U) +#define ADC_REGULAR_CHANNEL_RANK_TWELVE ((uint8_t)12U) +#define ADC_REGULAR_CHANNEL_RANK_SIXTEEN ((uint8_t)16U) +#define ADC_REGULAR_CHANNEL_RANK_LENGTH ((uint8_t)5U) + +/* ADC sampling time macro */ +#define ADC_CHANNEL_SAMPLE_TEN ((uint8_t)10U) +#define ADC_CHANNEL_SAMPLE_EIGHTEEN ((uint8_t)18U) +#define ADC_CHANNEL_SAMPLE_LENGTH ((uint8_t)3U) + +/* ADC inserted channel macro */ +#define ADC_INSERTED_CHANNEL_RANK_LENGTH ((uint8_t)5U) +#define ADC_INSERTED_CHANNEL_SHIFT_LENGTH ((uint8_t)15U) + +/* ADC inserted channel offset macro */ +#define ADC_OFFSET_LENGTH ((uint8_t)3U) +#define ADC_OFFSET_SHIFT_LENGTH ((uint8_t)4U) + +/*! + \brief reset ADC + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_deinit(uint32_t adc_periph) +{ + switch(adc_periph){ + case ADC0: + /* reset ADC0 */ + rcu_periph_reset_enable(RCU_ADC0RST); + rcu_periph_reset_disable(RCU_ADC0RST); + break; + case ADC1: + /* reset ADC1 */ + rcu_periph_reset_enable(RCU_ADC1RST); + rcu_periph_reset_disable(RCU_ADC1RST); + break; +#ifndef GD32F10X_CL + case ADC2: + rcu_periph_reset_enable(RCU_ADC2RST); + rcu_periph_reset_disable(RCU_ADC2RST); + break; +#endif /* GD32F10X_CL */ + default: + break; + } +} + +/*! + \brief configure the ADC sync mode + \param[in] mode: ADC mode + only one parameter can be selected which is shown as below: + \arg ADC_MODE_FREE: all the ADCs work independently + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_PARALLEL: ADC0 and ADC1 work in combined regular parallel + inserted parallel mode + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_ROTATION: ADC0 and ADC1 work in combined regular parallel + trigger rotation mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in combined inserted parallel + follow-up fast mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in combined inserted parallel + follow-up slow mode + \arg ADC_DAUL_INSERTED_PARALLEL: ADC0 and ADC1 work in inserted parallel mode only + \arg ADC_DAUL_REGULAL_PARALLEL: ADC0 and ADC1 work in regular parallel mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in follow-up fast mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in follow-up slow mode only + \arg ADC_DAUL_INSERTED_TRIGGER_ROTATION: ADC0 and ADC1 work in trigger rotation mode only + \param[out] none + \retval none +*/ +void adc_mode_config(uint32_t mode) +{ + ADC_CTL0(ADC0) &= ~(ADC_CTL0_SYNCM); + ADC_CTL0(ADC0) |= mode; +} + +/*! + \brief enable or disable ADC special function + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] function: the function to config + only one parameter can be selected which is shown as below: + \arg ADC_SCAN_MODE: scan mode select + \arg ADC_INSERTED_CHANNEL_AUTO: inserted channel group convert automatically + \arg ADC_CONTINUOUS_MODE: continuous mode select + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_special_function_config(uint32_t adc_periph, uint32_t function, ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (function & ADC_SCAN_MODE)){ + /* enable scan mode */ + ADC_CTL0(adc_periph) |= ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* enable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) |= ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* enable continuous mode */ + ADC_CTL1(adc_periph) |= ADC_CONTINUOUS_MODE; + } + }else{ + if(0U != (function & ADC_SCAN_MODE)){ + /* disable scan mode */ + ADC_CTL0(adc_periph) &= ~ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* disable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) &= ~ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* disable continuous mode */ + ADC_CTL1(adc_periph) &= ~ADC_CONTINUOUS_MODE; + } + } +} + +/*! + \brief configure ADC data alignment + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] data_alignment: data alignment select + only one parameter can be selected which is shown as below: + \arg ADC_DATAALIGN_RIGHT: LSB alignment + \arg ADC_DATAALIGN_LEFT: MSB alignment + \param[out] none + \retval none +*/ +void adc_data_alignment_config(uint32_t adc_periph, uint32_t data_alignment) +{ + if(ADC_DATAALIGN_RIGHT != data_alignment){ + /* MSB alignment */ + ADC_CTL1(adc_periph) |= ADC_CTL1_DAL; + }else{ + /* LSB alignment */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DAL); + } +} + +/*! + \brief enable ADC interface + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_enable(uint32_t adc_periph) +{ + if(RESET == (ADC_CTL1(adc_periph) & ADC_CTL1_ADCON)){ + /* enable ADC */ + ADC_CTL1(adc_periph) |= (uint32_t)ADC_CTL1_ADCON; + } +} + +/*! + \brief disable ADC interface + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_disable(uint32_t adc_periph) +{ + /* disable ADC */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ADCON); +} + +/*! + \brief ADC calibration and reset calibration(GD32F10x_MD series without this function) + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_calibration_enable(uint32_t adc_periph) +{ + /* reset the selected ADC1 calibration registers */ + ADC_CTL1(adc_periph) |= (uint32_t) ADC_CTL1_RSTCLB; + /* check the RSTCLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_RSTCLB)){ + } + /* enable ADC calibration process */ + ADC_CTL1(adc_periph) |= ADC_CTL1_CLB; + /* check the CLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_CLB)){ + } +} + +/*! + \brief enable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_enable(void) +{ + /* enable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) |= ADC_CTL1_TSVREN; +} + +/*! + \brief disable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_disable(void) +{ + /* disable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) &= ~ADC_CTL1_TSVREN; +} + +/*! + \brief enable DMA request + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_dma_mode_enable(uint32_t adc_periph) +{ + /* enable DMA request */ + ADC_CTL1(adc_periph) |= (uint32_t)(ADC_CTL1_DMA); +} + +/*! + \brief disable DMA request + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_dma_mode_disable(uint32_t adc_periph) +{ + /* disable DMA request */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DMA); +} + +/*! + \brief configure ADC discontinuous mode + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_CHANNEL_DISCON_DISABLE: disable discontinuous mode of regular & inserted channel + \param[in] length: number of conversions in discontinuous mode,the number can be 1..8 + for regular channel, the number has no effect for inserted channel + \param[out] none + \retval none +*/ +void adc_discontinuous_mode_config(uint32_t adc_periph, uint8_t adc_channel_group, uint8_t length) +{ + /* disable discontinuous mode of regular & inserted channel */ + ADC_CTL0(adc_periph) &= ~((uint32_t)(ADC_CTL0_DISRC | ADC_CTL0_DISIC)); + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* config the number of conversions in discontinuous mode */ + ADC_CTL0(adc_periph) &= ~((uint32_t)ADC_CTL0_DISNUM); + ADC_CTL0(adc_periph) |= CTL0_DISNUM(((uint32_t)length - ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + /* enable regular channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISRC; + break; + case ADC_INSERTED_CHANNEL: + /* enable inserted channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISIC; + break; + case ADC_CHANNEL_DISCON_DISABLE: + /* disable discontinuous mode of regular & inserted channel */ + default: + break; + } +} + +/*! + \brief configure the length of regular channel group or inserted channel group + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] length: the length of the channel + regular channel 1-16 + inserted channel 1-4 + \param[out] none + \retval none +*/ +void adc_channel_length_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t length) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure the length of regular channel group */ + ADC_RSQ0(adc_periph) &= ~((uint32_t)ADC_RSQ0_RL); + ADC_RSQ0(adc_periph) |= RSQ0_RL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + case ADC_INSERTED_CHANNEL: + /* configure the length of inserted channel group */ + ADC_ISQ(adc_periph) &= ~((uint32_t)ADC_ISQ_IL); + ADC_ISQ(adc_periph) |= ISQ_IL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + default: + break; + } +} + +/*! + \brief configure ADC regular channel + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] rank: the regular group sequence rank,this parameter must be between 0 to 15 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: the sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_regular_channel_config(uint32_t adc_periph, uint8_t rank, uint8_t adc_channel, uint32_t sample_time) +{ + uint32_t rsq,sampt; + + /* ADC regular sequence config */ + if(rank < ADC_REGULAR_CHANNEL_RANK_SIX){ + /* the regular group sequence rank is smaller than six */ + rsq = ADC_RSQ2(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank)); + ADC_RSQ2(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_TWELVE){ + /* the regular group sequence rank is smaller than twelve */ + rsq = ADC_RSQ1(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX))); + ADC_RSQ1(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_SIXTEEN){ + /* the regular group sequence rank is smaller than sixteen */ + rsq = ADC_RSQ0(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE))); + ADC_RSQ0(adc_periph) = rsq; + }else{ + } + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the regular group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel)); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the regular group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] rank: the inserted group sequencer rank,this parameter must be between 0 to 3 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: The sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_inserted_channel_config(uint32_t adc_periph, uint8_t rank, uint8_t adc_channel, uint32_t sample_time) +{ + uint8_t inserted_length; + uint32_t isq,sampt; + /* get inserted channel group length */ + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + /* the channel number is written to these bits to select a channel as the nth conversion in the inserted channel group */ + isq = ADC_ISQ(adc_periph); + isq &= ~((uint32_t)(ADC_ISQ_ISQN << (ADC_INSERTED_CHANNEL_SHIFT_LENGTH-(inserted_length-rank)*ADC_INSERTED_CHANNEL_RANK_LENGTH))); + isq |= ((uint32_t)adc_channel << (ADC_INSERTED_CHANNEL_SHIFT_LENGTH-(inserted_length-rank)*ADC_INSERTED_CHANNEL_RANK_LENGTH)); + ADC_ISQ(adc_periph) = isq; + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the inserted group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t) sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the inserted group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= ((uint32_t)sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel offset + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] inserted_channel: insert channel select + only one parameter can be selected + \arg ADC_INSERTED_CHANNEL_0: inserted channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted channel3 + \param[in] offset: the offset data + \param[out] none + \retval none +*/ +void adc_inserted_channel_offset_config(uint32_t adc_periph, uint8_t inserted_channel, uint16_t offset) +{ + uint8_t inserted_length; + uint32_t num = 0U; + + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + num = ((uint32_t)ADC_OFFSET_LENGTH - ((uint32_t)inserted_length - (uint32_t)inserted_channel)); + + if(num <= ADC_OFFSET_LENGTH){ + /* calculate the offset of the register */ + num = num * ADC_OFFSET_SHIFT_LENGTH; + /* config the offset of the selected channels */ + REG32((adc_periph) + 0x14U + num) = IOFFX_IOFF((uint32_t)offset); + } +} + +/*! + \brief configure ADC external trigger source + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] external_trigger_source: regular or inserted group trigger source + only one parameter can be selected + for regular channel: + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH0: TIMER0 CH0 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH1: TIMER0 CH1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH2: TIMER0 CH2 event select + \arg ADC0_1_EXTTRIG_REGULAR_T1_CH1: TIMER1 CH1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T2_TRGO: TIMER2 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_T3_CH3: TIMER3 CH3 event select + \arg ADC0_1_EXTTRIG_REGULAR_T7_TRGO: TIMER7 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_EXTI_11: external interrupt line 11 + \arg ADC2_EXTTRIG_REGULAR_T2_CH0: TIMER2 CH0 event select + \arg ADC2_EXTTRIG_REGULAR_T1_CH2: TIMER1 CH2 event select + \arg ADC2_EXTTRIG_REGULAR_T0_CH2: TIMER0 CH2 event select + \arg ADC2_EXTTRIG_REGULAR_T7_CH0: TIMER7 CH0 event select + \arg ADC2_EXTTRIG_REGULAR_T7_TRGO: TIMER7 TRGO event select + \arg ADC2_EXTTRIG_REGULAR_T4_CH0: TIMER4 CH0 event select + \arg ADC2_EXTTRIG_REGULAR_T4_CH2: TIMER4 CH2 event select + \arg ADC0_1_2_EXTTRIG_REGULAR_NONE: software trigger + for inserted channel: + \arg ADC0_1_EXTTRIG_INSERTED_T0_TRGO: TIMER0 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T0_CH3: TIMER0 CH3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_TRGO: TIMER1 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_CH0: TIMER1 CH0 event select + \arg ADC0_1_EXTTRIG_INSERTED_T2_CH3: TIMER2 CH3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T3_TRGO: TIMER3 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_EXTI_15: external interrupt line 15 + \arg ADC0_1_EXTTRIG_INSERTED_T7_CH3: TIMER7 CH3 event select + \arg ADC2_EXTTRIG_INSERTED_T0_TRGO: TIMER0 TRGO event select + \arg ADC2_EXTTRIG_INSERTED_T0_CH3: TIMER0 CH3 event select + \arg ADC2_EXTTRIG_INSERTED_T3_CH2: TIMER3 CH2 event select + \arg ADC2_EXTTRIG_INSERTED_T7_CH1: TIMER7 CH1 event select + \arg ADC2_EXTTRIG_INSERTED_T7_CH3: TIMER7 CH3 event select + \arg ADC2_EXTTRIG_INSERTED_T4_TRGO: TIMER4 TRGO event select + \arg ADC2_EXTTRIG_INSERTED_T4_CH3: TIMER4 CH3 event select + \arg ADC0_1_2_EXTTRIG_INSERTED_NONE: software trigger + \param[out] none + \retval none +*/ +void adc_external_trigger_source_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t external_trigger_source) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure ADC regular group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSRC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + case ADC_INSERTED_CHANNEL: + /* configure ADC inserted group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSIC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + default: + break; + } +} + +/*! + \brief configure ADC external trigger + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_external_trigger_config(uint32_t adc_periph, uint8_t adc_channel_group, ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETEIC; + } + }else{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETEIC; + } + } +} + +/*! + \brief enable ADC software trigger + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[out] none + \retval none +*/ +void adc_software_trigger_enable(uint32_t adc_periph, uint8_t adc_channel_group) +{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWRCST; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWICST; + } +} + +/*! + \brief read ADC regular group data register + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint16_t adc_regular_data_read(uint32_t adc_periph) +{ + return (uint16_t)(ADC_RDATA(adc_periph)); +} + +/*! + \brief read ADC inserted group data register + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] inserted_channel: insert channel select + only one parameter can be selected + \arg ADC_INSERTED_CHANNEL_0: inserted Channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted Channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted Channel3 + \param[out] none + \retval the conversion value +*/ +uint16_t adc_inserted_data_read(uint32_t adc_periph, uint8_t inserted_channel) +{ + uint32_t idata; + /* read the data of the selected channel */ + switch(inserted_channel){ + case ADC_INSERTED_CHANNEL_0: + /* read the data of channel 0 */ + idata = ADC_IDATA0(adc_periph); + break; + case ADC_INSERTED_CHANNEL_1: + /* read the data of channel 1 */ + idata = ADC_IDATA1(adc_periph); + break; + case ADC_INSERTED_CHANNEL_2: + /* read the data of channel 2 */ + idata = ADC_IDATA2(adc_periph); + break; + case ADC_INSERTED_CHANNEL_3: + /* read the data of channel 3 */ + idata = ADC_IDATA3(adc_periph); + break; + default: + idata = 0U; + break; + } + return (uint16_t)idata; +} + +/*! + \brief read the last ADC0 and ADC1 conversion result data in sync mode + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint32_t adc_sync_mode_convert_value_read(void) +{ + /* return conversion value */ + return ADC_RDATA(ADC0); +} + + +/*! + \brief configure ADC analog watchdog single channel + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x: ADC Channelx(x=0..17)(x=16 and x=17 are only for ADC0) + \param[out] none + \retval none +*/ +void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); + /* analog watchdog channel select */ + ADC_CTL0(adc_periph) |= (uint32_t)adc_channel; + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); +} + +/*! + \brief configure ADC analog watchdog group channel + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_channel_group: the channel group use analog watchdog + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_REGULAR_INSERTED_CHANNEL: both regular and inserted group + \param[out] none + \retval none +*/ +void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_group) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); + /* select the group */ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* regular channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_RWDEN; + break; + case ADC_INSERTED_CHANNEL: + /* inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_IWDEN; + break; + case ADC_REGULAR_INSERTED_CHANNEL: + /* regular and inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN); + break; + default: + break; + } +} + +/*! + \brief disable ADC analog watchdog + \param[in] adc_periph: ADCx, x=0,1,2 + \param[out] none + \retval none +*/ +void adc_watchdog_disable(uint32_t adc_periph) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); +} + +/*! + \brief configure ADC analog watchdog threshold + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] low_threshold: analog watchdog low threshold, 0..4095 + \param[in] high_threshold: analog watchdog high threshold, 0..4095 + \param[out] none + \retval none +*/ +void adc_watchdog_threshold_config(uint32_t adc_periph, uint16_t low_threshold, uint16_t high_threshold) +{ + ADC_WDLT(adc_periph) = (uint32_t)WDLT_WDLT(low_threshold); + ADC_WDHT(adc_periph) = (uint32_t)WDHT_WDHT(high_threshold); +} + +/*! + \brief get the ADC flag bits + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_flag: the adc flag bits + only one parameter can be selected which is shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_flag_get(uint32_t adc_periph, uint32_t adc_flag) +{ + FlagStatus reval = RESET; + if(ADC_STAT(adc_periph) & adc_flag){ + reval = SET; + } + return reval; +} + +/*! + \brief clear the ADC flag bits + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_flag: the adc flag bits + one or more parameters can be selected which are shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval none +*/ +void adc_flag_clear(uint32_t adc_periph, uint32_t adc_flag) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_flag); +} + +/*! + \brief get the bit state of ADCx software start conversion + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_regular_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_SWRCST)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the bit state of ADCx software inserted channel start conversion + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_inserted_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_SWICST)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the ADC interrupt bits + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_interrupt: the adc interrupt bits + only one parameter can be selected which is shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_interrupt_flag_get(uint32_t adc_periph, uint32_t adc_interrupt) +{ + FlagStatus interrupt_flag = RESET; + uint32_t state; + /* check the interrupt bits */ + switch(adc_interrupt){ + case ADC_INT_FLAG_WDE: + /* get the ADC analog watchdog interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_WDE; + if((ADC_CTL0(adc_periph) & ADC_CTL0_WDEIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOC: + /* get the ADC end of group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOCIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOIC: + /* get the ADC end of inserted group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOIC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOICIE) && state){ + interrupt_flag = SET; + } + break; + default: + break; + } + return interrupt_flag; +} + +/*! + \brief clear the ADC flag + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_interrupt: the adc status flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval none +*/ +void adc_interrupt_flag_clear(uint32_t adc_periph, uint32_t adc_interrupt) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_interrupt); +} + +/*! + \brief enable ADC interrupt + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_interrupt: the adc interrupt + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_enable(uint32_t adc_periph, uint32_t adc_interrupt) +{ + /* enable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_WDEIE; + } + /* enable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOCIE; + } + /* enable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOICIE; + } +} + +/*! + \brief disable ADC interrupt + \param[in] adc_periph: ADCx, x=0,1,2 + \param[in] adc_interrupt: the adc interrupt flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_disable(uint32_t adc_periph, uint32_t adc_interrupt) +{ + /* disable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_WDEIE; + } + /* disable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOCIE; + } + /* disable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOICIE; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_bkp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_bkp.c new file mode 100644 index 0000000..66d961d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_bkp.c @@ -0,0 +1,292 @@ +/*! + \file gd32f10x_bkp.c + \brief BKP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_bkp.h" + +/* BKP register bits offset */ +#define BKP_TAMPER_BITS_OFFSET ((uint32_t)8U) + +/*! + \brief reset BKP registers + \param[in] none + \param[out] none + \retval none +*/ +void bkp_deinit(void) +{ + /* reset BKP domain register*/ + rcu_bkp_reset_enable(); + rcu_bkp_reset_disable(); +} + +/*! + \brief write BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[in] data: the data to be write in BKP data register + \param[out] none + \retval none +*/ +void bkp_data_write(bkp_data_register_enum register_number, uint16_t data) +{ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + BKP_DATA10_41(register_number - 1U) = data; + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + BKP_DATA0_9(register_number - 1U) = data; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief read BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[out] none + \retval data of BKP data register +*/ +uint16_t bkp_data_read(bkp_data_register_enum register_number) +{ + uint16_t data = 0U; + + /* get the data from the BKP data register */ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + data = BKP_DATA10_41(register_number - 1U); + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + data = BKP_DATA0_9(register_number - 1U); + }else{ + /* illegal parameters */ + } + return data; +} + +/*! + \brief enable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_COEN; +} + +/*! + \brief disable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_COEN; +} + +/*! + \brief enable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_ASOEN; +} + +/*! + \brief disable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_ASOEN; +} + +/*! + \brief select RTC output + \param[in] outputsel: RTC output selection + only one parameter can be selected which is shown as below: + \arg RTC_OUTPUT_ALARM_PULSE: RTC alarm pulse is selected as the RTC output + \arg RTC_OUTPUT_SECOND_PULSE: RTC second pulse is selected as the RTC output + \param[out] none + \retval none +*/ +void bkp_rtc_output_select(uint16_t outputsel) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_ROSEL with outputsel */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_ROSEL; + ctl |= outputsel; + BKP_OCTL = ctl; +} + +/*! + \brief set RTC clock calibration value + \param[in] value: RTC clock calibration value + \arg 0x00 - 0x7F + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_value_set(uint8_t value) +{ + uint16_t ctl; + + /* configure BKP_OCTL_RCCV with value */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_RCCV; + ctl |= (uint16_t)OCTL_RCCV(value); + BKP_OCTL = ctl; +} + +/*! + \brief enable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_enable(void) +{ + BKP_TPCTL |= (uint16_t)BKP_TPCTL_TPEN; +} + +/*! + \brief disable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_disable(void) +{ + BKP_TPCTL &= (uint16_t)~BKP_TPCTL_TPEN; +} + +/*! + \brief set tamper pin active level + \param[in] level: tamper active level + only one parameter can be selected which is shown as below: + \arg TAMPER_PIN_ACTIVE_HIGH: the tamper pin is active high + \arg TAMPER_PIN_ACTIVE_LOW: the tamper pin is active low + \param[out] none + \retval none +*/ +void bkp_tamper_active_level_set(uint16_t level) +{ + uint16_t ctl = 0U; + + /* configure BKP_TPCTL_TPAL with level */ + ctl = BKP_TPCTL; + ctl &= (uint16_t)~BKP_TPCTL_TPAL; + ctl |= level; + BKP_TPCTL = ctl; +} + +/*! + \brief enable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_enable(void) +{ + BKP_TPCS |= (uint16_t)BKP_TPCS_TPIE; +} + +/*! + \brief disable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_disable(void) +{ + BKP_TPCS &= (uint16_t)~BKP_TPCS_TPIE; +} + +/*! + \brief get tamper flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} + +/*! + \brief get tamper interrupt flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_interrupt_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_INT_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper interrupt flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_INT_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_can.c new file mode 100644 index 0000000..eea114f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_can.c @@ -0,0 +1,1048 @@ +/*! + \file gd32f10x_can.c + \brief CAN driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_can.h" + +#define CAN_ERROR_HANDLE(s) do{}while(1) + +#define RFO1_CLEAR_VAL ((uint32_t)0x00000000U) /*!< RFO1 clear value */ +#define RFF1_CLEAR_VAL ((uint32_t)0x00000018U) /*!< RFF1 clear value */ + +/*! + \brief deinitialize CAN + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval none +*/ +void can_deinit(uint32_t can_periph) +{ +#ifdef GD32F10x_CL + if(CAN0 == can_periph){ + rcu_periph_reset_enable(RCU_CAN0RST); + rcu_periph_reset_disable(RCU_CAN0RST); + }else{ + rcu_periph_reset_enable(RCU_CAN1RST); + rcu_periph_reset_disable(RCU_CAN1RST); + } +#else + if(CAN0 == can_periph){ + rcu_periph_reset_enable(RCU_CAN0RST); + rcu_periph_reset_disable(RCU_CAN0RST); + } +#endif +} + +/*! + \brief initialize CAN parameter struct with a default value + \param[in] type: the type of CAN parameter struct + only one parameter can be selected which is shown as below: + \arg CAN_INIT_STRUCT: the CAN initial struct + \arg CAN_FILTER_STRUCT: the CAN filter struct + \arg CAN_TX_MESSAGE_STRUCT: the CAN TX message struct + \arg CAN_RX_MESSAGE_STRUCT: the CAN RX message struct + \param[in] p_struct: the pointer of the specific struct + \param[out] none + \retval none +*/ +void can_struct_para_init(can_struct_type_enum type, void* p_struct) +{ + uint8_t i; + + /* get type of the struct */ + switch(type){ + /* used for can_init() */ + case CAN_INIT_STRUCT: + ((can_parameter_struct*)p_struct)->auto_bus_off_recovery = DISABLE; + ((can_parameter_struct*)p_struct)->auto_retrans = DISABLE; + ((can_parameter_struct*)p_struct)->auto_wake_up = DISABLE; + ((can_parameter_struct*)p_struct)->prescaler = 0x03FFU; + ((can_parameter_struct*)p_struct)->rec_fifo_overwrite = DISABLE; + ((can_parameter_struct*)p_struct)->resync_jump_width = CAN_BT_SJW_1TQ; + ((can_parameter_struct*)p_struct)->time_segment_1 = CAN_BT_BS1_3TQ; + ((can_parameter_struct*)p_struct)->time_segment_2 = CAN_BT_BS2_1TQ; + ((can_parameter_struct*)p_struct)->time_triggered = DISABLE; + ((can_parameter_struct*)p_struct)->trans_fifo_order = DISABLE; + ((can_parameter_struct*)p_struct)->working_mode = CAN_NORMAL_MODE; + + break; + /* used for can_filter_init() */ + case CAN_FILTER_STRUCT: + ((can_filter_parameter_struct*)p_struct)->filter_bits = CAN_FILTERBITS_32BIT; + ((can_filter_parameter_struct*)p_struct)->filter_enable = DISABLE; + ((can_filter_parameter_struct*)p_struct)->filter_fifo_number = CAN_FIFO0; + ((can_filter_parameter_struct*)p_struct)->filter_list_high = 0x0000U; + ((can_filter_parameter_struct*)p_struct)->filter_list_low = 0x0000U; + ((can_filter_parameter_struct*)p_struct)->filter_mask_high = 0x0000U; + ((can_filter_parameter_struct*)p_struct)->filter_mask_low = 0x0000U; + ((can_filter_parameter_struct*)p_struct)->filter_mode = CAN_FILTERMODE_MASK; + ((can_filter_parameter_struct*)p_struct)->filter_number = 0U; + + break; + /* used for can_message_transmit() */ + case CAN_TX_MESSAGE_STRUCT: + for(i = 0U; i < 8U; i++){ + ((can_trasnmit_message_struct*)p_struct)->tx_data[i] = 0U; + } + + ((can_trasnmit_message_struct*)p_struct)->tx_dlen = 0u; + ((can_trasnmit_message_struct*)p_struct)->tx_efid = 0U; + ((can_trasnmit_message_struct*)p_struct)->tx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_trasnmit_message_struct*)p_struct)->tx_ft = (uint8_t)CAN_FT_DATA; + ((can_trasnmit_message_struct*)p_struct)->tx_sfid = 0U; + + break; + /* used for can_message_receive() */ + case CAN_RX_MESSAGE_STRUCT: + for(i = 0U; i < 8U; i++){ + ((can_receive_message_struct*)p_struct)->rx_data[i] = 0U; + } + + ((can_receive_message_struct*)p_struct)->rx_dlen = 0U; + ((can_receive_message_struct*)p_struct)->rx_efid = 0U; + ((can_receive_message_struct*)p_struct)->rx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_receive_message_struct*)p_struct)->rx_fi = 0U; + ((can_receive_message_struct*)p_struct)->rx_ft = (uint8_t)CAN_FT_DATA; + ((can_receive_message_struct*)p_struct)->rx_sfid = 0U; + + break; + + default: + CAN_ERROR_HANDLE("parameter is invalid \r\n"); + } +} + +/*! + \brief initialize CAN + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] can_parameter_init: parameters for CAN initializtion + \arg working_mode: CAN_NORMAL_MODE, CAN_LOOPBACK_MODE, CAN_SILENT_MODE, CAN_SILENT_LOOPBACK_MODE + \arg resync_jump_width: CAN_BT_SJW_xTQ(x=1, 2, 3, 4) + \arg time_segment_1: CAN_BT_BS1_xTQ(1..16) + \arg time_segment_2: CAN_BT_BS2_xTQ(1..8) + \arg time_triggered: ENABLE or DISABLE + \arg auto_bus_off_recovery: ENABLE or DISABLE + \arg auto_wake_up: ENABLE or DISABLE + \arg auto_retrans: ENABLE or DISABLE + \arg rec_fifo_overwrite: ENABLE or DISABLE + \arg trans_fifo_order: ENABLE or DISABLE + \arg prescaler: 0x0001 - 0x0400 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_init(uint32_t can_periph, can_parameter_struct* can_parameter_init) +{ + uint32_t timeout = CAN_TIMEOUT; + ErrStatus flag = ERROR; + + /* disable sleep mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + /* enable initialize mode */ + CAN_CTL(can_periph) |= CAN_CTL_IWMOD; + /* wait ACK */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)){ + timeout--; + } + /* check initialize working success */ + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)){ + flag = ERROR; + }else{ + /* set the bit timing register */ + CAN_BT(can_periph) = (BT_MODE((uint32_t)can_parameter_init->working_mode) | \ + BT_SJW((uint32_t)can_parameter_init->resync_jump_width) | \ + BT_BS1((uint32_t)can_parameter_init->time_segment_1) | \ + BT_BS2((uint32_t)can_parameter_init->time_segment_2) | \ + BT_BAUDPSC(((uint32_t)(can_parameter_init->prescaler) - 1U))); + + /* time trigger communication mode */ + if(ENABLE == can_parameter_init->time_triggered){ + CAN_CTL(can_periph) |= CAN_CTL_TTC; + }else{ + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + } + /* automatic bus-off managment */ + if(ENABLE == can_parameter_init->auto_bus_off_recovery){ + CAN_CTL(can_periph) |= CAN_CTL_ABOR; + }else{ + CAN_CTL(can_periph) &= ~CAN_CTL_ABOR; + } + /* automatic wakeup mode */ + if(ENABLE == can_parameter_init->auto_wake_up){ + CAN_CTL(can_periph) |= CAN_CTL_AWU; + }else{ + CAN_CTL(can_periph) &= ~CAN_CTL_AWU; + } + /* automatic retransmission mode */ + if(ENABLE == can_parameter_init->auto_retrans){ + CAN_CTL(can_periph) &= ~CAN_CTL_ARD; + }else{ + CAN_CTL(can_periph) |= CAN_CTL_ARD; + } + /* receive fifo overwrite mode */ + if(ENABLE == can_parameter_init->rec_fifo_overwrite){ + CAN_CTL(can_periph) &= ~CAN_CTL_RFOD; + }else{ + CAN_CTL(can_periph) |= CAN_CTL_RFOD; + } + /* transmit fifo order */ + if(ENABLE == can_parameter_init->trans_fifo_order){ + CAN_CTL(can_periph) |= CAN_CTL_TFO; + }else{ + CAN_CTL(can_periph) &= ~CAN_CTL_TFO; + } + /* disable initialize mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_IWMOD; + timeout = CAN_TIMEOUT; + /* wait the ACK */ + while((CAN_STAT_IWS == (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)){ + timeout--; + } + /* check exit initialize mode */ + if(0U != timeout){ + flag = SUCCESS; + } + } + return flag; +} + +/*! + \brief initialize CAN filter + \param[in] can_filter_parameter_init: struct for CAN filter initialization + \arg filter_list_high: 0x0000 - 0xFFFF + \arg filter_list_low: 0x0000 - 0xFFFF + \arg filter_mask_high: 0x0000 - 0xFFFF + \arg filter_mask_low: 0x0000 - 0xFFFF + \arg filter_fifo_number: CAN_FIFO0, CAN_FIFO1 + \arg filter_number: 0 - 27 + \arg filter_mode: CAN_FILTERMODE_MASK, CAN_FILTERMODE_LIST + \arg filter_bits: CAN_FILTERBITS_32BIT, CAN_FILTERBITS_16BIT + \arg filter_enable: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void can_filter_init(can_filter_parameter_struct* can_filter_parameter_init) +{ + uint32_t val = 0U; + + val = ((uint32_t)1) << (can_filter_parameter_init->filter_number); + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* disable filter */ + CAN_FW(CAN0) &= ~(uint32_t)val; + + /* filter 16 bits */ + if(CAN_FILTERBITS_16BIT == can_filter_parameter_init->filter_bits){ + /* set filter 16 bits */ + CAN_FSCFG(CAN0) &= ~(uint32_t)val; + /* first 16 bits list and first 16 bits mask or first 16 bits list and second 16 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* second 16 bits list and second 16 bits mask or third 16 bits list and fourth 16 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS); + } + /* filter 32 bits */ + if(CAN_FILTERBITS_32BIT == can_filter_parameter_init->filter_bits){ + /* set filter 32 bits */ + CAN_FSCFG(CAN0) |= (uint32_t)val; + /* 32 bits list or first 32 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* 32 bits mask or second 32 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS); + } + + /* filter mode */ + if(CAN_FILTERMODE_MASK == can_filter_parameter_init->filter_mode){ + /* mask mode */ + CAN_FMCFG(CAN0) &= ~(uint32_t)val; + }else{ + /* list mode */ + CAN_FMCFG(CAN0) |= (uint32_t)val; + } + + /* filter FIFO */ + if(CAN_FIFO0 == (can_filter_parameter_init->filter_fifo_number)){ + /* FIFO0 */ + CAN_FAFIFO(CAN0) &= ~(uint32_t)val; + }else{ + /* FIFO1 */ + CAN_FAFIFO(CAN0) |= (uint32_t)val; + } + + /* filter working */ + if(ENABLE == can_filter_parameter_init->filter_enable){ + + CAN_FW(CAN0) |= (uint32_t)val; + } + + /* filter lock enable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief set CAN1 fliter start bank number + \param[in] start_bank: CAN1 start bank number + only one parameter can be selected which is shown as below: + \arg (1..27) + \param[out] none + \retval none +*/ +void can1_filter_start_bank(uint8_t start_bank) +{ + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* set CAN1 filter start number */ + CAN_FCTL(CAN0) &= ~(uint32_t)CAN_FCTL_HBC1F; + CAN_FCTL(CAN0) |= FCTL_HBC1F(start_bank); + /* filter lock enaable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief enable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval none +*/ +void can_debug_freeze_enable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) |= CAN_CTL_DFZ; +#ifdef GD32F10x_CL + if(CAN0 == can_periph){ + dbg_periph_enable(DBG_CAN0_HOLD); + }else{ + dbg_periph_enable(DBG_CAN1_HOLD); + } +#else + if(CAN0 == can_periph){ + dbg_periph_enable(DBG_CAN0_HOLD); + } +#endif +} + +/*! + \brief disable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval none +*/ +void can_debug_freeze_disable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) &= ~CAN_CTL_DFZ; +#ifdef GD32F10x_CL + if(CAN0 == can_periph){ + dbg_periph_disable(DBG_CAN0_HOLD); + }else{ + dbg_periph_disable(DBG_CAN1_HOLD); + } +#else + if(CAN0 == can_periph){ + dbg_periph_enable(DBG_CAN0_HOLD); + } +#endif +} + +/*! + \brief enable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval none +*/ +void can_time_trigger_mode_enable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* enable the tcc mode */ + CAN_CTL(can_periph) |= CAN_CTL_TTC; + /* enable time stamp */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++){ + CAN_TMP(can_periph, mailbox_number) |= CAN_TMP_TSEN; + } +} + +/*! + \brief disable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval none +*/ +void can_time_trigger_mode_disable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* disable the TCC mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + /* reset TSEN bits */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++){ + CAN_TMP(can_periph, mailbox_number) &= ~CAN_TMP_TSEN; + } +} + +/*! + \brief transmit CAN message + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] transmit_message: struct for CAN transmit message + \arg tx_sfid: 0x00000000 - 0x000007FF + \arg tx_efid: 0x00000000 - 0x1FFFFFFF + \arg tx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg tx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg tx_dlen: 0 - 8 + \arg tx_data[]: 0x00 - 0xFF + \param[out] none + \retval mailbox_number +*/ +uint8_t can_message_transmit(uint32_t can_periph, can_trasnmit_message_struct* transmit_message) +{ + uint8_t mailbox_number = CAN_MAILBOX0; + + /* select one empty mailbox */ + if(CAN_TSTAT_TME0 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME0)){ + mailbox_number = CAN_MAILBOX0; + }else if(CAN_TSTAT_TME1 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME1)){ + mailbox_number = CAN_MAILBOX1; + }else if(CAN_TSTAT_TME2 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME2)){ + mailbox_number = CAN_MAILBOX2; + }else{ + mailbox_number = CAN_NOMAILBOX; + } + /* return no mailbox empty */ + if(CAN_NOMAILBOX == mailbox_number){ + return CAN_NOMAILBOX; + } + + CAN_TMI(can_periph, mailbox_number) &= CAN_TMI_TEN; + if(CAN_FF_STANDARD == transmit_message->tx_ff){ + /* set transmit mailbox standard identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_SFID(transmit_message->tx_sfid) | \ + transmit_message->tx_ft); + }else{ + /* set transmit mailbox extended identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_EFID(transmit_message->tx_efid) | \ + transmit_message->tx_ff | \ + transmit_message->tx_ft); + } + /* set the data length */ + CAN_TMP(can_periph, mailbox_number) &= ~CAN_TMP_DLENC; + CAN_TMP(can_periph, mailbox_number) |= transmit_message->tx_dlen; + /* set the data */ + CAN_TMDATA0(can_periph, mailbox_number) = TMDATA0_DB3(transmit_message->tx_data[3]) | \ + TMDATA0_DB2(transmit_message->tx_data[2]) | \ + TMDATA0_DB1(transmit_message->tx_data[1]) | \ + TMDATA0_DB0(transmit_message->tx_data[0]); + CAN_TMDATA1(can_periph, mailbox_number) = TMDATA1_DB7(transmit_message->tx_data[7]) | \ + TMDATA1_DB6(transmit_message->tx_data[6]) | \ + TMDATA1_DB5(transmit_message->tx_data[5]) | \ + TMDATA1_DB4(transmit_message->tx_data[4]); + /* enable transmission */ + CAN_TMI(can_periph, mailbox_number) |= CAN_TMI_TEN; + + return mailbox_number; +} + +/*! + \brief get CAN transmit state + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOX(x=0,1,2) + \param[out] none + \retval can_transmit_state_enum +*/ +can_transmit_state_enum can_transmit_states(uint32_t can_periph, uint8_t mailbox_number) +{ + can_transmit_state_enum state = CAN_TRANSMIT_FAILED; + uint32_t val = 0U; + + /* check selected mailbox state */ + switch(mailbox_number){ + /* mailbox0 */ + case CAN_MAILBOX0: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0); + break; + /* mailbox1 */ + case CAN_MAILBOX1: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1); + break; + /* mailbox2 */ + case CAN_MAILBOX2: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2); + break; + default: + val = CAN_TRANSMIT_FAILED; + break; + } + + switch(val){ + /* transmit pending */ + case (CAN_STATE_PENDING): + state = CAN_TRANSMIT_PENDING; + break; + /* mailbox0 transmit succeeded */ + case (CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0): + state = CAN_TRANSMIT_OK; + break; + /* mailbox1 transmit succeeded */ + case (CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1): + state = CAN_TRANSMIT_OK; + break; + /* mailbox2 transmit succeeded */ + case (CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2): + state = CAN_TRANSMIT_OK; + break; + /* transmit failed */ + default: + state = CAN_TRANSMIT_FAILED; + break; + } + return state; +} + +/*! + \brief stop CAN transmission + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOXx(x=0,1,2) + \param[out] none + \retval none +*/ +void can_transmission_stop(uint32_t can_periph, uint8_t mailbox_number) +{ + if(CAN_MAILBOX0 == mailbox_number){ + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST0; + while(CAN_TSTAT_MST0 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST0)){ + } + }else if(CAN_MAILBOX1 == mailbox_number){ + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST1; + while(CAN_TSTAT_MST1 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST1)){ + } + }else if(CAN_MAILBOX2 == mailbox_number){ + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST2; + while(CAN_TSTAT_MST2 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST2)){ + } + }else{ + /* illegal parameters */ + } +} + +/*! + \brief CAN receive message + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] fifo_number + \arg CAN_FIFOx(x=0,1) + \param[out] receive_message: struct for CAN receive message + \arg rx_sfid: 0x00000000 - 0x000007FF + \arg rx_efid: 0x00000000 - 0x1FFFFFFF + \arg rx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg rx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg rx_dlen: 0 - 8 + \arg rx_data[]: 0x00 - 0xFF + \arg rx_fi: 0 - 27 + \retval none +*/ +void can_message_receive(uint32_t can_periph, uint8_t fifo_number, can_receive_message_struct* receive_message) +{ + /* get the frame format */ + receive_message->rx_ff = (uint8_t)(CAN_RFIFOMI_FF & CAN_RFIFOMI(can_periph, fifo_number)); + if(CAN_FF_STANDARD == receive_message->rx_ff){ + /* get standard identifier */ + receive_message->rx_sfid = (uint32_t)(GET_RFIFOMI_SFID(CAN_RFIFOMI(can_periph, fifo_number))); + }else{ + /* get extended identifier */ + receive_message->rx_efid = (uint32_t)(GET_RFIFOMI_EFID(CAN_RFIFOMI(can_periph, fifo_number))); + } + + /* get frame type */ + receive_message->rx_ft = (uint8_t)(CAN_RFIFOMI_FT & CAN_RFIFOMI(can_periph, fifo_number)); + /* filtering index */ + receive_message->rx_fi = (uint8_t)(GET_RFIFOMP_FI(CAN_RFIFOMP(can_periph, fifo_number))); + /* get recevie data length */ + receive_message->rx_dlen = (uint8_t)(GET_RFIFOMP_DLENC(CAN_RFIFOMP(can_periph, fifo_number))); + + /* receive data */ + receive_message -> rx_data[0] = (uint8_t)(GET_RFIFOMDATA0_DB0(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message -> rx_data[1] = (uint8_t)(GET_RFIFOMDATA0_DB1(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message -> rx_data[2] = (uint8_t)(GET_RFIFOMDATA0_DB2(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message -> rx_data[3] = (uint8_t)(GET_RFIFOMDATA0_DB3(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message -> rx_data[4] = (uint8_t)(GET_RFIFOMDATA1_DB4(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message -> rx_data[5] = (uint8_t)(GET_RFIFOMDATA1_DB5(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message -> rx_data[6] = (uint8_t)(GET_RFIFOMDATA1_DB6(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message -> rx_data[7] = (uint8_t)(GET_RFIFOMDATA1_DB7(CAN_RFIFOMDATA1(can_periph, fifo_number))); + + /* release FIFO */ + if(CAN_FIFO0 == fifo_number){ + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + }else{ + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + } +} + +/*! + \brief release FIFO0 + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval none +*/ +void can_fifo_release(uint32_t can_periph, uint8_t fifo_number) +{ + if(CAN_FIFO0 == fifo_number){ + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + }else if(CAN_FIFO1 == fifo_number){ + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + }else{ + /* illegal parameters */ + CAN_ERROR_HANDLE("CAN FIFO NUM is invalid \r\n"); + } +} + +/*! + \brief CAN receive message length + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval message length +*/ +uint8_t can_receive_message_length_get(uint32_t can_periph, uint8_t fifo_number) +{ + uint8_t val = 0U; + + if(CAN_FIFO0 == fifo_number){ + /* FIFO0 */ + val = (uint8_t)(CAN_RFIFO0(can_periph) & CAN_RFIF_RFL_MASK); + }else if(CAN_FIFO1 == fifo_number){ + /* FIFO1 */ + val = (uint8_t)(CAN_RFIFO1(can_periph) & CAN_RFIF_RFL_MASK); + }else{ + /* illegal parameters */ + } + return val; +} + +/*! + \brief set CAN working mode + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] can_working_mode + only one parameter can be selected which is shown as below: + \arg CAN_MODE_INITIALIZE + \arg CAN_MODE_NORMAL + \arg CAN_MODE_SLEEP + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_working_mode_set(uint32_t can_periph, uint8_t working_mode) +{ + ErrStatus flag = ERROR; + /* timeout for IWS or also for SLPWS bits */ + uint32_t timeout = CAN_TIMEOUT; + + if(CAN_MODE_INITIALIZE == working_mode){ + /* disable sleep mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_SLPWMOD); + /* set initialize mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_IWMOD; + /* wait the acknowledge */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)){ + timeout--; + } + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)){ + flag = ERROR; + }else{ + flag = SUCCESS; + } + }else if(CAN_MODE_NORMAL == working_mode){ + /* enter normal mode */ + CAN_CTL(can_periph) &= ~(uint32_t)(CAN_CTL_SLPWMOD | CAN_CTL_IWMOD); + /* wait the acknowledge */ + while((0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) && (0U != timeout)){ + timeout--; + } + if(0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))){ + flag = ERROR; + }else{ + flag = SUCCESS; + } + }else if(CAN_MODE_SLEEP == working_mode){ + /* disable initialize mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_IWMOD); + /* set sleep mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_SLPWMOD; + /* wait the acknowledge */ + while((CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0U != timeout)){ + timeout--; + } + if(CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)){ + flag = ERROR; + }else{ + flag = SUCCESS; + } + }else{ + flag = ERROR; + } + return flag; +} + +/*! + \brief wake up CAN + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_wakeup(uint32_t can_periph) +{ + ErrStatus flag = ERROR; + uint32_t timeout = CAN_TIMEOUT; + + /* wakeup */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + + while((0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0x00U != timeout)){ + timeout--; + } + /* check state */ + if(0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)){ + flag = ERROR; + }else{ + flag = SUCCESS; + } + return flag; +} + +/*! + \brief get CAN error type + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval can_error_enum + \arg CAN_ERROR_NONE: no error + \arg CAN_ERROR_FILL: fill error + \arg CAN_ERROR_FORMATE: format error + \arg CAN_ERROR_ACK: ACK error + \arg CAN_ERROR_BITRECESSIVE: bit recessive + \arg CAN_ERROR_BITDOMINANTER: bit dominant error + \arg CAN_ERROR_CRC: CRC error + \arg CAN_ERROR_SOFTWARECFG: software configure +*/ +can_error_enum can_error_get(uint32_t can_periph) +{ + can_error_enum error; + error = CAN_ERROR_NONE; + + /* get error type */ + error = (can_error_enum)(GET_ERR_ERRN(CAN_ERR(can_periph))); + return error; +} + +/*! + \brief get CAN receive error number + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval error number +*/ +uint8_t can_receive_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + /* get error count */ + val = (uint8_t)(GET_ERR_RECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief get CAN transmit error number + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[out] none + \retval error number +*/ +uint8_t can_transmit_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + val = (uint8_t)(GET_ERR_TECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief enable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WAKEUP: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_enable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) |= interrupt; +} + +/*! + \brief disable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WAKEUP: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_disable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) &= ~interrupt; +} + +/*! + \brief get CAN flag state + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_RXL: RX level + \arg CAN_FLAG_LASTRX: last sample value of RX pin + \arg CAN_FLAG_RS: receiving state + \arg CAN_FLAG_TS: transmitting state + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_SLPWS: sleep working state + \arg CAN_FLAG_IWS: initial working state + \arg CAN_FLAG_TMLS2: transmit mailbox 2 last sending in Tx FIFO + \arg CAN_FLAG_TMLS1: transmit mailbox 1 last sending in Tx FIFO + \arg CAN_FLAG_TMLS0: transmit mailbox 0 last sending in Tx FIFO + \arg CAN_FLAG_TME2: transmit mailbox 2 empty + \arg CAN_FLAG_TME1: transmit mailbox 1 empty + \arg CAN_FLAG_TME0: transmit mailbox 0 empty + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \arg CAN_FLAG_BOERR: bus-off error + \arg CAN_FLAG_PERR: passive error + \arg CAN_FLAG_WERR: warning error + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_flag_get(uint32_t can_periph, can_flag_enum flag) +{ + /* get flag and interrupt enable state */ + if(RESET != (CAN_REG_VAL(can_periph, flag) & BIT(CAN_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CAN flag state + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \param[out] none + \retval none +*/ +void can_flag_clear(uint32_t can_periph, can_flag_enum flag) +{ + if (flag == CAN_FLAG_RFO1){ + CAN_REG_VAL(can_periph, flag) = RFO1_CLEAR_VAL; + } else if (flag == CAN_FLAG_RFF1){ + CAN_REG_VAL(can_periph, flag) = RFF1_CLEAR_VAL; + } else { + CAN_REG_VAL(can_periph, flag) = BIT(CAN_BIT_POS(flag)); + } +} + +/*! + \brief get CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFL0: receive FIFO0 not empty interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \arg CAN_INT_FLAG_RFL1: receive FIFO1 not empty interrupt flag + \arg CAN_INT_FLAG_ERRN: error number interrupt flag + \arg CAN_INT_FLAG_BOERR: bus-off error interrupt flag + \arg CAN_INT_FLAG_PERR: passive error interrupt flag + \arg CAN_INT_FLAG_WERR: warning error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_interrupt_flag_get(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + uint32_t ret1 = RESET; + uint32_t ret2 = RESET; + + /* get the staus of interrupt flag */ + if (flag == CAN_INT_FLAG_RFL0) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO0); + } else if (flag == CAN_INT_FLAG_RFL1) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO1); + } else if (flag == CAN_INT_FLAG_ERRN) { + ret1 = can_error_get(can_periph); + } else { + ret1 = CAN_REG_VALS(can_periph, flag) & BIT(CAN_BIT_POS0(flag)); + } + /* get the staus of interrupt enale bit */ + ret2 = CAN_INTEN(can_periph) & BIT(CAN_BIT_POS1(flag)); + if(ret1 && ret2){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1),the CAN1 only for GD32F10x_CL + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \param[out] none + \retval none +*/ +void can_interrupt_flag_clear(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + if (flag == CAN_INT_FLAG_RFO1){ + CAN_REG_VALS(can_periph, flag) = RFO1_CLEAR_VAL; + } else if (flag == CAN_INT_FLAG_RFF1){ + CAN_REG_VALS(can_periph, flag) = RFF1_CLEAR_VAL; + } else { + CAN_REG_VALS(can_periph, flag) = BIT(CAN_BIT_POS0(flag)); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_crc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_crc.c new file mode 100644 index 0000000..17fe26d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_crc.c @@ -0,0 +1,127 @@ +/*! + \file gd32f10x_crc.c + \brief CRC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_crc.h" + +#define CRC_DATA_RESET_VALUE ((uint32_t)0xFFFFFFFFU) +#define CRC_FDATA_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinit CRC calculation unit + \param[in] none + \param[out] none + \retval none +*/ +void crc_deinit(void) +{ + CRC_DATA = CRC_DATA_RESET_VALUE; + CRC_FDATA = CRC_FDATA_RESET_VALUE; + CRC_CTL = (uint32_t)CRC_CTL_RST; +} + +/*! + \brief reset data register to the value of initializaiton data register + \param[in] none + \param[out] none + \retval none +*/ +void crc_data_register_reset(void) +{ + CRC_CTL |= (uint32_t)CRC_CTL_RST; +} + +/*! + \brief read the value of the data register + \param[in] none + \param[out] none + \retval 32-bit value of the data register +*/ +uint32_t crc_data_register_read(void) +{ + uint32_t data; + data = CRC_DATA; + return (data); +} + +/*! + \brief read the value of the free data register + \param[in] none + \param[out] none + \retval 8-bit value of the free data register +*/ +uint8_t crc_free_data_register_read(void) +{ + uint8_t fdata; + fdata = (uint8_t)CRC_FDATA; + return (fdata); +} + +/*! + \brief write data to the free data register + \param[in] free_data: specify 8-bit data + \param[out] none + \retval none +*/ +void crc_free_data_register_write(uint8_t free_data) +{ + CRC_FDATA = (uint32_t)free_data; +} + +/*! + \brief calculate the CRC value of a 32-bit data + \param[in] sdata: specified 32-bit data + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_single_data_calculate(uint32_t sdata) +{ + CRC_DATA = sdata; + return (CRC_DATA); +} + +/*! + \brief calculate the CRC value of an array of 32-bit values + \param[in] array: pointer to an array of 32-bit values + \param[in] size: size of the array + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_block_data_calculate(uint32_t array[], uint32_t size) +{ + uint32_t index; + for(index = 0U; index < size; index++){ + CRC_DATA = array[index]; + } + return (CRC_DATA); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dac.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dac.c new file mode 100644 index 0000000..b636d54 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dac.c @@ -0,0 +1,540 @@ +/*! + \file gd32f10x_dac.c + \brief DAC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_dac.h" + +/* DAC register bit offset */ +#define OUT1_REG_OFFSET ((uint32_t)0x00000010U) +#define DH_12BIT_OFFSET ((uint32_t)0x00000010U) +#define DH_8BIT_OFFSET ((uint32_t)0x00000008U) + +/*! + \brief deinitialize DAC + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_deinit(uint32_t dac_periph) +{ + switch(dac_periph){ + case DAC0: + /* reset DAC0 */ + rcu_periph_reset_enable(RCU_DACRST); + rcu_periph_reset_disable(RCU_DACRST); + break; + default: + break; + } +} + +/*! + \brief enable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief get DAC output value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval DAC output data: 0~4095 +*/ +uint16_t dac_output_value_get(uint32_t dac_periph, uint8_t dac_out) +{ + uint16_t data = 0U; + + if(DAC_OUT0 == dac_out){ + /* store the DACx_OUT0 output value */ + data = (uint16_t)DAC_OUT0_DO(dac_periph); + }else if(DAC_OUT1 == dac_out){ + /* store the DACx_OUT1 output value */ + data = (uint16_t)DAC_OUT1_DO(dac_periph); + }else{ + /* illegal parameters */ + } + + return data; +} + +/*! + \brief set DAC data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data: data to be loaded(0~4095) + \param[out] none + \retval none +*/ +void dac_data_set(uint32_t dac_periph, uint8_t dac_out, uint32_t dac_align, uint16_t data) +{ + /* DAC_OUT0 data alignment */ + if(DAC_OUT0 == dac_out){ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT0_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT0_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT0_R8DH(dac_periph) = data; + break; + default: + break; + } + }else if(DAC_OUT1 == dac_out){ + /* DAC_OUT1 data alignment */ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT1_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT1_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT1_R8DH(dac_periph) = data; + break; + default: + break; + } + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC trigger source + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] triggersource: external trigger of DAC + only one parameter can be selected which is shown as below: + \arg DAC_TRIGGER_T5_TRGO: TIMER5 TRGO + \arg DAC_TRIGGER_T2_TRGO: TIMER2 TRGO, only for GD32F10X_CL devices + \arg DAC_TRIGGER_T7_TRGO: TIMER7 TRGO, only for GD32F10X_MD, GD32F10X_HD, GD32F10X_XD devices + \arg DAC_TRIGGER_T6_TRGO: TIMER6 TRGO + \arg DAC_TRIGGER_T4_TRGO: TIMER4 TRGO + \arg DAC_TRIGGER_T1_TRGO: TIMER1 TRGO + \arg DAC_TRIGGER_T3_TRGO: TIMER3 TRGO + \arg DAC_TRIGGER_EXTI_9: EXTI interrupt line9 event + \arg DAC_TRIGGER_SOFTWARE: software trigger + \param[out] none + \retval none +*/ +void dac_trigger_source_config(uint32_t dac_periph, uint8_t dac_out, uint32_t triggersource) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~(DAC_CTL0_DTSEL0)); + DAC_CTL0(dac_periph) |= triggersource; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~(DAC_CTL0_DTSEL1)); + DAC_CTL0(dac_periph) |= (triggersource << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC software trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \retval none +*/ +void dac_software_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR0; + }else if(DAC_OUT1 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC wave mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] wave_mode: DAC wave mode + only one parameter can be selected which is shown as below: + \arg DAC_WAVE_DISABLE: wave mode disable + \arg DAC_WAVE_MODE_LFSR: LFSR noise mode + \arg DAC_WAVE_MODE_TRIANGLE: triangle noise mode + \param[out] none + \retval none +*/ +void dac_wave_mode_config(uint32_t dac_periph, uint8_t dac_out, uint32_t wave_mode) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM0); + DAC_CTL0(dac_periph) |= wave_mode; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM1); + DAC_CTL0(dac_periph) |= (wave_mode << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC LFSR noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] unmask_bits: LFSR noise unmask bits + only one parameter can be selected which is shown as below: + \arg DAC_LFSR_BIT0: unmask the LFSR bit0 + \arg DAC_LFSR_BITS1_0: unmask the LFSR bits[1:0] + \arg DAC_LFSR_BITS2_0: unmask the LFSR bits[2:0] + \arg DAC_LFSR_BITS3_0: unmask the LFSR bits[3:0] + \arg DAC_LFSR_BITS4_0: unmask the LFSR bits[4:0] + \arg DAC_LFSR_BITS5_0: unmask the LFSR bits[5:0] + \arg DAC_LFSR_BITS6_0: unmask the LFSR bits[6:0] + \arg DAC_LFSR_BITS7_0: unmask the LFSR bits[7:0] + \arg DAC_LFSR_BITS8_0: unmask the LFSR bits[8:0] + \arg DAC_LFSR_BITS9_0: unmask the LFSR bits[9:0] + \arg DAC_LFSR_BITS10_0: unmask the LFSR bits[10:0] + \arg DAC_LFSR_BITS11_0: unmask the LFSR bits[11:0] + \param[out] none + \retval none +*/ +void dac_lfsr_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t unmask_bits) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= unmask_bits; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (unmask_bits << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC triangle noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] amplitude: the amplitude of the triangle + only one parameter can be selected which is shown as below: + \arg DAC_TRIANGLE_AMPLITUDE_1: triangle amplitude is 1 + \arg DAC_TRIANGLE_AMPLITUDE_3: triangle amplitude is 3 + \arg DAC_TRIANGLE_AMPLITUDE_7: triangle amplitude is 7 + \arg DAC_TRIANGLE_AMPLITUDE_15: triangle amplitude is 15 + \arg DAC_TRIANGLE_AMPLITUDE_31: triangle amplitude is 31 + \arg DAC_TRIANGLE_AMPLITUDE_63: triangle amplitude is 63 + \arg DAC_TRIANGLE_AMPLITUDE_127: triangle amplitude is 127 + \arg DAC_TRIANGLE_AMPLITUDE_255: triangle amplitude is 255 + \arg DAC_TRIANGLE_AMPLITUDE_511: triangle amplitude is 511 + \arg DAC_TRIANGLE_AMPLITUDE_1023: triangle amplitude is 1023 + \arg DAC_TRIANGLE_AMPLITUDE_2047: triangle amplitude is 2047 + \arg DAC_TRIANGLE_AMPLITUDE_4095: triangle amplitude is 4095 + \param[out] none + \retval none +*/ +void dac_triangle_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t amplitude) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= amplitude; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (amplitude << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief disable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief enable DAC concurrent software trigger + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_software_trigger_enable(uint32_t dac_periph) +{ + uint32_t swt = 0U; + + swt = (uint32_t)(DAC_SWT_SWTR0 | DAC_SWT_SWTR1); + DAC_SWT(dac_periph) |= (uint32_t)swt; +} + +/*! + \brief enable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief disable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief set DAC concurrent mode data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data0: data to be loaded(0~4095) + \param[in] data1: data to be loaded(0~4095) + \param[out] none + \retval none +*/ +void dac_concurrent_data_set(uint32_t dac_periph, uint32_t dac_align, uint16_t data0, uint16_t data1) +{ + uint32_t data = 0U; + + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_R12DH(dac_periph) = (uint32_t)data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_L12DH(dac_periph) = (uint32_t)data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + data = (uint32_t)(((uint32_t)data1 << DH_8BIT_OFFSET) | data0); + DACC_R8DH(dac_periph) = (uint32_t)data; + break; + default: + break; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dbg.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dbg.c new file mode 100644 index 0000000..5b236d3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dbg.c @@ -0,0 +1,149 @@ +/*! + \file gd32f10x_dbg.c + \brief DBG driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_dbg.h" + +/*! + \brief read DBG_ID code register + \param[in] none + \param[out] none + \retval DBG_ID code +*/ +uint32_t dbg_id_get(void) +{ + return DBG_ID; +} + +/*! + \brief enable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_enable(uint32_t dbg_low_power) +{ + DBG_CTL |= dbg_low_power; +} + +/*! + \brief disable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: donot keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: donot keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: donot keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_disable(uint32_t dbg_low_power) +{ + DBG_CTL &= ~dbg_low_power; +} + +/*! + \brief enable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CANx counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are not available for HD series): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_enable(dbg_periph_enum dbg_periph) +{ + DBG_CTL |= (uint32_t)dbg_periph; +} + +/*! + \brief disable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CAN0 counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are only available for XD and CL series): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_disable(dbg_periph_enum dbg_periph) +{ + DBG_CTL &= ~(uint32_t)dbg_periph; +} + +/*! + \brief enable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_enable(void) +{ + DBG_CTL |= DBG_CTL_TRACE_IOEN; +} + +/*! + \brief disable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_disable(void) +{ + DBG_CTL &= ~DBG_CTL_TRACE_IOEN; +} + +/*! + \brief trace pin mode selection + \param[in] trace_mode: + only one parameter can be selected which is shown as below: + \arg TRACE_MODE_ASYNC: trace pin used for async mode + \arg TRACE_MODE_SYNC_DATASIZE_1: trace pin used for sync mode and data size is 1 + \arg TRACE_MODE_SYNC_DATASIZE_2: trace pin used for sync mode and data size is 2 + \arg TRACE_MODE_SYNC_DATASIZE_4: trace pin used for sync mode and data size is 4 + \param[out] none + \retval none +*/ +void dbg_trace_pin_mode_set(uint32_t trace_mode) +{ + DBG_CTL &= ~DBG_CTL_TRACE_MODE; + DBG_CTL |= trace_mode; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dma.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dma.c new file mode 100644 index 0000000..8219744 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dma.c @@ -0,0 +1,733 @@ +/*! + \file gd32f10x_dma.c + \brief DMA driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_dma.h" + +#define DMA_WRONG_HANDLE while(1){} + + /* check whether peripheral matches channels or not */ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx); + +/*! + \brief deinitialize DMA a channel registers + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel is deinitialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_deinit(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* disable DMA a channel */ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; + /* reset DMA channel registers */ + DMA_CHCTL(dma_periph, channelx) = DMA_CHCTL_RESET_VALUE; + DMA_CHCNT(dma_periph, channelx) = DMA_CHCNT_RESET_VALUE; + DMA_CHPADDR(dma_periph, channelx) = DMA_CHPADDR_RESET_VALUE; + DMA_CHMADDR(dma_periph, channelx) = DMA_CHMADDR_RESET_VALUE; + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(DMA_CHINTF_RESET_VALUE, channelx); +} + +/*! + \brief initialize the parameters of DMA struct with the default values + \param[in] init_struct: the initialization data needed to initialize DMA channel + \param[out] none + \retval none +*/ +void dma_struct_para_init(dma_parameter_struct* init_struct) +{ + /* set the DMA struct with the default values */ + init_struct->periph_addr = 0U; + init_struct->periph_width = 0U; + init_struct->periph_inc = DMA_PERIPH_INCREASE_DISABLE; + init_struct->memory_addr = 0U; + init_struct->memory_width = 0U; + init_struct->memory_inc = DMA_MEMORY_INCREASE_DISABLE; + init_struct->number = 0U; + init_struct->direction = DMA_PERIPHERAL_TO_MEMORY; + init_struct->priority = DMA_PRIORITY_LOW; +} + +/*! + \brief initialize DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel is initialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] init_struct: the data needed to initialize DMA channel + periph_addr: peripheral base address + periph_width: DMA_PERIPHERAL_WIDTH_8BIT, DMA_PERIPHERAL_WIDTH_16BIT, DMA_PERIPHERAL_WIDTH_32BIT + periph_inc: DMA_PERIPH_INCREASE_ENABLE, DMA_PERIPH_INCREASE_DISABLE + memory_addr: memory base address + memory_width: DMA_MEMORY_WIDTH_8BIT, DMA_MEMORY_WIDTH_16BIT, DMA_MEMORY_WIDTH_32BIT + memory_inc: DMA_MEMORY_INCREASE_ENABLE, DMA_MEMORY_INCREASE_DISABLE + direction: DMA_PERIPHERAL_TO_MEMORY, DMA_MEMORY_TO_PERIPHERAL + number: the number of remaining data to be transferred by the DMA + priority: DMA_PRIORITY_LOW, DMA_PRIORITY_MEDIUM, DMA_PRIORITY_HIGH, DMA_PRIORITY_ULTRA_HIGH + \param[out] none + \retval none +*/ +void dma_init(uint32_t dma_periph, dma_channel_enum channelx, dma_parameter_struct *init_struct) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* configure peripheral base address */ + DMA_CHPADDR(dma_periph, channelx) = init_struct->periph_addr; + + /* configure memory base address */ + DMA_CHMADDR(dma_periph, channelx) = init_struct->memory_addr; + + /* configure the number of remaining data to be transferred */ + DMA_CHCNT(dma_periph, channelx) = (init_struct->number & DMA_CHANNEL_CNT_MASK); + + /* configure peripheral transfer width,memory transfer width, */ + ctl = DMA_CHCTL(dma_periph, channelx); + ctl &= ~(DMA_CHXCTL_PWIDTH | DMA_CHXCTL_MWIDTH | DMA_CHXCTL_PRIO); + ctl |= (init_struct->periph_width | init_struct->memory_width | init_struct->priority); + DMA_CHCTL(dma_periph, channelx) = ctl; + + /* configure peripheral increasing mode */ + if(DMA_PERIPH_INCREASE_ENABLE == init_struct->periph_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; + } + + /* configure memory increasing mode */ + if(DMA_MEMORY_INCREASE_ENABLE == init_struct->memory_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; + } + + /* configure the direction of data transfer */ + if(DMA_PERIPHERAL_TO_MEMORY == init_struct->direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + }else{ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief enable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CMEN; +} + +/*! + \brief disable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CMEN; +} + +/*! + \brief enable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_M2M; +} + +/*! + \brief disable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_M2M; +} + +/*! + \brief enable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CHEN; +} + +/*! + \brief disable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; +} + +/*! + \brief set DMA peripheral base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to set peripheral base address + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: peripheral base address + \param[out] none + \retval none +*/ +void dma_periph_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHPADDR(dma_periph, channelx) = address; +} + +/*! + \brief set DMA memory base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to set memory base address + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: memory base address + \param[out] none + \retval none +*/ +void dma_memory_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHMADDR(dma_periph, channelx) = address; +} + +/*! + \brief set the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to set number + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] number: the number of remaining data to be transferred by the DMA + \arg 0x0000-0xFFFF + \param[out] none + \retval none +*/ +void dma_transfer_number_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t number) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCNT(dma_periph, channelx) = (number & DMA_CHANNEL_CNT_MASK); +} + +/*! + \brief get the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to set number + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval uint32_t: the number of remaining data to be transferred by the DMA +*/ +uint32_t dma_transfer_number_get(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + return (uint32_t)DMA_CHCNT(dma_periph, channelx); +} + +/*! + \brief configure priority level of DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] priority: priority Level of this channel + only one parameter can be selected which is shown as below: + \arg DMA_PRIORITY_LOW: low priority + \arg DMA_PRIORITY_MEDIUM: medium priority + \arg DMA_PRIORITY_HIGH: high priority + \arg DMA_PRIORITY_ULTRA_HIGH: ultra high priority + \param[out] none + \retval none +*/ +void dma_priority_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t priority) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign regiser */ + ctl &= ~DMA_CHXCTL_PRIO; + ctl |= priority; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] mwidth: transfer data width of memory + only one parameter can be selected which is shown as below: + \arg DMA_MEMORY_WIDTH_8BIT: transfer data width of memory is 8-bit + \arg DMA_MEMORY_WIDTH_16BIT: transfer data width of memory is 16-bit + \arg DMA_MEMORY_WIDTH_32BIT: transfer data width of memory is 32-bit + \param[out] none + \retval none +*/ +void dma_memory_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t mwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign regiser */ + ctl &= ~DMA_CHXCTL_MWIDTH; + ctl |= mwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] pwidth: transfer data width of peripheral + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_WIDTH_8BIT: transfer data width of peripheral is 8-bit + \arg DMA_PERIPHERAL_WIDTH_16BIT: transfer data width of peripheral is 16-bit + \arg DMA_PERIPHERAL_WIDTH_32BIT: transfer data width of peripheral is 32-bit + \param[out] none + \retval none +*/ +void dma_periph_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t pwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign regiser */ + ctl &= ~DMA_CHXCTL_PWIDTH; + ctl |= pwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief enable next address increasement algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; +} + +/*! + \brief disable next address increasement algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; +} + +/*! + \brief enable next address increasement algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; +} + +/*! + \brief disable next address increasement algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; +} + +/*! + \brief configure the direction of data transfer on the channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] direction: specify the direction of data transfer + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_TO_MEMORY: read from peripheral and write to memory + \arg DMA_MEMORY_TO_PERIPHERAL: read from memory and write to peripheral + \param[out] none + \retval none +*/ +void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint8_t direction) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + if(DMA_PERIPHERAL_TO_MEMORY == direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + } else { + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief check DMA flag is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to get flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + FlagStatus reval; + + /* check whether the flag is set or not */ + if(RESET != (DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx))){ + reval = SET; + }else{ + reval = RESET; + } + + return reval; +} + +/*! + \brief clear the flag of a DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to clear flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval none +*/ +void dma_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief check DMA flag and interrupt enable bit is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to get flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_interrupt_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + uint32_t interrupt_enable = 0U, interrupt_flag = 0U; + + switch(flag){ + case DMA_INT_FLAG_FTF: + /* check whether the full transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_FTFIE; + break; + case DMA_INT_FLAG_HTF: + /* check whether the half transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_HTFIE; + break; + case DMA_INT_FLAG_ERR: + /* check whether the error interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_ERRIE; + break; + default: + DMA_WRONG_HANDLE + } + + /* when the interrupt flag is set and enabled, return SET */ + if(interrupt_flag && interrupt_enable){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear DMA a channel flag + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel to clear flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_G: global interrupt flag of channel + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval none +*/ +void dma_interrupt_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief enable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to enbale + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_enable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= source; +} + +/*! + \brief disable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to disbale + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_disable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~source; +} + +/*! + \brief check whether peripheral and channels match + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specify which DMA channel + only one parameter can be selected which is shown as below: + \arg DMA_CHx(x=0..6) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx) +{ + ErrStatus val = SUCCESS; + + if(DMA1 == dma_periph){ + /* for DMA1, the channel is from DMA_CH0 to DMA_CH4 */ + if(channelx > DMA_CH4){ + val = ERROR; + } + } + + return val; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_enet.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_enet.c new file mode 100644 index 0000000..c0cdc33 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_enet.c @@ -0,0 +1,3081 @@ +/*! + \file gd32f10x_enet.c + \brief ENET driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_enet.h" + +#ifdef GD32F10X_CL + +#if defined (__CC_ARM) /*!< ARM compiler */ +__align(4) +enet_descriptors_struct rxdesc_tab[ENET_RXBUF_NUM]; /*!< ENET RxDMA descriptor */ +__align(4) +enet_descriptors_struct txdesc_tab[ENET_TXBUF_NUM]; /*!< ENET TxDMA descriptor */ +__align(4) +uint8_t rx_buff[ENET_RXBUF_NUM][ENET_RXBUF_SIZE]; /*!< ENET receive buffer */ +__align(4) +uint8_t tx_buff[ENET_TXBUF_NUM][ENET_TXBUF_SIZE]; /*!< ENET transmit buffer */ + +#elif defined ( __ICCARM__ ) /*!< IAR compiler */ +#pragma data_alignment=4 +enet_descriptors_struct rxdesc_tab[ENET_RXBUF_NUM]; /*!< ENET RxDMA descriptor */ +#pragma data_alignment=4 +enet_descriptors_struct txdesc_tab[ENET_TXBUF_NUM]; /*!< ENET TxDMA descriptor */ +#pragma data_alignment=4 +uint8_t rx_buff[ENET_RXBUF_NUM][ENET_RXBUF_SIZE]; /*!< ENET receive buffer */ +#pragma data_alignment=4 +uint8_t tx_buff[ENET_TXBUF_NUM][ENET_TXBUF_SIZE]; /*!< ENET transmit buffer */ + +#elif defined (__GNUC__) /* GNU Compiler */ +enet_descriptors_struct rxdesc_tab[ENET_RXBUF_NUM] __attribute__ ((aligned (4))); /*!< ENET RxDMA descriptor */ +enet_descriptors_struct txdesc_tab[ENET_TXBUF_NUM] __attribute__ ((aligned (4))); /*!< ENET TxDMA descriptor */ +uint8_t rx_buff[ENET_RXBUF_NUM][ENET_RXBUF_SIZE] __attribute__ ((aligned (4))); /*!< ENET receive buffer */ +uint8_t tx_buff[ENET_TXBUF_NUM][ENET_TXBUF_SIZE] __attribute__ ((aligned (4))); /*!< ENET transmit buffer */ + +#endif /* __CC_ARM */ + +/* global transmit and receive descriptors pointers */ +enet_descriptors_struct *dma_current_txdesc; +enet_descriptors_struct *dma_current_rxdesc; + +/* structure pointer of ptp descriptor for normal mode */ +enet_descriptors_struct *dma_current_ptp_txdesc = NULL; +enet_descriptors_struct *dma_current_ptp_rxdesc = NULL; + +/* init structure parameters for ENET initialization */ +static enet_initpara_struct enet_initpara ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + +static uint32_t enet_unknow_err = 0U; + +/* array of register offset for debug information get */ +static const uint16_t enet_reg_tab[] = { +0x0000, 0x0004, 0x0008, 0x000C, 0x0010, 0x0014, 0x0018, 0x1080, 0x001C, 0x0028, 0x002C, +0x0038, 0x003C, 0x0040, 0x0044, 0x0048, 0x004C, 0x0050, 0x0054, 0x0058, 0x005C, + +0x0100, 0x0104, 0x0108, 0x010C, 0x0110, 0x014C, 0x0150, 0x0168, 0x0194, 0x0198, 0x01C4, + +0x0700, 0x0704,0x0708, 0x070C, 0x0710, 0x0714, 0x0718, 0x071C, 0x0720, + +0x1000, 0x1004, 0x1008, 0x100C, 0x1010, 0x1014, 0x1018, 0x101C, 0x1020, 0x1048, 0x104C, +0x1050, 0x1054}; + + +/*! + \brief deinitialize the ENET, and reset structure parameters for ENET initialization + \param[in] none + \param[out] none + \retval none +*/ +void enet_deinit(void) +{ + rcu_periph_reset_enable(RCU_ENETRST); + rcu_periph_reset_disable(RCU_ENETRST); + enet_initpara_reset(); +} + +/*! + \brief configure the parameters which are usually less cared for initialization + note -- this function must be called before enet_init(), otherwise + configuration will be no effect + \param[in] option: different function option, which is related to several parameters, + only one parameter can be selected which is shown as below, refer to enet_option_enum + \arg FORWARD_OPTION: choose to configure the frame forward related parameters + \arg DMABUS_OPTION: choose to configure the DMA bus mode related parameters + \arg DMA_MAXBURST_OPTION: choose to configure the DMA max burst related parameters + \arg DMA_ARBITRATION_OPTION: choose to configure the DMA arbitration related parameters + \arg STORE_OPTION: choose to configure the store forward mode related parameters + \arg DMA_OPTION: choose to configure the DMA descriptor related parameters + \arg VLAN_OPTION: choose to configure vlan related parameters + \arg FLOWCTL_OPTION: choose to configure flow control related parameters + \arg HASHH_OPTION: choose to configure hash high + \arg HASHL_OPTION: choose to configure hash low + \arg FILTER_OPTION: choose to configure frame filter related parameters + \arg HALFDUPLEX_OPTION: choose to configure halfduplex mode related parameters + \arg TIMER_OPTION: choose to configure time counter related parameters + \arg INTERFRAMEGAP_OPTION: choose to configure the inter frame gap related parameters + \param[in] para: the related parameters according to the option + all the related parameters should be configured which are shown as below + FORWARD_OPTION related parameters: + - ENET_AUTO_PADCRC_DROP_ENABLE/ ENET_AUTO_PADCRC_DROP_DISABLE ; + - ENET_FORWARD_ERRFRAMES_ENABLE/ ENET_FORWARD_ERRFRAMES_DISABLE ; + - ENET_FORWARD_UNDERSZ_GOODFRAMES_ENABLE/ ENET_FORWARD_UNDERSZ_GOODFRAMES_DISABLE . + DMABUS_OPTION related parameters: + - ENET_ADDRESS_ALIGN_ENABLE/ ENET_ADDRESS_ALIGN_DISABLE ; + - ENET_FIXED_BURST_ENABLE/ ENET_FIXED_BURST_DISABLE ; + DMA_MAXBURST_OPTION related parameters: + - ENET_RXDP_1BEAT/ ENET_RXDP_2BEAT/ ENET_RXDP_4BEAT/ + ENET_RXDP_8BEAT/ ENET_RXDP_16BEAT/ ENET_RXDP_32BEAT/ + ENET_RXDP_4xPGBL_4BEAT/ ENET_RXDP_4xPGBL_8BEAT/ + ENET_RXDP_4xPGBL_16BEAT/ ENET_RXDP_4xPGBL_32BEAT/ + ENET_RXDP_4xPGBL_64BEAT/ ENET_RXDP_4xPGBL_128BEAT ; + - ENET_PGBL_1BEAT/ ENET_PGBL_2BEAT/ ENET_PGBL_4BEAT/ + ENET_PGBL_8BEAT/ ENET_PGBL_16BEAT/ ENET_PGBL_32BEAT/ + ENET_PGBL_4xPGBL_4BEAT/ ENET_PGBL_4xPGBL_8BEAT/ + ENET_PGBL_4xPGBL_16BEAT/ ENET_PGBL_4xPGBL_32BEAT/ + ENET_PGBL_4xPGBL_64BEAT/ ENET_PGBL_4xPGBL_128BEAT ; + - ENET_RXTX_DIFFERENT_PGBL/ ENET_RXTX_SAME_PGBL ; + DMA_ARBITRATION_OPTION related parameters: + - ENET_ARBITRATION_RXPRIORTX / ENET_ARBITRATION_RXTX_1_1 + / ENET_ARBITRATION_RXTX_2_1/ ENET_ARBITRATION_RXTX_3_1 + / ENET_ARBITRATION_RXTX_4_1. + STORE_OPTION related parameters: + - ENET_RX_MODE_STOREFORWARD/ ENET_RX_MODE_CUTTHROUGH ; + - ENET_TX_MODE_STOREFORWARD/ ENET_TX_MODE_CUTTHROUGH ; + - ENET_RX_THRESHOLD_64BYTES/ ENET_RX_THRESHOLD_32BYTES/ + ENET_RX_THRESHOLD_96BYTES/ ENET_RX_THRESHOLD_128BYTES ; + - ENET_TX_THRESHOLD_64BYTES/ ENET_TX_THRESHOLD_128BYTES/ + ENET_TX_THRESHOLD_192BYTES/ ENET_TX_THRESHOLD_256BYTES/ + ENET_TX_THRESHOLD_40BYTES/ ENET_TX_THRESHOLD_32BYTES/ + ENET_TX_THRESHOLD_24BYTES/ ENET_TX_THRESHOLD_16BYTES . + DMA_OPTION related parameters: + - ENET_FLUSH_RXFRAME_ENABLE/ ENET_FLUSH_RXFRAME_DISABLE ; + - ENET_SECONDFRAME_OPT_ENABLE/ ENET_SECONDFRAME_OPT_DISABLE . + VLAN_OPTION related parameters: + - ENET_VLANTAGCOMPARISON_12BIT/ ENET_VLANTAGCOMPARISON_16BIT ; + - MAC_VLT_VLTI(regval) . + FLOWCTL_OPTION related parameters: + - MAC_FCTL_PTM(regval) ; + - ENET_ZERO_QUANTA_PAUSE_ENABLE/ ENET_ZERO_QUANTA_PAUSE_DISABLE ; + - ENET_PAUSETIME_MINUS4/ ENET_PAUSETIME_MINUS28/ + ENET_PAUSETIME_MINUS144/ENET_PAUSETIME_MINUS256 ; + - ENET_MAC0_AND_UNIQUE_ADDRESS_PAUSEDETECT/ ENET_UNIQUE_PAUSEDETECT ; + - ENET_RX_FLOWCONTROL_ENABLE/ ENET_RX_FLOWCONTROL_DISABLE ; + - ENET_TX_FLOWCONTROL_ENABLE/ ENET_TX_FLOWCONTROL_DISABLE ; + - ENET_ACTIVE_THRESHOLD_256BYTES/ ENET_ACTIVE_THRESHOLD_512BYTES ; + - ENET_ACTIVE_THRESHOLD_768BYTES/ ENET_ACTIVE_THRESHOLD_1024BYTES ; + - ENET_ACTIVE_THRESHOLD_1280BYTES/ ENET_ACTIVE_THRESHOLD_1536BYTES ; + - ENET_ACTIVE_THRESHOLD_1792BYTES ; + - ENET_DEACTIVE_THRESHOLD_256BYTES/ ENET_DEACTIVE_THRESHOLD_512BYTES ; + - ENET_DEACTIVE_THRESHOLD_768BYTES/ ENET_DEACTIVE_THRESHOLD_1024BYTES ; + - ENET_DEACTIVE_THRESHOLD_1280BYTES/ ENET_DEACTIVE_THRESHOLD_1536BYTES ; + - ENET_DEACTIVE_THRESHOLD_1792BYTES . + HASHH_OPTION related parameters: + - 0x0~0xFFFF FFFFU + HASHL_OPTION related parameters: + - 0x0~0xFFFF FFFFU + FILTER_OPTION related parameters: + - ENET_SRC_FILTER_NORMAL_ENABLE/ ENET_SRC_FILTER_INVERSE_ENABLE/ + ENET_SRC_FILTER_DISABLE ; + - ENET_DEST_FILTER_INVERSE_ENABLE/ ENET_DEST_FILTER_INVERSE_DISABLE ; + - ENET_MULTICAST_FILTER_HASH_OR_PERFECT/ ENET_MULTICAST_FILTER_HASH/ + ENET_MULTICAST_FILTER_PERFECT/ ENET_MULTICAST_FILTER_NONE ; + - ENET_UNICAST_FILTER_EITHER/ ENET_UNICAST_FILTER_HASH/ + ENET_UNICAST_FILTER_PERFECT ; + - ENET_PCFRM_PREVENT_ALL/ ENET_PCFRM_PREVENT_PAUSEFRAME/ + ENET_PCFRM_FORWARD_ALL/ ENET_PCFRM_FORWARD_FILTERED . + HALFDUPLEX_OPTION related parameters: + - ENET_CARRIERSENSE_ENABLE/ ENET_CARRIERSENSE_DISABLE ; + - ENET_RECEIVEOWN_ENABLE/ ENET_RECEIVEOWN_DISABLE ; + - ENET_RETRYTRANSMISSION_ENABLE/ ENET_RETRYTRANSMISSION_DISABLE ; + - ENET_BACKOFFLIMIT_10/ ENET_BACKOFFLIMIT_8/ + ENET_BACKOFFLIMIT_4/ ENET_BACKOFFLIMIT_1 ; + - ENET_DEFERRALCHECK_ENABLE/ ENET_DEFERRALCHECK_DISABLE . + TIMER_OPTION related parameters: + - ENET_WATCHDOG_ENABLE/ ENET_WATCHDOG_DISABLE ; + - ENET_JABBER_ENABLE/ ENET_JABBER_DISABLE ; + INTERFRAMEGAP_OPTION related parameters: + - ENET_INTERFRAMEGAP_96BIT/ ENET_INTERFRAMEGAP_88BIT/ + ENET_INTERFRAMEGAP_80BIT/ ENET_INTERFRAMEGAP_72BIT/ + ENET_INTERFRAMEGAP_64BIT/ ENET_INTERFRAMEGAP_56BIT/ + ENET_INTERFRAMEGAP_48BIT/ ENET_INTERFRAMEGAP_40BIT . + \param[out] none + \retval none +*/ +void enet_initpara_config(enet_option_enum option, uint32_t para) +{ + switch(option){ + case FORWARD_OPTION: + /* choose to configure forward_frame, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)FORWARD_OPTION; + enet_initpara.forward_frame = para; + break; + case DMABUS_OPTION: + /* choose to configure dmabus_mode, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)DMABUS_OPTION; + enet_initpara.dmabus_mode = para; + break; + case DMA_MAXBURST_OPTION: + /* choose to configure dma_maxburst, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)DMA_MAXBURST_OPTION; + enet_initpara.dma_maxburst = para; + break; + case DMA_ARBITRATION_OPTION: + /* choose to configure dma_arbitration, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)DMA_ARBITRATION_OPTION; + enet_initpara.dma_arbitration = para; + break; + case STORE_OPTION: + /* choose to configure store_forward_mode, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)STORE_OPTION; + enet_initpara.store_forward_mode = para; + break; + case DMA_OPTION: + /* choose to configure dma_function, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)DMA_OPTION; + enet_initpara.dma_function = para; + break; + case VLAN_OPTION: + /* choose to configure vlan_config, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)VLAN_OPTION; + enet_initpara.vlan_config = para; + break; + case FLOWCTL_OPTION: + /* choose to configure flow_control, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)FLOWCTL_OPTION; + enet_initpara.flow_control = para; + break; + case HASHH_OPTION: + /* choose to configure hashtable_high, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)HASHH_OPTION; + enet_initpara.hashtable_high = para; + break; + case HASHL_OPTION: + /* choose to configure hashtable_low, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)HASHL_OPTION; + enet_initpara.hashtable_low = para; + break; + case FILTER_OPTION: + /* choose to configure framesfilter_mode, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)FILTER_OPTION; + enet_initpara.framesfilter_mode = para; + break; + case HALFDUPLEX_OPTION: + /* choose to configure halfduplex_param, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)HALFDUPLEX_OPTION; + enet_initpara.halfduplex_param = para; + break; + case TIMER_OPTION: + /* choose to configure timer_config, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)TIMER_OPTION; + enet_initpara.timer_config = para; + break; + case INTERFRAMEGAP_OPTION: + /* choose to configure interframegap, and save the configuration parameters */ + enet_initpara.option_enable |= (uint32_t)INTERFRAMEGAP_OPTION; + enet_initpara.interframegap = para; + break; + default: + break; + } +} + +/*! + \brief initialize ENET peripheral with generally concerned parameters and the less cared + parameters + \param[in] mediamode: PHY mode and mac loopback configurations, only one parameter can be selected + which is shown as below, refer to enet_mediamode_enum + \arg ENET_AUTO_NEGOTIATION: PHY auto negotiation + \arg ENET_100M_FULLDUPLEX: 100Mbit/s, full-duplex + \arg ENET_100M_HALFDUPLEX: 100Mbit/s, half-duplex + \arg ENET_10M_FULLDUPLEX: 10Mbit/s, full-duplex + \arg ENET_10M_HALFDUPLEX: 10Mbit/s, half-duplex + \arg ENET_LOOPBACKMODE: MAC in loopback mode at the MII + \param[in] checksum: IP frame checksum offload function, only one parameter can be selected + which is shown as below, refer to enet_mediamode_enum + \arg ENET_NO_AUTOCHECKSUM: disable IP frame checksum function + \arg ENET_AUTOCHECKSUM_DROP_FAILFRAMES: enable IP frame checksum function + \arg ENET_AUTOCHECKSUM_ACCEPT_FAILFRAMES: enable IP frame checksum function, and the received frame + with only payload error but no other errors will not be dropped + \param[in] recept: frame filter function, only one parameter can be selected + which is shown as below, refer to enet_frmrecept_enum + \arg ENET_PROMISCUOUS_MODE: promiscuous mode enabled + \arg ENET_RECEIVEALL: all received frame are forwarded to application + \arg ENET_BROADCAST_FRAMES_PASS: the address filters pass all received broadcast frames + \arg ENET_BROADCAST_FRAMES_DROP: the address filters filter all incoming broadcast frames + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus enet_init(enet_mediamode_enum mediamode, enet_chksumconf_enum checksum, enet_frmrecept_enum recept) +{ + uint32_t reg_value=0U, reg_temp = 0U, temp = 0U; + uint32_t media_temp = 0U; + uint32_t timeout = 0U; + uint16_t phy_value = 0U; + ErrStatus phy_state= ERROR, enet_state = ERROR; + + /* PHY interface configuration, configure SMI clock and reset PHY chip */ + if(ERROR == enet_phy_config()){ + _ENET_DELAY_(PHY_RESETDELAY); + if(ERROR == enet_phy_config()){ + return enet_state; + } + } + /* initialize ENET peripheral with generally concerned parameters */ + enet_default_init(); + + /* 1st, configure mediamode */ + media_temp = (uint32_t)mediamode; + /* if is PHY auto negotiation */ + if((uint32_t)ENET_AUTO_NEGOTIATION == media_temp){ + /* wait for PHY_LINKED_STATUS bit be set */ + do{ + enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_REG_BSR, &phy_value); + phy_value &= PHY_LINKED_STATUS; + timeout++; + }while((RESET == phy_value) && (timeout < PHY_READ_TO)); + /* return ERROR due to timeout */ + if(PHY_READ_TO == timeout){ + return enet_state; + } + /* reset timeout counter */ + timeout = 0U; + + /* enable auto-negotiation */ + phy_value = PHY_AUTONEGOTIATION; + phy_state = enet_phy_write_read(ENET_PHY_WRITE, PHY_ADDRESS, PHY_REG_BCR, &phy_value); + if(!phy_state){ + /* return ERROR due to write timeout */ + return enet_state; + } + + /* wait for the PHY_AUTONEGO_COMPLETE bit be set */ + do{ + enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_REG_BSR, &phy_value); + phy_value &= PHY_AUTONEGO_COMPLETE; + timeout++; + }while((RESET == phy_value) && (timeout < (uint32_t)PHY_READ_TO)); + /* return ERROR due to timeout */ + if(PHY_READ_TO == timeout){ + return enet_state; + } + /* reset timeout counter */ + timeout = 0U; + + /* read the result of the auto-negotiation */ + enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_SR, &phy_value); + /* configure the duplex mode of MAC following the auto-negotiation result */ + if((uint16_t)RESET != (phy_value & PHY_DUPLEX_STATUS)){ + media_temp = ENET_MODE_FULLDUPLEX; + }else{ + media_temp = ENET_MODE_HALFDUPLEX; + } + /* configure the communication speed of MAC following the auto-negotiation result */ + if((uint16_t)RESET !=(phy_value & PHY_SPEED_STATUS)){ + media_temp |= ENET_SPEEDMODE_10M; + }else{ + media_temp |= ENET_SPEEDMODE_100M; + } + }else{ + phy_value = (uint16_t)((media_temp & ENET_MAC_CFG_DPM) >> 3); + phy_value |= (uint16_t)((media_temp & ENET_MAC_CFG_SPD) >> 1); + phy_state = enet_phy_write_read(ENET_PHY_WRITE, PHY_ADDRESS, PHY_REG_BCR, &phy_value); + if(!phy_state){ + /* return ERROR due to write timeout */ + return enet_state; + } + /* PHY configuration need some time */ + _ENET_DELAY_(PHY_CONFIGDELAY); + } + /* after configuring the PHY, use mediamode to configure registers */ + reg_value = ENET_MAC_CFG; + /* configure ENET_MAC_CFG register */ + reg_value &= (~(ENET_MAC_CFG_SPD |ENET_MAC_CFG_DPM |ENET_MAC_CFG_LBM)); + reg_value |= media_temp; + ENET_MAC_CFG = reg_value; + + + /* 2st, configure checksum */ + if(RESET != ((uint32_t)checksum & ENET_CHECKSUMOFFLOAD_ENABLE)){ + ENET_MAC_CFG |= ENET_CHECKSUMOFFLOAD_ENABLE; + + reg_value = ENET_DMA_CTL; + /* configure ENET_DMA_CTL register */ + reg_value &= ~ENET_DMA_CTL_DTCERFD; + reg_value |= ((uint32_t)checksum & ENET_DMA_CTL_DTCERFD); + ENET_DMA_CTL = reg_value; + } + + /* 3rd, configure recept */ + ENET_MAC_FRMF |= (uint32_t)recept; + + /* 4th, configure different function options */ + /* configure forward_frame related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)FORWARD_OPTION)){ + reg_temp = enet_initpara.forward_frame; + + reg_value = ENET_MAC_CFG; + temp = reg_temp; + /* configure ENET_MAC_CFG register */ + reg_value &= (~ENET_MAC_CFG_APCD); + temp &= ENET_MAC_CFG_APCD; + reg_value |= temp; + ENET_MAC_CFG = reg_value; + + reg_value = ENET_DMA_CTL; + temp = reg_temp; + /* configure ENET_DMA_CTL register */ + reg_value &= (~(ENET_DMA_CTL_FERF |ENET_DMA_CTL_FUF)); + temp &= ((ENET_DMA_CTL_FERF | ENET_DMA_CTL_FUF) << 2); + reg_value |= (temp >> 2); + ENET_DMA_CTL = reg_value; + } + + /* configure dmabus_mode related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)DMABUS_OPTION)){ + temp = enet_initpara.dmabus_mode; + + reg_value = ENET_DMA_BCTL; + /* configure ENET_DMA_BCTL register */ + reg_value &= ~(ENET_DMA_BCTL_AA | ENET_DMA_BCTL_FB \ + |ENET_DMA_BCTL_FPBL); + reg_value |= temp; + ENET_DMA_BCTL = reg_value; + } + + /* configure dma_maxburst related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)DMA_MAXBURST_OPTION)){ + temp = enet_initpara.dma_maxburst; + + reg_value = ENET_DMA_BCTL; + /* configure ENET_DMA_BCTL register */ + reg_value &= ~(ENET_DMA_BCTL_RXDP| ENET_DMA_BCTL_PGBL | ENET_DMA_BCTL_UIP); + reg_value |= temp; + ENET_DMA_BCTL = reg_value; + } + + /* configure dma_arbitration related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)DMA_ARBITRATION_OPTION)){ + temp = enet_initpara.dma_arbitration; + + reg_value = ENET_DMA_BCTL; + /* configure ENET_DMA_BCTL register */ + reg_value &= ~(ENET_DMA_BCTL_RTPR | ENET_DMA_BCTL_DAB); + reg_value |= temp; + ENET_DMA_BCTL = reg_value; + } + + /* configure store_forward_mode related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)STORE_OPTION)){ + temp = enet_initpara.store_forward_mode; + + reg_value = ENET_DMA_CTL; + /* configure ENET_DMA_CTL register */ + reg_value &= ~(ENET_DMA_CTL_RSFD | ENET_DMA_CTL_TSFD| ENET_DMA_CTL_RTHC| ENET_DMA_CTL_TTHC); + reg_value |= temp; + ENET_DMA_CTL = reg_value; + } + + /* configure dma_function related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)DMA_OPTION)){ + reg_temp = enet_initpara.dma_function; + + reg_value = ENET_DMA_CTL; + /* configure ENET_DMA_CTL register */ + reg_value &= (~(ENET_DMA_CTL_DAFRF |ENET_DMA_CTL_OSF)); + reg_value |= reg_temp; + ENET_DMA_CTL = reg_value; + } + + /* configure vlan_config related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)VLAN_OPTION)){ + reg_temp = enet_initpara.vlan_config; + + reg_value = ENET_MAC_VLT; + /* configure ENET_MAC_VLT register */ + reg_value &= ~(ENET_MAC_VLT_VLTI | ENET_MAC_VLT_VLTC); + reg_value |= reg_temp; + ENET_MAC_VLT = reg_value; + } + + /* configure flow_control related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)FLOWCTL_OPTION)){ + reg_temp = enet_initpara.flow_control; + + reg_value = ENET_MAC_FCTL; + temp = reg_temp; + /* configure ENET_MAC_FCTL register */ + reg_value &= ~(ENET_MAC_FCTL_PTM |ENET_MAC_FCTL_DZQP |ENET_MAC_FCTL_PLTS \ + | ENET_MAC_FCTL_UPFDT |ENET_MAC_FCTL_RFCEN |ENET_MAC_FCTL_TFCEN); + temp &= (ENET_MAC_FCTL_PTM |ENET_MAC_FCTL_DZQP |ENET_MAC_FCTL_PLTS \ + | ENET_MAC_FCTL_UPFDT |ENET_MAC_FCTL_RFCEN |ENET_MAC_FCTL_TFCEN); + reg_value |= temp; + ENET_MAC_FCTL = reg_value; + + reg_value = ENET_MAC_FCTH; + temp = reg_temp; + /* configure ENET_MAC_FCTH register */ + reg_value &= ~(ENET_MAC_FCTH_RFA |ENET_MAC_FCTH_RFD); + temp &= ((ENET_MAC_FCTH_RFA | ENET_MAC_FCTH_RFD )<<8); + reg_value |= (temp >> 8); + ENET_MAC_FCTH = reg_value; + } + + /* configure hashtable_high related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)HASHH_OPTION)){ + ENET_MAC_HLH = enet_initpara.hashtable_high; + } + + /* configure hashtable_low related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)HASHL_OPTION)){ + ENET_MAC_HLL = enet_initpara.hashtable_low; + } + + /* configure framesfilter_mode related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)FILTER_OPTION)){ + reg_temp = enet_initpara.framesfilter_mode; + + reg_value = ENET_MAC_FRMF; + /* configure ENET_MAC_FRMF register */ + reg_value &= ~(ENET_MAC_FRMF_SAFLT | ENET_MAC_FRMF_SAIFLT | ENET_MAC_FRMF_DAIFLT \ + | ENET_MAC_FRMF_HMF | ENET_MAC_FRMF_HPFLT | ENET_MAC_FRMF_MFD \ + | ENET_MAC_FRMF_HUF | ENET_MAC_FRMF_PCFRM); + reg_value |= reg_temp; + ENET_MAC_FRMF = reg_value; + } + + /* configure halfduplex_param related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)HALFDUPLEX_OPTION)){ + reg_temp = enet_initpara.halfduplex_param; + + reg_value = ENET_MAC_CFG; + /* configure ENET_MAC_CFG register */ + reg_value &= ~(ENET_MAC_CFG_CSD | ENET_MAC_CFG_ROD | ENET_MAC_CFG_RTD \ + | ENET_MAC_CFG_BOL | ENET_MAC_CFG_DFC); + reg_value |= reg_temp; + ENET_MAC_CFG = reg_value; + } + + /* configure timer_config related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)TIMER_OPTION)){ + reg_temp = enet_initpara.timer_config; + + reg_value = ENET_MAC_CFG; + /* configure ENET_MAC_CFG register */ + reg_value &= ~(ENET_MAC_CFG_WDD | ENET_MAC_CFG_JBD); + reg_value |= reg_temp; + ENET_MAC_CFG = reg_value; + } + + /* configure interframegap related registers */ + if(RESET != (enet_initpara.option_enable & (uint32_t)INTERFRAMEGAP_OPTION)){ + reg_temp = enet_initpara.interframegap; + + reg_value = ENET_MAC_CFG; + /* configure ENET_MAC_CFG register */ + reg_value &= ~ENET_MAC_CFG_IGBS; + reg_value |= reg_temp; + ENET_MAC_CFG = reg_value; + } + + enet_state = SUCCESS; + return enet_state; +} + +/*! + \brief reset all core internal registers located in CLK_TX and CLK_RX + \param[in] none + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_software_reset(void) +{ + uint32_t timeout = 0U; + ErrStatus enet_state = ERROR; + uint32_t dma_flag; + + /* reset all core internal registers located in CLK_TX and CLK_RX */ + ENET_DMA_BCTL |= ENET_DMA_BCTL_SWR; + + /* wait for reset operation complete */ + do{ + dma_flag = (ENET_DMA_BCTL & ENET_DMA_BCTL_SWR); + timeout++; + }while((RESET != dma_flag) && (ENET_DELAY_TO != timeout)); + + /* reset operation complete */ + if(RESET == (ENET_DMA_BCTL & ENET_DMA_BCTL_SWR)){ + enet_state = SUCCESS; + } + + return enet_state; +} + +/*! + \brief check receive frame valid and return frame size + \param[in] none + \param[out] none + \retval size of received frame: 0x0 - 0x3FFF +*/ +uint32_t enet_rxframe_size_get(void) +{ + uint32_t size = 0U; + uint32_t status; + + /* get rdes0 information of current RxDMA descriptor */ + status = dma_current_rxdesc->status; + + /* if the desciptor is owned by DMA */ + if((uint32_t)RESET != (status & ENET_RDES0_DAV)){ + return 0U; + } + + /* if has any error, or the frame uses two or more descriptors */ + if((((uint32_t)RESET) != (status & ENET_RDES0_ERRS)) || + (((uint32_t)RESET) == (status & ENET_RDES0_LDES)) || + (((uint32_t)RESET) == (status & ENET_RDES0_FDES))){ + /* drop current receive frame */ + enet_rxframe_drop(); + + return 1U; + } + + /* if is an ethernet-type frame, and IP frame payload error occurred */ + if((((uint32_t)RESET) != (status & ENET_RDES0_FRMT)) && + (((uint32_t)RESET) != (status & ENET_RDES0_PCERR))){ + /* drop current receive frame */ + enet_rxframe_drop(); + + return 1U; + } + + /* if CPU owns current descriptor, no error occured, the frame uses only one descriptor */ + if((((uint32_t)RESET) == (status & ENET_RDES0_DAV)) && + (((uint32_t)RESET) == (status & ENET_RDES0_ERRS)) && + (((uint32_t)RESET) != (status & ENET_RDES0_LDES)) && + (((uint32_t)RESET) != (status & ENET_RDES0_FDES))){ + /* get the size of the received data including CRC */ + size = GET_RDES0_FRML(status); + /* substract the CRC size */ + size = size - 4U; + }else{ + enet_unknow_err++; + enet_rxframe_drop(); + + return 1U; + } + + /* return packet size */ + return size; +} + +/*! + \brief initialize the DMA Tx/Rx descriptors's parameters in chain mode + \param[in] direction: the descriptors which users want to init, refer to enet_dmadirection_enum, + only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: DMA Tx descriptors + \arg ENET_DMA_RX: DMA Rx descriptors + \param[out] none + \retval none +*/ +void enet_descriptors_chain_init(enet_dmadirection_enum direction) +{ + uint32_t num = 0U, count = 0U, maxsize = 0U; + uint32_t desc_status = 0U, desc_bufsize = 0U; + enet_descriptors_struct *desc, *desc_tab; + uint8_t *buf; + + /* if want to initialize DMA Tx descriptors */ + if (ENET_DMA_TX == direction){ + /* save a copy of the DMA Tx descriptors */ + desc_tab = txdesc_tab; + buf = &tx_buff[0][0]; + count = ENET_TXBUF_NUM; + maxsize = ENET_TXBUF_SIZE; + + /* select chain mode */ + desc_status = ENET_TDES0_TCHM; + + /* configure DMA Tx descriptor table address register */ + ENET_DMA_TDTADDR = (uint32_t)desc_tab; + dma_current_txdesc = desc_tab; + }else{ + /* if want to initialize DMA Rx descriptors */ + /* save a copy of the DMA Rx descriptors */ + desc_tab = rxdesc_tab; + buf = &rx_buff[0][0]; + count = ENET_RXBUF_NUM; + maxsize = ENET_RXBUF_SIZE; + + /* enable receiving */ + desc_status = ENET_RDES0_DAV; + /* select receive chained mode and set buffer1 size */ + desc_bufsize = ENET_RDES1_RCHM | (uint32_t)ENET_RXBUF_SIZE; + + /* configure DMA Rx descriptor table address register */ + ENET_DMA_RDTADDR = (uint32_t)desc_tab; + dma_current_rxdesc = desc_tab; + } + dma_current_ptp_rxdesc = NULL; + dma_current_ptp_txdesc = NULL; + + /* configure each descriptor */ + for(num=0U; num < count; num++){ + /* get the pointer to the next descriptor of the descriptor table */ + desc = desc_tab + num; + + /* configure descriptors */ + desc->status = desc_status; + desc->control_buffer_size = desc_bufsize; + desc->buffer1_addr = (uint32_t)(&buf[num * maxsize]); + + /* if is not the last descriptor */ + if(num < (count - 1U)){ + /* configure the next descriptor address */ + desc->buffer2_next_desc_addr = (uint32_t)(desc_tab + num + 1U); + }else{ + /* when it is the last descriptor, the next descriptor address + equals to first descriptor address in descriptor table */ + desc->buffer2_next_desc_addr = (uint32_t) desc_tab; + } + } +} + +/*! + \brief initialize the DMA Tx/Rx descriptors's parameters in ring mode + \param[in] direction: the descriptors which users want to init, refer to enet_dmadirection_enum, + only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: DMA Tx descriptors + \arg ENET_DMA_RX: DMA Rx descriptors + \param[out] none + \retval none +*/ +void enet_descriptors_ring_init(enet_dmadirection_enum direction) +{ + uint32_t num = 0U, count = 0U, maxsize = 0U; + uint32_t desc_status = 0U, desc_bufsize = 0U; + enet_descriptors_struct *desc; + enet_descriptors_struct *desc_tab; + uint8_t *buf; + + /* configure descriptor skip length */ + ENET_DMA_BCTL &= ~ENET_DMA_BCTL_DPSL; + ENET_DMA_BCTL |= DMA_BCTL_DPSL(0); + + /* if want to initialize DMA Tx descriptors */ + if (ENET_DMA_TX == direction){ + /* save a copy of the DMA Tx descriptors */ + desc_tab = txdesc_tab; + buf = &tx_buff[0][0]; + count = ENET_TXBUF_NUM; + maxsize = ENET_TXBUF_SIZE; + + /* configure DMA Tx descriptor table address register */ + ENET_DMA_TDTADDR = (uint32_t)desc_tab; + dma_current_txdesc = desc_tab; + }else{ + /* if want to initialize DMA Rx descriptors */ + /* save a copy of the DMA Rx descriptors */ + desc_tab = rxdesc_tab; + buf = &rx_buff[0][0]; + count = ENET_RXBUF_NUM; + maxsize = ENET_RXBUF_SIZE; + + /* enable receiving */ + desc_status = ENET_RDES0_DAV; + /* set buffer1 size */ + desc_bufsize = ENET_RXBUF_SIZE; + + /* configure DMA Rx descriptor table address register */ + ENET_DMA_RDTADDR = (uint32_t)desc_tab; + dma_current_rxdesc = desc_tab; + } + dma_current_ptp_rxdesc = NULL; + dma_current_ptp_txdesc = NULL; + + /* configure each descriptor */ + for(num=0U; num < count; num++){ + /* get the pointer to the next descriptor of the descriptor table */ + desc = desc_tab + num; + + /* configure descriptors */ + desc->status = desc_status; + desc->control_buffer_size = desc_bufsize; + desc->buffer1_addr = (uint32_t)(&buf[num * maxsize]); + + /* when it is the last descriptor */ + if(num == (count - 1U)){ + if (ENET_DMA_TX == direction){ + /* configure transmit end of ring mode */ + desc->status |= ENET_TDES0_TERM; + }else{ + /* configure receive end of ring mode */ + desc->control_buffer_size |= ENET_RDES1_RERM; + } + } + } +} + +/*! + \brief handle current received frame data to application buffer + \param[in] bufsize: the size of buffer which is the parameter in function + \param[out] buffer: pointer to the received frame data + note -- if the input is NULL, user should copy data in application by himself + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_frame_receive(uint8_t *buffer, uint32_t bufsize) +{ + uint32_t offset = 0U, size = 0U; + + /* the descriptor is busy due to own by the DMA */ + if((uint32_t)RESET != (dma_current_rxdesc->status & ENET_RDES0_DAV)){ + return ERROR; + } + + + /* if buffer pointer is null, indicates that users has copied data in application */ + if(NULL != buffer){ + /* if no error occurs, and the frame uses only one descriptor */ + if((((uint32_t)RESET) == (dma_current_rxdesc->status & ENET_RDES0_ERRS)) && + (((uint32_t)RESET) != (dma_current_rxdesc->status & ENET_RDES0_LDES)) && + (((uint32_t)RESET) != (dma_current_rxdesc->status & ENET_RDES0_FDES))){ + /* get the frame length except CRC */ + size = GET_RDES0_FRML(dma_current_rxdesc->status); + size = size - 4U; + + /* to avoid situation that the frame size exceeds the buffer length */ + if(size > bufsize){ + return ERROR; + } + + /* copy data from Rx buffer to application buffer */ + for(offset = 0U; offsetbuffer1_addr) + offset)); + } + + }else{ + /* return ERROR */ + return ERROR; + } + } + /* enable reception, descriptor is owned by DMA */ + dma_current_rxdesc->status = ENET_RDES0_DAV; + + /* check Rx buffer unavailable flag status */ + if ((uint32_t)RESET != (ENET_DMA_STAT & ENET_DMA_STAT_RBU)){ + /* clear RBU flag */ + ENET_DMA_STAT = ENET_DMA_STAT_RBU; + /* resume DMA reception by writing to the RPEN register*/ + ENET_DMA_RPEN = 0U; + } + + /* update the current RxDMA descriptor pointer to the next decriptor in RxDMA decriptor table */ + /* chained mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RCHM)){ + dma_current_rxdesc = (enet_descriptors_struct*) (dma_current_rxdesc->buffer2_next_desc_addr); + }else{ + /* ring mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RERM)){ + /* if is the last descriptor in table, the next descriptor is the table header */ + dma_current_rxdesc = (enet_descriptors_struct*) (ENET_DMA_RDTADDR); + }else{ + /* the next descriptor is the current address, add the descriptor size, and descriptor skip length */ + dma_current_rxdesc = (enet_descriptors_struct*) (uint32_t)((uint32_t)dma_current_rxdesc + ETH_DMARXDESC_SIZE + (GET_DMA_BCTL_DPSL(ENET_DMA_BCTL))); + } + } + + return SUCCESS; +} + +/*! + \brief handle application buffer data to transmit it + \param[in] buffer: pointer to the frame data to be transmitted, + note -- if the input is NULL, user should handle the data in application by himself + \param[in] length: the length of frame data to be transmitted + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_frame_transmit(uint8_t *buffer, uint32_t length) +{ + uint32_t offset = 0U; + uint32_t dma_tbu_flag, dma_tu_flag; + + /* the descriptor is busy due to own by the DMA */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_DAV)){ + return ERROR; + } + + /* only frame length no more than ENET_MAX_FRAME_SIZE is allowed */ + if(length > ENET_MAX_FRAME_SIZE){ + return ERROR; + } + + /* if buffer pointer is null, indicates that users has handled data in application */ + if(NULL != buffer){ + /* copy frame data from application buffer to Tx buffer */ + for(offset = 0U; offset < length; offset++){ + (*(__IO uint8_t *) (uint32_t)((dma_current_txdesc->buffer1_addr) + offset)) = (*(buffer + offset)); + } + } + + /* set the frame length */ + dma_current_txdesc->control_buffer_size = length; + /* set the segment of frame, frame is transmitted in one descriptor */ + dma_current_txdesc->status |= ENET_TDES0_LSG | ENET_TDES0_FSG; + /* enable the DMA transmission */ + dma_current_txdesc->status |= ENET_TDES0_DAV; + + /* check Tx buffer unavailable flag status */ + dma_tbu_flag = (ENET_DMA_STAT & ENET_DMA_STAT_TBU); + dma_tu_flag = (ENET_DMA_STAT & ENET_DMA_STAT_TU); + + if ((RESET != dma_tbu_flag) || (RESET != dma_tu_flag)){ + /* clear TBU and TU flag */ + ENET_DMA_STAT = (dma_tbu_flag | dma_tu_flag); + /* resume DMA transmission by writing to the TPEN register*/ + ENET_DMA_TPEN = 0U; + } + + /* update the current TxDMA descriptor pointer to the next decriptor in TxDMA decriptor table*/ + /* chained mode */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_TCHM)){ + dma_current_txdesc = (enet_descriptors_struct*) (dma_current_txdesc->buffer2_next_desc_addr); + }else{ + /* ring mode */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_TERM)){ + /* if is the last descriptor in table, the next descriptor is the table header */ + dma_current_txdesc = (enet_descriptors_struct*) (ENET_DMA_TDTADDR); + }else{ + /* the next descriptor is the current address, add the descriptor size, and descriptor skip length */ + dma_current_txdesc = (enet_descriptors_struct*) (uint32_t)((uint32_t)dma_current_txdesc + ETH_DMATXDESC_SIZE + (GET_DMA_BCTL_DPSL(ENET_DMA_BCTL))); + } + } + + return SUCCESS; +} + +/*! + \brief configure the transmit IP frame checksum offload calculation and insertion + \param[in] desc: the descriptor pointer which users want to configure + \param[in] checksum: IP frame checksum configuration + only one parameter can be selected which is shown as below + \arg ENET_CHECKSUM_DISABLE: checksum insertion disabled + \arg ENET_CHECKSUM_IPV4HEADER: only IP header checksum calculation and insertion are enabled + \arg ENET_CHECKSUM_TCPUDPICMP_SEGMENT: TCP/UDP/ICMP checksum insertion calculated but pseudo-header + \arg ENET_CHECKSUM_TCPUDPICMP_FULL: TCP/UDP/ICMP checksum insertion fully calculated + \param[out] none + \retval none +*/ +void enet_transmit_checksum_config(enet_descriptors_struct *desc, uint32_t checksum) +{ + desc->status &= ~ENET_TDES0_CM; + desc->status |= checksum; +} + +/*! + \brief ENET Tx and Rx function enable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_enable(void) +{ + enet_tx_enable(); + enet_rx_enable(); +} + +/*! + \brief ENET Tx and Rx function disable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_disable(void) +{ + enet_tx_disable(); + enet_rx_disable(); +} + +/*! + \brief configure MAC address + \param[in] mac_addr: select which MAC address will be set, + only one parameter can be selected which is shown as below + \arg ENET_MAC_ADDRESS0: set MAC address 0 filter + \arg ENET_MAC_ADDRESS1: set MAC address 1 filter + \arg ENET_MAC_ADDRESS2: set MAC address 2 filter + \arg ENET_MAC_ADDRESS3: set MAC address 3 filter + \param[in] paddr: the buffer pointer which stores the MAC address + (little-ending store, such as MAC address is aa:bb:cc:dd:ee:22, the buffer is {22, ee, dd, cc, bb, aa}) + \param[out] none + \retval none +*/ +void enet_mac_address_set(enet_macaddress_enum mac_addr, uint8_t paddr[]) +{ + REG32(ENET_ADDRH_BASE + (uint32_t)mac_addr) = ENET_SET_MACADDRH(paddr); + REG32(ENET_ADDRL_BASE + (uint32_t)mac_addr) = ENET_SET_MACADDRL(paddr); +} + +/*! + \brief get MAC address + \param[in] mac_addr: select which MAC address will be get, + only one parameter can be selected which is shown as below + \arg ENET_MAC_ADDRESS0: get MAC address 0 filter + \arg ENET_MAC_ADDRESS1: get MAC address 1 filter + \arg ENET_MAC_ADDRESS2: get MAC address 2 filter + \arg ENET_MAC_ADDRESS3: get MAC address 3 filter + \param[out] paddr: the buffer pointer which is stored the MAC address + (little-ending store, such as mac address is aa:bb:cc:dd:ee:22, the buffer is {22, ee, dd, cc, bb, aa}) + \retval none +*/ +void enet_mac_address_get(enet_macaddress_enum mac_addr, uint8_t paddr[]) +{ + paddr[0] = ENET_GET_MACADDR(mac_addr, 0U); + paddr[1] = ENET_GET_MACADDR(mac_addr, 1U); + paddr[2] = ENET_GET_MACADDR(mac_addr, 2U); + paddr[3] = ENET_GET_MACADDR(mac_addr, 3U); + paddr[4] = ENET_GET_MACADDR(mac_addr, 4U); + paddr[5] = ENET_GET_MACADDR(mac_addr, 5U); +} + +/*! + \brief get the ENET MAC/MSC/PTP/DMA status flag + \param[in] enet_flag: ENET status flag, refer to enet_flag_enum, + only one parameter can be selected which is shown as below + \arg ENET_MAC_FLAG_MPKR: magic packet received flag + \arg ENET_MAC_FLAG_WUFR: wakeup frame received flag + \arg ENET_MAC_FLAG_FLOWCONTROL: flow control status flag + \arg ENET_MAC_FLAG_WUM: WUM status flag + \arg ENET_MAC_FLAG_MSC: MSC status flag + \arg ENET_MAC_FLAG_MSCR: MSC receive status flag + \arg ENET_MAC_FLAG_MSCT: MSC transmit status flag + \arg ENET_MAC_FLAG_TMST: time stamp trigger status flag + \arg ENET_PTP_FLAG_TSSCO: timestamp second counter overflow flag + \arg ENET_PTP_FLAG_TTM: target time match flag + \arg ENET_MSC_FLAG_RFCE: received frames CRC error flag + \arg ENET_MSC_FLAG_RFAE: received frames alignment error flag + \arg ENET_MSC_FLAG_RGUF: received good unicast frames flag + \arg ENET_MSC_FLAG_TGFSC: transmitted good frames single collision flag + \arg ENET_MSC_FLAG_TGFMSC: transmitted good frames more single collision flag + \arg ENET_MSC_FLAG_TGF: transmitted good frames flag + \arg ENET_DMA_FLAG_TS: transmit status flag + \arg ENET_DMA_FLAG_TPS: transmit process stopped status flag + \arg ENET_DMA_FLAG_TBU: transmit buffer unavailable status flag + \arg ENET_DMA_FLAG_TJT: transmit jabber timeout status flag + \arg ENET_DMA_FLAG_RO: receive overflow status flag + \arg ENET_DMA_FLAG_TU: transmit underflow status flag + \arg ENET_DMA_FLAG_RS: receive status flag + \arg ENET_DMA_FLAG_RBU: receive buffer unavailable status flag + \arg ENET_DMA_FLAG_RPS: receive process stopped status flag + \arg ENET_DMA_FLAG_RWT: receive watchdog timeout status flag + \arg ENET_DMA_FLAG_ET: early transmit status flag + \arg ENET_DMA_FLAG_FBE: fatal bus error status flag + \arg ENET_DMA_FLAG_ER: early receive status flag + \arg ENET_DMA_FLAG_AI: abnormal interrupt summary flag + \arg ENET_DMA_FLAG_NI: normal interrupt summary flag + \arg ENET_DMA_FLAG_EB_DMA_ERROR: DMA error flag + \arg ENET_DMA_FLAG_EB_TRANSFER_ERROR: transfer error flag + \arg ENET_DMA_FLAG_EB_ACCESS_ERROR: access error flag + \arg ENET_DMA_FLAG_MSC: MSC status flag + \arg ENET_DMA_FLAG_WUM: WUM status flag + \arg ENET_DMA_FLAG_TST: timestamp trigger status flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus enet_flag_get(enet_flag_enum enet_flag) +{ + if(RESET != (ENET_REG_VAL(enet_flag) & BIT(ENET_BIT_POS(enet_flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the ENET DMA status flag + \param[in] enet_flag: ENET DMA flag clear, refer to enet_flag_clear_enum + only one parameter can be selected which is shown as below + \arg ENET_DMA_FLAG_TS_CLR: transmit status flag clear + \arg ENET_DMA_FLAG_TPS_CLR: transmit process stopped status flag clear + \arg ENET_DMA_FLAG_TBU_CLR: transmit buffer unavailable status flag clear + \arg ENET_DMA_FLAG_TJT_CLR: transmit jabber timeout status flag clear + \arg ENET_DMA_FLAG_RO_CLR: receive overflow status flag clear + \arg ENET_DMA_FLAG_TU_CLR: transmit underflow status flag clear + \arg ENET_DMA_FLAG_RS_CLR: receive status flag clear + \arg ENET_DMA_FLAG_RBU_CLR: receive buffer unavailable status flag clear + \arg ENET_DMA_FLAG_RPS_CLR: receive process stopped status flag clear + \arg ENET_DMA_FLAG_RWT_CLR: receive watchdog timeout status flag clear + \arg ENET_DMA_FLAG_ET_CLR: early transmit status flag clear + \arg ENET_DMA_FLAG_FBE_CLR: fatal bus error status flag clear + \arg ENET_DMA_FLAG_ER_CLR: early receive status flag clear + \arg ENET_DMA_FLAG_AI_CLR: abnormal interrupt summary flag clear + \arg ENET_DMA_FLAG_NI_CLR: normal interrupt summary flag clear + \param[out] none + \retval none +*/ +void enet_flag_clear(enet_flag_clear_enum enet_flag) +{ + /* write 1 to the corresponding bit in ENET_DMA_STAT, to clear it */ + ENET_REG_VAL(enet_flag) = BIT(ENET_BIT_POS(enet_flag)); +} + +/*! + \brief enable ENET MAC/MSC/DMA interrupt + \param[in] enet_int: ENET interrupt, + only one parameter can be selected which is shown as below + \arg ENET_MAC_INT_WUMIM: WUM interrupt mask + \arg ENET_MAC_INT_TMSTIM: timestamp trigger interrupt mask + \arg ENET_MSC_INT_RFCEIM: received frame CRC error interrupt mask + \arg ENET_MSC_INT_RFAEIM: received frames alignment error interrupt mask + \arg ENET_MSC_INT_RGUFIM: received good unicast frames interrupt mask + \arg ENET_MSC_INT_TGFSCIM: transmitted good frames single collision interrupt mask + \arg ENET_MSC_INT_TGFMSCIM: transmitted good frames more single collision interrupt mask + \arg ENET_MSC_INT_TGFIM: transmitted good frames interrupt mask + \arg ENET_DMA_INT_TIE: transmit interrupt enable + \arg ENET_DMA_INT_TPSIE: transmit process stopped interrupt enable + \arg ENET_DMA_INT_TBUIE: transmit buffer unavailable interrupt enable + \arg ENET_DMA_INT_TJTIE: transmit jabber timeout interrupt enable + \arg ENET_DMA_INT_ROIE: receive overflow interrupt enable + \arg ENET_DMA_INT_TUIE: transmit underflow interrupt enable + \arg ENET_DMA_INT_RIE: receive interrupt enable + \arg ENET_DMA_INT_RBUIE: receive buffer unavailable interrupt enable + \arg ENET_DMA_INT_RPSIE: receive process stopped interrupt enable + \arg ENET_DMA_INT_RWTIE: receive watchdog timeout interrupt enable + \arg ENET_DMA_INT_ETIE: early transmit interrupt enable + \arg ENET_DMA_INT_FBEIE: fatal bus error interrupt enable + \arg ENET_DMA_INT_ERIE: early receive interrupt enable + \arg ENET_DMA_INT_AIE: abnormal interrupt summary enable + \arg ENET_DMA_INT_NIE: normal interrupt summary enable + \param[out] none + \retval none +*/ +void enet_interrupt_enable(enet_int_enum enet_int) +{ + if(DMA_INTEN_REG_OFFSET == ((uint32_t)enet_int >> 6)){ + /* ENET_DMA_INTEN register interrupt */ + ENET_REG_VAL(enet_int) |= BIT(ENET_BIT_POS(enet_int)); + }else{ + /* other INTMSK register interrupt */ + ENET_REG_VAL(enet_int) &= ~BIT(ENET_BIT_POS(enet_int)); + } +} + +/*! + \brief disable ENET MAC/MSC/DMA interrupt + \param[in] enet_int: ENET interrupt, + only one parameter can be selected which is shown as below + \arg ENET_MAC_INT_WUMIM: WUM interrupt mask + \arg ENET_MAC_INT_TMSTIM: timestamp trigger interrupt mask + \arg ENET_MSC_INT_RFCEIM: received frame CRC error interrupt mask + \arg ENET_MSC_INT_RFAEIM: received frames alignment error interrupt mask + \arg ENET_MSC_INT_RGUFIM: received good unicast frames interrupt mask + \arg ENET_MSC_INT_TGFSCIM: transmitted good frames single collision interrupt mask + \arg ENET_MSC_INT_TGFMSCIM: transmitted good frames more single collision interrupt mask + \arg ENET_MSC_INT_TGFIM: transmitted good frames interrupt mask + \arg ENET_DMA_INT_TIE: transmit interrupt enable + \arg ENET_DMA_INT_TPSIE: transmit process stopped interrupt enable + \arg ENET_DMA_INT_TBUIE: transmit buffer unavailable interrupt enable + \arg ENET_DMA_INT_TJTIE: transmit jabber timeout interrupt enable + \arg ENET_DMA_INT_ROIE: receive overflow interrupt enable + \arg ENET_DMA_INT_TUIE: transmit underflow interrupt enable + \arg ENET_DMA_INT_RIE: receive interrupt enable + \arg ENET_DMA_INT_RBUIE: receive buffer unavailable interrupt enable + \arg ENET_DMA_INT_RPSIE: receive process stopped interrupt enable + \arg ENET_DMA_INT_RWTIE: receive watchdog timeout interrupt enable + \arg ENET_DMA_INT_ETIE: early transmit interrupt enable + \arg ENET_DMA_INT_FBEIE: fatal bus error interrupt enable + \arg ENET_DMA_INT_ERIE: early receive interrupt enable + \arg ENET_DMA_INT_AIE: abnormal interrupt summary enable + \arg ENET_DMA_INT_NIE: normal interrupt summary enable + \param[out] none + \retval none +*/ +void enet_interrupt_disable(enet_int_enum enet_int) +{ + if(DMA_INTEN_REG_OFFSET == ((uint32_t)enet_int >> 6)){ + /* ENET_DMA_INTEN register interrupt */ + ENET_REG_VAL(enet_int) &= ~BIT(ENET_BIT_POS(enet_int)); + }else{ + /* other INTMSK register interrupt */ + ENET_REG_VAL(enet_int) |= BIT(ENET_BIT_POS(enet_int)); + } +} + +/*! + \brief get ENET MAC/MSC/DMA interrupt flag + \param[in] int_flag: ENET interrupt flag, + only one parameter can be selected which is shown as below + \arg ENET_MAC_INT_FLAG_WUM: WUM status flag + \arg ENET_MAC_INT_FLAG_MSC: MSC status flag + \arg ENET_MAC_INT_FLAG_MSCR: MSC receive status flag + \arg ENET_MAC_INT_FLAG_MSCT: MSC transmit status flag + \arg ENET_MAC_INT_FLAG_TMST: time stamp trigger status flag + \arg ENET_MSC_INT_FLAG_RFCE: received frames CRC error flag + \arg ENET_MSC_INT_FLAG_RFAE: received frames alignment error flag + \arg ENET_MSC_INT_FLAG_RGUF: received good unicast frames flag + \arg ENET_MSC_INT_FLAG_TGFSC: transmitted good frames single collision flag + \arg ENET_MSC_INT_FLAG_TGFMSC: transmitted good frames more single collision flag + \arg ENET_MSC_INT_FLAG_TGF: transmitted good frames flag + \arg ENET_DMA_INT_FLAG_TS: transmit status flag + \arg ENET_DMA_INT_FLAG_TPS: transmit process stopped status flag + \arg ENET_DMA_INT_FLAG_TBU: transmit buffer unavailable status flag + \arg ENET_DMA_INT_FLAG_TJT: transmit jabber timeout status flag + \arg ENET_DMA_INT_FLAG_RO: receive overflow status flag + \arg ENET_DMA_INT_FLAG_TU: transmit underflow status flag + \arg ENET_DMA_INT_FLAG_RS: receive status flag + \arg ENET_DMA_INT_FLAG_RBU: receive buffer unavailable status flag + \arg ENET_DMA_INT_FLAG_RPS: receive process stopped status flag + \arg ENET_DMA_INT_FLAG_RWT: receive watchdog timeout status flag + \arg ENET_DMA_INT_FLAG_ET: early transmit status flag + \arg ENET_DMA_INT_FLAG_FBE: fatal bus error status flag + \arg ENET_DMA_INT_FLAG_ER: early receive status flag + \arg ENET_DMA_INT_FLAG_AI: abnormal interrupt summary flag + \arg ENET_DMA_INT_FLAG_NI: normal interrupt summary flag + \arg ENET_DMA_INT_FLAG_MSC: MSC status flag + \arg ENET_DMA_INT_FLAG_WUM: WUM status flag + \arg ENET_DMA_INT_FLAG_TST: timestamp trigger status flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus enet_interrupt_flag_get(enet_int_flag_enum int_flag) +{ + if(RESET != (ENET_REG_VAL(int_flag) & BIT(ENET_BIT_POS(int_flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear ENET DMA interrupt flag + \param[in] int_flag_clear: clear ENET interrupt flag, + only one parameter can be selected which is shown as below + \arg ENET_DMA_INT_FLAG_TS_CLR: transmit status flag + \arg ENET_DMA_INT_FLAG_TPS_CLR: transmit process stopped status flag + \arg ENET_DMA_INT_FLAG_TBU_CLR: transmit buffer unavailable status flag + \arg ENET_DMA_INT_FLAG_TJT_CLR: transmit jabber timeout status flag + \arg ENET_DMA_INT_FLAG_RO_CLR: receive overflow status flag + \arg ENET_DMA_INT_FLAG_TU_CLR: transmit underflow status flag + \arg ENET_DMA_INT_FLAG_RS_CLR: receive status flag + \arg ENET_DMA_INT_FLAG_RBU_CLR: receive buffer unavailable status flag + \arg ENET_DMA_INT_FLAG_RPS_CLR: receive process stopped status flag + \arg ENET_DMA_INT_FLAG_RWT_CLR: receive watchdog timeout status flag + \arg ENET_DMA_INT_FLAG_ET_CLR: early transmit status flag + \arg ENET_DMA_INT_FLAG_FBE_CLR: fatal bus error status flag + \arg ENET_DMA_INT_FLAG_ER_CLR: early receive status flag + \arg ENET_DMA_INT_FLAG_AI_CLR: abnormal interrupt summary flag + \arg ENET_DMA_INT_FLAG_NI_CLR: normal interrupt summary flag + \param[out] none + \retval none +*/ +void enet_interrupt_flag_clear(enet_int_flag_clear_enum int_flag_clear) +{ + /* write 1 to the corresponding bit in ENET_DMA_STAT, to clear it */ + ENET_REG_VAL(int_flag_clear) = BIT(ENET_BIT_POS(int_flag_clear)); +} + +/*! + \brief ENET Tx function enable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_tx_enable(void) +{ + ENET_MAC_CFG |= ENET_MAC_CFG_TEN; + enet_txfifo_flush(); + ENET_DMA_CTL |= ENET_DMA_CTL_STE; +} + +/*! + \brief ENET Tx function disable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_tx_disable(void) +{ + ENET_DMA_CTL &= ~ENET_DMA_CTL_STE; + enet_txfifo_flush(); + ENET_MAC_CFG &= ~ENET_MAC_CFG_TEN; +} + +/*! + \brief ENET Rx function enable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_rx_enable(void) +{ + ENET_MAC_CFG |= ENET_MAC_CFG_REN; + ENET_DMA_CTL |= ENET_DMA_CTL_SRE; +} + +/*! + \brief ENET Rx function disable (include MAC and DMA module) + \param[in] none + \param[out] none + \retval none +*/ +void enet_rx_disable(void) +{ + ENET_DMA_CTL &= ~ENET_DMA_CTL_SRE; + ENET_MAC_CFG &= ~ENET_MAC_CFG_REN; +} + +/*! + \brief put registers value into the application buffer + \param[in] type: register type which will be get, refer to enet_registers_type_enum, + only one parameter can be selected which is shown as below + \arg ALL_MAC_REG: get the registers within the offset scope between ENET_MAC_CFG and ENET_MAC_FCTH + \arg ALL_MSC_REG: get the registers within the offset scope between ENET_MSC_CTL and ENET_MSC_RGUFCNT + \arg ALL_PTP_REG: get the registers within the offset scope between ENET_PTP_TSCTL and ENET_PTP_PPSCTL + \arg ALL_DMA_REG: get the registers within the offset scope between ENET_DMA_BCTL and ENET_DMA_CRBADDR + \param[in] num: the number of registers that the user want to get + \param[out] preg: the application buffer pointer for storing the register value + \retval none +*/ +void enet_registers_get(enet_registers_type_enum type, uint32_t *preg, uint32_t num) +{ + uint32_t offset = 0U, max = 0U, limit = 0U; + + offset = (uint32_t)type; + max = (uint32_t)type + num; + limit = sizeof(enet_reg_tab)/sizeof(uint16_t); + + /* prevent element in this array is out of range */ + if(max > limit){ + max = limit; + } + + for(; offset < max; offset++){ + /* get value of the corresponding register */ + *preg = REG32((ENET) + enet_reg_tab[offset]); + preg++; + } +} + +/*! + \brief enable the MAC address filter + \param[in] mac_addr: select which MAC address will be enable + \arg ENET_MAC_ADDRESS1: enable MAC address 1 filter + \arg ENET_MAC_ADDRESS2: enable MAC address 2 filter + \arg ENET_MAC_ADDRESS3: enable MAC address 3 filter + \param[out] none + \retval none +*/ +void enet_address_filter_enable(enet_macaddress_enum mac_addr) +{ + REG32(ENET_ADDRH_BASE + mac_addr) |= ENET_MAC_ADDR1H_AFE; +} + +/*! + \brief disable the MAC address filter + \param[in] mac_addr: select which MAC address will be disable, + only one parameter can be selected which is shown as below + \arg ENET_MAC_ADDRESS1: disable MAC address 1 filter + \arg ENET_MAC_ADDRESS2: disable MAC address 2 filter + \arg ENET_MAC_ADDRESS3: disable MAC address 3 filter + \param[out] none + \retval none +*/ +void enet_address_filter_disable(enet_macaddress_enum mac_addr) +{ + REG32(ENET_ADDRH_BASE + mac_addr) &= ~ENET_MAC_ADDR1H_AFE; +} + +/*! + \brief configure the MAC address filter + \param[in] mac_addr: select which MAC address will be configured, + only one parameter can be selected which is shown as below + \arg ENET_MAC_ADDRESS1: configure MAC address 1 filter + \arg ENET_MAC_ADDRESS2: configure MAC address 2 filter + \arg ENET_MAC_ADDRESS3: configure MAC address 3 filter + \param[in] addr_mask: select which MAC address bytes will be mask, + one or more parameters can be selected which are shown as below + \arg ENET_ADDRESS_MASK_BYTE0: mask ENET_MAC_ADDR1L[7:0] bits + \arg ENET_ADDRESS_MASK_BYTE1: mask ENET_MAC_ADDR1L[15:8] bits + \arg ENET_ADDRESS_MASK_BYTE2: mask ENET_MAC_ADDR1L[23:16] bits + \arg ENET_ADDRESS_MASK_BYTE3: mask ENET_MAC_ADDR1L [31:24] bits + \arg ENET_ADDRESS_MASK_BYTE4: mask ENET_MAC_ADDR1H [7:0] bits + \arg ENET_ADDRESS_MASK_BYTE5: mask ENET_MAC_ADDR1H [15:8] bits + \param[in] filter_type: select which MAC address filter type will be selected, + only one parameter can be selected which is shown as below + \arg ENET_ADDRESS_FILTER_SA: The MAC address is used to compared with the SA field of the received frame + \arg ENET_ADDRESS_FILTER_DA: The MAC address is used to compared with the DA field of the received frame + \param[out] none + \retval none +*/ +void enet_address_filter_config(enet_macaddress_enum mac_addr, uint32_t addr_mask, uint32_t filter_type) +{ + uint32_t reg; + + /* get the address filter register value which is to be configured */ + reg = REG32(ENET_ADDRH_BASE + mac_addr); + + /* clear and configure the address filter register */ + reg &= ~(ENET_MAC_ADDR1H_MB | ENET_MAC_ADDR1H_SAF); + reg |= (addr_mask | filter_type); + REG32(ENET_ADDRH_BASE + mac_addr) = reg; +} + +/*! + \brief PHY interface configuration (configure SMI clock and reset PHY chip) + \param[in] none + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_phy_config(void) +{ + uint32_t ahbclk; + uint32_t reg; + uint16_t phy_value; + ErrStatus enet_state = ERROR; + + /* clear the previous MDC clock */ + reg = ENET_MAC_PHY_CTL; + reg &= ~ENET_MAC_PHY_CTL_CLR; + + /* get the HCLK frequency */ + ahbclk = rcu_clock_freq_get(CK_AHB); + + /* configure MDC clock according to HCLK frequency range */ + if(ENET_RANGE(ahbclk, 20000000U, 35000000U)){ + reg |= ENET_MDC_HCLK_DIV16; + }else if(ENET_RANGE(ahbclk, 35000000U, 60000000U)){ + reg |= ENET_MDC_HCLK_DIV26; + }else if(ENET_RANGE(ahbclk, 60000000U, 90000000U)){ + reg |= ENET_MDC_HCLK_DIV42; + }else if((ENET_RANGE(ahbclk, 90000000U, 108000000U))||(108000000U == ahbclk)){ + reg |= ENET_MDC_HCLK_DIV62; + }else{ + return enet_state; + } + ENET_MAC_PHY_CTL = reg; + + /* reset PHY */ + phy_value = PHY_RESET; + if(ERROR == (enet_phy_write_read(ENET_PHY_WRITE, PHY_ADDRESS, PHY_REG_BCR, &phy_value))){ + return enet_state; + } + /* PHY reset need some time */ + _ENET_DELAY_(ENET_DELAY_TO); + + /* check whether PHY reset is complete */ + if(ERROR == (enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_REG_BCR, &phy_value))){ + return enet_state; + } + + /* PHY reset complete */ + if(RESET == (phy_value & PHY_RESET)){ + enet_state = SUCCESS; + } + + return enet_state; +} + +/*! + \brief write to / read from a PHY register + \param[in] direction: only one parameter can be selected which is shown as below + \arg ENET_PHY_WRITE: write data to phy register + \arg ENET_PHY_READ: read data from phy register + \param[in] phy_address: 0x0 - 0x1F + \param[in] phy_reg: 0x0 - 0x1F + \param[in] pvalue: the value will be written to the PHY register in ENET_PHY_WRITE direction + \param[out] pvalue: the value will be read from the PHY register in ENET_PHY_READ direction + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_phy_write_read(enet_phydirection_enum direction, uint16_t phy_address, uint16_t phy_reg, uint16_t *pvalue) +{ + uint32_t reg, phy_flag; + uint32_t timeout = 0U; + ErrStatus enet_state = ERROR; + + /* configure ENET_MAC_PHY_CTL with write/read operation */ + reg = ENET_MAC_PHY_CTL; + reg &= ~(ENET_MAC_PHY_CTL_PB | ENET_MAC_PHY_CTL_PW | ENET_MAC_PHY_CTL_PR | ENET_MAC_PHY_CTL_PA); + reg |= (direction | MAC_PHY_CTL_PR(phy_reg) | MAC_PHY_CTL_PA(phy_address) | ENET_MAC_PHY_CTL_PB); + + /* if do the write operation, write value to the register */ + if(ENET_PHY_WRITE == direction){ + ENET_MAC_PHY_DATA = *pvalue; + } + + /* do PHY write/read operation, and wait the operation complete */ + ENET_MAC_PHY_CTL = reg; + do{ + phy_flag = (ENET_MAC_PHY_CTL & ENET_MAC_PHY_CTL_PB); + timeout++; + } + while((RESET != phy_flag) && (ENET_DELAY_TO != timeout)); + + /* write/read operation complete */ + if(RESET == (ENET_MAC_PHY_CTL & ENET_MAC_PHY_CTL_PB)){ + enet_state = SUCCESS; + } + + /* if do the read operation, get value from the register */ + if(ENET_PHY_READ == direction){ + *pvalue = (uint16_t)ENET_MAC_PHY_DATA; + } + + return enet_state; +} + +/*! + \brief enable the loopback function of PHY chip + \param[in] none + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus enet_phyloopback_enable(void) +{ + uint16_t temp_phy = 0U; + ErrStatus phy_state = ERROR; + + /* get the PHY configuration to update it */ + enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_REG_BCR, &temp_phy); + + /* enable the PHY loopback mode */ + temp_phy |= PHY_LOOPBACK; + + /* update the PHY control register with the new configuration */ + phy_state = enet_phy_write_read(ENET_PHY_WRITE, PHY_ADDRESS, PHY_REG_BCR, &temp_phy); + + return phy_state; +} + +/*! + \brief disable the loopback function of PHY chip + \param[in] none + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus enet_phyloopback_disable(void) +{ + uint16_t temp_phy = 0U; + ErrStatus phy_state = ERROR; + + /* get the PHY configuration to update it */ + enet_phy_write_read(ENET_PHY_READ, PHY_ADDRESS, PHY_REG_BCR, &temp_phy); + + /* disable the PHY loopback mode */ + temp_phy &= (uint16_t)~PHY_LOOPBACK; + + /* update the PHY control register with the new configuration */ + phy_state = enet_phy_write_read(ENET_PHY_WRITE, PHY_ADDRESS, PHY_REG_BCR, &temp_phy); + + return phy_state; +} + +/*! + \brief enable ENET forward feature + \param[in] feature: the feature of ENET forward mode, + one or more parameters can be selected which are shown as below + \arg ENET_AUTO_PADCRC_DROP: the function of the MAC strips the Pad/FCS field on received frames + \arg ENET_FORWARD_ERRFRAMES: the function that all frame received with error except runt error are forwarded to memory + \arg ENET_FORWARD_UNDERSZ_GOODFRAMES: the function that forwarding undersized good frames + \param[out] none + \retval none +*/ +void enet_forward_feature_enable(uint32_t feature) +{ + uint32_t mask; + + mask = (feature & (~(ENET_FORWARD_ERRFRAMES | ENET_FORWARD_UNDERSZ_GOODFRAMES))); + ENET_MAC_CFG |= mask; + + mask = (feature & (~(ENET_AUTO_PADCRC_DROP))); + ENET_DMA_CTL |= (mask >> 2); +} + +/*! + \brief disable ENET forward feature + \param[in] feature: the feature of ENET forward mode, + one or more parameters can be selected which are shown as below + \arg ENET_AUTO_PADCRC_DROP: the function of the MAC strips the Pad/FCS field on received frames + \arg ENET_FORWARD_ERRFRAMES: the function that all frame received with error except runt error are forwarded to memory + \arg ENET_FORWARD_UNDERSZ_GOODFRAMES: the function that forwarding undersized good frames + \param[out] none + \retval none +*/ +void enet_forward_feature_disable(uint32_t feature) +{ + uint32_t mask; + + mask = (feature & (~(ENET_FORWARD_ERRFRAMES | ENET_FORWARD_UNDERSZ_GOODFRAMES))); + ENET_MAC_CFG &= ~mask; + + mask = (feature & (~(ENET_AUTO_PADCRC_DROP))); + ENET_DMA_CTL &= ~(mask >> 2); +} + +/*! + \brief enable ENET filter feature + \param[in] feature: the feature of ENET filter mode, + one or more parameters can be selected which are shown as below + \arg ENET_SRC_FILTER: filter source address function + \arg ENET_SRC_FILTER_INVERSE: inverse source address filtering result function + \arg ENET_DEST_FILTER_INVERSE: inverse DA filtering result function + \arg ENET_MULTICAST_FILTER_PASS: pass all multicast frames function + \arg ENET_MULTICAST_FILTER_HASH_MODE: HASH multicast filter function + \arg ENET_UNICAST_FILTER_HASH_MODE: HASH unicast filter function + \arg ENET_FILTER_MODE_EITHER: HASH or perfect filter function + \param[out] none + \retval none +*/ +void enet_filter_feature_enable(uint32_t feature) +{ + ENET_MAC_FRMF |= feature; +} + +/*! + \brief disable ENET filter feature + \param[in] feature: the feature of ENET filter mode, + one or more parameters can be selected which are shown as below + \arg ENET_SRC_FILTER: filter source address function + \arg ENET_SRC_FILTER_INVERSE: inverse source address filtering result function + \arg ENET_DEST_FILTER_INVERSE: inverse DA filtering result function + \arg ENET_MULTICAST_FILTER_PASS: pass all multicast frames function + \arg ENET_MULTICAST_FILTER_HASH_MODE: HASH multicast filter function + \arg ENET_UNICAST_FILTER_HASH_MODE: HASH unicast filter function + \arg ENET_FILTER_MODE_EITHER: HASH or perfect filter function + \param[out] none + \retval none +*/ +void enet_filter_feature_disable(uint32_t feature) +{ + ENET_MAC_FRMF &= ~feature; +} + +/*! + \brief generate the pause frame, ENET will send pause frame after enable transmit flow control + this function only use in full-dulex mode + \param[in] none + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus enet_pauseframe_generate(void) +{ + ErrStatus enet_state =ERROR; + uint32_t temp = 0U; + + /* in full-duplex mode, must make sure this bit is 0 before writing register */ + temp = ENET_MAC_FCTL & ENET_MAC_FCTL_FLCBBKPA; + if(RESET == temp){ + ENET_MAC_FCTL |= ENET_MAC_FCTL_FLCBBKPA; + enet_state = SUCCESS; + } + return enet_state; +} + +/*! + \brief configure the pause frame detect type + \param[in] detect: pause frame detect type, + only one parameter can be selected which is shown as below + \arg ENET_MAC0_AND_UNIQUE_ADDRESS_PAUSEDETECT: besides the unique multicast address, MAC can also + use the MAC0 address to detecting pause frame + \arg ENET_UNIQUE_PAUSEDETECT: only the unique multicast address for pause frame which is specified + in IEEE802.3 can be detected + \param[out] none + \retval none +*/ +void enet_pauseframe_detect_config(uint32_t detect) +{ + ENET_MAC_FCTL &= ~ENET_MAC_FCTL_UPFDT; + ENET_MAC_FCTL |= detect; +} + +/*! + \brief configure the pause frame parameters + \param[in] pausetime: pause time in transmit pause control frame + \param[in] pause_threshold: the threshold of the pause timer for retransmitting frames automatically, + this value must make sure to be less than configured pause time, only one parameter can be + selected which is shown as below + \arg ENET_PAUSETIME_MINUS4: pause time minus 4 slot times + \arg ENET_PAUSETIME_MINUS28: pause time minus 28 slot times + \arg ENET_PAUSETIME_MINUS144: pause time minus 144 slot times + \arg ENET_PAUSETIME_MINUS256: pause time minus 256 slot times + \param[out] none + \retval none +*/ +void enet_pauseframe_config(uint32_t pausetime, uint32_t pause_threshold) +{ + ENET_MAC_FCTL &= ~(ENET_MAC_FCTL_PTM | ENET_MAC_FCTL_PLTS); + ENET_MAC_FCTL |= (MAC_FCTL_PTM(pausetime) | pause_threshold); +} + +/*! + \brief configure the threshold of the flow control(deactive and active threshold) + \param[in] deactive: the threshold of the deactive flow control, this value + should always be less than active flow control value, only one + parameter can be selected which is shown as below + \arg ENET_DEACTIVE_THRESHOLD_256BYTES: threshold level is 256 bytes + \arg ENET_DEACTIVE_THRESHOLD_512BYTES: threshold level is 512 bytes + \arg ENET_DEACTIVE_THRESHOLD_768BYTES: threshold level is 768 bytes + \arg ENET_DEACTIVE_THRESHOLD_1024BYTES: threshold level is 1024 bytes + \arg ENET_DEACTIVE_THRESHOLD_1280BYTES: threshold level is 1280 bytes + \arg ENET_DEACTIVE_THRESHOLD_1536BYTES: threshold level is 1536 bytes + \arg ENET_DEACTIVE_THRESHOLD_1792BYTES: threshold level is 1792 bytes + \param[in] active: the threshold of the active flow control, only one parameter + can be selected which is shown as below + \arg ENET_ACTIVE_THRESHOLD_256BYTES: threshold level is 256 bytes + \arg ENET_ACTIVE_THRESHOLD_512BYTES: threshold level is 512 bytes + \arg ENET_ACTIVE_THRESHOLD_768BYTES: threshold level is 768 bytes + \arg ENET_ACTIVE_THRESHOLD_1024BYTES: threshold level is 1024 bytes + \arg ENET_ACTIVE_THRESHOLD_1280BYTES: threshold level is 1280 bytes + \arg ENET_ACTIVE_THRESHOLD_1536BYTES: threshold level is 1536 bytes + \arg ENET_ACTIVE_THRESHOLD_1792BYTES: threshold level is 1792 bytes + \param[out] none + \retval none +*/ +void enet_flowcontrol_threshold_config(uint32_t deactive, uint32_t active) +{ + ENET_MAC_FCTH = ((deactive | active) >> 8); +} + +/*! + \brief enable ENET flow control feature + \param[in] feature: the feature of ENET flow control mode + one or more parameters can be selected which are shown as below + \arg ENET_ZERO_QUANTA_PAUSE: the automatic zero-quanta generation function + \arg ENET_TX_FLOWCONTROL: the flow control operation in the MAC + \arg ENET_RX_FLOWCONTROL: decoding function for the received pause frame and process it + \arg ENET_BACK_PRESSURE: back pressure operation in the MAC(only use in half-dulex mode) + \param[out] none + \retval none +*/ +void enet_flowcontrol_feature_enable(uint32_t feature) +{ + if(RESET != (feature & ENET_ZERO_QUANTA_PAUSE)){ + ENET_MAC_FCTL &= ~ENET_ZERO_QUANTA_PAUSE; + } + feature &= ~ENET_ZERO_QUANTA_PAUSE; + ENET_MAC_FCTL |= feature; +} + +/*! + \brief disable ENET flow control feature + \param[in] feature: the feature of ENET flow control mode + one or more parameters can be selected which are shown as below + \arg ENET_ZERO_QUANTA_PAUSE: the automatic zero-quanta generation function + \arg ENET_TX_FLOWCONTROL: the flow control operation in the MAC + \arg ENET_RX_FLOWCONTROL: decoding function for the received pause frame and process it + \arg ENET_BACK_PRESSURE: back pressure operation in the MAC(only use in half-dulex mode) + \param[out] none + \retval none +*/ +void enet_flowcontrol_feature_disable(uint32_t feature) +{ + if(RESET != (feature & ENET_ZERO_QUANTA_PAUSE)){ + ENET_MAC_FCTL |= ENET_ZERO_QUANTA_PAUSE; + } + feature &= ~ENET_ZERO_QUANTA_PAUSE; + ENET_MAC_FCTL &= ~feature; +} + +/*! + \brief get the dma transmit/receive process state + \param[in] direction: choose the direction of dma process which users want to check, + refer to enet_dmadirection_enum, only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: dma transmit process + \arg ENET_DMA_RX: dma receive process + \param[out] none + \retval state of dma process, the value range shows below: + ENET_RX_STATE_STOPPED, ENET_RX_STATE_FETCHING, ENET_RX_STATE_WAITING, + ENET_RX_STATE_SUSPENDED, ENET_RX_STATE_CLOSING, ENET_RX_STATE_QUEUING, + ENET_TX_STATE_STOPPED, ENET_TX_STATE_FETCHING, ENET_TX_STATE_WAITING, + ENET_TX_STATE_READING, ENET_TX_STATE_SUSPENDED, ENET_TX_STATE_CLOSING +*/ +uint32_t enet_dmaprocess_state_get(enet_dmadirection_enum direction) +{ + uint32_t reval; + reval = (uint32_t)(ENET_DMA_STAT & (uint32_t)direction); + return reval; +} + +/*! + \brief poll the DMA transmission/reception enable by writing any value to the + ENET_DMA_TPEN/ENET_DMA_RPEN register, this will make the DMA to resume transmission/reception + \param[in] direction: choose the direction of DMA process which users want to resume, + refer to enet_dmadirection_enum, only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: DMA transmit process + \arg ENET_DMA_RX: DMA receive process + \param[out] none + \retval none +*/ +void enet_dmaprocess_resume(enet_dmadirection_enum direction) +{ + if(ENET_DMA_TX == direction){ + ENET_DMA_TPEN = 0U; + }else{ + ENET_DMA_RPEN = 0U; + } +} + +/*! + \brief check and recover the Rx process + \param[in] none + \param[out] none + \retval none +*/ +void enet_rxprocess_check_recovery(void) +{ + uint32_t status; + + /* get DAV information of current RxDMA descriptor */ + status = dma_current_rxdesc->status; + status &= ENET_RDES0_DAV; + + /* if current descriptor is owned by DMA, but the descriptor address mismatches with + receive descriptor address pointer updated by RxDMA controller */ + if((ENET_DMA_CRDADDR != ((uint32_t)dma_current_rxdesc)) && + (ENET_RDES0_DAV == status)){ + dma_current_rxdesc = (enet_descriptors_struct*)ENET_DMA_CRDADDR; + } +} + +/*! + \brief flush the ENET transmit FIFO, and wait until the flush operation completes + \param[in] none + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus enet_txfifo_flush(void) +{ + uint32_t flush_state; + uint32_t timeout = 0U; + ErrStatus enet_state = ERROR; + + /* set the FTF bit for flushing transmit FIFO */ + ENET_DMA_CTL |= ENET_DMA_CTL_FTF; + /* wait until the flush operation completes */ + do{ + flush_state = ENET_DMA_CTL & ENET_DMA_CTL_FTF; + timeout++; + }while((RESET != flush_state) && (timeout < ENET_DELAY_TO)); + /* return ERROR due to timeout */ + if(RESET == flush_state){ + enet_state = SUCCESS; + } + + return enet_state; +} + +/*! + \brief get the transmit/receive address of current descriptor, or current buffer, or descriptor table + \param[in] addr_get: choose the address which users want to get, refer to enet_desc_reg_enum, + only one parameter can be selected which is shown as below + \arg ENET_RX_DESC_TABLE: the start address of the receive descriptor table + \arg ENET_RX_CURRENT_DESC: the start descriptor address of the current receive descriptor read by + the RxDMA controller + \arg ENET_RX_CURRENT_BUFFER: the current receive buffer address being read by the RxDMA controller + \arg ENET_TX_DESC_TABLE: the start address of the transmit descriptor table + \arg ENET_TX_CURRENT_DESC: the start descriptor address of the current transmit descriptor read by + the TxDMA controller + \arg ENET_TX_CURRENT_BUFFER: the current transmit buffer address being read by the TxDMA controller + \param[out] none + \retval address value +*/ +uint32_t enet_current_desc_address_get(enet_desc_reg_enum addr_get) +{ + uint32_t reval = 0U; + + reval = REG32((ENET) +(uint32_t)addr_get); + return reval; +} + +/*! + \brief get the Tx or Rx descriptor information + \param[in] desc: the descriptor pointer which users want to get information + \param[in] info_get: the descriptor information type which is selected, + only one parameter can be selected which is shown as below + \arg RXDESC_BUFFER_1_SIZE: receive buffer 1 size + \arg RXDESC_BUFFER_2_SIZE: receive buffer 2 size + \arg RXDESC_FRAME_LENGTH: the byte length of the received frame that was transferred to the buffer + \arg TXDESC_COLLISION_COUNT: the number of collisions occurred before the frame was transmitted + \arg RXDESC_BUFFER_1_ADDR: the buffer1 address of the Rx frame + \arg TXDESC_BUFFER_1_ADDR: the buffer1 address of the Tx frame + \param[out] none + \retval descriptor information, if value is 0xFFFFFFFFU, means the false input parameter +*/ +uint32_t enet_desc_information_get(enet_descriptors_struct *desc, enet_descstate_enum info_get) +{ + uint32_t reval = 0xFFFFFFFFU; + + switch(info_get){ + case RXDESC_BUFFER_1_SIZE: + reval = GET_RDES1_RB1S(desc->control_buffer_size); + break; + case RXDESC_BUFFER_2_SIZE: + reval = GET_RDES1_RB2S(desc->control_buffer_size); + break; + case RXDESC_FRAME_LENGTH: + reval = GET_RDES0_FRML(desc->status); + if(reval > 4U){ + reval = reval - 4U; + }else{ + reval = 0U; + } + break; + case RXDESC_BUFFER_1_ADDR: + reval = desc->buffer1_addr; + break; + case TXDESC_BUFFER_1_ADDR: + reval = desc->buffer1_addr; + break; + case TXDESC_COLLISION_COUNT: + reval = GET_TDES0_COCNT(desc->status); + break; + default: + break; + } + return reval; +} + +/*! + \brief get the number of missed frames during receiving + \param[in] none + \param[out] rxfifo_drop: pointer to the number of frames dropped by RxFIFO + \param[out] rxdma_drop: pointer to the number of frames missed by the RxDMA controller + \retval none +*/ +void enet_missed_frame_counter_get(uint32_t *rxfifo_drop, uint32_t *rxdma_drop) +{ + uint32_t temp_counter = 0U; + + temp_counter = ENET_DMA_MFBOCNT; + *rxfifo_drop = GET_DMA_MFBOCNT_MSFA(temp_counter); + *rxdma_drop = GET_DMA_MFBOCNT_MSFC(temp_counter); +} + +/*! + \brief get the bit flag of ENET DMA descriptor + \param[in] desc: the descriptor pointer which users want to get flag + \param[in] desc_flag: the bit flag of ENET DMA descriptor, + only one parameter can be selected which is shown as below + \arg ENET_TDES0_DB: deferred + \arg ENET_TDES0_UFE: underflow error + \arg ENET_TDES0_EXD: excessive deferral + \arg ENET_TDES0_VFRM: VLAN frame + \arg ENET_TDES0_ECO: excessive collision + \arg ENET_TDES0_LCO: late collision + \arg ENET_TDES0_NCA: no carrier + \arg ENET_TDES0_LCA: loss of carrier + \arg ENET_TDES0_IPPE: IP payload error + \arg ENET_TDES0_FRMF: frame flushed + \arg ENET_TDES0_JT: jabber timeout + \arg ENET_TDES0_ES: error summary + \arg ENET_TDES0_IPHE: IP header error + \arg ENET_TDES0_TTMSS: transmit timestamp status + \arg ENET_TDES0_TCHM: the second address chained mode + \arg ENET_TDES0_TERM: transmit end of ring mode + \arg ENET_TDES0_TTSEN: transmit timestamp function enable + \arg ENET_TDES0_DPAD: disable adding pad + \arg ENET_TDES0_DCRC: disable CRC + \arg ENET_TDES0_FSG: first segment + \arg ENET_TDES0_LSG: last segment + \arg ENET_TDES0_INTC: interrupt on completion + \arg ENET_TDES0_DAV: DAV bit + + \arg ENET_RDES0_PCERR: payload checksum error + \arg ENET_RDES0_CERR: CRC error + \arg ENET_RDES0_DBERR: dribble bit error + \arg ENET_RDES0_RERR: receive error + \arg ENET_RDES0_RWDT: receive watchdog timeout + \arg ENET_RDES0_FRMT: frame type + \arg ENET_RDES0_LCO: late collision + \arg ENET_RDES0_IPHERR: IP frame header error + \arg ENET_RDES0_LDES: last descriptor + \arg ENET_RDES0_FDES: first descriptor + \arg ENET_RDES0_VTAG: VLAN tag + \arg ENET_RDES0_OERR: overflow error + \arg ENET_RDES0_LERR: length error + \arg ENET_RDES0_SAFF: SA filter fail + \arg ENET_RDES0_DERR: descriptor error + \arg ENET_RDES0_ERRS: error summary + \arg ENET_RDES0_DAFF: destination address filter fail + \arg ENET_RDES0_DAV: descriptor available + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus enet_desc_flag_get(enet_descriptors_struct *desc, uint32_t desc_flag) +{ + FlagStatus enet_flag = RESET; + + if ((uint32_t)RESET != (desc->status & desc_flag)){ + enet_flag = SET; + } + + return enet_flag; +} + +/*! + \brief set the bit flag of ENET DMA descriptor + \param[in] desc: the descriptor pointer which users want to set flag + \param[in] desc_flag: the bit flag of ENET DMA descriptor, + only one parameter can be selected which is shown as below + \arg ENET_TDES0_VFRM: VLAN frame + \arg ENET_TDES0_FRMF: frame flushed + \arg ENET_TDES0_TCHM: the second address chained mode + \arg ENET_TDES0_TERM: transmit end of ring mode + \arg ENET_TDES0_TTSEN: transmit timestamp function enable + \arg ENET_TDES0_DPAD: disable adding pad + \arg ENET_TDES0_DCRC: disable CRC + \arg ENET_TDES0_FSG: first segment + \arg ENET_TDES0_LSG: last segment + \arg ENET_TDES0_INTC: interrupt on completion + \arg ENET_TDES0_DAV: DAV bit + \arg ENET_RDES0_DAV: descriptor available + \param[out] none + \retval none +*/ +void enet_desc_flag_set(enet_descriptors_struct *desc, uint32_t desc_flag) +{ + desc->status |= desc_flag; +} + +/*! + \brief clear the bit flag of ENET DMA descriptor + \param[in] desc: the descriptor pointer which users want to clear flag + \param[in] desc_flag: the bit flag of ENET DMA descriptor, + only one parameter can be selected which is shown as below + \arg ENET_TDES0_VFRM: VLAN frame + \arg ENET_TDES0_FRMF: frame flushed + \arg ENET_TDES0_TCHM: the second address chained mode + \arg ENET_TDES0_TERM: transmit end of ring mode + \arg ENET_TDES0_TTSEN: transmit timestamp function enable + \arg ENET_TDES0_DPAD: disable adding pad + \arg ENET_TDES0_DCRC: disable CRC + \arg ENET_TDES0_FSG: first segment + \arg ENET_TDES0_LSG: last segment + \arg ENET_TDES0_INTC: interrupt on completion + \arg ENET_TDES0_DAV: DAV bit + \arg ENET_RDES0_DAV: descriptor available + \param[out] none + \retval none +*/ +void enet_desc_flag_clear(enet_descriptors_struct *desc, uint32_t desc_flag) +{ + desc->status &= ~desc_flag; +} + +/*! + \brief when receiving completed, set RS bit in ENET_DMA_STAT register will set + \param[in] desc: the descriptor pointer which users want to configure + \param[out] none + \retval none +*/ +void enet_desc_receive_complete_bit_enable(enet_descriptors_struct *desc) +{ + desc->control_buffer_size &= ~ENET_RDES1_DINTC; +} + +/*! + \brief when receiving completed, set RS bit in ENET_DMA_STAT register will not set + \param[in] desc: the descriptor pointer which users want to configure + \param[out] none + \retval none +*/ +void enet_desc_receive_complete_bit_disable(enet_descriptors_struct *desc) +{ + desc->control_buffer_size |= ENET_RDES1_DINTC; +} + +/*! + \brief drop current receive frame + \param[in] none + \param[out] none + \retval none +*/ +void enet_rxframe_drop(void) +{ + /* enable reception, descriptor is owned by DMA */ + dma_current_rxdesc->status = ENET_RDES0_DAV; + + /* chained mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RCHM)){ + if(NULL != dma_current_ptp_rxdesc){ + dma_current_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->buffer2_next_desc_addr); + /* if it is the last ptp descriptor */ + if(0U != dma_current_ptp_rxdesc->status){ + /* pointer back to the first ptp descriptor address in the desc_ptptab list address */ + dma_current_ptp_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->status); + }else{ + /* ponter to the next ptp descriptor */ + dma_current_ptp_rxdesc++; + } + }else{ + dma_current_rxdesc = (enet_descriptors_struct*) (dma_current_rxdesc->buffer2_next_desc_addr); + } + + }else{ + /* ring mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RERM)){ + /* if is the last descriptor in table, the next descriptor is the table header */ + dma_current_rxdesc = (enet_descriptors_struct*) (ENET_DMA_RDTADDR); + if(NULL != dma_current_ptp_rxdesc){ + dma_current_ptp_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->status); + } + }else{ + /* the next descriptor is the current address, add the descriptor size, and descriptor skip length */ + dma_current_rxdesc = (enet_descriptors_struct*) (uint32_t)((uint32_t)dma_current_rxdesc + ETH_DMARXDESC_SIZE + GET_DMA_BCTL_DPSL(ENET_DMA_BCTL)); + if(NULL != dma_current_ptp_rxdesc){ + dma_current_ptp_rxdesc++; + } + } + } +} + +/*! + \brief enable DMA feature + \param[in] feature: the feature of DMA mode, + one or more parameters can be selected which are shown as below + \arg ENET_NO_FLUSH_RXFRAME: RxDMA does not flushes frames function + \arg ENET_SECONDFRAME_OPT: TxDMA controller operate on second frame function + \param[out] none + \retval none +*/ +void enet_dma_feature_enable(uint32_t feature) +{ + ENET_DMA_CTL |= feature; +} + +/*! + \brief disable DMA feature + \param[in] feature: the feature of DMA mode, + one or more parameters can be selected which are shown as below + \arg ENET_NO_FLUSH_RXFRAME: RxDMA does not flushes frames function + \arg ENET_SECONDFRAME_OPT: TxDMA controller operate on second frame function + \param[out] none + \retval none +*/ +void enet_dma_feature_disable(uint32_t feature) +{ + ENET_DMA_CTL &= ~feature; +} + +/*! + \brief initialize the DMA Tx/Rx descriptors's parameters in normal chain mode with PTP function + \param[in] direction: the descriptors which users want to init, refer to enet_dmadirection_enum, + only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: DMA Tx descriptors + \arg ENET_DMA_RX: DMA Rx descriptors + \param[in] desc_ptptab: pointer to the first descriptor address of PTP Rx descriptor table + \param[out] none + \retval none +*/ +void enet_ptp_normal_descriptors_chain_init(enet_dmadirection_enum direction, enet_descriptors_struct *desc_ptptab) +{ + uint32_t num = 0U, count = 0U, maxsize = 0U; + uint32_t desc_status = 0U, desc_bufsize = 0U; + enet_descriptors_struct *desc, *desc_tab; + uint8_t *buf; + + /* if want to initialize DMA Tx descriptors */ + if (ENET_DMA_TX == direction){ + /* save a copy of the DMA Tx descriptors */ + desc_tab = txdesc_tab; + buf = &tx_buff[0][0]; + count = ENET_TXBUF_NUM; + maxsize = ENET_TXBUF_SIZE; + + /* select chain mode, and enable transmit timestamp function */ + desc_status = ENET_TDES0_TCHM | ENET_TDES0_TTSEN; + + /* configure DMA Tx descriptor table address register */ + ENET_DMA_TDTADDR = (uint32_t)desc_tab; + dma_current_txdesc = desc_tab; + dma_current_ptp_txdesc = desc_ptptab; + }else{ + /* if want to initialize DMA Rx descriptors */ + /* save a copy of the DMA Rx descriptors */ + desc_tab = rxdesc_tab; + buf = &rx_buff[0][0]; + count = ENET_RXBUF_NUM; + maxsize = ENET_RXBUF_SIZE; + + /* enable receiving */ + desc_status = ENET_RDES0_DAV; + /* select receive chained mode and set buffer1 size */ + desc_bufsize = ENET_RDES1_RCHM | (uint32_t)ENET_RXBUF_SIZE; + + /* configure DMA Rx descriptor table address register */ + ENET_DMA_RDTADDR = (uint32_t)desc_tab; + dma_current_rxdesc = desc_tab; + dma_current_ptp_rxdesc = desc_ptptab; + } + + /* configure each descriptor */ + for(num = 0U; num < count; num++){ + /* get the pointer to the next descriptor of the descriptor table */ + desc = desc_tab + num; + + /* configure descriptors */ + desc->status = desc_status; + desc->control_buffer_size = desc_bufsize; + desc->buffer1_addr = (uint32_t)(&buf[num * maxsize]); + + /* if is not the last descriptor */ + if(num < (count - 1U)){ + /* configure the next descriptor address */ + desc->buffer2_next_desc_addr = (uint32_t)(desc_tab + num + 1U); + }else{ + /* when it is the last descriptor, the next descriptor address + equals to first descriptor address in descriptor table */ + desc->buffer2_next_desc_addr = (uint32_t)desc_tab; + } + /* set desc_ptptab equal to desc_tab */ + (&desc_ptptab[num])->buffer1_addr = desc->buffer1_addr; + (&desc_ptptab[num])->buffer2_next_desc_addr = desc->buffer2_next_desc_addr; + } + /* when it is the last ptp descriptor, preserve the first descriptor + address of desc_ptptab in ptp descriptor status */ + (&desc_ptptab[num-1U])->status = (uint32_t)desc_ptptab; +} + +/*! + \brief initialize the DMA Tx/Rx descriptors's parameters in normal ring mode with PTP function + \param[in] direction: the descriptors which users want to init, refer to enet_dmadirection_enum, + only one parameter can be selected which is shown as below + \arg ENET_DMA_TX: DMA Tx descriptors + \arg ENET_DMA_RX: DMA Rx descriptors + \param[in] desc_ptptab: pointer to the first descriptor address of PTP Rx descriptor table + \param[out] none + \retval none +*/ +void enet_ptp_normal_descriptors_ring_init(enet_dmadirection_enum direction, enet_descriptors_struct *desc_ptptab) +{ + uint32_t num = 0U, count = 0U, maxsize = 0U; + uint32_t desc_status = 0U, desc_bufsize = 0U; + enet_descriptors_struct *desc, *desc_tab; + uint8_t *buf; + + /* configure descriptor skip length */ + ENET_DMA_BCTL &= ~ENET_DMA_BCTL_DPSL; + ENET_DMA_BCTL |= DMA_BCTL_DPSL(0); + + /* if want to initialize DMA Tx descriptors */ + if (ENET_DMA_TX == direction){ + /* save a copy of the DMA Tx descriptors */ + desc_tab = txdesc_tab; + buf = &tx_buff[0][0]; + count = ENET_TXBUF_NUM; + maxsize = ENET_TXBUF_SIZE; + + /* select ring mode, and enable transmit timestamp function */ + desc_status = ENET_TDES0_TTSEN; + + /* configure DMA Tx descriptor table address register */ + ENET_DMA_TDTADDR = (uint32_t)desc_tab; + dma_current_txdesc = desc_tab; + dma_current_ptp_txdesc = desc_ptptab; + }else{ + /* if want to initialize DMA Rx descriptors */ + /* save a copy of the DMA Rx descriptors */ + desc_tab = rxdesc_tab; + buf = &rx_buff[0][0]; + count = ENET_RXBUF_NUM; + maxsize = ENET_RXBUF_SIZE; + + /* enable receiving */ + desc_status = ENET_RDES0_DAV; + /* select receive ring mode and set buffer1 size */ + desc_bufsize = (uint32_t)ENET_RXBUF_SIZE; + + /* configure DMA Rx descriptor table address register */ + ENET_DMA_RDTADDR = (uint32_t)desc_tab; + dma_current_rxdesc = desc_tab; + dma_current_ptp_rxdesc = desc_ptptab; + } + + /* configure each descriptor */ + for(num = 0U; num < count; num++){ + /* get the pointer to the next descriptor of the descriptor table */ + desc = desc_tab + num; + + /* configure descriptors */ + desc->status = desc_status; + desc->control_buffer_size = desc_bufsize; + desc->buffer1_addr = (uint32_t)(&buf[num * maxsize]); + + /* when it is the last descriptor */ + if(num == (count - 1U)){ + if (ENET_DMA_TX == direction){ + /* configure transmit end of ring mode */ + desc->status |= ENET_TDES0_TERM; + }else{ + /* configure receive end of ring mode */ + desc->control_buffer_size |= ENET_RDES1_RERM; + } + } + /* set desc_ptptab equal to desc_tab */ + (&desc_ptptab[num])->buffer1_addr = desc->buffer1_addr; + (&desc_ptptab[num])->buffer2_next_desc_addr = desc->buffer2_next_desc_addr; + } + /* when it is the last ptp descriptor, preserve the first descriptor + address of desc_ptptab in ptp descriptor status */ + (&desc_ptptab[num-1U])->status = (uint32_t)desc_ptptab; +} + +/*! + \brief receive a packet data with timestamp values to application buffer, when the DMA is in normal mode + \param[in] bufsize: the size of buffer which is the parameter in function + \param[out] timestamp: pointer to the table which stores the timestamp high and low + \param[out] buffer: pointer to the application buffer + note -- if the input is NULL, user should copy data in application by himself + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_ptpframe_receive_normal_mode(uint8_t *buffer, uint32_t bufsize, uint32_t timestamp[]) +{ + uint32_t offset = 0U, size = 0U; + + /* the descriptor is busy due to own by the DMA */ + if((uint32_t)RESET != (dma_current_rxdesc->status & ENET_RDES0_DAV)){ + return ERROR; + } + + /* if buffer pointer is null, indicates that users has copied data in application */ + if(NULL != buffer){ + /* if no error occurs, and the frame uses only one descriptor */ + if(((uint32_t)RESET == (dma_current_rxdesc->status & ENET_RDES0_ERRS)) && + ((uint32_t)RESET != (dma_current_rxdesc->status & ENET_RDES0_LDES)) && + ((uint32_t)RESET != (dma_current_rxdesc->status & ENET_RDES0_FDES))){ + + /* get the frame length except CRC */ + size = GET_RDES0_FRML(dma_current_rxdesc->status) - 4U; + + /* to avoid situation that the frame size exceeds the buffer length */ + if(size > bufsize){ + return ERROR; + } + + /* copy data from Rx buffer to application buffer */ + for(offset = 0U; offset < size; offset++){ + (*(buffer + offset)) = (*(__IO uint8_t *)(uint32_t)((dma_current_ptp_rxdesc->buffer1_addr) + offset)); + } + + }else{ + return ERROR; + } + } + /* copy timestamp value from Rx descriptor to application array */ + timestamp[0] = dma_current_rxdesc->buffer1_addr; + timestamp[1] = dma_current_rxdesc->buffer2_next_desc_addr; + + dma_current_rxdesc->buffer1_addr = dma_current_ptp_rxdesc ->buffer1_addr ; + dma_current_rxdesc->buffer2_next_desc_addr = dma_current_ptp_rxdesc ->buffer2_next_desc_addr; + + /* enable reception, descriptor is owned by DMA */ + dma_current_rxdesc->status = ENET_RDES0_DAV; + + /* check Rx buffer unavailable flag status */ + if ((uint32_t)RESET != (ENET_DMA_STAT & ENET_DMA_STAT_RBU)){ + /* clear RBU flag */ + ENET_DMA_STAT = ENET_DMA_STAT_RBU; + /* resume DMA reception by writing to the RPEN register*/ + ENET_DMA_RPEN = 0U; + } + + + /* update the current RxDMA descriptor pointer to the next decriptor in RxDMA decriptor table */ + /* chained mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RCHM)){ + dma_current_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->buffer2_next_desc_addr); + /* if it is the last ptp descriptor */ + if(0U != dma_current_ptp_rxdesc->status){ + /* pointer back to the first ptp descriptor address in the desc_ptptab list address */ + dma_current_ptp_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->status); + }else{ + /* ponter to the next ptp descriptor */ + dma_current_ptp_rxdesc++; + } + }else{ + /* ring mode */ + if((uint32_t)RESET != (dma_current_rxdesc->control_buffer_size & ENET_RDES1_RERM)){ + /* if is the last descriptor in table, the next descriptor is the table header */ + dma_current_rxdesc = (enet_descriptors_struct*) (ENET_DMA_RDTADDR); + /* RDES2 and RDES3 will not be covered by buffer address, so do not need to preserve a new table, + use the same table with RxDMA descriptor */ + dma_current_ptp_rxdesc = (enet_descriptors_struct*) (dma_current_ptp_rxdesc->status); + }else{ + /* the next descriptor is the current address, add the descriptor size, and descriptor skip length */ + dma_current_rxdesc = (enet_descriptors_struct*) (uint32_t)((uint32_t)dma_current_rxdesc + ETH_DMARXDESC_SIZE + GET_DMA_BCTL_DPSL(ENET_DMA_BCTL)); + dma_current_ptp_rxdesc ++; + } + } + + return SUCCESS; +} + +/*! + \brief send data with timestamp values in application buffer as a transmit packet, when the DMA is in normal mode + \param[in] buffer: pointer on the application buffer + note -- if the input is NULL, user should copy data in application by himself + \param[in] length: the length of frame data to be transmitted + \param[out] timestamp: pointer to the table which stores the timestamp high and low + note -- if the input is NULL, timestamp is ignored + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus enet_ptpframe_transmit_normal_mode(uint8_t *buffer, uint32_t length, uint32_t timestamp[]) +{ + uint32_t offset = 0U, timeout = 0U; + uint32_t dma_tbu_flag, dma_tu_flag, tdes0_ttmss_flag; + + /* the descriptor is busy due to own by the DMA */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_DAV)){ + return ERROR; + } + + /* only frame length no more than ENET_MAX_FRAME_SIZE is allowed */ + if(length > ENET_MAX_FRAME_SIZE){ + return ERROR; + } + + /* if buffer pointer is null, indicates that users has handled data in application */ + if(NULL != buffer){ + /* copy frame data from application buffer to Tx buffer */ + for(offset = 0U; offset < length; offset++){ + (*(__IO uint8_t *) (uint32_t)((dma_current_ptp_txdesc->buffer1_addr) + offset)) = (*(buffer + offset)); + } + } + /* set the frame length */ + dma_current_txdesc->control_buffer_size = (length & (uint32_t)0x1FFF); + /* set the segment of frame, frame is transmitted in one descriptor */ + dma_current_txdesc->status |= ENET_TDES0_LSG | ENET_TDES0_FSG; + /* enable the DMA transmission */ + dma_current_txdesc->status |= ENET_TDES0_DAV; + + /* check Tx buffer unavailable flag status */ + dma_tbu_flag = (ENET_DMA_STAT & ENET_DMA_STAT_TBU); + dma_tu_flag = (ENET_DMA_STAT & ENET_DMA_STAT_TU); + + if((RESET != dma_tbu_flag) || (RESET != dma_tu_flag)){ + /* clear TBU and TU flag */ + ENET_DMA_STAT = (dma_tbu_flag | dma_tu_flag); + /* resume DMA transmission by writing to the TPEN register*/ + ENET_DMA_TPEN = 0U; + } + + /* if timestamp pointer is null, indicates that users don't care timestamp in application */ + if(NULL != timestamp){ + /* wait for ENET_TDES0_TTMSS flag to be set, a timestamp was captured */ + do{ + tdes0_ttmss_flag = (dma_current_txdesc->status & ENET_TDES0_TTMSS); + timeout++; + }while((RESET == tdes0_ttmss_flag) && (timeout < ENET_DELAY_TO)); + + /* return ERROR due to timeout */ + if(ENET_DELAY_TO == timeout){ + return ERROR; + } + + /* clear the ENET_TDES0_TTMSS flag */ + dma_current_txdesc->status &= ~ENET_TDES0_TTMSS; + /* get the timestamp value of the transmit frame */ + timestamp[0] = dma_current_txdesc->buffer1_addr; + timestamp[1] = dma_current_txdesc->buffer2_next_desc_addr; + } + dma_current_txdesc->buffer1_addr = dma_current_ptp_txdesc ->buffer1_addr ; + dma_current_txdesc->buffer2_next_desc_addr = dma_current_ptp_txdesc ->buffer2_next_desc_addr; + + /* update the current TxDMA descriptor pointer to the next decriptor in TxDMA decriptor table */ + /* chained mode */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_TCHM)){ + dma_current_txdesc = (enet_descriptors_struct*) (dma_current_ptp_txdesc->buffer2_next_desc_addr); + /* if it is the last ptp descriptor */ + if(0U != dma_current_ptp_txdesc->status){ + /* pointer back to the first ptp descriptor address in the desc_ptptab list address */ + dma_current_ptp_txdesc = (enet_descriptors_struct*) (dma_current_ptp_txdesc->status); + }else{ + /* ponter to the next ptp descriptor */ + dma_current_ptp_txdesc++; + } + }else{ + /* ring mode */ + if((uint32_t)RESET != (dma_current_txdesc->status & ENET_TDES0_TERM)){ + /* if is the last descriptor in table, the next descriptor is the table header */ + dma_current_txdesc = (enet_descriptors_struct*) (ENET_DMA_TDTADDR); + /* TDES2 and TDES3 will not be covered by buffer address, so do not need to preserve a new table, + use the same table with TxDMA descriptor */ + dma_current_ptp_txdesc = (enet_descriptors_struct*) (dma_current_ptp_txdesc->status); + }else{ + /* the next descriptor is the current address, add the descriptor size, and descriptor skip length */ + dma_current_txdesc = (enet_descriptors_struct*) (uint32_t)((uint32_t)dma_current_txdesc + ETH_DMATXDESC_SIZE + GET_DMA_BCTL_DPSL(ENET_DMA_BCTL)); + dma_current_ptp_txdesc ++; + } + } + return SUCCESS; +} + +/*! + \brief wakeup frame filter register pointer reset + \param[in] none + \param[out] none + \retval none +*/ +void enet_wum_filter_register_pointer_reset(void) +{ + ENET_MAC_WUM |= ENET_MAC_WUM_WUFFRPR; +} + +/*! + \brief set the remote wakeup frame registers + \param[in] pdata: pointer to buffer data which is written to remote wakeup frame registers (8 words total) + \param[out] none + \retval none +*/ +void enet_wum_filter_config(uint32_t pdata[]) +{ + uint32_t num = 0U; + + /* configure ENET_MAC_RWFF register */ + for(num = 0U; num < ETH_WAKEUP_REGISTER_LENGTH; num++){ + ENET_MAC_RWFF = pdata[num]; + } +} + +/*! + \brief enable wakeup management features + \param[in] feature: one or more parameters can be selected which are shown as below + \arg ENET_WUM_POWER_DOWN: power down mode + \arg ENET_WUM_MAGIC_PACKET_FRAME: enable a wakeup event due to magic packet reception + \arg ENET_WUM_WAKE_UP_FRAME: enable a wakeup event due to wakeup frame reception + \arg ENET_WUM_GLOBAL_UNICAST: any received unicast frame passed filter is considered to be a wakeup frame + \param[out] none + \retval none +*/ +void enet_wum_feature_enable(uint32_t feature) +{ + ENET_MAC_WUM |= feature; +} + +/*! + \brief disable wakeup management features + \param[in] feature: one or more parameters can be selected which are shown as below + \arg ENET_WUM_MAGIC_PACKET_FRAME: enable a wakeup event due to magic packet reception + \arg ENET_WUM_WAKE_UP_FRAME: enable a wakeup event due to wakeup frame reception + \arg ENET_WUM_GLOBAL_UNICAST: any received unicast frame passed filter is considered to be a wakeup frame + \param[out] none + \retval none +*/ +void enet_wum_feature_disable(uint32_t feature) +{ + ENET_MAC_WUM &= (~feature); +} + +/*! + \brief reset the MAC statistics counters + \param[in] none + \param[out] none + \retval none +*/ +void enet_msc_counters_reset(void) +{ + /* reset all counters */ + ENET_MSC_CTL |= ENET_MSC_CTL_CTR; +} + +/*! + \brief enable the MAC statistics counter features + \param[in] feature: one or more parameters can be selected which are shown as below + \arg ENET_MSC_COUNTER_STOP_ROLLOVER: counter stop rollover + \arg ENET_MSC_RESET_ON_READ: reset on read + \arg ENET_MSC_COUNTERS_FREEZE: MSC counter freeze + \param[out] none + \retval none +*/ +void enet_msc_feature_enable(uint32_t feature) +{ + ENET_MSC_CTL |= feature; +} + +/*! + \brief disable the MAC statistics counter features + \param[in] feature: one or more parameters can be selected which are shown as below + \arg ENET_MSC_COUNTER_STOP_ROLLOVER: counter stop rollover + \arg ENET_MSC_RESET_ON_READ: reset on read + \arg ENET_MSC_COUNTERS_FREEZE: MSC counter freeze + \param[out] none + \retval none +*/ +void enet_msc_feature_disable(uint32_t feature) +{ + ENET_MSC_CTL &= (~feature); +} + +/*! + \brief get MAC statistics counter + \param[in] counter: MSC counters which is selected, refer to enet_msc_counter_enum, + only one parameter can be selected which is shown as below + \arg ENET_MSC_TX_SCCNT: MSC transmitted good frames after a single collision counter + \arg ENET_MSC_TX_MSCCNT: MSC transmitted good frames after more than a single collision counter + \arg ENET_MSC_TX_TGFCNT: MSC transmitted good frames counter + \arg ENET_MSC_RX_RFCECNT: MSC received frames with CRC error counter + \arg ENET_MSC_RX_RFAECNT: MSC received frames with alignment error counter + \arg ENET_MSC_RX_RGUFCNT: MSC received good unicast frames counter + \param[out] none + \retval the MSC counter value +*/ +uint32_t enet_msc_counters_get(enet_msc_counter_enum counter) +{ + uint32_t reval; + + reval = REG32((ENET + (uint32_t)counter)); + + return reval; +} + +/*! + \brief change subsecond to nanosecond + \param[in] subsecond: subsecond value + \param[out] none + \retval the nanosecond value +*/ +uint32_t enet_ptp_subsecond_2_nanosecond(uint32_t subsecond) +{ + uint64_t val = subsecond * 1000000000Ull; + val >>= 31; + return (uint32_t)val; +} + +/*! + \brief change nanosecond to subsecond + \param[in] nanosecond: nanosecond value + \param[out] none + \retval the subsecond value +*/ +uint32_t enet_ptp_nanosecond_2_subsecond(uint32_t nanosecond) +{ + uint64_t val = nanosecond * 0x80000000Ull; + val /= 1000000000U; + return (uint32_t)val; +} + +/*! + \brief enable the PTP features + \param[in] feature: the feature of ENET PTP mode + one or more parameters can be selected which are shown as below + \arg ENET_RXTX_TIMESTAMP: timestamp function for transmit and receive frames + \arg ENET_PTP_TIMESTAMP_INT: timestamp interrupt trigger + \param[out] none + \retval none +*/ +void enet_ptp_feature_enable(uint32_t feature) +{ + ENET_PTP_TSCTL |= feature; +} + +/*! + \brief disable the PTP features + \param[in] feature: the feature of ENET PTP mode + one or more parameters can be selected which are shown as below + \arg ENET_RXTX_TIMESTAMP: timestamp function for transmit and receive frames + \arg ENET_PTP_TIMESTAMP_INT: timestamp interrupt trigger + \param[out] none + \retval none +*/ +void enet_ptp_feature_disable(uint32_t feature) +{ + ENET_PTP_TSCTL &= ~feature; +} + +/*! + \brief configure the PTP timestamp function + \param[in] func: only one parameter can be selected which is shown as below + \arg ENET_PTP_ADDEND_UPDATE: addend register update + \arg ENET_PTP_SYSTIME_UPDATE: timestamp update + \arg ENET_PTP_SYSTIME_INIT: timestamp initialize + \arg ENET_PTP_FINEMODE: the system timestamp uses the fine method for updating + \arg ENET_PTP_COARSEMODE: the system timestamp uses the coarse method for updating + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ + +ErrStatus enet_ptp_timestamp_function_config(enet_ptp_function_enum func) +{ + uint32_t temp_config = 0U, temp_state = 0U; + uint32_t timeout = 0U; + ErrStatus enet_state = SUCCESS; + + switch(func){ + case ENET_PTP_ADDEND_UPDATE: + /* this bit must be read as zero before application set it */ + do{ + temp_state = ENET_PTP_TSCTL & ENET_PTP_TSCTL_TMSARU; + timeout++; + }while((RESET != temp_state) && (timeout < ENET_DELAY_TO)); + /* return ERROR due to timeout */ + if(ENET_DELAY_TO == timeout){ + enet_state = ERROR; + }else{ + ENET_PTP_TSCTL |= ENET_PTP_TSCTL_TMSARU; + } + break; + case ENET_PTP_SYSTIME_UPDATE: + /* both the TMSSTU and TMSSTI bits must be read as zero before application set this bit */ + do{ + temp_state = ENET_PTP_TSCTL & (ENET_PTP_TSCTL_TMSSTU | ENET_PTP_TSCTL_TMSSTI); + timeout++; + }while((RESET != temp_state) && (timeout < ENET_DELAY_TO)); + /* return ERROR due to timeout */ + if(ENET_DELAY_TO == timeout){ + enet_state = ERROR; + }else{ + ENET_PTP_TSCTL |= ENET_PTP_TSCTL_TMSSTU; + } + break; + case ENET_PTP_SYSTIME_INIT: + /* this bit must be read as zero before application set it */ + do{ + temp_state = ENET_PTP_TSCTL & ENET_PTP_TSCTL_TMSSTI; + timeout++; + }while((RESET != temp_state) && (timeout < ENET_DELAY_TO)); + /* return ERROR due to timeout */ + if(ENET_DELAY_TO == timeout){ + enet_state = ERROR; + }else{ + ENET_PTP_TSCTL |= ENET_PTP_TSCTL_TMSSTI; + } + break; + default: + temp_config = (uint32_t)func & (~BIT(31)); + if(RESET != ((uint32_t)func & BIT(31))){ + ENET_PTP_TSCTL |= temp_config; + }else{ + ENET_PTP_TSCTL &= ~temp_config; + } + break; + } + + return enet_state; +} + +/*! + \brief configure system time subsecond increment value + \param[in] subsecond: the value will be added to the subsecond value of system time, + this value must be between 0 and 0xFF + \param[out] none + \retval none +*/ +void enet_ptp_subsecond_increment_config(uint32_t subsecond) +{ + ENET_PTP_SSINC = PTP_SSINC_STMSSI(subsecond); +} + +/*! + \brief adjusting the clock frequency only in fine update mode + \param[in] add: the value will be added to the accumulator register to achieve time synchronization + \param[out] none + \retval none +*/ +void enet_ptp_timestamp_addend_config(uint32_t add) +{ + ENET_PTP_TSADDEND = add; +} + +/*! + \brief initialize or add/subtract to second of the system time + \param[in] sign: timestamp update positive or negative sign, + only one parameter can be selected which is shown as below + \arg ENET_PTP_ADD_TO_TIME: timestamp update value is added to system time + \arg ENET_PTP_SUBSTRACT_FROM_TIME: timestamp update value is subtracted from system time + \param[in] second: initializing or adding/subtracting to second of the system time + \param[in] subsecond: the current subsecond of the system time + with 0.46 ns accuracy if required accuracy is 20 ns + \param[out] none + \retval none +*/ +void enet_ptp_timestamp_update_config(uint32_t sign, uint32_t second, uint32_t subsecond) +{ + ENET_PTP_TSUH = second; + ENET_PTP_TSUL = sign | PTP_TSUL_TMSUSS(subsecond); +} + +/*! + \brief configure the expected target time + \param[in] second: the expected target second time + \param[in] nanosecond: the expected target nanosecond time (signed) + \param[out] none + \retval none +*/ +void enet_ptp_expected_time_config(uint32_t second, uint32_t nanosecond) +{ + ENET_PTP_ETH = second; + ENET_PTP_ETL = nanosecond; +} + +/*! + \brief get the current system time + \param[in] none + \param[out] systime_struct: pointer to a enet_ptp_systime_struct structure which contains + parameters of PTP system time + members of the structure and the member values are shown as below: + second: 0x0 - 0xFFFF FFFF + nanosecond: 0x0 - 0x7FFF FFFF * 10^9 / 2^31 + sign: ENET_PTP_TIME_POSITIVE, ENET_PTP_TIME_NEGATIVE + \retval none +*/ +void enet_ptp_system_time_get(enet_ptp_systime_struct *systime_struct) +{ + uint32_t temp_sec = 0U, temp_subs = 0U; + + /* get the value of sysytem time registers */ + temp_sec = (uint32_t)ENET_PTP_TSH; + temp_subs = (uint32_t)ENET_PTP_TSL; + + /* get sysytem time and construct the enet_ptp_systime_struct structure */ + systime_struct->second = temp_sec; + systime_struct->nanosecond = GET_PTP_TSL_STMSS(temp_subs); + systime_struct->nanosecond = enet_ptp_subsecond_2_nanosecond(systime_struct->nanosecond); + systime_struct->sign = GET_PTP_TSL_STS(temp_subs); +} + +/*! + \brief configure and start PTP timestamp counter + \param[in] updatemethod: method for updating + \arg ENET_PTP_FINEMODE: fine correction method + \arg ENET_PTP_COARSEMODE: coarse correction method + \param[in] init_sec: second value for initializing system time + \param[in] init_subsec: subsecond value for initializing system time + \param[in] carry_cfg: the value to be added to the accumulator register (in fine method is used) + \param[in] accuracy_cfg: the value to be added to the subsecond value of system time + \param[out] none + \retval none +*/ +void enet_ptp_start(int32_t updatemethod, uint32_t init_sec, uint32_t init_subsec, uint32_t carry_cfg, uint32_t accuracy_cfg) +{ + /* mask the timestamp trigger interrupt */ + enet_interrupt_disable(ENET_MAC_INT_TMSTIM); + + /* enable timestamp */ + enet_ptp_feature_enable(ENET_RXTX_TIMESTAMP); + + /* configure system time subsecond increment based on the PTP clock frequency */ + enet_ptp_subsecond_increment_config(accuracy_cfg); + + if(ENET_PTP_FINEMODE == updatemethod){ + /* fine correction method: configure the timestamp addend, then update */ + enet_ptp_timestamp_addend_config(carry_cfg); + enet_ptp_timestamp_function_config(ENET_PTP_ADDEND_UPDATE); + /* wait until update is completed */ + while(SET == enet_ptp_flag_get((uint32_t)ENET_PTP_ADDEND_UPDATE)){ + } + } + + /* choose the fine correction method */ + enet_ptp_timestamp_function_config((enet_ptp_function_enum)updatemethod); + + /* initialize the system time */ + enet_ptp_timestamp_update_config(ENET_PTP_ADD_TO_TIME, init_sec, init_subsec); + enet_ptp_timestamp_function_config(ENET_PTP_SYSTIME_INIT); +} + +/*! + \brief adjust frequency in fine method by configure addend register + \param[in] carry_cfg: the value to be added to the accumulator register + \param[out] none + \retval none +*/ +void enet_ptp_finecorrection_adjfreq(int32_t carry_cfg) +{ + /* re-configure the timestamp addend, then update */ + enet_ptp_timestamp_addend_config((uint32_t)carry_cfg); + enet_ptp_timestamp_function_config(ENET_PTP_ADDEND_UPDATE); +} + +/*! + \brief update system time in coarse method + \param[in] systime_struct: pointer to a enet_ptp_systime_struct structure which contains + parameters of PTP system time + members of the structure and the member values are shown as below: + second: 0x0 - 0xFFFF FFFF + nanosecond: 0x0 - 0x7FFF FFFF * 10^9 / 2^31 + sign: ENET_PTP_TIME_POSITIVE, ENET_PTP_TIME_NEGATIVE + \param[out] none + \retval none +*/ +void enet_ptp_coarsecorrection_systime_update(enet_ptp_systime_struct *systime_struct) +{ + uint32_t subsecond_val; + uint32_t carry_cfg; + + subsecond_val = enet_ptp_nanosecond_2_subsecond(systime_struct->nanosecond); + + /* save the carry_cfg value */ + carry_cfg = ENET_PTP_TSADDEND_TMSA; + + /* update the system time */ + enet_ptp_timestamp_update_config(systime_struct->sign, systime_struct->second, subsecond_val); + enet_ptp_timestamp_function_config(ENET_PTP_SYSTIME_UPDATE); + + /* wait until the update is completed */ + while(SET == enet_ptp_flag_get((uint32_t)ENET_PTP_SYSTIME_UPDATE)){ + } + + /* write back the carry_cfg value, then update */ + enet_ptp_timestamp_addend_config(carry_cfg); + enet_ptp_timestamp_function_config(ENET_PTP_ADDEND_UPDATE); +} + +/*! + \brief set system time in fine method + \param[in] systime_struct: pointer to a enet_ptp_systime_struct structure which contains + parameters of PTP system time + members of the structure and the member values are shown as below: + second: 0x0 - 0xFFFF FFFF + nanosecond: 0x0 - 0x7FFF FFFF * 10^9 / 2^31 + sign: ENET_PTP_TIME_POSITIVE, ENET_PTP_TIME_NEGATIVE + \param[out] none + \retval none +*/ +void enet_ptp_finecorrection_settime(enet_ptp_systime_struct * systime_struct) +{ + uint32_t subsecond_val; + + subsecond_val = enet_ptp_nanosecond_2_subsecond(systime_struct->nanosecond); + + /* initialize the system time */ + enet_ptp_timestamp_update_config(systime_struct->sign, systime_struct->second, subsecond_val); + enet_ptp_timestamp_function_config(ENET_PTP_SYSTIME_INIT); + + /* wait until the system time initialzation finished */ + while(SET == enet_ptp_flag_get((uint32_t)ENET_PTP_SYSTIME_INIT)){ + } +} + +/*! + \brief get the ptp flag status + \param[in] flag: ptp flag status to be checked + \arg ENET_PTP_ADDEND_UPDATE: addend register update + \arg ENET_PTP_SYSTIME_UPDATE: timestamp update + \arg ENET_PTP_SYSTIME_INIT: timestamp initialize + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus enet_ptp_flag_get(uint32_t flag) +{ + FlagStatus bitstatus = RESET; + + if ((uint32_t)RESET != (ENET_PTP_TSCTL & flag)){ + bitstatus = SET; + } + + return bitstatus; +} + +/*! + \brief reset the ENET initpara struct, call it before using enet_initpara_config() + \param[in] none + \param[out] none + \retval none +*/ +void enet_initpara_reset(void) +{ + enet_initpara.option_enable = 0U; + enet_initpara.forward_frame = 0U; + enet_initpara.dmabus_mode = 0U; + enet_initpara.dma_maxburst = 0U; + enet_initpara.dma_arbitration = 0U; + enet_initpara.store_forward_mode = 0U; + enet_initpara.dma_function = 0U; + enet_initpara.vlan_config = 0U; + enet_initpara.flow_control = 0U; + enet_initpara.hashtable_high = 0U; + enet_initpara.hashtable_low = 0U; + enet_initpara.framesfilter_mode = 0U; + enet_initpara.halfduplex_param = 0U; + enet_initpara.timer_config = 0U; + enet_initpara.interframegap = 0U; +} + +/*! + \brief initialize ENET peripheral with generally concerned parameters, call it by enet_init() + \param[in] none + \param[out] none + \retval none +*/ +static void enet_default_init(void) +{ + uint32_t reg_value = 0U; + + /* MAC */ + /* configure ENET_MAC_CFG register */ + reg_value = ENET_MAC_CFG; + reg_value &= MAC_CFG_MASK; + reg_value |= ENET_WATCHDOG_ENABLE | ENET_JABBER_ENABLE | ENET_INTERFRAMEGAP_96BIT \ + | ENET_SPEEDMODE_10M |ENET_MODE_HALFDUPLEX | ENET_LOOPBACKMODE_DISABLE \ + | ENET_CARRIERSENSE_ENABLE | ENET_RECEIVEOWN_ENABLE \ + | ENET_RETRYTRANSMISSION_ENABLE | ENET_BACKOFFLIMIT_10 \ + | ENET_DEFERRALCHECK_DISABLE \ + | ENET_AUTO_PADCRC_DROP_DISABLE \ + | ENET_CHECKSUMOFFLOAD_DISABLE; + ENET_MAC_CFG = reg_value; + + /* configure ENET_MAC_FRMF register */ + ENET_MAC_FRMF = ENET_SRC_FILTER_DISABLE |ENET_DEST_FILTER_INVERSE_DISABLE \ + |ENET_MULTICAST_FILTER_PERFECT |ENET_UNICAST_FILTER_PERFECT \ + |ENET_PCFRM_PREVENT_ALL |ENET_BROADCASTFRAMES_ENABLE \ + |ENET_PROMISCUOUS_DISABLE |ENET_RX_FILTER_ENABLE; + + /* configure ENET_MAC_HLH, ENET_MAC_HLL register */ + ENET_MAC_HLH = 0x0U; + + ENET_MAC_HLL = 0x0U; + + /* configure ENET_MAC_FCTL, ENET_MAC_FCTH register */ + reg_value = ENET_MAC_FCTL; + reg_value &= MAC_FCTL_MASK; + reg_value |= MAC_FCTL_PTM(0) |ENET_ZERO_QUANTA_PAUSE_DISABLE \ + |ENET_PAUSETIME_MINUS4 |ENET_UNIQUE_PAUSEDETECT \ + |ENET_RX_FLOWCONTROL_DISABLE |ENET_TX_FLOWCONTROL_DISABLE; + ENET_MAC_FCTL = reg_value; + + /* configure ENET_MAC_VLT register */ + ENET_MAC_VLT = ENET_VLANTAGCOMPARISON_16BIT |MAC_VLT_VLTI(0); + + /* DMA */ + /* configure ENET_DMA_CTL register */ + reg_value = ENET_DMA_CTL; + reg_value &= DMA_CTL_MASK; + reg_value |= ENET_TCPIP_CKSUMERROR_DROP |ENET_RX_MODE_STOREFORWARD \ + |ENET_FLUSH_RXFRAME_ENABLE |ENET_TX_MODE_STOREFORWARD \ + |ENET_TX_THRESHOLD_64BYTES |ENET_RX_THRESHOLD_64BYTES \ + |ENET_SECONDFRAME_OPT_DISABLE; + ENET_DMA_CTL = reg_value; + + /* configure ENET_DMA_BCTL register */ + reg_value = ENET_DMA_BCTL; + reg_value &= DMA_BCTL_MASK; + reg_value = ENET_ADDRESS_ALIGN_ENABLE |ENET_ARBITRATION_RXTX_2_1 \ + |ENET_RXDP_32BEAT |ENET_PGBL_32BEAT |ENET_RXTX_DIFFERENT_PGBL \ + |ENET_FIXED_BURST_ENABLE; + ENET_DMA_BCTL = reg_value; +} + +#ifndef USE_DELAY +/*! + \brief insert a delay time + \param[in] ncount: specifies the delay time length + \param[out] none + \param[out] none +*/ +static void enet_delay(uint32_t ncount) +{ + __IO uint32_t delay_time = 0U; + + for(delay_time = ncount; delay_time != 0U; delay_time--){ + } +} +#endif /* USE_DELAY */ + +#endif /* GD32F10X_CL */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exmc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exmc.c new file mode 100644 index 0000000..cbc9e8a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exmc.c @@ -0,0 +1,642 @@ +/*! + \file gd32f10x_exmc.c + \brief EXMC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_exmc.h" + +/* EXMC bank0 register reset value */ +#define BANK0_SNCTL0_REGION_RESET ((uint32_t)0x000030DBU) +#define BANK0_SNCTL1_2_3_REGION_RESET ((uint32_t)0x000030D2U) +#define BANK0_SNTCFG_RESET ((uint32_t)0x0FFFFFFFU) +#define BANK0_SNWTCFG_RESET ((uint32_t)0x0FFFFFFFU) + +/* EXMC bank1/2 register reset mask*/ +#define BANK1_2_NPCTL_RESET ((uint32_t)0x00000018U) +#define BANK1_2_NPINTEN_RESET ((uint32_t)0x00000040U) +#define BANK1_2_NPCTCFG_RESET ((uint32_t)0xFCFCFCFCU) +#define BANK1_2_NPATCFG_RESET ((uint32_t)0xFCFCFCFCU) + +/* EXMC bank3 register reset mask*/ +#define BANK3_NPCTL_RESET ((uint32_t)0x00000018U) +#define BANK3_NPINTEN_RESET ((uint32_t)0x00000040U) +#define BANK3_NPCTCFG_RESET ((uint32_t)0xFCFCFCFCU) +#define BANK3_NPATCFG_RESET ((uint32_t)0xFCFCFCFCU) +#define BANK3_PIOTCFG3_RESET ((uint32_t)0xFCFCFCFCU) + +/* EXMC register bit offset */ +#define SNCTL_NRMUX_OFFSET ((uint32_t)1U) +#define SNCTL_SBRSTEN_OFFSET ((uint32_t)8U) +#define SNCTL_WRAPEN_OFFSET ((uint32_t)10U) +#define SNCTL_WREN_OFFSET ((uint32_t)12U) +#define SNCTL_NRWTEN_OFFSET ((uint32_t)13U) +#define SNCTL_EXMODEN_OFFSET ((uint32_t)14U) +#define SNCTL_ASYNCWAIT_OFFSET ((uint32_t)15U) + +#define SNTCFG_AHLD_OFFSET ((uint32_t)4U) +#define SNTCFG_DSET_OFFSET ((uint32_t)8U) +#define SNTCFG_BUSLAT_OFFSET ((uint32_t)16U) + +#define SNWTCFG_WAHLD_OFFSET ((uint32_t)4U) +#define SNWTCFG_WDSET_OFFSET ((uint32_t)8U) +#define SNWTCFG_WBUSLAT_OFFSET ((uint32_t)16U) + +#define NPCTL_NDWTEN_OFFSET ((uint32_t)1U) +#define NPCTL_ECCEN_OFFSET ((uint32_t)6U) + +#define NPCTCFG_COMWAIT_OFFSET ((uint32_t)8U) +#define NPCTCFG_COMHLD_OFFSET ((uint32_t)16U) +#define NPCTCFG_COMHIZ_OFFSET ((uint32_t)24U) + +#define NPATCFG_ATTWAIT_OFFSET ((uint32_t)8U) +#define NPATCFG_ATTHLD_OFFSET ((uint32_t)16U) +#define NPATCFG_ATTHIZ_OFFSET ((uint32_t)24U) + +#define PIOTCFG_IOWAIT_OFFSET ((uint32_t)8U) +#define PIOTCFG_IOHLD_OFFSET ((uint32_t)16U) +#define PIOTCFG_IOHIZ_OFFSET ((uint32_t)24U) + +#define INTEN_INTS_OFFSET ((uint32_t)3U) + +/*! + \brief deinitialize EXMC NOR/SRAM region + \param[in] norsram_region: select the region of bank0 + \arg EXMC_BANK0_NORSRAM_REGIONx(x=0..3) + \param[out] none + \retval none +*/ +void exmc_norsram_deinit(uint32_t norsram_region) +{ + /* reset the registers */ + if(EXMC_BANK0_NORSRAM_REGION0 == norsram_region){ + EXMC_SNCTL(norsram_region) = BANK0_SNCTL0_REGION_RESET; + }else{ + EXMC_SNCTL(norsram_region) = BANK0_SNCTL1_2_3_REGION_RESET; + } + + EXMC_SNTCFG(norsram_region) = BANK0_SNTCFG_RESET; + EXMC_SNWTCFG(norsram_region) = BANK0_SNWTCFG_RESET; +} + +/*! + \brief initialize EXMC NOR/SRAM region + \param[in] exmc_norsram_parameter_struct: configure the EXMC NOR/SRAM parameter + norsram_region: EXMC_BANK0_NORSRAM_REGIONx,x=0..3 + write_mode: EXMC_ASYN_WRITE,EXMC_SYN_WRITE + extended_mode: ENABLE or DISABLE + asyn_wait: ENABLE or DISABLE + nwait_signal: ENABLE or DISABLE + memory_write: ENABLE or DISABLE + nwait_config: EXMC_NWAIT_CONFIG_BEFORE,EXMC_NWAIT_CONFIG_DURING + wrap_burst_mode: ENABLE or DISABLE + nwait_polarity: EXMC_NWAIT_POLARITY_LOW,EXMC_NWAIT_POLARITY_HIGH + burst_mode: ENABLE or DISABLE + databus_width: EXMC_NOR_DATABUS_WIDTH_8B,EXMC_NOR_DATABUS_WIDTH_16B + memory_type: EXMC_MEMORY_TYPE_SRAM,EXMC_MEMORY_TYPE_PSRAM,EXMC_MEMORY_TYPE_NOR + address_data_mux: ENABLE or DISABLE + read_write_timing: struct exmc_norsram_timing_parameter_struct set the time + write_timing: struct exmc_norsram_timing_parameter_struct set the time + \param[out] none + \retval none +*/ +void exmc_norsram_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + uint32_t snctl = 0x00000000U, sntcfg = 0x00000000U, snwtcfg = 0x00000000U; + + /* get the register value */ + snctl = EXMC_SNCTL(exmc_norsram_init_struct->norsram_region); + + /* clear relative bits */ + snctl &= ((uint32_t)~(EXMC_SNCTL_NREN | EXMC_SNCTL_NRTP | EXMC_SNCTL_NRW | EXMC_SNCTL_SBRSTEN | + EXMC_SNCTL_NRWTPOL | EXMC_SNCTL_WRAPEN | EXMC_SNCTL_NRWTCFG | EXMC_SNCTL_WREN | + EXMC_SNCTL_NRWTEN | EXMC_SNCTL_EXMODEN | EXMC_SNCTL_ASYNCWAIT | EXMC_SNCTL_SYNCWR | + EXMC_SNCTL_NRMUX )); + + snctl |= (uint32_t)(exmc_norsram_init_struct->address_data_mux << SNCTL_NRMUX_OFFSET) | + exmc_norsram_init_struct->memory_type | + exmc_norsram_init_struct->databus_width | + (exmc_norsram_init_struct->burst_mode << SNCTL_SBRSTEN_OFFSET) | + exmc_norsram_init_struct->nwait_polarity | + (exmc_norsram_init_struct->wrap_burst_mode << SNCTL_WRAPEN_OFFSET) | + exmc_norsram_init_struct->nwait_config | + (exmc_norsram_init_struct->memory_write << SNCTL_WREN_OFFSET) | + (exmc_norsram_init_struct->nwait_signal << SNCTL_NRWTEN_OFFSET) | + (exmc_norsram_init_struct->extended_mode << SNCTL_EXMODEN_OFFSET) | + (exmc_norsram_init_struct->asyn_wait << SNCTL_ASYNCWAIT_OFFSET) | + exmc_norsram_init_struct->write_mode; + + sntcfg = (uint32_t)((exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime - 1U ) & EXMC_SNTCFG_ASET )| + (((exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime - 1U ) << SNTCFG_AHLD_OFFSET ) & EXMC_SNTCFG_AHLD ) | + (((exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime - 1U ) << SNTCFG_DSET_OFFSET ) & EXMC_SNTCFG_DSET ) | + (((exmc_norsram_init_struct->read_write_timing->bus_latency - 1U ) << SNTCFG_BUSLAT_OFFSET ) & EXMC_SNTCFG_BUSLAT )| + exmc_norsram_init_struct->read_write_timing->syn_clk_division | + exmc_norsram_init_struct->read_write_timing->syn_data_latency | + exmc_norsram_init_struct->read_write_timing->asyn_access_mode; + + /* nor flash access enable */ + if(EXMC_MEMORY_TYPE_NOR == exmc_norsram_init_struct->memory_type){ + snctl |= (uint32_t)EXMC_SNCTL_NREN; + } + + /* extended mode configure */ + if(ENABLE == exmc_norsram_init_struct->extended_mode){ + snwtcfg = (uint32_t)(((exmc_norsram_init_struct->write_timing->asyn_address_setuptime - 1U) & EXMC_SNWTCFG_WASET) | + (((exmc_norsram_init_struct->write_timing->asyn_address_holdtime - 1U) << SNTCFG_AHLD_OFFSET ) & EXMC_SNWTCFG_WAHLD)| + (((exmc_norsram_init_struct->write_timing->asyn_data_setuptime - 1U) << SNTCFG_DSET_OFFSET) & EXMC_SNWTCFG_WDSET) | + exmc_norsram_init_struct->write_timing->asyn_access_mode); + }else{ + snwtcfg = BANK0_SNWTCFG_RESET; + } + + /* configure the registers */ + EXMC_SNCTL(exmc_norsram_init_struct->norsram_region) = snctl; + EXMC_SNTCFG(exmc_norsram_init_struct->norsram_region) = sntcfg; + EXMC_SNWTCFG(exmc_norsram_init_struct->norsram_region) = snwtcfg; +} + +/*! + \brief initialize the struct exmc_norsram_parameter_struct + \param[in] none + \param[out] exmc_norsram_init_struct: the initialized struct exmc_norsram_parameter_struct pointer + \retval none +*/ +void exmc_norsram_struct_para_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + /* configure the structure with default value */ + exmc_norsram_init_struct->norsram_region = EXMC_BANK0_NORSRAM_REGION0; + exmc_norsram_init_struct->address_data_mux = ENABLE; + exmc_norsram_init_struct->memory_type = EXMC_MEMORY_TYPE_SRAM; + exmc_norsram_init_struct->databus_width = EXMC_NOR_DATABUS_WIDTH_8B; + exmc_norsram_init_struct->burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + exmc_norsram_init_struct->wrap_burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + exmc_norsram_init_struct->memory_write = ENABLE; + exmc_norsram_init_struct->nwait_signal = ENABLE; + exmc_norsram_init_struct->extended_mode = DISABLE; + exmc_norsram_init_struct->asyn_wait = DISABLE; + exmc_norsram_init_struct->write_mode = EXMC_ASYN_WRITE; + + /* read/write timing configure */ + exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->read_write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->read_write_timing->syn_clk_division = EXMC_SYN_CLOCK_RATIO_16_CLK; + exmc_norsram_init_struct->read_write_timing->syn_data_latency = EXMC_DATALAT_17_CLK; + exmc_norsram_init_struct->read_write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; + + /* write timing configure, when extended mode is used */ + exmc_norsram_init_struct->write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; +} + +/*! + \brief enable EXMC NOR/PSRAM bank region + \param[in] norsram_region: specifie the region of NOR/PSRAM bank + \arg EXMC_BANK0_NORSRAM_REGIONx(x=0..3) + \param[out] none + \retval none +*/ +void exmc_norsram_enable(uint32_t norsram_region) +{ + EXMC_SNCTL(norsram_region) |= (uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief disable EXMC NOR/PSRAM bank region + \param[in] norsram_region: specifie the region of NOR/PSRAM Bank + \arg EXMC_BANK0_NORSRAM_REGIONx(x=0..3) + \param[out] none + \retval none +*/ +void exmc_norsram_disable(uint32_t norsram_region) +{ + EXMC_SNCTL(norsram_region) &= ~(uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief deinitialize EXMC NAND bank + \param[in] nand_bank: select the bank of NAND + \arg EXMC_BANKx_NAND(x=1..2) + \param[out] none + \retval none +*/ +void exmc_nand_deinit(uint32_t nand_bank) +{ + /* EXMC_BANK1_NAND or EXMC_BANK2_NAND */ + EXMC_NPCTL(nand_bank) = BANK1_2_NPCTL_RESET; + EXMC_NPINTEN(nand_bank) = BANK1_2_NPINTEN_RESET; + EXMC_NPCTCFG(nand_bank) = BANK1_2_NPCTCFG_RESET; + EXMC_NPATCFG(nand_bank) = BANK1_2_NPATCFG_RESET; +} + +/*! + \brief initialize EXMC NAND bank + \param[in] exmc_nand_parameter_struct: configure the EXMC NAND parameter + nand_bank: EXMC_BANK1_NAND,EXMC_BANK2_NAND + ecc_size: EXMC_ECC_SIZE_xBYTES,x=256,512,1024,2048,4096 + atr_latency: EXMC_ALE_RE_DELAY_x_HCLK,x=1..16 + ctr_latency: EXMC_CLE_RE_DELAY_x_HCLK,x=1..16 + ecc_logic: ENABLE or DISABLE + databus_width: EXMC_NAND_DATABUS_WIDTH_8B,EXMC_NAND_DATABUS_WIDTH_16B + wait_feature: ENABLE or DISABLE + common_space_timing: struct exmc_nand_pccard_timing_parameter_struct set the time + attribute_space_timing: struct exmc_nand_pccard_timing_parameter_struct set the time + \param[out] none + \retval none +*/ +void exmc_nand_init(exmc_nand_parameter_struct* exmc_nand_init_struct) +{ + uint32_t npctl = 0x00000000U, npctcfg = 0x00000000U, npatcfg = 0x00000000U; + + npctl = (uint32_t)(exmc_nand_init_struct->wait_feature << NPCTL_NDWTEN_OFFSET)| + EXMC_NPCTL_NDTP | + exmc_nand_init_struct->databus_width | + (exmc_nand_init_struct->ecc_logic << NPCTL_ECCEN_OFFSET)| + exmc_nand_init_struct->ecc_size | + exmc_nand_init_struct->ctr_latency | + exmc_nand_init_struct->atr_latency; + + npctcfg = (uint32_t)((exmc_nand_init_struct->common_space_timing->setuptime - 1U) & EXMC_NPCTCFG_COMSET ) | + (((exmc_nand_init_struct->common_space_timing->waittime - 1U) << NPCTCFG_COMWAIT_OFFSET) & EXMC_NPCTCFG_COMWAIT ) | + ((exmc_nand_init_struct->common_space_timing->holdtime << NPCTCFG_COMHLD_OFFSET) & EXMC_NPCTCFG_COMHLD ) | + (((exmc_nand_init_struct->common_space_timing->databus_hiztime - 1U) << NPCTCFG_COMHIZ_OFFSET) & EXMC_NPCTCFG_COMHIZ ); + + npatcfg = (uint32_t)((exmc_nand_init_struct->attribute_space_timing->setuptime - 1U) & EXMC_NPATCFG_ATTSET ) | + (((exmc_nand_init_struct->attribute_space_timing->waittime - 1U) << NPATCFG_ATTWAIT_OFFSET) & EXMC_NPATCFG_ATTWAIT ) | + ((exmc_nand_init_struct->attribute_space_timing->holdtime << NPATCFG_ATTHLD_OFFSET) & EXMC_NPATCFG_ATTHLD ) | + (((exmc_nand_init_struct->attribute_space_timing->databus_hiztime -1U) << NPATCFG_ATTHIZ_OFFSET) & EXMC_NPATCFG_ATTHIZ ); + + /* EXMC_BANK1_NAND or EXMC_BANK2_NAND initialize */ + EXMC_NPCTL(exmc_nand_init_struct->nand_bank) = npctl; + EXMC_NPCTCFG(exmc_nand_init_struct->nand_bank) = npctcfg; + EXMC_NPATCFG(exmc_nand_init_struct->nand_bank) = npatcfg; +} + +/*! + \brief initialize the struct exmc_nand_init_struct + \param[in] none + \param[out] the initialized struct exmc_nand_init_struct pointer + \retval none +*/ +void exmc_nand_struct_para_init(exmc_nand_parameter_struct* exmc_nand_init_struct) +{ + /* configure the structure with default value */ + exmc_nand_init_struct->nand_bank = EXMC_BANK1_NAND; + exmc_nand_init_struct->wait_feature = DISABLE; + exmc_nand_init_struct->databus_width = EXMC_NAND_DATABUS_WIDTH_8B; + exmc_nand_init_struct->ecc_logic = DISABLE; + exmc_nand_init_struct->ecc_size = EXMC_ECC_SIZE_256BYTES; + exmc_nand_init_struct->ctr_latency = 0x0U; + exmc_nand_init_struct->atr_latency = 0x0U; + exmc_nand_init_struct->common_space_timing->setuptime = 0xFCU; + exmc_nand_init_struct->common_space_timing->waittime = 0xFCU; + exmc_nand_init_struct->common_space_timing->holdtime = 0xFCU; + exmc_nand_init_struct->common_space_timing->databus_hiztime = 0xFCU; + exmc_nand_init_struct->attribute_space_timing->setuptime = 0xFCU; + exmc_nand_init_struct->attribute_space_timing->waittime = 0xFCU; + exmc_nand_init_struct->attribute_space_timing->holdtime = 0xFCU; + exmc_nand_init_struct->attribute_space_timing->databus_hiztime = 0xFCU; +} + +/*! + \brief enable NAND bank + \param[in] nand_bank: specifie the NAND bank + \arg EXMC_BANKx_NAND(x=1,2) + \param[out] none + \retval none +*/ +void exmc_nand_enable(uint32_t nand_bank) +{ + EXMC_NPCTL(nand_bank) |= EXMC_NPCTL_NDBKEN; +} + +/*! + \brief disable NAND bank + \param[in] nand_bank: specifie the NAND bank + \arg EXMC_BANKx_NAND(x=1,2) + \param[out] none + \retval none +*/ +void exmc_nand_disable(uint32_t nand_bank) +{ + EXMC_NPCTL(nand_bank) &= ~EXMC_NPCTL_NDBKEN; +} + +/*! + \brief enable or disable the EXMC NAND ECC function + \param[in] nand_bank: specifie the NAND bank + \arg EXMC_BANKx_NAND(x=1,2) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void exmc_nand_ecc_config(uint32_t nand_bank, ControlStatus newvalue) +{ + if (ENABLE == newvalue){ + /* enable the selected NAND bank ECC function */ + EXMC_NPCTL(nand_bank) |= EXMC_NPCTL_ECCEN; + }else{ + /* disable the selected NAND bank ECC function */ + EXMC_NPCTL(nand_bank) &= ~EXMC_NPCTL_ECCEN; + } +} + +/*! + \brief get the EXMC ECC value + \param[in] nand_bank: specifie the NAND bank + \arg EXMC_BANKx_NAND(x=1,2) + \param[out] none + \retval the error correction code(ECC) value +*/ +uint32_t exmc_ecc_get(uint32_t nand_bank) +{ + return (EXMC_NECC(nand_bank)); +} + +/*! + \brief deinitialize EXMC PC card bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_pccard_deinit(void) +{ + /* EXMC_BANK3_PCCARD */ + EXMC_NPCTL3 = BANK3_NPCTL_RESET; + EXMC_NPINTEN3 = BANK3_NPINTEN_RESET; + EXMC_NPCTCFG3 = BANK3_NPCTCFG_RESET; + EXMC_NPATCFG3 = BANK3_NPATCFG_RESET; + EXMC_PIOTCFG3 = BANK3_PIOTCFG3_RESET; +} + +/*! + \brief initialize EXMC PC card bank + \param[in] exmc_pccard_parameter_struct: configure the EXMC NAND parameter + atr_latency: EXMC_ALE_RE_DELAY_x_HCLK,x=1..16 + ctr_latency: EXMC_CLE_RE_DELAY_x_HCLK,x=1..16 + wait_feature: ENABLE or DISABLE + common_space_timing: struct exmc_nand_pccard_timing_parameter_struct set the time + attribute_space_timing: struct exmc_nand_pccard_timing_parameter_struct set the time + io_space_timing: exmc_nand_pccard_timing_parameter_struct set the time + \param[out] none + \retval none +*/ +void exmc_pccard_init(exmc_pccard_parameter_struct* exmc_pccard_init_struct) +{ + /* configure the EXMC bank3 PC card control register */ + EXMC_NPCTL3 = (uint32_t)(exmc_pccard_init_struct->wait_feature << NPCTL_NDWTEN_OFFSET) | + EXMC_NAND_DATABUS_WIDTH_16B | + exmc_pccard_init_struct->ctr_latency | + exmc_pccard_init_struct->atr_latency ; + + /* configure the EXMC bank3 PC card common space timing configuration register */ + EXMC_NPCTCFG3 = (uint32_t)((exmc_pccard_init_struct->common_space_timing->setuptime - 1U)& EXMC_NPCTCFG_COMSET ) | + (((exmc_pccard_init_struct->common_space_timing->waittime - 1U) << NPCTCFG_COMWAIT_OFFSET) & EXMC_NPCTCFG_COMWAIT ) | + ((exmc_pccard_init_struct->common_space_timing->holdtime << NPCTCFG_COMHLD_OFFSET) & EXMC_NPCTCFG_COMHLD ) | + (((exmc_pccard_init_struct->common_space_timing->databus_hiztime - 1U) << NPCTCFG_COMHIZ_OFFSET) & EXMC_NPCTCFG_COMHIZ ); + + /* configure the EXMC bank3 PC card attribute space timing configuration register */ + EXMC_NPATCFG3 = (uint32_t)((exmc_pccard_init_struct->attribute_space_timing->setuptime - 1U) & EXMC_NPATCFG_ATTSET ) | + (((exmc_pccard_init_struct->attribute_space_timing->waittime - 1U) << NPATCFG_ATTWAIT_OFFSET) & EXMC_NPATCFG_ATTWAIT ) | + ((exmc_pccard_init_struct->attribute_space_timing->holdtime << NPATCFG_ATTHLD_OFFSET) & EXMC_NPATCFG_ATTHLD )| + (((exmc_pccard_init_struct->attribute_space_timing->databus_hiztime -1U) << NPATCFG_ATTHIZ_OFFSET) & EXMC_NPATCFG_ATTHIZ ); + + /* configure the EXMC bank3 PC card io space timing configuration register */ + EXMC_PIOTCFG3 = (uint32_t)((exmc_pccard_init_struct->io_space_timing->setuptime - 1U) & EXMC_PIOTCFG3_IOSET ) | + (((exmc_pccard_init_struct->io_space_timing->waittime - 1U) << PIOTCFG_IOWAIT_OFFSET) & EXMC_PIOTCFG3_IOWAIT ) | + ((exmc_pccard_init_struct->io_space_timing->holdtime << PIOTCFG_IOHLD_OFFSET) & EXMC_PIOTCFG3_IOHLD )| + ((exmc_pccard_init_struct->io_space_timing->databus_hiztime << PIOTCFG_IOHIZ_OFFSET) & EXMC_PIOTCFG3_IOHIZ ); +} + +/*! + \brief initialize the struct exmc_pccard_parameter_struct + \param[in] none + \param[out] the initialized struct exmc_pccard_parameter_struct pointer + \retval none +*/ +void exmc_pccard_struct_para_init(exmc_pccard_parameter_struct* exmc_pccard_init_struct) +{ + /* configure the structure with default value */ + exmc_pccard_init_struct->wait_feature = DISABLE; + exmc_pccard_init_struct->ctr_latency = 0x0U; + exmc_pccard_init_struct->atr_latency = 0x0U; + exmc_pccard_init_struct->common_space_timing->setuptime = 0xFCU; + exmc_pccard_init_struct->common_space_timing->waittime = 0xFCU; + exmc_pccard_init_struct->common_space_timing->holdtime = 0xFCU; + exmc_pccard_init_struct->common_space_timing->databus_hiztime = 0xFCU; + exmc_pccard_init_struct->attribute_space_timing->setuptime = 0xFCU; + exmc_pccard_init_struct->attribute_space_timing->waittime = 0xFCU; + exmc_pccard_init_struct->attribute_space_timing->holdtime = 0xFCU; + exmc_pccard_init_struct->attribute_space_timing->databus_hiztime = 0xFCU; + exmc_pccard_init_struct->io_space_timing->setuptime = 0xFCU; + exmc_pccard_init_struct->io_space_timing->waittime = 0xFCU; + exmc_pccard_init_struct->io_space_timing->holdtime = 0xFCU; + exmc_pccard_init_struct->io_space_timing->databus_hiztime = 0xFCU; +} + +/*! + \brief enable PC Card Bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_pccard_enable(void) +{ + EXMC_NPCTL3 |= EXMC_NPCTL_NDBKEN; +} + +/*! + \brief disable PC Card Bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_pccard_disable(void) +{ + EXMC_NPCTL3 &= ~EXMC_NPCTL_NDBKEN; +} + +/*! + \brief enable EXMC interrupt + \param[in] bank: specifies the NAND bank, PC card bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC card bank + \param[in] interrupt_source: specify get which interrupt flag + one or more parameters can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_INT_RISE: interrupt source of rising edge + \arg EXMC_NAND_PCCARD_INT_LEVEL: interrupt source of high-level + \arg EXMC_NAND_PCCARD_INT_FALL: interrupt source of falling edge + \param[out] none + \retval none +*/ +void exmc_interrupt_enable(uint32_t bank, uint32_t interrupt_source) +{ + /* NAND bank1, bank2 or PC card bank3 */ + EXMC_NPINTEN(bank) |= interrupt_source; +} + +/*! + \brief disable EXMC interrupt + \param[in] bank: specifies the NAND bank, PC card bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC card bank + \param[in] interrupt_source: specify get which interrupt flag + one or more parameters can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_INT_RISE: interrupt source of rising edge + \arg EXMC_NAND_PCCARD_INT_LEVEL: interrupt source of high-level + \arg EXMC_NAND_PCCARD_INT_FALL: interrupt source of falling edge + \param[out] none + \retval none +*/ +void exmc_interrupt_disable(uint32_t bank, uint32_t interrupt_source) +{ + /* NAND bank1,bank2 or PC card bank3 */ + EXMC_NPINTEN(bank) &= ~interrupt_source; +} + +/*! + \brief check EXMC flag is set or not + \param[in] bank: specifies the NAND bank, PC card bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC Card bank + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_FLAG_RISE: interrupt rising edge status + \arg EXMC_NAND_PCCARD_FLAG_LEVEL: interrupt high-level status + \arg EXMC_NAND_PCCARD_FLAG_FALL: interrupt falling edge status + \arg EXMC_NAND_PCCARD_FLAG_FIFOE: FIFO empty flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exmc_flag_get(uint32_t bank, uint32_t flag) +{ + uint32_t status = 0x00000000U; + + /* NAND bank1,bank2 or PC card bank3 */ + status = EXMC_NPINTEN(bank); + + if ((status & flag) != (uint32_t)flag ){ + /* flag is reset */ + return RESET; + }else{ + /* flag is set */ + return SET; + } +} + +/*! + \brief clear EXMC flag + \param[in] bank: specifie the NAND bank, PCCARD bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC card bank + \param[in] flag: specify get which flag + one or more parameters can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_FLAG_RISE: interrupt rising edge status + \arg EXMC_NAND_PCCARD_FLAG_LEVEL: interrupt high-level status + \arg EXMC_NAND_PCCARD_FLAG_FALL: interrupt falling edge status + \arg EXMC_NAND_PCCARD_FLAG_FIFOE: FIFO empty flag + \param[out] none + \retval none +*/ +void exmc_flag_clear(uint32_t bank, uint32_t flag) +{ + /* NAND bank1,bank2 or PC card bank3 */ + EXMC_NPINTEN(bank) &= ~flag; +} + +/*! + \brief check EXMC interrupt flag is set or not + \param[in] bank: specifies the NAND bank, PC card bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC card bank + \param[in] interrupt_source: specify get which interrupt flag + only one parameter can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_INT_RISE: interrupt source of rising edge + \arg EXMC_NAND_PCCARD_INT_LEVEL: interrupt source of high-level + \arg EXMC_NAND_PCCARD_INT_FALL: interrupt source of falling edge + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exmc_interrupt_flag_get(uint32_t bank, uint32_t interrupt_source) +{ + uint32_t status = 0x00000000U,interrupt_enable = 0x00000000U,interrupt_state = 0x00000000U; + + /* NAND bank1,bank2 or PC card bank3 */ + status = EXMC_NPINTEN(bank); + interrupt_state = (status & (interrupt_source >> INTEN_INTS_OFFSET)); + + interrupt_enable = (status & interrupt_source); + + if ((interrupt_enable) && (interrupt_state)){ + /* interrupt flag is set */ + return SET; + }else{ + /* interrupt flag is reset */ + return RESET; + } +} + +/*! + \brief clear EXMC interrupt flag + \param[in] bank: specifies the NAND bank, PC card bank + only one parameter can be selected which is shown as below: + \arg EXMC_BANK1_NAND: the NAND bank1 + \arg EXMC_BANK2_NAND: the NAND bank2 + \arg EXMC_BANK3_PCCARD: the PC card bank + \param[in] interrupt_source: specify get which interrupt flag + one or more parameters can be selected which is shown as below: + \arg EXMC_NAND_PCCARD_INT_RISE: interrupt source of rising edge + \arg EXMC_NAND_PCCARD_INT_LEVEL: interrupt source of high-level + \arg EXMC_NAND_PCCARD_INT_FALL: interrupt source of falling edge + \param[out] none + \retval none +*/ +void exmc_interrupt_flag_clear(uint32_t bank, uint32_t interrupt_source) +{ + /* NAND bank1, bank2 or PC card bank3 */ + EXMC_NPINTEN(bank) &= ~(interrupt_source >> INTEN_INTS_OFFSET); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exti.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exti.c new file mode 100644 index 0000000..7084e96 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exti.c @@ -0,0 +1,249 @@ +/*! + \file gd32f10x_exti.c + \brief EXTI driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_exti.h" + +#define EXTI_REG_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinitialize the EXTI + \param[in] none + \param[out] none + \retval none +*/ +void exti_deinit(void) +{ + /* reset the value of all the EXTI registers */ + EXTI_INTEN = EXTI_REG_RESET_VALUE; + EXTI_EVEN = EXTI_REG_RESET_VALUE; + EXTI_RTEN = EXTI_REG_RESET_VALUE; + EXTI_FTEN = EXTI_REG_RESET_VALUE; + EXTI_SWIEV = EXTI_REG_RESET_VALUE; +} + +/*! + \brief initialize the EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[in] mode: interrupt or event mode, refer to exti_mode_enum + only one parameter can be selected which is shown as below: + \arg EXTI_INTERRUPT: interrupt mode + \arg EXTI_EVENT: event mode + \param[in] trig_type: interrupt trigger type, refer to exti_trig_type_enum + only one parameter can be selected which is shown as below: + \arg EXTI_TRIG_RISING: rising edge trigger + \arg EXTI_TRIG_FALLING: falling trigger + \arg EXTI_TRIG_BOTH: rising and falling trigger + \arg EXTI_TRIG_NONE: without rising edge or falling edge trigger + \param[out] none + \retval none +*/ +void exti_init(exti_line_enum linex, exti_mode_enum mode, exti_trig_type_enum trig_type) +{ + /* reset the EXTI line x */ + EXTI_INTEN &= ~(uint32_t)linex; + EXTI_EVEN &= ~(uint32_t)linex; + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + + /* set the EXTI mode and enable the interrupts or events from EXTI line x */ + switch(mode) { + case EXTI_INTERRUPT: + EXTI_INTEN |= (uint32_t)linex; + break; + case EXTI_EVENT: + EXTI_EVEN |= (uint32_t)linex; + break; + default: + break; + } + + /* set the EXTI trigger type */ + switch(trig_type) { + case EXTI_TRIG_RISING: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + break; + case EXTI_TRIG_FALLING: + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + case EXTI_TRIG_BOTH: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + case EXTI_TRIG_NONE: + default: + break; + } +} + +/*! + \brief enable the interrupts from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_enable(exti_line_enum linex) +{ + EXTI_INTEN |= (uint32_t)linex; +} + +/*! + \brief disable the interrupts from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_disable(exti_line_enum linex) +{ + EXTI_INTEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_enable(exti_line_enum linex) +{ + EXTI_EVEN |= (uint32_t)linex; +} + +/*! + \brief disable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_disable(exti_line_enum linex) +{ + EXTI_EVEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_enable(exti_line_enum linex) +{ + EXTI_SWIEV |= (uint32_t)linex; +} + +/*! + \brief disable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_disable(exti_line_enum linex) +{ + EXTI_SWIEV &= ~(uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval FlagStatus: status of flag (RESET or SET) +*/ +FlagStatus exti_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval FlagStatus: status of flag (RESET or SET) +*/ +FlagStatus exti_interrupt_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..19): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fmc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fmc.c new file mode 100644 index 0000000..77be676 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fmc.c @@ -0,0 +1,967 @@ +/*! + \file gd32f10x_fmc.c + \brief FMC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_fmc.h" + +/*! + \brief set the wait state counter value + \param[in] wscnt��wait state counter value + \arg WS_WSCNT_0: FMC 0 wait state + \arg WS_WSCNT_1: FMC 1 wait state + \arg WS_WSCNT_2: FMC 2 wait state + \param[out] none + \retval none +*/ +void fmc_wscnt_set(uint32_t wscnt) +{ + uint32_t reg; + + reg = FMC_WS; + /* set the wait state counter value */ + reg &= ~FMC_WS_WSCNT; + FMC_WS = (reg | wscnt); +} + +/*! + \brief unlock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_unlock(void) +{ + if((RESET != (FMC_CTL0 & FMC_CTL0_LK))){ + /* write the FMC unlock key */ + FMC_KEY0 = UNLOCK_KEY0; + FMC_KEY0 = UNLOCK_KEY1; + } + + if(FMC_BANK0_SIZE < FMC_SIZE){ + /* write the FMC unlock key */ + if(RESET != (FMC_CTL1 & FMC_CTL1_LK)){ + FMC_KEY1 = UNLOCK_KEY0; + FMC_KEY1 = UNLOCK_KEY1; + } + } +} + +/*! + \brief unlock the FMC bank0 operation + this function can be used for all GD32F10x devices. + for GD32F10x_MD and GD32F10x_HD, this function unlocks bank0. + for GD32F10x_XD and GD32F10x_CL with flash no more than 512KB, it is equivalent to fmc_unlock function. + \param[in] none + \param[out] none + \retval none +*/ +void fmc_bank0_unlock(void) +{ + if((RESET != (FMC_CTL0 & FMC_CTL0_LK))){ + /* write the FMC unlock key */ + FMC_KEY0 = UNLOCK_KEY0; + FMC_KEY0 = UNLOCK_KEY1; + } +} + +/*! + \brief unlock the FMC bank1 operation + this function can be used for GD32F10x_XD and GD32F10x_CL with flash more than 512KB. + \param[in] none + \param[out] none + \retval none +*/ +void fmc_bank1_unlock(void) +{ + if((RESET != (FMC_CTL1 & FMC_CTL1_LK))){ + /* write the FMC unlock key */ + FMC_KEY1 = UNLOCK_KEY0; + FMC_KEY1 = UNLOCK_KEY1; + } +} + +/*! + \brief lock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_lock(void) +{ + /* set the LK bit */ + FMC_CTL0 |= FMC_CTL0_LK; + + if(FMC_BANK0_SIZE < FMC_SIZE){ + /* set the LK bit */ + FMC_CTL1 |= FMC_CTL1_LK; + } +} + +/*! + \brief lock the FMC bank0 operation + this function can be used for all GD32F10X devices. + for GD32F10x_MD and GD32F10x_HD, this function unlocks bank0. + for GD32F10x_XD and GD32F10x_CL with flash no more than 512KB, it is equivalent to fmc_unlock function. + \param[in] none + \param[out] none + \retval none +*/ +void fmc_bank0_lock(void) +{ + /* set the LK bit*/ + FMC_CTL0 |= FMC_CTL0_LK; +} + +/*! + \brief lock the FMC bank1 operation + this function can be used for GD32F10x_XD and GD32F10x_CL with flash more than 512KB. + \param[in] none + \param[out] none + \retval none +*/ +void fmc_bank1_lock(void) +{ + /* set the LK bit*/ + FMC_CTL1 |= FMC_CTL1_LK; +} + +/*! + \brief erase page + \param[in] page_address: the page address to be erased. + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_page_erase(uint32_t page_address) +{ + fmc_state_enum fmc_state; + + if(FMC_BANK0_SIZE < FMC_SIZE){ + if(FMC_BANK0_END_ADDRESS > page_address){ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* if the last operation is completed, start page erase */ + if(FMC_READY == fmc_state){ + FMC_CTL0 |= FMC_CTL0_PER; + FMC_ADDR0 = page_address; + FMC_CTL0 |= FMC_CTL0_START; + __nop(); + __nop(); + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PER bit */ + FMC_CTL0 &= ~FMC_CTL0_PER; + } + }else{ + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* if the last operation is completed, start page erase */ + if(FMC_READY == fmc_state){ + FMC_CTL1 |= FMC_CTL1_PER; + FMC_ADDR1 = page_address; + if(FMC_OBSTAT & FMC_OBSTAT_SPC){ + FMC_ADDR0 = page_address; + } + FMC_CTL1 |= FMC_CTL1_START; + __nop(); + __nop(); + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PER bit */ + FMC_CTL1 &= ~FMC_CTL1_PER; + } + } + }else{ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* if the last operation is completed, start page erase */ + if(FMC_READY == fmc_state){ + FMC_CTL0 |= FMC_CTL0_PER; + FMC_ADDR0 = page_address; + FMC_CTL0 |= FMC_CTL0_START; + __nop(); + __nop(); + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PER bit */ + FMC_CTL0 &= ~FMC_CTL0_PER; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief erase whole chip + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_mass_erase(void) +{ + fmc_state_enum fmc_state; + if(FMC_BANK0_SIZE < FMC_SIZE){ + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY == fmc_state){ + /* start whole chip erase */ + FMC_CTL0 |= FMC_CTL0_MER; + FMC_CTL0 |= FMC_CTL0_START; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL0 &= ~FMC_CTL0_MER; + } + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY == fmc_state){ + /* start whole chip erase */ + FMC_CTL1 |= FMC_CTL1_MER; + FMC_CTL1 |= FMC_CTL1_START; + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL1 &= ~FMC_CTL1_MER; + } + }else{ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* start whole chip erase */ + FMC_CTL0 |= FMC_CTL0_MER; + FMC_CTL0 |= FMC_CTL0_START; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL0 &= ~FMC_CTL0_MER; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief erase bank0 + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank0_erase(void) +{ + fmc_state_enum fmc_state = FMC_READY; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* start FMC bank0 erase */ + FMC_CTL0 |= FMC_CTL0_MER; + FMC_CTL0 |= FMC_CTL0_START; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL0 &= ~FMC_CTL0_MER; + } + /* return the fmc state */ + return fmc_state; +} + +/*! + \brief erase bank1 + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank1_erase(void) +{ + fmc_state_enum fmc_state = FMC_READY; + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* start FMC bank1 erase */ + FMC_CTL1 |= FMC_CTL1_MER; + FMC_CTL1 |= FMC_CTL1_START; + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL1 &= ~FMC_CTL1_MER; + } + /* return the fmc state */ + return fmc_state; +} + +/*! + \brief program a word at the corresponding address + \param[in] address: address to program + \param[in] data: word to program + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_word_program(uint32_t address, uint32_t data) +{ + fmc_state_enum fmc_state = FMC_READY; + if(FMC_BANK0_SIZE < FMC_SIZE){ + if(FMC_BANK0_END_ADDRESS > address){ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL0 |= FMC_CTL0_PG; + REG32(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL0 &= ~FMC_CTL0_PG; + } + }else{ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL1 |= FMC_CTL1_PG; + REG32(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL1 &= ~FMC_CTL1_PG; + } + } + }else{ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL0 |= FMC_CTL0_PG; + REG32(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL0 &= ~FMC_CTL0_PG; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program a half word at the corresponding address + \param[in] address: address to program + \param[in] data: halfword to program + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_halfword_program(uint32_t address, uint16_t data) +{ + fmc_state_enum fmc_state = FMC_READY; + if(FMC_BANK0_SIZE < FMC_SIZE){ + if(FMC_BANK0_END_ADDRESS > address){ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL0 |= FMC_CTL0_PG; + REG16(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL0 &= ~FMC_CTL0_PG; + } + }else{ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL1 |= FMC_CTL1_PG; + REG16(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank1_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL1 &= ~FMC_CTL1_PG; + } + } + }else{ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL0 |= FMC_CTL0_PG; + REG16(address) = data; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the PG bit */ + FMC_CTL0 &= ~FMC_CTL0_PG; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief unlock the option byte operation + \param[in] none + \param[out] none + \retval none +*/ +void ob_unlock(void) +{ + if(RESET == (FMC_CTL0 & FMC_CTL0_OBWEN)){ + /* write the FMC key */ + FMC_OBKEY = UNLOCK_KEY0; + FMC_OBKEY = UNLOCK_KEY1; + } + + /* wait until OBWEN bit is set by hardware */ + while(RESET == (FMC_CTL0 & FMC_CTL0_OBWEN)){ + } +} + +/*! + \brief lock the option byte operation + \param[in] none + \param[out] none + \retval none +*/ +void ob_lock(void) +{ + /* reset the OBWEN bit */ + FMC_CTL0 &= ~FMC_CTL0_OBWEN; +} + +/*! + \brief erase the FMC option byte + unlock the FMC_CTL0 and option byte before calling this function + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum ob_erase(void) +{ + uint16_t temp_spc = FMC_NSPC; + + fmc_state_enum fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + /* check the option byte security protection value */ + if(RESET != ob_spc_get()){ + temp_spc = FMC_USPC; + } + + if(FMC_READY == fmc_state){ + + /* start erase the option byte */ + FMC_CTL0 |= FMC_CTL0_OBER; + FMC_CTL0 |= FMC_CTL0_START; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit */ + FMC_CTL0 &= ~FMC_CTL0_OBER; + /* set the OBPG bit */ + FMC_CTL0 |= FMC_CTL0_OBPG; + /* no security protection */ + OB_SPC = (uint16_t)temp_spc; + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + }else{ + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief enable write protection + \param[in] ob_wp: specify sector to be write protected, set the bit to 1 if + you want to protect the corresponding pages. meanwhile, sector + macro could used to set specific sector write protected. + one or more parameters can be selected which are shown as below: + \arg OB_WPx(x = 0..31): write protect specify sector + \arg OB_WP_ALL: write protect all sector + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum ob_write_protection_enable(uint32_t ob_wp) +{ + uint16_t temp_wp0, temp_wp1, temp_wp2, temp_wp3; + + fmc_state_enum fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + ob_wp = (uint32_t)(~ob_wp); + temp_wp0 = (uint16_t)(ob_wp & OB_WP0_WP0); + temp_wp1 = (uint16_t)((ob_wp & OB_WP1_WP1) >> 8U); + temp_wp2 = (uint16_t)((ob_wp & OB_WP2_WP2) >> 16U); + temp_wp3 = (uint16_t)((ob_wp & OB_WP3_WP3) >> 24U); + + if(FMC_READY == fmc_state){ + + /* set the OBPG bit*/ + FMC_CTL0 |= FMC_CTL0_OBPG; + + if(0xFFU != temp_wp0){ + OB_WP0 = temp_wp0; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + } + if((FMC_READY == fmc_state) && (0xFFU != temp_wp1)){ + OB_WP1 = temp_wp1; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + } + if((FMC_READY == fmc_state) && (0xFFU != temp_wp2)){ + OB_WP2 = temp_wp2; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + } + if((FMC_READY == fmc_state) && (0xFFU != temp_wp3)){ + OB_WP3 = temp_wp3; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + } + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief configure security protection + \param[in] ob_spc: specify security protection + only one parameter can be selected which is shown as below: + \arg FMC_NSPC: no security protection + \arg FMC_USPC: under security protection + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum ob_security_protection_config(uint8_t ob_spc) +{ + fmc_state_enum fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + FMC_CTL0 |= FMC_CTL0_OBER; + FMC_CTL0 |= FMC_CTL0_START; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit */ + FMC_CTL0 &= ~FMC_CTL0_OBER; + + /* start the option byte program */ + FMC_CTL0 |= FMC_CTL0_OBPG; + + OB_SPC = (uint16_t)ob_spc; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + }else{ + if(FMC_TOERR != fmc_state){ + /* reset the OBER bit */ + FMC_CTL0 &= ~FMC_CTL0_OBER; + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program the FMC user option byte + \param[in] ob_fwdgt: option byte watchdog value + \arg OB_FWDGT_SW: software free watchdog + \arg OB_FWDGT_HW: hardware free watchdog + \param[in] ob_deepsleep: option byte deepsleep reset value + \arg OB_DEEPSLEEP_NRST: no reset when entering deepsleep mode + \arg OB_DEEPSLEEP_RST: generate a reset instead of entering deepsleep mode + \param[in] ob_stdby:option byte standby reset value + \arg OB_STDBY_NRST: no reset when entering standby mode + \arg OB_STDBY_RST: generate a reset instead of entering standby mode + \param[in] ob_boot: specifies the option byte boot bank value + \arg OB_BOOT_B0: boot from bank0 + \arg OB_BOOT_B1: boot from bank1 or bank0 if bank1 is void + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum ob_user_write(uint8_t ob_fwdgt, uint8_t ob_deepsleep, uint8_t ob_stdby, uint8_t ob_boot) +{ + fmc_state_enum fmc_state = FMC_READY; + uint8_t temp; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the OBPG bit*/ + FMC_CTL0 |= FMC_CTL0_OBPG; + + temp = ((uint8_t)((uint8_t)((uint8_t)(ob_boot | ob_fwdgt) | ob_deepsleep) | ob_stdby) | OB_USER_MASK); + OB_USER = (uint16_t)temp; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program option bytes data + \param[in] address: the option bytes address to be programmed + \param[in] data: the byte to be programmed + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum ob_data_program(uint32_t address, uint8_t data) +{ + fmc_state_enum fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the OBPG bit */ + FMC_CTL0 |= FMC_CTL0_OBPG; + REG16(address) = data; + + /* wait for the FMC ready */ + fmc_state = fmc_bank0_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_TOERR != fmc_state){ + /* reset the OBPG bit */ + FMC_CTL0 &= ~FMC_CTL0_OBPG; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief get the FMC user option byte + \param[in] none + \param[out] none + \retval the FMC user option byte values +*/ +uint8_t ob_user_get(void) +{ + /* return the FMC user option byte value */ + return (uint8_t)(FMC_OBSTAT >> 2U); +} + +/*! + \brief get OB_DATA in register FMC_OBSTAT + \param[in] none + \param[out] none + \retval ob_data +*/ +uint16_t ob_data_get(void) +{ + return (uint16_t)(FMC_OBSTAT >> 10U); +} + +/*! + \brief get the FMC option byte write protection + \param[in] none + \param[out] none + \retval the FMC write protection option byte value +*/ +uint32_t ob_write_protection_get(void) +{ + /* return the FMC write protection option byte value */ + return FMC_WP; +} + +/*! + \brief get the FMC option byte security protection + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ob_spc_get(void) +{ + FlagStatus spc_state = RESET; + + if(RESET != (FMC_OBSTAT & FMC_OBSTAT_SPC)){ + spc_state = SET; + }else{ + spc_state = RESET; + } + return spc_state; +} + +/*! + \brief enable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_BANK0_END: enable FMC end of program interrupt + \arg FMC_INT_BANK0_ERR: enable FMC error interrupt + \arg FMC_INT_BANK1_END: enable FMC bank1 end of program interrupt + \arg FMC_INT_BANK1_ERR: enable FMC bank1 error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_enable(uint32_t interrupt) +{ + FMC_REG_VAL(interrupt) |= BIT(FMC_BIT_POS(interrupt)); +} + +/*! + \brief disable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_BANK0_END: enable FMC end of program interrupt + \arg FMC_INT_BANK0_ERR: enable FMC error interrupt + \arg FMC_INT_BANK1_END: enable FMC bank1 end of program interrupt + \arg FMC_INT_BANK1_ERR: enable FMC bank1 error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_disable(uint32_t interrupt) +{ + FMC_REG_VAL(interrupt) &= ~BIT(FMC_BIT_POS(interrupt)); +} + +/*! + \brief check flag is set or not + \param[in] flag: check FMC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_BANK0_BUSY: FMC bank0 busy flag bit + \arg FMC_FLAG_BANK0_PGERR: FMC bank0 operation error flag bit + \arg FMC_FLAG_BANK0_WPERR: FMC bank0 erase/program protection error flag bit + \arg FMC_FLAG_BANK0_END: FMC bank0 end of operation flag bit + \arg FMC_FLAG_OBERR: FMC option bytes read error flag bit + \arg FMC_FLAG_BANK1_BUSY: FMC bank1 busy flag bit + \arg FMC_FLAG_BANK1_PGERR: FMC bank1 operation error flag bit + \arg FMC_FLAG_BANK1_WPERR: FMC bank1 erase/program protection error flag bit + \arg FMC_FLAG_BANK1_END: FMC bank1 end of operation flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_flag_get(uint32_t flag) +{ + if(RESET != (FMC_REG_VAL(flag) & BIT(FMC_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the FMC flag + \param[in] flag: clear FMC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_BANK0_PGERR: FMC bank0 operation error flag bit + \arg FMC_FLAG_BANK0_WPERR: FMC bank0 erase/program protection error flag bit + \arg FMC_FLAG_BANK0_END: FMC bank0 end of operation flag bit + \arg FMC_FLAG_BANK1_PGERR: FMC bank1 operation error flag bit + \arg FMC_FLAG_BANK1_WPERR: FMC bank1 erase/program protection error flag bit + \arg FMC_FLAG_BANK1_END: FMC bank1 end of operation flag bit + \param[out] none + \retval none +*/ +void fmc_flag_clear(uint32_t flag) +{ + FMC_REG_VAL(flag) |= BIT(FMC_BIT_POS(flag)); +} + +/*! + \brief get FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to fmc_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_BANK0_PGERR: FMC bank0 operation error interrupt flag bit + \arg FMC_INT_FLAG_BANK0_WPERR: FMC bank0 erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_BANK0_END: FMC bank0 end of operation interrupt flag bit + \arg FMC_INT_FLAG_BANK1_PGERR: FMC bank1 operation error interrupt flag bit + \arg FMC_INT_FLAG_BANK1_WPERR: FMC bank1 erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_BANK1_END: FMC bank1 end of operation interrupt flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_interrupt_flag_get(fmc_interrupt_flag_enum flag) +{ + uint32_t ret1 = RESET; + uint32_t ret2 = RESET; + + if(FMC_STAT0_REG_OFFSET == FMC_REG_OFFSET_GET(flag)){ + /* get the staus of interrupt flag */ + ret1 = (uint32_t)(FMC_REG_VALS(flag) & BIT(FMC_BIT_POS0(flag))); + /* get the staus of interrupt enale bit */ + ret2 = (uint32_t)(FMC_CTL0 & BIT(FMC_BIT_POS1(flag))); + }else{ + /* get the staus of interrupt flag */ + ret1 = (uint32_t)(FMC_REG_VALS(flag) & BIT(FMC_BIT_POS0(flag))); + /* get the staus of interrupt enale bit */ + ret2 = (uint32_t)(FMC_CTL1 & BIT(FMC_BIT_POS1(flag))); + } + + if(ret1 && ret2){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_BANK0_PGERR: FMC bank0 operation error interrupt flag bit + \arg FMC_INT_FLAG_BANK0_WPERR: FMC bank0 erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_BANK0_END: FMC bank0 end of operation interrupt flag bit + \arg FMC_INT_FLAG_BANK1_PGERR: FMC bank1 operation error interrupt flag bit + \arg FMC_INT_FLAG_BANK1_WPERR: FMC bank1 erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_BANK1_END: FMC bank1 end of operation interrupt flag bit + \param[out] none + \retval none +*/ +void fmc_interrupt_flag_clear(fmc_interrupt_flag_enum flag) +{ + FMC_REG_VALS(flag) |= BIT(FMC_BIT_POS0(flag)); +} + +/*! + \brief get the FMC bank0 state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank0_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_BUSY)){ + fmc_state = FMC_BUSY; + }else{ + if((uint32_t)0x00U != (FMC_STAT0 & FMC_STAT0_WPERR)){ + fmc_state = FMC_WPERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT0 & (FMC_STAT0_PGERR))){ + fmc_state = FMC_PGERR; + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief get the FMC bank1 state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank1_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT1 & FMC_STAT1_BUSY)){ + fmc_state = FMC_BUSY; + }else{ + if((uint32_t)0x00U != (FMC_STAT1 & FMC_STAT1_WPERR)){ + fmc_state = FMC_WPERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT1 & FMC_STAT1_PGERR)){ + fmc_state = FMC_PGERR; + } + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC bank0 is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do{ + /* get FMC state */ + fmc_state = fmc_bank0_state_get(); + timeout--; + }while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state){ + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC bank1 is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +fmc_state_enum fmc_bank1_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do{ + /* get FMC state */ + fmc_state = fmc_bank1_state_get(); + timeout--; + }while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state){ + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fwdgt.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fwdgt.c new file mode 100644 index 0000000..1de2d06 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fwdgt.c @@ -0,0 +1,211 @@ +/*! + \file gd32f10x_fwdgt.c + \brief FWDGT driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_fwdgt.h" + +/*! + \brief enable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_enable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; +} + +/*! + \brief disable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_disable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_DISABLE; +} + +/*! + \brief start the free watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_enable(void) +{ + FWDGT_CTL = FWDGT_KEY_ENABLE; +} + +/*! + \brief configure the free watchdog timer counter prescaler value + \param[in] prescaler_value: specify prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_prescaler_value_config(uint16_t prescaler_value) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the PUD flag to be reset */ + do{ + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + }while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if ((uint32_t)RESET != flag_status){ + return ERROR; + } + + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_value; + + return SUCCESS; +} + +/*! + \brief configure the free watchdog timer counter reload value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_reload_value_config(uint16_t reload_value) +{ + uint32_t timeout = FWDGT_RLD_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the RUD flag to be reset */ + do{ + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + }while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if ((uint32_t)RESET != flag_status){ + return ERROR; + } + + FWDGT_RLD = RLD_RLD(reload_value); + + return SUCCESS; +} + +/*! + \brief reload the counter of FWDGT + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_counter_reload(void) +{ + FWDGT_CTL = FWDGT_KEY_RELOAD; +} + +/*! + \brief configure counter reload value, and prescaler divider value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[in] prescaler_div: FWDGT prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC,and FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + /* wait until the PUD flag to be reset */ + do{ + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + }while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status){ + return ERROR; + } + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_div; + + timeout = FWDGT_RLD_TIMEOUT; + /* wait until the RUD flag to be reset */ + do{ + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + }while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status){ + return ERROR; + } + FWDGT_RLD = RLD_RLD(reload_value); + /* reload the counter */ + FWDGT_CTL = FWDGT_KEY_RELOAD; + + return SUCCESS; +} + +/*! + \brief get flag state of FWDGT + \param[in] flag: flag to get + only one parameter can be selected which is shown as below: + \arg FWDGT_FLAG_PUD: a write operation to FWDGT_PSC register is on going + \arg FWDGT_FLAG_RUD: a write operation to FWDGT_RLD register is on going + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fwdgt_flag_get(uint16_t flag) +{ + if(FWDGT_STAT & flag){ + return SET; + } + + return RESET; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_gpio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_gpio.c new file mode 100644 index 0000000..db7e801 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_gpio.c @@ -0,0 +1,533 @@ +/*! + \file gd32f10x_gpio.c + \brief GPIO driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_gpio.h" + +#define AFIO_EXTI_SOURCE_MASK ((uint8_t)0x03U) /*!< AFIO exti source selection mask*/ +#define AFIO_EXTI_SOURCE_FIELDS ((uint8_t)0x04U) /*!< select AFIO exti source registers */ +#define LSB_16BIT_MASK ((uint16_t)0xFFFFU) /*!< LSB 16-bit mask */ +#define PCF_POSITION_MASK ((uint32_t)0x000F0000U) /*!< AFIO_PCF register position mask */ +#define PCF_SWJCFG_MASK ((uint32_t)0xF0FFFFFFU) /*!< AFIO_PCF register SWJCFG mask */ +#define PCF_LOCATION1_MASK ((uint32_t)0x00200000U) /*!< AFIO_PCF register location1 mask */ +#define PCF_LOCATION2_MASK ((uint32_t)0x00100000U) /*!< AFIO_PCF register location2 mask */ +#define AFIO_PCF1_FIELDS ((uint32_t)0x80000000U) /*!< select AFIO_PCF1 register */ +#define GPIO_OUTPUT_PORT_OFFSET ((uint32_t)4U) /*!< GPIO event output port offset*/ + +/*! + \brief reset GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[out] none + \retval none +*/ +void gpio_deinit(uint32_t gpio_periph) +{ + switch(gpio_periph){ + case GPIOA: + /* reset GPIOA */ + rcu_periph_reset_enable(RCU_GPIOARST); + rcu_periph_reset_disable(RCU_GPIOARST); + break; + case GPIOB: + /* reset GPIOB */ + rcu_periph_reset_enable(RCU_GPIOBRST); + rcu_periph_reset_disable(RCU_GPIOBRST); + break; + case GPIOC: + /* reset GPIOC */ + rcu_periph_reset_enable(RCU_GPIOCRST); + rcu_periph_reset_disable(RCU_GPIOCRST); + break; + case GPIOD: + /* reset GPIOD */ + rcu_periph_reset_enable(RCU_GPIODRST); + rcu_periph_reset_disable(RCU_GPIODRST); + break; + case GPIOE: + /* reset GPIOE */ + rcu_periph_reset_enable(RCU_GPIOERST); + rcu_periph_reset_disable(RCU_GPIOERST); + break; + case GPIOF: + /* reset GPIOF */ + rcu_periph_reset_enable(RCU_GPIOFRST); + rcu_periph_reset_disable(RCU_GPIOFRST); + break; + case GPIOG: + /* reset GPIOG */ + rcu_periph_reset_enable(RCU_GPIOGRST); + rcu_periph_reset_disable(RCU_GPIOGRST); + break; + default: + break; + } +} + +/*! + \brief reset alternate function I/O(AFIO) + \param[in] none + \param[out] none + \retval none +*/ +void gpio_afio_deinit(void) +{ + rcu_periph_reset_enable(RCU_AFRST); + rcu_periph_reset_disable(RCU_AFRST); +} + +/*! + \brief GPIO parameter initialization + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] mode: gpio pin mode + only one parameter can be selected which is shown as below: + \arg GPIO_MODE_AIN: analog input mode + \arg GPIO_MODE_IN_FLOATING: floating input mode + \arg GPIO_MODE_IPD: pull-down input mode + \arg GPIO_MODE_IPU: pull-up input mode + \arg GPIO_MODE_OUT_OD: GPIO output with open-drain + \arg GPIO_MODE_OUT_PP: GPIO output with push-pull + \arg GPIO_MODE_AF_OD: AFIO output with open-drain + \arg GPIO_MODE_AF_PP: AFIO output with push-pull + \param[in] speed: gpio output max speed value + only one parameter can be selected which is shown as below: + \arg GPIO_OSPEED_10MHZ: output max speed 10MHz + \arg GPIO_OSPEED_2MHZ: output max speed 2MHz + \arg GPIO_OSPEED_50MHZ: output max speed 50MHz + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + + \param[out] none + \retval none +*/ +void gpio_init(uint32_t gpio_periph, uint32_t mode, uint32_t speed, uint32_t pin) +{ + uint16_t i; + uint32_t temp_mode = 0U; + uint32_t reg = 0U; + + /* GPIO mode configuration */ + temp_mode = (uint32_t)(mode & ((uint32_t)0x0FU)); + + /* GPIO speed configuration */ + if(((uint32_t)0x00U) != ((uint32_t)mode & ((uint32_t)0x10U))){ + /* output mode max speed:10MHz,2MHz,50MHz */ + temp_mode |= (uint32_t)speed; + } + + /* configure the eight low port pins with GPIO_CTL0 */ + for(i = 0U;i < 8U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL0(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL0 register */ + GPIO_CTL0(gpio_periph) = reg; + } + } + /* configure the eight high port pins with GPIO_CTL1 */ + for(i = 8U;i < 16U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL1(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i - 8U); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i - 8U, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL1 register */ + GPIO_CTL1(gpio_periph) = reg; + } + } +} + +/*! + \brief set GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_set(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BOP(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief reset GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_reset(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BC(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief write data to the specified GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[in] bit_value: SET or RESET + \arg RESET: clear the port pin + \arg SET: set the port pin + \param[out] none + \retval none +*/ +void gpio_bit_write(uint32_t gpio_periph, uint32_t pin, bit_status bit_value) +{ + if(RESET != bit_value){ + GPIO_BOP(gpio_periph) = (uint32_t)pin; + }else{ + GPIO_BC(gpio_periph) = (uint32_t)pin; + } +} + +/*! + \brief write data to the specified GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] data: specify the value to be written to the port output data register + \param[out] none + \retval none +*/ +void gpio_port_write(uint32_t gpio_periph,uint16_t data) +{ + GPIO_OCTL(gpio_periph) = (uint32_t)data; +} + +/*! + \brief get GPIO pin input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval input status of gpio pin: SET or RESET +*/ +FlagStatus gpio_input_bit_get(uint32_t gpio_periph,uint32_t pin) +{ + if((uint32_t)RESET != (GPIO_ISTAT(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[out] none + \retval input status of gpio all pins +*/ +uint16_t gpio_input_port_get(uint32_t gpio_periph) +{ + return (uint16_t)(GPIO_ISTAT(gpio_periph)); +} + +/*! + \brief get GPIO pin output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval output status of gpio pin: SET or RESET +*/ +FlagStatus gpio_output_bit_get(uint32_t gpio_periph, uint32_t pin) +{ + if((uint32_t)RESET !=(GPIO_OCTL(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[out] none + \retval output status of gpio all pins +*/ +uint16_t gpio_output_port_get(uint32_t gpio_periph) +{ + return ((uint16_t)GPIO_OCTL(gpio_periph)); +} + +/*! + \brief configure GPIO pin remap + \param[in] gpio_remap: select the pin to remap + \arg GPIO_SPI0_REMAP: SPI0 remapping + \arg GPIO_I2C0_REMAP: I2C0 remapping + \arg GPIO_USART0_REMAP: USART0 remapping + \arg GPIO_USART1_REMAP: USART1 remapping + \arg GPIO_USART2_PARTIAL_REMAP: USART2 partial remapping + \arg GPIO_USART2_FULL_REMAP: USART2 full remapping + \arg GPIO_TIMER0_PARTIAL_REMAP: TIMER0 partial remapping + \arg GPIO_TIMER0_FULL_REMAP: TIMER0 full remapping + \arg GPIO_TIMER1_PARTIAL_REMAP1: TIMER1 partial remapping + \arg GPIO_TIMER1_PARTIAL_REMAP2: TIMER1 partial remapping + \arg GPIO_TIMER1_FULL_REMAP: TIMER1 full remapping + \arg GPIO_TIMER2_PARTIAL_REMAP: TIMER2 partial remapping + \arg GPIO_TIMER2_FULL_REMAP: TIMER2 full remapping + \arg GPIO_TIMER3_REMAP: TIMER3 remapping + \arg GPIO_CAN_PARTIAL_REMAP: CAN partial remapping(only for GD32F10X_MD, GD32F10X_HD devices and GD32F10X_XD devices) + \arg GPIO_CAN_FULL_REMAP: CAN full remapping(only for GD32F10X_MD, GD32F10X_HD devices and GD32F10X_XD devices) + \arg GPIO_CAN0_PARTIAL_REMAP: CAN0 partial remapping(only for GD32F10X_CL devices) + \arg GPIO_CAN0_FULL_REMAP: CAN0 full remapping(only for GD32F10X_CL devices) + \arg GPIO_PD01_REMAP: PD01 remapping + \arg GPIO_TIMER4CH3_IREMAP: TIMER4 channel3 internal remapping(only for GD32F10X_CL devices and GD32F10X_HD devices) + \arg GPIO_ADC0_ETRGRT_REMAP: ADC0 external trigger routine conversion remapping(only for GD32F10X_MD, GD32F10X_HD devices and GD32F10X_XD devices) + \arg GPIO_ADC1_ETRGRT_REMAP: ADC1 external trigger routine conversion remapping(only for GD32F10X_MD, GD32F10X_HD devices and GD32F10X_XD devices) + \arg GPIO_ENET_REMAP: ENET remapping(only for GD32F10X_CL devices) + \arg GPIO_CAN1_REMAP: CAN1 remapping(only for GD32F10X_CL devices) + \arg GPIO_SWJ_NONJTRST_REMAP: full SWJ(JTAG-DP + SW-DP),but without NJTRST + \arg GPIO_SWJ_SWDPENABLE_REMAP: JTAG-DP disabled and SW-DP enabled + \arg GPIO_SWJ_DISABLE_REMAP: JTAG-DP disabled and SW-DP disabled + \arg GPIO_SPI2_REMAP: SPI2 remapping(only for GD32F10X_CL, GD32F10X_HD and GD32F10X_XD devices) + \arg GPIO_TIMER1ITI1_REMAP: TIMER1 internal trigger 1 remapping(only for GD32F10X_CL devices) + \arg GPIO_PTP_PPS_REMAP: ethernet PTP PPS remapping(only for GD32F10X_CL devices) + \arg GPIO_TIMER8_REMAP: TIMER8 remapping + \arg GPIO_TIMER9_REMAP: TIMER9 remapping + \arg GPIO_TIMER10_REMAP: TIMER10 remapping + \arg GPIO_TIMER12_REMAP: TIMER12 remapping + \arg GPIO_TIMER13_REMAP: TIMER13 remapping + \arg GPIO_EXMC_NADV_REMAP: EXMC_NADV connect/disconnect + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void gpio_pin_remap_config(uint32_t remap, ControlStatus newvalue) +{ + uint32_t remap1 = 0U, remap2 = 0U, temp_reg = 0U, temp_mask = 0U; + + if(AFIO_PCF1_FIELDS == (remap & AFIO_PCF1_FIELDS)){ + /* get AFIO_PCF1 regiter value */ + temp_reg = AFIO_PCF1; + }else{ + /* get AFIO_PCF0 regiter value */ + temp_reg = AFIO_PCF0; + } + + temp_mask = (remap & PCF_POSITION_MASK) >> 0x10U; + remap1 = remap & LSB_16BIT_MASK; + + /* judge pin remap type */ + if((PCF_LOCATION1_MASK | PCF_LOCATION2_MASK) == (remap & (PCF_LOCATION1_MASK | PCF_LOCATION2_MASK))){ + temp_reg &= PCF_SWJCFG_MASK; + AFIO_PCF0 &= PCF_SWJCFG_MASK; + }else if(PCF_LOCATION2_MASK == (remap & PCF_LOCATION2_MASK)){ + remap2 = ((uint32_t)0x03U) << temp_mask; + temp_reg &= ~remap2; + temp_reg |= ~PCF_SWJCFG_MASK; + }else{ + temp_reg &= ~(remap1 << ((remap >> 0x15U)*0x10U)); + temp_reg |= ~PCF_SWJCFG_MASK; + } + + /* set pin remap value */ + if(DISABLE != newvalue){ + temp_reg |= (remap1 << ((remap >> 0x15U)*0x10U)); + } + + if(AFIO_PCF1_FIELDS == (remap & AFIO_PCF1_FIELDS)){ + /* set AFIO_PCF1 regiter value */ + AFIO_PCF1 = temp_reg; + }else{ + /* set AFIO_PCF0 regiter value */ + AFIO_PCF0 = temp_reg; + } +} + +/*! + \brief select GPIO pin exti sources + \param[in] gpio_outputport: gpio event output port + \arg GPIO_PORT_SOURCE_GPIOA: output port source A + \arg GPIO_PORT_SOURCE_GPIOB: output port source B + \arg GPIO_PORT_SOURCE_GPIOC: output port source C + \arg GPIO_PORT_SOURCE_GPIOD: output port source D + \arg GPIO_PORT_SOURCE_GPIOE: output port source E + \arg GPIO_PORT_SOURCE_GPIOF: output port source F + \arg GPIO_PORT_SOURCE_GPIOG: output port source G + \param[in] gpio_outputpin: GPIO_PIN_SOURCE_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_exti_source_select(uint8_t output_port, uint8_t output_pin) +{ + uint32_t source = 0U; + source = ((uint32_t)0x0FU) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK)); + + /* select EXTI sources */ + if(GPIO_PIN_SOURCE_4 > output_pin){ + /* select EXTI0/EXTI1/EXTI2/EXTI3 */ + AFIO_EXTISS0 &= ~source; + AFIO_EXTISS0 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_8 > output_pin){ + /* select EXTI4/EXTI5/EXTI6/EXTI7 */ + AFIO_EXTISS1 &= ~source; + AFIO_EXTISS1 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_12 > output_pin){ + /* select EXTI8/EXTI9/EXTI10/EXTI11 */ + AFIO_EXTISS2 &= ~source; + AFIO_EXTISS2 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else{ + /* select EXTI12/EXTI13/EXTI14/EXTI15 */ + AFIO_EXTISS3 &= ~source; + AFIO_EXTISS3 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + } +} + +/*! + \brief configure GPIO pin event output + \param[in] output_port: gpio event output port + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PORT_GPIOA: event output port A + \arg GPIO_EVENT_PORT_GPIOB: event output port B + \arg GPIO_EVENT_PORT_GPIOC: event output port C + \arg GPIO_EVENT_PORT_GPIOD: event output port D + \arg GPIO_EVENT_PORT_GPIOE: event output port E + \arg GPIO_EVENT_PORT_GPIOE: event output port F + \arg GPIO_EVENT_PORT_GPIOE: event output port G + \param[in] output_pin: + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PIN_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_event_output_config(uint8_t output_port, uint8_t output_pin) +{ + uint32_t reg = 0U; + reg = AFIO_EC; + + /* clear AFIO_EC_PORT and AFIO_EC_PIN bits */ + reg &= (uint32_t)(~(AFIO_EC_PORT|AFIO_EC_PIN)); + + reg |= (uint32_t)((uint32_t)output_port << GPIO_OUTPUT_PORT_OFFSET); + reg |= (uint32_t)output_pin; + + AFIO_EC = reg; +} + +/*! + \brief enable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_enable(void) +{ + AFIO_EC |= AFIO_EC_EOE; +} + +/*! + \brief disable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_disable(void) +{ + AFIO_EC &= (uint32_t)(~AFIO_EC_EOE); +} + +/*! + \brief lock GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E,F,G) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_pin_lock(uint32_t gpio_periph, uint32_t pin) +{ + uint32_t lock = 0x00010000U; + lock |= pin; + + /* lock key writing sequence: write 1 -> write 0 -> write 1 -> read 0 -> read 1 */ + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + GPIO_LOCK(gpio_periph) = (uint32_t)pin; + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + lock = GPIO_LOCK(gpio_periph); + lock = GPIO_LOCK(gpio_periph); +} + +#ifdef GD32F10X_CL +/*! + \brief select ethernet MII or RMII PHY + \param[in] gpio_enetsel: ethernet MII or RMII PHY selection + \arg GPIO_ENET_PHY_MII: configure ethernet MAC for connection with an MII PHY + \arg GPIO_ENET_PHY_RMII: configure ethernet MAC for connection with an RMII PHY + \param[out] none + \retval none +*/ +void gpio_ethernet_phy_select(uint32_t gpio_enetsel) +{ + /* clear AFIO_PCF0_ENET_PHY_SEL bit */ + AFIO_PCF0 &= (uint32_t)(~AFIO_PCF0_ENET_PHY_SEL); + + /* select MII or RMII PHY */ + AFIO_PCF0 |= (uint32_t)gpio_enetsel; +} +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_i2c.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_i2c.c new file mode 100644 index 0000000..dc20fcc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_i2c.c @@ -0,0 +1,711 @@ +/*! + \file gd32f10x_i2c.c + \brief I2C driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_i2c.h" + +/* I2C register bit mask */ +#define I2CCLK_MAX ((uint32_t)0x00000036U) /*!< i2cclk maximum value */ +#define I2CCLK_MIN ((uint32_t)0x00000002U) /*!< i2cclk minimum value */ +#define I2C_FLAG_MASK ((uint32_t)0x0000FFFFU) /*!< i2c flag mask */ +#define I2C_ADDRESS_MASK ((uint32_t)0x000003FFU) /*!< i2c address mask */ +#define I2C_ADDRESS2_MASK ((uint32_t)0x000000FEU) /*!< the second i2c address mask */ + +/* I2C register bit offset */ +#define STAT1_PECV_OFFSET ((uint32_t)0x00000008U) /* bit offset of PECV in I2C_STAT1 */ + +/*! + \brief reset I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_deinit(uint32_t i2c_periph) +{ + switch(i2c_periph){ + case I2C0: + /* reset I2C0 */ + rcu_periph_reset_enable(RCU_I2C0RST); + rcu_periph_reset_disable(RCU_I2C0RST); + break; + case I2C1: + /* reset I2C1 */ + rcu_periph_reset_enable(RCU_I2C1RST); + rcu_periph_reset_disable(RCU_I2C1RST); + break; + default: + break; + } +} + +/*! + \brief configure I2C clock + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] clkspeed: I2C clock speed, supports standard mode (up to 100 kHz), fast mode (up to 400 kHz) + \param[in] dutycyc: duty cycle in fast mode + only one parameter can be selected which is shown as below: + \arg I2C_DTCY_2: T_low/T_high=2 + \arg I2C_DTCY_16_9: T_low/T_high=16/9 + \param[out] none + \retval none +*/ +void i2c_clock_config(uint32_t i2c_periph, uint32_t clkspeed, uint32_t dutycyc) +{ + uint32_t pclk1, clkc, freq, risetime; + uint32_t temp; + + pclk1 = rcu_clock_freq_get(CK_APB1); + /* I2C peripheral clock frequency */ + freq = (uint32_t)(pclk1/1000000U); + if(freq >= I2CCLK_MAX){ + freq = I2CCLK_MAX; + } + temp = I2C_CTL1(i2c_periph); + temp &= ~I2C_CTL1_I2CCLK; + temp |= freq; + + I2C_CTL1(i2c_periph) = temp; + + if(100000U >= clkspeed){ + /* the maximum SCL rise time is 1000ns in standard mode */ + risetime = (uint32_t)((pclk1/1000000U)+1U); + if(risetime >= I2CCLK_MAX){ + I2C_RT(i2c_periph) = I2CCLK_MAX; + }else if(risetime <= I2CCLK_MIN){ + I2C_RT(i2c_periph) = I2CCLK_MIN; + }else{ + I2C_RT(i2c_periph) = risetime; + } + clkc = (uint32_t)(pclk1/(clkspeed*2U)); + if(clkc < 0x04U){ + /* the CLKC in standard mode minmum value is 4 */ + clkc = 0x04U; + } + I2C_CKCFG(i2c_periph) |= (I2C_CKCFG_CLKC & clkc); + + }else if(400000U >= clkspeed){ + /* the maximum SCL rise time is 300ns in fast mode */ + I2C_RT(i2c_periph) = (uint32_t)(((freq*(uint32_t)300U)/(uint32_t)1000U)+(uint32_t)1U); + if(I2C_DTCY_2 == dutycyc){ + /* I2C duty cycle is 2 */ + clkc = (uint32_t)(pclk1/(clkspeed*3U)); + I2C_CKCFG(i2c_periph) &= ~I2C_CKCFG_DTCY; + }else{ + /* I2C duty cycle is 16/9 */ + clkc = (uint32_t)(pclk1/(clkspeed*25U)); + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_DTCY; + } + if(0U == (clkc & I2C_CKCFG_CLKC)){ + /* the CLKC in fast mode minmum value is 1 */ + clkc |= 0x0001U; + } + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_FAST; + I2C_CKCFG(i2c_periph) |= clkc; + }else{ + } +} + +/*! + \brief configure I2C address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] mode: + only one parameter can be selected which is shown as below: + \arg I2C_I2CMODE_ENABLE: I2C mode + \arg I2C_SMBUSMODE_ENABLE: SMBus mode + \param[in] addformat: 7bits or 10bits + only one parameter can be selected which is shown as below: + \arg I2C_ADDFORMAT_7BITS: address format is 7bits + \arg I2C_ADDFORMAT_10BITS: address format is 10bits + \param[in] addr: I2C address + \param[out] none + \retval none +*/ +void i2c_mode_addr_config(uint32_t i2c_periph, uint32_t mode, uint32_t addformat, uint32_t addr) +{ + /* SMBus/I2C mode selected */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SMBEN); + ctl |= mode; + I2C_CTL0(i2c_periph) = ctl; + /* configure address */ + addr = addr & I2C_ADDRESS_MASK; + I2C_SADDR0(i2c_periph) = (addformat | addr); +} + +/*! + \brief select SMBus type + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] type: + only one parameter can be selected which is shown as below: + \arg I2C_SMBUS_DEVICE: device + \arg I2C_SMBUS_HOST: host + \param[out] none + \retval none +*/ +void i2c_smbus_type_config(uint32_t i2c_periph, uint32_t type) +{ + if(I2C_SMBUS_HOST == type){ + I2C_CTL0(i2c_periph) |= I2C_CTL0_SMBSEL; + }else{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_SMBSEL); + } +} + +/*! + \brief whether or not to send an ACK + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] ack: + only one parameter can be selected which is shown as below: + \arg I2C_ACK_ENABLE: ACK will be sent + \arg I2C_ACK_DISABLE: ACK will not be sent + \param[out] none + \retval none +*/ +void i2c_ack_config(uint32_t i2c_periph, uint32_t ack) +{ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ACKEN); + ctl |= ack; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C POAP position + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pos: + only one parameter can be selected which is shown as below: + \arg I2C_ACKPOS_CURRENT: ACKEN bit decides whether or not to send ACK or not for the current byte + \arg I2C_ACKPOS_NEXT: ACKEN bit decides whether or not to send ACK for the next byte + \param[out] none + \retval none +*/ +void i2c_ackpos_config(uint32_t i2c_periph, uint32_t pos) +{ + uint32_t ctl = 0U; + /* configure I2C POAP position */ + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_POAP); + ctl |= pos; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief master sends slave address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: slave address + \param[in] trandirection: transmitter or receiver + only one parameter can be selected which is shown as below: + \arg I2C_TRANSMITTER: transmitter + \arg I2C_RECEIVER: receiver + \param[out] none + \retval none +*/ +void i2c_master_addressing(uint32_t i2c_periph, uint32_t addr, uint32_t trandirection) +{ + /* master is a transmitter or a receiver */ + if(I2C_TRANSMITTER == trandirection){ + addr = addr & I2C_TRANSMITTER; + }else{ + addr = addr | I2C_RECEIVER; + } + /* send slave address */ + I2C_DATA(i2c_periph) = addr; +} + +/*! + \brief enable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: the second address in dual-address mode + \param[out] none + \retval none +*/ +void i2c_dualaddr_enable(uint32_t i2c_periph, uint32_t addr) +{ + /* configure address */ + addr = addr & I2C_ADDRESS2_MASK; + I2C_SADDR1(i2c_periph) = (I2C_SADDR1_DUADEN | addr); +} + +/*! + \brief disable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_dualaddr_disable(uint32_t i2c_periph) +{ + I2C_SADDR1(i2c_periph) &= ~(I2C_SADDR1_DUADEN); +} + +/*! + \brief enable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_enable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_I2CEN; +} + +/*! + \brief disable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_disable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_I2CEN); +} + +/*! + \brief generate a START condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_start_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_START; +} + +/*! + \brief generate a STOP condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_stop_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_STOP; +} + +/*! + \brief I2C transmit data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] data: data of transmission + \param[out] none + \retval none +*/ +void i2c_data_transmit(uint32_t i2c_periph, uint8_t data) +{ + I2C_DATA(i2c_periph) = DATA_TRANS(data); +} + +/*! + \brief I2C receive data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval data of received +*/ +uint8_t i2c_data_receive(uint32_t i2c_periph) +{ + return (uint8_t)DATA_RECV(I2C_DATA(i2c_periph)); +} + +/*! + \brief configure I2C DMA mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmastate: + only one parameter can be selected which is shown as below: + \arg I2C_DMA_ON: enable DMA mode + \arg I2C_DMA_OFF: disable DMA mode + \param[out] none + \retval none +*/ +void i2c_dma_config(uint32_t i2c_periph, uint32_t dmastate) +{ + /* configure I2C DMA function */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMAON); + ctl |= dmastate; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief configure whether next DMA EOT is DMA last transfer or not + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmalast: + only one parameter can be selected which is shown as below: + \arg I2C_DMALST_ON: next DMA EOT is the last transfer + \arg I2C_DMALST_OFF: next DMA EOT is not the last transfer + \param[out] none + \retval none +*/ +void i2c_dma_last_transfer_config(uint32_t i2c_periph, uint32_t dmalast) +{ + /* configure DMA last transfer */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMALST); + ctl |= dmalast; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief whether to stretch SCL low when data is not ready in slave mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] stretchpara: + only one parameter can be selected which is shown as below: + \arg I2C_SCLSTRETCH_ENABLE: enable SCL stretching + \arg I2C_SCLSTRETCH_DISABLE: disable SCL stretching + \param[out] none + \retval none +*/ +void i2c_stretch_scl_low_config(uint32_t i2c_periph, uint32_t stretchpara) +{ + /* configure I2C SCL strerching */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SS); + ctl |= stretchpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief whether or not to response to a general call + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] gcallpara: + only one parameter can be selected which is shown as below: + \arg I2C_GCEN_ENABLE: slave will response to a general call + \arg I2C_GCEN_DISABLE: slave will not response to a general call + \param[out] none + \retval none +*/ +void i2c_slave_response_to_gcall_config(uint32_t i2c_periph, uint32_t gcallpara) +{ + /* configure slave response to a general call enable or disable */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_GCEN); + ctl |= gcallpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure software reset of I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] sreset: + only one parameter can be selected which is shown as below: + \arg I2C_SRESET_SET: I2C is under reset + \arg I2C_SRESET_RESET: I2C is not under reset + \param[out] none + \retval none +*/ +void i2c_software_reset_config(uint32_t i2c_periph, uint32_t sreset) +{ + /* modify CTL0 and configure software reset I2C state */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SRESET); + ctl |= sreset; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C PEC calculation + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecstate: + only one parameter can be selected which is shown as below: + \arg I2C_PEC_ENABLE: PEC calculation on + \arg I2C_PEC_DISABLE: PEC calculation off + \param[out] none + \retval none +*/ +void i2c_pec_config(uint32_t i2c_periph, uint32_t pecstate) +{ + /* on/off PEC calculation */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECEN); + ctl |= pecstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure whether to transfer PEC value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecpara: + only one parameter can be selected which is shown as below: + \arg I2C_PECTRANS_ENABLE: transfer PEC + \arg I2C_PECTRANS_DISABLE: not transfer PEC + \param[out] none + \retval none +*/ +void i2c_pec_transfer_config(uint32_t i2c_periph, uint32_t pecpara) +{ + /* whether to transfer PEC */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECTRANS); + ctl |= pecpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief get packet error checking value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval PEC value +*/ +uint8_t i2c_pec_value_get(uint32_t i2c_periph) +{ + return (uint8_t)((I2C_STAT1(i2c_periph) & I2C_STAT1_PECV)>>STAT1_PECV_OFFSET); +} + +/*! + \brief configure I2C alert through SMBA pin + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] smbuspara: + only one parameter can be selected which is shown as below: + \arg I2C_SALTSEND_ENABLE: issue alert through SMBA pin + \arg I2C_SALTSEND_DISABLE: not issue alert through SMBA pin + \param[out] none + \retval none +*/ +void i2c_smbus_alert_config(uint32_t i2c_periph, uint32_t smbuspara) +{ + /* issue alert through SMBA pin configure*/ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SALT); + ctl |= smbuspara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C ARP protocol in SMBus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] arpstate: + only one parameter can be selected which is shown as below: + \arg I2C_ARP_ENABLE: enable ARP + \arg I2C_ARP_DISABLE: disable ARP + \param[out] none + \retval none +*/ +void i2c_smbus_arp_config(uint32_t i2c_periph, uint32_t arpstate) +{ + /* enable or disable I2C ARP protocol*/ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ARPEN); + ctl |= arpstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief get I2C flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SBSEND: start condition sent out in master mode + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \arg I2C_FLAG_BTC: byte transmission finishes + \arg I2C_FLAG_ADD10SEND: header of 10-bit address is sent in master mode + \arg I2C_FLAG_STPDET: stop condition detected in slave mode + \arg I2C_FLAG_RBNE: I2C_DATA is not empty during receiving + \arg I2C_FLAG_TBE: I2C_DATA is empty during transmitting + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_OUERR: over-run or underrun situation occurs in slave mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_MASTER: a flag indicating whether I2C block is in master or slave mode + \arg I2C_FLAG_I2CBSY: busy flag + \arg I2C_FLAG_TRS: whether the I2C is a transmitter or a receiver + \arg I2C_FLAG_RXGC: general call address (00h) received + \arg I2C_FLAG_DEFSMB: default address of SMBus device + \arg I2C_FLAG_HSTSMB: SMBus host header detected in slave mode + \arg I2C_FLAG_DUMOD: dual flag in slave mode indicating which address is matched in dual-address mode + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_flag_get(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(RESET != (I2C_REG_VAL(i2c_periph, flag) & BIT(I2C_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_OUERR: over-run or under-run situation occurs in slave mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \param[out] none + \retval none +*/ +void i2c_flag_clear(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(I2C_FLAG_ADDSEND == flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL(i2c_periph, flag) &= ~BIT(I2C_BIT_POS(flag)); + } +} + +/*! + \brief enable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_interrupt_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt + \arg I2C_INT_EV: event interrupt + \arg I2C_INT_BUF: buffer interrupt + \param[out] none + \retval none +*/ +void i2c_interrupt_enable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) |= BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief disable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt enable + \arg I2C_INT_EV: event interrupt enable + \arg I2C_INT_BUF: buffer interrupt enable + \param[out] none + \retval none +*/ +void i2c_interrupt_disable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) &= ~BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief get I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_SBSEND: start condition sent out in master mode interrupt flag + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BTC: byte transmission finishes + \arg I2C_INT_FLAG_ADD10SEND: header of 10-bit address is sent in master mode interrupt flag + \arg I2C_INT_FLAG_STPDET: etop condition detected in slave mode interrupt flag + \arg I2C_INT_FLAG_RBNE: I2C_DATA is not Empty during receiving interrupt flag + \arg I2C_INT_FLAG_TBE: I2C_DATA is empty during transmitting interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_interrupt_flag_get(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U, bufie; + + /* check BUFIE */ + bufie = I2C_CTL1(i2c_periph)&I2C_CTL1_BUFIE; + + /* get the interrupt enable bit status */ + intenable = (I2C_REG_VAL(i2c_periph, int_flag) & BIT(I2C_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (I2C_REG_VAL2(i2c_periph, int_flag) & BIT(I2C_BIT_POS2(int_flag))); + + if((I2C_INT_FLAG_RBNE == int_flag) || (I2C_INT_FLAG_TBE == int_flag)){ + if(intenable && bufie){ + intenable = 1U; + }else{ + intenable = 0U; + } + } + if((0U != flagstatus) && (0U != intenable)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \param[out] none + \retval none +*/ +void i2c_interrupt_flag_clear(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + if(I2C_INT_FLAG_ADDSEND == int_flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL2(i2c_periph, int_flag) &= ~BIT(I2C_BIT_POS2(int_flag)); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_misc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_misc.c new file mode 100644 index 0000000..5f0d7f4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_misc.c @@ -0,0 +1,184 @@ +/*! + \file gd32f10x_misc.c + \brief MISC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_misc.h" + +/*! + \brief set the priority group + \param[in] nvic_prigroup: the NVIC priority group + \arg NVIC_PRIGROUP_PRE0_SUB4: 0 bits for pre-emption priority, 4 bits for subpriority + \arg NVIC_PRIGROUP_PRE1_SUB3: 1 bits for pre-emption priority, 3 bits for subpriority + \arg NVIC_PRIGROUP_PRE2_SUB2: 2 bits for pre-emption priority, 2 bits for subpriority + \arg NVIC_PRIGROUP_PRE3_SUB1: 3 bits for pre-emption priority, 1 bits for subpriority + \arg NVIC_PRIGROUP_PRE4_SUB0: 4 bits for pre-emption priority, 0 bits for subpriority + \param[out] none + \retval none +*/ +void nvic_priority_group_set(uint32_t nvic_prigroup) +{ + /* set the priority group value */ + SCB->AIRCR = NVIC_AIRCR_VECTKEY_MASK | nvic_prigroup; +} + +/*! + \brief enable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[in] nvic_irq_pre_priority: the pre-emption priority needed to set + \param[in] nvic_irq_sub_priority: the subpriority needed to set + \param[out] none + \retval none +*/ +void nvic_irq_enable(uint8_t nvic_irq, + uint8_t nvic_irq_pre_priority, + uint8_t nvic_irq_sub_priority) +{ + uint32_t temp_priority = 0x00U, temp_pre = 0x00U, temp_sub = 0x00U; + + /* use the priority group value to get the temp_pre and the temp_sub */ + switch((SCB->AIRCR) & (uint32_t)0x700U) { + case NVIC_PRIGROUP_PRE0_SUB4: + temp_pre = 0U; + temp_sub = 0x4U; + break; + case NVIC_PRIGROUP_PRE1_SUB3: + temp_pre = 1U; + temp_sub = 0x3U; + break; + case NVIC_PRIGROUP_PRE2_SUB2: + temp_pre = 2U; + temp_sub = 0x2U; + break; + case NVIC_PRIGROUP_PRE3_SUB1: + temp_pre = 3U; + temp_sub = 0x1U; + break; + case NVIC_PRIGROUP_PRE4_SUB0: + temp_pre = 4U; + temp_sub = 0x0U; + break; + default: + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + temp_pre = 2U; + temp_sub = 0x2U; + break; + } + + /* get the temp_priority to fill the NVIC->IP register */ + temp_priority = (uint32_t)nvic_irq_pre_priority << (0x4U - temp_pre); + temp_priority |= nvic_irq_sub_priority & (0x0FU >> (0x4U - temp_sub)); + temp_priority = temp_priority << 0x04U; + NVIC->IP[nvic_irq] = (uint8_t)temp_priority; + + /* enable the selected IRQ */ + NVIC->ISER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief disable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[out] none + \retval none +*/ +void nvic_irq_disable(uint8_t nvic_irq) +{ + /* disable the selected IRQ.*/ + NVIC->ICER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief set the NVIC vector table base address + \param[in] nvic_vict_tab: the RAM or FLASH base address + \arg NVIC_VECTTAB_RAM: RAM base address + \are NVIC_VECTTAB_FLASH: Flash base address + \param[in] offset: vector table offset + \param[out] none + \retval none +*/ +void nvic_vector_table_set(uint32_t nvic_vict_tab, uint32_t offset) +{ + SCB->VTOR = nvic_vict_tab | (offset & NVIC_VECTTAB_OFFSET_MASK); + __DSB(); +} + +/*! + \brief set the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system always enter low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the DEEPSLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode can be woke up + by all the enable and disable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_set(uint8_t lowpower_mode) +{ + SCB->SCR |= (uint32_t)lowpower_mode; +} + +/*! + \brief reset the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system will exit low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the SLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode only can be + woke up by the enable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_reset(uint8_t lowpower_mode) +{ + SCB->SCR &= (~(uint32_t)lowpower_mode); +} + +/*! + \brief set the systick clock source + \param[in] systick_clksource: the systick clock source needed to choose + \arg SYSTICK_CLKSOURCE_HCLK: systick clock source is from HCLK + \arg SYSTICK_CLKSOURCE_HCLK_DIV8: systick clock source is from HCLK/8 + \param[out] none + \retval none +*/ + +void systick_clksource_set(uint32_t systick_clksource) +{ + if(SYSTICK_CLKSOURCE_HCLK == systick_clksource) { + /* set the systick clock source from HCLK */ + SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; + } else { + /* set the systick clock source from HCLK/8 */ + SysTick->CTRL &= SYSTICK_CLKSOURCE_HCLK_DIV8; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_pmu.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_pmu.c new file mode 100644 index 0000000..0039ff3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_pmu.c @@ -0,0 +1,276 @@ +/*! + \file gd32f10x_pmu.c + \brief PMU driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_pmu.h" + +/*! + \brief reset PMU register + \param[in] none + \param[out] none + \retval none +*/ +void pmu_deinit(void) +{ + /* reset PMU */ + rcu_periph_reset_enable(RCU_PMURST); + rcu_periph_reset_disable(RCU_PMURST); +} + +/*! + \brief select low voltage detector threshold + \param[in] lvdt_n: + only one parameter can be selected which is shown as below: + \arg PMU_LVDT_0: voltage threshold is 2.2V + \arg PMU_LVDT_1: voltage threshold is 2.3V + \arg PMU_LVDT_2: voltage threshold is 2.4V + \arg PMU_LVDT_3: voltage threshold is 2.5V + \arg PMU_LVDT_4: voltage threshold is 2.6V + \arg PMU_LVDT_5: voltage threshold is 2.7V + \arg PMU_LVDT_6: voltage threshold is 2.8V + \arg PMU_LVDT_7: voltage threshold is 2.9V + \param[out] none + \retval none +*/ +void pmu_lvd_select(uint32_t lvdt_n) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; + /* clear LVDT bits */ + PMU_CTL &= ~PMU_CTL_LVDT; + /* set LVDT bits according to lvdt_n */ + PMU_CTL |= lvdt_n; + /* enable LVD */ + PMU_CTL |= PMU_CTL_LVDEN; +} + +/*! + \brief disable PMU lvd + \param[in] none + \param[out] none + \retval none +*/ +void pmu_lvd_disable(void) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; +} + +/*! + \brief PMU work in sleep mode + \param[in] sleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_sleepmode(uint8_t sleepmodecmd) +{ + /* clear sleepdeep bit of Cortex-M3 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); + + /* select WFI or WFE command to enter sleep mode */ + if(WFI_CMD == sleepmodecmd){ + __WFI(); + }else{ + __WFE(); + } +} + +/*! + \brief PMU work in deepsleep mode + \param[in] ldo: + only one parameter can be selected which is shown as below: + \arg PMU_LDO_NORMAL: LDO work in normal power mode when pmu enter deepsleep mode + \arg PMU_LDO_LOWPOWER: LDO work in low power mode when pmu enter deepsleep mode + \param[in] deepsleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_deepsleepmode(uint32_t ldo,uint8_t deepsleepmodecmd) +{ + static uint32_t reg_snap[ 4 ]; + /* clear stbmod and ldolp bits */ + PMU_CTL &= ~((uint32_t)(PMU_CTL_STBMOD | PMU_CTL_LDOLP)); + + /* set ldolp bit according to pmu_ldo */ + PMU_CTL |= ldo; + + /* set sleepdeep bit of Cortex-M3 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + reg_snap[0] = REG32(0xE000E010U); + reg_snap[1] = REG32(0xE000E100U); + reg_snap[2] = REG32(0xE000E104U); + reg_snap[3] = REG32(0xE000E108U); + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFF7FF83DU; + REG32(0xE000E184U) = 0XBFFFF8FFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI or WFE command to enter deepsleep mode */ + if(WFI_CMD == deepsleepmodecmd){ + __WFI(); + }else{ + __SEV(); + __WFE(); + __WFE(); + } + + REG32(0xE000E010U) = reg_snap[0] ; + REG32(0xE000E100U) = reg_snap[1] ; + REG32(0xE000E104U) = reg_snap[2] ; + REG32(0xE000E108U) = reg_snap[3] ; + + /* reset sleepdeep bit of Cortex-M3 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); +} + +/*! + \brief pmu work in standby mode + \param[in] none + \param[out] none + \retval none +*/ +void pmu_to_standbymode(void) +{ + /* set stbmod bit */ + PMU_CTL |= PMU_CTL_STBMOD; + + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + + /* set sleepdeep bit of Cortex-M3 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFFFFFFF7U; + REG32(0xE000E184U) = 0XFFFFFDFFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI command to enter standby mode */ + __WFI(); +} + +/*! + \brief enable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_enable(void) +{ + PMU_CS |= PMU_CS_WUPEN; +} + +/*! + \brief disable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_disable(void) +{ + PMU_CS &= ~PMU_CS_WUPEN; +} + +/*! + \brief enable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_enable(void) +{ + PMU_CTL |= PMU_CTL_BKPWEN; +} + +/*! + \brief disable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_disable(void) +{ + PMU_CTL &= ~PMU_CTL_BKPWEN; +} + +/*! + \brief get flag state + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_WAKEUP: wakeup flag + \arg PMU_FLAG_STANDBY: standby flag + \arg PMU_FLAG_LVD: lvd flag + \param[out] none + \retval FlagStatus SET or RESET +*/ +FlagStatus pmu_flag_get(uint32_t flag) +{ + if(PMU_CS & flag){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear flag bit + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_RESET_WAKEUP: reset wakeup flag + \arg PMU_FLAG_RESET_STANDBY: reset standby flag + \param[out] none + \retval none +*/ +void pmu_flag_clear(uint32_t flag) +{ + switch(flag){ + case PMU_FLAG_RESET_WAKEUP: + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + break; + case PMU_FLAG_RESET_STANDBY: + /* reset standby flag */ + PMU_CTL |= PMU_CTL_STBRST; + break; + default : + break; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rcu.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rcu.c new file mode 100644 index 0000000..62fcc80 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rcu.c @@ -0,0 +1,1192 @@ +/*! + \file gd32f10x_rcu.c + \brief RCU driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_rcu.h" + +/* define clock source */ +#define SEL_IRC8M ((uint16_t)0U) +#define SEL_HXTAL ((uint16_t)1U) +#define SEL_PLL ((uint16_t)2U) + +/* define startup timeout count */ +#define OSC_STARTUP_TIMEOUT ((uint32_t)0xFFFFFU) +#define LXTAL_STARTUP_TIMEOUT ((uint32_t)0x3FFFFFFU) + +/*! + \brief deinitialize the RCU + \param[in] none + \param[out] none + \retval none +*/ +void rcu_deinit(void) +{ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + rcu_osci_stab_wait(RCU_IRC8M); + + RCU_CFG0 &= ~RCU_CFG0_SCS; + + /* reset CTL register */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + RCU_CTL &= ~RCU_CTL_HXTALBPS; +#ifdef GD32F10X_CL + RCU_CTL &= ~(RCU_CTL_PLL1EN | RCU_CTL_PLL2EN); +#endif /* GD32F10X_CL */ + + /* reset CFG0 register */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0 | RCU_CFG0_PLLMF | + RCU_CFG0_USBDPSC | RCU_CFG0_CKOUT0SEL | RCU_CFG0_PLLMF_4 | RCU_CFG0_ADCPSC_2); +#elif defined(GD32F10X_CL) + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_CKOUT0SEL | RCU_CFG0_ADCPSC_2 | RCU_CFG0_PLLMF_4); +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + /* reset INT and CFG1 register */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + RCU_INT = 0x009f0000U; +#elif defined(GD32F10X_CL) + RCU_INT = 0x00ff0000U; + RCU_CFG1 &= ~(RCU_CFG1_PREDV0 | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PLL2MF | + RCU_CFG1_PREDV0SEL | RCU_CFG1_I2S1SEL | RCU_CFG1_I2S2SEL); +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ +} + +/*! + \brief enable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E,F,G): GPIO ports clock + \arg RCU_AF : alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_ENET: ENET clock(CL series available) + \arg RCU_ENETTX: ENETTX clock(CL series available) + \arg RCU_ENETRX: ENETRX clock(CL series available) + \arg RCU_USBD: USBD clock(HD,XD series available) + \arg RCU_USBFS: USBFS clock(CL series available) + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are only available for XD series): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1,CAN1 is only available for CL series): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1,2,ADC2 is not available for CL series): ADC clock + \arg RCU_SDIO: SDIO clock(not available for CL series) + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_enable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E,F,G): GPIO ports clock + \arg RCU_AF: alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_ENET: ENET clock(CL series available) + \arg RCU_ENETTX: ENETTX clock(CL series available) + \arg RCU_ENETRX: ENETRX clock(CL series available) + \arg RCU_USBD: USBD clock(HD,XD series available) + \arg RCU_USBFS: USBFS clock(CL series available) + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are only available for XD series): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1,CAN1 is only available for CL series): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1,2,ADC2 is not available for CL series): ADC clock + \arg RCU_SDIO: SDIO clock(not available for CL series) + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_disable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief enable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_enable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_disable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief reset the peripherals + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E,F,G): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_ENETRST: reset ENET(CL series available) + \arg RCU_USBDRST: reset USBD(HD,XD series available) + \arg RCU_USBFSRST: reset USBFS(CL series available) + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are only available for XD series): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1,CAN1 is only available for CL series): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1,2, ADC2 is not available for CL series): reset ADC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_enable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) |= BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief disable reset the peripheral + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E,F,G): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_ENETRST: reset ENET(CL series available) + \arg RCU_USBDRST: reset USBD(HD,XD series available) + \arg RCU_USBFSRST: reset USBFS(CL series available) + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are only available for XD series): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1,CAN1 is only available for CL series): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1,2, ADC2 is not available for CL series): reset ADC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_disable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) &= ~BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief reset the BKP domain + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_enable(void) +{ + RCU_BDCTL |= RCU_BDCTL_BKPRST; +} + +/*! + \brief disable the BKP domain reset + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_disable(void) +{ + RCU_BDCTL &= ~RCU_BDCTL_BKPRST; +} + +/*! + \brief configure the system clock source + \param[in] ck_sys: system clock source select + only one parameter can be selected which is shown as below: + \arg RCU_CKSYSSRC_IRC8M: select CK_IRC8M as the CK_SYS source + \arg RCU_CKSYSSRC_HXTAL: select CK_HXTAL as the CK_SYS source + \arg RCU_CKSYSSRC_PLL: select CK_PLL as the CK_SYS source + \param[out] none + \retval none +*/ +void rcu_system_clock_source_config(uint32_t ck_sys) +{ + uint32_t reg; + + reg = RCU_CFG0; + /* reset the SCS bits and set according to ck_sys */ + reg &= ~RCU_CFG0_SCS; + RCU_CFG0 = (reg | ck_sys); +} + +/*! + \brief get the system clock source + \param[in] none + \param[out] none + \retval which clock is selected as CK_SYS source + \arg RCU_SCSS_IRC8M: CK_IRC8M is selected as the CK_SYS source + \arg RCU_SCSS_HXTAL: CK_HXTAL is selected as the CK_SYS source + \arg RCU_SCSS_PLL: CK_PLL is selected as the CK_SYS source +*/ +uint32_t rcu_system_clock_source_get(void) +{ + return (RCU_CFG0 & RCU_CFG0_SCSS); +} + +/*! + \brief configure the AHB clock prescaler selection + \param[in] ck_ahb: AHB clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_AHB_CKSYS_DIVx, x=1, 2, 4, 8, 16, 64, 128, 256, 512 + \param[out] none + \retval none +*/ +void rcu_ahb_clock_config(uint32_t ck_ahb) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the AHBPSC bits and set according to ck_ahb */ + reg &= ~RCU_CFG0_AHBPSC; + RCU_CFG0 = (reg | ck_ahb); +} + +/*! + \brief configure the APB1 clock prescaler selection + \param[in] ck_apb1: APB1 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB1_CKAHB_DIV1: select CK_AHB as CK_APB1 + \arg RCU_APB1_CKAHB_DIV2: select CK_AHB/2 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV4: select CK_AHB/4 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV8: select CK_AHB/8 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV16: select CK_AHB/16 as CK_APB1 + \param[out] none + \retval none +*/ +void rcu_apb1_clock_config(uint32_t ck_apb1) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB1PSC and set according to ck_apb1 */ + reg &= ~RCU_CFG0_APB1PSC; + RCU_CFG0 = (reg | ck_apb1); +} + +/*! + \brief configure the APB2 clock prescaler selection + \param[in] ck_apb2: APB2 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB2_CKAHB_DIV1: select CK_AHB as CK_APB2 + \arg RCU_APB2_CKAHB_DIV2: select CK_AHB/2 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV4: select CK_AHB/4 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV8: select CK_AHB/8 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV16: select CK_AHB/16 as CK_APB2 + \param[out] none + \retval none +*/ +void rcu_apb2_clock_config(uint32_t ck_apb2) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB2PSC and set according to ck_apb2 */ + reg &= ~RCU_CFG0_APB2PSC; + RCU_CFG0 = (reg | ck_apb2); +} + +/*! + \brief configure the CK_OUT0 clock source + \param[in] ckout0_src: CK_OUT0 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_CKOUT0SRC_NONE: no clock selected + \arg RCU_CKOUT0SRC_CKSYS: system clock selected + \arg RCU_CKOUT0SRC_IRC8M: high speed 8M internal oscillator clock selected + \arg RCU_CKOUT0SRC_HXTAL: HXTAL selected + \arg RCU_CKOUT0SRC_CKPLL_DIV2: CK_PLL/2 selected + \arg RCU_CKOUT0SRC_CKPLL1: CK_PLL1 selected + \arg RCU_CKOUT0SRC_CKPLL2_DIV2: CK_PLL2/2 selected + \arg RCU_CKOUT0SRC_EXT1: EXT1 selected + \arg RCU_CKOUT0SRC_CKPLL2: PLL2 selected + \param[out] none + \retval none +*/ +void rcu_ckout0_config(uint32_t ckout0_src) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the CKOUT0SRC, set according to ckout0_src */ + reg &= ~RCU_CFG0_CKOUT0SEL; + RCU_CFG0 = (reg | ckout0_src); +} + +/*! + \brief configure the main PLL clock + \param[in] pll_src: PLL clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PLLSRC_IRC8M_DIV2: IRC8M/2 clock selected as source clock of PLL + \arg RCU_PLLSRC_HXTAL: HXTAL selected as source clock of PLL + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL_MULx (XD series x = 2..32, CL series x = 2..14, 6.5, 16..32) + \param[out] none + \retval none +*/ +void rcu_pll_config(uint32_t pll_src, uint32_t pll_mul) +{ + uint32_t reg = 0U; + + reg = RCU_CFG0; + + /* PLL clock source and multiplication factor configuration */ + reg &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + reg |= (pll_src | pll_mul); + + RCU_CFG0 = reg; +} + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) +/*! + \brief configure the PREDV0 division factor + \param[in] predv0_div: PREDV0 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0_DIVx, x = 1,2 + \param[out] none + \retval none +*/ +void rcu_predv0_config(uint32_t predv0_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG0; + /* reset PREDV0 bit */ + reg &= ~RCU_CFG0_PREDV0; + if(RCU_PREDV0_DIV2 == predv0_div){ + /* set the PREDV0 bit */ + reg |= RCU_CFG0_PREDV0; + } + + RCU_CFG0 = reg; +} +#elif defined(GD32F10X_CL) +/*! + \brief configure the PREDV0 division factor and clock source + \param[in] predv0_source: PREDV0 input clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0SRC_HXTAL: HXTAL selected as PREDV0 input source clock + \arg RCU_PREDV0SRC_CKPLL1: CK_PLL1 selected as PREDV0 input source clock + \param[in] predv0_div: PREDV0 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv0_config(uint32_t predv0_source, uint32_t predv0_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset PREDV0SEL and PREDV0 bits */ + reg &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV0); + /* set the PREDV0SEL and PREDV0 division factor */ + reg |= (predv0_source | predv0_div); + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PREDV1 division factor + \param[in] predv1_div: PREDV1 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV1_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv1_config(uint32_t predv1_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset the PREDV1 bits */ + reg &= ~RCU_CFG1_PREDV1; + /* set the PREDV1 division factor */ + reg |= predv1_div; + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PLL1 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL1_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll1_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL1MF; + RCU_CFG1 |= pll_mul; +} + +/*! + \brief configure the PLL2 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL2_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll2_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL2MF; + RCU_CFG1 |= pll_mul; +} +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + +/*! + \brief configure the ADC prescaler factor + \param[in] adc_psc: ADC prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKADC_CKAPB2_DIV2: ADC prescaler select CK_APB2/2 + \arg RCU_CKADC_CKAPB2_DIV4: ADC prescaler select CK_APB2/4 + \arg RCU_CKADC_CKAPB2_DIV6: ADC prescaler select CK_APB2/6 + \arg RCU_CKADC_CKAPB2_DIV8: ADC prescaler select CK_APB2/8 + \arg RCU_CKADC_CKAPB2_DIV12: ADC prescaler select CK_APB2/12 + \arg RCU_CKADC_CKAPB2_DIV16: ADC prescaler select CK_APB2/16 + \param[out] none + \retval none +*/ +void rcu_adc_clock_config(uint32_t adc_psc) +{ + uint32_t reg0; + + /* reset the ADCPSC bits */ + reg0 = RCU_CFG0; + reg0 &= ~(RCU_CFG0_ADCPSC_2 | RCU_CFG0_ADCPSC); + + /* set the ADC prescaler factor */ + switch(adc_psc){ + case RCU_CKADC_CKAPB2_DIV2: + case RCU_CKADC_CKAPB2_DIV4: + case RCU_CKADC_CKAPB2_DIV6: + case RCU_CKADC_CKAPB2_DIV8: + reg0 |= (adc_psc << 14); + break; + + case RCU_CKADC_CKAPB2_DIV12: + case RCU_CKADC_CKAPB2_DIV16: + adc_psc &= ~BIT(2); + reg0 |= (adc_psc << 14 | RCU_CFG0_ADCPSC_2); + break; + + default: + break; + } + + /* set the register */ + RCU_CFG0 = reg0; +} + +/*! + \brief configure the USBD/USBFS prescaler factor + \param[in] usb_psc: USB prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKUSB_CKPLL_DIV1_5: USBD/USBFS prescaler select CK_PLL/1.5 + \arg RCU_CKUSB_CKPLL_DIV1: USBD/USBFS prescaler select CK_PLL/1 + \arg RCU_CKUSB_CKPLL_DIV2_5: USBD/USBFS prescaler select CK_PLL/2.5 + \arg RCU_CKUSB_CKPLL_DIV2: USBD/USBFS prescaler select CK_PLL/2 + \param[out] none + \retval none +*/ +void rcu_usb_clock_config(uint32_t usb_psc) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* configure the USBD/USBFS prescaler factor */ +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + reg &= ~RCU_CFG0_USBDPSC; +#elif defined(GD32F10X_CL) + reg &= ~RCU_CFG0_USBFSPSC; +#endif /* GD32F10X_MD and GD32F10X_HD and GD32F10X_XD */ + + RCU_CFG0 = (reg | usb_psc); +} + +/*! + \brief configure the RTC clock source selection + \param[in] rtc_clock_source: RTC clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_RTCSRC_NONE: no clock selected + \arg RCU_RTCSRC_LXTAL: CK_LXTAL selected as RTC source clock + \arg RCU_RTCSRC_IRC40K: CK_IRC40K selected as RTC source clock + \arg RCU_RTCSRC_HXTAL_DIV_128: CK_HXTAL/128 selected as RTC source clock + \param[out] none + \retval none +*/ +void rcu_rtc_clock_config(uint32_t rtc_clock_source) +{ + uint32_t reg; + + reg = RCU_BDCTL; + /* reset the RTCSRC bits and set according to rtc_clock_source */ + reg &= ~RCU_BDCTL_RTCSRC; + RCU_BDCTL = (reg | rtc_clock_source); +} + +#ifdef GD32F10X_CL +/*! + \brief configure the I2S1 clock source selection + \param[in] i2s_clock_source: I2S1 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S1SRC_CKSYS: System clock selected as I2S1 source clock + \arg RCU_I2S1SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S1 source clock + \param[out] none + \retval none +*/ +void rcu_i2s1_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S1SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S1SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} + +/*! + \brief configure the I2S2 clock source selection + \param[in] i2s_clock_source: I2S2 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S2SRC_CKSYS: system clock selected as I2S2 source clock + \arg RCU_I2S2SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S2 source clock + \param[out] none + \retval none +*/ +void rcu_i2s2_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S2SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S2SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} +#endif /* GD32F10X_CL */ + +/*! + \brief get the clock stabilization and periphral reset flags + \param[in] flag: the clock stabilization and periphral reset flags, refer to rcu_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_FLAG_IRC8MSTB: IRC8M stabilization flag + \arg RCU_FLAG_HXTALSTB: HXTAL stabilization flag + \arg RCU_FLAG_PLLSTB: PLL stabilization flag + \arg RCU_FLAG_PLL1STB: PLL1 stabilization flag(CL series only) + \arg RCU_FLAG_PLL2STB: PLL2 stabilization flag(CL series only) + \arg RCU_FLAG_LXTALSTB: LXTAL stabilization flag + \arg RCU_FLAG_IRC40KSTB: IRC40K stabilization flag + \arg RCU_FLAG_EPRST: external PIN reset flag + \arg RCU_FLAG_PORRST: power reset flag + \arg RCU_FLAG_SWRST: software reset flag + \arg RCU_FLAG_FWDGTRST: free watchdog timer reset flag + \arg RCU_FLAG_WWDGTRST: window watchdog timer reset flag + \arg RCU_FLAG_LPRST: low-power reset flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus rcu_flag_get(rcu_flag_enum flag) +{ + /* get the rcu flag */ + if(RESET != (RCU_REG_VAL(flag) & BIT(RCU_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear all the reset flag + \param[in] none + \param[out] none + \retval none +*/ +void rcu_all_reset_flag_clear(void) +{ + RCU_RSTSCK |= RCU_RSTSCK_RSTFC; +} + +/*! + \brief get the clock stabilization interrupt and ckm flags + \param[in] int_flag: interrupt and ckm flags, refer to rcu_int_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB: IRC40K stabilization interrupt flag + \arg RCU_INT_FLAG_LXTALSTB: LXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_IRC8MSTB: IRC8M stabilization interrupt flag + \arg RCU_INT_FLAG_HXTALSTB: HXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_PLLSTB: PLL stabilization interrupt flag + \arg RCU_INT_FLAG_PLL1STB: PLL1 stabilization interrupt flag(CL series only) + \arg RCU_INT_FLAG_PLL2STB: PLL2 stabilization interrupt flag(CL series only) + \arg RCU_INT_FLAG_CKM: HXTAL clock stuck interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus rcu_interrupt_flag_get(rcu_int_flag_enum int_flag) +{ + /* get the rcu interrupt flag */ + if(RESET != (RCU_REG_VAL(int_flag) & BIT(RCU_BIT_POS(int_flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the interrupt flags + \param[in] int_flag_clear: clock stabilization and stuck interrupt flags clear, refer to rcu_int_flag_clear_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB_CLR: IRC40K stabilization interrupt flag clear + \arg RCU_INT_FLAG_LXTALSTB_CLR: LXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_IRC8MSTB_CLR: IRC8M stabilization interrupt flag clear + \arg RCU_INT_FLAG_HXTALSTB_CLR: HXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLLSTB_CLR: PLL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLL1STB_CLR: PLL1 stabilization interrupt flag clear(CL series only) + \arg RCU_INT_FLAG_PLL2STB_CLR: PLL2 stabilization interrupt flag clear(CL series only) + \arg RCU_INT_FLAG_CKM_CLR: clock stuck interrupt flag clear + \param[out] none + \retval none +*/ +void rcu_interrupt_flag_clear(rcu_int_flag_clear_enum int_flag_clear) +{ + RCU_REG_VAL(int_flag_clear) |= BIT(RCU_BIT_POS(int_flag_clear)); +} + +/*! + \brief enable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + Only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable(CL series only) + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable(CL series only) + \param[out] none + \retval none +*/ +void rcu_interrupt_enable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) |= BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief disable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable(CL series only) + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable(CL series only) + \param[out] none + \retval none +*/ +void rcu_interrupt_disable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) &= ~BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief wait for oscillator stabilization flags is SET or oscillator startup is timeout + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1(CL series only) + \arg RCU_PLL2_CK: phase locked loop 2(CL series only) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus rcu_osci_stab_wait(rcu_osci_type_enum osci) +{ + uint32_t stb_cnt = 0U; + ErrStatus reval = ERROR; + FlagStatus osci_stat = RESET; + + switch(osci){ + /* wait HXTAL stable */ + case RCU_HXTAL: + while((RESET == osci_stat) && (HXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_HXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_HXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait LXTAL stable */ + case RCU_LXTAL: + while((RESET == osci_stat) && (LXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_LXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_LXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC8M stable */ + case RCU_IRC8M: + while((RESET == osci_stat) && (IRC8M_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC8MSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC8MSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC40K stable */ + case RCU_IRC40K: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC40KSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC40KSTB)){ + reval = SUCCESS; + } + break; + + /* wait PLL stable */ + case RCU_PLL_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLLSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLLSTB)){ + reval = SUCCESS; + } + break; + +#ifdef GD32F10X_CL + /* wait PLL1 stable */ + case RCU_PLL1_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL1STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL1STB)){ + reval = SUCCESS; + } + break; + /* wait PLL2 stable */ + case RCU_PLL2_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL2STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL2STB)){ + reval = SUCCESS; + } + break; +#endif /* GD32F10X_CL */ + + default: + break; + } + + /* return value */ + return reval; +} + +/*! + \brief turn on the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1(CL series only) + \arg RCU_PLL2_CK: phase locked loop 2(CL series only) + \param[out] none + \retval none +*/ +void rcu_osci_on(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) |= BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief turn off the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1(CL series only) + \arg RCU_PLL2_CK: phase locked loop 2(CL series only) + \param[out] none + \retval none +*/ +void rcu_osci_off(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) &= ~BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief enable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_enable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* enable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg | RCU_CTL_HXTALBPS); + break; + /* enable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg | RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC40K: + case RCU_PLL_CK: +#ifdef GD32F10X_CL + case RCU_PLL1_CK: + case RCU_PLL2_CK: +#endif /* GD32F10X_CL */ + break; + default: + break; + } +} + +/*! + \brief disable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_disable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* disable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg & ~RCU_CTL_HXTALBPS); + break; + /* disable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg & ~RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC40K: + case RCU_PLL_CK: +#ifdef GD32F10X_CL + case RCU_PLL1_CK: + case RCU_PLL2_CK: +#endif /* GD32F10X_CL */ + break; + default: + break; + } +} + +/*! + \brief enable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ + +void rcu_hxtal_clock_monitor_enable(void) +{ + RCU_CTL |= RCU_CTL_CKMEN; +} + +/*! + \brief disable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ +void rcu_hxtal_clock_monitor_disable(void) +{ + RCU_CTL &= ~RCU_CTL_CKMEN; +} + +/*! + \brief set the IRC8M adjust value + \param[in] irc8m_adjval: IRC8M adjust value, must be between 0 and 0x1F + \param[out] none + \retval none +*/ +void rcu_irc8m_adjust_value_set(uint8_t irc8m_adjval) +{ + uint32_t reg; + + reg = RCU_CTL; + /* reset the IRC8MADJ bits and set according to irc8m_adjval */ + reg &= ~RCU_CTL_IRC8MADJ; + RCU_CTL = (reg | ((irc8m_adjval & 0x1FU) << 3)); +} + +/*! + \brief deep-sleep mode voltage select + \param[in] dsvol: deep sleep mode voltage + only one parameter can be selected which is shown as below: + \arg RCU_DEEPSLEEP_V_1_2: the core voltage is 1.2V + \arg RCU_DEEPSLEEP_V_1_1: the core voltage is 1.1V + \arg RCU_DEEPSLEEP_V_1_0: the core voltage is 1.0V + \arg RCU_DEEPSLEEP_V_0_9: the core voltage is 0.9V + \param[out] none + \retval none +*/ +void rcu_deepsleep_voltage_set(uint32_t dsvol) +{ + dsvol &= RCU_DSV_DSLPVS; + RCU_DSV = dsvol; +} + +/*! + \brief get the system clock, bus and peripheral clock frequency + \param[in] clock: the clock frequency which to get + only one parameter can be selected which is shown as below: + \arg CK_SYS: system clock frequency + \arg CK_AHB: AHB clock frequency + \arg CK_APB1: APB1 clock frequency + \arg CK_APB2: APB2 clock frequency + \param[out] none + \retval clock frequency of system, AHB, APB1, APB2 +*/ +uint32_t rcu_clock_freq_get(rcu_clock_freq_enum clock) +{ + uint32_t sws, ck_freq = 0U; + uint32_t cksys_freq, ahb_freq, apb1_freq, apb2_freq; + uint32_t pllsel, predv0sel, pllmf,ck_src, idx, clk_exp; +#ifdef GD32F10X_CL + uint32_t predv0, predv1, pll1mf; +#endif /* GD32F10X_CL */ + + /* exponent of AHB, APB1 and APB2 clock divider */ + uint8_t ahb_exp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + uint8_t apb1_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + uint8_t apb2_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + + sws = GET_BITS(RCU_CFG0, 2, 3); + switch(sws){ + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + cksys_freq = IRC8M_VALUE; + break; + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + cksys_freq = HXTAL_VALUE; + break; + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + if(RCU_PLLSRC_HXTAL == pllsel) { + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + +#if (defined(GD32F10X_MD) || defined(GD32F10X_HD) || defined(GD32F10X_XD)) + predv0sel = (RCU_CFG0 & RCU_CFG0_PREDV0); + /* PREDV0 input source clock divided by 2 */ + if(RCU_CFG0_PREDV0 == predv0sel){ + ck_src = HXTAL_VALUE/2U; + } +#elif defined(GD32F10X_CL) + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = (uint32_t)((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = (uint32_t)((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src / predv1) * pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; +#endif /* GD32F10X_HD and GD32F10X_XD */ + }else{ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE/2U; + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + if(pllmf < 15U){ + pllmf += 2U; + }else{ + pllmf += 1U; + } + + cksys_freq = ck_src * pllmf; + + #ifdef GD32F10X_CL + if(15U == pllmf){ + /* PLL source clock multiply by 6.5 */ + cksys_freq = ck_src * 6U + ck_src / 2U; + } + #endif /* GD32F10X_CL */ + + break; + /* IRC8M is selected as CK_SYS */ + default: + cksys_freq = IRC8M_VALUE; + break; + } + + /* calculate AHB clock frequency */ + idx = GET_BITS(RCU_CFG0, 4, 7); + clk_exp = ahb_exp[idx]; + ahb_freq = cksys_freq >> clk_exp; + + /* calculate APB1 clock frequency */ + idx = GET_BITS(RCU_CFG0, 8, 10); + clk_exp = apb1_exp[idx]; + apb1_freq = ahb_freq >> clk_exp; + + /* calculate APB2 clock frequency */ + idx = GET_BITS(RCU_CFG0, 11, 13); + clk_exp = apb2_exp[idx]; + apb2_freq = ahb_freq >> clk_exp; + + /* return the clocks frequency */ + switch(clock){ + case CK_SYS: + ck_freq = cksys_freq; + break; + case CK_AHB: + ck_freq = ahb_freq; + break; + case CK_APB1: + ck_freq = apb1_freq; + break; + case CK_APB2: + ck_freq = apb2_freq; + break; + default: + break; + } + return ck_freq; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rtc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rtc.c new file mode 100644 index 0000000..950656d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rtc.c @@ -0,0 +1,273 @@ +/*! + \file gd32f10x_rtc.c + \brief RTC driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_rtc.h" + +/* RTC register high / low bits mask */ +#define RTC_HIGH_BITS_MASK ((uint32_t)0x000F0000U) /* RTC high bits mask */ +#define RTC_LOW_BITS_MASK ((uint32_t)0x0000FFFFU) /* RTC low bits mask */ + +/* RTC register high bits offset */ +#define RTC_HIGH_BITS_OFFSET ((uint32_t)16U) + +/*! + \brief enter RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_enter(void) +{ + RTC_CTL |= RTC_CTL_CMF; +} + +/*! + \brief exit RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_exit(void) +{ + RTC_CTL &= ~RTC_CTL_CMF; +} + +/*! + \brief set RTC counter value + \param[in] cnt: RTC counter value + \param[out] none + \retval none +*/ +void rtc_counter_set(uint32_t cnt) +{ + rtc_configuration_mode_enter(); + /* set the RTC counter high bits */ + RTC_CNTH = (cnt >> RTC_HIGH_BITS_OFFSET); + /* set the RTC counter low bits */ + RTC_CNTL = (cnt & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief set RTC prescaler value + \param[in] psc: RTC prescaler value + \param[out] none + \retval none +*/ +void rtc_prescaler_set(uint32_t psc) +{ + rtc_configuration_mode_enter(); + /* set the RTC prescaler high bits */ + RTC_PSCH = ((psc & RTC_HIGH_BITS_MASK) >> RTC_HIGH_BITS_OFFSET); + /* set the RTC prescaler low bits */ + RTC_PSCL = (psc & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief wait RTC last write operation finished flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_lwoff_wait(void) +{ + /* loop until LWOFF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_LWOFF)){ + } +} + +/*! + \brief wait RTC registers synchronized flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_register_sync_wait(void) +{ + /* clear RSYNF flag */ + RTC_CTL &= ~RTC_CTL_RSYNF; + /* loop until RSYNF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_RSYNF)){ + } +} + +/*! + \brief set RTC alarm value + \param[in] alarm: RTC alarm value + \param[out] none + \retval none +*/ +void rtc_alarm_config(uint32_t alarm) +{ + rtc_configuration_mode_enter(); + /* set the alarm high bits */ + RTC_ALRMH = (alarm >> RTC_HIGH_BITS_OFFSET); + /* set the alarm low bits */ + RTC_ALRML = (alarm & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief get RTC counter value + \param[in] none + \param[out] none + \retval RTC counter value +*/ +uint32_t rtc_counter_get(void) +{ + uint32_t temp = 0x0U; + + temp = RTC_CNTL; + temp |= (RTC_CNTH << RTC_HIGH_BITS_OFFSET); + return temp; +} + +/*! + \brief get RTC divider value + \param[in] none + \param[out] none + \retval RTC divider value +*/ +uint32_t rtc_divider_get(void) +{ + uint32_t temp = 0x00U; + + temp = ((RTC_DIVH & RTC_DIVH_DIV) << RTC_HIGH_BITS_OFFSET); + temp |= RTC_DIVL; + return temp; +} + +/*! + \brief get RTC flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \arg RTC_FLAG_LWOF: last write operation finished flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \param[out] none + \retval none +*/ +void rtc_flag_clear(uint32_t flag) +{ + /* clear RTC flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief get RTC interrupt flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_interrupt_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC interrupt flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval none +*/ +void rtc_interrupt_flag_clear(uint32_t flag) +{ + /* clear RTC interrupt flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief enable RTC interrupt + \param[in] interrupt: specify which interrupt to enbale + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_enable(uint32_t interrupt) +{ + RTC_INTEN |= interrupt; +} + +/*! + \brief disable RTC interrupt + \param[in] interrupt: specify which interrupt to disbale + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_disable(uint32_t interrupt) +{ + RTC_INTEN &= ~interrupt; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_sdio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_sdio.c new file mode 100644 index 0000000..f047c41 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_sdio.c @@ -0,0 +1,804 @@ +/*! + \file gd32f10x_sdio.c + \brief SDIO driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_sdio.h" + +#define DEFAULT_RESET_VALUE 0x00000000U + +/*! + \brief deinitialize the SDIO + \param[in] none + \param[out] none + \retval none +*/ +void sdio_deinit(void) +{ + SDIO_PWRCTL = DEFAULT_RESET_VALUE; + SDIO_CLKCTL = DEFAULT_RESET_VALUE; + SDIO_CMDAGMT = DEFAULT_RESET_VALUE; + SDIO_CMDCTL = DEFAULT_RESET_VALUE; + SDIO_DATATO = DEFAULT_RESET_VALUE; + SDIO_DATALEN = DEFAULT_RESET_VALUE; + SDIO_DATACTL = DEFAULT_RESET_VALUE; + SDIO_INTC = DEFAULT_RESET_VALUE; + SDIO_INTEN = DEFAULT_RESET_VALUE; +} + +/*! + \brief configure the SDIO clock + \param[in] clock_edge: SDIO_CLK clock edge + only one parameter can be selected which is shown as below: + \arg SDIO_SDIOCLKEDGE_RISING: select the rising edge of the SDIOCLK to generate SDIO_CLK + \arg SDIO_SDIOCLKEDGE_FALLING: select the falling edge of the SDIOCLK to generate SDIO_CLK + \param[in] clock_bypass: clock bypass + only one parameter can be selected which is shown as below: + \arg SDIO_CLOCKBYPASS_ENABLE: clock bypass + \arg SDIO_CLOCKBYPASS_DISABLE: no bypass + \param[in] clock_powersave: SDIO_CLK clock dynamic switch on/off for power saving + only one parameter can be selected which is shown as below: + \arg SDIO_CLOCKPWRSAVE_ENABLE: SDIO_CLK closed when bus is idle + \arg SDIO_CLOCKPWRSAVE_DISABLE: SDIO_CLK clock is always on + \param[in] clock_division: clock division, less than 256 + \param[out] none + \retval none +*/ +void sdio_clock_config(uint32_t clock_edge, uint32_t clock_bypass, uint32_t clock_powersave, uint16_t clock_division) +{ + uint32_t clock_config = 0U; + clock_config = SDIO_CLKCTL; + /* reset the CLKEDGE, CLKBYP, CLKPWRSAV, DIV */ + clock_config &= ~(SDIO_CLKCTL_CLKEDGE | SDIO_CLKCTL_CLKBYP | SDIO_CLKCTL_CLKPWRSAV | SDIO_CLKCTL_DIV); + + /* configure the SDIO_CLKCTL according to the parameters */ + clock_config |= (clock_edge | clock_bypass | clock_powersave | clock_division); + SDIO_CLKCTL = clock_config; +} + +/*! + \brief enable hardware clock control + \param[in] none + \param[out] none + \retval none +*/ +void sdio_hardware_clock_enable(void) +{ + SDIO_CLKCTL |= SDIO_CLKCTL_HWCLKEN; +} + +/*! + \brief disable hardware clock control + \param[in] none + \param[out] none + \retval none +*/ +void sdio_hardware_clock_disable(void) +{ + SDIO_CLKCTL &= ~SDIO_CLKCTL_HWCLKEN; +} + +/*! + \brief set different SDIO card bus mode + \param[in] bus_mode: SDIO card bus mode + only one parameter can be selected which is shown as below: + \arg SDIO_BUSMODE_1BIT: 1-bit SDIO card bus mode + \arg SDIO_BUSMODE_4BIT: 4-bit SDIO card bus mode + \arg SDIO_BUSMODE_8BIT: 8-bit SDIO card bus mode + \param[out] none + \retval none +*/ +void sdio_bus_mode_set(uint32_t bus_mode) +{ + /* reset the SDIO card bus mode bits and set according to bus_mode */ + SDIO_CLKCTL &= ~SDIO_CLKCTL_BUSMODE; + SDIO_CLKCTL |= bus_mode; +} + +/*! + \brief set the SDIO power state + \param[in] power_state: SDIO power state + only one parameter can be selected which is shown as below: + \arg SDIO_POWER_ON: SDIO power on + \arg SDIO_POWER_OFF: SDIO power off + \param[out] none + \retval none +*/ +void sdio_power_state_set(uint32_t power_state) +{ + SDIO_PWRCTL = power_state; +} + +/*! + \brief get the SDIO power state + \param[in] none + \param[out] none + \retval SDIO power state + only one parameter can be selected which is shown as below: + \arg SDIO_POWER_ON: SDIO power on + \arg SDIO_POWER_OFF: SDIO power off +*/ +uint32_t sdio_power_state_get(void) +{ + return SDIO_PWRCTL; +} + +/*! + \brief enable SDIO_CLK clock output + \param[in] none + \param[out] none + \retval none +*/ +void sdio_clock_enable(void) +{ + SDIO_CLKCTL |= SDIO_CLKCTL_CLKEN; +} + +/*! + \brief disable SDIO_CLK clock output + \param[in] none + \param[out] none + \retval none +*/ +void sdio_clock_disable(void) +{ + SDIO_CLKCTL &= ~SDIO_CLKCTL_CLKEN; +} + +/*! + \brief configure the command and response + \param[in] cmd_index: command index, refer to the related specifications + \param[in] cmd_argument: command argument, refer to the related specifications + \param[in] response_type: response type + only one parameter can be selected which is shown as below: + \arg SDIO_RESPONSETYPE_NO: no response + \arg SDIO_RESPONSETYPE_SHORT: short response + \arg SDIO_RESPONSETYPE_LONG: long response + \param[out] none + \retval none +*/ +void sdio_command_response_config(uint32_t cmd_index, uint32_t cmd_argument, uint32_t response_type) +{ + uint32_t cmd_config = 0U; + /* reset the command index, command argument and response type */ + SDIO_CMDAGMT &= ~SDIO_CMDAGMT_CMDAGMT; + SDIO_CMDAGMT = cmd_argument; + cmd_config = SDIO_CMDCTL; + cmd_config &= ~(SDIO_CMDCTL_CMDIDX | SDIO_CMDCTL_CMDRESP); + /* configure SDIO_CMDCTL and SDIO_CMDAGMT according to the parameters */ + cmd_config |= (cmd_index | response_type); + SDIO_CMDCTL = cmd_config; +} + +/*! + \brief set the command state machine wait type + \param[in] wait_type: wait type + only one parameter can be selected which is shown as below: + \arg SDIO_WAITTYPE_NO: not wait interrupt + \arg SDIO_WAITTYPE_INTERRUPT: wait interrupt + \arg SDIO_WAITTYPE_DATAEND: wait the end of data transfer + \param[out] none + \retval none +*/ +void sdio_wait_type_set(uint32_t wait_type) +{ + /* reset INTWAIT and WAITDEND */ + SDIO_CMDCTL &= ~(SDIO_CMDCTL_INTWAIT | SDIO_CMDCTL_WAITDEND); + /* set the wait type according to wait_type */ + SDIO_CMDCTL |= wait_type; +} + +/*! + \brief enable the CSM(command state machine) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_csm_enable(void) +{ + SDIO_CMDCTL |= SDIO_CMDCTL_CSMEN; +} + +/*! + \brief disable the CSM(command state machine) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_csm_disable(void) +{ + SDIO_CMDCTL &= ~SDIO_CMDCTL_CSMEN; +} + +/*! + \brief get the last response command index + \param[in] none + \param[out] none + \retval last response command index +*/ +uint8_t sdio_command_index_get(void) +{ + return (uint8_t)SDIO_RSPCMDIDX; +} + +/*! + \brief get the response for the last received command + \param[in] responsex: SDIO response + only one parameter can be selected which is shown as below: + \arg SDIO_RESPONSE0: card response[31:0]/card response[127:96] + \arg SDIO_RESPONSE1: card response[95:64] + \arg SDIO_RESPONSE2: card response[63:32] + \arg SDIO_RESPONSE3: card response[31:1], plus bit 0 + \param[out] none + \retval response for the last received command +*/ +uint32_t sdio_response_get(uint32_t responsex) +{ + uint32_t resp_content = 0U; + switch(responsex){ + case SDIO_RESPONSE0: + resp_content = SDIO_RESP0; + break; + case SDIO_RESPONSE1: + resp_content = SDIO_RESP1; + break; + case SDIO_RESPONSE2: + resp_content = SDIO_RESP2; + break; + case SDIO_RESPONSE3: + resp_content = SDIO_RESP3; + break; + default: + break; + } + return resp_content; +} + +/*! + \brief configure the data timeout, data length and data block size + \param[in] data_timeout: data timeout period in card bus clock periods + \param[in] data_length: number of data bytes to be transferred + \param[in] data_blocksize: size of data block for block transfer + only one parameter can be selected which is shown as below: + \arg SDIO_DATABLOCKSIZE_1BYTE: block size = 1 byte + \arg SDIO_DATABLOCKSIZE_2BYTES: block size = 2 bytes + \arg SDIO_DATABLOCKSIZE_4BYTES: block size = 4 bytes + \arg SDIO_DATABLOCKSIZE_8BYTES: block size = 8 bytes + \arg SDIO_DATABLOCKSIZE_16BYTES: block size = 16 bytes + \arg SDIO_DATABLOCKSIZE_32BYTES: block size = 32 bytes + \arg SDIO_DATABLOCKSIZE_64BYTES: block size = 64 bytes + \arg SDIO_DATABLOCKSIZE_128BYTES: block size = 128 bytes + \arg SDIO_DATABLOCKSIZE_256BYTES: block size = 256 bytes + \arg SDIO_DATABLOCKSIZE_512BYTES: block size = 512 bytes + \arg SDIO_DATABLOCKSIZE_1024BYTES: block size = 1024 bytes + \arg SDIO_DATABLOCKSIZE_2048BYTES: block size = 2048 bytes + \arg SDIO_DATABLOCKSIZE_4096BYTES: block size = 4096 bytes + \arg SDIO_DATABLOCKSIZE_8192BYTES: block size = 8192 bytes + \arg SDIO_DATABLOCKSIZE_16384BYTES: block size = 16384 bytes + \param[out] none + \retval none +*/ +void sdio_data_config(uint32_t data_timeout, uint32_t data_length, uint32_t data_blocksize) +{ + /* reset data timeout, data length and data block size */ + SDIO_DATATO &= ~SDIO_DATATO_DATATO; + SDIO_DATALEN &= ~SDIO_DATALEN_DATALEN; + SDIO_DATACTL &= ~SDIO_DATACTL_BLKSZ; + /* configure the related parameters of data */ + SDIO_DATATO = data_timeout; + SDIO_DATALEN = data_length; + SDIO_DATACTL |= data_blocksize; +} + +/*! + \brief configure the data transfer mode and direction + \param[in] transfer_mode: mode of data transfer + only one parameter can be selected which is shown as below: + \arg SDIO_TRANSMODE_BLOCK: block transfer + \arg SDIO_TRANSMODE_STREAM: stream transfer or SDIO multibyte transfer + \param[in] transfer_direction: data transfer direction, read or write + only one parameter can be selected which is shown as below: + \arg SDIO_TRANSDIRECTION_TOCARD: write data to card + \arg SDIO_TRANSDIRECTION_TOSDIO: read data from card + \param[out] none + \retval none +*/ +void sdio_data_transfer_config(uint32_t transfer_mode, uint32_t transfer_direction) +{ + uint32_t data_trans = 0U; + /* reset the data transfer mode, transfer direction and set according to the parameters */ + data_trans = SDIO_DATACTL; + data_trans &= ~(SDIO_DATACTL_TRANSMOD | SDIO_DATACTL_DATADIR); + data_trans |= (transfer_mode | transfer_direction); + SDIO_DATACTL = data_trans; +} + +/*! + \brief enable the DSM(data state machine) for data transfer + \param[in] none + \param[out] none + \retval none +*/ +void sdio_dsm_enable(void) +{ + SDIO_DATACTL |= SDIO_DATACTL_DATAEN; +} + +/*! + \brief disable the DSM(data state machine) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_dsm_disable(void) +{ + SDIO_DATACTL &= ~SDIO_DATACTL_DATAEN; +} + +/*! + \brief write data(one word) to the transmit FIFO + \param[in] data: 32-bit data write to card + \param[out] none + \retval none +*/ +void sdio_data_write(uint32_t data) +{ + SDIO_FIFO = data; +} + +/*! + \brief read data(one word) from the receive FIFO + \param[in] none + \param[out] none + \retval received data +*/ +uint32_t sdio_data_read(void) +{ + return SDIO_FIFO; +} + +/*! + \brief get the number of remaining data bytes to be transferred to card + \param[in] none + \param[out] none + \retval number of remaining data bytes to be transferred +*/ +uint32_t sdio_data_counter_get(void) +{ + return SDIO_DATACNT; +} + +/*! + \brief get the number of words remaining to be written or read from FIFO + \param[in] none + \param[out] none + \retval remaining number of words +*/ +uint32_t sdio_fifo_counter_get(void) +{ + return SDIO_FIFOCNT; +} + +/*! + \brief enable the DMA request for SDIO + \param[in] none + \param[out] none + \retval none +*/ +void sdio_dma_enable(void) +{ + SDIO_DATACTL |= SDIO_DATACTL_DMAEN; +} + +/*! + \brief disable the DMA request for SDIO + \param[in] none + \param[out] none + \retval none +*/ +void sdio_dma_disable(void) +{ + SDIO_DATACTL &= ~SDIO_DATACTL_DMAEN; +} + +/*! + \brief get the flags state of SDIO + \param[in] flag: flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_FLAG_CCRCERR: command response received (CRC check failed) flag + \arg SDIO_FLAG_DTCRCERR: data block sent/received (CRC check failed) flag + \arg SDIO_FLAG_CMDTMOUT: command response timeout flag + \arg SDIO_FLAG_DTTMOUT: data timeout flag + \arg SDIO_FLAG_TXURE: transmit FIFO underrun error occurs flag + \arg SDIO_FLAG_RXORE: received FIFO overrun error occurs flag + \arg SDIO_FLAG_CMDRECV: command response received (CRC check passed) flag + \arg SDIO_FLAG_CMDSEND: command sent (no response required) flag + \arg SDIO_FLAG_DTEND: data end (data counter, SDIO_DATACNT, is zero) flag + \arg SDIO_FLAG_STBITE: start bit error in the bus flag + \arg SDIO_FLAG_DTBLKEND: data block sent/received (CRC check passed) flag + \arg SDIO_FLAG_CMDRUN: command transmission in progress flag + \arg SDIO_FLAG_TXRUN: data transmission in progress flag + \arg SDIO_FLAG_RXRUN: data reception in progress flag + \arg SDIO_FLAG_TFH: transmit FIFO is half empty flag: at least 8 words can be written into the FIFO + \arg SDIO_FLAG_RFH: receive FIFO is half full flag: at least 8 words can be read in the FIFO + \arg SDIO_FLAG_TFF: transmit FIFO is full flag + \arg SDIO_FLAG_RFF: receive FIFO is full flag + \arg SDIO_FLAG_TFE: transmit FIFO is empty flag + \arg SDIO_FLAG_RFE: receive FIFO is empty flag + \arg SDIO_FLAG_TXDTVAL: data is valid in transmit FIFO flag + \arg SDIO_FLAG_RXDTVAL: data is valid in receive FIFO flag + \arg SDIO_FLAG_SDIOINT: SD I/O interrupt received flag + \arg SDIO_FLAG_ATAEND: CE-ATA command completion signal received (only for CMD61) flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus sdio_flag_get(uint32_t flag) +{ + FlagStatus temp_flag = RESET; + if(RESET != (SDIO_STAT & flag)){ + temp_flag = SET; + } + return temp_flag; +} + +/*! + \brief clear the pending flags of SDIO + \param[in] flag: flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_FLAG_CCRCERR: command response received (CRC check failed) flag + \arg SDIO_FLAG_DTCRCERR: data block sent/received (CRC check failed) flag + \arg SDIO_FLAG_CMDTMOUT: command response timeout flag + \arg SDIO_FLAG_DTTMOUT: data timeout flag + \arg SDIO_FLAG_TXURE: transmit FIFO underrun error occurs flag + \arg SDIO_FLAG_RXORE: received FIFO overrun error occurs flag + \arg SDIO_FLAG_CMDRECV: command response received (CRC check passed) flag + \arg SDIO_FLAG_CMDSEND: command sent (no response required) flag + \arg SDIO_FLAG_DTEND: data end (data counter, SDIO_DATACNT, is zero) flag + \arg SDIO_FLAG_STBITE: start bit error in the bus flag + \arg SDIO_FLAG_DTBLKEND: data block sent/received (CRC check passed) flag + \arg SDIO_FLAG_SDIOINT: SD I/O interrupt received flag + \arg SDIO_FLAG_ATAEND: CE-ATA command completion signal received (only for CMD61) flag + \param[out] none + \retval none +*/ +void sdio_flag_clear(uint32_t flag) +{ + SDIO_INTC = flag; +} + +/*! + \brief enable the SDIO interrupt + \param[in] int_flag: interrupt flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_INT_CCRCERR: SDIO CCRCERR interrupt + \arg SDIO_INT_DTCRCERR: SDIO DTCRCERR interrupt + \arg SDIO_INT_CMDTMOUT: SDIO CMDTMOUT interrupt + \arg SDIO_INT_DTTMOUT: SDIO DTTMOUT interrupt + \arg SDIO_INT_TXURE: SDIO TXURE interrupt + \arg SDIO_INT_RXORE: SDIO RXORE interrupt + \arg SDIO_INT_CMDRECV: SDIO CMDRECV interrupt + \arg SDIO_INT_CMDSEND: SDIO CMDSEND interrupt + \arg SDIO_INT_DTEND: SDIO DTEND interrupt + \arg SDIO_INT_STBITE: SDIO STBITE interrupt + \arg SDIO_INT_DTBLKEND: SDIO DTBLKEND interrupt + \arg SDIO_INT_CMDRUN: SDIO CMDRUN interrupt + \arg SDIO_INT_TXRUN: SDIO TXRUN interrupt + \arg SDIO_INT_RXRUN: SDIO RXRUN interrupt + \arg SDIO_INT_TFH: SDIO TFH interrupt + \arg SDIO_INT_RFH: SDIO RFH interrupt + \arg SDIO_INT_TFF: SDIO TFF interrupt + \arg SDIO_INT_RFF: SDIO RFF interrupt + \arg SDIO_INT_TFE: SDIO TFE interrupt + \arg SDIO_INT_RFE: SDIO RFE interrupt + \arg SDIO_INT_TXDTVAL: SDIO TXDTVAL interrupt + \arg SDIO_INT_RXDTVAL: SDIO RXDTVAL interrupt + \arg SDIO_INT_SDIOINT: SDIO SDIOINT interrupt + \arg SDIO_INT_ATAEND: SDIO ATAEND interrupt + \param[out] none + \retval none +*/ +void sdio_interrupt_enable(uint32_t int_flag) +{ + SDIO_INTEN |= int_flag; +} + +/*! + \brief disable the SDIO interrupt + \param[in] int_flag: interrupt flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_INT_CCRCERR: SDIO CCRCERR interrupt + \arg SDIO_INT_DTCRCERR: SDIO DTCRCERR interrupt + \arg SDIO_INT_CMDTMOUT: SDIO CMDTMOUT interrupt + \arg SDIO_INT_DTTMOUT: SDIO DTTMOUT interrupt + \arg SDIO_INT_TXURE: SDIO TXURE interrupt + \arg SDIO_INT_RXORE: SDIO RXORE interrupt + \arg SDIO_INT_CMDRECV: SDIO CMDRECV interrupt + \arg SDIO_INT_CMDSEND: SDIO CMDSEND interrupt + \arg SDIO_INT_DTEND: SDIO DTEND interrupt + \arg SDIO_INT_STBITE: SDIO STBITE interrupt + \arg SDIO_INT_DTBLKEND: SDIO DTBLKEND interrupt + \arg SDIO_INT_CMDRUN: SDIO CMDRUN interrupt + \arg SDIO_INT_TXRUN: SDIO TXRUN interrupt + \arg SDIO_INT_RXRUN: SDIO RXRUN interrupt + \arg SDIO_INT_TFH: SDIO TFH interrupt + \arg SDIO_INT_RFH: SDIO RFH interrupt + \arg SDIO_INT_TFF: SDIO TFF interrupt + \arg SDIO_INT_RFF: SDIO RFF interrupt + \arg SDIO_INT_TFE: SDIO TFE interrupt + \arg SDIO_INT_RFE: SDIO RFE interrupt + \arg SDIO_INT_TXDTVAL: SDIO TXDTVAL interrupt + \arg SDIO_INT_RXDTVAL: SDIO RXDTVAL interrupt + \arg SDIO_INT_SDIOINT: SDIO SDIOINT interrupt + \arg SDIO_INT_ATAEND: SDIO ATAEND interrupt + \param[out] none + \retval none +*/ +void sdio_interrupt_disable(uint32_t int_flag) +{ + SDIO_INTEN &= ~int_flag; +} + +/*! + \brief get the interrupt flags state of SDIO + \param[in] int_flag: interrupt flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_INT_FLAG_CCRCERR: SDIO CCRCERR interrupt flag + \arg SDIO_INT_FLAG_DTCRCERR: SDIO DTCRCERR interrupt flag + \arg SDIO_INT_FLAG_CMDTMOUT: SDIO CMDTMOUT interrupt flag + \arg SDIO_INT_FLAG_DTTMOUT: SDIO DTTMOUT interrupt flag + \arg SDIO_INT_FLAG_TXURE: SDIO TXURE interrupt flag + \arg SDIO_INT_FLAG_RXORE: SDIO RXORE interrupt flag + \arg SDIO_INT_FLAG_CMDRECV: SDIO CMDRECV interrupt flag + \arg SDIO_INT_FLAG_CMDSEND: SDIO CMDSEND interrupt flag + \arg SDIO_INT_FLAG_DTEND: SDIO DTEND interrupt flag + \arg SDIO_INT_FLAG_STBITE: SDIO STBITE interrupt flag + \arg SDIO_INT_FLAG_DTBLKEND: SDIO DTBLKEND interrupt flag + \arg SDIO_INT_FLAG_CMDRUN: SDIO CMDRUN interrupt flag + \arg SDIO_INT_FLAG_TXRUN: SDIO TXRUN interrupt flag + \arg SDIO_INT_FLAG_RXRUN: SDIO RXRUN interrupt flag + \arg SDIO_INT_FLAG_TFH: SDIO TFH interrupt flag + \arg SDIO_INT_FLAG_RFH: SDIO RFH interrupt flag + \arg SDIO_INT_FLAG_TFF: SDIO TFF interrupt flag + \arg SDIO_INT_FLAG_RFF: SDIO RFF interrupt flag + \arg SDIO_INT_FLAG_TFE: SDIO TFE interrupt flag + \arg SDIO_INT_FLAG_RFE: SDIO RFE interrupt flag + \arg SDIO_INT_FLAG_TXDTVAL: SDIO TXDTVAL interrupt flag + \arg SDIO_INT_FLAG_RXDTVAL: SDIO RXDTVAL interrupt flag + \arg SDIO_INT_FLAG_SDIOINT: SDIO SDIOINT interrupt flag + \arg SDIO_INT_FLAG_ATAEND: SDIO ATAEND interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus sdio_interrupt_flag_get(uint32_t int_flag) +{ + if(RESET != (SDIO_STAT & int_flag)){ + return SET; + } + return RESET; +} + +/*! + \brief clear the interrupt pending flags of SDIO + \param[in] int_flag: interrupt flags state of SDIO + one or more parameters can be selected which are shown as below: + \arg SDIO_INT_FLAG_CCRCERR: command response received (CRC check failed) flag + \arg SDIO_INT_FLAG_DTCRCERR: data block sent/received (CRC check failed) flag + \arg SDIO_INT_FLAG_CMDTMOUT: command response timeout flag + \arg SDIO_INT_FLAG_DTTMOUT: data timeout flag + \arg SDIO_INT_FLAG_TXURE: transmit FIFO underrun error occurs flag + \arg SDIO_INT_FLAG_RXORE: received FIFO overrun error occurs flag + \arg SDIO_INT_FLAG_CMDRECV: command response received (CRC check passed) flag + \arg SDIO_INT_FLAG_CMDSEND: command sent (no response required) flag + \arg SDIO_INT_FLAG_DTEND: data end (data counter, SDIO_DATACNT, is zero) flag + \arg SDIO_INT_FLAG_STBITE: start bit error in the bus flag + \arg SDIO_INT_FLAG_DTBLKEND: data block sent/received (CRC check passed) flag + \arg SDIO_INT_FLAG_SDIOINT: SD I/O interrupt received flag + \arg SDIO_INT_FLAG_ATAEND: CE-ATA command completion signal received (only for CMD61) flag + \param[out] none + \retval none +*/ +void sdio_interrupt_flag_clear(uint32_t int_flag) +{ + SDIO_INTC = int_flag; +} + +/*! + \brief enable the read wait mode(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_readwait_enable(void) +{ + SDIO_DATACTL |= SDIO_DATACTL_RWEN; +} + +/*! + \brief disable the read wait mode(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_readwait_disable(void) +{ + SDIO_DATACTL &= ~SDIO_DATACTL_RWEN; +} + +/*! + \brief enable the function that stop the read wait process(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_stop_readwait_enable(void) +{ + SDIO_DATACTL |= SDIO_DATACTL_RWSTOP; +} + +/*! + \brief disable the function that stop the read wait process(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_stop_readwait_disable(void) +{ + SDIO_DATACTL &= ~SDIO_DATACTL_RWSTOP; +} + +/*! + \brief set the read wait type(SD I/O only) + \param[in] readwait_type: SD I/O read wait type + only one parameter can be selected which is shown as below: + \arg SDIO_READWAITTYPE_CLK: read wait control by stopping SDIO_CLK + \arg SDIO_READWAITTYPE_DAT2: read wait control using SDIO_DAT[2] + \param[out] none + \retval none +*/ +void sdio_readwait_type_set(uint32_t readwait_type) +{ + if(SDIO_READWAITTYPE_CLK == readwait_type){ + SDIO_DATACTL |= SDIO_DATACTL_RWTYPE; + }else{ + SDIO_DATACTL &= ~SDIO_DATACTL_RWTYPE; + } +} + +/*! + \brief enable the SD I/O mode specific operation(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_operation_enable(void) +{ + SDIO_DATACTL |= SDIO_DATACTL_IOEN; +} + +/*! + \brief disable the SD I/O mode specific operation(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_operation_disable(void) +{ + SDIO_DATACTL &= ~SDIO_DATACTL_IOEN; +} + +/*! + \brief enable the SD I/O suspend operation(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_suspend_enable(void) +{ + SDIO_CMDCTL |= SDIO_CMDCTL_SUSPEND; +} + +/*! + \brief disable the SD I/O suspend operation(SD I/O only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_suspend_disable(void) +{ + SDIO_CMDCTL &= ~SDIO_CMDCTL_SUSPEND; +} + +/*! + \brief enable the CE-ATA command(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_command_enable(void) +{ + SDIO_CMDCTL |= SDIO_CMDCTL_ATAEN; +} + +/*! + \brief disable the CE-ATA command(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_command_disable(void) +{ + SDIO_CMDCTL &= ~SDIO_CMDCTL_ATAEN; +} + +/*! + \brief enable the CE-ATA interrupt(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_interrupt_enable(void) +{ + SDIO_CMDCTL &= ~SDIO_CMDCTL_NINTEN; +} + +/*! + \brief disable the CE-ATA interrupt(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_interrupt_disable(void) +{ + SDIO_CMDCTL |= SDIO_CMDCTL_NINTEN; +} + +/*! + \brief enable the CE-ATA command completion signal(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_command_completion_enable(void) +{ + SDIO_CMDCTL |= SDIO_CMDCTL_ENCMDC; +} + +/*! + \brief disable the CE-ATA command completion signal(CE-ATA only) + \param[in] none + \param[out] none + \retval none +*/ +void sdio_ceata_command_completion_disable(void) +{ + SDIO_CMDCTL &= ~SDIO_CMDCTL_ENCMDC; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_spi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_spi.c new file mode 100644 index 0000000..fbb63a6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_spi.c @@ -0,0 +1,687 @@ +/*! + \file gd32f10x_spi.c + \brief SPI driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_spi.h" + +/* SPI/I2S parameter initialization mask */ +#define SPI_INIT_MASK ((uint32_t)0x00003040U) /*!< SPI parameter initialization mask */ +#define I2S_INIT_MASK ((uint32_t)0x0000F047U) /*!< I2S parameter initialization mask */ + +/* I2S clock source selection, multiplication and division mask */ +#define I2S1_CLOCK_SEL ((uint32_t)0x00020000U) /* I2S1 clock source selection */ +#define I2S2_CLOCK_SEL ((uint32_t)0x00040000U) /* I2S2 clock source selection */ +#define I2S_CLOCK_MUL_MASK ((uint32_t)0x0000F000U) /* I2S clock multiplication mask */ +#define I2S_CLOCK_DIV_MASK ((uint32_t)0x000000F0U) /* I2S clock division mask */ + +/* reset value and offset */ +#define SPI_I2SPSC_RESET ((uint32_t)0x00000002U) /*!< I2S clock prescaler register reset value */ +#define RCU_CFG1_PREDV1_OFFSET 4U /* PREDV1 offset in RCU_CFG1 */ +#define RCU_CFG1_PLL2MF_OFFSET 12U /* PLL2MF offset in RCU_CFG1 */ + +/*! + \brief reset SPI and I2S + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_i2s_deinit(uint32_t spi_periph) +{ + switch(spi_periph) { + case SPI0: + /* reset SPI0 */ + rcu_periph_reset_enable(RCU_SPI0RST); + rcu_periph_reset_disable(RCU_SPI0RST); + break; + case SPI1: + /* reset SPI1 and I2S1 */ + rcu_periph_reset_enable(RCU_SPI1RST); + rcu_periph_reset_disable(RCU_SPI1RST); + break; + case SPI2: + /* reset SPI2 and I2S2 */ + rcu_periph_reset_enable(RCU_SPI2RST); + rcu_periph_reset_disable(RCU_SPI2RST); + break; + default : + break; + } +} + +/*! + \brief initialize the parameters of SPI structure with the default values + \param[in] none + \param[out] spi_parameter_struct: the initialized structure spi_parameter_struct pointer + \retval none +*/ +void spi_struct_para_init(spi_parameter_struct *spi_struct) +{ + /* configure the SPI structure with the default values */ + spi_struct->device_mode = SPI_SLAVE; + spi_struct->trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_struct->frame_size = SPI_FRAMESIZE_8BIT; + spi_struct->nss = SPI_NSS_HARD; + spi_struct->endian = SPI_ENDIAN_MSB; + spi_struct->clock_polarity_phase = SPI_CK_PL_LOW_PH_1EDGE; + spi_struct->prescale = SPI_PSC_2; +} + +/*! + \brief initialize SPI parameters + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] spi_struct: SPI parameter initialization stuct members of the structure + and the member values are shown as below: + device_mode: SPI_MASTER, SPI_SLAVE + trans_mode: SPI_TRANSMODE_FULLDUPLEX, SPI_TRANSMODE_RECEIVEONLY, + SPI_TRANSMODE_BDRECEIVE, SPI_TRANSMODE_BDTRANSMIT + frame_size: SPI_FRAMESIZE_16BIT, SPI_FRAMESIZE_8BIT + nss: SPI_NSS_SOFT, SPI_NSS_HARD + endian: SPI_ENDIAN_MSB, SPI_ENDIAN_LSB + clock_polarity_phase: SPI_CK_PL_LOW_PH_1EDGE, SPI_CK_PL_HIGH_PH_1EDGE + SPI_CK_PL_LOW_PH_2EDGE, SPI_CK_PL_HIGH_PH_2EDGE + prescale: SPI_PSC_n (n=2,4,8,16,32,64,128,256) + \param[out] none + \retval none +*/ +void spi_init(uint32_t spi_periph, spi_parameter_struct *spi_struct) +{ + uint32_t reg = 0U; + reg = SPI_CTL0(spi_periph); + reg &= SPI_INIT_MASK; + + /* select SPI as master or slave */ + reg |= spi_struct->device_mode; + /* select SPI transfer mode */ + reg |= spi_struct->trans_mode; + /* select SPI frame size */ + reg |= spi_struct->frame_size; + /* select SPI NSS use hardware or software */ + reg |= spi_struct->nss; + /* select SPI LSB or MSB */ + reg |= spi_struct->endian; + /* select SPI polarity and phase */ + reg |= spi_struct->clock_polarity_phase; + /* select SPI prescale to adjust transmit speed */ + reg |= spi_struct->prescale; + + /* write to SPI_CTL0 register */ + SPI_CTL0(spi_periph) = (uint32_t)reg; + + /* select SPI mode */ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SSEL); +} + +/*! + \brief enable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_enable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SPIEN; +} + +/*! + \brief disable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_disable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SPIEN); +} + +/*! + \brief initialize I2S parameter + \param[in] spi_periph: SPIx(x=1,2) + \param[in] mode: I2S operation mode + only one parameter can be selected which is shown as below: + \arg I2S_MODE_SLAVETX: I2S slave transmit mode + \arg I2S_MODE_SLAVERX: I2S slave receive mode + \arg I2S_MODE_MASTERTX: I2S master transmit mode + \arg I2S_MODE_MASTERRX: I2S master receive mode + \param[in] standard: I2S standard + only one parameter can be selected which is shown as below: + \arg I2S_STD_PHILLIPS: I2S phillips standard + \arg I2S_STD_MSB: I2S MSB standard + \arg I2S_STD_LSB: I2S LSB standard + \arg I2S_STD_PCMSHORT: I2S PCM short standard + \arg I2S_STD_PCMLONG: I2S PCM long standard + \param[in] ckpl: I2S idle state clock polarity + only one parameter can be selected which is shown as below: + \arg I2S_CKPL_LOW: I2S clock polarity low level + \arg I2S_CKPL_HIGH: I2S clock polarity high level + \param[out] none + \retval none +*/ +void i2s_init(uint32_t spi_periph, uint32_t mode, uint32_t standard, uint32_t ckpl) +{ + uint32_t reg = 0U; + reg = SPI_I2SCTL(spi_periph); + reg &= I2S_INIT_MASK; + + /* enable I2S mode */ + reg |= (uint32_t)SPI_I2SCTL_I2SSEL; + /* select I2S mode */ + reg |= (uint32_t)mode; + /* select I2S standard */ + reg |= (uint32_t)standard; + /* select I2S polarity */ + reg |= (uint32_t)ckpl; + + /* write to SPI_I2SCTL register */ + SPI_I2SCTL(spi_periph) = (uint32_t)reg; +} + +/*! + \brief configure I2S prescaler + \param[in] spi_periph: SPIx(x=1,2) + \param[in] audiosample: I2S audio sample rate + only one parameter can be selected which is shown as below: + \arg I2S_AUDIOSAMPLE_8K: audio sample rate is 8KHz + \arg I2S_AUDIOSAMPLE_11K: audio sample rate is 11KHz + \arg I2S_AUDIOSAMPLE_16K: audio sample rate is 16KHz + \arg I2S_AUDIOSAMPLE_22K: audio sample rate is 22KHz + \arg I2S_AUDIOSAMPLE_32K: audio sample rate is 32KHz + \arg I2S_AUDIOSAMPLE_44K: audio sample rate is 44KHz + \arg I2S_AUDIOSAMPLE_48K: audio sample rate is 48KHz + \arg I2S_AUDIOSAMPLE_96K: audio sample rate is 96KHz + \arg I2S_AUDIOSAMPLE_192K: audio sample rate is 192KHz + \param[in] frameformat: I2S data length and channel length + only one parameter can be selected which is shown as below: + \arg I2S_FRAMEFORMAT_DT16B_CH16B: I2S data length is 16 bit and channel length is 16 bit + \arg I2S_FRAMEFORMAT_DT16B_CH32B: I2S data length is 16 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT24B_CH32B: I2S data length is 24 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT32B_CH32B: I2S data length is 32 bit and channel length is 32 bit + \param[in] mckout: I2S master clock output + only one parameter can be selected which is shown as below: + \arg I2S_MCKOUT_ENABLE: enable I2S master clock output + \arg I2S_MCKOUT_DISABLE: disable 2S master clock output + \param[out] none + \retval none +*/ +void i2s_psc_config(uint32_t spi_periph, uint32_t audiosample, uint32_t frameformat, uint32_t mckout) +{ + uint32_t i2sdiv = 2U, i2sof = 0U; + uint32_t clks = 0U; + uint32_t i2sclock = 0U; + + /* deinitialize SPI_I2SPSC register */ + SPI_I2SPSC(spi_periph) = SPI_I2SPSC_RESET; + +#ifdef GD32F10X_CL + /* get the I2S clock source */ + if(SPI1 == ((uint32_t)spi_periph)) { + /* I2S1 clock source selection */ + clks = I2S1_CLOCK_SEL; + } else { + /* I2S2 clock source selection */ + clks = I2S2_CLOCK_SEL; + } + + if(0U != (RCU_CFG1 & clks)) { + /* get RCU PLL2 clock multiplication factor */ + clks = (uint32_t)((RCU_CFG1 & I2S_CLOCK_MUL_MASK) >> RCU_CFG1_PLL2MF_OFFSET); + + if((clks > 5U) && (clks < 15U)) { + /* multiplier is between 8 and 14 */ + clks += 2U; + } else { + if(15U == clks) { + /* multiplier is 20 */ + clks = 20U; + } + } + + /* get the PREDV1 value */ + i2sclock = (uint32_t)(((RCU_CFG1 & I2S_CLOCK_DIV_MASK) >> RCU_CFG1_PREDV1_OFFSET) + 1U); + /* calculate I2S clock based on PLL2 and PREDV1 */ + i2sclock = (uint32_t)((HXTAL_VALUE / i2sclock) * clks * 2U); + } else { + /* get system clock */ + i2sclock = rcu_clock_freq_get(CK_SYS); + } +#else + /* get system clock */ + i2sclock = rcu_clock_freq_get(CK_SYS); +#endif /* GD32F10X_CL */ + + /* configure the prescaler depending on the mclk output state, the frame format and audio sample rate */ + if(I2S_MCKOUT_ENABLE == mckout) { + clks = (uint32_t)(((i2sclock / 256U) * 10U) / audiosample); + } else { + if(I2S_FRAMEFORMAT_DT16B_CH16B == frameformat) { + clks = (uint32_t)(((i2sclock / 32U) * 10U) / audiosample); + } else { + clks = (uint32_t)(((i2sclock / 64U) * 10U) / audiosample); + } + } + + /* remove the floating point */ + clks = (clks + 5U) / 10U; + i2sof = (clks & 0x00000001U); + i2sdiv = ((clks - i2sof) / 2U); + i2sof = (i2sof << 8U); + + /* set the default values */ + if((i2sdiv < 2U) || (i2sdiv > 255U)) { + i2sdiv = 2U; + i2sof = 0U; + } + + /* configure SPI_I2SPSC */ + SPI_I2SPSC(spi_periph) = (uint32_t)(i2sdiv | i2sof | mckout); + + /* clear SPI_I2SCTL_DTLEN and SPI_I2SCTL_CHLEN bits */ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~(SPI_I2SCTL_DTLEN | SPI_I2SCTL_CHLEN)); + /* configure data frame format */ + SPI_I2SCTL(spi_periph) |= (uint32_t)frameformat; +} + +/*! + \brief enable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_enable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) |= (uint32_t)SPI_I2SCTL_I2SEN; +} + +/*! + \brief disable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_disable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SEN); +} + +/*! + \brief enable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_NSSDRV; +} + +/*! + \brief disable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_NSSDRV); +} + +/*! + \brief SPI NSS pin high level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_high(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SWNSS; +} + +/*! + \brief SPI NSS pin low level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_low(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SWNSS); +} + +/*! + \brief enable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_enable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma) { + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMATEN; + } else { + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMAREN; + } +} + +/*! + \brief disable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_disable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma) { + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMATEN); + } else { + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMAREN); + } +} + +/*! + \brief configure SPI data frame format + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] frame_format: SPI frame size + only one parameter can be selected which is shown as below: + \arg SPI_FRAMESIZE_16BIT: SPI frame size is 16 bits + \arg SPI_FRAMESIZE_8BIT: SPI frame size is 8 bits + \param[out] none + \retval none +*/ +void spi_i2s_data_frame_format_config(uint32_t spi_periph, uint16_t frame_format) +{ + /* clear SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_FF16); + /* configure SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) |= (uint32_t)frame_format; +} + +/*! + \brief configure SPI bidirectional transfer direction + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] transfer_direction: SPI transfer direction + only one parameter can be selected which is shown as below: + \arg SPI_BIDIRECTIONAL_TRANSMIT: SPI work in transmit-only mode + \arg SPI_BIDIRECTIONAL_RECEIVE: SPI work in receive-only mode + \param[out] none + \retval none +*/ +void spi_bidirectional_transfer_config(uint32_t spi_periph, uint32_t transfer_direction) +{ + if(SPI_BIDIRECTIONAL_TRANSMIT == transfer_direction) { + /* set the transmit only mode */ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_BIDIRECTIONAL_TRANSMIT; + } else { + /* set the receive only mode */ + SPI_CTL0(spi_periph) &= SPI_BIDIRECTIONAL_RECEIVE; + } +} + +/*! + \brief SPI transmit data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] data: 16-bit data + \param[out] none + \retval none +*/ +void spi_i2s_data_transmit(uint32_t spi_periph, uint16_t data) +{ + SPI_DATA(spi_periph) = (uint32_t)data; +} + +/*! + \brief SPI receive data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit data +*/ +uint16_t spi_i2s_data_receive(uint32_t spi_periph) +{ + return ((uint16_t)SPI_DATA(spi_periph)); +} + +/*! + \brief set SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc_poly: CRC polynomial value + \param[out] none + \retval none +*/ +void spi_crc_polynomial_set(uint32_t spi_periph, uint16_t crc_poly) +{ + /* enable SPI CRC */ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCEN; + /* set SPI CRC polynomial */ + SPI_CRCPOLY(spi_periph) = (uint32_t)crc_poly; +} + +/*! + \brief get SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit CRC polynomial +*/ +uint16_t spi_crc_polynomial_get(uint32_t spi_periph) +{ + return ((uint16_t)SPI_CRCPOLY(spi_periph)); +} + +/*! + \brief turn on SPI CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_on(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCEN; +} + +/*! + \brief turn off SPI CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_off(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_CRCEN); +} + +/*! + \brief SPI next data is CRC value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_next(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCNT; +} + +/*! + \brief get SPI CRC send value or receive value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc: SPI crc value + only one parameter can be selected which is shown as below: + \arg SPI_CRC_TX: get transmit crc value + \arg SPI_CRC_RX: get receive crc value + \param[out] none + \retval 16-bit CRC value +*/ +uint16_t spi_crc_get(uint32_t spi_periph, uint8_t crc) +{ + if(SPI_CRC_TX == crc) { + return ((uint16_t)(SPI_TCRC(spi_periph))); + } else { + return ((uint16_t)(SPI_RCRC(spi_periph))); + } +} + +/*! + \brief clear SPI CRC error flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_error_clear(uint32_t spi_periph) +{ + SPI_STAT(spi_periph) = (uint32_t)(~SPI_FLAG_CRCERR); +} + +/*! + \brief get SPI and I2S flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] flag: SPI/I2S flag status + one or more parameters can be selected which are shown as below: + \arg SPI_FLAG_TBE: transmit buffer empty flag + \arg SPI_FLAG_RBNE: receive buffer not empty flag + \arg SPI_FLAG_TRANS: transmit on-going flag + \arg SPI_FLAG_RXORERR: receive overrun error flag + \arg SPI_FLAG_CONFERR: mode config error flag + \arg SPI_FLAG_CRCERR: CRC error flag + \arg I2S_FLAG_RXORERR: overrun error flag + \arg I2S_FLAG_TXURERR: underrun error flag + \arg I2S_FLAG_CH: channel side flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_flag_get(uint32_t spi_periph, uint32_t flag) +{ + if(RESET != (SPI_STAT(spi_periph) & flag)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief enable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error, configuration error, reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_enable(uint32_t spi_periph, uint8_t interrupt) +{ + SPI_CTL1(spi_periph) |= (uint32_t)interrupt; +} + +/*! + \brief disable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error, configuration error, reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_disable(uint32_t spi_periph, uint8_t interrupt) +{ + SPI_CTL1(spi_periph) &= ~(uint32_t)interrupt; +} + +/*! + \brief get SPI and I2S interrupt flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt flag status + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_FLAG_TBE: transmit buffer empty interrupt flag + \arg SPI_I2S_INT_FLAG_RBNE: receive buffer not empty interrupt flag + \arg SPI_I2S_INT_FLAG_RXORERR: overrun interrupt flag + \arg SPI_INT_FLAG_CONFERR: config error interrupt flag + \arg SPI_INT_FLAG_CRCERR: CRC error interrupt flag + \arg I2S_INT_FLAG_TXURERR: underrun error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_interrupt_flag_get(uint32_t spi_periph, uint8_t interrupt) +{ + uint32_t reg1 = SPI_STAT(spi_periph); + uint32_t reg2 = SPI_CTL1(spi_periph); + + switch(interrupt) { + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_FLAG_TBE: + reg1 = reg1 & SPI_STAT_TBE; + reg2 = reg2 & SPI_CTL1_TBEIE; + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_FLAG_RBNE: + reg1 = reg1 & SPI_STAT_RBNE; + reg2 = reg2 & SPI_CTL1_RBNEIE; + break; + /* SPI/I2S overrun interrupt */ + case SPI_I2S_INT_FLAG_RXORERR: + reg1 = reg1 & SPI_STAT_RXORERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI config error interrupt */ + case SPI_INT_FLAG_CONFERR: + reg1 = reg1 & SPI_STAT_CONFERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI CRC error interrupt */ + case SPI_INT_FLAG_CRCERR: + reg1 = reg1 & SPI_STAT_CRCERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* I2S underrun error interrupt */ + case I2S_INT_FLAG_TXURERR: + reg1 = reg1 & SPI_STAT_TXURERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + default : + break; + } + /*get SPI/I2S interrupt flag status */ + if((0U != reg1) && (0U != reg2)) { + return SET; + } else { + return RESET; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_timer.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_timer.c new file mode 100644 index 0000000..6456a6a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_timer.c @@ -0,0 +1,1999 @@ +/*! + \file gd32f10x_timer.c + \brief TIMER driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_timer.h" + +/* TIMER init parameter mask */ +#define ALIGNEDMODE_MASK ((uint32_t)0x00000060U) /*!< TIMER init parameter aligne dmode mask */ +#define COUNTERDIRECTION_MASK ((uint32_t)0x00000010U) /*!< TIMER init parameter counter direction mask */ +#define CLOCKDIVISION_MASK ((uint32_t)0x00000300U) /*!< TIMER init parameter clock division value mask */ + +/*! + \brief deinit a TIMER + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_deinit(uint32_t timer_periph) +{ + switch(timer_periph){ + case TIMER0: + /* reset TIMER0 */ + rcu_periph_reset_enable(RCU_TIMER0RST); + rcu_periph_reset_disable(RCU_TIMER0RST); + break; + case TIMER1: + /* reset TIMER1 */ + rcu_periph_reset_enable(RCU_TIMER1RST); + rcu_periph_reset_disable(RCU_TIMER1RST); + break; + case TIMER2: + /* reset TIMER2 */ + rcu_periph_reset_enable(RCU_TIMER2RST); + rcu_periph_reset_disable(RCU_TIMER2RST); + break; + case TIMER3: + /* reset TIMER3 */ + rcu_periph_reset_enable(RCU_TIMER3RST); + rcu_periph_reset_disable(RCU_TIMER3RST); + break; + case TIMER4: + /* reset TIMER4 */ + rcu_periph_reset_enable(RCU_TIMER4RST); + rcu_periph_reset_disable(RCU_TIMER4RST); + break; + case TIMER5: + /* reset TIMER5 */ + rcu_periph_reset_enable(RCU_TIMER5RST); + rcu_periph_reset_disable(RCU_TIMER5RST); + break; + case TIMER6: + /* reset TIMER6 */ + rcu_periph_reset_enable(RCU_TIMER6RST); + rcu_periph_reset_disable(RCU_TIMER6RST); + break; + case TIMER7: + /* reset TIMER7 */ + rcu_periph_reset_enable(RCU_TIMER7RST); + rcu_periph_reset_disable(RCU_TIMER7RST); + break; +#ifdef GD32F10X_XD + case TIMER8: + /* reset TIMER8 */ + rcu_periph_reset_enable(RCU_TIMER8RST); + rcu_periph_reset_disable(RCU_TIMER8RST); + break; + case TIMER9: + /* reset TIMER9 */ + rcu_periph_reset_enable(RCU_TIMER9RST); + rcu_periph_reset_disable(RCU_TIMER9RST); + break; + case TIMER10: + /* reset TIMER10 */ + rcu_periph_reset_enable(RCU_TIMER10RST); + rcu_periph_reset_disable(RCU_TIMER10RST); + break; + case TIMER11: + /* reset TIMER11 */ + rcu_periph_reset_enable(RCU_TIMER11RST); + rcu_periph_reset_disable(RCU_TIMER11RST); + break; + case TIMER12: + /* reset TIMER12 */ + rcu_periph_reset_enable(RCU_TIMER12RST); + rcu_periph_reset_disable(RCU_TIMER12RST); + break; + case TIMER13: + /* reset TIMER13 */ + rcu_periph_reset_enable(RCU_TIMER13RST); + rcu_periph_reset_disable(RCU_TIMER13RST); + break; +#endif /* GD32F10X_XD */ + default: + break; + } +} + +/*! + \brief initialize TIMER init parameter struct with a default value + \param[in] initpara: init parameter struct + \param[out] none + \retval none +*/ +void timer_struct_para_init(timer_parameter_struct* initpara) +{ + /* initialize the init parameter struct member with the default value */ + initpara->prescaler = 0U; + initpara->alignedmode = TIMER_COUNTER_EDGE; + initpara->counterdirection = TIMER_COUNTER_UP; + initpara->period = 65535U; + initpara->clockdivision = TIMER_CKDIV_DIV1; + initpara->repetitioncounter = 0U; +} + +/*! + \brief initialize TIMER counter + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] initpara: init parameter struct + prescaler: prescaler value of the counter clock,0~65535 + alignedmode: TIMER_COUNTER_EDGE,TIMER_COUNTER_CENTER_DOWN,TIMER_COUNTER_CENTER_UP, + TIMER_COUNTER_CENTER_BOTH + counterdirection: TIMER_COUNTER_UP,TIMER_COUNTER_DOWN + period: counter auto reload value,0~65535 + clockdivision: TIMER_CKDIV_DIV1,TIMER_CKDIV_DIV2,TIMER_CKDIV_DIV4 + repetitioncounter: counter repetition value,0~255 + \param[out] none + \retval none +*/ +void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara) +{ + /* configure the counter prescaler value */ + TIMER_PSC(timer_periph) = (uint16_t)initpara->prescaler; + + /* configure the counter direction and aligned mode */ + if((TIMER0 == timer_periph) || (TIMER1 == timer_periph) || (TIMER2 == timer_periph) || (TIMER3 == timer_periph) || + (TIMER4 == timer_periph) || (TIMER7 == timer_periph) || (TIMER8 == timer_periph) || (TIMER9 == timer_periph) || + (TIMER10 == timer_periph) || (TIMER11 == timer_periph) || (TIMER12 == timer_periph) || (TIMER13 == timer_periph)){ + TIMER_CTL0(timer_periph) &= (~(uint32_t)(TIMER_CTL0_DIR | TIMER_CTL0_CAM)); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->alignedmode & ALIGNEDMODE_MASK); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->counterdirection & COUNTERDIRECTION_MASK); + } + + /* configure the autoreload value */ + TIMER_CAR(timer_periph) = (uint32_t)initpara->period; + + if((TIMER5 != timer_periph) && (TIMER6 != timer_periph)){ + /* reset the CKDIV bit */ + TIMER_CTL0(timer_periph) &= (~(uint32_t)TIMER_CTL0_CKDIV); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->clockdivision & CLOCKDIVISION_MASK); + } + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* configure the repetition counter value */ + TIMER_CREP(timer_periph) = (uint32_t)initpara->repetitioncounter; + } + + /* generate an update event */ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; +} + +/*! + \brief enable a TIMER + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief disable a TIMER + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief enable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief disable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief enable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPDIS; +} + +/*! + \brief disable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t) TIMER_CTL0_UPDIS; +} + +/*! + \brief set TIMER counter alignment mode + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] aligned: + only one parameter can be selected which is shown as below: + \arg TIMER_COUNTER_EDGE: edge-aligned mode + \arg TIMER_COUNTER_CENTER_DOWN: center-aligned and counting down assert mode + \arg TIMER_COUNTER_CENTER_UP: center-aligned and counting up assert mode + \arg TIMER_COUNTER_CENTER_BOTH: center-aligned and counting up/down assert mode + \param[out] none + \retval none +*/ +void timer_counter_alignment(uint32_t timer_periph, uint16_t aligned) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_CAM; + TIMER_CTL0(timer_periph) |= (uint32_t)aligned; +} + +/*! + \brief set TIMER counter up direction + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[out] none + \retval none +*/ +void timer_counter_up_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief set TIMER counter down direction + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[out] none + \retval none +*/ +void timer_counter_down_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief configure TIMER prescaler + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] prescaler: prescaler value + \param[in] pscreload: prescaler reload mode + only one parameter can be selected which is shown as below: + \arg TIMER_PSC_RELOAD_NOW: the prescaler is loaded right now + \arg TIMER_PSC_RELOAD_UPDATE: the prescaler is loaded at the next update event + \param[out] none + \retval none +*/ +void timer_prescaler_config(uint32_t timer_periph, uint16_t prescaler, uint32_t pscreload) +{ + TIMER_PSC(timer_periph) = (uint32_t)prescaler; + + if(TIMER_PSC_RELOAD_NOW == pscreload){ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; + } +} + +/*! + \brief configure TIMER repetition register value + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] repetition: the counter repetition value,0~255 + \param[out] none + \retval none +*/ +void timer_repetition_value_config(uint32_t timer_periph, uint8_t repetition) +{ + TIMER_CREP(timer_periph) = (uint32_t)repetition; +} + +/*! + \brief configure TIMER autoreload register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] autoreload: the counter auto-reload value + \param[out] none + \retval none +*/ +void timer_autoreload_value_config(uint32_t timer_periph, uint32_t autoreload) +{ + TIMER_CAR(timer_periph) = (uint32_t)autoreload; +} + +/*! + \brief configure TIMER counter register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] counter: the counter value + \param[out] none + \retval none +*/ +void timer_counter_value_config(uint32_t timer_periph, uint32_t counter) +{ + TIMER_CNT(timer_periph) = (uint32_t)counter; +} + +/*! + \brief read TIMER counter value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval counter value +*/ +uint32_t timer_counter_read(uint32_t timer_periph) +{ + uint32_t count_value = 0U; + count_value = TIMER_CNT(timer_periph); + return (count_value); +} + +/*! + \brief read TIMER prescaler value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval prescaler register value +*/ +uint16_t timer_prescaler_read(uint32_t timer_periph) +{ + uint16_t prescaler_value = 0U; + prescaler_value = (uint16_t)(TIMER_PSC(timer_periph)); + return (prescaler_value); +} + +/*! + \brief configure TIMER single pulse mode + \param[in] timer_periph: TIMERx(x=0..8,11) + \param[in] spmode: + only one parameter can be selected which is shown as below: + \arg TIMER_SP_MODE_SINGLE: single pulse mode + \arg TIMER_SP_MODE_REPETITIVE: repetitive pulse mode + \param[out] none + \retval none +*/ +void timer_single_pulse_mode_config(uint32_t timer_periph, uint32_t spmode) +{ + if(TIMER_SP_MODE_SINGLE == spmode){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_SPM; + }else if(TIMER_SP_MODE_REPETITIVE == spmode){ + TIMER_CTL0(timer_periph) &= ~((uint32_t)TIMER_CTL0_SPM); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER update source + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] update: + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATE_SRC_GLOBAL: update generate by setting of UPG bit or the counter overflow/underflow, + or the slave mode controller trigger + \arg TIMER_UPDATE_SRC_REGULAR: update generate only by counter overflow/underflow + \param[out] none + \retval none +*/ +void timer_update_source_config(uint32_t timer_periph, uint32_t update) +{ + if(TIMER_UPDATE_SRC_REGULAR == update){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_UPS; + }else if(TIMER_UPDATE_SRC_GLOBAL == update){ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable the TIMER DMA + \param[in] timer_periph: please refer to the following parameters + \param[in] dma: timer DMA source enable + only one parameter can be selected which is shown as below: + \arg TIMER_DMA_UPD: update DMA enable,TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA enable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA enable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA enable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA enable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: commutation DMA request enable,TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA enable,TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_enable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) dma; +} + +/*! + \brief disable the TIMER DMA + \param[in] timer_periph: please refer to the following parameters + \param[in] dma: timer DMA source disable + only one parameter can be selected which is shown as below: + \arg TIMER_DMA_UPD: update DMA disable,TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA disable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA disable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA disable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA disable,TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: commutation DMA request disable,TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA disable,TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_disable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)(dma)); +} + +/*! + \brief channel DMA request source selection + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] dma_request: channel DMA request source selection + only one parameter can be selected which is shown as below: + \arg TIMER_DMAREQUEST_CHANNELEVENT: DMA request of channel y is sent when channel y event occurs + \arg TIMER_DMAREQUEST_UPDATEEVENT: DMA request of channel y is sent when update event occurs + \param[out] none + \retval none +*/ +void timer_channel_dma_request_source_select(uint32_t timer_periph, uint32_t dma_request) +{ + if(TIMER_DMAREQUEST_UPDATEEVENT == dma_request){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_DMAS; + }else if(TIMER_DMAREQUEST_CHANNELEVENT == dma_request){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_DMAS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure the TIMER DMA transfer + \param[in] timer_periph: please refer to the following parameters + \param[in] dma_baseaddr: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATA_CTL0: DMA transfer address is TIMER_CTL0,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CTL1: DMA transfer address is TIMER_CTL1,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SMCFG: DMA transfer address is TIMER_SMCFG,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_DMAINTEN: DMA transfer address is TIMER_DMAINTEN,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_INTF: DMA transfer address is TIMER_INTF,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SWEVG: DMA transfer address is TIMER_SWEVG,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL0: DMA transfer address is TIMER_CHCTL0,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL1: DMA transfer address is TIMER_CHCTL1,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL2: DMA transfer address is TIMER_CHCTL2,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CNT: DMA transfer address is TIMER_CNT,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_PSC: DMA transfer address is TIMER_PSC,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CAR: DMA transfer address is TIMER_CAR,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CREP: DMA transfer address is TIMER_CREP,TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_CH0CV: DMA transfer address is TIMER_CH0CV,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH1CV: DMA transfer address is TIMER_CH1CV,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH2CV: DMA transfer address is TIMER_CH2CV,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH3CV: DMA transfer address is TIMER_CH3CV,TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CCHP: DMA transfer address is TIMER_CCHP,TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_DMACFG: DMA transfer address is TIMER_DMACFG,TIMERx(x=0..4,7) + \param[in] dma_lenth: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATC_xTRANSFER(x=1..18): DMA transfer x time + \param[out] none + \retval none +*/ +void timer_dma_transfer_config(uint32_t timer_periph, uint32_t dma_baseaddr, uint32_t dma_lenth) +{ + TIMER_DMACFG(timer_periph) &= (~(uint32_t)(TIMER_DMACFG_DMATA | TIMER_DMACFG_DMATC)); + TIMER_DMACFG(timer_periph) |= (uint32_t)(dma_baseaddr | dma_lenth); +} + +/*! + \brief software generate events + \param[in] timer_periph: please refer to the following parameters + \param[in] event: the timer software event generation sources + one or more parameters can be selected which are shown as below: + \arg TIMER_EVENT_SRC_UPG: update event generation, TIMERx(x=0..13) + \arg TIMER_EVENT_SRC_CH0G: channel 0 capture or compare event generation, TIMERx(x=0..4,7..13) + \arg TIMER_EVENT_SRC_CH1G: channel 1 capture or compare event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_CH2G: channel 2 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CH3G: channel 3 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CMTG: channel commutation event generation, TIMERx(x=0,7) + \arg TIMER_EVENT_SRC_TRGG: trigger event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_BRKG: break event generation, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_event_software_generate(uint32_t timer_periph, uint16_t event) +{ + TIMER_SWEVG(timer_periph) |= (uint32_t)event; +} + +/*! + \brief initialize TIMER break parameter struct with a default value + \param[in] breakpara: TIMER break parameter struct + \param[out] none + \retval none +*/ +void timer_break_struct_para_init(timer_break_parameter_struct* breakpara) +{ + /* initialize the break parameter struct member with the default value */ + breakpara->runoffstate = TIMER_ROS_STATE_DISABLE; + breakpara->ideloffstate = TIMER_IOS_STATE_DISABLE; + breakpara->deadtime = 0U; + breakpara->breakpolarity = TIMER_BREAK_POLARITY_LOW; + breakpara->outputautostate = TIMER_OUTAUTO_DISABLE; + breakpara->protectmode = TIMER_CCHP_PROT_OFF; + breakpara->breakstate = TIMER_BREAK_DISABLE; +} + +/*! + \brief configure TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] breakpara: TIMER break parameter struct + runoffstate: TIMER_ROS_STATE_ENABLE,TIMER_ROS_STATE_DISABLE + ideloffstate: TIMER_IOS_STATE_ENABLE,TIMER_IOS_STATE_DISABLE + deadtime: 0~255 + breakpolarity: TIMER_BREAK_POLARITY_LOW,TIMER_BREAK_POLARITY_HIGH + outputautostate: TIMER_OUTAUTO_ENABLE,TIMER_OUTAUTO_DISABLE + protectmode: TIMER_CCHP_PROT_OFF,TIMER_CCHP_PROT_0,TIMER_CCHP_PROT_1,TIMER_CCHP_PROT_2 + breakstate: TIMER_BREAK_ENABLE,TIMER_BREAK_DISABLE + \param[out] none + \retval none +*/ +void timer_break_config(uint32_t timer_periph, timer_break_parameter_struct* breakpara) +{ + TIMER_CCHP(timer_periph) = (uint32_t)(((uint32_t)(breakpara->runoffstate)) | + ((uint32_t)(breakpara->ideloffstate)) | + ((uint32_t)(breakpara->deadtime)) | + ((uint32_t)(breakpara->breakpolarity)) | + ((uint32_t)(breakpara->outputautostate)) | + ((uint32_t)(breakpara->protectmode)) | + ((uint32_t)(breakpara->breakstate))) ; +} + +/*! + \brief enable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief disable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief enable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief disable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief enable or disable TIMER primary output function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_primary_output_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_POEN; + }else{ + TIMER_CCHP(timer_periph) &= (~(uint32_t)TIMER_CCHP_POEN); + } +} + +/*! + \brief enable or disable channel capture/compare control shadow register + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCSE; + }else{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCSE); + } +} + +/*! + \brief configure TIMER channel control shadow register update control + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] ccuctl: channel control shadow register update control + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATECTL_CCU: the shadow registers update by when CMTG bit is set + \arg TIMER_UPDATECTL_CCUTRI: the shadow registers update by when CMTG bit is set or an rising edge of TRGI occurs + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_update_config(uint32_t timer_periph, uint32_t ccuctl) +{ + if(TIMER_UPDATECTL_CCU == ccuctl){ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCUC); + }else if(TIMER_UPDATECTL_CCUTRI == ccuctl){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCUC; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief initialize TIMER channel output parameter struct with a default value + \param[in] ocpara: TIMER channel n output parameter struct + \param[out] none + \retval none +*/ +void timer_channel_output_struct_para_init(timer_oc_parameter_struct* ocpara) +{ + /* initialize the channel output parameter struct member with the default value */ + ocpara->outputstate = TIMER_CCX_DISABLE; + ocpara->outputnstate = TIMER_CCXN_DISABLE; + ocpara->ocpolarity = TIMER_OC_POLARITY_HIGH; + ocpara->ocnpolarity = TIMER_OCN_POLARITY_HIGH; + ocpara->ocidlestate = TIMER_OC_IDLE_STATE_LOW; + ocpara->ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; +} + +/*! + \brief configure TIMER channel output function + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocpara: TIMER channeln output parameter struct + outputstate: TIMER_CCX_ENABLE,TIMER_CCX_DISABLE + outputnstate: TIMER_CCXN_ENABLE,TIMER_CCXN_DISABLE + ocpolarity: TIMER_OC_POLARITY_HIGH,TIMER_OC_POLARITY_LOW + ocnpolarity: TIMER_OCN_POLARITY_HIGH,TIMER_OCN_POLARITY_LOW + ocidlestate: TIMER_OC_IDLE_STATE_LOW,TIMER_OC_IDLE_STATE_HIGH + ocnidlestate: TIMER_OCN_IDLE_STATE_LOW,TIMER_OCN_IDLE_STATE_HIGH + \param[out] none + \retval none +*/ +void timer_channel_output_config(uint32_t timer_periph, uint16_t channel, timer_oc_parameter_struct* ocpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH0MS; + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputstate; + /* reset the CH0P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + /* set the CH0P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocpolarity; + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + /* set the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputnstate; + /* reset the CH0NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + /* set the CH0NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocnpolarity; + /* reset the ISO0 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0); + /* set the ISO0 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocidlestate; + /* reset the ISO0N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0N); + /* set the ISO0N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocnidlestate; + } + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH1MS; + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 4U); + /* reset the CH1P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + /* set the CH1P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity)<< 4U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + /* set the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate)<< 4U); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity)<< 4U); + /* reset the ISO1 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1); + /* set the ISO1 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate)<< 2U); + /* reset the ISO1N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1N); + /* set the ISO1N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate)<< 2U); + } + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH2MS; + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 8U); + /* reset the CH2P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + /* set the CH2P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity)<< 8U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + /* set the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate)<< 8U); + /* reset the CH2NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + /* set the CH2NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity)<< 8U); + /* reset the ISO2 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2); + /* set the ISO2 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate)<< 4U); + /* reset the ISO2N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2N); + /* set the ISO2N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate)<< 4U); + } + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &=(~(uint32_t)TIMER_CHCTL2_CH3EN); + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH3MS; + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 12U); + /* reset the CH3P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + /* set the CH3P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity)<< 12U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the ISO3 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO3); + /* set the ISO3 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate)<< 6U); + } + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output compare mode + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] ocmode: channel output compare mode + only one parameter can be selected which is shown as below: + \arg TIMER_OC_MODE_TIMING: timing mode + \arg TIMER_OC_MODE_ACTIVE: active mode + \arg TIMER_OC_MODE_INACTIVE: inactive mode + \arg TIMER_OC_MODE_TOGGLE: toggle mode + \arg TIMER_OC_MODE_LOW: force low mode + \arg TIMER_OC_MODE_HIGH: force high mode + \arg TIMER_OC_MODE_PWM0: PWM0 mode + \arg TIMER_OC_MODE_PWM1: PWM1 mode + \param[out] none + \retval none +*/ +void timer_channel_output_mode_config(uint32_t timer_periph, uint16_t channel, uint16_t ocmode) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocmode)<< 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocmode)<< 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output pulse value + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] pulse: channel output pulse value + \param[out] none + \retval none +*/ +void timer_channel_output_pulse_value_config(uint32_t timer_periph, uint16_t channel, uint16_t pulse) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CH0CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CH1CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CH2CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CH3CV(timer_periph) = (uint32_t)pulse; + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output shadow function + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] ocshadow: channel output shadow state + only one parameter can be selected which is shown as below: + \arg TIMER_OC_SHADOW_ENABLE: channel output shadow state enable + \arg TIMER_OC_SHADOW_DISABLE: channel output shadow state disable + \param[out] none + \retval none +*/ +void timer_channel_output_shadow_config(uint32_t timer_periph, uint16_t channel, uint16_t ocshadow) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output fast function + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] ocfast: channel output fast function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_FAST_ENABLE: channel output fast function enable + \arg TIMER_OC_FAST_DISABLE: channel output fast function disable + \param[out] none + \retval none +*/ +void timer_channel_output_fast_config(uint32_t timer_periph, uint16_t channel, uint16_t ocfast) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output clear function + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0 + \arg TIMER_CH_1: TIMER channel1 + \arg TIMER_CH_2: TIMER channel2 + \arg TIMER_CH_3: TIMER channel3 + \param[in] occlear: channel output clear function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_CLEAR_ENABLE: channel output clear function enable + \arg TIMER_OC_CLEAR_DISABLE: channel output clear function disable + \param[out] none + \retval none +*/ +void timer_channel_output_clear_config(uint32_t timer_periph, uint16_t channel, uint16_t occlear) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output polarity + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] ocpolarity: channel output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OC_POLARITY_HIGH: channel output polarity is high + \arg TIMER_OC_POLARITY_LOW: channel output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output polarity + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \param[in] ocnpolarity: channel complementary output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OCN_POLARITY_HIGH: channel complementary output polarity is high + \arg TIMER_OCN_POLARITY_LOW: channel complementary output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel enable state + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] state: TIMER channel enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCX_ENABLE: channel enable + \arg TIMER_CCX_DISABLE: channel disable + \param[out] none + \retval none +*/ +void timer_channel_output_state_config(uint32_t timer_periph, uint16_t channel, uint32_t state) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)state; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output enable state + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0 + \arg TIMER_CH_1: TIMER channel1 + \arg TIMER_CH_2: TIMER channel2 + \param[in] ocnstate: TIMER channel complementary output enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCXN_ENABLE: channel complementary enable + \arg TIMER_CCXN_DISABLE: channel complementary disable + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_state_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnstate) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnstate; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 8U); + break; + default: + break; + } +} + +/*! + \brief initialize TIMER channel input parameter struct with a default value + \param[in] icpara: TIMER channel intput parameter struct + \param[out] none + \retval none +*/ +void timer_channel_input_struct_para_init(timer_ic_parameter_struct* icpara) +{ + /* initialize the channel input parameter struct member with the default value */ + icpara->icpolarity = TIMER_IC_POLARITY_RISING; + icpara->icselection = TIMER_IC_SELECTION_DIRECTTI; + icpara->icprescaler = TIMER_IC_PSC_DIV1; + icpara->icfilter = 0U; +} + +/*! + \brief configure TIMER input capture parameter + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] icpara: TIMER channel intput parameter struct + icpolarity: TIMER_IC_POLARITY_RISING, TIMER_IC_POLARITY_FALLING + icselection: TIMER_IC_SELECTION_DIRECTTI, TIMER_IC_SELECTION_INDIRECTTI, + TIMER_IC_SELECTION_ITS + icprescaler: TIMER_IC_PSC_DIV1, TIMER_IC_PSC_DIV2, TIMER_IC_PSC_DIV4, + TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpara->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpara->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + break; + + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + + /* reset the CH2P and CH2NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH2P | TIMER_CHCTL2_CH2NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 8U); + + /* reset the CH2MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection)); + + /* reset the CH2CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH2EN; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + + /* reset the CH3P bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH3P)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 12U); + + /* reset the CH3MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + + /* reset the CH3CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH3EN; + break; + default: + break; + } + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph,channel,(uint16_t)(icpara->icprescaler)); +} + +/*! + \brief configure TIMER channel input capture prescaler value + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[in] prescaler: channel input capture prescaler value + only one parameter can be selected which is shown as below: + \arg TIMER_IC_PSC_DIV1: no prescaler + \arg TIMER_IC_PSC_DIV2: divided by 2 + \arg TIMER_IC_PSC_DIV4: divided by 4 + \arg TIMER_IC_PSC_DIV8: divided by 8 + \param[out] none + \retval none +*/ +void timer_channel_input_capture_prescaler_config(uint32_t timer_periph, uint16_t channel, uint16_t prescaler) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPPSC); + TIMER_CHCTL0(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPPSC); + TIMER_CHCTL0(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPPSC); + TIMER_CHCTL1(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPPSC); + TIMER_CHCTL1(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + default: + break; + } +} + +/*! + \brief read TIMER channel capture compare register value + \param[in] timer_periph: please refer to the following parameters + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel3(TIMERx(x=0..4,7)) + \param[out] none + \retval channel capture compare register value +*/ +uint32_t timer_channel_capture_value_register_read(uint32_t timer_periph, uint16_t channel) +{ + uint32_t count_value = 0U; + + switch(channel){ + case TIMER_CH_0: + /* read TIMER channel 0 capture compare register value */ + count_value = TIMER_CH0CV(timer_periph); + break; + case TIMER_CH_1: + /* read TIMER channel 1 capture compare register value */ + count_value = TIMER_CH1CV(timer_periph); + break; + case TIMER_CH_2: + /* read TIMER channel 2 capture compare register value */ + count_value = TIMER_CH2CV(timer_periph); + break; + case TIMER_CH_3: + /* read TIMER channel 3 capture compare register value */ + count_value = TIMER_CH3CV(timer_periph); + break; + default: + break; + } + return (count_value); +} + +/*! + \brief configure TIMER input pwm capture function + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel0 + \arg TIMER_CH_1: TIMER channel1 + \param[in] icpwm:TIMER channel intput pwm parameter struct + icpolarity: TIMER_IC_POLARITY_RISING,TIMER_IC_POLARITY_FALLING + icselection: TIMER_IC_SELECTION_DIRECTTI,TIMER_IC_SELECTION_INDIRECTTI + icprescaler: TIMER_IC_PSC_DIV1,TIMER_IC_PSC_DIV2,TIMER_IC_PSC_DIV4,TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_pwm_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpwm) +{ + uint16_t icpolarity = 0x0U; + uint16_t icselection = 0x0U; + + /* Set channel input polarity */ + if(TIMER_IC_POLARITY_RISING == icpwm->icpolarity){ + icpolarity = TIMER_IC_POLARITY_FALLING; + }else{ + icpolarity = TIMER_IC_POLARITY_RISING; + } + /* Set channel input mode selection */ + if(TIMER_IC_SELECTION_DIRECTTI == icpwm->icselection){ + icselection = TIMER_IC_SELECTION_INDIRECTTI; + }else{ + icselection = TIMER_IC_SELECTION_DIRECTTI; + } + + if(TIMER_CH_0 == channel){ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpwm->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpwm->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph,TIMER_CH_0,(uint16_t)(icpwm->icprescaler)); + + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P|TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)icpolarity<< 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)icselection<< 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter)<< 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph,TIMER_CH_1,(uint16_t)(icpwm->icprescaler)); + }else{ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P|TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icpolarity)<< 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icselection)<< 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter)<< 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph,TIMER_CH_1,(uint16_t)(icpwm->icprescaler)); + + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P|TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)icpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)icselection; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph,TIMER_CH_0,(uint16_t)(icpwm->icprescaler)); + } +} + +/*! + \brief configure TIMER hall sensor mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] hallmode: + only one parameter can be selected which is shown as below: + \arg TIMER_HALLINTERFACE_ENABLE: TIMER hall sensor mode enable + \arg TIMER_HALLINTERFACE_DISABLE: TIMER hall sensor mode disable + \param[out] none + \retval none +*/ +void timer_hall_mode_config(uint32_t timer_periph, uint32_t hallmode) +{ + if(TIMER_HALLINTERFACE_ENABLE == hallmode){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_TI0S; + }else if(TIMER_HALLINTERFACE_DISABLE == hallmode){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_TI0S; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief select TIMER input trigger source + \param[in] timer_periph: please refer to the following parameters + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1,TIMERx(x=0..4,7,8,11) + \arg TIMER_SMCFG_TRGSEL_ETIFP: external trigger,TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_input_trigger_source_select(uint32_t timer_periph, uint32_t intrigger) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_TRGS); + TIMER_SMCFG(timer_periph) |= (uint32_t)intrigger; +} + +/*! + \brief select TIMER master mode output trigger source + \param[in] timer_periph: TIMERx(x=0..7) + \param[in] outrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_TRI_OUT_SRC_RESET: the UPG bit as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_ENABLE: the counter enable signal TIMER_CTL0_CEN as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_UPDATE: update event as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_CH0: a capture or a compare match occurred in channel 0 as trigger output TRGO(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O0CPRE: O0CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O1CPRE: O1CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O2CPRE: O2CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O3CPRE: O3CPRE as trigger output(TIMERx(x=0..4,7)) + \param[out] none + \retval none +*/ +void timer_master_output_trigger_source_select(uint32_t timer_periph, uint32_t outrigger) +{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_MMC); + TIMER_CTL1(timer_periph) |= (uint32_t)outrigger; +} + +/*! + \brief select TIMER slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] slavemode: + only one parameter can be selected which is shown as below: + \arg TIMER_SLAVE_MODE_DISABLE: slave mode disable + \arg TIMER_QUAD_DECODER_MODE0: quadrature decoder mode 0 + \arg TIMER_QUAD_DECODER_MODE1: quadrature decoder mode 1 + \arg TIMER_QUAD_DECODER_MODE2: quadrature decoder mode 2 + \arg TIMER_SLAVE_MODE_RESTART: restart mode + \arg TIMER_SLAVE_MODE_PAUSE: pause mode + \arg TIMER_SLAVE_MODE_EVENT: event mode + \arg TIMER_SLAVE_MODE_EXTERNAL0: external clock mode 0. + \param[out] none + \retval none +*/ + +void timer_slave_mode_select(uint32_t timer_periph, uint32_t slavemode) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + + TIMER_SMCFG(timer_periph) |= (uint32_t)slavemode; +} + +/*! + \brief configure TIMER master slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] masterslave: + only one parameter can be selected which is shown as below: + \arg TIMER_MASTER_SLAVE_MODE_ENABLE: master slave mode enable + \arg TIMER_MASTER_SLAVE_MODE_DISABLE: master slave mode disable + \param[out] none + \retval none +*/ +void timer_master_slave_mode_config(uint32_t timer_periph, uint32_t masterslave) +{ + if(TIMER_MASTER_SLAVE_MODE_ENABLE == masterslave){ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_MSM; + }else if(TIMER_MASTER_SLAVE_MODE_DISABLE == masterslave){ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_MSM; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER external trigger input + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] expolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_ETP | TIMER_SMCFG_ETPSC | TIMER_SMCFG_ETFC)); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extprescaler | extpolarity); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extfilter << 8U); +} + +/*! + \brief configure TIMER quadrature decoder mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] decomode: + only one parameter can be selected which is shown as below: + \arg TIMER_QUAD_DECODER_MODE0: counter counts on CI0FE0 edge depending on CI1FE1 level + \arg TIMER_QUAD_DECODER_MODE1: counter counts on CI1FE1 edge depending on CI0FE0 level + \arg TIMER_QUAD_DECODER_MODE2: counter counts on both CI0FE0 and CI1FE1 edges depending on the level of the other input + \param[in] ic0polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[in] ic1polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[out] none + \retval none +*/ +void timer_quadrature_decoder_mode_config(uint32_t timer_periph, uint32_t decomode, uint16_t ic0polarity, uint16_t ic1polarity) +{ + /* configure the quadrature decoder mode */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + TIMER_SMCFG(timer_periph) |= (uint32_t)decomode; + /* configure input capture selection */ + TIMER_CHCTL0(timer_periph) &= (uint32_t)(((~(uint32_t)TIMER_CHCTL0_CH0MS)) & ((~(uint32_t)TIMER_CHCTL0_CH1MS))); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(TIMER_IC_SELECTION_DIRECTTI | ((uint32_t)TIMER_IC_SELECTION_DIRECTTI << 8U)); + /* configure channel input capture polarity */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= ((uint32_t)ic0polarity | ((uint32_t)ic1polarity << 4U)); +} + +/*! + \brief configure TIMER internal clock mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[out] none + \retval none +*/ +void timer_internal_clock_config(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; +} + +/*! + \brief configure TIMER the internal trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0 + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1 + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2 + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3 + \param[out] none + \retval none +*/ +void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger) +{ + timer_input_trigger_source_select(timer_periph,intrigger); + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0 + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1 + \param[in] expolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: active high or rising edge active + \arg TIMER_IC_POLARITY_FALLING: active low or falling edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t extrigger, uint16_t extpolarity, uint8_t extfilter) +{ + if(TIMER_SMCFG_TRGSEL_CI1FE1 == extrigger){ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P|TIMER_CHCTL2_CH1NP)); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)extpolarity << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)TIMER_IC_SELECTION_DIRECTTI<< 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + }else{ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P|TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)extpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)TIMER_IC_SELECTION_DIRECTTI; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + } + /* select TIMER input trigger source */ + timer_input_trigger_source_select(timer_periph,extrigger); + /* reset the SMC bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + /* set the SMC bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external clock mode0 + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] expolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode0_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + /* reset the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_SMC | TIMER_SMCFG_TRGS)); + /* set the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)(TIMER_SLAVE_MODE_EXTERNAL0 | TIMER_SMCFG_TRGSEL_ETIFP); +} + +/*! + \brief configure TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint8_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief disable TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_disable(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief enable the TIMER interrupt + \param[in] timer_periph: please refer to the following parameters + \param[in] interrupt: timer interrupt enable source + only one parameter can be selected which is shown as below: + \arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt enable , TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt enable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt enable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_enable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) interrupt; +} + +/*! + \brief disable the TIMER interrupt + \param[in] timer_periph: please refer to the following parameters + \param[in] interrupt: timer interrupt source disable + only one parameter can be selected which is shown as below: + \arg TIMER_INT_UP: update interrupt disable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt disable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt disable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt disable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt disable , TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt disable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt disable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt disable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_disable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)interrupt); +} + +/*! + \brief get timer interrupt flag + \param[in] timer_periph: please refer to the following parameters + \param[in] interrupt: the timer interrupt bits + only one parameter can be selected which is shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag,TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag,TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag,TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag,TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag,TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag,TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag,TIMERx(x=0,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_interrupt_flag_get(uint32_t timer_periph, uint32_t interrupt) +{ + uint32_t val; + val = (TIMER_DMAINTEN(timer_periph) & interrupt); + if((RESET != (TIMER_INTF(timer_periph) & interrupt) ) && (RESET != val)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER interrupt flag + \param[in] timer_periph: please refer to the following parameters + \param[in] interrupt: the timer interrupt bits + only one parameter can be selected which is shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag,TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag,TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag,TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag,TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag,TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag,TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag,TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_flag_clear(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)interrupt); +} + +/*! + \brief get TIMER flags + \param[in] timer_periph: please refer to the following parameters + \param[in] flag: the timer interrupt flags + only one parameter can be selected which is shown as below: + \arg TIMER_FLAG_UP: update flag,TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag,TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel commutation flag,TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag,TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag,TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag,TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag,TIMERx(x=0..4,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_flag_get(uint32_t timer_periph, uint32_t flag) +{ + if(RESET != (TIMER_INTF(timer_periph) & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER flags + \param[in] timer_periph: please refer to the following parameters + \param[in] flag: the timer interrupt flags + only one parameter can be selected which is shown as below: + \arg TIMER_FLAG_UP: update flag,TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag,TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel control update flag,TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag,TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag,TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag,TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag,TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag,TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag,TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_flag_clear(uint32_t timer_periph, uint32_t flag) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)flag); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_usart.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_usart.c new file mode 100644 index 0000000..6b7621a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_usart.c @@ -0,0 +1,739 @@ +/*! + \file gd32f10x_usart.c + \brief USART driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_usart.h" + +/* USART register bit offset */ +#define GP_GUAT_OFFSET ((uint32_t)8U) /* bit offset of GUAT in USART_GP */ + +/*! + \brief reset USART/UART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_deinit(uint32_t usart_periph) +{ + switch(usart_periph){ + case USART0: + /* reset USART0 */ + rcu_periph_reset_enable(RCU_USART0RST); + rcu_periph_reset_disable(RCU_USART0RST); + break; + case USART1: + /* reset USART1 */ + rcu_periph_reset_enable(RCU_USART1RST); + rcu_periph_reset_disable(RCU_USART1RST); + break; + case USART2: + /* reset USART2 */ + rcu_periph_reset_enable(RCU_USART2RST); + rcu_periph_reset_disable(RCU_USART2RST); + break; + case UART3: + /* reset UART3 */ + rcu_periph_reset_enable(RCU_UART3RST); + rcu_periph_reset_disable(RCU_UART3RST); + break; + case UART4: + /* reset UART4 */ + rcu_periph_reset_enable(RCU_UART4RST); + rcu_periph_reset_disable(RCU_UART4RST); + break; + default: + break; + } +} + +/*! + \brief configure USART baud rate value + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] baudval: baud rate value + \param[out] none + \retval none +*/ +void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval) +{ + uint32_t uclk=0U, intdiv=0U, fradiv=0U, udiv=0U; + switch(usart_periph){ + /* get clock frequency */ + case USART0: + /* get USART0 clock */ + uclk=rcu_clock_freq_get(CK_APB2); + break; + case USART1: + /* get USART1 clock */ + uclk=rcu_clock_freq_get(CK_APB1); + break; + case USART2: + /* get USART2 clock */ + uclk=rcu_clock_freq_get(CK_APB1); + break; + case UART3: + /* get UART3 clock */ + uclk=rcu_clock_freq_get(CK_APB1); + break; + case UART4: + /* get UART4 clock */ + uclk=rcu_clock_freq_get(CK_APB1); + break; + default: + break; + } + /* oversampling by 16, configure the value of USART_BAUD */ + udiv = (uclk+baudval/2U)/baudval; + intdiv = udiv & (0x0000fff0U); + fradiv = udiv & (0x0000000fU); + USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); +} + +/*! + \brief configure USART parity + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] paritycfg: configure USART parity + only one parameter can be selected which is shown as below: + \arg USART_PM_NONE: no parity + \arg USART_PM_ODD: odd parity + \arg USART_PM_EVEN: even parity + \param[out] none + \retval none +*/ +void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg) +{ + /* clear USART_CTL0 PM,PCEN bits */ + USART_CTL0(usart_periph) &= ~(USART_CTL0_PM | USART_CTL0_PCEN); + /* configure USART parity mode */ + USART_CTL0(usart_periph) |= paritycfg ; +} + +/*! + \brief configure USART word length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wlen: USART word length configure + only one parameter can be selected which is shown as below: + \arg USART_WL_8BIT: 8 bits + \arg USART_WL_9BIT: 9 bits + \param[out] none + \retval none +*/ +void usart_word_length_set(uint32_t usart_periph, uint32_t wlen) +{ + /* clear USART_CTL0 WL bit */ + USART_CTL0(usart_periph) &= ~USART_CTL0_WL; + /* configure USART word length */ + USART_CTL0(usart_periph) |= wlen; +} + +/*! + \brief configure USART stop bit length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] stblen: USART stop bit configure + only one parameter can be selected which is shown as below: + \arg USART_STB_1BIT: 1 bit + \arg USART_STB_0_5BIT: 0.5 bit, not available for UARTx(x=3,4) + \arg USART_STB_2BIT: 2 bits + \arg USART_STB_1_5BIT: 1.5 bits, not available for UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen) +{ + /* clear USART_CTL1 STB bits */ + USART_CTL1(usart_periph) &= ~USART_CTL1_STB; + /* configure USART stop bits */ + USART_CTL1(usart_periph) |= stblen; +} +/*! + \brief enable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_UEN; +} + +/*! + \brief disable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_UEN); +} + +/*! + \brief configure USART transmitter + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] txconfig: enable or disable USART transmitter + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_ENABLE: enable USART transmission + \arg USART_TRANSMIT_DISABLE: disable USART transmission + \param[out] none + \retval none +*/ +void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig) +{ + uint32_t ctl = 0U; + + ctl = USART_CTL0(usart_periph); + ctl &= ~USART_CTL0_TEN; + ctl |= txconfig; + /* configure transfer mode */ + USART_CTL0(usart_periph) = ctl; +} + +/*! + \brief configure USART receiver + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] rxconfig: enable or disable USART receiver + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_ENABLE: enable USART reception + \arg USART_RECEIVE_DISABLE: disable USART reception + \param[out] none + \retval none +*/ +void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig) +{ + uint32_t ctl = 0U; + + ctl = USART_CTL0(usart_periph); + ctl &= ~USART_CTL0_REN; + ctl |= rxconfig; + /* configure receiver mode */ + USART_CTL0(usart_periph) = ctl; +} + +/*! + \brief USART transmit data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] data: data of transmission + \param[out] none + \retval none +*/ +void usart_data_transmit(uint32_t usart_periph, uint16_t data) +{ + USART_DATA(usart_periph) = USART_DATA_DATA & (uint32_t)data; +} + +/*! + \brief USART receive data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval data of received +*/ +uint16_t usart_data_receive(uint32_t usart_periph) +{ + return (uint16_t)(GET_BITS(USART_DATA(usart_periph), 0U, 8U)); +} + +/*! + \brief configure the address of the USART in wake up by address match mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] addr: address of USART/UART + \param[out] none + \retval none +*/ +void usart_address_config(uint32_t usart_periph, uint8_t addr) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_ADDR); + USART_CTL1(usart_periph) |= (USART_CTL1_ADDR & (uint32_t)addr); +} + +/*! + \brief receiver in mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_RWU; +} + +/*! + \brief receiver in active mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_RWU); +} + +/*! + \brief configure wakeup method in mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wmethod: two methods be used to enter or exit the mute mode + only one parameter can be selected which is shown as below: + \arg USART_WM_IDLE: idle line + \arg USART_WM_ADDR: address mask + \param[out] none + \retval none +*/ +void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmethod) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_WM); + USART_CTL0(usart_periph) |= wmethod; +} + +/*! + \brief enable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_LMEN; +} + +/*! + \brief disable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LMEN); +} + +/*! + \brief configure lin break frame length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] lblen: lin break frame length + only one parameter can be selected which is shown as below: + \arg USART_LBLEN_10B: 10 bits + \arg USART_LBLEN_11B: 11 bits + \param[out] none + \retval none +*/ +void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LBLEN); + USART_CTL1(usart_periph) |= (USART_CTL1_LBLEN & lblen); +} + +/*! + \brief send break frame + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_send_break(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_SBKCMD; +} + +/*! + \brief enable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_HDEN; +} + +/*! + \brief disable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_HDEN); +} + +/*! + \brief enable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_CKEN; +} + +/*! + \brief disable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CKEN); +} + +/*! + \brief configure USART synchronous mode parameters + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] clen: CK length + only one parameter can be selected which is shown as below: + \arg USART_CLEN_NONE: there are 7 CK pulses for an 8 bit frame and 8 CK pulses for a 9 bit frame + \arg USART_CLEN_EN: there are 8 CK pulses for an 8 bit frame and 9 CK pulses for a 9 bit frame + \param[in] cph: clock phase + only one parameter can be selected which is shown as below: + \arg USART_CPH_1CK: first clock transition is the first data capture edge + \arg USART_CPH_2CK: second clock transition is the first data capture edge + \param[in] cpl: clock polarity + only one parameter can be selected which is shown as below: + \arg USART_CPL_LOW: steady low value on CK pin + \arg USART_CPL_HIGH: steady high value on CK pin + \param[out] none + \retval none +*/ +void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cpl) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CLEN | USART_CTL1_CPH | USART_CTL1_CPL); + USART_CTL1(usart_periph) |= (USART_CTL1_CLEN & clen) | (USART_CTL1_CPH & cph) | (USART_CTL1_CPL & cpl); +} + +/*! + \brief configure guard time value in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] guat: guard time value + \param[out] none + \retval none +*/ +void usart_guard_time_config(uint32_t usart_periph,uint8_t guat) +{ + USART_GP(usart_periph) &= ~(USART_GP_GUAT); + USART_GP(usart_periph) |= (USART_GP_GUAT & ((uint32_t)guat << GP_GUAT_OFFSET)); +} + +/*! + \brief enable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_SCEN; +} + +/*! + \brief disable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_SCEN); +} + +/*! + \brief enable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_NKEN; +} + +/*! + \brief disable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_NKEN); +} + +/*! + \brief enable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_IREN; +} + +/*! + \brief disable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IREN); +} + +/*! + \brief configure the peripheral clock prescaler in USART IrDA low-power mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] psc: 0x00-0xFF + \param[out] none + \retval none +*/ +void usart_prescaler_config(uint32_t usart_periph, uint8_t psc) +{ + USART_GP(usart_periph) &= ~(USART_GP_PSC); + USART_GP(usart_periph) |= (uint32_t)psc; +} + +/*! + \brief configure IrDA low-power + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] irlp: IrDA low-power or normal + only one parameter can be selected which is shown as below: + \arg USART_IRLP_LOW: low-power + \arg USART_IRLP_NORMAL: normal + \param[out] none + \retval none +*/ +void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IRLP); + USART_CTL2(usart_periph) |= (USART_CTL2_IRLP & irlp); +} + +/*! + \brief configure hardware flow control RTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] rtsconfig: enable or disable RTS + only one parameter can be selected which is shown as below: + \arg USART_RTS_ENABLE: enable RTS + \arg USART_RTS_DISABLE: disable RTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_RTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_RTSEN & rtsconfig); +} + +/*! + \brief configure hardware flow control CTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] ctsconfig: enable or disable CTS + only one parameter can be selected which is shown as below: + \arg USART_CTS_ENABLE: enable CTS + \arg USART_CTS_DISABLE: disable CTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_CTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_CTSEN & ctsconfig); +} + +/*! + \brief configure USART DMA reception + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmacmd: enable or disable DMA for reception + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_DMA_ENABLE: enable USART DMA for reception + \arg USART_RECEIVE_DMA_DISABLE: disable USART DMA for reception + \param[out] none + \retval none +*/ +void usart_dma_receive_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENR); + USART_CTL2(usart_periph) |= (USART_CTL2_DENR & dmaconfig); +} + +/*! + \brief configure USART DMA transmission + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmacmd: enable or disable DMA for transmission + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_DMA_ENABLE: enable USART DMA for transmission + \arg USART_TRANSMIT_DMA_DISABLE: disable USART DMA for transmission + \param[out] none + \retval none +*/ +void usart_dma_transmit_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENT); + USART_CTL2(usart_periph) |= (USART_CTL2_DENT & dmaconfig); +} + +/*! + \brief get flag in STAT register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTSF: CTS change flag + \arg USART_FLAG_LBDF: LIN break detected flag + \arg USART_FLAG_TBE: transmit data buffer empty + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \arg USART_FLAG_IDLEF: IDLE frame detected flag + \arg USART_FLAG_ORERR: overrun error + \arg USART_FLAG_NERR: noise error flag + \arg USART_FLAG_FERR: frame error flag + \arg USART_FLAG_PERR: parity error flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag) +{ + if(RESET != (USART_REG_VAL(usart_periph, flag) & BIT(USART_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear flag in STAT register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTSF: CTS change flag + \arg USART_FLAG_LBDF: LIN break detected flag + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \param[out] none + \retval none +*/ +void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag) +{ + USART_REG_VAL(usart_periph, flag) = ~BIT(USART_BIT_POS(flag)); +} + +/*! + \brief enable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \param[out] none + \retval none +*/ +void usart_interrupt_enable(uint32_t usart_periph, uint32_t int_flag) +{ + USART_REG_VAL(usart_periph, int_flag) |= BIT(USART_BIT_POS(int_flag)); +} + +/*! + \brief disable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \param[out] none + \retval none +*/ +void usart_interrupt_disable(uint32_t usart_periph, uint32_t int_flag) +{ + USART_REG_VAL(usart_periph, int_flag) &= ~BIT(USART_BIT_POS(int_flag)); +} + +/*! + \brief get USART interrupt and flag status + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_PERR: parity error interrupt and flag + \arg USART_INT_FLAG_TBE: transmitter buffer empty interrupt and flag + \arg USART_INT_FLAG_TC: transmission complete interrupt and flag + \arg USART_INT_FLAG_RBNE: read data buffer not empty interrupt and flag + \arg USART_INT_FLAG_RBNE_ORERR: read data buffer not empty interrupt and overrun error flag + \arg USART_INT_FLAG_IDLE: IDLE line detected interrupt and flag + \arg USART_INT_FLAG_LBD: LIN break detected interrupt and flag + \arg USART_INT_FLAG_CTS: CTS interrupt and flag + \arg USART_INT_FLAG_ERR_ORERR: error interrupt and overrun error + \arg USART_INT_FLAG_ERR_NERR: error interrupt and noise error flag + \arg USART_INT_FLAG_ERR_FERR: error interrupt and frame error flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, uint32_t int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U; + /* get the interrupt enable bit status */ + intenable = (USART_REG_VAL(usart_periph, int_flag) & BIT(USART_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (USART_REG_VAL2(usart_periph, int_flag) & BIT(USART_BIT_POS2(int_flag))); + + if(flagstatus && intenable){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear USART interrupt flag in STAT register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART interrupt flag + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_CTS: CTS change flag + \arg USART_INT_FLAG_LBD: LIN break detected flag + \arg USART_INT_FLAG_TC: transmission complete + \arg USART_INT_FLAG_RBNE: read data buffer not empty + \param[out] none + \retval none +*/ +void usart_interrupt_flag_clear(uint32_t usart_periph, uint32_t flag) +{ + USART_REG_VAL2(usart_periph, flag) = ~BIT(USART_BIT_POS2(flag)); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_wwdgt.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_wwdgt.c new file mode 100644 index 0000000..54f8e40 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_wwdgt.c @@ -0,0 +1,125 @@ +/*! + \file gd32f10x_wwdgt.c + \brief WWDGT driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_wwdgt.h" + +/*! + \brief reset the window watchdog timer configuration + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_deinit(void) +{ + rcu_periph_reset_enable(RCU_WWDGTRST); + rcu_periph_reset_disable(RCU_WWDGTRST); +} + +/*! + \brief start the window watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_enable(void) +{ + WWDGT_CTL |= WWDGT_CTL_WDGTEN; +} + +/*! + \brief configure the window watchdog timer counter value + \param[in] counter_value: 0x00 - 0x7F + \param[out] none + \retval none +*/ +void wwdgt_counter_update(uint16_t counter_value) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter_value)); +} + +/*! + \brief configure counter value, window value, and prescaler divider value + \param[in] counter: 0x00 - 0x7F + \param[in] window: 0x00 - 0x7F + \param[in] prescaler: wwdgt prescaler value + only one parameter can be selected which is shown as below: + \arg WWDGT_CFG_PSC_DIV1: the time base of window watchdog counter = (PCLK1/4096)/1 + \arg WWDGT_CFG_PSC_DIV2: the time base of window watchdog counter = (PCLK1/4096)/2 + \arg WWDGT_CFG_PSC_DIV4: the time base of window watchdog counter = (PCLK1/4096)/4 + \arg WWDGT_CFG_PSC_DIV8: the time base of window watchdog counter = (PCLK1/4096)/8 + \param[out] none + \retval none +*/ +void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter)); + WWDGT_CFG = (uint32_t)(CFG_WIN(window) | prescaler); +} + +/*! + \brief check early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus wwdgt_flag_get(void) +{ + if(WWDGT_STAT & WWDGT_STAT_EWIF) { + return SET; + } + + return RESET; +} + +/*! + \brief clear early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_flag_clear(void) +{ + WWDGT_STAT = (uint32_t)(RESET); +} + +/*! + \brief enable early wakeup interrupt of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_interrupt_enable(void) +{ + WWDGT_CFG |= WWDGT_CFG_EWIE; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_core.h new file mode 100644 index 0000000..889e987 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_core.h @@ -0,0 +1,273 @@ +/*! + \file audio_core.h + \brief the header file of USB audio device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __AUDIO_CORE_H +#define __AUDIO_CORE_H + +#include "usbd_enum.h" + +#define FORMAT_24BIT(x) (uint8_t)(x);(uint8_t)((x) >> 8);(uint8_t)((x) >> 16) + +/* number of sub-packets in the audio transfer buffer. user can modify this value but always make sure + that it is an even number and higher than 3 */ +#define OUT_PACKET_NUM 120U + +/* total size of the audio transfer buffer */ +#define OUT_BUF_MARGIN 0U +#define TOTAL_OUT_BUF_SIZE ((uint32_t)((SPEAKER_OUT_PACKET + OUT_BUF_MARGIN) * OUT_PACKET_NUM)) + +#define AD_CONFIG_DESC_SET_LEN (sizeof(usb_desc_config_set)) +#define AD_INTERFACE_DESC_SIZE 9U + +#define USB_AD_DESC_SIZ 0x09U +#define AD_STANDARD_EP_DESC_SIZE 0x09U +#define AD_STREAMING_EP_DESC_SIZE 0x07U + +/* audio interface class code */ +#define USB_CLASS_AUDIO 0x01U + +/* audio interface subclass codes */ +#define AD_SUBCLASS_CONTROL 0x01U +#define AD_SUBCLASS_AUDIOSTREAMING 0x02U +#define AD_SUBCLASS_MIDISTREAMING 0x03U + +/* audio interface protocol codes */ +#define AD_PROTOCOL_UNDEFINED 0x00U +#define AD_STREAMING_GENERAL 0x01U +#define AD_STREAMING_FORMAT_TYPE 0x02U + +/* audio class-specific descriptor types */ +#define AD_DESCTYPE_UNDEFINED 0x20U +#define AD_DESCTYPE_DEVICE 0x21U +#define AD_DESCTYPE_CONFIGURATION 0x22U +#define AD_DESCTYPE_STRING 0x23U +#define AD_DESCTYPE_INTERFACE 0x24U +#define AD_DESCTYPE_ENDPOINT 0x25U + +/* audio control interface descriptor subtypes */ +#define AD_CONTROL_HEADER 0x01U +#define AD_CONTROL_INPUT_TERMINAL 0x02U +#define AD_CONTROL_OUTPUT_TERMINAL 0x03U +#define AD_CONTROL_MIXER_UNIT 0x04U +#define AD_CONTROL_SELECTOR_UNIT 0x05U +#define AD_CONTROL_FEATURE_UNIT 0x06U +#define AD_CONTROL_PROCESSING_UNIT 0x07U +#define AD_CONTROL_EXTENSION_UNIT 0x08U + +#define AD_INPUT_TERMINAL_DESC_SIZE 0x0CU +#define AD_OUTPUT_TERMINAL_DESC_SIZE 0x09U +#define AD_STREAMING_INTERFACE_DESC_SIZE 0x07U + +#define AD_CONTROL_MUTE 0x01U +#define AD_CONTROL_VOLUME 0x02U + +#define AD_FORMAT_TYPE_I 0x01U +#define AD_FORMAT_TYPE_III 0x03U + +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01U +#define AD_ENDPOINT_GENERAL 0x01U + +#define AD_REQ_UNDEFINED 0x00U +#define AD_REQ_SET_CUR 0x01U +#define AD_REQ_GET_CUR 0x81U +#define AD_REQ_SET_MIN 0x02U +#define AD_REQ_GET_MIN 0x82U +#define AD_REQ_SET_MAX 0x03U +#define AD_REQ_GET_MAX 0x83U +#define AD_REQ_SET_RES 0x04U +#define AD_REQ_GET_RES 0x84U +#define AD_REQ_SET_MEM 0x05U +#define AD_REQ_GET_MEM 0x85U +#define AD_REQ_GET_STAT 0xFFU + +#define AD_OUT_STREAMING_CTRL 0x02U +#define AD_IN_STREAMING_CTRL 0x05U + +/* audio stream interface number */ +enum +{ + SPEAK_INTERFACE_COUNT, + CONFIG_DESC_AS_ITF_COUNT, +}; + +#define AC_ITF_TOTAL_LEN (sizeof(usb_desc_AC_itf) + CONFIG_DESC_AS_ITF_COUNT*(sizeof(usb_desc_input_terminal) + \ + sizeof(usb_desc_mono_feature_unit) + sizeof(usb_desc_output_terminal))) + +#pragma pack(1) + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< header descriptor subtype */ + uint16_t bcdADC; /*!< audio device class specification release number in binary-coded decimal */ + uint16_t wTotalLength; /*!< total number of bytes */ + uint8_t bInCollection; /*!< the number of the streaming interfaces */ + uint8_t baInterfaceNr; /*!< interface number of the streaming interfaces */ +} usb_desc_AC_itf; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< AS_GENERAL descriptor subtype */ + uint8_t bTerminalLink; /*!< the terminal ID */ + uint8_t bDelay; /*!< delay introduced by the data path */ + uint16_t wFormatTag; /*!< the audio data format */ +} usb_desc_AS_itf; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< INPUT_TERMINAL descriptor subtype. */ + uint8_t bTerminalID; /*!< constant uniquely identifying the terminal within the audio function */ + uint16_t wTerminalType; /*!< constant characterizing the type of terminal */ + uint8_t bAssocTerminal; /*!< ID of the output terminal */ + uint8_t bNrChannels; /*!< number of logical output channels */ + uint16_t wChannelConfig; /*!< describes the spatial location of the logical channels */ + uint8_t iChannelNames; /*!< index of a string descriptor */ + uint8_t iTerminal; /*!< index of a string descriptor */ +} usb_desc_input_terminal; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< OUTPUT_TERMINAL descriptor subtype */ + uint8_t bTerminalID; /*!< constant uniquely identifying the terminal within the audio function */ + uint16_t wTerminalType; /*!< constant characterizing the type of terminal */ + uint8_t bAssocTerminal; /*!< constant, identifying the input terminal to which this output terminal is associated */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t iTerminal; /*!< index of a string descriptor */ +} usb_desc_output_terminal; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FEATURE_UNIT descriptor subtype */ + uint8_t bUnitID; /*!< constant uniquely identifying the unit within the audio function */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t bControlSize; /*!< size in bytes of an element of the bmaControls() array */ + uint8_t bmaControls0; /*!< a bit set to 1 indicates that the mentioned control is supported for master channel 0 */ + uint8_t bmaControls1; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 1 */ + uint8_t iFeature; /*!< index of a string descriptor */ +} usb_desc_mono_feature_unit; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FEATURE_UNIT descriptor subtype */ + uint8_t bUnitID; /*!< constant uniquely identifying the unit within the audio function */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t bControlSize; /*!< size in bytes of an element of the bmaControls() array */ + uint16_t bmaControls0; /*!< a bit set to 1 indicates that the mentioned control is supported for master channel 0 */ + uint16_t bmaControls1; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 1 */ + uint16_t bmaControls2; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 2 */ + uint8_t iFeature; /*!< index of a string descriptor */ +} usb_desc_stereo_feature_unit; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FORMAT_TYPE descriptor subtype */ + uint8_t bFormatType; /*!< constant identifying the format type */ + uint8_t bNrChannels; /*!< indicates the number of physical channels in the audio data stream */ + uint8_t bSubFrameSize; /*!< the number of bytes occupied by one audio sub frame */ + uint8_t bBitResolution; /*!< the number of effectively used bits from the available bits in an audio sub frame */ + uint8_t bSamFreqType; /*!< indicates how the sampling frequency can be programmed */ + uint8_t bSamFreq[3]; /*!< sampling frequency ns in Hz for this isochronous data endpoint */ +} usb_desc_format_type; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bEndpointAddress; /*!< the address of the endpoint */ + uint8_t bmAttributes; /*!< transfer type and synchronization type */ + uint16_t wMaxPacketSize; /*!< maximum packet size this endpoint is capable of sending or receiving */ + uint8_t bInterval; /*!< left to the designer's discretion */ + uint8_t bRefresh; /*!< reset to 0 */ + uint8_t bSynchAddress; /*!< reset to 0 */ +} usb_desc_std_ep; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< EP_GENERAL descriptor subtype */ + uint8_t bmAttributes; /*!< transfer type and synchronization type */ + uint8_t bLockDelayUnits; /*!< indicates the units used for the wLockDelay field */ + uint16_t wLockDelay; /*!< indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry */ +} usb_desc_AS_ep; + +#pragma pack() + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf std_itf; + usb_desc_AC_itf ac_itf; + usb_desc_input_terminal in_terminal; + usb_desc_mono_feature_unit feature_unit; + usb_desc_output_terminal out_terminal; + usb_desc_itf std_as_itf_zeroband; + usb_desc_itf std_as_itf_opera; + usb_desc_AS_itf as_itf; + usb_desc_format_type format_typeI; + usb_desc_std_ep std_endpoint; + usb_desc_AS_ep as_endpoint; +} usb_desc_config_set; + +typedef struct +{ + /* main buffer for audio data out transfers and its relative pointers */ + uint8_t isoc_out_buff[TOTAL_OUT_BUF_SIZE * 2U]; + uint8_t* isoc_out_wrptr; + uint8_t* isoc_out_rdptr; + + uint16_t buf_free_size; + uint16_t dam_tx_len; + + /* usb receive buffer */ + uint8_t usb_rx_buffer[SPEAKER_OUT_MAX_PACKET]; + + /* main buffer for audio control requests transfers and its relative variables */ + uint8_t audioctl[64]; + uint8_t audioctl_unit; + uint32_t audioctl_len; + + uint32_t play_flag; +} usbd_audio_handler; + +extern usb_desc audio_desc; +extern usb_class audio_class; + +#endif /* __AUDIO_CORE_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_out_itf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_out_itf.h new file mode 100644 index 0000000..6e0fd83 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Include/audio_out_itf.h @@ -0,0 +1,48 @@ +/*! + \file audio_out_itf.h + \brief audio OUT (playback) interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __AUDIO_OUT_ITF_H +#define __AUDIO_OUT_ITF_H + +#include "usbd_conf.h" + +typedef struct { + uint8_t (*audio_init) (uint32_t audio_freq, uint32_t volume); + uint8_t (*audio_deinit) (uint32_t options); + uint8_t (*audio_cmd) (uint8_t* pbuf, uint32_t size, uint8_t cmd); +} audio_fops_struct; + +extern audio_fops_struct audio_out_fops; + +#endif /* __AUDIO_OUT_ITF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_core.c new file mode 100644 index 0000000..9bb7ed6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_core.c @@ -0,0 +1,622 @@ +/*! + \file audio_core.c + \brief USB audio device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "audio_out_itf.h" +#include "audio_core.h" + +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x9574U + +#define VOL_MIN 0U /* volume minimum value */ +#define VOL_MAX 100U /* volume maximum value */ +#define VOL_RES 1U /* volume resolution */ +#define VOL_0dB 70U /* 0dB is in the middle of VOL_MIN and VOL_MAX */ + +/* local function prototypes ('static') */ +static uint8_t audio_sof (usb_dev *udev); +static uint8_t audio_init (usb_dev *udev, uint8_t config_index); +static uint8_t audio_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t audio_req_handler (usb_dev *udev, usb_req *req); +static uint8_t audio_ctlx_out (usb_dev *udev); +static void audio_data_out (usb_dev *udev, uint8_t ep_num); + +static void audio_set_itf (usb_dev *udev, usb_req *req); + +usb_class audio_class = +{ + .init = audio_init, + .deinit = audio_deinit, + .req_process = audio_req_handler, + .ctlx_out = audio_ctlx_out, + .data_out = audio_data_out +}; + +usbd_int_cb_struct usb_inthandler = +{ + audio_sof, +}; + +/* note:it should use the c99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev audio_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +usb_desc_config_set audio_config_set = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = AD_CONFIG_DESC_SET_LEN, + .bNumInterfaces = 0x01U + CONFIG_DESC_AS_ITF_COUNT, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xC0U, + .bMaxPower = 0x32U + }, + + .std_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_CONTROL, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .ac_itf = + { + .header = + { + .bLength = sizeof(usb_desc_AC_itf), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = 0x01U, + .bcdADC = 0x0100U, + .wTotalLength = AC_ITF_TOTAL_LEN, + .bInCollection = CONFIG_DESC_AS_ITF_COUNT, + .baInterfaceNr = 0x01U + }, + + .in_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_input_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_INPUT_TERMINAL, + .bTerminalID = 0x01U, + .wTerminalType = 0x0101U, + .bAssocTerminal = 0x00U, + .bNrChannels = 0x02U, + .wChannelConfig = 0x0000U, + .iChannelNames = 0x00U, + .iTerminal = 0x00U + }, + + .feature_unit = + { + .header = + { + .bLength = sizeof(usb_desc_mono_feature_unit), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_FEATURE_UNIT, + .bUnitID = AD_OUT_STREAMING_CTRL, + .bSourceID = 0x01U, + .bControlSize = 0x01U, + .bmaControls0 = AD_CONTROL_MUTE | AD_CONTROL_VOLUME, + .bmaControls1 = 0x00U, + .iFeature = 0x00U + }, + + .out_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_output_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_OUTPUT_TERMINAL, + .bTerminalID = 0x03U, + .wTerminalType = 0x0301U, + .bAssocTerminal = 0x00U, + .bSourceID = 0x02U, + .iTerminal = 0x00U + }, + + .std_as_itf_zeroband = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .std_as_itf_opera = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x01U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .as_itf = + { + .header = + { + .bLength = sizeof(usb_desc_AS_itf), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_GENERAL, + .bTerminalLink = 0x01U, + .bDelay = 0x01U, + .wFormatTag = 0x0001U, + }, + + .format_typeI = + { + .header = + { + .bLength = sizeof(usb_desc_format_type), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_FORMAT_TYPE, + .bFormatType = AD_FORMAT_TYPE_III, + .bNrChannels = SPEAKER_OUT_CHANNEL_NBR, + .bSubFrameSize = 0x02U, + .bBitResolution = SPEAKER_OUT_BIT_RESOLUTION, + .bSamFreqType = 0x01U, + .bSamFreq[0] = (uint8_t)USBD_SPEAKER_FREQ, + .bSamFreq[1] = USBD_SPEAKER_FREQ >> 8, + .bSamFreq[2] = USBD_SPEAKER_FREQ >> 16 + }, + + .std_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_std_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = AD_OUT_EP, + .bmAttributes = USB_ENDPOINT_TYPE_ISOCHRONOUS, + .wMaxPacketSize = SPEAKER_OUT_PACKET, + .bInterval = 0x01U, + .bRefresh = 0x00U, + .bSynchAddress = 0x00U + }, + + .as_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_AS_ep), + .bDescriptorType = AD_DESCTYPE_ENDPOINT + }, + .bDescriptorSubtype = AD_ENDPOINT_GENERAL, + .bmAttributes = 0x00U, + .bLockDelayUnits = 0x00U, + .wLockDelay = 0x0000U, + } +}; + +/* USB language ID descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(14U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'A', 'u', 'd', 'i', 'o'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor */ +static uint8_t* usbd_audio_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc audio_desc = { + .dev_desc = (uint8_t *)&audio_dev_desc, + .config_desc = (uint8_t *)&audio_config_set, + .strings = usbd_audio_strings +}; + +/*! + \brief initialize the audio device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_init (usb_dev *udev, uint8_t config_index) +{ + usb_desc_std_ep std_ep = audio_config_set.std_endpoint; + + static usbd_audio_handler audio_handler; + + memset((void *)&audio_handler, 0, sizeof(usbd_audio_handler)); + + usb_desc_ep ep = { + .header = std_ep.header, + .bEndpointAddress = std_ep.bEndpointAddress, + .bmAttributes = std_ep.bmAttributes, + .wMaxPacketSize = std_ep.wMaxPacketSize, + .bInterval = std_ep.bInterval + }; + + /* initialize RX endpoint */ + usbd_ep_init(udev, EP_BUF_DBL, AD_BUF_ADDR, &ep); + + usbd_int_fops = &usb_inthandler; + + audio_handler.isoc_out_rdptr = audio_handler.isoc_out_buff; + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + + /* initialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_init(USBD_SPEAKER_FREQ, DEFAULT_VOLUME)) { + return USBD_FAIL; + } + + udev->ep_transc[AD_OUT_EP][TRANSC_OUT] = audio_class.data_out; + + /* prepare out endpoint to receive audio data */ + usbd_ep_recev (udev, AD_OUT_EP, (uint8_t*)audio_handler.usb_rx_buffer, SPEAKER_OUT_MAX_PACKET); + + udev->class_data[USBD_AD_INTERFACE] = (void *)&audio_handler; + + return USBD_OK; +} + +/*! + \brief de-initialize the audio device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize audio endpoints */ + usbd_ep_deinit(udev, AD_OUT_EP); + + /* deinitialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_deinit(0U)) { + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle the audio class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + usbd_audio_handler *audio = (usbd_audio_handler *)udev->class_data[USBD_AD_INTERFACE]; + + switch (req->bRequest) { + case USB_SET_INTERFACE: + audio_set_itf(udev, req); + break; + + case AD_REQ_GET_CUR: + usb_transc_config(&udev->transc_in[0], audio->audioctl, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case AD_REQ_SET_CUR: + if (req->wLength) { + usb_transc_config(&udev->transc_out[0], audio->audioctl, req->wLength, 0U); + + udev->class_core->req_cmd = AD_REQ_SET_CUR; + + audio->audioctl_len = req->wLength; + audio->audioctl_unit = BYTE_HIGH(req->wIndex); + + status = REQ_SUPP; + } + break; + + case AD_REQ_GET_MIN: + audio->audioctl[0] = VOL_MIN; + usb_transc_config(&udev->transc_in[0], audio->audioctl, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case AD_REQ_GET_MAX: + audio->audioctl[0] = VOL_MAX; + usb_transc_config(&udev->transc_in[0], audio->audioctl, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case AD_REQ_GET_RES: + audio->audioctl[0] = VOL_RES; + usb_transc_config(&udev->transc_in[0], audio->audioctl, req->wLength, 0U); + + status = REQ_SUPP; + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle the audio set interface requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static void audio_set_itf(usb_dev *udev, usb_req *req) +{ + usbd_audio_handler *audio = (usbd_audio_handler *)udev->class_data[USBD_AD_INTERFACE]; + + if (0xFF != req->wValue){ + if (0 != req->wValue){ + /* deinit audio handler */ + memset((void *)audio, 0, sizeof(usbd_audio_handler)); + + audio->play_flag = 0; + audio->isoc_out_rdptr = audio->isoc_out_buff; + audio->isoc_out_wrptr = audio->isoc_out_buff; + } else { + /* stop audio output */ + audio_out_fops.audio_cmd(audio->isoc_out_rdptr, SPEAKER_OUT_PACKET / 2, AD_CMD_STOP); + + audio->play_flag = 0; + audio->isoc_out_rdptr = audio->isoc_out_buff; + audio->isoc_out_wrptr = audio->isoc_out_buff; + } + } +} + +/*! + \brief handles the audio out data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static void audio_data_out (usb_dev *udev, uint8_t ep_num) +{ + usbd_audio_handler *audio = (usbd_audio_handler *)udev->class_data[USBD_AD_INTERFACE]; + + if (AD_OUT_EP == ep_num) { + uint16_t usb_rx_length, tail_len; + + /* get receive length */ + usb_rx_length = udev->transc_out[ep_num].xfer_count; + + if (audio->isoc_out_wrptr >= audio->isoc_out_rdptr) { + audio->buf_free_size = TOTAL_OUT_BUF_SIZE + audio->isoc_out_rdptr - audio->isoc_out_wrptr; + } else { + audio->buf_free_size = audio->isoc_out_rdptr - audio->isoc_out_wrptr; + } + + /* free buffer enough to save rx data */ + if (audio->buf_free_size > usb_rx_length) { + if (audio->isoc_out_wrptr >= audio->isoc_out_rdptr) { + tail_len = audio->isoc_out_buff + TOTAL_OUT_BUF_SIZE - audio->isoc_out_wrptr; + + if(tail_len >= usb_rx_length){ + memcpy(audio->isoc_out_wrptr, audio->usb_rx_buffer, usb_rx_length); + + /* increment the buffer pointer */ + audio->isoc_out_wrptr += usb_rx_length; + + /* increment the Buffer pointer or roll it back when all buffers are full */ + if (audio->isoc_out_wrptr >= (audio->isoc_out_buff + TOTAL_OUT_BUF_SIZE)) { + /* all buffers are full: roll back */ + audio->isoc_out_wrptr = audio->isoc_out_buff; + } + } else { + memcpy(audio->isoc_out_wrptr, audio->usb_rx_buffer, tail_len); + + /* adjust write pointer */ + audio->isoc_out_wrptr = audio->isoc_out_buff; + + memcpy(audio->isoc_out_wrptr, &audio->usb_rx_buffer[tail_len], usb_rx_length - tail_len); + + /* adjust write pointer */ + audio->isoc_out_wrptr += usb_rx_length - tail_len; + } + } else { + memcpy(audio->isoc_out_wrptr, audio->usb_rx_buffer, usb_rx_length); + + /* increment the buffer pointer */ + audio->isoc_out_wrptr += usb_rx_length; + } + } + + /* prepare out endpoint to receive next audio packet */ + usbd_ep_recev (udev, AD_OUT_EP, audio->usb_rx_buffer, SPEAKER_OUT_MAX_PACKET); + + if (audio->isoc_out_wrptr >= audio->isoc_out_rdptr) { + audio->buf_free_size = TOTAL_OUT_BUF_SIZE + audio->isoc_out_rdptr - audio->isoc_out_wrptr; + } else { + audio->buf_free_size = audio->isoc_out_rdptr - audio->isoc_out_wrptr; + } + + if ((0U == audio->play_flag) && (audio->buf_free_size < TOTAL_OUT_BUF_SIZE / 2)) { + /* enable start of streaming */ + audio->play_flag = 1U; + + /* initialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_cmd(audio->isoc_out_rdptr, SPEAKER_OUT_MAX_PACKET / 2, AD_CMD_PLAY)) { + return; + } + + audio->dam_tx_len = SPEAKER_OUT_MAX_PACKET; + } + } +} + +/*! + \brief handles audio control request data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_ctlx_out (usb_dev *udev) +{ + usbd_audio_handler *audio = (usbd_audio_handler *)udev->class_data[USBD_AD_INTERFACE]; + + /* check if an audio_control request has been issued */ + if (AD_REQ_SET_CUR == udev->class_core->req_cmd) { + /* in this driver, to simplify code, only SET_CUR request is managed */ + + /* check for which addressed unit the audio_control request has been issued */ + if (AD_OUT_STREAMING_CTRL == audio->audioctl_unit) { + /* in this driver, to simplify code, only one unit is manage */ + + /* reset the audioctl_cmd variable to prevent re-entering this function */ + udev->class_core->req_cmd = 0U; + + audio->audioctl_len = 0U; + } + } + + return USBD_OK; +} + +/*! + \brief handles the SOF event (data buffer update and synchronization) + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_sof (usb_dev *udev) +{ + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_out_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_out_itf.c new file mode 100644 index 0000000..a44fa78 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/audio/Source/audio_out_itf.c @@ -0,0 +1,168 @@ +/*! + \file audio_out_itf.c + \brief audio OUT (playback) interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "audio_core.h" +#include "audio_out_itf.h" + +/* local function prototypes ('static') */ +static uint8_t init (uint32_t audio_freq, uint32_t volume); +static uint8_t deinit (uint32_t options); +static uint8_t audio_cmd (uint8_t* pbuf, uint32_t size, uint8_t cmd); + +audio_fops_struct audio_out_fops = +{ + .audio_init = init, + .audio_deinit = deinit, + .audio_cmd = audio_cmd, +}; + +static uint8_t audio_state = AD_STATE_INACTIVE; + +/*! + \brief initialize and configure all required resources for audio play function + \param[in] audio_freq: statrt_up audio frequency + \param[in] volume: start_up volume to be set + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t init (uint32_t audio_freq, uint32_t volume) +{ + static uint32_t initialized = 0U; + + /* check if the low layer has already been initialized */ + if (0U == initialized) { + /* initialize GPIO */ + codec_gpio_init(); + + /* initialize i2s */ + codec_audio_interface_init(audio_freq); + + /* initialize DMA */ + codec_i2s_dma_init(); + + /* set the initialization flag to prevent reinitializing the interface again */ + initialized = 1U; + } + + /* update the audio state machine */ + audio_state = AD_STATE_ACTIVE; + + return AD_OK; +} + +/*! + \brief free all resources used by low layer and stops audio-play function + \param[in] options: specific options passed to low layer function + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t deinit (uint32_t options) +{ + /* update the audio state machine */ + audio_state = AD_STATE_INACTIVE; + + return AD_OK; +} + +/*! + \brief play, stop, pause or resume current file + \param[in] pbuf: address from which file should be played + \param[in] size: size of the current buffer/file + \param[in] cmd: command to be executed, can be: + \arg AD_CMD_PLAY + \arg AD_CMD_PAUSE + \arg AD_CMD_STOP + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t audio_cmd (uint8_t* pbuf, uint32_t size, uint8_t cmd) +{ + /* check the current state */ + if ((AD_STATE_INACTIVE == audio_state) || (AD_STATE_ERROR == audio_state)) { + audio_state = AD_STATE_ERROR; + + return AD_FAIL; + } + + switch (cmd) { + /* process the play command */ + case AD_CMD_PLAY: + /* if current state is active or stopped */ + if ((AD_STATE_ACTIVE == audio_state) || \ + (AD_STATE_STOPPED == audio_state) || \ + (AD_STATE_PLAYING == audio_state)) { + audio_play((uint32_t)pbuf, size); + audio_state = AD_STATE_PLAYING; + + return AD_OK; + } else if (AD_STATE_PAUSED == audio_state) { + audio_pause_resume(AD_RESUME, (uint32_t)pbuf, (size/2)); + audio_state = AD_STATE_PLAYING; + + return AD_OK; + } else { + return AD_FAIL; + } + + /* process the stop command */ + case AD_CMD_STOP: + if (AD_STATE_PLAYING != audio_state) { + /* unsupported command */ + return AD_FAIL; + } else { + audio_stop(); + audio_state = AD_STATE_STOPPED; + + return AD_OK; + } + + /* process the pause command */ + case AD_CMD_PAUSE: + if (AD_STATE_PLAYING != audio_state) { + /* unsupported command */ + return AD_FAIL; + } else { + audio_pause_resume(AD_PAUSE, (uint32_t)pbuf, (size/2)); + audio_state = AD_STATE_PAUSED; + + return AD_OK; + } + + /* unsupported command */ + default: + break; + } + + return AD_FAIL; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Include/cdc_acm_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Include/cdc_acm_core.h new file mode 100644 index 0000000..5b67d5c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Include/cdc_acm_core.h @@ -0,0 +1,164 @@ +/*! + \file cdc_acm_core.h + \brief the header file of CDC ACM driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __CDC_ACM_CORE_H +#define __CDC_ACM_CORE_H + +#include "usbd_enum.h" + +/* communications device class code */ +#define USB_CLASS_CDC 0x02U + +/* CDC subclass code */ +#define USB_CDC_SUBCLASS_DLCM 0x01U +#define USB_CDC_SUBCLASS_ACM 0x02U + +/* communications interface class control protocol codes */ +#define USB_CDC_PROTOCOL_NONE 0x00U +#define USB_CDC_PROTOCOL_AT 0x01U + +/* data interface class code */ +#define USB_CLASS_DATA 0x0AU + +#define USB_DESCTYPE_CDC_ACM 0x21U +#define USB_DESCTYPE_CS_INTERFACE 0x24U + +#define USB_CDC_ACM_CONFIG_DESC_SIZE 0x43U + +/* class-specific notification codes for PSTN subclasses */ +#define USB_CDC_NOTIFY_SERIAL_STATE 0x20U + +/* class-specific request codes */ +#define SEND_ENCAPSULATED_COMMAND 0x00U +#define GET_ENCAPSULATED_RESPONSE 0x01U +#define SET_COMM_FEATURE 0x02U +#define GET_COMM_FEATURE 0x03U +#define CLEAR_COMM_FEATURE 0x04U +#define SET_LINE_CODING 0x20U +#define GET_LINE_CODING 0x21U +#define SET_CONTROL_LINE_STATE 0x22U +#define SEND_BREAK 0x23U +#define NO_CMD 0xFFU + +#pragma pack(1) + +/* CDC ACM line coding structure */ +typedef struct { + uint32_t dwDTERate; /*!< data terminal rate */ + uint8_t bCharFormat; /*!< format bits */ + uint8_t bParityType; /*!< parity */ + uint8_t bDataBits; /*!< data bits */ +} acm_line; + +/* notification structure */ +typedef struct { + uint8_t bmRequestType; /*!< type of request */ + uint8_t bNotification; /*!< communication interface class notifications */ + uint16_t wValue; /*!< value of notification */ + uint16_t wIndex; /*!< index of interface */ + uint16_t wLength; /*!< length of notification data */ +} acm_notification; + +/* header function structure */ +typedef struct { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: header function descriptor */ + uint16_t bcdCDC; /*!< bcdCDC: low byte of spec release number (CDC1.10) */ +} usb_desc_header_func; + +/* call management function structure */ +typedef struct { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: call management function descriptor */ + uint8_t bmCapabilities; /*!< bmCapabilities: D0 is reset, D1 is ignored */ + uint8_t bDataInterface; /*!< bDataInterface: 1 interface used for call management */ +} usb_desc_call_managment_func; + +/* ACM function structure */ +typedef struct { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: abstract control management descriptor */ + uint8_t bmCapabilities; /*!< bmCapabilities: D1 */ +} usb_desc_acm_func; + +/* union function structure */ +typedef struct { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: union function descriptor */ + uint8_t bMasterInterface; /*!< bMasterInterface: communication class interface */ + uint8_t bSlaveInterface0; /*!< bSlaveInterface0: data class interface */ +} usb_desc_union_func; + +#pragma pack() + +/* configuration descriptor structure */ +typedef struct { + usb_desc_config config; + usb_desc_itf cmd_itf; + usb_desc_header_func cdc_header; + usb_desc_call_managment_func cdc_call_managment; + usb_desc_acm_func cdc_acm; + usb_desc_union_func cdc_union; + usb_desc_ep cdc_cmd_endpoint; + usb_desc_itf cdc_data_interface; + usb_desc_ep cdc_out_endpoint; + usb_desc_ep cdc_in_endpoint; +} usb_cdc_desc_config_set; + +#define USB_CDC_RX_LEN 64U + +typedef struct { + uint8_t pre_packet_send; + uint8_t packet_sent; + uint8_t packet_receive; + + uint8_t data[USB_CDC_RX_LEN]; + + uint32_t receive_length; + + acm_line line_coding; +} usb_cdc_handler; + +extern usb_desc cdc_desc; +extern usb_class cdc_class; + +/* function declarations */ +/* receive CDC ACM data */ +void cdc_acm_data_receive(usb_dev *udev); +/* send CDC ACM data */ +void cdc_acm_data_send(usb_dev *udev); +/* check CDC ACM is ready for data transfer */ +uint8_t cdc_acm_check_ready(usb_dev *udev); + +#endif /* __CDC_ACM_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Source/cdc_acm_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Source/cdc_acm_core.c new file mode 100644 index 0000000..acb0845 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/cdc/Source/cdc_acm_core.c @@ -0,0 +1,509 @@ +/*! + \file cdc_acm_core.c + \brief CDC ACM driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "cdc_acm_core.h" + +#define USBD_VID 0x28E9U +#define USBD_PID 0x018AU + +/* note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev cdc_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = USB_CLASS_CDC, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +usb_cdc_desc_config_set cdc_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG, + }, + .wTotalLength = USB_CDC_ACM_CONFIG_DESC_SIZE, + .bNumInterfaces = 0x02U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .cmd_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_CLASS_CDC, + .bInterfaceSubClass = USB_CDC_SUBCLASS_ACM, + .bInterfaceProtocol = USB_CDC_PROTOCOL_AT, + .iInterface = 0x00U + }, + + .cdc_header = + { + .header = + { + .bLength = sizeof(usb_desc_header_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x00U, + .bcdCDC = 0x0110U + }, + + .cdc_call_managment = + { + .header = + { + .bLength = sizeof(usb_desc_call_managment_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x01U, + .bmCapabilities = 0x00U, + .bDataInterface = 0x01U + }, + + .cdc_acm = + { + .header = + { + .bLength = sizeof(usb_desc_acm_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x02U, + .bmCapabilities = 0x02U, + }, + + .cdc_union = + { + .header = + { + .bLength = sizeof(usb_desc_union_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x06U, + .bMasterInterface = 0x00U, + .bSlaveInterface0 = 0x01U, + }, + + .cdc_cmd_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP, + }, + .bEndpointAddress = CDC_CMD_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = CDC_ACM_CMD_PACKET_SIZE, + .bInterval = 0x0AU + }, + + .cdc_data_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF, + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_DATA, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = USB_CDC_PROTOCOL_NONE, + .iInterface = 0x00U + }, + + .cdc_out_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP, + }, + .bEndpointAddress = CDC_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00U + }, + + .cdc_in_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = CDC_ACM_DATA_PACKET_SIZE, + .bInterval = 0x00U + } +}; + +/* USB language ID descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'C', 'D', 'C', '_', 'A', 'C', 'M'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +uint8_t* usbd_cdc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc cdc_desc = { + .dev_desc = (uint8_t *)&cdc_dev_desc, + .config_desc = (uint8_t *)&cdc_config_desc, + .strings = usbd_cdc_strings +}; + +/* local function prototypes ('static') */ +static uint8_t cdc_acm_init (usb_dev *udev, uint8_t config_index); +static uint8_t cdc_acm_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t cdc_acm_req_handler (usb_dev *udev, usb_req *req); +static uint8_t cdc_acm_ctlx_out (usb_dev *udev); +static void cdc_acm_data_in (usb_dev *udev, uint8_t ep_num); +static void cdc_acm_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class cdc_class = { + .req_cmd = NO_CMD, + + .init = cdc_acm_init, + .deinit = cdc_acm_deinit, + .req_process = cdc_acm_req_handler, + .ctlx_out = cdc_acm_ctlx_out, + .data_in = cdc_acm_data_in, + .data_out = cdc_acm_data_out +}; + +/*! + \brief receive CDC ACM data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void cdc_acm_data_receive(usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + cdc->packet_receive = 0U; + cdc->pre_packet_send = 0U; + + usbd_ep_recev(udev, CDC_OUT_EP, (uint8_t*)(cdc->data), USB_CDC_RX_LEN); +} + +/*! + \brief send CDC ACM data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void cdc_acm_data_send (usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + uint32_t data_len = cdc->receive_length; + + if ((0U != data_len) && (1U == cdc->packet_sent)) { + cdc->packet_sent = 0U; + usbd_ep_send(udev, CDC_IN_EP, (uint8_t*)(cdc->data), (uint16_t)data_len); + cdc->receive_length = 0U; + } +} + +/*! + \brief check CDC ACM is ready for data transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval 0 if CDC is ready, 5 otherwise +*/ +uint8_t cdc_acm_check_ready(usb_dev *udev) +{ + if (udev->class_data[CDC_COM_INTERFACE] != NULL) { + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + if ((1U == cdc->packet_receive) && (1U == cdc->pre_packet_send)) { + return 0U; + } + } + + return 5U; +} + +/*! + \brief initialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_init (usb_dev *udev, uint8_t config_index) +{ + static usb_cdc_handler cdc_handler; + + /* initialize the data endpoints */ + usbd_ep_init(udev, EP_BUF_SNG, BULK_TX_ADDR, &(cdc_config_desc.cdc_in_endpoint)); + usbd_ep_init(udev, EP_BUF_SNG, BULK_RX_ADDR, &(cdc_config_desc.cdc_out_endpoint)); + + /* initialize the command endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, INT_TX_ADDR, &(cdc_config_desc.cdc_cmd_endpoint)); + + udev->ep_transc[EP_ID(CDC_IN_EP)][TRANSC_IN] = cdc_class.data_in; + udev->ep_transc[CDC_OUT_EP][TRANSC_OUT] = cdc_class.data_out; + + /* initialize CDC handler structure */ + cdc_handler.packet_receive = 0U; + cdc_handler.packet_sent = 1U; + cdc_handler.pre_packet_send = 1U; + cdc_handler.receive_length = 0U; + + cdc_handler.line_coding = (acm_line){ + .dwDTERate = 115200U, + .bCharFormat = 0U, + .bParityType = 0U, + .bDataBits = 0x08U + }; + + udev->class_data[CDC_COM_INTERFACE] = (void *)&cdc_handler; + + return USBD_OK; +} + +/*! + \brief deinitialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize the data endpoints */ + usbd_ep_deinit(udev, CDC_IN_EP); + usbd_ep_deinit(udev, CDC_OUT_EP); + + /* deinitialize the command endpoint */ + usbd_ep_deinit(udev, CDC_CMD_EP); + + return USBD_OK; +} + +/*! + \brief command data received on control endpoint + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_ctlx_out (usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + if (NO_CMD != udev->class_core->req_cmd) { + cdc->packet_receive = 1U; + cdc->pre_packet_send = 1U; + + udev->class_core->req_cmd = NO_CMD; + } + + return USBD_OK; +} + +/*! + \brief handle CDC ACM data in transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void cdc_acm_data_in (usb_dev *udev, uint8_t ep_num) +{ + usb_transc *transc = &udev->transc_in[ep_num]; + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + if (transc->xfer_count == transc->max_len) { + usbd_ep_send(udev, EP_ID(ep_num), NULL, 0U); + } else { + cdc->packet_sent = 1U; + cdc->pre_packet_send = 1U; + } +} + +/*! + \brief handle CDC ACM data out transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void cdc_acm_data_out (usb_dev *udev, uint8_t ep_num) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + cdc->packet_receive = 1U; + + cdc->receive_length = udev->transc_out[ep_num].xfer_count; +} + +/*! + \brief handle the CDC ACM class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP, noti_buf[10] = {0U}; + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE]; + + acm_notification *notif = (void *)noti_buf; + + switch (req->bRequest) { + case SEND_ENCAPSULATED_COMMAND: + break; + + case GET_ENCAPSULATED_RESPONSE: + break; + + case SET_COMM_FEATURE: + break; + + case GET_COMM_FEATURE: + break; + + case CLEAR_COMM_FEATURE: + break; + + case SET_LINE_CODING: + /* set the value of the current command to be processed */ + udev->class_core->req_cmd = req->bRequest; + + usb_transc_config(&udev->transc_out[0U], (uint8_t *)&cdc->line_coding, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case GET_LINE_CODING: + usb_transc_config(&udev->transc_in[0U], (uint8_t *)&cdc->line_coding, 7U, 0U); + + status = REQ_SUPP; + break; + + case SET_CONTROL_LINE_STATE: + notif->bmRequestType = 0xA1U; + notif->bNotification = USB_CDC_NOTIFY_SERIAL_STATE; + notif->wIndex = 0U; + notif->wValue = 0U; + notif->wLength = 2U; + noti_buf[8] = (uint8_t)req->wValue & 3U; + noti_buf[9] = 0U; + + status = REQ_SUPP; + break; + + case SEND_BREAK: + break; + + default: + break; + } + + return status; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_core.h new file mode 100644 index 0000000..a30ac10 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_core.h @@ -0,0 +1,184 @@ +/*! + \file dfu_core.h + \brief the header file of USB DFU device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DFU_CORE_H +#define __DFU_CORE_H + +#include "usbd_enum.h" + +/* DFU class code */ +#define USB_DFU_CLASS 0xFEU + +/* DFU subclass code */ +#define USB_DFU_SUBCLASS_UPGRADE 0x01U + +/* DFU protocol code */ +#define USB_DFU_PROTOCL_RUNTIME 0x01U +#define USB_DFU_PROTOCL_DFU 0x02U + +/* manifestation state */ +#define MANIFEST_COMPLETE 0x00U +#define MANIFEST_IN_PROGRESS 0x01U + +/* DFU attributes code */ +#define USB_DFU_CAN_DOWNLOAD 0x01U +#define USB_DFU_CAN_UPLOAD 0x02U +#define USB_DFU_MANIFEST_TOLERANT 0x04U +#define USB_DFU_WILL_DETACH 0x08U + +/* special commands with download request */ +#define GET_COMMANDS 0x00U +#define SET_ADDRESS_POINTER 0x21U +#define ERASE 0x41U + +/* memory operation command */ +#define CMD_ERASE 0U +#define CMD_WRITE 1U + +#define _BYTE1(x) (uint8_t)((x) & 0xFFU) /*!< addressing cycle 1st byte */ +#define _BYTE2(x) (uint8_t)(((x) & 0xFF00U) >> 8U) /*!< addressing cycle 2nd byte */ +#define _BYTE3(x) (uint8_t)(((x) & 0xFF0000U) >> 16U) /*!< addressing cycle 3rd byte */ + +#define SET_POLLING_TIMEOUT(x) do { \ + dfu->bwPollTimeout0 = _BYTE1(x);\ + dfu->bwPollTimeout1 = _BYTE2(x);\ + dfu->bwPollTimeout2 = _BYTE3(x);\ + } while(0) + +#define FLASH_ERASE_TIMEOUT 60U +#define FLASH_WRITE_TIMEOUT 80U + +/* bit detach capable = bit 3 in bmAttributes field */ +#define DFU_DETACH_MASK (uint8_t)(0x10U) +#define USB_DFU_CONFIG_DESC_SIZE (18U + (9U * USBD_ITF_MAX_NUM)) +#define DFU_DESC_TYPE 0x21U + +/* DFU device state enumeration */ +typedef enum +{ + STATE_APP_IDLE = 0x00U, + STATE_APP_DETACH, + STATE_DFU_IDLE, + STATE_DFU_DNLOAD_SYNC, + STATE_DFU_DNBUSY, + STATE_DFU_DNLOAD_IDLE, + STATE_DFU_MANIFEST_SYNC, + STATE_DFU_MANIFEST, + STATE_DFU_MANIFEST_WAIT_RESET, + STATE_DFU_UPLOAD_IDLE, + STATE_DFU_ERROR +} dfu_state; + +/* DFU device status enumeration */ +typedef enum +{ + STATUS_OK = 0x00U, + STATUS_ERR_TARGET, + STATUS_ERR_FILE, + STATUS_ERR_WRITE, + STATUS_ERR_ERASE, + STATUS_ERR_CHECK_ERASED, + STATUS_ERR_PROG, + STATUS_ERR_VERIFY, + STATUS_ERR_ADDRESS, + STATUS_ERR_NOTDONE, + STATUS_ERR_FIRMWARE, + STATUS_ERR_VENDOR, + STATUS_ERR_USBR, + STATUS_ERR_POR, + STATUS_ERR_UNKNOWN, + STATUS_ERR_STALLEDPKT +} dfu_status; + +/* DFU class-specific requests enumeration */ +typedef enum +{ + DFU_DETACH = 0U, + DFU_DNLOAD, + DFU_UPLOAD, + DFU_GETSTATUS, + DFU_CLRSTATUS, + DFU_GETSTATE, + DFU_ABORT, + DFU_REQ_MAX +} dfu_requests; + +#pragma pack(1) + +/* USB DFU function descriptor structure */ +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bmAttributes; /*!< DFU attributes */ + uint16_t wDetachTimeOut; /*!< time, in milliseconds, that the device will wait after receipt of the DFU_DETACH request. */ + uint16_t wTransferSize; /*!< maximum number of bytes that the device can accept per control-write transaction */ + uint16_t bcdDFUVersion; /*!< numeric expression identifying the version of the DFU specification release */ +} usb_desc_dfu_func; + +#pragma pack() + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf dfu_itf0; + usb_desc_itf dfu_itf1; + usb_desc_itf dfu_itf2; + usb_desc_dfu_func dfu_func; +} usb_dfu_desc_config_set; + +/* USB DFU handler structure */ +typedef struct +{ + uint8_t bStatus; + uint8_t bwPollTimeout0; + uint8_t bwPollTimeout1; + uint8_t bwPollTimeout2; + uint8_t bState; + uint8_t iString; + + uint8_t manifest_state; + uint32_t data_len; + uint16_t block_num; + uint32_t base_addr; + + uint8_t buf[TRANSFER_SIZE]; +} usbd_dfu_handler; + +typedef void (*app_func) (void); + +extern usb_desc dfu_desc; +extern usb_class dfu_class; + +#endif /* __DFU_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_mem.h new file mode 100644 index 0000000..f25858f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Include/dfu_mem.h @@ -0,0 +1,84 @@ +/*! + \file dfu_mem.h + \brief USB DFU device media access layer header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DFU_MEM_H +#define __DFU_MEM_H + +#include "usbd_conf.h" + +typedef struct _dfu_mem_prop +{ + const uint8_t* pstr_desc; + + uint8_t (*mem_init) (void); + uint8_t (*mem_deinit) (void); + uint8_t (*mem_erase) (uint32_t addr); + uint8_t (*mem_write) (uint8_t *buf, uint32_t addr, uint32_t len); + uint8_t* (*mem_read) (uint8_t *buf, uint32_t addr, uint32_t len); + uint8_t (*mem_checkaddr) (uint32_t addr); + + const uint32_t erase_timeout; + const uint32_t write_timeout; +} dfu_mem_prop; + +typedef enum +{ + MEM_OK = 0, + MEM_FAIL +} mem_status; + +#define _1ST_BYTE(x) (uint8_t)((x) & 0xFF) /*!< addressing cycle 1st byte */ +#define _2ND_BYTE(x) (uint8_t)(((x) & 0xFF00) >> 8) /*!< addressing cycle 2nd byte */ +#define _3RD_BYTE(x) (uint8_t)(((x) & 0xFF0000) >> 16) /*!< addressing cycle 3rd byte */ + +#define POLLING_TIMEOUT_SET(x) buffer[0] = _1ST_BYTE(x);\ + buffer[1] = _2ND_BYTE(x);\ + buffer[2] = _3RD_BYTE(x); + +/* function declarations */ +/* initialize the memory media on the GD32 */ +uint8_t dfu_mem_init(void); +/* deinitialize the memory media on the GD32 */ +uint8_t dfu_mem_deinit(void); +/* erase a memory sector */ +uint8_t dfu_mem_erase(uint32_t addr); +/* write data to sectors of memory */ +uint8_t dfu_mem_write(uint8_t *buf, uint32_t addr, uint32_t len); +/* read data from sectors of memory */ +uint8_t* dfu_mem_read(uint8_t *buf, uint32_t addr, uint32_t len); +/* get the status of a given memory and store in buffer */ +uint8_t dfu_mem_getstatus(uint32_t addr, uint8_t cmd, uint8_t *buffer); + +#endif /* __DFU_MEM_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_core.c new file mode 100644 index 0000000..0c70ef1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_core.c @@ -0,0 +1,746 @@ +/*! + \file dfu_core.c + \brief USB DFU device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_core.h" +#include "systick.h" +#include "dfu_mem.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x0189U + +/* local function prototypes ('static') */ +static uint8_t dfu_init (usb_dev *udev, uint8_t config_index); +static uint8_t dfu_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t dfu_req_handler (usb_dev *udev, usb_req *req); +static uint8_t dfu_ctlx_in (usb_dev *udev); + +/* DFU requests management functions */ +static void dfu_detach (usb_dev *udev, usb_req *req); +static void dfu_dnload (usb_dev *udev, usb_req *req); +static void dfu_upload (usb_dev *udev, usb_req *req); +static void dfu_getstatus (usb_dev *udev, usb_req *req); +static void dfu_clrstatus (usb_dev *udev, usb_req *req); +static void dfu_getstate (usb_dev *udev, usb_req *req); +static void dfu_abort (usb_dev *udev, usb_req *req); +static void string_to_unicode (uint8_t *str, uint16_t *pbuf); + +static void dfu_mode_leave (usb_dev *udev); +static uint8_t dfu_getstatus_complete (usb_dev *udev); + +extern dfu_mem_prop dfu_inter_flash_cb; +extern dfu_mem_prop dfu_nor_flash_cb; +extern dfu_mem_prop dfu_nand_flash_cb; + +static void (*dfu_request_process[])(usb_dev *udev, usb_req *req) = +{ + [DFU_DETACH] = dfu_detach, + [DFU_DNLOAD] = dfu_dnload, + [DFU_UPLOAD] = dfu_upload, + [DFU_GETSTATUS] = dfu_getstatus, + [DFU_CLRSTATUS] = dfu_clrstatus, + [DFU_GETSTATE] = dfu_getstate, + [DFU_ABORT] = dfu_abort +}; + +/* note:it should use the c99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev dfu_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +usb_dfu_desc_config_set dfu_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = sizeof(usb_dfu_desc_config_set), + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .dfu_itf0 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF0 + }, + + .dfu_itf1 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x01U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF1 + }, + + .dfu_itf2 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x02U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF2 + }, + + .dfu_func = + { + .header = + { + .bLength = sizeof(usb_desc_dfu_func), + .bDescriptorType = DFU_DESC_TYPE + }, + .bmAttributes = USB_DFU_CAN_DOWNLOAD | USB_DFU_CAN_UPLOAD | USB_DFU_WILL_DETACH, + .wDetachTimeOut = 0x00FFU, + .wTransferSize = TRANSFER_SIZE, + .bcdDFUVersion = 0x0110U, + }, +}; + +/* USB language ID descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'D', 'F', 'U'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB configure string */ +static usb_desc_str config_string = +{ + .header = + { + .bLength = USB_STRING_LEN(15U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', ' ', 'U', 'S', 'B', ' ', 'C', 'O', 'N', 'F', 'I', 'G'} +}; + +/* alternate interface 0 string */ +static usb_desc_str interface_string0 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; +/* alternate interface 1 string */ +static usb_desc_str interface_string1 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; + +/* alternate interface 2 string */ +static usb_desc_str interface_string2 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; + +uint8_t* usbd_dfu_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string, + [STR_IDX_CONFIG] = (uint8_t *)&config_string, + [STR_IDX_ALT_ITF0] = (uint8_t *)&interface_string0, + [STR_IDX_ALT_ITF1] = (uint8_t *)&interface_string1, + [STR_IDX_ALT_ITF2] = (uint8_t *)&interface_string2 +}; + +usb_desc dfu_desc = { + .dev_desc = (uint8_t *)&dfu_dev_desc, + .config_desc = (uint8_t *)&dfu_config_desc, + .strings = usbd_dfu_strings +}; + +usb_class dfu_class = { + .init = dfu_init, + .deinit = dfu_deinit, + .req_process = dfu_req_handler, + .ctlx_in = dfu_ctlx_in +}; + +/*! + \brief initialize the USB DFU device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_init (usb_dev *udev, uint8_t config_index) +{ + static usbd_dfu_handler dfu_handler; + + /* unlock the internal flash */ + dfu_mem_init(); + + systick_config(); + + memset((void *)&dfu_handler, 0, sizeof(usbd_dfu_handler)); + + dfu_handler.base_addr = APP_LOADED_ADDR; + dfu_handler.manifest_state = MANIFEST_COMPLETE; + dfu_handler.bState = STATE_DFU_IDLE; + dfu_handler.bStatus = STATUS_OK; + + udev->class_data[USBD_DFU_INTERFACE] = (void *)&dfu_handler; + + /* create interface string */ + string_to_unicode((uint8_t *)dfu_inter_flash_cb.pstr_desc, (uint16_t *)udev->desc->strings[STR_IDX_ALT_ITF0]); + string_to_unicode((uint8_t *)dfu_nor_flash_cb.pstr_desc, (uint16_t *)udev->desc->strings[STR_IDX_ALT_ITF1]); + string_to_unicode((uint8_t *)dfu_nand_flash_cb.pstr_desc, (uint16_t *)udev->desc->strings[STR_IDX_ALT_ITF2]); + return USBD_OK; +} + +/*! + \brief deinitialize the USB DFU device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_deinit (usb_dev *udev, uint8_t config_index) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + /* restore device default state */ + memset(udev->class_data[USBD_DFU_INTERFACE], 0, sizeof(usbd_dfu_handler)); + + dfu->bState = STATE_DFU_IDLE; + dfu->bStatus = STATUS_OK; + + /* lock the internal flash */ + dfu_mem_deinit(); + + return USBD_OK; +} + +/*! + \brief handle the USB DFU class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_req_handler (usb_dev *udev, usb_req *req) +{ + if (req->bRequest < DFU_REQ_MAX) { + dfu_request_process[req->bRequest](udev, req); + } else { + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle data stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_ctlx_in (usb_dev *udev) +{ + dfu_getstatus_complete(udev); + + return USBD_OK; +} + +/*! + \brief handle data in stage in control endpoint 0 + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status + */ +static uint8_t dfu_getstatus_complete (usb_dev *udev) +{ + uint32_t addr; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + if (STATE_DFU_DNBUSY == dfu->bState) { + /* decode the special command */ + if (0U == dfu->block_num) { + if (1U == dfu->data_len){ + if (GET_COMMANDS == dfu->buf[0]) { + /* no operation */ + } + } else if (5U == dfu->data_len) { + if (SET_ADDRESS_POINTER == dfu->buf[0]) { + /* set flash operation address */ + dfu->base_addr = *(uint32_t *)(dfu->buf + 1U); + } else if (ERASE == dfu->buf[0]) { + dfu->base_addr = *(uint32_t *)(dfu->buf + 1U); + + dfu_mem_erase(dfu->base_addr); + } else { + /* no operation */ + } + } else { + /* no operation */ + } + } else if (dfu->block_num > 1U) { /* regular download command */ + /* decode the required address */ + addr = (dfu->block_num - 2U) * TRANSFER_SIZE + dfu->base_addr; + + dfu_mem_write (dfu->buf, addr, dfu->data_len); + + dfu->block_num = 0U; + } else { + /* no operation */ + } + + dfu->data_len = 0U; + + /* update the device state and poll timeout */ + dfu->bState = STATE_DFU_DNLOAD_SYNC; + + return USBD_OK; + } else if (STATE_DFU_MANIFEST == dfu->bState) { /* manifestation in progress */ + /* start leaving DFU mode */ + dfu_mode_leave(udev); + } else { + /* no operation */ + } + + return USBD_OK; +} + +/*! + \brief handle the DFU_DETACH request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none. +*/ +static void dfu_detach(usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_SYNC: + case STATE_DFU_DNLOAD_IDLE: + case STATE_DFU_MANIFEST_SYNC: + case STATE_DFU_UPLOAD_IDLE: + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + dfu->iString = 0U; /* iString */ + + dfu->block_num = 0U; + dfu->data_len = 0U; + break; + + default: + break; + } + + /* check the detach capability in the DFU functional descriptor */ + if (dfu_config_desc.dfu_func.wDetachTimeOut & DFU_DETACH_MASK) { + usbd_disconnect(udev); + + usbd_connect(udev); + } else { + /* wait for the period of time specified in detach request */ + delay_1ms(4U); + } +} + +/*! + \brief handle the DFU_DNLOAD request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_dnload(usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->transc_out[0]; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_IDLE: + if (req->wLength > 0U) { + /* update the global length and block number */ + dfu->block_num = req->wValue; + dfu->data_len = req->wLength; + + dfu->bState = STATE_DFU_DNLOAD_SYNC; + + transc->xfer_len = dfu->data_len; + transc->xfer_buf = dfu->buf; + transc->xfer_count = 0U; + } else { + dfu->manifest_state = MANIFEST_IN_PROGRESS; + dfu->bState = STATE_DFU_MANIFEST_SYNC; + } + break; + + default: + break; + } +} + +/*! + \brief handles the DFU_UUPLOAD request. + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_upload (usb_dev *udev, usb_req *req) +{ + uint8_t *phy_addr = NULL; + uint32_t addr = 0U; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + if(req->wLength <= 0U) { + dfu->bState = STATE_DFU_IDLE; + + return; + } + + usb_transc *transc = &udev->transc_in[0]; + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_UPLOAD_IDLE: + /* update the global length and block number */ + dfu->block_num = req->wValue; + dfu->data_len = req->wLength; + + /* DFU get command */ + if (0U == dfu->block_num) { + /* update the state machine */ + dfu->bState = (dfu->data_len > 3U) ? STATE_DFU_IDLE : STATE_DFU_UPLOAD_IDLE; + + /* store the values of all supported commands */ + dfu->buf[0] = GET_COMMANDS; + dfu->buf[1] = SET_ADDRESS_POINTER; + dfu->buf[2] = ERASE; + + /* send the status data over EP0 */ + transc->xfer_buf = &(dfu->buf[0]); + transc->xfer_len = 3U; + } else if (dfu->block_num > 1U) { + dfu->bState = STATE_DFU_UPLOAD_IDLE; + + /* change is accelerated */ + addr = (dfu->block_num - 2U) * TRANSFER_SIZE + dfu->base_addr; + + /* return the physical address where data are stored */ + // phy_addr = (uint8_t *)(addr); + + /* return the physical address where data are stored */ + phy_addr = dfu_mem_read (dfu->buf, addr, dfu->data_len); + + /* send the status data over EP0 */ + transc->xfer_buf = phy_addr; + transc->xfer_len = dfu->data_len; + } else { + dfu->bState = STATUS_ERR_STALLEDPKT; + } + break; + + default: + dfu->data_len = 0U; + dfu->block_num = 0U; + break; + } +} + +/*! + \brief handle the DFU_GETSTATUS request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_getstatus (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->transc_in[0]; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_DNLOAD_SYNC: + if (0U != dfu->data_len) { + dfu->bState = STATE_DFU_DNBUSY; + + if (0U == dfu->block_num) { + if (ERASE == dfu->buf[0]) { + SET_POLLING_TIMEOUT(FLASH_ERASE_TIMEOUT); + } else { + SET_POLLING_TIMEOUT(FLASH_WRITE_TIMEOUT); + } + } + } else { + dfu->bState = STATE_DFU_DNLOAD_IDLE; + } + break; + + case STATE_DFU_MANIFEST_SYNC: + if (MANIFEST_IN_PROGRESS == dfu->manifest_state) { + dfu->bState = STATE_DFU_MANIFEST; + dfu->bwPollTimeout0 = 1U; + } else if ((MANIFEST_COMPLETE == dfu->manifest_state) && \ + (dfu_config_desc.dfu_func.bmAttributes & 0x04U)){ + dfu->bState = STATE_DFU_IDLE; + dfu->bwPollTimeout0 = 0U; + } else { + /* no operation */ + } + break; + + default: + break; + } + + /* send the status data of DFU interface to host over EP0 */ + transc->xfer_buf = (uint8_t *)&(dfu->bStatus); + transc->xfer_len = 6U; +} + +/*! + \brief handle the DFU_CLRSTATUS request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_clrstatus (usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + if (STATE_DFU_ERROR == dfu->bState) { + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + } else { + /* state error */ + dfu->bStatus = STATUS_ERR_UNKNOWN; + dfu->bState = STATE_DFU_ERROR; + } + + dfu->iString = 0U; /* iString: index = 0 */ +} + +/*! + \brief handle the DFU_GETSTATE request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_getstate (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->transc_in[0]; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + /* send the current state of the DFU interface to host */ + transc->xfer_buf = &(dfu->bState); + transc->xfer_len = 1U; +} + +/*! + \brief handle the DFU_ABORT request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_abort (usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState){ + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_SYNC: + case STATE_DFU_DNLOAD_IDLE: + case STATE_DFU_MANIFEST_SYNC: + case STATE_DFU_UPLOAD_IDLE: + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + dfu->iString = 0U; /* iString: index = 0 */ + + dfu->block_num = 0U; + dfu->data_len = 0U; + break; + + default: + break; + } +} + +/*! + \brief convert string value into unicode char + \param[in] str: pointer to plain string + \param[in] pbuf: buffer pointer to store unicode char + \param[out] none + \retval none +*/ +static void string_to_unicode (uint8_t *str, uint16_t *pbuf) +{ + uint8_t index = 0; + + if (str != NULL) { + pbuf[index++] = ((strlen((const char *)str) * 2U + 2U) & 0x00FFU) | ((USB_DESCTYPE_STR << 8U) & 0xFF00); + + while (*str != '\0') { + pbuf[index++] = *str++; + } + } +} + +/*! + \brief leave DFU mode and reset device to jump to user loaded code + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void dfu_mode_leave (usb_dev *udev) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->class_data[USBD_DFU_INTERFACE]; + + dfu->manifest_state = MANIFEST_COMPLETE; + + if (dfu_config_desc.dfu_func.bmAttributes & 0x04U) { + dfu->bState = STATE_DFU_MANIFEST_SYNC; + } else { + dfu->bState = STATE_DFU_MANIFEST_WAIT_RESET; + + /* lock the internal flash */ + dfu_mem_deinit(); + + /* generate system reset to allow jumping to the user code */ + NVIC_SystemReset(); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_mem.c new file mode 100644 index 0000000..c1b8b69 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/dfu/Source/dfu_mem.c @@ -0,0 +1,250 @@ +/*! + \file dfu_mem.c + \brief USB DFU device media access layer functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_mem.h" +#include "usbd_transc.h" +#include "nor_flash_if.h" +#include "nand_flash_if.h" +#include "inter_flash_if.h" + +extern usb_dev usb_dfu; +extern dfu_mem_prop dfu_inter_flash_cb; +extern dfu_mem_prop dfu_nor_flash_cb; +extern dfu_mem_prop dfu_nand_flash_cb; + +extern struct { + uint8_t buf[TRANSFER_SIZE]; + uint16_t data_len; + uint16_t block_num; + uint32_t base_addr; +} prog; + +dfu_mem_prop* mem_tab[MAX_USED_MEMORY_MEDIA] = +{ + &dfu_inter_flash_cb, + &dfu_nor_flash_cb, + &dfu_nand_flash_cb, +}; + +/* The list of memory interface string descriptor pointers. This list + can be updated whenever a memory has to be added or removed */ +const uint8_t* USBD_DFU_StringDesc[MAX_USED_MEMORY_MEDIA] = +{ + (const uint8_t *)INTER_FLASH_IF_STR, + (const uint8_t *)NOR_FLASH_IF_STR, + (const uint8_t *)NAND_FLASH_IF_STR +}; + +static uint8_t dfu_mem_checkaddr (uint32_t addr); + +/*! + \brief initialize the memory media on the GD32 + \param[in] none + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_init (void) +{ + uint32_t mem_index = 0U; + + /* initialize all supported memory medias */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* check if the memory media exists */ + if (NULL != mem_tab[mem_index]->mem_init) { + mem_tab[mem_index]->mem_init(); + } + } + + return MEM_OK; +} + +/*! + \brief deinitialize the memory media on the GD32 + \param[in] none + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_deinit (void) +{ + uint32_t mem_index = 0U; + + /* deinitialize all supported memory medias */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* check if the memory media exists */ + if (NULL != mem_tab[mem_index]->mem_deinit) { + mem_tab[mem_index]->mem_deinit(); + } + } + + return MEM_OK; +} + +/*! + \brief erase a memory sector + \param[in] addr: memory sector address/code + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_erase (uint32_t addr) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return MEM_FAIL; + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_erase) { + return mem_tab[mem_index]->mem_erase(addr); + } else { + return MEM_FAIL; + } + } else { + return MEM_FAIL; + } +} + +/*! + \brief write data to sectors of memory + \param[in] buf: the data buffer to be write + \param[in] addr: memory sector address/code + \param[in] len: data length + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return MEM_FAIL; + } + + if (OB_RDPT == (addr & MAL_MASK_OB)) { + option_byte_write(addr, buf); + + NVIC_SystemReset(); + + return MEM_OK; + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_write) { + return mem_tab[mem_index]->mem_write(buf, addr, len); + } else { + return MEM_FAIL; + } + } else { + return MEM_FAIL; + } +} + +/*! + \brief read data from sectors of memory + \param[in] buf: the data buffer to be write + \param[in] addr: memory sector address/code + \param[in] len: data length + \param[out] none + \retval pointer to buffer +*/ +uint8_t* dfu_mem_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t mem_index = 0U; + + if (OB_RDPT != addr) { + mem_index = dfu_mem_checkaddr(addr); + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_read) { + return mem_tab[mem_index]->mem_read(buf, addr, len); + } else { + return buf; + } + } else { + return buf; + } +} + +/*! + \brief get the status of a given memory and store in buffer + \param[in] addr: memory sector address/code + \param[in] cmd: 0 for erase and 1 for write + \param[in] buffer: pointer to the buffer where the status data will be stored + \param[out] none + \retval MEM_OK if all operations are OK, MEM_FAIL else +*/ +uint8_t dfu_mem_getstatus (uint32_t addr, uint8_t cmd, uint8_t *buffer) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + if (cmd & 0x01U) { + POLLING_TIMEOUT_SET(mem_tab[mem_index]->write_timeout); + } else { + POLLING_TIMEOUT_SET(mem_tab[mem_index]->erase_timeout); + } + + return MEM_OK; + } else { + return MEM_FAIL; + } +} + +/*! + \brief check the address is supported + \param[in] addr: memory sector address/code + \param[out] none + \retval index of the addressed memory +*/ +static uint8_t dfu_mem_checkaddr (uint32_t addr) +{ + uint8_t mem_index = 0U; + + /* check with all supported memories */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* if the check address is supported, return the memory index */ + if (MEM_OK == mem_tab[mem_index]->mem_checkaddr(addr)) { + return mem_index; + } + } + + /* if there is no memory found, return MAX_USED_MEMORY_MEDIA */ + return (MAX_USED_MEMORY_MEDIA); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/custom_hid_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/custom_hid_core.h new file mode 100644 index 0000000..4ad03e1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/custom_hid_core.h @@ -0,0 +1,68 @@ +/*! + \file custom_hid_core.h + \brief definitions for HID core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __CUSTOM_HID_CORE_H +#define __CUSTOM_HID_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define DESC_LEN_REPORT 96U +#define DESC_LEN_CONFIG 41U + +#define MAX_PERIPH_NUM 4U + +typedef struct +{ + uint8_t data[2]; + + uint8_t reportID; + uint8_t idlestate; + uint8_t protocol; +} custom_hid_handler; + +typedef struct { + void (*periph_config[MAX_PERIPH_NUM])(void); +} hid_fop_handler; + +extern usb_desc custom_hid_desc; +extern usb_class custom_hid_class; + +/* function declarations */ +/* register HID interface operation functions */ +uint8_t custom_hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop); +/* send custom HID report */ +uint8_t custom_hid_report_send (usb_dev *udev, uint8_t *report, uint16_t len); + +#endif /* __CUSTOM_HID_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/standard_hid_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/standard_hid_core.h new file mode 100644 index 0000000..c76b247 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/standard_hid_core.h @@ -0,0 +1,67 @@ +/*! + \file standard_hid_core.h + \brief definitions for HID core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __STANDARD_HID_CORE_H +#define __STANDARD_HID_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define USB_HID_CONFIG_DESC_LEN 0x22U +#define USB_HID_REPORT_DESC_LEN 0x2EU + +typedef struct +{ + uint32_t protocol; + uint32_t idle_state; + uint8_t data[HID_IN_PACKET]; + __IO uint8_t prev_transfer_complete; +} standard_hid_handler; + +typedef struct +{ + void (*hid_itf_config) (void); + void (*hid_itf_data_process) (usb_dev *udev); +} hid_fop_handler; + +extern usb_desc hid_desc; +extern usb_class hid_class; + +/* function declarations */ +/* register HID interface operation functions */ +uint8_t hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop); +/* send HID report */ +uint8_t hid_report_send (usb_dev *udev, uint8_t *report, uint16_t len); + +#endif /* __STANDARD_HID_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/usb_hid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/usb_hid.h new file mode 100644 index 0000000..ba48a21 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Include/usb_hid.h @@ -0,0 +1,83 @@ +/*! + \file usb_hid.h + \brief definitions for the USB HID class + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_HID_H +#define __USB_HID_H + +#include "usb_ch9_std.h" + +#define USB_HID_CLASS 0x03U + +#define USB_DESCTYPE_HID 0x21U +#define USB_DESCTYPE_REPORT 0x22U + +/* HID subclass code */ +#define USB_HID_SUBCLASS_BOOT_ITF 0x01U + +/* HID protocol codes */ +#define USB_HID_PROTOCOL_KEYBOARD 0x01U +#define USB_HID_PROTOCOL_MOUSE 0x02U + +#define GET_REPORT 0x01U +#define GET_IDLE 0x02U +#define GET_PROTOCOL 0x03U +#define SET_REPORT 0x09U +#define SET_IDLE 0x0AU +#define SET_PROTOCOL 0x0BU + +#pragma pack(1) + +typedef struct +{ + usb_desc_header header; /*!< regular descriptor header containing the descriptor's type and length */ + + uint16_t bcdHID; /*!< BCD encoded version that the HID descriptor and device complies to */ + uint8_t bCountryCode; /*!< country code of the localized device, or zero if universal */ + uint8_t bNumDescriptors; /*!< total number of HID report descriptors for the interface */ + uint8_t bDescriptorType; /*!< type of HID report */ + uint16_t wDescriptorLength; /*!< length of the associated HID report descriptor, in bytes */ +} usb_desc_hid; + +#pragma pack() + +typedef struct +{ + usb_desc_config config; + usb_desc_itf hid_itf; + usb_desc_hid hid_vendor; + usb_desc_ep hid_epin; + usb_desc_ep hid_epout; +} usb_hid_desc_config_set; + +#endif /* __USB_HID_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/custom_hid_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/custom_hid_core.c new file mode 100644 index 0000000..ad2eb8f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/custom_hid_core.c @@ -0,0 +1,509 @@ +/*! + \file custom_hid_core.c + \brief custom HID class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "custom_hid_core.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x128AU + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev custom_hid_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configure descriptor */ +usb_hid_desc_config_set custom_hid_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = DESC_LEN_CONFIG, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = 0x00U, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = DESC_LEN_REPORT, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = CUSTOMHID_IN_PACKET, + .bInterval = 0x20U + }, + + .hid_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_OUT_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = CUSTOMHID_OUT_PACKET, + .bInterval = 0x20U + } +}; + +/* USB language ID descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(14U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'C', 'u', 's', 't', 'o', 'm', 'H', 'I', 'D'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +static uint8_t* usbd_hid_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc custom_hid_desc = +{ + .dev_desc = (uint8_t *)&custom_hid_dev_desc, + .config_desc = (uint8_t *)&custom_hid_config_desc, + .strings = usbd_hid_strings +}; + +/* local function prototypes ('static') */ +static uint8_t custom_hid_init (usb_dev *udev, uint8_t config_index); +static uint8_t custom_hid_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t custom_hid_req_handler (usb_dev *udev, usb_req *req); +static void custom_hid_data_in (usb_dev *udev, uint8_t ep_num); +static void custom_hid_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class custom_hid_class = { + .req_cmd = 0xFFU, + + .init = custom_hid_init, + .deinit = custom_hid_deinit, + .req_process = custom_hid_req_handler, + .data_in = custom_hid_data_in, + .data_out = custom_hid_data_out +}; + +const uint8_t customhid_report_descriptor[DESC_LEN_REPORT] = +{ + 0x06, 0x00, 0xFF, /* USAGE_PAGE (Vendor Defined: 0xFF00) */ + 0x09, 0x00, /* USAGE (Custom Device) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + /* led 1 */ + 0x85, 0x11, /* REPORT_ID (0x11) */ + 0x09, 0x01, /* USAGE (LED 1) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 2 */ + 0x85, 0x12, /* REPORT_ID (0x12) */ + 0x09, 0x02, /* USAGE (LED 2) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 3 */ + 0x85, 0x13, /* REPORT_ID (0x13) */ + 0x09, 0x03, /* USAGE (LED 3) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 4 */ + 0x85, 0x14, /* REPORT_ID (0x14) */ + 0x09, 0x04, /* USAGE (LED 4) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* wakeup key */ + 0x85, 0x15, /* REPORT_ID (0x15) */ + 0x09, 0x05, /* USAGE (Push Button) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs,Vol) */ + + 0x75, 0x07, /* REPORT_SIZE (7) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs,Vol) */ + + /* tamper key */ + 0x85, 0x16, /* REPORT_ID (0x16) */ + 0x09, 0x06, /* USAGE (Push Button) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs,Vol) */ + + 0x75, 0x07, /* REPORT_SIZE (7) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs,Vol) */ + + 0xc0 /* END_COLLECTION */ +}; + +/*! + \brief register HID interface operation functions + \param[in] udev: pointer to USB device instance + \param[in] hid_fop: HID operation functions structure + \param[out] none + \retval USB device operation status +*/ +uint8_t custom_hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop) +{ + if (NULL != hid_fop) { + udev->user_data = hid_fop; + + return USBD_OK; + } + + return USBD_FAIL; +} + +/*! + \brief send custom HID report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t custom_hid_report_send (usb_dev *udev, uint8_t *report, uint16_t len) +{ + usbd_ep_send (udev, CUSTOMHID_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_init (usb_dev *udev, uint8_t config_index) +{ + static custom_hid_handler hid_handler; + + memset((void *)&hid_handler, 0, sizeof(custom_hid_handler)); + + /* initialize the data endpoints */ + usbd_ep_init(udev, EP_BUF_SNG, HID_TX_ADDR, &(custom_hid_config_desc.hid_epin)); + usbd_ep_init(udev, EP_BUF_SNG, HID_RX_ADDR, &(custom_hid_config_desc.hid_epout)); + + usbd_ep_recev (udev, CUSTOMHID_OUT_EP, hid_handler.data, 2U); + + udev->ep_transc[EP_ID(CUSTOMHID_IN_EP)][TRANSC_IN] = custom_hid_class.data_in; + udev->ep_transc[EP_ID(CUSTOMHID_OUT_EP)][TRANSC_OUT] = custom_hid_class.data_out; + + udev->class_data[CUSTOM_HID_INTERFACE] = (void *)&hid_handler; + + if (udev->user_data != NULL) { + for (uint8_t i = 0U; i < MAX_PERIPH_NUM; i++) { + if (((hid_fop_handler *)udev->user_data)->periph_config[i] != NULL) { + ((hid_fop_handler *)udev->user_data)->periph_config[i](); + } + } + } + + return USBD_OK; +} + +/*! + \brief de-initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize HID endpoints */ + usbd_ep_deinit(udev, CUSTOMHID_IN_EP); + usbd_ep_deinit(udev, CUSTOMHID_OUT_EP); + + return USBD_OK; +} + +/*! + \brief handle the HID class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + custom_hid_handler *hid = (custom_hid_handler *)udev->class_data[CUSTOM_HID_INTERFACE]; + + switch (req->bRequest) { + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8U)) { + usb_transc_config(&udev->transc_in[0], + (uint8_t *)customhid_report_descriptor, + USB_MIN(DESC_LEN_REPORT, req->wLength), + 0U); + + status = REQ_SUPP; + } else if (USB_DESCTYPE_HID == (req->wValue >> 8U)) { + usb_transc_config(&udev->transc_in[0U], + (uint8_t *)(&(custom_hid_config_desc.hid_vendor)), + USB_MIN(9U, req->wLength), + 0U); + } + break; + + case GET_REPORT: + if (2U == req->wLength) { + usb_transc_config(&udev->transc_in[0], hid->data, 2U, 0U); + + status = REQ_SUPP; + } + break; + + case GET_IDLE: + usb_transc_config(&udev->transc_in[0], (uint8_t *)&hid->idlestate, 1U, 0U); + + status = REQ_SUPP; + break; + + case GET_PROTOCOL: + usb_transc_config(&udev->transc_in[0], (uint8_t *)&hid->protocol, 1U, 0U); + + status = REQ_SUPP; + break; + + case SET_REPORT: + hid->reportID = (uint8_t)(req->wValue); + + usb_transc_config(&udev->transc_out[0], hid->data, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case SET_IDLE: + hid->idlestate = (uint8_t)(req->wValue >> 8); + + status = REQ_SUPP; + break; + + case SET_PROTOCOL: + hid->protocol = (uint8_t)(req->wValue); + + status = REQ_SUPP; + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle custom HID data in transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void custom_hid_data_in (usb_dev *udev, uint8_t ep_num) +{ + return; +} + +/*! + \brief handle custom HID data out transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void custom_hid_data_out (usb_dev *udev, uint8_t ep_num) +{ + custom_hid_handler *hid = (custom_hid_handler *)udev->class_data[CUSTOM_HID_INTERFACE]; + + if (CUSTOMHID_OUT_EP == ep_num){ + switch (hid->data[0]){ + case 0x11: + if (RESET != hid->data[1]) { + /* turn on led5 */ + gd_eval_led_on(LED5); + } else { + gd_eval_led_off(LED5); + } + break; + case 0x12: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + break; + case 0x13: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } + break; + case 0x14: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED4); + } else { + gd_eval_led_off(LED4); + } + break; + default: + /* turn off all leds */ + gd_eval_led_off(LED2); + gd_eval_led_off(LED3); + gd_eval_led_off(LED4); + gd_eval_led_off(LED5); + break; + } + + usbd_ep_recev(udev, CUSTOMHID_OUT_EP, hid->data, 2U); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/standard_hid_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/standard_hid_core.c new file mode 100644 index 0000000..f5b4dff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/hid/Source/standard_hid_core.c @@ -0,0 +1,429 @@ +/*! + \file standard_hid_core.c + \brief HID class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "standard_hid_core.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x0380U + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev hid_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, +#ifdef LPM_ENABLED + .bcdUSB = 0x0201U, +#else + .bcdUSB = 0x0200U, +#endif /* LPM_ENABLED */ + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +#ifdef LPM_ENABLED + +/* BOS descriptor */ +uint8_t USBD_BOSDesc[USB_BOS_DESC_LEN] = +{ + 0x05, + USB_DESCTYPE_BOS, + 0x0C, + 0x00, + 0x01, /* 1 device capability descriptor */ + + /* device capability*/ + 0x07, + USB_DEVICE_CAPABITY, + 0x02, + 0x06, /* LPM capability bit set */ + 0x00, + 0x00, + 0x00 +}; + +#endif /* LPM_ENABLED */ + +usb_hid_desc_config_set hid_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_HID_CONFIG_DESC_LEN, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xA0U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = USB_HID_SUBCLASS_BOOT_ITF, + .bInterfaceProtocol = USB_HID_PROTOCOL_KEYBOARD, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = USB_HID_REPORT_DESC_LEN, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = HID_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = HID_IN_PACKET, + .bInterval = 0x40U + } +}; + +/* USB language ID Descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(17U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +static uint8_t* usbd_hid_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc hid_desc = +{ +#ifdef LPM_ENABLED + .bos_desc = (uint8_t *)&USBD_BOSDesc, +#endif /* LPM_ENABLED */ + .dev_desc = (uint8_t *)&hid_dev_desc, + .config_desc = (uint8_t *)&hid_config_desc, + .strings = usbd_hid_strings +}; + +/* local function prototypes ('static') */ +static uint8_t hid_init (usb_dev *udev, uint8_t config_index); +static uint8_t hid_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t hid_req_handler (usb_dev *udev, usb_req *req); +static void hid_data_in_handler (usb_dev *udev, uint8_t ep_num); + +usb_class hid_class = +{ + .init = hid_init, + .deinit = hid_deinit, + .req_process = hid_req_handler, + .data_in = hid_data_in_handler +}; + +const uint8_t hid_report_desc[USB_HID_REPORT_DESC_LEN] = +{ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x06, /* USAGE (Keyboard) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + 0x05, 0x07, /* USAGE_PAGE (Keyboard/Keypad) */ + 0x19, 0xe0, /* USAGE_MINIMUM (Keyboard LeftControl) */ + 0x29, 0xe7, /* USAGE_MAXIMUM (Keyboard Right GUI) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x95, 0x08, /* REPORT_COUNT (8) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs) */ + + 0x95, 0x06, /* REPORT_COUNT (6) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255) */ + 0x05, 0x07, /* USAGE_PAGE (Keyboard/Keypad) */ + 0x19, 0x00, /* USAGE_MINIMUM (Reserved (no event indicated)) */ + 0x29, 0x65, /* USAGE_MAXIMUM (Keyboard Application) */ + 0x81, 0x00, /* INPUT (Data,Ary,Abs) */ + + 0xc0 /* END_COLLECTION */ +}; + +/*! + \brief register HID interface operation functions + \param[in] udev: pointer to USB device instance + \param[in] hid_fop: HID operation functions structure + \param[out] none + \retval USB device operation status +*/ +uint8_t hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop) +{ + if (NULL != hid_fop) { + udev->user_data = (void *)hid_fop; + + return USBD_OK; + } + + return USBD_FAIL; +} + +/*! + \brief send HID report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t hid_report_send (usb_dev *udev, uint8_t *report, uint16_t len) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->class_data[USBD_HID_INTERFACE]; + + /* check if USB is configured */ + hid->prev_transfer_complete = 0U; + + usbd_ep_send(udev, HID_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_init (usb_dev *udev, uint8_t config_index) +{ + static standard_hid_handler hid_handler; + + memset((void *)&hid_handler, 0, sizeof(standard_hid_handler)); + + /* initialize TX endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, INT_TX_ADDR, &(hid_config_desc.hid_epin)); + + udev->ep_transc[EP_ID(HID_IN_EP)][TRANSC_IN] = hid_class.data_in; + + hid_handler.prev_transfer_complete = 1U; + + udev->class_data[USBD_HID_INTERFACE] = (void *)&hid_handler; + + if (NULL != udev->user_data) { + ((hid_fop_handler *)udev->user_data)->hid_itf_config(); + } + + return USBD_OK; +} + +/*! + \brief deinitialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize HID endpoints */ + usbd_ep_deinit (udev, HID_IN_EP); + + return USBD_OK; +} + +/*! + \brief handle the HID class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + standard_hid_handler *hid = (standard_hid_handler *)udev->class_data[USBD_HID_INTERFACE]; + + switch (req->bRequest) { + case GET_REPORT: + /* no use for this driver */ + break; + + case GET_IDLE: + usb_transc_config(&udev->transc_in[0U], (uint8_t *)&hid->idle_state, 1U, 0U); + + status = REQ_SUPP; + break; + + case GET_PROTOCOL: + usb_transc_config(&udev->transc_in[0U], (uint8_t *)&hid->protocol, 1U, 0U); + + status = REQ_SUPP; + break; + + case SET_REPORT: + /* no use for this driver */ + break; + + case SET_IDLE: + hid->idle_state = (uint8_t)(req->wValue >> 8); + + status = REQ_SUPP; + break; + + case SET_PROTOCOL: + hid->protocol = (uint8_t)(req->wValue); + + status = REQ_SUPP; + break; + + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8)) { + usb_transc_config(&udev->transc_in[0U], + (uint8_t *)hid_report_desc, + USB_MIN(USB_HID_REPORT_DESC_LEN, req->wLength), + 0U); + + status = REQ_SUPP; + } else if (USB_DESCTYPE_HID == (req->wValue >> 8U)) { + usb_transc_config(&udev->transc_in[0U], + (uint8_t *)(&(hid_config_desc.hid_vendor)), + USB_MIN(9U, req->wLength), + 0U); + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle data stage in DATA IN transaction + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval none +*/ +static void hid_data_in_handler (usb_dev *udev, uint8_t ep_num) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->class_data[USBD_HID_INTERFACE]; + + if (hid->data[2]) { + hid->data[2] = 0x00U; + + usbd_ep_send(udev, HID_IN_EP, hid->data, HID_IN_PACKET); + } else { + hid->prev_transfer_complete = 1U; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Include/usb_iap_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Include/usb_iap_core.h new file mode 100644 index 0000000..a46c59e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Include/usb_iap_core.h @@ -0,0 +1,82 @@ +/*! + \file usb_iap_core.h + \brief the header file of IAP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_IAP_CORE_H +#define __USB_IAP_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define USB_DESC_LEN_IAP_REPORT 35U +#define USB_DESC_LEN_IAP_CONFIG_SET 41U + +/* special commands with download request */ +#define IAP_OPTION_BYTE 0x01U +#define IAP_ERASE 0x02U +#define IAP_DNLOAD 0x03U +#define IAP_LEAVE 0x04U +#define IAP_GETBIN_ADDRESS 0x05U + +typedef void (*app_func) (void); + +typedef struct +{ + uint8_t report_buf[IAP_OUT_PACKET + 1U]; + uint8_t option_byte[IAP_IN_PACKET]; + + /* state machine variables */ + uint8_t dev_status[IAP_IN_PACKET]; + uint8_t bin_addr[IAP_IN_PACKET]; + + uint8_t reportID; + uint8_t flag; + + uint32_t protocol; + uint32_t idlestate; + + uint16_t transfer_times; + uint16_t page_count; + uint16_t lps; /* last packet size */ + uint32_t file_length; + uint32_t base_address; +} usbd_iap_handler; + +extern usb_desc iap_desc; +extern usb_class iap_class; + +/* function declarations */ +/* send IAP report */ +uint8_t iap_report_send(usb_dev *udev, uint8_t *report, uint16_t len); + +#endif /* __USB_IAP_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Source/usb_iap_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Source/usb_iap_core.c new file mode 100644 index 0000000..9ac3c2e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/iap/Source/usb_iap_core.c @@ -0,0 +1,596 @@ +/*! + \file usb_iap_core.c + \brief IAP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "usb_iap_core.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x028BU + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +usb_desc_dev iap_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configure descriptor */ +usb_hid_desc_config_set iap_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_DESC_LEN_IAP_CONFIG_SET, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = 0x01U, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = USB_DESC_LEN_IAP_REPORT, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = IAP_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = IAP_IN_PACKET, + .bInterval = 0x01U + }, + + .hid_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = IAP_OUT_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = IAP_OUT_PACKET, + .bInterval = 0x01U + } +}; + +/* USB language ID Descriptor */ +usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'I', 'A', 'P'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +uint8_t* usbd_iap_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc iap_desc = { + .dev_desc = (uint8_t *)&iap_dev_desc, + .config_desc = (uint8_t *)&iap_config_desc, + .strings = usbd_iap_strings +}; + +/* local function prototypes ('static') */ +static uint8_t iap_init (usb_dev *udev, uint8_t config_index); +static uint8_t iap_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t iap_req_handler (usb_dev *udev, usb_req *req); +static void iap_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class iap_class = { + .init = iap_init, + .deinit = iap_deinit, + .req_process = iap_req_handler, + .data_out = iap_data_out +}; + +/* USB custom HID device report descriptor */ +const uint8_t iap_report_desc[USB_DESC_LEN_IAP_REPORT] = +{ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x00, /* USAGE (Custom Device) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + /* IAP command and data */ + 0x85, 0x01, /* REPORT_ID (0x01) */ + 0x09, 0x01, /* USAGE (IAP command) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0xff, /* LOGICAL_MAXIMUM (255) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x3f, /* REPORT_COUNT (63) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* device status and option byte */ + 0x85, 0x02, /* REPORT_ID (0x02) */ + 0x09, 0x02, /* USAGE (Status and option byte) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0xff, /* LOGICAL_MAXIMUM (255) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x10, /* REPORT_COUNT (16) */ + 0x81, 0x82, /* INPUT (Data,Var,Abs,Vol) */ + + 0xc0 /* END_COLLECTION */ +}; + +/* IAP requests management functions */ +static void iap_req_erase (usb_dev *udev); +static void iap_req_dnload (usb_dev *udev); +static void iap_req_optionbyte(usb_dev *udev); +static void iap_req_leave (usb_dev *udev); +static void iap_address_send (usb_dev *udev); +static void iap_data_write (uint8_t *data, uint32_t addr, uint32_t len); + +/*! + \brief initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_init (usb_dev *udev, uint8_t config_index) +{ + static usbd_iap_handler iap_handler; + + /* initialize TX endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, INT_TX_ADDR, &(iap_config_desc.hid_epin)); + + /* initialize RX endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, INT_RX_ADDR, &(iap_config_desc.hid_epout)); + + /* unlock the internal flash */ + fmc_unlock(); + + memset((void *)&iap_handler, 0, sizeof(usbd_iap_handler)); + + /* prepare receive Data */ + usbd_ep_recev(udev, IAP_OUT_EP, iap_handler.report_buf, IAP_OUT_PACKET); + + udev->ep_transc[EP_ID(IAP_OUT_EP)][TRANSC_OUT] = iap_class.data_out; + + iap_handler.base_address = APP_LOADED_ADDR; + + udev->class_data[USBD_IAP_INTERFACE] = (void *)&iap_handler; + + return USBD_OK; +} + +/*! + \brief deinitialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize HID endpoints */ + usbd_ep_deinit (udev, IAP_IN_EP); + usbd_ep_deinit (udev, IAP_OUT_EP); + + /* lock the internal flash */ + fmc_lock(); + + return USBD_OK; +} + +/*! + \brief handle the HID class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + switch (req->bRequest) { + case GET_REPORT: + /* no use for this driver */ + break; + + case GET_IDLE: + usb_transc_config(&udev->transc_in[0], (uint8_t *)&iap->idlestate, 1U, 0U); + + status = REQ_SUPP; + break; + + case GET_PROTOCOL: + usb_transc_config(&udev->transc_in[0], (uint8_t *)&iap->protocol, 1U, 0U); + + status = REQ_SUPP; + break; + + case SET_REPORT: + iap->reportID = (uint8_t)(req->wValue); + + usb_transc_config(&udev->transc_out[0], iap->report_buf, req->wLength, 0U); + + status = REQ_SUPP; + break; + + case SET_IDLE: + iap->idlestate = (uint8_t)(req->wValue >> 8); + + status = REQ_SUPP; + break; + + case SET_PROTOCOL: + iap->protocol = (uint8_t)(req->wValue); + + status = REQ_SUPP; + break; + + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8)) { + usb_transc_config(&udev->transc_in[0], + (uint8_t *)iap_report_desc, + USB_MIN(USB_DESC_LEN_IAP_REPORT, req->wLength), + 0U); + + return REQ_SUPP; + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle data out stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void iap_data_out (usb_dev *udev ,uint8_t ep_num) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + if (0x01U == iap->report_buf[0]) { + switch(iap->report_buf[1]) { + case IAP_DNLOAD: + iap_req_dnload(udev); + break; + + case IAP_ERASE: + iap_req_erase(udev); + break; + + case IAP_OPTION_BYTE: + iap_req_optionbyte(udev); + break; + + case IAP_LEAVE: + iap_req_leave(udev); + break; + + case IAP_GETBIN_ADDRESS: + iap_address_send(udev); + break; + + default: + break; + } + } + + usbd_ep_recev(udev, IAP_OUT_EP, iap->report_buf, IAP_OUT_PACKET); +} + +/*! + \brief send IAP report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t iap_report_send (usb_dev *udev, uint8_t *report, uint16_t len) +{ + usbd_ep_send (udev, IAP_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief handle the IAP_DNLOAD request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_dnload (usb_dev *udev) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + if (0U != iap->transfer_times) { + if (1U == iap->transfer_times) { + if (0U == iap->lps) { + iap_data_write(&iap->report_buf[2], iap->base_address, TRANSFER_SIZE); + } else { + iap_data_write(&iap->report_buf[2], iap->base_address, iap->file_length % TRANSFER_SIZE); + iap->lps = 0U; + } + + iap->dev_status[0] = 0x02U; + iap->dev_status[1] = 0x02U; + iap_report_send (udev, iap->dev_status, IAP_IN_PACKET); + } else { + iap_data_write(&iap->report_buf[2], iap->base_address, TRANSFER_SIZE); + + iap->base_address += TRANSFER_SIZE; + } + + iap->transfer_times--; + } +} + +/*! + \brief handle the IAP_ERASE request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_erase (usb_dev *udev) +{ + uint32_t i, addr = 0U; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + /* get base address to erase */ + iap->base_address = iap->report_buf[2]; + iap->base_address |= (uint32_t)iap->report_buf[3] << 8; + iap->base_address |= (uint32_t)iap->report_buf[4] << 16; + iap->base_address |= (uint32_t)iap->report_buf[5] << 24; + + iap->page_count = iap->report_buf[6]; + + /* get file length */ + iap->file_length = iap->report_buf[7]; + iap->file_length |= (uint32_t)iap->report_buf[8] << 8; + iap->file_length |= (uint32_t)iap->report_buf[9] << 16; + iap->file_length |= (uint32_t)iap->report_buf[10] << 24; + + /* compute last packet size and transfer times */ + iap->lps = iap->file_length % TRANSFER_SIZE; + if (0U == iap->lps) { + iap->transfer_times = (uint16_t)(iap->file_length / TRANSFER_SIZE); + } else { + iap->transfer_times = (uint16_t)(iap->file_length / TRANSFER_SIZE + 1U); + } + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(iap->base_address)) { + return; + } + + addr = iap->base_address; + + for (i = 0U; i < iap->page_count; i ++) { + /* call the standard flash erase-page function */ + fmc_page_erase(addr); + + addr += PAGE_SIZE; + } + + iap->dev_status[0] = 0x02U; + iap->dev_status[1] = 0x01U; + + usbd_ep_send(udev, IAP_IN_EP, iap->dev_status, IAP_IN_PACKET); +} + +/*! + \brief handle the IAP_OPTION_BYTE request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_optionbyte (usb_dev *udev) +{ + uint8_t i = 0U; + uint32_t address = 0x1FFFF800U; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + iap->option_byte[0] = 0x02U; + + for (i = 1U; i < 17U; i++) { + iap->option_byte[i] = *(uint8_t *)address; + address++; + } + + iap_report_send(udev, iap->option_byte, IAP_IN_PACKET); +} + +/*! + \brief handle the IAP_LEAVE request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_leave (usb_dev *udev) +{ + /* lock the internal flash */ + fmc_lock(); + + /* generate system reset to allow jumping to the user code */ + NVIC_SystemReset(); +} + +/*! + \brief handle the IAP_SEND_ADDRESS request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_address_send(usb_dev *udev) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->class_data[USBD_IAP_INTERFACE]; + + iap->bin_addr[0] = 0x02U; + + iap->bin_addr[1] = (uint8_t)(APP_LOADED_ADDR); + iap->bin_addr[2] = (uint8_t)(APP_LOADED_ADDR >> 8); + iap->bin_addr[3] = (uint8_t)(APP_LOADED_ADDR >> 16); + iap->bin_addr[4] = (uint8_t)(APP_LOADED_ADDR >> 24); + + iap_report_send (udev, iap->bin_addr, IAP_IN_PACKET); +} + +/*! + \brief write data to sectors of memory + \param[in] data: data to be written + \param[in] addr: sector address/code + \param[in] len: length of data to be written (in bytes) + \param[out] none + \retval none +*/ +static void iap_data_write (uint8_t *data, uint32_t addr, uint32_t len) +{ + uint32_t index = 0U; + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return; + } + + if (len & 0x03U) {/* not an aligned data */ + for (index = len; index < ((len & 0xFFFCU) + 4U); index++) { + data[index] = 0xFFU; + } + } + + /* data received are word multiple */ + for (index = 0U; index < len; index += 4U) { + fmc_word_program(addr, *(uint32_t *)(data + index)); + addr += 4U; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_bbb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_bbb.h new file mode 100644 index 0000000..03926a3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_bbb.h @@ -0,0 +1,131 @@ +/*! + \file usbd_msc_bbb.h + \brief the header file of the usbd_msc_bot.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_BBB_H +#define __USBD_MSC_BBB_H + +#include "usbd_core.h" +#include "usbd_msc_mem.h" +#include "usbd_msc_scsi.h" + +#define BBB_CBW_SIGNATURE 0x43425355U +#define BBB_CSW_SIGNATURE 0x53425355U +#define BBB_CBW_LENGTH 31U +#define BBB_CSW_LENGTH 13U + +typedef struct +{ + uint32_t dCBWSignature; + uint32_t dCBWTag; + uint32_t dCBWDataTransferLength; + uint8_t bmCBWFlags; + uint8_t bCBWLUN; + uint8_t bCBWCBLength; + uint8_t CBWCB[16]; +}msc_bbb_cbw; + +typedef struct +{ + uint32_t dCSWSignature; + uint32_t dCSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +}msc_bbb_csw; + +/* CSW command status */ +enum msc_csw_status +{ + CSW_CMD_PASSED = 0, + CSW_CMD_FAILED, + CSW_PHASE_ERROR +}; + +/* MSC BBB state */ +enum msc_bbb_state { + BBB_IDLE = 0U, /*!< idle state */ + BBB_DATA_OUT, /*!< data OUT state */ + BBB_DATA_IN, /*!< data IN state */ + BBB_LAST_DATA_IN, /*!< last data IN state */ + BBB_SEND_DATA /*!< send immediate data state */ +}; + +/* MSC BBB status */ +enum msc_bbb_status { + BBB_STATUS_NORMAL = 0U, /*!< normal status */ + BBB_STATUS_RECOVERY, /*!< recovery status*/ + BBB_STATUS_ERROR /*!< error status */ +}; + +typedef struct +{ + uint8_t bbb_data[MSC_MEDIA_PACKET_SIZE]; + + uint8_t max_lun; + uint8_t bbb_state; + uint8_t bbb_status; + + uint32_t bbb_datalen; + + msc_bbb_cbw bbb_cbw; + msc_bbb_csw bbb_csw; + + uint8_t scsi_sense_head; + uint8_t scsi_sense_tail; + + uint32_t scsi_blk_size[MEM_LUN_NUM]; + uint32_t scsi_blk_nbr[MEM_LUN_NUM]; + + uint32_t scsi_blk_addr; + uint32_t scsi_blk_len; + + msc_scsi_sense scsi_sense[SENSE_LIST_DEEPTH]; +} usbd_msc_handler; + +/* function declarations */ +/* initialize the bbb process */ +void msc_bbb_init (usb_dev *udev); +/* reset the BBB machine */ +void msc_bbb_reset (usb_dev *udev); +/* deinitialize the BBB machine */ +void msc_bbb_deinit (usb_dev *udev); +/* handle BBB data IN stage */ +void msc_bbb_data_in (usb_dev *udev, uint8_t ep_num); +/* handle BBB data OUT stage */ +void msc_bbb_data_out (usb_dev *udev, uint8_t ep_num); +/* send the CSW(command status wrapper) */ +void msc_bbb_csw_send (usb_dev *udev, uint8_t csw_status); +/* complete the clear feature request */ +void msc_bbb_clrfeature (usb_dev *udev, uint8_t ep_num); + +#endif /* __USBD_MSC_BBB_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_core.h new file mode 100644 index 0000000..45ec868 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_core.h @@ -0,0 +1,85 @@ +/*! + \file usbd_msc_core.h + \brief the header file of USB MSC device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_CORE_H +#define __USBD_MSC_CORE_H + +#include "usbd_core.h" + +/* mass storage device class code */ +#define USB_CLASS_MSC 0x08U + +/* mass storage subclass code */ +#define USB_MSC_SUBCLASS_RBC 0x01U +#define USB_MSC_SUBCLASS_ATAPI 0x02U +#define USB_MSC_SUBCLASS_UFI 0x04U +#define USB_MSC_SUBCLASS_SCSI 0x06U +#define USB_MSC_SUBCLASS_LOCKABLE 0x07U +#define USB_MSC_SUBCLASS_IEEE1667 0x08U + +/* mass storage interface class control protocol codes */ +#define USB_MSC_PROTOCOL_CBI 0x00U +#define USB_MSC_PROTOCOL_CBI_ALT 0x01U +#define USB_MSC_PROTOCOL_BBB 0x50U + +/* mass storage request codes */ +#define USB_MSC_REQ_CODES_ADSC 0x00U +#define USB_MSC_REQ_CODES_GET 0xFCU +#define USB_MSC_REQ_CODES_PUT 0xFDU +#define USB_MSC_REQ_CODES_GML 0xFEU +#define USB_MSC_REQ_CODES_BOMSR 0xFFU + +/* mass storage class-specific request codes */ +#define BBB_GET_MAX_LUN 0xFEU +#define BBB_RESET 0xFFU + +#define USB_MSC_CONFIG_DESC_SIZE 32U + +#define MSC_EPIN_SIZE MSC_DATA_PACKET_SIZE +#define MSC_EPOUT_SIZE MSC_DATA_PACKET_SIZE + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + + usb_desc_itf msc_itf; + usb_desc_ep msc_epin; + usb_desc_ep msc_epout; +} usb_desc_config_set; + +extern usb_desc msc_desc; +extern usb_class msc_class; + +#endif /* __USBD_MSC_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_mem.h new file mode 100644 index 0000000..80ba594 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_mem.h @@ -0,0 +1,59 @@ +/*! + \file usbd_msc_mem.h + \brief header file for storage memory + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_MEM_H +#define __USBD_MSC_MEM_H + +#include "usbd_conf.h" + +#define USBD_STD_INQUIRY_LENGTH 36U + +typedef struct +{ + int8_t (*mem_init) (uint8_t lun); + int8_t (*mem_ready) (uint8_t lun); + int8_t (*mem_protected) (uint8_t lun); + int8_t (*mem_read) (uint8_t lun, uint8_t *buf, uint32_t block_addr, uint16_t block_len); + int8_t (*mem_write) (uint8_t lun, uint8_t *buf, uint32_t block_addr, uint16_t block_len); + int8_t (*mem_maxlun) (void); + + uint8_t *mem_toc_data; + uint8_t *mem_inquiry_data[MEM_LUN_NUM]; + uint32_t mem_block_size[MEM_LUN_NUM]; + uint32_t mem_block_len[MEM_LUN_NUM]; +}usbd_mem_cb; + +extern usbd_mem_cb *usbd_mem_fops; + +#endif /* __USBD_MSC_MEM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_scsi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_scsi.h new file mode 100644 index 0000000..ac2b4af --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Include/usbd_msc_scsi.h @@ -0,0 +1,135 @@ +/*! + \file usbd_msc_scsi.h + \brief the header file of the usbd_msc_scsi.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_SCSI_H +#define __USBD_MSC_SCSI_H + +#include "usbd_msc_bbb.h" + +#define SENSE_LIST_DEEPTH 4U + +/* SCSI commands */ +#define SCSI_FORMAT_UNIT 0x04U +#define SCSI_INQUIRY 0x12U +#define SCSI_MODE_SELECT6 0x15U +#define SCSI_MODE_SELECT10 0x55U +#define SCSI_MODE_SENSE6 0x1AU +#define SCSI_READ_TOC_DATA 0x43U +#define SCSI_MODE_SENSE10 0x5AU +#define SCSI_ALLOW_MEDIUM_REMOVAL 0x1EU +#define SCSI_READ6 0x08U +#define SCSI_READ10 0x28U +#define SCSI_READ12 0xA8U +#define SCSI_READ16 0x88U + +#define SCSI_READ_CAPACITY10 0x25U +#define SCSI_READ_CAPACITY16 0x9EU + +#define SCSI_REQUEST_SENSE 0x03U +#define SCSI_START_STOP_UNIT 0x1BU +#define SCSI_TEST_UNIT_READY 0x00U +#define SCSI_WRITE6 0x0AU +#define SCSI_WRITE10 0x2AU +#define SCSI_WRITE12 0xAAU +#define SCSI_WRITE16 0x8AU + +#define SCSI_VERIFY10 0x2FU +#define SCSI_VERIFY12 0xAFU +#define SCSI_VERIFY16 0x8FU + +#define SCSI_SEND_DIAGNOSTIC 0x1DU +#define SCSI_READ_FORMAT_CAPACITIES 0x23U + +#define INVALID_CDB 0x20U +#define INVALID_FIELED_IN_COMMAND 0x24U +#define PARAMETER_LIST_LENGTH_ERROR 0x1AU +#define INVALID_FIELD_IN_PARAMETER_LIST 0x26U +#define ADDRESS_OUT_OF_RANGE 0x21U +#define MEDIUM_NOT_PRESENT 0x3AU +#define MEDIUM_HAVE_CHANGED 0x28U +#define WRITE_PROTECTED 0x27U +#define UNRECOVERED_READ_ERROR 0x11U +#define WRITE_FAULT 0x03U + +#define READ_FORMAT_CAPACITY_DATA_LEN 0x0CU +#define READ_CAPACITY10_DATA_LEN 0x08U +#define MODE_SENSE10_DATA_LEN 0x08U +#define MODE_SENSE6_DATA_LEN 0x04U +#define READ_TOC_CMD_LEN 0x14U +#define REQUEST_SENSE_DATA_LEN 0x12U +#define STANDARD_INQUIRY_DATA_LEN 0x24U +#define BLKVFY 0x04U + +#define MODE_SENSE6_LENGTH 8U +#define MODE_SENSE10_LENGTH 8U +#define INQUIRY_PAGE00_LENGTH 96U +#define FORMAT_CAPACITIES_LENGTH 20U + +enum sense_state +{ + NO_SENSE = 0U, + RECOVERED_ERROR, + NOT_READY, + MEDIUM_ERROR, + HARDWARE_ERROR, + ILLEGAL_REQUEST, + UNIT_ATTENTION, + DATA_PROTECT, + BLANK_CHECK, + VENDOR_SPECIFIC, + COPY_ABORTED, + ABORTED_COMMAND, + RESERVED, + VOLUME_OVERFLOW, + MISCOMPARE +}; + +typedef struct { + uint8_t SenseKey; + uint32_t Information; + uint8_t ASC; + uint8_t ASCQ; +} msc_scsi_sense; + +extern const uint8_t msc_page00_inquiry_data[]; +extern const uint8_t msc_mode_sense6_data[]; +extern const uint8_t msc_mode_sense10_data[]; + +/* function declarations */ +/* process SCSI commands */ +int8_t scsi_process_cmd (usb_dev *udev, uint8_t lun, uint8_t *cmd); +/* load the last error code in the error list */ +void scsi_sense_code (usb_dev *udev, uint8_t lun, uint8_t skey, uint8_t asc); + +#endif /* __USBD_MSC_SCSI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_bbb.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_bbb.c new file mode 100644 index 0000000..18e6fc0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_bbb.c @@ -0,0 +1,284 @@ +/*! + \file usbd_msc_bbb.c + \brief USB BBB(Bulk/Bulk/Bulk) protocol core functions + \note BBB means Bulk-only transport protocol for USB MSC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" + +/* local function prototypes ('static') */ +static void msc_bbb_cbw_decode (usb_dev *udev); +static void msc_bbb_data_send (usb_dev *udev, uint8_t *pbuf, uint32_t Len); +static void msc_bbb_abort (usb_dev *udev); + +/*! + \brief initialize the bbb process + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_init (usb_dev *udev) +{ + uint8_t lun_num; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; + msc->bbb_status = BBB_STATUS_NORMAL; + + /* initializes the storage logic unit */ + for(lun_num = 0U; lun_num < MEM_LUN_NUM; lun_num++) { + usbd_mem_fops->mem_init(lun_num); + } + + /* prepare endpoint to receive the first BBB CBW */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief reset the BBB machine + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_reset (usb_dev *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; + msc->bbb_status = BBB_STATUS_RECOVERY; + + /* prepare endpoint to receive the first BBB command */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief deinitialize the BBB machine + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_deinit (usb_dev *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; +} + +/*! + \brief handle BBB data IN stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_data_in (usb_dev *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + switch (msc->bbb_state) { + case BBB_DATA_IN: + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } + break; + + case BBB_SEND_DATA: + case BBB_LAST_DATA_IN: + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + break; + + default: + break; + } +} + +/*! + \brief handle BBB data OUT stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_data_out (usb_dev *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + switch (msc->bbb_state) { + case BBB_IDLE: + msc_bbb_cbw_decode (udev); + break; + + case BBB_DATA_OUT: + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } + break; + + default: + break; + } +} + +/*! + \brief send the CSW(command status wrapper) + \param[in] udev: pointer to USB device instance + \param[in] csw_status: CSW status + \param[out] none + \retval none +*/ +void msc_bbb_csw_send (usb_dev *udev, uint8_t csw_status) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_csw.dCSWSignature = BBB_CSW_SIGNATURE; + msc->bbb_csw.bCSWStatus = csw_status; + msc->bbb_state = BBB_IDLE; + + usbd_ep_send (udev, MSC_IN_EP, (uint8_t *)&msc->bbb_csw, BBB_CSW_LENGTH); + + /* prepare endpoint to receive next command */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief complete the clear feature request + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_clrfeature (usb_dev *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + /* bad CBW signature */ + if (msc->bbb_status == BBB_STATUS_ERROR) { + usbd_ep_stall(udev, MSC_IN_EP); + + msc->bbb_status = BBB_STATUS_NORMAL; + } else if(((ep_num & 0x80U) == 0x80U) && (msc->bbb_status != BBB_STATUS_RECOVERY)) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } else { + + } +} + +/*! + \brief decode the CBW command and set the BBB state machine accordingly + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void msc_bbb_cbw_decode (usb_dev *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + uint16_t rx_len = udev->transc_out[MSC_OUT_EP].xfer_count; + + msc->bbb_csw.dCSWTag = msc->bbb_cbw.dCBWTag; + msc->bbb_csw.dCSWDataResidue = msc->bbb_cbw.dCBWDataTransferLength; + + if ((BBB_CBW_LENGTH != rx_len) || + (BBB_CBW_SIGNATURE != msc->bbb_cbw.dCBWSignature)|| + (msc->bbb_cbw.bCBWLUN > 1U) || + (msc->bbb_cbw.bCBWCBLength < 1U) || + (msc->bbb_cbw.bCBWCBLength > 16U)) { + /* illegal command handler */ + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + msc->bbb_status = BBB_STATUS_ERROR; + + msc_bbb_abort (udev); + } else { + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_abort (udev); + } else if ((BBB_DATA_IN != msc->bbb_state) && + (BBB_DATA_OUT != msc->bbb_state) && + (BBB_LAST_DATA_IN != msc->bbb_state)) { /* burst xfer handled internally */ + if (msc->bbb_datalen > 0U) { + msc_bbb_data_send (udev, msc->bbb_data, msc->bbb_datalen); + } else if (0U == msc->bbb_datalen) { + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + } else { + + } + } else { + + } + } +} + +/*! + \brief send the requested data + \param[in] udev: pointer to USB device instance + \param[in] buf: pointer to data buffer + \param[in] len: data length + \param[out] none + \retval none +*/ +static void msc_bbb_data_send (usb_dev *udev, uint8_t *buf, uint32_t len) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + len = USB_MIN (msc->bbb_cbw.dCBWDataTransferLength, len); + + msc->bbb_csw.dCSWDataResidue -= len; + msc->bbb_csw.bCSWStatus = CSW_CMD_PASSED; + msc->bbb_state = BBB_SEND_DATA; + + usbd_ep_send (udev, MSC_IN_EP, buf, len); +} + +/*! + \brief abort the current transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void msc_bbb_abort (usb_dev *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if ((0U == msc->bbb_cbw.bmCBWFlags) && + (0U != msc->bbb_cbw.dCBWDataTransferLength) && + (BBB_STATUS_NORMAL == msc->bbb_status)) { + usbd_ep_stall(udev, MSC_OUT_EP); + } + + usbd_ep_stall(udev, MSC_IN_EP); + + if (msc->bbb_status == BBB_STATUS_ERROR) { + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_core.c new file mode 100644 index 0000000..fa0d057 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_core.c @@ -0,0 +1,316 @@ +/*! + \file usbd_msc_core.c + \brief USB MSC device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" +#include "usbd_msc_core.h" +#include "usbd_transc.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x128FU + +/* local function prototypes ('static') */ +static uint8_t msc_core_init (usb_dev *udev, uint8_t config_index); +static uint8_t msc_core_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t msc_core_req (usb_dev *udev, usb_req *req); +static void msc_core_in (usb_dev *udev, uint8_t ep_num); +static void msc_core_out (usb_dev *udev, uint8_t ep_num); + +usb_class msc_class = +{ + .init = msc_core_init, + .deinit = msc_core_deinit, + + .req_process = msc_core_req, + + .data_in = msc_core_in, + .data_out = msc_core_out +}; + +/* note: it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev msc_dev_desc = +{ + .header = { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +const usb_desc_config_set msc_config_desc = +{ + .config = + { + .header = { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_MSC_CONFIG_DESC_SIZE, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xC0U, + .bMaxPower = 0x32U + }, + + .msc_itf = + { + .header = { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_MSC, + .bInterfaceSubClass = USB_MSC_SUBCLASS_SCSI, + .bInterfaceProtocol = USB_MSC_PROTOCOL_BBB, + .iInterface = 0x00U + }, + + .msc_epin = + { + .header = { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = MSC_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = MSC_EPIN_SIZE, + .bInterval = 0x00U + }, + + .msc_epout = + { + .header = { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = MSC_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = MSC_EPOUT_SIZE, + .bInterval = 0x00U + } +}; + +/* USB language ID descriptor */ +const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'M', 'S', 'C'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor */ +uint8_t* usbd_msc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc msc_desc = +{ + .dev_desc = (uint8_t *)&msc_dev_desc, + .config_desc = (uint8_t *)&msc_config_desc, + .strings = usbd_msc_strings +}; + +static uint8_t usbd_msc_maxlun = 0U; + +/*! + \brief initialize the MSC device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_init (usb_dev *udev, uint8_t config_index) +{ + static usbd_msc_handler msc_handler; + + memset((void *)&msc_handler, 0U, sizeof(usbd_msc_handler)); + + udev->class_data[USBD_MSC_INTERFACE] = (void *)&msc_handler; + + /* initialize Tx endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, BULK_TX_ADDR, &(msc_config_desc.msc_epin)); + + /* initialize Rx endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, BULK_RX_ADDR, &(msc_config_desc.msc_epout)); + + udev->ep_transc[EP_ID(MSC_IN_EP)][TRANSC_IN] = msc_class.data_in; + udev->ep_transc[MSC_OUT_EP][TRANSC_OUT] = msc_class.data_out; + + /* initialize the BBB layer */ + msc_bbb_init(udev); + + return USBD_OK; +} + +/*! + \brief deinitialize the MSC device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_deinit (usb_dev *udev, uint8_t config_index) +{ + /* clear MSC endpoints */ + usbd_ep_deinit (udev, MSC_IN_EP); + usbd_ep_deinit (udev, MSC_OUT_EP); + + /* deinitialize the BBB layer */ + msc_bbb_deinit(udev); + + return USBD_OK; +} + +/*! + \brief handle the MSC class-specific and standard requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_req (usb_dev *udev, usb_req *req) +{ + switch (req->bRequest) { + case BBB_GET_MAX_LUN : + if((0U == req->wValue) && + (1U == req->wLength) && + (0x80U == (req->bmRequestType & 0x80U))) { + usbd_msc_maxlun = (uint8_t)usbd_mem_fops->mem_maxlun(); + + usb_transc_config(&udev->transc_in[0], &usbd_msc_maxlun, 1U, 0U); + } else { + return USBD_FAIL; + } + break; + + case BBB_RESET : + if((0U == req->wValue) && + (0U == req->wLength) && + (0x80U != (req->bmRequestType & 0x80U))) { + msc_bbb_reset(udev); + } else { + return USBD_FAIL; + } + break; + + case USB_CLEAR_FEATURE: + msc_bbb_clrfeature (udev, (uint8_t)req->wIndex); + break; + + default: + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle data in stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: the endpoint number + \param[out] none + \retval none +*/ +static void msc_core_in (usb_dev *udev, uint8_t ep_num) +{ + msc_bbb_data_in(udev, ep_num); +} + +/*! + \brief handle data out stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: the endpoint number + \param[out] none + \retval none +*/ +static void msc_core_out (usb_dev *udev, uint8_t ep_num) +{ + msc_bbb_data_out (udev, ep_num); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_scsi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_scsi.c new file mode 100644 index 0000000..1992c1f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/msc/Source/usbd_msc_scsi.c @@ -0,0 +1,759 @@ +/*! + \file usbd_msc_scsi.c + \brief USB SCSI layer functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" +#include "usbd_msc_scsi.h" + +/* USB mass storage page 0 inquiry data */ +const uint8_t msc_page00_inquiry_data[] = +{ + 0x00U, + 0x00U, + 0x00U, + 0x00U, + (INQUIRY_PAGE00_LENGTH - 4U), + 0x80U, + 0x83U, +}; + +/* USB mass storage sense 6 data */ +const uint8_t msc_mode_sense6_data[] = +{ + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U +}; + +/* USB mass storage sense 10 data */ +const uint8_t msc_mode_sense10_data[] = +{ + 0x00U, + 0x06U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U +}; + +/* local function prototypes ('static') */ +static int8_t scsi_test_unit_ready (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_select6 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_select10 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_inquiry (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read_format_capacity (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read_capacity10 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_request_sense (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_sense6 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_toc_cmd_read (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_sense10 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_write10 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read10 (usb_dev *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_verify10 (usb_dev *udev, uint8_t lun, uint8_t *params); + +static int8_t scsi_process_read (usb_dev *udev, uint8_t lun); +static int8_t scsi_process_write (usb_dev *udev, uint8_t lun); + +static inline int8_t scsi_check_address_range (usb_dev *udev, uint8_t lun, uint32_t blk_offset, uint16_t blk_nbr); +static inline int8_t scsi_format_cmd (usb_dev *udev, uint8_t lun); +static inline int8_t scsi_start_stop_unit (usb_dev *udev, uint8_t lun, uint8_t *params); +static inline int8_t scsi_allow_medium_removal (usb_dev *udev, uint8_t lun, uint8_t *params); + +/*! + \brief process SCSI commands + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +int8_t scsi_process_cmd(usb_dev *udev, uint8_t lun, uint8_t *params) +{ + switch (params[0]) { + case SCSI_TEST_UNIT_READY: + return scsi_test_unit_ready (udev, lun, params); + + case SCSI_REQUEST_SENSE: + return scsi_request_sense (udev, lun, params); + + case SCSI_INQUIRY: + return scsi_inquiry (udev, lun, params); + + case SCSI_START_STOP_UNIT: + return scsi_start_stop_unit (udev, lun, params); + + case SCSI_ALLOW_MEDIUM_REMOVAL: + return scsi_allow_medium_removal (udev, lun, params); + + case SCSI_MODE_SENSE6: + return scsi_mode_sense6 (udev, lun, params); + + case SCSI_MODE_SENSE10: + return scsi_mode_sense10 (udev, lun, params); + + case SCSI_READ_FORMAT_CAPACITIES: + return scsi_read_format_capacity (udev, lun, params); + + case SCSI_READ_CAPACITY10: + return scsi_read_capacity10 (udev, lun, params); + + case SCSI_READ10: + return scsi_read10 (udev, lun, params); + + case SCSI_WRITE10: + return scsi_write10 (udev, lun, params); + + case SCSI_VERIFY10: + return scsi_verify10 (udev, lun, params); + + case SCSI_FORMAT_UNIT: + return scsi_format_cmd (udev, lun); + + case SCSI_READ_TOC_DATA: + return scsi_toc_cmd_read (udev, lun, params); + + case SCSI_MODE_SELECT6: + return scsi_mode_select6 (udev, lun, params); + + case SCSI_MODE_SELECT10: + return scsi_mode_select10 (udev, lun, params); + + default: + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, INVALID_CDB); + return -1; + } +} + +/*! + \brief load the last error code in the error list + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] skey: sense key + \param[in] asc: additional sense key + \param[out] none + \retval none +*/ +void scsi_sense_code (usb_dev *udev, uint8_t lun, uint8_t skey, uint8_t asc) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->scsi_sense[msc->scsi_sense_tail].SenseKey = skey; + msc->scsi_sense[msc->scsi_sense_tail].ASC = asc << 8U; + msc->scsi_sense_tail++; + + if (SENSE_LIST_DEEPTH == msc->scsi_sense_tail) { + msc->scsi_sense_tail = 0U; + } +} + +/*! + \brief process SCSI test unit ready command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_test_unit_ready (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if (0U != msc->bbb_cbw.dCBWDataTransferLength) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code(udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process mode select 6 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_select6 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process mode select 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_select10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process inquiry command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_inquiry (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint8_t *page = NULL; + uint16_t len = 0U; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if (params[1] & 0x01U) { + page = (uint8_t *)msc_page00_inquiry_data; + + len = INQUIRY_PAGE00_LENGTH; + } else { + page = (uint8_t *)usbd_mem_fops->mem_inquiry_data[lun]; + + len = (uint16_t)(page[4] + 5U); + + if (params[4] <= len) { + len = params[4]; + } + } + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = page[len]; + } + + return 0; +} + +/*! + \brief process read capacity 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read_capacity10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint32_t blk_num = usbd_mem_fops->mem_block_len[lun] - 1U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->scsi_blk_nbr[lun] = usbd_mem_fops->mem_block_len[lun]; + msc->scsi_blk_size[lun] = usbd_mem_fops->mem_block_size[lun]; + + msc->bbb_data[0] = (uint8_t)(blk_num >> 24U); + msc->bbb_data[1] = (uint8_t)(blk_num >> 16U); + msc->bbb_data[2] = (uint8_t)(blk_num >> 8U); + msc->bbb_data[3] = (uint8_t)(blk_num); + + msc->bbb_data[4] = (uint8_t)(msc->scsi_blk_size[lun] >> 24U); + msc->bbb_data[5] = (uint8_t)(msc->scsi_blk_size[lun] >> 16U); + msc->bbb_data[6] = (uint8_t)(msc->scsi_blk_size[lun] >> 8U); + msc->bbb_data[7] = (uint8_t)(msc->scsi_blk_size[lun]); + + msc->bbb_datalen = 8U; + + return 0; +} + +/*! + \brief process read format capacity command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read_format_capacity (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint16_t i = 0U; + uint32_t blk_size = usbd_mem_fops->mem_block_size[lun]; + uint32_t blk_num = usbd_mem_fops->mem_block_len[lun]; + uint32_t blk_nbr = blk_num - 1U; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + for (i = 0U; i < 12U; i++) { + msc->bbb_data[i] = 0U; + } + + msc->bbb_data[3] = 0x08U; + msc->bbb_data[4] = (uint8_t)(blk_nbr >> 24U); + msc->bbb_data[5] = (uint8_t)(blk_nbr >> 16U); + msc->bbb_data[6] = (uint8_t)(blk_nbr >> 8U); + msc->bbb_data[7] = (uint8_t)(blk_nbr); + + msc->bbb_data[8] = 0x02U; + msc->bbb_data[9] = (uint8_t)(blk_size >> 16U); + msc->bbb_data[10] = (uint8_t)(blk_size >> 8U); + msc->bbb_data[11] = (uint8_t)(blk_size); + + msc->bbb_datalen = 12U; + + return 0; +} + +/*! + \brief process mode sense 6 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_sense6 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint16_t len = 8U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = msc_mode_sense6_data[len]; + } + + return 0; +} + +/*! + \brief process mode sense 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_sense10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint16_t len = 8U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = msc_mode_sense10_data[len]; + } + + return 0; +} + +/*! + \brief process request sense command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_request_sense (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint8_t i = 0U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + for (i = 0U; i < REQUEST_SENSE_DATA_LEN; i++) { + msc->bbb_data[i] = 0U; + } + + msc->bbb_data[0] = 0x70U; + msc->bbb_data[7] = REQUEST_SENSE_DATA_LEN - 6U; + + if ((msc->scsi_sense_head != msc->scsi_sense_tail)) { + msc->bbb_data[2] = msc->scsi_sense[msc->scsi_sense_head].SenseKey; + msc->bbb_data[12] = msc->scsi_sense[msc->scsi_sense_head].ASCQ; + msc->bbb_data[13] = msc->scsi_sense[msc->scsi_sense_head].ASC; + msc->scsi_sense_head++; + + if (msc->scsi_sense_head == SENSE_LIST_DEEPTH) { + msc->scsi_sense_head = 0U; + } + } + + msc->bbb_datalen = USB_MIN(REQUEST_SENSE_DATA_LEN, params[4]); + + return 0; +} + +/*! + \brief process start stop unit command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static inline int8_t scsi_start_stop_unit (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process allow medium removal command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static inline int8_t scsi_allow_medium_removal (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process read 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if (msc->bbb_state == BBB_IDLE) { + /* direction is from device to host */ + if (0x80U != (msc->bbb_cbw.bmCBWFlags & 0x80U)) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code (udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + msc->scsi_blk_addr = (params[2] << 24U) | (params[3] << 16U) | \ + (params[4] << 8U) | params[5]; + + msc->scsi_blk_len = (params[7] << 8U) | params[8]; + + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->bbb_state = BBB_DATA_IN; + + msc->scsi_blk_addr *= msc->scsi_blk_size[lun]; + msc->scsi_blk_len *= msc->scsi_blk_size[lun]; + + /* cases 4,5 : Hi <> Dn */ + if (msc->bbb_cbw.dCBWDataTransferLength != msc->scsi_blk_len) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + } + + msc->bbb_datalen = MSC_MEDIA_PACKET_SIZE; + + return scsi_process_read (udev, lun); +} + +/*! + \brief process write 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_write10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if (BBB_IDLE == msc->bbb_state) { + /* case 8 : Hi <> Do */ + if (0x80U == (msc->bbb_cbw.bmCBWFlags & 0x80U)) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + /* check whether media is ready */ + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code (udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + /* check if media is write-protected */ + if (0 != usbd_mem_fops->mem_protected(lun)) { + scsi_sense_code (udev, lun, NOT_READY, WRITE_PROTECTED); + + return -1; + } + + msc->scsi_blk_addr = (params[2] << 24U) | (params[3] << 16U) | \ + (params[4] << 8U) | params[5]; + + msc->scsi_blk_len = (params[7] << 8U) | params[8]; + + /* check if LBA address is in the right range */ + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->scsi_blk_addr *= msc->scsi_blk_size[lun]; + msc->scsi_blk_len *= msc->scsi_blk_size[lun]; + + /* cases 3,11,13 : Hn,Ho <> D0 */ + if (msc->bbb_cbw.dCBWDataTransferLength != msc->scsi_blk_len) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + /* prepare endpoint to receive first data packet */ + msc->bbb_state = BBB_DATA_OUT; + + usbd_ep_recev (udev, + MSC_OUT_EP, + msc->bbb_data, + USB_MIN (msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE)); + } else { /* write process ongoing */ + return scsi_process_write (udev, lun); + } + + return 0; +} + +/*! + \brief process verify 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_verify10 (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if (0x02U == (params[1] & 0x02U)) { + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); + + return -1; /* error, verify mode not supported*/ + } + + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief check address range + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] blk_offset: block offset + \param[in] blk_nbr: number of block to be processed + \param[out] none + \retval status +*/ +static inline int8_t scsi_check_address_range (usb_dev *udev, uint8_t lun, uint32_t blk_offset, uint16_t blk_nbr) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + if ((blk_offset + blk_nbr) > msc->scsi_blk_nbr[lun]) { + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, ADDRESS_OUT_OF_RANGE); + + return -1; + } + + return 0; +} + +/*! + \brief handle read process + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t scsi_process_read (usb_dev *udev, uint8_t lun) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + uint32_t len = USB_MIN(msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE); + + if (usbd_mem_fops->mem_read(lun, + msc->bbb_data, + msc->scsi_blk_addr, + (uint16_t)(len / msc->scsi_blk_size[lun])) < 0) { + scsi_sense_code(udev, lun, HARDWARE_ERROR, UNRECOVERED_READ_ERROR); + + return -1; + } + + usbd_ep_send (udev, MSC_IN_EP, msc->bbb_data, len); + + msc->scsi_blk_addr += len; + msc->scsi_blk_len -= len; + + /* case 6 : Hi = Di */ + msc->bbb_csw.dCSWDataResidue -= len; + + if (0U == msc->scsi_blk_len) { + msc->bbb_state = BBB_LAST_DATA_IN; + } + + return 0; +} + +/*! + \brief handle write process + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t scsi_process_write (usb_dev *udev, uint8_t lun) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + uint32_t len = USB_MIN(msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE); + + if (usbd_mem_fops->mem_write (lun, + msc->bbb_data, + msc->scsi_blk_addr, + (uint16_t)(len / msc->scsi_blk_size[lun])) < 0) { + scsi_sense_code(udev, lun, HARDWARE_ERROR, WRITE_FAULT); + + return -1; + } + + msc->scsi_blk_addr += len; + msc->scsi_blk_len -= len; + + /* case 12 : Ho = Do */ + msc->bbb_csw.dCSWDataResidue -= len; + + if (0U == msc->scsi_blk_len) { + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + } else { + /* prepare endpoint to receive next packet */ + usbd_ep_recev (udev, + MSC_OUT_EP, + msc->bbb_data, + USB_MIN (msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE)); + } + + return 0; +} + +/*! + \brief process format unit command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static inline int8_t scsi_format_cmd (usb_dev *udev, uint8_t lun) +{ + return 0; +} + +/*! + \brief process read TOC command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_toc_cmd_read (usb_dev *udev, uint8_t lun, uint8_t *params) +{ + uint8_t* pPage; + uint16_t len; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->class_data[USBD_MSC_INTERFACE]; + + pPage = (uint8_t *)&usbd_mem_fops->mem_toc_data[lun * READ_TOC_CMD_LEN]; + len = (uint16_t)pPage[1] + 2U; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = pPage[len]; + } + + return 0; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Include/printer_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Include/printer_core.h new file mode 100644 index 0000000..9e10341 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Include/printer_core.h @@ -0,0 +1,73 @@ +/*! + \file printer_core.h + \brief the header file of USB printer device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __PRINTER_CORE_H +#define __PRINTER_CORE_H + +#include "usbd_enum.h" + +/* USB printer device class code */ +#define USB_CLASS_PRINTER 0x07U + +/* printer device subclass code */ +#define USB_SUBCLASS_PRINTER 0x01U + +/* printer device protocol code */ +#define PROTOCOL_UNIDIRECTIONAL_ITF 0x01U +#define PROTOCOL_BI_DIRECTIONAL_ITF 0x02U +#define PROTOCOL_1284_4_ITF 0x03U +#define PROTOCOL_VENDOR 0xFFU + +#define DEVICE_ID_LEN 103U + +#define USB_PRINTER_CONFIG_DESC_LEN 32U + +/* printer device specific-class request */ +#define GET_DEVICE_ID 0x00U +#define GET_PORT_STATUS 0x01U +#define SOFT_RESET 0x02U + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf printer_itf; + usb_desc_ep printer_epin; + usb_desc_ep printer_epout; +} usb_printer_desc_config_set; + +extern usb_desc printer_desc; +extern usb_class printer_class; + +#endif /* __PRINTER_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Source/printer_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Source/printer_core.c new file mode 100644 index 0000000..2d615cc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/class/device/printer/Source/printer_core.c @@ -0,0 +1,311 @@ +/*! + \file printer_core.c + \brief USB printer device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_transc.h" +#include "printer_core.h" + +#define USBD_VID 0x28E9U +#define USBD_PID 0x028DU + +/* printer port status: paper not empty/selected/no error */ +static uint8_t g_port_status = 0x18U; +uint8_t g_printer_data_buf[PRINTER_OUT_PACKET]; + +uint8_t Printer_DEVICE_ID[DEVICE_ID_LEN] = +{ + 0x00, 0x67, + 'M', 'A', 'N', 'U', 'F', 'A', 'C', 'T', 'U', 'R', 'E', 'R', ':', + 'G', 'I', 'G', 'A', ' ', 'D', 'E', 'V', 'I', 'C', 'E', '-', ';', + 'C', 'O', 'M', 'M', 'A', 'N', 'D', ' ', 'S', 'E', 'T', ':', + 'P', 'C', 'L', ',', 'M', 'P', 'L', ';', + 'M', 'O', 'D', 'E', 'L', ':', + 'L', 'a', 's', 'e', 'r', 'B', 'e', 'a', 'm', '?', ';', + 'C', 'O', 'M', 'M', 'E', 'N', 'T', ':', + 'G', 'o', 'o', 'd', ' ', '!', ';', + 'A', 'C', 'T', 'I', 'V', 'E', ' ', 'C', 'O', 'M', 'M', 'A', 'N', 'D', ' ', 'S', 'E', 'T', ':', + 'P', 'C', 'L', ';' +}; + +/* USB standard device descriptor */ +usb_desc_dev printer_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USBD_EP0_MAX_SIZE, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +usb_printer_desc_config_set printer_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_PRINTER_CONFIG_DESC_LEN, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xA0U, + .bMaxPower = 0x32U + }, + + .printer_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_PRINTER, + .bInterfaceSubClass = USB_SUBCLASS_PRINTER, + .bInterfaceProtocol = PROTOCOL_BI_DIRECTIONAL_ITF, + .iInterface = 0x00U + }, + + .printer_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = PRINTER_IN_PACKET, + .bInterval = 0x00U + }, + + .printer_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = PRINTER_OUT_PACKET, + .bInterval = 0x00U + }, +}; + +/* USB language ID Descriptor */ +static usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(16U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'P', 'r', 'i', 'n', 't', 'e', 'r'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +static uint8_t* usbd_msc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc printer_desc = { + .dev_desc = (uint8_t *)&printer_dev_desc, + .config_desc = (uint8_t *)&printer_config_desc, + .strings = usbd_msc_strings +}; + +/* local function prototypes ('static') */ +static uint8_t printer_init (usb_dev *udev, uint8_t config_index); +static uint8_t printer_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t printer_req_handler (usb_dev *udev, usb_req *req); +static void printer_data_in (usb_dev *udev, uint8_t ep_num); +static void printer_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class printer_class = +{ + .init = printer_init, + .deinit = printer_deinit, + .req_process = printer_req_handler, + .data_in = printer_data_in, + .data_out = printer_data_out +}; +/*! + \brief initialize the printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_init (usb_dev *udev, uint8_t config_index) +{ + /* initialize the data TX/RX endpoint */ + usbd_ep_init(udev, EP_BUF_SNG, BULK_TX_ADDR, &(printer_config_desc.printer_epin)); + usbd_ep_init(udev, EP_BUF_SNG, BULK_RX_ADDR, &(printer_config_desc.printer_epout)); + + udev->ep_transc[EP_ID(PRINTER_IN_EP)][TRANSC_IN] = printer_class.data_in; + udev->ep_transc[PRINTER_OUT_EP][TRANSC_OUT] = printer_class.data_out; + + /* prepare to receive data */ + usbd_ep_recev(udev, PRINTER_OUT_EP, g_printer_data_buf, PRINTER_OUT_PACKET); + + return USBD_OK; +} + +/*! + \brief deinitialize the printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize the data TX/RX endpoint */ + usbd_ep_deinit(udev, PRINTER_IN_EP); + usbd_ep_deinit(udev, PRINTER_OUT_EP); + + return USBD_OK; +} + +/*! + \brief handle the printer class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + switch (req->bRequest) { + case GET_DEVICE_ID: + usb_transc_config(&udev->transc_in[0], Printer_DEVICE_ID, DEVICE_ID_LEN, 0U); + + status = REQ_SUPP; + break; + + case GET_PORT_STATUS: + usb_transc_config(&udev->transc_in[0], (uint8_t *)&g_port_status, 1U, 0U); + + status = REQ_SUPP; + break; + + case SOFT_RESET: + usbd_ep_recev(udev, PRINTER_OUT_EP, g_printer_data_buf, PRINTER_OUT_PACKET); + + status = REQ_SUPP; + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle printer data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void printer_data_in (usb_dev *udev, uint8_t ep_num) +{ +} + +/*! + \brief handle printer data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +static void printer_data_out (usb_dev *udev, uint8_t ep_num) +{ +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usb_ch9_std.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usb_ch9_std.h new file mode 100644 index 0000000..437733d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usb_ch9_std.h @@ -0,0 +1,223 @@ +/*! + \file usb_ch9_std.h + \brief USB 2.0 standard defines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CH9_STD_H +#define __USB_CH9_STD_H + +#include "usbd_conf.h" + +#define USB_DEV_QUALIFIER_DESC_LEN 0x0AU /*!< USB device qualifier descriptor length */ +#define USB_DEV_DESC_LEN 0x12U /*!< USB device descriptor length */ +#define USB_CFG_DESC_LEN 0x09U /*!< USB configuration descriptor length */ +#define USB_ITF_DESC_LEN 0x09U /*!< USB interface descriptor length */ +#define USB_EP_DESC_LEN 0x07U /*!< USB endpoint descriptor length */ +#define USB_BOS_DESC_LEN 0x0CU /*!< USB BOS descriptor length */ +#define USB_OTG_DESC_LEN 0x03U /*!< USB device OTG descriptor length */ +#define USB_SETUP_PACKET_LEN 0x08U /*!< USB SETUP packet length */ +#define USB_DEVICE_CAPABITY 0x10U /*!< USB device capabity */ + +/* bit 7 of bmRequestType: data phase transfer direction */ +#define USB_TRX_MASK 0x80U /*!< USB transfer direction mask */ +#define USB_TRX_OUT 0x00U /*!< USB transfer OUT direction */ +#define USB_TRX_IN 0x80U /*!< USB transfer IN direction */ + +/* bit 6..5 of bmRequestType: request type */ +#define USB_REQTYPE_STRD 0x00U /*!< USB standard request */ +#define USB_REQTYPE_CLASS 0x20U /*!< USB class request */ +#define USB_REQTYPE_VENDOR 0x40U /*!< USB vendor request */ +#define USB_REQTYPE_MASK 0x60U /*!< USB request mask */ + +#define USBD_BUS_POWERED 0x00U /*!< USB bus power supply */ +#define USBD_SELF_POWERED 0x01U /*!< USB self power supply */ + +#define USB_STATUS_REMOTE_WAKEUP 2U /*!< USB is in remote wakeup status */ +#define USB_STATUS_SELF_POWERED 1U /*!< USB is in self powered status */ + +/* bit 4..0 of bmRequestType: recipient type */ +enum _usb_recp_type +{ + USB_RECPTYPE_DEV = 0x0U, /*!< USB device request type */ + USB_RECPTYPE_ITF = 0x1U, /*!< USB interface request type */ + USB_RECPTYPE_EP = 0x2U, /*!< USB endpoint request type */ + USB_RECPTYPE_MASK = 0x3U /*!< USB request type mask */ +}; + +/* bRequest value */ +enum _usb_request +{ + USB_GET_STATUS = 0x0U, /*!< USB get status request */ + USB_CLEAR_FEATURE = 0x1U, /*!< USB clear feature request */ + USB_RESERVED2 = 0x2U, /*!< USB reserved2 */ + USB_SET_FEATURE = 0x3U, /*!< USB set feature request */ + USB_RESERVED4 = 0x4U, /*!< USB reserved4 */ + USB_SET_ADDRESS = 0x5U, /*!< USB set address request */ + USB_GET_DESCRIPTOR = 0x6U, /*!< USB get descriptor request */ + USB_SET_DESCRIPTOR = 0x7U, /*!< USB set descriptor request */ + USB_GET_CONFIGURATION = 0x8U, /*!< USB get configuration request */ + USB_SET_CONFIGURATION = 0x9U, /*!< USB set configuration request */ + USB_GET_INTERFACE = 0xAU, /*!< USB get interface request */ + USB_SET_INTERFACE = 0xBU, /*!< USB set interface request */ + USB_SYNCH_FRAME = 0xCU /*!< USB synchronized frame request */ +}; + +/* descriptor types of USB specifications */ +enum _usb_desctype +{ + USB_DESCTYPE_DEV = 0x1U, /*!< USB device descriptor type */ + USB_DESCTYPE_CONFIG = 0x2U, /*!< USB configuration descriptor type */ + USB_DESCTYPE_STR = 0x3U, /*!< USB string descriptor type */ + USB_DESCTYPE_ITF = 0x4U, /*!< USB interface descriptor type */ + USB_DESCTYPE_EP = 0x5U, /*!< USB endpoint descriptor type */ + USB_DESCTYPE_DEV_QUALIFIER = 0x6U, /*!< USB device qualifier descriptor type */ + USB_DESCTYPE_OTHER_SPD_CONFIG = 0x7U, /*!< USB other speed configuration descriptor type */ + USB_DESCTYPE_ITF_POWER = 0x8U, /*!< USB interface power descriptor type */ + USB_DESCTYPE_BOS = 0xFU /*!< USB BOS descriptor type */ +}; + +/* USB endpoint descriptor bmAttributes bit definitions */ +/* bits 1..0 : transfer type */ +enum _usbx_type +{ + USB_EP_ATTR_CTL = 0x0U, /*!< USB endpoint control attributes */ + USB_EP_ATTR_ISO = 0x1U, /*!< USB endpoint isochronous attributes */ + USB_EP_ATTR_BULK = 0x2U, /*!< USB endpoint bulk attributes */ + USB_EP_ATTR_INT = 0x3U /*!< USB endpoint interrupt attributes */ +}; + +/* bits 3..2 : Sync type (only if ISOCHRONOUS) */ +#define USB_EP_ATTR_NOSYNC 0x00U /*!< USB endpoint no SYNC attributes */ +#define USB_EP_ATTR_ASYNC 0x04U /*!< USB endpoint ASYNC attributes */ +#define USB_EP_ATTR_ADAPTIVE 0x08U /*!< USB endpoint adaptive attributes */ +#define USB_EP_ATTR_SYNC 0x0CU /*!< USB endpoint SYNC attributes */ +#define USB_EP_ATTR_SYNCTYPE 0x0CU /*!< USB endpoint SYNC type attributes */ + +/* bits 5..4 : usage type (only if ISOCHRONOUS) */ +#define USB_EP_ATTR_DATA 0x00U /*!< USB endpoint data attributes */ +#define USB_EP_ATTR_FEEDBACK 0x10U /*!< USB endpoint feedback attributes */ +#define USB_EP_ATTR_IMPLICIT_FEEDBACK_DATA 0x20U /*!< USB endpoint implicit feedback attributes */ +#define USB_EP_ATTR_USAGETYPE 0x30U /*!< USB endpoint usage type attributes */ + +#pragma pack(1) + +/* USB standard device request structure */ +typedef struct _usb_req +{ + uint8_t bmRequestType; /*!< type of request */ + uint8_t bRequest; /*!< request of setup packet */ + uint16_t wValue; /*!< value of setup packet */ + uint16_t wIndex; /*!< index of setup packet */ + uint16_t wLength; /*!< length of setup packet */ +} usb_req; + +/* USB setup packet definition */ +typedef union _usb_setup +{ + uint8_t data[8]; /*!< USB setup data */ + usb_req req; /*!< USB setup request */ +} usb_setup; + +/* USB descriptor definition */ +typedef struct _usb_desc_header +{ + uint8_t bLength; /*!< size of the descriptor */ + uint8_t bDescriptorType; /*!< type of the descriptor */ +} usb_desc_header; + +typedef struct _usb_desc_dev +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint16_t bcdUSB; /*!< BCD of the supported USB specification */ + uint8_t bDeviceClass; /*!< USB device class */ + uint8_t bDeviceSubClass; /*!< USB device subclass */ + uint8_t bDeviceProtocol; /*!< USB device protocol */ + uint8_t bMaxPacketSize0; /*!< size of the control (address 0) endpoint's bank in bytes */ + uint16_t idVendor; /*!< vendor ID for the USB product */ + uint16_t idProduct; /*!< unique product ID for the USB product */ + uint16_t bcdDevice; /*!< product release (version) number */ + uint8_t iManufacturer; /*!< string index for the manufacturer's name */ + uint8_t iProduct; /*!< string index for the product name/details */ + uint8_t iSerialNumber; /*!< string index for the product's globally unique hexadecimal serial number */ + uint8_t bNumberConfigurations; /*!< total number of configurations supported by the device */ +} usb_desc_dev; + +typedef struct _usb_desc_config +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint16_t wTotalLength; /*!< size of the configuration descriptor header, and all sub descriptors inside the configuration */ + uint8_t bNumInterfaces; /*!< total number of interfaces in the configuration */ + uint8_t bConfigurationValue; /*!< configuration index of the current configuration */ + uint8_t iConfiguration; /*!< index of a string descriptor describing the configuration */ + uint8_t bmAttributes; /*!< configuration attributes */ + uint8_t bMaxPower; /*!< maximum power consumption of the device while in the current configuration */ +} usb_desc_config; + +typedef struct _usb_desc_itf +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bInterfaceNumber; /*!< index of the interface in the current configuration */ + uint8_t bAlternateSetting; /*!< alternate setting for the interface number */ + uint8_t bNumEndpoints; /*!< total number of endpoints in the interface */ + uint8_t bInterfaceClass; /*!< interface class ID */ + uint8_t bInterfaceSubClass; /*!< interface subclass ID */ + uint8_t bInterfaceProtocol; /*!< interface protocol ID */ + uint8_t iInterface; /*!< index of the string descriptor describing the interface */ +} usb_desc_itf; + +typedef struct _usb_desc_ep +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bEndpointAddress; /*!< logical address of the endpoint */ + uint8_t bmAttributes; /*!< endpoint attribute */ + uint16_t wMaxPacketSize; /*!< size of the endpoint bank, in bytes */ + uint8_t bInterval; /*!< polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type */ +} usb_desc_ep; + +typedef struct _usb_desc_LANGID +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint16_t wLANGID; /*!< LANGID code */ +} usb_desc_LANGID; + +typedef struct _usb_desc_str +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint16_t unicode_string[64]; /*!< unicode string data */ +} usb_desc_str; + +#pragma pack() + +/* compute string descriptor length */ +#define USB_STRING_LEN(unicode_chars) (sizeof(usb_desc_header) + ((unicode_chars) << 1)) + +#endif /* __USB_CH9_STD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_core.h new file mode 100644 index 0000000..70ce94d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_core.h @@ -0,0 +1,353 @@ +/*! + \file usbd_core.h + \brief USB device driver core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CORE_H +#define __USBD_CORE_H + +#include "usb_ch9_std.h" + +/* endpoints definitions */ +#define EP_IN(x) ((uint8_t)(0x80U | (x))) +#define EP_OUT(x) ((uint8_t)(x)) + +#define EP_DIR(x) ((uint8_t)((x) >> 7U)) +#define EP_ID(x) ((uint8_t)((x) & 0x7FU)) + +/* USB device endpoint0 max packet size */ +#define USBD_EP0_MAX_SIZE 64U + +#define USBD_TRANSC_COUNT 3U + +/* USB device operation status */ +enum usbd_status +{ + USBD_UNCONNECTED = 0U, /*!< USB device unconnected status */ + USBD_DEFAULT, /*!< USB device default status */ + USBD_ADDRESSED, /*!< USB device addressed status */ + USBD_CONFIGURED, /*!< USB device configured status */ + USBD_SUSPENDED, /*!< USB device suspended status */ + USBD_CONNECTED /*!< USB device connected status */ +}; + +/* USB device operation state */ +enum usbd_state +{ + USBD_OK = 0U, /*!< USB device OK state */ + USBD_BUSY, /*!< USB device busy state */ + USBD_FAIL /*!< USB device fail state */ +}; + +/* USB device type */ +enum usbd_ctl_state +{ + USBD_CTL_IDLE = 0U, + USBD_CTL_DATA_IN, + USBD_CTL_DATA_OUT, + USBD_CTL_STATUS_IN, + USBD_CTL_STATUS_OUT +}; +enum usbd_transc { + TRANSC_SETUP = 0U, /*!< SETUP transaction */ + TRANSC_OUT, /*!< OUT transaction */ + TRANSC_IN, /*!< IN transaction */ + TRANSC_UNKNOWN /*!< unknown transaction */ +}; + +/* USB device endpoint buffer type */ +enum usbd_ep_kind { + EP_BUF_SNG = 0U, /*!< single buffer endpoint type value */ + EP_BUF_DBL /*!< double buffer endpoint type value */ +}; + +/* USB device transaction structure */ +typedef struct +{ + uint8_t ep_stall; /*!< endpoint STALL */ + uint16_t max_len; /*!< packet max length */ + + uint8_t *xfer_buf; /*!< transfer buffer */ + uint16_t xfer_len; /*!< transfer length */ + uint16_t xfer_count; /*!< transfer count */ +} usb_transc; + +/* USB device basic structure */ +typedef struct +{ + uint8_t max_ep_count; /*!< endpoint max count */ + uint8_t twin_buf; /*!< double buffer */ + uint16_t ram_size; /*!< ram size */ +} usb_basic; + +/* USB descriptor */ +typedef struct +{ + uint8_t *dev_desc; /*!< device descriptor */ + uint8_t *config_desc; /*!< configure descriptor */ + uint8_t *bos_desc; /*!< BOS descriptor */ + uint8_t **strings; /*!< strings descriptor */ +} usb_desc; + +/* USB power management */ +typedef struct +{ + uint8_t power_mode; /*!< power mode */ + uint8_t power_low; /*!< power low */ + uint8_t esof_count; /*!< ESOF count */ + uint8_t suspend_enabled; /*!< suspend enabled flag */ + uint8_t remote_wakeup; /*!< remote wakeup */ + uint8_t remote_wakeup_on; /*!< remote wakeup enable */ + uint8_t lpm_enable; /*!< LPM enable */ +} usb_pm; + +/* USB LPM management */ +typedef struct +{ + uint32_t besl; /*!< BESL */ + uint32_t L1_resume; /*!< L1 resume */ + uint32_t L1_remote_wakeup; /*!< L1 remote wakeup */ +} usb_lpm; + +/* USB control information */ +typedef struct +{ + usb_req req; /*!< USB request */ + uint8_t ctl_zlp; /*!< control zero length packet */ + uint8_t ctl_state; /*!< control state */ +} usb_control; + +typedef struct _usb_dev usb_dev; +typedef struct _usb_handler usb_handler; +typedef void (*usb_ep_transc) (usb_dev *usbd_dev, uint8_t ep_num); + +/* USB class structure */ +typedef struct +{ + uint8_t req_cmd; + uint8_t req_altset; + + uint8_t (*init) (usb_dev *udev, uint8_t config_index); + uint8_t (*deinit) (usb_dev *udev, uint8_t config_index); + + uint8_t (*req_process) (usb_dev *udev, usb_req *req); + + uint8_t (*ctlx_in) (usb_dev *udev); + uint8_t (*ctlx_out) (usb_dev *udev); + + void (*data_in) (usb_dev *udev, uint8_t ep_num); + void (*data_out) (usb_dev *udev, uint8_t ep_num); +} usb_class; + +/* USB core driver structure */ +struct _usb_dev +{ + /* basic parameters */ + uint8_t config; + uint8_t dev_addr; + + __IO uint8_t cur_status; + __IO uint8_t backup_status; + + usb_pm pm; +#ifdef LPM_ENABLED + usb_lpm lpm; +#endif /* LPM_ENABLED */ + usb_control control; + + usb_transc transc_out[EP_COUNT]; + usb_transc transc_in[EP_COUNT]; + + usb_ep_transc ep_transc[EP_COUNT][USBD_TRANSC_COUNT]; + + /* device class */ + usb_desc *desc; + usb_class *class_core; + usb_handler *drv_handler; + + void *class_data[USBD_ITF_MAX_NUM]; + void *user_data; + void *data; +}; + +typedef struct +{ + uint8_t (*SOF) (usb_dev *udev); /*!< SOF ISR callback */ +} usbd_int_cb_struct; + +/* USB handler structure */ +struct _usb_handler +{ + void (*init) (void); + void (*deinit) (void); + + void (*dp_pullup) (FlagStatus status); + void (*set_addr) (usb_dev *udev); + void (*suspend) (void); + void (*suspend_leave) (void); + void (*resume) (usb_dev *udev); + + void (*ep_reset) (usb_dev *udev); + void (*ep_setup) (usb_dev *udev, uint8_t buf_kind, uint32_t buf_addr, const usb_desc_ep *ep_desc); + void (*ep_disable) (usb_dev *udev, uint8_t ep_addr); + void (*ep_rx_enable) (usb_dev *udev, uint8_t ep_num); + void (*ep_write) (uint8_t *fifo, uint8_t ep_num, uint16_t bytes); + uint16_t (*ep_read) (uint8_t *fifo, uint8_t ep_num, uint8_t buf_kind); + void (*ep_stall_set) (usb_dev *udev, uint8_t ep_addr); + void (*ep_stall_clear) (usb_dev *udev, uint8_t ep_addr); + uint16_t (*ep_status_get) (usb_dev *udev, uint8_t ep_addr); +}; + +extern usbd_int_cb_struct *usbd_int_fops; + +/* static inline function definitions */ +/*! + \brief device connect + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_connect (usb_dev *udev) +{ + udev->drv_handler->dp_pullup(SET); + + udev->cur_status = (uint8_t)USBD_CONNECTED; +} + + +/*! + \brief device disconnect + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_disconnect (usb_dev *udev) +{ + udev->drv_handler->dp_pullup(RESET); + + udev->cur_status = (uint8_t)USBD_UNCONNECTED; +} + +/*! + \brief device core register configure when stop device + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_core_deinit (usb_dev *udev) +{ + udev->drv_handler->deinit(); +} + +/*! + \brief initialize endpoint + \param[in] udev: pointer to USB core instance + \param[in] buf_kind: endpoint buffer kind + \param[in] buf_addr: buffer address + \param[in] ep_desc: pointer to endpoint descriptor + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_ep_init (usb_dev *udev, uint8_t buf_kind, uint32_t buf_addr, const usb_desc_ep *ep_desc) +{ + udev->drv_handler->ep_setup(udev, buf_kind, buf_addr, ep_desc); +} + +/*! + \brief configure the endpoint when it is disabled + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_ep_deinit (usb_dev *udev, uint8_t ep_addr) +{ + udev->drv_handler->ep_disable(udev, ep_addr); +} + +/*! + \brief set an endpoint to STALL status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_ep_stall (usb_dev *udev, uint8_t ep_addr) +{ + udev->drv_handler->ep_stall_set(udev, ep_addr); +} + +/*! + \brief clear endpoint stalled status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_ep_clear_stall (usb_dev *udev, uint8_t ep_addr) +{ + udev->drv_handler->ep_stall_clear(udev, ep_addr); +} + +/*! + \brief get endpoint status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +__STATIC_INLINE uint16_t usbd_ep_status_get (usb_dev *udev, uint8_t ep_addr) +{ + return udev->drv_handler->ep_status_get(udev, ep_addr); +} + +/* function declarations */ +/* initialize USBD */ +void usbd_init(usb_dev *udev, usb_desc *desc, usb_class *usbc); +/* endpoint prepare to transmit data */ +void usbd_ep_send (usb_dev *udev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len); +/* endpoint prepare to receive data */ +void usbd_ep_recev (usb_dev *udev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len); + +#endif /* __USBD_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_enum.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_enum.h new file mode 100644 index 0000000..2613010 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_enum.h @@ -0,0 +1,110 @@ +/*! + \file usbd_enum.h + \brief USB enumeration definitions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_ENUM_H +#define __USBD_ENUM_H + +#include "usbd_core.h" + +#ifndef NULL + #define NULL 0U +#endif + +/* request state enumeration */ +typedef enum _usb_reqsta +{ + REQ_SUPP = 0x0U, /* supported request */ + REQ_NOTSUPP = 0x1U /* unsupported request */ +} usb_reqsta; + +/* string descriptor index enumeration */ +enum _str_index +{ + STR_IDX_LANGID = 0x0U, /* language ID string index */ + STR_IDX_MFC = 0x1U, /* manufacturer string index */ + STR_IDX_PRODUCT = 0x2U, /* product string index */ + STR_IDX_SERIAL = 0x3U, /* serial string index */ + STR_IDX_CONFIG = 0x4U, /* configuration string index */ + STR_IDX_ITF = 0x5U, /* interface string index */ + STR_IDX_MAX = 0x8U /* string index max value */ +}; + +/* PWR status enumeration */ +typedef enum +{ + USB_PWRSTA_SELF_POWERED = 0x1U, /* USB is in self powered status */ + USB_PWRSTA_REMOTE_WAKEUP = 0x2U, /* USB is in remote wakeup status */ +} usb_pwrsta; + +/* USB endpoint feature enumeration */ +typedef enum +{ + USB_FEATURE_EP_HALT = 0x0U, /* USB has endpoint halt feature */ + USB_FEATURE_REMOTE_WAKEUP = 0x1U, /* USB has endpoint remote wakeup feature */ + USB_FEATURE_TEST_MODE = 0x2U /* USB has endpoint test mode feature */ +} usb_feature; + +#define ENG_LANGID 0x0409U /* english language ID */ +#define CHN_LANGID 0x0804U /* chinese language ID */ + +/* device unique ID */ +#define DEVICE_ID1 (0x1FFFF7E8U) /* device ID1 */ +#define DEVICE_ID2 (0x1FFFF7ECU) /* device ID2 */ +#define DEVICE_ID3 (0x1FFFF7F0U) /* device ID3 */ + +#define DEVICE_ID (0x40022100U) /* device ID information */ + +//#define USB_SERIAL_STRING_SIZE 0x1AU + +/* USB device exported macros */ +#define BYTE_SWAP(addr) (((uint16_t)(*((uint8_t *)(addr)))) + \ + (uint16_t)(((uint16_t)(*(((uint8_t *)(addr)) + 1U))) << 8U)) +#define BYTE_LOW(x) ((uint8_t)((x) & 0x00FFU)) +#define BYTE_HIGH(x) ((uint8_t)(((x) & 0xFF00U) >> 8U)) + +#define USB_MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#define CTL_EP(ep) (((ep) == 0x00U) || ((ep) == 0x80U)) + +/* function declarations */ +/* handle USB standard device request */ +usb_reqsta usbd_standard_request (usb_dev *udev, usb_req *req); +/* handle device class request */ +usb_reqsta usbd_class_request (usb_dev *udev, usb_req *req); +/* handle USB vendor request */ +usb_reqsta usbd_vendor_request (usb_dev *udev, usb_req *req); +/* get serial string */ +void serial_string_get (uint16_t *unicode_str); + +#endif /* __USBD_ENUM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_pwr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_pwr.h new file mode 100644 index 0000000..a0918d9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_pwr.h @@ -0,0 +1,67 @@ +/*! + \file usbd_pwr.h + \brief USB device power management functions prototype + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_PWR_H +#define __USBD_PWR_H + +#include "usbd_core.h" + +/* static inline function definitions */ +/*! + \brief first operation of USB wakeup is to wakeup MCU + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void resume_mcu (usb_dev *udev) +{ + udev->drv_handler->suspend_leave(); +} + +/*! + \brief set USB device to suspend mode + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_to_suspend (usb_dev *udev) +{ + udev->drv_handler->suspend(); +} + +/* function declarations */ +/* start to remote wakeup */ +void usbd_remote_wakeup_active (usb_dev *udev); + +#endif /* __USBD_PWR_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_transc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_transc.h new file mode 100644 index 0000000..73db3ae --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Include/usbd_transc.h @@ -0,0 +1,139 @@ +/*! + \file usbd_transc.h + \brief USBD transaction + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_TRANSC_H +#define __USB_TRANSC_H + +#include "usbd_core.h" + +/*! + \brief USB transaction configure + \param[in] transc: pointer to USB device transaction instance + \param[in] buf: transfer data buffer + \param[in] len: transfer data length + \param[in] count: transfer data counter + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_transc_config (usb_transc *transc, uint8_t *buf, uint16_t len, uint16_t count) +{ + transc->xfer_buf = buf; + transc->xfer_len = len; + transc->xfer_count = count; +} + +/*! + \brief USB stalled transaction + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_stall_transc (usb_dev *udev) +{ + usbd_ep_stall(udev, 0x0U); +} + + +/*! + \brief USB control transaction status IN stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static inline void usb_ctl_status_in (usb_dev *udev) +{ + udev->control.ctl_state = USBD_CTL_STATUS_IN; + + udev->drv_handler->ep_write(udev->transc_in[0].xfer_buf, 0U, 0U); +} + +/*! + \brief USB control transaction data IN stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static inline void usb_ctl_data_in (usb_dev *udev) +{ + udev->control.ctl_state = USBD_CTL_DATA_IN; + + usbd_ep_send(udev, 0U, udev->transc_in[0].xfer_buf, udev->transc_in[0].xfer_len); +} + +/*! + \brief USB control transaction data OUT stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static inline void usb_ctl_data_out (usb_dev *udev) +{ + udev->control.ctl_state = USBD_CTL_DATA_OUT; + + udev->drv_handler->ep_rx_enable(udev, 0U); +} + +/*! + \brief USB control transaction status OUT stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static inline void usb_ctl_status_out (usb_dev *udev) +{ + udev->control.ctl_state = USBD_CTL_STATUS_OUT; + + udev->drv_handler->ep_rx_enable(udev, 0U); +} + +/*! + \brief USB send 0 length data packet + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static inline void usb_0len_packet_send (usb_dev *udev) +{ + udev->drv_handler->ep_write(udev->transc_in[0].xfer_buf, 0U, 0U); +} + +/* function declarations */ +/* process USB SETUP transaction */ +void _usb_setup_transc (usb_dev *udev, uint8_t ep_num); +/* process USB OUT transaction */ +void _usb_out0_transc (usb_dev *udev, uint8_t ep_num); +/* process USB IN transaction */ +void _usb_in0_transc (usb_dev *udev, uint8_t ep_num); + +#endif /* __USB_TRANSC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_core.c new file mode 100644 index 0000000..6f9e6a4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_core.c @@ -0,0 +1,128 @@ +/*! + \file usbd_core.c + \brief USB device driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_core.h" +#include "usbd_enum.h" +#include "usbd_transc.h" +#include "usbd_lld_core.h" + +usbd_int_cb_struct *usbd_int_fops = NULL; + +/*! + \brief configure USB device initialization + \param[in] udev: pointer to USB core instance + \param[in] desc: pointer to USB descriptor + \param[in] usbc: USB class + \param[out] none + \retval none +*/ +void usbd_init (usb_dev *udev, usb_desc *desc, usb_class *usbc) +{ + /* configure USBD core basic attributes */ + usbd_core.basic.max_ep_count = 8U; + usbd_core.basic.twin_buf = 1U; + usbd_core.basic.ram_size = 512U; + + usbd_core.dev = udev; + + udev->desc = desc; + udev->class_core = usbc; + udev->drv_handler = &usbd_drv_handler; + + udev->control.ctl_state = USBD_CTL_IDLE; + udev->ep_transc[0][TRANSC_SETUP] = _usb_setup_transc; + udev->ep_transc[0][TRANSC_OUT] = _usb_out0_transc; + udev->ep_transc[0][TRANSC_IN] = _usb_in0_transc; + + /* configure power management */ + udev->pm.power_mode = (udev->desc->config_desc[7] & 0x40U) >> 5U; + + /* enable USB suspend */ + udev->pm.suspend_enabled = 1U; + + /* USB low level initialization */ + udev->drv_handler->init(); + + /* create serial string */ + serial_string_get((uint16_t *)udev->desc->strings[STR_IDX_SERIAL]); +} + +/*! + \brief endpoint prepare to receive data + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[in] pbuf: user buffer address pointer + \param[in] buf_len: buffer length + \param[out] none + \retval none +*/ +void usbd_ep_recev (usb_dev *udev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len) +{ + /* configure the transaction level parameters */ + usb_transc *transc = &udev->transc_out[EP_ID(ep_addr)]; + + usb_transc_config(transc, pbuf, buf_len, 0U); + + /* enable endpoint to receive */ + udev->drv_handler->ep_rx_enable(udev, ep_addr); +} + +/*! + \brief endpoint prepare to transmit data + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[in] pbuf: transmit buffer address pointer + \param[in] buf_len: buffer length + \param[out] none + \retval none +*/ +void usbd_ep_send (usb_dev *udev, uint8_t ep_addr, uint8_t *pbuf, uint16_t buf_len) +{ + uint8_t ep_num = EP_ID(ep_addr); + + usb_transc *transc = &udev->transc_in[ep_num]; + + uint16_t len = USB_MIN(buf_len, transc->max_len); + + /* configure the transaction level parameters */ + udev->drv_handler->ep_write(pbuf, ep_num, len); + + usb_transc_config(transc, pbuf + len, buf_len - len, len); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_enum.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_enum.c new file mode 100644 index 0000000..dbffa6d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_enum.c @@ -0,0 +1,755 @@ +/*! + \file usbd_enum.c + \brief USB enumeration function + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_transc.h" + +/* USB enumeration handle functions */ +static usb_reqsta _usb_std_getstatus (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_clearfeature (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_setfeature (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_setaddress (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_getdescriptor (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_setdescriptor (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_getconfiguration (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_setconfiguration (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_reserved (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_getinterface (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_setinterface (usb_dev *udev, usb_req *req); +static usb_reqsta _usb_std_synchframe (usb_dev *udev, usb_req *req); + +static uint8_t* _usb_dev_desc_get (usb_dev *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_config_desc_get (usb_dev *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_str_desc_get (usb_dev *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_bos_desc_get (usb_dev *udev, uint8_t index, uint16_t *len); + +static void int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len); + +/* standard device request handler */ +static usb_reqsta (*_std_dev_req[]) (usb_dev *udev, usb_req *req) = { + [USB_GET_STATUS] = _usb_std_getstatus, + [USB_CLEAR_FEATURE] = _usb_std_clearfeature, + [USB_RESERVED2] = _usb_std_reserved, + [USB_SET_FEATURE] = _usb_std_setfeature, + [USB_RESERVED4] = _usb_std_reserved, + [USB_SET_ADDRESS] = _usb_std_setaddress, + [USB_GET_DESCRIPTOR] = _usb_std_getdescriptor, + [USB_SET_DESCRIPTOR] = _usb_std_setdescriptor, + [USB_GET_CONFIGURATION] = _usb_std_getconfiguration, + [USB_SET_CONFIGURATION] = _usb_std_setconfiguration, + [USB_GET_INTERFACE] = _usb_std_getinterface, + [USB_SET_INTERFACE] = _usb_std_setinterface, + [USB_SYNCH_FRAME] = _usb_std_synchframe, +}; + +/* get standard descriptor handler */ +static uint8_t* (*std_desc_get[])(usb_dev *udev, uint8_t index, uint16_t *len) = { + [USB_DESCTYPE_DEV - 1U] = _usb_dev_desc_get, + [USB_DESCTYPE_CONFIG - 1U] = _usb_config_desc_get, + [USB_DESCTYPE_STR - 1U] = _usb_str_desc_get +}; + +/*! + \brief handle USB standard device request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device operation cur_status +*/ +usb_reqsta usbd_standard_request (usb_dev *udev, usb_req *req) +{ + /* call device request handle function */ + return (*_std_dev_req[req->bRequest]) (udev, req); +} + +/*! + \brief handle USB device class request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device class request + \param[out] none + \retval USB device request status +*/ +usb_reqsta usbd_class_request (usb_dev *udev, usb_req *req) +{ + if ((uint8_t)USBD_CONFIGURED == udev->cur_status) { + if (BYTE_LOW(req->wIndex) < USBD_ITF_MAX_NUM) { + /* call device class handle function */ + return (usb_reqsta)udev->class_core->req_process(udev, req); + } + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB vendor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB vendor request + \param[out] none + \retval USB device request status +*/ +usb_reqsta usbd_vendor_request (usb_dev *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* added by user */ + + return REQ_NOTSUPP; +} + +/*! + \brief no operation, just for reserved + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_reserved (usb_dev *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no operation */ + return REQ_NOTSUPP; +} + +/*! + \brief get the device descriptor + \param[in] udev: pointer to USB device instance + \param[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_dev_desc_get (usb_dev *udev, uint8_t index, uint16_t *len) +{ + (void)index; + + *len = udev->desc->dev_desc[0]; + + return udev->desc->dev_desc; +} + +/*! + \brief get the configuration descriptor + \brief[in] udev: pointer to USB device instance + \brief[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_config_desc_get (usb_dev *udev, uint8_t index, uint16_t *len) +{ + (void)index; + + *len = udev->desc->config_desc[2] | (udev->desc->config_desc[3]<< 8U); + + return udev->desc->config_desc; +} + +/*! + \brief get the BOS descriptor + \brief[in] udev: pointer to USB device instance + \brief[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_bos_desc_get (usb_dev *udev, uint8_t index, uint16_t *len) +{ + if (NULL != udev->desc->bos_desc) { + (void)index; + + *len = (uint16_t)udev->desc->bos_desc[2] | (uint16_t)((uint16_t)udev->desc->bos_desc[3] << 8); + + return udev->desc->bos_desc; + } else { + *len = 0U; + + return NULL; + } +} + +/*! + \brief get string descriptor + \param[in] udev: pointer to USB device instance + \param[in] index: string descriptor index + \param[out] len: pointer to string length + \retval string descriptor +*/ +static uint8_t* _usb_str_desc_get (usb_dev *udev, uint8_t index, uint16_t *len) +{ + uint8_t* desc = udev->desc->strings[index]; + + *len = desc[0]; + + return desc; +} + +/*! + \brief handle Get_Status request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getstatus (usb_dev *udev, usb_req *req) +{ + uint8_t recp = BYTE_LOW(req->wIndex); + + usb_reqsta req_status = REQ_NOTSUPP; + + static uint8_t status[2] = {0U}; + + switch(req->bmRequestType & USB_RECPTYPE_MASK) { + /* handle device get status request */ + case USB_RECPTYPE_DEV: + switch (udev->cur_status) { + case USBD_ADDRESSED: + case USBD_CONFIGURED: + if (udev->pm.power_mode) { + status[0] = USB_STATUS_SELF_POWERED; + } else { + status[0] = 0U; + } + + if (udev->pm.remote_wakeup) { + status[0] |= USB_STATUS_REMOTE_WAKEUP; + } else { + status[0] = 0U; + } + + req_status = REQ_SUPP; + break; + + default: + break; + } + break; + + /* handle interface get status request */ + case USB_RECPTYPE_ITF: + if (((uint8_t)USBD_CONFIGURED == udev->cur_status) && (recp < USBD_ITF_MAX_NUM)) { + req_status = REQ_SUPP; + } + break; + + /* handle endpoint get status request */ + case USB_RECPTYPE_EP: + if ((uint8_t)USBD_CONFIGURED == udev->cur_status) { + if (0x80U == (recp & 0x80U)) { + status[0] = udev->transc_in[EP_ID(recp)].ep_stall; + } else { + status[0] = udev->transc_out[recp].ep_stall; + } + req_status = REQ_SUPP; + } + break; + + default: + break; + } + + if (REQ_SUPP == req_status) { + usb_transc_config(&udev->transc_in[0], status, 2U, 2U); + } + + return req_status; +} + +/*! + \brief handle USB Clear_Feature request + \param[in] udev: pointer to USB device instance + \param[in] req: USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_clearfeature (usb_dev *udev, usb_req *req) +{ + uint8_t ep = 0U; + + switch (req->bmRequestType & (uint8_t)USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + switch (udev->cur_status) { + case USBD_ADDRESSED: + case USBD_CONFIGURED: + /* clear device remote wakeup feature */ + if ((uint16_t)USB_FEATURE_REMOTE_WAKEUP == req->wValue) { + udev->pm.remote_wakeup = 0U; + + return REQ_SUPP; + } + break; + + default: + break; + } + break; + + case USB_RECPTYPE_EP: + /* get endpoint address */ + ep = BYTE_LOW(req->wIndex); + + if (((uint8_t)USBD_CONFIGURED == udev->cur_status) && (EP_ID(ep) < EP_COUNT)) { + /* clear endpoint halt feature */ + if (((uint16_t)USB_FEATURE_EP_HALT == req->wValue) && (!CTL_EP(ep))) { + if(0U != usbd_ep_status_get(udev, ep)){ + usbd_ep_clear_stall(udev, ep); + udev->class_core->req_process(udev, req); + + return REQ_SUPP; + } + } + } + break; + + case USB_RECPTYPE_ITF: + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Feature request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setfeature (usb_dev *udev, usb_req *req) +{ + uint8_t ep = 0U; + + switch (req->bmRequestType & (uint8_t)USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + switch (udev->cur_status) { + case USBD_ADDRESSED: + case USBD_CONFIGURED: + /* set device remote wakeup feature */ + if ((uint16_t)USB_FEATURE_REMOTE_WAKEUP == req->wValue) { + udev->pm.remote_wakeup = 1U; + + return REQ_SUPP; + } + break; + + default: + break; + } + break; + + case USB_RECPTYPE_EP: + /* get endpoint address */ + ep = BYTE_LOW(req->wIndex); + + if (((uint8_t)USBD_CONFIGURED == udev->cur_status) && (EP_ID(ep) < EP_COUNT)) { + /* set endpoint halt feature */ + if (((uint16_t)USB_FEATURE_EP_HALT == req->wValue) && (!CTL_EP(ep))) { + /* check whether the endpoint status is disabled */ + if(0U != usbd_ep_status_get(udev, ep)){ + usbd_ep_stall(udev, ep); + udev->class_core->req_process(udev, req); + + return REQ_SUPP; + } + } + } + + break; + + case USB_RECPTYPE_ITF: + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Address request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setaddress (usb_dev *udev, usb_req *req) +{ + if ((0U == req->wIndex) && (0U == req->wLength)) { + udev->dev_addr = (uint8_t)(req->wValue) & 0x7FU; + + if (udev->cur_status != (uint8_t)USBD_CONFIGURED) { + if (udev->dev_addr) { + udev->cur_status = (uint8_t)USBD_ADDRESSED; + } else { + udev->cur_status = (uint8_t)USBD_DEFAULT; + } + + return REQ_SUPP; + } + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Get_Descriptor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getdescriptor (usb_dev *udev, usb_req *req) +{ + uint8_t desc_type = 0U; + uint8_t desc_index = 0U; + + usb_reqsta status = REQ_NOTSUPP; + + usb_transc *transc = &udev->transc_in[0]; + + switch (req->bmRequestType & USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + desc_type = BYTE_HIGH(req->wValue); + desc_index = BYTE_LOW(req->wValue); + + switch (desc_type) { + case USB_DESCTYPE_DEV: + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, &transc->xfer_len); + if (64U == req->wLength) { + transc->xfer_len = 8U; + } + break; + + case USB_DESCTYPE_CONFIG: + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, &transc->xfer_len); + break; + + case USB_DESCTYPE_STR: + if (desc_index < STR_IDX_MAX) { + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, &transc->xfer_len); + } + break; + + case USB_DESCTYPE_ITF: + case USB_DESCTYPE_EP: + case USB_DESCTYPE_DEV_QUALIFIER: + case USB_DESCTYPE_OTHER_SPD_CONFIG: + case USB_DESCTYPE_ITF_POWER: + break; + + case USB_DESCTYPE_BOS: + transc->xfer_buf = _usb_bos_desc_get(udev, desc_index, &transc->xfer_len); + break; + + default: + break; + } + break; + + case USB_RECPTYPE_ITF: + /* get device class special descriptor */ + status = (usb_reqsta)(udev->class_core->req_process(udev, req)); + break; + + case USB_RECPTYPE_EP: + break; + + default: + break; + } + + if ((transc->xfer_len) && (req->wLength)) { + transc->xfer_len = USB_MIN(transc->xfer_len, req->wLength); + + if ((transc->xfer_len < udev->control.req.wLength) && + (0U == transc->xfer_len % transc->max_len)) { + udev->control.ctl_zlp = 1U; + } + + status = REQ_SUPP; + } + + return status; +} + +/*! + \brief handle USB Set_Descriptor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setdescriptor (usb_dev *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no handle */ + return REQ_SUPP; +} + +/*! + \brief handle USB Get_Configuration request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getconfiguration (usb_dev *udev, usb_req *req) +{ + (void)req; + + usb_reqsta req_status = REQ_NOTSUPP; + + switch (udev->cur_status) { + case USBD_ADDRESSED: + if (0U == udev->config) { + req_status = REQ_SUPP; + } + break; + + case USBD_CONFIGURED: + if (udev->config) { + req_status = REQ_SUPP; + } + break; + + default: + break; + } + + if (REQ_SUPP == req_status) { + usb_transc_config(&udev->transc_in[0], &(udev->config), 1U, 1U); + } + + return req_status; +} + +/*! + \brief handle USB Set_Configuration request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device operation cur_status +*/ +static usb_reqsta _usb_std_setconfiguration (usb_dev *udev, usb_req *req) +{ + static uint8_t config; + usb_reqsta status = REQ_NOTSUPP; + + config = (uint8_t)(req->wValue); + + if (config <= USBD_CFG_MAX_NUM) { + switch (udev->cur_status) { + case USBD_ADDRESSED: + if (config){ + (void)udev->class_core->init(udev, config); + + udev->config = config; + udev->cur_status = (uint8_t)USBD_CONFIGURED; + } + status = REQ_SUPP; + break; + + case USBD_CONFIGURED: + if (0U == config) { + (void)udev->class_core->deinit(udev, config); + + udev->config = config; + udev->cur_status = (uint8_t)USBD_ADDRESSED; + } else if (config != udev->config) { + /* clear old configuration */ + (void)udev->class_core->deinit(udev, udev->config); + + /* set new configuration */ + udev->config = config; + + (void)udev->class_core->init(udev, config); + } else { + /* no operation */ + } + status = REQ_SUPP; + break; + + case USBD_DEFAULT: + break; + + default: + break; + } + } + + return status; +} + +/*! + \brief handle USB Get_Interface request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getinterface (usb_dev *udev, usb_req *req) +{ + switch (udev->cur_status) { + case USBD_DEFAULT: + break; + + case USBD_ADDRESSED: + break; + + case USBD_CONFIGURED: + if (BYTE_LOW(req->wIndex) < USBD_ITF_MAX_NUM) { + usb_transc_config(&udev->transc_in[0], &(udev->class_core->req_altset), 1U, 1U); + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Interface request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setinterface (usb_dev *udev, usb_req *req) +{ + switch (udev->cur_status) { + case USBD_DEFAULT: + break; + + case USBD_ADDRESSED: + break; + + case USBD_CONFIGURED: + if (BYTE_LOW(req->wIndex) < USBD_ITF_MAX_NUM) { + udev->class_core->req_altset = (uint8_t)req->wValue; + + udev->class_core->req_process(udev, req); + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB SynchFrame request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_synchframe (usb_dev *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no handle */ + return REQ_SUPP; +} + +/*! + \brief convert hex 32bits value into unicode char + \param[in] value: Hex 32bits value + \param[in] pbuf: buffer pointer to store unicode char + \param[in] len: value length + \param[out] none + \retval none +*/ +static void int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len) +{ + uint8_t index = 0U; + + for (index = 0U; index < len; index++) { + if ((value >> 28U) < 0x0AU) { + pbuf[2U * index] = (uint8_t)((value >> 28) + '0'); + } else { + pbuf[2U * index] = (uint8_t)((value >> 28) + 'A' - 10U); + } + + value = value << 4U; + + pbuf[2U * index + 1U] = 0U; + } +} + +/*! + \brief convert hex 32bits value into unicode char + \param[in] unicode_str: pointer to unicode string + \param[out] none + \retval none +*/ +void serial_string_get (uint16_t *unicode_str) +{ + if (6U != (unicode_str[0] & 0x00FFU)) { + uint32_t DeviceSerial0, DeviceSerial1, DeviceSerial2; + + DeviceSerial0 = *(uint32_t*)DEVICE_ID1; + DeviceSerial1 = *(uint32_t*)DEVICE_ID2; + DeviceSerial2 = *(uint32_t*)DEVICE_ID3; + + DeviceSerial0 += DeviceSerial2; + + if (0U != DeviceSerial0) { + int_to_unicode(DeviceSerial0, (uint8_t*)&(unicode_str[1]), 8U); + int_to_unicode(DeviceSerial1, (uint8_t*)&(unicode_str[9]), 4U); + } + } else { + uint32_t device_serial = *(uint32_t*)DEVICE_ID; + + if (0U != device_serial) { + unicode_str[1] = (uint16_t)(device_serial & 0x0000FFFFU); + unicode_str[2] = (uint16_t)((device_serial & 0xFFFF0000U) >> 16U); + + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_pwr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_pwr.c new file mode 100644 index 0000000..f242741 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_pwr.c @@ -0,0 +1,60 @@ +/*! + \file usbd_pwr.c + \brief USB device power management driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_pwr.h" + +/*! + \brief start to remote wakeup + \param[in] udev: pointer to USB core instance + \param[out] none + \retval none +*/ +void usbd_remote_wakeup_active(usb_dev *udev) +{ + resume_mcu(udev); + +#ifdef LPM_ENABLED + if(1U == udev->lpm.L1_remote_wakeup){ + udev->drv_handler->resume(udev); + + udev->lpm.L1_resume = 1U; + } +#endif /* LPM_ENABLED */ + + if(1U == udev->pm.remote_wakeup){ + udev->pm.remote_wakeup_on = 1U; + udev->pm.esof_count = 15U; + udev->drv_handler->resume(udev); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_transc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_transc.c new file mode 100644 index 0000000..3786cde --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/device/Source/usbd_transc.c @@ -0,0 +1,167 @@ +/*! + \file usbd_transc.c + \brief USBD transaction function + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_transc.h" + +/* local function prototypes ('static') */ +static inline void usb_stall_transc (usb_dev *udev); +static inline void usb_ctl_data_in(usb_dev *udev); +static inline void usb_ctl_status_in(usb_dev *udev); +static inline void usb_ctl_data_out (usb_dev *udev); +static inline void usb_ctl_status_out(usb_dev *udev); +static inline void usb_0len_packet_send(usb_dev *udev); + + +/*! + \brief USB setup stage processing + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier(0..7) + \param[out] none + \retval none +*/ +void _usb_setup_transc (usb_dev *udev, uint8_t ep_num) +{ + (void)ep_num; + + usb_reqsta reqstat = REQ_NOTSUPP; + + uint16_t count = udev->drv_handler->ep_read((uint8_t *)(&udev->control.req), 0U, (uint8_t)EP_BUF_SNG); + + if (count != USB_SETUP_PACKET_LEN) { + usb_stall_transc(udev); + + return; + } + + switch (udev->control.req.bmRequestType & USB_REQTYPE_MASK) { + /* standard device request */ + case USB_REQTYPE_STRD: + reqstat = usbd_standard_request(udev, &udev->control.req); + break; + + /* device class request */ + case USB_REQTYPE_CLASS: + reqstat = usbd_class_request(udev, &udev->control.req); + break; + + /* vendor defined request */ + case USB_REQTYPE_VENDOR: + reqstat = usbd_vendor_request(udev, &udev->control.req); + break; + + default: + break; + } + + if (REQ_SUPP == reqstat) { + if (0U == udev->control.req.wLength) { + /* USB control transfer status in stage */ + usb_ctl_status_in(udev); + } else { + if (udev->control.req.bmRequestType & 0x80U) { + usb_ctl_data_in(udev); + } else { + /* USB control transfer data out stage */ + usb_ctl_data_out(udev); + } + } + } else { + usb_stall_transc(udev); + } +} + +/*! + \brief data out stage processing + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier(0..7) + \param[out] none + \retval none +*/ +void _usb_out0_transc (usb_dev *udev, uint8_t ep_num) +{ + if (((uint8_t)USBD_CONFIGURED == udev->cur_status) && (NULL != udev->class_core->ctlx_out)) { + /* device class handle */ + (void)udev->class_core->ctlx_out(udev); + } + + if (USBD_CTL_DATA_OUT == udev->control.ctl_state) { + /* enter the control transaction status IN stage */ + usb_ctl_status_in(udev); + } else if (USBD_CTL_STATUS_OUT == udev->control.ctl_state) { + usb_transc_config(&udev->transc_out[ep_num], NULL, 0U, 0U); + + udev->control.ctl_state = USBD_CTL_IDLE; + } else { + /* no operation */ + } + +} + +/*! + \brief data in stage processing + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier(0..7) + \param[out] none + \retval none +*/ +void _usb_in0_transc (usb_dev *udev, uint8_t ep_num) +{ + (void)ep_num; + + if (udev->control.ctl_zlp) { + /* send 0 length packet */ + usb_0len_packet_send(udev); + + udev->control.ctl_zlp = 0U; + } + + if (((uint8_t)USBD_CONFIGURED == udev->cur_status) && (NULL != udev->class_core->ctlx_in)) { + (void)udev->class_core->ctlx_in(udev); + } + + if (USBD_CTL_DATA_IN == udev->control.ctl_state) { + /* USB control transfer status OUT stage */ + usb_ctl_status_out(udev); + } else if (USBD_CTL_STATUS_IN == udev->control.ctl_state) { + udev->control.ctl_state = USBD_CTL_IDLE; + } + + + if (0U != udev->dev_addr) { + udev->drv_handler->set_addr(udev); + + udev->dev_addr = 0U; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_core.h new file mode 100644 index 0000000..a7c7e14 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_core.h @@ -0,0 +1,73 @@ +/*! + \file usbd_lld_core.h + \brief USB device low level driver core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_LLD_CORE_H +#define __USBD_LLD_CORE_H + +#include "usbd_lld_regs.h" +#include "usbd_core.h" + +/* double buffer endpoint direction enumeration */ +enum dbuf_ep_dir +{ + DBUF_EP_IN, /*!< double buffer in direction */ + DBUF_EP_OUT, /*!< double buffer out direction */ + DBUF_EP_ERR, /*!< double buffer error direction */ +}; + +/* USBD endpoint ram structure */ +typedef struct +{ + __IO uint32_t tx_addr; /*!< transmission address */ + __IO uint32_t tx_count; /*!< transmission count */ + __IO uint32_t rx_addr; /*!< reception address */ + __IO uint32_t rx_count; /*!< reception count */ +} usbd_ep_ram; + +extern struct _usb_handler usbd_drv_handler; + +/* USB core driver structure */ +typedef struct +{ + usb_basic basic; + usb_dev *dev; +} usb_core_drv; + +extern usb_core_drv usbd_core; + +/* function declarations */ +/* free buffer used from application by toggling the SW_BUF byte */ +void user_buffer_free (uint8_t ep_num, uint8_t dir); + +#endif /* __USBD_LLD_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_int.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_int.h new file mode 100644 index 0000000..8377140 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_int.h @@ -0,0 +1,48 @@ +/*! + \file usbd_lld_int.h + \brief USB device low level interrupt handler + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_LLD_INT_H +#define __USBD_LLD_INT_H + +#include "usbd_core.h" +#include "usbd_enum.h" +#include "usbd_pwr.h" + +/* function declarations */ +/* USB device interrupt service routine */ +void usbd_isr (void); +/* handle USB high priority successful transfer event */ +void usbd_int_hpst (usb_dev *udev); + +#endif /* __USBD_LLD_INT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_regs.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_regs.h new file mode 100644 index 0000000..938932c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Include/usbd_lld_regs.h @@ -0,0 +1,227 @@ +/*! + \file usbd_lld_regs.h + \brief USB device low level registers + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_LLD_REGS_H +#define __USBD_LLD_REGS_H + +#include "usbd_conf.h" + +/* USB device registers base address */ +#define USBD USBD_BASE +#define USBD_RAM USBD_RAM_BASE + +/* registers definitions */ +/* common registers */ +#define USBD_CTL (REG32(USBD + 0x40U)) /*!< control register */ +#define USBD_INTF (REG32(USBD + 0x44U)) /*!< interrupt flag register */ +#define USBD_STAT (REG32(USBD + 0x48U)) /*!< status register */ +#define USBD_DADDR (REG32(USBD + 0x4CU)) /*!< device address register */ +#define USBD_BADDR (REG32(USBD + 0x50U)) /*!< buffer address register */ +#define USBD_LPMCS (REG32(USBD + 0x54U)) /*!< USBD LPM control and status register */ + +/* endpoint control and status register */ +#define USBD_EPxCS(ep_num) (REG32(USBD + (ep_num) * 4U)) /*!< endpoint x control and status register address */ + +/* bits definitions */ +/* USBD_CTL */ +#define CTL_STIE BIT(15) /*!< successful transfer interrupt enable mask */ +#define CTL_PMOUIE BIT(14) /*!< packet memory overrun/underrun interrupt enable mask */ +#define CTL_ERRIE BIT(13) /*!< error interrupt enable mask */ +#define CTL_WKUPIE BIT(12) /*!< wakeup interrupt enable mask */ +#define CTL_SPSIE BIT(11) /*!< suspend state interrupt enable mask */ +#define CTL_RSTIE BIT(10) /*!< reset interrupt enable mask */ +#define CTL_SOFIE BIT(9) /*!< start of frame interrupt enable mask */ +#define CTL_ESOFIE BIT(8) /*!< expected start of frame interrupt enable mask */ +#define CTL_L1REQIE BIT(7) /*!< LPM L1 state request interrupt enable */ +#define CTL_L1RSREQ BIT(5) /*!< LPM L1 resume request */ +#define CTL_RSREQ BIT(4) /*!< resume request */ +#define CTL_SETSPS BIT(3) /*!< set suspend state */ +#define CTL_LOWM BIT(2) /*!< low-power mode at suspend state */ +#define CTL_CLOSE BIT(1) /*!< goes to close state */ +#define CTL_SETRST BIT(0) /*!< set USB reset */ + +#ifdef LPM_ENABLED +#define USBD_INTEN BITS(7, 15) /*!< USBD interrupt enable bits */ +#else +#define USBD_INTEN BITS(8, 15) /*!< USBD interrupt enable bits */ +#endif +/* USBD_INTF */ +#define INTF_STIF BIT(15) /*!< successful transfer interrupt flag (read only bit) */ +#define INTF_PMOUIF BIT(14) /*!< packet memory overrun/underrun interrupt flag (clear-only bit) */ +#define INTF_ERRIF BIT(13) /*!< error interrupt flag (clear-only bit) */ +#define INTF_WKUPIF BIT(12) /*!< wakeup interrupt flag (clear-only bit) */ +#define INTF_SPSIF BIT(11) /*!< suspend state interrupt flag (clear-only bit) */ +#define INTF_RSTIF BIT(10) /*!< reset interrupt flag (clear-only bit) */ +#define INTF_SOFIF BIT(9) /*!< start of frame interrupt flag (clear-only bit) */ +#define INTF_ESOFIF BIT(8) /*!< expected start of frame interrupt flag(clear-only bit) */ +#define INTF_L1REQ BIT(7) /*!< LPM L1 transaction is successfully received and acknowledged */ +#define INTF_DIR BIT(4) /*!< direction of transaction (read-only bit) */ +#define INTF_EPNUM BITS(0, 3) /*!< endpoint number (read-only bit) */ + +/* USBD_STAT */ +#define STAT_RXDP BIT(15) /*!< data plus line status */ +#define STAT_RXDM BIT(14) /*!< data minus line status */ +#define STAT_LOCK BIT(13) /*!< locked the USB */ +#define STAT_SOFLN BITS(11, 12) /*!< SOF lost number */ +#define STAT_FCNT BITS(0, 10) /*!< frame number count */ + +/* USBD_DADDR */ +#define DADDR_USBEN BIT(7) /*!< USB module enable */ +#define DADDR_USBADDR BITS(0, 6) /*!< USB device address */ + +/* USBD_EPxCS */ +#define EPxCS_RX_ST BIT(15) /*!< endpoint reception successful transferred */ +#define EPxCS_RX_DTG BIT(14) /*!< endpoint reception data PID toggle */ +#define EPxCS_RX_STA BITS(12, 13) /*!< endpoint reception status bits */ +#define EPxCS_SETUP BIT(11) /*!< endpoint setup transaction completed */ +#define EPxCS_CTL BITS(9, 10) /*!< endpoint type control */ +#define EPxCS_KCTL BIT(8) /*!< endpoint kind control */ +#define EPxCS_TX_ST BIT(7) /*!< endpoint transmission successful transfer */ +#define EPxCS_TX_DTG BIT(6) /*!< endpoint transmission data toggle */ +#define EPxCS_TX_STA BITS(4, 5) /*!< endpoint transmission transfers status bits */ +#define EPxCS_AR BITS(0, 3) /*!< endpoint address */ + +/* USBD_LPMCS */ +#define LPMCS_BLSTAT BITS(4, 7) /*!< bLinkState value */ +#define LPMCS_REMWK BIT(3) /*!< bRemoteWake value */ +#define LPMCS_LPMACK BIT(1) /*!< LPM token acknowledge enable */ +#define LPMCS_LPMEN BIT(0) /*!< LPM support enable */ + +/* constants definitions */ +/* endpoint control and status register mask (no toggle fields) */ +#define EPCS_MASK (EPxCS_RX_ST | EPxCS_SETUP | \ + EPxCS_CTL | EPxCS_KCTL | EPxCS_TX_ST | EPxCS_AR) + +/* EPxCS_CTL[1:0] endpoint type control */ +#define ENDP_TYPE(regval) (EPxCS_CTL & ((regval) << 9U)) + +#define EP_BULK ENDP_TYPE(0U) /* bulk transfers */ +#define EP_CONTROL ENDP_TYPE(1U) /* control transfers */ +#define EP_ISO ENDP_TYPE(2U) /* isochronous transfers */ +#define EP_INTERRUPT ENDP_TYPE(3U) /* interrupt transfers */ +#define EP_CTL_MASK (~EPxCS_CTL & EPCS_MASK) + +/* endpoint kind control mask */ +#define EPKCTL_MASK (~EPxCS_KCTL & EPCS_MASK) + +/* EPxCS_TX_STA[1:0] status for TX transfer */ +#define ENDP_TXSTAT(regval) (EPxCS_TX_STA & ((regval) << 4U)) + +#define EPTX_DISABLED ENDP_TXSTAT(0U) /* transmission state is disabled */ +#define EPTX_STALL ENDP_TXSTAT(1U) /* transmission state is STALL */ +#define EPTX_NAK ENDP_TXSTAT(2U) /* transmission state is NAK */ +#define EPTX_VALID ENDP_TXSTAT(3U) /* transmission state is enabled */ +#define EPTX_DTGMASK (EPxCS_TX_STA | EPCS_MASK) + +/* EPxCS_RX_STA[1:0] status for RX transfer */ +#define ENDP_RXSTAT(regval) (EPxCS_RX_STA & ((regval) << 12U)) + +#define EPRX_DISABLED ENDP_RXSTAT(0U) /* reception state is disabled */ +#define EPRX_STALL ENDP_RXSTAT(1U) /* reception state is STALL */ +#define EPRX_NAK ENDP_RXSTAT(2U) /* reception state is NAK */ +#define EPRX_VALID ENDP_RXSTAT(3U) /* reception state is enabled */ +#define EPRX_DTGMASK (EPxCS_RX_STA | EPCS_MASK) + +/* endpoint receive/transmission counter register bit definitions */ +#define EPRCNT_BLKSIZ BIT(15) /* reception data block size */ +#define EPRCNT_BLKNUM BITS(10, 14) /* reception data block number */ +#define EPRCNT_CNT BITS(0, 9) /* reception data count */ + +#define EPTCNT_CNT BITS(0, 9) /* transmisson data count */ + +/* interrupt flag clear bits */ +#define CLR(x) (USBD_INTF = ~INTF_##x) + +/* endpoint receive/transmission counter register bit offset */ +#define BLKSIZE_OFFSET (0x01U) +#define BLKNUM_OFFSET (0x05U) +#define RXCNT_OFFSET (0x0AU) + +#define TXCNT_OFFSET (0x0AU) + +#define BLKSIZE32_MASK (0x1fU) +#define BLKSIZE2_MASK (0x01U) + +#define BLKSIZE32_OFFSETMASK (0x05U) +#define BLKSIZE2_OFFSETMASK (0x01U) + +/* USBD operation macros */ + +/* TX or RX transfer status setting (bits EPTX_STA[1:0]) */ + +#define USBD_EP_TX_STAT_SET(ep, stat) do {\ + USBD_EPxCS(ep) = (USBD_EPxCS(ep) & (uint16_t)EPTX_DTGMASK) ^ (stat); \ +} while(0) + +#define USBD_EP_RX_STAT_SET(ep, stat) do {\ + USBD_EPxCS(ep) = (USBD_EPxCS(ep) & (uint16_t)EPRX_DTGMASK) ^ (stat); \ +} while(0) + +/* clear bit EPxCS_RX_ST/EPxCS_TX_ST in the endpoint control and status register */ + +#define USBD_EP_TX_ST_CLEAR(ep) do {\ + USBD_EPxCS(ep) &= ~EPxCS_TX_ST & (uint16_t)EPCS_MASK; \ +} while(0) + +#define USBD_EP_RX_ST_CLEAR(ep) do {\ + USBD_EPxCS(ep) &= ~EPxCS_RX_ST & (uint16_t)EPCS_MASK; \ +} while(0) + +/* toggle EPxCS_RX_DTG or EPxCS_TX_DTG bit in the endpoint control and status register */ + +#define USBD_TX_DTG_TOGGLE(ep) do {\ + USBD_EPxCS(ep) = EPxCS_TX_DTG | (USBD_EPxCS(ep) & EPCS_MASK); \ +} while(0) + +#define USBD_RX_DTG_TOGGLE(ep) do {\ + USBD_EPxCS(ep) = EPxCS_RX_DTG | (USBD_EPxCS(ep) & EPCS_MASK); \ +} while(0) + +/* clear EPxCS_RX_DTG or EPxCS_TX_DTG bit in the endpoint control and status register */ + +#define USBD_TX_DTG_CLEAR(ep) do {\ + if ((USBD_EPxCS(ep_num) & EPxCS_TX_DTG) != 0U) {\ + USBD_TX_DTG_TOGGLE(ep);\ + } \ +} while(0) + +#define USBD_RX_DTG_CLEAR(ep) do {\ + if ((USBD_EPxCS(ep_num) & EPxCS_RX_DTG) != 0U) {\ + USBD_RX_DTG_TOGGLE(ep);\ + } \ +} while(0) + +#define USBD_EP_DBL_BUF_SET(ep) (USBD_EPxCS(ep) = (USBD_EPxCS(ep) | EPxCS_KCTL) & EPCS_MASK) + +#endif /* __USBD_LLD_REGS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_core.c new file mode 100644 index 0000000..2514d64 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_core.c @@ -0,0 +1,637 @@ +/*! + \file usbd_lld_core.c + \brief USB device low level driver core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_lld_core.h" +#include "usbd_enum.h" + +#define USB_EPTYPE_MASK 0x03U + +#if defined (__CC_ARM) /* ARM Compiler */ +static usbd_ep_ram btable_ep[EP_COUNT]__attribute__((at(USBD_RAM + 2 * (BTABLE_OFFSET & 0xFFF8)))); +#elif defined (__ICCARM__) /* IAR Compiler */ + __no_init usbd_ep_ram btable_ep[EP_COUNT] @(USBD_RAM + 2 * (BTABLE_OFFSET & 0xFFF8)); +#elif defined (__GNUC__) /* GNU GCC Compiler */ + usbd_ep_ram *btable_ep = (usbd_ep_ram *)(USBD_RAM + 2 * (BTABLE_OFFSET & 0xFFF8)); +#endif + +usb_core_drv usbd_core; + +static const uint32_t ep_type[] = +{ + [USB_EP_ATTR_CTL] = EP_CONTROL, + [USB_EP_ATTR_BULK] = EP_BULK, + [USB_EP_ATTR_INT] = EP_INTERRUPT, + [USB_EP_ATTR_ISO] = EP_ISO +}; + +/* local function prototypes ('static') */ +static void usbd_dp_pullup (FlagStatus status); +static void usbd_core_reset (void); +static void usbd_core_stop (void); +static void usbd_address_set (usb_dev *udev); +static void usbd_ep_reset (usb_dev *udev); +static void usbd_ep_setup (usb_dev *udev, uint8_t buf_kind, uint32_t buf_addr, const usb_desc_ep *ep_desc); +static void usbd_ep_rx_enable (usb_dev *udev, uint8_t ep_addr); +static void usbd_ep_disable (usb_dev *udev, uint8_t ep_addr); +static void usbd_ep_stall_set (usb_dev *udev, uint8_t ep_addr); +static void usbd_ep_stall_clear (usb_dev *udev, uint8_t ep_addr); +static void usbd_ep_data_write (uint8_t *user_fifo, uint8_t ep_num, uint16_t bytes); +static uint16_t usbd_ep_data_read (uint8_t *user_fifo, uint8_t ep_num, uint8_t buf_kind); +static void usbd_resume (usb_dev *udev); +static void usbd_suspend (void); +static void usbd_leave_suspend (void); +static uint16_t usbd_ep_status (usb_dev *udev, uint8_t ep_addr); + +struct _usb_handler usbd_drv_handler = +{ + .dp_pullup = usbd_dp_pullup, + .init = usbd_core_reset, + .deinit = usbd_core_stop, + .suspend = usbd_suspend, + .suspend_leave = usbd_leave_suspend, + .resume = usbd_resume, + .set_addr = usbd_address_set, + .ep_reset = usbd_ep_reset, + .ep_disable = usbd_ep_disable, + .ep_setup = usbd_ep_setup, + .ep_rx_enable = usbd_ep_rx_enable, + .ep_write = usbd_ep_data_write, + .ep_read = usbd_ep_data_read, + .ep_stall_set = usbd_ep_stall_set, + .ep_stall_clear = usbd_ep_stall_clear, + .ep_status_get = usbd_ep_status +}; + +/*! + \brief free buffer used from application by toggling the SW_BUF byte + \param[in] ep_num: endpoint identifier (0..7) + \param[in] dir: endpoint direction which can be OUT(0) or IN(1) + \param[out] none + \retval None +*/ +void user_buffer_free (uint8_t ep_num, uint8_t dir) +{ + if ((uint8_t)DBUF_EP_OUT == dir) { + USBD_TX_DTG_TOGGLE(ep_num); + } else if ((uint8_t)DBUF_EP_IN == dir) { + USBD_RX_DTG_TOGGLE(ep_num); + } else { + /* no operation */ + } +} + +/*! + \brief set the status of pull-up pin + \param[in] status: SET or RESET + \param[out] none + \retval none +*/ +static void usbd_dp_pullup (FlagStatus status) +{ + if (SET == status) { + gpio_bit_set(USB_PULLUP, USB_PULLUP_PIN); + } else { + gpio_bit_reset(USB_PULLUP, USB_PULLUP_PIN); + } +} + +/*! + \brief device core register initialization + \param[in] none + \param[out] none + \retval none +*/ +static void usbd_core_reset (void) +{ + /* reset the CLOSE bit */ + USBD_CTL = CTL_SETRST; + + /* may be need wait some time(tSTARTUP) ... */ + + /* clear SETRST bit in USBD_CTL register */ + USBD_CTL = 0U; + + /* clear all pending interrupts */ + USBD_INTF = 0U; + + /* set descriptors table offset in USB dedicated SRAM */ + USBD_BADDR = BTABLE_OFFSET & 0xFFF8U; + +#ifdef LPM_ENABLED + /* enable L1REQ interrupt */ + USBD_CTL = CTL_L1REQIE; + + USBD_LPMCS = LPMCS_LPMACK | LPMCS_LPMEN; +#endif /* LPM_ENABLED */ + + /* enable all interrupts mask bits */ + USBD_CTL |= CTL_STIE | CTL_WKUPIE | CTL_SPSIE | CTL_SOFIE | CTL_ESOFIE | CTL_RSTIE; +} + +/*! + \brief device core register configure when stop device + \param[in] none + \param[out] none + \retval none +*/ +static void usbd_core_stop (void) +{ + /* disable all interrupts and set USB reset */ + USBD_CTL = CTL_SETRST; + + /* clear all interrupt flags */ + USBD_INTF = 0U; + + /* close device */ + USBD_CTL = CTL_SETRST | CTL_CLOSE; +} + +/*! + \brief set device address + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void usbd_address_set (usb_dev *udev) +{ + USBD_DADDR = DADDR_USBEN | udev->dev_addr; +} + +/*! + \brief handle USB reset event + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void usbd_ep_reset (usb_dev *udev) +{ + uint8_t i = 0U; + + usb_transc *transc = &udev->transc_in[0]; + + btable_ep[0].tx_addr = EP0_TX_ADDR; + btable_ep[0].tx_count = 0U; + + transc->max_len = USBD_EP0_MAX_SIZE; + + transc = &udev->transc_out[0]; + + btable_ep[0].rx_addr = EP0_RX_ADDR; + + transc->max_len = USBD_EP0_MAX_SIZE; + + if (transc->max_len > 62U) { + btable_ep[0].rx_count = ((uint16_t)((uint16_t)transc->max_len << 5) - 1U) | 0x8000U; + } else { + btable_ep[0].rx_count = ((transc->max_len + 1U) & ~1U) << 9U; + } + + /* reset non-control endpoints */ + for (i = 1U; i < EP_COUNT; i++) { + USBD_EPxCS(i) = (USBD_EPxCS(i) & (~EPCS_MASK)) | i; + } + + /* clear endpoint 0 register */ + USBD_EPxCS(0U)= (uint16_t)(USBD_EPxCS(0U)); + + USBD_EPxCS(0U) = EP_CONTROL | EPRX_VALID | EPTX_NAK; + + /* set device address as default address 0 */ + USBD_DADDR = DADDR_USBEN; + + udev->cur_status = (uint8_t)USBD_DEFAULT; +} + +/*! + \brief endpoint initialization + \param[in] udev: pointer to USB core instance + \param[in] buf_kind: endpoint buffer kind + \param[in] buf_addr: endpoint buffer address + \param[in] ep_desc: pointer to endpoint descriptor + \param[out] none + \retval none +*/ +static void usbd_ep_setup (usb_dev *udev, uint8_t buf_kind, uint32_t buf_addr, const usb_desc_ep *ep_desc) +{ + uint8_t ep_addr = ep_desc->bEndpointAddress; + uint8_t ep_num = EP_ID(ep_addr); + uint16_t max_len = ep_desc->wMaxPacketSize; + + usb_transc *transc = NULL; + + /* set the endpoint type */ + USBD_EPxCS(ep_num) = ep_type[ep_desc->bmAttributes & USB_EPTYPE_MASK] | ep_num; + + if (EP_DIR(ep_addr)) { + transc = &udev->transc_in[ep_num]; + + transc->max_len = max_len; + + if ((uint8_t)EP_BUF_SNG == buf_kind) { + btable_ep[ep_num].tx_addr = buf_addr; + + /* configure the endpoint status as NAK status */ + USBD_EP_TX_STAT_SET(ep_num, EPTX_NAK); + } else if ((uint8_t)EP_BUF_DBL == buf_kind) { + USBD_EP_DBL_BUF_SET(ep_num); + + btable_ep[ep_num].tx_addr = buf_addr & 0xFFFFU; + btable_ep[ep_num].rx_addr = (buf_addr & 0xFFFF0000U) >> 16U; + + USBD_EP_TX_STAT_SET(ep_num, EPTX_VALID); + USBD_EP_RX_STAT_SET(ep_num, EPRX_DISABLED); + } else { + /* error operation */ + } + } else { + transc = &udev->transc_out[ep_num]; + + transc->max_len = max_len; + + if ((uint8_t)EP_BUF_SNG == buf_kind) { + btable_ep[ep_num].rx_addr = buf_addr; + } else if ((uint8_t)EP_BUF_DBL == buf_kind) { + USBD_EP_DBL_BUF_SET(ep_num); + + USBD_TX_DTG_TOGGLE(ep_num); + + btable_ep[ep_num].tx_addr = buf_addr & 0xFFFFU; + btable_ep[ep_num].rx_addr = (buf_addr & 0xFFFF0000U) >> 16U; + + if (max_len > 62U) { + btable_ep[ep_num].tx_count = (((uint32_t)max_len << 5) - 1U) | 0x8000U; + } else { + btable_ep[ep_num].tx_count = ((max_len + 1U) & ~1U) << 9U; + } + } else { + /* error operation */ + } + + if (max_len > 62U) { + btable_ep[ep_num].rx_count = (((uint32_t)max_len << 5U) - 1U) | 0x8000U; + } else { + btable_ep[ep_num].rx_count = ((max_len + 1U) & ~1U) << 9U; + } + + if ((uint8_t)EP_BUF_SNG == buf_kind) { + /* configure the endpoint status as NAK status */ + USBD_EP_RX_STAT_SET(ep_num, EPRX_NAK); + } else if ((uint8_t)EP_BUF_DBL == buf_kind) { + USBD_EP_RX_STAT_SET(ep_num, EPRX_DISABLED); + USBD_EP_TX_STAT_SET(ep_num, EPTX_NAK); + } else { + /* error operation */ + } + } +} + +/*! + \brief configure the endpoint when it is disabled + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +static void usbd_ep_disable (usb_dev *udev, uint8_t ep_addr) +{ + (void)udev; + + uint8_t ep_num = EP_ID(ep_addr); + + if (EP_DIR(ep_addr)) { + USBD_TX_DTG_CLEAR(ep_num); + + /* configure the endpoint status as DISABLED */ + USBD_EP_TX_STAT_SET(ep_num, EPTX_DISABLED); + } else { + USBD_RX_DTG_CLEAR(ep_num); + + /* configure the endpoint status as DISABLED */ + USBD_EP_RX_STAT_SET(ep_num, EPRX_DISABLED); + } +} + +/*! + \brief enable endpoint to receive + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +static void usbd_ep_rx_enable (usb_dev *udev, uint8_t ep_addr) +{ + (void)udev; + + /* enable endpoint to receive */ + USBD_EP_RX_STAT_SET(EP_ID(ep_addr), EPRX_VALID); +} + +/*! + \brief set an endpoint to STALL status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +static void usbd_ep_stall_set (usb_dev *udev, uint8_t ep_addr) +{ + uint8_t ep_num = EP_ID(ep_addr); + + if (0U == ep_num) { + USBD_EP_TX_STAT_SET(0U, EPTX_STALL); + USBD_EP_RX_STAT_SET(0U, EPRX_STALL); + } else { + if (EP_DIR(ep_addr)) { + udev->transc_in[ep_num].ep_stall = 1U; + + USBD_EP_TX_STAT_SET(ep_num, EPTX_STALL); + } else { + udev->transc_out[ep_num].ep_stall = 1U; + + USBD_EP_RX_STAT_SET(ep_num, EPRX_STALL); + } + } +} + +/*! + \brief clear endpoint stalled status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +static void usbd_ep_stall_clear (usb_dev *udev, uint8_t ep_addr) +{ + uint8_t ep_num = EP_ID(ep_addr); + + if (EP_DIR(ep_addr)) { + if(EPTX_STALL == usbd_ep_status_get(udev, ep_addr)){ + /* clear endpoint data toggle bit */ + USBD_TX_DTG_CLEAR(ep_num); + + udev->transc_in[ep_num].ep_stall = 0U; + + /* clear endpoint stall status */ + USBD_EP_TX_STAT_SET(ep_num, EPTX_VALID); + } + } else { + if(EPRX_STALL == usbd_ep_status_get(udev, ep_addr)){ + /* clear endpoint data toggle bit */ + USBD_RX_DTG_CLEAR(ep_num); + + udev->transc_out[ep_num].ep_stall = 0U; + + /* clear endpoint stall status */ + USBD_EP_RX_STAT_SET(ep_num, EPRX_VALID); + } + } + +} + +/*! + \brief get the endpoint status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval endpoint status +*/ +static uint16_t usbd_ep_status (usb_dev *udev, uint8_t ep_addr) +{ + (void)udev; + + uint32_t epcs = USBD_EPxCS(EP_ID(ep_addr)); + + if (EP_DIR(ep_addr)) { + return (uint16_t)(epcs & EPxCS_TX_STA); + } else { + return (uint16_t)(epcs & EPxCS_RX_STA); + } +} + +/*! + \brief write data from user FIFO to USB RAM + \param[in] user_fifo: pointer to user FIFO + \param[in] ep_num: endpoint number + \param[in] bytes: the bytes count of the write data + \param[out] none + \retval none +*/ +static void usbd_ep_data_write (uint8_t *user_fifo, uint8_t ep_num, uint16_t bytes) +{ + if (0U != bytes) { + uint32_t n; + uint32_t *write_addr = (uint32_t *)(btable_ep[ep_num].tx_addr * 2U + USBD_RAM); + + for (n = 0U; n < (bytes + 1U) / 2U; n++) { + *write_addr++ = *((uint16_t*)user_fifo); + user_fifo += 2U; + } + } + + btable_ep[ep_num].tx_count = bytes; + + USBD_EP_TX_STAT_SET(ep_num, EPTX_VALID); +} + +/*! + \brief read data from USBRAM to user FIFO + \param[in] user_fifo: pointer to user FIFO + \param[in] ep_num: endpoint number + \param[in] buf_kind: endpoint buffer kind + \param[out] none + \retval none +*/ +static uint16_t usbd_ep_data_read (uint8_t *user_fifo, uint8_t ep_num, uint8_t buf_kind) +{ + uint16_t n = 0U, bytes = 0U; + uint32_t *read_addr = NULL; + + if ((uint8_t)EP_BUF_SNG == buf_kind) { + bytes = (uint16_t)(btable_ep[ep_num].rx_count & EPRCNT_CNT); + + read_addr = (uint32_t *)(btable_ep[ep_num].rx_addr * 2U + USBD_RAM); + } else if ((uint8_t)EP_BUF_DBL == buf_kind) { + if (USBD_EPxCS(ep_num) & EPxCS_TX_DTG) { + bytes = (uint16_t)(btable_ep[ep_num].tx_count & EPRCNT_CNT); + + read_addr = (uint32_t *)(btable_ep[ep_num].tx_addr * 2U + USBD_RAM); + } else { + bytes = (uint16_t)(btable_ep[ep_num].rx_count & EPRCNT_CNT); + + read_addr = (uint32_t *)(btable_ep[ep_num].rx_addr * 2U + USBD_RAM); + } + } else { + return 0U; + } + + for (n = 0U; n < (bytes + 1U) / 2U; n++) { + *((uint16_t*)user_fifo) = (uint16_t)*read_addr++; + user_fifo += 2U; + } + + return bytes; +} + +#ifdef USBD_LOWPWR_MODE_ENABLE + +/*! + \brief restore system clocks and power while exiting from suspend mode + \param[in] none + \param[out] none + \retval none +*/ +static void lowpower_mode_exit (void) +{ + /* restore system clock */ + +#ifdef LPM_ENABLED + /* enable IRC8M */ + rcu_osci_on(RCU_IRC8M); + + /* wait till IRC8M is ready */ + while (RESET == rcu_flag_get(RCU_FLAG_IRC8MSTB)) { + } +#else + /* enable HXTAL */ + rcu_osci_on(RCU_HXTAL); + + /* wait till HXTAL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_HXTALSTB)) { + } +#endif + + /* enable PLL */ + rcu_osci_on(RCU_PLL_CK); + + /* wait till PLL is ready */ + while(RESET == rcu_flag_get(RCU_FLAG_PLLSTB)) { + } + + /* select PLL as system clock source */ + rcu_system_clock_source_config(RCU_CKSYSSRC_PLL); + + /* wait till PLL is used as system clock source */ + while(0x08U != rcu_system_clock_source_get()) { + } + + /* low power sleep on exit disabled */ + system_lowpower_reset(SCB_LPM_DEEPSLEEP); +} + +#endif /* USBD_LOWPWR_MODE_ENABLE */ + +/*! + \brief resume the USB device + \param[in] none + \param[out] none + \retval none +*/ +static void usbd_resume (usb_dev *udev) +{ +#ifdef LPM_ENABLED + if(1 == udev->lpm.L1_remote_wakeup){ + USBD_CTL |= CTL_L1RSREQ; + } +#endif /* LPM_ENABLED */ + + if(1U == usbd_core.dev->pm.remote_wakeup){ + /* make USB resume */ + USBD_CTL |= CTL_RSREQ; + } +} + +/*! + \brief set USB device to leave mode + \param[in] none + \param[out] none + \retval none +*/ +static void usbd_leave_suspend (void) +{ + /* clear low_power mode bit in USBD_CTL */ + USBD_CTL &= ~CTL_LOWM; + +#ifdef USBD_LOWPWR_MODE_ENABLE + + /* restore normal operations */ + lowpower_mode_exit(); + +#endif /* USBD_LOWPWR_MODE_ENABLE */ + + /* clear SETSPS bit */ + USBD_CTL &= ~CTL_SETSPS; +} + +/*! + \brief set USB device to enter suspend mode + \param[in] none + \param[out] none + \retval none +*/ +static void usbd_suspend (void) +{ + /* set USB module to suspend and low-power mode */ + USBD_CTL |= CTL_SETSPS | CTL_LOWM; + +#ifdef USBD_LOWPWR_MODE_ENABLE + + /* check wakeup flag is set */ + if (0U == (USBD_INTF & INTF_WKUPIF)) { + /* enter DEEP_SLEEP mode with LDO in low power mode */ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + } else { + /* clear wakeup interrupt flag */ + CLR(WKUPIF); + + /* clear set_suspend flag */ + USBD_CTL &= ~CTL_SETSPS; + } + +#endif /* USBD_LOWPWR_MODE_ENABLE */ +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_int.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_int.c new file mode 100644 index 0000000..21a7d12 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbd_library/usbd/Source/usbd_lld_int.c @@ -0,0 +1,279 @@ + /*! + \file usbd_lld_int.c + \brief USB device low level interrupt routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_lld_int.h" +#include "usbd_lld_core.h" + +/* local function prototypes ('static') */ +static void usbd_int_suspend (usb_dev *udev); + +/*! + \brief handle USB high priority successful transfer event + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void usbd_int_hpst (usb_dev *udev) +{ + __IO uint16_t int_status = 0U; + + /* wait till interrupts are not pending */ + while ((int_status = (uint16_t)USBD_INTF) & (uint16_t)INTF_STIF) { + /* get endpoint number */ + uint8_t ep_num = (uint8_t)(int_status & INTF_EPNUM); + + uint8_t transc_num = (uint8_t)TRANSC_UNKNOWN; + + if (int_status & INTF_DIR) { + if (USBD_EPxCS(ep_num) & EPxCS_RX_ST) { + uint16_t count = 0U; + + usb_transc *transc = &udev->transc_out[ep_num]; + + /* clear successful receive interrupt flag */ + USBD_EP_RX_ST_CLEAR(ep_num); + + count = udev->drv_handler->ep_read (transc->xfer_buf, ep_num, (uint8_t)EP_BUF_DBL); + + user_buffer_free(ep_num, (uint8_t)DBUF_EP_OUT); + + transc->xfer_buf += count; + transc->xfer_count += count; + transc->xfer_len -= count; + + if ((0U == transc->xfer_len) || (count < transc->max_len)) { + USBD_EP_RX_STAT_SET(ep_num, EPRX_NAK); + + transc_num = (uint8_t)TRANSC_OUT; + } + } + } else { + /* handle the in direction transaction */ + if (USBD_EPxCS(ep_num) & EPxCS_TX_ST) { + /* clear successful transmit interrupt flag */ + USBD_EP_TX_ST_CLEAR(ep_num); + + transc_num = (uint8_t)TRANSC_IN; + } + } + + if ((uint8_t)TRANSC_UNKNOWN != transc_num) { + udev->ep_transc[ep_num][transc_num](udev, ep_num); + } + } +} + +/*! + \brief USB interrupt events service routine + \param[in] none + \param[out] none + \retval none +*/ +void usbd_isr (void) +{ + __IO uint16_t int_status = (uint16_t)USBD_INTF; + __IO uint16_t int_flag = (uint16_t)(USBD_INTF & USBD_INTEN); + uint16_t ctl_reg = (uint16_t)(USBD_CTL); + + int_flag &= ctl_reg; + + usb_dev *udev = usbd_core.dev; + + if (INTF_STIF & int_flag) { + /* wait till interrupts are not pending */ + while ((int_status = (uint16_t)USBD_INTF) & (uint16_t)INTF_STIF) { + /* get endpoint number */ + uint8_t ep_num = (uint8_t)(int_status & INTF_EPNUM); + + if (int_status & INTF_DIR) { + /* handle the USB OUT direction transaction */ + if (USBD_EPxCS(ep_num) & EPxCS_RX_ST) { + /* clear successful receive interrupt flag */ + USBD_EP_RX_ST_CLEAR(ep_num); + + if (USBD_EPxCS(ep_num) & EPxCS_SETUP) { + + if (0U == ep_num) { + udev->ep_transc[ep_num][TRANSC_SETUP](udev, ep_num); + } else { + return; + } + } else { + usb_transc *transc = &udev->transc_out[ep_num]; + + uint16_t count = udev->drv_handler->ep_read (transc->xfer_buf, ep_num, (uint8_t)EP_BUF_SNG); + + transc->xfer_buf += count; + transc->xfer_count += count; + + if ((transc->xfer_count >= transc->xfer_len) || (count < transc->max_len)) { + if (udev->ep_transc[ep_num][TRANSC_OUT]) { + udev->ep_transc[ep_num][TRANSC_OUT](udev, ep_num); + } + } else { + udev->drv_handler->ep_rx_enable(udev, ep_num); + } + } + } + } else { + /* handle the USB IN direction transaction */ + if (USBD_EPxCS(ep_num) & EPxCS_TX_ST) { + /* clear successful transmit interrupt flag */ + USBD_EP_TX_ST_CLEAR(ep_num); + + usb_transc *transc = &udev->transc_in[ep_num]; + + if (0U == transc->xfer_len) { + if (udev->ep_transc[ep_num][TRANSC_IN]) { + udev->ep_transc[ep_num][TRANSC_IN](udev, ep_num); + } + } else { + usbd_ep_send(udev, ep_num, transc->xfer_buf, transc->xfer_len); + } + } + } + } + } + + if (INTF_WKUPIF & int_flag) { + /* clear wakeup interrupt flag in INTF */ + CLR(WKUPIF); + + /* restore the old cur_status */ + udev->cur_status = udev->backup_status; + +#ifdef LPM_ENABLED + if ((0U == udev->pm.remote_wakeup_on) && (0U == udev->lpm.L1_resume)) { + resume_mcu(udev); + } else if (1U == udev->pm.remote_wakeup_on) { + /* no operation */ + } else { + udev->lpm.L1_resume = 0U; + } + + /* clear L1 remote wakeup flag */ + udev->lpm.L1_remote_wakeup = 0U; +#else + if (0U == udev->pm.remote_wakeup_on) { + resume_mcu(udev); + } +#endif /* LPM_ENABLED */ + } + + if (INTF_SPSIF & int_flag) { + if(!(USBD_CTL & CTL_RSREQ)) { + usbd_int_suspend (udev); + + /* clear of suspend interrupt flag bit must be done after setting of CTLR_SETSPS */ + CLR(SPSIF); + } + } + + if (INTF_SOFIF & int_flag) { + /* clear SOF interrupt flag in INTF */ + CLR(SOFIF); + + /* if necessary, user can add code here */ + if (NULL != usbd_int_fops) { + (void)usbd_int_fops->SOF(udev); + } + } + + if (INTF_ESOFIF & int_flag) { + /* clear ESOF interrupt flag in INTF */ + CLR(ESOFIF); + + /* control resume time by ESOFs */ + if (udev->pm.esof_count > 0U) { + if (0U == --udev->pm.esof_count) { + if (udev->pm.remote_wakeup_on) { + USBD_CTL &= ~CTL_RSREQ; + + udev->pm.remote_wakeup_on = 0U; + } else { + USBD_CTL |= CTL_RSREQ; + + udev->pm.esof_count = 3U; + udev->pm.remote_wakeup_on = 1U; + } + } + } + } + + if (INTF_RSTIF & int_flag) { + /* clear reset interrupt flag in INTF */ + CLR(RSTIF); + + udev->drv_handler->ep_reset(udev); + } + +#ifdef LPM_ENABLED + if (INTF_L1REQ & int_flag) { + /* clear L1 ST bit in LPM INTF */ + USBD_INTF = CLR(L1REQ); + + /* read BESL field from subendpoint0 register which corresponds to HIRD parameter in LPM spec */ + udev->lpm.besl = (USBD_LPMCS & LPMCS_BLSTAT) >> 4; + + /* read BREMOTEWAKE bit from subendpoint0 register which corresponding to bRemoteWake bit in LPM request */ + udev->lpm.L1_remote_wakeup = (USBD_LPMCS & LPMCS_REMWK) >> 3; + + /* process USB device core layer suspend routine */ + usbd_int_suspend(udev); + } +#endif /* LPM_ENABLED */ +} + +/*! + \brief handle USB suspend event + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void usbd_int_suspend (usb_dev *udev) +{ + /* store the device current status */ + udev->backup_status = udev->cur_status; + + /* set device in suspended state */ + udev->cur_status = (uint8_t)USBD_SUSPENDED; + + /* usb enter in suspend mode and mcu system in low power mode */ + if (udev->pm.suspend_enabled) { + usbd_to_suspend(udev); + } else { + /* if not possible then resume after xx ms */ + udev->pm.esof_count = 3U; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_core.h new file mode 100644 index 0000000..98bf7ab --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_core.h @@ -0,0 +1,319 @@ +/*! + \file audio_core.h + \brief the header file of USB audio device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __AUDIO_CORE_H +#define __AUDIO_CORE_H + +#include "usbd_enum.h" + +#define FORMAT_24BIT(x) (uint8_t)(x);(uint8_t)((x) >> 8U);(uint8_t)((x) >> 16U) + +/* number of sub-packets in the audio transfer buffer. you can modify this value but always make sure + that it is an even number and higher than 3 */ +#define OUT_PACKET_NUM 20U + +/* total size of the audio transfer buffer */ +#define OUT_BUF_MARGIN 0U +#define TOTAL_OUT_BUF_SIZE ((uint32_t)((SPEAKER_OUT_PACKET + OUT_BUF_MARGIN) * OUT_PACKET_NUM)) + +#define AD_CONFIG_DESC_SET_LEN (sizeof(usb_desc_config_set)) +#define AD_INTERFACE_DESC_SIZE 9U + +#define USB_AD_DESC_SIZ 0x09U +#define AD_STANDARD_EP_DESC_SIZE 0x09U +#define AD_STREAMING_EP_DESC_SIZE 0x07U + +/* audio interface class code */ +#define USB_CLASS_AUDIO 0x01U + +/* audio interface subclass codes */ +#define AD_SUBCLASS_CONTROL 0x01U +#define AD_SUBCLASS_AUDIOSTREAMING 0x02U +#define AD_SUBCLASS_MIDISTREAMING 0x03U + +/* audio interface protocol codes */ +#define AD_PROTOCOL_UNDEFINED 0x00U +#define AD_STREAMING_GENERAL 0x01U +#define AD_STREAMING_FORMAT_TYPE 0x02U + +/* audio class-specific descriptor types */ +#define AD_DESCTYPE_UNDEFINED 0x20U +#define AD_DESCTYPE_DEVICE 0x21U +#define AD_DESCTYPE_CONFIGURATION 0x22U +#define AD_DESCTYPE_STRING 0x23U +#define AD_DESCTYPE_INTERFACE 0x24U +#define AD_DESCTYPE_ENDPOINT 0x25U + +/* audio control interface descriptor subtypes */ +#define AD_CONTROL_HEADER 0x01U +#define AD_CONTROL_INPUT_TERMINAL 0x02U +#define AD_CONTROL_OUTPUT_TERMINAL 0x03U +#define AD_CONTROL_MIXER_UNIT 0x04U +#define AD_CONTROL_SELECTOR_UNIT 0x05U +#define AD_CONTROL_FEATURE_UNIT 0x06U +#define AD_CONTROL_PROCESSING_UNIT 0x07U +#define AD_CONTROL_EXTENSION_UNIT 0x08U + +#define AD_INPUT_TERMINAL_DESC_SIZE 0x0CU +#define AD_OUTPUT_TERMINAL_DESC_SIZE 0x09U +#define AD_STREAMING_INTERFACE_DESC_SIZE 0x07U + +#define AD_CONTROL_MUTE 0x01U +#define AD_CONTROL_VOLUME 0x02U + +#define AD_FORMAT_TYPE_I 0x01U +#define AD_FORMAT_TYPE_III 0x03U + +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01U +#define AD_ENDPOINT_GENERAL 0x01U + +#define AD_REQ_UNDEFINED 0x00U +#define AD_REQ_SET_CUR 0x01U +#define AD_REQ_GET_CUR 0x81U +#define AD_REQ_SET_MIN 0x02U +#define AD_REQ_GET_MIN 0x82U +#define AD_REQ_SET_MAX 0x03U +#define AD_REQ_GET_MAX 0x83U +#define AD_REQ_SET_RES 0x04U +#define AD_REQ_GET_RES 0x84U +#define AD_REQ_SET_MEM 0x05U +#define AD_REQ_GET_MEM 0x85U +#define AD_REQ_GET_STAT 0xFFU + +#define AD_OUT_STREAMING_CTRL 0x05U +#define AD_IN_STREAMING_CTRL 0x02U + +/* audio stream interface number */ +enum +{ +#ifdef USE_USB_AD_MICPHONE + MIC_INTERFACE_COUNT, +#endif /* USE_USB_AD_MICPHONE */ +#ifdef USE_USB_AD_SPEAKER + SPEAK_INTERFACE_COUNT, +#endif /* USE_USB_AD_SPEAKER */ + CONFIG_DESC_AS_ITF_COUNT, + +}; + +#define AC_ITF_TOTAL_LEN (sizeof(usb_desc_AC_itf) + CONFIG_DESC_AS_ITF_COUNT*(sizeof(usb_desc_input_terminal) + \ + sizeof(usb_desc_mono_feature_unit) + sizeof(usb_desc_output_terminal))) + +#pragma pack(1) + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< header descriptor subtype */ + uint16_t bcdADC; /*!< audio device class specification release number in binary-coded decimal */ + uint16_t wTotalLength; /*!< total number of bytes */ + uint8_t bInCollection; /*!< the number of the streaming interfaces */ +#ifdef USE_USB_AD_MICPHONE + uint8_t baInterfaceNr0; /*!< interface number of the streaming interfaces */ +#endif /* USE_USB_AD_MICPHONE */ +#ifdef USE_USB_AD_SPEAKER + uint8_t baInterfaceNr1; /*!< interface number of the streaming interfaces */ +#endif /* USE_USB_AD_SPEAKER */ +} usb_desc_AC_itf; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< AS_GENERAL descriptor subtype */ + uint8_t bTerminalLink; /*!< the terminal ID */ + uint8_t bDelay; /*!< delay introduced by the data path */ + uint16_t wFormatTag; /*!< the audio data format */ +} usb_desc_AS_itf; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< INPUT_TERMINAL descriptor subtype. */ + uint8_t bTerminalID; /*!< constant uniquely identifying the terminal within the audio function */ + uint16_t wTerminalType; /*!< constant characterizing the type of terminal */ + uint8_t bAssocTerminal; /*!< ID of the output terminal */ + uint8_t bNrChannels; /*!< number of logical output channels */ + uint16_t wChannelConfig; /*!< describes the spatial location of the logical channels */ + uint8_t iChannelNames; /*!< index of a string descriptor */ + uint8_t iTerminal; /*!< index of a string descriptor */ +} usb_desc_input_terminal; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< OUTPUT_TERMINAL descriptor subtype */ + uint8_t bTerminalID; /*!< constant uniquely identifying the terminal within the audio function */ + uint16_t wTerminalType; /*!< constant characterizing the type of terminal */ + uint8_t bAssocTerminal; /*!< constant, identifying the input terminal to which this output terminal is associated */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t iTerminal; /*!< index of a string descriptor */ +} usb_desc_output_terminal; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FEATURE_UNIT descriptor subtype */ + uint8_t bUnitID; /*!< constant uniquely identifying the unit within the audio function */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t bControlSize; /*!< size in bytes of an element of the bmaControls() array */ + uint8_t bmaControls0; /*!< a bit set to 1 indicates that the mentioned control is supported for master channel 0 */ + uint8_t bmaControls1; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 1 */ + uint8_t iFeature; /*!< index of a string descriptor */ +} usb_desc_mono_feature_unit; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FEATURE_UNIT descriptor subtype */ + uint8_t bUnitID; /*!< constant uniquely identifying the unit within the audio function */ + uint8_t bSourceID; /*!< ID of the unit or terminal */ + uint8_t bControlSize; /*!< size in bytes of an element of the bmaControls() array */ + uint16_t bmaControls0; /*!< a bit set to 1 indicates that the mentioned control is supported for master channel 0 */ + uint16_t bmaControls1; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 1 */ + uint16_t bmaControls2; /*!< a bit set to 1 indicates that the mentioned control is supported for logical channel 2 */ + uint8_t iFeature; /*!< index of a string descriptor */ +} usb_desc_stereo_feature_unit; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< FORMAT_TYPE descriptor subtype */ + uint8_t bFormatType; /*!< constant identifying the format type */ + uint8_t bNrChannels; /*!< indicates the number of physical channels in the audio data stream */ + uint8_t bSubFrameSize; /*!< the number of bytes occupied by one audio subframe */ + uint8_t bBitResolution; /*!< the number of effectively used bits from the available bits in an audio subframe */ + uint8_t bSamFreqType; /*!< indicates how the sampling frequency can be programmed */ + uint8_t bSamFreq[3]; /*!< sampling frequency ns in Hz for this isochronous data endpoint */ +} usb_desc_format_type; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bEndpointAddress; /*!< the address of the endpoint */ + uint8_t bmAttributes; /*!< transfer type and synchronization type */ + uint16_t wMaxPacketSize; /*!< maximum packet size this endpoint is capable of sending or receiving */ + uint8_t bInterval; /*!< left to the designer's discretion */ + uint8_t bRefresh; /*!< reset to 0 */ + uint8_t bSynchAddress; /*!< reset to 0 */ +} usb_desc_std_ep; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bDescriptorSubtype; /*!< EP_GENERAL descriptor subtype */ + uint8_t bmAttributes; /*!< transfer type and synchronization type */ + uint8_t bLockDelayUnits; /*!< indicates the units used for the wLockDelay field */ + uint16_t wLockDelay; /*!< indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry */ +} usb_desc_AS_ep; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bEndpointAddress; /*!< EP_GENERAL descriptor subtype */ + uint8_t bmAttributes; /*!< transfer type and synchronization type */ + uint16_t wMaxPacketSize; /*!< maximum packet size this endpoint is capable of sending or receiving */ + uint8_t bInterval; /*!< polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type */ + uint8_t Refresh; /*!< bRefresh 1~9, power of 2 */ + uint8_t bSynchAddress; /* bSynchAddress */ +} usb_desc_FeedBack_ep; +#pragma pack() + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf std_itf; + usb_desc_AC_itf ac_itf; + +#ifdef USE_USB_AD_MICPHONE + usb_desc_input_terminal mic_in_terminal; + usb_desc_mono_feature_unit mic_feature_unit; + usb_desc_output_terminal mic_out_terminal; +#endif + +#ifdef USE_USB_AD_SPEAKER + usb_desc_input_terminal speak_in_terminal; + usb_desc_mono_feature_unit speak_feature_unit; + usb_desc_output_terminal speak_out_terminal; +#endif /* USE_USB_AD_SPEAKER */ + +#ifdef USE_USB_AD_MICPHONE + usb_desc_itf mic_std_as_itf_zeroband; + usb_desc_itf mic_std_as_itf_opera; + usb_desc_AS_itf mic_as_itf; + usb_desc_format_type mic_format_typeI; + usb_desc_std_ep mic_std_endpoint; + usb_desc_AS_ep mic_as_endpoint; +#endif + +#ifdef USE_USB_AD_SPEAKER + usb_desc_itf speak_std_as_itf_zeroband; + usb_desc_itf speak_std_as_itf_opera; + usb_desc_AS_itf speak_as_itf; + usb_desc_format_type speak_format_typeI; + usb_desc_std_ep speak_std_endpoint; + usb_desc_AS_ep speak_as_endpoint; + usb_desc_FeedBack_ep speak_feedback_endpoint; +#endif /* USE_USB_AD_SPEAKER */ +} usb_desc_config_set; + + +typedef struct +{ + /* main buffer for audio data out transfers and its relative pointers */ + uint8_t isoc_out_buff[TOTAL_OUT_BUF_SIZE]; + uint8_t* isoc_out_wrptr; + uint8_t* isoc_out_rdptr; + uint16_t buf_free_size; + uint16_t dam_tx_len; + + __IO uint32_t actual_freq; + __IO uint8_t play_flag; + uint8_t feedback_freq[3]; + uint32_t cur_sam_freq; + + /* usb receive buffer */ + uint8_t usb_rx_buffer[SPEAKER_OUT_MAX_PACKET]; + + /* main buffer for audio control requests transfers and its relative variables */ + uint8_t audioctl[64]; + uint8_t audioctl_unit; + uint32_t audioctl_len; +} usbd_audio_handler; + +extern usb_desc audio_desc; +extern usb_class_core usbd_audio_cb; +extern usbd_audio_handler audio_handler; + +#endif /* __AUDIO_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_out_itf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_out_itf.h new file mode 100644 index 0000000..534579e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Include/audio_out_itf.h @@ -0,0 +1,50 @@ +/*! + \file audio_out_itf.h + \brief audio OUT (playback) interface header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __AUDIO_OUT_ITF_H +#define __AUDIO_OUT_ITF_H + +#include "usbd_conf.h" +#include "string.h" + +typedef struct +{ + uint8_t (*audio_init) (uint32_t audio_freq, uint32_t volume); + uint8_t (*audio_deinit) (void); + uint8_t (*audio_cmd) (uint8_t* pbuf, uint32_t size, uint8_t cmd); +} audio_fops_struct; + +extern audio_fops_struct audio_out_fops; + +#endif /* __AUDIO_OUT_ITF_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_core.c new file mode 100644 index 0000000..4eb54b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_core.c @@ -0,0 +1,953 @@ +/*! + \file audio_core.c + \brief USB audio device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "audio_out_itf.h" +#include "audio_core.h" +#include +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x6889U + +#define VOL_MIN 0U /* volume minimum value */ +#define VOL_MAX 100U /* volume maximum value */ +#define VOL_RES 1U /* volume resolution */ +#define VOL_0dB 70U /* 0dB is in the middle of VOL_MIN and VOL_MAX */ + +#ifdef USE_USB_AD_MICPHONE +extern volatile uint32_t count_data; +extern const char wavetestdata[]; +#define LENGTH_DATA (1747 * 32) +#endif /* USE_USB_AD_MICPHONE */ + +usbd_audio_handler audio_handler; + +/* local function prototypes ('static') */ +static uint8_t audio_init (usb_dev *udev, uint8_t config_index); +static uint8_t audio_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t audio_req_handler (usb_dev *udev, usb_req *req); +static uint8_t audio_set_intf (usb_dev *udev, usb_req *req); +static uint8_t audio_ctlx_out (usb_dev *udev); +static uint8_t audio_data_in (usb_dev *udev, uint8_t ep_num); +static uint8_t audio_data_out (usb_dev *udev, uint8_t ep_num); +static uint8_t audio_sof (usb_dev *udev); +static uint8_t audio_iso_in_incomplete (usb_dev *udev); +static uint8_t audio_iso_out_incomplete (usb_dev *udev); +static uint32_t usbd_audio_spk_get_feedback(usb_dev *udev); +static void get_feedback_fs_rate(uint32_t rate, uint8_t *buf); + +usb_class_core usbd_audio_cb = +{ + .init = audio_init, + .deinit = audio_deinit, + .req_proc = audio_req_handler, + .set_intf = audio_set_intf, + .ctlx_out = audio_ctlx_out, + .data_in = audio_data_in, + .data_out = audio_data_out, + .SOF = audio_sof, + .incomplete_isoc_in = audio_iso_in_incomplete, + .incomplete_isoc_out = audio_iso_out_incomplete +}; + +/* note:it should use the c99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev audio_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +const usb_desc_config_set audio_config_set = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = AD_CONFIG_DESC_SET_LEN, + .bNumInterfaces = 0x01U + CONFIG_DESC_AS_ITF_COUNT, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xC0U, + .bMaxPower = 0x32U + }, + + .std_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_CONTROL, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .ac_itf = + { + .header = + { + .bLength = sizeof(usb_desc_AC_itf), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = 0x01U, + .bcdADC = 0x0100U, + .wTotalLength = AC_ITF_TOTAL_LEN, + .bInCollection = CONFIG_DESC_AS_ITF_COUNT, +#ifdef USE_USB_AD_MICPHONE + .baInterfaceNr0 = 0x01U, +#endif +#ifdef USE_USB_AD_SPEAKER + .baInterfaceNr1 = 0x02U +#endif /* USE_USB_AD_SPEAKER */ + + }, + +#ifdef USE_USB_AD_MICPHONE + .mic_in_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_input_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = 0x02U, + .bTerminalID = 0x01U, + .wTerminalType = 0x0201U, + .bAssocTerminal = 0x00U, + .bNrChannels = 0x02U, + .wChannelConfig = 0x0003U, + .iChannelNames = 0x00U, + .iTerminal = 0x00U + }, + + .mic_feature_unit = + { + .header = + { + .bLength = sizeof(usb_desc_mono_feature_unit), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_FEATURE_UNIT, + .bUnitID = AD_IN_STREAMING_CTRL, + .bSourceID = 0x01U, + .bControlSize = 0x01U, + .bmaControls0 = AD_CONTROL_MUTE | AD_CONTROL_VOLUME, + .bmaControls1 = 0x00U, + .iFeature = 0x00U + }, + + .mic_out_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_output_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_OUTPUT_TERMINAL, + .bTerminalID = 0x03U, + .wTerminalType = 0x0101U, + .bAssocTerminal = 0x00U, + .bSourceID = 0x02U, + .iTerminal = 0x00U + }, +#endif /* USE_USB_AD_MICPHONE */ + +#ifdef USE_USB_AD_SPEAKER + .speak_in_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_input_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_INPUT_TERMINAL, + .bTerminalID = 0x04U, + .wTerminalType = 0x0101U, + .bAssocTerminal = 0x00U, + .bNrChannels = 0x02U, + .wChannelConfig = 0x0003U, + .iChannelNames = 0x00U, + .iTerminal = 0x00U + }, + + .speak_feature_unit = + { + .header = + { + .bLength = sizeof(usb_desc_mono_feature_unit), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_FEATURE_UNIT, + .bUnitID = AD_OUT_STREAMING_CTRL, + .bSourceID = 0x04U, + .bControlSize = 0x01U, + .bmaControls0 = AD_CONTROL_MUTE | AD_CONTROL_VOLUME, + .bmaControls1 = 0x00U, + .iFeature = 0x00U + }, + + .speak_out_terminal = + { + .header = + { + .bLength = sizeof(usb_desc_output_terminal), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_CONTROL_OUTPUT_TERMINAL, + .bTerminalID = 0x06U, + .wTerminalType = 0x0301U, + .bAssocTerminal = 0x00U, + .bSourceID = 0x05U, + .iTerminal = 0x00U + }, +#endif /* USE_USB_AD_SPEAKER */ + +#ifdef USE_USB_AD_MICPHONE + .mic_std_as_itf_zeroband = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .mic_std_as_itf_opera = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x01U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .mic_as_itf = + { + .header = + { + .bLength = sizeof(usb_desc_AS_itf), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_GENERAL, + .bTerminalLink = 0x03U, + .bDelay = 0x01U, + .wFormatTag = 0x0001U, + }, + + .mic_format_typeI = + { + .header = + { + .bLength = sizeof(usb_desc_format_type), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_FORMAT_TYPE, + .bFormatType = AD_FORMAT_TYPE_I, + .bNrChannels = MIC_IN_CHANNEL_NBR, + .bSubFrameSize = 0x02U, + .bBitResolution = MIC_IN_BIT_RESOLUTION, + .bSamFreqType = 0x01U, + .bSamFreq[0] = (uint8_t)USBD_MIC_FREQ, + .bSamFreq[1] = USBD_MIC_FREQ >> 8U, + .bSamFreq[2] = USBD_MIC_FREQ >> 16U + }, + + .mic_std_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_std_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = AD_IN_EP, + .bmAttributes = USB_ENDPOINT_TYPE_ISOCHRONOUS, + .wMaxPacketSize = MIC_IN_PACKET, + .bInterval = 0x01U, + .bRefresh = 0x00U, + .bSynchAddress = 0x00U + }, + + .mic_as_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_AS_ep), + .bDescriptorType = AD_DESCTYPE_ENDPOINT + }, + .bDescriptorSubtype = AD_ENDPOINT_GENERAL, + .bmAttributes = 0x00U, + .bLockDelayUnits = 0x00U, + .wLockDelay = 0x0000U, + }, +#endif /* USE_USB_AD_MICPHONE */ + +#ifdef USE_USB_AD_SPEAKER + .speak_std_as_itf_zeroband = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x02U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .speak_std_as_itf_opera = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x02U, + .bAlternateSetting = 0x01U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_AUDIO, + .bInterfaceSubClass = AD_SUBCLASS_AUDIOSTREAMING, + .bInterfaceProtocol = AD_PROTOCOL_UNDEFINED, + .iInterface = 0x00U + }, + + .speak_as_itf = + { + .header = + { + .bLength = sizeof(usb_desc_AS_itf), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_GENERAL, + .bTerminalLink = 0x04U, + .bDelay = 0x01U, + .wFormatTag = 0x0001U, + }, + + .speak_format_typeI = + { + .header = + { + .bLength = sizeof(usb_desc_format_type), + .bDescriptorType = AD_DESCTYPE_INTERFACE + }, + .bDescriptorSubtype = AD_STREAMING_FORMAT_TYPE, + .bFormatType = AD_FORMAT_TYPE_I, + .bNrChannels = SPEAKER_OUT_CHANNEL_NBR, + .bSubFrameSize = 0x02U, + .bBitResolution = SPEAKER_OUT_BIT_RESOLUTION, + .bSamFreqType = 0x01U, + .bSamFreq[0] = (uint8_t)USBD_SPEAKER_FREQ, + .bSamFreq[1] = USBD_SPEAKER_FREQ >> 8U, + .bSamFreq[2] = USBD_SPEAKER_FREQ >> 16U + }, + + .speak_std_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_std_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = AD_OUT_EP, + .bmAttributes = USB_EP_ATTR_ISO | USB_EP_ATTR_ASYNC, + .wMaxPacketSize = SPEAKER_OUT_PACKET, + .bInterval = 0x01U, + .bRefresh = 0x00U, + .bSynchAddress = AD_FEEDBACK_IN_EP, + }, + + .speak_as_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_AS_ep), + .bDescriptorType = AD_DESCTYPE_ENDPOINT + }, + .bDescriptorSubtype = AD_ENDPOINT_GENERAL, + .bmAttributes = 0x00U, + .bLockDelayUnits = 0x00U, + .wLockDelay = 0x0000U, + }, + + .speak_feedback_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_FeedBack_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = AD_FEEDBACK_IN_EP, + .bmAttributes = USB_EP_ATTR_ISO | USB_EP_ATTR_ASYNC | USB_EP_ATTR_FEEDBACK, + .wMaxPacketSize = FEEDBACK_IN_PACKET, + .bInterval = 0x01U, + .Refresh = FEEDBACK_IN_INTERVAL, /* refresh every 32(2^5) ms */ + .bSynchAddress = 0x00U, + }, +#endif /* USE_USB_AD_SPEAKER */ +}; + +/* USB language ID descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(14), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'A', 'u', 'd', 'i', 'o'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor */ +void *const usbd_audio_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +/* USB descriptor configure */ +usb_desc audio_desc = +{ + .dev_desc = (uint8_t *)&audio_dev_desc, + .config_desc = (uint8_t *)&audio_config_set, + .strings = usbd_audio_strings +}; + +/*! + \brief initialize the audio device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_init (usb_dev *udev, uint8_t config_index) +{ + memset((void *)&audio_handler, 0, sizeof(usbd_audio_handler)); + +#ifdef USE_USB_AD_MICPHONE +{ + usb_desc_std_ep std_ep = audio_config_set.mic_std_endpoint; + + usb_desc_ep ep = { + .header = std_ep.header, + .bEndpointAddress = std_ep.bEndpointAddress, + .bmAttributes = std_ep.bmAttributes, + .wMaxPacketSize = std_ep.wMaxPacketSize, + .bInterval = std_ep.bInterval + }; + + /* initialize TX endpoint */ + usbd_ep_setup (udev, &ep); +} +#endif /* USE_USB_AD_MICPHONE */ + + audio_handler.isoc_out_rdptr = audio_handler.isoc_out_buff; + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + + usb_desc_std_ep std_ep = audio_config_set.speak_std_endpoint; + + usb_desc_ep ep1 = { + .header = std_ep.header, + .bEndpointAddress = std_ep.bEndpointAddress, + .bmAttributes = std_ep.bmAttributes, + .wMaxPacketSize = SPEAKER_OUT_MAX_PACKET, + .bInterval = std_ep.bInterval + }; + + /* initialize Rx endpoint */ + usbd_ep_setup (udev, &ep1); + + /* prepare out endpoint to receive next audio packet */ + usbd_ep_recev (udev, AD_OUT_EP, audio_handler.usb_rx_buffer, SPEAKER_OUT_MAX_PACKET); + + /* initialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_init(USBD_SPEAKER_FREQ, DEFAULT_VOLUME)) { + return USBD_FAIL; + } + + usb_desc_FeedBack_ep feedback_ep = audio_config_set.speak_feedback_endpoint; + + usb_desc_ep ep2 = { + .header = feedback_ep.header, + .bEndpointAddress = feedback_ep.bEndpointAddress, + .bmAttributes = feedback_ep.bmAttributes, + .wMaxPacketSize = feedback_ep.wMaxPacketSize, + .bInterval = feedback_ep.bInterval + }; + + /* initialize Tx endpoint */ + usbd_ep_setup (udev, &ep2); + + return USBD_OK; +} + +/*! + \brief de-initialize the audio device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_deinit (usb_dev *udev, uint8_t config_index) +{ +#ifdef USE_USB_AD_MICPHONE + /* deinitialize audio endpoints */ + usbd_ep_clear(udev, AD_IN_EP); +#endif /* USE_USB_AD_MICPHONE */ + + /* deinitialize audio endpoints */ + usbd_ep_clear(udev, AD_OUT_EP); + + /* deinitialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_deinit()) { + return USBD_FAIL; + } + + /* deinitialize audio endpoints */ + usbd_ep_clear(udev, AD_FEEDBACK_IN_EP); + + return USBD_OK; +} + +/*! + \brief handle the audio class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_req_handler (usb_dev *udev, usb_req *req) +{ + uint8_t status = REQ_NOTSUPP; + + usb_transc *transc_in = &udev->dev.transc_in[0]; + usb_transc *transc_out = &udev->dev.transc_out[0]; + + switch (req->bRequest) { + case AD_REQ_GET_CUR: + transc_in->xfer_buf = audio_handler.audioctl; + transc_in->remain_len = req->wLength; + + status = REQ_SUPP; + break; + + case AD_REQ_SET_CUR: + if (req->wLength) { + transc_out->xfer_buf = audio_handler.audioctl; + transc_out->remain_len = req->wLength; + + udev->dev.class_core->command = AD_REQ_SET_CUR; + + audio_handler.audioctl_len = req->wLength; + audio_handler.audioctl_unit = BYTE_HIGH(req->wIndex); + + status = REQ_SUPP; + } + break; + + case AD_REQ_GET_MIN: + *((uint16_t *)audio_handler.audioctl) = VOL_MIN; + transc_in->xfer_buf = audio_handler.audioctl; + transc_in->remain_len = req->wLength; + status = REQ_SUPP; + break; + + case AD_REQ_GET_MAX: + *((uint16_t *)audio_handler.audioctl) = VOL_MAX; + transc_in->xfer_buf = audio_handler.audioctl; + transc_in->remain_len = req->wLength; + status = REQ_SUPP; + break; + + case AD_REQ_GET_RES: + *((uint16_t *)audio_handler.audioctl) = VOL_RES; + transc_in->xfer_buf = audio_handler.audioctl; + transc_in->remain_len = req->wLength; + status = REQ_SUPP; + break; + + default: + break; + } + + return status; +} + +/*! + \brief handle the audio set interface requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_set_intf(usb_dev *udev, usb_req *req) +{ + udev->dev.class_core->alter_set = req->wValue; + + if(0xFF != req->wValue){ + if (req->wValue != 0){ + /* deinit audio handler */ + memset((void *)&audio_handler, 0, sizeof(usbd_audio_handler)); + + audio_handler.play_flag = 0; + audio_handler.isoc_out_rdptr = audio_handler.isoc_out_buff; + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + + /* feedback calculate sample freq */ + audio_handler.actual_freq = I2S_ACTUAL_SAM_FREQ(USBD_SPEAKER_FREQ); + get_feedback_fs_rate(audio_handler.actual_freq, audio_handler.feedback_freq); + + /* send feedback data of estimated frequence*/ + usbd_ep_send(udev, AD_FEEDBACK_IN_EP, audio_handler.feedback_freq, FEEDBACK_IN_PACKET); + } else { + /* stop audio output */ + audio_out_fops.audio_cmd(audio_handler.isoc_out_rdptr, SPEAKER_OUT_PACKET/2, AD_CMD_STOP); + + audio_handler.play_flag = 0; + audio_handler.isoc_out_rdptr = audio_handler.isoc_out_buff; + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + + usbd_fifo_flush (udev, AD_IN_EP); + usbd_fifo_flush (udev, AD_FEEDBACK_IN_EP); + usbd_fifo_flush (udev, AD_OUT_EP); + } + } + + return 0; +} + +/*! + \brief handles the control transfer OUT callback + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_ctlx_out (usb_dev *udev) +{ +#ifdef USE_USB_AD_SPEAKER + /* handles audio control requests data */ + /* check if an audio_control request has been issued */ + if (AD_REQ_SET_CUR == udev->dev.class_core->command) { + /* in this driver, to simplify code, only SET_CUR request is managed */ + + /* check for which addressed unit the audio_control request has been issued */ + if (AD_OUT_STREAMING_CTRL == audio_handler.audioctl_unit) { + /* in this driver, to simplify code, only one unit is manage */ + + /* reset the audioctl_cmd variable to prevent re-entering this function */ + udev->dev.class_core->command = 0U; + + audio_handler.audioctl_len = 0U; + } + } +#endif /* USE_USB_AD_SPEAKER */ + + return USBD_OK; +} + +/*! + \brief handles the audio IN data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_data_in (usb_dev *udev, uint8_t ep_num) +{ +#ifdef USE_USB_AD_MICPHONE + if(ep_num == EP_ID(AD_IN_EP)){ + if(count_data < LENGTH_DATA){ + /* Prepare next buffer to be sent: dummy data */ + usbd_ep_send(udev, AD_IN_EP,(uint8_t*)&wavetestdata[count_data],MIC_IN_PACKET); + count_data += MIC_IN_PACKET; + } else { + usbd_ep_send(udev, AD_IN_EP,(uint8_t*)wavetestdata,MIC_IN_PACKET); + count_data = MIC_IN_PACKET; + } + } +#endif /* USE_USB_AD_MICPHONE */ + +#ifdef USE_USB_AD_SPEAKER + if(ep_num == EP_ID(AD_FEEDBACK_IN_EP)){ + /* calculate feedback actual freq */ + audio_handler.actual_freq = usbd_audio_spk_get_feedback(udev); + get_feedback_fs_rate(audio_handler.actual_freq, audio_handler.feedback_freq); + + usbd_ep_send(udev, AD_FEEDBACK_IN_EP, audio_handler.feedback_freq, FEEDBACK_IN_PACKET); + } +#endif /* USE_USB_AD_SPEAKER */ + + return USBD_OK; +} + +/*! + \brief handles the audio OUT data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_data_out (usb_dev *udev, uint8_t ep_num) +{ + uint16_t usb_rx_length, tail_len; + + /* get receive length */ + usb_rx_length = ((usb_core_driver *)udev)->dev.transc_out[ep_num].xfer_count; + + if(audio_handler.isoc_out_wrptr >= audio_handler.isoc_out_rdptr){ + audio_handler.buf_free_size = TOTAL_OUT_BUF_SIZE + audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + }else{ + audio_handler.buf_free_size = audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + } + + /* free buffer enough to save rx data */ + if(audio_handler.buf_free_size > usb_rx_length){ + if(audio_handler.isoc_out_wrptr >= audio_handler.isoc_out_rdptr){ + tail_len = audio_handler.isoc_out_buff + TOTAL_OUT_BUF_SIZE - audio_handler.isoc_out_wrptr; + + if(tail_len >= usb_rx_length){ + memcpy(audio_handler.isoc_out_wrptr, audio_handler.usb_rx_buffer, usb_rx_length); + + /* increment the buffer pointer */ + audio_handler.isoc_out_wrptr += usb_rx_length; + + /* increment the Buffer pointer or roll it back when all buffers are full */ + if(audio_handler.isoc_out_wrptr >= (audio_handler.isoc_out_buff + TOTAL_OUT_BUF_SIZE)){ + /* all buffers are full: roll back */ + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + } + }else{ + memcpy(audio_handler.isoc_out_wrptr, audio_handler.usb_rx_buffer, tail_len); + /* adjust write pointer */ + audio_handler.isoc_out_wrptr = audio_handler.isoc_out_buff; + + memcpy(audio_handler.isoc_out_wrptr, &audio_handler.usb_rx_buffer[tail_len], usb_rx_length - tail_len); + /* adjust write pointer */ + audio_handler.isoc_out_wrptr += usb_rx_length - tail_len; + } + }else{ + memcpy(audio_handler.isoc_out_wrptr, audio_handler.usb_rx_buffer, usb_rx_length); + + /* increment the buffer pointer */ + audio_handler.isoc_out_wrptr += usb_rx_length; + } + } + + /* Toggle the frame index */ + udev->dev.transc_out[ep_num].frame_num = (udev->dev.transc_out[ep_num].frame_num)? 0U:1U; + + /* prepare out endpoint to receive next audio packet */ + usbd_ep_recev (udev, AD_OUT_EP, audio_handler.usb_rx_buffer, SPEAKER_OUT_MAX_PACKET); + + if(audio_handler.isoc_out_wrptr >= audio_handler.isoc_out_rdptr){ + audio_handler.buf_free_size = TOTAL_OUT_BUF_SIZE + audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + }else{ + audio_handler.buf_free_size = audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + } + + if ((0U == audio_handler.play_flag) && (audio_handler.buf_free_size < TOTAL_OUT_BUF_SIZE/2)) { + /* enable start of streaming */ + audio_handler.play_flag = 1U; + + /* initialize the audio output hardware layer */ + if (USBD_OK != audio_out_fops.audio_cmd(audio_handler.isoc_out_rdptr, SPEAKER_OUT_MAX_PACKET/2, AD_CMD_PLAY)) { + return USBD_FAIL; + } + + audio_handler.dam_tx_len = SPEAKER_OUT_MAX_PACKET; + } + + return USBD_OK; +} + +/*! + \brief handles the SOF event (data buffer update and synchronization) + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_sof (usb_dev *udev) +{ + return USBD_OK; +} + +/*! + \brief handles the audio ISO IN Incomplete event + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_iso_in_incomplete (usb_dev *udev) +{ + (void)usb_txfifo_flush (&udev->regs, EP_ID(AD_FEEDBACK_IN_EP)); + + audio_handler.actual_freq = usbd_audio_spk_get_feedback(udev); + get_feedback_fs_rate(audio_handler.actual_freq, audio_handler.feedback_freq); + + /* send feedback data of estimated frequence*/ + usbd_ep_send(udev, AD_FEEDBACK_IN_EP, audio_handler.feedback_freq, FEEDBACK_IN_PACKET); + + return USBD_OK; +} + +/*! + \brief handles the audio ISO OUT Incomplete event + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t audio_iso_out_incomplete (usb_dev *udev) +{ + return USBD_OK; +} + +/*! + \brief calculate feedback sample frequency + \param[in] udev: pointer to USB device instance + \param[out] none + \retval feedback frequency value +*/ +static uint32_t usbd_audio_spk_get_feedback(usb_dev *udev) +{ + static uint32_t fb_freq; + + if(audio_handler.isoc_out_wrptr >= audio_handler.isoc_out_rdptr){ + audio_handler.buf_free_size = TOTAL_OUT_BUF_SIZE + audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + }else{ + audio_handler.buf_free_size = audio_handler.isoc_out_rdptr - audio_handler.isoc_out_wrptr; + } + + if(audio_handler.buf_free_size <= (TOTAL_OUT_BUF_SIZE/4)){ + fb_freq = I2S_ACTUAL_SAM_FREQ(USBD_SPEAKER_FREQ) - FEEDBACK_FREQ_OFFSET; + }else if(audio_handler.buf_free_size >= (TOTAL_OUT_BUF_SIZE*3/4)){ + fb_freq = I2S_ACTUAL_SAM_FREQ(USBD_SPEAKER_FREQ) + FEEDBACK_FREQ_OFFSET; + }else{ + fb_freq = I2S_ACTUAL_SAM_FREQ(USBD_SPEAKER_FREQ); + } + + return fb_freq; +} + +/*! + \brief get feedback value from rate in usb full speed + \param[in] rate: sample frequence + \param[in] buf: pointer to result buffer + \param[out] none + \retval USB device operation status +*/ +static void get_feedback_fs_rate(uint32_t rate, uint8_t *buf) +{ + rate = ((rate / 1000) << 14) | ((rate % 1000) << 4); + + buf[0] = rate; + buf[1] = rate >> 8; + buf[2] = rate >> 16; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_out_itf.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_out_itf.c new file mode 100644 index 0000000..b6ffc0e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/audio/Source/audio_out_itf.c @@ -0,0 +1,168 @@ +/*! + \file audio_out_itf.c + \brief audio OUT (playback) interface functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "audio_core.h" +#include "audio_out_itf.h" + +/* local function prototypes ('static') */ +static uint8_t init (uint32_t audio_freq, uint32_t volume); +static uint8_t deinit (void); +static uint8_t audio_cmd (uint8_t* pbuf, uint32_t size, uint8_t cmd); + +/* local variable defines */ +static uint8_t audio_state = AD_STATE_INACTIVE; + +audio_fops_struct audio_out_fops = +{ + .audio_init = init, + .audio_deinit = deinit, + .audio_cmd = audio_cmd, +}; + +/*! + \brief initialize and configures all required resources + \param[in] audio_freq: statrt_up audio frequency + \param[in] volume: start_up volume to be set + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t init (uint32_t audio_freq, uint32_t volume) +{ + static uint32_t initialized = 0U; + + /* check if the low layer has already been initialized */ + if (0U == initialized) { + /* initialize GPIO */ + codec_gpio_init(); + + /* initialize I2S */ + codec_audio_interface_init(audio_freq); + + /* initialize DMA */ + codec_i2s_dma_init(); + + /* prevent reinitializing the interface again */ + initialized = 1U; + } + + /* update the audio state machine */ + audio_state = AD_STATE_ACTIVE; + + return AD_OK; +} + +/*! + \brief free all resources used by low layer and stops audio-play function + \param[in] none + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t deinit (void) +{ + /* update the audio state machine */ + audio_state = AD_STATE_INACTIVE; + + return AD_OK; +} + +/*! + \brief play, stop, pause or resume current file + \param[in] pbuf: address from which file should be played + \param[in] size: size of the current buffer/file + \param[in] cmd: command to be executed, can be: + \arg AD_CMD_PLAY + \arg AD_CMD_PAUSE + \arg AD_CMD_RESUME + \arg AD_CMD_STOP + \param[out] none + \retval AD_OK if all operations succeed, otherwise, AD_FAIL. +*/ +static uint8_t audio_cmd (uint8_t* pbuf, uint32_t size, uint8_t cmd) +{ + /* check the current state */ + if ((AD_STATE_INACTIVE == audio_state) || (AD_STATE_ERROR == audio_state)) { + audio_state = AD_STATE_ERROR; + + return AD_FAIL; + } + + switch (cmd) { + /* process the play command */ + case AD_CMD_PLAY: + /* if current state is active or stopped */ + if ((AD_STATE_ACTIVE == audio_state) || \ + (AD_STATE_STOPPED == audio_state) || \ + (AD_STATE_PLAYING == audio_state)) { + audio_play((uint32_t)pbuf, size); + audio_state = AD_STATE_PLAYING; + + return AD_OK; + } else if (AD_STATE_PAUSED == audio_state) { + audio_pause_resume(AD_RESUME, (uint32_t)pbuf, (size/2)); + audio_state = AD_STATE_PLAYING; + + return AD_OK; + } else { + return AD_FAIL; + } + + /* process the stop command */ + case AD_CMD_STOP: + if (AD_STATE_PLAYING != audio_state) { + /* unsupported command */ + return AD_FAIL; + } else { + audio_stop(); + audio_state = AD_STATE_STOPPED; + + return AD_OK; + } + + /* process the pause command */ + case AD_CMD_PAUSE: + if (AD_STATE_PLAYING != audio_state) { + /* unsupported command */ + return AD_FAIL; + } else { + audio_pause_resume(AD_PAUSE, (uint32_t)pbuf, (size/2)); + audio_state = AD_STATE_PAUSED; + + return AD_OK; + } + + /* unsupported command */ + default: + return AD_FAIL; + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Include/cdc_acm_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Include/cdc_acm_core.h new file mode 100644 index 0000000..13dc4e3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Include/cdc_acm_core.h @@ -0,0 +1,64 @@ +/*! + \file cdc_acm_core.h + \brief the header file of cdc acm driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __CDC_ACM_CORE_H +#define __CDC_ACM_CORE_H + +#include "usbd_enum.h" +#include "usb_cdc.h" + +#define USB_CDC_RX_LEN 64 + +typedef struct +{ + uint8_t packet_sent; + uint8_t packet_receive; + uint8_t data[USB_CDC_RX_LEN]; + uint8_t cmd[USB_CDC_CMD_PACKET_SIZE]; + uint32_t receive_length; + acm_line line_coding; +} usb_cdc_handler; + +extern usb_desc cdc_desc; +extern usb_class_core cdc_class; + +/* function declarations */ +/* check CDC ACM is ready for data transfer */ +uint8_t cdc_acm_check_ready(usb_dev *udev); +/* send CDC ACM data */ +void cdc_acm_data_send(usb_dev *udev); +/* receive CDC ACM data */ +void cdc_acm_data_receive(usb_dev *udev); + +#endif /* __CDC_ACM_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Source/cdc_acm_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Source/cdc_acm_core.c new file mode 100644 index 0000000..245b041 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/cdc/Source/cdc_acm_core.c @@ -0,0 +1,523 @@ +/*! + \file cdc_acm_core.c + \brief CDC ACM driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "cdc_acm_core.h" + +#define USBD_VID 0x28E9U +#define USBD_PID 0x018AU + +/* note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev cdc_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = USB_CLASS_CDC, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +const usb_cdc_desc_config_set cdc_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG, + }, + .wTotalLength = USB_CDC_ACM_CONFIG_DESC_SIZE, + .bNumInterfaces = 0x02U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .cmd_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_CLASS_CDC, + .bInterfaceSubClass = USB_CDC_SUBCLASS_ACM, + .bInterfaceProtocol = USB_CDC_PROTOCOL_AT, + .iInterface = 0x00U + }, + + .cdc_header = + { + .header = + { + .bLength = sizeof(usb_desc_header_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x00U, + .bcdCDC = 0x0110U + }, + + .cdc_call_managment = + { + .header = + { + .bLength = sizeof(usb_desc_call_managment_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x01U, + .bmCapabilities = 0x00U, + .bDataInterface = 0x01U + }, + + .cdc_acm = + { + .header = + { + .bLength = sizeof(usb_desc_acm_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x02U, + .bmCapabilities = 0x02U, + }, + + .cdc_union = + { + .header = + { + .bLength = sizeof(usb_desc_union_func), + .bDescriptorType = USB_DESCTYPE_CS_INTERFACE + }, + .bDescriptorSubtype = 0x06U, + .bMasterInterface = 0x00U, + .bSlaveInterface0 = 0x01U, + }, + + .cdc_cmd_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP, + }, + .bEndpointAddress = CDC_CMD_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = USB_CDC_CMD_PACKET_SIZE, + .bInterval = 0x0AU + }, + + .cdc_data_interface = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF, + }, + .bInterfaceNumber = 0x01U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_DATA, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = USB_CDC_PROTOCOL_NONE, + .iInterface = 0x00U + }, + + .cdc_out_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP, + }, + .bEndpointAddress = CDC_DATA_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = USB_CDC_DATA_PACKET_SIZE, + .bInterval = 0x00U + }, + + .cdc_in_endpoint = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CDC_DATA_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = USB_CDC_DATA_PACKET_SIZE, + .bInterval = 0x00U + } +}; + +/* USB language ID Descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'C', 'D', 'C', '_', 'A', 'C', 'M'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +void *const usbd_cdc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc cdc_desc = +{ + .dev_desc = (uint8_t *)&cdc_dev_desc, + .config_desc = (uint8_t *)&cdc_config_desc, + .strings = usbd_cdc_strings +}; + +/* local function prototypes ('static') */ +static uint8_t cdc_acm_init (usb_dev *udev, uint8_t config_index); +static uint8_t cdc_acm_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t cdc_acm_req (usb_dev *udev, usb_req *req); +static uint8_t cdc_ctlx_out (usb_dev *udev); +static uint8_t cdc_acm_in (usb_dev *udev, uint8_t ep_num); +static uint8_t cdc_acm_out (usb_dev *udev, uint8_t ep_num); + +/* USB CDC device class callbacks structure */ +usb_class_core cdc_class = +{ + .command = NO_CMD, + .alter_set = 0U, + + .init = cdc_acm_init, + .deinit = cdc_acm_deinit, + .req_proc = cdc_acm_req, + .ctlx_out = cdc_ctlx_out, + .data_in = cdc_acm_in, + .data_out = cdc_acm_out +}; + +/*! + \brief check CDC ACM is ready for data transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval 0 if CDC is ready, 5 else +*/ +uint8_t cdc_acm_check_ready(usb_dev *udev) +{ + if (NULL != udev->dev.class_data[CDC_COM_INTERFACE]) { + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + if ((1U == cdc->packet_receive) && (1U == cdc->packet_sent)) { + return 0U; + } + } + + return 1U; +} + +/*! + \brief send CDC ACM data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_acm_data_send (usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + if (0U != cdc->receive_length) { + cdc->packet_sent = 0U; + + usbd_ep_send (udev, CDC_DATA_IN_EP, (uint8_t*)(cdc->data), cdc->receive_length); + + cdc->receive_length = 0U; + } +} + +/*! + \brief receive CDC ACM data + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +void cdc_acm_data_receive (usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + cdc->packet_receive = 0U; + cdc->packet_sent = 0U; + + usbd_ep_recev(udev, CDC_DATA_OUT_EP, (uint8_t*)(cdc->data), USB_CDC_DATA_PACKET_SIZE); +} + +/*! + \brief initialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_init (usb_dev *udev, uint8_t config_index) +{ + static usb_cdc_handler cdc_handler; + + /* initialize the data Tx endpoint */ + usbd_ep_setup (udev, &(cdc_config_desc.cdc_in_endpoint)); + + /* initialize the data Rx endpoint */ + usbd_ep_setup (udev, &(cdc_config_desc.cdc_out_endpoint)); + + /* initialize the command Tx endpoint */ + usbd_ep_setup (udev, &(cdc_config_desc.cdc_cmd_endpoint)); + + /* initialize CDC handler structure */ + cdc_handler.packet_receive = 1U; + cdc_handler.packet_sent = 1U; + cdc_handler.receive_length = 0U; + + cdc_handler.line_coding = (acm_line){ + .dwDTERate = 115200, + .bCharFormat = 0, + .bParityType = 0, + .bDataBits = 0x08 + }; + + udev->dev.class_data[CDC_COM_INTERFACE] = (void *)&cdc_handler; + + return USBD_OK; +} + +/*! + \brief deinitialize the CDC ACM device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize the data Tx / Rx endpoint */ + usbd_ep_clear (udev, CDC_DATA_IN_EP); + usbd_ep_clear (udev, CDC_DATA_OUT_EP); + + /* deinitialize the command Tx endpoint */ + usbd_ep_clear (udev, CDC_CMD_EP); + + return USBD_OK; +} + +/*! + \brief handle the CDC ACM class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_req (usb_dev *udev, usb_req *req) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + usb_transc *transc = NULL; + + switch (req->bRequest) { + case SEND_ENCAPSULATED_COMMAND: + /* no operation for this driver */ + break; + + case GET_ENCAPSULATED_RESPONSE: + /* no operation for this driver */ + break; + + case SET_COMM_FEATURE: + /* no operation for this driver */ + break; + + case GET_COMM_FEATURE: + /* no operation for this driver */ + break; + + case CLEAR_COMM_FEATURE: + /* no operation for this driver */ + break; + + case SET_LINE_CODING: + transc = &udev->dev.transc_out[0]; + + /* set the value of the current command to be processed */ + udev->dev.class_core->alter_set = req->bRequest; + + /* enable EP0 prepare to receive command data packet */ + transc->remain_len = req->wLength; + transc->xfer_buf = cdc->cmd; + break; + + case GET_LINE_CODING: + transc = &udev->dev.transc_in[0]; + + cdc->cmd[0] = (uint8_t)(cdc->line_coding.dwDTERate); + cdc->cmd[1] = (uint8_t)(cdc->line_coding.dwDTERate >> 8); + cdc->cmd[2] = (uint8_t)(cdc->line_coding.dwDTERate >> 16); + cdc->cmd[3] = (uint8_t)(cdc->line_coding.dwDTERate >> 24); + cdc->cmd[4] = cdc->line_coding.bCharFormat; + cdc->cmd[5] = cdc->line_coding.bParityType; + cdc->cmd[6] = cdc->line_coding.bDataBits; + + transc->xfer_buf = cdc->cmd; + transc->remain_len = 7U; + break; + + case SET_CONTROL_LINE_STATE: + /* no operation for this driver */ + break; + + case SEND_BREAK: + /* no operation for this driver */ + break; + + default: + break; + } + + return USBD_OK; +} + +static uint8_t cdc_ctlx_out (usb_dev *udev) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + if (udev->dev.class_core->alter_set != NO_CMD) { + /* process the command data */ + cdc->line_coding.dwDTERate = (uint32_t)((uint32_t)cdc->cmd[0] | + ((uint32_t)cdc->cmd[1] << 8U) | + ((uint32_t)cdc->cmd[2] << 16U) | + ((uint32_t)cdc->cmd[3] << 24U)); + + cdc->line_coding.bCharFormat = cdc->cmd[4]; + cdc->line_coding.bParityType = cdc->cmd[5]; + cdc->line_coding.bDataBits = cdc->cmd[6]; + + udev->dev.class_core->alter_set = NO_CMD; + } + + return USBD_OK; +} + +/*! + \brief handle CDC ACM data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_in (usb_dev *udev, uint8_t ep_num) +{ + usb_transc *transc = &udev->dev.transc_in[EP_ID(ep_num)]; + + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + if ((0U == transc->xfer_len % transc->max_len) && (0U != transc->xfer_len)) { + usbd_ep_send (udev, ep_num, NULL, 0U); + } else { + cdc->packet_sent = 1U; + } + + return USBD_OK; +} + +/*! + \brief handle CDC ACM data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static uint8_t cdc_acm_out (usb_dev *udev, uint8_t ep_num) +{ + usb_cdc_handler *cdc = (usb_cdc_handler *)udev->dev.class_data[CDC_COM_INTERFACE]; + + cdc->packet_receive = 1U; + cdc->receive_length = ((usb_core_driver *)udev)->dev.transc_out[ep_num].xfer_count; + + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_core.h new file mode 100644 index 0000000..cfdfac9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_core.h @@ -0,0 +1,178 @@ +/*! + \file dfu_core.h + \brief the header file of USB DFU device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DFU_CORE_H +#define __DFU_CORE_H + +#include "usbd_enum.h" + +/* DFU class code */ +#define USB_DFU_CLASS 0xFEU + +/* DFU subclass code */ +#define USB_DFU_SUBCLASS_UPGRADE 0x01U + +/* DFU protocol code */ +#define USB_DFU_PROTOCL_RUNTIME 0x01U +#define USB_DFU_PROTOCL_DFU 0x02U + +/* manifestation state */ +#define MANIFEST_COMPLETE 0x00U +#define MANIFEST_IN_PROGRESS 0x01U + +/* DFU attributes code */ +#define USB_DFU_CAN_DOWNLOAD 0x01U +#define USB_DFU_CAN_UPLOAD 0x02U +#define USB_DFU_MANIFEST_TOLERANT 0x04U +#define USB_DFU_WILL_DETACH 0x08U + +/* special commands with download request */ +#define GET_COMMANDS 0x00U +#define SET_ADDRESS_POINTER 0x21U +#define ERASE 0x41U + +/* memory operation command */ +#define CMD_ERASE 0U +#define CMD_WRITE 1U + +#define _BYTE1(x) (uint8_t)((x) & 0xFFU) /*!< addressing cycle 1st byte */ +#define _BYTE2(x) (uint8_t)(((x) & 0xFF00U) >> 8U) /*!< addressing cycle 2nd byte */ +#define _BYTE3(x) (uint8_t)(((x) & 0xFF0000U) >> 16U) /*!< addressing cycle 3rd byte */ + +#define FLASH_ERASE_TIMEOUT 60U +#define FLASH_WRITE_TIMEOUT 80U + +/* bit detach capable = bit 3 in bmAttributes field */ +#define DFU_DETACH_MASK (uint8_t)(0x10U) + +#define DFU_DESC_TYPE 0x21U + +/* DFU device state defines */ +typedef enum +{ + STATE_APP_IDLE = 0x00U, + STATE_APP_DETACH, + STATE_DFU_IDLE, + STATE_DFU_DNLOAD_SYNC, + STATE_DFU_DNBUSY, + STATE_DFU_DNLOAD_IDLE, + STATE_DFU_MANIFEST_SYNC, + STATE_DFU_MANIFEST, + STATE_DFU_MANIFEST_WAIT_RESET, + STATE_DFU_UPLOAD_IDLE, + STATE_DFU_ERROR +} dfu_state; + +/* DFU device status defines */ +typedef enum +{ + STATUS_OK = 0x00U, + STATUS_ERR_TARGET, + STATUS_ERR_FILE, + STATUS_ERR_WRITE, + STATUS_ERR_ERASE, + STATUS_ERR_CHECK_ERASED, + STATUS_ERR_PROG, + STATUS_ERR_VERIFY, + STATUS_ERR_ADDRESS, + STATUS_ERR_NOTDONE, + STATUS_ERR_FIRMWARE, + STATUS_ERR_VENDOR, + STATUS_ERR_USBR, + STATUS_ERR_POR, + STATUS_ERR_UNKNOWN, + STATUS_ERR_STALLEDPKT +} dfu_status; + +/* DFU class-specific requests */ +typedef enum +{ + DFU_DETACH = 0U, + DFU_DNLOAD, + DFU_UPLOAD, + DFU_GETSTATUS, + DFU_CLRSTATUS, + DFU_GETSTATE, + DFU_ABORT, + DFU_REQ_MAX +} dfu_requests; + +#pragma pack(1) + +/* USB DFU function descriptor structure */ +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size */ + uint8_t bmAttributes; /*!< DFU attributes */ + uint16_t wDetachTimeOut; /*!< time, in milliseconds, that the device will wait after receipt of the DFU_DETACH request. If */ + uint16_t wTransferSize; /*!< maximum number of bytes that the device can accept per control-write transaction */ + uint16_t bcdDFUVersion; /*!< numeric expression identifying the version of the DFU specification release. */ +} usb_desc_dfu_func; + +#pragma pack() + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf dfu_itf0; + usb_desc_itf dfu_itf1; + usb_desc_itf dfu_itf2; + usb_desc_dfu_func dfu_func; +} usb_dfu_desc_config_set; + +/* USB DFU handler structure */ +typedef struct +{ + uint8_t bStatus; + uint8_t bwPollTimeout0; + uint8_t bwPollTimeout1; + uint8_t bwPollTimeout2; + uint8_t bState; + uint8_t iString; + + uint8_t manifest_state; + uint32_t data_len; + uint16_t block_num; + uint32_t base_addr; + + uint8_t buf[TRANSFER_SIZE]; +} usbd_dfu_handler; + +typedef void (*app_func) (void); + +extern usb_desc dfu_desc; +extern usb_class_core dfu_class; + +#endif /* DFU_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_mem.h new file mode 100644 index 0000000..4ec6112 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Include/dfu_mem.h @@ -0,0 +1,83 @@ +/*! + \file dfu_mem.h + \brief USB DFU device media access layer header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DFU_MEM_H +#define __DFU_MEM_H + +#include "usb_conf.h" + +typedef struct _dfu_mem_prop +{ + const uint8_t* pstr_desc; + + uint8_t (*mem_init)(void); + uint8_t (*mem_deinit)(void); + uint8_t (*mem_erase)(uint32_t addr); + uint8_t (*mem_write)(uint8_t *buf, uint32_t addr, uint32_t len); + uint8_t *(*mem_read)(uint8_t *buf, uint32_t addr, uint32_t len); + uint8_t (*mem_checkaddr)(uint32_t addr); + + const uint32_t erase_timeout; + const uint32_t write_timeout; +} dfu_mem_prop; + +typedef enum +{ + MEM_OK = 0, + MEM_FAIL +} mem_status; + +#define _1ST_BYTE(x) (uint8_t)((x) & 0xFF) /*!< addressing cycle 1st byte */ +#define _2ND_BYTE(x) (uint8_t)(((x) & 0xFF00) >> 8) /*!< addressing cycle 2nd byte */ +#define _3RD_BYTE(x) (uint8_t)(((x) & 0xFF0000) >> 16) /*!< addressing cycle 3rd byte */ + +#define POLLING_TIMEOUT_SET(x) buffer[0] = _1ST_BYTE(x);\ + buffer[1] = _2ND_BYTE(x);\ + buffer[2] = _3RD_BYTE(x); + +/* function declarations */ +/* initialize the memory media on the GD32 */ +uint8_t dfu_mem_init(void); +/* deinitialize the memory media on the GD32 */ +uint8_t dfu_mem_deinit(void); +/* erase a memory sector */ +uint8_t dfu_mem_erase(uint32_t addr); +/* write data to sectors of memory */ +uint8_t dfu_mem_write(uint8_t *buf, uint32_t addr, uint32_t len); +/* read data from sectors of memory */ +uint8_t* dfu_mem_read(uint8_t *buf, uint32_t addr, uint32_t len); +/* get the status of a given memory and store in buffer */ +uint8_t dfu_mem_getstatus(uint32_t addr, uint8_t cmd, uint8_t *buffer); + +#endif /* __DFU_MEM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_core.c new file mode 100644 index 0000000..ed906ee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_core.c @@ -0,0 +1,733 @@ +/*! + \file dfu_core.c + \brief USB DFU device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_core.h" +#include "dfu_mem.h" +#include "drv_usb_hw.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x0189U + +/* local function prototypes ('static') */ +static uint8_t dfu_init(usb_dev *udev, uint8_t config_index); +static uint8_t dfu_deinit(usb_dev *udev, uint8_t config_index); +static uint8_t dfu_req_handler(usb_dev *udev, usb_req *req); +static uint8_t dfu_ctlx_in(usb_dev *udev); + +static void dfu_mode_leave(usb_dev *udev); +static uint8_t dfu_getstatus_complete (usb_dev *udev); + +/* DFU requests management functions */ +static void dfu_detach(usb_dev *udev, usb_req *req); +static void dfu_dnload(usb_dev *udev, usb_req *req); +static void dfu_upload(usb_dev *udev, usb_req *req); +static void dfu_getstatus(usb_dev *udev, usb_req *req); +static void dfu_clrstatus(usb_dev *udev, usb_req *req); +static void dfu_getstate(usb_dev *udev, usb_req *req); +static void dfu_abort(usb_dev *udev, usb_req *req); + +static void string_to_unicode (uint8_t *str, uint16_t *pbuf); + +static void (*dfu_request_process[])(usb_dev *udev, usb_req *req) = +{ + [DFU_DETACH] = dfu_detach, + [DFU_DNLOAD] = dfu_dnload, + [DFU_UPLOAD] = dfu_upload, + [DFU_GETSTATUS] = dfu_getstatus, + [DFU_CLRSTATUS] = dfu_clrstatus, + [DFU_GETSTATE] = dfu_getstate, + [DFU_ABORT] = dfu_abort +}; + +/* note:it should use the c99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev dfu_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +const usb_dfu_desc_config_set dfu_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = sizeof(usb_dfu_desc_config_set), + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .dfu_itf0 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF0 + }, + + .dfu_itf1 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x01U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF1 + }, + + .dfu_itf2 = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x02U, + .bNumEndpoints = 0x00U, + .bInterfaceClass = USB_DFU_CLASS, + .bInterfaceSubClass = USB_DFU_SUBCLASS_UPGRADE, + .bInterfaceProtocol = USB_DFU_PROTOCL_DFU, + .iInterface = STR_IDX_ALT_ITF2 + }, + + .dfu_func= + { + .header = + { + .bLength = sizeof(usb_desc_dfu_func), + .bDescriptorType = DFU_DESC_TYPE + }, + .bmAttributes = USB_DFU_CAN_DOWNLOAD | USB_DFU_CAN_UPLOAD | USB_DFU_WILL_DETACH, + .wDetachTimeOut = 0x00FFU, + .wTransferSize = TRANSFER_SIZE, + .bcdDFUVersion = 0x0110U, + }, +}; + +/* USB language ID descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'D', 'F', 'U'} +}; + +/* USB serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB configure string */ +static const usb_desc_str config_string = +{ + .header = + { + .bLength = USB_STRING_LEN(15U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', ' ', 'U', 'S', 'B', ' ', 'C', 'O', 'N', 'F', 'I', 'G'} +}; + +/* alternate interface 0 string */ +static usb_desc_str interface_string0 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; + +/* alternate interface 1 string */ +static usb_desc_str interface_string1 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; + +/* alternate interface 2 string */ +static usb_desc_str interface_string2 = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + }, +}; + +void *const usbd_dfu_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string, + [STR_IDX_CONFIG] = (uint8_t *)&config_string, + [STR_IDX_ALT_ITF0] = (uint8_t *)&interface_string0, + [STR_IDX_ALT_ITF1] = (uint8_t *)&interface_string1, + [STR_IDX_ALT_ITF2] = (uint8_t *)&interface_string2, +}; + +usb_desc dfu_desc = { + .dev_desc = (uint8_t *)&dfu_dev_desc, + .config_desc = (uint8_t *)&dfu_config_desc, + .strings = usbd_dfu_strings +}; + +usb_class_core dfu_class = { + .init = dfu_init, + .deinit = dfu_deinit, + .req_proc = dfu_req_handler, + .ctlx_in = dfu_ctlx_in +}; + +/*! + \brief initialize the DFU device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_init (usb_dev *udev, uint8_t config_index) +{ + static usbd_dfu_handler dfu_handler; + + /* unlock the internal flash */ + dfu_mem_init(); + + memset((void *)&dfu_handler, 0, sizeof(usbd_dfu_handler)); + + dfu_handler.manifest_state = MANIFEST_COMPLETE; + dfu_handler.bState = STATE_DFU_IDLE; + dfu_handler.bStatus = STATUS_OK; + + udev->dev.class_data[USBD_DFU_INTERFACE] = (void *)&dfu_handler; + + /* create interface string */ + string_to_unicode((uint8_t *)dfu_inter_flash_cb.pstr_desc, udev->dev.desc->strings[STR_IDX_ALT_ITF0]); + string_to_unicode((uint8_t *)dfu_nor_flash_cb.pstr_desc, udev->dev.desc->strings[STR_IDX_ALT_ITF1]); + string_to_unicode((uint8_t *)dfu_nand_flash_cb.pstr_desc, udev->dev.desc->strings[STR_IDX_ALT_ITF2]); + + return USBD_OK; +} + +/*! + \brief deinitialize the DFU device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_deinit (usb_dev *udev, uint8_t config_index) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + /* restore device default state */ + memset(udev->dev.class_data[USBD_DFU_INTERFACE], 0, sizeof(usbd_dfu_handler)); + + dfu->bState = STATE_DFU_IDLE; + dfu->bStatus = STATUS_OK; + + /* deinit the memory */ + dfu_mem_deinit(); + + return USBD_OK; +} + +/*! + \brief handle the DFU class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_req_handler (usb_dev *udev, usb_req *req) +{ + if (req->bRequest < DFU_REQ_MAX) { + dfu_request_process[req->bRequest](udev, req); + } else { + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle data stage + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status +*/ +static uint8_t dfu_ctlx_in (usb_dev *udev) +{ + dfu_getstatus_complete(udev); + + return USBD_OK; +} + +/*! + \brief leave DFU mode and reset device to jump to user loaded code + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void dfu_mode_leave (usb_dev *udev) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + dfu->manifest_state = MANIFEST_COMPLETE; + + if (dfu_config_desc.dfu_func.bmAttributes & 0x04U) { + dfu->bState = STATE_DFU_MANIFEST_SYNC; + } else { + dfu->bState = STATE_DFU_MANIFEST_WAIT_RESET; + + /* deinit the memory */ + dfu_mem_deinit(); + + /* generate system reset to allow jumping to the user code */ + NVIC_SystemReset(); + } +} + +/*! + \brief handle data IN stage in control endpoint 0 + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation status + */ +static uint8_t dfu_getstatus_complete (usb_dev *udev) +{ + uint32_t addr; + + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + if (STATE_DFU_DNBUSY == dfu->bState) { + /* decode the special command */ + if (0U == dfu->block_num) { + if (1U == dfu->data_len){ + if (GET_COMMANDS == dfu->buf[0]) { + /* no operation */ + } + } else if (5U == dfu->data_len) { + if (SET_ADDRESS_POINTER == dfu->buf[0]) { + /* set flash operation address */ + dfu->base_addr = *(uint32_t *)(dfu->buf + 1U); + } else if (ERASE == dfu->buf[0]) { + dfu->base_addr = *(uint32_t *)(dfu->buf + 1U); + + dfu_mem_erase(dfu->base_addr); + } else { + /* no operation */ + } + } else { + /* no operation */ + } + } else if (dfu->block_num > 1U) { /* regular download command */ + /* decode the required address */ + addr = (dfu->block_num - 2U) * TRANSFER_SIZE + dfu->base_addr; + + dfu_mem_write (dfu->buf, addr, dfu->data_len); + + dfu->block_num = 0U; + } else { + /* no operation */ + } + + dfu->data_len = 0U; + + /* update the device state and poll timeout */ + dfu->bState = STATE_DFU_DNLOAD_SYNC; + + return USBD_OK; + } else if (dfu->bState == STATE_DFU_MANIFEST) { /* manifestation in progress */ + /* start leaving DFU mode */ + dfu_mode_leave(udev); + } else { + /* no operation */ + } + + return USBD_OK; +} + +/*! + \brief handle the DFU_DETACH request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none. +*/ +static void dfu_detach(usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_SYNC: + case STATE_DFU_DNLOAD_IDLE: + case STATE_DFU_MANIFEST_SYNC: + case STATE_DFU_UPLOAD_IDLE: + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + dfu->iString = 0U; /* iString */ + + dfu->block_num = 0U; + dfu->data_len = 0U; + break; + + default: + break; + } + + /* check the detach capability in the DFU functional descriptor */ + if (dfu_config_desc.dfu_func.wDetachTimeOut & DFU_DETACH_MASK) { + usbd_disconnect (udev); + + usbd_connect (udev); + } else { + /* wait for the period of time specified in detach request */ + usb_mdelay (4U); + } +} + +/*! + \brief handle the DFU_DNLOAD request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_dnload(usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_out[0]; + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_IDLE: + if (req->wLength > 0U) { + /* update the global length and block number */ + dfu->block_num = req->wValue; + dfu->data_len = req->wLength; + + dfu->bState = STATE_DFU_DNLOAD_SYNC; + + transc->remain_len = dfu->data_len; + transc->xfer_buf = dfu->buf; + } else { + dfu->manifest_state = MANIFEST_IN_PROGRESS; + dfu->bState = STATE_DFU_MANIFEST_SYNC; + } + break; + + default: + break; + } +} + +/*! + \brief handles the DFU UPLOAD request. + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_upload (usb_dev *udev, usb_req *req) +{ + uint8_t *phy_addr = NULL; + uint32_t addr = 0U; + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + usb_transc *transc = &udev->dev.transc_in[0]; + + if(req->wLength <= 0U) { + dfu->bState = STATE_DFU_IDLE; + return; + } + + switch (dfu->bState) { + case STATE_DFU_IDLE: + case STATE_DFU_UPLOAD_IDLE: + /* update the global length and block number */ + dfu->block_num = req->wValue; + dfu->data_len = req->wLength; + + /* DFU get command */ + if (0U == dfu->block_num) { + /* update the state machine */ + dfu->bState = (dfu->data_len > 3U) ? STATE_DFU_IDLE : STATE_DFU_UPLOAD_IDLE; + + /* store the values of all supported commands */ + dfu->buf[0] = GET_COMMANDS; + dfu->buf[1] = SET_ADDRESS_POINTER; + dfu->buf[2] = ERASE; + + /* send the status data over EP0 */ + transc->xfer_buf = &(dfu->buf[0]); + transc->remain_len = 3U; + } else if (dfu->block_num > 1U) { + dfu->bState = STATE_DFU_UPLOAD_IDLE; + + /* change is accelerated */ + addr = (dfu->block_num - 2U) * TRANSFER_SIZE + dfu->base_addr; + + /* return the physical address where data are stored */ + phy_addr = dfu_mem_read (dfu->buf, addr, dfu->data_len); + + /* send the status data over EP0 */ + transc->xfer_buf = phy_addr; + transc->remain_len = dfu->data_len; + } else { + dfu->bState = STATUS_ERR_STALLEDPKT; + } + break; + + default: + dfu->data_len = 0U; + dfu->block_num = 0U; + break; + } +} + +/*! + \brief handle the DFU_GETSTATUS request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_getstatus (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState) { + case STATE_DFU_DNLOAD_SYNC: + if (0U != dfu->data_len) { + dfu->bState = STATE_DFU_DNBUSY; + + if (0U == dfu->block_num) { + if (ERASE == dfu->buf[0]) { + dfu_mem_getstatus (dfu->base_addr, CMD_ERASE, (uint8_t *)&dfu->bwPollTimeout0); + } else { + dfu_mem_getstatus (dfu->base_addr, CMD_WRITE, (uint8_t *)&dfu->bwPollTimeout0); + } + } + } else { + dfu->bState = STATE_DFU_DNLOAD_IDLE; + } + break; + + case STATE_DFU_MANIFEST_SYNC: + if (MANIFEST_IN_PROGRESS == dfu->manifest_state) { + dfu->bState = STATE_DFU_MANIFEST; + dfu->bwPollTimeout0 = 1U; + } else if ((MANIFEST_COMPLETE == dfu->manifest_state) && \ + (dfu_config_desc.dfu_func.bmAttributes & 0x04U)){ + dfu->bState = STATE_DFU_IDLE; + dfu->bwPollTimeout0 = 0U; + } else { + /* no operation */ + } + break; + + default: + break; + } + + /* send the status data of DFU interface to host over EP0 */ + transc->xfer_buf = (uint8_t *)&(dfu->bStatus); + transc->remain_len = 6U; +} + +/*! + \brief handle the DFU_CLRSTATUS request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_clrstatus (usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + if (STATE_DFU_ERROR == dfu->bState) { + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + } else { + /* state error */ + dfu->bStatus = STATUS_ERR_UNKNOWN; + dfu->bState = STATE_DFU_ERROR; + } + + dfu->iString = 0U; /* iString: index = 0 */ +} + +/*! + \brief handle the DFU_GETSTATE request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_getstate (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + /* send the current state of the DFU interface to host */ + transc->xfer_buf = &(dfu->bState); + transc->remain_len = 1U; +} + +/*! + \brief handle the DFU_ABORT request + \param[in] udev: pointer to USB device instance + \param[in] req: DFU class request + \param[out] none + \retval none +*/ +static void dfu_abort (usb_dev *udev, usb_req *req) +{ + usbd_dfu_handler *dfu = (usbd_dfu_handler *)udev->dev.class_data[USBD_DFU_INTERFACE]; + + switch (dfu->bState){ + case STATE_DFU_IDLE: + case STATE_DFU_DNLOAD_SYNC: + case STATE_DFU_DNLOAD_IDLE: + case STATE_DFU_MANIFEST_SYNC: + case STATE_DFU_UPLOAD_IDLE: + dfu->bStatus = STATUS_OK; + dfu->bState = STATE_DFU_IDLE; + dfu->iString = 0U; /* iString: index = 0 */ + + dfu->block_num = 0U; + dfu->data_len = 0U; + break; + + default: + break; + } +} + +/*! + \brief convert string value into unicode char + \param[in] str: pointer to plain string + \param[in] pbuf: buffer pointer to store unicode char + \param[out] none + \retval none +*/ +static void string_to_unicode (uint8_t *str, uint16_t *pbuf) +{ + uint8_t index = 0; + + if (str != NULL) { + pbuf[index++] = ((strlen((const char *)str) * 2U + 2U) & 0x00FFU) | ((USB_DESCTYPE_STR << 8U) & 0xFF00); + + while (*str != '\0') { + pbuf[index++] = *str++; + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_mem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_mem.c new file mode 100644 index 0000000..eb2be77 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/dfu/Source/dfu_mem.c @@ -0,0 +1,245 @@ +/*! + \file dfu_mem.c + \brief USB DFU device media access layer functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "dfu_mem.h" +#include "drv_usb_hw.h" +#include "usbd_transc.h" + +extern usb_core_driver usb_dfu_dev; + +extern struct +{ + uint8_t buf[TRANSFER_SIZE]; + uint16_t data_len; + uint16_t block_num; + uint32_t base_addr; +} prog; + +dfu_mem_prop* mem_tab[MAX_USED_MEMORY_MEDIA] = +{ + &dfu_inter_flash_cb, + &dfu_nor_flash_cb, + &dfu_nand_flash_cb, +}; + +/* The list of memory interface string descriptor pointers. This list + can be updated whenever a memory has to be added or removed */ +const uint8_t* USBD_DFU_StringDesc[MAX_USED_MEMORY_MEDIA] = +{ + (const uint8_t *)INTER_FLASH_IF_STR, + (const uint8_t *)NOR_FLASH_IF_STR, + (const uint8_t *)NAND_FLASH_IF_STR +}; + +static uint8_t dfu_mem_checkaddr (uint32_t addr); + +/*! + \brief initialize the memory media on the GD32 + \param[in] none + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_init (void) +{ + uint32_t mem_index = 0U; + + /* initialize all supported memory medias */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* check if the memory media exists */ + if (NULL != mem_tab[mem_index]->mem_init) { + mem_tab[mem_index]->mem_init(); + } + } + + return MEM_OK; +} + +/*! + \brief deinitialize the memory media on the GD32 + \param[in] none + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_deinit (void) +{ + uint32_t mem_index = 0U; + + /* deinitialize all supported memory medias */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* check if the memory media exists */ + if (NULL != mem_tab[mem_index]->mem_deinit) { + mem_tab[mem_index]->mem_deinit(); + } + } + + return MEM_OK; +} + +/*! + \brief erase a memory sector + \param[in] addr: memory sector address/code + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_erase (uint32_t addr) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return MEM_FAIL; + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_erase) { + return mem_tab[mem_index]->mem_erase(addr); + } else { + return MEM_FAIL; + } + } else { + return MEM_FAIL; + } +} + +/*! + \brief write data to sectors of memory + \param[in] buf: the data buffer to be write + \param[in] addr: memory sector address/code + \param[in] len: data length + \param[out] none + \retval MEM_OK +*/ +uint8_t dfu_mem_write (uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(addr)) { + return MEM_FAIL; + } + + if ((addr & MAL_MASK_OB) == OB_RDPT) { + option_byte_write(addr, buf); + NVIC_SystemReset(); + + return MEM_OK; + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_write) { + return mem_tab[mem_index]->mem_write(buf, addr, len); + } else { + return MEM_FAIL; + } + } else { + return MEM_FAIL; + } +} + +/*! + \brief read data from sectors of memory + \param[in] buf: the data buffer to be write + \param[in] addr: memory sector address/code + \param[in] len: data length + \param[out] none + \retval pointer to buffer +*/ +uint8_t* dfu_mem_read (uint8_t *buf, uint32_t addr, uint32_t len) +{ + uint32_t mem_index = 0U; + + if (OB_RDPT != addr) { + mem_index = dfu_mem_checkaddr(addr); + } + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + /* check if the operation is supported */ + if (NULL != mem_tab[mem_index]->mem_read) { + return mem_tab[mem_index]->mem_read(buf, addr, len); + } else { + return buf; + } + } else { + return buf; + } +} + +/*! + \brief get the status of a given memory and store in buffer + \param[in] addr: memory sector address/code + \param[in] cmd: 0 for erase and 1 for write + \param[in] buffer: pointer to the buffer where the status data will be stored + \param[out] none + \retval MEM_OK if all operations are OK, MEM_FAIL else +*/ +uint8_t dfu_mem_getstatus (uint32_t addr, uint8_t cmd, uint8_t *buffer) +{ + uint32_t mem_index = dfu_mem_checkaddr(addr); + + if (mem_index < MAX_USED_MEMORY_MEDIA) { + if (cmd & 0x01U) { + POLLING_TIMEOUT_SET(mem_tab[mem_index]->write_timeout); + } else { + POLLING_TIMEOUT_SET(mem_tab[mem_index]->erase_timeout); + } + + return MEM_OK; + } else { + return MEM_FAIL; + } +} + +/*! + \brief check the address is supported + \param[in] addr: memory sector address/code + \param[out] none + \retval index of the addressed memory +*/ +static uint8_t dfu_mem_checkaddr (uint32_t addr) +{ + uint8_t mem_index = 0U; + + /* check with all supported memories */ + for (mem_index = 0U; mem_index < MAX_USED_MEMORY_MEDIA; mem_index++) { + /* if the check address is supported, return the memory index */ + if (MEM_OK == mem_tab[mem_index]->mem_checkaddr(addr)) { + return mem_index; + } + } + + /* if there is no memory found, return MAX_USED_MEMORY_MEDIA */ + return (MAX_USED_MEMORY_MEDIA); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/custom_hid_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/custom_hid_core.h new file mode 100644 index 0000000..433ca9a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/custom_hid_core.h @@ -0,0 +1,70 @@ +/*! + \file custom_hid_core.h + \brief definitions for HID core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __CUSTOM_HID_CORE_H +#define __CUSTOM_HID_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define DESC_LEN_REPORT 96U +#define DESC_LEN_CONFIG 41U + +#define NO_CMD 0xFFU + +#define MAX_PERIPH_NUM 4U + +typedef struct +{ + uint8_t data[2]; + uint8_t reportID; + uint8_t idlestate; + uint8_t protocol; +} custom_hid_handler; + +typedef struct +{ + void (*periph_config[MAX_PERIPH_NUM])(void); +} hid_fop_handler; + +extern usb_desc custom_hid_desc; +extern usb_class_core usbd_custom_hid_cb; + +/* function declarations */ +/* register HID interface operation functions */ +uint8_t custom_hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop); +/* send custom HID report */ +uint8_t custom_hid_report_send (usb_dev *udev, uint8_t *report, uint32_t len); + +#endif /* __CUSTOM_HID_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/standard_hid_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/standard_hid_core.h new file mode 100644 index 0000000..6bf9883 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Include/standard_hid_core.h @@ -0,0 +1,69 @@ +/*! + \file standard_hid_core.h + \brief definitions for HID core + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __STANDARD_HID_CORE_H +#define __STANDARD_HID_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define USB_HID_CONFIG_DESC_LEN 0x22U +#define USB_HID_REPORT_DESC_LEN 0x2EU + +#define NO_CMD 0xFFU + +typedef struct +{ + uint32_t protocol; + uint32_t idle_state; + uint8_t data[HID_IN_PACKET]; + __IO uint8_t prev_transfer_complete; +} standard_hid_handler; + +typedef struct +{ + void (*hid_itf_config) (void); + void (*hid_itf_data_process) (usb_dev *udev); +} hid_fop_handler; + +extern usb_desc hid_desc; +extern usb_class_core usbd_hid_cb; + +/* function declarations */ +/* register HID interface operation functions */ +uint8_t hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop); +/* send keyboard report */ +uint8_t hid_report_send (usb_dev *udev, uint8_t *report, uint32_t len); + +#endif /* __STANDARD_HID_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/custom_hid_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/custom_hid_core.c new file mode 100644 index 0000000..ebb1dcf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/custom_hid_core.c @@ -0,0 +1,488 @@ +/*! + \file custom_hid_core.c + \brief custom HID class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "custom_hid_core.h" +#include "usbd_enum.h" + +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x028AU + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev custom_hid_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; + +/* USB device configuration descriptor */ +const usb_hid_desc_config_set custom_hid_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = DESC_LEN_CONFIG, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = 0x00U, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = DESC_LEN_REPORT, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = CUSTOMHID_IN_PACKET, + .bInterval = 0x20U + }, + + .hid_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = CUSTOMHID_OUT_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = CUSTOMHID_OUT_PACKET, + .bInterval = 0x20U + } +}; + +/* USB language ID descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(14U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'C', 'u', 's', 't', 'o', 'm', 'H', 'I', 'D'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor set */ +void *const usbd_hid_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc custom_hid_desc = { + .dev_desc = (uint8_t *)&custom_hid_dev_desc, + .config_desc = (uint8_t *)&custom_hid_config_desc, + .strings = usbd_hid_strings +}; + +const uint8_t customhid_report_descriptor[DESC_LEN_REPORT] = +{ + 0x06, 0x00, 0xFF, /* USAGE_PAGE (Vendor Defined: 0xFF00) */ + 0x09, 0x00, /* USAGE (Custom Device) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + /* led 1 */ + 0x85, 0x11, /* REPORT_ID (0x11) */ + 0x09, 0x01, /* USAGE (LED 1) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 2 */ + 0x85, 0x12, /* REPORT_ID (0x12) */ + 0x09, 0x02, /* USAGE (LED 2) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 3 */ + 0x85, 0x13, /* REPORT_ID (0x13) */ + 0x09, 0x03, /* USAGE (LED 3) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* led 4 */ + 0x85, 0x14, /* REPORT_ID (0x14) */ + 0x09, 0x04, /* USAGE (LED 4) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* wakeup key */ + 0x85, 0x15, /* REPORT_ID (0x15) */ + 0x09, 0x05, /* USAGE (Push Button) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs,Vol) */ + + 0x75, 0x07, /* REPORT_SIZE (7) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs,Vol) */ + + /* tamper key */ + 0x85, 0x16, /* REPORT_ID (0x16) */ + 0x09, 0x06, /* USAGE (Push Button) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs,Vol) */ + + 0x75, 0x07, /* REPORT_SIZE (7) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs,Vol) */ + + 0xc0 /* END_COLLECTION */ +}; + +/* local function prototypes ('static') */ +static uint8_t custom_hid_init (usb_dev *udev, uint8_t config_index); +static uint8_t custom_hid_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t custom_hid_req_handler (usb_dev *udev, usb_req *req); + +static uint8_t custom_hid_data_in (usb_dev *udev, uint8_t ep_num); +static uint8_t custom_hid_data_out (usb_dev *udev, uint8_t ep_num); + +usb_class_core usbd_custom_hid_cb = +{ + .command = NO_CMD, + .alter_set = 0U, + + .init = custom_hid_init, + .deinit = custom_hid_deinit, + + .req_proc = custom_hid_req_handler, + + .data_in = custom_hid_data_in, + .data_out = custom_hid_data_out +}; + +/*! + \brief register HID interface operation functions + \param[in] udev: pointer to USB device instance + \param[in] hid_fop: HID operation functions structure + \param[out] none + \retval USB device operation status +*/ +uint8_t custom_hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop) +{ + if (NULL != hid_fop) { + udev->dev.user_data = hid_fop; + + return USBD_OK; + } + + return USBD_FAIL; +} + +/*! + \brief send custom HID report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t custom_hid_report_send (usb_dev *udev, uint8_t *report, uint32_t len) +{ + usbd_ep_send (udev, CUSTOMHID_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_init (usb_dev *udev, uint8_t config_index) +{ + static custom_hid_handler hid_handler; + + memset((void *)&hid_handler, 0U, sizeof(custom_hid_handler)); + + /* initialize the data Tx endpoint */ + usbd_ep_setup (udev, &(custom_hid_config_desc.hid_epin)); + + /* Initialize the data Rx endpoint */ + usbd_ep_setup (udev, &(custom_hid_config_desc.hid_epout)); + + /* prepare receive data */ + usbd_ep_recev (udev, CUSTOMHID_OUT_EP, hid_handler.data, 2U); + + udev->dev.class_data[CUSTOM_HID_INTERFACE] = (void *)&hid_handler; + + if (NULL != udev->dev.user_data) { + for (uint8_t i = 0U; i < MAX_PERIPH_NUM; i++) { + if (NULL != ((hid_fop_handler *)udev->dev.user_data)->periph_config[i]) { + ((hid_fop_handler *)udev->dev.user_data)->periph_config[i](); + } + } + } + + return USBD_OK; +} + +/*! + \brief deinitialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize HID endpoints */ + usbd_ep_clear(udev, CUSTOMHID_IN_EP); + usbd_ep_clear(udev, CUSTOMHID_OUT_EP); + + return USBD_OK; +} + +/*! + \brief handle the HID class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_req_handler (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + custom_hid_handler *hid = (custom_hid_handler *)udev->dev.class_data[CUSTOM_HID_INTERFACE]; + + switch (req->bRequest) { + case GET_REPORT: + break; + + case GET_IDLE: + transc->xfer_buf = (uint8_t *)&hid->idlestate; + transc->remain_len = 1U; + break; + + case GET_PROTOCOL: + transc->xfer_buf = (uint8_t *)&hid->protocol; + transc->remain_len = 1U; + break; + + case SET_REPORT: + hid->reportID = (uint8_t)(req->wValue); + break; + + case SET_IDLE: + hid->idlestate = (uint8_t)(req->wValue >> 8U); + break; + + case SET_PROTOCOL: + hid->protocol = (uint8_t)(req->wValue); + break; + + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8U)) { + transc->remain_len = USB_MIN(DESC_LEN_REPORT, req->wLength); + transc->xfer_buf = (uint8_t *)customhid_report_descriptor; + } + break; + + default: + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle custom HID data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_data_in (usb_dev *udev, uint8_t ep_num) +{ + return USBD_OK; +} + +/*! + \brief handle custom HID data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static uint8_t custom_hid_data_out (usb_dev *udev, uint8_t ep_num) +{ + custom_hid_handler *hid = (custom_hid_handler *)udev->dev.class_data[CUSTOM_HID_INTERFACE]; + + switch (hid->data[0]){ + case 0x11U: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED5); + } else { + gd_eval_led_off(LED5); + } + break; + + case 0x12U: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED2); + } else { + gd_eval_led_off(LED2); + } + break; + + case 0x13U: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED3); + } else { + gd_eval_led_off(LED3); + } + break; + + case 0x14U: + if (RESET != hid->data[1]) { + gd_eval_led_on(LED4); + } else { + gd_eval_led_off(LED4); + } + break; + + default: + break; + } + + usbd_ep_recev (udev, CUSTOMHID_OUT_EP, hid->data, 2U); + + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/standard_hid_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/standard_hid_core.c new file mode 100644 index 0000000..e071e80 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/hid/Source/standard_hid_core.c @@ -0,0 +1,391 @@ +/*! + \file standard_hid_core.c + \brief HID class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "standard_hid_core.h" + +#include + +#define USBD_VID 0x28e9U +#define USBD_PID 0x0380U + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +const usb_desc_dev hid_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +const usb_hid_desc_config_set hid_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_HID_CONFIG_DESC_LEN, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xA0U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x01U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = USB_HID_SUBCLASS_BOOT_ITF, + .bInterfaceProtocol = USB_HID_PROTOCOL_KEYBOARD, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = USB_HID_REPORT_DESC_LEN, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = HID_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = HID_IN_PACKET, + .bInterval = 0x40U + } +}; + +/* USB language ID Descriptor */ +const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(17U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-','U', 'S', 'B', '_', 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +void *const usbd_hid_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc hid_desc = { + .dev_desc = (uint8_t *)&hid_dev_desc, + .config_desc = (uint8_t *)&hid_config_desc, + .strings = usbd_hid_strings +}; + +const uint8_t hid_report_desc[USB_HID_REPORT_DESC_LEN] = +{ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x06, /* USAGE (Keyboard) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + 0x05, 0x07, /* USAGE_PAGE (Keyboard/Keypad) */ + 0x19, 0xe0, /* USAGE_MINIMUM (Keyboard LeftControl) */ + 0x29, 0xe7, /* USAGE_MAXIMUM (Keyboard Right GUI) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */ + 0x95, 0x08, /* REPORT_COUNT (8) */ + 0x75, 0x01, /* REPORT_SIZE (1) */ + 0x81, 0x02, /* INPUT (Data,Var,Abs) */ + + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x81, 0x03, /* INPUT (Cnst,Var,Abs) */ + + 0x95, 0x06, /* REPORT_COUNT (6) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255) */ + 0x05, 0x07, /* USAGE_PAGE (Keyboard/Keypad) */ + 0x19, 0x00, /* USAGE_MINIMUM (Reserved (no event indicated)) */ + 0x29, 0x65, /* USAGE_MAXIMUM (Keyboard Application) */ + 0x81, 0x00, /* INPUT (Data,Ary,Abs) */ + + 0xc0 /* END_COLLECTION */ +}; + +/* local function prototypes ('static') */ +static uint8_t hid_init (usb_dev *udev, uint8_t config_index); +static uint8_t hid_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t hid_req (usb_dev *udev, usb_req *req); +static uint8_t hid_data_in (usb_dev *udev, uint8_t ep_num); + +usb_class_core usbd_hid_cb = +{ + .command = NO_CMD, + .alter_set = 0U, + + .init = hid_init, + .deinit = hid_deinit, + .req_proc = hid_req, + .data_in = hid_data_in +}; + +/*! + \brief register HID interface operation functions + \param[in] udev: pointer to USB device instance + \param[in] hid_fop: HID operation function structure + \param[out] none + \retval USB device operation status +*/ +uint8_t hid_itfop_register (usb_dev *udev, hid_fop_handler *hid_fop) +{ + if (NULL != hid_fop) { + udev->dev.user_data = (void *)hid_fop; + + return USBD_OK; + } + + return USBD_FAIL; +} + +/*! + \brief send keyboard report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t hid_report_send (usb_dev *udev, uint8_t *report, uint32_t len) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->dev.class_data[USBD_HID_INTERFACE]; + + hid->prev_transfer_complete = 0U; + + usbd_ep_send(udev, HID_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief initialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_init (usb_dev *udev, uint8_t config_index) +{ + static standard_hid_handler hid_handler; + + memset((void *)&hid_handler, 0U, sizeof(standard_hid_handler)); + + /* initialize the data Tx endpoint */ + usbd_ep_setup (udev, &(hid_config_desc.hid_epin)); + + hid_handler.prev_transfer_complete = 1U; + + udev->dev.class_data[USBD_HID_INTERFACE] = (void *)&hid_handler; + + if (NULL != udev->dev.user_data) { + ((hid_fop_handler *)udev->dev.user_data)->hid_itf_config(); + } + + return USBD_OK; +} + +/*! + \brief deinitialize the HID device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize HID endpoints */ + usbd_ep_clear(udev, HID_IN_EP); + + return USBD_OK; +} + +/*! + \brief handle the HID class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_req (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + standard_hid_handler *hid = (standard_hid_handler *)udev->dev.class_data[USBD_HID_INTERFACE]; + + switch (req->bRequest) { + case GET_REPORT: + /* no use for this driver */ + break; + + case GET_IDLE: + transc->xfer_buf = (uint8_t *)&hid->idle_state; + + transc->remain_len = 1U; + break; + + case GET_PROTOCOL: + transc->xfer_buf = (uint8_t *)&hid->protocol; + + transc->remain_len = 1U; + break; + + case SET_REPORT: + /* no use for this driver */ + break; + + case SET_IDLE: + hid->idle_state = (uint8_t)(req->wValue >> 8U); + break; + + case SET_PROTOCOL: + hid->protocol = (uint8_t)(req->wValue); + break; + + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8U)) { + transc->remain_len = USB_MIN(USB_HID_REPORT_DESC_LEN, req->wLength); + transc->xfer_buf = (uint8_t *)hid_report_desc; + + return REQ_SUPP; + } else if (USB_DESCTYPE_HID == (req->wValue >> 8U)) { + transc->remain_len = USB_MIN(9U, req->wLength); + transc->xfer_buf = (uint8_t *)(&(hid_config_desc.hid_vendor)); + } + break; + + default: + break; + } + + return USBD_OK; +} + +/*! + \brief handle data stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval USB device operation status +*/ +static uint8_t hid_data_in (usb_dev *udev, uint8_t ep_num) +{ + standard_hid_handler *hid = (standard_hid_handler *)udev->dev.class_data[USBD_HID_INTERFACE]; + + if (0U != hid->data[2]) { + hid->data[2] = 0x00U; + + usbd_ep_send(udev, HID_IN_EP, hid->data, HID_IN_PACKET); + } else { + hid->prev_transfer_complete = 1U; + } + + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Include/usb_iap_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Include/usb_iap_core.h new file mode 100644 index 0000000..d49ae10 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Include/usb_iap_core.h @@ -0,0 +1,83 @@ +/*! + \file usb_iap_core.h + \brief the header file of IAP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_IAP_CORE_H +#define __USB_IAP_CORE_H + +#include "usbd_enum.h" +#include "usb_hid.h" + +#define USB_SERIAL_STRING_SIZE 0x06U + +#ifdef USE_USB_FS + #define USB_DESC_LEN_IAP_REPORT 35U +#endif +#define USB_DESC_LEN_IAP_CONFIG_SET 41U + +/* special commands with download request */ +#define IAP_OPTION_BYTE1 0x01U +#define IAP_ERASE 0x02U +#define IAP_DNLOAD 0x03U +#define IAP_LEAVE 0x04U +#define IAP_GETBIN_ADDRESS 0x05U +#define IAP_OPTION_BYTE2 0x06U + +typedef struct +{ + uint8_t report_buf[IAP_OUT_PACKET + 1U]; + uint8_t option_byte[IAP_IN_PACKET]; + /* state machine variables */ + uint8_t dev_status[IAP_IN_PACKET]; + uint8_t bin_addr[IAP_IN_PACKET]; + uint8_t reportID; + uint8_t flag; + uint32_t protocol; + uint32_t idlestate; + uint16_t transfer_times; + uint16_t page_count; + uint16_t lps; /* last packet size */ + uint32_t file_length; + uint32_t base_address; +} usbd_iap_handler; + +typedef void (*app_func) (void); + +extern usb_desc iap_desc; +extern usb_class_core iap_class; + +/* function declarations */ +/* send IAP report */ +uint8_t iap_report_send (usb_dev *udev, uint8_t *report, uint32_t len); + +#endif /* __USB_IAP_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Source/usb_iap_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Source/usb_iap_core.c new file mode 100644 index 0000000..af7b3b9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/iap/Source/usb_iap_core.c @@ -0,0 +1,563 @@ +/*! + \file usb_iap_core.c + \brief IAP driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usb_iap_core.h" +#include "flash_operation.h" + +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x0228U + +/* Note:it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +__ALIGN_BEGIN const usb_desc_dev iap_dev_desc __ALIGN_END = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +__ALIGN_BEGIN const usb_hid_desc_config_set iap_config_desc __ALIGN_END = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_DESC_LEN_IAP_CONFIG_SET, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0x80U, + .bMaxPower = 0x32U + }, + + .hid_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_HID_CLASS, + .bInterfaceSubClass = 0x00U, + .bInterfaceProtocol = 0x00U, + .iInterface = 0x00U + }, + + .hid_vendor = + { + .header = + { + .bLength = sizeof(usb_desc_hid), + .bDescriptorType = USB_DESCTYPE_HID + }, + .bcdHID = 0x0111U, + .bCountryCode = 0x00U, + .bNumDescriptors = 0x01U, + .bDescriptorType = USB_DESCTYPE_REPORT, + .wDescriptorLength = USB_DESC_LEN_IAP_REPORT, + }, + + .hid_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = IAP_IN_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = IAP_IN_PACKET, + .bInterval = 0x01U + }, + + .hid_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = IAP_OUT_EP, + .bmAttributes = USB_EP_ATTR_INT, + .wMaxPacketSize = IAP_OUT_PACKET, + .bInterval = 0x01U + } +}; + +/* USB language ID Descriptor */ +static __ALIGN_BEGIN const usb_desc_LANGID usbd_language_id_desc __ALIGN_END = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static __ALIGN_BEGIN const usb_desc_str manufacturer_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static __ALIGN_BEGIN const usb_desc_str product_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'I', 'A', 'P'} +}; + +/* USBD serial string */ +static __ALIGN_BEGIN usb_desc_str serial_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(2U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +void *const usbd_iap_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc iap_desc = { + .dev_desc = (uint8_t *)&iap_dev_desc, + .config_desc = (uint8_t *)&iap_config_desc, + .strings = usbd_iap_strings +}; + +/* local function prototypes ('static') */ +static uint8_t iap_init (usb_dev *udev, uint8_t config_index); +static uint8_t iap_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t iap_req_handler (usb_dev *udev, usb_req *req); +static uint8_t iap_data_out (usb_dev *udev, uint8_t ep_num); + +/* IAP requests management functions */ +static void iap_req_erase (usb_dev *udev); +static void iap_req_dnload (usb_dev *udev); +static void iap_req_optionbyte(usb_dev *udev, uint8_t option_num); +static void iap_req_leave (usb_dev *udev); +static void iap_address_send (usb_dev *udev); + +usb_class_core iap_class = +{ + .init = iap_init, + .deinit = iap_deinit, + .req_proc = iap_req_handler, + .data_out = iap_data_out +}; + +/* USB custom HID device report descriptor */ +__ALIGN_BEGIN const uint8_t iap_report_desc[USB_DESC_LEN_IAP_REPORT] __ALIGN_END = +{ + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x00, /* USAGE (Custom Device) */ + 0xa1, 0x01, /* COLLECTION (Application) */ + + /* IAP command and data */ + 0x85, 0x01, /* REPORT_ID (0x01) */ + 0x09, 0x01, /* USAGE (IAP command) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0xff, /* LOGICAL_MAXIMUM (255) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, REPORT_OUT_COUNT, + 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */ + + /* device status and option byte */ + 0x85, 0x02, /* REPORT_ID (0x02) */ + 0x09, 0x02, /* USAGE (Status and option byte) */ + 0x15, 0x00, /* LOGICAL_MINIMUM (0) */ + 0x25, 0xff, /* LOGICAL_MAXIMUM (255) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, REPORT_IN_COUNT, /* REPORT_COUNT (23) */ + 0x81, 0x82, /* INPUT (Data,Var,Abs,Vol) */ + + 0xc0 /* END_COLLECTION */ +}; + +/*! + \brief send IAP report + \param[in] udev: pointer to USB device instance + \param[in] report: pointer to HID report + \param[in] len: data length + \param[out] none + \retval USB device operation status +*/ +uint8_t iap_report_send (usb_dev *udev, uint8_t *report, uint32_t len) +{ + usbd_ep_send (udev, IAP_IN_EP, report, len); + + return USBD_OK; +} + +/*! + \brief initialize the IAP device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_init (usb_dev *udev, uint8_t config_index) +{ + static __ALIGN_BEGIN usbd_iap_handler iap_handler __ALIGN_END; + + /* initialize Tx endpoint */ + usbd_ep_setup(udev, &(iap_config_desc.hid_epin)); + + /* initialize Rx endpoint */ + usbd_ep_setup(udev, &(iap_config_desc.hid_epout)); + + /* unlock the internal flash */ + fmc_unlock(); + + memset((void *)&iap_handler, 0U, sizeof(usbd_iap_handler)); + + /* prepare receive data */ + usbd_ep_recev(udev, IAP_OUT_EP, iap_handler.report_buf, IAP_OUT_PACKET); + + iap_handler.base_address = APP_LOADED_ADDR; + + udev->dev.class_data[USBD_IAP_INTERFACE] = (void *)&iap_handler; + + return USBD_OK; +} + +/*! + \brief deinitialize the IAP device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize IAP endpoints */ + usbd_ep_clear (udev, IAP_IN_EP); + usbd_ep_clear (udev, IAP_OUT_EP); + + /* lock the internal flash */ + fmc_lock(); + + return USBD_OK; +} + +/*! + \brief handle the IAP class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t iap_req_handler (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + switch (req->bRequest) { + case GET_REPORT: + /* no use for this driver */ + break; + + case GET_IDLE: + transc->xfer_buf = (uint8_t *)&iap->idlestate; + transc->remain_len = 1U; + break; + + case GET_PROTOCOL: + transc->xfer_buf = (uint8_t *)&iap->protocol; + transc->remain_len = 1U; + break; + + case SET_REPORT: + iap->reportID = (uint8_t)(req->wValue); + break; + + case SET_IDLE: + iap->idlestate = (uint8_t)(req->wValue >> 8U); + break; + + case SET_PROTOCOL: + iap->protocol = (uint8_t)(req->wValue); + break; + + case USB_GET_DESCRIPTOR: + if (USB_DESCTYPE_REPORT == (req->wValue >> 8U)) { + transc->remain_len = USB_MIN(USB_DESC_LEN_IAP_REPORT, req->wLength); + transc->xfer_buf = (uint8_t *)iap_report_desc; + } + break; + + default: + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle data out stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier + \param[out] none + \retval none +*/ +static uint8_t iap_data_out (usb_dev *udev ,uint8_t ep_num) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + if (0x01U == iap->report_buf[0]) { + switch (iap->report_buf[1]) { + case IAP_DNLOAD: + iap_req_dnload(udev); + break; + + case IAP_ERASE: + iap_req_erase(udev); + break; + + case IAP_OPTION_BYTE1: + iap_req_optionbyte(udev, 0x01U); + break; + + case IAP_LEAVE: + iap_req_leave(udev); + break; + + case IAP_GETBIN_ADDRESS: + iap_address_send(udev); + break; + + case IAP_OPTION_BYTE2: + iap_req_optionbyte(udev, 0x02U); + break; + + default: + break; + } + } + + usbd_ep_recev(udev, IAP_OUT_EP, iap->report_buf, IAP_OUT_PACKET); + + return USBD_OK; +} + +/*! + \brief handle the IAP_DNLOAD request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_dnload(usb_dev *udev) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + if (0U != iap->transfer_times) { + if (1U == iap->transfer_times) { + if (0U == iap->lps) { + iap_data_write(&iap->report_buf[2], iap->base_address, TRANSFER_SIZE); + } else { + iap_data_write(&iap->report_buf[2], iap->base_address, iap->file_length % TRANSFER_SIZE); + iap->lps = 0U; + } + + iap->dev_status[0] = 0x02U; + iap->dev_status[1] = 0x02U; + iap_report_send (udev, iap->dev_status, IAP_IN_PACKET); + } else { + iap_data_write(&iap->report_buf[2], iap->base_address, TRANSFER_SIZE); + + iap->base_address += TRANSFER_SIZE; + } + + iap->transfer_times--; + } +} + +/*! + \brief handle the IAP_ERASE request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_erase(usb_dev *udev) +{ + uint32_t addr = 0U; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + /* get base address to erase */ + iap->base_address = iap->report_buf[2]; + iap->base_address |= iap->report_buf[3] << 8U; + iap->base_address |= iap->report_buf[4] << 16U; + iap->base_address |= iap->report_buf[5] << 24U; + + /* get file length */ + iap->file_length = iap->report_buf[7]; + iap->file_length |= iap->report_buf[8] << 8U; + iap->file_length |= iap->report_buf[9] << 16U; + iap->file_length |= iap->report_buf[10] << 24U; + + iap->lps = iap->file_length % TRANSFER_SIZE; + if (0U == iap->lps) { + iap->transfer_times = iap->file_length / TRANSFER_SIZE; + } else { + iap->transfer_times = iap->file_length / TRANSFER_SIZE + 1U; + } + + /* check if the address is in protected area */ + if (IS_PROTECTED_AREA(iap->base_address)) { + return; + } + + addr = iap->base_address; + + /* unlock the flash program erase controller */ + fmc_unlock(); + + flash_erase(addr, iap->file_length, iap->report_buf); + + fmc_lock(); + + iap->dev_status[0] = 0x02U; + iap->dev_status[1] = 0x01U; + + usbd_ep_send(udev, IAP_IN_EP, iap->dev_status, IAP_IN_PACKET); +} + +/*! + \brief handle the IAP_OPTION_BYTE request + \param[in] udev: pointer to USB device instance + \param[in] option_num: number of option byte + \param[out] none + \retval none +*/ +static void iap_req_optionbyte(usb_dev *udev, uint8_t option_num) +{ + uint8_t i = 0U; + uint32_t address = 0U; + + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + iap->option_byte[0]= 0x02U; + + if (0x01U == option_num) { + address = OPT_BYTE_ADDR1; +#ifdef OPT_BYTE_ADDR2 + } else if (0x02U == option_num) { + address = OPT_BYTE_ADDR2; +#endif + } else { + return; + } + + for (i = 1U; i < 17U; i++) { + iap->option_byte[i] = *(uint8_t *)address; + address++; + } + + iap_report_send (udev, iap->option_byte, IAP_IN_PACKET); +} + +/*! + \brief handle the IAP_LEAVE request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_req_leave(usb_dev *udev) +{ + /* lock the internal flash */ + fmc_lock(); + + /* generate system reset to allow jumping to the user code */ + NVIC_SystemReset(); +} + +/*! + \brief handle the IAP_ADDRESS_SEND request + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void iap_address_send(usb_dev *udev) +{ + usbd_iap_handler *iap = (usbd_iap_handler *)udev->dev.class_data[USBD_IAP_INTERFACE]; + + iap->bin_addr[0] = 0x02U; + + iap->bin_addr[1] = (uint8_t)(APP_LOADED_ADDR); + iap->bin_addr[2] = (uint8_t)(APP_LOADED_ADDR >> 8U); + iap->bin_addr[3] = (uint8_t)(APP_LOADED_ADDR >> 16U); + iap->bin_addr[4] = (uint8_t)(APP_LOADED_ADDR >> 24U); + + iap_report_send (udev, iap->bin_addr, IAP_IN_PACKET); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_bbb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_bbb.h new file mode 100644 index 0000000..e0aac38 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_bbb.h @@ -0,0 +1,103 @@ +/*! + \file usbd_msc_bbb.h + \brief the header file of the usbd_msc_bbb.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_BBB_H +#define __USBD_MSC_BBB_H + +#include "usbd_core.h" +#include "msc_bbb.h" +#include "usbd_msc_mem.h" +#include "usbd_msc_scsi.h" + +/* MSC BBB state */ +enum msc_bbb_state +{ + BBB_IDLE = 0U, /*!< idle state */ + BBB_DATA_OUT, /*!< data OUT state */ + BBB_DATA_IN, /*!< data IN state */ + BBB_LAST_DATA_IN, /*!< last data IN state */ + BBB_SEND_DATA /*!< send immediate data state */ +}; + +/* MSC BBB status */ +enum msc_bbb_status +{ + BBB_STATUS_NORMAL = 0U, /*!< normal status */ + BBB_STATUS_RECOVERY, /*!< recovery status*/ + BBB_STATUS_ERROR /*!< error status */ +}; + +typedef struct +{ + uint8_t bbb_data[MSC_MEDIA_PACKET_SIZE]; + + uint8_t max_lun; + uint8_t bbb_state; + uint8_t bbb_status; + + uint32_t bbb_datalen; + + msc_bbb_cbw bbb_cbw; + msc_bbb_csw bbb_csw; + + uint8_t scsi_sense_head; + uint8_t scsi_sense_tail; + + uint32_t scsi_blk_size[MEM_LUN_NUM]; + uint32_t scsi_blk_nbr[MEM_LUN_NUM]; + + uint32_t scsi_blk_addr; + uint32_t scsi_blk_len; + uint32_t scsi_disk_pop; + + msc_scsi_sense scsi_sense[SENSE_LIST_DEEPTH]; +} usbd_msc_handler; + +/* function declarations */ +/* initialize the bbb process */ +void msc_bbb_init (usb_core_driver *udev); +/* reset the BBB machine */ +void msc_bbb_reset (usb_core_driver *udev); +/* deinitialize the BBB machine */ +void msc_bbb_deinit (usb_core_driver *udev); +/* handle BBB data IN stage */ +void msc_bbb_data_in (usb_core_driver *udev, uint8_t ep_num); +/* handle BBB data OUT stage */ +void msc_bbb_data_out (usb_core_driver *udev, uint8_t ep_num); +/* send the CSW(command status wrapper) */ +void msc_bbb_csw_send (usb_core_driver *udev, uint8_t csw_status); +/* complete the clear feature request */ +void msc_bbb_clrfeature (usb_core_driver *udev, uint8_t ep_num); + +#endif /* __USBD_MSC_BBB_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_core.h new file mode 100644 index 0000000..1b16a73 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_core.h @@ -0,0 +1,58 @@ +/*! + \file usbd_msc_core.h + \brief the header file of USB MSC device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_CORE_H +#define __USBD_MSC_CORE_H + +#include "usbd_core.h" +#include "usb_msc.h" + +#define USB_MSC_CONFIG_DESC_SIZE 32U + +#define MSC_EPIN_SIZE MSC_DATA_PACKET_SIZE +#define MSC_EPOUT_SIZE MSC_DATA_PACKET_SIZE + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf msc_itf; + usb_desc_ep msc_epin; + usb_desc_ep msc_epout; +} usb_desc_config_set; + +extern usb_desc msc_desc; +extern usb_class_core msc_class; + +#endif /* __USBD_MSC_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_mem.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_mem.h new file mode 100644 index 0000000..80ba594 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_mem.h @@ -0,0 +1,59 @@ +/*! + \file usbd_msc_mem.h + \brief header file for storage memory + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_MEM_H +#define __USBD_MSC_MEM_H + +#include "usbd_conf.h" + +#define USBD_STD_INQUIRY_LENGTH 36U + +typedef struct +{ + int8_t (*mem_init) (uint8_t lun); + int8_t (*mem_ready) (uint8_t lun); + int8_t (*mem_protected) (uint8_t lun); + int8_t (*mem_read) (uint8_t lun, uint8_t *buf, uint32_t block_addr, uint16_t block_len); + int8_t (*mem_write) (uint8_t lun, uint8_t *buf, uint32_t block_addr, uint16_t block_len); + int8_t (*mem_maxlun) (void); + + uint8_t *mem_toc_data; + uint8_t *mem_inquiry_data[MEM_LUN_NUM]; + uint32_t mem_block_size[MEM_LUN_NUM]; + uint32_t mem_block_len[MEM_LUN_NUM]; +}usbd_mem_cb; + +extern usbd_mem_cb *usbd_mem_fops; + +#endif /* __USBD_MSC_MEM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_scsi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_scsi.h new file mode 100644 index 0000000..184e15f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Include/usbd_msc_scsi.h @@ -0,0 +1,58 @@ +/*! + \file usbd_msc_scsi.h + \brief the header file of the usbd_msc_scsi.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_MSC_SCSI_H +#define __USBD_MSC_SCSI_H + +#include "usbd_msc_bbb.h" +#include "msc_scsi.h" + +#define SENSE_LIST_DEEPTH 4U + +#define MODE_SENSE6_LENGTH 8U +#define MODE_SENSE10_LENGTH 8U +#define INQUIRY_PAGE00_LENGTH 96U +#define FORMAT_CAPACITIES_LENGTH 20U + +extern const uint8_t msc_page00_inquiry_data[]; +extern const uint8_t msc_mode_sense6_data[]; +extern const uint8_t msc_mode_sense10_data[]; + +/* function declarations */ +/* process SCSI commands */ +int8_t scsi_process_cmd (usb_core_driver *udev, uint8_t lun, uint8_t *cmd); +/* load the last error code in the error list */ +void scsi_sense_code (usb_core_driver *udev, uint8_t lun, uint8_t skey, uint8_t asc); + +#endif /* __USBD_MSC_SCSI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_bbb.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_bbb.c new file mode 100644 index 0000000..82c1871 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_bbb.c @@ -0,0 +1,287 @@ +/*! + \file usbd_msc_bbb.c + \brief USB BBB(Bulk/Bulk/Bulk) protocol core functions + \note BBB means Bulk-only transport protocol for USB MSC + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" + +/* local function prototypes ('static') */ +static void msc_bbb_cbw_decode (usb_core_driver *udev); +static void msc_bbb_data_send (usb_core_driver *udev, uint8_t *pbuf, uint32_t Len); +static void msc_bbb_abort (usb_core_driver *udev); + +/*! + \brief initialize the bbb process + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_init (usb_core_driver *udev) +{ + uint8_t lun_num; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; + msc->bbb_status = BBB_STATUS_NORMAL; + + /* initializes the storage logic unit */ + for(lun_num = 0U; lun_num < MEM_LUN_NUM; lun_num++) { + usbd_mem_fops->mem_init(lun_num); + } + + /* flush the Rx FIFO */ + usbd_fifo_flush (udev, MSC_OUT_EP); + + /* flush the Tx FIFO */ + usbd_fifo_flush (udev, MSC_IN_EP); + + /* prepare endpoint to receive the first BBB CBW */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief reset the BBB machine + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_reset (usb_core_driver *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; + msc->bbb_status = BBB_STATUS_RECOVERY; + + /* prepare endpoint to receive the first BBB command */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief deinitialize the BBB machine + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void msc_bbb_deinit (usb_core_driver *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_state = BBB_IDLE; +} + +/*! + \brief handle BBB data IN stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_data_in (usb_core_driver *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + switch (msc->bbb_state) { + case BBB_DATA_IN: + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } + break; + + case BBB_SEND_DATA: + case BBB_LAST_DATA_IN: + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + break; + + default: + break; + } +} + +/*! + \brief handle BBB data OUT stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_data_out (usb_core_driver *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + switch (msc->bbb_state) { + case BBB_IDLE: + msc_bbb_cbw_decode (udev); + break; + + case BBB_DATA_OUT: + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } + break; + + default: + break; + } +} + +/*! + \brief send the CSW(command status wrapper) + \param[in] udev: pointer to USB device instance + \param[in] csw_status: CSW status + \param[out] none + \retval none +*/ +void msc_bbb_csw_send (usb_core_driver *udev, uint8_t csw_status) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_csw.dCSWSignature = BBB_CSW_SIGNATURE; + msc->bbb_csw.bCSWStatus = csw_status; + msc->bbb_state = BBB_IDLE; + + usbd_ep_send (udev, MSC_IN_EP, (uint8_t *)&msc->bbb_csw, BBB_CSW_LENGTH); + + /* prepare endpoint to receive next command */ + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); +} + +/*! + \brief complete the clear feature request + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval none +*/ +void msc_bbb_clrfeature (usb_core_driver *udev, uint8_t ep_num) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if (BBB_STATUS_ERROR == msc->bbb_status)/* bad CBW signature */ { + usbd_ep_stall(udev, MSC_IN_EP); + + msc->bbb_status = BBB_STATUS_NORMAL; + } else if((0x80U == (ep_num & 0x80U)) && (BBB_STATUS_RECOVERY != msc->bbb_status)) { + msc_bbb_csw_send (udev, CSW_CMD_FAILED); + } else { + + } +} + +/*! + \brief decode the CBW command and set the BBB state machine accordingly + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void msc_bbb_cbw_decode (usb_core_driver *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_csw.dCSWTag = msc->bbb_cbw.dCBWTag; + msc->bbb_csw.dCSWDataResidue = msc->bbb_cbw.dCBWDataTransferLength; + + if ((BBB_CBW_LENGTH != usbd_rxcount_get (udev, MSC_OUT_EP)) || + (BBB_CBW_SIGNATURE != msc->bbb_cbw.dCBWSignature)|| + (msc->bbb_cbw.bCBWLUN > 1U) || + (msc->bbb_cbw.bCBWCBLength < 1U) || + (msc->bbb_cbw.bCBWCBLength > 16U)) { + /* illegal command handler */ + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + msc->bbb_status = BBB_STATUS_ERROR; + + msc_bbb_abort (udev); + } else { + if (scsi_process_cmd (udev, msc->bbb_cbw.bCBWLUN, &msc->bbb_cbw.CBWCB[0]) < 0) { + msc_bbb_abort (udev); + } else if ((BBB_DATA_IN != msc->bbb_state) && + (BBB_DATA_OUT != msc->bbb_state) && + (BBB_LAST_DATA_IN != msc->bbb_state)) { /* burst xfer handled internally */ + if (msc->bbb_datalen > 0U) { + msc_bbb_data_send (udev, msc->bbb_data, msc->bbb_datalen); + } else if (0U == msc->bbb_datalen) { + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + } else { + + } + } else { + + } + } +} + +/*! + \brief send the requested data + \param[in] udev: pointer to USB device instance + \param[in] buf: pointer to data buffer + \param[in] len: data length + \param[out] none + \retval none +*/ +static void msc_bbb_data_send (usb_core_driver *udev, uint8_t *buf, uint32_t len) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + len = USB_MIN (msc->bbb_cbw.dCBWDataTransferLength, len); + + msc->bbb_csw.dCSWDataResidue -= len; + msc->bbb_csw.bCSWStatus = CSW_CMD_PASSED; + msc->bbb_state = BBB_SEND_DATA; + + usbd_ep_send (udev, MSC_IN_EP, buf, len); +} + +/*! + \brief abort the current transfer + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +static void msc_bbb_abort (usb_core_driver *udev) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if ((0U == msc->bbb_cbw.bmCBWFlags) && + (0U != msc->bbb_cbw.dCBWDataTransferLength) && + (BBB_STATUS_NORMAL == msc->bbb_status)) { + usbd_ep_stall(udev, MSC_OUT_EP); + } + + usbd_ep_stall(udev, MSC_IN_EP); + + if (msc->bbb_status == BBB_STATUS_ERROR) { + usbd_ep_recev (udev, MSC_OUT_EP, (uint8_t *)&msc->bbb_cbw, BBB_CBW_LENGTH); + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_core.c new file mode 100644 index 0000000..b3843cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_core.c @@ -0,0 +1,318 @@ +/*! + \file usbd_msc_core.c + \brief USB MSC device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" +#include "usbd_msc_core.h" +#include + +#define USBD_VID 0x28E9U +#define USBD_PID 0x026FU + +/* local function prototypes ('static') */ +static uint8_t msc_core_init (usb_dev *udev, uint8_t config_index); +static uint8_t msc_core_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t msc_core_req (usb_dev *udev, usb_req *req); +static uint8_t msc_core_in (usb_dev *udev, uint8_t ep_num); +static uint8_t msc_core_out (usb_dev *udev, uint8_t ep_num); + +usb_class_core msc_class = +{ + .init = msc_core_init, + .deinit = msc_core_deinit, + + .req_proc = msc_core_req, + + .data_in = msc_core_in, + .data_out = msc_core_out +}; + +/* note: it should use the C99 standard when compiling the below codes */ +/* USB standard device descriptor */ +__ALIGN_BEGIN const usb_desc_dev msc_dev_desc __ALIGN_END = +{ + .header = { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM +}; + +/* USB device configuration descriptor */ +__ALIGN_BEGIN const usb_desc_config_set msc_config_desc __ALIGN_END = +{ + .config = + { + .header = { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_MSC_CONFIG_DESC_SIZE, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xC0U, + .bMaxPower = 0x32U + }, + + .msc_itf = + { + .header = { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_MSC, + .bInterfaceSubClass = USB_MSC_SUBCLASS_SCSI, + .bInterfaceProtocol = USB_MSC_PROTOCOL_BBB, + .iInterface = 0x00U + }, + + .msc_epin = + { + .header = { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = MSC_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = MSC_EPIN_SIZE, + .bInterval = 0x00U + }, + + .msc_epout = + { + .header = { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = MSC_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = MSC_EPOUT_SIZE, + .bInterval = 0x00U + } +}; + +/* USB language ID descriptor */ +__ALIGN_BEGIN const usb_desc_LANGID usbd_language_id_desc __ALIGN_END = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static __ALIGN_BEGIN const usb_desc_str manufacturer_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static __ALIGN_BEGIN const usb_desc_str product_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'M', 'S', 'C'} +}; + +/* USBD serial string */ +static __ALIGN_BEGIN usb_desc_str serial_string __ALIGN_END = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor */ +void *const usbd_msc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc msc_desc = { + .dev_desc = (uint8_t *)&msc_dev_desc, + .config_desc = (uint8_t *)&msc_config_desc, + .strings = usbd_msc_strings +}; + +static __ALIGN_BEGIN uint8_t usbd_msc_maxlun = 0U __ALIGN_END; + +/*! + \brief initialize the MSC device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_init (usb_dev *udev, uint8_t config_index) +{ + static __ALIGN_BEGIN usbd_msc_handler msc_handler __ALIGN_END; + + memset((void *)&msc_handler, 0U, sizeof(usbd_msc_handler)); + + udev->dev.class_data[USBD_MSC_INTERFACE] = (void *)&msc_handler; + + /* configure MSC Tx endpoint */ + usbd_ep_setup (udev, &(msc_config_desc.msc_epin)); + + /* configure MSC Rx endpoint */ + usbd_ep_setup (udev, &(msc_config_desc.msc_epout)); + + /* initialize the BBB layer */ + msc_bbb_init(udev); + + return USBD_OK; +} + +/*! + \brief deinitialize the MSC device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_deinit (usb_dev *udev, uint8_t config_index) +{ + /* clear MSC endpoints */ + usbd_ep_clear (udev, MSC_IN_EP); + usbd_ep_clear (udev, MSC_OUT_EP); + + /* deinitialize the BBB layer */ + msc_bbb_deinit(udev); + + return USBD_OK; +} + +/*! + \brief handle the MSC class-specific and standard requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t msc_core_req (usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + switch (req->bRequest) { + case BBB_GET_MAX_LUN : + if((0U == req->wValue) && + (1U == req->wLength) && + (0x80U == (req->bmRequestType & 0x80U))) { + usbd_msc_maxlun = (uint8_t)usbd_mem_fops->mem_maxlun(); + + transc->xfer_buf = &usbd_msc_maxlun; + transc->remain_len = 1U; + } else { + return USBD_FAIL; + } + break; + + case BBB_RESET : + if((0U == req->wValue) && + (0U == req->wLength) && + (0x80U != (req->bmRequestType & 0x80U))) { + msc_bbb_reset(udev); + } else { + return USBD_FAIL; + } + break; + + case USB_CLEAR_FEATURE: + msc_bbb_clrfeature (udev, (uint8_t)req->wIndex); + break; + + default: + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle data in stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: the endpoint number + \param[out] none + \retval none +*/ +static uint8_t msc_core_in (usb_dev *udev, uint8_t ep_num) +{ + msc_bbb_data_in(udev, ep_num); + + return USBD_OK; +} + +/*! + \brief handle data out stage + \param[in] udev: pointer to USB device instance + \param[in] ep_num: the endpoint number + \param[out] none + \retval none +*/ +static uint8_t msc_core_out (usb_dev *udev, uint8_t ep_num) +{ + msc_bbb_data_out (udev, ep_num); + + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_scsi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_scsi.c new file mode 100644 index 0000000..9eabcb0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/msc/Source/usbd_msc_scsi.c @@ -0,0 +1,761 @@ +/*! + \file usbd_msc_scsi.c + \brief USB SCSI layer functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_msc_bbb.h" +#include "usbd_msc_scsi.h" + +/* USB mass storage page 0 inquiry data */ +const uint8_t msc_page00_inquiry_data[] = +{ + 0x00U, + 0x00U, + 0x00U, + 0x00U, + (INQUIRY_PAGE00_LENGTH - 4U), + 0x80U, + 0x83U, +}; + +/* USB mass storage sense 6 data */ +const uint8_t msc_mode_sense6_data[] = +{ + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U +}; + +/* USB mass storage sense 10 data */ +const uint8_t msc_mode_sense10_data[] = +{ + 0x00U, + 0x06U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U, + 0x00U +}; + +/* local function prototypes ('static') */ +static int8_t scsi_test_unit_ready (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_select6 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_select10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_inquiry (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read_format_capacity (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read_capacity10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_request_sense (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_sense6 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_toc_cmd_read (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_mode_sense10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_write10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_read10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static int8_t scsi_verify10 (usb_core_driver *udev, uint8_t lun, uint8_t *params); + +static int8_t scsi_process_read (usb_core_driver *udev, uint8_t lun); +static int8_t scsi_process_write (usb_core_driver *udev, uint8_t lun); + +static inline int8_t scsi_check_address_range (usb_core_driver *udev, uint8_t lun, uint32_t blk_offset, uint16_t blk_nbr); +static inline int8_t scsi_format_cmd (usb_core_driver *udev, uint8_t lun); +static inline int8_t scsi_start_stop_unit (usb_core_driver *udev, uint8_t lun, uint8_t *params); +static inline int8_t scsi_allow_medium_removal (usb_core_driver *udev, uint8_t lun, uint8_t *params); + +/*! + \brief process SCSI commands + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +int8_t scsi_process_cmd(usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + switch (params[0]) { + case SCSI_TEST_UNIT_READY: + return scsi_test_unit_ready (udev, lun, params); + + case SCSI_REQUEST_SENSE: + return scsi_request_sense (udev, lun, params); + + case SCSI_INQUIRY: + return scsi_inquiry (udev, lun, params); + + case SCSI_START_STOP_UNIT: + return scsi_start_stop_unit (udev, lun, params); + + case SCSI_ALLOW_MEDIUM_REMOVAL: + return scsi_allow_medium_removal (udev, lun, params); + + case SCSI_MODE_SENSE6: + return scsi_mode_sense6 (udev, lun, params); + + case SCSI_MODE_SENSE10: + return scsi_mode_sense10 (udev, lun, params); + + case SCSI_READ_FORMAT_CAPACITIES: + return scsi_read_format_capacity (udev, lun, params); + + case SCSI_READ_CAPACITY10: + return scsi_read_capacity10 (udev, lun, params); + + case SCSI_READ10: + return scsi_read10 (udev, lun, params); + + case SCSI_WRITE10: + return scsi_write10 (udev, lun, params); + + case SCSI_VERIFY10: + return scsi_verify10 (udev, lun, params); + + case SCSI_FORMAT_UNIT: + return scsi_format_cmd (udev, lun); + + case SCSI_READ_TOC_DATA: + return scsi_toc_cmd_read (udev, lun, params); + + case SCSI_MODE_SELECT6: + return scsi_mode_select6 (udev, lun, params); + + case SCSI_MODE_SELECT10: + return scsi_mode_select10 (udev, lun, params); + + default: + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, INVALID_CDB); + return -1; + } +} + +/*! + \brief load the last error code in the error list + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] skey: sense key + \param[in] asc: additional sense key + \param[out] none + \retval none +*/ +void scsi_sense_code (usb_core_driver *udev, uint8_t lun, uint8_t skey, uint8_t asc) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->scsi_sense[msc->scsi_sense_tail].SenseKey = skey; + msc->scsi_sense[msc->scsi_sense_tail].ASC = asc << 8U; + msc->scsi_sense_tail++; + + if (SENSE_LIST_DEEPTH == msc->scsi_sense_tail) { + msc->scsi_sense_tail = 0U; + } +} + +/*! + \brief process SCSI test unit ready command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_test_unit_ready (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + /* case 9 : Hi > D0 */ + if (0U != msc->bbb_cbw.dCBWDataTransferLength) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code(udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process mode select 6 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_select6 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process mode select 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_select10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process inquiry command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_inquiry (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint8_t *page = NULL; + uint16_t len = 0U; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if (params[1] & 0x01U) { + page = (uint8_t *)msc_page00_inquiry_data; + + len = INQUIRY_PAGE00_LENGTH; + } else { + page = (uint8_t *)usbd_mem_fops->mem_inquiry_data[lun]; + + len = (uint16_t)(page[4] + 5U); + + if (params[4] <= len) { + len = params[4]; + } + } + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = page[len]; + } + + return 0; +} + +/*! + \brief process read capacity 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read_capacity10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint32_t blk_num = usbd_mem_fops->mem_block_len[lun] - 1U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->scsi_blk_nbr[lun] = usbd_mem_fops->mem_block_len[lun]; + msc->scsi_blk_size[lun] = usbd_mem_fops->mem_block_size[lun]; + + msc->bbb_data[0] = (uint8_t)(blk_num >> 24U); + msc->bbb_data[1] = (uint8_t)(blk_num >> 16U); + msc->bbb_data[2] = (uint8_t)(blk_num >> 8U); + msc->bbb_data[3] = (uint8_t)(blk_num); + + msc->bbb_data[4] = (uint8_t)(msc->scsi_blk_size[lun] >> 24U); + msc->bbb_data[5] = (uint8_t)(msc->scsi_blk_size[lun] >> 16U); + msc->bbb_data[6] = (uint8_t)(msc->scsi_blk_size[lun] >> 8U); + msc->bbb_data[7] = (uint8_t)(msc->scsi_blk_size[lun]); + + msc->bbb_datalen = 8U; + + return 0; +} + +/*! + \brief process read format capacity command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read_format_capacity (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint16_t i = 0U; + uint32_t blk_size = usbd_mem_fops->mem_block_size[lun]; + uint32_t blk_num = usbd_mem_fops->mem_block_len[lun]; + uint32_t blk_nbr = blk_num - 1U; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + for (i = 0U; i < 12U; i++) { + msc->bbb_data[i] = 0U; + } + + msc->bbb_data[3] = 0x08U; + msc->bbb_data[4] = (uint8_t)(blk_nbr >> 24U); + msc->bbb_data[5] = (uint8_t)(blk_nbr >> 16U); + msc->bbb_data[6] = (uint8_t)(blk_nbr >> 8U); + msc->bbb_data[7] = (uint8_t)(blk_nbr); + + msc->bbb_data[8] = 0x02U; + msc->bbb_data[9] = (uint8_t)(blk_size >> 16U); + msc->bbb_data[10] = (uint8_t)(blk_size >> 8U); + msc->bbb_data[11] = (uint8_t)(blk_size); + + msc->bbb_datalen = 12U; + + return 0; +} + +/*! + \brief process mode sense 6 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_sense6 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint16_t len = 8U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = msc_mode_sense6_data[len]; + } + + return 0; +} + +/*! + \brief process mode sense 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_mode_sense10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint16_t len = 8U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = msc_mode_sense10_data[len]; + } + + return 0; +} + +/*! + \brief process request sense command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_request_sense (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint8_t i = 0U; + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + for (i = 0U; i < REQUEST_SENSE_DATA_LEN; i++) { + msc->bbb_data[i] = 0U; + } + + msc->bbb_data[0] = 0x70U; + msc->bbb_data[7] = REQUEST_SENSE_DATA_LEN - 6U; + + if ((msc->scsi_sense_head != msc->scsi_sense_tail)) { + msc->bbb_data[2] = msc->scsi_sense[msc->scsi_sense_head].SenseKey; + msc->bbb_data[12] = msc->scsi_sense[msc->scsi_sense_head].ASCQ; + msc->bbb_data[13] = msc->scsi_sense[msc->scsi_sense_head].ASC; + msc->scsi_sense_head++; + + if (msc->scsi_sense_head == SENSE_LIST_DEEPTH) { + msc->scsi_sense_head = 0U; + } + } + + msc->bbb_datalen = USB_MIN(REQUEST_SENSE_DATA_LEN, params[4]); + + return 0; +} + +/*! + \brief process start stop unit command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static inline int8_t scsi_start_stop_unit (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + msc->scsi_disk_pop = 1U; + + return 0; +} + +/*! + \brief process allow medium removal command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static inline int8_t scsi_allow_medium_removal (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief process read 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_read10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if (BBB_IDLE == msc->bbb_state) { + /* direction is from device to host */ + if (0x80U != (msc->bbb_cbw.bmCBWFlags & 0x80U)) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code (udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + msc->scsi_blk_addr = (params[2] << 24U) | (params[3] << 16U) | \ + (params[4] << 8U) | params[5]; + + msc->scsi_blk_len = (params[7] << 8U) | params[8]; + + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->bbb_state = BBB_DATA_IN; + + msc->scsi_blk_addr *= msc->scsi_blk_size[lun]; + msc->scsi_blk_len *= msc->scsi_blk_size[lun]; + + /* cases 4,5 : Hi <> Dn */ + if (msc->bbb_cbw.dCBWDataTransferLength != msc->scsi_blk_len) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + } + + msc->bbb_datalen = MSC_MEDIA_PACKET_SIZE; + + return scsi_process_read (udev, lun); +} + +/*! + \brief process write 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_write10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if (BBB_IDLE == msc->bbb_state) { + /* case 8 : Hi <> Do */ + if (0x80U == (msc->bbb_cbw.bmCBWFlags & 0x80U)) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + /* check whether media is ready */ + if (0 != usbd_mem_fops->mem_ready(lun)) { + scsi_sense_code (udev, lun, NOT_READY, MEDIUM_NOT_PRESENT); + + return -1; + } + + /* check if media is write-protected */ + if (0 != usbd_mem_fops->mem_protected(lun)) { + scsi_sense_code (udev, lun, NOT_READY, WRITE_PROTECTED); + + return -1; + } + + msc->scsi_blk_addr = (params[2] << 24U) | (params[3] << 16U) | \ + (params[4] << 8U) | params[5]; + + msc->scsi_blk_len = (params[7] << 8U) | params[8]; + + /* check if LBA address is in the right range */ + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->scsi_blk_addr *= msc->scsi_blk_size[lun]; + msc->scsi_blk_len *= msc->scsi_blk_size[lun]; + + /* cases 3,11,13 : Hn,Ho <> D0 */ + if (msc->bbb_cbw.dCBWDataTransferLength != msc->scsi_blk_len) { + scsi_sense_code (udev, msc->bbb_cbw.bCBWLUN, ILLEGAL_REQUEST, INVALID_CDB); + + return -1; + } + + /* prepare endpoint to receive first data packet */ + msc->bbb_state = BBB_DATA_OUT; + + usbd_ep_recev (udev, + MSC_OUT_EP, + msc->bbb_data, + USB_MIN (msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE)); + } else { /* write process ongoing */ + return scsi_process_write (udev, lun); + } + + return 0; +} + +/*! + \brief process verify 10 command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_verify10 (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if (0x02U == (params[1] & 0x02U)) { + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); + + return -1; /* error, verify mode not supported*/ + } + + if (scsi_check_address_range (udev, lun, msc->scsi_blk_addr, (uint16_t)msc->scsi_blk_len) < 0) { + return -1; /* error */ + } + + msc->bbb_datalen = 0U; + + return 0; +} + +/*! + \brief check address range + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] blk_offset: block offset + \param[in] blk_nbr: number of block to be processed + \param[out] none + \retval status +*/ +static inline int8_t scsi_check_address_range (usb_core_driver *udev, uint8_t lun, uint32_t blk_offset, uint16_t blk_nbr) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + if ((blk_offset + blk_nbr) > msc->scsi_blk_nbr[lun]) { + scsi_sense_code (udev, lun, ILLEGAL_REQUEST, ADDRESS_OUT_OF_RANGE); + + return -1; + } + + return 0; +} + +/*! + \brief handle read process + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t scsi_process_read (usb_core_driver *udev, uint8_t lun) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + uint32_t len = USB_MIN(msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE); + + if (usbd_mem_fops->mem_read(lun, + msc->bbb_data, + msc->scsi_blk_addr, + (uint16_t)(len / msc->scsi_blk_size[lun])) < 0) { + scsi_sense_code(udev, lun, HARDWARE_ERROR, UNRECOVERED_READ_ERROR); + + return -1; + } + + usbd_ep_send (udev, MSC_IN_EP, msc->bbb_data, len); + + msc->scsi_blk_addr += len; + msc->scsi_blk_len -= len; + + /* case 6 : Hi = Di */ + msc->bbb_csw.dCSWDataResidue -= len; + + if (0U == msc->scsi_blk_len) { + msc->bbb_state = BBB_LAST_DATA_IN; + } + + return 0; +} + +/*! + \brief handle write process + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static int8_t scsi_process_write (usb_core_driver *udev, uint8_t lun) +{ + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + uint32_t len = USB_MIN(msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE); + + if (usbd_mem_fops->mem_write (lun, + msc->bbb_data, + msc->scsi_blk_addr, + (uint16_t)(len / msc->scsi_blk_size[lun])) < 0) { + scsi_sense_code(udev, lun, HARDWARE_ERROR, WRITE_FAULT); + + return -1; + } + + msc->scsi_blk_addr += len; + msc->scsi_blk_len -= len; + + /* case 12 : Ho = Do */ + msc->bbb_csw.dCSWDataResidue -= len; + + if (0U == msc->scsi_blk_len) { + msc_bbb_csw_send (udev, CSW_CMD_PASSED); + } else { + /* prepare endpoint to receive next packet */ + usbd_ep_recev (udev, + MSC_OUT_EP, + msc->bbb_data, + USB_MIN (msc->scsi_blk_len, MSC_MEDIA_PACKET_SIZE)); + } + + return 0; +} + +/*! + \brief process format unit command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[out] none + \retval status +*/ +static inline int8_t scsi_format_cmd (usb_core_driver *udev, uint8_t lun) +{ + return 0; +} + +/*! + \brief process read TOC command + \param[in] udev: pointer to USB device instance + \param[in] lun: logical unit number + \param[in] params: command parameters + \param[out] none + \retval status +*/ +static int8_t scsi_toc_cmd_read (usb_core_driver *udev, uint8_t lun, uint8_t *params) +{ + uint8_t* pPage; + uint16_t len; + + usbd_msc_handler *msc = (usbd_msc_handler *)udev->dev.class_data[USBD_MSC_INTERFACE]; + + pPage = (uint8_t *)&usbd_mem_fops->mem_toc_data[lun * READ_TOC_CMD_LEN]; + len = (uint16_t)pPage[1] + 2U; + + msc->bbb_datalen = len; + + while (len) { + len--; + msc->bbb_data[len] = pPage[len]; + } + + return 0; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Include/printer_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Include/printer_core.h new file mode 100644 index 0000000..62c501a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Include/printer_core.h @@ -0,0 +1,78 @@ +/*! + \file printer_core.h + \brief the header file of USB printer device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __PRINTER_CORE_H +#define __PRINTER_CORE_H + +#include "usbd_enum.h" +#include "usb_ch9_std.h" + +/* USB printer device class code */ +#define USB_CLASS_PRINTER 0x07U + +/* printer device subclass code */ +#define USB_SUBCLASS_PRINTER 0x01U + +/* printer device protocol code */ +#define PROTOCOL_UNIDIRECTIONAL_ITF 0x01U +#define PROTOCOL_BI_DIRECTIONAL_ITF 0x02U +#define PROTOCOL_1284_4_ITF 0x03U +#define PROTOCOL_VENDOR 0xFFU + +#define DEVICE_ID_LEN 103U + +#define USB_PRINTER_CONFIG_DESC_LEN 32U + +/* printer device specific-class request */ +#define GET_DEVICE_ID 0x00U +#define GET_PORT_STATUS 0x01U +#define SOFT_RESET 0x02U + +#pragma pack(1) + +/* USB configuration descriptor structure */ +typedef struct +{ + usb_desc_config config; + usb_desc_itf printer_itf; + usb_desc_ep printer_epin; + usb_desc_ep printer_epout; +} usb_printer_desc_config_set; + +#pragma pack() + +extern usb_desc printer_desc; +extern usb_class_core usbd_printer_cb; + +#endif /* __PRINTER_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Source/printer_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Source/printer_core.c new file mode 100644 index 0000000..d8aa23b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/class/printer/Source/printer_core.c @@ -0,0 +1,309 @@ +/*! + \file printer_core.c + \brief USB printer device class core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "printer_core.h" + +#define USBD_VID 0x28E9U +#define USBD_PID 0x028DU + +/* printer port status: paper not empty/selected/no error */ +static uint8_t g_port_status = 0x18U; + +uint8_t g_printer_data_buf[PRINTER_OUT_PACKET]; + +uint8_t PRINTER_DEVICE_ID[DEVICE_ID_LEN] = +{ + 0x00, 0x67, + 'M', 'A', 'N', 'U', 'F', 'A', 'C', 'T', 'U', 'R', 'E', 'R', ':', + 'G', 'I', 'G', 'A', ' ', 'D', 'E', 'V', 'I', 'C', 'E', '-', ';', + 'C', 'O', 'M', 'M', 'A', 'N', 'D', ' ', 'S', 'E', 'T', ':', + 'P', 'C', 'L', ',', 'M', 'P', 'L', ';', + 'M', 'O', 'D', 'E', 'L', ':', + 'L', 'a', 's', 'e', 'r', 'B', 'e', 'a', 'm', '?', ';', + 'C', 'O', 'M', 'M', 'E', 'N', 'T', ':', + 'G', 'o', 'o', 'd', ' ', '!', ';', + 'A', 'C', 'T', 'I', 'V', 'E', ' ', 'C', 'O', 'M', 'M', 'A', 'N', 'D', ' ', 'S', 'E', 'T', ':', + 'P', 'C', 'L', ';' +}; + +/* USB standard device descriptor */ +const usb_desc_dev printer_dev_desc = +{ + .header = + { + .bLength = USB_DEV_DESC_LEN, + .bDescriptorType = USB_DESCTYPE_DEV, + }, + .bcdUSB = 0x0200U, + .bDeviceClass = 0x00U, + .bDeviceSubClass = 0x00U, + .bDeviceProtocol = 0x00U, + .bMaxPacketSize0 = USB_FS_EP0_MAX_LEN, + .idVendor = USBD_VID, + .idProduct = USBD_PID, + .bcdDevice = 0x0100U, + .iManufacturer = STR_IDX_MFC, + .iProduct = STR_IDX_PRODUCT, + .iSerialNumber = STR_IDX_SERIAL, + .bNumberConfigurations = USBD_CFG_MAX_NUM, +}; +/* USB device configuration descriptor */ +const usb_printer_desc_config_set printer_config_desc = +{ + .config = + { + .header = + { + .bLength = sizeof(usb_desc_config), + .bDescriptorType = USB_DESCTYPE_CONFIG + }, + .wTotalLength = USB_PRINTER_CONFIG_DESC_LEN, + .bNumInterfaces = 0x01U, + .bConfigurationValue = 0x01U, + .iConfiguration = 0x00U, + .bmAttributes = 0xA0U, + .bMaxPower = 0x32U + }, + + .printer_itf = + { + .header = + { + .bLength = sizeof(usb_desc_itf), + .bDescriptorType = USB_DESCTYPE_ITF + }, + .bInterfaceNumber = 0x00U, + .bAlternateSetting = 0x00U, + .bNumEndpoints = 0x02U, + .bInterfaceClass = USB_CLASS_PRINTER, + .bInterfaceSubClass = USB_SUBCLASS_PRINTER, + .bInterfaceProtocol = PROTOCOL_BI_DIRECTIONAL_ITF, + .iInterface = 0x00U + }, + + .printer_epin = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_IN_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = PRINTER_IN_PACKET, + .bInterval = 0x00U + }, + + .printer_epout = + { + .header = + { + .bLength = sizeof(usb_desc_ep), + .bDescriptorType = USB_DESCTYPE_EP + }, + .bEndpointAddress = PRINTER_OUT_EP, + .bmAttributes = USB_EP_ATTR_BULK, + .wMaxPacketSize = PRINTER_OUT_PACKET, + .bInterval = 0x00U + }, +}; + +/* USB language ID Descriptor */ +static const usb_desc_LANGID usbd_language_id_desc = +{ + .header = + { + .bLength = sizeof(usb_desc_LANGID), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .wLANGID = ENG_LANGID +}; + +/* USB manufacture string */ +static const usb_desc_str manufacturer_string = +{ + .header = + { + .bLength = USB_STRING_LEN(10U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'i', 'g', 'a', 'D', 'e', 'v', 'i', 'c', 'e'} +}; + +/* USB product string */ +static const usb_desc_str product_string = +{ + .header = + { + .bLength = USB_STRING_LEN(16U), + .bDescriptorType = USB_DESCTYPE_STR, + }, + .unicode_string = {'G', 'D', '3', '2', '-', 'U', 'S', 'B', '_', 'P', 'r', 'i', 'n', 't', 'e', 'r'} +}; + +/* USBD serial string */ +static usb_desc_str serial_string = +{ + .header = + { + .bLength = USB_STRING_LEN(12U), + .bDescriptorType = USB_DESCTYPE_STR, + } +}; + +/* USB string descriptor */ +static void *const usbd_msc_strings[] = +{ + [STR_IDX_LANGID] = (uint8_t *)&usbd_language_id_desc, + [STR_IDX_MFC] = (uint8_t *)&manufacturer_string, + [STR_IDX_PRODUCT] = (uint8_t *)&product_string, + [STR_IDX_SERIAL] = (uint8_t *)&serial_string +}; + +usb_desc printer_desc = { + .dev_desc = (uint8_t *)&printer_dev_desc, + .config_desc = (uint8_t *)&printer_config_desc, + .strings = usbd_msc_strings +}; + +/* local function prototypes ('static') */ +static uint8_t printer_init (usb_dev *udev, uint8_t config_index); +static uint8_t printer_deinit (usb_dev *udev, uint8_t config_index); +static uint8_t printer_req (usb_dev *udev, usb_req *req); +static uint8_t printer_in (usb_dev *udev, uint8_t ep_num); +static uint8_t printer_out (usb_dev *udev, uint8_t ep_num); + +usb_class_core usbd_printer_cb = { + .init = printer_init, + .deinit = printer_deinit, + + .req_proc = printer_req, + + .data_in = printer_in, + .data_out = printer_out +}; + +/*! + \brief initialize the printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_init (usb_dev *udev, uint8_t config_index) +{ + /* initialize the data Tx endpoint */ + usbd_ep_setup (udev, &(printer_config_desc.printer_epin)); + + /* initialize the data Rx endpoint */ + usbd_ep_setup (udev, &(printer_config_desc.printer_epout)); + + /* prepare to receive data */ + usbd_ep_recev(udev, PRINTER_OUT_EP, g_printer_data_buf, PRINTER_OUT_PACKET); + + return USBD_OK; +} + +/*! + \brief deinitialize the printer device + \param[in] udev: pointer to USB device instance + \param[in] config_index: configuration index + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_deinit (usb_dev *udev, uint8_t config_index) +{ + /* deinitialize the data Tx / Rx endpoint */ + usbd_ep_clear (udev, PRINTER_IN_EP); + usbd_ep_clear (udev, PRINTER_OUT_EP); + + return USBD_OK; +} + +/*! + \brief handle the printer class-specific requests + \param[in] udev: pointer to USB device instance + \param[in] req: device class-specific request + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_req(usb_dev *udev, usb_req *req) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + switch (req->bRequest) { + case GET_DEVICE_ID: + transc->xfer_buf = (uint8_t *)PRINTER_DEVICE_ID; + transc->remain_len = DEVICE_ID_LEN; + break; + + case GET_PORT_STATUS: + transc->xfer_buf = (uint8_t *)&g_port_status; + transc->remain_len = 1U; + break; + + case SOFT_RESET: + usbd_ep_recev(udev, PRINTER_OUT_EP, g_printer_data_buf, PRINTER_OUT_PACKET); + break; + + default: + return USBD_FAIL; + } + + return USBD_OK; +} + +/*! + \brief handle printer data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_in (usb_dev *udev, uint8_t ep_num) +{ + return USBD_OK; +} + +/*! + \brief handle printer data + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation status +*/ +static uint8_t printer_out (usb_dev *udev, uint8_t ep_num) +{ + return USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_core.h new file mode 100644 index 0000000..569e03b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_core.h @@ -0,0 +1,103 @@ +/*! + \file usbd_core.h + \brief USB device mode core functions prototype + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_CORE_H +#define __USBD_CORE_H + +#include "drv_usb_core.h" +#include "drv_usb_dev.h" + +typedef enum +{ + USBD_OK = 0U, /*!< status OK */ + USBD_BUSY, /*!< status busy */ + USBD_FAIL, /*!< status fail */ +} usbd_status; + +enum _usbd_status +{ + USBD_DEFAULT = 1U, /*!< default status */ + USBD_ADDRESSED = 2U, /*!< address send status */ + USBD_CONFIGURED = 3U, /*!< configured status */ + USBD_SUSPENDED = 4U /*!< suspended status */ +}; + +/* static inline function definitions */ +/*! + \brief set USB device address + \param[in] udev: pointer to USB core instance + \param[in] addr: device address to set + \param[out] none + \retval none +*/ +__STATIC_INLINE void usbd_addr_set (usb_core_driver *udev, uint8_t addr) +{ + usb_devaddr_set(udev, addr); +} + +/*! + \brief get the received data length + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint number + \param[out] none + \retval USB device operation cur_status +*/ +__STATIC_INLINE uint16_t usbd_rxcount_get (usb_core_driver *udev, uint8_t ep_num) +{ + return (uint16_t)udev->dev.transc_out[ep_num].xfer_count; +} + +/* function declarations */ +/* initializes the USB device-mode stack and load the class driver */ +void usbd_init (usb_core_driver *udev, usb_core_enum core, usb_desc *desc, usb_class_core *class_core); +/* endpoint initialization */ +uint32_t usbd_ep_setup (usb_core_driver *udev, const usb_desc_ep *ep_desc); +/* configure the endpoint when it is disabled */ +uint32_t usbd_ep_clear (usb_core_driver *udev, uint8_t ep_addr); +/* endpoint prepare to receive data */ +uint32_t usbd_ep_recev (usb_core_driver *udev, uint8_t ep_addr, uint8_t *pbuf, uint32_t len); +/* endpoint prepare to transmit data */ +uint32_t usbd_ep_send (usb_core_driver *udev, uint8_t ep_addr, uint8_t *pbuf, uint32_t len); +/* set an endpoint to STALL status */ +uint32_t usbd_ep_stall (usb_core_driver *udev, uint8_t ep_addr); +/* clear endpoint STALLed status */ +uint32_t usbd_ep_stall_clear (usb_core_driver *udev, uint8_t ep_addr); +/* flush the endpoint FIFOs */ +uint32_t usbd_fifo_flush (usb_core_driver *udev, uint8_t ep_addr); +/* device connect */ +void usbd_connect (usb_core_driver *udev); +/* device disconnect */ +void usbd_disconnect (usb_core_driver *udev); + +#endif /* __USBD_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_enum.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_enum.h new file mode 100644 index 0000000..cfeaa3e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_enum.h @@ -0,0 +1,107 @@ +/*! + \file usbd_enum.h + \brief USB enumeration definitions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_ENUM_H +#define __USBD_ENUM_H + +#include "usbd_core.h" +#include "usbd_conf.h" +#include + +#ifndef NULL + #define NULL 0U +#endif + +typedef enum _usb_reqsta +{ + REQ_SUPP = 0x0U, /* request support */ + REQ_NOTSUPP = 0x1U, /* request not support */ +} usb_reqsta; + +/* string descriptor index */ +enum _str_index +{ + STR_IDX_LANGID = 0x0U, /* language ID string index */ + STR_IDX_MFC = 0x1U, /* manufacturer string index */ + STR_IDX_PRODUCT = 0x2U, /* product string index */ + STR_IDX_SERIAL = 0x3U, /* serial string index */ + STR_IDX_CONFIG = 0x4U, /* configuration string index */ + STR_IDX_ITF = 0x5U, /* interface string index */ +#ifndef WINUSB_EXEMPT_DRIVER + STR_IDX_MAX = 0xAU, /* string maximum index */ +#else + STR_IDX_MAX = 0xEFU, /* string maximum index */ +#endif /* WINUSB_EXEMPT_DRIVER */ +}; + +typedef enum _usb_pwrsta +{ + USB_PWRSTA_SELF_POWERED = 0x1U, /* USB is in self powered status */ + USB_PWRSTA_REMOTE_WAKEUP = 0x2U, /* USB is in remote wakeup status */ +} usb_pwrsta; + +typedef enum _usb_feature +{ + USB_FEATURE_EP_HALT = 0x0U, /* USB has endpoint halt feature */ + USB_FEATURE_REMOTE_WAKEUP = 0x1U, /* USB has endpoint remote wakeup feature */ + USB_FEATURE_TEST_MODE = 0x2U, /* USB has endpoint test mode feature */ +} usb_feature; + +#define ENG_LANGID 0x0409U /* english language ID */ +#define CHN_LANGID 0x0804U /* chinese language ID */ + +/* USB device exported macros */ +#define CTL_EP(ep) (((ep) == 0x00U) || ((ep) == 0x80U)) + +#define DEVICE_ID1 (0x1FFFF7E8U) /* device ID1 */ +#define DEVICE_ID2 (0x1FFFF7ECU) /* device ID2 */ +#define DEVICE_ID3 (0x1FFFF7F0U) /* device ID3 */ + +#define DEVICE_ID (0x40022100U) + +/* function declarations */ +/* handle USB standard device request */ +usb_reqsta usbd_standard_request (usb_core_driver *udev, usb_req *req); +/* handle USB device class request */ +usb_reqsta usbd_class_request (usb_core_driver *udev, usb_req *req); +/* handle USB vendor request */ +usb_reqsta usbd_vendor_request (usb_core_driver *udev, usb_req *req); +/* handle USB enumeration error */ +void usbd_enum_error (usb_core_driver *udev, usb_req *req); +/* convert hex 32bits value into unicode char */ +void int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len); +/* get serial string */ +void serial_string_get (uint16_t *unicode_str); + +#endif /* __USBD_ENUM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_transc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_transc.h new file mode 100644 index 0000000..ce3451a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Include/usbd_transc.h @@ -0,0 +1,56 @@ +/*! + \file usbd_transc.h + \brief USB transaction core functions prototype + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBD_TRANSC_H +#define __USBD_TRANSC_H + +#include "usbd_core.h" + +/* function declarations */ +/* USB send data in control transaction */ +usbd_status usbd_ctl_send (usb_core_driver *udev); +/* USB receive data in control transaction */ +usbd_status usbd_ctl_recev (usb_core_driver *udev); +/* USB send control transaction status */ +usbd_status usbd_ctl_status_send (usb_core_driver *udev); +/* USB control receive status */ +usbd_status usbd_ctl_status_recev (usb_core_driver *udev); +/* USB setup stage processing */ +uint8_t usbd_setup_transc (usb_core_driver *udev); +/* data out stage processing */ +uint8_t usbd_out_transc (usb_core_driver *udev, uint8_t ep_num); +/* data in stage processing */ +uint8_t usbd_in_transc (usb_core_driver *udev, uint8_t ep_num); + +#endif /* __USBD_TRANSC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_core.c new file mode 100644 index 0000000..ef1d8fa --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_core.c @@ -0,0 +1,313 @@ +/*! + \file usbd_core.c + \brief USB device mode core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_core.h" +#include "usbd_enum.h" +#include "drv_usb_hw.h" + +/* endpoint type */ +const uint32_t ep_type[] = +{ + [USB_EP_ATTR_CTL] = (uint32_t)USB_EPTYPE_CTRL, + [USB_EP_ATTR_BULK] = (uint32_t)USB_EPTYPE_BULK, + [USB_EP_ATTR_INT] = (uint32_t)USB_EPTYPE_INTR, + [USB_EP_ATTR_ISO] = (uint32_t)USB_EPTYPE_ISOC +}; + +/*! + \brief initializes the USB device-mode stack and load the class driver + \param[in] udev: pointer to USB core instance + \param[in] core: USB core type + \param[in] desc: pointer to USB descriptor + \param[in] class_core: class driver + \param[out] none + \retval none +*/ +void usbd_init (usb_core_driver *udev, usb_core_enum core, usb_desc *desc, usb_class_core *class_core) +{ + udev->dev.desc = desc; + + /* class callbacks */ + udev->dev.class_core = class_core; + + /* create serial string */ + serial_string_get(udev->dev.desc->strings[STR_IDX_SERIAL]); + + /* configure USB capabilities */ + (void)usb_basic_init (&udev->bp, &udev->regs, core); + + usb_globalint_disable(&udev->regs); + + /* initializes the USB core*/ + (void)usb_core_init (udev->bp, &udev->regs); + + /* set device disconnect */ + usbd_disconnect (udev); + +#ifndef USE_OTG_MODE + usb_curmode_set(&udev->regs, DEVICE_MODE); +#endif + + /* initializes device mode */ + (void)usb_devcore_init (udev); + + usb_globalint_enable(&udev->regs); + + /* set device connect */ + usbd_connect (udev); + + udev->dev.cur_status = (uint8_t)USBD_DEFAULT; +} + +/*! + \brief endpoint initialization + \param[in] udev: pointer to USB core instance + \param[in] ep_desc: pointer to endpoint descriptor + \param[out] none + \retval none +*/ +uint32_t usbd_ep_setup (usb_core_driver *udev, const usb_desc_ep *ep_desc) +{ + usb_transc *transc; + + uint8_t ep_addr = ep_desc->bEndpointAddress; + uint16_t max_len = ep_desc->wMaxPacketSize; + + /* set endpoint direction */ + if (EP_DIR(ep_addr)) { + transc = &udev->dev.transc_in[EP_ID(ep_addr)]; + + transc->ep_addr.dir = 1U; + } else { + transc = &udev->dev.transc_out[ep_addr]; + + transc->ep_addr.dir = 0U; + } + + transc->ep_addr.num = EP_ID(ep_addr); + transc->max_len = max_len; + transc->ep_type = (uint8_t)ep_type[ep_desc->bmAttributes & (uint8_t)USB_EPTYPE_MASK]; + + /* active USB endpoint function */ + (void)usb_transc_active (udev, transc); + + return 0U; +} + +/*! + \brief configure the endpoint when it is disabled + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +uint32_t usbd_ep_clear (usb_core_driver *udev, uint8_t ep_addr) +{ + usb_transc *transc; + + if (EP_DIR(ep_addr)) { + transc = &udev->dev.transc_in[EP_ID(ep_addr)]; + } else { + transc = &udev->dev.transc_out[ep_addr]; + } + + /* deactivate USB endpoint function */ + (void)usb_transc_deactivate (udev, transc); + + return 0U; +} + +/*! + \brief endpoint prepare to receive data + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[in] pbuf: user buffer address pointer + \param[in] len: buffer length + \param[out] none + \retval none +*/ +uint32_t usbd_ep_recev (usb_core_driver *udev, uint8_t ep_addr, uint8_t *pbuf, uint32_t len) +{ + usb_transc *transc = &udev->dev.transc_out[EP_ID(ep_addr)]; + + /* setup the transfer */ + transc->xfer_buf = pbuf; + transc->xfer_len = len; + transc->xfer_count = 0U; + + /* start the transfer */ + (void)usb_transc_outxfer (udev, transc); + + return 0U; +} + +/*! + \brief endpoint prepare to transmit data + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[in] pbuf: transmit buffer address pointer + \param[in] len: buffer length + \param[out] none + \retval none +*/ +uint32_t usbd_ep_send (usb_core_driver *udev, uint8_t ep_addr, uint8_t *pbuf, uint32_t len) +{ + usb_transc *transc = &udev->dev.transc_in[EP_ID(ep_addr)]; + + /* setup the transfer */ + transc->xfer_buf = pbuf; + transc->xfer_len = len; + transc->xfer_count = 0U; + + /* start the transfer */ + (void)usb_transc_inxfer (udev, transc); + + return 0U; +} + +/*! + \brief set an endpoint to STALL status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +uint32_t usbd_ep_stall (usb_core_driver *udev, uint8_t ep_addr) +{ + usb_transc *transc = NULL; + + if (EP_DIR(ep_addr)) { + transc = &udev->dev.transc_in[EP_ID(ep_addr)]; + } else { + transc = &udev->dev.transc_out[ep_addr]; + } + + transc->ep_stall = 1U; + + (void)usb_transc_stall (udev, transc); + + return (0U); +} + +/*! + \brief clear endpoint STALLed status + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +uint32_t usbd_ep_stall_clear (usb_core_driver *udev, uint8_t ep_addr) +{ + usb_transc *transc = NULL; + + if (EP_DIR(ep_addr)) { + transc = &udev->dev.transc_in[EP_ID(ep_addr)]; + } else { + transc = &udev->dev.transc_out[ep_addr]; + } + + transc->ep_stall = 0U; + + (void)usb_transc_clrstall (udev, transc); + + return (0U); +} + +/*! + \brief flush the endpoint FIFOs + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + in this parameter: + bit0..bit6: endpoint number (0..7) + bit7: endpoint direction which can be IN(1) or OUT(0) + \param[out] none + \retval none +*/ +uint32_t usbd_fifo_flush (usb_core_driver *udev, uint8_t ep_addr) +{ + if (EP_DIR(ep_addr)) { + (void)usb_txfifo_flush (&udev->regs, EP_ID(ep_addr)); + } else { + (void)usb_rxfifo_flush (&udev->regs); + } + + return (0U); +} + +/*! + \brief device connect + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void usbd_connect (usb_core_driver *udev) +{ +#ifndef USE_OTG_MODE + /* connect device */ + usb_dev_connect (udev); + + usb_mdelay(3U); +#endif /* USE_OTG_MODE */ +} + +/*! + \brief device disconnect + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void usbd_disconnect (usb_core_driver *udev) +{ +#ifndef USE_OTG_MODE + /* disconnect device for 3ms */ + usb_dev_disconnect (udev); + + usb_mdelay(3U); +#endif /* USE_OTG_MODE */ +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_enum.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_enum.c new file mode 100644 index 0000000..8578586 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_enum.c @@ -0,0 +1,765 @@ +/*! + \file usbd_enum.c + \brief USB enumeration function + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usb_ch9_std.h" + +#ifdef WINUSB_EXEMPT_DRIVER + +extern usbd_status usbd_OEM_req(usb_dev *udev, usb_req *req); + +#endif /* WINUSB_EXEMPT_DRIVER */ + +/* local function prototypes ('static') */ +static usb_reqsta _usb_std_reserved (usb_core_driver *udev, usb_req *req); +static uint8_t* _usb_dev_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_config_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_bos_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len); +static uint8_t* _usb_str_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len); +static usb_reqsta _usb_std_getstatus (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_clearfeature (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_setfeature (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_setaddress (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_getdescriptor (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_setdescriptor (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_getconfiguration (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_setconfiguration (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_getinterface (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_setinterface (usb_core_driver *udev, usb_req *req); +static usb_reqsta _usb_std_synchframe (usb_core_driver *udev, usb_req *req); + +static usb_reqsta (*_std_dev_req[])(usb_core_driver *udev, usb_req *req) = +{ + [USB_GET_STATUS] = _usb_std_getstatus, + [USB_CLEAR_FEATURE] = _usb_std_clearfeature, + [USB_RESERVED2] = _usb_std_reserved, + [USB_SET_FEATURE] = _usb_std_setfeature, + [USB_RESERVED4] = _usb_std_reserved, + [USB_SET_ADDRESS] = _usb_std_setaddress, + [USB_GET_DESCRIPTOR] = _usb_std_getdescriptor, + [USB_SET_DESCRIPTOR] = _usb_std_setdescriptor, + [USB_GET_CONFIGURATION] = _usb_std_getconfiguration, + [USB_SET_CONFIGURATION] = _usb_std_setconfiguration, + [USB_GET_INTERFACE] = _usb_std_getinterface, + [USB_SET_INTERFACE] = _usb_std_setinterface, + [USB_SYNCH_FRAME] = _usb_std_synchframe, +}; + +/* get standard descriptor handler */ +static uint8_t* (*std_desc_get[])(usb_core_driver *udev, uint8_t index, uint16_t *len) = +{ + [(uint8_t)USB_DESCTYPE_DEV - 1U] = _usb_dev_desc_get, + [(uint8_t)USB_DESCTYPE_CONFIG - 1U] = _usb_config_desc_get, + [(uint8_t)USB_DESCTYPE_STR - 1U] = _usb_str_desc_get +}; + +/*! + \brief handle USB standard device request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +usb_reqsta usbd_standard_request (usb_core_driver *udev, usb_req *req) +{ + return (*_std_dev_req[req->bRequest])(udev, req); +} + +/*! + \brief handle USB device class request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device class request + \param[out] none + \retval USB device request status +*/ +usb_reqsta usbd_class_request (usb_core_driver *udev, usb_req *req) +{ + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + if (BYTE_LOW(req->wIndex) <= USBD_ITF_MAX_NUM) { + /* call device class handle function */ + return (usb_reqsta)udev->dev.class_core->req_proc(udev, req); + } + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB vendor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB vendor request + \param[out] none + \retval USB device request status +*/ +usb_reqsta usbd_vendor_request (usb_core_driver *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* added by user... */ +#ifdef WINUSB_EXEMPT_DRIVER + usbd_OEM_req(udev, req); +#endif + + return REQ_SUPP; +} + +/*! + \brief handle USB enumeration error + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval none +*/ +void usbd_enum_error (usb_core_driver *udev, usb_req *req) +{ + (void)req; + + (void)usbd_ep_stall (udev, 0x80U); + (void)usbd_ep_stall (udev, 0x00U); + + usb_ctlep_startout(udev); +} + +/*! + \brief convert hex 32bits value into unicode char + \param[in] value: hex 32bits value + \param[in] pbuf: buffer pointer to store unicode char + \param[in] len: value length + \param[out] none + \retval none +*/ +void int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len) +{ + uint8_t index; + + for (index = 0U; index < len; index++) { + if ((value >> 28U) < 0x0AU) { + pbuf[2U * index] = (uint8_t)((value >> 28U) + '0'); + } else { + pbuf[2U * index] = (uint8_t)((value >> 28U) + 'A' - 10U); + } + + value = value << 4U; + + pbuf[2U * index + 1U] = 0U; + } +} + +/*! + \brief convert hex 32bits value into unicode char + \param[in] unicode_str: pointer to unicode string + \param[out] none + \retval none +*/ +void serial_string_get (uint16_t *unicode_str) +{ + if ((unicode_str[0] & 0x00FFU) != 6U) { + uint32_t DeviceSerial0, DeviceSerial1, DeviceSerial2; + + DeviceSerial0 = *(uint32_t*)DEVICE_ID1; + DeviceSerial1 = *(uint32_t*)DEVICE_ID2; + DeviceSerial2 = *(uint32_t*)DEVICE_ID3; + + DeviceSerial0 += DeviceSerial2; + + if (0U != DeviceSerial0) { + int_to_unicode(DeviceSerial0, (uint8_t*)&(unicode_str[1]), 8U); + int_to_unicode(DeviceSerial1, (uint8_t*)&(unicode_str[9]), 4U); + } + } else { + uint32_t device_serial = *(uint32_t*)DEVICE_ID; + + if(0U != device_serial) { + unicode_str[1] = (uint16_t)(device_serial & 0x0000FFFFU); + unicode_str[2] = (uint16_t)((device_serial & 0xFFFF0000U) >> 16U); + + } + } +} + +/*! + \brief no operation, just for reserved + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB vendor request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_reserved (usb_core_driver *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no operation... */ + + return REQ_NOTSUPP; +} + +/*! + \brief get the device descriptor + \param[in] udev: pointer to USB device instance + \param[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_dev_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len) +{ + (void)index; + + *len = udev->dev.desc->dev_desc[0]; + + return udev->dev.desc->dev_desc; +} + +/*! + \brief get the configuration descriptor + \brief[in] udev: pointer to USB device instance + \brief[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_config_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len) +{ + (void)index; + + *len = udev->dev.desc->config_desc[2] | (udev->dev.desc->config_desc[3]<< 8U); + + return udev->dev.desc->config_desc; +} + +/*! + \brief get the BOS descriptor + \brief[in] udev: pointer to USB device instance + \brief[in] index: no use + \param[out] len: data length pointer + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_bos_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len) +{ + (void)index; + + *len = udev->dev.desc->bos_desc[2]; + + return udev->dev.desc->bos_desc; +} + +/*! + \brief get string descriptor + \param[in] udev: pointer to USB device instance + \param[in] index: string descriptor index + \param[out] len: pointer to string length + \retval descriptor buffer pointer +*/ +static uint8_t* _usb_str_desc_get (usb_core_driver *udev, uint8_t index, uint16_t *len) +{ + uint8_t *desc = udev->dev.desc->strings[index]; + + *len = desc[0]; + + return desc; +} + +/*! + \brief handle Get_Status request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getstatus (usb_core_driver *udev, usb_req *req) +{ + uint8_t recp = BYTE_LOW(req->wIndex); + usb_reqsta req_status = REQ_NOTSUPP; + usb_transc *transc = &udev->dev.transc_in[0]; + + static uint8_t status[2] = {0}; + + switch(req->bmRequestType & (uint8_t)USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + if (((uint8_t)USBD_ADDRESSED == udev->dev.cur_status) || \ + ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status)) { + + if (udev->dev.pm.power_mode) { + status[0] = USB_STATUS_SELF_POWERED; + } else { + status[0] = 0U; + } + + if (udev->dev.pm.dev_remote_wakeup) { + status[0] |= USB_STATUS_REMOTE_WAKEUP; + } else { + status[0] = 0U; + } + + req_status = REQ_SUPP; + } + break; + + case USB_RECPTYPE_ITF: + if (((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) && (recp <= USBD_ITF_MAX_NUM)) { + req_status = REQ_SUPP; + } + break; + + case USB_RECPTYPE_EP: + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + if (0x80U == (recp & 0x80U)) { + status[0] = udev->dev.transc_in[EP_ID(recp)].ep_stall; + } else { + status[0] = udev->dev.transc_out[recp].ep_stall; + } + + req_status = REQ_SUPP; + } + break; + + default: + break; + } + + if (REQ_SUPP == req_status) { + transc->xfer_buf = status; + transc->remain_len = 2U; + } + + return req_status; +} + +/*! + \brief handle USB Clear_Feature request + \param[in] udev: pointer to USB device instance + \param[in] req: USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_clearfeature (usb_core_driver *udev, usb_req *req) +{ + uint8_t ep = 0U; + + switch(req->bmRequestType & (uint8_t)USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + if (((uint8_t)USBD_ADDRESSED == udev->dev.cur_status) || \ + ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status)) { + + /* clear device remote wakeup feature */ + if ((uint16_t)USB_FEATURE_REMOTE_WAKEUP == req->wValue) { + udev->dev.pm.dev_remote_wakeup = 0U; + + return REQ_SUPP; + } + } + break; + + case USB_RECPTYPE_ITF: + break; + + case USB_RECPTYPE_EP: + /* get endpoint address */ + ep = BYTE_LOW(req->wIndex); + + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + /* clear endpoint halt feature */ + if (((uint16_t)USB_FEATURE_EP_HALT == req->wValue) && (!CTL_EP(ep))) { + (void)usbd_ep_stall_clear (udev, ep); + + (void)udev->dev.class_core->req_proc (udev, req); + } + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Feature request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setfeature (usb_core_driver *udev, usb_req *req) +{ + uint8_t ep = 0U; + + switch (req->bmRequestType & (uint8_t)USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + if (((uint8_t)USBD_ADDRESSED == udev->dev.cur_status) || \ + ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status)) { + /* set device remote wakeup feature */ + if ((uint16_t)USB_FEATURE_REMOTE_WAKEUP == req->wValue) { + udev->dev.pm.dev_remote_wakeup = 1U; + } + + return REQ_SUPP; + } + break; + + case USB_RECPTYPE_ITF: + break; + + case USB_RECPTYPE_EP: + /* get endpoint address */ + ep = BYTE_LOW(req->wIndex); + + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + /* set endpoint halt feature */ + if (((uint16_t)USB_FEATURE_EP_HALT == req->wValue) && (!CTL_EP(ep))) { + (void)usbd_ep_stall (udev, ep); + } + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Address request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setaddress (usb_core_driver *udev, usb_req *req) +{ + if ((0U == req->wIndex) && (0U == req->wLength)) { + udev->dev.dev_addr = (uint8_t)(req->wValue) & 0x7FU; + + if (udev->dev.cur_status != (uint8_t)USBD_CONFIGURED) { + usbd_addr_set (udev, udev->dev.dev_addr); + + if (udev->dev.dev_addr) { + udev->dev.cur_status = (uint8_t)USBD_ADDRESSED; + } else { + udev->dev.cur_status = (uint8_t)USBD_DEFAULT; + } + + return REQ_SUPP; + } + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Get_Descriptor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getdescriptor (usb_core_driver *udev, usb_req *req) +{ + uint8_t desc_type = 0U; + uint8_t desc_index = 0U; + + usb_reqsta status = REQ_NOTSUPP; + + usb_transc *transc = &udev->dev.transc_in[0]; + + /* get device standard descriptor */ + switch (req->bmRequestType & USB_RECPTYPE_MASK) { + case USB_RECPTYPE_DEV: + desc_type = BYTE_HIGH(req->wValue); + desc_index = BYTE_LOW(req->wValue); + + switch (desc_type) { + case USB_DESCTYPE_DEV: + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, (uint16_t *)&(transc->remain_len)); + + if (64U == req->wLength) { + transc->remain_len = 8U; + } + break; + + case USB_DESCTYPE_CONFIG: + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, (uint16_t *)&(transc->remain_len)); + break; + + case USB_DESCTYPE_STR: + if (desc_index < (uint8_t)STR_IDX_MAX) { + transc->xfer_buf = std_desc_get[desc_type - 1U](udev, desc_index, (uint16_t *)&(transc->remain_len)); + } + break; + + case USB_DESCTYPE_ITF: + case USB_DESCTYPE_EP: + case USB_DESCTYPE_DEV_QUALIFIER: + case USB_DESCTYPE_OTHER_SPD_CONFIG: + case USB_DESCTYPE_ITF_POWER: + break; + + case USB_DESCTYPE_BOS: + transc->xfer_buf = _usb_bos_desc_get(udev, desc_index, (uint16_t *)&(transc->remain_len)); + break; + + default: + break; + } + break; + + case USB_RECPTYPE_ITF: + /* get device class special descriptor */ + status = (usb_reqsta)(udev->dev.class_core->req_proc(udev, req)); + break; + + case USB_RECPTYPE_EP: + break; + + default: + break; + } + + if ((0U != transc->remain_len) && (0U != req->wLength)) { + if (transc->remain_len < req->wLength) { + if ((transc->remain_len >= transc->max_len) && (0U == (transc->remain_len % transc->max_len))) { + udev->dev.control.ctl_zlp = 1U; + } + } else { + transc->remain_len = req->wLength; + } + + status = REQ_SUPP; + } + + return status; +} + +/*! + \brief handle USB Set_Descriptor request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setdescriptor (usb_core_driver *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no handle... */ + return REQ_SUPP; +} + +/*! + \brief handle USB Get_Configuration request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getconfiguration (usb_core_driver *udev, usb_req *req) +{ + (void)req; + + usb_reqsta req_status = REQ_NOTSUPP; + usb_transc *transc = &udev->dev.transc_in[0]; + + switch (udev->dev.cur_status) { + case USBD_ADDRESSED: + if (USB_DEFAULT_CONFIG == udev->dev.config) { + req_status = REQ_SUPP; + } + break; + + case USBD_CONFIGURED: + if (USB_DEFAULT_CONFIG != udev->dev.config) { + req_status = REQ_SUPP; + } + break; + + default: + break; + } + + if (REQ_SUPP == req_status) { + transc->xfer_buf = &(udev->dev.config); + transc->remain_len = 1U; + } + + return req_status; +} + +/*! + \brief handle USB Set_Configuration request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setconfiguration (usb_core_driver *udev, usb_req *req) +{ + static uint8_t config; + usb_reqsta status = REQ_NOTSUPP; + + config = (uint8_t)(req->wValue); + + if (config <= USBD_CFG_MAX_NUM) { + switch (udev->dev.cur_status) { + case USBD_ADDRESSED: + if (config){ + (void)udev->dev.class_core->init(udev, config); + + udev->dev.config = config; + udev->dev.cur_status = (uint8_t)USBD_CONFIGURED; + } + + status = REQ_SUPP; + break; + + case USBD_CONFIGURED: + if (USB_DEFAULT_CONFIG == config) { + (void)udev->dev.class_core->deinit(udev, config); + + udev->dev.config = config; + udev->dev.cur_status = (uint8_t)USBD_ADDRESSED; + } else if (config != udev->dev.config) { + /* clear old configuration */ + (void)udev->dev.class_core->deinit(udev, config); + + /* set new configuration */ + udev->dev.config = config; + + (void)udev->dev.class_core->init(udev, config); + } else { + /* no operation */ + } + + status = REQ_SUPP; + break; + + case USBD_DEFAULT: + break; + + default: + break; + } + } + + return status; +} + +/*! + \brief handle USB Get_Interface request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_getinterface (usb_core_driver *udev, usb_req *req) +{ + switch (udev->dev.cur_status) { + case USBD_DEFAULT: + break; + + case USBD_ADDRESSED: + break; + + case USBD_CONFIGURED: + if (BYTE_LOW(req->wIndex) <= USBD_ITF_MAX_NUM) { + usb_transc *transc = &udev->dev.transc_in[0]; + + transc->xfer_buf = &(udev->dev.class_core->alter_set); + transc->remain_len = 1U; + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB Set_Interface request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_setinterface (usb_core_driver *udev, usb_req *req) +{ + switch (udev->dev.cur_status) { + case USBD_DEFAULT: + break; + + case USBD_ADDRESSED: + break; + + case USBD_CONFIGURED: + if (BYTE_LOW(req->wIndex) <= USBD_ITF_MAX_NUM) { + if (NULL != udev->dev.class_core->set_intf) { + (void)udev->dev.class_core->set_intf (udev, req); + } + + return REQ_SUPP; + } + break; + + default: + break; + } + + return REQ_NOTSUPP; +} + +/*! + \brief handle USB SynchFrame request + \param[in] udev: pointer to USB device instance + \param[in] req: pointer to USB device request + \param[out] none + \retval USB device request status +*/ +static usb_reqsta _usb_std_synchframe (usb_core_driver *udev, usb_req *req) +{ + (void)udev; + (void)req; + + /* no handle */ + return REQ_SUPP; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_transc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_transc.c new file mode 100644 index 0000000..9dc1a6f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/device/core/Source/usbd_transc.c @@ -0,0 +1,256 @@ +/*! + \file usbd_transc.c + \brief USB transaction core functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_enum.h" +#include "usbd_transc.h" + +/*! + \brief USB send data in the control transaction + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation cur_status +*/ +usbd_status usbd_ctl_send (usb_core_driver *udev) +{ + usb_transc *transc = &udev->dev.transc_in[0]; + + (void)usbd_ep_send(udev, 0U, transc->xfer_buf, transc->remain_len); + + if (transc->remain_len > transc->max_len) { + udev->dev.control.ctl_state = (uint8_t)USB_CTL_DATA_IN; + } else { + udev->dev.control.ctl_state = (uint8_t)USB_CTL_LAST_DATA_IN; + } + + return USBD_OK; +} + +/*! + \brief USB receive data in control transaction + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation cur_status +*/ +usbd_status usbd_ctl_recev (usb_core_driver *udev) +{ + usb_transc *transc = &udev->dev.transc_out[0]; + + (void)usbd_ep_recev (udev, 0U, transc->xfer_buf, transc->remain_len); + + if (transc->remain_len > transc->max_len) { + udev->dev.control.ctl_state = (uint8_t)USB_CTL_DATA_OUT; + } else { + udev->dev.control.ctl_state = (uint8_t)USB_CTL_LAST_DATA_OUT; + } + + return USBD_OK; +} + +/*! + \brief USB send control transaction status + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation cur_status +*/ +usbd_status usbd_ctl_status_send (usb_core_driver *udev) +{ + udev->dev.control.ctl_state = (uint8_t)USB_CTL_STATUS_IN; + + (void)usbd_ep_send (udev, 0U, NULL, 0U); + + usb_ctlep_startout(udev); + + return USBD_OK; +} + +/*! + \brief USB control receive status + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation cur_status +*/ +usbd_status usbd_ctl_status_recev (usb_core_driver *udev) +{ + udev->dev.control.ctl_state = (uint8_t)USB_CTL_STATUS_OUT; + + (void)usbd_ep_recev (udev, 0U, NULL, 0U); + + usb_ctlep_startout(udev); + + return USBD_OK; +} + +/*! + \brief USB setup stage processing + \param[in] udev: pointer to USB device instance + \param[out] none + \retval USB device operation cur_status +*/ +uint8_t usbd_setup_transc (usb_core_driver *udev) +{ + usb_reqsta reqstat = REQ_NOTSUPP; + + usb_req req = udev->dev.control.req; + + switch (req.bmRequestType & USB_REQTYPE_MASK) { + /* standard device request */ + case USB_REQTYPE_STRD: + reqstat = usbd_standard_request (udev, &req); + break; + + /* device class request */ + case USB_REQTYPE_CLASS: + reqstat = usbd_class_request (udev, &req); + break; + + /* vendor defined request */ + case USB_REQTYPE_VENDOR: + reqstat = usbd_vendor_request (udev, &req); + break; + + default: + break; + } + + if (REQ_SUPP == reqstat) { + if (0U == req.wLength) { + (void)usbd_ctl_status_send (udev); + } else { + if (req.bmRequestType & 0x80U) { + (void)usbd_ctl_send (udev); + } else { + (void)usbd_ctl_recev (udev); + } + } + } else { + usbd_enum_error (udev, &req); + } + + return (uint8_t)USBD_OK; +} + +/*! + \brief data out stage processing + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier(0..7) + \param[out] none + \retval USB device operation cur_status +*/ +uint8_t usbd_out_transc (usb_core_driver *udev, uint8_t ep_num) +{ + if (0U == ep_num) { + usb_transc *transc = &udev->dev.transc_out[0]; + + switch (udev->dev.control.ctl_state) { + case USB_CTL_DATA_OUT: + /* update transfer length */ + transc->remain_len -= transc->max_len; + + (void)usbd_ctl_recev (udev); + break; + + case USB_CTL_LAST_DATA_OUT: + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + if (NULL != udev->dev.class_core->ctlx_out) { + (void)udev->dev.class_core->ctlx_out (udev); + } + } + + transc->remain_len = 0U; + + (void)usbd_ctl_status_send (udev); + break; + + default: + break; + } + } else if ((NULL != udev->dev.class_core->data_out) && ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status)) { + (void)udev->dev.class_core->data_out (udev, ep_num); + } else { + /* no operation */ + } + + return (uint8_t)USBD_OK; +} + +/*! + \brief data in stage processing + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier(0..7) + \param[out] none + \retval USB device operation cur_status +*/ +uint8_t usbd_in_transc (usb_core_driver *udev, uint8_t ep_num) +{ + if (0U == ep_num) { + usb_transc *transc = &udev->dev.transc_in[0]; + + switch (udev->dev.control.ctl_state) { + case USB_CTL_DATA_IN: + /* update transfer length */ + transc->remain_len -= transc->max_len; + + (void)usbd_ctl_send (udev); + break; + + case USB_CTL_LAST_DATA_IN: + /* last packet is MPS multiple, so send ZLP packet */ + if (udev->dev.control.ctl_zlp) { + (void)usbd_ep_send (udev, 0U, NULL, 0U); + + udev->dev.control.ctl_zlp = 0U; + } else { + if ((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) { + if (NULL != udev->dev.class_core->ctlx_in) { + (void)udev->dev.class_core->ctlx_in (udev); + } + } + + transc->remain_len = 0U; + + (void)usbd_ctl_status_recev (udev); + } + break; + + default: + break; + } + } else { + if (((uint8_t)USBD_CONFIGURED == udev->dev.cur_status) && (NULL != udev->dev.class_core->data_in)) { + (void)udev->dev.class_core->data_in (udev, ep_num); + } + } + + return (uint8_t)USBD_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_core.h new file mode 100644 index 0000000..cc2fd0d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_core.h @@ -0,0 +1,166 @@ +/*! + \file drv_usb_core.h + \brief USB core low level driver header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USB_CORE_H +#define __DRV_USB_CORE_H + +#include "drv_usb_regs.h" +#include "usb_ch9_std.h" + +#define USB_FS_EP0_MAX_LEN 64U /*!< maximum packet size of endpoint 0 */ +#define HC_MAX_PACKET_COUNT 140U /*!< maximum packet count */ + +#define EP_ID(x) ((uint8_t)((x) & 0x7FU)) /*!< endpoint number */ +#define EP_DIR(x) ((uint8_t)((x) >> 7)) /*!< endpoint direction */ + +enum _usb_mode { + DEVICE_MODE = 0U, /*!< device mode */ + HOST_MODE, /*!< host mode */ + OTG_MODE /*!< OTG mode */ +}; + +enum _usb_eptype { + USB_EPTYPE_CTRL = 0U, /*!< control endpoint type */ + USB_EPTYPE_ISOC = 1U, /*!< isochronous endpoint type */ + USB_EPTYPE_BULK = 2U, /*!< bulk endpoint type */ + USB_EPTYPE_INTR = 3U, /*!< interrupt endpoint type */ + USB_EPTYPE_MASK = 3U /*!< endpoint type mask */ +}; + +typedef enum +{ + USB_OTG_OK = 0U, /*!< USB OTG status OK*/ + USB_OTG_FAIL /*!< USB OTG status fail*/ +} usb_otg_status; + +typedef enum +{ + USB_OK = 0U, /*!< USB status OK*/ + USB_FAIL /*!< USB status fail*/ +} usb_status; + +typedef enum +{ + USB_USE_FIFO, /*!< USB use FIFO transfer mode */ +} usb_transfer_mode; + +typedef struct +{ + uint8_t core_enum; /*!< USB core type */ + uint8_t core_speed; /*!< USB core speed */ + uint8_t num_pipe; /*!< USB host channel numbers */ + uint8_t num_ep; /*!< USB device endpoint numbers */ + uint8_t transfer_mode; /*!< USB transfer mode */ + uint8_t phy_itf; /*!< USB core PHY interface */ + uint8_t sof_enable; /*!< USB SOF output */ + uint8_t low_power; /*!< USB low power */ + uint8_t lpm_enable; /*!< USB link power mode(LPM) */ + uint8_t vbus_sensing_enable; /*!< USB VBUS sensing feature */ + uint8_t use_dedicated_ep1; /*!< USB dedicated endpoint1 interrupt */ + uint8_t use_external_vbus; /*!< enable or disable the use of the external VBUS */ + uint32_t base_reg; /*!< base register address */ +} usb_core_basic; + +/* static inline function definitions */ + +/*! + \brief get the global interrupts + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval interrupt status +*/ +__STATIC_INLINE uint32_t usb_coreintr_get(usb_core_regs *usb_regs) +{ + uint32_t reg_data = usb_regs->gr->GINTEN; + + reg_data &= usb_regs->gr->GINTF; + + return reg_data; +} + +/*! + \brief set USB RX FIFO size + \param[in] usb_regs: pointer to USB core registers + \param[in] size: assigned FIFO size + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_set_rxfifo(usb_core_regs *usb_regs, uint16_t size) +{ + usb_regs->gr->GRFLEN = size; +} + +/*! + \brief enable the global interrupts + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_globalint_enable(usb_core_regs *usb_regs) +{ + /* enable USB global interrupt */ + usb_regs->gr->GAHBCS |= GAHBCS_GINTEN; +} + +/*! + \brief disable the global interrupts + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_globalint_disable(usb_core_regs *usb_regs) +{ + /* disable USB global interrupt */ + usb_regs->gr->GAHBCS &= ~GAHBCS_GINTEN; +} + +/* function declarations */ +/* configure core capabilities */ +usb_status usb_basic_init (usb_core_basic *usb_basic, usb_core_regs *usb_regs, usb_core_enum usb_core); +/* initializes the USB controller registers and prepares the core device mode or host mode operation */ +usb_status usb_core_init (usb_core_basic usb_basic, usb_core_regs *usb_regs); +/* write a packet into the TX FIFO associated with the endpoint */ +usb_status usb_txfifo_write (usb_core_regs *usb_regs, uint8_t *src_buf, uint8_t fifo_num, uint16_t byte_count); +/* read a packet from the RX FIFO associated with the endpoint */ +void *usb_rxfifo_read (usb_core_regs *usb_regs, uint8_t *dest_buf, uint16_t byte_count); +/* flush a TX FIFO or all TX FIFOs */ +usb_status usb_txfifo_flush (usb_core_regs *usb_regs, uint8_t fifo_num); +/* flush the entire RX FIFO */ +usb_status usb_rxfifo_flush (usb_core_regs *usb_regs); +/* set endpoint or channel TX FIFO size */ +void usb_set_txfifo(usb_core_regs *usb_regs, uint8_t fifo, uint16_t size); +/* set USB current mode */ +void usb_curmode_set(usb_core_regs *usb_regs, uint8_t mode); + +#endif /* __DRV_USB_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_dev.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_dev.h new file mode 100644 index 0000000..fb77eca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_dev.h @@ -0,0 +1,287 @@ +/*! + \file drv_usb_dev.h + \brief USB device low level driver header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USB_DEV_H +#define __DRV_USB_DEV_H + +#include "usbd_conf.h" +#include "drv_usb_core.h" + +enum usb_ctl_status +{ + USB_CTL_IDLE = 0U, /*!< USB control transfer idle state */ + USB_CTL_DATA_IN, /*!< USB control transfer data in state */ + USB_CTL_LAST_DATA_IN, /*!< USB control transfer last data in state */ + USB_CTL_DATA_OUT, /*!< USB control transfer data out state */ + USB_CTL_LAST_DATA_OUT, /*!< USB control transfer last data out state */ + USB_CTL_STATUS_IN, /*!< USB control transfer status in state*/ + USB_CTL_STATUS_OUT /*!< USB control transfer status out state */ +}; + +#define EP_IN(x) ((uint8_t)(0x80U | (x))) /*!< device IN endpoint */ +#define EP_OUT(x) ((uint8_t)(x)) /*!< device OUT endpoint */ + +/* USB descriptor */ +typedef struct _usb_desc +{ + uint8_t *dev_desc; /*!< device descriptor */ + uint8_t *config_desc; /*!< configure descriptor */ + uint8_t *bos_desc; /*!< BOS descriptor */ + + void* const *strings; /*!< string descriptor */ +} usb_desc; + +/* USB power management */ +typedef struct _usb_pm +{ + uint8_t power_mode; /*!< power mode */ + uint8_t power_low; /*!< power low */ + uint8_t dev_remote_wakeup; /*!< remote wakeup */ + uint8_t remote_wakeup_on; /*!< remote wakeup on */ +} usb_pm; + +/* USB control information */ +typedef struct _usb_control +{ + usb_req req; /*!< USB standard device request */ + uint8_t ctl_state; /*!< USB control transfer state */ + uint8_t ctl_zlp; /*!< zero length package */ +} usb_control; + +typedef struct +{ + struct + { + uint8_t num: 4; /*!< the endpoint number.it can be from 0 to 6 */ + uint8_t pad: 3; /*!< padding between number and direction */ + uint8_t dir: 1; /*!< the endpoint direction */ + } ep_addr; + uint8_t ep_type; /*!< USB endpoint type */ + uint8_t ep_stall; /*!< USB endpoint stall status */ + uint8_t frame_num; /*!< number of frame */ + uint16_t max_len; /*!< Maximum packet length */ + /* transaction level variables */ + uint8_t *xfer_buf; /*!< transmit buffer */ + uint32_t xfer_len; /*!< transmit buffer length */ + uint32_t xfer_count; /*!< transmit buffer count */ + uint32_t remain_len; /*!< remain packet length */ +} usb_transc; + +typedef struct _usb_core_driver usb_dev; + +typedef struct _usb_class_core +{ + uint8_t command; /*!< device class request command */ + uint8_t alter_set; /*!< alternative set */ + uint8_t (*init) (usb_dev *udev, uint8_t config_index); /*!< initialize handler */ + uint8_t (*deinit) (usb_dev *udev, uint8_t config_index); /*!< deinitialize handler */ + uint8_t (*req_proc) (usb_dev *udev, usb_req *req); /*!< device request handler */ + uint8_t (*set_intf) (usb_dev *udev, usb_req *req); /*!< device set interface callback */ + uint8_t (*ctlx_in) (usb_dev *udev); /*!< device contrl in callback */ + uint8_t (*ctlx_out) (usb_dev *udev); /*!< device contrl out callback */ + uint8_t (*data_in) (usb_dev *udev, uint8_t ep_num); /*!< device data in handler */ + uint8_t (*data_out) (usb_dev *udev, uint8_t ep_num); /*!< device data out handler */ + uint8_t (*SOF) (usb_dev *udev); /*!< start of frame handler */ + uint8_t (*incomplete_isoc_in) (usb_dev *udev); /*!< incomplete synchronization IN transfer handler */ + uint8_t (*incomplete_isoc_out) (usb_dev *udev); /*!< incomplete synchronization OUT transfer handler */ +} usb_class_core; + +typedef struct _usb_perp_dev +{ + uint8_t config; /*!< configuration */ + uint8_t dev_addr; /*!< device address */ + __IO uint8_t cur_status; /*!< current status */ + __IO uint8_t backup_status; /*!< backup status */ + usb_transc transc_in[USBFS_MAX_TX_FIFOS]; /*!< endpoint IN transaction */ + usb_transc transc_out[USBFS_MAX_TX_FIFOS]; /*!< endpoint OUT transaction */ + usb_pm pm; /*!< power management */ + usb_control control; /*!< USB control information */ + usb_desc *desc; /*!< USB descriptors pointer */ + usb_class_core *class_core; /*!< class driver */ + void *class_data[USBD_ITF_MAX_NUM]; /*!< class data pointer */ + void *user_data; /*!< user data pointer */ + void *pdata; /*!< reserved data pointer */ +} usb_perp_dev; + +typedef struct _usb_core_driver +{ + usb_core_basic bp; /*!< USB basic parameters */ + usb_core_regs regs; /*!< USB registers */ + usb_perp_dev dev; /*!< USB peripheral device */ +} usb_core_driver; + +/* static inline function definitions */ + +/*! + \brief configure the USB device to be disconnected + \param[in] udev: pointer to USB device + \param[out] none + \retval operation status +*/ +__STATIC_INLINE void usb_dev_disconnect (usb_core_driver *udev) +{ + udev->regs.dr->DCTL |= DCTL_SD; +} + +/*! + \brief configure the USB device to be connected + \param[in] udev: pointer to USB device + \param[out] none + \retval operation status +*/ +__STATIC_INLINE void usb_dev_connect (usb_core_driver *udev) +{ + udev->regs.dr->DCTL &= ~DCTL_SD; +} + +/*! + \brief set the USB device address + \param[in] udev: pointer to USB device + \param[in] dev_addr: device address for setting + \param[out] none + \retval operation status +*/ +__STATIC_INLINE void usb_devaddr_set (usb_core_driver *udev, uint8_t dev_addr) +{ + udev->regs.dr->DCFG &= ~DCFG_DAR; + udev->regs.dr->DCFG |= (uint32_t)dev_addr << 4U; +} + +/*! + \brief read device all OUT endpoint interrupt register + \param[in] udev: pointer to USB device + \param[out] none + \retval interrupt status +*/ +__STATIC_INLINE uint32_t usb_oepintnum_read (usb_core_driver *udev) +{ + uint32_t value = udev->regs.dr->DAEPINT; + + value &= udev->regs.dr->DAEPINTEN; + + return (value & DAEPINT_OEPITB) >> 16U; +} + +/*! + \brief read device OUT endpoint interrupt flag register + \param[in] udev: pointer to USB device + \param[in] ep_num: endpoint number + \param[out] none + \retval interrupt status +*/ +__STATIC_INLINE uint32_t usb_oepintr_read (usb_core_driver *udev, uint8_t ep_num) +{ + uint32_t value = udev->regs.er_out[ep_num]->DOEPINTF; + + value &= udev->regs.dr->DOEPINTEN; + + return value; +} + +/*! + \brief read device all IN endpoint interrupt register + \param[in] udev: pointer to USB device + \param[out] none + \retval interrupt status +*/ +__STATIC_INLINE uint32_t usb_iepintnum_read (usb_core_driver *udev) +{ + uint32_t value = udev->regs.dr->DAEPINT; + + value &= udev->regs.dr->DAEPINTEN; + + return value & DAEPINT_IEPITB; +} + +/*! + \brief set remote wakeup signaling + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_rwkup_set (usb_core_driver *udev) +{ + if (udev->dev.pm.dev_remote_wakeup) { + /* enable remote wakeup signaling */ + udev->regs.dr->DCTL |= DCTL_RWKUP; + } +} + +/*! + \brief reset remote wakeup signaling + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_rwkup_reset (usb_core_driver *udev) +{ + if (udev->dev.pm.dev_remote_wakeup) { + /* disable remote wakeup signaling */ + udev->regs.dr->DCTL &= ~DCTL_RWKUP; + } +} + +/* function declarations */ +/* initialize USB core registers for device mode */ +usb_status usb_devcore_init (usb_core_driver *udev); +/* enable the USB device mode interrupts */ +usb_status usb_devint_enable (usb_core_driver *udev); +/* active the USB endpoint 0 transaction */ +usb_status usb_transc0_active (usb_core_driver *udev, usb_transc *transc); +/* active the USB transaction */ +usb_status usb_transc_active (usb_core_driver *udev, usb_transc *transc); +/* deactivate the USB transaction */ +usb_status usb_transc_deactivate (usb_core_driver *udev, usb_transc *transc); +/* configure USB transaction to start IN transfer */ +usb_status usb_transc_inxfer (usb_core_driver *udev, usb_transc *transc); +/* configure USB transaction to start OUT transfer */ +usb_status usb_transc_outxfer (usb_core_driver *udev, usb_transc *transc); +/* set the USB transaction STALL status */ +usb_status usb_transc_stall (usb_core_driver *udev, usb_transc *transc); +/* clear the USB transaction STALL status */ +usb_status usb_transc_clrstall (usb_core_driver *udev, usb_transc *transc); +/* read device IN endpoint interrupt flag register */ +uint32_t usb_iepintr_read (usb_core_driver *udev, uint8_t ep_num); +/* configures OUT endpoint 0 to receive SETUP packets */ +void usb_ctlep_startout (usb_core_driver *udev); +/* active remote wakeup signaling */ +void usb_rwkup_active (usb_core_driver *udev); +/* active USB core clock */ +void usb_clock_active (usb_core_driver *udev); +/* USB device suspend */ +void usb_dev_suspend (usb_core_driver *udev); +/* stop the device and clean up FIFOs */ +void usb_dev_stop (usb_core_driver *udev); + +#endif /* __DRV_USB_DEV_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_host.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_host.h new file mode 100644 index 0000000..25ac2ec --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_host.h @@ -0,0 +1,194 @@ +/*! + \file drv_usb_host.h + \brief USB host mode low level driver header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USB_HOST_H +#define __DRV_USB_HOST_H + +#include "drv_usb_regs.h" +#include "usb_ch9_std.h" +#include "drv_usb_core.h" + +typedef enum _usb_pipe_status +{ + PIPE_IDLE = 0U, + PIPE_XF, + PIPE_HALTED, + PIPE_NAK, + PIPE_NYET, + PIPE_STALL, + PIPE_TRACERR, + PIPE_BBERR, + PIPE_REQOVR, + PIPE_DTGERR, +} usb_pipe_staus; + +typedef enum _usb_pipe_mode +{ + PIPE_PERIOD = 0U, + PIPE_NON_PERIOD = 1U +} usb_pipe_mode; + +typedef enum _usb_urb_state +{ + URB_IDLE = 0U, + URB_DONE, + URB_NOTREADY, + URB_ERROR, + URB_STALL, + URB_PING +} usb_urb_state; + +typedef struct _usb_pipe +{ + uint8_t in_used; + uint8_t dev_addr; + uint32_t dev_speed; + + struct + { + uint8_t num; + uint8_t dir; + uint8_t type; + uint16_t mps; + } ep; + + uint8_t ping; + uint32_t DPID; + + uint8_t *xfer_buf; + uint32_t xfer_len; + uint32_t xfer_count; + + uint8_t data_toggle_in; + uint8_t data_toggle_out; + + __IO uint32_t err_count; + __IO usb_pipe_staus pp_status; + __IO usb_urb_state urb_state; +} usb_pipe; + + +typedef struct _usb_host_drv +{ + __IO uint32_t connect_status; + __IO uint32_t port_enabled; + __IO uint32_t backup_xfercount[USBFS_MAX_TX_FIFOS]; + + usb_pipe pipe[USBFS_MAX_TX_FIFOS]; + void *data; +} usb_host_drv; + +typedef struct _usb_core_driver +{ + usb_core_basic bp; + usb_core_regs regs; + usb_host_drv host; +} usb_core_driver; + +/*! + \brief get USB even frame + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +__STATIC_INLINE uint8_t usb_frame_even (usb_core_driver *udev) +{ + return (uint8_t)!(udev->regs.hr->HFINFR & 0x01U); +} + +/*! + \brief configure USB clock of PHY + \param[in] udev: pointer to USB device + \param[in] clock: PHY clock + \param[out] none + \retval none +*/ +__STATIC_INLINE void usb_phyclock_config (usb_core_driver *udev, uint8_t clock) +{ + udev->regs.hr->HCTL &= ~HCTL_CLKSEL; + udev->regs.hr->HCTL |= clock; +} + +/*! + \brief read USB port + \param[in] udev: pointer to USB device + \param[out] none + \retval port status +*/ +__STATIC_INLINE uint32_t usb_port_read (usb_core_driver *udev) +{ + return *udev->regs.HPCS & ~(HPCS_PE | HPCS_PCD | HPCS_PEDC); +} + +/*! + \brief get USB current speed + \param[in] udev: pointer to USB device + \param[out] none + \retval USB current speed +*/ +__STATIC_INLINE uint32_t usb_curspeed_get (usb_core_driver *udev) +{ + return *udev->regs.HPCS & HPCS_PS; +} + +/*! + \brief get USB current frame + \param[in] udev: pointer to USB device + \param[out] none + \retval USB current frame +*/ +__STATIC_INLINE uint32_t usb_curframe_get (usb_core_driver *udev) +{ + return (udev->regs.hr->HFINFR & 0xFFFFU); +} + +/* function declarations */ +/* initializes USB core for host mode */ +usb_status usb_host_init (usb_core_driver *udev); +/* control the VBUS to power */ +void usb_portvbus_switch (usb_core_driver *udev, uint8_t state); +/* reset host port */ +uint32_t usb_port_reset (usb_core_driver *udev); +/* initialize host pipe */ +usb_status usb_pipe_init (usb_core_driver *udev, uint8_t pipe_num); +/* prepare host pipe for transferring packets */ +usb_status usb_pipe_xfer (usb_core_driver *udev, uint8_t pipe_num); +/* halt host pipe */ +usb_status usb_pipe_halt (usb_core_driver *udev, uint8_t pipe_num); +/* configure host pipe to do ping operation */ +usb_status usb_pipe_ping (usb_core_driver *udev, uint8_t pipe_num); +/* stop the USB host and clean up FIFO */ +void usb_host_stop (usb_core_driver *udev); + +#endif /* __DRV_USB_HOST_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_hw.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_hw.h new file mode 100644 index 0000000..9f45ba9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_hw.h @@ -0,0 +1,67 @@ +/*! + \file drv_usb_hw.h + \brief USB hardware configuration header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USB_HW_H +#define __DRV_USB_HW_H + +#include "usb_conf.h" + +/* function declarations */ +/* configure USB clock */ +void usb_rcu_config (void); +/* configure USB interrupt */ +void usb_intr_config (void); +/* initializes delay unit using Timer2 */ +void usb_timer_init (void); +/* delay in micro seconds */ +void usb_udelay (const uint32_t usec); +/* delay in milliseconds */ +void usb_mdelay (const uint32_t msec); +/* configures system clock after wakeup from STOP mode */ +void system_clk_config_stop(void); + +/* configure the CTC peripheral */ +#ifdef USE_IRC48M + void ctc_config(void); +#endif /* USE_IRC48M */ + +#ifdef USE_HOST_MODE + void systick_config(void); + /* configure USB VBus */ + void usb_vbus_config (void); + /* drive USB VBus */ + void usb_vbus_drive (uint8_t State); +#endif /* USE_HOST_MODE */ + +#endif /* __DRV_USB_HW_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_regs.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_regs.h new file mode 100644 index 0000000..43b42dc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usb_regs.h @@ -0,0 +1,629 @@ +/*! + \file drv_usb_regs.h + \brief USB cell registers definition and handle macros + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USB_REGS_H +#define __DRV_USB_REGS_H + +#include "usb_conf.h" + +#define USBHS_REG_BASE 0x40040000L /*!< base address of USBHS registers */ +#define USBFS_REG_BASE 0x50000000L /*!< base address of USBFS registers */ + +#define USBFS_MAX_TX_FIFOS 15U /*!< FIFO number */ + +#define USBFS_MAX_PACKET_SIZE 64U /*!< USBFS max packet size */ +#define USBFS_MAX_CHANNEL_COUNT 8U /*!< USBFS host channel count */ +#define USBFS_MAX_EP_COUNT 4U /*!< USBFS device endpoint count */ +#define USBFS_MAX_FIFO_WORDLEN 320U /*!< USBFS max fifo size in words */ + +#define USB_DATA_FIFO_OFFSET 0x1000U /*!< USB data fifo offset */ +#define USB_DATA_FIFO_SIZE 0x1000U /*!< USB data fifo size */ + +typedef enum +{ + USB_CORE_ENUM_HS = 0, /*!< USB core type is HS */ + USB_CORE_ENUM_FS = 1 /*!< USB core type is FS */ +} usb_core_enum; + +enum USB_SPEED +{ + USB_SPEED_UNKNOWN = 0, /*!< USB speed unknown */ + USB_SPEED_LOW, /*!< USB speed low */ + USB_SPEED_FULL, /*!< USB speed full */ + USB_SPEED_HIGH, /*!< USB speed high */ +}; + +enum usb_reg_offset +{ + USB_REG_OFFSET_CORE = 0x0000U, /*!< global OTG control and status register */ + USB_REG_OFFSET_DEV = 0x0800U, /*!< device mode control and status registers */ + USB_REG_OFFSET_EP = 0x0020U, + USB_REG_OFFSET_EP_IN = 0x0900U, /*!< device IN endpoint 0 control register */ + USB_REG_OFFSET_EP_OUT = 0x0B00U, /*!< device OUT endpoint 0 control register */ + USB_REG_OFFSET_HOST = 0x0400U, /*!< host control register */ + USB_REG_OFFSET_CH = 0x0020U, + USB_REG_OFFSET_PORT = 0x0440U, /*!< host port control and status register */ + USB_REG_OFFSET_CH_INOUT = 0x0500U, /*!< Host channel-x control registers */ + USB_REG_OFFSET_PWRCLKCTL = 0x0E00U, /*!< power and clock register */ +}; + +typedef struct +{ + __IO uint32_t GOTGCS; /*!< USB global OTG control and status register 000h */ + __IO uint32_t GOTGINTF; /*!< USB global OTG interrupt flag register 004h */ + __IO uint32_t GAHBCS; /*!< USB global AHB control and status register 008h */ + __IO uint32_t GUSBCS; /*!< USB global USB control and status register 00Ch */ + __IO uint32_t GRSTCTL; /*!< USB global reset control register 010h */ + __IO uint32_t GINTF; /*!< USB global interrupt flag register 014h */ + __IO uint32_t GINTEN; /*!< USB global interrupt enable register 018h */ + __IO uint32_t GRSTATR; /*!< USB receive status debug read register 01Ch */ + __IO uint32_t GRSTATP; /*!< USB receive status and pop register 020h */ + __IO uint32_t GRFLEN; /*!< USB global receive FIFO length register 024h */ + __IO uint32_t DIEP0TFLEN_HNPTFLEN; /*!< USB device IN endpoint 0/host non-periodic transmit FIFO length register 028h */ + __IO uint32_t HNPTFQSTAT; /*!< USB host non-periodic FIFO/queue status register 02Ch */ + uint32_t Reserved30[2]; /*!< Reserved 030h */ + __IO uint32_t GCCFG; /*!< USB global core configuration register 038h */ + __IO uint32_t CID; /*!< USB core ID register 03Ch */ + uint32_t Reserved40[48]; /*!< Reserved 040h-0FFh */ + __IO uint32_t HPTFLEN; /*!< USB host periodic transmit FIFO length register 100h */ + __IO uint32_t DIEPTFLEN[15]; /*!< USB device IN endpoint transmit FIFO length register 104h */ +} usb_gr; + +typedef struct +{ + __IO uint32_t HCTL; /*!< USB host control register 400h */ + __IO uint32_t HFT; /*!< USB host frame interval register 404h */ + __IO uint32_t HFINFR; /*!< USB host frame information remaining register 408h */ + uint32_t Reserved40C; /*!< Reserved 40Ch */ + __IO uint32_t HPTFQSTAT; /*!< USB host periodic transmit FIFO/queue status register 410h */ + __IO uint32_t HACHINT; /*!< USB host all channels interrupt register 414h */ + __IO uint32_t HACHINTEN; /*!< USB host all channels interrupt enable register 418h */ +} usb_hr; + +typedef struct +{ + __IO uint32_t HCHCTL; /*!< USB host channel control register 500h */ + __IO uint32_t HCHSTCTL; /*!< Reserved 504h */ + __IO uint32_t HCHINTF; /*!< USB host channel interrupt flag register 508h */ + __IO uint32_t HCHINTEN; /*!< USB host channel interrupt enable register 50Ch */ + __IO uint32_t HCHLEN; /*!< USB host channel transfer length register 510h */ + uint32_t Reserved514; /*!< Reserved 514h*/ + uint32_t Reserved[2]; +} usb_pr; + +typedef struct +{ + __IO uint32_t DCFG; /*!< USB device configuration register 800h */ + __IO uint32_t DCTL; /*!< USB device control register 804h */ + __IO uint32_t DSTAT; /*!< USB device status register 808h */ + uint32_t Reserved0C; /*!< Reserved 80Ch */ + __IO uint32_t DIEPINTEN; /*!< USB device IN endpoint common interrupt enable register 810h */ + __IO uint32_t DOEPINTEN; /*!< USB device OUT endpoint common interrupt enable register 814h */ + __IO uint32_t DAEPINT; /*!< USB device all endpoints interrupt register 818h */ + __IO uint32_t DAEPINTEN; /*!< USB device all endpoints interrupt enable register 81Ch */ + uint32_t Reserved20; /*!< Reserved 820h */ + uint32_t Reserved24; /*!< Reserved 824h */ + __IO uint32_t DVBUSDT; /*!< USB device VBUS discharge time register 828h */ + __IO uint32_t DVBUSPT; /*!< USB device VBUS pulsing time register 82Ch */ + __IO uint32_t DTHRCTL; /*!< device threshold control 830h */ + __IO uint32_t DIEPFEINTEN; /*!< USB Device IN endpoint FIFO empty interrupt enable register 834h */ + __IO uint32_t DEP1INT; /*!< USB device endpoint 1 interrupt register 838h */ + __IO uint32_t DEP1INTEN; /*!< USB device endpoint 1 interrupt enable register 83Ch */ + uint32_t Reserved40; /*!< Reserved 840h */ + __IO uint32_t DIEP1INTEN; /*!< USB device IN endpoint-1 interrupt enable register 844h */ + uint32_t Reserved48[15]; /*!< Reserved 848-880h */ + __IO uint32_t DOEP1INTEN; /*!< USB device OUT endpoint-1 interrupt enable register 884h */ +} usb_dr; + +typedef struct +{ + __IO uint32_t DIEPCTL; /*!< USB device IN endpoint control register 900h + (EpNum * 20h) + 00h */ + uint32_t Reserved04; /*!< Reserved 900h + (EpNum * 20h) + 04h */ + __IO uint32_t DIEPINTF; /*!< USB device IN endpoint interrupt flag register 900h + (EpNum * 20h) + 08h */ + uint32_t Reserved0C; /*!< Reserved 900h + (EpNum * 20h) + 0Ch */ + __IO uint32_t DIEPLEN; /*!< USB device IN endpoint transfer length register 900h + (EpNum * 20h) + 10h */ + uint32_t Reserved; /*!< Reserved 900h + (EpNum * 20h) + 14h */ + __IO uint32_t DIEPTFSTAT; /*!< USB device IN endpoint transmit FIFO status register 900h + (EpNum * 20h) + 18h */ +} usb_erin; + +typedef struct +{ + __IO uint32_t DOEPCTL; /*!< USB device IN endpoint control register B00h + (EpNum * 20h) + 00h */ + uint32_t Reserved04; /*!< Reserved B00h + (EpNum * 20h) + 04h */ + __IO uint32_t DOEPINTF; /*!< USB device IN endpoint interrupt flag register B00h + (EpNum * 20h) + 08h */ + uint32_t Reserved0C; /*!< Reserved B00h + (EpNum * 20h) + 0Ch */ + __IO uint32_t DOEPLEN; /*!< USB device IN endpoint transfer length register B00h + (EpNum * 20h) + 10h */ + uint32_t Reserved; /*!< Reserved B00h + (EpNum * 20h) + 0Ch */ +} usb_erout; + +typedef struct _usb_regs +{ + usb_gr *gr; /*!< USBFS global registers */ + usb_dr *dr; /*!< Device control and status registers */ + usb_hr *hr; /*!< Host control and status registers */ + usb_erin *er_in[6]; /*!< USB device IN endpoint register */ + usb_erout *er_out[6]; /*!< USB device OUT endpoint register */ + usb_pr *pr[15]; /*!< USB Host channel-x control register */ + + __IO uint32_t *HPCS; /*!< USB host port control and status register */ + __IO uint32_t *DFIFO[USBFS_MAX_TX_FIFOS]; + __IO uint32_t *PWRCLKCTL; /*!< USB power and clock control register */ +} usb_core_regs; + +/* global OTG control and status register bits definitions */ +#define GOTGCS_BSV BIT(19) /*!< B-Session Valid */ +#define GOTGCS_ASV BIT(18) /*!< A-session valid */ +#define GOTGCS_DI BIT(17) /*!< debounce interval */ +#define GOTGCS_CIDPS BIT(16) /*!< id pin status */ +#define GOTGCS_DHNPEN BIT(11) /*!< device HNP enable */ +#define GOTGCS_HHNPEN BIT(10) /*!< host HNP enable */ +#define GOTGCS_HNPREQ BIT(9) /*!< HNP request */ +#define GOTGCS_HNPS BIT(8) /*!< HNP successes */ +#define GOTGCS_SRPREQ BIT(1) /*!< SRP request */ +#define GOTGCS_SRPS BIT(0) /*!< SRP successes */ + +/* global OTG interrupt flag register bits definitions */ +#define GOTGINTF_DF BIT(19) /*!< debounce finish */ +#define GOTGINTF_ADTO BIT(18) /*!< A-device timeout */ +#define GOTGINTF_HNPDET BIT(17) /*!< host negotiation request detected */ +#define GOTGINTF_HNPEND BIT(9) /*!< HNP end */ +#define GOTGINTF_SRPEND BIT(8) /*!< SRP end */ +#define GOTGINTF_SESEND BIT(2) /*!< session end */ + +/* global AHB control and status register bits definitions */ +#define GAHBCS_PTXFTH BIT(8) /*!< periodic Tx FIFO threshold */ +#define GAHBCS_TXFTH BIT(7) /*!< tx FIFO threshold */ +#define GAHBCS_GINTEN BIT(0) /*!< global interrupt enable */ + +/* global USB control and status register bits definitions */ +#define GUSBCS_FDM BIT(30) /*!< force device mode */ +#define GUSBCS_FHM BIT(29) /*!< force host mode */ +#define GUSBCS_ULPIEOI BIT(21) /*!< ULPI external over-current indicator */ +#define GUSBCS_ULPIEVD BIT(20) /*!< ULPI external VBUS driver */ +#define GUSBCS_UTT BITS(10, 13) /*!< USB turnaround time */ +#define GUSBCS_HNPCEN BIT(9) /*!< HNP capability enable */ +#define GUSBCS_SRPCEN BIT(8) /*!< SRP capability enable */ +#define GUSBCS_EMBPHY BIT(6) /*!< embedded PHY selected */ +#define GUSBCS_TOC BITS(0, 2) /*!< timeout calibration */ + +/* global reset control register bits definitions */ +#define GRSTCTL_TXFNUM BITS(6, 10) /*!< tx FIFO number */ +#define GRSTCTL_TXFF BIT(5) /*!< tx FIFO flush */ +#define GRSTCTL_RXFF BIT(4) /*!< rx FIFO flush */ +#define GRSTCTL_HFCRST BIT(2) /*!< host frame counter reset */ +#define GRSTCTL_HCSRST BIT(1) /*!< HCLK soft reset */ +#define GRSTCTL_CSRST BIT(0) /*!< core soft reset */ + +/* global interrupt flag register bits definitions */ +#define GINTF_WKUPIF BIT(31) /*!< wakeup interrupt flag */ +#define GINTF_SESIF BIT(30) /*!< session interrupt flag */ +#define GINTF_DISCIF BIT(29) /*!< disconnect interrupt flag */ +#define GINTF_IDPSC BIT(28) /*!< id pin status change */ +#define GINTF_PTXFEIF BIT(26) /*!< periodic tx FIFO empty interrupt flag */ +#define GINTF_HCIF BIT(25) /*!< host channels interrupt flag */ +#define GINTF_HPIF BIT(24) /*!< host port interrupt flag */ +#define GINTF_PXNCIF BIT(21) /*!< periodic transfer not complete interrupt flag */ +#define GINTF_ISOONCIF BIT(21) /*!< isochronous OUT transfer not complete interrupt flag */ +#define GINTF_ISOINCIF BIT(20) /*!< isochronous IN transfer not complete interrupt flag */ +#define GINTF_OEPIF BIT(19) /*!< OUT endpoint interrupt flag */ +#define GINTF_IEPIF BIT(18) /*!< IN endpoint interrupt flag */ +#define GINTF_EOPFIF BIT(15) /*!< end of periodic frame interrupt flag */ +#define GINTF_ISOOPDIF BIT(14) /*!< isochronous OUT packet dropped interrupt flag */ +#define GINTF_ENUMFIF BIT(13) /*!< enumeration finished */ +#define GINTF_RST BIT(12) /*!< USB reset */ +#define GINTF_SP BIT(11) /*!< USB suspend */ +#define GINTF_ESP BIT(10) /*!< early suspend */ +#define GINTF_GONAK BIT(7) /*!< global OUT NAK effective */ +#define GINTF_GNPINAK BIT(6) /*!< global IN non-periodic NAK effective */ +#define GINTF_NPTXFEIF BIT(5) /*!< non-periodic tx FIFO empty interrupt flag */ +#define GINTF_RXFNEIF BIT(4) /*!< rx FIFO non-empty interrupt flag */ +#define GINTF_SOF BIT(3) /*!< start of frame */ +#define GINTF_OTGIF BIT(2) /*!< OTG interrupt flag */ +#define GINTF_MFIF BIT(1) /*!< mode fault interrupt flag */ +#define GINTF_COPM BIT(0) /*!< current operation mode */ + +/* global interrupt enable register bits definitions */ +#define GINTEN_WKUPIE BIT(31) /*!< wakeup interrupt enable */ +#define GINTEN_SESIE BIT(30) /*!< session interrupt enable */ +#define GINTEN_DISCIE BIT(29) /*!< disconnect interrupt enable */ +#define GINTEN_IDPSCIE BIT(28) /*!< id pin status change interrupt enable */ +#define GINTEN_PTXFEIE BIT(26) /*!< periodic tx FIFO empty interrupt enable */ +#define GINTEN_HCIE BIT(25) /*!< host channels interrupt enable */ +#define GINTEN_HPIE BIT(24) /*!< host port interrupt enable */ +#define GINTEN_IPXIE BIT(21) /*!< periodic transfer not complete interrupt enable */ +#define GINTEN_ISOONCIE BIT(21) /*!< isochronous OUT transfer not complete interrupt enable */ +#define GINTEN_ISOINCIE BIT(20) /*!< isochronous IN transfer not complete interrupt enable */ +#define GINTEN_OEPIE BIT(19) /*!< OUT endpoints interrupt enable */ +#define GINTEN_IEPIE BIT(18) /*!< IN endpoints interrupt enable */ +#define GINTEN_EOPFIE BIT(15) /*!< end of periodic frame interrupt enable */ +#define GINTEN_ISOOPDIE BIT(14) /*!< isochronous OUT packet dropped interrupt enable */ +#define GINTEN_ENUMFIE BIT(13) /*!< enumeration finish enable */ +#define GINTEN_RSTIE BIT(12) /*!< USB reset interrupt enable */ +#define GINTEN_SPIE BIT(11) /*!< USB suspend interrupt enable */ +#define GINTEN_ESPIE BIT(10) /*!< early suspend interrupt enable */ +#define GINTEN_GONAKIE BIT(7) /*!< global OUT NAK effective interrupt enable */ +#define GINTEN_GNPINAKIE BIT(6) /*!< global non-periodic IN NAK effective interrupt enable */ +#define GINTEN_NPTXFEIE BIT(5) /*!< non-periodic Tx FIFO empty interrupt enable */ +#define GINTEN_RXFNEIE BIT(4) /*!< receive FIFO non-empty interrupt enable */ +#define GINTEN_SOFIE BIT(3) /*!< start of frame interrupt enable */ +#define GINTEN_OTGIE BIT(2) /*!< OTG interrupt enable */ +#define GINTEN_MFIE BIT(1) /*!< mode fault interrupt enable */ + +/* global receive status read and pop register bits definitions */ +#define GRSTATRP_RPCKST BITS(17, 20) /*!< received packet status */ +#define GRSTATRP_DPID BITS(15, 16) /*!< data PID */ +#define GRSTATRP_BCOUNT BITS(4, 14) /*!< byte count */ +#define GRSTATRP_CNUM BITS(0, 3) /*!< channel number */ +#define GRSTATRP_EPNUM BITS(0, 3) /*!< endpoint number */ + +/* global receive FIFO length register bits definitions */ +#define GRFLEN_RXFD BITS(0, 15) /*!< rx FIFO depth */ + +/* host non-periodic transmit FIFO length register bits definitions */ +#define HNPTFLEN_HNPTXFD BITS(16, 31) /*!< non-periodic Tx FIFO depth */ +#define HNPTFLEN_HNPTXRSAR BITS(0, 15) /*!< non-periodic Tx RAM start address */ + +/* USB IN endpoint 0 transmit FIFO length register bits definitions */ +#define DIEP0TFLEN_IEP0TXFD BITS(16, 31) /*!< IN Endpoint 0 Tx FIFO depth */ +#define DIEP0TFLEN_IEP0TXRSAR BITS(0, 15) /*!< IN Endpoint 0 TX RAM start address */ + +/* host non-periodic transmit FIFO/queue status register bits definitions */ +#define HNPTFQSTAT_NPTXRQTOP BITS(24, 30) /*!< top entry of the non-periodic Tx request queue */ +#define HNPTFQSTAT_NPTXRQS BITS(16, 23) /*!< non-periodic Tx request queue space */ +#define HNPTFQSTAT_NPTXFS BITS(0, 15) /*!< non-periodic Tx FIFO space */ +#define HNPTFQSTAT_CNUM BITS(27, 30) /*!< channel number*/ +#define HNPTFQSTAT_EPNUM BITS(27, 30) /*!< endpoint number */ +#define HNPTFQSTAT_TYPE BITS(25, 26) /*!< token type */ +#define HNPTFQSTAT_TMF BIT(24) /*!< terminate flag */ + +/* global core configuration register bits definitions */ +#define GCCFG_SOFOEN BIT(20) /*!< SOF output enable */ +#define GCCFG_VBUSBCEN BIT(19) /*!< the VBUS B-device comparer enable */ +#define GCCFG_VBUSACEN BIT(18) /*!< the VBUS A-device comparer enable */ +#define GCCFG_PWRON BIT(16) /*!< power on */ + +/* core ID register bits definitions */ +#define CID_CID BITS(0, 31) /*!< core ID */ + +/* host periodic transmit FIFO length register bits definitions */ +#define HPTFLEN_HPTXFD BITS(16, 31) /*!< host periodic Tx FIFO depth */ +#define HPTFLEN_HPTXFSAR BITS(0, 15) /*!< host periodic Tx RAM start address */ + +/* device IN endpoint transmit FIFO length register bits definitions */ +#define DIEPTFLEN_IEPTXFD BITS(16, 31) /*!< IN endpoint Tx FIFO x depth */ +#define DIEPTFLEN_IEPTXRSAR BITS(0, 15) /*!< IN endpoint FIFOx Tx x RAM start address */ + +/* host control register bits definitions */ +#define HCTL_SPDFSLS BIT(2) /*!< speed limited to FS and LS */ +#define HCTL_CLKSEL BITS(0, 1) /*!< clock select for USB clock */ + +/* host frame interval register bits definitions */ +#define HFT_FRI BITS(0, 15) /*!< frame interval */ + +/* host frame information remaining register bits definitions */ +#define HFINFR_FRT BITS(16, 31) /*!< frame remaining time */ +#define HFINFR_FRNUM BITS(0, 15) /*!< frame number */ + +/* host periodic transmit FIFO/queue status register bits definitions */ +#define HPTFQSTAT_PTXREQT BITS(24, 31) /*!< top entry of the periodic Tx request queue */ +#define HPTFQSTAT_PTXREQS BITS(16, 23) /*!< periodic Tx request queue space */ +#define HPTFQSTAT_PTXFS BITS(0, 15) /*!< periodic Tx FIFO space */ +#define HPTFQSTAT_OEFRM BIT(31) /*!< odd/eveb frame */ +#define HPTFQSTAT_CNUM BITS(27, 30) /*!< channel number */ +#define HPTFQSTAT_EPNUM BITS(27, 30) /*!< endpoint number */ +#define HPTFQSTAT_TYPE BITS(25, 26) /*!< token type */ +#define HPTFQSTAT_TMF BIT(24) /*!< terminate flag */ + +#define TFQSTAT_TXFS BITS(0, 15) +#define TFQSTAT_CNUM BITS(27, 30) + +/* host all channels interrupt register bits definitions */ +#define HACHINT_HACHINT BITS(0, 11) /*!< host all channel interrupts */ + +/* host all channels interrupt enable register bits definitions */ +#define HACHINTEN_CINTEN BITS(0, 11) /*!< channel interrupt enable */ + +/* host port control and status register bits definitions */ +#define HPCS_PS BITS(17, 18) /*!< port speed */ +#define HPCS_PP BIT(12) /*!< port power */ +#define HPCS_PLST BITS(10, 11) /*!< port line status */ +#define HPCS_PRST BIT(8) /*!< port reset */ +#define HPCS_PSP BIT(7) /*!< port suspend */ +#define HPCS_PREM BIT(6) /*!< port resume */ +#define HPCS_PEDC BIT(3) /*!< port enable/disable change */ +#define HPCS_PE BIT(2) /*!< port enable */ +#define HPCS_PCD BIT(1) /*!< port connect detected */ +#define HPCS_PCST BIT(0) /*!< port connect status */ + +/* host channel-x control register bits definitions */ +#define HCHCTL_CEN BIT(31) /*!< channel enable */ +#define HCHCTL_CDIS BIT(30) /*!< channel disable */ +#define HCHCTL_ODDFRM BIT(29) /*!< odd frame */ +#define HCHCTL_DAR BITS(22, 28) /*!< device address */ +#define HCHCTL_MPC BITS(20, 21) /*!< multiple packet count */ +#define HCHCTL_EPTYPE BITS(18, 19) /*!< endpoint type */ +#define HCHCTL_LSD BIT(17) /*!< low-speed device */ +#define HCHCTL_EPDIR BIT(15) /*!< endpoint direction */ +#define HCHCTL_EPNUM BITS(11, 14) /*!< endpoint number */ +#define HCHCTL_MPL BITS(0, 10) /*!< maximum packet length */ + +/* host channel-x split transaction register bits definitions */ +#define HCHSTCTL_SPLEN BIT(31) /*!< enable high-speed split transaction */ +#define HCHSTCTL_CSPLT BIT(16) /*!< complete-split enable */ +#define HCHSTCTL_ISOPCE BITS(14, 15) /*!< isochronous OUT payload continuation encoding */ +#define HCHSTCTL_HADDR BITS(7, 13) /*!< HUB address */ +#define HCHSTCTL_PADDR BITS(0, 6) /*!< port address */ + +/* host channel-x interrupt flag register bits definitions */ +#define HCHINTF_DTER BIT(10) /*!< data toggle error */ +#define HCHINTF_REQOVR BIT(9) /*!< request queue overrun */ +#define HCHINTF_BBER BIT(8) /*!< babble error */ +#define HCHINTF_USBER BIT(7) /*!< USB bus Error */ +#define HCHINTF_NYET BIT(6) /*!< NYET */ +#define HCHINTF_ACK BIT(5) /*!< ACK */ +#define HCHINTF_NAK BIT(4) /*!< NAK */ +#define HCHINTF_STALL BIT(3) /*!< STALL */ +#define HCHINTF_CH BIT(1) /*!< channel halted */ +#define HCHINTF_TF BIT(0) /*!< transfer finished */ + +/* host channel-x interrupt enable register bits definitions */ +#define HCHINTEN_DTERIE BIT(10) /*!< data toggle error interrupt enable */ +#define HCHINTEN_REQOVRIE BIT(9) /*!< request queue overrun interrupt enable */ +#define HCHINTEN_BBERIE BIT(8) /*!< babble error interrupt enable */ +#define HCHINTEN_USBERIE BIT(7) /*!< USB bus error interrupt enable */ +#define HCHINTEN_NYETIE BIT(6) /*!< NYET interrupt enable */ +#define HCHINTEN_ACKIE BIT(5) /*!< ACK interrupt enable */ +#define HCHINTEN_NAKIE BIT(4) /*!< NAK interrupt enable */ +#define HCHINTEN_STALLIE BIT(3) /*!< STALL interrupt enable */ +#define HCHINTEN_CHIE BIT(1) /*!< channel halted interrupt enable */ +#define HCHINTEN_TFIE BIT(0) /*!< transfer finished interrupt enable */ + +/* host channel-x transfer length register bits definitions */ +#define HCHLEN_PING BIT(31) /*!< PING token request */ +#define HCHLEN_DPID BITS(29, 30) /*!< data PID */ +#define HCHLEN_PCNT BITS(19, 28) /*!< packet count */ +#define HCHLEN_TLEN BITS(0, 18) /*!< transfer length */ + +#define PORT_SPEED(x) (((uint32_t)(x) << 17) & HPCS_PS) /*!< Port speed */ + +#define PORT_SPEED_HIGH PORT_SPEED(0U) /*!< high speed */ +#define PORT_SPEED_FULL PORT_SPEED(1U) /*!< full speed */ +#define PORT_SPEED_LOW PORT_SPEED(2U) /*!< low speed */ + +#define PIPE_CTL_DAR(x) (((uint32_t)(x) << 22) & HCHCTL_DAR) /*!< device address */ +#define PIPE_CTL_EPTYPE(x) (((uint32_t)(x) << 18) & HCHCTL_EPTYPE) /*!< endpoint type */ +#define PIPE_CTL_EPNUM(x) (((uint32_t)(x) << 11) & HCHCTL_EPNUM) /*!< endpoint number */ +#define PIPE_CTL_EPDIR(x) (((uint32_t)(x) << 15) & HCHCTL_EPDIR) /*!< endpoint direction */ +#define PIPE_CTL_EPMPL(x) (((uint32_t)(x) << 0) & HCHCTL_MPL) /*!< maximum packet length */ +#define PIPE_CTL_LSD(x) (((uint32_t)(x) << 17) & HCHCTL_LSD) /*!< low-Speed device */ + +#define PIPE_XFER_PCNT(x) (((uint32_t)(x) << 19) & HCHLEN_PCNT) /*!< packet count */ +#define PIPE_XFER_DPID(x) (((uint32_t)(x) << 29) & HCHLEN_DPID) /*!< data PID */ + +#define PIPE_DPID_DATA0 PIPE_XFER_DPID(0) /*!< DATA0 */ +#define PIPE_DPID_DATA1 PIPE_XFER_DPID(2) /*!< DATA1 */ +#define PIPE_DPID_DATA2 PIPE_XFER_DPID(1) /*!< DATA2 */ +#define PIPE_DPID_SETUP PIPE_XFER_DPID(3) /*!< MDATA (non-control)/SETUP (control) */ + +extern const uint32_t PIPE_DPID[2]; + +/* device configuration registers bits definitions */ +#define DCFG_EOPFT BITS(11, 12) /*!< end of periodic frame time */ +#define DCFG_DAR BITS(4, 10) /*!< device address */ +#define DCFG_NZLSOH BIT(2) /*!< non-zero-length status OUT handshake */ +#define DCFG_DS BITS(0, 1) /*!< device speed */ + +/* device control registers bits definitions */ +#define DCTL_POIF BIT(11) /*!< power-on initialization finished */ +#define DCTL_CGONAK BIT(10) /*!< clear global OUT NAK */ +#define DCTL_SGONAK BIT(9) /*!< set global OUT NAK */ +#define DCTL_CGINAK BIT(8) /*!< clear global IN NAK */ +#define DCTL_SGINAK BIT(7) /*!< set global IN NAK */ +#define DCTL_GONS BIT(3) /*!< global OUT NAK status */ +#define DCTL_GINS BIT(2) /*!< global IN NAK status */ +#define DCTL_SD BIT(1) /*!< soft disconnect */ +#define DCTL_RWKUP BIT(0) /*!< remote wakeup */ + +/* device status registers bits definitions */ +#define DSTAT_FNRSOF BITS(8, 21) /*!< the frame number of the received SOF. */ +#define DSTAT_ES BITS(1, 2) /*!< enumerated speed */ +#define DSTAT_SPST BIT(0) /*!< suspend status */ + +/* device IN endpoint common interrupt enable registers bits definitions */ +#define DIEPINTEN_NAKEN BIT(13) /*!< NAK handshake sent by USBHS interrupt enable bit */ +#define DIEPINTEN_TXFEEN BIT(7) /*!< transmit FIFO empty interrupt enable bit */ +#define DIEPINTEN_IEPNEEN BIT(6) /*!< IN endpoint NAK effective interrupt enable bit */ +#define DIEPINTEN_EPTXFUDEN BIT(4) /*!< endpoint Tx FIFO underrun interrupt enable bit */ +#define DIEPINTEN_CITOEN BIT(3) /*!< control In Timeout interrupt enable bit */ +#define DIEPINTEN_EPDISEN BIT(1) /*!< endpoint disabled interrupt enable bit */ +#define DIEPINTEN_TFEN BIT(0) /*!< transfer finished interrupt enable bit */ + +/* device OUT endpoint common interrupt enable registers bits definitions */ +#define DOEPINTEN_NYETEN BIT(14) /*!< NYET handshake is sent interrupt enable bit */ +#define DOEPINTEN_BTBSTPEN BIT(6) /*!< back-to-back SETUP packets interrupt enable bit */ +#define DOEPINTEN_EPRXFOVREN BIT(4) /*!< endpoint Rx FIFO overrun interrupt enable bit */ +#define DOEPINTEN_STPFEN BIT(3) /*!< SETUP phase finished interrupt enable bit */ +#define DOEPINTEN_EPDISEN BIT(1) /*!< endpoint disabled interrupt enable bit */ +#define DOEPINTEN_TFEN BIT(0) /*!< transfer finished interrupt enable bit */ + +/* device all endpoints interrupt registers bits definitions */ +#define DAEPINT_OEPITB BITS(16, 21) /*!< device all OUT endpoint interrupt bits */ +#define DAEPINT_IEPITB BITS(0, 5) /*!< device all IN endpoint interrupt bits */ + +/* device all endpoints interrupt enable registers bits definitions */ +#define DAEPINTEN_OEPIE BITS(16, 21) /*!< OUT endpoint interrupt enable */ +#define DAEPINTEN_IEPIE BITS(0, 3) /*!< IN endpoint interrupt enable */ + +/* device Vbus discharge time registers bits definitions */ +#define DVBUSDT_DVBUSDT BITS(0, 15) /*!< device VBUS discharge time */ + +/* device Vbus pulsing time registers bits definitions */ +#define DVBUSPT_DVBUSPT BITS(0, 11) /*!< device VBUS pulsing time */ + +/* device IN endpoint FIFO empty interrupt enable register bits definitions */ +#define DIEPFEINTEN_IEPTXFEIE BITS(0, 5) /*!< IN endpoint Tx FIFO empty interrupt enable bits */ + +/* device endpoint 0 control register bits definitions */ +#define DEP0CTL_EPEN BIT(31) /*!< endpoint enable */ +#define DEP0CTL_EPD BIT(30) /*!< endpoint disable */ +#define DEP0CTL_SNAK BIT(27) /*!< set NAK */ +#define DEP0CTL_CNAK BIT(26) /*!< clear NAK */ +#define DIEP0CTL_TXFNUM BITS(22, 25) /*!< tx FIFO number */ +#define DEP0CTL_STALL BIT(21) /*!< STALL handshake */ +#define DOEP0CTL_SNOOP BIT(20) /*!< snoop mode */ +#define DEP0CTL_EPTYPE BITS(18, 19) /*!< endpoint type */ +#define DEP0CTL_NAKS BIT(17) /*!< NAK status */ +#define DEP0CTL_EPACT BIT(15) /*!< endpoint active */ +#define DEP0CTL_MPL BITS(0, 1) /*!< maximum packet length */ + +/* device endpoint x control register bits definitions */ +#define DEPCTL_EPEN BIT(31) /*!< endpoint enable */ +#define DEPCTL_EPD BIT(30) /*!< endpoint disable */ +#define DEPCTL_SODDFRM BIT(29) /*!< set odd frame */ +#define DEPCTL_SD1PID BIT(29) /*!< set DATA1 PID */ +#define DEPCTL_SEVNFRM BIT(28) /*!< set even frame */ +#define DEPCTL_SD0PID BIT(28) /*!< set DATA0 PID */ +#define DEPCTL_SNAK BIT(27) /*!< set NAK */ +#define DEPCTL_CNAK BIT(26) /*!< clear NAK */ +#define DIEPCTL_TXFNUM BITS(22, 25) /*!< tx FIFO number */ +#define DEPCTL_STALL BIT(21) /*!< STALL handshake */ +#define DOEPCTL_SNOOP BIT(20) /*!< snoop mode */ +#define DEPCTL_EPTYPE BITS(18, 19) /*!< endpoint type */ +#define DEPCTL_NAKS BIT(17) /*!< NAK status */ +#define DEPCTL_EOFRM BIT(16) /*!< even/odd frame */ +#define DEPCTL_DPID BIT(16) /*!< endpoint data PID */ +#define DEPCTL_EPACT BIT(15) /*!< endpoint active */ +#define DEPCTL_MPL BITS(0, 10) /*!< maximum packet length */ + +/* device IN endpoint-x interrupt flag register bits definitions */ +#define DIEPINTF_NAK BIT(13) /*!< NAK handshake sent by USBHS */ +#define DIEPINTF_TXFE BIT(7) /*!< transmit FIFO empty */ +#define DIEPINTF_IEPNE BIT(6) /*!< IN endpoint NAK effective */ +#define DIEPINTF_EPTXFUD BIT(4) /*!< endpoint Tx FIFO underrun */ +#define DIEPINTF_CITO BIT(3) /*!< control In Timeout interrupt */ +#define DIEPINTF_EPDIS BIT(1) /*!< endpoint disabled */ +#define DIEPINTF_TF BIT(0) /*!< transfer finished */ + +/* device OUT endpoint-x interrupt flag register bits definitions */ +#define DOEPINTF_NYET BIT(14) /*!< NYET handshake is sent */ +#define DOEPINTF_BTBSTP BIT(6) /*!< back-to-back SETUP packets */ +#define DOEPINTF_EPRXFOVR BIT(4) /*!< endpoint Rx FIFO overrun */ +#define DOEPINTF_STPF BIT(3) /*!< SETUP phase finished */ +#define DOEPINTF_EPDIS BIT(1) /*!< endpoint disabled */ +#define DOEPINTF_TF BIT(0) /*!< transfer finished */ + +/* device IN endpoint 0 transfer length register bits definitions */ +#define DIEP0LEN_PCNT BITS(19, 20) /*!< packet count */ +#define DIEP0LEN_TLEN BITS(0, 6) /*!< transfer length */ + +/* device OUT endpoint 0 transfer length register bits definitions */ +#define DOEP0LEN_STPCNT BITS(29, 30) /*!< SETUP packet count */ +#define DOEP0LEN_PCNT BIT(19) /*!< packet count */ +#define DOEP0LEN_TLEN BITS(0, 6) /*!< transfer length */ + +/* device OUT endpoint-x transfer length register bits definitions */ +#define DOEPLEN_RXDPID BITS(29, 30) /*!< received data PID */ +#define DOEPLEN_STPCNT BITS(29, 30) /*!< SETUP packet count */ +#define DIEPLEN_MCNT BITS(29, 30) /*!< multi count */ +#define DEPLEN_PCNT BITS(19, 28) /*!< packet count */ +#define DEPLEN_TLEN BITS(0, 18) /*!< transfer length */ +/* device IN endpoint-x transmit FIFO status register bits definitions */ +#define DIEPTFSTAT_IEPTFS BITS(0, 15) /*!< IN endpoint Tx FIFO space remaining */ + +/* USB power and clock registers bits definition */ +#define PWRCLKCTL_SHCLK BIT(1) /*!< stop HCLK */ +#define PWRCLKCTL_SUCLK BIT(0) /*!< stop the USB clock */ + +#define RSTAT_GOUT_NAK 1U /* global OUT NAK (triggers an interrupt) */ +#define RSTAT_DATA_UPDT 2U /* OUT data packet received */ +#define RSTAT_XFER_COMP 3U /* OUT transfer completed (triggers an interrupt) */ +#define RSTAT_SETUP_COMP 4U /* SETUP transaction completed (triggers an interrupt) */ +#define RSTAT_SETUP_UPDT 6U /* SETUP data packet received */ + +#define DSTAT_EM_HS_PHY_30MHZ_60MHZ 0U /* USB enumerate speed use high-speed PHY clock in 30MHz or 60MHz */ +#define DSTAT_EM_FS_PHY_30MHZ_60MHZ 1U /* USB enumerate speed use full-speed PHY clock in 30MHz or 60MHz */ +#define DSTAT_EM_LS_PHY_6MHZ 2U /* USB enumerate speed use low-speed PHY clock in 6MHz */ +#define DSTAT_EM_FS_PHY_48MHZ 3U /* USB enumerate speed use full-speed PHY clock in 48MHz */ + +#define DPID_DATA0 0U /* device endpoint data PID is DATA0 */ +#define DPID_DATA1 2U /* device endpoint data PID is DATA1 */ +#define DPID_DATA2 1U /* device endpoint data PID is DATA2 */ +#define DPID_MDATA 3U /* device endpoint data PID is MDATA */ + +#define DCFG_PFRI(regval) (DCFG_EOPFT & ((regval) << 11)) /*!< end of periodic frame time configuration */ + +#define FRAME_INTERVAL_80 DCFG_PFRI(0U) /*!< 80% of the frame time */ +#define FRAME_INTERVAL_85 DCFG_PFRI(1U) /*!< 85% of the frame time */ +#define FRAME_INTERVAL_90 DCFG_PFRI(2U) /*!< 90% of the frame time */ +#define FRAME_INTERVAL_95 DCFG_PFRI(3U) /*!< 95% of the frame time */ + +#define DCFG_DEVSPEED(regval) (DCFG_DS & ((regval) << 0)) /*!< device speed configuration */ + +#define USB_SPEED_EXP_HIGH DCFG_DEVSPEED(0U) /*!< device external PHY high speed */ +#define USB_SPEED_EXP_FULL DCFG_DEVSPEED(1U) /*!< device external PHY full speed */ +#define USB_SPEED_INP_FULL DCFG_DEVSPEED(3U) /*!< device internal PHY full speed */ + +#define DEP0_MPL(regval) (DEP0CTL_MPL & ((regval) << 0)) /*!< maximum packet length configuration */ + +#define EP0MPL_64 DEP0_MPL(0U) /*!< maximum packet length 64 bytes */ +#define EP0MPL_32 DEP0_MPL(1U) /*!< maximum packet length 32 bytes */ +#define EP0MPL_16 DEP0_MPL(2U) /*!< maximum packet length 16 bytes */ +#define EP0MPL_8 DEP0_MPL(3U) /*!< maximum packet length 8 bytes */ + +#define DOEP0_TLEN(regval) (DOEP0LEN_TLEN & ((regval) << 0)) /*!< transfer length */ +#define DOEP0_PCNT(regval) (DOEP0LEN_PCNT & ((regval) << 19)) /*!< packet count */ +#define DOEP0_STPCNT(regval) (DOEP0LEN_STPCNT & ((regval) << 29)) /*!< SETUP packet count */ + +#define USB_ULPI_PHY 1U /*!< ULPI interface external PHY */ +#define USB_EMBEDDED_PHY 2U /*!< embedded PHY */ + +#define GRXSTS_PKTSTS_IN 2U +#define GRXSTS_PKTSTS_IN_XFER_COMP 3U +#define GRXSTS_PKTSTS_DATA_TOGGLE_ERR 5U +#define GRXSTS_PKTSTS_CH_HALTED 7U + +#define HCTL_30_60MHZ 0U /*!< USB clock 30-60MHZ */ +#define HCTL_48MHZ 1U /*!< USB clock 48MHZ */ +#define HCTL_6MHZ 2U /*!< USB clock 6MHZ */ + +#define EP0_OUT ((uint8_t)0x00) /*!< endpoint out 0 */ +#define EP0_IN ((uint8_t)0x80) /*!< endpoint in 0 */ +#define EP1_OUT ((uint8_t)0x01) /*!< endpoint out 1 */ +#define EP1_IN ((uint8_t)0x81) /*!< endpoint in 1 */ +#define EP2_OUT ((uint8_t)0x02) /*!< endpoint out 2 */ +#define EP2_IN ((uint8_t)0x82) /*!< endpoint in 2 */ +#define EP3_OUT ((uint8_t)0x03) /*!< endpoint out 3 */ +#define EP3_IN ((uint8_t)0x83) /*!< endpoint in 3 */ + +#endif /* __DRV_USB_REGS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbd_int.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbd_int.h new file mode 100644 index 0000000..b2be376 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbd_int.h @@ -0,0 +1,45 @@ +/*! + \file drv_usbd_int.h + \brief USB device mode interrupt header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USBD_INT_H +#define __DRV_USBD_INT_H + +#include "drv_usb_core.h" +#include "drv_usb_dev.h" + +/* function declarations */ +/* USB device-mode interrupts global service routine handler */ +void usbd_isr (usb_core_driver *udev); + +#endif /* __DRV_USBD_INT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbh_int.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbh_int.h new file mode 100644 index 0000000..7eba468 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Include/drv_usbh_int.h @@ -0,0 +1,54 @@ +/*! + \file drv_usbh_int.h.h + \brief USB host mode interrupt management header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __DRV_USBH_INT_H +#define __DRV_USBH_INT_H + +#include "drv_usb_host.h" +#include "usbh_core.h" + +typedef struct _usbh_ev_cb +{ + uint8_t (*connect) (usbh_host *uhost); + uint8_t (*disconnect) (usbh_host *uhost); + uint8_t (*SOF) (usbh_host *uhost); +} usbh_ev_cb; + +extern usbh_ev_cb *usbh_int_fop; + +/* function declarations */ +/* handle global host interrupt */ +uint32_t usbh_isr (usb_core_driver *udev); + +#endif /* __DRV_USBH_INT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_core.c new file mode 100644 index 0000000..f6a7316 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_core.c @@ -0,0 +1,336 @@ +/*! + \file drv_usb_core.c + \brief USB core driver which can operate in host and device mode + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_core.h" +#include "drv_usb_hw.h" + +/* local function prototypes ('static') */ +static void usb_core_reset (usb_core_regs *usb_regs); + +/*! + \brief configure USB core basic + \param[in] usb_basic: pointer to USB capabilities + \param[in] usb_regs: USB core registers + \param[in] usb_core: USB core + \param[out] none + \retval operation status +*/ +usb_status usb_basic_init (usb_core_basic *usb_basic, + usb_core_regs *usb_regs, + usb_core_enum usb_core) +{ + /* configure USB default transfer mode as FIFO mode */ + usb_basic->transfer_mode = (uint8_t)USB_USE_FIFO; + + /* USB default speed is full-speed */ + usb_basic->core_speed = (uint8_t)USB_SPEED_FULL; + + usb_basic->core_enum = (uint8_t)usb_core; + + switch (usb_core) { + case USB_CORE_ENUM_FS: + usb_basic->base_reg = (uint32_t)USBFS_REG_BASE; + + /* set the host channel numbers */ + usb_basic->num_pipe = USBFS_MAX_CHANNEL_COUNT; + + /* set the device endpoint numbers */ + usb_basic->num_ep = USBFS_MAX_EP_COUNT; + + /* USBFS core use embedded physical layer */ + usb_basic->phy_itf = USB_EMBEDDED_PHY; + break; + + default: + return USB_FAIL; + } + + usb_basic->sof_enable = USB_SOF_OUTPUT; + usb_basic->low_power = USB_LOW_POWER; + + /* assign main registers address */ + *usb_regs = (usb_core_regs) { + .gr = (usb_gr*) (usb_basic->base_reg + USB_REG_OFFSET_CORE), + .hr = (usb_hr*) (usb_basic->base_reg + USB_REG_OFFSET_HOST), + .dr = (usb_dr*) (usb_basic->base_reg + USB_REG_OFFSET_DEV), + + .HPCS = (uint32_t*) (usb_basic->base_reg + USB_REG_OFFSET_PORT), + .PWRCLKCTL = (uint32_t*) (usb_basic->base_reg + USB_REG_OFFSET_PWRCLKCTL) + }; + + /* assign device endpoint registers address */ + for (uint8_t i = 0U; i < usb_basic->num_ep; i++) { + usb_regs->er_in[i] = (usb_erin *) \ + (usb_basic->base_reg + USB_REG_OFFSET_EP_IN + (i * USB_REG_OFFSET_EP)); + + usb_regs->er_out[i] = (usb_erout *)\ + (usb_basic->base_reg + USB_REG_OFFSET_EP_OUT + (i * USB_REG_OFFSET_EP)); + } + + /* assign host pipe registers address */ + for (uint8_t i = 0U; i < usb_basic->num_pipe; i++) { + usb_regs->pr[i] = (usb_pr *) \ + (usb_basic->base_reg + USB_REG_OFFSET_CH_INOUT + (i * USB_REG_OFFSET_CH)); + + usb_regs->DFIFO[i] = (uint32_t *) \ + (usb_basic->base_reg + USB_DATA_FIFO_OFFSET + (i * USB_DATA_FIFO_SIZE)); + } + + return USB_OK; +} + +/*! + \brief initializes the USB controller registers and + prepares the core device mode or host mode operation + \param[in] usb_basic: pointer to USB capabilities + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval operation status +*/ +usb_status usb_core_init (usb_core_basic usb_basic, usb_core_regs *usb_regs) +{ + if (USB_ULPI_PHY == usb_basic.phy_itf) { + usb_regs->gr->GCCFG &= ~GCCFG_PWRON; + + if (usb_basic.sof_enable) { + usb_regs->gr->GCCFG |= GCCFG_SOFOEN; + } + + /* initialize the ULPI interface */ + usb_regs->gr->GUSBCS &= ~(GUSBCS_EMBPHY | GUSBCS_ULPIEOI); + +#ifdef USBHS_EXTERNAL_VBUS_ENABLED + /* use external VBUS driver */ + usb_regs->gr->GUSBCS |= GUSBCS_ULPIEVD; +#else + /* use internal VBUS driver */ + usb_regs->gr->GUSBCS &= ~GUSBCS_ULPIEVD; +#endif /* USBHS_EXTERNAL_VBUS_ENABLED */ + + /* soft reset the core */ + usb_core_reset (usb_regs); + } else { + usb_regs->gr->GUSBCS |= GUSBCS_EMBPHY; + + /* soft reset the core */ + usb_core_reset (usb_regs); + + /* active the transceiver and enable VBUS sensing */ + usb_regs->gr->GCCFG |= GCCFG_PWRON | GCCFG_VBUSACEN | GCCFG_VBUSBCEN; + + /* enable SOF output */ + if (usb_basic.sof_enable) { + usb_regs->gr->GCCFG |= GCCFG_SOFOEN; + } + + usb_mdelay(20U); + } + +#ifdef USE_OTG_MODE + + /* enable USB OTG features */ + usb_regs->gr->GUSBCS |= GUSBCS_HNPCEN | GUSBCS_SRPCEN; + + /* enable the USB wakeup and suspend interrupts */ + usb_regs->gr->GINTF = 0xBFFFFFFFU; + + usb_regs->gr->GINTEN = GINTEN_WKUPIE | GINTEN_SPIE | \ + GINTEN_OTGIE | GINTEN_SESIE | GINTEN_CIDPSCIE; + +#endif /* USE_OTG_MODE */ + + return USB_OK; +} + +/*! + \brief write a packet into the Tx FIFO associated with the endpoint + \param[in] usb_regs: pointer to USB core registers + \param[in] src_buf: pointer to source buffer + \param[in] fifo_num: FIFO number which is in (0..3) + \param[in] byte_count: packet byte count + \param[out] none + \retval operation status +*/ +usb_status usb_txfifo_write (usb_core_regs *usb_regs, + uint8_t *src_buf, + uint8_t fifo_num, + uint16_t byte_count) +{ + uint32_t word_count = (byte_count + 3U) / 4U; + + __IO uint32_t *fifo = usb_regs->DFIFO[fifo_num]; + + while (word_count-- > 0U) { + *fifo = *((__packed uint32_t *)src_buf); + + src_buf += 4U; + } + + return USB_OK; +} + +/*! + \brief read a packet from the Rx FIFO associated with the endpoint + \param[in] usb_regs: pointer to USB core registers + \param[in] dest_buf: pointer to destination buffer + \param[in] byte_count: packet byte count + \param[out] none + \retval void type pointer +*/ +void *usb_rxfifo_read (usb_core_regs *usb_regs, uint8_t *dest_buf, uint16_t byte_count) +{ + uint32_t word_count = (byte_count + 3U) / 4U; + + __IO uint32_t *fifo = usb_regs->DFIFO[0]; + + while (word_count-- > 0U) { + *(__packed uint32_t *)dest_buf = *fifo; + + dest_buf += 4U; + } + + return ((void *)dest_buf); +} + +/*! + \brief flush a Tx FIFO or all Tx FIFOs + \param[in] usb_regs: pointer to USB core registers + \param[in] fifo_num: FIFO number which is in (0..3) + \param[out] none + \retval operation status +*/ +usb_status usb_txfifo_flush (usb_core_regs *usb_regs, uint8_t fifo_num) +{ + usb_regs->gr->GRSTCTL = ((uint32_t)fifo_num << 6U) | GRSTCTL_TXFF; + + /* wait for Tx FIFO flush bit is set */ + while (usb_regs->gr->GRSTCTL & GRSTCTL_TXFF) { + /* no operation */ + } + + /* wait for 3 PHY clocks*/ + usb_udelay(3U); + + return USB_OK; +} + +/*! + \brief flush the entire Rx FIFO + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval operation status +*/ +usb_status usb_rxfifo_flush (usb_core_regs *usb_regs) +{ + usb_regs->gr->GRSTCTL = GRSTCTL_RXFF; + + /* wait for Rx FIFO flush bit is set */ + while (usb_regs->gr->GRSTCTL & GRSTCTL_RXFF) { + /* no operation */ + } + + /* wait for 3 PHY clocks */ + usb_udelay(3U); + + return USB_OK; +} + +/*! + \brief set endpoint or channel Tx FIFO size + \param[in] usb_regs: pointer to USB core registers + \param[in] fifo: Tx FIFO number + \param[in] size: assigned Tx FIFO size + \param[out] none + \retval none +*/ +void usb_set_txfifo(usb_core_regs *usb_regs, uint8_t fifo, uint16_t size) +{ + uint32_t tx_offset; + + tx_offset = usb_regs->gr->GRFLEN; + + if (0U == fifo) { + usb_regs->gr->DIEP0TFLEN_HNPTFLEN = ((uint32_t)size << 16) | tx_offset; + } else { + tx_offset += (usb_regs->gr->DIEP0TFLEN_HNPTFLEN) >> 16; + + for (uint8_t i = 0U; i < (fifo - 1U); i++) { + tx_offset += (usb_regs->gr->DIEPTFLEN[i] >> 16); + } + + /* multiply Tx_Size by 2 to get higher performance */ + usb_regs->gr->DIEPTFLEN[fifo - 1U] = ((uint32_t)size << 16) | tx_offset; + } +} + +/*! + \brief set USB current mode + \param[in] usb_regs: pointer to USB core registers + \param[in] mode: USB current mode + \param[out] none + \retval none +*/ +void usb_curmode_set(usb_core_regs *usb_regs, uint8_t mode) +{ + usb_regs->gr->GUSBCS &= ~(GUSBCS_FDM | GUSBCS_FHM); + + if (DEVICE_MODE == mode) { + usb_regs->gr->GUSBCS |= GUSBCS_FDM; + } else if (HOST_MODE == mode) { + usb_regs->gr->GUSBCS |= GUSBCS_FHM; + } else { + /* OTG mode and other mode can not be here! */ + } +} + +/*! + \brief configure USB core to soft reset + \param[in] usb_regs: pointer to USB core registers + \param[out] none + \retval none +*/ +static void usb_core_reset (usb_core_regs *usb_regs) +{ + /* enable core soft reset */ + usb_regs->gr->GRSTCTL |= GRSTCTL_CSRST; + + /* wait for the core to be soft reset */ + while (usb_regs->gr->GRSTCTL & GRSTCTL_CSRST) { + /* no operation */ + } + + /* wait for additional 3 PHY clocks */ + usb_udelay(3U); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_dev.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_dev.c new file mode 100644 index 0000000..979f53b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_dev.c @@ -0,0 +1,598 @@ +/*! + \file drv_usb_dev.c + \brief USB device mode low level driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "drv_usb_core.h" +#include "drv_usb_dev.h" + +/* endpoint 0 max packet length */ +static const uint8_t EP0_MAXLEN[4] = { + [DSTAT_EM_HS_PHY_30MHZ_60MHZ] = EP0MPL_64, + [DSTAT_EM_FS_PHY_30MHZ_60MHZ] = EP0MPL_64, + [DSTAT_EM_FS_PHY_48MHZ] = EP0MPL_64, + [DSTAT_EM_LS_PHY_6MHZ] = EP0MPL_8 +}; + +#ifdef USB_FS_CORE + +/* USB endpoint Tx FIFO size */ +static uint16_t USBFS_TX_FIFO_SIZE[USBFS_MAX_EP_COUNT] = +{ + (uint16_t)TX0_FIFO_FS_SIZE, + (uint16_t)TX1_FIFO_FS_SIZE, + (uint16_t)TX2_FIFO_FS_SIZE, + (uint16_t)TX3_FIFO_FS_SIZE +}; + +#endif /* USBFS_CORE */ + +/*! + \brief initialize USB core registers for device mode + \param[in] udev: pointer to USB device + \param[out] none + \retval operation status +*/ +usb_status usb_devcore_init (usb_core_driver *udev) +{ + uint8_t i; + + /* restart the PHY clock (maybe don't need to...) */ + *udev->regs.PWRCLKCTL = 0U; + + /* configure periodic frame interval to default value */ + udev->regs.dr->DCFG &= ~DCFG_EOPFT; + udev->regs.dr->DCFG |= FRAME_INTERVAL_80; + + udev->regs.dr->DCFG &= ~DCFG_DS; + +#ifdef USB_FS_CORE + if ((uint8_t)USB_CORE_ENUM_FS == udev->bp.core_enum) { + /* set full-speed PHY */ + udev->regs.dr->DCFG |= USB_SPEED_INP_FULL; + + /* set Rx FIFO size */ + usb_set_rxfifo(&udev->regs, RX_FIFO_FS_SIZE); + + /* set endpoint 1 to 3's Tx FIFO length and RAM address */ + for (i = 0U; i < USBFS_MAX_EP_COUNT; i++) { + usb_set_txfifo(&udev->regs, i, USBFS_TX_FIFO_SIZE[i]); + } + } +#endif /* USB_FS_CORE */ + + /* make sure all FIFOs are flushed */ + + /* flush all Tx FIFOs */ + (void)usb_txfifo_flush (&udev->regs, 0x10U); + + /* flush entire Rx FIFO */ + (void)usb_rxfifo_flush (&udev->regs); + + /* clear all pending device interrupts */ + udev->regs.dr->DIEPINTEN = 0U; + udev->regs.dr->DOEPINTEN = 0U; + udev->regs.dr->DAEPINT = 0xFFFFFFFFU; + udev->regs.dr->DAEPINTEN = 0U; + + /* configure all IN/OUT endpoints */ + for (i = 0U; i < udev->bp.num_ep; i++) { + if (udev->regs.er_in[i]->DIEPCTL & DEPCTL_EPEN) { + udev->regs.er_in[i]->DIEPCTL |= DEPCTL_EPD | DEPCTL_SNAK; + } else { + udev->regs.er_in[i]->DIEPCTL = 0U; + } + + /* set IN endpoint transfer length to 0 */ + udev->regs.er_in[i]->DIEPLEN = 0U; + + /* clear all pending IN endpoint interrupt */ + udev->regs.er_in[i]->DIEPINTF = 0xFFU; + + if (udev->regs.er_out[i]->DOEPCTL & DEPCTL_EPEN) { + udev->regs.er_out[i]->DOEPCTL |= DEPCTL_EPD | DEPCTL_SNAK; + } else { + udev->regs.er_out[i]->DOEPCTL = 0U; + } + + /* set OUT endpoint transfer length to 0 */ + udev->regs.er_out[i]->DOEPLEN = 0U; + + /* clear all pending OUT endpoint interrupts */ + udev->regs.er_out[i]->DOEPINTF = 0xFFU; + } + + udev->regs.dr->DIEPINTEN |= DIEPINTEN_EPTXFUDEN; + + (void)usb_devint_enable (udev); + + return USB_OK; +} + +/*! + \brief enable the USB device mode interrupts + \param[in] udev: pointer to USB device + \param[out] none + \retval operation status +*/ +usb_status usb_devint_enable (usb_core_driver *udev) +{ + /* clear any pending USB OTG interrupts */ + udev->regs.gr->GOTGINTF = 0xFFFFFFFFU; + + /* clear any pending interrupts */ + udev->regs.gr->GINTF = 0xBFFFFFFFU; + + /* enable the USB wakeup and suspend interrupts */ + udev->regs.gr->GINTEN = GINTEN_WKUPIE | GINTEN_SPIE; + + /* enable device_mode-related interrupts */ + if ((uint8_t)USB_USE_FIFO == udev->bp.transfer_mode) { + udev->regs.gr->GINTEN |= GINTEN_RXFNEIE; + } + + udev->regs.gr->GINTEN |= GINTEN_RSTIE | GINTEN_ENUMFIE | GINTEN_IEPIE |\ + GINTEN_OEPIE | GINTEN_SOFIE | GINTEN_ISOONCIE | GINTEN_ISOINCIE; + +#ifdef VBUS_SENSING_ENABLED + udev->regs.gr->GINTEN |= GINTEN_SESIE | GINTEN_OTGIE; +#endif /* VBUS_SENSING_ENABLED */ + + return USB_OK; +} + +/*! + \brief active the USB endpoint0 transaction + \param[in] udev: pointer to USB device + \param[in] transc: the USB endpoint0 transaction + \param[out] none + \retval operation status +*/ +usb_status usb_transc0_active (usb_core_driver *udev, usb_transc *transc) +{ + __IO uint32_t *reg_addr = NULL; + + uint8_t enum_speed = udev->regs.dr->DSTAT & DSTAT_ES; + /* get the endpoint number */ + uint8_t ep_num = transc->ep_addr.num; + + if (ep_num) { + /* not endpoint 0 */ + return USB_FAIL; + } + + if (transc->ep_addr.dir) { + reg_addr = &udev->regs.er_in[0]->DIEPCTL; + } else { + reg_addr = &udev->regs.er_out[0]->DOEPCTL; + } + + /* endpoint 0 is activated after USB clock is enabled */ + *reg_addr &= ~(DEPCTL_MPL | DEPCTL_EPTYPE | DIEPCTL_TXFNUM); + + /* set endpoint 0 maximum packet length */ + *reg_addr |= EP0_MAXLEN[enum_speed]; + + /* activate endpoint */ + *reg_addr |= ((uint32_t)transc->ep_type << 18U) | ((uint32_t)ep_num << 22U) | DEPCTL_SD0PID | DEPCTL_EPACT; + + return USB_OK; +} + +/*! + \brief active the USB transaction + \param[in] udev: pointer to USB device + \param[in] transc: the USB transaction + \param[out] none + \retval status +*/ +usb_status usb_transc_active (usb_core_driver *udev, usb_transc *transc) +{ + __IO uint32_t *reg_addr = NULL; + uint32_t epinten = 0U; + uint8_t enum_speed = udev->regs.dr->DSTAT & DSTAT_ES; + + /* get the endpoint number */ + uint8_t ep_num = transc->ep_addr.num; + + /* enable endpoint interrupt number */ + if (transc->ep_addr.dir) { + reg_addr = &udev->regs.er_in[ep_num]->DIEPCTL; + + epinten = 1U << ep_num; + } else { + reg_addr = &udev->regs.er_out[ep_num]->DOEPCTL; + + epinten = 1U << (16U + ep_num); + } + + /* if the endpoint is not active, need change the endpoint control register */ + if (!(*reg_addr & DEPCTL_EPACT)) { + *reg_addr &= ~(DEPCTL_MPL | DEPCTL_EPTYPE | DIEPCTL_TXFNUM); + + /* set endpoint maximum packet length */ + if (0U == ep_num) { + *reg_addr |= EP0_MAXLEN[enum_speed]; + } else { + *reg_addr |= transc->max_len; + } + + /* activate endpoint */ + *reg_addr |= ((uint32_t)transc->ep_type << 18U) | ((uint32_t)ep_num << 22U) | DEPCTL_SD0PID | DEPCTL_EPACT; + } + + + /* enable the interrupts for this endpoint */ + udev->regs.dr->DAEPINTEN |= epinten; + + return USB_OK; +} + +/*! + \brief deactivate the USB transaction + \param[in] udev: pointer to USB device + \param[in] transc: the USB transaction + \param[out] none + \retval status +*/ +usb_status usb_transc_deactivate(usb_core_driver *udev, usb_transc *transc) +{ + uint32_t epinten = 0U; + + uint8_t ep_num = transc->ep_addr.num; + + /* disable endpoint interrupt number */ + if (transc->ep_addr.dir) { + epinten = 1U << ep_num; + + udev->regs.er_in[ep_num]->DIEPCTL &= ~DEPCTL_EPACT; + } else { + epinten = 1U << (ep_num + 16U); + + udev->regs.er_out[ep_num]->DOEPCTL &= ~DEPCTL_EPACT; + } + + + /* disable the interrupts for this endpoint */ + udev->regs.dr->DAEPINTEN &= ~epinten; + + return USB_OK; +} + +/*! + \brief configure USB transaction to start IN transfer + \param[in] udev: pointer to USB device + \param[in] transc: the USB IN transaction + \param[out] none + \retval operation status +*/ +usb_status usb_transc_inxfer (usb_core_driver *udev, usb_transc *transc) +{ + usb_status status = USB_OK; + + uint8_t ep_num = transc->ep_addr.num; + + __IO uint32_t epctl = udev->regs.er_in[ep_num]->DIEPCTL; + __IO uint32_t eplen = udev->regs.er_in[ep_num]->DIEPLEN; + + eplen &= ~(DEPLEN_TLEN | DEPLEN_PCNT); + + /* zero length packet or endpoint 0 */ + if (0U == transc->xfer_len) { + /* set transfer packet count to 1 */ + eplen |= 1U << 19U; + } else { + /* set transfer packet count */ + if (0U == ep_num) { + transc->xfer_len = USB_MIN(transc->xfer_len, transc->max_len); + + eplen |= 1U << 19U; + } else { + eplen |= (((transc->xfer_len - 1U) + transc->max_len) / transc->max_len) << 19U; + } + + /* set endpoint transfer length */ + eplen |= transc->xfer_len; + + if (transc->ep_type == (uint8_t)USB_EPTYPE_ISOC) { + eplen |= DIEPLEN_MCNT & (1U << 29U); + } + } + + udev->regs.er_in[ep_num]->DIEPLEN = eplen; + + if (transc->ep_type == (uint8_t)USB_EPTYPE_ISOC) { + if (((udev->regs.dr->DSTAT & DSTAT_FNRSOF) >> 8U) & 0x01U) { + epctl |= DEPCTL_SEVNFRM; + } else { + epctl |= DEPCTL_SODDFRM; + } + } + + /* enable the endpoint and clear the NAK */ + epctl |= DEPCTL_CNAK | DEPCTL_EPEN; + + udev->regs.er_in[ep_num]->DIEPCTL = epctl; + + if ((uint8_t)USB_USE_FIFO == udev->bp.transfer_mode) { + udev->regs.er_in[ep_num]->DIEPCTL = epctl; + + if (transc->ep_type != (uint8_t)USB_EPTYPE_ISOC) { + /* enable the Tx FIFO empty interrupt for this endpoint */ + if (transc->xfer_len > 0U) { + udev->regs.dr->DIEPFEINTEN |= 1U << ep_num; + } + } else { + (void)usb_txfifo_write (&udev->regs, transc->xfer_buf, ep_num, (uint16_t)transc->xfer_len); + } + } + + return status; +} + +/*! + \brief configure USB transaction to start OUT transfer + \param[in] udev: pointer to USB device + \param[in] transc: the USB OUT transaction + \param[out] none + \retval status +*/ +usb_status usb_transc_outxfer (usb_core_driver *udev, usb_transc *transc) +{ + usb_status status = USB_OK; + + uint8_t ep_num = transc->ep_addr.num; + + uint32_t epctl = udev->regs.er_out[ep_num]->DOEPCTL; + uint32_t eplen = udev->regs.er_out[ep_num]->DOEPLEN; + + eplen &= ~(DEPLEN_TLEN | DEPLEN_PCNT); + + /* zero length packet or endpoint 0 */ + if ((0U == transc->xfer_len) || (0U == ep_num)) { + /* set the transfer length to max packet size */ + eplen |= transc->max_len; + + /* set the transfer packet count to 1 */ + eplen |= 1U << 19U; + } else { + /* configure the transfer size and packet count as follows: + * pktcnt = N + * xfersize = N * maxpacket + */ + uint32_t packet_count = (transc->xfer_len + transc->max_len - 1U) / transc->max_len; + + eplen |= packet_count << 19U; + eplen |= packet_count * transc->max_len; + } + + udev->regs.er_out[ep_num]->DOEPLEN = eplen; + + if (transc->ep_type == (uint8_t)USB_EPTYPE_ISOC) { + if (transc->frame_num) { + epctl |= DEPCTL_SD1PID; + } else { + epctl |= DEPCTL_SD0PID; + } + } + + /* enable the endpoint and clear the NAK */ + epctl |= DEPCTL_EPEN | DEPCTL_CNAK; + + udev->regs.er_out[ep_num]->DOEPCTL = epctl; + + return status; +} + +/*! + \brief set the USB transaction STALL status + \param[in] udev: pointer to USB device + \param[in] transc: the USB transaction + \param[out] none + \retval status +*/ +usb_status usb_transc_stall (usb_core_driver *udev, usb_transc *transc) +{ + __IO uint32_t *reg_addr = NULL; + + uint8_t ep_num = transc->ep_addr.num; + + if (transc->ep_addr.dir) { + reg_addr = &(udev->regs.er_in[ep_num]->DIEPCTL); + + /* set the endpoint disable bit */ + if (*reg_addr & DEPCTL_EPEN) { + *reg_addr |= DEPCTL_EPD; + } + } else { + /* set the endpoint stall bit */ + reg_addr = &(udev->regs.er_out[ep_num]->DOEPCTL); + } + + /* set the endpoint stall bit */ + *reg_addr |= DEPCTL_STALL; + + return USB_OK; +} + +/*! + \brief clear the USB transaction STALL status + \param[in] udev: pointer to USB device + \param[in] transc: the USB transaction + \param[out] none + \retval operation status +*/ +usb_status usb_transc_clrstall(usb_core_driver *udev, usb_transc *transc) +{ + __IO uint32_t *reg_addr = NULL; + + uint8_t ep_num = transc->ep_addr.num; + + if (transc->ep_addr.dir) { + reg_addr = &(udev->regs.er_in[ep_num]->DIEPCTL); + } else { + reg_addr = &(udev->regs.er_out[ep_num]->DOEPCTL); + } + + /* clear the endpoint stall bits */ + *reg_addr &= ~DEPCTL_STALL; + + /* reset data PID of the periodic endpoints */ + if (((uint8_t)USB_EPTYPE_INTR == transc->ep_type) || ((uint8_t)USB_EPTYPE_BULK == transc->ep_type)) { + *reg_addr |= DEPCTL_SD0PID; + } + + return USB_OK; +} + +/*! + \brief read device IN endpoint interrupt flag register + \param[in] udev: pointer to USB device + \param[in] ep_num: endpoint number + \param[out] none + \retval interrupt value +*/ +uint32_t usb_iepintr_read (usb_core_driver *udev, uint8_t ep_num) +{ + uint32_t value = 0U, fifoemptymask, commonintmask; + + commonintmask = udev->regs.dr->DIEPINTEN; + fifoemptymask = udev->regs.dr->DIEPFEINTEN; + + /* check FIFO empty interrupt enable bit */ + commonintmask |= ((fifoemptymask >> ep_num) & 0x1U) << 7; + + value = udev->regs.er_in[ep_num]->DIEPINTF & commonintmask; + + return value; +} + +/*! + \brief configures OUT endpoint 0 to receive SETUP packets + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_ctlep_startout (usb_core_driver *udev) +{ + /* set OUT endpoint 0 receive length to 24 bytes, 1 packet and 3 setup packets */ + udev->regs.er_out[0]->DOEPLEN = DOEP0_TLEN(8U * 3U) | DOEP0_PCNT(1U) | DOEP0_STPCNT(3U); +} + +/*! + \brief active remote wakeup signaling + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_rwkup_active (usb_core_driver *udev) +{ + if (udev->dev.pm.dev_remote_wakeup) { + if (udev->regs.dr->DSTAT & DSTAT_SPST) { + if (udev->bp.low_power) { + /* ungate USB core clock */ + *udev->regs.PWRCLKCTL &= ~(PWRCLKCTL_SHCLK | PWRCLKCTL_SUCLK); + } + + /* active remote wakeup signaling */ + udev->regs.dr->DCTL |= DCTL_RWKUP; + + usb_mdelay(5U); + + udev->regs.dr->DCTL &= ~DCTL_RWKUP; + } + } +} + +/*! + \brief active USB core clock + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_clock_active (usb_core_driver *udev) +{ + if (udev->bp.low_power) { + if (udev->regs.dr->DSTAT & DSTAT_SPST) { + /* ungate USB Core clock */ + *udev->regs.PWRCLKCTL &= ~(PWRCLKCTL_SHCLK | PWRCLKCTL_SUCLK); + } + } +} + +/*! + \brief USB device suspend + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_dev_suspend (usb_core_driver *udev) +{ + __IO uint32_t devstat = udev->regs.dr->DSTAT; + + if ((udev->bp.low_power) && (devstat & DSTAT_SPST)) { + /* switch-off the USB clocks */ + *udev->regs.PWRCLKCTL |= PWRCLKCTL_SHCLK; + + /* enter DEEP_SLEEP mode with LDO in low power mode */ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + } +} + +/*! + \brief stop the device and clean up FIFOs + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_dev_stop (usb_core_driver *udev) +{ + uint32_t i; + + udev->dev.cur_status = 1U; + + /* clear all interrupt flag and enable bits */ + for (i = 0U; i < udev->bp.num_ep; i++) { + udev->regs.er_in[i]->DIEPINTF = 0xFFU; + udev->regs.er_out[i]->DOEPINTF = 0xFFU; + } + + udev->regs.dr->DIEPINTEN = 0U; + udev->regs.dr->DOEPINTEN = 0U; + udev->regs.dr->DAEPINTEN = 0U; + udev->regs.dr->DAEPINT = 0xFFFFFFFFU; + + /* flush the FIFO */ + (void)usb_rxfifo_flush (&udev->regs); + (void)usb_txfifo_flush (&udev->regs, 0x10U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_host.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_host.c new file mode 100644 index 0000000..5795ad8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usb_host.c @@ -0,0 +1,443 @@ +/*! + \file drv_usb_host.c + \brief USB host mode low level driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "drv_usb_core.h" +#include "drv_usb_host.h" + +const uint32_t PIPE_DPID[2] = +{ + PIPE_DPID_DATA0, + PIPE_DPID_DATA1 +}; + +/*! + \brief initializes USB core for host mode + \param[in] udev: pointer to selected USB host + \param[out] none + \retval operation status +*/ +usb_status usb_host_init (usb_core_driver *udev) +{ + uint32_t i = 0U, inten = 0U; + + uint32_t nptxfifolen = 0U; + uint32_t ptxfifolen = 0U; + + /* restart the PHY Clock */ + *udev->regs.PWRCLKCTL = 0U; + + /* support FS/LS only */ + udev->regs.hr->HCTL &= ~HCTL_SPDFSLS; + + /* configure data FIFOs size */ +#ifdef USB_FS_CORE + if (USB_CORE_ENUM_FS == udev->bp.core_enum) { + /* set Rx FIFO size */ + udev->regs.gr->GRFLEN = USB_RX_FIFO_FS_SIZE; + + /* set non-periodic Tx FIFO size and address */ + nptxfifolen |= USB_RX_FIFO_FS_SIZE; + nptxfifolen |= USB_HTX_NPFIFO_FS_SIZE << 16U; + udev->regs.gr->DIEP0TFLEN_HNPTFLEN = nptxfifolen; + + /* set periodic Tx FIFO size and address */ + ptxfifolen |= USB_RX_FIFO_FS_SIZE + USB_HTX_NPFIFO_FS_SIZE; + ptxfifolen |= USB_HTX_PFIFO_FS_SIZE << 16U; + udev->regs.gr->HPTFLEN = ptxfifolen; + } +#endif /* USB_FS_CORE */ + +#ifdef USE_OTG_MODE + + /* clear host set HNP enable in the usb_otg control register */ + udev->regs.gr->GOTGCS &= ~GOTGCS_HHNPEN; + +#endif /* USE_OTG_MODE */ + + /* flush all TX FIFOs in device or host mode */ + usb_txfifo_flush (&udev->regs, 0x10U); + + /* flush the entire Rx FIFO */ + usb_rxfifo_flush (&udev->regs); + + /* disable all interrupts */ + udev->regs.gr->GINTEN = 0U; + + /* clear any pending USB OTG interrupts */ + udev->regs.gr->GOTGINTF = 0xFFFFFFFFU; + + /* enable the USB wakeup and suspend interrupts */ + udev->regs.gr->GINTF = 0xBFFFFFFFU; + + /* clear all pending host channel interrupts */ + for (i = 0U; i < udev->bp.num_pipe; i++) { + udev->regs.pr[i]->HCHINTF = 0xFFFFFFFFU; + udev->regs.pr[i]->HCHINTEN = 0U; + } + +#ifndef USE_OTG_MODE + usb_portvbus_switch (udev, 1U); +#endif /* USE_OTG_MODE */ + + udev->regs.gr->GINTEN = GINTEN_WKUPIE | GINTEN_SPIE; + + /* enable host_mode-related interrupts */ + if (USB_USE_FIFO == udev->bp.transfer_mode) { + inten = GINTEN_RXFNEIE; + } + + inten |= GINTEN_SESIE | GINTEN_HPIE | GINTEN_HCIE | GINTEN_ISOINCIE; + + udev->regs.gr->GINTEN |= inten; + + inten = GINTEN_DISCIE | GINTEN_SOFIE; + + udev->regs.gr->GINTEN &= ~inten; + + return USB_OK; +} + +/*! + \brief control the VBUS to power + \param[in] udev: pointer to selected usb host + \param[in] state: VBUS state + \param[out] none + \retval none +*/ +void usb_portvbus_switch (usb_core_driver *udev, uint8_t state) +{ + uint32_t port = 0U; + + /* enable or disable the external charge pump */ + usb_vbus_drive (state); + + /* turn on the host port power. */ + port = usb_port_read (udev); + + if (!(port & HPCS_PP) && (1U == state)) { + port |= HPCS_PP; + } + + if ((port & HPCS_PP) && (0U == state)) { + port &= ~HPCS_PP; + } + + *udev->regs.HPCS = port; + + usb_mdelay (200U); +} + +/*! + \brief reset host port + \param[in] udev: pointer to USB device + \param[out] none + \retval operation status +*/ +uint32_t usb_port_reset (usb_core_driver *udev) +{ + __IO uint32_t port = usb_port_read (udev); + + *udev->regs.HPCS = port | HPCS_PRST; + + usb_mdelay(20U); /* see note */ + + *udev->regs.HPCS = port & ~HPCS_PRST; + + usb_mdelay(20U); + + return 1U; +} + +/*! + \brief initialize host pipe + \param[in] udev: pointer to USB device + \param[in] pipe_num: host pipe number which is in (0..7) + \param[out] none + \retval operation status +*/ +usb_status usb_pipe_init (usb_core_driver *udev, uint8_t pipe_num) +{ + usb_status status = USB_OK; + + __IO uint32_t pp_ctl = 0U; + __IO uint32_t pp_inten = HCHINTEN_TFIE; + + usb_pipe *pp = &udev->host.pipe[pipe_num]; + + /* clear old interrupt conditions for this host channel */ + udev->regs.pr[pipe_num]->HCHINTF = 0xFFFFFFFFU; + + if (pp->ep.dir) { + pp_inten |= HCHINTEN_BBERIE; + } + + /* enable channel interrupts required for this transfer */ + switch (pp->ep.type) { + case USB_EPTYPE_CTRL: + case USB_EPTYPE_BULK: + pp_inten |= HCHINTEN_STALLIE | HCHINTEN_USBERIE \ + | HCHINTEN_DTERIE | HCHINTEN_NAKIE; + + if (!pp->ep.dir) { + pp_inten |= HCHINTEN_NYETIE; + + if (pp->ping) { + pp_inten |= HCHINTEN_ACKIE; + } + } + break; + + case USB_EPTYPE_INTR: + pp_inten |= HCHINTEN_STALLIE | HCHINTEN_USBERIE | HCHINTEN_DTERIE \ + | HCHINTEN_NAKIE | HCHINTEN_REQOVRIE; + break; + + case USB_EPTYPE_ISOC: + pp_inten |= HCHINTEN_REQOVRIE | HCHINTEN_ACKIE; + + if (pp->ep.dir) { + pp_inten |= HCHINTEN_USBERIE; + } + break; + + default: + break; + } + + udev->regs.pr[pipe_num]->HCHINTEN = pp_inten; + + /* enable the top level host channel interrupt */ + udev->regs.hr->HACHINTEN |= 1U << pipe_num; + + /* make sure host channel interrupts are enabled */ + udev->regs.gr->GINTEN |= GINTEN_HCIE; + + /* program the host channel control register */ + pp_ctl |= PIPE_CTL_DAR(pp->dev_addr); + pp_ctl |= PIPE_CTL_EPNUM(pp->ep.num); + pp_ctl |= PIPE_CTL_EPDIR(pp->ep.dir); + pp_ctl |= PIPE_CTL_EPTYPE(pp->ep.type); + pp_ctl |= PIPE_CTL_LSD(pp->dev_speed == PORT_SPEED_LOW); + + pp_ctl |= pp->ep.mps; + pp_ctl |= ((uint32_t)(pp->ep.type == USB_EPTYPE_INTR) << 29U) & HCHCTL_ODDFRM; + + udev->regs.pr[pipe_num]->HCHCTL = pp_ctl; + + return status; +} + +/*! + \brief prepare host channel for transferring packets + \param[in] udev: pointer to USB device + \param[in] pipe_num: host pipe number which is in (0..7) + \param[out] none + \retval operation status +*/ +usb_status usb_pipe_xfer (usb_core_driver *udev, uint8_t pipe_num) +{ + usb_status status = USB_OK; + + uint16_t dword_len = 0U; + uint16_t packet_count = 0U; + + __IO uint32_t pp_ctl = 0U; + + usb_pipe *pp = &udev->host.pipe[pipe_num]; + + uint16_t max_packet_len = pp->ep.mps; + + /* compute the expected number of packets associated to the transfer */ + if (pp->xfer_len > 0U) { + packet_count = (uint16_t)((pp->xfer_len + max_packet_len - 1U) / max_packet_len); + + if (packet_count > HC_MAX_PACKET_COUNT) { + packet_count = HC_MAX_PACKET_COUNT; + pp->xfer_len = (uint16_t)(packet_count * max_packet_len); + } + } else { + packet_count = 1U; + } + + if (pp->ep.dir) { + pp->xfer_len = (uint16_t)(packet_count * max_packet_len); + } + + /* initialize the host channel transfer information */ + udev->regs.pr[pipe_num]->HCHLEN = pp->xfer_len | pp->DPID | PIPE_XFER_PCNT(packet_count); + + pp_ctl = udev->regs.pr[pipe_num]->HCHCTL; + + if (usb_frame_even(udev)) { + pp_ctl |= HCHCTL_ODDFRM; + } else { + pp_ctl &= ~HCHCTL_ODDFRM; + } + + /* set host channel enabled */ + pp_ctl |= HCHCTL_CEN; + pp_ctl &= ~HCHCTL_CDIS; + + udev->regs.pr[pipe_num]->HCHCTL = pp_ctl; + + if (USB_USE_FIFO == udev->bp.transfer_mode) { + if ((0U == pp->ep.dir) && (pp->xfer_len > 0U)) { + switch (pp->ep.type) { + /* non-periodic transfer */ + case USB_EPTYPE_CTRL: + case USB_EPTYPE_BULK: + dword_len = (uint16_t)((pp->xfer_len + 3U) / 4U); + + /* check if there is enough space in fifo space */ + if (dword_len > (udev->regs.gr->HNPTFQSTAT & HNPTFQSTAT_NPTXFS)) { + /* need to process data in nptxfempty interrupt */ + udev->regs.gr->GINTEN |= GINTEN_NPTXFEIE; + } + break; + + /* periodic transfer */ + case USB_EPTYPE_INTR: + case USB_EPTYPE_ISOC: + dword_len = (uint16_t)((pp->xfer_len + 3U) / 4U); + + /* check if there is enough space in fifo space */ + if (dword_len > (udev->regs.hr->HPTFQSTAT & HPTFQSTAT_PTXFS)) { + /* need to process data in ptxfempty interrupt */ + udev->regs.gr->GINTEN |= GINTEN_PTXFEIE; + } + break; + + default: + break; + } + + /* write packet into the TX fifo. */ + usb_txfifo_write (&udev->regs, pp->xfer_buf, pipe_num, (uint16_t)pp->xfer_len); + } + } + + return status; +} + +/*! + \brief halt pipe + \param[in] udev: pointer to USB device + \param[in] pipe_num: host pipe number which is in (0..7) + \param[out] none + \retval operation status +*/ +usb_status usb_pipe_halt (usb_core_driver *udev, uint8_t pipe_num) +{ + __IO uint32_t pp_ctl = udev->regs.pr[pipe_num]->HCHCTL; + + uint8_t ep_type = (uint8_t)((pp_ctl & HCHCTL_EPTYPE) >> 18U); + + pp_ctl |= HCHCTL_CEN | HCHCTL_CDIS; + + switch (ep_type) { + case USB_EPTYPE_CTRL: + case USB_EPTYPE_BULK: + if (0U == (udev->regs.gr->HNPTFQSTAT & HNPTFQSTAT_NPTXFS)) { + pp_ctl &= ~HCHCTL_CEN; + } + break; + + case USB_EPTYPE_INTR: + case USB_EPTYPE_ISOC: + if (0U == (udev->regs.hr->HPTFQSTAT & HPTFQSTAT_PTXFS)) { + pp_ctl &= ~HCHCTL_CEN; + } + break; + + default: + break; + } + + udev->regs.pr[pipe_num]->HCHCTL = pp_ctl; + + return USB_OK; +} + +/*! + \brief configure host pipe to do ping operation + \param[in] udev: pointer to USB device + \param[in] pipe_num: host pipe number which is in (0..7) + \param[out] none + \retval operation status +*/ +usb_status usb_pipe_ping (usb_core_driver *udev, uint8_t pipe_num) +{ + uint32_t pp_ctl = 0U; + + udev->regs.pr[pipe_num]->HCHLEN = HCHLEN_PING | (HCHLEN_PCNT & (1U << 19U)); + + pp_ctl = udev->regs.pr[pipe_num]->HCHCTL; + + pp_ctl |= HCHCTL_CEN; + pp_ctl &= ~HCHCTL_CDIS; + + udev->regs.pr[pipe_num]->HCHCTL = pp_ctl; + + return USB_OK; +} + +/*! + \brief stop the USB host and clean up FIFO + \param[in] udev: pointer to USB device + \param[out] none + \retval none +*/ +void usb_host_stop (usb_core_driver *udev) +{ + uint32_t i; + __IO uint32_t pp_ctl = 0U; + + udev->regs.hr->HACHINTEN = 0x0U; + udev->regs.hr->HACHINT = 0xFFFFFFFFU; + + /* flush out any leftover queued requests. */ + for (i = 0U; i < udev->bp.num_pipe; i++) { + pp_ctl = udev->regs.pr[i]->HCHCTL; + + pp_ctl &= ~(HCHCTL_CEN | HCHCTL_EPDIR); + pp_ctl |= HCHCTL_CDIS; + + udev->regs.pr[i]->HCHCTL = pp_ctl; + } + + /* flush the FIFO */ + usb_rxfifo_flush (&udev->regs); + usb_txfifo_flush (&udev->regs, 0x10U); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbd_int.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbd_int.c new file mode 100644 index 0000000..749a957 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbd_int.c @@ -0,0 +1,481 @@ +/*! + \file drv_usbd_int.c + \brief USB device mode interrupt routines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbd_conf.h" +#include "drv_usbd_int.h" +#include "usbd_transc.h" + +static uint32_t usbd_int_epout (usb_core_driver *udev); +static uint32_t usbd_int_epin (usb_core_driver *udev); +static uint32_t usbd_int_rxfifo (usb_core_driver *udev); +static uint32_t usbd_int_reset (usb_core_driver *udev); +static uint32_t usbd_int_enumfinish (usb_core_driver *udev); +static uint32_t usbd_int_suspend (usb_core_driver *udev); + +static uint32_t usbd_emptytxfifo_write (usb_core_driver *udev, uint32_t ep_num); + +static const uint8_t USB_SPEED[4] = +{ + [DSTAT_EM_HS_PHY_30MHZ_60MHZ] = (uint8_t)USB_SPEED_HIGH, + [DSTAT_EM_FS_PHY_30MHZ_60MHZ] = (uint8_t)USB_SPEED_FULL, + [DSTAT_EM_FS_PHY_48MHZ] = (uint8_t)USB_SPEED_FULL, + [DSTAT_EM_LS_PHY_6MHZ] = (uint8_t)USB_SPEED_LOW +}; + +/*! + \brief USB device-mode interrupt global service routine handler + \param[in] udev: pointer to USB device instance + \param[out] none + \retval none +*/ +void usbd_isr (usb_core_driver *udev) +{ + if (HOST_MODE != (udev->regs.gr->GINTF & GINTF_COPM)) { + uint32_t intr = udev->regs.gr->GINTF; + intr &= udev->regs.gr->GINTEN; + + /* there are no interrupt, avoid spurious interrupt */ + if (!intr) { + return; + } + + /* OUT endpoints interrupts */ + if (intr & GINTF_OEPIF) { + (void)usbd_int_epout (udev); + } + + /* IN endpoints interrupts */ + if (intr & GINTF_IEPIF) { + (void)usbd_int_epin (udev); + } + + /* suspend interrupt */ + if (intr & GINTF_SP) { + (void)usbd_int_suspend (udev); + } + + /* wakeup interrupt */ + if (intr & GINTF_WKUPIF) { + if(USBD_SUSPENDED == udev->dev.cur_status){ + /* inform upper layer by the resume event */ + udev->dev.cur_status = udev->dev.backup_status; + } + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_WKUPIF; + } + + /* start of frame interrupt */ + if (intr & GINTF_SOF) { + if (udev->dev.class_core->SOF) { + (void)udev->dev.class_core->SOF(udev); + } + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_SOF; + } + + /* receive FIFO not empty interrupt */ + if (intr & GINTF_RXFNEIF) { + (void)usbd_int_rxfifo (udev); + } + + /* USB reset interrupt */ + if (intr & GINTF_RST) { + (void)usbd_int_reset (udev); + } + + /* enumeration has been done interrupt */ + if (intr & GINTF_ENUMFIF) { + (void)usbd_int_enumfinish (udev); + } + + /* incomplete synchronization IN transfer interrupt */ + if (intr & GINTF_ISOINCIF) { + if (NULL != udev->dev.class_core->incomplete_isoc_in) { + (void)udev->dev.class_core->incomplete_isoc_in(udev); + } + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_ISOINCIF; + } + + /* incomplete synchronization OUT transfer interrupt */ + if (intr & GINTF_ISOONCIF) { + if (NULL != udev->dev.class_core->incomplete_isoc_out) { + (void)udev->dev.class_core->incomplete_isoc_out(udev); + } + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_ISOONCIF; + } + +#ifdef VBUS_SENSING_ENABLED + + /* session request interrupt */ + if (intr & GINTF_SESIF) { + udev->regs.gr->GINTF = GINTF_SESIF; + } + + /* OTG mode interrupt */ + if (intr & GINTF_OTGIF) { + if(udev->regs.gr->GOTGINTF & GOTGINTF_SESEND) { + + } + + /* clear OTG interrupt */ + udev->regs.gr->GINTF = GINTF_OTGIF; + } +#endif /* VBUS_SENSING_ENABLED */ + } +} + +/*! + \brief indicates that an OUT endpoint has a pending interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +static uint32_t usbd_int_epout (usb_core_driver *udev) +{ + uint32_t epintnum = 0U; + uint8_t ep_num = 0U; + + for (epintnum = usb_oepintnum_read (udev); epintnum; epintnum >>= 1, ep_num++) { + if (epintnum & 0x01U) { + __IO uint32_t oepintr = usb_oepintr_read (udev, ep_num); + + /* transfer complete interrupt */ + if (oepintr & DOEPINTF_TF) { + /* clear the bit in DOEPINTF for this interrupt */ + udev->regs.er_out[ep_num]->DOEPINTF = DOEPINTF_TF; + + /* inform upper layer: data ready */ + (void)usbd_out_transc (udev, ep_num); + } + + /* setup phase finished interrupt (control endpoints) */ + if (oepintr & DOEPINTF_STPF) { + /* inform the upper layer that a setup packet is available */ + (void)usbd_setup_transc (udev); + + udev->regs.er_out[ep_num]->DOEPINTF = DOEPINTF_STPF; + } + } + } + + return 1U; +} + +/*! + \brief indicates that an IN endpoint has a pending interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +static uint32_t usbd_int_epin (usb_core_driver *udev) +{ + uint32_t epintnum = 0U; + uint8_t ep_num = 0U; + + for (epintnum = usb_iepintnum_read (udev); epintnum; epintnum >>= 1, ep_num++) { + if (epintnum & 0x1U) { + __IO uint32_t iepintr = usb_iepintr_read (udev, ep_num); + + if (iepintr & DIEPINTF_TF) { + udev->regs.er_in[ep_num]->DIEPINTF = DIEPINTF_TF; + + /* data transmission is completed */ + (void)usbd_in_transc (udev, ep_num); + } + + if (iepintr & DIEPINTF_TXFE) { + usbd_emptytxfifo_write (udev, (uint32_t)ep_num); + + udev->regs.er_in[ep_num]->DIEPINTF = DIEPINTF_TXFE; + } + } + } + + return 1U; +} + +/*! + \brief handle the Rx status queue level interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +static uint32_t usbd_int_rxfifo (usb_core_driver *udev) +{ + usb_transc *transc = NULL; + + uint8_t data_PID = 0U; + uint32_t bcount = 0U; + + __IO uint32_t devrxstat = 0U; + + /* disable the Rx status queue non-empty interrupt */ + udev->regs.gr->GINTEN &= ~GINTEN_RXFNEIE; + + /* get the status from the top of the FIFO */ + devrxstat = udev->regs.gr->GRSTATP; + + uint8_t ep_num = (uint8_t)(devrxstat & GRSTATRP_EPNUM); + + transc = &udev->dev.transc_out[ep_num]; + + bcount = (devrxstat & GRSTATRP_BCOUNT) >> 4U; + data_PID = (uint8_t)((devrxstat & GRSTATRP_DPID) >> 15U); + + switch ((devrxstat & GRSTATRP_RPCKST) >> 17U) { + case RSTAT_GOUT_NAK: + break; + + case RSTAT_DATA_UPDT: + if (bcount > 0U) { + (void)usb_rxfifo_read (&udev->regs, transc->xfer_buf, (uint16_t)bcount); + + transc->xfer_buf += bcount; + transc->xfer_count += bcount; + } + break; + + case RSTAT_XFER_COMP: + /* trigger the OUT endpoint interrupt */ + break; + + case RSTAT_SETUP_COMP: + /* trigger the OUT endpoint interrupt */ + break; + + case RSTAT_SETUP_UPDT: +#ifdef GD32F10X_CL + #ifdef CDC_DATA_IN_EP + udev->regs.dr->DAEPINTEN |= (uint32_t)(1U << (EP_ID(CDC_DATA_IN_EP) + 16U)); + #endif /* CDC_DATA_IN_EP */ +#endif /* GD32F10X_CL */ + + if ((0U == transc->ep_addr.num) && (8U == bcount) && (DPID_DATA0 == data_PID)) { + /* copy the setup packet received in FIFO into the setup buffer in RAM */ + (void)usb_rxfifo_read (&udev->regs, (uint8_t *)&udev->dev.control.req, (uint16_t)bcount); + + transc->xfer_count += bcount; + } + break; + + default: + break; + } + + /* enable the Rx status queue level interrupt */ + udev->regs.gr->GINTEN |= GINTEN_RXFNEIE; + + return 1U; +} + +/*! + \brief handle USB reset interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval status +*/ +static uint32_t usbd_int_reset (usb_core_driver *udev) +{ + uint32_t i; + + /* clear the remote wakeup signaling */ + udev->regs.dr->DCTL &= ~DCTL_RWKUP; + + /* flush the Tx FIFO */ + (void)usb_txfifo_flush (&udev->regs, 0U); + + for (i = 0U; i < udev->bp.num_ep; i++) { + udev->regs.er_in[i]->DIEPINTF = 0xFFU; + udev->regs.er_out[i]->DOEPINTF = 0xFFU; + } + + /* clear all pending device endpoint interrupts */ + udev->regs.dr->DAEPINT = 0xFFFFFFFFU; + + /* enable endpoint 0 interrupt */ + udev->regs.dr->DAEPINTEN = 1U | (1U << 16U); + + /* enable OUT endpoint interrupts */ + udev->regs.dr->DOEPINTEN = DOEPINTEN_STPFEN | DOEPINTEN_TFEN; + + /* enable IN endpoint interrupts */ + udev->regs.dr->DIEPINTEN = DIEPINTEN_TFEN; + + /* reset device address */ + udev->regs.dr->DCFG &= ~DCFG_DAR; + + /* configure endpoint 0 to receive SETUP packets */ + usb_ctlep_startout (udev); + + /* clear USB reset interrupt */ + udev->regs.gr->GINTF = GINTF_RST; + + udev->dev.transc_out[0] = (usb_transc) { + .ep_type = USB_EPTYPE_CTRL, + .max_len = USB_FS_EP0_MAX_LEN + }; + + (void)usb_transc_active (udev, &udev->dev.transc_out[0]); + + udev->dev.transc_in[0] = (usb_transc) { + .ep_addr = { + .dir = 1U + }, + + .ep_type = USB_EPTYPE_CTRL, + .max_len = USB_FS_EP0_MAX_LEN + }; + + (void)usb_transc_active (udev, &udev->dev.transc_in[0]); + + /* upon reset call user call back */ + udev->dev.cur_status = (uint8_t)USBD_DEFAULT; + + return 1U; +} + +/*! + \brief handle USB speed enumeration finish interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval status +*/ +static uint32_t usbd_int_enumfinish (usb_core_driver *udev) +{ + uint8_t enum_speed = (uint8_t)((udev->regs.dr->DSTAT & DSTAT_ES) >> 1U); + + udev->regs.dr->DCTL &= ~DCTL_CGINAK; + udev->regs.dr->DCTL |= DCTL_CGINAK; + + udev->regs.gr->GUSBCS &= ~GUSBCS_UTT; + + /* set USB turn-around time based on device speed and PHY interface */ + if (USB_SPEED[enum_speed] == (uint8_t)USB_SPEED_HIGH) { + udev->bp.core_speed = (uint8_t)USB_SPEED_HIGH; + + udev->regs.gr->GUSBCS |= 0x09U << 10U; + } else { + udev->bp.core_speed = (uint8_t)USB_SPEED_FULL; + + udev->regs.gr->GUSBCS |= 0x05U << 10U; + } + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_ENUMFIF; + + return 1U; +} + +/*! + \brief USB suspend interrupt handler + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +static uint32_t usbd_int_suspend (usb_core_driver *udev) +{ + __IO uint8_t low_power = udev->bp.low_power; + __IO uint8_t suspend = (uint8_t)(udev->regs.dr->DSTAT & DSTAT_SPST); + __IO uint8_t is_configured = (udev->dev.cur_status == (uint8_t)USBD_CONFIGURED)? 1U : 0U; + + udev->dev.backup_status = udev->dev.cur_status; + udev->dev.cur_status = (uint8_t)USBD_SUSPENDED; + + if (low_power && suspend && is_configured) { + /* switch-off the OTG clocks */ + *udev->regs.PWRCLKCTL |= PWRCLKCTL_SUCLK | PWRCLKCTL_SHCLK; + + /* enter DEEP_SLEEP mode with LDO in low power mode */ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + } + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_SP; + + return 1U; +} + +/*! + \brief check FIFO for the next packet to be loaded + \param[in] udev: pointer to USB device instance + \param[in] ep_num: endpoint identifier which is in (0..3) + \param[out] none + \retval status +*/ +static uint32_t usbd_emptytxfifo_write (usb_core_driver *udev, uint32_t ep_num) +{ + uint32_t len; + uint32_t word_count; + + usb_transc *transc = &udev->dev.transc_in[ep_num]; + + len = transc->xfer_len - transc->xfer_count; + + /* get the data length to write */ + if (len > transc->max_len) { + len = transc->max_len; + } + + word_count = (len + 3U) / 4U; + + while (((udev->regs.er_in[ep_num]->DIEPTFSTAT & DIEPTFSTAT_IEPTFS) >= word_count) && \ + (transc->xfer_count < transc->xfer_len)) { + len = transc->xfer_len - transc->xfer_count; + + if (len > transc->max_len) { + len = transc->max_len; + } + + /* write FIFO in word(4bytes) */ + word_count = (len + 3U) / 4U; + + /* write the FIFO */ + (void)usb_txfifo_write (&udev->regs, transc->xfer_buf, (uint8_t)ep_num, (uint16_t)len); + + transc->xfer_buf += len; + transc->xfer_count += len; + + if (transc->xfer_count == transc->xfer_len) { + /* disable the device endpoint FIFO empty interrupt */ + udev->regs.dr->DIEPFEINTEN &= ~(0x01U << ep_num); + } + } + + return 1U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbh_int.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbh_int.c new file mode 100644 index 0000000..b435de4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/driver/Source/drv_usbh_int.c @@ -0,0 +1,621 @@ +/*! + \file drv_usbh_int.c + \brief USB host mode interrupt handler file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usbh_int.h" + +#if defined (__CC_ARM) /*!< ARM compiler */ + #pragma O0 +#elif defined (__GNUC__) /*!< GNU compiler */ + #pragma GCC optimize ("O0") +#elif defined (__TASKING__) /*!< TASKING compiler */ + #pragma optimize=0 +#endif /* __CC_ARM */ + +/* local function prototypes ('static') */ +static uint32_t usbh_int_port (usb_core_driver *udev); +static uint32_t usbh_int_pipe (usb_core_driver *udev); +static uint32_t usbh_int_pipe_in (usb_core_driver *udev, uint32_t pp_num); +static uint32_t usbh_int_pipe_out (usb_core_driver *udev, uint32_t pp_num); +static uint32_t usbh_int_rxfifonoempty (usb_core_driver *udev); +static uint32_t usbh_int_txfifoempty (usb_core_driver *udev, usb_pipe_mode pp_mode); + +/*! + \brief handle global host interrupt + \param[in] udev: pointer to USB core instance + \param[out] none + \retval operation status +*/ +uint32_t usbh_isr (usb_core_driver *udev) +{ + uint32_t retval = 0U; + + __IO uint32_t intr = 0U; + + /* check if host mode */ + if (HOST_MODE == (udev->regs.gr->GINTF & GINTF_COPM)) { + intr = usb_coreintr_get(&udev->regs); + + if (!intr) { + return 0U; + } + + if (intr & GINTF_SOF) { + usbh_int_fop->SOF(udev->host.data); + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_SOF; + } + + if (intr & GINTF_RXFNEIF) { + retval |= usbh_int_rxfifonoempty (udev); + } + + if (intr & GINTF_NPTXFEIF) { + retval |= usbh_int_txfifoempty (udev, PIPE_NON_PERIOD); + } + + if (intr & GINTF_PTXFEIF) { + retval |= usbh_int_txfifoempty (udev, PIPE_PERIOD); + } + + if (intr & GINTF_HCIF) { + retval |= usbh_int_pipe (udev); + } + + if (intr & GINTF_HPIF) { + retval |= usbh_int_port (udev); + } + + if (intr & GINTF_WKUPIF) { + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_WKUPIF; + } + + if (intr & GINTF_DISCIF) { + usbh_int_fop->disconnect(udev->host.data); + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_DISCIF; + } + + if (intr & GINTF_ISOONCIF) { + udev->regs.pr[0]->HCHCTL |= HCHCTL_CEN | HCHCTL_CDIS; + + /* clear interrupt */ + udev->regs.gr->GINTF = GINTF_ISOONCIF; + } + + if (intr & GINTF_SESIF) { + usb_portvbus_switch (udev, 1U); + + udev->regs.gr->GINTF = GINTF_SESIF; + } + } + + return retval; +} + +/*! + \brief handle USB pipe halt + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pp_num: host channel number which is in (0..7) + \param[in] pp_int: pipe interrupt + \param[in] pp_status: pipe status + \param[out] none + \retval none +*/ +static inline void usb_pp_halt (usb_core_driver *udev, + uint8_t pp_num, + uint32_t pp_int, + usb_pipe_staus pp_status) +{ + udev->regs.pr[pp_num]->HCHINTEN |= HCHINTEN_CHIE; + + usb_pipe_halt(udev, pp_num); + + udev->regs.pr[pp_num]->HCHINTF = pp_int; + + udev->host.pipe[pp_num].pp_status = pp_status; +} + +/*! + \brief handle the host port interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +#if defined (__ICCARM__) /*!< IAR compiler */ + #pragma optimize = none +#endif /* __ICCARM */ +static uint32_t usbh_int_port (usb_core_driver *udev) +{ + uint32_t retval = 0U; + + /* note: when the USB PHY use USB HS PHY, the flag is needed */ + uint8_t port_reset = 0U; + + __IO uint32_t port_state = *udev->regs.HPCS; + + /* clear the interrupt bits in GINTF */ + port_state &= ~(HPCS_PE | HPCS_PCD | HPCS_PEDC); + + /* port connect detected */ + if (*udev->regs.HPCS & HPCS_PCD) { + port_state |= HPCS_PCD; + + usbh_int_fop->connect(udev->host.data); + + retval |= 1U; + } + + /* port enable changed */ + if (*udev->regs.HPCS & HPCS_PEDC) { + port_state |= HPCS_PEDC; + + if (*udev->regs.HPCS & HPCS_PE) { + uint32_t port_speed = usb_curspeed_get(udev); + uint32_t clock_type = udev->regs.hr->HCTL & HCTL_CLKSEL; + + udev->host.connect_status = 1U; + + if (PORT_SPEED_LOW == port_speed) { + udev->regs.hr->HFT = 6000U; + + if (HCTL_6MHZ != clock_type) { + if (USB_EMBEDDED_PHY == udev->bp.phy_itf) { + usb_phyclock_config (udev, HCTL_6MHZ); + } + + port_reset = 1U; + } + } else if (PORT_SPEED_FULL == port_speed) { + udev->regs.hr->HFT = 48000U; + + if (HCTL_48MHZ != clock_type) { + if (USB_EMBEDDED_PHY == udev->bp.phy_itf) { + usb_phyclock_config (udev, HCTL_48MHZ); + } + + port_reset = 1U; + } + } else { + /* for high speed device and others */ + port_reset = 1U; + } + + udev->host.port_enabled = 1; + + udev->regs.gr->GINTEN |= GINTEN_DISCIE | GINTEN_SOFIE; + } else { + udev->host.port_enabled = 0; + } + } + + if (port_reset) { + usb_port_reset(udev); + } + + /* clear port interrupts */ + *udev->regs.HPCS = port_state; + + return retval; +} + +/*! + \brief handle all host channels interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +static uint32_t usbh_int_pipe (usb_core_driver *udev) +{ + uint32_t pp_num = 0U; + uint32_t retval = 0U; + + for (pp_num = 0U; pp_num < udev->bp.num_pipe; pp_num++) { + if ((udev->regs.hr->HACHINT & HACHINT_HACHINT) & (1UL << pp_num)) { + if (udev->regs.pr[pp_num]->HCHCTL & HCHCTL_EPDIR) { + retval |= usbh_int_pipe_in (udev, pp_num); + } else { + retval |= usbh_int_pipe_out (udev, pp_num); + } + } + } + + return retval; +} + +/*! + \brief handle the IN channel interrupt + \param[in] udev: pointer to USB device instance + \param[in] pp_num: host channel number which is in (0..7) + \param[out] none + \retval operation status +*/ +#if defined (__ICCARM__) /*!< IAR compiler */ + #pragma optimize = none +#endif /* __ICCARM */ +static uint32_t usbh_int_pipe_in (usb_core_driver *udev, uint32_t pp_num) +{ + usb_pr *pp_reg = udev->regs.pr[pp_num]; + + usb_pipe *pp = &udev->host.pipe[pp_num]; + + uint32_t intr_pp = pp_reg->HCHINTF; + intr_pp &= pp_reg->HCHINTEN; + + uint8_t ep_type = (uint8_t)((pp_reg->HCHCTL & HCHCTL_EPTYPE) >> 18U); + + if (intr_pp & HCHINTF_ACK) { + pp_reg->HCHINTF = HCHINTF_ACK; + } else if (intr_pp & HCHINTF_STALL) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_STALL, PIPE_STALL); + pp_reg->HCHINTF = HCHINTF_NAK; + + /* note: When there is a 'STALL', reset also NAK, + else, the udev->host.pp_status = HC_STALL + will be overwritten by 'NAK' in code below */ + intr_pp &= ~HCHINTF_NAK; + } else if (intr_pp & HCHINTF_DTER) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_DTER, PIPE_DTGERR); + pp_reg->HCHINTF = HCHINTF_NAK; + } else { + /* no operation */ + } + + if (intr_pp & HCHINTF_REQOVR) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_REQOVR, PIPE_REQOVR); + } else if (intr_pp & HCHINTF_TF) { + pp->pp_status = PIPE_XF; + pp->err_count = 0U; + + pp_reg->HCHINTF = HCHINTF_TF; + + switch (ep_type) { + case USB_EPTYPE_CTRL: + case USB_EPTYPE_BULK: + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_NAK, PIPE_XF); + + pp->data_toggle_in ^= 1U; + break; + + case USB_EPTYPE_INTR: + case USB_EPTYPE_ISOC: + pp_reg->HCHCTL |= HCHCTL_ODDFRM; + pp->urb_state = URB_DONE; + break; + + default: + break; + } + } else if (intr_pp & HCHINTF_CH) { + pp_reg->HCHINTEN &= ~HCHINTEN_CHIE; + + switch (pp->pp_status) { + case PIPE_XF: + pp->urb_state = URB_DONE; + break; + + case PIPE_STALL: + pp->urb_state = URB_STALL; + break; + + case PIPE_TRACERR: + case PIPE_DTGERR: + pp->err_count = 0U; + pp->urb_state = URB_ERROR; + + pp->data_toggle_in ^= 1U; + break; + + case PIPE_IDLE: + case PIPE_HALTED: + case PIPE_NAK: + case PIPE_NYET: + case PIPE_BBERR: + case PIPE_REQOVR: + default: + if((uint8_t)USB_EPTYPE_INTR == ep_type) { + pp->data_toggle_in ^= 1U; + } + break; + } + + pp_reg->HCHINTF = HCHINTF_CH; + } else if (intr_pp & HCHINTF_USBER) { + pp->err_count++; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_USBER, PIPE_TRACERR); + } else if (intr_pp & HCHINTF_NAK) { + switch (ep_type) { + case USB_EPTYPE_CTRL: + case USB_EPTYPE_BULK: + /* re-activate the channel */ + pp_reg->HCHCTL = (pp_reg->HCHCTL | HCHCTL_CEN) & ~HCHCTL_CDIS; + break; + + case USB_EPTYPE_INTR: + pp_reg->HCHINTEN |= HCHINTEN_CHIE; + + (void)usb_pipe_halt(udev, (uint8_t)pp_num); + break; + + default: + break; + } + + pp->pp_status = PIPE_NAK; + + pp_reg->HCHINTF = HCHINTF_NAK; + } else { + /* no operation */ + } + + return 1U; +} + +/*! + \brief handle the OUT channel interrupt + \param[in] udev: pointer to USB device instance + \param[in] pp_num: host channel number which is in (0..7) + \param[out] none + \retval operation status +*/ +#if defined (__ICCARM__) /*!< IAR compiler */ + #pragma optimize = none +#endif /* __ICCARM */ +static uint32_t usbh_int_pipe_out (usb_core_driver *udev, uint32_t pp_num) +{ + usb_pr *pp_reg = udev->regs.pr[pp_num]; + + usb_pipe *pp = &udev->host.pipe[pp_num]; + + uint32_t intr_pp = pp_reg->HCHINTF; + intr_pp &= pp_reg->HCHINTEN; + + if (intr_pp & HCHINTF_ACK) { + if (URB_PING == pp->urb_state) { + pp->err_count = 0U; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_TF, PIPE_XF); + } + + pp_reg->HCHINTF = HCHINTF_ACK; + } else if (intr_pp & HCHINTF_STALL) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_STALL, PIPE_STALL); + } else if (intr_pp & HCHINTF_DTER) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_DTER, PIPE_DTGERR); + pp_reg->HCHINTF = HCHINTF_NAK; + } else if (intr_pp & HCHINTF_REQOVR) { + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_REQOVR, PIPE_REQOVR); + } else if (intr_pp & HCHINTF_TF) { + pp->err_count = 0U; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_TF, PIPE_XF); + } else if (intr_pp & HCHINTF_NAK) { + pp->err_count = 0U; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_NAK, PIPE_NAK); + } else if (intr_pp & HCHINTF_USBER) { + pp->err_count++; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_USBER, PIPE_TRACERR); + } else if (intr_pp & HCHINTF_NYET) { + pp->err_count = 0U; + usb_pp_halt (udev, (uint8_t)pp_num, HCHINTF_NYET, PIPE_NYET); + } else if (intr_pp & HCHINTF_CH) { + udev->regs.pr[pp_num]->HCHINTEN &= ~HCHINTEN_CHIE; + + switch (pp->pp_status) { + case PIPE_XF: + pp->urb_state = URB_DONE; + + if ((uint8_t)USB_EPTYPE_BULK == ((pp_reg->HCHCTL & HCHCTL_EPTYPE) >> 18U)) { + pp->data_toggle_out ^= 1U; + } + break; + + case PIPE_NAK: + + if (URB_PING == pp->urb_state) { + (void)usb_pipe_ping (udev, (uint8_t)pp_num); + } else { + pp->urb_state = URB_NOTREADY; + } + break; + + case PIPE_NYET: + if (1U == udev->host.pipe[pp_num].ping) { + (void)usb_pipe_ping (udev, (uint8_t)pp_num); + pp->urb_state = URB_PING; + } + else { + pp->urb_state = URB_NOTREADY; + } + break; + + case PIPE_STALL: + pp->urb_state = URB_STALL; + break; + + case PIPE_TRACERR: + if (3U == pp->err_count) { + pp->urb_state = URB_ERROR; + pp->err_count = 0U; + } + break; + + case PIPE_IDLE: + case PIPE_HALTED: + case PIPE_BBERR: + case PIPE_REQOVR: + case PIPE_DTGERR: + default: + break; + } + + pp_reg->HCHINTF = HCHINTF_CH; + } else { + /* no operation */ + } + + return 1U; +} + +/*! + \brief handle the RX FIFO non-empty interrupt + \param[in] udev: pointer to USB device instance + \param[out] none + \retval operation status +*/ +#if defined (__ICCARM__) /*!< IAR compiler */ + #pragma optimize = none +#endif /* __ICCARM */ +static uint32_t usbh_int_rxfifonoempty (usb_core_driver *udev) +{ + uint32_t count = 0U, xfer_count = 0U; + + __IO uint8_t pp_num = 0U; + __IO uint32_t rx_stat = 0U; + + /* disable the RX status queue level interrupt */ + udev->regs.gr->GINTEN &= ~GINTEN_RXFNEIE; + + rx_stat = udev->regs.gr->GRSTATP; + pp_num = (uint8_t)(rx_stat & GRSTATRP_CNUM); + + switch ((rx_stat & GRSTATRP_RPCKST) >> 17U) { + case GRXSTS_PKTSTS_IN: + count = (rx_stat & GRSTATRP_BCOUNT) >> 4U; + + /* read the data into the host buffer. */ + if ((count > 0U) && (NULL != udev->host.pipe[pp_num].xfer_buf)) { + (void)usb_rxfifo_read (&udev->regs, udev->host.pipe[pp_num].xfer_buf, (uint16_t)count); + + /* manage multiple transfer packet */ + udev->host.pipe[pp_num].xfer_buf += count; + udev->host.pipe[pp_num].xfer_count += count; + + xfer_count = udev->host.pipe[pp_num].xfer_count; + + udev->host.backup_xfercount[pp_num] = xfer_count; + + if (udev->regs.pr[pp_num]->HCHLEN & HCHLEN_PCNT) { + /* re-activate the channel when more packets are expected */ + uint32_t pp_ctl = udev->regs.pr[pp_num]->HCHCTL; + + pp_ctl |= HCHCTL_CEN; + pp_ctl &= ~HCHCTL_CDIS; + + udev->regs.pr[pp_num]->HCHCTL = pp_ctl; + } + } + break; + + case GRXSTS_PKTSTS_IN_XFER_COMP: + break; + + case GRXSTS_PKTSTS_DATA_TOGGLE_ERR: + count = (rx_stat & GRSTATRP_BCOUNT) >> 4U; + + while (count > 0U) { + rx_stat = udev->regs.gr->GRSTATP; + count--; + } + break; + + case GRXSTS_PKTSTS_CH_HALTED: + break; + + default: + break; + } + + /* enable the RX status queue level interrupt */ + udev->regs.gr->GINTEN |= GINTEN_RXFNEIE; + + return 1U; +} + +/*! + \brief handle the TX FIFO empty interrupt + \param[in] udev: pointer to USB device instance + \param[in] pp_mode: pipe mode + \param[out] none + \retval operation status +*/ +#if defined (__ICCARM__) /*!< IAR compiler */ + #pragma optimize = none +#endif /* __ICCARM */ +static uint32_t usbh_int_txfifoempty (usb_core_driver *udev, usb_pipe_mode pp_mode) +{ + uint8_t pp_num = 0U; + uint16_t word_count = 0U, len = 0U; + __IO uint32_t *txfiforeg = 0U, txfifostate = 0U; + + if (PIPE_NON_PERIOD == pp_mode) { + txfiforeg = &udev->regs.gr->HNPTFQSTAT; + } else if (PIPE_PERIOD == pp_mode) { + txfiforeg = &udev->regs.hr->HPTFQSTAT; + } else { + return 0U; + } + + txfifostate = *txfiforeg; + + pp_num = (uint8_t)((txfifostate & TFQSTAT_CNUM) >> 27U); + + word_count = (uint16_t)(udev->host.pipe[pp_num].xfer_len + 3U) / 4U; + + while (((txfifostate & TFQSTAT_TXFS) >= word_count) && (0U != udev->host.pipe[pp_num].xfer_len)) { + len = (uint16_t)(txfifostate & TFQSTAT_TXFS) * 4U; + + if (len > udev->host.pipe[pp_num].xfer_len) { + /* last packet */ + len = (uint16_t)udev->host.pipe[pp_num].xfer_len; + + if (PIPE_NON_PERIOD == pp_mode) { + udev->regs.gr->GINTEN &= ~GINTEN_NPTXFEIE; + } else { + udev->regs.gr->GINTEN &= ~GINTEN_PTXFEIE; + } + } + + word_count = (uint16_t)((udev->host.pipe[pp_num].xfer_len + 3U) / 4U); + usb_txfifo_write (&udev->regs, udev->host.pipe[pp_num].xfer_buf, pp_num, len); + + udev->host.pipe[pp_num].xfer_buf += len; + udev->host.pipe[pp_num].xfer_len -= len; + udev->host.pipe[pp_num].xfer_count += len; + + txfifostate = *txfiforeg; + } + + return 1U; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_hid_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_hid_core.h new file mode 100644 index 0000000..7158f58 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_hid_core.h @@ -0,0 +1,120 @@ +/*! + \file usbh_hid_core.h + \brief header file for the usbh_hid_core.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_HID_CORE_H +#define __USBH_HID_CORE_H + +#include "usb_hid.h" +#include "usbh_enum.h" +#include "usbh_transc.h" + +#define HID_MIN_POLL 10U +#define HID_REPORT_SIZE 16U +#define HID_QUEUE_SIZE 10U + +#define USB_HID_DESC_SIZE 9U + +/* states for HID state machine */ +typedef enum +{ + HID_INIT = 0U, + HID_IDLE, + HID_SEND_DATA, + HID_BUSY, + HID_GET_DATA, + HID_SYNC, + HID_POLL, + HID_ERROR, +} hid_state; + +typedef enum +{ + HID_REQ_INIT = 0U, + HID_REQ_IDLE, + HID_REQ_GET_REPORT_DESC, + HID_REQ_GET_HID_DESC, + HID_REQ_SET_IDLE, + HID_REQ_SET_PROTOCOL, + HID_REQ_SET_REPORT, +} hid_ctlstate; + +typedef enum +{ + HID_MOUSE = 0x01U, + HID_KEYBOARD = 0x02U, + HID_UNKNOWN = 0xFFU, +} hid_type; + +typedef struct +{ + uint8_t *buf; + uint16_t head; + uint16_t tail; + uint16_t size; + uint8_t lock; +} data_fifo; + +/* structure for HID process */ +typedef struct _hid_process +{ + uint8_t pipe_in; + uint8_t pipe_out; + uint8_t ep_addr; + uint8_t ep_in; + uint8_t ep_out; + uint8_t *pdata; + __IO uint8_t data_ready; + uint16_t len; + uint16_t poll; + __IO uint32_t timer; + usb_desc_hid hid_desc; + hid_state state; + hid_ctlstate ctl_state; + usbh_status (*init)(usb_core_driver *udev, usbh_host *uhost); + usbh_status (*decode)(uint8_t *data); +} usbh_hid_handler; + +extern usbh_class usbh_hid; + +/* function declarations */ +/* set HID report */ +usbh_status usbh_set_report (usb_core_driver *udev, + usbh_host *uhost, + uint8_t report_type, + uint8_t report_ID, + uint8_t report_len, + uint8_t *report_buf); + + +#endif /* __USBH_HID_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_standard_hid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_standard_hid.h new file mode 100644 index 0000000..9474017 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Include/usbh_standard_hid.h @@ -0,0 +1,99 @@ +/*! + \file usbh_standard_hid.h + \brief header file for usbh_standard_hid.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_STANDARD_HID_H +#define __USBH_STANDARD_HID_H + +#include "usb_conf.h" +#include "usbh_hid_core.h" + +//#define AZERTY_KEYBOARD +#define QWERTY_KEYBOARD + +#define MOUSE_BUTTON_1 0x01U +#define MOUSE_BUTTON_2 0x02U +#define MOUSE_BUTTON_3 0x04U + +#define KBD_LEFT_CTRL 0x01U +#define KBD_LEFT_SHIFT 0x02U +#define KBD_LEFT_ALT 0x04U +#define KBD_LEFT_GUI 0x08U +#define KBD_RIGHT_CTRL 0x10U +#define KBD_RIGHT_SHIFT 0x20U +#define KBD_RIGHT_ALT 0x40U +#define KBD_RIGHT_GUI 0x80U + +#define KBD_PRESSED_MAX_NUM 6U + +typedef struct _hid_mouse_info +{ + uint8_t x; + uint8_t y; + uint8_t buttons[3]; +} hid_mouse_info; + +typedef struct +{ + uint8_t state; + uint8_t lctrl; + uint8_t lshift; + uint8_t lalt; + uint8_t lgui; + uint8_t rctrl; + uint8_t rshift; + uint8_t ralt; + uint8_t rgui; + uint8_t keys[6]; +} hid_keybd_info; + +/* function declarations */ +/* initialize mouse */ +void usr_mouse_init (void); +/* process mouse data */ +void usr_mouse_process_data (hid_mouse_info *data); +/* initialize mouse function */ +usbh_status usbh_hid_mouse_init (usb_core_driver *udev, usbh_host *uhost); +/* decode mouse information */ +usbh_status usbh_hid_mouse_decode(uint8_t *data); + +/* initialize keyboard */ +void usr_keyboard_init (void); +/* process keyboard data */ +void usr_keybrd_process_data (uint8_t pbuf); +/* initialize the keyboard function */ +usbh_status usbh_hid_keybd_init (usb_core_driver *udev, usbh_host *uhost); +/* decode keyboard information */ +usbh_status usbh_hid_keybrd_decode (uint8_t *data); + +#endif /* __USBH_STANDARD_HID_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_hid_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_hid_core.c new file mode 100644 index 0000000..d93b5b8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_hid_core.c @@ -0,0 +1,579 @@ +/*! + \file usbh_hid_core.c + \brief USB host HID class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_pipe.h" +#include "usbh_hid_core.h" +#include "usbh_standard_hid.h" + +#include +#include + +static void usbh_hiddesc_parse (usb_desc_hid *hid_desc, uint8_t *buf); +static void usbh_hid_itf_deinit (usbh_host *uhost); +static usbh_status usbh_hid_itf_init (usbh_host *uhost); +static usbh_status usbh_hid_class_req (usbh_host *uhost); +static usbh_status usbh_hid_handle (usbh_host *uhost); +static usbh_status usbh_hid_reportdesc_get (usbh_host *uhost, uint16_t len); +static usbh_status usbh_hid_sof(usbh_host *uhost); +static usbh_status usbh_hid_desc_get (usbh_host *uhost, uint16_t len); +static usbh_status usbh_set_idle (usbh_host *uhost, uint8_t duration, uint8_t report_ID); +static usbh_status usbh_set_protocol (usbh_host *uhost, uint8_t protocol); + +usbh_class usbh_hid = +{ + USB_HID_CLASS, + usbh_hid_itf_init, + usbh_hid_itf_deinit, + usbh_hid_class_req, + usbh_hid_handle, + usbh_hid_sof +}; + +/*! + \brief get report + \param[in] uhost: pointer to USB host + \param[in] report_type: duration for HID set idle request + \param[in] report_ID: targeted report ID for HID set idle request + \param[in] report_len: length of data report to be send + \param[in] report_buf: report buffer + \param[out] none + \retval operation status +*/ +usbh_status usbh_get_report (usbh_host *uhost, + uint8_t report_type, + uint8_t report_ID, + uint8_t report_len, + uint8_t *report_buf) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_ITF | USB_REQTYPE_CLASS, + .bRequest = GET_REPORT, + .wValue = (report_type << 8U) | report_ID, + .wIndex = 0U, + .wLength = report_len + }; + + usbh_ctlstate_config (uhost, report_buf, report_len); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set report + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[in] report_type: duration for HID set idle request + \param[in] report_ID: targeted report ID for HID set idle request + \param[in] report_len: length of data report to be send + \param[in] report_buf: report buffer + \param[out] none + \retval operation status +*/ +usbh_status usbh_set_report (usb_core_driver *udev, + usbh_host *uhost, + uint8_t report_type, + uint8_t report_ID, + uint8_t report_len, + uint8_t *report_buf) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_ITF | USB_REQTYPE_CLASS, + .bRequest = SET_REPORT, + .wValue = (report_type << 8U) | report_ID, + .wIndex = 0U, + .wLength = report_len + }; + + usbh_ctlstate_config (uhost, report_buf, report_len); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief deinitialize the host pipes used for the HID class + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +void usbh_hid_itf_deinit (usbh_host *uhost) +{ + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + if (0x00U != hid->pipe_in) { + usb_pipe_halt (uhost->data, hid->pipe_in); + + usbh_pipe_free (uhost->data, hid->pipe_in); + /* reset the pipe as free */ + hid->pipe_in = 0U; + } + + if (0x00U != hid->pipe_out) { + usb_pipe_halt (uhost->data, hid->pipe_out); + + usbh_pipe_free (uhost->data, hid->pipe_out); + /* reset the channel as free */ + hid->pipe_out = 0U; + } +} + +/*! + \brief return device type + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[out] none + \retval hid_type +*/ +hid_type usbh_hid_device_type_get(usb_core_driver *udev, usbh_host *uhost) +{ + hid_type type = HID_UNKNOWN; + uint8_t interface_protocol; + + if (HOST_CLASS_HANDLER == uhost->cur_state) { + interface_protocol = uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].itf_desc.bInterfaceProtocol; + + if (USB_HID_PROTOCOL_KEYBOARD == interface_protocol) { + type = HID_KEYBOARD; + } else { + if (USB_HID_PROTOCOL_MOUSE == interface_protocol) { + type = HID_MOUSE; + } + } + } + + return type; +} + +/*! + \brief return HID device poll time + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[out] none + \retval poll time (ms) +*/ +uint8_t usbh_hid_poll_interval_get (usb_core_driver *udev, usbh_host *uhost) +{ + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + if ((HOST_CLASS_ENUM == uhost->cur_state) || + (HOST_USER_INPUT == uhost->cur_state) || + (HOST_CLASS_CHECK == uhost->cur_state) || + (HOST_CLASS_HANDLER == uhost->cur_state)) { + return (uint8_t)(hid->poll); + } else { + return 0U; + } +} + +/*! + \brief initialize the hid class + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_itf_init (usbh_host *uhost) +{ + uint8_t num = 0U, ep_num = 0U, interface = 0U; + usbh_status status = USBH_BUSY; + + interface = usbh_interface_find(&uhost->dev_prop, USB_HID_CLASS, USB_HID_SUBCLASS_BOOT_ITF, 0xFFU); + + if (0xFFU == interface) { + uhost->usr_cb->dev_not_supported(); + + status = USBH_FAIL; + } else { + usbh_interface_select(&uhost->dev_prop, interface); + + static usbh_hid_handler hid_handler; + + memset((void*)&hid_handler, 0, sizeof(usbh_hid_handler)); + + hid_handler.state = HID_ERROR; + + uint8_t itf_protocol = uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].itf_desc.bInterfaceProtocol; + if (USB_HID_PROTOCOL_KEYBOARD == itf_protocol) { + hid_handler.init = usbh_hid_keybd_init; + hid_handler.decode = usbh_hid_keybrd_decode; + } else if (USB_HID_PROTOCOL_MOUSE == itf_protocol) { + hid_handler.init = usbh_hid_mouse_init; + hid_handler.decode = usbh_hid_mouse_decode; + } else { + status = USBH_FAIL; + } + + hid_handler.state = HID_INIT; + hid_handler.ctl_state = HID_REQ_INIT; + hid_handler.ep_addr = uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].ep_desc[0].bEndpointAddress; + hid_handler.len = uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].ep_desc[0].wMaxPacketSize; + hid_handler.poll = uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].ep_desc[0].bInterval; + + if (hid_handler.poll < HID_MIN_POLL) { + hid_handler.poll = HID_MIN_POLL; + } + + /* check fifo available number of endpoints */ + /* find the number of endpoints in the interface descriptor */ + /* choose the lower number in order not to overrun the buffer allocated */ + ep_num = USB_MIN(uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].itf_desc.bNumEndpoints, USBH_MAX_EP_NUM); + + /* decode endpoint IN and OUT address from interface descriptor */ + for (num = 0U; num < ep_num; num++) { + usb_desc_ep *ep_desc = &uhost->dev_prop.cfg_desc_set.itf_desc_set[uhost->dev_prop.cur_itf][0].ep_desc[num]; + + uint8_t ep_addr = ep_desc->bEndpointAddress; + + if (ep_addr & 0x80U) { + hid_handler.ep_in = ep_addr; + hid_handler.pipe_in = usbh_pipe_allocate (uhost->data, ep_addr); + + /* open channel for IN endpoint */ + usbh_pipe_create (uhost->data, + &uhost->dev_prop, + hid_handler.pipe_in, + USB_EPTYPE_INTR, + hid_handler.len); + + usbh_pipe_toggle_set(uhost->data, hid_handler.pipe_in, 0U); + } else { + hid_handler.ep_out = ep_addr; + hid_handler.pipe_out = usbh_pipe_allocate (uhost->data, ep_addr); + + /* open channel for OUT endpoint */ + usbh_pipe_create (uhost->data, + &uhost->dev_prop, + hid_handler.pipe_out, + USB_EPTYPE_INTR, + hid_handler.len); + + usbh_pipe_toggle_set(uhost->data, hid_handler.pipe_out, 0U); + } + } + + uhost->active_class->class_data = (void *)&hid_handler; + + status = USBH_OK; + } + + return status; +} + +/*! + \brief handle HID class requests for HID class + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_class_req (usbh_host *uhost) +{ + usbh_status status = USBH_BUSY; + usbh_status class_req_status = USBH_BUSY; + + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + /* handle HID control state machine */ + switch (hid->ctl_state) { + case HID_REQ_INIT: + case HID_REQ_GET_HID_DESC: + /* get HID descriptor */ + if (USBH_OK == usbh_hid_desc_get (uhost, USB_HID_DESC_SIZE)) { + usbh_hiddesc_parse(&hid->hid_desc, uhost->dev_prop.data); + + hid->ctl_state = HID_REQ_GET_REPORT_DESC; + } + break; + + case HID_REQ_GET_REPORT_DESC: + /* get report descriptor */ + if (USBH_OK == usbh_hid_reportdesc_get(uhost, hid->hid_desc.wDescriptorLength)) { + hid->ctl_state = HID_REQ_SET_IDLE; + } + break; + + case HID_REQ_SET_IDLE: + class_req_status = usbh_set_idle (uhost, 0U, 0U); + + /* set idle */ + if (USBH_OK == class_req_status) { + hid->ctl_state = HID_REQ_SET_PROTOCOL; + } else { + if(USBH_NOT_SUPPORTED == class_req_status) { + hid->ctl_state = HID_REQ_SET_PROTOCOL; + } + } + break; + + case HID_REQ_SET_PROTOCOL: + /* set protocol */ + if (USBH_OK == usbh_set_protocol (uhost, 0U)) { + hid->ctl_state = HID_REQ_IDLE; + + /* all requests performed */ + status = USBH_OK; + } + break; + + case HID_REQ_IDLE: + default: + break; + } + + return status; +} + +/*! + \brief manage state machine for HID data transfers + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_handle (usbh_host *uhost) +{ + usbh_status status = USBH_OK; + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + switch (hid->state) { + case HID_INIT: + hid->init(uhost->data, uhost); + hid->state = HID_IDLE; + break; + + case HID_IDLE: + hid->state = HID_SYNC; + status = USBH_OK; + break; + + case HID_SYNC: + if (true == usb_frame_even(uhost->data)) { + hid->state = HID_GET_DATA; + } + break; + + case HID_GET_DATA: + usbh_data_recev (uhost->data, hid->pdata, hid->pipe_in, hid->len); + + hid->state = HID_POLL; + hid->timer = usb_curframe_get (uhost->data); + hid->data_ready = 0U; + break; + + case HID_POLL: + if (URB_DONE == usbh_urbstate_get (uhost->data, hid->pipe_in)) { + if (0U == hid->data_ready) { + hid->data_ready = 1U; + + hid->decode(hid->pdata); + } + } else { + if (URB_STALL == usbh_urbstate_get (uhost->data, hid->pipe_in)) { + if (USBH_OK == (usbh_clrfeature (uhost, hid->ep_addr, hid->pipe_in))) { + hid->state = HID_GET_DATA; + } + } + } + break; + + default: + break; + } + return status; +} + +/*! + \brief send get report descriptor command to the device + \param[in] uhost: pointer to USB host + \param[in] len: HID report descriptor length + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_reportdesc_get (usbh_host *uhost, uint16_t len) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_ITF | USB_REQTYPE_STRD, + .bRequest = USB_GET_DESCRIPTOR, + .wValue = USBH_DESC(USB_DESCTYPE_REPORT), + .wIndex = 0U, + .wLength = len + }; + + usbh_ctlstate_config (uhost, uhost->dev_prop.data, len); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief managing the SOF process + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_sof(usbh_host *uhost) +{ + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + if (HID_POLL == hid->state) { + uint32_t frame_count = usb_curframe_get (uhost->data); + + if ((frame_count > hid->timer) && ((frame_count - hid->timer) >= hid->poll)) { + hid->state = HID_GET_DATA; + } else if ((frame_count < hid->timer) && ((frame_count + 0x3FFFU - hid->timer) >= hid->poll)) { + hid->state = HID_GET_DATA; + } else { + /* no operation */ + } + } + + return USBH_OK; +} + +/*! + \brief send the command of get HID descriptor to the device + \param[in] uhost: pointer to USB host + \param[in] len: HID descriptor length + \param[out] none + \retval operation status +*/ +static usbh_status usbh_hid_desc_get (usbh_host *uhost, uint16_t len) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_ITF | USB_REQTYPE_STRD, + .bRequest = USB_GET_DESCRIPTOR, + .wValue = USBH_DESC(USB_DESCTYPE_HID), + .wIndex = 0U, + .wLength = len + }; + + usbh_ctlstate_config (uhost, uhost->dev_prop.data, len); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set idle state + \param[in] uhost: pointer to USB host + \param[in] duration: duration for HID set idle request + \param[in] report_ID: targeted report ID for HID set idle request + \param[out] none + \retval operation status +*/ +static usbh_status usbh_set_idle (usbh_host *uhost, uint8_t duration, uint8_t report_ID) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_ITF | USB_REQTYPE_CLASS, + .bRequest = SET_IDLE, + .wValue = (duration << 8U) | report_ID, + .wIndex = 0U, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set protocol state + \param[in] uhost: pointer to USB host + \param[in] protocol: boot/report protocol + \param[out] none + \retval operation status +*/ +static usbh_status usbh_set_protocol (usbh_host *uhost, uint8_t protocol) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_ITF | USB_REQTYPE_CLASS, + .bRequest = SET_PROTOCOL, + .wValue = !protocol, + .wIndex = 0U, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief parse the HID descriptor + \param[in] hid_desc: pointer to HID descriptor + \param[in] buf: pointer to buffer where the source descriptor is available + \param[out] none + \retval none +*/ +static void usbh_hiddesc_parse (usb_desc_hid *hid_desc, uint8_t *buf) +{ + hid_desc->header.bLength = *(uint8_t *)(buf + 0U); + hid_desc->header.bDescriptorType = *(uint8_t *)(buf + 1U); + hid_desc->bcdHID = BYTE_SWAP(buf + 2U); + hid_desc->bCountryCode = *(uint8_t *)(buf + 4U); + hid_desc->bNumDescriptors = *(uint8_t *)(buf + 5U); + hid_desc->bDescriptorType = *(uint8_t *)(buf + 6U); + hid_desc->wDescriptorLength = BYTE_SWAP(buf + 7U); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_standard_hid.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_standard_hid.c new file mode 100644 index 0000000..27ac3c4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/hid/Source/usbh_standard_hid.c @@ -0,0 +1,273 @@ +/*! + \file usbh_standard_hid.c + \brief USB host HID keyboard and mouse driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_standard_hid.h" +#include + +hid_mouse_info mouse_info; +hid_keybd_info keybd_info; + +uint8_t mouse_report_data[4] = {0U}; +uint32_t keybd_report_data[2]; + +/* local constants */ +static const uint8_t kbd_codes[] = +{ + 0, 0, 0, 0, 31, 50, 48, 33, + 19, 34, 35, 36, 24, 37, 38, 39, /* 0x00 - 0x0F */ + 52, 51, 25, 26, 17, 20, 32, 21, + 23, 49, 18, 47, 22, 46, 2, 3, /* 0x10 - 0x1F */ + 4, 5, 6, 7, 8, 9, 10, 11, + 43, 110, 15, 16, 61, 12, 13, 27, /* 0x20 - 0x2F */ + 28, 29, 42, 40, 41, 1, 53, 54, + 55, 30, 112, 113, 114, 115, 116, 117, /* 0x30 - 0x3F */ + 118, 119, 120, 121, 122, 123, 124, 125, + 126, 75, 80, 85, 76, 81, 86, 89, /* 0x40 - 0x4F */ + 79, 84, 83, 90, 95, 100, 105, 106, + 108, 93, 98, 103, 92, 97, 102, 91, /* 0x50 - 0x5F */ + 96, 101, 99, 104, 45, 129, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6F */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7F */ + 0, 0, 0, 0, 0, 107, 0, 56, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8F */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9F */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 - 0xAF */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 - 0xBF */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 - 0xCF */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 - 0xDF */ + 58, 44, 60, 127, 64, 57, 62, 128 /* 0xE0 - 0xE7 */ +}; + +#ifdef QWERTY_KEYBOARD + +static const int8_t kbd_key[] = +{ + '\0', '`', '1', '2', '3', '4', '5', '6', + '7', '8', '9', '0', '-', '=', '\0', '\r', + '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', + 'i', 'o', 'p', '[', ']', '\\', + '\0', 'a', 's', 'd', 'f', 'g', 'h', 'j', + 'k', 'l', ';', '\'', '\0', '\n', + '\0', '\0', 'z', 'x', 'c', 'v', 'b', 'n', + 'm', ',', '.', '/', '\0', '\0', + '\0', '\0', '\0', ' ', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '7', '4', '1', + '\0', '/', '8', '5', '2', + '0', '*', '9', '6', '3', + '.', '-', '+', '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0' +}; + +static const int8_t kbd_key_shift[] = { + '\0', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', + '_', '+', '\0', '\0', '\0', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', + 'I', 'O', 'P', '{', '}', '|', '\0', 'A', 'S', 'D', 'F', 'G', + 'H', 'J', 'K', 'L', ':', '"', '\0', '\n', '\0', '\0', 'Z', 'X', + 'C', 'V', 'B', 'N', 'M', '<', '>', '?', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' +}; + +#else + +static const int8_t kbd_key[] = { + '\0', '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + '-', '=', '\0', '\r', '\t', 'a', 'z', 'e', 'r', 't', 'y', 'u', + 'i', 'o', 'p', '[', ']', '\\', '\0', 'q', 's', 'd', 'f', 'g', + 'h', 'j', 'k', 'l', 'm', '\0', '\0', '\n', '\0', '\0', 'w', 'x', + 'c', 'v', 'b', 'n', ',', ';', ':', '!', '\0', '\0', '\0', '\0', + '\0', ' ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '7', '4', '1', '\0', '/', + '8', '5', '2', '0', '*', '9', '6', '3', '.', '-', '+', '\0', + '\n', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' +}; + +static const int8_t kbd_key_shift[] = { + '\0', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', + '+', '\0', '\0', '\0', 'A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', + 'P', '{', '}', '*', '\0', 'Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K', + 'L', 'M', '%', '\0', '\n', '\0', '\0', 'W', 'X', 'C', 'V', 'B', 'N', + '?', '.', '/', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' +}; + +#endif /* QWERTY_KEYBOARD */ + +/*! + \brief initialize the mouse function + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +usbh_status usbh_hid_mouse_init (usb_core_driver *udev, usbh_host *uhost) +{ + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + mouse_info.x = 0U; + mouse_info.y = 0U; + mouse_info.buttons[0] = 0U; + mouse_info.buttons[1] = 0U; + mouse_info.buttons[2] = 0U; + + if(hid->len > sizeof(mouse_report_data)) { + hid->len = sizeof(mouse_report_data); + } + + hid->pdata = (uint8_t *)(void *)mouse_report_data; + + usr_mouse_init(); + + return USBH_OK; +} + +/*! + \brief decode mouse information + \param[in] data: pointer to inut data + \param[out] none + \retval operation status +*/ +usbh_status usbh_hid_mouse_decode(uint8_t *data) +{ + mouse_info.buttons[0] = data[0] & MOUSE_BUTTON_1; + mouse_info.buttons[1] = data[0] & MOUSE_BUTTON_2; + mouse_info.buttons[2] = data[0] & MOUSE_BUTTON_3; + + mouse_info.x = data[1]; + mouse_info.y = data[2]; + + /* handle mouse data position */ + usr_mouse_process_data(&mouse_info); + + return USBH_FAIL; +} + +/*! + \brief initialize the keyboard function + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +usbh_status usbh_hid_keybd_init (usb_core_driver *udev, usbh_host *uhost) +{ + usbh_hid_handler *hid = (usbh_hid_handler *)uhost->active_class->class_data; + + keybd_info.lctrl = keybd_info.lshift = 0U; + keybd_info.lalt = keybd_info.lgui = 0U; + keybd_info.rctrl = keybd_info.rshift = 0U; + keybd_info.ralt = keybd_info.rgui = 0U; + + for (uint32_t x = 0U; x < (sizeof(keybd_report_data) / sizeof(uint32_t)); x++) { + keybd_report_data[x] = 0U; + } + + if (hid->len > (sizeof(keybd_report_data) / sizeof(uint32_t))) { + hid->len = (sizeof(keybd_report_data) / sizeof(uint32_t)); + } + + hid->pdata = (uint8_t*)(void *)keybd_report_data; + + /* call user initialization*/ + usr_keyboard_init(); + + return USBH_OK; +} + +/*! + \brief get ascii code + \param[in] info: keyboard information + \param[out] none + \retval output +*/ +uint8_t usbh_hid_ascii_code_get (hid_keybd_info *info) +{ + uint8_t output; + if ((1U == info->lshift) || (info->rshift)) { + output = kbd_key_shift[kbd_codes[info->keys[0]]]; + } else { + output = kbd_key[kbd_codes[info->keys[0]]]; + } + + return output; +} + +/*! + \brief decode keyboard information + \param[in] udev: pointer to USB core instance + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +usbh_status usbh_hid_keybrd_decode (uint8_t *data) +{ + uint8_t output; + + keybd_info.lshift = data[0] & KBD_LEFT_SHIFT; + keybd_info.rshift = data[0] & KBD_RIGHT_SHIFT; + + keybd_info.keys[0] = data[2]; + + if (keybd_info.lshift || keybd_info.rshift) { + output = kbd_key_shift[kbd_codes[keybd_info.keys[0]]]; + } else { + output = kbd_key[kbd_codes[keybd_info.keys[0]]]; + } + + if (0U != output) { + usr_keybrd_process_data(output); + } + + return USBH_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_bbb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_bbb.h new file mode 100644 index 0000000..914f2b5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_bbb.h @@ -0,0 +1,153 @@ +/*! + \file usbh_msc_bbb.h + \brief header file for usbh_msc_bbb.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_MSC_BBB_H +#define __USBH_MSC_BBB_H + +#include "usbh_enum.h" +#include "msc_bbb.h" + +typedef union +{ + msc_bbb_cbw field; + + uint8_t CBWArray[31]; +}usbh_cbw_pkt; + +typedef union +{ + msc_bbb_csw field; + + uint8_t CSWArray[13]; +}usbh_csw_pkt; + +enum usbh_msc_state +{ + USBH_MSC_BBB_INIT_STATE = 0U, + USBH_MSC_BBB_RESET, + USBH_MSC_GET_MAX_LUN, + USBH_MSC_TEST_UNIT_READY, + USBH_MSC_READ_CAPACITY10, + USBH_MSC_MODE_SENSE6, + USBH_MSC_REQUEST_SENSE, + USBH_MSC_BBB_USB_TRANSFERS, + USBH_MSC_DEFAULT_APPLI_STATE, + USBH_MSC_CTRL_ERROR_STATE, + USBH_MSC_UNRECOVERED_STATE +}; + +typedef enum +{ + BBB_OK = 0U, + BBB_FAIL, + BBB_PHASE_ERROR, + BBB_BUSY +} bbb_status; + +typedef enum +{ + BBB_CMD_IDLE = 0U, + BBB_CMD_SEND, + BBB_CMD_WAIT, +} bbb_cmd_state; + +/* csw status definitions */ +typedef enum +{ + BBB_CSW_CMD_PASSED = 0U, + BBB_CSW_CMD_FAILED, + BBB_CSW_PHASE_ERROR, +} bbb_csw_status; + +typedef enum +{ + BBB_SEND_CBW = 1U, + BBB_SEND_CBW_WAIT, + BBB_DATA_IN, + BBB_DATA_IN_WAIT, + BBB_DATA_OUT, + BBB_DATA_OUT_WAIT, + BBB_RECEIVE_CSW, + BBB_RECEIVE_CSW_WAIT, + BBB_ERROR_IN, + BBB_ERROR_OUT, + BBB_UNRECOVERED_ERROR +} bbb_state; + +typedef struct +{ + uint8_t *pbuf; + uint32_t data[16]; + bbb_state state; + bbb_state prev_state; + bbb_cmd_state cmd_state; + usbh_cbw_pkt cbw; + usbh_csw_pkt csw; +} bbb_handle; + +#define USBH_MSC_BBB_CBW_TAG 0x20304050U + +#define USBH_MSC_CSW_MAX_LENGTH 63U + +#define USBH_MSC_SEND_CSW_DISABLE 0U +#define USBH_MSC_SEND_CSW_ENABLE 1U + +#define USBH_MSC_DIR_IN 0U +#define USBH_MSC_DIR_OUT 1U +#define USBH_MSC_BOTH_DIR 2U + +#define USBH_MSC_PAGE_LENGTH 512U + +#define CBW_CB_LENGTH 16U +#define CBW_LENGTH 10U +#define CBW_LENGTH_TEST_UNIT_READY 0U + +#define MAX_BULK_STALL_COUNT_LIMIT 0x04U /*!< If STALL is seen on Bulk + Endpoint continously, this means + that device and Host has phase error + Hence a Reset is needed */ + +/* function declarations */ +/* initialize the mass storage parameters */ +void usbh_msc_bbb_init (usbh_host *uhost); +/* manage the different states of BOT transfer and updates the status to upper layer */ +usbh_status usbh_msc_bbb_process (usbh_host *uhost, uint8_t lun); +/* manages the different error handling for stall */ +usbh_status usbh_msc_bbb_abort (usbh_host *uhost, uint8_t direction); +/* reset MSC bot request structure */ +usbh_status usbh_msc_bbb_reset (usbh_host *uhost); +/* decode the CSW received by the device and updates the same to upper layer */ +bbb_csw_status usbh_msc_csw_decode (usbh_host *uhost); + +#endif /* __USBH_MSC_BBB_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_core.h new file mode 100644 index 0000000..6334458 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_core.h @@ -0,0 +1,124 @@ +/*! + \file usbh_core.h + \brief header file for the usbh_core.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_MSC_CORE_H +#define __USBH_MSC_CORE_H + +#include "usb_msc.h" +#include "usbh_msc_scsi.h" +#include "usbh_msc_bbb.h" + +#define MSC_MAX_SUPPORTED_LUN 2U + +typedef enum +{ + MSC_INIT = 0U, + MSC_IDLE, + MSC_TEST_UNIT_READY, + MSC_READ_CAPACITY10, + MSC_READ_INQUIRY, + MSC_REQUEST_SENSE, + MSC_READ, + MSC_WRITE, + MSC_UNRECOVERED_ERROR, + MSC_PERIODIC_CHECK, +} msc_state; + +typedef enum +{ + MSC_OK, + MSC_NOT_READY, + MSC_ERROR, +} msc_error; + +typedef enum +{ + MSC_REQ_IDLE = 0U, + MSC_REQ_RESET, + MSC_REQ_GET_MAX_LUN, + MSC_REQ_ERROR, +} msc_req_state; + +/* Structure for LUN */ +typedef struct +{ + msc_state state; + msc_error error; + msc_scsi_sense sense; + scsi_capacity capacity; + scsi_std_inquiry_data inquiry; + usbh_status prev_ready_state; + uint8_t state_changed; +} msc_lun; + +/* structure for MSC process */ +typedef struct _msc_process +{ + uint8_t pipe_in; + uint8_t pipe_out; + uint8_t ep_in; + uint8_t ep_out; + uint16_t ep_size_in; + uint16_t ep_size_out; + uint8_t cur_lun; + uint16_t rw_lun; + uint32_t max_lun; + msc_state state; + msc_error error; + msc_req_state req_state; + msc_req_state prev_req_state; + bbb_handle bot; + msc_lun unit[MSC_MAX_SUPPORTED_LUN]; + uint32_t timer; +} usbh_msc_handler; + +extern usbh_class usbh_msc; + +/* function declarations */ +/* get msc logic unit information */ +usbh_status usbh_msc_lun_info_get (usbh_host *uhost, uint8_t lun, msc_lun *info); +/* msc read interface */ +usbh_status usbh_msc_read (usbh_host *uhost, + uint8_t lun, + uint32_t address, + uint8_t *pbuf, + uint32_t length); +/* msc write interface */ +usbh_status usbh_msc_write (usbh_host *uhost, + uint8_t lun, + uint32_t address, + uint8_t *pbuf, + uint32_t length); + +#endif /* __USBH_MSC_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_scsi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_scsi.h new file mode 100644 index 0000000..9453e81 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Include/usbh_msc_scsi.h @@ -0,0 +1,100 @@ +/*! + \file usbh_msc_scsi.h + \brief header file for usbh_msc_scsi.c + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_MSC_SCSI_H +#define __USBH_MSC_SCSI_H + +#include "msc_scsi.h" +#include "usbh_enum.h" + +/* capacity data */ +typedef struct +{ + uint32_t block_nbr; + uint16_t block_size; +} scsi_capacity; + +/* inquiry data */ +typedef struct +{ + uint8_t peripheral_qualifier; + uint8_t device_type; + uint8_t removable_media; + uint8_t vendor_id[9]; + uint8_t product_id[17]; + uint8_t revision_id[5]; +} scsi_std_inquiry_data; + +typedef struct +{ + uint32_t msc_capacity; + uint32_t msc_sense_key; + uint16_t msc_page_len; + uint8_t msc_write_protect; +}usbh_msc_parameter; + +#define DESC_REQUEST_SENSE 0x00U +#define ALLOCATION_LENGTH_REQUEST_SENSE 63U +#define XFER_LEN_MODE_SENSE6 63U + +#define MASK_MODE_SENSE_WRITE_PROTECT 0x80U +#define MODE_SENSE_PAGE_CONTROL_FIELD 0x00U +#define MODE_SENSE_PAGE_CODE 0x3FU +#define DISK_WRITE_PROTECTED 0x01U + +/* function declarations */ +/* send 'inquiry' command to the device */ +usbh_status usbh_msc_scsi_inquiry (usbh_host *uhost, uint8_t lun, scsi_std_inquiry_data *inquiry); +/* send 'test unit ready' command to the device */ +usbh_status usbh_msc_test_unitready (usbh_host *uhost, uint8_t lun); +/* send the read capacity command to the device */ +usbh_status usbh_msc_read_capacity10 (usbh_host *uhost, uint8_t lun, scsi_capacity *capacity); +/* send the mode sense6 command to the device */ +usbh_status usbh_msc_mode_sense6 (usbh_host *uhost, uint8_t lun); +/* send the request sense command to the device */ +usbh_status usbh_msc_request_sense (usbh_host *uhost, uint8_t lun, msc_scsi_sense *sense_data); +/* send the write10 command to the device */ +usbh_status usbh_msc_write10 (usbh_host *uhost, + uint8_t lun, + uint8_t *data_buf, + uint32_t addr, + uint32_t byte_num); +/* send the read10 command to the device */ +usbh_status usbh_msc_read10 (usbh_host *uhost, + uint8_t lun, + uint8_t *data_buf, + uint32_t addr, + uint32_t byte_num); + +#endif /* __USBH_MSC_SCSI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_bbb.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_bbb.c new file mode 100644 index 0000000..1ca02d3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_bbb.c @@ -0,0 +1,355 @@ +/*! + \file usbh_msc_bbb.c + \brief USB MSC BBB protocol related functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_pipe.h" +#include "usbh_msc_core.h" +#include "usbh_msc_scsi.h" +#include "usbh_msc_bbb.h" +#include "usbh_transc.h" +#include "drv_usbh_int.h" + +/*! + \brief initialize the mass storage parameters + \param[in] uhost: pointer to USB host handler + \param[out] none + \retval none +*/ +void usbh_msc_bbb_init (usbh_host *uhost) +{ + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + msc->bot.cbw.field.dCBWSignature = BBB_CBW_SIGNATURE; + msc->bot.cbw.field.dCBWTag = USBH_MSC_BBB_CBW_TAG; + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_SEND; +} + +/*! + \brief manage the different states of BOT transfer and updates the status to upper layer + \param[in] uhost: pointer to usb host handler + \param[in] lun: logic unit number + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_bbb_process (usbh_host *uhost, uint8_t lun) +{ + bbb_csw_status csw_status = BBB_CSW_CMD_FAILED; + usbh_status status = USBH_BUSY; + usbh_status error = USBH_BUSY; + usb_urb_state urb_status = URB_IDLE; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.state) { + case BBB_SEND_CBW: + msc->bot.cbw.field.bCBWLUN = lun; + msc->bot.state = BBB_SEND_CBW_WAIT; + /* send CBW */ + usbh_data_send (uhost->data, + msc->bot.cbw.CBWArray, + msc->pipe_out, + BBB_CBW_LENGTH); + break; + + case BBB_SEND_CBW_WAIT: + urb_status = usbh_urbstate_get(uhost->data, msc->pipe_out); + + if (URB_DONE == urb_status) { + if (0U != msc->bot.cbw.field.dCBWDataTransferLength) { + if (USB_TRX_IN == (msc->bot.cbw.field.bmCBWFlags & USB_TRX_MASK)) { + msc->bot.state = BBB_DATA_IN; + } else { + msc->bot.state = BBB_DATA_OUT; + } + } else { + msc->bot.state = BBB_RECEIVE_CSW; + } + + } else if (URB_NOTREADY == urb_status) { + msc->bot.state = BBB_SEND_CBW; + } else { + if (URB_STALL == urb_status) { + msc->bot.state = BBB_ERROR_OUT; + } + } + break; + + case BBB_DATA_IN: + usbh_data_recev (uhost->data, + msc->bot.pbuf, + msc->pipe_in, + msc->ep_size_in); + + msc->bot.state = BBB_DATA_IN_WAIT; + break; + + case BBB_DATA_IN_WAIT: + urb_status = usbh_urbstate_get(uhost->data, msc->pipe_in); + + /* BOT DATA IN stage */ + if (URB_DONE == urb_status) { + if (msc->bot.cbw.field.dCBWDataTransferLength > msc->ep_size_in) { + msc->bot.pbuf += msc->ep_size_in; + msc->bot.cbw.field.dCBWDataTransferLength -= msc->ep_size_in; + } else { + msc->bot.cbw.field.dCBWDataTransferLength = 0U; + } + + if (msc->bot.cbw.field.dCBWDataTransferLength > 0U) { + usbh_data_recev (uhost->data, + msc->bot.pbuf, + msc->pipe_in, + msc->ep_size_in); + } else { + msc->bot.state = BBB_RECEIVE_CSW; + } + } else if(URB_STALL == urb_status) { + /* this is data stage stall condition */ + msc->bot.state = BBB_ERROR_IN; + } else { + /* no operation */ + } + break; + + case BBB_DATA_OUT: + usbh_data_send (uhost->data, + msc->bot.pbuf, + msc->pipe_out, + msc->ep_size_out); + + msc->bot.state = BBB_DATA_OUT_WAIT; + break; + + case BBB_DATA_OUT_WAIT: + /* BOT DATA OUT stage */ + urb_status = usbh_urbstate_get(uhost->data, msc->pipe_out); + if (URB_DONE == urb_status) { + if (msc->bot.cbw.field.dCBWDataTransferLength > msc->ep_size_out) { + msc->bot.pbuf += msc->ep_size_out; + msc->bot.cbw.field.dCBWDataTransferLength -= msc->ep_size_out; + } else { + msc->bot.cbw.field.dCBWDataTransferLength = 0; /* reset this value and keep in same state */ + } + + if (msc->bot.cbw.field.dCBWDataTransferLength > 0) { + usbh_data_send (uhost->data, + msc->bot.pbuf, + msc->pipe_out, + msc->ep_size_out); + } else { + msc->bot.state = BBB_RECEIVE_CSW; + } + } else if (URB_NOTREADY == urb_status) { + msc->bot.state = BBB_DATA_OUT; + } else if (URB_STALL == urb_status) { + msc->bot.state = BBB_ERROR_OUT; + } else { + /* no operation */ + } + break; + + case BBB_RECEIVE_CSW: + /* BOT CSW stage */ + usbh_data_recev (uhost->data, + msc->bot.csw.CSWArray, + msc->pipe_in, + BBB_CSW_LENGTH); + + msc->bot.state = BBB_RECEIVE_CSW_WAIT; + break; + + case BBB_RECEIVE_CSW_WAIT: + urb_status = usbh_urbstate_get(uhost->data, msc->pipe_in); + + /* decode CSW */ + if (URB_DONE == urb_status) { + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_SEND; + + csw_status = usbh_msc_csw_decode(uhost); + if (BBB_CSW_CMD_PASSED == csw_status) { + status = USBH_OK; + } else { + status = USBH_FAIL; + } + } else if (URB_STALL == urb_status) { + msc->bot.state = BBB_ERROR_IN; + } else { + /* no operation */ + } + break; + + case BBB_ERROR_IN: + error = usbh_msc_bbb_abort(uhost, USBH_MSC_DIR_IN); + + if (USBH_OK == error) { + msc->bot.state = BBB_RECEIVE_CSW; + } else if (USBH_UNRECOVERED_ERROR == status) { + /* this means that there is a stall error limit, do reset recovery */ + msc->bot.state = BBB_UNRECOVERED_ERROR; + } else { + /* no operation */ + } + break; + + case BBB_ERROR_OUT: + status = usbh_msc_bbb_abort (uhost, USBH_MSC_DIR_OUT); + + if (USBH_OK == status) { + uint8_t toggle = usbh_pipe_toggle_get(uhost->data, msc->pipe_out); + usbh_pipe_toggle_set(uhost->data, msc->pipe_out, 1U - toggle); + usbh_pipe_toggle_set(uhost->data, msc->pipe_in, 0U); + msc->bot.state = BBB_ERROR_IN; + } else { + if (USBH_UNRECOVERED_ERROR == status) { + msc->bot.state = BBB_UNRECOVERED_ERROR; + } + } + break; + + case BBB_UNRECOVERED_ERROR: + status = usbh_msc_bbb_reset(uhost); + if (USBH_OK == status) { + msc->bot.state = BBB_SEND_CBW; + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief manages the different error handling for stall + \param[in] uhost: pointer to USB host handler + \param[in] direction: data IN or OUT + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_bbb_abort (usbh_host *uhost, uint8_t direction) +{ + usbh_status status = USBH_BUSY; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (direction) { + case USBH_MSC_DIR_IN : + /* send clrfeture command on bulk IN endpoint */ + status = usbh_clrfeature(uhost, + msc->ep_in, + msc->pipe_in); + break; + + case USBH_MSC_DIR_OUT : + /*send clrfeature command on bulk OUT endpoint */ + status = usbh_clrfeature(uhost, + msc->ep_out, + msc->pipe_out); + break; + + default: + break; + } + + return status; +} + +/*! + \brief reset MSC bot transfer + \param[in] uhost: pointer to USB host handler + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_bbb_reset (usbh_host *uhost) +{ + usbh_status status = USBH_BUSY; + + if (CTL_IDLE == uhost->control.ctl_state) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_REQTYPE_CLASS | USB_RECPTYPE_ITF, + .bRequest = BBB_RESET, + .wValue = 0U, + .wIndex = 0U, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief decode the CSW received by the device and updates the same to upper layer + \param[in] uhost: pointer to USB host + \param[out] none + \retval on success USBH_MSC_OK, on failure USBH_MSC_FAIL +*/ +bbb_csw_status usbh_msc_csw_decode (usbh_host *uhost) +{ + bbb_csw_status status = BBB_CSW_CMD_FAILED; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + /* checking if the transfer length is different than 13 */ + if (BBB_CSW_LENGTH != usbh_xfercount_get (uhost->data, msc->pipe_in)) { + status = BBB_CSW_PHASE_ERROR; + } else { + /* CSW length is correct */ + + /* check validity of the CSW Signature and CSWStatus */ + if (BBB_CSW_SIGNATURE == msc->bot.csw.field.dCSWSignature) { + /* check condition 1. dCSWSignature is equal to 53425355h */ + if (msc->bot.csw.field.dCSWTag == msc->bot.cbw.field.dCBWTag) { + /* check condition 3. dCSWTag matches the dCBWTag from the corresponding CBW */ + if (0U == msc->bot.csw.field.bCSWStatus) { + status = BBB_CSW_CMD_PASSED; + } else if (1U == msc->bot.csw.field.bCSWStatus) { + status = BBB_CSW_CMD_FAILED; + } else if (2U == msc->bot.csw.field.bCSWStatus) { + status = BBB_CSW_PHASE_ERROR; + } else { + /* no operation */ + } + } + } else { + /* if the CSW signature is not valid, we shall return the phase error to + upper layers for reset recovery */ + status = BBB_CSW_PHASE_ERROR; + } + } + + return status; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_core.c new file mode 100644 index 0000000..26adf49 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_core.c @@ -0,0 +1,555 @@ +/*! + \file usbh_core.c + \brief USB MSC(mass storage device) class driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_msc_core.h" +#include "usbh_msc_scsi.h" +#include "usbh_msc_bbb.h" +#include "usbh_pipe.h" +#include "usbh_transc.h" +#include +#include + +/* local function prototypes ('static') */ +static void usbh_msc_itf_deinit (usbh_host *uhost); +static usbh_status usbh_msc_itf_init (usbh_host *uhost); +static usbh_status usbh_msc_req (usbh_host *uhost); +static usbh_status usbh_msc_handle (usbh_host *uhost); +static usbh_status usbh_msc_maxlun_get (usbh_host *uhost, uint8_t *maxlun); +static usbh_status usbh_msc_rdwr_process(usbh_host *uhost, uint8_t lun); + +usbh_class usbh_msc = +{ + USB_CLASS_MSC, + usbh_msc_itf_init, + usbh_msc_itf_deinit, + usbh_msc_req, + usbh_msc_handle, +}; + +/*! + \brief interface initialization for MSC class + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_msc_itf_init (usbh_host *uhost) +{ + usbh_status status = USBH_OK; + + uint8_t interface = usbh_interface_find(&uhost->dev_prop, MSC_CLASS, USB_MSC_SUBCLASS_SCSI, MSC_PROTOCOL); + + if (0xFFU == interface) { + uhost->usr_cb->dev_not_supported(); + + status = USBH_FAIL; + } else { + static usbh_msc_handler msc_handler; + + memset((void*)&msc_handler, 0, sizeof(usbh_msc_handler)); + + uhost->active_class->class_data = (void *)&msc_handler; + + usbh_interface_select(&uhost->dev_prop, interface); + + usb_desc_ep *ep_desc = &uhost->dev_prop.cfg_desc_set.itf_desc_set[interface][0].ep_desc[0]; + + if (ep_desc->bEndpointAddress & 0x80) { + msc_handler.ep_in = ep_desc->bEndpointAddress; + msc_handler.ep_size_in = ep_desc->wMaxPacketSize; + } else { + msc_handler.ep_out = ep_desc->bEndpointAddress; + msc_handler.ep_size_out = ep_desc->wMaxPacketSize; + } + + ep_desc = &uhost->dev_prop.cfg_desc_set.itf_desc_set[interface][0].ep_desc[1]; + + if (ep_desc->bEndpointAddress & 0x80) { + msc_handler.ep_in = ep_desc->bEndpointAddress; + msc_handler.ep_size_in = ep_desc->wMaxPacketSize; + } else { + msc_handler.ep_out = ep_desc->bEndpointAddress; + msc_handler.ep_size_out = ep_desc->wMaxPacketSize; + } + + msc_handler.state = MSC_INIT; + msc_handler.error = MSC_OK; + msc_handler.req_state = MSC_REQ_IDLE; + msc_handler.pipe_out = usbh_pipe_allocate(uhost->data, msc_handler.ep_out); + msc_handler.pipe_in = usbh_pipe_allocate(uhost->data, msc_handler.ep_in); + + usbh_msc_bbb_init(uhost); + + /* open the new channels */ + usbh_pipe_create (uhost->data, + &uhost->dev_prop, + msc_handler.pipe_out, + USB_EPTYPE_BULK, + msc_handler.ep_size_out); + + usbh_pipe_create (uhost->data, + &uhost->dev_prop, + msc_handler.pipe_in, + USB_EPTYPE_BULK, + msc_handler.ep_size_in); + + usbh_pipe_toggle_set (uhost->data, msc_handler.pipe_out, 0U); + usbh_pipe_toggle_set (uhost->data, msc_handler.pipe_in, 0U); + } + + return status; +} + +/*! + \brief deinitialize interface by freeing host channels allocated to interface + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +void usbh_msc_itf_deinit (usbh_host *uhost) +{ + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + if (msc->pipe_out) { + usb_pipe_halt (uhost->data, msc->pipe_out); + usbh_pipe_free (uhost->data, msc->pipe_out); + + msc->pipe_out = 0U; + } + + if (msc->pipe_in) { + usb_pipe_halt (uhost->data, msc->pipe_in); + usbh_pipe_free (uhost->data, msc->pipe_in); + + msc->pipe_in = 0U; + } +} + +/*! + \brief initialize the MSC state machine + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_msc_req (usbh_host *uhost) +{ + usbh_status status = USBH_BUSY; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->req_state) { + case MSC_REQ_IDLE: + case MSC_REQ_GET_MAX_LUN: + /* issue Get_MaxLun request */ + status = usbh_msc_maxlun_get (uhost, (uint8_t *)&msc->max_lun); + + if (USBH_OK == status) { + msc->max_lun = ((uint8_t)msc->max_lun > MSC_MAX_SUPPORTED_LUN) ? MSC_MAX_SUPPORTED_LUN : (uint8_t)msc->max_lun + 1U; + + for (uint8_t i = 0U; i < msc->max_lun; i++) { + msc->unit[i].prev_ready_state = USBH_FAIL; + msc->unit[i].state_changed = 0U; + } + } else { + if (USBH_NOT_SUPPORTED == status) { + msc->max_lun = 0U; + status = USBH_OK; + } + } + break; + + case MSC_REQ_ERROR: + /* issue clearfeature request */ + if (USBH_OK == usbh_clrfeature(uhost, 0x00U, uhost->control.pipe_out_num)) { + msc->req_state = msc->prev_req_state; + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief MSC state machine handler + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static usbh_status usbh_msc_handle (usbh_host *uhost) +{ + usbh_status status = USBH_BUSY; + uint8_t scsi_status = USBH_BUSY; + uint8_t ready_status = USBH_BUSY; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->state) { + case MSC_INIT: + if (msc->cur_lun < msc->max_lun) { + msc->unit[msc->cur_lun].error = MSC_NOT_READY; + + switch (msc->unit[msc->cur_lun].state) { + case MSC_INIT: + msc->unit[msc->cur_lun].state = MSC_READ_INQUIRY; + msc->timer = uhost->control.timer; + break; + + case MSC_READ_INQUIRY: + scsi_status = usbh_msc_scsi_inquiry(uhost, msc->cur_lun, &msc->unit[msc->cur_lun].inquiry); + + if (USBH_OK == scsi_status) { + msc->unit[msc->cur_lun].state = MSC_TEST_UNIT_READY; + } else if (scsi_status == USBH_FAIL) { + msc->unit[msc->cur_lun].state = MSC_REQUEST_SENSE; + } else { + if (scsi_status == USBH_UNRECOVERED_ERROR) { + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->unit[msc->cur_lun].error = MSC_ERROR; + } + } + break; + + case MSC_TEST_UNIT_READY: + /* issue SCSI command TestUnitReady */ + ready_status = usbh_msc_test_unitready(uhost, msc->cur_lun); + + if (USBH_OK == ready_status) { + if (USBH_OK != msc->unit[msc->cur_lun].prev_ready_state) { + msc->unit[msc->cur_lun].state_changed = 1U; + } else { + msc->unit[msc->cur_lun].state_changed = 0U; + } + + msc->unit[msc->cur_lun].state = MSC_READ_CAPACITY10; + msc->unit[msc->cur_lun].error = MSC_OK; + msc->unit[msc->cur_lun].prev_ready_state = USBH_OK; + } else if (USBH_FAIL == ready_status) { + if (USBH_FAIL != msc->unit[msc->cur_lun].prev_ready_state) { + msc->unit[msc->cur_lun].state_changed = 1U; + } else { + msc->unit[msc->cur_lun].state_changed = 0U; + } + + msc->unit[msc->cur_lun].state = MSC_REQUEST_SENSE; + msc->unit[msc->cur_lun].error = MSC_NOT_READY; + msc->unit[msc->cur_lun].prev_ready_state = USBH_FAIL; + } else { + if (USBH_UNRECOVERED_ERROR == ready_status) { + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->unit[msc->cur_lun].error = MSC_ERROR; + } + } + break; + + case MSC_READ_CAPACITY10: + /* issue READ_CAPACITY10 SCSI command */ + scsi_status = usbh_msc_read_capacity10(uhost, msc->cur_lun, &msc->unit[msc->cur_lun].capacity); + + if (USBH_OK == scsi_status) { + if (1U == msc->unit[msc->cur_lun].state_changed) { + } + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->unit[msc->cur_lun].error = MSC_OK; + msc->cur_lun ++; + } else if (USBH_FAIL == scsi_status) { + msc->unit[msc->cur_lun].state = MSC_REQUEST_SENSE; + } else { + if (USBH_UNRECOVERED_ERROR == scsi_status) { + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->unit[msc->cur_lun].error = MSC_ERROR; + } + } + break; + + case MSC_REQUEST_SENSE: + /* issue RequestSense SCSI command for retrieving error code */ + scsi_status = usbh_msc_request_sense (uhost, msc->cur_lun, &msc->unit[msc->cur_lun].sense); + if (USBH_OK == scsi_status) { + if ((msc->unit[msc->cur_lun].sense.SenseKey == UNIT_ATTENTION) || (msc->unit[msc->cur_lun].sense.SenseKey == NOT_READY)) { + if ((uhost->control.timer - msc->timer) < 10000U) { + msc->unit[msc->cur_lun].state = MSC_TEST_UNIT_READY; + break; + } + } + + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->cur_lun++; + } else if (USBH_FAIL == scsi_status) { + msc->unit[msc->cur_lun].state = MSC_UNRECOVERED_ERROR; + } else { + if (MSC_UNRECOVERED_ERROR == scsi_status) { + msc->unit[msc->cur_lun].state = MSC_IDLE; + msc->unit[msc->cur_lun].error = MSC_ERROR; + } + } + break; + + case MSC_UNRECOVERED_ERROR: + msc->cur_lun ++; + break; + + default: + break; + } + } else { + msc->cur_lun = 0U; + msc->state = MSC_IDLE; + } + break; + + case MSC_IDLE: + uhost->usr_cb->dev_user_app(); + status = USBH_OK; + break; + + default: + break; + } + + return status; +} + +/*! + \brief get max lun of the mass storage device + \param[in] uhost: pointer to USB host + \param[in] maxlun: pointer to max lun + \param[out] none + \retval operation status +*/ +static usbh_status usbh_msc_maxlun_get (usbh_host *uhost, uint8_t *maxlun) +{ + usbh_status status = USBH_BUSY; + + if (uhost->control.ctl_state == CTL_IDLE) { + uhost->control.setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_REQTYPE_CLASS | USB_RECPTYPE_ITF, + .bRequest = BBB_GET_MAX_LUN, + .wValue = 0U, + .wIndex = 0U, + .wLength = 1U + }; + + usbh_ctlstate_config (uhost, maxlun, 1U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief get max lun of the mass storage device + \param[in] uhost: pointer to USB host + \param[in] lun: logic unit number + \param[out] none + \retval operation status +*/ +static usbh_status usbh_msc_rdwr_process(usbh_host *uhost, uint8_t lun) +{ + usbh_status error = USBH_BUSY; + usbh_status scsi_status = USBH_BUSY; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + /* switch MSC req state machine */ + switch (msc->unit[lun].state) { + case MSC_READ: + scsi_status = usbh_msc_read10(uhost, lun, NULL, 0U, 0U); + + if (USBH_OK == scsi_status) { + msc->unit[lun].state = MSC_IDLE; + error = USBH_OK; + } else if (USBH_FAIL == scsi_status) { + msc->unit[lun].state = MSC_REQUEST_SENSE; + } else { + if (USBH_UNRECOVERED_ERROR == scsi_status) { + msc->unit[lun].state = MSC_UNRECOVERED_ERROR; + error = USBH_FAIL; + } + } + break; + + case MSC_WRITE: + scsi_status = usbh_msc_write10(uhost, lun, NULL, 0U, 0U); + + if (USBH_OK == scsi_status) { + msc->unit[lun].state = MSC_IDLE; + error = USBH_OK; + } else if(USBH_FAIL == scsi_status) { + msc->unit[lun].state = MSC_REQUEST_SENSE; + } else { + if (USBH_UNRECOVERED_ERROR == scsi_status) { + msc->unit[lun].state = MSC_UNRECOVERED_ERROR; + error = USBH_FAIL; + } + } + break; + + case MSC_REQUEST_SENSE: + scsi_status = usbh_msc_request_sense (uhost, lun, &msc->unit[lun].sense); + + if (USBH_OK == scsi_status) { + msc->unit[lun].state = MSC_IDLE; + msc->unit[lun].error = MSC_ERROR; + + error = USBH_FAIL; + } + + if (USBH_FAIL == scsi_status) { + } else { + if (USBH_UNRECOVERED_ERROR == scsi_status) { + msc->unit[lun].state = MSC_UNRECOVERED_ERROR; + error = USBH_FAIL; + } + } + break; + + default: + break; + } + + return error; +} + +/*! + \brief get lun information + \param[in] uhost: pointer to USB host + \param[in] lun: logic unit number + \param[in] info: pointer to lun information + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_lun_info_get (usbh_host *uhost, uint8_t lun, msc_lun *info) +{ + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + if (HOST_CLASS_HANDLER == uhost->cur_state) { + memcpy(info, &msc->unit[lun], sizeof(msc_lun)); + + return USBH_OK; + } else { + return USBH_FAIL; + } +} + +/*! + \brief handle MSC read operation + \param[in] uhost: pointer to USB host + \param[in] lun: logic unit number + \param[in] address: data address + \param[in] pbuf: pointer to data buffer + \param[in] length: buffer length + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_read (usbh_host *uhost, + uint8_t lun, + uint32_t address, + uint8_t *pbuf, + uint32_t length) +{ + uint32_t timeout = 0U; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + usb_core_driver *udev = (usb_core_driver *)uhost->data; + + if ((0U == udev->host.connect_status) || + (HOST_CLASS_HANDLER != uhost->cur_state) || + (MSC_IDLE != msc->unit[lun].state)) { + return USBH_FAIL; + } + + msc->state = MSC_READ; + msc->unit[lun].state = MSC_READ; + msc->rw_lun = lun; + + usbh_msc_read10(uhost, lun, pbuf, address, length); + + timeout = uhost->control.timer; + + while (USBH_BUSY == usbh_msc_rdwr_process(uhost, lun)) { + if (((uhost->control.timer - timeout) > (10000U * length)) || (0U == udev->host.connect_status)){ + msc->state = MSC_IDLE; + return USBH_FAIL; + } + } + + msc->state = MSC_IDLE; + + return USBH_OK; +} + +/*! + \brief handle MSC write operation + \param[in] uhost: pointer to USB host + \param[in] lun: logic unit number + \param[in] address: data address + \param[in] pbuf: pointer to data buffer + \param[in] length: buffer length + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_write (usbh_host *uhost, + uint8_t lun, + uint32_t address, + uint8_t *pbuf, + uint32_t length) +{ + uint32_t timeout = 0U; + usb_core_driver *udev = (usb_core_driver *)uhost->data; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + if ((0U == udev->host.connect_status) || + (HOST_CLASS_HANDLER != uhost->cur_state) || + (MSC_IDLE != msc->unit[lun].state)) { + return USBH_FAIL; + } + + msc->state = MSC_WRITE; + msc->unit[lun].state = MSC_WRITE; + msc->rw_lun = lun; + + usbh_msc_write10(uhost, lun, pbuf, address, length); + + timeout = uhost->control.timer; + + while (USBH_BUSY == usbh_msc_rdwr_process(uhost, lun)) { + if (((uhost->control.timer - timeout) > (10000U * length)) || (0U == udev->host.connect_status)) { + msc->state = MSC_IDLE; + return USBH_FAIL; + } + } + + msc->state = MSC_IDLE; + + return USBH_OK; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_fatfs.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_fatfs.c new file mode 100644 index 0000000..b4e4297 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_fatfs.c @@ -0,0 +1,233 @@ +/*! + \file usbh_msc_fatfs.c + \brief USB MSC host FATFS related functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usb_conf.h" +#include "diskio.h" +#include "usbh_msc_core.h" + +static volatile DSTATUS state = STA_NOINIT; /* disk status */ + +extern usbh_host usb_host; + +/*! + \brief initialize the disk drive + \param[in] drv: physical drive number (0) + \param[out] none + \retval operation status +*/ +DSTATUS disk_initialize (BYTE drv) +{ + usb_core_driver *udev = (usb_core_driver *)usb_host.data; + + if (udev->host.connect_status) { + state &= ~STA_NOINIT; + } + + return state; +} + +/*! + \brief get disk status + \param[in] drv: physical drive number (0) + \param[out] none + \retval operation status +*/ +DSTATUS disk_status (BYTE drv) +{ + if (drv) { + return STA_NOINIT; /* supports only single drive */ + } + + return state; +} + +/*! + \brief read sectors + \param[in] drv: physical drive number (0) + \param[in] buff: pointer to the data buffer to store read data + \param[in] sector: start sector number (LBA) + \param[in] count: sector count (1..255) + \param[out] none + \retval operation status +*/ +DRESULT disk_read (BYTE drv, BYTE *buff, DWORD sector, UINT count) +{ + BYTE status = USBH_OK; + usb_core_driver *udev = (usb_core_driver *)usb_host.data; + + if (drv || (!count)) { + return RES_PARERR; + } + + if (state & STA_NOINIT) { + return RES_NOTRDY; + } + + if (udev->host.connect_status) { + do { + status = usbh_msc_read (&usb_host, drv, sector, buff, count); + + if (!udev->host.connect_status) { + return RES_ERROR; + } + } while(status == USBH_BUSY); + } + + if (status == USBH_OK) { + return RES_OK; + } + + return RES_ERROR; +} + +#if _READONLY == 0U + +/*! + \brief write sectors + \param[in] drv: physical drive number (0) + \param[in] buff: pointer to the data buffer to store read data + \param[in] sector: start sector number (LBA) + \param[in] count: sector count (1..255) + \param[out] none + \retval operation status +*/ +DRESULT disk_write (BYTE drv, const BYTE *buff, DWORD sector, UINT count) +{ + BYTE status = USBH_OK; + usb_core_driver *udev = (usb_core_driver *)usb_host.data; + + if ((!count) || drv) { + return RES_PARERR; + } + + if (state & STA_NOINIT) { + return RES_NOTRDY; + } + + if (state & STA_PROTECT) { + return RES_WRPRT; + } + + if (udev->host.connect_status) { + do { + status = usbh_msc_write (&usb_host, drv, sector, (BYTE*)buff, count); + + if (!udev->host.connect_status) { + return RES_ERROR; + } + } while(status == USBH_BUSY); + } + + if (status == USBH_OK) { + return RES_OK; + } + + return RES_ERROR; +} + +#endif /* _READONLY == 0 */ + +/*! + \brief I/O control function + \param[in] drv: physical drive number (0) + \param[in] ctrl: control code + \param[in] buff: pointer to the data buffer to store read data + \param[out] none + \retval operation status +*/ +DRESULT disk_ioctl (BYTE drv, BYTE ctrl, void *buff) +{ + DRESULT res = RES_OK; + msc_lun info; + + if (drv) { + return RES_PARERR; + } + + res = RES_ERROR; + + if (state & STA_NOINIT) { + return RES_NOTRDY; + } + + switch (ctrl) { + /* make sure that no pending write process */ + case CTRL_SYNC: + res = RES_OK; + break; + + /* get number of sectors on the disk (dword) */ + case GET_SECTOR_COUNT: + if (USBH_OK == usbh_msc_lun_info_get(&usb_host, drv, &info)) { + *(DWORD*)buff = (DWORD)info.capacity.block_nbr; + res = RES_OK; + } + break; + + /* get r/w sector size (word) */ + case GET_SECTOR_SIZE: + if (USBH_OK == usbh_msc_lun_info_get(&usb_host, drv, &info)) { + *(WORD*)buff = (DWORD)info.capacity.block_size; + res = RES_OK; + } + break; + + /* get erase block size in unit of sector (dword) */ + case GET_BLOCK_SIZE: + *(DWORD*)buff = 512; + break; + + default: + res = RES_PARERR; + break; + } + + return res; +} + +/*! + \brief get fat time + \param[in] none + \param[out] none + \retval time value +*/ +DWORD get_fattime(void) { + + return ((DWORD)(2019U - 1980U) << 25U) /* year 2019 */ + | ((DWORD)1U << 21U) /* month 1 */ + | ((DWORD)1U << 16U) /* day 1 */ + | ((DWORD)0U << 11U) /* hour 0 */ + | ((DWORD)0U << 5U) /* min 0 */ + | ((DWORD)0U >> 1U); /* sec 0 */ +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_scsi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_scsi.c new file mode 100644 index 0000000..ce2fe8d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/class/msc/Source/usbh_msc_scsi.c @@ -0,0 +1,400 @@ +/*! + \file usbh_msc_scsi.c + \brief USB MSC SCSI commands implemention + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_msc_core.h" +#include "usbh_msc_scsi.h" +#include "usbh_msc_bbb.h" + +#include + +/*! + \brief send 'inquiry' command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[in] inquiry: pointer to the inquiry structure + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_scsi_inquiry (usbh_host *uhost, uint8_t lun, scsi_std_inquiry_data *inquiry) +{ + usbh_status error = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the cbw and relevant field*/ + msc->bot.cbw.field.dCBWDataTransferLength = STANDARD_INQUIRY_DATA_LEN; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_IN; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_INQUIRY; + msc->bot.cbw.field.CBWCB[1] = (lun << 5U); + msc->bot.cbw.field.CBWCB[4] = 0x24U; + + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = (uint8_t *)(void *)msc->bot.data; + error = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + error = usbh_msc_bbb_process(uhost, lun); + + if (USBH_OK == error) { + memset(inquiry, 0U, sizeof(scsi_std_inquiry_data)); + + /* assign inquiry data */ + inquiry->device_type = msc->bot.pbuf[0] & 0x1FU; + inquiry->peripheral_qualifier = msc->bot.pbuf[0] >> 5U; + + if (0x80U == ((uint32_t)msc->bot.pbuf[1] & 0x80U)) { + inquiry->removable_media = 1U; + } else { + inquiry->removable_media = 0U; + } + + memcpy (inquiry->vendor_id, &msc->bot.pbuf[8], 8U); + memcpy (inquiry->product_id, &msc->bot.pbuf[16], 16U); + memcpy (inquiry->revision_id, &msc->bot.pbuf[32], 4U); + } + break; + + default: + break; + } + + return error; +} + +/*! + \brief send 'test unit ready' command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_test_unitready (usbh_host *uhost, uint8_t lun) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the CBW and relevant field */ + msc->bot.cbw.field.dCBWDataTransferLength = CBW_LENGTH_TEST_UNIT_READY; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_OUT; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_TEST_UNIT_READY; + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + break; + + default: + break; + } + + return status; +} + +/*! + \brief send the read capacity command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[in] capacity: pointer to SCSI capacity + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_read_capacity10 (usbh_host *uhost, uint8_t lun, scsi_capacity *capacity) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the CBW and relevant field */ + msc->bot.cbw.field.dCBWDataTransferLength = READ_CAPACITY10_DATA_LEN; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_IN; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_READ_CAPACITY10; + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = (uint8_t *)(void *)msc->bot.data; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + + if (USBH_OK == status) { + capacity->block_nbr = msc->bot.pbuf[3] | \ + ((uint32_t)msc->bot.pbuf[2] << 8U) | \ + ((uint32_t)msc->bot.pbuf[1] << 16U) | \ + ((uint32_t)msc->bot.pbuf[0] << 24U); + + capacity->block_size = (uint16_t)(msc->bot.pbuf[7] | ((uint32_t)msc->bot.pbuf[6] << 8U)); + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief send the mode sense6 command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_mode_sense6 (usbh_host *uhost, uint8_t lun) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the CBW and relevant field */ + msc->bot.cbw.field.dCBWDataTransferLength = XFER_LEN_MODE_SENSE6; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_IN; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_MODE_SENSE6; + msc->bot.cbw.field.CBWCB[2] = MODE_SENSE_PAGE_CONTROL_FIELD | MODE_SENSE_PAGE_CODE; + msc->bot.cbw.field.CBWCB[4] = XFER_LEN_MODE_SENSE6; + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = (uint8_t *)(void *)msc->bot.data; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + + if (USBH_OK == status) { + if (msc->bot.data[2] & MASK_MODE_SENSE_WRITE_PROTECT) { + + } else { + + } + } + break; + + default: + break; + } + + + return status; +} + +/*! + \brief send the request sense command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[in] sense_data: pointer to sense data + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_request_sense (usbh_host *uhost, uint8_t lun, msc_scsi_sense *sense_data) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the cbw and relevant field */ + msc->bot.cbw.field.dCBWDataTransferLength = ALLOCATION_LENGTH_REQUEST_SENSE; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_IN; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_REQUEST_SENSE; + msc->bot.cbw.field.CBWCB[1] = (lun << 5U); + msc->bot.cbw.field.CBWCB[4] = ALLOCATION_LENGTH_REQUEST_SENSE; + + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = (uint8_t *)(void *)msc->bot.data; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + + if (USBH_OK == status) { + /* get sense data */ + sense_data->SenseKey = msc->bot.pbuf[2] & 0x0FU; + sense_data->ASC = msc->bot.pbuf[12]; + sense_data->ASCQ = msc->bot.pbuf[13]; + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief send the write10 command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[in] data_buf: data buffer contains the data to write + \param[in] addr: address to which the data will be written + \param[in] sector_num: number of sector to be written + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_write10 (usbh_host *uhost, uint8_t lun, uint8_t *data_buf, uint32_t addr, uint32_t sector_num) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + msc->bot.cbw.field.dCBWDataTransferLength = sector_num * msc->unit[lun].capacity.block_size; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_OUT; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_WRITE10; + + /* logical block address */ + msc->bot.cbw.field.CBWCB[2] = (((uint8_t*)&addr)[3]); + msc->bot.cbw.field.CBWCB[3] = (((uint8_t*)&addr)[2]); + msc->bot.cbw.field.CBWCB[4] = (((uint8_t*)&addr)[1]); + msc->bot.cbw.field.CBWCB[5] = (((uint8_t*)&addr)[0]); + + /* transfer length */ + msc->bot.cbw.field.CBWCB[7] = (((uint8_t *)§or_num)[1]); + msc->bot.cbw.field.CBWCB[8] = (((uint8_t *)§or_num)[0]); + + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = data_buf; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + break; + + default: + break; + } + + return status; +} + +/*! + \brief send the read10 command to the device + \param[in] uhost: pointer to USB host handler + \param[in] lun: logic unit number + \param[in] data_buf: data buffer contains the data to write + \param[in] addr: address to which the data will be read + \param[in] sector_num: number of sector to be read + \param[out] none + \retval operation status +*/ +usbh_status usbh_msc_read10 (usbh_host *uhost, uint8_t lun, uint8_t *data_buf, uint32_t addr, uint32_t sector_num) +{ + usbh_status status = USBH_FAIL; + usbh_msc_handler *msc = (usbh_msc_handler *)uhost->active_class->class_data; + + switch (msc->bot.cmd_state) { + case BBB_CMD_SEND: + /* prepare the CBW and relevant field */ + msc->bot.cbw.field.dCBWDataTransferLength = sector_num * msc->unit[lun].capacity.block_size; + msc->bot.cbw.field.bmCBWFlags = USB_TRX_IN; + msc->bot.cbw.field.bCBWCBLength = CBW_LENGTH; + + memset(msc->bot.cbw.field.CBWCB, 0U, CBW_CB_LENGTH); + + msc->bot.cbw.field.CBWCB[0] = SCSI_READ10; + + /* logical block address */ + msc->bot.cbw.field.CBWCB[2] = (((uint8_t*)&addr)[3]); + msc->bot.cbw.field.CBWCB[3] = (((uint8_t*)&addr)[2]); + msc->bot.cbw.field.CBWCB[4] = (((uint8_t*)&addr)[1]); + msc->bot.cbw.field.CBWCB[5] = (((uint8_t*)&addr)[0]); + + /* transfer length */ + msc->bot.cbw.field.CBWCB[7] = (((uint8_t *)§or_num)[1]); + msc->bot.cbw.field.CBWCB[8] = (((uint8_t *)§or_num)[0]); + + msc->bot.state = BBB_SEND_CBW; + msc->bot.cmd_state = BBB_CMD_WAIT; + msc->bot.pbuf = data_buf; + + status = USBH_BUSY; + break; + + case BBB_CMD_WAIT: + status = usbh_msc_bbb_process(uhost, lun); + break; + + default: + break; + } + + return status; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_core.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_core.h new file mode 100644 index 0000000..a3a9d9d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_core.h @@ -0,0 +1,264 @@ +/*! + \file usbh_core.h + \brief USB host core state machine header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_CORE_H +#define __USBH_CORE_H + +#include "usbh_conf.h" +#include "drv_usb_host.h" + +#define MSC_CLASS 0x08U +#define HID_CLASS 0x03U +#define MSC_PROTOCOL 0x50U +#define CBI_PROTOCOL 0x01U + +#define USBH_MAX_ERROR_COUNT 3U + +#define USBH_DEV_ADDR_DEFAULT 0U +#define USBH_DEV_ADDR 1U + +typedef enum +{ + USBH_OK = 0U, + USBH_BUSY, + USBH_FAIL, + USBH_NOT_SUPPORTED, + USBH_UNRECOVERED_ERROR, + USBH_SPEED_UNKNOWN_ERROR, + USBH_APPLY_DEINIT +} usbh_status; + +/* USB host global operation state */ +typedef enum +{ + HOST_DEFAULT = 0U, + HOST_DETECT_DEV_SPEED, + HOST_DEV_CONNECT, + HOST_DEV_DETACHED, + HOST_DEV_ENUM, + HOST_PWR_FEATURE_SET, + HOST_CLASS_CHECK, + HOST_CLASS_ENUM, + HOST_CLASS_HANDLER, + HOST_USER_INPUT, + HOST_SUSPEND, + HOST_WAKEUP, + HOST_ERROR +} usb_host_state; + +/* USB host enumeration state */ +typedef enum +{ + ENUM_DEFAULT = 0U, + ENUM_GET_DEV_DESC, + ENUM_SET_ADDR, + ENUM_GET_CFG_DESC, + ENUM_GET_CFG_DESC_SET, + ENUM_GET_STR_DESC, +#ifdef USB_MTP + ENUM_GET_MTP_STR, +#endif + ENUM_SET_CONFIGURATION, + ENUM_DEV_CONFIGURED +} usbh_enum_state; + +/* USB host control transfer state */ +typedef enum +{ + CTL_IDLE = 0U, + CTL_SETUP, + CTL_SETUP_WAIT, + CTL_DATA_IN, + CTL_DATA_IN_WAIT, + CTL_DATA_OUT, + CTL_DATA_OUT_WAIT, + CTL_STATUS_IN, + CTL_STATUS_IN_WAIT, + CTL_STATUS_OUT, + CTL_STATUS_OUT_WAIT, + CTL_ERROR, + CTL_FINISH +} usbh_ctl_state; + +/* user action state */ +typedef enum +{ + USR_IN_NO_RESP = 0U, + USR_IN_RESP_OK = 1U, +} usbh_user_status; + +/* control transfer information */ +typedef struct _usbh_control +{ + uint8_t pipe_in_num; + uint8_t pipe_out_num; + uint8_t max_len; + uint8_t error_count; + uint8_t *buf; + uint16_t ctl_len; + __IO uint32_t timer; + usb_setup setup; + usbh_ctl_state ctl_state; +} usbh_control; + +/* USB interface descriptor set */ +typedef struct _usb_desc_itf_set +{ + usb_desc_itf itf_desc; + usb_desc_ep ep_desc[USBH_MAX_EP_NUM]; +} usb_desc_itf_set; + +/* USB configure descriptor set */ +typedef struct _usb_desc_cfg_set +{ + usb_desc_config cfg_desc; + usb_desc_itf_set itf_desc_set[USBH_MAX_INTERFACES_NUM][USBH_MAX_ALT_SETTING]; +} usb_desc_cfg_set; + +/* USB device property */ +typedef struct +{ + uint8_t data[USBH_DATA_BUF_MAX_LEN]; + uint8_t cur_itf; + uint8_t addr; + + uint32_t speed; + + usb_desc_dev dev_desc; + usb_desc_cfg_set cfg_desc_set; + +#if (USBH_CFG_DESC_KEEP == 1U) + uint8_t cfgdesc_rawdata[USBH_CFGSET_MAX_LEN]; +#endif /* (USBH_CFG_DESC_KEEP == 1U) */ +} usb_dev_prop; + +struct _usbh_host; + +/* device class callbacks */ +typedef struct +{ + uint8_t class_code; /*!< USB class type */ + usbh_status (*class_init) (struct _usbh_host *phost); + void (*class_deinit) (struct _usbh_host *phost); + usbh_status (*class_requests) (struct _usbh_host *phost); + usbh_status (*class_machine) (struct _usbh_host *phost); + usbh_status (*class_sof) (struct _usbh_host *uhost); + void *class_data; +} usbh_class; + +/* user callbacks */ +typedef struct +{ + void (*dev_init) (void); + void (*dev_deinit) (void); + void (*dev_attach) (void); + void (*dev_reset) (void); + void (*dev_detach) (void); + void (*dev_over_currented) (void); + void (*dev_speed_detected) (uint32_t dev_speed); + void (*dev_devdesc_assigned) (void *dev_desc); + void (*dev_address_set) (void); + + void (*dev_cfgdesc_assigned) (usb_desc_config *cfg_desc, + usb_desc_itf *itf_desc, + usb_desc_ep *ep_desc); + + void (*dev_mfc_str) (void *mfc_str); + void (*dev_prod_str) (void *prod_str); + void (*dev_seral_str) (void *serial_str); + void (*dev_enumerated) (void); + usbh_user_status (*dev_user_input) (void); + int (*dev_user_app) (void); + void (*dev_not_supported) (void); + void (*dev_error) (void); +} usbh_user_cb; + +/* host information */ +typedef struct _usbh_host +{ + usb_host_state cur_state; /*!< host state machine value */ + usb_host_state backup_state; /*!< backup of previous state machine value */ + usbh_enum_state enum_state; /*!< enumeration state machine */ + usbh_control control; /*!< USB host control state machine */ + usb_dev_prop dev_prop; /*!< USB device property */ + usbh_class *uclass[USBH_MAX_SUPPORTED_CLASS]; /*!< USB host supported class */ + usbh_class *active_class; /*!< USB active class */ + usbh_user_cb *usr_cb; /*!< USB user callback */ + uint8_t class_num; /*!< USB class number */ + void *data; /*!< used for... */ + +#if USB_LOW_POWER + uint8_t suspend_flag; /*!< host suspend flag */ + uint8_t dev_supp_remote_wkup; /*!< record device remote wakeup function */ + uint8_t wakeup_mode; /*!< record wakeup mode */ +#endif /* USB_LOW_POWER*/ +} usbh_host; + +/*! + \brief get USB URB state + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[out] none + \retval none +*/ +static inline usb_urb_state usbh_urbstate_get (usb_core_driver *udev, uint8_t pp_num) +{ + return udev->host.pipe[pp_num].urb_state; +} + +/*! + \brief get USB transfer data count + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[out] none + \retval none +*/ +static inline uint32_t usbh_xfercount_get (usb_core_driver *udev, uint8_t pp_num) +{ + return udev->host.backup_xfercount[pp_num]; +} + +/* function declarations */ +/* USB host stack initializations */ +void usbh_init (usbh_host *uhost, usbh_user_cb *user_cb); +/* USB host register device class */ +usbh_status usbh_class_register (usbh_host *uhost, usbh_class *puclass); +/* deinitialize USB host */ +usbh_status usbh_deinit (usbh_host *uhost); +/* USB host core main state machine process */ +void usbh_core_task (usbh_host *uhost); +/* handle the error on USB host side */ +void usbh_error_handler (usbh_host *uhost, usbh_status err_type); + +#endif /* __USBH_CORE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_enum.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_enum.h new file mode 100644 index 0000000..3692b92 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_enum.h @@ -0,0 +1,70 @@ +/*! + \file usbh_enum.h + \brief USB host mode USB enumeration header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_ENUM_H +#define __USBH_ENUM_H + +#include "usbh_core.h" + +/* function declarations */ +/* configure USB control status parameters */ +void usbh_ctlstate_config (usbh_host *uhost, uint8_t *buf, uint16_t len); +/* get device descriptor from the USB device */ +usbh_status usbh_devdesc_get (usbh_host *uhost, uint8_t len); +/* get configuration descriptor from the USB device */ +usbh_status usbh_cfgdesc_get (usbh_host *uhost, uint16_t len); +/* get string descriptor from the USB device */ +usbh_status usbh_strdesc_get (usbh_host *uhost,uint8_t str_index, uint8_t *buf, uint16_t len); +/* set the address to the connected device */ +usbh_status usbh_setaddress (usbh_host *uhost, uint8_t dev_addr); +/* set the configuration value to the connected device */ +usbh_status usbh_setcfg (usbh_host *uhost, uint16_t config); +/* set the interface value to the connected device */ +usbh_status usbh_setinterface (usbh_host *uhost, uint8_t itf_num, uint8_t alter_setting); +/* set or enable a specific device feature */ +usbh_status usbh_setdevfeature (usbh_host *uhost, uint8_t feature_selector, uint16_t windex); +/* clear or disable a specific device feature */ +usbh_status usbh_clrdevfeature (usbh_host *uhost, uint8_t feature_selector, uint16_t windex); +/* clear or disable a specific feature */ +usbh_status usbh_clrfeature (usbh_host *uhost, uint8_t ep_addr, uint8_t pp_num); +/* get the next descriptor header */ +usb_desc_header *usbh_nextdesc_get (uint8_t *pbuf, uint16_t *ptr); +/* select an interface */ +usbh_status usbh_interface_select (usb_dev_prop *udev, uint8_t interface); +/* find the interface index for a specific class */ +uint8_t usbh_interface_find (usb_dev_prop *udev, uint8_t main_class, uint8_t sub_class, uint8_t protocol); +/* find the interface index for a specific class interface and alternate setting number */ +uint8_t usbh_interfaceindex_find (usb_dev_prop *udev, uint8_t interface_number, uint8_t alt_settings); + +#endif /* __USBH_ENUM_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_pipe.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_pipe.h new file mode 100644 index 0000000..fbf36cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_pipe.h @@ -0,0 +1,102 @@ +/*! + \file usbh_pipe.h + \brief USB host mode pipe header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_PIPE_H +#define __USBH_PIPE_H + +#include "usbh_core.h" + +/* host pipe maximum */ +#define HP_MAX 8U + +/* host pipe status */ +#define HP_OK 0x0000U +#define HP_USED 0x8000U +#define HP_ERROR 0xFFFFU +#define HP_USED_MASK 0x7FFFU + +/*! + \brief set toggle for a pipe + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[in] toggle: toggle (0/1) + \param[out] none + \retval operation status +*/ +__STATIC_INLINE void usbh_pipe_toggle_set (usb_core_driver *udev, uint8_t pp_num, uint8_t toggle) +{ + if (udev->host.pipe[pp_num].ep.dir) { + udev->host.pipe[pp_num].data_toggle_in = toggle; + } else { + udev->host.pipe[pp_num].data_toggle_out = toggle; + } +} + +/*! + \brief get toggle flag of pipe + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[out] none + \retval operation status +*/ +__STATIC_INLINE uint8_t usbh_pipe_toggle_get (usb_core_driver *udev, uint8_t pp_num) +{ + if (udev->host.pipe[pp_num].ep.dir) { + return udev->host.pipe[pp_num].data_toggle_in; + } else { + return udev->host.pipe[pp_num].data_toggle_out; + } +} + +/* function declarations */ +/* create a pipe */ +uint8_t usbh_pipe_create (usb_core_driver *udev, + usb_dev_prop *dev, + uint8_t pp_num, + uint8_t ep_type, + uint16_t ep_mpl); +/* update a pipe */ +uint8_t usbh_pipe_update (usb_core_driver *udev, + uint8_t pp_num, + uint8_t dev_addr, + uint32_t dev_speed, + uint16_t ep_mpl); +/* allocate a new pipe */ +uint8_t usbh_pipe_allocate (usb_core_driver *udev, uint8_t ep_addr); +/* free a pipe */ +uint8_t usbh_pipe_free (usb_core_driver *udev, uint8_t pp_num); +/* delete all USB host pipe */ +uint8_t usbh_pipe_delete (usb_core_driver *udev); + +#endif /* __USBH_PIPE_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_transc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_transc.h new file mode 100644 index 0000000..1964f07 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Include/usbh_transc.h @@ -0,0 +1,50 @@ +/*! + \file usbh_transc.h + \brief USB host mode transactions header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USBH_TRANSC_H +#define __USBH_TRANSC_H + +#include "usbh_core.h" + +/* function declarations */ +/* send the setup packet to the USB device */ +usbh_status usbh_ctlsetup_send (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num); +/* send a data packet to the USB device */ +usbh_status usbh_data_send (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len); +/* receive a data packet from the USB device */ +usbh_status usbh_data_recev (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len); +/* USB control transfer handler */ +usbh_status usbh_ctl_handler (usbh_host *uhost); + +#endif /* __USBH_TRANSC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_core.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_core.c new file mode 100644 index 0000000..2367ab9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_core.c @@ -0,0 +1,657 @@ +/*! + \file usbh_core.c + \brief USB host core state machine driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usbh_pipe.h" +#include "usbh_enum.h" +#include "usbh_core.h" +#include "drv_usbh_int.h" +#include + +usb_core_driver usbh_core; + +/* local function prototypes ('static') */ +static uint8_t usb_ev_sof (usbh_host *uhost); +static uint8_t usb_ev_connect (usbh_host *uhost); +static uint8_t usb_ev_disconnect (usbh_host *uhost); + +static usbh_status usbh_enum_task (usbh_host *uhost); + +#if USB_LOW_POWER +static void usb_hwp_suspend(usb_core_driver *udev); +static void usb_hwp_resume(usb_core_driver *udev); +#endif /* USB_LOW_POWER */ + +usbh_ev_cb usbh_int_op = +{ + usb_ev_connect, + usb_ev_disconnect, + usb_ev_sof, +}; + +usbh_ev_cb *usbh_int_fop = &usbh_int_op; + +/*! + \brief USB host stack initializations + \param[in] uhost: pointer to USB host + \param[in] user_cb: pointer to user callback + \param[out] none + \retval none +*/ +void usbh_init (usbh_host *uhost, usbh_user_cb *user_cb) +{ + /* host deinitialization */ + usbh_deinit(uhost); + + uhost->usr_cb = user_cb; + + usbh_core.host.connect_status = 0U; + + for (uint8_t i = 0U; i < USBFS_MAX_TX_FIFOS; i++) { + usbh_core.host.pipe[i].err_count = 0U; + usbh_core.host.pipe[i].pp_status = PIPE_IDLE; + usbh_core.host.backup_xfercount[i] = 0U; + } + + usbh_core.host.pipe[0].ep.mps = 8U; + +#ifdef USE_USB_FS + usb_basic_init (&usbh_core.bp, &usbh_core.regs, USB_CORE_ENUM_FS); +#endif /* USE_USB_FS */ + +#ifndef DUAL_ROLE_MODE_ENABLED + usb_globalint_disable(&usbh_core.regs); + + usb_core_init (usbh_core.bp, &usbh_core.regs); + +#ifndef USE_OTG_MODE + usb_curmode_set (&usbh_core.regs, HOST_MODE); +#endif /* USE_OTG_MODE */ + + usb_host_init (&usbh_core); + + usb_globalint_enable(&usbh_core.regs); +#endif /* DUAL_ROLE_MODE_ENABLED */ + + /* link driver to the stack */ + usbh_core.host.data = (void *)uhost; + uhost->data = (void *)&usbh_core; + + /* upon initialize call usr call back */ + uhost->usr_cb->dev_init(); +} + +/*! + \brief USB host register device class + \param[in] uhost: pointer to USB host instance + \param[in] puclass: pointer to USB device class + \param[out] none + \retval operation status +*/ +usbh_status usbh_class_register (usbh_host *uhost, usbh_class *puclass) +{ + usbh_status status = USBH_OK; + + if (NULL != puclass) { + if (uhost->class_num < USBH_MAX_SUPPORTED_CLASS) { + uhost->uclass[uhost->class_num++] = puclass; + } else { + status = USBH_FAIL; + } + } else { + status = USBH_FAIL; + } + + return status; +} + +/*! + \brief deinitialize USB host + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +usbh_status usbh_deinit(usbh_host *uhost) +{ + /* software initialize */ + uhost->cur_state = HOST_DEFAULT; + uhost->backup_state = HOST_DEFAULT; + uhost->enum_state = ENUM_DEFAULT; + + uhost->control.ctl_state = CTL_IDLE; + uhost->control.max_len = USB_FS_EP0_MAX_LEN; + + uhost->dev_prop.addr = USBH_DEV_ADDR_DEFAULT; + uhost->dev_prop.speed = PORT_SPEED_FULL; + uhost->dev_prop.cur_itf = 0xFFU; + + usbh_pipe_free(&usbh_core, uhost->control.pipe_in_num); + usbh_pipe_free(&usbh_core, uhost->control.pipe_out_num); + + return USBH_OK; +} + +/*! + \brief USB host core main state machine process + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +void usbh_core_task (usbh_host *uhost) +{ + volatile usbh_status status = USBH_FAIL; + + /* check for host port events */ + if (((0U == usbh_core.host.connect_status) || (0U == usbh_core.host.port_enabled)) && (HOST_DEFAULT != uhost->cur_state)) { + if (uhost->cur_state != HOST_DEV_DETACHED) { + uhost->cur_state = HOST_DEV_DETACHED; + } + } + + switch (uhost->cur_state) { + case HOST_DEFAULT: + if (usbh_core.host.connect_status) { + uhost->cur_state = HOST_DETECT_DEV_SPEED; + + usb_mdelay (100U); + + usb_port_reset (&usbh_core); + + uhost->usr_cb->dev_reset(); + } + break; + + case HOST_DETECT_DEV_SPEED: + if (usbh_core.host.port_enabled) { + uhost->cur_state = HOST_DEV_CONNECT; + + uhost->dev_prop.speed = usb_curspeed_get (&usbh_core); + + uhost->usr_cb->dev_speed_detected(uhost->dev_prop.speed); + + usb_mdelay (50U); + } + break; + + case HOST_DEV_CONNECT: + uhost->usr_cb->dev_attach(); + uhost->control.pipe_out_num = usbh_pipe_allocate(&usbh_core, 0x00U); + uhost->control.pipe_in_num = usbh_pipe_allocate(&usbh_core, 0x80U); + + /* open IN control pipe */ + usbh_pipe_create (&usbh_core, + &uhost->dev_prop, + uhost->control.pipe_in_num, + USB_EPTYPE_CTRL, + (uint16_t)uhost->control.max_len); + + /* open OUT control pipe */ + usbh_pipe_create (&usbh_core, + &uhost->dev_prop, + uhost->control.pipe_out_num, + USB_EPTYPE_CTRL, + (uint16_t)uhost->control.max_len); + + uhost->cur_state = HOST_DEV_ENUM; + break; + + case HOST_DEV_ENUM: + /* check for enumeration status */ + if (USBH_OK == usbh_enum_task (uhost)) { + /* the function shall return USBH_OK when full enumeration is complete */ + + /* user callback for end of device basic enumeration */ + uhost->usr_cb->dev_enumerated(); + +#if USB_LOW_POWER + uhost->cur_state = HOST_SUSPEND; + + /* judge device remote wakup function */ + if ((uhost->dev_prop.cfg_desc_set.cfg_desc.bmAttributes) & (1U << 5)) { + uhost->dev_supp_remote_wkup = 1; + }else{ + uhost->dev_supp_remote_wkup = 0; + } +#else + uhost->cur_state = HOST_PWR_FEATURE_SET; +#endif /* USB_LOW_POWER */ + } + break; + + case HOST_PWR_FEATURE_SET: + if ((uhost->dev_prop.cfg_desc_set.cfg_desc.bmAttributes) & (1U << 5)) { + if (usbh_setdevfeature(uhost, FEATURE_SELECTOR_REMOTEWAKEUP, 0U) == USBH_OK) { + uhost->cur_state = HOST_CLASS_CHECK; + } + } else { + uhost->cur_state = HOST_CLASS_CHECK; + } + break; + + case HOST_CLASS_CHECK: + if (0U == uhost->class_num) { + uhost->cur_state = HOST_ERROR; + } else { + uhost->active_class = NULL; + + uint8_t itf_class = uhost->dev_prop.cfg_desc_set.itf_desc_set[0][0].itf_desc.bInterfaceClass; + + for (uint8_t index = 0U; index < uhost->class_num; index++) { + if ((uhost->uclass[index]->class_code == itf_class) || (0xFFU == itf_class)) { + uhost->active_class = uhost->uclass[index]; + } + } + + if (uhost->active_class != NULL) { + uhost->cur_state = HOST_USER_INPUT; + } else { + uhost->cur_state = HOST_ERROR; + } + } + break; + + case HOST_USER_INPUT: + /* the function should return user response true to move to class state */ + if (USR_IN_RESP_OK == uhost->usr_cb->dev_user_input()) { + if ((USBH_OK == uhost->active_class->class_init(uhost))) { + uhost->cur_state = HOST_CLASS_ENUM; + } + } + break; + +#if USB_LOW_POWER + case HOST_SUSPEND: + if(uhost->dev_supp_remote_wkup){ + /* send set feature command*/ + if (USBH_OK == usbh_setdevfeature(uhost, FEATURE_SELECTOR_REMOTEWAKEUP, 0U)) { + + usb_hwp_suspend(&usbh_core); + + usb_mdelay(20U); + uhost->suspend_flag = 1; + uhost->usr_cb->dev_user_input(); + + /* MCU enter deep-sleep*/ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + uhost->cur_state = HOST_WAKEUP; + } + }else { + /* host suspend */ + usb_hwp_suspend(&usbh_core); + + usb_mdelay(20U); + uhost->suspend_flag = 1U; + uhost->usr_cb->dev_user_input(); + + /* MCU enter deep-sleep */ + pmu_to_deepsleepmode(PMU_LDO_LOWPOWER, WFI_CMD); + uhost->cur_state = HOST_WAKEUP; + } + break; + + case HOST_WAKEUP: + /* judge suspend status */ + if (0 == uhost->suspend_flag) { + usb_hwp_resume(&usbh_core); + usb_mdelay(500U); + + if(uhost->dev_supp_remote_wkup){ + if (USBH_OK == usbh_clrdevfeature(uhost, FEATURE_SELECTOR_DEV, 0U)) { + /* user callback for initialization */ + uhost->usr_cb->dev_init(); + uhost->cur_state = HOST_CLASS_CHECK; + } + } else{ + uhost->cur_state = HOST_CLASS_CHECK; + } + } + break; +#endif /* USB_LOW_POWER */ + + case HOST_CLASS_ENUM: + /* process class standard control requests state machine */ + status = uhost->active_class->class_requests(uhost); + + if (USBH_OK == status) { + uhost->cur_state = HOST_CLASS_HANDLER; + } else { + usbh_error_handler (uhost, status); + } + break; + + case HOST_CLASS_HANDLER: + /* process class state machine */ + status = uhost->active_class->class_machine(uhost); + + usbh_error_handler (uhost, status); + break; + + case HOST_ERROR: + /* initialize host for new enumeration */ + usbh_deinit (uhost); + uhost->usr_cb->dev_deinit(); + uhost->active_class->class_deinit(uhost); + break; + + case HOST_DEV_DETACHED: + /* manage user disconnect operations*/ + uhost->usr_cb->dev_detach(); + + /* re-initialize host for new enumeration */ + usbh_deinit(uhost); + uhost->usr_cb->dev_deinit(); + uhost->active_class->class_deinit(uhost); + usbh_pipe_delete(&usbh_core); + uhost->cur_state = HOST_DEFAULT; + break; + + default: + break; + } +} + +/*! + \brief handle the error on USB host side + \param[in] uhost: pointer to USB host + \param[in] err_type: type of error or busy/OK state + \param[out] none + \retval none +*/ +void usbh_error_handler (usbh_host *uhost, usbh_status err_type) +{ + /* error unrecovered or not supported device speed */ + if ((USBH_SPEED_UNKNOWN_ERROR == err_type) || (USBH_UNRECOVERED_ERROR == err_type)) { + uhost->usr_cb->dev_error(); + + uhost->cur_state = HOST_ERROR; + } else if (USBH_APPLY_DEINIT == err_type) { + uhost->cur_state = HOST_ERROR; + + /* user callback for initialization */ + uhost->usr_cb->dev_init(); + } else { + /* no operation */ + } +} + +/*! + \brief USB SOF event function from the interrupt + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static uint8_t usb_ev_sof (usbh_host *uhost) +{ + /* update timer variable */ + uhost->control.timer++; + + /* this callback could be used to implement a scheduler process */ + if (uhost->active_class != NULL) { + if (uhost->active_class->class_sof != NULL) { + uhost->active_class->class_sof(uhost); + } + } + + return 0U; +} + +/*! + \brief USB connect callback function from the interrupt + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static uint8_t usb_ev_connect (usbh_host *uhost) +{ + usbh_core.host.connect_status = 1U; + + return 0U; +} + +/*! + \brief USB disconnect callback function from the interrupt + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +static uint8_t usb_ev_disconnect (usbh_host *uhost) +{ + usbh_core.host.connect_status = 0U; + + return 0U; +} + +/*! + \brief handle the USB enumeration task + \param[in] uhost: pointer to host + \param[out] none + \retval none +*/ +static usbh_status usbh_enum_task (usbh_host *uhost) +{ + uint8_t str_buf[512]; + + usbh_status status = USBH_BUSY; + + static uint8_t index_mfc_str = 0U, index_prod_str = 0U, index_serial_str = 0U; + + switch (uhost->enum_state) { + case ENUM_DEFAULT: + /* get device descriptor for only 1st 8 bytes : to get ep0 max packet size */ + if (USBH_OK == usbh_devdesc_get (uhost, 8U)) { + uhost->control.max_len = uhost->dev_prop.dev_desc.bMaxPacketSize0; + + /* modify control channels configuration for maximum packet size */ + usbh_pipe_update (&usbh_core, + uhost->control.pipe_out_num, + 0U, 0U, + (uint16_t)uhost->control.max_len); + + usbh_pipe_update (&usbh_core, + uhost->control.pipe_in_num, + 0U, 0U, + (uint16_t)uhost->control.max_len); + + uhost->enum_state = ENUM_GET_DEV_DESC; + } + break; + + case ENUM_GET_DEV_DESC: + /* get full device descriptor */ + if (USBH_OK == usbh_devdesc_get (uhost, USB_DEV_DESC_LEN)) { + uhost->usr_cb->dev_devdesc_assigned(&uhost->dev_prop.dev_desc); + + index_mfc_str = uhost->dev_prop.dev_desc.iManufacturer; + index_prod_str = uhost->dev_prop.dev_desc.iProduct; + index_serial_str = uhost->dev_prop.dev_desc.iSerialNumber; + + uhost->enum_state = ENUM_SET_ADDR; + } + break; + + case ENUM_SET_ADDR: + /* set address */ + if (USBH_OK == usbh_setaddress (uhost, USBH_DEV_ADDR)) { + usb_mdelay (2U); + + uhost->dev_prop.addr = USBH_DEV_ADDR; + + /* user callback for device address assigned */ + uhost->usr_cb->dev_address_set(); + + /* modify control channels to update device address */ + usbh_pipe_update (&usbh_core, + uhost->control.pipe_in_num, + uhost->dev_prop.addr, + 0U, 0U); + + usbh_pipe_update (&usbh_core, + uhost->control.pipe_out_num, + uhost->dev_prop.addr, + 0U, 0U); + + uhost->enum_state = ENUM_GET_CFG_DESC; + } + break; + + case ENUM_GET_CFG_DESC: + /* get standard configuration descriptor */ + if (USBH_OK == usbh_cfgdesc_get (uhost, USB_CFG_DESC_LEN)) { + uhost->enum_state = ENUM_GET_CFG_DESC_SET; + } + break; + + case ENUM_GET_CFG_DESC_SET: + /* get full configure descriptor (config, interface, endpoints) */ + if (USBH_OK == usbh_cfgdesc_get (uhost, uhost->dev_prop.cfg_desc_set.cfg_desc.wTotalLength)) { + /* user callback for configuration descriptors available */ + uhost->usr_cb->dev_cfgdesc_assigned (&uhost->dev_prop.cfg_desc_set.cfg_desc, + &uhost->dev_prop.cfg_desc_set.itf_desc_set[0][0].itf_desc, + &uhost->dev_prop.cfg_desc_set.itf_desc_set[0][0].ep_desc[0]); + + uhost->enum_state = ENUM_GET_STR_DESC; + } + break; + + case ENUM_GET_STR_DESC: + if (index_mfc_str) { + if (USBH_OK == usbh_strdesc_get (uhost, + uhost->dev_prop.dev_desc.iManufacturer, + str_buf, + 0xFFU)) { + /* user callback for manufacturing string */ + uhost->usr_cb->dev_mfc_str(str_buf); + + index_mfc_str = 0U; + } + } else { + if (index_prod_str) { + /* check that product string is available */ + if (USBH_OK == usbh_strdesc_get (uhost, + uhost->dev_prop.dev_desc.iProduct, + str_buf, + 0xFFU)) { + uhost->usr_cb->dev_prod_str(str_buf); + + index_prod_str = 0U; + } + } else { + if (index_serial_str) { + if (USBH_OK == usbh_strdesc_get (uhost, + uhost->dev_prop.dev_desc.iSerialNumber, + str_buf, + 0xFFU)) { + uhost->usr_cb->dev_seral_str(str_buf); + uhost->enum_state = ENUM_SET_CONFIGURATION; + index_serial_str = 0U; + } + } else { + uhost->enum_state = ENUM_SET_CONFIGURATION; + } + } + } + break; + + case ENUM_SET_CONFIGURATION: + if (USBH_OK == usbh_setcfg (uhost, (uint16_t)uhost->dev_prop.cfg_desc_set.cfg_desc.bConfigurationValue)) { + uhost->enum_state = ENUM_DEV_CONFIGURED; + } + break; + + case ENUM_DEV_CONFIGURED: + status = USBH_OK; + break; + + default: + break; + } + + return status; +} + + +#if USB_LOW_POWER + +/*! + \brief handles the USB resume from suspend mode + \param[in] udev: pointer to selected USB device + \param[out] none + \retval none +*/ +static void usb_hwp_resume(usb_core_driver *udev) +{ + __IO uint32_t hprt = 0U; + + /* switch-on the clocks */ + *udev->regs.PWRCLKCTL &= ~PWRCLKCTL_SUCLK; + + *udev->regs.PWRCLKCTL &= ~PWRCLKCTL_SHCLK; + + hprt = usb_port_read(udev); + + hprt &= ~HPCS_PSP; + hprt |= HPCS_PREM; + + *udev->regs.HPCS = hprt; + + usb_mdelay (20U); + + hprt &= ~HPCS_PREM; + + *udev->regs.HPCS = hprt; +} + +/*! + \brief handles the USB enter to suspend mode + \param[in] udev: pointer to selected USB device + \param[out] none + \retval none +*/ +static void usb_hwp_suspend(usb_core_driver *udev) +{ + __IO uint32_t hprt = 0U; + + hprt = usb_port_read(udev); + + hprt |= HPCS_PSP; + + *udev->regs.HPCS = hprt; + + /* switch-off the clocks */ + *udev->regs.PWRCLKCTL |= PWRCLKCTL_SUCLK; + + *udev->regs.PWRCLKCTL |= PWRCLKCTL_SHCLK; +} + +#endif /* USB_LOW_POWER */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_enum.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_enum.c new file mode 100644 index 0000000..fb6be16 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_enum.c @@ -0,0 +1,691 @@ +/*! + \file usbh_enum.c + \brief USB host mode enumberation driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_pipe.h" +#include "usbh_transc.h" +#include "usbh_enum.h" + +/* local function prototypes ('static') */ +static void usbh_devdesc_parse (usb_desc_dev *dev_desc, uint8_t *buf, uint16_t len); +static void usbh_cfgdesc_parse (usb_desc_config *cfg_desc, uint8_t *buf); +static void usbh_cfgset_parse (usb_dev_prop *udev, uint8_t *buf); +static void usbh_itfdesc_parse (usb_desc_itf *itf_desc, uint8_t *buf); +static void usbh_epdesc_parse (usb_desc_ep *ep_desc, uint8_t *buf); +static void usbh_strdesc_parse (uint8_t *psrc, uint8_t *pdest, uint16_t len); + +/*! + \brief configure USB control status parameters + \param[in] uhost: pointer to USB host + \param[in] buf: control transfer data buffer pointer + \param[in] len: length of the data buffer + \param[out] none + \retval none +*/ +void usbh_ctlstate_config (usbh_host *uhost, uint8_t *buf, uint16_t len) +{ + /* prepare the transactions */ + uhost->control.buf = buf; + uhost->control.ctl_len = len; + + uhost->control.ctl_state = CTL_SETUP; +} + +/*! + \brief get device descriptor from the USB device + \param[in] uhost: pointer to USB host + \param[in] len: length of the descriptor + \param[out] none + \retval operation status +*/ +usbh_status usbh_devdesc_get (usbh_host *uhost, uint8_t len) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_GET_DESCRIPTOR, + .wValue = USBH_DESC(USB_DESCTYPE_DEV), + .wIndex = 0U, + .wLength = len + }; + + usbh_ctlstate_config (uhost, uhost->dev_prop.data, (uint16_t)len); + } + + status = usbh_ctl_handler (uhost); + + if (USBH_OK == status) { + /* commands successfully sent and response received */ + usbh_devdesc_parse (&uhost->dev_prop.dev_desc, uhost->dev_prop.data, (uint16_t)len); + } + + return status; +} + +/*! + \brief get configuration descriptor from the USB device + \param[in] uhost: pointer to USB host + \param[in] len: length of the descriptor + \param[out] none + \retval operation status +*/ +usbh_status usbh_cfgdesc_get (usbh_host *uhost, uint16_t len) +{ + uint8_t *pdata = NULL; + + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + +#if (USBH_CFG_DESC_KEEP == 1U) + pdata = uhost->dev_prop.cfgdesc_rawdata; +#else + pdata = uhost->dev_prop.data; +#endif /* USBH_CFG_DESC_KEEP */ + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_GET_DESCRIPTOR, + .wValue = USBH_DESC(USB_DESCTYPE_CONFIG), + .wIndex = 0U, + .wLength = len + }; + + usbh_ctlstate_config (uhost, pdata, len); + } + + status = usbh_ctl_handler (uhost); + + if (USBH_OK == status) { + if (len <= USB_CFG_DESC_LEN) { + usbh_cfgdesc_parse (&uhost->dev_prop.cfg_desc_set.cfg_desc, pdata); + } else { + usbh_cfgset_parse (&uhost->dev_prop, pdata); + } + } + + return status; +} + +/*! + \brief get string descriptor from the USB device + \param[in] uhost: pointer to USB host + \param[in] str_index: index for the string descriptor + \param[in] buf: buffer pointer to the string descriptor + \param[in] len: length of the descriptor + \param[out] none + \retval operation status +*/ +usbh_status usbh_strdesc_get (usbh_host *uhost, + uint8_t str_index, + uint8_t *buf, + uint16_t len) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_IN | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_GET_DESCRIPTOR, + .wValue = USBH_DESC(USB_DESCTYPE_STR) | str_index, + .wIndex = 0x0409U, + .wLength = len + }; + + usbh_ctlstate_config (uhost, uhost->dev_prop.data, len); + } + + status = usbh_ctl_handler (uhost); + + if (USBH_OK == status) { + /* commands successfully sent and response received */ + usbh_strdesc_parse (uhost->dev_prop.data, buf, len); + } + + return status; +} + +/*! + \brief set the address to the connected device + \param[in] uhost: pointer to USB host + \param[in] dev_addr: device address to assign + \param[out] none + \retval operation status +*/ +usbh_status usbh_setaddress (usbh_host *uhost, uint8_t dev_addr) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_SET_ADDRESS, + .wValue = (uint16_t)dev_addr, + .wIndex = 0U, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set the configuration value to the connected device + \param[in] uhost: pointer to USB host + \param[in] config_index: configuration value + \param[out] none + \retval operation status +*/ +usbh_status usbh_setcfg (usbh_host *uhost, uint16_t config_index) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_SET_CONFIGURATION, + .wValue = config_index, + .wIndex = 0U, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set the interface value to the connected device + \param[in] uhost: pointer to USB host + \param[in] itf_num: interface number + \param[in] set: alternated setting value + \param[out] none + \retval operation status +*/ +usbh_status usbh_setinterface (usbh_host *uhost, uint8_t itf_num, uint8_t set) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_ITF | USB_REQTYPE_STRD, + .bRequest = USB_SET_INTERFACE, + .wValue = set, + .wIndex = itf_num, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief set the interface value to the connected device + \param[in] uhost: pointer to USB host + \param[in] feature_selector: feature selector + \param[in] windex: index value + \param[out] none + \retval operation status +*/ +usbh_status usbh_setdevfeature (usbh_host *uhost, uint8_t feature_selector, uint16_t windex) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_SET_FEATURE, + .wValue = feature_selector, + .wIndex = windex, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief clear the interface value to the connected device + \param[in] uhost: pointer to USB host + \param[in] feature_selector: feature selector + \param[in] windex: index value + \param[out] none + \retval operation status +*/ +usbh_status usbh_clrdevfeature (usbh_host *uhost, uint8_t feature_selector, uint16_t windex) +{ + usbh_status status = USBH_BUSY; + + usbh_control *usb_ctl = &uhost->control; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_DEV | USB_REQTYPE_STRD, + .bRequest = USB_CLEAR_FEATURE, + .wValue = feature_selector, + .wIndex = windex, + .wLength = 0U + }; + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief clear or disable a specific feature + \param[in] uhost: pointer to USB host + \param[in] ep_addr: endpoint address + \param[in] pp_num: pipe number + \param[out] none + \retval operation status +*/ +usbh_status usbh_clrfeature (usbh_host *uhost, uint8_t ep_addr, uint8_t pp_num) +{ + usbh_status status = USBH_BUSY; + usbh_control *usb_ctl = &uhost->control; + usb_core_driver *udev = (usb_core_driver *)uhost->data; + + if (CTL_IDLE == usb_ctl->ctl_state) { + usb_ctl->setup.req = (usb_req) { + .bmRequestType = USB_TRX_OUT | USB_RECPTYPE_EP | USB_REQTYPE_STRD, + .bRequest = USB_CLEAR_FEATURE, + .wValue = FEATURE_SELECTOR_EP, + .wIndex = ep_addr, + .wLength = 0U + }; + + if (EP_ID(ep_addr) == udev->host.pipe[pp_num].ep.num) { + usbh_pipe_toggle_set(udev, pp_num, 0U); + } else { + return USBH_FAIL; + } + + usbh_ctlstate_config (uhost, NULL, 0U); + } + + status = usbh_ctl_handler (uhost); + + return status; +} + +/*! + \brief get the next descriptor header + \param[in] pbuf: pointer to buffer where the configuration descriptor set is available + \param[in] ptr: data pointer inside the configuration descriptor set + \param[out] none + \retval return descriptor header +*/ +usb_desc_header *usbh_nextdesc_get (uint8_t *pbuf, uint16_t *ptr) +{ + usb_desc_header *pnext; + + *ptr += ((usb_desc_header *)pbuf)->bLength; + + pnext = (usb_desc_header *)((uint8_t *)pbuf + ((usb_desc_header *)pbuf)->bLength); + + return (pnext); +} + +/*! + \brief get the next descriptor header + \param[in] udev: pointer to device property + \param[in] interface: interface number + \param[out] none + \retval operation status +*/ +usbh_status usbh_interface_select (usb_dev_prop *udev, uint8_t interface) +{ + usbh_status status = USBH_OK; + + if (interface < udev->cfg_desc_set.cfg_desc.bNumInterfaces) { + udev->cur_itf = interface; + } else { + status = USBH_FAIL; + } + + return status; +} + +/*! + \brief find the interface index for a specific class + \param[in] udev: pointer to device property + \param[in] main_class: class code + \param[in] sub_class: subclass code + \param[in] protocol: protocol code + \param[out] none + \retval interface index in the configuration structure +*/ +uint8_t usbh_interface_find (usb_dev_prop *udev, uint8_t main_class, uint8_t sub_class, uint8_t protocol) +{ + usb_desc_itf *pif; + + uint8_t if_ix = 0U; + + pif = (usb_desc_itf *)0; + + while (if_ix < udev->cfg_desc_set.cfg_desc.bNumInterfaces) { + pif = &udev->cfg_desc_set.itf_desc_set[if_ix][0].itf_desc; + + if (((pif->bInterfaceClass == main_class) || (0xFFU == main_class))&& + ((pif->bInterfaceSubClass == sub_class) || (0xFFU == sub_class))&& + ((pif->bInterfaceProtocol == protocol) || (0xFFU == protocol))) { + return if_ix; + } + + if_ix++; + } + + return 0xFFU; +} + +/*! + \brief find the interface index for a specific class interface and alternate setting number + \param[in] udev: pointer to device property + \param[in] interface_number: interface number + \param[in] alt_settings: alternate setting number + \param[out] none + \retval interface index in the configuration structure +*/ +uint8_t usbh_interfaceindex_find (usb_dev_prop *udev, uint8_t interface_number, uint8_t alt_settings) +{ + usb_desc_itf *pif; + + uint8_t if_ix = 0U; + + pif = (usb_desc_itf *)0; + + while (if_ix < USBH_MAX_INTERFACES_NUM) { + pif = &udev->cfg_desc_set.itf_desc_set[if_ix][alt_settings].itf_desc; + + if ((pif->bInterfaceNumber == interface_number) && (pif->bAlternateSetting == alt_settings)) { + return if_ix; + } + + if_ix++; + } + + return 0xFFU; +} + +/*! + \brief parse the device descriptor + \param[in] dev_desc: pointer to USB device descriptor buffer + \param[in] buf: pointer to the source descriptor buffer + \param[in] len: length of the descriptor + \param[out] none + \retval none +*/ +static void usbh_devdesc_parse (usb_desc_dev *dev_desc, uint8_t *buf, uint16_t len) +{ + *dev_desc = (usb_desc_dev) { + .header = { + .bLength = *(uint8_t *)(buf + 0U), + .bDescriptorType = *(uint8_t *)(buf + 1U) + }, + + .bcdUSB = BYTE_SWAP(buf + 2U), + .bDeviceClass = *(uint8_t *)(buf + 4U), + .bDeviceSubClass = *(uint8_t *)(buf + 5U), + .bDeviceProtocol = *(uint8_t *)(buf + 6U), + .bMaxPacketSize0 = *(uint8_t *)(buf + 7U) + }; + + if (len > 8U) { + /* for 1st time after device connection, host may issue only 8 bytes for device descriptor length */ + dev_desc->idVendor = BYTE_SWAP(buf + 8U); + dev_desc->idProduct = BYTE_SWAP(buf + 10U); + dev_desc->bcdDevice = BYTE_SWAP(buf + 12U); + dev_desc->iManufacturer = *(uint8_t *)(buf + 14U); + dev_desc->iProduct = *(uint8_t *)(buf + 15U); + dev_desc->iSerialNumber = *(uint8_t *)(buf + 16U); + dev_desc->bNumberConfigurations = *(uint8_t *)(buf + 17U); + } +} + +/*! + \brief parse the configuration descriptor + \param[in] cfg_desc: pointer to USB configuration descriptor buffer + \param[in] buf: pointer to the source descriptor buffer + \param[out] none + \retval none +*/ +static void usbh_cfgdesc_parse (usb_desc_config *cfg_desc, uint8_t *buf) +{ + /* parse configuration descriptor */ + *cfg_desc = (usb_desc_config) { + .header = { + .bLength = *(uint8_t *)(buf + 0U), + .bDescriptorType = *(uint8_t *)(buf + 1U), + }, + + .wTotalLength = BYTE_SWAP(buf + 2U), + .bNumInterfaces = *(uint8_t *)(buf + 4U), + .bConfigurationValue = *(uint8_t *)(buf + 5U), + .iConfiguration = *(uint8_t *)(buf + 6U), + .bmAttributes = *(uint8_t *)(buf + 7U), + .bMaxPower = *(uint8_t *)(buf + 8U) + }; +} + +/*! + \brief parse the configuration descriptor set + \param[in] udev: pointer to device property + \param[in] buf: pointer to the source descriptor buffer + \param[out] none + \retval none +*/ +static void usbh_cfgset_parse (usb_dev_prop *udev, uint8_t *buf) +{ + usb_desc_ep *ep = NULL; + usb_desc_itf_set *itf = NULL; + usb_desc_itf itf_value; + usb_desc_config *cfg = NULL; + + usb_desc_header *pdesc = (usb_desc_header *)buf; + + uint8_t itf_index = 0U, ep_index = 0U, alt_setting = 0U; + uint8_t pre_itf_index = 0U; + uint16_t ptr; + + /* parse configuration descriptor */ + usbh_cfgdesc_parse (&udev->cfg_desc_set.cfg_desc, buf); + cfg = &udev->cfg_desc_set.cfg_desc; + ptr = USB_CFG_DESC_LEN; + + if (cfg->bNumInterfaces > USBH_MAX_INTERFACES_NUM) { + return; + } + + while (ptr < cfg->wTotalLength) { + pdesc = usbh_nextdesc_get ((uint8_t *)pdesc, &ptr); + + if (pdesc->bDescriptorType == USB_DESCTYPE_ITF) { + itf_index = *(((uint8_t *)pdesc) + 2U); + + if (pre_itf_index != itf_index) { + alt_setting = 0U; + } + + itf = &udev->cfg_desc_set.itf_desc_set[itf_index][alt_setting]; + + alt_setting++; + + if ((*((uint8_t *)pdesc + 3U)) < 3U) { + usbh_itfdesc_parse (&itf_value, (uint8_t *)pdesc); + + /* parse endpoint descriptors relative to the current interface */ + if (itf_value.bNumEndpoints > USBH_MAX_EP_NUM) { + return; + } + + usbh_itfdesc_parse (&itf->itf_desc, (uint8_t *)&itf_value); + + /* store the previous interface index */ + pre_itf_index = itf_index; + + if (0U == itf_value.bNumEndpoints) { + continue; + } + + for (ep_index = 0U; ep_index < itf_value.bNumEndpoints; ) { + pdesc = usbh_nextdesc_get ((void*)pdesc, &ptr); + + if (pdesc->bDescriptorType == USB_DESCTYPE_EP) { + ep = &itf->ep_desc[ep_index]; + + usbh_epdesc_parse (ep, (uint8_t *)pdesc); + + ep_index++; + } + } + } + } + } +} + +/*! + \brief parse the interface descriptor + \param[in] itf_desc: pointer to USB interface descriptor buffer + \param[in] buf: pointer to the source descriptor buffer + \param[out] none + \retval none +*/ +static void usbh_itfdesc_parse (usb_desc_itf *itf_desc, uint8_t *buf) +{ + *itf_desc = (usb_desc_itf) { + .header = { + .bLength = *(uint8_t *)(buf + 0U), + .bDescriptorType = *(uint8_t *)(buf + 1U), + }, + + .bInterfaceNumber = *(uint8_t *)(buf + 2U), + .bAlternateSetting = *(uint8_t *)(buf + 3U), + .bNumEndpoints = *(uint8_t *)(buf + 4U), + .bInterfaceClass = *(uint8_t *)(buf + 5U), + .bInterfaceSubClass = *(uint8_t *)(buf + 6U), + .bInterfaceProtocol = *(uint8_t *)(buf + 7U), + .iInterface = *(uint8_t *)(buf + 8U) + }; +} + +/*! + \brief parse the endpoint descriptor + \param[in] ep_desc: pointer to USB endpoint descriptor buffer + \param[in] buf: pointer to the source descriptor buffer + \param[out] none + \retval none +*/ +static void usbh_epdesc_parse (usb_desc_ep *ep_desc, uint8_t *buf) +{ + *ep_desc = (usb_desc_ep) { + .header = { + .bLength = *(uint8_t *)(buf + 0U), + .bDescriptorType = *(uint8_t *)(buf + 1U) + }, + + .bEndpointAddress = *(uint8_t *)(buf + 2U), + .bmAttributes = *(uint8_t *)(buf + 3U), + .wMaxPacketSize = BYTE_SWAP(buf + 4U), + .bInterval = *(uint8_t *)(buf + 6U) + }; +} + +/*! + \brief parse the string descriptor + \param[in] psrc: source pointer containing the descriptor data + \param[in] pdest: destination address pointer + \param[in] len: length of the descriptor + \param[out] none + \retval none +*/ +static void usbh_strdesc_parse (uint8_t *psrc, uint8_t *pdest, uint16_t len) +{ + uint16_t str_len = 0U, index = 0U; + + /* the unicode string descriptor is not NULL-terminated. The string length is + * computed by substracting two from the value of the first byte of the descriptor. + */ + + /* check which is lower size, the size of string or the length of bytes read from the device */ + if (USB_DESCTYPE_STR == psrc[1]) { + /* make sure the descriptor is string type */ + + /* psrc[0] contains Size of Descriptor, subtract 2 to get the length of string */ + str_len = USB_MIN((uint16_t)psrc[0] - 2U, len); + + psrc += 2U; /* adjust the offset ignoring the string len and descriptor type */ + + for (index = 0U; index < str_len; index += 2U) { + /* copy only the string and ignore the unicode id, hence add the src */ + *pdest = psrc[index]; + + pdest++; + } + + *pdest = 0U; /* mark end of string */ + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_pipe.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_pipe.c new file mode 100644 index 0000000..3e5c5a5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_pipe.c @@ -0,0 +1,174 @@ +/*! + \file usbh_pipe.c + \brief USB host mode pipe operation driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "usbh_pipe.h" + +/* local function prototypes ('static') */ +static uint16_t usbh_freepipe_get (usb_core_driver *udev); + +/*! + \brief create a pipe + \param[in] udev: pointer to USB core instance + \param[in] dev: USB device + \param[in] pp_num: pipe number + \param[in] ep_type: endpoint type + \param[in] ep_mpl: endpoint max packet length + \param[out] none + \retval operation status +*/ +uint8_t usbh_pipe_create (usb_core_driver *udev, + usb_dev_prop *dev, + uint8_t pp_num, + uint8_t ep_type, + uint16_t ep_mpl) +{ + usb_pipe *pp = &udev->host.pipe[pp_num]; + + pp->dev_addr = dev->addr; + pp->dev_speed = dev->speed; + pp->ep.type = ep_type; + pp->ep.mps = ep_mpl; + pp->ping = (uint8_t)(dev->speed == PORT_SPEED_HIGH); + + usb_pipe_init (udev, pp_num); + + return HP_OK; +} + +/*! + \brief update a pipe + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[in] dev_addr: device address + \param[in] dev_speed: device speed + \param[in] ep_mpl: endpoint max packet length + \param[out] none + \retval operation status +*/ +uint8_t usbh_pipe_update (usb_core_driver *udev, + uint8_t pp_num, + uint8_t dev_addr, + uint32_t dev_speed, + uint16_t ep_mpl) +{ + usb_pipe *pp = &udev->host.pipe[pp_num]; + + if ((pp->dev_addr != dev_addr) && (dev_addr)) { + pp->dev_addr = dev_addr; + } + + if ((pp->dev_speed != dev_speed) && (dev_speed)) { + pp->dev_speed = dev_speed; + } + + if ((pp->ep.mps != ep_mpl) && (ep_mpl)) { + pp->ep.mps = ep_mpl; + } + + usb_pipe_init (udev, pp_num); + + return HP_OK; +} + +/*! + \brief allocate a new pipe + \param[in] udev: pointer to USB core instance + \param[in] ep_addr: endpoint address + \param[out] none + \retval operation status +*/ +uint8_t usbh_pipe_allocate (usb_core_driver *udev, uint8_t ep_addr) +{ + uint16_t pp_num = usbh_freepipe_get (udev); + + if (HP_ERROR != pp_num) { + udev->host.pipe[pp_num].in_used = 1U; + udev->host.pipe[pp_num].ep.dir = EP_DIR(ep_addr); + udev->host.pipe[pp_num].ep.num = EP_ID(ep_addr); + } + + return (uint8_t)pp_num; +} + +/*! + \brief free a pipe + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[out] none + \retval operation status +*/ +uint8_t usbh_pipe_free (usb_core_driver *udev, uint8_t pp_num) +{ + if (pp_num < HP_MAX) { + udev->host.pipe[pp_num].in_used = 0U; + } + + return USBH_OK; +} + +/*! + \brief delete all USB host pipe + \param[in] udev: pointer to USB core instance + \param[out] none + \retval operation status +*/ +uint8_t usbh_pipe_delete (usb_core_driver *udev) +{ + uint8_t pp_num = 0U; + + for (pp_num = 2U; pp_num < HP_MAX; pp_num++) { + udev->host.pipe[pp_num] = (usb_pipe) {0}; + } + + return USBH_OK; +} + +/*! + \brief get a free pipe number for allocation + \param[in] udev: pointer to USB core instance + \param[out] none + \retval operation status +*/ +static uint16_t usbh_freepipe_get (usb_core_driver *udev) +{ + uint8_t pp_num = 0U; + + for (pp_num = 0U; pp_num < HP_MAX; pp_num++) { + if (0U == udev->host.pipe[pp_num].in_used) { + return (uint16_t)pp_num; + } + } + + return HP_ERROR; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_transc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_transc.c new file mode 100644 index 0000000..8780b2b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/host/core/Source/usbh_transc.c @@ -0,0 +1,368 @@ +/*! + \file usbh_transc.c + \brief USB host mode transactions driver + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "drv_usb_hw.h" +#include "usbh_pipe.h" +#include "usbh_transc.h" + +/* local function prototypes ('static') */ +static usb_urb_state usbh_urb_wait (usbh_host *uhost, uint8_t pp_num, uint32_t wait_time); +static void usbh_setup_transc (usbh_host *uhost); +static void usbh_data_in_transc (usbh_host *uhost); +static void usbh_data_out_transc (usbh_host *uhost); +static void usbh_status_in_transc (usbh_host *uhost); +static void usbh_status_out_transc (usbh_host *uhost); +static uint32_t usbh_request_submit (usb_core_driver *udev, uint8_t pp_num); + +/*! + \brief send the setup packet to the USB device + \param[in] udev: pointer to USB core instance + \param[in] buf: data buffer which will be sent to USB device + \param[in] pp_num: pipe number + \param[out] none + \retval operation status +*/ +usbh_status usbh_ctlsetup_send (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num) +{ + usb_pipe *pp = &udev->host.pipe[pp_num]; + + pp->DPID = PIPE_DPID_SETUP; + pp->xfer_buf = buf; + pp->xfer_len = USB_SETUP_PACKET_LEN; + + return (usbh_status)usbh_request_submit (udev, pp_num); +} + +/*! + \brief send a data packet to the USB device + \param[in] udev: pointer to USB core instance + \param[in] buf: data buffer which will be sent to USB device + \param[in] pp_num: pipe number + \param[in] len: length of the data to be sent + \param[out] none + \retval operation status +*/ +usbh_status usbh_data_send (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len) +{ + usb_pipe *pp = &udev->host.pipe[pp_num]; + + pp->xfer_buf = buf; + pp->xfer_len = len; + + switch (pp->ep.type) { + case USB_EPTYPE_CTRL: + if (0U == len) { + pp->data_toggle_out = 1U; + } + + pp->DPID = PIPE_DPID[pp->data_toggle_out]; + break; + + case USB_EPTYPE_INTR: + pp->DPID = PIPE_DPID[pp->data_toggle_out]; + + pp->data_toggle_out ^= 1U; + break; + + case USB_EPTYPE_BULK: + pp->DPID = PIPE_DPID[pp->data_toggle_out]; + break; + + case USB_EPTYPE_ISOC: + pp->DPID = PIPE_DPID[0]; + break; + + default: + break; + } + + usbh_request_submit (udev, pp_num); + + return USBH_OK; +} + +/*! + \brief receive a data packet from the USB device + \param[in] udev: pointer to USB core instance + \param[in] buf: data buffer which will be received from USB device + \param[in] pp_num: pipe number + \param[in] len: length of the data to be received + \param[out] none + \retval operation status +*/ +usbh_status usbh_data_recev (usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len) +{ + usb_pipe *pp = &udev->host.pipe[pp_num]; + + pp->xfer_buf = buf; + pp->xfer_len = len; + + switch (pp->ep.type) { + case USB_EPTYPE_CTRL: + pp->DPID = PIPE_DPID[1]; + break; + + case USB_EPTYPE_INTR: + pp->DPID = PIPE_DPID[pp->data_toggle_in]; + + /* toggle DATA PID */ + pp->data_toggle_in ^= 1U; + break; + + case USB_EPTYPE_BULK: + pp->DPID = PIPE_DPID[pp->data_toggle_in]; + break; + + case USB_EPTYPE_ISOC: + pp->DPID = PIPE_DPID[0]; + break; + + default: + break; + } + + usbh_request_submit (udev, pp_num); + + return USBH_OK; +} + +/*! + \brief USB control transfer handler + \param[in] uhost: pointer to USB host + \param[out] none + \retval operation status +*/ +usbh_status usbh_ctl_handler (usbh_host *uhost) +{ + usbh_status status = USBH_BUSY; + + switch (uhost->control.ctl_state) { + case CTL_SETUP: + usbh_setup_transc (uhost); + break; + + case CTL_DATA_IN: + usbh_data_in_transc (uhost); + break; + + case CTL_DATA_OUT: + usbh_data_out_transc (uhost); + break; + + case CTL_STATUS_IN: + usbh_status_in_transc (uhost); + break; + + case CTL_STATUS_OUT: + usbh_status_out_transc (uhost); + break; + + case CTL_FINISH: + uhost->control.ctl_state = CTL_IDLE; + + status = USBH_OK; + break; + + case CTL_ERROR: + if (++uhost->control.error_count <= USBH_MAX_ERROR_COUNT) { + /* do the transmission again, starting from SETUP packet */ + uhost->control.ctl_state = CTL_SETUP; + } else { + status = USBH_FAIL; + } + break; + + default: + break; + } + + return status; +} + +/*! + \brief wait for USB URB(USB request block) state + \param[in] uhost: pointer to USB host + \param[in] pp_num: pipe number + \param[in] wait_time: wait time + \param[out] none + \retval USB URB state +*/ +static usb_urb_state usbh_urb_wait (usbh_host *uhost, uint8_t pp_num, uint32_t wait_time) +{ + uint32_t timeout = 0U; + usb_urb_state urb_status = URB_IDLE; + timeout = uhost->control.timer; + + while (URB_DONE != (urb_status = usbh_urbstate_get(uhost->data, pp_num))) { + if (URB_NOTREADY == urb_status) { + break; + } else if (URB_STALL == urb_status) { + uhost->control.ctl_state = CTL_SETUP; + break; + } else if (URB_ERROR == urb_status) { + uhost->control.ctl_state = CTL_ERROR; + break; + } else if ((wait_time > 0U) && ((uhost->control.timer - timeout) > wait_time)) { + /* timeout for in transfer */ + uhost->control.ctl_state = CTL_ERROR; + break; + } else { + /* no operation, just wait */ + } + } + + return urb_status; +} + +/*! + \brief USB setup transaction + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +static void usbh_setup_transc (usbh_host *uhost) +{ + /* send a SETUP packet */ + usbh_ctlsetup_send (uhost->data, + uhost->control.setup.data, + uhost->control.pipe_out_num); + + if (URB_DONE == usbh_urb_wait (uhost, uhost->control.pipe_out_num, 0U)) { + uint8_t dir = (uhost->control.setup.req.bmRequestType & USB_TRX_MASK); + + if (uhost->control.setup.req.wLength) { + if (USB_TRX_IN == dir) { + uhost->control.ctl_state = CTL_DATA_IN; + } else { + uhost->control.ctl_state = CTL_DATA_OUT; + } + } else { + if (USB_TRX_IN == dir) { + uhost->control.ctl_state = CTL_STATUS_OUT; + } else { + uhost->control.ctl_state = CTL_STATUS_IN; + } + } + } +} + +/*! + \brief USB data IN transaction + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +static void usbh_data_in_transc (usbh_host *uhost) +{ + usbh_data_recev (uhost->data, + uhost->control.buf, + uhost->control.pipe_in_num, + uhost->control.ctl_len); + + if (URB_DONE == usbh_urb_wait (uhost, uhost->control.pipe_in_num, DATA_STAGE_TIMEOUT)) { + uhost->control.ctl_state = CTL_STATUS_OUT; + + } +} + +/*! + \brief USB data OUT transaction + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +static void usbh_data_out_transc (usbh_host *uhost) +{ + usbh_pipe_toggle_set(uhost->data, uhost->control.pipe_out_num, 1U); + + usbh_data_send (uhost->data, + uhost->control.buf, + uhost->control.pipe_out_num, + uhost->control.ctl_len); + + if (URB_DONE == usbh_urb_wait (uhost, uhost->control.pipe_out_num, DATA_STAGE_TIMEOUT)) { + uhost->control.ctl_state = CTL_STATUS_IN; + + } +} + +/*! + \brief USB status IN transaction + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +static void usbh_status_in_transc (usbh_host *uhost) +{ + uint8_t pp_num = uhost->control.pipe_in_num; + + usbh_data_recev (uhost->data, NULL, pp_num, 0U); + + if (URB_DONE == usbh_urb_wait (uhost, pp_num, NODATA_STAGE_TIMEOUT)) { + uhost->control.ctl_state = CTL_FINISH; + } +} + +/*! + \brief USB status OUT transaction + \param[in] uhost: pointer to USB host + \param[out] none + \retval none +*/ +static void usbh_status_out_transc (usbh_host *uhost) +{ + uint8_t pp_num = uhost->control.pipe_out_num; + + usbh_data_send (uhost->data, NULL, pp_num, 0U); + + if (URB_DONE == usbh_urb_wait (uhost, pp_num, NODATA_STAGE_TIMEOUT)) { + uhost->control.ctl_state = CTL_FINISH; + } +} + +/*! + \brief prepare a pipe and start a transfer + \param[in] udev: pointer to USB core instance + \param[in] pp_num: pipe number + \param[out] none + \retval operation status +*/ +static uint32_t usbh_request_submit (usb_core_driver *udev, uint8_t pp_num) +{ + udev->host.pipe[pp_num].urb_state = URB_IDLE; + udev->host.pipe[pp_num].xfer_count = 0U; + + return (uint32_t)usb_pipe_xfer (udev, pp_num); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/cdc/usb_cdc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/cdc/usb_cdc.h new file mode 100644 index 0000000..4afa669 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/cdc/usb_cdc.h @@ -0,0 +1,188 @@ +/*! + \file usb_cdc.h + \brief the header file of communication device class standard + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CDC_H +#define __USB_CDC_H + +#include "usb_ch9_std.h" + +/* communications device class code */ +#define USB_CLASS_CDC 0x02U + +/* communications interface class control protocol codes */ +#define USB_CDC_PROTOCOL_NONE 0x00U +#define USB_CDC_PROTOCOL_AT 0x01U +#define USB_CDC_PROTOCOL_VENDOR 0xFFU + +/* data interface class code */ +#define USB_CLASS_DATA 0x0AU + +#define USB_DESCTYPE_CDC_ACM 0x21U +#define USB_DESCTYPE_CS_INTERFACE 0x24U + +#define USB_CDC_ACM_CONFIG_DESC_SIZE 0x43U + +/* class-specific notification codes for pstn subclasses */ +#define USB_CDC_NOTIFY_SERIAL_STATE 0x20U + +/* class-specific request codes */ +#define SEND_ENCAPSULATED_COMMAND 0x00U +#define GET_ENCAPSULATED_RESPONSE 0x01U +#define SET_COMM_FEATURE 0x02U +#define GET_COMM_FEATURE 0x03U +#define CLEAR_COMM_FEATURE 0x04U + +#define SET_AUX_LINE_STATE 0x10U +#define SET_HOOK_STATE 0x11U +#define PULSE_SETUP 0x12U +#define SEND_PULSE 0x13U +#define SET_PULSE_TIME 0x14U +#define RING_AUX_JACK 0x15U + +#define SET_LINE_CODING 0x20U +#define GET_LINE_CODING 0x21U +#define SET_CONTROL_LINE_STATE 0x22U +#define SEND_BREAK 0x23U +#define NO_CMD 0xFFU + +#define SET_RINGER_PARMS 0x30U +#define GET_RINGER_PARMS 0x31U +#define SET_OPERATION_PARMS 0x32U +#define GET_OPERATION_PARMS 0x33U +#define SET_LINE_PARMS 0x34U +#define GET_LINE_PARMS 0x35U +#define DIAL_DIGITS 0x36U +#define SET_UNIT_PARAMETER 0x37U +#define GET_UNIT_PARAMETER 0x38U +#define CLEAR_UNIT_PARAMETER 0x39U +#define GET_PROFILE 0x3AU + +#define SET_ETHERNET_MULTICAST_FILTERS 0x40U +#define SET_ETHERNET_POWER_MANAGEMENT_PATTERN FILTER 0x41U +#define GET_ETHERNET_POWER_MANAGEMENT_PATTERN FILTER 0x42U +#define SET_ETHERNET_PACKET_FILTER 0x43U +#define GET_ETHERNET_STATISTIC 0x44U + +#define SET_ATM_DATA_FORMAT 0x50U +#define GET_ATM_DEVICE_STATISTICS 0x51U +#define SET_ATM_DEFAULT_VC 0x52U +#define GET_ATM_VC_STATISTICS 0x53U + +/* wValue for set control line state */ +#define CDC_ACTIVATE_CARRIER_SIGNAL_RTS 0x0002U +#define CDC_DEACTIVATE_CARRIER_SIGNAL_RTS 0x0000U +#define CDC_ACTIVATE_SIGNAL_DTR 0x0001U +#define CDC_DEACTIVATE_SIGNAL_DTR 0x0000U + +/* CDC subclass code */ +enum usb_cdc_subclass +{ + USB_CDC_SUBCLASS_RESERVED = 0U, /*!< reserved */ + USB_CDC_SUBCLASS_DLCM, /*!< direct line control mode */ + USB_CDC_SUBCLASS_ACM, /*!< abstract control mode */ + USB_CDC_SUBCLASS_TCM, /*!< telephone control mode */ + USB_CDC_SUBCLASS_MCM, /*!< multichannel control model */ + USB_CDC_SUBCLASS_CCM, /*!< CAPI control model */ + USB_CDC_SUBCLASS_ENCM, /*!< ethernet networking control model */ + USB_CDC_SUBCLASS_ANCM /*!< ATM networking control model */ +}; + +#pragma pack(1) + +/* cdc acm line coding structure */ +typedef struct +{ + uint32_t dwDTERate; /*!< data terminal rate */ + uint8_t bCharFormat; /*!< stop bits */ + uint8_t bParityType; /*!< parity */ + uint8_t bDataBits; /*!< data bits */ +} acm_line; + +/* notification structure */ +typedef struct +{ + uint8_t bmRequestType; /*!< type of request */ + uint8_t bNotification; /*!< communication interface class notifications */ + uint16_t wValue; /*!< value of notification */ + uint16_t wIndex; /*!< index of interface */ + uint16_t wLength; /*!< length of notification data */ +} acm_notification; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: header function descriptor */ + uint16_t bcdCDC; /*!< bcdCDC: low byte of spec release number (CDC1.10) */ +} usb_desc_header_func; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: call management function descriptor */ + uint8_t bmCapabilities; /*!< bmCapabilities: D0 is reset, D1 is ignored */ + uint8_t bDataInterface; /*!< bDataInterface: 1 interface used for call management */ +} usb_desc_call_managment_func; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: abstract control management descriptor */ + uint8_t bmCapabilities; /*!< bmCapabilities: D1 */ +} usb_desc_acm_func; + +typedef struct +{ + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint8_t bDescriptorSubtype; /*!< bDescriptorSubtype: union function descriptor */ + uint8_t bMasterInterface; /*!< bMasterInterface: communication class interface */ + uint8_t bSlaveInterface0; /*!< bSlaveInterface0: data class interface */ +} usb_desc_union_func; + +#pragma pack() + +typedef struct +{ + usb_desc_config config; + usb_desc_itf cmd_itf; + usb_desc_header_func cdc_header; + usb_desc_call_managment_func cdc_call_managment; + usb_desc_acm_func cdc_acm; + usb_desc_union_func cdc_union; + usb_desc_ep cdc_cmd_endpoint; + usb_desc_itf cdc_data_interface; + usb_desc_ep cdc_out_endpoint; + usb_desc_ep cdc_in_endpoint; +} usb_cdc_desc_config_set; + +#endif /* __USB_CDC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/hid/usb_hid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/hid/usb_hid.h new file mode 100644 index 0000000..68148e4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/hid/usb_hid.h @@ -0,0 +1,83 @@ +/*! + \file usb_hid.h + \brief definitions for the USB HID class + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_HID_H +#define __USB_HID_H + +#include "usb_ch9_std.h" + +#define USB_HID_CLASS 0x03U + +#define USB_DESCTYPE_HID 0x21U +#define USB_DESCTYPE_REPORT 0x22U + +/* HID subclass code */ +#define USB_HID_SUBCLASS_BOOT_ITF 0x01U + +/* HID protocol codes */ +#define USB_HID_PROTOCOL_KEYBOARD 0x01U +#define USB_HID_PROTOCOL_MOUSE 0x02U + +#define GET_REPORT 0x01U +#define GET_IDLE 0x02U +#define GET_PROTOCOL 0x03U +#define SET_REPORT 0x09U +#define SET_IDLE 0x0AU +#define SET_PROTOCOL 0x0BU + +#pragma pack(1) + +typedef struct +{ + usb_desc_header header; /*!< regular descriptor header containing the descriptor's type and length */ + + uint16_t bcdHID; /*!< BCD encoded version that the HID descriptor and device complies to */ + uint8_t bCountryCode; /*!< country code of the localized device, or zero if universal */ + uint8_t bNumDescriptors; /*!< total number of HID report descriptors for the interface */ + uint8_t bDescriptorType; /*!< type of HID report */ + uint16_t wDescriptorLength; /*!< length of the associated HID report descriptor, in bytes */ +} usb_desc_hid; + +#pragma pack() + +typedef struct +{ + usb_desc_config config; + usb_desc_itf hid_itf; + usb_desc_hid hid_vendor; + usb_desc_ep hid_epin; + usb_desc_ep hid_epout; +}usb_hid_desc_config_set; + +#endif /* __USB_HID_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_bbb.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_bbb.h new file mode 100644 index 0000000..f2a37f7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_bbb.h @@ -0,0 +1,72 @@ +/*! + \file msc_bbb.h + \brief definitions for the USB MSC BBB(bulk/bulk/bulk) protocol + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __MSC_BBB_H +#define __MSC_BBB_H + +#include "usb_ch9_std.h" + +#define BBB_CBW_SIGNATURE 0x43425355U +#define BBB_CSW_SIGNATURE 0x53425355U +#define BBB_CBW_LENGTH 31U +#define BBB_CSW_LENGTH 13U + +typedef struct +{ + uint32_t dCBWSignature; + uint32_t dCBWTag; + uint32_t dCBWDataTransferLength; + uint8_t bmCBWFlags; + uint8_t bCBWLUN; + uint8_t bCBWCBLength; + uint8_t CBWCB[16]; +}msc_bbb_cbw; + +typedef struct +{ + uint32_t dCSWSignature; + uint32_t dCSWTag; + uint32_t dCSWDataResidue; + uint8_t bCSWStatus; +}msc_bbb_csw; + +/* CSW command status */ +enum msc_csw_status +{ + CSW_CMD_PASSED = 0, + CSW_CMD_FAILED, + CSW_PHASE_ERROR +}; + +#endif /* __MSC_BBB_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_scsi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_scsi.h new file mode 100644 index 0000000..c583b8a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/msc_scsi.h @@ -0,0 +1,119 @@ +/*! + \file msc_scsi.h + \brief definitions for the USB MSC SCSI commands + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __MSC_SCSI_H +#define __MSC_SCSI_H + +#include "usb_ch9_std.h" + +/* SCSI commands */ +#define SCSI_FORMAT_UNIT 0x04U +#define SCSI_INQUIRY 0x12U +#define SCSI_MODE_SELECT6 0x15U +#define SCSI_MODE_SELECT10 0x55U +#define SCSI_MODE_SENSE6 0x1AU +#define SCSI_READ_TOC_DATA 0x43U +#define SCSI_MODE_SENSE10 0x5AU +#define SCSI_ALLOW_MEDIUM_REMOVAL 0x1EU +#define SCSI_READ6 0x08U +#define SCSI_READ10 0x28U +#define SCSI_READ12 0xA8U +#define SCSI_READ16 0x88U + +#define SCSI_READ_CAPACITY10 0x25U +#define SCSI_READ_CAPACITY16 0x9EU + +#define SCSI_REQUEST_SENSE 0x03U +#define SCSI_START_STOP_UNIT 0x1BU +#define SCSI_TEST_UNIT_READY 0x00U +#define SCSI_WRITE6 0x0AU +#define SCSI_WRITE10 0x2AU +#define SCSI_WRITE12 0xAAU +#define SCSI_WRITE16 0x8AU + +#define SCSI_VERIFY10 0x2FU +#define SCSI_VERIFY12 0xAFU +#define SCSI_VERIFY16 0x8FU + +#define SCSI_SEND_DIAGNOSTIC 0x1DU +#define SCSI_READ_FORMAT_CAPACITIES 0x23U + +#define INVALID_CDB 0x20U +#define INVALID_FIELED_IN_COMMAND 0x24U +#define PARAMETER_LIST_LENGTH_ERROR 0x1AU +#define INVALID_FIELD_IN_PARAMETER_LIST 0x26U +#define ADDRESS_OUT_OF_RANGE 0x21U +#define MEDIUM_NOT_PRESENT 0x3AU +#define MEDIUM_HAVE_CHANGED 0x28U +#define WRITE_PROTECTED 0x27U +#define UNRECOVERED_READ_ERROR 0x11U +#define WRITE_FAULT 0x03U + +#define READ_FORMAT_CAPACITY_DATA_LEN 0x0CU +#define READ_CAPACITY10_DATA_LEN 0x08U +#define MODE_SENSE10_DATA_LEN 0x08U +#define MODE_SENSE6_DATA_LEN 0x04U +#define READ_TOC_CMD_LEN 0x14U +#define REQUEST_SENSE_DATA_LEN 0x12U +#define STANDARD_INQUIRY_DATA_LEN 0x24U +#define BLKVFY 0x04U + +enum sense_state +{ + NO_SENSE = 0U, + RECOVERED_ERROR, + NOT_READY, + MEDIUM_ERROR, + HARDWARE_ERROR, + ILLEGAL_REQUEST, + UNIT_ATTENTION, + DATA_PROTECT, + BLANK_CHECK, + VENDOR_SPECIFIC, + COPY_ABORTED, + ABORTED_COMMAND, + RESERVED, + VOLUME_OVERFLOW, + MISCOMPARE +}; + +typedef struct +{ + uint8_t SenseKey; + uint32_t Information; + uint8_t ASC; + uint8_t ASCQ; +} msc_scsi_sense; + +#endif /* __MSC_SCSI_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/usb_msc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/usb_msc.h new file mode 100644 index 0000000..99f90d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/class/msc/usb_msc.h @@ -0,0 +1,68 @@ +/*! + \file usb_msc.h + \brief definitions for the USB MSC class + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_MSC_H +#define __USB_MSC_H + +#include "usb_ch9_std.h" + +/* mass storage device class code */ +#define USB_CLASS_MSC 0x08U + +/* mass storage subclass code */ +#define USB_MSC_SUBCLASS_RBC 0x01U +#define USB_MSC_SUBCLASS_ATAPI 0x02U +#define USB_MSC_SUBCLASS_UFI 0x04U +#define USB_MSC_SUBCLASS_SCSI 0x06U +#define USB_MSC_SUBCLASS_LOCKABLE 0x07U +#define USB_MSC_SUBCLASS_IEEE1667 0x08U + +/* mass storage interface class control protocol codes */ +#define USB_MSC_PROTOCOL_CBI 0x00U +#define USB_MSC_PROTOCOL_CBI_ALT 0x01U +#define USB_MSC_PROTOCOL_BBB 0x50U + +/* mass storage request codes */ +#define USB_MSC_REQ_CODES_ADSC 0x00U +#define USB_MSC_REQ_CODES_GET 0xFCU +#define USB_MSC_REQ_CODES_PUT 0xFDU +#define USB_MSC_REQ_CODES_GML 0xFEU +#define USB_MSC_REQ_CODES_BOMSR 0xFFU + +#define BBB_GET_MAX_LUN 0xFEU +#define BBB_RESET 0xFFU + +#define SCSI_CMD_LENGTH 16U + +#endif /* __USB_MSC_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/common/usb_ch9_std.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/common/usb_ch9_std.h new file mode 100644 index 0000000..88eafbb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/GD32F10x_usbfs_library/ustd/common/usb_ch9_std.h @@ -0,0 +1,248 @@ +/*! + \file usb_ch9_std.h + \brief USB 2.0 standard defines + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __USB_CH9_STD_H +#define __USB_CH9_STD_H + +#include "usb_conf.h" + +#define USB_DEV_QUALIFIER_DESC_LEN 0x0AU /*!< USB device qualifier descriptor length */ +#define USB_DEV_DESC_LEN 0x12U /*!< USB device descriptor length */ +#define USB_CFG_DESC_LEN 0x09U /*!< USB configuration descriptor length */ +#define USB_ITF_DESC_LEN 0x09U /*!< USB interface descriptor length */ +#define USB_EP_DESC_LEN 0x07U /*!< USB endpoint descriptor length */ +#define USB_IAD_DESC_LEN 0x08U /*!< USB IAD descriptor length */ +#define USB_OTG_DESC_LEN 0x03U /*!< USB device OTG descriptor length */ + +#define USB_SETUP_PACKET_LEN 0x08U /*!< USB setup packet length */ + +/* bit 7 of bmRequestType: data phase transfer direction */ +#define USB_TRX_MASK 0x80U /*!< USB transfer direction mask */ +#define USB_TRX_OUT 0x00U /*!< USB transfer OUT direction */ +#define USB_TRX_IN 0x80U /*!< USB transfer IN direction */ + +/* bit 6..5 of bmRequestType: request type */ +#define USB_REQTYPE_STRD 0x00U /*!< USB standard request */ +#define USB_REQTYPE_CLASS 0x20U /*!< USB class request */ +#define USB_REQTYPE_VENDOR 0x40U /*!< USB vendor request */ +#define USB_REQTYPE_MASK 0x60U /*!< USB request mask */ + +#define USBD_BUS_POWERED 0x00U /*!< USB bus power supply */ +#define USBD_SELF_POWERED 0x01U /*!< USB self power supply */ + +#define USB_STATUS_REMOTE_WAKEUP 2U /*!< USB is in remote wakeup status */ +#define USB_STATUS_SELF_POWERED 1U /*!< USB is in self powered status */ + +/* bit 4..0 of bmRequestType: recipient type */ +enum _usb_recp_type { + USB_RECPTYPE_DEV = 0x0U, /*!< USB device request type */ + USB_RECPTYPE_ITF = 0x1U, /*!< USB interface request type */ + USB_RECPTYPE_EP = 0x2U, /*!< USB endpoint request type */ + USB_RECPTYPE_MASK = 0x3U /*!< USB request type mask */ +}; + +/* bRequest value */ +enum _usb_request { + USB_GET_STATUS = 0x0U, /*!< USB get status request */ + USB_CLEAR_FEATURE = 0x1U, /*!< USB clear feature request */ + USB_RESERVED2 = 0x2U, + USB_SET_FEATURE = 0x3U, /*!< USB set feature request */ + USB_RESERVED4 = 0x4U, + USB_SET_ADDRESS = 0x5U, /*!< USB set address request */ + USB_GET_DESCRIPTOR = 0x6U, /*!< USB get descriptor request */ + USB_SET_DESCRIPTOR = 0x7U, /*!< USB set descriptor request */ + USB_GET_CONFIGURATION = 0x8U, /*!< USB get configuration request */ + USB_SET_CONFIGURATION = 0x9U, /*!< USB set configuration request */ + USB_GET_INTERFACE = 0xAU, /*!< USB get interface request */ + USB_SET_INTERFACE = 0xBU, /*!< USB set interface request */ + USB_SYNCH_FRAME = 0xCU /*!< USB synchronize frame request */ +}; + +/* descriptor types of USB specifications */ +enum _usb_desctype { + USB_DESCTYPE_DEV = 0x1U, /*!< USB device descriptor type */ + USB_DESCTYPE_CONFIG = 0x2U, /*!< USB configuration descriptor type */ + USB_DESCTYPE_STR = 0x3U, /*!< USB string descriptor type */ + USB_DESCTYPE_ITF = 0x4U, /*!< USB interface descriptor type */ + USB_DESCTYPE_EP = 0x5U, /*!< USB endpoint descriptor type */ + USB_DESCTYPE_DEV_QUALIFIER = 0x6U, /*!< USB device qualifier descriptor type */ + USB_DESCTYPE_OTHER_SPD_CONFIG = 0x7U, /*!< USB other speed configuration descriptor type */ + USB_DESCTYPE_ITF_POWER = 0x8U, /*!< USB interface power descriptor type */ + USB_DESCTYPE_IAD = 0xBU, /*!< USB interface association descriptor type */ + USB_DESCTYPE_BOS = 0xFU /*!< USB BOS descriptor type */ +}; + +/* USB Endpoint Descriptor bmAttributes bit definitions */ +/* bits 1..0 : transfer type */ +enum _usbx_type { + USB_EP_ATTR_CTL = 0x0U, /*!< USB control transfer type */ + USB_EP_ATTR_ISO = 0x1U, /*!< USB Isochronous transfer type */ + USB_EP_ATTR_BULK = 0x2U, /*!< USB Bulk transfer type */ + USB_EP_ATTR_INT = 0x3U /*!< USB Interrupt transfer type */ +}; + +/* bits 3..2 : Sync type (only if ISOCHRONOUS) */ +#define USB_EP_ATTR_NOSYNC 0x00U /*!< No Synchronization */ +#define USB_EP_ATTR_ASYNC 0x04U /*!< asynchronous */ +#define USB_EP_ATTR_ADAPTIVE 0x08U /*!< adaptive */ +#define USB_EP_ATTR_SYNC 0x0CU /*!< synchronous */ +#define USB_EP_ATTR_SYNCTYPE 0x0CU /*!< synchronous type */ + +/* bits 5..4 : usage type (only if ISOCHRONOUS) */ +#define USB_EP_ATTR_DATA 0x00U /*!< data endpoint */ +#define USB_EP_ATTR_FEEDBACK 0x10U /*!< feedback endpoint */ +#define USB_EP_ATTR_IMPLICIT_FEEDBACK_DATA 0x20U /*!< implicit feedback Data endpoint */ +#define USB_EP_ATTR_USAGETYPE 0x30U /*!< usage type */ + +/* endpoint max packet size bits12..11 */ +#define USB_EP_MPS_ADD_0 (0x00 << 11) /*!< None(1 transaction per microframe */ +#define USB_EP_MPS_ADD_1 (0x01 << 11) /*!< 1 additional(2 transaction per microframe */ +#define USB_EP_MPS_ADD_2 (0x02 << 11) /*!< 2 additional(3 transaction per microframe */ + +#define FEATURE_SELECTOR_EP 0x00U /*!< USB endpoint feature selector */ +#define FEATURE_SELECTOR_DEV 0x01U /*!< USB device feature selector */ +#define FEATURE_SELECTOR_REMOTEWAKEUP 0x01U /*!< USB feature selector remote wakeup */ + +#define BYTE_SWAP(addr) (((uint16_t)(*((uint8_t *)(addr)))) + \ + (uint16_t)(((uint16_t)(*(((uint8_t *)(addr)) + 1U))) << 8U)) + +#define BYTE_LOW(x) ((uint8_t)((x) & 0x00FFU)) +#define BYTE_HIGH(x) ((uint8_t)(((x) & 0xFF00U) >> 8U)) + +#define USB_MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#define USB_DEFAULT_CONFIG 0U + +/* USB classes */ +#define USB_CLASS_HID 0x03U /*!< USB HID class */ +#define USB_CLASS_MSC 0x08U /*!< USB MSC class */ + +/* use the following values when USB host need to get descriptor */ +#define USBH_DESC(x) (((x)<< 8U) & 0xFF00U) + +/* as per USB specs 9.2.6.4 :standard request with data request timeout: 5sec + standard request with no data stage timeout : 50ms */ +#define DATA_STAGE_TIMEOUT 5000U /*!< USB data stage timeout*/ +#define NODATA_STAGE_TIMEOUT 50U /*!< USB no data stage timeout*/ + +#pragma pack(1) + +/* USB standard device request structure */ +typedef struct _usb_req { + uint8_t bmRequestType; /*!< type of request */ + uint8_t bRequest; /*!< request of setup packet */ + uint16_t wValue; /*!< value of setup packet */ + uint16_t wIndex; /*!< index of setup packet */ + uint16_t wLength; /*!< length of setup packet */ +} usb_req; + +/* USB setup packet define */ +typedef union _usb_setup { + uint8_t data[8]; + + usb_req req; +} usb_setup; + +/* USB descriptor defines */ + +typedef struct _usb_desc_header { + uint8_t bLength; /*!< size of the descriptor */ + uint8_t bDescriptorType; /*!< type of the descriptor */ +} usb_desc_header; + +typedef struct _usb_desc_dev { + usb_desc_header header; /*!< descriptor header, including type and size */ + + uint16_t bcdUSB; /*!< BCD of the supported USB specification */ + uint8_t bDeviceClass; /*!< USB device class */ + uint8_t bDeviceSubClass; /*!< USB device subclass */ + uint8_t bDeviceProtocol; /*!< USB device protocol */ + uint8_t bMaxPacketSize0; /*!< size of the control (address 0) endpoint's bank in bytes */ + uint16_t idVendor; /*!< vendor ID for the USB product */ + uint16_t idProduct; /*!< unique product ID for the USB product */ + uint16_t bcdDevice; /*!< product release (version) number */ + uint8_t iManufacturer; /*!< string index for the manufacturer's name */ + uint8_t iProduct; /*!< string index for the product name/details */ + uint8_t iSerialNumber; /*!< string index for the product's globally unique hexadecimal serial number */ + uint8_t bNumberConfigurations; /*!< total number of configurations supported by the device */ +} usb_desc_dev; + +typedef struct _usb_desc_config { + usb_desc_header header; /*!< descriptor header, including type and size */ + + uint16_t wTotalLength; /*!< size of the configuration descriptor header,and all sub descriptors inside the configuration */ + uint8_t bNumInterfaces; /*!< total number of interfaces in the configuration */ + uint8_t bConfigurationValue; /*!< configuration index of the current configuration */ + uint8_t iConfiguration; /*!< index of a string descriptor describing the configuration */ + uint8_t bmAttributes; /*!< configuration attributes */ + uint8_t bMaxPower; /*!< maximum power consumption of the device while in the current configuration */ +} usb_desc_config; + +typedef struct _usb_desc_itf { + usb_desc_header header; /*!< descriptor header, including type and size */ + + uint8_t bInterfaceNumber; /*!< index of the interface in the current configuration */ + uint8_t bAlternateSetting; /*!< alternate setting for the interface number */ + uint8_t bNumEndpoints; /*!< total number of endpoints in the interface */ + uint8_t bInterfaceClass; /*!< interface class ID */ + uint8_t bInterfaceSubClass; /*!< interface subclass ID */ + uint8_t bInterfaceProtocol; /*!< interface protocol ID */ + uint8_t iInterface; /*!< index of the string descriptor describing the interface */ +} usb_desc_itf; + +typedef struct _usb_desc_ep { + usb_desc_header header; /*!< descriptor header, including type and size. */ + + uint8_t bEndpointAddress; /*!< logical address of the endpoint */ + uint8_t bmAttributes; /*!< endpoint attributes */ + uint16_t wMaxPacketSize; /*!< size of the endpoint bank, in bytes */ + uint8_t bInterval; /*!< polling interval in milliseconds for the endpoint if it is an INTERRUPT or ISOCHRONOUS type */ +} usb_desc_ep; + +typedef struct _usb_desc_LANGID { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint16_t wLANGID; /*!< LANGID code */ +} usb_desc_LANGID; + +typedef struct _usb_desc_str { + usb_desc_header header; /*!< descriptor header, including type and size. */ + uint16_t unicode_string[64]; /*!< unicode string data */ +} usb_desc_str; + +#pragma pack() + +/* compute string descriptor length */ +#define USB_STRING_LEN(unicode_chars) (sizeof(usb_desc_header) + ((unicode_chars) << 1U)) + +#endif /* __USB_CH9_STD_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.c new file mode 100644 index 0000000..37e3b7c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.c @@ -0,0 +1,463 @@ +#include "24cxx.h" +#include "bsp_i2c_gpio.h" +#include "led.h" + +//ʼIIC +void ee_Init(void) +{ + bsp_InitI2C(); + +} +//AT24CXXַָȡһ +//ReadAddr :ʼĵַ +//ֵ ȡ +u8 ee_ReadOneByte(u16 ReadAddr) +{ + u8 temp = 0; + IIC_Start(); + + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR);//д + IIC_Wait_Ack(); + IIC_Send_Byte(ReadAddr / 256); //͸ߵַ + } else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR + ((ReadAddr / 256) << 1)); //ַ0xA0,д + + IIC_Wait_Ack(); + IIC_Send_Byte(ReadAddr % 256); //͵͵ַ + IIC_Wait_Ack(); + IIC_Start(); + + if (1)IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_RD); //ģʽ + else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_RD + ((ReadAddr / 256) << 1)); //ģʽ + + IIC_Wait_Ack(); + temp = IIC_Read_Byte(1); + IIC_Stop();//һֹͣ + return temp; +} + +//AT24CXXַָдһ +//WriteAddr:дݵĿĵַ +//data :Ҫд +void ee_WriteOneByte(u16 WriteAddr, u8 data) +{ + IIC_Start(); + + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR); + IIC_Wait_Ack(); + IIC_Send_Byte(WriteAddr / 256); //͸ߵַ + } else IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR + ((WriteAddr / 256) << 1)); + + IIC_Wait_Ack(); + IIC_Send_Byte(WriteAddr % 256); //͵͵ַ + IIC_Wait_Ack(); + IIC_Send_Byte(data); + IIC_Wait_Ack(); + IIC_Stop();//һֹͣ + Delay_MS(6); +} +#if 1 +//EEPROMдֽ +uint8_t ee_WriteBytes(uint8_t *_pWriteBuf, uint16_t _usAddress, uint16_t _usSize) +{ + uint16_t i, m; + uint16_t addr; + addr = _usAddress; + + for (i = 0; i < _usSize; i++) { + //һλߵַ뵽8Ҫ·ʼźźEEPROMַ + //Ϊ˽8ַ + if (i == 0 || (addr % EE_PAGE_SIZE) == 0) { + if (i != 0) { + IIC_Stop(); + Delay_MS(6); + } + //ʼַ + IIC_Start(); + + //豸дַ + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR|EEPROM_I2C_WR); + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + IIC_Send_Byte(addr / 256); //͸ߵַ + } else IIC_Send_Byte((EE_DEV_ADDR + ((addr / 256) << 1)) | EEPROM_I2C_WR); + + //ȴӻӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + //EEPROMӦEEPROMڲ洢ַ + IIC_Send_Byte((uint8_t)addr); + + //ȴӻӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + } + + // + IIC_Send_Byte(_pWriteBuf[i]); + + //ȴӦ + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + //дַ1 + addr++; + } + + IIC_Stop(); + return 1; + +cmd_fail: + IIC_Stop(); + return 0; +} + + +uint8_t ee_ReadBytes(uint8_t *_pReadBuf, uint16_t _usAddress, uint16_t _usSize) +{ + uint16_t i; + + //ʼַ + IIC_Start(); + + //豸дַ + if (EE_TYPE > AT24C16) { + IIC_Send_Byte(EE_DEV_ADDR); + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + IIC_Send_Byte(_usAddress / 256); //͸ߵַ + } else IIC_Send_Byte((EE_DEV_ADDR + ((_usAddress / 256) << 1)) | EEPROM_I2C_WR); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + IIC_Send_Byte((uint8_t)_usAddress); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + IIC_Start(); + if (EE_TYPE > AT24C16) IIC_Send_Byte(EE_DEV_ADDR | EEPROM_I2C_RD); + else IIC_Send_Byte((EE_DEV_ADDR + ((_usAddress / 256) << 1)) | EEPROM_I2C_RD); + + if (IIC_Wait_Ack() != 0) { + goto cmd_fail; + } + + for (i = 0; i < _usSize; i++) { + /* ÿ1ֽںҪAck һֽڲҪAckNack */ + _pReadBuf[i] = IIC_Read_Byte(i != _usSize - 1?1:0); + } + + IIC_Stop(); + return 1; + +cmd_fail: + IIC_Stop(); + return 0; +} +#endif +#if 0 +static void IIC1_Start(void); //ʼź +static void IIC1_Stop(void); //ֹͣź +static void IIC1_Write_Byte(u8 dat);//һֽ +static u8 IIC1_Read_Byte(unsigned char ack);//һֽ +static u8 IIC1_Wait_Ack(void);//ȴACKź +static void IIC1_Ack(void);//ACKź +static void IIC1_NAck(void);//ACKź + +void I2C_delay(uint16_t n) +{ + u8 i = 100 * n; //Żٶ ͵5д + + while (i) { + i--; + } +} + +//ʼIIC +void AT24cxx_init(void) +{ + GPIO_InitTypeDef GPIO_InitStructure; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); /* GPIOʱ */ + + + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11; //SDA,SCL + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_Init(GPIOB, &GPIO_InitStructure); + IIC_SDA1; + IIC_SCL1; + +} + +//AT24CXXַָȡһ +//ReadAddr :ʼĵַ +//ֵ ȡ +u8 AT24cxx_ReadOneByte(u16 ReadAddr) +{ + u8 temp = 0; + IIC1_Start(); + + if (EE_TYPE > AT24C16) { + IIC1_Write_Byte(0xa0);//д + IIC1_Wait_Ack(); + IIC1_Write_Byte(ReadAddr / 256); //͸ߵַ + } else IIC1_Write_Byte(0xa0 + ((ReadAddr / 256) << 1)); //ַ0xA0,д + + IIC1_Wait_Ack(); + IIC1_Write_Byte(ReadAddr % 256); //͵͵ַ + IIC1_Wait_Ack(); + IIC1_Start(); + + if (EE_TYPE > AT24C16)IIC1_Write_Byte(0xa1); //ģʽ + else IIC1_Write_Byte(0xa1 + ((ReadAddr / 256) << 1)); //ģʽ + + IIC1_Wait_Ack(); + temp = IIC1_Read_Byte(1); + IIC1_Stop();//һֹͣ + return temp; +} +//AT24CXXַָдһ +//WriteAddr:дݵĿĵַ +//data :Ҫд +void AT24cxx_WriteOneByte(u16 WriteAddr, u8 data) +{ + IIC1_Start(); + + if (EE_TYPE > AT24C16) { + IIC1_Write_Byte(0xa0); + IIC1_Wait_Ack(); + IIC1_Write_Byte(WriteAddr / 256); //͸ߵַ + } else IIC1_Write_Byte(0xa0 + ((WriteAddr / 256) << 1)); + + IIC1_Wait_Ack(); + IIC1_Write_Byte(WriteAddr % 256); //͵͵ַ + IIC1_Wait_Ack(); + IIC1_Write_Byte(data); + IIC1_Wait_Ack(); + IIC1_Stop();//һֹͣ + I2C_delay(2); +} +//AT24CXXַָʼдָȵ +//úд16λ32λ +//WriteAddr:ʼдĵַ +//data :Ҫд +//len :Ҫдݵij24 +void AT24cxx_WriteLenByte(u16 WriteAddr, u32 data, u8 len) +{ + u8 i; + + for (i = 0; i < len; i++) { + AT24cxx_WriteOneByte(WriteAddr + i, (data >> (8 * i)) & 0xff); + } +} +//AT24CXXַָʼָȵ +//úڶ16bit32bit. +//ReadAddr :ʼĵַ +//ֵ : +//len :Ҫݵij2,4 +u32 AT24cxx_ReadLenByte(u16 ReadAddr, u8 len) +{ + u8 i; + u32 temp = 0; + + for (i = 0; i < len; i++) { + temp <<= 8; + temp += AT24cxx_ReadOneByte(ReadAddr + len - i - 1); + } + + return temp; +} + +//AT24CXXַָʼдָȵ +//úдָֽ +//WriteAddr:ʼдĵַ +//buf :׵ַ +//len :Ҫдݵĸ +void AT24cxx_Write(u16 WriteAddr, u8 *buf, u16 len) +{ + u16 i; + + for (i = 0; i < len; i++) { + IWDG_Feed(); + AT24cxx_WriteOneByte(WriteAddr, *buf); + WriteAddr++; + buf++; + } +} +//AT24CXXַָʼָȵ +//úڶָֽ +//ReadAddr:ʼݵĵַ +//len :Ҫдݵĸ +//buf :׵ַ +void AT24cxx_Read(u16 ReadAddr, u8 *buf, u16 len) +{ + while (len--) { + IWDG_Feed(); + *buf++ = AT24cxx_ReadOneByte(ReadAddr++); + } +} +//AT24CXXǷ +//24XXĵһַ(0)洢־. +//1ʧ +//0ɹ +u8 AT24cxx_Check(void) +{ + u8 temp1, temp2; + AT24cxx_WriteOneByte(0x010, 0x55); + temp1 = AT24cxx_ReadOneByte(0x010); //ÿοдAT24CXX + temp2 = temp1; + + if (temp2 == 0x55)return 0; + else { + AT24cxx_WriteOneByte(0x010, 0x55); + temp1 = AT24cxx_ReadOneByte(0x010); + temp2 = temp1; + + if (temp2 == 0x55)return 0; + } + + return 1; +} + +//IICʼź +static void IIC1_Start(void) +{ + + IIC_SDA1; + IIC_SCL1; + I2C_delay(4); + IIC_SDA0; + I2C_delay(4); + IIC_SCL0; + I2C_delay(4); +} +//IICֹͣź +static void IIC1_Stop(void) +{ + IIC_SDA0; + IIC_SCL1; + I2C_delay(2); + IIC_SDA1; + I2C_delay(4); +// IIC_SCL0; +} +//1Ӧʧܣ0Ӧɹ +static u8 IIC1_Wait_Ack(void) +{ + u8 i; + SDA_IN(); + IIC_SCL0; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + + while (Read_IIC_SDA()) { + i++; + + if (i > 250) { + + IIC1_Stop(); + return 1; + } + } + + IIC_SCL0; + I2C_delay(2); + return 0; +} +//ACKӦ +static void IIC1_Ack(void) +{ + IIC_SCL0; + SDA_OUT(); + IIC_SDA0; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + IIC_SCL0; +} +//ACKӦ +static void IIC1_NAck(void) +{ + IIC_SCL0; + SDA_OUT(); + IIC_SDA1; + I2C_delay(2); + IIC_SCL1; + I2C_delay(2); + IIC_SCL0; +} +//IICһֽ +//شӻӦ +//0Ӧ +//1Ӧ +void IIC1_Write_Byte(u8 dat) +{ + u8 t; + SDA_OUT(); + I2C_delay(2); + + for (t = 0; t < 8; t++) { + IIC_SCL0; + + if (dat & 0x80) { + IIC_SDA1; + } else { + IIC_SDA0; + } + + I2C_delay(2); + IIC_SCL1; + dat <<= 1; + I2C_delay(2); + + } + + IIC_SCL0; + I2C_delay(2); +} +//1ֽڣack=0ʱACK,ack=1NACK +u8 IIC1_Read_Byte(unsigned char ack) +{ + u8 i, receive; + SDA_IN();//SDAΪ + IIC_SDA0; + I2C_delay(2); + + for (i = 0; i < 8; i++) { + IIC_SCL0; + I2C_delay(2); + IIC_SCL1; + receive <<= 1; + I2C_delay(2); + + if (Read_IIC_SDA())receive++; + + I2C_delay(2); + } + + IIC_SDA1; + I2C_delay(2); + IIC_SCL0; + I2C_delay(2); + + if (!ack) + IIC1_Ack(); + else + IIC1_NAck(); + + return receive; +} +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.h new file mode 100644 index 0000000..093b790 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/24C0X/24cxx.h @@ -0,0 +1,95 @@ +#ifndef __24CXX_H +#define __24CXX_H + +#include +#include "stm32f10x.h" +#define AT24C01 127 +#define AT24C02 255 +#define AT24C04 511 +#define AT24C08 1023 +#define AT24C16 2047 +#define AT24C32 4095 +#define AT24C64 8191 +#define AT24C128 16383 +#define AT24C256 32767 + +#define EE_TYPE AT24C32 //ʹõAT24C16 +#define EE_DEV_ADDR 0xA0 + +#if EE_TYPE == AT24C01 + #define EE_PAGE_SIZE 8 //ֽ/ҳ + #define EE_SIZE 0x007F //eeprom +#elif EE_TYPE == AT24C02 + #define EE_PAGE_SIZE 16 + #define EE_SIZE 0x00FF +#elif EE_TYPE == AT24C04 + #define EE_PAGE_SIZE 16 + #define EE_SIZE 0x01FF +#elif EE_TYPE == AT24C08 + #define EE_PAGE_SIZE 16 + #define EE_SIZE 0x03FF +#elif EE_TYPE == AT24C16 + #define EE_PAGE_SIZE 16 + #define EE_SIZE 0x07FF +#elif EE_TYPE == AT24C32 + #define EE_PAGE_SIZE 32 + #define EE_SIZE 0x0FFF +#elif EE_TYPE == AT24C64 + #define EE_PAGE_SIZE 32 + #define EE_SIZE 0x1FFF +#elif EE_TYPE == AT24C128 + #define EE_PAGE_SIZE 64 + #define EE_SIZE 0x3FFF +#elif EE_TYPE == AT24C256 + #define EE_PAGE_SIZE 64 + #define EE_SIZE 0x7FFF +#elif EE_TYPE == AT24C512 + #define EE_PAGE_SIZE 128 + #define EE_SIZE 0xFFFF +#endif + +#define EEPROM_I2C_WR 0 /* дbit */ +#define EEPROM_I2C_RD 1 /* bit */ + +// void AT24cxx_init(void);//ԻIIC +// u8 AT24cxx_ReadOneByte(u16 ReadAddr);//ַָȡһֽ +// void AT24cxx_WriteOneByte(u16 WriteAddr,u8 data);//ַָдһ +// void AT24cxx_WriteLenByte(u16 WriteAddr,u32 data,u8 len);//ַָʼдָȵ +// u32 AT24cxx_ReadLenByte(u16 ReadAddr,u8 len);//ַָʼָȵ +// void AT24cxx_Write(u16 WriteAddr,u8 *buf,u16 len);//ַָʼдָȵ +// void AT24cxx_Read(u16 ReadAddr,u8 *buf,u16 len);//ַָʼָȵ +// u8 AT24cxx_Check(void);// + +void ee_Init(void); +u8 ee_ReadOneByte(u16 ReadAddr); +void ee_WriteOneByte(u16 WriteAddr, u8 data); +uint8_t ee_WriteBytes(uint8_t *_pWriteBuf, uint16_t _usAddress, uint16_t _usSize); +uint8_t ee_ReadBytes(uint8_t *_pReadBuf, uint16_t _usAddress, uint16_t _usSize); +/* I2CӵGPIO˿, ûֻҪ޸4д뼴ıSCLSDA */ + +//IO +#define SDA_IN() //{GPIOB->ODR&=0XFFFF3FFF;GPIOB->ODR|=GPIO_Mode_IN<<14;}//sda +#define SDA_OUT() //{GPIOB->ODR&=0XFFFF3FFF;GPIOB->ODR|=GPIO_Mode_OUT<<14;}//sda + + +//IO +// #define IIC_SDA0 GPIOB->BRR=GPIO_Pin_11;//sda=0 +// #define IIC_SDA1 GPIOB->BSRR=GPIO_Pin_11;//sda=1 +// #define IIC_SCL0 GPIOB->BRR=GPIO_Pin_10; +// #define IIC_SCL1 GPIOB->BSRR=GPIO_Pin_10; + + + + +// #define Read_IIC_SDA() ((GPIOB->IDR&GPIO_Pin_11)!=0)?1:0 //жϽյλ +//IICв +// void IIC_Init(void);// ʼiicIO +//void IIC_Start(void); //ʼź +//void IIC_Stop(void); //ֹͣź +//void IIC_Write_Byte(u8 dat);//һֽ +//u8 IIC_Read_Byte(unsigned char ack);//һֽ +//u8 IIC_Wait_Ack(void);//ȴACKź +//void IIC_Ack(void);//ACKź +//void IIC_NAck(void);//ACKź + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.c new file mode 100644 index 0000000..e6e6751 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.h new file mode 100644 index 0000000..8b79db2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADC/adc.h @@ -0,0 +1,28 @@ +#ifndef __ADC_H +#define __ADC_H + + +#include "stm32f10x.h" +void ADC1_Init(void); +typedef struct +{ + int16_t TemperatureValue; + float R_Value; +}TempRes_TypeDef; + +int16_t FindTemperature(float r_value); +//ADC1ݽṹ +typedef struct +{ + float BAT_Voltage; //Aǹصѹ + float BAT_B_Reverse_Voltage; //Bǹӵѹ + + float Tempreture[3]; + float VIN_Input_Voltage; //Bǹӵѹ +}Sample_Data_t; +extern void BMS_Temperatrue_Sampling(void); +extern void VIN_Input_Sampling(void); +extern Sample_Data_t Sample_DataS; +void Gun_Input_Sampling(void); +#endif /* __ADC_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.c new file mode 100644 index 0000000..392c9df Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.h new file mode 100644 index 0000000..0419179 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/ADS1015/ads1015.h @@ -0,0 +1,60 @@ + +#ifndef _ADS1015_H_ +#define _ADS1015_H_ + #include "stm32f10x.h" + +#define ADS1015_IIC_SCL_ GPIO_Pin_6 +#define ADS1015_IIC_SDA_ GPIO_Pin_7 + + +/*************************************************************************************** +*??:??????????????,?????????????????(???????) +* ??????????????,???????????????????? +****************************************************************************************/ +#define SDA_A1 PBout(7)=1 //SDA?? +#define SDA_A0 PBout(7)=0 +#define SCL_A1 PBout(6)=1 //SCL +#define SCL_A0 PBout(6)=0 +#define SDA_AI PBin(7) //SDA?? + +//I2C +#define WR_REG 0x90 //???? +#define RE_REG 0x91 //???? + +/***********************************??????**********************************************/ +#define DATA_REG 0x00 //??????? +#define CONF_REG 0x01 //???????? +#define LOTH_REG 0x02 //??????? +#define HITH_REG 0x03 //??????? + +#define ch0 0xc0 //??0 +#define ch1 0xd0 //??1 +#define ch2 0xe0 //??2 +#define ch3 0xf0 //??3 + +/***********************?????************************************************************* +*| OS | MUX2 | MUX1 | MUX0 | PGA2 | PGA1 | PGA0 | MODE |------HCMD +*| DR2| DR1 | DR0 | COMP_MODE | COMP_POL | COMP_LAT | COMP_QUE1 | COMP_QUE0 |-----LCMD +***********************************************************************************************/ +#define HCMD1 0x64 //AIN0???? +-4.096?? ???? 01000100b +#define LCMD1 0xf0 //860sps ??????? ????? ??????? ??????? 11110000b + +/************************????****************************/ +static void ADS1115_delay(u16 D); +void delay_nms(u16 ms); +void delay_nus(u16 us); +void ADS1115_Init(void); +void I2CStart_A(void); +void I2CStop_A(void); +void I2CWriteByte_A(u8 DATA); +u8 I2CReadByte_A(void); +void ADS1115Config_A(u8 LCMD,u8 HCMD); +void SetThresHold_A(u16 L_TH,u16 H_TH); //?????? +u16 ReadAD_A(void); +u16 getad(u8 LCMD,u8 HCMD); +u16 lvbo(u8 LCMD,u8 HCMD); + +float GetSampleVolt(u8 key); + + + #endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.c new file mode 100644 index 0000000..8c1660f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.c @@ -0,0 +1,324 @@ +/*********************************************************************** +* @file name: canbusdrv.c +* @create date: 2022-11-12 +* @author +* @version: V 1.0.0 +* @remark: + ģcanͳһMCUӿڵIJͬһͳһĽӿ + MCUĸ漰 +************************************************************************/ +#include +#include +#include "canbusdrv.h" +#include "candrvctrl.h" + +/** + * ģcanͳһMCUӿڵIJͬһͳһĽӿ + * MCUĸ漰 + */ +/** + * ģͳһɣߵжշ쳣 + */ + +static st_cancb tpcb[2]; + +/***************************************************************************************** + * can շͶеĴ + *****************************************************************************************/ + + +typedef struct{ + bsp_can_cfg_t bsp_cfg; /* can */ + unsigned int open_flg; /* 򿪱־ 0 - ر 1- 2-Ѵ*/ + unsigned int sending; /* ڷ͵flag */ + can_frame_t tmp_frame; /* ʱ */ +}can_bus_t; + + +static can_bus_t canbus[BSP_CAN_CHANNEL_NUM]={0}; + + +static __inline void can_bus_ready_hook(unsigned char channel) +{ + if (channel >= BSP_CAN_CHANNEL_NUM) { + return; + } +} + + +/** + * @brief: յϢHOOK + * + * @param channel: ͨ + * @param pt_fram[IN]: յϢ + * + * @return: + */ +void bsp_can_msg_receive_hook(unsigned char channel, const can_frame_t * pt_fram) +{ + + if (channel >= BSP_CAN_CHANNEL_NUM) + { + return; + } + if(tpcb[channel].hdlFrmReceve != NULL) + { + tpcb[channel].hdlFrmReceve(channel,(pt_fram->IDE == CAN_ID_EXT)?pt_fram->ExtId:pt_fram->StdId, pt_fram->Data, pt_fram->DLC); + } + can_bus_ready_hook(channel); +} + + +/** + * @brief: Ϣɵhook + * + * @param channel: ͨ + * @param fifo_id: ϢյID + * @param success: true ͳɹ false ʧ + * + * @return: void + * + * @remark: FIFOյhook + */ +void bsp_can_msg_sent_hook(unsigned char channel, unsigned char fifo_id, bool success) +{ + unsigned char ret_id; + + if (channel >= BSP_CAN_CHANNEL_NUM) + { + return; + } + + /* жǷڷ */ + if (canbus[channel].sending&(0x00000001<= BSP_CAN_CHANNEL_NUM) { + return; + } + + SYS_ENTER_CRITICAL(); + if(tpcb[channel].BusOffCb != NULL) + { + tpcb[channel].BusOffCb(channel); + } + SYS_EXIT_CRITICAL(); + if (canbus[channel].sending > 0) + { + /* ˵зʧܵģԷʧܵĺ */ + canbus[channel].sending = 0; + } +} + + +/** + * @brief: лӦ״̬hook + * + * @param channel: can ͨ, + * + * @return: void + * + * @remark: ӦлδӦʱһ + */ +void can_bus_err_passive_hook(unsigned char channel) +{ + if (channel >= BSP_CAN_CHANNEL_NUM) { + return; + } + + if(tpcb[channel].BusErrorStsCb != NULL) + { + tpcb[channel].BusErrorStsCb(channel, canbus[channel].sending > 0?true:false); + } +} + + + +/** + * @brief: 첽ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return Ƿɹ + * true: ɹ false: ʧ + */ +bool can_bus_send(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len) +{ + can_frame_t tmp; + + if (chan >= BSP_CAN_CHANNEL_NUM) + { + return false; + } + + CAN_FRAME_INIT(&tmp, canid, data, len); + + + bsp_can_msg_sent_hook(chan, 0, true); + + + return true; +} + + + +/** + * @brief: ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return رʶţ0xFF ʶʧ + */ +unsigned char can_bus_send_rt(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len) +{ + unsigned char ret_id; + + if (chan >= BSP_CAN_CHANNEL_NUM || canbus[chan].open_flg != 2) + { + return false; + } + + CAN_FRAME_INIT(&canbus[chan].tmp_frame, canid, data, len); + + ret_id = bsp_can_msg_send(chan, &canbus[chan].tmp_frame); + + if (ret_id != 0xFF) + { + canbus[chan].sending |= (0x00000001<= BSP_CAN_CHANNEL_NUM) + { + return false; + } + + canbus[chan].open_flg = 1; + canbus[chan].bsp_cfg.abom = false; + canbus[chan].bsp_cfg.sleep = listen; + canbus[chan].bsp_cfg.domain_h = highdomain; + canbus[chan].bsp_cfg.krate = krate; + + canbus[chan].sending = 0; + if (bsp_can_open(chan, &canbus[chan].bsp_cfg)) + { + canbus[chan].open_flg = 2; + } + else + { + canbus[chan].open_flg = 0; + } + return canbus[chan].open_flg == 2; +} + + +/** + * @brief: رսӿ + * + * @return: + * ؽ: true - open ɹ false - open ʧ + */ +bool can_bus_close(unsigned char channel) +{ + canbus[channel].open_flg = 0; + bsp_can_close(channel); +} + + + +static const st_canif tpchan[] = +{ + { + 0, //chan1 + can_bus_open, //ConfigCan + can_bus_send_rt, //canSend + can_bus_close, //canClose + NULL, //canHwPowerDown + NULL, //canHwPowerUp + NULL, //canBusFilterInit + NULL, //canCloseFilter + }, + + { + 1, //chan2 + can_bus_open, //ConfigCan + can_bus_send_rt, //canSend + can_bus_close, //canClose + NULL, //canHwPowerDown + NULL, //canHwPowerUp + NULL, //canBusFilterInit + NULL, //canCloseFilter + }, +}; + + + +void InitCanifToCanDrvCtrl(void) +{ + st_cancb *pcb; + + memset(&canbus[0], 0x00, sizeof(canbus)); + memset(&tpcb[0], 0x00, sizeof(tpcb)); + + pcb = RegisterCanIF(&tpchan[0]); + if(pcb!=NULL) + memcpy(&tpcb[0],pcb,sizeof(st_cancb)); /* ±Ҫst_canif.chan һ */ + + pcb = RegisterCanIF(&tpchan[1]); + if(pcb!=NULL) + memcpy(&tpcb[1],pcb,sizeof(st_cancb)); /* ±Ҫst_canif.chan һ */ +} + + + +//#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.h new file mode 100644 index 0000000..9f50c1e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanBusDrv.h @@ -0,0 +1,267 @@ +/*********************************************************************** +* @file name: canbusdrv.h +* @create date: 2022-11-12 +* @author +* @version: V 1.0.0 +* @remark: + MCU canӿ֮Ľӿ +************************************************************************/ +#ifndef __CANBUSDRV_H__ +#define __CANBUSDRV_H__ + + +/*************************************************************************** + * Can Ϣ + **************************************************************************/ + +/* ֵ֧can MCU */ +#define BSP_CAN_CHANNEL_NUM (2) + +/* ݱĵ󳤶 */ +#define BSP_CAN_DATA_LENGTH_MAX (8) + + + +/*************************************************************************** + * ʹõͶ + **************************************************************************/ + +/* MCUصͶ */ +#include "porting.h" +#include "string.h" +/* ͣҶһϢתΪ˽ṹĺ */ +typedef CanTxMsg can_frame_t; + +static __inline void CAN_FRAME_INIT(can_frame_t * pt_frame, unsigned int canid,const unsigned char *data, unsigned char len) +{ + if (pt_frame != NULL) + { + pt_frame->IDE = 0; + pt_frame->StdId = 0; + pt_frame->ExtId = 0; + if (canid >= 0x800) + { + pt_frame->IDE = CAN_ID_EXT; + pt_frame->ExtId = canid; + } + else + { + pt_frame->IDE = CAN_ID_STD; + pt_frame->StdId = canid; + } + + if (len == 0 || data == NULL) + { + pt_frame->DLC = 0; + pt_frame->RTR = CAN_RTR_REMOTE; + } + else + { + pt_frame->RTR = CAN_RTR_DATA; + pt_frame->DLC = len; + memcpy(pt_frame->Data, data, len); + } + } +} + + +#if 0 + +/* can */ +typedef enum { + E_CAN_FRAME_STD_MASK = 0x01, + E_CAN_FRAME_EXT_MASK = 0x02, + E_CAN_FRAME_RTR_MASK = 0x04, +} can_frame_mask_e; + +/* ͳһcanϢ */ +typedef struct { + unsigned int id; + can_frame_mask_e frame_type; + #if BSP_CAN_DATA_LENGTH_MAX > 255 + unsigned short data_len; + #else + unsigned char data_len; + #endif + + unsigned char data[BSP_CAN_DATA_LENGTH_MAX]; +} can_frame_t; + +static __inline void CAN_FRAME_INIT(can_frame_t * pt_frame, unsigned int canid,const unsigned char *data, unsigned char len) +{ + if (pt_frame != NULL) + { + pt_frame->id = canid; + pt_frame->frame_type = 0; + + pt_frame->frame_type |= (canid >= 0x800)?E_CAN_FRAME_EXT_MASK:E_CAN_FRAME_STD_MASK; + if (len ==0 || data == NULL) + { + pt_frame->frame_type |= E_CAN_FRAME_RTR_MASK; + pt_frame->data_len = 0; + } + else + { + pt_frame->data_len = (len>BSP_CAN_DATA_LENGTH_MAX)?BSP_CAN_DATA_LENGTH_MAX:len; + memcpy(pt_frame->data, data, pt_frame->data_len); + } + } +} +#endif + + + + + +/*************************************************************************** + * MCU CAN ӲصĽӿ + **************************************************************************/ +/** + * ײMCU ʵֵĽӿ + */ + +typedef struct { + unsigned short krate; /* can */ + bool listen; /* Ƿģʽ, true false Ǽ */ + bool domain_h; /* Ϊߣǵ, true Ϊߣ false Ϊ */ + bool sleep; /* ˯ģʽ true Ϊߣ false Ϊ */ + bool abom; /* Ƿָ true ΪԶָ false ΪԶָ */ +}bsp_can_cfg_t; + +/** + * @brief: ӿڵϢ + * + * @param channel: can ͨţ MCU_CAN_CHANNEL_NUM + * @param pt_bsp_cfg[IN]: Զ + * + * @return: + * ؽ: true - open ɹ false - open ʧ + */ +bool bsp_can_open(unsigned char channel, const bsp_can_cfg_t * pt_bsp_cfg); + + +/** + * @brief: رսӿ + * + * @return: + * ؽ: true - open ɹ false - open ʧ + */ +bool bsp_can_close(unsigned char channel); + + + +#define BSP_CAN_SEND_FAIL (0xFF) +/** + * @brief: ͽӿ + * + * @param channel: ͨ + * @param pt_fram[IN]: ͵Ϣ + * + * @return: + * ؽ: ͳɹ(䵽Ĵ)FIFO id + * ʧܷ0xFF + */ +unsigned char bsp_can_msg_send(unsigned char channel, const can_frame_t * pt_fram); + + +/** + * @brief: յϢHOOK + * + * @param channel: ͨ + * @param pt_fram[IN]: յϢ + * + * @return: + */ +void bsp_can_msg_receive_hook(unsigned char channel, const can_frame_t * pt_fram); + + +/** + * @brief: Ϣɵhook + * + * @param channel: ͨ + * @param fifo_id: ϢյID + * @param success: true ͳɹ false ʧ + * + * @return: void + * + * @remark: FIFOյhook + */ +void bsp_can_msg_sent_hook(unsigned char channel, unsigned char fifo_id, bool success); + + + +/** + * @brief: PASSIVE hook + * + * @param channel: ͨ + * + * @return: void + */ +void bsp_can_passive_err_hook(unsigned char channel); + + +/** + * @brief: лӦ״̬hook + * + * @param channel: can ͨ, + * + * @return: void + * + * @remark: ӦлδӦʱһ + */ +void can_bus_err_passive_hook(unsigned char channel); + + + + + +/*************************************************************************** + * ӿ + **************************************************************************/ +/** + * @brief: 첽ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return Ƿɹ + * true: ɹ false: ʧ + */ +bool can_bus_send(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len); + +/** + * @brief: ݱ + * + * @param chan: can ͨ + * @param canid: ID + * @param data[IN]: + * @param len: ݳ + * + * @return رʶţ0xFF ʶʧ + */ +unsigned char can_bus_send_rt(unsigned char chan,unsigned int canid,const unsigned char *data, unsigned char len); + + + +/** + * @brief: + * + * @param chan: canͨ + * @param krate: + * @param highdomain: ߵƽź + * @param listen: ǷΪģʽ + * + * @return: + * true: ɹ false ʧ + */ +bool can_bus_open(unsigned char chan,unsigned short krate, bool highdomain, bool listen); + + +/** + * @brief: canйصд + */ +void can_bus_handle(void); +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.c new file mode 100644 index 0000000..1b37cb0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.c @@ -0,0 +1,845 @@ +/*********************************************************************** +* @file name: candrvctrl.c +* @create date: 2022-11-19 +* @author +* @version: V 1.0.0 +* @remark: + ģcanͳһMCUӿڵIJͬһͳһĽӿ + MCUĸ漰 +************************************************************************/ + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// CAN<------> +////////////////////////////////////////////////////////////////////////////////////////////////////// +//canͨidcanϢ֡id֮ͬcanidʾ׳ֻ +// chanʾcanͨ +// frmidʾcanϢ֡id +// +// +//can㽫ҪƵĽӿͨst_cancb * RegisterCanIF(st_canif *if) ӿڴģ +//st_cancb * RegisterCanIF(st_canif *if) 㽫ijӿڵĿȨCanDrvCtrlģ +//st_canif ͳһCanDrvCtrl Ľӿб,ConfigCan ,canSendcanidṩ +//ػصʵʱе +*********************************************************************************************************************/ + +#include "porting.h" +#include "candrvctrl.h" + +#if 0 +#define M_DEBUGF printf +#else +#define M_DEBUGF(...) ; +#endif + +#define MAX_CAN_IF_NUM 2 +#define PROTOCOL_VALID(PL) (PL.prompt[0] !=0) //жǷЭ鰲װijӿڣͨЭ +#define SET_PROTOCOL_INVALID(PL) (PL.prompt[0] =0) + +typedef enum +{ + e_step_send_idle=0, //еȴe_step_send,ͨʱ + e_step_send, //зȻe_step_waitackȴ //ͨϢ + e_step_waitack, //ͨʱ + e_step_resend, //ط,ʱӦ̳쳣ʱ + e_step_fail, //Ѿʧ + e_step_suc, //ͳɹ +}st_sendstep; + + +typedef struct +{ + unsigned int frmid; //canϢid + unsigned char sendindex; + unsigned char datalen; + unsigned char data[8]; + unsigned int msgident; + void(*cb)(unsigned int msgident,unsigned int result); +}st_senditem; +typedef struct +{ + unsigned int frmid; //canϢid + unsigned char datalen; + unsigned char data[8]; +}st_recitem; + + +typedef struct +{ + unsigned char stimes; + st_sendstep step; + st_senditem sending; //ǰڷ͵ + unsigned char waittime; //ȴʱ + unsigned char retrytimes; +}st_sendmsg; + + +typedef struct +{ + st_canif canif; + st_pl pl; + unsigned char linkSts; + st_fifo_t rec; + st_fifo_t send; + unsigned char *prec; + unsigned char *psend; + st_sendmsg smsg; //ǰϢ +}st_if; + +static void hdlIfSendSuccessCb(unsigned char chan,unsigned int index); +static void hdlIfBusErrorCb(unsigned char chan,bool sending); +static void hdlIfBusErrorStsCb(unsigned char chan,bool sending); +static bool hdlIfFrmReceve(unsigned char chan,unsigned int canid,const unsigned char *data,unsigned char len); +static void HdlSendMsgSuccess(st_if* pif,unsigned char index); +static void hdlIfBusOffCb(unsigned char chan); + +static st_if CanIF[MAX_CAN_IF_NUM]; +static st_cancb canifcb ={ + hdlIfSendSuccessCb, + hdlIfBusErrorCb, + hdlIfBusErrorStsCb, + hdlIfBusOffCb, + hdlIfFrmReceve}; + + +static st_if* GetIfFromChanel(unsigned char chan) +{ + unsigned char i; + + for(i=0;(ilinkSts <= e_sts_closed) + { + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + } + else if(pif->linkSts == e_err_sending && sending) + { + M_DEBUGF("[CDCtrl]hdlIfBusErrorStsCb: ⵽߷쳣!\n"); + pif->linkSts = e_err_sending; + can_kill( E_CAN_MSG_SIG,e_err_sending,chan); + } + else if(pif->linkSts != e_err_sending && sending == false) + { + M_DEBUGF("[CDCtrl]hdlIfBusErrorStsCb: ⵽߽쳣!\n"); + pif->linkSts = e_err_receive; + can_kill( E_CAN_MSG_SIG,e_err_receive,chan); + } + else + { + /* */ + } + } +} +static void hdlIfBusErrorStsCb(unsigned char chan,bool sending) +{ + hdlIfBusErrorCb(chan,sending); +} + + + +static void hdlIfBusOffCb(unsigned char chan) +{ + st_if* pif; + + pif=GetIfFromChanel(chan); + if(pif != NULL) + { + if(pif->linkSts <= e_sts_closed) + { + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + } + else + { + M_DEBUGF("[CDCtrl]hdlIfBusOffCb: ⵽BUSOFF!\n"); + pif->linkSts = e_err_bussoff; + can_kill( E_CAN_MSG_SIG,e_err_bussoff,chan); + } + } +} +static st_recitem tmpRItem; +static bool hdlIfFrmReceve(unsigned char chan,unsigned int canid,const unsigned char *data,unsigned char len) +{ + st_if* pif; + + pif = GetIfFromChanel(chan); + + if(pif != NULL && pif->linkSts >= e_sts_working) + { + if(e_err_receive == pif->linkSts) + { + pif->linkSts=e_sts_working; + } + + if(pif->pl.flg&CAN_FLG_SYNCRECEIVE) + { + if(pif->pl.hdlRecCanMsg!=NULL) pif->pl.hdlRecCanMsg(canid,data,len); + } + else + { + tmpRItem.frmid = canid; + tmpRItem.datalen = len; + if(tmpRItem.datalen > 0 && tmpRItem.datalen<=8) CAN_COPY(tmpRItem.data,data,tmpRItem.datalen); + + sfifo_write(&pif->rec,&tmpRItem); + if(sfifo_full(&pif->rec)) + { + M_DEBUGF("[CDCtrl]hdlIfFrmReceve: ջ\n"); + pif->linkSts=e_err_overfllow; + can_kill( E_CAN_MSG_SIG,e_err_overfllow,chan); + } + } + } + + return true; +} + + +//עͨŽӿںͳʼ +st_cancb * RegisterCanIF(const st_canif *IF) +{ + unsigned char i; + + if(IF == NULL || IF->ConfigCan == NULL || IF->canSend==NULL ) return NULL; + + for(i=0;ichan) return NULL; + } + + for(i=0;i= WAIT_ACK_TIME) + { + CanIF[i].smsg.step = e_step_resend; + can_kill( E_CAN_MSG_SIG,e_sts_needsend,CanIF[i].canif.chan); + } + } + } +} + + +static void StartResendMsgTmr(void) +{ + if(waitSendAck == 0) waitSendAck = can_timer_create(waitSendMsgAck); + if(can_timer_switch(waitSendAck) == false) can_timer_start(waitSendAck, WAIT_ACK_INTERVAL); +} + + +static void HdlAllSengMsgSts(st_if* pif) +{ + bool flg = false; + +#if CAN_SEND_FASET_MODE > 0 + do { + flg = false; +#endif + switch(pif->smsg.step) + { + case e_step_send_idle: //еȴe_step_send,ͨʱ + if(pif->linkSts >= e_sts_working) + { + if(sfifo_empty(&(pif->send))==false) + { + if(sfifo_read(&(pif->send),&(pif->smsg.sending))) + { + pif->smsg.step=e_step_send; + pif->smsg.stimes = 0; + pif->smsg.waittime = 0; + } + flg = true; + } + } + break; + + case e_step_send: //зȻe_step_waitackȴ //ͨϢ + pif->smsg.sending.sendindex = pif->canif.canSend(pif->canif.chan,pif->smsg.sending.frmid,pif->smsg.sending.data,pif->smsg.sending.datalen); + + pif->smsg.stimes++; + if(pif->smsg.sending.sendindex != 0xFF) + { + pif->smsg.step=e_step_waitack; + pif->smsg.waittime = 0; + flg = true; + if(pif->linkSts == e_err_sending) pif->linkSts = e_sts_working; + } + else + { + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step=e_step_fail; + flg = true; + } + } + break; + #if 1 + case e_step_waitack: //ͨʱ + break; + case e_step_resend: //ط,ʱӦ̳쳣ʱ + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step=e_step_fail; + } + else + { + pif->smsg.step=e_step_send; + } + flg = true; + break; + case e_step_fail: //Ѿʧ + pif->smsg.step=e_step_send_idle; + if(pif->smsg.sending.cb != NULL) {pif->smsg.sending.cb(pif->smsg.sending.msgident,_FAILURE);} + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_FAILURE);} + flg = true; + break; + case e_step_suc: //ͳɹ + pif->smsg.step=e_step_send_idle; + #if CAN_SEND_FASET_MODE > 0 + if(pif->smsg.sending.cb != NULL) {can_kill(E_CAN_MSG_CB_SIG, (unsigned int)(pif->smsg.sending.cb),pif->smsg.sending.msgident);} + else if (pif->pl.hdlCommSent != NULL) {can_kill(E_CAN_MSG_CB_SIG, (unsigned int)(pif->pl.hdlCommSent),pif->smsg.sending.msgident);} + #else + if(pif->smsg.sending.cb != NULL) {pif->smsg.sending.cb(pif->smsg.sending.msgident,_SUCCESS);} + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_SUCCESS);} + #endif + flg = true; + break; + #endif + } +#if CAN_SEND_FASET_MODE > 0 + }while(flg == true && (pif->smsg.step != e_step_fail)); +#endif + if(flg) can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + +} + + +static void HdlSendMsgError(st_if* pif) +{ + if(pif->smsg.step == e_step_waitack) + { + M_DEBUGF("[CDCtrl]chan%d%d(%d)ηʧ\n",pif->canif.chan,pif->smsg.stimes,pif->pl.resendTimes); + if(pif->smsg.stimes >= pif->pl.resendTimes) + { + pif->smsg.step = e_step_fail; + } + else + { + pif->smsg.step = e_step_resend; + } + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + } + else + { + M_DEBUGF("[CDCtrl]HdlSendError,ǰͲ%d!=%d\n",pif->smsg.step,e_step_waitack); + } +} + +static void HdlSendMsgSuccess(st_if* pif,unsigned char index) +{ + //M_DEBUGF("[CDCtrl]chan=%d,%o sendOK(%d)\n",pif->canif.chan,index,pif->smsg.step); + + if(pif->smsg.step == e_step_waitack||pif->smsg.step ==e_step_resend) + { + if(pif->smsg.sending.sendindex == index) + { + pif->smsg.step = e_step_suc; + + #if CAN_SEND_FASET_MODE > 0 + if(pif->linkSts >= e_sts_working) HdlAllSengMsgSts(pif); + #else + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + #endif + } + else + { + M_DEBUGF("[CDCtrl]chan %d,index :%o#%o\n",pif->canif.chan,index,pif->smsg.sending.sendindex); + } + } +} + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// <------> Э ************************** +////////////////////////////////////////////////////////////////////////////////////////////////////// +//bool InstallProtocalToIF(unsigned char canid, st_pl* pif, st_cl * pcanif); ijӿЭ֮ +// ͬһʱ䣬һӿڽһЭ +//st_pl ЭҪṩĽӿڣЩϢҪʱCANDRVCTRL +//st_cl, CANDRVCTRL ṩĽӿڣ ЭͨЩӿڽݷ͵ +*********************************************************************************************************************/ + +static bool plSend(unsigned char chan,unsigned int frmid,unsigned char *data,unsigned char len,unsigned int msgident,void(*cb)(unsigned int msgident,unsigned int result))//Ϊ0ʾԶ֡ +{ + st_senditem send; + st_if* pif=NULL; + + pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed|| len>8 || sfifo_full(&pif->send)) return false; + + SYS_ENTER_CRITICAL(); + if (pif->linkSts == e_err_bussoff || pif->linkSts < e_sts_working) + { + SYS_EXIT_CRITICAL(); + return false; + } + + send.cb = cb; + send.frmid = frmid; + send.datalen = len; + send.msgident = msgident; + if(data == NULL) send.datalen = 0; + if(send.datalen>0 && send.datalen<=8) CAN_COPY(send.data,data,send.datalen); + send.sendindex = 0xFF; + + sfifo_write(&pif->send,&send); + + if(pif->smsg.step == e_step_send_idle) + { + #if CAN_SEND_FASET_MODE > 0 + HdlAllSengMsgSts(pif); + #else + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + #endif + } + SYS_EXIT_CRITICAL(); + return true; +} + +static bool plReceive(unsigned char chan,unsigned int* frmid,unsigned char *data,unsigned char* len)//Ϊ0ʾԶ֡ +{ + st_recitem rec; + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed || data==NULL || (pif->pl.flg&CAN_FLG_SYNCRECEIVE)) return false; + + if(sfifo_empty(&pif->rec)) return false; + + if(sfifo_read(&pif->rec,&rec)==0) return false; + *frmid = rec.frmid; + *len = rec.datalen; + if(rec.datalen > 0 && rec.datalen<=8) CAN_COPY(data,rec.data,rec.datalen); + + if (pif->linkSts == e_err_overfllow) + { + pif->linkSts = e_sts_working; + } + return true; +} + +static unsigned int plGetCurrentLinkSts(unsigned char chan) //ȡǰ״̬ +{ + st_if* pif=NULL; + + + pif=GetIfFromChanel(chan); + + if(pif !=NULL) return pif->linkSts; + + return 0; +} + +static bool plConfigBus(unsigned char chan,unsigned short krate, bool highdomain,bool listen) +{ + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_unused) return false; + + if(pif->canif.ConfigCan != NULL) + { + if(pif->canif.ConfigCan(chan,krate,highdomain,listen)) + { + if(pif->psend != NULL) + { + sfifo_init(&pif->send,pif->psend,sizeof(st_senditem),pif->pl.msgNumber); + } + if((pif->pl.flg&CAN_FLG_SYNCRECEIVE)==0 && (pif->prec != NULL)) + { + sfifo_init(&pif->rec,pif->prec,sizeof(st_recitem),pif->pl.msgNumber); + } + pif->linkSts = e_sts_working; + return true; + } + } + return false; +} + +static bool plcanBusFilterInit(unsigned char chan,unsigned int *filterID_array, unsigned short filterID_total) +{ + return false; +} + +static bool plCloseLink(unsigned char chan) +{ + st_if* pif=GetIfFromChanel(chan); + + if(pif ==NULL ||pif->linkSts<=e_sts_closed) return false; + pif->linkSts = e_sts_closed; + + if(pif->canif.canClose != NULL) pif->canif.canClose(chan); + + if(pif->smsg.step != e_step_send_idle) + { + if(pif->smsg.sending.cb != NULL) + { + if(pif->smsg.step == e_step_suc) + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_SUCCESS); + } + else if(pif->smsg.step == e_step_fail) + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_FAILURE); + } + else + { + pif->smsg.sending.cb(pif->smsg.sending.msgident,_ABANDON); + } + } + else if (pif->pl.hdlCommSent != NULL) + { + if(pif->smsg.step == e_step_suc) + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_SUCCESS); + } + else if(pif->smsg.step == e_step_fail) + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_FAILURE); + } + else + { + pif->pl.hdlCommSent(pif->smsg.sending.msgident,_ABANDON); + } + } + } + + while(sfifo_empty(&(pif->send))==false) + { + if(sfifo_read(&(pif->send),&(pif->smsg.sending))) + { + if(pif->smsg.sending.cb != NULL) pif->smsg.sending.cb(pif->smsg.sending.msgident,_ABANDON); + else if (pif->pl.hdlCommSent != NULL) {pif->pl.hdlCommSent(pif->smsg.sending.msgident,_ABANDON);} + } + } + + + memset(&pif->smsg,0x00,sizeof(pif->smsg)); + + return true; +} + +//////////////////////////////////////////////////////////////////////////////////////////// +//CanDrvCtrl ģϢ +//////////////////////////////////////////////////////////////////////////////////////////// +static void hdlCanCtrlMsg(e_link_sts msg,unsigned char chan) +{ + st_if* pif=GetIfFromChanel(chan); + if(pif == NULL) return; + + switch(msg) + { + case e_sts_needsend: + if(pif->linkSts >= e_sts_working) HdlAllSengMsgSts(pif); + break; + case e_err_overfllow: + if(pif->linkSts >= e_sts_working && pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_overfllow); + } + break; + case e_err_receive: + + if(pif->linkSts >= e_sts_working && pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_receive); + } + + break; + case e_err_sending: + if(pif->linkSts >= e_sts_working) + { + HdlSendMsgError(pif); + if(pif->pl.hdlBusError!= NULL)pif->pl.hdlBusError(e_err_sending); + } + break; + case e_err_bussoff: + if(pif->linkSts >= e_sts_working) + { + if(pif->smsg.step == e_step_waitack) + { + pif->smsg.step = e_step_fail; + can_kill( E_CAN_MSG_SIG,e_sts_needsend,pif->canif.chan); + } + + if(pif->pl.hdlBusError!= NULL) + { + pif->pl.hdlBusError(e_err_bussoff); + } + else + { + plCloseLink(pif->canif.chan); + plConfigBus(pif->canif.chan, 0, 0, 0); + } + } + break; + default: + //ﵽ + break; + } +} + +static void CAN_MSG_SIG_FUNC(unsigned int signal, int para1, int para2) +{ + hdlCanCtrlMsg(para1, para2); +} + + +static void CAN_MSG_CB_SIG_FUNC(unsigned int signal, int para1, int para2) +{ + void (*hdlCommSent)(unsigned int canid, unsigned int result); + + hdlCommSent = (void *)para1; + + if (hdlCommSent != NULL) + { + hdlCommSent(para2, _SUCCESS); + } +} + + +//ЭҪṩܽӿ + +bool InstallProtocalToIF(unsigned char chan, st_pl* ppl, st_cl * pcl) +{ + st_if* pif = NULL; + st_pl *p_pl; + + pif=GetIfFromChanel(chan); + + if(pif == NULL || ppl == NULL||pcl==NULL) return false; + + if(ppl->prompt[0]== 0 || pif->linkSts != e_sts_unused) + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ЭΪջӿѰװЭ(%d)\n",pif->linkSts); + return false; + } + + if((ppl->flg&CAN_FLG_SYNCRECEIVE) && ppl->hdlRecCanMsg == NULL) + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF: δṩhdlRecCanMsg ӿ\n"); + return false; + } + + pif->pl.msgNumber = ppl->msgNumber; + if(pif->pl.msgNumber == 0) pif->pl.msgNumber=50; //Ĭ50 + + pif->psend = CAN_MALLOC(sizeof(st_senditem)*pif->pl.msgNumber); + if(pif->psend != NULL) + { + sfifo_init(&pif->send,pif->psend,sizeof(st_senditem),pif->pl.msgNumber); + } + else + { + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ڴʧ,ڴռ%d*%d\n",sizeof(st_senditem),pif->pl.msgNumber); + return false; + } + + if((ppl->flg&CAN_FLG_SYNCRECEIVE)==0) + { + pif->prec = CAN_MALLOC(sizeof(st_recitem)*pif->pl.msgNumber); + if(pif->prec != NULL) + { + sfifo_init(&pif->rec,pif->prec,sizeof(st_recitem),pif->pl.msgNumber); + } + else + { + CAN_FREE(pif->psend); + pif->psend = NULL; + M_DEBUGF("[CDCtrl]InstallProtocalToIF:ڴʧ,ڴռ%d*%d\n",sizeof(st_senditem),pif->pl.msgNumber); + return false; + } + } + + pif->pl.flg = ppl->flg; + p_pl = &(pif->pl); + + memset(p_pl->prompt,0x00,sizeof(ppl->prompt)); + CAN_COPY(p_pl->prompt,ppl->prompt,sizeof(ppl->prompt)-1); + p_pl->hdlBusError = ppl->hdlBusError; + p_pl->hdlRecCanMsg= ppl->hdlRecCanMsg; + p_pl->resendTimes = ppl->resendTimes; + p_pl->hdlCommSent = ppl->hdlCommSent; + + pcl->canBusFilterInit = plcanBusFilterInit; + pcl->ConfigBus = plConfigBus; + pcl->GetCurrentLinkSts = plGetCurrentLinkSts; + pcl->REC = plReceive; + pcl->SEND = plSend; + pcl->CloseLink = plCloseLink; + + pif->linkSts = e_sts_closed; + + + return true; + +} + + +bool UninstallProtocalToIF(unsigned char chan, st_pl* ppl) +{ + st_if* pif=NULL; + + pif=GetIfFromChanel(chan); + + if(ppl == NULL || pif == NULL) return false; + + if(CAN_CMPY(ppl->prompt,pif->pl.prompt,sizeof(ppl->prompt)-1) != 0) + { + M_DEBUGF("Эӿָ벻ƥ\n"); + return false; + } + + //״̬лδʹ״̬ + pif->linkSts = e_sts_unused; + + if(pif->canif.canCloseFilter != NULL) + { + pif->canif.canCloseFilter(chan); + } + if(pif->canif.canClose != NULL) + { + pif->canif.canClose(chan); + } + + //ͷſռ + if((pif->pl.flg&CAN_FLG_SYNCRECEIVE)==0 && pif->prec != NULL) + { + CAN_FREE(pif->prec); + pif->prec = NULL; + } + if(pif->psend != NULL) + { + CAN_FREE(pif->psend); + pif->psend = NULL; + } + + + memset(&pif->pl,0x00,sizeof(st_pl)); + memset(&pif->smsg,0x00,sizeof(st_sendmsg)); + + return true; +} + + + +void InitCanDrvCtrlMode(void) +{ + unsigned char i; + + for(i=0;i 0 +#if 0 +const static char* stsprompt[]={ + "e_sts_empty", + "e_sts_unused", + "e_sts_closed", + "e_sts_working", +}; +const static char* errprompt[]={ + "e_err_receive", + "e_err_sending", + "e_err_overfllow", +}; + +void DprintCanDrvCtrl(void) +{ + unsigned char i; + + for(i=0;i e_sts_unused) + { + M_DEBUGF("\tprotocol:%s\n",CanIF[i].pl.prompt); + } + M_DEBUGF("\tMsg Step:%d\n",CanIF[i].smsg.step); + + } +} + +#endif + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.h new file mode 100644 index 0000000..e08b867 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/CanDrvCtrl.h @@ -0,0 +1,111 @@ +#ifndef __CANDRVCTRL_H__ +#define __CANDRVCTRL_H__ +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// CAN<------> +////////////////////////////////////////////////////////////////////////////////////////////////////// +//canͨidcanϢ֡id֮ͬcanidʾ׳ֻ +// chanʾcanͨ +// frmidʾcanϢ֡id +// +// +//can㽫ҪƵĽӿͨst_cancb * RegisterCanIF(st_canif *if) ӿڴģ +//st_cancb * RegisterCanIF(st_canif *if) 㽫ijӿڵĿȨCanDrvCtrlģ +//st_canif ͳһCanDrvCtrl Ľӿб,ConfigCan ,canSendcanidṩ +//ػصʵʱе +*********************************************************************************************************************/ +#include "porting.h" + + +typedef struct{ + unsigned char chan; //canӿڱʶ + + bool (*ConfigCan)(unsigned char chan,unsigned short krate, bool highdomain,bool listen); + unsigned char (*canSend)(unsigned char chan,unsigned int canid,unsigned char *data,unsigned char len);//ijcan msgشϢˮ,0xFFFFFFFFΪʧ + bool (*canClose)(unsigned char chan); + bool (*canHwPowerDown)(unsigned char chan); + bool (*canHwPowerUp)(unsigned char chan); + bool (*canBusFilterInit) (unsigned char chan ,unsigned int *filterID_array, unsigned short filterID_total); + bool (*canCloseFilter) (unsigned char chan); +}st_canif; + +//ЩӿҪcan㡱ʵ֡hdlRemoteFrmΪNULL򲻽Զ֡. +typedef struct{ + void (*SendSuccessCb)(unsigned char chan,unsigned int index); //ijϢͳɹ + void (*BusErrorCb)(unsigned char chan,bool sending); //ߴ + void (*BusErrorStsCb)(unsigned char chan,bool sending); //ߴ״̬ı + void (*BusOffCb)(unsigned char chan); //߽BUS OFF Ļص + bool (*hdlFrmReceve)(unsigned char chan,unsigned int canid, const unsigned char *data,unsigned char len); //len = 0ʾԶ֡ +}st_cancb; +st_cancb * RegisterCanIF(const st_canif *IF); + +/********************************************************************************************************************* +//CANDRVCTRL ΪЭcan֮м㣬ΪһŦ߽ +// +////////////////////////////////////////////////////////////////////////////////////////////////////// +// <------> Э ************************** +////////////////////////////////////////////////////////////////////////////////////////////////////// +//bool InstallProtocalToIF(unsigned char canid, st_pl* pif, st_cl * pcanif); ijӿЭ֮ +// ͬһʱ䣬һӿڽһЭ +//st_pl ЭҪṩĽӿڣЩϢҪʱCANDRVCTRL +//st_cl, CANDRVCTRL ṩĽӿڣ ЭͨЩӿڽݷ͵ +*********************************************************************************************************************/ + +//ƲṩЭĽӿ +typedef struct{ + //void(*cb)(unsigned int result) result :#define _SUCCESS 0 #define _FAILURE 1 #define _OVERTIME 2 #define _ABANDON 3 + bool (*SEND)(unsigned char chan,unsigned int frmid,unsigned char *data,unsigned char len,unsigned int msgident,void(*cb)(unsigned int msgident,unsigned int result));//Ϊ0ʾԶ֡ + bool (*REC)(unsigned char chan,unsigned int* frmid,unsigned char *data,unsigned char* len);//Ϊ0ʾԶ֡ + unsigned int (*GetCurrentLinkSts)(unsigned char chan); //ȡǰ״̬ + bool (*ConfigBus)(unsigned char chan,unsigned short krate, bool highdomain,bool listen); + bool (*canBusFilterInit) (unsigned char chan,unsigned int *filterID_array, unsigned short filterID_total); + bool (*CloseLink)(unsigned char chan); +}st_cl; + + +#define CAN_SEND_FASET_MODE 1 +//ЭҪṩӿ +#define CAN_FLG_SYNCRECEIVE 1 //պͨhdlRecCanMsgӿڷظӦò + //ЭͨRECӿֶȡ +typedef enum +{ + e_sts_empty=0, //˽ӿǿδнӿƥ,RegisterCanIFunused + e_sts_unused, + e_sts_closed, + e_sts_working, //ǰڹδ + e_sts_needsend, //ǰڷ + e_err_receive=0x80, + e_err_sending, + e_err_overfllow, + e_err_bussoff, +}e_link_sts; + + +typedef struct{ + char prompt[32]; //ʾ + unsigned int flg; //bit0 = canϢշʽ + unsigned char resendTimes; //ط + unsigned char msgNumber; //աͻи + void (*hdlRecCanMsg)(unsigned int id, const unsigned char *data,unsigned char len); //len0ʾԶ֡ + void (*hdlBusError)(e_link_sts err); + void (*hdlCommSent)(unsigned int msgident, unsigned int result); //ͨ÷ͽĻص +}st_pl; + + +//st_pl* ppl, st_cl * pcl ַռķӦЭõʱ +bool InstallProtocalToIF(unsigned char chan, st_pl* ppl, st_cl * pcl); +bool UninstallProtocalToIF(unsigned char chan, st_pl* ppl); + + +//ڴеһЩϢ + +void hdlCanCtrlMsg(e_link_sts msg,unsigned char chan); + +void InitCanDrvCtrlMode(void); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.c new file mode 100644 index 0000000..925016a Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.h new file mode 100644 index 0000000..29309a7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/bsp_can.h @@ -0,0 +1,62 @@ +#ifndef __BSP_CAN_H +#define __BSP_CAN_H +#include "sys.h" + +#include "stm32f10x.h" +#include "stm32f10x_can.h" + + +//CANRX0жʹ +#define CAN_RX0_INT_ENABLE 1 //0,ʹ;1,ʹ. + +u8 CAN_Mode_Init(void);//CANʼ + +u8 Can_Send_Msg(u8* msg,u8 len); // + +u8 Can_Receive_Msg(u8 *buf); // + + +#define CAN_RX2_INT_ENABLE 1 //0,ʹ;1,ʹ. + +u8 CAN2_Mode_Init(void);//CANʼ + +u8 Can2_Send_Msg(u8* msg,u8 len); // +u8 Can2_Send_Message( CanTxMsg msg); +u8 Can2_Receive_Msg(u8 *buf); // + + +/** + * @brief: bus offrecovery + * + * @param : void + * + * @return: void + * + * @remark: Զָߣɷڶʱѭڣ䱻ִеļܳ10ms + */ +void can_bus_off_recovery(void); + + +/** + * @brief: ӡ can ״̬ + */ +void can_bus_off_status_printf(void); + +#endif + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.c new file mode 100644 index 0000000..971ca40 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.h new file mode 100644 index 0000000..8daf3f9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_app.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_app.c new file mode 100644 index 0000000..4630409 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_app.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.c new file mode 100644 index 0000000..3a8cb4c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.h new file mode 100644 index 0000000..8ed6978 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/can_nm.h @@ -0,0 +1,68 @@ + +/******************** (C) COPYRIGHT 2011 Ƕʽ ******************** + * ļ can_nm.h + * + * + * 汾 V1.0 +**********************************************************************************/ +#include "Sys.h" +#include "can.h" + +/* */ +typedef enum +{ + E_QR_NC_WU = 0, /* WAKE UP REAUEST */ + E_QR_NC_SA, /* (system Stay Active response) */ + E_QR_NC_SLEEP, /* Not used,MASTER */ + E_QR_NC_MULTIMASTER, /* MultiMaster */ +} qr_nc_e; + +/* +0 = The CAN controller is in Error Active State. +1 = The CAN controller is in Error Passive State. +2 = Reserved (In future to management Bus Off State). +3 = Not Used +*/ +/* CAN״̬ */ +typedef enum +{ + E_QR_CS_ACTIVE = 0, /* Error Active State */ + E_QR_CS_PASSIVE, /* Error Passive State */ + E_QR_CS_BUSSOFF, /* In future to management Bus Off State */ + E_QR_CS_RESERVE, /* Not Used */ +} qr_cs_e; + + + + +/*************************************APP ʹýӿ************************************************************/ +typedef enum +{ + E_QR_CMD_APP_NETON = 0, /* 缤ɹָ */ + E_QR_CMD_APP_NETOFF, /* رյָ */ + E_QR_CMD_APP_NETCHK, /* ָ */ + E_QR_CMD_APP_UNUSED, /* δʹãЧ */ +} app_qr_cmd_e; + + +/** + * @brief: Ӧó⵽״̬ı󴥷 + * + * @param CMD ״ָ̬ + * @param active ǰǷҪӦ(1-Ҫݣ0-Ҫͣ 0xFF-δ֪/Ч) + * @param dtc_staus: DTC״̬(1 : DTCStatus = present 0 - ǣ 0xFF-δ֪/Ч) + * @param acc_active: acc ״̬(1 : acc on 0 - acc off 0xFF-δ֪/Ч) + */ +void app_qr_nm_req(app_qr_cmd_e CMD, uint8_t active, uint8_t dtc_staus, uint8_t acc_active); + +/** + * @brief: Ĵ + */ +void app_qirui_nm_handle_2(void); + + +/** + * @breif: ģʼ + */ +void app_qirui_nm_init(void); + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.c new file mode 100644 index 0000000..a21fca0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.c @@ -0,0 +1,539 @@ +/********************************************************** +** porting.c * +** 2022-11-15 * +** V1.0 * +**********************************************************/ + +#include "porting.h" + + + +/** + * @brief: ʼһFIFO + * + * + */ +void sfifo_init(st_fifo_t *stfifo, void *array, unsigned short stsize, unsigned short deepth) +{ + stfifo->deepth = deepth; + stfifo->occupy = 0; + stfifo->array = array; + stfifo->stsize = stsize; + stfifo->limit = (void*)((unsigned int)array + stsize*deepth); + stfifo->wp = stfifo->array; + stfifo->rp = stfifo->array; +} + +void sfifo_reset(st_fifo_t *stfifo) +{ + stfifo->occupy = 0; + stfifo->rp = stfifo->array; + stfifo->wp = stfifo->array; +} + + +bool sfifo_write(st_fifo_t *stfifo, const void *stunit) +{ + if (stfifo->occupy >= stfifo->deepth || stfifo->array == NULL) return false; + + memcpy((unsigned char*)stfifo->wp,(unsigned char*)stunit,stfifo->stsize); + stfifo->wp = (void*)((unsigned int)stfifo->wp + stfifo->stsize); + if (stfifo->wp >= stfifo->limit) stfifo->wp = stfifo->array; + + stfifo->occupy++; + + return true; +} + +bool sfifo_empty(st_fifo_t *stfifo) +{ + if (stfifo->occupy == 0 || stfifo->array == NULL) return true; + else return false; +} + +bool sfifo_full(st_fifo_t *stfifo) +{ + if (stfifo->occupy >= stfifo->deepth) return true; + else return false; +} + + +unsigned int sfifo_read(st_fifo_t *stfifo,void *stunit) +{ + + if (stfifo->occupy == 0 || stfifo->array == NULL) return 0x0; + + memcpy((unsigned char*)stunit,(unsigned char*)stfifo->rp,stfifo->stsize); + stfifo->rp = (void*)((unsigned int)stfifo->rp + stfifo->stsize); + if (stfifo->rp >= stfifo->limit) stfifo->rp = stfifo->array; + + + stfifo->occupy--; + + return stfifo->stsize; +} + +unsigned int sfifo_occupy_get(st_fifo_t *stfifo) +{ + return stfifo->occupy; +} + + + + + + +/****************************************************************** + QUEUE +******************************************************************/ +bool CreateQueue(QUEUE *que) +{ + if (que == 0) return FALSE; + que->head = 0; + que->tail = 0; + que->item = 0; + return TRUE; +} + +unsigned short QueueItem(QUEUE *que) +{ + if (que == 0) return 0; + else return (que->item); +} + +QUEUEMEM *QueueHead(QUEUE *que) +{ + if (que == 0 || que->item == 0) return 0; + else return ((QUEUEMEM *)que->head);// + sizeof(NODE)); +} + +QUEUEMEM *QueueTail(QUEUE *que) +{ + if (que == 0 || que->item == 0) return 0; + else return ((QUEUEMEM *)que->tail);// + sizeof(NODE)); +} + +QUEUEMEM *QueueNext(QUEUEMEM *element) +{ + QUEUENODE *curnode; + + if (element == 0) return 0; + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + if ((curnode = curnode->next) == 0) return 0; + else return ((QUEUEMEM *)curnode);// + sizeof(NODE)); +} + +QUEUEMEM *DelQueueElement(QUEUE *que, QUEUEMEM *element) +{ + QUEUENODE *curnode, *prenode, *nextnode; + + if (que == 0 || element == 0) return 0; + if (que->item == 0) return 0; + + que->item--; + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + + if (curnode == que->head) { + que->head = curnode->next; + if (que->item == 0) { + que->tail = 0; + return 0; + } else { + return (QUEUEMEM *)(que->head);// + sizeof(NODE); + } + } + + nextnode = curnode->next; + prenode = que->head; + while (prenode != 0) { + if (prenode->next == curnode) { + break; + } else { + prenode = prenode->next; + } + } + if (prenode == 0) return 0; + + prenode->next = nextnode; + if (curnode == que->tail) { + que->tail = prenode; + return 0; + } else { + return ((QUEUEMEM *)nextnode);// + sizeof(NODE)); + } +} + +// Return: Queue head +QUEUEMEM *DelQueueHead(QUEUE *que) +{ + QUEUEMEM *element; + + if (que == 0 || que->item == 0) return 0; + + element = (QUEUEMEM *)que->head;//+ sizeof(NODE); + DelQueueElement(que, element); + return element; +} + +// Return: Queue tail +QUEUEMEM *DelQueueTail(QUEUE *que) +{ + QUEUEMEM *element; + + if (que == 0 || que->item == 0) return 0; + + element = (QUEUEMEM *)que->tail;// + sizeof(NODE); + DelQueueElement(que, element); + return element; +} + +bool AppendQueue(QUEUE *que, QUEUEMEM *element) +{ + QUEUENODE *curnode; + + if (que == 0 || element == 0) return FALSE; + + curnode = (QUEUENODE *)(element);// - sizeof(NODE)); + if (que->item == 0) { + que->head = curnode; + } else { + que->tail->next = curnode; + } + curnode->next = 0; + que->tail = curnode; + que->item++; + return TRUE; +} + + +//intsert element before curelement +bool InsertBeforeQueue(QUEUE *que, QUEUEMEM *element,QUEUEMEM *curelement) +{ + QUEUENODE *curnode, *prenode, *node; + + if (que == 0 || element == 0 || curelement == 0) return FALSE; + node = (QUEUENODE*)element; + curnode = (QUEUENODE*)curelement; + + if (que->head == curnode) { + que->head = node; + node->next = curnode; + } else { + prenode = que->head; + while (prenode != 0) { + if (prenode->next == curnode) { + break; + } else { + prenode = prenode->next; + } + } + if (prenode == 0) return false; + prenode->next = node; + node->next = curnode; + } + que->item++; + return true; + } + + + + + + + +/*********************************************źصIJ*******************************************************/ +typedef struct { + unsigned int signal_id; + unsigned int para1; + unsigned int para2; +} signal_cell_t; + +typedef struct { + unsigned int signal; + signal_callback cb; +}signal_callback_t; + +typedef struct { + signal_callback_t signal_map[20]; /* 洢my_kill עźźͻص */ + signal_cell_t signal[40]; + st_fifo_t queue; +} signal_queue_t; + + +static signal_queue_t can_signal_queue = {0}; + + + +/* + * \brief: һϢPID + * \para: + * signal: my_signal_e ͵źֵ + * para1,para2: my_kill ӦϢص֮䴫ݲ + * + * ˽Ϣŵ⣬鵱ǰеϢ + * һֵʱ뾯ʾ + */ +int can_kill(unsigned int signal, unsigned int para1, unsigned int para2) +{ + signal_cell_t signal_cell; + + + signal_cell.signal_id = signal; + signal_cell.para1 = para1; + signal_cell.para2 = para2; + + return sfifo_write(&can_signal_queue.queue, (void *)&signal_cell); +} + + +/* + * \brief: PID Ϣsignal + * \para: + * signal: ҪϢ + * cb: + * \return: + * 0-ɹ <0 ʧ + * + *ҪϢǷpSQueue->mass б򷵻ʧ + *ӵpSQueue->signal_map + */ +int can_signal(unsigned int signal, signal_callback cb) +{ + unsigned int i; + + if (signal == E_CAN_SIGNAL_NULL) return -1; + + + /*ѾµĻص滻֮ǰĻص*/ + for (i=0; iholdtime = 0; + pCur->optime = 0; + pCur->tmrfunc = NULL; + return; +} + +void can_timer_start(TIMER tmr,unsigned int ms) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return; + + pCur->holdtime = ms; + + TickOut(&(pCur->optime), 0); +} + + +void can_timer_stop(TIMER tmr) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return; + + pCur->holdtime = 0; +} + +bool can_timer_switch(TIMER tmr) +{ + timer_cell_t *pCur = (timer_cell_t *)tmr; + + if (pCur == NULL) return false; + + if (pCur->holdtime > 0) { + return true; + } else { + return false; + } +} + + + + +/* ʱܵijʼ */ +int can_timer_init(void) +{ + memset(can_timer, 0x00, sizeof(can_timer)); + return 0; +} + + +/* ʱܵijʼ */ +int can_timer_schedule(void) +{ + unsigned int tick, i, holdtime, last_tick = 0; + can_tmr_func cb; + + TickOut(&tick, 0); + + if (tick == last_tick || tick == (last_tick+1)) + { + return 0; + } + + last_tick = tick; + + for (i = 0; i < NELEMENTS(can_timer); i++) + { + cb = can_timer[i].tmrfunc; + holdtime = can_timer[i].holdtime; + + if (holdtime > 0 && cb != NULL) + { + + if (TickOut(&can_timer[i].optime,holdtime) == TRUE) + { + if (can_timer[i].tmrfunc != NULL) + { + can_timer[i].optime += ((tick - can_timer[i].optime)/holdtime*holdtime); + } + + if (cb != NULL) + { + cb((TIMER)&can_timer[i]); + } + } + } + } + + return 0; +} + + + +/** + * @brief: ʼcan ЭĻ + */ +void can_porting_init(void) +{ + can_timer_init(); + can_signal_queue_init(); +} + + +/** + * @brief: ʼcan ЭĻܵĵ + */ +void can_porting_schedule(void) +{ + can_signal_schedule(); + can_timer_schedule(); +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.h new file mode 100644 index 0000000..a5130d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/porting.h @@ -0,0 +1,170 @@ +/**************************************************************** +* porting.h * +* 2022-11-15 * +****************************************************************/ + +#ifndef _PROTOCOL_PORTING_H_ + +#define _PROTOCOL_PORTING_H_ + +/* Ͷ */ +#include +#include "stdint.h" +#include +#include "sys.h" + +#define NELEMENTS(x) (sizeof(x)/sizeof((x)[0])) + +#define _SUCCESS 0 +#define _FAILURE 1 +#define _OVERTIME 2 +#define _ABANDON 3 + + + + +typedef struct { + unsigned short deepth; /* ܹжԪ */ + unsigned short occupy; /* ռԪظ */ + unsigned short stsize; /* ÿԪصĴС */ + void *array; /* ŵĻ */ + void *limit; /* ĩβ */ + void *wp; /* дָ */ + void *rp; /* ָ */ +} st_fifo_t; + + +/** + * @brief: ʼһFIFO + * + * + */ +void sfifo_init(st_fifo_t *stfifo, void *array, unsigned short stsize, unsigned short deepth); + +void sfifo_reset(st_fifo_t *stfifo); + + +bool sfifo_write(st_fifo_t *stfifo, const void *stunit); + +bool sfifo_empty(st_fifo_t *stfifo); + +bool sfifo_full(st_fifo_t *stfifo); + +unsigned int sfifo_read(st_fifo_t *stfifo,void *stunit); + +unsigned int sfifo_occupy_get(st_fifo_t *stfifo); + + + + + +#define QUEUEMEM unsigned char +#define QUEUENODE struct node + +typedef struct node{ + QUEUENODE *next; +} NODE; + +typedef struct { + QUEUENODE *head; + QUEUENODE *tail; + unsigned short item; +} QUEUE; + +bool CreateQueue(QUEUE *que); +unsigned short QueueItem(QUEUE *que); +QUEUEMEM *QueueHead(QUEUE *que); +QUEUEMEM *QueueTail(QUEUE *que); +QUEUEMEM *QueueNext(QUEUEMEM *element); +QUEUEMEM *DelQueueElement(QUEUE *que, QUEUEMEM *element); +QUEUEMEM *DelQueueHead(QUEUE *que); +QUEUEMEM *DelQueueTail(QUEUE *que); +bool AppendQueue(QUEUE *que, QUEUEMEM *element); +bool InsertBeforeQueue(QUEUE *que, QUEUEMEM *element,QUEUEMEM *curelement); + + + + + + +/* ڴصĽӿֲ */ +/* + * void mem_cpy (void* dst, const void* src, int cnt); CAN_COPY + * void mem_set (void* dst, int val, int cnt); + * int mem_cmp (const void* dst, const void* src, int cnt); + * void *mem_malloc(mem_size_t size); + * void mem_free(void *mem); + */ +#define CAN_MALLOC(size) malloc(size) +#define CAN_COPY(p_des, p_src, size) memcpy((p_des), (p_src), (size)) +#define CAN_CMPY(p_des, p_src, size) memcmp((p_des), (p_src), (size)) +#define CAN_FREE(p) free(p) + + + + +/* + * źŵĻص + * para: + * signal: źű־ + * para1: 뷢߶ + * para2: 뷢߶ + */ +typedef void (*signal_callback)(unsigned int signal, int para1, int para2); + +/* + * \brief: һϢPID + * \para: + * signal: my_signal_e ͵źֵ + * para1,para2: my_kill ӦϢص֮䴫ݲ + */ +int can_kill(unsigned int signal, unsigned int para1, unsigned int para2); + +/* + * \brief: PID Ϣsignal + * \para: + * signal: ҪϢ + * cb: + * \return: + * 0-ɹ <0 ʧ + * \remark: + * 1) my_signal_queue_create ϢIDmy_signal + * 2) ͬһϢԶmy_signalֻһЧ + * DzҪô + */ +int can_signal(unsigned int signal, signal_callback cb); + + + +/* + * CANź + */ +typedef enum { + E_CAN_SIGNAL_NULL = 0, + E_CAN_MSG_SIG, + E_CAN_MSG_CB_SIG, /* źŵķͻص */ + E_CAN_15765_NET_SIG, + E_CAN_15765_SS_SIG, +} can_signal_e; + + + + +/*************************************ʱ********************************************************/ +typedef unsigned int TIMER; +typedef void (*can_tmr_func)(TIMER tmr_id); //ʱִָ +TIMER can_timer_create(can_tmr_func cb); + +void can_timer_remove(TIMER tmr); + +void can_timer_start(TIMER tmr,unsigned int ms); + + +void can_timer_stop(TIMER tmr); + +bool can_timer_switch(TIMER tmr); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/readme.txt new file mode 100644 index 0000000..c3597b8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/CAN/readme.txt @@ -0,0 +1,2 @@ +bsp_can 是对MCU的接口部分,相当于是MCU的移植部分 +CanBusDrv 提供对can的统一处理, 完成总线的异常处理等 \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.c new file mode 100644 index 0000000..b97585d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.h new file mode 100644 index 0000000..2ab09d7 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/DC300/dc300.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.c new file mode 100644 index 0000000..661ca69 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.c @@ -0,0 +1,322 @@ +/* +********************************************************************************************************* +* +* ģ : I2Cģ +* ļ : bsp_i2c_gpio.c +* : V1.0 +* ˵ : gpioģi2c, STM32F4ϵCPUģ鲻Ӧò֡I2C߻ +* +* ޸ļ¼ : +* 汾 ˵ +* V1.0 2015-05-21 armfly ʽ +* +* Copyright (C), 2015-2016, www.armfly.com +* +********************************************************************************************************* +*/ + +/* + Ӧ˵ + ڷI2C豸ǰȵ i2c_CheckDevice() I2C豸ǷúGPIO +*/ + +#include "stm32f10x.h" +#include "bsp_i2c_gpio.h" + +/* + STM32-V4 i2cGPIO: + PB6/I2C1_SCL + PB7/I2C1_SDA +*/ + +/* I2CӵGPIO˿, ûֻҪ޸4д뼴ıSCLSDA */ + +#define RCC_I2C_PORT RCC_APB2Periph_GPIOB /* GPIO˿ʱ */ + +#define PORT_I2C_SCL GPIOB /* GPIO˿ */ +#define PIN_I2C_SCL GPIO_Pin_10 /* GPIO */ + +#define PORT_I2C_SDA GPIOB /* GPIO˿ */ +#define PIN_I2C_SDA GPIO_Pin_11 /* GPIO */ + +#define I2C_SCL_PIN GPIO_Pin_10 /* ӵSCLʱߵGPIO */ +#define I2C_SDA_PIN GPIO_Pin_11 /* ӵSDAߵGPIO */ + +/* дSCLSDAĺ */ +#define I2C_SCL_1() PORT_I2C_SCL->BSRR = I2C_SCL_PIN /* SCL = 1 */ +#define I2C_SCL_0() PORT_I2C_SCL->BRR = I2C_SCL_PIN /* SCL = 0 */ + +#define I2C_SDA_1() PORT_I2C_SDA->BSRR = I2C_SDA_PIN /* SDA = 1 */ +#define I2C_SDA_0() PORT_I2C_SDA->BRR = I2C_SDA_PIN /* SDA = 0 */ + +#define I2C_SDA_READ() ((PORT_I2C_SDA->IDR & I2C_SDA_PIN) != 0) /* SDA״̬ */ +#define I2C_SCL_READ() ((PORT_I2C_SCL->IDR & I2C_SCL_PIN) != 0) /* SCL״̬ */ + +/* +********************************************************************************************************* +* : bsp_InitI2C +* ˵: I2CߵGPIOģIOķʽʵ +* : +* ֵ: +********************************************************************************************************* +*/ +void bsp_InitI2C(void) +{ + GPIO_InitTypeDef GPIO_InitStructure; + + RCC_APB2PeriphClockCmd(RCC_I2C_PORT, ENABLE); /* GPIOʱ */ + + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; /* ©ģʽ */ + GPIO_InitStructure.GPIO_Pin = PIN_I2C_SCL; + GPIO_Init(PORT_I2C_SCL, &GPIO_InitStructure); + + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_InitStructure.GPIO_Pin = PIN_I2C_SDA; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; /* ©ģʽ */ + GPIO_Init(PORT_I2C_SDA, &GPIO_InitStructure); + + /* һֹͣź, λI2Cϵ豸ģʽ */ +// IIC_Stop(); + GPIO_SetBits(PORT_I2C_SCL,PIN_I2C_SCL); //PB6,PB7 ??? + GPIO_SetBits(PORT_I2C_SDA,PIN_I2C_SDA); + + //??? + // GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;//A SCL SDA + // GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + // GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; + // GPIO_Init(GPIOB, &GPIO_InitStructure); + + // GPIO_SetBits(GPIOB,GPIO_Pin_6|GPIO_Pin_7); //PB6,PB7 ??? +} + +/* +********************************************************************************************************* +* : i2c_Delay +* ˵: I2Cλӳ٣400KHz +* : +* ֵ: +********************************************************************************************************* +*/ +static void i2c_Delay(void) +{ + uint16_t i; + + /* + CPUƵ168MHzʱڲFlash, MDK̲Ż̨ʽʾ۲ⲨΡ + ѭΪ5ʱSCLƵ = 1.78MHz (ʱ: 92ms, дʾ̽ͷϾͶдʧܡʱӽٽ) + ѭΪ10ʱSCLƵ = 1.1MHz (ʱ: 138ms, ٶ: 118724B/s) + ѭΪ30ʱSCLƵ = 440KHz SCLߵƽʱ1.0usSCL͵ƽʱ1.2us + + ѡ2.2KŷʱSCLʱԼ0.5usѡ4.7KŷԼ1us + + ʵӦѡ400KHzҵʼ + */ + for (i = 0; i < 60; i++); +} + +/* +********************************************************************************************************* +* : i2c_Start +* ˵: CPUI2Cź +* : +* ֵ: +********************************************************************************************************* +*/ +void IIC_Start(void) +{ + /* SCLߵƽʱSDAһرʾI2Cź */ + I2C_SDA_1(); + I2C_SCL_1(); + i2c_Delay(); + I2C_SDA_0(); + i2c_Delay(); + + I2C_SCL_0(); + i2c_Delay(); +} + +/* +********************************************************************************************************* +* : i2c_Start +* ˵: CPUI2Cֹͣź +* : +* ֵ: +********************************************************************************************************* +*/ +void IIC_Stop(void) +{ + /* SCLߵƽʱSDAһرʾI2Cֹͣź */ + I2C_SDA_0(); + I2C_SCL_1(); + i2c_Delay(); + I2C_SDA_1(); + i2c_Delay(); +} + +/* +********************************************************************************************************* +* : i2c_SendByte +* ˵: CPUI2C豸8bit +* : _ucByte ȴ͵ֽ +* ֵ: +********************************************************************************************************* +*/ +void IIC_Send_Byte(uint8_t _ucByte) +{ + uint8_t i; + + /* ȷֽڵĸλbit7 */ + for (i = 0; i < 8; i++) + { + if (_ucByte & 0x80) + { + I2C_SDA_1(); + } + else + { + I2C_SDA_0(); + } + i2c_Delay(); + I2C_SCL_1(); + i2c_Delay(); + I2C_SCL_0(); + if (i == 7) + { + I2C_SDA_1(); // ͷ + } + _ucByte <<= 1; /* һbit */ + i2c_Delay(); + } +} + +/* +********************************************************************************************************* +* : i2c_ReadByte +* ˵: CPUI2C豸ȡ8bit +* : +* ֵ: +********************************************************************************************************* +*/ +u8 IIC_Read_Byte(unsigned char ack) +{ + uint8_t i; + uint8_t value; + + /* 1bitΪݵbit7 */ + value = 0; + for (i = 0; i < 8; i++) + { + value <<= 1; + I2C_SCL_1(); + i2c_Delay(); + if (I2C_SDA_READ()) + { + value++; + } + I2C_SCL_0(); + i2c_Delay(); + } +if (!ack) + IIC_NAck();//??nACK + else + IIC_Ack(); //??ACK + return value; +} + +/* +********************************************************************************************************* +* : i2c_WaitAck +* ˵: CPUһʱӣȡACKӦź +* : +* ֵ: 0ʾȷӦ1ʾӦ +********************************************************************************************************* +*/ +uint8_t IIC_Wait_Ack(void) +{ + uint8_t re; + + I2C_SDA_1(); /* CPUͷSDA */ + i2c_Delay(); + I2C_SCL_1(); /* CPUSCL = 1, ʱ᷵ACKӦ */ + i2c_Delay(); + if (I2C_SDA_READ()) /* CPUȡSDA״̬ */ + { + re = 1; + } + else + { + re = 0; + } + I2C_SCL_0(); + i2c_Delay(); + return re; +} + +/* +********************************************************************************************************* +* : i2c_Ack +* ˵: CPUһACKź +* : +* ֵ: +********************************************************************************************************* +*/ +void IIC_Ack(void) +{ + I2C_SDA_0(); /* CPUSDA = 0 */ + i2c_Delay(); + I2C_SCL_1(); /* CPU1ʱ */ + i2c_Delay(); + I2C_SCL_0(); + i2c_Delay(); + I2C_SDA_1(); /* CPUͷSDA */ +} + +/* +********************************************************************************************************* +* : i2c_NAck +* ˵: CPU1NACKź +* : +* ֵ: +********************************************************************************************************* +*/ +void IIC_NAck(void) +{ + I2C_SDA_1(); /* CPUSDA = 1 */ + i2c_Delay(); + I2C_SCL_1(); /* CPU1ʱ */ + i2c_Delay(); + I2C_SCL_0(); + i2c_Delay(); +} + +///* +//********************************************************************************************************* +//* : i2c_CheckDevice +//* ˵: I2C豸CPU豸ַȻȡ豸Ӧжϸ豸Ƿ +//* : _Address豸I2Cߵַ +//* ֵ: ֵ 0 ʾȷ 1ʾδ̽⵽ +//********************************************************************************************************* +//*/ +//#define ADS1015_ADDRESS 0x48 +// u8 AD1015_Check(u8 i2cAddress) +//{ +// uint8_t ucAck; + +// if (I2C_SDA_READ() && I2C_SCL_READ()) +// { +// IIC_Start(); /* ź */ + +// /* 豸ַ+дbit0 = w 1 = r) bit7 ȴ */ +// IIC_Send_Byte(i2cAddress | I2C_WR); +// ucAck = IIC_Wait_Ack(); /* 豸ACKӦ */ + +// IIC_Stop(); /* ֹͣź */ + +// return ucAck; +// } +// return 1; /* I2C쳣 */ +//} + + +/***************************** www.armfly.com (END OF FILE) *********************************/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.h new file mode 100644 index 0000000..0939659 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/I2C/bsp_i2c_gpio.h @@ -0,0 +1,30 @@ +/* +********************************************************************************************************* +* +* ģ : I2Cģ +* ļ : bsp_i2c_gpio.h +* : V1.0 +* ˵ : ͷļ +* +* Copyright (C), 2012-2013, www.armfly.com +* +********************************************************************************************************* +*/ + +#ifndef _BSP_I2C_GPIO_H +#define _BSP_I2C_GPIO_H +#include "stm32f10x.h" +#define I2C_WR 0 /* дbit */ +#define I2C_RD 1 /* bit */ + +void bsp_InitI2C(void); +void IIC_Start(void); +void IIC_Stop(void); +void IIC_Send_Byte(uint8_t _ucByte); +u8 IIC_Read_Byte(unsigned char ack); +uint8_t IIC_Wait_Ack(void); +void IIC_Ack(void); +void IIC_NAck(void); +// u8 AD1015_Check(u8 i2cAddress); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.c new file mode 100644 index 0000000..2b03e6e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.h new file mode 100644 index 0000000..808f234 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LED/led.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.c new file mode 100644 index 0000000..f1eb279 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.h new file mode 100644 index 0000000..41c9645 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/LOWPOWER/app_pwr_manage.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.c new file mode 100644 index 0000000..ce3d706 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.c @@ -0,0 +1,77 @@ +#include "timer.h" +#include "led.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEKսSTM32 +//ʱ +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/3 +//汾V1.0 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +////////////////////////////////////////////////////////////////////////////////// + +//ͨöʱ3жϳʼ +//ʱѡΪAPB12APB1Ϊ36M +//arrԶװֵ +//pscʱԤƵ +//719Ƶ50k, 500ֵ֮100hz +//7199Ƶ5k, 500ֵ֮1000hz +//ʹõǶʱ3!//TIM3ʼԶװֵʱԤƵϵ +//Tout= ((arr+1)*(psc+1))/Tclk +// ΪAPB1 ʱӷƵΪ 1 TIM2~7 +// ʱƵʽΪ APB1 ʱӵҲ72 +//ʵTout=500*7200/72=500 000us +//һʱʱ + +void TIM3_Int_Init(u16 arr,u16 psc) +{ + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + NVIC_InitTypeDef NVIC_InitStructure; + + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); //ʱʹ + + //ʱTIM3ʼ + TIM_TimeBaseStructure.TIM_Period = arr; //һ¼װԶװؼĴڵֵ + TIM_TimeBaseStructure.TIM_Prescaler =psc; //ΪTIMxʱƵʳԤƵֵ + TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; //ʱӷָ:TDTS = Tck_tim + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIMϼģʽ + TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); //ָIJʼTIMxʱλ + + TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE ); //ʹָTIM3ж,ж + + //жȼNVIC + NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; //TIM3ж + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; //ռȼ0 + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; //ȼ3 + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQͨʹ + NVIC_Init(&NVIC_InitStructure); //ʼNVICĴ + + + TIM_Cmd(TIM3, ENABLE); //ʹTIMx +} +//ʱ3жϷ +extern int8_t QIRUI_DCDCSendBms2(void); + +void TIM3_IRQHandler(void) //TIM3ж +{ + if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) //TIM3жϷ + { + QIRUI_DCDCSendBms2(); + TIM_ClearITPendingBit(TIM3, TIM_IT_Update ); //TIMxжϱ־ + } +} + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.h new file mode 100644 index 0000000..a2637c4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/TIMER/timer.h @@ -0,0 +1,20 @@ +#ifndef __TIMER_H +#define __TIMER_H +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEKսSTM32 +//ʱ +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/3 +//汾V1.0 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +////////////////////////////////////////////////////////////////////////////////// + + +void TIM3_Int_Init(u16 arr,u16 psc); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.c new file mode 100644 index 0000000..7ad9b5c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.c @@ -0,0 +1,69 @@ +/************************************* + * ļ xxx.c + * ȡCPUIDÿоƬΨһ 96_bit unique ID + * ʵƽ̨MINI STM32 STM32F103C8T6 + * Ӳӣ + * 汾 ST3.0.0 + +**********************************************************************************/ + + +#include "chipid.h" + +#include "led.h" + + +u32 ChipUniqueID[3]; + #define UID_BASE 0x1FF80050 +/* ȡоƬID */ +void Get_ChipID(void) +{ + ChipUniqueID[0] = *(__IO u32 *)(0X1FFFF7F0); // ֽ + ChipUniqueID[1] = *(__IO u32 *)(0X1FFFF7EC); // + ChipUniqueID[2] = *(__IO u32 *)(0X1FFFF7E8); // ֽ + + if(ChipUniqueID[0]==0xFFFFFFFF) + { + + ChipUniqueID[0] = (uint32_t)(*((uint32_t *)UID_BASE)); + ChipUniqueID[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 0x04))); + ChipUniqueID[2] = (uint32_t)(*((uint32_t *)(UID_BASE + 0x14))); + } + + + +} +u32 ChipUniqueIDdecodeflag; +uint8_t ChipUniqueIDCompare(void) +{ + if((SysParaPileD.ChipUniqueID[0] == ChipUniqueID[0])&&(SysParaPileD.ChipUniqueID[1] == ChipUniqueID[1]) + && (SysParaPileD.ChipUniqueID[2] == ChipUniqueID[2])) + { + return 1; + } + else + { + MCU_LED(1); + while (1) + { + MCU_LED(1); + IWDG_Feed(); + ChipUniqueIDdecodeflag =1; + if(ChipUniqueIDdecodeflag==1) + { + ChipUniqueIDdecodeflag =0; + SysParaPileD.ChipUniqueID[0] = ChipUniqueID[0]; + SysParaPileD.ChipUniqueID[1] = ChipUniqueID[1]; + SysParaPileD.ChipUniqueID[2] = ChipUniqueID[2]; + Delay_MS(5); + SysParaPileD.bluetooth_passward[4]=0x35; + SysParaPileD.bluetooth_passward[5]=0x36; + SysWriteSysParm(); + Delay_MS(5); + break; + } + } + } +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.h new file mode 100644 index 0000000..2f4c72f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/chipID/chipid.h @@ -0,0 +1,9 @@ +#ifndef __CHIPID_H +#define __CHIPID_H + + +#include "stm32f10x.h" + +void Get_ChipID(void); +uint8_t ChipUniqueIDCompare(void); +#endif /* __CHIPID_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.c new file mode 100644 index 0000000..7f6ff52 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.h new file mode 100644 index 0000000..48eb2f8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/common/common.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.c new file mode 100644 index 0000000..53ebcac --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.c @@ -0,0 +1,222 @@ +/* +********************************************************************************************************* +* +* ģ : cpuڲfalshģ +* ļ : bsp_cpu_flash.c +* : V1.0 +* ˵ : ṩдCPUڲFlashĺ +* ޸ļ¼ : +* 汾 ˵ +* +********************************************************************************************************* +*/ +#include "Sys.h" +#include "misc.h" +#include "stm32f10x_flash.h" +#include "bsp_cpu_flash.h" +/* +********************************************************************************************************* +* : bsp_GetSector +* ˵: ݵַ׵ַ +* Σ +* ֵ: ׵ַ +********************************************************************************************************* +*/ +uint32_t bsp_GetSector(uint32_t _ulWrAddr) +{ + uint32_t sector = 0; + + sector = _ulWrAddr & SECTOR_MASK; + + return sector; +} + +/* +********************************************************************************************************* +* : bsp_ReadCpuFlash +* ˵: ȡCPU Flash +* Σ_ucpDst : Ŀ껺 +* _ulFlashAddr : ʼַ +* _ulSize : ݴСλֽڣ +* ֵ: 0=ɹ1=ʧ +********************************************************************************************************* +*/ +uint8_t bsp_ReadCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpDst, uint32_t _ulSize) +{ + uint32_t i; + + /* ƫƵַоƬ򲻸д */ + if (_ulFlashAddr + _ulSize > FLASH_BASE_ADDR + FLASH_SIZE) + { + return 1; + } + + /* Ϊ0ʱ,ʼַΪַ */ + if (_ulSize == 0) + { + return 1; + } + + for (i = 0; i < _ulSize; i++) + { + *_ucpDst++ = *(uint8_t *)_ulFlashAddr++; + } + + return 0; +} + +/* +********************************************************************************************************* +* : bsp_CmpCpuFlash +* ˵: ȽFlashַָ. +* : _ulFlashAddr : Flashַ +* _ucpBuf : ݻ +* _ulSize : ݴСλֽڣ +* ֵ: +* FLASH_IS_EQU 0 FlashݺʹдȣҪд +* FLASH_REQ_WRITE 1 FlashҪֱд +* FLASH_REQ_ERASE 2 FlashҪȲ,д +* FLASH_PARAM_ERR 3 +********************************************************************************************************* +*/ +uint8_t bsp_CmpCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpBuf, uint32_t _ulSize) +{ + uint32_t i; + uint8_t ucIsEqu; /* ȱ־ */ + uint8_t ucByte; + + /* ƫƵַоƬ򲻸д */ + if (_ulFlashAddr + _ulSize > FLASH_BASE_ADDR + FLASH_SIZE) + { + return FLASH_PARAM_ERR; /**/ + } + + /* Ϊ0ʱȷ */ + if (_ulSize == 0) + { + return FLASH_IS_EQU; /* Flashݺʹд */ + } + + ucIsEqu = 1; /* ȼֽںʹдȣκһȣΪ 0 */ + for (i = 0; i < _ulSize; i++) + { + ucByte = *(uint8_t *)_ulFlashAddr; + + if (ucByte != *_ucpBuf) + { + if (ucByte != 0xFF) + { + return FLASH_REQ_ERASE; /* Ҫд */ + } + else + { + ucIsEqu = 0; /* ȣҪд */ + } + } + + _ulFlashAddr++; + _ucpBuf++; + } + + if (ucIsEqu == 1) + { + return FLASH_IS_EQU; /* FlashݺʹдȣҪд */ + } + else + { + return FLASH_REQ_WRITE; /* FlashҪֱд */ + } +} + +/* +********************************************************************************************************* +* : bsp_WriteCpuFlash +* ˵: дݵCPU ڲFlash +* : _ulFlashAddr : Flashַ +* _ucpSrc : ݻ +* _ulSize : ݴСλֽڣ +* ֵ: 0-ɹ1-ݳȻַ2-дFlash(Flash) +********************************************************************************************************* +*/ +uint8_t bsp_WriteCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpSrc, uint32_t _ulSize) +{ + uint32_t i; + uint8_t ucRet; + uint16_t usTemp,j; + FLASH_Status status = FLASH_COMPLETE; + + /* ƫƵַоƬ򲻸д */ + if (_ulFlashAddr + _ulSize > FLASH_BASE_ADDR + FLASH_SIZE) + { + return 1; + } + + /* Ϊ0 ʱ */ + if (_ulSize == 0) + { + return 0; + } + + /* Ϊʱ */ +// if ((_ulSize % 2) != 0) +// { +// return 1; +// } + if ((_ulSize % 2) != 0) + { + _ulSize= _ulSize+1; + } + ucRet = bsp_CmpCpuFlash(_ulFlashAddr, _ucpSrc, _ulSize); + + if (ucRet == FLASH_IS_EQU) + { + return 0; + } + + __set_PRIMASK(1); /* ж */ + + /* FLASH */ + FLASH_Unlock(); + + /* Clear pending flags (if any) */ + FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); + + /* Ҫ */ +// if (ucRet == FLASH_REQ_ERASE) + { + status = FLASH_ErasePage(bsp_GetSector(_ulFlashAddr)); +// if (status != FLASH_COMPLETE) +// { +// return 2; +// } + } +j=1000; +while(j--); + /* ֽģʽ̣ΪЧʣ԰ֱ̣һд4ֽڣ */ + for (i = 0; i < _ulSize / 2; i++) + { + //FLASH_ProgramByte(_ulFlashAddr++, *_ucpSrc++); + usTemp = _ucpSrc[2 * i]; + usTemp |= (_ucpSrc[2 * i + 1] << 8); + status = FLASH_ProgramHalfWord(_ulFlashAddr, usTemp); + if (status != FLASH_COMPLETE) + { + break; + } + + _ulFlashAddr += 2; + } + + /* Flash ֹдFlashƼĴ */ + FLASH_Lock(); + + __set_PRIMASK(0); /* ж */ + + if (status == FLASH_COMPLETE) + { + return 0; + } + return 2; +} + +/***************************** www.armfly.com (END OF FILE) *********************************/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.h new file mode 100644 index 0000000..3a32541 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/HARDWARE/cupflash/bsp_cpu_flash.h @@ -0,0 +1,35 @@ +/* +********************************************************************************************************* +* +* ģ : cpuڲfalshģ +* ļ : bsp_cpu_flash.h +* : V1.0 +* +* Copyright (C), 2013-2014, www.armfly.com +* +********************************************************************************************************* +*/ + +#ifndef _BSP_CPU_FLASH_H_ +#define _BSP_CPU_FLASH_H_ +#include "Sys.h" +#define FLASH_BASE_ADDR 0x08000000 /* Flashַ */ +#define FLASH_SIZE (128*1024) /* Flash */ + +/* F103 128k FLASH , ÿPAGE = 2K ֽڣܹ 64 PAGE */ +#define SECTOR_MASK 0xFFFFF800 + +#define FLASH_IS_EQU 0 /* FlashݺʹдȣҪд */ +#define FLASH_REQ_WRITE 1 /* FlashҪֱд */ +#define FLASH_REQ_ERASE 2 /* FlashҪȲ,д */ +#define FLASH_PARAM_ERR 3 /* */ + +uint8_t bsp_ReadCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpDst, uint32_t _ulSize); +uint8_t bsp_WriteCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpSrc, uint32_t _ulSize); +uint8_t bsp_CmpCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpBuf, uint32_t _ulSize); + +#endif + + +/***************************** www.armfly.com (END OF FILE) *********************************/ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/LICENSE.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/LICENSE.txt new file mode 100644 index 0000000..6a346d0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/LICENSE.txt @@ -0,0 +1,86 @@ +This software component is provided to you as part of a software package and +applicable license terms are in the Package_license file. If you received this +software component outside of a package or without applicable license terms, +the terms of the SLA0044 license shall apply and are fully reproduced below: + +SLA0044 Rev5/February 2018 + +Software license agreement + +ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT + +BY INSTALLING, COPYING, DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE +OR ANY PART THEREOF (AND THE RELATED DOCUMENTATION) FROM STMICROELECTRONICS +INTERNATIONAL N.V, SWISS BRANCH AND/OR ITS AFFILIATED COMPANIES +(STMICROELECTRONICS), THE RECIPIENT, ON BEHALF OF HIMSELF OR HERSELF, OR ON +BEHALF OF ANY ENTITY BY WHICH SUCH RECIPIENT IS EMPLOYED AND/OR ENGAGED AGREES +TO BE BOUND BY THIS SOFTWARE LICENSE AGREEMENT. + +Under STMicroelectronics intellectual property rights, the redistribution, +reproduction and use in source and binary forms of the software or any part +thereof, with or without modification, are permitted provided that the following +conditions are met: + +1. Redistribution of source code (modified or not) must retain any copyright +notice, this list of conditions and the disclaimer set forth below as items 10 +and 11. + +2. Redistributions in binary form, except as embedded into microcontroller or +microprocessor device manufactured by or for STMicroelectronics or a software +update for such device, must reproduce any copyright notice provided with the +binary code, this list of conditions, and the disclaimer set forth below as +items 10 and 11, in documentation and/or other materials provided with the +distribution. + +3. Neither the name of STMicroelectronics nor the names of other contributors to +this software may be used to endorse or promote products derived from this +software or part thereof without specific written permission. + +4. This software or any part thereof, including modifications and/or derivative +works of this software, must be used and execute solely and exclusively on or in +combination with a microcontroller or microprocessor device manufactured by or +for STMicroelectronics. + +5. No use, reproduction or redistribution of this software partially or totally +may be done in any manner that would subject this software to any Open Source +Terms. Open Source Terms shall mean any open source license which requires as +part of distribution of software that the source code of such software is +distributed therewith or otherwise made available, or open source license that +substantially complies with the Open Source definition specified at +www.opensource.org and any other comparable open source license such as for +example GNU General Public License (GPL), Eclipse Public License (EPL), Apache +Software License, BSD license or MIT license. + +6. STMicroelectronics has no obligation to provide any maintenance, support or +updates for the software. + +7. The software is and will remain the exclusive property of STMicroelectronics +and its licensors. The recipient will not take any action that jeopardizes +STMicroelectronics and its licensors' proprietary rights or acquire any rights +in the software, except the limited rights specified hereunder. + +8. The recipient shall comply with all applicable laws and regulations affecting +the use of the software or any part thereof including any applicable export +control law or regulation. + +9. Redistribution and use of this software or any part thereof other than as +permitted under this license is void and will automatically terminate your +rights under this license. + +10. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, WHICH ARE +DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL +STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +11. EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS, WHETHER +EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL PROPERTY +RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/misc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/misc.h new file mode 100644 index 0000000..03e25e6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/misc.h @@ -0,0 +1,218 @@ +/** + ****************************************************************************** + * @file misc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the miscellaneous + * firmware library functions (add-on to CMSIS functions). + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MISC_H +#define __MISC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup MISC + * @{ + */ + +/** @defgroup MISC_Exported_Types + * @{ + */ + +/** + * @brief NVIC Init Structure definition + */ + +typedef struct +{ + uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled. + This parameter can be a value of @ref IRQn_Type + (For the complete STM32 Devices IRQ Channels list, please + refer to stm32f10x.h file) */ + + uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel + specified in NVIC_IRQChannel. This parameter can be a value + between 0 and 15 as described in the table @ref NVIC_Priority_Table */ + + uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified + in NVIC_IRQChannel. This parameter can be a value + between 0 and 15 as described in the table @ref NVIC_Priority_Table */ + + FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel + will be enabled or disabled. + This parameter can be set either to ENABLE or DISABLE */ +} NVIC_InitTypeDef; + +/** + * @} + */ + +/** @defgroup NVIC_Priority_Table + * @{ + */ + +/** +@code + The table below gives the allowed values of the pre-emption priority and subpriority according + to the Priority Grouping configuration performed by NVIC_PriorityGroupConfig function + ============================================================================================================================ + NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description + ============================================================================================================================ + NVIC_PriorityGroup_0 | 0 | 0-15 | 0 bits for pre-emption priority + | | | 4 bits for subpriority + ---------------------------------------------------------------------------------------------------------------------------- + NVIC_PriorityGroup_1 | 0-1 | 0-7 | 1 bits for pre-emption priority + | | | 3 bits for subpriority + ---------------------------------------------------------------------------------------------------------------------------- + NVIC_PriorityGroup_2 | 0-3 | 0-3 | 2 bits for pre-emption priority + | | | 2 bits for subpriority + ---------------------------------------------------------------------------------------------------------------------------- + NVIC_PriorityGroup_3 | 0-7 | 0-1 | 3 bits for pre-emption priority + | | | 1 bits for subpriority + ---------------------------------------------------------------------------------------------------------------------------- + NVIC_PriorityGroup_4 | 0-15 | 0 | 4 bits for pre-emption priority + | | | 0 bits for subpriority + ============================================================================================================================ +@endcode +*/ + +/** + * @} + */ + +/** @defgroup MISC_Exported_Constants + * @{ + */ + +/** @defgroup Vector_Table_Base + * @{ + */ + +#define NVIC_VectTab_RAM ((uint32_t)0x20000000) +#define NVIC_VectTab_FLASH ((uint32_t)0x08000000) +#define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \ + ((VECTTAB) == NVIC_VectTab_FLASH)) +/** + * @} + */ + +/** @defgroup System_Low_Power + * @{ + */ + +#define NVIC_LP_SEVONPEND ((uint8_t)0x10) +#define NVIC_LP_SLEEPDEEP ((uint8_t)0x04) +#define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02) +#define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \ + ((LP) == NVIC_LP_SLEEPDEEP) || \ + ((LP) == NVIC_LP_SLEEPONEXIT)) +/** + * @} + */ + +/** @defgroup Preemption_Priority_Group + * @{ + */ + +#define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority + 4 bits for subpriority */ +#define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority + 3 bits for subpriority */ +#define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority + 2 bits for subpriority */ +#define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority + 1 bits for subpriority */ +#define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority + 0 bits for subpriority */ + +#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \ + ((GROUP) == NVIC_PriorityGroup_1) || \ + ((GROUP) == NVIC_PriorityGroup_2) || \ + ((GROUP) == NVIC_PriorityGroup_3) || \ + ((GROUP) == NVIC_PriorityGroup_4)) + +#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) + +#define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) + +#define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF) + +/** + * @} + */ + +/** @defgroup SysTick_clock_source + * @{ + */ + +#define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) +#define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) +#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \ + ((SOURCE) == SysTick_CLKSource_HCLK_Div8)) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup MISC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup MISC_Exported_Functions + * @{ + */ + +void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup); +void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct); +void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset); +void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState); +void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource); + +#ifdef __cplusplus +} +#endif + +#endif /* __MISC_H */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_adc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_adc.h new file mode 100644 index 0000000..c357a39 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_adc.h @@ -0,0 +1,481 @@ +/** + ****************************************************************************** + * @file stm32f10x_adc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the ADC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_ADC_H +#define __STM32F10x_ADC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup ADC + * @{ + */ + +/** @defgroup ADC_Exported_Types + * @{ + */ + +/** + * @brief ADC Init structure definition + */ + +typedef struct +{ + uint32_t ADC_Mode; /*!< Configures the ADC to operate in independent or + dual mode. + This parameter can be a value of @ref ADC_mode */ + + FunctionalState ADC_ScanConvMode; /*!< Specifies whether the conversion is performed in + Scan (multichannels) or Single (one channel) mode. + This parameter can be set to ENABLE or DISABLE */ + + FunctionalState ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in + Continuous or Single mode. + This parameter can be set to ENABLE or DISABLE. */ + + uint32_t ADC_ExternalTrigConv; /*!< Defines the external trigger used to start the analog + to digital conversion of regular channels. This parameter + can be a value of @ref ADC_external_trigger_sources_for_regular_channels_conversion */ + + uint32_t ADC_DataAlign; /*!< Specifies whether the ADC data alignment is left or right. + This parameter can be a value of @ref ADC_data_align */ + + uint8_t ADC_NbrOfChannel; /*!< Specifies the number of ADC channels that will be converted + using the sequencer for regular channel group. + This parameter must range from 1 to 16. */ +}ADC_InitTypeDef; +/** + * @} + */ + +/** @defgroup ADC_Exported_Constants + * @{ + */ + +#define IS_ADC_ALL_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ + ((PERIPH) == ADC2) || \ + ((PERIPH) == ADC3)) + +#define IS_ADC_DMA_PERIPH(PERIPH) (((PERIPH) == ADC1) || \ + ((PERIPH) == ADC3)) + +/** @defgroup ADC_mode + * @{ + */ + +#define ADC_Mode_Independent ((uint32_t)0x00000000) +#define ADC_Mode_RegInjecSimult ((uint32_t)0x00010000) +#define ADC_Mode_RegSimult_AlterTrig ((uint32_t)0x00020000) +#define ADC_Mode_InjecSimult_FastInterl ((uint32_t)0x00030000) +#define ADC_Mode_InjecSimult_SlowInterl ((uint32_t)0x00040000) +#define ADC_Mode_InjecSimult ((uint32_t)0x00050000) +#define ADC_Mode_RegSimult ((uint32_t)0x00060000) +#define ADC_Mode_FastInterl ((uint32_t)0x00070000) +#define ADC_Mode_SlowInterl ((uint32_t)0x00080000) +#define ADC_Mode_AlterTrig ((uint32_t)0x00090000) + +#define IS_ADC_MODE(MODE) (((MODE) == ADC_Mode_Independent) || \ + ((MODE) == ADC_Mode_RegInjecSimult) || \ + ((MODE) == ADC_Mode_RegSimult_AlterTrig) || \ + ((MODE) == ADC_Mode_InjecSimult_FastInterl) || \ + ((MODE) == ADC_Mode_InjecSimult_SlowInterl) || \ + ((MODE) == ADC_Mode_InjecSimult) || \ + ((MODE) == ADC_Mode_RegSimult) || \ + ((MODE) == ADC_Mode_FastInterl) || \ + ((MODE) == ADC_Mode_SlowInterl) || \ + ((MODE) == ADC_Mode_AlterTrig)) +/** + * @} + */ + +/** @defgroup ADC_external_trigger_sources_for_regular_channels_conversion + * @{ + */ + +#define ADC_ExternalTrigConv_T1_CC1 ((uint32_t)0x00000000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigConv_T1_CC2 ((uint32_t)0x00020000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigConv_T2_CC2 ((uint32_t)0x00060000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigConv_T3_TRGO ((uint32_t)0x00080000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigConv_T4_CC4 ((uint32_t)0x000A0000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO ((uint32_t)0x000C0000) /*!< For ADC1 and ADC2 */ + +#define ADC_ExternalTrigConv_T1_CC3 ((uint32_t)0x00040000) /*!< For ADC1, ADC2 and ADC3 */ +#define ADC_ExternalTrigConv_None ((uint32_t)0x000E0000) /*!< For ADC1, ADC2 and ADC3 */ + +#define ADC_ExternalTrigConv_T3_CC1 ((uint32_t)0x00000000) /*!< For ADC3 only */ +#define ADC_ExternalTrigConv_T2_CC3 ((uint32_t)0x00020000) /*!< For ADC3 only */ +#define ADC_ExternalTrigConv_T8_CC1 ((uint32_t)0x00060000) /*!< For ADC3 only */ +#define ADC_ExternalTrigConv_T8_TRGO ((uint32_t)0x00080000) /*!< For ADC3 only */ +#define ADC_ExternalTrigConv_T5_CC1 ((uint32_t)0x000A0000) /*!< For ADC3 only */ +#define ADC_ExternalTrigConv_T5_CC3 ((uint32_t)0x000C0000) /*!< For ADC3 only */ + +#define IS_ADC_EXT_TRIG(REGTRIG) (((REGTRIG) == ADC_ExternalTrigConv_T1_CC1) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T1_CC2) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T1_CC3) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T2_CC2) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T3_TRGO) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T4_CC4) || \ + ((REGTRIG) == ADC_ExternalTrigConv_Ext_IT11_TIM8_TRGO) || \ + ((REGTRIG) == ADC_ExternalTrigConv_None) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T3_CC1) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T2_CC3) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T8_CC1) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T8_TRGO) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T5_CC1) || \ + ((REGTRIG) == ADC_ExternalTrigConv_T5_CC3)) +/** + * @} + */ + +/** @defgroup ADC_data_align + * @{ + */ + +#define ADC_DataAlign_Right ((uint32_t)0x00000000) +#define ADC_DataAlign_Left ((uint32_t)0x00000800) +#define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DataAlign_Right) || \ + ((ALIGN) == ADC_DataAlign_Left)) +/** + * @} + */ + +/** @defgroup 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_16 ((uint8_t)0x10) +#define ADC_Channel_17 ((uint8_t)0x11) + +#define ADC_Channel_TempSensor ((uint8_t)ADC_Channel_16) +#define ADC_Channel_Vrefint ((uint8_t)ADC_Channel_17) + +#define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_Channel_0) || ((CHANNEL) == ADC_Channel_1) || \ + ((CHANNEL) == ADC_Channel_2) || ((CHANNEL) == ADC_Channel_3) || \ + ((CHANNEL) == ADC_Channel_4) || ((CHANNEL) == ADC_Channel_5) || \ + ((CHANNEL) == ADC_Channel_6) || ((CHANNEL) == ADC_Channel_7) || \ + ((CHANNEL) == ADC_Channel_8) || ((CHANNEL) == ADC_Channel_9) || \ + ((CHANNEL) == ADC_Channel_10) || ((CHANNEL) == ADC_Channel_11) || \ + ((CHANNEL) == ADC_Channel_12) || ((CHANNEL) == ADC_Channel_13) || \ + ((CHANNEL) == ADC_Channel_14) || ((CHANNEL) == ADC_Channel_15) || \ + ((CHANNEL) == ADC_Channel_16) || ((CHANNEL) == ADC_Channel_17)) +/** + * @} + */ + +/** @defgroup ADC_sampling_time + * @{ + */ + +#define ADC_SampleTime_1Cycles5 ((uint8_t)0x00) +#define ADC_SampleTime_7Cycles5 ((uint8_t)0x01) +#define ADC_SampleTime_13Cycles5 ((uint8_t)0x02) +#define ADC_SampleTime_28Cycles5 ((uint8_t)0x03) +#define ADC_SampleTime_41Cycles5 ((uint8_t)0x04) +#define ADC_SampleTime_55Cycles5 ((uint8_t)0x05) +#define ADC_SampleTime_71Cycles5 ((uint8_t)0x06) +#define ADC_SampleTime_239Cycles5 ((uint8_t)0x07) +#define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SampleTime_1Cycles5) || \ + ((TIME) == ADC_SampleTime_7Cycles5) || \ + ((TIME) == ADC_SampleTime_13Cycles5) || \ + ((TIME) == ADC_SampleTime_28Cycles5) || \ + ((TIME) == ADC_SampleTime_41Cycles5) || \ + ((TIME) == ADC_SampleTime_55Cycles5) || \ + ((TIME) == ADC_SampleTime_71Cycles5) || \ + ((TIME) == ADC_SampleTime_239Cycles5)) +/** + * @} + */ + +/** @defgroup ADC_external_trigger_sources_for_injected_channels_conversion + * @{ + */ + +#define ADC_ExternalTrigInjecConv_T2_TRGO ((uint32_t)0x00002000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigInjecConv_T2_CC1 ((uint32_t)0x00003000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigInjecConv_T3_CC4 ((uint32_t)0x00004000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigInjecConv_T4_TRGO ((uint32_t)0x00005000) /*!< For ADC1 and ADC2 */ +#define ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4 ((uint32_t)0x00006000) /*!< For ADC1 and ADC2 */ + +#define ADC_ExternalTrigInjecConv_T1_TRGO ((uint32_t)0x00000000) /*!< For ADC1, ADC2 and ADC3 */ +#define ADC_ExternalTrigInjecConv_T1_CC4 ((uint32_t)0x00001000) /*!< For ADC1, ADC2 and ADC3 */ +#define ADC_ExternalTrigInjecConv_None ((uint32_t)0x00007000) /*!< For ADC1, ADC2 and ADC3 */ + +#define ADC_ExternalTrigInjecConv_T4_CC3 ((uint32_t)0x00002000) /*!< For ADC3 only */ +#define ADC_ExternalTrigInjecConv_T8_CC2 ((uint32_t)0x00003000) /*!< For ADC3 only */ +#define ADC_ExternalTrigInjecConv_T8_CC4 ((uint32_t)0x00004000) /*!< For ADC3 only */ +#define ADC_ExternalTrigInjecConv_T5_TRGO ((uint32_t)0x00005000) /*!< For ADC3 only */ +#define ADC_ExternalTrigInjecConv_T5_CC4 ((uint32_t)0x00006000) /*!< For ADC3 only */ + +#define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_ExternalTrigInjecConv_T1_TRGO) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T1_CC4) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_TRGO) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T2_CC1) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T3_CC4) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_TRGO) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_None) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T4_CC3) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC2) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T8_CC4) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_TRGO) || \ + ((INJTRIG) == ADC_ExternalTrigInjecConv_T5_CC4)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_ADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) == ADC_InjectedChannel_1) || \ + ((CHANNEL) == ADC_InjectedChannel_2) || \ + ((CHANNEL) == ADC_InjectedChannel_3) || \ + ((CHANNEL) == ADC_InjectedChannel_4)) +/** + * @} + */ + +/** @defgroup 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) + +#define IS_ADC_ANALOG_WATCHDOG(WATCHDOG) (((WATCHDOG) == ADC_AnalogWatchdog_SingleRegEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_SingleInjecEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_SingleRegOrInjecEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_AllRegEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_AllInjecEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_AllRegAllInjecEnable) || \ + ((WATCHDOG) == ADC_AnalogWatchdog_None)) +/** + * @} + */ + +/** @defgroup ADC_interrupts_definition + * @{ + */ + +#define ADC_IT_EOC ((uint16_t)0x0220) +#define ADC_IT_AWD ((uint16_t)0x0140) +#define ADC_IT_JEOC ((uint16_t)0x0480) + +#define IS_ADC_IT(IT) ((((IT) & (uint16_t)0xF81F) == 0x00) && ((IT) != 0x00)) + +#define IS_ADC_GET_IT(IT) (((IT) == ADC_IT_EOC) || ((IT) == ADC_IT_AWD) || \ + ((IT) == ADC_IT_JEOC)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_ADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint8_t)0xE0) == 0x00) && ((FLAG) != 0x00)) +#define IS_ADC_GET_FLAG(FLAG) (((FLAG) == ADC_FLAG_AWD) || ((FLAG) == ADC_FLAG_EOC) || \ + ((FLAG) == ADC_FLAG_JEOC) || ((FLAG)== ADC_FLAG_JSTRT) || \ + ((FLAG) == ADC_FLAG_STRT)) +/** + * @} + */ + +/** @defgroup ADC_thresholds + * @{ + */ + +#define IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= 0xFFF) + +/** + * @} + */ + +/** @defgroup ADC_injected_offset + * @{ + */ + +#define IS_ADC_OFFSET(OFFSET) ((OFFSET) <= 0xFFF) + +/** + * @} + */ + +/** @defgroup ADC_injected_length + * @{ + */ + +#define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x4)) + +/** + * @} + */ + +/** @defgroup ADC_injected_rank + * @{ + */ + +#define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x4)) + +/** + * @} + */ + + +/** @defgroup ADC_regular_length + * @{ + */ + +#define IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= 0x1) && ((LENGTH) <= 0x10)) +/** + * @} + */ + +/** @defgroup ADC_regular_rank + * @{ + */ + +#define IS_ADC_REGULAR_RANK(RANK) (((RANK) >= 0x1) && ((RANK) <= 0x10)) + +/** + * @} + */ + +/** @defgroup ADC_regular_discontinuous_mode_number + * @{ + */ + +#define IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= 0x1) && ((NUMBER) <= 0x8)) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup ADC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup ADC_Exported_Functions + * @{ + */ + +void ADC_DeInit(ADC_TypeDef* ADCx); +void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct); +void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct); +void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState); +void ADC_ResetCalibration(ADC_TypeDef* ADCx); +FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx); +void ADC_StartCalibration(ADC_TypeDef* ADCx); +FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx); +void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx); +void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number); +void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime); +void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx); +uint32_t ADC_GetDualModeConversionValue(void); +void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_ExternalTrigInjecConv); +void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState); +FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx); +void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime); +void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length); +void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset); +uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel); +void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog); +void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold, uint16_t LowThreshold); +void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel); +void ADC_TempSensorVrefintCmd(FunctionalState NewState); +FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG); +void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG); +ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT); +void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_ADC_H */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_bkp.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_bkp.h new file mode 100644 index 0000000..2eeb73b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_bkp.h @@ -0,0 +1,193 @@ +/** + ****************************************************************************** + * @file stm32f10x_bkp.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the BKP firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_BKP_H +#define __STM32F10x_BKP_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup BKP + * @{ + */ + +/** @defgroup BKP_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Exported_Constants + * @{ + */ + +/** @defgroup Tamper_Pin_active_level + * @{ + */ + +#define BKP_TamperPinLevel_High ((uint16_t)0x0000) +#define BKP_TamperPinLevel_Low ((uint16_t)0x0001) +#define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) (((LEVEL) == BKP_TamperPinLevel_High) || \ + ((LEVEL) == BKP_TamperPinLevel_Low)) +/** + * @} + */ + +/** @defgroup RTC_output_source_to_output_on_the_Tamper_pin + * @{ + */ + +#define BKP_RTCOutputSource_None ((uint16_t)0x0000) +#define BKP_RTCOutputSource_CalibClock ((uint16_t)0x0080) +#define BKP_RTCOutputSource_Alarm ((uint16_t)0x0100) +#define BKP_RTCOutputSource_Second ((uint16_t)0x0300) +#define IS_BKP_RTC_OUTPUT_SOURCE(SOURCE) (((SOURCE) == BKP_RTCOutputSource_None) || \ + ((SOURCE) == BKP_RTCOutputSource_CalibClock) || \ + ((SOURCE) == BKP_RTCOutputSource_Alarm) || \ + ((SOURCE) == BKP_RTCOutputSource_Second)) +/** + * @} + */ + +/** @defgroup Data_Backup_Register + * @{ + */ + +#define BKP_DR1 ((uint16_t)0x0004) +#define BKP_DR2 ((uint16_t)0x0008) +#define BKP_DR3 ((uint16_t)0x000C) +#define BKP_DR4 ((uint16_t)0x0010) +#define BKP_DR5 ((uint16_t)0x0014) +#define BKP_DR6 ((uint16_t)0x0018) +#define BKP_DR7 ((uint16_t)0x001C) +#define BKP_DR8 ((uint16_t)0x0020) +#define BKP_DR9 ((uint16_t)0x0024) +#define BKP_DR10 ((uint16_t)0x0028) +#define BKP_DR11 ((uint16_t)0x0040) +#define BKP_DR12 ((uint16_t)0x0044) +#define BKP_DR13 ((uint16_t)0x0048) +#define BKP_DR14 ((uint16_t)0x004C) +#define BKP_DR15 ((uint16_t)0x0050) +#define BKP_DR16 ((uint16_t)0x0054) +#define BKP_DR17 ((uint16_t)0x0058) +#define BKP_DR18 ((uint16_t)0x005C) +#define BKP_DR19 ((uint16_t)0x0060) +#define BKP_DR20 ((uint16_t)0x0064) +#define BKP_DR21 ((uint16_t)0x0068) +#define BKP_DR22 ((uint16_t)0x006C) +#define BKP_DR23 ((uint16_t)0x0070) +#define BKP_DR24 ((uint16_t)0x0074) +#define BKP_DR25 ((uint16_t)0x0078) +#define BKP_DR26 ((uint16_t)0x007C) +#define BKP_DR27 ((uint16_t)0x0080) +#define BKP_DR28 ((uint16_t)0x0084) +#define BKP_DR29 ((uint16_t)0x0088) +#define BKP_DR30 ((uint16_t)0x008C) +#define BKP_DR31 ((uint16_t)0x0090) +#define BKP_DR32 ((uint16_t)0x0094) +#define BKP_DR33 ((uint16_t)0x0098) +#define BKP_DR34 ((uint16_t)0x009C) +#define BKP_DR35 ((uint16_t)0x00A0) +#define BKP_DR36 ((uint16_t)0x00A4) +#define BKP_DR37 ((uint16_t)0x00A8) +#define BKP_DR38 ((uint16_t)0x00AC) +#define BKP_DR39 ((uint16_t)0x00B0) +#define BKP_DR40 ((uint16_t)0x00B4) +#define BKP_DR41 ((uint16_t)0x00B8) +#define BKP_DR42 ((uint16_t)0x00BC) + +#define IS_BKP_DR(DR) (((DR) == BKP_DR1) || ((DR) == BKP_DR2) || ((DR) == BKP_DR3) || \ + ((DR) == BKP_DR4) || ((DR) == BKP_DR5) || ((DR) == BKP_DR6) || \ + ((DR) == BKP_DR7) || ((DR) == BKP_DR8) || ((DR) == BKP_DR9) || \ + ((DR) == BKP_DR10) || ((DR) == BKP_DR11) || ((DR) == BKP_DR12) || \ + ((DR) == BKP_DR13) || ((DR) == BKP_DR14) || ((DR) == BKP_DR15) || \ + ((DR) == BKP_DR16) || ((DR) == BKP_DR17) || ((DR) == BKP_DR18) || \ + ((DR) == BKP_DR19) || ((DR) == BKP_DR20) || ((DR) == BKP_DR21) || \ + ((DR) == BKP_DR22) || ((DR) == BKP_DR23) || ((DR) == BKP_DR24) || \ + ((DR) == BKP_DR25) || ((DR) == BKP_DR26) || ((DR) == BKP_DR27) || \ + ((DR) == BKP_DR28) || ((DR) == BKP_DR29) || ((DR) == BKP_DR30) || \ + ((DR) == BKP_DR31) || ((DR) == BKP_DR32) || ((DR) == BKP_DR33) || \ + ((DR) == BKP_DR34) || ((DR) == BKP_DR35) || ((DR) == BKP_DR36) || \ + ((DR) == BKP_DR37) || ((DR) == BKP_DR38) || ((DR) == BKP_DR39) || \ + ((DR) == BKP_DR40) || ((DR) == BKP_DR41) || ((DR) == BKP_DR42)) + +#define IS_BKP_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7F) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup BKP_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Exported_Functions + * @{ + */ + +void BKP_DeInit(void); +void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel); +void BKP_TamperPinCmd(FunctionalState NewState); +void BKP_ITConfig(FunctionalState NewState); +void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource); +void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue); +void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data); +uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR); +FlagStatus BKP_GetFlagStatus(void); +void BKP_ClearFlag(void); +ITStatus BKP_GetITStatus(void); +void BKP_ClearITPendingBit(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_BKP_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_can.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_can.h new file mode 100644 index 0000000..75f7717 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_can.h @@ -0,0 +1,695 @@ +/** + ****************************************************************************** + * @file stm32f10x_can.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the CAN firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_CAN_H +#define __STM32F10x_CAN_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup CAN + * @{ + */ + +/** @defgroup CAN_Exported_Types + * @{ + */ + +#define IS_CAN_ALL_PERIPH(PERIPH) (((PERIPH) == CAN1) || \ + ((PERIPH) == CAN2)) + +/** + * @brief CAN init structure definition + */ + +typedef struct +{ + uint16_t CAN_Prescaler; /*!< Specifies the length of a time quantum. + It ranges from 1 to 1024. */ + + uint8_t CAN_Mode; /*!< Specifies the CAN operating mode. + This parameter can be a value of + @ref CAN_operating_mode */ + + uint8_t CAN_SJW; /*!< Specifies the maximum number of time quanta + the CAN hardware is allowed to lengthen or + shorten a bit to perform resynchronization. + This parameter can be a value of + @ref CAN_synchronisation_jump_width */ + + uint8_t CAN_BS1; /*!< Specifies the number of time quanta in Bit + Segment 1. This parameter can be a value of + @ref CAN_time_quantum_in_bit_segment_1 */ + + uint8_t CAN_BS2; /*!< Specifies the number of time quanta in Bit + Segment 2. + This parameter can be a value of + @ref CAN_time_quantum_in_bit_segment_2 */ + + FunctionalState CAN_TTCM; /*!< Enable or disable the time triggered + communication mode. This parameter can be set + either to ENABLE or DISABLE. */ + + FunctionalState CAN_ABOM; /*!< Enable or disable the automatic bus-off + management. This parameter can be set either + to ENABLE or DISABLE. */ + + FunctionalState CAN_AWUM; /*!< Enable or disable the automatic wake-up mode. + This parameter can be set either to ENABLE or + DISABLE. */ + + FunctionalState CAN_NART; /*!< Enable or disable the no-automatic + retransmission mode. This parameter can be + set either to ENABLE or DISABLE. */ + + FunctionalState CAN_RFLM; /*!< Enable or disable the Receive FIFO Locked mode. + This parameter can be set either to ENABLE + or DISABLE. */ + + FunctionalState CAN_TXFP; /*!< Enable or disable the transmit FIFO priority. + This parameter can be set either to ENABLE + or DISABLE. */ +} CAN_InitTypeDef; + +/** + * @brief CAN filter init structure definition + */ + +typedef struct +{ + uint16_t CAN_FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit + configuration, first one for a 16-bit configuration). + This parameter can be a value between 0x0000 and 0xFFFF */ + + uint16_t CAN_FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit + configuration, second one for a 16-bit configuration). + This parameter can be a value between 0x0000 and 0xFFFF */ + + uint16_t CAN_FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, + according to the mode (MSBs for a 32-bit configuration, + first one for a 16-bit configuration). + This parameter can be a value between 0x0000 and 0xFFFF */ + + uint16_t CAN_FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, + according to the mode (LSBs for a 32-bit configuration, + second one for a 16-bit configuration). + This parameter can be a value between 0x0000 and 0xFFFF */ + + uint16_t CAN_FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter. + This parameter can be a value of @ref CAN_filter_FIFO */ + + uint8_t CAN_FilterNumber; /*!< Specifies the filter which will be initialized. It ranges from 0 to 13. */ + + uint8_t CAN_FilterMode; /*!< Specifies the filter mode to be initialized. + This parameter can be a value of @ref CAN_filter_mode */ + + uint8_t CAN_FilterScale; /*!< Specifies the filter scale. + This parameter can be a value of @ref CAN_filter_scale */ + + FunctionalState CAN_FilterActivation; /*!< Enable or disable the filter. + This parameter can be set either to ENABLE or DISABLE. */ +} CAN_FilterInitTypeDef; + +/** + * @brief CAN Tx message structure definition + */ + +typedef struct +{ + uint32_t StdId; /*!< Specifies the standard identifier. + This parameter can be a value between 0 to 0x7FF. */ + + uint32_t ExtId; /*!< Specifies the extended identifier. + This parameter can be a value between 0 to 0x1FFFFFFF. */ + + uint8_t IDE; /*!< Specifies the type of identifier for the message that + will be transmitted. This parameter can be a value + of @ref CAN_identifier_type */ + + uint8_t RTR; /*!< Specifies the type of frame for the message that will + be transmitted. This parameter can be a value of + @ref CAN_remote_transmission_request */ + + uint8_t DLC; /*!< Specifies the length of the frame that will be + transmitted. This parameter can be a value between + 0 to 8 */ + + uint8_t Data[8]; /*!< Contains the data to be transmitted. It ranges from 0 + to 0xFF. */ +} CanTxMsg; + +/** + * @brief CAN Rx message structure definition + */ + +typedef struct +{ + uint32_t StdId; /*!< Specifies the standard identifier. + This parameter can be a value between 0 to 0x7FF. */ + + uint32_t ExtId; /*!< Specifies the extended identifier. + This parameter can be a value between 0 to 0x1FFFFFFF. */ + + uint8_t IDE; /*!< Specifies the type of identifier for the message that + will be received. This parameter can be a value of + @ref CAN_identifier_type */ + + uint8_t RTR; /*!< Specifies the type of frame for the received message. + This parameter can be a value of + @ref CAN_remote_transmission_request */ + + uint8_t DLC; /*!< Specifies the length of the frame that will be received. + This parameter can be a value between 0 to 8 */ + + uint8_t Data[8]; /*!< Contains the data to be received. It ranges from 0 to + 0xFF. */ + + uint8_t FMI; /*!< Specifies the index of the filter the message stored in + the mailbox passes through. This parameter can be a + value between 0 to 0xFF */ +} CanRxMsg; + +/** + * @} + */ + +/** @defgroup CAN_Exported_Constants + * @{ + */ + +/** @defgroup CAN_sleep_constants + * @{ + */ + +#define CAN_InitStatus_Failed ((uint8_t)0x00) /*!< CAN initialization failed */ +#define CAN_InitStatus_Success ((uint8_t)0x01) /*!< CAN initialization OK */ + +/** + * @} + */ + +/** @defgroup CAN_Mode + * @{ + */ + +#define CAN_Mode_Normal ((uint8_t)0x00) /*!< normal mode */ +#define CAN_Mode_LoopBack ((uint8_t)0x01) /*!< loopback mode */ +#define CAN_Mode_Silent ((uint8_t)0x02) /*!< silent mode */ +#define CAN_Mode_Silent_LoopBack ((uint8_t)0x03) /*!< loopback combined with silent mode */ + +#define IS_CAN_MODE(MODE) (((MODE) == CAN_Mode_Normal) || \ + ((MODE) == CAN_Mode_LoopBack)|| \ + ((MODE) == CAN_Mode_Silent) || \ + ((MODE) == CAN_Mode_Silent_LoopBack)) +/** + * @} + */ + + +/** + * @defgroup CAN_Operating_Mode + * @{ + */ +#define CAN_OperatingMode_Initialization ((uint8_t)0x00) /*!< Initialization mode */ +#define CAN_OperatingMode_Normal ((uint8_t)0x01) /*!< Normal mode */ +#define CAN_OperatingMode_Sleep ((uint8_t)0x02) /*!< sleep mode */ + + +#define IS_CAN_OPERATING_MODE(MODE) (((MODE) == CAN_OperatingMode_Initialization) ||\ + ((MODE) == CAN_OperatingMode_Normal)|| \ + ((MODE) == CAN_OperatingMode_Sleep)) +/** + * @} + */ + +/** + * @defgroup CAN_Mode_Status + * @{ + */ + +#define CAN_ModeStatus_Failed ((uint8_t)0x00) /*!< CAN entering the specific mode failed */ +#define CAN_ModeStatus_Success ((uint8_t)!CAN_ModeStatus_Failed) /*!< CAN entering the specific mode Succeed */ + + +/** + * @} + */ + +/** @defgroup CAN_synchronisation_jump_width + * @{ + */ + +#define CAN_SJW_1tq ((uint8_t)0x00) /*!< 1 time quantum */ +#define CAN_SJW_2tq ((uint8_t)0x01) /*!< 2 time quantum */ +#define CAN_SJW_3tq ((uint8_t)0x02) /*!< 3 time quantum */ +#define CAN_SJW_4tq ((uint8_t)0x03) /*!< 4 time quantum */ + +#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1tq) || ((SJW) == CAN_SJW_2tq)|| \ + ((SJW) == CAN_SJW_3tq) || ((SJW) == CAN_SJW_4tq)) +/** + * @} + */ + +/** @defgroup CAN_time_quantum_in_bit_segment_1 + * @{ + */ + +#define CAN_BS1_1tq ((uint8_t)0x00) /*!< 1 time quantum */ +#define CAN_BS1_2tq ((uint8_t)0x01) /*!< 2 time quantum */ +#define CAN_BS1_3tq ((uint8_t)0x02) /*!< 3 time quantum */ +#define CAN_BS1_4tq ((uint8_t)0x03) /*!< 4 time quantum */ +#define CAN_BS1_5tq ((uint8_t)0x04) /*!< 5 time quantum */ +#define CAN_BS1_6tq ((uint8_t)0x05) /*!< 6 time quantum */ +#define CAN_BS1_7tq ((uint8_t)0x06) /*!< 7 time quantum */ +#define CAN_BS1_8tq ((uint8_t)0x07) /*!< 8 time quantum */ +#define CAN_BS1_9tq ((uint8_t)0x08) /*!< 9 time quantum */ +#define CAN_BS1_10tq ((uint8_t)0x09) /*!< 10 time quantum */ +#define CAN_BS1_11tq ((uint8_t)0x0A) /*!< 11 time quantum */ +#define CAN_BS1_12tq ((uint8_t)0x0B) /*!< 12 time quantum */ +#define CAN_BS1_13tq ((uint8_t)0x0C) /*!< 13 time quantum */ +#define CAN_BS1_14tq ((uint8_t)0x0D) /*!< 14 time quantum */ +#define CAN_BS1_15tq ((uint8_t)0x0E) /*!< 15 time quantum */ +#define CAN_BS1_16tq ((uint8_t)0x0F) /*!< 16 time quantum */ + +#define IS_CAN_BS1(BS1) ((BS1) <= CAN_BS1_16tq) +/** + * @} + */ + +/** @defgroup CAN_time_quantum_in_bit_segment_2 + * @{ + */ + +#define CAN_BS2_1tq ((uint8_t)0x00) /*!< 1 time quantum */ +#define CAN_BS2_2tq ((uint8_t)0x01) /*!< 2 time quantum */ +#define CAN_BS2_3tq ((uint8_t)0x02) /*!< 3 time quantum */ +#define CAN_BS2_4tq ((uint8_t)0x03) /*!< 4 time quantum */ +#define CAN_BS2_5tq ((uint8_t)0x04) /*!< 5 time quantum */ +#define CAN_BS2_6tq ((uint8_t)0x05) /*!< 6 time quantum */ +#define CAN_BS2_7tq ((uint8_t)0x06) /*!< 7 time quantum */ +#define CAN_BS2_8tq ((uint8_t)0x07) /*!< 8 time quantum */ + +#define IS_CAN_BS2(BS2) ((BS2) <= CAN_BS2_8tq) + +/** + * @} + */ + +/** @defgroup CAN_clock_prescaler + * @{ + */ + +#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1) && ((PRESCALER) <= 1024)) + +/** + * @} + */ + +/** @defgroup CAN_filter_number + * @{ + */ +#ifndef STM32F10X_CL + #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 13) +#else + #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27) +#endif /* STM32F10X_CL */ +/** + * @} + */ + +/** @defgroup CAN_filter_mode + * @{ + */ + +#define CAN_FilterMode_IdMask ((uint8_t)0x00) /*!< identifier/mask mode */ +#define CAN_FilterMode_IdList ((uint8_t)0x01) /*!< identifier list mode */ + +#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FilterMode_IdMask) || \ + ((MODE) == CAN_FilterMode_IdList)) +/** + * @} + */ + +/** @defgroup CAN_filter_scale + * @{ + */ + +#define CAN_FilterScale_16bit ((uint8_t)0x00) /*!< Two 16-bit filters */ +#define CAN_FilterScale_32bit ((uint8_t)0x01) /*!< One 32-bit filter */ + +#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FilterScale_16bit) || \ + ((SCALE) == CAN_FilterScale_32bit)) + +/** + * @} + */ + +/** @defgroup CAN_filter_FIFO + * @{ + */ + +#define CAN_Filter_FIFO0 ((uint8_t)0x00) /*!< Filter FIFO 0 assignment for filter x */ +#define CAN_Filter_FIFO1 ((uint8_t)0x01) /*!< Filter FIFO 1 assignment for filter x */ +#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FilterFIFO0) || \ + ((FIFO) == CAN_FilterFIFO1)) +/** + * @} + */ + +/** @defgroup Start_bank_filter_for_slave_CAN + * @{ + */ +#define IS_CAN_BANKNUMBER(BANKNUMBER) (((BANKNUMBER) >= 1) && ((BANKNUMBER) <= 27)) +/** + * @} + */ + +/** @defgroup CAN_Tx + * @{ + */ + +#define IS_CAN_TRANSMITMAILBOX(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= ((uint8_t)0x02)) +#define IS_CAN_STDID(STDID) ((STDID) <= ((uint32_t)0x7FF)) +#define IS_CAN_EXTID(EXTID) ((EXTID) <= ((uint32_t)0x1FFFFFFF)) +#define IS_CAN_DLC(DLC) ((DLC) <= ((uint8_t)0x08)) + +/** + * @} + */ + +/** @defgroup CAN_identifier_type + * @{ + */ + +#define CAN_Id_Standard ((uint32_t)0x00000000) /*!< Standard Id */ +#define CAN_Id_Extended ((uint32_t)0x00000004) /*!< Extended Id */ +#define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_Id_Standard) || \ + ((IDTYPE) == CAN_Id_Extended)) +/** + * @} + */ + +/** @defgroup CAN_remote_transmission_request + * @{ + */ + +#define CAN_RTR_Data ((uint32_t)0x00000000) /*!< Data frame */ +#define CAN_RTR_Remote ((uint32_t)0x00000002) /*!< Remote frame */ +#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_Data) || ((RTR) == CAN_RTR_Remote)) + +/** + * @} + */ + +/** @defgroup CAN_transmit_constants + * @{ + */ + +#define CAN_TxStatus_Failed ((uint8_t)0x00)/*!< CAN transmission failed */ +#define CAN_TxStatus_Ok ((uint8_t)0x01) /*!< CAN transmission succeeded */ +#define CAN_TxStatus_Pending ((uint8_t)0x02) /*!< CAN transmission pending */ +#define CAN_TxStatus_NoMailBox ((uint8_t)0x04) /*!< CAN cell did not provide an empty mailbox */ + +/** + * @} + */ + +/** @defgroup CAN_receive_FIFO_number_constants + * @{ + */ + +#define CAN_FIFO0 ((uint8_t)0x00) /*!< CAN FIFO 0 used to receive */ +#define CAN_FIFO1 ((uint8_t)0x01) /*!< CAN FIFO 1 used to receive */ + +#define IS_CAN_FIFO(FIFO) (((FIFO) == CAN_FIFO0) || ((FIFO) == CAN_FIFO1)) + +/** + * @} + */ + +/** @defgroup CAN_sleep_constants + * @{ + */ + +#define CAN_Sleep_Failed ((uint8_t)0x00) /*!< CAN did not enter the sleep mode */ +#define CAN_Sleep_Ok ((uint8_t)0x01) /*!< CAN entered the sleep mode */ + +/** + * @} + */ + +/** @defgroup CAN_wake_up_constants + * @{ + */ + +#define CAN_WakeUp_Failed ((uint8_t)0x00) /*!< CAN did not leave the sleep mode */ +#define CAN_WakeUp_Ok ((uint8_t)0x01) /*!< CAN leaved the sleep mode */ + +/** + * @} + */ + +/** + * @defgroup CAN_Error_Code_constants + * @{ + */ + +#define CAN_ErrorCode_NoErr ((uint8_t)0x00) /*!< No Error */ +#define CAN_ErrorCode_StuffErr ((uint8_t)0x10) /*!< Stuff Error */ +#define CAN_ErrorCode_FormErr ((uint8_t)0x20) /*!< Form Error */ +#define CAN_ErrorCode_ACKErr ((uint8_t)0x30) /*!< Acknowledgment Error */ +#define CAN_ErrorCode_BitRecessiveErr ((uint8_t)0x40) /*!< Bit Recessive Error */ +#define CAN_ErrorCode_BitDominantErr ((uint8_t)0x50) /*!< Bit Dominant Error */ +#define CAN_ErrorCode_CRCErr ((uint8_t)0x60) /*!< CRC Error */ +#define CAN_ErrorCode_SoftwareSetErr ((uint8_t)0x70) /*!< Software Set Error */ + + +/** + * @} + */ + +/** @defgroup CAN_flags + * @{ + */ +/* If the flag is 0x3XXXXXXX, it means that it can be used with CAN_GetFlagStatus() + and CAN_ClearFlag() functions. */ +/* If the flag is 0x1XXXXXXX, it means that it can only be used with CAN_GetFlagStatus() function. */ + +/* Transmit Flags */ +#define CAN_FLAG_RQCP0 ((uint32_t)0x38000001) /*!< Request MailBox0 Flag */ +#define CAN_FLAG_RQCP1 ((uint32_t)0x38000100) /*!< Request MailBox1 Flag */ +#define CAN_FLAG_RQCP2 ((uint32_t)0x38010000) /*!< Request MailBox2 Flag */ + +/* Receive Flags */ +#define CAN_FLAG_FMP0 ((uint32_t)0x12000003) /*!< FIFO 0 Message Pending Flag */ +#define CAN_FLAG_FF0 ((uint32_t)0x32000008) /*!< FIFO 0 Full Flag */ +#define CAN_FLAG_FOV0 ((uint32_t)0x32000010) /*!< FIFO 0 Overrun Flag */ +#define CAN_FLAG_FMP1 ((uint32_t)0x14000003) /*!< FIFO 1 Message Pending Flag */ +#define CAN_FLAG_FF1 ((uint32_t)0x34000008) /*!< FIFO 1 Full Flag */ +#define CAN_FLAG_FOV1 ((uint32_t)0x34000010) /*!< FIFO 1 Overrun Flag */ + +/* Operating Mode Flags */ +#define CAN_FLAG_WKU ((uint32_t)0x31000008) /*!< Wake up Flag */ +#define CAN_FLAG_SLAK ((uint32_t)0x31000012) /*!< Sleep acknowledge Flag */ +/* Note: When SLAK intterupt is disabled (SLKIE=0), no polling on SLAKI is possible. + In this case the SLAK bit can be polled.*/ + +/* Error Flags */ +#define CAN_FLAG_EWG ((uint32_t)0x10F00001) /*!< Error Warning Flag */ +#define CAN_FLAG_EPV ((uint32_t)0x10F00002) /*!< Error Passive Flag */ +#define CAN_FLAG_BOF ((uint32_t)0x10F00004) /*!< Bus-Off Flag */ +#define CAN_FLAG_LEC ((uint32_t)0x30F00070) /*!< Last error code Flag */ + +#define IS_CAN_GET_FLAG(FLAG) (((FLAG) == CAN_FLAG_LEC) || ((FLAG) == CAN_FLAG_BOF) || \ + ((FLAG) == CAN_FLAG_EPV) || ((FLAG) == CAN_FLAG_EWG) || \ + ((FLAG) == CAN_FLAG_WKU) || ((FLAG) == CAN_FLAG_FOV0) || \ + ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_FMP0) || \ + ((FLAG) == CAN_FLAG_FOV1) || ((FLAG) == CAN_FLAG_FF1) || \ + ((FLAG) == CAN_FLAG_FMP1) || ((FLAG) == CAN_FLAG_RQCP2) || \ + ((FLAG) == CAN_FLAG_RQCP1)|| ((FLAG) == CAN_FLAG_RQCP0) || \ + ((FLAG) == CAN_FLAG_SLAK )) + +#define IS_CAN_CLEAR_FLAG(FLAG)(((FLAG) == CAN_FLAG_LEC) || ((FLAG) == CAN_FLAG_RQCP2) || \ + ((FLAG) == CAN_FLAG_RQCP1) || ((FLAG) == CAN_FLAG_RQCP0) || \ + ((FLAG) == CAN_FLAG_FF0) || ((FLAG) == CAN_FLAG_FOV0) ||\ + ((FLAG) == CAN_FLAG_FF1) || ((FLAG) == CAN_FLAG_FOV1) || \ + ((FLAG) == CAN_FLAG_WKU) || ((FLAG) == CAN_FLAG_SLAK)) +/** + * @} + */ + + +/** @defgroup CAN_interrupts + * @{ + */ + + + +#define CAN_IT_TME ((uint32_t)0x00000001) /*!< Transmit mailbox empty Interrupt*/ + +/* Receive Interrupts */ +#define CAN_IT_FMP0 ((uint32_t)0x00000002) /*!< FIFO 0 message pending Interrupt*/ +#define CAN_IT_FF0 ((uint32_t)0x00000004) /*!< FIFO 0 full Interrupt*/ +#define CAN_IT_FOV0 ((uint32_t)0x00000008) /*!< FIFO 0 overrun Interrupt*/ +#define CAN_IT_FMP1 ((uint32_t)0x00000010) /*!< FIFO 1 message pending Interrupt*/ +#define CAN_IT_FF1 ((uint32_t)0x00000020) /*!< FIFO 1 full Interrupt*/ +#define CAN_IT_FOV1 ((uint32_t)0x00000040) /*!< FIFO 1 overrun Interrupt*/ + +/* Operating Mode Interrupts */ +#define CAN_IT_WKU ((uint32_t)0x00010000) /*!< Wake-up Interrupt*/ +#define CAN_IT_SLK ((uint32_t)0x00020000) /*!< Sleep acknowledge Interrupt*/ + +/* Error Interrupts */ +#define CAN_IT_EWG ((uint32_t)0x00000100) /*!< Error warning Interrupt*/ +#define CAN_IT_EPV ((uint32_t)0x00000200) /*!< Error passive Interrupt*/ +#define CAN_IT_BOF ((uint32_t)0x00000400) /*!< Bus-off Interrupt*/ +#define CAN_IT_LEC ((uint32_t)0x00000800) /*!< Last error code Interrupt*/ +#define CAN_IT_ERR ((uint32_t)0x00008000) /*!< Error Interrupt*/ + +/* Flags named as Interrupts : kept only for FW compatibility */ +#define CAN_IT_RQCP0 CAN_IT_TME +#define CAN_IT_RQCP1 CAN_IT_TME +#define CAN_IT_RQCP2 CAN_IT_TME + + +#define IS_CAN_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FMP0) ||\ + ((IT) == CAN_IT_FF0) || ((IT) == CAN_IT_FOV0) ||\ + ((IT) == CAN_IT_FMP1) || ((IT) == CAN_IT_FF1) ||\ + ((IT) == CAN_IT_FOV1) || ((IT) == CAN_IT_EWG) ||\ + ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\ + ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\ + ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK)) + +#define IS_CAN_CLEAR_IT(IT) (((IT) == CAN_IT_TME) || ((IT) == CAN_IT_FF0) ||\ + ((IT) == CAN_IT_FOV0)|| ((IT) == CAN_IT_FF1) ||\ + ((IT) == CAN_IT_FOV1)|| ((IT) == CAN_IT_EWG) ||\ + ((IT) == CAN_IT_EPV) || ((IT) == CAN_IT_BOF) ||\ + ((IT) == CAN_IT_LEC) || ((IT) == CAN_IT_ERR) ||\ + ((IT) == CAN_IT_WKU) || ((IT) == CAN_IT_SLK)) + +/** + * @} + */ + +/** @defgroup CAN_Legacy + * @{ + */ +#define CANINITFAILED CAN_InitStatus_Failed +#define CANINITOK CAN_InitStatus_Success +#define CAN_FilterFIFO0 CAN_Filter_FIFO0 +#define CAN_FilterFIFO1 CAN_Filter_FIFO1 +#define CAN_ID_STD CAN_Id_Standard +#define CAN_ID_EXT CAN_Id_Extended +#define CAN_RTR_DATA CAN_RTR_Data +#define CAN_RTR_REMOTE CAN_RTR_Remote +#define CANTXFAILE CAN_TxStatus_Failed +#define CANTXOK CAN_TxStatus_Ok +#define CANTXPENDING CAN_TxStatus_Pending +#define CAN_NO_MB CAN_TxStatus_NoMailBox +#define CANSLEEPFAILED CAN_Sleep_Failed +#define CANSLEEPOK CAN_Sleep_Ok +#define CANWAKEUPFAILED CAN_WakeUp_Failed +#define CANWAKEUPOK CAN_WakeUp_Ok + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup CAN_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions + * @{ + */ +/* Function used to set the CAN configuration to the default reset state *****/ +void CAN_DeInit(CAN_TypeDef* CANx); + +/* Initialization and Configuration functions *********************************/ +uint8_t CAN_Init(CAN_TypeDef* CANx, CAN_InitTypeDef* CAN_InitStruct); +void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct); +void CAN_StructInit(CAN_InitTypeDef* CAN_InitStruct); +void CAN_SlaveStartBank(uint8_t CAN_BankNumber); +void CAN_DBGFreeze(CAN_TypeDef* CANx, FunctionalState NewState); +void CAN_TTComModeCmd(CAN_TypeDef* CANx, FunctionalState NewState); + +/* Transmit functions *********************************************************/ +uint8_t CAN_Transmit(CAN_TypeDef* CANx, CanTxMsg* TxMessage); +uint8_t CAN_TransmitStatus(CAN_TypeDef* CANx, uint8_t TransmitMailbox); +void CAN_CancelTransmit(CAN_TypeDef* CANx, uint8_t Mailbox); + +/* Receive functions **********************************************************/ +void CAN_Receive(CAN_TypeDef* CANx, uint8_t FIFONumber, CanRxMsg* RxMessage); +void CAN_FIFORelease(CAN_TypeDef* CANx, uint8_t FIFONumber); +uint8_t CAN_MessagePending(CAN_TypeDef* CANx, uint8_t FIFONumber); + + +/* Operation modes functions **************************************************/ +uint8_t CAN_OperatingModeRequest(CAN_TypeDef* CANx, uint8_t CAN_OperatingMode); +uint8_t CAN_Sleep(CAN_TypeDef* CANx); +uint8_t CAN_WakeUp(CAN_TypeDef* CANx); + +/* Error management functions *************************************************/ +uint8_t CAN_GetLastErrorCode(CAN_TypeDef* CANx); +uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef* CANx); +uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef* CANx); + +/* Interrupts and flags management functions **********************************/ +void CAN_ITConfig(CAN_TypeDef* CANx, uint32_t CAN_IT, FunctionalState NewState); +FlagStatus CAN_GetFlagStatus(CAN_TypeDef* CANx, uint32_t CAN_FLAG); +void CAN_ClearFlag(CAN_TypeDef* CANx, uint32_t CAN_FLAG); +ITStatus CAN_GetITStatus(CAN_TypeDef* CANx, uint32_t CAN_IT); +void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_CAN_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_cec.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_cec.h new file mode 100644 index 0000000..1e6b75e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_cec.h @@ -0,0 +1,208 @@ +/** + ****************************************************************************** + * @file stm32f10x_cec.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the CEC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_CEC_H +#define __STM32F10x_CEC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup CEC + * @{ + */ + + +/** @defgroup CEC_Exported_Types + * @{ + */ + +/** + * @brief CEC Init structure definition + */ +typedef struct +{ + uint16_t CEC_BitTimingMode; /*!< Configures the CEC Bit Timing Error Mode. + This parameter can be a value of @ref CEC_BitTiming_Mode */ + uint16_t CEC_BitPeriodMode; /*!< Configures the CEC Bit Period Error Mode. + This parameter can be a value of @ref CEC_BitPeriod_Mode */ +}CEC_InitTypeDef; + +/** + * @} + */ + +/** @defgroup CEC_Exported_Constants + * @{ + */ + +/** @defgroup CEC_BitTiming_Mode + * @{ + */ +#define CEC_BitTimingStdMode ((uint16_t)0x00) /*!< Bit timing error Standard Mode */ +#define CEC_BitTimingErrFreeMode CEC_CFGR_BTEM /*!< Bit timing error Free Mode */ + +#define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \ + ((MODE) == CEC_BitTimingErrFreeMode)) +/** + * @} + */ + +/** @defgroup CEC_BitPeriod_Mode + * @{ + */ +#define CEC_BitPeriodStdMode ((uint16_t)0x00) /*!< Bit period error Standard Mode */ +#define CEC_BitPeriodFlexibleMode CEC_CFGR_BPEM /*!< Bit period error Flexible Mode */ + +#define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \ + ((MODE) == CEC_BitPeriodFlexibleMode)) +/** + * @} + */ + + +/** @defgroup CEC_interrupts_definition + * @{ + */ +#define CEC_IT_TERR CEC_CSR_TERR +#define CEC_IT_TBTRF CEC_CSR_TBTRF +#define CEC_IT_RERR CEC_CSR_RERR +#define CEC_IT_RBTF CEC_CSR_RBTF +#define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \ + ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF)) +/** + * @} + */ + + +/** @defgroup CEC_Own_Address + * @{ + */ +#define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10) +/** + * @} + */ + +/** @defgroup CEC_Prescaler + * @{ + */ +#define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF) + +/** + * @} + */ + +/** @defgroup CEC_flags_definition + * @{ + */ + +/** + * @brief ESR register flags + */ +#define CEC_FLAG_BTE ((uint32_t)0x10010000) +#define CEC_FLAG_BPE ((uint32_t)0x10020000) +#define CEC_FLAG_RBTFE ((uint32_t)0x10040000) +#define CEC_FLAG_SBE ((uint32_t)0x10080000) +#define CEC_FLAG_ACKE ((uint32_t)0x10100000) +#define CEC_FLAG_LINE ((uint32_t)0x10200000) +#define CEC_FLAG_TBTFE ((uint32_t)0x10400000) + +/** + * @brief CSR register flags + */ +#define CEC_FLAG_TEOM ((uint32_t)0x00000002) +#define CEC_FLAG_TERR ((uint32_t)0x00000004) +#define CEC_FLAG_TBTRF ((uint32_t)0x00000008) +#define CEC_FLAG_RSOM ((uint32_t)0x00000010) +#define CEC_FLAG_REOM ((uint32_t)0x00000020) +#define CEC_FLAG_RERR ((uint32_t)0x00000040) +#define CEC_FLAG_RBTF ((uint32_t)0x00000080) + +#define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00)) + +#define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \ + ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \ + ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \ + ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \ + ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \ + ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \ + ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF)) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup CEC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup CEC_Exported_Functions + * @{ + */ +void CEC_DeInit(void); +void CEC_Init(CEC_InitTypeDef* CEC_InitStruct); +void CEC_Cmd(FunctionalState NewState); +void CEC_ITConfig(FunctionalState NewState); +void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress); +void CEC_SetPrescaler(uint16_t CEC_Prescaler); +void CEC_SendDataByte(uint8_t Data); +uint8_t CEC_ReceiveDataByte(void); +void CEC_StartOfMessage(void); +void CEC_EndOfMessageCmd(FunctionalState NewState); +FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG); +void CEC_ClearFlag(uint32_t CEC_FLAG); +ITStatus CEC_GetITStatus(uint8_t CEC_IT); +void CEC_ClearITPendingBit(uint16_t CEC_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_CEC_H */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h new file mode 100644 index 0000000..9f89cd2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h @@ -0,0 +1,92 @@ +/** + ****************************************************************************** + * @file stm32f10x_crc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the CRC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_CRC_H +#define __STM32F10x_CRC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup CRC + * @{ + */ + +/** @defgroup CRC_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Exported_Constants + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Exported_Functions + * @{ + */ + +void CRC_ResetDR(void); +uint32_t CRC_CalcCRC(uint32_t Data); +uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); +uint32_t CRC_GetCRC(void); +void CRC_SetIDRegister(uint8_t IDValue); +uint8_t CRC_GetIDRegister(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_CRC_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dac.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dac.h new file mode 100644 index 0000000..bca0216 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dac.h @@ -0,0 +1,315 @@ +/** + ****************************************************************************** + * @file stm32f10x_dac.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the DAC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_DAC_H +#define __STM32F10x_DAC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup DAC + * @{ + */ + +/** @defgroup DAC_Exported_Types + * @{ + */ + +/** + * @brief DAC Init structure definition + */ + +typedef struct +{ + uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. + This parameter can be a value of @ref DAC_trigger_selection */ + + uint32_t DAC_WaveGeneration; /*!< Specifies whether DAC channel noise waves or triangle waves + are generated, or whether no wave is generated. + This parameter can be a value of @ref DAC_wave_generation */ + + uint32_t DAC_LFSRUnmask_TriangleAmplitude; /*!< Specifies the LFSR mask for noise wave generation or + the maximum amplitude triangle generation for the DAC channel. + This parameter can be a value of @ref DAC_lfsrunmask_triangleamplitude */ + + uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. + This parameter can be a value of @ref DAC_output_buffer */ +}DAC_InitTypeDef; + +/** + * @} + */ + +/** @defgroup DAC_Exported_Constants + * @{ + */ + +/** @defgroup DAC_trigger_selection + * @{ + */ + +#define DAC_Trigger_None ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register + has been loaded, and not by external trigger */ +#define DAC_Trigger_T6_TRGO ((uint32_t)0x00000004) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_T8_TRGO ((uint32_t)0x0000000C) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel + only in High-density devices*/ +#define DAC_Trigger_T3_TRGO ((uint32_t)0x0000000C) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel + only in Connectivity line, Medium-density and Low-density Value Line devices */ +#define DAC_Trigger_T7_TRGO ((uint32_t)0x00000014) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_T5_TRGO ((uint32_t)0x0000001C) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_T15_TRGO ((uint32_t)0x0000001C) /*!< TIM15 TRGO selected as external conversion trigger for DAC channel + only in Medium-density and Low-density Value Line devices*/ +#define DAC_Trigger_T2_TRGO ((uint32_t)0x00000024) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_T4_TRGO ((uint32_t)0x0000002C) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_Ext_IT9 ((uint32_t)0x00000034) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ +#define DAC_Trigger_Software ((uint32_t)0x0000003C) /*!< Conversion started by software trigger for DAC channel */ + +#define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_Trigger_None) || \ + ((TRIGGER) == DAC_Trigger_T6_TRGO) || \ + ((TRIGGER) == DAC_Trigger_T8_TRGO) || \ + ((TRIGGER) == DAC_Trigger_T7_TRGO) || \ + ((TRIGGER) == DAC_Trigger_T5_TRGO) || \ + ((TRIGGER) == DAC_Trigger_T2_TRGO) || \ + ((TRIGGER) == DAC_Trigger_T4_TRGO) || \ + ((TRIGGER) == DAC_Trigger_Ext_IT9) || \ + ((TRIGGER) == DAC_Trigger_Software)) + +/** + * @} + */ + +/** @defgroup DAC_wave_generation + * @{ + */ + +#define DAC_WaveGeneration_None ((uint32_t)0x00000000) +#define DAC_WaveGeneration_Noise ((uint32_t)0x00000040) +#define DAC_WaveGeneration_Triangle ((uint32_t)0x00000080) +#define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WaveGeneration_None) || \ + ((WAVE) == DAC_WaveGeneration_Noise) || \ + ((WAVE) == DAC_WaveGeneration_Triangle)) +/** + * @} + */ + +/** @defgroup DAC_lfsrunmask_triangleamplitude + * @{ + */ + +#define DAC_LFSRUnmask_Bit0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ +#define DAC_LFSRUnmask_Bits1_0 ((uint32_t)0x00000100) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits2_0 ((uint32_t)0x00000200) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits3_0 ((uint32_t)0x00000300) /*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits4_0 ((uint32_t)0x00000400) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits5_0 ((uint32_t)0x00000500) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits6_0 ((uint32_t)0x00000600) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits7_0 ((uint32_t)0x00000700) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits8_0 ((uint32_t)0x00000800) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits9_0 ((uint32_t)0x00000900) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits10_0 ((uint32_t)0x00000A00) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ +#define DAC_LFSRUnmask_Bits11_0 ((uint32_t)0x00000B00) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ +#define DAC_TriangleAmplitude_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ +#define DAC_TriangleAmplitude_3 ((uint32_t)0x00000100) /*!< Select max triangle amplitude of 3 */ +#define DAC_TriangleAmplitude_7 ((uint32_t)0x00000200) /*!< Select max triangle amplitude of 7 */ +#define DAC_TriangleAmplitude_15 ((uint32_t)0x00000300) /*!< Select max triangle amplitude of 15 */ +#define DAC_TriangleAmplitude_31 ((uint32_t)0x00000400) /*!< Select max triangle amplitude of 31 */ +#define DAC_TriangleAmplitude_63 ((uint32_t)0x00000500) /*!< Select max triangle amplitude of 63 */ +#define DAC_TriangleAmplitude_127 ((uint32_t)0x00000600) /*!< Select max triangle amplitude of 127 */ +#define DAC_TriangleAmplitude_255 ((uint32_t)0x00000700) /*!< Select max triangle amplitude of 255 */ +#define DAC_TriangleAmplitude_511 ((uint32_t)0x00000800) /*!< Select max triangle amplitude of 511 */ +#define DAC_TriangleAmplitude_1023 ((uint32_t)0x00000900) /*!< Select max triangle amplitude of 1023 */ +#define DAC_TriangleAmplitude_2047 ((uint32_t)0x00000A00) /*!< Select max triangle amplitude of 2047 */ +#define DAC_TriangleAmplitude_4095 ((uint32_t)0x00000B00) /*!< Select max triangle amplitude of 4095 */ + +#define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUnmask_Bit0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits1_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits2_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits3_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits4_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits5_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits6_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits7_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits8_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits9_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits10_0) || \ + ((VALUE) == DAC_LFSRUnmask_Bits11_0) || \ + ((VALUE) == DAC_TriangleAmplitude_1) || \ + ((VALUE) == DAC_TriangleAmplitude_3) || \ + ((VALUE) == DAC_TriangleAmplitude_7) || \ + ((VALUE) == DAC_TriangleAmplitude_15) || \ + ((VALUE) == DAC_TriangleAmplitude_31) || \ + ((VALUE) == DAC_TriangleAmplitude_63) || \ + ((VALUE) == DAC_TriangleAmplitude_127) || \ + ((VALUE) == DAC_TriangleAmplitude_255) || \ + ((VALUE) == DAC_TriangleAmplitude_511) || \ + ((VALUE) == DAC_TriangleAmplitude_1023) || \ + ((VALUE) == DAC_TriangleAmplitude_2047) || \ + ((VALUE) == DAC_TriangleAmplitude_4095)) +/** + * @} + */ + +/** @defgroup DAC_output_buffer + * @{ + */ + +#define DAC_OutputBuffer_Enable ((uint32_t)0x00000000) +#define DAC_OutputBuffer_Disable ((uint32_t)0x00000002) +#define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OutputBuffer_Enable) || \ + ((STATE) == DAC_OutputBuffer_Disable)) +/** + * @} + */ + +/** @defgroup DAC_Channel_selection + * @{ + */ + +#define DAC_Channel_1 ((uint32_t)0x00000000) +#define DAC_Channel_2 ((uint32_t)0x00000010) +#define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_Channel_1) || \ + ((CHANNEL) == DAC_Channel_2)) +/** + * @} + */ + +/** @defgroup DAC_data_alignment + * @{ + */ + +#define DAC_Align_12b_R ((uint32_t)0x00000000) +#define DAC_Align_12b_L ((uint32_t)0x00000004) +#define DAC_Align_8b_R ((uint32_t)0x00000008) +#define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_Align_12b_R) || \ + ((ALIGN) == DAC_Align_12b_L) || \ + ((ALIGN) == DAC_Align_8b_R)) +/** + * @} + */ + +/** @defgroup DAC_wave_generation + * @{ + */ + +#define DAC_Wave_Noise ((uint32_t)0x00000040) +#define DAC_Wave_Triangle ((uint32_t)0x00000080) +#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_Wave_Noise) || \ + ((WAVE) == DAC_Wave_Triangle)) +/** + * @} + */ + +/** @defgroup DAC_data + * @{ + */ + +#define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) +/** + * @} + */ +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +/** @defgroup DAC_interrupts_definition + * @{ + */ + +#define DAC_IT_DMAUDR ((uint32_t)0x00002000) +#define IS_DAC_IT(IT) (((IT) == DAC_IT_DMAUDR)) + +/** + * @} + */ + +/** @defgroup DAC_flags_definition + * @{ + */ + +#define DAC_FLAG_DMAUDR ((uint32_t)0x00002000) +#define IS_DAC_FLAG(FLAG) (((FLAG) == DAC_FLAG_DMAUDR)) + +/** + * @} + */ +#endif + +/** + * @} + */ + +/** @defgroup DAC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DAC_Exported_Functions + * @{ + */ + +void DAC_DeInit(void); +void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct); +void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct); +void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState); +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState); +#endif +void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState); +void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState); +void DAC_DualSoftwareTriggerCmd(FunctionalState NewState); +void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState); +void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data); +void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data); +void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1); +uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel); +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG); +void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG); +ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT); +void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_DAC_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dbgmcu.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dbgmcu.h new file mode 100644 index 0000000..00872bf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dbgmcu.h @@ -0,0 +1,117 @@ +/** + ****************************************************************************** + * @file stm32f10x_dbgmcu.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the DBGMCU + * firmware library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_DBGMCU_H +#define __STM32F10x_DBGMCU_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup DBGMCU + * @{ + */ + +/** @defgroup DBGMCU_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Exported_Constants + * @{ + */ + +#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)0x00000400) +#define DBGMCU_TIM2_STOP ((uint32_t)0x00000800) +#define DBGMCU_TIM3_STOP ((uint32_t)0x00001000) +#define DBGMCU_TIM4_STOP ((uint32_t)0x00002000) +#define DBGMCU_CAN1_STOP ((uint32_t)0x00004000) +#define DBGMCU_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000) +#define DBGMCU_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000) +#define DBGMCU_TIM8_STOP ((uint32_t)0x00020000) +#define DBGMCU_TIM5_STOP ((uint32_t)0x00040000) +#define DBGMCU_TIM6_STOP ((uint32_t)0x00080000) +#define DBGMCU_TIM7_STOP ((uint32_t)0x00100000) +#define DBGMCU_CAN2_STOP ((uint32_t)0x00200000) +#define DBGMCU_TIM15_STOP ((uint32_t)0x00400000) +#define DBGMCU_TIM16_STOP ((uint32_t)0x00800000) +#define DBGMCU_TIM17_STOP ((uint32_t)0x01000000) +#define DBGMCU_TIM12_STOP ((uint32_t)0x02000000) +#define DBGMCU_TIM13_STOP ((uint32_t)0x04000000) +#define DBGMCU_TIM14_STOP ((uint32_t)0x08000000) +#define DBGMCU_TIM9_STOP ((uint32_t)0x10000000) +#define DBGMCU_TIM10_STOP ((uint32_t)0x20000000) +#define DBGMCU_TIM11_STOP ((uint32_t)0x40000000) + +#define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0x800000F8) == 0x00) && ((PERIPH) != 0x00)) +/** + * @} + */ + +/** @defgroup DBGMCU_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Exported_Functions + * @{ + */ + +uint32_t DBGMCU_GetREVID(void); +uint32_t DBGMCU_GetDEVID(void); +void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_DBGMCU_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dma.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dma.h new file mode 100644 index 0000000..f1a8cf9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dma.h @@ -0,0 +1,437 @@ +/** + ****************************************************************************** + * @file stm32f10x_dma.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the DMA firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_DMA_H +#define __STM32F10x_DMA_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup DMA + * @{ + */ + +/** @defgroup DMA_Exported_Types + * @{ + */ + +/** + * @brief DMA Init structure definition + */ + +typedef struct +{ + uint32_t DMA_PeripheralBaseAddr; /*!< Specifies the peripheral base address for DMAy Channelx. */ + + uint32_t DMA_MemoryBaseAddr; /*!< Specifies the memory base address for DMAy Channelx. */ + + uint32_t DMA_DIR; /*!< Specifies if the peripheral is the source or destination. + This parameter can be a value of @ref DMA_data_transfer_direction */ + + uint32_t DMA_BufferSize; /*!< Specifies the buffer size, in data unit, of the specified Channel. + The data unit is equal to the configuration set in DMA_PeripheralDataSize + or DMA_MemoryDataSize members depending in the transfer direction. */ + + uint32_t DMA_PeripheralInc; /*!< Specifies whether the Peripheral address register is incremented or not. + This parameter can be a value of @ref DMA_peripheral_incremented_mode */ + + uint32_t DMA_MemoryInc; /*!< Specifies whether the memory address register is incremented or not. + This parameter can be a value of @ref DMA_memory_incremented_mode */ + + uint32_t DMA_PeripheralDataSize; /*!< Specifies the Peripheral data width. + This parameter can be a value of @ref DMA_peripheral_data_size */ + + uint32_t DMA_MemoryDataSize; /*!< Specifies the Memory data width. + This parameter can be a value of @ref DMA_memory_data_size */ + + uint32_t DMA_Mode; /*!< Specifies the operation mode of the DMAy Channelx. + This parameter can be a value of @ref DMA_circular_normal_mode. + @note: The circular buffer mode cannot be used if the memory-to-memory + data transfer is configured on the selected Channel */ + + uint32_t DMA_Priority; /*!< Specifies the software priority for the DMAy Channelx. + This parameter can be a value of @ref DMA_priority_level */ + + uint32_t DMA_M2M; /*!< Specifies if the DMAy Channelx will be used in memory-to-memory transfer. + This parameter can be a value of @ref DMA_memory_to_memory */ +}DMA_InitTypeDef; + +/** + * @} + */ + +/** @defgroup DMA_Exported_Constants + * @{ + */ + +#define IS_DMA_ALL_PERIPH(PERIPH) (((PERIPH) == DMA1_Channel1) || \ + ((PERIPH) == DMA1_Channel2) || \ + ((PERIPH) == DMA1_Channel3) || \ + ((PERIPH) == DMA1_Channel4) || \ + ((PERIPH) == DMA1_Channel5) || \ + ((PERIPH) == DMA1_Channel6) || \ + ((PERIPH) == DMA1_Channel7) || \ + ((PERIPH) == DMA2_Channel1) || \ + ((PERIPH) == DMA2_Channel2) || \ + ((PERIPH) == DMA2_Channel3) || \ + ((PERIPH) == DMA2_Channel4) || \ + ((PERIPH) == DMA2_Channel5)) + +/** @defgroup DMA_data_transfer_direction + * @{ + */ + +#define DMA_DIR_PeripheralDST ((uint32_t)0x00000010) +#define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000) +#define IS_DMA_DIR(DIR) (((DIR) == DMA_DIR_PeripheralDST) || \ + ((DIR) == DMA_DIR_PeripheralSRC)) +/** + * @} + */ + +/** @defgroup DMA_peripheral_incremented_mode + * @{ + */ + +#define DMA_PeripheralInc_Enable ((uint32_t)0x00000040) +#define DMA_PeripheralInc_Disable ((uint32_t)0x00000000) +#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PeripheralInc_Enable) || \ + ((STATE) == DMA_PeripheralInc_Disable)) +/** + * @} + */ + +/** @defgroup DMA_memory_incremented_mode + * @{ + */ + +#define DMA_MemoryInc_Enable ((uint32_t)0x00000080) +#define DMA_MemoryInc_Disable ((uint32_t)0x00000000) +#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MemoryInc_Enable) || \ + ((STATE) == DMA_MemoryInc_Disable)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PeripheralDataSize_Byte) || \ + ((SIZE) == DMA_PeripheralDataSize_HalfWord) || \ + ((SIZE) == DMA_PeripheralDataSize_Word)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MemoryDataSize_Byte) || \ + ((SIZE) == DMA_MemoryDataSize_HalfWord) || \ + ((SIZE) == DMA_MemoryDataSize_Word)) +/** + * @} + */ + +/** @defgroup DMA_circular_normal_mode + * @{ + */ + +#define DMA_Mode_Circular ((uint32_t)0x00000020) +#define DMA_Mode_Normal ((uint32_t)0x00000000) +#define IS_DMA_MODE(MODE) (((MODE) == DMA_Mode_Circular) || ((MODE) == DMA_Mode_Normal)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_Priority_VeryHigh) || \ + ((PRIORITY) == DMA_Priority_High) || \ + ((PRIORITY) == DMA_Priority_Medium) || \ + ((PRIORITY) == DMA_Priority_Low)) +/** + * @} + */ + +/** @defgroup DMA_memory_to_memory + * @{ + */ + +#define DMA_M2M_Enable ((uint32_t)0x00004000) +#define DMA_M2M_Disable ((uint32_t)0x00000000) +#define IS_DMA_M2M_STATE(STATE) (((STATE) == DMA_M2M_Enable) || ((STATE) == DMA_M2M_Disable)) + +/** + * @} + */ + +/** @defgroup 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 IS_DMA_CONFIG_IT(IT) ((((IT) & 0xFFFFFFF1) == 0x00) && ((IT) != 0x00)) + +#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 DMA2_IT_GL1 ((uint32_t)0x10000001) +#define DMA2_IT_TC1 ((uint32_t)0x10000002) +#define DMA2_IT_HT1 ((uint32_t)0x10000004) +#define DMA2_IT_TE1 ((uint32_t)0x10000008) +#define DMA2_IT_GL2 ((uint32_t)0x10000010) +#define DMA2_IT_TC2 ((uint32_t)0x10000020) +#define DMA2_IT_HT2 ((uint32_t)0x10000040) +#define DMA2_IT_TE2 ((uint32_t)0x10000080) +#define DMA2_IT_GL3 ((uint32_t)0x10000100) +#define DMA2_IT_TC3 ((uint32_t)0x10000200) +#define DMA2_IT_HT3 ((uint32_t)0x10000400) +#define DMA2_IT_TE3 ((uint32_t)0x10000800) +#define DMA2_IT_GL4 ((uint32_t)0x10001000) +#define DMA2_IT_TC4 ((uint32_t)0x10002000) +#define DMA2_IT_HT4 ((uint32_t)0x10004000) +#define DMA2_IT_TE4 ((uint32_t)0x10008000) +#define DMA2_IT_GL5 ((uint32_t)0x10010000) +#define DMA2_IT_TC5 ((uint32_t)0x10020000) +#define DMA2_IT_HT5 ((uint32_t)0x10040000) +#define DMA2_IT_TE5 ((uint32_t)0x10080000) + +#define IS_DMA_CLEAR_IT(IT) (((((IT) & 0xF0000000) == 0x00) || (((IT) & 0xEFF00000) == 0x00)) && ((IT) != 0x00)) + +#define IS_DMA_GET_IT(IT) (((IT) == DMA1_IT_GL1) || ((IT) == DMA1_IT_TC1) || \ + ((IT) == DMA1_IT_HT1) || ((IT) == DMA1_IT_TE1) || \ + ((IT) == DMA1_IT_GL2) || ((IT) == DMA1_IT_TC2) || \ + ((IT) == DMA1_IT_HT2) || ((IT) == DMA1_IT_TE2) || \ + ((IT) == DMA1_IT_GL3) || ((IT) == DMA1_IT_TC3) || \ + ((IT) == DMA1_IT_HT3) || ((IT) == DMA1_IT_TE3) || \ + ((IT) == DMA1_IT_GL4) || ((IT) == DMA1_IT_TC4) || \ + ((IT) == DMA1_IT_HT4) || ((IT) == DMA1_IT_TE4) || \ + ((IT) == DMA1_IT_GL5) || ((IT) == DMA1_IT_TC5) || \ + ((IT) == DMA1_IT_HT5) || ((IT) == DMA1_IT_TE5) || \ + ((IT) == DMA1_IT_GL6) || ((IT) == DMA1_IT_TC6) || \ + ((IT) == DMA1_IT_HT6) || ((IT) == DMA1_IT_TE6) || \ + ((IT) == DMA1_IT_GL7) || ((IT) == DMA1_IT_TC7) || \ + ((IT) == DMA1_IT_HT7) || ((IT) == DMA1_IT_TE7) || \ + ((IT) == DMA2_IT_GL1) || ((IT) == DMA2_IT_TC1) || \ + ((IT) == DMA2_IT_HT1) || ((IT) == DMA2_IT_TE1) || \ + ((IT) == DMA2_IT_GL2) || ((IT) == DMA2_IT_TC2) || \ + ((IT) == DMA2_IT_HT2) || ((IT) == DMA2_IT_TE2) || \ + ((IT) == DMA2_IT_GL3) || ((IT) == DMA2_IT_TC3) || \ + ((IT) == DMA2_IT_HT3) || ((IT) == DMA2_IT_TE3) || \ + ((IT) == DMA2_IT_GL4) || ((IT) == DMA2_IT_TC4) || \ + ((IT) == DMA2_IT_HT4) || ((IT) == DMA2_IT_TE4) || \ + ((IT) == DMA2_IT_GL5) || ((IT) == DMA2_IT_TC5) || \ + ((IT) == DMA2_IT_HT5) || ((IT) == DMA2_IT_TE5)) + +/** + * @} + */ + +/** @defgroup 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 DMA2_FLAG_GL1 ((uint32_t)0x10000001) +#define DMA2_FLAG_TC1 ((uint32_t)0x10000002) +#define DMA2_FLAG_HT1 ((uint32_t)0x10000004) +#define DMA2_FLAG_TE1 ((uint32_t)0x10000008) +#define DMA2_FLAG_GL2 ((uint32_t)0x10000010) +#define DMA2_FLAG_TC2 ((uint32_t)0x10000020) +#define DMA2_FLAG_HT2 ((uint32_t)0x10000040) +#define DMA2_FLAG_TE2 ((uint32_t)0x10000080) +#define DMA2_FLAG_GL3 ((uint32_t)0x10000100) +#define DMA2_FLAG_TC3 ((uint32_t)0x10000200) +#define DMA2_FLAG_HT3 ((uint32_t)0x10000400) +#define DMA2_FLAG_TE3 ((uint32_t)0x10000800) +#define DMA2_FLAG_GL4 ((uint32_t)0x10001000) +#define DMA2_FLAG_TC4 ((uint32_t)0x10002000) +#define DMA2_FLAG_HT4 ((uint32_t)0x10004000) +#define DMA2_FLAG_TE4 ((uint32_t)0x10008000) +#define DMA2_FLAG_GL5 ((uint32_t)0x10010000) +#define DMA2_FLAG_TC5 ((uint32_t)0x10020000) +#define DMA2_FLAG_HT5 ((uint32_t)0x10040000) +#define DMA2_FLAG_TE5 ((uint32_t)0x10080000) + +#define IS_DMA_CLEAR_FLAG(FLAG) (((((FLAG) & 0xF0000000) == 0x00) || (((FLAG) & 0xEFF00000) == 0x00)) && ((FLAG) != 0x00)) + +#define IS_DMA_GET_FLAG(FLAG) (((FLAG) == DMA1_FLAG_GL1) || ((FLAG) == DMA1_FLAG_TC1) || \ + ((FLAG) == DMA1_FLAG_HT1) || ((FLAG) == DMA1_FLAG_TE1) || \ + ((FLAG) == DMA1_FLAG_GL2) || ((FLAG) == DMA1_FLAG_TC2) || \ + ((FLAG) == DMA1_FLAG_HT2) || ((FLAG) == DMA1_FLAG_TE2) || \ + ((FLAG) == DMA1_FLAG_GL3) || ((FLAG) == DMA1_FLAG_TC3) || \ + ((FLAG) == DMA1_FLAG_HT3) || ((FLAG) == DMA1_FLAG_TE3) || \ + ((FLAG) == DMA1_FLAG_GL4) || ((FLAG) == DMA1_FLAG_TC4) || \ + ((FLAG) == DMA1_FLAG_HT4) || ((FLAG) == DMA1_FLAG_TE4) || \ + ((FLAG) == DMA1_FLAG_GL5) || ((FLAG) == DMA1_FLAG_TC5) || \ + ((FLAG) == DMA1_FLAG_HT5) || ((FLAG) == DMA1_FLAG_TE5) || \ + ((FLAG) == DMA1_FLAG_GL6) || ((FLAG) == DMA1_FLAG_TC6) || \ + ((FLAG) == DMA1_FLAG_HT6) || ((FLAG) == DMA1_FLAG_TE6) || \ + ((FLAG) == DMA1_FLAG_GL7) || ((FLAG) == DMA1_FLAG_TC7) || \ + ((FLAG) == DMA1_FLAG_HT7) || ((FLAG) == DMA1_FLAG_TE7) || \ + ((FLAG) == DMA2_FLAG_GL1) || ((FLAG) == DMA2_FLAG_TC1) || \ + ((FLAG) == DMA2_FLAG_HT1) || ((FLAG) == DMA2_FLAG_TE1) || \ + ((FLAG) == DMA2_FLAG_GL2) || ((FLAG) == DMA2_FLAG_TC2) || \ + ((FLAG) == DMA2_FLAG_HT2) || ((FLAG) == DMA2_FLAG_TE2) || \ + ((FLAG) == DMA2_FLAG_GL3) || ((FLAG) == DMA2_FLAG_TC3) || \ + ((FLAG) == DMA2_FLAG_HT3) || ((FLAG) == DMA2_FLAG_TE3) || \ + ((FLAG) == DMA2_FLAG_GL4) || ((FLAG) == DMA2_FLAG_TC4) || \ + ((FLAG) == DMA2_FLAG_HT4) || ((FLAG) == DMA2_FLAG_TE4) || \ + ((FLAG) == DMA2_FLAG_GL5) || ((FLAG) == DMA2_FLAG_TC5) || \ + ((FLAG) == DMA2_FLAG_HT5) || ((FLAG) == DMA2_FLAG_TE5)) +/** + * @} + */ + +/** @defgroup DMA_Buffer_Size + * @{ + */ + +#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000)) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup DMA_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DMA_Exported_Functions + * @{ + */ + +void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx); +void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct); +void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct); +void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState); +void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState); +void DMA_SetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx, uint16_t DataNumber); +uint16_t DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx); +FlagStatus DMA_GetFlagStatus(uint32_t DMAy_FLAG); +void DMA_ClearFlag(uint32_t DMAy_FLAG); +ITStatus DMA_GetITStatus(uint32_t DMAy_IT); +void DMA_ClearITPendingBit(uint32_t DMAy_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_DMA_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_exti.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_exti.h new file mode 100644 index 0000000..fd0f81c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_exti.h @@ -0,0 +1,182 @@ +/** + ****************************************************************************** + * @file stm32f10x_exti.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the EXTI firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_EXTI_H +#define __STM32F10x_EXTI_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup EXTI + * @{ + */ + +/** @defgroup EXTI_Exported_Types + * @{ + */ + +/** + * @brief EXTI mode enumeration + */ + +typedef enum +{ + EXTI_Mode_Interrupt = 0x00, + EXTI_Mode_Event = 0x04 +}EXTIMode_TypeDef; + +#define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event)) + +/** + * @brief EXTI Trigger enumeration + */ + +typedef enum +{ + EXTI_Trigger_Rising = 0x08, + EXTI_Trigger_Falling = 0x0C, + EXTI_Trigger_Rising_Falling = 0x10 +}EXTITrigger_TypeDef; + +#define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \ + ((TRIGGER) == EXTI_Trigger_Falling) || \ + ((TRIGGER) == EXTI_Trigger_Rising_Falling)) +/** + * @brief EXTI Init Structure definition + */ + +typedef struct +{ + uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. + This parameter can be any combination of @ref EXTI_Lines */ + + EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. + This parameter can be a value of @ref EXTIMode_TypeDef */ + + EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. + This parameter can be a value of @ref EXTITrigger_TypeDef */ + + FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. + This parameter can be set either to ENABLE or DISABLE */ +}EXTI_InitTypeDef; + +/** + * @} + */ + +/** @defgroup EXTI_Exported_Constants + * @{ + */ + +/** @defgroup 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 */ +#define EXTI_Line9 ((uint32_t)0x00200) /*!< External interrupt line 9 */ +#define EXTI_Line10 ((uint32_t)0x00400) /*!< External interrupt line 10 */ +#define EXTI_Line11 ((uint32_t)0x00800) /*!< External interrupt line 11 */ +#define EXTI_Line12 ((uint32_t)0x01000) /*!< External interrupt line 12 */ +#define EXTI_Line13 ((uint32_t)0x02000) /*!< External interrupt line 13 */ +#define EXTI_Line14 ((uint32_t)0x04000) /*!< External interrupt line 14 */ +#define EXTI_Line15 ((uint32_t)0x08000) /*!< External interrupt line 15 */ +#define EXTI_Line16 ((uint32_t)0x10000) /*!< External interrupt line 16 Connected to the PVD Output */ +#define EXTI_Line17 ((uint32_t)0x20000) /*!< External interrupt line 17 Connected to the RTC Alarm event */ +#define EXTI_Line18 ((uint32_t)0x40000) /*!< External interrupt line 18 Connected to the USB Device/USB OTG FS + Wakeup from suspend event */ +#define EXTI_Line19 ((uint32_t)0x80000) /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */ + +#define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00)) +#define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \ + ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \ + ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \ + ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \ + ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \ + ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \ + ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \ + ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \ + ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \ + ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19)) + + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup EXTI_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup EXTI_Exported_Functions + * @{ + */ + +void EXTI_DeInit(void); +void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct); +void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct); +void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line); +FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line); +void EXTI_ClearFlag(uint32_t EXTI_Line); +ITStatus EXTI_GetITStatus(uint32_t EXTI_Line); +void EXTI_ClearITPendingBit(uint32_t EXTI_Line); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_EXTI_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_flash.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_flash.h new file mode 100644 index 0000000..6fe1f74 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_flash.h @@ -0,0 +1,424 @@ +/** + ****************************************************************************** + * @file stm32f10x_flash.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the FLASH + * firmware library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_FLASH_H +#define __STM32F10x_FLASH_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup FLASH + * @{ + */ + +/** @defgroup FLASH_Exported_Types + * @{ + */ + +/** + * @brief FLASH Status + */ + +typedef enum +{ + FLASH_BUSY = 1, + FLASH_ERROR_PG, + FLASH_ERROR_WRP, + FLASH_COMPLETE, + FLASH_TIMEOUT +}FLASH_Status; + +/** + * @} + */ + +/** @defgroup FLASH_Exported_Constants + * @{ + */ + +/** @defgroup 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 */ +#define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_Latency_0) || \ + ((LATENCY) == FLASH_Latency_1) || \ + ((LATENCY) == FLASH_Latency_2)) +/** + * @} + */ + +/** @defgroup Half_Cycle_Enable_Disable + * @{ + */ + +#define FLASH_HalfCycleAccess_Enable ((uint32_t)0x00000008) /*!< FLASH Half Cycle Enable */ +#define FLASH_HalfCycleAccess_Disable ((uint32_t)0x00000000) /*!< FLASH Half Cycle Disable */ +#define IS_FLASH_HALFCYCLEACCESS_STATE(STATE) (((STATE) == FLASH_HalfCycleAccess_Enable) || \ + ((STATE) == FLASH_HalfCycleAccess_Disable)) +/** + * @} + */ + +/** @defgroup Prefetch_Buffer_Enable_Disable + * @{ + */ + +#define FLASH_PrefetchBuffer_Enable ((uint32_t)0x00000010) /*!< FLASH Prefetch Buffer Enable */ +#define FLASH_PrefetchBuffer_Disable ((uint32_t)0x00000000) /*!< FLASH Prefetch Buffer Disable */ +#define IS_FLASH_PREFETCHBUFFER_STATE(STATE) (((STATE) == FLASH_PrefetchBuffer_Enable) || \ + ((STATE) == FLASH_PrefetchBuffer_Disable)) +/** + * @} + */ + +/** @defgroup Option_Bytes_Write_Protection + * @{ + */ + +/* Values to be used with STM32 Low and Medium density devices */ +#define FLASH_WRProt_Pages0to3 ((uint32_t)0x00000001) /*!< STM32 Low and Medium density devices: Write protection of page 0 to 3 */ +#define FLASH_WRProt_Pages4to7 ((uint32_t)0x00000002) /*!< STM32 Low and Medium density devices: Write protection of page 4 to 7 */ +#define FLASH_WRProt_Pages8to11 ((uint32_t)0x00000004) /*!< STM32 Low and Medium density devices: Write protection of page 8 to 11 */ +#define FLASH_WRProt_Pages12to15 ((uint32_t)0x00000008) /*!< STM32 Low and Medium density devices: Write protection of page 12 to 15 */ +#define FLASH_WRProt_Pages16to19 ((uint32_t)0x00000010) /*!< STM32 Low and Medium density devices: Write protection of page 16 to 19 */ +#define FLASH_WRProt_Pages20to23 ((uint32_t)0x00000020) /*!< STM32 Low and Medium density devices: Write protection of page 20 to 23 */ +#define FLASH_WRProt_Pages24to27 ((uint32_t)0x00000040) /*!< STM32 Low and Medium density devices: Write protection of page 24 to 27 */ +#define FLASH_WRProt_Pages28to31 ((uint32_t)0x00000080) /*!< STM32 Low and Medium density devices: Write protection of page 28 to 31 */ + +/* Values to be used with STM32 Medium-density devices */ +#define FLASH_WRProt_Pages32to35 ((uint32_t)0x00000100) /*!< STM32 Medium-density devices: Write protection of page 32 to 35 */ +#define FLASH_WRProt_Pages36to39 ((uint32_t)0x00000200) /*!< STM32 Medium-density devices: Write protection of page 36 to 39 */ +#define FLASH_WRProt_Pages40to43 ((uint32_t)0x00000400) /*!< STM32 Medium-density devices: Write protection of page 40 to 43 */ +#define FLASH_WRProt_Pages44to47 ((uint32_t)0x00000800) /*!< STM32 Medium-density devices: Write protection of page 44 to 47 */ +#define FLASH_WRProt_Pages48to51 ((uint32_t)0x00001000) /*!< STM32 Medium-density devices: Write protection of page 48 to 51 */ +#define FLASH_WRProt_Pages52to55 ((uint32_t)0x00002000) /*!< STM32 Medium-density devices: Write protection of page 52 to 55 */ +#define FLASH_WRProt_Pages56to59 ((uint32_t)0x00004000) /*!< STM32 Medium-density devices: Write protection of page 56 to 59 */ +#define FLASH_WRProt_Pages60to63 ((uint32_t)0x00008000) /*!< STM32 Medium-density devices: Write protection of page 60 to 63 */ +#define FLASH_WRProt_Pages64to67 ((uint32_t)0x00010000) /*!< STM32 Medium-density devices: Write protection of page 64 to 67 */ +#define FLASH_WRProt_Pages68to71 ((uint32_t)0x00020000) /*!< STM32 Medium-density devices: Write protection of page 68 to 71 */ +#define FLASH_WRProt_Pages72to75 ((uint32_t)0x00040000) /*!< STM32 Medium-density devices: Write protection of page 72 to 75 */ +#define FLASH_WRProt_Pages76to79 ((uint32_t)0x00080000) /*!< STM32 Medium-density devices: Write protection of page 76 to 79 */ +#define FLASH_WRProt_Pages80to83 ((uint32_t)0x00100000) /*!< STM32 Medium-density devices: Write protection of page 80 to 83 */ +#define FLASH_WRProt_Pages84to87 ((uint32_t)0x00200000) /*!< STM32 Medium-density devices: Write protection of page 84 to 87 */ +#define FLASH_WRProt_Pages88to91 ((uint32_t)0x00400000) /*!< STM32 Medium-density devices: Write protection of page 88 to 91 */ +#define FLASH_WRProt_Pages92to95 ((uint32_t)0x00800000) /*!< STM32 Medium-density devices: Write protection of page 92 to 95 */ +#define FLASH_WRProt_Pages96to99 ((uint32_t)0x01000000) /*!< STM32 Medium-density devices: Write protection of page 96 to 99 */ +#define FLASH_WRProt_Pages100to103 ((uint32_t)0x02000000) /*!< STM32 Medium-density devices: Write protection of page 100 to 103 */ +#define FLASH_WRProt_Pages104to107 ((uint32_t)0x04000000) /*!< STM32 Medium-density devices: Write protection of page 104 to 107 */ +#define FLASH_WRProt_Pages108to111 ((uint32_t)0x08000000) /*!< STM32 Medium-density devices: Write protection of page 108 to 111 */ +#define FLASH_WRProt_Pages112to115 ((uint32_t)0x10000000) /*!< STM32 Medium-density devices: Write protection of page 112 to 115 */ +#define FLASH_WRProt_Pages116to119 ((uint32_t)0x20000000) /*!< STM32 Medium-density devices: Write protection of page 115 to 119 */ +#define FLASH_WRProt_Pages120to123 ((uint32_t)0x40000000) /*!< STM32 Medium-density devices: Write protection of page 120 to 123 */ +#define FLASH_WRProt_Pages124to127 ((uint32_t)0x80000000) /*!< STM32 Medium-density devices: Write protection of page 124 to 127 */ + +/* Values to be used with STM32 High-density and STM32F10X Connectivity line devices */ +#define FLASH_WRProt_Pages0to1 ((uint32_t)0x00000001) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 0 to 1 */ +#define FLASH_WRProt_Pages2to3 ((uint32_t)0x00000002) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 2 to 3 */ +#define FLASH_WRProt_Pages4to5 ((uint32_t)0x00000004) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 4 to 5 */ +#define FLASH_WRProt_Pages6to7 ((uint32_t)0x00000008) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 6 to 7 */ +#define FLASH_WRProt_Pages8to9 ((uint32_t)0x00000010) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 8 to 9 */ +#define FLASH_WRProt_Pages10to11 ((uint32_t)0x00000020) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 10 to 11 */ +#define FLASH_WRProt_Pages12to13 ((uint32_t)0x00000040) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 12 to 13 */ +#define FLASH_WRProt_Pages14to15 ((uint32_t)0x00000080) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 14 to 15 */ +#define FLASH_WRProt_Pages16to17 ((uint32_t)0x00000100) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 16 to 17 */ +#define FLASH_WRProt_Pages18to19 ((uint32_t)0x00000200) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 18 to 19 */ +#define FLASH_WRProt_Pages20to21 ((uint32_t)0x00000400) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 20 to 21 */ +#define FLASH_WRProt_Pages22to23 ((uint32_t)0x00000800) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 22 to 23 */ +#define FLASH_WRProt_Pages24to25 ((uint32_t)0x00001000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 24 to 25 */ +#define FLASH_WRProt_Pages26to27 ((uint32_t)0x00002000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 26 to 27 */ +#define FLASH_WRProt_Pages28to29 ((uint32_t)0x00004000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 28 to 29 */ +#define FLASH_WRProt_Pages30to31 ((uint32_t)0x00008000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 30 to 31 */ +#define FLASH_WRProt_Pages32to33 ((uint32_t)0x00010000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 32 to 33 */ +#define FLASH_WRProt_Pages34to35 ((uint32_t)0x00020000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 34 to 35 */ +#define FLASH_WRProt_Pages36to37 ((uint32_t)0x00040000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 36 to 37 */ +#define FLASH_WRProt_Pages38to39 ((uint32_t)0x00080000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 38 to 39 */ +#define FLASH_WRProt_Pages40to41 ((uint32_t)0x00100000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 40 to 41 */ +#define FLASH_WRProt_Pages42to43 ((uint32_t)0x00200000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 42 to 43 */ +#define FLASH_WRProt_Pages44to45 ((uint32_t)0x00400000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 44 to 45 */ +#define FLASH_WRProt_Pages46to47 ((uint32_t)0x00800000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 46 to 47 */ +#define FLASH_WRProt_Pages48to49 ((uint32_t)0x01000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 48 to 49 */ +#define FLASH_WRProt_Pages50to51 ((uint32_t)0x02000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 50 to 51 */ +#define FLASH_WRProt_Pages52to53 ((uint32_t)0x04000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 52 to 53 */ +#define FLASH_WRProt_Pages54to55 ((uint32_t)0x08000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 54 to 55 */ +#define FLASH_WRProt_Pages56to57 ((uint32_t)0x10000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 56 to 57 */ +#define FLASH_WRProt_Pages58to59 ((uint32_t)0x20000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 58 to 59 */ +#define FLASH_WRProt_Pages60to61 ((uint32_t)0x40000000) /*!< STM32 High-density, XL-density and Connectivity line devices: + Write protection of page 60 to 61 */ +#define FLASH_WRProt_Pages62to127 ((uint32_t)0x80000000) /*!< STM32 Connectivity line devices: Write protection of page 62 to 127 */ +#define FLASH_WRProt_Pages62to255 ((uint32_t)0x80000000) /*!< STM32 Medium-density devices: Write protection of page 62 to 255 */ +#define FLASH_WRProt_Pages62to511 ((uint32_t)0x80000000) /*!< STM32 XL-density devices: Write protection of page 62 to 511 */ + +#define FLASH_WRProt_AllPages ((uint32_t)0xFFFFFFFF) /*!< Write protection of all Pages */ + +#define IS_FLASH_WRPROT_PAGE(PAGE) (((PAGE) != 0x00000000)) + +#define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x080FFFFF)) + +#define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == 0x1FFFF804) || ((ADDRESS) == 0x1FFFF806)) + +/** + * @} + */ + +/** @defgroup Option_Bytes_IWatchdog + * @{ + */ + +#define OB_IWDG_SW ((uint16_t)0x0001) /*!< Software IWDG selected */ +#define OB_IWDG_HW ((uint16_t)0x0000) /*!< Hardware IWDG selected */ +#define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW)) + +/** + * @} + */ + +/** @defgroup 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 */ +#define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NoRST) || ((SOURCE) == OB_STOP_RST)) + +/** + * @} + */ + +/** @defgroup 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 */ +#define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NoRST) || ((SOURCE) == OB_STDBY_RST)) + +#ifdef STM32F10X_XL +/** + * @} + */ +/** @defgroup FLASH_Boot + * @{ + */ +#define FLASH_BOOT_Bank1 ((uint16_t)0x0000) /*!< At startup, if boot pins are set in boot from user Flash position + and this parameter is selected the device will boot from Bank1(Default) */ +#define FLASH_BOOT_Bank2 ((uint16_t)0x0001) /*!< At startup, if boot pins are set in boot from user Flash position + and this parameter is selected the device will boot from Bank 2 or Bank 1, + depending on the activation of the bank */ +#define IS_FLASH_BOOT(BOOT) (((BOOT) == FLASH_BOOT_Bank1) || ((BOOT) == FLASH_BOOT_Bank2)) +#endif +/** + * @} + */ +/** @defgroup FLASH_Interrupts + * @{ + */ +#ifdef STM32F10X_XL +#define FLASH_IT_BANK2_ERROR ((uint32_t)0x80000400) /*!< FPEC BANK2 error interrupt source */ +#define FLASH_IT_BANK2_EOP ((uint32_t)0x80001000) /*!< End of FLASH BANK2 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 */ + +#define FLASH_IT_ERROR ((uint32_t)0x00000400) /*!< FPEC BANK1 error interrupt source */ +#define FLASH_IT_EOP ((uint32_t)0x00001000) /*!< End of FLASH BANK1 Operation Interrupt source */ +#define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0x7FFFEBFF) == 0x00000000) && (((IT) != 0x00000000))) +#else +#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 */ + +#define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0xFFFFEBFF) == 0x00000000) && (((IT) != 0x00000000))) +#endif + +/** + * @} + */ + +/** @defgroup FLASH_Flags + * @{ + */ +#ifdef STM32F10X_XL +#define FLASH_FLAG_BANK2_BSY ((uint32_t)0x80000001) /*!< FLASH BANK2 Busy flag */ +#define FLASH_FLAG_BANK2_EOP ((uint32_t)0x80000020) /*!< FLASH BANK2 End of Operation flag */ +#define FLASH_FLAG_BANK2_PGERR ((uint32_t)0x80000004) /*!< FLASH BANK2 Program error flag */ +#define FLASH_FLAG_BANK2_WRPRTERR ((uint32_t)0x80000010) /*!< FLASH BANK2 Write protected 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_PGERR FLASH_FLAG_PGERR /*!< FLASH BANK1 Program error flag */ +#define FLASH_FLAG_BANK1_WRPRTERR FLASH_FLAG_WRPRTERR /*!< FLASH BANK1 Write protected error flag */ + +#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_PGERR ((uint32_t)0x00000004) /*!< FLASH Program error 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 IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0x7FFFFFCA) == 0x00000000) && ((FLAG) != 0x00000000)) +#define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_EOP) || \ + ((FLAG) == FLASH_FLAG_PGERR) || ((FLAG) == FLASH_FLAG_WRPRTERR) || \ + ((FLAG) == FLASH_FLAG_OPTERR)|| \ + ((FLAG) == FLASH_FLAG_BANK1_BSY) || ((FLAG) == FLASH_FLAG_BANK1_EOP) || \ + ((FLAG) == FLASH_FLAG_BANK1_PGERR) || ((FLAG) == FLASH_FLAG_BANK1_WRPRTERR) || \ + ((FLAG) == FLASH_FLAG_BANK2_BSY) || ((FLAG) == FLASH_FLAG_BANK2_EOP) || \ + ((FLAG) == FLASH_FLAG_BANK2_PGERR) || ((FLAG) == FLASH_FLAG_BANK2_WRPRTERR)) +#else +#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_PGERR ((uint32_t)0x00000004) /*!< FLASH Program error 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_PGERR FLASH_FLAG_PGERR /*!< FLASH BANK1 Program error flag */ +#define FLASH_FLAG_BANK1_WRPRTERR FLASH_FLAG_WRPRTERR /*!< FLASH BANK1 Write protected error flag */ + +#define IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFCA) == 0x00000000) && ((FLAG) != 0x00000000)) +#define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_EOP) || \ + ((FLAG) == FLASH_FLAG_PGERR) || ((FLAG) == FLASH_FLAG_WRPRTERR) || \ + ((FLAG) == FLASH_FLAG_BANK1_BSY) || ((FLAG) == FLASH_FLAG_BANK1_EOP) || \ + ((FLAG) == FLASH_FLAG_BANK1_PGERR) || ((FLAG) == FLASH_FLAG_BANK1_WRPRTERR) || \ + ((FLAG) == FLASH_FLAG_OPTERR)) +#endif + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup FLASH_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup FLASH_Exported_Functions + * @{ + */ + +/*------------ Functions used for all STM32F10x devices -----*/ +void FLASH_SetLatency(uint32_t FLASH_Latency); +void FLASH_HalfCycleAccessCmd(uint32_t FLASH_HalfCycleAccess); +void FLASH_PrefetchBufferCmd(uint32_t FLASH_PrefetchBuffer); +void FLASH_Unlock(void); +void FLASH_Lock(void); +FLASH_Status FLASH_ErasePage(uint32_t Page_Address); +FLASH_Status FLASH_EraseAllPages(void); +FLASH_Status FLASH_EraseOptionBytes(void); +FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data); +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); +FLASH_Status FLASH_ProgramOptionByteData(uint32_t Address, uint8_t Data); +FLASH_Status FLASH_EnableWriteProtection(uint32_t FLASH_Pages); +FLASH_Status FLASH_ReadOutProtection(FunctionalState NewState); +FLASH_Status FLASH_UserOptionByteConfig(uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY); +uint32_t FLASH_GetUserOptionByte(void); +uint32_t FLASH_GetWriteProtectionOptionByte(void); +FlagStatus FLASH_GetReadOutProtectionStatus(void); +FlagStatus FLASH_GetPrefetchBufferStatus(void); +void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState); +FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG); +void FLASH_ClearFlag(uint32_t FLASH_FLAG); +FLASH_Status FLASH_GetStatus(void); +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); + +/*------------ New function used for all STM32F10x devices -----*/ +void FLASH_UnlockBank1(void); +void FLASH_LockBank1(void); +FLASH_Status FLASH_EraseAllBank1Pages(void); +FLASH_Status FLASH_GetBank1Status(void); +FLASH_Status FLASH_WaitForLastBank1Operation(uint32_t Timeout); + +#ifdef STM32F10X_XL +/*---- New Functions used only with STM32F10x_XL density devices -----*/ +void FLASH_UnlockBank2(void); +void FLASH_LockBank2(void); +FLASH_Status FLASH_EraseAllBank2Pages(void); +FLASH_Status FLASH_GetBank2Status(void); +FLASH_Status FLASH_WaitForLastBank2Operation(uint32_t Timeout); +FLASH_Status FLASH_BootConfig(uint16_t FLASH_BOOT); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_FLASH_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_fsmc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_fsmc.h new file mode 100644 index 0000000..467bd8e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_fsmc.h @@ -0,0 +1,731 @@ +/** + ****************************************************************************** + * @file stm32f10x_fsmc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the FSMC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_FSMC_H +#define __STM32F10x_FSMC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup FSMC + * @{ + */ + +/** @defgroup FSMC_Exported_Types + * @{ + */ + +/** + * @brief Timing parameters For NOR/SRAM Banks + */ + +typedef struct +{ + uint32_t FSMC_AddressSetupTime; /*!< Defines the number of HCLK cycles to configure + the duration of the address setup time. + This parameter can be a value between 0 and 0xF. + @note: It is not used with synchronous NOR Flash memories. */ + + uint32_t FSMC_AddressHoldTime; /*!< Defines the number of HCLK cycles to configure + the duration of the address hold time. + This parameter can be a value between 0 and 0xF. + @note: It is not used with synchronous NOR Flash memories.*/ + + uint32_t FSMC_DataSetupTime; /*!< Defines the number of HCLK cycles to configure + the duration of the data setup time. + This parameter can be a value between 0 and 0xFF. + @note: It is used for SRAMs, ROMs and asynchronous multiplexed NOR Flash memories. */ + + uint32_t FSMC_BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure + the duration of the bus turnaround. + This parameter can be a value between 0 and 0xF. + @note: It is only used for multiplexed NOR Flash memories. */ + + uint32_t FSMC_CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of HCLK cycles. + This parameter can be a value between 1 and 0xF. + @note: This parameter is not used for asynchronous NOR Flash, SRAM or ROM accesses. */ + + uint32_t FSMC_DataLatency; /*!< Defines the number of memory clock cycles to issue + to the memory before getting the first data. + The value of this parameter depends on the memory type as shown below: + - It must be set to 0 in case of a CRAM + - It is don't care in asynchronous NOR, SRAM or ROM accesses + - It may assume a value between 0 and 0xF in NOR Flash memories + with synchronous burst mode enable */ + + uint32_t FSMC_AccessMode; /*!< Specifies the asynchronous access mode. + This parameter can be a value of @ref FSMC_Access_Mode */ +}FSMC_NORSRAMTimingInitTypeDef; + +/** + * @brief FSMC NOR/SRAM Init structure definition + */ + +typedef struct +{ + uint32_t FSMC_Bank; /*!< Specifies the NOR/SRAM memory bank that will be used. + This parameter can be a value of @ref FSMC_NORSRAM_Bank */ + + uint32_t FSMC_DataAddressMux; /*!< Specifies whether the address and data values are + multiplexed on the databus or not. + This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */ + + uint32_t FSMC_MemoryType; /*!< Specifies the type of external memory attached to + the corresponding memory bank. + This parameter can be a value of @ref FSMC_Memory_Type */ + + uint32_t FSMC_MemoryDataWidth; /*!< Specifies the external memory device width. + This parameter can be a value of @ref FSMC_Data_Width */ + + uint32_t FSMC_BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory, + valid only with synchronous burst Flash memories. + This parameter can be a value of @ref FSMC_Burst_Access_Mode */ + + uint32_t FSMC_AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers, + valid only with asynchronous Flash memories. + This parameter can be a value of @ref FSMC_AsynchronousWait */ + + uint32_t FSMC_WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing + the Flash memory in burst mode. + This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */ + + uint32_t FSMC_WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash + memory, valid only when accessing Flash memories in burst mode. + This parameter can be a value of @ref FSMC_Wrap_Mode */ + + uint32_t FSMC_WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one + clock cycle before the wait state or during the wait state, + valid only when accessing memories in burst mode. + This parameter can be a value of @ref FSMC_Wait_Timing */ + + uint32_t FSMC_WriteOperation; /*!< Enables or disables the write operation in the selected bank by the FSMC. + This parameter can be a value of @ref FSMC_Write_Operation */ + + uint32_t FSMC_WaitSignal; /*!< Enables or disables the wait-state insertion via wait + signal, valid for Flash memory access in burst mode. + This parameter can be a value of @ref FSMC_Wait_Signal */ + + uint32_t FSMC_ExtendedMode; /*!< Enables or disables the extended mode. + This parameter can be a value of @ref FSMC_Extended_Mode */ + + uint32_t FSMC_WriteBurst; /*!< Enables or disables the write burst operation. + This parameter can be a value of @ref FSMC_Write_Burst */ + + FSMC_NORSRAMTimingInitTypeDef* FSMC_ReadWriteTimingStruct; /*!< Timing Parameters for write and read access if the ExtendedMode is not used*/ + + FSMC_NORSRAMTimingInitTypeDef* FSMC_WriteTimingStruct; /*!< Timing Parameters for write access if the ExtendedMode is used*/ +}FSMC_NORSRAMInitTypeDef; + +/** + * @brief Timing parameters For FSMC NAND and PCCARD Banks + */ + +typedef struct +{ + uint32_t FSMC_SetupTime; /*!< Defines the number of HCLK cycles to setup address before + the command assertion for NAND-Flash read or write access + to common/Attribute or I/O memory space (depending on + the memory space timing to be configured). + This parameter can be a value between 0 and 0xFF.*/ + + uint32_t FSMC_WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the + command for NAND-Flash read or write access to + common/Attribute or I/O memory space (depending on the + memory space timing to be configured). + This parameter can be a number between 0x00 and 0xFF */ + + uint32_t FSMC_HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address + (and data for write access) after the command deassertion + for NAND-Flash read or write access to common/Attribute + or I/O memory space (depending on the memory space timing + to be configured). + This parameter can be a number between 0x00 and 0xFF */ + + uint32_t FSMC_HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the + databus is kept in HiZ after the start of a NAND-Flash + write access to common/Attribute or I/O memory space (depending + on the memory space timing to be configured). + This parameter can be a number between 0x00 and 0xFF */ +}FSMC_NAND_PCCARDTimingInitTypeDef; + +/** + * @brief FSMC NAND Init structure definition + */ + +typedef struct +{ + uint32_t FSMC_Bank; /*!< Specifies the NAND memory bank that will be used. + This parameter can be a value of @ref FSMC_NAND_Bank */ + + uint32_t FSMC_Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory Bank. + This parameter can be any value of @ref FSMC_Wait_feature */ + + uint32_t FSMC_MemoryDataWidth; /*!< Specifies the external memory device width. + This parameter can be any value of @ref FSMC_Data_Width */ + + uint32_t FSMC_ECC; /*!< Enables or disables the ECC computation. + This parameter can be any value of @ref FSMC_ECC */ + + uint32_t FSMC_ECCPageSize; /*!< Defines the page size for the extended ECC. + This parameter can be any value of @ref FSMC_ECC_Page_Size */ + + uint32_t FSMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the + delay between CLE low and RE low. + This parameter can be a value between 0 and 0xFF. */ + + uint32_t FSMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the + delay between ALE low and RE low. + This parameter can be a number between 0x0 and 0xFF */ + + FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_CommonSpaceTimingStruct; /*!< FSMC Common Space Timing */ + + FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_AttributeSpaceTimingStruct; /*!< FSMC Attribute Space Timing */ +}FSMC_NANDInitTypeDef; + +/** + * @brief FSMC PCCARD Init structure definition + */ + +typedef struct +{ + uint32_t FSMC_Waitfeature; /*!< Enables or disables the Wait feature for the Memory Bank. + This parameter can be any value of @ref FSMC_Wait_feature */ + + uint32_t FSMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the + delay between CLE low and RE low. + This parameter can be a value between 0 and 0xFF. */ + + uint32_t FSMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the + delay between ALE low and RE low. + This parameter can be a number between 0x0 and 0xFF */ + + + FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_CommonSpaceTimingStruct; /*!< FSMC Common Space Timing */ + + FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_AttributeSpaceTimingStruct; /*!< FSMC Attribute Space Timing */ + + FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_IOSpaceTimingStruct; /*!< FSMC IO Space Timing */ +}FSMC_PCCARDInitTypeDef; + +/** + * @} + */ + +/** @defgroup FSMC_Exported_Constants + * @{ + */ + +/** @defgroup FSMC_NORSRAM_Bank + * @{ + */ +#define FSMC_Bank1_NORSRAM1 ((uint32_t)0x00000000) +#define FSMC_Bank1_NORSRAM2 ((uint32_t)0x00000002) +#define FSMC_Bank1_NORSRAM3 ((uint32_t)0x00000004) +#define FSMC_Bank1_NORSRAM4 ((uint32_t)0x00000006) +/** + * @} + */ + +/** @defgroup FSMC_NAND_Bank + * @{ + */ +#define FSMC_Bank2_NAND ((uint32_t)0x00000010) +#define FSMC_Bank3_NAND ((uint32_t)0x00000100) +/** + * @} + */ + +/** @defgroup FSMC_PCCARD_Bank + * @{ + */ +#define FSMC_Bank4_PCCARD ((uint32_t)0x00001000) +/** + * @} + */ + +#define IS_FSMC_NORSRAM_BANK(BANK) (((BANK) == FSMC_Bank1_NORSRAM1) || \ + ((BANK) == FSMC_Bank1_NORSRAM2) || \ + ((BANK) == FSMC_Bank1_NORSRAM3) || \ + ((BANK) == FSMC_Bank1_NORSRAM4)) + +#define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \ + ((BANK) == FSMC_Bank3_NAND)) + +#define IS_FSMC_GETFLAG_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \ + ((BANK) == FSMC_Bank3_NAND) || \ + ((BANK) == FSMC_Bank4_PCCARD)) + +#define IS_FSMC_IT_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \ + ((BANK) == FSMC_Bank3_NAND) || \ + ((BANK) == FSMC_Bank4_PCCARD)) + +/** @defgroup NOR_SRAM_Controller + * @{ + */ + +/** @defgroup FSMC_Data_Address_Bus_Multiplexing + * @{ + */ + +#define FSMC_DataAddressMux_Disable ((uint32_t)0x00000000) +#define FSMC_DataAddressMux_Enable ((uint32_t)0x00000002) +#define IS_FSMC_MUX(MUX) (((MUX) == FSMC_DataAddressMux_Disable) || \ + ((MUX) == FSMC_DataAddressMux_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_Memory_Type + * @{ + */ + +#define FSMC_MemoryType_SRAM ((uint32_t)0x00000000) +#define FSMC_MemoryType_PSRAM ((uint32_t)0x00000004) +#define FSMC_MemoryType_NOR ((uint32_t)0x00000008) +#define IS_FSMC_MEMORY(MEMORY) (((MEMORY) == FSMC_MemoryType_SRAM) || \ + ((MEMORY) == FSMC_MemoryType_PSRAM)|| \ + ((MEMORY) == FSMC_MemoryType_NOR)) + +/** + * @} + */ + +/** @defgroup FSMC_Data_Width + * @{ + */ + +#define FSMC_MemoryDataWidth_8b ((uint32_t)0x00000000) +#define FSMC_MemoryDataWidth_16b ((uint32_t)0x00000010) +#define IS_FSMC_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_MemoryDataWidth_8b) || \ + ((WIDTH) == FSMC_MemoryDataWidth_16b)) + +/** + * @} + */ + +/** @defgroup FSMC_Burst_Access_Mode + * @{ + */ + +#define FSMC_BurstAccessMode_Disable ((uint32_t)0x00000000) +#define FSMC_BurstAccessMode_Enable ((uint32_t)0x00000100) +#define IS_FSMC_BURSTMODE(STATE) (((STATE) == FSMC_BurstAccessMode_Disable) || \ + ((STATE) == FSMC_BurstAccessMode_Enable)) +/** + * @} + */ + +/** @defgroup FSMC_AsynchronousWait + * @{ + */ +#define FSMC_AsynchronousWait_Disable ((uint32_t)0x00000000) +#define FSMC_AsynchronousWait_Enable ((uint32_t)0x00008000) +#define IS_FSMC_ASYNWAIT(STATE) (((STATE) == FSMC_AsynchronousWait_Disable) || \ + ((STATE) == FSMC_AsynchronousWait_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_Wait_Signal_Polarity + * @{ + */ + +#define FSMC_WaitSignalPolarity_Low ((uint32_t)0x00000000) +#define FSMC_WaitSignalPolarity_High ((uint32_t)0x00000200) +#define IS_FSMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FSMC_WaitSignalPolarity_Low) || \ + ((POLARITY) == FSMC_WaitSignalPolarity_High)) + +/** + * @} + */ + +/** @defgroup FSMC_Wrap_Mode + * @{ + */ + +#define FSMC_WrapMode_Disable ((uint32_t)0x00000000) +#define FSMC_WrapMode_Enable ((uint32_t)0x00000400) +#define IS_FSMC_WRAP_MODE(MODE) (((MODE) == FSMC_WrapMode_Disable) || \ + ((MODE) == FSMC_WrapMode_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_Wait_Timing + * @{ + */ + +#define FSMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000) +#define FSMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800) +#define IS_FSMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FSMC_WaitSignalActive_BeforeWaitState) || \ + ((ACTIVE) == FSMC_WaitSignalActive_DuringWaitState)) + +/** + * @} + */ + +/** @defgroup FSMC_Write_Operation + * @{ + */ + +#define FSMC_WriteOperation_Disable ((uint32_t)0x00000000) +#define FSMC_WriteOperation_Enable ((uint32_t)0x00001000) +#define IS_FSMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FSMC_WriteOperation_Disable) || \ + ((OPERATION) == FSMC_WriteOperation_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_Wait_Signal + * @{ + */ + +#define FSMC_WaitSignal_Disable ((uint32_t)0x00000000) +#define FSMC_WaitSignal_Enable ((uint32_t)0x00002000) +#define IS_FSMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FSMC_WaitSignal_Disable) || \ + ((SIGNAL) == FSMC_WaitSignal_Enable)) +/** + * @} + */ + +/** @defgroup FSMC_Extended_Mode + * @{ + */ + +#define FSMC_ExtendedMode_Disable ((uint32_t)0x00000000) +#define FSMC_ExtendedMode_Enable ((uint32_t)0x00004000) + +#define IS_FSMC_EXTENDED_MODE(MODE) (((MODE) == FSMC_ExtendedMode_Disable) || \ + ((MODE) == FSMC_ExtendedMode_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_Write_Burst + * @{ + */ + +#define FSMC_WriteBurst_Disable ((uint32_t)0x00000000) +#define FSMC_WriteBurst_Enable ((uint32_t)0x00080000) +#define IS_FSMC_WRITE_BURST(BURST) (((BURST) == FSMC_WriteBurst_Disable) || \ + ((BURST) == FSMC_WriteBurst_Enable)) +/** + * @} + */ + +/** @defgroup FSMC_Address_Setup_Time + * @{ + */ + +#define IS_FSMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 0xF) + +/** + * @} + */ + +/** @defgroup FSMC_Address_Hold_Time + * @{ + */ + +#define IS_FSMC_ADDRESS_HOLD_TIME(TIME) ((TIME) <= 0xF) + +/** + * @} + */ + +/** @defgroup FSMC_Data_Setup_Time + * @{ + */ + +#define IS_FSMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 0xFF)) + +/** + * @} + */ + +/** @defgroup FSMC_Bus_Turn_around_Duration + * @{ + */ + +#define IS_FSMC_TURNAROUND_TIME(TIME) ((TIME) <= 0xF) + +/** + * @} + */ + +/** @defgroup FSMC_CLK_Division + * @{ + */ + +#define IS_FSMC_CLK_DIV(DIV) ((DIV) <= 0xF) + +/** + * @} + */ + +/** @defgroup FSMC_Data_Latency + * @{ + */ + +#define IS_FSMC_DATA_LATENCY(LATENCY) ((LATENCY) <= 0xF) + +/** + * @} + */ + +/** @defgroup FSMC_Access_Mode + * @{ + */ + +#define FSMC_AccessMode_A ((uint32_t)0x00000000) +#define FSMC_AccessMode_B ((uint32_t)0x10000000) +#define FSMC_AccessMode_C ((uint32_t)0x20000000) +#define FSMC_AccessMode_D ((uint32_t)0x30000000) +#define IS_FSMC_ACCESS_MODE(MODE) (((MODE) == FSMC_AccessMode_A) || \ + ((MODE) == FSMC_AccessMode_B) || \ + ((MODE) == FSMC_AccessMode_C) || \ + ((MODE) == FSMC_AccessMode_D)) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup NAND_PCCARD_Controller + * @{ + */ + +/** @defgroup FSMC_Wait_feature + * @{ + */ + +#define FSMC_Waitfeature_Disable ((uint32_t)0x00000000) +#define FSMC_Waitfeature_Enable ((uint32_t)0x00000002) +#define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_Waitfeature_Disable) || \ + ((FEATURE) == FSMC_Waitfeature_Enable)) + +/** + * @} + */ + + +/** @defgroup FSMC_ECC + * @{ + */ + +#define FSMC_ECC_Disable ((uint32_t)0x00000000) +#define FSMC_ECC_Enable ((uint32_t)0x00000040) +#define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_ECC_Disable) || \ + ((STATE) == FSMC_ECC_Enable)) + +/** + * @} + */ + +/** @defgroup FSMC_ECC_Page_Size + * @{ + */ + +#define FSMC_ECCPageSize_256Bytes ((uint32_t)0x00000000) +#define FSMC_ECCPageSize_512Bytes ((uint32_t)0x00020000) +#define FSMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000) +#define FSMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000) +#define FSMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000) +#define FSMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000) +#define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_ECCPageSize_256Bytes) || \ + ((SIZE) == FSMC_ECCPageSize_512Bytes) || \ + ((SIZE) == FSMC_ECCPageSize_1024Bytes) || \ + ((SIZE) == FSMC_ECCPageSize_2048Bytes) || \ + ((SIZE) == FSMC_ECCPageSize_4096Bytes) || \ + ((SIZE) == FSMC_ECCPageSize_8192Bytes)) + +/** + * @} + */ + +/** @defgroup FSMC_TCLR_Setup_Time + * @{ + */ + +#define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_TAR_Setup_Time + * @{ + */ + +#define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_Setup_Time + * @{ + */ + +#define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_Wait_Setup_Time + * @{ + */ + +#define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_Hold_Setup_Time + * @{ + */ + +#define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_HiZ_Setup_Time + * @{ + */ + +#define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 0xFF) + +/** + * @} + */ + +/** @defgroup FSMC_Interrupt_sources + * @{ + */ + +#define FSMC_IT_RisingEdge ((uint32_t)0x00000008) +#define FSMC_IT_Level ((uint32_t)0x00000010) +#define FSMC_IT_FallingEdge ((uint32_t)0x00000020) +#define IS_FSMC_IT(IT) ((((IT) & (uint32_t)0xFFFFFFC7) == 0x00000000) && ((IT) != 0x00000000)) +#define IS_FSMC_GET_IT(IT) (((IT) == FSMC_IT_RisingEdge) || \ + ((IT) == FSMC_IT_Level) || \ + ((IT) == FSMC_IT_FallingEdge)) +/** + * @} + */ + +/** @defgroup FSMC_Flags + * @{ + */ + +#define FSMC_FLAG_RisingEdge ((uint32_t)0x00000001) +#define FSMC_FLAG_Level ((uint32_t)0x00000002) +#define FSMC_FLAG_FallingEdge ((uint32_t)0x00000004) +#define FSMC_FLAG_FEMPT ((uint32_t)0x00000040) +#define IS_FSMC_GET_FLAG(FLAG) (((FLAG) == FSMC_FLAG_RisingEdge) || \ + ((FLAG) == FSMC_FLAG_Level) || \ + ((FLAG) == FSMC_FLAG_FallingEdge) || \ + ((FLAG) == FSMC_FLAG_FEMPT)) + +#define IS_FSMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000)) + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup FSMC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup FSMC_Exported_Functions + * @{ + */ + +void FSMC_NORSRAMDeInit(uint32_t FSMC_Bank); +void FSMC_NANDDeInit(uint32_t FSMC_Bank); +void FSMC_PCCARDDeInit(void); +void FSMC_NORSRAMInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct); +void FSMC_NANDInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct); +void FSMC_PCCARDInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct); +void FSMC_NORSRAMStructInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct); +void FSMC_NANDStructInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct); +void FSMC_PCCARDStructInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct); +void FSMC_NORSRAMCmd(uint32_t FSMC_Bank, FunctionalState NewState); +void FSMC_NANDCmd(uint32_t FSMC_Bank, FunctionalState NewState); +void FSMC_PCCARDCmd(FunctionalState NewState); +void FSMC_NANDECCCmd(uint32_t FSMC_Bank, FunctionalState NewState); +uint32_t FSMC_GetECC(uint32_t FSMC_Bank); +void FSMC_ITConfig(uint32_t FSMC_Bank, uint32_t FSMC_IT, FunctionalState NewState); +FlagStatus FSMC_GetFlagStatus(uint32_t FSMC_Bank, uint32_t FSMC_FLAG); +void FSMC_ClearFlag(uint32_t FSMC_Bank, uint32_t FSMC_FLAG); +ITStatus FSMC_GetITStatus(uint32_t FSMC_Bank, uint32_t FSMC_IT); +void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_FSMC_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_gpio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_gpio.h new file mode 100644 index 0000000..8911e6b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_gpio.h @@ -0,0 +1,383 @@ +/** + ****************************************************************************** + * @file stm32f10x_gpio.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the GPIO + * firmware library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_GPIO_H +#define __STM32F10x_GPIO_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup GPIO + * @{ + */ + +/** @defgroup GPIO_Exported_Types + * @{ + */ + +#define IS_GPIO_ALL_PERIPH(PERIPH) (((PERIPH) == GPIOA) || \ + ((PERIPH) == GPIOB) || \ + ((PERIPH) == GPIOC) || \ + ((PERIPH) == GPIOD) || \ + ((PERIPH) == GPIOE) || \ + ((PERIPH) == GPIOF) || \ + ((PERIPH) == GPIOG)) + +/** + * @brief Output Maximum frequency selection + */ + +typedef enum +{ + GPIO_Speed_10MHz = 1, + GPIO_Speed_2MHz, + GPIO_Speed_50MHz +}GPIOSpeed_TypeDef; +#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_Speed_10MHz) || ((SPEED) == GPIO_Speed_2MHz) || \ + ((SPEED) == GPIO_Speed_50MHz)) + +/** + * @brief 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; + +#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_Mode_AIN) || ((MODE) == GPIO_Mode_IN_FLOATING) || \ + ((MODE) == GPIO_Mode_IPD) || ((MODE) == GPIO_Mode_IPU) || \ + ((MODE) == GPIO_Mode_Out_OD) || ((MODE) == GPIO_Mode_Out_PP) || \ + ((MODE) == GPIO_Mode_AF_OD) || ((MODE) == GPIO_Mode_AF_PP)) + +/** + * @brief GPIO Init structure definition + */ + +typedef struct +{ + uint16_t GPIO_Pin; /*!< Specifies the GPIO pins to be configured. + This parameter can be any value of @ref GPIO_pins_define */ + + GPIOSpeed_TypeDef GPIO_Speed; /*!< Specifies the speed for the selected pins. + This parameter can be a value of @ref GPIOSpeed_TypeDef */ + + GPIOMode_TypeDef GPIO_Mode; /*!< Specifies the operating mode for the selected pins. + This parameter can be a value of @ref GPIOMode_TypeDef */ +}GPIO_InitTypeDef; + + +/** + * @brief Bit_SET and Bit_RESET enumeration + */ + +typedef enum +{ Bit_RESET = 0, + Bit_SET +}BitAction; + +#define IS_GPIO_BIT_ACTION(ACTION) (((ACTION) == Bit_RESET) || ((ACTION) == Bit_SET)) + +/** + * @} + */ + +/** @defgroup GPIO_Exported_Constants + * @{ + */ + +/** @defgroup 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_All ((uint16_t)0xFFFF) /*!< All pins selected */ + +#define IS_GPIO_PIN(PIN) ((((PIN) & (uint16_t)0x00) == 0x00) && ((PIN) != (uint16_t)0x00)) + +#define IS_GET_GPIO_PIN(PIN) (((PIN) == GPIO_Pin_0) || \ + ((PIN) == GPIO_Pin_1) || \ + ((PIN) == GPIO_Pin_2) || \ + ((PIN) == GPIO_Pin_3) || \ + ((PIN) == GPIO_Pin_4) || \ + ((PIN) == GPIO_Pin_5) || \ + ((PIN) == GPIO_Pin_6) || \ + ((PIN) == GPIO_Pin_7) || \ + ((PIN) == GPIO_Pin_8) || \ + ((PIN) == GPIO_Pin_9) || \ + ((PIN) == GPIO_Pin_10) || \ + ((PIN) == GPIO_Pin_11) || \ + ((PIN) == GPIO_Pin_12) || \ + ((PIN) == GPIO_Pin_13) || \ + ((PIN) == GPIO_Pin_14) || \ + ((PIN) == GPIO_Pin_15)) + +/** + * @} + */ + +/** @defgroup GPIO_Remap_define + * @{ + */ + +#define GPIO_Remap_SPI1 ((uint32_t)0x00000001) /*!< SPI1 Alternate Function mapping */ +#define GPIO_Remap_I2C1 ((uint32_t)0x00000002) /*!< I2C1 Alternate Function mapping */ +#define GPIO_Remap_USART1 ((uint32_t)0x00000004) /*!< USART1 Alternate Function mapping */ +#define GPIO_Remap_USART2 ((uint32_t)0x00000008) /*!< USART2 Alternate Function mapping */ +#define GPIO_PartialRemap_USART3 ((uint32_t)0x00140010) /*!< USART3 Partial Alternate Function mapping */ +#define GPIO_FullRemap_USART3 ((uint32_t)0x00140030) /*!< USART3 Full Alternate Function mapping */ +#define GPIO_PartialRemap_TIM1 ((uint32_t)0x00160040) /*!< TIM1 Partial 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_PartialRemap_TIM3 ((uint32_t)0x001A0800) /*!< TIM3 Partial Alternate Function mapping */ +#define GPIO_FullRemap_TIM3 ((uint32_t)0x001A0C00) /*!< TIM3 Full Alternate Function mapping */ +#define GPIO_Remap_TIM4 ((uint32_t)0x00001000) /*!< TIM4 Alternate Function mapping */ +#define GPIO_Remap1_CAN1 ((uint32_t)0x001D4000) /*!< CAN1 Alternate Function mapping */ +#define GPIO_Remap2_CAN1 ((uint32_t)0x001D6000) /*!< CAN1 Alternate Function mapping */ +#define GPIO_Remap_PD01 ((uint32_t)0x00008000) /*!< PD01 Alternate Function mapping */ +#define GPIO_Remap_TIM5CH4_LSI ((uint32_t)0x00200001) /*!< LSI connected to TIM5 Channel4 input capture for calibration */ +#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_ADC2_ETRGINJ ((uint32_t)0x00200008) /*!< ADC2 External Trigger Injected Conversion remapping */ +#define GPIO_Remap_ADC2_ETRGREG ((uint32_t)0x00200010) /*!< ADC2 External Trigger Regular Conversion remapping */ +#define GPIO_Remap_ETH ((uint32_t)0x00200020) /*!< Ethernet remapping (only for Connectivity line devices) */ +#define GPIO_Remap_CAN2 ((uint32_t)0x00200040) /*!< CAN2 remapping (only for Connectivity line devices) */ +#define GPIO_Remap_SWJ_NoJTRST ((uint32_t)0x00300100) /*!< Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST */ +#define GPIO_Remap_SWJ_JTAGDisable ((uint32_t)0x00300200) /*!< JTAG-DP Disabled and SW-DP Enabled */ +#define GPIO_Remap_SWJ_Disable ((uint32_t)0x00300400) /*!< Full SWJ Disabled (JTAG-DP + SW-DP) */ +#define GPIO_Remap_SPI3 ((uint32_t)0x00201100) /*!< SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices) */ +#define GPIO_Remap_TIM2ITR1_PTP_SOF ((uint32_t)0x00202000) /*!< Ethernet PTP output or USB OTG SOF (Start of Frame) connected + to TIM2 Internal Trigger 1 for calibration + (only for Connectivity line devices) */ +#define GPIO_Remap_PTP_PPS ((uint32_t)0x00204000) /*!< Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices) */ + +#define GPIO_Remap_TIM15 ((uint32_t)0x80000001) /*!< TIM15 Alternate Function mapping (only for Value line devices) */ +#define GPIO_Remap_TIM16 ((uint32_t)0x80000002) /*!< TIM16 Alternate Function mapping (only for Value line devices) */ +#define GPIO_Remap_TIM17 ((uint32_t)0x80000004) /*!< TIM17 Alternate Function mapping (only for Value line devices) */ +#define GPIO_Remap_CEC ((uint32_t)0x80000008) /*!< CEC Alternate Function mapping (only for Value line devices) */ +#define GPIO_Remap_TIM1_DMA ((uint32_t)0x80000010) /*!< TIM1 DMA requests mapping (only for Value line devices) */ + +#define GPIO_Remap_TIM9 ((uint32_t)0x80000020) /*!< TIM9 Alternate Function mapping (only for XL-density devices) */ +#define GPIO_Remap_TIM10 ((uint32_t)0x80000040) /*!< TIM10 Alternate Function mapping (only for XL-density devices) */ +#define GPIO_Remap_TIM11 ((uint32_t)0x80000080) /*!< TIM11 Alternate Function mapping (only for XL-density devices) */ +#define GPIO_Remap_TIM13 ((uint32_t)0x80000100) /*!< TIM13 Alternate Function mapping (only for High density Value line and XL-density devices) */ +#define GPIO_Remap_TIM14 ((uint32_t)0x80000200) /*!< TIM14 Alternate Function mapping (only for High density Value line and XL-density devices) */ +#define GPIO_Remap_FSMC_NADV ((uint32_t)0x80000400) /*!< FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices) */ + +#define GPIO_Remap_TIM67_DAC_DMA ((uint32_t)0x80000800) /*!< TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices) */ +#define GPIO_Remap_TIM12 ((uint32_t)0x80001000) /*!< TIM12 Alternate Function mapping (only for High density Value line devices) */ +#define GPIO_Remap_MISC ((uint32_t)0x80002000) /*!< Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping, + only for High density Value line devices) */ + +#define IS_GPIO_REMAP(REMAP) (((REMAP) == GPIO_Remap_SPI1) || ((REMAP) == GPIO_Remap_I2C1) || \ + ((REMAP) == GPIO_Remap_USART1) || ((REMAP) == GPIO_Remap_USART2) || \ + ((REMAP) == GPIO_PartialRemap_USART3) || ((REMAP) == GPIO_FullRemap_USART3) || \ + ((REMAP) == GPIO_PartialRemap_TIM1) || ((REMAP) == GPIO_FullRemap_TIM1) || \ + ((REMAP) == GPIO_PartialRemap1_TIM2) || ((REMAP) == GPIO_PartialRemap2_TIM2) || \ + ((REMAP) == GPIO_FullRemap_TIM2) || ((REMAP) == GPIO_PartialRemap_TIM3) || \ + ((REMAP) == GPIO_FullRemap_TIM3) || ((REMAP) == GPIO_Remap_TIM4) || \ + ((REMAP) == GPIO_Remap1_CAN1) || ((REMAP) == GPIO_Remap2_CAN1) || \ + ((REMAP) == GPIO_Remap_PD01) || ((REMAP) == GPIO_Remap_TIM5CH4_LSI) || \ + ((REMAP) == GPIO_Remap_ADC1_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC1_ETRGREG) || \ + ((REMAP) == GPIO_Remap_ADC2_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC2_ETRGREG) || \ + ((REMAP) == GPIO_Remap_ETH) ||((REMAP) == GPIO_Remap_CAN2) || \ + ((REMAP) == GPIO_Remap_SWJ_NoJTRST) || ((REMAP) == GPIO_Remap_SWJ_JTAGDisable) || \ + ((REMAP) == GPIO_Remap_SWJ_Disable)|| ((REMAP) == GPIO_Remap_SPI3) || \ + ((REMAP) == GPIO_Remap_TIM2ITR1_PTP_SOF) || ((REMAP) == GPIO_Remap_PTP_PPS) || \ + ((REMAP) == GPIO_Remap_TIM15) || ((REMAP) == GPIO_Remap_TIM16) || \ + ((REMAP) == GPIO_Remap_TIM17) || ((REMAP) == GPIO_Remap_CEC) || \ + ((REMAP) == GPIO_Remap_TIM1_DMA) || ((REMAP) == GPIO_Remap_TIM9) || \ + ((REMAP) == GPIO_Remap_TIM10) || ((REMAP) == GPIO_Remap_TIM11) || \ + ((REMAP) == GPIO_Remap_TIM13) || ((REMAP) == GPIO_Remap_TIM14) || \ + ((REMAP) == GPIO_Remap_FSMC_NADV) || ((REMAP) == GPIO_Remap_TIM67_DAC_DMA) || \ + ((REMAP) == GPIO_Remap_TIM12) || ((REMAP) == GPIO_Remap_MISC)) + +/** + * @} + */ + +/** @defgroup GPIO_Port_Sources + * @{ + */ + +#define GPIO_PortSourceGPIOA ((uint8_t)0x00) +#define GPIO_PortSourceGPIOB ((uint8_t)0x01) +#define GPIO_PortSourceGPIOC ((uint8_t)0x02) +#define GPIO_PortSourceGPIOD ((uint8_t)0x03) +#define GPIO_PortSourceGPIOE ((uint8_t)0x04) +#define GPIO_PortSourceGPIOF ((uint8_t)0x05) +#define GPIO_PortSourceGPIOG ((uint8_t)0x06) +#define IS_GPIO_EVENTOUT_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOB) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOC) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOD) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOE)) + +#define IS_GPIO_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOB) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOC) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOD) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOE) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOF) || \ + ((PORTSOURCE) == GPIO_PortSourceGPIOG)) + +/** + * @} + */ + +/** @defgroup 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 IS_GPIO_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == GPIO_PinSource0) || \ + ((PINSOURCE) == GPIO_PinSource1) || \ + ((PINSOURCE) == GPIO_PinSource2) || \ + ((PINSOURCE) == GPIO_PinSource3) || \ + ((PINSOURCE) == GPIO_PinSource4) || \ + ((PINSOURCE) == GPIO_PinSource5) || \ + ((PINSOURCE) == GPIO_PinSource6) || \ + ((PINSOURCE) == GPIO_PinSource7) || \ + ((PINSOURCE) == GPIO_PinSource8) || \ + ((PINSOURCE) == GPIO_PinSource9) || \ + ((PINSOURCE) == GPIO_PinSource10) || \ + ((PINSOURCE) == GPIO_PinSource11) || \ + ((PINSOURCE) == GPIO_PinSource12) || \ + ((PINSOURCE) == GPIO_PinSource13) || \ + ((PINSOURCE) == GPIO_PinSource14) || \ + ((PINSOURCE) == GPIO_PinSource15)) + +/** + * @} + */ + +/** @defgroup Ethernet_Media_Interface + * @{ + */ +#define GPIO_ETH_MediaInterface_MII ((u32)0x00000000) +#define GPIO_ETH_MediaInterface_RMII ((u32)0x00000001) + +#define IS_GPIO_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == GPIO_ETH_MediaInterface_MII) || \ + ((INTERFACE) == GPIO_ETH_MediaInterface_RMII)) + +/** + * @} + */ +/** + * @} + */ + +/** @defgroup GPIO_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup GPIO_Exported_Functions + * @{ + */ + +void GPIO_DeInit(GPIO_TypeDef* GPIOx); +void GPIO_AFIODeInit(void); +void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct); +void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct); +uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx); +uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx); +void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal); +void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal); +void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource); +void GPIO_EventOutputCmd(FunctionalState NewState); +void GPIO_PinRemapConfig(uint32_t GPIO_Remap, FunctionalState NewState); +void GPIO_EXTILineConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource); +void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_GPIO_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_i2c.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_i2c.h new file mode 100644 index 0000000..c661002 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_i2c.h @@ -0,0 +1,682 @@ +/** + ****************************************************************************** + * @file stm32f10x_i2c.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the I2C firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_I2C_H +#define __STM32F10x_I2C_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup I2C + * @{ + */ + +/** @defgroup I2C_Exported_Types + * @{ + */ + +/** + * @brief I2C Init structure definition + */ + +typedef struct +{ + uint32_t I2C_ClockSpeed; /*!< Specifies the clock frequency. + This parameter must be set to a value lower than 400kHz */ + + uint16_t I2C_Mode; /*!< Specifies the I2C mode. + This parameter can be a value of @ref I2C_mode */ + + uint16_t I2C_DutyCycle; /*!< Specifies the I2C fast mode duty cycle. + This parameter can be a value of @ref I2C_duty_cycle_in_fast_mode */ + + uint16_t I2C_OwnAddress1; /*!< Specifies the first device own address. + This parameter can be a 7-bit or 10-bit address. */ + + uint16_t I2C_Ack; /*!< Enables or disables the acknowledgement. + This parameter can be a value of @ref I2C_acknowledgement */ + + uint16_t I2C_AcknowledgedAddress; /*!< Specifies if 7-bit or 10-bit address is acknowledged. + This parameter can be a value of @ref I2C_acknowledged_address */ +}I2C_InitTypeDef; + +/** + * @} + */ + + +/** @defgroup I2C_Exported_Constants + * @{ + */ + +#define IS_I2C_ALL_PERIPH(PERIPH) (((PERIPH) == I2C1) || \ + ((PERIPH) == I2C2)) +/** @defgroup I2C_mode + * @{ + */ + +#define I2C_Mode_I2C ((uint16_t)0x0000) +#define I2C_Mode_SMBusDevice ((uint16_t)0x0002) +#define I2C_Mode_SMBusHost ((uint16_t)0x000A) +#define IS_I2C_MODE(MODE) (((MODE) == I2C_Mode_I2C) || \ + ((MODE) == I2C_Mode_SMBusDevice) || \ + ((MODE) == I2C_Mode_SMBusHost)) +/** + * @} + */ + +/** @defgroup 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 */ +#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DutyCycle_16_9) || \ + ((CYCLE) == I2C_DutyCycle_2)) +/** + * @} + */ + +/** @defgroup I2C_acknowledgement + * @{ + */ + +#define I2C_Ack_Enable ((uint16_t)0x0400) +#define I2C_Ack_Disable ((uint16_t)0x0000) +#define IS_I2C_ACK_STATE(STATE) (((STATE) == I2C_Ack_Enable) || \ + ((STATE) == I2C_Ack_Disable)) +/** + * @} + */ + +/** @defgroup I2C_transfer_direction + * @{ + */ + +#define I2C_Direction_Transmitter ((uint8_t)0x00) +#define I2C_Direction_Receiver ((uint8_t)0x01) +#define IS_I2C_DIRECTION(DIRECTION) (((DIRECTION) == I2C_Direction_Transmitter) || \ + ((DIRECTION) == I2C_Direction_Receiver)) +/** + * @} + */ + +/** @defgroup I2C_acknowledged_address + * @{ + */ + +#define I2C_AcknowledgedAddress_7bit ((uint16_t)0x4000) +#define I2C_AcknowledgedAddress_10bit ((uint16_t)0xC000) +#define IS_I2C_ACKNOWLEDGE_ADDRESS(ADDRESS) (((ADDRESS) == I2C_AcknowledgedAddress_7bit) || \ + ((ADDRESS) == I2C_AcknowledgedAddress_10bit)) +/** + * @} + */ + +/** @defgroup I2C_registers + * @{ + */ + +#define I2C_Register_CR1 ((uint8_t)0x00) +#define I2C_Register_CR2 ((uint8_t)0x04) +#define I2C_Register_OAR1 ((uint8_t)0x08) +#define I2C_Register_OAR2 ((uint8_t)0x0C) +#define I2C_Register_DR ((uint8_t)0x10) +#define I2C_Register_SR1 ((uint8_t)0x14) +#define I2C_Register_SR2 ((uint8_t)0x18) +#define I2C_Register_CCR ((uint8_t)0x1C) +#define I2C_Register_TRISE ((uint8_t)0x20) +#define IS_I2C_REGISTER(REGISTER) (((REGISTER) == I2C_Register_CR1) || \ + ((REGISTER) == I2C_Register_CR2) || \ + ((REGISTER) == I2C_Register_OAR1) || \ + ((REGISTER) == I2C_Register_OAR2) || \ + ((REGISTER) == I2C_Register_DR) || \ + ((REGISTER) == I2C_Register_SR1) || \ + ((REGISTER) == I2C_Register_SR2) || \ + ((REGISTER) == I2C_Register_CCR) || \ + ((REGISTER) == I2C_Register_TRISE)) +/** + * @} + */ + +/** @defgroup I2C_SMBus_alert_pin_level + * @{ + */ + +#define I2C_SMBusAlert_Low ((uint16_t)0x2000) +#define I2C_SMBusAlert_High ((uint16_t)0xDFFF) +#define IS_I2C_SMBUS_ALERT(ALERT) (((ALERT) == I2C_SMBusAlert_Low) || \ + ((ALERT) == I2C_SMBusAlert_High)) +/** + * @} + */ + +/** @defgroup I2C_PEC_position + * @{ + */ + +#define I2C_PECPosition_Next ((uint16_t)0x0800) +#define I2C_PECPosition_Current ((uint16_t)0xF7FF) +#define IS_I2C_PEC_POSITION(POSITION) (((POSITION) == I2C_PECPosition_Next) || \ + ((POSITION) == I2C_PECPosition_Current)) +/** + * @} + */ + +/** @defgroup I2C_NCAK_position + * @{ + */ + +#define I2C_NACKPosition_Next ((uint16_t)0x0800) +#define I2C_NACKPosition_Current ((uint16_t)0xF7FF) +#define IS_I2C_NACK_POSITION(POSITION) (((POSITION) == I2C_NACKPosition_Next) || \ + ((POSITION) == I2C_NACKPosition_Current)) +/** + * @} + */ + +/** @defgroup I2C_interrupts_definition + * @{ + */ + +#define I2C_IT_BUF ((uint16_t)0x0400) +#define I2C_IT_EVT ((uint16_t)0x0200) +#define I2C_IT_ERR ((uint16_t)0x0100) +#define IS_I2C_CONFIG_IT(IT) ((((IT) & (uint16_t)0xF8FF) == 0x00) && ((IT) != 0x00)) +/** + * @} + */ + +/** @defgroup I2C_interrupts_definition + * @{ + */ + +#define I2C_IT_SMBALERT ((uint32_t)0x01008000) +#define I2C_IT_TIMEOUT ((uint32_t)0x01004000) +#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) + +#define IS_I2C_CLEAR_IT(IT) ((((IT) & (uint16_t)0x20FF) == 0x00) && ((IT) != (uint16_t)0x00)) + +#define IS_I2C_GET_IT(IT) (((IT) == I2C_IT_SMBALERT) || ((IT) == I2C_IT_TIMEOUT) || \ + ((IT) == I2C_IT_PECERR) || ((IT) == I2C_IT_OVR) || \ + ((IT) == I2C_IT_AF) || ((IT) == I2C_IT_ARLO) || \ + ((IT) == I2C_IT_BERR) || ((IT) == I2C_IT_TXE) || \ + ((IT) == I2C_IT_RXNE) || ((IT) == I2C_IT_STOPF) || \ + ((IT) == I2C_IT_ADD10) || ((IT) == I2C_IT_BTF) || \ + ((IT) == I2C_IT_ADDR) || ((IT) == I2C_IT_SB)) +/** + * @} + */ + +/** @defgroup I2C_flags_definition + * @{ + */ + +/** + * @brief SR2 register flags + */ + +#define I2C_FLAG_DUALF ((uint32_t)0x00800000) +#define I2C_FLAG_SMBHOST ((uint32_t)0x00400000) +#define I2C_FLAG_SMBDEFAULT ((uint32_t)0x00200000) +#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) + +/** + * @brief SR1 register flags + */ + +#define I2C_FLAG_SMBALERT ((uint32_t)0x10008000) +#define I2C_FLAG_TIMEOUT ((uint32_t)0x10004000) +#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) + +#define IS_I2C_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0x20FF) == 0x00) && ((FLAG) != (uint16_t)0x00)) + +#define IS_I2C_GET_FLAG(FLAG) (((FLAG) == I2C_FLAG_DUALF) || ((FLAG) == I2C_FLAG_SMBHOST) || \ + ((FLAG) == I2C_FLAG_SMBDEFAULT) || ((FLAG) == I2C_FLAG_GENCALL) || \ + ((FLAG) == I2C_FLAG_TRA) || ((FLAG) == I2C_FLAG_BUSY) || \ + ((FLAG) == I2C_FLAG_MSL) || ((FLAG) == I2C_FLAG_SMBALERT) || \ + ((FLAG) == I2C_FLAG_TIMEOUT) || ((FLAG) == I2C_FLAG_PECERR) || \ + ((FLAG) == I2C_FLAG_OVR) || ((FLAG) == I2C_FLAG_AF) || \ + ((FLAG) == I2C_FLAG_ARLO) || ((FLAG) == I2C_FLAG_BERR) || \ + ((FLAG) == I2C_FLAG_TXE) || ((FLAG) == I2C_FLAG_RXNE) || \ + ((FLAG) == I2C_FLAG_STOPF) || ((FLAG) == I2C_FLAG_ADD10) || \ + ((FLAG) == I2C_FLAG_BTF) || ((FLAG) == I2C_FLAG_ADDR) || \ + ((FLAG) == I2C_FLAG_SB)) +/** + * @} + */ + +/** @defgroup I2C_Events + * @{ + */ + +/*======================================== + + I2C Master Events (Events grouped in order of communication) + ==========================================*/ +/** + * @brief Communication start + * + * After sending the START condition (I2C_GenerateSTART() function) the master + * has to wait for this event. It means that the Start condition has been correctly + * released on the I2C bus (the bus is free, no other devices is communicating). + * + */ +/* --EV5 */ +#define I2C_EVENT_MASTER_MODE_SELECT ((uint32_t)0x00030001) /* BUSY, MSL and SB flag */ + +/** + * @brief Address Acknowledge + * + * After checking on EV5 (start condition correctly released on the bus), the + * master sends the address of the slave(s) with which it will communicate + * (I2C_Send7bitAddress() function, it also determines the direction of the communication: + * Master 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 (just after generating the START + * and checking on EV5) has to send the header of 10-bit addressing mode (I2C_SendData() + * function). Then master should wait on EV9. It means that the 10-bit addressing + * header has been correctly sent on the bus. Then master should send the second part of + * the 10-bit address (LSB) using the function I2C_Send7bitAddress(). Then master + * should wait for event EV6. + * + */ + +/* --EV6 */ +#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 */ +/* --EV9 */ +#define I2C_EVENT_MASTER_MODE_ADDRESS10 ((uint32_t)0x00030008) /* BUSY, MSL and ADD10 flags */ + +/** + * @brief Communication events + * + * If a communication is established (START condition generated and slave address + * acknowledged) then the master has to check on one of the following events for + * communication procedures: + * + * 1) Master Receiver mode: The master has to wait on the event EV7 then to read + * the data received from the slave (I2C_ReceiveData() function). + * + * 2) Master Transmitter mode: The master has to send data (I2C_SendData() + * function) then to wait on event EV8 or EV8_2. + * These two events are similar: + * - EV8 means that the data has been written in the data register and is + * being shifted out. + * - EV8_2 means that the data has been physically shifted out and output + * on the bus. + * In most cases, using EV8 is sufficient for the application. + * Using EV8_2 leads to a slower communication but ensure more reliable test. + * EV8_2 is also more suitable than EV8 for testing on the last data transmission + * (before Stop condition generation). + * + * @note In case the user software does not guarantee that this event EV7 is + * managed before the current byte end of transfer, then user may check on EV7 + * and BTF flag at the same time (ie. (I2C_EVENT_MASTER_BYTE_RECEIVED | I2C_FLAG_BTF)). + * In this case the communication may be slower. + * + */ + +/* Master RECEIVER mode -----------------------------*/ +/* --EV7 */ +#define I2C_EVENT_MASTER_BYTE_RECEIVED ((uint32_t)0x00030040) /* BUSY, MSL and RXNE flags */ + +/* Master TRANSMITTER mode --------------------------*/ +/* --EV8 */ +#define I2C_EVENT_MASTER_BYTE_TRANSMITTING ((uint32_t)0x00070080) /* TRA, BUSY, MSL, TXE flags */ +/* --EV8_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 Communication start events + * + * Wait on one of these events at the start of the communication. It means that + * the I2C peripheral detected a Start condition on the bus (generated by master + * device) followed by the peripheral address. The peripheral generates an ACK + * condition on the bus (if the acknowledge feature is enabled through function + * I2C_AcknowledgeConfig()) and the events listed above are set : + * + * 1) 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). + * + * 2) 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. + * + * 3) 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. + * + */ + +/* --EV1 (all the events below are variants of EV1) */ +/* 1) 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 */ + +/* 2) 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 */ + +/* 3) 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 EV1 has already been checked and: + * + * - Slave RECEIVER mode: + * - EV2: When the application is expecting a data byte to be received. + * - EV4: When the application is expecting the end of the communication: master + * sends a stop condition and data transmission is stopped. + * + * - Slave Transmitter mode: + * - EV3: When a byte has been transmitted by the slave and the application is expecting + * the end of the byte transmission. The two events I2C_EVENT_SLAVE_BYTE_TRANSMITTED and + * I2C_EVENT_SLAVE_BYTE_TRANSMITTING are similar. The second one can optionally be + * used when the user software doesn't guarantee the EV3 is managed before the + * current byte end of transfer. + * - EV3_2: When the master sends a NACK in order to tell slave that data transmission + * shall end (before sending the STOP condition). In this case slave has to stop sending + * data bytes and expect a Stop condition on the bus. + * + * @note In case the user software does not guarantee that the event EV2 is + * managed before the current byte end of transfer, then user may check on EV2 + * and BTF flag at the same time (ie. (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_BTF)). + * In this case the communication may be slower. + * + */ + +/* Slave RECEIVER mode --------------------------*/ +/* --EV2 */ +#define I2C_EVENT_SLAVE_BYTE_RECEIVED ((uint32_t)0x00020040) /* BUSY and RXNE flags */ +/* --EV4 */ +#define I2C_EVENT_SLAVE_STOP_DETECTED ((uint32_t)0x00000010) /* STOPF flag */ + +/* Slave TRANSMITTER mode -----------------------*/ +/* --EV3 */ +#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 */ +/* --EV3_2 */ +#define I2C_EVENT_SLAVE_ACK_FAILURE ((uint32_t)0x00000400) /* AF flag */ + +/*=========================== End of Events Description ==========================================*/ + +#define IS_I2C_EVENT(EVENT) (((EVENT) == I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED) || \ + ((EVENT) == I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED) || \ + ((EVENT) == I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED) || \ + ((EVENT) == I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED) || \ + ((EVENT) == I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED) || \ + ((EVENT) == I2C_EVENT_SLAVE_BYTE_RECEIVED) || \ + ((EVENT) == (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_DUALF)) || \ + ((EVENT) == (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_GENCALL)) || \ + ((EVENT) == I2C_EVENT_SLAVE_BYTE_TRANSMITTED) || \ + ((EVENT) == (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_DUALF)) || \ + ((EVENT) == (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_GENCALL)) || \ + ((EVENT) == I2C_EVENT_SLAVE_STOP_DETECTED) || \ + ((EVENT) == I2C_EVENT_MASTER_MODE_SELECT) || \ + ((EVENT) == I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED) || \ + ((EVENT) == I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED) || \ + ((EVENT) == I2C_EVENT_MASTER_BYTE_RECEIVED) || \ + ((EVENT) == I2C_EVENT_MASTER_BYTE_TRANSMITTED) || \ + ((EVENT) == I2C_EVENT_MASTER_BYTE_TRANSMITTING) || \ + ((EVENT) == I2C_EVENT_MASTER_MODE_ADDRESS10) || \ + ((EVENT) == I2C_EVENT_SLAVE_ACK_FAILURE)) +/** + * @} + */ + +/** @defgroup I2C_own_address1 + * @{ + */ + +#define IS_I2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x3FF) +/** + * @} + */ + +/** @defgroup I2C_clock_speed + * @{ + */ + +#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) >= 0x1) && ((SPEED) <= 400000)) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup I2C_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup I2C_Exported_Functions + * @{ + */ + +void I2C_DeInit(I2C_TypeDef* I2Cx); +void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct); +void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct); +void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address); +void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_ITConfig(I2C_TypeDef* I2Cx, uint16_t I2C_IT, FunctionalState NewState); +void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data); +uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx); +void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C_Direction); +uint16_t I2C_ReadRegister(I2C_TypeDef* I2Cx, uint8_t I2C_Register); +void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition); +void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t I2C_SMBusAlert); +void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_PECPosition); +void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState); +uint8_t I2C_GetPEC(I2C_TypeDef* I2Cx); +void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState); +void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t I2C_DutyCycle); + +/** + * @brief + **************************************************************************************** + * + * I2C State Monitoring Functions + * + **************************************************************************************** + * This I2C driver provides three different ways for I2C state monitoring + * depending on the application requirements and constraints: + * + * + * 1) Basic state monitoring: + * Using I2C_CheckEvent() function: + * It compares the status registers (SR1 and SR2) content to a given event + * (can be the combination of one or more flags). + * It returns SUCCESS if the current status includes the given flags + * and returns ERROR if one or more flags are missing in the current status. + * - When to use: + * - This function is suitable for most applications as well as for startup + * activity since the events are fully described in the product reference manual + * (RM0008). + * - It is also suitable for users who need to define their own events. + * - Limitations: + * - If an error occurs (ie. error flags are set besides to the monitored flags), + * the I2C_CheckEvent() function may return SUCCESS despite the communication + * hold or corrupted real state. + * In this case, it is advised to use error interrupts to monitor the error + * events and handle them in the interrupt IRQ handler. + * + * @note + * For error management, it is advised to use the following functions: + * - I2C_ITConfig() to configure and enable the error interrupts (I2C_IT_ERR). + * - I2Cx_ER_IRQHandler() which is called when the error interrupt occurs. + * Where x is the peripheral instance (I2C1, I2C2 ...) + * - I2C_GetFlagStatus() or I2C_GetITStatus() to be called into I2Cx_ER_IRQHandler() + * in order to determine which error occurred. + * - I2C_ClearFlag() or I2C_ClearITPendingBit() and/or I2C_SoftwareResetCmd() + * and/or I2C_GenerateStop() in order to clear the error flag and source, + * and return to correct communication status. + * + * + * 2) Advanced state monitoring: + * Using the function I2C_GetLastEvent() which returns the image of both status + * registers in a single word (uint32_t) (Status Register 2 value is shifted left + * by 16 bits and concatenated to Status Register 1). + * - When to use: + * - This function is suitable for the same applications above but it allows to + * overcome the limitations of I2C_GetFlagStatus() function (see below). + * The returned value could be compared to events already defined in the + * library (stm32f10x_i2c.h) or to custom values defined by user. + * - This function is suitable when multiple flags are monitored at the same time. + * - At the opposite of I2C_CheckEvent() function, this function allows user to + * choose when an event is accepted (when all events flags are set and no + * other flags are set or just when the needed flags are set like + * I2C_CheckEvent() function). + * - Limitations: + * - User may need to define his own events. + * - Same remark concerning the error management is applicable for this + * function if user decides to check only regular communication flags (and + * ignores error flags). + * + * + * 3) Flag-based state monitoring: + * Using the function I2C_GetFlagStatus() which simply returns the status of + * one single flag (ie. I2C_FLAG_RXNE ...). + * - When to use: + * - This function could be used for specific applications or in debug phase. + * - It is suitable when only one flag checking is needed (most I2C events + * are monitored through multiple flags). + * - Limitations: + * - When calling this function, the Status register is accessed. Some flags are + * cleared when the status register is accessed. So checking the status + * of one Flag, may clear other ones. + * - Function may need to be called twice or more in order to monitor one + * single event. + * + */ + +/** + * + * 1) Basic state monitoring + ******************************************************************************* + */ +ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, uint32_t I2C_EVENT); +/** + * + * 2) Advanced state monitoring + ******************************************************************************* + */ +uint32_t I2C_GetLastEvent(I2C_TypeDef* I2Cx); +/** + * + * 3) Flag-based state monitoring + ******************************************************************************* + */ +FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG); +/** + * + ******************************************************************************* + */ + +void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG); +ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT); +void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_I2C_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_iwdg.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_iwdg.h new file mode 100644 index 0000000..76e3949 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_iwdg.h @@ -0,0 +1,138 @@ +/** + ****************************************************************************** + * @file stm32f10x_iwdg.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the IWDG + * firmware library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_IWDG_H +#define __STM32F10x_IWDG_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup IWDG + * @{ + */ + +/** @defgroup IWDG_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Exported_Constants + * @{ + */ + +/** @defgroup IWDG_WriteAccess + * @{ + */ + +#define IWDG_WriteAccess_Enable ((uint16_t)0x5555) +#define IWDG_WriteAccess_Disable ((uint16_t)0x0000) +#define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ + ((ACCESS) == IWDG_WriteAccess_Disable)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ + ((PRESCALER) == IWDG_Prescaler_8) || \ + ((PRESCALER) == IWDG_Prescaler_16) || \ + ((PRESCALER) == IWDG_Prescaler_32) || \ + ((PRESCALER) == IWDG_Prescaler_64) || \ + ((PRESCALER) == IWDG_Prescaler_128)|| \ + ((PRESCALER) == IWDG_Prescaler_256)) +/** + * @} + */ + +/** @defgroup IWDG_Flag + * @{ + */ + +#define IWDG_FLAG_PVU ((uint16_t)0x0001) +#define IWDG_FLAG_RVU ((uint16_t)0x0002) +#define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)) +#define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup IWDG_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Exported_Functions + * @{ + */ + +void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess); +void IWDG_SetPrescaler(uint8_t IWDG_Prescaler); +void IWDG_SetReload(uint16_t Reload); +void IWDG_ReloadCounter(void); +void IWDG_Enable(void); +FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_IWDG_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_pwr.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_pwr.h new file mode 100644 index 0000000..927aa81 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_pwr.h @@ -0,0 +1,154 @@ +/** + ****************************************************************************** + * @file stm32f10x_pwr.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the PWR firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_PWR_H +#define __STM32F10x_PWR_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup PWR + * @{ + */ + +/** @defgroup PWR_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup PWR_Exported_Constants + * @{ + */ + +/** @defgroup PVD_detection_level + * @{ + */ + +#define PWR_PVDLevel_2V2 ((uint32_t)0x00000000) +#define PWR_PVDLevel_2V3 ((uint32_t)0x00000020) +#define PWR_PVDLevel_2V4 ((uint32_t)0x00000040) +#define PWR_PVDLevel_2V5 ((uint32_t)0x00000060) +#define PWR_PVDLevel_2V6 ((uint32_t)0x00000080) +#define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0) +#define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0) +#define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0) +#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \ + ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \ + ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \ + ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9)) +/** + * @} + */ + +/** @defgroup Regulator_state_is_STOP_mode + * @{ + */ + +#define PWR_Regulator_ON ((uint32_t)0x00000000) +#define PWR_Regulator_LowPower ((uint32_t)0x00000001) +#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \ + ((REGULATOR) == PWR_Regulator_LowPower)) +/** + * @} + */ + +/** @defgroup STOP_mode_entry + * @{ + */ + +#define PWR_STOPEntry_WFI ((uint8_t)0x01) +#define PWR_STOPEntry_WFE ((uint8_t)0x02) +#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE)) + +/** + * @} + */ + +/** @defgroup PWR_Flag + * @{ + */ + +#define PWR_FLAG_WU ((uint32_t)0x00000001) +#define PWR_FLAG_SB ((uint32_t)0x00000002) +#define PWR_FLAG_PVDO ((uint32_t)0x00000004) +#define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \ + ((FLAG) == PWR_FLAG_PVDO)) + +#define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB)) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup PWR_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup PWR_Exported_Functions + * @{ + */ + +void PWR_DeInit(void); +void PWR_BackupAccessCmd(FunctionalState NewState); +void PWR_PVDCmd(FunctionalState NewState); +void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel); +void PWR_WakeUpPinCmd(FunctionalState NewState); +void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry); +void PWR_EnterSTANDBYMode(void); +FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG); +void PWR_ClearFlag(uint32_t PWR_FLAG); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_PWR_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rcc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rcc.h new file mode 100644 index 0000000..64c4677 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rcc.h @@ -0,0 +1,725 @@ +/** + ****************************************************************************** + * @file stm32f10x_rcc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the RCC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_RCC_H +#define __STM32F10x_RCC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup RCC + * @{ + */ + +/** @defgroup RCC_Exported_Types + * @{ + */ + +typedef struct +{ + uint32_t SYSCLK_Frequency; /*!< returns SYSCLK clock frequency expressed in Hz */ + uint32_t HCLK_Frequency; /*!< returns HCLK clock frequency expressed in Hz */ + uint32_t PCLK1_Frequency; /*!< returns PCLK1 clock frequency expressed in Hz */ + uint32_t PCLK2_Frequency; /*!< returns PCLK2 clock frequency expressed in Hz */ + uint32_t ADCCLK_Frequency; /*!< returns ADCCLK clock frequency expressed in Hz */ +}RCC_ClocksTypeDef; + +/** + * @} + */ + +/** @defgroup RCC_Exported_Constants + * @{ + */ + +/** @defgroup HSE_configuration + * @{ + */ + +#define RCC_HSE_OFF ((uint32_t)0x00000000) +#define RCC_HSE_ON ((uint32_t)0x00010000) +#define RCC_HSE_Bypass ((uint32_t)0x00040000) +#define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \ + ((HSE) == RCC_HSE_Bypass)) + +/** + * @} + */ + +/** @defgroup PLL_entry_clock_source + * @{ + */ + +#define RCC_PLLSource_HSI_Div2 ((uint32_t)0x00000000) + +#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_CL) + #define RCC_PLLSource_HSE_Div1 ((uint32_t)0x00010000) + #define RCC_PLLSource_HSE_Div2 ((uint32_t)0x00030000) + #define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \ + ((SOURCE) == RCC_PLLSource_HSE_Div1) || \ + ((SOURCE) == RCC_PLLSource_HSE_Div2)) +#else + #define RCC_PLLSource_PREDIV1 ((uint32_t)0x00010000) + #define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \ + ((SOURCE) == RCC_PLLSource_PREDIV1)) +#endif /* STM32F10X_CL */ + +/** + * @} + */ + +/** @defgroup PLL_multiplication_factor + * @{ + */ +#ifndef STM32F10X_CL + #define RCC_PLLMul_2 ((uint32_t)0x00000000) + #define RCC_PLLMul_3 ((uint32_t)0x00040000) + #define RCC_PLLMul_4 ((uint32_t)0x00080000) + #define RCC_PLLMul_5 ((uint32_t)0x000C0000) + #define RCC_PLLMul_6 ((uint32_t)0x00100000) + #define RCC_PLLMul_7 ((uint32_t)0x00140000) + #define RCC_PLLMul_8 ((uint32_t)0x00180000) + #define RCC_PLLMul_9 ((uint32_t)0x001C0000) + #define RCC_PLLMul_10 ((uint32_t)0x00200000) + #define RCC_PLLMul_11 ((uint32_t)0x00240000) + #define RCC_PLLMul_12 ((uint32_t)0x00280000) + #define RCC_PLLMul_13 ((uint32_t)0x002C0000) + #define RCC_PLLMul_14 ((uint32_t)0x00300000) + #define RCC_PLLMul_15 ((uint32_t)0x00340000) + #define RCC_PLLMul_16 ((uint32_t)0x00380000) + #define IS_RCC_PLL_MUL(MUL) (((MUL) == RCC_PLLMul_2) || ((MUL) == RCC_PLLMul_3) || \ + ((MUL) == RCC_PLLMul_4) || ((MUL) == RCC_PLLMul_5) || \ + ((MUL) == RCC_PLLMul_6) || ((MUL) == RCC_PLLMul_7) || \ + ((MUL) == RCC_PLLMul_8) || ((MUL) == RCC_PLLMul_9) || \ + ((MUL) == RCC_PLLMul_10) || ((MUL) == RCC_PLLMul_11) || \ + ((MUL) == RCC_PLLMul_12) || ((MUL) == RCC_PLLMul_13) || \ + ((MUL) == RCC_PLLMul_14) || ((MUL) == RCC_PLLMul_15) || \ + ((MUL) == RCC_PLLMul_16)) + +#else + #define RCC_PLLMul_4 ((uint32_t)0x00080000) + #define RCC_PLLMul_5 ((uint32_t)0x000C0000) + #define RCC_PLLMul_6 ((uint32_t)0x00100000) + #define RCC_PLLMul_7 ((uint32_t)0x00140000) + #define RCC_PLLMul_8 ((uint32_t)0x00180000) + #define RCC_PLLMul_9 ((uint32_t)0x001C0000) + #define RCC_PLLMul_6_5 ((uint32_t)0x00340000) + + #define IS_RCC_PLL_MUL(MUL) (((MUL) == RCC_PLLMul_4) || ((MUL) == RCC_PLLMul_5) || \ + ((MUL) == RCC_PLLMul_6) || ((MUL) == RCC_PLLMul_7) || \ + ((MUL) == RCC_PLLMul_8) || ((MUL) == RCC_PLLMul_9) || \ + ((MUL) == RCC_PLLMul_6_5)) +#endif /* STM32F10X_CL */ +/** + * @} + */ + +/** @defgroup PREDIV1_division_factor + * @{ + */ +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) + #define RCC_PREDIV1_Div1 ((uint32_t)0x00000000) + #define RCC_PREDIV1_Div2 ((uint32_t)0x00000001) + #define RCC_PREDIV1_Div3 ((uint32_t)0x00000002) + #define RCC_PREDIV1_Div4 ((uint32_t)0x00000003) + #define RCC_PREDIV1_Div5 ((uint32_t)0x00000004) + #define RCC_PREDIV1_Div6 ((uint32_t)0x00000005) + #define RCC_PREDIV1_Div7 ((uint32_t)0x00000006) + #define RCC_PREDIV1_Div8 ((uint32_t)0x00000007) + #define RCC_PREDIV1_Div9 ((uint32_t)0x00000008) + #define RCC_PREDIV1_Div10 ((uint32_t)0x00000009) + #define RCC_PREDIV1_Div11 ((uint32_t)0x0000000A) + #define RCC_PREDIV1_Div12 ((uint32_t)0x0000000B) + #define RCC_PREDIV1_Div13 ((uint32_t)0x0000000C) + #define RCC_PREDIV1_Div14 ((uint32_t)0x0000000D) + #define RCC_PREDIV1_Div15 ((uint32_t)0x0000000E) + #define RCC_PREDIV1_Div16 ((uint32_t)0x0000000F) + + #define IS_RCC_PREDIV1(PREDIV1) (((PREDIV1) == RCC_PREDIV1_Div1) || ((PREDIV1) == RCC_PREDIV1_Div2) || \ + ((PREDIV1) == RCC_PREDIV1_Div3) || ((PREDIV1) == RCC_PREDIV1_Div4) || \ + ((PREDIV1) == RCC_PREDIV1_Div5) || ((PREDIV1) == RCC_PREDIV1_Div6) || \ + ((PREDIV1) == RCC_PREDIV1_Div7) || ((PREDIV1) == RCC_PREDIV1_Div8) || \ + ((PREDIV1) == RCC_PREDIV1_Div9) || ((PREDIV1) == RCC_PREDIV1_Div10) || \ + ((PREDIV1) == RCC_PREDIV1_Div11) || ((PREDIV1) == RCC_PREDIV1_Div12) || \ + ((PREDIV1) == RCC_PREDIV1_Div13) || ((PREDIV1) == RCC_PREDIV1_Div14) || \ + ((PREDIV1) == RCC_PREDIV1_Div15) || ((PREDIV1) == RCC_PREDIV1_Div16)) +#endif +/** + * @} + */ + + +/** @defgroup PREDIV1_clock_source + * @{ + */ +#ifdef STM32F10X_CL +/* PREDIV1 clock source (for STM32 connectivity line devices) */ + #define RCC_PREDIV1_Source_HSE ((uint32_t)0x00000000) + #define RCC_PREDIV1_Source_PLL2 ((uint32_t)0x00010000) + + #define IS_RCC_PREDIV1_SOURCE(SOURCE) (((SOURCE) == RCC_PREDIV1_Source_HSE) || \ + ((SOURCE) == RCC_PREDIV1_Source_PLL2)) +#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +/* PREDIV1 clock source (for STM32 Value line devices) */ + #define RCC_PREDIV1_Source_HSE ((uint32_t)0x00000000) + + #define IS_RCC_PREDIV1_SOURCE(SOURCE) (((SOURCE) == RCC_PREDIV1_Source_HSE)) +#endif +/** + * @} + */ + +#ifdef STM32F10X_CL +/** @defgroup PREDIV2_division_factor + * @{ + */ + + #define RCC_PREDIV2_Div1 ((uint32_t)0x00000000) + #define RCC_PREDIV2_Div2 ((uint32_t)0x00000010) + #define RCC_PREDIV2_Div3 ((uint32_t)0x00000020) + #define RCC_PREDIV2_Div4 ((uint32_t)0x00000030) + #define RCC_PREDIV2_Div5 ((uint32_t)0x00000040) + #define RCC_PREDIV2_Div6 ((uint32_t)0x00000050) + #define RCC_PREDIV2_Div7 ((uint32_t)0x00000060) + #define RCC_PREDIV2_Div8 ((uint32_t)0x00000070) + #define RCC_PREDIV2_Div9 ((uint32_t)0x00000080) + #define RCC_PREDIV2_Div10 ((uint32_t)0x00000090) + #define RCC_PREDIV2_Div11 ((uint32_t)0x000000A0) + #define RCC_PREDIV2_Div12 ((uint32_t)0x000000B0) + #define RCC_PREDIV2_Div13 ((uint32_t)0x000000C0) + #define RCC_PREDIV2_Div14 ((uint32_t)0x000000D0) + #define RCC_PREDIV2_Div15 ((uint32_t)0x000000E0) + #define RCC_PREDIV2_Div16 ((uint32_t)0x000000F0) + + #define IS_RCC_PREDIV2(PREDIV2) (((PREDIV2) == RCC_PREDIV2_Div1) || ((PREDIV2) == RCC_PREDIV2_Div2) || \ + ((PREDIV2) == RCC_PREDIV2_Div3) || ((PREDIV2) == RCC_PREDIV2_Div4) || \ + ((PREDIV2) == RCC_PREDIV2_Div5) || ((PREDIV2) == RCC_PREDIV2_Div6) || \ + ((PREDIV2) == RCC_PREDIV2_Div7) || ((PREDIV2) == RCC_PREDIV2_Div8) || \ + ((PREDIV2) == RCC_PREDIV2_Div9) || ((PREDIV2) == RCC_PREDIV2_Div10) || \ + ((PREDIV2) == RCC_PREDIV2_Div11) || ((PREDIV2) == RCC_PREDIV2_Div12) || \ + ((PREDIV2) == RCC_PREDIV2_Div13) || ((PREDIV2) == RCC_PREDIV2_Div14) || \ + ((PREDIV2) == RCC_PREDIV2_Div15) || ((PREDIV2) == RCC_PREDIV2_Div16)) +/** + * @} + */ + + +/** @defgroup PLL2_multiplication_factor + * @{ + */ + + #define RCC_PLL2Mul_8 ((uint32_t)0x00000600) + #define RCC_PLL2Mul_9 ((uint32_t)0x00000700) + #define RCC_PLL2Mul_10 ((uint32_t)0x00000800) + #define RCC_PLL2Mul_11 ((uint32_t)0x00000900) + #define RCC_PLL2Mul_12 ((uint32_t)0x00000A00) + #define RCC_PLL2Mul_13 ((uint32_t)0x00000B00) + #define RCC_PLL2Mul_14 ((uint32_t)0x00000C00) + #define RCC_PLL2Mul_16 ((uint32_t)0x00000E00) + #define RCC_PLL2Mul_20 ((uint32_t)0x00000F00) + + #define IS_RCC_PLL2_MUL(MUL) (((MUL) == RCC_PLL2Mul_8) || ((MUL) == RCC_PLL2Mul_9) || \ + ((MUL) == RCC_PLL2Mul_10) || ((MUL) == RCC_PLL2Mul_11) || \ + ((MUL) == RCC_PLL2Mul_12) || ((MUL) == RCC_PLL2Mul_13) || \ + ((MUL) == RCC_PLL2Mul_14) || ((MUL) == RCC_PLL2Mul_16) || \ + ((MUL) == RCC_PLL2Mul_20)) +/** + * @} + */ + + +/** @defgroup PLL3_multiplication_factor + * @{ + */ + + #define RCC_PLL3Mul_8 ((uint32_t)0x00006000) + #define RCC_PLL3Mul_9 ((uint32_t)0x00007000) + #define RCC_PLL3Mul_10 ((uint32_t)0x00008000) + #define RCC_PLL3Mul_11 ((uint32_t)0x00009000) + #define RCC_PLL3Mul_12 ((uint32_t)0x0000A000) + #define RCC_PLL3Mul_13 ((uint32_t)0x0000B000) + #define RCC_PLL3Mul_14 ((uint32_t)0x0000C000) + #define RCC_PLL3Mul_16 ((uint32_t)0x0000E000) + #define RCC_PLL3Mul_20 ((uint32_t)0x0000F000) + + #define IS_RCC_PLL3_MUL(MUL) (((MUL) == RCC_PLL3Mul_8) || ((MUL) == RCC_PLL3Mul_9) || \ + ((MUL) == RCC_PLL3Mul_10) || ((MUL) == RCC_PLL3Mul_11) || \ + ((MUL) == RCC_PLL3Mul_12) || ((MUL) == RCC_PLL3Mul_13) || \ + ((MUL) == RCC_PLL3Mul_14) || ((MUL) == RCC_PLL3Mul_16) || \ + ((MUL) == RCC_PLL3Mul_20)) +/** + * @} + */ + +#endif /* STM32F10X_CL */ + + +/** @defgroup System_clock_source + * @{ + */ + +#define RCC_SYSCLKSource_HSI ((uint32_t)0x00000000) +#define RCC_SYSCLKSource_HSE ((uint32_t)0x00000001) +#define RCC_SYSCLKSource_PLLCLK ((uint32_t)0x00000002) +#define IS_RCC_SYSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSource_HSI) || \ + ((SOURCE) == RCC_SYSCLKSource_HSE) || \ + ((SOURCE) == RCC_SYSCLKSource_PLLCLK)) +/** + * @} + */ + +/** @defgroup AHB_clock_source + * @{ + */ + +#define RCC_SYSCLK_Div1 ((uint32_t)0x00000000) +#define RCC_SYSCLK_Div2 ((uint32_t)0x00000080) +#define RCC_SYSCLK_Div4 ((uint32_t)0x00000090) +#define RCC_SYSCLK_Div8 ((uint32_t)0x000000A0) +#define RCC_SYSCLK_Div16 ((uint32_t)0x000000B0) +#define RCC_SYSCLK_Div64 ((uint32_t)0x000000C0) +#define RCC_SYSCLK_Div128 ((uint32_t)0x000000D0) +#define RCC_SYSCLK_Div256 ((uint32_t)0x000000E0) +#define RCC_SYSCLK_Div512 ((uint32_t)0x000000F0) +#define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_Div1) || ((HCLK) == RCC_SYSCLK_Div2) || \ + ((HCLK) == RCC_SYSCLK_Div4) || ((HCLK) == RCC_SYSCLK_Div8) || \ + ((HCLK) == RCC_SYSCLK_Div16) || ((HCLK) == RCC_SYSCLK_Div64) || \ + ((HCLK) == RCC_SYSCLK_Div128) || ((HCLK) == RCC_SYSCLK_Div256) || \ + ((HCLK) == RCC_SYSCLK_Div512)) +/** + * @} + */ + +/** @defgroup APB1_APB2_clock_source + * @{ + */ + +#define RCC_HCLK_Div1 ((uint32_t)0x00000000) +#define RCC_HCLK_Div2 ((uint32_t)0x00000400) +#define RCC_HCLK_Div4 ((uint32_t)0x00000500) +#define RCC_HCLK_Div8 ((uint32_t)0x00000600) +#define RCC_HCLK_Div16 ((uint32_t)0x00000700) +#define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_Div1) || ((PCLK) == RCC_HCLK_Div2) || \ + ((PCLK) == RCC_HCLK_Div4) || ((PCLK) == RCC_HCLK_Div8) || \ + ((PCLK) == RCC_HCLK_Div16)) +/** + * @} + */ + +/** @defgroup RCC_Interrupt_source + * @{ + */ + +#define RCC_IT_LSIRDY ((uint8_t)0x01) +#define RCC_IT_LSERDY ((uint8_t)0x02) +#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) + +#ifndef STM32F10X_CL + #define IS_RCC_IT(IT) ((((IT) & (uint8_t)0xE0) == 0x00) && ((IT) != 0x00)) + #define IS_RCC_GET_IT(IT) (((IT) == RCC_IT_LSIRDY) || ((IT) == RCC_IT_LSERDY) || \ + ((IT) == RCC_IT_HSIRDY) || ((IT) == RCC_IT_HSERDY) || \ + ((IT) == RCC_IT_PLLRDY) || ((IT) == RCC_IT_CSS)) + #define IS_RCC_CLEAR_IT(IT) ((((IT) & (uint8_t)0x60) == 0x00) && ((IT) != 0x00)) +#else + #define RCC_IT_PLL2RDY ((uint8_t)0x20) + #define RCC_IT_PLL3RDY ((uint8_t)0x40) + #define IS_RCC_IT(IT) ((((IT) & (uint8_t)0x80) == 0x00) && ((IT) != 0x00)) + #define IS_RCC_GET_IT(IT) (((IT) == RCC_IT_LSIRDY) || ((IT) == RCC_IT_LSERDY) || \ + ((IT) == RCC_IT_HSIRDY) || ((IT) == RCC_IT_HSERDY) || \ + ((IT) == RCC_IT_PLLRDY) || ((IT) == RCC_IT_CSS) || \ + ((IT) == RCC_IT_PLL2RDY) || ((IT) == RCC_IT_PLL3RDY)) + #define IS_RCC_CLEAR_IT(IT) ((IT) != 0x00) +#endif /* STM32F10X_CL */ + + +/** + * @} + */ + +#ifndef STM32F10X_CL +/** @defgroup USB_Device_clock_source + * @{ + */ + + #define RCC_USBCLKSource_PLLCLK_1Div5 ((uint8_t)0x00) + #define RCC_USBCLKSource_PLLCLK_Div1 ((uint8_t)0x01) + + #define IS_RCC_USBCLK_SOURCE(SOURCE) (((SOURCE) == RCC_USBCLKSource_PLLCLK_1Div5) || \ + ((SOURCE) == RCC_USBCLKSource_PLLCLK_Div1)) +/** + * @} + */ +#else +/** @defgroup USB_OTG_FS_clock_source + * @{ + */ + #define RCC_OTGFSCLKSource_PLLVCO_Div3 ((uint8_t)0x00) + #define RCC_OTGFSCLKSource_PLLVCO_Div2 ((uint8_t)0x01) + + #define IS_RCC_OTGFSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_OTGFSCLKSource_PLLVCO_Div3) || \ + ((SOURCE) == RCC_OTGFSCLKSource_PLLVCO_Div2)) +/** + * @} + */ +#endif /* STM32F10X_CL */ + + +#ifdef STM32F10X_CL +/** @defgroup I2S2_clock_source + * @{ + */ + #define RCC_I2S2CLKSource_SYSCLK ((uint8_t)0x00) + #define RCC_I2S2CLKSource_PLL3_VCO ((uint8_t)0x01) + + #define IS_RCC_I2S2CLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2S2CLKSource_SYSCLK) || \ + ((SOURCE) == RCC_I2S2CLKSource_PLL3_VCO)) +/** + * @} + */ + +/** @defgroup I2S3_clock_source + * @{ + */ + #define RCC_I2S3CLKSource_SYSCLK ((uint8_t)0x00) + #define RCC_I2S3CLKSource_PLL3_VCO ((uint8_t)0x01) + + #define IS_RCC_I2S3CLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2S3CLKSource_SYSCLK) || \ + ((SOURCE) == RCC_I2S3CLKSource_PLL3_VCO)) +/** + * @} + */ +#endif /* STM32F10X_CL */ + + +/** @defgroup 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 IS_RCC_ADCCLK(ADCCLK) (((ADCCLK) == RCC_PCLK2_Div2) || ((ADCCLK) == RCC_PCLK2_Div4) || \ + ((ADCCLK) == RCC_PCLK2_Div6) || ((ADCCLK) == RCC_PCLK2_Div8)) +/** + * @} + */ + +/** @defgroup LSE_configuration + * @{ + */ + +#define RCC_LSE_OFF ((uint8_t)0x00) +#define RCC_LSE_ON ((uint8_t)0x01) +#define RCC_LSE_Bypass ((uint8_t)0x04) +#define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \ + ((LSE) == RCC_LSE_Bypass)) +/** + * @} + */ + +/** @defgroup RTC_clock_source + * @{ + */ + +#define RCC_RTCCLKSource_LSE ((uint32_t)0x00000100) +#define RCC_RTCCLKSource_LSI ((uint32_t)0x00000200) +#define RCC_RTCCLKSource_HSE_Div128 ((uint32_t)0x00000300) +#define IS_RCC_RTCCLK_SOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSource_LSE) || \ + ((SOURCE) == RCC_RTCCLKSource_LSI) || \ + ((SOURCE) == RCC_RTCCLKSource_HSE_Div128)) +/** + * @} + */ + +/** @defgroup AHB_peripheral + * @{ + */ + +#define RCC_AHBPeriph_DMA1 ((uint32_t)0x00000001) +#define RCC_AHBPeriph_DMA2 ((uint32_t)0x00000002) +#define RCC_AHBPeriph_SRAM ((uint32_t)0x00000004) +#define RCC_AHBPeriph_FLITF ((uint32_t)0x00000010) +#define RCC_AHBPeriph_CRC ((uint32_t)0x00000040) + +#ifndef STM32F10X_CL + #define RCC_AHBPeriph_FSMC ((uint32_t)0x00000100) + #define RCC_AHBPeriph_SDIO ((uint32_t)0x00000400) + #define IS_RCC_AHB_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFAA8) == 0x00) && ((PERIPH) != 0x00)) +#else + #define RCC_AHBPeriph_OTG_FS ((uint32_t)0x00001000) + #define RCC_AHBPeriph_ETH_MAC ((uint32_t)0x00004000) + #define RCC_AHBPeriph_ETH_MAC_Tx ((uint32_t)0x00008000) + #define RCC_AHBPeriph_ETH_MAC_Rx ((uint32_t)0x00010000) + + #define IS_RCC_AHB_PERIPH(PERIPH) ((((PERIPH) & 0xFFFE2FA8) == 0x00) && ((PERIPH) != 0x00)) + #define IS_RCC_AHB_PERIPH_RESET(PERIPH) ((((PERIPH) & 0xFFFFAFFF) == 0x00) && ((PERIPH) != 0x00)) +#endif /* STM32F10X_CL */ +/** + * @} + */ + +/** @defgroup 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_GPIOE ((uint32_t)0x00000040) +#define RCC_APB2Periph_GPIOF ((uint32_t)0x00000080) +#define RCC_APB2Periph_GPIOG ((uint32_t)0x00000100) +#define RCC_APB2Periph_ADC1 ((uint32_t)0x00000200) +#define RCC_APB2Periph_ADC2 ((uint32_t)0x00000400) +#define RCC_APB2Periph_TIM1 ((uint32_t)0x00000800) +#define RCC_APB2Periph_SPI1 ((uint32_t)0x00001000) +#define RCC_APB2Periph_TIM8 ((uint32_t)0x00002000) +#define RCC_APB2Periph_USART1 ((uint32_t)0x00004000) +#define RCC_APB2Periph_ADC3 ((uint32_t)0x00008000) +#define RCC_APB2Periph_TIM15 ((uint32_t)0x00010000) +#define RCC_APB2Periph_TIM16 ((uint32_t)0x00020000) +#define RCC_APB2Periph_TIM17 ((uint32_t)0x00040000) +#define RCC_APB2Periph_TIM9 ((uint32_t)0x00080000) +#define RCC_APB2Periph_TIM10 ((uint32_t)0x00100000) +#define RCC_APB2Periph_TIM11 ((uint32_t)0x00200000) + +#define IS_RCC_APB2_PERIPH(PERIPH) ((((PERIPH) & 0xFFC00002) == 0x00) && ((PERIPH) != 0x00)) +/** + * @} + */ + +/** @defgroup APB1_peripheral + * @{ + */ + +#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) +#define RCC_APB1Periph_TIM3 ((uint32_t)0x00000002) +#define RCC_APB1Periph_TIM4 ((uint32_t)0x00000004) +#define RCC_APB1Periph_TIM5 ((uint32_t)0x00000008) +#define RCC_APB1Periph_TIM6 ((uint32_t)0x00000010) +#define RCC_APB1Periph_TIM7 ((uint32_t)0x00000020) +#define RCC_APB1Periph_TIM12 ((uint32_t)0x00000040) +#define RCC_APB1Periph_TIM13 ((uint32_t)0x00000080) +#define RCC_APB1Periph_TIM14 ((uint32_t)0x00000100) +#define RCC_APB1Periph_WWDG ((uint32_t)0x00000800) +#define RCC_APB1Periph_SPI2 ((uint32_t)0x00004000) +#define RCC_APB1Periph_SPI3 ((uint32_t)0x00008000) +#define RCC_APB1Periph_USART2 ((uint32_t)0x00020000) +#define RCC_APB1Periph_USART3 ((uint32_t)0x00040000) +#define RCC_APB1Periph_UART4 ((uint32_t)0x00080000) +#define RCC_APB1Periph_UART5 ((uint32_t)0x00100000) +#define RCC_APB1Periph_I2C1 ((uint32_t)0x00200000) +#define RCC_APB1Periph_I2C2 ((uint32_t)0x00400000) +#define RCC_APB1Periph_USB ((uint32_t)0x00800000) +#define RCC_APB1Periph_CAN1 ((uint32_t)0x02000000) +#define RCC_APB1Periph_CAN2 ((uint32_t)0x04000000) +#define RCC_APB1Periph_BKP ((uint32_t)0x08000000) +#define RCC_APB1Periph_PWR ((uint32_t)0x10000000) +#define RCC_APB1Periph_DAC ((uint32_t)0x20000000) +#define RCC_APB1Periph_CEC ((uint32_t)0x40000000) + +#define IS_RCC_APB1_PERIPH(PERIPH) ((((PERIPH) & 0x81013600) == 0x00) && ((PERIPH) != 0x00)) + +/** + * @} + */ + +/** @defgroup 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_Div2 ((uint8_t)0x07) + +#ifndef STM32F10X_CL + #define IS_RCC_MCO(MCO) (((MCO) == RCC_MCO_NoClock) || ((MCO) == RCC_MCO_HSI) || \ + ((MCO) == RCC_MCO_SYSCLK) || ((MCO) == RCC_MCO_HSE) || \ + ((MCO) == RCC_MCO_PLLCLK_Div2)) +#else + #define RCC_MCO_PLL2CLK ((uint8_t)0x08) + #define RCC_MCO_PLL3CLK_Div2 ((uint8_t)0x09) + #define RCC_MCO_XT1 ((uint8_t)0x0A) + #define RCC_MCO_PLL3CLK ((uint8_t)0x0B) + + #define IS_RCC_MCO(MCO) (((MCO) == RCC_MCO_NoClock) || ((MCO) == RCC_MCO_HSI) || \ + ((MCO) == RCC_MCO_SYSCLK) || ((MCO) == RCC_MCO_HSE) || \ + ((MCO) == RCC_MCO_PLLCLK_Div2) || ((MCO) == RCC_MCO_PLL2CLK) || \ + ((MCO) == RCC_MCO_PLL3CLK_Div2) || ((MCO) == RCC_MCO_XT1) || \ + ((MCO) == RCC_MCO_PLL3CLK)) +#endif /* STM32F10X_CL */ + +/** + * @} + */ + +/** @defgroup 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_LSERDY ((uint8_t)0x41) +#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) + +#ifndef STM32F10X_CL + #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_HSERDY) || \ + ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_LSERDY) || \ + ((FLAG) == RCC_FLAG_LSIRDY) || ((FLAG) == RCC_FLAG_PINRST) || \ + ((FLAG) == RCC_FLAG_PORRST) || ((FLAG) == RCC_FLAG_SFTRST) || \ + ((FLAG) == RCC_FLAG_IWDGRST)|| ((FLAG) == RCC_FLAG_WWDGRST)|| \ + ((FLAG) == RCC_FLAG_LPWRRST)) +#else + #define RCC_FLAG_PLL2RDY ((uint8_t)0x3B) + #define RCC_FLAG_PLL3RDY ((uint8_t)0x3D) + #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_HSERDY) || \ + ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_LSERDY) || \ + ((FLAG) == RCC_FLAG_PLL2RDY) || ((FLAG) == RCC_FLAG_PLL3RDY) || \ + ((FLAG) == RCC_FLAG_LSIRDY) || ((FLAG) == RCC_FLAG_PINRST) || \ + ((FLAG) == RCC_FLAG_PORRST) || ((FLAG) == RCC_FLAG_SFTRST) || \ + ((FLAG) == RCC_FLAG_IWDGRST)|| ((FLAG) == RCC_FLAG_WWDGRST)|| \ + ((FLAG) == RCC_FLAG_LPWRRST)) +#endif /* STM32F10X_CL */ + +#define IS_RCC_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup RCC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup RCC_Exported_Functions + * @{ + */ + +void RCC_DeInit(void); +void RCC_HSEConfig(uint32_t RCC_HSE); +ErrorStatus RCC_WaitForHSEStartUp(void); +void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue); +void RCC_HSICmd(FunctionalState NewState); +void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul); +void RCC_PLLCmd(FunctionalState NewState); + +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) + void RCC_PREDIV1Config(uint32_t RCC_PREDIV1_Source, uint32_t RCC_PREDIV1_Div); +#endif + +#ifdef STM32F10X_CL + void RCC_PREDIV2Config(uint32_t RCC_PREDIV2_Div); + void RCC_PLL2Config(uint32_t RCC_PLL2Mul); + void RCC_PLL2Cmd(FunctionalState NewState); + void RCC_PLL3Config(uint32_t RCC_PLL3Mul); + void RCC_PLL3Cmd(FunctionalState NewState); +#endif /* STM32F10X_CL */ + +void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource); +uint8_t RCC_GetSYSCLKSource(void); +void RCC_HCLKConfig(uint32_t RCC_SYSCLK); +void RCC_PCLK1Config(uint32_t RCC_HCLK); +void RCC_PCLK2Config(uint32_t RCC_HCLK); +void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState); + +#ifndef STM32F10X_CL + void RCC_USBCLKConfig(uint32_t RCC_USBCLKSource); +#else + void RCC_OTGFSCLKConfig(uint32_t RCC_OTGFSCLKSource); +#endif /* STM32F10X_CL */ + +void RCC_ADCCLKConfig(uint32_t RCC_PCLK2); + +#ifdef STM32F10X_CL + void RCC_I2S2CLKConfig(uint32_t RCC_I2S2CLKSource); + void RCC_I2S3CLKConfig(uint32_t RCC_I2S3CLKSource); +#endif /* STM32F10X_CL */ + +void RCC_LSEConfig(uint8_t RCC_LSE); +void RCC_LSICmd(FunctionalState NewState); +void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource); +void RCC_RTCCLKCmd(FunctionalState NewState); +void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks); +void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState); +void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState); +void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState); + +#ifdef STM32F10X_CL +void RCC_AHBPeriphResetCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState); +#endif /* STM32F10X_CL */ + +void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState); +void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState); +void RCC_BackupResetCmd(FunctionalState NewState); +void RCC_ClockSecuritySystemCmd(FunctionalState NewState); +void RCC_MCOConfig(uint8_t RCC_MCO); +FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG); +void RCC_ClearFlag(void); +ITStatus RCC_GetITStatus(uint8_t RCC_IT); +void RCC_ClearITPendingBit(uint8_t RCC_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_RCC_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rtc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rtc.h new file mode 100644 index 0000000..021dc30 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rtc.h @@ -0,0 +1,133 @@ +/** + ****************************************************************************** + * @file stm32f10x_rtc.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the RTC firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_RTC_H +#define __STM32F10x_RTC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup RTC + * @{ + */ + +/** @defgroup RTC_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup RTC_Exported_Constants + * @{ + */ + +/** @defgroup RTC_interrupts_define + * @{ + */ + +#define RTC_IT_OW ((uint16_t)0x0004) /*!< Overflow interrupt */ +#define RTC_IT_ALR ((uint16_t)0x0002) /*!< Alarm interrupt */ +#define RTC_IT_SEC ((uint16_t)0x0001) /*!< Second interrupt */ +#define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00)) +#define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \ + ((IT) == RTC_IT_SEC)) +/** + * @} + */ + +/** @defgroup RTC_interrupts_flags + * @{ + */ + +#define RTC_FLAG_RTOFF ((uint16_t)0x0020) /*!< RTC Operation OFF flag */ +#define RTC_FLAG_RSF ((uint16_t)0x0008) /*!< Registers Synchronized flag */ +#define RTC_FLAG_OW ((uint16_t)0x0004) /*!< Overflow flag */ +#define RTC_FLAG_ALR ((uint16_t)0x0002) /*!< Alarm flag */ +#define RTC_FLAG_SEC ((uint16_t)0x0001) /*!< Second flag */ +#define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00)) +#define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \ + ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \ + ((FLAG) == RTC_FLAG_SEC)) +#define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup RTC_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup RTC_Exported_Functions + * @{ + */ + +void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState); +void RTC_EnterConfigMode(void); +void RTC_ExitConfigMode(void); +uint32_t RTC_GetCounter(void); +void RTC_SetCounter(uint32_t CounterValue); +void RTC_SetPrescaler(uint32_t PrescalerValue); +void RTC_SetAlarm(uint32_t AlarmValue); +uint32_t RTC_GetDivider(void); +void RTC_WaitForLastTask(void); +void RTC_WaitForSynchro(void); +FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG); +void RTC_ClearFlag(uint16_t RTC_FLAG); +ITStatus RTC_GetITStatus(uint16_t RTC_IT); +void RTC_ClearITPendingBit(uint16_t RTC_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_RTC_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_sdio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_sdio.h new file mode 100644 index 0000000..02bfb32 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_sdio.h @@ -0,0 +1,529 @@ +/** + ****************************************************************************** + * @file stm32f10x_sdio.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the SDIO firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_SDIO_H +#define __STM32F10x_SDIO_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup SDIO + * @{ + */ + +/** @defgroup SDIO_Exported_Types + * @{ + */ + +typedef struct +{ + uint32_t SDIO_ClockEdge; /*!< Specifies the clock transition on which the bit capture is made. + This parameter can be a value of @ref SDIO_Clock_Edge */ + + uint32_t SDIO_ClockBypass; /*!< Specifies whether the SDIO Clock divider bypass is + enabled or disabled. + This parameter can be a value of @ref SDIO_Clock_Bypass */ + + uint32_t SDIO_ClockPowerSave; /*!< Specifies whether SDIO Clock output is enabled or + disabled when the bus is idle. + This parameter can be a value of @ref SDIO_Clock_Power_Save */ + + uint32_t SDIO_BusWide; /*!< Specifies the SDIO bus width. + This parameter can be a value of @ref SDIO_Bus_Wide */ + + uint32_t SDIO_HardwareFlowControl; /*!< Specifies whether the SDIO hardware flow control is enabled or disabled. + This parameter can be a value of @ref SDIO_Hardware_Flow_Control */ + + uint8_t SDIO_ClockDiv; /*!< Specifies the clock frequency of the SDIO controller. + This parameter can be a value between 0x00 and 0xFF. */ + +} SDIO_InitTypeDef; + +typedef struct +{ + uint32_t SDIO_Argument; /*!< Specifies the SDIO command argument which is sent + to a card as part of a command message. If a command + contains an argument, it must be loaded into this register + before writing the command to the command register */ + + uint32_t SDIO_CmdIndex; /*!< Specifies the SDIO command index. It must be lower than 0x40. */ + + uint32_t SDIO_Response; /*!< Specifies the SDIO response type. + This parameter can be a value of @ref SDIO_Response_Type */ + + uint32_t SDIO_Wait; /*!< Specifies whether SDIO wait-for-interrupt request is enabled or disabled. + This parameter can be a value of @ref SDIO_Wait_Interrupt_State */ + + uint32_t SDIO_CPSM; /*!< Specifies whether SDIO Command path state machine (CPSM) + is enabled or disabled. + This parameter can be a value of @ref SDIO_CPSM_State */ +} SDIO_CmdInitTypeDef; + +typedef struct +{ + uint32_t SDIO_DataTimeOut; /*!< Specifies the data timeout period in card bus clock periods. */ + + uint32_t SDIO_DataLength; /*!< Specifies the number of data bytes to be transferred. */ + + uint32_t SDIO_DataBlockSize; /*!< Specifies the data block size for block transfer. + This parameter can be a value of @ref SDIO_Data_Block_Size */ + + uint32_t SDIO_TransferDir; /*!< Specifies the data transfer direction, whether the transfer + is a read or write. + This parameter can be a value of @ref SDIO_Transfer_Direction */ + + uint32_t SDIO_TransferMode; /*!< Specifies whether data transfer is in stream or block mode. + This parameter can be a value of @ref SDIO_Transfer_Type */ + + uint32_t SDIO_DPSM; /*!< Specifies whether SDIO Data path state machine (DPSM) + is enabled or disabled. + This parameter can be a value of @ref SDIO_DPSM_State */ +} SDIO_DataInitTypeDef; + +/** + * @} + */ + +/** @defgroup SDIO_Exported_Constants + * @{ + */ + +/** @defgroup SDIO_Clock_Edge + * @{ + */ + +#define SDIO_ClockEdge_Rising ((uint32_t)0x00000000) +#define SDIO_ClockEdge_Falling ((uint32_t)0x00002000) +#define IS_SDIO_CLOCK_EDGE(EDGE) (((EDGE) == SDIO_ClockEdge_Rising) || \ + ((EDGE) == SDIO_ClockEdge_Falling)) +/** + * @} + */ + +/** @defgroup SDIO_Clock_Bypass + * @{ + */ + +#define SDIO_ClockBypass_Disable ((uint32_t)0x00000000) +#define SDIO_ClockBypass_Enable ((uint32_t)0x00000400) +#define IS_SDIO_CLOCK_BYPASS(BYPASS) (((BYPASS) == SDIO_ClockBypass_Disable) || \ + ((BYPASS) == SDIO_ClockBypass_Enable)) +/** + * @} + */ + +/** @defgroup SDIO_Clock_Power_Save + * @{ + */ + +#define SDIO_ClockPowerSave_Disable ((uint32_t)0x00000000) +#define SDIO_ClockPowerSave_Enable ((uint32_t)0x00000200) +#define IS_SDIO_CLOCK_POWER_SAVE(SAVE) (((SAVE) == SDIO_ClockPowerSave_Disable) || \ + ((SAVE) == SDIO_ClockPowerSave_Enable)) +/** + * @} + */ + +/** @defgroup SDIO_Bus_Wide + * @{ + */ + +#define SDIO_BusWide_1b ((uint32_t)0x00000000) +#define SDIO_BusWide_4b ((uint32_t)0x00000800) +#define SDIO_BusWide_8b ((uint32_t)0x00001000) +#define IS_SDIO_BUS_WIDE(WIDE) (((WIDE) == SDIO_BusWide_1b) || ((WIDE) == SDIO_BusWide_4b) || \ + ((WIDE) == SDIO_BusWide_8b)) + +/** + * @} + */ + +/** @defgroup SDIO_Hardware_Flow_Control + * @{ + */ + +#define SDIO_HardwareFlowControl_Disable ((uint32_t)0x00000000) +#define SDIO_HardwareFlowControl_Enable ((uint32_t)0x00004000) +#define IS_SDIO_HARDWARE_FLOW_CONTROL(CONTROL) (((CONTROL) == SDIO_HardwareFlowControl_Disable) || \ + ((CONTROL) == SDIO_HardwareFlowControl_Enable)) +/** + * @} + */ + +/** @defgroup SDIO_Power_State + * @{ + */ + +#define SDIO_PowerState_OFF ((uint32_t)0x00000000) +#define SDIO_PowerState_ON ((uint32_t)0x00000003) +#define IS_SDIO_POWER_STATE(STATE) (((STATE) == SDIO_PowerState_OFF) || ((STATE) == SDIO_PowerState_ON)) +/** + * @} + */ + + +/** @defgroup SDIO_Interrupt_sources + * @{ + */ + +#define SDIO_IT_CCRCFAIL ((uint32_t)0x00000001) +#define SDIO_IT_DCRCFAIL ((uint32_t)0x00000002) +#define SDIO_IT_CTIMEOUT ((uint32_t)0x00000004) +#define SDIO_IT_DTIMEOUT ((uint32_t)0x00000008) +#define SDIO_IT_TXUNDERR ((uint32_t)0x00000010) +#define SDIO_IT_RXOVERR ((uint32_t)0x00000020) +#define SDIO_IT_CMDREND ((uint32_t)0x00000040) +#define SDIO_IT_CMDSENT ((uint32_t)0x00000080) +#define SDIO_IT_DATAEND ((uint32_t)0x00000100) +#define SDIO_IT_STBITERR ((uint32_t)0x00000200) +#define SDIO_IT_DBCKEND ((uint32_t)0x00000400) +#define SDIO_IT_CMDACT ((uint32_t)0x00000800) +#define SDIO_IT_TXACT ((uint32_t)0x00001000) +#define SDIO_IT_RXACT ((uint32_t)0x00002000) +#define SDIO_IT_TXFIFOHE ((uint32_t)0x00004000) +#define SDIO_IT_RXFIFOHF ((uint32_t)0x00008000) +#define SDIO_IT_TXFIFOF ((uint32_t)0x00010000) +#define SDIO_IT_RXFIFOF ((uint32_t)0x00020000) +#define SDIO_IT_TXFIFOE ((uint32_t)0x00040000) +#define SDIO_IT_RXFIFOE ((uint32_t)0x00080000) +#define SDIO_IT_TXDAVL ((uint32_t)0x00100000) +#define SDIO_IT_RXDAVL ((uint32_t)0x00200000) +#define SDIO_IT_SDIOIT ((uint32_t)0x00400000) +#define SDIO_IT_CEATAEND ((uint32_t)0x00800000) +#define IS_SDIO_IT(IT) ((((IT) & (uint32_t)0xFF000000) == 0x00) && ((IT) != (uint32_t)0x00)) +/** + * @} + */ + +/** @defgroup SDIO_Command_Index + * @{ + */ + +#define IS_SDIO_CMD_INDEX(INDEX) ((INDEX) < 0x40) +/** + * @} + */ + +/** @defgroup SDIO_Response_Type + * @{ + */ + +#define SDIO_Response_No ((uint32_t)0x00000000) +#define SDIO_Response_Short ((uint32_t)0x00000040) +#define SDIO_Response_Long ((uint32_t)0x000000C0) +#define IS_SDIO_RESPONSE(RESPONSE) (((RESPONSE) == SDIO_Response_No) || \ + ((RESPONSE) == SDIO_Response_Short) || \ + ((RESPONSE) == SDIO_Response_Long)) +/** + * @} + */ + +/** @defgroup SDIO_Wait_Interrupt_State + * @{ + */ + +#define SDIO_Wait_No ((uint32_t)0x00000000) /*!< SDIO No Wait, TimeOut is enabled */ +#define SDIO_Wait_IT ((uint32_t)0x00000100) /*!< SDIO Wait Interrupt Request */ +#define SDIO_Wait_Pend ((uint32_t)0x00000200) /*!< SDIO Wait End of transfer */ +#define IS_SDIO_WAIT(WAIT) (((WAIT) == SDIO_Wait_No) || ((WAIT) == SDIO_Wait_IT) || \ + ((WAIT) == SDIO_Wait_Pend)) +/** + * @} + */ + +/** @defgroup SDIO_CPSM_State + * @{ + */ + +#define SDIO_CPSM_Disable ((uint32_t)0x00000000) +#define SDIO_CPSM_Enable ((uint32_t)0x00000400) +#define IS_SDIO_CPSM(CPSM) (((CPSM) == SDIO_CPSM_Enable) || ((CPSM) == SDIO_CPSM_Disable)) +/** + * @} + */ + +/** @defgroup SDIO_Response_Registers + * @{ + */ + +#define SDIO_RESP1 ((uint32_t)0x00000000) +#define SDIO_RESP2 ((uint32_t)0x00000004) +#define SDIO_RESP3 ((uint32_t)0x00000008) +#define SDIO_RESP4 ((uint32_t)0x0000000C) +#define IS_SDIO_RESP(RESP) (((RESP) == SDIO_RESP1) || ((RESP) == SDIO_RESP2) || \ + ((RESP) == SDIO_RESP3) || ((RESP) == SDIO_RESP4)) +/** + * @} + */ + +/** @defgroup SDIO_Data_Length + * @{ + */ + +#define IS_SDIO_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF) +/** + * @} + */ + +/** @defgroup SDIO_Data_Block_Size + * @{ + */ + +#define SDIO_DataBlockSize_1b ((uint32_t)0x00000000) +#define SDIO_DataBlockSize_2b ((uint32_t)0x00000010) +#define SDIO_DataBlockSize_4b ((uint32_t)0x00000020) +#define SDIO_DataBlockSize_8b ((uint32_t)0x00000030) +#define SDIO_DataBlockSize_16b ((uint32_t)0x00000040) +#define SDIO_DataBlockSize_32b ((uint32_t)0x00000050) +#define SDIO_DataBlockSize_64b ((uint32_t)0x00000060) +#define SDIO_DataBlockSize_128b ((uint32_t)0x00000070) +#define SDIO_DataBlockSize_256b ((uint32_t)0x00000080) +#define SDIO_DataBlockSize_512b ((uint32_t)0x00000090) +#define SDIO_DataBlockSize_1024b ((uint32_t)0x000000A0) +#define SDIO_DataBlockSize_2048b ((uint32_t)0x000000B0) +#define SDIO_DataBlockSize_4096b ((uint32_t)0x000000C0) +#define SDIO_DataBlockSize_8192b ((uint32_t)0x000000D0) +#define SDIO_DataBlockSize_16384b ((uint32_t)0x000000E0) +#define IS_SDIO_BLOCK_SIZE(SIZE) (((SIZE) == SDIO_DataBlockSize_1b) || \ + ((SIZE) == SDIO_DataBlockSize_2b) || \ + ((SIZE) == SDIO_DataBlockSize_4b) || \ + ((SIZE) == SDIO_DataBlockSize_8b) || \ + ((SIZE) == SDIO_DataBlockSize_16b) || \ + ((SIZE) == SDIO_DataBlockSize_32b) || \ + ((SIZE) == SDIO_DataBlockSize_64b) || \ + ((SIZE) == SDIO_DataBlockSize_128b) || \ + ((SIZE) == SDIO_DataBlockSize_256b) || \ + ((SIZE) == SDIO_DataBlockSize_512b) || \ + ((SIZE) == SDIO_DataBlockSize_1024b) || \ + ((SIZE) == SDIO_DataBlockSize_2048b) || \ + ((SIZE) == SDIO_DataBlockSize_4096b) || \ + ((SIZE) == SDIO_DataBlockSize_8192b) || \ + ((SIZE) == SDIO_DataBlockSize_16384b)) +/** + * @} + */ + +/** @defgroup SDIO_Transfer_Direction + * @{ + */ + +#define SDIO_TransferDir_ToCard ((uint32_t)0x00000000) +#define SDIO_TransferDir_ToSDIO ((uint32_t)0x00000002) +#define IS_SDIO_TRANSFER_DIR(DIR) (((DIR) == SDIO_TransferDir_ToCard) || \ + ((DIR) == SDIO_TransferDir_ToSDIO)) +/** + * @} + */ + +/** @defgroup SDIO_Transfer_Type + * @{ + */ + +#define SDIO_TransferMode_Block ((uint32_t)0x00000000) +#define SDIO_TransferMode_Stream ((uint32_t)0x00000004) +#define IS_SDIO_TRANSFER_MODE(MODE) (((MODE) == SDIO_TransferMode_Stream) || \ + ((MODE) == SDIO_TransferMode_Block)) +/** + * @} + */ + +/** @defgroup SDIO_DPSM_State + * @{ + */ + +#define SDIO_DPSM_Disable ((uint32_t)0x00000000) +#define SDIO_DPSM_Enable ((uint32_t)0x00000001) +#define IS_SDIO_DPSM(DPSM) (((DPSM) == SDIO_DPSM_Enable) || ((DPSM) == SDIO_DPSM_Disable)) +/** + * @} + */ + +/** @defgroup SDIO_Flags + * @{ + */ + +#define SDIO_FLAG_CCRCFAIL ((uint32_t)0x00000001) +#define SDIO_FLAG_DCRCFAIL ((uint32_t)0x00000002) +#define SDIO_FLAG_CTIMEOUT ((uint32_t)0x00000004) +#define SDIO_FLAG_DTIMEOUT ((uint32_t)0x00000008) +#define SDIO_FLAG_TXUNDERR ((uint32_t)0x00000010) +#define SDIO_FLAG_RXOVERR ((uint32_t)0x00000020) +#define SDIO_FLAG_CMDREND ((uint32_t)0x00000040) +#define SDIO_FLAG_CMDSENT ((uint32_t)0x00000080) +#define SDIO_FLAG_DATAEND ((uint32_t)0x00000100) +#define SDIO_FLAG_STBITERR ((uint32_t)0x00000200) +#define SDIO_FLAG_DBCKEND ((uint32_t)0x00000400) +#define SDIO_FLAG_CMDACT ((uint32_t)0x00000800) +#define SDIO_FLAG_TXACT ((uint32_t)0x00001000) +#define SDIO_FLAG_RXACT ((uint32_t)0x00002000) +#define SDIO_FLAG_TXFIFOHE ((uint32_t)0x00004000) +#define SDIO_FLAG_RXFIFOHF ((uint32_t)0x00008000) +#define SDIO_FLAG_TXFIFOF ((uint32_t)0x00010000) +#define SDIO_FLAG_RXFIFOF ((uint32_t)0x00020000) +#define SDIO_FLAG_TXFIFOE ((uint32_t)0x00040000) +#define SDIO_FLAG_RXFIFOE ((uint32_t)0x00080000) +#define SDIO_FLAG_TXDAVL ((uint32_t)0x00100000) +#define SDIO_FLAG_RXDAVL ((uint32_t)0x00200000) +#define SDIO_FLAG_SDIOIT ((uint32_t)0x00400000) +#define SDIO_FLAG_CEATAEND ((uint32_t)0x00800000) +#define IS_SDIO_FLAG(FLAG) (((FLAG) == SDIO_FLAG_CCRCFAIL) || \ + ((FLAG) == SDIO_FLAG_DCRCFAIL) || \ + ((FLAG) == SDIO_FLAG_CTIMEOUT) || \ + ((FLAG) == SDIO_FLAG_DTIMEOUT) || \ + ((FLAG) == SDIO_FLAG_TXUNDERR) || \ + ((FLAG) == SDIO_FLAG_RXOVERR) || \ + ((FLAG) == SDIO_FLAG_CMDREND) || \ + ((FLAG) == SDIO_FLAG_CMDSENT) || \ + ((FLAG) == SDIO_FLAG_DATAEND) || \ + ((FLAG) == SDIO_FLAG_STBITERR) || \ + ((FLAG) == SDIO_FLAG_DBCKEND) || \ + ((FLAG) == SDIO_FLAG_CMDACT) || \ + ((FLAG) == SDIO_FLAG_TXACT) || \ + ((FLAG) == SDIO_FLAG_RXACT) || \ + ((FLAG) == SDIO_FLAG_TXFIFOHE) || \ + ((FLAG) == SDIO_FLAG_RXFIFOHF) || \ + ((FLAG) == SDIO_FLAG_TXFIFOF) || \ + ((FLAG) == SDIO_FLAG_RXFIFOF) || \ + ((FLAG) == SDIO_FLAG_TXFIFOE) || \ + ((FLAG) == SDIO_FLAG_RXFIFOE) || \ + ((FLAG) == SDIO_FLAG_TXDAVL) || \ + ((FLAG) == SDIO_FLAG_RXDAVL) || \ + ((FLAG) == SDIO_FLAG_SDIOIT) || \ + ((FLAG) == SDIO_FLAG_CEATAEND)) + +#define IS_SDIO_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFF3FF800) == 0x00) && ((FLAG) != (uint32_t)0x00)) + +#define IS_SDIO_GET_IT(IT) (((IT) == SDIO_IT_CCRCFAIL) || \ + ((IT) == SDIO_IT_DCRCFAIL) || \ + ((IT) == SDIO_IT_CTIMEOUT) || \ + ((IT) == SDIO_IT_DTIMEOUT) || \ + ((IT) == SDIO_IT_TXUNDERR) || \ + ((IT) == SDIO_IT_RXOVERR) || \ + ((IT) == SDIO_IT_CMDREND) || \ + ((IT) == SDIO_IT_CMDSENT) || \ + ((IT) == SDIO_IT_DATAEND) || \ + ((IT) == SDIO_IT_STBITERR) || \ + ((IT) == SDIO_IT_DBCKEND) || \ + ((IT) == SDIO_IT_CMDACT) || \ + ((IT) == SDIO_IT_TXACT) || \ + ((IT) == SDIO_IT_RXACT) || \ + ((IT) == SDIO_IT_TXFIFOHE) || \ + ((IT) == SDIO_IT_RXFIFOHF) || \ + ((IT) == SDIO_IT_TXFIFOF) || \ + ((IT) == SDIO_IT_RXFIFOF) || \ + ((IT) == SDIO_IT_TXFIFOE) || \ + ((IT) == SDIO_IT_RXFIFOE) || \ + ((IT) == SDIO_IT_TXDAVL) || \ + ((IT) == SDIO_IT_RXDAVL) || \ + ((IT) == SDIO_IT_SDIOIT) || \ + ((IT) == SDIO_IT_CEATAEND)) + +#define IS_SDIO_CLEAR_IT(IT) ((((IT) & (uint32_t)0xFF3FF800) == 0x00) && ((IT) != (uint32_t)0x00)) + +/** + * @} + */ + +/** @defgroup SDIO_Read_Wait_Mode + * @{ + */ + +#define SDIO_ReadWaitMode_CLK ((uint32_t)0x00000001) +#define SDIO_ReadWaitMode_DATA2 ((uint32_t)0x00000000) +#define IS_SDIO_READWAIT_MODE(MODE) (((MODE) == SDIO_ReadWaitMode_CLK) || \ + ((MODE) == SDIO_ReadWaitMode_DATA2)) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup SDIO_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup SDIO_Exported_Functions + * @{ + */ + +void SDIO_DeInit(void); +void SDIO_Init(SDIO_InitTypeDef* SDIO_InitStruct); +void SDIO_StructInit(SDIO_InitTypeDef* SDIO_InitStruct); +void SDIO_ClockCmd(FunctionalState NewState); +void SDIO_SetPowerState(uint32_t SDIO_PowerState); +uint32_t SDIO_GetPowerState(void); +void SDIO_ITConfig(uint32_t SDIO_IT, FunctionalState NewState); +void SDIO_DMACmd(FunctionalState NewState); +void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct); +void SDIO_CmdStructInit(SDIO_CmdInitTypeDef* SDIO_CmdInitStruct); +uint8_t SDIO_GetCommandResponse(void); +uint32_t SDIO_GetResponse(uint32_t SDIO_RESP); +void SDIO_DataConfig(SDIO_DataInitTypeDef* SDIO_DataInitStruct); +void SDIO_DataStructInit(SDIO_DataInitTypeDef* SDIO_DataInitStruct); +uint32_t SDIO_GetDataCounter(void); +uint32_t SDIO_ReadData(void); +void SDIO_WriteData(uint32_t Data); +uint32_t SDIO_GetFIFOCount(void); +void SDIO_StartSDIOReadWait(FunctionalState NewState); +void SDIO_StopSDIOReadWait(FunctionalState NewState); +void SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode); +void SDIO_SetSDIOOperation(FunctionalState NewState); +void SDIO_SendSDIOSuspendCmd(FunctionalState NewState); +void SDIO_CommandCompletionCmd(FunctionalState NewState); +void SDIO_CEATAITCmd(FunctionalState NewState); +void SDIO_SendCEATACmd(FunctionalState NewState); +FlagStatus SDIO_GetFlagStatus(uint32_t SDIO_FLAG); +void SDIO_ClearFlag(uint32_t SDIO_FLAG); +ITStatus SDIO_GetITStatus(uint32_t SDIO_IT); +void SDIO_ClearITPendingBit(uint32_t SDIO_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_SDIO_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_spi.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_spi.h new file mode 100644 index 0000000..c2f17c9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_spi.h @@ -0,0 +1,485 @@ +/** + ****************************************************************************** + * @file stm32f10x_spi.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the SPI firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_SPI_H +#define __STM32F10x_SPI_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup SPI + * @{ + */ + +/** @defgroup SPI_Exported_Types + * @{ + */ + +/** + * @brief SPI Init structure definition + */ + +typedef struct +{ + uint16_t SPI_Direction; /*!< Specifies the SPI unidirectional or bidirectional data mode. + This parameter can be a value of @ref SPI_data_direction */ + + uint16_t SPI_Mode; /*!< Specifies the SPI operating mode. + This parameter can be a value of @ref SPI_mode */ + + uint16_t SPI_DataSize; /*!< Specifies the SPI data size. + This parameter can be a value of @ref SPI_data_size */ + + uint16_t SPI_CPOL; /*!< Specifies the serial clock steady state. + This parameter can be a value of @ref SPI_Clock_Polarity */ + + uint16_t SPI_CPHA; /*!< Specifies the clock active edge for the bit capture. + This parameter can be a value of @ref SPI_Clock_Phase */ + + uint16_t SPI_NSS; /*!< Specifies whether the NSS signal is managed by + hardware (NSS pin) or by software using the SSI bit. + This parameter can be a value of @ref SPI_Slave_Select_management */ + + uint16_t SPI_BaudRatePrescaler; /*!< Specifies the Baud Rate prescaler value which will be + used to configure the transmit and receive SCK clock. + This parameter can be a value of @ref SPI_BaudRate_Prescaler. + @note The communication clock is derived from the master + clock. The slave clock does not need to be set. */ + + uint16_t SPI_FirstBit; /*!< Specifies whether data transfers start from MSB or LSB bit. + This parameter can be a value of @ref SPI_MSB_LSB_transmission */ + + uint16_t SPI_CRCPolynomial; /*!< Specifies the polynomial used for the CRC calculation. */ +}SPI_InitTypeDef; + +/** + * @brief I2S Init structure definition + */ + +typedef struct +{ + + uint16_t I2S_Mode; /*!< Specifies the I2S operating mode. + This parameter can be a value of @ref I2S_Mode */ + + uint16_t I2S_Standard; /*!< Specifies the standard used for the I2S communication. + This parameter can be a value of @ref I2S_Standard */ + + uint16_t I2S_DataFormat; /*!< Specifies the data format for the I2S communication. + This parameter can be a value of @ref I2S_Data_Format */ + + uint16_t I2S_MCLKOutput; /*!< Specifies whether the I2S MCLK output is enabled or not. + This parameter can be a value of @ref I2S_MCLK_Output */ + + uint32_t I2S_AudioFreq; /*!< Specifies the frequency selected for the I2S communication. + This parameter can be a value of @ref I2S_Audio_Frequency */ + + uint16_t I2S_CPOL; /*!< Specifies the idle state of the I2S clock. + This parameter can be a value of @ref I2S_Clock_Polarity */ +}I2S_InitTypeDef; + +/** + * @} + */ + +/** @defgroup SPI_Exported_Constants + * @{ + */ + +#define IS_SPI_ALL_PERIPH(PERIPH) (((PERIPH) == SPI1) || \ + ((PERIPH) == SPI2) || \ + ((PERIPH) == SPI3)) + +#define IS_SPI_23_PERIPH(PERIPH) (((PERIPH) == SPI2) || \ + ((PERIPH) == SPI3)) + +/** @defgroup 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) +#define IS_SPI_DIRECTION_MODE(MODE) (((MODE) == SPI_Direction_2Lines_FullDuplex) || \ + ((MODE) == SPI_Direction_2Lines_RxOnly) || \ + ((MODE) == SPI_Direction_1Line_Rx) || \ + ((MODE) == SPI_Direction_1Line_Tx)) +/** + * @} + */ + +/** @defgroup SPI_mode + * @{ + */ + +#define SPI_Mode_Master ((uint16_t)0x0104) +#define SPI_Mode_Slave ((uint16_t)0x0000) +#define IS_SPI_MODE(MODE) (((MODE) == SPI_Mode_Master) || \ + ((MODE) == SPI_Mode_Slave)) +/** + * @} + */ + +/** @defgroup SPI_data_size + * @{ + */ + +#define SPI_DataSize_16b ((uint16_t)0x0800) +#define SPI_DataSize_8b ((uint16_t)0x0000) +#define IS_SPI_DATASIZE(DATASIZE) (((DATASIZE) == SPI_DataSize_16b) || \ + ((DATASIZE) == SPI_DataSize_8b)) +/** + * @} + */ + +/** @defgroup SPI_Clock_Polarity + * @{ + */ + +#define SPI_CPOL_Low ((uint16_t)0x0000) +#define SPI_CPOL_High ((uint16_t)0x0002) +#define IS_SPI_CPOL(CPOL) (((CPOL) == SPI_CPOL_Low) || \ + ((CPOL) == SPI_CPOL_High)) +/** + * @} + */ + +/** @defgroup SPI_Clock_Phase + * @{ + */ + +#define SPI_CPHA_1Edge ((uint16_t)0x0000) +#define SPI_CPHA_2Edge ((uint16_t)0x0001) +#define IS_SPI_CPHA(CPHA) (((CPHA) == SPI_CPHA_1Edge) || \ + ((CPHA) == SPI_CPHA_2Edge)) +/** + * @} + */ + +/** @defgroup SPI_Slave_Select_management + * @{ + */ + +#define SPI_NSS_Soft ((uint16_t)0x0200) +#define SPI_NSS_Hard ((uint16_t)0x0000) +#define IS_SPI_NSS(NSS) (((NSS) == SPI_NSS_Soft) || \ + ((NSS) == SPI_NSS_Hard)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_SPI_BAUDRATE_PRESCALER(PRESCALER) (((PRESCALER) == SPI_BaudRatePrescaler_2) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_4) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_8) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_16) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_32) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_64) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_128) || \ + ((PRESCALER) == SPI_BaudRatePrescaler_256)) +/** + * @} + */ + +/** @defgroup SPI_MSB_LSB_transmission + * @{ + */ + +#define SPI_FirstBit_MSB ((uint16_t)0x0000) +#define SPI_FirstBit_LSB ((uint16_t)0x0080) +#define IS_SPI_FIRST_BIT(BIT) (((BIT) == SPI_FirstBit_MSB) || \ + ((BIT) == SPI_FirstBit_LSB)) +/** + * @} + */ + +/** @defgroup I2S_Mode + * @{ + */ + +#define I2S_Mode_SlaveTx ((uint16_t)0x0000) +#define I2S_Mode_SlaveRx ((uint16_t)0x0100) +#define I2S_Mode_MasterTx ((uint16_t)0x0200) +#define I2S_Mode_MasterRx ((uint16_t)0x0300) +#define IS_I2S_MODE(MODE) (((MODE) == I2S_Mode_SlaveTx) || \ + ((MODE) == I2S_Mode_SlaveRx) || \ + ((MODE) == I2S_Mode_MasterTx) || \ + ((MODE) == I2S_Mode_MasterRx) ) +/** + * @} + */ + +/** @defgroup I2S_Standard + * @{ + */ + +#define I2S_Standard_Phillips ((uint16_t)0x0000) +#define I2S_Standard_MSB ((uint16_t)0x0010) +#define I2S_Standard_LSB ((uint16_t)0x0020) +#define I2S_Standard_PCMShort ((uint16_t)0x0030) +#define I2S_Standard_PCMLong ((uint16_t)0x00B0) +#define IS_I2S_STANDARD(STANDARD) (((STANDARD) == I2S_Standard_Phillips) || \ + ((STANDARD) == I2S_Standard_MSB) || \ + ((STANDARD) == I2S_Standard_LSB) || \ + ((STANDARD) == I2S_Standard_PCMShort) || \ + ((STANDARD) == I2S_Standard_PCMLong)) +/** + * @} + */ + +/** @defgroup I2S_Data_Format + * @{ + */ + +#define I2S_DataFormat_16b ((uint16_t)0x0000) +#define I2S_DataFormat_16bextended ((uint16_t)0x0001) +#define I2S_DataFormat_24b ((uint16_t)0x0003) +#define I2S_DataFormat_32b ((uint16_t)0x0005) +#define IS_I2S_DATA_FORMAT(FORMAT) (((FORMAT) == I2S_DataFormat_16b) || \ + ((FORMAT) == I2S_DataFormat_16bextended) || \ + ((FORMAT) == I2S_DataFormat_24b) || \ + ((FORMAT) == I2S_DataFormat_32b)) +/** + * @} + */ + +/** @defgroup I2S_MCLK_Output + * @{ + */ + +#define I2S_MCLKOutput_Enable ((uint16_t)0x0200) +#define I2S_MCLKOutput_Disable ((uint16_t)0x0000) +#define IS_I2S_MCLK_OUTPUT(OUTPUT) (((OUTPUT) == I2S_MCLKOutput_Enable) || \ + ((OUTPUT) == I2S_MCLKOutput_Disable)) +/** + * @} + */ + +/** @defgroup I2S_Audio_Frequency + * @{ + */ + +#define I2S_AudioFreq_192k ((uint32_t)192000) +#define I2S_AudioFreq_96k ((uint32_t)96000) +#define I2S_AudioFreq_48k ((uint32_t)48000) +#define I2S_AudioFreq_44k ((uint32_t)44100) +#define I2S_AudioFreq_32k ((uint32_t)32000) +#define I2S_AudioFreq_22k ((uint32_t)22050) +#define I2S_AudioFreq_16k ((uint32_t)16000) +#define I2S_AudioFreq_11k ((uint32_t)11025) +#define I2S_AudioFreq_8k ((uint32_t)8000) +#define I2S_AudioFreq_Default ((uint32_t)2) + +#define IS_I2S_AUDIO_FREQ(FREQ) ((((FREQ) >= I2S_AudioFreq_8k) && \ + ((FREQ) <= I2S_AudioFreq_192k)) || \ + ((FREQ) == I2S_AudioFreq_Default)) +/** + * @} + */ + +/** @defgroup I2S_Clock_Polarity + * @{ + */ + +#define I2S_CPOL_Low ((uint16_t)0x0000) +#define I2S_CPOL_High ((uint16_t)0x0008) +#define IS_I2S_CPOL(CPOL) (((CPOL) == I2S_CPOL_Low) || \ + ((CPOL) == I2S_CPOL_High)) +/** + * @} + */ + +/** @defgroup SPI_I2S_DMA_transfer_requests + * @{ + */ + +#define SPI_I2S_DMAReq_Tx ((uint16_t)0x0002) +#define SPI_I2S_DMAReq_Rx ((uint16_t)0x0001) +#define IS_SPI_I2S_DMAREQ(DMAREQ) ((((DMAREQ) & (uint16_t)0xFFFC) == 0x00) && ((DMAREQ) != 0x00)) +/** + * @} + */ + +/** @defgroup SPI_NSS_internal_software_management + * @{ + */ + +#define SPI_NSSInternalSoft_Set ((uint16_t)0x0100) +#define SPI_NSSInternalSoft_Reset ((uint16_t)0xFEFF) +#define IS_SPI_NSS_INTERNAL(INTERNAL) (((INTERNAL) == SPI_NSSInternalSoft_Set) || \ + ((INTERNAL) == SPI_NSSInternalSoft_Reset)) +/** + * @} + */ + +/** @defgroup SPI_CRC_Transmit_Receive + * @{ + */ + +#define SPI_CRC_Tx ((uint8_t)0x00) +#define SPI_CRC_Rx ((uint8_t)0x01) +#define IS_SPI_CRC(CRC) (((CRC) == SPI_CRC_Tx) || ((CRC) == SPI_CRC_Rx)) +/** + * @} + */ + +/** @defgroup SPI_direction_transmit_receive + * @{ + */ + +#define SPI_Direction_Rx ((uint16_t)0xBFFF) +#define SPI_Direction_Tx ((uint16_t)0x4000) +#define IS_SPI_DIRECTION(DIRECTION) (((DIRECTION) == SPI_Direction_Rx) || \ + ((DIRECTION) == SPI_Direction_Tx)) +/** + * @} + */ + +/** @defgroup 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 IS_SPI_I2S_CONFIG_IT(IT) (((IT) == SPI_I2S_IT_TXE) || \ + ((IT) == SPI_I2S_IT_RXNE) || \ + ((IT) == SPI_I2S_IT_ERR)) +#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) +#define IS_SPI_I2S_CLEAR_IT(IT) (((IT) == SPI_IT_CRCERR)) +#define IS_SPI_I2S_GET_IT(IT) (((IT) == SPI_I2S_IT_RXNE) || ((IT) == SPI_I2S_IT_TXE) || \ + ((IT) == I2S_IT_UDR) || ((IT) == SPI_IT_CRCERR) || \ + ((IT) == SPI_IT_MODF) || ((IT) == SPI_I2S_IT_OVR)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_SPI_I2S_CLEAR_FLAG(FLAG) (((FLAG) == SPI_FLAG_CRCERR)) +#define IS_SPI_I2S_GET_FLAG(FLAG) (((FLAG) == SPI_I2S_FLAG_BSY) || ((FLAG) == SPI_I2S_FLAG_OVR) || \ + ((FLAG) == SPI_FLAG_MODF) || ((FLAG) == SPI_FLAG_CRCERR) || \ + ((FLAG) == I2S_FLAG_UDR) || ((FLAG) == I2S_FLAG_CHSIDE) || \ + ((FLAG) == SPI_I2S_FLAG_TXE) || ((FLAG) == SPI_I2S_FLAG_RXNE)) +/** + * @} + */ + +/** @defgroup SPI_CRC_polynomial + * @{ + */ + +#define IS_SPI_CRC_POLYNOMIAL(POLYNOMIAL) ((POLYNOMIAL) >= 0x1) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup SPI_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup SPI_Exported_Functions + * @{ + */ + +void SPI_I2S_DeInit(SPI_TypeDef* SPIx); +void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct); +void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct); +void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct); +void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct); +void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState); +void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState); +void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState); +void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState); +void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data); +uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx); +void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSInternalSoft); +void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState); +void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize); +void SPI_TransmitCRC(SPI_TypeDef* SPIx); +void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState); +uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC); +uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx); +void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction); +FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG); +void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG); +ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT); +void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_SPI_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_tim.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_tim.h new file mode 100644 index 0000000..cb98002 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_tim.h @@ -0,0 +1,1162 @@ +/** + ****************************************************************************** + * @file stm32f10x_tim.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the TIM firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_TIM_H +#define __STM32F10x_TIM_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup TIM + * @{ + */ + +/** @defgroup TIM_Exported_Types + * @{ + */ + +/** + * @brief TIM Time Base Init structure definition + * @note This structure is used with all TIMx except for TIM6 and TIM7. + */ + +typedef struct +{ + uint16_t TIM_Prescaler; /*!< Specifies the prescaler value used to divide the TIM clock. + This parameter can be a number between 0x0000 and 0xFFFF */ + + uint16_t TIM_CounterMode; /*!< Specifies the counter mode. + This parameter can be a value of @ref TIM_Counter_Mode */ + + uint16_t TIM_Period; /*!< Specifies the period value to be loaded into the active + Auto-Reload Register at the next update event. + This parameter must be a number between 0x0000 and 0xFFFF. */ + + uint16_t TIM_ClockDivision; /*!< Specifies the clock division. + This parameter can be a value of @ref TIM_Clock_Division_CKD */ + + uint8_t TIM_RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter + reaches zero, an update event is generated and counting restarts + from the RCR value (N). + This means in PWM mode that (N+1) corresponds to: + - the number of PWM periods in edge-aligned mode + - the number of half PWM period in center-aligned mode + This parameter must be a number between 0x00 and 0xFF. + @note This parameter is valid only for TIM1 and TIM8. */ +} TIM_TimeBaseInitTypeDef; + +/** + * @brief TIM Output Compare Init structure definition + */ + +typedef struct +{ + uint16_t TIM_OCMode; /*!< Specifies the TIM mode. + This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */ + + uint16_t TIM_OutputState; /*!< Specifies the TIM Output Compare state. + This parameter can be a value of @ref TIM_Output_Compare_state */ + + uint16_t TIM_OutputNState; /*!< Specifies the TIM complementary Output Compare state. + This parameter can be a value of @ref TIM_Output_Compare_N_state + @note This parameter is valid only for TIM1 and TIM8. */ + + uint16_t TIM_Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. + This parameter can be a number between 0x0000 and 0xFFFF */ + + uint16_t TIM_OCPolarity; /*!< Specifies the output polarity. + This parameter can be a value of @ref TIM_Output_Compare_Polarity */ + + uint16_t TIM_OCNPolarity; /*!< Specifies the complementary output polarity. + This parameter can be a value of @ref TIM_Output_Compare_N_Polarity + @note This parameter is valid only for TIM1 and TIM8. */ + + uint16_t TIM_OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_Idle_State + @note This parameter is valid only for TIM1 and TIM8. */ + + uint16_t TIM_OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State + @note This parameter is valid only for TIM1 and TIM8. */ +} TIM_OCInitTypeDef; + +/** + * @brief TIM Input Capture Init structure definition + */ + +typedef struct +{ + + uint16_t TIM_Channel; /*!< Specifies the TIM channel. + This parameter can be a value of @ref TIM_Channel */ + + uint16_t TIM_ICPolarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Input_Capture_Polarity */ + + uint16_t TIM_ICSelection; /*!< Specifies the input. + This parameter can be a value of @ref TIM_Input_Capture_Selection */ + + uint16_t TIM_ICPrescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ + + uint16_t TIM_ICFilter; /*!< Specifies the input capture filter. + This parameter can be a number between 0x0 and 0xF */ +} TIM_ICInitTypeDef; + +/** + * @brief BDTR structure definition + * @note This structure is used only with TIM1 and TIM8. + */ + +typedef struct +{ + + uint16_t TIM_OSSRState; /*!< Specifies the Off-State selection used in Run mode. + This parameter can be a value of @ref OSSR_Off_State_Selection_for_Run_mode_state */ + + uint16_t TIM_OSSIState; /*!< Specifies the Off-State used in Idle state. + This parameter can be a value of @ref OSSI_Off_State_Selection_for_Idle_mode_state */ + + uint16_t TIM_LOCKLevel; /*!< Specifies the LOCK level parameters. + This parameter can be a value of @ref Lock_level */ + + uint16_t TIM_DeadTime; /*!< Specifies the delay time between the switching-off and the + switching-on of the outputs. + This parameter can be a number between 0x00 and 0xFF */ + + uint16_t TIM_Break; /*!< Specifies whether the TIM Break input is enabled or not. + This parameter can be a value of @ref Break_Input_enable_disable */ + + uint16_t TIM_BreakPolarity; /*!< Specifies the TIM Break Input pin polarity. + This parameter can be a value of @ref Break_Polarity */ + + uint16_t TIM_AutomaticOutput; /*!< Specifies whether the TIM Automatic Output feature is enabled or not. + This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ +} TIM_BDTRInitTypeDef; + +/** @defgroup TIM_Exported_constants + * @{ + */ + +#define IS_TIM_ALL_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM6) || \ + ((PERIPH) == TIM7) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM9) || \ + ((PERIPH) == TIM10)|| \ + ((PERIPH) == TIM11)|| \ + ((PERIPH) == TIM12)|| \ + ((PERIPH) == TIM13)|| \ + ((PERIPH) == TIM14)|| \ + ((PERIPH) == TIM15)|| \ + ((PERIPH) == TIM16)|| \ + ((PERIPH) == TIM17)) + +/* LIST1: TIM 1 and 8 */ +#define IS_TIM_LIST1_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM8)) + +/* LIST2: TIM 1, 8, 15 16 and 17 */ +#define IS_TIM_LIST2_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM15)|| \ + ((PERIPH) == TIM16)|| \ + ((PERIPH) == TIM17)) + +/* LIST3: TIM 1, 2, 3, 4, 5 and 8 */ +#define IS_TIM_LIST3_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM8)) + +/* LIST4: TIM 1, 2, 3, 4, 5, 8, 15, 16 and 17 */ +#define IS_TIM_LIST4_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM15)|| \ + ((PERIPH) == TIM16)|| \ + ((PERIPH) == TIM17)) + +/* LIST5: TIM 1, 2, 3, 4, 5, 8 and 15 */ +#define IS_TIM_LIST5_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM15)) + +/* LIST6: TIM 1, 2, 3, 4, 5, 8, 9, 12 and 15 */ +#define IS_TIM_LIST6_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM9) || \ + ((PERIPH) == TIM12)|| \ + ((PERIPH) == TIM15)) + +/* LIST7: TIM 1, 2, 3, 4, 5, 6, 7, 8, 9, 12 and 15 */ +#define IS_TIM_LIST7_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM6) || \ + ((PERIPH) == TIM7) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM9) || \ + ((PERIPH) == TIM12)|| \ + ((PERIPH) == TIM15)) + +/* LIST8: TIM 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 and 17 */ +#define IS_TIM_LIST8_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM9) || \ + ((PERIPH) == TIM10)|| \ + ((PERIPH) == TIM11)|| \ + ((PERIPH) == TIM12)|| \ + ((PERIPH) == TIM13)|| \ + ((PERIPH) == TIM14)|| \ + ((PERIPH) == TIM15)|| \ + ((PERIPH) == TIM16)|| \ + ((PERIPH) == TIM17)) + +/* LIST9: TIM 1, 2, 3, 4, 5, 6, 7, 8, 15, 16, and 17 */ +#define IS_TIM_LIST9_PERIPH(PERIPH) (((PERIPH) == TIM1) || \ + ((PERIPH) == TIM2) || \ + ((PERIPH) == TIM3) || \ + ((PERIPH) == TIM4) || \ + ((PERIPH) == TIM5) || \ + ((PERIPH) == TIM6) || \ + ((PERIPH) == TIM7) || \ + ((PERIPH) == TIM8) || \ + ((PERIPH) == TIM15)|| \ + ((PERIPH) == TIM16)|| \ + ((PERIPH) == TIM17)) + +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMode_Timing) || \ + ((MODE) == TIM_OCMode_Active) || \ + ((MODE) == TIM_OCMode_Inactive) || \ + ((MODE) == TIM_OCMode_Toggle)|| \ + ((MODE) == TIM_OCMode_PWM1) || \ + ((MODE) == TIM_OCMode_PWM2)) +#define IS_TIM_OCM(MODE) (((MODE) == TIM_OCMode_Timing) || \ + ((MODE) == TIM_OCMode_Active) || \ + ((MODE) == TIM_OCMode_Inactive) || \ + ((MODE) == TIM_OCMode_Toggle)|| \ + ((MODE) == TIM_OCMode_PWM1) || \ + ((MODE) == TIM_OCMode_PWM2) || \ + ((MODE) == TIM_ForcedAction_Active) || \ + ((MODE) == TIM_ForcedAction_InActive)) +/** + * @} + */ + +/** @defgroup TIM_One_Pulse_Mode + * @{ + */ + +#define TIM_OPMode_Single ((uint16_t)0x0008) +#define TIM_OPMode_Repetitive ((uint16_t)0x0000) +#define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMode_Single) || \ + ((MODE) == TIM_OPMode_Repetitive)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \ + ((CHANNEL) == TIM_Channel_2) || \ + ((CHANNEL) == TIM_Channel_3) || \ + ((CHANNEL) == TIM_Channel_4)) +#define IS_TIM_PWMI_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \ + ((CHANNEL) == TIM_Channel_2)) +#define IS_TIM_COMPLEMENTARY_CHANNEL(CHANNEL) (((CHANNEL) == TIM_Channel_1) || \ + ((CHANNEL) == TIM_Channel_2) || \ + ((CHANNEL) == TIM_Channel_3)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_CKD_DIV(DIV) (((DIV) == TIM_CKD_DIV1) || \ + ((DIV) == TIM_CKD_DIV2) || \ + ((DIV) == TIM_CKD_DIV4)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_CounterMode_Up) || \ + ((MODE) == TIM_CounterMode_Down) || \ + ((MODE) == TIM_CounterMode_CenterAligned1) || \ + ((MODE) == TIM_CounterMode_CenterAligned2) || \ + ((MODE) == TIM_CounterMode_CenterAligned3)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Polarity + * @{ + */ + +#define TIM_OCPolarity_High ((uint16_t)0x0000) +#define TIM_OCPolarity_Low ((uint16_t)0x0002) +#define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPolarity_High) || \ + ((POLARITY) == TIM_OCPolarity_Low)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_Polarity + * @{ + */ + +#define TIM_OCNPolarity_High ((uint16_t)0x0000) +#define TIM_OCNPolarity_Low ((uint16_t)0x0008) +#define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPolarity_High) || \ + ((POLARITY) == TIM_OCNPolarity_Low)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_state + * @{ + */ + +#define TIM_OutputState_Disable ((uint16_t)0x0000) +#define TIM_OutputState_Enable ((uint16_t)0x0001) +#define IS_TIM_OUTPUT_STATE(STATE) (((STATE) == TIM_OutputState_Disable) || \ + ((STATE) == TIM_OutputState_Enable)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_state + * @{ + */ + +#define TIM_OutputNState_Disable ((uint16_t)0x0000) +#define TIM_OutputNState_Enable ((uint16_t)0x0004) +#define IS_TIM_OUTPUTN_STATE(STATE) (((STATE) == TIM_OutputNState_Disable) || \ + ((STATE) == TIM_OutputNState_Enable)) +/** + * @} + */ + +/** @defgroup TIM_Capture_Compare_state + * @{ + */ + +#define TIM_CCx_Enable ((uint16_t)0x0001) +#define TIM_CCx_Disable ((uint16_t)0x0000) +#define IS_TIM_CCX(CCX) (((CCX) == TIM_CCx_Enable) || \ + ((CCX) == TIM_CCx_Disable)) +/** + * @} + */ + +/** @defgroup TIM_Capture_Compare_N_state + * @{ + */ + +#define TIM_CCxN_Enable ((uint16_t)0x0004) +#define TIM_CCxN_Disable ((uint16_t)0x0000) +#define IS_TIM_CCXN(CCXN) (((CCXN) == TIM_CCxN_Enable) || \ + ((CCXN) == TIM_CCxN_Disable)) +/** + * @} + */ + +/** @defgroup Break_Input_enable_disable + * @{ + */ + +#define TIM_Break_Enable ((uint16_t)0x1000) +#define TIM_Break_Disable ((uint16_t)0x0000) +#define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_Break_Enable) || \ + ((STATE) == TIM_Break_Disable)) +/** + * @} + */ + +/** @defgroup Break_Polarity + * @{ + */ + +#define TIM_BreakPolarity_Low ((uint16_t)0x0000) +#define TIM_BreakPolarity_High ((uint16_t)0x2000) +#define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BreakPolarity_Low) || \ + ((POLARITY) == TIM_BreakPolarity_High)) +/** + * @} + */ + +/** @defgroup TIM_AOE_Bit_Set_Reset + * @{ + */ + +#define TIM_AutomaticOutput_Enable ((uint16_t)0x4000) +#define TIM_AutomaticOutput_Disable ((uint16_t)0x0000) +#define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AutomaticOutput_Enable) || \ + ((STATE) == TIM_AutomaticOutput_Disable)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLevel_OFF) || \ + ((LEVEL) == TIM_LOCKLevel_1) || \ + ((LEVEL) == TIM_LOCKLevel_2) || \ + ((LEVEL) == TIM_LOCKLevel_3)) +/** + * @} + */ + +/** @defgroup OSSI_Off_State_Selection_for_Idle_mode_state + * @{ + */ + +#define TIM_OSSIState_Enable ((uint16_t)0x0400) +#define TIM_OSSIState_Disable ((uint16_t)0x0000) +#define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSIState_Enable) || \ + ((STATE) == TIM_OSSIState_Disable)) +/** + * @} + */ + +/** @defgroup OSSR_Off_State_Selection_for_Run_mode_state + * @{ + */ + +#define TIM_OSSRState_Enable ((uint16_t)0x0800) +#define TIM_OSSRState_Disable ((uint16_t)0x0000) +#define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSRState_Enable) || \ + ((STATE) == TIM_OSSRState_Disable)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Idle_State + * @{ + */ + +#define TIM_OCIdleState_Set ((uint16_t)0x0100) +#define TIM_OCIdleState_Reset ((uint16_t)0x0000) +#define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIdleState_Set) || \ + ((STATE) == TIM_OCIdleState_Reset)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_Idle_State + * @{ + */ + +#define TIM_OCNIdleState_Set ((uint16_t)0x0200) +#define TIM_OCNIdleState_Reset ((uint16_t)0x0000) +#define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIdleState_Set) || \ + ((STATE) == TIM_OCNIdleState_Reset)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPolarity_Rising) || \ + ((POLARITY) == TIM_ICPolarity_Falling)) +#define IS_TIM_IC_POLARITY_LITE(POLARITY) (((POLARITY) == TIM_ICPolarity_Rising) || \ + ((POLARITY) == TIM_ICPolarity_Falling)|| \ + ((POLARITY) == TIM_ICPolarity_BothEdge)) +/** + * @} + */ + +/** @defgroup 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. */ +#define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSelection_DirectTI) || \ + ((SELECTION) == TIM_ICSelection_IndirectTI) || \ + ((SELECTION) == TIM_ICSelection_TRC)) +/** + * @} + */ + +/** @defgroup 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. */ +#define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \ + ((PRESCALER) == TIM_ICPSC_DIV2) || \ + ((PRESCALER) == TIM_ICPSC_DIV4) || \ + ((PRESCALER) == TIM_ICPSC_DIV8)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_IT(IT) ((((IT) & (uint16_t)0xFF00) == 0x0000) && ((IT) != 0x0000)) + +#define IS_TIM_GET_IT(IT) (((IT) == TIM_IT_Update) || \ + ((IT) == TIM_IT_CC1) || \ + ((IT) == TIM_IT_CC2) || \ + ((IT) == TIM_IT_CC3) || \ + ((IT) == TIM_IT_CC4) || \ + ((IT) == TIM_IT_COM) || \ + ((IT) == TIM_IT_Trigger) || \ + ((IT) == TIM_IT_Break)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABase_CR1) || \ + ((BASE) == TIM_DMABase_CR2) || \ + ((BASE) == TIM_DMABase_SMCR) || \ + ((BASE) == TIM_DMABase_DIER) || \ + ((BASE) == TIM_DMABase_SR) || \ + ((BASE) == TIM_DMABase_EGR) || \ + ((BASE) == TIM_DMABase_CCMR1) || \ + ((BASE) == TIM_DMABase_CCMR2) || \ + ((BASE) == TIM_DMABase_CCER) || \ + ((BASE) == TIM_DMABase_CNT) || \ + ((BASE) == TIM_DMABase_PSC) || \ + ((BASE) == TIM_DMABase_ARR) || \ + ((BASE) == TIM_DMABase_RCR) || \ + ((BASE) == TIM_DMABase_CCR1) || \ + ((BASE) == TIM_DMABase_CCR2) || \ + ((BASE) == TIM_DMABase_CCR3) || \ + ((BASE) == TIM_DMABase_CCR4) || \ + ((BASE) == TIM_DMABase_BDTR) || \ + ((BASE) == TIM_DMABase_DCR)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABurstLength_1Transfer) || \ + ((LENGTH) == TIM_DMABurstLength_2Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_3Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_4Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_5Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_6Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_7Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_8Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_9Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_10Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_11Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_12Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_13Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_14Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_15Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_16Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_17Transfers) || \ + ((LENGTH) == TIM_DMABurstLength_18Transfers)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & (uint16_t)0x80FF) == 0x0000) && ((SOURCE) != 0x0000)) + +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_EXT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ExtTRGPSC_OFF) || \ + ((PRESCALER) == TIM_ExtTRGPSC_DIV2) || \ + ((PRESCALER) == TIM_ExtTRGPSC_DIV4) || \ + ((PRESCALER) == TIM_ExtTRGPSC_DIV8)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ + ((SELECTION) == TIM_TS_ITR1) || \ + ((SELECTION) == TIM_TS_ITR2) || \ + ((SELECTION) == TIM_TS_ITR3) || \ + ((SELECTION) == TIM_TS_TI1F_ED) || \ + ((SELECTION) == TIM_TS_TI1FP1) || \ + ((SELECTION) == TIM_TS_TI2FP2) || \ + ((SELECTION) == TIM_TS_ETRF)) +#define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \ + ((SELECTION) == TIM_TS_ITR1) || \ + ((SELECTION) == TIM_TS_ITR2) || \ + ((SELECTION) == TIM_TS_ITR3)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_TIXCLK_SOURCE(SOURCE) (((SOURCE) == TIM_TIxExternalCLK1Source_TI1) || \ + ((SOURCE) == TIM_TIxExternalCLK1Source_TI2) || \ + ((SOURCE) == TIM_TIxExternalCLK1Source_TI1ED)) +/** + * @} + */ + +/** @defgroup TIM_External_Trigger_Polarity + * @{ + */ +#define TIM_ExtTRGPolarity_Inverted ((uint16_t)0x8000) +#define TIM_ExtTRGPolarity_NonInverted ((uint16_t)0x0000) +#define IS_TIM_EXT_POLARITY(POLARITY) (((POLARITY) == TIM_ExtTRGPolarity_Inverted) || \ + ((POLARITY) == TIM_ExtTRGPolarity_NonInverted)) +/** + * @} + */ + +/** @defgroup TIM_Prescaler_Reload_Mode + * @{ + */ + +#define TIM_PSCReloadMode_Update ((uint16_t)0x0000) +#define TIM_PSCReloadMode_Immediate ((uint16_t)0x0001) +#define IS_TIM_PRESCALER_RELOAD(RELOAD) (((RELOAD) == TIM_PSCReloadMode_Update) || \ + ((RELOAD) == TIM_PSCReloadMode_Immediate)) +/** + * @} + */ + +/** @defgroup TIM_Forced_Action + * @{ + */ + +#define TIM_ForcedAction_Active ((uint16_t)0x0050) +#define TIM_ForcedAction_InActive ((uint16_t)0x0040) +#define IS_TIM_FORCED_ACTION(ACTION) (((ACTION) == TIM_ForcedAction_Active) || \ + ((ACTION) == TIM_ForcedAction_InActive)) +/** + * @} + */ + +/** @defgroup TIM_Encoder_Mode + * @{ + */ + +#define TIM_EncoderMode_TI1 ((uint16_t)0x0001) +#define TIM_EncoderMode_TI2 ((uint16_t)0x0002) +#define TIM_EncoderMode_TI12 ((uint16_t)0x0003) +#define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_EncoderMode_TI1) || \ + ((MODE) == TIM_EncoderMode_TI2) || \ + ((MODE) == TIM_EncoderMode_TI12)) +/** + * @} + */ + + +/** @defgroup 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) +#define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & (uint16_t)0xFF00) == 0x0000) && ((SOURCE) != 0x0000)) + +/** + * @} + */ + +/** @defgroup 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. */ +#define IS_TIM_UPDATE_SOURCE(SOURCE) (((SOURCE) == TIM_UpdateSource_Global) || \ + ((SOURCE) == TIM_UpdateSource_Regular)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Preload_State + * @{ + */ + +#define TIM_OCPreload_Enable ((uint16_t)0x0008) +#define TIM_OCPreload_Disable ((uint16_t)0x0000) +#define IS_TIM_OCPRELOAD_STATE(STATE) (((STATE) == TIM_OCPreload_Enable) || \ + ((STATE) == TIM_OCPreload_Disable)) +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Fast_State + * @{ + */ + +#define TIM_OCFast_Enable ((uint16_t)0x0004) +#define TIM_OCFast_Disable ((uint16_t)0x0000) +#define IS_TIM_OCFAST_STATE(STATE) (((STATE) == TIM_OCFast_Enable) || \ + ((STATE) == TIM_OCFast_Disable)) + +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Clear_State + * @{ + */ + +#define TIM_OCClear_Enable ((uint16_t)0x0080) +#define TIM_OCClear_Disable ((uint16_t)0x0000) +#define IS_TIM_OCCLEAR_STATE(STATE) (((STATE) == TIM_OCClear_Enable) || \ + ((STATE) == TIM_OCClear_Disable)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGOSource_Reset) || \ + ((SOURCE) == TIM_TRGOSource_Enable) || \ + ((SOURCE) == TIM_TRGOSource_Update) || \ + ((SOURCE) == TIM_TRGOSource_OC1) || \ + ((SOURCE) == TIM_TRGOSource_OC1Ref) || \ + ((SOURCE) == TIM_TRGOSource_OC2Ref) || \ + ((SOURCE) == TIM_TRGOSource_OC3Ref) || \ + ((SOURCE) == TIM_TRGOSource_OC4Ref)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SlaveMode_Reset) || \ + ((MODE) == TIM_SlaveMode_Gated) || \ + ((MODE) == TIM_SlaveMode_Trigger) || \ + ((MODE) == TIM_SlaveMode_External1)) +/** + * @} + */ + +/** @defgroup TIM_Master_Slave_Mode + * @{ + */ + +#define TIM_MasterSlaveMode_Enable ((uint16_t)0x0080) +#define TIM_MasterSlaveMode_Disable ((uint16_t)0x0000) +#define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MasterSlaveMode_Enable) || \ + ((STATE) == TIM_MasterSlaveMode_Disable)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_TIM_GET_FLAG(FLAG) (((FLAG) == TIM_FLAG_Update) || \ + ((FLAG) == TIM_FLAG_CC1) || \ + ((FLAG) == TIM_FLAG_CC2) || \ + ((FLAG) == TIM_FLAG_CC3) || \ + ((FLAG) == TIM_FLAG_CC4) || \ + ((FLAG) == TIM_FLAG_COM) || \ + ((FLAG) == TIM_FLAG_Trigger) || \ + ((FLAG) == TIM_FLAG_Break) || \ + ((FLAG) == TIM_FLAG_CC1OF) || \ + ((FLAG) == TIM_FLAG_CC2OF) || \ + ((FLAG) == TIM_FLAG_CC3OF) || \ + ((FLAG) == TIM_FLAG_CC4OF)) + + +#define IS_TIM_CLEAR_FLAG(TIM_FLAG) ((((TIM_FLAG) & (uint16_t)0xE100) == 0x0000) && ((TIM_FLAG) != 0x0000)) +/** + * @} + */ + +/** @defgroup TIM_Input_Capture_Filer_Value + * @{ + */ + +#define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0xF) +/** + * @} + */ + +/** @defgroup TIM_External_Trigger_Filter + * @{ + */ + +#define IS_TIM_EXT_FILTER(EXTFILTER) ((EXTFILTER) <= 0xF) +/** + * @} + */ + +/** @defgroup 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 +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup TIM_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions + * @{ + */ + +void TIM_DeInit(TIM_TypeDef* TIMx); +void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct); +void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct); +void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct); +void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct); +void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct); +void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct); +void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct); +void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct); +void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct); +void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct); +void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct); +void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct); +void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_ITConfig(TIM_TypeDef* TIMx, uint16_t TIM_IT, FunctionalState NewState); +void TIM_GenerateEvent(TIM_TypeDef* TIMx, uint16_t TIM_EventSource); +void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength); +void TIM_DMACmd(TIM_TypeDef* TIMx, uint16_t TIM_DMASource, FunctionalState NewState); +void TIM_InternalClockConfig(TIM_TypeDef* TIMx); +void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource); +void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource, + uint16_t TIM_ICPolarity, uint16_t ICFilter); +void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, + uint16_t ExtTRGFilter); +void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, + uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter); +void TIM_ETRConfig(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, + uint16_t ExtTRGFilter); +void TIM_PrescalerConfig(TIM_TypeDef* TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode); +void TIM_CounterModeConfig(TIM_TypeDef* TIMx, uint16_t TIM_CounterMode); +void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource); +void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, uint16_t TIM_EncoderMode, + uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity); +void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction); +void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction); +void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction); +void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction); +void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_SelectCOM(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_SelectCCDMA(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_OC1PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload); +void TIM_OC2PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload); +void TIM_OC3PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload); +void TIM_OC4PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload); +void TIM_OC1FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast); +void TIM_OC2FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast); +void TIM_OC3FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast); +void TIM_OC4FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast); +void TIM_ClearOC1Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear); +void TIM_ClearOC2Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear); +void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear); +void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear); +void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity); +void TIM_OC1NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity); +void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity); +void TIM_OC2NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity); +void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity); +void TIM_OC3NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity); +void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity); +void TIM_CCxCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx); +void TIM_CCxNCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN); +void TIM_SelectOCxM(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_OCMode); +void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource); +void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState NewState); +void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, uint16_t TIM_OPMode); +void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource); +void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode); +void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_MasterSlaveMode); +void TIM_SetCounter(TIM_TypeDef* TIMx, uint16_t Counter); +void TIM_SetAutoreload(TIM_TypeDef* TIMx, uint16_t Autoreload); +void TIM_SetCompare1(TIM_TypeDef* TIMx, uint16_t Compare1); +void TIM_SetCompare2(TIM_TypeDef* TIMx, uint16_t Compare2); +void TIM_SetCompare3(TIM_TypeDef* TIMx, uint16_t Compare3); +void TIM_SetCompare4(TIM_TypeDef* TIMx, uint16_t Compare4); +void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC); +void TIM_SetIC2Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC); +void TIM_SetIC3Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC); +void TIM_SetIC4Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC); +void TIM_SetClockDivision(TIM_TypeDef* TIMx, uint16_t TIM_CKD); +uint16_t TIM_GetCapture1(TIM_TypeDef* TIMx); +uint16_t TIM_GetCapture2(TIM_TypeDef* TIMx); +uint16_t TIM_GetCapture3(TIM_TypeDef* TIMx); +uint16_t TIM_GetCapture4(TIM_TypeDef* TIMx); +uint16_t TIM_GetCounter(TIM_TypeDef* TIMx); +uint16_t TIM_GetPrescaler(TIM_TypeDef* TIMx); +FlagStatus TIM_GetFlagStatus(TIM_TypeDef* TIMx, uint16_t TIM_FLAG); +void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG); +ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT); +void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F10x_TIM_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_usart.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_usart.h new file mode 100644 index 0000000..24a819c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_usart.h @@ -0,0 +1,421 @@ +/** + ****************************************************************************** + * @file stm32f10x_usart.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the USART + * firmware library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_USART_H +#define __STM32F10x_USART_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup USART + * @{ + */ + +/** @defgroup USART_Exported_Types + * @{ + */ + +/** + * @brief USART Init Structure definition + */ + +typedef struct +{ + uint32_t USART_BaudRate; /*!< This member configures the USART communication baud rate. + The baud rate is computed using the following formula: + - IntegerDivider = ((PCLKx) / (16 * (USART_InitStruct->USART_BaudRate))) + - FractionalDivider = ((IntegerDivider - ((u32) IntegerDivider)) * 16) + 0.5 */ + + uint16_t USART_WordLength; /*!< Specifies the number of data bits transmitted or received in a frame. + This parameter can be a value of @ref USART_Word_Length */ + + uint16_t USART_StopBits; /*!< Specifies the number of stop bits transmitted. + This parameter can be a value of @ref USART_Stop_Bits */ + + uint16_t USART_Parity; /*!< Specifies the parity mode. + This parameter can be a value of @ref USART_Parity + @note When parity is enabled, the computed parity is inserted + at the MSB position of the transmitted data (9th bit when + the word length is set to 9 data bits; 8th bit when the + word length is set to 8 data bits). */ + + uint16_t USART_Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled. + This parameter can be a value of @ref USART_Mode */ + + uint16_t USART_HardwareFlowControl; /*!< Specifies wether the hardware flow control mode is enabled + or disabled. + This parameter can be a value of @ref USART_Hardware_Flow_Control */ +} USART_InitTypeDef; + +/** + * @brief USART Clock Init Structure definition + */ + +typedef struct +{ + + uint16_t USART_Clock; /*!< Specifies whether the USART clock is enabled or disabled. + This parameter can be a value of @ref USART_Clock */ + + uint16_t USART_CPOL; /*!< Specifies the steady state value of the serial clock. + This parameter can be a value of @ref USART_Clock_Polarity */ + + uint16_t USART_CPHA; /*!< Specifies the clock transition on which the bit capture is made. + This parameter can be a value of @ref USART_Clock_Phase */ + + uint16_t USART_LastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted + data bit (MSB) has to be output on the SCLK pin in synchronous mode. + This parameter can be a value of @ref USART_Last_Bit */ +} USART_ClockInitTypeDef; + +/** + * @} + */ + +/** @defgroup USART_Exported_Constants + * @{ + */ + +#define IS_USART_ALL_PERIPH(PERIPH) (((PERIPH) == USART1) || \ + ((PERIPH) == USART2) || \ + ((PERIPH) == USART3) || \ + ((PERIPH) == UART4) || \ + ((PERIPH) == UART5)) + +#define IS_USART_123_PERIPH(PERIPH) (((PERIPH) == USART1) || \ + ((PERIPH) == USART2) || \ + ((PERIPH) == USART3)) + +#define IS_USART_1234_PERIPH(PERIPH) (((PERIPH) == USART1) || \ + ((PERIPH) == USART2) || \ + ((PERIPH) == USART3) || \ + ((PERIPH) == UART4)) +/** @defgroup USART_Word_Length + * @{ + */ + +#define USART_WordLength_8b ((uint16_t)0x0000) +#define USART_WordLength_9b ((uint16_t)0x1000) + +#define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WordLength_8b) || \ + ((LENGTH) == USART_WordLength_9b)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_USART_STOPBITS(STOPBITS) (((STOPBITS) == USART_StopBits_1) || \ + ((STOPBITS) == USART_StopBits_0_5) || \ + ((STOPBITS) == USART_StopBits_2) || \ + ((STOPBITS) == USART_StopBits_1_5)) +/** + * @} + */ + +/** @defgroup USART_Parity + * @{ + */ + +#define USART_Parity_No ((uint16_t)0x0000) +#define USART_Parity_Even ((uint16_t)0x0400) +#define USART_Parity_Odd ((uint16_t)0x0600) +#define IS_USART_PARITY(PARITY) (((PARITY) == USART_Parity_No) || \ + ((PARITY) == USART_Parity_Even) || \ + ((PARITY) == USART_Parity_Odd)) +/** + * @} + */ + +/** @defgroup USART_Mode + * @{ + */ + +#define USART_Mode_Rx ((uint16_t)0x0004) +#define USART_Mode_Tx ((uint16_t)0x0008) +#define IS_USART_MODE(MODE) ((((MODE) & (uint16_t)0xFFF3) == 0x00) && ((MODE) != (uint16_t)0x00)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_USART_HARDWARE_FLOW_CONTROL(CONTROL)\ + (((CONTROL) == USART_HardwareFlowControl_None) || \ + ((CONTROL) == USART_HardwareFlowControl_RTS) || \ + ((CONTROL) == USART_HardwareFlowControl_CTS) || \ + ((CONTROL) == USART_HardwareFlowControl_RTS_CTS)) +/** + * @} + */ + +/** @defgroup USART_Clock + * @{ + */ +#define USART_Clock_Disable ((uint16_t)0x0000) +#define USART_Clock_Enable ((uint16_t)0x0800) +#define IS_USART_CLOCK(CLOCK) (((CLOCK) == USART_Clock_Disable) || \ + ((CLOCK) == USART_Clock_Enable)) +/** + * @} + */ + +/** @defgroup USART_Clock_Polarity + * @{ + */ + +#define USART_CPOL_Low ((uint16_t)0x0000) +#define USART_CPOL_High ((uint16_t)0x0400) +#define IS_USART_CPOL(CPOL) (((CPOL) == USART_CPOL_Low) || ((CPOL) == USART_CPOL_High)) + +/** + * @} + */ + +/** @defgroup USART_Clock_Phase + * @{ + */ + +#define USART_CPHA_1Edge ((uint16_t)0x0000) +#define USART_CPHA_2Edge ((uint16_t)0x0200) +#define IS_USART_CPHA(CPHA) (((CPHA) == USART_CPHA_1Edge) || ((CPHA) == USART_CPHA_2Edge)) + +/** + * @} + */ + +/** @defgroup USART_Last_Bit + * @{ + */ + +#define USART_LastBit_Disable ((uint16_t)0x0000) +#define USART_LastBit_Enable ((uint16_t)0x0100) +#define IS_USART_LASTBIT(LASTBIT) (((LASTBIT) == USART_LastBit_Disable) || \ + ((LASTBIT) == USART_LastBit_Enable)) +/** + * @} + */ + +/** @defgroup 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) /* In case interrupt is generated if the RXNEIE bit is set */ +#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) /* In case interrupt is generated if the EIE bit is set */ +#define USART_IT_NE ((uint16_t)0x0260) +#define USART_IT_FE ((uint16_t)0x0160) + +/** @defgroup USART_Legacy + * @{ + */ +#define USART_IT_ORE USART_IT_ORE_ER +/** + * @} + */ + +#define IS_USART_CONFIG_IT(IT) (((IT) == USART_IT_PE) || ((IT) == USART_IT_TXE) || \ + ((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \ + ((IT) == USART_IT_IDLE) || ((IT) == USART_IT_LBD) || \ + ((IT) == USART_IT_CTS) || ((IT) == USART_IT_ERR)) + +#define IS_USART_GET_IT(IT) (((IT) == USART_IT_PE) || ((IT) == USART_IT_TXE) || \ + ((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \ + ((IT) == USART_IT_IDLE) || ((IT) == USART_IT_LBD) || \ + ((IT) == USART_IT_CTS) || ((IT) == USART_IT_ORE) || \ + ((IT) == USART_IT_ORE_RX) || ((IT) == USART_IT_ORE_ER) || \ + ((IT) == USART_IT_NE) || ((IT) == USART_IT_FE)) + +#define IS_USART_CLEAR_IT(IT) (((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \ + ((IT) == USART_IT_LBD) || ((IT) == USART_IT_CTS)) +/** + * @} + */ + +/** @defgroup USART_DMA_Requests + * @{ + */ + +#define USART_DMAReq_Tx ((uint16_t)0x0080) +#define USART_DMAReq_Rx ((uint16_t)0x0040) +#define IS_USART_DMAREQ(DMAREQ) ((((DMAREQ) & (uint16_t)0xFF3F) == 0x00) && ((DMAREQ) != (uint16_t)0x00)) + +/** + * @} + */ + +/** @defgroup USART_WakeUp_methods + * @{ + */ + +#define USART_WakeUp_IdleLine ((uint16_t)0x0000) +#define USART_WakeUp_AddressMark ((uint16_t)0x0800) +#define IS_USART_WAKEUP(WAKEUP) (((WAKEUP) == USART_WakeUp_IdleLine) || \ + ((WAKEUP) == USART_WakeUp_AddressMark)) +/** + * @} + */ + +/** @defgroup USART_LIN_Break_Detection_Length + * @{ + */ + +#define USART_LINBreakDetectLength_10b ((uint16_t)0x0000) +#define USART_LINBreakDetectLength_11b ((uint16_t)0x0020) +#define IS_USART_LIN_BREAK_DETECT_LENGTH(LENGTH) \ + (((LENGTH) == USART_LINBreakDetectLength_10b) || \ + ((LENGTH) == USART_LINBreakDetectLength_11b)) +/** + * @} + */ + +/** @defgroup USART_IrDA_Low_Power + * @{ + */ + +#define USART_IrDAMode_LowPower ((uint16_t)0x0004) +#define USART_IrDAMode_Normal ((uint16_t)0x0000) +#define IS_USART_IRDA_MODE(MODE) (((MODE) == USART_IrDAMode_LowPower) || \ + ((MODE) == USART_IrDAMode_Normal)) +/** + * @} + */ + +/** @defgroup 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) +#define IS_USART_FLAG(FLAG) (((FLAG) == USART_FLAG_PE) || ((FLAG) == USART_FLAG_TXE) || \ + ((FLAG) == USART_FLAG_TC) || ((FLAG) == USART_FLAG_RXNE) || \ + ((FLAG) == USART_FLAG_IDLE) || ((FLAG) == USART_FLAG_LBD) || \ + ((FLAG) == USART_FLAG_CTS) || ((FLAG) == USART_FLAG_ORE) || \ + ((FLAG) == USART_FLAG_NE) || ((FLAG) == USART_FLAG_FE)) + +#define IS_USART_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFC9F) == 0x00) && ((FLAG) != (uint16_t)0x00)) + +#define IS_USART_BAUDRATE(BAUDRATE) (((BAUDRATE) > 0) && ((BAUDRATE) < 0x0044AA21)) +#define IS_USART_ADDRESS(ADDRESS) ((ADDRESS) <= 0xF) +#define IS_USART_DATA(DATA) ((DATA) <= 0x1FF) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup USART_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup USART_Exported_Functions + * @{ + */ + +void USART_DeInit(USART_TypeDef* USARTx); +void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct); +void USART_StructInit(USART_InitTypeDef* USART_InitStruct); +void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct); +void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct); +void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState); +void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState); +void USART_SetAddress(USART_TypeDef* USARTx, uint8_t USART_Address); +void USART_WakeUpConfig(USART_TypeDef* USARTx, uint16_t USART_WakeUp); +void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, uint16_t USART_LINBreakDetectLength); +void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_SendData(USART_TypeDef* USARTx, uint16_t Data); +uint16_t USART_ReceiveData(USART_TypeDef* USARTx); +void USART_SendBreak(USART_TypeDef* USARTx); +void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime); +void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler); +void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_OverSampling8Cmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_OneBitMethodCmd(USART_TypeDef* USARTx, FunctionalState NewState); +void USART_IrDAConfig(USART_TypeDef* USARTx, uint16_t USART_IrDAMode); +void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState); +FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, uint16_t USART_FLAG); +void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG); +ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT); +void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_USART_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_wwdg.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_wwdg.h new file mode 100644 index 0000000..0c1a951 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/inc/stm32f10x_wwdg.h @@ -0,0 +1,113 @@ +/** + ****************************************************************************** + * @file stm32f10x_wwdg.h + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file contains all the functions prototypes for the WWDG firmware + * library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_WWDG_H +#define __STM32F10x_WWDG_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @addtogroup WWDG + * @{ + */ + +/** @defgroup WWDG_Exported_Types + * @{ + */ + +/** + * @} + */ + +/** @defgroup WWDG_Exported_Constants + * @{ + */ + +/** @defgroup 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) +#define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \ + ((PRESCALER) == WWDG_Prescaler_2) || \ + ((PRESCALER) == WWDG_Prescaler_4) || \ + ((PRESCALER) == WWDG_Prescaler_8)) +#define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F) +#define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F)) + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup WWDG_Exported_Macros + * @{ + */ +/** + * @} + */ + +/** @defgroup WWDG_Exported_Functions + * @{ + */ + +void WWDG_DeInit(void); +void WWDG_SetPrescaler(uint32_t WWDG_Prescaler); +void WWDG_SetWindowValue(uint8_t WindowValue); +void WWDG_EnableIT(void); +void WWDG_SetCounter(uint8_t Counter); +void WWDG_Enable(uint8_t Counter); +FlagStatus WWDG_GetFlagStatus(void); +void WWDG_ClearFlag(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_WWDG_H */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/misc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/misc.c new file mode 100644 index 0000000..2b9e2ea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/misc.c @@ -0,0 +1,223 @@ +/** + ****************************************************************************** + * @file misc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the miscellaneous firmware functions (add-on + * to CMSIS functions). + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "misc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup MISC + * @brief MISC driver modules + * @{ + */ + +/** @defgroup MISC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup MISC_Private_Defines + * @{ + */ + +#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000) +/** + * @} + */ + +/** @defgroup MISC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup MISC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup MISC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup MISC_Private_Functions + * @{ + */ + +/** + * @brief Configures the priority grouping: pre-emption priority and subpriority. + * @param NVIC_PriorityGroup: specifies the priority grouping bits length. + * This parameter can be one of the following values: + * @arg NVIC_PriorityGroup_0: 0 bits for pre-emption priority + * 4 bits for subpriority + * @arg NVIC_PriorityGroup_1: 1 bits for pre-emption priority + * 3 bits for subpriority + * @arg NVIC_PriorityGroup_2: 2 bits for pre-emption priority + * 2 bits for subpriority + * @arg NVIC_PriorityGroup_3: 3 bits for pre-emption priority + * 1 bits for subpriority + * @arg NVIC_PriorityGroup_4: 4 bits for pre-emption priority + * 0 bits for subpriority + * @retval None + */ +void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup) +{ + /* Check the parameters */ + assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup)); + + /* Set the PRIGROUP[10:8] bits according to NVIC_PriorityGroup value */ + SCB->AIRCR = AIRCR_VECTKEY_MASK | NVIC_PriorityGroup; +} + +/** + * @brief Initializes the NVIC peripheral according to the specified + * parameters in the NVIC_InitStruct. + * @param NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure that contains + * the configuration information for the specified NVIC peripheral. + * @retval None + */ +void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct) +{ + uint32_t tmppriority = 0x00, tmppre = 0x00, tmpsub = 0x0F; + + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd)); + assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority)); + assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); + + if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) + { + /* Compute the Corresponding IRQ Priority --------------------------------*/ + tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; + tmppre = (0x4 - tmppriority); + tmpsub = tmpsub >> tmppriority; + + tmppriority = (uint32_t)NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; + tmppriority |= NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub; + tmppriority = tmppriority << 0x04; + + NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; + + /* Enable the Selected IRQ Channels --------------------------------------*/ + NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = + (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); + } + else + { + /* Disable the Selected IRQ Channels -------------------------------------*/ + NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = + (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); + } +} + +/** + * @brief Sets the vector table location and Offset. + * @param NVIC_VectTab: specifies if the vector table is in RAM or FLASH memory. + * This parameter can be one of the following values: + * @arg NVIC_VectTab_RAM + * @arg NVIC_VectTab_FLASH + * @param Offset: Vector Table base offset field. This value must be a multiple + * of 0x200. + * @retval None + */ +void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset) +{ + /* Check the parameters */ + assert_param(IS_NVIC_VECTTAB(NVIC_VectTab)); + assert_param(IS_NVIC_OFFSET(Offset)); + + SCB->VTOR = NVIC_VectTab | (Offset & (uint32_t)0x1FFFFF80); +} + +/** + * @brief Selects the condition for the system to enter low power mode. + * @param LowPowerMode: Specifies the new mode for the system to enter low power mode. + * This parameter can be one of the following values: + * @arg NVIC_LP_SEVONPEND + * @arg NVIC_LP_SLEEPDEEP + * @arg NVIC_LP_SLEEPONEXIT + * @param NewState: new state of LP condition. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_NVIC_LP(LowPowerMode)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + SCB->SCR |= LowPowerMode; + } + else + { + SCB->SCR &= (uint32_t)(~(uint32_t)LowPowerMode); + } +} + +/** + * @brief Configures the SysTick clock source. + * @param SysTick_CLKSource: specifies the SysTick clock source. + * This parameter can be one of the following values: + * @arg SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8 selected as SysTick clock source. + * @arg SysTick_CLKSource_HCLK: AHB clock selected as SysTick clock source. + * @retval None + */ +void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource) +{ + /* Check the parameters */ + assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource)); + if (SysTick_CLKSource == SysTick_CLKSource_HCLK) + { + SysTick->CTRL |= SysTick_CLKSource_HCLK; + } + else + { + SysTick->CTRL &= SysTick_CLKSource_HCLK_Div8; + } +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c new file mode 100644 index 0000000..5e814d4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c @@ -0,0 +1,1305 @@ +/** + ****************************************************************************** + * @file stm32f10x_adc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the ADC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_adc.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup ADC + * @brief ADC driver modules + * @{ + */ + +/** @defgroup ADC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup ADC_Private_Defines + * @{ + */ + +/* ADC DISCNUM mask */ +#define CR1_DISCNUM_Reset ((uint32_t)0xFFFF1FFF) + +/* ADC DISCEN mask */ +#define CR1_DISCEN_Set ((uint32_t)0x00000800) +#define CR1_DISCEN_Reset ((uint32_t)0xFFFFF7FF) + +/* ADC JAUTO mask */ +#define CR1_JAUTO_Set ((uint32_t)0x00000400) +#define CR1_JAUTO_Reset ((uint32_t)0xFFFFFBFF) + +/* ADC JDISCEN mask */ +#define CR1_JDISCEN_Set ((uint32_t)0x00001000) +#define CR1_JDISCEN_Reset ((uint32_t)0xFFFFEFFF) + +/* ADC AWDCH mask */ +#define CR1_AWDCH_Reset ((uint32_t)0xFFFFFFE0) + +/* ADC Analog watchdog enable mode mask */ +#define CR1_AWDMode_Reset ((uint32_t)0xFF3FFDFF) + +/* CR1 register Mask */ +#define CR1_CLEAR_Mask ((uint32_t)0xFFF0FEFF) + +/* ADC ADON mask */ +#define CR2_ADON_Set ((uint32_t)0x00000001) +#define CR2_ADON_Reset ((uint32_t)0xFFFFFFFE) + +/* ADC DMA mask */ +#define CR2_DMA_Set ((uint32_t)0x00000100) +#define CR2_DMA_Reset ((uint32_t)0xFFFFFEFF) + +/* ADC RSTCAL mask */ +#define CR2_RSTCAL_Set ((uint32_t)0x00000008) + +/* ADC CAL mask */ +#define CR2_CAL_Set ((uint32_t)0x00000004) + +/* ADC SWSTART mask */ +#define CR2_SWSTART_Set ((uint32_t)0x00400000) + +/* ADC EXTTRIG mask */ +#define CR2_EXTTRIG_Set ((uint32_t)0x00100000) +#define CR2_EXTTRIG_Reset ((uint32_t)0xFFEFFFFF) + +/* ADC Software start mask */ +#define CR2_EXTTRIG_SWSTART_Set ((uint32_t)0x00500000) +#define CR2_EXTTRIG_SWSTART_Reset ((uint32_t)0xFFAFFFFF) + +/* ADC JEXTSEL mask */ +#define CR2_JEXTSEL_Reset ((uint32_t)0xFFFF8FFF) + +/* ADC JEXTTRIG mask */ +#define CR2_JEXTTRIG_Set ((uint32_t)0x00008000) +#define CR2_JEXTTRIG_Reset ((uint32_t)0xFFFF7FFF) + +/* ADC JSWSTART mask */ +#define CR2_JSWSTART_Set ((uint32_t)0x00200000) + +/* ADC injected software start mask */ +#define CR2_JEXTTRIG_JSWSTART_Set ((uint32_t)0x00208000) +#define CR2_JEXTTRIG_JSWSTART_Reset ((uint32_t)0xFFDF7FFF) + +/* ADC TSPD mask */ +#define CR2_TSVREFE_Set ((uint32_t)0x00800000) +#define CR2_TSVREFE_Reset ((uint32_t)0xFF7FFFFF) + +/* CR2 register Mask */ +#define CR2_CLEAR_Mask ((uint32_t)0xFFF1F7FD) + +/* ADC SQx mask */ +#define SQR3_SQ_Set ((uint32_t)0x0000001F) +#define SQR2_SQ_Set ((uint32_t)0x0000001F) +#define SQR1_SQ_Set ((uint32_t)0x0000001F) + +/* SQR1 register Mask */ +#define SQR1_CLEAR_Mask ((uint32_t)0xFF0FFFFF) + +/* ADC JSQx mask */ +#define JSQR_JSQ_Set ((uint32_t)0x0000001F) + +/* ADC JL mask */ +#define JSQR_JL_Set ((uint32_t)0x00300000) +#define JSQR_JL_Reset ((uint32_t)0xFFCFFFFF) + +/* ADC SMPx mask */ +#define SMPR1_SMP_Set ((uint32_t)0x00000007) +#define SMPR2_SMP_Set ((uint32_t)0x00000007) + +/* ADC JDRx registers offset */ +#define JDR_Offset ((uint8_t)0x28) + +/* ADC1 DR register base address */ +#define DR_ADDRESS ((uint32_t)0x4001244C) + +/** + * @} + */ + +/** @defgroup ADC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup ADC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup ADC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup ADC_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the ADCx peripheral registers to their default reset values. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval None + */ +void ADC_DeInit(ADC_TypeDef* ADCx) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + + if (ADCx == ADC1) + { + /* Enable ADC1 reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, ENABLE); + /* Release ADC1 from reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, DISABLE); + } + else if (ADCx == ADC2) + { + /* Enable ADC2 reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, ENABLE); + /* Release ADC2 from reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, DISABLE); + } + else + { + if (ADCx == ADC3) + { + /* Enable ADC3 reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC3, ENABLE); + /* Release ADC3 from reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC3, DISABLE); + } + } +} + +/** + * @brief Initializes the ADCx peripheral according to the specified parameters + * in the ADC_InitStruct. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_InitStruct: pointer to an ADC_InitTypeDef structure that contains + * the configuration information for the specified ADC peripheral. + * @retval None + */ +void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct) +{ + uint32_t tmpreg1 = 0; + uint8_t tmpreg2 = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_MODE(ADC_InitStruct->ADC_Mode)); + assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ScanConvMode)); + assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ContinuousConvMode)); + assert_param(IS_ADC_EXT_TRIG(ADC_InitStruct->ADC_ExternalTrigConv)); + assert_param(IS_ADC_DATA_ALIGN(ADC_InitStruct->ADC_DataAlign)); + assert_param(IS_ADC_REGULAR_LENGTH(ADC_InitStruct->ADC_NbrOfChannel)); + + /*---------------------------- ADCx CR1 Configuration -----------------*/ + /* Get the ADCx CR1 value */ + tmpreg1 = ADCx->CR1; + /* Clear DUALMOD and SCAN bits */ + tmpreg1 &= CR1_CLEAR_Mask; + /* Configure ADCx: Dual mode and scan conversion mode */ + /* Set DUALMOD bits according to ADC_Mode value */ + /* Set SCAN bit according to ADC_ScanConvMode value */ + tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_Mode | ((uint32_t)ADC_InitStruct->ADC_ScanConvMode << 8)); + /* Write to ADCx CR1 */ + ADCx->CR1 = tmpreg1; + + /*---------------------------- ADCx CR2 Configuration -----------------*/ + /* Get the ADCx CR2 value */ + tmpreg1 = ADCx->CR2; + /* Clear CONT, ALIGN and EXTSEL bits */ + tmpreg1 &= CR2_CLEAR_Mask; + /* Configure ADCx: external trigger event and continuous conversion mode */ + /* Set ALIGN bit according to ADC_DataAlign value */ + /* Set EXTSEL bits according to ADC_ExternalTrigConv value */ + /* Set CONT bit according to ADC_ContinuousConvMode value */ + tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_DataAlign | ADC_InitStruct->ADC_ExternalTrigConv | + ((uint32_t)ADC_InitStruct->ADC_ContinuousConvMode << 1)); + /* Write to ADCx CR2 */ + ADCx->CR2 = tmpreg1; + + /*---------------------------- ADCx SQR1 Configuration -----------------*/ + /* Get the ADCx SQR1 value */ + tmpreg1 = ADCx->SQR1; + /* Clear L bits */ + tmpreg1 &= SQR1_CLEAR_Mask; + /* Configure ADCx: regular channel sequence length */ + /* Set L bits according to ADC_NbrOfChannel value */ + tmpreg2 |= (uint8_t) (ADC_InitStruct->ADC_NbrOfChannel - (uint8_t)1); + tmpreg1 |= (uint32_t)tmpreg2 << 20; + /* Write to ADCx SQR1 */ + ADCx->SQR1 = tmpreg1; +} + +/** + * @brief Fills each ADC_InitStruct member with its default value. + * @param ADC_InitStruct : pointer to an ADC_InitTypeDef structure which will be initialized. + * @retval None + */ +void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct) +{ + /* Reset ADC init structure parameters values */ + /* Initialize the ADC_Mode member */ + ADC_InitStruct->ADC_Mode = ADC_Mode_Independent; + /* initialize the ADC_ScanConvMode member */ + ADC_InitStruct->ADC_ScanConvMode = DISABLE; + /* Initialize the ADC_ContinuousConvMode member */ + ADC_InitStruct->ADC_ContinuousConvMode = DISABLE; + /* Initialize the ADC_ExternalTrigConv member */ + ADC_InitStruct->ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1; + /* Initialize the ADC_DataAlign member */ + ADC_InitStruct->ADC_DataAlign = ADC_DataAlign_Right; + /* Initialize the ADC_NbrOfChannel member */ + ADC_InitStruct->ADC_NbrOfChannel = 1; +} + +/** + * @brief Enables or disables the specified ADC peripheral. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the ADCx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the ADON bit to wake up the ADC from power down mode */ + ADCx->CR2 |= CR2_ADON_Set; + } + else + { + /* Disable the selected ADC peripheral */ + ADCx->CR2 &= CR2_ADON_Reset; + } +} + +/** + * @brief Enables or disables the specified ADC DMA request. + * @param ADCx: where x can be 1 or 3 to select the ADC peripheral. + * Note: ADC2 hasn't a DMA capability. + * @param NewState: new state of the selected ADC DMA transfer. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_DMA_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC DMA request */ + ADCx->CR2 |= CR2_DMA_Set; + } + else + { + /* Disable the selected ADC DMA request */ + ADCx->CR2 &= CR2_DMA_Reset; + } +} + +/** + * @brief Enables or disables the specified ADC interrupts. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_IT: specifies the ADC interrupt sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg ADC_IT_EOC: End of conversion interrupt mask + * @arg ADC_IT_AWD: Analog watchdog interrupt mask + * @arg ADC_IT_JEOC: End of injected conversion interrupt mask + * @param NewState: new state of the specified ADC interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState) +{ + uint8_t itmask = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + assert_param(IS_ADC_IT(ADC_IT)); + /* Get the ADC IT index */ + itmask = (uint8_t)ADC_IT; + if (NewState != DISABLE) + { + /* Enable the selected ADC interrupts */ + ADCx->CR1 |= itmask; + } + else + { + /* Disable the selected ADC interrupts */ + ADCx->CR1 &= (~(uint32_t)itmask); + } +} + +/** + * @brief Resets the selected ADC calibration registers. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval None + */ +void ADC_ResetCalibration(ADC_TypeDef* ADCx) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Resets the selected ADC calibration registers */ + ADCx->CR2 |= CR2_RSTCAL_Set; +} + +/** + * @brief Gets the selected ADC reset calibration registers status. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval The new state of ADC reset calibration registers (SET or RESET). + */ +FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Check the status of RSTCAL bit */ + if ((ADCx->CR2 & CR2_RSTCAL_Set) != (uint32_t)RESET) + { + /* RSTCAL bit is set */ + bitstatus = SET; + } + else + { + /* RSTCAL bit is reset */ + bitstatus = RESET; + } + /* Return the RSTCAL bit status */ + return bitstatus; +} + +/** + * @brief Starts the selected ADC calibration process. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval None + */ +void ADC_StartCalibration(ADC_TypeDef* ADCx) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Enable the selected ADC calibration process */ + ADCx->CR2 |= CR2_CAL_Set; +} + +/** + * @brief Gets the selected ADC calibration status. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval The new state of ADC calibration (SET or RESET). + */ +FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Check the status of CAL bit */ + if ((ADCx->CR2 & CR2_CAL_Set) != (uint32_t)RESET) + { + /* CAL bit is set: calibration on going */ + bitstatus = SET; + } + else + { + /* CAL bit is reset: end of calibration */ + bitstatus = RESET; + } + /* Return the CAL bit status */ + return bitstatus; +} + +/** + * @brief Enables or disables the selected ADC software start conversion . + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC software start conversion. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC conversion on external event and start the selected + ADC conversion */ + ADCx->CR2 |= CR2_EXTTRIG_SWSTART_Set; + } + else + { + /* Disable the selected ADC conversion on external event and stop the selected + ADC conversion */ + ADCx->CR2 &= CR2_EXTTRIG_SWSTART_Reset; + } +} + +/** + * @brief Gets the selected ADC Software start conversion Status. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval The new state of ADC software start conversion (SET or RESET). + */ +FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Check the status of SWSTART bit */ + if ((ADCx->CR2 & CR2_SWSTART_Set) != (uint32_t)RESET) + { + /* SWSTART bit is set */ + bitstatus = SET; + } + else + { + /* SWSTART bit is reset */ + bitstatus = RESET; + } + /* Return the SWSTART bit status */ + return bitstatus; +} + +/** + * @brief Configures the discontinuous mode for the selected ADC regular + * group channel. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param Number: specifies the discontinuous mode regular channel + * count value. This number must be between 1 and 8. + * @retval None + */ +void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number) +{ + uint32_t tmpreg1 = 0; + uint32_t tmpreg2 = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_REGULAR_DISC_NUMBER(Number)); + /* Get the old register value */ + tmpreg1 = ADCx->CR1; + /* Clear the old discontinuous mode channel count */ + tmpreg1 &= CR1_DISCNUM_Reset; + /* Set the discontinuous mode channel count */ + tmpreg2 = Number - 1; + tmpreg1 |= tmpreg2 << 13; + /* Store the new register value */ + ADCx->CR1 = tmpreg1; +} + +/** + * @brief Enables or disables the discontinuous mode on regular group + * channel for the specified ADC + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC discontinuous mode + * on regular group channel. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_DiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC regular discontinuous mode */ + ADCx->CR1 |= CR1_DISCEN_Set; + } + else + { + /* Disable the selected ADC regular discontinuous mode */ + ADCx->CR1 &= CR1_DISCEN_Reset; + } +} + +/** + * @brief Configures for the selected ADC regular channel its corresponding + * rank in the sequencer and its sample time. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_Channel: the ADC channel to configure. + * This parameter can be one of the following values: + * @arg ADC_Channel_0: ADC Channel0 selected + * @arg ADC_Channel_1: ADC Channel1 selected + * @arg ADC_Channel_2: ADC Channel2 selected + * @arg ADC_Channel_3: ADC Channel3 selected + * @arg ADC_Channel_4: ADC Channel4 selected + * @arg ADC_Channel_5: ADC Channel5 selected + * @arg ADC_Channel_6: ADC Channel6 selected + * @arg ADC_Channel_7: ADC Channel7 selected + * @arg ADC_Channel_8: ADC Channel8 selected + * @arg ADC_Channel_9: ADC Channel9 selected + * @arg ADC_Channel_10: ADC Channel10 selected + * @arg ADC_Channel_11: ADC Channel11 selected + * @arg ADC_Channel_12: ADC Channel12 selected + * @arg ADC_Channel_13: ADC Channel13 selected + * @arg ADC_Channel_14: ADC Channel14 selected + * @arg ADC_Channel_15: ADC Channel15 selected + * @arg ADC_Channel_16: ADC Channel16 selected + * @arg ADC_Channel_17: ADC Channel17 selected + * @param Rank: The rank in the regular group sequencer. This parameter must be between 1 to 16. + * @param ADC_SampleTime: The sample time value to be set for the selected channel. + * This parameter can be one of the following values: + * @arg ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles + * @arg ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles + * @arg ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles + * @arg ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles + * @arg ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles + * @arg ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles + * @arg ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles + * @arg ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles + * @retval None + */ +void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime) +{ + uint32_t tmpreg1 = 0, tmpreg2 = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_CHANNEL(ADC_Channel)); + assert_param(IS_ADC_REGULAR_RANK(Rank)); + assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); + /* if ADC_Channel_10 ... ADC_Channel_17 is selected */ + if (ADC_Channel > ADC_Channel_9) + { + /* Get the old register value */ + tmpreg1 = ADCx->SMPR1; + /* Calculate the mask to clear */ + tmpreg2 = SMPR1_SMP_Set << (3 * (ADC_Channel - 10)); + /* Clear the old channel sample time */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_SampleTime << (3 * (ADC_Channel - 10)); + /* Set the new channel sample time */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SMPR1 = tmpreg1; + } + else /* ADC_Channel include in ADC_Channel_[0..9] */ + { + /* Get the old register value */ + tmpreg1 = ADCx->SMPR2; + /* Calculate the mask to clear */ + tmpreg2 = SMPR2_SMP_Set << (3 * ADC_Channel); + /* Clear the old channel sample time */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); + /* Set the new channel sample time */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SMPR2 = tmpreg1; + } + /* For Rank 1 to 6 */ + if (Rank < 7) + { + /* Get the old register value */ + tmpreg1 = ADCx->SQR3; + /* Calculate the mask to clear */ + tmpreg2 = SQR3_SQ_Set << (5 * (Rank - 1)); + /* Clear the old SQx bits for the selected rank */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 1)); + /* Set the SQx bits for the selected rank */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SQR3 = tmpreg1; + } + /* For Rank 7 to 12 */ + else if (Rank < 13) + { + /* Get the old register value */ + tmpreg1 = ADCx->SQR2; + /* Calculate the mask to clear */ + tmpreg2 = SQR2_SQ_Set << (5 * (Rank - 7)); + /* Clear the old SQx bits for the selected rank */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 7)); + /* Set the SQx bits for the selected rank */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SQR2 = tmpreg1; + } + /* For Rank 13 to 16 */ + else + { + /* Get the old register value */ + tmpreg1 = ADCx->SQR1; + /* Calculate the mask to clear */ + tmpreg2 = SQR1_SQ_Set << (5 * (Rank - 13)); + /* Clear the old SQx bits for the selected rank */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 13)); + /* Set the SQx bits for the selected rank */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SQR1 = tmpreg1; + } +} + +/** + * @brief Enables or disables the ADCx conversion through external trigger. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC external trigger start of conversion. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC conversion on external event */ + ADCx->CR2 |= CR2_EXTTRIG_Set; + } + else + { + /* Disable the selected ADC conversion on external event */ + ADCx->CR2 &= CR2_EXTTRIG_Reset; + } +} + +/** + * @brief Returns the last ADCx conversion result data for regular channel. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval The Data conversion value. + */ +uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Return the selected ADC conversion value */ + return (uint16_t) ADCx->DR; +} + +/** + * @brief Returns the last ADC1 and ADC2 conversion result data in dual mode. + * @retval The Data conversion value. + */ +uint32_t ADC_GetDualModeConversionValue(void) +{ + /* Return the dual mode conversion value */ + return (*(__IO uint32_t *) DR_ADDRESS); +} + +/** + * @brief Enables or disables the selected ADC automatic injected group + * conversion after regular one. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC auto injected conversion + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC automatic injected group conversion */ + ADCx->CR1 |= CR1_JAUTO_Set; + } + else + { + /* Disable the selected ADC automatic injected group conversion */ + ADCx->CR1 &= CR1_JAUTO_Reset; + } +} + +/** + * @brief Enables or disables the discontinuous mode for injected group + * channel for the specified ADC + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC discontinuous mode + * on injected group channel. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC injected discontinuous mode */ + ADCx->CR1 |= CR1_JDISCEN_Set; + } + else + { + /* Disable the selected ADC injected discontinuous mode */ + ADCx->CR1 &= CR1_JDISCEN_Reset; + } +} + +/** + * @brief Configures the ADCx external trigger for injected channels conversion. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_ExternalTrigInjecConv: specifies the ADC trigger to start injected conversion. + * This parameter can be one of the following values: + * @arg ADC_ExternalTrigInjecConv_T1_TRGO: Timer1 TRGO event selected (for ADC1, ADC2 and ADC3) + * @arg ADC_ExternalTrigInjecConv_T1_CC4: Timer1 capture compare4 selected (for ADC1, ADC2 and ADC3) + * @arg ADC_ExternalTrigInjecConv_T2_TRGO: Timer2 TRGO event selected (for ADC1 and ADC2) + * @arg ADC_ExternalTrigInjecConv_T2_CC1: Timer2 capture compare1 selected (for ADC1 and ADC2) + * @arg ADC_ExternalTrigInjecConv_T3_CC4: Timer3 capture compare4 selected (for ADC1 and ADC2) + * @arg ADC_ExternalTrigInjecConv_T4_TRGO: Timer4 TRGO event selected (for ADC1 and ADC2) + * @arg ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4: External interrupt line 15 or Timer8 + * capture compare4 event selected (for ADC1 and ADC2) + * @arg ADC_ExternalTrigInjecConv_T4_CC3: Timer4 capture compare3 selected (for ADC3 only) + * @arg ADC_ExternalTrigInjecConv_T8_CC2: Timer8 capture compare2 selected (for ADC3 only) + * @arg ADC_ExternalTrigInjecConv_T8_CC4: Timer8 capture compare4 selected (for ADC3 only) + * @arg ADC_ExternalTrigInjecConv_T5_TRGO: Timer5 TRGO event selected (for ADC3 only) + * @arg ADC_ExternalTrigInjecConv_T5_CC4: Timer5 capture compare4 selected (for ADC3 only) + * @arg ADC_ExternalTrigInjecConv_None: Injected conversion started by software and not + * by external trigger (for ADC1, ADC2 and ADC3) + * @retval None + */ +void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_ExternalTrigInjecConv) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv)); + /* Get the old register value */ + tmpreg = ADCx->CR2; + /* Clear the old external event selection for injected group */ + tmpreg &= CR2_JEXTSEL_Reset; + /* Set the external event selection for injected group */ + tmpreg |= ADC_ExternalTrigInjecConv; + /* Store the new register value */ + ADCx->CR2 = tmpreg; +} + +/** + * @brief Enables or disables the ADCx injected channels conversion through + * external trigger + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC external trigger start of + * injected conversion. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC external event selection for injected group */ + ADCx->CR2 |= CR2_JEXTTRIG_Set; + } + else + { + /* Disable the selected ADC external event selection for injected group */ + ADCx->CR2 &= CR2_JEXTTRIG_Reset; + } +} + +/** + * @brief Enables or disables the selected ADC start of the injected + * channels conversion. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param NewState: new state of the selected ADC software start injected conversion. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected ADC conversion for injected group on external event and start the selected + ADC injected conversion */ + ADCx->CR2 |= CR2_JEXTTRIG_JSWSTART_Set; + } + else + { + /* Disable the selected ADC conversion on external event for injected group and stop the selected + ADC injected conversion */ + ADCx->CR2 &= CR2_JEXTTRIG_JSWSTART_Reset; + } +} + +/** + * @brief Gets the selected ADC Software start injected conversion Status. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @retval The new state of ADC software start injected conversion (SET or RESET). + */ +FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + /* Check the status of JSWSTART bit */ + if ((ADCx->CR2 & CR2_JSWSTART_Set) != (uint32_t)RESET) + { + /* JSWSTART bit is set */ + bitstatus = SET; + } + else + { + /* JSWSTART bit is reset */ + bitstatus = RESET; + } + /* Return the JSWSTART bit status */ + return bitstatus; +} + +/** + * @brief Configures for the selected ADC injected channel its corresponding + * rank in the sequencer and its sample time. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_Channel: the ADC channel to configure. + * This parameter can be one of the following values: + * @arg ADC_Channel_0: ADC Channel0 selected + * @arg ADC_Channel_1: ADC Channel1 selected + * @arg ADC_Channel_2: ADC Channel2 selected + * @arg ADC_Channel_3: ADC Channel3 selected + * @arg ADC_Channel_4: ADC Channel4 selected + * @arg ADC_Channel_5: ADC Channel5 selected + * @arg ADC_Channel_6: ADC Channel6 selected + * @arg ADC_Channel_7: ADC Channel7 selected + * @arg ADC_Channel_8: ADC Channel8 selected + * @arg ADC_Channel_9: ADC Channel9 selected + * @arg ADC_Channel_10: ADC Channel10 selected + * @arg ADC_Channel_11: ADC Channel11 selected + * @arg ADC_Channel_12: ADC Channel12 selected + * @arg ADC_Channel_13: ADC Channel13 selected + * @arg ADC_Channel_14: ADC Channel14 selected + * @arg ADC_Channel_15: ADC Channel15 selected + * @arg ADC_Channel_16: ADC Channel16 selected + * @arg ADC_Channel_17: ADC Channel17 selected + * @param Rank: The rank in the injected group sequencer. This parameter must be between 1 and 4. + * @param ADC_SampleTime: The sample time value to be set for the selected channel. + * This parameter can be one of the following values: + * @arg ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles + * @arg ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles + * @arg ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles + * @arg ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles + * @arg ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles + * @arg ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles + * @arg ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles + * @arg ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles + * @retval None + */ +void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime) +{ + uint32_t tmpreg1 = 0, tmpreg2 = 0, tmpreg3 = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_CHANNEL(ADC_Channel)); + assert_param(IS_ADC_INJECTED_RANK(Rank)); + assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); + /* if ADC_Channel_10 ... ADC_Channel_17 is selected */ + if (ADC_Channel > ADC_Channel_9) + { + /* Get the old register value */ + tmpreg1 = ADCx->SMPR1; + /* Calculate the mask to clear */ + tmpreg2 = SMPR1_SMP_Set << (3*(ADC_Channel - 10)); + /* Clear the old channel sample time */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_SampleTime << (3*(ADC_Channel - 10)); + /* Set the new channel sample time */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SMPR1 = tmpreg1; + } + else /* ADC_Channel include in ADC_Channel_[0..9] */ + { + /* Get the old register value */ + tmpreg1 = ADCx->SMPR2; + /* Calculate the mask to clear */ + tmpreg2 = SMPR2_SMP_Set << (3 * ADC_Channel); + /* Clear the old channel sample time */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set */ + tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); + /* Set the new channel sample time */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->SMPR2 = tmpreg1; + } + /* Rank configuration */ + /* Get the old register value */ + tmpreg1 = ADCx->JSQR; + /* Get JL value: Number = JL+1 */ + tmpreg3 = (tmpreg1 & JSQR_JL_Set)>> 20; + /* Calculate the mask to clear: ((Rank-1)+(4-JL-1)) */ + tmpreg2 = JSQR_JSQ_Set << (5 * (uint8_t)((Rank + 3) - (tmpreg3 + 1))); + /* Clear the old JSQx bits for the selected rank */ + tmpreg1 &= ~tmpreg2; + /* Calculate the mask to set: ((Rank-1)+(4-JL-1)) */ + tmpreg2 = (uint32_t)ADC_Channel << (5 * (uint8_t)((Rank + 3) - (tmpreg3 + 1))); + /* Set the JSQx bits for the selected rank */ + tmpreg1 |= tmpreg2; + /* Store the new register value */ + ADCx->JSQR = tmpreg1; +} + +/** + * @brief Configures the sequencer length for injected channels + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param Length: The sequencer length. + * This parameter must be a number between 1 to 4. + * @retval None + */ +void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length) +{ + uint32_t tmpreg1 = 0; + uint32_t tmpreg2 = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_INJECTED_LENGTH(Length)); + + /* Get the old register value */ + tmpreg1 = ADCx->JSQR; + /* Clear the old injected sequnence lenght JL bits */ + tmpreg1 &= JSQR_JL_Reset; + /* Set the injected sequnence lenght JL bits */ + tmpreg2 = Length - 1; + tmpreg1 |= tmpreg2 << 20; + /* Store the new register value */ + ADCx->JSQR = tmpreg1; +} + +/** + * @brief Set the injected channels conversion value offset + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_InjectedChannel: the ADC injected channel to set its offset. + * This parameter can be one of the following values: + * @arg ADC_InjectedChannel_1: Injected Channel1 selected + * @arg ADC_InjectedChannel_2: Injected Channel2 selected + * @arg ADC_InjectedChannel_3: Injected Channel3 selected + * @arg ADC_InjectedChannel_4: Injected Channel4 selected + * @param Offset: the offset value for the selected ADC injected channel + * This parameter must be a 12bit value. + * @retval None + */ +void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel)); + assert_param(IS_ADC_OFFSET(Offset)); + + tmp = (uint32_t)ADCx; + tmp += ADC_InjectedChannel; + + /* Set the selected injected channel data offset */ + *(__IO uint32_t *) tmp = (uint32_t)Offset; +} + +/** + * @brief Returns the ADC injected channel conversion result + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_InjectedChannel: the converted ADC injected channel. + * This parameter can be one of the following values: + * @arg ADC_InjectedChannel_1: Injected Channel1 selected + * @arg ADC_InjectedChannel_2: Injected Channel2 selected + * @arg ADC_InjectedChannel_3: Injected Channel3 selected + * @arg ADC_InjectedChannel_4: Injected Channel4 selected + * @retval The Data conversion value. + */ +uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel)); + + tmp = (uint32_t)ADCx; + tmp += ADC_InjectedChannel + JDR_Offset; + + /* Returns the selected injected channel conversion data value */ + return (uint16_t) (*(__IO uint32_t*) tmp); +} + +/** + * @brief Enables or disables the analog watchdog on single/all regular + * or injected channels + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_AnalogWatchdog: the ADC analog watchdog configuration. + * This parameter can be one of the following values: + * @arg ADC_AnalogWatchdog_SingleRegEnable: Analog watchdog on a single regular channel + * @arg ADC_AnalogWatchdog_SingleInjecEnable: Analog watchdog on a single injected channel + * @arg ADC_AnalogWatchdog_SingleRegOrInjecEnable: Analog watchdog on a single regular or injected channel + * @arg ADC_AnalogWatchdog_AllRegEnable: Analog watchdog on all regular channel + * @arg ADC_AnalogWatchdog_AllInjecEnable: Analog watchdog on all injected channel + * @arg ADC_AnalogWatchdog_AllRegAllInjecEnable: Analog watchdog on all regular and injected channels + * @arg ADC_AnalogWatchdog_None: No channel guarded by the analog watchdog + * @retval None + */ +void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_ANALOG_WATCHDOG(ADC_AnalogWatchdog)); + /* Get the old register value */ + tmpreg = ADCx->CR1; + /* Clear AWDEN, AWDENJ and AWDSGL bits */ + tmpreg &= CR1_AWDMode_Reset; + /* Set the analog watchdog enable mode */ + tmpreg |= ADC_AnalogWatchdog; + /* Store the new register value */ + ADCx->CR1 = tmpreg; +} + +/** + * @brief Configures the high and low thresholds of the analog watchdog. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param HighThreshold: the ADC analog watchdog High threshold value. + * This parameter must be a 12bit value. + * @param LowThreshold: the ADC analog watchdog Low threshold value. + * This parameter must be a 12bit value. + * @retval None + */ +void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold, + uint16_t LowThreshold) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_THRESHOLD(HighThreshold)); + assert_param(IS_ADC_THRESHOLD(LowThreshold)); + /* Set the ADCx high threshold */ + ADCx->HTR = HighThreshold; + /* Set the ADCx low threshold */ + ADCx->LTR = LowThreshold; +} + +/** + * @brief Configures the analog watchdog guarded single channel + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_Channel: the ADC channel to configure for the analog watchdog. + * This parameter can be one of the following values: + * @arg ADC_Channel_0: ADC Channel0 selected + * @arg ADC_Channel_1: ADC Channel1 selected + * @arg ADC_Channel_2: ADC Channel2 selected + * @arg ADC_Channel_3: ADC Channel3 selected + * @arg ADC_Channel_4: ADC Channel4 selected + * @arg ADC_Channel_5: ADC Channel5 selected + * @arg ADC_Channel_6: ADC Channel6 selected + * @arg ADC_Channel_7: ADC Channel7 selected + * @arg ADC_Channel_8: ADC Channel8 selected + * @arg ADC_Channel_9: ADC Channel9 selected + * @arg ADC_Channel_10: ADC Channel10 selected + * @arg ADC_Channel_11: ADC Channel11 selected + * @arg ADC_Channel_12: ADC Channel12 selected + * @arg ADC_Channel_13: ADC Channel13 selected + * @arg ADC_Channel_14: ADC Channel14 selected + * @arg ADC_Channel_15: ADC Channel15 selected + * @arg ADC_Channel_16: ADC Channel16 selected + * @arg ADC_Channel_17: ADC Channel17 selected + * @retval None + */ +void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_CHANNEL(ADC_Channel)); + /* Get the old register value */ + tmpreg = ADCx->CR1; + /* Clear the Analog watchdog channel select bits */ + tmpreg &= CR1_AWDCH_Reset; + /* Set the Analog watchdog channel */ + tmpreg |= ADC_Channel; + /* Store the new register value */ + ADCx->CR1 = tmpreg; +} + +/** + * @brief Enables or disables the temperature sensor and Vrefint channel. + * @param NewState: new state of the temperature sensor. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void ADC_TempSensorVrefintCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the temperature sensor and Vrefint channel*/ + ADC1->CR2 |= CR2_TSVREFE_Set; + } + else + { + /* Disable the temperature sensor and Vrefint channel*/ + ADC1->CR2 &= CR2_TSVREFE_Reset; + } +} + +/** + * @brief Checks whether the specified ADC flag is set or not. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg ADC_FLAG_AWD: Analog watchdog flag + * @arg ADC_FLAG_EOC: End of conversion flag + * @arg ADC_FLAG_JEOC: End of injected group conversion flag + * @arg ADC_FLAG_JSTRT: Start of injected group conversion flag + * @arg ADC_FLAG_STRT: Start of regular group conversion flag + * @retval The new state of ADC_FLAG (SET or RESET). + */ +FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_GET_FLAG(ADC_FLAG)); + /* Check the status of the specified ADC flag */ + if ((ADCx->SR & ADC_FLAG) != (uint8_t)RESET) + { + /* ADC_FLAG is set */ + bitstatus = SET; + } + else + { + /* ADC_FLAG is reset */ + bitstatus = RESET; + } + /* Return the ADC_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the ADCx's pending flags. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg ADC_FLAG_AWD: Analog watchdog flag + * @arg ADC_FLAG_EOC: End of conversion flag + * @arg ADC_FLAG_JEOC: End of injected group conversion flag + * @arg ADC_FLAG_JSTRT: Start of injected group conversion flag + * @arg ADC_FLAG_STRT: Start of regular group conversion flag + * @retval None + */ +void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_CLEAR_FLAG(ADC_FLAG)); + /* Clear the selected ADC flags */ + ADCx->SR = ~(uint32_t)ADC_FLAG; +} + +/** + * @brief Checks whether the specified ADC interrupt has occurred or not. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_IT: specifies the ADC interrupt source to check. + * This parameter can be one of the following values: + * @arg ADC_IT_EOC: End of conversion interrupt mask + * @arg ADC_IT_AWD: Analog watchdog interrupt mask + * @arg ADC_IT_JEOC: End of injected conversion interrupt mask + * @retval The new state of ADC_IT (SET or RESET). + */ +ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT) +{ + ITStatus bitstatus = RESET; + uint32_t itmask = 0, enablestatus = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_GET_IT(ADC_IT)); + /* Get the ADC IT index */ + itmask = ADC_IT >> 8; + /* Get the ADC_IT enable bit status */ + enablestatus = (ADCx->CR1 & (uint8_t)ADC_IT) ; + /* Check the status of the specified ADC interrupt */ + if (((ADCx->SR & itmask) != (uint32_t)RESET) && enablestatus) + { + /* ADC_IT is set */ + bitstatus = SET; + } + else + { + /* ADC_IT is reset */ + bitstatus = RESET; + } + /* Return the ADC_IT status */ + return bitstatus; +} + +/** + * @brief Clears the ADCx's interrupt pending bits. + * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral. + * @param ADC_IT: specifies the ADC interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg ADC_IT_EOC: End of conversion interrupt mask + * @arg ADC_IT_AWD: Analog watchdog interrupt mask + * @arg ADC_IT_JEOC: End of injected conversion interrupt mask + * @retval None + */ +void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT) +{ + uint8_t itmask = 0; + /* Check the parameters */ + assert_param(IS_ADC_ALL_PERIPH(ADCx)); + assert_param(IS_ADC_IT(ADC_IT)); + /* Get the ADC IT index */ + itmask = (uint8_t)(ADC_IT >> 8); + /* Clear the selected ADC interrupt pending bits */ + ADCx->SR = ~(uint32_t)itmask; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c new file mode 100644 index 0000000..26f36dc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c @@ -0,0 +1,306 @@ +/** + ****************************************************************************** + * @file stm32f10x_bkp.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the BKP firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_bkp.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup BKP + * @brief BKP driver modules + * @{ + */ + +/** @defgroup BKP_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Private_Defines + * @{ + */ + +/* ------------ BKP registers bit address in the alias region --------------- */ +#define BKP_OFFSET (BKP_BASE - PERIPH_BASE) + +/* --- CR Register ----*/ + +/* Alias word address of TPAL bit */ +#define CR_OFFSET (BKP_OFFSET + 0x30) +#define TPAL_BitNumber 0x01 +#define CR_TPAL_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPAL_BitNumber * 4)) + +/* Alias word address of TPE bit */ +#define TPE_BitNumber 0x00 +#define CR_TPE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPE_BitNumber * 4)) + +/* --- CSR Register ---*/ + +/* Alias word address of TPIE bit */ +#define CSR_OFFSET (BKP_OFFSET + 0x34) +#define TPIE_BitNumber 0x02 +#define CSR_TPIE_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TPIE_BitNumber * 4)) + +/* Alias word address of TIF bit */ +#define TIF_BitNumber 0x09 +#define CSR_TIF_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TIF_BitNumber * 4)) + +/* Alias word address of TEF bit */ +#define TEF_BitNumber 0x08 +#define CSR_TEF_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TEF_BitNumber * 4)) + +/* ---------------------- BKP registers bit mask ------------------------ */ + +/* RTCCR register bit mask */ +#define RTCCR_CAL_MASK ((uint16_t)0xFF80) +#define RTCCR_MASK ((uint16_t)0xFC7F) + +/** + * @} + */ + + +/** @defgroup BKP_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup BKP_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the BKP peripheral registers to their default reset values. + * @param None + * @retval None + */ +void BKP_DeInit(void) +{ + RCC_BackupResetCmd(ENABLE); + RCC_BackupResetCmd(DISABLE); +} + +/** + * @brief Configures the Tamper Pin active level. + * @param BKP_TamperPinLevel: specifies the Tamper Pin active level. + * This parameter can be one of the following values: + * @arg BKP_TamperPinLevel_High: Tamper pin active on high level + * @arg BKP_TamperPinLevel_Low: Tamper pin active on low level + * @retval None + */ +void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel) +{ + /* Check the parameters */ + assert_param(IS_BKP_TAMPER_PIN_LEVEL(BKP_TamperPinLevel)); + *(__IO uint32_t *) CR_TPAL_BB = BKP_TamperPinLevel; +} + +/** + * @brief Enables or disables the Tamper Pin activation. + * @param NewState: new state of the Tamper Pin activation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void BKP_TamperPinCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CR_TPE_BB = (uint32_t)NewState; +} + +/** + * @brief Enables or disables the Tamper Pin Interrupt. + * @param NewState: new state of the Tamper Pin Interrupt. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void BKP_ITConfig(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CSR_TPIE_BB = (uint32_t)NewState; +} + +/** + * @brief Select the RTC output source to output on the Tamper pin. + * @param BKP_RTCOutputSource: specifies the RTC output source. + * This parameter can be one of the following values: + * @arg BKP_RTCOutputSource_None: no RTC output on the Tamper pin. + * @arg BKP_RTCOutputSource_CalibClock: output the RTC clock with frequency + * divided by 64 on the Tamper pin. + * @arg BKP_RTCOutputSource_Alarm: output the RTC Alarm pulse signal on + * the Tamper pin. + * @arg BKP_RTCOutputSource_Second: output the RTC Second pulse signal on + * the Tamper pin. + * @retval None + */ +void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource) +{ + uint16_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_BKP_RTC_OUTPUT_SOURCE(BKP_RTCOutputSource)); + tmpreg = BKP->RTCCR; + /* Clear CCO, ASOE and ASOS bits */ + tmpreg &= RTCCR_MASK; + + /* Set CCO, ASOE and ASOS bits according to BKP_RTCOutputSource value */ + tmpreg |= BKP_RTCOutputSource; + /* Store the new value */ + BKP->RTCCR = tmpreg; +} + +/** + * @brief Sets RTC Clock Calibration value. + * @param CalibrationValue: specifies the RTC Clock Calibration value. + * This parameter must be a number between 0 and 0x7F. + * @retval None + */ +void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue) +{ + uint16_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_BKP_CALIBRATION_VALUE(CalibrationValue)); + tmpreg = BKP->RTCCR; + /* Clear CAL[6:0] bits */ + tmpreg &= RTCCR_CAL_MASK; + /* Set CAL[6:0] bits according to CalibrationValue value */ + tmpreg |= CalibrationValue; + /* Store the new value */ + BKP->RTCCR = tmpreg; +} + +/** + * @brief Writes user data to the specified Data Backup Register. + * @param BKP_DR: specifies the Data Backup Register. + * This parameter can be BKP_DRx where x:[1, 42] + * @param Data: data to write + * @retval None + */ +void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_BKP_DR(BKP_DR)); + + tmp = (uint32_t)BKP_BASE; + tmp += BKP_DR; + + *(__IO uint32_t *) tmp = Data; +} + +/** + * @brief Reads data from the specified Data Backup Register. + * @param BKP_DR: specifies the Data Backup Register. + * This parameter can be BKP_DRx where x:[1, 42] + * @retval The content of the specified Data Backup Register + */ +uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_BKP_DR(BKP_DR)); + + tmp = (uint32_t)BKP_BASE; + tmp += BKP_DR; + + return (*(__IO uint16_t *) tmp); +} + +/** + * @brief Checks whether the Tamper Pin Event flag is set or not. + * @param None + * @retval The new state of the Tamper Pin Event flag (SET or RESET). + */ +FlagStatus BKP_GetFlagStatus(void) +{ + return (FlagStatus)(*(__IO uint32_t *) CSR_TEF_BB); +} + +/** + * @brief Clears Tamper Pin Event pending flag. + * @param None + * @retval None + */ +void BKP_ClearFlag(void) +{ + /* Set CTE bit to clear Tamper Pin Event flag */ + BKP->CSR |= BKP_CSR_CTE; +} + +/** + * @brief Checks whether the Tamper Pin Interrupt has occurred or not. + * @param None + * @retval The new state of the Tamper Pin Interrupt (SET or RESET). + */ +ITStatus BKP_GetITStatus(void) +{ + return (ITStatus)(*(__IO uint32_t *) CSR_TIF_BB); +} + +/** + * @brief Clears Tamper Pin Interrupt pending bit. + * @param None + * @retval None + */ +void BKP_ClearITPendingBit(void) +{ + /* Set CTI bit to clear Tamper Pin Interrupt pending bit */ + BKP->CSR |= BKP_CSR_CTI; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c new file mode 100644 index 0000000..a65561a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c @@ -0,0 +1,1413 @@ +/** + ****************************************************************************** + * @file stm32f10x_can.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the CAN firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_can.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup CAN + * @brief CAN driver modules + * @{ + */ + +/** @defgroup CAN_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup CAN_Private_Defines + * @{ + */ + +/* CAN Master Control Register bits */ + +#define MCR_DBF ((uint32_t)0x00010000) /* software master reset */ + +/* CAN Mailbox Transmit Request */ +#define TMIDxR_TXRQ ((uint32_t)0x00000001) /* Transmit mailbox request */ + +/* CAN Filter Master Register bits */ +#define FMR_FINIT ((uint32_t)0x00000001) /* Filter init mode */ + +/* Time out for INAK bit */ +#define INAK_TIMEOUT ((uint32_t)0x0000FFFF) +/* Time out for SLAK bit */ +#define SLAK_TIMEOUT ((uint32_t)0x0000FFFF) + + + +/* Flags in TSR register */ +#define CAN_FLAGS_TSR ((uint32_t)0x08000000) +/* Flags in RF1R register */ +#define CAN_FLAGS_RF1R ((uint32_t)0x04000000) +/* Flags in RF0R register */ +#define CAN_FLAGS_RF0R ((uint32_t)0x02000000) +/* Flags in MSR register */ +#define CAN_FLAGS_MSR ((uint32_t)0x01000000) +/* Flags in ESR register */ +#define CAN_FLAGS_ESR ((uint32_t)0x00F00000) + +/* Mailboxes definition */ +#define CAN_TXMAILBOX_0 ((uint8_t)0x00) +#define CAN_TXMAILBOX_1 ((uint8_t)0x01) +#define CAN_TXMAILBOX_2 ((uint8_t)0x02) + + + +#define CAN_MODE_MASK ((uint32_t) 0x00000003) +/** + * @} + */ + +/** @defgroup CAN_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup CAN_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup CAN_Private_FunctionPrototypes + * @{ + */ + +static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit); + +/** + * @} + */ + +/** @defgroup CAN_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the CAN peripheral registers to their default reset values. + * @param CANx: where x can be 1 or 2 to select the CAN peripheral. + * @retval None. + */ +void CAN_DeInit(CAN_TypeDef* CANx) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + if (CANx == CAN1) + { + /* Enable CAN1 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, ENABLE); + /* Release CAN1 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, DISABLE); + } + else + { + /* Enable CAN2 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, ENABLE); + /* Release CAN2 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, DISABLE); + } +} + +/** + * @brief Initializes the CAN peripheral according to the specified + * parameters in the CAN_InitStruct. + * @param CANx: where x can be 1 or 2 to to select the CAN + * peripheral. + * @param CAN_InitStruct: pointer to a CAN_InitTypeDef structure that + * contains the configuration information for the + * CAN peripheral. + * @retval Constant indicates initialization succeed which will be + * CAN_InitStatus_Failed or CAN_InitStatus_Success. + */ +uint8_t CAN_Init(CAN_TypeDef* CANx, CAN_InitTypeDef* CAN_InitStruct) +{ + uint8_t InitStatus = CAN_InitStatus_Failed; + uint32_t wait_ack = 0x00000000; + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_TTCM)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_ABOM)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_AWUM)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_NART)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_RFLM)); + assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_TXFP)); + assert_param(IS_CAN_MODE(CAN_InitStruct->CAN_Mode)); + assert_param(IS_CAN_SJW(CAN_InitStruct->CAN_SJW)); + assert_param(IS_CAN_BS1(CAN_InitStruct->CAN_BS1)); + assert_param(IS_CAN_BS2(CAN_InitStruct->CAN_BS2)); + assert_param(IS_CAN_PRESCALER(CAN_InitStruct->CAN_Prescaler)); + + /* Exit from sleep mode */ + CANx->MCR &= (~(uint32_t)CAN_MCR_SLEEP); + + /* Request initialisation */ + CANx->MCR |= CAN_MCR_INRQ ; + + /* Wait the acknowledge */ + while (((CANx->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) && (wait_ack != INAK_TIMEOUT)) + { + wait_ack++; + } + + /* Check acknowledge */ + if ((CANx->MSR & CAN_MSR_INAK) != CAN_MSR_INAK) + { + InitStatus = CAN_InitStatus_Failed; + } + else + { + /* Set the time triggered communication mode */ + if (CAN_InitStruct->CAN_TTCM == ENABLE) + { + CANx->MCR |= CAN_MCR_TTCM; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_TTCM; + } + + /* Set the automatic bus-off management */ + if (CAN_InitStruct->CAN_ABOM == ENABLE) + { + CANx->MCR |= CAN_MCR_ABOM; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_ABOM; + } + + /* Set the automatic wake-up mode */ + if (CAN_InitStruct->CAN_AWUM == ENABLE) + { + CANx->MCR |= CAN_MCR_AWUM; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_AWUM; + } + + /* Set the no automatic retransmission */ + if (CAN_InitStruct->CAN_NART == ENABLE) + { + CANx->MCR |= CAN_MCR_NART; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_NART; + } + + /* Set the receive FIFO locked mode */ + if (CAN_InitStruct->CAN_RFLM == ENABLE) + { + CANx->MCR |= CAN_MCR_RFLM; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_RFLM; + } + + /* Set the transmit FIFO priority */ + if (CAN_InitStruct->CAN_TXFP == ENABLE) + { + CANx->MCR |= CAN_MCR_TXFP; + } + else + { + CANx->MCR &= ~(uint32_t)CAN_MCR_TXFP; + } + + /* Set the bit timing register */ + CANx->BTR = (uint32_t)((uint32_t)CAN_InitStruct->CAN_Mode << 30) | \ + ((uint32_t)CAN_InitStruct->CAN_SJW << 24) | \ + ((uint32_t)CAN_InitStruct->CAN_BS1 << 16) | \ + ((uint32_t)CAN_InitStruct->CAN_BS2 << 20) | \ + ((uint32_t)CAN_InitStruct->CAN_Prescaler - 1); + + /* Request leave initialisation */ + CANx->MCR &= ~(uint32_t)CAN_MCR_INRQ; + + /* Wait the acknowledge */ + wait_ack = 0; + + while (((CANx->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) && (wait_ack != INAK_TIMEOUT)) + { + wait_ack++; + } + + /* ...and check acknowledged */ + if ((CANx->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) + { + InitStatus = CAN_InitStatus_Failed; + } + else + { + InitStatus = CAN_InitStatus_Success ; + } + } + + /* At this step, return the status of initialization */ + return InitStatus; +} + +/** + * @brief Initializes the CAN peripheral according to the specified + * parameters in the CAN_FilterInitStruct. + * @param CAN_FilterInitStruct: pointer to a CAN_FilterInitTypeDef + * structure that contains the configuration + * information. + * @retval None. + */ +void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct) +{ + uint32_t filter_number_bit_pos = 0; + /* Check the parameters */ + assert_param(IS_CAN_FILTER_NUMBER(CAN_FilterInitStruct->CAN_FilterNumber)); + assert_param(IS_CAN_FILTER_MODE(CAN_FilterInitStruct->CAN_FilterMode)); + assert_param(IS_CAN_FILTER_SCALE(CAN_FilterInitStruct->CAN_FilterScale)); + assert_param(IS_CAN_FILTER_FIFO(CAN_FilterInitStruct->CAN_FilterFIFOAssignment)); + assert_param(IS_FUNCTIONAL_STATE(CAN_FilterInitStruct->CAN_FilterActivation)); + + filter_number_bit_pos = ((uint32_t)1) << CAN_FilterInitStruct->CAN_FilterNumber; + + /* Initialisation mode for the filter */ + CAN1->FMR |= FMR_FINIT; + + /* Filter Deactivation */ + CAN1->FA1R &= ~(uint32_t)filter_number_bit_pos; + + /* Filter Scale */ + if (CAN_FilterInitStruct->CAN_FilterScale == CAN_FilterScale_16bit) + { + /* 16-bit scale for the filter */ + CAN1->FS1R &= ~(uint32_t)filter_number_bit_pos; + + /* First 16-bit identifier and First 16-bit mask */ + /* Or First 16-bit identifier and Second 16-bit identifier */ + CAN1->sFilterRegister[CAN_FilterInitStruct->CAN_FilterNumber].FR1 = + ((0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterMaskIdLow) << 16) | + (0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterIdLow); + + /* Second 16-bit identifier and Second 16-bit mask */ + /* Or Third 16-bit identifier and Fourth 16-bit identifier */ + CAN1->sFilterRegister[CAN_FilterInitStruct->CAN_FilterNumber].FR2 = + ((0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterMaskIdHigh) << 16) | + (0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterIdHigh); + } + + if (CAN_FilterInitStruct->CAN_FilterScale == CAN_FilterScale_32bit) + { + /* 32-bit scale for the filter */ + CAN1->FS1R |= filter_number_bit_pos; + /* 32-bit identifier or First 32-bit identifier */ + CAN1->sFilterRegister[CAN_FilterInitStruct->CAN_FilterNumber].FR1 = + ((0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterIdHigh) << 16) | + (0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterIdLow); + /* 32-bit mask or Second 32-bit identifier */ + CAN1->sFilterRegister[CAN_FilterInitStruct->CAN_FilterNumber].FR2 = + ((0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterMaskIdHigh) << 16) | + (0x0000FFFF & (uint32_t)CAN_FilterInitStruct->CAN_FilterMaskIdLow); + } + + /* Filter Mode */ + if (CAN_FilterInitStruct->CAN_FilterMode == CAN_FilterMode_IdMask) + { + /*Id/Mask mode for the filter*/ + CAN1->FM1R &= ~(uint32_t)filter_number_bit_pos; + } + else /* CAN_FilterInitStruct->CAN_FilterMode == CAN_FilterMode_IdList */ + { + /*Identifier list mode for the filter*/ + CAN1->FM1R |= (uint32_t)filter_number_bit_pos; + } + + /* Filter FIFO assignment */ + if (CAN_FilterInitStruct->CAN_FilterFIFOAssignment == CAN_Filter_FIFO0) + { + /* FIFO 0 assignation for the filter */ + CAN1->FFA1R &= ~(uint32_t)filter_number_bit_pos; + } + + if (CAN_FilterInitStruct->CAN_FilterFIFOAssignment == CAN_Filter_FIFO1) + { + /* FIFO 1 assignation for the filter */ + CAN1->FFA1R |= (uint32_t)filter_number_bit_pos; + } + + /* Filter activation */ + if (CAN_FilterInitStruct->CAN_FilterActivation == ENABLE) + { + CAN1->FA1R |= filter_number_bit_pos; + } + + /* Leave the initialisation mode for the filter */ + CAN1->FMR &= ~FMR_FINIT; +} + +/** + * @brief Fills each CAN_InitStruct member with its default value. + * @param CAN_InitStruct: pointer to a CAN_InitTypeDef structure which + * will be initialized. + * @retval None. + */ +void CAN_StructInit(CAN_InitTypeDef* CAN_InitStruct) +{ + /* Reset CAN init structure parameters values */ + + /* Initialize the time triggered communication mode */ + CAN_InitStruct->CAN_TTCM = DISABLE; + + /* Initialize the automatic bus-off management */ + CAN_InitStruct->CAN_ABOM = DISABLE; + + /* Initialize the automatic wake-up mode */ + CAN_InitStruct->CAN_AWUM = DISABLE; + + /* Initialize the no automatic retransmission */ + CAN_InitStruct->CAN_NART = DISABLE; + + /* Initialize the receive FIFO locked mode */ + CAN_InitStruct->CAN_RFLM = DISABLE; + + /* Initialize the transmit FIFO priority */ + CAN_InitStruct->CAN_TXFP = DISABLE; + + /* Initialize the CAN_Mode member */ + CAN_InitStruct->CAN_Mode = CAN_Mode_Normal; + + /* Initialize the CAN_SJW member */ + CAN_InitStruct->CAN_SJW = CAN_SJW_1tq; + + /* Initialize the CAN_BS1 member */ + CAN_InitStruct->CAN_BS1 = CAN_BS1_4tq; + + /* Initialize the CAN_BS2 member */ + CAN_InitStruct->CAN_BS2 = CAN_BS2_3tq; + + /* Initialize the CAN_Prescaler member */ + CAN_InitStruct->CAN_Prescaler = 1; +} + +/** + * @brief Select the start bank filter for slave CAN. + * @note This function applies only to STM32 Connectivity line devices. + * @param CAN_BankNumber: Select the start slave bank filter from 1..27. + * @retval None. + */ +void CAN_SlaveStartBank(uint8_t CAN_BankNumber) +{ + /* Check the parameters */ + assert_param(IS_CAN_BANKNUMBER(CAN_BankNumber)); + + /* Enter Initialisation mode for the filter */ + CAN1->FMR |= FMR_FINIT; + + /* Select the start slave bank */ + CAN1->FMR &= (uint32_t)0xFFFFC0F1 ; + CAN1->FMR |= (uint32_t)(CAN_BankNumber)<<8; + + /* Leave Initialisation mode for the filter */ + CAN1->FMR &= ~FMR_FINIT; +} + +/** + * @brief Enables or disables the DBG Freeze for CAN. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param NewState: new state of the CAN peripheral. This parameter can + * be: ENABLE or DISABLE. + * @retval None. + */ +void CAN_DBGFreeze(CAN_TypeDef* CANx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable Debug Freeze */ + CANx->MCR |= MCR_DBF; + } + else + { + /* Disable Debug Freeze */ + CANx->MCR &= ~MCR_DBF; + } +} + + +/** + * @brief Enables or disabes the CAN Time TriggerOperation communication mode. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param NewState : Mode new state , can be one of @ref FunctionalState. + * @note when enabled, Time stamp (TIME[15:0]) value is sent in the last + * two data bytes of the 8-byte message: TIME[7:0] in data byte 6 + * and TIME[15:8] in data byte 7 + * @note DLC must be programmed as 8 in order Time Stamp (2 bytes) to be + * sent over the CAN bus. + * @retval None + */ +void CAN_TTComModeCmd(CAN_TypeDef* CANx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the TTCM mode */ + CANx->MCR |= CAN_MCR_TTCM; + + /* Set TGT bits */ + CANx->sTxMailBox[0].TDTR |= ((uint32_t)CAN_TDT0R_TGT); + CANx->sTxMailBox[1].TDTR |= ((uint32_t)CAN_TDT1R_TGT); + CANx->sTxMailBox[2].TDTR |= ((uint32_t)CAN_TDT2R_TGT); + } + else + { + /* Disable the TTCM mode */ + CANx->MCR &= (uint32_t)(~(uint32_t)CAN_MCR_TTCM); + + /* Reset TGT bits */ + CANx->sTxMailBox[0].TDTR &= ((uint32_t)~CAN_TDT0R_TGT); + CANx->sTxMailBox[1].TDTR &= ((uint32_t)~CAN_TDT1R_TGT); + CANx->sTxMailBox[2].TDTR &= ((uint32_t)~CAN_TDT2R_TGT); + } +} +/** + * @brief Initiates the transmission of a message. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param TxMessage: pointer to a structure which contains CAN Id, CAN + * DLC and CAN data. + * @retval The number of the mailbox that is used for transmission + * or CAN_TxStatus_NoMailBox if there is no empty mailbox. + */ +uint8_t CAN_Transmit(CAN_TypeDef* CANx, CanTxMsg* TxMessage) +{ + uint8_t transmit_mailbox = 0; + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_IDTYPE(TxMessage->IDE)); + assert_param(IS_CAN_RTR(TxMessage->RTR)); + assert_param(IS_CAN_DLC(TxMessage->DLC)); + + /* Select one empty transmit mailbox */ + if ((CANx->TSR&CAN_TSR_TME0) == CAN_TSR_TME0) + { + transmit_mailbox = 0; + } + else if ((CANx->TSR&CAN_TSR_TME1) == CAN_TSR_TME1) + { + transmit_mailbox = 1; + } + else if ((CANx->TSR&CAN_TSR_TME2) == CAN_TSR_TME2) + { + transmit_mailbox = 2; + } + else + { + transmit_mailbox = CAN_TxStatus_NoMailBox; + } + + if (transmit_mailbox != CAN_TxStatus_NoMailBox) + { + /* Set up the Id */ + CANx->sTxMailBox[transmit_mailbox].TIR &= TMIDxR_TXRQ; + if (TxMessage->IDE == CAN_Id_Standard) + { + assert_param(IS_CAN_STDID(TxMessage->StdId)); + CANx->sTxMailBox[transmit_mailbox].TIR |= ((TxMessage->StdId << 21) | \ + TxMessage->RTR); + } + else + { + assert_param(IS_CAN_EXTID(TxMessage->ExtId)); + CANx->sTxMailBox[transmit_mailbox].TIR |= ((TxMessage->ExtId << 3) | \ + TxMessage->IDE | \ + TxMessage->RTR); + } + + /* Set up the DLC */ + TxMessage->DLC &= (uint8_t)0x0000000F; + CANx->sTxMailBox[transmit_mailbox].TDTR &= (uint32_t)0xFFFFFFF0; + CANx->sTxMailBox[transmit_mailbox].TDTR |= TxMessage->DLC; + + /* Set up the data field */ + CANx->sTxMailBox[transmit_mailbox].TDLR = (((uint32_t)TxMessage->Data[3] << 24) | + ((uint32_t)TxMessage->Data[2] << 16) | + ((uint32_t)TxMessage->Data[1] << 8) | + ((uint32_t)TxMessage->Data[0])); + CANx->sTxMailBox[transmit_mailbox].TDHR = (((uint32_t)TxMessage->Data[7] << 24) | + ((uint32_t)TxMessage->Data[6] << 16) | + ((uint32_t)TxMessage->Data[5] << 8) | + ((uint32_t)TxMessage->Data[4])); + /* Request transmission */ + CANx->sTxMailBox[transmit_mailbox].TIR |= TMIDxR_TXRQ; + } + return transmit_mailbox; +} + +/** + * @brief Checks the transmission of a message. + * @param CANx: where x can be 1 or 2 to to select the + * CAN peripheral. + * @param TransmitMailbox: the number of the mailbox that is used for + * transmission. + * @retval CAN_TxStatus_Ok if the CAN driver transmits the message, CAN_TxStatus_Failed + * in an other case. + */ +uint8_t CAN_TransmitStatus(CAN_TypeDef* CANx, uint8_t TransmitMailbox) +{ + uint32_t state = 0; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_TRANSMITMAILBOX(TransmitMailbox)); + + switch (TransmitMailbox) + { + case (CAN_TXMAILBOX_0): + state = CANx->TSR & (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0); + break; + case (CAN_TXMAILBOX_1): + state = CANx->TSR & (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1); + break; + case (CAN_TXMAILBOX_2): + state = CANx->TSR & (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2); + break; + default: + state = CAN_TxStatus_Failed; + break; + } + switch (state) + { + /* transmit pending */ + case (0x0): state = CAN_TxStatus_Pending; + break; + /* transmit failed */ + case (CAN_TSR_RQCP0 | CAN_TSR_TME0): state = CAN_TxStatus_Failed; + break; + case (CAN_TSR_RQCP1 | CAN_TSR_TME1): state = CAN_TxStatus_Failed; + break; + case (CAN_TSR_RQCP2 | CAN_TSR_TME2): state = CAN_TxStatus_Failed; + break; + /* transmit succeeded */ + case (CAN_TSR_RQCP0 | CAN_TSR_TXOK0 | CAN_TSR_TME0):state = CAN_TxStatus_Ok; + break; + case (CAN_TSR_RQCP1 | CAN_TSR_TXOK1 | CAN_TSR_TME1):state = CAN_TxStatus_Ok; + break; + case (CAN_TSR_RQCP2 | CAN_TSR_TXOK2 | CAN_TSR_TME2):state = CAN_TxStatus_Ok; + break; + default: state = CAN_TxStatus_Failed; + break; + } + return (uint8_t) state; +} + +/** + * @brief Cancels a transmit request. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param Mailbox: Mailbox number. + * @retval None. + */ +void CAN_CancelTransmit(CAN_TypeDef* CANx, uint8_t Mailbox) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_TRANSMITMAILBOX(Mailbox)); + /* abort transmission */ + switch (Mailbox) + { + case (CAN_TXMAILBOX_0): CANx->TSR |= CAN_TSR_ABRQ0; + break; + case (CAN_TXMAILBOX_1): CANx->TSR |= CAN_TSR_ABRQ1; + break; + case (CAN_TXMAILBOX_2): CANx->TSR |= CAN_TSR_ABRQ2; + break; + default: + break; + } +} + + +/** + * @brief Receives a message. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param FIFONumber: Receive FIFO number, CAN_FIFO0 or CAN_FIFO1. + * @param RxMessage: pointer to a structure receive message which contains + * CAN Id, CAN DLC, CAN datas and FMI number. + * @retval None. + */ +void CAN_Receive(CAN_TypeDef* CANx, uint8_t FIFONumber, CanRxMsg* RxMessage) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_FIFO(FIFONumber)); + /* Get the Id */ + RxMessage->IDE = (uint8_t)0x04 & CANx->sFIFOMailBox[FIFONumber].RIR; + if (RxMessage->IDE == CAN_Id_Standard) + { + RxMessage->StdId = (uint32_t)0x000007FF & (CANx->sFIFOMailBox[FIFONumber].RIR >> 21); + } + else + { + RxMessage->ExtId = (uint32_t)0x1FFFFFFF & (CANx->sFIFOMailBox[FIFONumber].RIR >> 3); + } + + RxMessage->RTR = (uint8_t)0x02 & CANx->sFIFOMailBox[FIFONumber].RIR; + /* Get the DLC */ + RxMessage->DLC = (uint8_t)0x0F & CANx->sFIFOMailBox[FIFONumber].RDTR; + /* Get the FMI */ + RxMessage->FMI = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDTR >> 8); + /* Get the data field */ + RxMessage->Data[0] = (uint8_t)0xFF & CANx->sFIFOMailBox[FIFONumber].RDLR; + RxMessage->Data[1] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 8); + RxMessage->Data[2] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 16); + RxMessage->Data[3] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDLR >> 24); + RxMessage->Data[4] = (uint8_t)0xFF & CANx->sFIFOMailBox[FIFONumber].RDHR; + RxMessage->Data[5] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 8); + RxMessage->Data[6] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 16); + RxMessage->Data[7] = (uint8_t)0xFF & (CANx->sFIFOMailBox[FIFONumber].RDHR >> 24); + /* Release the FIFO */ + /* Release FIFO0 */ + if (FIFONumber == CAN_FIFO0) + { + CANx->RF0R |= CAN_RF0R_RFOM0; + } + /* Release FIFO1 */ + else /* FIFONumber == CAN_FIFO1 */ + { + CANx->RF1R |= CAN_RF1R_RFOM1; + } +} + +/** + * @brief Releases the specified FIFO. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param FIFONumber: FIFO to release, CAN_FIFO0 or CAN_FIFO1. + * @retval None. + */ +void CAN_FIFORelease(CAN_TypeDef* CANx, uint8_t FIFONumber) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_FIFO(FIFONumber)); + /* Release FIFO0 */ + if (FIFONumber == CAN_FIFO0) + { + CANx->RF0R |= CAN_RF0R_RFOM0; + } + /* Release FIFO1 */ + else /* FIFONumber == CAN_FIFO1 */ + { + CANx->RF1R |= CAN_RF1R_RFOM1; + } +} + +/** + * @brief Returns the number of pending messages. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param FIFONumber: Receive FIFO number, CAN_FIFO0 or CAN_FIFO1. + * @retval NbMessage : which is the number of pending message. + */ +uint8_t CAN_MessagePending(CAN_TypeDef* CANx, uint8_t FIFONumber) +{ + uint8_t message_pending=0; + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_FIFO(FIFONumber)); + if (FIFONumber == CAN_FIFO0) + { + message_pending = (uint8_t)(CANx->RF0R&(uint32_t)0x03); + } + else if (FIFONumber == CAN_FIFO1) + { + message_pending = (uint8_t)(CANx->RF1R&(uint32_t)0x03); + } + else + { + message_pending = 0; + } + return message_pending; +} + + +/** + * @brief Select the CAN Operation mode. + * @param CAN_OperatingMode : CAN Operating Mode. This parameter can be one + * of @ref CAN_OperatingMode_TypeDef enumeration. + * @retval status of the requested mode which can be + * - CAN_ModeStatus_Failed CAN failed entering the specific mode + * - CAN_ModeStatus_Success CAN Succeed entering the specific mode + + */ +uint8_t CAN_OperatingModeRequest(CAN_TypeDef* CANx, uint8_t CAN_OperatingMode) +{ + uint8_t status = CAN_ModeStatus_Failed; + + /* Timeout for INAK or also for SLAK bits*/ + uint32_t timeout = INAK_TIMEOUT; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_OPERATING_MODE(CAN_OperatingMode)); + + if (CAN_OperatingMode == CAN_OperatingMode_Initialization) + { + /* Request initialisation */ + CANx->MCR = (uint32_t)((CANx->MCR & (uint32_t)(~(uint32_t)CAN_MCR_SLEEP)) | CAN_MCR_INRQ); + + /* Wait the acknowledge */ + while (((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_INAK) && (timeout != 0)) + { + timeout--; + } + if ((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_INAK) + { + status = CAN_ModeStatus_Failed; + } + else + { + status = CAN_ModeStatus_Success; + } + } + else if (CAN_OperatingMode == CAN_OperatingMode_Normal) + { + /* Request leave initialisation and sleep mode and enter Normal mode */ + CANx->MCR &= (uint32_t)(~(CAN_MCR_SLEEP|CAN_MCR_INRQ)); + + /* Wait the acknowledge */ + while (((CANx->MSR & CAN_MODE_MASK) != 0) && (timeout!=0)) + { + timeout--; + } + if ((CANx->MSR & CAN_MODE_MASK) != 0) + { + status = CAN_ModeStatus_Failed; + } + else + { + status = CAN_ModeStatus_Success; + } + } + else if (CAN_OperatingMode == CAN_OperatingMode_Sleep) + { + /* Request Sleep mode */ + CANx->MCR = (uint32_t)((CANx->MCR & (uint32_t)(~(uint32_t)CAN_MCR_INRQ)) | CAN_MCR_SLEEP); + + /* Wait the acknowledge */ + while (((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_SLAK) && (timeout!=0)) + { + timeout--; + } + if ((CANx->MSR & CAN_MODE_MASK) != CAN_MSR_SLAK) + { + status = CAN_ModeStatus_Failed; + } + else + { + status = CAN_ModeStatus_Success; + } + } + else + { + status = CAN_ModeStatus_Failed; + } + + return (uint8_t) status; +} + +/** + * @brief Enters the low power mode. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @retval status: CAN_Sleep_Ok if sleep entered, CAN_Sleep_Failed in an + * other case. + */ +uint8_t CAN_Sleep(CAN_TypeDef* CANx) +{ + uint8_t sleepstatus = CAN_Sleep_Failed; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + /* Request Sleep mode */ + CANx->MCR = (((CANx->MCR) & (uint32_t)(~(uint32_t)CAN_MCR_INRQ)) | CAN_MCR_SLEEP); + + /* Sleep mode status */ + if ((CANx->MSR & (CAN_MSR_SLAK|CAN_MSR_INAK)) == CAN_MSR_SLAK) + { + /* Sleep mode not entered */ + sleepstatus = CAN_Sleep_Ok; + } + /* return sleep mode status */ + return (uint8_t)sleepstatus; +} + +/** + * @brief Wakes the CAN up. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @retval status: CAN_WakeUp_Ok if sleep mode left, CAN_WakeUp_Failed in an + * other case. + */ +uint8_t CAN_WakeUp(CAN_TypeDef* CANx) +{ + uint32_t wait_slak = SLAK_TIMEOUT; + uint8_t wakeupstatus = CAN_WakeUp_Failed; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + /* Wake up request */ + CANx->MCR &= ~(uint32_t)CAN_MCR_SLEEP; + + /* Sleep mode status */ + while(((CANx->MSR & CAN_MSR_SLAK) == CAN_MSR_SLAK)&&(wait_slak!=0x00)) + { + wait_slak--; + } + if((CANx->MSR & CAN_MSR_SLAK) != CAN_MSR_SLAK) + { + /* wake up done : Sleep mode exited */ + wakeupstatus = CAN_WakeUp_Ok; + } + /* return wakeup status */ + return (uint8_t)wakeupstatus; +} + + +/** + * @brief Returns the CANx's last error code (LEC). + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @retval CAN_ErrorCode: specifies the Error code : + * - CAN_ERRORCODE_NoErr No Error + * - CAN_ERRORCODE_StuffErr Stuff Error + * - CAN_ERRORCODE_FormErr Form Error + * - CAN_ERRORCODE_ACKErr Acknowledgment Error + * - CAN_ERRORCODE_BitRecessiveErr Bit Recessive Error + * - CAN_ERRORCODE_BitDominantErr Bit Dominant Error + * - CAN_ERRORCODE_CRCErr CRC Error + * - CAN_ERRORCODE_SoftwareSetErr Software Set Error + */ + +uint8_t CAN_GetLastErrorCode(CAN_TypeDef* CANx) +{ + uint8_t errorcode=0; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + /* Get the error code*/ + errorcode = (((uint8_t)CANx->ESR) & (uint8_t)CAN_ESR_LEC); + + /* Return the error code*/ + return errorcode; +} +/** + * @brief Returns the CANx Receive Error Counter (REC). + * @note In case of an error during reception, this counter is incremented + * by 1 or by 8 depending on the error condition as defined by the CAN + * standard. After every successful reception, the counter is + * decremented by 1 or reset to 120 if its value was higher than 128. + * When the counter value exceeds 127, the CAN controller enters the + * error passive state. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @retval CAN Receive Error Counter. + */ +uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef* CANx) +{ + uint8_t counter=0; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + /* Get the Receive Error Counter*/ + counter = (uint8_t)((CANx->ESR & CAN_ESR_REC)>> 24); + + /* Return the Receive Error Counter*/ + return counter; +} + + +/** + * @brief Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC). + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @retval LSB of the 9-bit CAN Transmit Error Counter. + */ +uint8_t CAN_GetLSBTransmitErrorCounter(CAN_TypeDef* CANx) +{ + uint8_t counter=0; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + + /* Get the LSB of the 9-bit CANx Transmit Error Counter(TEC) */ + counter = (uint8_t)((CANx->ESR & CAN_ESR_TEC)>> 16); + + /* Return the LSB of the 9-bit CANx Transmit Error Counter(TEC) */ + return counter; +} + + +/** + * @brief Enables or disables the specified CANx interrupts. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param CAN_IT: specifies the CAN interrupt sources to be enabled or disabled. + * This parameter can be: + * - CAN_IT_TME, + * - CAN_IT_FMP0, + * - CAN_IT_FF0, + * - CAN_IT_FOV0, + * - CAN_IT_FMP1, + * - CAN_IT_FF1, + * - CAN_IT_FOV1, + * - CAN_IT_EWG, + * - CAN_IT_EPV, + * - CAN_IT_LEC, + * - CAN_IT_ERR, + * - CAN_IT_WKU or + * - CAN_IT_SLK. + * @param NewState: new state of the CAN interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None. + */ +void CAN_ITConfig(CAN_TypeDef* CANx, uint32_t CAN_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_IT(CAN_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected CANx interrupt */ + CANx->IER |= CAN_IT; + } + else + { + /* Disable the selected CANx interrupt */ + CANx->IER &= ~CAN_IT; + } +} +/** + * @brief Checks whether the specified CAN flag is set or not. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param CAN_FLAG: specifies the flag to check. + * This parameter can be one of the following flags: + * - CAN_FLAG_EWG + * - CAN_FLAG_EPV + * - CAN_FLAG_BOF + * - CAN_FLAG_RQCP0 + * - CAN_FLAG_RQCP1 + * - CAN_FLAG_RQCP2 + * - CAN_FLAG_FMP1 + * - CAN_FLAG_FF1 + * - CAN_FLAG_FOV1 + * - CAN_FLAG_FMP0 + * - CAN_FLAG_FF0 + * - CAN_FLAG_FOV0 + * - CAN_FLAG_WKU + * - CAN_FLAG_SLAK + * - CAN_FLAG_LEC + * @retval The new state of CAN_FLAG (SET or RESET). + */ +FlagStatus CAN_GetFlagStatus(CAN_TypeDef* CANx, uint32_t CAN_FLAG) +{ + FlagStatus bitstatus = RESET; + + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_GET_FLAG(CAN_FLAG)); + + + if((CAN_FLAG & CAN_FLAGS_ESR) != (uint32_t)RESET) + { + /* Check the status of the specified CAN flag */ + if ((CANx->ESR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET) + { + /* CAN_FLAG is set */ + bitstatus = SET; + } + else + { + /* CAN_FLAG is reset */ + bitstatus = RESET; + } + } + else if((CAN_FLAG & CAN_FLAGS_MSR) != (uint32_t)RESET) + { + /* Check the status of the specified CAN flag */ + if ((CANx->MSR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET) + { + /* CAN_FLAG is set */ + bitstatus = SET; + } + else + { + /* CAN_FLAG is reset */ + bitstatus = RESET; + } + } + else if((CAN_FLAG & CAN_FLAGS_TSR) != (uint32_t)RESET) + { + /* Check the status of the specified CAN flag */ + if ((CANx->TSR & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET) + { + /* CAN_FLAG is set */ + bitstatus = SET; + } + else + { + /* CAN_FLAG is reset */ + bitstatus = RESET; + } + } + else if((CAN_FLAG & CAN_FLAGS_RF0R) != (uint32_t)RESET) + { + /* Check the status of the specified CAN flag */ + if ((CANx->RF0R & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET) + { + /* CAN_FLAG is set */ + bitstatus = SET; + } + else + { + /* CAN_FLAG is reset */ + bitstatus = RESET; + } + } + else /* If(CAN_FLAG & CAN_FLAGS_RF1R != (uint32_t)RESET) */ + { + /* Check the status of the specified CAN flag */ + if ((uint32_t)(CANx->RF1R & (CAN_FLAG & 0x000FFFFF)) != (uint32_t)RESET) + { + /* CAN_FLAG is set */ + bitstatus = SET; + } + else + { + /* CAN_FLAG is reset */ + bitstatus = RESET; + } + } + /* Return the CAN_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the CAN's pending flags. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param CAN_FLAG: specifies the flag to clear. + * This parameter can be one of the following flags: + * - CAN_FLAG_RQCP0 + * - CAN_FLAG_RQCP1 + * - CAN_FLAG_RQCP2 + * - CAN_FLAG_FF1 + * - CAN_FLAG_FOV1 + * - CAN_FLAG_FF0 + * - CAN_FLAG_FOV0 + * - CAN_FLAG_WKU + * - CAN_FLAG_SLAK + * - CAN_FLAG_LEC + * @retval None. + */ +void CAN_ClearFlag(CAN_TypeDef* CANx, uint32_t CAN_FLAG) +{ + uint32_t flagtmp=0; + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_CLEAR_FLAG(CAN_FLAG)); + + if (CAN_FLAG == CAN_FLAG_LEC) /* ESR register */ + { + /* Clear the selected CAN flags */ + CANx->ESR = (uint32_t)RESET; + } + else /* MSR or TSR or RF0R or RF1R */ + { + flagtmp = CAN_FLAG & 0x000FFFFF; + + if ((CAN_FLAG & CAN_FLAGS_RF0R)!=(uint32_t)RESET) + { + /* Receive Flags */ + CANx->RF0R = (uint32_t)(flagtmp); + } + else if ((CAN_FLAG & CAN_FLAGS_RF1R)!=(uint32_t)RESET) + { + /* Receive Flags */ + CANx->RF1R = (uint32_t)(flagtmp); + } + else if ((CAN_FLAG & CAN_FLAGS_TSR)!=(uint32_t)RESET) + { + /* Transmit Flags */ + CANx->TSR = (uint32_t)(flagtmp); + } + else /* If((CAN_FLAG & CAN_FLAGS_MSR)!=(uint32_t)RESET) */ + { + /* Operating mode Flags */ + CANx->MSR = (uint32_t)(flagtmp); + } + } +} + +/** + * @brief Checks whether the specified CANx interrupt has occurred or not. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param CAN_IT: specifies the CAN interrupt source to check. + * This parameter can be one of the following flags: + * - CAN_IT_TME + * - CAN_IT_FMP0 + * - CAN_IT_FF0 + * - CAN_IT_FOV0 + * - CAN_IT_FMP1 + * - CAN_IT_FF1 + * - CAN_IT_FOV1 + * - CAN_IT_WKU + * - CAN_IT_SLK + * - CAN_IT_EWG + * - CAN_IT_EPV + * - CAN_IT_BOF + * - CAN_IT_LEC + * - CAN_IT_ERR + * @retval The current state of CAN_IT (SET or RESET). + */ +ITStatus CAN_GetITStatus(CAN_TypeDef* CANx, uint32_t CAN_IT) +{ + ITStatus itstatus = RESET; + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_IT(CAN_IT)); + + /* check the enable interrupt bit */ + if((CANx->IER & CAN_IT) != RESET) + { + /* in case the Interrupt is enabled, .... */ + switch (CAN_IT) + { + case CAN_IT_TME: + /* Check CAN_TSR_RQCPx bits */ + itstatus = CheckITStatus(CANx->TSR, CAN_TSR_RQCP0|CAN_TSR_RQCP1|CAN_TSR_RQCP2); + break; + case CAN_IT_FMP0: + /* Check CAN_RF0R_FMP0 bit */ + itstatus = CheckITStatus(CANx->RF0R, CAN_RF0R_FMP0); + break; + case CAN_IT_FF0: + /* Check CAN_RF0R_FULL0 bit */ + itstatus = CheckITStatus(CANx->RF0R, CAN_RF0R_FULL0); + break; + case CAN_IT_FOV0: + /* Check CAN_RF0R_FOVR0 bit */ + itstatus = CheckITStatus(CANx->RF0R, CAN_RF0R_FOVR0); + break; + case CAN_IT_FMP1: + /* Check CAN_RF1R_FMP1 bit */ + itstatus = CheckITStatus(CANx->RF1R, CAN_RF1R_FMP1); + break; + case CAN_IT_FF1: + /* Check CAN_RF1R_FULL1 bit */ + itstatus = CheckITStatus(CANx->RF1R, CAN_RF1R_FULL1); + break; + case CAN_IT_FOV1: + /* Check CAN_RF1R_FOVR1 bit */ + itstatus = CheckITStatus(CANx->RF1R, CAN_RF1R_FOVR1); + break; + case CAN_IT_WKU: + /* Check CAN_MSR_WKUI bit */ + itstatus = CheckITStatus(CANx->MSR, CAN_MSR_WKUI); + break; + case CAN_IT_SLK: + /* Check CAN_MSR_SLAKI bit */ + itstatus = CheckITStatus(CANx->MSR, CAN_MSR_SLAKI); + break; + case CAN_IT_EWG: + /* Check CAN_ESR_EWGF bit */ + itstatus = CheckITStatus(CANx->ESR, CAN_ESR_EWGF); + break; + case CAN_IT_EPV: + /* Check CAN_ESR_EPVF bit */ + itstatus = CheckITStatus(CANx->ESR, CAN_ESR_EPVF); + break; + case CAN_IT_BOF: + /* Check CAN_ESR_BOFF bit */ + itstatus = CheckITStatus(CANx->ESR, CAN_ESR_BOFF); + break; + case CAN_IT_LEC: + /* Check CAN_ESR_LEC bit */ + itstatus = CheckITStatus(CANx->ESR, CAN_ESR_LEC); + break; + case CAN_IT_ERR: + /* Check CAN_MSR_ERRI bit */ + itstatus = CheckITStatus(CANx->MSR, CAN_MSR_ERRI); + break; + default : + /* in case of error, return RESET */ + itstatus = RESET; + break; + } + } + else + { + /* in case the Interrupt is not enabled, return RESET */ + itstatus = RESET; + } + + /* Return the CAN_IT status */ + return itstatus; +} + +/** + * @brief Clears the CANx's interrupt pending bits. + * @param CANx: where x can be 1 or 2 to to select the CAN peripheral. + * @param CAN_IT: specifies the interrupt pending bit to clear. + * - CAN_IT_TME + * - CAN_IT_FF0 + * - CAN_IT_FOV0 + * - CAN_IT_FF1 + * - CAN_IT_FOV1 + * - CAN_IT_WKU + * - CAN_IT_SLK + * - CAN_IT_EWG + * - CAN_IT_EPV + * - CAN_IT_BOF + * - CAN_IT_LEC + * - CAN_IT_ERR + * @retval None. + */ +void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT) +{ + /* Check the parameters */ + assert_param(IS_CAN_ALL_PERIPH(CANx)); + assert_param(IS_CAN_CLEAR_IT(CAN_IT)); + + switch (CAN_IT) + { + case CAN_IT_TME: + /* Clear CAN_TSR_RQCPx (rc_w1)*/ + CANx->TSR = CAN_TSR_RQCP0|CAN_TSR_RQCP1|CAN_TSR_RQCP2; + break; + case CAN_IT_FF0: + /* Clear CAN_RF0R_FULL0 (rc_w1)*/ + CANx->RF0R = CAN_RF0R_FULL0; + break; + case CAN_IT_FOV0: + /* Clear CAN_RF0R_FOVR0 (rc_w1)*/ + CANx->RF0R = CAN_RF0R_FOVR0; + break; + case CAN_IT_FF1: + /* Clear CAN_RF1R_FULL1 (rc_w1)*/ + CANx->RF1R = CAN_RF1R_FULL1; + break; + case CAN_IT_FOV1: + /* Clear CAN_RF1R_FOVR1 (rc_w1)*/ + CANx->RF1R = CAN_RF1R_FOVR1; + break; + case CAN_IT_WKU: + /* Clear CAN_MSR_WKUI (rc_w1)*/ + CANx->MSR = CAN_MSR_WKUI; + break; + case CAN_IT_SLK: + /* Clear CAN_MSR_SLAKI (rc_w1)*/ + CANx->MSR = CAN_MSR_SLAKI; + break; + case CAN_IT_EWG: + /* Clear CAN_MSR_ERRI (rc_w1) */ + CANx->MSR = CAN_MSR_ERRI; + /* Note : the corresponding Flag is cleared by hardware depending + of the CAN Bus status*/ + break; + case CAN_IT_EPV: + /* Clear CAN_MSR_ERRI (rc_w1) */ + CANx->MSR = CAN_MSR_ERRI; + /* Note : the corresponding Flag is cleared by hardware depending + of the CAN Bus status*/ + break; + case CAN_IT_BOF: + /* Clear CAN_MSR_ERRI (rc_w1) */ + CANx->MSR = CAN_MSR_ERRI; + /* Note : the corresponding Flag is cleared by hardware depending + of the CAN Bus status*/ + break; + case CAN_IT_LEC: + /* Clear LEC bits */ + CANx->ESR = RESET; + /* Clear CAN_MSR_ERRI (rc_w1) */ + CANx->MSR = CAN_MSR_ERRI; + break; + case CAN_IT_ERR: + /*Clear LEC bits */ + CANx->ESR = RESET; + /* Clear CAN_MSR_ERRI (rc_w1) */ + CANx->MSR = CAN_MSR_ERRI; + /* Note : BOFF, EPVF and EWGF Flags are cleared by hardware depending + of the CAN Bus status*/ + break; + default : + break; + } +} + +/** + * @brief Checks whether the CAN interrupt has occurred or not. + * @param CAN_Reg: specifies the CAN interrupt register to check. + * @param It_Bit: specifies the interrupt source bit to check. + * @retval The new state of the CAN Interrupt (SET or RESET). + */ +static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit) +{ + ITStatus pendingbitstatus = RESET; + + if ((CAN_Reg & It_Bit) != (uint32_t)RESET) + { + /* CAN_IT is set */ + pendingbitstatus = SET; + } + else + { + /* CAN_IT is reset */ + pendingbitstatus = RESET; + } + return pendingbitstatus; +} + + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c new file mode 100644 index 0000000..8324c68 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c @@ -0,0 +1,431 @@ +/** + ****************************************************************************** + * @file stm32f10x_cec.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the CEC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_cec.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup CEC + * @brief CEC driver modules + * @{ + */ + +/** @defgroup CEC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + + +/** @defgroup CEC_Private_Defines + * @{ + */ + +/* ------------ CEC registers bit address in the alias region ----------- */ +#define CEC_OFFSET (CEC_BASE - PERIPH_BASE) + +/* --- CFGR Register ---*/ + +/* Alias word address of PE bit */ +#define CFGR_OFFSET (CEC_OFFSET + 0x00) +#define PE_BitNumber 0x00 +#define CFGR_PE_BB (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (PE_BitNumber * 4)) + +/* Alias word address of IE bit */ +#define IE_BitNumber 0x01 +#define CFGR_IE_BB (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (IE_BitNumber * 4)) + +/* --- CSR Register ---*/ + +/* Alias word address of TSOM bit */ +#define CSR_OFFSET (CEC_OFFSET + 0x10) +#define TSOM_BitNumber 0x00 +#define CSR_TSOM_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TSOM_BitNumber * 4)) + +/* Alias word address of TEOM bit */ +#define TEOM_BitNumber 0x01 +#define CSR_TEOM_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TEOM_BitNumber * 4)) + +#define CFGR_CLEAR_Mask (uint8_t)(0xF3) /* CFGR register Mask */ +#define FLAG_Mask ((uint32_t)0x00FFFFFF) /* CEC FLAG mask */ + +/** + * @} + */ + + +/** @defgroup CEC_Private_Macros + * @{ + */ + +/** + * @} + */ + + +/** @defgroup CEC_Private_Variables + * @{ + */ + +/** + * @} + */ + + +/** @defgroup CEC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + + +/** @defgroup CEC_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the CEC peripheral registers to their default reset + * values. + * @param None + * @retval None + */ +void CEC_DeInit(void) +{ + /* Enable CEC reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CEC, ENABLE); + /* Release CEC from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_CEC, DISABLE); +} + + +/** + * @brief Initializes the CEC peripheral according to the specified + * parameters in the CEC_InitStruct. + * @param CEC_InitStruct: pointer to an CEC_InitTypeDef structure that + * contains the configuration information for the specified + * CEC peripheral. + * @retval None + */ +void CEC_Init(CEC_InitTypeDef* CEC_InitStruct) +{ + uint16_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_CEC_BIT_TIMING_ERROR_MODE(CEC_InitStruct->CEC_BitTimingMode)); + assert_param(IS_CEC_BIT_PERIOD_ERROR_MODE(CEC_InitStruct->CEC_BitPeriodMode)); + + /*---------------------------- CEC CFGR Configuration -----------------*/ + /* Get the CEC CFGR value */ + tmpreg = CEC->CFGR; + + /* Clear BTEM and BPEM bits */ + tmpreg &= CFGR_CLEAR_Mask; + + /* Configure CEC: Bit Timing Error and Bit Period Error */ + tmpreg |= (uint16_t)(CEC_InitStruct->CEC_BitTimingMode | CEC_InitStruct->CEC_BitPeriodMode); + + /* Write to CEC CFGR register*/ + CEC->CFGR = tmpreg; + +} + +/** + * @brief Enables or disables the specified CEC peripheral. + * @param NewState: new state of the CEC peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void CEC_Cmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CFGR_PE_BB = (uint32_t)NewState; + + if(NewState == DISABLE) + { + /* Wait until the PE bit is cleared by hardware (Idle Line detected) */ + while((CEC->CFGR & CEC_CFGR_PE) != (uint32_t)RESET) + { + } + } +} + +/** + * @brief Enables or disables the CEC interrupt. + * @param NewState: new state of the CEC interrupt. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void CEC_ITConfig(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CFGR_IE_BB = (uint32_t)NewState; +} + +/** + * @brief Defines the Own Address of the CEC device. + * @param CEC_OwnAddress: The CEC own address + * @retval None + */ +void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress) +{ + /* Check the parameters */ + assert_param(IS_CEC_ADDRESS(CEC_OwnAddress)); + + /* Set the CEC own address */ + CEC->OAR = CEC_OwnAddress; +} + +/** + * @brief Sets the CEC prescaler value. + * @param CEC_Prescaler: CEC prescaler new value + * @retval None + */ +void CEC_SetPrescaler(uint16_t CEC_Prescaler) +{ + /* Check the parameters */ + assert_param(IS_CEC_PRESCALER(CEC_Prescaler)); + + /* Set the Prescaler value*/ + CEC->PRES = CEC_Prescaler; +} + +/** + * @brief Transmits single data through the CEC peripheral. + * @param Data: the data to transmit. + * @retval None + */ +void CEC_SendDataByte(uint8_t Data) +{ + /* Transmit Data */ + CEC->TXD = Data ; +} + + +/** + * @brief Returns the most recent received data by the CEC peripheral. + * @param None + * @retval The received data. + */ +uint8_t CEC_ReceiveDataByte(void) +{ + /* Receive Data */ + return (uint8_t)(CEC->RXD); +} + +/** + * @brief Starts a new message. + * @param None + * @retval None + */ +void CEC_StartOfMessage(void) +{ + /* Starts of new message */ + *(__IO uint32_t *) CSR_TSOM_BB = (uint32_t)0x1; +} + +/** + * @brief Transmits message with or without an EOM bit. + * @param NewState: new state of the CEC Tx End Of Message. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void CEC_EndOfMessageCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + /* The data byte will be transmitted with or without an EOM bit*/ + *(__IO uint32_t *) CSR_TEOM_BB = (uint32_t)NewState; +} + +/** + * @brief Gets the CEC flag status + * @param CEC_FLAG: specifies the CEC flag to check. + * This parameter can be one of the following values: + * @arg CEC_FLAG_BTE: Bit Timing Error + * @arg CEC_FLAG_BPE: Bit Period Error + * @arg CEC_FLAG_RBTFE: Rx Block Transfer Finished Error + * @arg CEC_FLAG_SBE: Start Bit Error + * @arg CEC_FLAG_ACKE: Block Acknowledge Error + * @arg CEC_FLAG_LINE: Line Error + * @arg CEC_FLAG_TBTFE: Tx Block Transfer Finished Error + * @arg CEC_FLAG_TEOM: Tx End Of Message + * @arg CEC_FLAG_TERR: Tx Error + * @arg CEC_FLAG_TBTRF: Tx Byte Transfer Request or Block Transfer Finished + * @arg CEC_FLAG_RSOM: Rx Start Of Message + * @arg CEC_FLAG_REOM: Rx End Of Message + * @arg CEC_FLAG_RERR: Rx Error + * @arg CEC_FLAG_RBTF: Rx Byte/Block Transfer Finished + * @retval The new state of CEC_FLAG (SET or RESET) + */ +FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG) +{ + FlagStatus bitstatus = RESET; + uint32_t cecreg = 0, cecbase = 0; + + /* Check the parameters */ + assert_param(IS_CEC_GET_FLAG(CEC_FLAG)); + + /* Get the CEC peripheral base address */ + cecbase = (uint32_t)(CEC_BASE); + + /* Read flag register index */ + cecreg = CEC_FLAG >> 28; + + /* Get bit[23:0] of the flag */ + CEC_FLAG &= FLAG_Mask; + + if(cecreg != 0) + { + /* Flag in CEC ESR Register */ + CEC_FLAG = (uint32_t)(CEC_FLAG >> 16); + + /* Get the CEC ESR register address */ + cecbase += 0xC; + } + else + { + /* Get the CEC CSR register address */ + cecbase += 0x10; + } + + if(((*(__IO uint32_t *)cecbase) & CEC_FLAG) != (uint32_t)RESET) + { + /* CEC_FLAG is set */ + bitstatus = SET; + } + else + { + /* CEC_FLAG is reset */ + bitstatus = RESET; + } + + /* Return the CEC_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the CEC's pending flags. + * @param CEC_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg CEC_FLAG_TERR: Tx Error + * @arg CEC_FLAG_TBTRF: Tx Byte Transfer Request or Block Transfer Finished + * @arg CEC_FLAG_RSOM: Rx Start Of Message + * @arg CEC_FLAG_REOM: Rx End Of Message + * @arg CEC_FLAG_RERR: Rx Error + * @arg CEC_FLAG_RBTF: Rx Byte/Block Transfer Finished + * @retval None + */ +void CEC_ClearFlag(uint32_t CEC_FLAG) +{ + uint32_t tmp = 0x0; + + /* Check the parameters */ + assert_param(IS_CEC_CLEAR_FLAG(CEC_FLAG)); + + tmp = CEC->CSR & 0x2; + + /* Clear the selected CEC flags */ + CEC->CSR &= (uint32_t)(((~(uint32_t)CEC_FLAG) & 0xFFFFFFFC) | tmp); +} + +/** + * @brief Checks whether the specified CEC interrupt has occurred or not. + * @param CEC_IT: specifies the CEC interrupt source to check. + * This parameter can be one of the following values: + * @arg CEC_IT_TERR: Tx Error + * @arg CEC_IT_TBTF: Tx Block Transfer Finished + * @arg CEC_IT_RERR: Rx Error + * @arg CEC_IT_RBTF: Rx Block Transfer Finished + * @retval The new state of CEC_IT (SET or RESET). + */ +ITStatus CEC_GetITStatus(uint8_t CEC_IT) +{ + ITStatus bitstatus = RESET; + uint32_t enablestatus = 0; + + /* Check the parameters */ + assert_param(IS_CEC_GET_IT(CEC_IT)); + + /* Get the CEC IT enable bit status */ + enablestatus = (CEC->CFGR & (uint8_t)CEC_CFGR_IE) ; + + /* Check the status of the specified CEC interrupt */ + if (((CEC->CSR & CEC_IT) != (uint32_t)RESET) && enablestatus) + { + /* CEC_IT is set */ + bitstatus = SET; + } + else + { + /* CEC_IT is reset */ + bitstatus = RESET; + } + /* Return the CEC_IT status */ + return bitstatus; +} + +/** + * @brief Clears the CEC's interrupt pending bits. + * @param CEC_IT: specifies the CEC interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg CEC_IT_TERR: Tx Error + * @arg CEC_IT_TBTF: Tx Block Transfer Finished + * @arg CEC_IT_RERR: Rx Error + * @arg CEC_IT_RBTF: Rx Block Transfer Finished + * @retval None + */ +void CEC_ClearITPendingBit(uint16_t CEC_IT) +{ + uint32_t tmp = 0x0; + + /* Check the parameters */ + assert_param(IS_CEC_GET_IT(CEC_IT)); + + tmp = CEC->CSR & 0x2; + + /* Clear the selected CEC interrupt pending bits */ + CEC->CSR &= (uint32_t)(((~(uint32_t)CEC_IT) & 0xFFFFFFFC) | tmp); +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c new file mode 100644 index 0000000..641c491 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c @@ -0,0 +1,158 @@ +/** + ****************************************************************************** + * @file stm32f10x_crc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the CRC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_crc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup CRC + * @brief CRC driver modules + * @{ + */ + +/** @defgroup CRC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Private_Defines + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup CRC_Private_Functions + * @{ + */ + +/** + * @brief Resets the CRC Data register (DR). + * @param None + * @retval None + */ +void CRC_ResetDR(void) +{ + /* Reset CRC generator */ + CRC->CR = CRC_CR_RESET; +} + +/** + * @brief Computes the 32-bit CRC of a given data word(32-bit). + * @param Data: data word(32-bit) to compute its CRC + * @retval 32-bit CRC + */ +uint32_t CRC_CalcCRC(uint32_t Data) +{ + CRC->DR = Data; + + return (CRC->DR); +} + +/** + * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit). + * @param pBuffer: pointer to the buffer containing the data to be computed + * @param BufferLength: length of the buffer to be computed + * @retval 32-bit CRC + */ +uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength) +{ + uint32_t index = 0; + + for(index = 0; index < BufferLength; index++) + { + CRC->DR = pBuffer[index]; + } + return (CRC->DR); +} + +/** + * @brief Returns the current CRC value. + * @param None + * @retval 32-bit CRC + */ +uint32_t CRC_GetCRC(void) +{ + return (CRC->DR); +} + +/** + * @brief Stores a 8-bit data in the Independent Data(ID) register. + * @param IDValue: 8-bit value to be stored in the ID register + * @retval None + */ +void CRC_SetIDRegister(uint8_t IDValue) +{ + CRC->IDR = IDValue; +} + +/** + * @brief Returns the 8-bit data stored in the Independent Data(ID) register + * @param None + * @retval 8-bit value of the ID register + */ +uint8_t CRC_GetIDRegister(void) +{ + return (CRC->IDR); +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c new file mode 100644 index 0000000..65674fd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c @@ -0,0 +1,569 @@ +/** + ****************************************************************************** + * @file stm32f10x_dac.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the DAC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_dac.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup DAC + * @brief DAC driver modules + * @{ + */ + +/** @defgroup DAC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup DAC_Private_Defines + * @{ + */ + +/* CR register Mask */ +#define CR_CLEAR_MASK ((uint32_t)0x00000FFE) + +/* DAC Dual Channels SWTRIG masks */ +#define DUAL_SWTRIG_SET ((uint32_t)0x00000003) +#define DUAL_SWTRIG_RESET ((uint32_t)0xFFFFFFFC) + +/* DHR registers offsets */ +#define DHR12R1_OFFSET ((uint32_t)0x00000008) +#define DHR12R2_OFFSET ((uint32_t)0x00000014) +#define DHR12RD_OFFSET ((uint32_t)0x00000020) + +/* DOR register offset */ +#define DOR_OFFSET ((uint32_t)0x0000002C) +/** + * @} + */ + +/** @defgroup DAC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DAC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup DAC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup DAC_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the DAC peripheral registers to their default reset values. + * @param None + * @retval None + */ +void DAC_DeInit(void) +{ + /* Enable DAC reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, ENABLE); + /* Release DAC from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, DISABLE); +} + +/** + * @brief Initializes the DAC peripheral according to the specified + * parameters in the DAC_InitStruct. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_InitStruct: pointer to a DAC_InitTypeDef structure that + * contains the configuration information for the specified DAC channel. + * @retval None + */ +void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct) +{ + uint32_t tmpreg1 = 0, tmpreg2 = 0; + /* Check the DAC parameters */ + assert_param(IS_DAC_TRIGGER(DAC_InitStruct->DAC_Trigger)); + assert_param(IS_DAC_GENERATE_WAVE(DAC_InitStruct->DAC_WaveGeneration)); + assert_param(IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude)); + assert_param(IS_DAC_OUTPUT_BUFFER_STATE(DAC_InitStruct->DAC_OutputBuffer)); +/*---------------------------- DAC CR Configuration --------------------------*/ + /* Get the DAC CR value */ + tmpreg1 = DAC->CR; + /* Clear BOFFx, TENx, TSELx, WAVEx and MAMPx bits */ + tmpreg1 &= ~(CR_CLEAR_MASK << DAC_Channel); + /* Configure for the selected DAC channel: buffer output, trigger, wave generation, + mask/amplitude for wave generation */ + /* Set TSELx and TENx bits according to DAC_Trigger value */ + /* Set WAVEx bits according to DAC_WaveGeneration value */ + /* Set MAMPx bits according to DAC_LFSRUnmask_TriangleAmplitude value */ + /* Set BOFFx bit according to DAC_OutputBuffer value */ + tmpreg2 = (DAC_InitStruct->DAC_Trigger | DAC_InitStruct->DAC_WaveGeneration | + DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude | DAC_InitStruct->DAC_OutputBuffer); + /* Calculate CR register value depending on DAC_Channel */ + tmpreg1 |= tmpreg2 << DAC_Channel; + /* Write to DAC CR */ + DAC->CR = tmpreg1; +} + +/** + * @brief Fills each DAC_InitStruct member with its default value. + * @param DAC_InitStruct : pointer to a DAC_InitTypeDef structure which will + * be initialized. + * @retval None + */ +void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct) +{ +/*--------------- Reset DAC init structure parameters values -----------------*/ + /* Initialize the DAC_Trigger member */ + DAC_InitStruct->DAC_Trigger = DAC_Trigger_None; + /* Initialize the DAC_WaveGeneration member */ + DAC_InitStruct->DAC_WaveGeneration = DAC_WaveGeneration_None; + /* Initialize the DAC_LFSRUnmask_TriangleAmplitude member */ + DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bit0; + /* Initialize the DAC_OutputBuffer member */ + DAC_InitStruct->DAC_OutputBuffer = DAC_OutputBuffer_Enable; +} + +/** + * @brief Enables or disables the specified DAC channel. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param NewState: new state of the DAC channel. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected DAC channel */ + DAC->CR |= (DAC_CR_EN1 << DAC_Channel); + } + else + { + /* Disable the selected DAC channel */ + DAC->CR &= ~(DAC_CR_EN1 << DAC_Channel); + } +} +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +/** + * @brief Enables or disables the specified DAC interrupts. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_IT: specifies the DAC interrupt sources to be enabled or disabled. + * This parameter can be the following values: + * @arg DAC_IT_DMAUDR: DMA underrun interrupt mask + * @param NewState: new state of the specified DAC interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + assert_param(IS_DAC_IT(DAC_IT)); + + if (NewState != DISABLE) + { + /* Enable the selected DAC interrupts */ + DAC->CR |= (DAC_IT << DAC_Channel); + } + else + { + /* Disable the selected DAC interrupts */ + DAC->CR &= (~(uint32_t)(DAC_IT << DAC_Channel)); + } +} +#endif + +/** + * @brief Enables or disables the specified DAC channel DMA request. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param NewState: new state of the selected DAC channel DMA request. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected DAC channel DMA request */ + DAC->CR |= (DAC_CR_DMAEN1 << DAC_Channel); + } + else + { + /* Disable the selected DAC channel DMA request */ + DAC->CR &= ~(DAC_CR_DMAEN1 << DAC_Channel); + } +} + +/** + * @brief Enables or disables the selected DAC channel software trigger. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param NewState: new state of the selected DAC channel software trigger. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable software trigger for the selected DAC channel */ + DAC->SWTRIGR |= (uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4); + } + else + { + /* Disable software trigger for the selected DAC channel */ + DAC->SWTRIGR &= ~((uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4)); + } +} + +/** + * @brief Enables or disables simultaneously the two DAC channels software + * triggers. + * @param NewState: new state of the DAC channels software triggers. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_DualSoftwareTriggerCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable software trigger for both DAC channels */ + DAC->SWTRIGR |= DUAL_SWTRIG_SET ; + } + else + { + /* Disable software trigger for both DAC channels */ + DAC->SWTRIGR &= DUAL_SWTRIG_RESET; + } +} + +/** + * @brief Enables or disables the selected DAC channel wave generation. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_Wave: Specifies the wave type to enable or disable. + * This parameter can be one of the following values: + * @arg DAC_Wave_Noise: noise wave generation + * @arg DAC_Wave_Triangle: triangle wave generation + * @param NewState: new state of the selected DAC channel wave generation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_DAC_WAVE(DAC_Wave)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected wave generation for the selected DAC channel */ + DAC->CR |= DAC_Wave << DAC_Channel; + } + else + { + /* Disable the selected wave generation for the selected DAC channel */ + DAC->CR &= ~(DAC_Wave << DAC_Channel); + } +} + +/** + * @brief Set the specified data holding register value for DAC channel1. + * @param DAC_Align: Specifies the data alignment for DAC channel1. + * This parameter can be one of the following values: + * @arg DAC_Align_8b_R: 8bit right data alignment selected + * @arg DAC_Align_12b_L: 12bit left data alignment selected + * @arg DAC_Align_12b_R: 12bit right data alignment selected + * @param Data : Data to be loaded in the selected data holding register. + * @retval None + */ +void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_DAC_ALIGN(DAC_Align)); + assert_param(IS_DAC_DATA(Data)); + + tmp = (uint32_t)DAC_BASE; + tmp += DHR12R1_OFFSET + DAC_Align; + + /* Set the DAC channel1 selected data holding register */ + *(__IO uint32_t *) tmp = Data; +} + +/** + * @brief Set the specified data holding register value for DAC channel2. + * @param DAC_Align: Specifies the data alignment for DAC channel2. + * This parameter can be one of the following values: + * @arg DAC_Align_8b_R: 8bit right data alignment selected + * @arg DAC_Align_12b_L: 12bit left data alignment selected + * @arg DAC_Align_12b_R: 12bit right data alignment selected + * @param Data : Data to be loaded in the selected data holding register. + * @retval None + */ +void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_DAC_ALIGN(DAC_Align)); + assert_param(IS_DAC_DATA(Data)); + + tmp = (uint32_t)DAC_BASE; + tmp += DHR12R2_OFFSET + DAC_Align; + + /* Set the DAC channel2 selected data holding register */ + *(__IO uint32_t *)tmp = Data; +} + +/** + * @brief Set the specified data holding register value for dual channel + * DAC. + * @param DAC_Align: Specifies the data alignment for dual channel DAC. + * This parameter can be one of the following values: + * @arg DAC_Align_8b_R: 8bit right data alignment selected + * @arg DAC_Align_12b_L: 12bit left data alignment selected + * @arg DAC_Align_12b_R: 12bit right data alignment selected + * @param Data2: Data for DAC Channel2 to be loaded in the selected data + * holding register. + * @param Data1: Data for DAC Channel1 to be loaded in the selected data + * holding register. + * @retval None + */ +void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1) +{ + uint32_t data = 0, tmp = 0; + + /* Check the parameters */ + assert_param(IS_DAC_ALIGN(DAC_Align)); + assert_param(IS_DAC_DATA(Data1)); + assert_param(IS_DAC_DATA(Data2)); + + /* Calculate and set dual DAC data holding register value */ + if (DAC_Align == DAC_Align_8b_R) + { + data = ((uint32_t)Data2 << 8) | Data1; + } + else + { + data = ((uint32_t)Data2 << 16) | Data1; + } + + tmp = (uint32_t)DAC_BASE; + tmp += DHR12RD_OFFSET + DAC_Align; + + /* Set the dual DAC selected data holding register */ + *(__IO uint32_t *)tmp = data; +} + +/** + * @brief Returns the last data output value of the selected DAC channel. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @retval The selected DAC channel data output value. + */ +uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + + tmp = (uint32_t) DAC_BASE ; + tmp += DOR_OFFSET + ((uint32_t)DAC_Channel >> 2); + + /* Returns the DAC channel data output register value */ + return (uint16_t) (*(__IO uint32_t*) tmp); +} + +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) +/** + * @brief Checks whether the specified DAC flag is set or not. + * @param DAC_Channel: thee selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_FLAG: specifies the flag to check. + * This parameter can be only of the following value: + * @arg DAC_FLAG_DMAUDR: DMA underrun flag + * @retval The new state of DAC_FLAG (SET or RESET). + */ +FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_DAC_FLAG(DAC_FLAG)); + + /* Check the status of the specified DAC flag */ + if ((DAC->SR & (DAC_FLAG << DAC_Channel)) != (uint8_t)RESET) + { + /* DAC_FLAG is set */ + bitstatus = SET; + } + else + { + /* DAC_FLAG is reset */ + bitstatus = RESET; + } + /* Return the DAC_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the DAC channelx's pending flags. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_FLAG: specifies the flag to clear. + * This parameter can be of the following value: + * @arg DAC_FLAG_DMAUDR: DMA underrun flag + * @retval None + */ +void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_DAC_FLAG(DAC_FLAG)); + + /* Clear the selected DAC flags */ + DAC->SR = (DAC_FLAG << DAC_Channel); +} + +/** + * @brief Checks whether the specified DAC interrupt has occurred or not. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_IT: specifies the DAC interrupt source to check. + * This parameter can be the following values: + * @arg DAC_IT_DMAUDR: DMA underrun interrupt mask + * @retval The new state of DAC_IT (SET or RESET). + */ +ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT) +{ + ITStatus bitstatus = RESET; + uint32_t enablestatus = 0; + + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_DAC_IT(DAC_IT)); + + /* Get the DAC_IT enable bit status */ + enablestatus = (DAC->CR & (DAC_IT << DAC_Channel)) ; + + /* Check the status of the specified DAC interrupt */ + if (((DAC->SR & (DAC_IT << DAC_Channel)) != (uint32_t)RESET) && enablestatus) + { + /* DAC_IT is set */ + bitstatus = SET; + } + else + { + /* DAC_IT is reset */ + bitstatus = RESET; + } + /* Return the DAC_IT status */ + return bitstatus; +} + +/** + * @brief Clears the DAC channelx's interrupt pending bits. + * @param DAC_Channel: the selected DAC channel. + * This parameter can be one of the following values: + * @arg DAC_Channel_1: DAC Channel1 selected + * @arg DAC_Channel_2: DAC Channel2 selected + * @param DAC_IT: specifies the DAC interrupt pending bit to clear. + * This parameter can be the following values: + * @arg DAC_IT_DMAUDR: DMA underrun interrupt mask + * @retval None + */ +void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT) +{ + /* Check the parameters */ + assert_param(IS_DAC_CHANNEL(DAC_Channel)); + assert_param(IS_DAC_IT(DAC_IT)); + + /* Clear the selected DAC interrupt pending bits */ + DAC->SR = (DAC_IT << DAC_Channel); +} +#endif + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c new file mode 100644 index 0000000..4d9ae28 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c @@ -0,0 +1,160 @@ +/** + ****************************************************************************** + * @file stm32f10x_dbgmcu.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the DBGMCU firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_dbgmcu.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup DBGMCU + * @brief DBGMCU driver modules + * @{ + */ + +/** @defgroup DBGMCU_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Private_Defines + * @{ + */ + +#define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF) +/** + * @} + */ + +/** @defgroup DBGMCU_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup DBGMCU_Private_Functions + * @{ + */ + +/** + * @brief Returns the device revision identifier. + * @param None + * @retval Device revision identifier + */ +uint32_t DBGMCU_GetREVID(void) +{ + return(DBGMCU->IDCODE >> 16); +} + +/** + * @brief Returns the device identifier. + * @param None + * @retval Device identifier + */ +uint32_t DBGMCU_GetDEVID(void) +{ + return(DBGMCU->IDCODE & IDCODE_DEVID_MASK); +} + +/** + * @brief Configures the specified peripheral and low power mode behavior + * when the MCU under Debug mode. + * @param DBGMCU_Periph: specifies the peripheral and low power mode. + * This parameter can be any combination of the following values: + * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode + * @arg DBGMCU_STOP: Keep debugger connection during STOP mode + * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode + * @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted + * @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted + * @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted + * @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted + * @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted + * @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted + * @arg DBGMCU_CAN1_STOP: Debug CAN2 stopped when Core is halted + * @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is halted + * @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is halted + * @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted + * @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted + * @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted + * @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted + * @arg DBGMCU_CAN2_STOP: Debug CAN2 stopped when Core is halted + * @arg DBGMCU_TIM15_STOP: TIM15 counter stopped when Core is halted + * @arg DBGMCU_TIM16_STOP: TIM16 counter stopped when Core is halted + * @arg DBGMCU_TIM17_STOP: TIM17 counter stopped when Core is halted + * @arg DBGMCU_TIM9_STOP: TIM9 counter stopped when Core is halted + * @arg DBGMCU_TIM10_STOP: TIM10 counter stopped when Core is halted + * @arg DBGMCU_TIM11_STOP: TIM11 counter stopped when Core is halted + * @arg DBGMCU_TIM12_STOP: TIM12 counter stopped when Core is halted + * @arg DBGMCU_TIM13_STOP: TIM13 counter stopped when Core is halted + * @arg DBGMCU_TIM14_STOP: TIM14 counter stopped when Core is halted + * @param NewState: new state of the specified peripheral in Debug mode. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + DBGMCU->CR |= DBGMCU_Periph; + } + else + { + DBGMCU->CR &= ~DBGMCU_Periph; + } +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c new file mode 100644 index 0000000..2d73c8a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c @@ -0,0 +1,712 @@ +/** + ****************************************************************************** + * @file stm32f10x_dma.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the DMA firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_dma.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup DMA + * @brief DMA driver modules + * @{ + */ + +/** @defgroup DMA_Private_TypesDefinitions + * @{ + */ +/** + * @} + */ + +/** @defgroup DMA_Private_Defines + * @{ + */ + + +/* DMA1 Channelx interrupt pending bit masks */ +#define DMA1_Channel1_IT_Mask ((uint32_t)(DMA_ISR_GIF1 | DMA_ISR_TCIF1 | DMA_ISR_HTIF1 | DMA_ISR_TEIF1)) +#define DMA1_Channel2_IT_Mask ((uint32_t)(DMA_ISR_GIF2 | DMA_ISR_TCIF2 | DMA_ISR_HTIF2 | DMA_ISR_TEIF2)) +#define DMA1_Channel3_IT_Mask ((uint32_t)(DMA_ISR_GIF3 | DMA_ISR_TCIF3 | DMA_ISR_HTIF3 | DMA_ISR_TEIF3)) +#define DMA1_Channel4_IT_Mask ((uint32_t)(DMA_ISR_GIF4 | DMA_ISR_TCIF4 | DMA_ISR_HTIF4 | DMA_ISR_TEIF4)) +#define DMA1_Channel5_IT_Mask ((uint32_t)(DMA_ISR_GIF5 | DMA_ISR_TCIF5 | DMA_ISR_HTIF5 | DMA_ISR_TEIF5)) +#define DMA1_Channel6_IT_Mask ((uint32_t)(DMA_ISR_GIF6 | DMA_ISR_TCIF6 | DMA_ISR_HTIF6 | DMA_ISR_TEIF6)) +#define DMA1_Channel7_IT_Mask ((uint32_t)(DMA_ISR_GIF7 | DMA_ISR_TCIF7 | DMA_ISR_HTIF7 | DMA_ISR_TEIF7)) + +/* DMA2 Channelx interrupt pending bit masks */ +#define DMA2_Channel1_IT_Mask ((uint32_t)(DMA_ISR_GIF1 | DMA_ISR_TCIF1 | DMA_ISR_HTIF1 | DMA_ISR_TEIF1)) +#define DMA2_Channel2_IT_Mask ((uint32_t)(DMA_ISR_GIF2 | DMA_ISR_TCIF2 | DMA_ISR_HTIF2 | DMA_ISR_TEIF2)) +#define DMA2_Channel3_IT_Mask ((uint32_t)(DMA_ISR_GIF3 | DMA_ISR_TCIF3 | DMA_ISR_HTIF3 | DMA_ISR_TEIF3)) +#define DMA2_Channel4_IT_Mask ((uint32_t)(DMA_ISR_GIF4 | DMA_ISR_TCIF4 | DMA_ISR_HTIF4 | DMA_ISR_TEIF4)) +#define DMA2_Channel5_IT_Mask ((uint32_t)(DMA_ISR_GIF5 | DMA_ISR_TCIF5 | DMA_ISR_HTIF5 | DMA_ISR_TEIF5)) + +/* DMA2 FLAG mask */ +#define FLAG_Mask ((uint32_t)0x10000000) + +/* DMA registers Masks */ +#define CCR_CLEAR_Mask ((uint32_t)0xFFFF800F) + +/** + * @} + */ + +/** @defgroup DMA_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup DMA_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup DMA_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup DMA_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the DMAy Channelx registers to their default reset + * values. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @retval None + */ +void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx) +{ + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + + /* Disable the selected DMAy Channelx */ + DMAy_Channelx->CCR &= (uint16_t)(~DMA_CCR1_EN); + + /* Reset DMAy Channelx control register */ + DMAy_Channelx->CCR = 0; + + /* Reset DMAy Channelx remaining bytes register */ + DMAy_Channelx->CNDTR = 0; + + /* Reset DMAy Channelx peripheral address register */ + DMAy_Channelx->CPAR = 0; + + /* Reset DMAy Channelx memory address register */ + DMAy_Channelx->CMAR = 0; + + if (DMAy_Channelx == DMA1_Channel1) + { + /* Reset interrupt pending bits for DMA1 Channel1 */ + DMA1->IFCR |= DMA1_Channel1_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel2) + { + /* Reset interrupt pending bits for DMA1 Channel2 */ + DMA1->IFCR |= DMA1_Channel2_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel3) + { + /* Reset interrupt pending bits for DMA1 Channel3 */ + DMA1->IFCR |= DMA1_Channel3_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel4) + { + /* Reset interrupt pending bits for DMA1 Channel4 */ + DMA1->IFCR |= DMA1_Channel4_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel5) + { + /* Reset interrupt pending bits for DMA1 Channel5 */ + DMA1->IFCR |= DMA1_Channel5_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel6) + { + /* Reset interrupt pending bits for DMA1 Channel6 */ + DMA1->IFCR |= DMA1_Channel6_IT_Mask; + } + else if (DMAy_Channelx == DMA1_Channel7) + { + /* Reset interrupt pending bits for DMA1 Channel7 */ + DMA1->IFCR |= DMA1_Channel7_IT_Mask; + } + else if (DMAy_Channelx == DMA2_Channel1) + { + /* Reset interrupt pending bits for DMA2 Channel1 */ + DMA2->IFCR |= DMA2_Channel1_IT_Mask; + } + else if (DMAy_Channelx == DMA2_Channel2) + { + /* Reset interrupt pending bits for DMA2 Channel2 */ + DMA2->IFCR |= DMA2_Channel2_IT_Mask; + } + else if (DMAy_Channelx == DMA2_Channel3) + { + /* Reset interrupt pending bits for DMA2 Channel3 */ + DMA2->IFCR |= DMA2_Channel3_IT_Mask; + } + else if (DMAy_Channelx == DMA2_Channel4) + { + /* Reset interrupt pending bits for DMA2 Channel4 */ + DMA2->IFCR |= DMA2_Channel4_IT_Mask; + } + else + { + if (DMAy_Channelx == DMA2_Channel5) + { + /* Reset interrupt pending bits for DMA2 Channel5 */ + DMA2->IFCR |= DMA2_Channel5_IT_Mask; + } + } +} + +/** + * @brief Initializes the DMAy Channelx according to the specified + * parameters in the DMA_InitStruct. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @param DMA_InitStruct: pointer to a DMA_InitTypeDef structure that + * contains the configuration information for the specified DMA Channel. + * @retval None + */ +void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + assert_param(IS_DMA_DIR(DMA_InitStruct->DMA_DIR)); + assert_param(IS_DMA_BUFFER_SIZE(DMA_InitStruct->DMA_BufferSize)); + assert_param(IS_DMA_PERIPHERAL_INC_STATE(DMA_InitStruct->DMA_PeripheralInc)); + assert_param(IS_DMA_MEMORY_INC_STATE(DMA_InitStruct->DMA_MemoryInc)); + assert_param(IS_DMA_PERIPHERAL_DATA_SIZE(DMA_InitStruct->DMA_PeripheralDataSize)); + assert_param(IS_DMA_MEMORY_DATA_SIZE(DMA_InitStruct->DMA_MemoryDataSize)); + assert_param(IS_DMA_MODE(DMA_InitStruct->DMA_Mode)); + assert_param(IS_DMA_PRIORITY(DMA_InitStruct->DMA_Priority)); + assert_param(IS_DMA_M2M_STATE(DMA_InitStruct->DMA_M2M)); + +/*--------------------------- DMAy Channelx CCR Configuration -----------------*/ + /* Get the DMAy_Channelx CCR value */ + tmpreg = DMAy_Channelx->CCR; + /* Clear MEM2MEM, PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */ + tmpreg &= CCR_CLEAR_Mask; + /* Configure DMAy Channelx: data transfer, data size, priority level and mode */ + /* Set DIR bit according to DMA_DIR value */ + /* Set CIRC bit according to DMA_Mode value */ + /* Set PINC bit according to DMA_PeripheralInc value */ + /* Set MINC bit according to DMA_MemoryInc value */ + /* Set PSIZE bits according to DMA_PeripheralDataSize value */ + /* Set MSIZE bits according to DMA_MemoryDataSize value */ + /* Set PL bits according to DMA_Priority value */ + /* Set the MEM2MEM bit according to DMA_M2M value */ + tmpreg |= DMA_InitStruct->DMA_DIR | DMA_InitStruct->DMA_Mode | + DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | + DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | + DMA_InitStruct->DMA_Priority | DMA_InitStruct->DMA_M2M; + + /* Write to DMAy Channelx CCR */ + DMAy_Channelx->CCR = tmpreg; + +/*--------------------------- DMAy Channelx CNDTR Configuration ---------------*/ + /* Write to DMAy Channelx CNDTR */ + DMAy_Channelx->CNDTR = DMA_InitStruct->DMA_BufferSize; + +/*--------------------------- DMAy Channelx CPAR Configuration ----------------*/ + /* Write to DMAy Channelx CPAR */ + DMAy_Channelx->CPAR = DMA_InitStruct->DMA_PeripheralBaseAddr; + +/*--------------------------- DMAy Channelx CMAR Configuration ----------------*/ + /* Write to DMAy Channelx CMAR */ + DMAy_Channelx->CMAR = DMA_InitStruct->DMA_MemoryBaseAddr; +} + +/** + * @brief Fills each DMA_InitStruct member with its default value. + * @param DMA_InitStruct : pointer to a DMA_InitTypeDef structure which will + * be initialized. + * @retval None + */ +void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct) +{ +/*-------------- Reset DMA init structure parameters values ------------------*/ + /* Initialize the DMA_PeripheralBaseAddr member */ + DMA_InitStruct->DMA_PeripheralBaseAddr = 0; + /* Initialize the DMA_MemoryBaseAddr member */ + DMA_InitStruct->DMA_MemoryBaseAddr = 0; + /* Initialize the DMA_DIR member */ + DMA_InitStruct->DMA_DIR = DMA_DIR_PeripheralSRC; + /* Initialize the DMA_BufferSize member */ + DMA_InitStruct->DMA_BufferSize = 0; + /* Initialize the DMA_PeripheralInc member */ + DMA_InitStruct->DMA_PeripheralInc = DMA_PeripheralInc_Disable; + /* Initialize the DMA_MemoryInc member */ + DMA_InitStruct->DMA_MemoryInc = DMA_MemoryInc_Disable; + /* Initialize the DMA_PeripheralDataSize member */ + DMA_InitStruct->DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; + /* Initialize the DMA_MemoryDataSize member */ + DMA_InitStruct->DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; + /* Initialize the DMA_Mode member */ + DMA_InitStruct->DMA_Mode = DMA_Mode_Normal; + /* Initialize the DMA_Priority member */ + DMA_InitStruct->DMA_Priority = DMA_Priority_Low; + /* Initialize the DMA_M2M member */ + DMA_InitStruct->DMA_M2M = DMA_M2M_Disable; +} + +/** + * @brief Enables or disables the specified DMAy Channelx. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @param NewState: new state of the DMAy Channelx. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected DMAy Channelx */ + DMAy_Channelx->CCR |= DMA_CCR1_EN; + } + else + { + /* Disable the selected DMAy Channelx */ + DMAy_Channelx->CCR &= (uint16_t)(~DMA_CCR1_EN); + } +} + +/** + * @brief Enables or disables the specified DMAy Channelx interrupts. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @param DMA_IT: specifies the DMA interrupts sources to be enabled + * or disabled. + * This parameter can be any combination of the following values: + * @arg DMA_IT_TC: Transfer complete interrupt mask + * @arg DMA_IT_HT: Half transfer interrupt mask + * @arg DMA_IT_TE: Transfer error interrupt mask + * @param NewState: new state of the specified DMA interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + assert_param(IS_DMA_CONFIG_IT(DMA_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected DMA interrupts */ + DMAy_Channelx->CCR |= DMA_IT; + } + else + { + /* Disable the selected DMA interrupts */ + DMAy_Channelx->CCR &= ~DMA_IT; + } +} + +/** + * @brief Sets the number of data units in the current DMAy Channelx transfer. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @param DataNumber: The number of data units in the current DMAy Channelx + * transfer. + * @note This function can only be used when the DMAy_Channelx is disabled. + * @retval None. + */ +void DMA_SetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx, uint16_t DataNumber) +{ + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + +/*--------------------------- DMAy Channelx CNDTR Configuration ---------------*/ + /* Write to DMAy Channelx CNDTR */ + DMAy_Channelx->CNDTR = DataNumber; +} + +/** + * @brief Returns the number of remaining data units in the current + * DMAy Channelx transfer. + * @param DMAy_Channelx: where y can be 1 or 2 to select the DMA and + * x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. + * @retval The number of remaining data units in the current DMAy Channelx + * transfer. + */ +uint16_t DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx) +{ + /* Check the parameters */ + assert_param(IS_DMA_ALL_PERIPH(DMAy_Channelx)); + /* Return the number of remaining data units for DMAy Channelx */ + return ((uint16_t)(DMAy_Channelx->CNDTR)); +} + +/** + * @brief Checks whether the specified DMAy Channelx flag is set or not. + * @param DMAy_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg DMA1_FLAG_GL1: DMA1 Channel1 global flag. + * @arg DMA1_FLAG_TC1: DMA1 Channel1 transfer complete flag. + * @arg DMA1_FLAG_HT1: DMA1 Channel1 half transfer flag. + * @arg DMA1_FLAG_TE1: DMA1 Channel1 transfer error flag. + * @arg DMA1_FLAG_GL2: DMA1 Channel2 global flag. + * @arg DMA1_FLAG_TC2: DMA1 Channel2 transfer complete flag. + * @arg DMA1_FLAG_HT2: DMA1 Channel2 half transfer flag. + * @arg DMA1_FLAG_TE2: DMA1 Channel2 transfer error flag. + * @arg DMA1_FLAG_GL3: DMA1 Channel3 global flag. + * @arg DMA1_FLAG_TC3: DMA1 Channel3 transfer complete flag. + * @arg DMA1_FLAG_HT3: DMA1 Channel3 half transfer flag. + * @arg DMA1_FLAG_TE3: DMA1 Channel3 transfer error flag. + * @arg DMA1_FLAG_GL4: DMA1 Channel4 global flag. + * @arg DMA1_FLAG_TC4: DMA1 Channel4 transfer complete flag. + * @arg DMA1_FLAG_HT4: DMA1 Channel4 half transfer flag. + * @arg DMA1_FLAG_TE4: DMA1 Channel4 transfer error flag. + * @arg DMA1_FLAG_GL5: DMA1 Channel5 global flag. + * @arg DMA1_FLAG_TC5: DMA1 Channel5 transfer complete flag. + * @arg DMA1_FLAG_HT5: DMA1 Channel5 half transfer flag. + * @arg DMA1_FLAG_TE5: DMA1 Channel5 transfer error flag. + * @arg DMA1_FLAG_GL6: DMA1 Channel6 global flag. + * @arg DMA1_FLAG_TC6: DMA1 Channel6 transfer complete flag. + * @arg DMA1_FLAG_HT6: DMA1 Channel6 half transfer flag. + * @arg DMA1_FLAG_TE6: DMA1 Channel6 transfer error flag. + * @arg DMA1_FLAG_GL7: DMA1 Channel7 global flag. + * @arg DMA1_FLAG_TC7: DMA1 Channel7 transfer complete flag. + * @arg DMA1_FLAG_HT7: DMA1 Channel7 half transfer flag. + * @arg DMA1_FLAG_TE7: DMA1 Channel7 transfer error flag. + * @arg DMA2_FLAG_GL1: DMA2 Channel1 global flag. + * @arg DMA2_FLAG_TC1: DMA2 Channel1 transfer complete flag. + * @arg DMA2_FLAG_HT1: DMA2 Channel1 half transfer flag. + * @arg DMA2_FLAG_TE1: DMA2 Channel1 transfer error flag. + * @arg DMA2_FLAG_GL2: DMA2 Channel2 global flag. + * @arg DMA2_FLAG_TC2: DMA2 Channel2 transfer complete flag. + * @arg DMA2_FLAG_HT2: DMA2 Channel2 half transfer flag. + * @arg DMA2_FLAG_TE2: DMA2 Channel2 transfer error flag. + * @arg DMA2_FLAG_GL3: DMA2 Channel3 global flag. + * @arg DMA2_FLAG_TC3: DMA2 Channel3 transfer complete flag. + * @arg DMA2_FLAG_HT3: DMA2 Channel3 half transfer flag. + * @arg DMA2_FLAG_TE3: DMA2 Channel3 transfer error flag. + * @arg DMA2_FLAG_GL4: DMA2 Channel4 global flag. + * @arg DMA2_FLAG_TC4: DMA2 Channel4 transfer complete flag. + * @arg DMA2_FLAG_HT4: DMA2 Channel4 half transfer flag. + * @arg DMA2_FLAG_TE4: DMA2 Channel4 transfer error flag. + * @arg DMA2_FLAG_GL5: DMA2 Channel5 global flag. + * @arg DMA2_FLAG_TC5: DMA2 Channel5 transfer complete flag. + * @arg DMA2_FLAG_HT5: DMA2 Channel5 half transfer flag. + * @arg DMA2_FLAG_TE5: DMA2 Channel5 transfer error flag. + * @retval The new state of DMAy_FLAG (SET or RESET). + */ +FlagStatus DMA_GetFlagStatus(uint32_t DMAy_FLAG) +{ + FlagStatus bitstatus = RESET; + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_DMA_GET_FLAG(DMAy_FLAG)); + + /* Calculate the used DMAy */ + if ((DMAy_FLAG & FLAG_Mask) != (uint32_t)RESET) + { + /* Get DMA2 ISR register value */ + tmpreg = DMA2->ISR ; + } + else + { + /* Get DMA1 ISR register value */ + tmpreg = DMA1->ISR ; + } + + /* Check the status of the specified DMAy flag */ + if ((tmpreg & DMAy_FLAG) != (uint32_t)RESET) + { + /* DMAy_FLAG is set */ + bitstatus = SET; + } + else + { + /* DMAy_FLAG is reset */ + bitstatus = RESET; + } + + /* Return the DMAy_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the DMAy Channelx's pending flags. + * @param DMAy_FLAG: specifies the flag to clear. + * This parameter can be any combination (for the same DMA) of the following values: + * @arg DMA1_FLAG_GL1: DMA1 Channel1 global flag. + * @arg DMA1_FLAG_TC1: DMA1 Channel1 transfer complete flag. + * @arg DMA1_FLAG_HT1: DMA1 Channel1 half transfer flag. + * @arg DMA1_FLAG_TE1: DMA1 Channel1 transfer error flag. + * @arg DMA1_FLAG_GL2: DMA1 Channel2 global flag. + * @arg DMA1_FLAG_TC2: DMA1 Channel2 transfer complete flag. + * @arg DMA1_FLAG_HT2: DMA1 Channel2 half transfer flag. + * @arg DMA1_FLAG_TE2: DMA1 Channel2 transfer error flag. + * @arg DMA1_FLAG_GL3: DMA1 Channel3 global flag. + * @arg DMA1_FLAG_TC3: DMA1 Channel3 transfer complete flag. + * @arg DMA1_FLAG_HT3: DMA1 Channel3 half transfer flag. + * @arg DMA1_FLAG_TE3: DMA1 Channel3 transfer error flag. + * @arg DMA1_FLAG_GL4: DMA1 Channel4 global flag. + * @arg DMA1_FLAG_TC4: DMA1 Channel4 transfer complete flag. + * @arg DMA1_FLAG_HT4: DMA1 Channel4 half transfer flag. + * @arg DMA1_FLAG_TE4: DMA1 Channel4 transfer error flag. + * @arg DMA1_FLAG_GL5: DMA1 Channel5 global flag. + * @arg DMA1_FLAG_TC5: DMA1 Channel5 transfer complete flag. + * @arg DMA1_FLAG_HT5: DMA1 Channel5 half transfer flag. + * @arg DMA1_FLAG_TE5: DMA1 Channel5 transfer error flag. + * @arg DMA1_FLAG_GL6: DMA1 Channel6 global flag. + * @arg DMA1_FLAG_TC6: DMA1 Channel6 transfer complete flag. + * @arg DMA1_FLAG_HT6: DMA1 Channel6 half transfer flag. + * @arg DMA1_FLAG_TE6: DMA1 Channel6 transfer error flag. + * @arg DMA1_FLAG_GL7: DMA1 Channel7 global flag. + * @arg DMA1_FLAG_TC7: DMA1 Channel7 transfer complete flag. + * @arg DMA1_FLAG_HT7: DMA1 Channel7 half transfer flag. + * @arg DMA1_FLAG_TE7: DMA1 Channel7 transfer error flag. + * @arg DMA2_FLAG_GL1: DMA2 Channel1 global flag. + * @arg DMA2_FLAG_TC1: DMA2 Channel1 transfer complete flag. + * @arg DMA2_FLAG_HT1: DMA2 Channel1 half transfer flag. + * @arg DMA2_FLAG_TE1: DMA2 Channel1 transfer error flag. + * @arg DMA2_FLAG_GL2: DMA2 Channel2 global flag. + * @arg DMA2_FLAG_TC2: DMA2 Channel2 transfer complete flag. + * @arg DMA2_FLAG_HT2: DMA2 Channel2 half transfer flag. + * @arg DMA2_FLAG_TE2: DMA2 Channel2 transfer error flag. + * @arg DMA2_FLAG_GL3: DMA2 Channel3 global flag. + * @arg DMA2_FLAG_TC3: DMA2 Channel3 transfer complete flag. + * @arg DMA2_FLAG_HT3: DMA2 Channel3 half transfer flag. + * @arg DMA2_FLAG_TE3: DMA2 Channel3 transfer error flag. + * @arg DMA2_FLAG_GL4: DMA2 Channel4 global flag. + * @arg DMA2_FLAG_TC4: DMA2 Channel4 transfer complete flag. + * @arg DMA2_FLAG_HT4: DMA2 Channel4 half transfer flag. + * @arg DMA2_FLAG_TE4: DMA2 Channel4 transfer error flag. + * @arg DMA2_FLAG_GL5: DMA2 Channel5 global flag. + * @arg DMA2_FLAG_TC5: DMA2 Channel5 transfer complete flag. + * @arg DMA2_FLAG_HT5: DMA2 Channel5 half transfer flag. + * @arg DMA2_FLAG_TE5: DMA2 Channel5 transfer error flag. + * @retval None + */ +void DMA_ClearFlag(uint32_t DMAy_FLAG) +{ + /* Check the parameters */ + assert_param(IS_DMA_CLEAR_FLAG(DMAy_FLAG)); + + /* Calculate the used DMAy */ + if ((DMAy_FLAG & FLAG_Mask) != (uint32_t)RESET) + { + /* Clear the selected DMAy flags */ + DMA2->IFCR = DMAy_FLAG; + } + else + { + /* Clear the selected DMAy flags */ + DMA1->IFCR = DMAy_FLAG; + } +} + +/** + * @brief Checks whether the specified DMAy Channelx interrupt has occurred or not. + * @param DMAy_IT: specifies the DMAy interrupt source to check. + * This parameter can be one of the following values: + * @arg DMA1_IT_GL1: DMA1 Channel1 global interrupt. + * @arg DMA1_IT_TC1: DMA1 Channel1 transfer complete interrupt. + * @arg DMA1_IT_HT1: DMA1 Channel1 half transfer interrupt. + * @arg DMA1_IT_TE1: DMA1 Channel1 transfer error interrupt. + * @arg DMA1_IT_GL2: DMA1 Channel2 global interrupt. + * @arg DMA1_IT_TC2: DMA1 Channel2 transfer complete interrupt. + * @arg DMA1_IT_HT2: DMA1 Channel2 half transfer interrupt. + * @arg DMA1_IT_TE2: DMA1 Channel2 transfer error interrupt. + * @arg DMA1_IT_GL3: DMA1 Channel3 global interrupt. + * @arg DMA1_IT_TC3: DMA1 Channel3 transfer complete interrupt. + * @arg DMA1_IT_HT3: DMA1 Channel3 half transfer interrupt. + * @arg DMA1_IT_TE3: DMA1 Channel3 transfer error interrupt. + * @arg DMA1_IT_GL4: DMA1 Channel4 global interrupt. + * @arg DMA1_IT_TC4: DMA1 Channel4 transfer complete interrupt. + * @arg DMA1_IT_HT4: DMA1 Channel4 half transfer interrupt. + * @arg DMA1_IT_TE4: DMA1 Channel4 transfer error interrupt. + * @arg DMA1_IT_GL5: DMA1 Channel5 global interrupt. + * @arg DMA1_IT_TC5: DMA1 Channel5 transfer complete interrupt. + * @arg DMA1_IT_HT5: DMA1 Channel5 half transfer interrupt. + * @arg DMA1_IT_TE5: DMA1 Channel5 transfer error interrupt. + * @arg DMA1_IT_GL6: DMA1 Channel6 global interrupt. + * @arg DMA1_IT_TC6: DMA1 Channel6 transfer complete interrupt. + * @arg DMA1_IT_HT6: DMA1 Channel6 half transfer interrupt. + * @arg DMA1_IT_TE6: DMA1 Channel6 transfer error interrupt. + * @arg DMA1_IT_GL7: DMA1 Channel7 global interrupt. + * @arg DMA1_IT_TC7: DMA1 Channel7 transfer complete interrupt. + * @arg DMA1_IT_HT7: DMA1 Channel7 half transfer interrupt. + * @arg DMA1_IT_TE7: DMA1 Channel7 transfer error interrupt. + * @arg DMA2_IT_GL1: DMA2 Channel1 global interrupt. + * @arg DMA2_IT_TC1: DMA2 Channel1 transfer complete interrupt. + * @arg DMA2_IT_HT1: DMA2 Channel1 half transfer interrupt. + * @arg DMA2_IT_TE1: DMA2 Channel1 transfer error interrupt. + * @arg DMA2_IT_GL2: DMA2 Channel2 global interrupt. + * @arg DMA2_IT_TC2: DMA2 Channel2 transfer complete interrupt. + * @arg DMA2_IT_HT2: DMA2 Channel2 half transfer interrupt. + * @arg DMA2_IT_TE2: DMA2 Channel2 transfer error interrupt. + * @arg DMA2_IT_GL3: DMA2 Channel3 global interrupt. + * @arg DMA2_IT_TC3: DMA2 Channel3 transfer complete interrupt. + * @arg DMA2_IT_HT3: DMA2 Channel3 half transfer interrupt. + * @arg DMA2_IT_TE3: DMA2 Channel3 transfer error interrupt. + * @arg DMA2_IT_GL4: DMA2 Channel4 global interrupt. + * @arg DMA2_IT_TC4: DMA2 Channel4 transfer complete interrupt. + * @arg DMA2_IT_HT4: DMA2 Channel4 half transfer interrupt. + * @arg DMA2_IT_TE4: DMA2 Channel4 transfer error interrupt. + * @arg DMA2_IT_GL5: DMA2 Channel5 global interrupt. + * @arg DMA2_IT_TC5: DMA2 Channel5 transfer complete interrupt. + * @arg DMA2_IT_HT5: DMA2 Channel5 half transfer interrupt. + * @arg DMA2_IT_TE5: DMA2 Channel5 transfer error interrupt. + * @retval The new state of DMAy_IT (SET or RESET). + */ +ITStatus DMA_GetITStatus(uint32_t DMAy_IT) +{ + ITStatus bitstatus = RESET; + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_DMA_GET_IT(DMAy_IT)); + + /* Calculate the used DMA */ + if ((DMAy_IT & FLAG_Mask) != (uint32_t)RESET) + { + /* Get DMA2 ISR register value */ + tmpreg = DMA2->ISR; + } + else + { + /* Get DMA1 ISR register value */ + tmpreg = DMA1->ISR; + } + + /* Check the status of the specified DMAy interrupt */ + if ((tmpreg & DMAy_IT) != (uint32_t)RESET) + { + /* DMAy_IT is set */ + bitstatus = SET; + } + else + { + /* DMAy_IT is reset */ + bitstatus = RESET; + } + /* Return the DMA_IT status */ + return bitstatus; +} + +/** + * @brief Clears the DMAy Channelx's interrupt pending bits. + * @param DMAy_IT: specifies the DMAy interrupt pending bit to clear. + * This parameter can be any combination (for the same DMA) of the following values: + * @arg DMA1_IT_GL1: DMA1 Channel1 global interrupt. + * @arg DMA1_IT_TC1: DMA1 Channel1 transfer complete interrupt. + * @arg DMA1_IT_HT1: DMA1 Channel1 half transfer interrupt. + * @arg DMA1_IT_TE1: DMA1 Channel1 transfer error interrupt. + * @arg DMA1_IT_GL2: DMA1 Channel2 global interrupt. + * @arg DMA1_IT_TC2: DMA1 Channel2 transfer complete interrupt. + * @arg DMA1_IT_HT2: DMA1 Channel2 half transfer interrupt. + * @arg DMA1_IT_TE2: DMA1 Channel2 transfer error interrupt. + * @arg DMA1_IT_GL3: DMA1 Channel3 global interrupt. + * @arg DMA1_IT_TC3: DMA1 Channel3 transfer complete interrupt. + * @arg DMA1_IT_HT3: DMA1 Channel3 half transfer interrupt. + * @arg DMA1_IT_TE3: DMA1 Channel3 transfer error interrupt. + * @arg DMA1_IT_GL4: DMA1 Channel4 global interrupt. + * @arg DMA1_IT_TC4: DMA1 Channel4 transfer complete interrupt. + * @arg DMA1_IT_HT4: DMA1 Channel4 half transfer interrupt. + * @arg DMA1_IT_TE4: DMA1 Channel4 transfer error interrupt. + * @arg DMA1_IT_GL5: DMA1 Channel5 global interrupt. + * @arg DMA1_IT_TC5: DMA1 Channel5 transfer complete interrupt. + * @arg DMA1_IT_HT5: DMA1 Channel5 half transfer interrupt. + * @arg DMA1_IT_TE5: DMA1 Channel5 transfer error interrupt. + * @arg DMA1_IT_GL6: DMA1 Channel6 global interrupt. + * @arg DMA1_IT_TC6: DMA1 Channel6 transfer complete interrupt. + * @arg DMA1_IT_HT6: DMA1 Channel6 half transfer interrupt. + * @arg DMA1_IT_TE6: DMA1 Channel6 transfer error interrupt. + * @arg DMA1_IT_GL7: DMA1 Channel7 global interrupt. + * @arg DMA1_IT_TC7: DMA1 Channel7 transfer complete interrupt. + * @arg DMA1_IT_HT7: DMA1 Channel7 half transfer interrupt. + * @arg DMA1_IT_TE7: DMA1 Channel7 transfer error interrupt. + * @arg DMA2_IT_GL1: DMA2 Channel1 global interrupt. + * @arg DMA2_IT_TC1: DMA2 Channel1 transfer complete interrupt. + * @arg DMA2_IT_HT1: DMA2 Channel1 half transfer interrupt. + * @arg DMA2_IT_TE1: DMA2 Channel1 transfer error interrupt. + * @arg DMA2_IT_GL2: DMA2 Channel2 global interrupt. + * @arg DMA2_IT_TC2: DMA2 Channel2 transfer complete interrupt. + * @arg DMA2_IT_HT2: DMA2 Channel2 half transfer interrupt. + * @arg DMA2_IT_TE2: DMA2 Channel2 transfer error interrupt. + * @arg DMA2_IT_GL3: DMA2 Channel3 global interrupt. + * @arg DMA2_IT_TC3: DMA2 Channel3 transfer complete interrupt. + * @arg DMA2_IT_HT3: DMA2 Channel3 half transfer interrupt. + * @arg DMA2_IT_TE3: DMA2 Channel3 transfer error interrupt. + * @arg DMA2_IT_GL4: DMA2 Channel4 global interrupt. + * @arg DMA2_IT_TC4: DMA2 Channel4 transfer complete interrupt. + * @arg DMA2_IT_HT4: DMA2 Channel4 half transfer interrupt. + * @arg DMA2_IT_TE4: DMA2 Channel4 transfer error interrupt. + * @arg DMA2_IT_GL5: DMA2 Channel5 global interrupt. + * @arg DMA2_IT_TC5: DMA2 Channel5 transfer complete interrupt. + * @arg DMA2_IT_HT5: DMA2 Channel5 half transfer interrupt. + * @arg DMA2_IT_TE5: DMA2 Channel5 transfer error interrupt. + * @retval None + */ +void DMA_ClearITPendingBit(uint32_t DMAy_IT) +{ + /* Check the parameters */ + assert_param(IS_DMA_CLEAR_IT(DMAy_IT)); + + /* Calculate the used DMAy */ + if ((DMAy_IT & FLAG_Mask) != (uint32_t)RESET) + { + /* Clear the selected DMAy interrupt pending bits */ + DMA2->IFCR = DMAy_IT; + } + else + { + /* Clear the selected DMAy interrupt pending bits */ + DMA1->IFCR = DMAy_IT; + } +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c new file mode 100644 index 0000000..85a81d5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c @@ -0,0 +1,267 @@ +/** + ****************************************************************************** + * @file stm32f10x_exti.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the EXTI firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_exti.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup EXTI + * @brief EXTI driver modules + * @{ + */ + +/** @defgroup EXTI_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup EXTI_Private_Defines + * @{ + */ + +#define EXTI_LINENONE ((uint32_t)0x00000) /* No interrupt selected */ + +/** + * @} + */ + +/** @defgroup EXTI_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup EXTI_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup EXTI_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup EXTI_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the EXTI peripheral registers to their default reset values. + * @param None + * @retval None + */ +void EXTI_DeInit(void) +{ + EXTI->IMR = 0x00000000; + EXTI->EMR = 0x00000000; + EXTI->RTSR = 0x00000000; + EXTI->FTSR = 0x00000000; + EXTI->PR = 0x000FFFFF; +} + +/** + * @brief Initializes the EXTI peripheral according to the specified + * parameters in the EXTI_InitStruct. + * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure + * that contains the configuration information for the EXTI peripheral. + * @retval None + */ +void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct) +{ + uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_EXTI_MODE(EXTI_InitStruct->EXTI_Mode)); + assert_param(IS_EXTI_TRIGGER(EXTI_InitStruct->EXTI_Trigger)); + assert_param(IS_EXTI_LINE(EXTI_InitStruct->EXTI_Line)); + assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->EXTI_LineCmd)); + + tmp = (uint32_t)EXTI_BASE; + + if (EXTI_InitStruct->EXTI_LineCmd != DISABLE) + { + /* Clear EXTI line configuration */ + EXTI->IMR &= ~EXTI_InitStruct->EXTI_Line; + EXTI->EMR &= ~EXTI_InitStruct->EXTI_Line; + + tmp += EXTI_InitStruct->EXTI_Mode; + + *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; + + /* Clear Rising Falling edge configuration */ + EXTI->RTSR &= ~EXTI_InitStruct->EXTI_Line; + EXTI->FTSR &= ~EXTI_InitStruct->EXTI_Line; + + /* Select the trigger for the selected external interrupts */ + if (EXTI_InitStruct->EXTI_Trigger == EXTI_Trigger_Rising_Falling) + { + /* Rising Falling edge */ + EXTI->RTSR |= EXTI_InitStruct->EXTI_Line; + EXTI->FTSR |= EXTI_InitStruct->EXTI_Line; + } + else + { + tmp = (uint32_t)EXTI_BASE; + tmp += EXTI_InitStruct->EXTI_Trigger; + + *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; + } + } + else + { + tmp += EXTI_InitStruct->EXTI_Mode; + + /* Disable the selected external lines */ + *(__IO uint32_t *) tmp &= ~EXTI_InitStruct->EXTI_Line; + } +} + +/** + * @brief Fills each EXTI_InitStruct member with its reset value. + * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure which will + * be initialized. + * @retval None + */ +void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct) +{ + EXTI_InitStruct->EXTI_Line = EXTI_LINENONE; + EXTI_InitStruct->EXTI_Mode = EXTI_Mode_Interrupt; + EXTI_InitStruct->EXTI_Trigger = EXTI_Trigger_Falling; + EXTI_InitStruct->EXTI_LineCmd = DISABLE; +} + +/** + * @brief Generates a Software interrupt. + * @param EXTI_Line: specifies the EXTI lines to be enabled or disabled. + * This parameter can be any combination of EXTI_Linex where x can be (0..19). + * @retval None + */ +void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line) +{ + /* Check the parameters */ + assert_param(IS_EXTI_LINE(EXTI_Line)); + + EXTI->SWIER |= EXTI_Line; +} + +/** + * @brief Checks whether the specified EXTI line flag is set or not. + * @param EXTI_Line: specifies the EXTI line flag to check. + * This parameter can be: + * @arg EXTI_Linex: External interrupt line x where x(0..19) + * @retval The new state of EXTI_Line (SET or RESET). + */ +FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_GET_EXTI_LINE(EXTI_Line)); + + if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the EXTI's line pending flags. + * @param EXTI_Line: specifies the EXTI lines flags to clear. + * This parameter can be any combination of EXTI_Linex where x can be (0..19). + * @retval None + */ +void EXTI_ClearFlag(uint32_t EXTI_Line) +{ + /* Check the parameters */ + assert_param(IS_EXTI_LINE(EXTI_Line)); + + EXTI->PR = EXTI_Line; +} + +/** + * @brief Checks whether the specified EXTI line is asserted or not. + * @param EXTI_Line: specifies the EXTI line to check. + * This parameter can be: + * @arg EXTI_Linex: External interrupt line x where x(0..19) + * @retval The new state of EXTI_Line (SET or RESET). + */ +ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) +{ + ITStatus bitstatus = RESET; + uint32_t enablestatus = 0; + /* Check the parameters */ + assert_param(IS_GET_EXTI_LINE(EXTI_Line)); + + enablestatus = EXTI->IMR & EXTI_Line; + if (((EXTI->PR & EXTI_Line) != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET)) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the EXTI's line pending bits. + * @param EXTI_Line: specifies the EXTI lines to clear. + * This parameter can be any combination of EXTI_Linex where x can be (0..19). + * @retval None + */ +void EXTI_ClearITPendingBit(uint32_t EXTI_Line) +{ + /* Check the parameters */ + assert_param(IS_EXTI_LINE(EXTI_Line)); + + EXTI->PR = EXTI_Line; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c new file mode 100644 index 0000000..9263dbe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c @@ -0,0 +1,1677 @@ +/** + ****************************************************************************** + * @file stm32f10x_flash.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the FLASH firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_flash.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup FLASH + * @brief FLASH driver modules + * @{ + */ + +/** @defgroup FLASH_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup FLASH_Private_Defines + * @{ + */ + +/* Flash Access Control Register bits */ +#define ACR_LATENCY_Mask ((uint32_t)0x00000038) +#define ACR_HLFCYA_Mask ((uint32_t)0xFFFFFFF7) +#define ACR_PRFTBE_Mask ((uint32_t)0xFFFFFFEF) + +/* Flash Access Control Register bits */ +#define ACR_PRFTBS_Mask ((uint32_t)0x00000020) + +/* Flash Control Register bits */ +#define CR_PG_Set ((uint32_t)0x00000001) +#define CR_PG_Reset ((uint32_t)0x00001FFE) +#define CR_PER_Set ((uint32_t)0x00000002) +#define CR_PER_Reset ((uint32_t)0x00001FFD) +#define CR_MER_Set ((uint32_t)0x00000004) +#define CR_MER_Reset ((uint32_t)0x00001FFB) +#define CR_OPTPG_Set ((uint32_t)0x00000010) +#define CR_OPTPG_Reset ((uint32_t)0x00001FEF) +#define CR_OPTER_Set ((uint32_t)0x00000020) +#define CR_OPTER_Reset ((uint32_t)0x00001FDF) +#define CR_STRT_Set ((uint32_t)0x00000040) +#define CR_LOCK_Set ((uint32_t)0x00000080) + +/* 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) +#define OB_USER_BFB2 ((uint16_t)0x0008) + +/* FLASH BANK address */ +#define FLASH_BANK1_END_ADDRESS ((uint32_t)0x807FFFF) + +/* Delay definition */ +#define EraseTimeout ((uint32_t)0x000B0000) +#define ProgramTimeout ((uint32_t)0x00002000) +/** + * @} + */ + +/** @defgroup FLASH_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup FLASH_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup FLASH_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup FLASH_Private_Functions + * @{ + */ + +/** +@code + + This driver provides functions to configure and program the Flash memory of all STM32F10x devices, + including the latest STM32F10x_XL density devices. + + STM32F10x_XL devices feature up to 1 Mbyte with dual bank architecture for read-while-write (RWW) capability: + - bank1: fixed size of 512 Kbytes (256 pages of 2Kbytes each) + - bank2: up to 512 Kbytes (up to 256 pages of 2Kbytes each) + While other STM32F10x devices features only one bank with memory up to 512 Kbytes. + + In version V3.3.0, some functions were updated and new ones were added to support + STM32F10x_XL devices. Thus some functions manages all devices, while other are + dedicated for XL devices only. + + The table below presents the list of available functions depending on the used STM32F10x devices. + + *************************************************** + * Legacy functions used for all STM32F10x devices * + *************************************************** + +----------------------------------------------------------------------------------------------------------------------------------+ + | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | + | | devices | devices | | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_SetLatency | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_HalfCycleAccessCmd | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_PrefetchBufferCmd | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_Unlock | Yes | Yes | - For STM32F10X_XL devices: unlock Bank1 and Bank2. | + | | | | - For other devices: unlock Bank1 and it is equivalent | + | | | | to FLASH_UnlockBank1 function. | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_Lock | Yes | Yes | - For STM32F10X_XL devices: lock Bank1 and Bank2. | + | | | | - For other devices: lock Bank1 and it is equivalent | + | | | | to FLASH_LockBank1 function. | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ErasePage | Yes | Yes | - For STM32F10x_XL devices: erase a page in Bank1 and Bank2 | + | | | | - For other devices: erase a page in Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_EraseAllPages | Yes | Yes | - For STM32F10x_XL devices: erase all pages in Bank1 and Bank2 | + | | | | - For other devices: erase all pages in Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_EraseOptionBytes | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ProgramWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ProgramHalfWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ProgramOptionByteData | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_EnableWriteProtection | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ReadOutProtection | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_UserOptionByteConfig | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetUserOptionByte | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetWriteProtectionOptionByte | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetReadOutProtectionStatus | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetPrefetchBufferStatus | Yes | Yes | No change | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ITConfig | Yes | Yes | - For STM32F10x_XL devices: enable Bank1 and Bank2's interrupts| + | | | | - For other devices: enable Bank1's interrupts | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetFlagStatus | Yes | Yes | - For STM32F10x_XL devices: return Bank1 and Bank2's flag status| + | | | | - For other devices: return Bank1's flag status | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_ClearFlag | Yes | Yes | - For STM32F10x_XL devices: clear Bank1 and Bank2's flag | + | | | | - For other devices: clear Bank1's flag | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_GetStatus | Yes | Yes | - Return the status of Bank1 (for all devices) | + | | | | equivalent to FLASH_GetBank1Status function | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_WaitForLastOperation | Yes | Yes | - Wait for Bank1 last operation (for all devices) | + | | | | equivalent to: FLASH_WaitForLastBank1Operation function | + +----------------------------------------------------------------------------------------------------------------------------------+ + + ************************************************************************************************************************ + * New functions used for all STM32F10x devices to manage Bank1: * + * - These functions are mainly useful for STM32F10x_XL density devices, to have separate control for Bank1 and bank2 * + * - For other devices, these functions are optional (covered by functions listed above) * + ************************************************************************************************************************ + +----------------------------------------------------------------------------------------------------------------------------------+ + | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | + | | devices | devices | | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_UnlockBank1 | Yes | Yes | - Unlock Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_LockBank1 | Yes | Yes | - Lock Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_EraseAllBank1Pages | Yes | Yes | - Erase all pages in Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_GetBank1Status | Yes | Yes | - Return the status of Bank1 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_WaitForLastBank1Operation | Yes | Yes | - Wait for Bank1 last operation | + +----------------------------------------------------------------------------------------------------------------------------------+ + + ***************************************************************************** + * New Functions used only with STM32F10x_XL density devices to manage Bank2 * + ***************************************************************************** + +----------------------------------------------------------------------------------------------------------------------------------+ + | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | + | | devices | devices | | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_UnlockBank2 | Yes | No | - Unlock Bank2 | + |----------------------------------------------------------------------------------------------------------------------------------| + |FLASH_LockBank2 | Yes | No | - Lock Bank2 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_EraseAllBank2Pages | Yes | No | - Erase all pages in Bank2 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_GetBank2Status | Yes | No | - Return the status of Bank2 | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_WaitForLastBank2Operation | Yes | No | - Wait for Bank2 last operation | + |----------------------------------------------------------------------------------------------------------------------------------| + | FLASH_BootConfig | Yes | No | - Configure to boot from Bank1 or Bank2 | + +----------------------------------------------------------------------------------------------------------------------------------+ +@endcode +*/ + + +/** + * @brief Sets the code latency value. + * @note This function can be used for all STM32F10x devices. + * @param FLASH_Latency: specifies the FLASH Latency value. + * This parameter can be one of the following values: + * @arg FLASH_Latency_0: FLASH Zero Latency cycle + * @arg FLASH_Latency_1: FLASH One Latency cycle + * @arg FLASH_Latency_2: FLASH Two Latency cycles + * @retval None + */ +void FLASH_SetLatency(uint32_t FLASH_Latency) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_FLASH_LATENCY(FLASH_Latency)); + + /* Read the ACR register */ + tmpreg = FLASH->ACR; + + /* Sets the Latency value */ + tmpreg &= ACR_LATENCY_Mask; + tmpreg |= FLASH_Latency; + + /* Write the ACR register */ + FLASH->ACR = tmpreg; +} + +/** + * @brief Enables or disables the Half cycle flash access. + * @note This function can be used for all STM32F10x devices. + * @param FLASH_HalfCycleAccess: specifies the FLASH Half cycle Access mode. + * This parameter can be one of the following values: + * @arg FLASH_HalfCycleAccess_Enable: FLASH Half Cycle Enable + * @arg FLASH_HalfCycleAccess_Disable: FLASH Half Cycle Disable + * @retval None + */ +void FLASH_HalfCycleAccessCmd(uint32_t FLASH_HalfCycleAccess) +{ + /* Check the parameters */ + assert_param(IS_FLASH_HALFCYCLEACCESS_STATE(FLASH_HalfCycleAccess)); + + /* Enable or disable the Half cycle access */ + FLASH->ACR &= ACR_HLFCYA_Mask; + FLASH->ACR |= FLASH_HalfCycleAccess; +} + +/** + * @brief Enables or disables the Prefetch Buffer. + * @note This function can be used for all STM32F10x devices. + * @param FLASH_PrefetchBuffer: specifies the Prefetch buffer status. + * This parameter can be one of the following values: + * @arg FLASH_PrefetchBuffer_Enable: FLASH Prefetch Buffer Enable + * @arg FLASH_PrefetchBuffer_Disable: FLASH Prefetch Buffer Disable + * @retval None + */ +void FLASH_PrefetchBufferCmd(uint32_t FLASH_PrefetchBuffer) +{ + /* Check the parameters */ + assert_param(IS_FLASH_PREFETCHBUFFER_STATE(FLASH_PrefetchBuffer)); + + /* Enable or disable the Prefetch Buffer */ + FLASH->ACR &= ACR_PRFTBE_Mask; + FLASH->ACR |= FLASH_PrefetchBuffer; +} + +/** + * @brief Unlocks the FLASH Program Erase Controller. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices this function unlocks Bank1 and Bank2. + * - For all other devices it unlocks Bank1 and it is equivalent + * to FLASH_UnlockBank1 function.. + * @param None + * @retval None + */ +void FLASH_Unlock(void) +{ + /* Authorize the FPEC of Bank1 Access */ + FLASH->KEYR = FLASH_KEY1; + FLASH->KEYR = FLASH_KEY2; + +#ifdef STM32F10X_XL + /* Authorize the FPEC of Bank2 Access */ + FLASH->KEYR2 = FLASH_KEY1; + FLASH->KEYR2 = FLASH_KEY2; +#endif /* STM32F10X_XL */ +} +/** + * @brief Unlocks the FLASH Bank1 Program Erase Controller. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices this function unlocks Bank1. + * - For all other devices it unlocks Bank1 and it is + * equivalent to FLASH_Unlock function. + * @param None + * @retval None + */ +void FLASH_UnlockBank1(void) +{ + /* Authorize the FPEC of Bank1 Access */ + FLASH->KEYR = FLASH_KEY1; + FLASH->KEYR = FLASH_KEY2; +} + +#ifdef STM32F10X_XL +/** + * @brief Unlocks the FLASH Bank2 Program Erase Controller. + * @note This function can be used only for STM32F10X_XL density devices. + * @param None + * @retval None + */ +void FLASH_UnlockBank2(void) +{ + /* Authorize the FPEC of Bank2 Access */ + FLASH->KEYR2 = FLASH_KEY1; + FLASH->KEYR2 = FLASH_KEY2; + +} +#endif /* STM32F10X_XL */ + +/** + * @brief Locks the FLASH Program Erase Controller. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices this function Locks Bank1 and Bank2. + * - For all other devices it Locks Bank1 and it is equivalent + * to FLASH_LockBank1 function. + * @param None + * @retval None + */ +void FLASH_Lock(void) +{ + /* Set the Lock Bit to lock the FPEC and the CR of Bank1 */ + FLASH->CR |= CR_LOCK_Set; + +#ifdef STM32F10X_XL + /* Set the Lock Bit to lock the FPEC and the CR of Bank2 */ + FLASH->CR2 |= CR_LOCK_Set; +#endif /* STM32F10X_XL */ +} + +/** + * @brief Locks the FLASH Bank1 Program Erase Controller. + * @note this function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices this function Locks Bank1. + * - For all other devices it Locks Bank1 and it is equivalent + * to FLASH_Lock function. + * @param None + * @retval None + */ +void FLASH_LockBank1(void) +{ + /* Set the Lock Bit to lock the FPEC and the CR of Bank1 */ + FLASH->CR |= CR_LOCK_Set; +} + +#ifdef STM32F10X_XL +/** + * @brief Locks the FLASH Bank2 Program Erase Controller. + * @note This function can be used only for STM32F10X_XL density devices. + * @param None + * @retval None + */ +void FLASH_LockBank2(void) +{ + /* Set the Lock Bit to lock the FPEC and the CR of Bank2 */ + FLASH->CR2 |= CR_LOCK_Set; +} +#endif /* STM32F10X_XL */ + +/** + * @brief Erases a specified FLASH page. + * @note This function can be used for all STM32F10x devices. + * @param Page_Address: The page address to be erased. + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ErasePage(uint32_t Page_Address) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + assert_param(IS_FLASH_ADDRESS(Page_Address)); + +#ifdef STM32F10X_XL + if(Page_Address < FLASH_BANK1_END_ADDRESS) + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase the page */ + FLASH->CR|= CR_PER_Set; + FLASH->AR = Page_Address; + FLASH->CR|= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + + /* Disable the PER Bit */ + FLASH->CR &= CR_PER_Reset; + } + } + else + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase the page */ + FLASH->CR2|= CR_PER_Set; + FLASH->AR2 = Page_Address; + FLASH->CR2|= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(EraseTimeout); + + /* Disable the PER Bit */ + FLASH->CR2 &= CR_PER_Reset; + } + } +#else + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase the page */ + FLASH->CR|= CR_PER_Set; + FLASH->AR = Page_Address; + FLASH->CR|= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + /* Disable the PER Bit */ + FLASH->CR &= CR_PER_Reset; + } +#endif /* STM32F10X_XL */ + + /* Return the Erase Status */ + return status; +} + +/** + * @brief Erases all FLASH pages. + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_EraseAllPages(void) +{ + FLASH_Status status = FLASH_COMPLETE; + +#ifdef STM32F10X_XL + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase all pages */ + FLASH->CR |= CR_MER_Set; + FLASH->CR |= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + + /* Disable the MER Bit */ + FLASH->CR &= CR_MER_Reset; + } + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase all pages */ + FLASH->CR2 |= CR_MER_Set; + FLASH->CR2 |= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(EraseTimeout); + + /* Disable the MER Bit */ + FLASH->CR2 &= CR_MER_Reset; + } +#else + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase all pages */ + FLASH->CR |= CR_MER_Set; + FLASH->CR |= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + /* Disable the MER Bit */ + FLASH->CR &= CR_MER_Reset; + } +#endif /* STM32F10X_XL */ + + /* Return the Erase Status */ + return status; +} + +/** + * @brief Erases all Bank1 FLASH pages. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices this function erases all Bank1 pages. + * - For all other devices it erases all Bank1 pages and it is equivalent + * to FLASH_EraseAllPages function. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_EraseAllBank1Pages(void) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase all pages */ + FLASH->CR |= CR_MER_Set; + FLASH->CR |= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(EraseTimeout); + + /* Disable the MER Bit */ + FLASH->CR &= CR_MER_Reset; + } + /* Return the Erase Status */ + return status; +} + +#ifdef STM32F10X_XL +/** + * @brief Erases all Bank2 FLASH pages. + * @note This function can be used only for STM32F10x_XL density devices. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_EraseAllBank2Pages(void) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase all pages */ + FLASH->CR2 |= CR_MER_Set; + FLASH->CR2 |= CR_STRT_Set; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(EraseTimeout); + + /* Disable the MER Bit */ + FLASH->CR2 &= CR_MER_Reset; + } + /* Return the Erase Status */ + return status; +} +#endif /* STM32F10X_XL */ + +/** + * @brief Erases the FLASH option bytes. + * @note This functions erases all option bytes except the Read protection (RDP). + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_EraseOptionBytes(void) +{ + uint16_t rdptmp = RDP_Key; + + FLASH_Status status = FLASH_COMPLETE; + + /* Get the actual read protection Option Byte value */ + if(FLASH_GetReadOutProtectionStatus() != RESET) + { + rdptmp = 0x00; + } + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* Authorize the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + + /* if the previous operation is completed, proceed to erase the option bytes */ + FLASH->CR |= CR_OPTER_Set; + FLASH->CR |= CR_STRT_Set; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the erase operation is completed, disable the OPTER Bit */ + FLASH->CR &= CR_OPTER_Reset; + + /* Enable the Option Bytes Programming operation */ + FLASH->CR |= CR_OPTPG_Set; + /* Restore the last read protection Option Byte value */ + OB->RDP = (uint16_t)rdptmp; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + else + { + if (status != FLASH_TIMEOUT) + { + /* Disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + } + /* Return the erase status */ + return status; +} + +/** + * @brief Programs a word at a specified address. + * @note This function can be used for all STM32F10x devices. + * @param Address: specifies the address to be programmed. + * @param Data: specifies the data to be programmed. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data) +{ + FLASH_Status status = FLASH_COMPLETE; + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_FLASH_ADDRESS(Address)); + +#ifdef STM32F10X_XL + if(Address < FLASH_BANK1_END_ADDRESS - 2) + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(ProgramTimeout); + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new first + half word */ + FLASH->CR |= CR_PG_Set; + + *(__IO uint16_t*)Address = (uint16_t)Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new second + half word */ + tmp = Address + 2; + + *(__IO uint16_t*) tmp = Data >> 16; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + else + { + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + } + } + else if(Address == (FLASH_BANK1_END_ADDRESS - 1)) + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new first + half word */ + FLASH->CR |= CR_PG_Set; + + *(__IO uint16_t*)Address = (uint16_t)Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + else + { + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new second + half word */ + FLASH->CR2 |= CR_PG_Set; + tmp = Address + 2; + + *(__IO uint16_t*) tmp = Data >> 16; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR2 &= CR_PG_Reset; + } + else + { + /* Disable the PG Bit */ + FLASH->CR2 &= CR_PG_Reset; + } + } + else + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new first + half word */ + FLASH->CR2 |= CR_PG_Set; + + *(__IO uint16_t*)Address = (uint16_t)Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new second + half word */ + tmp = Address + 2; + + *(__IO uint16_t*) tmp = Data >> 16; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR2 &= CR_PG_Reset; + } + else + { + /* Disable the PG Bit */ + FLASH->CR2 &= CR_PG_Reset; + } + } + } +#else + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new first + half word */ + FLASH->CR |= CR_PG_Set; + + *(__IO uint16_t*)Address = (uint16_t)Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new second + half word */ + tmp = Address + 2; + + *(__IO uint16_t*) tmp = Data >> 16; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + else + { + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + } +#endif /* STM32F10X_XL */ + + /* Return the Program Status */ + return status; +} + +/** + * @brief Programs a half word at a specified address. + * @note This function can be used for all STM32F10x devices. + * @param Address: specifies the address to be programmed. + * @param Data: specifies the data to be programmed. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + assert_param(IS_FLASH_ADDRESS(Address)); + +#ifdef STM32F10X_XL + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(Address < FLASH_BANK1_END_ADDRESS) + { + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new data */ + FLASH->CR |= CR_PG_Set; + + *(__IO uint16_t*)Address = Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank1Operation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } + } + else + { + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new data */ + FLASH->CR2 |= CR_PG_Set; + + *(__IO uint16_t*)Address = Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastBank2Operation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR2 &= CR_PG_Reset; + } + } +#else + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new data */ + FLASH->CR |= CR_PG_Set; + + *(__IO uint16_t*)Address = Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + /* Disable the PG Bit */ + FLASH->CR &= CR_PG_Reset; + } +#endif /* STM32F10X_XL */ + + /* Return the Program Status */ + return status; +} + +/** + * @brief Programs a half word at a specified Option Byte Data address. + * @note This function can be used for all STM32F10x devices. + * @param Address: specifies the address to be programmed. + * This parameter can be 0x1FFFF804 or 0x1FFFF806. + * @param Data: specifies the data to be programmed. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ProgramOptionByteData(uint32_t Address, uint8_t Data) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + assert_param(IS_OB_DATA_ADDRESS(Address)); + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* Authorize the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + /* Enables the Option Bytes Programming operation */ + FLASH->CR |= CR_OPTPG_Set; + *(__IO uint16_t*)Address = Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + /* Return the Option Byte Data Program Status */ + return status; +} + +/** + * @brief Write protects the desired pages + * @note This function can be used for all STM32F10x devices. + * @param FLASH_Pages: specifies the address of the pages to be write protected. + * This parameter can be: + * @arg For @b STM32_Low-density_devices: value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages28to31 + * @arg For @b STM32_Medium-density_devices: value between FLASH_WRProt_Pages0to3 + * and FLASH_WRProt_Pages124to127 + * @arg For @b STM32_High-density_devices: value between FLASH_WRProt_Pages0to1 and + * FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to255 + * @arg For @b STM32_Connectivity_line_devices: value between FLASH_WRProt_Pages0to1 and + * FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to127 + * @arg For @b STM32_XL-density_devices: value between FLASH_WRProt_Pages0to1 and + * FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to511 + * @arg FLASH_WRProt_AllPages + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_EnableWriteProtection(uint32_t FLASH_Pages) +{ + uint16_t WRP0_Data = 0xFFFF, WRP1_Data = 0xFFFF, WRP2_Data = 0xFFFF, WRP3_Data = 0xFFFF; + + FLASH_Status status = FLASH_COMPLETE; + + /* Check the parameters */ + assert_param(IS_FLASH_WRPROT_PAGE(FLASH_Pages)); + + FLASH_Pages = (uint32_t)(~FLASH_Pages); + WRP0_Data = (uint16_t)(FLASH_Pages & WRP0_Mask); + WRP1_Data = (uint16_t)((FLASH_Pages & WRP1_Mask) >> 8); + WRP2_Data = (uint16_t)((FLASH_Pages & WRP2_Mask) >> 16); + WRP3_Data = (uint16_t)((FLASH_Pages & WRP3_Mask) >> 24); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* Authorizes the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + FLASH->CR |= CR_OPTPG_Set; + if(WRP0_Data != 0xFF) + { + OB->WRP0 = WRP0_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + } + if((status == FLASH_COMPLETE) && (WRP1_Data != 0xFF)) + { + OB->WRP1 = WRP1_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + } + if((status == FLASH_COMPLETE) && (WRP2_Data != 0xFF)) + { + OB->WRP2 = WRP2_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + } + + if((status == FLASH_COMPLETE)&& (WRP3_Data != 0xFF)) + { + OB->WRP3 = WRP3_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + } + + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + /* Return the write protection operation Status */ + return status; +} + +/** + * @brief Enables or disables the read out protection. + * @note If the user has already programmed the other option bytes before calling + * this function, he must re-program them since this function erases all option bytes. + * @note This function can be used for all STM32F10x devices. + * @param Newstate: new state of the ReadOut Protection. + * This parameter can be: ENABLE or DISABLE. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ReadOutProtection(FunctionalState NewState) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + status = FLASH_WaitForLastOperation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* Authorizes the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + FLASH->CR |= CR_OPTER_Set; + FLASH->CR |= CR_STRT_Set; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + if(status == FLASH_COMPLETE) + { + /* if the erase operation is completed, disable the OPTER Bit */ + FLASH->CR &= CR_OPTER_Reset; + /* Enable the Option Bytes Programming operation */ + FLASH->CR |= CR_OPTPG_Set; + if(NewState != DISABLE) + { + OB->RDP = 0x00; + } + else + { + OB->RDP = RDP_Key; + } + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + else + { + if(status != FLASH_TIMEOUT) + { + /* Disable the OPTER Bit */ + FLASH->CR &= CR_OPTER_Reset; + } + } + } + /* Return the protection operation Status */ + return status; +} + +/** + * @brief Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. + * @note This function can be used for all STM32F10x devices. + * @param OB_IWDG: Selects the IWDG mode + * This parameter can be one of the following values: + * @arg OB_IWDG_SW: Software IWDG selected + * @arg OB_IWDG_HW: Hardware IWDG selected + * @param OB_STOP: Reset event when entering STOP mode. + * This parameter can be one of the following values: + * @arg OB_STOP_NoRST: No reset generated when entering in STOP + * @arg OB_STOP_RST: Reset generated when entering in STOP + * @param OB_STDBY: Reset event when entering Standby mode. + * This parameter can be one of the following values: + * @arg OB_STDBY_NoRST: No reset generated when entering in STANDBY + * @arg OB_STDBY_RST: Reset generated when entering in STANDBY + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_UserOptionByteConfig(uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY) +{ + FLASH_Status status = FLASH_COMPLETE; + + /* Check the parameters */ + assert_param(IS_OB_IWDG_SOURCE(OB_IWDG)); + assert_param(IS_OB_STOP_SOURCE(OB_STOP)); + assert_param(IS_OB_STDBY_SOURCE(OB_STDBY)); + + /* Authorize the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* Enable the Option Bytes Programming operation */ + FLASH->CR |= CR_OPTPG_Set; + + OB->USER = OB_IWDG | (uint16_t)(OB_STOP | (uint16_t)(OB_STDBY | ((uint16_t)0xF8))); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + /* Return the Option Byte program Status */ + return status; +} + +#ifdef STM32F10X_XL +/** + * @brief Configures to boot from Bank1 or Bank2. + * @note This function can be used only for STM32F10x_XL density devices. + * @param FLASH_BOOT: select the FLASH Bank to boot from. + * This parameter can be one of the following values: + * @arg FLASH_BOOT_Bank1: At startup, if boot pins are set in boot from user Flash + * position and this parameter is selected the device will boot from Bank1(Default). + * @arg FLASH_BOOT_Bank2: At startup, if boot pins are set in boot from user Flash + * position and this parameter is selected the device will boot from Bank2 or Bank1, + * depending on the activation of the bank. The active banks are checked in + * the following order: Bank2, followed by Bank1. + * The active bank is recognized by the value programmed at the base address + * of the respective bank (corresponding to the initial stack pointer value + * in the interrupt vector table). + * For more information, please refer to AN2606 from www.st.com. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_BootConfig(uint16_t FLASH_BOOT) +{ + FLASH_Status status = FLASH_COMPLETE; + assert_param(IS_FLASH_BOOT(FLASH_BOOT)); + /* Authorize the small information block programming */ + FLASH->OPTKEYR = FLASH_KEY1; + FLASH->OPTKEYR = FLASH_KEY2; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + + if(status == FLASH_COMPLETE) + { + /* Enable the Option Bytes Programming operation */ + FLASH->CR |= CR_OPTPG_Set; + + if(FLASH_BOOT == FLASH_BOOT_Bank1) + { + OB->USER |= OB_USER_BFB2; + } + else + { + OB->USER &= (uint16_t)(~(uint16_t)(OB_USER_BFB2)); + } + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the OPTPG Bit */ + FLASH->CR &= CR_OPTPG_Reset; + } + } + /* Return the Option Byte program Status */ + return status; +} +#endif /* STM32F10X_XL */ + +/** + * @brief Returns the FLASH User Option Bytes values. + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval The FLASH User Option Bytes values:IWDG_SW(Bit0), RST_STOP(Bit1) + * and RST_STDBY(Bit2). + */ +uint32_t FLASH_GetUserOptionByte(void) +{ + /* Return the User Option Byte */ + return (uint32_t)(FLASH->OBR >> 2); +} + +/** + * @brief Returns the FLASH Write Protection Option Bytes Register value. + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval The FLASH Write Protection Option Bytes Register value + */ +uint32_t FLASH_GetWriteProtectionOptionByte(void) +{ + /* Return the Flash write protection Register value */ + return (uint32_t)(FLASH->WRPR); +} + +/** + * @brief Checks whether the FLASH Read Out Protection Status is set or not. + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval FLASH ReadOut Protection Status(SET or RESET) + */ +FlagStatus FLASH_GetReadOutProtectionStatus(void) +{ + FlagStatus readoutstatus = RESET; + if ((FLASH->OBR & RDPRT_Mask) != (uint32_t)RESET) + { + readoutstatus = SET; + } + else + { + readoutstatus = RESET; + } + return readoutstatus; +} + +/** + * @brief Checks whether the FLASH Prefetch Buffer status is set or not. + * @note This function can be used for all STM32F10x devices. + * @param None + * @retval FLASH Prefetch Buffer Status (SET or RESET). + */ +FlagStatus FLASH_GetPrefetchBufferStatus(void) +{ + FlagStatus bitstatus = RESET; + + if ((FLASH->ACR & ACR_PRFTBS_Mask) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + /* Return the new state of FLASH Prefetch Buffer Status (SET or RESET) */ + return bitstatus; +} + +/** + * @brief Enables or disables the specified FLASH interrupts. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices, enables or disables the specified FLASH interrupts + for Bank1 and Bank2. + * - For other devices it enables or disables the specified FLASH interrupts for Bank1. + * @param FLASH_IT: specifies the FLASH interrupt sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg FLASH_IT_ERROR: FLASH Error Interrupt + * @arg FLASH_IT_EOP: FLASH end of operation Interrupt + * @param NewState: new state of the specified Flash interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState) +{ +#ifdef STM32F10X_XL + /* Check the parameters */ + assert_param(IS_FLASH_IT(FLASH_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if((FLASH_IT & 0x80000000) != 0x0) + { + if(NewState != DISABLE) + { + /* Enable the interrupt sources */ + FLASH->CR2 |= (FLASH_IT & 0x7FFFFFFF); + } + else + { + /* Disable the interrupt sources */ + FLASH->CR2 &= ~(uint32_t)(FLASH_IT & 0x7FFFFFFF); + } + } + else + { + if(NewState != DISABLE) + { + /* Enable the interrupt sources */ + FLASH->CR |= FLASH_IT; + } + else + { + /* Disable the interrupt sources */ + FLASH->CR &= ~(uint32_t)FLASH_IT; + } + } +#else + /* Check the parameters */ + assert_param(IS_FLASH_IT(FLASH_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if(NewState != DISABLE) + { + /* Enable the interrupt sources */ + FLASH->CR |= FLASH_IT; + } + else + { + /* Disable the interrupt sources */ + FLASH->CR &= ~(uint32_t)FLASH_IT; + } +#endif /* STM32F10X_XL */ +} + +/** + * @brief Checks whether the specified FLASH flag is set or not. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices, this function checks whether the specified + * Bank1 or Bank2 flag is set or not. + * - For other devices, it checks whether the specified Bank1 flag is + * set or not. + * @param FLASH_FLAG: specifies the FLASH flag to check. + * This parameter can be one of the following values: + * @arg FLASH_FLAG_BSY: FLASH Busy flag + * @arg FLASH_FLAG_PGERR: FLASH Program error flag + * @arg FLASH_FLAG_WRPRTERR: FLASH Write protected error flag + * @arg FLASH_FLAG_EOP: FLASH End of Operation flag + * @arg FLASH_FLAG_OPTERR: FLASH Option Byte error flag + * @retval The new state of FLASH_FLAG (SET or RESET). + */ +FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG) +{ + FlagStatus bitstatus = RESET; + +#ifdef STM32F10X_XL + /* Check the parameters */ + assert_param(IS_FLASH_GET_FLAG(FLASH_FLAG)) ; + if(FLASH_FLAG == FLASH_FLAG_OPTERR) + { + if((FLASH->OBR & FLASH_FLAG_OPTERR) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + } + else + { + if((FLASH_FLAG & 0x80000000) != 0x0) + { + if((FLASH->SR2 & FLASH_FLAG) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + } + else + { + if((FLASH->SR & FLASH_FLAG) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + } + } +#else + /* Check the parameters */ + assert_param(IS_FLASH_GET_FLAG(FLASH_FLAG)) ; + if(FLASH_FLAG == FLASH_FLAG_OPTERR) + { + if((FLASH->OBR & FLASH_FLAG_OPTERR) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + } + else + { + if((FLASH->SR & FLASH_FLAG) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + } +#endif /* STM32F10X_XL */ + + /* Return the new state of FLASH_FLAG (SET or RESET) */ + return bitstatus; +} + +/** + * @brief Clears the FLASH's pending flags. + * @note This function can be used for all STM32F10x devices. + * - For STM32F10X_XL devices, this function clears Bank1 or Bank2s pending flags + * - For other devices, it clears Bank1s pending flags. + * @param FLASH_FLAG: specifies the FLASH flags to clear. + * This parameter can be any combination of the following values: + * @arg FLASH_FLAG_PGERR: FLASH Program error flag + * @arg FLASH_FLAG_WRPRTERR: FLASH Write protected error flag + * @arg FLASH_FLAG_EOP: FLASH End of Operation flag + * @retval None + */ +void FLASH_ClearFlag(uint32_t FLASH_FLAG) +{ +#ifdef STM32F10X_XL + /* Check the parameters */ + assert_param(IS_FLASH_CLEAR_FLAG(FLASH_FLAG)) ; + + if((FLASH_FLAG & 0x80000000) != 0x0) + { + /* Clear the flags */ + FLASH->SR2 = FLASH_FLAG; + } + else + { + /* Clear the flags */ + FLASH->SR = FLASH_FLAG; + } + +#else + /* Check the parameters */ + assert_param(IS_FLASH_CLEAR_FLAG(FLASH_FLAG)) ; + + /* Clear the flags */ + FLASH->SR = FLASH_FLAG; +#endif /* STM32F10X_XL */ +} + +/** + * @brief Returns the FLASH Status. + * @note This function can be used for all STM32F10x devices, it is equivalent + * to FLASH_GetBank1Status function. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP or FLASH_COMPLETE + */ +FLASH_Status FLASH_GetStatus(void) +{ + FLASH_Status flashstatus = FLASH_COMPLETE; + + if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY) + { + flashstatus = FLASH_BUSY; + } + else + { + if((FLASH->SR & FLASH_FLAG_PGERR) != 0) + { + flashstatus = FLASH_ERROR_PG; + } + else + { + if((FLASH->SR & FLASH_FLAG_WRPRTERR) != 0 ) + { + flashstatus = FLASH_ERROR_WRP; + } + else + { + flashstatus = FLASH_COMPLETE; + } + } + } + /* Return the Flash Status */ + return flashstatus; +} + +/** + * @brief Returns the FLASH Bank1 Status. + * @note This function can be used for all STM32F10x devices, it is equivalent + * to FLASH_GetStatus function. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP or FLASH_COMPLETE + */ +FLASH_Status FLASH_GetBank1Status(void) +{ + FLASH_Status flashstatus = FLASH_COMPLETE; + + if((FLASH->SR & FLASH_FLAG_BANK1_BSY) == FLASH_FLAG_BSY) + { + flashstatus = FLASH_BUSY; + } + else + { + if((FLASH->SR & FLASH_FLAG_BANK1_PGERR) != 0) + { + flashstatus = FLASH_ERROR_PG; + } + else + { + if((FLASH->SR & FLASH_FLAG_BANK1_WRPRTERR) != 0 ) + { + flashstatus = FLASH_ERROR_WRP; + } + else + { + flashstatus = FLASH_COMPLETE; + } + } + } + /* Return the Flash Status */ + return flashstatus; +} + +#ifdef STM32F10X_XL +/** + * @brief Returns the FLASH Bank2 Status. + * @note This function can be used for STM32F10x_XL density devices. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP or FLASH_COMPLETE + */ +FLASH_Status FLASH_GetBank2Status(void) +{ + FLASH_Status flashstatus = FLASH_COMPLETE; + + if((FLASH->SR2 & (FLASH_FLAG_BANK2_BSY & 0x7FFFFFFF)) == (FLASH_FLAG_BANK2_BSY & 0x7FFFFFFF)) + { + flashstatus = FLASH_BUSY; + } + else + { + if((FLASH->SR2 & (FLASH_FLAG_BANK2_PGERR & 0x7FFFFFFF)) != 0) + { + flashstatus = FLASH_ERROR_PG; + } + else + { + if((FLASH->SR2 & (FLASH_FLAG_BANK2_WRPRTERR & 0x7FFFFFFF)) != 0 ) + { + flashstatus = FLASH_ERROR_WRP; + } + else + { + flashstatus = FLASH_COMPLETE; + } + } + } + /* Return the Flash Status */ + return flashstatus; +} +#endif /* STM32F10X_XL */ +/** + * @brief Waits for a Flash operation to complete or a TIMEOUT to occur. + * @note This function can be used for all STM32F10x devices, + * it is equivalent to FLASH_WaitForLastBank1Operation. + * - For STM32F10X_XL devices this function waits for a Bank1 Flash operation + * to complete or a TIMEOUT to occur. + * - For all other devices it waits for a Flash operation to complete + * or a TIMEOUT to occur. + * @param Timeout: FLASH programming Timeout + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) +{ + FLASH_Status status = FLASH_COMPLETE; + + /* Check for the Flash Status */ + status = FLASH_GetBank1Status(); + /* Wait for a Flash operation to complete or a TIMEOUT to occur */ + while((status == FLASH_BUSY) && (Timeout != 0x00)) + { + status = FLASH_GetBank1Status(); + Timeout--; + } + if(Timeout == 0x00 ) + { + status = FLASH_TIMEOUT; + } + /* Return the operation status */ + return status; +} + +/** + * @brief Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur. + * @note This function can be used for all STM32F10x devices, + * it is equivalent to FLASH_WaitForLastOperation. + * @param Timeout: FLASH programming Timeout + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_WaitForLastBank1Operation(uint32_t Timeout) +{ + FLASH_Status status = FLASH_COMPLETE; + + /* Check for the Flash Status */ + status = FLASH_GetBank1Status(); + /* Wait for a Flash operation to complete or a TIMEOUT to occur */ + while((status == FLASH_FLAG_BANK1_BSY) && (Timeout != 0x00)) + { + status = FLASH_GetBank1Status(); + Timeout--; + } + if(Timeout == 0x00 ) + { + status = FLASH_TIMEOUT; + } + /* Return the operation status */ + return status; +} + +#ifdef STM32F10X_XL +/** + * @brief Waits for a Flash operation on Bank2 to complete or a TIMEOUT to occur. + * @note This function can be used only for STM32F10x_XL density devices. + * @param Timeout: FLASH programming Timeout + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_WaitForLastBank2Operation(uint32_t Timeout) +{ + FLASH_Status status = FLASH_COMPLETE; + + /* Check for the Flash Status */ + status = FLASH_GetBank2Status(); + /* Wait for a Flash operation to complete or a TIMEOUT to occur */ + while((status == (FLASH_FLAG_BANK2_BSY & 0x7FFFFFFF)) && (Timeout != 0x00)) + { + status = FLASH_GetBank2Status(); + Timeout--; + } + if(Timeout == 0x00 ) + { + status = FLASH_TIMEOUT; + } + /* Return the operation status */ + return status; +} +#endif /* STM32F10X_XL */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c new file mode 100644 index 0000000..8410495 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c @@ -0,0 +1,864 @@ +/** + ****************************************************************************** + * @file stm32f10x_fsmc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the FSMC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_fsmc.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup FSMC + * @brief FSMC driver modules + * @{ + */ + +/** @defgroup FSMC_Private_TypesDefinitions + * @{ + */ +/** + * @} + */ + +/** @defgroup FSMC_Private_Defines + * @{ + */ + +/* --------------------- FSMC registers bit mask ---------------------------- */ + +/* FSMC BCRx Mask */ +#define BCR_MBKEN_Set ((uint32_t)0x00000001) +#define BCR_MBKEN_Reset ((uint32_t)0x000FFFFE) +#define BCR_FACCEN_Set ((uint32_t)0x00000040) + +/* FSMC PCRx Mask */ +#define PCR_PBKEN_Set ((uint32_t)0x00000004) +#define PCR_PBKEN_Reset ((uint32_t)0x000FFFFB) +#define PCR_ECCEN_Set ((uint32_t)0x00000040) +#define PCR_ECCEN_Reset ((uint32_t)0x000FFFBF) +#define PCR_MemoryType_NAND ((uint32_t)0x00000008) +/** + * @} + */ + +/** @defgroup FSMC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup FSMC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup FSMC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup FSMC_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the FSMC NOR/SRAM Banks registers to their default + * reset values. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank1_NORSRAM1: FSMC Bank1 NOR/SRAM1 + * @arg FSMC_Bank1_NORSRAM2: FSMC Bank1 NOR/SRAM2 + * @arg FSMC_Bank1_NORSRAM3: FSMC Bank1 NOR/SRAM3 + * @arg FSMC_Bank1_NORSRAM4: FSMC Bank1 NOR/SRAM4 + * @retval None + */ +void FSMC_NORSRAMDeInit(uint32_t FSMC_Bank) +{ + /* Check the parameter */ + assert_param(IS_FSMC_NORSRAM_BANK(FSMC_Bank)); + + /* FSMC_Bank1_NORSRAM1 */ + if(FSMC_Bank == FSMC_Bank1_NORSRAM1) + { + FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030DB; + } + /* FSMC_Bank1_NORSRAM2, FSMC_Bank1_NORSRAM3 or FSMC_Bank1_NORSRAM4 */ + else + { + FSMC_Bank1->BTCR[FSMC_Bank] = 0x000030D2; + } + FSMC_Bank1->BTCR[FSMC_Bank + 1] = 0x0FFFFFFF; + FSMC_Bank1E->BWTR[FSMC_Bank] = 0x0FFFFFFF; +} + +/** + * @brief Deinitializes the FSMC NAND Banks registers to their default reset values. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @retval None + */ +void FSMC_NANDDeInit(uint32_t FSMC_Bank) +{ + /* Check the parameter */ + assert_param(IS_FSMC_NAND_BANK(FSMC_Bank)); + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + /* Set the FSMC_Bank2 registers to their reset values */ + FSMC_Bank2->PCR2 = 0x00000018; + FSMC_Bank2->SR2 = 0x00000040; + FSMC_Bank2->PMEM2 = 0xFCFCFCFC; + FSMC_Bank2->PATT2 = 0xFCFCFCFC; + } + /* FSMC_Bank3_NAND */ + else + { + /* Set the FSMC_Bank3 registers to their reset values */ + FSMC_Bank3->PCR3 = 0x00000018; + FSMC_Bank3->SR3 = 0x00000040; + FSMC_Bank3->PMEM3 = 0xFCFCFCFC; + FSMC_Bank3->PATT3 = 0xFCFCFCFC; + } +} + +/** + * @brief Deinitializes the FSMC PCCARD Bank registers to their default reset values. + * @param None + * @retval None + */ +void FSMC_PCCARDDeInit(void) +{ + /* Set the FSMC_Bank4 registers to their reset values */ + FSMC_Bank4->PCR4 = 0x00000018; + FSMC_Bank4->SR4 = 0x00000000; + FSMC_Bank4->PMEM4 = 0xFCFCFCFC; + FSMC_Bank4->PATT4 = 0xFCFCFCFC; + FSMC_Bank4->PIO4 = 0xFCFCFCFC; +} + +/** + * @brief Initializes the FSMC NOR/SRAM Banks according to the specified + * parameters in the FSMC_NORSRAMInitStruct. + * @param FSMC_NORSRAMInitStruct : pointer to a FSMC_NORSRAMInitTypeDef + * structure that contains the configuration information for + * the FSMC NOR/SRAM specified Banks. + * @retval None + */ +void FSMC_NORSRAMInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct) +{ + /* Check the parameters */ + assert_param(IS_FSMC_NORSRAM_BANK(FSMC_NORSRAMInitStruct->FSMC_Bank)); + assert_param(IS_FSMC_MUX(FSMC_NORSRAMInitStruct->FSMC_DataAddressMux)); + assert_param(IS_FSMC_MEMORY(FSMC_NORSRAMInitStruct->FSMC_MemoryType)); + assert_param(IS_FSMC_MEMORY_WIDTH(FSMC_NORSRAMInitStruct->FSMC_MemoryDataWidth)); + assert_param(IS_FSMC_BURSTMODE(FSMC_NORSRAMInitStruct->FSMC_BurstAccessMode)); + assert_param(IS_FSMC_ASYNWAIT(FSMC_NORSRAMInitStruct->FSMC_AsynchronousWait)); + assert_param(IS_FSMC_WAIT_POLARITY(FSMC_NORSRAMInitStruct->FSMC_WaitSignalPolarity)); + assert_param(IS_FSMC_WRAP_MODE(FSMC_NORSRAMInitStruct->FSMC_WrapMode)); + assert_param(IS_FSMC_WAIT_SIGNAL_ACTIVE(FSMC_NORSRAMInitStruct->FSMC_WaitSignalActive)); + assert_param(IS_FSMC_WRITE_OPERATION(FSMC_NORSRAMInitStruct->FSMC_WriteOperation)); + assert_param(IS_FSMC_WAITE_SIGNAL(FSMC_NORSRAMInitStruct->FSMC_WaitSignal)); + assert_param(IS_FSMC_EXTENDED_MODE(FSMC_NORSRAMInitStruct->FSMC_ExtendedMode)); + assert_param(IS_FSMC_WRITE_BURST(FSMC_NORSRAMInitStruct->FSMC_WriteBurst)); + assert_param(IS_FSMC_ADDRESS_SETUP_TIME(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressSetupTime)); + assert_param(IS_FSMC_ADDRESS_HOLD_TIME(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressHoldTime)); + assert_param(IS_FSMC_DATASETUP_TIME(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataSetupTime)); + assert_param(IS_FSMC_TURNAROUND_TIME(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_BusTurnAroundDuration)); + assert_param(IS_FSMC_CLK_DIV(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_CLKDivision)); + assert_param(IS_FSMC_DATA_LATENCY(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataLatency)); + assert_param(IS_FSMC_ACCESS_MODE(FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AccessMode)); + + /* Bank1 NOR/SRAM control register configuration */ + FSMC_Bank1->BTCR[FSMC_NORSRAMInitStruct->FSMC_Bank] = + (uint32_t)FSMC_NORSRAMInitStruct->FSMC_DataAddressMux | + FSMC_NORSRAMInitStruct->FSMC_MemoryType | + FSMC_NORSRAMInitStruct->FSMC_MemoryDataWidth | + FSMC_NORSRAMInitStruct->FSMC_BurstAccessMode | + FSMC_NORSRAMInitStruct->FSMC_AsynchronousWait | + FSMC_NORSRAMInitStruct->FSMC_WaitSignalPolarity | + FSMC_NORSRAMInitStruct->FSMC_WrapMode | + FSMC_NORSRAMInitStruct->FSMC_WaitSignalActive | + FSMC_NORSRAMInitStruct->FSMC_WriteOperation | + FSMC_NORSRAMInitStruct->FSMC_WaitSignal | + FSMC_NORSRAMInitStruct->FSMC_ExtendedMode | + FSMC_NORSRAMInitStruct->FSMC_WriteBurst; + + if(FSMC_NORSRAMInitStruct->FSMC_MemoryType == FSMC_MemoryType_NOR) + { + FSMC_Bank1->BTCR[FSMC_NORSRAMInitStruct->FSMC_Bank] |= (uint32_t)BCR_FACCEN_Set; + } + + /* Bank1 NOR/SRAM timing register configuration */ + FSMC_Bank1->BTCR[FSMC_NORSRAMInitStruct->FSMC_Bank+1] = + (uint32_t)FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressSetupTime | + (FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressHoldTime << 4) | + (FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataSetupTime << 8) | + (FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_BusTurnAroundDuration << 16) | + (FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_CLKDivision << 20) | + (FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataLatency << 24) | + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AccessMode; + + + /* Bank1 NOR/SRAM timing register for write configuration, if extended mode is used */ + if(FSMC_NORSRAMInitStruct->FSMC_ExtendedMode == FSMC_ExtendedMode_Enable) + { + assert_param(IS_FSMC_ADDRESS_SETUP_TIME(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressSetupTime)); + assert_param(IS_FSMC_ADDRESS_HOLD_TIME(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressHoldTime)); + assert_param(IS_FSMC_DATASETUP_TIME(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataSetupTime)); + assert_param(IS_FSMC_CLK_DIV(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_CLKDivision)); + assert_param(IS_FSMC_DATA_LATENCY(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataLatency)); + assert_param(IS_FSMC_ACCESS_MODE(FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AccessMode)); + FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] = + (uint32_t)FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressSetupTime | + (FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressHoldTime << 4 )| + (FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataSetupTime << 8) | + (FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_CLKDivision << 20) | + (FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataLatency << 24) | + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AccessMode; + } + else + { + FSMC_Bank1E->BWTR[FSMC_NORSRAMInitStruct->FSMC_Bank] = 0x0FFFFFFF; + } +} + +/** + * @brief Initializes the FSMC NAND Banks according to the specified + * parameters in the FSMC_NANDInitStruct. + * @param FSMC_NANDInitStruct : pointer to a FSMC_NANDInitTypeDef + * structure that contains the configuration information for the FSMC + * NAND specified Banks. + * @retval None + */ +void FSMC_NANDInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct) +{ + uint32_t tmppcr = 0x00000000, tmppmem = 0x00000000, tmppatt = 0x00000000; + + /* Check the parameters */ + assert_param( IS_FSMC_NAND_BANK(FSMC_NANDInitStruct->FSMC_Bank)); + assert_param( IS_FSMC_WAIT_FEATURE(FSMC_NANDInitStruct->FSMC_Waitfeature)); + assert_param( IS_FSMC_MEMORY_WIDTH(FSMC_NANDInitStruct->FSMC_MemoryDataWidth)); + assert_param( IS_FSMC_ECC_STATE(FSMC_NANDInitStruct->FSMC_ECC)); + assert_param( IS_FSMC_ECCPAGE_SIZE(FSMC_NANDInitStruct->FSMC_ECCPageSize)); + assert_param( IS_FSMC_TCLR_TIME(FSMC_NANDInitStruct->FSMC_TCLRSetupTime)); + assert_param( IS_FSMC_TAR_TIME(FSMC_NANDInitStruct->FSMC_TARSetupTime)); + assert_param(IS_FSMC_SETUP_TIME(FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime)); + assert_param(IS_FSMC_WAIT_TIME(FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime)); + assert_param(IS_FSMC_HOLD_TIME(FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime)); + assert_param(IS_FSMC_HIZ_TIME(FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime)); + assert_param(IS_FSMC_SETUP_TIME(FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime)); + assert_param(IS_FSMC_WAIT_TIME(FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime)); + assert_param(IS_FSMC_HOLD_TIME(FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime)); + assert_param(IS_FSMC_HIZ_TIME(FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime)); + + /* Set the tmppcr value according to FSMC_NANDInitStruct parameters */ + tmppcr = (uint32_t)FSMC_NANDInitStruct->FSMC_Waitfeature | + PCR_MemoryType_NAND | + FSMC_NANDInitStruct->FSMC_MemoryDataWidth | + FSMC_NANDInitStruct->FSMC_ECC | + FSMC_NANDInitStruct->FSMC_ECCPageSize | + (FSMC_NANDInitStruct->FSMC_TCLRSetupTime << 9 )| + (FSMC_NANDInitStruct->FSMC_TARSetupTime << 13); + + /* Set tmppmem value according to FSMC_CommonSpaceTimingStructure parameters */ + tmppmem = (uint32_t)FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime | + (FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime << 8) | + (FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime << 16)| + (FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime << 24); + + /* Set tmppatt value according to FSMC_AttributeSpaceTimingStructure parameters */ + tmppatt = (uint32_t)FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime | + (FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime << 8) | + (FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime << 16)| + (FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime << 24); + + if(FSMC_NANDInitStruct->FSMC_Bank == FSMC_Bank2_NAND) + { + /* FSMC_Bank2_NAND registers configuration */ + FSMC_Bank2->PCR2 = tmppcr; + FSMC_Bank2->PMEM2 = tmppmem; + FSMC_Bank2->PATT2 = tmppatt; + } + else + { + /* FSMC_Bank3_NAND registers configuration */ + FSMC_Bank3->PCR3 = tmppcr; + FSMC_Bank3->PMEM3 = tmppmem; + FSMC_Bank3->PATT3 = tmppatt; + } +} + +/** + * @brief Initializes the FSMC PCCARD Bank according to the specified + * parameters in the FSMC_PCCARDInitStruct. + * @param FSMC_PCCARDInitStruct : pointer to a FSMC_PCCARDInitTypeDef + * structure that contains the configuration information for the FSMC + * PCCARD Bank. + * @retval None + */ +void FSMC_PCCARDInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct) +{ + /* Check the parameters */ + assert_param(IS_FSMC_WAIT_FEATURE(FSMC_PCCARDInitStruct->FSMC_Waitfeature)); + assert_param(IS_FSMC_TCLR_TIME(FSMC_PCCARDInitStruct->FSMC_TCLRSetupTime)); + assert_param(IS_FSMC_TAR_TIME(FSMC_PCCARDInitStruct->FSMC_TARSetupTime)); + + assert_param(IS_FSMC_SETUP_TIME(FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime)); + assert_param(IS_FSMC_WAIT_TIME(FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime)); + assert_param(IS_FSMC_HOLD_TIME(FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime)); + assert_param(IS_FSMC_HIZ_TIME(FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime)); + + assert_param(IS_FSMC_SETUP_TIME(FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime)); + assert_param(IS_FSMC_WAIT_TIME(FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime)); + assert_param(IS_FSMC_HOLD_TIME(FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime)); + assert_param(IS_FSMC_HIZ_TIME(FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime)); + assert_param(IS_FSMC_SETUP_TIME(FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_SetupTime)); + assert_param(IS_FSMC_WAIT_TIME(FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_WaitSetupTime)); + assert_param(IS_FSMC_HOLD_TIME(FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HoldSetupTime)); + assert_param(IS_FSMC_HIZ_TIME(FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HiZSetupTime)); + + /* Set the PCR4 register value according to FSMC_PCCARDInitStruct parameters */ + FSMC_Bank4->PCR4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_Waitfeature | + FSMC_MemoryDataWidth_16b | + (FSMC_PCCARDInitStruct->FSMC_TCLRSetupTime << 9) | + (FSMC_PCCARDInitStruct->FSMC_TARSetupTime << 13); + + /* Set PMEM4 register value according to FSMC_CommonSpaceTimingStructure parameters */ + FSMC_Bank4->PMEM4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime | + (FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime << 8) | + (FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime << 16)| + (FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime << 24); + + /* Set PATT4 register value according to FSMC_AttributeSpaceTimingStructure parameters */ + FSMC_Bank4->PATT4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime | + (FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime << 8) | + (FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime << 16)| + (FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime << 24); + + /* Set PIO4 register value according to FSMC_IOSpaceTimingStructure parameters */ + FSMC_Bank4->PIO4 = (uint32_t)FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_SetupTime | + (FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_WaitSetupTime << 8) | + (FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HoldSetupTime << 16)| + (FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HiZSetupTime << 24); +} + +/** + * @brief Fills each FSMC_NORSRAMInitStruct member with its default value. + * @param FSMC_NORSRAMInitStruct: pointer to a FSMC_NORSRAMInitTypeDef + * structure which will be initialized. + * @retval None + */ +void FSMC_NORSRAMStructInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct) +{ + /* Reset NOR/SRAM Init structure parameters values */ + FSMC_NORSRAMInitStruct->FSMC_Bank = FSMC_Bank1_NORSRAM1; + FSMC_NORSRAMInitStruct->FSMC_DataAddressMux = FSMC_DataAddressMux_Enable; + FSMC_NORSRAMInitStruct->FSMC_MemoryType = FSMC_MemoryType_SRAM; + FSMC_NORSRAMInitStruct->FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; + FSMC_NORSRAMInitStruct->FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable; + FSMC_NORSRAMInitStruct->FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable; + FSMC_NORSRAMInitStruct->FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low; + FSMC_NORSRAMInitStruct->FSMC_WrapMode = FSMC_WrapMode_Disable; + FSMC_NORSRAMInitStruct->FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState; + FSMC_NORSRAMInitStruct->FSMC_WriteOperation = FSMC_WriteOperation_Enable; + FSMC_NORSRAMInitStruct->FSMC_WaitSignal = FSMC_WaitSignal_Enable; + FSMC_NORSRAMInitStruct->FSMC_ExtendedMode = FSMC_ExtendedMode_Disable; + FSMC_NORSRAMInitStruct->FSMC_WriteBurst = FSMC_WriteBurst_Disable; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressSetupTime = 0xF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AddressHoldTime = 0xF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataSetupTime = 0xFF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_BusTurnAroundDuration = 0xF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_CLKDivision = 0xF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_DataLatency = 0xF; + FSMC_NORSRAMInitStruct->FSMC_ReadWriteTimingStruct->FSMC_AccessMode = FSMC_AccessMode_A; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressSetupTime = 0xF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AddressHoldTime = 0xF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataSetupTime = 0xFF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_BusTurnAroundDuration = 0xF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_CLKDivision = 0xF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_DataLatency = 0xF; + FSMC_NORSRAMInitStruct->FSMC_WriteTimingStruct->FSMC_AccessMode = FSMC_AccessMode_A; +} + +/** + * @brief Fills each FSMC_NANDInitStruct member with its default value. + * @param FSMC_NANDInitStruct: pointer to a FSMC_NANDInitTypeDef + * structure which will be initialized. + * @retval None + */ +void FSMC_NANDStructInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct) +{ + /* Reset NAND Init structure parameters values */ + FSMC_NANDInitStruct->FSMC_Bank = FSMC_Bank2_NAND; + FSMC_NANDInitStruct->FSMC_Waitfeature = FSMC_Waitfeature_Disable; + FSMC_NANDInitStruct->FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_8b; + FSMC_NANDInitStruct->FSMC_ECC = FSMC_ECC_Disable; + FSMC_NANDInitStruct->FSMC_ECCPageSize = FSMC_ECCPageSize_256Bytes; + FSMC_NANDInitStruct->FSMC_TCLRSetupTime = 0x0; + FSMC_NANDInitStruct->FSMC_TARSetupTime = 0x0; + FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime = 0xFC; + FSMC_NANDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime = 0xFC; +} + +/** + * @brief Fills each FSMC_PCCARDInitStruct member with its default value. + * @param FSMC_PCCARDInitStruct: pointer to a FSMC_PCCARDInitTypeDef + * structure which will be initialized. + * @retval None + */ +void FSMC_PCCARDStructInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct) +{ + /* Reset PCCARD Init structure parameters values */ + FSMC_PCCARDInitStruct->FSMC_Waitfeature = FSMC_Waitfeature_Disable; + FSMC_PCCARDInitStruct->FSMC_TCLRSetupTime = 0x0; + FSMC_PCCARDInitStruct->FSMC_TARSetupTime = 0x0; + FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_SetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_WaitSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HoldSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_CommonSpaceTimingStruct->FSMC_HiZSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_SetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_WaitSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HoldSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_AttributeSpaceTimingStruct->FSMC_HiZSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_SetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_WaitSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HoldSetupTime = 0xFC; + FSMC_PCCARDInitStruct->FSMC_IOSpaceTimingStruct->FSMC_HiZSetupTime = 0xFC; +} + +/** + * @brief Enables or disables the specified NOR/SRAM Memory Bank. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank1_NORSRAM1: FSMC Bank1 NOR/SRAM1 + * @arg FSMC_Bank1_NORSRAM2: FSMC Bank1 NOR/SRAM2 + * @arg FSMC_Bank1_NORSRAM3: FSMC Bank1 NOR/SRAM3 + * @arg FSMC_Bank1_NORSRAM4: FSMC Bank1 NOR/SRAM4 + * @param NewState: new state of the FSMC_Bank. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FSMC_NORSRAMCmd(uint32_t FSMC_Bank, FunctionalState NewState) +{ + assert_param(IS_FSMC_NORSRAM_BANK(FSMC_Bank)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected NOR/SRAM Bank by setting the PBKEN bit in the BCRx register */ + FSMC_Bank1->BTCR[FSMC_Bank] |= BCR_MBKEN_Set; + } + else + { + /* Disable the selected NOR/SRAM Bank by clearing the PBKEN bit in the BCRx register */ + FSMC_Bank1->BTCR[FSMC_Bank] &= BCR_MBKEN_Reset; + } +} + +/** + * @brief Enables or disables the specified NAND Memory Bank. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @param NewState: new state of the FSMC_Bank. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FSMC_NANDCmd(uint32_t FSMC_Bank, FunctionalState NewState) +{ + assert_param(IS_FSMC_NAND_BANK(FSMC_Bank)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected NAND Bank by setting the PBKEN bit in the PCRx register */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->PCR2 |= PCR_PBKEN_Set; + } + else + { + FSMC_Bank3->PCR3 |= PCR_PBKEN_Set; + } + } + else + { + /* Disable the selected NAND Bank by clearing the PBKEN bit in the PCRx register */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->PCR2 &= PCR_PBKEN_Reset; + } + else + { + FSMC_Bank3->PCR3 &= PCR_PBKEN_Reset; + } + } +} + +/** + * @brief Enables or disables the PCCARD Memory Bank. + * @param NewState: new state of the PCCARD Memory Bank. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FSMC_PCCARDCmd(FunctionalState NewState) +{ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the PCCARD Bank by setting the PBKEN bit in the PCR4 register */ + FSMC_Bank4->PCR4 |= PCR_PBKEN_Set; + } + else + { + /* Disable the PCCARD Bank by clearing the PBKEN bit in the PCR4 register */ + FSMC_Bank4->PCR4 &= PCR_PBKEN_Reset; + } +} + +/** + * @brief Enables or disables the FSMC NAND ECC feature. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @param NewState: new state of the FSMC NAND ECC feature. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FSMC_NANDECCCmd(uint32_t FSMC_Bank, FunctionalState NewState) +{ + assert_param(IS_FSMC_NAND_BANK(FSMC_Bank)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected NAND Bank ECC function by setting the ECCEN bit in the PCRx register */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->PCR2 |= PCR_ECCEN_Set; + } + else + { + FSMC_Bank3->PCR3 |= PCR_ECCEN_Set; + } + } + else + { + /* Disable the selected NAND Bank ECC function by clearing the ECCEN bit in the PCRx register */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->PCR2 &= PCR_ECCEN_Reset; + } + else + { + FSMC_Bank3->PCR3 &= PCR_ECCEN_Reset; + } + } +} + +/** + * @brief Returns the error correction code register value. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @retval The Error Correction Code (ECC) value. + */ +uint32_t FSMC_GetECC(uint32_t FSMC_Bank) +{ + uint32_t eccval = 0x00000000; + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + /* Get the ECCR2 register value */ + eccval = FSMC_Bank2->ECCR2; + } + else + { + /* Get the ECCR3 register value */ + eccval = FSMC_Bank3->ECCR3; + } + /* Return the error correction code value */ + return(eccval); +} + +/** + * @brief Enables or disables the specified FSMC interrupts. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @arg FSMC_Bank4_PCCARD: FSMC Bank4 PCCARD + * @param FSMC_IT: specifies the FSMC interrupt sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg FSMC_IT_RisingEdge: Rising edge detection interrupt. + * @arg FSMC_IT_Level: Level edge detection interrupt. + * @arg FSMC_IT_FallingEdge: Falling edge detection interrupt. + * @param NewState: new state of the specified FSMC interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void FSMC_ITConfig(uint32_t FSMC_Bank, uint32_t FSMC_IT, FunctionalState NewState) +{ + assert_param(IS_FSMC_IT_BANK(FSMC_Bank)); + assert_param(IS_FSMC_IT(FSMC_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected FSMC_Bank2 interrupts */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->SR2 |= FSMC_IT; + } + /* Enable the selected FSMC_Bank3 interrupts */ + else if (FSMC_Bank == FSMC_Bank3_NAND) + { + FSMC_Bank3->SR3 |= FSMC_IT; + } + /* Enable the selected FSMC_Bank4 interrupts */ + else + { + FSMC_Bank4->SR4 |= FSMC_IT; + } + } + else + { + /* Disable the selected FSMC_Bank2 interrupts */ + if(FSMC_Bank == FSMC_Bank2_NAND) + { + + FSMC_Bank2->SR2 &= (uint32_t)~FSMC_IT; + } + /* Disable the selected FSMC_Bank3 interrupts */ + else if (FSMC_Bank == FSMC_Bank3_NAND) + { + FSMC_Bank3->SR3 &= (uint32_t)~FSMC_IT; + } + /* Disable the selected FSMC_Bank4 interrupts */ + else + { + FSMC_Bank4->SR4 &= (uint32_t)~FSMC_IT; + } + } +} + +/** + * @brief Checks whether the specified FSMC flag is set or not. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @arg FSMC_Bank4_PCCARD: FSMC Bank4 PCCARD + * @param FSMC_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg FSMC_FLAG_RisingEdge: Rising egde detection Flag. + * @arg FSMC_FLAG_Level: Level detection Flag. + * @arg FSMC_FLAG_FallingEdge: Falling egde detection Flag. + * @arg FSMC_FLAG_FEMPT: Fifo empty Flag. + * @retval The new state of FSMC_FLAG (SET or RESET). + */ +FlagStatus FSMC_GetFlagStatus(uint32_t FSMC_Bank, uint32_t FSMC_FLAG) +{ + FlagStatus bitstatus = RESET; + uint32_t tmpsr = 0x00000000; + + /* Check the parameters */ + assert_param(IS_FSMC_GETFLAG_BANK(FSMC_Bank)); + assert_param(IS_FSMC_GET_FLAG(FSMC_FLAG)); + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + tmpsr = FSMC_Bank2->SR2; + } + else if(FSMC_Bank == FSMC_Bank3_NAND) + { + tmpsr = FSMC_Bank3->SR3; + } + /* FSMC_Bank4_PCCARD*/ + else + { + tmpsr = FSMC_Bank4->SR4; + } + + /* Get the flag status */ + if ((tmpsr & FSMC_FLAG) != (uint16_t)RESET ) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + /* Return the flag status */ + return bitstatus; +} + +/** + * @brief Clears the FSMC's pending flags. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @arg FSMC_Bank4_PCCARD: FSMC Bank4 PCCARD + * @param FSMC_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg FSMC_FLAG_RisingEdge: Rising egde detection Flag. + * @arg FSMC_FLAG_Level: Level detection Flag. + * @arg FSMC_FLAG_FallingEdge: Falling egde detection Flag. + * @retval None + */ +void FSMC_ClearFlag(uint32_t FSMC_Bank, uint32_t FSMC_FLAG) +{ + /* Check the parameters */ + assert_param(IS_FSMC_GETFLAG_BANK(FSMC_Bank)); + assert_param(IS_FSMC_CLEAR_FLAG(FSMC_FLAG)) ; + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->SR2 &= ~FSMC_FLAG; + } + else if(FSMC_Bank == FSMC_Bank3_NAND) + { + FSMC_Bank3->SR3 &= ~FSMC_FLAG; + } + /* FSMC_Bank4_PCCARD*/ + else + { + FSMC_Bank4->SR4 &= ~FSMC_FLAG; + } +} + +/** + * @brief Checks whether the specified FSMC interrupt has occurred or not. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @arg FSMC_Bank4_PCCARD: FSMC Bank4 PCCARD + * @param FSMC_IT: specifies the FSMC interrupt source to check. + * This parameter can be one of the following values: + * @arg FSMC_IT_RisingEdge: Rising edge detection interrupt. + * @arg FSMC_IT_Level: Level edge detection interrupt. + * @arg FSMC_IT_FallingEdge: Falling edge detection interrupt. + * @retval The new state of FSMC_IT (SET or RESET). + */ +ITStatus FSMC_GetITStatus(uint32_t FSMC_Bank, uint32_t FSMC_IT) +{ + ITStatus bitstatus = RESET; + uint32_t tmpsr = 0x0, itstatus = 0x0, itenable = 0x0; + + /* Check the parameters */ + assert_param(IS_FSMC_IT_BANK(FSMC_Bank)); + assert_param(IS_FSMC_GET_IT(FSMC_IT)); + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + tmpsr = FSMC_Bank2->SR2; + } + else if(FSMC_Bank == FSMC_Bank3_NAND) + { + tmpsr = FSMC_Bank3->SR3; + } + /* FSMC_Bank4_PCCARD*/ + else + { + tmpsr = FSMC_Bank4->SR4; + } + + itstatus = tmpsr & FSMC_IT; + + itenable = tmpsr & (FSMC_IT >> 3); + if ((itstatus != (uint32_t)RESET) && (itenable != (uint32_t)RESET)) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the FSMC's interrupt pending bits. + * @param FSMC_Bank: specifies the FSMC Bank to be used + * This parameter can be one of the following values: + * @arg FSMC_Bank2_NAND: FSMC Bank2 NAND + * @arg FSMC_Bank3_NAND: FSMC Bank3 NAND + * @arg FSMC_Bank4_PCCARD: FSMC Bank4 PCCARD + * @param FSMC_IT: specifies the interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg FSMC_IT_RisingEdge: Rising edge detection interrupt. + * @arg FSMC_IT_Level: Level edge detection interrupt. + * @arg FSMC_IT_FallingEdge: Falling edge detection interrupt. + * @retval None + */ +void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT) +{ + /* Check the parameters */ + assert_param(IS_FSMC_IT_BANK(FSMC_Bank)); + assert_param(IS_FSMC_IT(FSMC_IT)); + + if(FSMC_Bank == FSMC_Bank2_NAND) + { + FSMC_Bank2->SR2 &= ~(FSMC_IT >> 3); + } + else if(FSMC_Bank == FSMC_Bank3_NAND) + { + FSMC_Bank3->SR3 &= ~(FSMC_IT >> 3); + } + /* FSMC_Bank4_PCCARD*/ + else + { + FSMC_Bank4->SR4 &= ~(FSMC_IT >> 3); + } +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c new file mode 100644 index 0000000..9befc20 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c @@ -0,0 +1,648 @@ +/** + ****************************************************************************** + * @file stm32f10x_gpio.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the GPIO firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_gpio.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup GPIO + * @brief GPIO driver modules + * @{ + */ + +/** @defgroup GPIO_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup GPIO_Private_Defines + * @{ + */ + +/* ------------ RCC registers bit address in the alias region ----------------*/ +#define AFIO_OFFSET (AFIO_BASE - PERIPH_BASE) + +/* --- EVENTCR Register -----*/ + +/* Alias word address of EVOE bit */ +#define EVCR_OFFSET (AFIO_OFFSET + 0x00) +#define EVOE_BitNumber ((uint8_t)0x07) +#define EVCR_EVOE_BB (PERIPH_BB_BASE + (EVCR_OFFSET * 32) + (EVOE_BitNumber * 4)) + + +/* --- MAPR Register ---*/ +/* Alias word address of MII_RMII_SEL bit */ +#define MAPR_OFFSET (AFIO_OFFSET + 0x04) +#define MII_RMII_SEL_BitNumber ((u8)0x17) +#define MAPR_MII_RMII_SEL_BB (PERIPH_BB_BASE + (MAPR_OFFSET * 32) + (MII_RMII_SEL_BitNumber * 4)) + + +#define EVCR_PORTPINCONFIG_MASK ((uint16_t)0xFF80) +#define LSB_MASK ((uint16_t)0xFFFF) +#define DBGAFR_POSITION_MASK ((uint32_t)0x000F0000) +#define DBGAFR_SWJCFG_MASK ((uint32_t)0xF0FFFFFF) +#define DBGAFR_LOCATION_MASK ((uint32_t)0x00200000) +#define DBGAFR_NUMBITS_MASK ((uint32_t)0x00100000) +/** + * @} + */ + +/** @defgroup GPIO_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup GPIO_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup GPIO_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup GPIO_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the GPIOx peripheral registers to their default reset values. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @retval None + */ +void GPIO_DeInit(GPIO_TypeDef* GPIOx) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + + if (GPIOx == GPIOA) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, DISABLE); + } + else if (GPIOx == GPIOB) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, DISABLE); + } + else if (GPIOx == GPIOC) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, DISABLE); + } + else if (GPIOx == GPIOD) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, DISABLE); + } + else if (GPIOx == GPIOE) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, DISABLE); + } + else if (GPIOx == GPIOF) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOF, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOF, DISABLE); + } + else + { + if (GPIOx == GPIOG) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOG, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOG, DISABLE); + } + } +} + +/** + * @brief Deinitializes the Alternate Functions (remap, event control + * and EXTI configuration) registers to their default reset values. + * @param None + * @retval None + */ +void GPIO_AFIODeInit(void) +{ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, DISABLE); +} + +/** + * @brief Initializes the GPIOx peripheral according to the specified + * parameters in the GPIO_InitStruct. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that + * contains the configuration information for the specified GPIO peripheral. + * @retval None + */ +void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) +{ + uint32_t currentmode = 0x00, currentpin = 0x00, pinpos = 0x00, pos = 0x00; + uint32_t tmpreg = 0x00, pinmask = 0x00; + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GPIO_MODE(GPIO_InitStruct->GPIO_Mode)); + assert_param(IS_GPIO_PIN(GPIO_InitStruct->GPIO_Pin)); + +/*---------------------------- GPIO Mode Configuration -----------------------*/ + currentmode = ((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x0F); + if ((((uint32_t)GPIO_InitStruct->GPIO_Mode) & ((uint32_t)0x10)) != 0x00) + { + /* Check the parameters */ + assert_param(IS_GPIO_SPEED(GPIO_InitStruct->GPIO_Speed)); + /* Output mode */ + currentmode |= (uint32_t)GPIO_InitStruct->GPIO_Speed; + } +/*---------------------------- GPIO CRL Configuration ------------------------*/ + /* Configure the eight low port pins */ + if (((uint32_t)GPIO_InitStruct->GPIO_Pin & ((uint32_t)0x00FF)) != 0x00) + { + tmpreg = GPIOx->CRL; + for (pinpos = 0x00; pinpos < 0x08; pinpos++) + { + pos = ((uint32_t)0x01) << pinpos; + /* Get the port pins position */ + currentpin = (GPIO_InitStruct->GPIO_Pin) & pos; + if (currentpin == pos) + { + pos = pinpos << 2; + /* Clear the corresponding low control register bits */ + pinmask = ((uint32_t)0x0F) << pos; + tmpreg &= ~pinmask; + /* Write the mode configuration in the corresponding bits */ + tmpreg |= (currentmode << pos); + /* Reset the corresponding ODR bit */ + if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD) + { + GPIOx->BRR = (((uint32_t)0x01) << pinpos); + } + else + { + /* Set the corresponding ODR bit */ + if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU) + { + GPIOx->BSRR = (((uint32_t)0x01) << pinpos); + } + } + } + } + GPIOx->CRL = tmpreg; + } +/*---------------------------- GPIO CRH Configuration ------------------------*/ + /* Configure the eight high port pins */ + if (GPIO_InitStruct->GPIO_Pin > 0x00FF) + { + tmpreg = GPIOx->CRH; + for (pinpos = 0x00; pinpos < 0x08; pinpos++) + { + pos = (((uint32_t)0x01) << (pinpos + 0x08)); + /* Get the port pins position */ + currentpin = ((GPIO_InitStruct->GPIO_Pin) & pos); + if (currentpin == pos) + { + pos = pinpos << 2; + /* Clear the corresponding high control register bits */ + pinmask = ((uint32_t)0x0F) << pos; + tmpreg &= ~pinmask; + /* Write the mode configuration in the corresponding bits */ + tmpreg |= (currentmode << pos); + /* Reset the corresponding ODR bit */ + if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD) + { + GPIOx->BRR = (((uint32_t)0x01) << (pinpos + 0x08)); + } + /* Set the corresponding ODR bit */ + if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU) + { + GPIOx->BSRR = (((uint32_t)0x01) << (pinpos + 0x08)); + } + } + } + GPIOx->CRH = tmpreg; + } +} + +/** + * @brief Fills each GPIO_InitStruct member with its default value. + * @param GPIO_InitStruct : pointer to a GPIO_InitTypeDef structure which will + * be initialized. + * @retval None + */ +void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct) +{ + /* Reset GPIO init structure parameters values */ + GPIO_InitStruct->GPIO_Pin = GPIO_Pin_All; + GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz; + GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING; +} + +/** + * @brief Reads the specified input port pin. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bit to read. + * This parameter can be GPIO_Pin_x where x can be (0..15). + * @retval The input port pin value. + */ +uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + uint8_t bitstatus = 0x00; + + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); + + if ((GPIOx->IDR & GPIO_Pin) != (uint32_t)Bit_RESET) + { + bitstatus = (uint8_t)Bit_SET; + } + else + { + bitstatus = (uint8_t)Bit_RESET; + } + return bitstatus; +} + +/** + * @brief Reads the specified GPIO input data port. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @retval GPIO input data port value. + */ +uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + + return ((uint16_t)GPIOx->IDR); +} + +/** + * @brief Reads the specified output data port bit. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bit to read. + * This parameter can be GPIO_Pin_x where x can be (0..15). + * @retval The output port pin value. + */ +uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + uint8_t bitstatus = 0x00; + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); + + if ((GPIOx->ODR & GPIO_Pin) != (uint32_t)Bit_RESET) + { + bitstatus = (uint8_t)Bit_SET; + } + else + { + bitstatus = (uint8_t)Bit_RESET; + } + return bitstatus; +} + +/** + * @brief Reads the specified GPIO output data port. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @retval GPIO output data port value. + */ +uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + + return ((uint16_t)GPIOx->ODR); +} + +/** + * @brief Sets the selected data port bits. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bits to be written. + * This parameter can be any combination of GPIO_Pin_x where x can be (0..15). + * @retval None + */ +void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + GPIOx->BSRR = GPIO_Pin; +} + +/** + * @brief Clears the selected data port bits. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bits to be written. + * This parameter can be any combination of GPIO_Pin_x where x can be (0..15). + * @retval None + */ +void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + GPIOx->BRR = GPIO_Pin; +} + +/** + * @brief Sets or clears the selected data port bit. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bit to be written. + * This parameter can be one of GPIO_Pin_x where x can be (0..15). + * @param BitVal: specifies the value to be written to the selected bit. + * This parameter can be one of the BitAction enum values: + * @arg Bit_RESET: to clear the port pin + * @arg Bit_SET: to set the port pin + * @retval None + */ +void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); + assert_param(IS_GPIO_BIT_ACTION(BitVal)); + + if (BitVal != Bit_RESET) + { + GPIOx->BSRR = GPIO_Pin; + } + else + { + GPIOx->BRR = GPIO_Pin; + } +} + +/** + * @brief Writes data to the specified GPIO data port. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param PortVal: specifies the value to be written to the port output data register. + * @retval None + */ +void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal) +{ + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + + GPIOx->ODR = PortVal; +} + +/** + * @brief Locks GPIO Pins configuration registers. + * @param GPIOx: where x can be (A..G) to select the GPIO peripheral. + * @param GPIO_Pin: specifies the port bit to be written. + * This parameter can be any combination of GPIO_Pin_x where x can be (0..15). + * @retval None + */ +void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + uint32_t tmp = 0x00010000; + + /* Check the parameters */ + assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + tmp |= GPIO_Pin; + /* Set LCKK bit */ + GPIOx->LCKR = tmp; + /* Reset LCKK bit */ + GPIOx->LCKR = GPIO_Pin; + /* Set LCKK bit */ + GPIOx->LCKR = tmp; + /* Read LCKK bit*/ + tmp = GPIOx->LCKR; + /* Read LCKK bit*/ + tmp = GPIOx->LCKR; +} + +/** + * @brief Selects the GPIO pin used as Event output. + * @param GPIO_PortSource: selects the GPIO port to be used as source + * for Event output. + * This parameter can be GPIO_PortSourceGPIOx where x can be (A..E). + * @param GPIO_PinSource: specifies the pin for the Event output. + * This parameter can be GPIO_PinSourcex where x can be (0..15). + * @retval None + */ +void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource) +{ + uint32_t tmpreg = 0x00; + /* Check the parameters */ + assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource)); + assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource)); + + tmpreg = AFIO->EVCR; + /* Clear the PORT[6:4] and PIN[3:0] bits */ + tmpreg &= EVCR_PORTPINCONFIG_MASK; + tmpreg |= (uint32_t)GPIO_PortSource << 0x04; + tmpreg |= GPIO_PinSource; + AFIO->EVCR = tmpreg; +} + +/** + * @brief Enables or disables the Event Output. + * @param NewState: new state of the Event output. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void GPIO_EventOutputCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) EVCR_EVOE_BB = (uint32_t)NewState; +} + +/** + * @brief Changes the mapping of the specified pin. + * @param GPIO_Remap: selects the pin to remap. + * This parameter can be one of the following values: + * @arg GPIO_Remap_SPI1 : SPI1 Alternate Function mapping + * @arg GPIO_Remap_I2C1 : I2C1 Alternate Function mapping + * @arg GPIO_Remap_USART1 : USART1 Alternate Function mapping + * @arg GPIO_Remap_USART2 : USART2 Alternate Function mapping + * @arg GPIO_PartialRemap_USART3 : USART3 Partial Alternate Function mapping + * @arg GPIO_FullRemap_USART3 : USART3 Full Alternate Function mapping + * @arg GPIO_PartialRemap_TIM1 : TIM1 Partial Alternate Function mapping + * @arg GPIO_FullRemap_TIM1 : TIM1 Full Alternate Function mapping + * @arg GPIO_PartialRemap1_TIM2 : TIM2 Partial1 Alternate Function mapping + * @arg GPIO_PartialRemap2_TIM2 : TIM2 Partial2 Alternate Function mapping + * @arg GPIO_FullRemap_TIM2 : TIM2 Full Alternate Function mapping + * @arg GPIO_PartialRemap_TIM3 : TIM3 Partial Alternate Function mapping + * @arg GPIO_FullRemap_TIM3 : TIM3 Full Alternate Function mapping + * @arg GPIO_Remap_TIM4 : TIM4 Alternate Function mapping + * @arg GPIO_Remap1_CAN1 : CAN1 Alternate Function mapping + * @arg GPIO_Remap2_CAN1 : CAN1 Alternate Function mapping + * @arg GPIO_Remap_PD01 : PD01 Alternate Function mapping + * @arg GPIO_Remap_TIM5CH4_LSI : LSI connected to TIM5 Channel4 input capture for calibration + * @arg GPIO_Remap_ADC1_ETRGINJ : ADC1 External Trigger Injected Conversion remapping + * @arg GPIO_Remap_ADC1_ETRGREG : ADC1 External Trigger Regular Conversion remapping + * @arg GPIO_Remap_ADC2_ETRGINJ : ADC2 External Trigger Injected Conversion remapping + * @arg GPIO_Remap_ADC2_ETRGREG : ADC2 External Trigger Regular Conversion remapping + * @arg GPIO_Remap_ETH : Ethernet remapping (only for Connectivity line devices) + * @arg GPIO_Remap_CAN2 : CAN2 remapping (only for Connectivity line devices) + * @arg GPIO_Remap_SWJ_NoJTRST : Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST + * @arg GPIO_Remap_SWJ_JTAGDisable : JTAG-DP Disabled and SW-DP Enabled + * @arg GPIO_Remap_SWJ_Disable : Full SWJ Disabled (JTAG-DP + SW-DP) + * @arg GPIO_Remap_SPI3 : SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices) + * When the SPI3/I2S3 is remapped using this function, the SWJ is configured + * to Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST. + * @arg GPIO_Remap_TIM2ITR1_PTP_SOF : Ethernet PTP output or USB OTG SOF (Start of Frame) connected + * to TIM2 Internal Trigger 1 for calibration (only for Connectivity line devices) + * If the GPIO_Remap_TIM2ITR1_PTP_SOF is enabled the TIM2 ITR1 is connected to + * Ethernet PTP output. When Reset TIM2 ITR1 is connected to USB OTG SOF output. + * @arg GPIO_Remap_PTP_PPS : Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices) + * @arg GPIO_Remap_TIM15 : TIM15 Alternate Function mapping (only for Value line devices) + * @arg GPIO_Remap_TIM16 : TIM16 Alternate Function mapping (only for Value line devices) + * @arg GPIO_Remap_TIM17 : TIM17 Alternate Function mapping (only for Value line devices) + * @arg GPIO_Remap_CEC : CEC Alternate Function mapping (only for Value line devices) + * @arg GPIO_Remap_TIM1_DMA : TIM1 DMA requests mapping (only for Value line devices) + * @arg GPIO_Remap_TIM9 : TIM9 Alternate Function mapping (only for XL-density devices) + * @arg GPIO_Remap_TIM10 : TIM10 Alternate Function mapping (only for XL-density devices) + * @arg GPIO_Remap_TIM11 : TIM11 Alternate Function mapping (only for XL-density devices) + * @arg GPIO_Remap_TIM13 : TIM13 Alternate Function mapping (only for High density Value line and XL-density devices) + * @arg GPIO_Remap_TIM14 : TIM14 Alternate Function mapping (only for High density Value line and XL-density devices) + * @arg GPIO_Remap_FSMC_NADV : FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices) + * @arg GPIO_Remap_TIM67_DAC_DMA : TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices) + * @arg GPIO_Remap_TIM12 : TIM12 Alternate Function mapping (only for High density Value line devices) + * @arg GPIO_Remap_MISC : Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping, + * only for High density Value line devices) + * @param NewState: new state of the port pin remapping. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void GPIO_PinRemapConfig(uint32_t GPIO_Remap, FunctionalState NewState) +{ + uint32_t tmp = 0x00, tmp1 = 0x00, tmpreg = 0x00, tmpmask = 0x00; + + /* Check the parameters */ + assert_param(IS_GPIO_REMAP(GPIO_Remap)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if((GPIO_Remap & 0x80000000) == 0x80000000) + { + tmpreg = AFIO->MAPR2; + } + else + { + tmpreg = AFIO->MAPR; + } + + tmpmask = (GPIO_Remap & DBGAFR_POSITION_MASK) >> 0x10; + tmp = GPIO_Remap & LSB_MASK; + + if ((GPIO_Remap & (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK)) == (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK)) + { + tmpreg &= DBGAFR_SWJCFG_MASK; + AFIO->MAPR &= DBGAFR_SWJCFG_MASK; + } + else if ((GPIO_Remap & DBGAFR_NUMBITS_MASK) == DBGAFR_NUMBITS_MASK) + { + tmp1 = ((uint32_t)0x03) << tmpmask; + tmpreg &= ~tmp1; + tmpreg |= ~DBGAFR_SWJCFG_MASK; + } + else + { + tmpreg &= ~(tmp << ((GPIO_Remap >> 0x15)*0x10)); + tmpreg |= ~DBGAFR_SWJCFG_MASK; + } + + if (NewState != DISABLE) + { + tmpreg |= (tmp << ((GPIO_Remap >> 0x15)*0x10)); + } + + if((GPIO_Remap & 0x80000000) == 0x80000000) + { + AFIO->MAPR2 = tmpreg; + } + else + { + AFIO->MAPR = tmpreg; + } +} + +/** + * @brief Selects the GPIO pin used as EXTI Line. + * @param GPIO_PortSource: selects the GPIO port to be used as source for EXTI lines. + * This parameter can be GPIO_PortSourceGPIOx where x can be (A..G). + * @param GPIO_PinSource: specifies the EXTI line to be configured. + * This parameter can be GPIO_PinSourcex where x can be (0..15). + * @retval None + */ +void GPIO_EXTILineConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource) +{ + uint32_t tmp = 0x00; + /* Check the parameters */ + assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource)); + assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource)); + + tmp = ((uint32_t)0x0F) << (0x04 * (GPIO_PinSource & (uint8_t)0x03)); + AFIO->EXTICR[GPIO_PinSource >> 0x02] &= ~tmp; + AFIO->EXTICR[GPIO_PinSource >> 0x02] |= (((uint32_t)GPIO_PortSource) << (0x04 * (GPIO_PinSource & (uint8_t)0x03))); +} + +/** + * @brief Selects the Ethernet media interface. + * @note This function applies only to STM32 Connectivity line devices. + * @param GPIO_ETH_MediaInterface: specifies the Media Interface mode. + * This parameter can be one of the following values: + * @arg GPIO_ETH_MediaInterface_MII: MII mode + * @arg GPIO_ETH_MediaInterface_RMII: RMII mode + * @retval None + */ +void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface) +{ + assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface)); + + /* Configure MII_RMII selection bit */ + *(__IO uint32_t *) MAPR_MII_RMII_SEL_BB = GPIO_ETH_MediaInterface; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c new file mode 100644 index 0000000..539c96c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c @@ -0,0 +1,1329 @@ +/** + ****************************************************************************** + * @file stm32f10x_i2c.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the I2C firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_i2c.h" +#include "stm32f10x_rcc.h" + + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup I2C + * @brief I2C driver modules + * @{ + */ + +/** @defgroup I2C_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup I2C_Private_Defines + * @{ + */ + +/* I2C SPE mask */ +#define CR1_PE_Set ((uint16_t)0x0001) +#define CR1_PE_Reset ((uint16_t)0xFFFE) + +/* I2C START mask */ +#define CR1_START_Set ((uint16_t)0x0100) +#define CR1_START_Reset ((uint16_t)0xFEFF) + +/* I2C STOP mask */ +#define CR1_STOP_Set ((uint16_t)0x0200) +#define CR1_STOP_Reset ((uint16_t)0xFDFF) + +/* I2C ACK mask */ +#define CR1_ACK_Set ((uint16_t)0x0400) +#define CR1_ACK_Reset ((uint16_t)0xFBFF) + +/* I2C ENGC mask */ +#define CR1_ENGC_Set ((uint16_t)0x0040) +#define CR1_ENGC_Reset ((uint16_t)0xFFBF) + +/* I2C SWRST mask */ +#define CR1_SWRST_Set ((uint16_t)0x8000) +#define CR1_SWRST_Reset ((uint16_t)0x7FFF) + +/* I2C PEC mask */ +#define CR1_PEC_Set ((uint16_t)0x1000) +#define CR1_PEC_Reset ((uint16_t)0xEFFF) + +/* I2C ENPEC mask */ +#define CR1_ENPEC_Set ((uint16_t)0x0020) +#define CR1_ENPEC_Reset ((uint16_t)0xFFDF) + +/* I2C ENARP mask */ +#define CR1_ENARP_Set ((uint16_t)0x0010) +#define CR1_ENARP_Reset ((uint16_t)0xFFEF) + +/* I2C NOSTRETCH mask */ +#define CR1_NOSTRETCH_Set ((uint16_t)0x0080) +#define CR1_NOSTRETCH_Reset ((uint16_t)0xFF7F) + +/* I2C registers Masks */ +#define CR1_CLEAR_Mask ((uint16_t)0xFBF5) + +/* I2C DMAEN mask */ +#define CR2_DMAEN_Set ((uint16_t)0x0800) +#define CR2_DMAEN_Reset ((uint16_t)0xF7FF) + +/* I2C LAST mask */ +#define CR2_LAST_Set ((uint16_t)0x1000) +#define CR2_LAST_Reset ((uint16_t)0xEFFF) + +/* I2C FREQ mask */ +#define CR2_FREQ_Reset ((uint16_t)0xFFC0) + +/* I2C ADD0 mask */ +#define OAR1_ADD0_Set ((uint16_t)0x0001) +#define OAR1_ADD0_Reset ((uint16_t)0xFFFE) + +/* I2C ENDUAL mask */ +#define OAR2_ENDUAL_Set ((uint16_t)0x0001) +#define OAR2_ENDUAL_Reset ((uint16_t)0xFFFE) + +/* I2C ADD2 mask */ +#define OAR2_ADD2_Reset ((uint16_t)0xFF01) + +/* I2C F/S mask */ +#define CCR_FS_Set ((uint16_t)0x8000) + +/* I2C CCR mask */ +#define CCR_CCR_Set ((uint16_t)0x0FFF) + +/* I2C FLAG mask */ +#define FLAG_Mask ((uint32_t)0x00FFFFFF) + +/* I2C Interrupt Enable mask */ +#define ITEN_Mask ((uint32_t)0x07000000) + +/** + * @} + */ + +/** @defgroup I2C_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup I2C_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup I2C_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup I2C_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the I2Cx peripheral registers to their default reset values. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @retval None + */ +void I2C_DeInit(I2C_TypeDef* I2Cx) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + if (I2Cx == I2C1) + { + /* Enable I2C1 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C1, ENABLE); + /* Release I2C1 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C1, DISABLE); + } + else + { + /* Enable I2C2 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C2, ENABLE); + /* Release I2C2 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_I2C2, DISABLE); + } +} + +/** + * @brief Initializes the I2Cx peripheral according to the specified + * parameters in the I2C_InitStruct. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_InitStruct: pointer to a I2C_InitTypeDef structure that + * contains the configuration information for the specified I2C peripheral. + * @retval None + */ +void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct) +{ + uint16_t tmpreg = 0, freqrange = 0; + uint16_t result = 0x04; + uint32_t pclk1 = 8000000; + RCC_ClocksTypeDef rcc_clocks; + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_CLOCK_SPEED(I2C_InitStruct->I2C_ClockSpeed)); + assert_param(IS_I2C_MODE(I2C_InitStruct->I2C_Mode)); + assert_param(IS_I2C_DUTY_CYCLE(I2C_InitStruct->I2C_DutyCycle)); + assert_param(IS_I2C_OWN_ADDRESS1(I2C_InitStruct->I2C_OwnAddress1)); + assert_param(IS_I2C_ACK_STATE(I2C_InitStruct->I2C_Ack)); + assert_param(IS_I2C_ACKNOWLEDGE_ADDRESS(I2C_InitStruct->I2C_AcknowledgedAddress)); + +/*---------------------------- I2Cx CR2 Configuration ------------------------*/ + /* Get the I2Cx CR2 value */ + tmpreg = I2Cx->CR2; + /* Clear frequency FREQ[5:0] bits */ + tmpreg &= CR2_FREQ_Reset; + /* Get pclk1 frequency value */ + RCC_GetClocksFreq(&rcc_clocks); + pclk1 = rcc_clocks.PCLK1_Frequency; + /* Set frequency bits depending on pclk1 value */ + freqrange = (uint16_t)(pclk1 / 1000000); + tmpreg |= freqrange; + /* Write to I2Cx CR2 */ + I2Cx->CR2 = tmpreg; + +/*---------------------------- I2Cx CCR Configuration ------------------------*/ + /* Disable the selected I2C peripheral to configure TRISE */ + I2Cx->CR1 &= CR1_PE_Reset; + /* Reset tmpreg value */ + /* Clear F/S, DUTY and CCR[11:0] bits */ + tmpreg = 0; + + /* Configure speed in standard mode */ + if (I2C_InitStruct->I2C_ClockSpeed <= 100000) + { + /* Standard mode speed calculate */ + result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed << 1)); + /* Test if CCR value is under 0x4*/ + if (result < 0x04) + { + /* Set minimum allowed value */ + result = 0x04; + } + /* Set speed value for standard mode */ + tmpreg |= result; + /* Set Maximum Rise Time for standard mode */ + I2Cx->TRISE = freqrange + 1; + } + /* Configure speed in fast mode */ + else /*(I2C_InitStruct->I2C_ClockSpeed <= 400000)*/ + { + if (I2C_InitStruct->I2C_DutyCycle == I2C_DutyCycle_2) + { + /* Fast mode speed calculate: Tlow/Thigh = 2 */ + result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed * 3)); + } + else /*I2C_InitStruct->I2C_DutyCycle == I2C_DutyCycle_16_9*/ + { + /* Fast mode speed calculate: Tlow/Thigh = 16/9 */ + result = (uint16_t)(pclk1 / (I2C_InitStruct->I2C_ClockSpeed * 25)); + /* Set DUTY bit */ + result |= I2C_DutyCycle_16_9; + } + + /* Test if CCR value is under 0x1*/ + if ((result & CCR_CCR_Set) == 0) + { + /* Set minimum allowed value */ + result |= (uint16_t)0x0001; + } + /* Set speed value and set F/S bit for fast mode */ + tmpreg |= (uint16_t)(result | CCR_FS_Set); + /* Set Maximum Rise Time for fast mode */ + I2Cx->TRISE = (uint16_t)(((freqrange * (uint16_t)300) / (uint16_t)1000) + (uint16_t)1); + } + + /* Write to I2Cx CCR */ + I2Cx->CCR = tmpreg; + /* Enable the selected I2C peripheral */ + I2Cx->CR1 |= CR1_PE_Set; + +/*---------------------------- I2Cx CR1 Configuration ------------------------*/ + /* Get the I2Cx CR1 value */ + tmpreg = I2Cx->CR1; + /* Clear ACK, SMBTYPE and SMBUS bits */ + tmpreg &= CR1_CLEAR_Mask; + /* Configure I2Cx: mode and acknowledgement */ + /* Set SMBTYPE and SMBUS bits according to I2C_Mode value */ + /* Set ACK bit according to I2C_Ack value */ + tmpreg |= (uint16_t)((uint32_t)I2C_InitStruct->I2C_Mode | I2C_InitStruct->I2C_Ack); + /* Write to I2Cx CR1 */ + I2Cx->CR1 = tmpreg; + +/*---------------------------- I2Cx OAR1 Configuration -----------------------*/ + /* Set I2Cx Own Address1 and acknowledged address */ + I2Cx->OAR1 = (I2C_InitStruct->I2C_AcknowledgedAddress | I2C_InitStruct->I2C_OwnAddress1); +} + +/** + * @brief Fills each I2C_InitStruct member with its default value. + * @param I2C_InitStruct: pointer to an I2C_InitTypeDef structure which will be initialized. + * @retval None + */ +void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct) +{ +/*---------------- Reset I2C init structure parameters values ----------------*/ + /* initialize the I2C_ClockSpeed member */ + I2C_InitStruct->I2C_ClockSpeed = 5000; + /* Initialize the I2C_Mode member */ + I2C_InitStruct->I2C_Mode = I2C_Mode_I2C; + /* Initialize the I2C_DutyCycle member */ + I2C_InitStruct->I2C_DutyCycle = I2C_DutyCycle_2; + /* Initialize the I2C_OwnAddress1 member */ + I2C_InitStruct->I2C_OwnAddress1 = 0; + /* Initialize the I2C_Ack member */ + I2C_InitStruct->I2C_Ack = I2C_Ack_Disable; + /* Initialize the I2C_AcknowledgedAddress member */ + I2C_InitStruct->I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit; +} + +/** + * @brief Enables or disables the specified I2C peripheral. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2Cx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected I2C peripheral */ + I2Cx->CR1 |= CR1_PE_Set; + } + else + { + /* Disable the selected I2C peripheral */ + I2Cx->CR1 &= CR1_PE_Reset; + } +} + +/** + * @brief Enables or disables the specified I2C DMA requests. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C DMA transfer. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected I2C DMA requests */ + I2Cx->CR2 |= CR2_DMAEN_Set; + } + else + { + /* Disable the selected I2C DMA requests */ + I2Cx->CR2 &= CR2_DMAEN_Reset; + } +} + +/** + * @brief Specifies if the next DMA transfer will be the last one. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C DMA last transfer. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Next DMA transfer is the last transfer */ + I2Cx->CR2 |= CR2_LAST_Set; + } + else + { + /* Next DMA transfer is not the last transfer */ + I2Cx->CR2 &= CR2_LAST_Reset; + } +} + +/** + * @brief Generates I2Cx communication START condition. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C START condition generation. + * This parameter can be: ENABLE or DISABLE. + * @retval None. + */ +void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Generate a START condition */ + I2Cx->CR1 |= CR1_START_Set; + } + else + { + /* Disable the START condition generation */ + I2Cx->CR1 &= CR1_START_Reset; + } +} + +/** + * @brief Generates I2Cx communication STOP condition. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C STOP condition generation. + * This parameter can be: ENABLE or DISABLE. + * @retval None. + */ +void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Generate a STOP condition */ + I2Cx->CR1 |= CR1_STOP_Set; + } + else + { + /* Disable the STOP condition generation */ + I2Cx->CR1 &= CR1_STOP_Reset; + } +} + +/** + * @brief Enables or disables the specified I2C acknowledge feature. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C Acknowledgement. + * This parameter can be: ENABLE or DISABLE. + * @retval None. + */ +void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the acknowledgement */ + I2Cx->CR1 |= CR1_ACK_Set; + } + else + { + /* Disable the acknowledgement */ + I2Cx->CR1 &= CR1_ACK_Reset; + } +} + +/** + * @brief Configures the specified I2C own address2. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param Address: specifies the 7bit I2C own address2. + * @retval None. + */ +void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address) +{ + uint16_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* Get the old register value */ + tmpreg = I2Cx->OAR2; + + /* Reset I2Cx Own address2 bit [7:1] */ + tmpreg &= OAR2_ADD2_Reset; + + /* Set I2Cx Own address2 */ + tmpreg |= (uint16_t)((uint16_t)Address & (uint16_t)0x00FE); + + /* Store the new register value */ + I2Cx->OAR2 = tmpreg; +} + +/** + * @brief Enables or disables the specified I2C dual addressing mode. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C dual addressing mode. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_DualAddressCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable dual addressing mode */ + I2Cx->OAR2 |= OAR2_ENDUAL_Set; + } + else + { + /* Disable dual addressing mode */ + I2Cx->OAR2 &= OAR2_ENDUAL_Reset; + } +} + +/** + * @brief Enables or disables the specified I2C general call feature. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C General call. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_GeneralCallCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable generall call */ + I2Cx->CR1 |= CR1_ENGC_Set; + } + else + { + /* Disable generall call */ + I2Cx->CR1 &= CR1_ENGC_Reset; + } +} + +/** + * @brief Enables or disables the specified I2C interrupts. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_IT: specifies the I2C interrupts sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg I2C_IT_BUF: Buffer interrupt mask + * @arg I2C_IT_EVT: Event interrupt mask + * @arg I2C_IT_ERR: Error interrupt mask + * @param NewState: new state of the specified I2C interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_ITConfig(I2C_TypeDef* I2Cx, uint16_t I2C_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + assert_param(IS_I2C_CONFIG_IT(I2C_IT)); + + if (NewState != DISABLE) + { + /* Enable the selected I2C interrupts */ + I2Cx->CR2 |= I2C_IT; + } + else + { + /* Disable the selected I2C interrupts */ + I2Cx->CR2 &= (uint16_t)~I2C_IT; + } +} + +/** + * @brief Sends a data byte through the I2Cx peripheral. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param Data: Byte to be transmitted.. + * @retval None + */ +void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + /* Write in the DR register the data to be sent */ + I2Cx->DR = Data; +} + +/** + * @brief Returns the most recent received data by the I2Cx peripheral. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @retval The value of the received data. + */ +uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + /* Return the data in the DR register */ + return (uint8_t)I2Cx->DR; +} + +/** + * @brief Transmits the address byte to select the slave device. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param Address: specifies the slave address which will be transmitted + * @param I2C_Direction: specifies whether the I2C device will be a + * Transmitter or a Receiver. This parameter can be one of the following values + * @arg I2C_Direction_Transmitter: Transmitter mode + * @arg I2C_Direction_Receiver: Receiver mode + * @retval None. + */ +void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C_Direction) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_DIRECTION(I2C_Direction)); + /* Test on the direction to set/reset the read/write bit */ + if (I2C_Direction != I2C_Direction_Transmitter) + { + /* Set the address bit0 for read */ + Address |= OAR1_ADD0_Set; + } + else + { + /* Reset the address bit0 for write */ + Address &= OAR1_ADD0_Reset; + } + /* Send the address */ + I2Cx->DR = Address; +} + +/** + * @brief Reads the specified I2C register and returns its value. + * @param I2C_Register: specifies the register to read. + * This parameter can be one of the following values: + * @arg I2C_Register_CR1: CR1 register. + * @arg I2C_Register_CR2: CR2 register. + * @arg I2C_Register_OAR1: OAR1 register. + * @arg I2C_Register_OAR2: OAR2 register. + * @arg I2C_Register_DR: DR register. + * @arg I2C_Register_SR1: SR1 register. + * @arg I2C_Register_SR2: SR2 register. + * @arg I2C_Register_CCR: CCR register. + * @arg I2C_Register_TRISE: TRISE register. + * @retval The value of the read register. + */ +uint16_t I2C_ReadRegister(I2C_TypeDef* I2Cx, uint8_t I2C_Register) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_REGISTER(I2C_Register)); + + tmp = (uint32_t) I2Cx; + tmp += I2C_Register; + + /* Return the selected register value */ + return (*(__IO uint16_t *) tmp); +} + +/** + * @brief Enables or disables the specified I2C software reset. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C software reset. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Peripheral under reset */ + I2Cx->CR1 |= CR1_SWRST_Set; + } + else + { + /* Peripheral not under reset */ + I2Cx->CR1 &= CR1_SWRST_Reset; + } +} + +/** + * @brief Selects the specified I2C NACK position in master receiver mode. + * This function is useful in I2C Master Receiver mode when the number + * of data to be received is equal to 2. In this case, this function + * should be called (with parameter I2C_NACKPosition_Next) before data + * reception starts,as described in the 2-byte reception procedure + * recommended in Reference Manual in Section: Master receiver. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_NACKPosition: specifies the NACK position. + * This parameter can be one of the following values: + * @arg I2C_NACKPosition_Next: indicates that the next byte will be the last + * received byte. + * @arg I2C_NACKPosition_Current: indicates that current byte is the last + * received byte. + * + * @note This function configures the same bit (POS) as I2C_PECPositionConfig() + * but is intended to be used in I2C mode while I2C_PECPositionConfig() + * is intended to used in SMBUS mode. + * + * @retval None + */ +void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_NACK_POSITION(I2C_NACKPosition)); + + /* Check the input parameter */ + if (I2C_NACKPosition == I2C_NACKPosition_Next) + { + /* Next byte in shift register is the last received byte */ + I2Cx->CR1 |= I2C_NACKPosition_Next; + } + else + { + /* Current byte in shift register is the last received byte */ + I2Cx->CR1 &= I2C_NACKPosition_Current; + } +} + +/** + * @brief Drives the SMBusAlert pin high or low for the specified I2C. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_SMBusAlert: specifies SMBAlert pin level. + * This parameter can be one of the following values: + * @arg I2C_SMBusAlert_Low: SMBAlert pin driven low + * @arg I2C_SMBusAlert_High: SMBAlert pin driven high + * @retval None + */ +void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t I2C_SMBusAlert) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_SMBUS_ALERT(I2C_SMBusAlert)); + if (I2C_SMBusAlert == I2C_SMBusAlert_Low) + { + /* Drive the SMBusAlert pin Low */ + I2Cx->CR1 |= I2C_SMBusAlert_Low; + } + else + { + /* Drive the SMBusAlert pin High */ + I2Cx->CR1 &= I2C_SMBusAlert_High; + } +} + +/** + * @brief Enables or disables the specified I2C PEC transfer. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2C PEC transmission. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected I2C PEC transmission */ + I2Cx->CR1 |= CR1_PEC_Set; + } + else + { + /* Disable the selected I2C PEC transmission */ + I2Cx->CR1 &= CR1_PEC_Reset; + } +} + +/** + * @brief Selects the specified I2C PEC position. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_PECPosition: specifies the PEC position. + * This parameter can be one of the following values: + * @arg I2C_PECPosition_Next: indicates that the next byte is PEC + * @arg I2C_PECPosition_Current: indicates that current byte is PEC + * + * @note This function configures the same bit (POS) as I2C_NACKPositionConfig() + * but is intended to be used in SMBUS mode while I2C_NACKPositionConfig() + * is intended to used in I2C mode. + * + * @retval None + */ +void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_PECPosition) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_PEC_POSITION(I2C_PECPosition)); + if (I2C_PECPosition == I2C_PECPosition_Next) + { + /* Next byte in shift register is PEC */ + I2Cx->CR1 |= I2C_PECPosition_Next; + } + else + { + /* Current byte in shift register is PEC */ + I2Cx->CR1 &= I2C_PECPosition_Current; + } +} + +/** + * @brief Enables or disables the PEC value calculation of the transferred bytes. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2Cx PEC value calculation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected I2C PEC calculation */ + I2Cx->CR1 |= CR1_ENPEC_Set; + } + else + { + /* Disable the selected I2C PEC calculation */ + I2Cx->CR1 &= CR1_ENPEC_Reset; + } +} + +/** + * @brief Returns the PEC value for the specified I2C. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @retval The PEC value. + */ +uint8_t I2C_GetPEC(I2C_TypeDef* I2Cx) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + /* Return the selected I2C PEC value */ + return ((I2Cx->SR2) >> 8); +} + +/** + * @brief Enables or disables the specified I2C ARP. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2Cx ARP. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_ARPCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected I2C ARP */ + I2Cx->CR1 |= CR1_ENARP_Set; + } + else + { + /* Disable the selected I2C ARP */ + I2Cx->CR1 &= CR1_ENARP_Reset; + } +} + +/** + * @brief Enables or disables the specified I2C Clock stretching. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param NewState: new state of the I2Cx Clock stretching. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState == DISABLE) + { + /* Enable the selected I2C Clock stretching */ + I2Cx->CR1 |= CR1_NOSTRETCH_Set; + } + else + { + /* Disable the selected I2C Clock stretching */ + I2Cx->CR1 &= CR1_NOSTRETCH_Reset; + } +} + +/** + * @brief Selects the specified I2C fast mode duty cycle. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_DutyCycle: specifies the fast mode duty cycle. + * This parameter can be one of the following values: + * @arg I2C_DutyCycle_2: I2C fast mode Tlow/Thigh = 2 + * @arg I2C_DutyCycle_16_9: I2C fast mode Tlow/Thigh = 16/9 + * @retval None + */ +void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t I2C_DutyCycle) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_DUTY_CYCLE(I2C_DutyCycle)); + if (I2C_DutyCycle != I2C_DutyCycle_16_9) + { + /* I2C fast mode Tlow/Thigh=2 */ + I2Cx->CCR &= I2C_DutyCycle_2; + } + else + { + /* I2C fast mode Tlow/Thigh=16/9 */ + I2Cx->CCR |= I2C_DutyCycle_16_9; + } +} + + + +/** + * @brief + **************************************************************************************** + * + * I2C State Monitoring Functions + * + **************************************************************************************** + * This I2C driver provides three different ways for I2C state monitoring + * depending on the application requirements and constraints: + * + * + * 1) Basic state monitoring: + * Using I2C_CheckEvent() function: + * It compares the status registers (SR1 and SR2) content to a given event + * (can be the combination of one or more flags). + * It returns SUCCESS if the current status includes the given flags + * and returns ERROR if one or more flags are missing in the current status. + * - When to use: + * - This function is suitable for most applications as well as for startup + * activity since the events are fully described in the product reference manual + * (RM0008). + * - It is also suitable for users who need to define their own events. + * - Limitations: + * - If an error occurs (ie. error flags are set besides to the monitored flags), + * the I2C_CheckEvent() function may return SUCCESS despite the communication + * hold or corrupted real state. + * In this case, it is advised to use error interrupts to monitor the error + * events and handle them in the interrupt IRQ handler. + * + * @note + * For error management, it is advised to use the following functions: + * - I2C_ITConfig() to configure and enable the error interrupts (I2C_IT_ERR). + * - I2Cx_ER_IRQHandler() which is called when the error interrupt occurs. + * Where x is the peripheral instance (I2C1, I2C2 ...) + * - I2C_GetFlagStatus() or I2C_GetITStatus() to be called into I2Cx_ER_IRQHandler() + * in order to determine which error occured. + * - I2C_ClearFlag() or I2C_ClearITPendingBit() and/or I2C_SoftwareResetCmd() + * and/or I2C_GenerateStop() in order to clear the error flag and source, + * and return to correct communication status. + * + * + * 2) Advanced state monitoring: + * Using the function I2C_GetLastEvent() which returns the image of both status + * registers in a single word (uint32_t) (Status Register 2 value is shifted left + * by 16 bits and concatenated to Status Register 1). + * - When to use: + * - This function is suitable for the same applications above but it allows to + * overcome the mentioned limitation of I2C_GetFlagStatus() function. + * The returned value could be compared to events already defined in the + * library (stm32f10x_i2c.h) or to custom values defined by user. + * - This function is suitable when multiple flags are monitored at the same time. + * - At the opposite of I2C_CheckEvent() function, this function allows user to + * choose when an event is accepted (when all events flags are set and no + * other flags are set or just when the needed flags are set like + * I2C_CheckEvent() function). + * - Limitations: + * - User may need to define his own events. + * - Same remark concerning the error management is applicable for this + * function if user decides to check only regular communication flags (and + * ignores error flags). + * + * + * 3) Flag-based state monitoring: + * Using the function I2C_GetFlagStatus() which simply returns the status of + * one single flag (ie. I2C_FLAG_RXNE ...). + * - When to use: + * - This function could be used for specific applications or in debug phase. + * - It is suitable when only one flag checking is needed (most I2C events + * are monitored through multiple flags). + * - Limitations: + * - When calling this function, the Status register is accessed. Some flags are + * cleared when the status register is accessed. So checking the status + * of one Flag, may clear other ones. + * - Function may need to be called twice or more in order to monitor one + * single event. + * + * For detailed description of Events, please refer to section I2C_Events in + * stm32f10x_i2c.h file. + * + */ + +/** + * + * 1) Basic state monitoring + ******************************************************************************* + */ + +/** + * @brief Checks whether the last I2Cx Event is equal to the one passed + * as parameter. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_EVENT: specifies the event to be checked. + * This parameter can be one of the following values: + * @arg I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED : EV1 + * @arg I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED : EV1 + * @arg I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED : EV1 + * @arg I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED : EV1 + * @arg I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED : EV1 + * @arg I2C_EVENT_SLAVE_BYTE_RECEIVED : EV2 + * @arg (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_DUALF) : EV2 + * @arg (I2C_EVENT_SLAVE_BYTE_RECEIVED | I2C_FLAG_GENCALL) : EV2 + * @arg I2C_EVENT_SLAVE_BYTE_TRANSMITTED : EV3 + * @arg (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_DUALF) : EV3 + * @arg (I2C_EVENT_SLAVE_BYTE_TRANSMITTED | I2C_FLAG_GENCALL) : EV3 + * @arg I2C_EVENT_SLAVE_ACK_FAILURE : EV3_2 + * @arg I2C_EVENT_SLAVE_STOP_DETECTED : EV4 + * @arg I2C_EVENT_MASTER_MODE_SELECT : EV5 + * @arg I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED : EV6 + * @arg I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED : EV6 + * @arg I2C_EVENT_MASTER_BYTE_RECEIVED : EV7 + * @arg I2C_EVENT_MASTER_BYTE_TRANSMITTING : EV8 + * @arg I2C_EVENT_MASTER_BYTE_TRANSMITTED : EV8_2 + * @arg I2C_EVENT_MASTER_MODE_ADDRESS10 : EV9 + * + * @note: For detailed description of Events, please refer to section + * I2C_Events in stm32f10x_i2c.h file. + * + * @retval An ErrorStatus enumeration value: + * - SUCCESS: Last event is equal to the I2C_EVENT + * - ERROR: Last event is different from the I2C_EVENT + */ +ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, uint32_t I2C_EVENT) +{ + uint32_t lastevent = 0; + uint32_t flag1 = 0, flag2 = 0; + ErrorStatus status = ERROR; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_EVENT(I2C_EVENT)); + + /* Read the I2Cx status register */ + flag1 = I2Cx->SR1; + flag2 = I2Cx->SR2; + flag2 = flag2 << 16; + + /* Get the last event value from I2C status register */ + lastevent = (flag1 | flag2) & FLAG_Mask; + + /* Check whether the last event contains the I2C_EVENT */ + if ((lastevent & I2C_EVENT) == I2C_EVENT) + { + /* SUCCESS: last event is equal to I2C_EVENT */ + status = SUCCESS; + } + else + { + /* ERROR: last event is different from I2C_EVENT */ + status = ERROR; + } + /* Return status */ + return status; +} + +/** + * + * 2) Advanced state monitoring + ******************************************************************************* + */ + +/** + * @brief Returns the last I2Cx Event. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * + * @note: For detailed description of Events, please refer to section + * I2C_Events in stm32f10x_i2c.h file. + * + * @retval The last event + */ +uint32_t I2C_GetLastEvent(I2C_TypeDef* I2Cx) +{ + uint32_t lastevent = 0; + uint32_t flag1 = 0, flag2 = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + + /* Read the I2Cx status register */ + flag1 = I2Cx->SR1; + flag2 = I2Cx->SR2; + flag2 = flag2 << 16; + + /* Get the last event value from I2C status register */ + lastevent = (flag1 | flag2) & FLAG_Mask; + + /* Return status */ + return lastevent; +} + +/** + * + * 3) Flag-based state monitoring + ******************************************************************************* + */ + +/** + * @brief Checks whether the specified I2C flag is set or not. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg I2C_FLAG_DUALF: Dual flag (Slave mode) + * @arg I2C_FLAG_SMBHOST: SMBus host header (Slave mode) + * @arg I2C_FLAG_SMBDEFAULT: SMBus default header (Slave mode) + * @arg I2C_FLAG_GENCALL: General call header flag (Slave mode) + * @arg I2C_FLAG_TRA: Transmitter/Receiver flag + * @arg I2C_FLAG_BUSY: Bus busy flag + * @arg I2C_FLAG_MSL: Master/Slave flag + * @arg I2C_FLAG_SMBALERT: SMBus Alert flag + * @arg I2C_FLAG_TIMEOUT: Timeout or Tlow error flag + * @arg I2C_FLAG_PECERR: PEC error in reception flag + * @arg I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode) + * @arg I2C_FLAG_AF: Acknowledge failure flag + * @arg I2C_FLAG_ARLO: Arbitration lost flag (Master mode) + * @arg I2C_FLAG_BERR: Bus error flag + * @arg I2C_FLAG_TXE: Data register empty flag (Transmitter) + * @arg I2C_FLAG_RXNE: Data register not empty (Receiver) flag + * @arg I2C_FLAG_STOPF: Stop detection flag (Slave mode) + * @arg I2C_FLAG_ADD10: 10-bit header sent flag (Master mode) + * @arg I2C_FLAG_BTF: Byte transfer finished flag + * @arg I2C_FLAG_ADDR: Address sent flag (Master mode) "ADSL" + * Address matched flag (Slave mode)"ENDA" + * @arg I2C_FLAG_SB: Start bit flag (Master mode) + * @retval The new state of I2C_FLAG (SET or RESET). + */ +FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG) +{ + FlagStatus bitstatus = RESET; + __IO uint32_t i2creg = 0, i2cxbase = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_GET_FLAG(I2C_FLAG)); + + /* Get the I2Cx peripheral base address */ + i2cxbase = (uint32_t)I2Cx; + + /* Read flag register index */ + i2creg = I2C_FLAG >> 28; + + /* Get bit[23:0] of the flag */ + I2C_FLAG &= FLAG_Mask; + + if(i2creg != 0) + { + /* Get the I2Cx SR1 register address */ + i2cxbase += 0x14; + } + else + { + /* Flag in I2Cx SR2 Register */ + I2C_FLAG = (uint32_t)(I2C_FLAG >> 16); + /* Get the I2Cx SR2 register address */ + i2cxbase += 0x18; + } + + if(((*(__IO uint32_t *)i2cxbase) & I2C_FLAG) != (uint32_t)RESET) + { + /* I2C_FLAG is set */ + bitstatus = SET; + } + else + { + /* I2C_FLAG is reset */ + bitstatus = RESET; + } + + /* Return the I2C_FLAG status */ + return bitstatus; +} + + + +/** + * @brief Clears the I2Cx's pending flags. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg I2C_FLAG_SMBALERT: SMBus Alert flag + * @arg I2C_FLAG_TIMEOUT: Timeout or Tlow error flag + * @arg I2C_FLAG_PECERR: PEC error in reception flag + * @arg I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode) + * @arg I2C_FLAG_AF: Acknowledge failure flag + * @arg I2C_FLAG_ARLO: Arbitration lost flag (Master mode) + * @arg I2C_FLAG_BERR: Bus error flag + * + * @note + * - STOPF (STOP detection) is cleared by software sequence: a read operation + * to I2C_SR1 register (I2C_GetFlagStatus()) followed by a write operation + * to I2C_CR1 register (I2C_Cmd() to re-enable the I2C peripheral). + * - ADD10 (10-bit header sent) is cleared by software sequence: a read + * operation to I2C_SR1 (I2C_GetFlagStatus()) followed by writing the + * second byte of the address in DR register. + * - BTF (Byte Transfer Finished) is cleared by software sequence: a read + * operation to I2C_SR1 register (I2C_GetFlagStatus()) followed by a + * read/write to I2C_DR register (I2C_SendData()). + * - ADDR (Address sent) is cleared by software sequence: a read operation to + * I2C_SR1 register (I2C_GetFlagStatus()) followed by a read operation to + * I2C_SR2 register ((void)(I2Cx->SR2)). + * - SB (Start Bit) is cleared software sequence: a read operation to I2C_SR1 + * register (I2C_GetFlagStatus()) followed by a write operation to I2C_DR + * register (I2C_SendData()). + * @retval None + */ +void I2C_ClearFlag(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG) +{ + uint32_t flagpos = 0; + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_CLEAR_FLAG(I2C_FLAG)); + /* Get the I2C flag position */ + flagpos = I2C_FLAG & FLAG_Mask; + /* Clear the selected I2C flag */ + I2Cx->SR1 = (uint16_t)~flagpos; +} + +/** + * @brief Checks whether the specified I2C interrupt has occurred or not. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_IT: specifies the interrupt source to check. + * This parameter can be one of the following values: + * @arg I2C_IT_SMBALERT: SMBus Alert flag + * @arg I2C_IT_TIMEOUT: Timeout or Tlow error flag + * @arg I2C_IT_PECERR: PEC error in reception flag + * @arg I2C_IT_OVR: Overrun/Underrun flag (Slave mode) + * @arg I2C_IT_AF: Acknowledge failure flag + * @arg I2C_IT_ARLO: Arbitration lost flag (Master mode) + * @arg I2C_IT_BERR: Bus error flag + * @arg I2C_IT_TXE: Data register empty flag (Transmitter) + * @arg I2C_IT_RXNE: Data register not empty (Receiver) flag + * @arg I2C_IT_STOPF: Stop detection flag (Slave mode) + * @arg I2C_IT_ADD10: 10-bit header sent flag (Master mode) + * @arg I2C_IT_BTF: Byte transfer finished flag + * @arg I2C_IT_ADDR: Address sent flag (Master mode) "ADSL" + * Address matched flag (Slave mode)"ENDAD" + * @arg I2C_IT_SB: Start bit flag (Master mode) + * @retval The new state of I2C_IT (SET or RESET). + */ +ITStatus I2C_GetITStatus(I2C_TypeDef* I2Cx, uint32_t I2C_IT) +{ + ITStatus bitstatus = RESET; + uint32_t enablestatus = 0; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_GET_IT(I2C_IT)); + + /* Check if the interrupt source is enabled or not */ + enablestatus = (uint32_t)(((I2C_IT & ITEN_Mask) >> 16) & (I2Cx->CR2)) ; + + /* Get bit[23:0] of the flag */ + I2C_IT &= FLAG_Mask; + + /* Check the status of the specified I2C flag */ + if (((I2Cx->SR1 & I2C_IT) != (uint32_t)RESET) && enablestatus) + { + /* I2C_IT is set */ + bitstatus = SET; + } + else + { + /* I2C_IT is reset */ + bitstatus = RESET; + } + /* Return the I2C_IT status */ + return bitstatus; +} + +/** + * @brief Clears the I2Cxs interrupt pending bits. + * @param I2Cx: where x can be 1 or 2 to select the I2C peripheral. + * @param I2C_IT: specifies the interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg I2C_IT_SMBALERT: SMBus Alert interrupt + * @arg I2C_IT_TIMEOUT: Timeout or Tlow error interrupt + * @arg I2C_IT_PECERR: PEC error in reception interrupt + * @arg I2C_IT_OVR: Overrun/Underrun interrupt (Slave mode) + * @arg I2C_IT_AF: Acknowledge failure interrupt + * @arg I2C_IT_ARLO: Arbitration lost interrupt (Master mode) + * @arg I2C_IT_BERR: Bus error interrupt + * + * @note + * - STOPF (STOP detection) is cleared by software sequence: a read operation + * to I2C_SR1 register (I2C_GetITStatus()) followed by a write operation to + * I2C_CR1 register (I2C_Cmd() to re-enable the I2C peripheral). + * - ADD10 (10-bit header sent) is cleared by software sequence: a read + * operation to I2C_SR1 (I2C_GetITStatus()) followed by writing the second + * byte of the address in I2C_DR register. + * - BTF (Byte Transfer Finished) is cleared by software sequence: a read + * operation to I2C_SR1 register (I2C_GetITStatus()) followed by a + * read/write to I2C_DR register (I2C_SendData()). + * - ADDR (Address sent) is cleared by software sequence: a read operation to + * I2C_SR1 register (I2C_GetITStatus()) followed by a read operation to + * I2C_SR2 register ((void)(I2Cx->SR2)). + * - SB (Start Bit) is cleared by software sequence: a read operation to + * I2C_SR1 register (I2C_GetITStatus()) followed by a write operation to + * I2C_DR register (I2C_SendData()). + * @retval None + */ +void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT) +{ + uint32_t flagpos = 0; + /* Check the parameters */ + assert_param(IS_I2C_ALL_PERIPH(I2Cx)); + assert_param(IS_I2C_CLEAR_IT(I2C_IT)); + /* Get the I2C flag position */ + flagpos = I2C_IT & FLAG_Mask; + /* Clear the selected I2C flag */ + I2Cx->SR1 = (uint16_t)~flagpos; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c new file mode 100644 index 0000000..dffe0cf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c @@ -0,0 +1,188 @@ +/** + ****************************************************************************** + * @file stm32f10x_iwdg.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the IWDG firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_iwdg.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup IWDG + * @brief IWDG driver modules + * @{ + */ + +/** @defgroup IWDG_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Private_Defines + * @{ + */ + +/* ---------------------- IWDG registers bit mask ----------------------------*/ + +/* KR register bit mask */ +#define KR_KEY_Reload ((uint16_t)0xAAAA) +#define KR_KEY_Enable ((uint16_t)0xCCCC) + +/** + * @} + */ + +/** @defgroup IWDG_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup IWDG_Private_Functions + * @{ + */ + +/** + * @brief Enables or disables write access to IWDG_PR and IWDG_RLR registers. + * @param IWDG_WriteAccess: new state of write access to IWDG_PR and IWDG_RLR registers. + * This parameter can be one of the following values: + * @arg IWDG_WriteAccess_Enable: Enable write access to IWDG_PR and IWDG_RLR registers + * @arg IWDG_WriteAccess_Disable: Disable write access to IWDG_PR and IWDG_RLR registers + * @retval None + */ +void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess) +{ + /* Check the parameters */ + assert_param(IS_IWDG_WRITE_ACCESS(IWDG_WriteAccess)); + IWDG->KR = IWDG_WriteAccess; +} + +/** + * @brief Sets IWDG Prescaler value. + * @param IWDG_Prescaler: specifies the IWDG Prescaler value. + * This parameter can be one of the following values: + * @arg IWDG_Prescaler_4: IWDG prescaler set to 4 + * @arg IWDG_Prescaler_8: IWDG prescaler set to 8 + * @arg IWDG_Prescaler_16: IWDG prescaler set to 16 + * @arg IWDG_Prescaler_32: IWDG prescaler set to 32 + * @arg IWDG_Prescaler_64: IWDG prescaler set to 64 + * @arg IWDG_Prescaler_128: IWDG prescaler set to 128 + * @arg IWDG_Prescaler_256: IWDG prescaler set to 256 + * @retval None + */ +void IWDG_SetPrescaler(uint8_t IWDG_Prescaler) +{ + /* Check the parameters */ + assert_param(IS_IWDG_PRESCALER(IWDG_Prescaler)); + IWDG->PR = IWDG_Prescaler; +} + +/** + * @brief Sets IWDG Reload value. + * @param Reload: specifies the IWDG Reload value. + * This parameter must be a number between 0 and 0x0FFF. + * @retval None + */ +void IWDG_SetReload(uint16_t Reload) +{ + /* Check the parameters */ + assert_param(IS_IWDG_RELOAD(Reload)); + IWDG->RLR = Reload; +} + +/** + * @brief Reloads IWDG counter with value defined in the reload register + * (write access to IWDG_PR and IWDG_RLR registers disabled). + * @param None + * @retval None + */ +void IWDG_ReloadCounter(void) +{ + IWDG->KR = KR_KEY_Reload; +} + +/** + * @brief Enables IWDG (write access to IWDG_PR and IWDG_RLR registers disabled). + * @param None + * @retval None + */ +void IWDG_Enable(void) +{ + IWDG->KR = KR_KEY_Enable; +} + +/** + * @brief Checks whether the specified IWDG flag is set or not. + * @param IWDG_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg IWDG_FLAG_PVU: Prescaler Value Update on going + * @arg IWDG_FLAG_RVU: Reload Value Update on going + * @retval The new state of IWDG_FLAG (SET or RESET). + */ +FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_IWDG_FLAG(IWDG_FLAG)); + if ((IWDG->SR & IWDG_FLAG) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + /* Return the flag status */ + return bitstatus; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c new file mode 100644 index 0000000..5f9e421 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c new file mode 100644 index 0000000..d7d5455 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c @@ -0,0 +1,1469 @@ +/** + ****************************************************************************** + * @file stm32f10x_rcc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the RCC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup RCC + * @brief RCC driver modules + * @{ + */ + +/** @defgroup RCC_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup RCC_Private_Defines + * @{ + */ + +/* ------------ RCC registers bit address in the alias region ----------- */ +#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) + +/* --- CR Register ---*/ + +/* Alias word address of HSION bit */ +#define CR_OFFSET (RCC_OFFSET + 0x00) +#define HSION_BitNumber 0x00 +#define CR_HSION_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (HSION_BitNumber * 4)) + +/* Alias word address of PLLON bit */ +#define PLLON_BitNumber 0x18 +#define CR_PLLON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLLON_BitNumber * 4)) + +#ifdef STM32F10X_CL + /* Alias word address of PLL2ON bit */ + #define PLL2ON_BitNumber 0x1A + #define CR_PLL2ON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLL2ON_BitNumber * 4)) + + /* Alias word address of PLL3ON bit */ + #define PLL3ON_BitNumber 0x1C + #define CR_PLL3ON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PLL3ON_BitNumber * 4)) +#endif /* STM32F10X_CL */ + +/* Alias word address of CSSON bit */ +#define CSSON_BitNumber 0x13 +#define CR_CSSON_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (CSSON_BitNumber * 4)) + +/* --- CFGR Register ---*/ + +/* Alias word address of USBPRE bit */ +#define CFGR_OFFSET (RCC_OFFSET + 0x04) + +#ifndef STM32F10X_CL + #define USBPRE_BitNumber 0x16 + #define CFGR_USBPRE_BB (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (USBPRE_BitNumber * 4)) +#else + #define OTGFSPRE_BitNumber 0x16 + #define CFGR_OTGFSPRE_BB (PERIPH_BB_BASE + (CFGR_OFFSET * 32) + (OTGFSPRE_BitNumber * 4)) +#endif /* STM32F10X_CL */ + +/* --- BDCR Register ---*/ + +/* Alias word address of RTCEN bit */ +#define BDCR_OFFSET (RCC_OFFSET + 0x20) +#define RTCEN_BitNumber 0x0F +#define BDCR_RTCEN_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (RTCEN_BitNumber * 4)) + +/* Alias word address of BDRST bit */ +#define BDRST_BitNumber 0x10 +#define BDCR_BDRST_BB (PERIPH_BB_BASE + (BDCR_OFFSET * 32) + (BDRST_BitNumber * 4)) + +/* --- CSR Register ---*/ + +/* Alias word address of LSION bit */ +#define CSR_OFFSET (RCC_OFFSET + 0x24) +#define LSION_BitNumber 0x00 +#define CSR_LSION_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (LSION_BitNumber * 4)) + +#ifdef STM32F10X_CL +/* --- CFGR2 Register ---*/ + + /* Alias word address of I2S2SRC bit */ + #define CFGR2_OFFSET (RCC_OFFSET + 0x2C) + #define I2S2SRC_BitNumber 0x11 + #define CFGR2_I2S2SRC_BB (PERIPH_BB_BASE + (CFGR2_OFFSET * 32) + (I2S2SRC_BitNumber * 4)) + + /* Alias word address of I2S3SRC bit */ + #define I2S3SRC_BitNumber 0x12 + #define CFGR2_I2S3SRC_BB (PERIPH_BB_BASE + (CFGR2_OFFSET * 32) + (I2S3SRC_BitNumber * 4)) +#endif /* STM32F10X_CL */ + +/* ---------------------- RCC registers bit mask ------------------------ */ + +/* CR register bit mask */ +#define CR_HSEBYP_Reset ((uint32_t)0xFFFBFFFF) +#define CR_HSEBYP_Set ((uint32_t)0x00040000) +#define CR_HSEON_Reset ((uint32_t)0xFFFEFFFF) +#define CR_HSEON_Set ((uint32_t)0x00010000) +#define CR_HSITRIM_Mask ((uint32_t)0xFFFFFF07) + +/* CFGR register bit mask */ +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) + #define CFGR_PLL_Mask ((uint32_t)0xFFC2FFFF) +#else + #define CFGR_PLL_Mask ((uint32_t)0xFFC0FFFF) +#endif /* STM32F10X_CL */ + +#define CFGR_PLLMull_Mask ((uint32_t)0x003C0000) +#define CFGR_PLLSRC_Mask ((uint32_t)0x00010000) +#define CFGR_PLLXTPRE_Mask ((uint32_t)0x00020000) +#define CFGR_SWS_Mask ((uint32_t)0x0000000C) +#define CFGR_SW_Mask ((uint32_t)0xFFFFFFFC) +#define CFGR_HPRE_Reset_Mask ((uint32_t)0xFFFFFF0F) +#define CFGR_HPRE_Set_Mask ((uint32_t)0x000000F0) +#define CFGR_PPRE1_Reset_Mask ((uint32_t)0xFFFFF8FF) +#define CFGR_PPRE1_Set_Mask ((uint32_t)0x00000700) +#define CFGR_PPRE2_Reset_Mask ((uint32_t)0xFFFFC7FF) +#define CFGR_PPRE2_Set_Mask ((uint32_t)0x00003800) +#define CFGR_ADCPRE_Reset_Mask ((uint32_t)0xFFFF3FFF) +#define CFGR_ADCPRE_Set_Mask ((uint32_t)0x0000C000) + +/* CSR register bit mask */ +#define CSR_RMVF_Set ((uint32_t)0x01000000) + +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) +/* CFGR2 register bit mask */ + #define CFGR2_PREDIV1SRC ((uint32_t)0x00010000) + #define CFGR2_PREDIV1 ((uint32_t)0x0000000F) +#endif +#ifdef STM32F10X_CL + #define CFGR2_PREDIV2 ((uint32_t)0x000000F0) + #define CFGR2_PLL2MUL ((uint32_t)0x00000F00) + #define CFGR2_PLL3MUL ((uint32_t)0x0000F000) +#endif /* STM32F10X_CL */ + +/* RCC Flag Mask */ +#define FLAG_Mask ((uint8_t)0x1F) + +/* CIR register byte 2 (Bits[15:8]) base address */ +#define CIR_BYTE2_ADDRESS ((uint32_t)0x40021009) + +/* CIR register byte 3 (Bits[23:16]) base address */ +#define CIR_BYTE3_ADDRESS ((uint32_t)0x4002100A) + +/* CFGR register byte 4 (Bits[31:24]) base address */ +#define CFGR_BYTE4_ADDRESS ((uint32_t)0x40021007) + +/* BDCR register base address */ +#define BDCR_ADDRESS (PERIPH_BASE + BDCR_OFFSET) + +/** + * @} + */ + +/** @defgroup RCC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup RCC_Private_Variables + * @{ + */ + +static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; +static __I uint8_t ADCPrescTable[4] = {2, 4, 6, 8}; + +/** + * @} + */ + +/** @defgroup RCC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup RCC_Private_Functions + * @{ + */ + +/** + * @brief Resets the RCC clock configuration to the default reset state. + * @param None + * @retval None + */ +void RCC_DeInit(void) +{ + /* Set HSION bit */ + RCC->CR |= (uint32_t)0x00000001; + + /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */ +#ifndef STM32F10X_CL + RCC->CFGR &= (uint32_t)0xF8FF0000; +#else + RCC->CFGR &= (uint32_t)0xF0FF0000; +#endif /* STM32F10X_CL */ + + /* Reset HSEON, CSSON and PLLON bits */ + RCC->CR &= (uint32_t)0xFEF6FFFF; + + /* Reset HSEBYP bit */ + RCC->CR &= (uint32_t)0xFFFBFFFF; + + /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */ + RCC->CFGR &= (uint32_t)0xFF80FFFF; + +#ifdef STM32F10X_CL + /* Reset PLL2ON and PLL3ON bits */ + RCC->CR &= (uint32_t)0xEBFFFFFF; + + /* Disable all interrupts and clear pending bits */ + RCC->CIR = 0x00FF0000; + + /* Reset CFGR2 register */ + RCC->CFGR2 = 0x00000000; +#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) + /* Disable all interrupts and clear pending bits */ + RCC->CIR = 0x009F0000; + + /* Reset CFGR2 register */ + RCC->CFGR2 = 0x00000000; +#else + /* Disable all interrupts and clear pending bits */ + RCC->CIR = 0x009F0000; +#endif /* STM32F10X_CL */ + +} + +/** + * @brief Configures the External High Speed oscillator (HSE). + * @note HSE can not be stopped if it is used directly or through the PLL as system clock. + * @param RCC_HSE: specifies the new state of the HSE. + * This parameter can be one of the following values: + * @arg RCC_HSE_OFF: HSE oscillator OFF + * @arg RCC_HSE_ON: HSE oscillator ON + * @arg RCC_HSE_Bypass: HSE oscillator bypassed with external clock + * @retval None + */ +void RCC_HSEConfig(uint32_t RCC_HSE) +{ + /* Check the parameters */ + assert_param(IS_RCC_HSE(RCC_HSE)); + /* Reset HSEON and HSEBYP bits before configuring the HSE ------------------*/ + /* Reset HSEON bit */ + RCC->CR &= CR_HSEON_Reset; + /* Reset HSEBYP bit */ + RCC->CR &= CR_HSEBYP_Reset; + /* Configure HSE (RCC_HSE_OFF is already covered by the code section above) */ + switch(RCC_HSE) + { + case RCC_HSE_ON: + /* Set HSEON bit */ + RCC->CR |= CR_HSEON_Set; + break; + + case RCC_HSE_Bypass: + /* Set HSEBYP and HSEON bits */ + RCC->CR |= CR_HSEBYP_Set | CR_HSEON_Set; + break; + + default: + break; + } +} + +/** + * @brief Waits for HSE start-up. + * @param None + * @retval An ErrorStatus enumuration value: + * - SUCCESS: HSE oscillator is stable and ready to use + * - ERROR: HSE oscillator not yet ready + */ +ErrorStatus RCC_WaitForHSEStartUp(void) +{ + __IO uint32_t StartUpCounter = 0; + ErrorStatus status = ERROR; + FlagStatus HSEStatus = RESET; + + /* Wait till HSE is ready and if Time out is reached exit */ + do + { + HSEStatus = RCC_GetFlagStatus(RCC_FLAG_HSERDY); + StartUpCounter++; + } while((StartUpCounter != HSE_STARTUP_TIMEOUT) && (HSEStatus == RESET)); + + if (RCC_GetFlagStatus(RCC_FLAG_HSERDY) != RESET) + { + status = SUCCESS; + } + else + { + status = ERROR; + } + return (status); +} + +/** + * @brief Adjusts the Internal High Speed oscillator (HSI) calibration value. + * @param HSICalibrationValue: specifies the calibration trimming value. + * This parameter must be a number between 0 and 0x1F. + * @retval None + */ +void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue)); + tmpreg = RCC->CR; + /* Clear HSITRIM[4:0] bits */ + tmpreg &= CR_HSITRIM_Mask; + /* Set the HSITRIM[4:0] bits according to HSICalibrationValue value */ + tmpreg |= (uint32_t)HSICalibrationValue << 3; + /* Store the new value */ + RCC->CR = tmpreg; +} + +/** + * @brief Enables or disables the Internal High Speed oscillator (HSI). + * @note HSI can not be stopped if it is used directly or through the PLL as system clock. + * @param NewState: new state of the HSI. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_HSICmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CR_HSION_BB = (uint32_t)NewState; +} + +/** + * @brief Configures the PLL clock source and multiplication factor. + * @note This function must be used only when the PLL is disabled. + * @param RCC_PLLSource: specifies the PLL entry clock source. + * For @b STM32_Connectivity_line_devices or @b STM32_Value_line_devices, + * this parameter can be one of the following values: + * @arg RCC_PLLSource_HSI_Div2: HSI oscillator clock divided by 2 selected as PLL clock entry + * @arg RCC_PLLSource_PREDIV1: PREDIV1 clock selected as PLL clock entry + * For @b other_STM32_devices, this parameter can be one of the following values: + * @arg RCC_PLLSource_HSI_Div2: HSI oscillator clock divided by 2 selected as PLL clock entry + * @arg RCC_PLLSource_HSE_Div1: HSE oscillator clock selected as PLL clock entry + * @arg RCC_PLLSource_HSE_Div2: HSE oscillator clock divided by 2 selected as PLL clock entry + * @param RCC_PLLMul: specifies the PLL multiplication factor. + * For @b STM32_Connectivity_line_devices, this parameter can be RCC_PLLMul_x where x:{[4,9], 6_5} + * For @b other_STM32_devices, this parameter can be RCC_PLLMul_x where x:[2,16] + * @retval None + */ +void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource)); + assert_param(IS_RCC_PLL_MUL(RCC_PLLMul)); + + tmpreg = RCC->CFGR; + /* Clear PLLSRC, PLLXTPRE and PLLMUL[3:0] bits */ + tmpreg &= CFGR_PLL_Mask; + /* Set the PLL configuration bits */ + tmpreg |= RCC_PLLSource | RCC_PLLMul; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +/** + * @brief Enables or disables the PLL. + * @note The PLL can not be disabled if it is used as system clock. + * @param NewState: new state of the PLL. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_PLLCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CR_PLLON_BB = (uint32_t)NewState; +} + +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) +/** + * @brief Configures the PREDIV1 division factor. + * @note + * - This function must be used only when the PLL is disabled. + * - This function applies only to STM32 Connectivity line and Value line + * devices. + * @param RCC_PREDIV1_Source: specifies the PREDIV1 clock source. + * This parameter can be one of the following values: + * @arg RCC_PREDIV1_Source_HSE: HSE selected as PREDIV1 clock + * @arg RCC_PREDIV1_Source_PLL2: PLL2 selected as PREDIV1 clock + * @note + * For @b STM32_Value_line_devices this parameter is always RCC_PREDIV1_Source_HSE + * @param RCC_PREDIV1_Div: specifies the PREDIV1 clock division factor. + * This parameter can be RCC_PREDIV1_Divx where x:[1,16] + * @retval None + */ +void RCC_PREDIV1Config(uint32_t RCC_PREDIV1_Source, uint32_t RCC_PREDIV1_Div) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_RCC_PREDIV1_SOURCE(RCC_PREDIV1_Source)); + assert_param(IS_RCC_PREDIV1(RCC_PREDIV1_Div)); + + tmpreg = RCC->CFGR2; + /* Clear PREDIV1[3:0] and PREDIV1SRC bits */ + tmpreg &= ~(CFGR2_PREDIV1 | CFGR2_PREDIV1SRC); + /* Set the PREDIV1 clock source and division factor */ + tmpreg |= RCC_PREDIV1_Source | RCC_PREDIV1_Div ; + /* Store the new value */ + RCC->CFGR2 = tmpreg; +} +#endif + +#ifdef STM32F10X_CL +/** + * @brief Configures the PREDIV2 division factor. + * @note + * - This function must be used only when both PLL2 and PLL3 are disabled. + * - This function applies only to STM32 Connectivity line devices. + * @param RCC_PREDIV2_Div: specifies the PREDIV2 clock division factor. + * This parameter can be RCC_PREDIV2_Divx where x:[1,16] + * @retval None + */ +void RCC_PREDIV2Config(uint32_t RCC_PREDIV2_Div) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_RCC_PREDIV2(RCC_PREDIV2_Div)); + + tmpreg = RCC->CFGR2; + /* Clear PREDIV2[3:0] bits */ + tmpreg &= ~CFGR2_PREDIV2; + /* Set the PREDIV2 division factor */ + tmpreg |= RCC_PREDIV2_Div; + /* Store the new value */ + RCC->CFGR2 = tmpreg; +} + +/** + * @brief Configures the PLL2 multiplication factor. + * @note + * - This function must be used only when the PLL2 is disabled. + * - This function applies only to STM32 Connectivity line devices. + * @param RCC_PLL2Mul: specifies the PLL2 multiplication factor. + * This parameter can be RCC_PLL2Mul_x where x:{[8,14], 16, 20} + * @retval None + */ +void RCC_PLL2Config(uint32_t RCC_PLL2Mul) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_RCC_PLL2_MUL(RCC_PLL2Mul)); + + tmpreg = RCC->CFGR2; + /* Clear PLL2Mul[3:0] bits */ + tmpreg &= ~CFGR2_PLL2MUL; + /* Set the PLL2 configuration bits */ + tmpreg |= RCC_PLL2Mul; + /* Store the new value */ + RCC->CFGR2 = tmpreg; +} + + +/** + * @brief Enables or disables the PLL2. + * @note + * - The PLL2 can not be disabled if it is used indirectly as system clock + * (i.e. it is used as PLL clock entry that is used as System clock). + * - This function applies only to STM32 Connectivity line devices. + * @param NewState: new state of the PLL2. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_PLL2Cmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CR_PLL2ON_BB = (uint32_t)NewState; +} + + +/** + * @brief Configures the PLL3 multiplication factor. + * @note + * - This function must be used only when the PLL3 is disabled. + * - This function applies only to STM32 Connectivity line devices. + * @param RCC_PLL3Mul: specifies the PLL3 multiplication factor. + * This parameter can be RCC_PLL3Mul_x where x:{[8,14], 16, 20} + * @retval None + */ +void RCC_PLL3Config(uint32_t RCC_PLL3Mul) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_RCC_PLL3_MUL(RCC_PLL3Mul)); + + tmpreg = RCC->CFGR2; + /* Clear PLL3Mul[3:0] bits */ + tmpreg &= ~CFGR2_PLL3MUL; + /* Set the PLL3 configuration bits */ + tmpreg |= RCC_PLL3Mul; + /* Store the new value */ + RCC->CFGR2 = tmpreg; +} + + +/** + * @brief Enables or disables the PLL3. + * @note This function applies only to STM32 Connectivity line devices. + * @param NewState: new state of the PLL3. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_PLL3Cmd(FunctionalState NewState) +{ + /* Check the parameters */ + + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CR_PLL3ON_BB = (uint32_t)NewState; +} +#endif /* STM32F10X_CL */ + +/** + * @brief Configures the system clock (SYSCLK). + * @param RCC_SYSCLKSource: specifies the clock source used as system clock. + * This parameter can be one of the following values: + * @arg RCC_SYSCLKSource_HSI: HSI selected as system clock + * @arg RCC_SYSCLKSource_HSE: HSE selected as system clock + * @arg RCC_SYSCLKSource_PLLCLK: PLL selected as system clock + * @retval None + */ +void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_SYSCLK_SOURCE(RCC_SYSCLKSource)); + tmpreg = RCC->CFGR; + /* Clear SW[1:0] bits */ + tmpreg &= CFGR_SW_Mask; + /* Set SW[1:0] bits according to RCC_SYSCLKSource value */ + tmpreg |= RCC_SYSCLKSource; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +/** + * @brief Returns the clock source used as system clock. + * @param None + * @retval The clock source used as system clock. The returned value can + * be one of the following: + * - 0x00: HSI used as system clock + * - 0x04: HSE used as system clock + * - 0x08: PLL used as system clock + */ +uint8_t RCC_GetSYSCLKSource(void) +{ + return ((uint8_t)(RCC->CFGR & CFGR_SWS_Mask)); +} + +/** + * @brief Configures the AHB clock (HCLK). + * @param RCC_SYSCLK: defines the AHB clock divider. This clock is derived from + * the system clock (SYSCLK). + * This parameter can be one of the following values: + * @arg RCC_SYSCLK_Div1: AHB clock = SYSCLK + * @arg RCC_SYSCLK_Div2: AHB clock = SYSCLK/2 + * @arg RCC_SYSCLK_Div4: AHB clock = SYSCLK/4 + * @arg RCC_SYSCLK_Div8: AHB clock = SYSCLK/8 + * @arg RCC_SYSCLK_Div16: AHB clock = SYSCLK/16 + * @arg RCC_SYSCLK_Div64: AHB clock = SYSCLK/64 + * @arg RCC_SYSCLK_Div128: AHB clock = SYSCLK/128 + * @arg RCC_SYSCLK_Div256: AHB clock = SYSCLK/256 + * @arg RCC_SYSCLK_Div512: AHB clock = SYSCLK/512 + * @retval None + */ +void RCC_HCLKConfig(uint32_t RCC_SYSCLK) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_HCLK(RCC_SYSCLK)); + tmpreg = RCC->CFGR; + /* Clear HPRE[3:0] bits */ + tmpreg &= CFGR_HPRE_Reset_Mask; + /* Set HPRE[3:0] bits according to RCC_SYSCLK value */ + tmpreg |= RCC_SYSCLK; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +/** + * @brief Configures the Low Speed APB clock (PCLK1). + * @param RCC_HCLK: defines the APB1 clock divider. This clock is derived from + * the AHB clock (HCLK). + * This parameter can be one of the following values: + * @arg RCC_HCLK_Div1: APB1 clock = HCLK + * @arg RCC_HCLK_Div2: APB1 clock = HCLK/2 + * @arg RCC_HCLK_Div4: APB1 clock = HCLK/4 + * @arg RCC_HCLK_Div8: APB1 clock = HCLK/8 + * @arg RCC_HCLK_Div16: APB1 clock = HCLK/16 + * @retval None + */ +void RCC_PCLK1Config(uint32_t RCC_HCLK) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_PCLK(RCC_HCLK)); + tmpreg = RCC->CFGR; + /* Clear PPRE1[2:0] bits */ + tmpreg &= CFGR_PPRE1_Reset_Mask; + /* Set PPRE1[2:0] bits according to RCC_HCLK value */ + tmpreg |= RCC_HCLK; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +/** + * @brief Configures the High Speed APB clock (PCLK2). + * @param RCC_HCLK: defines the APB2 clock divider. This clock is derived from + * the AHB clock (HCLK). + * This parameter can be one of the following values: + * @arg RCC_HCLK_Div1: APB2 clock = HCLK + * @arg RCC_HCLK_Div2: APB2 clock = HCLK/2 + * @arg RCC_HCLK_Div4: APB2 clock = HCLK/4 + * @arg RCC_HCLK_Div8: APB2 clock = HCLK/8 + * @arg RCC_HCLK_Div16: APB2 clock = HCLK/16 + * @retval None + */ +void RCC_PCLK2Config(uint32_t RCC_HCLK) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_PCLK(RCC_HCLK)); + tmpreg = RCC->CFGR; + /* Clear PPRE2[2:0] bits */ + tmpreg &= CFGR_PPRE2_Reset_Mask; + /* Set PPRE2[2:0] bits according to RCC_HCLK value */ + tmpreg |= RCC_HCLK << 3; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +/** + * @brief Enables or disables the specified RCC interrupts. + * @param RCC_IT: specifies the RCC interrupt sources to be enabled or disabled. + * + * For @b STM32_Connectivity_line_devices, this parameter can be any combination + * of the following values + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt + * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt + * + * For @b other_STM32_devices, this parameter can be any combination of the + * following values + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * + * @param NewState: new state of the specified RCC interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_IT(RCC_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Perform Byte access to RCC_CIR bits to enable the selected interrupts */ + *(__IO uint8_t *) CIR_BYTE2_ADDRESS |= RCC_IT; + } + else + { + /* Perform Byte access to RCC_CIR bits to disable the selected interrupts */ + *(__IO uint8_t *) CIR_BYTE2_ADDRESS &= (uint8_t)~RCC_IT; + } +} + +#ifndef STM32F10X_CL +/** + * @brief Configures the USB clock (USBCLK). + * @param RCC_USBCLKSource: specifies the USB clock source. This clock is + * derived from the PLL output. + * This parameter can be one of the following values: + * @arg RCC_USBCLKSource_PLLCLK_1Div5: PLL clock divided by 1,5 selected as USB + * clock source + * @arg RCC_USBCLKSource_PLLCLK_Div1: PLL clock selected as USB clock source + * @retval None + */ +void RCC_USBCLKConfig(uint32_t RCC_USBCLKSource) +{ + /* Check the parameters */ + assert_param(IS_RCC_USBCLK_SOURCE(RCC_USBCLKSource)); + + *(__IO uint32_t *) CFGR_USBPRE_BB = RCC_USBCLKSource; +} +#else +/** + * @brief Configures the USB OTG FS clock (OTGFSCLK). + * This function applies only to STM32 Connectivity line devices. + * @param RCC_OTGFSCLKSource: specifies the USB OTG FS clock source. + * This clock is derived from the PLL output. + * This parameter can be one of the following values: + * @arg RCC_OTGFSCLKSource_PLLVCO_Div3: PLL VCO clock divided by 2 selected as USB OTG FS clock source + * @arg RCC_OTGFSCLKSource_PLLVCO_Div2: PLL VCO clock divided by 2 selected as USB OTG FS clock source + * @retval None + */ +void RCC_OTGFSCLKConfig(uint32_t RCC_OTGFSCLKSource) +{ + /* Check the parameters */ + assert_param(IS_RCC_OTGFSCLK_SOURCE(RCC_OTGFSCLKSource)); + + *(__IO uint32_t *) CFGR_OTGFSPRE_BB = RCC_OTGFSCLKSource; +} +#endif /* STM32F10X_CL */ + +/** + * @brief Configures the ADC clock (ADCCLK). + * @param RCC_PCLK2: defines the ADC clock divider. This clock is derived from + * the APB2 clock (PCLK2). + * This parameter can be one of the following values: + * @arg RCC_PCLK2_Div2: ADC clock = PCLK2/2 + * @arg RCC_PCLK2_Div4: ADC clock = PCLK2/4 + * @arg RCC_PCLK2_Div6: ADC clock = PCLK2/6 + * @arg RCC_PCLK2_Div8: ADC clock = PCLK2/8 + * @retval None + */ +void RCC_ADCCLKConfig(uint32_t RCC_PCLK2) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_RCC_ADCCLK(RCC_PCLK2)); + tmpreg = RCC->CFGR; + /* Clear ADCPRE[1:0] bits */ + tmpreg &= CFGR_ADCPRE_Reset_Mask; + /* Set ADCPRE[1:0] bits according to RCC_PCLK2 value */ + tmpreg |= RCC_PCLK2; + /* Store the new value */ + RCC->CFGR = tmpreg; +} + +#ifdef STM32F10X_CL +/** + * @brief Configures the I2S2 clock source(I2S2CLK). + * @note + * - This function must be called before enabling I2S2 APB clock. + * - This function applies only to STM32 Connectivity line devices. + * @param RCC_I2S2CLKSource: specifies the I2S2 clock source. + * This parameter can be one of the following values: + * @arg RCC_I2S2CLKSource_SYSCLK: system clock selected as I2S2 clock entry + * @arg RCC_I2S2CLKSource_PLL3_VCO: PLL3 VCO clock selected as I2S2 clock entry + * @retval None + */ +void RCC_I2S2CLKConfig(uint32_t RCC_I2S2CLKSource) +{ + /* Check the parameters */ + assert_param(IS_RCC_I2S2CLK_SOURCE(RCC_I2S2CLKSource)); + + *(__IO uint32_t *) CFGR2_I2S2SRC_BB = RCC_I2S2CLKSource; +} + +/** + * @brief Configures the I2S3 clock source(I2S2CLK). + * @note + * - This function must be called before enabling I2S3 APB clock. + * - This function applies only to STM32 Connectivity line devices. + * @param RCC_I2S3CLKSource: specifies the I2S3 clock source. + * This parameter can be one of the following values: + * @arg RCC_I2S3CLKSource_SYSCLK: system clock selected as I2S3 clock entry + * @arg RCC_I2S3CLKSource_PLL3_VCO: PLL3 VCO clock selected as I2S3 clock entry + * @retval None + */ +void RCC_I2S3CLKConfig(uint32_t RCC_I2S3CLKSource) +{ + /* Check the parameters */ + assert_param(IS_RCC_I2S3CLK_SOURCE(RCC_I2S3CLKSource)); + + *(__IO uint32_t *) CFGR2_I2S3SRC_BB = RCC_I2S3CLKSource; +} +#endif /* STM32F10X_CL */ + +/** + * @brief Configures the External Low Speed oscillator (LSE). + * @note LSEON is cleared regardless of the function's argument value. + * @param RCC_LSE: specifies the new state of the LSE. + * This parameter can be one of the following values: + * @arg RCC_LSE_OFF: LSE oscillator OFF + * @arg RCC_LSE_ON: LSE oscillator ON + * @arg RCC_LSE_Bypass: LSE oscillator bypassed with external clock + * @retval None + */ +void RCC_LSEConfig(uint8_t RCC_LSE) +{ + /* Check the parameters */ + assert_param(IS_RCC_LSE(RCC_LSE)); + /* Reset LSEON and LSEBYP bits before configuring the LSE ------------------*/ + /* Reset LSEON bit */ + *(__IO uint8_t *) BDCR_ADDRESS = RCC_LSE_OFF; + /* Reset LSEBYP bit */ + *(__IO uint8_t *) BDCR_ADDRESS = RCC_LSE_OFF; + /* Configure LSE (RCC_LSE_OFF is already covered by the code section above) */ + switch(RCC_LSE) + { + case RCC_LSE_ON: + /* Set LSEON bit */ + *(__IO uint8_t *) BDCR_ADDRESS = RCC_LSE_ON; + break; + + case RCC_LSE_Bypass: + /* Set LSEBYP and LSEON bits */ + *(__IO uint8_t *) BDCR_ADDRESS = RCC_LSE_Bypass | RCC_LSE_ON; + break; + + default: + break; + } +} + +/** + * @brief Enables or disables the Internal Low Speed oscillator (LSI). + * @note LSI can not be disabled if the IWDG is running. + * @param NewState: new state of the LSI. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_LSICmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CSR_LSION_BB = (uint32_t)NewState; +} + +/** + * @brief Configures the RTC clock (RTCCLK). + * @note Once the RTC clock is selected it can't be changed unless the Backup domain is reset. + * @param RCC_RTCCLKSource: specifies the RTC clock source. + * This parameter can be one of the following values: + * @arg RCC_RTCCLKSource_LSE: LSE selected as RTC clock + * @arg RCC_RTCCLKSource_LSI: LSI selected as RTC clock + * @arg RCC_RTCCLKSource_HSE_Div128: HSE clock divided by 128 selected as RTC clock + * @retval None + */ +void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource) +{ + /* Check the parameters */ + assert_param(IS_RCC_RTCCLK_SOURCE(RCC_RTCCLKSource)); + /* Select the RTC clock source */ + RCC->BDCR |= RCC_RTCCLKSource; +} + +/** + * @brief Enables or disables the RTC clock. + * @note This function must be used only after the RTC clock was selected using the RCC_RTCCLKConfig function. + * @param NewState: new state of the RTC clock. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_RTCCLKCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) BDCR_RTCEN_BB = (uint32_t)NewState; +} + +/** + * @brief Returns the frequencies of different on chip clocks. + * @param RCC_Clocks: pointer to a RCC_ClocksTypeDef structure which will hold + * the clocks frequencies. + * @note The result of this function could be not correct when using + * fractional value for HSE crystal. + * @retval None + */ +void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks) +{ + uint32_t tmp = 0, pllmull = 0, pllsource = 0, presc = 0; + +#ifdef STM32F10X_CL + uint32_t prediv1source = 0, prediv1factor = 0, prediv2factor = 0, pll2mull = 0; +#endif /* STM32F10X_CL */ + +#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) + uint32_t prediv1factor = 0; +#endif + + /* Get SYSCLK source -------------------------------------------------------*/ + tmp = RCC->CFGR & CFGR_SWS_Mask; + + switch (tmp) + { + case 0x00: /* HSI used as system clock */ + RCC_Clocks->SYSCLK_Frequency = HSI_VALUE; + break; + case 0x04: /* HSE used as system clock */ + RCC_Clocks->SYSCLK_Frequency = HSE_VALUE; + break; + case 0x08: /* PLL used as system clock */ + + /* Get PLL clock source and multiplication factor ----------------------*/ + pllmull = RCC->CFGR & CFGR_PLLMull_Mask; + pllsource = RCC->CFGR & CFGR_PLLSRC_Mask; + +#ifndef STM32F10X_CL + pllmull = ( pllmull >> 18) + 2; + + if (pllsource == 0x00) + {/* HSI oscillator clock divided by 2 selected as PLL clock entry */ + RCC_Clocks->SYSCLK_Frequency = (HSI_VALUE >> 1) * pllmull; + } + else + { + #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) + prediv1factor = (RCC->CFGR2 & CFGR2_PREDIV1) + 1; + /* HSE oscillator clock selected as PREDIV1 clock entry */ + RCC_Clocks->SYSCLK_Frequency = (HSE_VALUE / prediv1factor) * pllmull; + #else + /* HSE selected as PLL clock entry */ + if ((RCC->CFGR & CFGR_PLLXTPRE_Mask) != (uint32_t)RESET) + {/* HSE oscillator clock divided by 2 */ + RCC_Clocks->SYSCLK_Frequency = (HSE_VALUE >> 1) * pllmull; + } + else + { + RCC_Clocks->SYSCLK_Frequency = HSE_VALUE * pllmull; + } + #endif + } +#else + pllmull = pllmull >> 18; + + if (pllmull != 0x0D) + { + pllmull += 2; + } + else + { /* PLL multiplication factor = PLL input clock * 6.5 */ + pllmull = 13 / 2; + } + + if (pllsource == 0x00) + {/* HSI oscillator clock divided by 2 selected as PLL clock entry */ + RCC_Clocks->SYSCLK_Frequency = (HSI_VALUE >> 1) * pllmull; + } + else + {/* PREDIV1 selected as PLL clock entry */ + + /* Get PREDIV1 clock source and division factor */ + prediv1source = RCC->CFGR2 & CFGR2_PREDIV1SRC; + prediv1factor = (RCC->CFGR2 & CFGR2_PREDIV1) + 1; + + if (prediv1source == 0) + { /* HSE oscillator clock selected as PREDIV1 clock entry */ + RCC_Clocks->SYSCLK_Frequency = (HSE_VALUE / prediv1factor) * pllmull; + } + else + {/* PLL2 clock selected as PREDIV1 clock entry */ + + /* Get PREDIV2 division factor and PLL2 multiplication factor */ + prediv2factor = ((RCC->CFGR2 & CFGR2_PREDIV2) >> 4) + 1; + pll2mull = ((RCC->CFGR2 & CFGR2_PLL2MUL) >> 8 ) + 2; + RCC_Clocks->SYSCLK_Frequency = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull; + } + } +#endif /* STM32F10X_CL */ + break; + + default: + RCC_Clocks->SYSCLK_Frequency = HSI_VALUE; + break; + } + + /* Compute HCLK, PCLK1, PCLK2 and ADCCLK clocks frequencies ----------------*/ + /* Get HCLK prescaler */ + tmp = RCC->CFGR & CFGR_HPRE_Set_Mask; + tmp = tmp >> 4; + presc = APBAHBPrescTable[tmp]; + /* HCLK clock frequency */ + RCC_Clocks->HCLK_Frequency = RCC_Clocks->SYSCLK_Frequency >> presc; + /* Get PCLK1 prescaler */ + tmp = RCC->CFGR & CFGR_PPRE1_Set_Mask; + tmp = tmp >> 8; + presc = APBAHBPrescTable[tmp]; + /* PCLK1 clock frequency */ + RCC_Clocks->PCLK1_Frequency = RCC_Clocks->HCLK_Frequency >> presc; + /* Get PCLK2 prescaler */ + tmp = RCC->CFGR & CFGR_PPRE2_Set_Mask; + tmp = tmp >> 11; + presc = APBAHBPrescTable[tmp]; + /* PCLK2 clock frequency */ + RCC_Clocks->PCLK2_Frequency = RCC_Clocks->HCLK_Frequency >> presc; + /* Get ADCCLK prescaler */ + tmp = RCC->CFGR & CFGR_ADCPRE_Set_Mask; + tmp = tmp >> 14; + presc = ADCPrescTable[tmp]; + /* ADCCLK clock frequency */ + RCC_Clocks->ADCCLK_Frequency = RCC_Clocks->PCLK2_Frequency / presc; +} + +/** + * @brief Enables or disables the AHB peripheral clock. + * @param RCC_AHBPeriph: specifies the AHB peripheral to gates its clock. + * + * For @b STM32_Connectivity_line_devices, this parameter can be any combination + * of the following values: + * @arg RCC_AHBPeriph_DMA1 + * @arg RCC_AHBPeriph_DMA2 + * @arg RCC_AHBPeriph_SRAM + * @arg RCC_AHBPeriph_FLITF + * @arg RCC_AHBPeriph_CRC + * @arg RCC_AHBPeriph_OTG_FS + * @arg RCC_AHBPeriph_ETH_MAC + * @arg RCC_AHBPeriph_ETH_MAC_Tx + * @arg RCC_AHBPeriph_ETH_MAC_Rx + * + * For @b other_STM32_devices, this parameter can be any combination of the + * following values: + * @arg RCC_AHBPeriph_DMA1 + * @arg RCC_AHBPeriph_DMA2 + * @arg RCC_AHBPeriph_SRAM + * @arg RCC_AHBPeriph_FLITF + * @arg RCC_AHBPeriph_CRC + * @arg RCC_AHBPeriph_FSMC + * @arg RCC_AHBPeriph_SDIO + * + * @note SRAM and FLITF clock can be disabled only during sleep mode. + * @param NewState: new state of the specified peripheral clock. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + RCC->AHBENR |= RCC_AHBPeriph; + } + else + { + RCC->AHBENR &= ~RCC_AHBPeriph; + } +} + +/** + * @brief Enables or disables the High Speed APB (APB2) peripheral clock. + * @param RCC_APB2Periph: specifies the APB2 peripheral to gates its clock. + * This parameter can be any combination of the following values: + * @arg RCC_APB2Periph_AFIO, RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB, + * RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, RCC_APB2Periph_GPIOE, + * RCC_APB2Periph_GPIOF, RCC_APB2Periph_GPIOG, RCC_APB2Periph_ADC1, + * RCC_APB2Periph_ADC2, RCC_APB2Periph_TIM1, RCC_APB2Periph_SPI1, + * RCC_APB2Periph_TIM8, RCC_APB2Periph_USART1, RCC_APB2Periph_ADC3, + * RCC_APB2Periph_TIM15, RCC_APB2Periph_TIM16, RCC_APB2Periph_TIM17, + * RCC_APB2Periph_TIM9, RCC_APB2Periph_TIM10, RCC_APB2Periph_TIM11 + * @param NewState: new state of the specified peripheral clock. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + RCC->APB2ENR |= RCC_APB2Periph; + } + else + { + RCC->APB2ENR &= ~RCC_APB2Periph; + } +} + +/** + * @brief Enables or disables the Low Speed APB (APB1) peripheral clock. + * @param RCC_APB1Periph: specifies the APB1 peripheral to gates its clock. + * This parameter can be any combination of the following values: + * @arg RCC_APB1Periph_TIM2, RCC_APB1Periph_TIM3, RCC_APB1Periph_TIM4, + * RCC_APB1Periph_TIM5, RCC_APB1Periph_TIM6, RCC_APB1Periph_TIM7, + * RCC_APB1Periph_WWDG, RCC_APB1Periph_SPI2, RCC_APB1Periph_SPI3, + * RCC_APB1Periph_USART2, RCC_APB1Periph_USART3, RCC_APB1Periph_USART4, + * RCC_APB1Periph_USART5, RCC_APB1Periph_I2C1, RCC_APB1Periph_I2C2, + * RCC_APB1Periph_USB, RCC_APB1Periph_CAN1, RCC_APB1Periph_BKP, + * RCC_APB1Periph_PWR, RCC_APB1Periph_DAC, RCC_APB1Periph_CEC, + * RCC_APB1Periph_TIM12, RCC_APB1Periph_TIM13, RCC_APB1Periph_TIM14 + * @param NewState: new state of the specified peripheral clock. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + RCC->APB1ENR |= RCC_APB1Periph; + } + else + { + RCC->APB1ENR &= ~RCC_APB1Periph; + } +} + +#ifdef STM32F10X_CL +/** + * @brief Forces or releases AHB peripheral reset. + * @note This function applies only to STM32 Connectivity line devices. + * @param RCC_AHBPeriph: specifies the AHB peripheral to reset. + * This parameter can be any combination of the following values: + * @arg RCC_AHBPeriph_OTG_FS + * @arg RCC_AHBPeriph_ETH_MAC + * @param NewState: new state of the specified peripheral reset. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_AHBPeriphResetCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_AHB_PERIPH_RESET(RCC_AHBPeriph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + RCC->AHBRSTR |= RCC_AHBPeriph; + } + else + { + RCC->AHBRSTR &= ~RCC_AHBPeriph; + } +} +#endif /* STM32F10X_CL */ + +/** + * @brief Forces or releases High Speed APB (APB2) peripheral reset. + * @param RCC_APB2Periph: specifies the APB2 peripheral to reset. + * This parameter can be any combination of the following values: + * @arg RCC_APB2Periph_AFIO, RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB, + * RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, RCC_APB2Periph_GPIOE, + * RCC_APB2Periph_GPIOF, RCC_APB2Periph_GPIOG, RCC_APB2Periph_ADC1, + * RCC_APB2Periph_ADC2, RCC_APB2Periph_TIM1, RCC_APB2Periph_SPI1, + * RCC_APB2Periph_TIM8, RCC_APB2Periph_USART1, RCC_APB2Periph_ADC3, + * RCC_APB2Periph_TIM15, RCC_APB2Periph_TIM16, RCC_APB2Periph_TIM17, + * RCC_APB2Periph_TIM9, RCC_APB2Periph_TIM10, RCC_APB2Periph_TIM11 + * @param NewState: new state of the specified peripheral reset. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + RCC->APB2RSTR |= RCC_APB2Periph; + } + else + { + RCC->APB2RSTR &= ~RCC_APB2Periph; + } +} + +/** + * @brief Forces or releases Low Speed APB (APB1) peripheral reset. + * @param RCC_APB1Periph: specifies the APB1 peripheral to reset. + * This parameter can be any combination of the following values: + * @arg RCC_APB1Periph_TIM2, RCC_APB1Periph_TIM3, RCC_APB1Periph_TIM4, + * RCC_APB1Periph_TIM5, RCC_APB1Periph_TIM6, RCC_APB1Periph_TIM7, + * RCC_APB1Periph_WWDG, RCC_APB1Periph_SPI2, RCC_APB1Periph_SPI3, + * RCC_APB1Periph_USART2, RCC_APB1Periph_USART3, RCC_APB1Periph_USART4, + * RCC_APB1Periph_USART5, RCC_APB1Periph_I2C1, RCC_APB1Periph_I2C2, + * RCC_APB1Periph_USB, RCC_APB1Periph_CAN1, RCC_APB1Periph_BKP, + * RCC_APB1Periph_PWR, RCC_APB1Periph_DAC, RCC_APB1Periph_CEC, + * RCC_APB1Periph_TIM12, RCC_APB1Periph_TIM13, RCC_APB1Periph_TIM14 + * @param NewState: new state of the specified peripheral clock. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + RCC->APB1RSTR |= RCC_APB1Periph; + } + else + { + RCC->APB1RSTR &= ~RCC_APB1Periph; + } +} + +/** + * @brief Forces or releases the Backup domain reset. + * @param NewState: new state of the Backup domain reset. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_BackupResetCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) BDCR_BDRST_BB = (uint32_t)NewState; +} + +/** + * @brief Enables or disables the Clock Security System. + * @param NewState: new state of the Clock Security System.. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RCC_ClockSecuritySystemCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + *(__IO uint32_t *) CR_CSSON_BB = (uint32_t)NewState; +} + +/** + * @brief Selects the clock source to output on MCO pin. + * @param RCC_MCO: specifies the clock source to output. + * + * For @b STM32_Connectivity_line_devices, this parameter can be one of the + * following values: + * @arg RCC_MCO_NoClock: No clock selected + * @arg RCC_MCO_SYSCLK: System clock selected + * @arg RCC_MCO_HSI: HSI oscillator clock selected + * @arg RCC_MCO_HSE: HSE oscillator clock selected + * @arg RCC_MCO_PLLCLK_Div2: PLL clock divided by 2 selected + * @arg RCC_MCO_PLL2CLK: PLL2 clock selected + * @arg RCC_MCO_PLL3CLK_Div2: PLL3 clock divided by 2 selected + * @arg RCC_MCO_XT1: External 3-25 MHz oscillator clock selected + * @arg RCC_MCO_PLL3CLK: PLL3 clock selected + * + * For @b other_STM32_devices, this parameter can be one of the following values: + * @arg RCC_MCO_NoClock: No clock selected + * @arg RCC_MCO_SYSCLK: System clock selected + * @arg RCC_MCO_HSI: HSI oscillator clock selected + * @arg RCC_MCO_HSE: HSE oscillator clock selected + * @arg RCC_MCO_PLLCLK_Div2: PLL clock divided by 2 selected + * + * @retval None + */ +void RCC_MCOConfig(uint8_t RCC_MCO) +{ + /* Check the parameters */ + assert_param(IS_RCC_MCO(RCC_MCO)); + + /* Perform Byte access to MCO bits to select the MCO source */ + *(__IO uint8_t *) CFGR_BYTE4_ADDRESS = RCC_MCO; +} + +/** + * @brief Checks whether the specified RCC flag is set or not. + * @param RCC_FLAG: specifies the flag to check. + * + * For @b STM32_Connectivity_line_devices, this parameter can be one of the + * following values: + * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready + * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready + * @arg RCC_FLAG_PLLRDY: PLL clock ready + * @arg RCC_FLAG_PLL2RDY: PLL2 clock ready + * @arg RCC_FLAG_PLL3RDY: PLL3 clock ready + * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready + * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready + * @arg RCC_FLAG_PINRST: Pin reset + * @arg RCC_FLAG_PORRST: POR/PDR reset + * @arg RCC_FLAG_SFTRST: Software reset + * @arg RCC_FLAG_IWDGRST: Independent Watchdog reset + * @arg RCC_FLAG_WWDGRST: Window Watchdog reset + * @arg RCC_FLAG_LPWRRST: Low Power reset + * + * For @b other_STM32_devices, this parameter can be one of the following values: + * @arg RCC_FLAG_HSIRDY: HSI oscillator clock ready + * @arg RCC_FLAG_HSERDY: HSE oscillator clock ready + * @arg RCC_FLAG_PLLRDY: PLL clock ready + * @arg RCC_FLAG_LSERDY: LSE oscillator clock ready + * @arg RCC_FLAG_LSIRDY: LSI oscillator clock ready + * @arg RCC_FLAG_PINRST: Pin reset + * @arg RCC_FLAG_PORRST: POR/PDR reset + * @arg RCC_FLAG_SFTRST: Software reset + * @arg RCC_FLAG_IWDGRST: Independent Watchdog reset + * @arg RCC_FLAG_WWDGRST: Window Watchdog reset + * @arg RCC_FLAG_LPWRRST: Low Power reset + * + * @retval The new state of RCC_FLAG (SET or RESET). + */ +FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG) +{ + uint32_t tmp = 0; + uint32_t statusreg = 0; + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_RCC_FLAG(RCC_FLAG)); + + /* Get the RCC register index */ + tmp = RCC_FLAG >> 5; + if (tmp == 1) /* The flag to check is in CR register */ + { + statusreg = RCC->CR; + } + else if (tmp == 2) /* The flag to check is in BDCR register */ + { + statusreg = RCC->BDCR; + } + else /* The flag to check is in CSR register */ + { + statusreg = RCC->CSR; + } + + /* Get the flag position */ + tmp = RCC_FLAG & FLAG_Mask; + if ((statusreg & ((uint32_t)1 << tmp)) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + + /* Return the flag status */ + return bitstatus; +} + +/** + * @brief Clears the RCC reset flags. + * @note The reset flags are: RCC_FLAG_PINRST, RCC_FLAG_PORRST, RCC_FLAG_SFTRST, + * RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST, RCC_FLAG_LPWRRST + * @param None + * @retval None + */ +void RCC_ClearFlag(void) +{ + /* Set RMVF bit to clear the reset flags */ + RCC->CSR |= CSR_RMVF_Set; +} + +/** + * @brief Checks whether the specified RCC interrupt has occurred or not. + * @param RCC_IT: specifies the RCC interrupt source to check. + * + * For @b STM32_Connectivity_line_devices, this parameter can be one of the + * following values: + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt + * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt + * @arg RCC_IT_CSS: Clock Security System interrupt + * + * For @b other_STM32_devices, this parameter can be one of the following values: + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * @arg RCC_IT_CSS: Clock Security System interrupt + * + * @retval The new state of RCC_IT (SET or RESET). + */ +ITStatus RCC_GetITStatus(uint8_t RCC_IT) +{ + ITStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_RCC_GET_IT(RCC_IT)); + + /* Check the status of the specified RCC interrupt */ + if ((RCC->CIR & RCC_IT) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + + /* Return the RCC_IT status */ + return bitstatus; +} + +/** + * @brief Clears the RCC's interrupt pending bits. + * @param RCC_IT: specifies the interrupt pending bit to clear. + * + * For @b STM32_Connectivity_line_devices, this parameter can be any combination + * of the following values: + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * @arg RCC_IT_PLL2RDY: PLL2 ready interrupt + * @arg RCC_IT_PLL3RDY: PLL3 ready interrupt + * @arg RCC_IT_CSS: Clock Security System interrupt + * + * For @b other_STM32_devices, this parameter can be any combination of the + * following values: + * @arg RCC_IT_LSIRDY: LSI ready interrupt + * @arg RCC_IT_LSERDY: LSE ready interrupt + * @arg RCC_IT_HSIRDY: HSI ready interrupt + * @arg RCC_IT_HSERDY: HSE ready interrupt + * @arg RCC_IT_PLLRDY: PLL ready interrupt + * + * @arg RCC_IT_CSS: Clock Security System interrupt + * @retval None + */ +void RCC_ClearITPendingBit(uint8_t RCC_IT) +{ + /* Check the parameters */ + assert_param(IS_RCC_CLEAR_IT(RCC_IT)); + + /* Perform Byte access to RCC_CIR[23:16] bits to clear the selected interrupt + pending bits */ + *(__IO uint8_t *) CIR_BYTE3_ADDRESS = RCC_IT; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c new file mode 100644 index 0000000..c1bc9e1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c @@ -0,0 +1,350 @@ +/** + ****************************************************************************** + * @file stm32f10x_rtc.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the RTC firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_rtc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup RTC + * @brief RTC driver modules + * @{ + */ + +/** @defgroup RTC_Private_TypesDefinitions + * @{ + */ +/** + * @} + */ + +/** @defgroup RTC_Private_Defines + * @{ + */ +#define RTC_LSB_MASK ((uint32_t)0x0000FFFF) /*!< RTC LSB Mask */ +#define PRLH_MSB_MASK ((uint32_t)0x000F0000) /*!< RTC Prescaler MSB Mask */ + +/** + * @} + */ + +/** @defgroup RTC_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup RTC_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup RTC_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup RTC_Private_Functions + * @{ + */ + +/** + * @brief Enables or disables the specified RTC interrupts. + * @param RTC_IT: specifies the RTC interrupts sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg RTC_IT_OW: Overflow interrupt + * @arg RTC_IT_ALR: Alarm interrupt + * @arg RTC_IT_SEC: Second interrupt + * @param NewState: new state of the specified RTC interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_RTC_IT(RTC_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + RTC->CRH |= RTC_IT; + } + else + { + RTC->CRH &= (uint16_t)~RTC_IT; + } +} + +/** + * @brief Enters the RTC configuration mode. + * @param None + * @retval None + */ +void RTC_EnterConfigMode(void) +{ + /* Set the CNF flag to enter in the Configuration Mode */ + RTC->CRL |= RTC_CRL_CNF; +} + +/** + * @brief Exits from the RTC configuration mode. + * @param None + * @retval None + */ +void RTC_ExitConfigMode(void) +{ + /* Reset the CNF flag to exit from the Configuration Mode */ + RTC->CRL &= (uint16_t)~((uint16_t)RTC_CRL_CNF); +} + +/** + * @brief Gets the RTC counter value. + * @param None + * @retval RTC counter value. + */ +uint32_t RTC_GetCounter(void) +{ + uint16_t high1 = 0, high2 = 0, low = 0; + + high1 = RTC->CNTH; + low = RTC->CNTL; + high2 = RTC->CNTH; + + if (high1 != high2) + { /* In this case the counter roll over during reading of CNTL and CNTH registers, + read again CNTL register then return the counter value */ + return (((uint32_t) high2 << 16 ) | RTC->CNTL); + } + else + { /* No counter roll over during reading of CNTL and CNTH registers, counter + value is equal to first value of CNTL and CNTH */ + return (((uint32_t) high1 << 16 ) | low); + } +} + +/** + * @brief Sets the RTC counter value. + * @param CounterValue: RTC counter new value. + * @retval None + */ +void RTC_SetCounter(uint32_t CounterValue) +{ + RTC_EnterConfigMode(); + /* Set RTC COUNTER MSB word */ + RTC->CNTH = CounterValue >> 16; + /* Set RTC COUNTER LSB word */ + RTC->CNTL = (CounterValue & RTC_LSB_MASK); + RTC_ExitConfigMode(); +} + +/** + * @brief Sets the RTC prescaler value. + * @param PrescalerValue: RTC prescaler new value. + * @retval None + */ +void RTC_SetPrescaler(uint32_t PrescalerValue) +{ + /* Check the parameters */ + assert_param(IS_RTC_PRESCALER(PrescalerValue)); + + RTC_EnterConfigMode(); + /* Set RTC PRESCALER MSB word */ + RTC->PRLH = (PrescalerValue & PRLH_MSB_MASK) >> 16; + /* Set RTC PRESCALER LSB word */ + RTC->PRLL = (PrescalerValue & RTC_LSB_MASK); + RTC_ExitConfigMode(); +} + +/** + * @brief Sets the RTC alarm value. + * @param AlarmValue: RTC alarm new value. + * @retval None + */ +void RTC_SetAlarm(uint32_t AlarmValue) +{ + RTC_EnterConfigMode(); + /* Set the ALARM MSB word */ + RTC->ALRH = AlarmValue >> 16; + /* Set the ALARM LSB word */ + RTC->ALRL = (AlarmValue & RTC_LSB_MASK); + RTC_ExitConfigMode(); +} + +/** + * @brief Gets the RTC divider value. + * @param None + * @retval RTC Divider value. + */ +uint32_t RTC_GetDivider(void) +{ + uint32_t tmp = 0x00; + tmp = ((uint32_t)RTC->DIVH & (uint32_t)0x000F) << 16; + tmp |= RTC->DIVL; + return tmp; +} + +/** + * @brief Waits until last write operation on RTC registers has finished. + * @note This function must be called before any write to RTC registers. + * @param None + * @retval None + */ +void RTC_WaitForLastTask(void) +{ + /* Loop until RTOFF flag is set */ + while ((RTC->CRL & RTC_FLAG_RTOFF) == (uint16_t)RESET) + { + } +} + +/** + * @brief Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) + * are synchronized with RTC APB clock. + * @note This function must be called before any read operation after an APB reset + * or an APB clock stop. + * @param None + * @retval None + */ +void RTC_WaitForSynchro(void) +{ + /* Clear RSF flag */ + RTC->CRL &= (uint16_t)~RTC_FLAG_RSF; + /* Loop until RSF flag is set */ + while ((RTC->CRL & RTC_FLAG_RSF) == (uint16_t)RESET) + { + } +} + +/** + * @brief Checks whether the specified RTC flag is set or not. + * @param RTC_FLAG: specifies the flag to check. + * This parameter can be one the following values: + * @arg RTC_FLAG_RTOFF: RTC Operation OFF flag + * @arg RTC_FLAG_RSF: Registers Synchronized flag + * @arg RTC_FLAG_OW: Overflow flag + * @arg RTC_FLAG_ALR: Alarm flag + * @arg RTC_FLAG_SEC: Second flag + * @retval The new state of RTC_FLAG (SET or RESET). + */ +FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG) +{ + FlagStatus bitstatus = RESET; + + /* Check the parameters */ + assert_param(IS_RTC_GET_FLAG(RTC_FLAG)); + + if ((RTC->CRL & RTC_FLAG) != (uint16_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the RTC's pending flags. + * @param RTC_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg RTC_FLAG_RSF: Registers Synchronized flag. This flag is cleared only after + * an APB reset or an APB Clock stop. + * @arg RTC_FLAG_OW: Overflow flag + * @arg RTC_FLAG_ALR: Alarm flag + * @arg RTC_FLAG_SEC: Second flag + * @retval None + */ +void RTC_ClearFlag(uint16_t RTC_FLAG) +{ + /* Check the parameters */ + assert_param(IS_RTC_CLEAR_FLAG(RTC_FLAG)); + + /* Clear the corresponding RTC flag */ + RTC->CRL &= (uint16_t)~RTC_FLAG; +} + +/** + * @brief Checks whether the specified RTC interrupt has occurred or not. + * @param RTC_IT: specifies the RTC interrupts sources to check. + * This parameter can be one of the following values: + * @arg RTC_IT_OW: Overflow interrupt + * @arg RTC_IT_ALR: Alarm interrupt + * @arg RTC_IT_SEC: Second interrupt + * @retval The new state of the RTC_IT (SET or RESET). + */ +ITStatus RTC_GetITStatus(uint16_t RTC_IT) +{ + ITStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_RTC_GET_IT(RTC_IT)); + + bitstatus = (ITStatus)(RTC->CRL & RTC_IT); + if (((RTC->CRH & RTC_IT) != (uint16_t)RESET) && (bitstatus != (uint16_t)RESET)) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the RTC's interrupt pending bits. + * @param RTC_IT: specifies the interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg RTC_IT_OW: Overflow interrupt + * @arg RTC_IT_ALR: Alarm interrupt + * @arg RTC_IT_SEC: Second interrupt + * @retval None + */ +void RTC_ClearITPendingBit(uint16_t RTC_IT) +{ + /* Check the parameters */ + assert_param(IS_RTC_IT(RTC_IT)); + + /* Clear the corresponding RTC pending bit */ + RTC->CRL &= (uint16_t)~RTC_IT; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c new file mode 100644 index 0000000..7c0bb9b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c @@ -0,0 +1,796 @@ +/** + ****************************************************************************** + * @file stm32f10x_sdio.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the SDIO firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_sdio.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup SDIO + * @brief SDIO driver modules + * @{ + */ + +/** @defgroup SDIO_Private_TypesDefinitions + * @{ + */ + +/* ------------ SDIO registers bit address in the alias region ----------- */ +#define SDIO_OFFSET (SDIO_BASE - PERIPH_BASE) + +/* --- CLKCR Register ---*/ + +/* Alias word address of CLKEN bit */ +#define CLKCR_OFFSET (SDIO_OFFSET + 0x04) +#define CLKEN_BitNumber 0x08 +#define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BitNumber * 4)) + +/* --- CMD Register ---*/ + +/* Alias word address of SDIOSUSPEND bit */ +#define CMD_OFFSET (SDIO_OFFSET + 0x0C) +#define SDIOSUSPEND_BitNumber 0x0B +#define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BitNumber * 4)) + +/* Alias word address of ENCMDCOMPL bit */ +#define ENCMDCOMPL_BitNumber 0x0C +#define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BitNumber * 4)) + +/* Alias word address of NIEN bit */ +#define NIEN_BitNumber 0x0D +#define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BitNumber * 4)) + +/* Alias word address of ATACMD bit */ +#define ATACMD_BitNumber 0x0E +#define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BitNumber * 4)) + +/* --- DCTRL Register ---*/ + +/* Alias word address of DMAEN bit */ +#define DCTRL_OFFSET (SDIO_OFFSET + 0x2C) +#define DMAEN_BitNumber 0x03 +#define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BitNumber * 4)) + +/* Alias word address of RWSTART bit */ +#define RWSTART_BitNumber 0x08 +#define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BitNumber * 4)) + +/* Alias word address of RWSTOP bit */ +#define RWSTOP_BitNumber 0x09 +#define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BitNumber * 4)) + +/* Alias word address of RWMOD bit */ +#define RWMOD_BitNumber 0x0A +#define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BitNumber * 4)) + +/* Alias word address of SDIOEN bit */ +#define SDIOEN_BitNumber 0x0B +#define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BitNumber * 4)) + +/* ---------------------- SDIO registers bit mask ------------------------ */ + +/* --- CLKCR Register ---*/ + +/* CLKCR register clear mask */ +#define CLKCR_CLEAR_MASK ((uint32_t)0xFFFF8100) + +/* --- PWRCTRL Register ---*/ + +/* SDIO PWRCTRL Mask */ +#define PWR_PWRCTRL_MASK ((uint32_t)0xFFFFFFFC) + +/* --- DCTRL Register ---*/ + +/* SDIO DCTRL Clear Mask */ +#define DCTRL_CLEAR_MASK ((uint32_t)0xFFFFFF08) + +/* --- CMD Register ---*/ + +/* CMD Register clear mask */ +#define CMD_CLEAR_MASK ((uint32_t)0xFFFFF800) + +/* SDIO RESP Registers Address */ +#define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14)) + +/** + * @} + */ + +/** @defgroup SDIO_Private_Defines + * @{ + */ + +/** + * @} + */ + +/** @defgroup SDIO_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup SDIO_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup SDIO_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup SDIO_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the SDIO peripheral registers to their default reset values. + * @param None + * @retval None + */ +void SDIO_DeInit(void) +{ + SDIO->POWER = 0x00000000; + SDIO->CLKCR = 0x00000000; + SDIO->ARG = 0x00000000; + SDIO->CMD = 0x00000000; + SDIO->DTIMER = 0x00000000; + SDIO->DLEN = 0x00000000; + SDIO->DCTRL = 0x00000000; + SDIO->ICR = 0x00C007FF; + SDIO->MASK = 0x00000000; +} + +/** + * @brief Initializes the SDIO peripheral according to the specified + * parameters in the SDIO_InitStruct. + * @param SDIO_InitStruct : pointer to a SDIO_InitTypeDef structure + * that contains the configuration information for the SDIO peripheral. + * @retval None + */ +void SDIO_Init(SDIO_InitTypeDef* SDIO_InitStruct) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_SDIO_CLOCK_EDGE(SDIO_InitStruct->SDIO_ClockEdge)); + assert_param(IS_SDIO_CLOCK_BYPASS(SDIO_InitStruct->SDIO_ClockBypass)); + assert_param(IS_SDIO_CLOCK_POWER_SAVE(SDIO_InitStruct->SDIO_ClockPowerSave)); + assert_param(IS_SDIO_BUS_WIDE(SDIO_InitStruct->SDIO_BusWide)); + assert_param(IS_SDIO_HARDWARE_FLOW_CONTROL(SDIO_InitStruct->SDIO_HardwareFlowControl)); + +/*---------------------------- SDIO CLKCR Configuration ------------------------*/ + /* Get the SDIO CLKCR value */ + tmpreg = SDIO->CLKCR; + + /* Clear CLKDIV, PWRSAV, BYPASS, WIDBUS, NEGEDGE, HWFC_EN bits */ + tmpreg &= CLKCR_CLEAR_MASK; + + /* Set CLKDIV bits according to SDIO_ClockDiv value */ + /* Set PWRSAV bit according to SDIO_ClockPowerSave value */ + /* Set BYPASS bit according to SDIO_ClockBypass value */ + /* Set WIDBUS bits according to SDIO_BusWide value */ + /* Set NEGEDGE bits according to SDIO_ClockEdge value */ + /* Set HWFC_EN bits according to SDIO_HardwareFlowControl value */ + tmpreg |= (SDIO_InitStruct->SDIO_ClockDiv | SDIO_InitStruct->SDIO_ClockPowerSave | + SDIO_InitStruct->SDIO_ClockBypass | SDIO_InitStruct->SDIO_BusWide | + SDIO_InitStruct->SDIO_ClockEdge | SDIO_InitStruct->SDIO_HardwareFlowControl); + + /* Write to SDIO CLKCR */ + SDIO->CLKCR = tmpreg; +} + +/** + * @brief Fills each SDIO_InitStruct member with its default value. + * @param SDIO_InitStruct: pointer to an SDIO_InitTypeDef structure which + * will be initialized. + * @retval None + */ +void SDIO_StructInit(SDIO_InitTypeDef* SDIO_InitStruct) +{ + /* SDIO_InitStruct members default value */ + SDIO_InitStruct->SDIO_ClockDiv = 0x00; + SDIO_InitStruct->SDIO_ClockEdge = SDIO_ClockEdge_Rising; + SDIO_InitStruct->SDIO_ClockBypass = SDIO_ClockBypass_Disable; + SDIO_InitStruct->SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable; + SDIO_InitStruct->SDIO_BusWide = SDIO_BusWide_1b; + SDIO_InitStruct->SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable; +} + +/** + * @brief Enables or disables the SDIO Clock. + * @param NewState: new state of the SDIO Clock. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_ClockCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CLKCR_CLKEN_BB = (uint32_t)NewState; +} + +/** + * @brief Sets the power status of the controller. + * @param SDIO_PowerState: new state of the Power state. + * This parameter can be one of the following values: + * @arg SDIO_PowerState_OFF + * @arg SDIO_PowerState_ON + * @retval None + */ +void SDIO_SetPowerState(uint32_t SDIO_PowerState) +{ + /* Check the parameters */ + assert_param(IS_SDIO_POWER_STATE(SDIO_PowerState)); + + SDIO->POWER = SDIO_PowerState; +} + +/** + * @brief Gets the power status of the controller. + * @param None + * @retval Power status of the controller. The returned value can + * be one of the following: + * - 0x00: Power OFF + * - 0x02: Power UP + * - 0x03: Power ON + */ +uint32_t SDIO_GetPowerState(void) +{ + return (SDIO->POWER & (~PWR_PWRCTRL_MASK)); +} + +/** + * @brief Enables or disables the SDIO interrupts. + * @param SDIO_IT: specifies the SDIO interrupt sources to be enabled or disabled. + * This parameter can be one or a combination of the following values: + * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt + * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt + * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt + * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt + * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt + * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt + * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt + * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt + * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt + * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide + * bus mode interrupt + * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt + * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt + * @arg SDIO_IT_TXACT: Data transmit in progress interrupt + * @arg SDIO_IT_RXACT: Data receive in progress interrupt + * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt + * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt + * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt + * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt + * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt + * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt + * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt + * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt + * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt + * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt + * @param NewState: new state of the specified SDIO interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_ITConfig(uint32_t SDIO_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SDIO_IT(SDIO_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the SDIO interrupts */ + SDIO->MASK |= SDIO_IT; + } + else + { + /* Disable the SDIO interrupts */ + SDIO->MASK &= ~SDIO_IT; + } +} + +/** + * @brief Enables or disables the SDIO DMA request. + * @param NewState: new state of the selected SDIO DMA request. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_DMACmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) DCTRL_DMAEN_BB = (uint32_t)NewState; +} + +/** + * @brief Initializes the SDIO Command according to the specified + * parameters in the SDIO_CmdInitStruct and send the command. + * @param SDIO_CmdInitStruct : pointer to a SDIO_CmdInitTypeDef + * structure that contains the configuration information for the SDIO command. + * @retval None + */ +void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_SDIO_CMD_INDEX(SDIO_CmdInitStruct->SDIO_CmdIndex)); + assert_param(IS_SDIO_RESPONSE(SDIO_CmdInitStruct->SDIO_Response)); + assert_param(IS_SDIO_WAIT(SDIO_CmdInitStruct->SDIO_Wait)); + assert_param(IS_SDIO_CPSM(SDIO_CmdInitStruct->SDIO_CPSM)); + +/*---------------------------- SDIO ARG Configuration ------------------------*/ + /* Set the SDIO Argument value */ + SDIO->ARG = SDIO_CmdInitStruct->SDIO_Argument; + +/*---------------------------- SDIO CMD Configuration ------------------------*/ + /* Get the SDIO CMD value */ + tmpreg = SDIO->CMD; + /* Clear CMDINDEX, WAITRESP, WAITINT, WAITPEND, CPSMEN bits */ + tmpreg &= CMD_CLEAR_MASK; + /* Set CMDINDEX bits according to SDIO_CmdIndex value */ + /* Set WAITRESP bits according to SDIO_Response value */ + /* Set WAITINT and WAITPEND bits according to SDIO_Wait value */ + /* Set CPSMEN bits according to SDIO_CPSM value */ + tmpreg |= (uint32_t)SDIO_CmdInitStruct->SDIO_CmdIndex | SDIO_CmdInitStruct->SDIO_Response + | SDIO_CmdInitStruct->SDIO_Wait | SDIO_CmdInitStruct->SDIO_CPSM; + + /* Write to SDIO CMD */ + SDIO->CMD = tmpreg; +} + +/** + * @brief Fills each SDIO_CmdInitStruct member with its default value. + * @param SDIO_CmdInitStruct: pointer to an SDIO_CmdInitTypeDef + * structure which will be initialized. + * @retval None + */ +void SDIO_CmdStructInit(SDIO_CmdInitTypeDef* SDIO_CmdInitStruct) +{ + /* SDIO_CmdInitStruct members default value */ + SDIO_CmdInitStruct->SDIO_Argument = 0x00; + SDIO_CmdInitStruct->SDIO_CmdIndex = 0x00; + SDIO_CmdInitStruct->SDIO_Response = SDIO_Response_No; + SDIO_CmdInitStruct->SDIO_Wait = SDIO_Wait_No; + SDIO_CmdInitStruct->SDIO_CPSM = SDIO_CPSM_Disable; +} + +/** + * @brief Returns command index of last command for which response received. + * @param None + * @retval Returns the command index of the last command response received. + */ +uint8_t SDIO_GetCommandResponse(void) +{ + return (uint8_t)(SDIO->RESPCMD); +} + +/** + * @brief Returns response received from the card for the last command. + * @param SDIO_RESP: Specifies the SDIO response register. + * This parameter can be one of the following values: + * @arg SDIO_RESP1: Response Register 1 + * @arg SDIO_RESP2: Response Register 2 + * @arg SDIO_RESP3: Response Register 3 + * @arg SDIO_RESP4: Response Register 4 + * @retval The Corresponding response register value. + */ +uint32_t SDIO_GetResponse(uint32_t SDIO_RESP) +{ + __IO uint32_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_SDIO_RESP(SDIO_RESP)); + + tmp = SDIO_RESP_ADDR + SDIO_RESP; + + return (*(__IO uint32_t *) tmp); +} + +/** + * @brief Initializes the SDIO data path according to the specified + * parameters in the SDIO_DataInitStruct. + * @param SDIO_DataInitStruct : pointer to a SDIO_DataInitTypeDef structure that + * contains the configuration information for the SDIO command. + * @retval None + */ +void SDIO_DataConfig(SDIO_DataInitTypeDef* SDIO_DataInitStruct) +{ + uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_SDIO_DATA_LENGTH(SDIO_DataInitStruct->SDIO_DataLength)); + assert_param(IS_SDIO_BLOCK_SIZE(SDIO_DataInitStruct->SDIO_DataBlockSize)); + assert_param(IS_SDIO_TRANSFER_DIR(SDIO_DataInitStruct->SDIO_TransferDir)); + assert_param(IS_SDIO_TRANSFER_MODE(SDIO_DataInitStruct->SDIO_TransferMode)); + assert_param(IS_SDIO_DPSM(SDIO_DataInitStruct->SDIO_DPSM)); + +/*---------------------------- SDIO DTIMER Configuration ---------------------*/ + /* Set the SDIO Data TimeOut value */ + SDIO->DTIMER = SDIO_DataInitStruct->SDIO_DataTimeOut; + +/*---------------------------- SDIO DLEN Configuration -----------------------*/ + /* Set the SDIO DataLength value */ + SDIO->DLEN = SDIO_DataInitStruct->SDIO_DataLength; + +/*---------------------------- SDIO DCTRL Configuration ----------------------*/ + /* Get the SDIO DCTRL value */ + tmpreg = SDIO->DCTRL; + /* Clear DEN, DTMODE, DTDIR and DBCKSIZE bits */ + tmpreg &= DCTRL_CLEAR_MASK; + /* Set DEN bit according to SDIO_DPSM value */ + /* Set DTMODE bit according to SDIO_TransferMode value */ + /* Set DTDIR bit according to SDIO_TransferDir value */ + /* Set DBCKSIZE bits according to SDIO_DataBlockSize value */ + tmpreg |= (uint32_t)SDIO_DataInitStruct->SDIO_DataBlockSize | SDIO_DataInitStruct->SDIO_TransferDir + | SDIO_DataInitStruct->SDIO_TransferMode | SDIO_DataInitStruct->SDIO_DPSM; + + /* Write to SDIO DCTRL */ + SDIO->DCTRL = tmpreg; +} + +/** + * @brief Fills each SDIO_DataInitStruct member with its default value. + * @param SDIO_DataInitStruct: pointer to an SDIO_DataInitTypeDef structure which + * will be initialized. + * @retval None + */ +void SDIO_DataStructInit(SDIO_DataInitTypeDef* SDIO_DataInitStruct) +{ + /* SDIO_DataInitStruct members default value */ + SDIO_DataInitStruct->SDIO_DataTimeOut = 0xFFFFFFFF; + SDIO_DataInitStruct->SDIO_DataLength = 0x00; + SDIO_DataInitStruct->SDIO_DataBlockSize = SDIO_DataBlockSize_1b; + SDIO_DataInitStruct->SDIO_TransferDir = SDIO_TransferDir_ToCard; + SDIO_DataInitStruct->SDIO_TransferMode = SDIO_TransferMode_Block; + SDIO_DataInitStruct->SDIO_DPSM = SDIO_DPSM_Disable; +} + +/** + * @brief Returns number of remaining data bytes to be transferred. + * @param None + * @retval Number of remaining data bytes to be transferred + */ +uint32_t SDIO_GetDataCounter(void) +{ + return SDIO->DCOUNT; +} + +/** + * @brief Read one data word from Rx FIFO. + * @param None + * @retval Data received + */ +uint32_t SDIO_ReadData(void) +{ + return SDIO->FIFO; +} + +/** + * @brief Write one data word to Tx FIFO. + * @param Data: 32-bit data word to write. + * @retval None + */ +void SDIO_WriteData(uint32_t Data) +{ + SDIO->FIFO = Data; +} + +/** + * @brief Returns the number of words left to be written to or read from FIFO. + * @param None + * @retval Remaining number of words. + */ +uint32_t SDIO_GetFIFOCount(void) +{ + return SDIO->FIFOCNT; +} + +/** + * @brief Starts the SD I/O Read Wait operation. + * @param NewState: new state of the Start SDIO Read Wait operation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_StartSDIOReadWait(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) DCTRL_RWSTART_BB = (uint32_t) NewState; +} + +/** + * @brief Stops the SD I/O Read Wait operation. + * @param NewState: new state of the Stop SDIO Read Wait operation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_StopSDIOReadWait(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) DCTRL_RWSTOP_BB = (uint32_t) NewState; +} + +/** + * @brief Sets one of the two options of inserting read wait interval. + * @param SDIO_ReadWaitMode: SD I/O Read Wait operation mode. + * This parameter can be: + * @arg SDIO_ReadWaitMode_CLK: Read Wait control by stopping SDIOCLK + * @arg SDIO_ReadWaitMode_DATA2: Read Wait control using SDIO_DATA2 + * @retval None + */ +void SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode) +{ + /* Check the parameters */ + assert_param(IS_SDIO_READWAIT_MODE(SDIO_ReadWaitMode)); + + *(__IO uint32_t *) DCTRL_RWMOD_BB = SDIO_ReadWaitMode; +} + +/** + * @brief Enables or disables the SD I/O Mode Operation. + * @param NewState: new state of SDIO specific operation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_SetSDIOOperation(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) DCTRL_SDIOEN_BB = (uint32_t)NewState; +} + +/** + * @brief Enables or disables the SD I/O Mode suspend command sending. + * @param NewState: new state of the SD I/O Mode suspend command. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_SendSDIOSuspendCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CMD_SDIOSUSPEND_BB = (uint32_t)NewState; +} + +/** + * @brief Enables or disables the command completion signal. + * @param NewState: new state of command completion signal. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_CommandCompletionCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CMD_ENCMDCOMPL_BB = (uint32_t)NewState; +} + +/** + * @brief Enables or disables the CE-ATA interrupt. + * @param NewState: new state of CE-ATA interrupt. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_CEATAITCmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CMD_NIEN_BB = (uint32_t)((~((uint32_t)NewState)) & ((uint32_t)0x1)); +} + +/** + * @brief Sends CE-ATA command (CMD61). + * @param NewState: new state of CE-ATA command. This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SDIO_SendCEATACmd(FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + *(__IO uint32_t *) CMD_ATACMD_BB = (uint32_t)NewState; +} + +/** + * @brief Checks whether the specified SDIO flag is set or not. + * @param SDIO_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed) + * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed) + * @arg SDIO_FLAG_CTIMEOUT: Command response timeout + * @arg SDIO_FLAG_DTIMEOUT: Data timeout + * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error + * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error + * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed) + * @arg SDIO_FLAG_CMDSENT: Command sent (no response required) + * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero) + * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide + * bus mode. + * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed) + * @arg SDIO_FLAG_CMDACT: Command transfer in progress + * @arg SDIO_FLAG_TXACT: Data transmit in progress + * @arg SDIO_FLAG_RXACT: Data receive in progress + * @arg SDIO_FLAG_TXFIFOHE: Transmit FIFO Half Empty + * @arg SDIO_FLAG_RXFIFOHF: Receive FIFO Half Full + * @arg SDIO_FLAG_TXFIFOF: Transmit FIFO full + * @arg SDIO_FLAG_RXFIFOF: Receive FIFO full + * @arg SDIO_FLAG_TXFIFOE: Transmit FIFO empty + * @arg SDIO_FLAG_RXFIFOE: Receive FIFO empty + * @arg SDIO_FLAG_TXDAVL: Data available in transmit FIFO + * @arg SDIO_FLAG_RXDAVL: Data available in receive FIFO + * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received + * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61 + * @retval The new state of SDIO_FLAG (SET or RESET). + */ +FlagStatus SDIO_GetFlagStatus(uint32_t SDIO_FLAG) +{ + FlagStatus bitstatus = RESET; + + /* Check the parameters */ + assert_param(IS_SDIO_FLAG(SDIO_FLAG)); + + if ((SDIO->STA & SDIO_FLAG) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the SDIO's pending flags. + * @param SDIO_FLAG: specifies the flag to clear. + * This parameter can be one or a combination of the following values: + * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed) + * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed) + * @arg SDIO_FLAG_CTIMEOUT: Command response timeout + * @arg SDIO_FLAG_DTIMEOUT: Data timeout + * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error + * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error + * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed) + * @arg SDIO_FLAG_CMDSENT: Command sent (no response required) + * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero) + * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide + * bus mode + * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed) + * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received + * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61 + * @retval None + */ +void SDIO_ClearFlag(uint32_t SDIO_FLAG) +{ + /* Check the parameters */ + assert_param(IS_SDIO_CLEAR_FLAG(SDIO_FLAG)); + + SDIO->ICR = SDIO_FLAG; +} + +/** + * @brief Checks whether the specified SDIO interrupt has occurred or not. + * @param SDIO_IT: specifies the SDIO interrupt source to check. + * This parameter can be one of the following values: + * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt + * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt + * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt + * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt + * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt + * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt + * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt + * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt + * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt + * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide + * bus mode interrupt + * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt + * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt + * @arg SDIO_IT_TXACT: Data transmit in progress interrupt + * @arg SDIO_IT_RXACT: Data receive in progress interrupt + * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt + * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt + * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt + * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt + * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt + * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt + * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt + * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt + * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt + * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt + * @retval The new state of SDIO_IT (SET or RESET). + */ +ITStatus SDIO_GetITStatus(uint32_t SDIO_IT) +{ + ITStatus bitstatus = RESET; + + /* Check the parameters */ + assert_param(IS_SDIO_GET_IT(SDIO_IT)); + if ((SDIO->STA & SDIO_IT) != (uint32_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the SDIO's interrupt pending bits. + * @param SDIO_IT: specifies the interrupt pending bit to clear. + * This parameter can be one or a combination of the following values: + * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt + * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt + * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt + * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt + * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt + * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt + * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt + * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt + * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt + * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide + * bus mode interrupt + * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt + * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 + * @retval None + */ +void SDIO_ClearITPendingBit(uint32_t SDIO_IT) +{ + /* Check the parameters */ + assert_param(IS_SDIO_CLEAR_IT(SDIO_IT)); + + SDIO->ICR = SDIO_IT; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c new file mode 100644 index 0000000..b625ae4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c @@ -0,0 +1,906 @@ +/** + ****************************************************************************** + * @file stm32f10x_spi.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the SPI firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_spi.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup SPI + * @brief SPI driver modules + * @{ + */ + +/** @defgroup SPI_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + + +/** @defgroup SPI_Private_Defines + * @{ + */ + +/* SPI SPE mask */ +#define CR1_SPE_Set ((uint16_t)0x0040) +#define CR1_SPE_Reset ((uint16_t)0xFFBF) + +/* I2S I2SE mask */ +#define I2SCFGR_I2SE_Set ((uint16_t)0x0400) +#define I2SCFGR_I2SE_Reset ((uint16_t)0xFBFF) + +/* SPI CRCNext mask */ +#define CR1_CRCNext_Set ((uint16_t)0x1000) + +/* SPI CRCEN mask */ +#define CR1_CRCEN_Set ((uint16_t)0x2000) +#define CR1_CRCEN_Reset ((uint16_t)0xDFFF) + +/* SPI SSOE mask */ +#define CR2_SSOE_Set ((uint16_t)0x0004) +#define CR2_SSOE_Reset ((uint16_t)0xFFFB) + +/* SPI registers Masks */ +#define CR1_CLEAR_Mask ((uint16_t)0x3040) +#define I2SCFGR_CLEAR_Mask ((uint16_t)0xF040) + +/* SPI or I2S mode selection masks */ +#define SPI_Mode_Select ((uint16_t)0xF7FF) +#define I2S_Mode_Select ((uint16_t)0x0800) + +/* I2S clock source selection masks */ +#define I2S2_CLOCK_SRC ((uint32_t)(0x00020000)) +#define I2S3_CLOCK_SRC ((uint32_t)(0x00040000)) +#define I2S_MUL_MASK ((uint32_t)(0x0000F000)) +#define I2S_DIV_MASK ((uint32_t)(0x000000F0)) + +/** + * @} + */ + +/** @defgroup SPI_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup SPI_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup SPI_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup SPI_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the SPIx peripheral registers to their default + * reset values (Affects also the I2Ss). + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @retval None + */ +void SPI_I2S_DeInit(SPI_TypeDef* SPIx) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + if (SPIx == SPI1) + { + /* Enable SPI1 reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, ENABLE); + /* Release SPI1 from reset state */ + RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, DISABLE); + } + else if (SPIx == SPI2) + { + /* Enable SPI2 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, ENABLE); + /* Release SPI2 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI2, DISABLE); + } + else + { + if (SPIx == SPI3) + { + /* Enable SPI3 reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI3, ENABLE); + /* Release SPI3 from reset state */ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_SPI3, DISABLE); + } + } +} + +/** + * @brief Initializes the SPIx peripheral according to the specified + * parameters in the SPI_InitStruct. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param SPI_InitStruct: pointer to a SPI_InitTypeDef structure that + * contains the configuration information for the specified SPI peripheral. + * @retval None + */ +void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct) +{ + uint16_t tmpreg = 0; + + /* check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + /* Check the SPI parameters */ + assert_param(IS_SPI_DIRECTION_MODE(SPI_InitStruct->SPI_Direction)); + assert_param(IS_SPI_MODE(SPI_InitStruct->SPI_Mode)); + assert_param(IS_SPI_DATASIZE(SPI_InitStruct->SPI_DataSize)); + assert_param(IS_SPI_CPOL(SPI_InitStruct->SPI_CPOL)); + assert_param(IS_SPI_CPHA(SPI_InitStruct->SPI_CPHA)); + assert_param(IS_SPI_NSS(SPI_InitStruct->SPI_NSS)); + assert_param(IS_SPI_BAUDRATE_PRESCALER(SPI_InitStruct->SPI_BaudRatePrescaler)); + assert_param(IS_SPI_FIRST_BIT(SPI_InitStruct->SPI_FirstBit)); + assert_param(IS_SPI_CRC_POLYNOMIAL(SPI_InitStruct->SPI_CRCPolynomial)); + +/*---------------------------- SPIx CR1 Configuration ------------------------*/ + /* Get the SPIx CR1 value */ + tmpreg = SPIx->CR1; + /* Clear BIDIMode, BIDIOE, RxONLY, SSM, SSI, LSBFirst, BR, MSTR, CPOL and CPHA bits */ + tmpreg &= CR1_CLEAR_Mask; + /* Configure SPIx: direction, NSS management, first transmitted bit, BaudRate prescaler + master/salve mode, CPOL and CPHA */ + /* Set BIDImode, BIDIOE and RxONLY bits according to SPI_Direction value */ + /* Set SSM, SSI and MSTR bits according to SPI_Mode and SPI_NSS values */ + /* Set LSBFirst bit according to SPI_FirstBit value */ + /* Set BR bits according to SPI_BaudRatePrescaler value */ + /* Set CPOL bit according to SPI_CPOL value */ + /* Set CPHA bit according to SPI_CPHA value */ + tmpreg |= (uint16_t)((uint32_t)SPI_InitStruct->SPI_Direction | SPI_InitStruct->SPI_Mode | + SPI_InitStruct->SPI_DataSize | SPI_InitStruct->SPI_CPOL | + SPI_InitStruct->SPI_CPHA | SPI_InitStruct->SPI_NSS | + SPI_InitStruct->SPI_BaudRatePrescaler | SPI_InitStruct->SPI_FirstBit); + /* Write to SPIx CR1 */ + SPIx->CR1 = tmpreg; + + /* Activate the SPI mode (Reset I2SMOD bit in I2SCFGR register) */ + SPIx->I2SCFGR &= SPI_Mode_Select; + +/*---------------------------- SPIx CRCPOLY Configuration --------------------*/ + /* Write to SPIx CRCPOLY */ + SPIx->CRCPR = SPI_InitStruct->SPI_CRCPolynomial; +} + +/** + * @brief Initializes the SPIx peripheral according to the specified + * parameters in the I2S_InitStruct. + * @param SPIx: where x can be 2 or 3 to select the SPI peripheral + * (configured in I2S mode). + * @param I2S_InitStruct: pointer to an I2S_InitTypeDef structure that + * contains the configuration information for the specified SPI peripheral + * configured in I2S mode. + * @note + * The function calculates the optimal prescaler needed to obtain the most + * accurate audio frequency (depending on the I2S clock source, the PLL values + * and the product configuration). But in case the prescaler value is greater + * than 511, the default value (0x02) will be configured instead. * + * @retval None + */ +void I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct) +{ + uint16_t tmpreg = 0, i2sdiv = 2, i2sodd = 0, packetlength = 1; + uint32_t tmp = 0; + RCC_ClocksTypeDef RCC_Clocks; + uint32_t sourceclock = 0; + + /* Check the I2S parameters */ + assert_param(IS_SPI_23_PERIPH(SPIx)); + assert_param(IS_I2S_MODE(I2S_InitStruct->I2S_Mode)); + assert_param(IS_I2S_STANDARD(I2S_InitStruct->I2S_Standard)); + assert_param(IS_I2S_DATA_FORMAT(I2S_InitStruct->I2S_DataFormat)); + assert_param(IS_I2S_MCLK_OUTPUT(I2S_InitStruct->I2S_MCLKOutput)); + assert_param(IS_I2S_AUDIO_FREQ(I2S_InitStruct->I2S_AudioFreq)); + assert_param(IS_I2S_CPOL(I2S_InitStruct->I2S_CPOL)); + +/*----------------------- SPIx I2SCFGR & I2SPR Configuration -----------------*/ + /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */ + SPIx->I2SCFGR &= I2SCFGR_CLEAR_Mask; + SPIx->I2SPR = 0x0002; + + /* Get the I2SCFGR register value */ + tmpreg = SPIx->I2SCFGR; + + /* If the default value has to be written, reinitialize i2sdiv and i2sodd*/ + if(I2S_InitStruct->I2S_AudioFreq == I2S_AudioFreq_Default) + { + i2sodd = (uint16_t)0; + i2sdiv = (uint16_t)2; + } + /* If the requested audio frequency is not the default, compute the prescaler */ + else + { + /* Check the frame length (For the Prescaler computing) */ + if(I2S_InitStruct->I2S_DataFormat == I2S_DataFormat_16b) + { + /* Packet length is 16 bits */ + packetlength = 1; + } + else + { + /* Packet length is 32 bits */ + packetlength = 2; + } + + /* Get the I2S clock source mask depending on the peripheral number */ + if(((uint32_t)SPIx) == SPI2_BASE) + { + /* The mask is relative to I2S2 */ + tmp = I2S2_CLOCK_SRC; + } + else + { + /* The mask is relative to I2S3 */ + tmp = I2S3_CLOCK_SRC; + } + + /* Check the I2S clock source configuration depending on the Device: + Only Connectivity line devices have the PLL3 VCO clock */ +#ifdef STM32F10X_CL + if((RCC->CFGR2 & tmp) != 0) + { + /* Get the configuration bits of RCC PLL3 multiplier */ + tmp = (uint32_t)((RCC->CFGR2 & I2S_MUL_MASK) >> 12); + + /* Get the value of the PLL3 multiplier */ + if((tmp > 5) && (tmp < 15)) + { + /* Multiplier is between 8 and 14 (value 15 is forbidden) */ + tmp += 2; + } + else + { + if (tmp == 15) + { + /* Multiplier is 20 */ + tmp = 20; + } + } + /* Get the PREDIV2 value */ + sourceclock = (uint32_t)(((RCC->CFGR2 & I2S_DIV_MASK) >> 4) + 1); + + /* Calculate the Source Clock frequency based on PLL3 and PREDIV2 values */ + sourceclock = (uint32_t) ((HSE_Value / sourceclock) * tmp * 2); + } + else + { + /* I2S Clock source is System clock: Get System Clock frequency */ + RCC_GetClocksFreq(&RCC_Clocks); + + /* Get the source clock value: based on System Clock value */ + sourceclock = RCC_Clocks.SYSCLK_Frequency; + } +#else /* STM32F10X_HD */ + /* I2S Clock source is System clock: Get System Clock frequency */ + RCC_GetClocksFreq(&RCC_Clocks); + + /* Get the source clock value: based on System Clock value */ + sourceclock = RCC_Clocks.SYSCLK_Frequency; +#endif /* STM32F10X_CL */ + + /* Compute the Real divider depending on the MCLK output state with a floating point */ + if(I2S_InitStruct->I2S_MCLKOutput == I2S_MCLKOutput_Enable) + { + /* MCLK output is enabled */ + tmp = (uint16_t)(((((sourceclock / 256) * 10) / I2S_InitStruct->I2S_AudioFreq)) + 5); + } + else + { + /* MCLK output is disabled */ + tmp = (uint16_t)(((((sourceclock / (32 * packetlength)) *10 ) / I2S_InitStruct->I2S_AudioFreq)) + 5); + } + + /* Remove the floating point */ + tmp = tmp / 10; + + /* Check the parity of the divider */ + i2sodd = (uint16_t)(tmp & (uint16_t)0x0001); + + /* Compute the i2sdiv prescaler */ + i2sdiv = (uint16_t)((tmp - i2sodd) / 2); + + /* Get the Mask for the Odd bit (SPI_I2SPR[8]) register */ + i2sodd = (uint16_t) (i2sodd << 8); + } + + /* Test if the divider is 1 or 0 or greater than 0xFF */ + if ((i2sdiv < 2) || (i2sdiv > 0xFF)) + { + /* Set the default values */ + i2sdiv = 2; + i2sodd = 0; + } + + /* Write to SPIx I2SPR register the computed value */ + SPIx->I2SPR = (uint16_t)(i2sdiv | (uint16_t)(i2sodd | (uint16_t)I2S_InitStruct->I2S_MCLKOutput)); + + /* Configure the I2S with the SPI_InitStruct values */ + tmpreg |= (uint16_t)(I2S_Mode_Select | (uint16_t)(I2S_InitStruct->I2S_Mode | \ + (uint16_t)(I2S_InitStruct->I2S_Standard | (uint16_t)(I2S_InitStruct->I2S_DataFormat | \ + (uint16_t)I2S_InitStruct->I2S_CPOL)))); + + /* Write to SPIx I2SCFGR */ + SPIx->I2SCFGR = tmpreg; +} + +/** + * @brief Fills each SPI_InitStruct member with its default value. + * @param SPI_InitStruct : pointer to a SPI_InitTypeDef structure which will be initialized. + * @retval None + */ +void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct) +{ +/*--------------- Reset SPI init structure parameters values -----------------*/ + /* Initialize the SPI_Direction member */ + SPI_InitStruct->SPI_Direction = SPI_Direction_2Lines_FullDuplex; + /* initialize the SPI_Mode member */ + SPI_InitStruct->SPI_Mode = SPI_Mode_Slave; + /* initialize the SPI_DataSize member */ + SPI_InitStruct->SPI_DataSize = SPI_DataSize_8b; + /* Initialize the SPI_CPOL member */ + SPI_InitStruct->SPI_CPOL = SPI_CPOL_Low; + /* Initialize the SPI_CPHA member */ + SPI_InitStruct->SPI_CPHA = SPI_CPHA_1Edge; + /* Initialize the SPI_NSS member */ + SPI_InitStruct->SPI_NSS = SPI_NSS_Hard; + /* Initialize the SPI_BaudRatePrescaler member */ + SPI_InitStruct->SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2; + /* Initialize the SPI_FirstBit member */ + SPI_InitStruct->SPI_FirstBit = SPI_FirstBit_MSB; + /* Initialize the SPI_CRCPolynomial member */ + SPI_InitStruct->SPI_CRCPolynomial = 7; +} + +/** + * @brief Fills each I2S_InitStruct member with its default value. + * @param I2S_InitStruct : pointer to a I2S_InitTypeDef structure which will be initialized. + * @retval None + */ +void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct) +{ +/*--------------- Reset I2S init structure parameters values -----------------*/ + /* Initialize the I2S_Mode member */ + I2S_InitStruct->I2S_Mode = I2S_Mode_SlaveTx; + + /* Initialize the I2S_Standard member */ + I2S_InitStruct->I2S_Standard = I2S_Standard_Phillips; + + /* Initialize the I2S_DataFormat member */ + I2S_InitStruct->I2S_DataFormat = I2S_DataFormat_16b; + + /* Initialize the I2S_MCLKOutput member */ + I2S_InitStruct->I2S_MCLKOutput = I2S_MCLKOutput_Disable; + + /* Initialize the I2S_AudioFreq member */ + I2S_InitStruct->I2S_AudioFreq = I2S_AudioFreq_Default; + + /* Initialize the I2S_CPOL member */ + I2S_InitStruct->I2S_CPOL = I2S_CPOL_Low; +} + +/** + * @brief Enables or disables the specified SPI peripheral. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param NewState: new state of the SPIx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected SPI peripheral */ + SPIx->CR1 |= CR1_SPE_Set; + } + else + { + /* Disable the selected SPI peripheral */ + SPIx->CR1 &= CR1_SPE_Reset; + } +} + +/** + * @brief Enables or disables the specified SPI peripheral (in I2S mode). + * @param SPIx: where x can be 2 or 3 to select the SPI peripheral. + * @param NewState: new state of the SPIx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SPI_23_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected SPI peripheral (in I2S mode) */ + SPIx->I2SCFGR |= I2SCFGR_I2SE_Set; + } + else + { + /* Disable the selected SPI peripheral (in I2S mode) */ + SPIx->I2SCFGR &= I2SCFGR_I2SE_Reset; + } +} + +/** + * @brief Enables or disables the specified SPI/I2S interrupts. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @param SPI_I2S_IT: specifies the SPI/I2S interrupt source to be enabled or disabled. + * This parameter can be one of the following values: + * @arg SPI_I2S_IT_TXE: Tx buffer empty interrupt mask + * @arg SPI_I2S_IT_RXNE: Rx buffer not empty interrupt mask + * @arg SPI_I2S_IT_ERR: Error interrupt mask + * @param NewState: new state of the specified SPI/I2S interrupt. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState) +{ + uint16_t itpos = 0, itmask = 0 ; + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT)); + + /* Get the SPI/I2S IT index */ + itpos = SPI_I2S_IT >> 4; + + /* Set the IT mask */ + itmask = (uint16_t)1 << (uint16_t)itpos; + + if (NewState != DISABLE) + { + /* Enable the selected SPI/I2S interrupt */ + SPIx->CR2 |= itmask; + } + else + { + /* Disable the selected SPI/I2S interrupt */ + SPIx->CR2 &= (uint16_t)~itmask; + } +} + +/** + * @brief Enables or disables the SPIx/I2Sx DMA interface. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @param SPI_I2S_DMAReq: specifies the SPI/I2S DMA transfer request to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request + * @arg SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request + * @param NewState: new state of the selected SPI/I2S DMA transfer request. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq)); + if (NewState != DISABLE) + { + /* Enable the selected SPI/I2S DMA requests */ + SPIx->CR2 |= SPI_I2S_DMAReq; + } + else + { + /* Disable the selected SPI/I2S DMA requests */ + SPIx->CR2 &= (uint16_t)~SPI_I2S_DMAReq; + } +} + +/** + * @brief Transmits a Data through the SPIx/I2Sx peripheral. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @param Data : Data to be transmitted. + * @retval None + */ +void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + /* Write in the DR register the data to be sent */ + SPIx->DR = Data; +} + +/** + * @brief Returns the most recent received data by the SPIx/I2Sx peripheral. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @retval The value of the received data. + */ +uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + /* Return the data in the DR register */ + return SPIx->DR; +} + +/** + * @brief Configures internally by software the NSS pin for the selected SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param SPI_NSSInternalSoft: specifies the SPI NSS internal state. + * This parameter can be one of the following values: + * @arg SPI_NSSInternalSoft_Set: Set NSS pin internally + * @arg SPI_NSSInternalSoft_Reset: Reset NSS pin internally + * @retval None + */ +void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSInternalSoft) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft)); + if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset) + { + /* Set NSS pin internally by software */ + SPIx->CR1 |= SPI_NSSInternalSoft_Set; + } + else + { + /* Reset NSS pin internally by software */ + SPIx->CR1 &= SPI_NSSInternalSoft_Reset; + } +} + +/** + * @brief Enables or disables the SS output for the selected SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param NewState: new state of the SPIx SS output. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected SPI SS output */ + SPIx->CR2 |= CR2_SSOE_Set; + } + else + { + /* Disable the selected SPI SS output */ + SPIx->CR2 &= CR2_SSOE_Reset; + } +} + +/** + * @brief Configures the data size for the selected SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param SPI_DataSize: specifies the SPI data size. + * This parameter can be one of the following values: + * @arg SPI_DataSize_16b: Set data frame format to 16bit + * @arg SPI_DataSize_8b: Set data frame format to 8bit + * @retval None + */ +void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_DATASIZE(SPI_DataSize)); + /* Clear DFF bit */ + SPIx->CR1 &= (uint16_t)~SPI_DataSize_16b; + /* Set new DFF bit value */ + SPIx->CR1 |= SPI_DataSize; +} + +/** + * @brief Transmit the SPIx CRC value. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @retval None + */ +void SPI_TransmitCRC(SPI_TypeDef* SPIx) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + /* Enable the selected SPI CRC transmission */ + SPIx->CR1 |= CR1_CRCNext_Set; +} + +/** + * @brief Enables or disables the CRC value calculation of the transferred bytes. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param NewState: new state of the SPIx CRC value calculation. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the selected SPI CRC calculation */ + SPIx->CR1 |= CR1_CRCEN_Set; + } + else + { + /* Disable the selected SPI CRC calculation */ + SPIx->CR1 &= CR1_CRCEN_Reset; + } +} + +/** + * @brief Returns the transmit or the receive CRC register value for the specified SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param SPI_CRC: specifies the CRC register to be read. + * This parameter can be one of the following values: + * @arg SPI_CRC_Tx: Selects Tx CRC register + * @arg SPI_CRC_Rx: Selects Rx CRC register + * @retval The selected CRC register value.. + */ +uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC) +{ + uint16_t crcreg = 0; + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_CRC(SPI_CRC)); + if (SPI_CRC != SPI_CRC_Rx) + { + /* Get the Tx CRC register */ + crcreg = SPIx->TXCRCR; + } + else + { + /* Get the Rx CRC register */ + crcreg = SPIx->RXCRCR; + } + /* Return the selected CRC register */ + return crcreg; +} + +/** + * @brief Returns the CRC Polynomial register value for the specified SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @retval The CRC Polynomial register value. + */ +uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + + /* Return the CRC polynomial register */ + return SPIx->CRCPR; +} + +/** + * @brief Selects the data transfer direction in bi-directional mode for the specified SPI. + * @param SPIx: where x can be 1, 2 or 3 to select the SPI peripheral. + * @param SPI_Direction: specifies the data transfer direction in bi-directional mode. + * This parameter can be one of the following values: + * @arg SPI_Direction_Tx: Selects Tx transmission direction + * @arg SPI_Direction_Rx: Selects Rx receive direction + * @retval None + */ +void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_DIRECTION(SPI_Direction)); + if (SPI_Direction == SPI_Direction_Tx) + { + /* Set the Tx only mode */ + SPIx->CR1 |= SPI_Direction_Tx; + } + else + { + /* Set the Rx only mode */ + SPIx->CR1 &= SPI_Direction_Rx; + } +} + +/** + * @brief Checks whether the specified SPI/I2S flag is set or not. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @param SPI_I2S_FLAG: specifies the SPI/I2S flag to check. + * This parameter can be one of the following values: + * @arg SPI_I2S_FLAG_TXE: Transmit buffer empty flag. + * @arg SPI_I2S_FLAG_RXNE: Receive buffer not empty flag. + * @arg SPI_I2S_FLAG_BSY: Busy flag. + * @arg SPI_I2S_FLAG_OVR: Overrun flag. + * @arg SPI_FLAG_MODF: Mode Fault flag. + * @arg SPI_FLAG_CRCERR: CRC Error flag. + * @arg I2S_FLAG_UDR: Underrun Error flag. + * @arg I2S_FLAG_CHSIDE: Channel Side flag. + * @retval The new state of SPI_I2S_FLAG (SET or RESET). + */ +FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_I2S_GET_FLAG(SPI_I2S_FLAG)); + /* Check the status of the specified SPI/I2S flag */ + if ((SPIx->SR & SPI_I2S_FLAG) != (uint16_t)RESET) + { + /* SPI_I2S_FLAG is set */ + bitstatus = SET; + } + else + { + /* SPI_I2S_FLAG is reset */ + bitstatus = RESET; + } + /* Return the SPI_I2S_FLAG status */ + return bitstatus; +} + +/** + * @brief Clears the SPIx CRC Error (CRCERR) flag. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * @param SPI_I2S_FLAG: specifies the SPI flag to clear. + * This function clears only CRCERR flag. + * @note + * - OVR (OverRun error) flag is cleared by software sequence: a read + * operation to SPI_DR register (SPI_I2S_ReceiveData()) followed by a read + * operation to SPI_SR register (SPI_I2S_GetFlagStatus()). + * - UDR (UnderRun error) flag is cleared by a read operation to + * SPI_SR register (SPI_I2S_GetFlagStatus()). + * - MODF (Mode Fault) flag is cleared by software sequence: a read/write + * operation to SPI_SR register (SPI_I2S_GetFlagStatus()) followed by a + * write operation to SPI_CR1 register (SPI_Cmd() to enable the SPI). + * @retval None + */ +void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG) +{ + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_I2S_CLEAR_FLAG(SPI_I2S_FLAG)); + + /* Clear the selected SPI CRC Error (CRCERR) flag */ + SPIx->SR = (uint16_t)~SPI_I2S_FLAG; +} + +/** + * @brief Checks whether the specified SPI/I2S interrupt has occurred or not. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * - 2 or 3 in I2S mode + * @param SPI_I2S_IT: specifies the SPI/I2S interrupt source to check. + * This parameter can be one of the following values: + * @arg SPI_I2S_IT_TXE: Transmit buffer empty interrupt. + * @arg SPI_I2S_IT_RXNE: Receive buffer not empty interrupt. + * @arg SPI_I2S_IT_OVR: Overrun interrupt. + * @arg SPI_IT_MODF: Mode Fault interrupt. + * @arg SPI_IT_CRCERR: CRC Error interrupt. + * @arg I2S_IT_UDR: Underrun Error interrupt. + * @retval The new state of SPI_I2S_IT (SET or RESET). + */ +ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT) +{ + ITStatus bitstatus = RESET; + uint16_t itpos = 0, itmask = 0, enablestatus = 0; + + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_I2S_GET_IT(SPI_I2S_IT)); + + /* Get the SPI/I2S IT index */ + itpos = 0x01 << (SPI_I2S_IT & 0x0F); + + /* Get the SPI/I2S IT mask */ + itmask = SPI_I2S_IT >> 4; + + /* Set the IT mask */ + itmask = 0x01 << itmask; + + /* Get the SPI_I2S_IT enable bit status */ + enablestatus = (SPIx->CR2 & itmask) ; + + /* Check the status of the specified SPI/I2S interrupt */ + if (((SPIx->SR & itpos) != (uint16_t)RESET) && enablestatus) + { + /* SPI_I2S_IT is set */ + bitstatus = SET; + } + else + { + /* SPI_I2S_IT is reset */ + bitstatus = RESET; + } + /* Return the SPI_I2S_IT status */ + return bitstatus; +} + +/** + * @brief Clears the SPIx CRC Error (CRCERR) interrupt pending bit. + * @param SPIx: where x can be + * - 1, 2 or 3 in SPI mode + * @param SPI_I2S_IT: specifies the SPI interrupt pending bit to clear. + * This function clears only CRCERR interrupt pending bit. + * @note + * - OVR (OverRun Error) interrupt pending bit is cleared by software + * sequence: a read operation to SPI_DR register (SPI_I2S_ReceiveData()) + * followed by a read operation to SPI_SR register (SPI_I2S_GetITStatus()). + * - UDR (UnderRun Error) interrupt pending bit is cleared by a read + * operation to SPI_SR register (SPI_I2S_GetITStatus()). + * - MODF (Mode Fault) interrupt pending bit is cleared by software sequence: + * a read/write operation to SPI_SR register (SPI_I2S_GetITStatus()) + * followed by a write operation to SPI_CR1 register (SPI_Cmd() to enable + * the SPI). + * @retval None + */ +void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT) +{ + uint16_t itpos = 0; + /* Check the parameters */ + assert_param(IS_SPI_ALL_PERIPH(SPIx)); + assert_param(IS_SPI_I2S_CLEAR_IT(SPI_I2S_IT)); + + /* Get the SPI IT index */ + itpos = 0x01 << (SPI_I2S_IT & 0x0F); + + /* Clear the selected SPI CRC Error (CRCERR) interrupt pending bit */ + SPIx->SR = (uint16_t)~itpos; +} +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c new file mode 100644 index 0000000..cb2bc30 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c @@ -0,0 +1,2888 @@ +/** + ****************************************************************************** + * @file stm32f10x_tim.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the TIM firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_tim.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup TIM + * @brief TIM driver modules + * @{ + */ + +/** @defgroup TIM_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_Defines + * @{ + */ + +/* ---------------------- TIM registers bit mask ------------------------ */ +#define SMCR_ETR_Mask ((uint16_t)0x00FF) +#define CCMR_Offset ((uint16_t)0x0018) +#define CCER_CCE_Set ((uint16_t)0x0001) +#define CCER_CCNE_Set ((uint16_t)0x0004) + +/** + * @} + */ + +/** @defgroup TIM_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_FunctionPrototypes + * @{ + */ + +static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter); +static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter); +static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter); +static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter); +/** + * @} + */ + +/** @defgroup TIM_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the TIMx peripheral registers to their default reset values. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @retval None + */ +void TIM_DeInit(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + + if (TIMx == TIM1) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); + } + else if (TIMx == TIM2) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); + } + else if (TIMx == TIM3) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); + } + else if (TIMx == TIM4) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); + } + else if (TIMx == TIM5) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); + } + else if (TIMx == TIM6) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); + } + else if (TIMx == TIM7) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); + } + else if (TIMx == TIM8) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); + } + else if (TIMx == TIM9) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); + } + else if (TIMx == TIM10) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); + } + else if (TIMx == TIM11) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); + } + else if (TIMx == TIM12) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); + } + else if (TIMx == TIM13) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); + } + else if (TIMx == TIM14) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); + } + else if (TIMx == TIM15) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, DISABLE); + } + else if (TIMx == TIM16) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, DISABLE); + } + else + { + if (TIMx == TIM17) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, DISABLE); + } + } +} + +/** + * @brief Initializes the TIMx Time Base Unit peripheral according to + * the specified parameters in the TIM_TimeBaseInitStruct. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef + * structure that contains the configuration information for the + * specified TIM peripheral. + * @retval None + */ +void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) +{ + uint16_t tmpcr1 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); + assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); + + tmpcr1 = TIMx->CR1; + + if((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM2) || (TIMx == TIM3)|| + (TIMx == TIM4) || (TIMx == TIM5)) + { + /* Select the Counter Mode */ + tmpcr1 &= (uint16_t)(~((uint16_t)(TIM_CR1_DIR | TIM_CR1_CMS))); + tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; + } + + if((TIMx != TIM6) && (TIMx != TIM7)) + { + /* Set the clock division */ + tmpcr1 &= (uint16_t)(~((uint16_t)TIM_CR1_CKD)); + tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; + } + + TIMx->CR1 = tmpcr1; + + /* Set the Autoreload value */ + TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; + + /* Set the Prescaler value */ + TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; + + if ((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM15)|| (TIMx == TIM16) || (TIMx == TIM17)) + { + /* Set the Repetition Counter value */ + TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; + } + + /* Generate an update event to reload the Prescaler and the Repetition counter + values immediately */ + TIMx->EGR = TIM_PSCReloadMode_Immediate; +} + +/** + * @brief Initializes the TIMx Channel1 according to the specified + * parameters in the TIM_OCInitStruct. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) +{ + uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); + assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); + /* Disable the Channel 1: Reset the CC1E Bit */ + TIMx->CCER &= (uint16_t)(~(uint16_t)TIM_CCER_CC1E); + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR1; + + /* Reset the Output Compare Mode Bits */ + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_OC1M)); + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_CC1S)); + + /* Select the Output Compare Mode */ + tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; + + /* Reset the Output Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC1P)); + /* Set the Output Compare Polarity */ + tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; + + /* Set the Output State */ + tmpccer |= TIM_OCInitStruct->TIM_OutputState; + + if((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM15)|| + (TIMx == TIM16)|| (TIMx == TIM17)) + { + assert_param(IS_TIM_OUTPUTN_STATE(TIM_OCInitStruct->TIM_OutputNState)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); + assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); + + /* Reset the Output N Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC1NP)); + /* Set the Output N Polarity */ + tmpccer |= TIM_OCInitStruct->TIM_OCNPolarity; + + /* Reset the Output N State */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC1NE)); + /* Set the Output N State */ + tmpccer |= TIM_OCInitStruct->TIM_OutputNState; + + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS1)); + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS1N)); + + /* Set the Output Idle state */ + tmpcr2 |= TIM_OCInitStruct->TIM_OCIdleState; + /* Set the Output N Idle state */ + tmpcr2 |= TIM_OCInitStruct->TIM_OCNIdleState; + } + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR1 = TIM_OCInitStruct->TIM_Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Initializes the TIMx Channel2 according to the specified + * parameters in the TIM_OCInitStruct. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select + * the TIM peripheral. + * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) +{ + uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); + assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= (uint16_t)(~((uint16_t)TIM_CCER_CC2E)); + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR1; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_OC2M)); + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_CC2S)); + + /* Select the Output Compare Mode */ + tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); + + /* Reset the Output Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC2P)); + /* Set the Output Compare Polarity */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); + + /* Set the Output State */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); + + if((TIMx == TIM1) || (TIMx == TIM8)) + { + assert_param(IS_TIM_OUTPUTN_STATE(TIM_OCInitStruct->TIM_OutputNState)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); + assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); + + /* Reset the Output N Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC2NP)); + /* Set the Output N Polarity */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); + + /* Reset the Output N State */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC2NE)); + /* Set the Output N State */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); + + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS2)); + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS2N)); + + /* Set the Output Idle state */ + tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); + /* Set the Output N Idle state */ + tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 2); + } + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR2 = TIM_OCInitStruct->TIM_Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Initializes the TIMx Channel3 according to the specified + * parameters in the TIM_OCInitStruct. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) +{ + uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); + assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= (uint16_t)(~((uint16_t)TIM_CCER_CC3E)); + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR2 register value */ + tmpccmrx = TIMx->CCMR2; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR2_OC3M)); + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR2_CC3S)); + /* Select the Output Compare Mode */ + tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; + + /* Reset the Output Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC3P)); + /* Set the Output Compare Polarity */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); + + /* Set the Output State */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); + + if((TIMx == TIM1) || (TIMx == TIM8)) + { + assert_param(IS_TIM_OUTPUTN_STATE(TIM_OCInitStruct->TIM_OutputNState)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); + assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); + + /* Reset the Output N Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC3NP)); + /* Set the Output N Polarity */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); + /* Reset the Output N State */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC3NE)); + + /* Set the Output N State */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS3)); + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS3N)); + /* Set the Output Idle state */ + tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); + /* Set the Output N Idle state */ + tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 4); + } + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR3 = TIM_OCInitStruct->TIM_Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Initializes the TIMx Channel4 according to the specified + * parameters in the TIM_OCInitStruct. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) +{ + uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); + assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); + /* Disable the Channel 2: Reset the CC4E Bit */ + TIMx->CCER &= (uint16_t)(~((uint16_t)TIM_CCER_CC4E)); + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR2 register value */ + tmpccmrx = TIMx->CCMR2; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR2_OC4M)); + tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR2_CC4S)); + + /* Select the Output Compare Mode */ + tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); + + /* Reset the Output Polarity level */ + tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC4P)); + /* Set the Output Compare Polarity */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); + + /* Set the Output State */ + tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); + + if((TIMx == TIM1) || (TIMx == TIM8)) + { + assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); + /* Reset the Output Compare IDLE State */ + tmpcr2 &= (uint16_t)(~((uint16_t)TIM_CR2_OIS4)); + /* Set the Output Idle state */ + tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 6); + } + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR4 = TIM_OCInitStruct->TIM_Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Initializes the TIM peripheral according to the specified + * parameters in the TIM_ICInitStruct. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct) +{ + /* Check the parameters */ + assert_param(IS_TIM_CHANNEL(TIM_ICInitStruct->TIM_Channel)); + assert_param(IS_TIM_IC_SELECTION(TIM_ICInitStruct->TIM_ICSelection)); + assert_param(IS_TIM_IC_PRESCALER(TIM_ICInitStruct->TIM_ICPrescaler)); + assert_param(IS_TIM_IC_FILTER(TIM_ICInitStruct->TIM_ICFilter)); + + if((TIMx == TIM1) || (TIMx == TIM8) || (TIMx == TIM2) || (TIMx == TIM3) || + (TIMx == TIM4) ||(TIMx == TIM5)) + { + assert_param(IS_TIM_IC_POLARITY(TIM_ICInitStruct->TIM_ICPolarity)); + } + else + { + assert_param(IS_TIM_IC_POLARITY_LITE(TIM_ICInitStruct->TIM_ICPolarity)); + } + if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_1) + { + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + /* TI1 Configuration */ + TI1_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, + TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } + else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_2) + { + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + /* TI2 Configuration */ + TI2_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, + TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } + else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_3) + { + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* TI3 Configuration */ + TI3_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, + TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC3Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } + else + { + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* TI4 Configuration */ + TI4_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, + TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC4Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } +} + +/** + * @brief Configures the TIM peripheral according to the specified + * parameters in the TIM_ICInitStruct to measure an external PWM signal. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure + * that contains the configuration information for the specified TIM peripheral. + * @retval None + */ +void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct) +{ + uint16_t icoppositepolarity = TIM_ICPolarity_Rising; + uint16_t icoppositeselection = TIM_ICSelection_DirectTI; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + /* Select the Opposite Input Polarity */ + if (TIM_ICInitStruct->TIM_ICPolarity == TIM_ICPolarity_Rising) + { + icoppositepolarity = TIM_ICPolarity_Falling; + } + else + { + icoppositepolarity = TIM_ICPolarity_Rising; + } + /* Select the Opposite Input */ + if (TIM_ICInitStruct->TIM_ICSelection == TIM_ICSelection_DirectTI) + { + icoppositeselection = TIM_ICSelection_IndirectTI; + } + else + { + icoppositeselection = TIM_ICSelection_DirectTI; + } + if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_1) + { + /* TI1 Configuration */ + TI1_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + /* TI2 Configuration */ + TI2_Config(TIMx, icoppositepolarity, icoppositeselection, TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } + else + { + /* TI2 Configuration */ + TI2_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, TIM_ICInitStruct->TIM_ICSelection, + TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + /* TI1 Configuration */ + TI1_Config(TIMx, icoppositepolarity, icoppositeselection, TIM_ICInitStruct->TIM_ICFilter); + /* Set the Input Capture Prescaler value */ + TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler); + } +} + +/** + * @brief Configures the: Break feature, dead time, Lock level, the OSSI, + * the OSSR State and the AOE(automatic output enable). + * @param TIMx: where x can be 1 or 8 to select the TIM + * @param TIM_BDTRInitStruct: pointer to a TIM_BDTRInitTypeDef structure that + * contains the BDTR Register configuration information for the TIM peripheral. + * @retval None + */ +void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST2_PERIPH(TIMx)); + assert_param(IS_TIM_OSSR_STATE(TIM_BDTRInitStruct->TIM_OSSRState)); + assert_param(IS_TIM_OSSI_STATE(TIM_BDTRInitStruct->TIM_OSSIState)); + assert_param(IS_TIM_LOCK_LEVEL(TIM_BDTRInitStruct->TIM_LOCKLevel)); + assert_param(IS_TIM_BREAK_STATE(TIM_BDTRInitStruct->TIM_Break)); + assert_param(IS_TIM_BREAK_POLARITY(TIM_BDTRInitStruct->TIM_BreakPolarity)); + assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(TIM_BDTRInitStruct->TIM_AutomaticOutput)); + /* Set the Lock level, the Break enable Bit and the Ploarity, the OSSR State, + the OSSI State, the dead time value and the Automatic Output Enable Bit */ + TIMx->BDTR = (uint32_t)TIM_BDTRInitStruct->TIM_OSSRState | TIM_BDTRInitStruct->TIM_OSSIState | + TIM_BDTRInitStruct->TIM_LOCKLevel | TIM_BDTRInitStruct->TIM_DeadTime | + TIM_BDTRInitStruct->TIM_Break | TIM_BDTRInitStruct->TIM_BreakPolarity | + TIM_BDTRInitStruct->TIM_AutomaticOutput; +} + +/** + * @brief Fills each TIM_TimeBaseInitStruct member with its default value. + * @param TIM_TimeBaseInitStruct : pointer to a TIM_TimeBaseInitTypeDef + * structure which will be initialized. + * @retval None + */ +void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) +{ + /* Set the default configuration */ + TIM_TimeBaseInitStruct->TIM_Period = 0xFFFF; + TIM_TimeBaseInitStruct->TIM_Prescaler = 0x0000; + TIM_TimeBaseInitStruct->TIM_ClockDivision = TIM_CKD_DIV1; + TIM_TimeBaseInitStruct->TIM_CounterMode = TIM_CounterMode_Up; + TIM_TimeBaseInitStruct->TIM_RepetitionCounter = 0x0000; +} + +/** + * @brief Fills each TIM_OCInitStruct member with its default value. + * @param TIM_OCInitStruct : pointer to a TIM_OCInitTypeDef structure which will + * be initialized. + * @retval None + */ +void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct) +{ + /* Set the default configuration */ + TIM_OCInitStruct->TIM_OCMode = TIM_OCMode_Timing; + TIM_OCInitStruct->TIM_OutputState = TIM_OutputState_Disable; + TIM_OCInitStruct->TIM_OutputNState = TIM_OutputNState_Disable; + TIM_OCInitStruct->TIM_Pulse = 0x0000; + TIM_OCInitStruct->TIM_OCPolarity = TIM_OCPolarity_High; + TIM_OCInitStruct->TIM_OCNPolarity = TIM_OCPolarity_High; + TIM_OCInitStruct->TIM_OCIdleState = TIM_OCIdleState_Reset; + TIM_OCInitStruct->TIM_OCNIdleState = TIM_OCNIdleState_Reset; +} + +/** + * @brief Fills each TIM_ICInitStruct member with its default value. + * @param TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure which will + * be initialized. + * @retval None + */ +void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct) +{ + /* Set the default configuration */ + TIM_ICInitStruct->TIM_Channel = TIM_Channel_1; + TIM_ICInitStruct->TIM_ICPolarity = TIM_ICPolarity_Rising; + TIM_ICInitStruct->TIM_ICSelection = TIM_ICSelection_DirectTI; + TIM_ICInitStruct->TIM_ICPrescaler = TIM_ICPSC_DIV1; + TIM_ICInitStruct->TIM_ICFilter = 0x00; +} + +/** + * @brief Fills each TIM_BDTRInitStruct member with its default value. + * @param TIM_BDTRInitStruct: pointer to a TIM_BDTRInitTypeDef structure which + * will be initialized. + * @retval None + */ +void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct) +{ + /* Set the default configuration */ + TIM_BDTRInitStruct->TIM_OSSRState = TIM_OSSRState_Disable; + TIM_BDTRInitStruct->TIM_OSSIState = TIM_OSSIState_Disable; + TIM_BDTRInitStruct->TIM_LOCKLevel = TIM_LOCKLevel_OFF; + TIM_BDTRInitStruct->TIM_DeadTime = 0x00; + TIM_BDTRInitStruct->TIM_Break = TIM_Break_Disable; + TIM_BDTRInitStruct->TIM_BreakPolarity = TIM_BreakPolarity_Low; + TIM_BDTRInitStruct->TIM_AutomaticOutput = TIM_AutomaticOutput_Disable; +} + +/** + * @brief Enables or disables the specified TIM peripheral. + * @param TIMx: where x can be 1 to 17 to select the TIMx peripheral. + * @param NewState: new state of the TIMx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the TIM Counter */ + TIMx->CR1 |= TIM_CR1_CEN; + } + else + { + /* Disable the TIM Counter */ + TIMx->CR1 &= (uint16_t)(~((uint16_t)TIM_CR1_CEN)); + } +} + +/** + * @brief Enables or disables the TIM peripheral Main Outputs. + * @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIMx peripheral. + * @param NewState: new state of the TIM peripheral Main Outputs. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST2_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the TIM Main Output */ + TIMx->BDTR |= TIM_BDTR_MOE; + } + else + { + /* Disable the TIM Main Output */ + TIMx->BDTR &= (uint16_t)(~((uint16_t)TIM_BDTR_MOE)); + } +} + +/** + * @brief Enables or disables the specified TIM interrupts. + * @param TIMx: where x can be 1 to 17 to select the TIMx peripheral. + * @param TIM_IT: specifies the TIM interrupts sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg TIM_IT_Update: TIM update Interrupt source + * @arg TIM_IT_CC1: TIM Capture Compare 1 Interrupt source + * @arg TIM_IT_CC2: TIM Capture Compare 2 Interrupt source + * @arg TIM_IT_CC3: TIM Capture Compare 3 Interrupt source + * @arg TIM_IT_CC4: TIM Capture Compare 4 Interrupt source + * @arg TIM_IT_COM: TIM Commutation Interrupt source + * @arg TIM_IT_Trigger: TIM Trigger Interrupt source + * @arg TIM_IT_Break: TIM Break Interrupt source + * @note + * - TIM6 and TIM7 can only generate an update interrupt. + * - TIM9, TIM12 and TIM15 can have only TIM_IT_Update, TIM_IT_CC1, + * TIM_IT_CC2 or TIM_IT_Trigger. + * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1. + * - TIM_IT_Break is used only with TIM1, TIM8 and TIM15. + * - TIM_IT_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. + * @param NewState: new state of the TIM interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_ITConfig(TIM_TypeDef* TIMx, uint16_t TIM_IT, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_IT(TIM_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the Interrupt sources */ + TIMx->DIER |= TIM_IT; + } + else + { + /* Disable the Interrupt sources */ + TIMx->DIER &= (uint16_t)~TIM_IT; + } +} + +/** + * @brief Configures the TIMx event to be generate by software. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_EventSource: specifies the event source. + * This parameter can be one or more of the following values: + * @arg TIM_EventSource_Update: Timer update Event source + * @arg TIM_EventSource_CC1: Timer Capture Compare 1 Event source + * @arg TIM_EventSource_CC2: Timer Capture Compare 2 Event source + * @arg TIM_EventSource_CC3: Timer Capture Compare 3 Event source + * @arg TIM_EventSource_CC4: Timer Capture Compare 4 Event source + * @arg TIM_EventSource_COM: Timer COM event source + * @arg TIM_EventSource_Trigger: Timer Trigger Event source + * @arg TIM_EventSource_Break: Timer Break event source + * @note + * - TIM6 and TIM7 can only generate an update event. + * - TIM_EventSource_COM and TIM_EventSource_Break are used only with TIM1 and TIM8. + * @retval None + */ +void TIM_GenerateEvent(TIM_TypeDef* TIMx, uint16_t TIM_EventSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_EVENT_SOURCE(TIM_EventSource)); + + /* Set the event sources */ + TIMx->EGR = TIM_EventSource; +} + +/** + * @brief Configures the TIMx's DMA interface. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 15, 16 or 17 to select + * the TIM peripheral. + * @param TIM_DMABase: DMA Base address. + * This parameter can be one of the following values: + * @arg TIM_DMABase_CR, TIM_DMABase_CR2, TIM_DMABase_SMCR, + * TIM_DMABase_DIER, TIM1_DMABase_SR, TIM_DMABase_EGR, + * TIM_DMABase_CCMR1, TIM_DMABase_CCMR2, TIM_DMABase_CCER, + * TIM_DMABase_CNT, TIM_DMABase_PSC, TIM_DMABase_ARR, + * TIM_DMABase_RCR, TIM_DMABase_CCR1, TIM_DMABase_CCR2, + * TIM_DMABase_CCR3, TIM_DMABase_CCR4, TIM_DMABase_BDTR, + * TIM_DMABase_DCR. + * @param TIM_DMABurstLength: DMA Burst length. + * This parameter can be one value between: + * TIM_DMABurstLength_1Transfer and TIM_DMABurstLength_18Transfers. + * @retval None + */ +void TIM_DMAConfig(TIM_TypeDef* TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST4_PERIPH(TIMx)); + assert_param(IS_TIM_DMA_BASE(TIM_DMABase)); + assert_param(IS_TIM_DMA_LENGTH(TIM_DMABurstLength)); + /* Set the DMA Base and the DMA Burst Length */ + TIMx->DCR = TIM_DMABase | TIM_DMABurstLength; +} + +/** + * @brief Enables or disables the TIMx's DMA Requests. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 6, 7, 8, 15, 16 or 17 + * to select the TIM peripheral. + * @param TIM_DMASource: specifies the DMA Request sources. + * This parameter can be any combination of the following values: + * @arg TIM_DMA_Update: TIM update Interrupt source + * @arg TIM_DMA_CC1: TIM Capture Compare 1 DMA source + * @arg TIM_DMA_CC2: TIM Capture Compare 2 DMA source + * @arg TIM_DMA_CC3: TIM Capture Compare 3 DMA source + * @arg TIM_DMA_CC4: TIM Capture Compare 4 DMA source + * @arg TIM_DMA_COM: TIM Commutation DMA source + * @arg TIM_DMA_Trigger: TIM Trigger DMA source + * @param NewState: new state of the DMA Request sources. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_DMACmd(TIM_TypeDef* TIMx, uint16_t TIM_DMASource, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST9_PERIPH(TIMx)); + assert_param(IS_TIM_DMA_SOURCE(TIM_DMASource)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the DMA sources */ + TIMx->DIER |= TIM_DMASource; + } + else + { + /* Disable the DMA sources */ + TIMx->DIER &= (uint16_t)~TIM_DMASource; + } +} + +/** + * @brief Configures the TIMx internal Clock + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 + * to select the TIM peripheral. + * @retval None + */ +void TIM_InternalClockConfig(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + /* Disable slave mode to clock the prescaler directly with the internal clock */ + TIMx->SMCR &= (uint16_t)(~((uint16_t)TIM_SMCR_SMS)); +} + +/** + * @brief Configures the TIMx Internal Trigger as External Clock + * @param TIMx: where x can be 1, 2, 3, 4, 5, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_ITRSource: Trigger source. + * This parameter can be one of the following values: + * @param TIM_TS_ITR0: Internal Trigger 0 + * @param TIM_TS_ITR1: Internal Trigger 1 + * @param TIM_TS_ITR2: Internal Trigger 2 + * @param TIM_TS_ITR3: Internal Trigger 3 + * @retval None + */ +void TIM_ITRxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_INTERNAL_TRIGGER_SELECTION(TIM_InputTriggerSource)); + /* Select the Internal Trigger */ + TIM_SelectInputTrigger(TIMx, TIM_InputTriggerSource); + /* Select the External clock mode1 */ + TIMx->SMCR |= TIM_SlaveMode_External1; +} + +/** + * @brief Configures the TIMx Trigger as External Clock + * @param TIMx: where x can be 1, 2, 3, 4, 5, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_TIxExternalCLKSource: Trigger source. + * This parameter can be one of the following values: + * @arg TIM_TIxExternalCLK1Source_TI1ED: TI1 Edge Detector + * @arg TIM_TIxExternalCLK1Source_TI1: Filtered Timer Input 1 + * @arg TIM_TIxExternalCLK1Source_TI2: Filtered Timer Input 2 + * @param TIM_ICPolarity: specifies the TIx Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @param ICFilter : specifies the filter value. + * This parameter must be a value between 0x0 and 0xF. + * @retval None + */ +void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource, + uint16_t TIM_ICPolarity, uint16_t ICFilter) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_TIXCLK_SOURCE(TIM_TIxExternalCLKSource)); + assert_param(IS_TIM_IC_POLARITY(TIM_ICPolarity)); + assert_param(IS_TIM_IC_FILTER(ICFilter)); + /* Configure the Timer Input Clock Source */ + if (TIM_TIxExternalCLKSource == TIM_TIxExternalCLK1Source_TI2) + { + TI2_Config(TIMx, TIM_ICPolarity, TIM_ICSelection_DirectTI, ICFilter); + } + else + { + TI1_Config(TIMx, TIM_ICPolarity, TIM_ICSelection_DirectTI, ICFilter); + } + /* Select the Trigger source */ + TIM_SelectInputTrigger(TIMx, TIM_TIxExternalCLKSource); + /* Select the External clock mode1 */ + TIMx->SMCR |= TIM_SlaveMode_External1; +} + +/** + * @brief Configures the External clock Mode1 + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ExtTRGPrescaler: The external Trigger Prescaler. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. + * @arg TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. + * @arg TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. + * @arg TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8. + * @param TIM_ExtTRGPolarity: The external Trigger Polarity. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPolarity_Inverted: active low or falling edge active. + * @arg TIM_ExtTRGPolarity_NonInverted: active high or rising edge active. + * @param ExtTRGFilter: External Trigger Filter. + * This parameter must be a value between 0x00 and 0x0F + * @retval None + */ +void TIM_ETRClockMode1Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, + uint16_t ExtTRGFilter) +{ + uint16_t tmpsmcr = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler)); + assert_param(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity)); + assert_param(IS_TIM_EXT_FILTER(ExtTRGFilter)); + /* Configure the ETR Clock source */ + TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter); + + /* Get the TIMx SMCR register value */ + tmpsmcr = TIMx->SMCR; + /* Reset the SMS Bits */ + tmpsmcr &= (uint16_t)(~((uint16_t)TIM_SMCR_SMS)); + /* Select the External clock mode1 */ + tmpsmcr |= TIM_SlaveMode_External1; + /* Select the Trigger selection : ETRF */ + tmpsmcr &= (uint16_t)(~((uint16_t)TIM_SMCR_TS)); + tmpsmcr |= TIM_TS_ETRF; + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; +} + +/** + * @brief Configures the External clock Mode2 + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ExtTRGPrescaler: The external Trigger Prescaler. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. + * @arg TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. + * @arg TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. + * @arg TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8. + * @param TIM_ExtTRGPolarity: The external Trigger Polarity. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPolarity_Inverted: active low or falling edge active. + * @arg TIM_ExtTRGPolarity_NonInverted: active high or rising edge active. + * @param ExtTRGFilter: External Trigger Filter. + * This parameter must be a value between 0x00 and 0x0F + * @retval None + */ +void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, + uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler)); + assert_param(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity)); + assert_param(IS_TIM_EXT_FILTER(ExtTRGFilter)); + /* Configure the ETR Clock source */ + TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter); + /* Enable the External clock mode2 */ + TIMx->SMCR |= TIM_SMCR_ECE; +} + +/** + * @brief Configures the TIMx External Trigger (ETR). + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ExtTRGPrescaler: The external Trigger Prescaler. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. + * @arg TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. + * @arg TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. + * @arg TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8. + * @param TIM_ExtTRGPolarity: The external Trigger Polarity. + * This parameter can be one of the following values: + * @arg TIM_ExtTRGPolarity_Inverted: active low or falling edge active. + * @arg TIM_ExtTRGPolarity_NonInverted: active high or rising edge active. + * @param ExtTRGFilter: External Trigger Filter. + * This parameter must be a value between 0x00 and 0x0F + * @retval None + */ +void TIM_ETRConfig(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, + uint16_t ExtTRGFilter) +{ + uint16_t tmpsmcr = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler)); + assert_param(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity)); + assert_param(IS_TIM_EXT_FILTER(ExtTRGFilter)); + tmpsmcr = TIMx->SMCR; + /* Reset the ETR Bits */ + tmpsmcr &= SMCR_ETR_Mask; + /* Set the Prescaler, the Filter value and the Polarity */ + tmpsmcr |= (uint16_t)(TIM_ExtTRGPrescaler | (uint16_t)(TIM_ExtTRGPolarity | (uint16_t)(ExtTRGFilter << (uint16_t)8))); + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; +} + +/** + * @brief Configures the TIMx Prescaler. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param Prescaler: specifies the Prescaler Register value + * @param TIM_PSCReloadMode: specifies the TIM Prescaler Reload mode + * This parameter can be one of the following values: + * @arg TIM_PSCReloadMode_Update: The Prescaler is loaded at the update event. + * @arg TIM_PSCReloadMode_Immediate: The Prescaler is loaded immediately. + * @retval None + */ +void TIM_PrescalerConfig(TIM_TypeDef* TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_PRESCALER_RELOAD(TIM_PSCReloadMode)); + /* Set the Prescaler value */ + TIMx->PSC = Prescaler; + /* Set or reset the UG Bit */ + TIMx->EGR = TIM_PSCReloadMode; +} + +/** + * @brief Specifies the TIMx Counter Mode to be used. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_CounterMode: specifies the Counter Mode to be used + * This parameter can be one of the following values: + * @arg TIM_CounterMode_Up: TIM Up Counting Mode + * @arg TIM_CounterMode_Down: TIM Down Counting Mode + * @arg TIM_CounterMode_CenterAligned1: TIM Center Aligned Mode1 + * @arg TIM_CounterMode_CenterAligned2: TIM Center Aligned Mode2 + * @arg TIM_CounterMode_CenterAligned3: TIM Center Aligned Mode3 + * @retval None + */ +void TIM_CounterModeConfig(TIM_TypeDef* TIMx, uint16_t TIM_CounterMode) +{ + uint16_t tmpcr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_COUNTER_MODE(TIM_CounterMode)); + tmpcr1 = TIMx->CR1; + /* Reset the CMS and DIR Bits */ + tmpcr1 &= (uint16_t)(~((uint16_t)(TIM_CR1_DIR | TIM_CR1_CMS))); + /* Set the Counter Mode */ + tmpcr1 |= TIM_CounterMode; + /* Write to TIMx CR1 register */ + TIMx->CR1 = tmpcr1; +} + +/** + * @brief Selects the Input Trigger source + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_InputTriggerSource: The Input Trigger source. + * This parameter can be one of the following values: + * @arg TIM_TS_ITR0: Internal Trigger 0 + * @arg TIM_TS_ITR1: Internal Trigger 1 + * @arg TIM_TS_ITR2: Internal Trigger 2 + * @arg TIM_TS_ITR3: Internal Trigger 3 + * @arg TIM_TS_TI1F_ED: TI1 Edge Detector + * @arg TIM_TS_TI1FP1: Filtered Timer Input 1 + * @arg TIM_TS_TI2FP2: Filtered Timer Input 2 + * @arg TIM_TS_ETRF: External Trigger input + * @retval None + */ +void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource) +{ + uint16_t tmpsmcr = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_TRIGGER_SELECTION(TIM_InputTriggerSource)); + /* Get the TIMx SMCR register value */ + tmpsmcr = TIMx->SMCR; + /* Reset the TS Bits */ + tmpsmcr &= (uint16_t)(~((uint16_t)TIM_SMCR_TS)); + /* Set the Input Trigger source */ + tmpsmcr |= TIM_InputTriggerSource; + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; +} + +/** + * @brief Configures the TIMx Encoder Interface. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_EncoderMode: specifies the TIMx Encoder Mode. + * This parameter can be one of the following values: + * @arg TIM_EncoderMode_TI1: Counter counts on TI1FP1 edge depending on TI2FP2 level. + * @arg TIM_EncoderMode_TI2: Counter counts on TI2FP2 edge depending on TI1FP1 level. + * @arg TIM_EncoderMode_TI12: Counter counts on both TI1FP1 and TI2FP2 edges depending + * on the level of the other input. + * @param TIM_IC1Polarity: specifies the IC1 Polarity + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Falling: IC Falling edge. + * @arg TIM_ICPolarity_Rising: IC Rising edge. + * @param TIM_IC2Polarity: specifies the IC2 Polarity + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Falling: IC Falling edge. + * @arg TIM_ICPolarity_Rising: IC Rising edge. + * @retval None + */ +void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, uint16_t TIM_EncoderMode, + uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity) +{ + uint16_t tmpsmcr = 0; + uint16_t tmpccmr1 = 0; + uint16_t tmpccer = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST5_PERIPH(TIMx)); + assert_param(IS_TIM_ENCODER_MODE(TIM_EncoderMode)); + assert_param(IS_TIM_IC_POLARITY(TIM_IC1Polarity)); + assert_param(IS_TIM_IC_POLARITY(TIM_IC2Polarity)); + + /* Get the TIMx SMCR register value */ + tmpsmcr = TIMx->SMCR; + + /* Get the TIMx CCMR1 register value */ + tmpccmr1 = TIMx->CCMR1; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + + /* Set the encoder Mode */ + tmpsmcr &= (uint16_t)(~((uint16_t)TIM_SMCR_SMS)); + tmpsmcr |= TIM_EncoderMode; + + /* Select the Capture Compare 1 and the Capture Compare 2 as input */ + tmpccmr1 &= (uint16_t)(((uint16_t)~((uint16_t)TIM_CCMR1_CC1S)) & (uint16_t)(~((uint16_t)TIM_CCMR1_CC2S))); + tmpccmr1 |= TIM_CCMR1_CC1S_0 | TIM_CCMR1_CC2S_0; + + /* Set the TI1 and the TI2 Polarities */ + tmpccer &= (uint16_t)(((uint16_t)~((uint16_t)TIM_CCER_CC1P)) & ((uint16_t)~((uint16_t)TIM_CCER_CC2P))); + tmpccer |= (uint16_t)(TIM_IC1Polarity | (uint16_t)(TIM_IC2Polarity << (uint16_t)4)); + + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmr1; + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Forces the TIMx output 1 waveform to active or inactive level. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_ForcedAction: specifies the forced Action to be set to the output waveform. + * This parameter can be one of the following values: + * @arg TIM_ForcedAction_Active: Force active level on OC1REF + * @arg TIM_ForcedAction_InActive: Force inactive level on OC1REF. + * @retval None + */ +void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_FORCED_ACTION(TIM_ForcedAction)); + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC1M Bits */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC1M); + /* Configure The Forced output Mode */ + tmpccmr1 |= TIM_ForcedAction; + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Forces the TIMx output 2 waveform to active or inactive level. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_ForcedAction: specifies the forced Action to be set to the output waveform. + * This parameter can be one of the following values: + * @arg TIM_ForcedAction_Active: Force active level on OC2REF + * @arg TIM_ForcedAction_InActive: Force inactive level on OC2REF. + * @retval None + */ +void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_FORCED_ACTION(TIM_ForcedAction)); + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC2M Bits */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC2M); + /* Configure The Forced output Mode */ + tmpccmr1 |= (uint16_t)(TIM_ForcedAction << 8); + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Forces the TIMx output 3 waveform to active or inactive level. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ForcedAction: specifies the forced Action to be set to the output waveform. + * This parameter can be one of the following values: + * @arg TIM_ForcedAction_Active: Force active level on OC3REF + * @arg TIM_ForcedAction_InActive: Force inactive level on OC3REF. + * @retval None + */ +void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_FORCED_ACTION(TIM_ForcedAction)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC1M Bits */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC3M); + /* Configure The Forced output Mode */ + tmpccmr2 |= TIM_ForcedAction; + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Forces the TIMx output 4 waveform to active or inactive level. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ForcedAction: specifies the forced Action to be set to the output waveform. + * This parameter can be one of the following values: + * @arg TIM_ForcedAction_Active: Force active level on OC4REF + * @arg TIM_ForcedAction_InActive: Force inactive level on OC4REF. + * @retval None + */ +void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, uint16_t TIM_ForcedAction) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_FORCED_ACTION(TIM_ForcedAction)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC2M Bits */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC4M); + /* Configure The Forced output Mode */ + tmpccmr2 |= (uint16_t)(TIM_ForcedAction << 8); + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Enables or disables TIMx peripheral Preload register on ARR. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param NewState: new state of the TIMx peripheral Preload register + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the ARR Preload Bit */ + TIMx->CR1 |= TIM_CR1_ARPE; + } + else + { + /* Reset the ARR Preload Bit */ + TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_ARPE); + } +} + +/** + * @brief Selects the TIM peripheral Commutation event. + * @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIMx peripheral + * @param NewState: new state of the Commutation event. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_SelectCOM(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST2_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the COM Bit */ + TIMx->CR2 |= TIM_CR2_CCUS; + } + else + { + /* Reset the COM Bit */ + TIMx->CR2 &= (uint16_t)~((uint16_t)TIM_CR2_CCUS); + } +} + +/** + * @brief Selects the TIMx peripheral Capture Compare DMA source. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 15, 16 or 17 to select + * the TIM peripheral. + * @param NewState: new state of the Capture Compare DMA source + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_SelectCCDMA(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST4_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the CCDS Bit */ + TIMx->CR2 |= TIM_CR2_CCDS; + } + else + { + /* Reset the CCDS Bit */ + TIMx->CR2 &= (uint16_t)~((uint16_t)TIM_CR2_CCDS); + } +} + +/** + * @brief Sets or Resets the TIM peripheral Capture Compare Preload Control bit. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8 or 15 + * to select the TIMx peripheral + * @param NewState: new state of the Capture Compare Preload Control bit + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST5_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the CCPC Bit */ + TIMx->CR2 |= TIM_CR2_CCPC; + } + else + { + /* Reset the CCPC Bit */ + TIMx->CR2 &= (uint16_t)~((uint16_t)TIM_CR2_CCPC); + } +} + +/** + * @brief Enables or disables the TIMx peripheral Preload register on CCR1. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_OCPreload: new state of the TIMx peripheral Preload register + * This parameter can be one of the following values: + * @arg TIM_OCPreload_Enable + * @arg TIM_OCPreload_Disable + * @retval None + */ +void TIM_OC1PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC1PE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC1PE); + /* Enable or Disable the Output Compare Preload feature */ + tmpccmr1 |= TIM_OCPreload; + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Enables or disables the TIMx peripheral Preload register on CCR2. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select + * the TIM peripheral. + * @param TIM_OCPreload: new state of the TIMx peripheral Preload register + * This parameter can be one of the following values: + * @arg TIM_OCPreload_Enable + * @arg TIM_OCPreload_Disable + * @retval None + */ +void TIM_OC2PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC2PE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC2PE); + /* Enable or Disable the Output Compare Preload feature */ + tmpccmr1 |= (uint16_t)(TIM_OCPreload << 8); + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Enables or disables the TIMx peripheral Preload register on CCR3. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCPreload: new state of the TIMx peripheral Preload register + * This parameter can be one of the following values: + * @arg TIM_OCPreload_Enable + * @arg TIM_OCPreload_Disable + * @retval None + */ +void TIM_OC3PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC3PE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC3PE); + /* Enable or Disable the Output Compare Preload feature */ + tmpccmr2 |= TIM_OCPreload; + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Enables or disables the TIMx peripheral Preload register on CCR4. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCPreload: new state of the TIMx peripheral Preload register + * This parameter can be one of the following values: + * @arg TIM_OCPreload_Enable + * @arg TIM_OCPreload_Disable + * @retval None + */ +void TIM_OC4PreloadConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPreload) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC4PE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC4PE); + /* Enable or Disable the Output Compare Preload feature */ + tmpccmr2 |= (uint16_t)(TIM_OCPreload << 8); + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Configures the TIMx Output Compare 1 Fast feature. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_OCFast: new state of the Output Compare Fast Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCFast_Enable: TIM output compare fast enable + * @arg TIM_OCFast_Disable: TIM output compare fast disable + * @retval None + */ +void TIM_OC1FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_OCFAST_STATE(TIM_OCFast)); + /* Get the TIMx CCMR1 register value */ + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC1FE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC1FE); + /* Enable or Disable the Output Compare Fast Bit */ + tmpccmr1 |= TIM_OCFast; + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Configures the TIMx Output Compare 2 Fast feature. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select + * the TIM peripheral. + * @param TIM_OCFast: new state of the Output Compare Fast Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCFast_Enable: TIM output compare fast enable + * @arg TIM_OCFast_Disable: TIM output compare fast disable + * @retval None + */ +void TIM_OC2FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_OCFAST_STATE(TIM_OCFast)); + /* Get the TIMx CCMR1 register value */ + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC2FE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC2FE); + /* Enable or Disable the Output Compare Fast Bit */ + tmpccmr1 |= (uint16_t)(TIM_OCFast << 8); + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Configures the TIMx Output Compare 3 Fast feature. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCFast: new state of the Output Compare Fast Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCFast_Enable: TIM output compare fast enable + * @arg TIM_OCFast_Disable: TIM output compare fast disable + * @retval None + */ +void TIM_OC3FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCFAST_STATE(TIM_OCFast)); + /* Get the TIMx CCMR2 register value */ + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC3FE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC3FE); + /* Enable or Disable the Output Compare Fast Bit */ + tmpccmr2 |= TIM_OCFast; + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Configures the TIMx Output Compare 4 Fast feature. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCFast: new state of the Output Compare Fast Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCFast_Enable: TIM output compare fast enable + * @arg TIM_OCFast_Disable: TIM output compare fast disable + * @retval None + */ +void TIM_OC4FastConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCFast) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCFAST_STATE(TIM_OCFast)); + /* Get the TIMx CCMR2 register value */ + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC4FE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC4FE); + /* Enable or Disable the Output Compare Fast Bit */ + tmpccmr2 |= (uint16_t)(TIM_OCFast << 8); + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Clears or safeguards the OCREF1 signal on an external event + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCClear: new state of the Output Compare Clear Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCClear_Enable: TIM Output clear enable + * @arg TIM_OCClear_Disable: TIM Output clear disable + * @retval None + */ +void TIM_ClearOC1Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCCLEAR_STATE(TIM_OCClear)); + + tmpccmr1 = TIMx->CCMR1; + + /* Reset the OC1CE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC1CE); + /* Enable or Disable the Output Compare Clear Bit */ + tmpccmr1 |= TIM_OCClear; + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Clears or safeguards the OCREF2 signal on an external event + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCClear: new state of the Output Compare Clear Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCClear_Enable: TIM Output clear enable + * @arg TIM_OCClear_Disable: TIM Output clear disable + * @retval None + */ +void TIM_ClearOC2Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear) +{ + uint16_t tmpccmr1 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCCLEAR_STATE(TIM_OCClear)); + tmpccmr1 = TIMx->CCMR1; + /* Reset the OC2CE Bit */ + tmpccmr1 &= (uint16_t)~((uint16_t)TIM_CCMR1_OC2CE); + /* Enable or Disable the Output Compare Clear Bit */ + tmpccmr1 |= (uint16_t)(TIM_OCClear << 8); + /* Write to TIMx CCMR1 register */ + TIMx->CCMR1 = tmpccmr1; +} + +/** + * @brief Clears or safeguards the OCREF3 signal on an external event + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCClear: new state of the Output Compare Clear Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCClear_Enable: TIM Output clear enable + * @arg TIM_OCClear_Disable: TIM Output clear disable + * @retval None + */ +void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCCLEAR_STATE(TIM_OCClear)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC3CE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC3CE); + /* Enable or Disable the Output Compare Clear Bit */ + tmpccmr2 |= TIM_OCClear; + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Clears or safeguards the OCREF4 signal on an external event + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCClear: new state of the Output Compare Clear Enable Bit. + * This parameter can be one of the following values: + * @arg TIM_OCClear_Enable: TIM Output clear enable + * @arg TIM_OCClear_Disable: TIM Output clear disable + * @retval None + */ +void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, uint16_t TIM_OCClear) +{ + uint16_t tmpccmr2 = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OCCLEAR_STATE(TIM_OCClear)); + tmpccmr2 = TIMx->CCMR2; + /* Reset the OC4CE Bit */ + tmpccmr2 &= (uint16_t)~((uint16_t)TIM_CCMR2_OC4CE); + /* Enable or Disable the Output Compare Clear Bit */ + tmpccmr2 |= (uint16_t)(TIM_OCClear << 8); + /* Write to TIMx CCMR2 register */ + TIMx->CCMR2 = tmpccmr2; +} + +/** + * @brief Configures the TIMx channel 1 polarity. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_OCPolarity: specifies the OC1 Polarity + * This parameter can be one of the following values: + * @arg TIM_OCPolarity_High: Output Compare active high + * @arg TIM_OCPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity)); + tmpccer = TIMx->CCER; + /* Set or Reset the CC1P Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC1P); + tmpccer |= TIM_OCPolarity; + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx Channel 1N polarity. + * @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIM peripheral. + * @param TIM_OCNPolarity: specifies the OC1N Polarity + * This parameter can be one of the following values: + * @arg TIM_OCNPolarity_High: Output Compare active high + * @arg TIM_OCNPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC1NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST2_PERIPH(TIMx)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCNPolarity)); + + tmpccer = TIMx->CCER; + /* Set or Reset the CC1NP Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC1NP); + tmpccer |= TIM_OCNPolarity; + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx channel 2 polarity. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_OCPolarity: specifies the OC2 Polarity + * This parameter can be one of the following values: + * @arg TIM_OCPolarity_High: Output Compare active high + * @arg TIM_OCPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity)); + tmpccer = TIMx->CCER; + /* Set or Reset the CC2P Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC2P); + tmpccer |= (uint16_t)(TIM_OCPolarity << 4); + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx Channel 2N polarity. + * @param TIMx: where x can be 1 or 8 to select the TIM peripheral. + * @param TIM_OCNPolarity: specifies the OC2N Polarity + * This parameter can be one of the following values: + * @arg TIM_OCNPolarity_High: Output Compare active high + * @arg TIM_OCNPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC2NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST1_PERIPH(TIMx)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCNPolarity)); + + tmpccer = TIMx->CCER; + /* Set or Reset the CC2NP Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC2NP); + tmpccer |= (uint16_t)(TIM_OCNPolarity << 4); + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx channel 3 polarity. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCPolarity: specifies the OC3 Polarity + * This parameter can be one of the following values: + * @arg TIM_OCPolarity_High: Output Compare active high + * @arg TIM_OCPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity)); + tmpccer = TIMx->CCER; + /* Set or Reset the CC3P Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC3P); + tmpccer |= (uint16_t)(TIM_OCPolarity << 8); + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx Channel 3N polarity. + * @param TIMx: where x can be 1 or 8 to select the TIM peripheral. + * @param TIM_OCNPolarity: specifies the OC3N Polarity + * This parameter can be one of the following values: + * @arg TIM_OCNPolarity_High: Output Compare active high + * @arg TIM_OCNPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC3NPolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCNPolarity) +{ + uint16_t tmpccer = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST1_PERIPH(TIMx)); + assert_param(IS_TIM_OCN_POLARITY(TIM_OCNPolarity)); + + tmpccer = TIMx->CCER; + /* Set or Reset the CC3NP Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC3NP); + tmpccer |= (uint16_t)(TIM_OCNPolarity << 8); + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Configures the TIMx channel 4 polarity. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_OCPolarity: specifies the OC4 Polarity + * This parameter can be one of the following values: + * @arg TIM_OCPolarity_High: Output Compare active high + * @arg TIM_OCPolarity_Low: Output Compare active low + * @retval None + */ +void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity) +{ + uint16_t tmpccer = 0; + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity)); + tmpccer = TIMx->CCER; + /* Set or Reset the CC4P Bit */ + tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC4P); + tmpccer |= (uint16_t)(TIM_OCPolarity << 12); + /* Write to TIMx CCER register */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Enables or disables the TIM Capture Compare Channel x. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_Channel: specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_Channel_1: TIM Channel 1 + * @arg TIM_Channel_2: TIM Channel 2 + * @arg TIM_Channel_3: TIM Channel 3 + * @arg TIM_Channel_4: TIM Channel 4 + * @param TIM_CCx: specifies the TIM Channel CCxE bit new state. + * This parameter can be: TIM_CCx_Enable or TIM_CCx_Disable. + * @retval None + */ +void TIM_CCxCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx) +{ + uint16_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_CHANNEL(TIM_Channel)); + assert_param(IS_TIM_CCX(TIM_CCx)); + + tmp = CCER_CCE_Set << TIM_Channel; + + /* Reset the CCxE Bit */ + TIMx->CCER &= (uint16_t)~ tmp; + + /* Set or reset the CCxE Bit */ + TIMx->CCER |= (uint16_t)(TIM_CCx << TIM_Channel); +} + +/** + * @brief Enables or disables the TIM Capture Compare Channel xN. + * @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIM peripheral. + * @param TIM_Channel: specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_Channel_1: TIM Channel 1 + * @arg TIM_Channel_2: TIM Channel 2 + * @arg TIM_Channel_3: TIM Channel 3 + * @param TIM_CCxN: specifies the TIM Channel CCxNE bit new state. + * This parameter can be: TIM_CCxN_Enable or TIM_CCxN_Disable. + * @retval None + */ +void TIM_CCxNCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN) +{ + uint16_t tmp = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST2_PERIPH(TIMx)); + assert_param(IS_TIM_COMPLEMENTARY_CHANNEL(TIM_Channel)); + assert_param(IS_TIM_CCXN(TIM_CCxN)); + + tmp = CCER_CCNE_Set << TIM_Channel; + + /* Reset the CCxNE Bit */ + TIMx->CCER &= (uint16_t) ~tmp; + + /* Set or reset the CCxNE Bit */ + TIMx->CCER |= (uint16_t)(TIM_CCxN << TIM_Channel); +} + +/** + * @brief Selects the TIM Output Compare Mode. + * @note This function disables the selected channel before changing the Output + * Compare Mode. + * User has to enable this channel using TIM_CCxCmd and TIM_CCxNCmd functions. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_Channel: specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_Channel_1: TIM Channel 1 + * @arg TIM_Channel_2: TIM Channel 2 + * @arg TIM_Channel_3: TIM Channel 3 + * @arg TIM_Channel_4: TIM Channel 4 + * @param TIM_OCMode: specifies the TIM Output Compare Mode. + * This parameter can be one of the following values: + * @arg TIM_OCMode_Timing + * @arg TIM_OCMode_Active + * @arg TIM_OCMode_Toggle + * @arg TIM_OCMode_PWM1 + * @arg TIM_OCMode_PWM2 + * @arg TIM_ForcedAction_Active + * @arg TIM_ForcedAction_InActive + * @retval None + */ +void TIM_SelectOCxM(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_OCMode) +{ + uint32_t tmp = 0; + uint16_t tmp1 = 0; + + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_CHANNEL(TIM_Channel)); + assert_param(IS_TIM_OCM(TIM_OCMode)); + + tmp = (uint32_t) TIMx; + tmp += CCMR_Offset; + + tmp1 = CCER_CCE_Set << (uint16_t)TIM_Channel; + + /* Disable the Channel: Reset the CCxE Bit */ + TIMx->CCER &= (uint16_t) ~tmp1; + + if((TIM_Channel == TIM_Channel_1) ||(TIM_Channel == TIM_Channel_3)) + { + tmp += (TIM_Channel>>1); + + /* Reset the OCxM bits in the CCMRx register */ + *(__IO uint32_t *) tmp &= (uint32_t)~((uint32_t)TIM_CCMR1_OC1M); + + /* Configure the OCxM bits in the CCMRx register */ + *(__IO uint32_t *) tmp |= TIM_OCMode; + } + else + { + tmp += (uint16_t)(TIM_Channel - (uint16_t)4)>> (uint16_t)1; + + /* Reset the OCxM bits in the CCMRx register */ + *(__IO uint32_t *) tmp &= (uint32_t)~((uint32_t)TIM_CCMR1_OC2M); + + /* Configure the OCxM bits in the CCMRx register */ + *(__IO uint32_t *) tmp |= (uint16_t)(TIM_OCMode << 8); + } +} + +/** + * @brief Enables or Disables the TIMx Update event. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param NewState: new state of the TIMx UDIS bit + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the Update Disable Bit */ + TIMx->CR1 |= TIM_CR1_UDIS; + } + else + { + /* Reset the Update Disable Bit */ + TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_UDIS); + } +} + +/** + * @brief Configures the TIMx Update Request Interrupt source. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_UpdateSource: specifies the Update source. + * This parameter can be one of the following values: + * @arg TIM_UpdateSource_Global: Source of update is the counter overflow/underflow + or the setting of UG bit, or an update generation + through the slave mode controller. + * @arg TIM_UpdateSource_Regular: Source of update is counter overflow/underflow. + * @retval None + */ +void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_UPDATE_SOURCE(TIM_UpdateSource)); + if (TIM_UpdateSource != TIM_UpdateSource_Global) + { + /* Set the URS Bit */ + TIMx->CR1 |= TIM_CR1_URS; + } + else + { + /* Reset the URS Bit */ + TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_URS); + } +} + +/** + * @brief Enables or disables the TIMx's Hall sensor interface. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param NewState: new state of the TIMx Hall sensor interface. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Set the TI1S Bit */ + TIMx->CR2 |= TIM_CR2_TI1S; + } + else + { + /* Reset the TI1S Bit */ + TIMx->CR2 &= (uint16_t)~((uint16_t)TIM_CR2_TI1S); + } +} + +/** + * @brief Selects the TIMx's One Pulse Mode. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_OPMode: specifies the OPM Mode to be used. + * This parameter can be one of the following values: + * @arg TIM_OPMode_Single + * @arg TIM_OPMode_Repetitive + * @retval None + */ +void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, uint16_t TIM_OPMode) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_OPM_MODE(TIM_OPMode)); + /* Reset the OPM Bit */ + TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_OPM); + /* Configure the OPM Mode */ + TIMx->CR1 |= TIM_OPMode; +} + +/** + * @brief Selects the TIMx Trigger Output Mode. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 6, 7, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_TRGOSource: specifies the Trigger Output source. + * This paramter can be one of the following values: + * + * - For all TIMx + * @arg TIM_TRGOSource_Reset: The UG bit in the TIM_EGR register is used as the trigger output (TRGO). + * @arg TIM_TRGOSource_Enable: The Counter Enable CEN is used as the trigger output (TRGO). + * @arg TIM_TRGOSource_Update: The update event is selected as the trigger output (TRGO). + * + * - For all TIMx except TIM6 and TIM7 + * @arg TIM_TRGOSource_OC1: The trigger output sends a positive pulse when the CC1IF flag + * is to be set, as soon as a capture or compare match occurs (TRGO). + * @arg TIM_TRGOSource_OC1Ref: OC1REF signal is used as the trigger output (TRGO). + * @arg TIM_TRGOSource_OC2Ref: OC2REF signal is used as the trigger output (TRGO). + * @arg TIM_TRGOSource_OC3Ref: OC3REF signal is used as the trigger output (TRGO). + * @arg TIM_TRGOSource_OC4Ref: OC4REF signal is used as the trigger output (TRGO). + * + * @retval None + */ +void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST7_PERIPH(TIMx)); + assert_param(IS_TIM_TRGO_SOURCE(TIM_TRGOSource)); + /* Reset the MMS Bits */ + TIMx->CR2 &= (uint16_t)~((uint16_t)TIM_CR2_MMS); + /* Select the TRGO source */ + TIMx->CR2 |= TIM_TRGOSource; +} + +/** + * @brief Selects the TIMx Slave Mode. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_SlaveMode: specifies the Timer Slave Mode. + * This parameter can be one of the following values: + * @arg TIM_SlaveMode_Reset: Rising edge of the selected trigger signal (TRGI) re-initializes + * the counter and triggers an update of the registers. + * @arg TIM_SlaveMode_Gated: The counter clock is enabled when the trigger signal (TRGI) is high. + * @arg TIM_SlaveMode_Trigger: The counter starts at a rising edge of the trigger TRGI. + * @arg TIM_SlaveMode_External1: Rising edges of the selected trigger (TRGI) clock the counter. + * @retval None + */ +void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_SLAVE_MODE(TIM_SlaveMode)); + /* Reset the SMS Bits */ + TIMx->SMCR &= (uint16_t)~((uint16_t)TIM_SMCR_SMS); + /* Select the Slave Mode */ + TIMx->SMCR |= TIM_SlaveMode; +} + +/** + * @brief Sets or Resets the TIMx Master/Slave Mode. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_MasterSlaveMode: specifies the Timer Master Slave Mode. + * This parameter can be one of the following values: + * @arg TIM_MasterSlaveMode_Enable: synchronization between the current timer + * and its slaves (through TRGO). + * @arg TIM_MasterSlaveMode_Disable: No action + * @retval None + */ +void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_MasterSlaveMode) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_MSM_STATE(TIM_MasterSlaveMode)); + /* Reset the MSM Bit */ + TIMx->SMCR &= (uint16_t)~((uint16_t)TIM_SMCR_MSM); + + /* Set or Reset the MSM Bit */ + TIMx->SMCR |= TIM_MasterSlaveMode; +} + +/** + * @brief Sets the TIMx Counter Register value + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param Counter: specifies the Counter register new value. + * @retval None + */ +void TIM_SetCounter(TIM_TypeDef* TIMx, uint16_t Counter) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + /* Set the Counter Register value */ + TIMx->CNT = Counter; +} + +/** + * @brief Sets the TIMx Autoreload Register value + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param Autoreload: specifies the Autoreload register new value. + * @retval None + */ +void TIM_SetAutoreload(TIM_TypeDef* TIMx, uint16_t Autoreload) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + /* Set the Autoreload Register value */ + TIMx->ARR = Autoreload; +} + +/** + * @brief Sets the TIMx Capture Compare1 Register value + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param Compare1: specifies the Capture Compare1 register new value. + * @retval None + */ +void TIM_SetCompare1(TIM_TypeDef* TIMx, uint16_t Compare1) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + /* Set the Capture Compare1 Register value */ + TIMx->CCR1 = Compare1; +} + +/** + * @brief Sets the TIMx Capture Compare2 Register value + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param Compare2: specifies the Capture Compare2 register new value. + * @retval None + */ +void TIM_SetCompare2(TIM_TypeDef* TIMx, uint16_t Compare2) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + /* Set the Capture Compare2 Register value */ + TIMx->CCR2 = Compare2; +} + +/** + * @brief Sets the TIMx Capture Compare3 Register value + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param Compare3: specifies the Capture Compare3 register new value. + * @retval None + */ +void TIM_SetCompare3(TIM_TypeDef* TIMx, uint16_t Compare3) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* Set the Capture Compare3 Register value */ + TIMx->CCR3 = Compare3; +} + +/** + * @brief Sets the TIMx Capture Compare4 Register value + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param Compare4: specifies the Capture Compare4 register new value. + * @retval None + */ +void TIM_SetCompare4(TIM_TypeDef* TIMx, uint16_t Compare4) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* Set the Capture Compare4 Register value */ + TIMx->CCR4 = Compare4; +} + +/** + * @brief Sets the TIMx Input Capture 1 prescaler. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_ICPSC: specifies the Input Capture1 prescaler new value. + * This parameter can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + * @retval None + */ +void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_IC_PRESCALER(TIM_ICPSC)); + /* Reset the IC1PSC Bits */ + TIMx->CCMR1 &= (uint16_t)~((uint16_t)TIM_CCMR1_IC1PSC); + /* Set the IC1PSC value */ + TIMx->CCMR1 |= TIM_ICPSC; +} + +/** + * @brief Sets the TIMx Input Capture 2 prescaler. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_ICPSC: specifies the Input Capture2 prescaler new value. + * This parameter can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + * @retval None + */ +void TIM_SetIC2Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + assert_param(IS_TIM_IC_PRESCALER(TIM_ICPSC)); + /* Reset the IC2PSC Bits */ + TIMx->CCMR1 &= (uint16_t)~((uint16_t)TIM_CCMR1_IC2PSC); + /* Set the IC2PSC value */ + TIMx->CCMR1 |= (uint16_t)(TIM_ICPSC << 8); +} + +/** + * @brief Sets the TIMx Input Capture 3 prescaler. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ICPSC: specifies the Input Capture3 prescaler new value. + * This parameter can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + * @retval None + */ +void TIM_SetIC3Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_IC_PRESCALER(TIM_ICPSC)); + /* Reset the IC3PSC Bits */ + TIMx->CCMR2 &= (uint16_t)~((uint16_t)TIM_CCMR2_IC3PSC); + /* Set the IC3PSC value */ + TIMx->CCMR2 |= TIM_ICPSC; +} + +/** + * @brief Sets the TIMx Input Capture 4 prescaler. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ICPSC: specifies the Input Capture4 prescaler new value. + * This parameter can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + * @retval None + */ +void TIM_SetIC4Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + assert_param(IS_TIM_IC_PRESCALER(TIM_ICPSC)); + /* Reset the IC4PSC Bits */ + TIMx->CCMR2 &= (uint16_t)~((uint16_t)TIM_CCMR2_IC4PSC); + /* Set the IC4PSC value */ + TIMx->CCMR2 |= (uint16_t)(TIM_ICPSC << 8); +} + +/** + * @brief Sets the TIMx Clock Division value. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select + * the TIM peripheral. + * @param TIM_CKD: specifies the clock division value. + * This parameter can be one of the following value: + * @arg TIM_CKD_DIV1: TDTS = Tck_tim + * @arg TIM_CKD_DIV2: TDTS = 2*Tck_tim + * @arg TIM_CKD_DIV4: TDTS = 4*Tck_tim + * @retval None + */ +void TIM_SetClockDivision(TIM_TypeDef* TIMx, uint16_t TIM_CKD) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + assert_param(IS_TIM_CKD_DIV(TIM_CKD)); + /* Reset the CKD Bits */ + TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_CKD); + /* Set the CKD value */ + TIMx->CR1 |= TIM_CKD; +} + +/** + * @brief Gets the TIMx Input Capture 1 value. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @retval Capture Compare 1 Register value. + */ +uint16_t TIM_GetCapture1(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST8_PERIPH(TIMx)); + /* Get the Capture 1 Register value */ + return TIMx->CCR1; +} + +/** + * @brief Gets the TIMx Input Capture 2 value. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @retval Capture Compare 2 Register value. + */ +uint16_t TIM_GetCapture2(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST6_PERIPH(TIMx)); + /* Get the Capture 2 Register value */ + return TIMx->CCR2; +} + +/** + * @brief Gets the TIMx Input Capture 3 value. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @retval Capture Compare 3 Register value. + */ +uint16_t TIM_GetCapture3(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* Get the Capture 3 Register value */ + return TIMx->CCR3; +} + +/** + * @brief Gets the TIMx Input Capture 4 value. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @retval Capture Compare 4 Register value. + */ +uint16_t TIM_GetCapture4(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_LIST3_PERIPH(TIMx)); + /* Get the Capture 4 Register value */ + return TIMx->CCR4; +} + +/** + * @brief Gets the TIMx Counter value. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @retval Counter Register value. + */ +uint16_t TIM_GetCounter(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + /* Get the Counter Register value */ + return TIMx->CNT; +} + +/** + * @brief Gets the TIMx Prescaler value. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @retval Prescaler Register value. + */ +uint16_t TIM_GetPrescaler(TIM_TypeDef* TIMx) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + /* Get the Prescaler Register value */ + return TIMx->PSC; +} + +/** + * @brief Checks whether the specified TIM flag is set or not. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg TIM_FLAG_Update: TIM update Flag + * @arg TIM_FLAG_CC1: TIM Capture Compare 1 Flag + * @arg TIM_FLAG_CC2: TIM Capture Compare 2 Flag + * @arg TIM_FLAG_CC3: TIM Capture Compare 3 Flag + * @arg TIM_FLAG_CC4: TIM Capture Compare 4 Flag + * @arg TIM_FLAG_COM: TIM Commutation Flag + * @arg TIM_FLAG_Trigger: TIM Trigger Flag + * @arg TIM_FLAG_Break: TIM Break Flag + * @arg TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag + * @arg TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag + * @arg TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag + * @arg TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag + * @note + * - TIM6 and TIM7 can have only one update flag. + * - TIM9, TIM12 and TIM15 can have only TIM_FLAG_Update, TIM_FLAG_CC1, + * TIM_FLAG_CC2 or TIM_FLAG_Trigger. + * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1. + * - TIM_FLAG_Break is used only with TIM1, TIM8 and TIM15. + * - TIM_FLAG_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. + * @retval The new state of TIM_FLAG (SET or RESET). + */ +FlagStatus TIM_GetFlagStatus(TIM_TypeDef* TIMx, uint16_t TIM_FLAG) +{ + ITStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_GET_FLAG(TIM_FLAG)); + + if ((TIMx->SR & TIM_FLAG) != (uint16_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the TIMx's pending flags. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_FLAG: specifies the flag bit to clear. + * This parameter can be any combination of the following values: + * @arg TIM_FLAG_Update: TIM update Flag + * @arg TIM_FLAG_CC1: TIM Capture Compare 1 Flag + * @arg TIM_FLAG_CC2: TIM Capture Compare 2 Flag + * @arg TIM_FLAG_CC3: TIM Capture Compare 3 Flag + * @arg TIM_FLAG_CC4: TIM Capture Compare 4 Flag + * @arg TIM_FLAG_COM: TIM Commutation Flag + * @arg TIM_FLAG_Trigger: TIM Trigger Flag + * @arg TIM_FLAG_Break: TIM Break Flag + * @arg TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag + * @arg TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag + * @arg TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag + * @arg TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag + * @note + * - TIM6 and TIM7 can have only one update flag. + * - TIM9, TIM12 and TIM15 can have only TIM_FLAG_Update, TIM_FLAG_CC1, + * TIM_FLAG_CC2 or TIM_FLAG_Trigger. + * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1. + * - TIM_FLAG_Break is used only with TIM1, TIM8 and TIM15. + * - TIM_FLAG_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. + * @retval None + */ +void TIM_ClearFlag(TIM_TypeDef* TIMx, uint16_t TIM_FLAG) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_CLEAR_FLAG(TIM_FLAG)); + + /* Clear the flags */ + TIMx->SR = (uint16_t)~TIM_FLAG; +} + +/** + * @brief Checks whether the TIM interrupt has occurred or not. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_IT: specifies the TIM interrupt source to check. + * This parameter can be one of the following values: + * @arg TIM_IT_Update: TIM update Interrupt source + * @arg TIM_IT_CC1: TIM Capture Compare 1 Interrupt source + * @arg TIM_IT_CC2: TIM Capture Compare 2 Interrupt source + * @arg TIM_IT_CC3: TIM Capture Compare 3 Interrupt source + * @arg TIM_IT_CC4: TIM Capture Compare 4 Interrupt source + * @arg TIM_IT_COM: TIM Commutation Interrupt source + * @arg TIM_IT_Trigger: TIM Trigger Interrupt source + * @arg TIM_IT_Break: TIM Break Interrupt source + * @note + * - TIM6 and TIM7 can generate only an update interrupt. + * - TIM9, TIM12 and TIM15 can have only TIM_IT_Update, TIM_IT_CC1, + * TIM_IT_CC2 or TIM_IT_Trigger. + * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1. + * - TIM_IT_Break is used only with TIM1, TIM8 and TIM15. + * - TIM_IT_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. + * @retval The new state of the TIM_IT(SET or RESET). + */ +ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT) +{ + ITStatus bitstatus = RESET; + uint16_t itstatus = 0x0, itenable = 0x0; + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_GET_IT(TIM_IT)); + + itstatus = TIMx->SR & TIM_IT; + + itenable = TIMx->DIER & TIM_IT; + if ((itstatus != (uint16_t)RESET) && (itenable != (uint16_t)RESET)) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the TIMx's interrupt pending bits. + * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. + * @param TIM_IT: specifies the pending bit to clear. + * This parameter can be any combination of the following values: + * @arg TIM_IT_Update: TIM1 update Interrupt source + * @arg TIM_IT_CC1: TIM Capture Compare 1 Interrupt source + * @arg TIM_IT_CC2: TIM Capture Compare 2 Interrupt source + * @arg TIM_IT_CC3: TIM Capture Compare 3 Interrupt source + * @arg TIM_IT_CC4: TIM Capture Compare 4 Interrupt source + * @arg TIM_IT_COM: TIM Commutation Interrupt source + * @arg TIM_IT_Trigger: TIM Trigger Interrupt source + * @arg TIM_IT_Break: TIM Break Interrupt source + * @note + * - TIM6 and TIM7 can generate only an update interrupt. + * - TIM9, TIM12 and TIM15 can have only TIM_IT_Update, TIM_IT_CC1, + * TIM_IT_CC2 or TIM_IT_Trigger. + * - TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1. + * - TIM_IT_Break is used only with TIM1, TIM8 and TIM15. + * - TIM_IT_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17. + * @retval None + */ +void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT) +{ + /* Check the parameters */ + assert_param(IS_TIM_ALL_PERIPH(TIMx)); + assert_param(IS_TIM_IT(TIM_IT)); + /* Clear the IT pending Bit */ + TIMx->SR = (uint16_t)~TIM_IT; +} + +/** + * @brief Configure the TI1 as Input. + * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. + * @param TIM_ICPolarity : The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @param TIM_ICSelection: specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSelection_DirectTI: TIM Input 1 is selected to be connected to IC1. + * @arg TIM_ICSelection_IndirectTI: TIM Input 1 is selected to be connected to IC2. + * @arg TIM_ICSelection_TRC: TIM Input 1 is selected to be connected to TRC. + * @param TIM_ICFilter: Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter) +{ + uint16_t tmpccmr1 = 0, tmpccer = 0; + /* Disable the Channel 1: Reset the CC1E Bit */ + TIMx->CCER &= (uint16_t)~((uint16_t)TIM_CCER_CC1E); + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + /* Select the Input and set the filter */ + tmpccmr1 &= (uint16_t)(((uint16_t)~((uint16_t)TIM_CCMR1_CC1S)) & ((uint16_t)~((uint16_t)TIM_CCMR1_IC1F))); + tmpccmr1 |= (uint16_t)(TIM_ICSelection | (uint16_t)(TIM_ICFilter << (uint16_t)4)); + + if((TIMx == TIM1) || (TIMx == TIM8) || (TIMx == TIM2) || (TIMx == TIM3) || + (TIMx == TIM4) ||(TIMx == TIM5)) + { + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC1P)); + tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)TIM_CCER_CC1E); + } + else + { + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC1P | TIM_CCER_CC1NP)); + tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)TIM_CCER_CC1E); + } + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI2 as Input. + * @param TIMx: where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. + * @param TIM_ICPolarity : The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @param TIM_ICSelection: specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSelection_DirectTI: TIM Input 2 is selected to be connected to IC2. + * @arg TIM_ICSelection_IndirectTI: TIM Input 2 is selected to be connected to IC1. + * @arg TIM_ICSelection_TRC: TIM Input 2 is selected to be connected to TRC. + * @param TIM_ICFilter: Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter) +{ + uint16_t tmpccmr1 = 0, tmpccer = 0, tmp = 0; + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= (uint16_t)~((uint16_t)TIM_CCER_CC2E); + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + tmp = (uint16_t)(TIM_ICPolarity << 4); + /* Select the Input and set the filter */ + tmpccmr1 &= (uint16_t)(((uint16_t)~((uint16_t)TIM_CCMR1_CC2S)) & ((uint16_t)~((uint16_t)TIM_CCMR1_IC2F))); + tmpccmr1 |= (uint16_t)(TIM_ICFilter << 12); + tmpccmr1 |= (uint16_t)(TIM_ICSelection << 8); + + if((TIMx == TIM1) || (TIMx == TIM8) || (TIMx == TIM2) || (TIMx == TIM3) || + (TIMx == TIM4) ||(TIMx == TIM5)) + { + /* Select the Polarity and set the CC2E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC2P)); + tmpccer |= (uint16_t)(tmp | (uint16_t)TIM_CCER_CC2E); + } + else + { + /* Select the Polarity and set the CC2E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC2P | TIM_CCER_CC2NP)); + tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)TIM_CCER_CC2E); + } + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1 ; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI3 as Input. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ICPolarity : The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @param TIM_ICSelection: specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSelection_DirectTI: TIM Input 3 is selected to be connected to IC3. + * @arg TIM_ICSelection_IndirectTI: TIM Input 3 is selected to be connected to IC4. + * @arg TIM_ICSelection_TRC: TIM Input 3 is selected to be connected to TRC. + * @param TIM_ICFilter: Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter) +{ + uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0; + /* Disable the Channel 3: Reset the CC3E Bit */ + TIMx->CCER &= (uint16_t)~((uint16_t)TIM_CCER_CC3E); + tmpccmr2 = TIMx->CCMR2; + tmpccer = TIMx->CCER; + tmp = (uint16_t)(TIM_ICPolarity << 8); + /* Select the Input and set the filter */ + tmpccmr2 &= (uint16_t)(((uint16_t)~((uint16_t)TIM_CCMR2_CC3S)) & ((uint16_t)~((uint16_t)TIM_CCMR2_IC3F))); + tmpccmr2 |= (uint16_t)(TIM_ICSelection | (uint16_t)(TIM_ICFilter << (uint16_t)4)); + + if((TIMx == TIM1) || (TIMx == TIM8) || (TIMx == TIM2) || (TIMx == TIM3) || + (TIMx == TIM4) ||(TIMx == TIM5)) + { + /* Select the Polarity and set the CC3E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC3P)); + tmpccer |= (uint16_t)(tmp | (uint16_t)TIM_CCER_CC3E); + } + else + { + /* Select the Polarity and set the CC3E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC3P | TIM_CCER_CC3NP)); + tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)TIM_CCER_CC3E); + } + + /* Write to TIMx CCMR2 and CCER registers */ + TIMx->CCMR2 = tmpccmr2; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI4 as Input. + * @param TIMx: where x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral. + * @param TIM_ICPolarity : The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPolarity_Rising + * @arg TIM_ICPolarity_Falling + * @param TIM_ICSelection: specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSelection_DirectTI: TIM Input 4 is selected to be connected to IC4. + * @arg TIM_ICSelection_IndirectTI: TIM Input 4 is selected to be connected to IC3. + * @arg TIM_ICSelection_TRC: TIM Input 4 is selected to be connected to TRC. + * @param TIM_ICFilter: Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, + uint16_t TIM_ICFilter) +{ + uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0; + + /* Disable the Channel 4: Reset the CC4E Bit */ + TIMx->CCER &= (uint16_t)~((uint16_t)TIM_CCER_CC4E); + tmpccmr2 = TIMx->CCMR2; + tmpccer = TIMx->CCER; + tmp = (uint16_t)(TIM_ICPolarity << 12); + /* Select the Input and set the filter */ + tmpccmr2 &= (uint16_t)((uint16_t)(~(uint16_t)TIM_CCMR2_CC4S) & ((uint16_t)~((uint16_t)TIM_CCMR2_IC4F))); + tmpccmr2 |= (uint16_t)(TIM_ICSelection << 8); + tmpccmr2 |= (uint16_t)(TIM_ICFilter << 12); + + if((TIMx == TIM1) || (TIMx == TIM8) || (TIMx == TIM2) || (TIMx == TIM3) || + (TIMx == TIM4) ||(TIMx == TIM5)) + { + /* Select the Polarity and set the CC4E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC4P)); + tmpccer |= (uint16_t)(tmp | (uint16_t)TIM_CCER_CC4E); + } + else + { + /* Select the Polarity and set the CC4E Bit */ + tmpccer &= (uint16_t)~((uint16_t)(TIM_CCER_CC3P | TIM_CCER_CC4NP)); + tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)TIM_CCER_CC4E); + } + /* Write to TIMx CCMR2 and CCER registers */ + TIMx->CCMR2 = tmpccmr2; + TIMx->CCER = tmpccer; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c new file mode 100644 index 0000000..da4407a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c @@ -0,0 +1,1057 @@ +/** + ****************************************************************************** + * @file stm32f10x_usart.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the USART firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_usart.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup USART + * @brief USART driver modules + * @{ + */ + +/** @defgroup USART_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup USART_Private_Defines + * @{ + */ + +#define CR1_UE_Set ((uint16_t)0x2000) /*!< USART Enable Mask */ +#define CR1_UE_Reset ((uint16_t)0xDFFF) /*!< USART Disable Mask */ + +#define CR1_WAKE_Mask ((uint16_t)0xF7FF) /*!< USART WakeUp Method Mask */ + +#define CR1_RWU_Set ((uint16_t)0x0002) /*!< USART mute mode Enable Mask */ +#define CR1_RWU_Reset ((uint16_t)0xFFFD) /*!< USART mute mode Enable Mask */ +#define CR1_SBK_Set ((uint16_t)0x0001) /*!< USART Break Character send Mask */ +#define CR1_CLEAR_Mask ((uint16_t)0xE9F3) /*!< USART CR1 Mask */ +#define CR2_Address_Mask ((uint16_t)0xFFF0) /*!< USART address Mask */ + +#define CR2_LINEN_Set ((uint16_t)0x4000) /*!< USART LIN Enable Mask */ +#define CR2_LINEN_Reset ((uint16_t)0xBFFF) /*!< USART LIN Disable Mask */ + +#define CR2_LBDL_Mask ((uint16_t)0xFFDF) /*!< USART LIN Break detection Mask */ +#define CR2_STOP_CLEAR_Mask ((uint16_t)0xCFFF) /*!< USART CR2 STOP Bits Mask */ +#define CR2_CLOCK_CLEAR_Mask ((uint16_t)0xF0FF) /*!< USART CR2 Clock Mask */ + +#define CR3_SCEN_Set ((uint16_t)0x0020) /*!< USART SC Enable Mask */ +#define CR3_SCEN_Reset ((uint16_t)0xFFDF) /*!< USART SC Disable Mask */ + +#define CR3_NACK_Set ((uint16_t)0x0010) /*!< USART SC NACK Enable Mask */ +#define CR3_NACK_Reset ((uint16_t)0xFFEF) /*!< USART SC NACK Disable Mask */ + +#define CR3_HDSEL_Set ((uint16_t)0x0008) /*!< USART Half-Duplex Enable Mask */ +#define CR3_HDSEL_Reset ((uint16_t)0xFFF7) /*!< USART Half-Duplex Disable Mask */ + +#define CR3_IRLP_Mask ((uint16_t)0xFFFB) /*!< USART IrDA LowPower mode Mask */ +#define CR3_CLEAR_Mask ((uint16_t)0xFCFF) /*!< USART CR3 Mask */ + +#define CR3_IREN_Set ((uint16_t)0x0002) /*!< USART IrDA Enable Mask */ +#define CR3_IREN_Reset ((uint16_t)0xFFFD) /*!< USART IrDA Disable Mask */ +#define GTPR_LSB_Mask ((uint16_t)0x00FF) /*!< Guard Time Register LSB Mask */ +#define GTPR_MSB_Mask ((uint16_t)0xFF00) /*!< Guard Time Register MSB Mask */ +#define IT_Mask ((uint16_t)0x001F) /*!< USART Interrupt Mask */ + +/* USART OverSampling-8 Mask */ +#define CR1_OVER8_Set ((u16)0x8000) /* USART OVER8 mode Enable Mask */ +#define CR1_OVER8_Reset ((u16)0x7FFF) /* USART OVER8 mode Disable Mask */ + +/* USART One Bit Sampling Mask */ +#define CR3_ONEBITE_Set ((u16)0x0800) /* USART ONEBITE mode Enable Mask */ +#define CR3_ONEBITE_Reset ((u16)0xF7FF) /* USART ONEBITE mode Disable Mask */ + +/** + * @} + */ + +/** @defgroup USART_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup USART_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup USART_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup USART_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the USARTx peripheral registers to their default reset values. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @retval None + */ +void USART_DeInit(USART_TypeDef* USARTx) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + + if (USARTx == USART1) + { + RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, DISABLE); + } + else if (USARTx == USART2) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, DISABLE); + } + else if (USARTx == USART3) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, DISABLE); + } + else if (USARTx == UART4) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART4, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART4, DISABLE); + } + else + { + if (USARTx == UART5) + { + RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART5, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART5, DISABLE); + } + } +} + +/** + * @brief Initializes the USARTx peripheral according to the specified + * parameters in the USART_InitStruct . + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_InitStruct: pointer to a USART_InitTypeDef structure + * that contains the configuration information for the specified USART + * peripheral. + * @retval None + */ +void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct) +{ + uint32_t tmpreg = 0x00, apbclock = 0x00; + uint32_t integerdivider = 0x00; + uint32_t fractionaldivider = 0x00; + uint32_t usartxbase = 0; + RCC_ClocksTypeDef RCC_ClocksStatus; + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_BAUDRATE(USART_InitStruct->USART_BaudRate)); + assert_param(IS_USART_WORD_LENGTH(USART_InitStruct->USART_WordLength)); + assert_param(IS_USART_STOPBITS(USART_InitStruct->USART_StopBits)); + assert_param(IS_USART_PARITY(USART_InitStruct->USART_Parity)); + assert_param(IS_USART_MODE(USART_InitStruct->USART_Mode)); + assert_param(IS_USART_HARDWARE_FLOW_CONTROL(USART_InitStruct->USART_HardwareFlowControl)); + /* The hardware flow control is available only for USART1, USART2 and USART3 */ + if (USART_InitStruct->USART_HardwareFlowControl != USART_HardwareFlowControl_None) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + usartxbase = (uint32_t)USARTx; + +/*---------------------------- USART CR2 Configuration -----------------------*/ + tmpreg = USARTx->CR2; + /* Clear STOP[13:12] bits */ + tmpreg &= CR2_STOP_CLEAR_Mask; + /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit ------------*/ + /* Set STOP[13:12] bits according to USART_StopBits value */ + tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits; + + /* Write to USART CR2 */ + USARTx->CR2 = (uint16_t)tmpreg; + +/*---------------------------- USART CR1 Configuration -----------------------*/ + tmpreg = USARTx->CR1; + /* Clear M, PCE, PS, TE and RE bits */ + tmpreg &= CR1_CLEAR_Mask; + /* Configure the USART Word Length, Parity and mode ----------------------- */ + /* Set the M bits according to USART_WordLength value */ + /* Set PCE and PS bits according to USART_Parity value */ + /* Set TE and RE bits according to USART_Mode value */ + tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity | + USART_InitStruct->USART_Mode; + /* Write to USART CR1 */ + USARTx->CR1 = (uint16_t)tmpreg; + +/*---------------------------- USART CR3 Configuration -----------------------*/ + tmpreg = USARTx->CR3; + /* Clear CTSE and RTSE bits */ + tmpreg &= CR3_CLEAR_Mask; + /* Configure the USART HFC -------------------------------------------------*/ + /* Set CTSE and RTSE bits according to USART_HardwareFlowControl value */ + tmpreg |= USART_InitStruct->USART_HardwareFlowControl; + /* Write to USART CR3 */ + USARTx->CR3 = (uint16_t)tmpreg; + +/*---------------------------- USART BRR Configuration -----------------------*/ + /* Configure the USART Baud Rate -------------------------------------------*/ + RCC_GetClocksFreq(&RCC_ClocksStatus); + if (usartxbase == USART1_BASE) + { + apbclock = RCC_ClocksStatus.PCLK2_Frequency; + } + else + { + apbclock = RCC_ClocksStatus.PCLK1_Frequency; + } + + /* Determine the integer part */ + if ((USARTx->CR1 & CR1_OVER8_Set) != 0) + { + /* Integer part computing in case Oversampling mode is 8 Samples */ + integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate))); + } + else /* if ((USARTx->CR1 & CR1_OVER8_Set) == 0) */ + { + /* Integer part computing in case Oversampling mode is 16 Samples */ + integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate))); + } + tmpreg = (integerdivider / 100) << 4; + + /* Determine the fractional part */ + fractionaldivider = integerdivider - (100 * (tmpreg >> 4)); + + /* Implement the fractional part in the register */ + if ((USARTx->CR1 & CR1_OVER8_Set) != 0) + { + tmpreg |= ((((fractionaldivider * 8) + 50) / 100)) & ((uint8_t)0x07); + } + else /* if ((USARTx->CR1 & CR1_OVER8_Set) == 0) */ + { + tmpreg |= ((((fractionaldivider * 16) + 50) / 100)) & ((uint8_t)0x0F); + } + + /* Write to USART BRR */ + USARTx->BRR = (uint16_t)tmpreg; +} + +/** + * @brief Fills each USART_InitStruct member with its default value. + * @param USART_InitStruct: pointer to a USART_InitTypeDef structure + * which will be initialized. + * @retval None + */ +void USART_StructInit(USART_InitTypeDef* USART_InitStruct) +{ + /* USART_InitStruct members default value */ + USART_InitStruct->USART_BaudRate = 9600; + USART_InitStruct->USART_WordLength = USART_WordLength_8b; + USART_InitStruct->USART_StopBits = USART_StopBits_1; + USART_InitStruct->USART_Parity = USART_Parity_No ; + USART_InitStruct->USART_Mode = USART_Mode_Rx | USART_Mode_Tx; + USART_InitStruct->USART_HardwareFlowControl = USART_HardwareFlowControl_None; +} + +/** + * @brief Initializes the USARTx peripheral Clock according to the + * specified parameters in the USART_ClockInitStruct . + * @param USARTx: where x can be 1, 2, 3 to select the USART peripheral. + * @param USART_ClockInitStruct: pointer to a USART_ClockInitTypeDef + * structure that contains the configuration information for the specified + * USART peripheral. + * @note The Smart Card and Synchronous modes are not available for UART4 and UART5. + * @retval None + */ +void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct) +{ + uint32_t tmpreg = 0x00; + /* Check the parameters */ + assert_param(IS_USART_123_PERIPH(USARTx)); + assert_param(IS_USART_CLOCK(USART_ClockInitStruct->USART_Clock)); + assert_param(IS_USART_CPOL(USART_ClockInitStruct->USART_CPOL)); + assert_param(IS_USART_CPHA(USART_ClockInitStruct->USART_CPHA)); + assert_param(IS_USART_LASTBIT(USART_ClockInitStruct->USART_LastBit)); + +/*---------------------------- USART CR2 Configuration -----------------------*/ + tmpreg = USARTx->CR2; + /* Clear CLKEN, CPOL, CPHA and LBCL bits */ + tmpreg &= CR2_CLOCK_CLEAR_Mask; + /* Configure the USART Clock, CPOL, CPHA and LastBit ------------*/ + /* Set CLKEN bit according to USART_Clock value */ + /* Set CPOL bit according to USART_CPOL value */ + /* Set CPHA bit according to USART_CPHA value */ + /* Set LBCL bit according to USART_LastBit value */ + tmpreg |= (uint32_t)USART_ClockInitStruct->USART_Clock | USART_ClockInitStruct->USART_CPOL | + USART_ClockInitStruct->USART_CPHA | USART_ClockInitStruct->USART_LastBit; + /* Write to USART CR2 */ + USARTx->CR2 = (uint16_t)tmpreg; +} + +/** + * @brief Fills each USART_ClockInitStruct member with its default value. + * @param USART_ClockInitStruct: pointer to a USART_ClockInitTypeDef + * structure which will be initialized. + * @retval None + */ +void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct) +{ + /* USART_ClockInitStruct members default value */ + USART_ClockInitStruct->USART_Clock = USART_Clock_Disable; + USART_ClockInitStruct->USART_CPOL = USART_CPOL_Low; + USART_ClockInitStruct->USART_CPHA = USART_CPHA_1Edge; + USART_ClockInitStruct->USART_LastBit = USART_LastBit_Disable; +} + +/** + * @brief Enables or disables the specified USART peripheral. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USARTx peripheral. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the selected USART by setting the UE bit in the CR1 register */ + USARTx->CR1 |= CR1_UE_Set; + } + else + { + /* Disable the selected USART by clearing the UE bit in the CR1 register */ + USARTx->CR1 &= CR1_UE_Reset; + } +} + +/** + * @brief Enables or disables the specified USART interrupts. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_IT: specifies the USART interrupt sources to be enabled or disabled. + * This parameter can be one of the following values: + * @arg USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5) + * @arg USART_IT_LBD: LIN Break detection interrupt + * @arg USART_IT_TXE: Transmit Data Register empty interrupt + * @arg USART_IT_TC: Transmission complete interrupt + * @arg USART_IT_RXNE: Receive Data register not empty interrupt + * @arg USART_IT_IDLE: Idle line detection interrupt + * @arg USART_IT_PE: Parity Error interrupt + * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error) + * @param NewState: new state of the specified USARTx interrupts. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState) +{ + uint32_t usartreg = 0x00, itpos = 0x00, itmask = 0x00; + uint32_t usartxbase = 0x00; + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_CONFIG_IT(USART_IT)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + /* The CTS interrupt is not available for UART4 and UART5 */ + if (USART_IT == USART_IT_CTS) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + usartxbase = (uint32_t)USARTx; + + /* Get the USART register index */ + usartreg = (((uint8_t)USART_IT) >> 0x05); + + /* Get the interrupt position */ + itpos = USART_IT & IT_Mask; + itmask = (((uint32_t)0x01) << itpos); + + if (usartreg == 0x01) /* The IT is in CR1 register */ + { + usartxbase += 0x0C; + } + else if (usartreg == 0x02) /* The IT is in CR2 register */ + { + usartxbase += 0x10; + } + else /* The IT is in CR3 register */ + { + usartxbase += 0x14; + } + if (NewState != DISABLE) + { + *(__IO uint32_t*)usartxbase |= itmask; + } + else + { + *(__IO uint32_t*)usartxbase &= ~itmask; + } +} + +/** + * @brief Enables or disables the USARTs DMA interface. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_DMAReq: specifies the DMA request. + * This parameter can be any combination of the following values: + * @arg USART_DMAReq_Tx: USART DMA transmit request + * @arg USART_DMAReq_Rx: USART DMA receive request + * @param NewState: new state of the DMA Request sources. + * This parameter can be: ENABLE or DISABLE. + * @note The DMA mode is not available for UART5 except in the STM32 + * High density value line devices(STM32F10X_HD_VL). + * @retval None + */ +void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_DMAREQ(USART_DMAReq)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the DMA transfer for selected requests by setting the DMAT and/or + DMAR bits in the USART CR3 register */ + USARTx->CR3 |= USART_DMAReq; + } + else + { + /* Disable the DMA transfer for selected requests by clearing the DMAT and/or + DMAR bits in the USART CR3 register */ + USARTx->CR3 &= (uint16_t)~USART_DMAReq; + } +} + +/** + * @brief Sets the address of the USART node. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_Address: Indicates the address of the USART node. + * @retval None + */ +void USART_SetAddress(USART_TypeDef* USARTx, uint8_t USART_Address) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_ADDRESS(USART_Address)); + + /* Clear the USART address */ + USARTx->CR2 &= CR2_Address_Mask; + /* Set the USART address node */ + USARTx->CR2 |= USART_Address; +} + +/** + * @brief Selects the USART WakeUp method. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_WakeUp: specifies the USART wakeup method. + * This parameter can be one of the following values: + * @arg USART_WakeUp_IdleLine: WakeUp by an idle line detection + * @arg USART_WakeUp_AddressMark: WakeUp by an address mark + * @retval None + */ +void USART_WakeUpConfig(USART_TypeDef* USARTx, uint16_t USART_WakeUp) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_WAKEUP(USART_WakeUp)); + + USARTx->CR1 &= CR1_WAKE_Mask; + USARTx->CR1 |= USART_WakeUp; +} + +/** + * @brief Determines if the USART is in mute mode or not. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USART mute mode. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the USART mute mode by setting the RWU bit in the CR1 register */ + USARTx->CR1 |= CR1_RWU_Set; + } + else + { + /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */ + USARTx->CR1 &= CR1_RWU_Reset; + } +} + +/** + * @brief Sets the USART LIN Break detection length. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_LINBreakDetectLength: specifies the LIN break detection length. + * This parameter can be one of the following values: + * @arg USART_LINBreakDetectLength_10b: 10-bit break detection + * @arg USART_LINBreakDetectLength_11b: 11-bit break detection + * @retval None + */ +void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, uint16_t USART_LINBreakDetectLength) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength)); + + USARTx->CR2 &= CR2_LBDL_Mask; + USARTx->CR2 |= USART_LINBreakDetectLength; +} + +/** + * @brief Enables or disables the USARTs LIN mode. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USART LIN mode. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the LIN mode by setting the LINEN bit in the CR2 register */ + USARTx->CR2 |= CR2_LINEN_Set; + } + else + { + /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */ + USARTx->CR2 &= CR2_LINEN_Reset; + } +} + +/** + * @brief Transmits single data through the USARTx peripheral. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param Data: the data to transmit. + * @retval None + */ +void USART_SendData(USART_TypeDef* USARTx, uint16_t Data) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_DATA(Data)); + + /* Transmit Data */ + USARTx->DR = (Data & (uint16_t)0x01FF); +} + +/** + * @brief Returns the most recent received data by the USARTx peripheral. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @retval The received data. + */ +uint16_t USART_ReceiveData(USART_TypeDef* USARTx) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + + /* Receive Data */ + return (uint16_t)(USARTx->DR & (uint16_t)0x01FF); +} + +/** + * @brief Transmits break characters. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @retval None + */ +void USART_SendBreak(USART_TypeDef* USARTx) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + + /* Send break characters */ + USARTx->CR1 |= CR1_SBK_Set; +} + +/** + * @brief Sets the specified USART guard time. + * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral. + * @param USART_GuardTime: specifies the guard time. + * @note The guard time bits are not available for UART4 and UART5. + * @retval None + */ +void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime) +{ + /* Check the parameters */ + assert_param(IS_USART_123_PERIPH(USARTx)); + + /* Clear the USART Guard time */ + USARTx->GTPR &= GTPR_LSB_Mask; + /* Set the USART guard time */ + USARTx->GTPR |= (uint16_t)((uint16_t)USART_GuardTime << 0x08); +} + +/** + * @brief Sets the system clock prescaler. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_Prescaler: specifies the prescaler clock. + * @note The function is used for IrDA mode with UART4 and UART5. + * @retval None + */ +void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + + /* Clear the USART prescaler */ + USARTx->GTPR &= GTPR_MSB_Mask; + /* Set the USART prescaler */ + USARTx->GTPR |= USART_Prescaler; +} + +/** + * @brief Enables or disables the USARTs Smart Card mode. + * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral. + * @param NewState: new state of the Smart Card mode. + * This parameter can be: ENABLE or DISABLE. + * @note The Smart Card mode is not available for UART4 and UART5. + * @retval None + */ +void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_123_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the SC mode by setting the SCEN bit in the CR3 register */ + USARTx->CR3 |= CR3_SCEN_Set; + } + else + { + /* Disable the SC mode by clearing the SCEN bit in the CR3 register */ + USARTx->CR3 &= CR3_SCEN_Reset; + } +} + +/** + * @brief Enables or disables NACK transmission. + * @param USARTx: where x can be 1, 2 or 3 to select the USART peripheral. + * @param NewState: new state of the NACK transmission. + * This parameter can be: ENABLE or DISABLE. + * @note The Smart Card mode is not available for UART4 and UART5. + * @retval None + */ +void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_123_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + if (NewState != DISABLE) + { + /* Enable the NACK transmission by setting the NACK bit in the CR3 register */ + USARTx->CR3 |= CR3_NACK_Set; + } + else + { + /* Disable the NACK transmission by clearing the NACK bit in the CR3 register */ + USARTx->CR3 &= CR3_NACK_Reset; + } +} + +/** + * @brief Enables or disables the USARTs Half Duplex communication. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USART Communication. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */ + USARTx->CR3 |= CR3_HDSEL_Set; + } + else + { + /* Disable the Half-Duplex mode by clearing the HDSEL bit in the CR3 register */ + USARTx->CR3 &= CR3_HDSEL_Reset; + } +} + + +/** + * @brief Enables or disables the USART's 8x oversampling mode. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USART one bit sampling method. + * This parameter can be: ENABLE or DISABLE. + * @note + * This function has to be called before calling USART_Init() + * function in order to have correct baudrate Divider value. + * @retval None + */ +void USART_OverSampling8Cmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the 8x Oversampling mode by setting the OVER8 bit in the CR1 register */ + USARTx->CR1 |= CR1_OVER8_Set; + } + else + { + /* Disable the 8x Oversampling mode by clearing the OVER8 bit in the CR1 register */ + USARTx->CR1 &= CR1_OVER8_Reset; + } +} + +/** + * @brief Enables or disables the USART's one bit sampling method. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the USART one bit sampling method. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_OneBitMethodCmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the one bit method by setting the ONEBITE bit in the CR3 register */ + USARTx->CR3 |= CR3_ONEBITE_Set; + } + else + { + /* Disable tthe one bit method by clearing the ONEBITE bit in the CR3 register */ + USARTx->CR3 &= CR3_ONEBITE_Reset; + } +} + +/** + * @brief Configures the USART's IrDA interface. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_IrDAMode: specifies the IrDA mode. + * This parameter can be one of the following values: + * @arg USART_IrDAMode_LowPower + * @arg USART_IrDAMode_Normal + * @retval None + */ +void USART_IrDAConfig(USART_TypeDef* USARTx, uint16_t USART_IrDAMode) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_IRDA_MODE(USART_IrDAMode)); + + USARTx->CR3 &= CR3_IRLP_Mask; + USARTx->CR3 |= USART_IrDAMode; +} + +/** + * @brief Enables or disables the USART's IrDA interface. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param NewState: new state of the IrDA mode. + * This parameter can be: ENABLE or DISABLE. + * @retval None + */ +void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_FUNCTIONAL_STATE(NewState)); + + if (NewState != DISABLE) + { + /* Enable the IrDA mode by setting the IREN bit in the CR3 register */ + USARTx->CR3 |= CR3_IREN_Set; + } + else + { + /* Disable the IrDA mode by clearing the IREN bit in the CR3 register */ + USARTx->CR3 &= CR3_IREN_Reset; + } +} + +/** + * @brief Checks whether the specified USART flag is set or not. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_FLAG: specifies the flag to check. + * This parameter can be one of the following values: + * @arg USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5) + * @arg USART_FLAG_LBD: LIN Break detection flag + * @arg USART_FLAG_TXE: Transmit data register empty flag + * @arg USART_FLAG_TC: Transmission Complete flag + * @arg USART_FLAG_RXNE: Receive data register not empty flag + * @arg USART_FLAG_IDLE: Idle Line detection flag + * @arg USART_FLAG_ORE: OverRun Error flag + * @arg USART_FLAG_NE: Noise Error flag + * @arg USART_FLAG_FE: Framing Error flag + * @arg USART_FLAG_PE: Parity Error flag + * @retval The new state of USART_FLAG (SET or RESET). + */ +FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, uint16_t USART_FLAG) +{ + FlagStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_FLAG(USART_FLAG)); + /* The CTS flag is not available for UART4 and UART5 */ + if (USART_FLAG == USART_FLAG_CTS) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + if ((USARTx->SR & USART_FLAG) != (uint16_t)RESET) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + return bitstatus; +} + +/** + * @brief Clears the USARTx's pending flags. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_FLAG: specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5). + * @arg USART_FLAG_LBD: LIN Break detection flag. + * @arg USART_FLAG_TC: Transmission Complete flag. + * @arg USART_FLAG_RXNE: Receive data register not empty flag. + * + * @note + * - PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun + * error) and IDLE (Idle line detected) flags are cleared by software + * sequence: a read operation to USART_SR register (USART_GetFlagStatus()) + * followed by a read operation to USART_DR register (USART_ReceiveData()). + * - RXNE flag can be also cleared by a read to the USART_DR register + * (USART_ReceiveData()). + * - TC flag can be also cleared by software sequence: a read operation to + * USART_SR register (USART_GetFlagStatus()) followed by a write operation + * to USART_DR register (USART_SendData()). + * - TXE flag is cleared only by a write to the USART_DR register + * (USART_SendData()). + * @retval None + */ +void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG) +{ + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_CLEAR_FLAG(USART_FLAG)); + /* The CTS flag is not available for UART4 and UART5 */ + if ((USART_FLAG & USART_FLAG_CTS) == USART_FLAG_CTS) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + USARTx->SR = (uint16_t)~USART_FLAG; +} + +/** + * @brief Checks whether the specified USART interrupt has occurred or not. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_IT: specifies the USART interrupt source to check. + * This parameter can be one of the following values: + * @arg USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5) + * @arg USART_IT_LBD: LIN Break detection interrupt + * @arg USART_IT_TXE: Tansmit Data Register empty interrupt + * @arg USART_IT_TC: Transmission complete interrupt + * @arg USART_IT_RXNE: Receive Data register not empty interrupt + * @arg USART_IT_IDLE: Idle line detection interrupt + * @arg USART_IT_ORE_RX : OverRun Error interrupt if the RXNEIE bit is set + * @arg USART_IT_ORE_ER : OverRun Error interrupt if the EIE bit is set + * @arg USART_IT_NE: Noise Error interrupt + * @arg USART_IT_FE: Framing Error interrupt + * @arg USART_IT_PE: Parity Error interrupt + * @retval The new state of USART_IT (SET or RESET). + */ +ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT) +{ + uint32_t bitpos = 0x00, itmask = 0x00, usartreg = 0x00; + ITStatus bitstatus = RESET; + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_GET_IT(USART_IT)); + /* The CTS interrupt is not available for UART4 and UART5 */ + if (USART_IT == USART_IT_CTS) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + /* Get the USART register index */ + usartreg = (((uint8_t)USART_IT) >> 0x05); + /* Get the interrupt position */ + itmask = USART_IT & IT_Mask; + itmask = (uint32_t)0x01 << itmask; + + if (usartreg == 0x01) /* The IT is in CR1 register */ + { + itmask &= USARTx->CR1; + } + else if (usartreg == 0x02) /* The IT is in CR2 register */ + { + itmask &= USARTx->CR2; + } + else /* The IT is in CR3 register */ + { + itmask &= USARTx->CR3; + } + + bitpos = USART_IT >> 0x08; + bitpos = (uint32_t)0x01 << bitpos; + bitpos &= USARTx->SR; + if ((itmask != (uint16_t)RESET)&&(bitpos != (uint16_t)RESET)) + { + bitstatus = SET; + } + else + { + bitstatus = RESET; + } + + return bitstatus; +} + +/** + * @brief Clears the USARTx's interrupt pending bits. + * @param USARTx: Select the USART or the UART peripheral. + * This parameter can be one of the following values: + * USART1, USART2, USART3, UART4 or UART5. + * @param USART_IT: specifies the interrupt pending bit to clear. + * This parameter can be one of the following values: + * @arg USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5) + * @arg USART_IT_LBD: LIN Break detection interrupt + * @arg USART_IT_TC: Transmission complete interrupt. + * @arg USART_IT_RXNE: Receive Data register not empty interrupt. + * + * @note + * - PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun + * error) and IDLE (Idle line detected) pending bits are cleared by + * software sequence: a read operation to USART_SR register + * (USART_GetITStatus()) followed by a read operation to USART_DR register + * (USART_ReceiveData()). + * - RXNE pending bit can be also cleared by a read to the USART_DR register + * (USART_ReceiveData()). + * - TC pending bit can be also cleared by software sequence: a read + * operation to USART_SR register (USART_GetITStatus()) followed by a write + * operation to USART_DR register (USART_SendData()). + * - TXE pending bit is cleared only by a write to the USART_DR register + * (USART_SendData()). + * @retval None + */ +void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT) +{ + uint16_t bitpos = 0x00, itmask = 0x00; + /* Check the parameters */ + assert_param(IS_USART_ALL_PERIPH(USARTx)); + assert_param(IS_USART_CLEAR_IT(USART_IT)); + /* The CTS interrupt is not available for UART4 and UART5 */ + if (USART_IT == USART_IT_CTS) + { + assert_param(IS_USART_123_PERIPH(USARTx)); + } + + bitpos = USART_IT >> 0x08; + itmask = ((uint16_t)0x01 << (uint16_t)bitpos); + USARTx->SR = (uint16_t)~itmask; +} +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c new file mode 100644 index 0000000..91137c3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c @@ -0,0 +1,222 @@ +/** + ****************************************************************************** + * @file stm32f10x_wwdg.c + * @author MCD Application Team + * @version V3.6.2 + * @date 17-September-2021 + * @brief This file provides all the WWDG firmware functions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2012 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x_wwdg.h" +#include "stm32f10x_rcc.h" + +/** @addtogroup STM32F10x_StdPeriph_Driver + * @{ + */ + +/** @defgroup WWDG + * @brief WWDG driver modules + * @{ + */ + +/** @defgroup WWDG_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @defgroup WWDG_Private_Defines + * @{ + */ + +/* ----------- WWDG registers bit address in the alias region ----------- */ +#define WWDG_OFFSET (WWDG_BASE - PERIPH_BASE) + +/* Alias word address of EWI bit */ +#define CFR_OFFSET (WWDG_OFFSET + 0x04) +#define EWI_BitNumber 0x09 +#define CFR_EWI_BB (PERIPH_BB_BASE + (CFR_OFFSET * 32) + (EWI_BitNumber * 4)) + +/* --------------------- WWDG registers bit mask ------------------------ */ + +/* CR register bit mask */ +#define CR_WDGA_Set ((uint32_t)0x00000080) + +/* CFR register bit mask */ +#define CFR_WDGTB_Mask ((uint32_t)0xFFFFFE7F) +#define CFR_W_Mask ((uint32_t)0xFFFFFF80) +#define BIT_Mask ((uint8_t)0x7F) + +/** + * @} + */ + +/** @defgroup WWDG_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @defgroup WWDG_Private_Variables + * @{ + */ + +/** + * @} + */ + +/** @defgroup WWDG_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @defgroup WWDG_Private_Functions + * @{ + */ + +/** + * @brief Deinitializes the WWDG peripheral registers to their default reset values. + * @param None + * @retval None + */ +void WWDG_DeInit(void) +{ + RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, ENABLE); + RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, DISABLE); +} + +/** + * @brief Sets the WWDG Prescaler. + * @param WWDG_Prescaler: specifies the WWDG Prescaler. + * This parameter can be one of the following values: + * @arg WWDG_Prescaler_1: WWDG counter clock = (PCLK1/4096)/1 + * @arg WWDG_Prescaler_2: WWDG counter clock = (PCLK1/4096)/2 + * @arg WWDG_Prescaler_4: WWDG counter clock = (PCLK1/4096)/4 + * @arg WWDG_Prescaler_8: WWDG counter clock = (PCLK1/4096)/8 + * @retval None + */ +void WWDG_SetPrescaler(uint32_t WWDG_Prescaler) +{ + uint32_t tmpreg = 0; + /* Check the parameters */ + assert_param(IS_WWDG_PRESCALER(WWDG_Prescaler)); + /* Clear WDGTB[1:0] bits */ + tmpreg = WWDG->CFR & CFR_WDGTB_Mask; + /* Set WDGTB[1:0] bits according to WWDG_Prescaler value */ + tmpreg |= WWDG_Prescaler; + /* Store the new value */ + WWDG->CFR = tmpreg; +} + +/** + * @brief Sets the WWDG window value. + * @param WindowValue: specifies the window value to be compared to the downcounter. + * This parameter value must be lower than 0x80. + * @retval None + */ +void WWDG_SetWindowValue(uint8_t WindowValue) +{ + __IO uint32_t tmpreg = 0; + + /* Check the parameters */ + assert_param(IS_WWDG_WINDOW_VALUE(WindowValue)); + /* Clear W[6:0] bits */ + + tmpreg = WWDG->CFR & CFR_W_Mask; + + /* Set W[6:0] bits according to WindowValue value */ + tmpreg |= WindowValue & (uint32_t) BIT_Mask; + + /* Store the new value */ + WWDG->CFR = tmpreg; +} + +/** + * @brief Enables the WWDG Early Wakeup interrupt(EWI). + * @param None + * @retval None + */ +void WWDG_EnableIT(void) +{ + *(__IO uint32_t *) CFR_EWI_BB = (uint32_t)ENABLE; +} + +/** + * @brief Sets the WWDG counter value. + * @param Counter: specifies the watchdog counter value. + * This parameter must be a number between 0x40 and 0x7F. + * @retval None + */ +void WWDG_SetCounter(uint8_t Counter) +{ + /* Check the parameters */ + assert_param(IS_WWDG_COUNTER(Counter)); + /* Write to T[6:0] bits to configure the counter value, no need to do + a read-modify-write; writing a 0 to WDGA bit does nothing */ + WWDG->CR = Counter & BIT_Mask; +} + +/** + * @brief Enables WWDG and load the counter value. + * @param Counter: specifies the watchdog counter value. + * This parameter must be a number between 0x40 and 0x7F. + * @retval None + */ +void WWDG_Enable(uint8_t Counter) +{ + /* Check the parameters */ + assert_param(IS_WWDG_COUNTER(Counter)); + WWDG->CR = CR_WDGA_Set | Counter; +} + +/** + * @brief Checks whether the Early Wakeup interrupt flag is set or not. + * @param None + * @retval The new state of the Early Wakeup interrupt flag (SET or RESET) + */ +FlagStatus WWDG_GetFlagStatus(void) +{ + return (FlagStatus)(WWDG->SR); +} + +/** + * @brief Clears Early Wakeup interrupt flag. + * @param None + * @retval None + */ +void WWDG_ClearFlag(void) +{ + WWDG->SR = (uint32_t)RESET; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x.h new file mode 100644 index 0000000..2312819 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_conf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_conf.h new file mode 100644 index 0000000..a95acc4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_conf.h @@ -0,0 +1,75 @@ +/** + ****************************************************************************** + * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_conf.h + * @author MCD Application Team + * @version V3.6.0 + * @date 20-September-2021 + * @brief Library configuration file. + ****************************************************************************** + * @attention + * + * Copyright (c) 2011 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_CONF_H +#define __STM32F10x_CONF_H + +/* Includes ------------------------------------------------------------------*/ +/* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */ +#include "stm32f10x_adc.h" +#include "stm32f10x_bkp.h" +#include "stm32f10x_can.h" +#include "stm32f10x_cec.h" +#include "stm32f10x_crc.h" +#include "stm32f10x_dac.h" +#include "stm32f10x_dbgmcu.h" +#include "stm32f10x_dma.h" +#include "stm32f10x_exti.h" +#include "stm32f10x_flash.h" +#include "stm32f10x_fsmc.h" +#include "stm32f10x_gpio.h" +#include "stm32f10x_i2c.h" +#include "stm32f10x_iwdg.h" +#include "stm32f10x_pwr.h" +#include "stm32f10x_rcc.h" +#include "stm32f10x_rtc.h" +#include "stm32f10x_sdio.h" +#include "stm32f10x_spi.h" +#include "stm32f10x_tim.h" +#include "stm32f10x_usart.h" +#include "stm32f10x_wwdg.h" +#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Uncomment the line below to expanse the "assert_param" macro in the + Standard Peripheral Library drivers code */ +/* #define USE_FULL_ASSERT 1 */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT + +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function which reports + * the name of the source file and the source line number of the call + * that failed. If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0) +#endif /* USE_FULL_ASSERT */ + +#endif /* __STM32F10x_CONF_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.c new file mode 100644 index 0000000..16591e3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.h new file mode 100644 index 0000000..cb075d7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/stm32f10x_it.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.h + * @author MCD Application Team + * @version V3.6.0 + * @date 20-September-2021 + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + * Copyright (c) 2011 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F10x_IT_H +#define __STM32F10x_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f10x.h" + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F10x_IT_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.c new file mode 100644 index 0000000..d0ef55b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.h new file mode 100644 index 0000000..4665723 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/STM32_file/system_stm32f10x.h @@ -0,0 +1,96 @@ +/** + ****************************************************************************** + * @file system_stm32f10x.h + * @author MCD Application Team + * @version V3.5.1 + * @date 08-September-2021 + * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. + ****************************************************************************** + * @attention + * + * Copyright (c) 2011 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32f10x_system + * @{ + */ + +/** + * @brief Define to prevent recursive inclusion + */ +#ifndef __SYSTEM_STM32F10X_H +#define __SYSTEM_STM32F10X_H + +#ifdef __cplusplus + extern "C" { +#endif + +/** @addtogroup STM32F10x_System_Includes + * @{ + */ + +/** + * @} + */ + + +/** @addtogroup STM32F10x_System_Exported_types + * @{ + */ + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +/** + * @} + */ + +/** @addtogroup STM32F10x_System_Exported_Constants + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F10x_System_Exported_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F10x_System_Exported_Functions + * @{ + */ + +extern void SystemInit(void); +extern void SystemCoreClockUpdate(void); +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /*__SYSTEM_STM32F10X_H */ + +/** + * @} + */ + +/** + * @} + */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.c new file mode 100644 index 0000000..da62fb7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.c @@ -0,0 +1,182 @@ +#include "delay.h" +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ʹucos,ͷļ. +#if SYSTEM_SUPPORT_UCOS +#include "includes.h" //ucos ʹ +#endif +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEK STM32 +//ʹSysTickͨģʽӳٽй +//delay_us,delay_ms +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/2 +//汾V1.5 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +//******************************************************************************** +//V1.2޸˵ +//жеóѭĴ +//ֹʱ׼ȷ,do whileṹ! + +//V1.3޸˵ +//˶UCOSIIʱ֧. +//ʹucosII,delay_initԶSYSTICKֵ,ʹ֮ucosTICKS_PER_SECӦ. +//delay_msdelay_usҲucosĸ. +//delay_usucosʹ,׼ȷȺܸ,ҪûռöĶʱ. +//delay_msucos,ԵOSTimeDly,δucosʱ,delay_usʵ,Ӷ׼ȷʱ +//ʼ,ucos֮delay_msʱij,ѡOSTimeDlyʵֻdelay_usʵ. + +//V1.4޸˵ 20110929 +//޸ʹucos,ucosδʱ,delay_msж޷Ӧbug. +//V1.5޸˵ 20120902 +//delay_usucosֹucosdelay_usִУܵµʱ׼ +////////////////////////////////////////////////////////////////////////////////// +static u8 fac_us=0;//usʱ +static u16 fac_ms=0;//msʱ +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. +//systickжϷ,ʹucosʱõ +void SysTick_Handler(void) +{ + OSIntEnter(); //ж + OSTimeTick(); //ucosʱӷ + OSIntExit(); //лж +} +#endif + +//ʼӳٺ +//ʹucosʱ,˺ʼucosʱӽ +//SYSTICKʱӹ̶ΪHCLKʱӵ1/8 +//SYSCLK:ϵͳʱ +void delay_init() +{ + +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. + u32 reload; +#endif + SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8); //ѡⲿʱ HCLK/8 + fac_us=SystemCoreClock/8000000; //Ϊϵͳʱӵ1/8 + +#ifdef OS_CRITICAL_METHOD //OS_CRITICAL_METHOD,˵ʹucosII. + reload=SystemCoreClock/8000000; //ÿӵļ λΪK + reload*=1000000/OS_TICKS_PER_SEC;//OS_TICKS_PER_SEC趨ʱ + //reloadΪ24λĴ,ֵ:16777216,72M,Լ1.86s + fac_ms=1000/OS_TICKS_PER_SEC;//ucosʱٵλ + SysTick->CTRL|=SysTick_CTRL_TICKINT_Msk; //SYSTICKж + SysTick->LOAD=reload; //ÿ1/OS_TICKS_PER_SECжһ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk; //SYSTICK +#else + fac_ms=(u16)fac_us*1000;//ucos,ÿmsҪsystickʱ +#endif +} + +#ifdef OS_CRITICAL_METHOD //ʹucos +//ʱnus +//nusΪҪʱus. +void delay_us(u32 nus) +{ + u32 ticks; + u32 told,tnow,tcnt=0; + u32 reload=SysTick->LOAD; //LOADֵ + ticks=nus*fac_us; //ҪĽ + tcnt=0; + told=SysTick->VAL; //սʱļֵ + while(1) + { + tnow=SysTick->VAL; + if(tnow!=told) + { + if(tnow=ticks)break;//ʱ䳬/Ҫӳٵʱ,˳. + } + }; +} +//ʱnms +//nms:Ҫʱms +void delay_ms(u16 nms) +{ + if(OSRunning==TRUE)//osѾ + { + if(nms>=fac_ms)//ʱʱucosʱ + { + OSTimeDly(nms/fac_ms);//ucosʱ + } + nms%=fac_ms; //ucosѾ޷ṩôСʱ,ͨʽʱ + } + delay_us((u32)(nms*1000)); //ͨʽʱ,ʱucos޷. +} +#else//ucosʱ +//ʱnus +//nusΪҪʱus. +void delay_us(u32 nus) +{ + u32 temp; + SysTick->LOAD=nus*fac_us; //ʱ + SysTick->VAL=0x00; //ռ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk ; //ʼ + do + { + temp=SysTick->CTRL; + } + while(temp&0x01&&!(temp&(1<<16)));//ȴʱ䵽 + SysTick->CTRL&=~SysTick_CTRL_ENABLE_Msk; //رռ + SysTick->VAL =0X00; //ռ +} +//ʱnms +//עnmsķΧ +//SysTick->LOADΪ24λĴ,,ʱΪ: +//nms<=0xffffff*8*1000/SYSCLK +//SYSCLKλΪHz,nmsλΪms +//72M,nms<=1864 +void delay_ms(u16 nms) +{ + u32 temp; + SysTick->LOAD=(u32)nms*fac_ms;//ʱ(SysTick->LOADΪ24bit) + SysTick->VAL =0x00; //ռ + SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk ; //ʼ + do + { + temp=SysTick->CTRL; + } + while(temp&0x01&&!(temp&(1<<16)));//ȴʱ䵽 + SysTick->CTRL&=~SysTick_CTRL_ENABLE_Msk; //رռ + SysTick->VAL =0X00; //ռ +} +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.h new file mode 100644 index 0000000..f3101dd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/delay/delay.h @@ -0,0 +1,67 @@ +#ifndef __DELAY_H +#define __DELAY_H +#include "sys.h" +////////////////////////////////////////////////////////////////////////////////// +//ֻѧϰʹãδɣκ; +//ALIENTEK STM32 +//ʹSysTickͨģʽӳٽй +//delay_us,delay_ms +//ԭ@ALIENTEK +//̳:www.openedv.com +//޸:2012/9/2 +//汾V1.5 +//ȨУؾ +//Copyright(C) ӿƼ޹˾ 2009-2019 +//All rights reserved +//******************************************************************************** +//V1.2޸˵ +//жеóѭĴ +//ֹʱ׼ȷ,do whileṹ! + +//V1.3޸˵ +//˶UCOSIIʱ֧. +//ʹucosII,delay_initԶSYSTICKֵ,ʹ֮ucosTICKS_PER_SECӦ. +//delay_msdelay_usҲucosĸ. +//delay_usucosʹ,׼ȷȺܸ,ҪûռöĶʱ. +//delay_msucos,ԵOSTimeDly,δucosʱ,delay_usʵ,Ӷ׼ȷʱ +//ʼ,ucos֮delay_msʱij,ѡOSTimeDlyʵֻdelay_usʵ. + +//V1.4޸˵ 20110929 +//޸ʹucos,ucosδʱ,delay_msж޷Ӧbug. +//V1.5޸˵ 20120902 +//delay_usucosֹucosdelay_usִУܵµʱ׼ +////////////////////////////////////////////////////////////////////////////////// +void delay_init(void); +void delay_ms(u16 nms); +void delay_us(u32 nus); + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.c new file mode 100644 index 0000000..9751a52 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.h new file mode 100644 index 0000000..2a2154d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/sys/sys.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.c new file mode 100644 index 0000000..81f8ba6 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.h new file mode 100644 index 0000000..58b3f87 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/SYSTEM/usart/usart.h @@ -0,0 +1,298 @@ +#ifndef __USART_H +#define __USART_H +//#include +#include "stdio.h" +#include "sys.h" + +#define USART_REC_LEN 200 //ֽ 200 +#define EN_USART1_RX 1 //ʹܣ1/ֹ01 + +#define USART2_REC_LEN 254 // 250 //ֽ 200 +#define EN_USART2_RX 1 //ʹܣ1/ֹ02 + +#define USART3_REC_LEN 200 //ֽ 200 +#define EN_USART3_RX 1 //ʹܣ1/ֹ03 + +#define UART4_REC_LEN 200 //ֽ 200 +#define EN_UART4_RX 1 //ʹܣ1/ֹ04 + +#define UART5_REC_LEN 200 //ֽ 200 +#define EN_UART5_RX 1 //ʹܣ1/ֹ05 + +extern u8 USART_RX_BUF[USART_REC_LEN]; //ջ,USART_REC_LENֽ.ĩֽΪз +extern u16 USART_RX_STA; //״̬ +//봮жϽգ벻Ҫעº궨 + +extern u8 USART2_RX_BUF[USART2_REC_LEN]; //ջ,USART_REC_LENֽ.ĩֽΪз +extern u16 USART2_RX_STA; //״̬ +extern u8 USART2_RX_FLAG; +void RS232_Uart2_Write(uint8_t* buff, int length) ; +extern u8 USART3_RX_BUF[USART3_REC_LEN]; //ջ,USART_REC_LENֽ.ĩֽΪз +extern u16 USART3_RX_STA; //״̬ +extern u8 USART3_RX_FLAG; +extern u16 USART3_RX_LEN; +void RS232_Uart3_Write(uint8_t* buff, int length) ; + void RS232_Uart4_Write(uint8_t* buff, int length) ; + +extern u8 UART4_RX_BUF[UART4_REC_LEN]; //ջ,USART_REC_LENֽ.ĩֽΪз +extern u16 UART4_RX_STA; //״̬ +extern u8 UART4_RX_FLAG; +void RS232_Uart4_Write(uint8_t* buff, int length) ; + +extern u16 UART5_RX_STA; //״̬ +extern u8 UART5_RX_FLAG; +extern u16 UART5_RX_LEN; //ճ +extern u8 UART5_RX_BUF[UART5_REC_LEN]; //ջ,USART_REC_LENֽ. + +////extern u8 UpdToutCnt; + +void uart_init(u32 bound); +void uart2_init(u32 bound); +void uart3_init(u32 bound); +void uart4_init(u32 bound); +void uart5_init(u32 bound); + +void debugdataprocess(u8 *data,u16 len); +void Delupdtcnt(void); +u16 Getupdtcnt(void); + + +#include "stm32f10x.h" +#include + +#define MAX_PARAM 4 + +typedef struct { + uint8_t paranum; + uint8_t cmdlen; + uint8_t *cmd; + uint8_t *param[MAX_PARAM]; + uint8_t paramlen[MAX_PARAM]; +}SH_CMD; + + +typedef enum { + SHELL_USER, // û + SHELL_TEST, // Թ̼ + SHELL_RD, // з +} e_cmdtype; + + +typedef struct { + uint8_t shelltype; + char *command; + void (*cmdfunc)(void); +}SHELLMAP; + + +#define USART_BUFFER_SIZE 128 +#define USART_BUFFER_TX_SIZE 64 +typedef struct +{ + uint8_t Link_status; + uint8_t recvFlag; + uint8_t recvLength; + uint8_t sendLength; + uint8_t recvBuffer[USART_BUFFER_SIZE]; + uint8_t sendBuffer[USART_BUFFER_TX_SIZE]; +}UsartObj; + +void RS232_Blue_Write(uint8_t* buff, int length) ; +void Blue_Receive_Parser(void); + +void Blue_Query_Version(void); +void Blue_Connect_State(void); +void Blue_Name_Cfg(uint8_t *data); +void Blue_Name_Query(void); +void Blue_Query_UART_Cfg(void); + +typedef enum +{ + BLUE_IDLE = 0, + BLUE_CONFIG, + BLUE_PREPARE, + BLUE_LINK_STATUE, + BLUE_LINK_CONNECTING, + BLUE_LINK_CONNECTED, + BLUE_END + +}BLueProcessState; +typedef enum +{ + BLUE_REGISTERED= 0, + BLUE_LOGIN, + BLUE_WECHATAPPLET_ONLINE, + BLUE_WECHATAPPLET_OFFLINE, + BLUE_WECHATAPPLET_UPDATA, + BLUE_END_OVER + +}BLueDataProcessState; + +typedef struct +{ + uint8_t State; + uint8_t Link_status; + uint8_t ConnectServerState; + uint8_t *recvBuffer; + uint16_t recvLength; + uint16_t sendLength; + uint8_t *sendBuffer; + uint8_t connetcOvertimeFlag; + uint8_t ReciveDataOvertimeFlag; +}BlueManage_t; +void BluetoothProcess(void); +void BluetoothConnectProcess(void); +#define D_DP_FrameStart1 0xA5 /* ֡ͷ 1 */ +#define D_DP_FrameStart2 0x5A /* ֡ͷ 2 */ +#define D_DP_Device 0x20 //0x10 /* ַָдĴ */ +#define D_DP_CtrlRead 0x81 /* ַָĴ */ +#define D_DP_DataWirte 0x82 /* ַָʼдݴ洢 */ +#define D_DP_DataRead 0x83 /* ӱ洢ַָʼRD_LEN */ +#define D_DP_CurveWirte 0x84 /* д߻ */ +#pragma pack(1) +typedef struct +{ + uint16_t address; // Ĵַ + uint16_t len; + uint8_t device; + uint16_t cmd; + uint8_t ucDataSpace[350]; // // 128 512 + uint16_t crc; +} DP_FrameBluetooth_t; +#pragma pack() +typedef struct +{ + uint8_t addr; + uint8_t len; + uint8_t *param; + +}HMI_DW_BLUE; + +//ö +typedef enum +{ + BLUE_Registered = 0, + + //׮ + BLUE_Login, // + BLUE_BootNotification, + BLUE_DataTransfer_ChargeHost, //׮ݼ + BLUE_DiagnosticsStatusNotification, + BLUE_FirmwareStatusNotification, + BLUE_Heartbeat, + + BLUE_StartTransaction, + BLUE_StatusNotification, + BLUE_StopTransaction, + + + OCPP_CallError_Send + +}BLUE_SendHandleState; + +extern BlueManage_t BluetoothInfo; +extern uint8_t SocCalculateCharging(void); + + +typedef struct +{ + uint8_t paramaddr; + uint8_t paramlen; + uint8_t *paramData; + +}SysparamTable_t; + + + +/* bms0 Ϣ */ + #pragma pack (1) /*ָ1ֽڶ*/ + +typedef struct +{ + // byte 0-1-2 + uint16_t BattCellVoltage ; // 0.001V صѹ + uint8_t Celltemp ; //¶ +}cellbat_info_t; + + + +typedef union +{ + uint8_t stats[8]; + struct + { + + //byte0 // byte1 + uint16_t BatMaNegRlySts :2; //̵ + uint16_t BatMaPosRlySts :2; //ذ̵ + uint16_t BatPrechrgRlySts :2; //ذԤ̵״̬ + + uint16_t BatHvIntlkSts :2; //ذѹ + uint16_t BatFuSts:1; //ذ 0 1۶ + uint16_t BatHeRlySts:2; //ذȼ̵״̬ + uint16_t BatHeSts:2; //ذ״̬ + uint16_t Prechrgsts:1; //Ԥ״̬ + uint16_t reserve:2; + + + // byte3-4-5-6 + uint16_t Batfaultnum :16; //ϸ + uint16_t BatTalVolSts :16; // + + // byte7 + uint8_t BatAvgCelVolSts:2; //ذѹ澯 + uint8_t BatAvgTolVolSts:2; //ذѹ澯 + uint8_t BatChrgCurSts:1; //س״̬ + uint8_t BatDischrgCurSts:1; //ŵ + uint8_t BatIslateSts:1; //ذԵ + uint8_t BatInCANBsErrFlt:1; //can쳣 + // byte8 + uint8_t BatTempSensFlt:1;//ذ¶ + uint8_t BatCurSensFlt:1; //ذ + uint8_t BatCelVolSensFlt:1; //ѹ쳣 + uint8_t BalanceSts:2;// + + uint8_t reserv3:3; + }bits; +}bms_state_info_t; + + +typedef struct +{ + uint8_t BatManuSpecCode[4]; //Э䳵 + uint8_t BatManuversionNo[4]; //bmsЭ + uint32_t VehOdo ; //ʻ + uint8_t CDUType; //Ʒʹ + //Ϣ + uint16_t ChrgVolRqst ;//ѹ + uint16_t ChrgCurRqst ;// + uint16_t BatIslatRes ; //Եֵ k + uint8_t BatSOH ; + uint8_t BatSOC; + uint16_t BatEnrgAvail ; //ذʣ 0.1kw + uint16_t BatEnrgRated ; //ض 0.1kw + + uint16_t BatChrgTims; + uint8_t BatPlsChrgPowAvail; //繦Ч + uint8_t BatPlsDischrgPowAvail;//ŵ繦Ч + uint16_t BatVolRated ; //ضѹ 0.1V + //ڵ¶Ϣ صѹϢ + cellbat_info_t cellbat_data[40]; + //̵ּ״̬Ϣ + bms_state_info_t bms_state_info; + +}bmsblue_datainfo_t; + #pragma pack() + +extern bmsblue_datainfo_t bluebms_datainfo; +extern void BMS_UpdataACKInfo(void); +extern void BMS_VersionInfo(void); +extern void UpdataDebugInfoToServer(uint8_t *data,uint8_t len); +extern void BMS_ChargingDataInfo(void); + extern void bat_temp_Info(void); + +extern void bat_Cell_Vol_Info(void); + extern void bat_state_code(void); +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.c new file mode 100644 index 0000000..a80dda6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.c @@ -0,0 +1,190 @@ +#include "bootloader.h" + + +#if BOOTLOADER_CODE_FLAG +#include "stm32f10x_flash.h" + +const uint8_t BootloaderSwVersion[] = BOOTLOADER_SOFTWARE_VERSION; +#endif + +uint8_t updataflag = false; + + + +uint8_t Checksum(uint32_t address, uint32_t length) +{ + //uint32_t checksum = 0; + + return 1; + +} + + +typedef void (*pFunction)(void); +static pFunction Jump_To_Application; +static uint32_t JumpAddress = 0; + + +void BootloaderInit(void) +{ + +} + +void JumpToApplicationSW(void) +{ +#if BOOTLOADER_CODE_FLAG + + + __disable_irq();//ȫж + + + if (IsExternProgrammingRequestValid()) { + updataflag = true; + ClearExternProgrammingRequest(); + } else if (((*(__IO uint32_t *)APP_FlashBaseAddress) & 0x2FFE0000) == MCU_RAM_StartAddress) { + SetBootloaderSwVersionAddress(); + JumpAddress = *(__IO uint32_t *)(APP_FlashBaseAddress + 4); + Jump_To_Application = (pFunction) JumpAddress; + __set_MSP(*(__IO uint32_t *) APP_FlashBaseAddress); + Jump_To_Application(); + } + + __enable_irq(); +#endif +} + +#if BOOTLOADER_CODE_FLAG + +void RAMFLASHInit(void) +{ + +} + +status_t EraseApplicationSoftwareCode(uint32_t address, uint32_t length) +{ + status_t ret = STATUS_SUCCESS; + uint32_t page_address = 0; + + if (address % FMC_PAGE_SIZE) { + return STATUS_ERROR; + } + FLASH_Unlock(); + /* б־λ */ + FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); + page_address = address; + + while(page_address < address+length) + { + if(FLASH_COMPLETE != FLASH_ErasePage(page_address)) + { + ret = STATUS_ERROR; + break; + } + page_address += FMC_PAGE_SIZE; + } + + FLASH_Lock(); + return ret; +} + +status_t ProgramApplicationSoftware(uint32_t address, uint8_t *pdata, uint32_t length) +{ + status_t ret = STATUS_SUCCESS; + uint32_t program_address = 0; + + FLASH_Unlock(); + + /* б־λ */ + FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); + /* Program Flash Bank1 */ + program_address = address; + + while(program_address < (address + length)) + { + FLASH_ProgramWord(program_address, *(uint32_t *)pdata); + if (*(uint32_t*)program_address != *(uint32_t*)pdata) + { + ret = STATUS_ERROR; // У + break; + } + program_address += 4; + pdata += 4; + } + FLASH_Lock(); + + return ret; +} +#endif + +uint8_t GetUdsUpdataFlag(void) +{ + if (updataflag) { + updataflag = 0; + return 1; + } + + return 0; +} + + +void ClearExternProgrammingRequest(void) +{ + BKP->DR39 = 0x00; + BKP->DR40 = 0x00; +} + +void SetExternProgrammingRequest(void) +{ + BKP->DR39 = (uint16_t)(BOOTLOADER_PROGRAMMING_FLAG >> 0); + BKP->DR40 = (uint16_t)(BOOTLOADER_PROGRAMMING_FLAG >> 16); +} + + +bool IsExternProgrammingRequestValid(void) +{ + bool status = false; + uint32_t flag; + + flag = BKP->DR40; + flag = (flag << 16) | BKP->DR39; + + if (flag == BOOTLOADER_PROGRAMMING_FLAG) { + status = true; + } + + return status; +} + +#if BOOTLOADER_CODE_FLAG +void SetBootloaderSwVersionAddress(void) +{ + BKP->DR41 = (uint16_t)((uint32_t)BootloaderSwVersion >> 0); + BKP->DR42 = (uint16_t)((uint32_t)BootloaderSwVersion >> 16); +} +#endif + +uint32_t GetBootloaderSwVersionAddress(void) +{ + static uint32_t bl_sw_addr; + + bl_sw_addr = BKP->DR42; + bl_sw_addr = (bl_sw_addr << 16) | BKP->DR41; + return bl_sw_addr; +} + + + + + + + + + + + + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.h new file mode 100644 index 0000000..12c7da6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/bootloader.h @@ -0,0 +1,35 @@ +#ifndef __BOOTLOADER_H__ +#define __BOOTLOADER_H__ + + +#include "uds_config.h" + + +#define BOOTLOADER_PROGRAMMING_FLAG 0xAA55BA5C + + +typedef enum +{ + /* Generic error codes */ + STATUS_SUCCESS = 0x000U, /*!< Generic operation success status */ + STATUS_ERROR = 0x001U, /*!< Generic operation failure status */ + STATUS_BUSY = 0x002U, /*!< Generic operation busy status */ + STATUS_TIMEOUT = 0x003U, /*!< Generic operation timeout status */ +} status_t; + + +extern void JumpToApplicationSW(void); +extern status_t EraseApplicationSoftwareCode(uint32_t address, uint32_t length); +extern status_t ProgramApplicationSoftware(uint32_t address, uint8_t *pdata, uint32_t length); + +extern void BootloaderInit(void); +extern uint8_t GetUdsUpdataFlag(void); + +void ClearExternProgrammingRequest(void); +void SetExternProgrammingRequest(void); +void SetBootloaderSwVersionAddress(void); +uint32_t GetBootloaderSwVersionAddress(void); +bool IsExternProgrammingRequestValid(void); + + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.c new file mode 100644 index 0000000..078ff7a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.c @@ -0,0 +1,97 @@ +#include "crc.h" + + +const unsigned short crc16tab[256] = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, + 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, + 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, + 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, + 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, + 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, + 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, + 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, + 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, + 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, + 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, + 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, + 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, + 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, + 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, + 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, + 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, + 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, + 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, + 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, + 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, + 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, + 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 +}; + +/* Calculate checksum */ +void CalcCheckSum(uint32_t *sum, uint8_t *data, uint32_t size) +{ + int i; + for(i=0;i>8)^pData[i]; + *crc=(*crc<<8)^crc16tab[tmp]; + } +} + +uint32_t CRC_Cal16_WithCfg( const uint8_t *pData, uint32_t size) +{ + uint8_t cnt,temp; + uint16_t crc=0xFFFF; + uint16_t poly=0x8005; + + while(size) + { + size--; + temp = * pData++; + crc ^=temp<<8; + for( cnt=0; cnt<8; cnt++ ) + { + if(crc &0x8000){crc<<=1; crc^=poly;} + else crc<<=1; + } + } + return crc; + +} + +uint32_t CRC16_DataCheck( const u8 *pData, u32 size ) +{ + uint32_t CRCData; + uint32_t CRC16; + //polynome 0x8005 + CRC16 = CRC_Cal16_WithCfg((u8*)pData, size); + CRCData = (u16)(pData[size+1]<<8)|pData[size]; + + return (CRCData^CRC16); +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.h new file mode 100644 index 0000000..ba09bf4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/crc.h @@ -0,0 +1,17 @@ +#ifndef _CRC_H +#define _CRC_H + +#include "sys.h" + + +uint32_t crc32( uint8_t *buf, int len); //crc32 ʵֺ +uint32_t crc32MultSegment( uint8_t *seg1, int len1, uint8_t *seg2, int len2); +void CalcCheckSum(uint32_t *sum, uint8_t *data, uint32_t size); +void CRC16_CCITT_1021_Init(uint16_t *crc); +void CRC16_CCITT_1021_Update(uint16_t *crc, uint8_t *pData ,uint32_t len); +uint32_t CRC16_DataCheck( const u8 *pData, u32 size ); + + +#endif + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.c new file mode 100644 index 0000000..358f698 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.h new file mode 100644 index 0000000..3a2d56c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/diagnosis_mid.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_15765_2.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_15765_2.h new file mode 100644 index 0000000..2230497 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_15765_2.h @@ -0,0 +1,127 @@ +#ifndef TP_15765_2_H +#define TP_15765_2_H +/*! + * @file tp_15765_2.h + * @brief TP layer file according to the 15765-2. + * + */ + +#include "uds_types.h" + +#define FRAME_TYPE_MASK 0xF0 /*!< FRAME TYPE MASK */ +#define FLOW_STATUS_MASK 0x0F /*!< FLOW STATUS MASK */ +#define SEQUENCE_NUMBER_MASK 0x0F /*!< SEQUENCE NUMBER MASK */ +#define SINGLE_FRAME_DATA_LENGTH_MASK 0x0F /*!< SINGLE FRAME DATA LENGTH MASK */ +#define FIRST_FRAME_DATA_LENGTH_MSB_NIBBLE_MASK 0x0F /*!< FIRST FRAME DATA LENGTH MSB NIBBLE MASK */ +#define SEQUENCE_NUMBER_MAX 0x10 /*!< SEQUENCE NUMBER MAX */ +#define CAN_FRAME_BYTES_UPPER_RANGE 7 /*!< CAN FRAME BYTES UPPER RANGEK */ +#define ZERO_LOOP_COUNT 0 /*!< SEQUENCE NUMBER MASK */ +#define ONE_LOOP_COUNT 1 /*!< SEQUENCE NUMBER MASK */ +#define TWO_LOOP_COUNT 2 /*!< SEQUENCE NUMBER MASK */ + +#ifdef RX_MULTI_BUFFER_SUPPORT + #define RECEIVE_MULTI_BUFFER_SUPPORT TRUE +#else + #define RECEIVE_MULTI_BUFFER_SUPPORT FALSE +#endif + +/*! + * Enum Type. TP Layer State + */ +typedef enum TPState_Tag +{ + TP_Idle_State = 0, /*!< Idle State */ + TP_Wait_For_SFORFF_TxConf_State, /*!< Wait for TXConf State */ + TP_Wait_For_FCFrame_Rx_State, /*!< Wait for Flow Control State */ + TP_Transmit_CF_State, /*!< Transmit CF State */ + TP_Wait_For_CF_TxConf_State, /*!< Wait For CF TxConf State */ + TP_Wait_For_STmin_State, /*!< Wait For STmin State */ + TP_Wait_For_FC_TXconf_State, /*!< Wait For FC_TXconf State */ + TP_Rx_CF_State, /*!< Receive CF State */ + TP_Wait_For_DataRead_State /*!< Wait For DataRead State */ + }TPState_T; + +/*! + * Enum Type. Parameters + */ +typedef enum TPParameters_Tag +{ + N_BLOCKSIZE = 0, + N_SEPERATIONTIME +}TPParameters_T; + + +/*! + * Enum Type. Result for change parameter + */ +typedef enum TPResultChangePara_Tag +{ + N_OK_R = 0, + N_RX_ON, + N_WRONG_PARAMETER, + N_WRONG_VALUE +}TPResultChangePara_T; + +/*! + * Enum Type. Transmit sub state + */ +typedef enum TPTransmitSubState_Tag +{ + TP_TX_LOAD_CF_DATA = 0, + TP_TX_LOAD_REMAINING_BYTES_OF_CF, + TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF +}TPTransmitSubState_T; +/*! + * Enum Type. Receive sub state + */ +typedef enum TPReceiveSubState_Tag +{ + TP_RX_UNLOAD_CF_DATA = 0, + TP_RX_UNLOAD_REMAINING_BYTES_OF_CF, + TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF +}TPReceiveSubState_T; +/*! + * Enum Type. Transmit Status + */ +typedef enum TPTransmitStatus_Tag +{ + TP_TRANSMIT_IDLE = 0, + TP_TRANSMIT_START, + WAITINGFORFLOWCONTROL +}TPTransmitStatus_T; +/*! + * Enum Type. Receive Status + */ +typedef enum TPReceiveStatus_Tag +{ + TP_RECEIVE_IDLE = 0, + TP_RECEIVE_START +}TPReceiveStatus_T; +/*! + * Enum Type. Timer control + */ +typedef enum TPTimerControl_Tag +{ + TIMER_STOP = 0, + TIMER_RUN +}TPTimerControl_T; +/*! + * Enum Type. Flow control + */ +typedef enum TPFlowControlStatus_Tag +{ + CLEAR_TO_SEND = 0, + WAIT, + OVERFLOW, + RESERVED +}TPFlowControlStatus_T; +/*! + * Enum Type. Buffer Status + */ +typedef enum TPBufferStatus_Tag +{ + EMPTY = 0, + FILLED +}TPBufferStatus_T; + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_cca.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_cca.c new file mode 100644 index 0000000..2560e88 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_cca.c @@ -0,0 +1,1781 @@ +/*! + * @file tp_cca.c + * @brief TP layer file according to the 15765-2. + * + */ +#include "uds_config.h" + +/*! + * Macro. Minumum of the first frame data length + */ +#define MINIMUM_FIRST_FRAME_DATA_LENGTH 8 +/*! + * Macro. Dynamic tp para update enable + */ +#define DYNAMIC_TP_PARA_UPDATE_ENABLE 0 + +static uint8_t TP_Tx_Message_Status; /*!< Transmit Message Status */ +static uint8_t TP_Tx_Block_Size; /*!< Transmit Block Size */ +static uint8_t TP_Tx_Block_Size_Constant; /*!< Transmit Block Size Constant */ +static uint8_t TP_Tx_Separation_Time_Min_Constant; /*!< Min of Transmit Separation time constant */ +static uint8_t TP_Tx_Separation_Time_min; /*!< Min of Transmit Separation time */ +static uint8_t TP_Tx_Sequence_Number; /*!< Transmit sequence number */ +static uint8_t TP_Transmit_Sub_State; /*!< Transmit sub state */ +uint16_t TP_Tx_Message_DLC; /*!< Transmit Message DLC */ +static uint8_t TP_Tx_Frame_Type; /*!< Transmit Frame Type */ +static uint16_t TP_Tx_Index; /*!< Transmit Index */ +static uint8_t TP_Tx_Frame_DLC; /*!< Transmit Frame DLC */ +//static uint8_t TP_Transmit_Message_Number_Physical; /*!< Transmit transmit message physical number */ + +static uint8_t TP_Rx_Message_Status; /*!< Receive message Status */ +static uint16_t TP_Rx_Block_Size; /*!< Receive Block Size */ +//static uint16_t TP_Rx_Block_Size_Parameter; /*!< Receive Block size Parameter */ +//static uint8_t TP_Rx_Seperation_Time_Parameter; /*!< Receive Seperation Time Parameter */ +static uint8_t TP_Rx_Sequence_Number; /*!< Receive sequence number */ +static uint8_t TP_Receive_Sub_State; /*!< Receive sub state */ +static uint16_t TP_Rx_Message_DLC; /*!< Receive Message DLC */ +static uint8_t TP_Rx_Frame_Type; /*!< Receive Frame type */ +uint16_t TP_Rx_Index; /*!< Receive Index */ +static uint16_t TP_Rx_Frame_DLC; /*!< Receive Frame DLC */ +//static uint8_t TP_Receive_Message_Number_Physical; /*!< Receive Message Number Physical */ +//static uint8_t TP_Receivet_Message_Number_Functional; /*!< Receive Message Number Functional */ + uint16_t TP_Rx_Message_Length; /*!< Receive Message Length */ + +static uint16_t TPN_As_Timer; /*!< AS Timer */ +static uint16_t TPN_Ar_Timer; /*!< Ar Timer */ +static uint16_t TPN_Bs_Timer; /*!< Bs Timer */ +static uint16_t TPN_Cr_Timer; /*!< Cr Timer */ +static uint8_t TP_State; /*!< State of tp layer */ +static uint16_t TP_Data_Count; /*!< Data Count */ +static uint16_t TP_Next_Loop_Count; /*!< Next Loop Count */ +static uint8_t Flow_Status; /*!< Flow Status */ +static uint8_t TP_Result; /*!< Result */ +static uint8_t TP_Change_Parameter_Result; /*!< Change parameter Result */ +static uint8_t TP_Request_Type; /*!< Request type */ + +bool Frame_Tx_Complete; /*!< Frame transmit complete flag */ +static bool Frame_Available; /*!< Frame available flag */ + +static bool Load_Consecutive_Frame; /*!< Load CF flag */ + +static uint8_t TP_Tx_Buffer_Status; /*!< Tx Buffer Status */ +static uint8_t TP_Rx_Buffer_Status; /*!< Rx Buffer Status */ +static uint8_t TP_N_As_Timer_Control; /*!< As Timer Control */ +static uint8_t TP_N_Ar_Timer_Control; /*!< Ar Timer Control */ +static uint8_t TP_N_Bs_Timer_Control; /*!< Bs Timer Control */ +static uint8_t TP_N_Cr_Timer_Control; /*!< Cr Timer Control */ + +static bool Update_Tp_Parameter_Req = DYNAMIC_TP_PARA_UPDATE_ENABLE; +uint8_t TP_Buffer[TP_BUFFER_SIZE]; /*!< TP Buffer */ +//uint8_t TP_Tx_Buffer[TP_BUFFER_SIZE]; + +static uint8_t TP_Frame_Array[FRAME_DATA_SIZE]; /*!< Frame Buffer */ + +/* functions local to TP Module */ +static void TP_Transmit_Single_OR_First_Frame (void); +static void TP_Receive_Single_OR_First_Frame (void); +static void TP_Transmit_Consecutive_Frame (void); +static void TP_Receive_Consecutive_Frame (void); +static void TP_Check_Rx_Message_Length (void); +static void TP_Transmit_Flow_Control (void); +static void TP_Update_Timers (void); +static bool TP_Received_DLC_Check (void); +static uint8_t TP_STmin_Calculate (void); +static void TP_Idle_State_Process (void); +static void TP_Wait_For_SFORFF_TxConf_State_Process (void); +static void TP_Wait_For_FCFrame_Rx_State_Process (void); +static void TP_Transmit_CF_State_Process (void); +static void TP_Wait_For_CF_TxConf_State_Process (void); +static void TP_Wait_For_STmin_State_Process (void); +static void TP_Wait_For_FC_TXconf_State_Process (void); +static void TP_Rx_CF_State_Process (void); +static void TP_Wait_For_DataRead_State_Process (void); +static void TP_Tx_To_Idle_Init (uint8_t TP_Result); +static void TP_FC_Frame_Process (void); +static void TP_Rx_To_Idle_Init (uint8_t TP_Result); +static void TP_Transmit_Single_Frame (void); +static void TP_Transmit_First_Frame (void); +static void TP_Receive_Single_Frame (void); +static void TP_Receive_First_Frame (void); +static void TP_Tx_Load_CF_Data_Process (void); +static void TP_Tx_Load_Remaining_Bytes_OF_CF_Process (void); +static void TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process (void); +static void TP_Load_TL_Buffer_Start_NAs_Timer (void); +static void TP_Update_SN_and_BS (void); +static void TP_Tx_CF_Data_Process (void); +static void TP_Tx_Last_CF_Data_Process (void); +static void TP_Rx_Unload_CF_Data_Process (void); +static void TP_Rx_Unload_Remaining_Bytes_OF_CF_Process (void); +static void TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process (void); +static void TP_Rx_CF_Data_Process (void); +static void TP_Rx_Last_CF_Data_Process (void); + +/*! + * @brief TP_Init + * Read the message numbers from the TL config table, Initialize + * the state to idle, transmit and recieve status init, buffer status init, + * Timers disabling, loads the default value's of BS and STmin to + * variables. + */ +void TP_Init (void) +{ + /* Reads the Message number/Index from the TL config table */ +#ifdef TP_DIAG_PHYSICAL_MSG_SUPPORT + // TP_Transmit_Message_Number_Physical = 8; + // TP_Receive_Message_Number_Physical = 8; +#endif +#ifdef TP_DIAG_FUNCTIONAL_MSG_SUPPORT + // TP_Receivet_Message_Number_Functional = 8; +#endif + TP_State = TP_Idle_State; + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Tx_Buffer_Status = EMPTY; + TP_Rx_Buffer_Status = EMPTY; + Frame_Tx_Complete = false; +// Frame_Tx_Complete_Flag_For_Reset = false; + Frame_Available = false; + TP_N_As_Timer_Control = TIMER_STOP; + TP_N_Ar_Timer_Control = TIMER_STOP; + TP_N_Bs_Timer_Control = TIMER_STOP; + TP_N_Cr_Timer_Control = TIMER_STOP; + Flow_Status = CLEAR_TO_SEND; + /* default block size for receive. */ +// TP_Rx_Block_Size_Parameter = TP_RX_BLOCK_SIZE_MAX; + /* default STmin for receive. */ +// TP_Rx_Seperation_Time_Parameter = TP_RX_SEPARATION_TIME_MIN; + Load_Consecutive_Frame = false; +}/* End of TP_Init*/ +void TP_Task(void) +{ + //U32 context = hwi_disable_interrupts_savestate(); + switch (TP_State) + { + case TP_Idle_State: + TP_Idle_State_Process(); + break; + + case TP_Wait_For_SFORFF_TxConf_State: + TP_Wait_For_SFORFF_TxConf_State_Process(); + break; + + case TP_Wait_For_FCFrame_Rx_State: + TP_Wait_For_FCFrame_Rx_State_Process(); + break; + + case TP_Transmit_CF_State: + TP_Transmit_CF_State_Process(); + break; + + case TP_Wait_For_CF_TxConf_State: + TP_Wait_For_CF_TxConf_State_Process(); + break; + + case TP_Wait_For_STmin_State: + TP_Wait_For_STmin_State_Process(); + break; + + case TP_Wait_For_FC_TXconf_State: + TP_Wait_For_FC_TXconf_State_Process(); + break; + + case TP_Rx_CF_State: + TP_Rx_CF_State_Process(); + break; + + case TP_Wait_For_DataRead_State: + TP_Wait_For_DataRead_State_Process(); + break; + + default: + break; + } + + //hwi_restore_interrupts( context ); + +} +/*! + * @brief TP_Periodic_Task + * Main task which handles both transmit and receive portion of + * Network Layer + */ +void TP_Periodic_Task (void) +{ + TP_Update_Timers(); + TP_Task(); +}/* End of TP_Periodic_Task*/ +/*! + * @brief TP_Idle_State_Process + * This function handles TP_Idle_State + * + */ +static void TP_Idle_State_Process (void) +{ + if (Frame_Available == true) + { + Frame_Available = false; + TP_Receive_Single_OR_First_Frame(); + } +} +/*! + * @brief TP_Wait_For_SFORFF_TxConf_State_Process + * This function handles TP_Wait_For_SFORFF_TxConf_State + */ +static void TP_Wait_For_SFORFF_TxConf_State_Process (void) +{ + if (TPN_As_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (Frame_Tx_Complete == true) + { + Frame_Tx_Complete = false; + TP_N_As_Timer_Control = TIMER_STOP; + + if (TP_Tx_Frame_Type == SINGLE_FRAME) + { + TP_Result = N_OK; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (TP_Tx_Frame_Type == FIRST_FRAME) + { + Update_Tp_Parameter_Req = TRUE; + TP_State = TP_Wait_For_FCFrame_Rx_State; + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_FCFrame_Rx_State_Process + * This function handles TP_Wait_For_FCFrame_Rx_State + */ +static void TP_Wait_For_FCFrame_Rx_State_Process (void) +{ + uint8_t FlowControlStatus; + + if (TPN_Bs_Timer == 0) + { + TP_Result = N_TIMEOUTBs; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + + if (TP_Rx_Frame_Type == FLOW_CONTROL_FRAME) + { + TP_N_Bs_Timer_Control = TIMER_STOP; + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + TP_Tx_To_Idle_Init (TP_Result); + } + else + { + if (FlowControlStatus >= RESERVED) + { + TP_Result = N_INVALID_FS; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (FlowControlStatus == OVERFLOW) + { + TP_Result = N_BUFFER_OVFLW; + TP_Tx_To_Idle_Init (TP_Result); + } + else if (FlowControlStatus == WAIT) + { + if (N_WAIT_FRAME_TX_MAX == 0) + { + TP_Result = N_WFT_OVRN; + TP_Tx_To_Idle_Init (TP_Result); + } + + /* A count of 1 less is loaded as Bs timeout was exceeding max set */ + TPN_Bs_Timer = (N_Bs_TIMER_COUNT) - 1; + TP_N_Bs_Timer_Control = TIMER_RUN; + } + else if (FlowControlStatus == CLEAR_TO_SEND) + { + TP_FC_Frame_Process(); + } + else + { + /* do nothing */ + } + } + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Transmit_CF_State_Process + * This function handles TP_Transmit_CF_State + */ +static void TP_Transmit_CF_State_Process (void) +{ + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + TP_State = TP_Wait_For_CF_TxConf_State; + } +} +/*! + * @brief TP_Wait_For_CF_TxConf_State_Process + * This function handles TP_Wait_For_CF_TxConf_State + */ +static void TP_Wait_For_CF_TxConf_State_Process (void) +{ + if (TPN_As_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Tx_To_Idle_Init (TP_Result); + } + else if ( (Frame_Tx_Complete == true) || (Load_Consecutive_Frame == true)) + { + TP_N_As_Timer_Control = TIMER_STOP; + Frame_Tx_Complete = false; + + if (TP_Tx_Message_DLC == 0) + { + TP_Result = N_OK; + TP_Tx_To_Idle_Init (TP_Result); + } + else if ( (TP_Tx_Block_Size_Constant != 0) && (TP_Tx_Block_Size == 0)) + { + Update_Tp_Parameter_Req = DYNAMIC_TP_PARA_UPDATE_ENABLE; + TP_State = TP_Wait_For_FCFrame_Rx_State; + } + else if ( (TP_Tx_Separation_Time_Min_Constant == ZERO_LOOP_COUNT) || + (TP_Tx_Separation_Time_Min_Constant == ONE_LOOP_COUNT)) + { + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + Load_Consecutive_Frame = false; + } + else + { + Load_Consecutive_Frame = true; + } + } + else if (TP_Tx_Separation_Time_Min_Constant == TWO_LOOP_COUNT) + { + TP_State = TP_Transmit_CF_State; + } + else if (TP_Tx_Separation_Time_Min_Constant > TWO_LOOP_COUNT) + { + TP_Tx_Separation_Time_min--; + TP_State = TP_Wait_For_STmin_State; + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_STmin_State_Process + * This function handles TP_Wait_For_STmin_State + */ +static void TP_Wait_For_STmin_State_Process (void) +{ + TP_Tx_Separation_Time_min--; + + if (TP_Tx_Separation_Time_min <= 1) + { + TP_State = TP_Transmit_CF_State; + TP_Tx_Separation_Time_min = TP_Tx_Separation_Time_Min_Constant; + } +} +/*! + * @brief TP_Wait_For_FC_TXconf_State_Process + * This function handles TP_Wait_For_FC_TXconf_State + */ +static void TP_Wait_For_FC_TXconf_State_Process (void) +{ + if (Frame_Tx_Complete == true) + { + Frame_Tx_Complete = false; + TP_N_Ar_Timer_Control = TIMER_STOP; + TP_State = TP_Rx_CF_State; + TPN_Cr_Timer = N_Cr_TIMER_COUNT; + TP_N_Cr_Timer_Control = TIMER_RUN; + } + else if (TPN_Ar_Timer == 0) + { + TP_Result = N_TIMEOUT_A; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_CF_State_Process + * This function handles TP_Rx_CF_State + */ +static void TP_Rx_CF_State_Process (void) +{ + if (TPN_Cr_Timer == 0) + { + TP_Result = N_TIMEOUTCr; + TP_Rx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_N_Cr_Timer_Control = TIMER_STOP; + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + + if ( (TP_Rx_Frame_Type == SINGLE_FRAME) || + (TP_Rx_Frame_Type == FIRST_FRAME)) + { + TP_Result = N_UNEXP_PDU; + TP_Rx_To_Idle_Init (TP_Result); + TP_Receive_Single_OR_First_Frame(); + } + else if (TP_Rx_Frame_Type == CONSECUTIVE_FRAME) + { + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + if (TP_Rx_Sequence_Number == (TP_Frame_Array[0] & + SEQUENCE_NUMBER_MASK)) + { + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_Receive_Consecutive_Frame(); + TPN_Cr_Timer = N_Cr_TIMER_COUNT; + TP_N_Cr_Timer_Control = TIMER_RUN; + + if (TP_Receive_Sub_State == TP_RX_UNLOAD_CF_DATA) + { + TP_Check_Rx_Message_Length(); + } + } + else + { + TP_Result = N_WRONG_SN; + TP_Rx_To_Idle_Init (TP_Result); + } + } + } + else + { + /* do nothing */ + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Wait_For_DataRead_State_Process + * This function handles TP_Wait_For_DataRead_State + */ +static void TP_Wait_For_DataRead_State_Process (void) +{ + if (TPN_Cr_Timer == 0) + { + TP_Result = N_TIMEOUTCr; + TP_Rx_To_Idle_Init (TP_Result); + } + else if (Frame_Available == true) + { + Frame_Available = false; + TP_Result = TP_BUFFER_OVER_FLOW; + TP_Rx_To_Idle_Init (TP_Result); + } + else + { + TP_Receive_Consecutive_Frame(); + + if (TP_Receive_Sub_State == TP_RX_UNLOAD_CF_DATA) + { + TP_Check_Rx_Message_Length(); + } + } +} +/*! + * @brief TP_Tx_To_Idle_Init + * This function handles TP transmit variables initialization + * when transmit operation is completed suceesfully / unsuceesfully + * + * @param TP_Result TP Result + */ +static void TP_Tx_To_Idle_Init (uint8_t TP_Result) +{ + UCB_TP_N_USData_Confirm (TP_Result); + TP_State = TP_Idle_State; + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + TP_Tx_Buffer_Status = EMPTY; + Frame_Tx_Complete = false; +} +/*! + * @brief TP_FC_Frame_Process + * This function handles flow control parameter processing + */ +static void TP_FC_Frame_Process (void) +{ + if (Update_Tp_Parameter_Req) + { + TP_Tx_Block_Size_Constant = TP_Frame_Array[1]; + /* function to calcualte stmin */ + TP_Tx_Separation_Time_Min_Constant = + TP_STmin_Calculate(); + } + + TP_Tx_Block_Size = TP_Tx_Block_Size_Constant; + TP_Tx_Separation_Time_min = + TP_Tx_Separation_Time_Min_Constant; + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_Transmit_Consecutive_Frame(); + + if (TP_Transmit_Sub_State == TP_TX_LOAD_CF_DATA) + { + TP_State = TP_Wait_For_CF_TxConf_State; + } + else + { + TP_State = TP_Transmit_CF_State; + } +} +/*! + * @brief TP_Rx_To_Idle_Init + * This function handles TP receive variables initialization + * when receive operation is completed suceesfully / unsuceesfully + */ +static void TP_Rx_To_Idle_Init (uint8_t TP_Result) +{ + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + TP_State = TP_Idle_State; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Rx_Buffer_Status = EMPTY; +} +/*! + * @brief TP_Transmit_Single_OR_First_Frame + * This function handles transmission of 'single' or 'first' + * frame + */ +static void TP_Transmit_Single_OR_First_Frame (void) +{ + if (TP_Tx_Frame_Type == SINGLE_FRAME) + { + TP_Transmit_Single_Frame(); + } + else if (TP_Tx_Frame_Type == FIRST_FRAME) + { + TP_Transmit_First_Frame(); + } + else + { + /* do nothing */ + } + + /* for CF1 count starts with '1'. Becomes '0' if it reaches 16 */ + TP_Tx_Sequence_Number = 1; + /* TL API is called to set DLC */ + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + /* TL API is called to transmit a frame */ + TP_State = TP_Wait_For_SFORFF_TxConf_State; + TPN_As_Timer = N_As_TIMER_COUNT; + TP_N_As_Timer_Control = TIMER_RUN; +}/* End of TP_Transmit_Single_OR_First_Frame*/ +/*! + * @brief TP_Transmit_Single_Frame + * This function handles transmission of 'single' frame + */ +static void TP_Transmit_Single_Frame (void) +{ + uint8_t Frame_Array_Index, Data_Count ; + /* store N_PCI and message length in the first byte of Frame buffer */ + TP_Frame_Array[0] = (uint8_t) (SINGLE_FRAME | TP_Tx_Message_DLC); + Data_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= TP_Tx_Message_DLC; + Frame_Array_Index++) + { + /* copy the data bytes from TP buffer to frame buffer */ + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + Data_Count++; + } + + /* DLC of the frame to be transmitted: Data bytes + N_PCI */ + TP_Tx_Frame_DLC = (uint8_t) (TP_Tx_Message_DLC + 1); + + if (PADDING_OPERATION == true) + { + if (Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE) + { + /* padd the remaining space in the frame buffer */ + for (; Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE; + Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + /* DLC of the frame to be transmitted: DLC Max bytes */ + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + } +} +/*! + * @brief TP_Transmit_First_Frame + * This function handles transmission of 'first' frame + */ +static void TP_Transmit_First_Frame (void) +{ + uint8_t Frame_Array_Index; + /*store N_PCI and message length in the first and second byte of Frame buffer*/ + TP_Frame_Array[0] = (uint8_t) (FIRST_FRAME | ( (TP_Tx_Message_DLC & 0X0F00) >> 8)); + TP_Frame_Array[1] = (uint8_t) (TP_Tx_Message_DLC & 0X00FF); + + for (Frame_Array_Index = 2; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + /* DLC of the frame to be transmitted: DLC Max bytes */ + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; +} +/*! + * @brief TP_Receive_Single_OR_First_Frame + * This function handles reception of 'single' or 'first' frame + */ +static void TP_Receive_Single_OR_First_Frame (void) +{ + /* first byte: MSB Nibble indicates frame type :-N_PCI */ + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + TP_Rx_Index = 0; + TP_Request_Type = PHYSICAL_ADDRESS_TYPE; + + UdsService.FrameType=TP_Rx_Frame_Type; + + if (TP_Rx_Frame_Type == SINGLE_FRAME) + { + TP_Receive_Single_Frame(); + } + else if (TP_Rx_Frame_Type == FIRST_FRAME) + { + TP_Receive_First_Frame(); + } + else + { + /* do nothing */ + } +}/* End of TP_Receive_Single_OR_First_Frame*/ +/*! + * @brief TP_Receive_Single_Frame + * This function handles reception of 'single' frame + */ +static void TP_Receive_Single_Frame (void)//THT +{ + uint8_t Frame_Array_Index; + /* first byte: LSB Nibble indicates data length */ + TP_Rx_Message_DLC = TP_Frame_Array[0] & SINGLE_FRAME_DATA_LENGTH_MASK; + //UdsService.RxDlc = TP_Rx_Message_DLC; + for (Frame_Array_Index = 1; Frame_Array_Index <= TP_Rx_Message_DLC; + Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + } + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } +} +/*! + * @brief TP_Receive_First_Frame + * This function handles reception of 'first' frame + */ +static void TP_Receive_First_Frame (void) +{ + uint8_t Frame_Array_Index; + TP_Rx_Message_DLC = ( (uint16_t) ( (TP_Frame_Array[0] & + FIRST_FRAME_DATA_LENGTH_MSB_NIBBLE_MASK) << 8) | TP_Frame_Array[1]); + TP_Rx_Message_Length = TP_Rx_Message_DLC; + if ( (RECEIVE_MULTI_BUFFER_SUPPORT == false) && + (TP_Rx_Message_DLC > TP_BUFFER_SIZE)) + { + TP_Result = TP_RX_LENGTH_INVALID; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + Flow_Status = OVERFLOW; + TP_Transmit_Flow_Control(); + Flow_Status = CLEAR_TO_SEND; + TP_State = TP_Idle_State; + } + else + { + if (TP_Rx_Message_DLC >= MINIMUM_FIRST_FRAME_DATA_LENGTH) + { + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + for (Frame_Array_Index = 2; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Message_Length--; + TP_Rx_Index++; + } + + TP_Rx_Sequence_Number = 1; + /* User call back function to notify the first frame of multiframe message + arrival */ + UCB_TP_N_USData_FF_Indication (TP_Rx_Message_DLC); + TP_Rx_Message_Status = TP_RECEIVE_START; + /* After receiveing first frame this API is called to transmit flow control + frame */ + TP_Transmit_Flow_Control(); + } + } + } +} +/*! + * @brief TP_Transmit_Consecutive_Frame + * Handles the consecutive frame transmission with respect to + * total message length and the TP buffer + */ +static void TP_Transmit_Consecutive_Frame (void) +{ + switch (TP_Transmit_Sub_State) + { + case TP_TX_LOAD_CF_DATA: + TP_Tx_Load_CF_Data_Process(); + break; + + case TP_TX_LOAD_REMAINING_BYTES_OF_CF: + TP_Tx_Load_Remaining_Bytes_OF_CF_Process(); + break; + + case TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF: + TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process(); + break; + + default: + break; + }/* end of TP_Transmit_Sub_State switch */ +}/* End of TP_Transmit_Consecutive_Frame*/ +/*! + * @brief TP_Tx_Load_CF_Data_Process + * Handles the consecutive frame transmission with respect to + * total message length and the TP buffer + */ +static void TP_Tx_Load_CF_Data_Process (void) +{ + TP_Frame_Array[0] = CONSECUTIVE_FRAME | TP_Tx_Sequence_Number; + TP_Data_Count = TP_BUFFER_SIZE - TP_Tx_Index; + + if (TP_Tx_Message_DLC >= CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Tx_CF_Data_Process(); + } + else if (TP_Tx_Message_DLC < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Tx_Last_CF_Data_Process(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_CF_Data_Process + * Checks the data availability in TP buffer and loads the CF + * accordingly when CF is other than last CF + */ +static void TP_Tx_CF_Data_Process (void) +{ + uint8_t Frame_Array_Index; + + if (TP_Data_Count < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + TP_Next_Loop_Count++; + } + + TP_Transmit_Sub_State = TP_TX_LOAD_REMAINING_BYTES_OF_CF; + TP_Tx_Buffer_Status = EMPTY; + UCB_TP_Transmit_Buffer_Empty(); + TP_Tx_Index = 0; + } + else if (TP_Data_Count >= CONSECUTIVE_FRAME_DATA_BYTE) + { + for (Frame_Array_Index = 1; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_State = TP_Wait_For_CF_TxConf_State; + TP_Update_SN_and_BS(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_Last_CF_Data_Process + * Checks the data availability in TP buffer and loads the CF + * accordingly for last CF + */ +static void TP_Tx_Last_CF_Data_Process (void)//THT +{ + uint8_t Frame_Array_Index, Data_Count, TempLoopCount; + + if (TP_Data_Count >= TP_Tx_Message_DLC) + { + Data_Count = 1; + TempLoopCount = (uint8_t) TP_Tx_Message_DLC; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TempLoopCount; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + Data_Count++; + } + + TP_Tx_Frame_DLC = TempLoopCount; + + if (PADDING_OPERATION == true) + { + for (; Data_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_State = TP_Wait_For_CF_TxConf_State; + } + else if (TP_Data_Count < TP_Tx_Message_DLC) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + TP_Next_Loop_Count++; + } + + TP_Transmit_Sub_State = TP_TX_LOAD_REMAINING_BYTES_OF_LAST_CF; + TP_Tx_Buffer_Status = EMPTY; + UCB_TP_Transmit_Buffer_Empty(); + TP_Tx_Index = 0; + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Tx_Load_Remaining_Bytes_OF_CF_Process + * Handles the consecutive frame transmission with respect to + * remaining bytes of CF + */ +static void TP_Tx_Load_Remaining_Bytes_OF_CF_Process (void) +{ + if (TP_Tx_Buffer_Status == FILLED) + { + for (; TP_Next_Loop_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; TP_Next_Loop_Count++) + { + TP_Frame_Array[TP_Next_Loop_Count] = TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_State = TP_Wait_For_CF_TxConf_State; + TP_Update_SN_and_BS(); + } +} +/*! + * @brief TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process + * Handles the consecutive frame transmission with respect to + * remaining bytes of last CF + */ +static void TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process (void) +{ + uint8_t Data_Count; + //uint8_t TempLoopCount; + + if (TP_Tx_Buffer_Status == FILLED) + { + Data_Count = (uint8_t) TP_Next_Loop_Count; + //TempLoopCount = (uint8_t) TP_Tx_Message_DLC; + TP_Tx_Frame_DLC = (uint8_t) (TP_Next_Loop_Count + TP_Tx_Message_DLC); + + for (; TP_Next_Loop_Count < TP_Tx_Frame_DLC + ; TP_Next_Loop_Count++) + { + TP_Frame_Array[TP_Next_Loop_Count] = + TP_Buffer[TP_Tx_Index]; + TP_Tx_Index++; + TP_Tx_Message_DLC--; + Data_Count++; + } + + if (PADDING_OPERATION == true) + { + for (; Data_Count <= CAN_FRAME_BYTES_UPPER_RANGE; + Data_Count++) + { + TP_Frame_Array[Data_Count] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + + TP_Load_TL_Buffer_Start_NAs_Timer(); + TP_Transmit_Sub_State = TP_TX_LOAD_CF_DATA; + TP_State = TP_Wait_For_CF_TxConf_State; + } +} +/*! + * @brief TP_Load_TL_Buffer_Start_NAs_Timer + * Loads the frame into TL s/w buffer and starts the NAs timer + * counter. + */ +static void TP_Load_TL_Buffer_Start_NAs_Timer (void) +{ + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + TPN_As_Timer = N_As_TIMER_COUNT; + TP_N_As_Timer_Control = TIMER_RUN; +} +/*! + * @brief TP_Update_SN_and_BS + * updates the sequence number and the block size parameters + */ +static void TP_Update_SN_and_BS (void) +{ + TP_Tx_Sequence_Number++; + + if (TP_Tx_Sequence_Number == SEQUENCE_NUMBER_MAX) + { + TP_Tx_Sequence_Number = 0; + } + + if (TP_Tx_Block_Size_Constant != 0) + { + TP_Tx_Block_Size--; + } +} +/*! + * @brief TP_Receive_Consecutive_Frame + * Handles the consecutive frame reception with respect to total + * message length and the TP buffer + */ +static void TP_Receive_Consecutive_Frame (void) +{ + switch (TP_Receive_Sub_State) + { + case TP_RX_UNLOAD_CF_DATA: + TP_Rx_Unload_CF_Data_Process(); + break; + + case TP_RX_UNLOAD_REMAINING_BYTES_OF_CF: + TP_Rx_Unload_Remaining_Bytes_OF_CF_Process(); + break; + + case TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF: + TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process(); + break; + + default: + break; + }/* end of TP_Receive_Sub_State switch */ +}/* End of TP_Receive_Consecutive_Frame */ +/*! + * @brief TP_Rx_Unload_CF_Data_Process + * Handles the consecutive frame reception with respect to total + * message length and the TP buffer + */ +static void TP_Rx_Unload_CF_Data_Process (void) +{ + TP_Data_Count = TP_BUFFER_SIZE - TP_Rx_Index; + + if (TP_Rx_Message_Length >= CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Rx_CF_Data_Process(); + } + else if (TP_Rx_Message_Length < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Rx_Last_CF_Data_Process(); + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_CF_Data_Process + * Checks the memory availability in TP buffer and unloads the CF + * accordingly when CF is other than last CF ( From TL to TP Buffer) + */ +static void TP_Rx_CF_Data_Process (void) +{ + uint8_t Frame_Array_Index; + + if (TP_Data_Count < CONSECUTIVE_FRAME_DATA_BYTE) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + TP_Next_Loop_Count++; + } + if(!TP_Rx_Message_Length) + { + UdsService.MultFrameComp=1; + } + TP_Receive_Sub_State = TP_RX_UNLOAD_REMAINING_BYTES_OF_CF; + TP_State = TP_Wait_For_DataRead_State; + TP_Rx_Buffer_Status = FILLED; +#ifdef RX_MULTI_BUFFER_SUPPORT + UCB_TP_Receive_Buffer_Filled(); +#endif + TP_Rx_Index = 0; + } + else if (TP_Data_Count >= CONSECUTIVE_FRAME_DATA_BYTE) + { + for (Frame_Array_Index = 1; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; // THT + } + if(!TP_Rx_Message_Length) + { + UdsService.MultFrameComp=1; + } + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_Last_CF_Data_Process + * Checks the memory availability in TP buffer and unloads the CF + * accordingly for last CF ( From TL to TP Buffer) + */ +static void TP_Rx_Last_CF_Data_Process (void) +{ + uint8_t TempLoopCount, Frame_Array_Index; + + if (TP_Data_Count >= TP_Rx_Message_Length) + { + TempLoopCount = (uint8_t) TP_Rx_Message_Length; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TempLoopCount; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + if(!TP_Rx_Message_Length)//THT + { + UdsService.MultFrameComp=1; + } + } + else if (TP_Data_Count < TP_Rx_Message_Length) + { + TP_Next_Loop_Count = 1; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Data_Count; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + TP_Next_Loop_Count++; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_REMAINING_BYTES_OF_LAST_CF; + TP_State = TP_Wait_For_DataRead_State; + TP_Rx_Buffer_Status = FILLED; +#ifdef RX_MULTI_BUFFER_SUPPORT + UCB_TP_Receive_Buffer_Filled(); +#endif + TP_Rx_Index = 0; + } + else + { + /* do nothing */ + } +} +/*! + * @brief TP_Rx_Unload_Remaining_Bytes_Of_CFProcess + * Handles the consecutive frame reception with respect to + * remaining bytes of CF + */ +static void TP_Rx_Unload_Remaining_Bytes_OF_CF_Process (void) +{ + if (TP_Rx_Buffer_Status == EMPTY) + { + for (; TP_Next_Loop_Count <= + CAN_FRAME_BYTES_UPPER_RANGE; TP_Next_Loop_Count++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[TP_Next_Loop_Count]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_State = TP_Rx_CF_State; + } +} +/*! + * @brief TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process + * Handles the consecutive frame reception with respect to + * remaining bytes of last CF + */ +static void TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process (void) +{ + uint8_t TempLoopCount; + //uint8_t Data_Count; + + if (TP_Rx_Buffer_Status == EMPTY) + { + // Data_Count = 0; + TempLoopCount = (uint8_t) TP_Rx_Message_Length; + + for (; TP_Next_Loop_Count <= + (TempLoopCount + 1); TP_Next_Loop_Count++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[TP_Next_Loop_Count]; + TP_Rx_Index++; + TP_Rx_Message_Length--; + } + + TP_Receive_Sub_State = TP_RX_UNLOAD_CF_DATA; + TP_State = TP_Rx_CF_State; + } +} +/*! + * @brief TP_Transmit_Buffer_Filled + * Sets the TP buffer to true state. After filling the buffer, + * application will call the function to indicate TP layer that buffer has + * been filled. + */ +void TP_Transmit_Buffer_Filled (void) +{ + TP_Tx_Buffer_Status = FILLED; +}/* End of TP_Transmit_Buffer_Filled*/ +/*! + * @brief TP_Receive_Buffer_Read + * Clears the TP buffer to false state. After emptying the buffer, + * application will call the function to indicate TP layer that buffer is + * emptied. + */ +void TP_Receive_Buffer_Read (void) +{ + TP_Rx_Buffer_Status = EMPTY; +}/* End of TP_Receive_Buffer_Read */ +/*! + * @brief TP_Check_Rx_Message_Length + * This API checks for the remaining length. If all the bytes are + * received it goes to idle stste. Otherwise it goes to a state to receive + * next CF + */ +static void TP_Check_Rx_Message_Length (void) +{ + if (TP_Rx_Message_Length == 0) + { + TP_N_Cr_Timer_Control = TIMER_STOP; + TP_State = TP_Idle_State; + TP_Rx_Message_Status = TP_RECEIVE_IDLE; + TP_Rx_Buffer_Status = EMPTY; + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + if (TP_RX_BLOCK_SIZE_MAX == 0) + { + TP_State = TP_Rx_CF_State; + } + else + { + TP_Rx_Block_Size--; + + if (TP_Rx_Block_Size == 0) + { + TP_Transmit_Flow_Control(); + TP_State = TP_Wait_For_FC_TXconf_State; + } + } + + TP_Rx_Sequence_Number++; + + if (TP_Rx_Sequence_Number == SEQUENCE_NUMBER_MAX) + { + TP_Rx_Sequence_Number = 0; + } + } +}/* End of TP_Check_Rx_Message_Length */ +/*! + * @brief TP_Transmit_Flow_Control + * This API is responsible for framing the flowcontrol message + * and transmitting to the transmitter using TL API's + */ +static void TP_Transmit_Flow_Control (void) +{ + uint8_t Frame_Array_Index; + /* frame a control-frame using modifiable parameters */ + /* store N_PCI and flow status, as first byte */ + TP_Frame_Array[0] = FLOW_CONTROL_FRAME | Flow_Status; + /* store ECU's BS parameter for receiving, as second byte */ + TP_Frame_Array[1] = TP_RX_BLOCK_SIZE_MAX; // 20190315 lbin + /* store ECU's STmin parameter for receiving, as third byte */ + TP_Frame_Array[2] = TP_RX_SEPARATION_TIME_MIN;//TP_Rx_Seperation_Time_Parameter; + /* store BS to another variable */ + TP_Rx_Block_Size = TP_RX_BLOCK_SIZE_MAX; + TP_Tx_Frame_DLC = FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE; + + if (PADDING_OPERATION == true) + { + for (Frame_Array_Index = 3; Frame_Array_Index <= + CAN_FRAME_BYTES_UPPER_RANGE; Frame_Array_Index++) + { + TP_Frame_Array[Frame_Array_Index] = PADDING_BYTE; + } + + TP_Tx_Frame_DLC = NW_DLC_MAX_BYTES; + } + HAL_UDS_Set_Tx_ID(0); + HAL_UDS_Set_Tx_DLC (TP_Tx_Frame_DLC); + HAL_UDS_Set_Tx_Buf (TP_Frame_Array); + TP_State = TP_Wait_For_FC_TXconf_State; + TPN_Ar_Timer = N_Ar_TIMER_COUNT; + TP_N_Ar_Timer_Control = TIMER_RUN; +}/* End of TP_Transmit_Flow_Control */ +/*! + * @brief TP_Received_DLC_Check + * This API checks for the received DLC.If the received DLC is + * less than the expected DLC it returns false. Otherwise it returns true. + */ +static bool TP_Received_DLC_Check (void) +{ + bool ReceivedDLCResult = false; + //uint8_t len=0; + switch (TP_Rx_Frame_Type)//THT + { + case SINGLE_FRAME: + //len = (TP_Rx_Message_DLC + SINGLE_FRAME_N_PCI_BYTE); + if (TP_Rx_Message_DLC != 0) + { + if (TP_Rx_Frame_DLC < (TP_Rx_Message_DLC + SINGLE_FRAME_N_PCI_BYTE)) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + break; + + case FIRST_FRAME: + if (TP_Rx_Frame_DLC < FIRST_FRAME_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + + break; + + case CONSECUTIVE_FRAME: + if (TP_Rx_Message_Length >= CONSECUTIVE_FRAME_DATA_BYTE) + { + if (TP_Rx_Frame_DLC < CONSECUTIVE_FRAME_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + else + { + if (TP_Rx_Frame_DLC < (TP_Rx_Message_Length + + CONSECUTIVE_FRAME_N_PCI_BYTE)) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + } + + break; + + case FLOW_CONTROL_FRAME: + if (TP_Rx_Frame_DLC < FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE) + { + ReceivedDLCResult = false; + } + else + { + ReceivedDLCResult = true; + } + + break; + + default: + break; + } + + return (ReceivedDLCResult); +}/* End of TP_Received_DLC_Check */ +/*! + * @brief TP_Update_Timers + * If the timers are enabled, timercount for each timer is + * decremented. Timers are: N_As, N_Ar, N_Bs and N_Cr + */ +static void TP_Update_Timers (void) +{ + if (TP_N_As_Timer_Control == TIMER_RUN) + { + if (TPN_As_Timer > 0) + { + TPN_As_Timer--; + } + else + { + // _P101 = 0x00; TBD-PVD : Timer needs to be identified. + } + } + + if (TP_N_Ar_Timer_Control == TIMER_RUN) + { + if (TPN_Ar_Timer > 0) + { + TPN_Ar_Timer--; + } + } + + if (TP_N_Bs_Timer_Control == TIMER_RUN) + { + if (TPN_Bs_Timer > 0) + { + TPN_Bs_Timer--; + } + } + + if (TP_N_Cr_Timer_Control == TIMER_RUN) + { + if (TPN_Cr_Timer > 0) + { + TPN_Cr_Timer--; + } + } +}/* End of TP_Update_Timers */ +/*! + * @brief TP_GetBufferSize + * User calls this API to get the size of the buffer. + * decremented. Timers are: N_As, N_Ar, N_Bs and N_Cr + * + * @return TP Buffer size + */ +uint16_t TP_Get_Message_Buffer_Size (void) +{ + return (TP_BUFFER_SIZE); /* size of the TP_Buffer as configured in the + config file */ +}/* End of TP_Get_Message_Buffer_Size */ +/*! + * @brief TP_GetBufferPointer + * User calls this API to get the pointer(address)of the + * TP_Buffer. + * + * @return Address of the TP buffer + */ + +uint8_t *TP_Get_Message_Buffer_Pointer (void) +{ + //memset(TP_Tx_Buffer,0x0,TP_BUFFER_SIZE); + // memcpy(TP_Tx_Buffer,TP_Buffer,TP_BUFFER_SIZE); + // memset(TP_Buffer,0x0,TP_BUFFER_SIZE); + return (TP_Buffer); /* returns the starting address of the TP buffer */ +}/* End of TP_Get_Message_Buffer_Pointer */ +/*! + * @brief TP_Get_Request_Type + * User calls this API to get the type of + * request(physical/functional). + * + * @return Address of the TP buffer + */ +uint8_t TP_Get_Request_Type (void) +{ + return (TP_Request_Type); /* returns the type of request */ +}/* End of TP_Get_Request_Type */ +/*! + * @brief TP_N_USData_Request + * User calls this API to transmit a message. It passes the length + * of the message to be transmitted. + * + * @param TPTransmitMessageLength Transmit message length + */ +void TP_N_USData_Request (uint16_t TPTransmitMessageLength) +{ + TP_Tx_Message_DLC = TPTransmitMessageLength; + + if (TP_Tx_Message_DLC <= MAXIMUM_SINGLE_FRAME_DATA_BYTE) + { + TP_Tx_Frame_Type = SINGLE_FRAME; + } + else + { + TP_Tx_Frame_Type = FIRST_FRAME; + } + + TP_Tx_Message_Status = TP_TRANSMIT_START; + TP_Tx_Index = 0; + + if (TP_Tx_Buffer_Status == FILLED) + { + TP_Transmit_Single_OR_First_Frame(); + } + else + { + TP_Result = TP_BUFFER_NOT_FILLED; + UCB_TP_N_USData_Confirm (TP_Result); + TP_Tx_Message_Status = TP_TRANSMIT_IDLE; + } + +}/* End of TP_N_USData_Request */ +/*! + * @brief TP_D_UUData_Confirm + * This is a callback function called by TL after transmitting + * a message corresponding to TP. Flag is set to inform the TP about frame + * transmission completion. + * + */ +void TP_D_UUData_Confirm (void) +{ + Frame_Tx_Complete = true; + TP_N_As_Timer_Control = TIMER_STOP; + + if ( (TP_State == TP_Wait_For_SFORFF_TxConf_State) && + (TP_Tx_Frame_Type == FIRST_FRAME)) + { + UCB_TP_N_USData_FF_Confirmation(); + } + + if ( ( (TP_State == TP_Wait_For_SFORFF_TxConf_State) && + (TP_Tx_Frame_Type == FIRST_FRAME)) || + ( (TP_Tx_Block_Size_Constant != 0) && (TP_Tx_Block_Size == 0))) + { + TPN_Bs_Timer = N_Bs_TIMER_COUNT; + TP_N_Bs_Timer_Control = TIMER_RUN; + TP_Tx_Message_Status = WAITINGFORFLOWCONTROL; + } + + if ( ( (TP_Tx_Message_Status == TP_TRANSMIT_START) && + (TP_Tx_Separation_Time_Min_Constant == 0)) || + (SINGLE_FRAME == TP_Tx_Frame_Type) || + ( (TP_State == TP_Wait_For_CF_TxConf_State) && (0 == TP_Tx_Message_DLC))) + { + /* to transmit 2nd CF onwards if stmin =0......*/ + /* to handle next request within loop time of response */ + TP_Task(); + } + + if ( (TP_Rx_Message_Status == TP_RECEIVE_START) && + (TP_State == TP_Wait_For_FC_TXconf_State)) + { + /* to notify flow control tx so that cf's can be received(any time)*/ + TP_Task(); + } +}/* End of TP_D_UUData_Confirm */ +/*! + * @brief TP_D_UUData_Indication_Physical + * This is a callback function called by TL after receiving + * a message(Physical) corresponding to TP. If the ECU is transmitting, + * and if it receives a frame it is ignored. Flag is set to inform the TP about + * frame arrival.Data is copied from the software buffer to TP's Frame buffer. + * + */ +bool TpRxFlg=false; +uint8_t g_ucTpRxStatusCnt; +void TP_D_UUData_Indication_Physical (void) +{ + //uint8_t Frame_Array_Index; + uint8_t FlowControlStatus; + + if (TP_Tx_Message_Status != TP_TRANSMIT_START) + { + Frame_Available = true; + TP_Rx_Frame_DLC = HAL_UDS_Rx_DLC(); + HAL_UDS_Get_Buf(TP_Frame_Array); + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if ( (TP_Tx_Message_Status == WAITINGFORFLOWCONTROL) && + (FlowControlStatus == CLEAR_TO_SEND)) + { + TP_Tx_Message_Status = TP_TRANSMIT_START; + } + + if ( (TP_Rx_Message_Status == TP_RECEIVE_START)) + { + TP_Task(); /* to receive cf's......*/ + } + g_ucTpRxStatusCnt=0; + TpRxFlg=true; + UdsService.PhyFlg = true; + //Debug("UDS REC:\r\n"); // + } + else + { + if(++g_ucTpRxStatusCnt>=2) + { + UDS_Service_Init(); + TP_Init(); + //TP_Rx_To_Idle_Init(TP_Result); + //Debug("UDS g_ucTpRxStatusCnt:\r\n"); + g_ucTpRxStatusCnt=0; + TP_Tx_Message_Status=TP_TRANSMIT_IDLE; + TP_State =TP_Idle_State; + HAL_Response_Pocessing = false; + } + } +}/* End of TP_D_UUData_Indication_Physical */ +#ifdef TP_DIAG_FUNCTIONAL_MSG_SUPPORT +/*! + * @brief TP_D_UUData_Indication_Functional + * This is a callback function called by TL after receiving + * a message(functional) corresponding to TP. If the ECU is transmitting, + * and if it receives a frame it is ignored. Flag is set to inform the TP about + * frame arrival. Data is copied from the software buffer to TP's Frame buffer + */ +void TP_D_UUData_Indication_Functional (void) +{ + // uint8_t *ReceivedMessageAddress; + uint8_t Frame_Array_Index; + uint8_t FlowControlStatus; + + if (TP_Tx_Message_Status != TP_TRANSMIT_START) //if ((TP_Tx_Message_Status == TP_TRANSMIT_IDLE)||(TP_Tx_Message_Status != TP_TRANSMIT_START)) + { + if ((UdsService.PhyFlg == true) && (TP_Rx_Message_Status == TP_RECEIVE_START)) { + return; + } + TP_Rx_Frame_DLC = HAL_UDS_Rx_DLC(); + HAL_UDS_Get_Buf(TP_Frame_Array); + TP_Rx_Frame_Type = TP_Frame_Array[0] & FRAME_TYPE_MASK; + TP_Rx_Index = 0; + UdsService.RxDlc = TP_Rx_Message_DLC; + + UdsService.PhyFlg = false; + FlowControlStatus = TP_Frame_Array[0] & FLOW_STATUS_MASK; + + if ( (TP_Tx_Message_Status == WAITINGFORFLOWCONTROL) && + (FlowControlStatus == CLEAR_TO_SEND)) + { + TP_Tx_Message_Status = TP_TRANSMIT_START; + } + if ( (TP_Rx_Message_Status == TP_RECEIVE_START)) + { + TP_Task(); /* to receive cf's......*/ + } + + if (TP_Rx_Frame_Type == SINGLE_FRAME) + { + TP_Rx_Message_DLC = TP_Frame_Array[0] & + SINGLE_FRAME_DATA_LENGTH_MASK; + + for (Frame_Array_Index = 1; Frame_Array_Index <= + TP_Rx_Message_DLC; Frame_Array_Index++) + { + TP_Buffer[TP_Rx_Index] = TP_Frame_Array[Frame_Array_Index]; + TP_Rx_Index++; + } + + if (false == TP_Received_DLC_Check()) + { + TP_Result = N_WRONG_DLC; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + else + { + TP_Request_Type = FUNCTIONAL_ADDRESS_TYPE; + TP_Result = N_OK; + UCB_TP_N_USData_Indication (TP_Rx_Message_DLC, TP_Result); + } + } + } +}/* End of TP_D_UUData_Indication_Functional */ +#endif +/*! + * @brief TP_N_Change_Parameters_Request + * This API is called by user to change the parameter values of + * the parameters BlockSize and the Minimum SeparationTime + * + * @param Parameter Parameter + * @param ParameterValue Parameter Value + */ +void TP_N_Change_Parameters_Request (uint8_t Parameter, uint16_t ParameterValue) +{ + /* if it is in the multiframe receive mode, change is not permitted */ + if (TP_Rx_Message_Status != TP_RECEIVE_START) + { + switch (Parameter) + { + case N_BLOCKSIZE: + if ((ParameterValue <= 0xff)) + { +// TP_Rx_Block_Size_Parameter = (uint8_t) ParameterValue; + TP_Change_Parameter_Result = N_OK_R; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + else + { + TP_Change_Parameter_Result = N_WRONG_VALUE; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + + break; + + case N_SEPERATIONTIME: + if ((ParameterValue <= 0xff)) + { +// TP_Rx_Seperation_Time_Parameter = (uint8_t) ParameterValue; + TP_Change_Parameter_Result = N_OK_R; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + //Debug("TP_Rx_Seperation_Time_Parameter=%d",TP_Rx_Seperation_Time_Parameter); + } + else + { + TP_Change_Parameter_Result = N_WRONG_VALUE; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } + + break; + + default: + TP_Change_Parameter_Result = N_WRONG_PARAMETER; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + break; + } + } + else + { + TP_Change_Parameter_Result = N_RX_ON; + UCB_TP_N_Change_Parameter_Confirm (Parameter, + TP_Change_Parameter_Result); + } +}/* End of TP_N_Change_Parameters_Request */ +static uint8_t TP_STmin_Calculate (void) +{ + uint8_t TP_STmin_Result,TP_FC_STmin; + TP_FC_STmin = TP_Frame_Array[2]; + + if (TP_FC_STmin != 0) + { + if (TP_FC_STmin > 0x7F) + { + TP_FC_STmin = 0x7F; + } + + TP_STmin_Result = TP_FC_STmin / CALL_RATE_TP; + + TP_STmin_Result += 1; + + } + else + { + if (STmin_ZERO == CALL_RATE_TP) + { + TP_STmin_Result = 1; + } + else + { + TP_STmin_Result = 0; + } + } + + return (TP_STmin_Result); +}/*/TP_STmin_Calculate*/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_config.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_config.h new file mode 100644 index 0000000..6b76c13 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/tp_config.h @@ -0,0 +1,235 @@ +#ifndef TP_CONFIG_H +#define TP_CONFIG_H + +#include +#include +#include +#include "uds_config.h" +#include "uds_did.h" +#include "uds_dtc.h" +#include "uds_can_interface.h" +#include "diagnosis_mid.h" +#include "tp_15765_2.h" +#include "tp_config.h" +#include "uds_interface.h" +#include "uds_manage.h" +#include "uds_services.h" +#include "uds_types.h" + +/*! + * @file tp_config.h + * @brief TP layer file according to the 15765-2. + * + */ + +#include "uds_types.h" +// lbin_20190117 +#define CALL_RATE_TP 1 /*!< Call rate of the periodic task */ + +#define N_As_TIME_OUT 70 /*!< default value : max as per standard = 1000msec */ +#define N_Ar_TIME_OUT 70 /*!< default value : max as per standard = 1000msec */ +#define N_Bs_TIME_OUT 150 /*!< default value : max as per standard = 1000msec */ +#define N_Cr_TIME_OUT 150 /*!< default value : max as per standard = 1000msec */ + +#define N_As_TIMER_COUNT N_As_TIME_OUT/CALL_RATE_TP /*!< As TIMER COUNT*/ +#define N_Ar_TIMER_COUNT N_Ar_TIME_OUT/CALL_RATE_TP /*!< Ar TIMER COUNT */ +#define N_Bs_TIMER_COUNT N_Bs_TIME_OUT/CALL_RATE_TP /*!< Bs TIMER COUNT */ +#define N_Cr_TIMER_COUNT N_Cr_TIME_OUT/CALL_RATE_TP /*!< Cr TIMER COUNT */ + +#if (BOOTLOADER_CODE_FLAG == 0) +#define TP_RX_BLOCK_SIZE_MAX 0 /*!< default block size for receive. */ +#define TP_RX_SEPARATION_TIME_MIN 0 /*!< default STmin for receive. lbin */ +#else +#define TP_RX_BLOCK_SIZE_MAX 0 /*!< default block size for receive. */ +#define TP_RX_SEPARATION_TIME_MIN 0 /*!< default STmin for receive. lbin */ +#endif + + + +#define TP_BUFFER_SIZE 2050//255 /*!< TP buffer(common for both Rx & RX) size */ +#define FRAME_DATA_SIZE 8 /*!< Frame buffer size */ + +/*! + * Macro. Wait frame Transmit support: if 0 no wait frame tx supported + * otherwise configure max wait frame tx count + */ +#define N_WAIT_FRAME_TX_MAX 0 +/*! + * Macro. If the Padding is required select as 'TRUE'. Otherwise 'FALSE' + */ +#define PADDING_OPERATION true +/*! + * Macro. Default selected as -xaa; change it to required value + */ +#define PADDING_BYTE 0x00 +/* maximum dlc value for one CAN frame */ + +/* #define RX_MULTI_BUFFER_SUPPORT */ + +#define STmin_ZERO CALL_RATE_TP + +#define TP_DIAG_PHYSICAL_MSG_SUPPORT +#define TP_DIAG_FUNCTIONAL_MSG_SUPPORT + +/*! + * Macro. Max number of bytes + */ + +#define NW_DLC_MAX_BYTES 8 +/*! + * Macro. number of bytes to represent N_PCI in a sinlge frame + */ +#define SINGLE_FRAME_N_PCI_BYTE 1 +/*! + * Macro. maximum number of data bytes in a single frame + */ +#define MAXIMUM_SINGLE_FRAME_DATA_BYTE 7 +/*! + * Macro. Two N_PCI + six data bytes in a first frame + */ +#define FIRST_FRAME_N_PCI_PLUS_DATA_BYTE 8 +/*! + * Macro. maximum number of data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_N_PCI_BYTE 1 +/*! + * Macro. data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_DATA_BYTE 7 +/*! + * Macro. One N_PCI + seven data bytes in a consecutive frame + */ +#define CONSECUTIVE_FRAME_N_PCI_PLUS_DATA_BYTE 8 +/*! + * Macro. Three N_PCI bytes in a flow control frame + */ +#define FLOW_CONTROL_N_PCI_PLUS_DATA_BYTE 3 +/*! + * Enum Type. PCI Type + */ +typedef enum TPN_PCI_Type_Tag +{ + SINGLE_FRAME = 0x00, /*!< N_PCI type for single frame */ + FIRST_FRAME = 0x10, /*!< N_PCI type for first frame */ + CONSECUTIVE_FRAME = 0x20, /*!< N_PCI type for consecutive frame */ + FLOW_CONTROL_FRAME = 0x30 /*!< N_PCI type for flow control frame */ +}TPN_PCI_Type_T; +/*! + * Enum Type. TP Request Tpye + */ +typedef enum TPRequestTpye_Tag +{ + PHYSICAL_ADDRESS_TYPE = 0, /*!< PHYSICAL ADDRESS TYPE */ + FUNCTIONAL_ADDRESS_TYPE /*!< FUNCTIONAL ADDRESS TYPE */ +}TPRequestTpye_T; +/*! + * Enum Type. TP Result Tpye + */ +typedef enum TPResult_Tag +{ + N_OK = 0, /*!< Result OK */ + N_TIMEOUT_A, /*!< Timeout A */ + N_TIMEOUTBs, /*!< Timeout Bs */ + N_TIMEOUTCr, /*!< Timeout Cr */ + N_WRONG_SN, /*!< Wrong SN */ + N_INVALID_FS, /*!< Invaild FS */ + N_UNEXP_PDU, /*!< Unexpected PDU */ + N_WFT_OVRN, /*!< WFT Overrun */ + N_BUFFER_OVFLW, /*!< Buffer Overflow */ + N_WRONG_DLC, /*!< Wrong DLC */ + N_ERROR, /*!< ERROR */ + TP_BUFFER_OVER_FLOW, /*!< TP Buffer Overflow */ + TP_BUFFER_NOT_FILLED, /*!< TP BUFFER not filled */ + TP_RX_LENGTH_INVALID /*!< TP Invalid RX Length */ + } TPResult_T; +extern bool TpRxFlg; + +extern uint16_t TP_Rx_Message_Length; /*!< Receive Message Length */ +extern uint16_t TP_Rx_Index; +extern uint8_t TP_Buffer[TP_BUFFER_SIZE]; /*!< TP Buffer */ +extern void TP_Init( void ); +extern void TP_Periodic_Task( void ); +extern void TP_Transmit_Buffer_Filled(void); +extern void TP_Receive_Buffer_Read(void); +extern uint16_t TP_Get_Message_Buffer_Size(void); +extern uint8_t * TP_Get_Message_Buffer_Pointer(void); +extern uint8_t TP_Get_Request_Type(void); +extern void TP_N_USData_Request(uint16_t TPTransmitMessageLength); +extern void TP_N_Change_Parameters_Request(uint8_t Parameter, + uint16_t ParameterValue); +uint8_t *TP_Get_Tx_Message_Buffer_Pointer (void); + +extern void TP_D_UUData_Confirm(void); +extern void TP_D_UUData_Indication_Physical(void); +extern void TP_D_UUData_Indication_Functional(void); + +#define UCB_TP_Transmit_Buffer_Empty HAL_UDS_Transmit_Buffer_Empty +#ifdef RX_MULTI_BUFFER_SUPPORT +#define UCB_TP_Receive_Buffer_Filled DG_TP_Receive_Buffer_Filled +#endif +#define UCB_TP_N_USData_Confirm HAL_UDS_Response_Confirm +#define UCB_TP_N_USData_FF_Indication HAL_UDS_FF_Indication +#define UCB_TP_N_USData_Indication HAL_UDS_Indication +#define UCB_TP_N_Change_Parameter_Confirm HAL_UDS_Change_Parameter_Confirm +#define UCB_TP_N_USData_FF_Confirmation HAL_UDS_FF_Confirmation + + +extern void UCB_TP_Transmit_Buffer_Empty(void); +#ifdef RX_MULTI_BUFFER_SUPPORT +extern void UCB_TP_Receive_Buffer_Filled(void); +#endif +extern void UCB_TP_N_USData_Confirm(uint8_t N_Result); +extern void UCB_TP_N_USData_FF_Indication(uint16_t + TPReceivexMessageLength); +extern void UCB_TP_N_USData_Indication(uint16_t TPReceivexMessageLength, + uint8_t N_Result); +extern void UCB_TP_N_Change_Parameter_Confirm(uint8_t Parameter, + uint8_t ParameterChangeResult); +extern void UCB_TP_N_USData_FF_Confirmation(void); +void TP_Task(void); + +#endif +/*============================================================================*/ +/* CAN : Controller Area Network */ +/* DLC : Data Length Code (number of data bytes in a CAN message) */ +/* ID : Identifier */ +/* BS : Block Size */ +/* CF : Consecutive frame */ +/* confirm : Confirmation service primitive */ +/* ECU : Electronic Control Unit - generic term for any electronic control */ +/* unit */ +/* FC : Flow Control */ +/* FF : First frame */ +/* FF_DL : First frame data length */ +/* FS : Flow Status */ +/*indication : Indication service primitive */ +/* Mtype : Message Type */ +/*N : Network */ +/* N_AE : Network Address Extension */ +/* N_AI : Address Information */ +/* N_Ar : Network layer timing parameter Ar */ +/* N_As : Network layer timing parameter As */ +/* N_Br : Network layer timing parameter Br */ +/* N_Bs : Network layer timing parameter Bs */ +/* N_ChangeParameter : Network layer service name */ +/* N_Cr : Network layer timing parameter Cr */ +/* N_Cs : Network layer timing parameter Cs */ +/* N_Data : Network Data */ +/* N_PCI : Network Protocol Control Information */ +/* N_PCItype : Network Protocol Control Information Type */ +/* N_PDU : Network Protocol Data Unit */ +/* N_USData : Network layer Unacknowledged Segmented Data transfer service */ +/* name */ +/* NWL : Network Layer */ +/* request : Request service primitive */ +/* SF : Single frame */ +/* SF_DL : Single frame data length */ +/* SN : Sequence Number */ +/* STmin : Separation Time min. */ +/* N_As : Time for transmission of the CAN frame(anu N_PDU) on the sender side*/ +/* N_Ar : Time for transmission of the CAN frame(anu N_PDU) on the receiver */ +/*side */ +/* N_Bs : Time until reception of the next flow control N_PDU */ +/* N_Cr : Time until reception of the next consecutive frame N_PDU */ +/*============================================================================*/ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.c new file mode 100644 index 0000000..4553b05 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.h new file mode 100644 index 0000000..728b20b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_api.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.c new file mode 100644 index 0000000..be0162c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.h new file mode 100644 index 0000000..432b558 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_can_interface.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_config.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_config.h new file mode 100644 index 0000000..58f619d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_config.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.c new file mode 100644 index 0000000..be94475 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.c @@ -0,0 +1,68 @@ +#include "uds_did.h" +#include + +const uint16_t DIDOffset[] = { + DID_FOREACH(GENERATE_DID_OFFSETS) +}; + +const uint8_t DIDSize[] = { + DID_FOREACH(GENERATE_DID_SIZE) +}; + +const uint16_t DIDId[] = { + DID_FOREACH(GENERATE_DID_ID) +}; + +const uint8_t DIDIsStoreInFlashTable[] = { + DID_FOREACH(GENERATE_DID_STORE_FLAG) +}; + +const uint16_t DIDStoreInFlashOffset[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_OFFSETS) +}; + +const uint16_t DIDStoreInFlashSize[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_SIZE) +}; + +const uint16_t DIDStoreInFlashId[] = { + DID_FOREACH(GENERATE_DID_STORE_IN_FLASH_ID) +}; + + +uint8_t GetDIDIndexByID(uint16_t id) +{ + uint8_t ret = 0xFF; + uint8_t i; + + for( i = 0; i < sizeof(DIDId)/sizeof(uint16_t); i++) + { + if (DIDId[i] == id) + { + ret = i; + break; + } + } + + return ret; +} + + +uint8_t GetDIDStoreInFlashIndexByID(uint16_t id) +{ + uint8_t ret = 0xFF; + uint8_t i; + + for( i = 0; i < sizeof(DIDStoreInFlashId)/sizeof(uint16_t); i++) + { + if (DIDStoreInFlashId[i] == id) + { + ret = i; + break; + } + } + + return ret; +} + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.h new file mode 100644 index 0000000..b3c1f63 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_did.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_dtc.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_dtc.h new file mode 100644 index 0000000..e2f0cfe Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_dtc.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.c new file mode 100644 index 0000000..2fd31f2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.h new file mode 100644 index 0000000..4808d6c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_interface.h @@ -0,0 +1,216 @@ +/*! + * @file uds_interface.h + * @brief customized service sequence definition. Modify the file according to the requirements. + * + */ + + +#ifndef UDS_INTERFACE_H +#define UDS_INTERFACE_H + +#include "uds_types.h" + + + +#if BOOTLOADER_CODE_FLAG == 0 +#define UDS_SERVICE_FOREACH(func)\ +/*00*/ func(0x10,UDS_10_Service_Session_Control,0)\ +/*01*/ func(0x11,UDS_11_Service_Ecu_Reset,0)\ +/*02*/ func(0x14,UDS_14_Service_Clear_DTC,0)\ +/*03*/ func(0x19,UDS_19_Service_Read_DTC,0) \ +/*04*/ func(0x22,UDS_22_Service_Read_Data,0)\ +/*05*/ func(0x2E,UDS_2E_Service_Write_Data,1) \ +/*06*/ func(0x27,UDS_27_Service_Security_Access,0) \ +/*07*/ func(0x3E,UDS_3E_Service_Tester_Present,0) \ +/*08*/ func(0x31,UDS_31_Service_Routine_Ctrl,0) \ +/*09*/ func(0x28,UDS_28_Service_Communication_Control,0) \ +/*10*/ func(0x85,UDS_85_Service_Control_DTC,0) \ +/*12*/ func(0x7F,UDS_Service_NRC,0) + +#else +#define UDS_SERVICE_FOREACH(func)\ +/*00*/ func(0x10,UDS_10_Service_Session_Control,0)\ +/*01*/ func(0x11,UDS_11_Service_Ecu_Reset,0)\ +/*02*/ func(0x22,UDS_22_Service_Read_Data,0)\ +/*03*/ func(0x2E,UDS_2E_Service_Write_Data,1) \ +/*04*/ func(0x27,UDS_27_Service_Security_Access,0) \ +/*05*/ func(0x3E,UDS_3E_Service_Tester_Present,0) \ +/*06*/ func(0x31,UDS_31_Service_Routine_Ctrl,0) \ +/*07*/ func(0x28,UDS_28_Service_Communication_Control,0) \ +/*08*/ func(0x85,UDS_85_Service_Control_DTC,0) \ +/*09*/ func(0x34,UDS_34_Service_Request_Download,1) \ +/*10*/ func(0x36,UDS_36_Service_Transfer_Data,1) \ +/*11*/ func(0x37,UDS_37_Service_Transfer_Exit,0) \ +/*12*/ func(0x7F,UDS_Service_NRC,0) + + +#endif + +#define GENERATE_UDS_SERVICE_INDEX(sid,service,rx_end_flag) Index_Sid_##sid, +#define GENERATE_UDS_SERVICE_TABLE(sid,service,rx_end_flag) service, +#define GENERATE_UDS_SERVICE_ID(sid,name,rx_end_flag) sid , + + +typedef enum _UDS_SERVICE_INDEX { + UDS_SERVICE_FOREACH(GENERATE_UDS_SERVICE_INDEX) + UDS_SERVICE_NUM, +}UDS_SERVICE_INDEX; + + +typedef enum{ + _UDS_DEFAULT_SESSION=0x01, + _UDS_PROGRAM_SESSION=0x02, + _UDS_EXT_SESSION=0x03, +// _UDS_STD_DIAG_SESSION=0x81, +// _UDS_PRO_DIAG_SESSION=0x85, +// _UDS_EXT_DIAG_SESSION=0x90, +}UDS_SESSION; + +typedef enum { + DOWNLOAD_SEQUENCE_IDLE, + DOWNLOAD_SEQUENCE_34, + DOWNLOAD_SEQUENCE_36, + DOWNLOAD_SEQUENCE_37, +}DownloadSequenceType; + +#define UDS_UP_LEN (FMC_PAGE_SIZE) + +typedef struct +{ + bool start; /*!< Sequence start state */ + uint8_t index; /*!< Sequence index to be serviced */ +}UDS_Demo_Service_Ctrl_T; + +typedef struct{ + bool RxEraseFlg; + bool RxProgramFlag; + bool UpCompFlg; + bool UpChkProgIntegFlg; + bool UpModleFlg; + bool EraseMemoryFlg; + //bool SecureFlg; + //bool SecureSw; + uint8_t EraseMemorySts; + uint32_t OffSetAdd; + uint32_t EraseAddress; + uint32_t EraseLength; + uint16_t GetCrc; + uint16_t CalcCrc; + uint32_t dLen; + uint32_t StackTopAdr; + uint32_t checksum; +#if BOOTLOADER_CODE_FLAG + uint8_t Buf[UDS_UP_LEN]; +#endif + + bool RoutineEraseMemoryFlg; + bool RoutineChkProgIntegrityFlg; + bool RoutineChkProgIntegrityPass; + bool PrintFingerFlg; + bool RoutineEraseMemoryErr; + //uint16_t FlashDriverDlength; + uint8_t Sn; + uint32_t totalRecvLength; + DownloadSequenceType DownloadSeq; +}_UdsUpData; + +typedef struct{ + bool ResetMcuFlg; + bool UdsTxFlg; + bool UdsTxCompFlg; + bool KeyLockFlg; + bool PhyFlg; + bool TxCompFlg; + bool AlreadSendSeed; + bool StartFlg; + bool IsUdsFlg; + bool BattErrFlg; + bool HsCanErrFlg; + bool TypeVech; + bool UpDataFlg; + bool CanRxOkFlg; + bool BusOffNoSendFlg; + bool ChkProgPreconditionFlg; + bool Sid2FWaitResFlg; + uint8_t IOCP; + uint16_t IOCS; + uint8_t SwErrCnt; + uint8_t VersionMod; + uint8_t CheckDtc5S; + uint8_t DtcFlg; + uint8_t DtcErr; + uint8_t FrameType; + uint8_t RequestFlg; + uint8_t SessionDiagModel; + uint8_t RxSessionDiagModel; + uint8_t Id; + uint8_t RstTimer; + uint8_t MultFrameComp; + uint8_t SeedKeyIsOK; + uint8_t SeedKeyLevel; + uint8_t NcmDisRxAndTx; + uint8_t NmcmDisRxAndTx; + uint8_t EnRxAndTx0x29; + uint8_t DisDTCRecord; + uint8_t KeyErrCnt; + uint8_t KeyErrLockTimer; + uint8_t TxUdsChann; + uint8_t ReqCmdBuf[20]; + uint16_t SessionTimer;//ĬϻỰ£ʱתһʱصĬϻỰ + uint16_t RxDlc; + uint16_t RxMulDlc; + uint16_t TxTimerOut; + uint16_t RxBlockCnt; + uint16_t SwImageErrTimer; + uint16_t BusOffNoSendTimer; + uint16_t CanID; + uint16_t IoDid; + uint16_t Nrc78Timer; +}__UDSService; +extern uint8_t UDS_SeedKeyBuf[8]; +extern __UDSService UdsService; +extern _UdsUpData UdsUpData; +extern const uint8_t UDSsid[]; + +extern UDS_Demo_Service_Ctrl_T Service_Ctrl; +void GotoDefaultSession(void); +bool CheckIsBeyonSession(INT8U CurSession,INT8U SelfSession,INT8U Type); +bool CheckUdsDlcIsOk(INT16U RxDlc,INT16U rDlc); +bool CheckSubSidNeedPosResp(INT8U SubSID); +bool CheckIsKeyOk(void); +bool CanRxConStatus(void); +bool CheckIsSupportBootloaderRead_Sid22(uint16_t did); +bool CheckIsSupportSubFunc_Sid19(uint8_t sub); +bool CheckIsSupportSubFunc_Sid11(uint8_t sub); + + +/*! + * @brief Demo Service Function to start service sequencce + * This function is used to start service sequencce + */ +void UDS_Demo_Services_Start(void); +/*! + * @brief Demo Service Function to call the services in sequencce + * This function is used to call the services in sequencce + */ +void UDS_Demo_Services_Sequence(void); +/*! + * @brief Demo service function to calculate key according to seed. + * The function is used to calculate key according to seed. + * + * @param rsp_buf Response buf pointer + */ +void UDS_Demo_Calculate_Key(uint8_t* rsp_buf); +/*! + * @brief Demo Service Function for positive response callback + * This function is used for positive response callback + */ +void UDS_Pos_Response_Callback(void); +/*! + * @brief Demo Service Function for negtive response callback + * This function is used for negtive response callback + */ +void UDS_Neg_Response_Callback(void); + +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_manage.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_manage.c new file mode 100644 index 0000000..d38355e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_manage.c @@ -0,0 +1,312 @@ +/*! +* @file uds_manage.c +* @brief interaction layer between UDS service and TP layer. +* +*/ +#include "uds_config.h" + +static uint8_t HAL_UDS_Rx_Buffer[8]; /*!< UDS Receive Buffer */ +bool HAL_Response_Pocessing; /*!< UDS Response Processing */ +static uint8_t HAL_UDS_RECEIVE_LENGTH; /*!< UDS Receive Length */ +static uint8_t HAL_UDS_TRANSMIT_LENGTH; /*!< UDS Transmit Length */ +static uint32_t HAL_UDS_TRANSMIT_ID; /*!< UDS Transmit ID */ + +//extern flexcan_state_t canCom0_State[3]; +//flexcan_msgbuff_t recvBuff; +/*! + * @brief HAL_UDS_CallBack + * UDS Transmit and Receive interrupt callback + * + * @param instance instance + * @param eventType interrupt event type + * @param state flexCAN state + */ +/*! + * @brief HAL_UDS_Init + * Initialize function for CAN UDS + * + */ + +/*! + * @brief HAL_UDS_Rx_DLC + * Return the DLC of the Rx Msg + * + * @return the DLC of the Rx Msg + */ +uint8_t HAL_UDS_Rx_DLC(void) +{ + return HAL_UDS_RECEIVE_LENGTH; +} + +/*! + * @brief HAL_UDS_Get_Buf + * Copy the rx msg data from the temp buffer to appl_data_ptr + * + * @param appl_data_ptr pointer to the destination buffer + */ +void HAL_UDS_Get_Buf(uint8_t* appl_data_ptr) +{ + uint8_t index; + + for(index = 0;index (uint8_t*)NVM_ADDR_END) || (pImage < (uint8_t*)NVM_ADDR_STR)) { + return -1; + } + + if (pData) { + for (i = 0; i < Len; ++i) { + pImage[i] = pData[i]; + } + } + addr = pImage - (uint8_t *)&NvmImage + NVM_ADDRESS_START; + UdsApi_EE_WriteBytes(pImage, addr, Len); + return 0; +} + +int32_t uds_service_nvm_write(uint8_t *pImage, const uint8_t *pData, uint32_t Len, void (*pCbFn)(uint32_t)) +{ + int32_t result; + + result = nvm_write(pImage, pData, Len, pCbFn); + return result; +} + +void NVM_Init(void) +{ + UdsApi_EE_ReadBytes((uint8_t *)&NvmImage, NVM_ADDRESS_START, NVM_SIZE); +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_nvm.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_nvm.h new file mode 100644 index 0000000..fa15b03 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_nvm.h @@ -0,0 +1,57 @@ +#ifndef _UDS_NVM_H +#define _UDS_NVM_H + +#include "sys.h" +#include "uds_did.h" +#include "uds_dtc.h" + + + +#define NVM_SIZE (512u) +#define NVM_ADDR_STR ((u32)&NvmImage) +#define NVM_ADDR_END (NVM_ADDR_STR+NVM_SIZE) + +#define SIZE_UDS (NVM_SIZE) +#define NVM_IMAGE_DTC_ADDR ((uint8_t*)&NvmImage.UDS.DTCs) +#define NVM_IMAGE_DID_ADDR ((uint8_t*)&NvmImage.UDS.DIDs) + +#define NVM_ADDRESS_START 0 + + +typedef struct { + DTC_StatusType DTC_Status; +}DTCS_NvmType; + +typedef union +{ + struct { + DIDS_NvmType DIDs; + DTCS_NvmType DTCs; + uint8_t reverse; + }; + uint8_t UDS_Data[SIZE_UDS]; + +}NvmData_UDS_t; + +typedef union +{ + u8 D8[NVM_SIZE]; + u32 D32[NVM_SIZE>>2]; + + struct + { + NvmData_UDS_t UDS; + }; + +}NvmImage_t; + + +extern NvmImage_t NvmImage; +#define pNvmImage ((NvmImage_t *)&NvmImage) + +void NVM_Init(void); +int32_t uds_service_nvm_write(u8 *pImage, const u8 *pData, u32 Len, void (*pCbFn)(u32)); + + +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.c new file mode 100644 index 0000000..2da2eed Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.h new file mode 100644 index 0000000..51e8bb3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_services.h differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_types.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_types.h new file mode 100644 index 0000000..e74e068 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Firmware/UDS/uds_types.h @@ -0,0 +1,94 @@ + /*! + * @file uds_types.h + * @brief user defined types for UDS + * + */ + +#ifndef UDS_TYPES_H_ +#define UDS_TYPES_H_ + + + +//typedef signed char int8_t; +//typedef unsigned char uint8_t; + +typedef volatile signed char vint8_t; +typedef volatile unsigned char vuint8_t; + +//typedef signed short int16_t; +//typedef unsigned short uint16_t; +typedef volatile signed short vint16_t; +typedef volatile unsigned short vuint16_t; + +//typedef signed int int32_t; +//typedef unsigned int uint32_t; +typedef volatile signed int vint32_t; +typedef volatile unsigned int vuint32_t; + +typedef unsigned char BOOLEAN; +typedef unsigned char INT8U; +typedef signed char INT8S; +typedef unsigned short INT16U; +typedef signed short INT16S; +typedef unsigned int INT32U; +typedef signed int INT32S; +typedef unsigned long INT64U; +typedef signed long INT64S; + + +typedef unsigned char U8; +#define U8_DISP U8 +#define U8_CAL volatile const U8 +#define U8_MIN (0U) +#define U8_MAX (255U) + +typedef signed char S8; +#define S8_DISP S8 +#define S8_CAL volatile const S8 +#define S8_MIN (-128) +#define S8_MAX (127) + +typedef unsigned short int U16; +#define U16_DISP U16 +#define U16_CAL volatile const U16 +#define U16_MIN (0U) +#define U16_MAX (65535U) + +typedef signed short int S16; +#define S16_DISP S16 +#define S16_CAL volatile const S16 +#define S16_MIN (-32768) +#define S16_MAX (32767) + +typedef unsigned long U32; +#define U32_DISP U32 +#define U32_CAL volatile const U32 +#define U32_MIN (0UL) +#define U32_MAX (4294967295UL) + +typedef signed long S32; +#define S32_DISP S32 +#define S32_CAL volatile const S32 +#define S32_MIN (-2147483648L) +#define S32_MAX (2147483647L) + +#if 0 +typedef enum BOOL_TYPE_ +{ + FALSE = 0, + TRUE +} BOOL_TYPE; +#endif +typedef U8 UINT8; +//typedef U8 BYTE; +typedef U16 UINT16; +typedef U16 WORD; +typedef U32 UINT32; +typedef S32 INT32; + +#define LSB(WORD) (uint8_t)WORD +#define MSB(WORD) (uint8_t)(WORD>>8) +#define WORD(MSB,LSB) (uint16_t)(((uint16_t) MSB << 8) + LSB) + + +#endif /* UDS_TYPES_H_ */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewd new file mode 100644 index 0000000..71657e7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewd @@ -0,0 +1,5475 @@ + + + + 2 + + GD32F10X_CL + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + GD32F10X_MD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + GD32F10X_HD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + GD32F10X_XD + + ARM + + 1 + + C-SPY + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + CMSISDAP_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + IJET_ID + 2 + + 6 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + XDS100_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewp new file mode 100644 index 0000000..6b2f59e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewp @@ -0,0 +1,3936 @@ + + + + 2 + + GD32F10X_CL + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + GD32F10X_MD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + GD32F10X_HD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + GD32F10X_XD + + ARM + + 1 + + General + 3 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 16 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Application + + $PROJ_DIR$\..\gd32f10x_it.c + + + $PROJ_DIR$\..\main.c + + + $PROJ_DIR$\..\systick.c + + + + CMSIS + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + Peripherals + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + + + + Startup + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + GD32F10X_MD + GD32F10X_HD + GD32F10X_XD + + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + GD32F10X_CL + GD32F10X_MD + GD32F10X_XD + + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_md.s + + GD32F10X_CL + GD32F10X_HD + GD32F10X_XD + + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_xd.s + + GD32F10X_CL + GD32F10X_MD + GD32F10X_HD + + + + + Utilities + + $PROJ_DIR$\..\..\Utilities\gd32f10x_eval.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewt new file mode 100644 index 0000000..83619f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.ewt @@ -0,0 +1,4336 @@ + + + + 2 + + GD32F10X_CL + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + GD32F10X_MD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + GD32F10X_HD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + GD32F10X_XD + + ARM + + 1 + + C-STAT + 1 + + 1 + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Application + + $PROJ_DIR$\..\gd32f10x_it.c + + + $PROJ_DIR$\..\main.c + + + $PROJ_DIR$\..\systick.c + + + + CMSIS + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\system_gd32f10x.c + + + + Doc + + $PROJ_DIR$\..\readme.txt + + + + Peripherals + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + + + $PROJ_DIR$\..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + + + + Startup + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_cl.s + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_hd.s + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_md.s + + + $PROJ_DIR$\..\..\Firmware\CMSIS\GD\GD32F10x\Source\IAR\startup_gd32f10x_xd.s + + + + Utilities + + $PROJ_DIR$\..\..\Utilities\gd32f10x_eval.c + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.eww b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.eww new file mode 100644 index 0000000..e0fd14b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/IAR_project/Project.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\Project.ewp + + + + + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvgui.hedun2 b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvgui.hedun2 new file mode 100644 index 0000000..cc561ab --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvgui.hedun2 @@ -0,0 +1,1850 @@ + + + + -6.1 + +
### uVision Project, (C) Keil Software
+ + + + + + 38003 + Registers + 115 67 + + + 346 + Code Coverage + 770 160 + + + 204 + Performance Analyzer + 930 + + + + + + 1506 + Symbols + + 64 64 64 + + + 1936 + Watch 1 + + 200 133 133 + + + 1937 + Watch 2 + + 200 133 133 + + + 1935 + Call Stack + Locals + + 200 133 133 + + + 2506 + Trace Data + + 75 135 130 95 70 230 200 150 + + + 466 + Source Browser + 500 + 300 + + + + + + + + 1 + 1 + 0 + 0 + -1 + + + + + + + 44 + 2 + 3 + + -1 + -1 + + + -1 + -1 + + + 69 + 152 + 1379 + 882 + + + + 0 + + 60 + 010000000400000001000000010000000100000001000000000000000200000000000000010000000100000000000000280000002800000000000000 + + + + 0 + Build + + -1 + -1 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000004F00000070040000BC000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1005 + 1005 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD0000007C020000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 109 + 109 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD0000007C020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 1465 + 1465 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000A40100007004000011020000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1466 + 1466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1467 + 1467 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1468 + 1468 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1506 + 1506 + 0 + 0 + 0 + 0 + 32767 + 0 + 16384 + 0 + + 16 + B3030000660000006D040000D4000000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 1913 + 1913 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1935 + 1935 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 1936 + 1936 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 1937 + 1937 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 1939 + 1939 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1940 + 1940 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1941 + 1941 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1942 + 1942 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 195 + 195 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD0000007C020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 196 + 196 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD0000007C020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 197 + 197 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 00000000AD0200000006000006030000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 198 + 198 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 00000000900100007004000011020000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 199 + 199 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000B00200006D040000ED020000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 203 + 203 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C40000006300000070040000BC000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 204 + 204 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 221 + 221 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000000000000000000000000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 2506 + 2506 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B00300006300000070040000A0010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 2507 + 2507 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000A401000070040000FD010000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 343 + 343 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 346 + 346 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 35141 + 35141 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35824 + 35824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 35885 + 35885 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35886 + 35886 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35887 + 35887 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35888 + 35888 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35889 + 35889 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35890 + 35890 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35891 + 35891 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35892 + 35892 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35893 + 35893 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35894 + 35894 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35895 + 35895 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35896 + 35896 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35897 + 35897 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35898 + 35898 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35899 + 35899 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35900 + 35900 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35901 + 35901 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35902 + 35902 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35903 + 35903 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35904 + 35904 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35905 + 35905 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 38003 + 38003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000F8010000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 38007 + 38007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000AD0200007004000006030000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 436 + 436 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000B00200006D040000ED020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 437 + 437 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 440 + 440 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 463 + 463 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000B00200006D040000ED020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 466 + 466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000B00200006D040000ED020000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 470 + 470 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000006300000070040000BC000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 50000 + 50000 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50001 + 50001 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50002 + 50002 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50003 + 50003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50004 + 50004 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50005 + 50005 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50006 + 50006 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50007 + 50007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50008 + 50008 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50009 + 50009 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50010 + 50010 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50011 + 50011 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50012 + 50012 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50013 + 50013 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50014 + 50014 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50015 + 50015 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50016 + 50016 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50017 + 50017 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50018 + 50018 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50019 + 50019 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000016010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 59392 + 59392 + 1 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + 0000000000000000C40300001C000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59393 + 0 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000060300000006000019030000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59399 + 59399 + 1 + 0 + 0 + 0 + 32767 + 0 + 8192 + 1 + + 16 + 000000001C000000E701000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59400 + 59400 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 2 + + 16 + 00000000380000006F02000054000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 824 + 824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000E4010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 3317 + 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFC4000000BC00000070040000C0000000000000000100001004000000010000000000000000000000FFFFFFFF08000000CB00000057010000CC000000F08B00005A01000079070000D601000045890000FFFF02000B004354616262656450616E6500200000000000003C0000005300000074020000C0000000C40000004F00000070040000BC0000000000000040280046080000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFF0F53797374656D20416E616C797A657200000000D601000001000000FFFFFFFFFFFFFFFF104576656E742053746174697374696373000000004589000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFFAC0300004F000000B0030000A0010000000000000200001004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C30000018000400000000000003C00000053000000FC000000F1000000B00300004F00000070040000A001000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFFC00000004F000000C400000095020000010000000200001004000000010000000000000000000000FFFFFFFF05000000ED0300006D000000C3000000C400000073940000018000100000010000003C00000053000000FC000000F1000000000000004F000000C0000000950200000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73010000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7301000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657301000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273000000007394000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000000000000FFFFFFFFFFFFFFFF000000008C010000700400009001000000000000010000100400000001000000000000000000000000000000000000000000000001000000C6000000FFFFFFFF0F0000008F070000930700009407000095070000960700009007000091070000B5010000B801000038030000B9050000BA050000BB050000BC050000CB090000018000800000000000003C00000053000000FC000000F10000000000000090010000700400001102000000000000404100460F0000001343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF09554C494E4B706C7573000000003803000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFFFFFFFFFF0000000001000000000000000000000001000000FFFFFFFF38020000900100003C0200001102000000000000020000000400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF00000000950200000006000099020000010000000100001004000000010000000000000000000000FFFFFFFF06000000C5000000C7000000B4010000D2010000CF01000077940000018000800000010000003C0000005300000074020000C0000000000000009902000000060000060300000000000040820056060000000C4275696C64204F757470757401000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657300000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0E536F757263652042726F7773657200000000D201000001000000FFFFFFFFFFFFFFFF1346696E6420416C6C205265666572656E63657300000000CF01000001000000FFFFFFFFFFFFFFFF0742726F77736572000000007794000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000000000000000000 + + + 59392 + File + + 2577 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000400020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000004000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000004000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000004000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000004000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000400000000000000000000000000000000000001000000010000009600000002002050000000000A64656C61795F696E6974960000000000000014000A64656C61795F696E6974124E5649435F436F6E66696775726174696F6E085761697435307573145564734170695F45455F5772697465427974657309424B502D3E445234320F5564734170695F50617261496E69741D476574426F6F746C6F61646572537756657273696F6E416464726573730A424B505F4441544134310B424B505F444154415F343116626B705F646174615F72656769737465725F656E756D155564734170695F426F6F745377416464725F47657409424B502D3E445234310530784243550864656C61795F6D7304766F69640864656C61795F75730A656E746572536C65657006436F72746578115343425F5343525F534C454550444545500E72656769737465726564466C61670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000004001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000400160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000000000000010000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65FF7F0000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E1000000000000FFFFFFFF000100000000000000010000000000000001000000018001E1000000000000FFFFFFFF000100000000000000010000000000000001000000018003E1000000000000FFFFFFFF0001000000000000000100000000000000010000000180CD7F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF000000000000000000010000000000000001000000018023E1000000000000FFFFFFFF000100000000000000010000000000000001000000018022E1000000000000FFFFFFFF000100000000000000010000000000000001000000018025E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802BE1000000000000FFFFFFFF00010000000000000001000000000000000100000001802CE1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001807A8A000000000000FFFFFFFF00010000000000000001000000000000000100000001807B8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180D3B0000000000000FFFFFFFF000100000000000000010000000000000001000000018015B1000000000000FFFFFFFF0001000000000000000100000000000000010000000180F4B0000000000000FFFFFFFF000100000000000000010000000000000001000000018036B1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FF88000000000000FFFFFFFF0001000000000000000100000000000000010000000180FE88000000000000FFFFFFFF00010000000000000001000000000000000100000001800B81000000000000FFFFFFFF00010000000000000001000000000000000100000001800C81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180F088000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE7F000000000000FFFFFFFF000100000000000000010000000000000001000000018024E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800A81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802280000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C488000000000000FFFFFFFF0001000000000000000100000000000000010000000180C988000000000000FFFFFFFF0001000000000000000100000000000000010000000180C788000000000000FFFFFFFF0001000000000000000100000000000000010000000180C888000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180DD88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FB7F000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000000000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000000000C0000000000000000000000000000000001000000010000000180F4B00000000000000D000000000000000000000000000000000100000001000000018036B10000000000000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF880000000000000F0000000000000000000000000000000001000000010000000180FE880000000000001000000000000000000000000000000000010000000100000001800B810000000000001100000000000000000000000000000000010000000100000001800C810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F088000000000000130000000000000000000000000000000001000000010000000180EE7F00000000000014000000000000000000000000000000000100000001000000018024E10000000000001500000000000000000000000000000000010000000100000001800A810000000000001600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000180000000000000000000000000000000001000000010000000180C988000000000000190000000000000000000000000000000001000000010000000180C7880000000000001A0000000000000000000000000000000001000000010000000180C8880000000000001B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180DD880000000000001C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001D000000000000000000000000000000000100000001000000 + + + + 59399 + Build + + 1030 + 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000004001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000000000000100000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050000000000B47443332463130585F434C960000000000000004000B47443332463130585F434C0B47443332463130585F4D440B47443332463130585F48440B47443332463130585F5844000000000000000000000000000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64FF7F0000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000FFFFFFFF0001000000000000000100000000000000010000000180D07F000000000000FFFFFFFF00010000000000000001000000000000000100000001803080000000000000FFFFFFFF00010000000000000001000000000000000100000001809E8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D17F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001804C8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001806680000000000000FFFFFFFF0001000000000000000100000000000000010000000180EB88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180B08A000000000000FFFFFFFF0001000000000000000100000000000000010000000180A801000000000000FFFFFFFF00010000000000000001000000000000000100000001807202000000000000FFFFFFFF0001000000000000000100000000000000010000000180BE01000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000000000000000000000000000000000000001000000010000000180D07F00000000000001000000000000000000000000000000000100000001000000018030800000000000000200000000000000000000000000000000010000000100000001809E8A000000000000030000000000000000000000000000000001000000010000000180D17F0000000000000400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000000500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001806680000000000000060000000000000000000000000000000001000000010000000180EB880000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000080000000000000000000000000000000001000000010000000180B08A000000000000090000000000000000000000000000000001000000010000000180A8010000000000000A000000000000000000000000000000000100000001000000018072020000000000000B0000000000000000000000000000000001000000010000000180BE010000000000000C000000000000000000000000000000000100000001000000 + + + + 59400 + Debug + + 2373 + 00200000000000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000000002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000000000002D0000000000000000000000000000000001000000010000000180F07F0000000000002E0000000000000000000000000000000001000000010000000180E8880000000000003700000000000000000000000000000000010000000100000001803B010000000000002F0000000000000000000000000000000001000000010000000180BB8A00000000000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000000000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720100000000000000000000000100000001000000000000000000000001000000000013800F01000000000000320000000E4D656D6F72792057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000000000000330000000E53657269616C2057696E646F77730000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000000000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7201000000000000000000000001000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720100000000000000000000000100000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720100000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000000000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730100000000000000000000000100000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000000000000100000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F720100000000000000000000000100000001000000000000000000000001000000000000000000054465627567FF7F0000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801780000000000000FFFFFFFF00010000000000000001000000000000000100000001801D80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801A80000000000000FFFFFFFF00010000000000000001000000000000000100000001801B80000000000000FFFFFFFF0001000000000000000100000000000000010000000180E57F000000000000FFFFFFFF00010000000000000001000000000000000100000001801C80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800089000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180E48B000000000000FFFFFFFF0001000000000000000100000000000000010000000180F07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180E888000000000000FFFFFFFF00010000000000000001000000000000000100000001803B01000000000000FFFFFFFF0001000000000000000100000000000000010000000180BB8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D88B000000000000FFFFFFFF0001000000000000000100000000000000010000000180D28B000000000000FFFFFFFF00010000000000000001000000000000000100000001809307000000000000FFFFFFFF0001000000000000000100000000000000010000000180658A000000000000FFFFFFFF0001000000000000000100000000000000010000000180C18A000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE8B000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800189000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000000000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000000100000000000000000000000000000000010000000100000001801D800000000000000200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000000300000000000000000000000000000000010000000100000001801B80000000000000040000000000000000000000000000000001000000010000000180E57F0000000000000500000000000000000000000000000000010000000100000001801C800000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B000000000000080000000000000000000000000000000001000000010000000180F07F000000000000090000000000000000000000000000000001000000010000000180E8880000000000000A00000000000000000000000000000000010000000100000001803B010000000000000B0000000000000000000000000000000001000000010000000180BB8A0000000000000C0000000000000000000000000000000001000000010000000180D88B0000000000000D0000000000000000000000000000000001000000010000000180D28B0000000000000E000000000000000000000000000000000100000001000000018093070000000000000F0000000000000000000000000000000001000000010000000180658A000000000000100000000000000000000000000000000001000000010000000180C18A000000000000110000000000000000000000000000000001000000010000000180EE8B0000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180018900000000000013000000000000000000000000000000000100000001000000 + + + + 0 + 1536 + 864 + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvopt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvopt new file mode 100644 index 0000000..f245637 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvopt @@ -0,0 +1,1168 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + GD32F10X_CL + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGUARM + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + JL2CM3 + -U20080643 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F10x_CL -FS08000000 -FL040000) + + + + + + 0 + 1 + flag + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + GD32F10X_MD + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 0 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGUARM + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + JL2CM3 + -U20080643 -O14 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_MD -FS08000000 -FL020000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_MD -FL020000 -FS08000000 + + + + + + 0 + 1 + flag + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + GD32F10X_HD + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 0 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGUARM + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + JL2CM3 + -U20080643 -O14 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_HD -FS08000000 -FL080000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_HD -FL040000 -FS08000000 + + + + + + 0 + 1 + flag + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + GD32F10X_XD + 0x4 + ARM-ADS + + 8000000 + + 1 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 0 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGUARM + + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + JL2CM3 + -U20080643 -O14 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC800 -FN1 -FF0GD32F10x_XD -FS08000000 -FL0300000 + + + 0 + UL2CM3 + -O207 -S0 -C0 -FO7 -FN1 -FC800 -FD20000000 -FF0GD32F10x_XD -FL0300000 -FS08000000 + + + + + + 0 + 1 + flag + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\main.c + main.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\systick.c + systick.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + + + CMSIS + 0 + 0 + 0 + 0 + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\system_gd32f10x.c + system_gd32f10x.c + 0 + 0 + + + + + Peripherals + 0 + 0 + 0 + 0 + + 3 + 5 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + gd32f10x_bkp.c + 0 + 0 + + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + gd32f10x_crc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + gd32f10x_dac.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + gd32f10x_fwdgt.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + gd32f10x_rtc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + gd32f10x_wwdgt.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + gd32f10x_adc.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + gd32f10x_can.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + gd32f10x_dbg.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + gd32f10x_enet.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + gd32f10x_sdio.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 4 + 28 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + 4 + 29 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + 4 + 30 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_md.s + startup_gd32f10x_md.s + 0 + 0 + + + 4 + 31 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_xd.s + startup_gd32f10x_xd.s + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 5 + 32 + 1 + 0 + 0 + 0 + ..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Doc + 0 + 0 + 0 + 0 + + 6 + 33 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvproj b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvproj new file mode 100644 index 0000000..de09d13 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil4_project/Project.uvproj differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/EventRecorderStub.scvd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/EventRecorderStub.scvd new file mode 100644 index 0000000..4007c27 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/EventRecorderStub.scvd differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkLog.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkLog.txt new file mode 100644 index 0000000..3d32677 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkLog.txt differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkSettings.ini b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkSettings.ini new file mode 100644 index 0000000..39b6d05 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/JLinkSettings.ini @@ -0,0 +1,39 @@ +[BREAKPOINTS] +ForceImpTypeAny = 0 +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +MonModeVTableAddr = 0xFFFFFFFF +MonModeDebug = 0 +MaxNumAPs = 0 +LowPowerHandlingMode = 0 +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +CacheExcludeSize = 0x00 +CacheExcludeAddr = 0x00 +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 0 +Device="ARM7" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +RAMUsageLimit = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.57720 b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.57720 new file mode 100644 index 0000000..00cc0c0 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.57720 @@ -0,0 +1,3726 @@ + + + + -6.1 + +
### uVision Project, (C) Keil Software
+ + + + + + 38003 + Registers + 140 140 + + + 346 + Code Coverage + 770 160 + + + 204 + Performance Analyzer + 930 + + + + + + 1506 + Symbols + + 64 64 64 + + + 1936 + Watch 1 + + 200 133 133 + + + 1937 + Watch 2 + + 200 133 133 + + + 1935 + Call Stack + Locals + + 200 133 133 + + + 2506 + Trace Data + + 75 135 130 95 70 230 200 150 + + + 466 + Source Browser + 500 + 166 + + + + + + + + 0 + 0 + 0 + 50 + 16 + + + + + + + 44 + 2 + 3 + + -1 + -1 + + + -1 + -1 + + + 7 + 1 + 883 + 734 + + + + 0 + + 2091 + 0100000004000000010000000100000001000000010000000000000002000000000000000100000001000000000000002800000028000000010000000E000000060000000100000063443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C6D61696E2E6300000000066D61696E2E6300000000FFDC7800FFFFFFFF73443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C44433330305C64633330302E63000000000764633330302E6300000000BECEA100FFFFFFFF6F443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C4144435C6164632E6300000000056164632E6300000000F0A0A100FFFFFFFF6D443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C7379735C7379732E6300000000057379732E6300000000BCA8E100FFFFFFFF73443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C44433330305C64633330302E68000000000764633330302E68000000009CC1B600FFFFFFFF71443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C75736172745C75736172742E63000000000775736172742E6300000000F7B88600FFFFFFFF6F443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C63616E2E63000000000563616E2E6300000000D9ADC200FFFFFFFF6D443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C7379735C7379732E6800000000057379732E6800000000A5C2D700FFFFFFFF6F443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C63616E2E68000000000563616E2E6800000000B3A6BE00FFFFFFFF77443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C414453313031355C616473313031352E630000000009616473313031352E6300000000EAD6A300FFFFFFFF6A443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C5544535C7564735F6170692E6300000000097564735F6170692E6300000000F6FA7D00FFFFFFFF7F443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C4C4F57504F5745525C6170705F7077725F6D616E6167652E6300000000106170705F7077725F6D616E6167652E6300000000B5E99D00FFFFFFFF6F443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C4C45445C6C65642E6300000000056C65642E63000000005FC3CF00FFFFFFFF71443A5C776F726B5C70726F6A6563745F44435C71697275695C3830B0E6B1BE5C51523230355F3137305F53545F47445F38365C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C75736172745C75736172742E68000000000775736172742E6800000000C1838300FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD50001000000000000000200000026010000660000000006000035020000 + + + + 0 + Build + + -1 + -1 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000004F00000070040000BC000000 + + + 16 + C40000006600000070040000D3000000 + + + + 1005 + 1005 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000001F01000005020000 + + + 16 + 560000006D000000160100000B010000 + + + + 109 + 109 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000001F01000005020000 + + + 16 + 560000006D0000003901000024020000 + + + + 1465 + 1465 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1466 + 1466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1467 + 1467 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1468 + 1468 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1506 + 1506 + 0 + 0 + 0 + 0 + 32767 + 0 + 16384 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1913 + 1913 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1935 + 1935 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1936 + 1936 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1937 + 1937 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1939 + 1939 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1940 + 1940 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1941 + 1941 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1942 + 1942 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 195 + 195 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000001F01000005020000 + + + 16 + 560000006D0000003901000024020000 + + + + 196 + 196 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000001F01000005020000 + + + 16 + 560000006D0000003901000024020000 + + + + 197 + 197 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 198 + 198 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 00000000900100007004000011020000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 199 + 199 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 203 + 203 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 204 + 204 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 221 + 221 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000000000000000000000000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 2506 + 2506 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 2507 + 2507 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 343 + 343 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 346 + 346 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 35141 + 35141 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D000000160100000B010000 + + + + 35824 + 35824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 35885 + 35885 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35886 + 35886 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35887 + 35887 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35888 + 35888 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35889 + 35889 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35890 + 35890 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35891 + 35891 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35892 + 35892 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35893 + 35893 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35894 + 35894 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35895 + 35895 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35896 + 35896 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35897 + 35897 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35898 + 35898 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35899 + 35899 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35900 + 35900 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35901 + 35901 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35902 + 35902 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35903 + 35903 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35904 + 35904 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35905 + 35905 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 38003 + 38003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000001F01000005020000 + + + 16 + 560000006D0000003901000024020000 + + + + 38007 + 38007 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 436 + 436 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 437 + 437 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 440 + 440 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 463 + 463 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 466 + 466 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000039020000FD050000ED020000 + + + 16 + F4000000DC020000F4060000A0030000 + + + + 470 + 470 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 50000 + 50000 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50001 + 50001 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50002 + 50002 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50003 + 50003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50004 + 50004 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50005 + 50005 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50006 + 50006 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50007 + 50007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50008 + 50008 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50009 + 50009 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50010 + 50010 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50011 + 50011 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50012 + 50012 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50013 + 50013 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50014 + 50014 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50015 + 50015 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50016 + 50016 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50017 + 50017 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50018 + 50018 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50019 + 50019 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 59392 + 59392 + 1 + 0 + 0 + 0 + 953 + 0 + 8192 + 0 + + 16 + 0000000000000000C40300001C000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59393 + 0 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000060300000006000019030000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59399 + 59399 + 1 + 0 + 0 + 0 + 476 + 0 + 8192 + 1 + + 16 + 000000001C000000E701000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59400 + 59400 + 0 + 0 + 0 + 0 + 612 + 0 + 8192 + 2 + + 16 + 00000000380000006F02000054000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 824 + 824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 3337 + 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFC4000000BC00000070040000C0000000000000000100000004000000010000000000000000000000FFFFFFFF08000000CB00000057010000CC000000F08B00005A01000079070000D601000045890000FFFF02000B004354616262656450616E650020000000000000C40000006600000070040000D3000000C40000004F00000070040000BC0000000000000040280046080000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFF0F53797374656D20416E616C797A657200000000D601000001000000FFFFFFFFFFFFFFFF104576656E742053746174697374696373000000004589000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFFAC0300004F000000B0030000A0010000000000000200000004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C3000001800040000000000000B00300006600000070040000B7010000B00300004F00000070040000A001000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFF220100004F000000260100001E0200000100000002000010040000000100000006FFFFFFFB040000FFFFFFFF05000000ED0300006D000000C3000000C4000000739400000180001000000100000000000000660000002201000035020000000000004F000000220100001E0200000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73010000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7301000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657301000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273000000007394000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000000000000FFFFFFFFFFFFFFFF000000008C010000700400009001000000000000010000000400000001000000000000000000000000000000000000000000000001000000C6000000FFFFFFFF0F0000008F070000930700009407000095070000960700009007000091070000B5010000B801000038030000B9050000BA050000BB050000BC050000CB0900000180008000000000000000000000A701000070040000280200000000000090010000700400001102000000000000404100460F0000001343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF09554C494E4B706C7573000000003803000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFFFFFFFFFF0000000001000000000000000000000001000000FFFFFFFF38020000900100003C0200001102000000000000020000000400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF000000001E020000000600002202000001000000010000100400000001000000F6FDFFFFA200000000000000000000000000000001000000FFFFFFFF06000000C5000000C7000000B4010000D2010000CF01000077940000018000800000010000000000000039020000000600001D030000000000002202000000060000060300000000000040820056060000000C4275696C64204F757470757401000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657301000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0E536F757263652042726F7773657200000000D201000001000000FFFFFFFFFFFFFFFF1346696E6420416C6C205265666572656E63657300000000CF01000001000000FFFFFFFFFFFFFFFF0742726F77736572010000007794000001000000FFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000000000000000000 + + + 59392 + File + + 2723 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000004000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000004000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE80300000000000000000000000000000000000000000000000100000001000000960000000200205000000000186661756C745F6175785F756E6465725F766F6C745F65727296000000000000001400186661756C745F6175785F756E6465725F766F6C745F657272116661756C745F706F77657232345F65727213466463496E666F2E76696E5F766F6C746167650F6661756C745F74656D705F6F7665721473746F70436861726765526561736F6E203D20301573746F70436861726765526561736F6E203D3D20301473746F70436861726765526561736F6E203D20380D6661756C745F636F6D5F6363751473746F70436861726765526561736F6E203D20371573746F70436861726765526561736F6E203D2038371373746F70436861726765526561736F6E203D371073746F70436861726765526561736F6E19436865636B5169727569424D535761726E696E67537461746517436865636B5169727569424D534661756C7453746174651573746F70436861726765526561736F6E203D203839174D6F64756C65496E666F2E6661756C74636F6465203E30136661756C745F4261745F556E646572566F6C740B626D735F53656E644243531D426D735F4261744368617267655265616C4F6264426174437572534F430A75426174437572534F430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65B9030000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E1000000000000FFFFFFFF000100000000000000010000000000000001000000018001E1000000000000FFFFFFFF000100000000000000010000000000000001000000018003E1000000000000FFFFFFFF0001000000000000000100000000000000010000000180CD7F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF000000000000000000010000000000000001000000018023E1000000000000FFFFFFFF000100000000000000010000000000000001000000018022E1000000000000FFFFFFFF000100000000000000010000000000000001000000018025E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802BE1000000000000FFFFFFFF00010000000000000001000000000000000100000001802CE1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001807A8A000000000000FFFFFFFF00010000000000000001000000000000000100000001807B8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180D3B0000000000000FFFFFFFF000100000000000000010000000000000001000000018015B1000000000000FFFFFFFF0001000000000000000100000000000000010000000180F4B0000000000000FFFFFFFF000100000000000000010000000000000001000000018036B1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FF88000000000000FFFFFFFF0001000000000000000100000000000000010000000180FE88000000000000FFFFFFFF00010000000000000001000000000000000100000001800B81000000000000FFFFFFFF00010000000000000001000000000000000100000001800C81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180F088000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE7F000000000000FFFFFFFF000100000000000000010000000000000001000000018024E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800A81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802280000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C488000000000000FFFFFFFF0001000000000000000100000000000000010000000180C988000000000000FFFFFFFF0001000000000000000100000000000000010000000180C788000000000000FFFFFFFF0001000000000000000100000000000000010000000180C888000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180DD88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FB7F000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000000000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000000000C0000000000000000000000000000000001000000010000000180F4B00000000000000D000000000000000000000000000000000100000001000000018036B10000000000000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF880000000000000F0000000000000000000000000000000001000000010000000180FE880000000000001000000000000000000000000000000000010000000100000001800B810000000000001100000000000000000000000000000000010000000100000001800C810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F088000000000000130000000000000000000000000000000001000000010000000180EE7F00000000000014000000000000000000000000000000000100000001000000018024E10000000000001500000000000000000000000000000000010000000100000001800A810000000000001600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000180000000000000000000000000000000001000000010000000180C988000000000000190000000000000000000000000000000001000000010000000180C7880000000000001A0000000000000000000000000000000001000000010000000180C8880000000000001B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180DD880000000000001C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001D000000000000000000000000000000000100000001000000 + + + + 59399 + Build + + 1030 + 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000000000000100000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050000000000B47443332463130585F434C960000000000000004000B47443332463130585F434C0B47443332463130585F4D440B47443332463130585F48440B47443332463130585F5844000000000000000000000000000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000FFFFFFFF0001000000000000000100000000000000010000000180D07F000000000000FFFFFFFF00010000000000000001000000000000000100000001803080000000000000FFFFFFFF00010000000000000001000000000000000100000001809E8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D17F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001804C8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001806680000000000000FFFFFFFF0001000000000000000100000000000000010000000180EB88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180B08A000000000000FFFFFFFF0001000000000000000100000000000000010000000180A801000000000000FFFFFFFF00010000000000000001000000000000000100000001807202000000000000FFFFFFFF0001000000000000000100000000000000010000000180BE01000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000000000000000000000000000000000000001000000010000000180D07F00000000000001000000000000000000000000000000000100000001000000018030800000000000000200000000000000000000000000000000010000000100000001809E8A000000000000030000000000000000000000000000000001000000010000000180D17F0000000000000400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000000500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001806680000000000000060000000000000000000000000000000001000000010000000180EB880000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000080000000000000000000000000000000001000000010000000180B08A000000000000090000000000000000000000000000000001000000010000000180A8010000000000000A000000000000000000000000000000000100000001000000018072020000000000000B0000000000000000000000000000000001000000010000000180BE010000000000000C000000000000000000000000000000000100000001000000 + + + + 59400 + Debug + + 2373 + 00200000000000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000000002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000000000002D0000000000000000000000000000000001000000010000000180F07F0000000000002E0000000000000000000000000000000001000000010000000180E8880000000000003700000000000000000000000000000000010000000100000001803B010000000000002F0000000000000000000000000000000001000000010000000180BB8A00000000000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000000000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720000000000000000010000000000000001000000000000000000000001000000000013800F01000000000000320000000E4D656D6F72792057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000000000000330000000E53657269616C2057696E646F77730000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000000000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7200000000000000000100000000000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720000000000000000010000000000000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720000000000000000010000000000000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000000000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730000000000000000010000000000000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000010000000000000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F72000000000000000001000000000000000100000000000000000000000100000000000000000005446562756764020000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801780000000000000FFFFFFFF00010000000000000001000000000000000100000001801D80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801A80000000000000FFFFFFFF00010000000000000001000000000000000100000001801B80000000000000FFFFFFFF0001000000000000000100000000000000010000000180E57F000000000000FFFFFFFF00010000000000000001000000000000000100000001801C80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800089000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180E48B000000000000FFFFFFFF0001000000000000000100000000000000010000000180F07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180E888000000000000FFFFFFFF00010000000000000001000000000000000100000001803B01000000000000FFFFFFFF0001000000000000000100000000000000010000000180BB8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D88B000000000000FFFFFFFF0001000000000000000100000000000000010000000180D28B000000000000FFFFFFFF00010000000000000001000000000000000100000001809307000000000000FFFFFFFF0001000000000000000100000000000000010000000180658A000000000000FFFFFFFF0001000000000000000100000000000000010000000180C18A000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE8B000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800189000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000000000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000000100000000000000000000000000000000010000000100000001801D800000000000000200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000000300000000000000000000000000000000010000000100000001801B80000000000000040000000000000000000000000000000001000000010000000180E57F0000000000000500000000000000000000000000000000010000000100000001801C800000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B000000000000080000000000000000000000000000000001000000010000000180F07F000000000000090000000000000000000000000000000001000000010000000180E8880000000000000A00000000000000000000000000000000010000000100000001803B010000000000000B0000000000000000000000000000000001000000010000000180BB8A0000000000000C0000000000000000000000000000000001000000010000000180D88B0000000000000D0000000000000000000000000000000001000000010000000180D28B0000000000000E000000000000000000000000000000000100000001000000018093070000000000000F0000000000000000000000000000000001000000010000000180658A000000000000100000000000000000000000000000000001000000010000000180C18A000000000000110000000000000000000000000000000001000000010000000180EE8B0000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180018900000000000013000000000000000000000000000000000100000001000000 + + + + 0 + 1536 + 864 + + + + 1 + Debug + + -1 + -1 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000004F000000000600007F000000 + + + 16 + C4000000660000000006000096000000 + + + + 1005 + 1005 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000EF010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 109 + 109 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000EF010000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 1465 + 1465 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1466 + 1466 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1467 + 1467 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1468 + 1468 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1506 + 1506 + 0 + 0 + 0 + 0 + 32767 + 0 + 16384 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 1913 + 1913 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 1935 + 1935 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1936 + 1936 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1937 + 1937 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1939 + 1939 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1940 + 1940 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1941 + 1941 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 1942 + 1942 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 195 + 195 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000EF010000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 196 + 196 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000EF010000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 197 + 197 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 198 + 198 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 199 + 199 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 203 + 203 + 1 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C400000063000000000600007F000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 204 + 204 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 221 + 221 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000000000000000000000000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 2506 + 2506 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 2507 + 2507 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 343 + 343 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 346 + 346 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 35141 + 35141 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35824 + 35824 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 35885 + 35885 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35886 + 35886 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35887 + 35887 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35888 + 35888 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35889 + 35889 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35890 + 35890 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35891 + 35891 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35892 + 35892 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35893 + 35893 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35894 + 35894 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35895 + 35895 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35896 + 35896 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35897 + 35897 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35898 + 35898 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35899 + 35899 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35900 + 35900 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35901 + 35901 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35902 + 35902 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35903 + 35903 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35904 + 35904 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 35905 + 35905 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 38003 + 38003 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0300000066000000BD000000EF010000 + + + 16 + 3C000000530000001F0100000A020000 + + + + 38007 + 38007 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 436 + 436 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 437 + 437 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 440 + 440 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 463 + 463 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 466 + 466 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 470 + 470 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD05000066000000 + + + 16 + 3C0000005300000074020000C0000000 + + + + 50000 + 50000 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50001 + 50001 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50002 + 50002 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50003 + 50003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50004 + 50004 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50005 + 50005 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50006 + 50006 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50007 + 50007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50008 + 50008 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50009 + 50009 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50010 + 50010 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50011 + 50011 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50012 + 50012 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50013 + 50013 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50014 + 50014 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50015 + 50015 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50016 + 50016 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50017 + 50017 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50018 + 50018 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 50019 + 50019 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 3C00000053000000FC000000F1000000 + + + + 59392 + 59392 + 1 + 0 + 0 + 0 + 953 + 0 + 8192 + 0 + + 16 + 0000000000000000C40300001C000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59393 + 0 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000060300000006000019030000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59399 + 59399 + 0 + 0 + 0 + 0 + 476 + 0 + 8192 + 1 + + 16 + 000000001C000000E701000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59400 + 59400 + 1 + 0 + 0 + 0 + 612 + 0 + 8192 + 2 + + 16 + 010000001C0000007002000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 824 + 824 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 0300000023020000FD050000ED020000 + + + 16 + 76FFFFFFC20200006C03000043040000 + + + + 3167 + 0000000008000000000000000020000001000000FFFFFFFFFFFFFFFFC40000007F00000000060000830000000100000001000010040000000100000095FFFFFFB9010000FFFFFFFF08000000CB00000057010000CC000000F08B00005A01000079070000D601000045890000FFFF02000B004354616262656450616E650020000001000000C4000000660000000006000096000000C40000004F000000000600007F0000000000000040280056080000000B446973617373656D626C7901000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFF0F53797374656D20416E616C797A657200000000D601000001000000FFFFFFFFFFFFFFFF104576656E742053746174697374696373000000004589000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFFAC0300004F000000B0030000A0010000000000000200000004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C3000001800040000000000000B00300006600000070040000B7010000B00300004F00000070040000A001000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFFC00000004F000000C400000008020000010000000200001004000000010000000000000000000000FFFFFFFF05000000ED0300006D000000C3000000C400000073940000018000100000010000000000000066000000C00000001F020000000000004F000000C0000000080200000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73000000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7300000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657300000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273010000007394000001000000FFFFFFFFFFFFFFFF04000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000001000000FFFFFFFFFFFFFFFF0000000008020000000600000C02000001000000010000100400000001000000EBFDFFFF6300000000000000000000000000000001000000FFFFFFFF16000000C6000000C5000000C7000000B4010000D2010000CF010000779400008F070000930700009407000095070000960700009007000091070000B5010000B801000038030000B9050000BA050000BB050000BC050000CB090000018000800000010000000000000023020000000600001D030000000000000C020000000600000603000000000000408200561600000007436F6D6D616E6401000000C600000001000000FFFFFFFFFFFFFFFF0C4275696C64204F757470757400000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657301000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0E536F757263652042726F7773657200000000D201000001000000FFFFFFFFFFFFFFFF1346696E6420416C6C205265666572656E63657300000000CF01000001000000FFFFFFFFFFFFFFFF0742726F77736572010000007794000001000000FFFFFFFFFFFFFFFF1343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031010000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF09554C494E4B706C7573000000003803000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFF0C000000000000000000000001000000000000000000000001000000FFFFFFFF0003000085020000040300000603000000000000020000000400000000000000000000000000000000000000000000000000000001000000FFFFFFFFC600000001000000FFFFFFFFC6000000000000000000000000000000 + + + 59392 + File + + 2723 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE80300000000000000000000000000000000000000000000000100000001000000960000000200205000000000186661756C745F6175785F756E6465725F766F6C745F65727296000000000000001400186661756C745F6175785F756E6465725F766F6C745F657272116661756C745F706F77657232345F65727213466463496E666F2E76696E5F766F6C746167650F6661756C745F74656D705F6F7665721473746F70436861726765526561736F6E203D20301573746F70436861726765526561736F6E203D3D20301473746F70436861726765526561736F6E203D20380D6661756C745F636F6D5F6363751473746F70436861726765526561736F6E203D20371573746F70436861726765526561736F6E203D2038371373746F70436861726765526561736F6E203D371073746F70436861726765526561736F6E19436865636B5169727569424D535761726E696E67537461746517436865636B5169727569424D534661756C7453746174651573746F70436861726765526561736F6E203D203839174D6F64756C65496E666F2E6661756C74636F6465203E30136661756C745F4261745F556E646572566F6C740B626D735F53656E644243531D426D735F4261744368617267655265616C4F6264426174437572534F430A75426174437572534F430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000100150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000400160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65B9030000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E1000000000000FFFFFFFF000100000000000000010000000000000001000000018001E1000000000000FFFFFFFF000100000000000000010000000000000001000000018003E1000000000000FFFFFFFF0001000000000000000100000000000000010000000180CD7F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF000000000000000000010000000000000001000000018023E1000000000000FFFFFFFF000100000000000000010000000000000001000000018022E1000000000000FFFFFFFF000100000000000000010000000000000001000000018025E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802BE1000000000000FFFFFFFF00010000000000000001000000000000000100000001802CE1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001807A8A000000000000FFFFFFFF00010000000000000001000000000000000100000001807B8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180D3B0000000000000FFFFFFFF000100000000000000010000000000000001000000018015B1000000000000FFFFFFFF0001000000000000000100000000000000010000000180F4B0000000000000FFFFFFFF000100000000000000010000000000000001000000018036B1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FF88000000000000FFFFFFFF0001000000000000000100000000000000010000000180FE88000000000000FFFFFFFF00010000000000000001000000000000000100000001800B81000000000000FFFFFFFF00010000000000000001000000000000000100000001800C81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180F088000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE7F000000000000FFFFFFFF000100000000000000010000000000000001000000018024E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800A81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802280000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C488000000000000FFFFFFFF0001000000000000000100000000000000010000000180C988000000000000FFFFFFFF0001000000000000000100000000000000010000000180C788000000000000FFFFFFFF0001000000000000000100000000000000010000000180C888000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180DD88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FB7F000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000000000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000000000C0000000000000000000000000000000001000000010000000180F4B00000000000000D000000000000000000000000000000000100000001000000018036B10000000000000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF880000000000000F0000000000000000000000000000000001000000010000000180FE880000000000001000000000000000000000000000000000010000000100000001800B810000000000001100000000000000000000000000000000010000000100000001800C810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F088000000000000130000000000000000000000000000000001000000010000000180EE7F00000000000014000000000000000000000000000000000100000001000000018024E10000000000001500000000000000000000000000000000010000000100000001800A810000000000001600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000180000000000000000000000000000000001000000010000000180C988000000000000190000000000000000000000000000000001000000010000000180C7880000000000001A0000000000000000000000000000000001000000010000000180C8880000000000001B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180DD880000000000001C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001D000000000000000000000000000000000100000001000000 + + + + 59399 + Build + + 955 + 00200000000000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000010000000000000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000000002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050FFFFFFFF00960000000000000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000000240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000FFFFFFFF0001000000000000000100000000000000010000000180D07F000000000000FFFFFFFF00010000000000000001000000000000000100000001803080000000000000FFFFFFFF00010000000000000001000000000000000100000001809E8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D17F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001804C8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001806680000000000000FFFFFFFF0001000000000000000100000000000000010000000180EB88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180B08A000000000000FFFFFFFF0001000000000000000100000000000000010000000180A801000000000000FFFFFFFF00010000000000000001000000000000000100000001807202000000000000FFFFFFFF0001000000000000000100000000000000010000000180BE01000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000000000000000000000000000000000000001000000010000000180D07F00000000000001000000000000000000000000000000000100000001000000018030800000000000000200000000000000000000000000000000010000000100000001809E8A000000000000030000000000000000000000000000000001000000010000000180D17F0000000000000400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000000500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001806680000000000000060000000000000000000000000000000001000000010000000180EB880000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000080000000000000000000000000000000001000000010000000180B08A000000000000090000000000000000000000000000000001000000010000000180A8010000000000000A000000000000000000000000000000000100000001000000018072020000000000000B0000000000000000000000000000000001000000010000000180BE010000000000000C000000000000000000000000000000000100000001000000 + + + + 59400 + Debug + + 2362 + 00200000010000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000004002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000020001002D0000000000000000000000000000000001000000010000000180F07F0000020001002E0000000000000000000000000000000001000000010000000180E8880000020000003700000000000000000000000000000000010000000100000001803B010000020001002F0000000000000000000000000000000001000000010000000180BB8A00000200000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000002000100310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720100000000000000010000000000000001000000000000000000000001000000000013800F0100000200000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000002000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000020000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7201000000000000000100000000000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720100000000000000010000000000000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720100000000000000010000000000000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000002000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730100000000000000010000000000000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000010000000000000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F72010000000000000001000000000000000100000000000000000000000100000000000000000005446562756764020000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801780000000000000FFFFFFFF00010000000000000001000000000000000100000001801D80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801A80000000000000FFFFFFFF00010000000000000001000000000000000100000001801B80000000000000FFFFFFFF0001000000000000000100000000000000010000000180E57F000000000000FFFFFFFF00010000000000000001000000000000000100000001801C80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800089000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180E48B000000000000FFFFFFFF0001000000000000000100000000000000010000000180F07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180E888000000000000FFFFFFFF00010000000000000001000000000000000100000001803B01000000000000FFFFFFFF0001000000000000000100000000000000010000000180BB8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D88B000000000000FFFFFFFF0001000000000000000100000000000000010000000180D28B000000000000FFFFFFFF00010000000000000001000000000000000100000001809307000000000000FFFFFFFF0001000000000000000100000000000000010000000180658A000000000000FFFFFFFF0001000000000000000100000000000000010000000180C18A000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE8B000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800189000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000000000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000000100000000000000000000000000000000010000000100000001801D800000000000000200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000000300000000000000000000000000000000010000000100000001801B80000000000000040000000000000000000000000000000001000000010000000180E57F0000000000000500000000000000000000000000000000010000000100000001801C800000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B000000000000080000000000000000000000000000000001000000010000000180F07F000000000000090000000000000000000000000000000001000000010000000180E8880000000000000A00000000000000000000000000000000010000000100000001803B010000000000000B0000000000000000000000000000000001000000010000000180BB8A0000000000000C0000000000000000000000000000000001000000010000000180D88B0000000000000D0000000000000000000000000000000001000000010000000180D28B0000000000000E000000000000000000000000000000000100000001000000018093070000000000000F0000000000000000000000000000000001000000010000000180658A000000000000100000000000000000000000000000000001000000010000000180C18A000000000000110000000000000000000000000000000001000000010000000180EE8B0000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180018900000000000013000000000000000000000000000000000100000001000000 + + + + 0 + 1536 + 864 + + + + + + 1 + 0 + + 100 + 6 + + ..\main.c + 0 + 296 + 315 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\DC300\dc300.c + 1 + 305 + 312 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\ADC\adc.c + 0 + 393 + 412 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\sys\sys.c + 39 + 10 + 18 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\DC300\dc300.h + 46 + 125 + 126 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\usart\usart.c + 4 + 2722 + 2732 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\can.c + 61 + 4035 + 4132 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\sys\sys.h + 0 + 360 + 377 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\can.h + 8 + 772 + 773 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\ADS1015\ads1015.c + 0 + 242 + 261 + 1 + + 0 + + + ..\..\Firmware\UDS\uds_api.c + 0 + 42 + 43 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.c + 0 + 1 + 13 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\LED\led.c + 0 + 1 + 3 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\usart\usart.h + 0 + 119 + 124 + 1 + + 0 + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.hedun2 b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.hedun2 new file mode 100644 index 0000000..16c715f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvguix.hedun2 @@ -0,0 +1,3924 @@ + + + + -6.1 + +
### uVision Project, (C) Keil Software
+ + + + + + 38003 + Registers + 184 100 + + + 346 + Code Coverage + 770 560 + + + 204 + Performance Analyzer + 946 139 139 106 + + + + + + 1506 + Symbols + + 64 64 64 + + + 1936 + Watch 1 + + 200 133 133 + + + 1937 + Watch 2 + + 200 133 133 + + + 1935 + Call Stack + Locals + + 200 133 133 + + + 2506 + Trace Data + + 75 135 130 95 70 230 200 150 + + + 466 + Source Browser + 500 + 166 + + + + + + + + 0 + 0 + 0 + 50 + 16 + + + + + + + 44 + 2 + 3 + + -32000 + -32000 + + + -1 + -1 + + + 79 + -12 + 1269 + 752 + + + + 0 + + 4611 + 0100000004000000010000000100000001000000010000000000000002000000000000000100000001000000000000002800000028000000010000002400000006000000010000004C443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C6D61696E2E6300000000066D61696E2E6300000000FFDC7800FFFFFFFF5C443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53544D33325F66696C655C73746D3332663130782E68000000000B73746D3332663130782E6800000000BECEA100FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C5574696C69746965735C67643332663130785F6576616C2E63000000000F67643332663130785F6576616C2E6300000000F0A0A100FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C5574696C69746965735C67643332663130785F6576616C2E68000000000F67643332663130785F6576616C2E6800000000BCA8E100FFFFFFFF5C443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C63616E5F6170702E63000000000963616E5F6170702E63000000009CC1B600FFFFFFFF58443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C63616E2E68000000000563616E2E6800000000F7B88600FFFFFFFF68443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C4C4F57504F5745525C6170705F7077725F6D616E6167652E6300000000106170705F7077725F6D616E6167652E6300000000D9ADC200FFFFFFFF4F443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C7379737469636B2E6300000000097379737469636B2E6300000000A5C2D700FFFFFFFF58443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C4C45445C6C65642E6300000000056C65642E6300000000B3A6BE00FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C5544535C626F6F746C6F616465722E63000000000C626F6F746C6F616465722E6300000000EAD6A300FFFFFFFF59443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C5544535C646961676E6F7369735F6D69642E63000000000F646961676E6F7369735F6D69642E6300000000F6FA7D00FFFFFFFF53443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C5544535C7564735F6469642E6300000000097564735F6469642E6300000000B5E99D00FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C7379735C7379732E6300000000057379732E63000000005FC3CF00FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C7379735C7379732E6800000000057379732E6800000000CACAD500FFFFFFFF78443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C47445C47443332463130785C536F757263655C41524D5C737461727475705F67643332663130785F636C2E730000000015737461727475705F67643332663130785F636C2E7300000000C5D4F200FFFFFFFF4C443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C6D61696E2E6800000000066D61696E2E6800000000FFDC7800FFFFFFFF53443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C67643332663130785F69742E68000000000D67643332663130785F69742E6800000000BECEA100FFFFFFFF53443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C67643332663130785F69742E63000000000D67643332663130785F69742E6300000000F0A0A100FFFFFFFF5A443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C64656C61795C64656C61792E63000000000764656C61792E6300000000BCA8E100FFFFFFFF78443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C47445C47443332463130785C536F757263655C41524D5C737461727475705F67643332663130785F78642E730000000015737461727475705F67643332663130785F78642E73000000009CC1B600FFFFFFFF58443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C63616E2E63000000000563616E2E6300000000F7B88600FFFFFFFF4F443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C54656D706C6174655C7379737469636B2E6800000000097379737469636B2E6800000000D9ADC200FFFFFFFF56443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C636F72655F636D332E68000000000A636F72655F636D332E6800000000A5C2D700FFFFFFFF5F443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C43414E5C43616E4472764374726C2E63000000000C43616E4472764374726C2E6300000000B3A6BE00FFFFFFFF5E443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C48415244574152455C6368697049445C6368697069642E6300000000086368697069642E6300000000EAD6A300FFFFFFFF24433A5C4B65696C5F76355C41524D5C41524D43435C696E636C7564655C737464696F2E680000000007737464696F2E6800000000F6FA7D00FFFFFFFF7A443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C47443332463130785F7374616E646172645F7065726970686572616C5C536F757263655C67643332663130785F75736172742E63000000001067643332663130785F75736172742E6300000000B5E99D00FFFFFFFF7B443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C47443332463130785F7374616E646172645F7065726970686572616C5C496E636C7564655C67643332663130785F75736172742E68000000001067643332663130785F75736172742E68000000005FC3CF00FFFFFFFF6A443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C47445C47443332463130785C496E636C7564655C67643332663130782E68000000000A67643332663130782E6800000000C1838300FFFFFFFF79443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C47445C47443332463130785C536F757263655C41524D5C737461727475705F73746D3332663130785F636C2E730000000016737461727475705F73746D3332663130785F636C2E7300000000CACAD500FFFFFFFF63443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53544D33325F66696C655C73797374656D5F73746D3332663130782E63000000001273797374656D5F73746D3332663130782E6300000000C5D4F200FFFFFFFF71443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C434D5349535C47445C47443332463130785C496E636C7564655C73797374656D5F67643332663130782E68000000001173797374656D5F67643332663130782E6800000000FFDC7800FFFFFFFF74443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53544D3332463130785F5374645065726970685F4472697665725C7372635C73746D3332663130785F74696D2E63000000000F73746D3332663130785F74696D2E6300000000BECEA100FFFFFFFF5F443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53544D33325F66696C655C73746D3332663130785F69742E63000000000E73746D3332663130785F69742E6300000000F0A0A100FFFFFFFF5A443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53595354454D5C75736172745C75736172742E63000000000775736172742E6300000000BCA8E100FFFFFFFF74443A5C686579646E5F6C755C51523230355F3137305F53545F47445C47443332463130785F4669726D776172655F4C6962726172795F56322E332E305C4669726D776172655C53544D3332463130785F5374645065726970685F4472697665725C7372635C73746D3332663130785F7077722E63000000000F73746D3332663130785F7077722E6300000000F0A0A100FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD50001000000000000000200000071010000660000000006000002020000 + + + + 0 + Build + + -1 + -1 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000004F00000070040000BC000000 + + + 16 + C40000006600000070040000D3000000 + + + + 1005 + 1005 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000006A010000ED020000 + + + 16 + EDFFFFFF4E0100006201000099020000 + + + + 109 + 109 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000006A010000ED020000 + + + 16 + EDFFFFFF4E0100006201000099020000 + + + + 1465 + 1465 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1466 + 1466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1467 + 1467 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1468 + 1468 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1506 + 1506 + 0 + 0 + 0 + 0 + 32767 + 0 + 16384 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1913 + 1913 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1935 + 1935 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1936 + 1936 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1937 + 1937 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 1939 + 1939 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1940 + 1940 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1941 + 1941 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 1942 + 1942 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 195 + 195 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000006A010000ED020000 + + + 16 + EDFFFFFF4E0100006201000099020000 + + + + 196 + 196 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000006A010000ED020000 + + + 16 + EDFFFFFF4E0100006201000099020000 + + + + 197 + 197 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 198 + 198 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 00000000900100007004000011020000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 199 + 199 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 203 + 203 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 204 + 204 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 221 + 221 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000000000000000000000000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 2506 + 2506 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 2507 + 2507 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 343 + 343 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 346 + 346 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 35141 + 35141 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D000000160100000B010000 + + + + 35824 + 35824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 35885 + 35885 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35886 + 35886 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35887 + 35887 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35888 + 35888 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35889 + 35889 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35890 + 35890 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35891 + 35891 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35892 + 35892 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35893 + 35893 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35894 + 35894 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35895 + 35895 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35896 + 35896 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35897 + 35897 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35898 + 35898 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35899 + 35899 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35900 + 35900 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35901 + 35901 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35902 + 35902 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35903 + 35903 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35904 + 35904 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 35905 + 35905 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 38003 + 38003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000660000006A010000ED020000 + + + 16 + EDFFFFFF4E0100006201000099020000 + + + + 38007 + 38007 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 436 + 436 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000003901000024020000 + + + + 437 + 437 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 440 + 440 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 463 + 463 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000003901000024020000 + + + + 466 + 466 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 7401000006020000FD050000ED020000 + + + 16 + 560000006D0000003901000024020000 + + + + 470 + 470 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C7000000660000006D040000A3000000 + + + 16 + 560000006D0000008E020000DA000000 + + + + 50000 + 50000 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50001 + 50001 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50002 + 50002 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50003 + 50003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50004 + 50004 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50005 + 50005 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50006 + 50006 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50007 + 50007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50008 + 50008 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50009 + 50009 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50010 + 50010 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50011 + 50011 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50012 + 50012 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50013 + 50013 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50014 + 50014 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50015 + 50015 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50016 + 50016 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50017 + 50017 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50018 + 50018 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 50019 + 50019 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 560000006D000000160100000B010000 + + + + 59392 + 59392 + 1 + 0 + 0 + 0 + 953 + 0 + 8192 + 0 + + 16 + 0000000000000000C40300001C000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59393 + 0 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000060300000006000019030000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59399 + 59399 + 1 + 0 + 0 + 0 + 476 + 0 + 8192 + 1 + + 16 + 000000001C000000E701000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59400 + 59400 + 0 + 0 + 0 + 0 + 612 + 0 + 8192 + 2 + + 16 + 00000000380000006F02000054000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 824 + 824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 03000000A70100006D040000F8010000 + + + 16 + 560000006D000000160100000B010000 + + + + 3337 + 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFC4000000BC00000070040000C0000000000000000100000004000000010000000000000000000000FFFFFFFF08000000CB00000057010000CC000000F08B00005A01000079070000D601000045890000FFFF02000B004354616262656450616E650020000000000000C40000006600000070040000D3000000C40000004F00000070040000BC0000000000000040280046080000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFF0F53797374656D20416E616C797A657200000000D601000001000000FFFFFFFFFFFFFFFF104576656E742053746174697374696373000000004589000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFFAC0300004F000000B0030000A0010000000000000200000004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C3000001800040000000000000B00300006600000070040000B7010000B00300004F00000070040000A001000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000080000000000000FFFFFFFFFFFFFFFF000000008C010000700400009001000000000000010000000400000001000000000000000000000000000000000000000000000001000000C6000000FFFFFFFF0F0000008F070000930700009407000095070000960700009007000091070000B5010000B801000038030000B9050000BA050000BB050000BC050000CB0900000180008000000000000000000000A701000070040000280200000000000090010000700400001102000000000000404100460F0000001343616C6C20537461636B202B204C6F63616C73000000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF09554C494E4B706C7573000000003803000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFFFFFFFFFF0000000001000000000000000000000001000000FFFFFFFF38020000900100003C0200001102000000000000020000000400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF71010000EB01000000060000EF01000001000000010000100400000001000000B5FEFFFF61010000FFFFFFFF06000000C5000000C7000000B4010000D2010000CF01000077940000018000800000010000007101000006020000000600001D03000071010000EF01000000060000060300000000000040820056060000000C4275696C64204F757470757401000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657301000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0E536F757263652042726F7773657200000000D201000001000000FFFFFFFFFFFFFFFF1346696E6420416C6C205265666572656E63657300000000CF01000001000000FFFFFFFFFFFFFFFF0742726F77736572010000007794000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000010000001000000FFFFFFFFFFFFFFFF6D0100004F000000710100000603000001000000020000100400000001000000000000000000000000000000000000000000000001000000FFFFFFFF05000000ED0300006D000000C3000000C4000000739400000180001000000100000000000000660000006D0100001D030000000000004F0000006D010000060300000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73010000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7301000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657301000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273000000007394000001000000FFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000000000000000000 + + + 59392 + File + + 2542 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050000000000E7379737469636B5F636F6E666967960000000000000013001447445F5057525F456E74657253544F504D6F64650E7379737469636B5F636F6E6669670349525108526F7574696E65730E50656E6453565F48616E646C65720348534505383030303004434F4D3313205553455F53544D3332313030455F4556414C0F64656C61795F64656372656D656E740A53797374656D496E69740F5379735469636B5F48616E646C657204766F69640A5379737469636B4E756D1554696D655461736B44697370617463685F466C61670A465F54696D655F314D531844435F506F7765725F4D616E75616C546573745F466C61670C5379735469636B5F4952516E0964656C61795F316D7300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65B9030000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E1000000000000FFFFFFFF000100000000000000010000000000000001000000018001E1000000000000FFFFFFFF000100000000000000010000000000000001000000018003E1000000000000FFFFFFFF0001000000000000000100000000000000010000000180CD7F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF000000000000000000010000000000000001000000018023E1000000000000FFFFFFFF000100000000000000010000000000000001000000018022E1000000000000FFFFFFFF000100000000000000010000000000000001000000018025E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802BE1000000000000FFFFFFFF00010000000000000001000000000000000100000001802CE1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001807A8A000000000000FFFFFFFF00010000000000000001000000000000000100000001807B8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180D3B0000000000000FFFFFFFF000100000000000000010000000000000001000000018015B1000000000000FFFFFFFF0001000000000000000100000000000000010000000180F4B0000000000000FFFFFFFF000100000000000000010000000000000001000000018036B1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FF88000000000000FFFFFFFF0001000000000000000100000000000000010000000180FE88000000000000FFFFFFFF00010000000000000001000000000000000100000001800B81000000000000FFFFFFFF00010000000000000001000000000000000100000001800C81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180F088000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE7F000000000000FFFFFFFF000100000000000000010000000000000001000000018024E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800A81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802280000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C488000000000000FFFFFFFF0001000000000000000100000000000000010000000180C988000000000000FFFFFFFF0001000000000000000100000000000000010000000180C788000000000000FFFFFFFF0001000000000000000100000000000000010000000180C888000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180DD88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FB7F000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000000000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000000000C0000000000000000000000000000000001000000010000000180F4B00000000000000D000000000000000000000000000000000100000001000000018036B10000000000000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF880000000000000F0000000000000000000000000000000001000000010000000180FE880000000000001000000000000000000000000000000000010000000100000001800B810000000000001100000000000000000000000000000000010000000100000001800C810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F088000000000000130000000000000000000000000000000001000000010000000180EE7F00000000000014000000000000000000000000000000000100000001000000018024E10000000000001500000000000000000000000000000000010000000100000001800A810000000000001600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000180000000000000000000000000000000001000000010000000180C988000000000000190000000000000000000000000000000001000000010000000180C7880000000000001A0000000000000000000000000000000001000000010000000180C8880000000000001B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180DD880000000000001C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001D000000000000000000000000000000000100000001000000 + + + + 59399 + Build + + 1030 + 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000010000000000000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050000000000B47443332463130585F434C960000000000000004000B47443332463130585F434C0B47443332463130585F4D440B47443332463130585F48440B47443332463130585F5844000000000000000000000000000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000FFFFFFFF0001000000000000000100000000000000010000000180D07F000000000000FFFFFFFF00010000000000000001000000000000000100000001803080000000000000FFFFFFFF00010000000000000001000000000000000100000001809E8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D17F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001804C8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001806680000000000000FFFFFFFF0001000000000000000100000000000000010000000180EB88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180B08A000000000000FFFFFFFF0001000000000000000100000000000000010000000180A801000000000000FFFFFFFF00010000000000000001000000000000000100000001807202000000000000FFFFFFFF0001000000000000000100000000000000010000000180BE01000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000000000000000000000000000000000000001000000010000000180D07F00000000000001000000000000000000000000000000000100000001000000018030800000000000000200000000000000000000000000000000010000000100000001809E8A000000000000030000000000000000000000000000000001000000010000000180D17F0000000000000400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000000500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001806680000000000000060000000000000000000000000000000001000000010000000180EB880000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000080000000000000000000000000000000001000000010000000180B08A000000000000090000000000000000000000000000000001000000010000000180A8010000000000000A000000000000000000000000000000000100000001000000018072020000000000000B0000000000000000000000000000000001000000010000000180BE010000000000000C000000000000000000000000000000000100000001000000 + + + + 59400 + Debug + + 2373 + 00200000000000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000000002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000000000002D0000000000000000000000000000000001000000010000000180F07F0000000000002E0000000000000000000000000000000001000000010000000180E8880000000000003700000000000000000000000000000000010000000100000001803B010000000000002F0000000000000000000000000000000001000000010000000180BB8A00000000000030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000000000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720100000000000000010000000000000001000000000000000000000001000000000013800F01000000000000320000000E4D656D6F72792057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000000000000330000000E53657269616C2057696E646F77730000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000000000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7201000000000000000100000000000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720100000000000000010000000000000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720100000000000000010000000000000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000000000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730100000000000000010000000000000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000010000000000000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F72010000000000000001000000000000000100000000000000000000000100000000000000000005446562756764020000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801780000000000000FFFFFFFF00010000000000000001000000000000000100000001801D80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801A80000000000000FFFFFFFF00010000000000000001000000000000000100000001801B80000000000000FFFFFFFF0001000000000000000100000000000000010000000180E57F000000000000FFFFFFFF00010000000000000001000000000000000100000001801C80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800089000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180E48B000000000000FFFFFFFF0001000000000000000100000000000000010000000180F07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180E888000000000000FFFFFFFF00010000000000000001000000000000000100000001803B01000000000000FFFFFFFF0001000000000000000100000000000000010000000180BB8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D88B000000000000FFFFFFFF0001000000000000000100000000000000010000000180D28B000000000000FFFFFFFF00010000000000000001000000000000000100000001809307000000000000FFFFFFFF0001000000000000000100000000000000010000000180658A000000000000FFFFFFFF0001000000000000000100000000000000010000000180C18A000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE8B000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800189000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000000000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000000100000000000000000000000000000000010000000100000001801D800000000000000200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000000300000000000000000000000000000000010000000100000001801B80000000000000040000000000000000000000000000000001000000010000000180E57F0000000000000500000000000000000000000000000000010000000100000001801C800000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B000000000000080000000000000000000000000000000001000000010000000180F07F000000000000090000000000000000000000000000000001000000010000000180E8880000000000000A00000000000000000000000000000000010000000100000001803B010000000000000B0000000000000000000000000000000001000000010000000180BB8A0000000000000C0000000000000000000000000000000001000000010000000180D88B0000000000000D0000000000000000000000000000000001000000010000000180D28B0000000000000E000000000000000000000000000000000100000001000000018093070000000000000F0000000000000000000000000000000001000000010000000180658A000000000000100000000000000000000000000000000001000000010000000180C18A000000000000110000000000000000000000000000000001000000010000000180EE8B0000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180018900000000000013000000000000000000000000000000000100000001000000 + + + + 0 + 1536 + 864 + + + + 1 + Debug + + -1 + -1 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C40000004F00000000060000BC000000 + + + 16 + C40000006600000000060000D3000000 + + + + 1005 + 1005 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000006600000023010000DD010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 109 + 109 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000006600000023010000DD010000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 1465 + 1465 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1466 + 1466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1467 + 1467 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1468 + 1468 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1506 + 1506 + 0 + 0 + 0 + 0 + 32767 + 0 + 16384 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 1913 + 1913 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1935 + 1935 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 030300000E020000000600005F020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 1936 + 1936 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 1937 + 1937 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 1939 + 1939 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1940 + 1940 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1941 + 1941 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 1942 + 1942 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 195 + 195 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000006600000023010000DD010000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 196 + 196 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000006600000023010000DD010000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 197 + 197 + 0 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 030000007A020000FD050000ED020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 198 + 198 + 1 + 0 + 0 + 0 + 32767 + 0 + 32768 + 0 + + 16 + 00000000FA010000FF0200005F020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 199 + 199 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000770200000006000006030000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 203 + 203 + 0 + 0 + 0 + 0 + 32767 + 0 + 8192 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 204 + 204 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 221 + 221 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000000000000000000000000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 2506 + 2506 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 2507 + 2507 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 343 + 343 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 346 + 346 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 35141 + 35141 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35824 + 35824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 35885 + 35885 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35886 + 35886 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35887 + 35887 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35888 + 35888 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35889 + 35889 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35890 + 35890 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35891 + 35891 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35892 + 35892 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35893 + 35893 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35894 + 35894 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35895 + 35895 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35896 + 35896 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35897 + 35897 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35898 + 35898 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35899 + 35899 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35900 + 35900 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35901 + 35901 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35902 + 35902 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35903 + 35903 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35904 + 35904 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 35905 + 35905 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 38003 + 38003 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000006600000023010000DD010000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 38007 + 38007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000007A020000FD050000ED020000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 436 + 436 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000007A020000FD050000ED020000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 437 + 437 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 440 + 440 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 463 + 463 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000007A020000FD050000ED020000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 466 + 466 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 030000007A020000FD050000ED020000 + + + 16 + 8A000000A10000006D01000058020000 + + + + 470 + 470 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + C700000066000000FD050000A3000000 + + + 16 + 8A000000A1000000C20200000E010000 + + + + 50000 + 50000 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50001 + 50001 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50002 + 50002 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50003 + 50003 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50004 + 50004 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50005 + 50005 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50006 + 50006 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50007 + 50007 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50008 + 50008 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50009 + 50009 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50010 + 50010 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50011 + 50011 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50012 + 50012 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50013 + 50013 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50014 + 50014 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50015 + 50015 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50016 + 50016 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50017 + 50017 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50018 + 50018 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 50019 + 50019 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + B3030000660000006D04000087010000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 59392 + 59392 + 1 + 0 + 0 + 0 + 953 + 0 + 8192 + 0 + + 16 + 0000000000000000C40300001C000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59393 + 0 + 1 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 00000000060300000006000019030000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59399 + 59399 + 0 + 0 + 0 + 0 + 476 + 0 + 8192 + 1 + + 16 + 000000001C000000E701000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 59400 + 59400 + 1 + 0 + 0 + 0 + 612 + 0 + 8192 + 2 + + 16 + 000000001C0000006F02000038000000 + + + 16 + 0A0000000A0000006E0000006E000000 + + + + 824 + 824 + 0 + 0 + 0 + 0 + 32767 + 0 + 4096 + 0 + + 16 + 0603000011020000FD05000046020000 + + + 16 + 8A000000A10000004A0100003F010000 + + + + 3316 + 000000000B000000000000000020000000000000FFFFFFFFFFFFFFFFC4000000BC00000000060000C0000000000000000100000004000000010000000000000000000000FFFFFFFF08000000CB00000057010000CC000000F08B00005A01000079070000D601000045890000FFFF02000B004354616262656450616E650020000000000000C40000006600000000060000D3000000C40000004F00000000060000BC0000000000000040280046080000000B446973617373656D626C7900000000CB00000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A6572000000005701000001000000FFFFFFFFFFFFFFFF14506572666F726D616E636520416E616C797A657200000000CC00000001000000FFFFFFFFFFFFFFFF0E4C6F67696320416E616C797A657200000000F08B000001000000FFFFFFFFFFFFFFFF0D436F646520436F766572616765000000005A01000001000000FFFFFFFFFFFFFFFF11496E737472756374696F6E205472616365000000007907000001000000FFFFFFFFFFFFFFFF0F53797374656D20416E616C797A657200000000D601000001000000FFFFFFFFFFFFFFFF104576656E742053746174697374696373000000004589000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFCB00000001000000FFFFFFFFCB000000000000000040000000000000FFFFFFFFFFFFFFFFAC0300004F000000B0030000A0010000000000000200000004000000010000000000000000000000FFFFFFFF2B000000E2050000CA0900002D8C00002E8C00002F8C0000308C0000318C0000328C0000338C0000348C0000358C0000368C0000378C0000388C0000398C00003A8C00003B8C00003C8C00003D8C00003E8C00003F8C0000408C0000418C000050C3000051C3000052C3000053C3000054C3000055C3000056C3000057C3000058C3000059C300005AC300005BC300005CC300005DC300005EC300005FC3000060C3000061C3000062C3000063C3000001800040000000000000B00300006600000070040000B7010000B00300004F00000070040000A001000000000000404100462B0000000753796D626F6C7300000000E205000001000000FFFFFFFFFFFFFFFF0A5472616365204461746100000000CA09000001000000FFFFFFFFFFFFFFFF00000000002D8C000001000000FFFFFFFFFFFFFFFF00000000002E8C000001000000FFFFFFFFFFFFFFFF00000000002F8C000001000000FFFFFFFFFFFFFFFF0000000000308C000001000000FFFFFFFFFFFFFFFF0000000000318C000001000000FFFFFFFFFFFFFFFF0000000000328C000001000000FFFFFFFFFFFFFFFF0000000000338C000001000000FFFFFFFFFFFFFFFF0000000000348C000001000000FFFFFFFFFFFFFFFF0000000000358C000001000000FFFFFFFFFFFFFFFF0000000000368C000001000000FFFFFFFFFFFFFFFF0000000000378C000001000000FFFFFFFFFFFFFFFF0000000000388C000001000000FFFFFFFFFFFFFFFF0000000000398C000001000000FFFFFFFFFFFFFFFF00000000003A8C000001000000FFFFFFFFFFFFFFFF00000000003B8C000001000000FFFFFFFFFFFFFFFF00000000003C8C000001000000FFFFFFFFFFFFFFFF00000000003D8C000001000000FFFFFFFFFFFFFFFF00000000003E8C000001000000FFFFFFFFFFFFFFFF00000000003F8C000001000000FFFFFFFFFFFFFFFF0000000000408C000001000000FFFFFFFFFFFFFFFF0000000000418C000001000000FFFFFFFFFFFFFFFF000000000050C3000001000000FFFFFFFFFFFFFFFF000000000051C3000001000000FFFFFFFFFFFFFFFF000000000052C3000001000000FFFFFFFFFFFFFFFF000000000053C3000001000000FFFFFFFFFFFFFFFF000000000054C3000001000000FFFFFFFFFFFFFFFF000000000055C3000001000000FFFFFFFFFFFFFFFF000000000056C3000001000000FFFFFFFFFFFFFFFF000000000057C3000001000000FFFFFFFFFFFFFFFF000000000058C3000001000000FFFFFFFFFFFFFFFF000000000059C3000001000000FFFFFFFFFFFFFFFF00000000005AC3000001000000FFFFFFFFFFFFFFFF00000000005BC3000001000000FFFFFFFFFFFFFFFF00000000005CC3000001000000FFFFFFFFFFFFFFFF00000000005DC3000001000000FFFFFFFFFFFFFFFF00000000005EC3000001000000FFFFFFFFFFFFFFFF00000000005FC3000001000000FFFFFFFFFFFFFFFF000000000060C3000001000000FFFFFFFFFFFFFFFF000000000061C3000001000000FFFFFFFFFFFFFFFF000000000062C3000001000000FFFFFFFFFFFFFFFF000000000063C3000001000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000001000000FFFFFFFFE205000001000000FFFFFFFFE2050000000000000010000001000000FFFFFFFFFFFFFFFF260100004F0000002A010000F60100000100000002000010040000000100000042FFFFFFFB030000FFFFFFFF05000000ED0300006D000000C3000000C400000073940000018000100000010000000000000066000000260100000D020000000000004F00000026010000F60100000000000040410056050000000750726F6A65637401000000ED03000001000000FFFFFFFFFFFFFFFF05426F6F6B73000000006D00000001000000FFFFFFFFFFFFFFFF0946756E6374696F6E7300000000C300000001000000FFFFFFFFFFFFFFFF0954656D706C6174657300000000C400000001000000FFFFFFFFFFFFFFFF09526567697374657273010000007394000001000000FFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000001000000FFFFFFFFED03000001000000FFFFFFFFED030000000000000080000001000000FFFFFFFFFFFFFFFF00000000F601000000060000FA01000001000000010000100400000001000000A3FEFFFF0400000000000000000000000000000001000000C6000000FFFFFFFF0F0000008F070000930700009407000095070000960700009007000091070000B5010000B801000038030000B9050000BA050000BB050000BC050000CB090000018000800000010000000303000011020000000600007602000003030000FA010000000600005F02000000000000404100560F0000001343616C6C20537461636B202B204C6F63616C73010000008F07000001000000FFFFFFFFFFFFFFFF0755415254202331000000009307000001000000FFFFFFFFFFFFFFFF0755415254202332000000009407000001000000FFFFFFFFFFFFFFFF0755415254202333000000009507000001000000FFFFFFFFFFFFFFFF15446562756720287072696E74662920566965776572000000009607000001000000FFFFFFFFFFFFFFFF0757617463682031000000009007000001000000FFFFFFFFFFFFFFFF0757617463682032000000009107000001000000FFFFFFFFFFFFFFFF10547261636520457863657074696F6E7300000000B501000001000000FFFFFFFFFFFFFFFF0E4576656E7420436F756E7465727300000000B801000001000000FFFFFFFFFFFFFFFF09554C494E4B706C7573000000003803000001000000FFFFFFFFFFFFFFFF084D656D6F7279203100000000B905000001000000FFFFFFFFFFFFFFFF084D656D6F7279203200000000BA05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203300000000BB05000001000000FFFFFFFFFFFFFFFF084D656D6F7279203400000000BC05000001000000FFFFFFFFFFFFFFFF105472616365204E617669676174696F6E00000000CB09000001000000FFFFFFFFFFFFFFFF000000000000000001000000000000000100000001000000FFFFFFFFFF020000FA010000030300005F02000001000000020000100400000000000000000000000000000000000000000000000000000002000000C6000000FFFFFFFF8F07000001000000FFFFFFFF8F07000001000000C6000000000000000080000001000000FFFFFFFFFFFFFFFF000000005F02000000060000630200000100000001000010040000000100000070FEFFFF68000000FFFFFFFF06000000C5000000C7000000B4010000D2010000CF0100007794000001800080000001000000000000007A020000000600001D030000000000006302000000060000060300000000000040820056060000000C4275696C64204F757470757400000000C500000001000000FFFFFFFFFFFFFFFF0D46696E6420496E2046696C657301000000C700000001000000FFFFFFFFFFFFFFFF0A4572726F72204C69737400000000B401000001000000FFFFFFFFFFFFFFFF0E536F757263652042726F7773657200000000D201000001000000FFFFFFFFFFFFFFFF1346696E6420416C6C205265666572656E63657300000000CF01000001000000FFFFFFFFFFFFFFFF0642726F777365000000007794000001000000FFFFFFFFFFFFFFFF01000000000000000000000000000000000000000000000001000000FFFFFFFFC500000001000000FFFFFFFFC5000000000000000000000000000000 + + + 59392 + File + + 2517 + 00200000010000002800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000040004000000000000000000000000000000000100000001000000018022E100000000040005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000004000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000004000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000004000C0000000000000000000000000000000001000000010000000180F4B00000000004000D000000000000000000000000000000000100000001000000018036B10000000004000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF88000000000400460000000000000000000000000000000001000000010000000180FE880000000004004500000000000000000000000000000000010000000100000001800B810000000004001300000000000000000000000000000000010000000100000001800C810000000004001400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F0880000020000000F000000000000000000000000000000000100000001000000FFFF0100120043555646696E64436F6D626F427574746F6EE803000000000000000000000000000000000000000000000001000000010000009600000002002050000000000E7379737469636B5F636F6E666967960000000000000012000E7379737469636B5F636F6E6669670349525108526F7574696E65730E50656E6453565F48616E646C65720348534505383030303004434F4D3313205553455F53544D3332313030455F4556414C0F64656C61795F64656372656D656E740A53797374656D496E69740F5379735469636B5F48616E646C657204766F69640A5379737469636B4E756D1554696D655461736B44697370617463685F466C61670A465F54696D655F314D531844435F506F7765725F4D616E75616C546573745F466C61670C5379735469636B5F4952516E0964656C61795F316D73000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018024E10000000000001100000000000000000000000000000000010000000100000001800A810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E2280000002000100150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B46350000000000000000000000000100000001000000000000000000000001000000020021802280000000000000150000002153746172742F53746F70202644656275672053657373696F6E094374726C2B4635000000000000000000000000010000000100000000000000000000000100000000002180E0010000000000007500000021456E65726779204D6561737572656D656E742026776974686F75742044656275670000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000160000000000000000000000000000000001000000010000000180C988000000000400180000000000000000000000000000000001000000010000000180C788000000000000190000000000000000000000000000000001000000010000000180C8880000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000021804C010000020001001A0000000F2650726F6A6563742057696E646F77000000000000000000000000010000000100000000000000000000000100000008002180DD880000000000001A0000000750726F6A656374000000000000000000000000010000000100000000000000000000000100000000002180DC8B0000000000003A00000005426F6F6B73000000000000000000000000010000000100000000000000000000000100000000002180E18B0000000000003B0000000946756E6374696F6E73000000000000000000000000010000000100000000000000000000000100000000002180E28B000000000000400000000954656D706C6174657300000000000000000000000001000000010000000000000000000000010000000000218018890000000000003D0000000E536F757263652042726F777365720000000000000000000000000100000001000000000000000000000001000000000021800000000000000400FFFFFFFF00000000000000000001000000000000000100000000000000000000000100000000002180D988000000000000390000000C4275696C64204F7574707574000000000000000000000000010000000100000000000000000000000100000000002180E38B000000000000410000000B46696E64204F75747075740000000000000000000000000100000001000000000000000000000001000000000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001B000000000000000000000000000000000100000001000000000000000446696C65B9030000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E1000000000000FFFFFFFF000100000000000000010000000000000001000000018001E1000000000000FFFFFFFF000100000000000000010000000000000001000000018003E1000000000000FFFFFFFF0001000000000000000100000000000000010000000180CD7F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF000000000000000000010000000000000001000000018023E1000000000000FFFFFFFF000100000000000000010000000000000001000000018022E1000000000000FFFFFFFF000100000000000000010000000000000001000000018025E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802BE1000000000000FFFFFFFF00010000000000000001000000000000000100000001802CE1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001807A8A000000000000FFFFFFFF00010000000000000001000000000000000100000001807B8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180D3B0000000000000FFFFFFFF000100000000000000010000000000000001000000018015B1000000000000FFFFFFFF0001000000000000000100000000000000010000000180F4B0000000000000FFFFFFFF000100000000000000010000000000000001000000018036B1000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FF88000000000000FFFFFFFF0001000000000000000100000000000000010000000180FE88000000000000FFFFFFFF00010000000000000001000000000000000100000001800B81000000000000FFFFFFFF00010000000000000001000000000000000100000001800C81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180F088000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE7F000000000000FFFFFFFF000100000000000000010000000000000001000000018024E1000000000000FFFFFFFF00010000000000000001000000000000000100000001800A81000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001802280000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C488000000000000FFFFFFFF0001000000000000000100000000000000010000000180C988000000000000FFFFFFFF0001000000000000000100000000000000010000000180C788000000000000FFFFFFFF0001000000000000000100000000000000010000000180C888000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180DD88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180FB7F000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 1423 + 2800FFFF01001100434D4643546F6F6C426172427574746F6E00E100000000000000000000000000000000000000000000000100000001000000018001E100000000000001000000000000000000000000000000000100000001000000018003E1000000000000020000000000000000000000000000000001000000010000000180CD7F0000000000000300000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018023E100000000000004000000000000000000000000000000000100000001000000018022E100000000000005000000000000000000000000000000000100000001000000018025E10000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001802BE10000000000000700000000000000000000000000000000010000000100000001802CE10000000000000800000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001807A8A0000000000000900000000000000000000000000000000010000000100000001807B8A0000000000000A00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180D3B00000000000000B000000000000000000000000000000000100000001000000018015B10000000000000C0000000000000000000000000000000001000000010000000180F4B00000000000000D000000000000000000000000000000000100000001000000018036B10000000000000E00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FF880000000000000F0000000000000000000000000000000001000000010000000180FE880000000000001000000000000000000000000000000000010000000100000001800B810000000000001100000000000000000000000000000000010000000100000001800C810000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180F088000000000000130000000000000000000000000000000001000000010000000180EE7F00000000000014000000000000000000000000000000000100000001000000018024E10000000000001500000000000000000000000000000000010000000100000001800A810000000000001600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018022800000000000001700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C488000000000000180000000000000000000000000000000001000000010000000180C988000000000000190000000000000000000000000000000001000000010000000180C7880000000000001A0000000000000000000000000000000001000000010000000180C8880000000000001B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180DD880000000000001C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180FB7F0000000000001D000000000000000000000000000000000100000001000000 + + + + 59399 + Build + + 955 + 00200000000000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0000000000000000010000000000000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000000002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA00000000000000000000000000000000000000000000000001000000010000009600000003002050FFFFFFFF00960000000000000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000000240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000FFFFFFFF0001000000000000000100000000000000010000000180D07F000000000000FFFFFFFF00010000000000000001000000000000000100000001803080000000000000FFFFFFFF00010000000000000001000000000000000100000001809E8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D17F000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001804C8A000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001806680000000000000FFFFFFFF0001000000000000000100000000000000010000000180EB88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180C07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180B08A000000000000FFFFFFFF0001000000000000000100000000000000010000000180A801000000000000FFFFFFFF00010000000000000001000000000000000100000001807202000000000000FFFFFFFF0001000000000000000100000000000000010000000180BE01000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 583 + 1000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F000000000000000000000000000000000000000000000001000000010000000180D07F00000000000001000000000000000000000000000000000100000001000000018030800000000000000200000000000000000000000000000000010000000100000001809E8A000000000000030000000000000000000000000000000001000000010000000180D17F0000000000000400000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000000500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001806680000000000000060000000000000000000000000000000001000000010000000180EB880000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000080000000000000000000000000000000001000000010000000180B08A000000000000090000000000000000000000000000000001000000010000000180A8010000000000000A000000000000000000000000000000000100000001000000018072020000000000000B0000000000000000000000000000000001000000010000000180BE010000000000000C000000000000000000000000000000000100000001000000 + + + + 59400 + Debug + + 2362 + 00200000010000001900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000002500000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000002600000000000000000000000000000000010000000100000001801D800000000004002700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000002800000000000000000000000000000000010000000100000001801B80000000000000290000000000000000000000000000000001000000010000000180E57F0000000000002A00000000000000000000000000000000010000000100000001801C800000000000002B00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000002C00000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B0000020001002D0000000000000000000000000000000001000000010000000180F07F0000020000002E0000000000000000000000000000000001000000010000000180E8880000020000003700000000000000000000000000000000010000000100000001803B010000020001002F0000000000000000000000000000000001000000010000000180BB8A00000200010030000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6E0E01000002000000310000000D57617463682057696E646F7773000000000000000000000000010000000100000000000000000000000100000003001380D88B00000000000031000000085761746368202631000000000000000000000000010000000100000000000000000000000100000000001380D98B00000000000031000000085761746368202632000000000000000000000000010000000100000000000000000000000100000000001380CE01000000000000FFFFFFFF0C576174636820416E63686F720000000000000000010000000000000001000000000000000000000001000000000013800F0100000200000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000004001380D28B00000000000032000000094D656D6F7279202631000000000000000000000000010000000100000000000000000000000100000000001380D38B00000000000032000000094D656D6F7279202632000000000000000000000000010000000100000000000000000000000100000000001380D48B00000000000032000000094D656D6F7279202633000000000000000000000000010000000100000000000000000000000100000000001380D58B00000000000032000000094D656D6F72792026340000000000000000000000000100000001000000000000000000000001000000000013801001000002000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000040013809307000000000000330000000855415254202326310000000000000000000000000100000001000000000000000000000001000000000013809407000000000000330000000855415254202326320000000000000000000000000100000001000000000000000000000001000000000013809507000000000000330000000855415254202326330000000000000000000000000100000001000000000000000000000001000000000013809607000000000000330000001626446562756720287072696E746629205669657765720000000000000000000000000100000001000000000000000000000001000000000013803C010000020000003400000010416E616C797369732057696E646F7773000000000000000000000000010000000100000000000000000000000100000004001380658A000000000000340000000F264C6F67696320416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380DC7F0000000000003E0000001526506572666F726D616E636520416E616C797A6572000000000000000000000000010000000100000000000000000000000100000000001380E788000000000000380000000E26436F646520436F766572616765000000000000000000000000010000000100000000000000000000000100000000001380CD01000000000000FFFFFFFF0F416E616C7973697320416E63686F7200000000000000000100000000000000010000000000000000000000010000000000138053010000000000003F0000000D54726163652057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013805401000000000000FFFFFFFF115472616365204D656E7520416E63686F720000000000000000010000000000000001000000000000000000000001000000000013802901000000000000350000001553797374656D205669657765722057696E646F77730000000000000000000000000100000001000000000000000000000001000000010013804B01000000000000FFFFFFFF1453797374656D2056696577657220416E63686F720000000000000000010000000000000001000000000000000000000001000000000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000013800189000002000000360000000F26546F6F6C626F782057696E646F7700000000000000000000000001000000010000000000000000000000010000000300138044C5000000000000FFFFFFFF0E5570646174652057696E646F77730000000000000000010000000000000001000000000000000000000001000000000013800000000000000400FFFFFFFF000000000000000000010000000000000001000000000000000000000001000000000013805B01000000000000FFFFFFFF12546F6F6C626F78204D656E75416E63686F72000000000000000001000000000000000100000000000000000000000100000000000000000005446562756764020000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC88000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801780000000000000FFFFFFFF00010000000000000001000000000000000100000001801D80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001801A80000000000000FFFFFFFF00010000000000000001000000000000000100000001801B80000000000000FFFFFFFF0001000000000000000100000000000000010000000180E57F000000000000FFFFFFFF00010000000000000001000000000000000100000001801C80000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800089000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF0000000000000000000100000000000000010000000180E48B000000000000FFFFFFFF0001000000000000000100000000000000010000000180F07F000000000000FFFFFFFF0001000000000000000100000000000000010000000180E888000000000000FFFFFFFF00010000000000000001000000000000000100000001803B01000000000000FFFFFFFF0001000000000000000100000000000000010000000180BB8A000000000000FFFFFFFF0001000000000000000100000000000000010000000180D88B000000000000FFFFFFFF0001000000000000000100000000000000010000000180D28B000000000000FFFFFFFF00010000000000000001000000000000000100000001809307000000000000FFFFFFFF0001000000000000000100000000000000010000000180658A000000000000FFFFFFFF0001000000000000000100000000000000010000000180C18A000000000000FFFFFFFF0001000000000000000100000000000000010000000180EE8B000000000000FFFFFFFF00010000000000000001000000000000000100000001800000000000000000FFFFFFFF00000000000000000001000000000000000100000001800189000000000000FFFFFFFF000100000000000000010000000000000001000000 + + + 898 + 1900FFFF01001100434D4643546F6F6C426172427574746F6ECC880000000000000000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018017800000000000000100000000000000000000000000000000010000000100000001801D800000000000000200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001801A800000000000000300000000000000000000000000000000010000000100000001801B80000000000000040000000000000000000000000000000001000000010000000180E57F0000000000000500000000000000000000000000000000010000000100000001801C800000000000000600000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000018000890000000000000700000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180E48B000000000000080000000000000000000000000000000001000000010000000180F07F000000000000090000000000000000000000000000000001000000010000000180E8880000000000000A00000000000000000000000000000000010000000100000001803B010000000000000B0000000000000000000000000000000001000000010000000180BB8A0000000000000C0000000000000000000000000000000001000000010000000180D88B0000000000000D0000000000000000000000000000000001000000010000000180D28B0000000000000E000000000000000000000000000000000100000001000000018093070000000000000F0000000000000000000000000000000001000000010000000180658A000000000000100000000000000000000000000000000001000000010000000180C18A000000000000110000000000000000000000000000000001000000010000000180EE8B0000000000001200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180018900000000000013000000000000000000000000000000000100000001000000 + + + + 0 + 1536 + 864 + + + + + + 1 + 0 + + 100 + 6 + + ..\main.c + 2 + 308 + 318 + 1 + + 0 + + + ..\..\Firmware\STM32_file\stm32f10x.h + 35 + 106 + 116 + 1 + + 0 + + + ..\..\Utilities\gd32f10x_eval.c + 0 + 93 + 103 + 1 + + 0 + + + D:\heydn_lu\QR205_170_ST_GD\GD32F10x_Firmware_Library_V2.3.0\Utilities\gd32f10x_eval.h + 0 + 77 + 87 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\can_app.c + 0 + 543 + 549 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\can.h + 0 + 1008 + 1017 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.c + 16 + 12 + 22 + 1 + + 0 + + + ..\systick.c + 41 + 107 + 129 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\LED\led.c + 34 + 141 + 151 + 1 + + 0 + + + ..\..\Firmware\UDS\bootloader.c + 0 + 1 + 1 + 1 + + 0 + + + ..\..\Firmware\UDS\diagnosis_mid.c + 0 + 1 + 1 + 1 + + 0 + + + ..\..\Firmware\UDS\uds_did.c + 0 + 1 + 1 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\sys\sys.c + 20 + 44 + 45 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\sys\sys.h + 0 + 57 + 62 + 1 + + 0 + + + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + 0 + 162 + 167 + 0 + + 0 + + + ..\main.h + 0 + 1 + 1 + 1 + + 0 + + + D:\heydn_lu\QR205_170_ST_GD\GD32F10x_Firmware_Library_V2.3.0\Template\gd32f10x_it.h + 13 + 31 + 58 + 1 + + 0 + + + ..\gd32f10x_it.c + 0 + 123 + 148 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\delay\delay.c + 0 + 35 + 42 + 1 + + 0 + + + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_xd.s + 0 + 196 + 206 + 0 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\can.c + 0 + 1 + 1 + 1 + + 0 + + + ..\systick.h + 0 + 18 + 41 + 1 + + 0 + + + ..\..\Firmware\CMSIS\core_cm3.h + 0 + 1538 + 1543 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\CAN\CanDrvCtrl.c + 0 + 470 + 479 + 1 + + 0 + + + ..\..\Firmware\HARDWARE\chipID\chipid.c + 0 + 18 + 19 + 1 + + 0 + + + C:\Keil_v5\ARM\ARMCC\include\stdio.h + 0 + 717 + 727 + 1 + + 0 + + + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + 0 + 240 + 248 + 1 + + 0 + + + D:\heydn_lu\QR205_170_ST_GD\GD32F10x_Firmware_Library_V2.3.0\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_usart.h + 0 + 134 + 142 + 1 + + 0 + + + D:\heydn_lu\QR205_170_ST_GD\GD32F10x_Firmware_Library_V2.3.0\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h + 0 + 53 + 54 + 1 + + 0 + + + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_stm32f10x_cl.s + 0 + 154 + 158 + 0 + + 0 + + + ..\..\Firmware\STM32_file\system_stm32f10x.c + 0 + 263 + 267 + 1 + + 0 + + + D:\heydn_lu\QR205_170_ST_GD\GD32F10x_Firmware_Library_V2.3.0\Firmware\CMSIS\GD\GD32F10x\Include\system_gd32f10x.h + 17 + 31 + 52 + 1 + + 0 + + + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c + 0 + 2675 + 2682 + 1 + + 0 + + + ..\..\Firmware\STM32_file\stm32f10x_it.c + 2 + 124 + 134 + 1 + + 0 + + + ..\..\Firmware\SYSTEM\usart\usart.c + 35 + 1 + 11 + 1 + + 0 + + + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c + 0 + 295 + 297 + 1 + + 0 + + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvoptx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvoptx new file mode 100644 index 0000000..c2a8052 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvoptx @@ -0,0 +1,2018 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + GD32F10X_CL + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 4 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + DLGUARM + d + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0STM32F10x_CL -FL080000 -FS08000000 -FP0($$Device:STM32F105RC$Flash\STM32F10x_CL.FLM) + + + 0 + JL2CM3 + -U69400295 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_CL.FLM -FS08000000 -FL040000 -FP0($$Device:STM32F105RC$Flash\STM32F10x_CL.FLM) + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + + + + 0 + 1 + SysParaPileD.Debug_Page_function + + + 1 + 1 + BluetoothInfo.ConnectServerState + + + 2 + 1 + BluetoothInfo.State + + + 3 + 1 + BluetoothInfo.State + + + 4 + 1 + BluetoothInfo.ConnectServerState + + + 5 + 1 + SysParaPileD.Debug_Page_function + + + 6 + 1 + ModuleInfo.faultcode,0x0A + + + + 0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 0 + 2 + 10000000 + + + + + + GD32F10X_MD + 0x4 + ARM-ADS + + 12000000 + + 0 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 0 + + 255 + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + -1 + + + + + + + + + + + + + + + 0 + 0 + 45 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 1 + 0 + 51 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 2 + 0 + 317 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+ + 3 + 0 + 318 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+
+ + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + GD32F10X_HD + 0x4 + ARM-ADS + + 12000000 + + 0 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 0 + + 255 + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + -1 + + + + + + + + + + + + + + + 0 + 0 + 45 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 1 + 0 + 51 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 2 + 0 + 317 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+ + 3 + 0 + 318 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+
+ + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + GD32F10X_XD + 0x4 + ARM-ADS + + 12000000 + + 0 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 0 + + 255 + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + -1 + + + + + + + + + + + + + + + 0 + 0 + 45 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 1 + 0 + 51 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + + +
+ + 2 + 0 + 317 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+ + 3 + 0 + 318 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + ..\main.c + + +
+
+ + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application + 0 + 0 + 0 + 0 + + 1 + 1 + 1 + 0 + 0 + 0 + ..\gd32f10x_it.c + gd32f10x_it.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 + ..\main.c + main.c + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\systick.c + systick.c + 0 + 0 + + + 1 + 4 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32_file\stm32f10x_it.c + stm32f10x_it.c + 0 + 0 + + + + + CMSIS + 1 + 0 + 0 + 0 + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32_file\system_stm32f10x.c + system_stm32f10x.c + 0 + 0 + + + + + Peripherals + 0 + 0 + 0 + 0 + + 3 + 6 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c + gd32f10x_adc.c + 0 + 0 + + + 3 + 7 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c + gd32f10x_bkp.c + 0 + 0 + + + 3 + 8 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c + gd32f10x_can.c + 0 + 0 + + + 3 + 9 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c + gd32f10x_dac.c + 0 + 0 + + + 3 + 10 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c + gd32f10x_dbg.c + 0 + 0 + + + 3 + 11 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c + gd32f10x_dma.c + 0 + 0 + + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c + gd32f10x_enet.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c + gd32f10x_crc.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c + gd32f10x_exmc.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c + gd32f10x_exti.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c + gd32f10x_fmc.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c + gd32f10x_fwdgt.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c + gd32f10x_gpio.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c + gd32f10x_i2c.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c + gd32f10x_misc.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c + gd32f10x_pmu.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c + gd32f10x_rcu.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c + gd32f10x_rtc.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c + gd32f10x_sdio.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c + gd32f10x_spi.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c + gd32f10x_timer.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c + gd32f10x_usart.c + 0 + 0 + + + 3 + 28 + 1 + 0 + 0 + 0 + ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c + gd32f10x_wwdgt.c + 0 + 0 + + + + + Startup + 0 + 0 + 0 + 0 + + 4 + 29 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s + startup_gd32f10x_cl.s + 0 + 0 + + + 4 + 30 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s + startup_gd32f10x_hd.s + 0 + 0 + + + 4 + 31 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_md.s + startup_gd32f10x_md.s + 0 + 0 + + + 4 + 32 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_xd.s + startup_gd32f10x_xd.s + 0 + 0 + + + 4 + 33 + 2 + 0 + 0 + 0 + ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_stm32f10x_cl.s + startup_stm32f10x_cl.s + 0 + 0 + + + + + Utilities + 0 + 0 + 0 + 0 + + 5 + 34 + 1 + 0 + 0 + 0 + ..\..\Utilities\gd32f10x_eval.c + gd32f10x_eval.c + 0 + 0 + + + + + Doc + 1 + 0 + 0 + 0 + + 6 + 35 + 5 + 0 + 0 + 0 + ..\readme.txt + readme.txt + 0 + 0 + + + + + StdPeriph_Driver + 0 + 0 + 0 + 0 + + 7 + 36 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\misc.c + misc.c + 0 + 0 + + + 7 + 37 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c + stm32f10x_adc.c + 0 + 0 + + + 7 + 38 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c + stm32f10x_bkp.c + 0 + 0 + + + 7 + 39 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c + stm32f10x_can.c + 0 + 0 + + + 7 + 40 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c + stm32f10x_cec.c + 0 + 0 + + + 7 + 41 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c + stm32f10x_crc.c + 0 + 0 + + + 7 + 42 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c + stm32f10x_dac.c + 0 + 0 + + + 7 + 43 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c + stm32f10x_dbgmcu.c + 0 + 0 + + + 7 + 44 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c + stm32f10x_dma.c + 0 + 0 + + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c + stm32f10x_exti.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c + stm32f10x_flash.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c + stm32f10x_fsmc.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c + stm32f10x_gpio.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c + stm32f10x_i2c.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c + stm32f10x_iwdg.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c + stm32f10x_pwr.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c + stm32f10x_rcc.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c + stm32f10x_rtc.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c + stm32f10x_sdio.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c + stm32f10x_spi.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c + stm32f10x_tim.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c + stm32f10x_usart.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c + stm32f10x_wwdg.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 8 + 59 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\LED\led.c + led.c + 0 + 0 + + + 8 + 60 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\TIMER\timer.c + timer.c + 0 + 0 + + + 8 + 61 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\bsp_can.c + bsp_can.c + 0 + 0 + + + 8 + 62 + 1 + 1 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\can.c + can.c + 0 + 0 + + + 8 + 63 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\can_app.c + can_app.c + 0 + 0 + + + 8 + 64 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\can_nm.c + can_nm.c + 0 + 0 + + + 8 + 65 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\CanBusDrv.c + CanBusDrv.c + 0 + 0 + + + 8 + 66 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\CanDrvCtrl.c + CanDrvCtrl.c + 0 + 0 + + + 8 + 67 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\CAN\porting.c + porting.c + 0 + 0 + + + 8 + 68 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.c + app_pwr_manage.c + 0 + 0 + + + 8 + 69 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\24C0X\24cxx.c + 24cxx.c + 0 + 0 + + + 8 + 70 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\ADC\adc.c + adc.c + 0 + 0 + + + 8 + 71 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\DC300\dc300.c + dc300.c + 0 + 0 + + + 8 + 72 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\chipID\chipid.c + chipid.c + 0 + 0 + + + 8 + 73 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\ADS1015\ads1015.c + ads1015.c + 0 + 0 + + + 8 + 74 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\common\common.c + common.c + 0 + 0 + + + 8 + 75 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.c + bsp_i2c_gpio.c + 0 + 0 + + + 8 + 76 + 1 + 0 + 0 + 0 + ..\..\Firmware\HARDWARE\cupflash\bsp_cpu_flash.c + bsp_cpu_flash.c + 0 + 0 + + + + + UDS + 0 + 0 + 0 + 0 + + 9 + 77 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\bootloader.c + bootloader.c + 0 + 0 + + + 9 + 78 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\crc.c + crc.c + 0 + 0 + + + 9 + 79 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\diagnosis_mid.c + diagnosis_mid.c + 0 + 0 + + + 9 + 80 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\tp_cca.c + tp_cca.c + 0 + 0 + + + 9 + 81 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_api.c + uds_api.c + 0 + 0 + + + 9 + 82 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_can_interface.c + uds_can_interface.c + 0 + 0 + + + 9 + 83 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_did.c + uds_did.c + 0 + 0 + + + 9 + 84 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_interface.c + uds_interface.c + 0 + 0 + + + 9 + 85 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_manage.c + uds_manage.c + 0 + 0 + + + 9 + 86 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_nvm.c + uds_nvm.c + 0 + 0 + + + 9 + 87 + 1 + 0 + 0 + 0 + ..\..\Firmware\UDS\uds_services.c + uds_services.c + 0 + 0 + + + + + SYSTEM + 1 + 0 + 0 + 0 + + 10 + 88 + 1 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\delay\delay.c + delay.c + 0 + 0 + + + 10 + 89 + 1 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\sys\sys.c + sys.c + 0 + 0 + + + 10 + 90 + 1 + 0 + 0 + 0 + ..\..\Firmware\SYSTEM\usart\usart.c + usart.c + 0 + 0 + + + +
diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvprojx b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvprojx new file mode 100644 index 0000000..d9a6f06 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/Project.uvprojx differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/LED.map b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/LED.map new file mode 100644 index 0000000..9043509 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/LED.map differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/startup_stm32f10x_cl.lst b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/startup_stm32f10x_cl.lst new file mode 100644 index 0000000..15bd14f Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/list/startup_stm32f10x_cl.lst differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.crf new file mode 100644 index 0000000..6839913 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.d new file mode 100644 index 0000000..fe30b59 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.d @@ -0,0 +1,36 @@ +.\output\24cxx.o: ..\..\Firmware\HARDWARE\24C0X\24cxx.c +.\output\24cxx.o: ..\..\Firmware\HARDWARE\24C0X\24cxx.h +.\output\24cxx.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\24cxx.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\24cxx.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\24cxx.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\24cxx.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\24cxx.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\24cxx.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\24cxx.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\24cxx.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\24cxx.o: ..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.h +.\output\24cxx.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\24cxx.o: ..\..\Firmware\SYSTEM\sys\sys.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.o new file mode 100644 index 0000000..8e738ff Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/24cxx.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/App.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/App.bin new file mode 100644 index 0000000..d9b9856 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/App.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/DCBms.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/DCBms.hex new file mode 100644 index 0000000..867e604 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/DCBms.hex @@ -0,0 +1,6803 @@ +:020000040800F2 +:100000002045002085010008991D0008811800087E +:10001000951D0008B7020008B95400080000000050 +:10002000000000000000000000000000D9200008CF +:100030005F0F000800000000A11E00085D270008F7 +:100040009F0100089F0100089F0100089F01000810 +:100050009F0100089F0100089F0100089F01000800 +:100060009F0100089F0100089F0100089F010008F0 +:100070009F0100089F0100089F0100089F010008E0 +:100080009F0100089F0100089F0100089F010008D0 +:10009000BD0200089F010008D90200089F01000866 +:1000A0009F0100089F0100089F0100089F010008B0 +:1000B0009F010008812800089F0100089F01000897 +:1000C0009F0100089F0100089F0100089F01000890 +:1000D0009F0100089F0100089F0100089F01000880 +:1000E0009F0100089F0100089F0100080000000018 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000009F0100089F0100089F +:100110009F0100089F0100089F0100089F0100083F +:100120009F0100089F0100089F0100089F0100082F +:100130009F0100089F0100089F0100089F0100081F +:100140009F01000879040008AD0400089F01000821 +:10015000DFF80CD000F068F800480047C9570008E5 +:1001600020450020EFF30980704780F3098870472D +:10017000EFF30880704780F30888704740BA7047F3 +:10018000C0BA70470648804706480047FEE7FEE7CA +:10019000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE737 +:1001A000152800085101000810B5431A934209D2DE +:1001B0008318881803E010F8011D03F8011D521E72 +:1001C000F9D210BD40EA01039B0703D009E008C93A +:1001D000121F08C0042AFAD203E011F8013B00F80C +:1001E000013B521EF9D210BDD2B201E000F8012B42 +:1001F000491EFBD270470022F6E710B513460A46A7 +:1002000004461946FFF7F0FF204610BD30B50446FE +:100210000020034600E05B1C934203D2E05CCD5C0F +:10022000401BF8D030BD0000064C074D06E0E068EA +:1002300040F0010394E8070098471034AC42F6D32D +:10024000FFF78AFFFC5B00081C5C000870B58C1887 +:1002500010F8015B15F0070301D110F8013B2A11DA +:1002600006D110F8012B03E010F8016B01F8016BC7 +:100270005B1EF9D12B0705D40023521E0DD401F8C3 +:10028000013BFAE710F8013BCB1A921C03E013F88C +:10029000015B01F8015B521EF9D5A142D8D30020C1 +:1002A00070BD10B501214FF0C05001F01FFE0120BC +:1002B00001F0C6FD10BD00BFFEE7000000B585B02F +:1002C000002005F0C5F96A460021024800F095FBC0 +:1002D00005B000BD0064004010B54FF40071154832 +:1002E00000F068FA01280DD11349124800F026FAEF +:1002F000012802D1002005F067F94FF400710D4884 +:1003000000F028F94FF480610A4800F053FA012800 +:100310000ED10949891C074800F010FA012802D1C2 +:10032000002005F065F94FF48061024800F012F9F1 +:1003300010BD0000006400400200F01000B589B05C +:100340000121092001F0F2FD0121480601F0CEFD56 +:100350000121880601F0CAFD4FF40050ADF82000DD +:1003600003208DF8220018208DF8230008A94048AA +:1003700000F033FF4FF48050ADF8200048208DF896 +:10038000230008A93A4800F028FF00208DF81A0041 +:1003900001208DF81B0000208DF81C008DF81D0039 +:1003A0008DF81E008DF81F008DF8160001208DF8C5 +:1003B000170008208DF8180001208DF8190006207C +:1003C000ADF8140005A92B4800F08DFA0E208DF829 +:1003D0000E0000208DF80F0001208DF81000002085 +:1003E000ADF80400ADF80600ADF80800ADF80A005D +:1003F0000120ADF80C008DF8110001A800F01AF9E9 +:10040000012210211B4800F065FA41208DF8000000 +:1004100001208DF8010000208DF8020001208DF8E8 +:100420000300684601F0C0FC012005F005F9012237 +:100430005102104800F04EFA012291020D4800F0DE +:1004400049FA0122D1030B4800F044FA42208DF80A +:10045000000001208DF8010000208DF8020001202D +:100460008DF80300684601F09FFC002009B000BD34 +:10047000000C01400068004010B586B00024012047 +:1004800005F0E6F801AA0121074800F0B6FA059840 +:10049000009001A80FC804F0DFFE142101A8FFF7A7 +:1004A000AAFE06B010BD00000068004010B54FF471 +:1004B0000071184800F07EF9012810D1164915483E +:1004C00000F03CF9012805D105F07EF812491148E9 +:1004D00000F024F84FF400710E4800F03BF84FF4A0 +:1004E00080610C4800F066F9012812D10A49891C84 +:1004F000084800F023F9012806D105F079F80649EB +:10050000891C044800F00AF84FF48061014800F0AB +:1005100021F810BD006800400200F01000220C4BD2 +:10052000994202D10023836111E0C1F3130201F06B +:1005300000730BB1C2600AE001F080630BB102618D +:1005400005E001F000630BB1826000E0426070479B +:100550007000F030B1F5007F3AD00FDC202928D0B0 +:1005600006DC01291CD004291DD0082940D11DE03A +:10057000402921D0B1F5807F3AD126E0B1F5004F76 +:1005800031D006DCB1F5806F25D0B1F5006F2FD1E9 +:1005900024E0B1F5803F12D0B1F5003F28D111E041 +:1005A000154A826025E00822C26022E01022C26063 +:1005B0001FE0082202611CE01022026119E00822FB +:1005C000426016E01022426013E00422426010E014 +:1005D000042242600DE0042242600AE000228261AF +:1005E0000422426005E0002282610422426000E0B1 +:1005F00000BF00BF704700000101010010B50446B4 +:100600000B48844209D10121480601F07FFC0021FA +:100610004FF0007001F07AFC08E00121880601F03B +:1006200075FC00214FF0806001F070FC10BD0000EF +:100630000064004010B50021837A012202FA03F120 +:100640003D4A126842F001023B4B1A603A4A1C32A2 +:1006500012688A43384B1C331A60027BCAB9364A87 +:100660000C3212688A43344B0C331A604288C388B8 +:1006700042EA0343304A4032847A42F834300288F6 +:10068000838842EA03432C4A4032847A02EBC40254 +:100690005360027B012A19D1274A0C3212680A439F +:1006A000254B0C331A604288038842EA0343224AEE +:1006B0004032847A42F83430C288838842EA034365 +:1006C0001D4A4032847A02EBC4025360C27A3AB9BE +:1006D000194A121D12688A43174B1B1D1A6006E047 +:1006E000154A121D12680A43134B1B1D1A6002891A +:1006F00032B9114A143212688A430F4B14331A600C +:100700000289012A06D10C4A143212680A430A4BA4 +:1007100014331A60427B012A06D1074A1C32126840 +:100720000A43054B1C331A60034A126822F0010287 +:10073000014B1A6010BD00000066004010B5024673 +:10074000002001F4700343B19369C1F31304234003 +:100750000BB101202DE000202BE001F0807343B1AC +:100760005368C1F3130423400BB1012021E00020A2 +:100770001FE001F0006343B19368C1F31304234009 +:100780000BB1012015E0002013E001F0007343B12C +:10079000D368C1F3130423400BB1012009E000200A +:1007A00007E01369C1F3130423400BB1012000E0FB +:1007B000002010BD70B504460D4600266069284033 +:1007C000002871D0B5F5807F5CD010DC082D35D0C5 +:1007D00006DC012D20D0022D24D0042D72D127E07B +:1007E000102D31D0202D35D0402D6BD138E0B5F50E +:1007F000004F60D009DCB5F5007F49D0B5F5806FBA +:100800004CD0B5F5006F5DD14FE0B5F5803F2DD0F0 +:10081000B5F5003F56D12FE0A0682D4900F0F2FA5F +:10082000064651E0E068032100F0ECFA06464BE092 +:10083000E068082100F0E6FA064645E0E06810218D +:1008400000F0E0FA06463FE02069032100F0DAFA02 +:10085000064639E02069082100F0D4FA064633E064 +:100860002069102100F0CEFA06462DE060680821CC +:1008700000F0C8FA064627E06068102100F0C2FACE +:10088000064621E0A069012100F0BCFA06461BE003 +:10089000A069022100F0B6FA064615E0A06904211D +:1008A00000F0B0FA06460FE00FE0A069702100F0FA +:1008B000A9FA064608E06068042100F0A3FA06469B +:1008C00002E0FFE7002600BF00E00026304670BDD2 +:1008D000010101001AB143690B43436102E043691E +:1008E0008B434361704730B50246002000231468F3 +:1008F00024F002041460146844F00104146000E061 +:100900005B1C546804F001041CB94FF6FF74A34249 +:10091000F6D1546804F001040CB900206CE08C7925 +:10092000012C04D1146844F08004146003E01468BE +:1009300024F080041460CC79012C04D1146844F0B4 +:100940004004146003E0146824F0400414600C7A3E +:10095000012C04D1146844F02004146003E01468EE +:1009600024F0200414604C7A012C04D1146844F063 +:100970001004146003E0146824F0100414608C7AEE +:10098000012C04D1146844F00804146003E01468D6 +:1009900024F008041460CC7A012C04D1146844F0CB +:1009A0000404146003E0146824F0040414608C78D8 +:1009B000A407CD7844EA05640D7944EA05444D79ED +:1009C00044EA05540D886D1E2C43D461146824F04C +:1009D00001041460002300E05B1C546804F001046F +:1009E0001CB14FF6FF74A342F6D1546804F0010421 +:1009F0000CB1002000E0012030BD10B500F5D87327 +:100A000003EB01131B6803F004031372137A53B949 +:100A100000F5D87303EB01131B6840F2FF7404EA7E +:100A20005353136009E000F5D87303EB01131B68FF +:100A30006FF0604404EAD303536000F5D87303EB0E +:100A400001131B6803F00203537200F5D87303EB24 +:100A500001135B6803F00F03937200F5D87303EB87 +:100A600001135B681B0AD37400F5D87303EB011301 +:100A70009B68D37200F5D87303EB01139B681C0AC3 +:100A8000147300F5D87303EB01139B681C0C5473AB +:100A900000F5D87303EB01139B681B0E937300F5ED +:100AA000D87303EB0113DB68D37300F5D87303EB42 +:100AB0000113DB681C0A147400F5D87303EB0113EF +:100AC000DB681C0C547400F5D87303EB0113DB686E +:100AD0001B0E937421B9C36843F02003C36003E085 +:100AE000036943F02003036110BD10B502460020E6 +:100AF000936803F08063B3F1806F00D110E09368D6 +:100B000003F00063B3F1006F01D1012008E09368A6 +:100B100003F08053B3F1805F01D1022000E0042094 +:100B2000042874D002F5C07303EB00131B6803F0B4 +:100B3000010402F5C07303EB00131C600B7A7BB950 +:100B40004B7A0C8843EA445302F5C07404EB00145A +:100B50002468234302F5C07404EB0014236010E002 +:100B60000B7A4C6843EAC4034C7A234302F5C07401 +:100B700004EB00142468234302F5C07404EB001452 +:100B800023608B7A03F00F038B7202F5C07303EBC3 +:100B900000135B6823F00F0402F5C07303EB00132E +:100BA0005C6002F5C07303EB00135B688C7A23432F +:100BB00002F5C07404EB001463608B7B1C064B7B56 +:100BC00044EA03440B7B44EA0323CC7A234302F533 +:100BD000C07404EB0014A3608B7C1C064B7C44EABD +:100BE00003440B7C44EA0323CC7B234302F5C0740B +:100BF00004EB0014E36002F5C07303EB00131B6801 +:100C000043F0010402F5C07303EB00131C6010BD38 +:100C100010B50246002321B1012907D002290FD1C6 +:100C200009E090681D4C00EA04030BE090681C4C3E +:100C300000EA040306E090681A4C00EA040301E0AD +:100C4000002300BF00BF184C181BA34216D007DCBE +:100C500083B16FF08060184470B1022818D111E0A0 +:100C6000B0F5007F10D0114C204448B1B0F5003FE2 +:100C70000ED10BE002230DE000230BE0002309E07E +:100C8000002307E0012305E0012303E0012301E045 +:100C9000002300BF00BFD8B210BD00000300000455 +:100CA0000003000800000310000100080001FFF726 +:100CB0004FF6FF710180704770B50B4600210BE0C5 +:100CC0005D5C068885EA2624054D35F814500678C3 +:100CD00085EA06250580491C9142F1D370BD0000CC +:100CE00032590008F0B504460D462946204600F06A +:100CF00009F80746615D681C205C41EA002686EA27 +:100D00000700F0BD70B502464FF6FF7048F20505CA +:100D100017E0491E12F8014B80EA042000230EE080 +:100D200000F400462EB14FF6FF7606EA4000684018 +:100D300003E04FF6FF7606EA40005E1CF3B2082B94 +:100D4000EEDB0029E5D170BD30B50B46002104E093 +:100D50005D5C04682C440460491C9142F8D330BDAA +:100D60000FB430B585B00024142208A96846FFF7F7 +:100D70001BFA012004F080FC20B9012005B030BC32 +:100D80005DF814FB69460E48FFF7AFFE05460024E8 +:100D900001E0601C84B2012004F06EFC40B12946E1 +:100DA0000748FFF735FF18B940F6FF708442F0DBC3 +:100DB00040F6FF70844201DB0120DFE70020DDE721 +:100DC00000680040002001207047000010B50B486B +:100DD000C07E0B4981F822000848407801280CD1D8 +:100DE00006488078012808D100200449487088709E +:100DF00000F042FD01200149487110BD4C3A00202D +:100E0000300600200246002002EA01030BB1012057 +:100E100000E0002070470000002003490978C1F37A +:100E2000800101B101207047DD0600200020034948 +:100E30000978C1F3400101B101207047DD060020AF +:100E400010B5034600202AB18B4201D0012006E0F4 +:100E5000002004E08B4201D1012000E0002010BD01 +:100E600001460020084A128A8A420BD0064A528A5A +:100E70008A4207D0044A52888A4203D0024A128822 +:100E80008A4200D1012070476C5B000801460020B7 +:100E9000012901D0032900D101207047014600201B +:100EA00001F0800202B901207047024600208A4208 +:100EB00000D10120704700000020054A937B527B3F +:100EC00003EB022291B2502900DC012070470000A0 +:100ED000DD060020002002490880091D08807047B7 +:100EE000B06C00402DE9F8436946164800F088F8D8 +:100EF000DFF85490002420E0144931F8140000F089 +:100F0000CFFA0546FF2D16D0114830F8150000EB3A +:100F10000908104830F814600F4830F814000099A0 +:100F2000471831463846FFF7DDFE20B932463946CC +:100F30004046FFF739F9601CC4B20C2CDCDBBDE87D +:100F4000F8830000A03A002030060020D65B00089D +:100F5000325B0008BE5B0008A65B00087047704764 +:100F600010B5044606E0142004F0A8FA00F080FD55 +:100F7000601E84B2002CF6DC10BD00002DE9F84F95 +:100F800083464FF0000A00200090584600F09CFA7B +:100F90008046B8F1FF0F27D0584600F081FA054689 +:100FA000FF2D21D01148445DDFF84490114830F8FE +:100FB000150000EB090621463046FFF7A3FE87B275 +:100FC0003755641C38123055641C0B4830F8180033 +:100FD0000A4900EB010ABAF1000F05D000232246AE +:100FE0003146504600F01EF8BDE8F88F585B000807 +:100FF00030060020325B0008A65B0008A03A002003 +:1010000002460748904201D1086007E0044846388C +:10101000904201D1086001E0002070470120FCE708 +:10102000E63A00202DE9F04104460D4616461F46DB +:101030003B4632462946204604F05AFC0120BDE8D2 +:10104000F0812DE9F04104460E4600270025C4F347 +:101050000A0010B10120BDE8F08100F09FF83520B2 +:1010600000F014F8254608E0284600F015F804289A +:1010700001D0012704E005F50065A019A842F3D8C6 +:1010800000BF00F049F83846E5E700000149C860B4 +:10109000704700000020024030B5044604250F4888 +:1010A00000F088F80546042D16D10D48006940F07F +:1010B00002000B49086108464461006940F04000A5 +:1010C0000861064800F076F805460548006941F6D3 +:1010D000FD71084002490861284630BDFFFF0F003E +:1010E0000020024004200B49C96801F0010109B148 +:1010F00001200EE00749C96801F0040109B102208E +:1011000007E00449C96801F0100109B1032000E0BB +:1011100004207047002002400348006940F080002E +:1011200001490861704700000020024078B506467A +:101130000C460425002000904FF6FF7000F03AF8AE +:101140000546042D26D11448006940F001001249DB +:10115000086134804FF6FF7000F02CF80546042D2E +:1011600011D1B01C0090200C009908804FF6FF7040 +:1011700000F020F805460848006941F6FE71084075 +:101180000549086106E00448006941F6FE7108401F +:1011900001490861284678BD002002400248034901 +:1011A00048600348486070472301674500200240BB +:1011B000AB89EFCD00B502460423FFF793FF03464A +:1011C00003E0FFF78FFF0346521E012B01D1002AD7 +:1011D000F7D102B90523184600BD2DE9F0410246BA +:1011E00000250026002000230024002791F803C0DA +:1011F0000CF00F0591F803C00CF0100CBCF1000FBF +:1012000003D091F802C04CEA050591F800C0BCF18A +:10121000000F31D0146800202BE04FF0010C0CFAC5 +:1012200000F3B1F800C00CEA03069E4220D183000F +:101230004FF00F0C0CFA03F7BC4305FA03FC4CEA21 +:10124000040491F803C0BCF1280F06D14FF0010C43 +:101250000CFA00FCC2F814C00AE091F803C0BCF11B +:10126000480F05D14FF0010C0CFA00FCC2F810C079 +:10127000401C0828D1D31460B1F800C0BCF1FF0FA6 +:1012800034DD546800202EE000F1080C4FF0010816 +:1012900008FA0CF3B1F800C00CEA03069E4221D113 +:1012A00083004FF00F0C0CFA03F7BC4305FA03FC64 +:1012B0004CEA040491F803C0BCF1280F05D100F1F9 +:1012C000080C08FA0CF8C2F8148091F803C0BCF1BD +:1012D000480F07D100F1080C4FF0010808FA0CF88C +:1012E000C2F81080401C0828CED35460BDE8F081BD +:1012F000F0B50A46002300240021002500F0004636 +:10130000B6F1004F02D11D4EF16901E01B4E71682C +:10131000C0F3034583B200F44016B6F5401F08D170 +:1013200021F07061154E766826F07066134F7E606E +:1013300012E000F48016B6F5801F06D1032606FAE7 +:1013400005F4A14341F0706106E0460D360103FA51 +:1013500006F6B14341F0706122B1460D360103FA41 +:1013600006F6314300F00046B6F1004F02D1034EBD +:10137000F16101E0014E7160F0BD0000000001402C +:10138000416170470161704718B501460C128DF834 +:101390000040CCB28DF801404FF6FE70002221E0F3 +:1013A0001DF8024080EA0420002317E000F4004406 +:1013B00074B100F080042CB148F2084484EA40047F +:1013C000A0B209E048F2250484EA4004A0B203E098 +:1013D0004FF6FF7404EA40005C1CE3B2082BE5DB27 +:1013E000541CE2B2022ADBDB18BD70B5044603F0E0 +:1013F0000BFF45432570280C6070002070BD000075 +:101400002DE9F047064600240027204890F82A00DE +:101410001E4991F8291000EB012087B26222214673 +:10142000641C72543A0A2146641C72542146641C9E +:101430007754DFF85C90002507E0164830F8150077 +:10144000B84200D103E0681CC5B2132DF5DB00BF24 +:10145000132D01D1022404E03846FFF701FD00B945 +:101460000224022C0ED00C4810F805800B4A32F8EA +:10147000152002EB090130194246FEF795FE04EBF8 +:10148000080084B22046BDE8F08700004C3A0020F6 +:10149000300600206C5B0008585B0008325B0008D7 +:1014A0000246FF20002108E0064B33F8113093423A +:1014B00001D1084603E04B1CD9B21329F4D300BF75 +:1014C000704700006C5B00080246FF20002108E026 +:1014D000064B33F81130934201D1084603E04B1C10 +:1014E000D9B20C29F4D300BF70470000D65B0008C6 +:1014F0000448007820B1002002490870012070479C +:101500000020FCE7580000200648006806490860F3 +:101510000448001F00684860024808380068886076 +:1015200070470000F0F7FF1F600100205C48008852 +:10153000401C80B25A4908800A2879DB00200880C4 +:101540005848C08FB0F5FA7F2FDA5648C08F401C3C +:101550005449C8870846C08FB0F5FA7F25D10020CE +:1015600008720846C07E032803D00846C07E0228C1 +:101570001BD100204B4988760120C876002081F8D5 +:1015800020008871C88781F8220081F8230081F843 +:101590002500C87344480079012803D1002042493E +:1015A000C882087101203F4908703E4890F8220027 +:1015B00058B13E48007820F001003C4908700846C8 +:1015C000007820F0020008700CE03848007820F025 +:1015D0000100401C354908700846007820F00200E0 +:1015E000801C08702F4890F8230058B12F480078CD +:1015F00020F004002D4908700846007820F008000B +:1016000008700CE02948007820F00400001D2749EC +:1016100008700846007820F0080008300870244858 +:101620000088401C80B222490880642801DA704793 +:1016300033E000201E4908801A4890F82700D8B1EE +:10164000184890F82700401E164981F827000846E0 +:1016500090F8270080B90846C07801280CD10020F6 +:10166000C870084690F82600002805DD084690F866 +:101670002600401E81F826000A48007A30B10B4847 +:10168000007820F010000949087006E0074800784B +:1016900020F0100010300549087000BFC7E70000B7 +:1016A0002E0100204C3A0020183200206C0000204F +:1016B0002C0100207047704770B505460E4608485B +:1016C0000670002404E0285D06490855601CC4B279 +:1016D000034800788442F6DB01F092F970BD000007 +:1016E00039010020300100200146002004E0054AB5 +:1016F000125C0A54421CD0B2034A12789042F6DBC4 +:1017000070470000300100203901002070B5044608 +:101710000D4601F081FA064632462946204603F07E +:10172000BFFC70BD70B505460E4608480670002423 +:1017300004E0285D06490855601CC4B203480078DF +:101740008442F6DB01F0E0F970BD000039010020B1 +:101750003001002010B501F0F1FA10BD10B50446BB +:1017600003F032FD00200149087010BD380100204F +:101770000148007870470000390100207FB5054618 +:101780000E48006800900E4800788DF80400002490 +:1017900005E0295D0DF105000155601CC4B2084843 +:1017A00000788442F5DB01208DF80D000549487072 +:1017B0009DE80F0002F08AFB7FBD00003C01002085 +:1017C0003A0100204C3A002001490870704700009F +:1017D0003A01002020B940F29571044A116003E0FB +:1017E00040F29571014A1160704700003C010020F1 +:1017F000704700002DE9F04105460E4601F00CFA55 +:1018000004460A48007878B97F2020706570A67079 +:1018100003270020FFF7DEFF01F0F4FD384601F05A +:101820005BFA012001490870BDE8F0813801002011 +:101830002DE9F04105460E4601F0EEF980460D48CF +:101840000078A8B9A5B1002404E0305D08F80400D0 +:10185000601C84B2AC42F8DB2F460020FFF7BAFFD1 +:1018600001F0D0FD384601F037FA01200149087037 +:10187000BDE8F0813801002010B501F063F810BD1B +:1018800000BFFEE710B54FF400600B49086003F09D +:1018900094FF4FF480600849091F086003F08DFF32 +:1018A0004FF480600449086003F087FF4FF4006044 +:1018B0000149091F086010BD140C014010B54FF418 +:1018C00000600949086003F078FF4FF48060064922 +:1018D000086003F072FF4FF480600349091D08603F +:1018E00003F06BFF10BD0000100C014070B5054601 +:1018F0000024002618E06006040E4FF480600F49B3 +:10190000086003F05AFF0D480838006800F40060D2 +:1019100008B1601CC4B24FF480600849091D08601A +:1019200003F04BFF701CC6B2082EE4DB15B9FFF7BD +:10193000C5FF01E0FFF7A6FF204670BD100C014077 +:1019400070B50446002524E004F0800020B14FF477 +:1019500000601149086004E04FF400600E49091D61 +:10196000086003F02AFF4FF480600B49086003F021 +:1019700024FF4FF480600849091D0860072D02D13B +:101980004000091F08606006040E03F016FF681C83 +:10199000C5B2082DD8DB70BD100C014010B54FF456 +:1019A00000600A4908604010086003F006FF4FF429 +:1019B00000600649091D086003F0FFFE4FF48060D7 +:1019C0000249091D086003F0F8FE10BD100C01402B +:1019D00010B54FF40060074908604010091F086007 +:1019E00003F0EBFE4FF400600249091F086003F0AA +:1019F000E4FE10BD140C014010B54FF400600E4918 +:101A0000086003F0DAFE4FF480600B49086003F0D1 +:101A1000D4FE09480838006800F4006008B10124C9 +:101A200000E000244FF480600349091D086003F0C2 +:101A3000C4FE204610BD0000100C014070B50546E4 +:101A40000C4645F2555000F033F8284600F024F8D3 +:101A5000204600F027F800F017F800F001F870BDFC +:101A60004CF6CC400149086070470000003000404F +:101A700010B500F009F810BD10B540F6354104204E +:101A8000FFF7DCFF10BD00004AF6AA2001490860FC +:101A90007047000000300040014948607047000076 +:101AA000003000400149886070470000003000406D +:101AB0000149086070470000003000402DE9F04700 +:101AC0002D4804682D48844201D0BDE8F0872A489B +:101AD000001D0468B4F5205F02D3B4F5D03F00D9EF +:101AE000F3E7A60804F0030000B1761CDFF890804D +:101AF000244DFFF753FB002724E04FF0000AD8F8ED +:101B00000040C5F30A0010B92846FFF7C5FA0EE0F9 +:101B100021462846FFF70AFB042800D108E00AF115 +:101B2000010000F0FF0ABAF1030F00DB00E0EFE76D +:101B300000BFD5F800904C4500D005E008F104083E +:101B40002D1D7F1CB742D8D300BF0B48FFF7A4FA66 +:101B5000FFF7E2FA0B4840680B4908600846006846 +:101B60000A49086007490868FEF705FB074800684E +:101B7000804700BFA9E70000005802084433221143 +:101B800000600208008000081800002014000020F7 +:101B90000020054A1188121F128842EA0141034AB7 +:101BA000914200D101207047B46C00405CBA55AA44 +:101BB00010B572B6FFF782FFFFF7EAFF28B10120E8 +:101BC0000F490870FFF786F917E00E4800680E49C4 +:101BD0000840B0F1005F10D100F022FD09484068D4 +:101BE0000A4908600846006809490860054908680C +:101BF000FEF7C1FA06480068804762B610BD0000D3 +:101C000058000020008000080000FE2F6000002027 +:101C10005C00002008B501211C2000F087F94FF47A +:101C20000070ADF8000010208DF8030003208DF83F +:101C3000020069465348FFF7D0FA4FF4007151484B +:101C4000FFF7A0FB0120ADF8000010208DF8030085 +:101C500003208DF8020069464A48FFF7BEFA0121C9 +:101C60004848FFF78FFB40F20240ADF8000010201B +:101C70008DF8030003208DF8020069464148FFF704 +:101C8000ACFA02213F48FFF77DFB4FF480613D48ED +:101C9000FFF776FBA020ADF8000010208DF80300C0 +:101CA00003208DF8020069463748FFF796FA202195 +:101CB0003548FFF765FB80213348FFF763FB44F2AB +:101CC0002720ADF8000010208DF8030003208DF8C8 +:101CD000020069462D48FFF780FA4FF400712B4847 +:101CE000FFF750FB01212948FFF74AFB0221274853 +:101CF000FFF746FB04212548FFF742FB4FF48041E4 +:101D00002248FFF73DFB20212048FFF739FB4FF425 +:101D10008070ADF8000048208DF80300694619482E +:101D2000FFF75BFA4FF40070ADF8000048208DF823 +:101D3000030069461448FFF750FA0121084600F0F5 +:101D4000F5F801211248FFF7D3FA1020ADF8000092 +:101D500001208DF8020010208DF8030069460B4821 +:101D6000FFF73BFA10210948FFF70CFB4FF4005036 +:101D7000ADF8000004208DF8030069460248FFF723 +:101D80002CFA08BD0008014000100140000C014081 +:101D90000001300000BFFEE7704710B54FF4A060AF +:101DA00000F03AF810BD000070B5002100230F22AA +:101DB000C47804B3154C246804F4E064C4F5E0640A +:101DC000210AC1F10403CA40447804FA03F184787B +:101DD0001440214309010E4C0678A155047804F003 +:101DE0001F050124AC4005786D11AD0005F1E0251B +:101DF000C5F8004109E0047804F01F050124AC4057 +:101E0000044D0678761145F8264070BD0CED00E0D3 +:101E100000E400E080E100E002490143024A116071 +:101E2000704700000000FA050CED00E010B54FF41B +:101E300000720021014803F0D2F910BDA03A002041 +:101E4000014908627047000000000E421FB50120E2 +:101E5000124908720020C8870098A0F2857010B15E +:101E60005A2818D10BE040F285700C49A1F84C00BB +:101E70009DF804100DF10500FFF754FC0CE040F252 +:101E8000DF700649A1F84C009DF804100DF1050023 +:101E9000FFF712FC00E000BF00BF1FBD4C3A00205E +:101EA00070472DE9F04106460C4617464FF00008F2 +:101EB0000025FFF773F93520FFF7E8F835460CE009 +:101EC00028462168FFF732F928682168884202D045 +:101ED0004FF0010804E02D1D241DF019A842EFD891 +:101EE00000BFFFF719F94046BDE8F08129B1064A65 +:101EF000D2690243044BDA6104E0034AD2698243A7 +:101F0000014BDA61704700000010024029B1064A17 +:101F100012690243044B1A6104E0034A12698243C6 +:101F2000014B1A61704700000010024029B1064AB7 +:101F300092690243044B9A6104E0034A9269824326 +:101F4000014B9A6170470000001002402DE9F041FA +:101F500000210022002500230026002400278C46B3 +:101F6000DFF86081D8F8048008F00C0121B1042961 +:101F700007D0082959D109E0DFF84C81C0F800806A +:101F800058E0DFF84481C0F8008053E0DFF8348186 +:101F9000D8F8048008F47012DFF82881D8F804809B +:101FA00008F48035920C0D2A01D0921C00E0062224 +:101FB00035B9DFF8188102FB08F8C0F8008033E07B +:101FC000DFF80081D8F82C8008F48036DFF8F48040 +:101FD000D8F82C8008F00F0808F1010446B9DFF8A2 +:101FE000E880B8FBF4F808FB02F8C0F800801BE0BA +:101FF000DFF8D080D8F82C80C8F3031808F1010767 +:10200000DFF8C080D8F82C80C8F3032808F1020C50 +:10201000DFF8B480B8FBF7F808FB0CF8B8FBF4F86D +:1020200008FB02F8C0F8008004E0DFF89C80C0F8EC +:10203000008000BF00BFDFF88C80D8F8048008F073 +:10204000F0010909DFF8888018F80130D0F8008025 +:1020500028FA03F8C0F80480DFF86880D8F8048014 +:1020600008F4E061090ADFF8688018F80130D0F858 +:10207000048028FA03F8C0F80880DFF84880D8F810 +:10208000048008F46051C90ADFF8448018F8013070 +:10209000D0F8048028FA03F8C0F80C80DFF8248018 +:1020A000D8F8048008F44041890BDFF8288018F83C +:1020B0000130D0F80C80B8FBF3F8C0F81080BDE810 +:1020C000F08100000010024000127A0000093D007B +:1020D0004300002053000020704700002DE9F0412C +:1020E00004460D46002700266078217800EB012089 +:1020F00086B21A48008AB04211D11948007AA84223 +:102100000BD1184890F8200028B12A46A11C164887 +:10211000FEF74AF81BE0332719E0132717E00F48B2 +:10212000408AB04212D10E48407AA8420CD10D48E4 +:1021300090F8200030B12A46A11C0B480E30FEF763 +:1021400033F804E0332702E0132700E0312717B902 +:102150003046FEF713FF3846BDE8F0816C5B00089F +:10216000585B00084C3A0020AA0600202DE9F04FE9 +:102170008DB0044691469A464FF0000BD846002594 +:1021800000260027F048B0F84000042803DA1320A6 +:102190000DB0BDE8F08F94F80080A078617840EA37 +:1021A000012571223046711C8EB20DF80020227874 +:1021B0003046711C8EB20DF8002062783046711CDA +:1021C0008EB20DF80020A2783046711C8EB20DF848 +:1021D0000020B8F1010F71D1DB49B1F840000621B0 +:1021E000FEF763FE18B14DF60420854215D0D6499E +:1021F000B1F840000C21FEF758FE10B1B5F57F4F45 +:102200000BD0D149B1F840000E21FEF74EFE002858 +:102210007AD04FF6017085427ED1CB4890F82000ED +:10222000002876D0A5F55A40043830B1A0F51050FA +:10223000FC38B8B101286AD141E0C44890F83008B0 +:1022400003280CD12079E17800EB0120BF49888276 +:1022500001273046711C8EB20DF8007001E04FF07E +:10226000220B55E0E0780006217900EB014061790E +:1022700000EB0120A1790844B449C860E079000668 +:10228000217A00EB0140617A00EB0120A17A084439 +:10229000AE4908610846C068AD49884206D04FF093 +:1022A000720B0120A94981F8280806E04FF0780B4D +:1022B0000120A649087081F8240829E03DE0E07873 +:1022C0000006217900EB0140617900EB0120A17942 +:1022D0000844A0490860E0790006217A00EB01403B +:1022E000617A00EB0120A17A08449B490860207BB9 +:1022F000E17A00EB01209949088001273046711CE2 +:102300008EB20DF8007003E006E002E0FFE700BFC8 +:102310000EE14FF0330B0BE14DF60420854206D061 +:10232000B5F57F4F03D04FF60170854202D14FF0D3 +:10233000130BFDE04FF0310BFAE0B8F1030F61D160 +:102340008149B1F840000421FEF7AFFD18B14DF608 +:102350000420854214D07C49B1F840000421FEF7E6 +:10236000A4FD10B1B5F57F4F0AD07749B1F8400010 +:102370000421FEF79AFD78B34FF60170854230D103 +:10238000714890F8200040B3A5F55A40043830B1A8 +:10239000A0F51050FC3850B101281BD100E000BF5F +:1023A00002273046711C8EB20DF8007013E06748AA +:1023B0008079022801D1022706E06448807901284B +:1023C00001D1032700E005273046711C8EB20DF8BD +:1023D000007000E000BFABE003E0FFE74FF0330B1D +:1023E000A6E04DF60420854206D0B5F57F4F03D018 +:1023F0004FF60170854202D14FF0130B98E04FF079 +:10240000310B95E0B8F1020F72D14F49B1F840009D +:102410000421FEF74AFD18B14DF60420854214D080 +:102420004949B1F840000421FEF73FFD10B1B5F570 +:102430007F4F0AD04449B1F840000421FEF735FD32 +:1024400078B34FF60170854258D13F4890F820008C +:1024500040B3A5F55A40043830B1A0F51050FC380F +:1024600008B3012845D128E03848C08A3749898A0D +:10247000884210D13548C06939490840B0F1005F41 +:1024800009D1042231491C313148FFF70AFD08B94E +:10249000012700E002273046711C8EB20DF8007053 +:1024A00028E02BE027E00020284948710427304627 +:1024B000711C8EB20DF800701CE02448C0682549DC +:1024C000096888420BD0214800692349096888427D +:1024D00005D01E48C08A21490988884201D10127B8 +:1024E00000E002273046711C8EB20DF8007001E04A +:1024F00015E000BF1CE04FF0330B19E04DF604204F +:10250000854206D0B5F57F4F03D04FF60170854266 +:1025100002D14FF0130B0BE04FF0310B08E00A48EB +:102520000079012804D10020074908714FF0120BEF +:10253000AAF80060BBF1000F04D132466946484654 +:10254000FDF732FE584623E64C3A002018320020B0 +:102550000080000880000020840000208800002007 +:102560000000FE2F2DE9F04704460F46904699469D +:102570000025002626782648D0F82C182548B0F8E3 +:102580004000801E08442249C1F82C08FEF744FC94 +:1025900008B1922539E0FEF749FC08B1932534E0F3 +:1025A0001C48B0F8400040F60201884201DD1325C6 +:1025B0002BE0174890F83008012806D0144890F80E +:1025C0003008022801D024251FE0114890F829087E +:1025D000B04201D0732518E00D48D0F82C080E4900 +:1025E0000968884201D971250FE001200849487027 +:1025F000022081F830080748B0F84000821E0749E1 +:1026000003482430FDF7D0FD78252846BDE8F08743 +:10261000183200204C3A0020440100201E0A0020FD +:10262000034804490880000C091D08807047000019 +:1026300010590008B86C004010B500F001F810BD4A +:102640000CB50020019000904048006840F48030B4 +:102650003E49086000BF3D48006800F4003000902B +:102660000198401C0190009820B94FF6FF71019825 +:102670008842F0D13548006800F4003010B10120E4 +:10268000009001E000200090009801285CD13048C3 +:10269000006840F010002E4908600846006820F0ED +:1026A000030008600846006840F002000860274800 +:1026B00040682649486008464068486008464068C7 +:1026C00040F4806048600846C06A224908401F49BB +:1026D000C8620846C06A204908431C49C8620846C7 +:1026E000006840F08060086000BF1848006800F093 +:1026F00000600028F9D01548406820F47C10134988 +:1027000048600846406840F4E810486008460068A1 +:1027100040F08070086000BF0C48006800F0007056 +:102720000028F9D00948406820F0030007494860B4 +:102730000846406840F00200486000BF0348406817 +:1027400000F00C000828F9D10CBD00000010024078 +:102750000020024000F0FEFF140801000F4800684E +:10276000401C0E4908600E480068401C0C49086077 +:102770000A4800684FF47A71B0FBF1F201FB1200D5 +:10278000012804D107480068401C06490860064833 +:10279000007810B901200449087070473400002007 +:1027A0002C000020380000203000002030B51648F2 +:1027B00000684FF47A72B0FBF2F1B1F1807F01D37F +:1027C00001201DE021F07F40401E4FF0E0225061CB +:1027D00050170F22002807DA13071D0E0B4B00F0CD +:1027E0000F04241F1D5503E013071C0E084B1C5437 +:1027F00000BF00204FF0E022906107201061002010 +:1028000008B100BFFEE730BD0000002018ED00E079 +:1028100000E400E010B51648006840F001001449DB +:102820000860084640681349084011494860084656 +:102830000068114908400E4908600846006820F405 +:10284000802008600846406820F4FE004860084682 +:10285000006820F0A05008604FF47F0088600020DE +:10286000C862FFF7E9FE4FF000600449086010BD40 +:10287000001002400000FFF0FFFFF6FE08ED00E050 +:1028800010B50121084800F016F858B1012106489A +:1028900000F00EF80548006808B9012000E00020AB +:1028A0000249086010BD000000040040900123426E +:1028B000CA430282704730B502460020002300243C +:1028C000158A05EA0103958905EA010413B10CB1E3 +:1028D000012000E0002030BD10B51248008888B902 +:1028E00000201149087011490870114908701149F8 +:1028F0000870114908700846017810480088FEF7F2 +:1029000005FF0DE00720094908700D480078401CBC +:102910000B49087008460078102801D10020087083 +:1029200010BD0000A6000020C2000020B000002062 +:1029300099000020BE000020B70000209E0000206B +:102940009C00002010B50120214908700020214979 +:10295000087021480078012805D120480078102807 +:1029600001D1FEF7A7FE1C480078012803D11B48BF +:102970000078102805D01A48007858B11948007816 +:1029800040B9962018490880012018490870022093 +:102990001749087016480078012802D115480078B8 +:1029A00048B10E48007830B10B480078042804D1B3 +:1029B0001148008808B900F0F9FC10480078012897 +:1029C00005D105480078062801D100F0EFFC10BDC4 +:1029D000BA000020BF000020B000002094000020BA +:1029E0008C0000208B000020AC000020C1000020E3 +:1029F0008A0000208D000020920000209900002015 +:102A000070B536480078012866D03548007901282D +:102A100004D134480078012800D170BDFEF7A8FE2B +:102A2000314908803148FEF75FFE3048007800F0F9 +:102A3000F0002F49087000202E4908802E48008899 +:102A40002749A1F84000002008712848007800F0CC +:102A50000F0522480078022803D115B901201F492B +:102A6000087020480078012801D100F09FFC204820 +:102A7000007820BB1D48007800F00F001E49088038 +:102A800001240CE01948005D1C491A4A1288885438 +:102A900018480088401C17490880601CC4B21648BA +:102AA00000888442EEDD00F03DFA48B9092014495F +:102AB00008700846017810480088FEF727FE0BE0F2 +:102AC00001201049087000200D490870084601785F +:102AD00009480088FEF71AFE00BF9EE78A00002022 +:102AE0004C3A002099000020A4000020C4000020DF +:102AF000A0000020A20000209E0000201C0A002050 +:102B0000B7000020B900002010B51F480078012848 +:102B100024D001201D490870FEF72AFE1C490880B8 +:102B20001C48FEF7E1FD1B48007800F00F04164832 +:102B30000078022803D114B90120134908701648FF +:102B40000078012801D100F031FC00201349087001 +:102B50000120134908701349087114E00F480078E8 +:102B6000401CC0B20D49087002280CDB02F0FAF9D3 +:102B700000F064F8002009490870034908700A4908 +:102B800008700A49087010BD8A000020BB000020B0 +:102B9000A4000020C400002099000020CD000020E7 +:102BA000CC0000204C3A0020B0000020380100206A +:102BB00010B51148007838B11048407810490870B5 +:102BC00000F0E6FB0F4908700D4800780E490870C8 +:102BD0000C4800780D49087000200D49087000F07D +:102BE00025FC0B48007818B904200A49087002E057 +:102BF00003200849087010BDC3000020C400002055 +:102C00008C0000208D0000208B0000208E00002012 +:102C100090000020B0000020004870471C0A0020EF +:102C200010B505480078012804D100200249087039 +:102C300000F050F910BD0000BB00002000200D493D +:102C400008700D4908700D4908700D4908700D494C +:102C500008700D4908700D4908700D4908700D493C +:102C600008700D4908700D4908700D4908700D492C +:102C700008707047B00000208A00002099000020F2 +:102C8000BD000020BE000020BA000020BB000020D4 +:102C9000BF000020C0000020C1000020C2000020B2 +:102CA000B6000020BC00002010B507480078FEF7F1 +:102CB0008BFD0648FEF762FD46200549088001208D +:102CC0000449087010BD000098000020C4000020D6 +:102CD000A8000020BF00002010B504461148048061 +:102CE0000088072803DC00200F49087002E010204C +:102CF0000D49087001200D49087000200C4908801A +:102D00000C480078012802D100F04EFC09E00C20AC +:102D10000949087008460078FEF720FD00200349A5 +:102D2000087010BD92000020940000208A0000204E +:102D300096000020BD000020B700002010B500F074 +:102D400037FE00F033FB10BD10B50A48007820B103 +:102D5000012805D0022809D105E000F08DFA06E02F +:102D600000F0A6FA03E000F0D9FA00E000BF00BFCF +:102D700010BD00009D00002010B52E4840782D4960 +:102D8000097801F00F0140EA01202B49088008462C +:102D900000882A4908802848008840F602018842B5 +:102DA00013DD0D2026490870084601782248008866 +:102DB000FEF7ACFC02202349087000F07FFB0020E6 +:102DC000204908702049087032E01B480088082814 +:102DD0002EDB00F0A7F848B9092019490870084609 +:102DE000017815480088FEF791FC21E0022411E0EB +:102DF0001048005D1549164A128888540F4800880B +:102E0000401E0E49088012480088401C1049088066 +:102E1000601CC4B2072CEBDD01200E490870064887 +:102E20000088FEF748FC01200B49087000F046FBC3 +:102E300010BD0000C40000209E000020A60000205D +:102E4000B7000020B6000020B00000201C0A0020BF +:102E5000A20000209C0000209900002010B5184816 +:102E6000007800F00F001749088001240CE0144896 +:102E7000005D1549154A1288885414480088401C82 +:102E800012490880601CC4B20E4800888442EEDDFE +:102E900000F048F848B909200D4908700846017843 +:102EA00008480088FEF732FC08E000200849087056 +:102EB0000846017803480088FEF728FC10BD000092 +:102EC000C40000209E0000201C0A0020A200002058 +:102ED000B700002010B50E48007800F0F0000D4952 +:102EE000087000200C4908800C49087009480078D7 +:102EF0000B4948760748007810B9FFF7AFFF05E0A7 +:102F000004480078102801D1FFF736FF10BD0000FB +:102F1000C4000020A0000020A2000020B900002072 +:102F20004C3A002000202149097831B1102912D0F3 +:102F3000202918D0302935D12CE01D49098849B104 +:102F40001C490A881A490988491C8A4201DA00206A +:102F500000E0012027E017490988082901DA00204C +:102F600000E001201FE014490988072907DB114907 +:102F70000988082901DA00200BE0012009E00D4949 +:102F80000A880D490988491C8A4201DA002000E0BC +:102F9000012008E007490988032901DA002000E040 +:102FA000012000E000BF00BF70470000A00000202B +:102FB0009E000020A4000020A60000202B490988C4 +:102FC000072932DA01212A4A1180012016E0294915 +:102FD000095C294A294B1B88D15428490988491C76 +:102FE000264A118026490988491E254A1180204910 +:102FF0000988491C1E4A1180411CC8B21B49098816 +:103000008842E4DD1E49098811B901211D4AD177A2 +:1030100001211D4A117008211C4A117001211C4A0E +:1030200011700021154A11801FE0104909880729F5 +:103030001BDB012011E00F49095C0F4A0F4B1B8875 +:10304000D1540E490988491C0C4A11800C49098841 +:10305000491E0B4A1180411CC8B20728EBDD084904 +:10306000098811B90121074AD1777047B2000020C1 +:10307000B4000020C40000201C0A0020A200002090 +:10308000A60000204C3A00209D000020B000002047 +:10309000BE00002010B52D48008838B903202C4907 +:1030A00008700846007800F0CFF84EE02948007814 +:1030B00001284AD10020274908702749087027486D +:1030C000007800F0F000264908700846007818B132 +:1030D00008460078102809D106201D4908700846C6 +:1030E000007800F0B1F8FFF7F5FE2EE01C480078FC +:1030F00020282AD1FFF716FF38B909201449087093 +:103100000846007800F0A0F81FE01448007800F0AE +:103110000F0014490978884210D100201249087024 +:10312000FFF712FE96200949088001200A4908701D +:103130000D48007848B9FFF7CFFB06E004200449AA +:1031400008700846007800F07FF810BDAE0000203F +:10315000B7000020BB000020C2000020C4000020F7 +:10316000A00000209C0000209D00002010B52C4AEB +:1031700012882C4B1B889A421FDB2A4A11780120A7 +:1031800011E0294A125C294B294C24881A55284AF7 +:103190001288521C264B1A80224A1288521E214B3A +:1031A0001A80421CD0B28842EBDD1E4A1288002AE7 +:1031B00035D101221F4BDA7731E0194A1288194BB9 +:1031C0001B889A422BDA01221B4B1A80012016E041 +:1031D000154A125C154B164C24881A55144A12884D +:1031E000521C134B1A800F4A1288521E0D4B1A8024 +:1031F000114A1288521C104B1A80421CD0B2084A45 +:1032000012889042E4DD02220C4B1A7008220C4B0B +:103210001A7001220B4B1A700022054B1A8010BD48 +:10322000B2000020A6000020C40000201C0A0020DC +:10323000A20000204C3A0020B40000209D00002095 +:10324000B0000020BE00002010B50446214606480C +:103250000088FEF75BFA00200449087004490870F2 +:103260000449087010BD00009E000020B00000203E +:1032700099000020BE00002010B50A48008840F6E2 +:103280000201081A0849088008480088072802DB5C +:10329000FFF794FE05E005480088072801DAFFF7EC +:1032A00065FF10BDA2000020B2000020A600002093 +:1032B0001248007808BB16E0114812490988405CA2 +:1032C0001149124A1288885410480088401C0F493E +:1032D00008800F480088401E0D4908800948008872 +:1032E000401C08490880074800880728E4DD0020C2 +:1032F000084908700720084908707047BE00002080 +:10330000C4000020B40000201C0A0020A2000020FD +:10331000A60000209D000020B0000020144909787C +:1033200021BB1449087816E01349144A1288895CB5 +:10333000134A144B1B88D15412490988491C114A5D +:1033400011800C490988491E0A4A11800B490988D5 +:10335000491C0A4A118009490A88411C8A42E3DD56 +:103360000021094A11700721084A117070470000B6 +:10337000BE000020A6000020C4000020B4000020F1 +:103380001C0A0020A20000209D000020B0000020A8 +:10339000054A917831B17F2900DD7F21C8B2421CF6 +:1033A000D0B200E001207047C400002010B51448DE +:1033B0000078092821D2DFE800F005080B0E11146F +:1033C000171A1D00FFF72CFC18E000F069FC15E04F +:1033D00000F0D4FB12E000F01BF80FE000F02EFB31 +:1033E0000CE000F097FC09E000F02CFC06E0FFF791 +:1033F00051FE03E000F096FB00E000BF00BF10BDEF +:10340000B00000200120014908707047BD00002075 +:1034100010B500F00BF80348007810B904200249F9 +:10342000087010BD90000020B000002010B50A48C0 +:10343000007820B1012805D0022809D105E000F06C +:10344000C9F906E000F0ECF903E000F02BFA00E027 +:1034500000BF00BF10BD0000900000201249098885 +:10346000C1F3032141F01001104A11700E4909788F +:103470005170022011E00E490E4A1288895C0B4AF5 +:1034800011540C490988491C0A4A118006490988C7 +:10349000491E054A1180411CC8B20728EBDD0821EE +:1034A000054A11707047000092000020C4000020FF +:1034B0001C0A0020960000209800002010B5174834 +:1034C000007840F03000164908700020487088707D +:1034D00014490880032014490870032404E00020E4 +:1034E0000F490855601CC4B2072CF8DD08200E49AE +:1034F00008700020FEF76EF90B480078FEF764F9BB +:103500000748FEF73BF9062008490870462008499D +:10351000088001200749087010BD0000B600002097 +:10352000C40000209A00002098000020B000002075 +:10353000AA000020C0000020164A1278164B1A700C +:10354000012001210EE0154A154B1B88D25C124B5D +:103550005A54134A1288521C114B1A80421CD0B282 +:103560004A1CD1B20B4A12889142ECDD094A12780A +:10357000521C0C4B1A7007280ADC04E00022064B90 +:103580001A54421CD0B20728F8DD0822054B1A70E5 +:103590007047000092000020C40000201C0A002098 +:1035A000960000209800002010B51048007810B94F +:1035B000FFF7C2FF05E00D480078102801D1FFF7A2 +:1035C0004DFF01200A4908700A480078FEF7FCF810 +:1035D0000948FEF7D3F80120084908704620084939 +:1035E000088001200749087010BD000094000020E9 +:1035F0008F00002098000020C4000020B0000020B0 +:10360000A8000020BF00002010B52A480088072825 +:103610002BDA012028490880012416E02748284990 +:103620000988405C2749085525480088401C2449E2 +:10363000088025480088401E234908801E480088CD +:10364000401C1D490880601CC4B21A48008884428E +:10365000E4DD01201D49087000201D490870FEF7B7 +:10366000C7F800201649088023E012480088072880 +:103670001FDB012411E0114811490988405C114900 +:1036800008550F480088401C0D4908800E480088E6 +:10369000401E0D490880601CC4B2072CEBDD0820D9 +:1036A0000C490870FFF700FB04200B49087000F07C +:1036B00065F910BDB2000020B40000201C0A0020F3 +:1036C00096000020C40000209200002090000020FE +:1036D000BD00002098000020B000002070B53348E5 +:1036E00000883349098888422DDB01253048067857 +:1036F000012413E02F4830490988405C2F490855C0 +:103700002D480088401C2C49088029480088401E0C +:1037100027490880681CC5B2601CC4B2B442E9DD08 +:103720002748067004E0002024494855681CC5B2AB +:10373000072DF8DD082022490870FFF7B5FA0420AC +:103740002049087030E019480088194909888842E2 +:103750002ADA01201C490880012416E01548164980 +:103760000988405C1549085513480088401C1249D7 +:1037700008800F480088401E0D49088012480088C4 +:10378000401C11490880601CC4B20848008884426B +:10379000E4DD02200D49087000200D490870FEF795 +:1037A00027F800200449088070BD0000B200002006 +:1037B000920000201C0A002096000020C400002077 +:1037C00098000020B0000020B400002090000020ED +:1037D000BD00002010B50D48007840F020000C49D5 +:1037E00008700C48008840F60201081A0A4908804F +:1037F0000A480088072802DBFFF706FF05E00748B4 +:103800000088072801DAFFF769FF10BD8F0000204C +:10381000C400002096000020B2000020920000208A +:1038200010B517480078012828D116E01548164928 +:103830000988405C1549164A128888541248008845 +:10384000401C1149088013480088401E1149088017 +:103850000F480088401C0E4908800D480088072842 +:10386000E4DD08200C490870FFF71EFA00200B4920 +:10387000087004200A49087000F080F810BD0000AC +:10388000BD0000201C0A002096000020C40000207B +:10389000B40000209200002098000020900000203A +:1038A000B000002010B52048007801283AD11F4808 +:1038B000047800781E49097808441E49087018E009 +:1038C0001D481E490988405C1D49184A12888854C1 +:1038D0001A480088401C1949088015480088401E75 +:1038E00013490880601CC4B210480088401C0F496E +:1038F00008800E4800880F4909788842E0DB04E020 +:1039000000200F490855601CC4B2072CF8DD0820C0 +:1039100008490870FFF7C8F900200A490870042018 +:103920000949087010BD0000BD000020B40000204F +:1039300092000020980000201C0A00209600002021 +:10394000C400002090000020B000002010B5044604 +:103950002046FDF703FF0020044908700449087061 +:10396000044908700449087010BD0000B000002030 +:103970008A000020BD000020BA000020094800781D +:10398000401C0849087008460078102801D1002022 +:1039900008700548007820B104480078401E0349AB +:1039A000087070478F0000208C0000208B000020E2 +:1039B0001A480078012808D119480088002804DD39 +:1039C00017480088401E16490880164800780128CC +:1039D00008D115480088002804DD13480088401EDF +:1039E0001149088011480078012808D11048008842 +:1039F000002804DD0E480088401E0D4908800D484F +:103A00000078012808D10C480088002804DD0A4805 +:103A10000088401E0849088070470000BF00002051 +:103A2000A8000020C0000020AA000020C100002043 +:103A3000AC000020C2000020AE00002010B52C48D1 +:103A4000008838B901202B49087008460078FFF734 +:103A50007DFF4CE028480078012803D027480078F3 +:103A6000012844D1002026490870234908702548C0 +:103A7000008838B900201F49087008460078FFF711 +:103A800065FF34E02048007848B12048007830B91C +:103A900000201F49087002201E49087027E01E48B8 +:103AA000007818B11C48007801280CD1FFF7BEFC43 +:103AB0001A48007818B900201049087017E0012052 +:103AC0000E49087013E014480078022803D103203F +:103AD000104908700BE010480078022807DD1048F4 +:103AE0000078401E0E49087005200A49087010BD74 +:103AF000A8000020B7000020BA000020BC00002071 +:103B0000BF000020920000208C0000208B000020CD +:103B1000C3000020B00000208D0000209000002095 +:103B20008E00002010B51148008838B903201049D4 +:103B3000087008460078FFF787FB15E00D4800780D +:103B400001280AD100200B4908700B200849087091 +:103B500008460078FFF778FB06E0FFF7F5F806481F +:103B6000007808B9FEF7B8FE10BD0000AE000020D6 +:103B7000B7000020BB0000209D00002010B52B489E +:103B8000008838B902202A49087008460078FFF7F3 +:103B9000DDFE49E027480078012845D1002025496D +:103BA00008702548007800F0F000244908700846A5 +:103BB0000078302838D10020214908701E4800784C +:103BC00000F00F04FFF7AEF938B909201849087062 +:103BD00008460078FFF7BAFE26E0032C07DB052035 +:103BE0001349087008460078FFF7B0FE1CE0022C6D +:103BF00007D108200E49087008460078FFF7A6FE96 +:103C000012E0012C0DD10720094908700846007800 +:103C1000FFF79CFE9520054908800120084908709F +:103C200002E00CB9FEF7C4FF10BD0000AC0000209C +:103C3000B7000020BB000020C4000020A00000202E +:103C4000C100002010B50F48007801280ED10020D7 +:103C50000C4908700C49087007200C490870962020 +:103C60000B49088001200B49087009E00A480088C8 +:103C700030B901200949087008460078FFF7E4FAD6 +:103C800010BD0000BA000020C0000020B0000020DD +:103C9000AE000020C2000020AA000020B7000020D3 +:103CA00010B51548008838B9012014490870084635 +:103CB0000078FFF74BFE1DE011480078012819D16C +:103CC00000200F4908700F4908700F48007838B974 +:103CD00000200A49087008460078FFF737FE09E01F +:103CE00009480078102805D10120084908700220F1 +:103CF0000749087010BD0000A8000020B700002090 +:103D0000BA000020BF00002094000020C300002063 +:103D1000B000002008480078401E07490870084697 +:103D20000078012806DC0320044908700448007864 +:103D300001490870704700008E000020B00000208C +:103D40008D0000200246002321B90D480068106054 +:103D5000012070470A4803681068984205D8106827 +:103D6000181A884209D30120F3E71068C0F1FF3028 +:103D70001844884201D30120EBE70020E9E7000066 +:103D8000340000204F48007801280AD14E4840896D +:103D9000401C4D49488101200870002049490870A5 +:103DA00000E0704748484089052190FBF1F201FB93 +:103DB000120030B94448408918B101204249487086 +:103DC00000E0EEE7404840890A2190FBF1F201FB58 +:103DD000120028B93C48408910B101203A49887046 +:103DE00039484089142190FBF1F201FB120028B9F7 +:103DF0003548408910B101203349C87032484089A4 +:103E0000322190FBF1F201FB120028B92E484089C3 +:103E100010B101202C4908712B484089642190FB86 +:103E2000F1F201FB120028B92748408910B10120A6 +:103E300025494871244840894FF4FA7190FBF1F20A +:103E400001FB120028B92048408910B101201E4909 +:103E500088711D4840894FF47A7190FBF1F201FBA3 +:103E6000120028B91848408910B101201649C871BC +:103E70001548408940F2DC5190FBF1F201FB120041 +:103E800028B91148408910B101200F4908720E4825 +:103E900040894FF4FA6190FBF1F201FB120028B95E +:103EA0000948408910B101200749487206484089F5 +:103EB00041F27071884202DB00200349488100BF53 +:103EC0006FE7000030000020900100200FB5184877 +:103ED00000880A2802DB002015490880144802885F +:103EE000001D00EB0210009901609DF804101048BD +:103EF0000288001D00EB021001719DF80D100C48A6 +:103F00000288001D00EB0210417309480188001D62 +:103F100000EB0110DDF8051040F8051FDDF8091071 +:103F2000416003480088401C014908800FBD000023 +:103F30002012002010B51748006800B110BDFCF732 +:103F400041FF00B9FAE71BE0134840880A2802DB6A +:103F500000201149488010484188001D00EB0114E1 +:103F600094E80F0001F08FF901200C4988700020BF +:103F700081F8280008484088401C0749488005E02F +:103F800005480088044949888842DDD100BF00BF48 +:103F9000D4E7000068000020201200204C3A0020E6 +:103FA00010B50948807E70B10748407F10280AD1BB +:103FB0000549087F00F05AFB002003498876FF215D +:103FC0000248FCF718F910BD4C3A00201C0A0020EA +:103FD00010B50748807E50B10548407F112806D1B2 +:103FE0000348293000F010FC00200149887610BDFC +:103FF0004C3A002010B50648807E40B10448407F0E +:10400000222804D100F072FA00200149887610BD00 +:104010004C3A002010B51448807E20B31248407FEF +:10402000272820D1104890F82900042809D00F4AE9 +:104030000D492931032000F047FC00200A49887609 +:1040400011E0094890F8290004280CD1074A0649D4 +:10405000293100F039FC002003498876C8770348ED +:1040600000210160416010BD4C3A0020EC000020AE +:1040700010B50A48807E78B10848407F28280BD1C7 +:1040800002210648293000F033FD002003498876DC +:10409000FF210348FCF7AFF810BD00004C3A0020A8 +:1040A0001C0A002010B50948807E70B10748407F87 +:1040B0002E280AD106480088401E81B2054800F02B +:1040C0005BFA00200149C877887610BD4C3A002081 +:1040D000A20000201D0A002010B50A48807E78B199 +:1040E0000848407F31280BD103210648293000F0D1 +:1040F00089FD002003498876FF210348FCF77BF8FF +:1041000010BD00004C3A00201C0A002010B50C48DD +:10411000807E98B10A48407F34280FD10948008832 +:10412000401E81B2084800F0A7FD002004498876AF +:104130004877FF210448401EFCF75DF810BD0000E1 +:104140004C3A0020A20000201D0A002010B50C48A7 +:10415000807EA0B10A48407F362810D109480078F7 +:10416000401EC1B20648293000F014FE0020044968 +:104170008876487740F602010348FCF73CF810BD0A +:104180004C3A0020A20000201C0A002010B509486B +:10419000807E70B10748407F37280AD106480088E2 +:1041A000401E81B2054800F01FFE002001498876BC +:1041B000487710BD4C3A0020A20000201D0A0020C4 +:1041C00010B50748807E50B10548407F3E2806D193 +:1041D0000348293000F010FA00200149887610BD0C +:1041E0004C3A002010B50A48807E78B10848407FDC +:1041F00085280BD101210648293000F04DFE002012 +:1042000003498876FF210348FBF7F5FF10BD000046 +:104210004C3A00201C0A00208178064A1170C178AF +:10422000517011460978491C117011464978891C52 +:1042300051707047EC00002010B509480078012843 +:104240000DD1074840780D2806DA05484078054921 +:1042500051F82040A04702E000200149087010BD3D +:10426000F4000020F800002010B501200249087079 +:1042700000F078FE10BD0000F400002010B5002012 +:104280000249087000F06EFE10BD0000F40000202E +:104290002DE9F04100240125A046002600277E4894 +:1042A000007801281DD100207B490870084640791C +:1042B00088B9012048710846C06878490860764886 +:1042C00000697749086000207649086076490880CF +:1042D00071498871DDE003206F49887100204871C1 +:1042E000D7E06D484079012869D16B4988716C48E5 +:1042F000006890B16A480068B0F5006F08D9684856 +:104300000068A0F50060664908604FF4006704E0AB +:104310006348076800206249086060490968614A8B +:10432000126888183946FCF78CFE05465D4800681F +:1043300038445C4908605C480088401C5A49088041 +:104340002DB103205449887100204871A1E05448E0 +:10435000006830BB022050498871002048717122EA +:104360002046611CCCB251490A5401222046611CEE +:10437000CCB24E490A54FF222046611CCCB24B49B4 +:104380000A5400222046611CCCB248490A5401223A +:104390002046611CCCB245490A542046FDF748FA34 +:1043A00077E041480088142190FBF1F201FB1200F4 +:1043B00000286ED178213120FDF71CFA69E03648DB +:1043C0004078012865D176222046611CCCB237495D +:1043D0000A54314890F829282046611CCCB2334950 +:1043E0000A543348B0F84000861E32462A49243128 +:1043F000081FFCF7A9FC28488068A0B92648163099 +:10440000FCF756FC042224492431A1F10E00FCF7EC +:1044100053FC2148406A2049C861FF2204211E48FC +:104420002430FBF7E1FE1C498968224A881832468D +:1044300019492431FDF735FD054617488068304499 +:10444000154988600846D0F82C081B49096888423D +:1044500009D319480068061F32461649091D0E483F +:104460001630FCF729FC25B910492046FDF7E0F984 +:1044700006E000200849C86172213620FDF7BAF92C +:10448000054890F82908401C034981F829080020B4 +:104490004870BDE8F0810000183200205001002073 +:1044A00054010020580100205C010020A03C0020A5 +:1044B0004C3A0020008000084401002000200A49F6 +:1044C00081F82700C87081F826000120C8760020F6 +:1044D00081F820008871C88781F8220081F82300C4 +:1044E00081F82500704700004C3A002070B5002488 +:1044F00000251E484078012837DD1D480079012835 +:1045000033D11B48B0F84000032824DB1849B1F828 +:10451000400000EBD0714910A0EB4101012918D1F6 +:104520001349B1F84010032913DC1248FCF768FF67 +:104530000546032D04DB0F492846FDF779F90BE00A +:104540000B48B0F84C0040F28571884204D1312408 +:1045500002E0132400E013241CB121462220FDF7C1 +:1045600049F91E200249A1F8440070BD480100200D +:104570004C3A0020A03C00202DE9F04104460D46B5 +:10458000002600271948407801282CDD18480079BA +:10459000012828D11649C87E00220221FCF750FCD0 +:1045A000B8B1032D01DA132714E0A81E81B220460A +:1045B000FDF794FD064656B96E200E490870207826 +:1045C0004870607888700320FDF732F902E03746C2 +:1045D00000E07F271FB139462E20FDF70BF9282078 +:1045E0000349A1F84400BDE8F08100004801002023 +:1045F0004C3A0020A03C002070B50446002500265F +:104600001748407801282ADD1649B1F840000221F8 +:10461000FCF74BFCC8B1207800F07F0666B9207823 +:10462000FCF73CFC90B17E200F4908702078487060 +:104630000220FDF7FDF809E00A480079012805D1BC +:10464000002008490871122500E013251DB12946F4 +:104650003E20FDF7CFF80A200249A1F8440070BDC2 +:10466000480100204C3A0020A03C00202DE9F041F8 +:1046700005460227002600245F48407801287DDD9A +:1046800010205D490870002048705C49B1F8400076 +:104690000221FCF70AFC002871D005F07F04012CF0 +:1046A00003D0022C01D0032C6AD15448C07E0328C9 +:1046B0003AD1022C38D1FCF7FFFB002832D04F480A +:1046C000C476C47600204D4981F820008871C887DF +:1046D00081F8220081F8230081F825002846FCF7A4 +:1046E000DDFB80B150204649087008464570002027 +:1046F00088703220C87001200871F42048710627A4 +:104700003846FDF795F800203E4981F8240881F8E5 +:10471000250881F8260881F8280881F8270881F8FB +:1047200030085AE0222658E03448C07E012801D1E2 +:10473000022C05D03148C07E022803D1032C01D1C0 +:104740007E264AE0032C03D100202C49C8730AE0DE +:10475000012C08D12948C07E022804D10120274914 +:104760000870C82088772548C47600202349C88768 +:1047700081F8200088710846C07E02E03AE02BE014 +:1047800021E0032801D1032C07D000201B4981F828 +:10479000220081F8230081F825002846FCF77EFBE3 +:1047A000D8B150201649087008464570002088701E +:1047B0003220C87001200871F4204871062738465D +:1047C000FDF736F809E00D480079012805D10020F1 +:1047D0000A490871122600E013261EB13146102046 +:1047E000FDF708F80A2004498880084680880349B4 +:1047F000A1F84400BDE8F081480100204C3A0020B7 +:10480000A03C00201832002070B504460025002688 +:104810002948407801284DDD1120274908700020E3 +:1048200048701E20888025480079012842D12349FC +:10483000B1F840000221FCF738FB002830D0207886 +:1048400000F07F063046FCF721FB00B3FCF734FB99 +:10485000D8B12078FCF722FB38B1512018490870F4 +:10486000207848700220FCF7E3FF16480079012801 +:1048700005D10020134908711149087048700120C2 +:104880000E490870C82088770BE0222509E00B4804 +:104890000079012805D1002008490871122500E09F +:1048A00013251DB129461120FCF7A4FF0A20034956 +:1048B000A1F8440070BD0000480100204C3A0020DF +:1048C000A03C0020183200202DE9F04781460C461C +:1048D000154600274FF0FF087F48407801287DDD0E +:1048E0007E480079012879D17C49C87E0122114691 +:1048F000FCF7A6FA002872D0207803283ED10020C9 +:10490000774908707549B1F840000221FCF7CDFAEB +:1049100088B37248C078012801D13727CEE06720DC +:1049200070490870207848706F48FCF75EFD80463B +:10493000B8F1000FF2D1694890F82000012807D1A2 +:1049400066488079012803D166480021418003E050 +:1049500064486549098841800120614908705F49C0 +:10496000887167205C490870002048705D49042008 +:10497000FCF75EFFA2E0FFE713279FE02078042802 +:104980007CD15649B1F840000421FCF78EFA00288A +:1049900075D0524890F82600032802DC5048007871 +:1049A00058B94E4890F82600032800DB36274C48BB +:1049B00000780028B2D1242780E0494800780128F7 +:1049C00002D10020464908704648002101600222B9 +:1049D0004549FBF71BFC00285FD001E079E06CE063 +:1049E00041494978404A127801EB022188B2FCF72C +:1049F000CBFC064660782870A0786870E078A870D4 +:104A00002079E8703012394908704E700222284629 +:104A1000FBF7FCFBF8B90020304981F8260067203D +:104A200030490870207848702078042801D101208E +:104A300000E00220294981F82100672026490870FA +:104A4000002048700120254981F8200025490220D6 +:104A5000FCF7EEFE22E0214890F82600FF2806DA57 +:104A60001E4890F82600401C1C4981F826001B486F +:104A700090F82600022803DC35270FE014E011E04F +:104A8000164890F82600032808D136273C20134901 +:104A900081F827000120C87000E024271248002177 +:104AA00001600BE0132709E00C48B0F84000022831 +:104AB00001DA132702E0122700E07F271FB13946F1 +:104AC0002720FCF797FE1E20034988800349A1F8A0 +:104AD0004400BDE8F0870000480100204C3A002067 +:104AE0005E010020A03C0020780000207A00002019 +:104AF0002DE9F0410446884600270025002668205D +:104B00003D4908703D484078012873DD28203B4925 +:104B100008701E2088803A49C87E01221146FCF7A1 +:104B20008FF9002855D03649B1F840000321FCF731 +:104B3000BCF900284BD0FCF7BFF9002845D02078FD +:104B400000F07F0566780DB1032D35D1012E01D01F +:104B5000032E28D16DB9012E04D10020284981F8F7 +:104B6000220015E00020264981F8220081F8230068 +:104B70000EE0032D0CD1012E04D10120204981F833 +:104B8000220005E001201E4981F8220081F823005F +:104B90002078FCF783F920B3207817494870022069 +:104BA000FCF746FE1DE01648B0F84C0040F2857157 +:104BB000884216D1312714E011480079012810D11C +:104BC00000200F49087112270BE0222709E0132764 +:104BD00007E00B48B0F84C0040F28571884200D1E4 +:104BE0007F271FB139462820FCF704FE0A2004491C +:104BF000A1F84400BDE8F081A03C0020480100205D +:104C00004C3A0020F8B505460E46002400200090DE +:104C100016484078012827DD3120144908701E20ED +:104C200088801348007901281ED11149C87E0122CD +:104C30001146FCF705F938B16B460E4A3146284655 +:104C4000FDF794FA044600E07F2424B12146312088 +:104C5000FCF7D0FD04E00749BDF80000FCF7E8FDD3 +:104C60000A200349A1F84400F8BD000048010020D3 +:104C70004C3A0020A03C00202DE9F04104460E46AD +:104C800000273D484078012874DD3C48007908B988 +:104C9000BDE8F0813949C87E00220221FCF7D0F836 +:104CA000002855D0354890F8200001284ED12578AD +:104CB00094F801800A2E47D115B9B8F1440F01D0FC +:104CC000312746E0A0780006E17840EA01402179EA +:104CD00040EA01206179084329490860A07900066B +:104CE000E17940EA0140217A40EA0120617A0843F3 +:104CF0002449086074202449087008464570202023 +:104D00004870082088700220C87001201F4981F86F +:104D100029080020C1F82C088860194800681C493F +:104D200088420FD117480068B0F5563F0AD217489D +:104D300090F8240820B114490420FCF779FD08E01C +:104D4000222706E0702704E0132702E0332700E063 +:104D50007F2727B139463420FCF74CFD03E00120C2 +:104D60000A4981F830081E2003498880142003492D +:104D7000A1F8440000BF8BE7480100204C3A002016 +:104D80004001002044010020A03C002018320020F7 +:104D900000800008F8B505460E460024002000906B +:104DA0000E484078012818DD36200C4908701E2076 +:104DB00088800B48007901280FD16B46094A31469B +:104DC0002846FDF7CFFB04461CB121463620FCF7F0 +:104DD00011FD1E200249A1F84400F8BD4801002041 +:104DE0004C3A0020A03C002070B505460E46002439 +:104DF00077202549087025484078012843DD24485C +:104E0000007901283FD17720204908701E20888032 +:104E1000002048701E49C87E00220221FCF710F8CD +:104E200038B31B4890F82000012820D11849B1F868 +:104E300040000121FCF739F8B8B1164890F8300865 +:104E4000022810D1772010490870124890F82000ED +:104E5000C043487003200F4981F830080A490220F6 +:104E6000FCF7E6FC06E0242404E0132402E03324EB +:104E700000E07F241CB121463720FCF7BBFC0A2050 +:104E80000349A1F8440070BDA03C00204801002067 +:104E90004C3A0020183200202DE9F04104460F461C +:104EA000002600252C484078012853DD85202A491A +:104EB00008701E2088802949C87E01221146FBF710 +:104EC000BFFF002835D02549B1F840000221FBF78B +:104ED000ECFF60B3FBF7F0FF08B9222631E0207841 +:104EE00000F07F05012D01D0022D17D1012D04D135 +:104EF00000201A4981F8250003E00120174981F8B4 +:104F000025002078FBF7CAFFD8B1C52014490870E6 +:104F1000207848700220FCF78BFC12E00F480079E3 +:104F200001280ED100200D490871122609E0132630 +:104F300007E00A48B0F84C0040F28571884200D181 +:104F40007F261EB131468520FCF754FC0A20034918 +:104F5000A1F84400BDE8F081480100204C3A00204F +:104F6000A03C002010B5FCF7C3FA012823D1022091 +:104F70001649C87601200873002081F82000887146 +:104F8000C88781F8220081F8230081F8250081F884 +:104F90002700C87050200E4908700C48C07E487029 +:104FA000002088703220C87001200871F4204871F8 +:104FB0000620FCF73DFC00200649087002204870DE +:104FC000012088700020888010BD00004C3A00202D +:104FD000A03C00204801002010B50848807E58B150 +:104FE0000649487F00F014F8002004498876487785 +:104FF000FF210348FBF7FFF810BD00004C3A0020EA +:105000001C0A002010B50446FFF738F910BD000057 +:1050100070B50546002415484078012825DD144860 +:10502000407F342807D01248407F362803D01048EC +:10503000407F372808D10E49C87E00220221FBF7A5 +:10504000FFFE48B97F2407E009480079012803D111 +:1050500000200749087111241CB121462846FCF79D +:10506000C9FB0A200249A1F8440070BD4801002094 +:105070004C3A00201E2001498880704748010020DA +:1050800070B505460C4605480078272805D160789C +:10509000012802D12046FFF7BFF870BD480100206B +:1050A0002DE9F04107460E4614464EBB3F48407876 +:1050B000012825D13D48007840302178884207D129 +:1050C00021463846FFF7DCFF0220384948706BE084 +:1050D00020787F2868D1354800786178884263D18C +:1050E000A078782805D1FFF7C5FF04202F49487024 +:1050F0005AE0A078FFF786FF03202C49487053E060 +:10510000002E44D129484078022840D12078102828 +:1051100005D1022025494870607825490877207814 +:1051200023494877002518E02248405D2049497FFF +:10513000884210D11E48407F342803D01C48407F4D +:10514000362805D11C48008820B91C48457001E06C +:105150001A48457003E0681CC5B20D2DE4DB00BFA2 +:105160000D2D02D10C20154948701421104829300A +:10517000FBF741F81422611C0D482930FBF714F8A5 +:1051800001200B4988760846A0F840700CE0092EF3 +:105190000AD10B480078012806D100200849087080 +:1051A000FF210848FBF727F8BDE8F08148010020FF +:1051B0004C3A0020EE5B0008A6000020F40000201E +:1051C000CC0000201C0A00200120014948707047D3 +:1051D00048010020704710B500F098F810BD70B578 +:1051E00004460D46164632462946204600F05AFA35 +:1051F00070BD70B504460D46164632462946204617 +:1052000000F093FA70BD00001149096851B94FF0E0 +:10521000E02189690E4A1160114609680D4A51431F +:105220000B4A11604FF0E0218969094A1268881819 +:105230000749096843F285621144054A116080B24A +:105240001146098801EB810140EA014070470000E6 +:10525000D00000200DE37A050FB41FB5069800902A +:105260009DF822008DF804009DF804200DF1230123 +:105270000DF10500FAF798FF9DE80F0000F0B0F877 +:105280001FBC5DF814FB0FB587B000208DF810002F +:10529000079802909DF820008DF8120000208DF8EC +:1052A00011009DF812200DF121010DF11300FAF704 +:1052B0007BFF0698009002A80FC8FBF751FD0BB0CA +:1052C00000BD10B50A20FBF74BFEFCF7AFFD10BD8B +:1052D00010B50348027803A10B48FAF765FF10BD2B +:1052E000585B0008515246424C5F312E335F3233D7 +:1052F0003036303820202020202020202020202060 +:1053000020202020000000003006002010B52D488D +:10531000007850B9FFF7DCFFFBF7E4FDFBF71EFE5A +:10532000FFF7CCF801202749087027480078D8B14A +:105330002548807F28B12448807F401E22498877F5 +:1053400011E000202049087000BF2048006800F4E8 +:10535000E0601F490843001D1C490860BFF3408FEF +:1053600000BF00BFFEE710BD1A480088401C80B295 +:105370001849088002280DDB00200880FEF774FF22 +:1053800001201149C8710020487600F067F800201C +:105390001149088011480088401C80B20F490880DC +:1053A000012805DB00200880FEF746FFFCF7D2F954 +:1053B000FEF7C0FDFCF7BAF8FBF708FDFEF768FF43 +:1053C00000BFD0E7EA0000204C3A00200CED00E0DE +:1053D0000000FA05E4000020E8000020E6000020BC +:1053E0000FB540F2DF710098884204D040F2857119 +:1053F000009888422FD118480088B0F5FA7F02DB68 +:1054000000201549088014480288001D00EB021096 +:10541000009901609DF804100F480288001D00EB00 +:10542000021001719DF80D100B480288001D00EB61 +:105430000210417308480188001D00EB0110DDF8DF +:10544000051040F8051FDDF809104160024800888A +:10545000401C014908800FBDC412002010B51EE099 +:1054600012484088B0F5FA7F02DB00200F494880DF +:105470000E4880780E4908700C484188001D00EBEA +:10548000011494E80F00FCF7E1FC08484088401C38 +:105490000649488007480068401C064908600348E0 +:1054A0000088024949888842DAD110BDC412002020 +:1054B000D5000020E000002000BFFEE744E03221DC +:1054C0003EE000BF00BF00BF00BF00BF00BF00BF85 +:1054D00000BF00BF00BF00BF00BF00BF00BF00BFD4 +:1054E00000BF00BF00BF00BF00BF00BF00BF00BFC4 +:1054F00000BF00BF00BF00BF00BF00BF00BF00BFB4 +:1055000000BF00BF00BF00BF00BF00BF00BF00BFA3 +:1055100000BF00BF00BF00BF00BF00BF00BF00BF93 +:1055200000BF00BF00BF00BF00BF00BF00BF00BF83 +:1055300000BF00BF00BF00BF00BF00BF4A1ED1B206 +:105540000029BEDC421ED0B20028B8DC704702E061 +:1055500008C8121F08C1002AFAD1704770470020FE +:1055600001E001C1121F002AFBD1704708B50121DB +:105570000820FCF7DBFC03208DF8020014208DF8D6 +:1055800003004FF48060ADF8000069460D48FBF75A +:1055900024FE03208DF802004FF40060ADF80000F7 +:1055A00014208DF8030069460648FBF716FE4FF4F9 +:1055B00080610448FBF7E6FE4FF400610148FBF709 +:1055C000E1FE08BD000C0140022808DA074911F885 +:1055D000301021B1054911F83010032900D170476E +:1055E0000221024A02F8301000BFF8E76C010020E7 +:1055F00010B50446022C03DA0C4810F8340000B948 +:1056000010BD0320094901F8340001EBC401081D55 +:105610000021FEF797FB1CB90548FAF7EFFF02E0FF +:105620000448FAF7EBFF00BFEAE700006C01002036 +:105630000064004000680040022800DB7047012140 +:10564000024A02F8301000BFF8E700006C010020A9 +:10565000022803DA074911F8301001B97047012117 +:10566000044A02F83010002102EBC002517000BF62 +:10567000F4E700006C0100200146022908DA064820 +:1056800010F8310020B1044810F83100032801D18E +:10569000002070470120FCE76C01002010B5FFF7E7 +:1056A00065FF10BD2DE9F04107460C461646FCF794 +:1056B00075F9A020FCF744F9FCF79EF900B130E041 +:1056C000A046E11704EB1161C1F30720FCF738F99C +:1056D000FCF792F900B124E0E0B2FCF731F9FCF7F5 +:1056E0008BF900B11DE0FCF759F9A120FCF728F96E +:1056F000FCF782F900B114E000250BE0711EA9420D +:1057000001D0012100E000210846FCF7EFF87855B0 +:10571000681C85B2B542F1DBFCF75AF90120BDE8FF +:10572000F081FCF755F90020F9E72DE9F04706462E +:105730000F4690463C46002534E035B1E11704EBB6 +:10574000D1614911A4EB411109BB25B1FCF740F926 +:105750000620FBF705FCFCF721F9A020FCF7F0F888 +:10576000FCF74AF900B124E0A146E11704EB11610E +:10577000C1F30720FCF7E4F8FCF73EF900B118E0AC +:10578000E0B2FCF7DDF8FCF737F900B111E0705D2D +:10579000FCF7D6F8FCF730F900B10AE0601C84B2DF +:1057A000681C85B24545C8DBFCF712F90120BDE84D +:1057B000F087FCF70DF90020F9E7002001E0411C1B +:1057C00088B23C28FBDB704786B0FDF723F8FAF778 +:1057D00068FDFCF7EDF9FCF7E9FF01A8FCF7B6FB63 +:1057E000FCF7DBFAFCF716FAFFF758FFFCF744F971 +:1057F000FAF7A4FD4FF400712648FBF7C1FDFFF74F +:1058000060FDFBF781FE43E0FEF7BCFA224800781A +:10581000012805D1002020490870FFF7DCFC37E0A3 +:105820001D484078012805D100201B494870FCF72D +:105830001FF92DE018488078012805D1002016496D +:105840008870FFF7C7FC23E01348C078012803D114 +:1058500000201149C8701BE00F480079012803D1CE +:1058600000200D49087113E00B484079012803D14D +:105870000020094948710BE00748C079012807D189 +:1058800000200549C8714FF400710248FBF778FD0C +:10589000BAE70000000C0140900100202DE9F0471C +:1058A00004460F46154699463DB161190E4881429E +:1058B00003D8A0F50070844203D24FF0FF30BDE85A +:1058C000F08737B1002602E0B85DA055761CAE42E5 +:1058D000FAD30648A4EB0008AAB21FFA88F12046C2 +:1058E000FFF787FC0020EAE7A03C0020A03A002058 +:1058F0002DE9F04104460D4616461F463B4632460A +:1059000029462046FFF7CAFF80464046BDE8F081A1 +:10591000515246424C5F312E335F3233303630388D +:105920002020202020202020202020202020202077 +:10593000000000002110422063308440A550C66062 +:10594000E770088129914AA16BB18CC1ADD1CEE13C +:10595000EFF13112100273325222B5529442F772B3 +:10596000D662399318837BB35AA3BDD39CC3FFF38C +:10597000DEE36224433420040114E664C774A444C3 +:1059800085546AA54BB528850995EEE5CFF5ACC5DC +:105990008DD55336722611163006D776F666955693 +:1059A000B4465BB77AA719973887DFF7FEE79DD72C +:1059B000BCC7C448E5588668A77840086118022823 +:1059C0002338CCC9EDD98EE9AFF9488969990AA97C +:1059D0002BB9F55AD44AB77A966A711A500A333AF3 +:1059E000122AFDDBDCCBBFFB9EEB799B588B3BBBCC +:1059F0001AABA66C877CE44CC55C222C033C600C83 +:105A0000411CAEED8FFDECCDCDDD2AAD0BBD688D1B +:105A1000499D977EB66ED55EF44E133E322E511ED2 +:105A2000700E9FFFBEEFDDDFFCCF1BBF3AAF599F6B +:105A3000788F8891A981CAB1EBA10CD12DC14EF10B +:105A40006FE18010A100C230E32004502540467071 +:105A50006760B9839893FBA3DAB33DC31CD37FE39C +:105A60005EF3B1029012F322D232354214527762C1 +:105A70005672EAB5CBA5A89589856EF54FE52CD56C +:105A80000DC5E234C324A014810466744764245411 +:105A90000544DBA7FAB79987B8975FE77EF71DC77C +:105AA0003CD7D326F2369106B01657667676154661 +:105AB00034564CD96DC90EF92FE9C899E9898AB9CC +:105AC000ABA94458654806782768C018E1088238B1 +:105AD000A3287DCB5CDB3FEB1EFBF98BD89BBBABDC +:105AE0009ABB754A545A376A167AF10AD01AB32A01 +:105AF000923A2EFD0FED6CDD4DCDAABD8BADE89D2C +:105B0000C98D267C076C645C454CA23C832CE01C50 +:105B1000C10C1FEF3EFF5DCF7CDF9BAFBABFD98FBB +:105B2000F89F176E367E554E745E932EB23ED10EA0 +:105B3000F01E000022002500340046004B005900F2 +:105B40006C007A0088008E00920096009A009E00F9 +:105B5000A100A400A700AA0020010D10030C110C45 +:105B60000C040202020201010101010080F186F130 +:105B700087F194F18AF18CF190F191F198F199F11A +:105B800010FE11FE12FE13FE14FE15FE16FE17FE89 +:105B900018FE0000000000000100010101010101E8 +:105BA00001010101010000001300210027002B006A +:105BB0002F00330037003A003D0040004300110041 +:105BC0000C000400020002000200020001000100BB +:105BD00001000100010090F198F199F110FE11FE11 +:105BE00012FE13FE14FE15FE16FE17FE18FE10110F +:105BF000222E273E3128853436377F001C5C000872 +:105C000000000020600100004C0200086C5C0008ED +:105C100060010020C04300005E5500081184A24AC4 +:105C2000040009330102030406070809293B693F00 +:105C3000051502040608EA1F35017B13A13F1B0866 +:105C4000D1041AF50413A5401B08150413C1411B08 +:105C500008D9081A71041AE50C1A0D041A4D042A01 +:0C5C60008D18124F0914D50A1580187118 +:04000005080001519D +:00000001FF +:020000040800F2 +:10800000007800206581000833F500087DEC000849 +:1080100031F50008E5AE00089545010800000000B4 +:10802000000000000000000000000000ED08010852 +:1080300025D300080000000035F7000815180108D6 +:10804000DD4601087F8100087F8100087F810008EC +:108050007F8100087F8100087F8100087F81000800 +:108060007F81000899D900089FD900087F81000806 +:108070007F8100087F8100087F8100087F810008E0 +:108080007F8100087F8100087F81000871AF0008B0 +:10809000E9AE00087F81000809AF0008A5D90008F3 +:1080A0007F8100087F8100087F8100087F810008B0 +:1080B0007F810008091901087F8100087F8100087D +:1080C0007F8100087F8100087F8100087F81000890 +:1080D0007F81000851370108CD3701089D3801081C +:1080E00049D90008E90501087F8100080000000067 +:1080F0000000000000000000000000000000000080 +:1081000000000000000000007F8100087F8100085F +:10811000792901086D2A01087F8100087F81000804 +:108120007F8100087F8100087F8100087F8100082F +:108130007F8100087F8100087F810008E1B100088D +:108140007F81000841B1000869B100087F81000803 +:10815000DFF80CD000F0EEFC00480047318B01083E +:10816000007800200648804706480047FEE7FEE703 +:10817000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7D7 +:10818000AD1801085181000840EA01039B0703D0A4 +:1081900009E008C9121F08C0042AFAD203E011F846 +:1081A000013B00F8013B521EF9D27047D2B201E008 +:1081B00000F8012B491EFBD270470022F6E710B5EC +:1081C00013460A4604461946FFF7F0FF204610BD45 +:1081D00030B505462A460B4612F8010B13F8014B41 +:1081E00008B1A042F8D01CB1002802D06D1CF1E704 +:1081F000284630BD421C10F8011B0029FBD1801A13 +:10820000704730B504460020034600E05B1C9342F3 +:1082100003D2E05CCD5C401BF8D030BD034611F8C2 +:10822000012B00F8012B002AF9D118467047F0B451 +:1082300080EA0102D40F4200B2EB410F02D20246A3 +:10824000084611464A0042D0C30DDDB2C1F3C75201 +:10825000AD1A202D35DAC1F3160141F4000204B144 +:108260005242C5F1200602FA06F12A411044B3EB4E +:10827000D05F23D0C4B1012DA0EBC35009DCF0BC0A +:108280004FF0004202EAC352DBB200F5000000F0FA +:10829000AEBB400000F1807000EBC350A0F18070D5 +:1082A00040EAD170490009E0490841EAC071A0EBF9 +:1082B000C35000F50000400800EBC350F0BC00F0D4 +:1082C0008DBB6142012202EB4101001BF6E7F0BCCD +:1082D000704781F00041AAE780F00040A7E780EAFC +:1082E000010210B502F00043400022D04A001FD026 +:1082F000010E01EB1261C0F35600C2F3560240F4C6 +:10830000000042F40002A0FB022000047F391404A4 +:1083100000D0401C50EA124001D44000491EC2B2B5 +:108320000C0604EBD010401C4008802A02D003E069 +:10833000002010BD20F00100002900DA00201843C1 +:1083400010BD30B480EA010202F0004530F0004276 +:1083500021F0004013D090B1C30DD40DC2F316012B +:10836000C0F31600E41A41F4000140F400027D3429 +:10837000914201D3641C00E04900002C02DA30BCB9 +:10838000002070474FF400000023914201D3891A66 +:10839000034340084FEA4101F7D151B1914202D164 +:1083A0004FF0004105E002D24FF0010101E06FF013 +:1083B000010103EBC450284430BC00F00FBB420065 +:1083C00005D0C0F3C7525242914201DC00207047F1 +:1083D00000EBC15070472DE9FE4F804681EA030053 +:1083E000C00F0C46009021F0004123F00045B8EB8F +:1083F0000200A94105D24046214690461C460B4644 +:10840000024623F00040104347D0270DC7F30A006F +:10841000C3F30A510290401A019040286BDAC3F36B +:10842000130040F4801B0098924620B10023D2EB49 +:10843000030A63EB0B0B01985946C0F1400250460A +:1084400000F09BFA06460D4650465946019A00F048 +:10845000B3FA10EB08006141002487EA115284EA64 +:10846000E7731A4340D0009A62B3019A012A4FEA97 +:10847000075215DC001B61EB02014FF0004202EADB +:108480000752CDE90042001C41F5801132462B46CF +:1084900000F0EAFA03B0BDE8F08F40462146F9E764 +:1084A000001B61EB0201001C41F5801300185B41C9 +:1084B0002018A2F5001747EB030140EAD570B61962 +:1084C0006D4111E06D084FEA360645EAC0754FEA86 +:1084D0000752001B61EB0201001C41F580114908A5 +:1084E0004FEA30000019514132462B4603B0BDE837 +:1084F000F04F00F0AABA0098012240000023D0EB10 +:10850000020263EBE073009821464FEAE074B8EB97 +:10851000000061EB0401E9E783F000435BE781F0D1 +:10852000004158E72DE9FE4F81EA030404F00044BE +:1085300021F0004100944FF0000B23F0004350EA7B +:1085400001045ED052EA03045BD0C3F30A54C1F3C2 +:108550000A552C44A4F2F3340194A0FB0254C1F355 +:10856000130141F48011C3F3130343F4801301FB9F +:10857000024400FB034E840A970A44EA815447EA06 +:108580008357A4FB076802958D0A05FB07854FEA10 +:10859000932C04FB0C542705029D4FEA065847EA2A +:1085A0001637B5EB08056EEB070C870E920E47EAFF +:1085B000811742EA8312A7FB0201B6EB0B0164EBC1 +:1085C00000042B0D43EA0C335E1844EB1C50DA46D2 +:1085D0005146E7FB0201C5F313044FEA0B3343EAAC +:1085E00014534FEA0432019C43EA0603A4F10C043D +:1085F0000294009CCDE900B400F036FA03B0BDE867 +:10860000F08F00200146F9E72DE9F04D81EA0304DF +:1086100004F0004B21F0004514464FF0000A23F00F +:10862000004150EA050220D054EA01021DD0C5F3F2 +:108630000A570246C5F31303C1F31300C1F30A56E8 +:1086400040F4801543F48013A7EB0608101BD646B0 +:1086500008F2FD3873EB050002D308F1010801E0D0 +:1086600092185B41B8F1000F03DA00200146BDE823 +:10867000F08D00204FF48011064684460EE0171B53 +:1086800073EB050705D3121B63EB050306434CEAA6 +:10869000010C49084FEA300092185B4150EA01078B +:1086A000EDD152EA030012D082EA040083EA050108 +:1086B000084305D0101BAB4106D20122002306E07F +:1086C00000224FF0004302E06FF0010253101AEB5A +:1086D00006004CEB085110EB0A0041EB0B01BDE822 +:1086E000F04D00F0B2B970B521F0004303430CD057 +:1086F000C1F30A550024D5EB040564EB0403D61737 +:10870000AD1AB34102DB0020014670BD201841EBD9 +:10871000025170BDC10F80EAE0700844CA07962379 +:10872000002100F064B996230022114600F05FB9E1 +:108730000EB5C10F80EAE0700844CA07002140F27C +:1087400033438DE80E000A460B4600F08DF903B066 +:1087500000BD0EB540F2334102910021CDE9001178 +:108760000A460B4600F080F903B000BD00F000425D +:1087700020F00040C10DC0F3160040F400007F2936 +:1087800001DA00207047962903DCC1F19601C84048 +:1087900001E096398840002AF4D04042704720F02A +:1087A0000040C10DC0F3160040F400007F2901DA3B +:1087B00000207047962903DCC1F19601C84070473C +:1087C00096398840704770B5C1F30A5201F00045F0 +:1087D0000024C1F3130140F2FF3341F480119A42A7 +:1087E00001DA002070BD40F233439A42A2F23342D4 +:1087F00003DC524200F0D0F800E090402C43F1D06E +:10880000404270BDC1F30A5210B5C1F3130140F2EA +:10881000FF3341F480119A4201DA002010BD40F28A +:1088200033439A42A2F2334203DC524200F0B4F8DE +:1088300010BD904010BD00F0004230F000400AD062 +:10884000C10D01F56071C0F3160042EA0151C20882 +:1088500040071143704700200146704730B5041EA1 +:1088600071F1000404DB4FF00044404264EB01016D +:10887000141E73F1000405DB1C464FF00043524206 +:1088800063EB0403994208BF904230BD01F00043FE +:1088900030B421F0004150EA010206D00A0DA2F5E1 +:1088A0006072C1F31301002A02DC30BC0020704763 +:1088B000440F44EAC104C100E01830BC00EBC250D0 +:1088C00000F08CB8002801DBC0F10040002901DB7A +:1088D000C1F1004181427047002801DBC0F1004036 +:1088E000002901DBC1F100418842704730B50B46D9 +:1088F000014600202022012409E021FA02F59D42D0 +:1089000005D303FA02F5491B04FA02F52844151EA3 +:10891000A2F10102F1DC30BD2DE9F05F0546002037 +:1089200092469B4688460646814640241BE02846E0 +:1089300041464746224600F02FF853465A46C01A91 +:10894000914110D311461846224600F016F82D1A10 +:1089500067EB01084F4622460120002100F00DF888 +:1089600017EB00094E41201EA4F10104DFDC48464C +:1089700031462A464346BDE8F09F202A04DB203AD0 +:1089800000FA02F1002070479140C2F1200320FA62 +:1089900003F3194390407047202A04DB203A21FA60 +:1089A00002F00021704721FA02F3D040C2F1200208 +:1089B0009140084319467047202A06DBCB17203A1E +:1089C00041FA02F043EAE07306E041FA02F3D040D4 +:1089D000C2F1200291400843194670470029A8BF00 +:1089E0007047401C490008BF20F00100704710B4D8 +:1089F000B0FA80FC00FA0CF050EA010404BF10BC8D +:108A0000704749B1CCF1200421FA04F411FA0CF1B9 +:108A100018BF012121430843A3EB0C01CB1D4FEAF2 +:108A200000614FEA102042BF002010BC704700EBED +:108A3000C35010440029A4BF10BC7047401C49001B +:108A400008BF20F0010010BC704710B5141E73F170 +:108A5000000408DA401C41F1000192185B411A43FE +:108A600001D120F0010010BD2DE9F04D92469B464A +:108A700011B1B1FA81F202E0B0FA80F220329046F0 +:108A8000FFF77BFF04460F4640EA0A0041EA0B016C +:108A900053465A46084313D0114653EA010019D0F1 +:108AA000C8F140025046FFF777FF05460E46504694 +:108AB00059464246FFF761FF084305D0012004E014 +:108AC00020463946BDE8F08D0020054346EAE076B1 +:108AD0002C4337430A986305E40AA0EB0800002200 +:108AE000FD0A44EA47540A3002D500200146E9E76E +:108AF000010510196941DDE9084500196941BDE822 +:108B0000F04DA2E7C1F30A52C1F3130140F2FF3363 +:108B100041F480119A4202DA00200146704740F287 +:108B200033439A42A2F2334202DC5242FFF734BF8F +:108B3000FFF723BF064C074D06E0E06840F0010355 +:108B400094E8070098471034AC42F6D3FFF704FBD3 +:108B500074C6010894C6010870B58C1810F8015B42 +:108B600015F0070301D110F8013B2A1106D110F8C6 +:108B7000012B03E010F8016B01F8016B5B1EF9D1CA +:108B80002B0705D40023521E0DD401F8013BFAE750 +:108B900010F8013BCB1A921C03E013F8015B01F8BB +:108BA000015B521EF9D5A142D8D3002070BD000050 +:108BB00038B50121152007F02BFC0F20ADF800007F +:108BC00000248DF803406946064805F07DFB01202E +:108BD000ADF800008DF803406946034805F074FBCA +:108BE00038BD0000001001400008014010B5FFF73B +:108BF000DFFFBDE8104000F001B8000070B50121B2 +:108C000090B0084607F0E0FB384E304604F072FAA8 +:108C100037480090374801A90024052581E8310034 +:108C20008020CDE90440400006908000079020207D +:108C300008900002CDE909046946304604F0CCFAF8 +:108C40000121304604F04AFA0121480207F0E0FB16 +:108C500001208DF830008DF831000B944FF4602026 +:108C6000CDE90D04224C8DF83C504C3C0BA920461C +:108C700000F086F8052301220A21204600F0A4F81E +:108C8000052302220B21204600F09EF80523032233 +:108C90000C21204600F098F8052304220D212046DF +:108CA00000F092F805231A460021204600F08CF8C7 +:108CB0000121204600F02AF80121204600F01CF88E +:108CC000204600F0BBF8204600F053F80028FAD107 +:108CD000204600F0C2F8204600F044F80028FAD1FF +:108CE0000121204600F0AFF810B070BD080002402E +:108CF0004C240140DC1600200029816802D041F09C +:108D0000010101E021F001018160704700298168C3 +:108D100002D041F4807101E021F4807181607047DC +:108D20000D4910B5884202D1012144150AE00B49D2 +:108D3000884202D10121041504E0094988420AD180 +:108D40000121CC03204607F06FFB2046BDE8104010 +:108D5000002107F069BB10BD00240140002801403C +:108D6000003C0140014600208968490700D50120E8 +:108D70007047014600208968090700D50120704727 +:108D800010B542680E4B0C791A400B6842EA042277 +:108D90001343436082680B4B1A40D1E902432343DB +:108DA0004C7942EA440213438360C26A097C22F48C +:108DB0007002491EC9B242EA0151C16210BD0000F1 +:108DC000FFFEF0FFFDF7F1FF70B5072609290AD96C +:108DD000C568A1F10A0404EB4404A640B543A340CE +:108DE0001D43C56007E0056901EB4104A640B5439A +:108DF000A3401D4305611F23072A09D2446B521E5D +:108E000002EB820293409C4391400C43446370BD4B +:108E10000D2A09D2046BD21F02EB820293409C43BD +:108E200091400C43046370BDC46A0D3A02EB8202A8 +:108E300093409C4391400C43C46270BD816841F0F3 +:108E40000801816070470029816802D041F4A001C7 +:108E500001E021F4A00181607047816841F00401C4 +:108E60008160704738B590228DF8002001228DF87E +:108E700001208DF802108DF803000B480024C0F883 +:108E8000982105F0C5FF6D46285D05F0FFFF0A201B +:108E9000401E0004000CFBD1641CE4B2042CF3D38C +:108EA00005F0D8FF38BD00000080214208B501213F +:108EB000082007F0ADFAC020ADF8000003208DF8BF +:108EC000020010208DF803006946054805F0FCF902 +:108ED00004480121C0F89C11C0F8981108BD000099 +:108EE000000C01400080214210B52248FFF718FF16 +:108EF0002148FFF715FF214802F0FEF9204802F053 +:108F0000FBF9204804F0F6F81E48143004F0F2F89B +:108F10001C48283004F0EEF81A483C3004F0EAF817 +:108F20001848503004F0E6F81648643004F0E2F8CF +:108F30001448783004F0DEF8134805F057F9134868 +:108F400005F054F9124805F051F9124808F02EFDC9 +:108F500011480AF02DFD11480AF02AFD10480AF0C8 +:108F600027FD10480AF024FDBDE810400E480AF025 +:108F70001FBD0000002401400028014000640040A3 +:108F80000068004008000240000801400014014051 +:108F90000018014000040040003801400044004037 +:108FA00000480040004C0040005000402DE9F84FC0 +:108FB000FE49FF4FB1F82B0010F0600F07D14207B8 +:108FC00005D4420403D4820401D4000501D5052050 +:108FD00078704878002488460C2814D1D8F80710F7 +:108FE00042F21070454681420DDD7C70AC70C5F8D0 +:108FF00003403C21EF48FFF7E0F80C20687009F0CF +:10900000C9FB01F0CBFED8F80700E849401CDFF8A7 +:10901000A4A3C1F807007878DFF89CB30226DFF834 +:109020009C930AF1900AAAF1160506287BD2DFE884 +:1090300000F0033DB0F2F1F009F0ACFB3E21E04856 +:10904000FFF7BBF83C21DB48FFF7B7F87C74DD483D +:10905000FC853C8601210170BC714FF4FA60788672 +:109060003C712C806980A5F80540A5F807106C7448 +:1090700099F89701012806D079703976E972BDE830 +:10908000F84F01F08BBE3878E87262280BD3CE48D7 +:109090000078012807D09BF800100029EFD11C218F +:1090A0008BF80010EBE779703976E8E7C748047071 +:1090B0007C74BC85FC8701F07DFA387E012866D17E +:1090C000BC4D288F400446D588F8026099F86B00A3 +:1090D000022808D0B6484FF4FA61743009F066FBF4 +:1090E00001282FD036E0B2484FF47A71743009F07D +:1090F0005DFB012820D1B879411CB971022811D239 +:109100002021B34805F061F9DFF8C89202214846F2 +:1091100005F05BF90121484605F057F94FF4FA7064 +:1091200004F001F900E032E0ABA00BF033FBA04803 +:109130000021743009F03AFB9E486D30C0880CF075 +:1091400093FF07E0A9A00BF025FB9948002174309C +:1091500009F02CFBAC6395F83800C00717D098F8DD +:109160000210022902D0012188F8021090484FF421 +:10917000FA61743009F01AFB012807D1A1A00BF0A5 +:1091800009FB8B480021743009F010FB7E70BDE8AC +:10919000F88F01F00FFABC714FF480418D4805F053 +:1091A00014F9AC74387EAB460028F0D0814D44F2FF +:1091B0002001A86B084201D1400602D50120787039 +:1091C000AC63288F40040BD599F86B00022804D1BA +:1091D00078486D30C0880CF047FF88F80260AC63B7 +:1091E00095F83800C007D2D0E878AA2802D0787C59 +:1091F000B8B13BE0032078700421764805F0E5F82B +:109200008BF811404FF4FA7004F08DF87C74BC8533 +:1092100002E0EEE3E8E15BE0BDE8F84F7FA00BF091 +:10922000B9BA63486421783009F0C0FA01280AD13C +:109230000CF038FF5E488AF80B4000217830CAF8FD +:10924000044009F0B3FA9AF80B10504611290DD1D9 +:10925000417C02290AD1426841F6EC41B1EB124F40 +:1092600004D17E74C472CAF8044002E0787C0228FB +:109270000CD102200CF016FFB88D0021401CB885DF +:10928000032078744A487C3009F090FA787C0328EF +:109290007FF47DAF9AF80B10504613290DD1417C15 +:1092A00002290AD1426841F6EC41B1EB124F04D1D8 +:1092B000AC63C472CAF804407C743D4832217C30EF +:1092C00009F074FA0128E3D17C74BC85AC635EE7D5 +:1092D00001F070F9374944F22002886B104201D145 +:1092E000400602D5012078708C63324890F838002F +:1092F000C00759D0787C28BB2D483221803009F036 +:1093000055FA01280BD100210CF096FD28488AF867 +:109310000B4000218030CAF8044009F047FA9AF85F +:109320000B10504611290DD1417C06290AD1426803 +:1093300041F6EC41B1EB124F04D17E74C472CAF80D +:10934000044002E0787C02280AD1002102200CF0BF +:1093500073FD0320787416480021843009F026FA42 +:10936000787C03286CD19AF80B105046132911D140 +:10937000417C06290ED1426841F6EC41B1EB124F17 +:1093800008D17C74C4720B48CAF80440816B21F088 +:109390000101816306483221843009F007FA01286F +:1093A0004ED17C74034847E04AE000003E2A00208A +:1093B00058020020740B00207C070020902A002017 +:1093C000001700208B070020820700201C050020CA +:1093D00000100140000C0140445F43445A5F484183 +:1093E0004E44494E475F43484D0A0D00424D535F7E +:1093F00050524F544F43414C5F4742323031310A53 +:109400000D00000052455620445F43445A5F4841D6 +:109410004E44494E475F43524D0A0D005245562077 +:10942000445F43445A5F48414E44494E475F43526C +:109430004D2041410A0D0000816B21F00101816343 +:10944000DFF834A4DAF83800810704D520F00200F0 +:10945000CAF8380050E0410725D5B88D401C80B2CD +:10946000B885F97988421CD3AAF8304098F80000F2 +:109470000C2803D09BF8001041B10AE04FF4804162 +:10948000FE4804F0A4FF0120A87402E00D218BF82F +:109490000010AA200CF004FFDAF8381021F00401C3 +:1094A00028E00020F6E7000726D59AF81A00AA2837 +:1094B00002D1F3A00BF06EF9B88DF979884243D34D +:1094C00098F800000C2803D09BF8001041B10AE086 +:1094D0004FF48041E94804F07AFF0120A87402E0CB +:1094E0000D218BF80010AA200CF0DAFEDAF8381003 +:1094F00021F00801CAF838109AF81A00AA287FF457 +:10950000E6AEDFF894A3E549DAF80400009088425B +:1095100048DDB9F8590000F5FA70FFF704F9009931 +:10952000FFF7DAF93ED2042078704FF0010987F88E +:109530000290DB49DAF80000DA4A014456469142CB +:1095400004D2FFF72CF903E00020CDE740F61C40E1 +:1095500028807068FFF723F9A7F84200BC857C7467 +:109560000021D1483F1D09F021F9D0A00BF012F9DC +:10957000D7498BF800400C70D6497C703C700C7059 +:10958000BC877C8398F800100C2903D00D218BF840 +:109590000010FCE54FF48041B84804F018FF85F84E +:1095A0001290F4E5B88D411CB98544F620618842DB +:1095B000EFD905207870BC857C749BF8001009B940 +:1095C0008BF80060DAF804402046FFF7E8F8A7F8C7 +:1095D00042002046FFF7CAF8B9F85920BDE8F84F15 +:1095E00001B2BDA00BF0D6B8B878DFF8208301280F +:1095F00002D0022864D0BEE09F48C54AB0F81B10D4 +:10960000B1F5FA6F2FD9B9F8590000F5FA739942FC +:1096100029D2A149D1F804B0934507DD00F5967031 +:10962000FFF781F85946FFF757F92BD39A4841685D +:10963000B848814291484FF480410BDD04F0C5FEEB +:10964000AC740BE0BE704FF480418C4804F0BDFE5A +:10965000AC748FE004F0BBFE0120A8743C864FF48C +:109660007A70788687E08C48D0F804B0934510DD96 +:10967000B9F8590000F59670FFF755F85946FFF70D +:109680002BF906D2388E411C3986798E8842D9D87A +:1096900071E03C864FF47A70788609F07BF87E485A +:1096A00041689C48814275484FF4804103DD04F0D5 +:1096B0008CFEAC745FE004F08AFE0120A8745AE0CE +:1096C0007548954940680090884240DDB9F85900D6 +:1096D00000F59670FFF727F80099FFF7FDF836D2EE +:1096E0000FF0A6FD012846D13879142826D27948F2 +:1096F000007810BB7879012816D198F81B10012941 +:1097000002D1B8F8261079B1388E411C398641F261 +:10971000883188422FD93C8609F03CF802F01AFEC5 +:10972000A8F826407C7126E03C8630B909F038F86C +:109730003879401C3871012078711CE09BF80010CA +:1097400011B911218BF800106148067013E0388EB2 +:10975000411C398641F2883188420CD96F4A4FF05A +:10976000010BA2F800B0798609F014F8594887F87F +:1097700002B004703C8611F06FFB08B154480670CB +:1097800005F0BEFD01282FD181033C4804F01DFEE9 +:10979000AC7498F800104046012925D1C17E0129FA +:1097A00022D199F897214FF4967B012A26D0B9F857 +:1097B0007511B8F81C0002F0A4F9584528D3B8F880 +:1097C0001C20B9F875112BE004212C4804F0FFFD92 +:1097D0000120687404E00421284804F0F6FD6C744C +:1097E0004FF4FA7003F09FFD0CF0B4FE08B3384854 +:1097F000007801281DD002281BD03BE0DFF8209123 +:10980000B8F81C00B9F83C1002F07BF9584503D2B7 +:10981000687C0028D8D0E7E7B8F81C20B9F83C10DD +:109820008A42E1D9B0F5AF7FDED9687C0128D2D079 +:10983000DAE728480121017025480078022801D183 +:1098400008F0A8FFF88D401C80B2F885B0F5FA6FDB +:1098500010D998F81B20012A07D1B8F81E109629B4 +:1098600003D342F21071884204D908F093FFFC85BB +:109870000520787056E00000740B0020000C0140B9 +:1098800043445A5F48414E44494E475F43524D203E +:1098900041410A0D00000000E81600200080BB4492 +:1098A000FF3FBEBAFFFF18009C02002043445A5FEE +:1098B00048414E44494E475F43524D204141207438 +:1098C0006F204368617267696E670A0D00000000CF +:1098D000820700201C0500204241545F53616D70D7 +:1098E0006C655F566F6C74202564203E3C20426D91 +:1098F000734D6178566F6C7420256420656E6469C1 +:109900006E67206368617267650D0A0000170020AA +:1099100000603D4500C05A450000FA442E05002075 +:10992000FC0D002000F046FE00F02CFC00F0F6FCE0 +:109930003221644808F03AFF012805D10CF052FAB0 +:109940000021604808F032FF5E48FA21001D08F04F +:109950002DFF01283CD1787C68BB5A48C8211438B7 +:1099600008F024FF01280DD10CF0F4FA8AF80B401E +:10997000CAF80440B88D0021401CB88551481438FD +:1099800008F014FF9AF80B10504611290DD1417CB4 +:1099900011290AD1426841F6EC41B1EB124F04D1D2 +:1099A000BC85C472CAF8044003E0B88D022802D90D +:1099B000BC857E7402E0787C022809D102200CF07C +:1099C000C9FA40487C74BC850021001D08F0EEFEF9 +:1099D0003C48FA21083008F0E9FE01287FF477AC12 +:1099E0000CF0AAFCBDE8F84F36480021083008F01A +:1099F000DDBE08F0CFFEFC70464688F80240DFF876 +:109A0000C880FC874FF48041404604F0DEFC2D48BE +:109A1000AC74FA210C3008F0C9FE012807D10020EF +:109A20000CF05AFC274800210C3008F0BFFE322110 +:109A3000244808F0BBFE012806D100200CF06CFD84 +:109A40000021204808F0B2FED6F8071041F2883015 +:109A5000814214DC70780C2811D099F89701012804 +:109A6000BCD1E87A6228BFF432AC184E308F400483 +:109A700013D57C70B463687C012805D00DE01348D1 +:109A80007C7084633C760FE00421404604F09DFC2A +:109A90006C744FF4FA7003F046FC96F83800C00777 +:109AA0003FF415AC7C70B463687C012896D1042126 +:109AB000404604F08AFC6C74BDE8F84F4FF4FA702D +:109AC00003F031BCE0020020000C0140740B0020C8 +:109AD00000F00F01000900EB800001EB4000C0B274 +:109AE000704710B5012006F0ABFCBDE81040002027 +:109AF00006F0A6BC014908607047000000860D42D0 +:109B00002DE9F04F724C734AA1B041F20400A4F861 +:109B10000500D0790026012800D1D6716E4F106D56 +:109B2000F97A10B9917301201065DFF8B0B10A25F8 +:109B30005846BBF81230BA46B3FBF5FCB3FBF5F35D +:109B400084F807C01B0A2372BBF81430B3FBF5FC82 +:109B5000B3FBF5F384F809C01B0AA372BBF81630F7 +:109B6000B3FBF5FCB3FBF5F384F80BC01B0A2373BE +:109B7000038BB3FBF5FCB3FBF5F384F80DC01B0AB4 +:109B8000A373B0F81B30B3FBF5FCB3FBF5F384F81B +:109B90000FC01B0A2374B7F80730B3FBF5F7B3FB0C +:109BA000F5F367741B0AA374BBF83200E074000A73 +:109BB00020754B480078431E632B01D8607500E088 +:109BC0006175DFF82081907BA075DFF81C91D8F8D3 +:109BD0000800464F484508D2B84206DA4449FEF725 +:109BE00026FBFEF7DCFDE07500E0E675D8F80C001A +:109BF000484508D2B84206DA3D49FEF718FBFEF7A1 +:109C0000CEFD207600E02676D8F81000484508D230 +:109C1000B84206DA3649FEF70AFBFEF7C0FD607669 +:109C200000E06676334931F8590FB0FBF5F2B0FB2E +:109C3000F5F0A276000AE0764888B0FBF5F2B0FBBA +:109C4000F5F02277000A6077488DB0FBF5F2B0FBA3 +:109C5000F5F0A277000AE077888DB0FBF5F1B0FB54 +:109C6000F5F084F82010000A84F821009AF8110019 +:109C700084F82200BBF8300084F82300000A84F83E +:109C800024001D48C17E01291FD0808CB0FBF5F156 +:109C9000B0FBF5F084F82510000A84F82600202097 +:109CA00060801648017C491C017415A00AF072FD01 +:109CB00020AA6946064803F0ADFA064800214C3058 +:109CC00008F074FD21B0BDE8F08F808BDEE7000066 +:109CD000723400207C070020EE0B0020740B002063 +:109CE00058020020E8160020000020C20000F642C2 +:109CF00000002042902A002000170020F8350020A4 +:109D000073656E6420436861726765206461746185 +:109D10000A0D00002DE9F04FDFF818A1A1B041F2C3 +:109D200009010AF2EA24AAF805104FF0780BA4F80A +:109D300017B040F2DE30404DA4F81D004FF47A70A9 +:109D4000AF8F24F80D7F6E8F6680A0802889FEF784 +:109D500000FD3A4A3A4BFEF7E5FBFEF753FDC3B26E +:109D6000E371EA7EA2714FF03209A4F80890E88FFF +:109D70002946C0F30900A081B5F827C0C98A0D3C67 +:109D80004FF06408BCF1000F07D1B5F806C00CFB1A +:109D900001FC9CFBF8FCA5F827C0B5F825C0BCF178 +:109DA000000F07D1B5F804C00CFB01FC9CFBF8F1D7 +:109DB000A5F8251095F827C084F81BC095F8255004 +:109DC00025778AF807703C0A8AF808408AF8096003 +:109DD000340A8AF80A40E8248AF80B4003248AF8F7 +:109DE0000C408AF80D308AF80E208AF80F90002275 +:109DF00051468AF810208AF811B08A74C874000A93 +:109E0000087581F815C08D75DE20C8750C760D4972 +:109E10001220AAF80200087C401C08740AA00AF06C +:109E2000B9FC20AA6946034803F0F4F921B0BDE863 +:109E3000F08F000072340020FC0D00207B14AE4730 +:109E4000E17A843FF835002053656E6420436861F1 +:109E50007267696E6744617461200A0D000000003A +:109E600030B5A1B000201D49ADF880001C4C41F276 +:109E70000300A1F80500E07BC8711A480125022300 +:109E800000780422012809D0022807D003250328DE +:109E900004D0042805D0052806D008E00B724D72C6 +:109EA00005E00D724A7202E00A72052048722078BD +:109EB00088724A800C49087C401C08740BA00AF088 +:109EC00069FC20AA6946054803F0A4F9044800216A +:109ED000483008F06BFC21B030BD00007234002027 +:109EE0007C07002059020020F835002073656E645D +:109EF0002073746174652064617461200A0D000030 +:109F00002DE9FE4F002738490097019702970878FE +:109F1000DFF8D8803C4650B3012826D10F70344F6B +:109F2000DFF8D090DFF8D0A000246D4608F11806C5 +:109F300058F82400FEF77FFC02460B463846494697 +:109F4000FEF762FB00225346FEF7E6FAFEF79EFCA0 +:109F500045F8240004F0C6F8FEF7DCFB06EB8401AC +:109F6000641CA4B28860032CE2D3BDE8FE8F48785D +:109F70001E4D401CC0B2183D89464870142810D2AE +:109F800005F1240636F81400FEF7CDFB55F8241031 +:109F9000FEF74DF945F82400641CA4B2032CF1D35C +:109FA000E3E7124EDFF854B0DFF854A00C3E55F84A +:109FB00024005946FEF7C5F96FF00B01FEF7FFF9D3 +:109FC0005146FEF78CF948F8240046F8247045F80D +:109FD0002470641CA4B2032CE9D389F80170012118 +:109FE00089F80010C1E70000F4040020D01600201A +:109FF0009A999999999913400000F03F0000A04167 +:10A000003333534010B5124CA2B041F22100A4F8F2 +:10A010000500A4F246404069E071010A2172010C7A +:10A020006172000EA072042004F5C3716080087C88 +:10A03000401C087407A00AF0ADFB20AA6946204620 +:10A0400003F0E8F80421E01D0EF0FCFA22B010BD88 +:10A05000723400200A0D7368656E676A6979696EEB +:10A06000676461200A0D000010B50F4CA2B04FF4D8 +:10A070008150A4F805005520E071AA20207202202A +:10A0800004F5C3716080087C401C087407A00AF0C6 +:10A0900081FB20AA6946204603F0BCF80221E01D9E +:10A0A0000EF0D0FA22B010BD723400204F5441207F +:10A0B00041434B200A0D000000B51A49A1B041F2FE +:10A0C0000800A1F8050018A001F2BE23026818A03C +:10A0D000DA6200681863A1F1420343F8492F01F2E4 +:10A0E000EA225860144809231373D0F8B500000B16 +:10A0F0009060C873020A0A74020C4A74000E8874D5 +:10A10000CB740D20488001F5C371087C401C087495 +:10A110000AA00AF03FFB20AA6946024803F07AF839 +:10A1200021B000BD723400205332303100000000F5 +:10A130005169525569000000FC0D002073656E6482 +:10A1400020626D732076657273696F6E0A0D000070 +:10A1500010B501214FF0C05006F042F9012005F082 +:10A1600061FA074A116908784978C943C9B2884237 +:10A1700002D1411E042900D30020107010BD000040 +:10A18000E004002010B54FF47A711A4808F00EFB75 +:10A1900001282DD1184830F8051F408841434FF45D +:10A1A000616091FBF0F0FEF7B5FA144C54F8031F10 +:10A1B000FEF73DF82060FEF73EFB114A114BFEF71B +:10A1C000B1F90022104BFEF71FFAFEF71BFB0A4CF9 +:10A1D00000217A3C6086074808F0E8FAA4F14800BC +:10A1E000618E01814189491C4181208E401C20865D +:10A1F00010BD0000B4020020EE0B00203E2A00201B +:10A200009A9999999999F13F0088C3402DE9F047AF +:10A21000DFF8FC803F4A4049B8F80500508391F8C8 +:10A220009731032B71D10A23B0FBF3F45483B1F8B7 +:10A230009801A04269D3B1F89A01A04265D80020E4 +:10A24000914601EB4005B5F89C21A24258D8B5F8DB +:10A250009E21A24254D901EB4000B5F89C61B0F8B0 +:10A260009E0105F5CE75801BFEF754FA8246688C78 +:10A270002F8CC01BFEF74EFA5146FEF762F80546DA +:10A280003846FEF750FA82464F46A01BFEF742FAC8 +:10A290002946FEF724F85146FDF7C9FFFEF77FFA7D +:10A2A000C0B2F87398F80B10454601B9E872C82C93 +:10A2B00003D97978032900D2E872E97A01F021FC08 +:10A2C000032805D8E97AF87B814216D8E87214E0B1 +:10A2D000104841F28831683008F068FA01280CD142 +:10A2E000E87A602804D2F97B884201D8401CE872E1 +:10A2F00008480021683008F059FA0120BDE8F087CD +:10A30000401CC0B210289CD3F8D10020F6E7000012 +:10A31000EE0B002058020020902A00202DE9F04189 +:10A320006A4E0021728DB08B824202D070853167F7 +:10A330003174674C4FF4FA62E07A6428306F00F1B0 +:10A340000103336704D2904207D90220316703E04A +:10A35000904202D906203167B0835E4DB5F8831074 +:10A36000B5F85900814201D9A5F88300B5F88520D8 +:10A37000B5F85B108A4201D9A5F88510B4F805102C +:10A38000B4F80720C827514342F2107291FBF2F152 +:10A39000B164B18B4FF4967807295DD2DFE801F004 +:10A3A0005C5E0422303737002188814200D920804A +:10A3B00046484FF47A716C3008F0F8F901284DD115 +:10A3C0006088B5F88510884201D21E3060806088B0 +:10A3D000642801D2642060803C4800216C3008F081 +:10A3E000E5F93BE0B5F883002080B5F88500FEF77D +:10A3F000B0F9394A394BFEF795F8FEF703FA24E035 +:10A40000B5F883002080B5F8850040081DE095F878 +:10A4100097019621012803D0B5F8830020800BE036 +:10A420002F48304AC08812885043B5F8832090FBEB +:10A43000F2F080B2642801D261800FE0962801D248 +:10A4400067800BE0C82802D2FA20608006E0FA2874 +:10A4500004D2A4F8028001E00120B08322480078F1 +:10A46000012804D121480088404500D86780B07891 +:10A47000022802D0012803D00FE0B5F883000BE0DA +:10A480001B481C491C4A00680144914202D2FEF755 +:10A4900086F901E040F61C4020806188B5F885000F +:10A4A000814200D960802188B5F85900814200D9E5 +:10A4B00020806188B5F85B00814200D960806088A7 +:10A4C0001E2801D21E206080BDE8F08158020020C5 +:10A4D000EE0B0020902A00209A9999999999E93FCA +:10A4E000FC0D0020240500201C050020260500206E +:10A4F000E8160020FF3FBEBAFFFF180070B52949DB +:10A50000294D31F8590FE8848988884201D9401AC9 +:10A510002885A97B687B254C814224D0E17A01B94A +:10A52000E072E17A01F0EDFA032806D8E17A687B5F +:10A53000814224D8E072A87321E01B484EF66021C6 +:10A54000643008F033F9012819D1E07A622804D286 +:10A55000697B884201D8401CE072134800216430B6 +:10A5600008F024F90BE010481149603008F01EF99A +:10A57000012809D1E07A602801D2401CE0720A4823 +:10A580000021603008F012F9E07A6421642800D3D9 +:10A59000E172E07AA0F147021D2A00D35A21A1817D +:10A5A00070BD0000902A002058020020EE0B002011 +:10A5B000C0D4010070B5164D164C95F897010228CD +:10A5C00009D0012803D0FFF721FE20B105E0124891 +:10A5D0000078E07201E0FFF791FF10481049114A3E +:10A5E00040680144914202D2FEF7D9F80CE00948D4 +:10A5F0007A38B0F81B00B0F5FA6F03D9B5F85910E6 +:10A60000884201D3B5F88300A4F8050070BD0000AE +:10A61000902A0020EE0B002058020020E8160020AF +:10A62000FFFF1EBBFFBF790070B5094D130AD2B200 +:10A6300005F5807605E010F8014B5C402B5D53403A +:10A64000325D491E89B2F6D242EA032070BD000095 +:10A65000C0BB010870B5094DFF22134605F5807691 +:10A6600005E010F8014B54402A5D5A40335D491E05 +:10A6700089B2F6D243EA022070BD0000C0BB0108D7 +:10A68000022101A005F08ABF415400000A2101A067 +:10A6900005F084BF41542B53544154453D3F0000C5 +:10A6A00010B588B0044620216846FDF786FD2021BC +:10A6B0006846FDF782FD224606A168460AF07AF850 +:10A6C0006846FDF797FD0146684605F067FF08B04C +:10A6D00010BD000041542B4E414D453D25730000F7 +:10A6E000092101A005F05ABF41542B4E414D453D73 +:10A6F0003F0000000D2101A005F050BF41542B5533 +:10A700004152545F4346473D3F0000000B2101A0EA +:10A7100005F044BF41542B564552494F4E3D3F0032 +:10A7200070B5214D687801283DD1204C207806284D +:10A7300030D2DFE800F003130B2F1A2307221CA1ED +:10A740001D48FDF75EFD28BB022015E00A221BA173 +:10A750001948FDF756FDE8B901200DE01A491648E1 +:10A76000FDF736FDB0B1042006E00B2217A1124818 +:10A77000FDF747FD70B9052020700BE00E486060C2 +:10A78000688A20810C480188A1F5B442A53A01D11C +:10A790000EF0BEFD002068706882BDE87040802128 +:10A7A0000548FDF70ABD70BD7C070020F835002084 +:10A7B00041542B4F4B0D0A001C31002041542B4FAC +:10A7C0004B0D0A3033303300A02A002041542B4F68 +:10A7D0004B0D0A30310D0A0010B5114C20780628B7 +:10A7E00019D2DFE800F0030B07180F19BDE810407D +:10A7F000FFF746BFBDE8104000F0B0BABDE810401A +:10A8000000F070BA00F096FA064890F8760008B1A9 +:10A81000012800D1A07010BDBDE8104000F004B8C0 +:10A82000F8350020902A00202DE9F041404E96F89E +:10A83000A800012823D03F4D3F4A4FF47A71E984A4 +:10A840003046177C0123002490F87600142F06D997 +:10A8500010B1012802D002E0947000E09370977864 +:10A86000052F0CD2DFE807F003070D0B5700BDE8FA +:10A87000F04100F007BA00F0C5F986F8A840BDE83D +:10A88000F0812C48343007F091FF0128F7D1A88CD3 +:10A89000401C80B2A884092800D9AC842548002136 +:10A8A000343007F083FFA88CA8B1012817D0022804 +:10A8B00019D00328E3D0042819D005281BD0062876 +:10A8C0001DD007281FD0082821D00928D7D1BDE8DE +:10A8D000F0410BF067B8BDE8F04100F0B5B8BDE855 +:10A8E000F041FFF70DB9BDE8F041FFF7B9BABDE897 +:10A8F000F04100F023B8BDE8F041FFF7DDBBBDE853 +:10A90000F041FFF707BABDE8F0410BF0A7B8BDE88A +:10A91000F0410BF009B8517C4D1C55741429AED987 +:10A92000147018B10128AAD19370A8E79470A6E713 +:10A93000902A00207C070020F835002070B5A2B0D6 +:10A94000374C0021ADF8801041F20700A4F8050053 +:10A95000344842F21076838BC28BE37103FB02F51D +:10A9600095FBF6F51B0A23726272120AA272E57257 +:10A9700090F8292012B12832227300E0217390F858 +:10A98000282012B12832627300E061732022A27382 +:10A990005F22E273C37E2374C28C6274120AA274B3 +:10A9A000E374B0F809202275120A6275B0F80B2022 +:10A9B000A275120AE275B0F801202276120A6276B8 +:10A9C000B0F80520A276120AE276C2792277428A8E +:10A9D0006277120AA27790F82A2012B12832E27721 +:10A9E00000E0E17790F82B0018B1283084F82000BF +:10A9F00001E084F820100CA009F0CCFE1A20608041 +:10AA000020AA6946064802F005FC0C49087C401C57 +:10AA1000087400210A4807F0C9FE22B070BD00008A +:10AA2000723400200017002073656E642044434494 +:10AA30004320646174610A0D00000000F8350020B5 +:10AA4000D007002005F09EBD30B5A1B00020614CBC +:10AA5000ADF88000604941F20200A4F80500486C9E +:10AA60005F4B401C486404F8070F000A60705B48A5 +:10AA700090F86B10A1705A8A0A21B2FBF1F5B2FB73 +:10AA8000F1F2E570120A22719A8AB2FBF1F5B2FB7B +:10AA9000F1F26571120AA271DA8AB2FBF1F5B2FB2A +:10AAA000F1F2E571120A22721A8BB2FBF1F3B2FBDA +:10AAB000F1F26372120AA27290F88D20E272B0F87D +:10AAC0005320B2FBF1F22273B0F863206273120AD2 +:10AAD000A273B0F88E20B2FBF1F3B2FBF1F2E37394 +:10AAE000120A2274B0F8B320B2FBF1F26274B0F82B +:10AAF000B120B2FBF1F2A274B0F85D20E274120A48 +:10AB00002275B0F85F206275120AA275B0F859205C +:10AB1000E275120A227690F8B020627690F88920C9 +:10AB2000A27690F88A20E27690F88B20B2FBF1F2C0 +:10AB3000227790F88C20B2FBF1F2627790F8B52082 +:10AB4000323AA27790F8B620323AE27790F8B720FE +:10AB500084F8202090F84D2084F8212090F84F2090 +:10AB600084F8222090F8512084F8232090F8872040 +:10AB700084F824201B4A927884F82520B0F890208D +:10AB8000B2FBF1F184F8261090F8921084F82710A7 +:10AB900090F8930084F8280010490E48112295314E +:10ABA0003030FDF7F1FA10A009F0F4FD3A2024F856 +:10ABB000050C20AA6946074802F02CFB1049087CC6 +:10ABC000401C087404480021403007F0EFFD21B01C +:10ABD00030BD0000723400207C070020902A002045 +:10ABE000740B00203E2A002073656E642068656146 +:10ABF0007274626561742064617461200A0D0000E2 +:10AC0000F835002010B592B00020ADF8400040F6B5 +:10AC1000B831134807F0CAFD01281FD1114C41F289 +:10AC20000100A4F8050010A009F0B4FD1349A4F137 +:10AC30004200CA6E40F8492F096F416010490A6806 +:10AC400082604968C1601020608010AA6946204671 +:10AC500002F0E0FA0021024807F0A8FD12B010BD92 +:10AC6000B80700207234002073656E64204C6F6753 +:10AC7000696E20646174610D0A000000902A002052 +:10AC800030BB010810B592B00024ADF8404041F24D +:10AC900088310C4807F08AFD012810D101030A48C9 +:10ACA000A0F80510448009A009F074FD10AA6946B7 +:10ACB000054802F0AFFA0021024807F077FD12B014 +:10ACC00010BD0000B40700207234002053656E648C +:10ACD000205265676973746572656420646174618C +:10ACE0000A0D000010B54FF47A71104807F05EFDB0 +:10ACF000012819D10D4C2C3C607B20B1012804D0D7 +:10AD0000022807D00AE0012007E00948FFF7C8FC45 +:10AD1000022002E0FFF7E4FC00206073BDE8104071 +:10AD20000021024807F042BD10BD0000A807002026 +:10AD3000A02A002010B540F6B831074807F036FDCC +:10AD4000012807D1FFF7A2FCBDE81040002102480E +:10AD500007F02CBD10BD0000AC07002010B54FF46B +:10AD60007A710D4807F022FD012814D10A4C283CC5 +:10AD7000207B10B1012804D007E0FFF7C7FC0120B9 +:10AD800002E0FFF7B7FC00202073BDE8104000216F +:10AD9000014807F00BBD10BDA40700202DE9F047C6 +:10ADA00031214448FDF709FA42480D213130FDF7C1 +:10ADB00004FA404813213E30FDF7FFF93D480127D2 +:10ADC0003D4D077047700026867095F8B010C17031 +:10ADD000B5F85F1051B18180B5F859404FF4FA6A67 +:10ADE00040F6AC59544504D3C48004E04FF47A7162 +:10ADF000F1E7A0F80690DFF8BC8030A2A8F10408C3 +:10AE00001268C8F80C201F21C66001740B21417420 +:10AE10000A218174C6740675102141758775C6753F +:10AE200095F8951008F11C00FF294FF0110204D08D +:10AE300021499531FDF7A8F902E022A1FDF7A4F917 +:10AE400025A140460A6840F82D2F496841601949FC +:10AE5000B5F8B10031310880B5F85B00642801D243 +:10AE60004FF4FA704880B5F863008880A4F2D1707E +:10AE700040F6C312904201D2CC8001E0A1F80690C6 +:10AE80006E2008724FF49670A1F80900B5F86700BB +:10AE9000504501D840F6B830A1F80B0005481E21F6 +:10AEA0003E304180B5F883100180C6720774BDE85A +:10AEB000F0870000B00B0020902A00204259445433 +:10AEC000000000004C4656324132314B364133309F +:10AED00039323339390000005330303148303031A5 +:10AEE00000000000FEE7000000B585B06A460021C2 +:10AEF000044800F09FFC694600200BF04BFD05B0B4 +:10AF000000BD00000064004070B5174C4FF40075A0 +:10AF10002946204600F0C6FA01280CD113492046E4 +:10AF200000F0A6FA012802D100200BF0D3FD29463B +:10AF3000204600F0A5F94FF480652946204600F030 +:10AF4000B1FA01280FD109492046891C00F090FA76 +:10AF5000012802D100200BF0D5FD29462046BDE88E +:10AF6000704000F08DB970BD006400400200F01028 +:10AF700010B51A4C0021204600F0F6FC022806D03D +:10AF8000012824D00022002108460BF02FFD0121CA +:10AF9000204600F0E9FC022806D0012819D0002242 +:10AFA000012100200BF022FD0221204600F0DCFCF4 +:10AFB000022806D001280ED00022022100200BF02A +:10AFC00015FD2046BDE81040012100F059B90122CD +:10AFD000D9E70122E4E70122EFE700000064004026 +:10AFE00070B58AB005F084FC0121092005F010FA43 +:10AFF0000121480605F0F4F90121880605F0F0F971 +:10B00000494E0021304600F0CFFB7014ADF820000F +:10B0100003208DF822001820444C8DF8230008A945 +:10B02000204603F051F9A014ADF8200048208DF817 +:10B03000230008A9204603F047F9002501248DF8D4 +:10B040001A508DF81B4008208DF818008DF8165006 +:10B050008DF817400620ADF8140007958DF81940BB +:10B0600005A9304600F07AFA0E208DF80E008DF812 +:10B070000F508DF81040ADF80450ADF80850ADF801 +:10B080000650ADF80A50ADF80C408DF8114001A8FB +:10B0900000F088F901221021304600F057FA4120D3 +:10B0A0008DF800008DF801408DF802508DF80340B6 +:10B0B000684604F043FA01221146304600F046FA91 +:10B0C00001225102304600F041FA0122910230463D +:10B0D00000F03CFA0122D103304600F037FA01219A +:10B0E000304600F061FB3F208DF800008DF80140F4 +:10B0F0008DF802508DF80340684604F01FFA422094 +:10B100008DF800008DF801408DF802508DF8034055 +:10B11000684604F013FA05F0F5FB05A009F03AFBC8 +:10B120000AB0002070BD000000680040000C014023 +:10B1300063616E2032206F70656E210A000000008E +:10B1400000B585B06A460121064800F073FB9DF802 +:10B150000900002803D1694601200BF01BFC05B053 +:10B1600000BD00000068004070B51B4C4FF4007536 +:10B170002946204600F096F9012810D1174E2046A6 +:10B18000314600F075F9012805D10BF0A3FC3146DA +:10B19000204600F05DF82946204600F071F84FF493 +:10B1A00080652946204600F07DF9012813D10B4E19 +:10B1B0002046B61C314600F05BF9012805D10BF0A2 +:10B1C000A1FC3146204600F043F829462046BDE860 +:10B1D000704000F055B870BD006800400200F010EB +:10B1E00010B51A4C0021204600F0BEFB022806D004 +:10B1F000012824D00022002101200BF0F7FB0121BF +:10B20000204600F0B1FB022806D0012819D0002208 +:10B21000012108460BF0EAFB0221204600F0A4FBC6 +:10B22000022806D001280ED00022022101200BF0B6 +:10B23000DDFB2046BDE81040012100F021B80122CD +:10B24000D9E70122E4E70122EFE7000000680040AF +:10B250000A4A914202D1002181617047C1F3130271 +:10B260008B0101D5C26070474B0101D50261704767 +:10B27000090101D582607047426070477000F0306C +:10B2800030B5082310240422B1F5007F1DD010DC56 +:10B29000202929D007DC012921D0042922D008291E +:10B2A00000D1C46030BD402920D0B1F5807FF9D1F4 +:10B2B0000BE00025B1F5004F06D008DCB1F5806F3A +:10B2C00003D0B1F5006FEDD18561426030BDB1F5BD +:10B2D000803F0DD0B1F5003FF8D1446030BD054945 +:10B2E000816030BDC36030BD036130BD046130BDDD +:10B2F000436030BD01010100094910B588424FF09B +:10B30000010101D14C0601E04FF08064204605F0B8 +:10B3100073F82046BDE81040002105F06DB800002C +:10B320000064004030B41446002819D00022027294 +:10B3300002604260B1F5006F03D3042505724160DD +:10B3400001E00272016043B13CB142728372214656 +:10B3500030BC1A460B30FCF717BF827202214172D3 +:10B3600030BC704730B41446002819D00022027255 +:10B3700002604260B1F5006F03D30425057241609D +:10B3800001E00272016043B13CB142728372214616 +:10B3900030BC1A460B30FCF7F7BE827202214172B4 +:10B3A00030BC7047F0B5827A2F4D012191402A6858 +:10B3B00042F001022A602C4E1C3632688A43326009 +:10B3C000294A047B294B0C32A4B914688C431460BD +:10B3D0004488C78844EA0744877A03EBC707C7F85D +:10B3E00040460488878844EA0744877A03EBC70706 +:10B3F000C7F84446047B012C12D114680C43146036 +:10B40000847A026803EBC4044FEA3242C4F840264F +:10B41000847A426803EBC4034FEA3242C3F84426FD +:10B42000114AC37A121D002B136806D00B43136018 +:10B430000D4A0389143213B104E08B43F7E7136814 +:10B440008B4313600389012B02D113680B431360F4 +:10B45000407B012802D1306808433060286820F022 +:10B4600001002860F0BD0000006600400060004060 +:10B470000246002011F4700F03D0926904E001200D +:10B480007047CB0104D552680A401103F7D17047C9 +:10B490000B0101D59268F7E78B0101D5D268F3E77C +:10B4A0001269F1E70246002053690B424AD0B1F518 +:10B4B000807F3BD013DC08292ED007DC012926D061 +:10B4C000022927D004293DD1D0682BE0102925D0AE +:10B4D000202926D0402935D11069102130E0B1F55E +:10B4E000004F2BD00BDCB1F5007F22D0B1F5806F7F +:10B4F00022D0B1F5006F25D19069702120E0B1F51F +:10B50000803F11D0B1F5003F1CD15068E5E790684D +:10B510000D4915E0D06802E0D068DEE7106903212C +:10B520000EE0106908210BE05068FBE790690121EB +:10B5300006E09069022103E0906900E05068042170 +:10B5400000F09CBD7047000001010100002A426923 +:10B5500001D00A4300E08A434261704710B5036896 +:10B56000002223F002030360036843F00103036039 +:10B570004FF6FF7300E0521C4468E40701D19A4281 +:10B58000F9D14268D2073ED08A79012A02683CD0BC +:10B5900022F080020260CA79012A026838D022F0C3 +:10B5A000400202600A7A012A026834D022F02002A6 +:10B5B00002604A7A012A026830D022F0100202604A +:10B5C0008A7A012A02682CD022F008020260CA7A24 +:10B5D000012A026828D022F0040202608A78CC781E +:10B5E000920742EA04620C7942EA04424C790988E3 +:10B5F00042EA0452491E0A43C261016821F0010176 +:10B600000160002114E0002010BD42F08002C1E77B +:10B6100042F04002C5E742F02002C9E742F01002C2 +:10B62000CDE742F00802D1E742F00402D5E7491C19 +:10B630004268D20701D09942F9D14068C007E2D1EF +:10B64000012010BD10460B0001D0002118477047A3 +:10B650000846D1B2C0B20DF037B9000070B58AB05B +:10B660000121052004F0D4FE0121480604F0B8FEB3 +:10B67000474E0021304600F097F8B014ADF8200096 +:10B6800003208DF822001820424C8DF8230008A9D1 +:10B69000204602F019FEE014ADF8200048208DF895 +:10B6A000230008A9204602F00FFE00248DF81A405E +:10B6B00001258DF81B500C208DF818008DF81640D0 +:10B6C0008DF817400920ADF8140007948DF8195033 +:10B6D00005A93046FFF742FF8DF80E408DF80F4068 +:10B6E0008DF81050ADF80440ADF80840ADF80640B4 +:10B6F000ADF80A40ADF80C408DF8115001A8FFF7E5 +:10B7000051FE012202213046FFF720FF14208DF860 +:10B7100000008DF801508DF802408DF80350684606 +:10B7200003F00CFF012211463046FFF70FFF012204 +:10B7300051023046FFF70AFF012291023046FFF71F +:10B7400005FF0122D1033046FFF700FF01213046FB +:10B7500000F02AF813208DF800008DF801508DF8C4 +:10B7600002408DF80350684603F0E8FE16208DF87D +:10B7700000008DF801508DF802408DF803506846A6 +:10B7800003F0DCFE04A009F005F80AB0002070BD4B +:10B79000006400400008014063616E2031206F703A +:10B7A000656E210A0000000000234FF6FF7221B1F0 +:10B7B000012917D0022924D03AE0016821F00201C2 +:10B7C00041F00101016000E0521E416801F00301F7 +:10B7D000012901D0002AF7D1406800F003000128B8 +:10B7E00023D124E0016821F00301016000E0521E32 +:10B7F0004168890701D0002AF9D14068800714D137 +:10B8000015E0016821F0010141F00201016000E052 +:10B81000521E416801F00301022901D0002AF7D12C +:10B82000406800F00300022801D0002300E001235B +:10B830001846704710B500EB0113D3F8B04114F06F +:10B8400004041472D3F8B04133D0E4085460D3F840 +:10B85000B04104F002045472D3F8B44104F00F0470 +:10B860009472D3F8B441240AD474D3F8B841D47292 +:10B87000D3F8B841240A1473D3F8B841240C547394 +:10B88000D3F8B841240E9473D3F8BC41D473D3F8E1 +:10B89000BC41240A1474D3F8BC41240C5474D3F86A +:10B8A000BC311B0E937439B1016941F02001016173 +:10B8B00010BD640D1460CAE7C16841F02001C16089 +:10B8C00010BD30B50246002093685B0108D4906833 +:10B8D000000101D5012003E09068C00037D50220A7 +:10B8E00002EB0012D2F8803103F00103C2F880317C +:10B8F0000B7A73B3D2F880414D681C434B7A43EA0C +:10B90000C5031C43C2F880418B7A03F00F038B728E +:10B91000D2F8843123F00F03C2F88431D2F8843195 +:10B920008C7A2343C2F88431CB7ACC6843EA04236F +:10B93000C2F88831CB7B096943EA0121C2F88C1136 +:10B94000D2F8801141F00101C2F8801130BD04200D +:10B9500030BDD2F880314C7A23430C8843EA4453FB +:10B96000C2F88031D0E70000002221B1012905D0C2 +:10B97000022906D112E08268114801E0826811486C +:10B9800002401149501A8A4214D00ADCA2B16FF069 +:10B99000806010180FD002280CD10FE082680B488D +:10B9A000EEE7B0F5007F09D00949401803D0B0F5A3 +:10B9B000003F03D0002070470220704701207047ED +:10B9C0000300000400030008000100080000031049 +:10B9D0000001FFF710B501784278154B01EB022109 +:10B9E000A3F81B108178C27801EB022109B2B1F5EE +:10B9F0007A6F02DDA1F57A6101E0C1F57A6109B2E1 +:10BA00000B4C8AB27A34A3F81D200A2902DBA4F871 +:10BA1000072002E00021A4F807100179427901EB28 +:10BA2000022123F81F1F80799870012010BD0000AB +:10BA3000740B002000B502460078FEF749F8134B5E +:10BA4000D8725078FEF744F818739078FEF740F8F3 +:10BA50005873D078FEF73CF898731079FEF738F8F1 +:10BA6000D8735079FEF734F818749079FEF730F8EF +:10BA7000064958744839D1F8532041F8012FB1F8DC +:10BA800056208A808871012000BD0000740B0020C0 +:10BA900070B5094DFF22134605F5807605E010F8D4 +:10BAA000014B54402A5D5A40335D491E89B2F6D29B +:10BAB00043EA022070BD000020B8010830B50D46F1 +:10BAC000044600F004F861190988484030BD70B59B +:10BAD00003464FF6FF7048F2050504460EE013F8E2 +:10BAE000012B80EA02200022491E060404EA4000DD +:10BAF00000D56840521CD2B2082AF6D30029EED1F4 +:10BB000070BD884202D9A0EB010002E003D2A1EB94 +:10BB1000000080B270474FF000007047012070476E +:10BB2000A0F13001092901D8C8B27047A0F1410144 +:10BB3000052901D8373804E0A0F16101052902D8B0 +:10BB40005738C0B270470020704700002DE9F05F01 +:10BB5000DFF800940024A9F1520799F89701FE4DEF +:10BB6000012817D1D7F80B10481CC7F80B0038462E +:10BB7000B1F57A7FB0F82B0008DD40F48060A7F8BB +:10BB80002B00287830B90E20287003E020F4806064 +:10BB9000A7F82B00D7F8071042F210708142B7F8CF +:10BBA0002B0008DD40F48050A7F82B00287830B92E +:10BBB0000820287003E020F48050A7F82B00DFF85D +:10BBC0009CA36FF07E510AEB840BE548DBF80880FC +:10BBD0004144814224D209EB4406B6F84D00401F8F +:10BBE000FCF798FD4146FCF76DFE06D8287808B9A9 +:10BBF0000A202870DB4901200870B6F84D00FCF7D8 +:10BC000092FDDBF80810FCF75DFE09D8287808B92A +:10BC10000A202870B7F82B0020F00100A7F82B00AD +:10BC2000641CE4B2032CCCD3CF48CA4CDFF83CB33D +:10BC300000780026683C4FF4967804287DD1BBF844 +:10BC400007000A2816D8CA48808FB0F5E16F18D3CC +:10BC50002088411C218044F25061884211D9B7F8F4 +:10BC60002B0040F08000A7F82B00287848B9072067 +:10BC7000287006E0B7F82B0020F08000A7F82B0012 +:10BC80002680BC48BC4A4FF480410378BB48022B55 +:10BC9000DAF804301A4416D0824253D2B84802F07F +:10BCA00094FB8BF812606088411C89B26180B0F50A +:10BCB000FA7F2ED9B7F82B0040F00400A7F82B002C +:10BCC000287820B325E0824219D2AD4802F07DFBEE +:10BCD0008BF812606088411C618064280BD906F0E3 +:10BCE00059FDB7F82B0040F00400A7F82B00287886 +:10BCF00008B913202870608840450DD81DE0B7F8BA +:10BD00002B0020F00400A7F82B00668022E013200F +:10BD10002870B1F5487F10D920219A4802F055FBD0 +:10BD20000221974802F051FB0121954802F04DFB9A +:10BD30004FF4FA7001F0F7FA66808E480078022816 +:10BD400008D034E0B7F82B0020F00400A7F82B004F +:10BD5000668030E0B9F85900BBF805208A4900F543 +:10BD60009670824203D3DAF804208A4208DC874ABC +:10BD7000B2F81B20824213D9DAF8040088420FDDA2 +:10BD8000A088411CA180C82811D9287808B913209F +:10BD90002870B7F82B0040F00400A7F82B0006E04D +:10BDA000B7F82B0020F00400A7F82B00A6806E48FF +:10BDB000007804281CD1B9F88530BBF807000C21A5 +:10BDC0003233984204D2B9F85B203232904218D311 +:10BDD000E088421CE28040450AD9287820B1B7F8B3 +:10BDE0002B0040F0100001E02970F8E7A7F82B00C5 +:10BDF000387818280BD0268265480178012916D09A +:10BE00003BE0E680B7F82B0020F01000EEE7208A38 +:10BE1000411C21826428EFD9287808B90D202870A8 +:10BE2000B7F82B0040F40050A7F82B00E4E7C17EE0 +:10BE3000012922D1818BC08B40F25F524143B9F876 +:10BE400079015043B1EBC00F11DD2089411C2181E4 +:10BE5000B0F5FA7F12D92681287808B91520287004 +:10BE6000B7F82B0040F00200A7F82B0006E0B7F867 +:10BE70002B0020F00200A7F82B0026813748454907 +:10BE8000406801444448814210D2A089411CA181EC +:10BE900040450CD9A681287808B917202870B7F832 +:10BEA0002B0040F02000A7F82B0000E0A681DFF86F +:10BEB000D4A04FF40041504602F080FA88B19BF8BC +:10BEC000110070B1E089411CE18140451FD9E68134 +:10BED000287808B918202870B7F82B0040F40040E3 +:10BEE00013E04FF40041504602F068FA18B99BF88D +:10BEF0001100DA46C8B1E089411CE181404506D90C +:10BF0000E681B7F82B0020F40040A7F82B00134877 +:10BF100022494069884259DA608A411C6182404561 +:10BF200055D966822878D8B349E0E089411CE1817F +:10BF30004045ECD9E681287808B9182028700421FA +:10BF40000F4802F044FA01214FF4FA7B8AF81110ED +:10BF5000584626E0902A00207C070020E8160020A2 +:10BF6000FFFF47031D05002059020020EE0B0020B3 +:10BF7000FC0D00205A020020FF0F78BAFF6F62000C +:10BF8000000C01400010014000C05A45740B002015 +:10BF900000170020FFFFB73CFF5FA202000028410E +:10BFA0000BE001F0C0F904211D4802F00EFA8AF8F6 +:10BFB0001160584601F0B7F98EE71D202870B7F8D8 +:10BFC0002B0040F48040A7F82B0000E06682B9F80F +:10BFD000B100FCF7BEFB814612488A46808BFCF715 +:10BFE000B8FB114A114BFCF79DFA4A465346FCF741 +:10BFF00035FC0DD8A08AA682411C40450AD9287874 +:10C0000008B91E20287037F82D0F40F00200388044 +:10C01000BDE8F09F37F82D0F20F00200F7E7000091 +:10C02000000C0140FC0D00209A9999999999B93F0B +:10C0300070B50F4900254889401C80B248810A2804 +:10C0400004D34D8102F014FB03F042F8094C0A4975 +:10C05000E07E81F822006078012808D1A0780128CC +:10C0600005D16570A57002F007FE0120607170BDFA +:10C0700098060020542700204C170020024600207C +:10C080000A4200D00120704703490020097849077F +:10C0900000D5012070470000F91700200349002057 +:10C0A0000978890700D5012070470000F9170020A2 +:10C0B000034600201AB18B4200D0012070478B420A +:10C0C000FBD0704703490020C978002900D0012027 +:10C0D00070470000F9170020034900200978C907BC +:10C0E00000D0012070470000F91700200146002011 +:10C0F000012901D0032900D1012070470021022825 +:10C1000007D0032805D0042803D0062801D00A2828 +:10C1100000D101210846704710B500F0F7F818B1BA +:10C1200000210D4806F042FB0B485838406D58B1CD +:10C1300009484FF49661001F06F038FB002802D032 +:10C1400006490020087010BD03480021BDE81040DA +:10C15000001F06F02BBB0000B0020020E504002009 +:10C1600030B53E4B3E48997E2A2903D902780AB958 +:10C17000562202702C2903D902780AB9582202707B +:10C180002E2903D902780AB9592202702F2903D91E +:10C1900002780AB95A220270302903D902780AB902 +:10C1A0005B22027093F83120540707D004780CB951 +:10C1B0005C24047002F00702032A07D093F83220AF +:10C1C00054070AD005785D2415B102E0072030BD80 +:10C1D000047002F00705032D06D012F0380F0DD0C1 +:10C1E00005785E242DB105E0017801B904700820BE +:10C1F00030BD0470C2F3C202032A0AD093F836207D +:10C20000C2F3C204012C09D0520611D5017859B1EC +:10C210000CE0017801B90470092030BD017809B93A +:10C220005F2101700A2030BD602101700B2030BDFC +:10C2300093F83520C2F3C202022A04D002290AD29E +:10C24000017831B107E0017809B9612101700C2052 +:10C2500030BD62210170002030BD0000FC0D0020C7 +:10C260007C07002001460020090600D40120704709 +:10C27000024600208A4200D1012070470549002073 +:10C28000CA7B897B02EB012189B2502900D80120A9 +:10C2900070470000F917002010B54FF400711148E5 +:10C2A00002F08CF806221049002338B1CB71087ACD +:10C2B000052811D200F10100087211E00B72C87953 +:10C2C000052803D200F10100C87109E008D1CA7144 +:10C2D0004FF00100487203E002D10A72CB714B7239 +:10C2E000487A10BD00100140E00400200348407966 +:10C2F000002801D04FF0FF3070470000E00400201C +:10C300000148007870470000E004002010B54FF4A9 +:10C3100080710A4802F052F8094C4FF40071207302 +:10C32000084802F04BF86073217B012901D10128F4 +:10C3300002D04FF0FF3010BD002010BD00080140BA +:10C34000E0040020001001403E210148FBF735BF0A +:10C350000017002002490020A1F8190070470000D2 +:10C360000017002070B518490020184D08600C39DE +:10C370000446487104EB440000EBC40005EB4006A2 +:10C380000C3614213046FBF718FF14213046FFF716 +:10C390009EFB3075000A641CE4B27075122CE9D360 +:10C3A0000A494FF4C6740C3122460D4601F5C67099 +:10C3B000FBF7EAFE002322462946054801F034FA3D +:10C3C000BDE8704007F0FABBA40600200C1800205E +:10C3D000EE27002010B59AB0202112A8FBF7EDFE41 +:10C3E0005A208DF8000001208DF8010082208DF880 +:10C3F0000200344C12208DF8030020788DF80400E0 +:10C40000B4F80900010A8DF805108DF80600B4F89B +:10C410000B008DF80800010A8DF80710B4F80F0022 +:10C42000010A8DF809108DF80A00B4F80D008DF896 +:10C430000C00010A8DF80B10607C8DF80D00A08AAD +:10C44000010A8DF80E108DF80F00E08A010A8DF8B0 +:10C4500010108DF811001C4890F87C118DF8121006 +:10C4600090F87B118DF8131090F881118DF814104D +:10C4700090F882018DF8150016216846FFF708FB39 +:10C480009DF80320ADF84400694612A8121DFBF781 +:10C490007BFEBDF844009DF8031013AA030A8B54D9 +:10C4A000521C8854B4F8190042F21072904202D221 +:10C4B000401CA4F8190012A8891D04F089F81AB0CC +:10C4C00010BD000000170020902A00202DE9FC5F1D +:10C4D000FF4EFE480024316B0278481C5F2A05D2CB +:10C4E0003063C82912D9062034630EE0622A05D2CF +:10C4F0003063C8290AD90820346306E0632A1DD8AE +:10C500003063C82902D909203463B070F149DFF8DB +:10C51000C883DFF8C89331F81B2FA8F80D2049888D +:10C52000A8F80F10012188F81110ED4898F8003094 +:10C53000B9F87711C288012B03D006E005203463D7 +:10C54000E3E798F81B30012B12D0104602F0EAF90D +:10C550000546B078DE4FDFF88CA33837DFF888B3B4 +:10C56000401F05287DD2DFE800F0CA2986868600B4 +:10C57000B9F8795142F210777D43B8F81C0099F868 +:10C580009731B5FBF0F080B2012B03D1814200D38B +:10C590000146104602F0C6F90546D14890F8D7008A +:10C5A0000F28D6D12846FCF7D4F84FF06632CF4B8F +:10C5B000FBF7B8FFFCF726F985B2CAE7C4484FF489 +:10C5C0007A71243006F0F2F8012873D198F81B0034 +:10C5D0004246012806D09620A8F80B00BC4800214E +:10C5E000243089E099F89711012921D0B9F8770111 +:10C5F000F189884201D93231F18189B2A94200D34F +:10C60000F581F189884200D8F081D08B642819D255 +:10C61000B2F80B004FF49671884202D23230A2F881 +:10C620000B00B2F80B008842D8D9A2F80B10D5E75E +:10C63000F089A84201D23230F08180B2A842E4D31E +:10C64000F581E2E73879012804D13888F1898842F8 +:10C6500000D2F081B2F80B10F089814204D232315D +:10C6600000E06FE0A2F80B10B2F80B108142B5D3D6 +:10C67000A2F80B00B2E796484FF47A71283006F022 +:10C6800095F8012860D199F89711012913D0B9F8CC +:10C690007701F189884201D93231F18189B2A94209 +:10C6A00000D3F581F189884200D8F08138790128DA +:10C6B0000BD00FE045E0F089A84201D23230F08182 +:10C6C00080B2A842F2D3F581F0E73888F189884238 +:10C6D00000D2F081B8F80B10F0894246814202D2B4 +:10C6E0003231A2F80B10B2F80B10814201D3A2F83C +:10C6F0000B0077480021283006F058F824E0642029 +:10C70000F081022188F8001099F89701012820D1C2 +:10C71000734FF888FCF71DF852465B46FBF702FFA3 +:10C7200002460B4600207249FCF798F80CD8F888AE +:10C73000FCF70FF852465B46FBF7F4FEFCF762F895 +:10C74000F08101E00920B07099F89701494601286D +:10C7500016D0B9F87501B081A8F80900B9F87911B7 +:10C7600042F210725143B1FBF0F2F3899A4202D8BF +:10C77000B1FBF0F0F081F089A84200D3F5817CE1B3 +:10C78000574840F2A363808FA0F2F5129A4225D257 +:10C79000534A92F83930022B03D098F81B70012FBE +:10C7A00001D01E300AE0B8F81E30C82BF9D992F833 +:10C7B0000A21002AF5D14F4A9630147080B2A8F8A9 +:10C7C0000900FA3080B2A8F80100B081B1F87D11FB +:10C7D0004246884209D2A2F8011006E0B1F87D0174 +:10C7E000B081B9F87511A8F80910FFF7B9FC10F07D +:10C7F000FF0756D04FF4C871072F2FD0082F2DD028 +:10C80000092F2BD00A2F29D00B2F27D00C2F25D062 +:10C81000042F47D0052F45D0314AD08800EB800344 +:10C82000B1EB430F75D2FBF794FF52465B46FBF723 +:10C8300079FECDE90001F089FBF78BFFDDE90023EC +:10C84000FCF70CF869D82648C088FBF782FF5246EF +:10C850005B46FBF767FEFBF7D5FF5DE0204AD0881B +:10C8600088421AD9FBF775FF52465B46FBF75AFE22 +:10C8700007460091F089FBF76CFF3A46009BFBF7F7 +:10C88000EDFF54D81648C088FBF763FF52465B465D +:10C89000FBF748FEFBF7B6FF02E0F189884246D875 +:10C8A000F08144E00E4AD088884232D9FBF751FF2C +:10C8B000114A124BFBF736FECDE90001F089FBF778 +:10C8C00048FFDDE90023FBF7C9FF1AE0580200200A +:10C8D00018050020740B002000170020902A00206B +:10C8E000FC0D00209A9999999999E93F6666EE3F67 +:10C8F000000059405C020020CDCCCCCCCCCCEC3F2D +:10C9000007E00AD8E048C088FBF723FFDF4AE04B86 +:10C910009FE7F189884200D8F081062F07D1F0897E +:10C92000C82801D9C820F081DA4902200870D64F02 +:10C9300097F8390002281ED0F888C8286CD9D64943 +:10C94000C97A5F294DD2FBF704FF4FF06632D34B13 +:10C95000FBF7E8FD05460091F089FBF7FAFE2A4651 +:10C96000009BFBF77BFF78D8F888FBF7F2FE4FF0CF +:10C970006632CA4B4AE098F80000454601286CD15F +:10C98000E87E012869D1B5F80900A98B884226D92B +:10C99000401AB0F5967FF88806DD962810D2FBF78E +:10C9A000D8FE0022BE4B06E0962809D2FBF7D1FE46 +:10C9B0004FF03332BB4BFBF7B5FDFBF723FFF081A4 +:10C9C000B5F80B10F089814202D21E31A5F80B1088 +:10C9D000B5F80B10814240D9A5F80B003DE0F8886E +:10C9E000E4E7FBF7B6FE52465B46FBF79BFD0546C8 +:10C9F0000091F089FBF7ADFE2A46009BFBF72EFF66 +:10CA00002BD8F888FBF7A5FE52465B46FBF78AFD5C +:10CA1000FBF7F8FEF08120E0B98F3231B181FBF7EE +:10CA200098FE52465B46FBF77DFDCDE90001F0899B +:10CA3000FBF78FFEDDE90023FBF710FF09D8F8882C +:10CA4000FBF787FE52465B46FBF76CFDFBF7DAFE11 +:10CA5000F081F089A84200D3F581F88868B9B078F0 +:10CA6000062805D0072803D0092801D0082804D1BA +:10CA70008D48017809B93721017030793546012890 +:10CA800026D0EC62464698F8291016F8280F01F0D7 +:10CA900045FF4F4699F87B1199F87C0101F03EFF64 +:10CAA00097F87C0116F82829411F8A4207DA97F87F +:10CAB0007B1196F82930A1F1050C634525DB686BE5 +:10CAC000411C696364282DD901206C63687129E0D9 +:10CAD000E86A6C63401CE8621428D3D91421B0FBC7 +:10CAE000F1F201FB12000128CCD1E8894FF4AF71BB +:10CAF000884203D84FF49671884201D9E981C1E791 +:10CB0000C828BFD9C820E881BCE7C91F8B4209DA11 +:10CB1000C01F824206DA686B411C6963642801D930 +:10CB20006C716C6397F8970140F6C4180128687916 +:10CB300002D0012879D095E001281CD1B7F87701FF +:10CB4000FBF707FE594A5B46FBF7ECFC81468A4639 +:10CB5000E889FBF7FEFD4A465346FBF77FFE0AD203 +:10CB6000B7F87701FBF7F5FD504A5B46FBF7DAFCB7 +:10CB7000FBF748FEE881444840F2BB22818FA1F2D6 +:10CB8000097191426ED290F80A0101286AD130767B +:10CB9000E8894FF41671884200D9E981AA89404694 +:10CBA000824200D9A881B6F80920824201D9A6F8AC +:10CBB0000900B6F80B00884201D9A6F80B10BDE8B1 +:10CBC000FC9FB7F87F01E989884200D2E881B7F875 +:10CBD0007D01A98988424DD3B6F8091040468142AB +:10CBE00001D9A6F80900A989814245D8B6F80910EB +:10CBF000A889814201D9A6F80900B6F80B104FF4B4 +:10CC00007A7081423AD8E989814200D9E881B6F840 +:10CC10000B10E889814234D8B6F80B003228CED206 +:10CC20003220A6F80B00CAE7FFE7B7F87701FBF759 +:10CC300090FD1E4A5B46FBF775FC81468A46E889F3 +:10CC4000FBF787FD4A465346FBF708FE0AD2B7F8C2 +:10CC50007701FBF77EFD154A5B46FBF763FCFBF7AC +:10CC6000D1FDE8813476B7F87701E9898842A8D206 +:10CC7000E881A6E7A881AFE7A881B7E7A6F80B008F +:10CC8000C1E7A6F80B00C7E7FC0D0020CDCCCCCC4B +:10CC9000CCCCEC3F82070020EE0B00206666EE3F16 +:10CCA0000000F83F3333F33F7C0700209A999999AD +:10CCB0002DE9F05FDE4CDF4F4FF00508E08C0025DA +:10CCC00098B1788B411C79834FF4FA7188420DD961 +:10CCD000D9483D7002780AB9142202707983F87835 +:10CCE000012803D087F8038000E07D83D348B0F8A3 +:10CCF0002B0010F0600F03D1410701D4400403D58D +:10CD00003D7087F8038010E0F878022801D00428ED +:10CD10000BD1397819B9012801D087F803800CF0BC +:10CD200087FA10B9C64902200870C648C64990F86B +:10CD30000A0101281ED0B1F87D01A4F8010040F2DB +:10CD40001A40A4F80500B1F87901A4F80700F878B2 +:10CD5000BE4E8B46012810D0DFF8F4A24FF0010937 +:10CD6000022827D0042870D005286FD1F88A01281E +:10CD70006DD026E140F6C410DFE73D827D820220BF +:10CD80002070FD713D72BD71397801295ED1F87056 +:10CD90002021B04801F019FB0221304601F015FBBB +:10CDA0000121304601F011FBBDE8F05F4FF4FA704D +:10CDB00000F0B9BAFD82388A782801D2401C388246 +:10CDC00080B208281CD2397A21B1052840D0062823 +:10CDD00013D072E020219F4801F0F7FA022130467B +:10CDE00001F0F5FA0121304601F0F1FA4FF4FA7042 +:10CDF00000F099FA87F808905FE003F0FDFC5CE032 +:10CE00000F282DD2B97969B10321B0FBF1F201FBF2 +:10CE1000120101291CD0B0FBF8F108FB1100012818 +:10CE200019D04AE020218B4801F0D1FA0221304686 +:10CE300001F0CDFA0121304601F0C9FA4FF4FA7041 +:10CE400000F071FA87F8069037E06CE069E0A2E044 +:10CE500003F0C4FF31E003F0CFFC0AF0BDF82CE092 +:10CE60007D63218C40F2DB52A1F2D171914222D23A +:10CE7000B0F5966F01D2401C388280B2B0FBF8F159 +:10CE800008FB1101012904D000F00700012803D09C +:10CE900004E003F0A3FF01E003F0AEFC388A14289D +:10CEA00001D984F80090E17E012927D0B0F57A7F7E +:10CEB00001D987F80380FFF78DFA674840F277536E +:10CEC00030F81B1FA4F80D104088A4F80F005D482F +:10CED0006421808FA0F221329A4212D2A4F8090074 +:10CEE00000F5967080B2A4F80100A4F80B10BBF80E +:10CEF0007D1188420FD2A4F801100CE00420F870D4 +:10CF0000D9E7BBF87501A4F80900A4F80B1040F6A6 +:10CF1000C410A4F80100BAF80010A182BAF8020007 +:10CF2000E082BDE8F09FB88A401CB8824B48007888 +:10CF3000012813D0BAF80010A182BAF80200E082EA +:10CF400084F800900BF024FCFFF7C0FAB88AB0FB1D +:10CF5000F8F108FB1100012808D009E040484068BA +:10CF6000FBF71DFCA082BAF80200E8E7FFF732FAEF +:10CF7000B88A0B21B0FBF1F201FB1200012801D1AC +:10CF800007F0C6FA387D00F00F000128C9D1BDE8CE +:10CF9000F05F03F023BF02202070B879012810D180 +:10CFA00020212C4801F011FA0221304601F00DFA3F +:10CFB0000121304601F009FA4FF4FA7000F0B3F99C +:10CFC000BD71788A642801D2401C788280B2022820 +:10CFD00001D90221217028281FD9B879012810D140 +:10CFE00020211C4801F0F1F90221304601F0EDF951 +:10CFF0000121304601F0E9F94FF4FA7000F093F99D +:10D00000BD71FFF7A1F93D827D820421304601F018 +:10D01000DCF98AF8115087F80390BBF8750124F801 +:10D02000090F32206080BDE8F05FFFF7D3B9000040 +:10D0300000170020180500207C0700203E2A002051 +:10D0400082070020FC0D0020902A0020000C0140E7 +:10D05000EE0B002000100140740B00208007002020 +:10D06000E81600202DE9F84F6946164800F0CEFB7F +:10D07000154DDFF85890DFF858A0DFF858B00024BD +:10D0800039F8140001F07CFAFF2814D03AF81000A7 +:10D09000009900EB050810483BF8147030F81400B4 +:10D0A000461839463046FEF709FD20B93A46314662 +:10D0B0004046FBF769F8641CE4B20C2CE0D3BDE8F1 +:10D0C000F88F0000A82700204C170020DCBA0108C8 +:10D0D0007CBA01080CBB0108F4BA010800290168F8 +:10D0E00002D041F0010102E04FF6FE7211400160F2 +:10D0F0007047000001684FF6FE7211400160002188 +:10D10000016041608160C1603149314A0839904213 +:10D1100003D1486840F00F0006E02D4A14329042D7 +:10D1200004D1486840F0F00048607047284A28322F +:10D13000904203D1486840F47060F5E7244A3C32DD +:10D14000904203D1486840F47040EDE7204A5032E5 +:10D15000904203D1486840F47020E5E71C4A6432ED +:10D16000904203D1486840F47000DDE7184A7832F5 +:10D17000904203D1486840F07060D5E7154A111F0E +:10D18000904203D1086840F00F0006E0114A1432C3 +:10D19000904204D1086840F0F000086070470D4AE2 +:10D1A0002832904203D1086840F47060F5E7094ADC +:10D1B0003C32904203D1086840F47040EDE7054AE4 +:10D1C00050329042EAD1086840F47020E5E7000050 +:10D1D000080002400804024030B5026847F6F073C8 +:10D1E0009A430C6A8B682343D1E904452C432343BB +:10D1F0008C692343CC6923434C6A23438C6A2343C1 +:10D2000013430360CA6842600A6882604968C1606B +:10D2100030BD000070B50C46050033D08CB3688873 +:10D22000A52121705A2161701930A070000AE070A8 +:10D2300020202071601D10221349FAF7A5FF68799C +:10D240006075B5F805001726000AA0756A88022ADD +:10D2500007D304F11700E91DFAF796FFA8781730F5 +:10D26000C6B231462046FDF7F5F9A055761CF1B25D +:10D27000000A6054491CC9B22046FDF7E3FB0120B7 +:10D2800070BDFFE70020FBE7902A0020F8B5694653 +:10D290001F4800F0BBFA16261E4F002505EB45007F +:10D2A00000EBC5040098B11E00EB4400FEF706FC3D +:10D2B00088B90098324600EB440107EB44000C307B +:10D2C000FAF762FF0098324600EB4401124800EB87 +:10D2D0004400FAF759FF07EB4400007B092805D109 +:10D2E0000E480122AA400168114301606D1CEDB295 +:10D2F000122DD3D309494FF0FF30091DA1F10B02C4 +:10D3000008600749A1F5467003F05AFEF8BD000019 +:10D31000EE2700200C180020A4190020A4060020ED +:10D32000301B0020704710B5044606E0142007F0BB +:10D33000E9F901F0A3FE641EA4B2002CF6D110BDE1 +:10D3400070B5044601F030F90546FF2820D020468C +:10D3500001F016F9FF281BD00E49104A0C5C0E494B +:10D3600032F81000461821463046FEF7B0FB305523 +:10D37000621C000AB0540A480A49A21C30F8150081 +:10D38000401805D03146BDE87040002300F04CBA8B +:10D3900070BD0000A2BA01084C1700207CBA010839 +:10D3A000F4BA0108A82700202DE9F04399468046E9 +:10D3B000DDE9074300250120012A01D0FF2A49D1D8 +:10D3C0001E784FF0590C771C1F7004F806C01E78A9 +:10D3D000771C1F7004F80680224E21F07F4756F814 +:10D3E00025C0674538D11E780F0C06F1010C83F873 +:10D3F00000C0A7551E780F0A06F1010C83F800C083 +:10D40000A7551E780020771C1F70A15505EB45011C +:10D4100001EBC505197819F815704E1C1E7067547C +:10D42000012A01D0FF2A15D1197801264A1C1A7049 +:10D43000665409EB45011A784E7C551C1D70A654A4 +:10D440001A788E7C551C1D70A654CD7C19784A1C08 +:10D450001A706554BDE8F0836D1CEDB2122DBED379 +:10D46000F8E7000034BA01082DE9F8411C4600260F +:10D4700088468DF80060217815464A1C5923227091 +:10D480006B5421781A4F4A1C227068546A463946F8 +:10D49000404603F095FD24E037F816002278010A93 +:10D4A000144802F1010C50F8210084F800C0030C6C +:10D4B000AB542278030A02F1010C84F800C0AB548B +:10D4C0002278531C2370A85401EB410000EBC101EA +:10D4D00008EB410042782078411C2170761C2A54C8 +:10D4E000F6B29DF800008642D6D30020BDE8F88150 +:10D4F000301B002034BA01082DE9F0434FF05908E1 +:10D50000DDE90764002527784FF0010907F1010CD8 +:10D5100084F800C006F80780277807F1010C84F82A +:10D5200000C0F055234821F07F4750F825C06745DB +:10D5300039D120780F0C00F1010C84F800C0375469 +:10D5400020780F0A00F1010C84F800C037542078CD +:10D55000471C2770315405EB450000EBC5012078CE +:10D5600013F81170451C257003EB410137544878BE +:10D57000904201D0FF2A1AD1487C4FF00009B0B187 +:10D5800020780123421C2270335420780623421C49 +:10D59000227033542078891C304403F0C9FC217870 +:10D5A0000844207003E06D1CEDB2122DBDD3484637 +:10D5B000BDE8F08334BA010810B5FEF765FD002818 +:10D5C00074D1FEF76BFD002870D1FEF785FD614B2D +:10D5D00000286CD0604C03F10C022078C106116861 +:10D5E00002D541F0020101E021F002011160810643 +:10D5F000116802D541F0040101E021F0040111603D +:10D600004106116802D541F0080101E021F008014E +:10D610001160000602D541F0100001E021F0100079 +:10D6200010606078C107116802D041F0200101E06C +:10D6300021F0200111608107116802D541F04001FD +:10D6400001E021F0400111604107116802D541F06D +:10D65000800101E021F0800111600107116802D50D +:10D6600041F4807101E021F480711160C1061168FC +:10D6700002D541F4007101E021F4007111608106CE +:10D68000116802D541F4806101E021F480611160EC +:10D690004106116802D541F4006101E021F4006106 +:10D6A0001160000604D541F4805003E03EE04EE0F6 +:10D6B00021F480501060A078C107116802D041F4B5 +:10D6C000005101E021F4005111608107116802D579 +:10D6D00041F4804101E021F480411160410711686B +:10D6E00002D541F4004101E021F40041116000073E +:10D6F00002D541F4803001E021F480301060FEF763 +:10D70000E1FCA0B1E078082803D3106840F00100E4 +:10D710001060FEF7D7FC002808D15878002150B1DE +:10D72000401E10F0FF00587000D1198110BD106824 +:10D7300020F00100ECE71889401C80B21881B0F598 +:10D74000967FF3D9106840F400301060EDE7322086 +:10D75000587010BD98060020F917002070B50D46CE +:10D7600000EB4001104A01EBC00102EB41040D4EF9 +:10D770000C34122815D22078A84211D0092D0DD1D1 +:10D78000204603F015FC607818B93078401C3070E2 +:10D790006070607CFF2801D0401C60740020E07441 +:10D7A000257070BD9D0600200C180020154810B58E +:10D7B000154A0178937801F00100984221D09070C9 +:10D7C000C8071ED000210F4C0B46133401EB41005B +:10D7D00000EBC10004EB400010F80C2F082A0CD11C +:10D7E000C27C521CD2B2C274282A06D3C3740370FE +:10D7F000827CFF2A01D0521C8274491CC9B21229B2 +:10D80000E4D310BDF917002098060020054A824293 +:10D8100002D0463A824202D101200A6070470020BD +:10D8200070470000EE27002010B50DF08BFC0120A2 +:10D8300010BD2DE9FE4F4FF017088DF80880012527 +:10D840008DF8095003268DF80A6004468DF80B0008 +:10D8500002A801F073FE0921022000F021FD00273B +:10D860008DF804704FF00C094FF4007A8DF8059094 +:10D87000CDF800A08DF80640684600F0BBF8504691 +:10D8800000F0A8F88DF808808DF809508DF80A602E +:10D890008DF80B4002A801F051FE0821002000F095 +:10D8A000FFFC8DF804704FF480788DF80590CDF86A +:10D8B00000808DF80640684600F09CF8404600F075 +:10D8C00089F828208DF808008DF809508DF80A6035 +:10D8D0008DF80B4002A801F031FE0D21022000F06E +:10D8E000DFFC8DF8047008208DF805006D030095AD +:10D8F0008DF80640684600F07DF8284600F06AF88A +:10D90000202000F067F8402000F064F8802000F04C +:10D9100061F8404600F05EF8504600F05BF8E81011 +:10D9200000F058F8A81000F055F8681000F052F810 +:10D93000284600F04FF8680000F04CF8A80000F00E +:10D9400049F8BDE8FE8F000010B54FF400542046A2 +:10D9500000F046F80F4908B1032000E001200870EC +:10D960004FF4806000F036F84FF4006000F032F8B9 +:10D970004FF4805000F02EF8204600F02BF84FF4C2 +:10D98000804000F027F8BDE810404FF4004000F060 +:10D9900021B80000E0040020082000F01BB810208F +:10D9A00000F018B810B5202000F014F8402000F066 +:10D9B00011F8802000F00EF84FF4807000F00AF8A3 +:10D9C0004FF4007000F006F801490120087010BD06 +:10D9D000E004002001490860704700001404014081 +:10D9E000034A0146002012680A4200D00120704715 +:10D9F0001404014030B51A4A8379016853B313689F +:10DA00008B431360111D0B680468A3430B600179FD +:10DA100011440B68046823430B60114B08331968E9 +:10DA20000468A14319601C1D21680568A943216091 +:10DA30004179102905D011440A68006802430A6040 +:10DA400030BD1968026811431960216800680143FC +:10DA5000216030BD0079104402688A43026030BD05 +:10DA60000004014001F00AFB0120FFF7E2FE33A0B1 +:10DA700006F090FE0A20FFF756FC01F0FFFA02F0D4 +:10DA8000BFFD012002F04CFF6FF0FF0002F03CFEF2 +:10DA900001F0F4FAFBF728FA0121084600F05CFBDC +:10DAA00003F004FF4FF40041080301F093FD03F07D +:10DAB000CDFE01F03FFD01F0EDFA01F0DFFA4FF489 +:10DAC000E1300DF085FA244C2078022802D001289C +:10DAD00002D01AE021A000E028A006F05BFE20782A +:10DAE000022802D0012802D00FE02BA000E023A0E2 +:10DAF00006F050FE2078022802D0012802D004E06F +:10DB00002DA000E01DA006F045FE2078032802D1DC +:10DB100030A006F03FFE216920780870C0434870AD +:10DB200001F0ACFABFF34F8F31480168314A01F47C +:10DB3000E06111430160BFF34F8FFEE7456E7465EE +:10DB400072536C656570303030303050726F636581 +:10DB500073730D0A00000000E00400205274635F3C +:10DB600077616B652D30302D2D5274635F77616B5B +:10DB7000652121212121210D0A000000494F207734 +:10DB8000616B652D2D2D494F2077616B652121211A +:10DB90002121210D0A0000005274635F77616B65DB +:10DBA0002D31312D2D5274635F77616B65212121F9 +:10DBB0002121210D0A0000005274635F77616B65BB +:10DBC0002D2D2D5274635F77616B652121212121F9 +:10DBD000210D0A0043414E2077616B652D2D2D43A9 +:10DBE000414E2077616B652121212121210D0A0001 +:10DBF0000CED00E00400FA052DE9F047DFF8E890AD +:10DC00000025484640F25241C0E9001589F8085005 +:10DC100089F80950082109F5207089F80A1040F8A0 +:10DC20003A5F09F5E874456014F8EA0FDFF8BC8044 +:10DC300020F0FF062670D8F80C00FAF7B0FDC7B246 +:10DC40002771D8F81000FAF7AAFDC1B2284861710F +:10DC5000EA3C4078042833D0B4F8EB006FF30C00B2 +:10DC6000A4F8EB0094F8EC0000F03F00A4F8EC00FE +:10DC7000B4F8EB0034F8EC3FC0022A4640EA9310B7 +:10DC800066F30702030C63F30F22030A63F31742E0 +:10DC900060F31F62174867F3070561F30F25C08C17 +:10DCA000A080010A61F3174560F31F65484640F8FC +:10DCB0000B2F45600C4809F02DF90120BDE8F087D5 +:10DCC0000948B838B0F81B20B4F8EB0062F30C0038 +:10DCD000A4F8EB0004483E38B0F80720B4F8EC0094 +:10DCE00062F38F10C2E700002C0C0020E816002021 +:10DCF00058020020001700202DE9F041414C00207F +:10DD000040F25141E4E802103F4D04F8010B0821B4 +:10DD100004F8010B04F8011B45F8320F394968601B +:10DD2000B839394811F8233FB0389F0910F8E22F6D +:10DD300063F3010202704A78467862F3010667F3E2 +:10DD400083061F0967F305169B0863F38716467061 +:10DD50008B788678970963F3010667F383061709C2 +:10DD600067F30516920862F3871686709A08C378DF +:10DD700062F38713CA7862F30513920862F3830390 +:10DD80000A7A62F30103C3708A7A0679930863F30F +:10DD900001064B7A62F383069F0867F3051663F367 +:10DDA00087160671CB7A4679120963F3051662F37A +:10DDB00087160A7962F38306930863F3010662F318 +:10DDC000830663F3010646714A79837962F3871308 +:10DDD000920862F305138A7962F38303920862F36F +:10DDE00001038371C979C27961F38712C27128680E +:10DDF000696820606160034809F08CF80120BDE883 +:10DE0000F08100002C0C0020AC0E00202DE9F04128 +:10DE1000294A002140F25340C2E9000111725172B7 +:10DE20000820907202F52070012440F8421F4160E2 +:10DE300002F5E870A0F5227590F8D830B4EB131F06 +:10DE400003D00524B4EB131F03D16982A982E982B0 +:10DE500029836B8A20F8F23FAC8A4480EE8AC6F5AB +:10DE60007A67868867F30B0686802D8BC5F57A67FF +:10DE7000C58867F30B05C5801F0A084667F30700CE +:10DE800063F30F20230A63F3174064F31F60330129 +:10DE90001C0A64F3070163F30F212B011C0A64F3CE +:10DEA000174142F80B0F63F31F615160024809F0FC +:10DEB00031F80120BDE8F0812C0C002070B5384A03 +:10DEC000002140F25440C2E9000111725172082051 +:10DED000907202F52070012540F84A1F416002F55A +:10DEE000E870A0F20E2490F8D830B5EB131F03D0E1 +:10DEF0000525B5EB131F03D1A4F80510A4F80710EE +:10DF000034F8053FA0F8FA306488B0F8FC50C4F546 +:10DF10007A6464F30B05A0F8FC5090F8FD40204DA6 +:10DF200024F0F004B83D80F8FD40AC7EAA2C90F8B7 +:10DF3000FE4024F0030400D1641C80F8FE4004F08D +:10DF4000C30400F8FE4FB5F81F5030F802491E0A0E +:10DF500065F38F140D4666F30705448063F30F25C0 +:10DF600003881B011E0A66F3174563F31F65837858 +:10DF700001719B0343EA94131E0A0C4666F30704DF +:10DF800063F30F245623437161F3174442F80B5F88 +:10DF900063F31F645460024808F0BCFF012070BDA9 +:10DFA0002C0C00200149C86070470000002002408E +:10DFB00070B505464FF43026304600F081F804284D +:10DFC00011D1094C206940F002002061656120698F +:10DFD00040F040002061304600F072F8216941F6BF +:10DFE000FD721140216170BD0020024008490420EB +:10DFF000CA68D20701D001207047CA68520701D50C +:10E0000002207047C968C906FBD50320704700008D +:10E01000002002400248016941F08001016170471F +:10E0200000200240F0B506464FF400570D46384632 +:10E0300000F046F804280CD1064C206940F001009D +:10E0400020613580384600F03BF82169BA1E114046 +:10E050002161F0BD002002402DE9F8410646002074 +:10E060004FF4005700900D46384600F029F8042878 +:10E0700016D10C4C206940F0010020613580B84673 +:10E08000384600F01DF8BF1E042806D1B61C280C27 +:10E0900000963080404600F013F821693940216134 +:10E0A000BDE8F8810020024003480249416003496D +:10E0B000416070472301674500200240AB89EFCDE6 +:10E0C00000B50346FFF792FF02E0FFF78FFF5B1EEC +:10E0D000012803D0002B00D1052000BD002BF4D176 +:10E0E000FAE700002DE9F04781461A48184C002550 +:10E0F000C088401E86B204EBC60041684846FAF765 +:10E10000E1FB04D348466168FAF7E6FB1AD240F611 +:10E11000FF70BDE8F087A819440808EBC40748461B +:10E120007968FAF7D9FB02D2641EA6B20BE0484622 +:10E130007968FAF7C7FB02D2641CA5B203E038F98C +:10E140003400E6E7A046B542E5D938F93500E0E706 +:10E15000F0B20108F404002030B51E4B1A6822F01A +:10E16000030202431A601C4B186840F00400186058 +:10E170004FF0E0200469194A1460D0F8004154605F +:10E18000D0F804419460D0F80841D4600469144D7B +:10E190002C400461134CC0F88041134CC0F88441FA +:10E1A0004417C0F88841012912D040BF20BF20BFCA +:10E1B000116801615168C0F800119168C0F804113C +:10E1C000D168C0F80811186820F00400186030BD4C +:10E1D00030BFEDE70070004010ED00E01C0B0020A8 +:10E1E000040001003DF87FFFFFF8FFBF254910B58F +:10E1F000884206D10121042002F016F900210420F2 +:10E200003BE02149884206D10121082002F00CF9A7 +:10E210000021082031E01D49884206D1012110204B +:10E2200002F002F90021102027E01949884206D1A6 +:10E230000121202002F0F8F8002120201DE01549DE +:10E24000884206D10121402002F0EEF80021402052 +:10E2500013E01149884206D10121802002F0E4F840 +:10E260000021802009E00D4988420AD1841501214E +:10E27000204602F0D9F800212046BDE8104002F007 +:10E28000D3B810BD00080140000C0140001001404F +:10E290000014014000180140001C01400020014012 +:10E2A00010B58A0721F003040649120F21440F23F9 +:10E2B0008C6893409C438C608B68904003438B60D8 +:10E2C00010BD000000000140F0B5CC78002204F041 +:10E2D0000F03E40601D58C7823430C784FF00F0C24 +:10E2E00014F0FF0F4FF0010E1BD005680E880EFAD8 +:10E2F00002F42640A64210D196000CFA06F725EA51 +:10E30000070703FA06F5CE783D43282E02D0482EA3 +:10E3100002D002E0446100E00461521C082AE5D307 +:10E3200005600A88FF2A1CD94468002202F1080609 +:10E330000EFA06F50E882E40AE420ED196000CFA6B +:10E3400006F7BC4303FA06F7CE783C43282E00D1EB +:10E350004561CE78482E00D10561521C082AE5D3CC +:10E360004460F0BDF0B5144C002801DAE36900E028 +:10E370006368450D2E0185B2C0F30157B540C0F367 +:10E380000342032F05D0C6020AD503269640B343A5 +:10E3900007E023F07062636823F07063636002E05B +:10E3A000AB4343F0706201B12A43002801DAE26115 +:10E3B000F0BD6260F0BD0000000001400246002098 +:10E3C00092680A4200D001207047416170470161A4 +:10E3D0007047F8B5010A8DF800108DF801004FF66E +:10E3E000FE7000226F4648F2084648F22504451C9C +:10E3F000B95C80EA01200021030408D5030602D598 +:10E4000086EA400001E084EA400080B201E005EACB +:10E410004000491CC9B20829EED3521CD2B2022ACC +:10E42000E6D3F8BD10B5044605F0AEFB6843207096 +:10E43000000C6070002010BDFEB500260D468DF862 +:10E4400008608F1E53782C490446092F51D2DFE80B +:10E4500007F0052329503C50505005002A4602A9D8 +:10E4600000F0B6F880BB8DF80860592020709DF848 +:10E4700008000921401CC0B28DF8080025549DF801 +:10E480000800401CC0B28DF8080021549DF8080017 +:10E49000401C8DF808002CE0024602AB2846FEF72F +:10E4A000E3FF26E063F31740937863F30F20D378FC +:10E4B000127963F3070002ABCDE900430B46014636 +:10E4C0002846FFF719F811E013E063F3174093783B +:10E4D00063F30F20D378127963F3070002ABCDE921 +:10E4E00000430B4601462846FEF75EFF08B18DF853 +:10E4F00008609DF80800FEBD1818002070B503469E +:10E5000015480324154E90F82A1090F82900144A53 +:10E5100001EB0020622180B21970010A59709870D5 +:10E52000002132F81150854203D0491CC9B2132989 +:10E53000F7D313290ED0022C0AD00A48455C0A48AA +:10E540002A4630F8110081191819F9F71DFE2C44DC +:10E55000204670BD0224FBE7542700204C17002002 +:10E56000B6BA0108A2BA01087CBA010803480088BB +:10E570000249091F098841EA00407047BC6C00400D +:10E5800010B50146FF23074A002032F810408C42A4 +:10E5900001D1034603E0401CC0B21328F5D318464E +:10E5A00010BD0000B6BA010810B50146FF23074AA6 +:10E5B000002032F810408C4201D1034603E0401C99 +:10E5C000C0B20C28F5D3184610BD0000DCBA010813 +:10E5D0002DE9F043DFF88C8000265924A8F80A6062 +:10E5E000047042700924894684703146032401EB8B +:10E5F000410505EBC10508EB45073D7B1D4203D1F5 +:10E600009D4201D00A2A24D1174D2D68CD40ED0737 +:10E610001FD0B8F80A5001266D1CA8F80A50134DF7 +:10E6200055F821C04FEA1C4C00F804C0641C35F8B2 +:10E6300021C0E4B24FEA1C2C00F804C0641CE4B210 +:10E6400015F821500555641CE4B23D7B0555641C4A +:10E65000E4B2491CC9B21229C9D389F80040304636 +:10E66000BDE8F0830C180020A806002034BA010889 +:10E670002DE9F041314E307818B1401E3070BDE8C0 +:10E68000F081FEF799FF2E4890F825000028F6D17A +:10E69000FFF78CF829482B4F0C300024056825FA29 +:10E6A00004F0C00701D0092108E004EB440000EBAE +:10E6B000C40007EB4000007B20F001012046FFF77B +:10E6C0004DF8641CE4B2122CE9D3F078162500EB67 +:10E6D000400101EBC00007EB40041B4F14F80C1F76 +:10E6E00017F81020914205D107EB4000E17CC07C77 +:10E6F00081421AD014212046FDF7E9F92075000A5D +:10E700006075F078227800EB400101EBC001002336 +:10E7100007F8112007EB4101E27CCA740B492A4635 +:10E7200005FB00102146FFF77FF8F078401CC0B2CF +:10E73000F0701228A3D30020F070A0E79806002004 +:10E74000542700200C180020A4190020EE270020D8 +:10E7500000210D4B0CE0824206D101EB410000EBA1 +:10E76000C10003EB00107047491CC9B2022908D24E +:10E7700001EB410202EBC10203EB02121278FF2A05 +:10E78000E9D1002070470000C01100202DE9F047BA +:10E790000026DFF80C81DFF80C91DFF80CA1434D67 +:10E7A0004FF400474FF6FF74012804D0022817D019 +:10E7B000032854D070E0EB2182200AF099F9A0F5EB +:10E7C00000416881B94202D2201A688102E0A04269 +:10E7D00000D36E816889F9F7BCFF42464B4652E090 +:10E7E000E321B2200AF084F96881B84204D3012100 +:10E7F000E980201A688100E0EE8080B2F9F7A9FF75 +:10E8000042464B46F9F78EFE00225346F9F7FCFECE +:10E81000FAF73CF8FAF70FF84FF03332244BF9F7D8 +:10E8200081FE244A244BF9F7EFFEFAF72FF8A8618E +:10E83000E888012830D11D484FF4FA61143003F004 +:10E84000B5FF012807D11DA005F0A4FF174800213E +:10E85000143003F0ABFFA86980F000401BE0E32117 +:10E86000B4200AF045F9A0F500416881B94202D20E +:10E87000201A688102E0A04200D36E816889F9F70E +:10E8800068FF4246164BF9F74DFE00225346F9F752 +:10E89000BBFEF9F7FBFFA861A869BDE8F08700009F +:10E8A000FCA9F1D24D622040E0FFEF407C06002041 +:10E8B000F308CA40F6285C8FC2F513404E656761C5 +:10E8C0007469766520766F6C746167652073616D1D +:10E8D000706C65206661756C74210D0A0000000083 +:10E8E0004D6210400A4800680A49094A121F086030 +:10E8F00012684A60064A083A12688A60401C06D1CB +:10E900000548026D0A60426D4A60406E886070473B +:10E91000F0F7FF1F401700200000F81F884200D2C8 +:10E9200008467047884200D90846704770B5384E8F +:10E930007088401C80B270800A2861D3354C002555 +:10E940007580E08F4FF4FA71884221D2401C80B26A +:10E95000E08788421CD12572E07E032801D002287E +:10E9600016D1A5760120E07684F82050A571E587C0 +:10E9700084F82250274884F8235084F825503438EE +:10E98000E5730179012901D1C582057100F074FB9D +:10E9900094F8221020480029017802D021F00301C8 +:10E9A00001E041F00301017094F82310002901787F +:10E9B00002D021F00C0101E041F00C01017031881E +:10E9C000491C89B2318064291AD3358094F8271004 +:10E9D00079B1491E11F0FF0184F8271009D1E178BF +:10E9E000012906D1E57094F8261011B1491E84F86A +:10E9F0002610217A0029017803D021F0100101703E +:10EA000070BD41F010010170BDE8704000F034BBF2 +:10EA100010070020542700209E06002000F00F0061 +:10EA2000092801D93730704730307047000909286C +:10EA300001D9373070473030704700002DE9F04180 +:10EA4000264D00242879C0B1012814D12C71244905 +:10EA5000286AF9F744FC6FF081410844214A2249B1 +:10EA600090422CD22889421C2A81142802D92C8158 +:10EA7000062048706C81BDE8F08118486F7986697E +:10EA8000142F0AD219480089F9F74DFE3146F9F7DB +:10EA9000CEFB7F1CA8616F71EDE715493046F9F791 +:10EAA00050FC6FF00B01F9F78AFC1249F9F717FCDB +:10EAB000C5E90740AC616C7101202871DBE768890A +:10EAC000421C6A81142806D96C81D1F80700642899 +:10EAD00001DD0C2048702C81CDE70000F4040020FB +:10EAE00000003041FFFF8F003E2A0020DC1600208E +:10EAF0000000A0413333534070477047074A30B499 +:10EB00005170064B0022083303E0845C9C54521C75 +:10EB1000D2B28A42F9D330BC03F0B4B85007002017 +:10EB2000064B10B5A3F108020021527803E05C5CAB +:10EB30004454491CC9B29142F9D310BD5807002072 +:10EB400070B50C46054603F051F9024621462846A9 +:10EB5000BDE8704004F07ABD074A30B45170064BEE +:10EB60000022083303E0845C9C54521CD2B28A42D7 +:10EB7000F9D330BC03F0DCB85007002003F08CB9A7 +:10EB800010B504F0DFFD02490020087010BD000040 +:10EB900050070020014840787047000050070020CF +:10EBA0007FB50D496B464A6800928A788DF804203B +:10EBB000002104E0445C5D18491C6C71C9B29142AB +:10EBC000F8D3064901208DF80D0048709DE80F002C +:10EBD00003F076FE7FBD0000500700205427002080 +:10EBE000014988707047000050070020024940F238 +:10EBF00095724A607047000050070020704700007F +:10EC000070B50C46064603F0F1F80A4D2978002944 +:10EC10000ED17F2101704670847003240020FFF71D +:10EC2000E5FF03F06DFB204603F006F90120287094 +:10EC300070BD00005007002070B50D46044603F07B +:10EC4000D5F80C4E3178002913D1002C11D00022B8 +:10EC500003E0A95C8154521C92B2A242F9D3002075 +:10EC6000FFF7C4FF03F04CFB204603F0E5F801205A +:10EC7000307070BD5007002002F0CABFFEE72DE9DA +:10EC8000F04104270126044600F17008002594F89D +:10EC90009110002006296AD2DFE801F0031A6942C8 +:10ECA0004E5B94F85400032870D340460CF0DFF814 +:10ECB00000286BD104F1940140460CF0F4F828B11F +:10ECC00084F8916084F8905084F8AC50012050E0B2 +:10ECD000D4F808C094F89930207804F19A02D4F856 +:10ECE0009410E04784F8980094F89010491C84F838 +:10ECF0009010FF280CD0022084F8910084F8AC50CA +:10ED000094F854008128C2D1032084F85400BEE74F +:10ED1000C8B294F84410884238D384F891702EE039 +:10ED200094F8900094F84410884202D384F89170CB +:10ED3000CCE784F89160C9E784F89150D4F8A82012 +:10ED400012B9226D002AC1D00121D4F8A400904745 +:10ED5000BCE784F89150D4F8A81011B9216D0029AE +:10ED6000B4D00220D4F8A42007F0BAFFAEE7002800 +:10ED70000CD094F89110042989D1002806D022786B +:10ED8000BDE8F0410421012007F0AABFBDE8F081F1 +:10ED900030B500201D4B024604460125C3F89851AA +:10EDA0000521491E0904090CFBD14006D3F81C11AA +:10EDB000000E09B140F00100C3F898410521491E39 +:10EDC0000904090CFBD1521CD2B2082AE6D3C3F8BD +:10EDD00098410521491E0904090CFBD1C3F89C4147 +:10EDE0000521491E0904090CFBD1C3F898510521DE +:10EDF000491E0904090CFBD1C3F898410521491E9D +:10EE00000904090CFBD1C3F89C5130BD008021429C +:10EE10000F490122C1F89C210520401E0004000C6E +:10EE2000FBD1C1F898210520401E0004000CFBD145 +:10EE30000022C1F89C210520401E0004000CFBD1DB +:10EE4000C1F898210520401E0004000CFBD170473A +:10EE5000008021420C490020C1F89C010520401E81 +:10EE60000004000CFBD10122C1F898210520401EAE +:10EE70000004000CFBD1C1F89C210520401E0004B9 +:10EE8000000CFBD1704700000080214230B5164BCA +:10EE90000025C3F898512A460124010602D5C3F87B +:10EEA0009C4101E0C3F89C51C3F898410521491EDB +:10EEB0000904090CFBD1C3F898510521491E090426 +:10EEC000090CFBD14006521C000ED2B2082AE4D332 +:10EED000C3F89C41C3F898410520401E0004000C73 +:10EEE000FBD1C3F8985130BD008021422DE9F0419B +:10EEF000084E4FF40065356009F0F3FD371F6C10C4 +:10EF00003C6009F0EEFD346009F0EBFD3D60BDE8CA +:10EF1000F0810000140C014070B5084D4FF4006002 +:10EF2000286009F0DEFD2C152C6009F0DAFD281DA3 +:10EF30000460BDE8704009F0D4BD0000100C014031 +:10EF40002DE9F047144F0024DFF84C808246254617 +:10EF5000A8F108083E1507F104096006040E3E609A +:10EF600009F0BFFDD8F80000000501D5641CE4B22B +:10EF7000C9F8006009F0B5FD6D1CEDB2082DECD3A9 +:10EF8000BAF1000F04D0FFF7B1FF2046BDE8F087CB +:10EF9000FFF7C2FFF9E70000100C01402DE9F04730 +:10EFA000DFF84890054600244FF480674FF400686E +:10EFB000A9F104062806404601D5306001E0C9F8F1 +:10EFC000000009F08EFD376009F08BFDC9F8007074 +:10EFD000072C01D1C6F800806806050E09F081FDF6 +:10EFE000641CE4B2082CE5D3BDE8F087140C0140A2 +:10EFF00070B509484FF4006606600515056009F014 +:10F0000070FD054C241D266009F06BFD2560BDE8F0 +:10F01000704009F066BD0000100C014070B5074853 +:10F020004FF400640460054D00152D1F286009F0A1 +:10F0300058FD2C60BDE8704009F053BD140C014030 +:10F0400070B50C4C4FF40060206009F04AFD2515A6 +:10F05000256009F046FD074808380068000501D51D +:10F06000012400E000240348001D056009F039FD7B +:10F07000204670BD100C01407047000003497F20FE +:10F08000086003490020087070470000002C004011 +:10F09000540200200C48C16941F40061C1610B4970 +:10F0A00040F2FF30086009487F21001F01600168BD +:10F0B00041F0800101604FF0E021002081F8000460 +:10F0C0000120C1F80001704700100240042C0040EC +:10F0D0000A480B4A0078137900F0010199420BD0DD +:10F0E0001171C00708D00749002081F82700C870B7 +:10F0F00081F8260081F8200070470000F9170020F1 +:10F1000098060020542700202DE9F0410024144DDA +:10F11000FF2604EB440000EBC40005EB001007469B +:10F12000B021F9F74AF8641CE4B23E70022CF0D327 +:10F130000C4C206818B90C4807F068FE206007F0F6 +:10F14000C2FE18B90A21206807F0B6FE074901205F +:10F1500007F0FAFDBDE8F0410549022007F0F4BDD3 +:10F16000C0110020C8040020E9B1010851B6000810 +:10F1700045B6000810B548210F48F9F71EF80E48AB +:10F1800028214830F9F719F80C4801F075FB010007 +:10F1900004D0094814224830F8F7F6FF0748203019 +:10F1A00001F06AFB010006D003481422BDE81040BC +:10F1B0005C30F8F7E9BF10BD5011002088B201089B +:10F1C0002DE9F04116460D46FFF7C2FA040007D0BC +:10F1D00035B12EB1287818B194F85400012802D026 +:10F1E0000020BDE8F08195F82000C00702D0A86A91 +:10F1F0000028F6D095F8250084F8450010B9322093 +:10F2000084F84500C0B200EB4000C00009F09AFE4F +:10F21000C4F88C000028E4D0014694F84530182248 +:10F2200004F170000BF033FE95F82000C0070FD1F9 +:10F2300094F84500000109F085FEC4F8880078B311 +:10F24000014694F84530102204F158000BF01FFEDF +:10F25000286A04F12007206420213846F8F7ADFF22 +:10F260001F2229463846F8F78FFFE86AF862A86A35 +:10F27000B86295F8240087F82400286B38630C489E +:10F2800030610C48F0600C48B0600C4870600C486D +:10F2900030600C487061022084F854000120A0E71F +:10F2A000FFE754F88C0F09F0D9FA0020206097E7A7 +:10F2B0001392010883900108F59001080591010857 +:10F2C00079910108EF8F01080068B0F5607F15D0D3 +:10F2D000A0F58061523911D0A0F5806153390DD06D +:10F2E000A0F58061543909D0A0F58061513905D06D +:10F2F000A0F5C061123901D000207047012070478D +:10F30000014800787047000018050020A0F1300186 +:10F31000092905D91139052902D96138052801D8EB +:10F32000012070470020704730B50446002014F8D3 +:10F33000015B8D4203D1012A08D0521ED2B2002BAC +:10F3400004D0401C5B1E80B29BB2F0E730BD0000D1 +:10F35000144810B5C07E144C012816D04FF47A70B2 +:10F360000146A0611048143003F020FA012817D19B +:10F37000E0784FF4007110F0010F00F10100E0702F +:10F380000A4804D0FFF721F803E06420E8E7FFF71C +:10F390001EF805480021BDE81040143003F006BAFD +:10F3A00010BD0000001700200000002000080140F0 +:10F3B0002DE9F84F01211C2001F02AF84FF40076C6 +:10F3C000ADF800601024DFF858918DF80340032554 +:10F3D0008DF8025069464846FEF776FF31464846AA +:10F3E000FEF7F5FF0127ADF800708DF803408DF8AA +:10F3F000025069464846FEF767FF01214846FEF77E +:10F40000E6FF40F20240ADF800008DF803408DF8B1 +:10F41000025069464846FEF757FF02214846FEF76C +:10F42000D6FFA1014846FEF7D0FFA020ADF80000AE +:10F43000DFF8F0A08DF803408DF802506946504681 +:10F44000FEF742FF20215046FEF7BFFF80215046C5 +:10F45000FEF7BDFF44F22720ADF80000DFF8C880BA +:10F460008DF803408DF8025069464046FEF72CFFA8 +:10F4700031464046FEF7ABFF01214046FEF7A5FFAF +:10F4800002214046FEF7A1FF04214046FEF79DFF02 +:10F49000A1024046FEF799FF20214046FEF795FF66 +:10F4A0002001ADF8000048258DF803506946484614 +:10F4B000FEF70AFFE002ADF800008DF80350694640 +:10F4C0005046FEF701FFADF800608DF80350694625 +:10F4D0005046FEF7F9FE0121084600F099FF012190 +:10F4E0001248FEF73FFFADF800408DF802708DF82E +:10F4F000034069464046FEF7E7FE10214046FEF70E +:10F5000066FF0020FAF7F6FA6002ADF8000004206A +:10F510008DF8030069465046FEF7D6FEBDE8F88F29 +:10F520000008014000100140000C014000013000C3 +:10F53000FEE770474FF4A06000F032B830B50F23FB +:10F54000C27801780125F2B1144A126801F1E02174 +:10F5500002F4E062C2F5E062120AC2F10404D34090 +:10F560004278A24084781C401443220181F8002490 +:10F57000007800F01F018D404009800000F1E0207C +:10F58000C0F8005130BD01F01F00854048098000DF +:10F5900000F1E020C0F8805130BD00000CED00E02B +:10F5A0000249084302490860704700000000FA055C +:10F5B0000CED00E00907090E002806DA00F00F0044 +:10F5C00000F1E02080F8141D704700F1E02080F881 +:10F5D00000147047024A114001430248016070471D +:10F5E00080FFFF1F08ED00E04FF40072002101488A +:10F5F00004F0C6BAA827002010B540F6B83421465A +:10F60000074803F0D3F8012806D105482146001D1C +:10F6100003F0CCF8012801D0012010BD002010BD5E +:10F62000AC020020014908627047000000000E4251 +:10F630002DE9F0472348DFF890900122B0F81880B8 +:10F6400009F2FA250020C5F80490287043462021CD +:10F650004846FFF769FE687004461CA0696805F01B +:10F6600099F8444528D0022624E019F804102029EE +:10F6700025D02978274605EB810109EB0700886032 +:10F680004346324620211048FFF74EFE2A781349A0 +:10F690000446C01B5054297805EB8100826810A0F5 +:10F6A00005F078F82878401CC0B22870042803D2EE +:10F6B000761CF6B24445D8D10120BDE8F087641C21 +:10F6C000A4B2F7E77C070020E2320020696E6F7574 +:10F6D0007420636D643A25730A000000F43500203D +:10F6E000256420706172616D3A25730A0000000084 +:10F6F0001FB50F4B012018720020D887009A9DF883 +:10F700000410A2F5E0626846853A09D05A2A06D16B +:10F7100040F2DF72A3F84C20401DFFF7EFF91FBD48 +:10F7200040F28572A3F84C20401DFFF715FA1FBD6B +:10F7300054270020704700002DE9F047DFF8E480EF +:10F740004FF4807529464046FEF738FE364CDFF808 +:10F75000DC906E00207331464F464846FEF72EFE81 +:10F76000607302462378217B31A005F013F83146FF +:10F770003846FEF723FE002700282AD0AA4629464D +:10F7800045464046FEF71AFE18B3A0780A21B0FBA2 +:10F79000F1F201FB1201401CA070012915D1314684 +:10F7A0004846FEF70BFE08B12CA100E02DA12FA0CA +:10F7B00004F0F0FF51462846FEF700FE08B127A1ED +:10F7C00000E028A12BA004F0E5FFFCF78FFDA0B915 +:10F7D0001AE0207BE178884205D0E07080B121A159 +:10F7E00022A004F0D7FF2179607B814205D02071EF +:10F7F00040B11CA11FA004F0CDFF6770BDE8F087E9 +:10F8000016A1EDE715A1F5E761781DA004F0C2FF90 +:10F810006078401CC0B260700C28EFD96770FEF7AA +:10F8200021F9000000080140E00400200010014020 +:10F830007374617465412D2D2D202564202073740F +:10F840006174654163633A20256420202077616BF1 +:10F85000655F747970653A25640D0A0077616B65A0 +:10F8600075700000736C656570000000412B2025E9 +:10F87000730D0A004143432025730D0A0000000068 +:10F88000456E74657220536C6565702054696D65B2 +:10F89000206164642D2D2D20256420202D2D4D61A7 +:10F8A000782D31320D0A00002DE9F0412B482C490A +:10F8B0004069F8F714FDF8F772FF81B2B1F5AF7F38 +:10F8C00043D3284A284E00249079012706EBC00331 +:10F8D0000546B3F802C08C450CD316E036F830C0AC +:10F8E0008C4505D206EBC00CBCF802C08C4504D890 +:10F8F000401CC0B20528F1D301E0052800D3042044 +:10F90000D472947AECB9977216E036F830C08C4510 +:10F910000CD814E036F830C08C4505D206EBC00C8C +:10F92000BCF802C08C4503D8401EC0B20028F1D1FB +:10F930009472D47A2CB9D772DB88D38101E0D47267 +:10F940009472D3891BB15B1ED381BDE8F0818542DF +:10F95000FBD03229F9D99071F7E70000E8160020B2 +:10F960000000C842E0040020C8B20108074810B5F2 +:10F9700040F2126101600021416001724172022176 +:10F98000817205F0EBFE012010BD00002C0C002060 +:10F9900070B5FCF7C1FB05F081FC002877D0764CF0 +:10F9A0000025207B012802D0022866D0D1E07248D1 +:10F9B0000A21A83002F010FF012857D1E08E0A2159 +:10F9C000B0FBF1F201FB1202F2B1B0FBF1F201FB6C +:10F9D0001202012A20D0B0FBF1F201FB1202022A2E +:10F9E00022D0B0FBF1F201FB1202032A24D0B0FBBB +:10F9F000F1F201FB1202042A26D0B0FBF1F201FB66 +:10FA00001200052828D02EE040F2126007F080F99D +:10FA100008B3FFF7ABFF26E04FF4607007F078F90A +:10FA2000C8B100F0B3F81EE040F2524007F070F9A0 +:10FA300088B1FEF7E1F816E040F2534007F068F9AC +:10FA400048B1FEF7E3F90EE040F2544007F060F9E8 +:10FA500008B1FEF733FA06E040F2514007F058F9DA +:10FA600008B1FEF749F9E08E401CE086E08E0628DA +:10FA70006FD3E586022020736BE0FCF747FC3E4E17 +:10FA8000803610B9FCF732FC10B175620FE061E00E +:10FA9000706A42F21071884209D237480A21B030A8 +:10FAA00002F09AFE012802D1706A401C706232484E +:10FAB0006421A83002F090FE0525012818D1608F3E +:10FAC000B0FBF5F105FB1101401C608781B92B48A3 +:10FAD00000780028E08E00F10100E08602D0C00727 +:10FAE00004D105E000F00300012801D1FFF73EFF3B +:10FAF00021481421AC3002F06FFE012829D1A08FDB +:10FB0000B0FBF5F105FB1101401CA08709BBFFF715 +:10FB100073FD01281DD1208F401C80B2B0FBF5F190 +:10FB200005FB11012087042915D0B0FBF5F105FB79 +:10FB30001101032916D0B0FBF5F105FB11010229D3 +:10FB400013D0B0FBF5F105FB1100012810D0FEF732 +:10FB5000D3F8012070BDFCF7D9FB0028F9D000F0E4 +:10FB600015F8F6E7FEF748F8F3E7FEF74FF9F0E788 +:10FB7000FEF7A4F9EDE7000058020020E50400209C +:10FB80000149012008737047580200202DE9F84F01 +:10FB9000824800264FF46071C0E900160672467272 +:10FBA000082181727E4834467E498068F8F73FFB21 +:10FBB000F8F7F5FD7C4D85F8D5007C4810F8281F36 +:10FBC00040780844282101EB500085F8D600784899 +:10FBD000294631F8D39F4378487909F00F0220F085 +:10FBE0000C00062B03D095F80A11012977D1001DCE +:10FBF00085F8D80095F8B910DFF8B0B1C1F3411C11 +:10FC0000DFF898E16B49AEF1B80EBBF81CA049785B +:10FC1000BBF81E80BEF830E0BBF826700097664F38 +:10FC20008B1EBCF1020F97F800B0624FBF781BD05B +:10FC3000032B5FD84B466AF30F13A5F8D330B5F802 +:10FC4000D2203C2368F30B02A5F8D220BEFBF3F2CE +:10FC500085F8D720009A7AB320F0F000503085F86C +:10FC6000D80085F8D9B056E0032B5ED84B466AF32E +:10FC70000F13A5F8D330B5F8D2203C2368F30B025C +:10FC8000A5F8D220BEFBF3F285F8D720009A002A0F +:10FC9000E2D1042924D005290AD003290DD01AE085 +:10FCA00020F0F00030301EE020F0F00020301AE0AC +:10FCB00020F0F000403003E007E020F0F0002030BA +:10FCC00085F8D80085F8D96025E0042908D00529F1 +:10FCD0000CD00329E8D020F0F0001030F0E724E049 +:10FCE000022FE1D1DCE785F8D80014E020F0F00025 +:10FCF0004030F8E720F0F000103085F8D80085F8A3 +:10FD0000D960A5F8D320B5F8D2006FF30B00A5F8A1 +:10FD1000D20085F8D76021483E38407C012895F80C +:10FD2000D80020F0030004D004E020F0F0006030A0 +:10FD3000E3E7401C85F8D8000BF08EF820B11E4890 +:10FD4000007885F8D90001E085F8D9601648B03010 +:10FD500050F8221F42681548C37E012B0BD1174B68 +:10FD60001B78042B07D1134B5B78042B03D1838BB7 +:10FD7000C08B43EA003464F31741200A60F30F217B +:10FD8000200C60F30701054840F80B1F4260034850 +:10FD900007F0C0F80120BDE8F88F00002C0C00200F +:10FDA000E816002000002042FC0D00200017002073 +:10FDB0003E2A0020580200207C0700201B0500205E +:10FDC000064810B5406938B1044840F21451143067 +:10FDD00002F0ECFC002800D0012010BD940F0020A0 +:10FDE00010B50949027B11F8DB3F62F303030B7086 +:10FDF000C27A064B02F00301D972017B104605F06E +:10FE00005DFD012010BD0000FC0D00205802002007 +:10FE10000249012081F80A0170470000FC0D002012 +:10FE2000044950F80B2F41F8092F40684860012021 +:10FE300070470000AC0E00202DE9F0410446B0F8F8 +:10FE40000B0040BAF8F785FC1B4E1C4F32463B4670 +:10FE5000F8F768FBDFF8688000224346F8F75CFBA0 +:10FE6000F8F7D0FC80B2411E40F2E732154D9142C6 +:10FE70000CD2F8F76EFC32463B46F8F753FB0022F3 +:10FE80004346F8F749FBF8F7BDFCA880B4F80F002B +:10FE900040BA2881F8F75DFC0B4A0C4BF8F742FB9F +:10FEA000F8F7B0FC0A490870607CA872A07CE87280 +:10FEB0000120BDE8F08100009A9999999999A93F8C +:10FEC00000009940FC0D00207B14AE47E17A843F8E +:10FED0005802002030F80B1F4ABA074921F8402F7A +:10FEE000428852BA4A80828852BA8A80C08840BA10 +:10FEF000C880012070470000FC0D002030F80B1F67 +:10FF00004ABA074921F8482F428852BA4A80828863 +:10FF100052BA8A80C08840BAC88001207047000069 +:10FF2000FC0D002030F80B1F4ABA074921F8502F6A +:10FF3000428852BA4A80828852BA8A80C08840BABF +:10FF4000C880012070470000FC0D002030F80B1F16 +:10FF50004ABA074921F8582F428852BA4A80828803 +:10FF600052BA8A80C08840BAC88001207047000019 +:10FF7000FC0D002030F80B1F4ABA074921F8602F0A +:10FF8000428852BA4A80828852BA8A80C08840BA6F +:10FF9000C880012070470000FC0D002030F80B1FC6 +:10FFA0004ABA074921F8682F428852BA4A808288A3 +:10FFB00052BA8A80C08840BAC880012070470000C9 +:10FFC000FC0D002030F80B1F4ABA074921F8702FAA +:10FFD000428852BA4A80828852BA8A80C08840BA1F +:10FFE000C880012070470000FC0D002030F80B1F76 +:10FFF0004ABA074921F8782F428852BA4A80828843 +:020000040801F1 +:1000000052BA8A80C08840BAC88001207047000078 +:10001000FC0D002030F80B1F49BACAB2084921F87C +:10002000802F428852BAD2B24A80828852BAD2B263 +:100030008A80C08840BAC0B2C880012070470000E2 +:10004000FC0D00202DE9F041044634F80B0F40BAB6 +:10005000F8F77FFB0F4E104F32463B46F8F762FA37 +:10006000F8F7D0FB0D4DA881608840BAF8F771FB16 +:1000700032463B46F8F756FAF8F7C4FBE881207998 +:10008000287460796874A079A874E079E874012014 +:10009000BDE8F0819A9999999999A93FFC0D0020A2 +:1000A00010B50C4AC37A12F8A01F63F30301117054 +:1000B000C37A1B0963F3071111700A09072A00D9D3 +:1000C000072200F10C010348A130F8F75DF8012088 +:1000D00010BD0000FC0D00202DE9F041044634F86D +:1000E0000B0F40BA00B2F8F723FB184E184F3246F8 +:1000F0003B46F8F717FA0022164BF8F70DFAF8F717 +:1001000062FB154DA882608840BA00B2F8F710FB78 +:10011000F217F8F7E8FAF8F775FBE882A08840BA1A +:1001200000B2F8F705FB32463B46F8F7FBF9F8F763 +:1001300069FB2883A0790B3C282800D92838A876A9 +:10014000A07CE8760120BDE8F08100009A99999999 +:100150009999A93F00009940FC0D002030F80B1F31 +:100160004ABA094921F81C2F428852BA4A800279BA +:10017000283A0A714279283A4A71C08840BAA1F8EF +:100180000700012070470000FC0D00202DE9F04120 +:10019000044634F80B0F40BAC0F30B00F8F7D9FA55 +:1001A0000D4E0E4F32463B46F8F7BCF9F8F72AFBE6 +:1001B0000B4D25F8250F608840BAC0F30B00F8F707 +:1001C000C8FA32463B46F8F7ADF9F8F71BFB6880F2 +:1001D0000120BDE8F08100009A9999999999B93F59 +:1001E000FC0D00200949C27A01F8292F027B4A70D0 +:1001F000427B8A70827BCA70C27B0A71027C4A7120 +:10020000427C8A71807CC87101207047FC0D0020FF +:100210000949C27A01F8312F027B4A70427B8A7009 +:10022000827BCA70C27B0A71027C4A71427C8A71ED +:10023000807CC87101207047FC0D002070B50F4D07 +:100240000446C07A85F83900A08940BAF8F781FAE7 +:100250004FF0FF363246F8F746FAF8F7D3FA6887D8 +:10026000E880E08940BAF8F774FA3246F8F73BFACA +:10027000F8F7C8FAA887012070BD0000FC0D002027 +:10028000C17A282900D92839174AA2F89010017B91 +:10029000282900D92839A2F89210417B282900D9B1 +:1002A0002839A2F89410817B282900D92839A2F88E +:1002B0009610C17B282900D92839A2F89810017C12 +:1002C000282900D92839A2F89A10417C282900D978 +:1002D0002839A2F89C10807C282800D92838A2F858 +:1002E0009E00012070470000FC0D002070B51149F0 +:1002F00050F80B2FA1F130058A674068C86735F8C0 +:10030000AC4FA008F8F725FA0B4A0C4BF8F70AF99E +:10031000F8F778FA60F38F042C802879F8F719FA47 +:10032000074A084BF8F7FEF8F8F76CFA2871012035 +:1003300070BD00002C0E00209A9999999999B93FA7 +:100340004A0C022B8716C93F0A4A50F80B1F42F885 +:10035000011F41685160427983791204C07942EAF1 +:1003600003220243034862F31F31B038C0F8B510CE +:1003700001207047AC0E002010B504480449F8F77E +:1003800041FA0449A1F8C900012010BD9A99999930 +:1003900099D1B840FC0D00200A4911F8C12F02F58F +:1003A000FA620A70027B4A70427B8A70827BCA7052 +:1003B000C27B0A71027C4A71427C8A71807CC8715E +:1003C00001207047FC0D0020044A0029516901D02A +:1003D000014300E08143516170470000001002407A +:1003E000044A0029D16901D0014300E08143D16171 +:1003F0007047000000100240044A0029116901D032 +:10040000014300E081431161704700000010024089 +:10041000044A0029916901D0014300E081439161C0 +:100420007047000000100240044A0029D16801D042 +:10043000014300E08143D16070470000001002409A +:10044000014908607047000040044242F0B52B4C5F +:1004500061682B4A11F00C014FF00F0603D00429FC +:1004600001D0082901D0026026E06168636806EACD +:10047000914103F480330D2901D0891C00E006214D +:10048000BBB1E36A13F4803FE36A03F00F0303F1A7 +:1004900001030AD0E56AC5F30317E56A7F1CB2FBC6 +:1004A000F7F2C5F30325AD1C6A43B2FBF3F24A43EE +:1004B000D9E7144A514301606168134A06EA1111F1 +:1004C000535C0168D94041606368072505EA13233E +:1004D000D35C21FA03F38360636805EAD323D25C1B +:1004E000D140C1606268032303EA9232064B1B1FAE +:1004F0009A5CB1FBF2F10161F0BD00000010024016 +:1005000000127A0000093D0044020020034600204A +:100510005909094A01290AD002290AD0516A03F06F +:100520001F02012393400B4200D001207047116845 +:10053000F5E7116AF3E700000010024006490022C7 +:1005400081F8202081F82020012802D0042802D13F +:10055000052081F820007047001002400149086022 +:100560007047000080044242014908607047000063 +:100570003C04424202490A6A02430A627047000090 +:100580000010024070B50D460646002403E0305DC1 +:1005900003F010F9641CAC42F9DB70BD70B50D4678 +:1005A0000646002403E0305D03F004F9641CAC420D +:1005B000F9DB0D2003F0FEF80A2003F0FBF800241D +:1005C00003E0305D02F0CCF9641CAC42F9DB70BD95 +:1005D00070B50D460646002403E0305D03F0C8F90F +:1005E000641CAC42F9DB70BD10B54FF40030FDF770 +:1005F000F1F902490220087010BD0000E00400205B +:100600003EB54FF40030002500908DF804500820CE +:100610008DF8050001248DF806406846FDF7EAF9DB +:1006200029208DF8080002208DF809008DF80A5065 +:100630008DF80B4002A8FEF781FF3EBD02480188FD +:1006400041F01001018070470428004002480188F1 +:1006500021F01001018070470428004006480188FD +:10066000031D1A880088814203D0198841EA00409E +:10067000704742EA0140704718280040044A0029A8 +:10068000118801D0014300E08143118070470000D0 +:100690000028004010B516A004F07CF801214FF0AE +:1006A000C050FFF79DFE0120FEF7BCFFF9F719FAD5 +:1006B0000020FFF743FF0120FFF750FF6120FFF705 +:1006C00025FF0028FAD04FF40070FFF753FF0120F8 +:1006D000FFF74AFF00F060F849F6404000F044F8A8 +:1006E00000F052F8BDE81040002000F02DB80000E6 +:1006F0005254435F496E745F436F6E6669677572EB +:100700006174696F6E0D0A0010B50446FFF7A6FF0D +:10071000204400F009F800F037F80121BDE810404E +:100720000220FFF7ABBF000000B50246FFF786FFCF +:100730000449100C0880081D02805DF804EBFFF7E7 +:1007400085BF00002028004000B50246FFF776FF75 +:100750000449100C0880081D02805DF804EBFFF7C7 +:1007600075BF00001828004000B50246FFF766FF7D +:100770000449C2F303400880081D02805DF804EBC1 +:10078000FFF764BF08280040024801888906FCD5AD +:1007900070470000042800400448018821F0080147 +:1007A000018001880907FCD570470000042800403B +:1007B0000F4910B50120C1F89801FEF729FB9020E0 +:1007C000FEF764FB0020FEF761FBFEF743FBFEF73C +:1007D0001FFB9120FEF75AFBFEF7DAFA054C20705A +:1007E000FEF7D6FA6070FEF735FB208840BA10BDE0 +:1007F000008021427E06002000B597B0142112A887 +:10080000F7F7DBFC5A208DF8000001208DF801007D +:1008100086218DF802108DF80400022100208DF849 +:1008200003108DF8050006216846FBF731F99DF8A5 +:100830000320ADF84400694612A8121DF7F7A4FC86 +:10084000BDF844009DF8031013AA030A8B54521CF0 +:1008500042F210738854074AB2F81900984202D243 +:10086000401CA2F8190012A8891DFFF7B1FE17B0AD +:1008700000BD00000017002010B508B34168F9B1B1 +:100880008168E9B10178174B002202EB420404EBC6 +:10089000C20403EB041424788C4211D0521CD2B24F +:1008A000022AF2D3002202EB420101EBC20103EB68 +:1008B00001110978FF2905D0521CD2B2022AF2D3C5 +:1008C000002010BD02EB420101EBC20103EB011459 +:1008D000014620222046F7F757FC012084F85400F7 +:1008E000014810BDC0110020CC040020704700005A +:1008F00003490869401C0861012800D172B670479D +:100900006807002005490869012802D0401E0861D7 +:1009100070470020086162B6704700006807002039 +:100920002DE9F84F01208DF802004FF44C60ADF82E +:100930000000DFF898B104248DF80340694658465A +:10094000FDF7C2FCE1016248FDF741FD614D28461B +:10095000F8F7E6F900212846F8F7CEF9012140F230 +:10096000BD10FFF755FD5C4D284603F021F800212E +:10097000284603F012F840F225590022494628463D +:1009800003F076F840F2244A00225146284603F04C +:100990006FF80C20ADF8000010258DF803500326E9 +:1009A0008DF8026069464A48FDF78EFC04214848EC +:1009B000FDF70BFD08214648FDF707FD0120FCF778 +:1009C00038FF464F384602F0F3FF0021384602F068 +:1009D000E4FF00224946384603F04AF8002240F27C +:1009E0002661384603F044F800225146384603F0A9 +:1009F0003FF8B002ADF80000394F8DF8034069466A +:100A00003846FDF761FCDFF8DC80404602F0D0FF9D +:100A10000021404602F0C1FF00224946404603F053 +:100A200027F800225146404603F022F8A002ADF814 +:100A300000008DF8034069463846FDF745FCADF8E7 +:100A4000004069462848FDF73FFC02212048FDF799 +:100A5000BCFC8DF802604FF40870ADF800008DF812 +:100A6000035069465846FDF72FFC8DF802602402BA +:100A7000ADF800408DF8035069461548FDF724FC99 +:100A800021461348FDF7A3FC61105846FDF79FFC73 +:100A900020215846FDF79BFC10215846FDF795FC98 +:100AA00020213846FDF791FC01215846FDF78DFCC9 +:100AB00002215846FDF789FC04215846FDF785FCC4 +:100AC00021015846FDF781FCBDE8F88F000C01407C +:100AD000000801400024014000440040004C004058 +:100AE0000010014000500040001401402DE9F04189 +:100AF00003460E46407819785F4A00EB012085B224 +:100B00005F48978900245D4990F82000AF4210D1DA +:100B10008979B1420BD140B1FBF7B0FB18B1324635 +:100B2000991C584815E02224A2E03324A0E01324A5 +:100B30009EE0978AAF4212D1897AB142F7D100285C +:100B4000F3D0FBF79BFB0028EDD04E483246991CB2 +:100B50003530F7F719FB2846FCF7F2FB88E0D78A17 +:100B6000AF420DD1C97AB142E1D10028DDD0FBF707 +:100B700085FB0028D7D04348991C32463930E8E736 +:100B8000178BAF420DD1097BB142D0D10028CCD018 +:100B9000FBF774FB0028C6D03A48991C32463D301A +:100BA000D7E7578BAF420DD1497BB142BFD1002867 +:100BB000BBD0FBF763FB0028B5D03248991C324606 +:100BC0004130C6E7978BAF420DD1897BB142AED1A0 +:100BD0000028AAD0FBF752FB0028A4D02948991C72 +:100BE00032464530B5E7D78BAF420DD1C97BB14214 +:100BF0009DD1002899D0FBF741FB002893D02148D4 +:100C0000991C32464830A4E7178CAF420DD1097CBD +:100C1000B1428CD1002888D0FBF730FB002882D06D +:100C20001848991C32464B3093E7578CAF420DD190 +:100C3000497CB14298D1002898D0FBF71FFB0028CF +:100C400098D01048991C32464E3082E7928CAA42C6 +:100C50000DD1897CB14287D1002887D0FBF70EFBEC +:100C6000002887D00748991C3246513071E731245B +:100C70002046BDE8F0810000B6BA0108A2BA01081A +:100C800054270020A517002070B5184D00248EB001 +:100C9000B5F840101646042902D213200EB070BDDC +:100CA000017871228DF8002002788DF801204278B9 +:100CB0008DF80220807804228DF80300012907D0E6 +:100CC000022905D0032903D02879012802D004E0A5 +:100CD000312402E00020287112241A801CB96946D0 +:100CE0003046F7F751FA2046D8E700005427002095 +:100CF00004494BF65C200880091D4AF655200880FF +:100D000070470000B06C00400CB500222E480092E5 +:100D10000192016841F4803101604FF4A0630168E1 +:100D200001F4003101910099491C0091019911B918 +:100D300000999942F3D10168890342D501210191BB +:100D400022490A6842F010020A600A6822F007028B +:100D50000A600A6842F002020A6041684160416824 +:100D60004160416841F480614160C16A184A1140A4 +:100D7000C162C16A174A1143C162016841F08061D2 +:100D8000016001680901FCD5416821F47C114160D2 +:100D9000416841F4E8114160016841F080710160EF +:100DA00001688901FCD5416821F003014160416877 +:100DB00041F0020141604168C1F381010229FAD189 +:100DC0000CBD01920CBD000000100240002002404A +:100DD00000F0FEFF14080100FFF78ABF10B598B0BD +:100DE000142112A8F7F7E9F95A208DF80000012123 +:100DF0008DF8011084208DF802002D4840F2BB23AD +:100E00002C4C828FA2F209729A4203D290F80A0106 +:100E100001284AD0002020760B208DF8030034F8FA +:100E2000010F010A8DF804108DF80500A088010A51 +:100E30008DF806108DF80700E088010A8DF808107B +:100E40008DF809008DF80A108DF80B00B4F8110028 +:100E5000010A8DF80C108DF80D00E07D8DF80E0064 +:100E60000F216846FAF714FE9DF80320ADF8440000 +:100E7000694612A8121DF7F787F9BDF844009DF8DE +:100E8000031013AA030A8B54521C8854208B42F27D +:100E90001072641E904202D2401CA4F8190012A8DD +:100EA000891DFFF795FB18B010BD2176B4E700004F +:100EB000FC0D00200017002070B5FEF7B9FB0028DC +:100EC00018D0124C0020124D124EE08380B200EB7D +:100ED000400005EB800041687068F7F779F9002859 +:100EE000E08B08D000EB400005EB8000806800B18B +:100EF0008047012070BD401C80B2E0830B28E5D301 +:100F000005A003F047FC002070BD00007C07002016 +:100F10003CBB0108DC350020416E20756E726563B4 +:100F20006F676E697A656420434D4420210A000092 +:100F300030B547220270032343700B788370C27070 +:100F4000062303714B7843718B788371CB78C3711F +:100F500002720A2343720B790E2503F03F0383725A +:100F60004B7903F03F03C3728B7903F01F030373C4 +:100F7000CB7903F01F0343730B7A03F01F038373D2 +:100F80004C7A0F2304F03F04C473027445748D7AC5 +:100F90008574CD7AC574027543750B7B83751024F7 +:100FA000C27504764A7B4276897B81761B2030BDF0 +:100FB0000F220249801CF7F7E7B80000FD17002058 +:100FC000F0B50023137003EB430404EBC30400EB00 +:100FD0004404647834B144EA032514786600641C40 +:100FE00014708D535B1CDBB2122BECD310780028ED +:100FF0001DD0002317E000200EE001EB400531F882 +:1010000010606C88F7B204F0FF0C674502D96E805F +:1010100021F81040401CC0B21478E41A641E8442C7 +:10102000EBDC5B1CDBB21078401E9842E3DCF0BDC9 +:1010300010B50B46024600240DE01078FEF766F965 +:1010400038B112F8010BFAF76BFD04EB840100EBE9 +:1010500041045B1EDBB2002BEFD1204610BD000027 +:101060002DE9F84F4FF417742146F648F7F7A5F825 +:10107000F5A003F08FFBFE4D2246F249284605F00D +:1010800013FCF04F3878FF2800D050B90A20FCF745 +:101090004AF9F8A003F07EFB2246EA49284605F00B +:1010A00003FC3878FF2800D050B90A20FCF73BF940 +:1010B000F5A003F06FFB2246E249284605F0F4FB59 +:1010C0003978FF2900D051B90A20FCF72CF9F4A097 +:1010D00003F060FB2246DB49284605F0E5FB97F864 +:1010E0003800FF2804D1D74814213830F7F765F8C5 +:1010F0003878DFF85083DFF8C0930A260025A8F17E +:101100006808FF2801D0002872D1C8F86850C8F8D4 +:101110006C50C8F87050C8F8745087F87650482062 +:101120003870592078704420B8704E20F870322002 +:10113000387130217971B8713320F871D9F80810FD +:10114000080EB6EB101F4FEA101201D2263200E053 +:10115000303200F00F003A720A2801D9263000E040 +:1011600030307872C1F30740B6EB101F4FEA10120F +:1011700001D2263200E0303200F00F00BA720A28A5 +:1011800001D9263000E03030F872C1F30720B6EB09 +:10119000101F4FEA101201D2263200E0303200F068 +:1011A0000F003A730A2801D9263000E030307873F6 +:1011B000C8B2B6EB101F4FEA101101D2263100E081 +:1011C000303100F00F00B9730A2801D9263000E051 +:1011D0003030F873B9A003F0DDFA0024BCA0395D0B +:1011E00003F0D8FA641CE4B2102CF7D387F84C5003 +:1011F00097F8B900FF2801D00A2804D987F8B95018 +:10120000AEA003F0C7FA387CFF2800D080B9C8F838 +:101210007850C8F87C508B48C8F88050ADA2AFA178 +:101220001030C8F8845003F0C5FAADA003F0B2FA4C +:10123000844C97F820001834FF2800D050B981481A +:10124000A560AFA2A5A12030E56003F0B3FAAEA07F +:1012500003F0A0FA97F82800FF2800D060B92561B4 +:1012600065617848A5619BA29CA12830E56103F0E7 +:10127000A1FAA5A003F08EFAB7F84D004FF6FF7162 +:101280004FF0500B884200D008B9A7F84DB0B7F81E +:101290004F005522884200D008B9A7F84F20B7F870 +:1012A00051008846404500D008B9A7F85120654C48 +:1012B00097F895009534FF2800D0B8BB9BA1204635 +:1012C000F6F7ACFFD9F80810C1F30740B6EB101FD2 +:1012D0004FEA101201D2263200E0303200F00F0047 +:1012E00087F8A0200A2801D9263000E0303087F89E +:1012F000A100C1F30720B6EB101F4FEA101201D274 +:10130000263200E0303200F00F0087F8A2200A28D1 +:1013100001D9263000E0303087F8A300C8B2B6EB20 +:10132000101F4FEA101102D2263101E016E03031D1 +:1013300000F00F0087F8A4100A2801D9263000E039 +:10134000303087F8A5002046694603F079F99DF80A +:101350000000303087F89D0087F84C50394821460E +:10136000983040F8115F8580857175A003F012FAFE +:10137000B7F890004146884200D008B9A7F89060BD +:10138000B7F853006E22884200D008B9A7F853205E +:10139000B7F857004FF4E17C884200D008B9A7F8AD +:1013A00057C0B7F85500884200D018B94FF47A609A +:1013B000A7F85500B7F8590040F6AC54884200D061 +:1013C00008B9A7F85940B7F85B004FF4FA738842A0 +:1013D00000D008B9A7F85B30B7F88300884200D086 +:1013E00018B940F61C40A7F88300B7F8850088427A +:1013F00000D008B9A7F885C0B7F85D00884200D0D2 +:1014000018B9B7F88300A7F85D00B7F85F004FF48C +:101410007A78884200D008B9A7F85F80B7F86100F1 +:10142000884200D008B9A7F86130B7F86300884255 +:1014300000D018B94FF49B70A7F86300B7F86500A7 +:1014400088428FE0902A00203D3D3D3D3D3D486172 +:10145000692044756E20506172616D6574657220FB +:10146000496E6974213D3D3D3D3D3D0D0A00000042 +:1014700000F001086273705F5265616443707546E5 +:101480006C617368210D0A006273705F526561645C +:10149000437075466C61736820310D0A00000000CE +:1014A0006273705F52656164437075466C61736806 +:1014B00020320D0A0000000040170020736E2069E2 +:1014C000732064656661756C74210D0A000000006C +:1014D00025632000484559444E0000002573000054 +:1014E000626C7565746F6F74685F6E616D6520699D +:1014F000732064656661756C74210D0A000000003C +:101500003132333400000000626C7565746F6F74A3 +:10151000685F7061737377617264206973206465BA +:101520006661756C74210D0A000000004C4B364159 +:1015300044434531354C42343038353639000000AB +:101540000A0D205379735061726150696C654420B3 +:101550005665686963686C65496E666F2025730A15 +:101560000D00000000D008B9A7F86540B7F8670083 +:1015700040F6B83A884200D008B9A7F867A097F8B3 +:10158000B500FF2800D008B987F8B52097F8B60055 +:10159000FF2800D010B9322087F8B60097F8B000C5 +:1015A000FF2800D010B9032087F8B000B7F8B100C9 +:1015B000884200D018B94FF4D270A7F8B100B7F83C +:1015C000B300884200D018B94FF4A070A7F8B30058 +:1015D00097F893004FF01E09FF2801D00A2801D286 +:1015E00087F8939097F86B00FF2802D1022087F8C4 +:1015F0006B00B7F86900A0F57F41FF3900D008B94A +:10160000A7F8696097F86C00FF2803D10A21764893 +:10161000F6F7D3FD97F87600FF2801D187F87650CA +:1016200097F887100120FF2901D187F88700B7F8C4 +:101630008E104FF6FF72914200D019B9B7F85910C9 +:10164000A7F88E1097F88D10FF2900D009B987F8F8 +:101650008D0097F88711FF2901D187F8870197F846 +:101660008910FF2901D187F8895097F88A105A23E9 +:10167000FF2900D009B987F88A3097F88B10FF2925 +:1016800000D009B987F88B9097F88C10FF2900D00B +:1016900009B987F88C9097F89210FF2901D187F843 +:1016A000925097F87411FF2900D009B987F8745146 +:1016B000B7F87D11914200D019B940F2DC51A7F87A +:1016C0007D11B7F87F11914200D009B9A7F87F8149 +:1016D000B7F87511914200D019B940F24C41A7F802 +:1016E0007511B7F87711914200D019B940F2B631AF +:1016F000A7F87711B7F879116426914200D009B99B +:10170000A7F8796197F87B11FF2900D011B96921F9 +:1017100087F87B1197F87C11FF2900D009B987F869 +:101720007CB197F88111FF2900D009B987F881B100 +:1017300097F88211FF2900D009B987F8823197F80C +:101740008911FF2900D011B9032187F8891197F871 +:101750009011FF2901D0022901D987F89051B7F8DB +:101760008A11914200D009B9A7F88A6197F88C11C3 +:10177000FF2901D187F88C0197F89711FF2901D033 +:10178000022901D987F89701B7F8A610914201D034 +:10179000A14201D9A7F8A6A0B7F88E11914201D0B5 +:1017A000A14201D9A7F88EA1B7F89811914201D1B1 +:1017B000A7F89881B7F89A11914203D14FF4487174 +:1017C000A7F89A1197F87411FF2901D187F87401CD +:1017D00097F84C00112804D0112087F84C0000F035 +:1017E00055F8BDE8F88F0000FC2A002070B5084CC1 +:1017F00000256078012801D0A57070BDA078411C3B +:10180000A1700528F9D900F041F8A570657070BD88 +:10181000680700200C488168491C81604168491CA8 +:10182000416081684FF47A72B1FBF2F302FB13114D +:10183000012902D1C168491CC1600178002901D188 +:1018400001210170704700006807002070B50E4844 +:101850004FF47A710068B0FBF1F0401EB0F1807F68 +:1018600011D24FF0E024606165170F212846FDF783 +:10187000A1FE0020A061072020612846BDE870403D +:101880000021FDF797BEFEE72C02002010B5FDF702 +:10189000F5FBBDE810404FF417720249024805F00D +:1018A00019B80000902A002000F00108124810B575 +:1018B000016841F0010101604168104A1140416036 +:1018C00001680F4A11400160016821F48021016024 +:1018D000416821F4FE014160016821F0A0510160DE +:1018E0004FF47F0181600021C162FFF70DFA0549C5 +:1018F0004FF00060086010BD001002400000FFF0D3 +:10190000FFFFF6FE08ED00E010B5084C012120466F +:1019100000F004F9002807D0FEF73AF82046BDE8A9 +:101920001040012100F034B810BD00000004004058 +:101930007FB50D46044601210220FEF751FDADF8AA +:1019400004400020ADF80050104CADF80600ADF892 +:1019500002006946204600F0F5F8012211462046B3 +:1019600000F0E8F81D208DF80C0001218DF80D1015 +:1019700003228DF80E208DF80F1003A8FDF7DEFD71 +:101980000121204600F007F87FBD00000004004060 +:10199000C943018270470029018802D041F001014A +:1019A00001E021F001010180704700004B4910B5B2 +:1019B000884202D10121C41486E0B0F1804F09D0E1 +:1019C000474988420DD101210220FEF715FD002173 +:1019D000022064E001210846FEF70EFD00210120EF +:1019E0005DE04049884206D101210420FEF704FD54 +:1019F0000021042053E03C49884206D101210820FF +:101A0000FEF7FAFC0021082049E03849884206D157 +:101A100001211020FEF7F0FC002110203FE03449A6 +:101A2000884206D101212020FEF7E6FC002120207B +:101A300035E03049884202D10121441444E02E4966 +:101A4000884202D10121CC043EE02C49884202D1D7 +:101A500001210C0538E02A49884202D101214C05B8 +:101A600032E02849884206D101214020FEF7C4FC1B +:101A70000021402013E02449884206D10121802022 +:101A8000FEF7BAFC0021802009E0204988420AD1F3 +:101A9000841501212046FEF7AFFC00212046BDE859 +:101AA0001040FEF7A9BC1A49884202D101210C045A +:101AB0000AE01849884202D101214C0404E0164989 +:101AC00088420AD101218C042046FEF7ADFC204655 +:101AD000BDE810400021FEF7A7BC10BD002C01405E +:101AE0000004004000080040000C004000100040CE +:101AF0000014004000340140004C014000500140FF +:101B00000054014000180040001C0040002000402C +:101B100000400140004401400048014002460020CE +:101B2000138A92890B4202EA010202D0002A00D0F5 +:101B300001207047002A828901D00A4300E08A43CD +:101B40008281704730B502881B4C1C4DA0420DD0DD +:101B5000A8420BD0B0F1804F08D0194B984205D065 +:101B6000184B984202D0184B984203D122F07003D0 +:101B70004A881A43154B984206D0154B984203D019 +:101B800022F44073CA881A4302808A8882850A88B0 +:101B90000285A0420AD0A84208D00E4A904205D041 +:101BA0000D4A904202D00D4A904201D1097A018635 +:101BB0000121818230BD0000002C01400034014031 +:101BC0000004004000080040000C004000100040ED +:101BD0000014004000400140004401400048014022 +:101BE0000A480021428D4AB10722C273027B521C6F +:101BF000D2B20273102A00D1017370470177C1730A +:101C0000C17201764174808CFCF79ABFB406002043 +:101C100070B51B4C0125002025756076E07B0128FE +:101C20000AD1607A102807D1FCF766FFE07B012813 +:101C300002D1607A102807D0207908B1E07818B175 +:101C4000A078012806D007E096202086E5760220BD +:101C5000A07001E0607930B1607A20B1E07B0428A7 +:101C600003D1E08B08B900F0EFFAE07A012806D141 +:101C7000E07B062803D1BDE8704000F0E5BA70BDF6 +:101C8000B40600202DE9F041264CA078012847D069 +:101C9000254F3879012802D1E07A012840D0FCF79D +:101CA00079FF20851F483830FCF73AFF1D4E00258C +:101CB0003836307800F0F001A173E584A18CA7F8E4 +:101CC00040103D71A178012700F00F00022901D1D9 +:101CD00000B9A770E07A012801D100F0B5FAA07B25 +:101CE00000281DD13078114A00F00F0CA4F824C050 +:101CF000012006E0E18C335C5354491C401CE18414 +:101D0000C0B26045F6D900F06BF938B1E7742946E6 +:101D10006174A08CBDE8F041FCF712BF0921F7E720 +:101D2000BDE8F081B406002054270020541B002099 +:101D300070B5194D0024A87801281CD001266E75B5 +:101D4000FCF728FF288505F13800FCF7E9FE05F1CE +:101D50003800A9780078022900F00F0001D100B9FD +:101D6000AE70E87A012801D100F06EFA0B486C776A +:101D70006E70067170BD687F401CC0B26877022823 +:101D8000F8D301F02BFC00F035F86C770448AC7008 +:101D9000EC73047070BD0000B406002054270020CE +:101DA0005007002010B5104C207868B104F13800BD +:101DB00041782171807828B17F2800D97F20401C8C +:101DC000C0B200E0012060712079E0706079A071FC +:101DD0000020207200F09AFA207A10B10320E073FC +:101DE00010BD0420FBE70000B40600200048704747 +:101DF000541B002007480021C1738170C172C17556 +:101E000001760175417541768176C176017701745D +:101E100081757047B406002010B5064CA07AFCF717 +:101E2000DFFE04F13800FCF7BBFE4620A085012050 +:101E3000607610BDB406002070B5164C002507284A +:101E4000E08301D8657201E0102060720126A6705F +:101E50002584E07D012805D00C206074FCF790FEFD +:101E6000A57070BD607A10B1102803D004E000F0B6 +:101E7000B5FA01E000F06AFAE671A07AFCF7B0FE6C +:101E800004483830FCF78CFEE6734620A085667661 +:101E900070BD0000B406002010B500F0CFFBBDE817 +:101EA000104000F0D1B900000B49487B28B101284F +:101EB0000FD002280FD100F0A5B9C88CA0F60200FF +:101EC00040428886488D072801D300F0A9B800F069 +:101ED0002BB900F077B97047B406002070B51F4DDC +:101EE000A5F138042978687801F00F0140EA012053 +:101EF000A08440F60201608588420BD90D216174EF +:101F0000FCF71EFE0220207400F040FA002020742E +:101F1000E07370BD0828FCD300F062F8B8B1104B34 +:101F20000220E18C2A5C401C5A54628D491C521ECE +:101F30006285C0B2E1840728F3D901252573A08CFE +:101F4000FCF7DBFDE572BDE8704000F01FBA092127 +:101F50006174A08CBDE87040FCF7F2BDEC06002077 +:101F6000541B002070B50F4D0F4AA5F13804287896 +:101F700000F00F03A384012006E0E18C2E5C565490 +:101F8000491C401CE184C0B29842F6D900F028F800 +:101F900030B100216174A08CBDE87040FCF7D0BD69 +:101FA0000921F7E7EC060020541B00200A480A49E3 +:101FB0004FF000020078A1F1380110F0F0008873B2 +:101FC000CA84CA740549487603D0102803D1FFF7A4 +:101FD00085BFFFF7C7BF7047EC06002054270020DD +:101FE0000E4B002019469A7B098D42B1102A0ED063 +:101FF000202A0FD0302A09D1032907D305E09A8C73 +:10200000002A03D0521C914200D3012070470829B6 +:10201000FCD3FAE75A8D072AF9D2F3E7B406002079 +:10202000F0B51D49DFF874C001268D8E1C4B01F1FF +:102030003807072D1CD2CE8601200CE0CA8C3C5CF0 +:102040009C54521CCA844A8D521E4A85CA8E521C08 +:10205000401CCA86C0B2A842F0D9488D08B98CF895 +:102060001F604E730820C8730E760020C884F0BD30 +:102070000120CA8C3C5C401C9C54521CCA844A8D72 +:10208000C0B2521E4A850728F3D91004000CEED1C5 +:102090008CF81F60F0BD0000B4060020542700201B +:1020A000541B002070B51F4C608E38B3607D002833 +:1020B00036D00025657504F138062577307810F0A4 +:1020C000F000A0731CD010281AD0202828D1FFF7C8 +:1020D00087FFE8B13078217B00F00F00884219D1EA +:1020E0006573FFF7E1FE9620608601202077607B14 +:1020F000002815D1BDE87040FFF772BD03200AE04B +:102100000620607400F050F8BDE87040FFF74EBF45 +:10211000092000E004206074BDE8704000F044B87D +:1021200070BD0000B4060020F0B51C4901231C4D11 +:102130008E8E488D01F13804864214D3C6B2012038 +:1021400009E0CA8C275CAF54521CCA844A8D521EC7 +:10215000401C4A85C0B2B042F3D9488D002801D155 +:102160001048C377F0BDCB8601200CE0CA8C275CF9 +:10217000AF54521CCA844A8D521E4A85CA8E521CC4 +:10218000401CCA86C0B2B042F0D902204873082071 +:10219000C8730B760020C884F0BD0000B406002090 +:1021A000541B00205427002010B5054C0146A08C7C +:1021B000FCF7C6FC0020E073E072207610BD000042 +:1021C000B406002030B50D48017E002914D10C4C16 +:1021D00000F13803C18E07290AD8C28C5D5CA55472 +:1021E000521CC284428D521E4285491CC186F1E7B1 +:1021F000002141730721C17330BD0000B4060020E7 +:10220000541B002070B50E48017E002917D190F8AC +:102210002A3000F138040B4D5B1C09E0C28C665C6F +:10222000AE54521CC284428D521E4285491CC18646 +:10223000C18E9942F2D9002141730721C17370BD4B +:10224000B4060020541B002070B52C4C00222146FF +:10225000E37B0320497D092B1CD2DFE803F0050C4A +:1022600010141C202A383C00002913D06275BDE8E8 +:102270007040FFF79BBEBDE8704000F073BABDE848 +:10228000704000F035BA00F041F8207A002801D102 +:102290000420E07370BDBDE8704000F0F1B9A17991 +:1022A000491EC9B2A1710129F4D8E0736079A07107 +:1022B00070BD217D012039B12275A2760721E1731D +:1022C00096216186207770BDE18D49B170BDBDE872 +:1022D0007040FFF7E7BE638E13B131B162750B201A +:1022E0006074BDE87040FFF75FBFFFF7DDFD607B06 +:1022F0000028EBD1BDE87040FFF772BCB4060020A7 +:1023000001490120C8757047B40600200E49087ABB +:1023100028B1012815D0022815D100F03BB90A4A8E +:10232000C879383240F020001070088CA0F6020006 +:1023300040428886C88B072801D300F075B800F0AA +:10234000B3B800F0FFB87047B406002030B50D4AAE +:102350000D4C02F13803D08BC0F3032141F0100182 +:10236000197058700220118C655C1D54491C118431 +:10237000D18B401C491EC0B2D1830728F3D9082055 +:10238000907230BDB4060020541B002010B5124CD2 +:10239000002104F13802207C40F0300010705170B0 +:1023A000917061840320A0721154401CC0B20728B0 +:1023B000FAD90820A0720020FCF718FCA07AFCF7DC +:1023C0000FFC05483830FCF7EBFB0620E073462095 +:1023D000E0850120A07610BDB4060020F0B5104CB9 +:1023E000012004F13805E38B2B7001460D4E08E007 +:1023F000228C401CC0B2B75C6F54521C491C228412 +:10240000C9B29942F4D95B1CA372072807D80021EE +:102410002954401CC0B20728FAD90820A072F0BD88 +:10242000B4060020541B00202DE9F0411C4C1D4B2C +:1024300004F13805A28E072A1AD20126E686304614 +:102440000CE0218C5F5C2F54491C2184E18B491ED8 +:10245000E183E18E491C401CE186C0B29042F0D974 +:1024600026720025E575FCF7C9FB2584BDE8F081DF +:102470000120218C5A5C2A54491C2184E18B401C88 +:10248000491EC0B2E1830728F3D90820A072FFF7E4 +:10249000C3FC0420E073BDE8F04100F0BDB80000CB +:1024A000B4060020541B00202DE9F041234C0025E8 +:1024B000DFF88CC0A28EE18B04F138068A424FF01F +:1024C000010020D3CBB201210CE0228C401CC0B211 +:1024D0001CF802707754521C2284E28B521E491C55 +:1024E000E283C9B29942F0D9A37202E03554401C8C +:1024F000C0B20728FAD90820A072FFF78DFC04208B +:10250000E073BDE8F081E08601200DE0218C1CF82D +:1025100001303354491C2184E18B491EE183E18E53 +:10252000491C401CE186C0B29042EFD902202072C3 +:10253000E575FCF763FB2584E3E70000B4060020A3 +:10254000541B002070B5114CE07D01281CD1104BAC +:1025500004F13802E08E07280AD8218C5D5C1554FE +:10256000491C2184E18B491EE183401CE086F1E790 +:102570000820A072FFF750FC002020720420E073B6 +:10258000BDE8704000F048B870BD0000B4060020FF +:10259000541B00202DE9F041174CE07D012829D182 +:1025A00094F83610A27FC8B21144CEB2A6724FF092 +:1025B000000C04F13803114F0BE0228C401CC0B218 +:1025C000BD5C5D54521C2284E28B521EE283491C86 +:1025D000E186E18EB142F0D36546072803D81D5449 +:1025E000401CC0B2F9E70820A072FFF715FC257265 +:1025F0000420E073BDE8F081B4060020541B0020E5 +:1026000010B5FCF7BDFA03480021C1738170C17594 +:10261000017510BDB40600200749C879401CC0B23E +:10262000C871102801D10020C8710879002802D093 +:10263000C878401EC8707047B40600200F49487E15 +:10264000012803D1888D08B1401E8885887E012825 +:1026500003D1C88D08B1401EC885C87E012803D1AA +:10266000088E08B1401E0886087F012804D1488ED4 +:10267000002801D0401E488670470000B4060020A4 +:1026800070B51A4D0126A88DD0B1287DA97D0843CB +:1026900026D000246C762C75E88B98B1287908B187 +:1026A000E878A8B16979B1B1012914D002291AD00A +:1026B00016D9A879A0F10100A8714FF0050013E028 +:1026C000304600E020466874BDE87040FFF798BFD0 +:1026D0002C70022008E0FFF719FE287A08B1AE75C9 +:1026E00070BDAC7570BD0320E87370BDB4060020EA +:1026F00070B51B4D288EB0B1687D00282FD0002208 +:1027000005F138006A75007800F0F001A9733029EE +:1027100025D1EA7600F00F04FFF762FC28B1032C04 +:1027200005D305200EE002200CE009200AE0022C6F +:1027300007D0012C0BD0002C11D1BDE87040FFF761 +:1027400031BB08206874BDE87040FFF759BF07200F +:102750006874FFF755FF952028860120E87670BD44 +:10276000B40600200A4A0123908D68B1107D00282C +:1027700009D0002010755076517A31B1102902D15C +:1027800013700220D073704718465074FFF738BF9B +:10279000B406002001490020087070471805002089 +:1027A000014901200870704718050020094A29B125 +:1027B00092680068904204D8101A04E091680160A1 +:1027C00003E0C0431044884201D301207047002039 +:1027D000704700006807002010B5094C49B1A26895 +:1027E0000368934201D8D21A01E0DB431A448A42BB +:1027F00003D3A1680160012010BD002010BD0000BE +:102800006807002030B52C4C2078012852D12B4A83 +:102810000121D068401CD060117000232370052472 +:10282000B0FBF4F504FB1504002C43D1002841D083 +:102830000A24B0FBF4F504FB1504517004B991703F +:102840001424B0FBF4F504FB150404B9D170322450 +:10285000B0FBF4F504FB150404B911716424B0FB5A +:10286000F4F504FB150404B951714FF4FA74B0FB8C +:10287000F4F504FB150404B991714FF47A74B0FBBC +:10288000F4F504FB150404B9D17140F2DC54B0FB3B +:10289000F4F504FB150404B911724FF4FA64B0FBAB +:1028A000F4F504FB150404B9517241F270718842C9 +:1028B00000D3D36030BD000068070020802A0020CC +:1028C0000FB5124801880A2901D30021018002882E +:1028D000009900EB0212516002889DF8041000EB91 +:1028E0000212117202889DF80D1000EB0212517451 +:1028F0000188DDF8052000EB011141F8092FDDF812 +:1029000009204A600188491C01800FBD582300201E +:1029100070B51048006800281BD1F9F7FFF80028AF +:1029200017D00D4C21886088814212D000250A28DA +:1029300000D36580608804EB0010001D0FC801F013 +:1029400068F906480121817080F828506088401C91 +:10295000608070BDB006002058230020542700205E +:1029600010B5044C0146204601F0F4F8208800061A +:10297000FCD510BD004C00402DE9F041384E40F22E +:1029800025573946304601F054F8364C002590B1B1 +:10299000304601F0DBF8C1B2208BC82804D2324A9D +:1029A0001154401C208300E025830A292FD039468A +:1029B000304600F0ECFF40F224473946304601F043 +:1029C00038F838B12583304601F0C0F83946304632 +:1029D00000F0DDFF40F227742146304601F029F86F +:1029E00018B12146304600F0D2FF40F2266421465D +:1029F000304601F01EF818B12146304600F0C7FFFE +:102A00000821304601F00EF8012805D00BE0FEF752 +:102A100053FA2583BDE8F0810821304600F0B4FF69 +:102A2000304601F093F80421304600F0FBFF012806 +:102A300006D10421304600F0A7FF304601F086F8A9 +:102A40000221304600F0EEFF0128E3D1022130469A +:102A500000F09AFF3046BDE8F04101F077B8000081 +:102A6000004C00407C070020E232002070B5314C61 +:102A700040F225563146204600F0DBFF2E4D98B13E +:102A8000204601F063F8AA8B0021C0B2C82A04D204 +:102A90002A4B9854521CAA8300E0A9836983E970E9 +:102AA0003146204600F073FF40F22446314620466E +:102AB00000F0BFFF40B1204601F048F80120E87067 +:102AC0003146204600F063FF40F226652946204645 +:102AD00000F0AFFF18B12946204600F058FF08214A +:102AE000204600F09FFF012806D10821204600F073 +:102AF0004BFF204601F02AF80421204600F092FF07 +:102B0000012806D10421204600F03EFF204601F0B6 +:102B10001DF80221204600F085FF012808D102217E +:102B2000204600F031FF2046BDE8704001F00EB8AD +:102B300070BD0000005000407C070020AA33002038 +:102B400010B5094CA07E00280DD0607F10280AD156 +:102B5000207F00F047FA0020A076BDE81040FF215A +:102B60000248F5F72ABB10BD54270020541B002053 +:102B700010B5074CA07E002808D0607F112805D131 +:102B800004F1290000F0B0FA0020A07610BD00008A +:102B90005427002010B50A4CA07E00280FD0607F7B +:102BA00014280CD1032104F1290000F0EFFA0020D1 +:102BB000A076BDE81040FF210248F5F7FEBA10BD2F +:102BC00054270020541B002010B5064CA07E00287E +:102BD00006D0607F192803D100F0F8F80020A07615 +:102BE00010BD00005427002010B5064CA07E002820 +:102BF00006D0607F222803D100F058F90020A0768B +:102C000010BD00005427002070B50F4DA87E00288D +:102C10000ED0687F27280BD195F8290000240B4A95 +:102C200005F12901042804D0032000F0F1FAAC7664 +:102C300070BD042000F0ECFA0448AC76801FEC77FD +:102C400040F8064F446070BD54270020160700204E +:102C500010B50A4CA07E00280FD0607F28280CD128 +:102C6000022104F1290000F0BBFB0020A076BDE8A2 +:102C70001040FF210248F5F7A0BA10BD54270020EC +:102C8000541B002010B5094CA07E00280CD0607F9A +:102C90002E2809D106480088401E81B2054800F060 +:102CA00035F90020E077A07610BD00005427002001 +:102CB000DA060020551B002010B50A4CA07E002823 +:102CC0000FD0607F31280CD1032104F1290000F0DE +:102CD000F9FB0020A076BDE81040FF210248F5F77F +:102CE0006CBA10BD54270020541B002010B5074CAF +:102CF000A07E002808D0607F3E2805D104F129007D +:102D000000F03CF90020A07610BD00005427002000 +:102D100010B50A4CA07E00280FD0607F85280CD10A +:102D2000012104F1290000F003FC0020A076BDE899 +:102D30001040FF210248F5F740BA10BD542700208B +:102D4000541B0020044A81781170C078491C11700E +:102D5000801C507070470000160700200649087854 +:102D6000012808D148780C2803D20C3151F82000F2 +:102D70000047002008707047140700200249012016 +:102D8000087000F02BBC000014070020024900204E +:102D9000087000F023BC00001407002070470000FA +:102DA00009480021012280F82710C17080F8261000 +:102DB000C27680F820108171C18780F8221080F8D7 +:102DC000231080F8251070475427002070B5344830 +:102DD0004178012963D9334C217901295FD1192127 +:102DE000017000214170E07E01220221F9F760F9B3 +:102DF000E8B3B4F84000022846D394F8290004F15F +:102E0000290600F07F05A81E092815D2DFE800F08A +:102E1000053019141914141430002846F9F76EF906 +:102E200050B1B4F8400003212AE0324629461E483A +:102E3000FBF702FBB8B929E02079122101282BD138 +:102E400027E02846F9F75AF90028F5D0B4F84000F1 +:102E50000621F9F70DFAB8B1324629461248FBF7B8 +:102E6000EBFA032812D91049FBF7E6FE14E00FE055 +:102E70002846F9F743F90028DED0B4F840000221D3 +:102E8000F9F7F6F90028D0D1132102E0312100E052 +:102E90007F211920FBF7B4FE0A20A4F8440070BD7E +:102EA0006207002054270020A8290020144810B5EC +:102EB0004078012823D9134C207901281FD1B4F878 +:102EC0004000032814D3C10712D0032810D80E489D +:102ED000FBF714FB032803D30B49FBF7ADFE0BE014 +:102EE000B4F84C00A0F5E061853905D1312100E04E +:102EF00013212220FBF784FE1E20A4F8440010BDFD +:102F00006207002054270020A829002070B505463C +:102F100017480E464078012828D9164C20790128F8 +:102F200024D1E07E00220321F9F7C2F8B8B1032EC4 +:102F300001D2132114E0B61EB1B22846FDF7D6FD2A +:102F400008B101460CE00C486E21017029784170EF +:102F50006978817001460320FBF76EFE03E07F2154 +:102F60002E20FBF74DFE2820A4F8440070BD000081 +:102F70006207002054270020A829002070B50546CC +:102F800015484078012826D9144C0221B4F8400095 +:102F9000F9F76EF9C0B1287810F07F0F03D02079CF +:102FA00001280DD014E0F9F75DF988B10C487E21B5 +:102FB00001702978417001460220FBF73DFE07E0D1 +:102FC00000202071122100E013213E20FBF718FEA3 +:102FD0000A20A4F8440070BD620700205427002096 +:102FE000A82900202DE9F04707463C4841780129EF +:102FF00071D9102101703A4D002680464670B5F80F +:1030000040000221F9F734F988B307F07F04012C5E +:1030100007D0022C05D0032C03D0287901284ED0EC +:1030200054E0E87E4FF00109032804D0012814D0B1 +:10303000022817D013E0022C11D1F9F71FF950B173 +:10304000EC76FDF7C9FE85F80C90C82085F8009055 +:10305000A877782137E0222135E0022C08D0032C14 +:1030600008D001E0032C03D0012C05D006E029E0B4 +:103070007E2128E0EE7301E0FBF7FEFFEC76EE87A1 +:1030800085F82060AE71032C05D085F8226085F8A4 +:10309000236085F825603846F9F7E4F8B0B11148A7 +:1030A00050210170477086703221C17080F8049001 +:1030B000F421417106200B49FBF7BEFD06E02E719D +:1030C000122100E013211020FBF79AFD0A21A8F835 +:1030D0000410A5F84410BDE8F08700006207002046 +:1030E00054270020A82900202DE9F0410446234858 +:1030F0004178012940D9112101700026204D4670E8 +:103100001E2181802879012836D1B5F8400002219E +:10311000F9F7AEF848B3207800F07F00F8F7E6FF43 +:10312000E8B1F9F7ABF8C0B12078F9F79BF8154F83 +:1031300038B1512038702078787039460220FBF77A +:103140007BFD11480179012902D106713E707E7024 +:1031500001202870C820A8770BE0222106E02879FA +:10316000012806D12E71122100E013211120FBF756 +:1031700047FD0A20A5F84400BDE8F0816207002061 +:1031800054270020A82900202027002070B51D49C1 +:103190004A78012A35D914220A701E228A800178C1 +:1031A0004278090401EB02218078174C0D180122A6 +:1031B000E07E0221F8F77CFFE0B1B4F84000042182 +:1031C000F9F756F8A0B16FF07F40854208D1F9F7C2 +:1031D000C9F80E49542008700120FBF72DFD0DE0C1 +:1031E000B4F84C00A0F5E061853907D1312102E047 +:1031F000132100E07F211420FBF702FD0A20A4F830 +:10320000440070BD6207002054270020A829002038 +:103210002DE9F05FDFF8B4810024164698F801002C +:103220000D4601287ED96A4F387901287AD10122CA +:10323000F87E1146F8F73CFF002874D028784FF04C +:10324000010AA8F10209A346032806D00428B7F80A +:10325000400037D0022833D3B4E089F800B05E468E +:10326000B7F840000221F9F703F848B3F8780128CD +:103270000BD0584C4FF0670B84F800B02878607082 +:103280005548FBF7CFF810B195E037248FE097F859 +:103290002000012802D1B87901280FD04E480088BB +:1032A000608089F800A087F806A088F800B088F848 +:1032B000016048490420FBF7BFFC7CE06680F0E732 +:1032C000132474E00421F8F7D3FF0028F8D097F80E +:1032D0002600032807D899F8001011B1012908D059 +:1032E00009E0032800D3362499F80000A0BB242469 +:1032F0005DE089F800B03748D9460222C0F800B036 +:103300003549F4F77EFF40B333484178007801EB4C +:10331000002080B2FBF75DF869783170A978717090 +:10332000E97801E04CE04FE0B1702979F1702B4968 +:10333000020A0A70487002223046F4F762FF68B150 +:1033400097F82600FF2802D2401C87F82600C0B25A +:1033500002281ED8352426E028E023E01D4887F8FF +:103360002690672202702B784370287849460428FB +:103370000DD0022087F8210088F8002088F801107D +:1033800087F820A013490220FBF756FC0BE0012030 +:10339000F0E7032807D136243C2087F8270087F878 +:1033A00003A000E024240C48C0F800901CB1214682 +:1033B0002720FBF725FC1E20A8F80400A7F84400EE +:1033C000BDE8F09F1224F2E77F24F0E762070020B7 +:1033D00054270020A8290020AC060020AE060020BB +:1033E0002DE9F041344E044668203070334841786E +:1033F00001295ED9282101701E21314D81800122D1 +:10340000E87E1146F8F754FE40F28577E0B3B5F850 +:1034100040000321F8F72CFFB8B3F8F72FFFA8B34B +:1034200020784FF0000210F07F01607805D003296A +:1034300003D0287901282AD038E0012807D00328B2 +:1034400005D0B5F84C00B84230D131212BE011B194 +:10345000032907D00DE0012885F8222009D085F83E +:10346000232006E00121012885F8221001D085F8EB +:1034700023102078F8F7F6FEC0B1207870700E495E +:103480000220FBF7D9FB11E008E005E002E02A7119 +:10349000122108E0222106E0132104E0B5F84C00D7 +:1034A000B84203D17F212820FBF7AAFB0A20A5F808 +:1034B0004400BDE8F0810000A82900206207002038 +:1034C00054270020F8B506460020ADF80000154846 +:1034D0000D464178012923D931210170124C1E215A +:1034E0008180207901281BD10122E07E1146F8F766 +:1034F000DFFD40B16B460D4A29463046FDF7C4FB5F +:10350000010001D104E07F213120FBF779FB04E0C9 +:103510000649BDF80000FBF78FFB0A20A4F8440021 +:10352000F8BD00006207002054270020A8290020D1 +:1035300070B5044626484178012948D98521017093 +:103540001E21244D81800122E87E1146F8F7B0FD4E +:1035500078B3B5F840000221F8F78AFE38B3F8F7DF +:103560008DFE58B12078002100F07F00012807D09F +:10357000022808D02879012816D025E0222120E051 +:1035800085F8251002E0012085F825002078F8F75D +:1035900069FEC8B11048C52101702178417001460B +:1035A0000220FBF749FB0FE02971122109E01321EA +:1035B00007E0FFE7B5F84C00A0F5E061853903D1DD +:1035C0007F218520FBF71CFB0A20A5F8440070BD75 +:1035D0006207002054270020A82900200448002169 +:1035E00002220170427001228270818070470000C7 +:1035F0006207002010B5084CA07E00280BD0607F29 +:1036000000F00EF80020A0766077BDE81040FF21A2 +:103610000248F4F7D2BD10BD54270020541B0020EF +:10362000084910B5497801290BD9074C217901299E +:1036300004D1002121711121FBF7E2FA0A20A4F83C +:10364000440010BD62070020542700202DE9F041FE +:103650001446054669B1092927D133480178002964 +:1036600023D000210170BDE8F041FF212F48F4F77D +:10367000A4BD2F4902264878012806D0022814D17B +:1036800020782C4F102823D025E00D46097820788B +:1036900001F1400282420AD12046272904D1417813 +:1036A000012901D1FFF74EFB6E70BDE8F0817F2844 +:1036B000FBD160788142F8D1A078782804D0FFF758 +:1036C00065FB03206870F0E71E20A8800420F9E75E +:1036D0004E70607838772178174A184B7977002038 +:1036E000165C8E4208D1342901D0362902D1144902 +:1036F000098829B9587003E0401CC0B20C28EFD3E8 +:103700000C2801D10B2058700A4814212930064694 +:10371000F4F753FD1422611C3046F4F735FD012007 +:10372000B876A7F84050C0E7B5060020541B00202B +:10373000620700205427002024BB01081407002042 +:10374000DE06002001490120487070476207002012 +:1037500070B5154C40F22551204600F06AF900285A +:103760000ED0204600F0F2F9104AC1B2108A0304CC +:1037700006D444044FF0000306D50A2901D0138271 +:1037800070BD40F400400DE00D2909D0C0F30D04D8 +:10379000074D401C80B229551082C728EFD870BD54 +:1037A00040F48040108270BD003801407C0700204A +:1037B0005430002010B5044C0146204600F0CAF9F0 +:1037C00020880006FCD510BD0044004070B5304C88 +:1037D00040F225563146204600F02BF92D4D88B198 +:1037E000204600F0B3F96A8AC0B2FE2A04D22A4900 +:1037F0008854521C6A8201E00020688231462046CB +:1038000000F0C5F840F224463146204600F011F998 +:1038100040B1204600F09AF90120687031462046F8 +:1038200000F0B5F840F226652946204600F001F97F +:1038300018B12946204600F0AAF80821204600F0D9 +:10384000F1F8012806D10821204600F09DF8204615 +:1038500000F07CF90421204600F0E4F8012806D1AC +:103860000421204600F090F8204600F06FF9022174 +:10387000204600F0D7F8012808D10221204600F0A8 +:1038800083F82046BDE8704000F060B970BD0000CC +:10389000004400407C0700201C31002070B5314CF2 +:1038A00040F225563146204600F0C3F82E4D98B11F +:1038B000204600F04BF9EA8A0021C0B2C82A04D29F +:1038C0002A4B9854521CEA8200E0E982A982A9702E +:1038D0003146204600F05BF840F22446314620464F +:1038E00000F0A7F840B1204600F030F90120A870A0 +:1038F0003146204600F04BF840F226652946204626 +:1039000000F097F818B12946204600F040F8082149 +:10391000204600F087F8012806D10821204600F053 +:1039200033F8204600F012F90421204600F07AF81E +:10393000012806D10421204600F026F8204600F098 +:1039400005F90221204600F06DF8012808D1022176 +:10395000204600F019F82046BDE8704000F0F6B8A7 +:1039600070BD0000004800407C0700201A32002093 +:1039700010B5044C0146204600F0ECF82088000603 +:10398000FCD510BD00500040C943018070470A0AB1 +:1039900001219140C943018070470029818902D0EB +:1039A00041F4005101E021F4005181817047000091 +:1039B000174910B588420AD101218C032046FCF733 +:1039C00033FD2046BDE810400021FCF72DBD114914 +:1039D000884202D101214C0410E00F49884202D1F3 +:1039E00001218C040AE00D49884202D10121CC0456 +:1039F00004E00B4988420AD101210C052046FCF75E +:103A0000FBFC2046BDE810400021FCF7F5BC10BDD2 +:103A1000003801400044004000480040004C004095 +:103A2000005000400246002012880A4200D00120C7 +:103A3000704770B501F01F0501260024C1F3421341 +:103A400006FA05F2012B0FD0022B0FD0838A4FEA22 +:103A500011210088134206FA01F600EA060001D09F +:103A600000B10124204670BD8389F0E7038AEEE7A8 +:103A700010B5C1F3421301F01F040121A140012B35 +:103A800007D0022B07D01430002A026805D00A4361 +:103A900004E00C30F8E71030F6E78A43026010BD0E +:103AA00030B50446008A85B00D464CF6FF710840DB +:103AB000E98801432182A0894EF6F3110840A988C4 +:103AC0002A8911436A8902431143A181A08A4FF6D2 +:103AD000FF410840A9890143A1826846FCF7B6FC72 +:103AE0001948844201D1039800E00298A189090491 +:103AF00000EBC00101EB0010296801D5490000E08E +:103B00008900B0FBF1F06422B0FBF2F109010B096E +:103B10006FF018056B4300EB8300A3891D044FF081 +:103B2000320306D503EBC000B0FBF2F000F0070053 +:103B300005E003EB0010B0FBF2F000F00F000843CB +:103B4000208105B030BD0000003801408088C0F3FE +:103B500008007047C1F308018180704700F008B980 +:103B600000F08AB904480088034A0449121F1288E9 +:103B700042EA004088607047BC6C0040F4060020B8 +:103B800004F095BD04F0CCBD0A494FF0E02248682E +:103B900018B99069084B58434860926943F28563AD +:103BA00002441844486091B200EB800041EA0040B2 +:103BB00070470000F40600200DE37A05704700000E +:103BC000034900200978C90700D001207047000090 +:103BD0009E060020034900200978890700D50120AE +:103BE000704700009E0600200FB41FB50DF12301A1 +:103BF000069800909DF822208DF804200DF1050014 +:103C0000F4F7C2FA9DE80F0000F084F91FBC5DF8DC +:103C100014FB0FB585B000208DF808009DF8182022 +:103C200005998DF80A2000918DF809000DF1190110 +:103C30000DF10B00F4F7A8FA684603F06BF909B030 +:103C400000BD0000074810B50178002909D1012105 +:103C50000170FBF7C9FCF9F705FABDE81040F9F768 +:103C600015BB10BDF406002070B5FAF77FFC2B4D94 +:103C700001462B482A78F4F787FA2948697A883070 +:103C8000F4F79BFA2648297A7A30F4F796FA244812 +:103C9000A9795930F4F791FA22482A7881682048A6 +:103CA000F4F772FA1E4C012604F1250084F8226014 +:103CB000AA781DA18B34F4F767FA2A791EA1A4F122 +:103CC0004500F4F761FAEA791CA1A4F11F00F4F7AA +:103CD0005BFAEA781DA1A4F15700F4F755FA6A7966 +:103CE0001FA1A4F14000F4F74FFAE6705E202071A6 +:103CF0000020E071C8212172E07282212173E073FB +:103D00003C2020747820E0742820A0757D20607607 +:103D1000872020778C20E07770BD0000A2BA0108D0 +:103D20004C170020F4060020383037303030383857 +:103D300034414120200000004A374B0030312E3002 +:103D4000302E3031202020200000000030312E3075 +:103D5000302E3033202020202020202000000000A2 +:103D600031323334353637383930313200000000E3 +:103D700070B5F8F791FA3A4C217860F300013948B0 +:103D800021700078022803D241F00200207006E082 +:103D900021F00200207002D940F0040001E000F0A0 +:103DA000FB002070304A21784FF0000312F82B0FEF +:103DB00063F3041163F34511927821F0400162F33B +:103DC000C7112170617863F3000121F0020160F3F3 +:103DD000820163F3C30163F304116170A07820F0E2 +:103DE0000500A0704FF0010002F014FF1F4DE070BD +:103DF00095F8B900C0F341102071D5F8B500010F56 +:103E00006171010DA171000BE07195F8C60020727F +:103E100095F8C500607295F8C400A07295F8C300CB +:103E2000E07295F8C200207395F8C1006073B5F890 +:103E3000C900A935010AA173E0730D480D49406915 +:103E4000F4F74DFAF4F7ABFC207435F8A10C05211A +:103E5000B0FBF1F2B0FBF1F0120A6274A07470BD15 +:103E6000F9170020E60400203E2A0020FC0D002067 +:103E7000E8160020000020412DE9F041214C0127E7 +:103E8000207820B9FFF7F0FEFEF78AFF27701E4D5D +:103E90000026287890B1A87F18B1401EA877BDE809 +:103EA000F0812E70BFF34F8F18490868184A00F44C +:103EB000E06010430860BFF34F8FFEE76088401C4E +:103EC00080B26080022807D36680FEF757FFEF714B +:103ED0006E7600F055F8E680A088401C0004000CC7 +:103EE000A08004D0A680FEF739FFFAF747FEFEF760 +:103EF0000FFDFAF71BFDF8F79BF8BDE8F041FEF760 +:103F00004DBF000008070020542700200CED00E002 +:103F10000400FA050FB40098A0F5E061DF3907D07E +:103F2000A0F5E061853903D080B204B000F04CB850 +:103F300012480188322901D30021018002880099AA +:103F400000EB0212516002889DF8041000EB02128F +:103F5000117202889DF80D1000EB02125174018855 +:103F6000DDF8052000EB011141F8092FDDF80920EB +:103F70004A600188491C018004B07047FC2300207E +:103F80002DE9F0410D4C00260D4F0E4D10E032286A +:103F900000D366806088387004EB0010001D0FC8E5 +:103FA000FBF7A6FB6088401C60802868401C2860E6 +:103FB000218860888142EAD1BDE8F081FC2300209D +:103FC000000700200407002008490978C9070CD021 +:103FD000B0F58E6F09D10548801D016821F40031CC +:103FE000016002490020891F088170479E06002059 +:103FF0002DE9FE4F14460D460746FBF73FF8DFF864 +:1040000094C2A54E002F59D0012F7DD16046C07AB1 +:10401000002879D12878D5F8011040EA0120706194 +:10402000F5F7F0FFFBF72AF822469CA0716900F033 +:10403000B1FBD6E90501814267D0B061F169A4F115 +:104040000D0B01EB0B03C3F30A02D90A99A0F3612C +:1040500000F0A0FBFAF728F8318CF069DFF88492C1 +:10406000B1EBD02F0BD0C10A4844C70A3184FF02FC +:1040700039469DA000F08EFB3846F9F799FF4FEACC +:10408000EB710BEB9170C0F387082F1DA007B0F107 +:10409000804F0CD09BA000F07DFB28190322FF214C +:1040A0000938F4F783F808F1010000F0FF087A48B6 +:1040B0000024426AC1699144416271E02C793470F4 +:1040C0006A797270D5F806004FF6FF7800BA20F0D2 +:1040D000FF03687A0343736068893081297BD5F8D0 +:1040E0000D7041EA0721F1602D8A35824FF0FF37CC +:1040F000B7610027F7617762A6F820808CF80B7013 +:104100008DE82300214601E042E0BFE083A000F0FB +:1041100041FB3089328AF1688DE807007278317886 +:104120008D48736800F036FBBDE8FE4FF5F79CBF85 +:10413000002657F824104846F9F78EFF042808D0C7 +:10414000761CF6B2032EF4D3494684A000F022FB7D +:104150001BE0D9F800A01CB1A8F10100844206DBE5 +:1041600057F824205346494685A000F013FB57F822 +:10417000241051450ED08AA000F00CFB57F82420E3 +:10418000534649467EA000F005FB42490120C87213 +:10419000BDE8FE8F09F10409032E03D2641CE4B2CA +:1041A0004445C5D3FAF76AFF3A4E1FFA8BF1281D32 +:1041B000728CF6F739FA384D70840246298981A04D +:1041C00000F0E8FAFAF75AFFE968686988425BD1BB +:1041D0002889728C904204D0BDE8FE4F82A000F086 +:1041E000D9BA0024A8468AA000F0D4FA914D2846F6 +:1041F000F9F7DEFE904F28463946F9F72DFF0428DF +:1042000007D0641CE4B2032CF5D329468BA000F040 +:10421000C1FA2C68294623463A4659A000F0BAFA5A +:10422000BC421BD1834F002445463F1D3846696878 +:10423000F9F712FF042807D0641CE4B2032CF5D36D +:10424000394687A000F0A6FA3C68394623468EA07E +:104250006A6800F09FFA6868A04202D00120F072FC +:1042600096E7FAF70BFFF5F7CDFE90A000F092FA73 +:10427000BFF34F8F98490868984A00F4E0601043F4 +:104280000860BFF34F8FFEE7F9F7C4FEBDE8FE4FAD +:10429000FAF7F4BE7C0700202C3000200A0D43758D +:1042A0007272204261673A25642C206C656E20256D +:1042B000640A0D0057726974652D616464723A2056 +:1042C000736563746F722025642C2C6F666673654A +:1042D00074202564202C7265636C656E2025306423 +:1042E0000D0A0000006002083434437572722045E4 +:1042F000726173652D2D616464723A202530780DEA +:104300000A0000000A0D6C6173742D2D2D2D2D6295 +:104310006167212121212121210A0D000D0A363654 +:10432000365570642D2D747970653A2564202C768D +:1043300065723A25642C54627974653A25642C20A0 +:104340004372633A25642C5061673A25642C506CA3 +:10435000656E3A25640D0A00D4C501082132322168 +:10436000212121212121212157726974652D466166 +:10437000696C2D616464723A202530780D0A000062 +:1043800061646472202530782C2C57726974652022 +:104390002530782C2C72656164202530780D0A0058 +:1043A0000A0D207265616476616C20213D20557094 +:1043B00064646174615B695D2921212121210A0DF9 +:1043C00000000000313232557064486561642E4649 +:1043D000696C654372633D2530782C544372633DAC +:1043E0002530780D0A000000557064486561642E20 +:1043F00046696C6543726320213D205443726320FB +:104400002121212072657475726E210D0A00000051 +:104410002121217570642D696E666F2121205772EC +:104420006974652D746F74706167202564200D0AAE +:104430000000000000580208443322115570644403 +:10444000617461466C6167212057726974652D46FD +:1044500061696C2D616464723A202530780D0A0020 +:104460002121217570642D696E666F21212057729C +:104470006974652D4661696C2D616464723A20250A +:1044800030780D0A0000000031616464722025302C +:10449000782C2C5772697465202530782C2C726525 +:1044A0006164202530780D0A0000000032327570FA +:1044B000642D616C6C207772697465204F4F4B4B93 +:1044C00021217265737461727421212121212121BE +:1044D000212121210D0A00000CED00E00400FA0565 +:1044E00030B50D46094CC1B041F20D01A4F80510DC +:1044F00001462A46E01DF3F747FE658040AA69465B +:104500002046F8F787FE41B030BD0000723400202D +:1045100010B598B0142112A8F3F74FFE5A208DF869 +:10452000000001208DF8010088208DF80200184C51 +:1045300002208DF80300B4F80100010A8DF8041080 +:104540008DF8050006216846F7F7A2FA9DF80320CA +:10455000ADF84400694612A8121DF3F715FEBDF828 +:1045600044009DF8031013AA030A8B54521C88546C +:10457000B4F8190042F21072904202D2401CA4F822 +:10458000190012A8891DFCF723F818B010BD00000F +:1045900000170020FEE700002DE9F041204C002725 +:1045A000A078B0B1012824D1A7701E496069F3F743 +:1045B00096FEF4F740F91C4A1C4BF3F70CFFF4F796 +:1045C00065F91B49B0F1834F48611A4925DA0C207F +:1045D00024E01348E578C668142D0CD214480C3832 +:1045E000C088F4F7A0F83146F3F721FE6D1CE060B7 +:1045F000E570BDE8F08110493046F3F7A2FE6FF098 +:104600000B01F3F7DCFE0D49F3F769FEC4E9047012 +:10461000E760E7700120A070EBE718200870E8E77A +:10462000F4040020000030419A9999999999D93F52 +:10463000E81600203E2A00200000A04133335340FA +:10464000F0B593B00F4606460024254634221D4996 +:104650006846F3F799FD14221BA10DA8F3F794FD0A +:104660006A46315DA1F16100192801D8203906E0C0 +:10467000A1F14100192803D9303909291FD8C9B23D +:10468000A1F1410019280AD8002012F810308B42FD +:1046900002D102EB40014978401C1A28F5D30DA83D +:1046A000005D641C01FB0055112CDAD30B20B5FB17 +:1046B000F0F100FB11503870012013B0F0BD4FF045 +:1046C000FF30FAE748B20108080706050403020AAA +:1046D000000908070605040302000000074900203E +:1046E000086007490878401CC0B208701E2803D82B +:1046F00002497F200839086070470000082C0040FC +:104700005402002043E0322100BF00BF00BF00BFC1 +:1047100000BF00BF00BF00BF00BF00BF00BF00BFA1 +:1047200000BF00BF00BF00BF00BF00BF00BF00BF91 +:1047300000BF00BF00BF00BF00BF00BF00BF00BF81 +:1047400000BF00BF00BF00BF00BF00BF00BF00BF71 +:1047500000BF00BF00BF00BF00BF00BF00BF00BF61 +:1047600000BF00BF00BF00BF00BF00BF00BF00BF51 +:1047700000BF00BF00BF00BF00BF00BF00BF00BF41 +:1047800000BF491E11F0FF01BED1401EC0B200287B +:10479000B9D170470FB4054B10B503A9044A02986C +:1047A00000F0EEF810BC5DF814FB0000058801086D +:1047B000100B00200FB4084B10B504A902AA0398EF +:1047C00000F0DEF8044602A9002000F070FC20464C +:1047D00010BC5DF814FB0000AF50010802E008C8EF +:1047E000121F08C1002AFAD170477047002001E06B +:1047F00001C1121F002AFBD1704700002DE9FF5FA5 +:1048000082B00021DDE90430020DDDF840B0034341 +:1048100018D044F61050A2F2FF32424315141198FA +:1048200001281FD0A5EB0B00401C5FEA000A4FF0E7 +:1048300000064E4FDFF83891B046504615D5CAF104 +:10484000000413E0119801244AA3012801D16FEA62 +:104850000B010298119AC0E90031C0E9024206B08A +:10486000BDE8F09FCBF10000DFE704460021404A9D +:10487000491842EB0450CDE9001012E0E00707D0E0 +:1048800032463B4640464946F3F74CFE8046894651 +:1048900032463B4610461946F3F744FE06460F469D +:1048A0006410002CEAD1DDE90401DDE90023BAF14E +:1048B000000F06DAF3F736FE42464B46F3F732FEB8 +:1048C00005E0F3F7A1FE42464B46F3F79DFE044692 +:1048D0000E460022284BF3F7C1FF03D84FF0FF30FC +:1048E000014607E00022254B20463146F3F773FDD1 +:1048F000F4F708F9102409E0002C0ADB0A2200234F +:10490000F4F70AF8039B30321A55641E50EA01028C +:10491000F2D1641C039AC4F111031444119A012AC0 +:1049200003D0012208430DD10AE0084304D000203F +:104930004FF0110B119072E7A3EB0B056D1E0DE00C +:104940005B4504DD4FF0000205F1010504E003DAE8 +:104950004FF00002A5F10105002AECD00298119950 +:10496000C0E90231C0E9004579E7000000001440C9 +:104970000000F03F300000000000F0430000E03F86 +:104980002DE9FF4F95B09B468946064600250FE26C +:10499000252877D100242746F84A0121059400E014 +:1049A000044316F8013F203B01FA03F01042F7D10F +:1049B00030782A2811D06FF02F033078A0F1300220 +:1049C000092A16D8059A44F0020402EB820203EB8E +:1049D00042021044761C0590EFE759F8042B05922B +:1049E000002A03DA504244F40054059044F00204D3 +:1049F000761C30782E2816D116F8010F44F00404E6 +:104A00002A280DD06FF02F023078A0F13003092B47 +:104A100009D807EB870302EB4303C718761CF3E7BB +:104A200059F8047B761C30786C280FD006DC4C28B3 +:104A300017D068280DD06A2814D104E0742810D04B +:104A40007A280FD10DE044F400140AE044F48014F5 +:104A500001E044F440147278824202D104F58014DB +:104A6000761C761C307866280BD013DC582877D05B +:104A700009DC002875D04528F6D04628F4D0472810 +:104A80001AD19DE118E0632835D0642879D06528D3 +:104A900012D195E1702873D008DC6728F1D069281D +:104AA0006FD06E280DD06F2806D1B5E073282CD0BA +:104AB000752875D0782874D05A46179990476D1C80 +:104AC00075E1C4F30250022809D003280DD0D9F8AB +:104AD000001004280DD00D6009F1040967E1D9F830 +:104AE0000010EA17C1E90052F6E7D9F800100D806E +:104AF000F2E70D70F0E719F8041B8DF800100020A4 +:104B00008DF80100EA46012003E059F804AB4FF0AC +:104B1000FF3061074FF0000102D40DE008F1010100 +:104B20008846B9420FDA8045F8DB1AF808100029E8 +:104B3000F4D108E008F1010188468142FADB1AF855 +:104B400008100029F6D105985B46A0EB080721461E +:104B50003846179A00F094FA284400EB080507E05D +:104B60004DE029E10DE01AF8010B5A4617999047DC +:104B7000B8F10108F7D25B4621463846179A13E18F +:104B800042E00A220092C4F302524FF0000A022AC5 +:104B900008D059F804CB032A4FEAEC710AD00DE093 +:104BA00029E02AE009F1070121F00702F2E802C139 +:104BB000914609E00FFA8CFC4FEAEC71042A03D10C +:104BC0004FFA8CFC4FEAEC71002907DA0A46002103 +:104BD000DCF1000C61EB02012D2202E0220504D57C +:104BE0002B228DF80420012203E0E20701D02022CD +:104BF000F7E7904659E00A2102E010220DE010216B +:104C00004FF0000A00910BE010224FF0000A44F030 +:104C100004040827009203E008224FF0000A0092E3 +:104C2000C4F30252022A05D059F804CB0021032A0A +:104C300008D009E009F1070121F00702F2E802C1FA +:104C4000914605E01FFA8CFC042A01D10CF0FF0C00 +:104C50004FF00008220728D5702806D0009B83F06B +:104C6000100353EA0A0305D00EE040228DF8042019 +:104C7000012208E05CEA010206D030228DF804200F +:104C80008DF8050002229046009B83F0080353EA4A +:104C90000A030AD15CEA010201D1620705D530227C +:104CA0008DF804204FF001087F1E582804D034A04E +:104CB00003900EA802900DE036A0F9E75346604637 +:104CC000009AF3F729FE84460398825C0298401EFE +:104CD000029002705CEA0100F0D1029806A9081A5D +:104CE00000F1200A600702D524F4803400E0012797 +:104CF000574502DDA7EB0A0000E0002000EB0A01A7 +:104D0000009005984144401A0590E00306D45B46A4 +:104D10002146179A059800F0B3F90544002706E0EC +:104D200001A85A46C05D179990476D1C7F1C4745E6 +:104D3000F6DBE0030CD55B462146179A059800F098 +:104D40009FF9054404E030205A46179990476D1C9E +:104D50000099481E00900029F5DC08E002980299AD +:104D60005A460078491C0291179990476D1CBAF178 +:104D70000001AAF1010AF1DC65E100000928010047 +:104D800030313233343536373839616263646566C1 +:104D90000000000030313233343536373839414283 +:104DA000434445460000000000F058F90544761CD5 +:104DB000307800287FF4ECAD19B02846BDE8F08FBC +:104DC000620700D4062709F1070222F0070CFCE86D +:104DD0000223E14603F000485FEA080C02D00FF21C +:104DE000702C0DE05FEA045C02D50FF2682C07E03E +:104DF0005FEAC47C02D00FF2602C01E0AFF2700CCD +:104E00004FF0FF3823F00043CDF850C065280CD098 +:104E100006DC452809D046281DD047283DD13DE075 +:104E2000662818D067287ED138E00021112F01DBD9 +:104E3000112000E0781CCDE9000106A90EA8FFF7BB +:104E4000DDFCDDE90F010E9A03910021009207F1CC +:104E5000010A04914DE04FF000400097CDE90110A8 +:104E600006A90EA8FFF7CAFCDDE90F0203920E9B0C +:104E700011990022DDF80CA00093049211B9791C5D +:104E800000EB010AB7EB0A0004D4C0F1FF3007F1D0 +:104E9000010A0490AAEB0700019044E0012F00DA18 +:104EA00001270021112F01DD112000E03846CDE956 +:104EB000000106A90EA8FFF7A1FCDDE90F010E9A7B +:104EC0000391002104910092BA4621070CD4039962 +:104ED000514500DA8A46BAF1010F05DD009AAAF1C0 +:104EE0000101515C302908D0B84202DA10F1040FF8 +:104EF00006DA0121CDE9011015E0AAF10101E9E787 +:104F0000002805DC049901440491AAEB000102E0A9 +:104F1000411C514500DD8A460499401A401C01900D +:104F20004FF000400290200704D40198504501DB67 +:104F3000CDF8048000208DF84F0002980DF14F0746 +:104F4000B0F1004F25D02B200E9002984FF00208B0 +:104F500000280CDA404202902D200E9007E00A2132 +:104F60000298F3F7C3FC3031029007F8011DB8F145 +:104F70000001A8F10108F2DC02980028EFD1791EA7 +:104F80000E980870307800F0200040F0450007F8D7 +:104F9000020D12A8C01B00F107081498007800B198 +:104FA000012000EB0A01019801EBE07105984144F2 +:104FB000401A401E0590E00306D45B462146179A2E +:104FC000059800F05DF805441498007818B15A4629 +:104FD000179990476D1CE00324D55B462146179A2C +:104FE000059800F04DF805441CE00498002807DB04 +:104FF000DDE90301884203DD0098405C179901E078 +:10500000179930205A469047049805F10105401C35 +:1050100004900198401E019004D12E205A46179901 +:1050200090476D1CBAF10001AAF1010ADDDC05E030 +:1050300017F8010B5A46179990476D1CB8F10001FB +:10504000A8F10108F4DC5B462146179A0598ABE607 +:105050002D0000002B000000200000002DE9F04191 +:10506000044600251E461746880404D405E0394648 +:105070002020B0476D1C641EF9D52846BDE8F0819C +:105080002DE9F041044600251E469046C80301D58F +:10509000302700E02027880404D505E04146384643 +:1050A000B0476D1C641EF9D52846BDE8F0810A683A +:1050B000531C0B601070704770B58CB001F021FE6E +:1050C0000026304D27E09DF82C3008AA03A80A9945 +:1050D000F6F728F92C498DF81F6001208870079891 +:1050E00003AC009094E80F0000F010FE012810D1EE +:1050F0002448142203A91438F3F746F82248801CE8 +:10510000CDE901601F481438016900910FC800F013 +:10511000B3FDF9F7B3FF6C683CB30BAB08AA0AA95F +:105120000020A0470028CED11FE09DF82C3008AA0F +:1051300003A80A99F6F7F6F88DF81F60FEF740FD10 +:1051400030B1079803AC009094E80F0000F0E8FC41 +:10515000079803AC009094E80F00FEF745FD14217A +:1051600003A8F3F72AF8F9F789FFEC6934B10BAB20 +:1051700008AA0AA90120A0470028D6D101F0E2FC24 +:105180000CB070BD440F0020DC03002070B520215E +:105190001B48F3F712F81A4830213038F3F70DF8AE +:1051A00001F0A8FDF9F7B0FFF9F7E4FF144A15493B +:1051B000303A0020FAF704F810B113A0FFF7EAFA2A +:1051C0000F4A1049183A34390120F9F7F9FF10B1A4 +:1051D00013A0FFF7DFFA0A4D303DEC6824B100233D +:1051E0001A4619461846A0476C6A24B100231A468D +:1051F00019460120A047BDE8704000F0F9B9000051 +:10520000740F00207804002063616E3120D0ADD28D +:10521000E9B3F5CABCBBAFB3C9B9A60D0A0000001B +:1052200063616E3220D0ADD2E9B3F5CABCBBAFB377 +:10523000C9B9A60D0A00000010B54FF480710C48E2 +:10524000F9F7BCF888B14FF400710A48F9F7B6F8DD +:1052500058B109480078022807D0032805D004284F +:1052600003D006480078002800D0012010BD0000BF +:10527000000801400010014059020020AC04002049 +:1052800010B54FF400710448F9F798F808B1002000 +:1052900010BD012010BD000000100140034800783F +:1052A000032801D00020704701207047940F002090 +:1052B000704700002DE9F041CA4C002527462078B0 +:1052C00007F1200618374FF4FA6806287ED2DFE887 +:1052D00000F00305679EFDFC01207DE1A07820F031 +:1052E000B000A070C0484178F9B956214170F7F775 +:1052F00007F8032821D0F7F703F8F0B1F7F700F823 +:10530000002812DDF6F7FCFF03280EDA022000F079 +:10531000B1FA607820F003006070A07840F080005F +:10532000A07000F05FFA00F099FAB0480078012808 +:1053300009D0FFF7A5FF40B118E0052000F09AFA68 +:1053400000F092FAF1E70520CBE0FFF775FF68B1B6 +:10535000022000F08FFA607820F003006070A078DF +:1053600040F08000A07000F03DFA15E0FFF764FF08 +:1053700058B900F043F9002828D0607C002825D0D7 +:10538000607A00F00300022820D0607820F003004B +:105390006070032000F06EFABDE8F04100F05EBAE4 +:1053A000FFF76EFF10B100F029F970B9A06920B1C4 +:1053B00041463846FDF7FAF938B9607C002805D037 +:1053C000607A00F00300012800D100E0E6E0657497 +:1053D000032000F04FFA00F041FAFFF751FF68B1E7 +:1053E00000F00CF950B1607C40B1607A00F003002D +:1053F000022803D0607820F0030003E0607820F0FA +:105400000300401C6070BDE8F04100F0EBB9FFF70D +:1054100037FF0028607C18D018B1607AC04380073D +:1054200009D0A06978B341463846FDF7BFF950B3BB +:10543000FFF702FF38B3657400F010FA6078C143DB +:10544000890720D040F003001AE020B1607A00F014 +:105450000300012809D0A069A8B141463846FDF7EC +:10546000A5F980B1FFF7E8FE68B1657400F0F6F9C0 +:10547000607800F00301012905D020F00300401CF2 +:10548000607000F0AFF9FFF7D7FE30B9A06920B126 +:1054900041463846FDF78AF938B9607C00287DD04E +:1054A000607A00F00300022878D16574042000F0CF +:1054B000E1F9A07820F030001030A07000F092F9EF +:1054C0003046BDE8F041002101E044E001E0FDF795 +:1054D0006DB9206A58B164213046FDF767F930B1E3 +:1054E000012000F0C7F9BDE8F04100F0BDB9607CD3 +:1054F00010B1607A80070FD0FFF79EFE10B1FFF762 +:10550000BFFE48B100F07AF890B1607C80B1607A5B +:1055100000F0030002280BD06574607820F00300CF +:10552000607000F09BF9A07820F03000A07050E08F +:10553000FFF7A6FE002853D0FFF77EFE00284FD0CD +:1055400000F08CF9607840F003006070A07820F0E3 +:105550003000A07026E0E06938B1224841461C3096 +:10556000FDF724F900287FF4B7AE607C20B1607AA3 +:1055700000F00300012819D0FFF782FED8B1FFF731 +:105580005BFEC0B1607C20B1607A00F003000128AE +:105590000CD0607840F00300607000E020E065749B +:1055A00000F05CF900F01EF9032015E0607820F0AF +:1055B0000300401CF0E7FFF763FE002810D1FFF75F +:1055C0003BFE00280CD000F049F9607820F0030081 +:1055D000607000F007F90220BDE8F04100F04AB920 +:1055E000BDE8F081940F0020AC040020E504002009 +:1055F00024210148F2F7E1BD940F002010B54FF4CB +:1056000080710948F8F7DAFE58B14FF40071074885 +:10561000F8F7D4FE28B1F6F769FE401C01D000204F +:1056200010BD012010BD0000000801400010014025 +:105630001CB51B4C1B48217850F821201AA0FFF7FD +:10564000A9F8A07AC0F3011200F00F01CDE9001211 +:10565000617AC20901F00303617C1748FFF79AF8E9 +:10566000A078C0F301110091617800F00F0301F000 +:105670000302C10911A0FFF78DF818341FA094E8A8 +:105680000E00FFF787F8FFF7D7FD0446FFF7F8FD98 +:1056900002B022460146BDE8104021A0FFF77AB8CB +:1056A000940F0020B00400207374617475733A2560 +:1056B00064282573290D0A001CC301086E6D5F66FE +:1056C00072616D653A20414C3A2564204E657477CD +:1056D0006F726B436F6D6D616E643A256420636F0A +:1056E000756E7465723A256420636F6E74726F6CA8 +:1056F0005F7374733A25640D0A00000073615F7470 +:1057000069636B3A2025642074315F7469636B3A76 +:1057100025642074325F7469636B3A25640D0A0056 +:105720006170705F71697275695F6E6D5F616363EF +:105730005F6F6E5F636865636B3A202564206170FC +:10574000705F71697275695F6E6D5F414C5F636810 +:1057500065636B3A25640D0A0000000070B51F4CAC +:1057600040F212600026C4E900062672667202202A +:10577000A072FAF725FB1A4D18B1A87820F00F0097 +:10578000A870FFF759FD0028A87802D040F08000EB +:1057900001E020F08000A87055F8010F44F80B0FCD +:1057A0006868606003F038FD0D4D243570B16C6899 +:1057B000142C0BD204EB840005EB80011422074863 +:1057C0000831F2F7E1FC641C6C6001E02E606E6051 +:1057D000BDE87040014801F09DBB00002C0C00208A +:1057E000940F002070B51B4C40F212602060002026 +:1057F0006060207260720220A072FAF7E1FA164D22 +:1058000018B1A87820F00F00A870FFF715FD002848 +:10581000A87802D040F0800001E020F08000A8705D +:1058200055F8010F44F80B0F686860600A4C243487 +:10583000206814280BD200EB800004EB80001422B7 +:1058400004490830F2F7A0FC2068401C00E0142056 +:10585000206070BD2C0C0020940F00200021014816 +:10586000FCF7A4BFAC0F002000210148FCF79EBF4D +:10587000B00F002038B504460648074D234650F8BF +:1058800024100091297850F8212004A0FEF782FF0F +:105890002C7038BDB0040020940F002063616E208E +:1058A0006E6D3A20256428257329202D2D203E2059 +:1058B0002564282573290D0A0000000010B5194C35 +:1058C0006072A172002104F11400FCF76FFF012047 +:1058D0006074A07AA17860F30301A170A06968B137 +:1058E00040F2145104F11800FCF760FF30B1607A07 +:1058F00000F00300022801D0FFF774FF6078617A9E +:1059000000F0030001F00301884201D0FFF7D2FC50 +:10591000607A00F00300012803D1BDE81040FFF7D2 +:105920009DBF10BD940F002030B5164BA1B041F2C1 +:105930000B01154D0020A3F8051003F2EA2405EB36 +:10594000400100EB40022244B1F84010A2F81F10C1 +:1059500003EB4002401CD171090A80B21172282861 +:10596000EDD30A4950205880087C401C087408A0D8 +:10597000FEF710FF20AA69460248F7F74BFC21B05A +:1059800030BD000072340020FC0D0020F8350020EE +:1059900053656E642063656C6C2074656D70200ABD +:1059A0000D00000010B5244AA2B041F20C01A2F88B +:1059B000051002F2EA21214C91F89730002023F0E3 +:1059C00003035B1C23F0C00381F8973091F89830F3 +:1059D00094F82A4023F01F03240964F3451381F847 +:1059E00098300023A1F89930A1F89B3091F89D30B0 +:1059F00023F0FF0381F89D3091F89E3023F01F03C0 +:105A000081F89E300B181418401C93F8973080B220 +:105A1000E3710828F6D3082050800948017C491C0E +:105A2000017408A0FEF7B6FE20AA69460248F7F7FF +:105A3000F1FB22B010BD000072340020FC0D0020EC +:105A4000F835002073656E6420626D735F73746156 +:105A500074655F696E666F0A0D00000030B5284AF4 +:105A6000A1B041F20A010020A2F80510FF2302F2C2 +:105A7000EA2100EB40040C44401C80B284F8213041 +:105A80002828F6D31F4C0020A47E2834E4B200EB73 +:105A900040050D44401C80B285F821400828F6D30B +:105AA000002000EB40040C44401C80B284F83930E4 +:105AB0000828F6D3002000EB40040C44401C80B2C0 +:105AC00084F851300828F6D3002000EB4003141866 +:105AD0000B44401C93F8213080B2E3712828F4D3A2 +:105AE000094928205080087C401C087407A0FEF754 +:105AF00051FE20AA69460248F7F78CFB21B030BD61 +:105B000072340020FC0D0020F835002053656E64CF +:105B10002063656C6C2074656D70200A0D000000B8 +:105B20000FB414222DE9F04708A94E48F2F72CFBD8 +:105B30004C4E4FF4C0613068A0F58062693A58D08D +:105B4000A0F580626A3A54D0A0F580626B3A50D0DA +:105B5000A0F580626C3A4CD0A0F580626D3A48D0D6 +:105B6000A0F580626E3A44D0A0F580626F3A40D0D2 +:105B7000B0F58E6F46D0B0F5A86F43D0A0F5A06207 +:105B8000413A36D0A0F5A062423A32D0A0F5A062E8 +:105B9000433A2ED0A0F5A062443A2AD0A0F5A062E4 +:105BA000453A26D0A0F5A062463A22D0A0F5A062E0 +:105BB000473A1ED0B0F5A96F24D0B0F5AC6F21D014 +:105BC000A0F5A062663A14D0884214D0A0F5806295 +:105BD000033A17D0B0F5866F14D0A0F54072913A11 +:105BE00007D0A0F58062173A03D0B0F5807F09D0C6 +:105BF00033E0884206D11C490120087000211B486F +:105C0000FCF7D4FD1749142201F56A70F2F7BCFACB +:105C100080211748F8F7DBFB124D002405F52770AB +:105C2000DFF84880DFF84C902746048008F16008D0 +:105C3000296858F83420914206D108EBC400416825 +:105C400028468847C9F80B70641C64B21A2CEFD33D +:105C500014210448F2F7B1FA3760BDE8F0070020DC +:105C60005DF814FB600B0020E5040020AC0200206E +:105C7000001001403E2A00200FB470B5214D0A9C4F +:105C8000687814280BD200EB800005EB800014220A +:105C900004A9001DF2F778FA6878401C687005982E +:105CA00041F6EC4218490025B2EB104F10D19DF897 +:105CB0001B00102804D0132802D0112803D005E0BF +:105CC0009DF81E0001E09DF81C0088740A200EE07B +:105CD00041F6EB42B2EB104F0AD19DF81B008A7CD3 +:105CE000904203D1142008658D7401E032200865CC +:105CF000054800214C30FCF759FD257070BC5DF85B +:105D000014FB0000540C0020580200200FB4142291 +:105D100070B504A92748F2F737FA264D26484FF008 +:105D2000FF366C688461A0B2A0F57441563903D087 +:105D3000304670BC5DF814FB41F6EC41B1EB144FFA +:105D400003D0491EB1EB144F06D11A49142201F1B8 +:105D5000B800F2F719FAEBE718498C421AD0184943 +:105D60008C4217D017498C4214D017498C4211D05D +:105D700016498C420ED016498C420BD015498C42E4 +:105D800008D015498C4205D014498C4202D01449E0 +:105D90008C420CD10749142201F1F400F2F7F4F916 +:105DA0000449AA7A00230B31204600F069FC002048 +:105DB000BFE700004C0B0020D802002056F4261844 +:105DC00056F4011856F4071856F4081856F40A1039 +:105DD00056F4121856F41D1856F41F0856F41A10EB +:105DE00056F41A1810B5124C12490020C4E90001EB +:105DF0000421217260720520A072FF22082104F1A3 +:105E00000B00F2F7D3F9A4F12A020223508811887B +:105E10001371E172090AC0F57A6021736073000A98 +:105E2000A073E3732046BDE8104001F053B80000B2 +:105E3000180C0020F45610182DE9F0410546F4F72F +:105E4000B9FB3F4C042108220227002604F10B0075 +:105E5000012D57D0022D70D13A4BC4E90063217255 +:105E60006672A272FF220821F2F7A0F90120A4F1C4 +:105E70003705E07228882073000A60736888C0F5CF +:105E80007A60A073000AE073A8882074000A607426 +:105E9000A879A074204601F01DF80320F7F743FA13 +:105EA000E772E8882849000A2073287A6073A4F111 +:105EB0002A0040F6C313C07A00EB80004000A5F82A +:105EC0000900A073000AE073B1F8A600A0F2E9325D +:105ED0009A4211D31D4840F2A363B0F84200A0F2E9 +:105EE00009729A4208D3B1F88E01A0F6F121B1F5FA +:105EF000957F01D940F6B830A5F80B0080B2207428 +:105F0000000A13E0124BC4E9006321726672A272A8 +:105F1000FF220821F2F74AF91020E0720D202073C9 +:105F20006673A773FF20E073267406206074A6745E +:105F3000BDE8F041024800F0CDBFBDE8F0810000AF +:105F4000180C0020F456EB1C902A00205802002068 +:105F5000F456EC1C2DE9F04103463C4C0421082288 +:105F60000226002504F10B00012B19D0022B6AD167 +:105F7000374BC4E9005321726572A272FF220821D7 +:105F8000F2F714F90120E07232483349334A40688D +:105F9000A4F12A070144914218D2F2F700FC23E051 +:105FA0002F4BC4E9005321726572A272FF220821AF +:105FB000F2F7FCF81020E072092020736573A673D5 +:105FC000FF20E07325741120607436E01F482549D6 +:105FD000A438B0F81B00B0F5FA6F03D9B1F8592016 +:105FE000904201D3B1F88300A7F8050037F8050FF8 +:105FF0002073000A60737888C0F57A60A073000A85 +:10600000E073124837380088643840F48050B88014 +:106010002074000A6074B879A0740C4800F05AFF2C +:106020000320F7F780F9E672B7F807002073000A3B +:106030006073A573E57325746574A574BDE8F041BC +:10604000024800F047BFBDE8F0810000180C0020B6 +:10605000F456EB1CE8160020FFFF1EBBFFBF7900C3 +:10606000F456EC1C902A002070B50C4C05460C49E7 +:106070000020C4E900010421217260720220A07294 +:10608000FF22082104F10B00F2F790F8E572280ACC +:1060900020732046BDE8704000F01CBF180C0020A3 +:1060A000F45627182DE9F04F85B0054614216846AF +:1060B000F2F783F8764C082102270026042204F127 +:1060C0000B004FF0100B4FF00709012D7ED0022D71 +:1060D0007DD1704B9246C4E9006322726672A17250 +:1060E000FF22F2F763F84FF00108A4F1680584F885 +:1060F0000B802878207368786073A878A073E8789C +:10610000E073A8882074000A6074A879A0742046FF +:1061100000F0E0FE0320F7F706F9E772E888000ACE +:106120002073287A6073687AA073A87AE073E87A9B +:1061300020746674A674204600F0CCFE0320F7F7A6 +:10614000F2F80320E07284F80C806773287CA07357 +:10615000687CE073A87C2074E87C6074287DA0745F +:10616000204600F0B7FE0320F7F7DDF84A4890F824 +:10617000870101287ED0FF2211216846F2F716F828 +:1061800084F80BA0687D20736673A6739DF80000E9 +:10619000E0739DF8010020749DF8020060749DF882 +:1061A0000300A0743A4800F095FE0320F7F7BBF80F +:1061B0000520E0729DF8040020739DF805006073CF +:1061C0009DF80600A0739DF8070001E040E03CE068 +:1061D000E0739DF8080020749DF8090060749DF834 +:1061E0000A00A0742A4800F075FE0320F7F79BF818 +:1061F0000620E0729DF80B0020739DF80C00607380 +:106200009DF80D00A0739DF80E00E0739DF80F003F +:1062100020749DF81000607484F812B01C4800F0DF +:1062200059FE0320F7F77FF884F80B900A212173B9 +:106230000B21617384F80E90E020E073FF2020743E +:106240006074A074124800F045FE05B0BDE8F08F00 +:10625000124BC4E9006322726672A172FF22082108 +:10626000F1F7A4FF84F80BB031202073667384F833 +:106270000E9000E005E0FF20E07326746774A674BA +:10628000E0E70349142250396846F1F77DFF77E7CC +:10629000180C0020F456EB1C902A0020F456EC1C3D +:1062A00070B505460A4C0B480021C4E900100420D3 +:1062B000207261720120A072FF22082104F10B00FC +:1062C000F1F774FFE5722046BDE8704000F002BEB1 +:1062D000180C0020F456091070B5144C1449002015 +:1062E000C4E900010425257260720720A072FF2214 +:1062F000082104F10B00F1F759FF0E4801786420E2 +:10630000012911D0A4F12A01C97AE1724C2121732B +:106310006573B021A173E573207469206074BDE8D2 +:106320007040024800F0D6BDE072EFE7180C002084 +:10633000F4561C18820700202DE9F84FDFF8BC81C5 +:106340006F4A40464FF0000AC0E900A2042288F8D4 +:10635000082088F809A0072188F80A10FF220821E0 +:106360000B30F1F723FF674C674E684DA07D684FF7 +:106370004FF032094FF0550B012842D196F8B50085 +:10638000F2F7D1F900903946A868F1F750FF00996B +:10639000F2F798FA13D296F8B600F2F7C4F9009023 +:1063A0003946A868F1F743FF0099F2F795FA06D24B +:1063B0003946A868F1F73BFFF2F7F1F901E096F8EA +:1063C000B50020754F4847F23051A030FCF704FA71 +:1063D00001280DD1207D617D884204D9411AC9B2BE +:1063E000032900D2607547480021A030FCF7F4F97A +:1063F000207D322801D284F81590552801D384F8E5 +:1064000015B0A07D90BB96F8B500F2F78CF900901E +:106410003946A868F1F70BFF0099F2F753FA13D247 +:1064200096F8B600F2F77FF900903946A868F1F7C0 +:10643000FEFE0099F2F750FA06D23946A868F1F745 +:10644000F6FEF2F7ACF901E096F8B5002075C0B29F +:10645000322803D2484684F8149004E0552802D923 +:10646000584684F814B060750120A07596F8B50000 +:10647000F2F759F981463946A868F1F7D8FE49463E +:10648000F2F720FA13D296F8B600F2F74CF98146EB +:106490003946A868F1F7CBFE4946F2F71DFA06D255 +:1064A0003946A868F1F7C3FEF2F779F901E096F8EA +:1064B000B50020751748807E411E402901D2323038 +:1064C0006075052188F80B10617D0C484A1E88F81C +:1064D0000C20122288F80D20891E88F80E101C212D +:1064E00088F80F10054988F810A02A39097C09019D +:1064F00088F81110BDE8F84F00F0ECBC180C002033 +:10650000F456131858020020902A0020E8160020A4 +:1065100000004842FC0D002070B50C4C0C480025D2 +:10652000C4E90050042020726572A072FF22082185 +:1065300004F10B00F1F73AFE0520E0722573657354 +:10654000A5732046BDE8704000F0C4BC180C0020C4 +:10655000F45619102DE9F05F344FDFF8CCC0344CFD +:10656000FA8FDCF8380002F101018EB2798C314DDE +:1065700001F101035FEA80684FF47A794FF0020A73 +:106580004FF0030B9BB213D5FE870A2A02D220F0EC +:10659000200015E0B1FBF9F209FB12107B84012801 +:1065A0001BD125A017E02078C0BB84F800B035E0EF +:1065B0005FEA406817D5FE870A2A04D220F040001F +:1065C000CCF838002DE0B1FBF9F209FB12107B8406 +:1065D000012802D11EA0FEF7DDF828780028E2D1BC +:1065E00085F800A0DFE75FEA00681AD5FE870A2A6F +:1065F00002D220F08000E3E7207808B984F800B0E8 +:10660000287808B985F800A0B1FBF9F209FB12104F +:106610007B84012802D114A0FEF7BCF80020BDE85D +:10662000F09F0120FBE70000740B002058020020BF +:106630007C070020820700205265762053746F701B +:106640002063616E2064617461310A0D00000000F6 +:106650005265762053746F702063616E206461749C +:106660006120320A0D0000005265762053746F706D +:106670002063616E2064617461330A0D00000000C4 +:106680002DE9F04117460C460146594A00205A4D63 +:10669000DFF860C1C2F807000126A86BA1EB0C026D +:1066A000614551D021DC554AA1EB0206914276D0DA +:1066B0000ADC534A891871D0524AD1422FD121782D +:1066C000A97640F0080066E04F49711829D0B1F56D +:1066D000C02F24D11A4639462046F5F7ABF90028D9 +:1066E0001DD0A86B40F0020055E0B2F5202F48D035 +:1066F000B2F5901F53D0B2F5A81F5ED0B2F5F01FCF +:106700000DD121463A46032F00DD03223A48F1F726 +:106710003BFDA86B40F48040A8633C480672BDE88E +:10672000F0812178E97061782971A1786971E17847 +:10673000A9712179E97161792972A1796972E17987 +:10674000A97240F0010026E0218869826188A9824F +:10675000A1884FF47A6209B2914202DDA1F57A6113 +:1067600001E0C1F57A61E982E18809B2914202DD76 +:10677000A1F57A6101E0C1F57A61298340F0040056 +:1067800009E01A4639462046F5F724F90028C6D014 +:10679000A86B40F01000A863C1E700E01AE0217880 +:1067A00005F8231F61786970A178A970E178E97014 +:1067B00040F02000C5F81500B1E7217905F8341F35 +:1067C00061796970A179A970E179E97040F04000C0 +:1067D0006860A4E7217805F8271F61786970A178BF +:1067E000A970E178E97040F08000C5F8110096E7E3 +:1067F0003E2A002056F40818740B002056F41A1094 +:10680000AA0BE0F7000015F8000019F85802002064 +:1068100070B50F4C8318A34201D9032070BDA2B1FB +:10682000012500230BE004780E78A64204D0FF2C4B +:1068300001D0022070BD0025401C491C5B1C934206 +:10684000F1D3012D01D0012070BD002070BD0000EA +:1068500000000208F8B501210820F9F7D9FD03244A +:106860008DF8024014250F4F8DF803504FF48066C9 +:10687000ADF8006069463846F7F726FD8DF802400E +:106880007400ADF800408DF8035069463846F7F7BC +:106890001BFD31463846F7F79AFD21463846F7F793 +:1068A00096FDF8BD000C014010B5094C8318A342B9 +:1068B00002D80AB1002306E0012010BD10F8014BF8 +:1068C00001F8014B5B1C9342F8D3002010BD00007F +:1068D000000002082DE9F041884606461546224987 +:1068E0002844884202D90120BDE8F081C5B3E807F9 +:1068F00000D0551C2A4641463046FFF789FF002844 +:10690000F2D0012080F31088F7F7CEFB3520F7F79F +:1069100049FBF00AC002F7F74BFB07464FF47A70C9 +:10692000401E80B2FCD200240EE008EB440118F8AF +:106930001400497840EA01213046F7F773FB074617 +:10694000042804D1641CB61CB4EB550FEDD3F7F743 +:1069500061FB002080F31088042F02D00220C3E7DF +:10696000FFE70020C0E700000000020810B54FF06C +:10697000000140B1054C2046F4F716FF2046F4F71D +:10698000BBFC012010BD024CF5E700000068004090 +:106990000064004030B4022814D20B4A00EB80039C +:1069A00002EB83021569002D0CD00A7A8B7A042A37 +:1069B00006D00C6801F10B022146AC4630BC6047A2 +:1069C0004C68F7E730BC70479811002010B530B123 +:1069D0000448F4F776FF042800D1FF2010BD0248D8 +:1069E000F7E70000006800400064004030B402286F +:1069F00015D20C4A00EBC00302EB83040123E268CA +:106A00008B401A420BD09A43E260064A00EB8003A7 +:106A1000483252F82320002A01D030BC104730BC45 +:106A2000704700005011002010B518B1F4F7D8FAE3 +:106A3000012010BDF4F712FEFAE7000010B583281C +:106A400012D10A4C207C01280ED0A4F13000C16A7A +:106A500009B1012088470120207404480021BDE8C5 +:106A600010401430FBF7A2BE10BD0000740F0020D0 +:106A700070B5054600291CD10E4E002406EB04100B +:106A80000168A94203D100210C30FBF78FFE641C82 +:106A9000A4B2062CF2D30848817F002909D0017CDA +:106AA000022906D100218177BDE870401830FBF73C +:106AB0007DBE70BDE4030020740F0020044B00EB8A +:106AC000C00203EB820200219160FFF74FBF00007C +:106AD00050110020022811D2094900EB800201EB7D +:106AE00082018A68002A09D0054B00EBC001483BAF +:106AF00003EB8101C96801B1012110477047000013 +:106B00009811002010B50446022817D2F9F7F0FEBC +:106B10000B4804EB840100EB8100C16809B12046F9 +:106B20008847F9F7EFFE064804EBC401483800EB4C +:106B30008100C168002901D00021C16010BD0000A2 +:106B4000981100202DE9FF474FF000082F4FCDF896 +:106B50000880454607F13009CDF80C8009EB051493 +:106B60002078012802D002283AD045E0A0890628E2 +:106B700003D2274931F8101001E040F2E631201D20 +:106B8000FBF714FE58B3F9F7B3FEA08905EB4506F1 +:106B9000401CA08107EBC600D0F80CC0BCF1000F70 +:106BA00004D000231A4619462846E04702202070E8 +:106BB0008DF8088057F8366040463EB140F21261C9 +:106BC000CDE90010082302AA2846B047F9F79AFE3B +:106BD00004F108000021FBF7E9FD0120A0730BE0A0 +:106BE00004F108006721FBF7E1FD28B1F8F7C8FFC1 +:106BF000A4F80C8084F800806D1CEDB2022DADD39A +:106C0000FEF756FBFEF756FBBDE8FF87440F00205A +:106C10007CB20108024901EB001080897047000036 +:106C2000740F002038B5094CA0680090A289217823 +:106C300007486368FDF7AEFDA0690090A28B217C38 +:106C400004486369FDF7A6FD38BD0000740F0020FD +:106C5000C8C2010874C201082DE9F041022802D31C +:106C60000020BDE8F0810C4F00EBC00607EB860466 +:106C70000125A560002565712371E27027F82610B3 +:106C80002146E560FFF7D0FE18B10220A060012088 +:106C9000E7E7A560E4E700005011002070B5054665 +:106CA000022807D20D4805EBC50400EB8404A06858 +:106CB000022801D0002070BD04F110000646F4F750 +:106CC00051FB31462846FFF781FEFF28F3D0012211 +:106CD000E16882401143E16070BD00005011002066 +:106CE0000EB58DE807006946014804F0F8F80EBDBE +:106CF000B015002010B500F0A5F8BDE8104000F078 +:106D00004FB810B500F05EF8BDE8104000F0A4B830 +:106D100010B50C4A002102EB01131B6883420AD113 +:106D200002EB0110C16851B141680C30C91EFBF77C +:106D30003DFD20B910BD491C89B20629EBD30120C5 +:106D400010BD0000E403002030B54FF0FF34E8B17F +:106D5000124B002253F83250854208D103EBC20097 +:106D6000416011B9002043F83200002030BD521CB0 +:106D7000142AEFD351B1002253F8325045B103EB3E +:106D8000C2056D6825B1521C142AF5D3204630BDCA +:106D900043F8320003EBC2004160E6E73013002005 +:106DA00010B54FF426710648F1F707FA0449282375 +:106DB000A0310C2201F5F07004F069F8002010BD3C +:106DC000301300203EB5104C04F5207514E06946E0 +:106DD000284604F068F80021009A54F831009042E7 +:106DE00007D104EBC100436833B19DE80700984721 +:106DF00002E0491C1429EFD3284604F038F8002893 +:106E0000E5D000203EBD00003013002000280CD04B +:106E10000B4A002101EB410302EB83039B682BB17A +:106E2000491C89B21429F5D30020704701EB4103B6 +:106E300002EB83018860002042F823000846704777 +:106E4000C815002010B5F0210248F1F7B6F900206E +:106E500010BD0000C81500202DE9F8430021684648 +:106E6000FBF7A4FC009810B3012820D0DFF8448081 +:106E7000002505EB450008EB800458F82060A76862 +:106E800096B18FB1201D3146FBF790FC01280BD144 +:106E9000A06838B160680099091AB1FBF6F101FBEE +:106EA000060060602046B8476D1C142DE1D3002019 +:106EB000BDE8F883C8150020002803D002C00021D7 +:106EC000FBF774BC7047002803D00068002800D08E +:106ED000012070471CB50E490C68BCB1017A002333 +:106EE00004290DD00268CDE90023427A52B1002373 +:106EF000042909D0016800F10B020020A0471CBD45 +:106F00004268F0E7837AF3E74168F4E700201CBDAC +:106F1000440F00207CB504462B482C494069F1F70A +:106F2000DEF9F1F73CFC2A4B002580B299884A1C17 +:106F300092B29A800C2911D3642A01D964219980D4 +:106F40001A7801219AB1B0F5207F20D31D705A78AC +:106F50009AB140F22971884219D85D702068A0F575 +:106F6000E061953915D0FCF735FE60B111E040F2D3 +:106F70004E229042EBD2197009E040F23A729042F0 +:106F8000ECD9597003E02046F8F79EF908B10120CA +:106F90007CBD104886697EB1207A04280ED0216815 +:106FA000CDE90015617A59B1002304280AD021687F +:106FB00004F10B020120B04700207CBD6168EFE7BF +:106FC000A37AF2E76168F3E7E81600200000C84200 +:106FD000DC030020440F0020034800214FF4967288 +:106FE0000171028041807047500500202DE9F05F5B +:106FF000FA4E317EB068FAF71BF80546717EF068EC +:10700000FAF716F80446B17E3069FAF711F8022D46 +:1070100057D0DFF8CC830127F24E082D66D0092D1A +:1070200077D04FF0000A0A2D6DD04FF6FF7B4FF05E +:107030000A09102D68D0112D67D0122D77D0132D8D +:1070400076D00C2D75D00D2D74D0042D73D0162D47 +:1070500072D0292D71D02A2D70D02B2D6FD0502DAC +:107060006ED0512D6DD0522D6CD0532D6BD0542D30 +:107070006AD0552D69D0562D68D0572D67D0582D20 +:1070800071D0592D70D05A2D6FD0662D6ED01E2D17 +:107090006DD01F2D6CD1B6F85300A04269D24D4679 +:1070A000B4FBF5F2B4FBF5F1CFA0FDF773FBB6F836 +:1070B00053000A3880B2B0FBF5F1A6F89000D1A0D9 +:1070C000AFE3D94D012C08D0D8A0FDF763FB2846CB +:1070D000BDE8F05F2021F7F778B920212846F7F7BF +:1070E00076F9BDE8F05FD4A0FDF754BB022C07D0C1 +:1070F000D4A1D6A0FDF74EFB022C07D034B1D2E3C9 +:10710000D7A1F6E705E023E039E04DE086F86B40D3 +:10711000C9E3B24CD4A0E168FDF73CFB657E1021C9 +:10712000B048F1F74AF82A46AE48E1689FE053E0DC +:107130005DE06DE078E089E09CE0A6E0B5E0C0E0CD +:10714000CFE0DEE0F6E00FE125E129E12DE13FE3CC +:10715000012C0FD0C6A1C8A0FDF71CFB012C0BD041 +:1071600086F887A09FE34DE354E35DE364E39EE389 +:10717000E9E0A8E3C6A1EEE786F8877093E321462D +:10718000C5A0FDF707FBB6F8590004EB8401B0EB8E +:10719000410F04D90BEA4100A6F8830083E3B0FB5A +:1071A000F9F22146C1A013E02146CAA0FDF7F2FA88 +:1071B000B6F85B0004EB8401B0EB410F04D90BEA95 +:1071C0004100A6F885006EE3B0FBF9F22146C7A0A6 +:1071D000BDE8F05FFDF7DEBA2146D2A0FDF7DAFA8E +:1071E00004EB84010BEA4100A6F859005BE3214659 +:1071F000D0A0FDF7CFFA04EB84010BEA41004FF475 +:10720000FA71A6F85B008842ACD9A6F85B104AE395 +:10721000012C05D086F889A0CBA0FDF7BBFA42E38C +:1072200086F88970D0A0F8E7642C08D286F88A40E6 +:107230002146D4A0FDF7AEFA88F8007033E3D8A059 +:10724000FDF7A8FA5A2086F88A002CE3634DDAA0ED +:10725000E968FDF79FFA6C7E102C74D86148102104 +:1072600010300646F0F7A9FF22463046E968F0F7ED +:107270008BFF18E34846B4FBF0F109FB1142B4FB65 +:10728000F9F1A6F86340D1A0B9E2A4F10A005A28A6 +:1072900004D8E1B286F89310D3A0C2E22146DAA066 +:1072A000FDF778FA86F893A0FDE2A4F16400FA28CD +:1072B00004D8A1B2A6F8A610DDA0B2E22146E4A04F +:1072C000AFE2012C08D086F8A8A096F8A800012803 +:1072D00005D067A1EAA0A4E286F8A870F5E76CA142 +:1072E000F8E7012C08D086F874A196F874010128FB +:1072F00005D0EAA1EBA094E286F87471F5E7EEA15F +:10730000F8E7A4F5F07040F64801884202D2A6F8EA +:10731000754104E0B4FBF9F1EBA0FDF73BFAB6F8D8 +:1073200075014946B0FBF1F2B0FBF9F109FB12021D +:10733000EEA064E2A4F1650040F28331884203D2FA +:10734000A6F8774105E0B0E2B4FBF9F1EEA0FDF755 +:1073500021FAB6F877014946B0FBF1F2B0FBF9F13A +:1073600009FB1202F2A04AE2A4F10B008B2802D220 +:10737000A6F8794104E0B4FBF9F1F3A0FDF70AFAAD +:10738000B6F879014946B0FBF1F2B0FBF9F109FB1F +:107390001202F5A033E2E1B286F87B11F8A040E2D8 +:1073A000E1B286F87C11FCA03BE2A4F5F07040F25B +:1073B000E471884202D2A6F87D4104E0B4FBF9F101 +:1073C000FAA0FDF7E7F9B6F87D014946B0FBF1F206 +:1073D000B0FBF9F109FB1202F8E10000DC350020F6 +:1073E00069070020902A0020526571756972655006 +:1073F0006F7765722564206B7720203A25646B7760 +:107400000A0D000052657175697265506F7765727B +:10741000204175746F204C696D6974202564206B60 +:1074200077200A0D00000000001001404B4331207E +:107430006F70656E0A0000004B433120636C6F7300 +:10744000650A0000474232303131000050726F74DB +:107450006F636F6C547970652025730A000000001B +:107460004742323031350000736E3A25730A00000E +:1074700044697361626C6500517569636B4368614F +:10748000726765456E61626C652025730A000000B5 +:10749000456E61626C650000426D5265717569727E +:1074A00065566F6C742025640A000000426D5265B9 +:1074B0007175697265566F6C74256420426D734DE9 +:1074C0006178566F6C742564206661696C65640A26 +:1074D0000D000000426D73526571756972654375E8 +:1074E0007272656E742025640A0000000A0D426DF8 +:1074F000735265717569726543757272656E742039 +:107500002564204F76657220426D734D6178437516 +:107510007272656E74202564204661696C65640A28 +:107520000D000000426D734D6178566F6C7420251C +:10753000640A0000426D734D617843757272656E26 +:10754000742025640A000000747269636B6C6543E3 +:1075500068617267696E67536F63446973456E61F2 +:10756000626C65200A0D0000747269636B6C654380 +:1075700068617267696E67536F63456E61626C65BF +:107580000A0D0000747269636B6C65204368617258 +:1075900067696E6720536F6325640A0D0000000061 +:1075A000747269636B6C65204368617267696E67AA +:1075B00020536F630A0D0000626C7565746F6F7401 +:1075C00068206E616D653A25730A0000754261742A +:1075D0004D6178456E657267792025642E25646B50 +:1075E00077680A0D00000000526571756972655672 +:1075F0006F6C74616765446966666572656E636524 +:10760000202564560A0D0000526571756972655631 +:107610006F6C74616765446966666572656E636503 +:107620002D2D4F766572202564560A0D000000004E +:1076300053696D756C6174656443757272656E74BF +:10764000426174566F6C74202564560A0D00000068 +:1076500053696D756C6174656443757272656E749F +:10766000426174566F6C74202564562D2D4F7665DB +:1076700072203130302D333530560A0D00000000B5 +:10768000446562756720506167652066756E637436 +:10769000696F6E2025732020200A0D0065617379C3 +:1076A00000000000576F726B4D6F64656C2025738E +:1076B0002020200A0D00000070726F6665737369E8 +:1076C0006F6E616C00000000444352657175697211 +:1076D00065566F6C7425643A4F7665722834382D80 +:1076E000323630292020200A0D0000004443526524 +:1076F0007175697265566F6C743A25642E25642025 +:107700005620200A0D0000004443526571756972CD +:107710006543757272656E74202564413A4F7665D3 +:10772000722831302D31303041292020200A0D00BF +:1077300044435265717569726543757272656E7402 +:1077400020256441200A0D0044434D6178506F7735 +:1077500065722564203A4F76657228312D31306B81 +:107760002909200A0D00000044434D6178506F77CD +:1077700065723A25642E2564206B77090A0D000096 +:1077800044435F496E64756374616E636554656DEF +:1077900070202564200A0D0044435F494742545439 +:1077A000656D70202564200A0D00000044434D6182 +:1077B00078566F6C742564563A4F76657228343863 +:1077C0002D32303056292020200A0D0044A016E02A +:1077D000A4F1C800B0F5487F02D8A6F87F4104E0C4 +:1077E000B4FBF9F144A0FCF7D5FFB6F87F01494698 +:1077F000B0FBF1F2B0FBF9F109FB120247A0FCF774 +:10780000C9FF50E0962C01D286F8814196F881118B +:1078100049A006E0962C01D286F8824196F88211A2 +:107820004BA0FCF7B7FF3EE0022C01D286F8904156 +:1078300096F890114BA0F4E704EB84010BEA4100A9 +:107840004E4DA6F88E014E496868F0F77AFD8146E4 +:107850002046F0F768FF4946F0F73BFDF0F786FF5A +:1078600041B286F88D11002902DA494245A000E0B4 +:107870004BA0FCF78FFF96F98D0100F10901132948 +:1078800001D3286808E000EB80004000F0F742FFD9 +:107890006968F0F7CCFC2860F0F7CDFF02460B4694 +:1078A00046A0FCF777FF88F80070BDE8F09FA0B213 +:1078B0004946B0FBF1F2B0FBF9F109FB1202A6F860 +:1078C000530045A09BE7A0B24946B0FBF1F2B0FBE4 +:1078D000F9F109FB1202A6F8900045A08FE700001D +:1078E00044434D6178566F6C743A25642E256420AC +:1078F0005620200A0D00000044434D617843757204 +:1079000072656E7425643A4F7665722832302D3177 +:107910003030292020200A0D0000000044434D6132 +:107920007843757272656E743A25642E2564204121 +:1079300020200A0D000000004361706163697461DA +:107940006E636554656D7031202564200A0D00005A +:107950004443426F7854656D7032202564200A0DCF +:107960000000000043617061636974616E63655477 +:10797000656D7032202564200A0D0000E816002095 +:10798000000020410A0D48696768566F6C74616792 +:10799000654F66667365742D20256456200A0D00B8 +:1079A0000A0D48696768566F6C746167654F666653 +:1079B0007365742B20256456200A0D000A0D724849 +:1079C000696768566F6C746167654F666673657446 +:1079D00020256620200A0D004F766572506F77656E +:1079E00072203A25642E25646B77680A0D0000002A +:1079F0000A0D52657175697265506F7765723A2527 +:107A0000642E25646B77680A0D0000000D4810B5E0 +:107A1000017E8068F9F70CFBC0B201220A490128F7 +:107A20000DD000200860094941F8770F4860886050 +:107A30000748027007A0BDE81040FCF7ABBE09A0E4 +:107A40000A60F8E7DC35002078060020902A002044 +:107A500069070020656E636F6465636869700D0A6D +:107A6000000000006465636F646520636869700DE1 +:107A70000A0000000120FFF745B8000010B5094CCE +:107A8000217EA068F9F7D4FA617EE068F9F7D0FAB0 +:107A9000A17E2069F9F7CCFAFAF77CFE02490020B2 +:107AA000087110BDDC3500207C0700202DE9F05F57 +:107AB000504C217EA068F9F7BBFA8146617EE068F0 +:107AC000F9F7B6FA05464C4890F82B0010F0600F15 +:107AD00004D0BDE8F05F49A0FCF75CBEA9F130001E +:107AE0004F4E01274F4C4FF0020B4FF06408A22875 +:107AF0004DD8E81E4FF6FF7A61280AD805EB8501BC +:107B00000AEA4100A4F80B00294647A0FCF742FE10 +:107B100004E0A4F80B804AA0FCF73CFEB6F879011B +:107B2000A4F8070004F8017B86F897B104214E48B9 +:107B300006F27516F6F74BFC4C4909EB89000AEA88 +:107B400040024F74228108EB4000208005EB850045 +:107B500008EB4000A0800888A4F813004888A4F827 +:107B60001500FAF71DFE42480021C822077141485E +:107B7000017102804180208930803F496089708096 +:107B8000C8804946BDE8F05F3CA0FCF703BEB6F8EC +:107B90007D01A4F801004FF47A7AA4F805A0B6F8A4 +:107BA0007901A4F80700334DB946277000272F71DB +:107BB000C82028806F8004212B48F6F708FC2B484A +:107BC000C82180F8119086F897B12F7129806F80B5 +:107BD000A4F809A0A4F80B800188A1824088E08263 +:107BE000FAF7DEFD224981F804902349A1F806A0A6 +:107BF000BDE8F09FDC3500203E2A002046444320AB +:107C0000B7B4BDD3B9CAD5CF2CC7EBBCECB2E9BD74 +:107C1000D3CFDFBAF3D4DABFAABBFA0A0D00000053 +:107C2000902A002000170020444320C9E8B6A8CAC3 +:107C3000E4B3F6B5E7C1F720256420410A0D000042 +:107C4000444320C9E8B6A8B3ACB3F6B7B6CEA7286C +:107C5000332D31303041292CBBD6B8B4C4ACC8CF99 +:107C6000313041200A0D0000000C0140EE0B0020D5 +:107C70007C07002050050020FC0D0020444320C953 +:107C8000E8B6A8CAE4B3F6B5E7D1B9202564205612 +:107C90000A0D000010B5124C12A034F8591FFCF761 +:107CA00079FD618815A0FCF775FD1A480068F0F7AA +:107CB00076FD81B218A0FCF76DFD618D1BA0FCF76D +:107CC00069FDA18D20A0FCF765FDA07C022805D0F0 +:107CD00024A1BDE8104025A0FCF75CBD28A1F8E771 +:107CE000902A00200A0DD7EEB8DFD4CAD0EDB3E455 +:107CF000B5E7B5E7D1B925640A0D00000A0DD7EE46 +:107D0000B8DFD4CAD0EDB3E4B5E7B5E7C1F7256471 +:107D10000A0D0000E81600200A0DB5B1C7B0B2C9BF +:107D2000D1F9B5E7D1B925640A0D00000A0DD3C316 +:107D3000BBA7D7EEB8DFD0E8C7F3B3E4B5E7B5E744 +:107D4000D1B925640A0D00000A0DD3C3BBA7D7EE35 +:107D5000B8DFD0E8C7F3B3E4B5E7B5E7C1F725640A +:107D60000A0D0000C0CFB9FAB1EA00000A0DB5B1A2 +:107D7000C7B0B5E7B3D8D0ADD2E925730A0000008B +:107D8000D0C2B9FAB1EA000070477047F8B54FF4B5 +:107D900080715D48F6F712FB5C4D4FF4007168721C +:107DA0005B48F6F70BFBA8725A485B49406888426B +:107DB00001D15AA000E062A0FCF7ECFC664C206800 +:107DC000A0F5806169394FD064A0FCF7E3FC694FEE +:107DD00004213846F6F7FBFA6749012048744FF44E +:107DE0007A70F5F7A0FA65A0FCF7D4FC674CA068A0 +:107DF000F0F7D5FC81B266A0FCF7CCFCE068F0F7A8 +:107E0000CEFC81B268A0FCF7C5FC2069F0F7C7FC86 +:107E100081B26BA0FCF7BEFC6F4E70A03178FCF70E +:107E2000B9FC4FF480413846F6F7D1FA4FF4FA77AF +:107E30003846F5F778FA70A0FCF7ACFC6068F0F70C +:107E4000FAFC02460B4672A0FCF7A4FC2068F0F78F +:107E5000F2FC02460B4676A0FCF79CFC7D4960686C +:107E600088421FDD7CA01EE081A0FCF793FC8848BF +:107E70002668066061684160227A0272627A427204 +:107E8000A27A8272D4F80B20C0F80B20D4F80F200D +:107E9000C0F80F2002690092D0E902233046FFF7B4 +:107EA00039F894E77BA0FCF775FC30780C2817D0E4 +:107EB0007EA0FCF76FFC3846F5F735FA814800786C +:107EC00004280FD005280DD07FA0FCF763FC707844 +:107ED000062809D082A0FCF75DFC687A30B109E081 +:107EE00084A0E6E789A0F0E78EA0F4E792A194A031 +:107EF000FCF750FCA87A002805D1BDE8F8408EA117 +:107F000091A0FCF747BCF8BD000801407C070020A9 +:107F100000100140400C002056F426180A0DCAD566 +:107F2000B5BD63616E2031CED5CAD6B1A8CEC42C02 +:107F300063616EC7FDB6AFD5FDB3A30A0D000000A7 +:107F40000A0D20CEB4CAD5B5BD63616E3120B1A88B +:107F5000CEC40A0D00000000080F00200A0D20CE3C +:107F6000B4CAD5B5BD63616E32B1A8CEC43F0A0DA7 +:107F700000000000000C0140EE0B00200A0D20B1B3 +:107F8000D5BACFBCCCB5E7C6F70A0D00E81600207D +:107F90000A0DB5B1C7B0B0E5D7D3CEC2B6C8312D42 +:107FA0002D25640A0D0000000A0DB5B1C7B0B0E57B +:107FB000D7D3CEC2B6C8322D2D25640A0D000000DD +:107FC0000A0DB5B1C7B0B0E5D7D3CEC2B6C8332D10 +:107FD0002D25640A0D0000003E2A00200A0DB5B1CF +:107FE000C7B0B0E5D7D3CAE4C8EBB5E7D1B92D2DFA +:107FF0002564560A0D0000000A0D20B1D5BACFB88D +:10800000DFD1B933303056BCCCB5E7C6F70A0D0026 +:108010000A0D20B5B1C7B0B2C9D1F9B5E7B3D8B52B +:10802000E7D1B9256628302E3156290A0D00000007 +:108030000A0D20B5E7B3D8D0A3D7BCBAF3B5C4D0E6 +:10804000E8C7F3B5E7D1B9256628302E3156290A9D +:108050000D000000000091430A0D2020626D73B0F6 +:10806000E5B8DFD1B9B5E7D1B9D5FDB3A30A0D00A5 +:108070000A0DCAD5B5BD63616E32B1A8CEC42C63FA +:10808000616E32C7FDB6AFD5FDB3A30A0D00000087 +:108090001C0F00200A0D2020626D73B0E5B8DFD1FF +:1080A000B9B5E7D1B9D2ECB3A30A0D000A0D20206F +:1080B000626D73B0E5B5CDD1B9B5E7D1B9D2ECB346 +:1080C000A30A0D00F83500200A0DC0B6D1C0C4A324 +:1080D000BFE9CEB4CDA8D0C5C9CF0A0D00000000BD +:1080E0000A0D2067756E5F706C7567696E3132209E +:1080F0000A0D00000A0D2020626D73B0E5B5CDD1E8 +:10810000B9B5E7D1B9D5FDB3A30A0D000A0DC0B6C4 +:10811000D1C0C4A3BFE9CDA8D0C5D5FDB3A30A0D76 +:10812000000000000A0D2067756E5F706C7567694E +:108130006E36200A0D00000077616B6575700000D7 +:10814000412B2025730D0A004143432025730D0A5E +:108150000000000001210248017002A0FCF71ABBD8 +:10816000AC040020675F746573745F616C203D2010 +:1081700025640D0A0000000008B500216846FAF7E2 +:1081800015FB04A00099FCF705FBFEF74BFDFDF77E +:108190004FFA08BD7469636B203D2025640D0A0009 +:1081A00070B590B00C4640216846F0F706F8184BC1 +:1081B0005878401C587017482178C27E8A420CD0EB +:1081C0000025012907D05A7A561C5E72052A04D967 +:1081D000C1765D7201E05D72C17634F8011F49BA63 +:1081E00020F81C1F618849BA4180A18849BA818062 +:1081F000A17928390173E1792839417321894181B5 +:10820000A17A28398173E17A2839C17310B070BD21 +:1082100018050020001700202DE9F047DFF89C80AA +:1082200098F80000012813D1254F264D264E4FF017 +:108230000009308806280BD30CD14FF0C801204824 +:10824000EFF7BBFF88F80090A6F80090A5F80A9019 +:10825000BDE8F0876889384401785A2927D14178E8 +:10826000012924D1C178402921D8021D8B5C421DEF +:108270008A5C091D03EB022294B2F3F709FCA042C9 +:1082800015D169897818041DC77839446981318806 +:10829000C91B3180807801F021F8E8610028D7D02F +:1082A00043683A462146BDE8F047002018476889F0 +:1082B000401C68813088401E3080BAE77F0700206C +:1082C000AA33002018050020980700202DE9F05F50 +:1082D0004FF47A717B48FAF769FA01287ED1DFF80A +:1082E000E881D8F80400F0F75AFA764C81B2103CD5 +:1082F000A088F3F706FC0126642805D9D8F8040005 +:10830000F0F74DFAA080E68070492078CA7E82425C +:1083100001D02270E680DFF8B891637899F8000008 +:10832000834201D06070E680C88C2389984201D0D6 +:108330002081E680E0780A23B0FBF3F503FB15000B +:10834000012802D0E08801287ED10027E7808A46F4 +:108350000D4609785FA0FCF71DFAAA8BB5F8091045 +:1083600064A0FCF717FAEA8BB5F80B1068A0FCF7CD +:1083700011FA6A8C298C6DA0FCF70CFA7348418FB6 +:1083800073A0FCF707FAE98C99F8002073A0FCF7BA +:1083900001FA02F061FDE8B1DFF8DCB1774DA770BA +:1083A000A17815F8310003090BEB430200F00F032D +:1083B000B2F82B2006FA03F0024205D005EBC1000B +:1083C00041686FA0FCF7E6F9A078401CC0B2A0702D +:1083D0001028E5D35546BAF8260000E06FE0D8B182 +:1083E000DFF8B0A1A770A0781AF83020110905EBCA +:1083F000410102F00F02C98C06FA02F2114205D0C7 +:108400000AEBC00041685FA0FCF7C4F9A078401CEB +:10841000C0B2A0701028E6D399F800004E46B0B163 +:10842000A770284F0C37A078327817F83010914297 +:1084300005D107EBC000416857A0FCF7ABF9A07865 +:10844000401CC0B2A07000E033E01428EBD34446D7 +:10845000D8F81000F0F78AF907B2E068F0F786F96B +:1084600006B2A068F0F782F901B23B4632464EA050 +:10847000FCF790F995F8292015F8281F52A0FCF771 +:1084800089F9EA78A97859A0FCF784F96068F0F7CF +:10849000D2F90B465A4902465AA0B1F81B10FCF714 +:1084A00079F96069F0F7C7F902460B465DA0FCF761 +:1084B00071F9BDE8F05F00210248FAF777B9BDE82D +:1084C000F09F000010000020E81600200017002098 +:1084D0007C0700204D6F64756C6520737774696349 +:1084E00068202025642073746174652025640D0A5A +:1084F00000000000766F6C742074617267657420F0 +:108500002564206E6F77202564200D0A000000008E +:108510006375727220746172676574202564206EC1 +:108520006F77202564200D0A00000000696E7075C9 +:10853000745F766F6C7420256420696E7075745F4B +:10854000637572722025640D0A000000FC0D002086 +:10855000424D535265712020256400006661756CA0 +:1085600074636F646520256420726561736F6E208B +:1085700025640D0A000000003E2A00207805002036 +:108580004644435F6661756C74636F646520257350 +:108590000D0A0000F805002073746F705265617356 +:1085A0006F6E2025730D0A0054656D7031202564AF +:1085B0002054656D70322025642054656D70332021 +:1085C00025640D0A000000004D6F64756C5F5465F2 +:1085D0006D7020256420496E64756374616E6365F7 +:1085E0005F54656D702025640D0A000074656D7020 +:1085F000332025642074656D70342025640D0A00D5 +:10860000740B002043445A20566F6C74202564205C +:108610002020494E5055545F566F6C742025660DCE +:108620000A00000043445A20417578696C69617200 +:108630007920506F77657220566F6C742025660D17 +:108640000A0000002DE9F04104460E460D20FAF71D +:1086500087F90A20FAF784F9002510E02078F6F768 +:10866000E5F901462078F6F7D9F907460846FAF702 +:1086700077F93846FAF774F96D1CADB2641CB5424F +:10868000ECD30D20FAF76CF9BDE8F0410A20FAF7B7 +:1086900067B9002242F6E06304E01946491EFDD1A5 +:1086A000521C92B28242F8D37047FEF7D3B82DE93C +:1086B000F04115460C460746F6F79AFCA020F6F75F +:1086C0006DFCF6F7BDFC98B9200AF6F767FCF6F7E3 +:1086D000B7FC68B9E0B2F6F761FCF6F7B1FC38B95F +:1086E000F6F786FCA120F6F759FCF6F7A9FC20B1B5 +:1086F000F6F794FC0020BDE8F08100246E1E09E02E +:10870000B44201D0012000E00020F6F719FC3855F2 +:10871000641CA4B2AC42F3D3F6F780FC0120EAE774 +:108720002DE9F04116460C46074600252AE035B1F2 +:10873000E00618D1F6F772FC0620F4F7F4FDF6F720 +:1087400057FCA020F6F72AFCF6F77AFC88B9200A35 +:10875000F6F724FCF6F774FC58B9E0B2F6F71EFC05 +:10876000F6F76EFC28B9785DF6F718FCF6F768FCAA +:1087700020B1F6F753FC0020BDE8F081641C6D1CAD +:10878000A4B2ADB2B542D2D3F6F748FC0120F3E76C +:1087900070B541F288311848FAF708F8012829D154 +:1087A000164CE07E01281FD1134DE18B203D288B14 +:1087B000814219D016D2F3F7A4F9C82812D90E496C +:1087C00001201831087148880A2804D20C4A32F86E +:1087D0001000088003E0C8200880092048804888ED +:1087E000401C4880E08B2883BDE87040002102488F +:1087F000F9F7DCBF70BD000038050020001700202D +:1088000020BA010870B5104C0546C1B22046FBF7EE +:10881000A1F920880006FCD50C4890F8A800012892 +:1088200010D10B48807802280CD10A4C0A48217AD2 +:10883000962903D24554491C217203E0FBF750FEF0 +:1088400000202072284670BD004C0040902A002075 +:10885000F83500207C070020302F002010B50028BC +:1088600021D0114B0022001F196803E0814203D878 +:108870000A4649680029F9D152B11368841A9C420A +:1088800004D1006818441060104602E0506000E017 +:10889000186039B102680B1A934203D10B681A446D +:1088A00002604968416010BD140B002000B5F0F76C +:1088B000D9FA0520FFF7EDFEF7F77AFF0149888026 +:1088C00000BD00007C06002070B505460846F5F79F +:1088D0003FFF040062D00420812D2CD00CDC042D3D +:1088E00017D0802D5AD194F85400032856D3E16C48 +:1088F000002953D0802043E0822D13D0832D4DD109 +:1089000094F85410032949D394F8911002292DD0DA +:1089100033E094F85400032840D32046BDE870406B +:10892000F6F7ADB994F85400032837D3E16C002969 +:1089300034D0822024E094F8541003292ED394F8E4 +:10894000911002290DD194F8901094F8442091428E +:1089500000D2032084F89100227804210120FEF740 +:10896000BFF9E16C002919D0812009E084F8910059 +:10897000227804210120FEF7B3F9E16C19B18320BC +:10898000BDE870400847207800F031FB2078BDE852 +:10899000704000231A46194600F073BB70BD70B5D5 +:1089A0000D460446F5F7D4FE00281ED090F854304A +:1089B000022B06D8C168002917D02046BDE87040B8 +:1089C0000847812B0AD0002D0FD1802180F8541048 +:1089D0002246BDE870400120FEF782B9002D04D088 +:1089E000812180F854102246F3E770BDFFF7D7BF0E +:1089F00010B50446F5F7ACFE002813D090F85410DB +:108A0000022906D8C16800290CD02046BDE81040D4 +:108A10000847832180F854102246BDE81040012009 +:108A2000FEF75EB910BD00002DE9F0411D46164667 +:108A30000F468046F5F78CFE040030D094F85400C1 +:108A400003282CD3802802D1032084F8540094F802 +:108A50004000C00706D0A36C0BB32A463146384607 +:108A600098471CE00F48691E2A46076005710729D0 +:108A700003D83146401DEFF787FB04F15800094940 +:108A8000054602F02CFA284602F0F9F938B18220A6 +:108A900084F85400014642460120FEF721F90120E6 +:108AA000BDE8F0812013002010B50C46F5F750FE0C +:108AB000002815D090F89110E2B2022901D00329C4 +:108AC0000ED190F8981091420AD1052180F89110AA +:108AD00090F85410032903D3BDE81040F6F7CFB83F +:108AE00010BD0020401C80B23C28FBD37047000022 +:108AF00010B50E4C627852B1002161702170E068AF +:108B00000A22B0FBF2F080B22081E16010BDFFF7D5 +:108B1000CDFEE1680844E0602078411C21700928FE +:108B200001D301206070208910BD00007C06002068 +:108B300086B0F1F70DFBFBF715F84FF4004162B674 +:108B40000803F6F747FDF8F781FE6846F7F77EFC65 +:108B5000F6F7F0FCF6F72CFC40F2CF2140F2F310D0 +:108B6000F8F7E6FEFFF7A1FDF0F740F8F0F79EF901 +:108B70007C48C06802F0D0F94FF4E13002F028FAE6 +:108B80004FF4165002F084FAF6F784FA4021764842 +:108B9000F5F71DFC02217548F5F719FCFCF7F6FA0C +:108BA000F5F7A0FEF8F75CFAF2F7F8F870A0FBF71B +:108BB000F1FD76A0FBF7EEFD7B497CA0FBF7EAFD1B +:108BC0007E4D0A24B5F859005335B0FBF4F17CA072 +:108BD000FBF7E0FD2889B0FBF4F17FA0FBF7DAFD9D +:108BE000288EB0FBF4F182A0FBF7D4FD688EB0FBB9 +:108BF000F4F186A0FBF7CEFD2888B0FBF4F18AA043 +:108C0000FBF7C8FD287E533D022834D08BA18DA0F0 +:108C1000FBF7C0FD95F897118FA005F27515FBF7CE +:108C2000B9FD2888B0FBF4F194A0FBF7B3FD688888 +:108C3000B0FBF4F197A0FBF7ADFD2889B0FBF4F190 +:108C40009AA0FBF7A7FD6889B0FBF4F19DA0FBF7A4 +:108C5000A1FDA888A5F27515B0FBF4F19FA0FBF764 +:108C600099FD5648EFF7C6FA102806D25349A0A03E +:108C7000FBF790FD0DE0A3A1C9E7A4A0FBF78AFDD7 +:108C80000024A6A0295DFBF785FD641CE4B2102C2E +:108C9000F7D3F7F7FFFCF7F7B3FCA14A002485F8F8 +:108CA000A840506820F007019EA05160FBF772FDBC +:108CB000A04DF9F7A7FDFCF7FFF9287801281FD090 +:108CC000687801282ED0A878012831D0E8780128CA +:108CD0003ED0287901283DD0687901283ED0E87936 +:108CE0000128E6D14102EC719348F5F76EFBF6F7E7 +:108CF00023FDF1F771FDF8F779FDFAF7A3FFD8E747 +:108D00002C70F1F70DFD8D480078012801D0F0F7A7 +:108D10004DF9F5F793FEFFF7D9FAFBF73DFCFAF7AB +:108D20001FFFC6E76C70FFF777FAF6F7A7F9C0E701 +:108D3000AC70F2F70BFFF1F7E3F80220F5F726FD30 +:108D40007F4948600860FAF709FFF6F7ADFDB0E724 +:108D5000EC70AEE72C71F6F7FBFAAAE7F3F7A8FF81 +:108D60006C71A6E7000000200010014000080140DF +:108D70000D0A4150502070726F6772616D207275DC +:108D80006E6E696E67202E2E2E0D0A000D0A20735E +:108D90006F6674776172652056657273696F6E3A9B +:108DA00020200D0A0000000030BB01080D0A20B091 +:108DB000E6B1BEBAC53A2025730D0A00902A0020FC +:108DC0000D0AD7EEB4F3B3E4B5E7B5E7D1B93A206D +:108DD00025640D0A000000000D0A20D7EEB4F3B39D +:108DE000E4B5E7B5E7C1F73A2025640D0A000000B5 +:108DF0000A0DD3C3BBA7D7EEB8DFD0E8C7F3B3E4FF +:108E0000B5E7B5E7D1B925640A0D00000A0DD3C353 +:108E1000BBA7D7EEB8DFD0E8C7F3B3E4B5E7B5E753 +:108E2000C1F725640A0D00000A0DD3C3BBA7D7EE16 +:108E3000B4F3B9A6C2CA25640A0D0000C0CFB9FABE +:108E4000B1EA00000A0DB5B1C7B0B5E7B3D8D0ADEF +:108E5000D2E925730A0D00000A0D5379735061722F +:108E60006150696C65442E536F6353696D756C6115 +:108E7000547970652025640A0D0000000A0D4443F2 +:108E80004443D0E8C7F3B3E4B5E7B5E7D1B9256407 +:108E90000A0D00000A0D44434443D0E8C7F3B3E48D +:108EA000B5E7B5E7C1F725640A0D00000A0D444394 +:108EB0004443D7EEB4F3B3E4B5E7B5E7D1B92564DD +:108EC0000A0D00000A0D44434443D7EEB4F3B3E463 +:108ED000B5E7B5E7C1F725640A0D00000A0D444364 +:108EE0004443D7EEB4F3B9A6C2CA25640A0D000004 +:108EF0000A0DC9E8B1B8B5C4736EBAC53A25730A8C +:108F000000000000D0C2B9FAB1EA00000A0DC9E8B9 +:108F1000B1B8B5C4736EBAC53A0A00002563200023 +:108F2000002004E056616C7565203D2025640D0A23 +:108F300000000000802A0020000C01408007002073 +:108F4000E8160020F0B50B30154D20F00701002485 +:108F5000144A0FE003688B420BD38B4205D95E1A8B +:108F600043184768C3E9006700E04368136002C024 +:108F700004E0021D10680028ECD12046002802D130 +:108F8000286808B10020F0BD064A07481060074A6B +:108F9000121A22F00702C0E9002401202860D7E756 +:108FA000180B0020140B002004380020005800206B +:108FB00070B53AB10C4B84189C4203D8A3F50074E9 +:108FC000A04202D24FF0FF3070BD31B1002302E069 +:108FD000CD5CC5545B1C9342FAD3011B92B289B29B +:108FE000FAF7D0FD002070BDA8290020704770B5A9 +:108FF0000546F5F7ADFB040003D094F854000228B1 +:1090000001D8002070BD022084F85400E16809B145 +:109010002846884794F8910018B3D4F8A8204AB994 +:1090200006E00428D4F8A4000AD00321904718E0F1 +:10903000226DB2B10528F4D10021D4F8A400F5E7DF +:109040000121F3E73146284601F02DFF68B1D4F83D +:10905000A8200AB9226D42B10321D4F8A400904798 +:1090600003E004F1940604F17005284601F0FFFEC8 +:109070000028E7D0202104F19000EFF79EF80120AE +:1090800070BD2DE9F0411D4616460F468046F5F7A6 +:109090005FFB04002CD094F85400012828D9D4F8A0 +:1090A00004C0BCF1000F23D02B463246394640465F +:1090B000E047E8B1D4F88C1031B194F8453018226B +:1090C00004F1700001F0E3FE94F84000C00709D1FC +:1090D000D4F8881031B194F84530102204F15800CA +:1090E00001F0D5FE032084F854000120BDE8F08192 +:1090F0000020FBE710B5F5F72BFB002801D090F816 +:10910000540010BD2DE9FF411E4615460F46F5F7E8 +:109110001FFB04000ED094F8540002280AD94DB168 +:1091200094F84000C00705D104F15800804601F0D2 +:109130009EFE18B1002004B0BDE8F08169464046AB +:1091400001F0B1FE0028F6D0009838609DF80400C8 +:1091500030709DF80420501E072804D828460DF1D1 +:109160000501EFF711F894F85400822802D103208A +:1091700084F854000120DEE72DE9F04786B01D4653 +:10918000DDE90E9816460F46F5F7E2FA04000BD01B +:1091900094F85400022807D9082D05D804F170006E +:1091A000824601F06CFE18B1002006B0BDE8F087E1 +:1091B000F7F79EFB94F85400832801D0032802D2CD +:1091C000F7F7A0FBF0E7CDF8148000978DF8055075 +:1091D000CDF8109016B900208DF805009DF80520F7 +:1091E000501E072804D831460DF10600EEF7CCFFDB +:1091F000FF208DF804006946504601F070FE94F897 +:10920000910010B92046F5F73AFDF7F77BFB0120F6 +:10921000CBE7002070470000044803C8814201D317 +:1092200000207047401AC0B270470000B80F0020FD +:1092300070B51C48C17A1C48462902D24FF4FA6125 +:1092400001E04FF47A710184184991F897110129CE +:1092500018D1174D174B002695F8291001F003027D +:109260001978012A08D0C28B541CC483048CA242F2 +:1092700003D9A1B90F2011E0C68395F839201AB19E +:10928000A0F84060012070BD30F8402F541C20F839 +:10929000204900888242F5D909B9102018700020B1 +:1092A00070BD0000EE0B002058020020902A002024 +:1092B000FC0D00207C07002005480A6840F82E2F8E +:1092C00049684160024903A02E31FBF763BA0000F0 +:1092D000001700200A0D20257320000010B504237C +:1092E000094A002112F83140844206D1074B002080 +:1092F000A3F8190002EBC10010BD491CC9B2994284 +:10930000F0D3002010BD00005805002000170020F9 +:109310002DE9F04F93B0044640216846EEF74DFF2B +:109320004FF0000AADF844A04FF6FF7BFE4D85F8E4 +:1093300010A0B4F80580A8F5004020381ED0A8F58C +:10934000004021381AD0DFF8E4930127F84EB8F531 +:10935000004F7DD05CDCB8F5D06F01F04A8549DC68 +:10936000B8F5607F6ED03EDCB8F1800F70D0B8F5F4 +:10937000C07F68D0B8F5207F32D18BE06688274661 +:10938000B6F5967F05D8E8483246E11D3830EEF74D +:10939000FBFEE54831463830FFF754F9B81930F88C +:1093A000024CB01E81B23846F1F754F90746024626 +:1093B0002146E0A0FBF7EEF9BC4201D0E3A044E077 +:1093C000D94908F1E00885F811A008F0FF003246FD +:1093D0003831FAF70DFEE549642008840420A870AE +:1093E00013B0BDE8F08FB8F5906F64D0B8F5B06FEA +:1093F000F6D178E0B8F5286F22D0F1DCB8F5F06F3F +:109400001ED0B8F5086F1BD0B8F5186FE8D117E07B +:1094100048F20701A8EB0100884511D009DC6FF480 +:10942000004040440628DBD2DFE800F02B344345FF +:109430005DFD032804D0D3DC012801D00228CFD160 +:1094400002E005E035E01CE0C9A0FBF7A3F9C7E79F +:10945000E079012801D0CDA0F7E7AF7086F87670EB +:1094600046F86CAFB249C6F804A0A6F808A0A068F8 +:109470003060E0687060AF7089F800706C31C8A02F +:109480005AE2E079012801D0CDA0DEE70220A870E1 +:10949000CFA0DAE7E179D3A0FBF77CF9D648D4F87E +:1094A000091040F8011FB4F80D108180E17B817133 +:1094B00096E7D2A0C9E7D7A0FBF76CF9207A01287C +:1094C0000FD0DAA1DBA0FBF765F9207A002887D15D +:1094D000A648022181710178002981D104210170FF +:1094E0007EE7D7A1EEE7DFF8848288F80770E0799D +:1094F000A0B1D5A0FBF74EF9E079012810D00028E3 +:10950000A5D1277AD4A03946FBF744F9D74A88F881 +:1095100005700D2F01F0158401F017BCD4A0E9E708 +:10952000257AD7A02946FBF735F9012D7CD0022DED +:109530007BD004F109001090042D77D0072D76D050 +:10954000062D75D0082D74D0092D73D00A2D72D038 +:109550000B2DADD00C2D6FD00D2D6ED04FF00A0815 +:109560000E2D6BD00F2D6AD0102D69D0112D68D023 +:10957000122D67D0132D66D0142D65D0162D7DD0F9 +:109580001D2D7CD01E2D7BD01F2D7AD0202D79D083 +:10959000212D78D0222D77D0232D76D0242D75D073 +:1095A000252D74D0262D73D0272D72D0282D71D063 +:1095B000292D70D02A2D6FD02B2D6ED0302D6DD04F +:1095C000312D6CD0322D6BD0332D6AD0342D69D033 +:1095D000352D68D0362D67D0372D66D0502D7BD0F5 +:1095E000512D7AD0522D79D0532D78D0542D77D05B +:1095F000552D76D0562D75D0572D74D0582D73D04B +:10960000592D72D05A2D71D0602D70D0612D6FD030 +:10961000622D6ED0632D6DD0642D6CD0652D6BD016 +:109620006D2D6AD011E0C9E252E163E176E186E195 +:109630008DE196E1ADE1C0E1C9E1D3E1E0E1EDE129 +:10964000F7E117E22DE239E24BE240F22F226E2DD4 +:1096500054D06F2D53D0702D52D0712D51D0722D0A +:1096600050D0732D4FD0742D4ED0752D4DD0762DFA +:109670004CD0772D4BD0782D4AD017E057E263E2DB +:1096800072E281E29BE29BE29BE29BE29BE29BE235 +:109690009BE29BE29BE29BE29BE29BE29BE29BE2E2 +:1096A0009BE29BE29BE29BE29BE29BE2792D30D026 +:1096B0007A2D2FD07B2D2ED07C2D2DD07D2D2CD012 +:1096C0007E2D2BD07F2D2AD0802D29D0812D28D002 +:1096D000822D27D0832DDBE085E285E285E285E2DD +:1096E00085E285E285E285E285E285E285E285E242 +:1096F00085E285E285E285E285E285E285E285E232 +:1097000085E285E285E285E285E285E285E285E221 +:1097100085E285E285E285E285E285E285E285E211 +:1097200085E285E285E20000F83500206907002027 +:10973000902A00200A0D44637263202530782C564D +:10974000637263202530780A0D0000000A0D20287E +:109750004463726320213D20566372632920726541 +:109760007475726E21212121210A0D007C070020D1 +:109770005265636569766520444344432073746190 +:1097800074652061636B0A0D0000000072656769F3 +:10979000737465726564206661696C65640A0D00A6 +:1097A0007265676973746572656420737563636558 +:1097B000737365642C436F64652025730A0D000084 +:1097C0004C6F67696E204661696C65640A0D000024 +:1097D0004C6F67696E205375636365737365640AC4 +:1097E0000D000000686561727420636F756E7420EF +:1097F00025640A0D000000002C0B002072656365D3 +:109800006976652073746174652064617461200AEF +:109810000D0000007265636569766520636861729A +:1098200067652064617461200A0D000044697361FA +:10983000626C65006368617267652025730A0D00BC +:10984000456E61626C650000706172616D207772B7 +:109850006974650A0D0000005265616420706172D0 +:10986000616D206E756D2025640A0D007234002034 +:10987000706172616D20726561640A0D0000000004 +:10988000706172616D20616464722025780A0D0038 +:1098900073D0842D72D0852D71D0862D70D0872DF8 +:1098A0006FD0882D6ED0892D6DD08A2D6CD08B2DE8 +:1098B0006BD08C2D6AD08D2D69D08E2D68D08F2DD8 +:1098C0007FF4C5ADB4F80910A6F8DA11D9A0E8E321 +:1098D000607A40B9022288F8062098F8002012B970 +:1098E000042288F80020012802D0D8A1D9A023E0C2 +:1098F000DCA1FBE7617ADD4C012907D0DCA0FAF797 +:1099000049FF04212046F4F760FD69E5DCA0FAF781 +:1099100041FF04212046F4F75AFD61E50446EEF7C5 +:1099200069FC82B2102A214605D2D948EEF72CFCF8 +:109930002146D8A0CBE7DCA0FAF72CFF50E5647AEB +:10994000E0A02146FAF726FFA6F869405AE1647ABA +:10995000E3A02146FAF71EFF26F84D4F7480B4802D +:10996000F4E7607A022803D086F86B70E2A080E307 +:10997000022086F86B00E6A0F9E7F0E3F0E3F0E3FD +:10998000F0E3F0E3F0E3F0E3F0E3F0E3F0E3F0E33F +:10999000F0E30446EEF72EFC82B2102A21460AD2EA +:1099A000BB481038EEF7F0FB2146DFA0FAF7F2FED5 +:1099B00089F80070CAE7E2A089E7607A012803D03D +:1099C00086F887A0E5A0D2E786F88770FAE7607A84 +:1099D000012803D086F889A0E6A0C8E786F8897038 +:1099E000ECA0C4E7617A642903D286F88A10F1A05A +:1099F0006DE7F6A0FAF7CEFE5A2086F88A00A5E7B2 +:109A0000647A4046B4FBF0F108FB1142B4FBF8F174 +:109A1000F4A0FAF7BFFE86F88B4097E7647AF7A0C8 +:109A20002146FAF7B7FE04EB8400400086F88C006C +:109A30008CE7B4F80940F7A02146FAF7ABFEB6F878 +:109A4000592004EB8400B2EB400F04D90BEA40002C +:109A5000A6F883007AE704EB84004100F1A0FAF74E +:109A600099FE36F8590F143880B2B0FBF8F17085C2 +:109A7000F3A061E7B4F80940F6A02146FAF78AFEA0 +:109A8000B6F85B2004EB8400B2EB400F04D90BEA7C +:109A90004000A6F8850059E704EB84004100F2A0DD +:109AA0008CE2B4F80940F6A02146FAF773FE04EB05 +:109AB00084010BEA4100A6F8590047E7B4F80940D1 +:109AC000F4A02146FAF766FE04EB84010BEA41009C +:109AD0004FF4FA71A6F85B00884290D9A6F85B10A3 +:109AE00034E7647AF0A02146FAF754FEF34D286873 +:109AF000EEF755FE81B2F2A0FAF74CFEF5488178F8 +:109B0000202901D920218170C9B201EBC10100EBEC +:109B100041012A68C1F80320817801EBC10100EB03 +:109B20004101A1F807408178491C817058E4B4F8DC +:109B300009004146B0FBF1F2B0FBF8F108FB12025C +:109B4000A6F86300E4A029E2607A012803D0022885 +:109B500001D0E7A079E486F88D00012802D0EAA1BF +:109B6000EAA0B4E6EEA1FBE7607A00EB80010BEA25 +:109B700041004146B0FBF1F2B0FBF8F108FB1202E4 +:109B8000A6F85300E7A009E2B6F89000B6F8531023 +:109B9000627A884211D94446B1FBF4F2B0FBF4F189 +:109BA000E6A0FAF7F7FDB6F853000A3880B2B0FB2A +:109BB000F4F1A6F89000ECA089E6E1E12BE3EEE1F8 +:109BC000FFE10EE212E21EE22AE232E23AE261E252 +:109BD00068E276E285E295E2A1E2B1E2B5E2B9E2BD +:109BE000C9E2DBE2EBE2F7E207E315E315E315E395 +:109BF00015E315E315E315E315E315E315E315E3A5 +:109C000015E315E314E214E314E314E314E314E39B +:109C100014E314E314E314E314E314E314E314E38C +:109C200014E314E314E314E314E314E314E314E37C +:109C300014E314E3536F6343616C69627261746986 +:109C40006F6E202025642020200A0D006469736156 +:109C5000626C65006368617267696E672025730ACC +:109C60000D000000656E61626C650000000C014033 +:109C70006F70656E2072656C61790A0D00000000DE +:109C8000636C6F73652072656C61790A0D0000006A +:109C9000A02A0020626C7565746F6F7468206E6115 +:109CA0006D652025730A0D00626C7565746F6F74A5 +:109CB00068206E616D65206D697374616B65202528 +:109CC000730A0D0048656172742042656174205406 +:109CD000696D6520256420207365630A0D0000000E +:109CE0004F76657254656D7056616C75652025649C +:109CF0002020200A0D000000424D532050524F54A6 +:109D00004F43414C204742323031310A0D000000B0 +:109D1000424D532050524F544F43414C2047423202 +:109D20003031350A0D000000537973506172615073 +:109D3000696C65442E736E3A25730A0D00000000AD +:109D40005379735061726150696C65442E736E2053 +:109D50006661756C742025730A0D00005175696386 +:109D60006B2043686172676520456E61626C650AAD +:109D70000D000000747269636B6C6520436861724A +:109D800067696E6720536F6320456E61626C652062 +:109D9000300A0D00747269636B6C652043686172F0 +:109DA00067696E6720536F6320456E61626C652042 +:109DB000310A0D00747269636B6C65436861726788 +:109DC000696E67536F6325640A0D000074726963DE +:109DD0006B6C654368617267696E67536F632039A6 +:109DE000300A0D00747269636B6C6520706F776563 +:109DF000722025642E25646B770A0D0074726963E6 +:109E00006B6C652063757272656E742564410A0D12 +:109E100000000000426D734D6178566F6C742564CC +:109E2000200A0D00256420426D734D6178566F6CD9 +:109E300074202564206661696C640A0D00000000CE +:109E4000426D52657175697265566F6C7420256438 +:109E5000200A0D00426D734D617843757272656E14 +:109E600074202564200A0D00726571202564206F1E +:109E7000766572206D6178202564200A0D0000004F +:109E8000426D734D6178566F6C74202564200A0D05 +:109E900000000000426D734D617843757272656E0B +:109EA000742564200A0D000073657474696E672060 +:109EB000736F63282564290A0D000000E81600204E +:109EC0004241545F566F6C746167652025640A0DCA +:109ED00000000000EC2C0020754261744D61784553 +:109EE0006E657267792025642E25640A0D000000D6 +:109EF0004368617267696E674D6F6465204661757E +:109F00006C740A0D00000000435600004368617243 +:109F100067696E674D6F64653A2573200A0D00000E +:109F2000434300004F766572506F776572203A2583 +:109F3000642E25646B77680A0D0000005265717508 +:109F4000697265506F776572202564206B77204FAA +:109F5000766572506F776572203A25646B772C6650 +:109F600061756C740A0D00005265717569726550F7 +:109F70006F776572202564206B77200A0D00000042 +:109F800002EB82010BEA41004146B0FBF1F2B0FB6B +:109F9000F8F108FB1202A6F89000B1A096E3607AEF +:109FA00000EB80010BEA41006421B0FBF1F201FB00 +:109FB0001202B0FBF1F1A6F8B300B0A0FAF7EAFB89 +:109FC000A3E4607A00EB80010BEA41006421B0FB5E +:109FD000F1F201FB1202B0FBF1F1A6F8B100AEA064 +:109FE00074E3617AA6F8B710B2A070E4B4F809007F +:109FF0004146B0FBF1F2B0FBF8F108FB1202A6F803 +:10A000005F00B0A062E3B4F809004146B0FBF1F292 +:10A01000B0FBF8F108FB1202A6F85900B0A055E316 +:10A02000647AB4A02146FAF7B5FB323486F8B5401D +:10A030004EE3647AB6A02146FAF7ACFB323486F8D8 +:10A04000B64045E3607A86F8B000012810D00228B7 +:10A0500010D0032810D0042810D0052810D00628CE +:10A0600010D0072810D0082810D0FF2810D02FE3D8 +:10A07000AEA0D4E3B3A0D2E3B8A0D0E3BEA0CEE3B9 +:10A08000C3A0CCE3C8A0CAE3CDA0C8E3D4A0C6E374 +:10A09000D9A0C4E3B4F80900A6F85D00B0FBF8F15C +:10A0A000DBA0D8E2617AA1F10A005A2803D886F829 +:10A0B0009310DCA0CFE2E4A0FAF76CFB86F893A043 +:10A0C00006E3B4F8091040F6C412A1F57A70904284 +:10A0D00005D8A6F8A610B1FBF8F1E1A0BBE2E8A014 +:10A0E000B9E2607A012808D086F8A8A096F8A800FE +:10A0F000012805D0ECA1EEA0ADE286F8A870F5E746 +:10A10000F2A1F8E7B4F809004146B0FBF1F2B0FB68 +:10A11000F8F108FB1202A6F86300EEA0D6E2B4F84C +:10A12000090000EB80010BEA41004146B0FBF1F26F +:10A13000B0FBF8F108FB1202A6F88E00EBA0C5E216 +:10A14000617AA6F84D10F0A0EBE3617AA6F84F1003 +:10A15000F3A0E6E3617AA6F85110F7A0E1E3EDE39E +:10A16000EDE3EDE3EDE3EDE3EDE3EDE3EDE3EDE36F +:10A17000EDE3EDE3EDE3607A012809D086F892A0E3 +:10A1800096F89200012806D0AFF66011F0A0C8E35F +:10A1900086F89270F4E7AFF65811F7E71121F2480C +:10A1A000EEF70BF8F04854F8091F953840F8951F62 +:10A1B0006168416021890181ECA01099B1E3EA480E +:10A1C00054F8091F953840F89F1FA1888180A17914 +:10A1D0008171ECA01099A4E3607A012808D086F878 +:10A1E00074A196F87401012805D0EEA1EFA098E3C0 +:10A1F00086F87471F5E7F2A1F8E7B4F80910A1F157 +:10A200003000FC2806D201EB81010BEA4100A6F8E0 +:10A210007501E0E1DCE19DE3E8E102E217E21BE227 +:10A220001FE239E255E25DE265E277E289E29BE214 +:10A23000B5E2D1E2E3E2FAE20BE31AE31FE323E340 +:10A2400028E32CE330E334E339E33DE341E345E342 +:10A2500049E34DE351E355E359E35DE368E37AE312 +:10A2600052657175697265506F776572203A256421 +:10A270002E25646B77680A0D00000000426174525D +:10A2800061746564566F6C74616765203A25642E4D +:10A290002564560A0D0000004261744D61784368E0 +:10A2A00061726765566F6C203A25642E2564560AE4 +:10A2B0000D000000426174436F756E74203A25648E +:10A2C0000A0D0000546F74616C43617061636974BE +:10A2D00079203A25642E256441480A0D00000000CB +:10A2E000426D734D6178566F6C743A25642E256407 +:10A2F000760A0D00754261744D617854656D705039 +:10A300006C75733530203A2564200A0D000000007A +:10A31000754261744D696E54656D70506C7573351E +:10A3200030203A2564200A0D000000007563426168 +:10A3300074547970653AC7A6CBE1B5E7B3D8200A63 +:10A340000D0000007563426174547970653AC4F879 +:10A35000C7E2B5E7B3D8200A0D000000756342617B +:10A3600074547970653AC1D7CBE1CCFAEFAEB5E75A +:10A37000B3D8200A0D0000007563426174547970EF +:10A38000653AC3CCCBE1EFAEB5E7B3D8200A0D00F8 +:10A390007563426174547970653AEEDCCBE1EFAEDF +:10A3A000B5E7B3D8200A0D00756342617454797023 +:10A3B000653AC8FDD4AAEFAEB5E7B3D8200A0D00C0 +:10A3C0007563426174547970653ABEDBBACFCEEFE3 +:10A3D000EFAEC0EBD7D3B5E7B3D8200A0D0000002D +:10A3E0007563426174547970653AEED1CBE1EFAE9A +:10A3F000B5E7B3D8200A0D007563426174547970D3 +:10A40000653AC6E4CBFBB5E7B3D8200A0D000000DF +:10A41000546F74616C566F6C746167653A25642083 +:10A42000200A0D0052657175697265566F6C746112 +:10A430006765446966666572656E6365282564298B +:10A4400056200A0D00000000202825642956206FA0 +:10A450007665722072616E6765200A0D000000004B +:10A4600053696D756C6174656443757272656E7461 +:10A47000426174566F6C74202564560A0D0000000A +:10A4800053696D756C6174656443757272656E7441 +:10A49000426174566F6C74202564562D2D31303016 +:10A4A0002D333530560A0D00434C4F534500000004 +:10A4B00025732044656275675F506167655F6675E7 +:10A4C0006E6374696F6E200A0D0000004F50454E98 +:10A4D00000000000754261744D6178456E657267D9 +:10A4E00079202564202E2564200A0D0053746F7096 +:10A4F000566F6C74616765203A25642E256420567A +:10A5000020200A0D000000004F76657254656D70C2 +:10A510003056616C75653A256420200A0D000000F4 +:10A520004F76657254656D703156616C75653A256C +:10A530006420200A0D0000004F76657254656D702E +:10A540003256616C75653A256420200A0D000000C2 +:10A550005369676E616C4C6F7373466C616720253D +:10A560007320200A0D000000252B00205665686925 +:10A5700063686C65496E666F28302D39293A2573FA +:10A580000A0D00005665686963686C65496E666F00 +:10A590002056494E2831302D3137293A25730A0D7E +:10A5A000000000006561737900000000576F726B56 +:10A5B0004D6F64656C20257320200A0D000000009B +:10A5C00070726F66657373696F6E616C0000000076 +:10A5D000E1A0FAF7DFF8B6F875014146B0FBF1F2F9 +:10A5E000B0FBF8F108FB1202E4A06FE0B4F8091028 +:10A5F000A1F10B00592806D201EB81010BEA4100C1 +:10A60000A6F8770102E0E4A0FAF7C4F8B6F87701FB +:10A610004146B0FBF1F2B0FBF8F108FB1202E8A0F2 +:10A6200054E0617AA1F10B008B2802D2A6F87911CF +:10A6300002E0E9A0FAF7AEF8B6F879014146B0FBBE +:10A64000F1F2B0FBF8F108FB1202EBA03EE0617AF8 +:10A6500086F87B11EEA064E1617A86F87C11F2A0A5 +:10A660005FE1B4F80910A1F13000CA2806D201EB6D +:10A6700081010BEA4100A6F87D0102E0EFA0FAF7A4 +:10A6800089F8B6F87D014146B0FBF1F2B0FBF8F174 +:10A6900008FB1202F2A019E0B4F80910A1F11400AD +:10A6A000512806D201EB81010BEA4100A6F87F0197 +:10A6B00002E0F2A0FAF76EF8B6F87F014146B0FB6F +:10A6C000F1F2B0FBF8F108FB1202F5A0FAF762F81C +:10A6D00029E1607A962801D286F8810196F88111E5 +:10A6E000F6A01EE1607A962801D286F8820196F8DB +:10A6F0008211F8A015E1607A012809D086F890A1AE +:10A7000096F89001012806D0AFF6E061F6A008E1C6 +:10A7100086F89071F4E7AFF6D861F7E7607A012820 +:10A7200009D086F887A196F88701012806D0AFF6F0 +:10A730000471F3A0F5E086F88771F4E7AFF60071D5 +:10A74000F7E7607A012809D086F888A196F8880191 +:10A75000012806D0AFF62C71EDA0E2E086F88871F2 +:10A76000F4E7AFF62471F7E7607A032804D886F897 +:10A770008901012803D005E086F889A1D3E0E9A08A +:10A78000FAF708F896F88901022802D1EAA0FAF748 +:10A7900001F896F8890103281DD1ECA03FE096F856 +:10A7A0008901B4F80940012803D12146ECA0F9F74A +:10A7B000F1FF96F88901022803D12146EEA0F9F7AE +:10A7C000E9FF96F88901032803D12146F0A0F9F7A3 +:10A7D000E1FFA6F88A41A6E0607A012809D086F850 +:10A7E0008CA196F88C01012806D0AFF6C071EEA0BE +:10A7F00097E086F88C71F4E7AFF6BC71F7E7607A02 +:10A80000012804D0022806D003280BD08BE086F85C +:10A810009771ECA003E0022086F89701EEA0F9F70B +:10A82000B9FF80E0032086F89701F0A0F7E7B4F8BD +:10A830000910A6F89811A1F1C9030846934205D260 +:10A8400000EB80020BEA4201A6F859100146ECA089 +:10A8500067E0B4F80910A1F1C900904205D201EBFC +:10A8600081020BEA4200A6F85D00A6F89A11ECA05E +:10A8700057E0B4F80910A6F89C11F1A051E0B4F823 +:10A880000910A6F89E1103E0B4F80910A6F8A0116B +:10A89000F5A046E0B4F80910A6F8A2110DE0B4F84E +:10A8A0000910A6F8A41108E0B4F80910A6F8A6113A +:10A8B00003E0B4F80910A6F8A811F3A031E0B4F849 +:10A8C0000910A6F8AA11F8E7B4F80910A6F8AC1117 +:10A8D000F3E7B4F80910A6F8AE11EEE7B4F80910E2 +:10A8E000A6F8B011E9E7B4F80910A6F8B211E4E748 +:10A8F000B4F80910A6F8B411DFE7B4F80910A6F807 +:10A90000B611DAE7B4F80910A6F8B811D5E7B4F82B +:10A910000910A6F8BA11D0E7B4F80910A6F8BC11CE +:10A92000E1A0F9F737FF89F8007013B0BDE8F08FA8 +:10A93000B4F80910A6F8BE11FEF7C8BFC5E1C9E119 +:10A94000CDE1D1E1D5E1D9E1DDE1E1E1E5E1E9E127 +:10A95000EDE1F1E14DE2B3E1444352657175697295 +:10A9600065566F6C742025643A4F766572283438CA +:10A970002D333030292020200A0D00004443526539 +:10A980007175697265566F6C743A25642E25642062 +:10A990005620200A0D00000044435265717569720B +:10A9A0006543757272656E742564413A4F766572BF +:10A9B0002831302D31303041292020200A0D00006F +:10A9C00044435265717569726543757272656E7440 +:10A9D000256441200A0D000044434D6178506F7793 +:10A9E00065722564203A4F76657228312D31356BBA +:10A9F0002909200A0D00000044434D6178506F770B +:10AA000065723A25642E2564206B77090A0D0000D3 +:10AA100044435F496E64756374616E636554656D2C +:10AA200070202564200A0D0044435F494742545476 +:10AA3000656D70202564200A0D00000044434D61BF +:10AA400078566F6C74202564563A4F7665722834B8 +:10AA5000382D32303056292020200A0D0000000009 +:10AA600044432044434D6178566F6C743A25642EFC +:10AA70002564205620200A0D000000004443204495 +:10AA8000434D617843757272656E7425643A4F76F2 +:10AA900065722832302D313130292020200A0D00F6 +:10AAA00044432044434D617843757272656E743A35 +:10AAB00025642E2564204120200A0D004361706129 +:10AAC000636974616E636554656D7031202564201F +:10AAD0000A0D00004443426F7854656D70322025A2 +:10AAE00064200A0D00000000446F75626C654261CD +:10AAF00074746572794D6F64652025730A0D0000CA +:10AB000056494E205472616E732025730A0D000061 +:10AB1000426C75655369676E616C4C6F7373257316 +:10AB20000A0D00004368617267654D6F64652D2DE5 +:10AB30006B77680A0D0000004368617267654D6FAE +:10AB400064652D2D74696D650A0D0000436861729E +:10AB500067654D6F64652D2D534F430A0D0000004E +:10AB60004368617267654D6F64652D6B7768282552 +:10AB700064290A0D000000004368617267654D6F2B +:10AB800064652D74696D65282564290A0D0000002F +:10AB90004368617267654D6F64652D534F43282587 +:10ABA00064290A0D000000006869676820766F6CF0 +:10ABB00074616765206D6F64756C652025730A0D7F +:10ABC00000000000536F6353696D756C61547970B8 +:10ABD000652D310A0D000000536F6353696D756C6C +:10ABE00061547970652D320A0D000000536F635374 +:10ABF000696D756C61547970652D330A0D00000024 +:10AC00000A0D20536F6353696D756C614D61785601 +:10AC10006F6C7420202564205620200A0D0000004F +:10AC20000A0D20536F6353696D756C614D696E56E3 +:10AC30006F6C7420202564205620200A0D0000002F +:10AC40000A0D20536F6343616C6962726174696FAE +:10AC50006E566F6C74202025642028302E312956C2 +:10AC600020200A0D000000000A0D20536F6343618D +:10AC70006C6962726174696F6E566F6C7420202506 +:10AC800064205620200A0D00536F6343616C696293 +:10AC9000726174696F6E566F6C7420202564205643 +:10ACA00020200A0D00000000536F6343616C69624D +:10ACB000726174696F6E2020256420200A0D0000E7 +:10ACC000B4F80910A6F8C01136E6B4F80910A6F8D1 +:10ACD000C21131E6B4F80910A6F8C4112CE6B4F894 +:10ACE0000910A6F8C61127E6B4F80910A6F8C8118D +:10ACF00022E6B4F80910A6F8CA111DE6B4F8091046 +:10AD0000A6F8CC1118E6B4F80910A6F8CE1113E68F +:10AD1000B4F80910A6F8D0110EE6B4F80910A6F898 +:10AD2000D21109E6B4F80910A6F8D41104E6B4F873 +:10AD30000910A6F8D611FFE5B4F80910A6F8D81145 +:10AD4000FAE588F805A0A2F802A09146A2F802A0B0 +:10AD500000F0FAF94FF00008DFF8B4B027E004EB98 +:10AD60000800002590F809A01BF8352051465245EF +:10AD700015D10BEBC50627A07278F9F70BFDB9F8D2 +:10AD8000023007F109004B44727818447168EDF7FE +:10AD9000FBF9B9F8020071780844A9F802006D1CAB +:10ADA000EDB2672DE0D308F1010000F0FF08B845CF +:10ADB000D5D3B9F80220B81C1044A9F8020041F21A +:10ADC0000500A9F80500E07989F80700494689F8E7 +:10ADD0000870002005E022180B18527A401C5A72A5 +:10ADE000C0B2B842F7D311AA69461348F2F712FA73 +:10ADF0009BE5E0790128FBD186F8B9A078210F48BE +:10AE0000EDF7DBF9F6F742FD0DA0FEF71EBB0000E3 +:10AE1000D40700207265616420706172616D2061E9 +:10AE2000646472203078257820706172616D206CC6 +:10AE3000656E2025640A0D00723400204A2B002024 +:10AE400052656365697665207265636F726473200D +:10AE500061636B0A0D0000000348B0F82B00002866 +:10AE600000D00120704700003E2A00207047418832 +:10AE700019B1806808B100207047012070474188EF +:10AE80000088814201D3012070470020704710B52F +:10AE90000380002444808160828002FB0312C0E9A9 +:10AEA0000321416110BD10B5044640880B46A0B196 +:10AEB000A06890B1A28818466169EDF765F9A1888C +:10AEC000606908446061E268904201D3A0686061F3 +:10AED0006088401E6080084610BD002010BD10B57F +:10AEE000044640882288904213D2A06888B1A28884 +:10AEF0002069EDF749F9A188206908442061E168DB +:10AF0000884201D3A06820616088401C60800120D5 +:10AF100010BD002010BD000030B5044687B00121EF +:10AF20000420F5F775FA01214804F5F759FA0420D1 +:10AF3000ADF8100003208DF812001820224D8DF876 +:10AF4000130004A92846F3F7BFF90820ADF8100054 +:10AF500048208DF8130004A92846F3F7B5F92620F8 +:10AF60008DF8140001218DF815108DF816108DF84C +:10AF7000171005A8F4F7E2FA0020ADF804000094D9 +:10AF8000ADF80600ADF80800ADF80C000C200F4C31 +:10AF9000ADF80A0069462046F8F782FD012240F22A +:10AFA00025512046F8F764FD012240F22441204655 +:10AFB000F8F75EFD01212046F8F7EFFC80212046DE +:10AFC000F8F7E2FC07B030BD000801400044004043 +:10AFD00070B5054686B001211120F5F719FA012157 +:10AFE000C804F5F7FDF94FF48060ADF810000324B4 +:10AFF0008DF812401820244E8DF8130004A9304615 +:10B00000F3F762F9F014ADF8100048208DF8130042 +:10B0100004A93046F3F758F934208DF814008DF860 +:10B0200015408DF8164001208DF8170005A8F4F79B +:10B0300085FA0020ADF80400ADF80600ADF8080070 +:10B04000ADF80C000C20114CADF80A0000956946D3 +:10B050002046F8F725FD01212046F8F79EFC012245 +:10B0600040F225512046F8F703FD012240F2266107 +:10B070002046F8F7FDFC012240F224412046F8F773 +:10B08000F7FC06B070BD000000100140004C00400D +:10B0900030B5054687B001213020F5F7B9F9012117 +:10B0A0000805F5F79DF94FF48050ADF81000032422 +:10B0B0008DF8124018208DF8130004A91E48F3F7EC +:10B0C00003F90420ADF8100048208DF8130004A9FE +:10B0D0001A48F3F7F9F835208DF8140001218DF89E +:10B0E00015108DF816408DF8171005A8F4F726FAFC +:10B0F0000020ADF80400ADF80600ADF80800ADF88A +:10B100000C000C200E4CADF80A0000956946204654 +:10B11000F8F7C6FC012240F225512046F8F7A8FCBA +:10B12000012240F224412046F8F7A2FC01212046EA +:10B13000F8F733FC07B030BD0010014000140140A7 +:10B1400000500040FDF734BF254810B5B0F8591045 +:10B150000A22B1FBF2F323490B80B0F85B30B3FB5A +:10B16000F2F34B80B0F88330B3FBF2F30B82B0F80C +:10B170005330B3FBF2F30B83B0F88E30B3FBF2F332 +:10B180008B82B0F88530B3FBF2F34B8290F88B30B2 +:10B19000B3FBF2F38B7690F88C30B3FBF2F3CB7603 +:10B1A000B0F89030B3FBF2F3CB82B0F8B130B3FB20 +:10B1B000F2F4B0F8B340B4FBF2F4B3FBF2F2CC8398 +:10B1C0008A8390F8B620323A81F8212090F8B52091 +:10B1D000323A81F8202090F8790181F8220010BDE0 +:10B1E000902A00200C36002070B5164E002505EB85 +:10B1F000450000EBC50006EB001494F8540003284A +:10B200001BD394F89100012803D122780421FBF785 +:10B2100067FD94F8910002280FD194F8AC00401C0F +:10B22000C0B284F8AC00022807D3032084F8910050 +:10B23000227804210120FBF753FD6D1CEDB2022D95 +:10B24000D5D370BDC0110020410142024303440424 +:10B25000450546064707480849004A014B024C038A +:10B260004D044E054F005007510852095302540334 +:10B27000550456055706580759085A0962006200D6 +:10B28000620062006200E60300000000596C0108E1 +:10B290009D6C0108BD6A010800000000000000006C +:10B2A000000000000000000001000000596C0108CF +:10B2B0009D6C0108BD6A010800000000000000004C +:10B2C000000000000000000000008A0202000200EE +:10B2D0007602B60302000500840340060200050062 +:10B2E0000E063A07020005001C076009020005006F +:10B2F000D8FF0000F8339F43D9FF000058699543F9 +:10B30000DAFF0000BA298C43DBFF0000C77B8343D0 +:10B31000DCFF000071BD7643DDFF0000A09A6743AB +:10B32000DEFF000000805943DFFF0000E75B4C4375 +:10B33000E0FF0000E71B4043E1FF00001BAF344388 +:10B34000E2FF00005A042A43E3FF00008B0C204375 +:10B35000E4FF00001DBA1643E5FF000042000E4363 +:10B36000E6FF0000B6D30543E7FF00007B54FC4234 +:10B37000E8FF0000C3F5ED42E9FF00005879E04224 +:10B38000EAFF000068D1D342EBFF0000E6EEC742BF +:10B39000ECFF0000AFC5BC42EDFF0000C749B24260 +:10B3A000EEFF00002E70A842EFFF0000B22E9F4279 +:10B3B000F0FF0000C07B9642F1FF00008A4E8E42F3 +:10B3C000F2FF0000AB9E8642F3FF00009AC87E4267 +:10B3D000F4FF000007307142F5FF0000FE65644293 +:10B3E000F6FF0000645D5842F7FF0000230A4D425B +:10B3F000F8FF0000C5604242F9FF00006D56384278 +:10B40000FAFF000048E12E42FBFF0000B5F725429D +:10B41000FCFF000000911D42FDFF0000DDA415426D +:10B42000FEFF00009F2B0E42FFFF0000011E07429F +:10B43000000000005A75004201000000A156F441CE +:10B44000020000005474E841030000005238DD415E +:10B4500004000000FC98D241050000004A8CC8415D +:10B4600006000000D509BF4107000000CE08B64124 +:10B4700008000000D881AD4109000000916DA54190 +:10B480000A00000039C59D410B00000075829641FD +:10B490000C0000008A9F8F410D000000F0168941CA +:10B4A0000E00000088E382410F00000069007A412D +:10B4B00010000000B7D16E411100000061326441FC +:10B4C00012000000CE195A41130000006F81504154 +:10B4D000140000007C6147411500000039B43E4172 +:10B4E000160000001973364117000000F6972E4130 +:10B4F000180000004F1E27411900000000002041E5 +:10B500001A000000DA3819411B00000028C412415B +:10B510001C000000939D0C411D00000020C106414D +:10B520001E000000022B01411F00000025AFF74064 +:10B5300020000000D786ED4021000000A1D6E340A6 +:10B54000220000009E98DA4023000000E7C6D140A8 +:10B5500024000000145CC940250000001153C140C4 +:10B5600026000000DFA6B94027000000FC52B240D0 +:10B57000280000001153AB4029000000DBA2A440CA +:10B580002A000000963E9E402B0000007D2298403D +:10B590002C0000000A4B92402D000000E1B48C40CA +:10B5A0002E000000E65C87402F0000001040824023 +:10B5B000300000002CB77A40310000006059714023 +:10B5C00032000000D06168403300000092CB5F4041 +:10B5D000340000001092574035000000DEB04F40AC +:10B5E00036000000E2234840370000002EE74040CC +:10B5F0003800000027F7394039000000DF4F3340A2 +:10B600003A00000063EE2C403B0000006CCF264067 +:10B610003C000000B3EF20403D000000984C1B4070 +:10B620003E00000054E315403F0000001CB11040F4 +:10B6300040000000D0B30B4041000000A7E80640E6 +:10B6400042000000D34D024043000000BEC1FB3F5A +:10B6500044000000FB3FF33F450000001B12EB3F9E +:10B66000460000002B35E33F47000000E8A4DB3F25 +:10B67000480000005F5ED43F490000004A5ECD3FB5 +:10B680004A000000B6A1C63F4B0000000326C03FA1 +:10B690004C0000003EE8B93F4D00000075E5B33FA7 +:10B6A0004E000000041CAE3F4F000000A488A83FDD +:10B6B00050000000062AA33F5100000037FD9D3FC7 +:10B6C000520000009300993F530000002332943F42 +:10B6D00054000000EF8F8F3F5500000001188B3F92 +:10B6E0005600000008C9863F5700000062A1823F53 +:10B6F000580000002D3E7D3F59000000AE81753F8F +:10B700005A0000004E0B6E3F5B0000001FD7663FE3 +:10B710005C0000002AE35F3F5D000000CF2C593F32 +:10B720005E00000018B2523F5F00000065704C3FA1 +:10B73000600000001765463F61000000DE8E403F5C +:10B74000620000001CEB3A3F63000000D977353FF0 +:10B75000640000006E34303F65000000931D2B3FF5 +:10B7600066000000A032263F670000009F71213F65 +:10B770006800000040D91C3F690000008C67183F3A +:10B780006A000000331B143F6B000000E5F20F3F1E +:10B790006C00000052ED0B3F6D0000002D09083FCA +:10B7A0006E000000CC45043F6F00000038A1003F50 +:10B7B000700000009335FA3E710000006362F33EB2 +:10B7C000720000008FC7EC3E730000007862E63E16 +:10B7D000740000007F30E03E75000000A531DA3EC5 +:10B7E00076000000FA61D43E770000007FC1CE3EB3 +:10B7F00078000000944DC93E790000003A06C43E2E +:10B800007A00000082E7BE3E7B0000006BF1B93E8B +:10B810007C0000005721B53E7D0000009678B03EC8 +:10B8200000C1814001C0804101C0804100C1814010 +:10B8300001C0804100C1814000C1814001C0804100 +:10B8400001C0804100C1814000C1814001C08041F0 +:10B8500000C1814001C0804101C0804100C18140E0 +:10B8600001C0804100C1814000C1814001C08041D0 +:10B8700000C1814001C0804101C0804100C18140C0 +:10B8800000C1814001C0804101C0804100C18140B0 +:10B8900001C0804100C1814000C1814001C08041A0 +:10B8A00001C0804100C1814000C1814001C0804190 +:10B8B00000C1814001C0804101C0804100C1814080 +:10B8C00000C1814001C0804101C0804100C1814070 +:10B8D00001C0804100C1814000C1814001C0804160 +:10B8E00000C1814001C0804101C0804100C1814050 +:10B8F00001C0804100C1814000C1814001C0804140 +:10B9000001C0804100C1814000C1814001C080412F +:10B9100000C1814001C0804101C0804100C181401F +:10B9200000C0C101C30302C2C60607C705C5C404DF +:10B93000CC0C0DCD0FCFCE0E0ACACB0BC90908C84F +:10B94000D81819D91BDBDA1A1EDEDF1FDD1D1CDC3F +:10B9500014D4D515D71716D6D21213D311D1D010AF +:10B96000F03031F133F3F23236F6F737F53534F49F +:10B970003CFCFD3DFF3F3EFEFA3A3BFB39F9F8380F +:10B9800028E8E929EB2B2AEAEE2E2FEF2DEDEC2CFF +:10B99000E42425E527E7E62622E2E323E12120E06F +:10B9A000A06061A163A3A26266A6A767A56564A45F +:10B9B0006CACAD6DAF6F6EAEAA6A6BAB69A9A868CF +:10B9C00078B8B979BB7B7ABABE7E7FBF7DBDBC7CBF +:10B9D000B47475B577B7B67672B2B373B17170B02F +:10B9E000509091519353529296565797559594541F +:10B9F0009C5C5D9D5F9F9E5E5A9A9B5B995958988F +:10BA0000884849894B8B8A4A4E8E8F4F8D4D4C8C7E +:10BA100044848545874746868242438341818040EE +:10BA20002003BC028A0258022602F401C2019001DE +:10BA30005E012C018873C00017801F0016801F0054 +:10BA400017811F0016811F0019801F0019811F0018 +:10BA50004B801F0012801F0012811F001C801F00DE +:10BA600063801F0098801F0007801F001E801F003A +:10BA70001C811F0098811F0029801F0000002200E8 +:10BA80002500340046004B0059006C007A00880005 +:10BA90008E00920096009A009E00A100A400A700CC +:10BAA000AA0020010D10030C110C0C04020202026A +:10BAB00001010101010080F186F187F194F18AF121 +:10BAC0008CF190F191F198F199F110FE11FE12FEB6 +:10BAD00013FE14FE15FE16FE17FE18FE90F198F1E7 +:10BAE00099F110FE11FE12FE13FE14FE15FE16FE55 +:10BAF00017FE18FE00001300210027002B002F0066 +:10BB0000330037003A003D004000430011000C00B4 +:10BB10000400020002000200020001000100010016 +:10BB20000100010010111419222E273E3128857FB3 +:10BB300042333043383600000000000001000000AE +:10BB400070C60108ED6F01080100000020C6010861 +:10BB5000AD7A01080100000018C601087D7A0108CD +:10BB60000100000064C60108957C01080100000086 +:10BB70005CC601088D7D01080100000050C6010867 +:10BB80008B7D01080100000028C60108897D01089D +:10BB90000100000034C601080D7A01080100000010 +:10BBA00044C60108798101080100000040C601086F +:10BBB000757A01080100000048C601085581010896 +:10BBC00000C1814001C0804101C0804100C181406D +:10BBD00001C0804100C1814000C1814001C080415D +:10BBE00001C0804100C1814000C1814001C080414D +:10BBF00000C1814001C0804101C0804100C181403D +:10BC000001C0804100C1814000C1814001C080412C +:10BC100000C1814001C0804101C0804100C181401C +:10BC200000C1814001C0804101C0804100C181400C +:10BC300001C0804100C1814000C1814001C08041FC +:10BC400001C0804100C1814000C1814001C08041EC +:10BC500000C1814001C0804101C0804100C18140DC +:10BC600000C1814001C0804101C0804100C18140CC +:10BC700001C0804100C1814000C1814001C08041BC +:10BC800000C1814001C0804101C0804100C18140AC +:10BC900001C0804100C1814000C1814001C080419C +:10BCA00001C0804100C1814000C1814001C080418C +:10BCB00000C1814001C0804101C0804100C181407C +:10BCC00000C0C101C30302C2C60607C705C5C4043C +:10BCD000CC0C0DCD0FCFCE0E0ACACB0BC90908C8AC +:10BCE000D81819D91BDBDA1A1EDEDF1FDD1D1CDC9C +:10BCF00014D4D515D71716D6D21213D311D1D0100C +:10BD0000F03031F133F3F23236F6F737F53534F4FB +:10BD10003CFCFD3DFF3F3EFEFA3A3BFB39F9F8386B +:10BD200028E8E929EB2B2AEAEE2E2FEF2DEDEC2C5B +:10BD3000E42425E527E7E62622E2E323E12120E0CB +:10BD4000A06061A163A3A26266A6A767A56564A4BB +:10BD50006CACAD6DAF6F6EAEAA6A6BAB69A9A8682B +:10BD600078B8B979BB7B7ABABE7E7FBF7DBDBC7C1B +:10BD7000B47475B577B7B67672B2B373B17170B08B +:10BD8000509091519353529296565797559594547B +:10BD90009C5C5D9D5F9F9E5E5A9A9B5B99595898EB +:10BDA000884849894B8B8A4A4E8E8F4F8D4D4C8CDB +:10BDB000448485458747468682424383418180404B +:10BDC000B3E4B5E7D7AEB5E7C1F7B3ACB9FD626D83 +:10BDD00073D0E8C7F3B5E7C1F72FD7EEB4F3B3E4F8 +:10BDE000B5E7B5E7C1F7202000000000BDD3CAD5F4 +:10BDF000B3B5C1BEB1A8CEC4B3ACCAB12000000077 +:10BE0000B3E4B5E7B2E5D7F9CEC2B6C8D2ECB3A376 +:10BE100000000000B3E4B5E7D7AECAE4B3F6B5E777 +:10BE2000D1B9B9FDD1B9B1A3BBA40000B3E4B5E762 +:10BE3000D7AEB3ACB9A6C2CAB1A3BBA40000000080 +:10BE4000B5E7B3D8BCD3C8C8BCCCB5E7C6F7D5B343 +:10BE5000C1AC0000D6F7BCCCB5E7C6F7D5B3C1ACD2 +:10BE600000000000564355D7B4CCACB7C7B3E4B517 +:10BE7000E7D7B4CCAC000000B3E4B5E7D7AEB5E784 +:10BE8000C1F7B2A8B6AF0000B3E4B5E7D7AEB6FECF +:10BE9000B4CEC6F4B6AF0000B5A5CCE5C7B7D1B9EE +:10BEA000B1A8BEAF00000000B5A5CCE5B5CDCEC2AF +:10BEB000B1A8BEAF00000000C8C8CAA7BFD8B1A8CB +:10BEC000BEAF0000B5A5CCE5B8DFCEC2B8E6BEAFC8 +:10BED00000000000BDD3CAD5B3E4B5E7D7AECAFDB4 +:10BEE000BEDDB1A8CEC4B3ACCAB10000464443B66F +:10BEF000FEB4CEC6F4B6AFB4CECAFDB3ACCAB10080 +:10BF0000B5A5CCE5B9FDD1B900000000B3A4C6DAEF +:10BF1000CEDEB5E7C1F7CDA3D6B90000B5E7B3D8FB +:10BF2000CEB4D7BCB1B8BAC300000000CAD5B5BD05 +:10BF3000B3E4B5E7D7AECDA3D6B9B3E4B5E7B1A8BE +:10BF4000CEC40000B5E7B3D8B0FCB1A3CFD5C8DBF1 +:10BF5000B6CF0000B8DFD1B9BBD8C2B7D6F7B1A30E +:10BF6000CFD5D5EFB6CF0000B5E7B3D8D6F7D5FD1E +:10BF7000D6F7B8BABDD3B4A5C6F7CEB4B1D5BACF4B +:10BF800000000000B5A5B4CEBCD3C8C8CAB1BCE49B +:10BF9000B3A4B9CAD5CF0000BEF8D4B5B9CAD5CFBD +:10BFA00000000000B5E7B3D8B0FCD7DCD1B9B2C906 +:10BFB000D1F9BBD8C2B7B9CAD5CF0000D7DCB5E735 +:10BFC000D1B9B9FDD1B9B9CAD5CF0000B5A5CCE575 +:10BFD000B9FDD1B9B9CAD5CF00000000B3B5C1BE13 +:10BFE00043414ECDA8D0C5B9CAD5CF00564355CD93 +:10BFF000A8D0C5B9CAD5CF00B8A8D6FAB5E7D4B489 +:10C00000B5CDB9CAD5CF0000464443CAE4C8EBB7A2 +:10C01000B4BDD3B9CAD5CF00464443CAE4B3F6B7DA +:10C02000B4BDD3B9CAD5CF00736F6320B8DFB9CA26 +:10C03000D5CF0000B5E7D4B4C4A3BFE9B9CAD5CF02 +:10C0400000000000B5A5CCE5D1B9B2EEB9CAD5CF94 +:10C0500000000000CEC2B2EEB9CAD5CF0000000089 +:10C06000B5E7C1F7B4ABB8D0C6F7B9CAD5CF0000B1 +:10C07000464443CAE4B3F6BCCCB5E7C6F7B9CAD563 +:10C08000CF000000B8DFD1B9BBB7C2B7BBA5CBF8B2 +:10C09000B9CAD5CF00000000B5E7B3D8B0FCB3E40F +:10C0A000B5E7D0C5BAC5D7B4CCACB2BBB6D40000E6 +:10C0B000D4A4B3E4CAA7B0DC00000000B5E7B3D84D +:10C0C000B5A5CCE5B5E7D1B9B2C9BCAFCFDFB6CF26 +:10C0D000CFDF0000B5A5CCE5CEC2B8D0B2C9BCAFA9 +:10C0E000CFDFB6CFCFDF0000B9FDB3E40000000022 +:10C0F000626F6F7374C9FDD1B9B5E7D1B9B2BBC670 +:10C10000A5C5E400D7DCB5E7D1B9C7B7D1B9BEAF93 +:10C11000B8E60000B5E7B3D8B5CDCEC2BEAFB8E63D +:10C1200000000000B5E7B3D8B8DFCEC2BEAFB8E6B6 +:10C1300000000000736F63B5CDBEAFB8E60000002D +:10C14000736F6320CCF8B1E4BEAFB8E60000000026 +:10C15000564355BDFBD6B9B3E4B5E70056B3B5C1F8 +:10C16000BEB5E7B3D8B0FCB3E4B5E7D7B4CCACB751 +:10C17000C72D2DBFECB3E4BFC9B3E4B5E7000000A1 +:10C18000B7C5B5E7B9FDC1F700000000B3E4B5E7F6 +:10C19000B9FDC1F700000000B5E7C1F7B2C9D1F998 +:10C1A00000000000B9FDCEC2BDB5D4D82FCDA3BBD1 +:10C1B000FA000000534F43B4EFB5BD313030CDA38A +:10C1C000BBFA0000B5E7B3D8B5E7C1F7D0E8C7F3CD +:10C1D000CEAA30CDA3BBFA00B3E4B5E7B4EFB5BD4A +:10C1E000C9E8B6A8534F43CDA3BBFA00B3E4B5E703 +:10C1F000C1F7B3CCB3ACCAB1CDA3BBFA0000000009 +:10C20000B3E4B5E7D7AECAE4B3F6B5E7D1B92DB913 +:10C21000FDD1B9CDA3BBFA00B3E4B5E7B4EFB5BD2A +:10C22000B5E7B3D8C8DDC1BFCDA3BBFA000000009D +:10C23000B3E4B5E7B4EFB5BDC9E8B6A8CAB1BCE48C +:10C24000CDA3BBFA00000000B3E4B5E7D7AEB8A8B1 +:10C25000D6FAB5E7D4B4323456C6BDCCA82D2DB32A +:10C26000E4B5E7CDA3BBFA00D0A1B3CCD0F2CDA307 +:10C27000BBFA000063616E20323A20737465702847 +:10C280002564292C207265636F7276657279282582 +:10C2900064292C206C61737420627573206F66664C +:10C2A000207469636B282564292020206C617374D5 +:10C2B000207265636F76657279207469636B2825D7 +:10C2C0006429210A0000000063616E20313A207366 +:10C2D000746570282564292C207265636F727665F9 +:10C2E0007279282564292C206C617374206275731F +:10C2F000206F6666207469636B282564292C2020D2 +:10C30000206C617374207265636F76657279207436 +:10C3100069636B28256429210A0000006E6D5F7235 +:10C3200065633A206E657725643A20414C3A25646E +:10C33000204E6574776F726B436F6D6D616E643AFA +:10C34000256420636F756E7465723A256420636F8F +:10C350006E74726F6C5F7374733A25640D0A00001B +:10C36000455F4E4D5F5354415455535F504F5745B1 +:10C37000524F464600000000455F4E4D5F5354410A +:10C380005455535F4E45544F46460000455F4E4D51 +:10C390005F5354415455535F574149545F4143548F +:10C3A000494F4E00455F4E4D5F5354415455535FC6 +:10C3B0004E45544F4E000000455F4E4D5F53544173 +:10C3C0005455535F574149545F535441525455504B +:10C3D00000000000455F4E4D5F5354415455535F7C +:10C3E0004E4554534C49454E540000006661756CEF +:10C3F000745F72656C61795F657272202000000065 +:10C400006661756C745F636F6D5F63637520200098 +:10C410006661756C745F636F6D5F76656368696391 +:10C420006C6500006661756C745F677269645F6952 +:10C430006E7075745F7265766572736500000000DA +:10C440006661756C745F677269645F6F757470752F +:10C45000745F726576657273650000006661756C65 +:10C46000745F666364635F66616E00006661756C2D +:10C47000745F677269645F766F6C745F756E646514 +:10C48000720000006661756C745F6C6F61645F6F51 +:10C49000766572006661756C745F74656D705F6F50 +:10C4A000766572006661756C745F677269645F635C +:10C4B0007572725F6F766572000000006661756C60 +:10C4C000745F677269645F766F6C745F6F766572B4 +:10C4D000000000006661756C745F706F7765723282 +:10C4E000345F6572720000006175785F756E646517 +:10C4F000725F766F6C5F6572720000006661756CCA +:10C50000745F6E6F5F637572720000006661756CB8 +:10C51000745F4261745F556E646572566F6C74002F +:10C52000B7E7C9C8B6C2D7AA20200000426174B5D7 +:10C53000E7D1B9B5CDD1B92020000000425553B59F +:10C54000E7D1B9B5CDD1B900425553D3D0D0A7B5B5 +:10C55000E7D1B9B9FDD1B900426174CBB2D3D0D023 +:10C56000A7B5E7D1B9B9FDD1B9000000425553CB09 +:10C57000B2CAB1B5E7D1B9B9FDD1B900426174CB46 +:10C58000B2CAB1B5E7D1B9B9FDD1B900B9FDCEC2D2 +:10C59000B9CAD5CF000000004275636BD3D0D0A7D5 +:10C5A000B5E7C1F7B9FDC1F7000000004275636B44 +:10C5B000CBB2CAB1B5E7C1F7B9FDC1F700000000C1 +:10C5C0004275636BB5E7C1F7D3B2BCFEB9FDC1F7E5 +:10C5D000000000000D0A3737375570642D2D74792F +:10C5E00070653A253078202C7665723A2530782CA3 +:10C5F00054627974653A2530782C204372633A2569 +:10C6000030782C5061673A2530782C506C656E3A42 +:10C610002530780D0A0000004F464644434443004D +:10C620004F4E44434443000053455441504E5057ED +:10C6300044000000434849504445434F44450000EE +:10C640004F46460043414E00414C5F4F4E000000B4 +:10C6500053455441504E5553455200005445535490 +:10C66000424D5300524541444D4153530000000098 +:10C670005345540094C60108000000201C0B000024 +:10C68000588B000850CC01081C0B0020E46C000003 +:10C69000EC470108D1BBE8030B32022DF0C00108C2 +:10C6A00016362CBF0108043668C20108063678BE6B +:10C6B0000108071A0C1832081AD41032091A88080F +:10C6C000320A46A4C101080B1930320C36C0BD0134 +:10C6D000080D1A4810320E1AEC10320F1A5C28326C +:10C6E000101A64382A111819082A12081918321356 +:10C6F0001A141032141A34882A1588191032161A8E +:10C70000181032171A080832181A70082A1918193E +:10C7100060321A1A3008321B1AD848321C1AB40870 +:10C72000321D1AF8B0421E190832321A44082A3350 +:10C73000D8190832341A1C0832351A503032361AD9 +:10C74000985832371AC4102A380819802A39F01933 +:10C75000182A3AE81930323B1ABC10323C1ACC1075 +:10C760002A3D101908323E1A8418323F1A54082AFA +:10C77000407019082A4110192032421A80582A4361 +:10C7800068190832441A60202A4510192032461AC6 +:10C7900028102A4730197832481AB01032491A4006 +:10C7A00010324A1ADC28424B1910324C1AE8202A5F +:10C7B0004D781918324E1AEC08324F1AB820325BF5 +:10C7C0001A2468325C1AA8102A5D681908325E1AA9 +:10C7D0000418325F1A34082A6060190832611A8C12 +:10C7E0000832621A14081184A24A04680D01020377 +:10C7F000040607080902040608106914B13A0F1C60 +:10C800002214F2FF0310E803091012017122011330 +:10C8100011FE1B0803E627ED02010821051E9903FE +:10C82000010810101A79081A30081A49081A91AA32 +:10C830001A21281A69101A39081A6A0812451C01A7 +:10C84000086B081AD9081A6C081E5D0101086D08EA +:10C850001A8D081A6E081AE5081A6F081A11581A64 +:10C8600070081A3D081A40601AD5401A41081AFD8E +:10C87000081A42081325FF1B0843081A4D081A44DA +:10C88000081A75081A45081A9D081A46081AC50894 +:10C890001A47081AED081A48081A15701A60081A7B +:10C8A00081501A66081AA11011220613E1FD8208B0 +:10C8B0001A12101AE8B4811A800C1AF4EC811A5278 +:10C8C00090A910DA5310DA5410DA511000091CD56F +:10C8D000FBB3B5D0ADD2E963030A1E3D6A0108710E +:10C8E00004092A34C11E60C3010878041AB8041A66 +:10C8F000A4041AD4041A8C0441180AA98A01089FB6 +:10C90000890108ED041AF1041A291061920213F04A +:10C91000FF6220021FA67A01E20530CA08E803324E +:10C920008336A181010885366DAE01088736B9923C +:10C930000108894BED8F982D94C40108651A84086D +:10C9400029A21ABC0829691A6C0832041AA40832F0 +:10C95000051A240832061A400832071AFC08320A5F +:10C960001A1008420C1908320B1A5C08320D1AD43E +:10C9700008320E1AE808320F36ECC30108104B0CCF +:10C98000C578811A6C1029801A480829801A7C08F9 +:10C9900029801A580829801AAC0829801A98082971 +:10C9A000801AC00829801A8C0829491A3C083209C3 +:10C9B0001A2C082990DA2060013C1464320112011B +:10C9C00002811F1E412B010871041A95041AC90423 +:10C9D0001AE9041B852CF819041AED041AB9041A73 +:10C9E000510400094E112D0108F535010823FFFF00 +:10C9F0000330E803230201130C0B5B2001085A03E8 +:10CA00000823051013B02A1B2004081AA0082306C7 +:10CA1000021ADD081A07081AF9081A08281AFB086A +:10CA20001A09201A90081A0A1013172B1B200F0836 +:10CA30001A1C081A0E081A1B081A0D081A1A081AC6 +:10CA40000C081A19085A0B601A13481AEB381A12F4 +:10CA5000081AE9081A11081A15201A10081A1308DA +:10CA60001A140829281A150813EC161B2016081A80 +:10CA7000F3281B17049819181A18481A40281A196D +:10CA8000101AB8101A1AFA1AC008231B111A2518FE +:10CA9000231C081AD9101A1F281322361B201E081F +:10CAA0001A24081A1D081A1D201A20081A2A101AFA +:10CAB00021081A28081A22081A47185A24901A23FB +:10CAC000081AEF085A27681A26081A2D281A250866 +:10CAD0001A2C081A28201AED201A29101A23201AB5 +:10CAE0002A101A36081A2B101A38085A30B01A3180 +:10CAF000081A20301A32181ADD101A33081ADF0803 +:10CB00001A34081AE1082A35A019304B360AB8231E +:10CB100037071A2F081A501813042C1B2051401ADB +:10CB200005081A52081A07081A53181A09081A543D +:10CB3000081A0B081A55081A0C081A56201A0D085C +:10CB40001A57081A0F081A58181A11081A59081AE9 +:10CB500012081A5A081A20081A60081A17081A61C7 +:10CB6000081A18081A62081A19081A63381A1A08D3 +:10CB70001A65101A1C081A66081A1D081A6D081A78 +:10CB800027081A6E201A28081A6F081A2A081A701D +:10CB9000081A2C081A71081A2E081A72081A300876 +:10CBA0001A73081A32081A74081A34081A75081AFF +:10CBB00036081A76081A38081A77081A3A081A78BE +:10CBC000081A3C081A79081A3E081A7A081A400806 +:10CBD0001A7B081A42081A7C081A44081A7D081A97 +:10CBE00046081A7E081A48081A7F081A4A081A8046 +:10CBF000081A4C081A81081A4E081A82081A500896 +:10CC00001A83081A52081A84081A54081A85081A2E +:10CC100056081A86081A58081A87081A5A081A88CD +:10CC2000081A5C081A89081A5E081A8A081A600825 +:10CC30001A8B081A62081A8C081A64081A8D081AC6 +:10CC400066081A8E081A68081A8F081A6A080110EE +:04000005080081511D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ExtDll.iex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ExtDll.iex new file mode 100644 index 0000000..6c0896e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ExtDll.iex @@ -0,0 +1,2 @@ +[EXTDLL] +Count=0 diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.axf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.axf new file mode 100644 index 0000000..a909315 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.axf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.build_log.htm b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.build_log.htm new file mode 100644 index 0000000..05a322e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.build_log.htm @@ -0,0 +1,53 @@ + + +
+

Vision Build Log

+

Tool Versions:

+IDE-Version: Vision V5.25.2.0 +Copyright (C) 2018 ARM Ltd and ARM Germany GmbH. All rights reserved. +License Information: 1 577208907@qq.com, 2, LIC=14HV2-9NX17-8T33P-MAETB-MH3E0-2V8NR + +Tool Versions: +Toolchain: MDK-ARM Plus Version: 5.25.2.0 +Toolchain Path: C:\Keil_v5\ARM\ARMCC\Bin +C Compiler: Armcc.exe V5.06 update 6 (build 750) +Assembler: Armasm.exe V5.06 update 6 (build 750) +Linker/Locator: ArmLink.exe V5.06 update 6 (build 750) +Library Manager: ArmAr.exe V5.06 update 6 (build 750) +Hex Converter: FromElf.exe V5.06 update 6 (build 750) +CPU DLL: SARMCM3.DLL V5.25.2.0 +Dialog DLL: DCM.DLL V1.17.1.0 +Target DLL: Segger\JL2CM3.dll V2.99.29.0 +Dialog DLL: TCM.DLL V1.35.1.0 + +

Project:

+D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\Project.uvprojx +Project File Date: 04/25/2024 + +

Output:

+*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' +Build target 'GD32F10X_CL' +After Build - User command #1: output\merge.cmd +D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project>set "cmdDir=D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\output\" +D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project>copy D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\output\boot.hex D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\output\DCBms.hex +Ѹ 1 ļ +D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project>type D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\output\LED.hex 1>>D:\work\project_DC\qirui\80汾\QR205_170_ST_GD_86\GD32F10x_Firmware_Library_V2.3.0\Template\Keil5_project\output\DCBms.hex +After Build - User command #2: fromelf --bin --output output\App.bin output\LED.axf +".\output\LED.axf" - 0 Error(s), 0 Warning(s). + +

Software Packages used:

+ +Package Vendor: Keil + http://www.keil.com/pack/Keil.STM32F1xx_DFP.1.0.5.pack + Keil.STM32F1xx_DFP.1.0.5 + STMicroelectronics STM32F1 Series Device Support, Drivers and Examples + +

Collection of Component include folders:

+ .\RTE\_GD32F10X_CL + C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include + +

Collection of Component Files used:

+Build Time Elapsed: 00:00:05 +
+ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.hex new file mode 100644 index 0000000..951f80e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.hex @@ -0,0 +1,5321 @@ +:020000040800F2 +:10800000007800206581000833F500087DEC000849 +:1080100031F50008E5AE00089545010800000000B4 +:10802000000000000000000000000000ED08010852 +:1080300025D300080000000035F7000815180108D6 +:10804000DD4601087F8100087F8100087F810008EC +:108050007F8100087F8100087F8100087F81000800 +:108060007F81000899D900089FD900087F81000806 +:108070007F8100087F8100087F8100087F810008E0 +:108080007F8100087F8100087F81000871AF0008B0 +:10809000E9AE00087F81000809AF0008A5D90008F3 +:1080A0007F8100087F8100087F8100087F810008B0 +:1080B0007F810008091901087F8100087F8100087D +:1080C0007F8100087F8100087F8100087F81000890 +:1080D0007F81000851370108CD3701089D3801081C +:1080E00049D90008E90501087F8100080000000067 +:1080F0000000000000000000000000000000000080 +:1081000000000000000000007F8100087F8100085F +:10811000792901086D2A01087F8100087F81000804 +:108120007F8100087F8100087F8100087F8100082F +:108130007F8100087F8100087F810008E1B100088D +:108140007F81000841B1000869B100087F81000803 +:10815000DFF80CD000F0EEFC00480047318B01083E +:10816000007800200648804706480047FEE7FEE703 +:10817000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7D7 +:10818000AD1801085181000840EA01039B0703D0A4 +:1081900009E008C9121F08C0042AFAD203E011F846 +:1081A000013B00F8013B521EF9D27047D2B201E008 +:1081B00000F8012B491EFBD270470022F6E710B5EC +:1081C00013460A4604461946FFF7F0FF204610BD45 +:1081D00030B505462A460B4612F8010B13F8014B41 +:1081E00008B1A042F8D01CB1002802D06D1CF1E704 +:1081F000284630BD421C10F8011B0029FBD1801A13 +:10820000704730B504460020034600E05B1C9342F3 +:1082100003D2E05CCD5C401BF8D030BD034611F8C2 +:10822000012B00F8012B002AF9D118467047F0B451 +:1082300080EA0102D40F4200B2EB410F02D20246A3 +:10824000084611464A0042D0C30DDDB2C1F3C75201 +:10825000AD1A202D35DAC1F3160141F4000204B144 +:108260005242C5F1200602FA06F12A411044B3EB4E +:10827000D05F23D0C4B1012DA0EBC35009DCF0BC0A +:108280004FF0004202EAC352DBB200F5000000F0FA +:10829000AEBB400000F1807000EBC350A0F18070D5 +:1082A00040EAD170490009E0490841EAC071A0EBF9 +:1082B000C35000F50000400800EBC350F0BC00F0D4 +:1082C0008DBB6142012202EB4101001BF6E7F0BCCD +:1082D000704781F00041AAE780F00040A7E780EAFC +:1082E000010210B502F00043400022D04A001FD026 +:1082F000010E01EB1261C0F35600C2F3560240F4C6 +:10830000000042F40002A0FB022000047F391404A4 +:1083100000D0401C50EA124001D44000491EC2B2B5 +:108320000C0604EBD010401C4008802A02D003E069 +:10833000002010BD20F00100002900DA00201843C1 +:1083400010BD30B480EA010202F0004530F0004276 +:1083500021F0004013D090B1C30DD40DC2F316012B +:10836000C0F31600E41A41F4000140F400027D3429 +:10837000914201D3641C00E04900002C02DA30BCB9 +:10838000002070474FF400000023914201D3891A66 +:10839000034340084FEA4101F7D151B1914202D164 +:1083A0004FF0004105E002D24FF0010101E06FF013 +:1083B000010103EBC450284430BC00F00FBB420065 +:1083C00005D0C0F3C7525242914201DC00207047F1 +:1083D00000EBC15070472DE9FE4F804681EA030053 +:1083E000C00F0C46009021F0004123F00045B8EB8F +:1083F0000200A94105D24046214690461C460B4644 +:10840000024623F00040104347D0270DC7F30A006F +:10841000C3F30A510290401A019040286BDAC3F36B +:10842000130040F4801B0098924620B10023D2EB49 +:10843000030A63EB0B0B01985946C0F1400250460A +:1084400000F09BFA06460D4650465946019A00F048 +:10845000B3FA10EB08006141002487EA115284EA64 +:10846000E7731A4340D0009A62B3019A012A4FEA97 +:10847000075215DC001B61EB02014FF0004202EADB +:108480000752CDE90042001C41F5801132462B46CF +:1084900000F0EAFA03B0BDE8F08F40462146F9E764 +:1084A000001B61EB0201001C41F5801300185B41C9 +:1084B0002018A2F5001747EB030140EAD570B61962 +:1084C0006D4111E06D084FEA360645EAC0754FEA86 +:1084D0000752001B61EB0201001C41F580114908A5 +:1084E0004FEA30000019514132462B4603B0BDE837 +:1084F000F04F00F0AABA0098012240000023D0EB10 +:10850000020263EBE073009821464FEAE074B8EB97 +:10851000000061EB0401E9E783F000435BE781F0D1 +:10852000004158E72DE9FE4F81EA030404F00044BE +:1085300021F0004100944FF0000B23F0004350EA7B +:1085400001045ED052EA03045BD0C3F30A54C1F3C2 +:108550000A552C44A4F2F3340194A0FB0254C1F355 +:10856000130141F48011C3F3130343F4801301FB9F +:10857000024400FB034E840A970A44EA815447EA06 +:108580008357A4FB076802958D0A05FB07854FEA10 +:10859000932C04FB0C542705029D4FEA065847EA2A +:1085A0001637B5EB08056EEB070C870E920E47EAFF +:1085B000811742EA8312A7FB0201B6EB0B0164EBC1 +:1085C00000042B0D43EA0C335E1844EB1C50DA46D2 +:1085D0005146E7FB0201C5F313044FEA0B3343EAAC +:1085E00014534FEA0432019C43EA0603A4F10C043D +:1085F0000294009CCDE900B400F036FA03B0BDE867 +:10860000F08F00200146F9E72DE9F04D81EA0304DF +:1086100004F0004B21F0004514464FF0000A23F00F +:10862000004150EA050220D054EA01021DD0C5F3F2 +:108630000A570246C5F31303C1F31300C1F30A56E8 +:1086400040F4801543F48013A7EB0608101BD646B0 +:1086500008F2FD3873EB050002D308F1010801E0D0 +:1086600092185B41B8F1000F03DA00200146BDE823 +:10867000F08D00204FF48011064684460EE0171B53 +:1086800073EB050705D3121B63EB050306434CEAA6 +:10869000010C49084FEA300092185B4150EA01078B +:1086A000EDD152EA030012D082EA040083EA050108 +:1086B000084305D0101BAB4106D20122002306E07F +:1086C00000224FF0004302E06FF0010253101AEB5A +:1086D00006004CEB085110EB0A0041EB0B01BDE822 +:1086E000F04D00F0B2B970B521F0004303430CD057 +:1086F000C1F30A550024D5EB040564EB0403D61737 +:10870000AD1AB34102DB0020014670BD201841EBD9 +:10871000025170BDC10F80EAE0700844CA07962379 +:10872000002100F064B996230022114600F05FB9E1 +:108730000EB5C10F80EAE0700844CA07002140F27C +:1087400033438DE80E000A460B4600F08DF903B066 +:1087500000BD0EB540F2334102910021CDE9001178 +:108760000A460B4600F080F903B000BD00F000425D +:1087700020F00040C10DC0F3160040F400007F2936 +:1087800001DA00207047962903DCC1F19601C84048 +:1087900001E096398840002AF4D04042704720F02A +:1087A0000040C10DC0F3160040F400007F2901DA3B +:1087B00000207047962903DCC1F19601C84070473C +:1087C00096398840704770B5C1F30A5201F00045F0 +:1087D0000024C1F3130140F2FF3341F480119A42A7 +:1087E00001DA002070BD40F233439A42A2F23342D4 +:1087F00003DC524200F0D0F800E090402C43F1D06E +:10880000404270BDC1F30A5210B5C1F3130140F2EA +:10881000FF3341F480119A4201DA002010BD40F28A +:1088200033439A42A2F2334203DC524200F0B4F8DE +:1088300010BD904010BD00F0004230F000400AD062 +:10884000C10D01F56071C0F3160042EA0151C20882 +:1088500040071143704700200146704730B5041EA1 +:1088600071F1000404DB4FF00044404264EB01016D +:10887000141E73F1000405DB1C464FF00043524206 +:1088800063EB0403994208BF904230BD01F00043FE +:1088900030B421F0004150EA010206D00A0DA2F5E1 +:1088A0006072C1F31301002A02DC30BC0020704763 +:1088B000440F44EAC104C100E01830BC00EBC250D0 +:1088C00000F08CB8002801DBC0F10040002901DB7A +:1088D000C1F1004181427047002801DBC0F1004036 +:1088E000002901DBC1F100418842704730B50B46D9 +:1088F000014600202022012409E021FA02F59D42D0 +:1089000005D303FA02F5491B04FA02F52844151EA3 +:10891000A2F10102F1DC30BD2DE9F05F0546002037 +:1089200092469B4688460646814640241BE02846E0 +:1089300041464746224600F02FF853465A46C01A91 +:10894000914110D311461846224600F016F82D1A10 +:1089500067EB01084F4622460120002100F00DF888 +:1089600017EB00094E41201EA4F10104DFDC48464C +:1089700031462A464346BDE8F09F202A04DB203AD0 +:1089800000FA02F1002070479140C2F1200320FA62 +:1089900003F3194390407047202A04DB203A21FA60 +:1089A00002F00021704721FA02F3D040C2F1200208 +:1089B0009140084319467047202A06DBCB17203A1E +:1089C00041FA02F043EAE07306E041FA02F3D040D4 +:1089D000C2F1200291400843194670470029A8BF00 +:1089E0007047401C490008BF20F00100704710B4D8 +:1089F000B0FA80FC00FA0CF050EA010404BF10BC8D +:108A0000704749B1CCF1200421FA04F411FA0CF1B9 +:108A100018BF012121430843A3EB0C01CB1D4FEAF2 +:108A200000614FEA102042BF002010BC704700EBED +:108A3000C35010440029A4BF10BC7047401C49001B +:108A400008BF20F0010010BC704710B5141E73F170 +:108A5000000408DA401C41F1000192185B411A43FE +:108A600001D120F0010010BD2DE9F04D92469B464A +:108A700011B1B1FA81F202E0B0FA80F220329046F0 +:108A8000FFF77BFF04460F4640EA0A0041EA0B016C +:108A900053465A46084313D0114653EA010019D0F1 +:108AA000C8F140025046FFF777FF05460E46504694 +:108AB00059464246FFF761FF084305D0012004E014 +:108AC00020463946BDE8F08D0020054346EAE076B1 +:108AD0002C4337430A986305E40AA0EB0800002200 +:108AE000FD0A44EA47540A3002D500200146E9E76E +:108AF000010510196941DDE9084500196941BDE822 +:108B0000F04DA2E7C1F30A52C1F3130140F2FF3363 +:108B100041F480119A4202DA00200146704740F287 +:108B200033439A42A2F2334202DC5242FFF734BF8F +:108B3000FFF723BF064C074D06E0E06840F0010355 +:108B400094E8070098471034AC42F6D3FFF704FBD3 +:108B500074C6010894C6010870B58C1810F8015B42 +:108B600015F0070301D110F8013B2A1106D110F8C6 +:108B7000012B03E010F8016B01F8016B5B1EF9D1CA +:108B80002B0705D40023521E0DD401F8013BFAE750 +:108B900010F8013BCB1A921C03E013F8015B01F8BB +:108BA000015B521EF9D5A142D8D3002070BD000050 +:108BB00038B50121152007F02BFC0F20ADF800007F +:108BC00000248DF803406946064805F07DFB01202E +:108BD000ADF800008DF803406946034805F074FBCA +:108BE00038BD0000001001400008014010B5FFF73B +:108BF000DFFFBDE8104000F001B8000070B50121B2 +:108C000090B0084607F0E0FB384E304604F072FAA8 +:108C100037480090374801A90024052581E8310034 +:108C20008020CDE90440400006908000079020207D +:108C300008900002CDE909046946304604F0CCFAF8 +:108C40000121304604F04AFA0121480207F0E0FB16 +:108C500001208DF830008DF831000B944FF4602026 +:108C6000CDE90D04224C8DF83C504C3C0BA920461C +:108C700000F086F8052301220A21204600F0A4F81E +:108C8000052302220B21204600F09EF80523032233 +:108C90000C21204600F098F8052304220D212046DF +:108CA00000F092F805231A460021204600F08CF8C7 +:108CB0000121204600F02AF80121204600F01CF88E +:108CC000204600F0BBF8204600F053F80028FAD107 +:108CD000204600F0C2F8204600F044F80028FAD1FF +:108CE0000121204600F0AFF810B070BD080002402E +:108CF0004C240140DC1600200029816802D041F09C +:108D0000010101E021F001018160704700298168C3 +:108D100002D041F4807101E021F4807181607047DC +:108D20000D4910B5884202D1012144150AE00B49D2 +:108D3000884202D10121041504E0094988420AD180 +:108D40000121CC03204607F06FFB2046BDE8104010 +:108D5000002107F069BB10BD00240140002801403C +:108D6000003C0140014600208968490700D50120E8 +:108D70007047014600208968090700D50120704727 +:108D800010B542680E4B0C791A400B6842EA042277 +:108D90001343436082680B4B1A40D1E902432343DB +:108DA0004C7942EA440213438360C26A097C22F48C +:108DB0007002491EC9B242EA0151C16210BD0000F1 +:108DC000FFFEF0FFFDF7F1FF70B5072609290AD96C +:108DD000C568A1F10A0404EB4404A640B543A340CE +:108DE0001D43C56007E0056901EB4104A640B5439A +:108DF000A3401D4305611F23072A09D2446B521E5D +:108E000002EB820293409C4391400C43446370BD4B +:108E10000D2A09D2046BD21F02EB820293409C43BD +:108E200091400C43046370BDC46A0D3A02EB8202A8 +:108E300093409C4391400C43C46270BD816841F0F3 +:108E40000801816070470029816802D041F4A001C7 +:108E500001E021F4A00181607047816841F00401C4 +:108E60008160704738B590228DF8002001228DF87E +:108E700001208DF802108DF803000B480024C0F883 +:108E8000982105F0C5FF6D46285D05F0FFFF0A201B +:108E9000401E0004000CFBD1641CE4B2042CF3D38C +:108EA00005F0D8FF38BD00000080214208B501213F +:108EB000082007F0ADFAC020ADF8000003208DF8BF +:108EC000020010208DF803006946054805F0FCF902 +:108ED00004480121C0F89C11C0F8981108BD000099 +:108EE000000C01400080214210B52248FFF718FF16 +:108EF0002148FFF715FF214802F0FEF9204802F053 +:108F0000FBF9204804F0F6F81E48143004F0F2F89B +:108F10001C48283004F0EEF81A483C3004F0EAF817 +:108F20001848503004F0E6F81648643004F0E2F8CF +:108F30001448783004F0DEF8134805F057F9134868 +:108F400005F054F9124805F051F9124808F02EFDC9 +:108F500011480AF02DFD11480AF02AFD10480AF0C8 +:108F600027FD10480AF024FDBDE810400E480AF025 +:108F70001FBD0000002401400028014000640040A3 +:108F80000068004008000240000801400014014051 +:108F90000018014000040040003801400044004037 +:108FA00000480040004C0040005000402DE9F84FC0 +:108FB000FE49FF4FB1F82B0010F0600F07D14207B8 +:108FC00005D4420403D4820401D4000501D5052050 +:108FD00078704878002488460C2814D1D8F80710F7 +:108FE00042F21070454681420DDD7C70AC70C5F8D0 +:108FF00003403C21EF48FFF7E0F80C20687009F0CF +:10900000C9FB01F0CBFED8F80700E849401CDFF8A7 +:10901000A4A3C1F807007878DFF89CB30226DFF834 +:109020009C930AF1900AAAF1160506287BD2DFE884 +:1090300000F0033DB0F2F1F009F0ACFB3E21E04856 +:10904000FFF7BBF83C21DB48FFF7B7F87C74DD483D +:10905000FC853C8601210170BC714FF4FA60788672 +:109060003C712C806980A5F80540A5F807106C7448 +:1090700099F89701012806D079703976E972BDE830 +:10908000F84F01F08BBE3878E87262280BD3CE48D7 +:109090000078012807D09BF800100029EFD11C218F +:1090A0008BF80010EBE779703976E8E7C748047071 +:1090B0007C74BC85FC8701F07DFA387E012866D17E +:1090C000BC4D288F400446D588F8026099F86B00A3 +:1090D000022808D0B6484FF4FA61743009F066FBF4 +:1090E00001282FD036E0B2484FF47A71743009F07D +:1090F0005DFB012820D1B879411CB971022811D239 +:109100002021B34805F061F9DFF8C89202214846F2 +:1091100005F05BF90121484605F057F94FF4FA7064 +:1091200004F001F900E032E0ABA00BF033FBA04803 +:109130000021743009F03AFB9E486D30C0880CF075 +:1091400093FF07E0A9A00BF025FB9948002174309C +:1091500009F02CFBAC6395F83800C00717D098F8DD +:109160000210022902D0012188F8021090484FF421 +:10917000FA61743009F01AFB012807D1A1A00BF0A5 +:1091800009FB8B480021743009F010FB7E70BDE8AC +:10919000F88F01F00FFABC714FF480418D4805F053 +:1091A00014F9AC74387EAB460028F0D0814D44F2FF +:1091B0002001A86B084201D1400602D50120787039 +:1091C000AC63288F40040BD599F86B00022804D1BA +:1091D00078486D30C0880CF047FF88F80260AC63B7 +:1091E00095F83800C007D2D0E878AA2802D0787C59 +:1091F000B8B13BE0032078700421764805F0E5F82B +:109200008BF811404FF4FA7004F08DF87C74BC8533 +:1092100002E0EEE3E8E15BE0BDE8F84F7FA00BF091 +:10922000B9BA63486421783009F0C0FA01280AD13C +:109230000CF038FF5E488AF80B4000217830CAF8FD +:10924000044009F0B3FA9AF80B10504611290DD1D9 +:10925000417C02290AD1426841F6EC41B1EB124F40 +:1092600004D17E74C472CAF8044002E0787C0228FB +:109270000CD102200CF016FFB88D0021401CB885DF +:10928000032078744A487C3009F090FA787C0328EF +:109290007FF47DAF9AF80B10504613290DD1417C15 +:1092A00002290AD1426841F6EC41B1EB124F04D1D8 +:1092B000AC63C472CAF804407C743D4832217C30EF +:1092C00009F074FA0128E3D17C74BC85AC635EE7D5 +:1092D00001F070F9374944F22002886B104201D145 +:1092E000400602D5012078708C63324890F838002F +:1092F000C00759D0787C28BB2D483221803009F036 +:1093000055FA01280BD100210CF096FD28488AF867 +:109310000B4000218030CAF8044009F047FA9AF85F +:109320000B10504611290DD1417C06290AD1426803 +:1093300041F6EC41B1EB124F04D17E74C472CAF80D +:10934000044002E0787C02280AD1002102200CF0BF +:1093500073FD0320787416480021843009F026FA42 +:10936000787C03286CD19AF80B105046132911D140 +:10937000417C06290ED1426841F6EC41B1EB124F17 +:1093800008D17C74C4720B48CAF80440816B21F088 +:109390000101816306483221843009F007FA01286F +:1093A0004ED17C74034847E04AE000003E2A00208A +:1093B00058020020740B00207C070020902A002017 +:1093C000001700208B070020820700201C050020CA +:1093D00000100140000C0140445F43445A5F484183 +:1093E0004E44494E475F43484D0A0D00424D535F7E +:1093F00050524F544F43414C5F4742323031310A53 +:109400000D00000052455620445F43445A5F4841D6 +:109410004E44494E475F43524D0A0D005245562077 +:10942000445F43445A5F48414E44494E475F43526C +:109430004D2041410A0D0000816B21F00101816343 +:10944000DFF834A4DAF83800810704D520F00200F0 +:10945000CAF8380050E0410725D5B88D401C80B2CD +:10946000B885F97988421CD3AAF8304098F80000F2 +:109470000C2803D09BF8001041B10AE04FF4804162 +:10948000FE4804F0A4FF0120A87402E00D218BF82F +:109490000010AA200CF004FFDAF8381021F00401C3 +:1094A00028E00020F6E7000726D59AF81A00AA2837 +:1094B00002D1F3A00BF06EF9B88DF979884243D34D +:1094C00098F800000C2803D09BF8001041B10AE086 +:1094D0004FF48041E94804F07AFF0120A87402E0CB +:1094E0000D218BF80010AA200CF0DAFEDAF8381003 +:1094F00021F00801CAF838109AF81A00AA287FF457 +:10950000E6AEDFF894A3E549DAF80400009088425B +:1095100048DDB9F8590000F5FA70FFF704F9009931 +:10952000FFF7DAF93ED2042078704FF0010987F88E +:109530000290DB49DAF80000DA4A014456469142CB +:1095400004D2FFF72CF903E00020CDE740F61C40E1 +:1095500028807068FFF723F9A7F84200BC857C7467 +:109560000021D1483F1D09F021F9D0A00BF012F9DC +:10957000D7498BF800400C70D6497C703C700C7059 +:10958000BC877C8398F800100C2903D00D218BF840 +:109590000010FCE54FF48041B84804F018FF85F84E +:1095A0001290F4E5B88D411CB98544F620618842DB +:1095B000EFD905207870BC857C749BF8001009B940 +:1095C0008BF80060DAF804402046FFF7E8F8A7F8C7 +:1095D00042002046FFF7CAF8B9F85920BDE8F84F15 +:1095E00001B2BDA00BF0D6B8B878DFF8208301280F +:1095F00002D0022864D0BEE09F48C54AB0F81B10D4 +:10960000B1F5FA6F2FD9B9F8590000F5FA739942FC +:1096100029D2A149D1F804B0934507DD00F5967031 +:10962000FFF781F85946FFF757F92BD39A4841685D +:10963000B848814291484FF480410BDD04F0C5FEEB +:10964000AC740BE0BE704FF480418C4804F0BDFE5A +:10965000AC748FE004F0BBFE0120A8743C864FF48C +:109660007A70788687E08C48D0F804B0934510DD96 +:10967000B9F8590000F59670FFF755F85946FFF70D +:109680002BF906D2388E411C3986798E8842D9D87A +:1096900071E03C864FF47A70788609F07BF87E485A +:1096A00041689C48814275484FF4804103DD04F0D5 +:1096B0008CFEAC745FE004F08AFE0120A8745AE0CE +:1096C0007548954940680090884240DDB9F85900D6 +:1096D00000F59670FFF727F80099FFF7FDF836D2EE +:1096E0000FF0A6FD012846D13879142826D27948F2 +:1096F000007810BB7879012816D198F81B10012941 +:1097000002D1B8F8261079B1388E411C398641F261 +:10971000883188422FD93C8609F03CF802F01AFEC5 +:10972000A8F826407C7126E03C8630B909F038F86C +:109730003879401C3871012078711CE09BF80010CA +:1097400011B911218BF800106148067013E0388EB2 +:10975000411C398641F2883188420CD96F4A4FF05A +:10976000010BA2F800B0798609F014F8594887F87F +:1097700002B004703C8611F06FFB08B154480670CB +:1097800005F0BEFD01282FD181033C4804F01DFEE9 +:10979000AC7498F800104046012925D1C17E0129FA +:1097A00022D199F897214FF4967B012A26D0B9F857 +:1097B0007511B8F81C0002F0A4F9584528D3B8F880 +:1097C0001C20B9F875112BE004212C4804F0FFFD92 +:1097D0000120687404E00421284804F0F6FD6C744C +:1097E0004FF4FA7003F09FFD0CF0B4FE08B3384854 +:1097F000007801281DD002281BD03BE0DFF8209123 +:10980000B8F81C00B9F83C1002F07BF9584503D2B7 +:10981000687C0028D8D0E7E7B8F81C20B9F83C10DD +:109820008A42E1D9B0F5AF7FDED9687C0128D2D079 +:10983000DAE728480121017025480078022801D183 +:1098400008F0A8FFF88D401C80B2F885B0F5FA6FDB +:1098500010D998F81B20012A07D1B8F81E109629B4 +:1098600003D342F21071884204D908F093FFFC85BB +:109870000520787056E00000740B0020000C0140B9 +:1098800043445A5F48414E44494E475F43524D203E +:1098900041410A0D00000000E81600200080BB4492 +:1098A000FF3FBEBAFFFF18009C02002043445A5FEE +:1098B00048414E44494E475F43524D204141207438 +:1098C0006F204368617267696E670A0D00000000CF +:1098D000820700201C0500204241545F53616D70D7 +:1098E0006C655F566F6C74202564203E3C20426D91 +:1098F000734D6178566F6C7420256420656E6469C1 +:109900006E67206368617267650D0A0000170020AA +:1099100000603D4500C05A450000FA442E05002075 +:10992000FC0D002000F046FE00F02CFC00F0F6FCE0 +:109930003221644808F03AFF012805D10CF052FAB0 +:109940000021604808F032FF5E48FA21001D08F04F +:109950002DFF01283CD1787C68BB5A48C8211438B7 +:1099600008F024FF01280DD10CF0F4FA8AF80B401E +:10997000CAF80440B88D0021401CB88551481438FD +:1099800008F014FF9AF80B10504611290DD1417CB4 +:1099900011290AD1426841F6EC41B1EB124F04D1D2 +:1099A000BC85C472CAF8044003E0B88D022802D90D +:1099B000BC857E7402E0787C022809D102200CF07C +:1099C000C9FA40487C74BC850021001D08F0EEFEF9 +:1099D0003C48FA21083008F0E9FE01287FF477AC12 +:1099E0000CF0AAFCBDE8F84F36480021083008F01A +:1099F000DDBE08F0CFFEFC70464688F80240DFF876 +:109A0000C880FC874FF48041404604F0DEFC2D48BE +:109A1000AC74FA210C3008F0C9FE012807D10020EF +:109A20000CF05AFC274800210C3008F0BFFE322110 +:109A3000244808F0BBFE012806D100200CF06CFD84 +:109A40000021204808F0B2FED6F8071041F2883015 +:109A5000814214DC70780C2811D099F89701012804 +:109A6000BCD1E87A6228BFF432AC184E308F400483 +:109A700013D57C70B463687C012805D00DE01348D1 +:109A80007C7084633C760FE00421404604F09DFC2A +:109A90006C744FF4FA7003F046FC96F83800C00777 +:109AA0003FF415AC7C70B463687C012896D1042126 +:109AB000404604F08AFC6C74BDE8F84F4FF4FA702D +:109AC00003F031BCE0020020000C0140740B0020C8 +:109AD00000F00F01000900EB800001EB4000C0B274 +:109AE000704710B5012006F0ABFCBDE81040002027 +:109AF00006F0A6BC014908607047000000860D42D0 +:109B00002DE9F04F724C734AA1B041F20400A4F861 +:109B10000500D0790026012800D1D6716E4F106D56 +:109B2000F97A10B9917301201065DFF8B0B10A25F8 +:109B30005846BBF81230BA46B3FBF5FCB3FBF5F35D +:109B400084F807C01B0A2372BBF81430B3FBF5FC82 +:109B5000B3FBF5F384F809C01B0AA372BBF81630F7 +:109B6000B3FBF5FCB3FBF5F384F80BC01B0A2373BE +:109B7000038BB3FBF5FCB3FBF5F384F80DC01B0AB4 +:109B8000A373B0F81B30B3FBF5FCB3FBF5F384F81B +:109B90000FC01B0A2374B7F80730B3FBF5F7B3FB0C +:109BA000F5F367741B0AA374BBF83200E074000A73 +:109BB00020754B480078431E632B01D8607500E088 +:109BC0006175DFF82081907BA075DFF81C91D8F8D3 +:109BD0000800464F484508D2B84206DA4449FEF725 +:109BE00026FBFEF7DCFDE07500E0E675D8F80C001A +:109BF000484508D2B84206DA3D49FEF718FBFEF7A1 +:109C0000CEFD207600E02676D8F81000484508D230 +:109C1000B84206DA3649FEF70AFBFEF7C0FD607669 +:109C200000E06676334931F8590FB0FBF5F2B0FB2E +:109C3000F5F0A276000AE0764888B0FBF5F2B0FBBA +:109C4000F5F02277000A6077488DB0FBF5F2B0FBA3 +:109C5000F5F0A277000AE077888DB0FBF5F1B0FB54 +:109C6000F5F084F82010000A84F821009AF8110019 +:109C700084F82200BBF8300084F82300000A84F83E +:109C800024001D48C17E01291FD0808CB0FBF5F156 +:109C9000B0FBF5F084F82510000A84F82600202097 +:109CA00060801648017C491C017415A00AF072FD01 +:109CB00020AA6946064803F0ADFA064800214C3058 +:109CC00008F074FD21B0BDE8F08F808BDEE7000066 +:109CD000723400207C070020EE0B0020740B002063 +:109CE00058020020E8160020000020C20000F642C2 +:109CF00000002042902A002000170020F8350020A4 +:109D000073656E6420436861726765206461746185 +:109D10000A0D00002DE9F04FDFF818A1A1B041F2C3 +:109D200009010AF2EA24AAF805104FF0780BA4F80A +:109D300017B040F2DE30404DA4F81D004FF47A70A9 +:109D4000AF8F24F80D7F6E8F6680A0802889FEF784 +:109D500000FD3A4A3A4BFEF7E5FBFEF753FDC3B26E +:109D6000E371EA7EA2714FF03209A4F80890E88FFF +:109D70002946C0F30900A081B5F827C0C98A0D3C67 +:109D80004FF06408BCF1000F07D1B5F806C00CFB1A +:109D900001FC9CFBF8FCA5F827C0B5F825C0BCF178 +:109DA000000F07D1B5F804C00CFB01FC9CFBF8F1D7 +:109DB000A5F8251095F827C084F81BC095F8255004 +:109DC00025778AF807703C0A8AF808408AF8096003 +:109DD000340A8AF80A40E8248AF80B4003248AF8F7 +:109DE0000C408AF80D308AF80E208AF80F90002275 +:109DF00051468AF810208AF811B08A74C874000A93 +:109E0000087581F815C08D75DE20C8750C760D4972 +:109E10001220AAF80200087C401C08740AA00AF06C +:109E2000B9FC20AA6946034803F0F4F921B0BDE863 +:109E3000F08F000072340020FC0D00207B14AE4730 +:109E4000E17A843FF835002053656E6420436861F1 +:109E50007267696E6744617461200A0D000000003A +:109E600030B5A1B000201D49ADF880001C4C41F276 +:109E70000300A1F80500E07BC8711A480125022300 +:109E800000780422012809D0022807D003250328DE +:109E900004D0042805D0052806D008E00B724D72C6 +:109EA00005E00D724A7202E00A72052048722078BD +:109EB00088724A800C49087C401C08740BA00AF088 +:109EC00069FC20AA6946054803F0A4F9044800216A +:109ED000483008F06BFC21B030BD00007234002027 +:109EE0007C07002059020020F835002073656E645D +:109EF0002073746174652064617461200A0D000030 +:109F00002DE9FE4F002738490097019702970878FE +:109F1000DFF8D8803C4650B3012826D10F70344F6B +:109F2000DFF8D090DFF8D0A000246D4608F11806C5 +:109F300058F82400FEF77FFC02460B463846494697 +:109F4000FEF762FB00225346FEF7E6FAFEF79EFCA0 +:109F500045F8240004F0C6F8FEF7DCFB06EB8401AC +:109F6000641CA4B28860032CE2D3BDE8FE8F48785D +:109F70001E4D401CC0B2183D89464870142810D2AE +:109F800005F1240636F81400FEF7CDFB55F8241031 +:109F9000FEF74DF945F82400641CA4B2032CF1D35C +:109FA000E3E7124EDFF854B0DFF854A00C3E55F84A +:109FB00024005946FEF7C5F96FF00B01FEF7FFF9D3 +:109FC0005146FEF78CF948F8240046F8247045F80D +:109FD0002470641CA4B2032CE9D389F80170012118 +:109FE00089F80010C1E70000F4040020D01600201A +:109FF0009A999999999913400000F03F0000A04167 +:10A000003333534010B5124CA2B041F22100A4F8F2 +:10A010000500A4F246404069E071010A2172010C7A +:10A020006172000EA072042004F5C3716080087C88 +:10A03000401C087407A00AF0ADFB20AA6946204620 +:10A0400003F0E8F80421E01D0EF0FCFA22B010BD88 +:10A05000723400200A0D7368656E676A6979696EEB +:10A06000676461200A0D000010B50F4CA2B04FF4D8 +:10A070008150A4F805005520E071AA20207202202A +:10A0800004F5C3716080087C401C087407A00AF0C6 +:10A0900081FB20AA6946204603F0BCF80221E01D9E +:10A0A0000EF0D0FA22B010BD723400204F5441207F +:10A0B00041434B200A0D000000B51A49A1B041F2FE +:10A0C0000800A1F8050018A001F2BE23026818A03C +:10A0D000DA6200681863A1F1420343F8492F01F2E4 +:10A0E000EA225860144809231373D0F8B500000B16 +:10A0F0009060C873020A0A74020C4A74000E8874D5 +:10A10000CB740D20488001F5C371087C401C087495 +:10A110000AA00AF03FFB20AA6946024803F07AF839 +:10A1200021B000BD723400205332303100000000F5 +:10A130005169525569000000FC0D002073656E6482 +:10A1400020626D732076657273696F6E0A0D000070 +:10A1500010B501214FF0C05006F042F9012005F082 +:10A1600061FA074A116908784978C943C9B2884237 +:10A1700002D1411E042900D30020107010BD000040 +:10A18000E004002010B54FF47A711A4808F00EFB75 +:10A1900001282DD1184830F8051F408841434FF45D +:10A1A000616091FBF0F0FEF7B5FA144C54F8031F10 +:10A1B000FEF73DF82060FEF73EFB114A114BFEF71B +:10A1C000B1F90022104BFEF71FFAFEF71BFB0A4CF9 +:10A1D00000217A3C6086074808F0E8FAA4F14800BC +:10A1E000618E01814189491C4181208E401C20865D +:10A1F00010BD0000B4020020EE0B00203E2A00201B +:10A200009A9999999999F13F0088C3402DE9F047AF +:10A21000DFF8FC803F4A4049B8F80500508391F8C8 +:10A220009731032B71D10A23B0FBF3F45483B1F8B7 +:10A230009801A04269D3B1F89A01A04265D80020E4 +:10A24000914601EB4005B5F89C21A24258D8B5F8DB +:10A250009E21A24254D901EB4000B5F89C61B0F8B0 +:10A260009E0105F5CE75801BFEF754FA8246688C78 +:10A270002F8CC01BFEF74EFA5146FEF762F80546DA +:10A280003846FEF750FA82464F46A01BFEF742FAC8 +:10A290002946FEF724F85146FDF7C9FFFEF77FFA7D +:10A2A000C0B2F87398F80B10454601B9E872C82C93 +:10A2B00003D97978032900D2E872E97A01F021FC08 +:10A2C000032805D8E97AF87B814216D8E87214E0B1 +:10A2D000104841F28831683008F068FA01280CD142 +:10A2E000E87A602804D2F97B884201D8401CE872E1 +:10A2F00008480021683008F059FA0120BDE8F087CD +:10A30000401CC0B210289CD3F8D10020F6E7000012 +:10A31000EE0B002058020020902A00202DE9F04189 +:10A320006A4E0021728DB08B824202D070853167F7 +:10A330003174674C4FF4FA62E07A6428306F00F1B0 +:10A340000103336704D2904207D90220316703E04A +:10A35000904202D906203167B0835E4DB5F8831074 +:10A36000B5F85900814201D9A5F88300B5F88520D8 +:10A37000B5F85B108A4201D9A5F88510B4F805102C +:10A38000B4F80720C827514342F2107291FBF2F152 +:10A39000B164B18B4FF4967807295DD2DFE801F004 +:10A3A0005C5E0422303737002188814200D920804A +:10A3B00046484FF47A716C3008F0F8F901284DD115 +:10A3C0006088B5F88510884201D21E3060806088B0 +:10A3D000642801D2642060803C4800216C3008F081 +:10A3E000E5F93BE0B5F883002080B5F88500FEF77D +:10A3F000B0F9394A394BFEF795F8FEF703FA24E035 +:10A40000B5F883002080B5F8850040081DE095F878 +:10A4100097019621012803D0B5F8830020800BE036 +:10A420002F48304AC08812885043B5F8832090FBEB +:10A43000F2F080B2642801D261800FE0962801D248 +:10A4400067800BE0C82802D2FA20608006E0FA2874 +:10A4500004D2A4F8028001E00120B08322480078F1 +:10A46000012804D121480088404500D86780B07891 +:10A47000022802D0012803D00FE0B5F883000BE0DA +:10A480001B481C491C4A00680144914202D2FEF755 +:10A4900086F901E040F61C4020806188B5F885000F +:10A4A000814200D960802188B5F85900814200D9E5 +:10A4B00020806188B5F85B00814200D960806088A7 +:10A4C0001E2801D21E206080BDE8F08158020020C5 +:10A4D000EE0B0020902A00209A9999999999E93FCA +:10A4E000FC0D0020240500201C050020260500206E +:10A4F000E8160020FF3FBEBAFFFF180070B52949DB +:10A50000294D31F8590FE8848988884201D9401AC9 +:10A510002885A97B687B254C814224D0E17A01B94A +:10A52000E072E17A01F0EDFA032806D8E17A687B5F +:10A53000814224D8E072A87321E01B484EF66021C6 +:10A54000643008F033F9012819D1E07A622804D286 +:10A55000697B884201D8401CE072134800216430B6 +:10A5600008F024F90BE010481149603008F01EF99A +:10A57000012809D1E07A602801D2401CE0720A4823 +:10A580000021603008F012F9E07A6421642800D3D9 +:10A59000E172E07AA0F147021D2A00D35A21A1817D +:10A5A00070BD0000902A002058020020EE0B002011 +:10A5B000C0D4010070B5164D164C95F897010228CD +:10A5C00009D0012803D0FFF721FE20B105E0124891 +:10A5D0000078E07201E0FFF791FF10481049114A3E +:10A5E00040680144914202D2FEF7D9F80CE00948D4 +:10A5F0007A38B0F81B00B0F5FA6F03D9B5F85910E6 +:10A60000884201D3B5F88300A4F8050070BD0000AE +:10A61000902A0020EE0B002058020020E8160020AF +:10A62000FFFF1EBBFFBF790070B5094D130AD2B200 +:10A6300005F5807605E010F8014B5C402B5D53403A +:10A64000325D491E89B2F6D242EA032070BD000095 +:10A65000C0BB010870B5094DFF22134605F5807691 +:10A6600005E010F8014B54402A5D5A40335D491E05 +:10A6700089B2F6D243EA022070BD0000C0BB0108D7 +:10A68000022101A005F08ABF415400000A2101A067 +:10A6900005F084BF41542B53544154453D3F0000C5 +:10A6A00010B588B0044620216846FDF786FD2021BC +:10A6B0006846FDF782FD224606A168460AF07AF850 +:10A6C0006846FDF797FD0146684605F067FF08B04C +:10A6D00010BD000041542B4E414D453D25730000F7 +:10A6E000092101A005F05ABF41542B4E414D453D73 +:10A6F0003F0000000D2101A005F050BF41542B5533 +:10A700004152545F4346473D3F0000000B2101A0EA +:10A7100005F044BF41542B564552494F4E3D3F0032 +:10A7200070B5214D687801283DD1204C207806284D +:10A7300030D2DFE800F003130B2F1A2307221CA1ED +:10A740001D48FDF75EFD28BB022015E00A221BA173 +:10A750001948FDF756FDE8B901200DE01A491648E1 +:10A76000FDF736FDB0B1042006E00B2217A1124818 +:10A77000FDF747FD70B9052020700BE00E486060C2 +:10A78000688A20810C480188A1F5B442A53A01D11C +:10A790000EF0BEFD002068706882BDE87040802128 +:10A7A0000548FDF70ABD70BD7C070020F835002084 +:10A7B00041542B4F4B0D0A001C31002041542B4FAC +:10A7C0004B0D0A3033303300A02A002041542B4F68 +:10A7D0004B0D0A30310D0A0010B5114C20780628B7 +:10A7E00019D2DFE800F0030B07180F19BDE810407D +:10A7F000FFF746BFBDE8104000F0B0BABDE810401A +:10A8000000F070BA00F096FA064890F8760008B1A9 +:10A81000012800D1A07010BDBDE8104000F004B8C0 +:10A82000F8350020902A00202DE9F041404E96F89E +:10A83000A800012823D03F4D3F4A4FF47A71E984A4 +:10A840003046177C0123002490F87600142F06D997 +:10A8500010B1012802D002E0947000E09370977864 +:10A86000052F0CD2DFE807F003070D0B5700BDE8FA +:10A87000F04100F007BA00F0C5F986F8A840BDE83D +:10A88000F0812C48343007F091FF0128F7D1A88CD3 +:10A89000401C80B2A884092800D9AC842548002136 +:10A8A000343007F083FFA88CA8B1012817D0022804 +:10A8B00019D00328E3D0042819D005281BD0062876 +:10A8C0001DD007281FD0082821D00928D7D1BDE8DE +:10A8D000F0410BF067B8BDE8F04100F0B5B8BDE855 +:10A8E000F041FFF70DB9BDE8F041FFF7B9BABDE897 +:10A8F000F04100F023B8BDE8F041FFF7DDBBBDE853 +:10A90000F041FFF707BABDE8F0410BF0A7B8BDE88A +:10A91000F0410BF009B8517C4D1C55741429AED987 +:10A92000147018B10128AAD19370A8E79470A6E713 +:10A93000902A00207C070020F835002070B5A2B0D6 +:10A94000374C0021ADF8801041F20700A4F8050053 +:10A95000344842F21076838BC28BE37103FB02F51D +:10A9600095FBF6F51B0A23726272120AA272E57257 +:10A9700090F8292012B12832227300E0217390F858 +:10A98000282012B12832627300E061732022A27382 +:10A990005F22E273C37E2374C28C6274120AA274B3 +:10A9A000E374B0F809202275120A6275B0F80B2022 +:10A9B000A275120AE275B0F801202276120A6276B8 +:10A9C000B0F80520A276120AE276C2792277428A8E +:10A9D0006277120AA27790F82A2012B12832E27721 +:10A9E00000E0E17790F82B0018B1283084F82000BF +:10A9F00001E084F820100CA009F0CCFE1A20608041 +:10AA000020AA6946064802F005FC0C49087C401C57 +:10AA1000087400210A4807F0C9FE22B070BD00008A +:10AA2000723400200017002073656E642044434494 +:10AA30004320646174610A0D00000000F8350020B5 +:10AA4000D007002005F09EBD30B5A1B00020614CBC +:10AA5000ADF88000604941F20200A4F80500486C9E +:10AA60005F4B401C486404F8070F000A60705B48A5 +:10AA700090F86B10A1705A8A0A21B2FBF1F5B2FB73 +:10AA8000F1F2E570120A22719A8AB2FBF1F5B2FB7B +:10AA9000F1F26571120AA271DA8AB2FBF1F5B2FB2A +:10AAA000F1F2E571120A22721A8BB2FBF1F3B2FBDA +:10AAB000F1F26372120AA27290F88D20E272B0F87D +:10AAC0005320B2FBF1F22273B0F863206273120AD2 +:10AAD000A273B0F88E20B2FBF1F3B2FBF1F2E37394 +:10AAE000120A2274B0F8B320B2FBF1F26274B0F82B +:10AAF000B120B2FBF1F2A274B0F85D20E274120A48 +:10AB00002275B0F85F206275120AA275B0F859205C +:10AB1000E275120A227690F8B020627690F88920C9 +:10AB2000A27690F88A20E27690F88B20B2FBF1F2C0 +:10AB3000227790F88C20B2FBF1F2627790F8B52082 +:10AB4000323AA27790F8B620323AE27790F8B720FE +:10AB500084F8202090F84D2084F8212090F84F2090 +:10AB600084F8222090F8512084F8232090F8872040 +:10AB700084F824201B4A927884F82520B0F890208D +:10AB8000B2FBF1F184F8261090F8921084F82710A7 +:10AB900090F8930084F8280010490E48112295314E +:10ABA0003030FDF7F1FA10A009F0F4FD3A2024F856 +:10ABB000050C20AA6946074802F02CFB1049087CC6 +:10ABC000401C087404480021403007F0EFFD21B01C +:10ABD00030BD0000723400207C070020902A002045 +:10ABE000740B00203E2A002073656E642068656146 +:10ABF0007274626561742064617461200A0D0000E2 +:10AC0000F835002010B592B00020ADF8400040F6B5 +:10AC1000B831134807F0CAFD01281FD1114C41F289 +:10AC20000100A4F8050010A009F0B4FD1349A4F137 +:10AC30004200CA6E40F8492F096F416010490A6806 +:10AC400082604968C1601020608010AA6946204671 +:10AC500002F0E0FA0021024807F0A8FD12B010BD92 +:10AC6000B80700207234002073656E64204C6F6753 +:10AC7000696E20646174610D0A000000902A002052 +:10AC800030BB010810B592B00024ADF8404041F24D +:10AC900088310C4807F08AFD012810D101030A48C9 +:10ACA000A0F80510448009A009F074FD10AA6946B7 +:10ACB000054802F0AFFA0021024807F077FD12B014 +:10ACC00010BD0000B40700207234002053656E648C +:10ACD000205265676973746572656420646174618C +:10ACE0000A0D000010B54FF47A71104807F05EFDB0 +:10ACF000012819D10D4C2C3C607B20B1012804D0D7 +:10AD0000022807D00AE0012007E00948FFF7C8FC45 +:10AD1000022002E0FFF7E4FC00206073BDE8104071 +:10AD20000021024807F042BD10BD0000A807002026 +:10AD3000A02A002010B540F6B831074807F036FDCC +:10AD4000012807D1FFF7A2FCBDE81040002102480E +:10AD500007F02CBD10BD0000AC07002010B54FF46B +:10AD60007A710D4807F022FD012814D10A4C283CC5 +:10AD7000207B10B1012804D007E0FFF7C7FC0120B9 +:10AD800002E0FFF7B7FC00202073BDE8104000216F +:10AD9000014807F00BBD10BDA40700202DE9F047C6 +:10ADA00031214448FDF709FA42480D213130FDF7C1 +:10ADB00004FA404813213E30FDF7FFF93D480127D2 +:10ADC0003D4D077047700026867095F8B010C17031 +:10ADD000B5F85F1051B18180B5F859404FF4FA6A67 +:10ADE00040F6AC59544504D3C48004E04FF47A7162 +:10ADF000F1E7A0F80690DFF8BC8030A2A8F10408C3 +:10AE00001268C8F80C201F21C66001740B21417420 +:10AE10000A218174C6740675102141758775C6753F +:10AE200095F8951008F11C00FF294FF0110204D08D +:10AE300021499531FDF7A8F902E022A1FDF7A4F917 +:10AE400025A140460A6840F82D2F496841601949FC +:10AE5000B5F8B10031310880B5F85B00642801D243 +:10AE60004FF4FA704880B5F863008880A4F2D1707E +:10AE700040F6C312904201D2CC8001E0A1F80690C6 +:10AE80006E2008724FF49670A1F80900B5F86700BB +:10AE9000504501D840F6B830A1F80B0005481E21F6 +:10AEA0003E304180B5F883100180C6720774BDE85A +:10AEB000F0870000B00B0020902A00204259445433 +:10AEC000000000004C4656324132314B364133309F +:10AED00039323339390000005330303148303031A5 +:10AEE00000000000FEE7000000B585B06A460021C2 +:10AEF000044800F09FFC694600200BF04BFD05B0B4 +:10AF000000BD00000064004070B5174C4FF40075A0 +:10AF10002946204600F0C6FA01280CD113492046E4 +:10AF200000F0A6FA012802D100200BF0D3FD29463B +:10AF3000204600F0A5F94FF480652946204600F030 +:10AF4000B1FA01280FD109492046891C00F090FA76 +:10AF5000012802D100200BF0D5FD29462046BDE88E +:10AF6000704000F08DB970BD006400400200F01028 +:10AF700010B51A4C0021204600F0F6FC022806D03D +:10AF8000012824D00022002108460BF02FFD0121CA +:10AF9000204600F0E9FC022806D0012819D0002242 +:10AFA000012100200BF022FD0221204600F0DCFCF4 +:10AFB000022806D001280ED00022022100200BF02A +:10AFC00015FD2046BDE81040012100F059B90122CD +:10AFD000D9E70122E4E70122EFE700000064004026 +:10AFE00070B58AB005F084FC0121092005F010FA43 +:10AFF0000121480605F0F4F90121880605F0F0F971 +:10B00000494E0021304600F0CFFB7014ADF820000F +:10B0100003208DF822001820444C8DF8230008A945 +:10B02000204603F051F9A014ADF8200048208DF817 +:10B03000230008A9204603F047F9002501248DF8D4 +:10B040001A508DF81B4008208DF818008DF8165006 +:10B050008DF817400620ADF8140007958DF81940BB +:10B0600005A9304600F07AFA0E208DF80E008DF812 +:10B070000F508DF81040ADF80450ADF80850ADF801 +:10B080000650ADF80A50ADF80C408DF8114001A8FB +:10B0900000F088F901221021304600F057FA4120D3 +:10B0A0008DF800008DF801408DF802508DF80340B6 +:10B0B000684604F043FA01221146304600F046FA91 +:10B0C00001225102304600F041FA0122910230463D +:10B0D00000F03CFA0122D103304600F037FA01219A +:10B0E000304600F061FB3F208DF800008DF80140F4 +:10B0F0008DF802508DF80340684604F01FFA422094 +:10B100008DF800008DF801408DF802508DF8034055 +:10B11000684604F013FA05F0F5FB05A009F03AFBC8 +:10B120000AB0002070BD000000680040000C014023 +:10B1300063616E2032206F70656E210A000000008E +:10B1400000B585B06A460121064800F073FB9DF802 +:10B150000900002803D1694601200BF01BFC05B053 +:10B1600000BD00000068004070B51B4C4FF4007536 +:10B170002946204600F096F9012810D1174E2046A6 +:10B18000314600F075F9012805D10BF0A3FC3146DA +:10B19000204600F05DF82946204600F071F84FF493 +:10B1A00080652946204600F07DF9012813D10B4E19 +:10B1B0002046B61C314600F05BF9012805D10BF0A2 +:10B1C000A1FC3146204600F043F829462046BDE860 +:10B1D000704000F055B870BD006800400200F010EB +:10B1E00010B51A4C0021204600F0BEFB022806D004 +:10B1F000012824D00022002101200BF0F7FB0121BF +:10B20000204600F0B1FB022806D0012819D0002208 +:10B21000012108460BF0EAFB0221204600F0A4FBC6 +:10B22000022806D001280ED00022022101200BF0B6 +:10B23000DDFB2046BDE81040012100F021B80122CD +:10B24000D9E70122E4E70122EFE7000000680040AF +:10B250000A4A914202D1002181617047C1F3130271 +:10B260008B0101D5C26070474B0101D50261704767 +:10B27000090101D582607047426070477000F0306C +:10B2800030B5082310240422B1F5007F1DD010DC56 +:10B29000202929D007DC012921D0042922D008291E +:10B2A00000D1C46030BD402920D0B1F5807FF9D1F4 +:10B2B0000BE00025B1F5004F06D008DCB1F5806F3A +:10B2C00003D0B1F5006FEDD18561426030BDB1F5BD +:10B2D000803F0DD0B1F5003FF8D1446030BD054945 +:10B2E000816030BDC36030BD036130BD046130BDDD +:10B2F000436030BD01010100094910B588424FF09B +:10B30000010101D14C0601E04FF08064204605F0B8 +:10B3100073F82046BDE81040002105F06DB800002C +:10B320000064004030B41446002819D00022027294 +:10B3300002604260B1F5006F03D3042505724160DD +:10B3400001E00272016043B13CB142728372214656 +:10B3500030BC1A460B30FCF717BF827202214172D3 +:10B3600030BC704730B41446002819D00022027255 +:10B3700002604260B1F5006F03D30425057241609D +:10B3800001E00272016043B13CB142728372214616 +:10B3900030BC1A460B30FCF7F7BE827202214172B4 +:10B3A00030BC7047F0B5827A2F4D012191402A6858 +:10B3B00042F001022A602C4E1C3632688A43326009 +:10B3C000294A047B294B0C32A4B914688C431460BD +:10B3D0004488C78844EA0744877A03EBC707C7F85D +:10B3E00040460488878844EA0744877A03EBC70706 +:10B3F000C7F84446047B012C12D114680C43146036 +:10B40000847A026803EBC4044FEA3242C4F840264F +:10B41000847A426803EBC4034FEA3242C3F84426FD +:10B42000114AC37A121D002B136806D00B43136018 +:10B430000D4A0389143213B104E08B43F7E7136814 +:10B440008B4313600389012B02D113680B431360F4 +:10B45000407B012802D1306808433060286820F022 +:10B4600001002860F0BD0000006600400060004060 +:10B470000246002011F4700F03D0926904E001200D +:10B480007047CB0104D552680A401103F7D17047C9 +:10B490000B0101D59268F7E78B0101D5D268F3E77C +:10B4A0001269F1E70246002053690B424AD0B1F518 +:10B4B000807F3BD013DC08292ED007DC012926D061 +:10B4C000022927D004293DD1D0682BE0102925D0AE +:10B4D000202926D0402935D11069102130E0B1F55E +:10B4E000004F2BD00BDCB1F5007F22D0B1F5806F7F +:10B4F00022D0B1F5006F25D19069702120E0B1F51F +:10B50000803F11D0B1F5003F1CD15068E5E790684D +:10B510000D4915E0D06802E0D068DEE7106903212C +:10B520000EE0106908210BE05068FBE790690121EB +:10B5300006E09069022103E0906900E05068042170 +:10B5400000F09CBD7047000001010100002A426923 +:10B5500001D00A4300E08A434261704710B5036896 +:10B56000002223F002030360036843F00103036039 +:10B570004FF6FF7300E0521C4468E40701D19A4281 +:10B58000F9D14268D2073ED08A79012A02683CD0BC +:10B5900022F080020260CA79012A026838D022F0C3 +:10B5A000400202600A7A012A026834D022F02002A6 +:10B5B00002604A7A012A026830D022F0100202604A +:10B5C0008A7A012A02682CD022F008020260CA7A24 +:10B5D000012A026828D022F0040202608A78CC781E +:10B5E000920742EA04620C7942EA04424C790988E3 +:10B5F00042EA0452491E0A43C261016821F0010176 +:10B600000160002114E0002010BD42F08002C1E77B +:10B6100042F04002C5E742F02002C9E742F01002C2 +:10B62000CDE742F00802D1E742F00402D5E7491C19 +:10B630004268D20701D09942F9D14068C007E2D1EF +:10B64000012010BD10460B0001D0002118477047A3 +:10B650000846D1B2C0B20DF037B9000070B58AB05B +:10B660000121052004F0D4FE0121480604F0B8FEB3 +:10B67000474E0021304600F097F8B014ADF8200096 +:10B6800003208DF822001820424C8DF8230008A9D1 +:10B69000204602F019FEE014ADF8200048208DF895 +:10B6A000230008A9204602F00FFE00248DF81A405E +:10B6B00001258DF81B500C208DF818008DF81640D0 +:10B6C0008DF817400920ADF8140007948DF8195033 +:10B6D00005A93046FFF742FF8DF80E408DF80F4068 +:10B6E0008DF81050ADF80440ADF80840ADF80640B4 +:10B6F000ADF80A40ADF80C408DF8115001A8FFF7E5 +:10B7000051FE012202213046FFF720FF14208DF860 +:10B7100000008DF801508DF802408DF80350684606 +:10B7200003F00CFF012211463046FFF70FFF012204 +:10B7300051023046FFF70AFF012291023046FFF71F +:10B7400005FF0122D1033046FFF700FF01213046FB +:10B7500000F02AF813208DF800008DF801508DF8C4 +:10B7600002408DF80350684603F0E8FE16208DF87D +:10B7700000008DF801508DF802408DF803506846A6 +:10B7800003F0DCFE04A009F005F80AB0002070BD4B +:10B79000006400400008014063616E2031206F703A +:10B7A000656E210A0000000000234FF6FF7221B1F0 +:10B7B000012917D0022924D03AE0016821F00201C2 +:10B7C00041F00101016000E0521E416801F00301F7 +:10B7D000012901D0002AF7D1406800F003000128B8 +:10B7E00023D124E0016821F00301016000E0521E32 +:10B7F0004168890701D0002AF9D14068800714D137 +:10B8000015E0016821F0010141F00201016000E052 +:10B81000521E416801F00301022901D0002AF7D12C +:10B82000406800F00300022801D0002300E001235B +:10B830001846704710B500EB0113D3F8B04114F06F +:10B8400004041472D3F8B04133D0E4085460D3F840 +:10B85000B04104F002045472D3F8B44104F00F0470 +:10B860009472D3F8B441240AD474D3F8B841D47292 +:10B87000D3F8B841240A1473D3F8B841240C547394 +:10B88000D3F8B841240E9473D3F8BC41D473D3F8E1 +:10B89000BC41240A1474D3F8BC41240C5474D3F86A +:10B8A000BC311B0E937439B1016941F02001016173 +:10B8B00010BD640D1460CAE7C16841F02001C16089 +:10B8C00010BD30B50246002093685B0108D4906833 +:10B8D000000101D5012003E09068C00037D50220A7 +:10B8E00002EB0012D2F8803103F00103C2F880317C +:10B8F0000B7A73B3D2F880414D681C434B7A43EA0C +:10B90000C5031C43C2F880418B7A03F00F038B728E +:10B91000D2F8843123F00F03C2F88431D2F8843195 +:10B920008C7A2343C2F88431CB7ACC6843EA04236F +:10B93000C2F88831CB7B096943EA0121C2F88C1136 +:10B94000D2F8801141F00101C2F8801130BD04200D +:10B9500030BDD2F880314C7A23430C8843EA4453FB +:10B96000C2F88031D0E70000002221B1012905D0C2 +:10B97000022906D112E08268114801E0826811486C +:10B9800002401149501A8A4214D00ADCA2B16FF069 +:10B99000806010180FD002280CD10FE082680B488D +:10B9A000EEE7B0F5007F09D00949401803D0B0F5A3 +:10B9B000003F03D0002070470220704701207047ED +:10B9C0000300000400030008000100080000031049 +:10B9D0000001FFF710B501784278154B01EB022109 +:10B9E000A3F81B108178C27801EB022109B2B1F5EE +:10B9F0007A6F02DDA1F57A6101E0C1F57A6109B2E1 +:10BA00000B4C8AB27A34A3F81D200A2902DBA4F871 +:10BA1000072002E00021A4F807100179427901EB28 +:10BA2000022123F81F1F80799870012010BD0000AB +:10BA3000740B002000B502460078FEF749F8134B5E +:10BA4000D8725078FEF744F818739078FEF740F8F3 +:10BA50005873D078FEF73CF898731079FEF738F8F1 +:10BA6000D8735079FEF734F818749079FEF730F8EF +:10BA7000064958744839D1F8532041F8012FB1F8DC +:10BA800056208A808871012000BD0000740B0020C0 +:10BA900070B5094DFF22134605F5807605E010F8D4 +:10BAA000014B54402A5D5A40335D491E89B2F6D29B +:10BAB00043EA022070BD000020B8010830B50D46F1 +:10BAC000044600F004F861190988484030BD70B59B +:10BAD00003464FF6FF7048F2050504460EE013F8E2 +:10BAE000012B80EA02200022491E060404EA4000DD +:10BAF00000D56840521CD2B2082AF6D30029EED1F4 +:10BB000070BD884202D9A0EB010002E003D2A1EB94 +:10BB1000000080B270474FF000007047012070476E +:10BB2000A0F13001092901D8C8B27047A0F1410144 +:10BB3000052901D8373804E0A0F16101052902D8B0 +:10BB40005738C0B270470020704700002DE9F05F01 +:10BB5000DFF800940024A9F1520799F89701FE4DEF +:10BB6000012817D1D7F80B10481CC7F80B0038462E +:10BB7000B1F57A7FB0F82B0008DD40F48060A7F8BB +:10BB80002B00287830B90E20287003E020F4806064 +:10BB9000A7F82B00D7F8071042F210708142B7F8CF +:10BBA0002B0008DD40F48050A7F82B00287830B92E +:10BBB0000820287003E020F48050A7F82B00DFF85D +:10BBC0009CA36FF07E510AEB840BE548DBF80880FC +:10BBD0004144814224D209EB4406B6F84D00401F8F +:10BBE000FCF798FD4146FCF76DFE06D8287808B9A9 +:10BBF0000A202870DB4901200870B6F84D00FCF7D8 +:10BC000092FDDBF80810FCF75DFE09D8287808B92A +:10BC10000A202870B7F82B0020F00100A7F82B00AD +:10BC2000641CE4B2032CCCD3CF48CA4CDFF83CB33D +:10BC300000780026683C4FF4967804287DD1BBF844 +:10BC400007000A2816D8CA48808FB0F5E16F18D3CC +:10BC50002088411C218044F25061884211D9B7F8F4 +:10BC60002B0040F08000A7F82B00287848B9072067 +:10BC7000287006E0B7F82B0020F08000A7F82B0012 +:10BC80002680BC48BC4A4FF480410378BB48022B55 +:10BC9000DAF804301A4416D0824253D2B84802F07F +:10BCA00094FB8BF812606088411C89B26180B0F50A +:10BCB000FA7F2ED9B7F82B0040F00400A7F82B002C +:10BCC000287820B325E0824219D2AD4802F07DFBEE +:10BCD0008BF812606088411C618064280BD906F0E3 +:10BCE00059FDB7F82B0040F00400A7F82B00287886 +:10BCF00008B913202870608840450DD81DE0B7F8BA +:10BD00002B0020F00400A7F82B00668022E013200F +:10BD10002870B1F5487F10D920219A4802F055FBD0 +:10BD20000221974802F051FB0121954802F04DFB9A +:10BD30004FF4FA7001F0F7FA66808E480078022816 +:10BD400008D034E0B7F82B0020F00400A7F82B004F +:10BD5000668030E0B9F85900BBF805208A4900F543 +:10BD60009670824203D3DAF804208A4208DC874ABC +:10BD7000B2F81B20824213D9DAF8040088420FDDA2 +:10BD8000A088411CA180C82811D9287808B913209F +:10BD90002870B7F82B0040F00400A7F82B0006E04D +:10BDA000B7F82B0020F00400A7F82B00A6806E48FF +:10BDB000007804281CD1B9F88530BBF807000C21A5 +:10BDC0003233984204D2B9F85B203232904218D311 +:10BDD000E088421CE28040450AD9287820B1B7F8B3 +:10BDE0002B0040F0100001E02970F8E7A7F82B00C5 +:10BDF000387818280BD0268265480178012916D09A +:10BE00003BE0E680B7F82B0020F01000EEE7208A38 +:10BE1000411C21826428EFD9287808B90D202870A8 +:10BE2000B7F82B0040F40050A7F82B00E4E7C17EE0 +:10BE3000012922D1818BC08B40F25F524143B9F876 +:10BE400079015043B1EBC00F11DD2089411C2181E4 +:10BE5000B0F5FA7F12D92681287808B91520287004 +:10BE6000B7F82B0040F00200A7F82B0006E0B7F867 +:10BE70002B0020F00200A7F82B0026813748454907 +:10BE8000406801444448814210D2A089411CA181EC +:10BE900040450CD9A681287808B917202870B7F832 +:10BEA0002B0040F02000A7F82B0000E0A681DFF86F +:10BEB000D4A04FF40041504602F080FA88B19BF8BC +:10BEC000110070B1E089411CE18140451FD9E68134 +:10BED000287808B918202870B7F82B0040F40040E3 +:10BEE00013E04FF40041504602F068FA18B99BF88D +:10BEF0001100DA46C8B1E089411CE181404506D90C +:10BF0000E681B7F82B0020F40040A7F82B00134877 +:10BF100022494069884259DA608A411C6182404561 +:10BF200055D966822878D8B349E0E089411CE1817F +:10BF30004045ECD9E681287808B9182028700421FA +:10BF40000F4802F044FA01214FF4FA7B8AF81110ED +:10BF5000584626E0902A00207C070020E8160020A2 +:10BF6000FFFF47031D05002059020020EE0B0020B3 +:10BF7000FC0D00205A020020FF0F78BAFF6F62000C +:10BF8000000C01400010014000C05A45740B002015 +:10BF900000170020FFFFB73CFF5FA202000028410E +:10BFA0000BE001F0C0F904211D4802F00EFA8AF8F6 +:10BFB0001160584601F0B7F98EE71D202870B7F8D8 +:10BFC0002B0040F48040A7F82B0000E06682B9F80F +:10BFD000B100FCF7BEFB814612488A46808BFCF715 +:10BFE000B8FB114A114BFCF79DFA4A465346FCF741 +:10BFF00035FC0DD8A08AA682411C40450AD9287874 +:10C0000008B91E20287037F82D0F40F00200388044 +:10C01000BDE8F09F37F82D0F20F00200F7E7000091 +:10C02000000C0140FC0D00209A9999999999B93F0B +:10C0300070B50F4900254889401C80B248810A2804 +:10C0400004D34D8102F014FB03F042F8094C0A4975 +:10C05000E07E81F822006078012808D1A0780128CC +:10C0600005D16570A57002F007FE0120607170BDFA +:10C0700098060020542700204C170020024600207C +:10C080000A4200D00120704703490020097849077F +:10C0900000D5012070470000F91700200349002057 +:10C0A0000978890700D5012070470000F9170020A2 +:10C0B000034600201AB18B4200D0012070478B420A +:10C0C000FBD0704703490020C978002900D0012027 +:10C0D00070470000F9170020034900200978C907BC +:10C0E00000D0012070470000F91700200146002011 +:10C0F000012901D0032900D1012070470021022825 +:10C1000007D0032805D0042803D0062801D00A2828 +:10C1100000D101210846704710B500F0F7F818B1BA +:10C1200000210D4806F042FB0B485838406D58B1CD +:10C1300009484FF49661001F06F038FB002802D032 +:10C1400006490020087010BD03480021BDE81040DA +:10C15000001F06F02BBB0000B0020020E504002009 +:10C1600030B53E4B3E48997E2A2903D902780AB958 +:10C17000562202702C2903D902780AB9582202707B +:10C180002E2903D902780AB9592202702F2903D91E +:10C1900002780AB95A220270302903D902780AB902 +:10C1A0005B22027093F83120540707D004780CB951 +:10C1B0005C24047002F00702032A07D093F83220AF +:10C1C00054070AD005785D2415B102E0072030BD80 +:10C1D000047002F00705032D06D012F0380F0DD0C1 +:10C1E00005785E242DB105E0017801B904700820BE +:10C1F00030BD0470C2F3C202032A0AD093F836207D +:10C20000C2F3C204012C09D0520611D5017859B1EC +:10C210000CE0017801B90470092030BD017809B93A +:10C220005F2101700A2030BD602101700B2030BDFC +:10C2300093F83520C2F3C202022A04D002290AD29E +:10C24000017831B107E0017809B9612101700C2052 +:10C2500030BD62210170002030BD0000FC0D0020C7 +:10C260007C07002001460020090600D40120704709 +:10C27000024600208A4200D1012070470549002073 +:10C28000CA7B897B02EB012189B2502900D80120A9 +:10C2900070470000F917002010B54FF400711148E5 +:10C2A00002F08CF806221049002338B1CB71087ACD +:10C2B000052811D200F10100087211E00B72C87953 +:10C2C000052803D200F10100C87109E008D1CA7144 +:10C2D0004FF00100487203E002D10A72CB714B7239 +:10C2E000487A10BD00100140E00400200348407966 +:10C2F000002801D04FF0FF3070470000E00400201C +:10C300000148007870470000E004002010B54FF4A9 +:10C3100080710A4802F052F8094C4FF40071207302 +:10C32000084802F04BF86073217B012901D10128F4 +:10C3300002D04FF0FF3010BD002010BD00080140BA +:10C34000E0040020001001403E210148FBF735BF0A +:10C350000017002002490020A1F8190070470000D2 +:10C360000017002070B518490020184D08600C39DE +:10C370000446487104EB440000EBC40005EB4006A2 +:10C380000C3614213046FBF718FF14213046FFF716 +:10C390009EFB3075000A641CE4B27075122CE9D360 +:10C3A0000A494FF4C6740C3122460D4601F5C67099 +:10C3B000FBF7EAFE002322462946054801F034FA3D +:10C3C000BDE8704007F0FABBA40600200C1800205E +:10C3D000EE27002010B59AB0202112A8FBF7EDFE41 +:10C3E0005A208DF8000001208DF8010082208DF880 +:10C3F0000200344C12208DF8030020788DF80400E0 +:10C40000B4F80900010A8DF805108DF80600B4F89B +:10C410000B008DF80800010A8DF80710B4F80F0022 +:10C42000010A8DF809108DF80A00B4F80D008DF896 +:10C430000C00010A8DF80B10607C8DF80D00A08AAD +:10C44000010A8DF80E108DF80F00E08A010A8DF8B0 +:10C4500010108DF811001C4890F87C118DF8121006 +:10C4600090F87B118DF8131090F881118DF814104D +:10C4700090F882018DF8150016216846FFF708FB39 +:10C480009DF80320ADF84400694612A8121DFBF781 +:10C490007BFEBDF844009DF8031013AA030A8B54D9 +:10C4A000521C8854B4F8190042F21072904202D221 +:10C4B000401CA4F8190012A8891D04F089F81AB0CC +:10C4C00010BD000000170020902A00202DE9FC5F1D +:10C4D000FF4EFE480024316B0278481C5F2A05D2CB +:10C4E0003063C82912D9062034630EE0622A05D2CF +:10C4F0003063C8290AD90820346306E0632A1DD8AE +:10C500003063C82902D909203463B070F149DFF8DB +:10C51000C883DFF8C89331F81B2FA8F80D2049888D +:10C52000A8F80F10012188F81110ED4898F8003094 +:10C53000B9F87711C288012B03D006E005203463D7 +:10C54000E3E798F81B30012B12D0104602F0EAF90D +:10C550000546B078DE4FDFF88CA33837DFF888B3B4 +:10C56000401F05287DD2DFE800F0CA2986868600B4 +:10C57000B9F8795142F210777D43B8F81C0099F868 +:10C580009731B5FBF0F080B2012B03D1814200D38B +:10C590000146104602F0C6F90546D14890F8D7008A +:10C5A0000F28D6D12846FCF7D4F84FF06632CF4B8F +:10C5B000FBF7B8FFFCF726F985B2CAE7C4484FF489 +:10C5C0007A71243006F0F2F8012873D198F81B0034 +:10C5D0004246012806D09620A8F80B00BC4800214E +:10C5E000243089E099F89711012921D0B9F8770111 +:10C5F000F189884201D93231F18189B2A94200D34F +:10C60000F581F189884200D8F081D08B642819D255 +:10C61000B2F80B004FF49671884202D23230A2F881 +:10C620000B00B2F80B008842D8D9A2F80B10D5E75E +:10C63000F089A84201D23230F08180B2A842E4D31E +:10C64000F581E2E73879012804D13888F1898842F8 +:10C6500000D2F081B2F80B10F089814204D232315D +:10C6600000E06FE0A2F80B10B2F80B108142B5D3D6 +:10C67000A2F80B00B2E796484FF47A71283006F022 +:10C6800095F8012860D199F89711012913D0B9F8CC +:10C690007701F189884201D93231F18189B2A94209 +:10C6A00000D3F581F189884200D8F08138790128DA +:10C6B0000BD00FE045E0F089A84201D23230F08182 +:10C6C00080B2A842F2D3F581F0E73888F189884238 +:10C6D00000D2F081B8F80B10F0894246814202D2B4 +:10C6E0003231A2F80B10B2F80B10814201D3A2F83C +:10C6F0000B0077480021283006F058F824E0642029 +:10C70000F081022188F8001099F89701012820D1C2 +:10C71000734FF888FCF71DF852465B46FBF702FFA3 +:10C7200002460B4600207249FCF798F80CD8F888AE +:10C73000FCF70FF852465B46FBF7F4FEFCF762F895 +:10C74000F08101E00920B07099F89701494601286D +:10C7500016D0B9F87501B081A8F80900B9F87911B7 +:10C7600042F210725143B1FBF0F2F3899A4202D8BF +:10C77000B1FBF0F0F081F089A84200D3F5817CE1B3 +:10C78000574840F2A363808FA0F2F5129A4225D257 +:10C79000534A92F83930022B03D098F81B70012FBE +:10C7A00001D01E300AE0B8F81E30C82BF9D992F833 +:10C7B0000A21002AF5D14F4A9630147080B2A8F8A9 +:10C7C0000900FA3080B2A8F80100B081B1F87D11FB +:10C7D0004246884209D2A2F8011006E0B1F87D0174 +:10C7E000B081B9F87511A8F80910FFF7B9FC10F07D +:10C7F000FF0756D04FF4C871072F2FD0082F2DD028 +:10C80000092F2BD00A2F29D00B2F27D00C2F25D062 +:10C81000042F47D0052F45D0314AD08800EB800344 +:10C82000B1EB430F75D2FBF794FF52465B46FBF723 +:10C8300079FECDE90001F089FBF78BFFDDE90023EC +:10C84000FCF70CF869D82648C088FBF782FF5246EF +:10C850005B46FBF767FEFBF7D5FF5DE0204AD0881B +:10C8600088421AD9FBF775FF52465B46FBF75AFE22 +:10C8700007460091F089FBF76CFF3A46009BFBF7F7 +:10C88000EDFF54D81648C088FBF763FF52465B465D +:10C89000FBF748FEFBF7B6FF02E0F189884246D875 +:10C8A000F08144E00E4AD088884232D9FBF751FF2C +:10C8B000114A124BFBF736FECDE90001F089FBF778 +:10C8C00048FFDDE90023FBF7C9FF1AE0580200200A +:10C8D00018050020740B002000170020902A00206B +:10C8E000FC0D00209A9999999999E93F6666EE3F67 +:10C8F000000059405C020020CDCCCCCCCCCCEC3F2D +:10C9000007E00AD8E048C088FBF723FFDF4AE04B86 +:10C910009FE7F189884200D8F081062F07D1F0897E +:10C92000C82801D9C820F081DA4902200870D64F02 +:10C9300097F8390002281ED0F888C8286CD9D64943 +:10C94000C97A5F294DD2FBF704FF4FF06632D34B13 +:10C95000FBF7E8FD05460091F089FBF7FAFE2A4651 +:10C96000009BFBF77BFF78D8F888FBF7F2FE4FF0CF +:10C970006632CA4B4AE098F80000454601286CD15F +:10C98000E87E012869D1B5F80900A98B884226D92B +:10C99000401AB0F5967FF88806DD962810D2FBF78E +:10C9A000D8FE0022BE4B06E0962809D2FBF7D1FE46 +:10C9B0004FF03332BB4BFBF7B5FDFBF723FFF081A4 +:10C9C000B5F80B10F089814202D21E31A5F80B1088 +:10C9D000B5F80B10814240D9A5F80B003DE0F8886E +:10C9E000E4E7FBF7B6FE52465B46FBF79BFD0546C8 +:10C9F0000091F089FBF7ADFE2A46009BFBF72EFF66 +:10CA00002BD8F888FBF7A5FE52465B46FBF78AFD5C +:10CA1000FBF7F8FEF08120E0B98F3231B181FBF7EE +:10CA200098FE52465B46FBF77DFDCDE90001F0899B +:10CA3000FBF78FFEDDE90023FBF710FF09D8F8882C +:10CA4000FBF787FE52465B46FBF76CFDFBF7DAFE11 +:10CA5000F081F089A84200D3F581F88868B9B078F0 +:10CA6000062805D0072803D0092801D0082804D1BA +:10CA70008D48017809B93721017030793546012890 +:10CA800026D0EC62464698F8291016F8280F01F0D7 +:10CA900045FF4F4699F87B1199F87C0101F03EFF64 +:10CAA00097F87C0116F82829411F8A4207DA97F87F +:10CAB0007B1196F82930A1F1050C634525DB686BE5 +:10CAC000411C696364282DD901206C63687129E0D9 +:10CAD000E86A6C63401CE8621428D3D91421B0FBC7 +:10CAE000F1F201FB12000128CCD1E8894FF4AF71BB +:10CAF000884203D84FF49671884201D9E981C1E791 +:10CB0000C828BFD9C820E881BCE7C91F8B4209DA11 +:10CB1000C01F824206DA686B411C6963642801D930 +:10CB20006C716C6397F8970140F6C4180128687916 +:10CB300002D0012879D095E001281CD1B7F87701FF +:10CB4000FBF707FE594A5B46FBF7ECFC81468A4639 +:10CB5000E889FBF7FEFD4A465346FBF77FFE0AD203 +:10CB6000B7F87701FBF7F5FD504A5B46FBF7DAFCB7 +:10CB7000FBF748FEE881444840F2BB22818FA1F2D6 +:10CB8000097191426ED290F80A0101286AD130767B +:10CB9000E8894FF41671884200D9E981AA89404694 +:10CBA000824200D9A881B6F80920824201D9A6F8AC +:10CBB0000900B6F80B00884201D9A6F80B10BDE8B1 +:10CBC000FC9FB7F87F01E989884200D2E881B7F875 +:10CBD0007D01A98988424DD3B6F8091040468142AB +:10CBE00001D9A6F80900A989814245D8B6F80910EB +:10CBF000A889814201D9A6F80900B6F80B104FF4B4 +:10CC00007A7081423AD8E989814200D9E881B6F840 +:10CC10000B10E889814234D8B6F80B003228CED206 +:10CC20003220A6F80B00CAE7FFE7B7F87701FBF759 +:10CC300090FD1E4A5B46FBF775FC81468A46E889F3 +:10CC4000FBF787FD4A465346FBF708FE0AD2B7F8C2 +:10CC50007701FBF77EFD154A5B46FBF763FCFBF7AC +:10CC6000D1FDE8813476B7F87701E9898842A8D206 +:10CC7000E881A6E7A881AFE7A881B7E7A6F80B008F +:10CC8000C1E7A6F80B00C7E7FC0D0020CDCCCCCC4B +:10CC9000CCCCEC3F82070020EE0B00206666EE3F16 +:10CCA0000000F83F3333F33F7C0700209A999999AD +:10CCB0002DE9F05FDE4CDF4F4FF00508E08C0025DA +:10CCC00098B1788B411C79834FF4FA7188420DD961 +:10CCD000D9483D7002780AB9142202707983F87835 +:10CCE000012803D087F8038000E07D83D348B0F8A3 +:10CCF0002B0010F0600F03D1410701D4400403D58D +:10CD00003D7087F8038010E0F878022801D00428ED +:10CD10000BD1397819B9012801D087F803800CF0BC +:10CD200087FA10B9C64902200870C648C64990F86B +:10CD30000A0101281ED0B1F87D01A4F8010040F2DB +:10CD40001A40A4F80500B1F87901A4F80700F878B2 +:10CD5000BE4E8B46012810D0DFF8F4A24FF0010937 +:10CD6000022827D0042870D005286FD1F88A01281E +:10CD70006DD026E140F6C410DFE73D827D820220BF +:10CD80002070FD713D72BD71397801295ED1F87056 +:10CD90002021B04801F019FB0221304601F015FBBB +:10CDA0000121304601F011FBBDE8F05F4FF4FA704D +:10CDB00000F0B9BAFD82388A782801D2401C388246 +:10CDC00080B208281CD2397A21B1052840D0062823 +:10CDD00013D072E020219F4801F0F7FA022130467B +:10CDE00001F0F5FA0121304601F0F1FA4FF4FA7042 +:10CDF00000F099FA87F808905FE003F0FDFC5CE032 +:10CE00000F282DD2B97969B10321B0FBF1F201FBF2 +:10CE1000120101291CD0B0FBF8F108FB1100012818 +:10CE200019D04AE020218B4801F0D1FA0221304686 +:10CE300001F0CDFA0121304601F0C9FA4FF4FA7041 +:10CE400000F071FA87F8069037E06CE069E0A2E044 +:10CE500003F0C4FF31E003F0CFFC0AF0BDF82CE092 +:10CE60007D63218C40F2DB52A1F2D171914222D23A +:10CE7000B0F5966F01D2401C388280B2B0FBF8F159 +:10CE800008FB1101012904D000F00700012803D09C +:10CE900004E003F0A3FF01E003F0AEFC388A14289D +:10CEA00001D984F80090E17E012927D0B0F57A7F7E +:10CEB00001D987F80380FFF78DFA674840F277536E +:10CEC00030F81B1FA4F80D104088A4F80F005D482F +:10CED0006421808FA0F221329A4212D2A4F8090074 +:10CEE00000F5967080B2A4F80100A4F80B10BBF80E +:10CEF0007D1188420FD2A4F801100CE00420F870D4 +:10CF0000D9E7BBF87501A4F80900A4F80B1040F6A6 +:10CF1000C410A4F80100BAF80010A182BAF8020007 +:10CF2000E082BDE8F09FB88A401CB8824B48007888 +:10CF3000012813D0BAF80010A182BAF80200E082EA +:10CF400084F800900BF024FCFFF7C0FAB88AB0FB1D +:10CF5000F8F108FB1100012808D009E040484068BA +:10CF6000FBF71DFCA082BAF80200E8E7FFF732FAEF +:10CF7000B88A0B21B0FBF1F201FB1200012801D1AC +:10CF800007F0C6FA387D00F00F000128C9D1BDE8CE +:10CF9000F05F03F023BF02202070B879012810D180 +:10CFA00020212C4801F011FA0221304601F00DFA3F +:10CFB0000121304601F009FA4FF4FA7000F0B3F99C +:10CFC000BD71788A642801D2401C788280B2022820 +:10CFD00001D90221217028281FD9B879012810D140 +:10CFE00020211C4801F0F1F90221304601F0EDF951 +:10CFF0000121304601F0E9F94FF4FA7000F093F99D +:10D00000BD71FFF7A1F93D827D820421304601F018 +:10D01000DCF98AF8115087F80390BBF8750124F801 +:10D02000090F32206080BDE8F05FFFF7D3B9000040 +:10D0300000170020180500207C0700203E2A002051 +:10D0400082070020FC0D0020902A0020000C0140E7 +:10D05000EE0B002000100140740B00208007002020 +:10D06000E81600202DE9F84F6946164800F0CEFB7F +:10D07000154DDFF85890DFF858A0DFF858B00024BD +:10D0800039F8140001F07CFAFF2814D03AF81000A7 +:10D09000009900EB050810483BF8147030F81400B4 +:10D0A000461839463046FEF709FD20B93A46314662 +:10D0B0004046FBF769F8641CE4B20C2CE0D3BDE8F1 +:10D0C000F88F0000A82700204C170020DCBA0108C8 +:10D0D0007CBA01080CBB0108F4BA010800290168F8 +:10D0E00002D041F0010102E04FF6FE7211400160F2 +:10D0F0007047000001684FF6FE7211400160002188 +:10D10000016041608160C1603149314A0839904213 +:10D1100003D1486840F00F0006E02D4A14329042D7 +:10D1200004D1486840F0F00048607047284A28322F +:10D13000904203D1486840F47060F5E7244A3C32DD +:10D14000904203D1486840F47040EDE7204A5032E5 +:10D15000904203D1486840F47020E5E71C4A6432ED +:10D16000904203D1486840F47000DDE7184A7832F5 +:10D17000904203D1486840F07060D5E7154A111F0E +:10D18000904203D1086840F00F0006E0114A1432C3 +:10D19000904204D1086840F0F000086070470D4AE2 +:10D1A0002832904203D1086840F47060F5E7094ADC +:10D1B0003C32904203D1086840F47040EDE7054AE4 +:10D1C00050329042EAD1086840F47020E5E7000050 +:10D1D000080002400804024030B5026847F6F073C8 +:10D1E0009A430C6A8B682343D1E904452C432343BB +:10D1F0008C692343CC6923434C6A23438C6A2343C1 +:10D2000013430360CA6842600A6882604968C1606B +:10D2100030BD000070B50C46050033D08CB3688873 +:10D22000A52121705A2161701930A070000AE070A8 +:10D2300020202071601D10221349FAF7A5FF68799C +:10D240006075B5F805001726000AA0756A88022ADD +:10D2500007D304F11700E91DFAF796FFA8781730F5 +:10D26000C6B231462046FDF7F5F9A055761CF1B25D +:10D27000000A6054491CC9B22046FDF7E3FB0120B7 +:10D2800070BDFFE70020FBE7902A0020F8B5694653 +:10D290001F4800F0BBFA16261E4F002505EB45007F +:10D2A00000EBC5040098B11E00EB4400FEF706FC3D +:10D2B00088B90098324600EB440107EB44000C307B +:10D2C000FAF762FF0098324600EB4401124800EB87 +:10D2D0004400FAF759FF07EB4400007B092805D109 +:10D2E0000E480122AA400168114301606D1CEDB295 +:10D2F000122DD3D309494FF0FF30091DA1F10B02C4 +:10D3000008600749A1F5467003F05AFEF8BD000019 +:10D31000EE2700200C180020A4190020A4060020ED +:10D32000301B0020704710B5044606E0142007F0BB +:10D33000E9F901F0A3FE641EA4B2002CF6D110BDE1 +:10D3400070B5044601F030F90546FF2820D020468C +:10D3500001F016F9FF281BD00E49104A0C5C0E494B +:10D3600032F81000461821463046FEF7B0FB305523 +:10D37000621C000AB0540A480A49A21C30F8150081 +:10D38000401805D03146BDE87040002300F04CBA8B +:10D3900070BD0000A2BA01084C1700207CBA010839 +:10D3A000F4BA0108A82700202DE9F04399468046E9 +:10D3B000DDE9074300250120012A01D0FF2A49D1D8 +:10D3C0001E784FF0590C771C1F7004F806C01E78A9 +:10D3D000771C1F7004F80680224E21F07F4756F814 +:10D3E00025C0674538D11E780F0C06F1010C83F873 +:10D3F00000C0A7551E780F0A06F1010C83F800C083 +:10D40000A7551E780020771C1F70A15505EB45011C +:10D4100001EBC505197819F815704E1C1E7067547C +:10D42000012A01D0FF2A15D1197801264A1C1A7049 +:10D43000665409EB45011A784E7C551C1D70A654A4 +:10D440001A788E7C551C1D70A654CD7C19784A1C08 +:10D450001A706554BDE8F0836D1CEDB2122DBED379 +:10D46000F8E7000034BA01082DE9F8411C4600260F +:10D4700088468DF80060217815464A1C5923227091 +:10D480006B5421781A4F4A1C227068546A463946F8 +:10D49000404603F095FD24E037F816002278010A93 +:10D4A000144802F1010C50F8210084F800C0030C6C +:10D4B000AB542278030A02F1010C84F800C0AB548B +:10D4C0002278531C2370A85401EB410000EBC101EA +:10D4D00008EB410042782078411C2170761C2A54C8 +:10D4E000F6B29DF800008642D6D30020BDE8F88150 +:10D4F000301B002034BA01082DE9F0434FF05908E1 +:10D50000DDE90764002527784FF0010907F1010CD8 +:10D5100084F800C006F80780277807F1010C84F82A +:10D5200000C0F055234821F07F4750F825C06745DB +:10D5300039D120780F0C00F1010C84F800C0375469 +:10D5400020780F0A00F1010C84F800C037542078CD +:10D55000471C2770315405EB450000EBC5012078CE +:10D5600013F81170451C257003EB410137544878BE +:10D57000904201D0FF2A1AD1487C4FF00009B0B187 +:10D5800020780123421C2270335420780623421C49 +:10D59000227033542078891C304403F0C9FC217870 +:10D5A0000844207003E06D1CEDB2122DBDD3484637 +:10D5B000BDE8F08334BA010810B5FEF765FD002818 +:10D5C00074D1FEF76BFD002870D1FEF785FD614B2D +:10D5D00000286CD0604C03F10C022078C106116861 +:10D5E00002D541F0020101E021F002011160810643 +:10D5F000116802D541F0040101E021F0040111603D +:10D600004106116802D541F0080101E021F008014E +:10D610001160000602D541F0100001E021F0100079 +:10D6200010606078C107116802D041F0200101E06C +:10D6300021F0200111608107116802D541F04001FD +:10D6400001E021F0400111604107116802D541F06D +:10D65000800101E021F0800111600107116802D50D +:10D6600041F4807101E021F480711160C1061168FC +:10D6700002D541F4007101E021F4007111608106CE +:10D68000116802D541F4806101E021F480611160EC +:10D690004106116802D541F4006101E021F4006106 +:10D6A0001160000604D541F4805003E03EE04EE0F6 +:10D6B00021F480501060A078C107116802D041F4B5 +:10D6C000005101E021F4005111608107116802D579 +:10D6D00041F4804101E021F480411160410711686B +:10D6E00002D541F4004101E021F40041116000073E +:10D6F00002D541F4803001E021F480301060FEF763 +:10D70000E1FCA0B1E078082803D3106840F00100E4 +:10D710001060FEF7D7FC002808D15878002150B1DE +:10D72000401E10F0FF00587000D1198110BD106824 +:10D7300020F00100ECE71889401C80B21881B0F598 +:10D74000967FF3D9106840F400301060EDE7322086 +:10D75000587010BD98060020F917002070B50D46CE +:10D7600000EB4001104A01EBC00102EB41040D4EF9 +:10D770000C34122815D22078A84211D0092D0DD1D1 +:10D78000204603F015FC607818B93078401C3070E2 +:10D790006070607CFF2801D0401C60740020E07441 +:10D7A000257070BD9D0600200C180020154810B58E +:10D7B000154A0178937801F00100984221D09070C9 +:10D7C000C8071ED000210F4C0B46133401EB41005B +:10D7D00000EBC10004EB400010F80C2F082A0CD11C +:10D7E000C27C521CD2B2C274282A06D3C3740370FE +:10D7F000827CFF2A01D0521C8274491CC9B21229B2 +:10D80000E4D310BDF917002098060020054A824293 +:10D8100002D0463A824202D101200A6070470020BD +:10D8200070470000EE27002010B50DF08BFC0120A2 +:10D8300010BD2DE9FE4F4FF017088DF80880012527 +:10D840008DF8095003268DF80A6004468DF80B0008 +:10D8500002A801F073FE0921022000F021FD00273B +:10D860008DF804704FF00C094FF4007A8DF8059094 +:10D87000CDF800A08DF80640684600F0BBF8504691 +:10D8800000F0A8F88DF808808DF809508DF80A602E +:10D890008DF80B4002A801F051FE0821002000F095 +:10D8A000FFFC8DF804704FF480788DF80590CDF86A +:10D8B00000808DF80640684600F09CF8404600F075 +:10D8C00089F828208DF808008DF809508DF80A6035 +:10D8D0008DF80B4002A801F031FE0D21022000F06E +:10D8E000DFFC8DF8047008208DF805006D030095AD +:10D8F0008DF80640684600F07DF8284600F06AF88A +:10D90000202000F067F8402000F064F8802000F04C +:10D9100061F8404600F05EF8504600F05BF8E81011 +:10D9200000F058F8A81000F055F8681000F052F810 +:10D93000284600F04FF8680000F04CF8A80000F00E +:10D9400049F8BDE8FE8F000010B54FF400542046A2 +:10D9500000F046F80F4908B1032000E001200870EC +:10D960004FF4806000F036F84FF4006000F032F8B9 +:10D970004FF4805000F02EF8204600F02BF84FF4C2 +:10D98000804000F027F8BDE810404FF4004000F060 +:10D9900021B80000E0040020082000F01BB810208F +:10D9A00000F018B810B5202000F014F8402000F066 +:10D9B00011F8802000F00EF84FF4807000F00AF8A3 +:10D9C0004FF4007000F006F801490120087010BD06 +:10D9D000E004002001490860704700001404014081 +:10D9E000034A0146002012680A4200D00120704715 +:10D9F0001404014030B51A4A8379016853B313689F +:10DA00008B431360111D0B680468A3430B600179FD +:10DA100011440B68046823430B60114B08331968E9 +:10DA20000468A14319601C1D21680568A943216091 +:10DA30004179102905D011440A68006802430A6040 +:10DA400030BD1968026811431960216800680143FC +:10DA5000216030BD0079104402688A43026030BD05 +:10DA60000004014001F00AFB0120FFF7E2FE33A0B1 +:10DA700006F090FE0A20FFF756FC01F0FFFA02F0D4 +:10DA8000BFFD012002F04CFF6FF0FF0002F03CFEF2 +:10DA900001F0F4FAFBF728FA0121084600F05CFBDC +:10DAA00003F004FF4FF40041080301F093FD03F07D +:10DAB000CDFE01F03FFD01F0EDFA01F0DFFA4FF489 +:10DAC000E1300DF085FA244C2078022802D001289C +:10DAD00002D01AE021A000E028A006F05BFE20782A +:10DAE000022802D0012802D00FE02BA000E023A0E2 +:10DAF00006F050FE2078022802D0012802D004E06F +:10DB00002DA000E01DA006F045FE2078032802D1DC +:10DB100030A006F03FFE216920780870C0434870AD +:10DB200001F0ACFABFF34F8F31480168314A01F47C +:10DB3000E06111430160BFF34F8FFEE7456E7465EE +:10DB400072536C656570303030303050726F636581 +:10DB500073730D0A00000000E00400205274635F3C +:10DB600077616B652D30302D2D5274635F77616B5B +:10DB7000652121212121210D0A000000494F207734 +:10DB8000616B652D2D2D494F2077616B652121211A +:10DB90002121210D0A0000005274635F77616B65DB +:10DBA0002D31312D2D5274635F77616B65212121F9 +:10DBB0002121210D0A0000005274635F77616B65BB +:10DBC0002D2D2D5274635F77616B652121212121F9 +:10DBD000210D0A0043414E2077616B652D2D2D43A9 +:10DBE000414E2077616B652121212121210D0A0001 +:10DBF0000CED00E00400FA052DE9F047DFF8E890AD +:10DC00000025484640F25241C0E9001589F8085005 +:10DC100089F80950082109F5207089F80A1040F8A0 +:10DC20003A5F09F5E874456014F8EA0FDFF8BC8044 +:10DC300020F0FF062670D8F80C00FAF7B0FDC7B246 +:10DC40002771D8F81000FAF7AAFDC1B2284861710F +:10DC5000EA3C4078042833D0B4F8EB006FF30C00B2 +:10DC6000A4F8EB0094F8EC0000F03F00A4F8EC00FE +:10DC7000B4F8EB0034F8EC3FC0022A4640EA9310B7 +:10DC800066F30702030C63F30F22030A63F31742E0 +:10DC900060F31F62174867F3070561F30F25C08C17 +:10DCA000A080010A61F3174560F31F65484640F8FC +:10DCB0000B2F45600C4809F02DF90120BDE8F087D5 +:10DCC0000948B838B0F81B20B4F8EB0062F30C0038 +:10DCD000A4F8EB0004483E38B0F80720B4F8EC0094 +:10DCE00062F38F10C2E700002C0C0020E816002021 +:10DCF00058020020001700202DE9F041414C00207F +:10DD000040F25141E4E802103F4D04F8010B0821B4 +:10DD100004F8010B04F8011B45F8320F394968601B +:10DD2000B839394811F8233FB0389F0910F8E22F6D +:10DD300063F3010202704A78467862F3010667F3E2 +:10DD400083061F0967F305169B0863F38716467061 +:10DD50008B788678970963F3010667F383061709C2 +:10DD600067F30516920862F3871686709A08C378DF +:10DD700062F38713CA7862F30513920862F3830390 +:10DD80000A7A62F30103C3708A7A0679930863F30F +:10DD900001064B7A62F383069F0867F3051663F367 +:10DDA00087160671CB7A4679120963F3051662F37A +:10DDB00087160A7962F38306930863F3010662F318 +:10DDC000830663F3010646714A79837962F3871308 +:10DDD000920862F305138A7962F38303920862F36F +:10DDE00001038371C979C27961F38712C27128680E +:10DDF000696820606160034809F08CF80120BDE883 +:10DE0000F08100002C0C0020AC0E00202DE9F04128 +:10DE1000294A002140F25340C2E9000111725172B7 +:10DE20000820907202F52070012440F8421F4160E2 +:10DE300002F5E870A0F5227590F8D830B4EB131F06 +:10DE400003D00524B4EB131F03D16982A982E982B0 +:10DE500029836B8A20F8F23FAC8A4480EE8AC6F5AB +:10DE60007A67868867F30B0686802D8BC5F57A67FF +:10DE7000C58867F30B05C5801F0A084667F30700CE +:10DE800063F30F20230A63F3174064F31F60330129 +:10DE90001C0A64F3070163F30F212B011C0A64F3CE +:10DEA000174142F80B0F63F31F615160024809F0FC +:10DEB00031F80120BDE8F0812C0C002070B5384A03 +:10DEC000002140F25440C2E9000111725172082051 +:10DED000907202F52070012540F84A1F416002F55A +:10DEE000E870A0F20E2490F8D830B5EB131F03D0E1 +:10DEF0000525B5EB131F03D1A4F80510A4F80710EE +:10DF000034F8053FA0F8FA306488B0F8FC50C4F546 +:10DF10007A6464F30B05A0F8FC5090F8FD40204DA6 +:10DF200024F0F004B83D80F8FD40AC7EAA2C90F8B7 +:10DF3000FE4024F0030400D1641C80F8FE4004F08D +:10DF4000C30400F8FE4FB5F81F5030F802491E0A0E +:10DF500065F38F140D4666F30705448063F30F25C0 +:10DF600003881B011E0A66F3174563F31F65837858 +:10DF700001719B0343EA94131E0A0C4666F30704DF +:10DF800063F30F245623437161F3174442F80B5F88 +:10DF900063F31F645460024808F0BCFF012070BDA9 +:10DFA0002C0C00200149C86070470000002002408E +:10DFB00070B505464FF43026304600F081F804284D +:10DFC00011D1094C206940F002002061656120698F +:10DFD00040F040002061304600F072F8216941F6BF +:10DFE000FD721140216170BD0020024008490420EB +:10DFF000CA68D20701D001207047CA68520701D50C +:10E0000002207047C968C906FBD50320704700008D +:10E01000002002400248016941F08001016170471F +:10E0200000200240F0B506464FF400570D46384632 +:10E0300000F046F804280CD1064C206940F001009D +:10E0400020613580384600F03BF82169BA1E114046 +:10E050002161F0BD002002402DE9F8410646002074 +:10E060004FF4005700900D46384600F029F8042878 +:10E0700016D10C4C206940F0010020613580B84673 +:10E08000384600F01DF8BF1E042806D1B61C280C27 +:10E0900000963080404600F013F821693940216134 +:10E0A000BDE8F8810020024003480249416003496D +:10E0B000416070472301674500200240AB89EFCDE6 +:10E0C00000B50346FFF792FF02E0FFF78FFF5B1EEC +:10E0D000012803D0002B00D1052000BD002BF4D176 +:10E0E000FAE700002DE9F04781461A48184C002550 +:10E0F000C088401E86B204EBC60041684846FAF765 +:10E10000E1FB04D348466168FAF7E6FB1AD240F611 +:10E11000FF70BDE8F087A819440808EBC40748461B +:10E120007968FAF7D9FB02D2641EA6B20BE0484622 +:10E130007968FAF7C7FB02D2641CA5B203E038F98C +:10E140003400E6E7A046B542E5D938F93500E0E706 +:10E15000F0B20108F404002030B51E4B1A6822F01A +:10E16000030202431A601C4B186840F00400186058 +:10E170004FF0E0200469194A1460D0F8004154605F +:10E18000D0F804419460D0F80841D4600469144D7B +:10E190002C400461134CC0F88041134CC0F88441FA +:10E1A0004417C0F88841012912D040BF20BF20BFCA +:10E1B000116801615168C0F800119168C0F804113C +:10E1C000D168C0F80811186820F00400186030BD4C +:10E1D00030BFEDE70070004010ED00E01C0B0020A8 +:10E1E000040001003DF87FFFFFF8FFBF254910B58F +:10E1F000884206D10121042002F016F900210420F2 +:10E200003BE02149884206D10121082002F00CF9A7 +:10E210000021082031E01D49884206D1012110204B +:10E2200002F002F90021102027E01949884206D1A6 +:10E230000121202002F0F8F8002120201DE01549DE +:10E24000884206D10121402002F0EEF80021402052 +:10E2500013E01149884206D10121802002F0E4F840 +:10E260000021802009E00D4988420AD1841501214E +:10E27000204602F0D9F800212046BDE8104002F007 +:10E28000D3B810BD00080140000C0140001001404F +:10E290000014014000180140001C01400020014012 +:10E2A00010B58A0721F003040649120F21440F23F9 +:10E2B0008C6893409C438C608B68904003438B60D8 +:10E2C00010BD000000000140F0B5CC78002204F041 +:10E2D0000F03E40601D58C7823430C784FF00F0C24 +:10E2E00014F0FF0F4FF0010E1BD005680E880EFAD8 +:10E2F00002F42640A64210D196000CFA06F725EA51 +:10E30000070703FA06F5CE783D43282E02D0482EA3 +:10E3100002D002E0446100E00461521C082AE5D307 +:10E3200005600A88FF2A1CD94468002202F1080609 +:10E330000EFA06F50E882E40AE420ED196000CFA6B +:10E3400006F7BC4303FA06F7CE783C43282E00D1EB +:10E350004561CE78482E00D10561521C082AE5D3CC +:10E360004460F0BDF0B5144C002801DAE36900E028 +:10E370006368450D2E0185B2C0F30157B540C0F367 +:10E380000342032F05D0C6020AD503269640B343A5 +:10E3900007E023F07062636823F07063636002E05B +:10E3A000AB4343F0706201B12A43002801DAE26115 +:10E3B000F0BD6260F0BD0000000001400246002098 +:10E3C00092680A4200D001207047416170470161A4 +:10E3D0007047F8B5010A8DF800108DF801004FF66E +:10E3E000FE7000226F4648F2084648F22504451C9C +:10E3F000B95C80EA01200021030408D5030602D598 +:10E4000086EA400001E084EA400080B201E005EACB +:10E410004000491CC9B20829EED3521CD2B2022ACC +:10E42000E6D3F8BD10B5044605F0AEFB6843207096 +:10E43000000C6070002010BDFEB500260D468DF862 +:10E4400008608F1E53782C490446092F51D2DFE80B +:10E4500007F0052329503C50505005002A4602A9D8 +:10E4600000F0B6F880BB8DF80860592020709DF848 +:10E4700008000921401CC0B28DF8080025549DF801 +:10E480000800401CC0B28DF8080021549DF8080017 +:10E49000401C8DF808002CE0024602AB2846FEF72F +:10E4A000E3FF26E063F31740937863F30F20D378FC +:10E4B000127963F3070002ABCDE900430B46014636 +:10E4C0002846FFF719F811E013E063F3174093783B +:10E4D00063F30F20D378127963F3070002ABCDE921 +:10E4E00000430B4601462846FEF75EFF08B18DF853 +:10E4F00008609DF80800FEBD1818002070B503469E +:10E5000015480324154E90F82A1090F82900144A53 +:10E5100001EB0020622180B21970010A59709870D5 +:10E52000002132F81150854203D0491CC9B2132989 +:10E53000F7D313290ED0022C0AD00A48455C0A48AA +:10E540002A4630F8110081191819F9F71DFE2C44DC +:10E55000204670BD0224FBE7542700204C17002002 +:10E56000B6BA0108A2BA01087CBA010803480088BB +:10E570000249091F098841EA00407047BC6C00400D +:10E5800010B50146FF23074A002032F810408C42A4 +:10E5900001D1034603E0401CC0B21328F5D318464E +:10E5A00010BD0000B6BA010810B50146FF23074AA6 +:10E5B000002032F810408C4201D1034603E0401C99 +:10E5C000C0B20C28F5D3184610BD0000DCBA010813 +:10E5D0002DE9F043DFF88C8000265924A8F80A6062 +:10E5E000047042700924894684703146032401EB8B +:10E5F000410505EBC10508EB45073D7B1D4203D1F5 +:10E600009D4201D00A2A24D1174D2D68CD40ED0737 +:10E610001FD0B8F80A5001266D1CA8F80A50134DF7 +:10E6200055F821C04FEA1C4C00F804C0641C35F8B2 +:10E6300021C0E4B24FEA1C2C00F804C0641CE4B210 +:10E6400015F821500555641CE4B23D7B0555641C4A +:10E65000E4B2491CC9B21229C9D389F80040304636 +:10E66000BDE8F0830C180020A806002034BA010889 +:10E670002DE9F041314E307818B1401E3070BDE8C0 +:10E68000F081FEF799FF2E4890F825000028F6D17A +:10E69000FFF78CF829482B4F0C300024056825FA29 +:10E6A00004F0C00701D0092108E004EB440000EBAE +:10E6B000C40007EB4000007B20F001012046FFF77B +:10E6C0004DF8641CE4B2122CE9D3F078162500EB67 +:10E6D000400101EBC00007EB40041B4F14F80C1F76 +:10E6E00017F81020914205D107EB4000E17CC07C77 +:10E6F00081421AD014212046FDF7E9F92075000A5D +:10E700006075F078227800EB400101EBC001002336 +:10E7100007F8112007EB4101E27CCA740B492A4635 +:10E7200005FB00102146FFF77FF8F078401CC0B2CF +:10E73000F0701228A3D30020F070A0E79806002004 +:10E74000542700200C180020A4190020EE270020D8 +:10E7500000210D4B0CE0824206D101EB410000EBA1 +:10E76000C10003EB00107047491CC9B2022908D24E +:10E7700001EB410202EBC10203EB02121278FF2A05 +:10E78000E9D1002070470000C01100202DE9F047BA +:10E790000026DFF80C81DFF80C91DFF80CA1434D67 +:10E7A0004FF400474FF6FF74012804D0022817D019 +:10E7B000032854D070E0EB2182200AF099F9A0F5EB +:10E7C00000416881B94202D2201A688102E0A04269 +:10E7D00000D36E816889F9F7BCFF42464B4652E090 +:10E7E000E321B2200AF084F96881B84204D3012100 +:10E7F000E980201A688100E0EE8080B2F9F7A9FF75 +:10E8000042464B46F9F78EFE00225346F9F7FCFECE +:10E81000FAF73CF8FAF70FF84FF03332244BF9F7D8 +:10E8200081FE244A244BF9F7EFFEFAF72FF8A8618E +:10E83000E888012830D11D484FF4FA61143003F004 +:10E84000B5FF012807D11DA005F0A4FF174800213E +:10E85000143003F0ABFFA86980F000401BE0E32117 +:10E86000B4200AF045F9A0F500416881B94202D20E +:10E87000201A688102E0A04200D36E816889F9F70E +:10E8800068FF4246164BF9F74DFE00225346F9F752 +:10E89000BBFEF9F7FBFFA861A869BDE8F08700009F +:10E8A000FCA9F1D24D622040E0FFEF407C06002041 +:10E8B000F308CA40F6285C8FC2F513404E656761C5 +:10E8C0007469766520766F6C746167652073616D1D +:10E8D000706C65206661756C74210D0A0000000083 +:10E8E0004D6210400A4800680A49094A121F086030 +:10E8F00012684A60064A083A12688A60401C06D1CB +:10E900000548026D0A60426D4A60406E886070473B +:10E91000F0F7FF1F401700200000F81F884200D2C8 +:10E9200008467047884200D90846704770B5384E8F +:10E930007088401C80B270800A2861D3354C002555 +:10E940007580E08F4FF4FA71884221D2401C80B26A +:10E95000E08788421CD12572E07E032801D002287E +:10E9600016D1A5760120E07684F82050A571E587C0 +:10E9700084F82250274884F8235084F825503438EE +:10E98000E5730179012901D1C582057100F074FB9D +:10E9900094F8221020480029017802D021F00301C8 +:10E9A00001E041F00301017094F82310002901787F +:10E9B00002D021F00C0101E041F00C01017031881E +:10E9C000491C89B2318064291AD3358094F8271004 +:10E9D00079B1491E11F0FF0184F8271009D1E178BF +:10E9E000012906D1E57094F8261011B1491E84F86A +:10E9F0002610217A0029017803D021F0100101703E +:10EA000070BD41F010010170BDE8704000F034BBF2 +:10EA100010070020542700209E06002000F00F0061 +:10EA2000092801D93730704730307047000909286C +:10EA300001D9373070473030704700002DE9F04180 +:10EA4000264D00242879C0B1012814D12C71244905 +:10EA5000286AF9F744FC6FF081410844214A2249B1 +:10EA600090422CD22889421C2A81142802D92C8158 +:10EA7000062048706C81BDE8F08118486F7986697E +:10EA8000142F0AD219480089F9F74DFE3146F9F7DB +:10EA9000CEFB7F1CA8616F71EDE715493046F9F791 +:10EAA00050FC6FF00B01F9F78AFC1249F9F717FCDB +:10EAB000C5E90740AC616C7101202871DBE768890A +:10EAC000421C6A81142806D96C81D1F80700642899 +:10EAD00001DD0C2048702C81CDE70000F4040020FB +:10EAE00000003041FFFF8F003E2A0020DC1600208E +:10EAF0000000A0413333534070477047074A30B499 +:10EB00005170064B0022083303E0845C9C54521C75 +:10EB1000D2B28A42F9D330BC03F0B4B85007002017 +:10EB2000064B10B5A3F108020021527803E05C5CAB +:10EB30004454491CC9B29142F9D310BD5807002072 +:10EB400070B50C46054603F051F9024621462846A9 +:10EB5000BDE8704004F07ABD074A30B45170064BEE +:10EB60000022083303E0845C9C54521CD2B28A42D7 +:10EB7000F9D330BC03F0DCB85007002003F08CB9A7 +:10EB800010B504F0DFFD02490020087010BD000040 +:10EB900050070020014840787047000050070020CF +:10EBA0007FB50D496B464A6800928A788DF804203B +:10EBB000002104E0445C5D18491C6C71C9B29142AB +:10EBC000F8D3064901208DF80D0048709DE80F002C +:10EBD00003F076FE7FBD0000500700205427002080 +:10EBE000014988707047000050070020024940F238 +:10EBF00095724A607047000050070020704700007F +:10EC000070B50C46064603F0F1F80A4D2978002944 +:10EC10000ED17F2101704670847003240020FFF71D +:10EC2000E5FF03F06DFB204603F006F90120287094 +:10EC300070BD00005007002070B50D46044603F07B +:10EC4000D5F80C4E3178002913D1002C11D00022B8 +:10EC500003E0A95C8154521C92B2A242F9D3002075 +:10EC6000FFF7C4FF03F04CFB204603F0E5F801205A +:10EC7000307070BD5007002002F0CABFFEE72DE9DA +:10EC8000F04104270126044600F17008002594F89D +:10EC90009110002006296AD2DFE801F0031A6942C8 +:10ECA0004E5B94F85400032870D340460CF0DFF814 +:10ECB00000286BD104F1940140460CF0F4F828B11F +:10ECC00084F8916084F8905084F8AC50012050E0B2 +:10ECD000D4F808C094F89930207804F19A02D4F856 +:10ECE0009410E04784F8980094F89010491C84F838 +:10ECF0009010FF280CD0022084F8910084F8AC50CA +:10ED000094F854008128C2D1032084F85400BEE74F +:10ED1000C8B294F84410884238D384F891702EE039 +:10ED200094F8900094F84410884202D384F89170CB +:10ED3000CCE784F89160C9E784F89150D4F8A82012 +:10ED400012B9226D002AC1D00121D4F8A400904745 +:10ED5000BCE784F89150D4F8A81011B9216D0029AE +:10ED6000B4D00220D4F8A42007F0BAFFAEE7002800 +:10ED70000CD094F89110042989D1002806D022786B +:10ED8000BDE8F0410421012007F0AABFBDE8F081F1 +:10ED900030B500201D4B024604460125C3F89851AA +:10EDA0000521491E0904090CFBD14006D3F81C11AA +:10EDB000000E09B140F00100C3F898410521491E39 +:10EDC0000904090CFBD1521CD2B2082AE6D3C3F8BD +:10EDD00098410521491E0904090CFBD1C3F89C4147 +:10EDE0000521491E0904090CFBD1C3F898510521DE +:10EDF000491E0904090CFBD1C3F898410521491E9D +:10EE00000904090CFBD1C3F89C5130BD008021429C +:10EE10000F490122C1F89C210520401E0004000C6E +:10EE2000FBD1C1F898210520401E0004000CFBD145 +:10EE30000022C1F89C210520401E0004000CFBD1DB +:10EE4000C1F898210520401E0004000CFBD170473A +:10EE5000008021420C490020C1F89C010520401E81 +:10EE60000004000CFBD10122C1F898210520401EAE +:10EE70000004000CFBD1C1F89C210520401E0004B9 +:10EE8000000CFBD1704700000080214230B5164BCA +:10EE90000025C3F898512A460124010602D5C3F87B +:10EEA0009C4101E0C3F89C51C3F898410521491EDB +:10EEB0000904090CFBD1C3F898510521491E090426 +:10EEC000090CFBD14006521C000ED2B2082AE4D332 +:10EED000C3F89C41C3F898410520401E0004000C73 +:10EEE000FBD1C3F8985130BD008021422DE9F0419B +:10EEF000084E4FF40065356009F0F3FD371F6C10C4 +:10EF00003C6009F0EEFD346009F0EBFD3D60BDE8CA +:10EF1000F0810000140C014070B5084D4FF4006002 +:10EF2000286009F0DEFD2C152C6009F0DAFD281DA3 +:10EF30000460BDE8704009F0D4BD0000100C014031 +:10EF40002DE9F047144F0024DFF84C808246254617 +:10EF5000A8F108083E1507F104096006040E3E609A +:10EF600009F0BFFDD8F80000000501D5641CE4B22B +:10EF7000C9F8006009F0B5FD6D1CEDB2082DECD3A9 +:10EF8000BAF1000F04D0FFF7B1FF2046BDE8F087CB +:10EF9000FFF7C2FFF9E70000100C01402DE9F04730 +:10EFA000DFF84890054600244FF480674FF400686E +:10EFB000A9F104062806404601D5306001E0C9F8F1 +:10EFC000000009F08EFD376009F08BFDC9F8007074 +:10EFD000072C01D1C6F800806806050E09F081FDF6 +:10EFE000641CE4B2082CE5D3BDE8F087140C0140A2 +:10EFF00070B509484FF4006606600515056009F014 +:10F0000070FD054C241D266009F06BFD2560BDE8F0 +:10F01000704009F066BD0000100C014070B5074853 +:10F020004FF400640460054D00152D1F286009F0A1 +:10F0300058FD2C60BDE8704009F053BD140C014030 +:10F0400070B50C4C4FF40060206009F04AFD2515A6 +:10F05000256009F046FD074808380068000501D51D +:10F06000012400E000240348001D056009F039FD7B +:10F07000204670BD100C01407047000003497F20FE +:10F08000086003490020087070470000002C004011 +:10F09000540200200C48C16941F40061C1610B4970 +:10F0A00040F2FF30086009487F21001F01600168BD +:10F0B00041F0800101604FF0E021002081F8000460 +:10F0C0000120C1F80001704700100240042C0040EC +:10F0D0000A480B4A0078137900F0010199420BD0DD +:10F0E0001171C00708D00749002081F82700C870B7 +:10F0F00081F8260081F8200070470000F9170020F1 +:10F1000098060020542700202DE9F0410024144DDA +:10F11000FF2604EB440000EBC40005EB001007469B +:10F12000B021F9F74AF8641CE4B23E70022CF0D327 +:10F130000C4C206818B90C4807F068FE206007F0F6 +:10F14000C2FE18B90A21206807F0B6FE074901205F +:10F1500007F0FAFDBDE8F0410549022007F0F4BDD3 +:10F16000C0110020C8040020E9B1010851B6000810 +:10F1700045B6000810B548210F48F9F71EF80E48AB +:10F1800028214830F9F719F80C4801F075FB010007 +:10F1900004D0094814224830F8F7F6FF0748203019 +:10F1A00001F06AFB010006D003481422BDE81040BC +:10F1B0005C30F8F7E9BF10BD5011002088B201089B +:10F1C0002DE9F04116460D46FFF7C2FA040007D0BC +:10F1D00035B12EB1287818B194F85400012802D026 +:10F1E0000020BDE8F08195F82000C00702D0A86A91 +:10F1F0000028F6D095F8250084F8450010B9322093 +:10F2000084F84500C0B200EB4000C00009F09AFE4F +:10F21000C4F88C000028E4D0014694F84530182248 +:10F2200004F170000BF033FE95F82000C0070FD1F9 +:10F2300094F84500000109F085FEC4F8880078B311 +:10F24000014694F84530102204F158000BF01FFEDF +:10F25000286A04F12007206420213846F8F7ADFF22 +:10F260001F2229463846F8F78FFFE86AF862A86A35 +:10F27000B86295F8240087F82400286B38630C489E +:10F2800030610C48F0600C48B0600C4870600C486D +:10F2900030600C487061022084F854000120A0E71F +:10F2A000FFE754F88C0F09F0D9FA0020206097E7A7 +:10F2B0001392010883900108F59001080591010857 +:10F2C00079910108EF8F01080068B0F5607F15D0D3 +:10F2D000A0F58061523911D0A0F5806153390DD06D +:10F2E000A0F58061543909D0A0F58061513905D06D +:10F2F000A0F5C061123901D000207047012070478D +:10F30000014800787047000018050020A0F1300186 +:10F31000092905D91139052902D96138052801D8EB +:10F32000012070470020704730B50446002014F8D3 +:10F33000015B8D4203D1012A08D0521ED2B2002BAC +:10F3400004D0401C5B1E80B29BB2F0E730BD0000D1 +:10F35000144810B5C07E144C012816D04FF47A70B2 +:10F360000146A0611048143003F020FA012817D19B +:10F37000E0784FF4007110F0010F00F10100E0702F +:10F380000A4804D0FFF721F803E06420E8E7FFF71C +:10F390001EF805480021BDE81040143003F006BAFD +:10F3A00010BD0000001700200000002000080140F0 +:10F3B0002DE9F84F01211C2001F02AF84FF40076C6 +:10F3C000ADF800601024DFF858918DF80340032554 +:10F3D0008DF8025069464846FEF776FF31464846AA +:10F3E000FEF7F5FF0127ADF800708DF803408DF8AA +:10F3F000025069464846FEF767FF01214846FEF77E +:10F40000E6FF40F20240ADF800008DF803408DF8B1 +:10F41000025069464846FEF757FF02214846FEF76C +:10F42000D6FFA1014846FEF7D0FFA020ADF80000AE +:10F43000DFF8F0A08DF803408DF802506946504681 +:10F44000FEF742FF20215046FEF7BFFF80215046C5 +:10F45000FEF7BDFF44F22720ADF80000DFF8C880BA +:10F460008DF803408DF8025069464046FEF72CFFA8 +:10F4700031464046FEF7ABFF01214046FEF7A5FFAF +:10F4800002214046FEF7A1FF04214046FEF79DFF02 +:10F49000A1024046FEF799FF20214046FEF795FF66 +:10F4A0002001ADF8000048258DF803506946484614 +:10F4B000FEF70AFFE002ADF800008DF80350694640 +:10F4C0005046FEF701FFADF800608DF80350694625 +:10F4D0005046FEF7F9FE0121084600F099FF012190 +:10F4E0001248FEF73FFFADF800408DF802708DF82E +:10F4F000034069464046FEF7E7FE10214046FEF70E +:10F5000066FF0020FAF7F6FA6002ADF8000004206A +:10F510008DF8030069465046FEF7D6FEBDE8F88F29 +:10F520000008014000100140000C014000013000C3 +:10F53000FEE770474FF4A06000F032B830B50F23FB +:10F54000C27801780125F2B1144A126801F1E02174 +:10F5500002F4E062C2F5E062120AC2F10404D34090 +:10F560004278A24084781C401443220181F8002490 +:10F57000007800F01F018D404009800000F1E0207C +:10F58000C0F8005130BD01F01F00854048098000DF +:10F5900000F1E020C0F8805130BD00000CED00E02B +:10F5A0000249084302490860704700000000FA055C +:10F5B0000CED00E00907090E002806DA00F00F0044 +:10F5C00000F1E02080F8141D704700F1E02080F881 +:10F5D00000147047024A114001430248016070471D +:10F5E00080FFFF1F08ED00E04FF40072002101488A +:10F5F00004F0C6BAA827002010B540F6B83421465A +:10F60000074803F0D3F8012806D105482146001D1C +:10F6100003F0CCF8012801D0012010BD002010BD5E +:10F62000AC020020014908627047000000000E4251 +:10F630002DE9F0472348DFF890900122B0F81880B8 +:10F6400009F2FA250020C5F80490287043462021CD +:10F650004846FFF769FE687004461CA0696805F01B +:10F6600099F8444528D0022624E019F804102029EE +:10F6700025D02978274605EB810109EB0700886032 +:10F680004346324620211048FFF74EFE2A781349A0 +:10F690000446C01B5054297805EB8100826810A0F5 +:10F6A00005F078F82878401CC0B22870042803D2EE +:10F6B000761CF6B24445D8D10120BDE8F087641C21 +:10F6C000A4B2F7E77C070020E2320020696E6F7574 +:10F6D0007420636D643A25730A000000F43500203D +:10F6E000256420706172616D3A25730A0000000084 +:10F6F0001FB50F4B012018720020D887009A9DF883 +:10F700000410A2F5E0626846853A09D05A2A06D16B +:10F7100040F2DF72A3F84C20401DFFF7EFF91FBD48 +:10F7200040F28572A3F84C20401DFFF715FA1FBD6B +:10F7300054270020704700002DE9F047DFF8E480EF +:10F740004FF4807529464046FEF738FE364CDFF808 +:10F75000DC906E00207331464F464846FEF72EFE81 +:10F76000607302462378217B31A005F013F83146FF +:10F770003846FEF723FE002700282AD0AA4629464D +:10F7800045464046FEF71AFE18B3A0780A21B0FBA2 +:10F79000F1F201FB1201401CA070012915D1314684 +:10F7A0004846FEF70BFE08B12CA100E02DA12FA0CA +:10F7B00004F0F0FF51462846FEF700FE08B127A1ED +:10F7C00000E028A12BA004F0E5FFFCF78FFDA0B915 +:10F7D0001AE0207BE178884205D0E07080B121A159 +:10F7E00022A004F0D7FF2179607B814205D02071EF +:10F7F00040B11CA11FA004F0CDFF6770BDE8F087E9 +:10F8000016A1EDE715A1F5E761781DA004F0C2FF90 +:10F810006078401CC0B260700C28EFD96770FEF7AA +:10F8200021F9000000080140E00400200010014020 +:10F830007374617465412D2D2D202564202073740F +:10F840006174654163633A20256420202077616BF1 +:10F85000655F747970653A25640D0A0077616B65A0 +:10F8600075700000736C656570000000412B2025E9 +:10F87000730D0A004143432025730D0A0000000068 +:10F88000456E74657220536C6565702054696D65B2 +:10F89000206164642D2D2D20256420202D2D4D61A7 +:10F8A000782D31320D0A00002DE9F0412B482C490A +:10F8B0004069F8F714FDF8F772FF81B2B1F5AF7F38 +:10F8C00043D3284A284E00249079012706EBC00331 +:10F8D0000546B3F802C08C450CD316E036F830C0AC +:10F8E0008C4505D206EBC00CBCF802C08C4504D890 +:10F8F000401CC0B20528F1D301E0052800D3042044 +:10F90000D472947AECB9977216E036F830C08C4510 +:10F910000CD814E036F830C08C4505D206EBC00C8C +:10F92000BCF802C08C4503D8401EC0B20028F1D1FB +:10F930009472D47A2CB9D772DB88D38101E0D47267 +:10F940009472D3891BB15B1ED381BDE8F0818542DF +:10F95000FBD03229F9D99071F7E70000E8160020B2 +:10F960000000C842E0040020C8B20108074810B5F2 +:10F9700040F2126101600021416001724172022176 +:10F98000817205F0EBFE012010BD00002C0C002060 +:10F9900070B5FCF7C1FB05F081FC002877D0764CF0 +:10F9A0000025207B012802D0022866D0D1E07248D1 +:10F9B0000A21A83002F010FF012857D1E08E0A2159 +:10F9C000B0FBF1F201FB1202F2B1B0FBF1F201FB6C +:10F9D0001202012A20D0B0FBF1F201FB1202022A2E +:10F9E00022D0B0FBF1F201FB1202032A24D0B0FBBB +:10F9F000F1F201FB1202042A26D0B0FBF1F201FB66 +:10FA00001200052828D02EE040F2126007F080F99D +:10FA100008B3FFF7ABFF26E04FF4607007F078F90A +:10FA2000C8B100F0B3F81EE040F2524007F070F9A0 +:10FA300088B1FEF7E1F816E040F2534007F068F9AC +:10FA400048B1FEF7E3F90EE040F2544007F060F9E8 +:10FA500008B1FEF733FA06E040F2514007F058F9DA +:10FA600008B1FEF749F9E08E401CE086E08E0628DA +:10FA70006FD3E586022020736BE0FCF747FC3E4E17 +:10FA8000803610B9FCF732FC10B175620FE061E00E +:10FA9000706A42F21071884209D237480A21B030A8 +:10FAA00002F09AFE012802D1706A401C706232484E +:10FAB0006421A83002F090FE0525012818D1608F3E +:10FAC000B0FBF5F105FB1101401C608781B92B48A3 +:10FAD00000780028E08E00F10100E08602D0C00727 +:10FAE00004D105E000F00300012801D1FFF73EFF3B +:10FAF00021481421AC3002F06FFE012829D1A08FDB +:10FB0000B0FBF5F105FB1101401CA08709BBFFF715 +:10FB100073FD01281DD1208F401C80B2B0FBF5F190 +:10FB200005FB11012087042915D0B0FBF5F105FB79 +:10FB30001101032916D0B0FBF5F105FB11010229D3 +:10FB400013D0B0FBF5F105FB1100012810D0FEF732 +:10FB5000D3F8012070BDFCF7D9FB0028F9D000F0E4 +:10FB600015F8F6E7FEF748F8F3E7FEF74FF9F0E788 +:10FB7000FEF7A4F9EDE7000058020020E50400209C +:10FB80000149012008737047580200202DE9F84F01 +:10FB9000824800264FF46071C0E900160672467272 +:10FBA000082181727E4834467E498068F8F73FFB21 +:10FBB000F8F7F5FD7C4D85F8D5007C4810F8281F36 +:10FBC00040780844282101EB500085F8D600784899 +:10FBD000294631F8D39F4378487909F00F0220F085 +:10FBE0000C00062B03D095F80A11012977D1001DCE +:10FBF00085F8D80095F8B910DFF8B0B1C1F3411C11 +:10FC0000DFF898E16B49AEF1B80EBBF81CA049785B +:10FC1000BBF81E80BEF830E0BBF826700097664F38 +:10FC20008B1EBCF1020F97F800B0624FBF781BD05B +:10FC3000032B5FD84B466AF30F13A5F8D330B5F802 +:10FC4000D2203C2368F30B02A5F8D220BEFBF3F2CE +:10FC500085F8D720009A7AB320F0F000503085F86C +:10FC6000D80085F8D9B056E0032B5ED84B466AF32E +:10FC70000F13A5F8D330B5F8D2203C2368F30B025C +:10FC8000A5F8D220BEFBF3F285F8D720009A002A0F +:10FC9000E2D1042924D005290AD003290DD01AE085 +:10FCA00020F0F00030301EE020F0F00020301AE0AC +:10FCB00020F0F000403003E007E020F0F0002030BA +:10FCC00085F8D80085F8D96025E0042908D00529F1 +:10FCD0000CD00329E8D020F0F0001030F0E724E049 +:10FCE000022FE1D1DCE785F8D80014E020F0F00025 +:10FCF0004030F8E720F0F000103085F8D80085F8A3 +:10FD0000D960A5F8D320B5F8D2006FF30B00A5F8A1 +:10FD1000D20085F8D76021483E38407C012895F80C +:10FD2000D80020F0030004D004E020F0F0006030A0 +:10FD3000E3E7401C85F8D8000BF08EF820B11E4890 +:10FD4000007885F8D90001E085F8D9601648B03010 +:10FD500050F8221F42681548C37E012B0BD1174B68 +:10FD60001B78042B07D1134B5B78042B03D1838BB7 +:10FD7000C08B43EA003464F31741200A60F30F217B +:10FD8000200C60F30701054840F80B1F4260034850 +:10FD900007F0C0F80120BDE8F88F00002C0C00200F +:10FDA000E816002000002042FC0D00200017002073 +:10FDB0003E2A0020580200207C0700201B0500205E +:10FDC000064810B5406938B1044840F21451143067 +:10FDD00002F0ECFC002800D0012010BD940F0020A0 +:10FDE00010B50949027B11F8DB3F62F303030B7086 +:10FDF000C27A064B02F00301D972017B104605F06E +:10FE00005DFD012010BD0000FC0D00205802002007 +:10FE10000249012081F80A0170470000FC0D002012 +:10FE2000044950F80B2F41F8092F40684860012021 +:10FE300070470000AC0E00202DE9F0410446B0F8F8 +:10FE40000B0040BAF8F785FC1B4E1C4F32463B4670 +:10FE5000F8F768FBDFF8688000224346F8F75CFBA0 +:10FE6000F8F7D0FC80B2411E40F2E732154D9142C6 +:10FE70000CD2F8F76EFC32463B46F8F753FB0022F3 +:10FE80004346F8F749FBF8F7BDFCA880B4F80F002B +:10FE900040BA2881F8F75DFC0B4A0C4BF8F742FB9F +:10FEA000F8F7B0FC0A490870607CA872A07CE87280 +:10FEB0000120BDE8F08100009A9999999999A93F8C +:10FEC00000009940FC0D00207B14AE47E17A843F8E +:10FED0005802002030F80B1F4ABA074921F8402F7A +:10FEE000428852BA4A80828852BA8A80C08840BA10 +:10FEF000C880012070470000FC0D002030F80B1F67 +:10FF00004ABA074921F8482F428852BA4A80828863 +:10FF100052BA8A80C08840BAC88001207047000069 +:10FF2000FC0D002030F80B1F4ABA074921F8502F6A +:10FF3000428852BA4A80828852BA8A80C08840BABF +:10FF4000C880012070470000FC0D002030F80B1F16 +:10FF50004ABA074921F8582F428852BA4A80828803 +:10FF600052BA8A80C08840BAC88001207047000019 +:10FF7000FC0D002030F80B1F4ABA074921F8602F0A +:10FF8000428852BA4A80828852BA8A80C08840BA6F +:10FF9000C880012070470000FC0D002030F80B1FC6 +:10FFA0004ABA074921F8682F428852BA4A808288A3 +:10FFB00052BA8A80C08840BAC880012070470000C9 +:10FFC000FC0D002030F80B1F4ABA074921F8702FAA +:10FFD000428852BA4A80828852BA8A80C08840BA1F +:10FFE000C880012070470000FC0D002030F80B1F76 +:10FFF0004ABA074921F8782F428852BA4A80828843 +:020000040801F1 +:1000000052BA8A80C08840BAC88001207047000078 +:10001000FC0D002030F80B1F49BACAB2084921F87C +:10002000802F428852BAD2B24A80828852BAD2B263 +:100030008A80C08840BAC0B2C880012070470000E2 +:10004000FC0D00202DE9F041044634F80B0F40BAB6 +:10005000F8F77FFB0F4E104F32463B46F8F762FA37 +:10006000F8F7D0FB0D4DA881608840BAF8F771FB16 +:1000700032463B46F8F756FAF8F7C4FBE881207998 +:10008000287460796874A079A874E079E874012014 +:10009000BDE8F0819A9999999999A93FFC0D0020A2 +:1000A00010B50C4AC37A12F8A01F63F30301117054 +:1000B000C37A1B0963F3071111700A09072A00D9D3 +:1000C000072200F10C010348A130F8F75DF8012088 +:1000D00010BD0000FC0D00202DE9F041044634F86D +:1000E0000B0F40BA00B2F8F723FB184E184F3246F8 +:1000F0003B46F8F717FA0022164BF8F70DFAF8F717 +:1001000062FB154DA882608840BA00B2F8F710FB78 +:10011000F217F8F7E8FAF8F775FBE882A08840BA1A +:1001200000B2F8F705FB32463B46F8F7FBF9F8F763 +:1001300069FB2883A0790B3C282800D92838A876A9 +:10014000A07CE8760120BDE8F08100009A99999999 +:100150009999A93F00009940FC0D002030F80B1F31 +:100160004ABA094921F81C2F428852BA4A800279BA +:10017000283A0A714279283A4A71C08840BAA1F8EF +:100180000700012070470000FC0D00202DE9F04120 +:10019000044634F80B0F40BAC0F30B00F8F7D9FA55 +:1001A0000D4E0E4F32463B46F8F7BCF9F8F72AFBE6 +:1001B0000B4D25F8250F608840BAC0F30B00F8F707 +:1001C000C8FA32463B46F8F7ADF9F8F71BFB6880F2 +:1001D0000120BDE8F08100009A9999999999B93F59 +:1001E000FC0D00200949C27A01F8292F027B4A70D0 +:1001F000427B8A70827BCA70C27B0A71027C4A7120 +:10020000427C8A71807CC87101207047FC0D0020FF +:100210000949C27A01F8312F027B4A70427B8A7009 +:10022000827BCA70C27B0A71027C4A71427C8A71ED +:10023000807CC87101207047FC0D002070B50F4D07 +:100240000446C07A85F83900A08940BAF8F781FAE7 +:100250004FF0FF363246F8F746FAF8F7D3FA6887D8 +:10026000E880E08940BAF8F774FA3246F8F73BFACA +:10027000F8F7C8FAA887012070BD0000FC0D002027 +:10028000C17A282900D92839174AA2F89010017B91 +:10029000282900D92839A2F89210417B282900D9B1 +:1002A0002839A2F89410817B282900D92839A2F88E +:1002B0009610C17B282900D92839A2F89810017C12 +:1002C000282900D92839A2F89A10417C282900D978 +:1002D0002839A2F89C10807C282800D92838A2F858 +:1002E0009E00012070470000FC0D002070B51149F0 +:1002F00050F80B2FA1F130058A674068C86735F8C0 +:10030000AC4FA008F8F725FA0B4A0C4BF8F70AF99E +:10031000F8F778FA60F38F042C802879F8F719FA47 +:10032000074A084BF8F7FEF8F8F76CFA2871012035 +:1003300070BD00002C0E00209A9999999999B93FA7 +:100340004A0C022B8716C93F0A4A50F80B1F42F885 +:10035000011F41685160427983791204C07942EAF1 +:1003600003220243034862F31F31B038C0F8B510CE +:1003700001207047AC0E002010B504480449F8F77E +:1003800041FA0449A1F8C900012010BD9A99999930 +:1003900099D1B840FC0D00200A4911F8C12F02F58F +:1003A000FA620A70027B4A70427B8A70827BCA7052 +:1003B000C27B0A71027C4A71427C8A71807CC8715E +:1003C00001207047FC0D0020044A0029516901D02A +:1003D000014300E08143516170470000001002407A +:1003E000044A0029D16901D0014300E08143D16171 +:1003F0007047000000100240044A0029116901D032 +:10040000014300E081431161704700000010024089 +:10041000044A0029916901D0014300E081439161C0 +:100420007047000000100240044A0029D16801D042 +:10043000014300E08143D16070470000001002409A +:10044000014908607047000040044242F0B52B4C5F +:1004500061682B4A11F00C014FF00F0603D00429FC +:1004600001D0082901D0026026E06168636806EACD +:10047000914103F480330D2901D0891C00E006214D +:10048000BBB1E36A13F4803FE36A03F00F0303F1A7 +:1004900001030AD0E56AC5F30317E56A7F1CB2FBC6 +:1004A000F7F2C5F30325AD1C6A43B2FBF3F24A43EE +:1004B000D9E7144A514301606168134A06EA1111F1 +:1004C000535C0168D94041606368072505EA13233E +:1004D000D35C21FA03F38360636805EAD323D25C1B +:1004E000D140C1606268032303EA9232064B1B1FAE +:1004F0009A5CB1FBF2F10161F0BD00000010024016 +:1005000000127A0000093D0044020020034600204A +:100510005909094A01290AD002290AD0516A03F06F +:100520001F02012393400B4200D001207047116845 +:10053000F5E7116AF3E700000010024006490022C7 +:1005400081F8202081F82020012802D0042802D13F +:10055000052081F820007047001002400149086022 +:100560007047000080044242014908607047000063 +:100570003C04424202490A6A02430A627047000090 +:100580000010024070B50D460646002403E0305DC1 +:1005900003F010F9641CAC42F9DB70BD70B50D4678 +:1005A0000646002403E0305D03F004F9641CAC420D +:1005B000F9DB0D2003F0FEF80A2003F0FBF800241D +:1005C00003E0305D02F0CCF9641CAC42F9DB70BD95 +:1005D00070B50D460646002403E0305D03F0C8F90F +:1005E000641CAC42F9DB70BD10B54FF40030FDF770 +:1005F000F1F902490220087010BD0000E00400205B +:100600003EB54FF40030002500908DF804500820CE +:100610008DF8050001248DF806406846FDF7EAF9DB +:1006200029208DF8080002208DF809008DF80A5065 +:100630008DF80B4002A8FEF781FF3EBD02480188FD +:1006400041F01001018070470428004002480188F1 +:1006500021F01001018070470428004006480188FD +:10066000031D1A880088814203D0198841EA00409E +:10067000704742EA0140704718280040044A0029A8 +:10068000118801D0014300E08143118070470000D0 +:100690000028004010B516A004F07CF801214FF0AE +:1006A000C050FFF79DFE0120FEF7BCFFF9F719FAD5 +:1006B0000020FFF743FF0120FFF750FF6120FFF705 +:1006C00025FF0028FAD04FF40070FFF753FF0120F8 +:1006D000FFF74AFF00F060F849F6404000F044F8A8 +:1006E00000F052F8BDE81040002000F02DB80000E6 +:1006F0005254435F496E745F436F6E6669677572EB +:100700006174696F6E0D0A0010B50446FFF7A6FF0D +:10071000204400F009F800F037F80121BDE810404E +:100720000220FFF7ABBF000000B50246FFF786FFCF +:100730000449100C0880081D02805DF804EBFFF7E7 +:1007400085BF00002028004000B50246FFF776FF75 +:100750000449100C0880081D02805DF804EBFFF7C7 +:1007600075BF00001828004000B50246FFF766FF7D +:100770000449C2F303400880081D02805DF804EBC1 +:10078000FFF764BF08280040024801888906FCD5AD +:1007900070470000042800400448018821F0080147 +:1007A000018001880907FCD570470000042800403B +:1007B0000F4910B50120C1F89801FEF729FB9020E0 +:1007C000FEF764FB0020FEF761FBFEF743FBFEF73C +:1007D0001FFB9120FEF75AFBFEF7DAFA054C20705A +:1007E000FEF7D6FA6070FEF735FB208840BA10BDE0 +:1007F000008021427E06002000B597B0142112A887 +:10080000F7F7DBFC5A208DF8000001208DF801007D +:1008100086218DF802108DF80400022100208DF849 +:1008200003108DF8050006216846FBF731F99DF8A5 +:100830000320ADF84400694612A8121DF7F7A4FC86 +:10084000BDF844009DF8031013AA030A8B54521CF0 +:1008500042F210738854074AB2F81900984202D243 +:10086000401CA2F8190012A8891DFFF7B1FE17B0AD +:1008700000BD00000017002010B508B34168F9B1B1 +:100880008168E9B10178174B002202EB420404EBC6 +:10089000C20403EB041424788C4211D0521CD2B24F +:1008A000022AF2D3002202EB420101EBC20103EB68 +:1008B00001110978FF2905D0521CD2B2022AF2D3C5 +:1008C000002010BD02EB420101EBC20103EB011459 +:1008D000014620222046F7F757FC012084F85400F7 +:1008E000014810BDC0110020CC040020704700005A +:1008F00003490869401C0861012800D172B670479D +:100900006807002005490869012802D0401E0861D7 +:1009100070470020086162B6704700006807002039 +:100920002DE9F84F01208DF802004FF44C60ADF82E +:100930000000DFF898B104248DF80340694658465A +:10094000FDF7C2FCE1016248FDF741FD614D28461B +:10095000F8F7E6F900212846F8F7CEF9012140F230 +:10096000BD10FFF755FD5C4D284603F021F800212E +:10097000284603F012F840F225590022494628463D +:1009800003F076F840F2244A00225146284603F04C +:100990006FF80C20ADF8000010258DF803500326E9 +:1009A0008DF8026069464A48FDF78EFC04214848EC +:1009B000FDF70BFD08214648FDF707FD0120FCF778 +:1009C00038FF464F384602F0F3FF0021384602F068 +:1009D000E4FF00224946384603F04AF8002240F27C +:1009E0002661384603F044F800225146384603F0A9 +:1009F0003FF8B002ADF80000394F8DF8034069466A +:100A00003846FDF761FCDFF8DC80404602F0D0FF9D +:100A10000021404602F0C1FF00224946404603F053 +:100A200027F800225146404603F022F8A002ADF814 +:100A300000008DF8034069463846FDF745FCADF8E7 +:100A4000004069462848FDF73FFC02212048FDF799 +:100A5000BCFC8DF802604FF40870ADF800008DF812 +:100A6000035069465846FDF72FFC8DF802602402BA +:100A7000ADF800408DF8035069461548FDF724FC99 +:100A800021461348FDF7A3FC61105846FDF79FFC73 +:100A900020215846FDF79BFC10215846FDF795FC98 +:100AA00020213846FDF791FC01215846FDF78DFCC9 +:100AB00002215846FDF789FC04215846FDF785FCC4 +:100AC00021015846FDF781FCBDE8F88F000C01407C +:100AD000000801400024014000440040004C004058 +:100AE0000010014000500040001401402DE9F04189 +:100AF00003460E46407819785F4A00EB012085B224 +:100B00005F48978900245D4990F82000AF4210D1DA +:100B10008979B1420BD140B1FBF7B0FB18B1324635 +:100B2000991C584815E02224A2E03324A0E01324A5 +:100B30009EE0978AAF4212D1897AB142F7D100285C +:100B4000F3D0FBF79BFB0028EDD04E483246991CB2 +:100B50003530F7F719FB2846FCF7F2FB88E0D78A17 +:100B6000AF420DD1C97AB142E1D10028DDD0FBF707 +:100B700085FB0028D7D04348991C32463930E8E736 +:100B8000178BAF420DD1097BB142D0D10028CCD018 +:100B9000FBF774FB0028C6D03A48991C32463D301A +:100BA000D7E7578BAF420DD1497BB142BFD1002867 +:100BB000BBD0FBF763FB0028B5D03248991C324606 +:100BC0004130C6E7978BAF420DD1897BB142AED1A0 +:100BD0000028AAD0FBF752FB0028A4D02948991C72 +:100BE00032464530B5E7D78BAF420DD1C97BB14214 +:100BF0009DD1002899D0FBF741FB002893D02148D4 +:100C0000991C32464830A4E7178CAF420DD1097CBD +:100C1000B1428CD1002888D0FBF730FB002882D06D +:100C20001848991C32464B3093E7578CAF420DD190 +:100C3000497CB14298D1002898D0FBF71FFB0028CF +:100C400098D01048991C32464E3082E7928CAA42C6 +:100C50000DD1897CB14287D1002887D0FBF70EFBEC +:100C6000002887D00748991C3246513071E731245B +:100C70002046BDE8F0810000B6BA0108A2BA01081A +:100C800054270020A517002070B5184D00248EB001 +:100C9000B5F840101646042902D213200EB070BDDC +:100CA000017871228DF8002002788DF801204278B9 +:100CB0008DF80220807804228DF80300012907D0E6 +:100CC000022905D0032903D02879012802D004E0A5 +:100CD000312402E00020287112241A801CB96946D0 +:100CE0003046F7F751FA2046D8E700005427002095 +:100CF00004494BF65C200880091D4AF655200880FF +:100D000070470000B06C00400CB500222E480092E5 +:100D10000192016841F4803101604FF4A0630168E1 +:100D200001F4003101910099491C0091019911B918 +:100D300000999942F3D10168890342D501210191BB +:100D400022490A6842F010020A600A6822F007028B +:100D50000A600A6842F002020A6041684160416824 +:100D60004160416841F480614160C16A184A1140A4 +:100D7000C162C16A174A1143C162016841F08061D2 +:100D8000016001680901FCD5416821F47C114160D2 +:100D9000416841F4E8114160016841F080710160EF +:100DA00001688901FCD5416821F003014160416877 +:100DB00041F0020141604168C1F381010229FAD189 +:100DC0000CBD01920CBD000000100240002002404A +:100DD00000F0FEFF14080100FFF78ABF10B598B0BD +:100DE000142112A8F7F7E9F95A208DF80000012123 +:100DF0008DF8011084208DF802002D4840F2BB23AD +:100E00002C4C828FA2F209729A4203D290F80A0106 +:100E100001284AD0002020760B208DF8030034F8FA +:100E2000010F010A8DF804108DF80500A088010A51 +:100E30008DF806108DF80700E088010A8DF808107B +:100E40008DF809008DF80A108DF80B00B4F8110028 +:100E5000010A8DF80C108DF80D00E07D8DF80E0064 +:100E60000F216846FAF714FE9DF80320ADF8440000 +:100E7000694612A8121DF7F787F9BDF844009DF8DE +:100E8000031013AA030A8B54521C8854208B42F27D +:100E90001072641E904202D2401CA4F8190012A8DD +:100EA000891DFFF795FB18B010BD2176B4E700004F +:100EB000FC0D00200017002070B5FEF7B9FB0028DC +:100EC00018D0124C0020124D124EE08380B200EB7D +:100ED000400005EB800041687068F7F779F9002859 +:100EE000E08B08D000EB400005EB8000806800B18B +:100EF0008047012070BD401C80B2E0830B28E5D301 +:100F000005A003F047FC002070BD00007C07002016 +:100F10003CBB0108DC350020416E20756E726563B4 +:100F20006F676E697A656420434D4420210A000092 +:100F300030B547220270032343700B788370C27070 +:100F4000062303714B7843718B788371CB78C3711F +:100F500002720A2343720B790E2503F03F0383725A +:100F60004B7903F03F03C3728B7903F01F030373C4 +:100F7000CB7903F01F0343730B7A03F01F038373D2 +:100F80004C7A0F2304F03F04C473027445748D7AC5 +:100F90008574CD7AC574027543750B7B83751024F7 +:100FA000C27504764A7B4276897B81761B2030BDF0 +:100FB0000F220249801CF7F7E7B80000FD17002058 +:100FC000F0B50023137003EB430404EBC30400EB00 +:100FD0004404647834B144EA032514786600641C40 +:100FE00014708D535B1CDBB2122BECD310780028ED +:100FF0001DD0002317E000200EE001EB400531F882 +:1010000010606C88F7B204F0FF0C674502D96E805F +:1010100021F81040401CC0B21478E41A641E8442C7 +:10102000EBDC5B1CDBB21078401E9842E3DCF0BDC9 +:1010300010B50B46024600240DE01078FEF766F965 +:1010400038B112F8010BFAF76BFD04EB840100EBE9 +:1010500041045B1EDBB2002BEFD1204610BD000027 +:101060002DE9F84F4FF417742146F648F7F7A5F825 +:10107000F5A003F08FFBFE4D2246F249284605F00D +:1010800013FCF04F3878FF2800D050B90A20FCF745 +:101090004AF9F8A003F07EFB2246EA49284605F00B +:1010A00003FC3878FF2800D050B90A20FCF73BF940 +:1010B000F5A003F06FFB2246E249284605F0F4FB59 +:1010C0003978FF2900D051B90A20FCF72CF9F4A097 +:1010D00003F060FB2246DB49284605F0E5FB97F864 +:1010E0003800FF2804D1D74814213830F7F765F8C5 +:1010F0003878DFF85083DFF8C0930A260025A8F17E +:101100006808FF2801D0002872D1C8F86850C8F8D4 +:101110006C50C8F87050C8F8745087F87650482062 +:101120003870592078704420B8704E20F870322002 +:10113000387130217971B8713320F871D9F80810FD +:10114000080EB6EB101F4FEA101201D2263200E053 +:10115000303200F00F003A720A2801D9263000E040 +:1011600030307872C1F30740B6EB101F4FEA10120F +:1011700001D2263200E0303200F00F00BA720A28A5 +:1011800001D9263000E03030F872C1F30720B6EB09 +:10119000101F4FEA101201D2263200E0303200F068 +:1011A0000F003A730A2801D9263000E030307873F6 +:1011B000C8B2B6EB101F4FEA101101D2263100E081 +:1011C000303100F00F00B9730A2801D9263000E051 +:1011D0003030F873B9A003F0DDFA0024BCA0395D0B +:1011E00003F0D8FA641CE4B2102CF7D387F84C5003 +:1011F00097F8B900FF2801D00A2804D987F8B95018 +:10120000AEA003F0C7FA387CFF2800D080B9C8F838 +:101210007850C8F87C508B48C8F88050ADA2AFA178 +:101220001030C8F8845003F0C5FAADA003F0B2FA4C +:10123000844C97F820001834FF2800D050B981481A +:10124000A560AFA2A5A12030E56003F0B3FAAEA07F +:1012500003F0A0FA97F82800FF2800D060B92561B4 +:1012600065617848A5619BA29CA12830E56103F0E7 +:10127000A1FAA5A003F08EFAB7F84D004FF6FF7162 +:101280004FF0500B884200D008B9A7F84DB0B7F81E +:101290004F005522884200D008B9A7F84F20B7F870 +:1012A00051008846404500D008B9A7F85120654C48 +:1012B00097F895009534FF2800D0B8BB9BA1204635 +:1012C000F6F7ACFFD9F80810C1F30740B6EB101FD2 +:1012D0004FEA101201D2263200E0303200F00F0047 +:1012E00087F8A0200A2801D9263000E0303087F89E +:1012F000A100C1F30720B6EB101F4FEA101201D274 +:10130000263200E0303200F00F0087F8A2200A28D1 +:1013100001D9263000E0303087F8A300C8B2B6EB20 +:10132000101F4FEA101102D2263101E016E03031D1 +:1013300000F00F0087F8A4100A2801D9263000E039 +:10134000303087F8A5002046694603F079F99DF80A +:101350000000303087F89D0087F84C50394821460E +:10136000983040F8115F8580857175A003F012FAFE +:10137000B7F890004146884200D008B9A7F89060BD +:10138000B7F853006E22884200D008B9A7F853205E +:10139000B7F857004FF4E17C884200D008B9A7F8AD +:1013A00057C0B7F85500884200D018B94FF47A609A +:1013B000A7F85500B7F8590040F6AC54884200D061 +:1013C00008B9A7F85940B7F85B004FF4FA738842A0 +:1013D00000D008B9A7F85B30B7F88300884200D086 +:1013E00018B940F61C40A7F88300B7F8850088427A +:1013F00000D008B9A7F885C0B7F85D00884200D0D2 +:1014000018B9B7F88300A7F85D00B7F85F004FF48C +:101410007A78884200D008B9A7F85F80B7F86100F1 +:10142000884200D008B9A7F86130B7F86300884255 +:1014300000D018B94FF49B70A7F86300B7F86500A7 +:1014400088428FE0902A00203D3D3D3D3D3D486172 +:10145000692044756E20506172616D6574657220FB +:10146000496E6974213D3D3D3D3D3D0D0A00000042 +:1014700000F001086273705F5265616443707546E5 +:101480006C617368210D0A006273705F526561645C +:10149000437075466C61736820310D0A00000000CE +:1014A0006273705F52656164437075466C61736806 +:1014B00020320D0A0000000040170020736E2069E2 +:1014C000732064656661756C74210D0A000000006C +:1014D00025632000484559444E0000002573000054 +:1014E000626C7565746F6F74685F6E616D6520699D +:1014F000732064656661756C74210D0A000000003C +:101500003132333400000000626C7565746F6F74A3 +:10151000685F7061737377617264206973206465BA +:101520006661756C74210D0A000000004C4B364159 +:1015300044434531354C42343038353639000000AB +:101540000A0D205379735061726150696C654420B3 +:101550005665686963686C65496E666F2025730A15 +:101560000D00000000D008B9A7F86540B7F8670083 +:1015700040F6B83A884200D008B9A7F867A097F8B3 +:10158000B500FF2800D008B987F8B52097F8B60055 +:10159000FF2800D010B9322087F8B60097F8B000C5 +:1015A000FF2800D010B9032087F8B000B7F8B100C9 +:1015B000884200D018B94FF4D270A7F8B100B7F83C +:1015C000B300884200D018B94FF4A070A7F8B30058 +:1015D00097F893004FF01E09FF2801D00A2801D286 +:1015E00087F8939097F86B00FF2802D1022087F8C4 +:1015F0006B00B7F86900A0F57F41FF3900D008B94A +:10160000A7F8696097F86C00FF2803D10A21764893 +:10161000F6F7D3FD97F87600FF2801D187F87650CA +:1016200097F887100120FF2901D187F88700B7F8C4 +:101630008E104FF6FF72914200D019B9B7F85910C9 +:10164000A7F88E1097F88D10FF2900D009B987F8F8 +:101650008D0097F88711FF2901D187F8870197F846 +:101660008910FF2901D187F8895097F88A105A23E9 +:10167000FF2900D009B987F88A3097F88B10FF2925 +:1016800000D009B987F88B9097F88C10FF2900D00B +:1016900009B987F88C9097F89210FF2901D187F843 +:1016A000925097F87411FF2900D009B987F8745146 +:1016B000B7F87D11914200D019B940F2DC51A7F87A +:1016C0007D11B7F87F11914200D009B9A7F87F8149 +:1016D000B7F87511914200D019B940F24C41A7F802 +:1016E0007511B7F87711914200D019B940F2B631AF +:1016F000A7F87711B7F879116426914200D009B99B +:10170000A7F8796197F87B11FF2900D011B96921F9 +:1017100087F87B1197F87C11FF2900D009B987F869 +:101720007CB197F88111FF2900D009B987F881B100 +:1017300097F88211FF2900D009B987F8823197F80C +:101740008911FF2900D011B9032187F8891197F871 +:101750009011FF2901D0022901D987F89051B7F8DB +:101760008A11914200D009B9A7F88A6197F88C11C3 +:10177000FF2901D187F88C0197F89711FF2901D033 +:10178000022901D987F89701B7F8A610914201D034 +:10179000A14201D9A7F8A6A0B7F88E11914201D0B5 +:1017A000A14201D9A7F88EA1B7F89811914201D1B1 +:1017B000A7F89881B7F89A11914203D14FF4487174 +:1017C000A7F89A1197F87411FF2901D187F87401CD +:1017D00097F84C00112804D0112087F84C0000F035 +:1017E00055F8BDE8F88F0000FC2A002070B5084CC1 +:1017F00000256078012801D0A57070BDA078411C3B +:10180000A1700528F9D900F041F8A570657070BD88 +:10181000680700200C488168491C81604168491CA8 +:10182000416081684FF47A72B1FBF2F302FB13114D +:10183000012902D1C168491CC1600178002901D188 +:1018400001210170704700006807002070B50E4844 +:101850004FF47A710068B0FBF1F0401EB0F1807F68 +:1018600011D24FF0E024606165170F212846FDF783 +:10187000A1FE0020A061072020612846BDE870403D +:101880000021FDF797BEFEE72C02002010B5FDF702 +:10189000F5FBBDE810404FF417720249024805F00D +:1018A00019B80000902A002000F00108124810B575 +:1018B000016841F0010101604168104A1140416036 +:1018C00001680F4A11400160016821F48021016024 +:1018D000416821F4FE014160016821F0A0510160DE +:1018E0004FF47F0181600021C162FFF70DFA0549C5 +:1018F0004FF00060086010BD001002400000FFF0D3 +:10190000FFFFF6FE08ED00E010B5084C012120466F +:1019100000F004F9002807D0FEF73AF82046BDE8A9 +:101920001040012100F034B810BD00000004004058 +:101930007FB50D46044601210220FEF751FDADF8AA +:1019400004400020ADF80050104CADF80600ADF892 +:1019500002006946204600F0F5F8012211462046B3 +:1019600000F0E8F81D208DF80C0001218DF80D1015 +:1019700003228DF80E208DF80F1003A8FDF7DEFD71 +:101980000121204600F007F87FBD00000004004060 +:10199000C943018270470029018802D041F001014A +:1019A00001E021F001010180704700004B4910B5B2 +:1019B000884202D10121C41486E0B0F1804F09D0E1 +:1019C000474988420DD101210220FEF715FD002173 +:1019D000022064E001210846FEF70EFD00210120EF +:1019E0005DE04049884206D101210420FEF704FD54 +:1019F0000021042053E03C49884206D101210820FF +:101A0000FEF7FAFC0021082049E03849884206D157 +:101A100001211020FEF7F0FC002110203FE03449A6 +:101A2000884206D101212020FEF7E6FC002120207B +:101A300035E03049884202D10121441444E02E4966 +:101A4000884202D10121CC043EE02C49884202D1D7 +:101A500001210C0538E02A49884202D101214C05B8 +:101A600032E02849884206D101214020FEF7C4FC1B +:101A70000021402013E02449884206D10121802022 +:101A8000FEF7BAFC0021802009E0204988420AD1F3 +:101A9000841501212046FEF7AFFC00212046BDE859 +:101AA0001040FEF7A9BC1A49884202D101210C045A +:101AB0000AE01849884202D101214C0404E0164989 +:101AC00088420AD101218C042046FEF7ADFC204655 +:101AD000BDE810400021FEF7A7BC10BD002C01405E +:101AE0000004004000080040000C004000100040CE +:101AF0000014004000340140004C014000500140FF +:101B00000054014000180040001C0040002000402C +:101B100000400140004401400048014002460020CE +:101B2000138A92890B4202EA010202D0002A00D0F5 +:101B300001207047002A828901D00A4300E08A43CD +:101B40008281704730B502881B4C1C4DA0420DD0DD +:101B5000A8420BD0B0F1804F08D0194B984205D065 +:101B6000184B984202D0184B984203D122F07003D0 +:101B70004A881A43154B984206D0154B984203D019 +:101B800022F44073CA881A4302808A8882850A88B0 +:101B90000285A0420AD0A84208D00E4A904205D041 +:101BA0000D4A904202D00D4A904201D1097A018635 +:101BB0000121818230BD0000002C01400034014031 +:101BC0000004004000080040000C004000100040ED +:101BD0000014004000400140004401400048014022 +:101BE0000A480021428D4AB10722C273027B521C6F +:101BF000D2B20273102A00D1017370470177C1730A +:101C0000C17201764174808CFCF79ABFB406002043 +:101C100070B51B4C0125002025756076E07B0128FE +:101C20000AD1607A102807D1FCF766FFE07B012813 +:101C300002D1607A102807D0207908B1E07818B175 +:101C4000A078012806D007E096202086E5760220BD +:101C5000A07001E0607930B1607A20B1E07B0428A7 +:101C600003D1E08B08B900F0EFFAE07A012806D141 +:101C7000E07B062803D1BDE8704000F0E5BA70BDF6 +:101C8000B40600202DE9F041264CA078012847D069 +:101C9000254F3879012802D1E07A012840D0FCF79D +:101CA00079FF20851F483830FCF73AFF1D4E00258C +:101CB0003836307800F0F001A173E584A18CA7F8E4 +:101CC00040103D71A178012700F00F00022901D1D9 +:101CD00000B9A770E07A012801D100F0B5FAA07B25 +:101CE00000281DD13078114A00F00F0CA4F824C050 +:101CF000012006E0E18C335C5354491C401CE18414 +:101D0000C0B26045F6D900F06BF938B1E7742946E6 +:101D10006174A08CBDE8F041FCF712BF0921F7E720 +:101D2000BDE8F081B406002054270020541B002099 +:101D300070B5194D0024A87801281CD001266E75B5 +:101D4000FCF728FF288505F13800FCF7E9FE05F1CE +:101D50003800A9780078022900F00F0001D100B9FD +:101D6000AE70E87A012801D100F06EFA0B486C776A +:101D70006E70067170BD687F401CC0B26877022823 +:101D8000F8D301F02BFC00F035F86C770448AC7008 +:101D9000EC73047070BD0000B406002054270020CE +:101DA0005007002010B5104C207868B104F13800BD +:101DB00041782171807828B17F2800D97F20401C8C +:101DC000C0B200E0012060712079E0706079A071FC +:101DD0000020207200F09AFA207A10B10320E073FC +:101DE00010BD0420FBE70000B40600200048704747 +:101DF000541B002007480021C1738170C172C17556 +:101E000001760175417541768176C176017701745D +:101E100081757047B406002010B5064CA07AFCF717 +:101E2000DFFE04F13800FCF7BBFE4620A085012050 +:101E3000607610BDB406002070B5164C002507284A +:101E4000E08301D8657201E0102060720126A6705F +:101E50002584E07D012805D00C206074FCF790FEFD +:101E6000A57070BD607A10B1102803D004E000F0B6 +:101E7000B5FA01E000F06AFAE671A07AFCF7B0FE6C +:101E800004483830FCF78CFEE6734620A085667661 +:101E900070BD0000B406002010B500F0CFFBBDE817 +:101EA000104000F0D1B900000B49487B28B101284F +:101EB0000FD002280FD100F0A5B9C88CA0F60200FF +:101EC00040428886488D072801D300F0A9B800F069 +:101ED0002BB900F077B97047B406002070B51F4DDC +:101EE000A5F138042978687801F00F0140EA012053 +:101EF000A08440F60201608588420BD90D216174EF +:101F0000FCF71EFE0220207400F040FA002020742E +:101F1000E07370BD0828FCD300F062F8B8B1104B34 +:101F20000220E18C2A5C401C5A54628D491C521ECE +:101F30006285C0B2E1840728F3D901252573A08CFE +:101F4000FCF7DBFDE572BDE8704000F01FBA092127 +:101F50006174A08CBDE87040FCF7F2BDEC06002077 +:101F6000541B002070B50F4D0F4AA5F13804287896 +:101F700000F00F03A384012006E0E18C2E5C565490 +:101F8000491C401CE184C0B29842F6D900F028F800 +:101F900030B100216174A08CBDE87040FCF7D0BD69 +:101FA0000921F7E7EC060020541B00200A480A49E3 +:101FB0004FF000020078A1F1380110F0F0008873B2 +:101FC000CA84CA740549487603D0102803D1FFF7A4 +:101FD00085BFFFF7C7BF7047EC06002054270020DD +:101FE0000E4B002019469A7B098D42B1102A0ED063 +:101FF000202A0FD0302A09D1032907D305E09A8C73 +:10200000002A03D0521C914200D3012070470829B6 +:10201000FCD3FAE75A8D072AF9D2F3E7B406002079 +:10202000F0B51D49DFF874C001268D8E1C4B01F1FF +:102030003807072D1CD2CE8601200CE0CA8C3C5CF0 +:102040009C54521CCA844A8D521E4A85CA8E521C08 +:10205000401CCA86C0B2A842F0D9488D08B98CF895 +:102060001F604E730820C8730E760020C884F0BD30 +:102070000120CA8C3C5C401C9C54521CCA844A8D72 +:10208000C0B2521E4A850728F3D91004000CEED1C5 +:102090008CF81F60F0BD0000B4060020542700201B +:1020A000541B002070B51F4C608E38B3607D002833 +:1020B00036D00025657504F138062577307810F0A4 +:1020C000F000A0731CD010281AD0202828D1FFF7C8 +:1020D00087FFE8B13078217B00F00F00884219D1EA +:1020E0006573FFF7E1FE9620608601202077607B14 +:1020F000002815D1BDE87040FFF772BD03200AE04B +:102100000620607400F050F8BDE87040FFF74EBF45 +:10211000092000E004206074BDE8704000F044B87D +:1021200070BD0000B4060020F0B51C4901231C4D11 +:102130008E8E488D01F13804864214D3C6B2012038 +:1021400009E0CA8C275CAF54521CCA844A8D521EC7 +:10215000401C4A85C0B2B042F3D9488D002801D155 +:102160001048C377F0BDCB8601200CE0CA8C275CF9 +:10217000AF54521CCA844A8D521E4A85CA8E521CC4 +:10218000401CCA86C0B2B042F0D902204873082071 +:10219000C8730B760020C884F0BD0000B406002090 +:1021A000541B00205427002010B5054C0146A08C7C +:1021B000FCF7C6FC0020E073E072207610BD000042 +:1021C000B406002030B50D48017E002914D10C4C16 +:1021D00000F13803C18E07290AD8C28C5D5CA55472 +:1021E000521CC284428D521E4285491CC186F1E7B1 +:1021F000002141730721C17330BD0000B4060020E7 +:10220000541B002070B50E48017E002917D190F8AC +:102210002A3000F138040B4D5B1C09E0C28C665C6F +:10222000AE54521CC284428D521E4285491CC18646 +:10223000C18E9942F2D9002141730721C17370BD4B +:10224000B4060020541B002070B52C4C00222146FF +:10225000E37B0320497D092B1CD2DFE803F0050C4A +:1022600010141C202A383C00002913D06275BDE8E8 +:102270007040FFF79BBEBDE8704000F073BABDE848 +:10228000704000F035BA00F041F8207A002801D102 +:102290000420E07370BDBDE8704000F0F1B9A17991 +:1022A000491EC9B2A1710129F4D8E0736079A07107 +:1022B00070BD217D012039B12275A2760721E1731D +:1022C00096216186207770BDE18D49B170BDBDE872 +:1022D0007040FFF7E7BE638E13B131B162750B201A +:1022E0006074BDE87040FFF75FBFFFF7DDFD607B06 +:1022F0000028EBD1BDE87040FFF772BCB4060020A7 +:1023000001490120C8757047B40600200E49087ABB +:1023100028B1012815D0022815D100F03BB90A4A8E +:10232000C879383240F020001070088CA0F6020006 +:1023300040428886C88B072801D300F075B800F0AA +:10234000B3B800F0FFB87047B406002030B50D4AAE +:102350000D4C02F13803D08BC0F3032141F0100182 +:10236000197058700220118C655C1D54491C118431 +:10237000D18B401C491EC0B2D1830728F3D9082055 +:10238000907230BDB4060020541B002010B5124CD2 +:10239000002104F13802207C40F0300010705170B0 +:1023A000917061840320A0721154401CC0B20728B0 +:1023B000FAD90820A0720020FCF718FCA07AFCF7DC +:1023C0000FFC05483830FCF7EBFB0620E073462095 +:1023D000E0850120A07610BDB4060020F0B5104CB9 +:1023E000012004F13805E38B2B7001460D4E08E007 +:1023F000228C401CC0B2B75C6F54521C491C228412 +:10240000C9B29942F4D95B1CA372072807D80021EE +:102410002954401CC0B20728FAD90820A072F0BD88 +:10242000B4060020541B00202DE9F0411C4C1D4B2C +:1024300004F13805A28E072A1AD20126E686304614 +:102440000CE0218C5F5C2F54491C2184E18B491ED8 +:10245000E183E18E491C401CE186C0B29042F0D974 +:1024600026720025E575FCF7C9FB2584BDE8F081DF +:102470000120218C5A5C2A54491C2184E18B401C88 +:10248000491EC0B2E1830728F3D90820A072FFF7E4 +:10249000C3FC0420E073BDE8F04100F0BDB80000CB +:1024A000B4060020541B00202DE9F041234C0025E8 +:1024B000DFF88CC0A28EE18B04F138068A424FF01F +:1024C000010020D3CBB201210CE0228C401CC0B211 +:1024D0001CF802707754521C2284E28B521E491C55 +:1024E000E283C9B29942F0D9A37202E03554401C8C +:1024F000C0B20728FAD90820A072FFF78DFC04208B +:10250000E073BDE8F081E08601200DE0218C1CF82D +:1025100001303354491C2184E18B491EE183E18E53 +:10252000491C401CE186C0B29042EFD902202072C3 +:10253000E575FCF763FB2584E3E70000B4060020A3 +:10254000541B002070B5114CE07D01281CD1104BAC +:1025500004F13802E08E07280AD8218C5D5C1554FE +:10256000491C2184E18B491EE183401CE086F1E790 +:102570000820A072FFF750FC002020720420E073B6 +:10258000BDE8704000F048B870BD0000B4060020FF +:10259000541B00202DE9F041174CE07D012829D182 +:1025A00094F83610A27FC8B21144CEB2A6724FF092 +:1025B000000C04F13803114F0BE0228C401CC0B218 +:1025C000BD5C5D54521C2284E28B521EE283491C86 +:1025D000E186E18EB142F0D36546072803D81D5449 +:1025E000401CC0B2F9E70820A072FFF715FC257265 +:1025F0000420E073BDE8F081B4060020541B0020E5 +:1026000010B5FCF7BDFA03480021C1738170C17594 +:10261000017510BDB40600200749C879401CC0B23E +:10262000C871102801D10020C8710879002802D093 +:10263000C878401EC8707047B40600200F49487E15 +:10264000012803D1888D08B1401E8885887E012825 +:1026500003D1C88D08B1401EC885C87E012803D1AA +:10266000088E08B1401E0886087F012804D1488ED4 +:10267000002801D0401E488670470000B4060020A4 +:1026800070B51A4D0126A88DD0B1287DA97D0843CB +:1026900026D000246C762C75E88B98B1287908B187 +:1026A000E878A8B16979B1B1012914D002291AD00A +:1026B00016D9A879A0F10100A8714FF0050013E028 +:1026C000304600E020466874BDE87040FFF798BFD0 +:1026D0002C70022008E0FFF719FE287A08B1AE75C9 +:1026E00070BDAC7570BD0320E87370BDB4060020EA +:1026F00070B51B4D288EB0B1687D00282FD0002208 +:1027000005F138006A75007800F0F001A9733029EE +:1027100025D1EA7600F00F04FFF762FC28B1032C04 +:1027200005D305200EE002200CE009200AE0022C6F +:1027300007D0012C0BD0002C11D1BDE87040FFF761 +:1027400031BB08206874BDE87040FFF759BF07200F +:102750006874FFF755FF952028860120E87670BD44 +:10276000B40600200A4A0123908D68B1107D00282C +:1027700009D0002010755076517A31B1102902D15C +:1027800013700220D073704718465074FFF738BF9B +:10279000B406002001490020087070471805002089 +:1027A000014901200870704718050020094A29B125 +:1027B00092680068904204D8101A04E091680160A1 +:1027C00003E0C0431044884201D301207047002039 +:1027D000704700006807002010B5094C49B1A26895 +:1027E0000368934201D8D21A01E0DB431A448A42BB +:1027F00003D3A1680160012010BD002010BD0000BE +:102800006807002030B52C4C2078012852D12B4A83 +:102810000121D068401CD060117000232370052472 +:10282000B0FBF4F504FB1504002C43D1002841D083 +:102830000A24B0FBF4F504FB1504517004B991703F +:102840001424B0FBF4F504FB150404B9D170322450 +:10285000B0FBF4F504FB150404B911716424B0FB5A +:10286000F4F504FB150404B951714FF4FA74B0FB8C +:10287000F4F504FB150404B991714FF47A74B0FBBC +:10288000F4F504FB150404B9D17140F2DC54B0FB3B +:10289000F4F504FB150404B911724FF4FA64B0FBAB +:1028A000F4F504FB150404B9517241F270718842C9 +:1028B00000D3D36030BD000068070020802A0020CC +:1028C0000FB5124801880A2901D30021018002882E +:1028D000009900EB0212516002889DF8041000EB91 +:1028E0000212117202889DF80D1000EB0212517451 +:1028F0000188DDF8052000EB011141F8092FDDF812 +:1029000009204A600188491C01800FBD582300201E +:1029100070B51048006800281BD1F9F7FFF80028AF +:1029200017D00D4C21886088814212D000250A28DA +:1029300000D36580608804EB0010001D0FC801F013 +:1029400068F906480121817080F828506088401C91 +:10295000608070BDB006002058230020542700205E +:1029600010B5044C0146204601F0F4F8208800061A +:10297000FCD510BD004C00402DE9F041384E40F22E +:1029800025573946304601F054F8364C002590B1B1 +:10299000304601F0DBF8C1B2208BC82804D2324A9D +:1029A0001154401C208300E025830A292FD039468A +:1029B000304600F0ECFF40F224473946304601F043 +:1029C00038F838B12583304601F0C0F83946304632 +:1029D00000F0DDFF40F227742146304601F029F86F +:1029E00018B12146304600F0D2FF40F2266421465D +:1029F000304601F01EF818B12146304600F0C7FFFE +:102A00000821304601F00EF8012805D00BE0FEF752 +:102A100053FA2583BDE8F0810821304600F0B4FF69 +:102A2000304601F093F80421304600F0FBFF012806 +:102A300006D10421304600F0A7FF304601F086F8A9 +:102A40000221304600F0EEFF0128E3D1022130469A +:102A500000F09AFF3046BDE8F04101F077B8000081 +:102A6000004C00407C070020E232002070B5314C61 +:102A700040F225563146204600F0DBFF2E4D98B13E +:102A8000204601F063F8AA8B0021C0B2C82A04D204 +:102A90002A4B9854521CAA8300E0A9836983E970E9 +:102AA0003146204600F073FF40F22446314620466E +:102AB00000F0BFFF40B1204601F048F80120E87067 +:102AC0003146204600F063FF40F226652946204645 +:102AD00000F0AFFF18B12946204600F058FF08214A +:102AE000204600F09FFF012806D10821204600F073 +:102AF0004BFF204601F02AF80421204600F092FF07 +:102B0000012806D10421204600F03EFF204601F0B6 +:102B10001DF80221204600F085FF012808D102217E +:102B2000204600F031FF2046BDE8704001F00EB8AD +:102B300070BD0000005000407C070020AA33002038 +:102B400010B5094CA07E00280DD0607F10280AD156 +:102B5000207F00F047FA0020A076BDE81040FF215A +:102B60000248F5F72ABB10BD54270020541B002053 +:102B700010B5074CA07E002808D0607F112805D131 +:102B800004F1290000F0B0FA0020A07610BD00008A +:102B90005427002010B50A4CA07E00280FD0607F7B +:102BA00014280CD1032104F1290000F0EFFA0020D1 +:102BB000A076BDE81040FF210248F5F7FEBA10BD2F +:102BC00054270020541B002010B5064CA07E00287E +:102BD00006D0607F192803D100F0F8F80020A07615 +:102BE00010BD00005427002010B5064CA07E002820 +:102BF00006D0607F222803D100F058F90020A0768B +:102C000010BD00005427002070B50F4DA87E00288D +:102C10000ED0687F27280BD195F8290000240B4A95 +:102C200005F12901042804D0032000F0F1FAAC7664 +:102C300070BD042000F0ECFA0448AC76801FEC77FD +:102C400040F8064F446070BD54270020160700204E +:102C500010B50A4CA07E00280FD0607F28280CD128 +:102C6000022104F1290000F0BBFB0020A076BDE8A2 +:102C70001040FF210248F5F7A0BA10BD54270020EC +:102C8000541B002010B5094CA07E00280CD0607F9A +:102C90002E2809D106480088401E81B2054800F060 +:102CA00035F90020E077A07610BD00005427002001 +:102CB000DA060020551B002010B50A4CA07E002823 +:102CC0000FD0607F31280CD1032104F1290000F0DE +:102CD000F9FB0020A076BDE81040FF210248F5F77F +:102CE0006CBA10BD54270020541B002010B5074CAF +:102CF000A07E002808D0607F3E2805D104F129007D +:102D000000F03CF90020A07610BD00005427002000 +:102D100010B50A4CA07E00280FD0607F85280CD10A +:102D2000012104F1290000F003FC0020A076BDE899 +:102D30001040FF210248F5F740BA10BD542700208B +:102D4000541B0020044A81781170C078491C11700E +:102D5000801C507070470000160700200649087854 +:102D6000012808D148780C2803D20C3151F82000F2 +:102D70000047002008707047140700200249012016 +:102D8000087000F02BBC000014070020024900204E +:102D9000087000F023BC00001407002070470000FA +:102DA00009480021012280F82710C17080F8261000 +:102DB000C27680F820108171C18780F8221080F8D7 +:102DC000231080F8251070475427002070B5344830 +:102DD0004178012963D9334C217901295FD1192127 +:102DE000017000214170E07E01220221F9F760F9B3 +:102DF000E8B3B4F84000022846D394F8290004F15F +:102E0000290600F07F05A81E092815D2DFE800F08A +:102E1000053019141914141430002846F9F76EF906 +:102E200050B1B4F8400003212AE0324629461E483A +:102E3000FBF702FBB8B929E02079122101282BD138 +:102E400027E02846F9F75AF90028F5D0B4F84000F1 +:102E50000621F9F70DFAB8B1324629461248FBF7B8 +:102E6000EBFA032812D91049FBF7E6FE14E00FE055 +:102E70002846F9F743F90028DED0B4F840000221D3 +:102E8000F9F7F6F90028D0D1132102E0312100E052 +:102E90007F211920FBF7B4FE0A20A4F8440070BD7E +:102EA0006207002054270020A8290020144810B5EC +:102EB0004078012823D9134C207901281FD1B4F878 +:102EC0004000032814D3C10712D0032810D80E489D +:102ED000FBF714FB032803D30B49FBF7ADFE0BE014 +:102EE000B4F84C00A0F5E061853905D1312100E04E +:102EF00013212220FBF784FE1E20A4F8440010BDFD +:102F00006207002054270020A829002070B505463C +:102F100017480E464078012828D9164C20790128F8 +:102F200024D1E07E00220321F9F7C2F8B8B1032EC4 +:102F300001D2132114E0B61EB1B22846FDF7D6FD2A +:102F400008B101460CE00C486E21017029784170EF +:102F50006978817001460320FBF76EFE03E07F2154 +:102F60002E20FBF74DFE2820A4F8440070BD000081 +:102F70006207002054270020A829002070B50546CC +:102F800015484078012826D9144C0221B4F8400095 +:102F9000F9F76EF9C0B1287810F07F0F03D02079CF +:102FA00001280DD014E0F9F75DF988B10C487E21B5 +:102FB00001702978417001460220FBF73DFE07E0D1 +:102FC00000202071122100E013213E20FBF718FEA3 +:102FD0000A20A4F8440070BD620700205427002096 +:102FE000A82900202DE9F04707463C4841780129EF +:102FF00071D9102101703A4D002680464670B5F80F +:1030000040000221F9F734F988B307F07F04012C5E +:1030100007D0022C05D0032C03D0287901284ED0EC +:1030200054E0E87E4FF00109032804D0012814D0B1 +:10303000022817D013E0022C11D1F9F71FF950B173 +:10304000EC76FDF7C9FE85F80C90C82085F8009055 +:10305000A877782137E0222135E0022C08D0032C14 +:1030600008D001E0032C03D0012C05D006E029E0B4 +:103070007E2128E0EE7301E0FBF7FEFFEC76EE87A1 +:1030800085F82060AE71032C05D085F8226085F8A4 +:10309000236085F825603846F9F7E4F8B0B11148A7 +:1030A00050210170477086703221C17080F8049001 +:1030B000F421417106200B49FBF7BEFD06E02E719D +:1030C000122100E013211020FBF79AFD0A21A8F835 +:1030D0000410A5F84410BDE8F08700006207002046 +:1030E00054270020A82900202DE9F0410446234858 +:1030F0004178012940D9112101700026204D4670E8 +:103100001E2181802879012836D1B5F8400002219E +:10311000F9F7AEF848B3207800F07F00F8F7E6FF43 +:10312000E8B1F9F7ABF8C0B12078F9F79BF8154F83 +:1031300038B1512038702078787039460220FBF77A +:103140007BFD11480179012902D106713E707E7024 +:1031500001202870C820A8770BE0222106E02879FA +:10316000012806D12E71122100E013211120FBF756 +:1031700047FD0A20A5F84400BDE8F0816207002061 +:1031800054270020A82900202027002070B51D49C1 +:103190004A78012A35D914220A701E228A800178C1 +:1031A0004278090401EB02218078174C0D180122A6 +:1031B000E07E0221F8F77CFFE0B1B4F84000042182 +:1031C000F9F756F8A0B16FF07F40854208D1F9F7C2 +:1031D000C9F80E49542008700120FBF72DFD0DE0C1 +:1031E000B4F84C00A0F5E061853907D1312102E047 +:1031F000132100E07F211420FBF702FD0A20A4F830 +:10320000440070BD6207002054270020A829002038 +:103210002DE9F05FDFF8B4810024164698F801002C +:103220000D4601287ED96A4F387901287AD10122CA +:10323000F87E1146F8F73CFF002874D028784FF04C +:10324000010AA8F10209A346032806D00428B7F80A +:10325000400037D0022833D3B4E089F800B05E468E +:10326000B7F840000221F9F703F848B3F8780128CD +:103270000BD0584C4FF0670B84F800B02878607082 +:103280005548FBF7CFF810B195E037248FE097F859 +:103290002000012802D1B87901280FD04E480088BB +:1032A000608089F800A087F806A088F800B088F848 +:1032B000016048490420FBF7BFFC7CE06680F0E732 +:1032C000132474E00421F8F7D3FF0028F8D097F80E +:1032D0002600032807D899F8001011B1012908D059 +:1032E00009E0032800D3362499F80000A0BB242469 +:1032F0005DE089F800B03748D9460222C0F800B036 +:103300003549F4F77EFF40B333484178007801EB4C +:10331000002080B2FBF75DF869783170A978717090 +:10332000E97801E04CE04FE0B1702979F1702B4968 +:10333000020A0A70487002223046F4F762FF68B150 +:1033400097F82600FF2802D2401C87F82600C0B25A +:1033500002281ED8352426E028E023E01D4887F8FF +:103360002690672202702B784370287849460428FB +:103370000DD0022087F8210088F8002088F801107D +:1033800087F820A013490220FBF756FC0BE0012030 +:10339000F0E7032807D136243C2087F8270087F878 +:1033A00003A000E024240C48C0F800901CB1214682 +:1033B0002720FBF725FC1E20A8F80400A7F84400EE +:1033C000BDE8F09F1224F2E77F24F0E762070020B7 +:1033D00054270020A8290020AC060020AE060020BB +:1033E0002DE9F041344E044668203070334841786E +:1033F00001295ED9282101701E21314D81800122D1 +:10340000E87E1146F8F754FE40F28577E0B3B5F850 +:1034100040000321F8F72CFFB8B3F8F72FFFA8B34B +:1034200020784FF0000210F07F01607805D003296A +:1034300003D0287901282AD038E0012807D00328B2 +:1034400005D0B5F84C00B84230D131212BE011B194 +:10345000032907D00DE0012885F8222009D085F83E +:10346000232006E00121012885F8221001D085F8EB +:1034700023102078F8F7F6FEC0B1207870700E495E +:103480000220FBF7D9FB11E008E005E002E02A7119 +:10349000122108E0222106E0132104E0B5F84C00D7 +:1034A000B84203D17F212820FBF7AAFB0A20A5F808 +:1034B0004400BDE8F0810000A82900206207002038 +:1034C00054270020F8B506460020ADF80000154846 +:1034D0000D464178012923D931210170124C1E215A +:1034E0008180207901281BD10122E07E1146F8F766 +:1034F000DFFD40B16B460D4A29463046FDF7C4FB5F +:10350000010001D104E07F213120FBF779FB04E0C9 +:103510000649BDF80000FBF78FFB0A20A4F8440021 +:10352000F8BD00006207002054270020A8290020D1 +:1035300070B5044626484178012948D98521017093 +:103540001E21244D81800122E87E1146F8F7B0FD4E +:1035500078B3B5F840000221F8F78AFE38B3F8F7DF +:103560008DFE58B12078002100F07F00012807D09F +:10357000022808D02879012816D025E0222120E051 +:1035800085F8251002E0012085F825002078F8F75D +:1035900069FEC8B11048C52101702178417001460B +:1035A0000220FBF749FB0FE02971122109E01321EA +:1035B00007E0FFE7B5F84C00A0F5E061853903D1DD +:1035C0007F218520FBF71CFB0A20A5F8440070BD75 +:1035D0006207002054270020A82900200448002169 +:1035E00002220170427001228270818070470000C7 +:1035F0006207002010B5084CA07E00280BD0607F29 +:1036000000F00EF80020A0766077BDE81040FF21A2 +:103610000248F4F7D2BD10BD54270020541B0020EF +:10362000084910B5497801290BD9074C217901299E +:1036300004D1002121711121FBF7E2FA0A20A4F83C +:10364000440010BD62070020542700202DE9F041FE +:103650001446054669B1092927D133480178002964 +:1036600023D000210170BDE8F041FF212F48F4F77D +:10367000A4BD2F4902264878012806D0022814D17B +:1036800020782C4F102823D025E00D46097820788B +:1036900001F1400282420AD12046272904D1417813 +:1036A000012901D1FFF74EFB6E70BDE8F0817F2844 +:1036B000FBD160788142F8D1A078782804D0FFF758 +:1036C00065FB03206870F0E71E20A8800420F9E75E +:1036D0004E70607838772178174A184B7977002038 +:1036E000165C8E4208D1342901D0362902D1144902 +:1036F000098829B9587003E0401CC0B20C28EFD3E8 +:103700000C2801D10B2058700A4814212930064694 +:10371000F4F753FD1422611C3046F4F735FD012007 +:10372000B876A7F84050C0E7B5060020541B00202B +:10373000620700205427002024BB01081407002042 +:10374000DE06002001490120487070476207002012 +:1037500070B5154C40F22551204600F06AF900285A +:103760000ED0204600F0F2F9104AC1B2108A0304CC +:1037700006D444044FF0000306D50A2901D0138271 +:1037800070BD40F400400DE00D2909D0C0F30D04D8 +:10379000074D401C80B229551082C728EFD870BD54 +:1037A00040F48040108270BD003801407C0700204A +:1037B0005430002010B5044C0146204600F0CAF9F0 +:1037C00020880006FCD510BD0044004070B5304C88 +:1037D00040F225563146204600F02BF92D4D88B198 +:1037E000204600F0B3F96A8AC0B2FE2A04D22A4900 +:1037F0008854521C6A8201E00020688231462046CB +:1038000000F0C5F840F224463146204600F011F998 +:1038100040B1204600F09AF90120687031462046F8 +:1038200000F0B5F840F226652946204600F001F97F +:1038300018B12946204600F0AAF80821204600F0D9 +:10384000F1F8012806D10821204600F09DF8204615 +:1038500000F07CF90421204600F0E4F8012806D1AC +:103860000421204600F090F8204600F06FF9022174 +:10387000204600F0D7F8012808D10221204600F0A8 +:1038800083F82046BDE8704000F060B970BD0000CC +:10389000004400407C0700201C31002070B5314CF2 +:1038A00040F225563146204600F0C3F82E4D98B11F +:1038B000204600F04BF9EA8A0021C0B2C82A04D29F +:1038C0002A4B9854521CEA8200E0E982A982A9702E +:1038D0003146204600F05BF840F22446314620464F +:1038E00000F0A7F840B1204600F030F90120A870A0 +:1038F0003146204600F04BF840F226652946204626 +:1039000000F097F818B12946204600F040F8082149 +:10391000204600F087F8012806D10821204600F053 +:1039200033F8204600F012F90421204600F07AF81E +:10393000012806D10421204600F026F8204600F098 +:1039400005F90221204600F06DF8012808D1022176 +:10395000204600F019F82046BDE8704000F0F6B8A7 +:1039600070BD0000004800407C0700201A32002093 +:1039700010B5044C0146204600F0ECF82088000603 +:10398000FCD510BD00500040C943018070470A0AB1 +:1039900001219140C943018070470029818902D0EB +:1039A00041F4005101E021F4005181817047000091 +:1039B000174910B588420AD101218C032046FCF733 +:1039C00033FD2046BDE810400021FCF72DBD114914 +:1039D000884202D101214C0410E00F49884202D1F3 +:1039E00001218C040AE00D49884202D10121CC0456 +:1039F00004E00B4988420AD101210C052046FCF75E +:103A0000FBFC2046BDE810400021FCF7F5BC10BDD2 +:103A1000003801400044004000480040004C004095 +:103A2000005000400246002012880A4200D00120C7 +:103A3000704770B501F01F0501260024C1F3421341 +:103A400006FA05F2012B0FD0022B0FD0838A4FEA22 +:103A500011210088134206FA01F600EA060001D09F +:103A600000B10124204670BD8389F0E7038AEEE7A8 +:103A700010B5C1F3421301F01F040121A140012B35 +:103A800007D0022B07D01430002A026805D00A4361 +:103A900004E00C30F8E71030F6E78A43026010BD0E +:103AA00030B50446008A85B00D464CF6FF710840DB +:103AB000E98801432182A0894EF6F3110840A988C4 +:103AC0002A8911436A8902431143A181A08A4FF6D2 +:103AD000FF410840A9890143A1826846FCF7B6FC72 +:103AE0001948844201D1039800E00298A189090491 +:103AF00000EBC00101EB0010296801D5490000E08E +:103B00008900B0FBF1F06422B0FBF2F109010B096E +:103B10006FF018056B4300EB8300A3891D044FF081 +:103B2000320306D503EBC000B0FBF2F000F0070053 +:103B300005E003EB0010B0FBF2F000F00F000843CB +:103B4000208105B030BD0000003801408088C0F3FE +:103B500008007047C1F308018180704700F008B980 +:103B600000F08AB904480088034A0449121F1288E9 +:103B700042EA004088607047BC6C0040F4060020B8 +:103B800004F095BD04F0CCBD0A494FF0E02248682E +:103B900018B99069084B58434860926943F28563AD +:103BA00002441844486091B200EB800041EA0040B2 +:103BB00070470000F40600200DE37A05704700000E +:103BC000034900200978C90700D001207047000090 +:103BD0009E060020034900200978890700D50120AE +:103BE000704700009E0600200FB41FB50DF12301A1 +:103BF000069800909DF822208DF804200DF1050014 +:103C0000F4F7C2FA9DE80F0000F084F91FBC5DF8DC +:103C100014FB0FB585B000208DF808009DF8182022 +:103C200005998DF80A2000918DF809000DF1190110 +:103C30000DF10B00F4F7A8FA684603F06BF909B030 +:103C400000BD0000074810B50178002909D1012105 +:103C50000170FBF7C9FCF9F705FABDE81040F9F768 +:103C600015BB10BDF406002070B5FAF77FFC2B4D94 +:103C700001462B482A78F4F787FA2948697A883070 +:103C8000F4F79BFA2648297A7A30F4F796FA244812 +:103C9000A9795930F4F791FA22482A7881682048A6 +:103CA000F4F772FA1E4C012604F1250084F8226014 +:103CB000AA781DA18B34F4F767FA2A791EA1A4F122 +:103CC0004500F4F761FAEA791CA1A4F11F00F4F7AA +:103CD0005BFAEA781DA1A4F15700F4F755FA6A7966 +:103CE0001FA1A4F14000F4F74FFAE6705E202071A6 +:103CF0000020E071C8212172E07282212173E073FB +:103D00003C2020747820E0742820A0757D20607607 +:103D1000872020778C20E07770BD0000A2BA0108D0 +:103D20004C170020F4060020383037303030383857 +:103D300034414120200000004A374B0030312E3002 +:103D4000302E3031202020200000000030312E3075 +:103D5000302E3033202020202020202000000000A2 +:103D600031323334353637383930313200000000E3 +:103D700070B5F8F791FA3A4C217860F300013948B0 +:103D800021700078022803D241F00200207006E082 +:103D900021F00200207002D940F0040001E000F0A0 +:103DA000FB002070304A21784FF0000312F82B0FEF +:103DB00063F3041163F34511927821F0400162F33B +:103DC000C7112170617863F3000121F0020160F3F3 +:103DD000820163F3C30163F304116170A07820F0E2 +:103DE0000500A0704FF0010002F014FF1F4DE070BD +:103DF00095F8B900C0F341102071D5F8B500010F56 +:103E00006171010DA171000BE07195F8C60020727F +:103E100095F8C500607295F8C400A07295F8C300CB +:103E2000E07295F8C200207395F8C1006073B5F890 +:103E3000C900A935010AA173E0730D480D49406915 +:103E4000F4F74DFAF4F7ABFC207435F8A10C05211A +:103E5000B0FBF1F2B0FBF1F0120A6274A07470BD15 +:103E6000F9170020E60400203E2A0020FC0D002067 +:103E7000E8160020000020412DE9F041214C0127E7 +:103E8000207820B9FFF7F0FEFEF78AFF27701E4D5D +:103E90000026287890B1A87F18B1401EA877BDE809 +:103EA000F0812E70BFF34F8F18490868184A00F44C +:103EB000E06010430860BFF34F8FFEE76088401C4E +:103EC00080B26080022807D36680FEF757FFEF714B +:103ED0006E7600F055F8E680A088401C0004000CC7 +:103EE000A08004D0A680FEF739FFFAF747FEFEF760 +:103EF0000FFDFAF71BFDF8F79BF8BDE8F041FEF760 +:103F00004DBF000008070020542700200CED00E002 +:103F10000400FA050FB40098A0F5E061DF3907D07E +:103F2000A0F5E061853903D080B204B000F04CB850 +:103F300012480188322901D30021018002880099AA +:103F400000EB0212516002889DF8041000EB02128F +:103F5000117202889DF80D1000EB02125174018855 +:103F6000DDF8052000EB011141F8092FDDF80920EB +:103F70004A600188491C018004B07047FC2300207E +:103F80002DE9F0410D4C00260D4F0E4D10E032286A +:103F900000D366806088387004EB0010001D0FC8E5 +:103FA000FBF7A6FB6088401C60802868401C2860E6 +:103FB000218860888142EAD1BDE8F081FC2300209D +:103FC000000700200407002008490978C9070CD021 +:103FD000B0F58E6F09D10548801D016821F40031CC +:103FE000016002490020891F088170479E06002059 +:103FF0002DE9FE4F14460D460746FBF73FF8DFF864 +:1040000094C2A54E002F59D0012F7DD16046C07AB1 +:10401000002879D12878D5F8011040EA0120706194 +:10402000F5F7F0FFFBF72AF822469CA0716900F033 +:10403000B1FBD6E90501814267D0B061F169A4F115 +:104040000D0B01EB0B03C3F30A02D90A99A0F3612C +:1040500000F0A0FBFAF728F8318CF069DFF88492C1 +:10406000B1EBD02F0BD0C10A4844C70A3184FF02FC +:1040700039469DA000F08EFB3846F9F799FF4FEACC +:10408000EB710BEB9170C0F387082F1DA007B0F107 +:10409000804F0CD09BA000F07DFB28190322FF214C +:1040A0000938F4F783F808F1010000F0FF087A48B6 +:1040B0000024426AC1699144416271E02C793470F4 +:1040C0006A797270D5F806004FF6FF7800BA20F0D2 +:1040D000FF03687A0343736068893081297BD5F8D0 +:1040E0000D7041EA0721F1602D8A35824FF0FF37CC +:1040F000B7610027F7617762A6F820808CF80B7013 +:104100008DE82300214601E042E0BFE083A000F0FB +:1041100041FB3089328AF1688DE807007278317886 +:104120008D48736800F036FBBDE8FE4FF5F79CBF85 +:10413000002657F824104846F9F78EFF042808D0C7 +:10414000761CF6B2032EF4D3494684A000F022FB7D +:104150001BE0D9F800A01CB1A8F10100844206DBE5 +:1041600057F824205346494685A000F013FB57F822 +:10417000241051450ED08AA000F00CFB57F82420E3 +:10418000534649467EA000F005FB42490120C87213 +:10419000BDE8FE8F09F10409032E03D2641CE4B2CA +:1041A0004445C5D3FAF76AFF3A4E1FFA8BF1281D32 +:1041B000728CF6F739FA384D70840246298981A04D +:1041C00000F0E8FAFAF75AFFE968686988425BD1BB +:1041D0002889728C904204D0BDE8FE4F82A000F086 +:1041E000D9BA0024A8468AA000F0D4FA914D2846F6 +:1041F000F9F7DEFE904F28463946F9F72DFF0428DF +:1042000007D0641CE4B2032CF5D329468BA000F040 +:10421000C1FA2C68294623463A4659A000F0BAFA5A +:10422000BC421BD1834F002445463F1D3846696878 +:10423000F9F712FF042807D0641CE4B2032CF5D36D +:10424000394687A000F0A6FA3C68394623468EA07E +:104250006A6800F09FFA6868A04202D00120F072FC +:1042600096E7FAF70BFFF5F7CDFE90A000F092FA73 +:10427000BFF34F8F98490868984A00F4E0601043F4 +:104280000860BFF34F8FFEE7F9F7C4FEBDE8FE4FAD +:10429000FAF7F4BE7C0700202C3000200A0D43758D +:1042A0007272204261673A25642C206C656E20256D +:1042B000640A0D0057726974652D616464723A2056 +:1042C000736563746F722025642C2C6F666673654A +:1042D00074202564202C7265636C656E2025306423 +:1042E0000D0A0000006002083434437572722045E4 +:1042F000726173652D2D616464723A202530780DEA +:104300000A0000000A0D6C6173742D2D2D2D2D6295 +:104310006167212121212121210A0D000D0A363654 +:10432000365570642D2D747970653A2564202C768D +:1043300065723A25642C54627974653A25642C20A0 +:104340004372633A25642C5061673A25642C506CA3 +:10435000656E3A25640D0A00D4C501082132322168 +:10436000212121212121212157726974652D466166 +:10437000696C2D616464723A202530780D0A000062 +:1043800061646472202530782C2C57726974652022 +:104390002530782C2C72656164202530780D0A0058 +:1043A0000A0D207265616476616C20213D20557094 +:1043B00064646174615B695D2921212121210A0DF9 +:1043C00000000000313232557064486561642E4649 +:1043D000696C654372633D2530782C544372633DAC +:1043E0002530780D0A000000557064486561642E20 +:1043F00046696C6543726320213D205443726320FB +:104400002121212072657475726E210D0A00000051 +:104410002121217570642D696E666F2121205772EC +:104420006974652D746F74706167202564200D0AAE +:104430000000000000580208443322115570644403 +:10444000617461466C6167212057726974652D46FD +:1044500061696C2D616464723A202530780D0A0020 +:104460002121217570642D696E666F21212057729C +:104470006974652D4661696C2D616464723A20250A +:1044800030780D0A0000000031616464722025302C +:10449000782C2C5772697465202530782C2C726525 +:1044A0006164202530780D0A0000000032327570FA +:1044B000642D616C6C207772697465204F4F4B4B93 +:1044C00021217265737461727421212121212121BE +:1044D000212121210D0A00000CED00E00400FA0565 +:1044E00030B50D46094CC1B041F20D01A4F80510DC +:1044F00001462A46E01DF3F747FE658040AA69465B +:104500002046F8F787FE41B030BD0000723400202D +:1045100010B598B0142112A8F3F74FFE5A208DF869 +:10452000000001208DF8010088208DF80200184C51 +:1045300002208DF80300B4F80100010A8DF8041080 +:104540008DF8050006216846F7F7A2FA9DF80320CA +:10455000ADF84400694612A8121DF3F715FEBDF828 +:1045600044009DF8031013AA030A8B54521C88546C +:10457000B4F8190042F21072904202D2401CA4F822 +:10458000190012A8891DFCF723F818B010BD00000F +:1045900000170020FEE700002DE9F041204C002725 +:1045A000A078B0B1012824D1A7701E496069F3F743 +:1045B00096FEF4F740F91C4A1C4BF3F70CFFF4F796 +:1045C00065F91B49B0F1834F48611A4925DA0C207F +:1045D00024E01348E578C668142D0CD214480C3832 +:1045E000C088F4F7A0F83146F3F721FE6D1CE060B7 +:1045F000E570BDE8F08110493046F3F7A2FE6FF098 +:104600000B01F3F7DCFE0D49F3F769FEC4E9047012 +:10461000E760E7700120A070EBE718200870E8E77A +:10462000F4040020000030419A9999999999D93F52 +:10463000E81600203E2A00200000A04133335340FA +:10464000F0B593B00F4606460024254634221D4996 +:104650006846F3F799FD14221BA10DA8F3F794FD0A +:104660006A46315DA1F16100192801D8203906E0C0 +:10467000A1F14100192803D9303909291FD8C9B23D +:10468000A1F1410019280AD8002012F810308B42FD +:1046900002D102EB40014978401C1A28F5D30DA83D +:1046A000005D641C01FB0055112CDAD30B20B5FB17 +:1046B000F0F100FB11503870012013B0F0BD4FF045 +:1046C000FF30FAE748B20108080706050403020AAA +:1046D000000908070605040302000000074900203E +:1046E000086007490878401CC0B208701E2803D82B +:1046F00002497F200839086070470000082C0040FC +:104700005402002043E0322100BF00BF00BF00BFC1 +:1047100000BF00BF00BF00BF00BF00BF00BF00BFA1 +:1047200000BF00BF00BF00BF00BF00BF00BF00BF91 +:1047300000BF00BF00BF00BF00BF00BF00BF00BF81 +:1047400000BF00BF00BF00BF00BF00BF00BF00BF71 +:1047500000BF00BF00BF00BF00BF00BF00BF00BF61 +:1047600000BF00BF00BF00BF00BF00BF00BF00BF51 +:1047700000BF00BF00BF00BF00BF00BF00BF00BF41 +:1047800000BF491E11F0FF01BED1401EC0B200287B +:10479000B9D170470FB4054B10B503A9044A02986C +:1047A00000F0EEF810BC5DF814FB0000058801086D +:1047B000100B00200FB4084B10B504A902AA0398EF +:1047C00000F0DEF8044602A9002000F070FC20464C +:1047D00010BC5DF814FB0000AF50010802E008C8EF +:1047E000121F08C1002AFAD170477047002001E06B +:1047F00001C1121F002AFBD1704700002DE9FF5FA5 +:1048000082B00021DDE90430020DDDF840B0034341 +:1048100018D044F61050A2F2FF32424315141198FA +:1048200001281FD0A5EB0B00401C5FEA000A4FF0E7 +:1048300000064E4FDFF83891B046504615D5CAF104 +:10484000000413E0119801244AA3012801D16FEA62 +:104850000B010298119AC0E90031C0E9024206B08A +:10486000BDE8F09FCBF10000DFE704460021404A9D +:10487000491842EB0450CDE9001012E0E00707D0E0 +:1048800032463B4640464946F3F74CFE8046894651 +:1048900032463B4610461946F3F744FE06460F469D +:1048A0006410002CEAD1DDE90401DDE90023BAF14E +:1048B000000F06DAF3F736FE42464B46F3F732FEB8 +:1048C00005E0F3F7A1FE42464B46F3F79DFE044692 +:1048D0000E460022284BF3F7C1FF03D84FF0FF30FC +:1048E000014607E00022254B20463146F3F773FDD1 +:1048F000F4F708F9102409E0002C0ADB0A2200234F +:10490000F4F70AF8039B30321A55641E50EA01028C +:10491000F2D1641C039AC4F111031444119A012AC0 +:1049200003D0012208430DD10AE0084304D000203F +:104930004FF0110B119072E7A3EB0B056D1E0DE00C +:104940005B4504DD4FF0000205F1010504E003DAE8 +:104950004FF00002A5F10105002AECD00298119950 +:10496000C0E90231C0E9004579E7000000001440C9 +:104970000000F03F300000000000F0430000E03F86 +:104980002DE9FF4F95B09B468946064600250FE26C +:10499000252877D100242746F84A0121059400E014 +:1049A000044316F8013F203B01FA03F01042F7D10F +:1049B00030782A2811D06FF02F033078A0F1300220 +:1049C000092A16D8059A44F0020402EB820203EB8E +:1049D00042021044761C0590EFE759F8042B05922B +:1049E000002A03DA504244F40054059044F00204D3 +:1049F000761C30782E2816D116F8010F44F00404E6 +:104A00002A280DD06FF02F023078A0F13003092B47 +:104A100009D807EB870302EB4303C718761CF3E7BB +:104A200059F8047B761C30786C280FD006DC4C28B3 +:104A300017D068280DD06A2814D104E0742810D04B +:104A40007A280FD10DE044F400140AE044F48014F5 +:104A500001E044F440147278824202D104F58014DB +:104A6000761C761C307866280BD013DC582877D05B +:104A700009DC002875D04528F6D04628F4D0472810 +:104A80001AD19DE118E0632835D0642879D06528D3 +:104A900012D195E1702873D008DC6728F1D069281D +:104AA0006FD06E280DD06F2806D1B5E073282CD0BA +:104AB000752875D0782874D05A46179990476D1C80 +:104AC00075E1C4F30250022809D003280DD0D9F8AB +:104AD000001004280DD00D6009F1040967E1D9F830 +:104AE0000010EA17C1E90052F6E7D9F800100D806E +:104AF000F2E70D70F0E719F8041B8DF800100020A4 +:104B00008DF80100EA46012003E059F804AB4FF0AC +:104B1000FF3061074FF0000102D40DE008F1010100 +:104B20008846B9420FDA8045F8DB1AF808100029E8 +:104B3000F4D108E008F1010188468142FADB1AF855 +:104B400008100029F6D105985B46A0EB080721461E +:104B50003846179A00F094FA284400EB080507E05D +:104B60004DE029E10DE01AF8010B5A4617999047DC +:104B7000B8F10108F7D25B4621463846179A13E18F +:104B800042E00A220092C4F302524FF0000A022AC5 +:104B900008D059F804CB032A4FEAEC710AD00DE093 +:104BA00029E02AE009F1070121F00702F2E802C139 +:104BB000914609E00FFA8CFC4FEAEC71042A03D10C +:104BC0004FFA8CFC4FEAEC71002907DA0A46002103 +:104BD000DCF1000C61EB02012D2202E0220504D57C +:104BE0002B228DF80420012203E0E20701D02022CD +:104BF000F7E7904659E00A2102E010220DE010216B +:104C00004FF0000A00910BE010224FF0000A44F030 +:104C100004040827009203E008224FF0000A0092E3 +:104C2000C4F30252022A05D059F804CB0021032A0A +:104C300008D009E009F1070121F00702F2E802C1FA +:104C4000914605E01FFA8CFC042A01D10CF0FF0C00 +:104C50004FF00008220728D5702806D0009B83F06B +:104C6000100353EA0A0305D00EE040228DF8042019 +:104C7000012208E05CEA010206D030228DF804200F +:104C80008DF8050002229046009B83F0080353EA4A +:104C90000A030AD15CEA010201D1620705D530227C +:104CA0008DF804204FF001087F1E582804D034A04E +:104CB00003900EA802900DE036A0F9E75346604637 +:104CC000009AF3F729FE84460398825C0298401EFE +:104CD000029002705CEA0100F0D1029806A9081A5D +:104CE00000F1200A600702D524F4803400E0012797 +:104CF000574502DDA7EB0A0000E0002000EB0A01A7 +:104D0000009005984144401A0590E00306D45B46A4 +:104D10002146179A059800F0B3F90544002706E0EC +:104D200001A85A46C05D179990476D1C7F1C4745E6 +:104D3000F6DBE0030CD55B462146179A059800F098 +:104D40009FF9054404E030205A46179990476D1C9E +:104D50000099481E00900029F5DC08E002980299AD +:104D60005A460078491C0291179990476D1CBAF178 +:104D70000001AAF1010AF1DC65E100000928010047 +:104D800030313233343536373839616263646566C1 +:104D90000000000030313233343536373839414283 +:104DA000434445460000000000F058F90544761CD5 +:104DB000307800287FF4ECAD19B02846BDE8F08FBC +:104DC000620700D4062709F1070222F0070CFCE86D +:104DD0000223E14603F000485FEA080C02D00FF21C +:104DE000702C0DE05FEA045C02D50FF2682C07E03E +:104DF0005FEAC47C02D00FF2602C01E0AFF2700CCD +:104E00004FF0FF3823F00043CDF850C065280CD098 +:104E100006DC452809D046281DD047283DD13DE075 +:104E2000662818D067287ED138E00021112F01DBD9 +:104E3000112000E0781CCDE9000106A90EA8FFF7BB +:104E4000DDFCDDE90F010E9A03910021009207F1CC +:104E5000010A04914DE04FF000400097CDE90110A8 +:104E600006A90EA8FFF7CAFCDDE90F0203920E9B0C +:104E700011990022DDF80CA00093049211B9791C5D +:104E800000EB010AB7EB0A0004D4C0F1FF3007F1D0 +:104E9000010A0490AAEB0700019044E0012F00DA18 +:104EA00001270021112F01DD112000E03846CDE956 +:104EB000000106A90EA8FFF7A1FCDDE90F010E9A7B +:104EC0000391002104910092BA4621070CD4039962 +:104ED000514500DA8A46BAF1010F05DD009AAAF1C0 +:104EE0000101515C302908D0B84202DA10F1040FF8 +:104EF00006DA0121CDE9011015E0AAF10101E9E787 +:104F0000002805DC049901440491AAEB000102E0A9 +:104F1000411C514500DD8A460499401A401C01900D +:104F20004FF000400290200704D40198504501DB67 +:104F3000CDF8048000208DF84F0002980DF14F0746 +:104F4000B0F1004F25D02B200E9002984FF00208B0 +:104F500000280CDA404202902D200E9007E00A2132 +:104F60000298F3F7C3FC3031029007F8011DB8F145 +:104F70000001A8F10108F2DC02980028EFD1791EA7 +:104F80000E980870307800F0200040F0450007F8D7 +:104F9000020D12A8C01B00F107081498007800B198 +:104FA000012000EB0A01019801EBE07105984144F2 +:104FB000401A401E0590E00306D45B462146179A2E +:104FC000059800F05DF805441498007818B15A4629 +:104FD000179990476D1CE00324D55B462146179A2C +:104FE000059800F04DF805441CE00498002807DB04 +:104FF000DDE90301884203DD0098405C179901E078 +:10500000179930205A469047049805F10105401C35 +:1050100004900198401E019004D12E205A46179901 +:1050200090476D1CBAF10001AAF1010ADDDC05E030 +:1050300017F8010B5A46179990476D1CB8F10001FB +:10504000A8F10108F4DC5B462146179A0598ABE607 +:105050002D0000002B000000200000002DE9F04191 +:10506000044600251E461746880404D405E0394648 +:105070002020B0476D1C641EF9D52846BDE8F0819C +:105080002DE9F041044600251E469046C80301D58F +:10509000302700E02027880404D505E04146384643 +:1050A000B0476D1C641EF9D52846BDE8F0810A683A +:1050B000531C0B601070704770B58CB001F021FE6E +:1050C0000026304D27E09DF82C3008AA03A80A9945 +:1050D000F6F728F92C498DF81F6001208870079891 +:1050E00003AC009094E80F0000F010FE012810D1EE +:1050F0002448142203A91438F3F746F82248801CE8 +:10510000CDE901601F481438016900910FC800F013 +:10511000B3FDF9F7B3FF6C683CB30BAB08AA0AA95F +:105120000020A0470028CED11FE09DF82C3008AA0F +:1051300003A80A99F6F7F6F88DF81F60FEF740FD10 +:1051400030B1079803AC009094E80F0000F0E8FC41 +:10515000079803AC009094E80F00FEF745FD14217A +:1051600003A8F3F72AF8F9F789FFEC6934B10BAB20 +:1051700008AA0AA90120A0470028D6D101F0E2FC24 +:105180000CB070BD440F0020DC03002070B520215E +:105190001B48F3F712F81A4830213038F3F70DF8AE +:1051A00001F0A8FDF9F7B0FFF9F7E4FF144A15493B +:1051B000303A0020FAF704F810B113A0FFF7EAFA2A +:1051C0000F4A1049183A34390120F9F7F9FF10B1A4 +:1051D00013A0FFF7DFFA0A4D303DEC6824B100233D +:1051E0001A4619461846A0476C6A24B100231A468D +:1051F00019460120A047BDE8704000F0F9B9000051 +:10520000740F00207804002063616E3120D0ADD28D +:10521000E9B3F5CABCBBAFB3C9B9A60D0A0000001B +:1052200063616E3220D0ADD2E9B3F5CABCBBAFB377 +:10523000C9B9A60D0A00000010B54FF480710C48E2 +:10524000F9F7BCF888B14FF400710A48F9F7B6F8DD +:1052500058B109480078022807D0032805D004284F +:1052600003D006480078002800D0012010BD0000BF +:10527000000801400010014059020020AC04002049 +:1052800010B54FF400710448F9F798F808B1002000 +:1052900010BD012010BD000000100140034800783F +:1052A000032801D00020704701207047940F002090 +:1052B000704700002DE9F041CA4C002527462078B0 +:1052C00007F1200618374FF4FA6806287ED2DFE887 +:1052D00000F00305679EFDFC01207DE1A07820F031 +:1052E000B000A070C0484178F9B956214170F7F775 +:1052F00007F8032821D0F7F703F8F0B1F7F700F823 +:10530000002812DDF6F7FCFF03280EDA022000F079 +:10531000B1FA607820F003006070A07840F080005F +:10532000A07000F05FFA00F099FAB0480078012808 +:1053300009D0FFF7A5FF40B118E0052000F09AFA68 +:1053400000F092FAF1E70520CBE0FFF775FF68B1B6 +:10535000022000F08FFA607820F003006070A078DF +:1053600040F08000A07000F03DFA15E0FFF764FF08 +:1053700058B900F043F9002828D0607C002825D0D7 +:10538000607A00F00300022820D0607820F003004B +:105390006070032000F06EFABDE8F04100F05EBAE4 +:1053A000FFF76EFF10B100F029F970B9A06920B1C4 +:1053B00041463846FDF7FAF938B9607C002805D037 +:1053C000607A00F00300012800D100E0E6E0657497 +:1053D000032000F04FFA00F041FAFFF751FF68B1E7 +:1053E00000F00CF950B1607C40B1607A00F003002D +:1053F000022803D0607820F0030003E0607820F0FA +:105400000300401C6070BDE8F04100F0EBB9FFF70D +:1054100037FF0028607C18D018B1607AC04380073D +:1054200009D0A06978B341463846FDF7BFF950B3BB +:10543000FFF702FF38B3657400F010FA6078C143DB +:10544000890720D040F003001AE020B1607A00F014 +:105450000300012809D0A069A8B141463846FDF7EC +:10546000A5F980B1FFF7E8FE68B1657400F0F6F9C0 +:10547000607800F00301012905D020F00300401CF2 +:10548000607000F0AFF9FFF7D7FE30B9A06920B126 +:1054900041463846FDF78AF938B9607C00287DD04E +:1054A000607A00F00300022878D16574042000F0CF +:1054B000E1F9A07820F030001030A07000F092F9EF +:1054C0003046BDE8F041002101E044E001E0FDF795 +:1054D0006DB9206A58B164213046FDF767F930B1E3 +:1054E000012000F0C7F9BDE8F04100F0BDB9607CD3 +:1054F00010B1607A80070FD0FFF79EFE10B1FFF762 +:10550000BFFE48B100F07AF890B1607C80B1607A5B +:1055100000F0030002280BD06574607820F00300CF +:10552000607000F09BF9A07820F03000A07050E08F +:10553000FFF7A6FE002853D0FFF77EFE00284FD0CD +:1055400000F08CF9607840F003006070A07820F0E3 +:105550003000A07026E0E06938B1224841461C3096 +:10556000FDF724F900287FF4B7AE607C20B1607AA3 +:1055700000F00300012819D0FFF782FED8B1FFF731 +:105580005BFEC0B1607C20B1607A00F003000128AE +:105590000CD0607840F00300607000E020E065749B +:1055A00000F05CF900F01EF9032015E0607820F0AF +:1055B0000300401CF0E7FFF763FE002810D1FFF75F +:1055C0003BFE00280CD000F049F9607820F0030081 +:1055D000607000F007F90220BDE8F04100F04AB920 +:1055E000BDE8F081940F0020AC040020E504002009 +:1055F00024210148F2F7E1BD940F002010B54FF4CB +:1056000080710948F8F7DAFE58B14FF40071074885 +:10561000F8F7D4FE28B1F6F769FE401C01D000204F +:1056200010BD012010BD0000000801400010014025 +:105630001CB51B4C1B48217850F821201AA0FFF7FD +:10564000A9F8A07AC0F3011200F00F01CDE9001211 +:10565000617AC20901F00303617C1748FFF79AF8E9 +:10566000A078C0F301110091617800F00F0301F000 +:105670000302C10911A0FFF78DF818341FA094E8A8 +:105680000E00FFF787F8FFF7D7FD0446FFF7F8FD98 +:1056900002B022460146BDE8104021A0FFF77AB8CB +:1056A000940F0020B00400207374617475733A2560 +:1056B00064282573290D0A001CC301086E6D5F66FE +:1056C00072616D653A20414C3A2564204E657477CD +:1056D0006F726B436F6D6D616E643A256420636F0A +:1056E000756E7465723A256420636F6E74726F6CA8 +:1056F0005F7374733A25640D0A00000073615F7470 +:1057000069636B3A2025642074315F7469636B3A76 +:1057100025642074325F7469636B3A25640D0A0056 +:105720006170705F71697275695F6E6D5F616363EF +:105730005F6F6E5F636865636B3A202564206170FC +:10574000705F71697275695F6E6D5F414C5F636810 +:1057500065636B3A25640D0A0000000070B51F4CAC +:1057600040F212600026C4E900062672667202202A +:10577000A072FAF725FB1A4D18B1A87820F00F0097 +:10578000A870FFF759FD0028A87802D040F08000EB +:1057900001E020F08000A87055F8010F44F80B0FCD +:1057A0006868606003F038FD0D4D243570B16C6899 +:1057B000142C0BD204EB840005EB80011422074863 +:1057C0000831F2F7E1FC641C6C6001E02E606E6051 +:1057D000BDE87040014801F09DBB00002C0C00208A +:1057E000940F002070B51B4C40F212602060002026 +:1057F0006060207260720220A072FAF7E1FA164D22 +:1058000018B1A87820F00F00A870FFF715FD002848 +:10581000A87802D040F0800001E020F08000A8705D +:1058200055F8010F44F80B0F686860600A4C243487 +:10583000206814280BD200EB800004EB80001422B7 +:1058400004490830F2F7A0FC2068401C00E0142056 +:10585000206070BD2C0C0020940F00200021014816 +:10586000FCF7A4BFAC0F002000210148FCF79EBF4D +:10587000B00F002038B504460648074D234650F8BF +:1058800024100091297850F8212004A0FEF782FF0F +:105890002C7038BDB0040020940F002063616E208E +:1058A0006E6D3A20256428257329202D2D203E2059 +:1058B0002564282573290D0A0000000010B5194C35 +:1058C0006072A172002104F11400FCF76FFF012047 +:1058D0006074A07AA17860F30301A170A06968B137 +:1058E00040F2145104F11800FCF760FF30B1607A07 +:1058F00000F00300022801D0FFF774FF6078617A9E +:1059000000F0030001F00301884201D0FFF7D2FC50 +:10591000607A00F00300012803D1BDE81040FFF7D2 +:105920009DBF10BD940F002030B5164BA1B041F2C1 +:105930000B01154D0020A3F8051003F2EA2405EB36 +:10594000400100EB40022244B1F84010A2F81F10C1 +:1059500003EB4002401CD171090A80B21172282861 +:10596000EDD30A4950205880087C401C087408A0D8 +:10597000FEF710FF20AA69460248F7F74BFC21B05A +:1059800030BD000072340020FC0D0020F8350020EE +:1059900053656E642063656C6C2074656D70200ABD +:1059A0000D00000010B5244AA2B041F20C01A2F88B +:1059B000051002F2EA21214C91F89730002023F0E3 +:1059C00003035B1C23F0C00381F8973091F89830F3 +:1059D00094F82A4023F01F03240964F3451381F847 +:1059E00098300023A1F89930A1F89B3091F89D30B0 +:1059F00023F0FF0381F89D3091F89E3023F01F03C0 +:105A000081F89E300B181418401C93F8973080B220 +:105A1000E3710828F6D3082050800948017C491C0E +:105A2000017408A0FEF7B6FE20AA69460248F7F7FF +:105A3000F1FB22B010BD000072340020FC0D0020EC +:105A4000F835002073656E6420626D735F73746156 +:105A500074655F696E666F0A0D00000030B5284AF4 +:105A6000A1B041F20A010020A2F80510FF2302F2C2 +:105A7000EA2100EB40040C44401C80B284F8213041 +:105A80002828F6D31F4C0020A47E2834E4B200EB73 +:105A900040050D44401C80B285F821400828F6D30B +:105AA000002000EB40040C44401C80B284F83930E4 +:105AB0000828F6D3002000EB40040C44401C80B2C0 +:105AC00084F851300828F6D3002000EB4003141866 +:105AD0000B44401C93F8213080B2E3712828F4D3A2 +:105AE000094928205080087C401C087407A0FEF754 +:105AF00051FE20AA69460248F7F78CFB21B030BD61 +:105B000072340020FC0D0020F835002053656E64CF +:105B10002063656C6C2074656D70200A0D000000B8 +:105B20000FB414222DE9F04708A94E48F2F72CFBD8 +:105B30004C4E4FF4C0613068A0F58062693A58D08D +:105B4000A0F580626A3A54D0A0F580626B3A50D0DA +:105B5000A0F580626C3A4CD0A0F580626D3A48D0D6 +:105B6000A0F580626E3A44D0A0F580626F3A40D0D2 +:105B7000B0F58E6F46D0B0F5A86F43D0A0F5A06207 +:105B8000413A36D0A0F5A062423A32D0A0F5A062E8 +:105B9000433A2ED0A0F5A062443A2AD0A0F5A062E4 +:105BA000453A26D0A0F5A062463A22D0A0F5A062E0 +:105BB000473A1ED0B0F5A96F24D0B0F5AC6F21D014 +:105BC000A0F5A062663A14D0884214D0A0F5806295 +:105BD000033A17D0B0F5866F14D0A0F54072913A11 +:105BE00007D0A0F58062173A03D0B0F5807F09D0C6 +:105BF00033E0884206D11C490120087000211B486F +:105C0000FCF7D4FD1749142201F56A70F2F7BCFACB +:105C100080211748F8F7DBFB124D002405F52770AB +:105C2000DFF84880DFF84C902746048008F16008D0 +:105C3000296858F83420914206D108EBC400416825 +:105C400028468847C9F80B70641C64B21A2CEFD33D +:105C500014210448F2F7B1FA3760BDE8F0070020DC +:105C60005DF814FB600B0020E5040020AC0200206E +:105C7000001001403E2A00200FB470B5214D0A9C4F +:105C8000687814280BD200EB800005EB800014220A +:105C900004A9001DF2F778FA6878401C687005982E +:105CA00041F6EC4218490025B2EB104F10D19DF897 +:105CB0001B00102804D0132802D0112803D005E0BF +:105CC0009DF81E0001E09DF81C0088740A200EE07B +:105CD00041F6EB42B2EB104F0AD19DF81B008A7CD3 +:105CE000904203D1142008658D7401E032200865CC +:105CF000054800214C30FCF759FD257070BC5DF85B +:105D000014FB0000540C0020580200200FB4142291 +:105D100070B504A92748F2F737FA264D26484FF008 +:105D2000FF366C688461A0B2A0F57441563903D087 +:105D3000304670BC5DF814FB41F6EC41B1EB144FFA +:105D400003D0491EB1EB144F06D11A49142201F1B8 +:105D5000B800F2F719FAEBE718498C421AD0184943 +:105D60008C4217D017498C4214D017498C4211D05D +:105D700016498C420ED016498C420BD015498C42E4 +:105D800008D015498C4205D014498C4202D01449E0 +:105D90008C420CD10749142201F1F400F2F7F4F916 +:105DA0000449AA7A00230B31204600F069FC002048 +:105DB000BFE700004C0B0020D802002056F4261844 +:105DC00056F4011856F4071856F4081856F40A1039 +:105DD00056F4121856F41D1856F41F0856F41A10EB +:105DE00056F41A1810B5124C12490020C4E90001EB +:105DF0000421217260720520A072FF22082104F1A3 +:105E00000B00F2F7D3F9A4F12A020223508811887B +:105E10001371E172090AC0F57A6021736073000A98 +:105E2000A073E3732046BDE8104001F053B80000B2 +:105E3000180C0020F45610182DE9F0410546F4F72F +:105E4000B9FB3F4C042108220227002604F10B0075 +:105E5000012D57D0022D70D13A4BC4E90063217255 +:105E60006672A272FF220821F2F7A0F90120A4F1C4 +:105E70003705E07228882073000A60736888C0F5CF +:105E80007A60A073000AE073A8882074000A607426 +:105E9000A879A074204601F01DF80320F7F743FA13 +:105EA000E772E8882849000A2073287A6073A4F111 +:105EB0002A0040F6C313C07A00EB80004000A5F82A +:105EC0000900A073000AE073B1F8A600A0F2E9325D +:105ED0009A4211D31D4840F2A363B0F84200A0F2E9 +:105EE00009729A4208D3B1F88E01A0F6F121B1F5FA +:105EF000957F01D940F6B830A5F80B0080B2207428 +:105F0000000A13E0124BC4E9006321726672A272A8 +:105F1000FF220821F2F74AF91020E0720D202073C9 +:105F20006673A773FF20E073267406206074A6745E +:105F3000BDE8F041024800F0CDBFBDE8F0810000AF +:105F4000180C0020F456EB1C902A00205802002068 +:105F5000F456EC1C2DE9F04103463C4C0421082288 +:105F60000226002504F10B00012B19D0022B6AD167 +:105F7000374BC4E9005321726572A272FF220821D7 +:105F8000F2F714F90120E07232483349334A40688D +:105F9000A4F12A070144914218D2F2F700FC23E051 +:105FA0002F4BC4E9005321726572A272FF220821AF +:105FB000F2F7FCF81020E072092020736573A673D5 +:105FC000FF20E07325741120607436E01F482549D6 +:105FD000A438B0F81B00B0F5FA6F03D9B1F8592016 +:105FE000904201D3B1F88300A7F8050037F8050FF8 +:105FF0002073000A60737888C0F57A60A073000A85 +:10600000E073124837380088643840F48050B88014 +:106010002074000A6074B879A0740C4800F05AFF2C +:106020000320F7F780F9E672B7F807002073000A3B +:106030006073A573E57325746574A574BDE8F041BC +:10604000024800F047BFBDE8F0810000180C0020B6 +:10605000F456EB1CE8160020FFFF1EBBFFBF7900C3 +:10606000F456EC1C902A002070B50C4C05460C49E7 +:106070000020C4E900010421217260720220A07294 +:10608000FF22082104F10B00F2F790F8E572280ACC +:1060900020732046BDE8704000F01CBF180C0020A3 +:1060A000F45627182DE9F04F85B0054614216846AF +:1060B000F2F783F8764C082102270026042204F127 +:1060C0000B004FF0100B4FF00709012D7ED0022D71 +:1060D0007DD1704B9246C4E9006322726672A17250 +:1060E000FF22F2F763F84FF00108A4F1680584F885 +:1060F0000B802878207368786073A878A073E8789C +:10610000E073A8882074000A6074A879A0742046FF +:1061100000F0E0FE0320F7F706F9E772E888000ACE +:106120002073287A6073687AA073A87AE073E87A9B +:1061300020746674A674204600F0CCFE0320F7F7A6 +:10614000F2F80320E07284F80C806773287CA07357 +:10615000687CE073A87C2074E87C6074287DA0745F +:10616000204600F0B7FE0320F7F7DDF84A4890F824 +:10617000870101287ED0FF2211216846F2F716F828 +:1061800084F80BA0687D20736673A6739DF80000E9 +:10619000E0739DF8010020749DF8020060749DF882 +:1061A0000300A0743A4800F095FE0320F7F7BBF80F +:1061B0000520E0729DF8040020739DF805006073CF +:1061C0009DF80600A0739DF8070001E040E03CE068 +:1061D000E0739DF8080020749DF8090060749DF834 +:1061E0000A00A0742A4800F075FE0320F7F79BF818 +:1061F0000620E0729DF80B0020739DF80C00607380 +:106200009DF80D00A0739DF80E00E0739DF80F003F +:1062100020749DF81000607484F812B01C4800F0DF +:1062200059FE0320F7F77FF884F80B900A212173B9 +:106230000B21617384F80E90E020E073FF2020743E +:106240006074A074124800F045FE05B0BDE8F08F00 +:10625000124BC4E9006322726672A172FF22082108 +:10626000F1F7A4FF84F80BB031202073667384F833 +:106270000E9000E005E0FF20E07326746774A674BA +:10628000E0E70349142250396846F1F77DFF77E7CC +:10629000180C0020F456EB1C902A0020F456EC1C3D +:1062A00070B505460A4C0B480021C4E900100420D3 +:1062B000207261720120A072FF22082104F10B00FC +:1062C000F1F774FFE5722046BDE8704000F002BEB1 +:1062D000180C0020F456091070B5144C1449002015 +:1062E000C4E900010425257260720720A072FF2214 +:1062F000082104F10B00F1F759FF0E4801786420E2 +:10630000012911D0A4F12A01C97AE1724C2121732B +:106310006573B021A173E573207469206074BDE8D2 +:106320007040024800F0D6BDE072EFE7180C002084 +:10633000F4561C18820700202DE9F84FDFF8BC81C5 +:106340006F4A40464FF0000AC0E900A2042288F8D4 +:10635000082088F809A0072188F80A10FF220821E0 +:106360000B30F1F723FF674C674E684DA07D684FF7 +:106370004FF032094FF0550B012842D196F8B50085 +:10638000F2F7D1F900903946A868F1F750FF00996B +:10639000F2F798FA13D296F8B600F2F7C4F9009023 +:1063A0003946A868F1F743FF0099F2F795FA06D24B +:1063B0003946A868F1F73BFFF2F7F1F901E096F8EA +:1063C000B50020754F4847F23051A030FCF704FA71 +:1063D00001280DD1207D617D884204D9411AC9B2BE +:1063E000032900D2607547480021A030FCF7F4F97A +:1063F000207D322801D284F81590552801D384F8E5 +:1064000015B0A07D90BB96F8B500F2F78CF900901E +:106410003946A868F1F70BFF0099F2F753FA13D247 +:1064200096F8B600F2F77FF900903946A868F1F7C0 +:10643000FEFE0099F2F750FA06D23946A868F1F745 +:10644000F6FEF2F7ACF901E096F8B5002075C0B29F +:10645000322803D2484684F8149004E0552802D923 +:10646000584684F814B060750120A07596F8B50000 +:10647000F2F759F981463946A868F1F7D8FE49463E +:10648000F2F720FA13D296F8B600F2F74CF98146EB +:106490003946A868F1F7CBFE4946F2F71DFA06D255 +:1064A0003946A868F1F7C3FEF2F779F901E096F8EA +:1064B000B50020751748807E411E402901D2323038 +:1064C0006075052188F80B10617D0C484A1E88F81C +:1064D0000C20122288F80D20891E88F80E101C212D +:1064E00088F80F10054988F810A02A39097C09019D +:1064F00088F81110BDE8F84F00F0ECBC180C002033 +:10650000F456131858020020902A0020E8160020A4 +:1065100000004842FC0D002070B50C4C0C480025D2 +:10652000C4E90050042020726572A072FF22082185 +:1065300004F10B00F1F73AFE0520E0722573657354 +:10654000A5732046BDE8704000F0C4BC180C0020C4 +:10655000F45619102DE9F05F344FDFF8CCC0344CFD +:10656000FA8FDCF8380002F101018EB2798C314DDE +:1065700001F101035FEA80684FF47A794FF0020A73 +:106580004FF0030B9BB213D5FE870A2A02D220F0EC +:10659000200015E0B1FBF9F209FB12107B84012801 +:1065A0001BD125A017E02078C0BB84F800B035E0EF +:1065B0005FEA406817D5FE870A2A04D220F040001F +:1065C000CCF838002DE0B1FBF9F209FB12107B8406 +:1065D000012802D11EA0FEF7DDF828780028E2D1BC +:1065E00085F800A0DFE75FEA00681AD5FE870A2A6F +:1065F00002D220F08000E3E7207808B984F800B0E8 +:10660000287808B985F800A0B1FBF9F209FB12104F +:106610007B84012802D114A0FEF7BCF80020BDE85D +:10662000F09F0120FBE70000740B002058020020BF +:106630007C070020820700205265762053746F701B +:106640002063616E2064617461310A0D00000000F6 +:106650005265762053746F702063616E206461749C +:106660006120320A0D0000005265762053746F706D +:106670002063616E2064617461330A0D00000000C4 +:106680002DE9F04117460C460146594A00205A4D63 +:10669000DFF860C1C2F807000126A86BA1EB0C026D +:1066A000614551D021DC554AA1EB0206914276D0DA +:1066B0000ADC534A891871D0524AD1422FD121782D +:1066C000A97640F0080066E04F49711829D0B1F56D +:1066D000C02F24D11A4639462046F5F7ABF90028D9 +:1066E0001DD0A86B40F0020055E0B2F5202F48D035 +:1066F000B2F5901F53D0B2F5A81F5ED0B2F5F01FCF +:106700000DD121463A46032F00DD03223A48F1F726 +:106710003BFDA86B40F48040A8633C480672BDE88E +:10672000F0812178E97061782971A1786971E17847 +:10673000A9712179E97161792972A1796972E17987 +:10674000A97240F0010026E0218869826188A9824F +:10675000A1884FF47A6209B2914202DDA1F57A6113 +:1067600001E0C1F57A61E982E18809B2914202DD76 +:10677000A1F57A6101E0C1F57A61298340F0040056 +:1067800009E01A4639462046F5F724F90028C6D014 +:10679000A86B40F01000A863C1E700E01AE0217880 +:1067A00005F8231F61786970A178A970E178E97014 +:1067B00040F02000C5F81500B1E7217905F8341F35 +:1067C00061796970A179A970E179E97040F04000C0 +:1067D0006860A4E7217805F8271F61786970A178BF +:1067E000A970E178E97040F08000C5F8110096E7E3 +:1067F0003E2A002056F40818740B002056F41A1094 +:10680000AA0BE0F7000015F8000019F85802002064 +:1068100070B50F4C8318A34201D9032070BDA2B1FB +:10682000012500230BE004780E78A64204D0FF2C4B +:1068300001D0022070BD0025401C491C5B1C934206 +:10684000F1D3012D01D0012070BD002070BD0000EA +:1068500000000208F8B501210820F9F7D9FD03244A +:106860008DF8024014250F4F8DF803504FF48066C9 +:10687000ADF8006069463846F7F726FD8DF802400E +:106880007400ADF800408DF8035069463846F7F7BC +:106890001BFD31463846F7F79AFD21463846F7F793 +:1068A00096FDF8BD000C014010B5094C8318A342B9 +:1068B00002D80AB1002306E0012010BD10F8014BF8 +:1068C00001F8014B5B1C9342F8D3002010BD00007F +:1068D000000002082DE9F041884606461546224987 +:1068E0002844884202D90120BDE8F081C5B3E807F9 +:1068F00000D0551C2A4641463046FFF789FF002844 +:10690000F2D0012080F31088F7F7CEFB3520F7F79F +:1069100049FBF00AC002F7F74BFB07464FF47A70C9 +:10692000401E80B2FCD200240EE008EB440118F8AF +:106930001400497840EA01213046F7F773FB074617 +:10694000042804D1641CB61CB4EB550FEDD3F7F743 +:1069500061FB002080F31088042F02D00220C3E7DF +:10696000FFE70020C0E700000000020810B54FF06C +:10697000000140B1054C2046F4F716FF2046F4F71D +:10698000BBFC012010BD024CF5E700000068004090 +:106990000064004030B4022814D20B4A00EB80039C +:1069A00002EB83021569002D0CD00A7A8B7A042A37 +:1069B00006D00C6801F10B022146AC4630BC6047A2 +:1069C0004C68F7E730BC70479811002010B530B123 +:1069D0000448F4F776FF042800D1FF2010BD0248D8 +:1069E000F7E70000006800400064004030B402286F +:1069F00015D20C4A00EBC00302EB83040123E268CA +:106A00008B401A420BD09A43E260064A00EB8003A7 +:106A1000483252F82320002A01D030BC104730BC45 +:106A2000704700005011002010B518B1F4F7D8FAE3 +:106A3000012010BDF4F712FEFAE7000010B583281C +:106A400012D10A4C207C01280ED0A4F13000C16A7A +:106A500009B1012088470120207404480021BDE8C5 +:106A600010401430FBF7A2BE10BD0000740F0020D0 +:106A700070B5054600291CD10E4E002406EB04100B +:106A80000168A94203D100210C30FBF78FFE641C82 +:106A9000A4B2062CF2D30848817F002909D0017CDA +:106AA000022906D100218177BDE870401830FBF73C +:106AB0007DBE70BDE4030020740F0020044B00EB8A +:106AC000C00203EB820200219160FFF74FBF00007C +:106AD00050110020022811D2094900EB800201EB7D +:106AE00082018A68002A09D0054B00EBC001483BAF +:106AF00003EB8101C96801B1012110477047000013 +:106B00009811002010B50446022817D2F9F7F0FEBC +:106B10000B4804EB840100EB8100C16809B12046F9 +:106B20008847F9F7EFFE064804EBC401483800EB4C +:106B30008100C168002901D00021C16010BD0000A2 +:106B4000981100202DE9FF474FF000082F4FCDF896 +:106B50000880454607F13009CDF80C8009EB051493 +:106B60002078012802D002283AD045E0A0890628E2 +:106B700003D2274931F8101001E040F2E631201D20 +:106B8000FBF714FE58B3F9F7B3FEA08905EB4506F1 +:106B9000401CA08107EBC600D0F80CC0BCF1000F70 +:106BA00004D000231A4619462846E04702202070E8 +:106BB0008DF8088057F8366040463EB140F21261C9 +:106BC000CDE90010082302AA2846B047F9F79AFE3B +:106BD00004F108000021FBF7E9FD0120A0730BE0A0 +:106BE00004F108006721FBF7E1FD28B1F8F7C8FFC1 +:106BF000A4F80C8084F800806D1CEDB2022DADD39A +:106C0000FEF756FBFEF756FBBDE8FF87440F00205A +:106C10007CB20108024901EB001080897047000036 +:106C2000740F002038B5094CA0680090A289217823 +:106C300007486368FDF7AEFDA0690090A28B217C38 +:106C400004486369FDF7A6FD38BD0000740F0020FD +:106C5000C8C2010874C201082DE9F041022802D31C +:106C60000020BDE8F0810C4F00EBC00607EB860466 +:106C70000125A560002565712371E27027F82610B3 +:106C80002146E560FFF7D0FE18B10220A060012088 +:106C9000E7E7A560E4E700005011002070B5054665 +:106CA000022807D20D4805EBC50400EB8404A06858 +:106CB000022801D0002070BD04F110000646F4F750 +:106CC00051FB31462846FFF781FEFF28F3D0012211 +:106CD000E16882401143E16070BD00005011002066 +:106CE0000EB58DE807006946014804F0F8F80EBDBE +:106CF000B015002010B500F0A5F8BDE8104000F078 +:106D00004FB810B500F05EF8BDE8104000F0A4B830 +:106D100010B50C4A002102EB01131B6883420AD113 +:106D200002EB0110C16851B141680C30C91EFBF77C +:106D30003DFD20B910BD491C89B20629EBD30120C5 +:106D400010BD0000E403002030B54FF0FF34E8B17F +:106D5000124B002253F83250854208D103EBC20097 +:106D6000416011B9002043F83200002030BD521CB0 +:106D7000142AEFD351B1002253F8325045B103EB3E +:106D8000C2056D6825B1521C142AF5D3204630BDCA +:106D900043F8320003EBC2004160E6E73013002005 +:106DA00010B54FF426710648F1F707FA0449282375 +:106DB000A0310C2201F5F07004F069F8002010BD3C +:106DC000301300203EB5104C04F5207514E06946E0 +:106DD000284604F068F80021009A54F831009042E7 +:106DE00007D104EBC100436833B19DE80700984721 +:106DF00002E0491C1429EFD3284604F038F8002893 +:106E0000E5D000203EBD00003013002000280CD04B +:106E10000B4A002101EB410302EB83039B682BB17A +:106E2000491C89B21429F5D30020704701EB4103B6 +:106E300002EB83018860002042F823000846704777 +:106E4000C815002010B5F0210248F1F7B6F900206E +:106E500010BD0000C81500202DE9F8430021684648 +:106E6000FBF7A4FC009810B3012820D0DFF8448081 +:106E7000002505EB450008EB800458F82060A76862 +:106E800096B18FB1201D3146FBF790FC01280BD144 +:106E9000A06838B160680099091AB1FBF6F101FBEE +:106EA000060060602046B8476D1C142DE1D3002019 +:106EB000BDE8F883C8150020002803D002C00021D7 +:106EC000FBF774BC7047002803D00068002800D08E +:106ED000012070471CB50E490C68BCB1017A002333 +:106EE00004290DD00268CDE90023427A52B1002373 +:106EF000042909D0016800F10B020020A0471CBD45 +:106F00004268F0E7837AF3E74168F4E700201CBDAC +:106F1000440F00207CB504462B482C494069F1F70A +:106F2000DEF9F1F73CFC2A4B002580B299884A1C17 +:106F300092B29A800C2911D3642A01D964219980D4 +:106F40001A7801219AB1B0F5207F20D31D705A78AC +:106F50009AB140F22971884219D85D702068A0F575 +:106F6000E061953915D0FCF735FE60B111E040F2D3 +:106F70004E229042EBD2197009E040F23A729042F0 +:106F8000ECD9597003E02046F8F79EF908B10120CA +:106F90007CBD104886697EB1207A04280ED0216815 +:106FA000CDE90015617A59B1002304280AD021687F +:106FB00004F10B020120B04700207CBD6168EFE7BF +:106FC000A37AF2E76168F3E7E81600200000C84200 +:106FD000DC030020440F0020034800214FF4967288 +:106FE0000171028041807047500500202DE9F05F5B +:106FF000FA4E317EB068FAF71BF80546717EF068EC +:10700000FAF716F80446B17E3069FAF711F8022D46 +:1070100057D0DFF8CC830127F24E082D66D0092D1A +:1070200077D04FF0000A0A2D6DD04FF6FF7B4FF05E +:107030000A09102D68D0112D67D0122D77D0132D8D +:1070400076D00C2D75D00D2D74D0042D73D0162D47 +:1070500072D0292D71D02A2D70D02B2D6FD0502DAC +:107060006ED0512D6DD0522D6CD0532D6BD0542D30 +:107070006AD0552D69D0562D68D0572D67D0582D20 +:1070800071D0592D70D05A2D6FD0662D6ED01E2D17 +:107090006DD01F2D6CD1B6F85300A04269D24D4679 +:1070A000B4FBF5F2B4FBF5F1CFA0FDF773FBB6F836 +:1070B00053000A3880B2B0FBF5F1A6F89000D1A0D9 +:1070C000AFE3D94D012C08D0D8A0FDF763FB2846CB +:1070D000BDE8F05F2021F7F778B920212846F7F7BF +:1070E00076F9BDE8F05FD4A0FDF754BB022C07D0C1 +:1070F000D4A1D6A0FDF74EFB022C07D034B1D2E3C9 +:10710000D7A1F6E705E023E039E04DE086F86B40D3 +:10711000C9E3B24CD4A0E168FDF73CFB657E1021C9 +:10712000B048F1F74AF82A46AE48E1689FE053E0DC +:107130005DE06DE078E089E09CE0A6E0B5E0C0E0CD +:10714000CFE0DEE0F6E00FE125E129E12DE13FE3CC +:10715000012C0FD0C6A1C8A0FDF71CFB012C0BD041 +:1071600086F887A09FE34DE354E35DE364E39EE389 +:10717000E9E0A8E3C6A1EEE786F8877093E321462D +:10718000C5A0FDF707FBB6F8590004EB8401B0EB8E +:10719000410F04D90BEA4100A6F8830083E3B0FB5A +:1071A000F9F22146C1A013E02146CAA0FDF7F2FA88 +:1071B000B6F85B0004EB8401B0EB410F04D90BEA95 +:1071C0004100A6F885006EE3B0FBF9F22146C7A0A6 +:1071D000BDE8F05FFDF7DEBA2146D2A0FDF7DAFA8E +:1071E00004EB84010BEA4100A6F859005BE3214659 +:1071F000D0A0FDF7CFFA04EB84010BEA41004FF475 +:10720000FA71A6F85B008842ACD9A6F85B104AE395 +:10721000012C05D086F889A0CBA0FDF7BBFA42E38C +:1072200086F88970D0A0F8E7642C08D286F88A40E6 +:107230002146D4A0FDF7AEFA88F8007033E3D8A059 +:10724000FDF7A8FA5A2086F88A002CE3634DDAA0ED +:10725000E968FDF79FFA6C7E102C74D86148102104 +:1072600010300646F0F7A9FF22463046E968F0F7ED +:107270008BFF18E34846B4FBF0F109FB1142B4FB65 +:10728000F9F1A6F86340D1A0B9E2A4F10A005A28A6 +:1072900004D8E1B286F89310D3A0C2E22146DAA066 +:1072A000FDF778FA86F893A0FDE2A4F16400FA28CD +:1072B00004D8A1B2A6F8A610DDA0B2E22146E4A04F +:1072C000AFE2012C08D086F8A8A096F8A800012803 +:1072D00005D067A1EAA0A4E286F8A870F5E76CA142 +:1072E000F8E7012C08D086F874A196F874010128FB +:1072F00005D0EAA1EBA094E286F87471F5E7EEA15F +:10730000F8E7A4F5F07040F64801884202D2A6F8EA +:10731000754104E0B4FBF9F1EBA0FDF73BFAB6F8D8 +:1073200075014946B0FBF1F2B0FBF9F109FB12021D +:10733000EEA064E2A4F1650040F28331884203D2FA +:10734000A6F8774105E0B0E2B4FBF9F1EEA0FDF755 +:1073500021FAB6F877014946B0FBF1F2B0FBF9F13A +:1073600009FB1202F2A04AE2A4F10B008B2802D220 +:10737000A6F8794104E0B4FBF9F1F3A0FDF70AFAAD +:10738000B6F879014946B0FBF1F2B0FBF9F109FB1F +:107390001202F5A033E2E1B286F87B11F8A040E2D8 +:1073A000E1B286F87C11FCA03BE2A4F5F07040F25B +:1073B000E471884202D2A6F87D4104E0B4FBF9F101 +:1073C000FAA0FDF7E7F9B6F87D014946B0FBF1F206 +:1073D000B0FBF9F109FB1202F8E10000DC350020F6 +:1073E00069070020902A0020526571756972655006 +:1073F0006F7765722564206B7720203A25646B7760 +:107400000A0D000052657175697265506F7765727B +:10741000204175746F204C696D6974202564206B60 +:1074200077200A0D00000000001001404B4331207E +:107430006F70656E0A0000004B433120636C6F7300 +:10744000650A0000474232303131000050726F74DB +:107450006F636F6C547970652025730A000000001B +:107460004742323031350000736E3A25730A00000E +:1074700044697361626C6500517569636B4368614F +:10748000726765456E61626C652025730A000000B5 +:10749000456E61626C650000426D5265717569727E +:1074A00065566F6C742025640A000000426D5265B9 +:1074B0007175697265566F6C74256420426D734DE9 +:1074C0006178566F6C742564206661696C65640A26 +:1074D0000D000000426D73526571756972654375E8 +:1074E0007272656E742025640A0000000A0D426DF8 +:1074F000735265717569726543757272656E742039 +:107500002564204F76657220426D734D6178437516 +:107510007272656E74202564204661696C65640A28 +:107520000D000000426D734D6178566F6C7420251C +:10753000640A0000426D734D617843757272656E26 +:10754000742025640A000000747269636B6C6543E3 +:1075500068617267696E67536F63446973456E61F2 +:10756000626C65200A0D0000747269636B6C654380 +:1075700068617267696E67536F63456E61626C65BF +:107580000A0D0000747269636B6C65204368617258 +:1075900067696E6720536F6325640A0D0000000061 +:1075A000747269636B6C65204368617267696E67AA +:1075B00020536F630A0D0000626C7565746F6F7401 +:1075C00068206E616D653A25730A0000754261742A +:1075D0004D6178456E657267792025642E25646B50 +:1075E00077680A0D00000000526571756972655672 +:1075F0006F6C74616765446966666572656E636524 +:10760000202564560A0D0000526571756972655631 +:107610006F6C74616765446966666572656E636503 +:107620002D2D4F766572202564560A0D000000004E +:1076300053696D756C6174656443757272656E74BF +:10764000426174566F6C74202564560A0D00000068 +:1076500053696D756C6174656443757272656E749F +:10766000426174566F6C74202564562D2D4F7665DB +:1076700072203130302D333530560A0D00000000B5 +:10768000446562756720506167652066756E637436 +:10769000696F6E2025732020200A0D0065617379C3 +:1076A00000000000576F726B4D6F64656C2025738E +:1076B0002020200A0D00000070726F6665737369E8 +:1076C0006F6E616C00000000444352657175697211 +:1076D00065566F6C7425643A4F7665722834382D80 +:1076E000323630292020200A0D0000004443526524 +:1076F0007175697265566F6C743A25642E25642025 +:107700005620200A0D0000004443526571756972CD +:107710006543757272656E74202564413A4F7665D3 +:10772000722831302D31303041292020200A0D00BF +:1077300044435265717569726543757272656E7402 +:1077400020256441200A0D0044434D6178506F7735 +:1077500065722564203A4F76657228312D31306B81 +:107760002909200A0D00000044434D6178506F77CD +:1077700065723A25642E2564206B77090A0D000096 +:1077800044435F496E64756374616E636554656DEF +:1077900070202564200A0D0044435F494742545439 +:1077A000656D70202564200A0D00000044434D6182 +:1077B00078566F6C742564563A4F76657228343863 +:1077C0002D32303056292020200A0D0044A016E02A +:1077D000A4F1C800B0F5487F02D8A6F87F4104E0C4 +:1077E000B4FBF9F144A0FCF7D5FFB6F87F01494698 +:1077F000B0FBF1F2B0FBF9F109FB120247A0FCF774 +:10780000C9FF50E0962C01D286F8814196F881118B +:1078100049A006E0962C01D286F8824196F88211A2 +:107820004BA0FCF7B7FF3EE0022C01D286F8904156 +:1078300096F890114BA0F4E704EB84010BEA4100A9 +:107840004E4DA6F88E014E496868F0F77AFD8146E4 +:107850002046F0F768FF4946F0F73BFDF0F786FF5A +:1078600041B286F88D11002902DA494245A000E0B4 +:107870004BA0FCF78FFF96F98D0100F10901132948 +:1078800001D3286808E000EB80004000F0F742FFD9 +:107890006968F0F7CCFC2860F0F7CDFF02460B4694 +:1078A00046A0FCF777FF88F80070BDE8F09FA0B213 +:1078B0004946B0FBF1F2B0FBF9F109FB1202A6F860 +:1078C000530045A09BE7A0B24946B0FBF1F2B0FBE4 +:1078D000F9F109FB1202A6F8900045A08FE700001D +:1078E00044434D6178566F6C743A25642E256420AC +:1078F0005620200A0D00000044434D617843757204 +:1079000072656E7425643A4F7665722832302D3177 +:107910003030292020200A0D0000000044434D6132 +:107920007843757272656E743A25642E2564204121 +:1079300020200A0D000000004361706163697461DA +:107940006E636554656D7031202564200A0D00005A +:107950004443426F7854656D7032202564200A0DCF +:107960000000000043617061636974616E63655477 +:10797000656D7032202564200A0D0000E816002095 +:10798000000020410A0D48696768566F6C74616792 +:10799000654F66667365742D20256456200A0D00B8 +:1079A0000A0D48696768566F6C746167654F666653 +:1079B0007365742B20256456200A0D000A0D724849 +:1079C000696768566F6C746167654F666673657446 +:1079D00020256620200A0D004F766572506F77656E +:1079E00072203A25642E25646B77680A0D0000002A +:1079F0000A0D52657175697265506F7765723A2527 +:107A0000642E25646B77680A0D0000000D4810B5E0 +:107A1000017E8068F9F70CFBC0B201220A490128F7 +:107A20000DD000200860094941F8770F4860886050 +:107A30000748027007A0BDE81040FCF7ABBE09A0E4 +:107A40000A60F8E7DC35002078060020902A002044 +:107A500069070020656E636F6465636869700D0A6D +:107A6000000000006465636F646520636869700DE1 +:107A70000A0000000120FFF745B8000010B5094CCE +:107A8000217EA068F9F7D4FA617EE068F9F7D0FAB0 +:107A9000A17E2069F9F7CCFAFAF77CFE02490020B2 +:107AA000087110BDDC3500207C0700202DE9F05F57 +:107AB000504C217EA068F9F7BBFA8146617EE068F0 +:107AC000F9F7B6FA05464C4890F82B0010F0600F15 +:107AD00004D0BDE8F05F49A0FCF75CBEA9F130001E +:107AE0004F4E01274F4C4FF0020B4FF06408A22875 +:107AF0004DD8E81E4FF6FF7A61280AD805EB8501BC +:107B00000AEA4100A4F80B00294647A0FCF742FE10 +:107B100004E0A4F80B804AA0FCF73CFEB6F879011B +:107B2000A4F8070004F8017B86F897B104214E48B9 +:107B300006F27516F6F74BFC4C4909EB89000AEA88 +:107B400040024F74228108EB4000208005EB850045 +:107B500008EB4000A0800888A4F813004888A4F827 +:107B60001500FAF71DFE42480021C822077141485E +:107B7000017102804180208930803F496089708096 +:107B8000C8804946BDE8F05F3CA0FCF703BEB6F8EC +:107B90007D01A4F801004FF47A7AA4F805A0B6F8A4 +:107BA0007901A4F80700334DB946277000272F71DB +:107BB000C82028806F8004212B48F6F708FC2B484A +:107BC000C82180F8119086F897B12F7129806F80B5 +:107BD000A4F809A0A4F80B800188A1824088E08263 +:107BE000FAF7DEFD224981F804902349A1F806A0A6 +:107BF000BDE8F09FDC3500203E2A002046444320AB +:107C0000B7B4BDD3B9CAD5CF2CC7EBBCECB2E9BD74 +:107C1000D3CFDFBAF3D4DABFAABBFA0A0D00000053 +:107C2000902A002000170020444320C9E8B6A8CAC3 +:107C3000E4B3F6B5E7C1F720256420410A0D000042 +:107C4000444320C9E8B6A8B3ACB3F6B7B6CEA7286C +:107C5000332D31303041292CBBD6B8B4C4ACC8CF99 +:107C6000313041200A0D0000000C0140EE0B0020D5 +:107C70007C07002050050020FC0D0020444320C953 +:107C8000E8B6A8CAE4B3F6B5E7D1B9202564205612 +:107C90000A0D000010B5124C12A034F8591FFCF761 +:107CA00079FD618815A0FCF775FD1A480068F0F7AA +:107CB00076FD81B218A0FCF76DFD618D1BA0FCF76D +:107CC00069FDA18D20A0FCF765FDA07C022805D0F0 +:107CD00024A1BDE8104025A0FCF75CBD28A1F8E771 +:107CE000902A00200A0DD7EEB8DFD4CAD0EDB3E455 +:107CF000B5E7B5E7D1B925640A0D00000A0DD7EE46 +:107D0000B8DFD4CAD0EDB3E4B5E7B5E7C1F7256471 +:107D10000A0D0000E81600200A0DB5B1C7B0B2C9BF +:107D2000D1F9B5E7D1B925640A0D00000A0DD3C316 +:107D3000BBA7D7EEB8DFD0E8C7F3B3E4B5E7B5E744 +:107D4000D1B925640A0D00000A0DD3C3BBA7D7EE35 +:107D5000B8DFD0E8C7F3B3E4B5E7B5E7C1F725640A +:107D60000A0D0000C0CFB9FAB1EA00000A0DB5B1A2 +:107D7000C7B0B5E7B3D8D0ADD2E925730A0000008B +:107D8000D0C2B9FAB1EA000070477047F8B54FF4B5 +:107D900080715D48F6F712FB5C4D4FF4007168721C +:107DA0005B48F6F70BFBA8725A485B49406888426B +:107DB00001D15AA000E062A0FCF7ECFC664C206800 +:107DC000A0F5806169394FD064A0FCF7E3FC694FEE +:107DD00004213846F6F7FBFA6749012048744FF44E +:107DE0007A70F5F7A0FA65A0FCF7D4FC674CA068A0 +:107DF000F0F7D5FC81B266A0FCF7CCFCE068F0F7A8 +:107E0000CEFC81B268A0FCF7C5FC2069F0F7C7FC86 +:107E100081B26BA0FCF7BEFC6F4E70A03178FCF70E +:107E2000B9FC4FF480413846F6F7D1FA4FF4FA77AF +:107E30003846F5F778FA70A0FCF7ACFC6068F0F70C +:107E4000FAFC02460B4672A0FCF7A4FC2068F0F78F +:107E5000F2FC02460B4676A0FCF79CFC7D4960686C +:107E600088421FDD7CA01EE081A0FCF793FC8848BF +:107E70002668066061684160227A0272627A427204 +:107E8000A27A8272D4F80B20C0F80B20D4F80F200D +:107E9000C0F80F2002690092D0E902233046FFF7B4 +:107EA00039F894E77BA0FCF775FC30780C2817D0E4 +:107EB0007EA0FCF76FFC3846F5F735FA814800786C +:107EC00004280FD005280DD07FA0FCF763FC707844 +:107ED000062809D082A0FCF75DFC687A30B109E081 +:107EE00084A0E6E789A0F0E78EA0F4E792A194A031 +:107EF000FCF750FCA87A002805D1BDE8F8408EA117 +:107F000091A0FCF747BCF8BD000801407C070020A9 +:107F100000100140400C002056F426180A0DCAD566 +:107F2000B5BD63616E2031CED5CAD6B1A8CEC42C02 +:107F300063616EC7FDB6AFD5FDB3A30A0D000000A7 +:107F40000A0D20CEB4CAD5B5BD63616E3120B1A88B +:107F5000CEC40A0D00000000080F00200A0D20CE3C +:107F6000B4CAD5B5BD63616E32B1A8CEC43F0A0DA7 +:107F700000000000000C0140EE0B00200A0D20B1B3 +:107F8000D5BACFBCCCB5E7C6F70A0D00E81600207D +:107F90000A0DB5B1C7B0B0E5D7D3CEC2B6C8312D42 +:107FA0002D25640A0D0000000A0DB5B1C7B0B0E57B +:107FB000D7D3CEC2B6C8322D2D25640A0D000000DD +:107FC0000A0DB5B1C7B0B0E5D7D3CEC2B6C8332D10 +:107FD0002D25640A0D0000003E2A00200A0DB5B1CF +:107FE000C7B0B0E5D7D3CAE4C8EBB5E7D1B92D2DFA +:107FF0002564560A0D0000000A0D20B1D5BACFB88D +:10800000DFD1B933303056BCCCB5E7C6F70A0D0026 +:108010000A0D20B5B1C7B0B2C9D1F9B5E7B3D8B52B +:10802000E7D1B9256628302E3156290A0D00000007 +:108030000A0D20B5E7B3D8D0A3D7BCBAF3B5C4D0E6 +:10804000E8C7F3B5E7D1B9256628302E3156290A9D +:108050000D000000000091430A0D2020626D73B0F6 +:10806000E5B8DFD1B9B5E7D1B9D5FDB3A30A0D00A5 +:108070000A0DCAD5B5BD63616E32B1A8CEC42C63FA +:10808000616E32C7FDB6AFD5FDB3A30A0D00000087 +:108090001C0F00200A0D2020626D73B0E5B8DFD1FF +:1080A000B9B5E7D1B9D2ECB3A30A0D000A0D20206F +:1080B000626D73B0E5B5CDD1B9B5E7D1B9D2ECB346 +:1080C000A30A0D00F83500200A0DC0B6D1C0C4A324 +:1080D000BFE9CEB4CDA8D0C5C9CF0A0D00000000BD +:1080E0000A0D2067756E5F706C7567696E3132209E +:1080F0000A0D00000A0D2020626D73B0E5B5CDD1E8 +:10810000B9B5E7D1B9D5FDB3A30A0D000A0DC0B6C4 +:10811000D1C0C4A3BFE9CDA8D0C5D5FDB3A30A0D76 +:10812000000000000A0D2067756E5F706C7567694E +:108130006E36200A0D00000077616B6575700000D7 +:10814000412B2025730D0A004143432025730D0A5E +:108150000000000001210248017002A0FCF71ABBD8 +:10816000AC040020675F746573745F616C203D2010 +:1081700025640D0A0000000008B500216846FAF7E2 +:1081800015FB04A00099FCF705FBFEF74BFDFDF77E +:108190004FFA08BD7469636B203D2025640D0A0009 +:1081A00070B590B00C4640216846F0F706F8184BC1 +:1081B0005878401C587017482178C27E8A420CD0EB +:1081C0000025012907D05A7A561C5E72052A04D967 +:1081D000C1765D7201E05D72C17634F8011F49BA63 +:1081E00020F81C1F618849BA4180A18849BA818062 +:1081F000A17928390173E1792839417321894181B5 +:10820000A17A28398173E17A2839C17310B070BD21 +:1082100018050020001700202DE9F047DFF89C80AA +:1082200098F80000012813D1254F264D264E4FF017 +:108230000009308806280BD30CD14FF0C801204824 +:10824000EFF7BBFF88F80090A6F80090A5F80A9019 +:10825000BDE8F0876889384401785A2927D14178E8 +:10826000012924D1C178402921D8021D8B5C421DEF +:108270008A5C091D03EB022294B2F3F709FCA042C9 +:1082800015D169897818041DC77839446981318806 +:10829000C91B3180807801F021F8E8610028D7D02F +:1082A00043683A462146BDE8F047002018476889F0 +:1082B000401C68813088401E3080BAE77F0700206C +:1082C000AA33002018050020980700202DE9F05F50 +:1082D0004FF47A717B48FAF769FA01287ED1DFF80A +:1082E000E881D8F80400F0F75AFA764C81B2103CD5 +:1082F000A088F3F706FC0126642805D9D8F8040005 +:10830000F0F74DFAA080E68070492078CA7E82425C +:1083100001D02270E680DFF8B891637899F8000008 +:10832000834201D06070E680C88C2389984201D0D6 +:108330002081E680E0780A23B0FBF3F503FB15000B +:10834000012802D0E08801287ED10027E7808A46F4 +:108350000D4609785FA0FCF71DFAAA8BB5F8091045 +:1083600064A0FCF717FAEA8BB5F80B1068A0FCF7CD +:1083700011FA6A8C298C6DA0FCF70CFA7348418FB6 +:1083800073A0FCF707FAE98C99F8002073A0FCF7BA +:1083900001FA02F061FDE8B1DFF8DCB1774DA770BA +:1083A000A17815F8310003090BEB430200F00F032D +:1083B000B2F82B2006FA03F0024205D005EBC1000B +:1083C00041686FA0FCF7E6F9A078401CC0B2A0702D +:1083D0001028E5D35546BAF8260000E06FE0D8B182 +:1083E000DFF8B0A1A770A0781AF83020110905EBCA +:1083F000410102F00F02C98C06FA02F2114205D0C7 +:108400000AEBC00041685FA0FCF7C4F9A078401CEB +:10841000C0B2A0701028E6D399F800004E46B0B163 +:10842000A770284F0C37A078327817F83010914297 +:1084300005D107EBC000416857A0FCF7ABF9A07865 +:10844000401CC0B2A07000E033E01428EBD34446D7 +:10845000D8F81000F0F78AF907B2E068F0F786F96B +:1084600006B2A068F0F782F901B23B4632464EA050 +:10847000FCF790F995F8292015F8281F52A0FCF771 +:1084800089F9EA78A97859A0FCF784F96068F0F7CF +:10849000D2F90B465A4902465AA0B1F81B10FCF714 +:1084A00079F96069F0F7C7F902460B465DA0FCF761 +:1084B00071F9BDE8F05F00210248FAF777B9BDE82D +:1084C000F09F000010000020E81600200017002098 +:1084D0007C0700204D6F64756C6520737774696349 +:1084E00068202025642073746174652025640D0A5A +:1084F00000000000766F6C742074617267657420F0 +:108500002564206E6F77202564200D0A000000008E +:108510006375727220746172676574202564206EC1 +:108520006F77202564200D0A00000000696E7075C9 +:10853000745F766F6C7420256420696E7075745F4B +:10854000637572722025640D0A000000FC0D002086 +:10855000424D535265712020256400006661756CA0 +:1085600074636F646520256420726561736F6E208B +:1085700025640D0A000000003E2A00207805002036 +:108580004644435F6661756C74636F646520257350 +:108590000D0A0000F805002073746F705265617356 +:1085A0006F6E2025730D0A0054656D7031202564AF +:1085B0002054656D70322025642054656D70332021 +:1085C00025640D0A000000004D6F64756C5F5465F2 +:1085D0006D7020256420496E64756374616E6365F7 +:1085E0005F54656D702025640D0A000074656D7020 +:1085F000332025642074656D70342025640D0A00D5 +:10860000740B002043445A20566F6C74202564205C +:108610002020494E5055545F566F6C742025660DCE +:108620000A00000043445A20417578696C69617200 +:108630007920506F77657220566F6C742025660D17 +:108640000A0000002DE9F04104460E460D20FAF71D +:1086500087F90A20FAF784F9002510E02078F6F768 +:10866000E5F901462078F6F7D9F907460846FAF702 +:1086700077F93846FAF774F96D1CADB2641CB5424F +:10868000ECD30D20FAF76CF9BDE8F0410A20FAF7B7 +:1086900067B9002242F6E06304E01946491EFDD1A5 +:1086A000521C92B28242F8D37047FEF7D3B82DE93C +:1086B000F04115460C460746F6F79AFCA020F6F75F +:1086C0006DFCF6F7BDFC98B9200AF6F767FCF6F7E3 +:1086D000B7FC68B9E0B2F6F761FCF6F7B1FC38B95F +:1086E000F6F786FCA120F6F759FCF6F7A9FC20B1B5 +:1086F000F6F794FC0020BDE8F08100246E1E09E02E +:10870000B44201D0012000E00020F6F719FC3855F2 +:10871000641CA4B2AC42F3D3F6F780FC0120EAE774 +:108720002DE9F04116460C46074600252AE035B1F2 +:10873000E00618D1F6F772FC0620F4F7F4FDF6F720 +:1087400057FCA020F6F72AFCF6F77AFC88B9200A35 +:10875000F6F724FCF6F774FC58B9E0B2F6F71EFC05 +:10876000F6F76EFC28B9785DF6F718FCF6F768FCAA +:1087700020B1F6F753FC0020BDE8F081641C6D1CAD +:10878000A4B2ADB2B542D2D3F6F748FC0120F3E76C +:1087900070B541F288311848FAF708F8012829D154 +:1087A000164CE07E01281FD1134DE18B203D288B14 +:1087B000814219D016D2F3F7A4F9C82812D90E496C +:1087C00001201831087148880A2804D20C4A32F86E +:1087D0001000088003E0C8200880092048804888ED +:1087E000401C4880E08B2883BDE87040002102488F +:1087F000F9F7DCBF70BD000038050020001700202D +:1088000020BA010870B5104C0546C1B22046FBF7EE +:10881000A1F920880006FCD50C4890F8A800012892 +:1088200010D10B48807802280CD10A4C0A48217AD2 +:10883000962903D24554491C217203E0FBF750FEF0 +:1088400000202072284670BD004C0040902A002075 +:10885000F83500207C070020302F002010B50028BC +:1088600021D0114B0022001F196803E0814203D878 +:108870000A4649680029F9D152B11368841A9C420A +:1088800004D1006818441060104602E0506000E017 +:10889000186039B102680B1A934203D10B681A446D +:1088A00002604968416010BD140B002000B5F0F76C +:1088B000D9FA0520FFF7EDFEF7F77AFF0149888026 +:1088C00000BD00007C06002070B505460846F5F79F +:1088D0003FFF040062D00420812D2CD00CDC042D3D +:1088E00017D0802D5AD194F85400032856D3E16C48 +:1088F000002953D0802043E0822D13D0832D4DD109 +:1089000094F85410032949D394F8911002292DD0DA +:1089100033E094F85400032840D32046BDE870406B +:10892000F6F7ADB994F85400032837D3E16C002969 +:1089300034D0822024E094F8541003292ED394F8E4 +:10894000911002290DD194F8901094F8442091428E +:1089500000D2032084F89100227804210120FEF740 +:10896000BFF9E16C002919D0812009E084F8910059 +:10897000227804210120FEF7B3F9E16C19B18320BC +:10898000BDE870400847207800F031FB2078BDE852 +:10899000704000231A46194600F073BB70BD70B5D5 +:1089A0000D460446F5F7D4FE00281ED090F854304A +:1089B000022B06D8C168002917D02046BDE87040B8 +:1089C0000847812B0AD0002D0FD1802180F8541048 +:1089D0002246BDE870400120FEF782B9002D04D088 +:1089E000812180F854102246F3E770BDFFF7D7BF0E +:1089F00010B50446F5F7ACFE002813D090F85410DB +:108A0000022906D8C16800290CD02046BDE81040D4 +:108A10000847832180F854102246BDE81040012009 +:108A2000FEF75EB910BD00002DE9F0411D46164667 +:108A30000F468046F5F78CFE040030D094F85400C1 +:108A400003282CD3802802D1032084F8540094F802 +:108A50004000C00706D0A36C0BB32A463146384607 +:108A600098471CE00F48691E2A46076005710729D0 +:108A700003D83146401DEFF787FB04F15800094940 +:108A8000054602F02CFA284602F0F9F938B18220A6 +:108A900084F85400014642460120FEF721F90120E6 +:108AA000BDE8F0812013002010B50C46F5F750FE0C +:108AB000002815D090F89110E2B2022901D00329C4 +:108AC0000ED190F8981091420AD1052180F89110AA +:108AD00090F85410032903D3BDE81040F6F7CFB83F +:108AE00010BD0020401C80B23C28FBD37047000022 +:108AF00010B50E4C627852B1002161702170E068AF +:108B00000A22B0FBF2F080B22081E16010BDFFF7D5 +:108B1000CDFEE1680844E0602078411C21700928FE +:108B200001D301206070208910BD00007C06002068 +:108B300086B0F1F70DFBFBF715F84FF4004162B674 +:108B40000803F6F747FDF8F781FE6846F7F77EFC65 +:108B5000F6F7F0FCF6F72CFC40F2CF2140F2F310D0 +:108B6000F8F7E6FEFFF7A1FDF0F740F8F0F79EF901 +:108B70007C48C06802F0D0F94FF4E13002F028FAE6 +:108B80004FF4165002F084FAF6F784FA4021764842 +:108B9000F5F71DFC02217548F5F719FCFCF7F6FA0C +:108BA000F5F7A0FEF8F75CFAF2F7F8F870A0FBF71B +:108BB000F1FD76A0FBF7EEFD7B497CA0FBF7EAFD1B +:108BC0007E4D0A24B5F859005335B0FBF4F17CA072 +:108BD000FBF7E0FD2889B0FBF4F17FA0FBF7DAFD9D +:108BE000288EB0FBF4F182A0FBF7D4FD688EB0FBB9 +:108BF000F4F186A0FBF7CEFD2888B0FBF4F18AA043 +:108C0000FBF7C8FD287E533D022834D08BA18DA0F0 +:108C1000FBF7C0FD95F897118FA005F27515FBF7CE +:108C2000B9FD2888B0FBF4F194A0FBF7B3FD688888 +:108C3000B0FBF4F197A0FBF7ADFD2889B0FBF4F190 +:108C40009AA0FBF7A7FD6889B0FBF4F19DA0FBF7A4 +:108C5000A1FDA888A5F27515B0FBF4F19FA0FBF764 +:108C600099FD5648EFF7C6FA102806D25349A0A03E +:108C7000FBF790FD0DE0A3A1C9E7A4A0FBF78AFDD7 +:108C80000024A6A0295DFBF785FD641CE4B2102C2E +:108C9000F7D3F7F7FFFCF7F7B3FCA14A002485F8F8 +:108CA000A840506820F007019EA05160FBF772FDBC +:108CB000A04DF9F7A7FDFCF7FFF9287801281FD090 +:108CC000687801282ED0A878012831D0E8780128CA +:108CD0003ED0287901283DD0687901283ED0E87936 +:108CE0000128E6D14102EC719348F5F76EFBF6F7E7 +:108CF00023FDF1F771FDF8F779FDFAF7A3FFD8E747 +:108D00002C70F1F70DFD8D480078012801D0F0F7A7 +:108D10004DF9F5F793FEFFF7D9FAFBF73DFCFAF7AB +:108D20001FFFC6E76C70FFF777FAF6F7A7F9C0E701 +:108D3000AC70F2F70BFFF1F7E3F80220F5F726FD30 +:108D40007F4948600860FAF709FFF6F7ADFDB0E724 +:108D5000EC70AEE72C71F6F7FBFAAAE7F3F7A8FF81 +:108D60006C71A6E7000000200010014000080140DF +:108D70000D0A4150502070726F6772616D207275DC +:108D80006E6E696E67202E2E2E0D0A000D0A20735E +:108D90006F6674776172652056657273696F6E3A9B +:108DA00020200D0A0000000030BB01080D0A20B091 +:108DB000E6B1BEBAC53A2025730D0A00902A0020FC +:108DC0000D0AD7EEB4F3B3E4B5E7B5E7D1B93A206D +:108DD00025640D0A000000000D0A20D7EEB4F3B39D +:108DE000E4B5E7B5E7C1F73A2025640D0A000000B5 +:108DF0000A0DD3C3BBA7D7EEB8DFD0E8C7F3B3E4FF +:108E0000B5E7B5E7D1B925640A0D00000A0DD3C353 +:108E1000BBA7D7EEB8DFD0E8C7F3B3E4B5E7B5E753 +:108E2000C1F725640A0D00000A0DD3C3BBA7D7EE16 +:108E3000B4F3B9A6C2CA25640A0D0000C0CFB9FABE +:108E4000B1EA00000A0DB5B1C7B0B5E7B3D8D0ADEF +:108E5000D2E925730A0D00000A0D5379735061722F +:108E60006150696C65442E536F6353696D756C6115 +:108E7000547970652025640A0D0000000A0D4443F2 +:108E80004443D0E8C7F3B3E4B5E7B5E7D1B9256407 +:108E90000A0D00000A0D44434443D0E8C7F3B3E48D +:108EA000B5E7B5E7C1F725640A0D00000A0D444394 +:108EB0004443D7EEB4F3B3E4B5E7B5E7D1B92564DD +:108EC0000A0D00000A0D44434443D7EEB4F3B3E463 +:108ED000B5E7B5E7C1F725640A0D00000A0D444364 +:108EE0004443D7EEB4F3B9A6C2CA25640A0D000004 +:108EF0000A0DC9E8B1B8B5C4736EBAC53A25730A8C +:108F000000000000D0C2B9FAB1EA00000A0DC9E8B9 +:108F1000B1B8B5C4736EBAC53A0A00002563200023 +:108F2000002004E056616C7565203D2025640D0A23 +:108F300000000000802A0020000C01408007002073 +:108F4000E8160020F0B50B30154D20F00701002485 +:108F5000144A0FE003688B420BD38B4205D95E1A8B +:108F600043184768C3E9006700E04368136002C024 +:108F700004E0021D10680028ECD12046002802D130 +:108F8000286808B10020F0BD064A07481060074A6B +:108F9000121A22F00702C0E9002401202860D7E756 +:108FA000180B0020140B002004380020005800206B +:108FB00070B53AB10C4B84189C4203D8A3F50074E9 +:108FC000A04202D24FF0FF3070BD31B1002302E069 +:108FD000CD5CC5545B1C9342FAD3011B92B289B29B +:108FE000FAF7D0FD002070BDA8290020704770B5A9 +:108FF0000546F5F7ADFB040003D094F854000228B1 +:1090000001D8002070BD022084F85400E16809B145 +:109010002846884794F8910018B3D4F8A8204AB994 +:1090200006E00428D4F8A4000AD00321904718E0F1 +:10903000226DB2B10528F4D10021D4F8A400F5E7DF +:109040000121F3E73146284601F02DFF68B1D4F83D +:10905000A8200AB9226D42B10321D4F8A400904798 +:1090600003E004F1940604F17005284601F0FFFEC8 +:109070000028E7D0202104F19000EFF79EF80120AE +:1090800070BD2DE9F0411D4616460F468046F5F7A6 +:109090005FFB04002CD094F85400012828D9D4F8A0 +:1090A00004C0BCF1000F23D02B463246394640465F +:1090B000E047E8B1D4F88C1031B194F8453018226B +:1090C00004F1700001F0E3FE94F84000C00709D1FC +:1090D000D4F8881031B194F84530102204F15800CA +:1090E00001F0D5FE032084F854000120BDE8F08192 +:1090F0000020FBE710B5F5F72BFB002801D090F816 +:10910000540010BD2DE9FF411E4615460F46F5F7E8 +:109110001FFB04000ED094F8540002280AD94DB168 +:1091200094F84000C00705D104F15800804601F0D2 +:109130009EFE18B1002004B0BDE8F08169464046AB +:1091400001F0B1FE0028F6D0009838609DF80400C8 +:1091500030709DF80420501E072804D828460DF1D1 +:109160000501EFF711F894F85400822802D103208A +:1091700084F854000120DEE72DE9F04786B01D4653 +:10918000DDE90E9816460F46F5F7E2FA04000BD01B +:1091900094F85400022807D9082D05D804F170006E +:1091A000824601F06CFE18B1002006B0BDE8F087E1 +:1091B000F7F79EFB94F85400832801D0032802D2CD +:1091C000F7F7A0FBF0E7CDF8148000978DF8055075 +:1091D000CDF8109016B900208DF805009DF80520F7 +:1091E000501E072804D831460DF10600EEF7CCFFDB +:1091F000FF208DF804006946504601F070FE94F897 +:10920000910010B92046F5F73AFDF7F77BFB0120F6 +:10921000CBE7002070470000044803C8814201D317 +:1092200000207047401AC0B270470000B80F0020FD +:1092300070B51C48C17A1C48462902D24FF4FA6125 +:1092400001E04FF47A710184184991F897110129CE +:1092500018D1174D174B002695F8291001F003027D +:109260001978012A08D0C28B541CC483048CA242F2 +:1092700003D9A1B90F2011E0C68395F839201AB19E +:10928000A0F84060012070BD30F8402F541C20F839 +:10929000204900888242F5D909B9102018700020B1 +:1092A00070BD0000EE0B002058020020902A002024 +:1092B000FC0D00207C07002005480A6840F82E2F8E +:1092C00049684160024903A02E31FBF763BA0000F0 +:1092D000001700200A0D20257320000010B504237C +:1092E000094A002112F83140844206D1074B002080 +:1092F000A3F8190002EBC10010BD491CC9B2994284 +:10930000F0D3002010BD00005805002000170020F9 +:109310002DE9F04F93B0044640216846EEF74DFF2B +:109320004FF0000AADF844A04FF6FF7BFE4D85F8E4 +:1093300010A0B4F80580A8F5004020381ED0A8F58C +:10934000004021381AD0DFF8E4930127F84EB8F531 +:10935000004F7DD05CDCB8F5D06F01F04A8549DC68 +:10936000B8F5607F6ED03EDCB8F1800F70D0B8F5F4 +:10937000C07F68D0B8F5207F32D18BE06688274661 +:10938000B6F5967F05D8E8483246E11D3830EEF74D +:10939000FBFEE54831463830FFF754F9B81930F88C +:1093A000024CB01E81B23846F1F754F90746024626 +:1093B0002146E0A0FBF7EEF9BC4201D0E3A044E077 +:1093C000D94908F1E00885F811A008F0FF003246FD +:1093D0003831FAF70DFEE549642008840420A870AE +:1093E00013B0BDE8F08FB8F5906F64D0B8F5B06FEA +:1093F000F6D178E0B8F5286F22D0F1DCB8F5F06F3F +:109400001ED0B8F5086F1BD0B8F5186FE8D117E07B +:1094100048F20701A8EB0100884511D009DC6FF480 +:10942000004040440628DBD2DFE800F02B344345FF +:109430005DFD032804D0D3DC012801D00228CFD160 +:1094400002E005E035E01CE0C9A0FBF7A3F9C7E79F +:10945000E079012801D0CDA0F7E7AF7086F87670EB +:1094600046F86CAFB249C6F804A0A6F808A0A068F8 +:109470003060E0687060AF7089F800706C31C8A02F +:109480005AE2E079012801D0CDA0DEE70220A870E1 +:10949000CFA0DAE7E179D3A0FBF77CF9D648D4F87E +:1094A000091040F8011FB4F80D108180E17B817133 +:1094B00096E7D2A0C9E7D7A0FBF76CF9207A01287C +:1094C0000FD0DAA1DBA0FBF765F9207A002887D15D +:1094D000A648022181710178002981D104210170FF +:1094E0007EE7D7A1EEE7DFF8848288F80770E0799D +:1094F000A0B1D5A0FBF74EF9E079012810D00028E3 +:10950000A5D1277AD4A03946FBF744F9D74A88F881 +:1095100005700D2F01F0158401F017BCD4A0E9E708 +:10952000257AD7A02946FBF735F9012D7CD0022DED +:109530007BD004F109001090042D77D0072D76D050 +:10954000062D75D0082D74D0092D73D00A2D72D038 +:109550000B2DADD00C2D6FD00D2D6ED04FF00A0815 +:109560000E2D6BD00F2D6AD0102D69D0112D68D023 +:10957000122D67D0132D66D0142D65D0162D7DD0F9 +:109580001D2D7CD01E2D7BD01F2D7AD0202D79D083 +:10959000212D78D0222D77D0232D76D0242D75D073 +:1095A000252D74D0262D73D0272D72D0282D71D063 +:1095B000292D70D02A2D6FD02B2D6ED0302D6DD04F +:1095C000312D6CD0322D6BD0332D6AD0342D69D033 +:1095D000352D68D0362D67D0372D66D0502D7BD0F5 +:1095E000512D7AD0522D79D0532D78D0542D77D05B +:1095F000552D76D0562D75D0572D74D0582D73D04B +:10960000592D72D05A2D71D0602D70D0612D6FD030 +:10961000622D6ED0632D6DD0642D6CD0652D6BD016 +:109620006D2D6AD011E0C9E252E163E176E186E195 +:109630008DE196E1ADE1C0E1C9E1D3E1E0E1EDE129 +:10964000F7E117E22DE239E24BE240F22F226E2DD4 +:1096500054D06F2D53D0702D52D0712D51D0722D0A +:1096600050D0732D4FD0742D4ED0752D4DD0762DFA +:109670004CD0772D4BD0782D4AD017E057E263E2DB +:1096800072E281E29BE29BE29BE29BE29BE29BE235 +:109690009BE29BE29BE29BE29BE29BE29BE29BE2E2 +:1096A0009BE29BE29BE29BE29BE29BE2792D30D026 +:1096B0007A2D2FD07B2D2ED07C2D2DD07D2D2CD012 +:1096C0007E2D2BD07F2D2AD0802D29D0812D28D002 +:1096D000822D27D0832DDBE085E285E285E285E2DD +:1096E00085E285E285E285E285E285E285E285E242 +:1096F00085E285E285E285E285E285E285E285E232 +:1097000085E285E285E285E285E285E285E285E221 +:1097100085E285E285E285E285E285E285E285E211 +:1097200085E285E285E20000F83500206907002027 +:10973000902A00200A0D44637263202530782C564D +:10974000637263202530780A0D0000000A0D20287E +:109750004463726320213D20566372632920726541 +:109760007475726E21212121210A0D007C070020D1 +:109770005265636569766520444344432073746190 +:1097800074652061636B0A0D0000000072656769F3 +:10979000737465726564206661696C65640A0D00A6 +:1097A0007265676973746572656420737563636558 +:1097B000737365642C436F64652025730A0D000084 +:1097C0004C6F67696E204661696C65640A0D000024 +:1097D0004C6F67696E205375636365737365640AC4 +:1097E0000D000000686561727420636F756E7420EF +:1097F00025640A0D000000002C0B002072656365D3 +:109800006976652073746174652064617461200AEF +:109810000D0000007265636569766520636861729A +:1098200067652064617461200A0D000044697361FA +:10983000626C65006368617267652025730A0D00BC +:10984000456E61626C650000706172616D207772B7 +:109850006974650A0D0000005265616420706172D0 +:10986000616D206E756D2025640A0D007234002034 +:10987000706172616D20726561640A0D0000000004 +:10988000706172616D20616464722025780A0D0038 +:1098900073D0842D72D0852D71D0862D70D0872DF8 +:1098A0006FD0882D6ED0892D6DD08A2D6CD08B2DE8 +:1098B0006BD08C2D6AD08D2D69D08E2D68D08F2DD8 +:1098C0007FF4C5ADB4F80910A6F8DA11D9A0E8E321 +:1098D000607A40B9022288F8062098F8002012B970 +:1098E000042288F80020012802D0D8A1D9A023E0C2 +:1098F000DCA1FBE7617ADD4C012907D0DCA0FAF797 +:1099000049FF04212046F4F760FD69E5DCA0FAF781 +:1099100041FF04212046F4F75AFD61E50446EEF7C5 +:1099200069FC82B2102A214605D2D948EEF72CFCF8 +:109930002146D8A0CBE7DCA0FAF72CFF50E5647AEB +:10994000E0A02146FAF726FFA6F869405AE1647ABA +:10995000E3A02146FAF71EFF26F84D4F7480B4802D +:10996000F4E7607A022803D086F86B70E2A080E307 +:10997000022086F86B00E6A0F9E7F0E3F0E3F0E3FD +:10998000F0E3F0E3F0E3F0E3F0E3F0E3F0E3F0E33F +:10999000F0E30446EEF72EFC82B2102A21460AD2EA +:1099A000BB481038EEF7F0FB2146DFA0FAF7F2FED5 +:1099B00089F80070CAE7E2A089E7607A012803D03D +:1099C00086F887A0E5A0D2E786F88770FAE7607A84 +:1099D000012803D086F889A0E6A0C8E786F8897038 +:1099E000ECA0C4E7617A642903D286F88A10F1A05A +:1099F0006DE7F6A0FAF7CEFE5A2086F88A00A5E7B2 +:109A0000647A4046B4FBF0F108FB1142B4FBF8F174 +:109A1000F4A0FAF7BFFE86F88B4097E7647AF7A0C8 +:109A20002146FAF7B7FE04EB8400400086F88C006C +:109A30008CE7B4F80940F7A02146FAF7ABFEB6F878 +:109A4000592004EB8400B2EB400F04D90BEA40002C +:109A5000A6F883007AE704EB84004100F1A0FAF74E +:109A600099FE36F8590F143880B2B0FBF8F17085C2 +:109A7000F3A061E7B4F80940F6A02146FAF78AFEA0 +:109A8000B6F85B2004EB8400B2EB400F04D90BEA7C +:109A90004000A6F8850059E704EB84004100F2A0DD +:109AA0008CE2B4F80940F6A02146FAF773FE04EB05 +:109AB00084010BEA4100A6F8590047E7B4F80940D1 +:109AC000F4A02146FAF766FE04EB84010BEA41009C +:109AD0004FF4FA71A6F85B00884290D9A6F85B10A3 +:109AE00034E7647AF0A02146FAF754FEF34D286873 +:109AF000EEF755FE81B2F2A0FAF74CFEF5488178F8 +:109B0000202901D920218170C9B201EBC10100EBEC +:109B100041012A68C1F80320817801EBC10100EB03 +:109B20004101A1F807408178491C817058E4B4F8DC +:109B300009004146B0FBF1F2B0FBF8F108FB12025C +:109B4000A6F86300E4A029E2607A012803D0022885 +:109B500001D0E7A079E486F88D00012802D0EAA1BF +:109B6000EAA0B4E6EEA1FBE7607A00EB80010BEA25 +:109B700041004146B0FBF1F2B0FBF8F108FB1202E4 +:109B8000A6F85300E7A009E2B6F89000B6F8531023 +:109B9000627A884211D94446B1FBF4F2B0FBF4F189 +:109BA000E6A0FAF7F7FDB6F853000A3880B2B0FB2A +:109BB000F4F1A6F89000ECA089E6E1E12BE3EEE1F8 +:109BC000FFE10EE212E21EE22AE232E23AE261E252 +:109BD00068E276E285E295E2A1E2B1E2B5E2B9E2BD +:109BE000C9E2DBE2EBE2F7E207E315E315E315E395 +:109BF00015E315E315E315E315E315E315E315E3A5 +:109C000015E315E314E214E314E314E314E314E39B +:109C100014E314E314E314E314E314E314E314E38C +:109C200014E314E314E314E314E314E314E314E37C +:109C300014E314E3536F6343616C69627261746986 +:109C40006F6E202025642020200A0D006469736156 +:109C5000626C65006368617267696E672025730ACC +:109C60000D000000656E61626C650000000C014033 +:109C70006F70656E2072656C61790A0D00000000DE +:109C8000636C6F73652072656C61790A0D0000006A +:109C9000A02A0020626C7565746F6F7468206E6115 +:109CA0006D652025730A0D00626C7565746F6F74A5 +:109CB00068206E616D65206D697374616B65202528 +:109CC000730A0D0048656172742042656174205406 +:109CD000696D6520256420207365630A0D0000000E +:109CE0004F76657254656D7056616C75652025649C +:109CF0002020200A0D000000424D532050524F54A6 +:109D00004F43414C204742323031310A0D000000B0 +:109D1000424D532050524F544F43414C2047423202 +:109D20003031350A0D000000537973506172615073 +:109D3000696C65442E736E3A25730A0D00000000AD +:109D40005379735061726150696C65442E736E2053 +:109D50006661756C742025730A0D00005175696386 +:109D60006B2043686172676520456E61626C650AAD +:109D70000D000000747269636B6C6520436861724A +:109D800067696E6720536F6320456E61626C652062 +:109D9000300A0D00747269636B6C652043686172F0 +:109DA00067696E6720536F6320456E61626C652042 +:109DB000310A0D00747269636B6C65436861726788 +:109DC000696E67536F6325640A0D000074726963DE +:109DD0006B6C654368617267696E67536F632039A6 +:109DE000300A0D00747269636B6C6520706F776563 +:109DF000722025642E25646B770A0D0074726963E6 +:109E00006B6C652063757272656E742564410A0D12 +:109E100000000000426D734D6178566F6C742564CC +:109E2000200A0D00256420426D734D6178566F6CD9 +:109E300074202564206661696C640A0D00000000CE +:109E4000426D52657175697265566F6C7420256438 +:109E5000200A0D00426D734D617843757272656E14 +:109E600074202564200A0D00726571202564206F1E +:109E7000766572206D6178202564200A0D0000004F +:109E8000426D734D6178566F6C74202564200A0D05 +:109E900000000000426D734D617843757272656E0B +:109EA000742564200A0D000073657474696E672060 +:109EB000736F63282564290A0D000000E81600204E +:109EC0004241545F566F6C746167652025640A0DCA +:109ED00000000000EC2C0020754261744D61784553 +:109EE0006E657267792025642E25640A0D000000D6 +:109EF0004368617267696E674D6F6465204661757E +:109F00006C740A0D00000000435600004368617243 +:109F100067696E674D6F64653A2573200A0D00000E +:109F2000434300004F766572506F776572203A2583 +:109F3000642E25646B77680A0D0000005265717508 +:109F4000697265506F776572202564206B77204FAA +:109F5000766572506F776572203A25646B772C6650 +:109F600061756C740A0D00005265717569726550F7 +:109F70006F776572202564206B77200A0D00000042 +:109F800002EB82010BEA41004146B0FBF1F2B0FB6B +:109F9000F8F108FB1202A6F89000B1A096E3607AEF +:109FA00000EB80010BEA41006421B0FBF1F201FB00 +:109FB0001202B0FBF1F1A6F8B300B0A0FAF7EAFB89 +:109FC000A3E4607A00EB80010BEA41006421B0FB5E +:109FD000F1F201FB1202B0FBF1F1A6F8B100AEA064 +:109FE00074E3617AA6F8B710B2A070E4B4F809007F +:109FF0004146B0FBF1F2B0FBF8F108FB1202A6F803 +:10A000005F00B0A062E3B4F809004146B0FBF1F292 +:10A01000B0FBF8F108FB1202A6F85900B0A055E316 +:10A02000647AB4A02146FAF7B5FB323486F8B5401D +:10A030004EE3647AB6A02146FAF7ACFB323486F8D8 +:10A04000B64045E3607A86F8B000012810D00228B7 +:10A0500010D0032810D0042810D0052810D00628CE +:10A0600010D0072810D0082810D0FF2810D02FE3D8 +:10A07000AEA0D4E3B3A0D2E3B8A0D0E3BEA0CEE3B9 +:10A08000C3A0CCE3C8A0CAE3CDA0C8E3D4A0C6E374 +:10A09000D9A0C4E3B4F80900A6F85D00B0FBF8F15C +:10A0A000DBA0D8E2617AA1F10A005A2803D886F829 +:10A0B0009310DCA0CFE2E4A0FAF76CFB86F893A043 +:10A0C00006E3B4F8091040F6C412A1F57A70904284 +:10A0D00005D8A6F8A610B1FBF8F1E1A0BBE2E8A014 +:10A0E000B9E2607A012808D086F8A8A096F8A800FE +:10A0F000012805D0ECA1EEA0ADE286F8A870F5E746 +:10A10000F2A1F8E7B4F809004146B0FBF1F2B0FB68 +:10A11000F8F108FB1202A6F86300EEA0D6E2B4F84C +:10A12000090000EB80010BEA41004146B0FBF1F26F +:10A13000B0FBF8F108FB1202A6F88E00EBA0C5E216 +:10A14000617AA6F84D10F0A0EBE3617AA6F84F1003 +:10A15000F3A0E6E3617AA6F85110F7A0E1E3EDE39E +:10A16000EDE3EDE3EDE3EDE3EDE3EDE3EDE3EDE36F +:10A17000EDE3EDE3EDE3607A012809D086F892A0E3 +:10A1800096F89200012806D0AFF66011F0A0C8E35F +:10A1900086F89270F4E7AFF65811F7E71121F2480C +:10A1A000EEF70BF8F04854F8091F953840F8951F62 +:10A1B0006168416021890181ECA01099B1E3EA480E +:10A1C00054F8091F953840F89F1FA1888180A17914 +:10A1D0008171ECA01099A4E3607A012808D086F878 +:10A1E00074A196F87401012805D0EEA1EFA098E3C0 +:10A1F00086F87471F5E7F2A1F8E7B4F80910A1F157 +:10A200003000FC2806D201EB81010BEA4100A6F8E0 +:10A210007501E0E1DCE19DE3E8E102E217E21BE227 +:10A220001FE239E255E25DE265E277E289E29BE214 +:10A23000B5E2D1E2E3E2FAE20BE31AE31FE323E340 +:10A2400028E32CE330E334E339E33DE341E345E342 +:10A2500049E34DE351E355E359E35DE368E37AE312 +:10A2600052657175697265506F776572203A256421 +:10A270002E25646B77680A0D00000000426174525D +:10A2800061746564566F6C74616765203A25642E4D +:10A290002564560A0D0000004261744D61784368E0 +:10A2A00061726765566F6C203A25642E2564560AE4 +:10A2B0000D000000426174436F756E74203A25648E +:10A2C0000A0D0000546F74616C43617061636974BE +:10A2D00079203A25642E256441480A0D00000000CB +:10A2E000426D734D6178566F6C743A25642E256407 +:10A2F000760A0D00754261744D617854656D705039 +:10A300006C75733530203A2564200A0D000000007A +:10A31000754261744D696E54656D70506C7573351E +:10A3200030203A2564200A0D000000007563426168 +:10A3300074547970653AC7A6CBE1B5E7B3D8200A63 +:10A340000D0000007563426174547970653AC4F879 +:10A35000C7E2B5E7B3D8200A0D000000756342617B +:10A3600074547970653AC1D7CBE1CCFAEFAEB5E75A +:10A37000B3D8200A0D0000007563426174547970EF +:10A38000653AC3CCCBE1EFAEB5E7B3D8200A0D00F8 +:10A390007563426174547970653AEEDCCBE1EFAEDF +:10A3A000B5E7B3D8200A0D00756342617454797023 +:10A3B000653AC8FDD4AAEFAEB5E7B3D8200A0D00C0 +:10A3C0007563426174547970653ABEDBBACFCEEFE3 +:10A3D000EFAEC0EBD7D3B5E7B3D8200A0D0000002D +:10A3E0007563426174547970653AEED1CBE1EFAE9A +:10A3F000B5E7B3D8200A0D007563426174547970D3 +:10A40000653AC6E4CBFBB5E7B3D8200A0D000000DF +:10A41000546F74616C566F6C746167653A25642083 +:10A42000200A0D0052657175697265566F6C746112 +:10A430006765446966666572656E6365282564298B +:10A4400056200A0D00000000202825642956206FA0 +:10A450007665722072616E6765200A0D000000004B +:10A4600053696D756C6174656443757272656E7461 +:10A47000426174566F6C74202564560A0D0000000A +:10A4800053696D756C6174656443757272656E7441 +:10A49000426174566F6C74202564562D2D31303016 +:10A4A0002D333530560A0D00434C4F534500000004 +:10A4B00025732044656275675F506167655F6675E7 +:10A4C0006E6374696F6E200A0D0000004F50454E98 +:10A4D00000000000754261744D6178456E657267D9 +:10A4E00079202564202E2564200A0D0053746F7096 +:10A4F000566F6C74616765203A25642E256420567A +:10A5000020200A0D000000004F76657254656D70C2 +:10A510003056616C75653A256420200A0D000000F4 +:10A520004F76657254656D703156616C75653A256C +:10A530006420200A0D0000004F76657254656D702E +:10A540003256616C75653A256420200A0D000000C2 +:10A550005369676E616C4C6F7373466C616720253D +:10A560007320200A0D000000252B00205665686925 +:10A5700063686C65496E666F28302D39293A2573FA +:10A580000A0D00005665686963686C65496E666F00 +:10A590002056494E2831302D3137293A25730A0D7E +:10A5A000000000006561737900000000576F726B56 +:10A5B0004D6F64656C20257320200A0D000000009B +:10A5C00070726F66657373696F6E616C0000000076 +:10A5D000E1A0FAF7DFF8B6F875014146B0FBF1F2F9 +:10A5E000B0FBF8F108FB1202E4A06FE0B4F8091028 +:10A5F000A1F10B00592806D201EB81010BEA4100C1 +:10A60000A6F8770102E0E4A0FAF7C4F8B6F87701FB +:10A610004146B0FBF1F2B0FBF8F108FB1202E8A0F2 +:10A6200054E0617AA1F10B008B2802D2A6F87911CF +:10A6300002E0E9A0FAF7AEF8B6F879014146B0FBBE +:10A64000F1F2B0FBF8F108FB1202EBA03EE0617AF8 +:10A6500086F87B11EEA064E1617A86F87C11F2A0A5 +:10A660005FE1B4F80910A1F13000CA2806D201EB6D +:10A6700081010BEA4100A6F87D0102E0EFA0FAF7A4 +:10A6800089F8B6F87D014146B0FBF1F2B0FBF8F174 +:10A6900008FB1202F2A019E0B4F80910A1F11400AD +:10A6A000512806D201EB81010BEA4100A6F87F0197 +:10A6B00002E0F2A0FAF76EF8B6F87F014146B0FB6F +:10A6C000F1F2B0FBF8F108FB1202F5A0FAF762F81C +:10A6D00029E1607A962801D286F8810196F88111E5 +:10A6E000F6A01EE1607A962801D286F8820196F8DB +:10A6F0008211F8A015E1607A012809D086F890A1AE +:10A7000096F89001012806D0AFF6E061F6A008E1C6 +:10A7100086F89071F4E7AFF6D861F7E7607A012820 +:10A7200009D086F887A196F88701012806D0AFF6F0 +:10A730000471F3A0F5E086F88771F4E7AFF60071D5 +:10A74000F7E7607A012809D086F888A196F8880191 +:10A75000012806D0AFF62C71EDA0E2E086F88871F2 +:10A76000F4E7AFF62471F7E7607A032804D886F897 +:10A770008901012803D005E086F889A1D3E0E9A08A +:10A78000FAF708F896F88901022802D1EAA0FAF748 +:10A7900001F896F8890103281DD1ECA03FE096F856 +:10A7A0008901B4F80940012803D12146ECA0F9F74A +:10A7B000F1FF96F88901022803D12146EEA0F9F7AE +:10A7C000E9FF96F88901032803D12146F0A0F9F7A3 +:10A7D000E1FFA6F88A41A6E0607A012809D086F850 +:10A7E0008CA196F88C01012806D0AFF6C071EEA0BE +:10A7F00097E086F88C71F4E7AFF6BC71F7E7607A02 +:10A80000012804D0022806D003280BD08BE086F85C +:10A810009771ECA003E0022086F89701EEA0F9F70B +:10A82000B9FF80E0032086F89701F0A0F7E7B4F8BD +:10A830000910A6F89811A1F1C9030846934205D260 +:10A8400000EB80020BEA4201A6F859100146ECA089 +:10A8500067E0B4F80910A1F1C900904205D201EBFC +:10A8600081020BEA4200A6F85D00A6F89A11ECA05E +:10A8700057E0B4F80910A6F89C11F1A051E0B4F823 +:10A880000910A6F89E1103E0B4F80910A6F8A0116B +:10A89000F5A046E0B4F80910A6F8A2110DE0B4F84E +:10A8A0000910A6F8A41108E0B4F80910A6F8A6113A +:10A8B00003E0B4F80910A6F8A811F3A031E0B4F849 +:10A8C0000910A6F8AA11F8E7B4F80910A6F8AC1117 +:10A8D000F3E7B4F80910A6F8AE11EEE7B4F80910E2 +:10A8E000A6F8B011E9E7B4F80910A6F8B211E4E748 +:10A8F000B4F80910A6F8B411DFE7B4F80910A6F807 +:10A90000B611DAE7B4F80910A6F8B811D5E7B4F82B +:10A910000910A6F8BA11D0E7B4F80910A6F8BC11CE +:10A92000E1A0F9F737FF89F8007013B0BDE8F08FA8 +:10A93000B4F80910A6F8BE11FEF7C8BFC5E1C9E119 +:10A94000CDE1D1E1D5E1D9E1DDE1E1E1E5E1E9E127 +:10A95000EDE1F1E14DE2B3E1444352657175697295 +:10A9600065566F6C742025643A4F766572283438CA +:10A970002D333030292020200A0D00004443526539 +:10A980007175697265566F6C743A25642E25642062 +:10A990005620200A0D00000044435265717569720B +:10A9A0006543757272656E742564413A4F766572BF +:10A9B0002831302D31303041292020200A0D00006F +:10A9C00044435265717569726543757272656E7440 +:10A9D000256441200A0D000044434D6178506F7793 +:10A9E00065722564203A4F76657228312D31356BBA +:10A9F0002909200A0D00000044434D6178506F770B +:10AA000065723A25642E2564206B77090A0D0000D3 +:10AA100044435F496E64756374616E636554656D2C +:10AA200070202564200A0D0044435F494742545476 +:10AA3000656D70202564200A0D00000044434D61BF +:10AA400078566F6C74202564563A4F7665722834B8 +:10AA5000382D32303056292020200A0D0000000009 +:10AA600044432044434D6178566F6C743A25642EFC +:10AA70002564205620200A0D000000004443204495 +:10AA8000434D617843757272656E7425643A4F76F2 +:10AA900065722832302D313130292020200A0D00F6 +:10AAA00044432044434D617843757272656E743A35 +:10AAB00025642E2564204120200A0D004361706129 +:10AAC000636974616E636554656D7031202564201F +:10AAD0000A0D00004443426F7854656D70322025A2 +:10AAE00064200A0D00000000446F75626C654261CD +:10AAF00074746572794D6F64652025730A0D0000CA +:10AB000056494E205472616E732025730A0D000061 +:10AB1000426C75655369676E616C4C6F7373257316 +:10AB20000A0D00004368617267654D6F64652D2DE5 +:10AB30006B77680A0D0000004368617267654D6FAE +:10AB400064652D2D74696D650A0D0000436861729E +:10AB500067654D6F64652D2D534F430A0D0000004E +:10AB60004368617267654D6F64652D6B7768282552 +:10AB700064290A0D000000004368617267654D6F2B +:10AB800064652D74696D65282564290A0D0000002F +:10AB90004368617267654D6F64652D534F43282587 +:10ABA00064290A0D000000006869676820766F6CF0 +:10ABB00074616765206D6F64756C652025730A0D7F +:10ABC00000000000536F6353696D756C61547970B8 +:10ABD000652D310A0D000000536F6353696D756C6C +:10ABE00061547970652D320A0D000000536F635374 +:10ABF000696D756C61547970652D330A0D00000024 +:10AC00000A0D20536F6353696D756C614D61785601 +:10AC10006F6C7420202564205620200A0D0000004F +:10AC20000A0D20536F6353696D756C614D696E56E3 +:10AC30006F6C7420202564205620200A0D0000002F +:10AC40000A0D20536F6343616C6962726174696FAE +:10AC50006E566F6C74202025642028302E312956C2 +:10AC600020200A0D000000000A0D20536F6343618D +:10AC70006C6962726174696F6E566F6C7420202506 +:10AC800064205620200A0D00536F6343616C696293 +:10AC9000726174696F6E566F6C7420202564205643 +:10ACA00020200A0D00000000536F6343616C69624D +:10ACB000726174696F6E2020256420200A0D0000E7 +:10ACC000B4F80910A6F8C01136E6B4F80910A6F8D1 +:10ACD000C21131E6B4F80910A6F8C4112CE6B4F894 +:10ACE0000910A6F8C61127E6B4F80910A6F8C8118D +:10ACF00022E6B4F80910A6F8CA111DE6B4F8091046 +:10AD0000A6F8CC1118E6B4F80910A6F8CE1113E68F +:10AD1000B4F80910A6F8D0110EE6B4F80910A6F898 +:10AD2000D21109E6B4F80910A6F8D41104E6B4F873 +:10AD30000910A6F8D611FFE5B4F80910A6F8D81145 +:10AD4000FAE588F805A0A2F802A09146A2F802A0B0 +:10AD500000F0FAF94FF00008DFF8B4B027E004EB98 +:10AD60000800002590F809A01BF8352051465245EF +:10AD700015D10BEBC50627A07278F9F70BFDB9F8D2 +:10AD8000023007F109004B44727818447168EDF7FE +:10AD9000FBF9B9F8020071780844A9F802006D1CAB +:10ADA000EDB2672DE0D308F1010000F0FF08B845CF +:10ADB000D5D3B9F80220B81C1044A9F8020041F21A +:10ADC0000500A9F80500E07989F80700494689F8E7 +:10ADD0000870002005E022180B18527A401C5A72A5 +:10ADE000C0B2B842F7D311AA69461348F2F712FA73 +:10ADF0009BE5E0790128FBD186F8B9A078210F48BE +:10AE0000EDF7DBF9F6F742FD0DA0FEF71EBB0000E3 +:10AE1000D40700207265616420706172616D2061E9 +:10AE2000646472203078257820706172616D206CC6 +:10AE3000656E2025640A0D00723400204A2B002024 +:10AE400052656365697665207265636F726473200D +:10AE500061636B0A0D0000000348B0F82B00002866 +:10AE600000D00120704700003E2A00207047418832 +:10AE700019B1806808B100207047012070474188EF +:10AE80000088814201D3012070470020704710B52F +:10AE90000380002444808160828002FB0312C0E9A9 +:10AEA0000321416110BD10B5044640880B46A0B196 +:10AEB000A06890B1A28818466169EDF765F9A1888C +:10AEC000606908446061E268904201D3A0686061F3 +:10AED0006088401E6080084610BD002010BD10B57F +:10AEE000044640882288904213D2A06888B1A28884 +:10AEF0002069EDF749F9A188206908442061E168DB +:10AF0000884201D3A06820616088401C60800120D5 +:10AF100010BD002010BD000030B5044687B00121EF +:10AF20000420F5F775FA01214804F5F759FA0420D1 +:10AF3000ADF8100003208DF812001820224D8DF876 +:10AF4000130004A92846F3F7BFF90820ADF8100054 +:10AF500048208DF8130004A92846F3F7B5F92620F8 +:10AF60008DF8140001218DF815108DF816108DF84C +:10AF7000171005A8F4F7E2FA0020ADF804000094D9 +:10AF8000ADF80600ADF80800ADF80C000C200F4C31 +:10AF9000ADF80A0069462046F8F782FD012240F22A +:10AFA00025512046F8F764FD012240F22441204655 +:10AFB000F8F75EFD01212046F8F7EFFC80212046DE +:10AFC000F8F7E2FC07B030BD000801400044004043 +:10AFD00070B5054686B001211120F5F719FA012157 +:10AFE000C804F5F7FDF94FF48060ADF810000324B4 +:10AFF0008DF812401820244E8DF8130004A9304615 +:10B00000F3F762F9F014ADF8100048208DF8130042 +:10B0100004A93046F3F758F934208DF814008DF860 +:10B0200015408DF8164001208DF8170005A8F4F79B +:10B0300085FA0020ADF80400ADF80600ADF8080070 +:10B04000ADF80C000C20114CADF80A0000956946D3 +:10B050002046F8F725FD01212046F8F79EFC012245 +:10B0600040F225512046F8F703FD012240F2266107 +:10B070002046F8F7FDFC012240F224412046F8F773 +:10B08000F7FC06B070BD000000100140004C00400D +:10B0900030B5054687B001213020F5F7B9F9012117 +:10B0A0000805F5F79DF94FF48050ADF81000032422 +:10B0B0008DF8124018208DF8130004A91E48F3F7EC +:10B0C00003F90420ADF8100048208DF8130004A9FE +:10B0D0001A48F3F7F9F835208DF8140001218DF89E +:10B0E00015108DF816408DF8171005A8F4F726FAFC +:10B0F0000020ADF80400ADF80600ADF80800ADF88A +:10B100000C000C200E4CADF80A0000956946204654 +:10B11000F8F7C6FC012240F225512046F8F7A8FCBA +:10B12000012240F224412046F8F7A2FC01212046EA +:10B13000F8F733FC07B030BD0010014000140140A7 +:10B1400000500040FDF734BF254810B5B0F8591045 +:10B150000A22B1FBF2F323490B80B0F85B30B3FB5A +:10B16000F2F34B80B0F88330B3FBF2F30B82B0F80C +:10B170005330B3FBF2F30B83B0F88E30B3FBF2F332 +:10B180008B82B0F88530B3FBF2F34B8290F88B30B2 +:10B19000B3FBF2F38B7690F88C30B3FBF2F3CB7603 +:10B1A000B0F89030B3FBF2F3CB82B0F8B130B3FB20 +:10B1B000F2F4B0F8B340B4FBF2F4B3FBF2F2CC8398 +:10B1C0008A8390F8B620323A81F8212090F8B52091 +:10B1D000323A81F8202090F8790181F8220010BDE0 +:10B1E000902A00200C36002070B5164E002505EB85 +:10B1F000450000EBC50006EB001494F8540003284A +:10B200001BD394F89100012803D122780421FBF785 +:10B2100067FD94F8910002280FD194F8AC00401C0F +:10B22000C0B284F8AC00022807D3032084F8910050 +:10B23000227804210120FBF753FD6D1CEDB2022D95 +:10B24000D5D370BDC0110020410142024303440424 +:10B25000450546064707480849004A014B024C038A +:10B260004D044E054F005007510852095302540334 +:10B27000550456055706580759085A0962006200D6 +:10B28000620062006200E60300000000596C0108E1 +:10B290009D6C0108BD6A010800000000000000006C +:10B2A000000000000000000001000000596C0108CF +:10B2B0009D6C0108BD6A010800000000000000004C +:10B2C000000000000000000000008A0202000200EE +:10B2D0007602B60302000500840340060200050062 +:10B2E0000E063A07020005001C076009020005006F +:10B2F000D8FF0000F8339F43D9FF000058699543F9 +:10B30000DAFF0000BA298C43DBFF0000C77B8343D0 +:10B31000DCFF000071BD7643DDFF0000A09A6743AB +:10B32000DEFF000000805943DFFF0000E75B4C4375 +:10B33000E0FF0000E71B4043E1FF00001BAF344388 +:10B34000E2FF00005A042A43E3FF00008B0C204375 +:10B35000E4FF00001DBA1643E5FF000042000E4363 +:10B36000E6FF0000B6D30543E7FF00007B54FC4234 +:10B37000E8FF0000C3F5ED42E9FF00005879E04224 +:10B38000EAFF000068D1D342EBFF0000E6EEC742BF +:10B39000ECFF0000AFC5BC42EDFF0000C749B24260 +:10B3A000EEFF00002E70A842EFFF0000B22E9F4279 +:10B3B000F0FF0000C07B9642F1FF00008A4E8E42F3 +:10B3C000F2FF0000AB9E8642F3FF00009AC87E4267 +:10B3D000F4FF000007307142F5FF0000FE65644293 +:10B3E000F6FF0000645D5842F7FF0000230A4D425B +:10B3F000F8FF0000C5604242F9FF00006D56384278 +:10B40000FAFF000048E12E42FBFF0000B5F725429D +:10B41000FCFF000000911D42FDFF0000DDA415426D +:10B42000FEFF00009F2B0E42FFFF0000011E07429F +:10B43000000000005A75004201000000A156F441CE +:10B44000020000005474E841030000005238DD415E +:10B4500004000000FC98D241050000004A8CC8415D +:10B4600006000000D509BF4107000000CE08B64124 +:10B4700008000000D881AD4109000000916DA54190 +:10B480000A00000039C59D410B00000075829641FD +:10B490000C0000008A9F8F410D000000F0168941CA +:10B4A0000E00000088E382410F00000069007A412D +:10B4B00010000000B7D16E411100000061326441FC +:10B4C00012000000CE195A41130000006F81504154 +:10B4D000140000007C6147411500000039B43E4172 +:10B4E000160000001973364117000000F6972E4130 +:10B4F000180000004F1E27411900000000002041E5 +:10B500001A000000DA3819411B00000028C412415B +:10B510001C000000939D0C411D00000020C106414D +:10B520001E000000022B01411F00000025AFF74064 +:10B5300020000000D786ED4021000000A1D6E340A6 +:10B54000220000009E98DA4023000000E7C6D140A8 +:10B5500024000000145CC940250000001153C140C4 +:10B5600026000000DFA6B94027000000FC52B240D0 +:10B57000280000001153AB4029000000DBA2A440CA +:10B580002A000000963E9E402B0000007D2298403D +:10B590002C0000000A4B92402D000000E1B48C40CA +:10B5A0002E000000E65C87402F0000001040824023 +:10B5B000300000002CB77A40310000006059714023 +:10B5C00032000000D06168403300000092CB5F4041 +:10B5D000340000001092574035000000DEB04F40AC +:10B5E00036000000E2234840370000002EE74040CC +:10B5F0003800000027F7394039000000DF4F3340A2 +:10B600003A00000063EE2C403B0000006CCF264067 +:10B610003C000000B3EF20403D000000984C1B4070 +:10B620003E00000054E315403F0000001CB11040F4 +:10B6300040000000D0B30B4041000000A7E80640E6 +:10B6400042000000D34D024043000000BEC1FB3F5A +:10B6500044000000FB3FF33F450000001B12EB3F9E +:10B66000460000002B35E33F47000000E8A4DB3F25 +:10B67000480000005F5ED43F490000004A5ECD3FB5 +:10B680004A000000B6A1C63F4B0000000326C03FA1 +:10B690004C0000003EE8B93F4D00000075E5B33FA7 +:10B6A0004E000000041CAE3F4F000000A488A83FDD +:10B6B00050000000062AA33F5100000037FD9D3FC7 +:10B6C000520000009300993F530000002332943F42 +:10B6D00054000000EF8F8F3F5500000001188B3F92 +:10B6E0005600000008C9863F5700000062A1823F53 +:10B6F000580000002D3E7D3F59000000AE81753F8F +:10B700005A0000004E0B6E3F5B0000001FD7663FE3 +:10B710005C0000002AE35F3F5D000000CF2C593F32 +:10B720005E00000018B2523F5F00000065704C3FA1 +:10B73000600000001765463F61000000DE8E403F5C +:10B74000620000001CEB3A3F63000000D977353FF0 +:10B75000640000006E34303F65000000931D2B3FF5 +:10B7600066000000A032263F670000009F71213F65 +:10B770006800000040D91C3F690000008C67183F3A +:10B780006A000000331B143F6B000000E5F20F3F1E +:10B790006C00000052ED0B3F6D0000002D09083FCA +:10B7A0006E000000CC45043F6F00000038A1003F50 +:10B7B000700000009335FA3E710000006362F33EB2 +:10B7C000720000008FC7EC3E730000007862E63E16 +:10B7D000740000007F30E03E75000000A531DA3EC5 +:10B7E00076000000FA61D43E770000007FC1CE3EB3 +:10B7F00078000000944DC93E790000003A06C43E2E +:10B800007A00000082E7BE3E7B0000006BF1B93E8B +:10B810007C0000005721B53E7D0000009678B03EC8 +:10B8200000C1814001C0804101C0804100C1814010 +:10B8300001C0804100C1814000C1814001C0804100 +:10B8400001C0804100C1814000C1814001C08041F0 +:10B8500000C1814001C0804101C0804100C18140E0 +:10B8600001C0804100C1814000C1814001C08041D0 +:10B8700000C1814001C0804101C0804100C18140C0 +:10B8800000C1814001C0804101C0804100C18140B0 +:10B8900001C0804100C1814000C1814001C08041A0 +:10B8A00001C0804100C1814000C1814001C0804190 +:10B8B00000C1814001C0804101C0804100C1814080 +:10B8C00000C1814001C0804101C0804100C1814070 +:10B8D00001C0804100C1814000C1814001C0804160 +:10B8E00000C1814001C0804101C0804100C1814050 +:10B8F00001C0804100C1814000C1814001C0804140 +:10B9000001C0804100C1814000C1814001C080412F +:10B9100000C1814001C0804101C0804100C181401F +:10B9200000C0C101C30302C2C60607C705C5C404DF +:10B93000CC0C0DCD0FCFCE0E0ACACB0BC90908C84F +:10B94000D81819D91BDBDA1A1EDEDF1FDD1D1CDC3F +:10B9500014D4D515D71716D6D21213D311D1D010AF +:10B96000F03031F133F3F23236F6F737F53534F49F +:10B970003CFCFD3DFF3F3EFEFA3A3BFB39F9F8380F +:10B9800028E8E929EB2B2AEAEE2E2FEF2DEDEC2CFF +:10B99000E42425E527E7E62622E2E323E12120E06F +:10B9A000A06061A163A3A26266A6A767A56564A45F +:10B9B0006CACAD6DAF6F6EAEAA6A6BAB69A9A868CF +:10B9C00078B8B979BB7B7ABABE7E7FBF7DBDBC7CBF +:10B9D000B47475B577B7B67672B2B373B17170B02F +:10B9E000509091519353529296565797559594541F +:10B9F0009C5C5D9D5F9F9E5E5A9A9B5B995958988F +:10BA0000884849894B8B8A4A4E8E8F4F8D4D4C8C7E +:10BA100044848545874746868242438341818040EE +:10BA20002003BC028A0258022602F401C2019001DE +:10BA30005E012C018873C00017801F0016801F0054 +:10BA400017811F0016811F0019801F0019811F0018 +:10BA50004B801F0012801F0012811F001C801F00DE +:10BA600063801F0098801F0007801F001E801F003A +:10BA70001C811F0098811F0029801F0000002200E8 +:10BA80002500340046004B0059006C007A00880005 +:10BA90008E00920096009A009E00A100A400A700CC +:10BAA000AA0020010D10030C110C0C04020202026A +:10BAB00001010101010080F186F187F194F18AF121 +:10BAC0008CF190F191F198F199F110FE11FE12FEB6 +:10BAD00013FE14FE15FE16FE17FE18FE90F198F1E7 +:10BAE00099F110FE11FE12FE13FE14FE15FE16FE55 +:10BAF00017FE18FE00001300210027002B002F0066 +:10BB0000330037003A003D004000430011000C00B4 +:10BB10000400020002000200020001000100010016 +:10BB20000100010010111419222E273E3128857FB3 +:10BB300042333043383600000000000001000000AE +:10BB400070C60108ED6F01080100000020C6010861 +:10BB5000AD7A01080100000018C601087D7A0108CD +:10BB60000100000064C60108957C01080100000086 +:10BB70005CC601088D7D01080100000050C6010867 +:10BB80008B7D01080100000028C60108897D01089D +:10BB90000100000034C601080D7A01080100000010 +:10BBA00044C60108798101080100000040C601086F +:10BBB000757A01080100000048C601085581010896 +:10BBC00000C1814001C0804101C0804100C181406D +:10BBD00001C0804100C1814000C1814001C080415D +:10BBE00001C0804100C1814000C1814001C080414D +:10BBF00000C1814001C0804101C0804100C181403D +:10BC000001C0804100C1814000C1814001C080412C +:10BC100000C1814001C0804101C0804100C181401C +:10BC200000C1814001C0804101C0804100C181400C +:10BC300001C0804100C1814000C1814001C08041FC +:10BC400001C0804100C1814000C1814001C08041EC +:10BC500000C1814001C0804101C0804100C18140DC +:10BC600000C1814001C0804101C0804100C18140CC +:10BC700001C0804100C1814000C1814001C08041BC +:10BC800000C1814001C0804101C0804100C18140AC +:10BC900001C0804100C1814000C1814001C080419C +:10BCA00001C0804100C1814000C1814001C080418C +:10BCB00000C1814001C0804101C0804100C181407C +:10BCC00000C0C101C30302C2C60607C705C5C4043C +:10BCD000CC0C0DCD0FCFCE0E0ACACB0BC90908C8AC +:10BCE000D81819D91BDBDA1A1EDEDF1FDD1D1CDC9C +:10BCF00014D4D515D71716D6D21213D311D1D0100C +:10BD0000F03031F133F3F23236F6F737F53534F4FB +:10BD10003CFCFD3DFF3F3EFEFA3A3BFB39F9F8386B +:10BD200028E8E929EB2B2AEAEE2E2FEF2DEDEC2C5B +:10BD3000E42425E527E7E62622E2E323E12120E0CB +:10BD4000A06061A163A3A26266A6A767A56564A4BB +:10BD50006CACAD6DAF6F6EAEAA6A6BAB69A9A8682B +:10BD600078B8B979BB7B7ABABE7E7FBF7DBDBC7C1B +:10BD7000B47475B577B7B67672B2B373B17170B08B +:10BD8000509091519353529296565797559594547B +:10BD90009C5C5D9D5F9F9E5E5A9A9B5B99595898EB +:10BDA000884849894B8B8A4A4E8E8F4F8D4D4C8CDB +:10BDB000448485458747468682424383418180404B +:10BDC000B3E4B5E7D7AEB5E7C1F7B3ACB9FD626D83 +:10BDD00073D0E8C7F3B5E7C1F72FD7EEB4F3B3E4F8 +:10BDE000B5E7B5E7C1F7202000000000BDD3CAD5F4 +:10BDF000B3B5C1BEB1A8CEC4B3ACCAB12000000077 +:10BE0000B3E4B5E7B2E5D7F9CEC2B6C8D2ECB3A376 +:10BE100000000000B3E4B5E7D7AECAE4B3F6B5E777 +:10BE2000D1B9B9FDD1B9B1A3BBA40000B3E4B5E762 +:10BE3000D7AEB3ACB9A6C2CAB1A3BBA40000000080 +:10BE4000B5E7B3D8BCD3C8C8BCCCB5E7C6F7D5B343 +:10BE5000C1AC0000D6F7BCCCB5E7C6F7D5B3C1ACD2 +:10BE600000000000564355D7B4CCACB7C7B3E4B517 +:10BE7000E7D7B4CCAC000000B3E4B5E7D7AEB5E784 +:10BE8000C1F7B2A8B6AF0000B3E4B5E7D7AEB6FECF +:10BE9000B4CEC6F4B6AF0000B5A5CCE5C7B7D1B9EE +:10BEA000B1A8BEAF00000000B5A5CCE5B5CDCEC2AF +:10BEB000B1A8BEAF00000000C8C8CAA7BFD8B1A8CB +:10BEC000BEAF0000B5A5CCE5B8DFCEC2B8E6BEAFC8 +:10BED00000000000BDD3CAD5B3E4B5E7D7AECAFDB4 +:10BEE000BEDDB1A8CEC4B3ACCAB10000464443B66F +:10BEF000FEB4CEC6F4B6AFB4CECAFDB3ACCAB10080 +:10BF0000B5A5CCE5B9FDD1B900000000B3A4C6DAEF +:10BF1000CEDEB5E7C1F7CDA3D6B90000B5E7B3D8FB +:10BF2000CEB4D7BCB1B8BAC300000000CAD5B5BD05 +:10BF3000B3E4B5E7D7AECDA3D6B9B3E4B5E7B1A8BE +:10BF4000CEC40000B5E7B3D8B0FCB1A3CFD5C8DBF1 +:10BF5000B6CF0000B8DFD1B9BBD8C2B7D6F7B1A30E +:10BF6000CFD5D5EFB6CF0000B5E7B3D8D6F7D5FD1E +:10BF7000D6F7B8BABDD3B4A5C6F7CEB4B1D5BACF4B +:10BF800000000000B5A5B4CEBCD3C8C8CAB1BCE49B +:10BF9000B3A4B9CAD5CF0000BEF8D4B5B9CAD5CFBD +:10BFA00000000000B5E7B3D8B0FCD7DCD1B9B2C906 +:10BFB000D1F9BBD8C2B7B9CAD5CF0000D7DCB5E735 +:10BFC000D1B9B9FDD1B9B9CAD5CF0000B5A5CCE575 +:10BFD000B9FDD1B9B9CAD5CF00000000B3B5C1BE13 +:10BFE00043414ECDA8D0C5B9CAD5CF00564355CD93 +:10BFF000A8D0C5B9CAD5CF00B8A8D6FAB5E7D4B489 +:10C00000B5CDB9CAD5CF0000464443CAE4C8EBB7A2 +:10C01000B4BDD3B9CAD5CF00464443CAE4B3F6B7DA +:10C02000B4BDD3B9CAD5CF00736F6320B8DFB9CA26 +:10C03000D5CF0000B5E7D4B4C4A3BFE9B9CAD5CF02 +:10C0400000000000B5A5CCE5D1B9B2EEB9CAD5CF94 +:10C0500000000000CEC2B2EEB9CAD5CF0000000089 +:10C06000B5E7C1F7B4ABB8D0C6F7B9CAD5CF0000B1 +:10C07000464443CAE4B3F6BCCCB5E7C6F7B9CAD563 +:10C08000CF000000B8DFD1B9BBB7C2B7BBA5CBF8B2 +:10C09000B9CAD5CF00000000B5E7B3D8B0FCB3E40F +:10C0A000B5E7D0C5BAC5D7B4CCACB2BBB6D40000E6 +:10C0B000D4A4B3E4CAA7B0DC00000000B5E7B3D84D +:10C0C000B5A5CCE5B5E7D1B9B2C9BCAFCFDFB6CF26 +:10C0D000CFDF0000B5A5CCE5CEC2B8D0B2C9BCAFA9 +:10C0E000CFDFB6CFCFDF0000B9FDB3E40000000022 +:10C0F000626F6F7374C9FDD1B9B5E7D1B9B2BBC670 +:10C10000A5C5E400D7DCB5E7D1B9C7B7D1B9BEAF93 +:10C11000B8E60000B5E7B3D8B5CDCEC2BEAFB8E63D +:10C1200000000000B5E7B3D8B8DFCEC2BEAFB8E6B6 +:10C1300000000000736F63B5CDBEAFB8E60000002D +:10C14000736F6320CCF8B1E4BEAFB8E60000000026 +:10C15000564355BDFBD6B9B3E4B5E70056B3B5C1F8 +:10C16000BEB5E7B3D8B0FCB3E4B5E7D7B4CCACB751 +:10C17000C72D2DBFECB3E4BFC9B3E4B5E7000000A1 +:10C18000B7C5B5E7B9FDC1F700000000B3E4B5E7F6 +:10C19000B9FDC1F700000000B5E7C1F7B2C9D1F998 +:10C1A00000000000B9FDCEC2BDB5D4D82FCDA3BBD1 +:10C1B000FA000000534F43B4EFB5BD313030CDA38A +:10C1C000BBFA0000B5E7B3D8B5E7C1F7D0E8C7F3CD +:10C1D000CEAA30CDA3BBFA00B3E4B5E7B4EFB5BD4A +:10C1E000C9E8B6A8534F43CDA3BBFA00B3E4B5E703 +:10C1F000C1F7B3CCB3ACCAB1CDA3BBFA0000000009 +:10C20000B3E4B5E7D7AECAE4B3F6B5E7D1B92DB913 +:10C21000FDD1B9CDA3BBFA00B3E4B5E7B4EFB5BD2A +:10C22000B5E7B3D8C8DDC1BFCDA3BBFA000000009D +:10C23000B3E4B5E7B4EFB5BDC9E8B6A8CAB1BCE48C +:10C24000CDA3BBFA00000000B3E4B5E7D7AEB8A8B1 +:10C25000D6FAB5E7D4B4323456C6BDCCA82D2DB32A +:10C26000E4B5E7CDA3BBFA00D0A1B3CCD0F2CDA307 +:10C27000BBFA000063616E20323A20737465702847 +:10C280002564292C207265636F7276657279282582 +:10C2900064292C206C61737420627573206F66664C +:10C2A000207469636B282564292020206C617374D5 +:10C2B000207265636F76657279207469636B2825D7 +:10C2C0006429210A0000000063616E20313A207366 +:10C2D000746570282564292C207265636F727665F9 +:10C2E0007279282564292C206C617374206275731F +:10C2F000206F6666207469636B282564292C2020D2 +:10C30000206C617374207265636F76657279207436 +:10C3100069636B28256429210A0000006E6D5F7235 +:10C3200065633A206E657725643A20414C3A25646E +:10C33000204E6574776F726B436F6D6D616E643AFA +:10C34000256420636F756E7465723A256420636F8F +:10C350006E74726F6C5F7374733A25640D0A00001B +:10C36000455F4E4D5F5354415455535F504F5745B1 +:10C37000524F464600000000455F4E4D5F5354410A +:10C380005455535F4E45544F46460000455F4E4D51 +:10C390005F5354415455535F574149545F4143548F +:10C3A000494F4E00455F4E4D5F5354415455535FC6 +:10C3B0004E45544F4E000000455F4E4D5F53544173 +:10C3C0005455535F574149545F535441525455504B +:10C3D00000000000455F4E4D5F5354415455535F7C +:10C3E0004E4554534C49454E540000006661756CEF +:10C3F000745F72656C61795F657272202000000065 +:10C400006661756C745F636F6D5F63637520200098 +:10C410006661756C745F636F6D5F76656368696391 +:10C420006C6500006661756C745F677269645F6952 +:10C430006E7075745F7265766572736500000000DA +:10C440006661756C745F677269645F6F757470752F +:10C45000745F726576657273650000006661756C65 +:10C46000745F666364635F66616E00006661756C2D +:10C47000745F677269645F766F6C745F756E646514 +:10C48000720000006661756C745F6C6F61645F6F51 +:10C49000766572006661756C745F74656D705F6F50 +:10C4A000766572006661756C745F677269645F635C +:10C4B0007572725F6F766572000000006661756C60 +:10C4C000745F677269645F766F6C745F6F766572B4 +:10C4D000000000006661756C745F706F7765723282 +:10C4E000345F6572720000006175785F756E646517 +:10C4F000725F766F6C5F6572720000006661756CCA +:10C50000745F6E6F5F637572720000006661756CB8 +:10C51000745F4261745F556E646572566F6C74002F +:10C52000B7E7C9C8B6C2D7AA20200000426174B5D7 +:10C53000E7D1B9B5CDD1B92020000000425553B59F +:10C54000E7D1B9B5CDD1B900425553D3D0D0A7B5B5 +:10C55000E7D1B9B9FDD1B900426174CBB2D3D0D023 +:10C56000A7B5E7D1B9B9FDD1B9000000425553CB09 +:10C57000B2CAB1B5E7D1B9B9FDD1B900426174CB46 +:10C58000B2CAB1B5E7D1B9B9FDD1B900B9FDCEC2D2 +:10C59000B9CAD5CF000000004275636BD3D0D0A7D5 +:10C5A000B5E7C1F7B9FDC1F7000000004275636B44 +:10C5B000CBB2CAB1B5E7C1F7B9FDC1F700000000C1 +:10C5C0004275636BB5E7C1F7D3B2BCFEB9FDC1F7E5 +:10C5D000000000000D0A3737375570642D2D74792F +:10C5E00070653A253078202C7665723A2530782CA3 +:10C5F00054627974653A2530782C204372633A2569 +:10C6000030782C5061673A2530782C506C656E3A42 +:10C610002530780D0A0000004F464644434443004D +:10C620004F4E44434443000053455441504E5057ED +:10C6300044000000434849504445434F44450000EE +:10C640004F46460043414E00414C5F4F4E000000B4 +:10C6500053455441504E5553455200005445535490 +:10C66000424D5300524541444D4153530000000098 +:10C670005345540094C60108000000201C0B000024 +:10C68000588B000850CC01081C0B0020E46C000003 +:10C69000EC470108D1BBE8030B32022DF0C00108C2 +:10C6A00016362CBF0108043668C20108063678BE6B +:10C6B0000108071A0C1832081AD41032091A88080F +:10C6C000320A46A4C101080B1930320C36C0BD0134 +:10C6D000080D1A4810320E1AEC10320F1A5C28326C +:10C6E000101A64382A111819082A12081918321356 +:10C6F0001A141032141A34882A1588191032161A8E +:10C70000181032171A080832181A70082A1918193E +:10C7100060321A1A3008321B1AD848321C1AB40870 +:10C72000321D1AF8B0421E190832321A44082A3350 +:10C73000D8190832341A1C0832351A503032361AD9 +:10C74000985832371AC4102A380819802A39F01933 +:10C75000182A3AE81930323B1ABC10323C1ACC1075 +:10C760002A3D101908323E1A8418323F1A54082AFA +:10C77000407019082A4110192032421A80582A4361 +:10C7800068190832441A60202A4510192032461AC6 +:10C7900028102A4730197832481AB01032491A4006 +:10C7A00010324A1ADC28424B1910324C1AE8202A5F +:10C7B0004D781918324E1AEC08324F1AB820325BF5 +:10C7C0001A2468325C1AA8102A5D681908325E1AA9 +:10C7D0000418325F1A34082A6060190832611A8C12 +:10C7E0000832621A14081184A24A04680D01020377 +:10C7F000040607080902040608106914B13A0F1C60 +:10C800002214F2FF0310E803091012017122011330 +:10C8100011FE1B0803E627ED02010821051E9903FE +:10C82000010810101A79081A30081A49081A91AA32 +:10C830001A21281A69101A39081A6A0812451C01A7 +:10C84000086B081AD9081A6C081E5D0101086D08EA +:10C850001A8D081A6E081AE5081A6F081A11581A64 +:10C8600070081A3D081A40601AD5401A41081AFD8E +:10C87000081A42081325FF1B0843081A4D081A44DA +:10C88000081A75081A45081A9D081A46081AC50894 +:10C890001A47081AED081A48081A15701A60081A7B +:10C8A00081501A66081AA11011220613E1FD8208B0 +:10C8B0001A12101AE8B4811A800C1AF4EC811A5278 +:10C8C00090A910DA5310DA5410DA511000091CD56F +:10C8D000FBB3B5D0ADD2E963030A1E3D6A0108710E +:10C8E00004092A34C11E60C3010878041AB8041A66 +:10C8F000A4041AD4041A8C0441180AA98A01089FB6 +:10C90000890108ED041AF1041A291061920213F04A +:10C91000FF6220021FA67A01E20530CA08E803324E +:10C920008336A181010885366DAE01088736B9923C +:10C930000108894BED8F982D94C40108651A84086D +:10C9400029A21ABC0829691A6C0832041AA40832F0 +:10C95000051A240832061A400832071AFC08320A5F +:10C960001A1008420C1908320B1A5C08320D1AD43E +:10C9700008320E1AE808320F36ECC30108104B0CCF +:10C98000C578811A6C1029801A480829801A7C08F9 +:10C9900029801A580829801AAC0829801A98082971 +:10C9A000801AC00829801A8C0829491A3C083209C3 +:10C9B0001A2C082990DA2060013C1464320112011B +:10C9C00002811F1E412B010871041A95041AC90423 +:10C9D0001AE9041B852CF819041AED041AB9041A73 +:10C9E000510400094E112D0108F535010823FFFF00 +:10C9F0000330E803230201130C0B5B2001085A03E8 +:10CA00000823051013B02A1B2004081AA0082306C7 +:10CA1000021ADD081A07081AF9081A08281AFB086A +:10CA20001A09201A90081A0A1013172B1B200F0836 +:10CA30001A1C081A0E081A1B081A0D081A1A081AC6 +:10CA40000C081A19085A0B601A13481AEB381A12F4 +:10CA5000081AE9081A11081A15201A10081A1308DA +:10CA60001A140829281A150813EC161B2016081A80 +:10CA7000F3281B17049819181A18481A40281A196D +:10CA8000101AB8101A1AFA1AC008231B111A2518FE +:10CA9000231C081AD9101A1F281322361B201E081F +:10CAA0001A24081A1D081A1D201A20081A2A101AFA +:10CAB00021081A28081A22081A47185A24901A23FB +:10CAC000081AEF085A27681A26081A2D281A250866 +:10CAD0001A2C081A28201AED201A29101A23201AB5 +:10CAE0002A101A36081A2B101A38085A30B01A3180 +:10CAF000081A20301A32181ADD101A33081ADF0803 +:10CB00001A34081AE1082A35A019304B360AB8231E +:10CB100037071A2F081A501813042C1B2051401ADB +:10CB200005081A52081A07081A53181A09081A543D +:10CB3000081A0B081A55081A0C081A56201A0D085C +:10CB40001A57081A0F081A58181A11081A59081AE9 +:10CB500012081A5A081A20081A60081A17081A61C7 +:10CB6000081A18081A62081A19081A63381A1A08D3 +:10CB70001A65101A1C081A66081A1D081A6D081A78 +:10CB800027081A6E201A28081A6F081A2A081A701D +:10CB9000081A2C081A71081A2E081A72081A300876 +:10CBA0001A73081A32081A74081A34081A75081AFF +:10CBB00036081A76081A38081A77081A3A081A78BE +:10CBC000081A3C081A79081A3E081A7A081A400806 +:10CBD0001A7B081A42081A7C081A44081A7D081A97 +:10CBE00046081A7E081A48081A7F081A4A081A8046 +:10CBF000081A4C081A81081A4E081A82081A500896 +:10CC00001A83081A52081A84081A54081A85081A2E +:10CC100056081A86081A58081A87081A5A081A88CD +:10CC2000081A5C081A89081A5E081A8A081A600825 +:10CC30001A8B081A62081A8C081A64081A8D081AC6 +:10CC400066081A8E081A68081A8F081A6A080110EE +:04000005080081511D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.htm b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.htm new file mode 100644 index 0000000..f7c7f97 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.htm @@ -0,0 +1,5836 @@ + + +Static Call Graph - [.\output\LED.axf] +
+

Static Call Graph for image .\output\LED.axf


+

#<CALLGRAPH># ARM Linker, 5060750: Last Updated: Thu May 30 17:33:48 2024 +

+

Maximum Stack Usage = 384 bytes + Unknown(Cycles, Untraceable Function Pointers)

+Call chain for Maximum Stack Depth:

+main ⇒ Blue_Receive_Parser ⇒ sHandleParsePkg ⇒ UpdProcess ⇒ BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +

+

+Mutually Recursive functions +

  • ADC1_2_IRQHandler   ⇒   ADC1_2_IRQHandler
    +
  • BusFault_Handler   ⇒   BusFault_Handler
    +
  • HardFault_Handler   ⇒   HardFault_Handler
    +
  • MemManage_Handler   ⇒   MemManage_Handler
    +
  • UsageFault_Handler   ⇒   UsageFault_Handler
    + +

    +

    +Function Pointers +

      +
    • ADC1_2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • BusFault_Handler from stm32f10x_it.o(i.BusFault_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN1_RX0_IRQHandler from bsp_can.o(i.CAN1_RX0_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN1_RX1_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN1_SCE_IRQHandler from bsp_can.o(i.CAN1_SCE_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN1_TX_IRQHandler from bsp_can.o(i.CAN1_TX_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN2_RX0_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN2_RX1_IRQHandler from bsp_can.o(i.CAN2_RX1_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN2_SCE_IRQHandler from bsp_can.o(i.CAN2_SCE_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN2_TX_IRQHandler from bsp_can.o(i.CAN2_TX_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • CAN_MSG_CB_SIG_FUNC from candrvctrl.o(i.CAN_MSG_CB_SIG_FUNC) referenced from candrvctrl.o(i.InitCanDrvCtrlMode) +
    • CAN_MSG_SIG_FUNC from candrvctrl.o(i.CAN_MSG_SIG_FUNC) referenced from candrvctrl.o(i.InitCanDrvCtrlMode) +
    • DMA1_Channel1_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel3_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel4_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel5_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel6_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA1_Channel7_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA2_Channel1_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA2_Channel2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA2_Channel3_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA2_Channel4_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DMA2_Channel5_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • DebugMon_Handler from stm32f10x_it.o(i.DebugMon_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • ETH_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • ETH_WKUP_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI0_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI15_10_IRQHandler from app_pwr_manage.o(i.EXTI15_10_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI1_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI3_IRQHandler from app_pwr_manage.o(i.EXTI3_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI4_IRQHandler from app_pwr_manage.o(i.EXTI4_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • EXTI9_5_IRQHandler from app_pwr_manage.o(i.EXTI9_5_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • FLASH_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • HardFault_Handler from stm32f10x_it.o(i.HardFault_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • I2C1_ER_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • I2C1_EV_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • I2C2_ER_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • I2C2_EV_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • MemManage_Handler from stm32f10x_it.o(i.MemManage_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • NMI_Handler from stm32f10x_it.o(i.NMI_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • OTG_FS_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • OTG_FS_WKUP_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • PVD_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • PendSV_Handler from stm32f10x_it.o(i.PendSV_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • QIRUI_NMmaster from can.o(i.QIRUI_NMmaster) referenced 2 times from can.o(.data) +
    • QIRUI_Parse100 from can.o(i.QIRUI_Parse100) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBCM1 from can.o(i.QIRUI_ParseBCM1) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS1 from can.o(i.QIRUI_ParseBMS1) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS10 from can.o(i.QIRUI_ParseBMS10) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS11 from can.o(i.QIRUI_ParseBMS11) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS12 from can.o(i.QIRUI_ParseBMS12) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS13 from can.o(i.QIRUI_ParseBMS13) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS14 from can.o(i.QIRUI_ParseBMS14) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS15 from can.o(i.QIRUI_ParseBMS15) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS16 from can.o(i.QIRUI_ParseBMS16) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS17 from can.o(i.QIRUI_ParseBMS17) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS18 from can.o(i.QIRUI_ParseBMS18) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS2 from can.o(i.QIRUI_ParseBMS2) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS24 from can.o(i.QIRUI_ParseBMS24) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS3 from can.o(i.QIRUI_ParseBMS3) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS4 from can.o(i.QIRUI_ParseBMS4) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS5 from can.o(i.QIRUI_ParseBMS5) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS6 from can.o(i.QIRUI_ParseBMS6) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS7 from can.o(i.QIRUI_ParseBMS7) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBMS9 from can.o(i.QIRUI_ParseBMS9) referenced 2 times from can.o(.data) +
    • QIRUI_ParseBattTempSensor18 from can.o(i.QIRUI_ParseBattTempSensor18) referenced 2 times from can.o(.data) +
    • QIRUI_ParseGW_VCU_1 from can.o(i.QIRUI_ParseGW_VCU_1) referenced 2 times from can.o(.data) +
    • QIRUI_ParseICM1 from can.o(i.QIRUI_ParseICM1) referenced 2 times from can.o(.data) +
    • QIRUI_ParseMCU_1 from can.o(i.QIRUI_ParseMCU_1) referenced 2 times from can.o(.data) +
    • QIRUI_ParseTBOX_2 from can.o(i.QIRUI_ParseTBOX_2) referenced 2 times from can.o(.data) +
    • RCC_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • RTCAlarm_IRQHandler from app_pwr_manage.o(i.RTCAlarm_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • RTC_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • Reset_Handler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • SPI1_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • SPI2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • SPI3_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • SVC_Handler from stm32f10x_it.o(i.SVC_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • SysTick_Handler from sys.o(i.SysTick_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • SystemInit from system_stm32f10x.o(i.SystemInit) referenced from startup_stm32f10x_cl.o(.text) +
    • TAMPER_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM1_BRK_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM1_CC_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM1_TRG_COM_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM1_UP_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM2_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM3_IRQHandler from timer.o(i.TIM3_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM4_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM5_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM6_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • TIM7_IRQHandler from startup_stm32f10x_cl.o(.text) referenced from startup_stm32f10x_cl.o(RESET) +
    • UART4_IRQHandler from usart.o(i.UART4_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • UART5_IRQHandler from usart.o(i.UART5_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • UDS_10_Service_Session_Control from uds_interface.o(i.UDS_10_Service_Session_Control) referenced 2 times from uds_interface.o(.data) +
    • UDS_11_Service_Ecu_Reset from uds_interface.o(i.UDS_11_Service_Ecu_Reset) referenced 2 times from uds_interface.o(.data) +
    • UDS_14_Service_Clear_DTC from uds_interface.o(i.UDS_14_Service_Clear_DTC) referenced 2 times from uds_interface.o(.data) +
    • UDS_19_Service_Read_DTC from uds_interface.o(i.UDS_19_Service_Read_DTC) referenced 2 times from uds_interface.o(.data) +
    • UDS_22_Service_Read_Data from uds_interface.o(i.UDS_22_Service_Read_Data) referenced 2 times from uds_interface.o(.data) +
    • UDS_27_Service_Security_Access from uds_interface.o(i.UDS_27_Service_Security_Access) referenced 2 times from uds_interface.o(.data) +
    • UDS_28_Service_Communication_Control from uds_interface.o(i.UDS_28_Service_Communication_Control) referenced 2 times from uds_interface.o(.data) +
    • UDS_2E_Service_Write_Data from uds_interface.o(i.UDS_2E_Service_Write_Data) referenced 2 times from uds_interface.o(.data) +
    • UDS_31_Service_Routine_Ctrl from uds_interface.o(i.UDS_31_Service_Routine_Ctrl) referenced 2 times from uds_interface.o(.data) +
    • UDS_3E_Service_Tester_Present from uds_interface.o(i.UDS_3E_Service_Tester_Present) referenced 2 times from uds_interface.o(.data) +
    • UDS_85_Service_Control_DTC from uds_interface.o(i.UDS_85_Service_Control_DTC) referenced 2 times from uds_interface.o(.data) +
    • UDS_Service_NRC from uds_interface.o(i.UDS_Service_NRC) referenced 2 times from uds_interface.o(.data) +
    • USART1_IRQHandler from usart.o(i.USART1_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • USART2_IRQHandler from usart.o(i.USART2_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • USART3_IRQHandler from usart.o(i.USART3_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • UsageFault_Handler from stm32f10x_it.o(i.UsageFault_Handler) referenced from startup_stm32f10x_cl.o(RESET) +
    • WWDG_IRQHandler from led.o(i.WWDG_IRQHandler) referenced from startup_stm32f10x_cl.o(RESET) +
    • __main from entry.o(.ARM.Collect$$$$00000000) referenced from startup_stm32f10x_cl.o(.text) +
    • _sputc from printfa.o(i._sputc) referenced from printfa.o(i.__0sprintf) +
    • can2_bus_error_cb from can_app.o(i.can2_bus_error_cb) referenced 2 times from can_app.o(.data) +
    • can2_comm_sent_cb from can_app.o(i.can2_comm_sent_cb) referenced 2 times from can_app.o(.data) +
    • can_bus_close from canbusdrv.o(i.can_bus_close) referenced 2 times from canbusdrv.o(.constdata) +
    • can_bus_open from canbusdrv.o(i.can_bus_open) referenced 2 times from canbusdrv.o(.constdata) +
    • can_bus_send_rt from canbusdrv.o(i.can_bus_send_rt) referenced 2 times from canbusdrv.o(.constdata) +
    • cmd_ADPrint from usart.o(i.cmd_ADPrint) referenced from usart.o(.constdata) +
    • cmd_DecodeUniquID from usart.o(i.cmd_DecodeUniquID) referenced from usart.o(.constdata) +
    • cmd_OFF from usart.o(i.cmd_OFF) referenced from usart.o(.constdata) +
    • cmd_OFFDCDCPrint from usart.o(i.cmd_OFFDCDCPrint) referenced from usart.o(.constdata) +
    • cmd_ONDCDCPrint from usart.o(i.cmd_ONDCDCPrint) referenced from usart.o(.constdata) +
    • cmd_PhoneTest from usart.o(i.cmd_PhoneTest) referenced from usart.o(.constdata) +
    • cmd_SetAPNPassword from usart.o(i.cmd_SetAPNPassword) referenced from usart.o(.constdata) +
    • cmd_SetAPNUser from usart.o(i.cmd_SetAPNUser) referenced from usart.o(.constdata) +
    • cmd_TT from usart.o(i.cmd_TT) referenced from usart.o(.constdata) +
    • cmd_al_on from usart.o(i.cmd_al_on) referenced from usart.o(.constdata) +
    • cmd_cansend from usart.o(i.cmd_cansend) referenced from usart.o(.constdata) +
    • control_cmd_proc from dc300.o(i.control_cmd_proc) referenced 2 times from dc300.o(.data) +
    • fputc from usart.o(i.fputc) referenced from printfa.o(i.__0printf) +
    • hdlIfBusErrorCb from candrvctrl.o(i.hdlIfBusErrorCb) referenced 2 times from candrvctrl.o(.data) +
    • hdlIfBusErrorStsCb from candrvctrl.o(i.hdlIfBusErrorStsCb) referenced 2 times from candrvctrl.o(.data) +
    • hdlIfBusOffCb from candrvctrl.o(i.hdlIfBusOffCb) referenced 2 times from candrvctrl.o(.data) +
    • hdlIfFrmReceve from candrvctrl.o(i.hdlIfFrmReceve) referenced 2 times from candrvctrl.o(.data) +
    • hdlIfSendSuccessCb from candrvctrl.o(i.hdlIfSendSuccessCb) referenced 2 times from candrvctrl.o(.data) +
    • main from main.o(i.main) referenced from entry9a.o(.ARM.Collect$$$$0000000B) +
    • param_update_firmware_cmd_proc from dc300.o(i.param_update_firmware_cmd_proc) referenced 2 times from dc300.o(.data) +
    • plCloseLink from candrvctrl.o(i.plCloseLink) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • plConfigBus from candrvctrl.o(i.plConfigBus) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • plGetCurrentLinkSts from candrvctrl.o(i.plGetCurrentLinkSts) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • plReceive from candrvctrl.o(i.plReceive) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • plSend from candrvctrl.o(i.plSend) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • plcanBusFilterInit from candrvctrl.o(i.plcanBusFilterInit) referenced from candrvctrl.o(i.InstallProtocalToIF) +
    • read_version_cmd_proc from dc300.o(i.read_version_cmd_proc) referenced 2 times from dc300.o(.data) +
    • set_param_cmd_proc from dc300.o(i.set_param_cmd_proc) referenced 2 times from dc300.o(.data) +
    • waitSendMsgAck from candrvctrl.o(i.waitSendMsgAck) referenced from candrvctrl.o(i.InitCanDrvCtrlMode) +
    +

    +

    +Global Symbols +

    +

    __main (Thumb, 0 bytes, Stack size unknown bytes, entry.o(.ARM.Collect$$$$00000000)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(.text) +
    +

    _main_stk (Thumb, 0 bytes, Stack size unknown bytes, entry2.o(.ARM.Collect$$$$00000001)) + +

    _main_scatterload (Thumb, 0 bytes, Stack size unknown bytes, entry5.o(.ARM.Collect$$$$00000004)) +

    [Calls]

    • >>   __scatterload +
    + +

    __main_after_scatterload (Thumb, 0 bytes, Stack size unknown bytes, entry5.o(.ARM.Collect$$$$00000004)) +

    [Called By]

    • >>   __scatterload +
    + +

    _main_clock (Thumb, 0 bytes, Stack size unknown bytes, entry7b.o(.ARM.Collect$$$$00000008)) + +

    _main_cpp_init (Thumb, 0 bytes, Stack size unknown bytes, entry8b.o(.ARM.Collect$$$$0000000A)) + +

    _main_init (Thumb, 0 bytes, Stack size unknown bytes, entry9a.o(.ARM.Collect$$$$0000000B)) + +

    __rt_final_cpp (Thumb, 0 bytes, Stack size unknown bytes, entry10a.o(.ARM.Collect$$$$0000000D)) + +

    __rt_final_exit (Thumb, 0 bytes, Stack size unknown bytes, entry11a.o(.ARM.Collect$$$$0000000F)) + +

    Reset_Handler (Thumb, 8 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    ADC1_2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +

    [Calls]

    • >>   ADC1_2_IRQHandler +
    +
    [Called By]
    • >>   ADC1_2_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN1_RX1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN2_RX0_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel6_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA1_Channel7_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA2_Channel1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA2_Channel2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA2_Channel3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA2_Channel4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    DMA2_Channel5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    ETH_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    ETH_WKUP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI0_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    FLASH_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    I2C1_ER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    I2C1_EV_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    I2C2_ER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    I2C2_EV_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    OTG_FS_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    OTG_FS_WKUP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    PVD_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    RCC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    RTC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    SPI1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    SPI2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    SPI3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TAMPER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM1_BRK_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM1_CC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM1_TRG_COM_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM1_UP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM6_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM7_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32f10x_cl.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    __aeabi_memcpy (Thumb, 36 bytes, Stack size 0 bytes, memcpya.o(.text)) +

    [Called By]

    • >>   BmsParaDataInit +
    • >>   bms_parseData +
    • >>   QIRUI_ParseBMS24 +
    • >>   sfifo_write +
    • >>   sfifo_read +
    • >>   plSend +
    • >>   plReceive +
    • >>   hdlIfFrmReceve +
    • >>   CAN_FRAME_INIT +
    • >>   UdsApi_MsgQueueIn +
    • >>   CAN_FRAME_INIT +
    • >>   SnapshotRecordLoad +
    • >>   Set0x31DiagData +
    • >>   Set0x2EDidDiagData +
    • >>   Get0x22SerDiagData +
    • >>   DTC_SignalInit +
    • >>   DID_SignalInit +
    • >>   UDS_Service_Response_Handler +
    • >>   UdsApi_ParaInit +
    • >>   UdsApi_MsgQueueOut +
    • >>   sHandleParsePkg +
    • >>   cmd_ADPrint +
    • >>   UpdataDebugInfoToServer +
    • >>   DP_PackageWriteDataFrame +
    • >>   Bluetooth_HeartBeat +
    + +

    __aeabi_memcpy4 (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text)) +

    [Called By]

    • >>   app_can_handle +
    • >>   BmsParaDataInit +
    • >>   UpdateDCFrame +
    • >>   SettingParamDCFrame +
    • >>   ReadDCVersion +
    • >>   ControlDCFrame +
    • >>   RegisterCanIF +
    • >>   app_qirui_nm_send_NM_Cache +
    • >>   InstallProtocalToIF +
    • >>   InitCanifToCanDrvCtrl +
    • >>   app_qirui_nm_send_NM +
    • >>   bms_SendBRM +
    • >>   bms_RcvCanSingleDataProc +
    • >>   bms_RcvCanMutliData +
    • >>   bms_RcvCan2DataProc +
    • >>   VinCalc +
    • >>   ClearDtc +
    + +

    __aeabi_memcpy8 (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED) + +

    __aeabi_memset (Thumb, 14 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Called By]

    • >>   bms_SendBST +
    • >>   bms_SendBSM +
    • >>   bms_SendBSD +
    • >>   bms_SendBRO +
    • >>   bms_SendBRM +
    • >>   bms_SendBHM +
    • >>   bms_SendBCS +
    • >>   bms_SendBCP +
    • >>   bms_SendBCL +
    • >>   UpdProcess +
    • >>   _memset$wrapper +
    • >>   __aeabi_memclr +
    + +

    __aeabi_memset4 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    __aeabi_memset8 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    __aeabi_memclr (Thumb, 4 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Calls]

    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   dc300FrameParser +
    • >>   BmsParaDataInit +
    • >>   AppCtrOnoffHandle +
    • >>   ClearDCModuleInfo +
    • >>   ClearDtc +
    • >>   UDS_Service_Response_Handler +
    • >>   UDS_Service_NRC +
    • >>   UDS_85_Service_Control_DTC +
    • >>   UDS_31_Service_Routine_Ctrl +
    • >>   UDS_28_Service_Communication_Control +
    • >>   UDS_14_Service_Clear_DTC +
    • >>   UDS_10_Service_Session_Control +
    • >>   UdsApi_ParaInit +
    • >>   sHandleParsePkg +
    • >>   cmd_ADPrint +
    + +

    __aeabi_memclr4 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Called By]

    • >>   app_can_init +
    • >>   app_can_handle +
    • >>   SysParaDataInit +
    • >>   BmsParaDataInit +
    • >>   Blue_Receive_Parser +
    • >>   AppCtrOnoffHandle +
    • >>   UpdateDCFrame +
    • >>   SettingParamDCFrame +
    • >>   ReadDCVersion +
    • >>   ControlDCFrame +
    • >>   control_cmd_proc +
    • >>   can_timer_init +
    • >>   can_signal_queue_init +
    • >>   plCloseLink +
    • >>   app_qirui_nm_init +
    • >>   InstallProtocalToIF +
    • >>   InitCanifToCanDrvCtrl +
    • >>   InitCanDrvCtrlMode +
    • >>   bms_SendBRM +
    • >>   bms_RcvCan2DataProc +
    • >>   sHandleParsePkg +
    • >>   Blue_Name_Cfg +
    + +

    __aeabi_memclr8 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    _memset$wrapper (Thumb, 18 bytes, Stack size 8 bytes, memseta.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_memset +
    + +

    strstr (Thumb, 36 bytes, Stack size 12 bytes, strstr.o(.text)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = strstr +
    +
    [Called By]
    • >>   Blue_Receive_Parser +
    • >>   ShellCommad +
    + +

    strlen (Thumb, 14 bytes, Stack size 0 bytes, strlen.o(.text)) +

    [Called By]

    • >>   main +
    • >>   sHandleParsePkg +
    • >>   Blue_Name_Cfg +
    + +

    memcmp (Thumb, 26 bytes, Stack size 12 bytes, memcmp.o(.text)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = memcmp +
    +
    [Called By]
    • >>   Blue_Receive_Parser +
    • >>   UDS_Service_27 +
    + +

    strcpy (Thumb, 18 bytes, Stack size 0 bytes, strcpy.o(.text)) +

    [Called By]

    • >>   SysParaDataInit +
    + +

    __aeabi_fadd (Thumb, 164 bytes, Stack size 16 bytes, fadd.o(.text)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   _float_round +
    • >>   _float_epilogue +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   Gun_Input_Sampling +
    • >>   BMS_Temperatrue_Sampling +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   Battery_Energy_Calculate +
    • >>   bms_SendBSM +
    • >>   QIRUI_DCDCState +
    • >>   __aeabi_fsub +
    • >>   cmd_ADPrint +
    • >>   BMS_ChargeInfo +
    • >>   __aeabi_frsub +
    + +

    __aeabi_fsub (Thumb, 6 bytes, Stack size 0 bytes, fadd.o(.text)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = __aeabi_fsub ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   __aeabi_fadd +
    +
    [Called By]
    • >>   cmd_ADPrint +
    + +

    __aeabi_frsub (Thumb, 6 bytes, Stack size 0 bytes, fadd.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_fadd +
    + +

    __aeabi_fmul (Thumb, 100 bytes, Stack size 8 bytes, fmul.o(.text)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __aeabi_fmul +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   Pwr_BatVoltRangeMonitor +
    • >>   Gun_Input_Sampling +
    • >>   BMS_Temperatrue_Sampling +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   can_write2 +
    • >>   UdsApi_VehicleInfo2UdsProc +
    + +

    __aeabi_fdiv (Thumb, 124 bytes, Stack size 8 bytes, fdiv.o(.text)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __aeabi_fdiv +
    +
    [Calls]
    • >>   _float_round +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   Gun_Input_Sampling +
    • >>   BMS_Temperatrue_Sampling +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   cmd_ADPrint +
    + +

    __ARM_scalbnf (Thumb, 24 bytes, Stack size 0 bytes, fscalb.o(.text)) +

    [Called By]

    • >>   VIN_Input_Sampling +
    • >>   Gun_Input_Sampling +
    • >>   BMS_Temperatrue_Sampling +
    + +

    scalbnf (Thumb, 0 bytes, Stack size 0 bytes, fscalb.o(.text), UNUSED) + +

    __aeabi_dadd (Thumb, 322 bytes, Stack size 48 bytes, dadd.o(.text)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_lasr +
    • >>   __aeabi_llsl +
    • >>   _double_round +
    • >>   _double_epilogue +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   __aeabi_dsub +
    • >>   __aeabi_drsub +
    • >>   _fp_digits +
    + +

    __aeabi_dsub (Thumb, 6 bytes, Stack size 0 bytes, dadd.o(.text)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = __aeabi_dsub ⇒ __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_dadd +
    +
    [Called By]
    • >>   BMS_Temperatrue_Sampling +
    • >>   QIRUI_ParseBMS3 +
    • >>   QIRUI_ParseBMS1 +
    + +

    __aeabi_drsub (Thumb, 6 bytes, Stack size 0 bytes, dadd.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_dadd +
    + +

    __aeabi_dmul (Thumb, 228 bytes, Stack size 48 bytes, dmul.o(.text)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   _double_epilogue +
    +
    [Called By]
    • >>   GetSampleVolt +
    • >>   Charger_ProtectCheck +
    • >>   QIRUI_ParseGW_VCU_1 +
    • >>   QIRUI_ParseBMS5 +
    • >>   QIRUI_ParseBMS3 +
    • >>   QIRUI_ParseBMS2 +
    • >>   QIRUI_ParseBMS1 +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   Battery_Energy_Calculate +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   BMS_ChargingDataInfo +
    • >>   _fp_digits +
    + +

    __aeabi_ddiv (Thumb, 222 bytes, Stack size 32 bytes, ddiv.o(.text)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = __aeabi_ddiv ⇒ _double_round +
    +
    [Calls]
    • >>   _double_round +
    +
    [Called By]
    • >>   GetSampleVolt +
    • >>   BMS_Temperatrue_Sampling +
    • >>   Battery_Energy_Calculate +
    • >>   _fp_digits +
    + +

    __ARM_scalbn (Thumb, 46 bytes, Stack size 16 bytes, dscalb.o(.text)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = __ARM_scalbn +
    +
    [Called By]
    • >>   QIRUI_ParseBMS9 +
    • >>   QIRUI_ParseBMS3 +
    + +

    scalbn (Thumb, 0 bytes, Stack size 16 bytes, dscalb.o(.text), UNUSED) + +

    __aeabi_i2f (Thumb, 18 bytes, Stack size 0 bytes, fflti.o(.text)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = __aeabi_i2f ⇒ _float_epilogue +
    +
    [Calls]
    • >>   _float_epilogue +
    +
    [Called By]
    • >>   Charger_ProtectCheck +
    • >>   BMS_Temperatrue_Sampling +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   Battery_Energy_Calculate +
    • >>   cmd_ADPrint +
    + +

    __aeabi_ui2f (Thumb, 10 bytes, Stack size 0 bytes, ffltui.o(.text)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = __aeabi_ui2f ⇒ _float_epilogue +
    +
    [Calls]
    • >>   _float_epilogue +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   Gun_Input_Sampling +
    • >>   Charger_ProtectCheck +
    • >>   BMS_Temperatrue_Sampling +
    • >>   AppCtrOnoffHandle +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   bms_SendBSM +
    • >>   cmd_ADPrint +
    + +

    __aeabi_i2d (Thumb, 34 bytes, Stack size 16 bytes, dflti.o(.text)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = __aeabi_i2d ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   _double_epilogue +
    +
    [Called By]
    • >>   QIRUI_ParseBMS3 +
    + +

    __aeabi_ui2d (Thumb, 26 bytes, Stack size 16 bytes, dfltui.o(.text)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = __aeabi_ui2d ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   _double_epilogue +
    +
    [Called By]
    • >>   GetSampleVolt +
    • >>   Charger_ProtectCheck +
    • >>   QIRUI_ParseGW_VCU_1 +
    • >>   QIRUI_ParseBMS9 +
    • >>   QIRUI_ParseBMS5 +
    • >>   QIRUI_ParseBMS2 +
    • >>   QIRUI_ParseBMS1 +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   BMS_ChargingDataInfo +
    + +

    __aeabi_f2iz (Thumb, 50 bytes, Stack size 0 bytes, ffixi.o(.text)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    • >>   debug_info +
    • >>   cmd_ADPrint +
    + +

    __aeabi_f2uiz (Thumb, 40 bytes, Stack size 0 bytes, ffixui.o(.text)) +

    [Called By]

    • >>   Pwr_BatVoltRangeMonitor +
    • >>   DCDC_Power_Handle +
    • >>   AppCtrOnoffHandle +
    • >>   debug_info +
    • >>   Battery_Soc_Calculate +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   can_write2 +
    • >>   bms_SendBSM +
    • >>   bms_SendBCS +
    • >>   QIRUI_DCDCState +
    • >>   FDC_General_Status_2 +
    • >>   UdsApi_VehicleInfo2UdsProc +
    • >>   sHandleParsePkg +
    • >>   cmd_TT +
    • >>   cmd_PhoneTest +
    • >>   BMS_ChargeInfo +
    + +

    __aeabi_d2iz (Thumb, 62 bytes, Stack size 16 bytes, dfixi.o(.text)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = __aeabi_d2iz +
    +
    [Calls]
    • >>   __aeabi_llsr +
    +
    [Called By]
    • >>   QIRUI_ParseBMS3 +
    + +

    __aeabi_d2uiz (Thumb, 50 bytes, Stack size 8 bytes, dfixui.o(.text)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __aeabi_d2uiz +
    +
    [Calls]
    • >>   __aeabi_llsr +
    +
    [Called By]
    • >>   QIRUI_ParseMCU_1 +
    • >>   QIRUI_ParseGW_VCU_1 +
    • >>   QIRUI_ParseBMS9 +
    • >>   QIRUI_ParseBMS5 +
    • >>   QIRUI_ParseBMS3 +
    • >>   QIRUI_ParseBMS2 +
    • >>   QIRUI_ParseBMS1 +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   Battery_Energy_Calculate +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   BMS_ChargingDataInfo +
    + +

    __aeabi_f2d (Thumb, 38 bytes, Stack size 0 bytes, f2d.o(.text)) +

    [Called By]

    • >>   VIN_Input_Sampling +
    • >>   GetSampleVolt +
    • >>   BMS_Temperatrue_Sampling +
    • >>   debug_info +
    • >>   Battery_Energy_Calculate +
    • >>   cmd_TT +
    • >>   cmd_ADPrint +
    + +

    __aeabi_cdrcmple (Thumb, 48 bytes, Stack size 0 bytes, cdrcmple.o(.text)) +

    [Called By]

    • >>   Charger_ProtectCheck +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   _fp_digits +
    + +

    __aeabi_d2f (Thumb, 56 bytes, Stack size 8 bytes, d2f.o(.text)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __aeabi_d2f +
    +
    [Calls]
    • >>   _float_round +
    +
    [Called By]
    • >>   VIN_Input_Sampling +
    • >>   GetSampleVolt +
    • >>   BMS_Temperatrue_Sampling +
    + +

    __aeabi_cfcmpeq (Thumb, 0 bytes, Stack size 0 bytes, cfcmple.o(.text), UNUSED) + +

    __aeabi_cfcmple (Thumb, 20 bytes, Stack size 0 bytes, cfcmple.o(.text)) +

    [Called By]

    • >>   Charger_ProtectCheck +
    • >>   FindTemperature +
    • >>   bms_SendBSM +
    + +

    __aeabi_cfrcmple (Thumb, 20 bytes, Stack size 0 bytes, cfrcmple.o(.text)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    • >>   FindTemperature +
    • >>   bms_SendBSM +
    + +

    __aeabi_uidiv (Thumb, 0 bytes, Stack size 12 bytes, uidiv.o(.text), UNUSED) + +

    __aeabi_uidivmod (Thumb, 44 bytes, Stack size 12 bytes, uidiv.o(.text), UNUSED) +

    [Called By]

    • >>   _printf_core +
    + +

    __aeabi_uldivmod (Thumb, 98 bytes, Stack size 40 bytes, uldiv.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_llsr +
    • >>   __aeabi_llsl +
    +
    [Called By]
    • >>   _printf_core +
    • >>   _fp_digits +
    + +

    __aeabi_llsl (Thumb, 30 bytes, Stack size 0 bytes, llshl.o(.text)) +

    [Called By]

    • >>   __aeabi_dadd +
    • >>   __aeabi_uldivmod +
    • >>   _double_epilogue +
    • >>   __aeabi_d2ulz +
    + +

    _ll_shift_l (Thumb, 0 bytes, Stack size 0 bytes, llshl.o(.text), UNUSED) + +

    __aeabi_llsr (Thumb, 32 bytes, Stack size 0 bytes, llushr.o(.text)) +

    [Called By]

    • >>   __aeabi_d2uiz +
    • >>   __aeabi_d2iz +
    • >>   __aeabi_uldivmod +
    • >>   _double_epilogue +
    • >>   __aeabi_d2ulz +
    + +

    _ll_ushift_r (Thumb, 0 bytes, Stack size 0 bytes, llushr.o(.text), UNUSED) + +

    __aeabi_lasr (Thumb, 36 bytes, Stack size 0 bytes, llsshr.o(.text)) +

    [Called By]

    • >>   __aeabi_dadd +
    + +

    _ll_sshift_r (Thumb, 0 bytes, Stack size 0 bytes, llsshr.o(.text), UNUSED) + +

    __I$use$fp (Thumb, 0 bytes, Stack size 0 bytes, iusefp.o(.text), UNUSED) + +

    _float_round (Thumb, 18 bytes, Stack size 0 bytes, fepilogue.o(.text)) +

    [Called By]

    • >>   __aeabi_d2f +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    + +

    _float_epilogue (Thumb, 92 bytes, Stack size 4 bytes, fepilogue.o(.text)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = _float_epilogue +
    +
    [Called By]
    • >>   __aeabi_ui2f +
    • >>   __aeabi_i2f +
    • >>   __aeabi_fadd +
    + +

    _double_round (Thumb, 30 bytes, Stack size 8 bytes, depilogue.o(.text)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = _double_round +
    +
    [Called By]
    • >>   __aeabi_dadd +
    • >>   __aeabi_ddiv +
    • >>   _double_epilogue +
    + +

    _double_epilogue (Thumb, 156 bytes, Stack size 32 bytes, depilogue.o(.text)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_llsr +
    • >>   __aeabi_llsl +
    • >>   _double_round +
    +
    [Called By]
    • >>   __aeabi_dadd +
    • >>   __aeabi_ui2d +
    • >>   __aeabi_i2d +
    • >>   __aeabi_dmul +
    + +

    __aeabi_d2ulz (Thumb, 48 bytes, Stack size 0 bytes, dfixul.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_llsr +
    • >>   __aeabi_llsl +
    +
    [Called By]
    • >>   _fp_digits +
    + +

    __scatterload (Thumb, 28 bytes, Stack size 0 bytes, init.o(.text)) +

    [Calls]

    • >>   __main_after_scatterload +
    +
    [Called By]
    • >>   _main_scatterload +
    + +

    __scatterload_rt2 (Thumb, 0 bytes, Stack size 0 bytes, init.o(.text), UNUSED) + +

    __decompress (Thumb, 0 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED) + +

    __decompress1 (Thumb, 86 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED) + +

    ADC1_GPIO_Config (Thumb, 50 bytes, Stack size 16 bytes, adc.o(i.ADC1_GPIO_Config)) +

    [Stack]

    • Max Depth = 36
    • Call Chain = ADC1_GPIO_Config ⇒ GPIO_Init +
    +
    [Calls]
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    +
    [Called By]
    • >>   ADC1_Init +
    + +

    ADC1_Init (Thumb, 14 bytes, Stack size 8 bytes, adc.o(i.ADC1_Init)) +

    [Stack]

    • Max Depth = 104
    • Call Chain = ADC1_Init ⇒ ADC1_Mode_Config ⇒ ADC_RegularChannelConfig +
    +
    [Calls]
    • >>   ADC1_Mode_Config +
    • >>   ADC1_GPIO_Config +
    +
    [Called By]
    • >>   main +
    + +

    ADC1_Mode_Config (Thumb, 240 bytes, Stack size 80 bytes, adc.o(i.ADC1_Mode_Config)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = ADC1_Mode_Config ⇒ ADC_RegularChannelConfig +
    +
    [Calls]
    • >>   DMA_Init +
    • >>   DMA_DeInit +
    • >>   DMA_Cmd +
    • >>   ADC_StartCalibration +
    • >>   ADC_SoftwareStartConvCmd +
    • >>   ADC_ResetCalibration +
    • >>   ADC_RegularChannelConfig +
    • >>   ADC_Init +
    • >>   ADC_GetResetCalibrationStatus +
    • >>   ADC_GetCalibrationStatus +
    • >>   ADC_DMACmd +
    • >>   ADC_Cmd +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_AHBPeriphClockCmd +
    +
    [Called By]
    • >>   ADC1_Init +
    + +

    ADC_Cmd (Thumb, 20 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_Cmd)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    • >>   SavePwrCfg +
    + +

    ADC_DMACmd (Thumb, 20 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_DMACmd)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADC_DeInit (Thumb, 56 bytes, Stack size 8 bytes, stm32f10x_adc.o(i.ADC_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = ADC_DeInit +
    +
    [Calls]
    • >>   RCC_APB2PeriphResetCmd +
    +
    [Called By]
    • >>   SavePwrCfg +
    • >>   AllDisable +
    + +

    ADC_GetCalibrationStatus (Thumb, 14 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_GetCalibrationStatus)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADC_GetResetCalibrationStatus (Thumb, 14 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_GetResetCalibrationStatus)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADC_Init (Thumb, 62 bytes, Stack size 8 bytes, stm32f10x_adc.o(i.ADC_Init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = ADC_Init +
    +
    [Called By]
    • >>   ADC1_Mode_Config +
    + +

    ADC_RegularChannelConfig (Thumb, 116 bytes, Stack size 16 bytes, stm32f10x_adc.o(i.ADC_RegularChannelConfig)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = ADC_RegularChannelConfig +
    +
    [Called By]
    • >>   ADC1_Mode_Config +
    + +

    ADC_ResetCalibration (Thumb, 10 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_ResetCalibration)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADC_SoftwareStartConvCmd (Thumb, 20 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_SoftwareStartConvCmd)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADC_StartCalibration (Thumb, 10 bytes, Stack size 0 bytes, stm32f10x_adc.o(i.ADC_StartCalibration)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    ADS1115Config_A (Thumb, 66 bytes, Stack size 16 bytes, ads1015.o(i.ADS1115Config_A)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = ADS1115Config_A ⇒ I2CWriteByte_A +
    +
    [Calls]
    • >>   I2CWriteByte_A +
    • >>   I2CStop_A +
    • >>   I2CStart_A +
    +
    [Called By]
    • >>   getad +
    + +

    ADS1115_Init (Thumb, 50 bytes, Stack size 8 bytes, ads1015.o(i.ADS1115_Init)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = ADS1115_Init ⇒ GPIO_Init +
    +
    [Calls]
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    +
    [Called By]
    • >>   main +
    + +

    AllDisable (Thumb, 138 bytes, Stack size 8 bytes, app_pwr_manage.o(i.AllDisable)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = AllDisable ⇒ CAN_DeInit +
    +
    [Calls]
    • >>   DMA_DeInit +
    • >>   CAN_DeInit +
    • >>   ADC_DeInit +
    • >>   GPIO_DeInit +
    • >>   USART_DeInit +
    • >>   TIM_DeInit +
    +
    [Called By]
    • >>   EnterSleepProcess +
    + +

    AppCtrOnoffHandle (Thumb, 2840 bytes, Stack size 40 bytes, can.o(i.AppCtrOnoffHandle)) +

    [Stack]

    • Max Depth = 152
    • Call Chain = AppCtrOnoffHandle ⇒ Battery_RequireVoltCur_Calculate ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   sIsFdcExistFault +
    • >>   __aeabi_f2uiz +
    • >>   __aeabi_f2iz +
    • >>   TickOut +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   Calculate_Absolute_Value +
    • >>   BmsParaDataInit +
    • >>   Battery_Soc_Calculate +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   Battery_Energy_Calculate +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_cfrcmple +
    • >>   TakeDCPowerOn +
    • >>   TakeDCPowerOff +
    • >>   IsDCDCPowerOn +
    • >>   Delay_MS +
    • >>   ClearDCPowerPowerComState +
    • >>   qiruibms_check_status +
    • >>   bms_check_status +
    • >>   bms_SendBST +
    • >>   bms_SendBSM +
    • >>   bms_SendBSD +
    • >>   bms_SendBRO +
    • >>   bms_SendBRM +
    • >>   bms_SendBHM +
    • >>   bms_SendBCS +
    • >>   bms_SendBCP +
    • >>   bms_SendBCL +
    • >>   __2printf +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memclr +
    +
    [Called By]
    • >>   main +
    + +

    BCD2HEX (Thumb, 18 bytes, Stack size 0 bytes, can.o(i.BCD2HEX)) +

    [Called By]

    • >>   CDZ_ParseCTS +
    + +

    BKP_DeInit (Thumb, 18 bytes, Stack size 8 bytes, stm32f10x_bkp.o(i.BKP_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = BKP_DeInit +
    +
    [Calls]
    • >>   RCC_BackupResetCmd +
    +
    [Called By]
    • >>   RTC_Int_Configuration +
    + +

    BKP_TamperPinCmd (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_bkp.o(i.BKP_TamperPinCmd)) +

    [Called By]

    • >>   LED_Init +
    + +

    BMS_ChargeInfo (Thumb, 462 bytes, Stack size 168 bytes, usart.o(i.BMS_ChargeInfo)) +

    [Stack]

    • Max Depth = 208
    • Call Chain = BMS_ChargeInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   TickOut +
    • >>   __aeabi_fadd +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    BMS_ChargingDataInfo (Thumb, 286 bytes, Stack size 168 bytes, usart.o(i.BMS_ChargingDataInfo)) +

    [Stack]

    • Max Depth = 256
    • Call Chain = BMS_ChargingDataInfo ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    BMS_StatusMessage (Thumb, 122 bytes, Stack size 144 bytes, usart.o(i.BMS_StatusMessage)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = BMS_StatusMessage ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    BMS_Temperatrue_Sampling (Thumb, 230 bytes, Stack size 48 bytes, adc.o(i.BMS_Temperatrue_Sampling)) +

    [Stack]

    • Max Depth = 136
    • Call Chain = BMS_Temperatrue_Sampling ⇒ __aeabi_dsub ⇒ __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_f2d +
    • >>   __aeabi_d2f +
    • >>   __ARM_scalbnf +
    • >>   FindTemperature +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_i2f +
    • >>   __aeabi_fmul +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    • >>   __aeabi_dsub +
    • >>   __aeabi_ddiv +
    +
    [Called By]
    • >>   main +
    + +

    BMS_Updata2ACKInfo (Thumb, 76 bytes, Stack size 144 bytes, usart.o(i.BMS_Updata2ACKInfo)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = BMS_Updata2ACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   debugdataprocess +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   UpdProcess +
    + +

    BMS_UpdataACKInfo (Thumb, 64 bytes, Stack size 144 bytes, usart.o(i.BMS_UpdataACKInfo)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   debugdataprocess +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   UpdProcess +
    + +

    BMS_VersionInfo (Thumb, 108 bytes, Stack size 136 bytes, usart.o(i.BMS_VersionInfo)) +

    [Stack]

    • Max Depth = 176
    • Call Chain = BMS_VersionInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    BSP_BKP_Init (Thumb, 46 bytes, Stack size 8 bytes, app_pwr_manage.o(i.BSP_BKP_Init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = BSP_BKP_Init +
    +
    [Calls]
    • >>   PWR_BackupAccessCmd +
    • >>   RCC_APB1PeriphClockCmd +
    +
    [Called By]
    • >>   main +
    + +

    Blue2CRC16 (Thumb, 38 bytes, Stack size 16 bytes, usart.o(i.Blue2CRC16)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = Blue2CRC16 +
    +
    [Called By]
    • >>   UpdProcess +
    + +

    BlueCRC16 (Thumb, 38 bytes, Stack size 16 bytes, usart.o(i.BlueCRC16)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = BlueCRC16 +
    +
    [Called By]
    • >>   sHandleParsePkg +
    • >>   DP_PackageWriteDataFrame +
    + +

    Blue_AT_Init (Thumb, 8 bytes, Stack size 0 bytes, usart.o(i.Blue_AT_Init)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Blue_AT_Init ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    +
    [Called By]
    • >>   BluetoothConnectProcess +
    + +

    Blue_Connect_State (Thumb, 8 bytes, Stack size 0 bytes, usart.o(i.Blue_Connect_State)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Blue_Connect_State ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    +
    [Called By]
    • >>   Bluetooth_Switch_Connecting +
    + +

    Blue_Name_Cfg (Thumb, 50 bytes, Stack size 40 bytes, usart.o(i.Blue_Name_Cfg)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = Blue_Name_Cfg ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    • >>   __2sprintf +
    • >>   strlen +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   Bluetooth_Switch_Config +
    + +

    Blue_Name_Query (Thumb, 8 bytes, Stack size 0 bytes, usart.o(i.Blue_Name_Query)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Blue_Name_Query ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    +
    [Called By]
    • >>   Bluetooth_Switch_Config +
    + +

    Blue_Query_UART_Cfg (Thumb, 8 bytes, Stack size 0 bytes, usart.o(i.Blue_Query_UART_Cfg)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Blue_Query_UART_Cfg ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    +
    [Called By]
    • >>   Bluetooth_Switch_PREPARE +
    + +

    Blue_Query_Version (Thumb, 8 bytes, Stack size 0 bytes, usart.o(i.Blue_Query_Version)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Blue_Query_Version ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_Write +
    +
    [Called By]
    • >>   Bluetooth_Switch_PREPARE +
    + +

    Blue_Receive_Parser (Thumb, 136 bytes, Stack size 16 bytes, usart.o(i.Blue_Receive_Parser)) +

    [Stack]

    • Max Depth = 360
    • Call Chain = Blue_Receive_Parser ⇒ sHandleParsePkg ⇒ UpdProcess ⇒ BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   sHandleParsePkg +
    • >>   memcmp +
    • >>   strstr +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   main +
    + +

    BluetoothConnectProcess (Thumb, 72 bytes, Stack size 8 bytes, usart.o(i.BluetoothConnectProcess)) +

    [Stack]

    • Max Depth = 288
    • Call Chain = BluetoothConnectProcess ⇒ BluetoothDataProcess ⇒ BMS_ChargingDataInfo ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   Bluetooth_Switch_PREPARE +
    • >>   Bluetooth_Switch_Connecting +
    • >>   Bluetooth_Switch_Config +
    • >>   BluetoothDataProcess +
    • >>   Blue_AT_Init +
    +
    [Called By]
    • >>   main +
    + +

    BluetoothDataProcess (Thumb, 264 bytes, Stack size 24 bytes, usart.o(i.BluetoothDataProcess)) +

    [Stack]

    • Max Depth = 280
    • Call Chain = BluetoothDataProcess ⇒ BMS_ChargingDataInfo ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   TickOut +
    • >>   bat_temp_Info +
    • >>   bat_state_code +
    • >>   bat_Cell_Vol_Info +
    • >>   Bluetooth_Registered +
    • >>   Bluetooth_Login +
    • >>   Bluetooth_HeartBeat +
    • >>   Bluetooth_DCDC_Data +
    • >>   BMS_VersionInfo +
    • >>   BMS_StatusMessage +
    • >>   BMS_ChargingDataInfo +
    • >>   BMS_ChargeInfo +
    +
    [Called By]
    • >>   BluetoothConnectProcess +
    + +

    Bluetooth_DCDC_Data (Thumb, 226 bytes, Stack size 152 bytes, usart.o(i.Bluetooth_DCDC_Data)) +

    [Stack]

    • Max Depth = 192
    • Call Chain = Bluetooth_DCDC_Data ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    Bluetooth_Data_Send (Thumb, 4 bytes, Stack size 0 bytes, usart.o(i.Bluetooth_Data_Send)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   RS232_Blue_DataWrite +
    +
    [Called By]
    • >>   DP_PackageWriteDataFrame +
    + +

    Bluetooth_HeartBeat (Thumb, 394 bytes, Stack size 144 bytes, usart.o(i.Bluetooth_HeartBeat)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = Bluetooth_HeartBeat ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    Bluetooth_Login (Thumb, 92 bytes, Stack size 80 bytes, usart.o(i.Bluetooth_Login)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = Bluetooth_Login ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    Bluetooth_Registered (Thumb, 62 bytes, Stack size 80 bytes, usart.o(i.Bluetooth_Registered)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = Bluetooth_Registered ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    Bluetooth_Switch_Config (Thumb, 70 bytes, Stack size 8 bytes, usart.o(i.Bluetooth_Switch_Config)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = Bluetooth_Switch_Config ⇒ Blue_Name_Cfg ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   Blue_Name_Query +
    • >>   Blue_Name_Cfg +
    +
    [Called By]
    • >>   BluetoothConnectProcess +
    + +

    Bluetooth_Switch_Connecting (Thumb, 34 bytes, Stack size 8 bytes, usart.o(i.Bluetooth_Switch_Connecting)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = Bluetooth_Switch_Connecting ⇒ Blue_Connect_State ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   Blue_Connect_State +
    +
    [Called By]
    • >>   BluetoothConnectProcess +
    + +

    Bluetooth_Switch_PREPARE (Thumb, 60 bytes, Stack size 8 bytes, usart.o(i.Bluetooth_Switch_PREPARE)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = Bluetooth_Switch_PREPARE ⇒ Blue_Query_Version ⇒ RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   TickOut +
    • >>   Blue_Query_Version +
    • >>   Blue_Query_UART_Cfg +
    +
    [Called By]
    • >>   BluetoothConnectProcess +
    + +

    BmsParaDataInit (Thumb, 278 bytes, Stack size 32 bytes, can.o(i.BmsParaDataInit)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = BmsParaDataInit +
    +
    [Calls]
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy4 +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    • >>   main +
    + +

    BusFault_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.BusFault_Handler)) +

    [Calls]

    • >>   BusFault_Handler +
    +
    [Called By]
    • >>   BusFault_Handler +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN1_RX0_IRQHandler (Thumb, 26 bytes, Stack size 24 bytes, bsp_can.o(i.CAN1_RX0_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = CAN1_RX0_IRQHandler ⇒ CAN_Receive +
    +
    [Calls]
    • >>   CAN_Receive +
    • >>   bsp_can_msg_receive_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN1_SCE_IRQHandler (Thumb, 96 bytes, Stack size 16 bytes, bsp_can.o(i.CAN1_SCE_IRQHandler)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = CAN1_SCE_IRQHandler ⇒ CAN_ClearITPendingBit +
    +
    [Calls]
    • >>   CAN_GetITStatus +
    • >>   CAN_GetFlagStatus +
    • >>   CAN_ClearITPendingBit +
    • >>   can_bus_off_hook +
    • >>   can_bus_err_passive_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN1_TX_IRQHandler (Thumb, 106 bytes, Stack size 8 bytes, bsp_can.o(i.CAN1_TX_IRQHandler)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = CAN1_TX_IRQHandler ⇒ CAN_ClearITPendingBit +
    +
    [Calls]
    • >>   CAN_TransmitStatus +
    • >>   CAN_ClearITPendingBit +
    • >>   bsp_can_msg_sent_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN2_Mode_Init (Thumb, 326 bytes, Stack size 56 bytes, bsp_can.o(i.CAN2_Mode_Init)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = CAN2_Mode_Init ⇒ __2printf +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   CAN_OperatingModeRequest +
    • >>   CAN_Init +
    • >>   CAN_ITConfig +
    • >>   CAN_FilterInit +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   SYS_EXIT_CRITICAL +
    • >>   SYS_ENTER_CRITICAL +
    • >>   __2printf +
    +
    [Called By]
    • >>   bsp_can_open +
    + +

    CAN2_RX1_IRQHandler (Thumb, 34 bytes, Stack size 24 bytes, bsp_can.o(i.CAN2_RX1_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = CAN2_RX1_IRQHandler ⇒ CAN_Receive +
    +
    [Calls]
    • >>   CAN_Receive +
    • >>   bsp_can_msg_receive_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN2_SCE_IRQHandler (Thumb, 112 bytes, Stack size 16 bytes, bsp_can.o(i.CAN2_SCE_IRQHandler)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = CAN2_SCE_IRQHandler ⇒ CAN_ClearITPendingBit +
    +
    [Calls]
    • >>   CAN_GetITStatus +
    • >>   CAN_GetFlagStatus +
    • >>   CAN_ClearITPendingBit +
    • >>   CAN_ClearFlag +
    • >>   can_bus_off_hook +
    • >>   can_bus_err_passive_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN2_TX_IRQHandler (Thumb, 106 bytes, Stack size 8 bytes, bsp_can.o(i.CAN2_TX_IRQHandler)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = CAN2_TX_IRQHandler ⇒ CAN_ClearITPendingBit +
    +
    [Calls]
    • >>   CAN_TransmitStatus +
    • >>   CAN_ClearITPendingBit +
    • >>   bsp_can_msg_sent_hook +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    CAN_ClearFlag (Thumb, 44 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_ClearFlag)) +

    [Called By]

    • >>   CAN2_SCE_IRQHandler +
    + +

    CAN_ClearITPendingBit (Thumb, 116 bytes, Stack size 12 bytes, stm32f10x_can.o(i.CAN_ClearITPendingBit)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = CAN_ClearITPendingBit +
    +
    [Called By]
    • >>   CAN2_TX_IRQHandler +
    • >>   CAN2_SCE_IRQHandler +
    • >>   CAN1_TX_IRQHandler +
    • >>   CAN1_SCE_IRQHandler +
    + +

    CAN_DeInit (Thumb, 38 bytes, Stack size 8 bytes, stm32f10x_can.o(i.CAN_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CAN_DeInit +
    +
    [Calls]
    • >>   RCC_APB1PeriphResetCmd +
    +
    [Called By]
    • >>   bsp_can_close +
    • >>   AllDisable +
    + +

    CAN_FilterInit (Thumb, 194 bytes, Stack size 20 bytes, stm32f10x_can.o(i.CAN_FilterInit)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = CAN_FilterInit +
    +
    [Called By]
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    + +

    CAN_GetFlagStatus (Thumb, 52 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_GetFlagStatus)) +

    [Called By]

    • >>   CAN2_SCE_IRQHandler +
    • >>   CAN1_SCE_IRQHandler +
    + +

    CAN_GetITStatus (Thumb, 162 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_GetITStatus)) +

    [Calls]

    • >>   CheckITStatus +
    +
    [Called By]
    • >>   CAN2_SCE_IRQHandler +
    • >>   CAN1_SCE_IRQHandler +
    + +

    CAN_ITConfig (Thumb, 16 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_ITConfig)) +

    [Called By]

    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    + +

    CAN_Init (Thumb, 232 bytes, Stack size 8 bytes, stm32f10x_can.o(i.CAN_Init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CAN_Init +
    +
    [Called By]
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    + +

    CAN_Mode_Init (Thumb, 308 bytes, Stack size 56 bytes, bsp_can.o(i.CAN_Mode_Init)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = CAN_Mode_Init ⇒ __2printf +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   CAN_OperatingModeRequest +
    • >>   CAN_Init +
    • >>   CAN_ITConfig +
    • >>   CAN_FilterInit +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   __2printf +
    +
    [Called By]
    • >>   bsp_can_open +
    + +

    CAN_OperatingModeRequest (Thumb, 140 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_OperatingModeRequest)) +

    [Called By]

    • >>   bsp_can_close +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    + +

    CAN_Receive (Thumb, 142 bytes, Stack size 8 bytes, stm32f10x_can.o(i.CAN_Receive)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CAN_Receive +
    +
    [Called By]
    • >>   CAN2_RX1_IRQHandler +
    • >>   CAN1_RX0_IRQHandler +
    + +

    CAN_Transmit (Thumb, 164 bytes, Stack size 12 bytes, stm32f10x_can.o(i.CAN_Transmit)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = CAN_Transmit +
    +
    [Called By]
    • >>   bsp_can_msg_send +
    + +

    CAN_TransmitStatus (Thumb, 88 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CAN_TransmitStatus)) +

    [Called By]

    • >>   CAN2_TX_IRQHandler +
    • >>   CAN1_TX_IRQHandler +
    + +

    CRC16 (Thumb, 38 bytes, Stack size 16 bytes, dc300.o(i.CRC16)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = CRC16 +
    +
    [Called By]
    • >>   dc300FrameParser +
    • >>   UpdateDCFrame +
    • >>   SettingParamDCFrame +
    • >>   ReadDCVersion +
    • >>   ControlDCFrame +
    + +

    CRC16_DataCheck (Thumb, 18 bytes, Stack size 12 bytes, crc.o(i.CRC16_DataCheck)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = CRC16_DataCheck ⇒ CRC_Cal16_WithCfg +
    +
    [Calls]
    • >>   CRC_Cal16_WithCfg +
    +
    [Called By]
    • >>   DTC_SignalInit +
    • >>   DID_SignalInit +
    + +

    CRC_Cal16_WithCfg (Thumb, 52 bytes, Stack size 16 bytes, crc.o(i.CRC_Cal16_WithCfg)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = CRC_Cal16_WithCfg +
    +
    [Called By]
    • >>   GetFaultInfo +
    • >>   DiagDIDStoreFlash +
    • >>   ClearDtc +
    • >>   CRC16_DataCheck +
    + +

    Calculate_Absolute_Value (Thumb, 26 bytes, Stack size 0 bytes, sys.o(i.Calculate_Absolute_Value)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    • >>   debug_info +
    • >>   Battery_Soc_AnalogCalculate +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   fdc_check_download_status +
    + +

    CanRxConStatus (Thumb, 4 bytes, Stack size 0 bytes, uds_interface.o(i.CanRxConStatus)) +

    [Called By]

    • >>   TxQueueCan0Out +
    + +

    CharToSemiHex (Thumb, 42 bytes, Stack size 0 bytes, usart.o(i.CharToSemiHex)) +

    [Called By]

    • >>   StringToInt +
    + +

    Charger_ProtectCheck (Thumb, 1234 bytes, Stack size 40 bytes, sys.o(i.Charger_ProtectCheck)) +

    [Stack]

    • Max Depth = 128
    • Call Chain = Charger_ProtectCheck ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   GPIO_ReadInputDataBit +
    • >>   __aeabi_cdrcmple +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_ui2d +
    • >>   __aeabi_i2f +
    • >>   __aeabi_dmul +
    • >>   __aeabi_cfcmple +
    • >>   TakeDCPowerOff +
    • >>   Delay_MS +
    +
    [Called By]
    • >>   main +
    + +

    CheckDtcHsCanError (Thumb, 64 bytes, Stack size 16 bytes, diagnosis_mid.o(i.CheckDtcHsCanError)) +

    [Stack]

    • Max Depth = 156
    • Call Chain = CheckDtcHsCanError ⇒ HAL_UDS_Tx_Callback ⇒ TP_D_UUData_Confirm ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Tx_Callback +
    • >>   IgnChangeProcess +
    • >>   GetFaultInfo +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    CheckIsBatteryHigh (Thumb, 14 bytes, Stack size 0 bytes, diagnosis_mid.o(i.CheckIsBatteryHigh)) +

    [Called By]

    • >>   DiagFaultsMonitor +
    + +

    CheckIsBatteryLow (Thumb, 14 bytes, Stack size 0 bytes, diagnosis_mid.o(i.CheckIsBatteryLow)) +

    [Called By]

    • >>   DiagFaultsMonitor +
    + +

    CheckIsBeyonSession (Thumb, 20 bytes, Stack size 0 bytes, uds_interface.o(i.CheckIsBeyonSession)) +

    [Called By]

    • >>   UDS_Service_85 +
    • >>   UDS_Service_31 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_27 +
    • >>   UDS_Service_14 +
    • >>   UDS_Service_0x2E_Response +
    • >>   UDS_Service_0x19_Response +
    + +

    CheckIsCanBusoff (Thumb, 14 bytes, Stack size 0 bytes, diagnosis_mid.o(i.CheckIsCanBusoff)) +

    [Called By]

    • >>   DiagFaultsMonitor +
    + +

    CheckIsIgnON (Thumb, 14 bytes, Stack size 0 bytes, diagnosis_mid.o(i.CheckIsIgnON)) +

    [Called By]

    • >>   DiagFaultsMonitor +
    + +

    CheckIsSupportSubFunc_Sid11 (Thumb, 16 bytes, Stack size 0 bytes, uds_interface.o(i.CheckIsSupportSubFunc_Sid11)) +

    [Called By]

    • >>   UDS_Service_11 +
    + +

    CheckIsSupportSubFunc_Sid19 (Thumb, 28 bytes, Stack size 0 bytes, uds_interface.o(i.CheckIsSupportSubFunc_Sid19)) +

    [Called By]

    • >>   UDS_Service_0x19_Response +
    + +

    CheckNetworkManageFrameFlagTimeout (Thumb, 62 bytes, Stack size 8 bytes, can.o(i.CheckNetworkManageFrameFlagTimeout)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = CheckNetworkManageFrameFlagTimeout ⇒ ChkPwrManageAccoff +
    +
    [Calls]
    • >>   TickOut +
    • >>   ChkPwrManageAccoff +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    CheckQiruiBMSWarningState (Thumb, 250 bytes, Stack size 12 bytes, can.o(i.CheckQiruiBMSWarningState)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = CheckQiruiBMSWarningState +
    +
    [Called By]
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    + +

    CheckSubSidNeedPosResp (Thumb, 12 bytes, Stack size 0 bytes, uds_interface.o(i.CheckSubSidNeedPosResp)) +

    [Called By]

    • >>   UDS_Service_85 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_11 +
    • >>   UDS_Service_10_Response +
    • >>   UDS_Service_0x3E_Response +
    + +

    CheckUdsDlcIsOk (Thumb, 12 bytes, Stack size 0 bytes, uds_interface.o(i.CheckUdsDlcIsOk)) +

    [Called By]

    • >>   UDS_Service_85 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_27 +
    • >>   UDS_Service_14 +
    • >>   UDS_Service_11 +
    • >>   UDS_Service_10_Response +
    • >>   UDS_Service_0x3E_Response +
    • >>   UDS_Service_0x19_Response +
    + +

    CheckVechileStatus (Thumb, 22 bytes, Stack size 0 bytes, diagnosis_mid.o(i.CheckVechileStatus)) +

    [Called By]

    • >>   Set0x2EDidDiagData +
    • >>   UDS_Service_85 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_11 +
    • >>   UDS_Service_10_Response +
    + +

    ChkInputIGN1 (Thumb, 76 bytes, Stack size 8 bytes, app_pwr_manage.o(i.ChkInputIGN1)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = ChkInputIGN1 +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    +
    [Called By]
    • >>   UdsApi_VehicleInfo2UdsProc +
    + +

    ChkNetworkManageoff (Thumb, 14 bytes, Stack size 0 bytes, app_pwr_manage.o(i.ChkNetworkManageoff)) +

    [Called By]

    • >>   PwrManageWork +
    • >>   QIRUI_DCDCSendBms2 +
    • >>   app_qirui_nm_net_on_check +
    + +

    ChkNetworkWakeType (Thumb, 6 bytes, Stack size 0 bytes, app_pwr_manage.o(i.ChkNetworkWakeType)) +

    [Called By]

    • >>   app_qirui_nm_handle_2 +
    + +

    ChkPwrManageAccoff (Thumb, 48 bytes, Stack size 8 bytes, app_pwr_manage.o(i.ChkPwrManageAccoff)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = ChkPwrManageAccoff +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    • >>   CheckNetworkManageFrameFlagTimeout +
    + +

    ClearDCModuleInfo (Thumb, 8 bytes, Stack size 0 bytes, dc300.o(i.ClearDCModuleInfo)) +

    [Calls]

    • >>   __aeabi_memclr +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    ClearDCPowerPowerComState (Thumb, 10 bytes, Stack size 0 bytes, dc300.o(i.ClearDCPowerPowerComState)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    + +

    ClearDtc (Thumb, 100 bytes, Stack size 16 bytes, diagnosis_mid.o(i.ClearDtc)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = ClearDtc ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   UdsApi_HardwareFault_ForceClear +
    • >>   EE_Write +
    • >>   CRC_Cal16_WithCfg +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   UDS_Service_14 +
    + +

    ControlDCFrame (Thumb, 238 bytes, Stack size 112 bytes, dc300.o(i.ControlDCFrame)) +

    [Stack]

    • Max Depth = 136
    • Call Chain = ControlDCFrame ⇒ RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   RS232_Uart5_Write +
    • >>   CRC16 +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    DCDC_Power_Handle (Thumb, 894 bytes, Stack size 40 bytes, dc300.o(i.DCDC_Power_Handle)) +

    [Stack]

    • Max Depth = 176
    • Call Chain = DCDC_Power_Handle ⇒ ControlDCFrame ⇒ RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   fdc_check_download_status +
    • >>   clear_fdc_check_download_status +
    • >>   UpdateDCFrame +
    • >>   SettingParamDCFrame +
    • >>   ReadDCVersion +
    • >>   ControlDCFrame +
    • >>   ClearDCModuleInfo +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   Delay_MS +
    • >>   qiruibms_check_status +
    +
    [Called By]
    • >>   main +
    + +

    DID_SignalInit (Thumb, 94 bytes, Stack size 40 bytes, diagnosis_mid.o(i.DID_SignalInit)) +

    [Stack]

    • Max Depth = 68
    • Call Chain = DID_SignalInit ⇒ CRC16_DataCheck ⇒ CRC_Cal16_WithCfg +
    +
    [Calls]
    • >>   GetDIDIndexByID +
    • >>   EE_Read +
    • >>   CRC16_DataCheck +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UdsApi_NVM_Init +
    + +

    DMA_Cmd (Thumb, 22 bytes, Stack size 0 bytes, stm32f10x_dma.o(i.DMA_Cmd)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    DMA_DeInit (Thumb, 218 bytes, Stack size 0 bytes, stm32f10x_dma.o(i.DMA_DeInit)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    • >>   AllDisable +
    + +

    DMA_Init (Thumb, 58 bytes, Stack size 12 bytes, stm32f10x_dma.o(i.DMA_Init)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = DMA_Init +
    +
    [Called By]
    • >>   ADC1_Mode_Config +
    + +

    DP_PackageWriteDataFrame (Thumb, 116 bytes, Stack size 16 bytes, usart.o(i.DP_PackageWriteDataFrame)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   Bluetooth_Data_Send +
    • >>   BlueCRC16 +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   sHandleParsePkg +
    • >>   bat_temp_Info +
    • >>   bat_state_code +
    • >>   bat_Cell_Vol_Info +
    • >>   UpdataDebugInfoToServer +
    • >>   Bluetooth_Registered +
    • >>   Bluetooth_Login +
    • >>   Bluetooth_HeartBeat +
    • >>   Bluetooth_DCDC_Data +
    • >>   BMS_VersionInfo +
    • >>   BMS_UpdataACKInfo +
    • >>   BMS_Updata2ACKInfo +
    • >>   BMS_StatusMessage +
    • >>   BMS_ChargingDataInfo +
    • >>   BMS_ChargeInfo +
    + +

    DTC_SignalInit (Thumb, 130 bytes, Stack size 24 bytes, diagnosis_mid.o(i.DTC_SignalInit)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = DTC_SignalInit ⇒ CRC16_DataCheck ⇒ CRC_Cal16_WithCfg +
    +
    [Calls]
    • >>   SnapshotRecordNumberGet +
    • >>   EE_Read +
    • >>   CRC16_DataCheck +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UdsApi_NVM_Init +
    + +

    DebugMon_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.DebugMon_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    Delay_MS (Thumb, 26 bytes, Stack size 8 bytes, sys.o(i.Delay_MS)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = Delay_MS +
    +
    [Calls]
    • >>   IWDG_Feed +
    • >>   Wait50us +
    +
    [Called By]
    • >>   SysParaDataInit +
    • >>   DCDC_Power_Handle +
    • >>   Charger_ProtectCheck +
    • >>   AppCtrOnoffHandle +
    • >>   ee_WriteBytes +
    • >>   EnterSleepProcess +
    • >>   bms_SendBRM +
    • >>   bms_SendBCS +
    • >>   bms_SendBCP +
    • >>   cmd_TT +
    + +

    DiagDIDStoreFlash (Thumb, 82 bytes, Stack size 16 bytes, diagnosis_mid.o(i.DiagDIDStoreFlash)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = DiagDIDStoreFlash ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   GetDIDStoreInFlashIndexByID +
    • >>   GetDIDIndexByID +
    • >>   EE_Write +
    • >>   CRC_Cal16_WithCfg +
    +
    [Called By]
    • >>   Set0x2EDidDiagData +
    + +

    DiagDtcExtendedDataRecordFill (Thumb, 186 bytes, Stack size 28 bytes, diagnosis_mid.o(i.DiagDtcExtendedDataRecordFill)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = DiagDtcExtendedDataRecordFill +
    +
    [Called By]
    • >>   Get0x19SerDiagData +
    + +

    DiagDtcReportSnapshotFill (Thumb, 136 bytes, Stack size 28 bytes, diagnosis_mid.o(i.DiagDtcReportSnapshotFill)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = DiagDtcReportSnapshotFill ⇒ SnapshotRecordNumberGet +
    +
    [Calls]
    • >>   SnapshotRecordNumberGet +
    +
    [Called By]
    • >>   Get0x19SerDiagData +
    + +

    DiagDtcSnapshotRecordFill (Thumb, 188 bytes, Stack size 28 bytes, diagnosis_mid.o(i.DiagDtcSnapshotRecordFill)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = DiagDtcSnapshotRecordFill ⇒ SnapshotRecordFill +
    +
    [Calls]
    • >>   SnapshotRecordFill +
    +
    [Called By]
    • >>   Get0x19SerDiagData +
    + +

    DiagFaultsMonitor (Thumb, 412 bytes, Stack size 8 bytes, diagnosis_mid.o(i.DiagFaultsMonitor)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = DiagFaultsMonitor +
    +
    [Calls]
    • >>   CheckIsIgnON +
    • >>   CheckIsCanBusoff +
    • >>   CheckIsBatteryLow +
    • >>   CheckIsBatteryHigh +
    +
    [Called By]
    • >>   GetFaultInfo +
    + +

    DiagUpdateDtcValue (Thumb, 72 bytes, Stack size 16 bytes, diagnosis_mid.o(i.DiagUpdateDtcValue)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = DiagUpdateDtcValue +
    +
    [Calls]
    • >>   SnapshotRecordLoad +
    +
    [Called By]
    • >>   GetFaultInfo +
    + +

    DtcAging_Process (Thumb, 88 bytes, Stack size 8 bytes, diagnosis_mid.o(i.DtcAging_Process)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = DtcAging_Process +
    +
    [Called By]
    • >>   GetFaultInfo +
    + +

    EE_Read (Thumb, 22 bytes, Stack size 0 bytes, diagnosis_mid.o(i.EE_Read)) +

    [Called By]

    • >>   DTC_SignalInit +
    • >>   DID_SignalInit +
    + +

    EE_Write (Thumb, 10 bytes, Stack size 8 bytes, diagnosis_mid.o(i.EE_Write)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   uds_service_nvm_write +
    +
    [Called By]
    • >>   GetFaultInfo +
    • >>   DiagDIDStoreFlash +
    • >>   ClearDtc +
    + +

    EXIT_Configuration (Thumb, 276 bytes, Stack size 48 bytes, app_pwr_manage.o(i.EXIT_Configuration)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = EXIT_Configuration ⇒ NVIC_Init +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   EXTI_Init +
    • >>   EXTI_ClearITPendingBit +
    • >>   GPIO_EXTILineConfig +
    +
    [Called By]
    • >>   SavePwrCfg +
    • >>   EnterSleepProcess +
    + +

    EXTI15_10_IRQHandler (Thumb, 74 bytes, Stack size 8 bytes, app_pwr_manage.o(i.EXTI15_10_IRQHandler)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = EXTI15_10_IRQHandler +
    +
    [Calls]
    • >>   EXTI_GetFlagStatus +
    • >>   EXTI_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI3_IRQHandler (Thumb, 6 bytes, Stack size 0 bytes, app_pwr_manage.o(i.EXTI3_IRQHandler)) +

    [Calls]

    • >>   EXTI_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI4_IRQHandler (Thumb, 6 bytes, Stack size 0 bytes, app_pwr_manage.o(i.EXTI4_IRQHandler)) +

    [Calls]

    • >>   EXTI_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI9_5_IRQHandler (Thumb, 44 bytes, Stack size 8 bytes, app_pwr_manage.o(i.EXTI9_5_IRQHandler)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = EXTI9_5_IRQHandler +
    +
    [Calls]
    • >>   EXTI_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    EXTI_ClearITPendingBit (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_exti.o(i.EXTI_ClearITPendingBit)) +

    [Called By]

    • >>   RTCAlarm_IRQHandler +
    • >>   EXTI9_5_IRQHandler +
    • >>   EXTI4_IRQHandler +
    • >>   EXTI3_IRQHandler +
    • >>   EXTI15_10_IRQHandler +
    • >>   EXIT_Configuration +
    + +

    EXTI_GetFlagStatus (Thumb, 16 bytes, Stack size 0 bytes, stm32f10x_exti.o(i.EXTI_GetFlagStatus)) +

    [Called By]

    • >>   EXTI15_10_IRQHandler +
    + +

    EXTI_Init (Thumb, 108 bytes, Stack size 12 bytes, stm32f10x_exti.o(i.EXTI_Init)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = EXTI_Init +
    +
    [Called By]
    • >>   RTC_EXTI_INITIAL +
    • >>   EXIT_Configuration +
    + +

    EnterSleepProcess (Thumb, 216 bytes, Stack size 0 bytes, app_pwr_manage.o(i.EnterSleepProcess)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = EnterSleepProcess ⇒ SavePwrCfg ⇒ EXIT_Configuration ⇒ NVIC_Init +
    +
    [Calls]
    • >>   SystemInit +
    • >>   uart4_init +
    • >>   SysTick_Init +
    • >>   RTC_EXTI_INITIAL +
    • >>   NVIC_SetVectorTable +
    • >>   NVIC_Configuration +
    • >>   IWDG_Init +
    • >>   IWDG_Feed +
    • >>   GD_PWR_EnterSTOPMode +
    • >>   SavePwrCfg +
    • >>   RTC_SET_ALARM +
    • >>   EXIT_Configuration +
    • >>   AllDisable +
    • >>   Delay_MS +
    • >>   __2printf +
    +
    [Called By]
    • >>   PwrManageWork +
    + +

    FDC_General_Status_2 (Thumb, 238 bytes, Stack size 32 bytes, can.o(i.FDC_General_Status_2)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = FDC_General_Status_2 ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   can_write2 +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    FDC_General_Status_3 (Thumb, 266 bytes, Stack size 24 bytes, can.o(i.FDC_General_Status_3)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = FDC_General_Status_3 ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   can_write2 +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    FDC_General_Status_4 (Thumb, 172 bytes, Stack size 24 bytes, can.o(i.FDC_General_Status_4)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = FDC_General_Status_4 ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   can_write2 +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    FDC_General_Status_5 (Thumb, 228 bytes, Stack size 16 bytes, can.o(i.FDC_General_Status_5)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = FDC_General_Status_5 ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   can_write2 +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    FLASH_ClearFlag (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_flash.o(i.FLASH_ClearFlag)) +

    [Called By]

    • >>   bsp_WriteCpuFlash +
    + +

    FLASH_ErasePage (Thumb, 56 bytes, Stack size 16 bytes, stm32f10x_flash.o(i.FLASH_ErasePage)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = FLASH_ErasePage ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   FLASH_WaitForLastOperation +
    +
    [Called By]
    • >>   bsp_WriteCpuFlash +
    • >>   UpdProcess +
    + +

    FLASH_GetBank1Status (Thumb, 34 bytes, Stack size 0 bytes, stm32f10x_flash.o(i.FLASH_GetBank1Status)) +

    [Called By]

    • >>   FLASH_WaitForLastOperation +
    + +

    FLASH_Lock (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_flash.o(i.FLASH_Lock)) +

    [Called By]

    • >>   bsp_WriteCpuFlash +
    • >>   UpdProcess +
    + +

    FLASH_ProgramHalfWord (Thumb, 48 bytes, Stack size 20 bytes, stm32f10x_flash.o(i.FLASH_ProgramHalfWord)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = FLASH_ProgramHalfWord ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   FLASH_WaitForLastOperation +
    +
    [Called By]
    • >>   bsp_WriteCpuFlash +
    + +

    FLASH_ProgramWord (Thumb, 76 bytes, Stack size 28 bytes, stm32f10x_flash.o(i.FLASH_ProgramWord)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = FLASH_ProgramWord ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   FLASH_WaitForLastOperation +
    +
    [Called By]
    • >>   UpdProcess +
    + +

    FLASH_Unlock (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_flash.o(i.FLASH_Unlock)) +

    [Called By]

    • >>   bsp_WriteCpuFlash +
    • >>   UpdProcess +
    + +

    FLASH_WaitForLastOperation (Thumb, 34 bytes, Stack size 4 bytes, stm32f10x_flash.o(i.FLASH_WaitForLastOperation)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   FLASH_GetBank1Status +
    +
    [Called By]
    • >>   FLASH_ProgramWord +
    • >>   FLASH_ProgramHalfWord +
    • >>   FLASH_ErasePage +
    + +

    FindTemperature (Thumb, 108 bytes, Stack size 32 bytes, adc.o(i.FindTemperature)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = FindTemperature +
    +
    [Calls]
    • >>   __aeabi_cfrcmple +
    • >>   __aeabi_cfcmple +
    +
    [Called By]
    • >>   BMS_Temperatrue_Sampling +
    + +

    GD_PWR_EnterSTOPMode (Thumb, 124 bytes, Stack size 12 bytes, stm32f10x_pwr.o(i.GD_PWR_EnterSTOPMode)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = GD_PWR_EnterSTOPMode +
    +
    [Called By]
    • >>   EnterSleepProcess +
    + +

    GPIO_DeInit (Thumb, 152 bytes, Stack size 8 bytes, stm32f10x_gpio.o(i.GPIO_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = GPIO_DeInit +
    +
    [Calls]
    • >>   RCC_APB2PeriphResetCmd +
    +
    [Called By]
    • >>   AllDisable +
    + +

    GPIO_EXTILineConfig (Thumb, 34 bytes, Stack size 8 bytes, stm32f10x_gpio.o(i.GPIO_EXTILineConfig)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = GPIO_EXTILineConfig +
    +
    [Called By]
    • >>   EXIT_Configuration +
    + +

    GPIO_Init (Thumb, 156 bytes, Stack size 20 bytes, stm32f10x_gpio.o(i.GPIO_Init)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = GPIO_Init +
    +
    [Called By]
    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   LED_Init +
    • >>   ADS1115_Init +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    • >>   ADC1_GPIO_Config +
    • >>   bsp_InitI2C +
    • >>   SavePwrCfg +
    + +

    GPIO_PinRemapConfig (Thumb, 82 bytes, Stack size 20 bytes, stm32f10x_gpio.o(i.GPIO_PinRemapConfig)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = GPIO_PinRemapConfig +
    +
    [Called By]
    • >>   LED_Init +
    + +

    GPIO_ReadInputDataBit (Thumb, 14 bytes, Stack size 0 bytes, stm32f10x_gpio.o(i.GPIO_ReadInputDataBit)) +

    [Called By]

    • >>   PwrManageWork +
    • >>   Charger_ProtectCheck +
    • >>   ChkInputIGN1 +
    • >>   app_qirui_nm_net_on_check +
    • >>   app_qirui_nm_acc_on_check +
    • >>   app_qirui_nm_AL_check +
    • >>   ChkPwrManageAccoff +
    • >>   cmd_TT +
    + +

    GPIO_ResetBits (Thumb, 4 bytes, Stack size 0 bytes, stm32f10x_gpio.o(i.GPIO_ResetBits)) +

    [Called By]

    • >>   LED_Init +
    • >>   DCDC_Power_Handle +
    • >>   Charger_ProtectCheck +
    • >>   AppCtrOnoffHandle +
    • >>   main +
    • >>   LED_Ctrl +
    • >>   SavePwrCfg +
    • >>   sHandleParsePkg +
    • >>   cmd_ADPrint +
    + +

    GPIO_SetBits (Thumb, 4 bytes, Stack size 0 bytes, stm32f10x_gpio.o(i.GPIO_SetBits)) +

    [Called By]

    • >>   LED_Init +
    • >>   DCDC_Power_Handle +
    • >>   Charger_ProtectCheck +
    • >>   AppCtrOnoffHandle +
    • >>   main +
    • >>   LED_Ctrl +
    • >>   bsp_InitI2C +
    • >>   SavePwrCfg +
    • >>   bms_RcvCan2DataProc +
    • >>   sHandleParsePkg +
    • >>   cmd_TT +
    • >>   cmd_ONDCDCPrint +
    • >>   cmd_ADPrint +
    + +

    GenerateSID27KeyValue (Thumb, 82 bytes, Stack size 24 bytes, diagnosis_mid.o(i.GenerateSID27KeyValue)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = GenerateSID27KeyValue +
    +
    [Called By]
    • >>   UDS_Service_27 +
    + +

    GenerateSID27SeedValue (Thumb, 20 bytes, Stack size 8 bytes, diagnosis_mid.o(i.GenerateSID27SeedValue)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = GenerateSID27SeedValue +
    +
    [Calls]
    • >>   UdsApi_GetRandom +
    +
    [Called By]
    • >>   UDS_Service_27 +
    + +

    Get0x19SerDiagData (Thumb, 192 bytes, Stack size 32 bytes, diagnosis_mid.o(i.Get0x19SerDiagData)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = Get0x19SerDiagData ⇒ DiagDtcReportSnapshotFill ⇒ SnapshotRecordNumberGet +
    +
    [Calls]
    • >>   GetDtcStatusMask +
    • >>   DiagDtcSnapshotRecordFill +
    • >>   DiagDtcReportSnapshotFill +
    • >>   DiagDtcExtendedDataRecordFill +
    +
    [Called By]
    • >>   UDS_Service_0x19_Response +
    + +

    Get0x22SerDiagData (Thumb, 92 bytes, Stack size 16 bytes, diagnosis_mid.o(i.Get0x22SerDiagData)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = Get0x22SerDiagData +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UDS_Service_0x22_Response +
    + +

    GetBootloaderSwVersionAddress (Thumb, 16 bytes, Stack size 0 bytes, bootloader.o(i.GetBootloaderSwVersionAddress)) +

    [Called By]

    • >>   UdsApi_ParaInit +
    + +

    GetDIDIndexByID (Thumb, 34 bytes, Stack size 8 bytes, uds_did.o(i.GetDIDIndexByID)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = GetDIDIndexByID +
    +
    [Called By]
    • >>   DiagDIDStoreFlash +
    • >>   DID_SignalInit +
    + +

    GetDIDStoreInFlashIndexByID (Thumb, 34 bytes, Stack size 8 bytes, uds_did.o(i.GetDIDStoreInFlashIndexByID)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = GetDIDStoreInFlashIndexByID +
    +
    [Called By]
    • >>   DiagDIDStoreFlash +
    + +

    GetDtcStatusMask (Thumb, 148 bytes, Stack size 28 bytes, diagnosis_mid.o(i.GetDtcStatusMask)) +

    [Stack]

    • Max Depth = 28
    • Call Chain = GetDtcStatusMask +
    +
    [Called By]
    • >>   Get0x19SerDiagData +
    + +

    GetFaultInfo (Thumb, 204 bytes, Stack size 24 bytes, diagnosis_mid.o(i.GetFaultInfo)) +

    [Stack]

    • Max Depth = 104
    • Call Chain = GetFaultInfo ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   EE_Write +
    • >>   DtcAging_Process +
    • >>   DiagUpdateDtcValue +
    • >>   DiagFaultsMonitor +
    • >>   CRC_Cal16_WithCfg +
    +
    [Called By]
    • >>   CheckDtcHsCanError +
    + +

    GetSampleVolt (Thumb, 274 bytes, Stack size 32 bytes, ads1015.o(i.GetSampleVolt)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = GetSampleVolt ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_f2d +
    • >>   TickOut +
    • >>   lvbo +
    • >>   __aeabi_d2f +
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_ddiv +
    • >>   __2printf +
    +
    [Called By]
    • >>   main +
    + +

    Get_ChipID (Thumb, 44 bytes, Stack size 0 bytes, chipid.o(i.Get_ChipID)) +

    [Called By]

    • >>   main +
    + +

    Get_Max_Value (Thumb, 8 bytes, Stack size 0 bytes, sys.o(i.Get_Max_Value)) +

    [Called By]

    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    + +

    Get_Min_Value (Thumb, 8 bytes, Stack size 0 bytes, sys.o(i.Get_Min_Value)) +

    [Called By]

    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    + +

    GotoDefaultSession (Thumb, 228 bytes, Stack size 16 bytes, uds_interface.o(i.GotoDefaultSession)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = GotoDefaultSession +
    +
    [Calls]
    • >>   IO_InputOutputRelease +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    GprsCommGetAscLSB (Thumb, 16 bytes, Stack size 0 bytes, usart.o(i.GprsCommGetAscLSB)) +

    [Called By]

    • >>   debugdataprocess +
    + +

    GprsCommGetAscMSB (Thumb, 14 bytes, Stack size 0 bytes, usart.o(i.GprsCommGetAscMSB)) +

    [Called By]

    • >>   debugdataprocess +
    + +

    Gun_Input_Sampling (Thumb, 158 bytes, Stack size 24 bytes, adc.o(i.Gun_Input_Sampling)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = Gun_Input_Sampling ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   __ARM_scalbnf +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_fmul +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    +
    [Called By]
    • >>   main +
    + +

    HAL_UDS_FF_Confirmation (Thumb, 2 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_FF_Confirmation)) +

    [Called By]

    • >>   TP_D_UUData_Confirm +
    + +

    HAL_UDS_FF_Indication (Thumb, 2 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_FF_Indication)) +

    [Called By]

    • >>   TP_Receive_First_Frame +
    + +

    HAL_UDS_FUN_Rx_Callback (Thumb, 32 bytes, Stack size 8 bytes, uds_manage.o(i.HAL_UDS_FUN_Rx_Callback)) +

    [Stack]

    • Max Depth = 156
    • Call Chain = HAL_UDS_FUN_Rx_Callback ⇒ TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_D_UUData_Indication_Functional +
    +
    [Called By]
    • >>   ParseUdsCan +
    + +

    HAL_UDS_Get_Buf (Thumb, 28 bytes, Stack size 8 bytes, uds_manage.o(i.HAL_UDS_Get_Buf)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = HAL_UDS_Get_Buf +
    +
    [Called By]
    • >>   TP_D_UUData_Indication_Physical +
    • >>   TP_D_UUData_Indication_Functional +
    + +

    HAL_UDS_Indication (Thumb, 24 bytes, Stack size 16 bytes, uds_manage.o(i.HAL_UDS_Indication)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = HAL_UDS_Indication ⇒ UDS_Service_Response_Handler +
    +
    [Calls]
    • >>   UDS_Service_Response_Handler +
    • >>   TP_Get_Message_Buffer_Pointer +
    +
    [Called By]
    • >>   TP_Rx_To_Idle_Init +
    • >>   TP_Receive_Single_Frame +
    • >>   TP_Receive_First_Frame +
    • >>   TP_Check_Rx_Message_Length +
    • >>   TP_D_UUData_Indication_Functional +
    + +

    HAL_UDS_PHY_Rx_Callback (Thumb, 32 bytes, Stack size 8 bytes, uds_manage.o(i.HAL_UDS_PHY_Rx_Callback)) +

    [Stack]

    • Max Depth = 148
    • Call Chain = HAL_UDS_PHY_Rx_Callback ⇒ TP_D_UUData_Indication_Physical ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_D_UUData_Indication_Physical +
    +
    [Called By]
    • >>   ParseUdsCan +
    + +

    HAL_UDS_Periodic_Task (Thumb, 4 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Periodic_Task)) +

    [Stack]

    • Max Depth = 132
    • Call Chain = HAL_UDS_Periodic_Task ⇒ TP_Periodic_Task ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Periodic_Task +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    HAL_UDS_Response_Confirm (Thumb, 14 bytes, Stack size 8 bytes, uds_manage.o(i.HAL_UDS_Response_Confirm)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = HAL_UDS_Response_Confirm +
    +
    [Calls]
    • >>   UDS_Service_Transmit_Confirmed +
    +
    [Called By]
    • >>   TP_Tx_To_Idle_Init +
    • >>   TP_N_USData_Request +
    + +

    HAL_UDS_Rx_DLC (Thumb, 6 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Rx_DLC)) +

    [Called By]

    • >>   TP_D_UUData_Indication_Physical +
    • >>   TP_D_UUData_Indication_Functional +
    + +

    HAL_UDS_Set_Tx_Buf (Thumb, 54 bytes, Stack size 32 bytes, uds_manage.o(i.HAL_UDS_Set_Tx_Buf)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TxQueueCan0In +
    +
    [Called By]
    • >>   TP_Transmit_Flow_Control +
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    • >>   TP_N_USData_Request +
    + +

    HAL_UDS_Set_Tx_DLC (Thumb, 6 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Set_Tx_DLC)) +

    [Called By]

    • >>   TP_Transmit_Flow_Control +
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    • >>   TP_N_USData_Request +
    + +

    HAL_UDS_Set_Tx_ID (Thumb, 10 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Set_Tx_ID)) +

    [Called By]

    • >>   TP_Transmit_Flow_Control +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    + +

    HAL_UDS_Transmit_Buffer_Empty (Thumb, 2 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Transmit_Buffer_Empty)) +

    [Called By]

    • >>   TP_Tx_Last_CF_Data_Process +
    • >>   TP_Tx_CF_Data_Process +
    + +

    HAL_UDS_Transmit_Pending_Response (Thumb, 50 bytes, Stack size 16 bytes, uds_manage.o(i.HAL_UDS_Transmit_Pending_Response)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = HAL_UDS_Transmit_Pending_Response ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Set_Tx_ID +
    • >>   TP_Transmit_Buffer_Filled +
    • >>   TP_N_USData_Request +
    • >>   TP_Get_Message_Buffer_Pointer +
    +
    [Called By]
    • >>   UDS_Service_NonSupport_Response +
    • >>   UDS_Service_85 +
    • >>   UDS_Service_31 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_27 +
    • >>   UDS_Service_14 +
    • >>   UDS_Service_11 +
    • >>   UDS_Service_10_Response +
    • >>   UDS_Service_0x3E_Response +
    • >>   UDS_Service_0x2E_Response +
    • >>   UDS_Service_0x22_Response +
    • >>   UDS_Service_0x19_Response +
    + +

    HAL_UDS_Transmit_Physical_Request (Thumb, 60 bytes, Stack size 16 bytes, uds_manage.o(i.HAL_UDS_Transmit_Physical_Request)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Set_Tx_ID +
    • >>   TP_Transmit_Buffer_Filled +
    • >>   TP_N_USData_Request +
    • >>   TP_Get_Message_Buffer_Pointer +
    +
    [Called By]
    • >>   UDS_Service_85 +
    • >>   UDS_Service_31 +
    • >>   UDS_Service_28 +
    • >>   UDS_Service_27 +
    • >>   UDS_Service_14 +
    • >>   UDS_Service_11 +
    • >>   UDS_Service_10_Response +
    • >>   UDS_Service_0x3E_Response +
    • >>   UDS_Service_0x2E_Response +
    • >>   UDS_Service_0x22_Response +
    • >>   UDS_Service_0x19_Response +
    + +

    HAL_UDS_Tx_Callback (Thumb, 4 bytes, Stack size 0 bytes, uds_manage.o(i.HAL_UDS_Tx_Callback)) +

    [Stack]

    • Max Depth = 140
    • Call Chain = HAL_UDS_Tx_Callback ⇒ TP_D_UUData_Confirm ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_D_UUData_Confirm +
    +
    [Called By]
    • >>   CheckDtcHsCanError +
    + +

    HardFault_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.HardFault_Handler)) +

    [Calls]

    • >>   HardFault_Handler +
    +
    [Called By]
    • >>   HardFault_Handler +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    I2CReadByte_A (Thumb, 124 bytes, Stack size 12 bytes, ads1015.o(i.I2CReadByte_A)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = I2CReadByte_A +
    +
    [Called By]
    • >>   ReadAD_A +
    + +

    I2CStart_A (Thumb, 64 bytes, Stack size 0 bytes, ads1015.o(i.I2CStart_A)) +

    [Called By]

    • >>   ReadAD_A +
    • >>   ADS1115Config_A +
    + +

    I2CStop_A (Thumb, 50 bytes, Stack size 0 bytes, ads1015.o(i.I2CStop_A)) +

    [Called By]

    • >>   ReadAD_A +
    • >>   ADS1115Config_A +
    + +

    I2CWriteByte_A (Thumb, 92 bytes, Stack size 12 bytes, ads1015.o(i.I2CWriteByte_A)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = I2CWriteByte_A +
    +
    [Called By]
    • >>   ReadAD_A +
    • >>   ADS1115Config_A +
    + +

    IIC_Ack (Thumb, 38 bytes, Stack size 24 bytes, bsp_i2c_gpio.o(i.IIC_Ack)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = IIC_Ack +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   IIC_Read_Byte +
    + +

    IIC_NAck (Thumb, 34 bytes, Stack size 16 bytes, bsp_i2c_gpio.o(i.IIC_NAck)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = IIC_NAck +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   IIC_Read_Byte +
    + +

    IIC_Read_Byte (Thumb, 86 bytes, Stack size 32 bytes, bsp_i2c_gpio.o(i.IIC_Read_Byte)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = IIC_Read_Byte ⇒ IIC_Ack +
    +
    [Calls]
    • >>   IIC_NAck +
    • >>   IIC_Ack +
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   ee_ReadBytes +
    + +

    IIC_Send_Byte (Thumb, 80 bytes, Stack size 32 bytes, bsp_i2c_gpio.o(i.IIC_Send_Byte)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = IIC_Send_Byte +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   ee_WriteBytes +
    • >>   ee_ReadBytes +
    + +

    IIC_Start (Thumb, 38 bytes, Stack size 16 bytes, bsp_i2c_gpio.o(i.IIC_Start)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = IIC_Start +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   ee_WriteBytes +
    • >>   ee_ReadBytes +
    + +

    IIC_Stop (Thumb, 32 bytes, Stack size 16 bytes, bsp_i2c_gpio.o(i.IIC_Stop)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = IIC_Stop +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   ee_WriteBytes +
    • >>   ee_ReadBytes +
    + +

    IIC_Wait_Ack (Thumb, 52 bytes, Stack size 16 bytes, bsp_i2c_gpio.o(i.IIC_Wait_Ack)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = IIC_Wait_Ack +
    +
    [Calls]
    • >>   i2c_Delay +
    +
    [Called By]
    • >>   ee_WriteBytes +
    • >>   ee_ReadBytes +
    + +

    IO_InputOutputRelease (Thumb, 2 bytes, Stack size 0 bytes, diagnosis_mid.o(i.IO_InputOutputRelease)) +

    [Called By]

    • >>   UDS_Service_10_Response +
    • >>   GotoDefaultSession +
    + +

    IWDG_Feed (Thumb, 14 bytes, Stack size 0 bytes, led.o(i.IWDG_Feed)) +

    [Called By]

    • >>   app_can_handle +
    • >>   main +
    • >>   SysWriteSysParm +
    • >>   EnterSleepProcess +
    • >>   Delay_MS +
    • >>   UpdProcess +
    + +

    IWDG_Init (Thumb, 52 bytes, Stack size 0 bytes, led.o(i.IWDG_Init)) +

    [Called By]

    • >>   main +
    • >>   EnterSleepProcess +
    + +

    IgnChangeProcess (Thumb, 42 bytes, Stack size 0 bytes, diagnosis_mid.o(i.IgnChangeProcess)) +

    [Called By]

    • >>   CheckDtcHsCanError +
    + +

    InitCanDrvCtrlMode (Thumb, 88 bytes, Stack size 24 bytes, candrvctrl.o(i.InitCanDrvCtrlMode)) +

    [Stack]

    • Max Depth = 36
    • Call Chain = InitCanDrvCtrlMode ⇒ can_signal +
    +
    [Calls]
    • >>   can_timer_switch +
    • >>   can_timer_start +
    • >>   can_timer_create +
    • >>   can_signal +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   app_can_init +
    + +

    InitCanifToCanDrvCtrl (Thumb, 68 bytes, Stack size 8 bytes, canbusdrv.o(i.InitCanifToCanDrvCtrl)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = InitCanifToCanDrvCtrl ⇒ RegisterCanIF +
    +
    [Calls]
    • >>   RegisterCanIF +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_can_init +
    + +

    InstallProtocalToIF (Thumb, 240 bytes, Stack size 24 bytes, candrvctrl.o(i.InstallProtocalToIF)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = InstallProtocalToIF ⇒ malloc +
    +
    [Calls]
    • >>   sfifo_init +
    • >>   GetIfFromChanel +
    • >>   malloc +
    • >>   free +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_can_init +
    + +

    IsAppCanID (Thumb, 56 bytes, Stack size 0 bytes, can_app.o(i.IsAppCanID)) +

    [Called By]

    • >>   can_write2 +
    + +

    IsDCDCPowerOn (Thumb, 6 bytes, Stack size 0 bytes, dc300.o(i.IsDCDCPowerOn)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    + +

    IsHexChar (Thumb, 28 bytes, Stack size 0 bytes, usart.o(i.IsHexChar)) +

    [Called By]

    • >>   StringToInt +
    + +

    KeyLocation (Thumb, 38 bytes, Stack size 12 bytes, usart.o(i.KeyLocation)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = KeyLocation +
    +
    [Called By]
    • >>   ParseCommandParam +
    + +

    LED_Ctrl (Thumb, 82 bytes, Stack size 8 bytes, main.o(i.LED_Ctrl)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = LED_Ctrl +
    +
    [Calls]
    • >>   TickOut +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    +
    [Called By]
    • >>   main +
    + +

    LED_Init (Thumb, 368 bytes, Stack size 40 bytes, led.o(i.LED_Init)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = LED_Init ⇒ GPIO_PinRemapConfig +
    +
    [Calls]
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   BKP_TamperPinCmd +
    • >>   GPIO_PinRemapConfig +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    +
    [Called By]
    • >>   main +
    + +

    MemManage_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.MemManage_Handler)) +

    [Calls]

    • >>   MemManage_Handler +
    +
    [Called By]
    • >>   MemManage_Handler +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    NMI_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.NMI_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    NVIC_Configuration (Thumb, 8 bytes, Stack size 0 bytes, sys.o(i.NVIC_Configuration)) +

    [Calls]

    • >>   NVIC_PriorityGroupConfig +
    +
    [Called By]
    • >>   main +
    • >>   EnterSleepProcess +
    + +

    NVIC_Init (Thumb, 94 bytes, Stack size 12 bytes, misc.o(i.NVIC_Init)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = NVIC_Init +
    +
    [Called By]
    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   TIM3_Int_Init +
    • >>   RTC_EXTI_INITIAL +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    • >>   EXIT_Configuration +
    + +

    NVIC_PriorityGroupConfig (Thumb, 10 bytes, Stack size 0 bytes, misc.o(i.NVIC_PriorityGroupConfig)) +

    [Called By]

    • >>   NVIC_Configuration +
    + +

    NVIC_SetVectorTable (Thumb, 12 bytes, Stack size 0 bytes, misc.o(i.NVIC_SetVectorTable)) +

    [Called By]

    • >>   main +
    • >>   EnterSleepProcess +
    + +

    NVM_Init (Thumb, 12 bytes, Stack size 0 bytes, uds_nvm.o(i.NVM_Init)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = NVM_Init ⇒ UdsApi_EE_ReadBytes ⇒ ee_ReadBytes ⇒ IIC_Read_Byte ⇒ IIC_Ack +
    +
    [Calls]
    • >>   UdsApi_EE_ReadBytes +
    +
    [Called By]
    • >>   UdsApi_NVM_Init +
    + +

    NetWorkAppDateSending (Thumb, 40 bytes, Stack size 8 bytes, can.o(i.NetWorkAppDateSending)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = NetWorkAppDateSending +
    +
    [Calls]
    • >>   TickOut +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    PWR_BackupAccessCmd (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_pwr.o(i.PWR_BackupAccessCmd)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    • >>   BSP_BKP_Init +
    + +

    ParseUdsCan (Thumb, 64 bytes, Stack size 24 bytes, uds_can_interface.o(i.ParseUdsCan)) +

    [Stack]

    • Max Depth = 180
    • Call Chain = ParseUdsCan ⇒ HAL_UDS_FUN_Rx_Callback ⇒ TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_PHY_Rx_Callback +
    • >>   HAL_UDS_FUN_Rx_Callback +
    +
    [Called By]
    • >>   UdsQueueCanOut +
    + +

    PendSV_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.PendSV_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    PwrManageWork (Thumb, 234 bytes, Stack size 32 bytes, app_pwr_manage.o(i.PwrManageWork)) +

    [Stack]

    • Max Depth = 132
    • Call Chain = PwrManageWork ⇒ EnterSleepProcess ⇒ SavePwrCfg ⇒ EXIT_Configuration ⇒ NVIC_Init +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    • >>   EnterSleepProcess +
    • >>   ChkNetworkManageoff +
    • >>   __2printf +
    +
    [Called By]
    • >>   main +
    + +

    Pwr_BatVoltRangeMonitor (Thumb, 178 bytes, Stack size 24 bytes, app_pwr_manage.o(i.Pwr_BatVoltRangeMonitor)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = Pwr_BatVoltRangeMonitor ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   __aeabi_fmul +
    +
    [Called By]
    • >>   main +
    + +

    QIRUI_ActivateBMS (Thumb, 30 bytes, Stack size 8 bytes, can.o(i.QIRUI_ActivateBMS)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = QIRUI_ActivateBMS ⇒ app_qirui_nm_send_NM ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   app_qirui_nm_send_NM +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    QIRUI_DCDCSendBms2 (Thumb, 486 bytes, Stack size 16 bytes, can.o(i.QIRUI_DCDCSendBms2)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = QIRUI_DCDCSendBms2 ⇒ QIRUI_DCDCState ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   can_sent_cycle_timeout +
    • >>   app_qirui_nm_app_can_send +
    • >>   TickOutCycle +
    • >>   ChkPwrManageAccoff +
    • >>   ChkNetworkManageoff +
    • >>   QIRUI_DCDCState +
    • >>   QIRUI_ActivateBMS +
    • >>   NetWorkAppDateSending +
    • >>   FDC_General_Status_5 +
    • >>   FDC_General_Status_4 +
    • >>   FDC_General_Status_3 +
    • >>   FDC_General_Status_2 +
    • >>   CheckNetworkManageFrameFlagTimeout +
    +
    [Called By]
    • >>   TIM3_IRQHandler +
    + +

    QIRUI_DCDCSendBms2_force (Thumb, 8 bytes, Stack size 0 bytes, can.o(i.QIRUI_DCDCSendBms2_force)) +

    [Called By]

    • >>   can_bus_off_recovery +
    + +

    QIRUI_DCDCState (Thumb, 526 bytes, Stack size 40 bytes, can.o(i.QIRUI_DCDCState)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = QIRUI_DCDCState ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   sIsFdcExistFault +
    • >>   __aeabi_f2uiz +
    • >>   can_write2 +
    • >>   __aeabi_fadd +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    RCC_AHBPeriphClockCmd (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_AHBPeriphClockCmd)) +

    [Called By]

    • >>   ADC1_Mode_Config +
    + +

    RCC_APB1PeriphClockCmd (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_APB1PeriphClockCmd)) +

    [Called By]

    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   TIM3_Int_Init +
    • >>   RTC_Int_Configuration +
    • >>   BSP_BKP_Init +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    + +

    RCC_APB1PeriphResetCmd (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_APB1PeriphResetCmd)) +

    [Called By]

    • >>   CAN_DeInit +
    • >>   USART_DeInit +
    • >>   TIM_DeInit +
    + +

    RCC_APB2PeriphClockCmd (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_APB2PeriphClockCmd)) +

    [Called By]

    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   LED_Init +
    • >>   ADS1115_Init +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    • >>   ADC1_Mode_Config +
    • >>   ADC1_GPIO_Config +
    • >>   bsp_InitI2C +
    • >>   SavePwrCfg +
    + +

    RCC_APB2PeriphResetCmd (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_APB2PeriphResetCmd)) +

    [Called By]

    • >>   ADC_DeInit +
    • >>   GPIO_DeInit +
    • >>   USART_DeInit +
    • >>   TIM_DeInit +
    + +

    RCC_BackupResetCmd (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_BackupResetCmd)) +

    [Called By]

    • >>   BKP_DeInit +
    + +

    RCC_GetClocksFreq (Thumb, 174 bytes, Stack size 20 bytes, stm32f10x_rcc.o(i.RCC_GetClocksFreq)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = RCC_GetClocksFreq +
    +
    [Called By]
    • >>   main +
    • >>   USART_Init +
    + +

    RCC_GetFlagStatus (Thumb, 42 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_GetFlagStatus)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    RCC_LSEConfig (Thumb, 28 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_LSEConfig)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    RCC_LSICmd (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_LSICmd)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    RCC_RTCCLKCmd (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_RTCCLKCmd)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    RCC_RTCCLKConfig (Thumb, 10 bytes, Stack size 0 bytes, stm32f10x_rcc.o(i.RCC_RTCCLKConfig)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    RS232_Blue_DataWrite (Thumb, 24 bytes, Stack size 16 bytes, usart.o(i.RS232_Blue_DataWrite)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   USART2SendByte +
    +
    [Called By]
    • >>   Bluetooth_Data_Send +
    + +

    RS232_Blue_Write (Thumb, 52 bytes, Stack size 16 bytes, usart.o(i.RS232_Blue_Write)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = RS232_Blue_Write ⇒ USART2SendByte +
    +
    [Calls]
    • >>   USART2SendByte +
    • >>   UART4SendByte +
    +
    [Called By]
    • >>   Blue_Query_Version +
    • >>   Blue_Query_UART_Cfg +
    • >>   Blue_Name_Query +
    • >>   Blue_Name_Cfg +
    • >>   Blue_Connect_State +
    • >>   Blue_AT_Init +
    + +

    RS232_Uart5_Write (Thumb, 24 bytes, Stack size 16 bytes, usart.o(i.RS232_Uart5_Write)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   USART5SendByte +
    +
    [Called By]
    • >>   UpdateDCFrame +
    • >>   SettingParamDCFrame +
    • >>   ReadDCVersion +
    • >>   ControlDCFrame +
    + +

    RTCAlarm_IRQHandler (Thumb, 18 bytes, Stack size 8 bytes, app_pwr_manage.o(i.RTCAlarm_IRQHandler)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = RTCAlarm_IRQHandler +
    +
    [Calls]
    • >>   EXTI_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    RTC_EXTI_INITIAL (Thumb, 60 bytes, Stack size 24 bytes, app_pwr_manage.o(i.RTC_EXTI_INITIAL)) +

    [Stack]

    • Max Depth = 36
    • Call Chain = RTC_EXTI_INITIAL ⇒ NVIC_Init +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   EXTI_Init +
    +
    [Called By]
    • >>   main +
    • >>   EnterSleepProcess +
    + +

    RTC_EnterConfigMode (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_EnterConfigMode)) +

    [Called By]

    • >>   RTC_SetPrescaler +
    • >>   RTC_SetCounter +
    • >>   RTC_SetAlarm +
    + +

    RTC_ExitConfigMode (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_ExitConfigMode)) +

    [Called By]

    • >>   RTC_SetPrescaler +
    • >>   RTC_SetCounter +
    • >>   RTC_SetAlarm +
    + +

    RTC_GetCounter (Thumb, 28 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_GetCounter)) +

    [Called By]

    • >>   RTC_SET_ALARM +
    + +

    RTC_ITConfig (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_ITConfig)) +

    [Called By]

    • >>   RTC_SET_ALARM +
    + +

    RTC_Int_Configuration (Thumb, 90 bytes, Stack size 8 bytes, app_pwr_manage.o(i.RTC_Int_Configuration)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = RTC_Int_Configuration ⇒ __2printf +
    +
    [Calls]
    • >>   BKP_DeInit +
    • >>   PWR_BackupAccessCmd +
    • >>   RTC_WaitForSynchro +
    • >>   RTC_WaitForLastTask +
    • >>   RTC_SetPrescaler +
    • >>   RTC_SetCounter +
    • >>   RCC_RTCCLKConfig +
    • >>   RCC_RTCCLKCmd +
    • >>   RCC_LSICmd +
    • >>   RCC_LSEConfig +
    • >>   RCC_GetFlagStatus +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   __2printf +
    +
    [Called By]
    • >>   main +
    + +

    RTC_SET_ALARM (Thumb, 30 bytes, Stack size 8 bytes, app_pwr_manage.o(i.RTC_SET_ALARM)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = RTC_SET_ALARM ⇒ RTC_SetAlarm +
    +
    [Calls]
    • >>   RTC_WaitForLastTask +
    • >>   RTC_SetAlarm +
    • >>   RTC_ITConfig +
    • >>   RTC_GetCounter +
    +
    [Called By]
    • >>   EnterSleepProcess +
    + +

    RTC_SetAlarm (Thumb, 26 bytes, Stack size 4 bytes, stm32f10x_rtc.o(i.RTC_SetAlarm)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = RTC_SetAlarm +
    +
    [Calls]
    • >>   RTC_ExitConfigMode +
    • >>   RTC_EnterConfigMode +
    +
    [Called By]
    • >>   RTC_SET_ALARM +
    + +

    RTC_SetCounter (Thumb, 26 bytes, Stack size 4 bytes, stm32f10x_rtc.o(i.RTC_SetCounter)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = RTC_SetCounter +
    +
    [Calls]
    • >>   RTC_ExitConfigMode +
    • >>   RTC_EnterConfigMode +
    +
    [Called By]
    • >>   RTC_Int_Configuration +
    + +

    RTC_SetPrescaler (Thumb, 28 bytes, Stack size 4 bytes, stm32f10x_rtc.o(i.RTC_SetPrescaler)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = RTC_SetPrescaler +
    +
    [Calls]
    • >>   RTC_ExitConfigMode +
    • >>   RTC_EnterConfigMode +
    +
    [Called By]
    • >>   RTC_Int_Configuration +
    + +

    RTC_WaitForLastTask (Thumb, 10 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_WaitForLastTask)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    • >>   RTC_SET_ALARM +
    + +

    RTC_WaitForSynchro (Thumb, 18 bytes, Stack size 0 bytes, stm32f10x_rtc.o(i.RTC_WaitForSynchro)) +

    [Called By]

    • >>   RTC_Int_Configuration +
    + +

    ReadAD_A (Thumb, 64 bytes, Stack size 8 bytes, ads1015.o(i.ReadAD_A)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = ReadAD_A ⇒ I2CWriteByte_A +
    +
    [Calls]
    • >>   I2CWriteByte_A +
    • >>   I2CStop_A +
    • >>   I2CStart_A +
    • >>   I2CReadByte_A +
    +
    [Called By]
    • >>   getad +
    + +

    ReadDCVersion (Thumb, 122 bytes, Stack size 96 bytes, dc300.o(i.ReadDCVersion)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = ReadDCVersion ⇒ RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   RS232_Uart5_Write +
    • >>   CRC16 +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    RegisterCanIF (Thumb, 108 bytes, Stack size 8 bytes, candrvctrl.o(i.RegisterCanIF)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = RegisterCanIF +
    +
    [Calls]
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   InitCanifToCanDrvCtrl +
    + +

    SVC_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.SVC_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    SYS_ENTER_CRITICAL (Thumb, 16 bytes, Stack size 0 bytes, sys.o(i.SYS_ENTER_CRITICAL)) +

    [Called By]

    • >>   can_bus_off_hook +
    • >>   CAN2_Mode_Init +
    • >>   plSend +
    • >>   can_bus_off_recovery +
    + +

    SYS_EXIT_CRITICAL (Thumb, 22 bytes, Stack size 0 bytes, sys.o(i.SYS_EXIT_CRITICAL)) +

    [Called By]

    • >>   can_bus_off_hook +
    • >>   CAN2_Mode_Init +
    • >>   plSend +
    • >>   can_bus_off_recovery +
    + +

    SavePwrCfg (Thumb, 428 bytes, Stack size 40 bytes, app_pwr_manage.o(i.SavePwrCfg)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = SavePwrCfg ⇒ EXIT_Configuration ⇒ NVIC_Init +
    +
    [Calls]
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   ADC_DeInit +
    • >>   ADC_Cmd +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   USART_ITConfig +
    • >>   USART_DeInit +
    • >>   USART_Cmd +
    • >>   EXIT_Configuration +
    +
    [Called By]
    • >>   EnterSleepProcess +
    + +

    Set0x2EDidDiagData (Thumb, 394 bytes, Stack size 24 bytes, diagnosis_mid.o(i.Set0x2EDidDiagData)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = Set0x2EDidDiagData ⇒ DiagDIDStoreFlash ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   DiagDIDStoreFlash +
    • >>   CheckVechileStatus +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UDS_Service_0x2E_Response +
    + +

    Set0x31DiagData (Thumb, 98 bytes, Stack size 72 bytes, diagnosis_mid.o(i.Set0x31DiagData)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = Set0x31DiagData +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UDS_Service_31 +
    + +

    SetExternProgrammingRequest (Thumb, 18 bytes, Stack size 0 bytes, bootloader.o(i.SetExternProgrammingRequest)) +

    [Called By]

    • >>   SetUdsUpdataFlag +
    + +

    SetUdsUpdataFlag (Thumb, 4 bytes, Stack size 0 bytes, diagnosis_mid.o(i.SetUdsUpdataFlag)) +

    [Calls]

    • >>   SetExternProgrammingRequest +
    +
    [Called By]
    • >>   UDS_Service_10_Response +
    + +

    SettingParamDCFrame (Thumb, 210 bytes, Stack size 104 bytes, dc300.o(i.SettingParamDCFrame)) +

    [Stack]

    • Max Depth = 128
    • Call Chain = SettingParamDCFrame ⇒ RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   RS232_Uart5_Write +
    • >>   CRC16 +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    SnapshotRecordFill (Thumb, 128 bytes, Stack size 12 bytes, diagnosis_mid.o(i.SnapshotRecordFill)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = SnapshotRecordFill +
    +
    [Called By]
    • >>   DiagDtcSnapshotRecordFill +
    + +

    SnapshotRecordLoad (Thumb, 10 bytes, Stack size 0 bytes, diagnosis_mid.o(i.SnapshotRecordLoad)) +

    [Calls]

    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   DiagUpdateDtcValue +
    + +

    SnapshotRecordNumberGet (Thumb, 112 bytes, Stack size 20 bytes, diagnosis_mid.o(i.SnapshotRecordNumberGet)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = SnapshotRecordNumberGet +
    +
    [Called By]
    • >>   DiagDtcReportSnapshotFill +
    • >>   DTC_SignalInit +
    + +

    StringToInt (Thumb, 46 bytes, Stack size 8 bytes, usart.o(i.StringToInt)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = StringToInt +
    +
    [Calls]
    • >>   IsHexChar +
    • >>   CharToSemiHex +
    +
    [Called By]
    • >>   cmd_ONDCDCPrint +
    • >>   cmd_OFFDCDCPrint +
    • >>   cmd_DecodeUniquID +
    • >>   cmd_ADPrint +
    + +

    SysParaDataInit (Thumb, 1926 bytes, Stack size 40 bytes, sys.o(i.SysParaDataInit)) +

    [Stack]

    • Max Depth = 136
    • Call Chain = SysParaDataInit ⇒ VinCalc +
    +
    [Calls]
    • >>   SysWriteSysParm +
    • >>   Delay_MS +
    • >>   VinCalc +
    • >>   bsp_ReadCpuFlash +
    • >>   __2sprintf +
    • >>   __2printf +
    • >>   strcpy +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   main +
    + +

    SysStoreSysParm (Thumb, 36 bytes, Stack size 16 bytes, sys.o(i.SysStoreSysParm)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = SysStoreSysParm ⇒ SysWriteSysParm ⇒ bsp_WriteCpuFlash ⇒ FLASH_ProgramHalfWord ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   SysWriteSysParm +
    +
    [Called By]
    • >>   main +
    + +

    SysTick_Handler (Thumb, 50 bytes, Stack size 0 bytes, sys.o(i.SysTick_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    SysTick_Init (Thumb, 60 bytes, Stack size 16 bytes, sys.o(i.SysTick_Init)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = SysTick_Init +
    +
    [Calls]
    • >>   NVIC_SetPriority +
    +
    [Called By]
    • >>   main +
    • >>   EnterSleepProcess +
    + +

    SysWriteSysParm (Thumb, 22 bytes, Stack size 8 bytes, sys.o(i.SysWriteSysParm)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = SysWriteSysParm ⇒ bsp_WriteCpuFlash ⇒ FLASH_ProgramHalfWord ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   IWDG_Feed +
    • >>   bsp_WriteCpuFlash +
    +
    [Called By]
    • >>   SysStoreSysParm +
    • >>   SysParaDataInit +
    • >>   sHandleParsePkg +
    + +

    SystemInit (Thumb, 76 bytes, Stack size 8 bytes, system_stm32f10x.o(i.SystemInit)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = SystemInit ⇒ SetSysClockTo72 +
    +
    [Calls]
    • >>   SetSysClockTo72 +
    +
    [Called By]
    • >>   EnterSleepProcess +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(.text) +
    +

    TIM3_IRQHandler (Thumb, 34 bytes, Stack size 8 bytes, timer.o(i.TIM3_IRQHandler)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = TIM3_IRQHandler ⇒ QIRUI_DCDCSendBms2 ⇒ QIRUI_DCDCState ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   QIRUI_DCDCSendBms2 +
    • >>   TIM_GetITStatus +
    • >>   TIM_ClearITPendingBit +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    TIM3_Int_Init (Thumb, 90 bytes, Stack size 32 bytes, timer.o(i.TIM3_Int_Init)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = TIM3_Int_Init ⇒ NVIC_Init +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   TIM_TimeBaseInit +
    • >>   TIM_ITConfig +
    • >>   TIM_Cmd +
    +
    [Called By]
    • >>   main +
    + +

    TIM_ClearITPendingBit (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_tim.o(i.TIM_ClearITPendingBit)) +

    [Called By]

    • >>   TIM3_IRQHandler +
    + +

    TIM_Cmd (Thumb, 20 bytes, Stack size 0 bytes, stm32f10x_tim.o(i.TIM_Cmd)) +

    [Called By]

    • >>   TIM3_Int_Init +
    + +

    TIM_DeInit (Thumb, 304 bytes, Stack size 8 bytes, stm32f10x_tim.o(i.TIM_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = TIM_DeInit +
    +
    [Calls]
    • >>   RCC_APB1PeriphResetCmd +
    • >>   RCC_APB2PeriphResetCmd +
    +
    [Called By]
    • >>   AllDisable +
    + +

    TIM_GetITStatus (Thumb, 24 bytes, Stack size 0 bytes, stm32f10x_tim.o(i.TIM_GetITStatus)) +

    [Called By]

    • >>   TIM3_IRQHandler +
    + +

    TIM_ITConfig (Thumb, 16 bytes, Stack size 0 bytes, stm32f10x_tim.o(i.TIM_ITConfig)) +

    [Called By]

    • >>   TIM3_Int_Init +
    + +

    TIM_TimeBaseInit (Thumb, 114 bytes, Stack size 12 bytes, stm32f10x_tim.o(i.TIM_TimeBaseInit)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = TIM_TimeBaseInit +
    +
    [Called By]
    • >>   TIM3_Int_Init +
    + +

    TP_D_UUData_Confirm (Thumb, 112 bytes, Stack size 16 bytes, tp_cca.o(i.TP_D_UUData_Confirm)) +

    [Stack]

    • Max Depth = 140
    • Call Chain = TP_D_UUData_Confirm ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_FF_Confirmation +
    • >>   TP_Task +
    +
    [Called By]
    • >>   HAL_UDS_Tx_Callback +
    + +

    TP_D_UUData_Indication_Functional (Thumb, 160 bytes, Stack size 24 bytes, tp_cca.o(i.TP_D_UUData_Indication_Functional)) +

    [Stack]

    • Max Depth = 148
    • Call Chain = TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Received_DLC_Check +
    • >>   HAL_UDS_Rx_DLC +
    • >>   HAL_UDS_Indication +
    • >>   HAL_UDS_Get_Buf +
    • >>   TP_Task +
    +
    [Called By]
    • >>   HAL_UDS_FUN_Rx_Callback +
    + +

    TP_D_UUData_Indication_Physical (Thumb, 102 bytes, Stack size 16 bytes, tp_cca.o(i.TP_D_UUData_Indication_Physical)) +

    [Stack]

    • Max Depth = 140
    • Call Chain = TP_D_UUData_Indication_Physical ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_Init +
    • >>   HAL_UDS_Rx_DLC +
    • >>   HAL_UDS_Get_Buf +
    • >>   TP_Task +
    • >>   TP_Init +
    +
    [Called By]
    • >>   HAL_UDS_PHY_Rx_Callback +
    + +

    TP_Get_Message_Buffer_Pointer (Thumb, 4 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Get_Message_Buffer_Pointer)) +

    [Called By]

    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   HAL_UDS_Indication +
    + +

    TP_Init (Thumb, 32 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Init)) +

    [Called By]

    • >>   TP_D_UUData_Indication_Physical +
    + +

    TP_N_USData_Request (Thumb, 90 bytes, Stack size 16 bytes, tp_cca.o(i.TP_N_USData_Request)) +

    [Stack]

    • Max Depth = 68
    • Call Chain = TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Transmit_Single_Frame +
    • >>   TP_Transmit_First_Frame +
    • >>   HAL_UDS_Set_Tx_DLC +
    • >>   HAL_UDS_Set_Tx_Buf +
    • >>   HAL_UDS_Response_Confirm +
    +
    [Called By]
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    + +

    TP_Periodic_Task (Thumb, 14 bytes, Stack size 8 bytes, tp_cca.o(i.TP_Periodic_Task)) +

    [Stack]

    • Max Depth = 132
    • Call Chain = TP_Periodic_Task ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Update_Timers +
    • >>   TP_Task +
    +
    [Called By]
    • >>   HAL_UDS_Periodic_Task +
    + +

    TP_Task (Thumb, 180 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Task)) +

    [Stack]

    • Max Depth = 124
    • Call Chain = TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Wait_For_SFORFF_TxConf_State_Process +
    • >>   TP_Wait_For_FCFrame_Rx_State_Process +
    • >>   TP_Wait_For_CF_TxConf_State_Process +
    • >>   TP_Transmit_Consecutive_Frame +
    • >>   TP_Rx_To_Idle_Init +
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Receive_Single_OR_First_Frame +
    • >>   TP_Receive_Consecutive_Frame +
    • >>   TP_Check_Rx_Message_Length +
    +
    [Called By]
    • >>   TP_Periodic_Task +
    • >>   TP_D_UUData_Indication_Physical +
    • >>   TP_D_UUData_Indication_Functional +
    • >>   TP_D_UUData_Confirm +
    + +

    TP_Transmit_Buffer_Filled (Thumb, 8 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Transmit_Buffer_Filled)) +

    [Called By]

    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    + +

    TakeDCPowerOff (Thumb, 8 bytes, Stack size 0 bytes, dc300.o(i.TakeDCPowerOff)) +

    [Called By]

    • >>   Charger_ProtectCheck +
    • >>   AppCtrOnoffHandle +
    • >>   cmd_OFFDCDCPrint +
    + +

    TakeDCPowerOn (Thumb, 8 bytes, Stack size 0 bytes, dc300.o(i.TakeDCPowerOn)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    • >>   cmd_ONDCDCPrint +
    + +

    TickOut (Thumb, 38 bytes, Stack size 0 bytes, sys.o(i.TickOut)) +

    [Called By]

    • >>   GetSampleVolt +
    • >>   AppCtrOnoffHandle +
    • >>   debug_info +
    • >>   LED_Ctrl +
    • >>   Battery_Soc_AnalogCalculate +
    • >>   Battery_RequireVoltCur_Calculate +
    • >>   Battery_NewSoc_CalibrationCalculate +
    • >>   Battery_Energy_Calculate +
    • >>   fdc_check_download_status +
    • >>   DCDC_Battery_RequireVoltCur_Calculate +
    • >>   can_timer_schedule +
    • >>   can_timer_start +
    • >>   app_qirui_nm_start_t1 +
    • >>   app_qirui_nm_start_sa +
    • >>   QIRUI_NMReceiveTimeout +
    • >>   app_qirui_nm_handle_2 +
    • >>   can_bus_off_recovery +
    • >>   can2_bus_error_cb +
    • >>   can2_comm_sent_cb +
    • >>   can_sent_cycle_timeout +
    • >>   app_qr_nm_master_frame +
    • >>   bms_RcvCanMutliData +
    • >>   bms_RcvCan2DataProc +
    • >>   NetWorkAppDateSending +
    • >>   CheckNetworkManageFrameFlagTimeout +
    • >>   cmd_cansend +
    • >>   Bluetooth_Switch_PREPARE +
    • >>   Bluetooth_Switch_Connecting +
    • >>   Bluetooth_Switch_Config +
    • >>   Bluetooth_Registered +
    • >>   Bluetooth_Login +
    • >>   Bluetooth_HeartBeat +
    • >>   Bluetooth_DCDC_Data +
    • >>   BluetoothDataProcess +
    • >>   BMS_StatusMessage +
    • >>   BMS_ChargeInfo +
    + +

    TickOutCycle (Thumb, 38 bytes, Stack size 8 bytes, sys.o(i.TickOutCycle)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = TickOutCycle +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    • >>   bms_SendBSM +
    + +

    TimeTaskDispatch_Flag (Thumb, 178 bytes, Stack size 12 bytes, sys.o(i.TimeTaskDispatch_Flag)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = TimeTaskDispatch_Flag +
    +
    [Called By]
    • >>   main +
    + +

    TxQueueCan0In (Thumb, 76 bytes, Stack size 20 bytes, uds_can_interface.o(i.TxQueueCan0In)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = TxQueueCan0In +
    +
    [Called By]
    • >>   HAL_UDS_Set_Tx_Buf +
    + +

    TxQueueCan0Out (Thumb, 68 bytes, Stack size 16 bytes, uds_can_interface.o(i.TxQueueCan0Out)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = TxQueueCan0Out ⇒ UdsApi_MsgQueueOut ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   CanRxConStatus +
    • >>   UdsApi_MsgQueueOut +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    UART4SendByte (Thumb, 20 bytes, Stack size 8 bytes, usart.o(i.UART4SendByte)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = UART4SendByte +
    +
    [Calls]
    • >>   USART_SendData +
    +
    [Called By]
    • >>   debugdataprocess +
    • >>   RS232_Blue_Write +
    + +

    UART4_IRQHandler (Thumb, 230 bytes, Stack size 24 bytes, usart.o(i.UART4_IRQHandler)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = UART4_IRQHandler ⇒ ShellCommad ⇒ ParseCommandParam ⇒ __2printf +
    +
    [Calls]
    • >>   USART_ReceiveData +
    • >>   USART_GetITStatus +
    • >>   USART_GetFlagStatus +
    • >>   USART_ClearITPendingBit +
    • >>   USART_ClearFlag +
    • >>   ShellCommad +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    UART5_IRQHandler (Thumb, 198 bytes, Stack size 16 bytes, usart.o(i.UART5_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = UART5_IRQHandler ⇒ USART_GetITStatus +
    +
    [Calls]
    • >>   USART_ReceiveData +
    • >>   USART_GetITStatus +
    • >>   USART_GetFlagStatus +
    • >>   USART_ClearITPendingBit +
    • >>   USART_ClearFlag +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    UDS_Demo_Calculate_Key (Thumb, 18 bytes, Stack size 0 bytes, uds_interface.o(i.UDS_Demo_Calculate_Key)) +

    [Called By]

    • >>   UDS_Service_Response_Handler +
    + +

    UDS_Demo_Services_Sequence (Thumb, 28 bytes, Stack size 0 bytes, uds_interface.o(i.UDS_Demo_Services_Sequence)) +

    [Called By]

    • >>   UdsProcTask +
    + +

    UDS_Demo_Services_Start (Thumb, 10 bytes, Stack size 0 bytes, uds_interface.o(i.UDS_Demo_Services_Start)) +

    [Calls]

    • >>   UDS_Service_Init +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    UDS_Neg_Response_Callback (Thumb, 10 bytes, Stack size 0 bytes, uds_interface.o(i.UDS_Neg_Response_Callback)) +

    [Calls]

    • >>   UDS_Service_Init +
    +
    [Called By]
    • >>   UDS_Service_Response_Handler +
    + +

    UDS_Nrc78PostProcessing (Thumb, 2 bytes, Stack size 0 bytes, uds_services.o(i.UDS_Nrc78PostProcessing)) +

    [Called By]

    • >>   UdsProcTask +
    + +

    UDS_ServiceInit (Thumb, 40 bytes, Stack size 0 bytes, diagnosis_mid.o(i.UDS_ServiceInit)) +

    [Called By]

    • >>   UdsProcTask +
    + +

    UDS_Service_0x19_Response (Thumb, 212 bytes, Stack size 16 bytes, uds_services.o(i.UDS_Service_0x19_Response)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = UDS_Service_0x19_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   Get0x19SerDiagData +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckIsSupportSubFunc_Sid19 +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_19_Service_Read_DTC +
    + +

    UDS_Service_0x22_Response (Thumb, 84 bytes, Stack size 8 bytes, uds_services.o(i.UDS_Service_0x22_Response)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = UDS_Service_0x22_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   Get0x22SerDiagData +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    +
    [Called By]
    • >>   UDS_22_Service_Read_Data +
    + +

    UDS_Service_0x2E_Response (Thumb, 98 bytes, Stack size 16 bytes, uds_services.o(i.UDS_Service_0x2E_Response)) +

    [Stack]

    • Max Depth = 136
    • Call Chain = UDS_Service_0x2E_Response ⇒ Set0x2EDidDiagData ⇒ DiagDIDStoreFlash ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   Set0x2EDidDiagData +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_2E_Service_Write_Data +
    + +

    UDS_Service_0x3E_Response (Thumb, 92 bytes, Stack size 16 bytes, uds_services.o(i.UDS_Service_0x3E_Response)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = UDS_Service_0x3E_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckSubSidNeedPosResp +
    +
    [Called By]
    • >>   UDS_3E_Service_Tester_Present +
    + +

    UDS_Service_10_Response (Thumb, 246 bytes, Stack size 32 bytes, uds_services.o(i.UDS_Service_10_Response)) +

    [Stack]

    • Max Depth = 116
    • Call Chain = UDS_Service_10_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   SetUdsUpdataFlag +
    • >>   IO_InputOutputRelease +
    • >>   CheckVechileStatus +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckSubSidNeedPosResp +
    +
    [Called By]
    • >>   UDS_10_Service_Session_Control +
    + +

    UDS_Service_11 (Thumb, 148 bytes, Stack size 24 bytes, uds_services.o(i.UDS_Service_11)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_Service_11 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   CheckVechileStatus +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckSubSidNeedPosResp +
    • >>   CheckIsSupportSubFunc_Sid11 +
    +
    [Called By]
    • >>   UDS_11_Service_Ecu_Reset +
    + +

    UDS_Service_14 (Thumb, 120 bytes, Stack size 16 bytes, uds_services.o(i.UDS_Service_14)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = UDS_Service_14 ⇒ ClearDtc ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   ClearDtc +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_14_Service_Clear_DTC +
    + +

    UDS_Service_27 (Thumb, 444 bytes, Stack size 40 bytes, uds_services.o(i.UDS_Service_27)) +

    [Stack]

    • Max Depth = 124
    • Call Chain = UDS_Service_27 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   GenerateSID27SeedValue +
    • >>   GenerateSID27KeyValue +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckIsBeyonSession +
    • >>   memcmp +
    +
    [Called By]
    • >>   UDS_27_Service_Security_Access +
    + +

    UDS_Service_28 (Thumb, 214 bytes, Stack size 24 bytes, uds_services.o(i.UDS_Service_28)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_Service_28 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   CheckVechileStatus +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckSubSidNeedPosResp +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_28_Service_Communication_Control +
    + +

    UDS_Service_31 (Thumb, 94 bytes, Stack size 24 bytes, uds_services.o(i.UDS_Service_31)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_Service_31 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   Set0x31DiagData +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_31_Service_Routine_Ctrl +
    + +

    UDS_Service_85 (Thumb, 160 bytes, Stack size 16 bytes, uds_services.o(i.UDS_Service_85)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = UDS_Service_85 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   CheckVechileStatus +
    • >>   HAL_UDS_Transmit_Physical_Request +
    • >>   HAL_UDS_Transmit_Pending_Response +
    • >>   CheckUdsDlcIsOk +
    • >>   CheckSubSidNeedPosResp +
    • >>   CheckIsBeyonSession +
    +
    [Called By]
    • >>   UDS_85_Service_Control_DTC +
    + +

    UDS_Service_Init (Thumb, 18 bytes, Stack size 0 bytes, uds_services.o(i.UDS_Service_Init)) +

    [Called By]

    • >>   UDS_Neg_Response_Callback +
    • >>   UDS_Demo_Services_Start +
    • >>   TP_D_UUData_Indication_Physical +
    + +

    UDS_Service_NonSupport_Response (Thumb, 36 bytes, Stack size 8 bytes, uds_services.o(i.UDS_Service_NonSupport_Response)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = UDS_Service_NonSupport_Response ⇒ HAL_UDS_Transmit_Pending_Response ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Transmit_Pending_Response +
    +
    [Called By]
    • >>   UDS_Service_NRC +
    + +

    UDS_Service_Response_Handler (Thumb, 220 bytes, Stack size 24 bytes, uds_services.o(i.UDS_Service_Response_Handler)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = UDS_Service_Response_Handler +
    +
    [Calls]
    • >>   UDS_Neg_Response_Callback +
    • >>   UDS_Demo_Calculate_Key +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   HAL_UDS_Indication +
    + +

    UDS_Service_Transmit_Confirmed (Thumb, 8 bytes, Stack size 0 bytes, uds_services.o(i.UDS_Service_Transmit_Confirmed)) +

    [Called By]

    • >>   HAL_UDS_Response_Confirm +
    + +

    USART1_IRQHandler (Thumb, 88 bytes, Stack size 16 bytes, usart.o(i.USART1_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = USART1_IRQHandler ⇒ USART_GetITStatus +
    +
    [Calls]
    • >>   USART_ReceiveData +
    • >>   USART_GetITStatus +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    USART2SendByte (Thumb, 20 bytes, Stack size 8 bytes, usart.o(i.USART2SendByte)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = USART2SendByte +
    +
    [Calls]
    • >>   USART_SendData +
    +
    [Called By]
    • >>   RS232_Blue_Write +
    • >>   RS232_Blue_DataWrite +
    + +

    USART2_IRQHandler (Thumb, 194 bytes, Stack size 16 bytes, usart.o(i.USART2_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = USART2_IRQHandler ⇒ USART_GetITStatus +
    +
    [Calls]
    • >>   USART_ReceiveData +
    • >>   USART_GetITStatus +
    • >>   USART_GetFlagStatus +
    • >>   USART_ClearITPendingBit +
    • >>   USART_ClearFlag +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    USART3_IRQHandler (Thumb, 198 bytes, Stack size 16 bytes, usart.o(i.USART3_IRQHandler)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = USART3_IRQHandler ⇒ USART_GetITStatus +
    +
    [Calls]
    • >>   USART_ReceiveData +
    • >>   USART_GetITStatus +
    • >>   USART_GetFlagStatus +
    • >>   USART_ClearITPendingBit +
    • >>   USART_ClearFlag +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    USART5SendByte (Thumb, 20 bytes, Stack size 8 bytes, usart.o(i.USART5SendByte)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = USART5SendByte +
    +
    [Calls]
    • >>   USART_SendData +
    +
    [Called By]
    • >>   RS232_Uart5_Write +
    + +

    USART_ClearFlag (Thumb, 6 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_ClearFlag)) +

    [Called By]

    • >>   uart2_init +
    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   UART5_IRQHandler +
    • >>   UART4_IRQHandler +
    + +

    USART_ClearITPendingBit (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_ClearITPendingBit)) +

    [Called By]

    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   UART5_IRQHandler +
    • >>   UART4_IRQHandler +
    + +

    USART_Cmd (Thumb, 20 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_Cmd)) +

    [Called By]

    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   SavePwrCfg +
    + +

    USART_DeInit (Thumb, 96 bytes, Stack size 8 bytes, stm32f10x_usart.o(i.USART_DeInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = USART_DeInit +
    +
    [Calls]
    • >>   RCC_APB1PeriphResetCmd +
    • >>   RCC_APB2PeriphResetCmd +
    +
    [Called By]
    • >>   SavePwrCfg +
    • >>   AllDisable +
    + +

    USART_GetFlagStatus (Thumb, 14 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_GetFlagStatus)) +

    [Called By]

    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   UART5_IRQHandler +
    • >>   UART4_IRQHandler +
    + +

    USART_GetITStatus (Thumb, 62 bytes, Stack size 16 bytes, stm32f10x_usart.o(i.USART_GetITStatus)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = USART_GetITStatus +
    +
    [Called By]
    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   USART1_IRQHandler +
    • >>   UART5_IRQHandler +
    • >>   UART4_IRQHandler +
    + +

    USART_ITConfig (Thumb, 48 bytes, Stack size 8 bytes, stm32f10x_usart.o(i.USART_ITConfig)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = USART_ITConfig +
    +
    [Called By]
    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   SavePwrCfg +
    + +

    USART_Init (Thumb, 166 bytes, Stack size 32 bytes, stm32f10x_usart.o(i.USART_Init)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = USART_Init ⇒ RCC_GetClocksFreq +
    +
    [Calls]
    • >>   RCC_GetClocksFreq +
    +
    [Called By]
    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    + +

    USART_ReceiveData (Thumb, 8 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_ReceiveData)) +

    [Called By]

    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   USART1_IRQHandler +
    • >>   UART5_IRQHandler +
    • >>   UART4_IRQHandler +
    + +

    USART_SendData (Thumb, 8 bytes, Stack size 0 bytes, stm32f10x_usart.o(i.USART_SendData)) +

    [Called By]

    • >>   fputc +
    • >>   USART5SendByte +
    • >>   USART2SendByte +
    • >>   UART4SendByte +
    + +

    UdsApi_10ms_task (Thumb, 4 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_10ms_task)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = UdsApi_10ms_task ⇒ UdsApi_VehicleInfo2UdsProc ⇒ ChkInputIGN1 +
    +
    [Calls]
    • >>   UdsApi_VehicleInfo2UdsProc +
    +
    [Called By]
    • >>   main +
    + +

    UdsApi_1ms_task (Thumb, 4 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_1ms_task)) +

    [Stack]

    • Max Depth = 228
    • Call Chain = UdsApi_1ms_task ⇒ UdsProcTask ⇒ UdsQueueCanOut ⇒ ParseUdsCan ⇒ HAL_UDS_FUN_Rx_Callback ⇒ TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UdsProcTask +
    +
    [Called By]
    • >>   main +
    + +

    UdsApi_BootSwAddr_Get (Thumb, 20 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_BootSwAddr_Get)) +

    [Called By]

    • >>   main +
    + +

    UdsApi_EE_ReadBytes (Thumb, 4 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_EE_ReadBytes)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = UdsApi_EE_ReadBytes ⇒ ee_ReadBytes ⇒ IIC_Read_Byte ⇒ IIC_Ack +
    +
    [Calls]
    • >>   ee_ReadBytes +
    +
    [Called By]
    • >>   NVM_Init +
    + +

    UdsApi_EE_WriteBytes (Thumb, 4 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_EE_WriteBytes)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   ee_WriteBytes +
    +
    [Called By]
    • >>   nvm_write +
    + +

    UdsApi_GetRandom (Thumb, 42 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_GetRandom)) +

    [Called By]

    • >>   GenerateSID27SeedValue +
    + +

    UdsApi_HardwareFault_ForceClear (Thumb, 2 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_HardwareFault_ForceClear)) +

    [Called By]

    • >>   ClearDtc +
    + +

    UdsApi_Is_UdsEnableNCMRx (Thumb, 14 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_Is_UdsEnableNCMRx)) +

    [Called By]

    • >>   app_can_handle +
    + +

    UdsApi_Is_UdsEnableNCMTx (Thumb, 14 bytes, Stack size 0 bytes, uds_api.o(i.UdsApi_Is_UdsEnableNCMTx)) +

    [Called By]

    • >>   can_write2 +
    + +

    UdsApi_MsgQueueIn (Thumb, 42 bytes, Stack size 40 bytes, uds_api.o(i.UdsApi_MsgQueueIn)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = UdsApi_MsgQueueIn ⇒ UdsQueueCanIn +
    +
    [Calls]
    • >>   UdsQueueCanIn +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    UdsApi_MsgQueueOut (Thumb, 48 bytes, Stack size 40 bytes, uds_api.o(i.UdsApi_MsgQueueOut)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = UdsApi_MsgQueueOut ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   can_write2 +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   TxQueueCan0Out +
    + +

    UdsApi_NVM_Init (Thumb, 32 bytes, Stack size 8 bytes, uds_api.o(i.UdsApi_NVM_Init)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = UdsApi_NVM_Init ⇒ NVM_Init ⇒ UdsApi_EE_ReadBytes ⇒ ee_ReadBytes ⇒ IIC_Read_Byte ⇒ IIC_Ack +
    +
    [Calls]
    • >>   DTC_SignalInit +
    • >>   DID_SignalInit +
    • >>   NVM_Init +
    +
    [Called By]
    • >>   main +
    + +

    UdsApi_ParaInit (Thumb, 178 bytes, Stack size 16 bytes, uds_api.o(i.UdsApi_ParaInit)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = UdsApi_ParaInit +
    +
    [Calls]
    • >>   GetBootloaderSwVersionAddress +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    UdsApi_VehicleInfo2UdsProc (Thumb, 240 bytes, Stack size 16 bytes, uds_api.o(i.UdsApi_VehicleInfo2UdsProc)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = UdsApi_VehicleInfo2UdsProc ⇒ ChkInputIGN1 +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   ChkInputIGN1 +
    • >>   can_bus_off_recovery_times +
    • >>   __aeabi_fmul +
    +
    [Called By]
    • >>   UdsApi_10ms_task +
    + +

    UdsProcTask (Thumb, 138 bytes, Stack size 24 bytes, uds_can_interface.o(i.UdsProcTask)) +

    [Stack]

    • Max Depth = 228
    • Call Chain = UdsProcTask ⇒ UdsQueueCanOut ⇒ ParseUdsCan ⇒ HAL_UDS_FUN_Rx_Callback ⇒ TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UdsQueueCanOut +
    • >>   UDS_ServiceInit +
    • >>   CheckDtcHsCanError +
    • >>   UDS_Nrc78PostProcessing +
    • >>   UDS_Demo_Services_Start +
    • >>   UDS_Demo_Services_Sequence +
    • >>   HAL_UDS_Periodic_Task +
    • >>   GotoDefaultSession +
    • >>   TxQueueCan0Out +
    • >>   UdsApi_ParaInit +
    +
    [Called By]
    • >>   UdsApi_1ms_task +
    + +

    UdsQueueCanIn (Thumb, 104 bytes, Stack size 16 bytes, uds_can_interface.o(i.UdsQueueCanIn)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = UdsQueueCanIn +
    +
    [Calls]
    • >>   Uds_SetMsgMonitorTimer +
    +
    [Called By]
    • >>   UdsApi_MsgQueueIn +
    + +

    UdsQueueCanOut (Thumb, 60 bytes, Stack size 24 bytes, diagnosis_mid.o(i.UdsQueueCanOut)) +

    [Stack]

    • Max Depth = 204
    • Call Chain = UdsQueueCanOut ⇒ ParseUdsCan ⇒ HAL_UDS_FUN_Rx_Callback ⇒ TP_D_UUData_Indication_Functional ⇒ TP_Task ⇒ TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   ParseUdsCan +
    +
    [Called By]
    • >>   UdsProcTask +
    + +

    Uds_SetMsgMonitorTimer (Thumb, 36 bytes, Stack size 0 bytes, diagnosis_mid.o(i.Uds_SetMsgMonitorTimer)) +

    [Called By]

    • >>   UdsQueueCanIn +
    + +

    UpdProcess (Thumb, 676 bytes, Stack size 48 bytes, usart.o(i.UpdProcess)) +

    [Stack]

    • Max Depth = 232
    • Call Chain = UpdProcess ⇒ BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   IWDG_Feed +
    • >>   FLASH_Unlock +
    • >>   FLASH_ProgramWord +
    • >>   FLASH_Lock +
    • >>   FLASH_ErasePage +
    • >>   Blue2CRC16 +
    • >>   BMS_UpdataACKInfo +
    • >>   BMS_Updata2ACKInfo +
    • >>   __2printf +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   sHandleParsePkg +
    + +

    UpdataDebugInfoToServer (Thumb, 42 bytes, Stack size 272 bytes, usart.o(i.UpdataDebugInfoToServer)) +

    [Stack]

    • Max Depth = 312
    • Call Chain = UpdataDebugInfoToServer ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   DP_PackageWriteDataFrame +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   fputc +
    + +

    UpdateDCFrame (Thumb, 126 bytes, Stack size 104 bytes, dc300.o(i.UpdateDCFrame)) +

    [Stack]

    • Max Depth = 128
    • Call Chain = UpdateDCFrame ⇒ RS232_Uart5_Write ⇒ USART5SendByte +
    +
    [Calls]
    • >>   RS232_Uart5_Write +
    • >>   CRC16 +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    UsageFault_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32f10x_it.o(i.UsageFault_Handler)) +

    [Calls]

    • >>   UsageFault_Handler +
    +
    [Called By]
    • >>   UsageFault_Handler +
    +
    [Address Reference Count : 1]
    • startup_stm32f10x_cl.o(RESET) +
    +

    VIN_Input_Sampling (Thumb, 136 bytes, Stack size 24 bytes, adc.o(i.VIN_Input_Sampling)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = VIN_Input_Sampling ⇒ __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_f2d +
    • >>   __aeabi_dadd +
    • >>   __aeabi_d2f +
    • >>   __ARM_scalbnf +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_fmul +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    +
    [Called By]
    • >>   main +
    + +

    VinCalc (Thumb, 132 bytes, Stack size 96 bytes, can.o(i.VinCalc)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = VinCalc +
    +
    [Calls]
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   SysParaDataInit +
    + +

    WWDG_IRQHandler (Thumb, 30 bytes, Stack size 0 bytes, led.o(i.WWDG_IRQHandler)) +
    [Address Reference Count : 1]

    • startup_stm32f10x_cl.o(RESET) +
    +

    Wait50us (Thumb, 144 bytes, Stack size 0 bytes, sys.o(i.Wait50us)) +

    [Called By]

    • >>   Delay_MS +
    + +

    __0printf (Thumb, 22 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED) +

    [Calls]

    • >>   _printf_core +
    + +

    __1printf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED) + +

    __2printf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = __2printf +
    +
    [Called By]
    • >>   app_can_init +
    • >>   SysParaDataInit +
    • >>   RTC_Int_Configuration +
    • >>   PwrManageWork +
    • >>   GetSampleVolt +
    • >>   AppCtrOnoffHandle +
    • >>   main +
    • >>   debug_info +
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    • >>   read_version_cmd_proc +
    • >>   EnterSleepProcess +
    • >>   app_qirui_nm_print +
    • >>   app_qirui_nm_switch +
    • >>   can_bus_off_status_printf +
    • >>   bms_check_status +
    • >>   sHandleParsePkg +
    • >>   cmd_cansend +
    • >>   cmd_al_on +
    • >>   cmd_TT +
    • >>   cmd_PhoneTest +
    • >>   cmd_ONDCDCPrint +
    • >>   cmd_DecodeUniquID +
    • >>   cmd_ADPrint +
    • >>   bat_temp_Info +
    • >>   bat_state_code +
    • >>   bat_Cell_Vol_Info +
    • >>   UpdProcess +
    • >>   Bluetooth_Registered +
    • >>   Bluetooth_Login +
    • >>   Bluetooth_HeartBeat +
    • >>   Bluetooth_DCDC_Data +
    • >>   BMS_VersionInfo +
    • >>   BMS_UpdataACKInfo +
    • >>   BMS_Updata2ACKInfo +
    • >>   BMS_StatusMessage +
    • >>   BMS_ChargingDataInfo +
    • >>   BMS_ChargeInfo +
    • >>   ShellCommad +
    • >>   ParseCommandParam +
    + +

    __c89printf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED) + +

    printf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0printf), UNUSED) + +

    __0sprintf (Thumb, 34 bytes, Stack size 24 bytes, printfa.o(i.__0sprintf), UNUSED) +

    [Calls]

    • >>   _sputc +
    • >>   _printf_core +
    + +

    __1sprintf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0sprintf), UNUSED) + +

    __2sprintf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0sprintf)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = __2sprintf +
    +
    [Called By]
    • >>   SysParaDataInit +
    • >>   Blue_Name_Cfg +
    + +

    __c89sprintf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0sprintf), UNUSED) + +

    sprintf (Thumb, 0 bytes, Stack size 24 bytes, printfa.o(i.__0sprintf), UNUSED) + +

    __scatterload_copy (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_copy), UNUSED) + +

    __scatterload_null (Thumb, 2 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_null), UNUSED) + +

    __scatterload_zeroinit (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_zeroinit), UNUSED) + +

    app_can_handle (Thumb, 204 bytes, Stack size 64 bytes, can_app.o(i.app_can_handle)) +

    [Stack]

    • Max Depth = 176
    • Call Chain = app_can_handle ⇒ can_bus_off_recovery ⇒ app_qirui_nm_handle_2 ⇒ app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   IWDG_Feed +
    • >>   can_porting_schedule +
    • >>   UdsApi_MsgQueueIn +
    • >>   UdsApi_Is_UdsEnableNCMRx +
    • >>   can_bus_off_recovery +
    • >>   CAN_FRAME_INIT +
    • >>   bms_RcvCanSingleDataProc +
    • >>   bms_RcvCanMutliData +
    • >>   bms_RcvCan2DataProc +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   main +
    + +

    app_can_init (Thumb, 114 bytes, Stack size 16 bytes, can_app.o(i.app_can_init)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = app_can_init ⇒ InstallProtocalToIF ⇒ malloc +
    +
    [Calls]
    • >>   can_porting_init +
    • >>   app_qirui_nm_init +
    • >>   InstallProtocalToIF +
    • >>   InitCanifToCanDrvCtrl +
    • >>   InitCanDrvCtrlMode +
    • >>   __2printf +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   main +
    + +

    app_qirui_nm_app_can_send (Thumb, 16 bytes, Stack size 0 bytes, can_nm.o(i.app_qirui_nm_app_can_send)) +

    [Called By]

    • >>   QIRUI_DCDCSendBms2 +
    + +

    app_qirui_nm_handle (Thumb, 2 bytes, Stack size 0 bytes, can.o(i.app_qirui_nm_handle)) +

    [Called By]

    • >>   can_bus_off_recovery +
    + +

    app_qirui_nm_handle_2 (Thumb, 816 bytes, Stack size 24 bytes, can_nm.o(i.app_qirui_nm_handle_2)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = app_qirui_nm_handle_2 ⇒ app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   TickOut +
    • >>   ChkNetworkWakeType +
    • >>   app_qirui_nm_send_NM_Cache +
    • >>   app_qirui_nm_switch +
    • >>   app_qirui_nm_start_t1 +
    • >>   app_qirui_nm_start_sa +
    • >>   app_qirui_nm_net_on_check +
    • >>   app_qirui_nm_acc_on_check +
    • >>   app_qirui_nm_AL_check +
    +
    [Called By]
    • >>   can_bus_off_recovery +
    • >>   app_qr_nm_master_frame +
    + +

    app_qirui_nm_init (Thumb, 8 bytes, Stack size 0 bytes, can_nm.o(i.app_qirui_nm_init)) +

    [Calls]

    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   app_can_init +
    + +

    app_qirui_nm_print (Thumb, 112 bytes, Stack size 16 bytes, can_nm.o(i.app_qirui_nm_print)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = app_qirui_nm_print ⇒ __2printf +
    +
    [Calls]
    • >>   app_qirui_nm_acc_on_check +
    • >>   app_qirui_nm_AL_check +
    • >>   __2printf +
    +
    [Called By]
    • >>   cmd_cansend +
    + +

    app_qirui_nm_send_NM (Thumb, 126 bytes, Stack size 16 bytes, can_nm.o(i.app_qirui_nm_send_NM)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = app_qirui_nm_send_NM ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   qirui_nm_cache_check +
    • >>   app_qirui_nm_AL_check +
    • >>   QIRUI_NMReceiveTimeout +
    • >>   can_write2 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   QIRUI_ActivateBMS +
    + +

    app_qirui_nm_send_NM_Cache (Thumb, 112 bytes, Stack size 16 bytes, can_nm.o(i.app_qirui_nm_send_NM_Cache)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = app_qirui_nm_send_NM_Cache ⇒ app_qirui_nm_AL_check +
    +
    [Calls]
    • >>   app_qirui_nm_AL_check +
    • >>   QIRUI_NMReceiveTimeout +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_qirui_nm_handle_2 +
    • >>   app_qr_nm_master_frame +
    + +

    app_qr_nm_master_frame (Thumb, 104 bytes, Stack size 8 bytes, can_nm.o(i.app_qr_nm_master_frame)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = app_qr_nm_master_frame ⇒ app_qirui_nm_handle_2 ⇒ app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   TickOut +
    • >>   app_qirui_nm_send_NM_Cache +
    • >>   app_qirui_nm_start_sa +
    • >>   app_qirui_nm_handle_2 +
    +
    [Called By]
    • >>   QIRUI_NMmaster +
    + +

    bat_Cell_Vol_Info (Thumb, 90 bytes, Stack size 144 bytes, usart.o(i.bat_Cell_Vol_Info)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = bat_Cell_Vol_Info ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    bat_state_code (Thumb, 146 bytes, Stack size 144 bytes, usart.o(i.bat_state_code)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = bat_state_code ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    bat_temp_Info (Thumb, 164 bytes, Stack size 144 bytes, usart.o(i.bat_temp_Info)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = bat_temp_Info ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   DP_PackageWriteDataFrame +
    • >>   __2printf +
    +
    [Called By]
    • >>   BluetoothDataProcess +
    + +

    bms_RcvCan2DataProc (Thumb, 324 bytes, Stack size 48 bytes, can.o(i.bms_RcvCan2DataProc)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = bms_RcvCan2DataProc +
    +
    [Calls]
    • >>   TickOut +
    • >>   GPIO_SetBits +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    bms_RcvCanMutliData (Thumb, 138 bytes, Stack size 32 bytes, can.o(i.bms_RcvCanMutliData)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_RcvCanMutliData +
    +
    [Calls]
    • >>   TickOut +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    bms_RcvCanSingleDataProc (Thumb, 166 bytes, Stack size 32 bytes, can.o(i.bms_RcvCanSingleDataProc)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = bms_RcvCanSingleDataProc ⇒ bms_parseData ⇒ CDZ_ParseCCS +
    +
    [Calls]
    • >>   bms_parseData +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    bms_SendBCL (Thumb, 74 bytes, Stack size 8 bytes, can.o(i.bms_SendBCL)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = bms_SendBCL ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBCP (Thumb, 262 bytes, Stack size 24 bytes, can.o(i.bms_SendBCP)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = bms_SendBCP ⇒ Battery_Soc_Calculate ⇒ Battery_NewSoc_CalibrationCalculate ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   Battery_Soc_Calculate +
    • >>   can_write +
    • >>   Delay_MS +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBCS (Thumb, 246 bytes, Stack size 24 bytes, can.o(i.bms_SendBCS)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = bms_SendBCS ⇒ can_write +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   can_write +
    • >>   Delay_MS +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBHM (Thumb, 52 bytes, Stack size 16 bytes, can.o(i.bms_SendBHM)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_SendBHM ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBRM (Thumb, 492 bytes, Stack size 56 bytes, can.o(i.bms_SendBRM)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = bms_SendBRM ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   Delay_MS +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memset +
    • >>   __aeabi_memcpy4 +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBRO (Thumb, 48 bytes, Stack size 16 bytes, can.o(i.bms_SendBRO)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_SendBRO ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBSD (Thumb, 84 bytes, Stack size 16 bytes, can.o(i.bms_SendBSD)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_SendBSD ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBSM (Thumb, 452 bytes, Stack size 40 bytes, can.o(i.bms_SendBSM)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = bms_SendBSM ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   can_write +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_fadd +
    • >>   __aeabi_cfrcmple +
    • >>   __aeabi_cfcmple +
    • >>   TickOutCycle +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_SendBST (Thumb, 52 bytes, Stack size 16 bytes, can.o(i.bms_SendBST)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_SendBST ⇒ can_write +
    +
    [Calls]
    • >>   can_write +
    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bms_check_status (Thumb, 210 bytes, Stack size 40 bytes, can.o(i.bms_check_status)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = bms_check_status ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    bsp_CmpCpuFlash (Thumb, 62 bytes, Stack size 16 bytes, bsp_cpu_flash.o(i.bsp_CmpCpuFlash)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = bsp_CmpCpuFlash +
    +
    [Called By]
    • >>   bsp_WriteCpuFlash +
    + +

    bsp_InitI2C (Thumb, 80 bytes, Stack size 24 bytes, bsp_i2c_gpio.o(i.bsp_InitI2C)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = bsp_InitI2C ⇒ GPIO_Init +
    +
    [Calls]
    • >>   GPIO_SetBits +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    +
    [Called By]
    • >>   ee_Init +
    + +

    bsp_ReadCpuFlash (Thumb, 38 bytes, Stack size 8 bytes, bsp_cpu_flash.o(i.bsp_ReadCpuFlash)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = bsp_ReadCpuFlash +
    +
    [Called By]
    • >>   SysParaDataInit +
    + +

    bsp_WriteCpuFlash (Thumb, 146 bytes, Stack size 24 bytes, bsp_cpu_flash.o(i.bsp_WriteCpuFlash)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = bsp_WriteCpuFlash ⇒ FLASH_ProgramHalfWord ⇒ FLASH_WaitForLastOperation +
    +
    [Calls]
    • >>   FLASH_Unlock +
    • >>   FLASH_ProgramHalfWord +
    • >>   FLASH_Lock +
    • >>   FLASH_ErasePage +
    • >>   FLASH_ClearFlag +
    • >>   bsp_CmpCpuFlash +
    +
    [Called By]
    • >>   SysWriteSysParm +
    + +

    bsp_can_close (Thumb, 30 bytes, Stack size 8 bytes, bsp_can.o(i.bsp_can_close)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = bsp_can_close ⇒ CAN_DeInit +
    +
    [Calls]
    • >>   CAN_OperatingModeRequest +
    • >>   CAN_DeInit +
    +
    [Called By]
    • >>   can_bus_close +
    + +

    bsp_can_msg_receive_hook (Thumb, 52 bytes, Stack size 8 bytes, canbusdrv.o(i.bsp_can_msg_receive_hook)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = bsp_can_msg_receive_hook +
    +
    [Called By]
    • >>   CAN2_RX1_IRQHandler +
    • >>   CAN1_RX0_IRQHandler +
    + +

    bsp_can_msg_send (Thumb, 22 bytes, Stack size 8 bytes, bsp_can.o(i.bsp_can_msg_send)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = bsp_can_msg_send ⇒ CAN_Transmit +
    +
    [Calls]
    • >>   CAN_Transmit +
    +
    [Called By]
    • >>   can_bus_send_rt +
    + +

    bsp_can_msg_sent_hook (Thumb, 54 bytes, Stack size 8 bytes, canbusdrv.o(i.bsp_can_msg_sent_hook)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = bsp_can_msg_sent_hook +
    +
    [Called By]
    • >>   CAN2_TX_IRQHandler +
    • >>   CAN1_TX_IRQHandler +
    + +

    bsp_can_open (Thumb, 18 bytes, Stack size 8 bytes, bsp_can.o(i.bsp_can_open)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = bsp_can_open ⇒ CAN_Mode_Init ⇒ __2printf +
    +
    [Calls]
    • >>   CAN_Mode_Init +
    • >>   CAN2_Mode_Init +
    +
    [Called By]
    • >>   can_bus_open +
    + +

    can2_bus_error_cb (Thumb, 46 bytes, Stack size 8 bytes, can_app.o(i.can2_bus_error_cb)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = can2_bus_error_cb +
    +
    [Calls]
    • >>   TickOut +
    +
    [Address Reference Count : 1]
    • can_app.o(.data) +
    +

    can_bus_close (Thumb, 18 bytes, Stack size 0 bytes, canbusdrv.o(i.can_bus_close)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = can_bus_close ⇒ bsp_can_close ⇒ CAN_DeInit +
    +
    [Calls]
    • >>   bsp_can_close +
    +
    [Address Reference Count : 1]
    • canbusdrv.o(.constdata) +
    +

    can_bus_err_passive_hook (Thumb, 42 bytes, Stack size 0 bytes, canbusdrv.o(i.can_bus_err_passive_hook)) +

    [Called By]

    • >>   CAN2_SCE_IRQHandler +
    • >>   CAN1_SCE_IRQHandler +
    + +

    can_bus_off_hook (Thumb, 58 bytes, Stack size 8 bytes, canbusdrv.o(i.can_bus_off_hook)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = can_bus_off_hook +
    +
    [Calls]
    • >>   SYS_EXIT_CRITICAL +
    • >>   SYS_ENTER_CRITICAL +
    +
    [Called By]
    • >>   CAN2_SCE_IRQHandler +
    • >>   CAN1_SCE_IRQHandler +
    • >>   cmd_OFF +
    + +

    can_bus_off_recovery (Thumb, 200 bytes, Stack size 48 bytes, can_app.o(i.can_bus_off_recovery)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = can_bus_off_recovery ⇒ app_qirui_nm_handle_2 ⇒ app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   TickOut +
    • >>   SYS_EXIT_CRITICAL +
    • >>   SYS_ENTER_CRITICAL +
    • >>   app_qirui_nm_handle_2 +
    • >>   app_qirui_nm_handle +
    • >>   QIRUI_DCDCSendBms2_force +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    can_bus_off_recovery_times (Thumb, 10 bytes, Stack size 0 bytes, can_app.o(i.can_bus_off_recovery_times)) +

    [Called By]

    • >>   UdsApi_VehicleInfo2UdsProc +
    + +

    can_bus_off_status_printf (Thumb, 38 bytes, Stack size 16 bytes, can_app.o(i.can_bus_off_status_printf)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = can_bus_off_status_printf ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Called By]
    • >>   cmd_cansend +
    + +

    can_bus_open (Thumb, 62 bytes, Stack size 24 bytes, canbusdrv.o(i.can_bus_open)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = can_bus_open ⇒ bsp_can_open ⇒ CAN_Mode_Init ⇒ __2printf +
    +
    [Calls]
    • >>   bsp_can_open +
    +
    [Address Reference Count : 1]
    • canbusdrv.o(.constdata) +
    +

    can_bus_send_rt (Thumb, 62 bytes, Stack size 16 bytes, canbusdrv.o(i.can_bus_send_rt)) +

    [Stack]

    • Max Depth = 36
    • Call Chain = can_bus_send_rt ⇒ bsp_can_msg_send ⇒ CAN_Transmit +
    +
    [Calls]
    • >>   bsp_can_msg_send +
    • >>   CAN_FRAME_INIT +
    +
    [Address Reference Count : 1]
    • canbusdrv.o(.constdata) +
    +

    can_kill (Thumb, 16 bytes, Stack size 16 bytes, porting.o(i.can_kill)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   sfifo_write +
    +
    [Called By]
    • >>   waitSendMsgAck +
    • >>   hdlIfFrmReceve +
    • >>   hdlIfBusOffCb +
    • >>   hdlIfBusErrorCb +
    • >>   hdlCanCtrlMsg +
    • >>   HdlAllSengMsgSts +
    + +

    can_porting_init (Thumb, 14 bytes, Stack size 8 bytes, porting.o(i.can_porting_init)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = can_porting_init ⇒ can_signal_queue_init ⇒ sfifo_init +
    +
    [Calls]
    • >>   can_timer_init +
    • >>   can_signal_queue_init +
    +
    [Called By]
    • >>   app_can_init +
    + +

    can_porting_schedule (Thumb, 14 bytes, Stack size 8 bytes, porting.o(i.can_porting_schedule)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = can_porting_schedule ⇒ can_timer_schedule +
    +
    [Calls]
    • >>   can_timer_schedule +
    • >>   can_signal_schedule +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    can_sent_cycle_timeout (Thumb, 50 bytes, Stack size 8 bytes, can_app.o(i.can_sent_cycle_timeout)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = can_sent_cycle_timeout +
    +
    [Calls]
    • >>   TickOut +
    +
    [Called By]
    • >>   QIRUI_DCDCSendBms2 +
    + +

    can_signal (Thumb, 84 bytes, Stack size 12 bytes, porting.o(i.can_signal)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = can_signal +
    +
    [Called By]
    • >>   InitCanDrvCtrlMode +
    + +

    can_signal_queue_init (Thumb, 32 bytes, Stack size 8 bytes, porting.o(i.can_signal_queue_init)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = can_signal_queue_init ⇒ sfifo_init +
    +
    [Calls]
    • >>   sfifo_init +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   can_porting_init +
    + +

    can_signal_schedule (Thumb, 66 bytes, Stack size 24 bytes, porting.o(i.can_signal_schedule)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = can_signal_schedule ⇒ sfifo_read +
    +
    [Calls]
    • >>   sfifo_read +
    • >>   sfifo_empty +
    +
    [Called By]
    • >>   can_porting_schedule +
    + +

    can_timer_create (Thumb, 52 bytes, Stack size 0 bytes, porting.o(i.can_timer_create)) +

    [Called By]

    • >>   InitCanDrvCtrlMode +
    + +

    can_timer_init (Thumb, 14 bytes, Stack size 8 bytes, porting.o(i.can_timer_init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = can_timer_init +
    +
    [Calls]
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   can_porting_init +
    + +

    can_timer_schedule (Thumb, 92 bytes, Stack size 32 bytes, porting.o(i.can_timer_schedule)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = can_timer_schedule +
    +
    [Calls]
    • >>   TickOut +
    +
    [Called By]
    • >>   can_porting_schedule +
    + +

    can_timer_start (Thumb, 14 bytes, Stack size 0 bytes, porting.o(i.can_timer_start)) +

    [Calls]

    • >>   TickOut +
    +
    [Called By]
    • >>   InitCanDrvCtrlMode +
    + +

    can_timer_switch (Thumb, 14 bytes, Stack size 0 bytes, porting.o(i.can_timer_switch)) +

    [Called By]

    • >>   InitCanDrvCtrlMode +
    + +

    can_write (Thumb, 60 bytes, Stack size 16 bytes, can_app.o(i.can_write)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = can_write +
    +
    [Called By]
    • >>   bms_SendBST +
    • >>   bms_SendBSM +
    • >>   bms_SendBSD +
    • >>   bms_SendBRO +
    • >>   bms_SendBRM +
    • >>   bms_SendBHM +
    • >>   bms_SendBCS +
    • >>   bms_SendBCP +
    • >>   bms_SendBCL +
    + +

    can_write2 (Thumb, 180 bytes, Stack size 24 bytes, can_app.o(i.can_write2)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   UdsApi_Is_UdsEnableNCMTx +
    • >>   IsAppCanID +
    • >>   __aeabi_fmul +
    +
    [Called By]
    • >>   app_qirui_nm_send_NM +
    • >>   QIRUI_DCDCState +
    • >>   FDC_General_Status_5 +
    • >>   FDC_General_Status_4 +
    • >>   FDC_General_Status_3 +
    • >>   FDC_General_Status_2 +
    • >>   UdsApi_MsgQueueOut +
    • >>   cmd_TT +
    + +

    clear_fdc_check_download_status (Thumb, 16 bytes, Stack size 0 bytes, dc300.o(i.clear_fdc_check_download_status)) +

    [Called By]

    • >>   DCDC_Power_Handle +
    + +

    cmd_ADPrint (Thumb, 2290 bytes, Stack size 40 bytes, usart.o(i.cmd_ADPrint)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = cmd_ADPrint ⇒ __2printf +
    +
    [Calls]
    • >>   __aeabi_f2iz +
    • >>   __aeabi_f2d +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_i2f +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    • >>   __aeabi_fsub +
    • >>   StringToInt +
    • >>   __2printf +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_DecodeUniquID (Thumb, 56 bytes, Stack size 8 bytes, usart.o(i.cmd_DecodeUniquID)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = cmd_DecodeUniquID ⇒ __2printf +
    +
    [Calls]
    • >>   StringToInt +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_OFF (Thumb, 6 bytes, Stack size 0 bytes, usart.o(i.cmd_OFF)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = cmd_OFF ⇒ can_bus_off_hook +
    +
    [Calls]
    • >>   can_bus_off_hook +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_OFFDCDCPrint (Thumb, 40 bytes, Stack size 8 bytes, usart.o(i.cmd_OFFDCDCPrint)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = cmd_OFFDCDCPrint ⇒ StringToInt +
    +
    [Calls]
    • >>   TakeDCPowerOff +
    • >>   StringToInt +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_ONDCDCPrint (Thumb, 328 bytes, Stack size 40 bytes, usart.o(i.cmd_ONDCDCPrint)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = cmd_ONDCDCPrint ⇒ __2printf +
    +
    [Calls]
    • >>   GPIO_SetBits +
    • >>   TakeDCPowerOn +
    • >>   StringToInt +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_PhoneTest (Thumb, 76 bytes, Stack size 8 bytes, usart.o(i.cmd_PhoneTest)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = cmd_PhoneTest ⇒ __2printf +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_SetAPNPassword (Thumb, 2 bytes, Stack size 0 bytes, usart.o(i.cmd_SetAPNPassword)) +
    [Address Reference Count : 1]

    • usart.o(.constdata) +
    +

    cmd_SetAPNUser (Thumb, 2 bytes, Stack size 0 bytes, usart.o(i.cmd_SetAPNUser)) +
    [Address Reference Count : 1]

    • usart.o(.constdata) +
    +

    cmd_TT (Thumb, 380 bytes, Stack size 24 bytes, usart.o(i.cmd_TT)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = cmd_TT ⇒ can_write2 ⇒ __aeabi_fmul +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   __aeabi_f2d +
    • >>   GPIO_SetBits +
    • >>   GPIO_ReadInputDataBit +
    • >>   can_write2 +
    • >>   Delay_MS +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_al_on (Thumb, 12 bytes, Stack size 0 bytes, usart.o(i.cmd_al_on)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = cmd_al_on ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    cmd_cansend (Thumb, 28 bytes, Stack size 8 bytes, usart.o(i.cmd_cansend)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = cmd_cansend ⇒ app_qirui_nm_print ⇒ __2printf +
    +
    [Calls]
    • >>   TickOut +
    • >>   app_qirui_nm_print +
    • >>   can_bus_off_status_printf +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • usart.o(.constdata) +
    +

    dc300FrameParser (Thumb, 164 bytes, Stack size 32 bytes, dc300.o(i.dc300FrameParser)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = dc300FrameParser ⇒ CRC16 +
    +
    [Calls]
    • >>   request_lookup +
    • >>   CRC16 +
    • >>   __aeabi_memclr +
    +
    [Called By]
    • >>   main +
    + +

    debug_info (Thumb, 502 bytes, Stack size 40 bytes, main.o(i.debug_info)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = debug_info ⇒ __2printf +
    +
    [Calls]
    • >>   sIsFdcExistFault +
    • >>   __aeabi_f2uiz +
    • >>   __aeabi_f2iz +
    • >>   __aeabi_f2d +
    • >>   TickOut +
    • >>   Calculate_Absolute_Value +
    • >>   __2printf +
    +
    [Called By]
    • >>   main +
    + +

    debugdataprocess (Thumb, 78 bytes, Stack size 24 bytes, usart.o(i.debugdataprocess)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = debugdataprocess ⇒ UART4SendByte +
    +
    [Calls]
    • >>   UART4SendByte +
    • >>   GprsCommGetAscMSB +
    • >>   GprsCommGetAscLSB +
    +
    [Called By]
    • >>   sHandleParsePkg +
    • >>   BMS_UpdataACKInfo +
    • >>   BMS_Updata2ACKInfo +
    + +

    delay_nms (Thumb, 24 bytes, Stack size 0 bytes, ads1015.o(i.delay_nms)) +

    [Called By]

    • >>   getad +
    + +

    ee_Init (Thumb, 4 bytes, Stack size 0 bytes, 24cxx.o(i.ee_Init)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = ee_Init ⇒ bsp_InitI2C ⇒ GPIO_Init +
    +
    [Calls]
    • >>   bsp_InitI2C +
    +
    [Called By]
    • >>   main +
    + +

    ee_ReadBytes (Thumb, 114 bytes, Stack size 24 bytes, 24cxx.o(i.ee_ReadBytes)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = ee_ReadBytes ⇒ IIC_Read_Byte ⇒ IIC_Ack +
    +
    [Calls]
    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    • >>   IIC_Send_Byte +
    • >>   IIC_Read_Byte +
    +
    [Called By]
    • >>   UdsApi_EE_ReadBytes +
    + +

    ee_WriteBytes (Thumb, 112 bytes, Stack size 24 bytes, 24cxx.o(i.ee_WriteBytes)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    • >>   IIC_Send_Byte +
    • >>   Delay_MS +
    +
    [Called By]
    • >>   UdsApi_EE_WriteBytes +
    + +

    fdc_check_download_status (Thumb, 102 bytes, Stack size 16 bytes, dc300.o(i.fdc_check_download_status)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = fdc_check_download_status +
    +
    [Calls]
    • >>   TickOut +
    • >>   Calculate_Absolute_Value +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    fputc (Thumb, 68 bytes, Stack size 16 bytes, usart.o(i.fputc)) +

    [Stack]

    • Max Depth = 328
    • Call Chain = fputc ⇒ UpdataDebugInfoToServer ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   USART_SendData +
    • >>   UpdataDebugInfoToServer +
    +
    [Address Reference Count : 1]
    • printfa.o(i.__0printf) +
    +

    free (Thumb, 76 bytes, Stack size 8 bytes, malloc.o(i.free)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = free +
    +
    [Called By]
    • >>   InstallProtocalToIF +
    + +

    getad (Thumb, 22 bytes, Stack size 4 bytes, ads1015.o(i.getad)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = getad ⇒ ADS1115Config_A ⇒ I2CWriteByte_A +
    +
    [Calls]
    • >>   delay_nms +
    • >>   ReadAD_A +
    • >>   ADS1115Config_A +
    +
    [Called By]
    • >>   lvbo +
    + +

    lvbo (Thumb, 58 bytes, Stack size 8 bytes, ads1015.o(i.lvbo)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = lvbo ⇒ getad ⇒ ADS1115Config_A ⇒ I2CWriteByte_A +
    +
    [Calls]
    • >>   getad +
    +
    [Called By]
    • >>   GetSampleVolt +
    + +

    main (Thumb, 564 bytes, Stack size 24 bytes, main.o(i.main)) +

    [Stack]

    • Max Depth = 384
    • Call Chain = main ⇒ Blue_Receive_Parser ⇒ sHandleParsePkg ⇒ UpdProcess ⇒ BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   uart5_init +
    • >>   uart4_init +
    • >>   uart2_init +
    • >>   ee_Init +
    • >>   dc300FrameParser +
    • >>   app_can_init +
    • >>   app_can_handle +
    • >>   VIN_Input_Sampling +
    • >>   UdsApi_NVM_Init +
    • >>   UdsApi_BootSwAddr_Get +
    • >>   UdsApi_1ms_task +
    • >>   UdsApi_10ms_task +
    • >>   TimeTaskDispatch_Flag +
    • >>   TIM3_Int_Init +
    • >>   SysTick_Init +
    • >>   SysStoreSysParm +
    • >>   SysParaDataInit +
    • >>   RTC_Int_Configuration +
    • >>   RTC_EXTI_INITIAL +
    • >>   RCC_GetClocksFreq +
    • >>   Pwr_BatVoltRangeMonitor +
    • >>   PwrManageWork +
    • >>   NVIC_SetVectorTable +
    • >>   NVIC_Configuration +
    • >>   LED_Init +
    • >>   IWDG_Init +
    • >>   IWDG_Feed +
    • >>   Gun_Input_Sampling +
    • >>   Get_ChipID +
    • >>   GetSampleVolt +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   DCDC_Power_Handle +
    • >>   Charger_ProtectCheck +
    • >>   BmsParaDataInit +
    • >>   BluetoothConnectProcess +
    • >>   Blue_Receive_Parser +
    • >>   BSP_BKP_Init +
    • >>   BMS_Temperatrue_Sampling +
    • >>   AppCtrOnoffHandle +
    • >>   ADS1115_Init +
    • >>   ADC1_Init +
    • >>   debug_info +
    • >>   LED_Ctrl +
    • >>   __2printf +
    • >>   strlen +
    +
    [Address Reference Count : 1]
    • entry9a.o(.ARM.Collect$$$$0000000B) +
    +

    malloc (Thumb, 92 bytes, Stack size 20 bytes, malloc.o(i.malloc)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = malloc +
    +
    [Called By]
    • >>   InstallProtocalToIF +
    + +

    nvm_write (Thumb, 56 bytes, Stack size 16 bytes, uds_nvm.o(i.nvm_write)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   UdsApi_EE_WriteBytes +
    +
    [Called By]
    • >>   uds_service_nvm_write +
    + +

    qirui_nm_cache_check (Thumb, 18 bytes, Stack size 0 bytes, can_nm.o(i.qirui_nm_cache_check)) +

    [Called By]

    • >>   app_qirui_nm_send_NM +
    + +

    qiruibms_check_status (Thumb, 114 bytes, Stack size 16 bytes, can.o(i.qiruibms_check_status)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = qiruibms_check_status +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    • >>   AppCtrOnoffHandle +
    + +

    request_lookup (Thumb, 42 bytes, Stack size 8 bytes, dc300.o(i.request_lookup)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = request_lookup +
    +
    [Called By]
    • >>   dc300FrameParser +
    + +

    sHandleParsePkg (Thumb, 6910 bytes, Stack size 112 bytes, usart.o(i.sHandleParsePkg)) +

    [Stack]

    • Max Depth = 344
    • Call Chain = sHandleParsePkg ⇒ UpdProcess ⇒ BMS_UpdataACKInfo ⇒ DP_PackageWriteDataFrame ⇒ Bluetooth_Data_Send ⇒ RS232_Blue_DataWrite ⇒ USART2SendByte +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   GPIO_SetBits +
    • >>   GPIO_ResetBits +
    • >>   SysWriteSysParm +
    • >>   updata_param +
    • >>   debugdataprocess +
    • >>   UpdProcess +
    • >>   DP_PackageWriteDataFrame +
    • >>   BlueCRC16 +
    • >>   __2printf +
    • >>   strlen +
    • >>   __aeabi_memclr4 +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   Blue_Receive_Parser +
    + +

    sIsFdcExistFault (Thumb, 14 bytes, Stack size 0 bytes, sys.o(i.sIsFdcExistFault)) +

    [Called By]

    • >>   AppCtrOnoffHandle +
    • >>   debug_info +
    • >>   QIRUI_DCDCState +
    + +

    sfifo_empty (Thumb, 16 bytes, Stack size 0 bytes, porting.o(i.sfifo_empty)) +

    [Called By]

    • >>   can_signal_schedule +
    • >>   plReceive +
    • >>   plCloseLink +
    • >>   HdlAllSengMsgSts +
    + +

    sfifo_full (Thumb, 16 bytes, Stack size 0 bytes, porting.o(i.sfifo_full)) +

    [Called By]

    • >>   plSend +
    • >>   hdlIfFrmReceve +
    + +

    sfifo_init (Thumb, 24 bytes, Stack size 8 bytes, porting.o(i.sfifo_init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = sfifo_init +
    +
    [Called By]
    • >>   can_signal_queue_init +
    • >>   plConfigBus +
    • >>   InstallProtocalToIF +
    + +

    sfifo_read (Thumb, 56 bytes, Stack size 8 bytes, porting.o(i.sfifo_read)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = sfifo_read +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   can_signal_schedule +
    • >>   plReceive +
    • >>   plCloseLink +
    • >>   HdlAllSengMsgSts +
    + +

    sfifo_write (Thumb, 56 bytes, Stack size 8 bytes, porting.o(i.sfifo_write)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = sfifo_write +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   can_kill +
    • >>   plSend +
    • >>   hdlIfFrmReceve +
    + +

    uart2_init (Thumb, 176 bytes, Stack size 40 bytes, usart.o(i.uart2_init)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = uart2_init ⇒ USART_Init ⇒ RCC_GetClocksFreq +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   USART_Init +
    • >>   USART_ITConfig +
    • >>   USART_Cmd +
    • >>   USART_ClearFlag +
    +
    [Called By]
    • >>   main +
    + +

    uart4_init (Thumb, 182 bytes, Stack size 40 bytes, usart.o(i.uart4_init)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = uart4_init ⇒ USART_Init ⇒ RCC_GetClocksFreq +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   USART_Init +
    • >>   USART_ITConfig +
    • >>   USART_Cmd +
    +
    [Called By]
    • >>   main +
    • >>   EnterSleepProcess +
    + +

    uart5_init (Thumb, 168 bytes, Stack size 40 bytes, usart.o(i.uart5_init)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = uart5_init ⇒ USART_Init ⇒ RCC_GetClocksFreq +
    +
    [Calls]
    • >>   NVIC_Init +
    • >>   GPIO_Init +
    • >>   RCC_APB2PeriphClockCmd +
    • >>   RCC_APB1PeriphClockCmd +
    • >>   USART_Init +
    • >>   USART_ITConfig +
    • >>   USART_Cmd +
    +
    [Called By]
    • >>   main +
    + +

    uds_service_nvm_write (Thumb, 4 bytes, Stack size 0 bytes, uds_nvm.o(i.uds_service_nvm_write)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   nvm_write +
    +
    [Called By]
    • >>   EE_Write +
    + +

    updata_param (Thumb, 152 bytes, Stack size 8 bytes, usart.o(i.updata_param)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = updata_param +
    +
    [Called By]
    • >>   sHandleParsePkg +
    +

    +

    +Local Symbols +

    +

    SetSysClockTo72 (Thumb, 190 bytes, Stack size 12 bytes, system_stm32f10x.o(i.SetSysClockTo72)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = SetSysClockTo72 +
    +
    [Called By]
    • >>   SystemInit +
    + +

    CheckITStatus (Thumb, 12 bytes, Stack size 0 bytes, stm32f10x_can.o(i.CheckITStatus)) +

    [Called By]

    • >>   CAN_GetITStatus +
    + +

    Battery_Energy_Calculate (Thumb, 110 bytes, Stack size 8 bytes, can.o(i.Battery_Energy_Calculate)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = Battery_Energy_Calculate ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_f2d +
    • >>   TickOut +
    • >>   __aeabi_i2f +
    • >>   __aeabi_fadd +
    • >>   __aeabi_dmul +
    • >>   __aeabi_ddiv +
    • >>   __aeabi_d2uiz +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    Battery_NewSoc_CalibrationCalculate (Thumb, 258 bytes, Stack size 32 bytes, can.o(i.Battery_NewSoc_CalibrationCalculate)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = Battery_NewSoc_CalibrationCalculate ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   TickOut +
    • >>   Calculate_Absolute_Value +
    • >>   __aeabi_ui2f +
    • >>   __aeabi_i2f +
    • >>   __aeabi_fmul +
    • >>   __aeabi_fdiv +
    • >>   __aeabi_fadd +
    +
    [Called By]
    • >>   Battery_Soc_Calculate +
    + +

    Battery_RequireVoltCur_Calculate (Thumb, 432 bytes, Stack size 24 bytes, can.o(i.Battery_RequireVoltCur_Calculate)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = Battery_RequireVoltCur_Calculate ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   TickOut +
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    + +

    Battery_Soc_AnalogCalculate (Thumb, 166 bytes, Stack size 16 bytes, can.o(i.Battery_Soc_AnalogCalculate)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = Battery_Soc_AnalogCalculate +
    +
    [Calls]
    • >>   TickOut +
    • >>   Calculate_Absolute_Value +
    +
    [Called By]
    • >>   Battery_Soc_Calculate +
    + +

    Battery_Soc_Calculate (Thumb, 90 bytes, Stack size 16 bytes, can.o(i.Battery_Soc_Calculate)) +

    [Stack]

    • Max Depth = 68
    • Call Chain = Battery_Soc_Calculate ⇒ Battery_NewSoc_CalibrationCalculate ⇒ __aeabi_fadd ⇒ _float_epilogue +
    +
    [Calls]
    • >>   __aeabi_f2uiz +
    • >>   Battery_Soc_AnalogCalculate +
    • >>   Battery_NewSoc_CalibrationCalculate +
    +
    [Called By]
    • >>   AppCtrOnoffHandle +
    • >>   bms_SendBCP +
    + +

    CDZ_ParseCCS (Thumb, 90 bytes, Stack size 8 bytes, can.o(i.CDZ_ParseCCS)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CDZ_ParseCCS +
    +
    [Called By]
    • >>   bms_parseData +
    + +

    CDZ_ParseCTS (Thumb, 86 bytes, Stack size 4 bytes, can.o(i.CDZ_ParseCTS)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = CDZ_ParseCTS +
    +
    [Calls]
    • >>   BCD2HEX +
    +
    [Called By]
    • >>   bms_parseData +
    + +

    QIRUI_NMmaster (Thumb, 38 bytes, Stack size 8 bytes, can.o(i.QIRUI_NMmaster)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = QIRUI_NMmaster ⇒ app_qr_nm_master_frame ⇒ app_qirui_nm_handle_2 ⇒ app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   app_qr_nm_master_frame +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_Parse100 (Thumb, 10 bytes, Stack size 0 bytes, can.o(i.QIRUI_Parse100)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBCM1 (Thumb, 18 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBCM1)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS1 (Thumb, 126 bytes, Stack size 24 bytes, can.o(i.QIRUI_ParseBMS1)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = QIRUI_ParseBMS1 ⇒ __aeabi_dsub ⇒ __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dsub +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBMS10 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS10)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS11 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS11)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS12 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS12)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS13 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS13)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS14 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS14)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS15 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS15)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS16 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS16)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS17 (Thumb, 34 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS17)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS18 (Thumb, 42 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS18)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS2 (Thumb, 80 bytes, Stack size 24 bytes, can.o(i.QIRUI_ParseBMS2)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = QIRUI_ParseBMS2 ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBMS24 (Thumb, 50 bytes, Stack size 8 bytes, can.o(i.QIRUI_ParseBMS24)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = QIRUI_ParseBMS24 +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBMS3 (Thumb, 114 bytes, Stack size 24 bytes, can.o(i.QIRUI_ParseBMS3)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = QIRUI_ParseBMS3 ⇒ __aeabi_dsub ⇒ __aeabi_dadd ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_i2d +
    • >>   __aeabi_dsub +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    • >>   __aeabi_d2iz +
    • >>   __ARM_scalbn +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBMS4 (Thumb, 42 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS4)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS5 (Thumb, 74 bytes, Stack size 24 bytes, can.o(i.QIRUI_ParseBMS5)) +

    [Stack]

    • Max Depth = 112
    • Call Chain = QIRUI_ParseBMS5 ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBMS6 (Thumb, 40 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS6)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS7 (Thumb, 40 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBMS7)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseBMS9 (Thumb, 62 bytes, Stack size 16 bytes, can.o(i.QIRUI_ParseBMS9)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = QIRUI_ParseBMS9 ⇒ __aeabi_ui2d ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_d2uiz +
    • >>   __ARM_scalbn +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseBattTempSensor18 (Thumb, 102 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseBattTempSensor18)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseGW_VCU_1 (Thumb, 70 bytes, Stack size 16 bytes, can.o(i.QIRUI_ParseGW_VCU_1)) +

    [Stack]

    • Max Depth = 104
    • Call Chain = QIRUI_ParseGW_VCU_1 ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseICM1 (Thumb, 44 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseICM1)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    QIRUI_ParseMCU_1 (Thumb, 20 bytes, Stack size 8 bytes, can.o(i.QIRUI_ParseMCU_1)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = QIRUI_ParseMCU_1 ⇒ __aeabi_d2uiz +
    +
    [Calls]
    • >>   __aeabi_d2uiz +
    +
    [Address Reference Count : 1]
    • can.o(.data) +
    +

    QIRUI_ParseTBOX_2 (Thumb, 44 bytes, Stack size 0 bytes, can.o(i.QIRUI_ParseTBOX_2)) +
    [Address Reference Count : 1]

    • can.o(.data) +
    +

    bms_parseData (Thumb, 368 bytes, Stack size 24 bytes, can.o(i.bms_parseData)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = bms_parseData ⇒ CDZ_ParseCCS +
    +
    [Calls]
    • >>   CDZ_ParseCTS +
    • >>   CDZ_ParseCCS +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   bms_RcvCanSingleDataProc +
    + +

    CAN_FRAME_INIT (Thumb, 64 bytes, Stack size 8 bytes, can_app.o(i.CAN_FRAME_INIT)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CAN_FRAME_INIT +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   app_can_handle +
    + +

    can2_comm_sent_cb (Thumb, 68 bytes, Stack size 16 bytes, can_app.o(i.can2_comm_sent_cb)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = can2_comm_sent_cb +
    +
    [Calls]
    • >>   TickOut +
    +
    [Address Reference Count : 1]
    • can_app.o(.data) +
    +

    QIRUI_NMReceiveTimeout (Thumb, 28 bytes, Stack size 8 bytes, can_nm.o(i.QIRUI_NMReceiveTimeout)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = QIRUI_NMReceiveTimeout +
    +
    [Calls]
    • >>   TickOut +
    +
    [Called By]
    • >>   app_qirui_nm_send_NM_Cache +
    • >>   app_qirui_nm_send_NM +
    + +

    app_qirui_nm_AL_check (Thumb, 54 bytes, Stack size 8 bytes, can_nm.o(i.app_qirui_nm_AL_check)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = app_qirui_nm_AL_check +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    +
    [Called By]
    • >>   app_qirui_nm_send_NM_Cache +
    • >>   app_qirui_nm_print +
    • >>   app_qirui_nm_handle_2 +
    • >>   app_qirui_nm_send_NM +
    + +

    app_qirui_nm_acc_on_check (Thumb, 22 bytes, Stack size 8 bytes, can_nm.o(i.app_qirui_nm_acc_on_check)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = app_qirui_nm_acc_on_check +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    +
    [Called By]
    • >>   app_qirui_nm_print +
    • >>   app_qirui_nm_handle_2 +
    + +

    app_qirui_nm_net_on_check (Thumb, 42 bytes, Stack size 8 bytes, can_nm.o(i.app_qirui_nm_net_on_check)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = app_qirui_nm_net_on_check +
    +
    [Calls]
    • >>   GPIO_ReadInputDataBit +
    • >>   ChkNetworkManageoff +
    +
    [Called By]
    • >>   app_qirui_nm_handle_2 +
    + +

    app_qirui_nm_start_sa (Thumb, 8 bytes, Stack size 0 bytes, can_nm.o(i.app_qirui_nm_start_sa)) +

    [Calls]

    • >>   TickOut +
    +
    [Called By]
    • >>   app_qirui_nm_handle_2 +
    • >>   app_qr_nm_master_frame +
    + +

    app_qirui_nm_start_t1 (Thumb, 8 bytes, Stack size 0 bytes, can_nm.o(i.app_qirui_nm_start_t1)) +

    [Calls]

    • >>   TickOut +
    +
    [Called By]
    • >>   app_qirui_nm_handle_2 +
    + +

    app_qirui_nm_switch (Thumb, 32 bytes, Stack size 16 bytes, can_nm.o(i.app_qirui_nm_switch)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = app_qirui_nm_switch ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Called By]
    • >>   app_qirui_nm_handle_2 +
    + +

    CAN_FRAME_INIT (Thumb, 64 bytes, Stack size 8 bytes, canbusdrv.o(i.CAN_FRAME_INIT)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = CAN_FRAME_INIT +
    +
    [Calls]
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   can_bus_send_rt +
    + +

    CAN_MSG_CB_SIG_FUNC (Thumb, 12 bytes, Stack size 0 bytes, candrvctrl.o(i.CAN_MSG_CB_SIG_FUNC)) +
    [Address Reference Count : 1]

    • candrvctrl.o(i.InitCanDrvCtrlMode) +
    +

    CAN_MSG_SIG_FUNC (Thumb, 10 bytes, Stack size 0 bytes, candrvctrl.o(i.CAN_MSG_SIG_FUNC)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = CAN_MSG_SIG_FUNC ⇒ hdlCanCtrlMsg ⇒ HdlAllSengMsgSts ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   hdlCanCtrlMsg +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InitCanDrvCtrlMode) +
    +

    GetIfFromChanel (Thumb, 54 bytes, Stack size 0 bytes, candrvctrl.o(i.GetIfFromChanel)) +

    [Called By]

    • >>   plSend +
    • >>   plReceive +
    • >>   plGetCurrentLinkSts +
    • >>   plConfigBus +
    • >>   plCloseLink +
    • >>   hdlIfSendSuccessCb +
    • >>   hdlIfFrmReceve +
    • >>   hdlIfBusOffCb +
    • >>   hdlIfBusErrorCb +
    • >>   hdlCanCtrlMsg +
    • >>   InstallProtocalToIF +
    + +

    HdlAllSengMsgSts (Thumb, 274 bytes, Stack size 24 bytes, candrvctrl.o(i.HdlAllSengMsgSts)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = HdlAllSengMsgSts ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   sfifo_read +
    • >>   sfifo_empty +
    • >>   can_kill +
    +
    [Called By]
    • >>   plSend +
    • >>   hdlIfSendSuccessCb +
    • >>   hdlCanCtrlMsg +
    + +

    hdlCanCtrlMsg (Thumb, 214 bytes, Stack size 16 bytes, candrvctrl.o(i.hdlCanCtrlMsg)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = hdlCanCtrlMsg ⇒ HdlAllSengMsgSts ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   can_kill +
    • >>   plConfigBus +
    • >>   plCloseLink +
    • >>   HdlAllSengMsgSts +
    • >>   GetIfFromChanel +
    +
    [Called By]
    • >>   CAN_MSG_SIG_FUNC +
    + +

    hdlIfBusErrorCb (Thumb, 78 bytes, Stack size 16 bytes, candrvctrl.o(i.hdlIfBusErrorCb)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = hdlIfBusErrorCb ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   can_kill +
    • >>   GetIfFromChanel +
    +
    [Called By]
    • >>   hdlIfBusErrorStsCb +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(.data) +
    +

    hdlIfBusErrorStsCb (Thumb, 4 bytes, Stack size 0 bytes, candrvctrl.o(i.hdlIfBusErrorStsCb)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = hdlIfBusErrorStsCb ⇒ hdlIfBusErrorCb ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   hdlIfBusErrorCb +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(.data) +
    +

    hdlIfBusOffCb (Thumb, 54 bytes, Stack size 8 bytes, candrvctrl.o(i.hdlIfBusOffCb)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = hdlIfBusOffCb ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   can_kill +
    • >>   GetIfFromChanel +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(.data) +
    +

    hdlIfFrmReceve (Thumb, 124 bytes, Stack size 24 bytes, candrvctrl.o(i.hdlIfFrmReceve)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = hdlIfFrmReceve ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   sfifo_write +
    • >>   sfifo_full +
    • >>   can_kill +
    • >>   GetIfFromChanel +
    • >>   __aeabi_memcpy +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(.data) +
    +

    hdlIfSendSuccessCb (Thumb, 58 bytes, Stack size 8 bytes, candrvctrl.o(i.hdlIfSendSuccessCb)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = hdlIfSendSuccessCb ⇒ HdlAllSengMsgSts ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   HdlAllSengMsgSts +
    • >>   GetIfFromChanel +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(.data) +
    +

    plCloseLink (Thumb, 148 bytes, Stack size 16 bytes, candrvctrl.o(i.plCloseLink)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = plCloseLink ⇒ sfifo_read +
    +
    [Calls]
    • >>   sfifo_read +
    • >>   sfifo_empty +
    • >>   GetIfFromChanel +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   hdlCanCtrlMsg +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    plConfigBus (Thumb, 114 bytes, Stack size 24 bytes, candrvctrl.o(i.plConfigBus)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = plConfigBus ⇒ sfifo_init +
    +
    [Calls]
    • >>   sfifo_init +
    • >>   GetIfFromChanel +
    +
    [Called By]
    • >>   hdlCanCtrlMsg +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    plGetCurrentLinkSts (Thumb, 16 bytes, Stack size 8 bytes, candrvctrl.o(i.plGetCurrentLinkSts)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = plGetCurrentLinkSts +
    +
    [Calls]
    • >>   GetIfFromChanel +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    plReceive (Thumb, 116 bytes, Stack size 40 bytes, candrvctrl.o(i.plReceive)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = plReceive ⇒ sfifo_read +
    +
    [Calls]
    • >>   sfifo_read +
    • >>   sfifo_empty +
    • >>   GetIfFromChanel +
    • >>   __aeabi_memcpy +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    plSend (Thumb, 154 bytes, Stack size 56 bytes, candrvctrl.o(i.plSend)) +

    [Stack]

    • Max Depth = 104
    • Call Chain = plSend ⇒ HdlAllSengMsgSts ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   SYS_EXIT_CRITICAL +
    • >>   SYS_ENTER_CRITICAL +
    • >>   sfifo_write +
    • >>   sfifo_full +
    • >>   HdlAllSengMsgSts +
    • >>   GetIfFromChanel +
    • >>   __aeabi_memcpy +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    plcanBusFilterInit (Thumb, 4 bytes, Stack size 0 bytes, candrvctrl.o(i.plcanBusFilterInit)) +
    [Address Reference Count : 1]

    • candrvctrl.o(i.InstallProtocalToIF) +
    +

    waitSendMsgAck (Thumb, 92 bytes, Stack size 16 bytes, candrvctrl.o(i.waitSendMsgAck)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = waitSendMsgAck ⇒ can_kill ⇒ sfifo_write +
    +
    [Calls]
    • >>   can_kill +
    +
    [Address Reference Count : 1]
    • candrvctrl.o(i.InitCanDrvCtrlMode) +
    +

    DCDC_Battery_RequireVoltCur_Calculate (Thumb, 1980 bytes, Stack size 48 bytes, dc300.o(i.DCDC_Battery_RequireVoltCur_Calculate)) +

    [Stack]

    • Max Depth = 136
    • Call Chain = DCDC_Battery_RequireVoltCur_Calculate ⇒ __aeabi_dmul ⇒ _double_epilogue ⇒ _double_round +
    +
    [Calls]
    • >>   TickOut +
    • >>   __aeabi_cdrcmple +
    • >>   Get_Min_Value +
    • >>   Get_Max_Value +
    • >>   __aeabi_ui2d +
    • >>   __aeabi_dmul +
    • >>   __aeabi_d2uiz +
    • >>   CheckQiruiBMSWarningState +
    +
    [Called By]
    • >>   DCDC_Power_Handle +
    + +

    control_cmd_proc (Thumb, 112 bytes, Stack size 80 bytes, dc300.o(i.control_cmd_proc)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = control_cmd_proc +
    +
    [Calls]
    • >>   __aeabi_memclr4 +
    +
    [Address Reference Count : 1]
    • dc300.o(.data) +
    +

    param_update_firmware_cmd_proc (Thumb, 2 bytes, Stack size 0 bytes, dc300.o(i.param_update_firmware_cmd_proc)) +
    [Address Reference Count : 1]

    • dc300.o(.data) +
    +

    read_version_cmd_proc (Thumb, 22 bytes, Stack size 0 bytes, dc300.o(i.read_version_cmd_proc)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = read_version_cmd_proc ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • dc300.o(.data) +
    +

    set_param_cmd_proc (Thumb, 2 bytes, Stack size 0 bytes, dc300.o(i.set_param_cmd_proc)) +
    [Address Reference Count : 1]

    • dc300.o(.data) +
    +

    i2c_Delay (Thumb, 12 bytes, Stack size 0 bytes, bsp_i2c_gpio.o(i.i2c_Delay)) +

    [Called By]

    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    • >>   IIC_Send_Byte +
    • >>   IIC_Read_Byte +
    • >>   IIC_NAck +
    • >>   IIC_Ack +
    + +

    TP_Check_Rx_Message_Length (Thumb, 44 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Check_Rx_Message_Length)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = TP_Check_Rx_Message_Length ⇒ HAL_UDS_Indication ⇒ UDS_Service_Response_Handler +
    +
    [Calls]
    • >>   HAL_UDS_Indication +
    +
    [Called By]
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Task +
    + +

    TP_FC_Frame_Process (Thumb, 66 bytes, Stack size 8 bytes, tp_cca.o(i.TP_FC_Frame_Process)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Transmit_Consecutive_Frame +
    +
    [Called By]
    • >>   TP_Wait_For_FCFrame_Rx_State_Process +
    + +

    TP_Load_TL_Buffer_Start_NAs_Timer (Thumb, 28 bytes, Stack size 8 bytes, tp_cca.o(i.TP_Load_TL_Buffer_Start_NAs_Timer)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Set_Tx_DLC +
    • >>   HAL_UDS_Set_Tx_Buf +
    +
    [Called By]
    • >>   TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process +
    • >>   TP_Tx_Load_Remaining_Bytes_OF_CF_Process +
    • >>   TP_Tx_Last_CF_Data_Process +
    • >>   TP_Tx_CF_Data_Process +
    + +

    TP_Receive_Consecutive_Frame (Thumb, 48 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Receive_Consecutive_Frame)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = TP_Receive_Consecutive_Frame ⇒ TP_Rx_Last_CF_Data_Process +
    +
    [Calls]
    • >>   TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process +
    • >>   TP_Rx_Unload_Remaining_Bytes_OF_CF_Process +
    • >>   TP_Rx_Last_CF_Data_Process +
    • >>   TP_Rx_CF_Data_Process +
    +
    [Called By]
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Task +
    + +

    TP_Receive_First_Frame (Thumb, 128 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Receive_First_Frame)) +

    [Stack]

    • Max Depth = 76
    • Call Chain = TP_Receive_First_Frame ⇒ TP_Transmit_Flow_Control ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Transmit_Flow_Control +
    • >>   TP_Received_DLC_Check +
    • >>   HAL_UDS_Indication +
    • >>   HAL_UDS_FF_Indication +
    +
    [Called By]
    • >>   TP_Receive_Single_OR_First_Frame +
    + +

    TP_Receive_Single_Frame (Thumb, 64 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Receive_Single_Frame)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = TP_Receive_Single_Frame ⇒ HAL_UDS_Indication ⇒ UDS_Service_Response_Handler +
    +
    [Calls]
    • >>   TP_Received_DLC_Check +
    • >>   HAL_UDS_Indication +
    +
    [Called By]
    • >>   TP_Receive_Single_OR_First_Frame +
    + +

    TP_Receive_Single_OR_First_Frame (Thumb, 44 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Receive_Single_OR_First_Frame)) +

    [Stack]

    • Max Depth = 76
    • Call Chain = TP_Receive_Single_OR_First_Frame ⇒ TP_Receive_First_Frame ⇒ TP_Transmit_Flow_Control ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Receive_Single_Frame +
    • >>   TP_Receive_First_Frame +
    +
    [Called By]
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Task +
    + +

    TP_Received_DLC_Check (Thumb, 60 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Received_DLC_Check)) +

    [Called By]

    • >>   TP_Wait_For_FCFrame_Rx_State_Process +
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Receive_Single_Frame +
    • >>   TP_Receive_First_Frame +
    • >>   TP_D_UUData_Indication_Functional +
    + +

    TP_Rx_CF_Data_Process (Thumb, 118 bytes, Stack size 20 bytes, tp_cca.o(i.TP_Rx_CF_Data_Process)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = TP_Rx_CF_Data_Process +
    +
    [Called By]
    • >>   TP_Receive_Consecutive_Frame +
    + +

    TP_Rx_CF_State_Process (Thumb, 126 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Rx_CF_State_Process)) +

    [Stack]

    • Max Depth = 92
    • Call Chain = TP_Rx_CF_State_Process ⇒ TP_Receive_Single_OR_First_Frame ⇒ TP_Receive_First_Frame ⇒ TP_Transmit_Flow_Control ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Rx_To_Idle_Init +
    • >>   TP_Received_DLC_Check +
    • >>   TP_Receive_Single_OR_First_Frame +
    • >>   TP_Receive_Consecutive_Frame +
    • >>   TP_Check_Rx_Message_Length +
    +
    [Called By]
    • >>   TP_Task +
    + +

    TP_Rx_Last_CF_Data_Process (Thumb, 114 bytes, Stack size 20 bytes, tp_cca.o(i.TP_Rx_Last_CF_Data_Process)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = TP_Rx_Last_CF_Data_Process +
    +
    [Called By]
    • >>   TP_Receive_Consecutive_Frame +
    + +

    TP_Rx_To_Idle_Init (Thumb, 22 bytes, Stack size 8 bytes, tp_cca.o(i.TP_Rx_To_Idle_Init)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = TP_Rx_To_Idle_Init ⇒ HAL_UDS_Indication ⇒ UDS_Service_Response_Handler +
    +
    [Calls]
    • >>   HAL_UDS_Indication +
    +
    [Called By]
    • >>   TP_Rx_CF_State_Process +
    • >>   TP_Task +
    + +

    TP_Rx_Unload_Remaining_Bytes_OF_CF_Process (Thumb, 54 bytes, Stack size 12 bytes, tp_cca.o(i.TP_Rx_Unload_Remaining_Bytes_OF_CF_Process)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = TP_Rx_Unload_Remaining_Bytes_OF_CF_Process +
    +
    [Called By]
    • >>   TP_Receive_Consecutive_Frame +
    + +

    TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process (Thumb, 60 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = TP_Rx_Unload_Remaining_Bytes_OF_Last_CF_Process +
    +
    [Called By]
    • >>   TP_Receive_Consecutive_Frame +
    + +

    TP_Transmit_Consecutive_Frame (Thumb, 60 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Transmit_Consecutive_Frame)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process +
    • >>   TP_Tx_Load_Remaining_Bytes_OF_CF_Process +
    • >>   TP_Tx_Last_CF_Data_Process +
    • >>   TP_Tx_CF_Data_Process +
    +
    [Called By]
    • >>   TP_Wait_For_CF_TxConf_State_Process +
    • >>   TP_FC_Frame_Process +
    • >>   TP_Task +
    + +

    TP_Transmit_First_Frame (Thumb, 56 bytes, Stack size 12 bytes, tp_cca.o(i.TP_Transmit_First_Frame)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = TP_Transmit_First_Frame +
    +
    [Called By]
    • >>   TP_N_USData_Request +
    + +

    TP_Transmit_Flow_Control (Thumb, 76 bytes, Stack size 8 bytes, tp_cca.o(i.TP_Transmit_Flow_Control)) +

    [Stack]

    • Max Depth = 60
    • Call Chain = TP_Transmit_Flow_Control ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   HAL_UDS_Set_Tx_ID +
    • >>   HAL_UDS_Set_Tx_DLC +
    • >>   HAL_UDS_Set_Tx_Buf +
    +
    [Called By]
    • >>   TP_Receive_First_Frame +
    + +

    TP_Transmit_Single_Frame (Thumb, 68 bytes, Stack size 20 bytes, tp_cca.o(i.TP_Transmit_Single_Frame)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = TP_Transmit_Single_Frame +
    +
    [Called By]
    • >>   TP_N_USData_Request +
    + +

    TP_Tx_CF_Data_Process (Thumb, 118 bytes, Stack size 24 bytes, tp_cca.o(i.TP_Tx_CF_Data_Process)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = TP_Tx_CF_Data_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Update_SN_and_BS +
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    • >>   HAL_UDS_Transmit_Buffer_Empty +
    +
    [Called By]
    • >>   TP_Transmit_Consecutive_Frame +
    + +

    TP_Tx_Last_CF_Data_Process (Thumb, 146 bytes, Stack size 24 bytes, tp_cca.o(i.TP_Tx_Last_CF_Data_Process)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = TP_Tx_Last_CF_Data_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    • >>   HAL_UDS_Transmit_Buffer_Empty +
    +
    [Called By]
    • >>   TP_Transmit_Consecutive_Frame +
    + +

    TP_Tx_Load_Remaining_Bytes_OF_CF_Process (Thumb, 70 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Tx_Load_Remaining_Bytes_OF_CF_Process)) +

    [Stack]

    • Max Depth = 76
    • Call Chain = TP_Tx_Load_Remaining_Bytes_OF_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Update_SN_and_BS +
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    +
    [Called By]
    • >>   TP_Transmit_Consecutive_Frame +
    + +

    TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process (Thumb, 100 bytes, Stack size 24 bytes, tp_cca.o(i.TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Load_TL_Buffer_Start_NAs_Timer +
    +
    [Called By]
    • >>   TP_Transmit_Consecutive_Frame +
    + +

    TP_Tx_To_Idle_Init (Thumb, 20 bytes, Stack size 8 bytes, tp_cca.o(i.TP_Tx_To_Idle_Init)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = TP_Tx_To_Idle_Init ⇒ HAL_UDS_Response_Confirm +
    +
    [Calls]
    • >>   HAL_UDS_Response_Confirm +
    +
    [Called By]
    • >>   TP_Wait_For_SFORFF_TxConf_State_Process +
    • >>   TP_Wait_For_FCFrame_Rx_State_Process +
    • >>   TP_Wait_For_CF_TxConf_State_Process +
    + +

    TP_Update_SN_and_BS (Thumb, 32 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Update_SN_and_BS)) +

    [Called By]

    • >>   TP_Tx_Load_Remaining_Bytes_OF_CF_Process +
    • >>   TP_Tx_CF_Data_Process +
    + +

    TP_Update_Timers (Thumb, 62 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Update_Timers)) +

    [Called By]

    • >>   TP_Periodic_Task +
    + +

    TP_Wait_For_CF_TxConf_State_Process (Thumb, 108 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Wait_For_CF_TxConf_State_Process)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = TP_Wait_For_CF_TxConf_State_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Tx_To_Idle_Init +
    • >>   TP_Transmit_Consecutive_Frame +
    +
    [Called By]
    • >>   TP_Task +
    + +

    TP_Wait_For_FCFrame_Rx_State_Process (Thumb, 112 bytes, Stack size 16 bytes, tp_cca.o(i.TP_Wait_For_FCFrame_Rx_State_Process)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = TP_Wait_For_FCFrame_Rx_State_Process ⇒ TP_FC_Frame_Process ⇒ TP_Transmit_Consecutive_Frame ⇒ TP_Tx_Load_Remaining_Bytes_OF_Last_CF_Process ⇒ TP_Load_TL_Buffer_Start_NAs_Timer ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   TP_Tx_To_Idle_Init +
    • >>   TP_Received_DLC_Check +
    • >>   TP_FC_Frame_Process +
    +
    [Called By]
    • >>   TP_Task +
    + +

    TP_Wait_For_SFORFF_TxConf_State_Process (Thumb, 44 bytes, Stack size 0 bytes, tp_cca.o(i.TP_Wait_For_SFORFF_TxConf_State_Process)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = TP_Wait_For_SFORFF_TxConf_State_Process ⇒ TP_Tx_To_Idle_Init ⇒ HAL_UDS_Response_Confirm +
    +
    [Calls]
    • >>   TP_Tx_To_Idle_Init +
    +
    [Called By]
    • >>   TP_Task +
    + +

    UDS_10_Service_Session_Control (Thumb, 40 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_10_Service_Session_Control)) +

    [Stack]

    • Max Depth = 124
    • Call Chain = UDS_10_Service_Session_Control ⇒ UDS_Service_10_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_10_Response +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_11_Service_Ecu_Reset (Thumb, 30 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_11_Service_Ecu_Reset)) +

    [Stack]

    • Max Depth = 116
    • Call Chain = UDS_11_Service_Ecu_Reset ⇒ UDS_Service_11 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_11 +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_14_Service_Clear_DTC (Thumb, 44 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_14_Service_Clear_DTC)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = UDS_14_Service_Clear_DTC ⇒ UDS_Service_14 ⇒ ClearDtc ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   UDS_Service_14 +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_19_Service_Read_DTC (Thumb, 26 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_19_Service_Read_DTC)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_19_Service_Read_DTC ⇒ UDS_Service_0x19_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_0x19_Response +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_22_Service_Read_Data (Thumb, 26 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_22_Service_Read_Data)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = UDS_22_Service_Read_Data ⇒ UDS_Service_0x22_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_0x22_Response +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_27_Service_Security_Access (Thumb, 64 bytes, Stack size 16 bytes, uds_interface.o(i.UDS_27_Service_Security_Access)) +

    [Stack]

    • Max Depth = 140
    • Call Chain = UDS_27_Service_Security_Access ⇒ UDS_Service_27 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_27 +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_28_Service_Communication_Control (Thumb, 44 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_28_Service_Communication_Control)) +

    [Stack]

    • Max Depth = 116
    • Call Chain = UDS_28_Service_Communication_Control ⇒ UDS_Service_28 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_28 +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_2E_Service_Write_Data (Thumb, 38 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_2E_Service_Write_Data)) +

    [Stack]

    • Max Depth = 144
    • Call Chain = UDS_2E_Service_Write_Data ⇒ UDS_Service_0x2E_Response ⇒ Set0x2EDidDiagData ⇒ DiagDIDStoreFlash ⇒ EE_Write ⇒ uds_service_nvm_write ⇒ nvm_write ⇒ UdsApi_EE_WriteBytes ⇒ ee_WriteBytes ⇒ IIC_Send_Byte +
    +
    [Calls]
    • >>   UDS_Service_0x2E_Response +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_31_Service_Routine_Ctrl (Thumb, 44 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_31_Service_Routine_Ctrl)) +

    [Stack]

    • Max Depth = 116
    • Call Chain = UDS_31_Service_Routine_Ctrl ⇒ UDS_Service_31 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_31 +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_3E_Service_Tester_Present (Thumb, 30 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_3E_Service_Tester_Present)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_3E_Service_Tester_Present ⇒ UDS_Service_0x3E_Response ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_0x3E_Response +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_85_Service_Control_DTC (Thumb, 44 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_85_Service_Control_DTC)) +

    [Stack]

    • Max Depth = 108
    • Call Chain = UDS_85_Service_Control_DTC ⇒ UDS_Service_85 ⇒ HAL_UDS_Transmit_Physical_Request ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_85 +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    UDS_Service_NRC (Thumb, 36 bytes, Stack size 8 bytes, uds_interface.o(i.UDS_Service_NRC)) +

    [Stack]

    • Max Depth = 100
    • Call Chain = UDS_Service_NRC ⇒ UDS_Service_NonSupport_Response ⇒ HAL_UDS_Transmit_Pending_Response ⇒ TP_N_USData_Request ⇒ HAL_UDS_Set_Tx_Buf ⇒ TxQueueCan0In +
    +
    [Calls]
    • >>   UDS_Service_NonSupport_Response +
    • >>   __aeabi_memclr +
    +
    [Address Reference Count : 1]
    • uds_interface.o(.data) +
    +

    NVIC_SetPriority (Thumb, 32 bytes, Stack size 0 bytes, sys.o(i.NVIC_SetPriority)) +

    [Called By]

    • >>   SysTick_Init +
    + +

    ParseCommandParam (Thumb, 148 bytes, Stack size 32 bytes, usart.o(i.ParseCommandParam)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = ParseCommandParam ⇒ __2printf +
    +
    [Calls]
    • >>   KeyLocation +
    • >>   __2printf +
    +
    [Called By]
    • >>   ShellCommad +
    + +

    ShellCommad (Thumb, 82 bytes, Stack size 16 bytes, usart.o(i.ShellCommad)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = ShellCommad ⇒ ParseCommandParam ⇒ __2printf +
    +
    [Calls]
    • >>   ParseCommandParam +
    • >>   __2printf +
    • >>   strstr +
    +
    [Called By]
    • >>   UART4_IRQHandler +
    + +

    _fp_digits (Thumb, 366 bytes, Stack size 64 bytes, printfa.o(i._fp_digits), UNUSED) +

    [Calls]

    • >>   __aeabi_cdrcmple +
    • >>   __aeabi_dadd +
    • >>   __aeabi_dmul +
    • >>   __aeabi_ddiv +
    • >>   __aeabi_uldivmod +
    • >>   __aeabi_d2ulz +
    +
    [Called By]
    • >>   _printf_core +
    + +

    _printf_core (Thumb, 1744 bytes, Stack size 136 bytes, printfa.o(i._printf_core), UNUSED) +

    [Calls]

    • >>   __aeabi_uldivmod +
    • >>   __aeabi_uidivmod +
    • >>   _printf_pre_padding +
    • >>   _printf_post_padding +
    • >>   _fp_digits +
    +
    [Called By]
    • >>   __0sprintf +
    • >>   __0printf +
    + +

    _printf_post_padding (Thumb, 36 bytes, Stack size 24 bytes, printfa.o(i._printf_post_padding), UNUSED) +

    [Called By]

    • >>   _printf_core +
    + +

    _printf_pre_padding (Thumb, 46 bytes, Stack size 24 bytes, printfa.o(i._printf_pre_padding), UNUSED) +

    [Called By]

    • >>   _printf_core +
    + +

    _sputc (Thumb, 10 bytes, Stack size 0 bytes, printfa.o(i._sputc)) +

    [Called By]

    • >>   __0sprintf +
    +
    [Address Reference Count : 1]
    • printfa.o(i.__0sprintf) +

    +

    +Undefined Global Symbols +


    diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.lnp b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.lnp new file mode 100644 index 0000000..7b38cbe --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.lnp @@ -0,0 +1,64 @@ +--cpu Cortex-M3 +".\output\main.o" +".\output\stm32f10x_it.o" +".\output\system_stm32f10x.o" +".\output\startup_stm32f10x_cl.o" +".\output\misc.o" +".\output\stm32f10x_adc.o" +".\output\stm32f10x_bkp.o" +".\output\stm32f10x_can.o" +".\output\stm32f10x_cec.o" +".\output\stm32f10x_crc.o" +".\output\stm32f10x_dac.o" +".\output\stm32f10x_dbgmcu.o" +".\output\stm32f10x_dma.o" +".\output\stm32f10x_exti.o" +".\output\stm32f10x_flash.o" +".\output\stm32f10x_fsmc.o" +".\output\stm32f10x_gpio.o" +".\output\stm32f10x_i2c.o" +".\output\stm32f10x_iwdg.o" +".\output\stm32f10x_pwr.o" +".\output\stm32f10x_rcc.o" +".\output\stm32f10x_rtc.o" +".\output\stm32f10x_sdio.o" +".\output\stm32f10x_spi.o" +".\output\stm32f10x_tim.o" +".\output\stm32f10x_usart.o" +".\output\stm32f10x_wwdg.o" +".\output\led.o" +".\output\timer.o" +".\output\bsp_can.o" +".\output\can.o" +".\output\can_app.o" +".\output\can_nm.o" +".\output\canbusdrv.o" +".\output\candrvctrl.o" +".\output\porting.o" +".\output\app_pwr_manage.o" +".\output\24cxx.o" +".\output\adc.o" +".\output\dc300.o" +".\output\chipid.o" +".\output\ads1015.o" +".\output\common.o" +".\output\bsp_i2c_gpio.o" +".\output\bsp_cpu_flash.o" +".\output\bootloader.o" +".\output\crc.o" +".\output\diagnosis_mid.o" +".\output\tp_cca.o" +".\output\uds_api.o" +".\output\uds_can_interface.o" +".\output\uds_did.o" +".\output\uds_interface.o" +".\output\uds_manage.o" +".\output\uds_nvm.o" +".\output\uds_services.o" +".\output\delay.o" +".\output\sys.o" +".\output\usart.o" +--library_type=microlib --strict --scatter ".\output\LED.sct" +--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols +--info sizes --info totals --info unused --info veneers +--list ".\list\LED.map" -o .\output\LED.axf \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.sct b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.sct new file mode 100644 index 0000000..2738612 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/LED.sct differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project.hex new file mode 100644 index 0000000..0e60d70 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project.hex @@ -0,0 +1,5309 @@ +:020000040800F2 +:10800000F877002065810008CBF4000815EC000823 +:10801000C9F40008B9AE00082945010800000000B5 +:108020000000000000000000000000007D080108C2 +:10803000C5D2000800000000CDF60008AD17010809 +:10804000754601087F8100087F8100087F81000854 +:108050007F8100087F8100087F8100087F81000800 +:108060007F81000839D900083FD900087F810008C6 +:108070007F8100087F8100087F8100087F810008E0 +:108080007F8100087F8100087F81000845AF0008DC +:10809000BDAE00087F810008DDAE000845D90008AC +:1080A0007F8100087F8100087F8100087F810008B0 +:1080B0007F810008A11801087F8100087F810008E6 +:1080C0007F8100087F8100087F8100087F81000890 +:1080D0007F810008E9360108653701083538010855 +:1080E000E9D80008790501087F8100080000000038 +:1080F0000000000000000000000000000000000080 +:1081000000000000000000007F8100087F8100085F +:1081100011290108052A01087F8100087F810008D4 +:108120007F8100087F8100087F8100087F8100082F +:108130007F8100087F8100087F810008B5B10008B9 +:108140007F81000815B100083DB100087F8100085B +:10815000DFF80CD000F0EEFC00480047B18A0108BF +:10816000F87700200648804706480047FEE7FEE70C +:10817000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7D7 +:10818000451801085181000840EA01039B0703D00C +:1081900009E008C9121F08C0042AFAD203E011F846 +:1081A000013B00F8013B521EF9D27047D2B201E008 +:1081B00000F8012B491EFBD270470022F6E710B5EC +:1081C00013460A4604461946FFF7F0FF204610BD45 +:1081D00030B505462A460B4612F8010B13F8014B41 +:1081E00008B1A042F8D01CB1002802D06D1CF1E704 +:1081F000284630BD421C10F8011B0029FBD1801A13 +:10820000704730B504460020034600E05B1C9342F3 +:1082100003D2E05CCD5C401BF8D030BD034611F8C2 +:10822000012B00F8012B002AF9D118467047F0B451 +:1082300080EA0102D40F4200B2EB410F02D20246A3 +:10824000084611464A0042D0C30DDDB2C1F3C75201 +:10825000AD1A202D35DAC1F3160141F4000204B144 +:108260005242C5F1200602FA06F12A411044B3EB4E +:10827000D05F23D0C4B1012DA0EBC35009DCF0BC0A +:108280004FF0004202EAC352DBB200F5000000F0FA +:10829000AEBB400000F1807000EBC350A0F18070D5 +:1082A00040EAD170490009E0490841EAC071A0EBF9 +:1082B000C35000F50000400800EBC350F0BC00F0D4 +:1082C0008DBB6142012202EB4101001BF6E7F0BCCD +:1082D000704781F00041AAE780F00040A7E780EAFC +:1082E000010210B502F00043400022D04A001FD026 +:1082F000010E01EB1261C0F35600C2F3560240F4C6 +:10830000000042F40002A0FB022000047F391404A4 +:1083100000D0401C50EA124001D44000491EC2B2B5 +:108320000C0604EBD010401C4008802A02D003E069 +:10833000002010BD20F00100002900DA00201843C1 +:1083400010BD30B480EA010202F0004530F0004276 +:1083500021F0004013D090B1C30DD40DC2F316012B +:10836000C0F31600E41A41F4000140F400027D3429 +:10837000914201D3641C00E04900002C02DA30BCB9 +:10838000002070474FF400000023914201D3891A66 +:10839000034340084FEA4101F7D151B1914202D164 +:1083A0004FF0004105E002D24FF0010101E06FF013 +:1083B000010103EBC450284430BC00F00FBB420065 +:1083C00005D0C0F3C7525242914201DC00207047F1 +:1083D00000EBC15070472DE9FE4F804681EA030053 +:1083E000C00F0C46009021F0004123F00045B8EB8F +:1083F0000200A94105D24046214690461C460B4644 +:10840000024623F00040104347D0270DC7F30A006F +:10841000C3F30A510290401A019040286BDAC3F36B +:10842000130040F4801B0098924620B10023D2EB49 +:10843000030A63EB0B0B01985946C0F1400250460A +:1084400000F09BFA06460D4650465946019A00F048 +:10845000B3FA10EB08006141002487EA115284EA64 +:10846000E7731A4340D0009A62B3019A012A4FEA97 +:10847000075215DC001B61EB02014FF0004202EADB +:108480000752CDE90042001C41F5801132462B46CF +:1084900000F0EAFA03B0BDE8F08F40462146F9E764 +:1084A000001B61EB0201001C41F5801300185B41C9 +:1084B0002018A2F5001747EB030140EAD570B61962 +:1084C0006D4111E06D084FEA360645EAC0754FEA86 +:1084D0000752001B61EB0201001C41F580114908A5 +:1084E0004FEA30000019514132462B4603B0BDE837 +:1084F000F04F00F0AABA0098012240000023D0EB10 +:10850000020263EBE073009821464FEAE074B8EB97 +:10851000000061EB0401E9E783F000435BE781F0D1 +:10852000004158E72DE9FE4F81EA030404F00044BE +:1085300021F0004100944FF0000B23F0004350EA7B +:1085400001045ED052EA03045BD0C3F30A54C1F3C2 +:108550000A552C44A4F2F3340194A0FB0254C1F355 +:10856000130141F48011C3F3130343F4801301FB9F +:10857000024400FB034E840A970A44EA815447EA06 +:108580008357A4FB076802958D0A05FB07854FEA10 +:10859000932C04FB0C542705029D4FEA065847EA2A +:1085A0001637B5EB08056EEB070C870E920E47EAFF +:1085B000811742EA8312A7FB0201B6EB0B0164EBC1 +:1085C00000042B0D43EA0C335E1844EB1C50DA46D2 +:1085D0005146E7FB0201C5F313044FEA0B3343EAAC +:1085E00014534FEA0432019C43EA0603A4F10C043D +:1085F0000294009CCDE900B400F036FA03B0BDE867 +:10860000F08F00200146F9E72DE9F04D81EA0304DF +:1086100004F0004B21F0004514464FF0000A23F00F +:10862000004150EA050220D054EA01021DD0C5F3F2 +:108630000A570246C5F31303C1F31300C1F30A56E8 +:1086400040F4801543F48013A7EB0608101BD646B0 +:1086500008F2FD3873EB050002D308F1010801E0D0 +:1086600092185B41B8F1000F03DA00200146BDE823 +:10867000F08D00204FF48011064684460EE0171B53 +:1086800073EB050705D3121B63EB050306434CEAA6 +:10869000010C49084FEA300092185B4150EA01078B +:1086A000EDD152EA030012D082EA040083EA050108 +:1086B000084305D0101BAB4106D20122002306E07F +:1086C00000224FF0004302E06FF0010253101AEB5A +:1086D00006004CEB085110EB0A0041EB0B01BDE822 +:1086E000F04D00F0B2B970B521F0004303430CD057 +:1086F000C1F30A550024D5EB040564EB0403D61737 +:10870000AD1AB34102DB0020014670BD201841EBD9 +:10871000025170BDC10F80EAE0700844CA07962379 +:10872000002100F064B996230022114600F05FB9E1 +:108730000EB5C10F80EAE0700844CA07002140F27C +:1087400033438DE80E000A460B4600F08DF903B066 +:1087500000BD0EB540F2334102910021CDE9001178 +:108760000A460B4600F080F903B000BD00F000425D +:1087700020F00040C10DC0F3160040F400007F2936 +:1087800001DA00207047962903DCC1F19601C84048 +:1087900001E096398840002AF4D04042704720F02A +:1087A0000040C10DC0F3160040F400007F2901DA3B +:1087B00000207047962903DCC1F19601C84070473C +:1087C00096398840704770B5C1F30A5201F00045F0 +:1087D0000024C1F3130140F2FF3341F480119A42A7 +:1087E00001DA002070BD40F233439A42A2F23342D4 +:1087F00003DC524200F0D0F800E090402C43F1D06E +:10880000404270BDC1F30A5210B5C1F3130140F2EA +:10881000FF3341F480119A4201DA002010BD40F28A +:1088200033439A42A2F2334203DC524200F0B4F8DE +:1088300010BD904010BD00F0004230F000400AD062 +:10884000C10D01F56071C0F3160042EA0151C20882 +:1088500040071143704700200146704730B5041EA1 +:1088600071F1000404DB4FF00044404264EB01016D +:10887000141E73F1000405DB1C464FF00043524206 +:1088800063EB0403994208BF904230BD01F00043FE +:1088900030B421F0004150EA010206D00A0DA2F5E1 +:1088A0006072C1F31301002A02DC30BC0020704763 +:1088B000440F44EAC104C100E01830BC00EBC250D0 +:1088C00000F08CB8002801DBC0F10040002901DB7A +:1088D000C1F1004181427047002801DBC0F1004036 +:1088E000002901DBC1F100418842704730B50B46D9 +:1088F000014600202022012409E021FA02F59D42D0 +:1089000005D303FA02F5491B04FA02F52844151EA3 +:10891000A2F10102F1DC30BD2DE9F05F0546002037 +:1089200092469B4688460646814640241BE02846E0 +:1089300041464746224600F02FF853465A46C01A91 +:10894000914110D311461846224600F016F82D1A10 +:1089500067EB01084F4622460120002100F00DF888 +:1089600017EB00094E41201EA4F10104DFDC48464C +:1089700031462A464346BDE8F09F202A04DB203AD0 +:1089800000FA02F1002070479140C2F1200320FA62 +:1089900003F3194390407047202A04DB203A21FA60 +:1089A00002F00021704721FA02F3D040C2F1200208 +:1089B0009140084319467047202A06DBCB17203A1E +:1089C00041FA02F043EAE07306E041FA02F3D040D4 +:1089D000C2F1200291400843194670470029A8BF00 +:1089E0007047401C490008BF20F00100704710B4D8 +:1089F000B0FA80FC00FA0CF050EA010404BF10BC8D +:108A0000704749B1CCF1200421FA04F411FA0CF1B9 +:108A100018BF012121430843A3EB0C01CB1D4FEAF2 +:108A200000614FEA102042BF002010BC704700EBED +:108A3000C35010440029A4BF10BC7047401C49001B +:108A400008BF20F0010010BC704710B5141E73F170 +:108A5000000408DA401C41F1000192185B411A43FE +:108A600001D120F0010010BD2DE9F04D92469B464A +:108A700011B1B1FA81F202E0B0FA80F220329046F0 +:108A8000FFF77BFF04460F4640EA0A0041EA0B016C +:108A900053465A46084313D0114653EA010019D0F1 +:108AA000C8F140025046FFF777FF05460E46504694 +:108AB00059464246FFF761FF084305D0012004E014 +:108AC00020463946BDE8F08D0020054346EAE076B1 +:108AD0002C4337430A986305E40AA0EB0800002200 +:108AE000FD0A44EA47540A3002D500200146E9E76E +:108AF000010510196941DDE9084500196941BDE822 +:108B0000F04DA2E7C1F30A52C1F3130140F2FF3363 +:108B100041F480119A4202DA00200146704740F287 +:108B200033439A42A2F2334202DC5242FFF734BF8F +:108B3000FFF723BF064C074D06E0E06840F0010355 +:108B400094E8070098471034AC42F6D3FFF704FBD3 +:108B5000C0C50108E0C5010870B58C1810F8015BAC +:108B600015F0070301D110F8013B2A1106D110F8C6 +:108B7000012B03E010F8016B01F8016B5B1EF9D1CA +:108B80002B0705D40023521E0DD401F8013BFAE750 +:108B900010F8013BCB1A921C03E013F8015B01F8BB +:108BA000015B521EF9D5A142D8D3002070BD000050 +:108BB00038B50121152007F0F3FB0F20ADF80000B8 +:108BC00000248DF803406946064805F049FB012062 +:108BD000ADF800008DF803406946034805F040FBFE +:108BE00038BD0000001001400008014010B5FFF73B +:108BF000DFFFBDE8104000F001B8000070B50121B2 +:108C000090B0084607F0A8FB384E304604F042FA10 +:108C100037480090374801A90024052581E8310034 +:108C20008020CDE90440400006908000079020207D +:108C300008900002CDE909046946304604F09CFA28 +:108C40000121304604F01AFA0121480207F0A8FB7E +:108C500001208DF830008DF831000B944FF4602026 +:108C6000CDE90D04224C8DF83C504C3C0BA920461C +:108C700000F086F8052301220A21204600F0A4F81E +:108C8000052302220B21204600F09EF80523032233 +:108C90000C21204600F098F8052304220D212046DF +:108CA00000F092F805231A460021204600F08CF8C7 +:108CB0000121204600F02AF80121204600F01CF88E +:108CC000204600F0BBF8204600F053F80028FAD107 +:108CD000204600F0C2F8204600F044F80028FAD1FF +:108CE0000121204600F0AFF810B070BD080002402E +:108CF0004C240140DC1600200029816802D041F09C +:108D0000010101E021F001018160704700298168C3 +:108D100002D041F4807101E021F4807181607047DC +:108D20000D4910B5884202D1012144150AE00B49D2 +:108D3000884202D10121041504E0094988420AD180 +:108D40000121CC03204607F037FB2046BDE8104048 +:108D5000002107F031BB10BD002401400028014074 +:108D6000003C0140014600208968490700D50120E8 +:108D70007047014600208968090700D50120704727 +:108D800010B542680E4B0C791A400B6842EA042277 +:108D90001343436082680B4B1A40D1E902432343DB +:108DA0004C7942EA440213438360C26A097C22F48C +:108DB0007002491EC9B242EA0151C16210BD0000F1 +:108DC000FFFEF0FFFDF7F1FF70B5072609290AD96C +:108DD000C568A1F10A0404EB4404A640B543A340CE +:108DE0001D43C56007E0056901EB4104A640B5439A +:108DF000A3401D4305611F23072A09D2446B521E5D +:108E000002EB820293409C4391400C43446370BD4B +:108E10000D2A09D2046BD21F02EB820293409C43BD +:108E200091400C43046370BDC46A0D3A02EB8202A8 +:108E300093409C4391400C43C46270BD816841F0F3 +:108E40000801816070470029816802D041F4A001C7 +:108E500001E021F4A00181607047816841F00401C4 +:108E60008160704738B590228DF8002001228DF87E +:108E700001208DF802108DF803000B480024C0F883 +:108E8000982105F091FF6D46285D05F0CBFF0A2083 +:108E9000401E0004000CFBD1641CE4B2042CF3D38C +:108EA00005F0A4FF38BD00000080214208B5012173 +:108EB000082007F075FAC020ADF8000003208DF8F7 +:108EC000020010208DF803006946054805F0C8F936 +:108ED00004480121C0F89C11C0F8981108BD000099 +:108EE000000C01400080214210B52248FFF718FF16 +:108EF0002148FFF715FF214802F0E8F9204802F069 +:108F0000E5F9204804F0C6F81E48143004F0C2F811 +:108F10001C48283004F0BEF81A483C3004F0BAF877 +:108F20001848503004F0B6F81648643004F0B2F82F +:108F30001448783004F0AEF8134805F023F91348CC +:108F400005F020F9124805F01DF9124808F0FAFC66 +:108F500011480AF0F9FC11480AF0F6FC10480AF032 +:108F6000F3FC10480AF0F0FCBDE810400E480AF08F +:108F7000EBBC0000002401400028014000640040D8 +:108F80000068004008000240000801400014014051 +:108F90000018014000040040003801400044004037 +:108FA00000480040004C0040005000402DE9F84FC0 +:108FB000FD49FE4FB1F82B0010F0600F05D14207BC +:108FC00003D4820401D4C00401D505207870487808 +:108FD000002488460C2814D1D8F8071042F21070EB +:108FE000454681420DDD7C70AC70C5F803403C21E4 +:108FF000EF48FFF7E2F80C20687009F097FB01F0EA +:10900000B7FED8F80700E849401CDFF8A4A3C1F870 +:1090100007007878DFF89CB30226DFF89C930AF10A +:10902000900AAAF1160506287BD2DFE800F0033D7E +:10903000B0FDFCFB09F07AFB3C21E048FFF7BDF8EE +:109040003C21DB48FFF7B9F87C74DD48FC853C86A1 +:1090500001210170BC714FF4FA6078863C712C805C +:109060006980A5F80540A5F807106C7499F8970178 +:10907000012806D079703976E972BDE8F84F01F021 +:1090800077BE3878E87262280BD3CE480078012882 +:1090900007D09BF800100029EFD11C218BF800109D +:1090A000EBE779703976E8E7C74804707C74BC85D3 +:1090B000FC8701F07BFA387E012866D1BC4D288FF1 +:1090C000400446D588F8026099F86B00022808D061 +:1090D000B6484FF4FA61743009F034FB01282FD000 +:1090E00036E0B2484FF47A71743009F02BFB012856 +:1090F00020D1B879411CB971022811D22021B3487E +:1091000005F02FF9DFF8C8920221484605F029F949 +:109110000121484605F025F94FF4FA7004F0D3F820 +:1091200000E032E0ABA00BF001FBA048002174305E +:1091300009F008FB9E486D30C0880CF061FF07E025 +:10914000A9A00BF0F3FA99480021743009F0FAFA5B +:10915000AC6395F83800C00717D098F802100229C0 +:1091600002D0012188F8021090484FF4FA6174305F +:1091700009F0E8FA012807D1A1A00BF0D7FA8B4833 +:109180000021743009F0DEFA7E70BDE8F88F01F03E +:109190000DFABC714FF480418D4805F0E2F8AC74D3 +:1091A000387EAB460028F0D0814D44F22001A86BF8 +:1091B000084201D1400602D501207870AC63288FA7 +:1091C00040040BD599F86B00022804D178486D3023 +:1091D000C0880CF015FF88F80260AC6395F8380081 +:1091E000C007D2D0E878AA2802D0787C98B13BE0BA +:1091F000032078700421764805F0B3F88BF811400D +:109200004FF4FA7004F05FF87C74BC85BDE8F84F49 +:1092100081A00BF08BBA65486421783009F092FA8E +:10922000012802E0E1E3DCE150E00AD10CF006FFA6 +:109230005E488AF80B4000217830CAF8044009F0F3 +:1092400081FA9AF80B10504611290DD1417C022960 +:109250000AD1426841F6EC41B1EB124F04D17E7461 +:10926000C472CAF8044002E0787C02280CD10220C3 +:109270000CF0E4FEB88D0021401CB8850320787402 +:109280004A487C3009F05EFA787C03287FF47DAF91 +:109290009AF80B10504613290DD1417C02290AD1AE +:1092A000426841F6EC41B1EB124F04D1AC63C47299 +:1092B000CAF804407C743D4832217C3009F042FAFF +:1092C0000128E3D17C74BC85AC635EE701F06EF9E4 +:1092D000374944F22002886B104201D1400602D582 +:1092E000012078708C63324890F83800C0075AD05B +:1092F000787C28BB2D483221803009F023FA0128E0 +:109300000BD100210CF064FD28488AF80B400021A5 +:109310008030CAF8044009F015FA9AF80B1050464C +:1093200011290DD1417C06290AD1426841F6EC4150 +:10933000B1EB124F04D17E74C472CAF8044002E04B +:10934000787C02280AD1002102200CF041FD032084 +:10935000787416480021843009F0F4F9787C0328E9 +:109360006BD19AF80B105046132911D1417C062974 +:109370000ED1426841F6EC41B1EB124F08D17C743A +:10938000C4720B48CAF80440816B21F0010181636B +:1093900006483221843009F0D5F901284DD104481E +:1093A0007C74816B46E048E03A2A00205802002095 +:1093B000740B00207C0700208C2A0020001700205E +:1093C0008B070020820700201C05002000100140B0 +:1093D000000C0140445F43445A5F48414E44494EAB +:1093E000475F43484D0A0D00424D535F50524F5462 +:1093F0004F43414C5F4742323031310A0D0000008B +:1094000052455620445F43445A5F48414E44494EBA +:10941000475F43524D0A0D0052455620445F434476 +:109420005A5F48414E44494E475F43524D204141A7 +:109430000A0D000021F001018163DFF834A4DAF89D +:109440003800810704D520F00200CAF8380050E047 +:10945000410725D5B88D401C80B2B885F97988427E +:109460001CD3AAF8304098F800000C2803D09BF8D1 +:10947000001041B10AE04FF48041FE4804F073FF50 +:109480000120A87402E00D218BF80010AA200CF036 +:10949000D3FEDAF8381021F0040128E00020F6E7C6 +:1094A000000726D59AF81A00AA2802D1F2A00BF0DC +:1094B0003DF9B88DF979884243D398F800000C281B +:1094C00003D09BF8001041B10AE04FF48041E94815 +:1094D00004F049FF0120A87402E00D218BF8001070 +:1094E000AA200CF0A9FEDAF8381021F00801CAF819 +:1094F00038109AF81A00AA287FF4E7AEDFF890A394 +:10950000E449DAF804000090884248DDB9F85900CF +:1095100000F5FA70FFF707F90099FFF7DDF93ED281 +:10952000042078704FF0010987F80290DA49DAF8E0 +:109530000000DA4A01445646914204D2FFF72FF95F +:1095400003E00020CDE740F61C4028807068FFF75C +:1095500026F9A7F84200BC857C740021D0483F1D45 +:1095600009F0F0F8CFA00BF0E1F8D7488BF80040F5 +:109570000470D6487C703C700470BC877C8398F87B +:1095800000000C2803D00D208BF80000FDE54FF4FF +:109590008041B84804F0E7FE85F81290F5E5B88DF3 +:1095A000411CB98544F620618842EFD905207870C6 +:1095B000BC857C749BF8001009B98BF80060DAF860 +:1095C00004402046FFF7EBF8A7F842002046FFF7DB +:1095D000CDF8B9F85920BDE8F84F01B2BCA00BF0A6 +:1095E000A5B8B878DFF81C83012802D0022864D01F +:1095F000BEE09F48C44AB0F81B10B1F5FA6F2FD9EE +:10960000B9F8590000F5FA73994229D2A049D1F866 +:1096100004B0934507DD00F59670FFF784F85946CE +:10962000FFF75AF92BD39A484168B84881429148CC +:109630004FF480410BDD04F094FEAC740BE0BE707F +:109640004FF480418B4804F08CFEAC748FE004F042 +:109650008AFE0120A8743C864FF47A70788687E0F1 +:109660008B48D0F804B0934510DDB9F8590000F5E7 +:109670009670FFF758F85946FFF72EF906D2388E44 +:10968000411C3986798E8842D9D871E03C864FF4E6 +:109690007A70788609F04AF87D4841689B48814293 +:1096A00074484FF4804103DD04F05BFEAC745FE06E +:1096B00004F059FE0120A8745AE0754894494068A6 +:1096C0000090884240DDB9F8590000F59670FFF728 +:1096D0002AF80099FFF700F936D20FF06BFD012848 +:1096E00046D13879142826D27848007810BB78798A +:1096F000012816D198F81B10012902D1B8F82610BC +:1097000079B1388E411C398641F2883188422FD98F +:109710003C8609F00BF802F007FEA8F826407C71A1 +:1097200026E03C8630B909F007F83879401C3871DA +:10973000012078711CE09BF8001011B911218BF801 +:1097400000106148067013E0388E411C398641F2E2 +:10975000883188420CD96F4A4FF0010BA2F800B053 +:10976000798608F0E3FF594887F802B004703C8618 +:1097700011F032FB08B15448067005F08DFD012848 +:109780002FD181033B4804F0ECFDAC7498F8001035 +:109790004046012925D1C17E012922D199F897217E +:1097A0004FF4967B012A26D0B9F87511B8F81C0041 +:1097B00002F091F9584528D3B8F81C20B9F8751172 +:1097C0002BE004212B4804F0CEFD0120687404E056 +:1097D0000421284804F0C5FD6C744FF4FA7003F0BE +:1097E00072FD0CF083FE08B33748007801281DD0C5 +:1097F00002281BD03BE0DFF82091B8F81C00B9F834 +:109800003C1002F068F9584503D2687C0028D8D093 +:10981000E7E7B8F81C20B9F83C108A42E1D9B0F566 +:10982000AF7FDED9687C0128D2D0DAE72748012152 +:10983000017025480078022801D108F077FFF88DE3 +:10984000401C80B2F885B0F5FA6F10D998F81B204B +:10985000012A07D1B8F81E10962903D342F21071DD +:10986000884204D908F062FFFC850520787055E035 +:10987000740B0020000C014043445A5F48414E44A1 +:10988000494E475F43524D2041410A0D0000000000 +:10989000E81600200080BB44FF3FBEBAFFFF18005F +:1098A0009C02002043445A5F48414E44494E475F62 +:1098B00043524D20414120746F20436861726769B3 +:1098C0006E670A0D00000000820700201C050020C2 +:1098D0004241545F53616D706C655F566F6C7420CC +:1098E0002564203E3C20426D734D6178566F6C7448 +:1098F00020256420656E64696E6720636861726705 +:10990000650D0A000017002000603D4500C05A4563 +:109910000000FA442E050020FC0D002000F046FE59 +:1099200000F02CFC00F0F6FC3221644808F00AFF3D +:10993000012805D10CF022FA0021604808F002FF4E +:109940005E48FA21001D08F0FDFE01283CD1787C1C +:1099500068BB5A48C821143808F0F4FE01280DD11C +:109960000CF0C4FA8AF80B40CAF80440B88D002104 +:10997000401CB8855148143808F0E4FE9AF80B10E2 +:10998000504611290DD1417C11290AD1426841F676 +:10999000EC41B1EB124F04D1BC85C472CAF804404B +:1099A00003E0B88D022802D9BC857E7402E0787C81 +:1099B000022809D102200CF099FA40487C74BC8539 +:1099C0000021001D08F0BEFE3C48FA21083008F0D6 +:1099D000B9FE01287FF479AC0CF07AFCBDE8F84FB1 +:1099E00036480021083008F0ADBE08F09FFEFC703C +:1099F000464688F80240DFF8C880FC874FF4804173 +:109A0000404604F0AEFC2D48AC74FA210C3008F04E +:109A100099FE012807D100200CF02AFC27480021DC +:109A20000C3008F08FFE3221244808F08BFE01280C +:109A300006D100200CF03CFD0021204808F082FEF9 +:109A4000D6F8071041F28830814214DC70780C2877 +:109A500011D099F897010128BCD1E87A6228BFF4A7 +:109A600034AC184E308F400413D57C70B463687CDE +:109A7000012805D00DE013487C7084633C760FE02C +:109A80000421404604F06DFC6C744FF4FA7003F04E +:109A90001AFC96F83800C0073FF417AC7C70B4632A +:109AA000687C012896D10421404604F05AFC6C746D +:109AB000BDE8F84F4FF4FA7003F005BCE002002057 +:109AC000000C0140740B002000F00F01000900EBB6 +:109AD000800001EB4000C0B2704710B5012006F0D5 +:109AE00077FCBDE81040002006F072BC0149086018 +:109AF0007047000000860D422DE9F04F724C734A0A +:109B0000A1B041F20400A4F80500D0790026012894 +:109B100000D1D6716E4F106DF97A10B99173012092 +:109B20001065DFF8B0B10A255846BBF81230BA46C6 +:109B3000B3FBF5FCB3FBF5F384F807C01B0A2372F3 +:109B4000BBF81430B3FBF5FCB3FBF5F384F809C0A4 +:109B50001B0AA372BBF81630B3FBF5FCB3FBF5F39D +:109B600084F80BC01B0A2373038BB3FBF5FCB3FB18 +:109B7000F5F384F80DC01B0AA373B0F81B30B3FBD8 +:109B8000F5FCB3FBF5F384F80FC01B0A2374B7F898 +:109B90000730B3FBF5F7B3FBF5F367741B0AA37447 +:109BA000BBF83200E074000A20754B480078431E71 +:109BB000632B01D8607500E06175DFF82081907B30 +:109BC000A075DFF81C91D8F80800464F484508D228 +:109BD000B84206DA4449FEF72AFBFEF7E0FDE075DD +:109BE00000E0E675D8F80C00484508D2B84206DA1D +:109BF0003D49FEF71CFBFEF7D2FD207600E02676FD +:109C0000D8F81000484508D2B84206DA3649FEF7BF +:109C10000EFBFEF7C4FD607600E06676334931F84E +:109C2000590FB0FBF5F2B0FBF5F0A276000AE07632 +:109C30004888B0FBF5F2B0FBF5F02277000A6077B8 +:109C4000488DB0FBF5F2B0FBF5F0A277000AE077A3 +:109C5000888DB0FBF5F1B0FBF5F084F82010000A18 +:109C600084F821009AF8110084F82200BBF8300033 +:109C700084F82300000A84F824001D48C17E0129CD +:109C80001FD0808CB0FBF5F1B0FBF5F084F8251007 +:109C9000000A84F82600202060801648017C491CB8 +:109CA000017415A00AF042FD20AA6946064803F097 +:109CB00081FA064800214C3008F044FD21B0BDE88F +:109CC000F08F808BDEE700006E3400207C070020E0 +:109CD000EE0B0020740B002058020020E816002034 +:109CE000000020C20000F642000020428C2A002022 +:109CF00000170020F435002073656E64204368610E +:109D000072676520646174610A0D00002DE9F04FEF +:109D1000DFF818A1A1B041F209010AF2EA24AAF879 +:109D200005104FF0780BA4F817B040F2DE30404D2C +:109D3000A4F81D004FF47A70AF8F24F80D7F6E8F5A +:109D40006680A0802889FEF704FD3A4A3A4BFEF768 +:109D5000E9FBFEF757FDC3B2E371EA7EA2714FF053 +:109D60003209A4F80890E88F2946C0F30900A081C1 +:109D7000B5F827C0C98A0D3C4FF06408BCF1000F4C +:109D800007D1B5F806C00CFB01FC9CFBF8FCA5F85C +:109D900027C0B5F825C0BCF1000F07D1B5F804C045 +:109DA0000CFB01FC9CFBF8F1A5F8251095F827C0E9 +:109DB00084F81BC095F8255025778AF807703C0A6F +:109DC0008AF808408AF80960340A8AF80A40E824C8 +:109DD0008AF80B4003248AF80C408AF80D308AF880 +:109DE0000E208AF80F90002251468AF810208AF837 +:109DF00011B08A74C874000A087581F815C08D7591 +:109E0000DE20C8750C760D491220AAF80200087CE5 +:109E1000401C08740AA00AF089FC20AA694603487D +:109E200003F0C8F921B0BDE8F08F00006E340020C7 +:109E3000FC0D00207B14AE47E17A843FF43500200E +:109E400053656E64204368617267696E674461742C +:109E500061200A0D0000000030B5A1B000201D49AE +:109E6000ADF880001C4C41F20300A1F80500E07B36 +:109E7000C8711A480125022300780422012809D05C +:109E8000022807D00325032804D0042805D005287C +:109E900006D008E00B724D7205E00D724A7202E0C6 +:109EA0000A7205204872207888724A800C49087C22 +:109EB000401C08740BA00AF039FC20AA694605482A +:109EC00003F078F904480021483008F03BFC21B049 +:109ED00030BD00006E3400207C07002059020020B5 +:109EE000F435002073656E642073746174652064BA +:109EF000617461200A0D00002DE9FE4F00273849EA +:109F00000097019702970878DFF8D8803C4650B355 +:109F1000012826D10F70344FDFF8D090DFF8D0A0A1 +:109F200000246D4608F1180658F82400FEF783FC5B +:109F300002460B4638464946FEF766FB002253466A +:109F4000FEF7EAFAFEF7A2FC45F8240004F096F8C2 +:109F5000FEF7E0FB06EB8401641CA4B28860032CCE +:109F6000E2D3BDE8FE8F48781E4D401CC0B2183DBC +:109F700089464870142810D205F1240636F81400DA +:109F8000FEF7D1FB55F82410FEF751F945F82400EF +:109F9000641CA4B2032CF1D3E3E7124EDFF854B0F3 +:109FA000DFF854A00C3E55F824005946FEF7C9F9D5 +:109FB0006FF00B01FEF703FA5146FEF790F948F8EF +:109FC000240046F8247045F82470641CA4B2032CC5 +:109FD000E9D389F80170012189F80010C1E7000078 +:109FE000F4040020D01600209A9999999999134069 +:109FF0000000F03F0000A041CDCC4C4010B5124C09 +:10A00000A2B041F22100A4F80500A4F24640406944 +:10A01000E071010A2172010C6172000EA07204202D +:10A0200004F5C3716080087C401C087407A00AF026 +:10A030007DFB20AA6946204603F0BCF80421E01D00 +:10A040000EF0C0FA22B010BD6E3400200A0D736805 +:10A05000656E676A6979696E676461200A0D000040 +:10A0600010B50F4CA2B04FF48150A4F80500552054 +:10A07000E071AA202072022004F5C3716080087C80 +:10A08000401C087407A00AF051FB20AA694620462C +:10A0900003F090F80221E01D0EF094FA22B010BDFA +:10A0A0006E3400204F54412041434B200A0D0000E4 +:10A0B00000B51A49A1B041F20800A1F8050018A0A6 +:10A0C00001F2BE23026818A0DA6200681863A1F1E9 +:10A0D000420343F8492F01F2EA2258601448092349 +:10A0E0001373D0F8B500000B9060C873020A0A74AD +:10A0F000020C4A74000E8874CB740D20488001F560 +:10A10000C371087C401C08740AA00AF00FFB20AA47 +:10A110006946024803F04EF821B000BD6E340020BD +:10A12000533230310000000051695255690000007F +:10A13000FC0D002073656E6420626D73207665727D +:10A1400073696F6E0A0D000010B501214FF0C05009 +:10A1500006F00EF9012005F031FA074A1169087876 +:10A160004978C943C9B2884202D1411E042900D3AB +:10A170000020107010BD0000E004002010B54FF466 +:10A180007A711A4808F0DEFA01282DD1184830F803 +:10A19000051F408841434FF4616091FBF0F0FEF7EA +:10A1A000B9FA144C54F8031FFEF741F82060FEF78B +:10A1B00042FB114A114BFEF7B5F90022104BFEF796 +:10A1C00023FAFEF71FFB0A4C00217A3C6086074801 +:10A1D00008F0B8FAA4F14800618E01814189491C58 +:10A1E0004181208E401C208610BD0000B40200205A +:10A1F000EE0B00203A2A00209A9999999999F13FFB +:10A200000088C3402DE9F047DFF8FC803F4A404911 +:10A21000B8F80500508391F89731032B71D10A23C8 +:10A22000B0FBF3F45483B1F89801A04269D3B1F8BC +:10A230009A01A04265D80020914601EB4005B5F88F +:10A240009C21A24258D8B5F89E21A24254D901EBD4 +:10A250004000B5F89C61B0F89E0105F5CE75801BF5 +:10A26000FEF758FA8246688C2F8CC01BFEF752FA14 +:10A270005146FEF766F805463846FEF754FA824620 +:10A280004F46A01BFEF746FA2946FEF728F851462E +:10A29000FDF7CDFFFEF783FAC0B2F87398F80B1004 +:10A2A000454601B9E872C82C03D97978032900D250 +:10A2B000E872E97A01F00FFC032805D8E97AF87B07 +:10A2C000814216D8E87214E0104841F288316830B3 +:10A2D00008F038FA01280CD1E87A602804D2F97B1A +:10A2E000884201D8401CE87208480021683008F014 +:10A2F00029FA0120BDE8F087401CC0B210289CD389 +:10A30000F8D10020F6E70000EE0B002058020020F4 +:10A310008C2A00202DE9F0416A4E0021728DB08B0D +:10A32000824202D0708531673174674C4FF4FA6213 +:10A33000E07A6428306F00F10103336704D2904261 +:10A3400007D90220316703E0904202D90620316725 +:10A35000B0835E4DB5F88310B5F85900814201D93C +:10A36000A5F88300B5F88520B5F85B108A4201D9BD +:10A37000A5F88510B4F80510B4F80720C827514394 +:10A3800042F2107291FBF2F1B164B18B4FF4967806 +:10A3900007295DD2DFE801F05C5E04223037370028 +:10A3A0002188814200D9208046484FF47A716C3070 +:10A3B00008F0C8F901284DD16088B5F885108842A9 +:10A3C00001D21E3060806088642801D264206080E1 +:10A3D0003C4800216C3008F0B5F93BE0B5F883004B +:10A3E0002080B5F88500FEF7B4F9394A394BFEF7FD +:10A3F00099F8FEF707FA24E0B5F883002080B5F855 +:10A40000850040081DE095F897019621012803D0AA +:10A41000B5F8830020800BE02F48304AC0881288AE +:10A420005043B5F8832090FBF2F080B2642801D24B +:10A4300061800FE0962801D267800BE0C82802D225 +:10A44000FA20608006E0FA2804D2A4F8028001E035 +:10A450000120B08322480078012804D121480088D7 +:10A46000404500D86780B078022802D0012803D088 +:10A470000FE0B5F883000BE01B481C491C4A00683C +:10A480000144914202D2FEF78AF901E040F61C40F5 +:10A4900020806188B5F88500814200D960802188DC +:10A4A000B5F85900814200D920806188B5F85B0079 +:10A4B000814200D9608060881E2801D21E20608001 +:10A4C000BDE8F08158020020EE0B00208C2A00200D +:10A4D0009A9999999999E93FFC0D0020240500204B +:10A4E0001C05002026050020E8160020FF3FBEBA0C +:10A4F000FFFF180070B52949294D31F8590FE8843C +:10A500008988884201D9401A2885A97B687B254C17 +:10A51000814224D0E17A01B9E072E17A01F0DBFAFC +:10A52000032806D8E17A687B814224D8E072A873B8 +:10A5300021E01B484EF66021643008F003F9012841 +:10A5400019D1E07A622804D2697B884201D8401C84 +:10A55000E07213480021643008F0F4F80BE0104872 +:10A560001149603008F0EEF8012809D1E07A60283E +:10A5700001D2401CE0720A480021603008F0E2F885 +:10A58000E07A6421642800D3E172E07AA0F1470206 +:10A590001D2A00D35A21A18170BD00008C2A002001 +:10A5A00058020020EE0B0020C0D4010070B5164DFB +:10A5B000164C95F89701022809D0012803D0FFF71F +:10A5C00021FE20B105E012480078E07201E0FFF7BB +:10A5D00091FF10481049114A40680144914202D24B +:10A5E000FEF7DDF80CE009487A38B0F81B00B0F54A +:10A5F000FA6F03D9B5F85910884201D3B5F8830032 +:10A60000A4F8050070BD00008C2A0020EE0B00208D +:10A6100058020020E8160020FFFF1EBBFFBF790094 +:10A6200070B5094D130AD2B205F5807605E010F831 +:10A63000014B5C402B5D5340325D491E89B2F6D21E +:10A6400042EA032070BD000028BB010870B5094D27 +:10A65000FF22134605F5807605E010F8014B5440C3 +:10A660002A5D5A40335D491E89B2F6D243EA022080 +:10A6700070BD000028BB0108022101A005F056BFF3 +:10A68000415400000A2101A005F050BF41542B5352 +:10A69000544154453D3F000010B588B00446202188 +:10A6A0006846FDF78AFD20216846FDF786FD2246B3 +:10A6B00006A168460AF04AF86846FDF79BFD014688 +:10A6C000684605F033FF08B010BD000041542B4E22 +:10A6D000414D453D25730000092101A005F026BF2D +:10A6E00041542B4E414D453D3F0000000D2101A03E +:10A6F00005F01CBF41542B554152545F4346473D22 +:10A700003F0000000B2101A005F010BF41542B5663 +:10A710004552494F4E3D3F0070B5214D68780128A4 +:10A720003DD1204C2078062830D2DFE800F003131A +:10A730000B2F1A2307221CA11D48FDF762FD28BB21 +:10A74000022015E00A221BA11948FDF75AFDE8B9BD +:10A7500001200DE01A491648FDF73AFDB0B104207A +:10A7600006E00B2217A11248FDF74BFD70B905203A +:10A7700020700BE00E486060688A20810C480188D8 +:10A78000A1F5B442A53A01D10EF082FD0020687017 +:10A790006882BDE8704080210548FDF70EBD70BDA0 +:10A7A0007C070020F435002041542B4F4B0D0A004C +:10A7B0001831002041542B4F4B0D0A3033303300F9 +:10A7C0009C2A002041542B4F4B0D0A30310D0A00BA +:10A7D00010B5114C2078062819D2DFE800F0030BE1 +:10A7E00007180F19BDE81040FFF746BFBDE810403D +:10A7F00000F09EBABDE8104000F05EBA00F084FAA6 +:10A80000064890F8760008B1012800D1A07010BD6C +:10A81000BDE8104000F004B8F43500208C2A002078 +:10A820002DE9F041404E96F8A800012823D03F4D75 +:10A830003F4A4FF47A71E9843046177C01230024A3 +:10A8400090F87600142F06D910B1012802D002E04A +:10A85000947000E093709778052F0CD2DFE807F032 +:10A8600003070D0B5700BDE8F04100F0F5B900F00B +:10A87000B3F986F8A840BDE8F0812C48343007F0E1 +:10A8800061FF0128F7D1A88C401C80B2A884092858 +:10A8900000D9AC8425480021343007F053FFA88C40 +:10A8A000A8B1012817D0022819D00328E3D0042822 +:10A8B00019D005281BD006281DD007281FD008282E +:10A8C00021D00928D7D1BDE8F0410BF037B8BDE859 +:10A8D000F04100F0A3B8BDE8F041FFF70DB9BDE8C5 +:10A8E000F041FFF7B9BABDE8F04100F023B8BDE888 +:10A8F000F041FFF7DDBBBDE8F041FFF707BABDE867 +:10A90000F0410BF077B8BDE8F0410AF0D9BF517CB7 +:10A910004D1C55741429AED9147018B10128AAD150 +:10A920009370A8E79470A6E78C2A00207C0700208B +:10A93000F435002030B5A1B000202F4CADF88000D8 +:10A9400041F20700A4F805002C4842F21075828BF2 +:10A95000C18BE27102FB01F393FBF5F3120A227241 +:10A960006172090AA172E37290F82910217390F8BC +:10A97000281061732021A1735F21E173C27E2274CC +:10A98000C18C6174090AA174E274B0F809102175D0 +:10A99000090A6175B0F80B10A175090AE175B0F8E4 +:10A9A00001102176090A6176B0F80510A176090A2E +:10A9B000E176C1792177418A6177090AA17790F818 +:10A9C0002A10E17790F82B0084F820000CA009F001 +:10A9D000ADFE1A20608020AA6946204602F0EAFBFC +:10A9E00004F5C371087C401C08740021094807F075 +:10A9F000A9FE21B030BD00006E34002000170020F9 +:10AA000073656E64204443444320646174610A0D9D +:10AA100000000000D007002005F07CBD30B5A1B0DB +:10AA20000020614CADF88000604941F20200A4F8BA +:10AA30000500486C5F4B401C486404F8070F000A8F +:10AA400060705B4890F86B10A1705A8A0A21B2FBC3 +:10AA5000F1F5B2FBF1F2E570120A22719A8AB2FBAB +:10AA6000F1F5B2FBF1F26571120AA271DA8AB2FB5A +:10AA7000F1F5B2FBF1F2E571120A22721A8BB2FB08 +:10AA8000F1F3B2FBF1F26372120AA27290F88D2018 +:10AA9000E272B0F85320B2FBF1F22273B0F86320F7 +:10AAA0006273120AA273B0F88E20B2FBF1F3B2FB0C +:10AAB000F1F2E373120A2274B0F8B320B2FBF1F2A0 +:10AAC0006274B0F8B120B2FBF1F2A274B0F85D206C +:10AAD000E274120A2275B0F85F206275120AA2753C +:10AAE000B0F85920E275120A227690F8B02062760A +:10AAF00090F88920A27690F88A20E27690F88B2050 +:10AB0000B2FBF1F2227790F88C20B2FBF1F262777F +:10AB100090F8B520323AA27790F8B620323AE27730 +:10AB200090F8B72084F8202090F84D2084F8212058 +:10AB300090F84F2084F8222090F8512084F82320A8 +:10AB400090F8872084F824201B4A927884F82520E6 +:10AB5000B0F89020B2FBF1F184F8261090F8921032 +:10AB600084F8271090F8930084F8280010490E48C4 +:10AB7000112295313030FDF707FB10A009F0D6FD0A +:10AB80003A2024F8050C20AA6946074802F012FB77 +:10AB90001049087C401C087404480021403007F02C +:10ABA000D1FD21B030BD00006E3400207C070020B4 +:10ABB0008C2A0020740B00203A2A002073656E64F2 +:10ABC00020686561727462656174206461746120DB +:10ABD0000A0D0000F435002010B592B00020ADF849 +:10ABE000400040F6B831134807F0ACFD01281FD1F2 +:10ABF000114C41F20100A4F8050010A009F096FDE7 +:10AC00001349A4F14200CA6E40F8492F096F416010 +:10AC100010490A6882604968C1601020608010AAEB +:10AC20006946204602F0C6FA0021024807F08AFD74 +:10AC300012B010BDB80700206E34002073656E643A +:10AC4000204C6F67696E20646174610D0A0000001A +:10AC50008C2A002098BA010810B592B00024ADF8F3 +:10AC6000404041F288310C4807F06CFD012810D1BA +:10AC700001030A48A0F80510448009A009F056FD18 +:10AC800010AA6946054802F095FA0021024807F02B +:10AC900059FD12B010BD0000B40700206E34002032 +:10ACA00053656E64205265676973746572656420CC +:10ACB000646174610A0D000010B54FF47A71104898 +:10ACC00007F040FD012819D10D4C2C3C607B20B1D0 +:10ACD000012804D0022807D00AE0012007E0094833 +:10ACE000FFF7DAFC022002E0FFF7F6FC00206073B9 +:10ACF000BDE810400021024807F024BD10BD00004F +:10AD0000A80700209C2A002010B540F6B83107485B +:10AD100007F018FD012807D1FFF7B4FCBDE810408B +:10AD20000021024807F00EBD10BD0000AC07002056 +:10AD300010B54FF47A710D4807F004FD012814D1C5 +:10AD40000A4C283C207B10B1012804D007E0FFF713 +:10AD5000D9FC012002E0FFF7C9FC00202073BDE808 +:10AD600010400021014807F0EDBC10BDA4070020F1 +:10AD70002DE9F04731214448FDF71FFA42480D21E3 +:10AD80003130FDF71AFA404813213E30FDF715FA2D +:10AD90003D4801273D4D077047700026867095F8A5 +:10ADA000B010C170B5F85F1051B18180B5F859404D +:10ADB0004FF4FA6A40F6AC59544504D3C48004E019 +:10ADC0004FF47A71F1E7A0F80690DFF8BC8030A26A +:10ADD000A8F104081268C8F80C201F21C66001748D +:10ADE0000B2141740A218174C674067510214175C6 +:10ADF0008775C67595F8951008F11C00FF294FF06E +:10AE0000110204D021499531FDF7BEF902E022A1DB +:10AE1000FDF7BAF925A140460A6840F82D2F496888 +:10AE200041601949B5F8B10031310880B5F85B00CF +:10AE3000642801D24FF4FA704880B5F86300888026 +:10AE4000A4F2D17040F6C312904201D2CC8001E04E +:10AE5000A1F806906E2008724FF49670A1F80900D0 +:10AE6000B5F86700504501D840F6B830A1F80B009E +:10AE700005481E213E304180B5F883100180C6721E +:10AE80000774BDE8F0870000B00B00208C2A00207A +:10AE900042594454000000004C4656324132314B76 +:10AEA00036413330393233393900000053303031D4 +:10AEB0004830303100000000FEE7000000B585B0EA +:10AEC0006A460021044800F09FFC694600200BF010 +:10AED0002DFD05B000BD00000064004070B5174CAA +:10AEE0004FF400752946204600F0C6FA01280CD11F +:10AEF0001349204600F0A6FA012802D100200BF0E9 +:10AF0000B5FD2946204600F0A5F94FF48065294695 +:10AF1000204600F0B1FA01280FD109492046891CCA +:10AF200000F090FA012802D100200BF0B7FD29466D +:10AF30002046BDE8704000F08DB970BD006400404F +:10AF40000200F01010B51A4C0021204600F0F6FC6B +:10AF5000022806D0012824D00022002108460BF048 +:10AF600011FD0121204600F0E9FC022806D001284D +:10AF700019D00022012100200BF004FD02212046FF +:10AF800000F0DCFC022806D001280ED000220221AD +:10AF900000200BF0F7FC2046BDE81040012100F036 +:10AFA00059B90122D9E70122E4E70122EFE70000C5 +:10AFB0000064004070B58AB005F062FC01210920F0 +:10AFC00005F0EEF90121480605F0D2F901218806C5 +:10AFD00005F0CEF9494E0021304600F0CFFB701449 +:10AFE000ADF8200003208DF822001820444C8DF885 +:10AFF000230008A9204603F033F9A014ADF820007F +:10B0000048208DF8230008A9204603F029F90025DF +:10B0100001248DF81A508DF81B4008208DF8180077 +:10B020008DF816508DF817400620ADF814000795DE +:10B030008DF8194005A9304600F07AFA0E208DF8F7 +:10B040000E008DF80F508DF81040ADF80450ADF89B +:10B050000850ADF80650ADF80A50ADF80C408DF828 +:10B06000114001A800F088F901221021304600F0BB +:10B0700057FA41208DF800008DF801408DF80250FC +:10B080008DF80340684604F025FA01221146304647 +:10B0900000F046FA01225102304600F041FA012246 +:10B0A0009102304600F03CFA0122D103304600F014 +:10B0B00037FA0121304600F061FB3F208DF8000097 +:10B0C0008DF801408DF802508DF80340684604F079 +:10B0D00001FA42208DF800008DF801408DF80250F1 +:10B0E0008DF80340684604F0F5F905F0D3FB05A0A0 +:10B0F00009F01CFB0AB0002070BD00000068004091 +:10B10000000C014063616E2032206F70656E210A71 +:10B110000000000000B585B06A460121064800F035 +:10B1200073FB9DF80900002803D1694601200BF04C +:10B13000FDFB05B000BD00000068004070B51B4C71 +:10B140004FF400752946204600F096F9012810D1E9 +:10B15000174E2046314600F075F9012805D10BF055 +:10B1600085FC3146204600F05DF82946204600F077 +:10B1700071F84FF480652946204600F07DF90128DA +:10B1800013D10B4E2046B61C314600F05BF9012866 +:10B1900005D10BF083FC3146204600F043F82946E8 +:10B1A0002046BDE8704000F055B870BD0068004012 +:10B1B0000200F01010B51A4C0021204600F0BEFB32 +:10B1C000022806D0012824D00022002101200BF003 +:10B1D000D9FB0121204600F0B1FB022806D001284E +:10B1E00019D00022012108460BF0CCFB0221204699 +:10B1F00000F0A4FB022806D001280ED00022022174 +:10B2000001200BF0BFFB2046BDE81040012100F0FB +:10B2100021B80122D9E70122E4E70122EFE700008B +:10B22000006800400A4A914202D1002181617047C2 +:10B23000C1F313028B0101D5C26070474B0101D5E8 +:10B2400002617047090101D5826070474260704712 +:10B250007000F03030B5082310240422B1F5007FCF +:10B260001DD010DC202929D007DC012921D0042998 +:10B2700022D0082900D1C46030BD402920D0B1F5CA +:10B28000807FF9D10BE00025B1F5004F06D008DC36 +:10B29000B1F5806F03D0B1F5006FEDD185614260EB +:10B2A00030BDB1F5803F0DD0B1F5003FF8D144601D +:10B2B00030BD0549816030BDC36030BD036130BD24 +:10B2C000046130BD436030BD01010100094910B582 +:10B2D00088424FF0010101D14C0601E04FF080643B +:10B2E000204605F051F82046BDE81040002105F049 +:10B2F0004BB800000064004030B41446002819D058 +:10B300000022027202604260B1F5006F03D304258F +:10B310000572416001E00272016043B13CB14272CA +:10B320008372214630BC1A460B30FCF72DBF827267 +:10B330000221417230BC704730B41446002819D045 +:10B340000022027202604260B1F5006F03D304254F +:10B350000572416001E00272016043B13CB142728A +:10B360008372214630BC1A460B30FCF70DBF827247 +:10B370000221417230BC7047F0B5827A2F4D012115 +:10B3800091402A6842F001022A602C4E1C36326835 +:10B390008A433260294A047B294B0C32A4B91468D1 +:10B3A0008C4314604488C78844EA0744877A03EBD7 +:10B3B000C707C7F840460488878844EA0744877A65 +:10B3C00003EBC707C7F84446047B012C12D114686D +:10B3D0000C431460847A026803EBC4044FEA3242DF +:10B3E000C4F84026847A426803EBC4034FEA324231 +:10B3F000C3F84426114AC37A121D002B136806D0E5 +:10B400000B4313600D4A0389143213B104E08B43DC +:10B41000F7E713688B4313600389012B02D113688C +:10B420000B431360407B012802D130680843306031 +:10B43000286820F001002860F0BD00000066004090 +:10B44000006000400246002011F4700F03D09269A2 +:10B4500004E001207047CB0104D552680A40110373 +:10B46000F7D170470B0101D59268F7E78B0101D541 +:10B47000D268F3E71269F1E70246002053690B42F4 +:10B480004AD0B1F5807F3BD013DC08292ED007DCF1 +:10B49000012926D0022927D004293DD1D0682BE0EC +:10B4A000102925D0202926D0402935D11069102116 +:10B4B00030E0B1F5004F2BD00BDCB1F5007F22D08E +:10B4C000B1F5806F22D0B1F5006F25D19069702160 +:10B4D00020E0B1F5803F11D0B1F5003F1CD150689C +:10B4E000E5E790680D4915E0D06802E0D068DEE736 +:10B4F000106903210EE0106908210BE05068FBE79A +:10B500009069012106E09069022103E0906900E062 +:10B510005068042100F09CBD70470000010101004B +:10B52000002A426901D00A4300E08A434261704721 +:10B5300010B50368002223F002030360036843F0A0 +:10B54000010303604FF6FF7300E0521C4468E407F8 +:10B5500001D19A42F9D14268D2073ED08A79012AB4 +:10B5600002683CD022F080020260CA79012A026897 +:10B5700038D022F0400202600A7A012A026834D0F0 +:10B5800022F0200202604A7A012A026830D022F0BA +:10B59000100202608A7A012A02682CD022F0080286 +:10B5A0000260CA7A012A026828D022F004020260EE +:10B5B0008A78CC78920742EA04620C7942EA044223 +:10B5C0004C79098842EA0452491E0A43C261016863 +:10B5D00021F001010160002114E0002010BD42F0C3 +:10B5E0008002C1E742F04002C5E742F02002C9E70D +:10B5F00042F01002CDE742F00802D1E742F0040227 +:10B60000D5E7491C4268D20701D09942F9D1406878 +:10B61000C007E2D1012010BD10460B0001D000216F +:10B62000184770470846D1B2C0B20DF00DB90000FE +:10B6300070B58AB00121052004F0B2FE0121480650 +:10B6400004F096FE474E0021304600F097F8B01403 +:10B65000ADF8200003208DF822001820424C8DF810 +:10B66000230008A9204602F0FBFDE014ADF82000FD +:10B6700048208DF8230008A9204602F0F1FD00249F +:10B680008DF81A4001258DF81B500C208DF81800FC +:10B690008DF816408DF817400920ADF81400079476 +:10B6A0008DF8195005A93046FFF742FF8DF80E407E +:10B6B0008DF80F408DF81050ADF80440ADF80840FB +:10B6C000ADF80640ADF80A40ADF80C408DF81150C9 +:10B6D00001A8FFF751FE012202213046FFF720FFAB +:10B6E00014208DF800008DF801508DF802408DF87F +:10B6F0000350684603F0EEFE012211463046FFF784 +:10B700000FFF012251023046FFF70AFF012291028A +:10B710003046FFF705FF0122D1033046FFF700FF57 +:10B720000121304600F02AF813208DF800008DF832 +:10B7300001508DF802408DF80350684603F0CAFEB0 +:10B7400016208DF800008DF801508DF802408DF81C +:10B750000350684603F0BEFE04A008F0E7FF0AB0FD +:10B76000002070BD006400400008014063616E204D +:10B7700031206F70656E210A0000000000234FF633 +:10B78000FF7221B1012917D0022924D03AE00168C3 +:10B7900021F0020141F00101016000E0521E416808 +:10B7A00001F00301012901D0002AF7D1406800F01F +:10B7B0000300012823D124E0016821F00301016086 +:10B7C00000E0521E4168890701D0002AF9D1406883 +:10B7D000800714D115E0016821F0010141F0020158 +:10B7E000016000E0521E416801F00301022901D00E +:10B7F000002AF7D1406800F00300022801D000239E +:10B8000000E001231846704710B500EB0113D3F890 +:10B81000B04114F004041472D3F8B04133D0E408FA +:10B820005460D3F8B04104F002045472D3F8B44128 +:10B8300004F00F049472D3F8B441240AD474D3F8FA +:10B84000B841D472D3F8B841240A1473D3F8B8417C +:10B85000240C5473D3F8B841240E9473D3F8BC412C +:10B86000D473D3F8BC41240A1474D3F8BC41240C1B +:10B870005474D3F8BC311B0E937439B1016941F093 +:10B880002001016110BD640D1460CAE7C16841F078 +:10B890002001C16010BD30B50246002093685B01F5 +:10B8A00008D49068000101D5012003E09068C00031 +:10B8B00037D5022002EB0012D2F8803103F00103E9 +:10B8C000C2F880310B7A73B3D2F880414D681C43C3 +:10B8D0004B7A43EAC5031C43C2F880418B7A03F0DC +:10B8E0000F038B72D2F8843123F00F03C2F8843136 +:10B8F000D2F884318C7A2343C2F88431CB7ACC6875 +:10B9000043EA0423C2F88831CB7B096943EA012169 +:10B91000C2F88C11D2F8801141F00101C2F88011F7 +:10B9200030BD042030BDD2F880314C7A23430C88DE +:10B9300043EA4453C2F88031D0E70000002221B12D +:10B94000012905D0022906D112E08268114801E0E0 +:10B950008268114802401149501A8A4214D00ADC08 +:10B96000A2B16FF0806010180FD002280CD10FE048 +:10B9700082680B48EEE7B0F5007F09D0094940180E +:10B9800003D0B0F5003F03D000207047022070477D +:10B9900001207047030000040003000800010008B4 +:10B9A000000003100001FFF710B501784278154B35 +:10B9B00001EB0221A3F81B108178C27801EB022170 +:10B9C00009B2B1F57A6F02DDA1F57A6101E0C1F546 +:10B9D0007A6109B20B4C8AB27A34A3F81D200A2985 +:10B9E00002DBA4F8072002E00021A4F80710017987 +:10B9F000427901EB022123F81F1F80799870012002 +:10BA000010BD0000740B002000B502460078FEF760 +:10BA10005BF8134BD8725078FEF756F8187390788D +:10BA2000FEF752F85873D078FEF74EF898731079F5 +:10BA3000FEF74AF8D8735079FEF746F818749079F3 +:10BA4000FEF742F8064958744839D1F8532041F8B6 +:10BA5000012FB1F856208A808871012000BD0000B6 +:10BA6000740B002070B5094DFF22134605F5807652 +:10BA700005E010F8014B54402A5D5A40335D491EE1 +:10BA800089B2F6D243EA022070BD000088B70108EF +:10BA900030B50D46044600F004F8611909884840A5 +:10BAA00030BD70B503464FF6FF7048F205050446F9 +:10BAB0000EE013F8012B80EA02200022491E060442 +:10BAC00004EA400000D56840521CD2B2082AF6D3DE +:10BAD0000029EED170BD884202D9A0EB010002E03E +:10BAE00003D2A1EB000080B270474FF00000704716 +:10BAF00001207047A0F13001092901D8C8B2704770 +:10BB0000A0F14101052901D8373804E0A0F1610115 +:10BB1000052902D85738C0B270470020704700008E +:10BB20002DE9F05FDFF800940024A9F1520799F89D +:10BB30009701FE4D012817D1D7F80B10481CC7F804 +:10BB40000B003846B1F57A7FB0F82B0008DD40F4E1 +:10BB50008060A7F82B00287830B90E20287003E009 +:10BB600020F48060A7F82B00D7F8071042F210707D +:10BB70008142B7F82B0008DD40F40060A7F82B00E5 +:10BB8000287830B90820287003E020F40060A7F876 +:10BB90002B00DFF89CA36FF07E510AEB840BE54885 +:10BBA000DBF808804144814224D209EB4406B6F810 +:10BBB0004D00401FFCF7AEFD4146FCF783FE06D862 +:10BBC000287808B90A202870DB4901200870B6F8E7 +:10BBD0004D00FCF7A8FDDBF80810FCF773FE09D850 +:10BBE000287808B90A202870B7F82B0020F0010047 +:10BBF000A7F82B00641CE4B2032CCCD3CF48CA4C6A +:10BC0000DFF83CB300780026683C4FF496780428AF +:10BC10007DD1BBF807000A2816D8CA48808FB0F536 +:10BC2000E16F18D32088411C218044F25061884282 +:10BC300011D9B7F82B0040F08000A7F82B00287826 +:10BC400048B90720287006E0B7F82B0020F08000E4 +:10BC5000A7F82B002680BC48BC4A4FF480410378EB +:10BC6000BB48022BDAF804301A4416D0824253D271 +:10BC7000B84802F076FB8BF812606088411C89B2EC +:10BC80006180B0F5FA7F2ED9B7F82B0040F00400A0 +:10BC9000A7F82B00287820B325E0824219D2AD48BE +:10BCA00002F05FFB8BF812606088411C61806428A1 +:10BCB0000BD906F03BFDB7F82B0040F00400A7F8C5 +:10BCC0002B00287808B913202870608840450DD8CB +:10BCD0001DE0B7F82B0020F00400A7F82B006680C9 +:10BCE00022E013202870B1F5487F10D920219A480E +:10BCF00002F037FB0221974802F033FB01219548FF +:10BD000002F02FFB4FF4FA7001F0DDFA66808E48E6 +:10BD10000078022808D034E0B7F82B0020F00400A7 +:10BD2000A7F82B00668030E0B9F85900BBF8052071 +:10BD30008A4900F59670824203D3DAF804208A42D9 +:10BD400008DC874AB2F81B20824213D9DAF80400D3 +:10BD500088420FDDA088411CA180C82811D928780D +:10BD600008B913202870B7F82B0040F00400A7F89A +:10BD70002B0006E0B7F82B0020F00400A7F82B00FA +:10BD8000A6806E48007804281CD1B9F88530BBF82D +:10BD900007000C213233984204D2B9F85B203232CA +:10BDA000904218D3E088421CE28040450AD92878A6 +:10BDB00020B1B7F82B0040F0100001E02970F8E73F +:10BDC000A7F82B00387818280BD026826548017810 +:10BDD000012916D03BE0E680B7F82B0020F01000D8 +:10BDE000EEE7208A411C21826428EFD9287808B91F +:10BDF0000D202870B7F82B0040F48050A7F82B00D6 +:10BE0000E4E7C17E012922D1818BC08B40F25F52D1 +:10BE10004143B9F879015043B1EBC00F11DD2089DE +:10BE2000411C2181B0F5FA7F12D92681287808B902 +:10BE300015202870B7F82B0040F00200A7F82B005F +:10BE400006E0B7F82B0020F00200A7F82B002681AF +:10BE500037484549406801444448814210D2A0898E +:10BE6000411CA18140450CD9A681287808B917202A +:10BE70002870B7F82B0040F02000A7F82B0000E056 +:10BE8000A681DFF8D4A04FF40041504602F062FAD8 +:10BE900088B19BF8110070B1E089411CE1814045F7 +:10BEA0001FD9E681287808B918202870B7F82B0028 +:10BEB00040F4804013E04FF40041504602F04AFA4B +:10BEC00018B99BF81100DA46C8B1E089411CE1813C +:10BED000404506D9E681B7F82B0020F48040A7F84A +:10BEE0002B00134822494069884259DA608A411C74 +:10BEF0006182404555D966822878D8B349E0E08907 +:10BF0000411CE1814045ECD9E681287808B9182028 +:10BF1000287004210F4802F026FA01214FF4FA7B21 +:10BF20008AF81110584626E08C2A00207C07002051 +:10BF3000E8160020FFFF47031D05002059020020DE +:10BF4000EE0B0020FC0D00205A020020FF0F78BAF3 +:10BF5000FF6F6200000C01400010014000C05A4514 +:10BF6000740B002000170020FFFFB73CFF5FA20208 +:10BF7000000028410BE001F0A6F904211D4802F061 +:10BF8000F0F98AF81160584601F09DF98EE71D20FE +:10BF90002870B7F82B0040F40050A7F82B0000E001 +:10BFA0006682B9F8B100FCF7D4FB814612488A4694 +:10BFB000808BFCF7CEFB114A114BFCF7B3FA4A46D3 +:10BFC0005346FCF74BFC0DD8A08AA682411C404585 +:10BFD0000AD9287808B91E20287037F82D0F40F0AC +:10BFE00001003880BDE8F09F37F82D0F20F00100E8 +:10BFF000F7E70000000C0140FC0D00209A99999988 +:10C000009999B93F70B50F4900254889401C80B205 +:10C0100048810A2804D34D8102F0F6FA03F024F88F +:10C02000094C0A49E07E81F822006078012808D195 +:10C03000A078012805D16570A57002F0E9FD012006 +:10C04000607170BD9806002050270020481700201E +:10C05000024600200A4200D0012070470349002018 +:10C060000978490700D5012070470000F517002026 +:10C07000034900200978890700D501207047000096 +:10C08000F5170020034600201AB18B4200D0012092 +:10C0900070478B42FBD0704703490020C9780029C4 +:10C0A00000D0012070470000F51700200349002050 +:10C0B0000978C90700D0012070470000F51700205B +:10C0C00001460020012901D0032900D10120704739 +:10C0D0000021022807D0032805D0042803D0062811 +:10C0E00001D00A2800D101210846704710B500F0A0 +:10C0F000F7F818B100210D4806F024FB0B4858381A +:10C10000406D58B109484FF49661001F06F01AFBC4 +:10C11000002802D006490020087010BD0348002105 +:10C12000BDE81040001F06F00DBB0000B00200206B +:10C13000E504002030B53E4B3E48997E2A2903D9BC +:10C1400002780AB9562202702C2903D902780AB95A +:10C15000582202702E2903D902780AB95922027096 +:10C160002F2903D902780AB95A220270302903D93B +:10C1700002780AB95B22027093F83120540707D085 +:10C1800004780CB95C24047002F00702032A07D07B +:10C1900093F8322054070AD005785D2415B102E0E7 +:10C1A000072030BD047002F00705032D06D012F001 +:10C1B000380F0DD005785E242DB105E0017801B966 +:10C1C0000470082030BD0470C2F3C202032A0AD0F2 +:10C1D00093F83620C2F3C204012C09D0520611D5BF +:10C1E000017859B10CE0017801B90470092030BD23 +:10C1F000017809B95F2101700A2030BD602101700A +:10C200000B2030BD93F83520C2F3C202022A04D0BD +:10C2100002290AD2017831B107E0017809B9612118 +:10C2200001700C2030BD62210170002030BD000083 +:10C23000FC0D00207C07002001460020090600D4E8 +:10C2400001207047024600208A4200D10120704739 +:10C2500005490020CA7B897B02EB012189B2502964 +:10C2600000D8012070470000F517002010B54FF4EA +:10C270000071114802F06EF806221049002338B10F +:10C28000CB71087A052811D200F10100087211E083 +:10C290000B72C879052803D200F10100C87109E0CA +:10C2A00008D1CA714FF00100487203E002D10A724E +:10C2B000CB714B72487A10BD00100140E0040020A1 +:10C2C00003484079002801D04FF0FF30704700004C +:10C2D000E00400200148007870470000E0040020DE +:10C2E00010B54FF480710A4802F034F8094C4FF44D +:10C2F00000712073084802F02DF86073217B01293A +:10C3000001D1012802D04FF0FF3010BD002010BD38 +:10C3100000080140E0040020001001403C210148D9 +:10C32000FBF74BBF0017002002490020A1F81900BD +:10C33000704700000017002070B518490020184D04 +:10C3400008600C390446487104EB440000EBC4005B +:10C3500005EB40060C3614213046FBF72EFF142166 +:10C360003046FFF79EFB3075000A641CE4B270751E +:10C37000122CE9D30A494FF4C6740C3122460D46FB +:10C3800001F5C670FBF700FF002322462946054849 +:10C3900001F01AFABDE8704007F0DCBBA4060020EB +:10C3A00008180020EA27002010B59AB0202112A812 +:10C3B000FBF703FF5A208DF8000001208DF80100E3 +:10C3C00082208DF80200344C12208DF80300207872 +:10C3D0008DF80400B4F80900010A8DF805108DF8F5 +:10C3E0000600B4F80B008DF80800010A8DF807105C +:10C3F000B4F80F00010A8DF809108DF80A00B4F89E +:10C400000D008DF80C00010A8DF80B10607C8DF882 +:10C410000D00A08A010A8DF80E108DF80F00E08A39 +:10C42000010A8DF810108DF811001C4890F87C114D +:10C430008DF8121090F87B118DF8131090F881117F +:10C440008DF8141090F882018DF8150016216846B9 +:10C45000FFF708FB9DF80320ADF84400694612A8D9 +:10C46000121DFBF791FEBDF844009DF8031013AABE +:10C47000030A8B54521C8854B4F8190042F210720B +:10C48000904202D2401CA4F8190012A8891D04F0A1 +:10C4900067F81AB010BD0000001700208C2A002099 +:10C4A0002DE9FC5FF84EF7480024316B0278481CF8 +:10C4B0005F2A05D23063C82912D9062034630EE002 +:10C4C000622A05D23063C8290AD90820346306E0FD +:10C4D000632A1DD83063C82902D909203463B0709B +:10C4E000EA49DFF8AC83DFF8AC9331F81B2FA8F8EA +:10C4F0000D204988A8F80F10012188F81110E6488E +:10C5000098F80030B9F87711C288012B03D017E0F2 +:10C5100005203463E3E798F81B30012B10D1B9F8FC +:10C52000795142F210777D43B8F81C0099F89731A1 +:10C53000B5FBF0F080B2012B03D1814200D301465C +:10C54000104602F0BBF90546B078CF4FDFF84CA398 +:10C550003837DFF84CB3401F05287DD2DFE800F004 +:10C56000A4035E5E5E00C8484FF47A71243006F082 +:10C57000E9F8012871D198F81B004246012806D03D +:10C580009620A8F80B00C0480021243089E099F8D3 +:10C590009711012921D0B9F87701F189884201D991 +:10C5A0003231F18189B2A94200D3F581F189884203 +:10C5B00000D8F081D08B642819D2B2F80B004FF468 +:10C5C0009671884202D23230A2F80B00B2F80B000A +:10C5D0008842D8D9A2F80B10D5E7F089A84201D239 +:10C5E0003230F08180B2A842E4D3F581E2E73879B5 +:10C5F000012804D13888F189884200D2F081B2F84C +:10C600000B10F089814202D23231A2F80B10B2F83D +:10C610000B108142B7D3A2F80B00B4E79A484FF44D +:10C620007A71283006F08EF8012862D199F89711B6 +:10C63000012915D0B9F87701F189884201D9323141 +:10C64000F18189B2A94200D3F581F189884200D8ED +:10C65000F0813879012801E049E047E00AD00EE096 +:10C66000F089A84201D23230F08180B2A842F0D3E2 +:10C67000F581EEE73888F189884200D2F081B8F878 +:10C680000B10F0894246814202D23231A2F80B10DF +:10C69000B2F80B10814201D3A2F80B007A480021B6 +:10C6A000283006F04FF824E06420F081022088F85A +:10C6B000000099F89701012820D1774FF888FCF7FE +:10C6C00048F852465B46FBF72DFF02460B4600201A +:10C6D0007449FCF7C3F80CD8F888FCF73AF85246CE +:10C6E0005B46FBF71FFFFCF78DF8F08101E00920A6 +:10C6F000B07099F897014946012816D0B9F875012C +:10C70000B081A8F80900B9F8791142F210725143CA +:10C71000B1FBF0F2F3899A4202D8B1FBF0F0F0815C +:10C72000F089A84200D3F58179E15B4840F2A36328 +:10C73000808FA0F2F5129A4225D2574A92F83930EA +:10C74000022B03D098F81B70012F01D01E300AE095 +:10C75000B8F81E30C82BF9D992F80A21002AF5D171 +:10C76000514A9630147080B2A8F80900FA3080B2AD +:10C77000A8F80100B081B1F87D114246884209D283 +:10C78000A2F8011006E0B1F87D01B081B9F8751189 +:10C79000A8F80910FFF7CEFC10F0FF0756D04FF4B1 +:10C7A000C871072F2FD0082F2DD0092F2BD00A2F7B +:10C7B00029D00B2F27D00C2F25D0042F47D0052FA1 +:10C7C00045D0354AD08800EB8003B1EB430F72D2DD +:10C7D000FBF7BFFF52465B46FBF7A4FECDE9000125 +:10C7E000F089FBF7B6FFDDE90023FCF737F866D8E0 +:10C7F0002948C088FBF7ADFF52465B46FBF792FE27 +:10C80000FCF700F85AE0244AD08888421AD9FBF78E +:10C81000A0FF52465B46FBF785FE07460091F08974 +:10C82000FBF797FF3A46009BFCF718F851D81A48D7 +:10C83000C088FBF78EFF52465B46FBF773FEFBF7A3 +:10C84000E1FF02E0F189884243D8F08141E0124AD9 +:10C85000D08888422FD9FBF77CFF144A144BFBF792 +:10C8600061FECDE90001F089FBF773FFDDE90023EC +:10C87000FBF7F4FF23D80848C088FBF76AFF0B4A90 +:10C880000B4BBBE75802002018050020740B00205A +:10C89000001700208C2A0020FC0D00209A999999FD +:10C8A0009999E93F000059405C020020CDCCCCCCE6 +:10C8B000CCCCEC3FFFE7F189884200D8F081062F0D +:10C8C00007D1F089C82801D9C820F081D8490220B1 +:10C8D0000870D84F97F8390002281ED0F888C82869 +:10C8E0006CD9D549C97A5F294DD2FBF732FF4FF099 +:10C8F0006632D24BFBF716FE00900D46F089FBF72F +:10C9000028FF2B46009AFBF7A9FF78D8F888FBF799 +:10C9100020FF4FF06632C94B4AE098F800004546C8 +:10C9200001286CD1E87E012869D1B5F80900A98BEE +:10C93000884226D9401AB0F5967FF88806DD9628F9 +:10C9400010D2FBF706FF0022BD4B06E0962809D265 +:10C95000FBF7FFFE4FF03332BA4BFBF7E3FDFBF77B +:10C9600051FFF081B5F80B10F089814202D21E31DF +:10C97000A5F80B10B5F80B10814240D9A5F80B00B3 +:10C980003DE0F888E4E7FBF7E4FE52465B46FBF740 +:10C99000C9FD05460091F089FBF7DBFE2A46009BA6 +:10C9A000FBF75CFF2BD8F888FBF7D3FE52465B46BB +:10C9B000FBF7B8FDFBF726FFF08120E0B98F32319D +:10C9C000B181FBF7C6FE52465B46FBF7ABFDCDE9F6 +:10C9D0000001F089FBF7BDFEDDE90023FBF73EFF18 +:10C9E00009D8F888FBF7B5FE52465B46FBF79AFD7F +:10C9F000FBF708FFF081F089A84200D3F581F888A1 +:10CA000068B9B078062805D0072803D0092801D0D6 +:10CA1000082804D18C48017809B937210170307990 +:10CA20003546012828D0EC62464698F8291016F8B9 +:10CA3000280F01F03FFF4F4699F87B1199F87C01D0 +:10CA400001F038FF16F8282997F87C01283A411F91 +:10CA50008A4208DA96F8293097F87B11283BA1F131 +:10CA6000050C634525DB686B411C696364282DD97F +:10CA700001206C63687129E0E86A6C63401CE8621D +:10CA80001428D1D91421B0FBF1F201FB12000128C6 +:10CA9000CAD1E8894FF4AF71884203D84FF4967138 +:10CAA000884201D9E981BFE7C828BDD9C820E881FB +:10CAB000BAE7C91F8B4209DAC01F824206DA686BE7 +:10CAC000411C6963642801D96C716C6397F8970104 +:10CAD00040F6C4180128687902D0012879D095E081 +:10CAE00001281CD1B7F87701FBF733FE574A5B46A4 +:10CAF000FBF718FD81468A46E889FBF72AFE4A467D +:10CB00005346FBF7ABFE0AD2B7F87701FBF721FEDD +:10CB10004E4A5B46FBF706FDFBF774FEE88145488D +:10CB200040F2BB22818FA1F2097191426ED290F83E +:10CB30000A0101286AD13076E8894FF416718842DB +:10CB400000D9E981AA894046824200D9A881B6F875 +:10CB50000920824201D9A6F80900B6F80B008842E4 +:10CB600001D9A6F80B10BDE8FC9FB7F87F01E98951 +:10CB7000884200D2E881B7F87D01A98988424DD367 +:10CB8000B6F809104046814201D9A6F80900A989E2 +:10CB9000814245D8B6F80910A889814201D9A6F882 +:10CBA0000900B6F80B104FF47A7081423AD8E9893F +:10CBB000814200D9E881B6F80B10E889814234D867 +:10CBC000B6F80B003228CED23220A6F80B00CAE706 +:10CBD000FFE7B7F87701FBF7BCFD1C4A5B46FBF7A4 +:10CBE000A1FC81468A46E889FBF7B3FD4A465346D5 +:10CBF000FBF734FE0AD2B7F87701FBF7AAFD134A18 +:10CC00005B46FBF78FFCFBF7FDFDE8813476B7F858 +:10CC10007701E9898842A8D2E881A6E7A881AFE731 +:10CC2000A881B7E7A6F80B00C1E7A6F80B00C7E795 +:10CC300082070020FC0D0020EE0B00206666EE3F10 +:10CC40000000F83F3333F33F7C0700209A9999990D +:10CC50002DE9F05FDE4CDF4F4FF00508E08C00253A +:10CC600098B1788B411C79834FF4FA7188420DD9C1 +:10CC7000D9483D7002780AB9142202707983F87895 +:10CC8000012803D087F8038000E07D83D348B0F803 +:10CC90002B0010F0600F03D1410701D4800403D5AD +:10CCA0003D7087F8038010E0F878022801D004284E +:10CCB0000BD1397819B9012801D087F803800CF01D +:10CCC00079FA10B9C64902200870C648C64990F8DA +:10CCD0000A0101281ED0B1F87D01A4F8010040F23C +:10CCE0001A40A4F80500B1F87901A4F80700F87813 +:10CCF000BE4E8B46012810D0DFF8F4A24FF0010998 +:10CD0000022827D0042870D005286FD1F88A01287E +:10CD10006DD026E140F6C410DFE73D827D8202201F +:10CD20002070FD713D72BD71397801295ED1F870B6 +:10CD30002021B04801F015FB0221304601F011FB23 +:10CD40000121304601F00DFBBDE8F05F4FF4FA70B1 +:10CD500000F0B9BAFD82388A782801D2401C3882A6 +:10CD600080B208281CD2397A21B1052840D0062883 +:10CD700013D072E020219F4801F0F3FA02213046DF +:10CD800001F0F1FA0121304601F0EDFA4FF4FA70AA +:10CD900000F099FA87F808905FE003F0F5FC5CE09A +:10CDA0000F282DD2B97969B10321B0FBF1F201FB53 +:10CDB000120101291CD0B0FBF8F108FB1100012879 +:10CDC00019D04AE020218B4801F0CDFA02213046EB +:10CDD00001F0C9FA0121304601F0C5FA4FF4FA70AA +:10CDE00000F071FA87F8069037E06CE069E0A2E0A5 +:10CDF00003F0BCFF31E003F0C7FC0AF0B9F82CE007 +:10CE00007D63218C40F2DB52A1F2D171914222D29A +:10CE1000B0F5966F01D2401C388280B2B0FBF8F1B9 +:10CE200008FB1101012904D000F00700012803D0FC +:10CE300004E003F09BFF01E003F0A6FC388A14280D +:10CE400001D984F80090E17E012927D0B0F57A7FDE +:10CE500001D987F80380FFF7A7FA674840F27753B4 +:10CE600030F81B1FA4F80D104088A4F80F005D488F +:10CE70006421808FA0F221329A4212D2A4F80900D4 +:10CE800000F5967080B2A4F80100A4F80B10BBF86E +:10CE90007D1188420FD2A4F801100CE00420F87034 +:10CEA000D9E7BBF87501A4F80900A4F80B1040F607 +:10CEB000C410A4F80100BAF80010A182BAF8020068 +:10CEC000E082BDE8F09FB88A401CB8824B480078E9 +:10CED000012813D0BAF80010A182BAF80200E0824B +:10CEE00084F800900BF014FCFFF7DAFAB88AB0FB74 +:10CEF000F8F108FB1100012808D009E0404840681B +:10CF0000FBF74DFCA082BAF80200E8E7FFF74CFA05 +:10CF1000B88A0B21B0FBF1F201FB1200012801D10C +:10CF200007F0C0FA387D00F00F000128C9D1BDE834 +:10CF3000F05F03F01BBF02202070B879012810D1E8 +:10CF400020212C4801F00DFA0221304601F009FAA7 +:10CF50000121304601F005FA4FF4FA7000F0B3F900 +:10CF6000BD71788A642801D2401C788280B2022880 +:10CF700001D90221217028281FD9B879012810D1A0 +:10CF800020211C4801F0EDF90221304601F0E9F9B9 +:10CF90000121304601F0E5F94FF4FA7000F093F901 +:10CFA000BD71FFF7BBF93D827D820421304601F05F +:10CFB000D8F98AF8115087F80390BBF8750124F866 +:10CFC000090F32206080BDE8F05FFFF7EDB9000087 +:10CFD00000170020180500207C0700203A2A0020B6 +:10CFE00082070020FC0D00208C2A0020000C01404C +:10CFF000EE0B002000100140740B00208007002081 +:10D00000E81600202DE9F84F6946164800F0CEFBDF +:10D01000154DDFF85890DFF858A0DFF858B000241D +:10D0200039F8140001F078FAFF2814D03AF810000B +:10D03000009900EB050810483BF8147030F8140014 +:10D04000461839463046FEF723FD20B93A463146A8 +:10D050004046FBF799F8641CE4B20C2CE0D3BDE821 +:10D06000F88F0000A42700204817002044BA0108C8 +:10D07000E4B9010874BA01085CBA01080029016822 +:10D0800002D041F0010102E04FF6FE721140016052 +:10D090007047000001684FF6FE72114001600021E8 +:10D0A000016041608160C1603149314A0839904274 +:10D0B00003D1486840F00F0006E02D4A1432904238 +:10D0C00004D1486840F0F00048607047284A283290 +:10D0D000904203D1486840F47060F5E7244A3C323E +:10D0E000904203D1486840F47040EDE7204A503246 +:10D0F000904203D1486840F47020E5E71C4A64324E +:10D10000904203D1486840F47000DDE7184A783255 +:10D11000904203D1486840F07060D5E7154A111F6E +:10D12000904203D1086840F00F0006E0114A143223 +:10D13000904204D1086840F0F000086070470D4A42 +:10D140002832904203D1086840F47060F5E7094A3C +:10D150003C32904203D1086840F47040EDE7054A44 +:10D1600050329042EAD1086840F47020E5E70000B0 +:10D17000080002400804024030B5026847F6F07328 +:10D180009A430C6A8B682343D1E904452C4323431B +:10D190008C692343CC6923434C6A23438C6A234321 +:10D1A00013430360CA6842600A6882604968C160CC +:10D1B00030BD000070B50C46050033D08CB36888D4 +:10D1C000A52121705A2161701930A070000AE07009 +:10D1D00020202071601D10221349FAF7D5FF6879CD +:10D1E0006075B5F805001726000AA0756A88022A3E +:10D1F00007D304F11700E91DFAF7C6FFA878173026 +:10D20000C6B231462046FDF721FAA055761CF1B290 +:10D21000000A6054491CC9B22046FDF7FDFB0120FD +:10D2200070BDFFE70020FBE78C2A0020F8B56946B7 +:10D230001F4800F0BBFA16261E4F002505EB4500DF +:10D2400000EBC5040098B11E00EB4400FEF720FC83 +:10D2500088B90098324600EB440107EB44000C30DB +:10D26000FAF792FF0098324600EB4401124800EBB7 +:10D270004400FAF789FF07EB4400007B092805D139 +:10D280000E480122AA400168114301606D1CEDB2F5 +:10D29000122DD3D309494FF0FF30091DA1F10B0224 +:10D2A00008600749A1F5467003F052FEF8BD000082 +:10D2B000EA27002008180020A0190020A40600205A +:10D2C0002C1B0020704710B5044606E0142007F020 +:10D2D000E5F901F09FFE641EA4B2002CF6D110BD4A +:10D2E00070B5044601F02CF90546FF2820D02046F1 +:10D2F00001F012F9FF281BD00E49104A0C5C0E49B0 +:10D3000032F81000461821463046FEF7CAFB305569 +:10D31000621C000AB0540A480A49A21C30F81500E1 +:10D32000401805D03146BDE87040002300F04CBAEB +:10D3300070BD00000ABA010848170020E4B90108CE +:10D340005CBA0108A42700202DE9F04399468046E5 +:10D35000DDE9074300250120012A01D0FF2A49D138 +:10D360001E784FF0590C771C1F7004F806C01E7809 +:10D37000771C1F7004F80680224E21F07F4756F874 +:10D3800025C0674538D11E780F0C06F1010C83F8D3 +:10D3900000C0A7551E780F0A06F1010C83F800C0E3 +:10D3A000A7551E780020771C1F70A15505EB45017D +:10D3B00001EBC505197819F815704E1C1E706754DD +:10D3C000012A01D0FF2A15D1197801264A1C1A70AA +:10D3D000665409EB45011A784E7C551C1D70A65405 +:10D3E0001A788E7C551C1D70A654CD7C19784A1C69 +:10D3F0001A706554BDE8F0836D1CEDB2122DBED3DA +:10D40000F8E700009CB901082DE9F8411C46002608 +:10D4100088468DF80060217815464A1C59232270F1 +:10D420006B5421781A4F4A1C227068546A46394658 +:10D43000404603F08DFD24E037F816002278010AFB +:10D44000144802F1010C50F8210084F800C0030CCC +:10D45000AB542278030A02F1010C84F800C0AB54EB +:10D460002278531C2370A85401EB410000EBC1014A +:10D4700008EB410042782078411C2170761C2A5428 +:10D48000F6B29DF800008642D6D30020BDE8F881B0 +:10D490002C1B00209CB901082DE9F0434FF05908DE +:10D4A000DDE90764002527784FF0010907F1010C39 +:10D4B00084F800C006F80780277807F1010C84F88B +:10D4C00000C0F055234821F07F4750F825C067453C +:10D4D00039D120780F0C00F1010C84F800C03754CA +:10D4E00020780F0A00F1010C84F800C0375420782E +:10D4F000471C2770315405EB450000EBC50120782F +:10D5000013F81170451C257003EB4101375448781E +:10D51000904201D0FF2A1AD1487C4FF00009B0B1E7 +:10D5200020780123421C2270335420780623421CA9 +:10D53000227033542078891C304403F0C1FC2178D8 +:10D540000844207003E06D1CEDB2122DBDD3484697 +:10D55000BDE8F0839CB9010810B5FEF77FFD0028F7 +:10D5600074D1FEF785FD002870D1FEF79FFD614B59 +:10D5700000286CD0604C03F10C022078C1061168C1 +:10D5800002D541F0020101E021F0020111608106A3 +:10D59000116802D541F0040101E021F0040111609D +:10D5A0004106116802D541F0080101E021F00801AF +:10D5B0001160000602D541F0100001E021F01000DA +:10D5C00010606078C107116802D041F0200101E0CD +:10D5D00021F0200111608107116802D541F040015E +:10D5E00001E021F0400111604107116802D541F0CE +:10D5F000800101E021F0800111600107116802D56E +:10D6000041F4807101E021F480711160C10611685C +:10D6100002D541F4007101E021F40071116081062E +:10D62000116802D541F4806101E021F4806111604C +:10D630004106116802D541F4006101E021F4006166 +:10D640001160000604D541F4805003E03EE04EE056 +:10D6500021F480501060A078C107116802D041F415 +:10D66000005101E021F4005111608107116802D5D9 +:10D6700041F4804101E021F48041116041071168CB +:10D6800002D541F4004101E021F40041116000079E +:10D6900002D541F4803001E021F480301060FEF7C3 +:10D6A000FBFCA0B1E078082803D3106840F001002B +:10D6B0001060FEF7F1FC002808D15878002150B125 +:10D6C000401E10F0FF00587000D1198110BD106885 +:10D6D00020F00100ECE71889401C80B21881B0F5F9 +:10D6E000967FF3D9106840F400301060EDE73220E7 +:10D6F000587010BD98060020F517002070B50D4633 +:10D7000000EB4001104A01EBC00102EB41040D4E59 +:10D710000C34122815D22078A84211D0092D0DD131 +:10D72000204603F00DFC607818B93078401C30704A +:10D730006070607CFF2801D0401C60740020E074A1 +:10D74000257070BD9D06002008180020154810B5F2 +:10D75000154A0178937801F00100984221D0907029 +:10D76000C8071ED000210F4C0B46133401EB4100BB +:10D7700000EBC10004EB400010F80C2F082A0CD17C +:10D78000C27C521CD2B2C274282A06D3C37403705E +:10D79000827CFF2A01D0521C8274491CC9B2122912 +:10D7A000E4D310BDF517002098060020054A8242F8 +:10D7B00002D0463A824202D101200A60704700201E +:10D7C00070470000EA27002010B50DF06FFC012023 +:10D7D00010BD2DE9FE4F4FF017088DF80880012588 +:10D7E0008DF8095003268DF80A6004468DF80B0069 +:10D7F00002A801F06FFE0921022000F01DFD0027A4 +:10D800008DF804704FF00C094FF4007A8DF80590F4 +:10D81000CDF800A08DF80640684600F0BBF85046F1 +:10D8200000F0A8F88DF808808DF809508DF80A608E +:10D830008DF80B4002A801F04DFE0821002000F0F9 +:10D84000FBFC8DF804704FF480788DF80590CDF8CE +:10D8500000808DF80640684600F09CF8404600F0D5 +:10D8600089F828208DF808008DF809508DF80A6095 +:10D870008DF80B4002A801F02DFE0D21022000F0D2 +:10D88000DBFC8DF8047008208DF805006D03009511 +:10D890008DF80640684600F07DF8284600F06AF8EA +:10D8A000202000F067F8402000F064F8802000F0AD +:10D8B00061F8404600F05EF8504600F05BF8E81072 +:10D8C00000F058F8A81000F055F8681000F052F871 +:10D8D000284600F04FF8680000F04CF8A80000F06F +:10D8E00049F8BDE8FE8F000010B54FF40054204603 +:10D8F00000F046F80F4908B1032000E0012008704D +:10D900004FF4806000F036F84FF4006000F032F819 +:10D910004FF4805000F02EF8204600F02BF84FF422 +:10D92000804000F027F8BDE810404FF4004000F0C0 +:10D9300021B80000E0040020082000F01BB81020EF +:10D9400000F018B810B5202000F014F8402000F0C6 +:10D9500011F8802000F00EF84FF4807000F00AF803 +:10D960004FF4007000F006F801490120087010BD66 +:10D97000E0040020014908607047000014040140E1 +:10D98000034A0146002012680A4200D00120704775 +:10D990001404014030B51A4A8379016853B31368FF +:10D9A0008B431360111D0B680468A3430B6001795E +:10D9B00011440B68046823430B60114B083319684A +:10D9C0000468A14319601C1D21680568A9432160F2 +:10D9D0004179102905D011440A68006802430A60A1 +:10D9E00030BD19680268114319602168006801435D +:10D9F000216030BD0079104402688A43026030BD66 +:10DA00000004014001F006FB0120FFF7E2FE33A015 +:10DA100006F08CFE0A20FFF756FC01F0FBFA02F03C +:10DA2000B7FD012002F044FF6FF0FF0002F034FE6A +:10DA300001F0F0FAFBF758FA0121084600F058FB14 +:10DA400003F000FF4FF40041080301F08FFD03F0E5 +:10DA5000C9FE01F03BFD01F0E9FA01F0DBFA4FF4F9 +:10DA6000E1300DF075FA244C2078022802D001280C +:10DA700002D01AE021A000E028A006F057FE20788E +:10DA8000022802D0012802D00FE02BA000E023A042 +:10DA900006F04CFE2078022802D0012802D004E0D3 +:10DAA0002DA000E01DA006F041FE2078032802D141 +:10DAB00030A006F03BFE216920780870C043487012 +:10DAC00001F0A8FABFF34F8F31480168314A01F4E1 +:10DAD000E06111430160BFF34F8FFEE7456E74654F +:10DAE00072536C656570303030303050726F6365E2 +:10DAF00073730D0A00000000E00400205274635F9D +:10DB000077616B652D30302D2D5274635F77616BBB +:10DB1000652121212121210D0A000000494F207794 +:10DB2000616B652D2D2D494F2077616B652121217A +:10DB30002121210D0A0000005274635F77616B653B +:10DB40002D31312D2D5274635F77616B6521212159 +:10DB50002121210D0A0000005274635F77616B651B +:10DB60002D2D2D5274635F77616B65212121212159 +:10DB7000210D0A0043414E2077616B652D2D2D4309 +:10DB8000414E2077616B652121212121210D0A0061 +:10DB90000CED00E00400FA052DE9F047DFF8E49011 +:10DBA0000025484640F25241C0E9001589F8085066 +:10DBB00089F80950082109F5207089F80A1040F801 +:10DBC0003A5F09F5E874456014F8EA0FDFF8B880A9 +:10DBD00020F0FF072770D8F80C00FAF7E0FDC6B276 +:10DBE0002671D8F81000FAF7DAFDC1B22748617142 +:10DBF000EA3C4078042832D0B4F8EB006FF30C0014 +:10DC0000A4F8EB0094F8EC0000F03F00A4F8EC005E +:10DC100034F8EB0F2A46B4F80130C00240EA931002 +:10DC200067F30702030C63F30F22030A63F317423F +:10DC300060F31F622B4666F307036571484661F384 +:10DC40000F23A57165F3174340F80B2F65F31F638E +:10DC500043600C4809F02AF90120BDE8F087094823 +:10DC6000B838B0F81B20B4F8EB0062F30C00A4F84D +:10DC7000EB0004483E38B0F80720B4F8EC0062F33B +:10DC80008F10C3E72C0C0020E8160020580200205B +:10DC90002DE9F041414C002040F25141E4E80210EE +:10DCA0003F4D04F8010B082104F8010B04F8011B97 +:10DCB00045F8320F39496860B839394811F8233FBF +:10DCC000B0389F0910F8E22F63F3010202704A781E +:10DCD000467862F3010667F383061F0967F30516AA +:10DCE0009B0863F3871646708B788678970963F3F1 +:10DCF000010667F38306170967F30516920862F3B6 +:10DD0000871686709A08C37862F38713CA7862F31D +:10DD10000513920862F383030A7A62F30103C37066 +:10DD20008A7A0679930863F301064B7A62F38306D5 +:10DD30009F0867F3051663F387160671CB7A467959 +:10DD4000120963F3051662F387160A7962F38306F4 +:10DD5000930863F3010662F3830663F301064671D9 +:10DD60004A79837962F38713920862F305138A79FB +:10DD700062F38303920862F301038371C979C27964 +:10DD800061F38712C2712868696820606160034886 +:10DD900009F08CF80120BDE8F08100002C0C002077 +:10DDA000AC0E00202DE9F041294A002140F25340F9 +:10DDB000C2E90001117251720820907202F52070C0 +:10DDC000012440F8421F416002F5E870A0F5227579 +:10DDD00090F8D830B4EB131F03D00524B4EB131F15 +:10DDE00003D16982A982E98229836B8A20F8F23FF4 +:10DDF000AC8A4480EE8AC6F57A67868867F30B069C +:10DE000086802D8BC5F57A67C58867F30B05C580BD +:10DE10001F0A084667F3070063F30F20230A63F322 +:10DE2000174064F31F6033011C0A64F3070163F3B6 +:10DE30000F212B011C0A64F3174142F80B0F63F307 +:10DE40001F615160024809F031F80120BDE8F081FE +:10DE50002C0C002070B5384A002140F25440C2E931 +:10DE60000001117251720820907202F52070012594 +:10DE700040F84A1F416002F5E870A0F20E2490F8C5 +:10DE8000D830B5EB131F03D00525B5EB131F03D115 +:10DE9000A4F80510A4F8071034F8053FA0F8FA30EC +:10DEA0006488B0F8FC50C4F57A6464F30B05A0F8FC +:10DEB000FC5090F8FD40204D24F0F004B83D80F86F +:10DEC000FD40AC7EAA2C90F8FE4024F0030400D163 +:10DED000641C80F8FE4004F0C30400F8FE4FB5F85F +:10DEE0001F5030F802491E0A65F38F140D4666F381 +:10DEF0000705448063F30F2503881B011E0A66F3A0 +:10DF0000174563F31F65837801719B0343EA9413FC +:10DF10001E0A0C4666F3070463F30F24542343716F +:10DF200061F3174442F80B5F63F31F6454600248C7 +:10DF300008F0BCFF012070BD2C0C00200149C86016 +:10DF4000704700000020024070B505464FF43026AF +:10DF5000304600F081F8042811D1094C206940F0C6 +:10DF6000020020616561206940F040002061304678 +:10DF700000F072F8216941F6FD721140216170BD17 +:10DF80000020024008490420CA68D20701D00120BD +:10DF90007047CA68520701D502207047C968C90690 +:10DFA000FBD50320704700000020024002480169B1 +:10DFB00041F080010161704700200240F0B5064643 +:10DFC0004FF400570D46384600F046F804280CD1AF +:10DFD000064C206940F0010020613580384600F091 +:10DFE0003BF82169BA1E11402161F0BD00200240BA +:10DFF0002DE9F841064600204FF4005700900D46E9 +:10E00000384600F029F8042816D10C4C206940F05D +:10E01000010020613580B846384600F01DF8BF1E6B +:10E02000042806D1B61C280C00963080404600F02B +:10E0300013F8216939402161BDE8F88100200240D0 +:10E040000348024941600349416070472301674525 +:10E0500000200240AB89EFCD00B50346FFF792FFE9 +:10E0600002E0FFF78FFF5B1E012803D0002B00D1D9 +:10E07000052000BD002BF4D1FAE700002DE9F047A0 +:10E0800081461A48184C0025C088401E86B204EB11 +:10E09000C60041684846FAF715FC04D34846616853 +:10E0A000FAF71AFC1AD240F6FF70BDE8F087A819FB +:10E0B000440808EBC40748467968FAF70DFC02D219 +:10E0C000641EA6B20BE048467968FAF7FBFB02D261 +:10E0D000641CA5B203E038F93400E6E7A046B54277 +:10E0E000E5D938F93500E0E758B20108F40400201A +:10E0F00030B51E4B1A6822F0030202431A601C4B13 +:10E10000186840F0040018604FF0E0200469194AD4 +:10E110001460D0F800415460D0F804419460D0F805 +:10E120000841D4600469144D2C400461134CC0F8BC +:10E130008041134CC0F884414417C0F8884101293C +:10E1400012D040BF20BF20BF116801615168C0F8E4 +:10E1500000119168C0F80411D168C0F8081118685E +:10E1600020F00400186030BD30BFEDE700700040C3 +:10E1700010ED00E01C0B0020040001003DF87FFFC3 +:10E18000FFF8FFBF254910B5884206D101210420C0 +:10E1900002F012F9002104203BE02149884206D117 +:10E1A0000121082002F008F90021082031E01D4972 +:10E1B000884206D10121102002F0FEF80021102033 +:10E1C00027E01949884206D10121202002F0F4F805 +:10E1D000002120201DE01549884206D10121402060 +:10E1E00002F0EAF80021402013E01149884206D1EC +:10E1F0000121802002F0E0F80021802009E00D4993 +:10E2000088420AD184150121204602F0D5F8002168 +:10E210002046BDE8104002F0CFB810BD0008014014 +:10E22000000C0140001001400014014000180140A2 +:10E23000001C01400020014010B58A0721F00304B2 +:10E240000649120F21440F238C6893409C438C6035 +:10E250008B68904003438B6010BD000000000140BC +:10E26000F0B5CC78002204F00F03E40601D58C78D9 +:10E2700023430C784FF00F0C14F0FF0F4FF0010EFA +:10E280001BD005680E880EFA02F42640A64210D173 +:10E2900096000CFA06F725EA070703FA06F5CE788A +:10E2A0003D43282E02D0482E02D002E0446100E017 +:10E2B0000461521C082AE5D305600A88FF2A1CD98C +:10E2C0004468002202F108060EFA06F50E882E4078 +:10E2D000AE420ED196000CFA06F7BC4303FA06F7DD +:10E2E000CE783C43282E00D14561CE78482E00D10F +:10E2F0000561521C082AE5D34460F0BDF0B5144C0A +:10E30000002801DAE36900E06368450D2E0185B25B +:10E31000C0F30157B540C0F30342032F05D0C60236 +:10E320000AD503269640B34307E023F07062636882 +:10E3300023F07063636002E0AB4343F0706201B1AD +:10E340002A43002801DAE261F0BD6260F0BD0000FE +:10E35000000001400246002092680A4200D00120DD +:10E3600070474161704701617047F8B5010A8DF847 +:10E3700000108DF801004FF6FE7000226F4648F243 +:10E38000084648F22504451CB95C80EA01200021BA +:10E39000030408D5030602D586EA400001E084EABA +:10E3A000400080B201E005EA4000491CC9B20829DA +:10E3B000EED3521CD2B2022AE6D3F8BD10B5044601 +:10E3C00005F0AEFB68432070000C6070002010BDAB +:10E3D000FEB500260D468DF808608F1E53782C4937 +:10E3E0000446092F51D2DFE807F0052329503C509D +:10E3F000505005002A4602A900F0B6F880BB8DF8FF +:10E400000860592020709DF808000921401CC0B206 +:10E410008DF8080025549DF80800401CC0B28DF806 +:10E42000080021549DF80800401C8DF808002CE0DD +:10E43000024602AB2846FEF7E7FF26E063F31740EB +:10E44000937863F30F20D378127963F3070002AB5C +:10E45000CDE900430B4601462846FFF71DF811E0C1 +:10E4600013E063F31740937863F30F20D3781279A6 +:10E4700063F3070002ABCDE900430B460146284693 +:10E48000FEF762FF08B18DF808609DF80800FEBD38 +:10E490001418002070B5034615480324154E90F853 +:10E4A0002A1090F82900144A01EB0020622180B262 +:10E4B0001970010A59709870002132F81150854284 +:10E4C00003D0491CC9B21329F7D313290ED0022C4B +:10E4D0000AD00A48455C0A482A4630F811008119DA +:10E4E0001819F9F751FE2C44204670BD0224FBE7B1 +:10E4F00050270020481700201EBA01080ABA010858 +:10E50000E4B90108034800880249091F098841EA63 +:10E5100000407047BC6C004010B50146FF23074A1D +:10E52000002032F810408C4201D1034603E0401C29 +:10E53000C0B21328F5D3184610BD00001EBA01085A +:10E5400010B50146FF23074A002032F810408C42E4 +:10E5500001D1034603E0401CC0B20C28F5D3184695 +:10E5600010BD000044BA01082DE9F043DFF88C80AB +:10E5700000265924A8F80A600470427009248946CC +:10E5800084703146032401EB410505EBC10508EB1E +:10E5900045073D7B1D4203D19D4201D00A2A24D16B +:10E5A000174D2D68CD40ED071FD0B8F80A50012651 +:10E5B0006D1CA8F80A50134D55F821C04FEA1C4CA9 +:10E5C00000F804C0641C35F821C0E4B24FEA1C2CEA +:10E5D00000F804C0641CE4B215F821500555641C11 +:10E5E000E4B23D7B0555641CE4B2491CC9B2122952 +:10E5F000C9D389F800403046BDE8F08308180020F0 +:10E60000A80600209CB901082DE9F041314E307870 +:10E6100018B1401E3070BDE8F081FEF79DFF2E4816 +:10E6200090F825000028F6D1FFF790F829482B4FE5 +:10E630000C300024056825FA04F0C00701D0092138 +:10E6400008E004EB440000EBC40007EB4000007B53 +:10E6500020F001012046FFF751F8641CE4B2122CAF +:10E66000E9D3F078162500EB400101EBC00007EB81 +:10E6700040041B4F14F80C1F17F81020914205D1CD +:10E6800007EB4000E17CC07C81421AD01421204677 +:10E69000FDF707FA2075000A6075F078227800EB24 +:10E6A000400101EBC001002307F8112007EB4101F5 +:10E6B000E27CCA740B492A4605FB00102146FFF78D +:10E6C00083F8F078401CC0B2F0701228A3D3002069 +:10E6D000F070A0E7980600205027002008180020BE +:10E6E000A0190020EA27002000210D4B0CE08242F7 +:10E6F00006D101EB410000EBC10003EB00107047B5 +:10E70000491CC9B2022908D201EB410202EBC10245 +:10E7100003EB02121278FF2AE9D1002070470000B3 +:10E72000C01100202DE9F0470026DFF80C81DFF84A +:10E730000C91DFF80CA1434D4FF400474FF6FF74E6 +:10E74000012804D0022817D0032854D070E0EB2110 +:10E7500082200AF08DF9A0F500416881B94202D209 +:10E76000201A688102E0A04200D36E816889F9F71F +:10E77000F0FF42464B4652E0E321B2200AF078F91E +:10E780006881B84204D30121E980201A688100E041 +:10E79000EE8080B2F9F7DDFF42464B46F9F7C2FE44 +:10E7A00000225346F9F730FFFAF770F8FAF743F80A +:10E7B0004FF03332244BF9F7B5FE244A244BF9F7D6 +:10E7C00023FFFAF763F8A861E888012830D11D48D3 +:10E7D0004FF4FA61143003F0B5FF012807D11DA0F2 +:10E7E00005F0A4FF17480021143003F0ABFFA8691F +:10E7F00080F000401BE0E321B4200AF039F9A0F5D5 +:10E8000000416881B94202D2201A688102E0A04228 +:10E8100000D36E816889F9F79CFF4246164BF9F7E1 +:10E8200081FE00225346F9F7EFFEFAF72FF8A861B0 +:10E83000A869BDE8F0870000FCA9F1D24D62204034 +:10E84000E0FFEF407C060020F308CA40F6285C8F0A +:10E85000C2F513404E6567617469766520766F6C0A +:10E86000746167652073616D706C65206661756C9D +:10E8700074210D0A000000004D6210400A48006833 +:10E880000A49094A121F086012684A60064A083A93 +:10E8900012688A60401C06D10548026D0A60426D0C +:10E8A0004A60406E88607047F0F7FF1F3C170020F9 +:10E8B0000000F81F884200D208467047884200D9FD +:10E8C0000846704770B5384E7088401C80B2708022 +:10E8D0000A2861D3354C00257580E08F4FF4FA711A +:10E8E000884221D2401C80B2E08788421CD1257228 +:10E8F000E07E032801D0022816D1A5760120E0761B +:10E9000084F82050A571E58784F82250274884F8C0 +:10E91000235084F825503438E5730179012901D159 +:10E92000C582057100F074FB94F82210204800297C +:10E93000017802D021F0030101E041F003010170F0 +:10E9400094F823100029017802D021F00C0101E095 +:10E9500041F00C0101703188491C89B23180642971 +:10E960001AD3358094F8271079B1491E11F0FF01B0 +:10E9700084F8271009D1E178012906D1E57094F8CF +:10E98000261011B1491E84F82610217A0029017839 +:10E9900003D021F01001017070BD41F01001017031 +:10E9A000BDE8704000F034BB100700205027002065 +:10E9B0009E06002000F00F00092801D9373070476B +:10E9C000303070470009092801D93730704730309E +:10E9D000704700002DE9F041264D00242879C0B190 +:10E9E000012814D12C712449286AF9F778FC6FF0BA +:10E9F00081410844214A224990422CD22889421C54 +:10EA00002A81142802D92C81062048706C81BDE827 +:10EA1000F08118486F798669142F0AD21948008945 +:10EA2000F9F781FE3146F9F702FC7F1CA8616F718E +:10EA3000EDE715493046F9F784FC6FF00B01F9F763 +:10EA4000BEFC1249F9F74BFCC5E90740AC616C719B +:10EA500001202871DBE76889421C6A81142806D9E5 +:10EA60006C81D1F80700642801DD0C2048702C81EE +:10EA7000CDE70000F404002000003041FFFF8F00CC +:10EA80003A2A0020DC1600200000A041CDCC4C40EA +:10EA900070477047074A30B45170064B0022083364 +:10EAA00003E0845C9C54521CD2B28A42F9D330BC3D +:10EAB00003F0B4B850070020064B10B5A3F10802CC +:10EAC0000021527803E05C5C4454491CC9B2914275 +:10EAD000F9D310BD5807002070B50C46054603F069 +:10EAE00051F9024621462846BDE8704004F07ABD3F +:10EAF000074A30B45170064B0022083303E0845CAF +:10EB00009C54521CD2B28A42F9D330BC03F0DCB818 +:10EB10005007002003F08CB910B504F0DFFD024966 +:10EB20000020087010BD0000500700200148407808 +:10EB300070470000500700207FB50D496B464A68BA +:10EB400000928A788DF80420002104E0445C5D186E +:10EB5000491C6C71C9B29142F8D3064901208DF865 +:10EB60000D0048709DE80F0003F076FE7FBD0000A9 +:10EB7000500700205027002001498870704700008E +:10EB800050070020024940F295724A607047000029 +:10EB9000500700207047000070B50C46064603F091 +:10EBA000F1F80A4D297800290ED17F2101704670B5 +:10EBB000847003240020FFF7E5FF03F06DFB20467F +:10EBC00003F006F90120287070BD000050070020F6 +:10EBD00070B50D46044603F0D5F80C4E3178002987 +:10EBE00013D1002C11D0002203E0A95C8154521CE7 +:10EBF00092B2A242F9D30020FFF7C4FF03F04CFB0E +:10EC0000204603F0E5F80120307070BD5007002069 +:10EC100002F0CABFFEE72DE9F041042701260446B1 +:10EC200000F17008002594F89110002006296AD29E +:10EC3000DFE801F0031A69424E5B94F854000328A0 +:10EC400070D340460CF0D3F800286BD104F1940146 +:10EC500040460CF0E8F828B184F8916084F89050B0 +:10EC600084F8AC50012050E0D4F808C094F89930F2 +:10EC7000207804F19A02D4F89410E04784F89800C0 +:10EC800094F89010491C84F89010FF280CD00220B2 +:10EC900084F8910084F8AC5094F854008128C2D1D3 +:10ECA000032084F85400BEE7C8B294F844108842A8 +:10ECB00038D384F891702EE094F8900094F84410C2 +:10ECC000884202D384F89170CCE784F89160C9E758 +:10ECD00084F89150D4F8A82012B9226D002AC1D02E +:10ECE0000121D4F8A4009047BCE784F89150D4F8EF +:10ECF000A81011B9216D0029B4D00220D4F8A420A5 +:10ED000007F0BAFFAEE700280CD094F89110042960 +:10ED100089D1002806D02278BDE8F04104210120E5 +:10ED200007F0AABFBDE8F08130B500201D4B0246B8 +:10ED300004460125C3F898510521491E0904090C10 +:10ED4000FBD14006D3F81C11000E09B140F00100C0 +:10ED5000C3F898410521491E0904090CFBD1521C36 +:10ED6000D2B2082AE6D3C3F898410521491E090406 +:10ED7000090CFBD1C3F89C410521491E0904090C6B +:10ED8000FBD1C3F898510521491E0904090CFBD198 +:10ED9000C3F898410521491E0904090CFBD1C3F8A9 +:10EDA0009C5130BD008021420F490122C1F89C21B5 +:10EDB0000520401E0004000CFBD1C1F8982105205D +:10EDC000401E0004000CFBD10022C1F89C2105204C +:10EDD000401E0004000CFBD1C1F898210520401E04 +:10EDE0000004000CFBD17047008021420C49002038 +:10EDF000C1F89C010520401E0004000CFBD101223B +:10EE0000C1F898210520401E0004000CFBD1C1F878 +:10EE10009C210520401E0004000CFBD1704700001F +:10EE20000080214230B5164B0025C3F898512A4680 +:10EE30000124010602D5C3F89C4101E0C3F89C51AE +:10EE4000C3F898410521491E0904090CFBD1C3F8F8 +:10EE500098510521491E0904090CFBD14006521C9A +:10EE6000000ED2B2082AE4D3C3F89C41C3F89841FB +:10EE70000520401E0004000CFBD1C3F8985130BDA2 +:10EE8000008021422DE9F041084E4FF400653560C5 +:10EE900009F0E7FD371F6C103C6009F0E2FD3460BB +:10EEA00009F0DFFD3D60BDE8F0810000140C014079 +:10EEB00070B5084D4FF40060286009F0D2FD2C15A4 +:10EEC0002C6009F0CEFD281D0460BDE8704009F0FB +:10EED000C8BD0000100C01402DE9F047144F00247C +:10EEE000DFF84C8082462546A8F108083E1507F158 +:10EEF00004096006040E3E6009F0B3FDD8F8000076 +:10EF0000000501D5641CE4B2C9F8006009F0A9FD50 +:10EF10006D1CEDB2082DECD3BAF1000F04D0FFF751 +:10EF2000B1FF2046BDE8F087FFF7C2FFF9E7000018 +:10EF3000100C01402DE9F047DFF848900546002409 +:10EF40004FF480674FF40068A9F104062806404694 +:10EF500001D5306001E0C9F8000009F082FD37609A +:10EF600009F07FFDC9F80070072C01D1C6F80080B8 +:10EF70006806050E09F075FD641CE4B2082CE5D3A3 +:10EF8000BDE8F087140C014070B509484FF40066E5 +:10EF900006600515056009F064FD054C241D26601A +:10EFA00009F05FFD2560BDE8704009F05ABD000022 +:10EFB000100C014070B507484FF400640460054D23 +:10EFC00000152D1F286009F04CFD2C60BDE8704035 +:10EFD00009F047BD140C014070B50C4C4FF40060B3 +:10EFE000206009F03EFD2515256009F03AFD07482F +:10EFF00008380068000501D5012400E0002403481A +:10F00000001D056009F02DFD204670BD100C01406B +:10F010007047000003497F20086003490020087002 +:10F0200070470000002C0040540200200C48C169C9 +:10F0300041F40061C1610B4940F2FF3008600948AA +:10F040007F21001F0160016841F0800101604FF0E5 +:10F05000E021002081F800040120C1F80001704780 +:10F0600000100240042C00400A480B4A0078137933 +:10F0700000F0010199420BD01171C00708D0074977 +:10F08000002081F82700C87081F8260081F8200050 +:10F0900070470000F5170020980600205027002038 +:10F0A0002DE9F0410024144DFF2604EB440000EB51 +:10F0B000C40005EB00100746B021F9F77EF8641C88 +:10F0C000E4B23E70022CF0D30C4C206818B90C4806 +:10F0D00007F068FE206007F0C2FE18B90A21206818 +:10F0E00007F0B6FE0749012007F0FAFDBDE8F04140 +:10F0F0000549022007F0F4BDC0110020C80400201B +:10F1000051B1010825B6000819B6000810B548210C +:10F110000F48F9F752F80E4828214830F9F74DF812 +:10F120000C4801F071FB010004D00948142248305A +:10F13000F9F72AF80748203001F066FB010006D0F5 +:10F1400003481422BDE810405C30F9F71DB810BD2B +:10F1500050110020F0B101082DE9F04116460D468E +:10F16000FFF7C2FA040007D035B12EB1287818B1E4 +:10F1700094F85400012802D00020BDE8F08195F8F1 +:10F180002000C00702D0A86A0028F6D095F8250014 +:10F1900084F8450010B9322084F84500C0B200EB75 +:10F1A0004000C00009F090FEC4F88C000028E4D0B4 +:10F1B000014694F84530182204F170000BF027FE48 +:10F1C00095F82000C0070FD194F84500000109F020 +:10F1D0007BFEC4F8880078B3014694F845301022CD +:10F1E00004F158000BF013FE286A04F12007206494 +:10F1F00020213846F8F7E1FF1F2229463846F8F764 +:10F20000C3FFE86AF862A86AB86295F8240087F834 +:10F210002400286B38630C4830610C48F0600C48BF +:10F22000B0600C4870600C4830600C48706102207F +:10F2300084F854000120A0E7FFE754F88C0F09F090 +:10F24000CDFA0020206097E7979101080790010808 +:10F250007990010889900108FD900108738F0108D9 +:10F260000068B0F5607F15D0A0F58061523911D0EB +:10F27000A0F5806153390DD0A0F58061543909D0D3 +:10F28000A0F58061513905D0A0F5C061123901D0D7 +:10F290000020704701207047014800787047000047 +:10F2A00018050020A0F13001092905D911390529D7 +:10F2B00002D96138052801D8012070470020704725 +:10F2C00030B50446002014F8015B8D4203D1012AB9 +:10F2D00008D0521ED2B2002B04D0401C5B1E80B25C +:10F2E0009BB2F0E730BD0000144810B5C07E144C4E +:10F2F000012816D04FF47A700146A06110481430EE +:10F3000003F020FA012817D1E0784FF4007110F0D3 +:10F31000010F00F10100E0700A4804D0FFF721F866 +:10F3200003E06420E8E7FFF71EF805480021BDE888 +:10F330001040143003F006BA10BD00000017002082 +:10F3400000000020000801402DE9F84F01211C2099 +:10F3500001F026F84FF40076ADF800601024DFF8D5 +:10F3600058918DF8034003258DF8025069464846B0 +:10F37000FEF776FF31464846FEF7F5FF0127ADF868 +:10F3800000708DF803408DF8025069464846FEF73C +:10F3900067FF01214846FEF7E6FF40F20240ADF864 +:10F3A00000008DF803408DF8025069464846FEF78C +:10F3B00057FF02214846FEF7D6FFA1014846FEF757 +:10F3C000D0FFA020ADF80000DFF8F0A08DF80340DA +:10F3D0008DF8025069465046FEF742FF2021504604 +:10F3E000FEF7BFFF80215046FEF7BDFF44F2272005 +:10F3F000ADF80000DFF8C8808DF803408DF80250AA +:10F4000069464046FEF72CFF31464046FEF7ABFF0B +:10F4100001214046FEF7A5FF02214046FEF7A1FF6D +:10F4200004214046FEF79DFFA1024046FEF799FFEA +:10F4300020214046FEF795FF2001ADF80000482549 +:10F440008DF8035069464846FEF70AFFE002ADF822 +:10F4500000008DF8035069465046FEF701FFADF8F5 +:10F4600000608DF8035069465046FEF7F9FE012111 +:10F47000084600F095FF01211248FEF73FFFADF866 +:10F4800000408DF802708DF8034069464046FEF753 +:10F49000E7FE10214046FEF766FF0020FAF726FB44 +:10F4A0006002ADF8000004208DF803006946504664 +:10F4B000FEF7D6FEBDE8F88F0008014000100140BD +:10F4C000000C014000013000FEE770474FF4A060DF +:10F4D00000F032B830B50F23C27801780125F2B1BF +:10F4E000144A126801F1E02102F4E062C2F5E06220 +:10F4F000120AC2F10404D3404278A24084781C402E +:10F500001443220181F80024007800F01F018D408F +:10F510004009800000F1E020C0F8005130BD01F04A +:10F520001F0085404809800000F1E020C0F88051AC +:10F5300030BD00000CED00E00249084302490860BC +:10F54000704700000000FA050CED00E00907090E05 +:10F55000002806DA00F00F0000F1E02080F8141D0A +:10F56000704700F1E02080F800147047024A114013 +:10F57000014302480160704780FFFF1F08ED00E073 +:10F580004FF400720021014804F0C6BAA4270020FD +:10F5900010B540F6B8342146074803F0D3F80128E7 +:10F5A00006D105482146001D03F0CCF8012801D002 +:10F5B000012010BD002010BDAC02002001490862EE +:10F5C0007047000000000E422DE9F0472348DFF8A5 +:10F5D00090900122B0F8188009F2FA250020C5F8B1 +:10F5E00004902870434620214846FFF769FE687062 +:10F5F00004461CA0696805F099F8444528D0022605 +:10F6000024E019F80410202925D02978274605EB95 +:10F61000810109EB070088604346324620211048EB +:10F62000FFF74EFE2A7813490446C01B5054297830 +:10F6300005EB8100826810A005F078F82878401C5E +:10F64000C0B22870042803D2761CF6B24445D8D143 +:10F650000120BDE8F087641CA4B2F7E77C07002016 +:10F66000DE320020696E6F757420636D643A257315 +:10F670000A000000F0350020256420706172616D81 +:10F680003A25730A000000001FB50F4B01201872C5 +:10F690000020D887009A9DF80410A2F5E062684621 +:10F6A000853A09D05A2A06D140F2DF72A3F84C20DD +:10F6B000401DFFF7EFF91FBD40F28572A3F84C2003 +:10F6C000401DFFF715FA1FBD5027002070470000AE +:10F6D0002DE9F047DFF8E4804FF480752946404675 +:10F6E000FEF738FE364CDFF8DC906E0020733146B2 +:10F6F0004F464846FEF72EFE607302462378217B74 +:10F7000031A005F013F831463846FEF723FE0027F6 +:10F7100000282AD0AA46294645464046FEF71AFE4A +:10F7200018B3A0780A21B0FBF1F201FB1201401CD2 +:10F73000A070012915D131464846FEF70BFE08B1ED +:10F740002CA100E02DA12FA004F0F0FF5146284687 +:10F75000FEF700FE08B127A100E028A12BA004F0CD +:10F76000E5FFFCF7ADFDA0B91AE0207BE178884207 +:10F7700005D0E07080B121A122A004F0D7FF21794B +:10F78000607B814205D0207140B11CA11FA004F014 +:10F79000CDFF6770BDE8F08716A1EDE715A1F5E78D +:10F7A00061781DA004F0C2FF6078401CC0B2607098 +:10F7B0000C28EFD96770FEF725F90000000801401A +:10F7C000E0040020001001407374617465412D2D28 +:10F7D0002D202564202073746174654163633A2091 +:10F7E000256420202077616B655F747970653A2508 +:10F7F000640D0A0077616B6575700000736C656558 +:10F8000070000000412B2025730D0A004143432066 +:10F8100025730D0A00000000456E74657220536C5C +:10F820006565702054696D65206164642D2D2D20FF +:10F83000256420202D2D4D61782D31320D0A0000D8 +:10F840002DE9F0412B482C494069F8F748FDF8F7BD +:10F85000A6FF81B2B1F5AF7F43D3284A284E0024DA +:10F860009079012706EBC0030546B3F802C08C452A +:10F870000CD316E036F830C08C4505D206EBC00C30 +:10F88000BCF802C08C4504D8401CC0B20528F1D396 +:10F8900001E0052800D30420D472947AECB9977261 +:10F8A00016E036F830C08C450CD814E036F830C07D +:10F8B0008C4505D206EBC00CBCF802C08C4503D8C1 +:10F8C000401EC0B20028F1D19472D47A2CB9D772FC +:10F8D000DB88D38101E0D4729472D3891BB15B1EA3 +:10F8E000D381BDE8F0818542FBD03229F9D99071EE +:10F8F000F7E70000E81600200000C842E0040020FE +:10F9000030B20108074810B540F2126101600021D1 +:10F910004160017241720221817205F0EBFE01200B +:10F9200010BD00002C0C002070B5FCF7DFFB05F0CB +:10F9300081FC002877D0764C0025207B012802D05E +:10F94000022866D0D1E072480A21A83002F010FFE8 +:10F95000012857D1E08E0A21B0FBF1F201FB12021F +:10F96000F2B1B0FBF1F201FB1202012A20D0B0FB90 +:10F97000F1F201FB1202022A22D0B0FBF1F201FBEC +:10F980001202032A24D0B0FBF1F201FB1202042A76 +:10F9900026D0B0FBF1F201FB1200052828D02EE0A2 +:10F9A00040F2126007F080F908B3FFF7ABFF26E0E2 +:10F9B0004FF4607007F078F9C8B100F0B3F81EE0BA +:10F9C00040F2524007F070F988B1FEF7E5F816E012 +:10F9D00040F2534007F068F948B1FEF7E3F90EE052 +:10F9E00040F2544007F060F908B1FEF733FA06E040 +:10F9F00040F2514007F058F908B1FEF749F9E08E9E +:10FA0000401CE086E08E06286FD3E5860220207336 +:10FA10006BE0FCF765FC3E4E803610B9FCF750FCFD +:10FA200010B175620FE061E0706A42F210718842B5 +:10FA300009D237480A21B03002F09AFE012802D1DB +:10FA4000706A401C706232486421A83002F090FE57 +:10FA50000525012818D1608FB0FBF5F105FB1101D8 +:10FA6000401C608781B92B4800780028E08E00F1A7 +:10FA70000100E08602D0C00704D105E000F00300D9 +:10FA8000012801D1FFF73EFF21481421AC3002F0DC +:10FA90006FFE012829D1A08FB0FBF5F105FB110104 +:10FAA000401CA08709BBFFF773FD01281DD1208FE3 +:10FAB000401C80B2B0FBF5F105FB11012087042941 +:10FAC00015D0B0FBF5F105FB1101032916D0B0FBF1 +:10FAD000F5F105FB1101022913D0B0FBF5F105FB8F +:10FAE0001100012810D0FEF7D3F8012070BDFCF7FB +:10FAF000F7FB0028F9D000F015F8F6E7FEF74CF810 +:10FB0000F3E7FEF74FF9F0E7FEF7A4F9EDE70000A1 +:10FB100058020020E50400200149012008737047C5 +:10FB2000580200202DE9F05F814800254FF46071F4 +:10FB3000C0E9001505724572082181727D482C4686 +:10FB40007D498068F8F773FBF8F729FE7B4F87F84B +:10FB5000D5007B4810F8281F40780844503800EB47 +:10FB6000D070282101EB600087F8D600754839462F +:10FB700031F8D3AF90F801C0487971490AF00F0607 +:10FB800020F00C008B8BCA8B6F49BCF1060F4978B3 +:10FB900004D097F80AC1BCF1010F6FD1001D87F89E +:10FBA000D80097F8B9C0DFF888B1CCF34118DFF876 +:10FBB00098C1ABF1B80BB8F1020F9CF801C0BBF8CB +:10FBC00030B0ACF10209DFF878C1BCF826E0DFF80C +:10FBD00078C19CF802C01FD0B9F1030F64D8564613 +:10FBE00063F30F16A7F8D360B7F8D2604FF03C0864 +:10FBF00062F30B06A7F8D260BBFBF8F687F8D76074 +:10FC0000BEF1000F3BD020F0F000503087F8D80054 +:10FC1000042087F8D90058E0B9F1030F5FD85646A1 +:10FC200063F30F16A7F8D360B7F8D2604FF03C0823 +:10FC300062F30B06A7F8D260BBFBF8F687F8D76033 +:10FC4000BEF1000FDFD1042923D005290AD00329F2 +:10FC50000CD01AE020F0F00030301EE020F0F00070 +:10FC600020301AE020F0F000403002E020F0F000F8 +:10FC7000203087F8D80087F8D95026E02FE00429F3 +:10FC800007D005290CD00329E8D020F0F00010306F +:10FC9000EFE7BCF1020FE1D1DCE787F8D80014E010 +:10FCA00020F0F0004030F8E720F0F000103087F846 +:10FCB000D80087F8D950A7F8D360B7F8D2006FF30F +:10FCC0000B00A7F8D20087F8D75019483E38407C7F +:10FCD000012817F8D80F20F0030004D004E020F02A +:10FCE000F0006030E3E7401C38701448B03050F842 +:10FCF000225F46681248C07E012807D11348007869 +:10FD0000042803D1042901D143EA023464F31745DE +:10FD1000200A60F30F25200C60F30705044840F823 +:10FD20000B5F4660024807F0C1F80120BDE8F09F74 +:10FD30002C0C0020E816002000002042FC0D0020C2 +:10FD4000001700203A2A0020580200201B0500203E +:10FD5000064810B5406938B1044840F214511430D7 +:10FD600002F0F0FC002800D0012010BD940F00200C +:10FD700010B50949027B11F8DB3F62F303030B70F6 +:10FD8000C27A064B02F00301D972017B104605F0DE +:10FD900061FD012010BD0000FC0D00205802002074 +:10FDA0000249012081F80A0170470000FC0D002083 +:10FDB000044950F80B2F41F8092F40684860012092 +:10FDC00070470000AC0E00202DE9F0410446B0F869 +:10FDD0000B0040BAF8F7BDFC1B4E1C4F32463B46A9 +:10FDE000F8F7A0FBDFF8688000224346F8F794FBA1 +:10FDF000F8F708FD80B2411E40F2E732154D9142FE +:10FE00000CD2F8F7A6FC32463B46F8F78BFB0022F3 +:10FE10004346F8F781FBF8F7F5FCA880B4F80F002B +:10FE200040BA2881F8F795FC0B4A0C4BF8F77AFB9F +:10FE3000F8F7E8FC0A490870607CA872A07CE872B8 +:10FE40000120BDE8F08100009A9999999999A93FFC +:10FE500000009940FC0D00207B14AE47E17A843FFE +:10FE60005802002030F80B1F4ABA074921F8402FEA +:10FE7000428852BA4A80828852BA8A80C08840BA80 +:10FE8000C880012070470000FC0D002030F80B1FD7 +:10FE90004ABA074921F8482F428852BA4A808288D4 +:10FEA00052BA8A80C08840BAC880012070470000DA +:10FEB000FC0D002030F80B1F4ABA074921F8502FDB +:10FEC000428852BA4A80828852BA8A80C08840BA30 +:10FED000C880012070470000FC0D002030F80B1F87 +:10FEE0004ABA074921F8582F428852BA4A80828874 +:10FEF00052BA8A80C08840BAC8800120704700008A +:10FF0000FC0D002030F80B1F4ABA074921F8602F7A +:10FF1000428852BA4A80828852BA8A80C08840BADF +:10FF2000C880012070470000FC0D002030F80B1F36 +:10FF30004ABA074921F8682F428852BA4A80828813 +:10FF400052BA8A80C08840BAC88001207047000039 +:10FF5000FC0D002030F80B1F4ABA074921F8702F1A +:10FF6000428852BA4A80828852BA8A80C08840BA8F +:10FF7000C880012070470000FC0D002030F80B1FE6 +:10FF80004ABA074921F8782F428852BA4A808288B3 +:10FF900052BA8A80C08840BAC880012070470000E9 +:10FFA000FC0D002030F80B1F49BACAB2084921F8ED +:10FFB000802F428852BAD2B24A80828852BAD2B2D4 +:10FFC0008A80C08840BAC0B2C88001207047000053 +:10FFD000FC0D00202DE9F041044634F80B0F40BA27 +:10FFE000F8F7B7FB0F4E104F32463B46F8F79AFA38 +:10FFF000F8F708FC0D4DA881608840BAF8F7A9FB16 +:020000040801F1 +:1000000032463B46F8F78EFAF8F7FCFBE881207998 +:10001000287460796874A079A874E079E874012084 +:10002000BDE8F0819A9999999999A93FFC0D002012 +:1000300010B50C4AC37A12F8A01F63F303011170C4 +:10004000C37A1B0963F3071111700A09072A00D943 +:10005000072200F10C010348A130F8F795F80120C0 +:1000600010BD0000FC0D00202DE9F041044634F8DD +:100070000B0F40BA00B2F8F75BFB184E184F324630 +:100080003B46F8F74FFA0022164BF8F745FAF8F717 +:100090009AFB154DA882608840BA00B2F8F748FB79 +:1000A000F217F8F720FBF8F7ADFBE882A08840BA1A +:1000B00000B2F8F73DFB32463B46F8F733FAF8F763 +:1000C000A1FB2883A0790B3C282800D92838A876E2 +:1000D000A07CE8760120BDE8F08100009A9999990A +:1000E0009999A93F00009940FC0D002030F80B1FA2 +:1000F0004ABA094921F81C2F428852BA4A8002792B +:10010000283A0A714279283A4A71C08840BAA1F85F +:100110000700012070470000FC0D00202DE9F04190 +:10012000044634F80B0F40BAC0F30B00F8F711FB8C +:100130000D4E0E4F32463B46F8F7F4F9F8F762FBE6 +:100140000B4D25F8250F608840BAC0F30B00F8F777 +:1001500000FB32463B46F8F7E5F9F8F753FB6880B9 +:100160000120BDE8F08100009A9999999999B93FC9 +:10017000FC0D00200949C27A01F8292F027B4A7040 +:10018000427B8A70827BCA70C27B0A71027C4A7190 +:10019000427C8A71807CC87101207047FC0D002070 +:1001A0000949C27A01F8312F027B4A70427B8A707A +:1001B000827BCA70C27B0A71027C4A71427C8A715E +:1001C000807CC87101207047FC0D002070B50F4D78 +:1001D0000446C07A85F83900A08940BAF8F7B9FA20 +:1001E0004FF0FF363246F8F77EFAF8F70BFB6887D8 +:1001F000E880E08940BAF8F7ACFA3246F8F773FACB +:10020000F8F700FBA887012070BD0000FC0D00205E +:10021000C17A282900D92839174AA2F89010017B01 +:10022000282900D92839A2F89210417B282900D921 +:100230002839A2F89410817B282900D92839A2F8FE +:100240009610C17B282900D92839A2F89810017C82 +:10025000282900D92839A2F89A10417C282900D9E8 +:100260002839A2F89C10807C282800D92838A2F8C8 +:100270009E00012070470000FC0D002070B5114960 +:1002800050F80B2FA1F130058A674068C86735F830 +:10029000AC4FA008F8F75DFA0B4A0C4BF8F742F99F +:1002A000F8F7B0FA60F38F042C802879F8F751FA48 +:1002B000074A084BF8F736F9F8F7A4FA2871012035 +:1002C00070BD00002C0E00209A9999999999B93F18 +:1002D0004A0C022B8716C93F0A4A50F80B1F42F8F6 +:1002E000011F41685160427983791204C07942EA62 +:1002F00003220243034862F31F31B038C0F8B5103F +:1003000001207047AC0E002010B504480449F8F7EE +:1003100079FA0449A1F8C900012010BD9A99999968 +:1003200099D1B840FC0D00200A4911F8C12F02F5FF +:10033000FA620A70027B4A70427B8A70827BCA70C2 +:10034000C27B0A71027C4A71427C8A71807CC871CE +:1003500001207047FC0D0020044A0029516901D09A +:10036000014300E0814351617047000000100240EA +:10037000044A0029D16901D0014300E08143D161E1 +:100380007047000000100240044A0029116901D0A2 +:10039000014300E0814311617047000000100240FA +:1003A000044A0029916901D0014300E08143916131 +:1003B0007047000000100240044A0029D16801D0B3 +:1003C000014300E08143D16070470000001002400B +:1003D000014908607047000040044242F0B52B4CD0 +:1003E00061682B4A11F00C014FF00F0603D004296D +:1003F00001D0082901D0026026E06168636806EA3E +:10040000914103F480330D2901D0891C00E00621BD +:10041000BBB1E36A13F4803FE36A03F00F0303F117 +:1004200001030AD0E56AC5F30317E56A7F1CB2FB36 +:10043000F7F2C5F30325AD1C6A43B2FBF3F24A435E +:10044000D9E7144A514301606168134A06EA111161 +:10045000535C0168D94041606368072505EA1323AE +:10046000D35C21FA03F38360636805EAD323D25C8B +:10047000D140C1606268032303EA9232064B1B1F1E +:100480009A5CB1FBF2F10161F0BD00000010024086 +:1004900000127A0000093D004402002003460020BB +:1004A0005909094A01290AD002290AD0516A03F0E0 +:1004B0001F02012393400B4200D0012070471168B6 +:1004C000F5E7116AF3E70000001002400649002238 +:1004D00081F8202081F82020012802D0042802D1B0 +:1004E000052081F820007047001002400149086093 +:1004F00070470000800442420149086070470000D4 +:100500003C04424202490A6A02430A627047000000 +:100510000010024070B50D460646002403E0305D31 +:1005200003F014F9641CAC42F9DB70BD70B50D46E4 +:100530000646002403E0305D03F008F9641CAC4279 +:10054000F9DB0D2003F002F90A2003F0FFF8002484 +:1005500003E0305D02F0D0F9641CAC42F9DB70BD01 +:1005600070B50D460646002403E0305D03F0CCF97B +:10057000641CAC42F9DB70BD10B54FF40030FDF7E0 +:10058000F9F902490220087010BD0000E0040020C3 +:100590003EB54FF40030002500908DF8045008203F +:1005A0008DF8050001248DF806406846FDF7F2F944 +:1005B00029208DF8080002208DF809008DF80A50D6 +:1005C0008DF80B4002A8FEF785FF3EBD024801886A +:1005D00041F0100101807047042800400248018862 +:1005E00021F010010180704704280040064801886E +:1005F000031D1A880088814203D0198841EA00400F +:10060000704742EA0140704718280040044A002918 +:10061000118801D0014300E0814311807047000040 +:100620000028004010B516A004F080F801214FF01A +:10063000C050FFF79DFE0120FEF7C0FFF9F74DFA0D +:100640000020FFF743FF0120FFF750FF6120FFF775 +:1006500025FF0028FAD04FF40070FFF753FF012068 +:10066000FFF74AFF00F060F849F6404000F044F818 +:1006700000F052F8BDE81040002000F02DB8000056 +:100680005254435F496E745F436F6E66696775725B +:100690006174696F6E0D0A0010B50446FFF7A6FF7E +:1006A000204400F009F800F037F80121BDE81040BF +:1006B0000220FFF7ABBF000000B50246FFF786FF40 +:1006C0000449100C0880081D02805DF804EBFFF758 +:1006D00085BF00002028004000B50246FFF776FFE6 +:1006E0000449100C0880081D02805DF804EBFFF738 +:1006F00075BF00001828004000B50246FFF766FFEE +:100700000449C2F303400880081D02805DF804EB31 +:10071000FFF764BF08280040024801888906FCD51D +:1007200070470000042800400448018821F00801B7 +:10073000018001880907FCD57047000004280040AB +:100740000F4910B50120C1F89801FEF72DFB90204C +:10075000FEF768FB0020FEF765FBFEF747FBFEF7A0 +:1007600023FB9120FEF75EFBFEF7DEFA054C2070BE +:10077000FEF7DAFA6070FEF739FB208840BA10BD48 +:10078000008021427E06002000B597B0142112A8F7 +:10079000F7F713FD5A208DF8000001208DF80100B5 +:1007A00086218DF802108DF80400022100208DF8BA +:1007B00003108DF8050006216846FBF753F99DF8F4 +:1007C0000320ADF84400694612A8121DF7F7DCFCBF +:1007D000BDF844009DF8031013AA030A8B54521C61 +:1007E00042F210738854074AB2F81900984202D2B4 +:1007F000401CA2F8190012A8891DFFF7B1FE17B01E +:1008000000BD00000017002010B508B34168F9B121 +:100810008168E9B10178174B002202EB420404EB36 +:10082000C20403EB041424788C4211D0521CD2B2BF +:10083000022AF2D3002202EB420101EBC20103EBD8 +:1008400001110978FF2905D0521CD2B2022AF2D335 +:10085000002010BD02EB420101EBC20103EB0114C9 +:10086000014620222046F7F78FFC012084F854002F +:10087000014810BDC0110020CC04002070470000CA +:1008800003490869401C0861012800D172B670470D +:100890006807002005490869012802D0401E086148 +:1008A00070470020086162B67047000068070020AA +:1008B0002DE9F84F01208DF802004FF44C60ADF89F +:1008C0000000DFF898B104248DF8034069465846CB +:1008D000FDF7C6FCE1016248FDF745FD614D284684 +:1008E000F8F71EFA00212846F8F706FA012140F22F +:1008F000BD10FFF755FD5C4D284603F025F800219B +:10090000284603F016F840F22559002249462846A9 +:1009100003F07AF840F2244A00225146284603F0B8 +:1009200073F80C20ADF8000010258DF80350032655 +:100930008DF8026069464A48FDF792FC0421484858 +:10094000FDF70FFD08214648FDF70BFD0120FCF7E0 +:1009500040FF464F384602F0F7FF0021384602F0CC +:10096000E8FF00224946384603F04EF8002240F2E4 +:100970002661384603F048F800225146384603F015 +:1009800043F8B002ADF80000394F8DF803406946D6 +:100990003846FDF765FCDFF8DC80404602F0D4FF06 +:1009A0000021404602F0C5FF00224946404603F0C0 +:1009B0002BF800225146404603F026F8A002ADF87D +:1009C00000008DF8034069463846FDF749FCADF854 +:1009D000004069462848FDF743FC02212048FDF706 +:1009E000C0FC8DF802604FF40870ADF800008DF87F +:1009F000035069465846FDF733FC8DF80260240227 +:100A0000ADF800408DF8035069461548FDF728FC05 +:100A100021461348FDF7A7FC61105846FDF7A3FCDB +:100A200020215846FDF79FFC10215846FDF799FC00 +:100A300020213846FDF795FC01215846FDF791FC31 +:100A400002215846FDF78DFC04215846FDF789FC2C +:100A500021015846FDF785FCBDE8F88F000C0140E8 +:100A6000000801400024014000440040004C0040C8 +:100A70000010014000500040001401402DE9F041F9 +:100A800003460E46407819785F4A00EB012085B294 +:100A90005F48978900245D4990F82000AF4210D14B +:100AA0008979B1420BD140B1FBF7D2FB18B1324684 +:100AB000991C584815E02224A2E03324A0E0132416 +:100AC0009EE0978AAF4212D1897AB142F7D10028CD +:100AD000F3D0FBF7BDFB0028EDD04E483246991C01 +:100AE0003530F7F751FB2846FCF7FAFB88E0D78A48 +:100AF000AF420DD1C97AB142E1D10028DDD0FBF778 +:100B0000A7FB0028D7D04348991C32463930E8E784 +:100B1000178BAF420DD1097BB142D0D10028CCD088 +:100B2000FBF796FB0028C6D03A48991C32463D3068 +:100B3000D7E7578BAF420DD1497BB142BFD10028D7 +:100B4000BBD0FBF785FB0028B5D03248991C324654 +:100B50004130C6E7978BAF420DD1897BB142AED110 +:100B60000028AAD0FBF774FB0028A4D02948991CC0 +:100B700032464530B5E7D78BAF420DD1C97BB14284 +:100B80009DD1002899D0FBF763FB002893D0214822 +:100B9000991C32464830A4E7178CAF420DD1097C2E +:100BA000B1428CD1002888D0FBF752FB002882D0BC +:100BB0001848991C32464B3093E7578CAF420DD101 +:100BC000497CB14298D1002898D0FBF741FB00281E +:100BD00098D01048991C32464E3082E7928CAA4237 +:100BE0000DD1897CB14287D1002887D0FBF730FB3B +:100BF000002887D00748991C3246513071E73124CC +:100C00002046BDE8F08100001EBA01080ABA0108BA +:100C100050270020A117002070B5184D00248EB079 +:100C2000B5F840101646042902D213200EB070BD4C +:100C3000017871228DF8002002788DF80120427829 +:100C40008DF80220807804228DF80300012907D056 +:100C5000022905D0032903D02879012802D004E015 +:100C6000312402E00020287112241A801CB9694640 +:100C70003046F7F789FA2046D8E7000050270020D1 +:100C800004494BF65C200880091D4AF6552008806F +:100C900070470000B06C00400CB500222E48009256 +:100CA0000192016841F4803101604FF4A063016852 +:100CB00001F4003101910099491C0091019911B989 +:100CC00000999942F3D10168890342D5012101912C +:100CD00022490A6842F010020A600A6822F00702FC +:100CE0000A600A6842F002020A6041684160416895 +:100CF0004160416841F480614160C16A184A114015 +:100D0000C162C16A174A1143C162016841F0806142 +:100D1000016001680901FCD5416821F47C11416042 +:100D2000416841F4E8114160016841F0807101605F +:100D300001688901FCD5416821F0030141604168E7 +:100D400041F0020141604168C1F381010229FAD1F9 +:100D50000CBD01920CBD00000010024000200240BA +:100D600000F0FEFF14080100FFF78ABF10B598B02D +:100D7000142112A8F7F721FA5A208DF8000001215A +:100D80008DF8011084208DF802002D4840F2BB231D +:100D90002C4C828FA2F209729A4203D290F80A0177 +:100DA00001284AD0002020760B208DF8030034F86B +:100DB000010F010A8DF804108DF80500A088010AC2 +:100DC0008DF806108DF80700E088010A8DF80810EC +:100DD0008DF809008DF80A108DF80B00B4F8110099 +:100DE000010A8DF80C108DF80D00E07D8DF80E00D5 +:100DF0000F216846FAF736FE9DF80320ADF844004F +:100E0000694612A8121DF7F7BFF9BDF844009DF816 +:100E1000031013AA030A8B54521C8854208B42F2ED +:100E20001072641E904202D2401CA4F8190012A84D +:100E3000891DFFF795FB18B010BD2176B4E70000BF +:100E4000FC0D00200017002070B5FEF7BDFB002848 +:100E500018D0124C0020124D124EE08380B200EBED +:100E6000400005EB800041687068F7F7B1F9002891 +:100E7000E08B08D000EB400005EB8000806800B1FB +:100E80008047012070BD401C80B2E0830B28E5D371 +:100E900005A003F04BFC002070BD00007C07002083 +:100EA000A4BA0108D8350020416E20756E726563C2 +:100EB0006F676E697A656420434D4420210A000003 +:100EC00030B547220270032343700B788370C270E1 +:100ED000062303714B7843718B788371CB78C37190 +:100EE00002720A2343720B790E2503F03F038372CB +:100EF0004B7903F03F03C3728B7903F01F03037335 +:100F0000CB7903F01F0343730B7A03F01F03837342 +:100F10004C7A0F2304F03F04C473027445748D7A35 +:100F20008574CD7AC574027543750B7B8375102467 +:100F3000C27504764A7B4276897B81761B2030BD60 +:100F40000F220249801CF7F71FB90000F917002093 +:100F5000F0B50023137003EB430404EBC30400EB70 +:100F60004404647834B144EA032514786600641CB0 +:100F700014708D535B1CDBB2122BECD3107800285D +:100F80001DD0002317E000200EE001EB400531F8F2 +:100F900010606C88F7B204F0FF0C674502D96E80D0 +:100FA00021F81040401CC0B21478E41A641E844238 +:100FB000EBDC5B1CDBB21078401E9842E3DCF0BD3A +:100FC00010B50B46024600240DE01078FEF76AF9D2 +:100FD00038B112F8010BFAF78DFD04EB840100EB38 +:100FE00041045B1EDBB2002BEFD1204610BD000098 +:100FF0002DE9F84F4FF417742146F648F7F7DDF85E +:10100000F5A003F093FBFE4D2246F249284605F079 +:1010100017FCF04F3878FF2800D050B90A20FCF7B1 +:1010200052F9F8A003F082FB2246EA49284605F06F +:1010300007FC3878FF2800D050B90A20FCF743F9A4 +:10104000F5A003F073FB2246E249284605F0F8FBC1 +:101050003978FF2900D051B90A20FCF734F9F4A0FF +:1010600003F064FB2246DB49284605F0E9FB97F8CC +:101070003800FF2804D1D74814213830F7F79DF8FD +:101080003878DFF85083DFF8C0930A260025A8F1EE +:1010900068084FF0320AFF2801D0002873D1C8F841 +:1010A0006850C8F86C50C8F87050C8F8745087F889 +:1010B000765048203870592078704420B8704E20FF +:1010C000F87087F804A03021797187F806A03320E2 +:1010D000F871D9F80810080EB6EB101F4FEA10127D +:1010E00001D2263200E0303200F00F003A720A28B6 +:1010F00001D9263000E030307872C1F30740B6EBFA +:10110000101F4FEA101201D2263200E0303200F0F8 +:101110000F00BA720A2801D9263000E03030F87288 +:10112000C1F30720B6EB101F4FEA101201D226328E +:1011300000E0303200F00F003A730A2801D926305F +:1011400000E030307873C8B2B6EB101F4FEA1011D0 +:1011500001D2263100E0303100F00F00B9730A28C7 +:1011600001D9263000E03030F873B8A003F0DEFA81 +:101170000024BBA0395D03F0D9FA641CE4B2102C42 +:10118000F7D387F84C5097F8B900FF2801D00A2808 +:1011900004D987F8B950ADA003F0C8FA387CFF280D +:1011A00000D080B9C8F87850C8F87C508948C8F891 +:1011B0008050ACA2ADA11030C8F8845003F0C6FA3C +:1011C000ABA003F0B3FA834C97F820001834FF2843 +:1011D00000D050B97F48A560ADA2A4A12030E56041 +:1011E00003F0B4FAACA003F0A1FA97F82800FF28A6 +:1011F00000D060B9256165617648A56199A29BA17F +:101200002830E56103F0A2FAA3A003F08FFAB7F843 +:101210004D004FF6FF71884200D010B95020A7F85A +:101220004D00B7F84F00884200D010B95520A7F8FC +:101230004F00B7F851008846404500D010B95520FE +:10124000A7F85100634C97F895009534FF2800D01B +:10125000B8BB9AA12046F6F7E1FFD9F80810C1F310 +:101260000740B6EB101F4FEA101201D2263200E001 +:10127000303200F00F0087F8A0200A2801D926306C +:1012800000E0303087F8A100C1F30720B6EB101F53 +:101290004FEA101201D2263200E0303200F00F0087 +:1012A00087F8A2200A2801D9263000E0303087F8DC +:1012B000A300C8B2B6EB101F4FEA101102D22631BC +:1012C00001E016E0303100F00F0087F8A4100A2882 +:1012D00001D9263000E0303087F8A5002046694665 +:1012E00003F07AF99DF80000303087F89D0087F808 +:1012F0004C5038482146983040F8115F8580857100 +:1013000073A003F013FAB7F890004146884200D06A +:1013100008B9A7F89060B7F853004FF06E088842FC +:1013200000D008B9A7F85380B7F857004FF4E1721E +:10133000884200D008B9A7F85720B7F8550088426E +:1013400000D018B94FF47A60A7F85500B7F85900E3 +:1013500040F6AC54884200D008B9A7F85940B7F815 +:101360005B004FF4FA73884200D008B9A7F85B30ED +:10137000B7F88300884200D018B940F61C40A7F89F +:101380008300B7F88500884200D008B9A7F8852007 +:10139000B7F85D00884200D018B9B7F88300A7F805 +:1013A0005D00B7F85F004FF47A79884200D008B941 +:1013B000A7F85F90B7F86100884200D008B9A7F895 +:1013C0006130B7F86300884200D010B94FF49B70C9 +:1013D00090E091E08C2A00203D3D3D3D3D3D48613F +:1013E000692044756E20506172616D65746572206C +:1013F000496E6974213D3D3D3D3D3D0D0A000000B3 +:1014000000F001086273705F526561644370754655 +:101410006C617368210D0A006273705F52656164CC +:10142000437075466C61736820310D0A000000003E +:101430006273705F52656164437075466C61736876 +:1014400020320D0A000000003C170020736E206956 +:10145000732064656661756C74210D0A00000000DC +:1014600025632000484559444E00000025730000C4 +:10147000626C7565746F6F74685F6E616D6520690D +:10148000732064656661756C74210D0A00000000AC +:101490003132333400000000626C7565746F6F7414 +:1014A000685F70617373776172642069732064652B +:1014B0006661756C74210D0A000000004C4B3641CA +:1014C00044434531354C423430383536390000001C +:1014D0000A0D205379735061726150696C65442024 +:1014E0005665686963686C65496E666F2025730A86 +:1014F0000D000000A7F86300B7F86500884200D02F +:1015000008B9A7F86540B7F8670040F6B83B8842CD +:1015100000D008B9A7F867B097F8B500FF2800D049 +:1015200008B987F8B58097F8B600FF2800D008B949 +:1015300087F8B6A097F8B000FF2800D010B90320B4 +:1015400087F8B000B7F8B100884200D018B94FF45E +:10155000D270A7F8B100B7F8B300884200D018B92C +:101560004FF4A070A7F8B30097F893004FF01E0A4D +:10157000FF2801D00A2801D287F893A097F86B00C2 +:10158000FF2802D1022087F86B00B7F86900A0F5A8 +:101590007F41FF3900D008B9A7F8696097F86C005F +:1015A000FF2803D10A217648F6F707FE97F8760060 +:1015B000FF2801D187F8765097F887100120FF297E +:1015C00001D187F88700B7F88E104FF6FF7291426D +:1015D00000D019B9B7F85910A7F88E1097F88D10E8 +:1015E000FF2900D009B987F88D0097F88711FF29E6 +:1015F00001D187F8870197F88910FF2901D187F871 +:10160000895097F88A105A23FF2900D009B987F822 +:101610008A3097F88B10FF2900D009B987F88BA082 +:1016200097F88C10FF2900D009B987F88CA097F89B +:101630009210FF2901D187F8925097F87411FF2971 +:1016400000D009B987F87451B7F87D11914200D0E4 +:1016500019B940F2DC51A7F87D11B7F87F1191421A +:1016600000D009B9A7F87F91B7F87511914200D061 +:1016700019B940F24C41A7F87511B7F877119142AA +:1016800000D019B940F2B631A7F87711B7F879113F +:101690006426914200D009B9A7F8796197F87B11C7 +:1016A000FF2900D009B987F87B8197F87C11FF29C1 +:1016B00000D011B9552187F87C1197F88111FF29C5 +:1016C00000D011B9502187F8811197F88211FF29B4 +:1016D00000D009B987F8823197F88911FF2900D025 +:1016E00011B9032187F8891197F89011FF2901D0CA +:1016F000022901D987F89051B7F88A11914200D098 +:1017000009B9A7F88A6197F88C11FF2901D187F8E8 +:101710008C0197F89711FF2901D0022901D987F888 +:101720009701B7F8A610914201D0A14201D9A7F8BC +:10173000A6B0B7F88E11914201D0A14201D9A7F805 +:101740008EB1B7F89811914201D1A7F89891B7F8E6 +:101750009A11914203D14FF44871A7F89A1197F862 +:101760007411FF2901D187F8740197F84C001128F2 +:1017700004D0112087F84C0000F054F8BDE8F88F31 +:10178000F82A002070B5084C00256078012801D0A7 +:10179000A57070BDA078411CA1700528F9D900F092 +:1017A00041F8A570657070BD680700200C4881681D +:1017B000491C81604168491C416081684FF47A721C +:1017C000B1FBF2F302FB1311012902D1C168491CDC +:1017D000C1600178002901D101210170704700002A +:1017E0006807002070B50E484FF47A710068B0FBAE +:1017F000F1F0401EB0F1807F11D24FF0E024606123 +:1018000065170F212846FDF7A1FE0020A0610720E3 +:1018100020612846BDE870400021FDF797BEFEE735 +:101820002C02002010B5FDF7F5FBBDE810404FF489 +:1018300017720249024805F019B800008C2A0020EE +:1018400000F00108124810B5016841F00101016083 +:101850004168104A1140416001680F4A114001601F +:10186000016821F480210160416821F4FE0141609A +:10187000016821F0A05101604FF47F0181600021D7 +:10188000C162FFF709FA05494FF00060086010BD1A +:10189000001002400000FFF0FFFFF6FE08ED00E040 +:1018A00010B5084C0121204600F004F9002807D0AB +:1018B000FEF73AF82046BDE81040012100F034B8A8 +:1018C00010BD0000000400407FB50D460446012114 +:1018D0000220FEF74DFDADF804400020ADF80050A9 +:1018E000104CADF80600ADF802006946204600F045 +:1018F000F5F801221146204600F0E8F81D208DF889 +:101900000C0001218DF80D1003228DF80E208DF8AA +:101910000F1003A8FDF7DEFD0121204600F007F8B7 +:101920007FBD000000040040C943018270470029C8 +:10193000018802D041F0010101E021F001010180A4 +:10194000704700004B4910B5884202D10121C414F0 +:1019500086E0B0F1804F09D0474988420DD101217E +:101960000220FEF711FD0021022064E0012108465B +:10197000FEF70AFD002101205DE04049884206D1C2 +:1019800001210420FEF700FD0021042053E03C4922 +:10199000884206D101210820FEF7F6FC002108202C +:1019A00049E03849884206D101211020FEF7ECFCBD +:1019B000002110203FE03449884206D10121202037 +:1019C000FEF7E2FC0021202035E03049884202D1B8 +:1019D0000121441444E02E49884202D10121CC0463 +:1019E0003EE02C49884202D101210C0538E02A4909 +:1019F000884202D101214C0532E02849884206D1B3 +:101A000001214020FEF7C0FC0021402013E02449C2 +:101A1000884206D101218020FEF7B6FC00218020FB +:101A200009E0204988420AD1841501212046FEF7A9 +:101A3000ABFC00212046BDE81040FEF7A5BC1A49CA +:101A4000884202D101210C040AE01849884202D1DF +:101A500001214C0404E0164988420AD101218C047A +:101A60002046FEF7A9FC2046BDE810400021FEF705 +:101A7000A3BC10BD002C0140000400400008004041 +:101A8000000C0040001000400014004000340140F1 +:101A9000004C01400050014000540140001800403B +:101AA000001C004000200040004001400044014074 +:101AB0000048014002460020138A92890B4202EA44 +:101AC000010202D0002A00D001207047002A82893A +:101AD00001D00A4300E08A438281704730B5028812 +:101AE0001B4C1C4DA0420DD0A8420BD0B0F1804F32 +:101AF00008D0194B984205D0184B984202D0184B89 +:101B0000984203D122F070034A881A43154B984239 +:101B100006D0154B984203D022F44073CA881A436A +:101B200002808A8882850A880285A0420AD0A8425B +:101B300008D00E4A904205D00D4A904202D00D4A7C +:101B4000904201D1097A01860121818230BD0000D5 +:101B5000002C014000340140000400400008004017 +:101B6000000C004000100040001400400040014004 +:101B700000440140004801400A480021428D4AB11A +:101B80000722C273027B521CD2B20273102A00D108 +:101B9000017370470177C173C17201764174808C03 +:101BA000FCF79ABFB406002070B51B4C012500203D +:101BB00025756076E07B01280AD1607A102807D16C +:101BC000FCF766FFE07B012802D1607A102807D07D +:101BD000207908B1E07818B1A078012806D007E094 +:101BE00096202086E5760220A07001E0607930B171 +:101BF000607A20B1E07B042803D1E08B08B900F0C3 +:101C0000EFFAE07A012806D1E07B062803D1BDE88F +:101C1000704000F0E5BA70BDB40600202DE9F04137 +:101C2000264CA078012847D0254F3879012802D1C9 +:101C3000E07A012840D0FCF779FF20851F48383032 +:101C4000FCF73AFF1D4E00253836307800F0F001E1 +:101C5000A173E584A18CA7F840103D71A1780127FC +:101C600000F00F00022901D100B9A770E07A012825 +:101C700001D100F0B5FAA07B00281DD13078114ABF +:101C800000F00F0CA4F824C0012006E0E18C335CC6 +:101C90005354491C401CE184C0B26045F6D900F0A1 +:101CA0006BF938B1E77429466174A08CBDE8F04146 +:101CB000FCF712BF0921F7E7BDE8F081B406002068 +:101CC00050270020501B002070B5194D0024A87823 +:101CD00001281CD001266E75FCF728FF288505F128 +:101CE0003800FCF7E9FE05F13800A97800780229F0 +:101CF00000F00F0001D100B9AE70E87A012801D1DF +:101D000000F06EFA0B486C776E70067170BD687FDC +:101D1000401CC0B268770228F8D301F02BFC00F019 +:101D200035F86C770448AC70EC73047070BD00003B +:101D3000B4060020502700205007002010B5104C9A +:101D4000207868B104F1380041782171807828B199 +:101D50007F2800D97F20401CC0B200E001206071C4 +:101D60002079E0706079A0710020207200F09AFA6A +:101D7000207A10B10320E07310BD0420FBE70000BF +:101D8000B406002000487047501B0020074800217F +:101D9000C1738170C172C17501760175417541765B +:101DA0008176C1760177017481757047B406002091 +:101DB00010B5064CA07AFCF7DFFE04F13800FCF702 +:101DC000BBFE4620A0850120607610BDB406002031 +:101DD00070B5164C00250728E08301D8657201E034 +:101DE000102060720126A6702584E07D012805D0B0 +:101DF0000C206074FCF790FEA57070BD607A10B185 +:101E0000102803D004E000F0B5FA01E000F06AFA0F +:101E1000E671A07AFCF7B0FE04483830FCF78CFE7F +:101E2000E6734620A085667670BD0000B4060020EB +:101E300010B500F0CFFBBDE8104000F0D1B90000B4 +:101E40000B49487B28B101280FD002280FD100F0A0 +:101E5000A5B9C88CA0F6020040428886488D0728A4 +:101E600001D300F0A9B800F02BB900F077B97047A2 +:101E7000B406002070B51F4DA5F1380429786878A4 +:101E800001F00F0140EA0120A08440F602016085C4 +:101E900088420BD90D216174FCF71EFE02202074CC +:101EA00000F040FA00202074E07370BD0828FCD3D5 +:101EB00000F062F8B8B1104B0220E18C2A5C401CA3 +:101EC0005A54628D491C521E6285C0B2E1840728B3 +:101ED000F3D901252573A08CFCF7DBFDE572BDE885 +:101EE000704000F01FBA09216174A08CBDE87040F9 +:101EF000FCF7F2BDEC060020501B002070B50F4D22 +:101F00000F4AA5F13804287800F00F03A3840120BC +:101F100006E0E18C2E5C5654491C401CE184C0B2A2 +:101F20009842F6D900F028F830B100216174A08CF5 +:101F3000BDE87040FCF7D0BD0921F7E7EC060020B2 +:101F4000501B00200A480A494FF000020078A1F116 +:101F5000380110F0F0008873CA84CA7405494876C5 +:101F600003D0102803D1FFF785BFFFF7C7BF704725 +:101F7000EC060020502700200E4B002019469A7BCB +:101F8000098D42B1102A0ED0202A0FD0302A09D153 +:101F9000032907D305E09A8C002A03D0521C9142F2 +:101FA00000D3012070470829FCD3FAE75A8D072A8D +:101FB000F9D2F3E7B4060020F0B51D49DFF874C08C +:101FC00001268D8E1C4B01F13807072D1CD2CE86C1 +:101FD00001200CE0CA8C3C5C9C54521CCA844A8D83 +:101FE000521E4A85CA8E521C401CCA86C0B2A842E4 +:101FF000F0D9488D08B98CF81F604E730820C8735B +:102000000E760020C884F0BD0120CA8C3C5C401CC8 +:102010009C54521CCA844A8DC0B2521E4A8507285D +:10202000F3D91004000CEED18CF81F60F0BD000055 +:10203000B406002050270020501B002070B51F4C14 +:10204000608E38B3607D002836D00025657504F1B8 +:1020500038062577307810F0F000A0731CD01028D7 +:102060001AD0202828D1FFF787FFE8B13078217BEC +:1020700000F00F00884219D16573FFF7E1FE96204A +:10208000608601202077607B002815D1BDE8704074 +:10209000FFF772BD03200AE00620607400F050F8DC +:1020A000BDE87040FFF74EBF092000E004206074D7 +:1020B000BDE8704000F044B870BD0000B4060020D8 +:1020C000F0B51C4901231C4D8E8E488D01F138045A +:1020D000864214D3C6B2012009E0CA8C275CAF54F3 +:1020E000521CCA844A8D521E401C4A85C0B2B0425E +:1020F000F3D9488D002801D11048C377F0BDCB86B5 +:1021000001200CE0CA8C275CAF54521CCA844A8D53 +:10211000521E4A85CA8E521C401CCA86C0B2B042AA +:10212000F0D9022048730820C8730B760020C884B9 +:10213000F0BD0000B4060020501B002050270020F6 +:1021400010B5054C0146A08CFCF7C6FC0020E073DE +:10215000E072207610BD0000B406002030B50D48B6 +:10216000017E002914D10C4C00F13803C18E0729DF +:102170000AD8C28C5D5CA554521CC284428D521E8A +:102180004285491CC186F1E7002141730721C173D3 +:1021900030BD0000B4060020501B002070B50E4872 +:1021A000017E002917D190F82A3000F138040B4D38 +:1021B0005B1C09E0C28C665CAE54521CC284428D2A +:1021C000521E4285491CC186C18E9942F2D9002116 +:1021D00041730721C17370BDB4060020501B00205D +:1021E00070B52C4C00222146E37B0320497D092B4E +:1021F0001CD2DFE803F0050C10141C202A383C0028 +:10220000002913D06275BDE87040FFF79BBEBDE8A2 +:10221000704000F073BABDE8704000F035BA00F0CD +:1022200041F8207A002801D10420E07370BDBDE898 +:10223000704000F0F1B9A179491EC9B2A17101291C +:10224000F4D8E0736079A07170BD217D012039B1AF +:102250002275A2760721E17396216186207770BDF1 +:10226000E18D49B170BDBDE87040FFF7E7BE638EF8 +:1022700013B131B162750B206074BDE87040FFF797 +:102280005FBFFFF7DDFD607B0028EBD1BDE870404C +:10229000FFF772BCB406002001490120C8757047E1 +:1022A000B40600200E49087A28B1012815D002286A +:1022B00015D100F03BB90A4AC879383240F0200005 +:1022C0001070088CA0F6020040428886C88B072850 +:1022D00001D300F075B800F0B3B800F0FFB8704754 +:1022E000B406002030B50D4A0D4C02F13803D08BF6 +:1022F000C0F3032141F01001197058700220118CB5 +:10230000655C1D54491C1184D18B401C491EC0B210 +:10231000D1830728F3D90820907230BDB40600207D +:10232000501B002010B5124C002104F13802207C13 +:1023300040F0300010705170917061840320A072E1 +:102340001154401CC0B20728FAD90820A0720020FE +:10235000FCF718FCA07AFCF70FFC05483830FCF7B6 +:10236000EBFB0620E0734620E0850120A07610BD3F +:10237000B4060020F0B5104C012004F13805E38BC1 +:102380002B7001460D4E08E0228C401CC0B2B75C99 +:102390006F54521C491C2284C9B29942F4D95B1C67 +:1023A000A372072807D800212954401CC0B207286F +:1023B000FAD90820A072F0BDB4060020501B0020FE +:1023C0002DE9F0411C4C1D4B04F13805A28E072A63 +:1023D0001AD20126E68630460CE0218C5F5C2F5431 +:1023E000491C2184E18B491EE183E18E491C401C7C +:1023F000E186C0B29042F0D926720025E575FCF75F +:10240000C9FB2584BDE8F0810120218C5A5C2A5447 +:10241000491C2184E18B401C491EC0B2E18307287E +:10242000F3D90820A072FFF7C3FC0420E073BDE8D5 +:10243000F04100F0BDB80000B4060020501B0020A1 +:102440002DE9F041234C0025DFF88CC0A28EE18BF2 +:1024500004F138068A424FF0010020D3CBB20121AB +:102460000CE0228C401CC0B21CF802707754521C45 +:102470002284E28B521E491CE283C9B29942F0D9F0 +:10248000A37202E03554401CC0B20728FAD90820D4 +:10249000A072FFF78DFC0420E073BDE8F081E086B8 +:1024A00001200DE0218C1CF801303354491C21849B +:1024B000E18B491EE183E18E491C401CE186C0B2DC +:1024C0009042EFD902202072E575FCF763FB25846A +:1024D000E3E70000B4060020501B002070B5114C4B +:1024E000E07D01281CD1104B04F13802E08E072852 +:1024F0000AD8218C5D5C1554491C2184E18B491E4E +:10250000E183401CE086F1E70820A072FFF750FC51 +:10251000002020720420E073BDE8704000F048B84D +:1025200070BD0000B4060020501B00202DE9F041D2 +:10253000174CE07D012829D194F83610A27FC8B24B +:102540001144CEB2A6724FF0000C04F13803114FC3 +:102550000BE0228C401CC0B2BD5C5D54521C228436 +:10256000E28B521EE283491CE186E18EB142F0D338 +:102570006546072803D81D54401CC0B2F9E708205F +:10258000A072FFF715FC25720420E073BDE8F0810E +:10259000B4060020501B002010B5FCF7BDFA03481C +:1025A0000021C1738170C175017510BDB406002092 +:1025B0000749C879401CC0B2C871102801D1002059 +:1025C000C8710879002802D0C878401EC8707047CA +:1025D000B40600200F49487E012803D1888D08B138 +:1025E000401E8885887E012803D1C88D08B1401E11 +:1025F000C885C87E012803D1088E08B1401E088610 +:10260000087F012804D1488E002801D0401E48864A +:1026100070470000B406002070B51A4D0126A88D41 +:10262000D0B1287DA97D084326D000246C762C7576 +:10263000E88B98B1287908B1E878A8B16979B1B187 +:10264000012914D002291AD016D9A879A0F10100C5 +:10265000A8714FF0050013E0304600E02046687492 +:10266000BDE87040FFF798BF2C70022008E0FFF72C +:1026700019FE287A08B1AE7570BDAC7570BD032027 +:10268000E87370BDB406002070B51B4D288EB0B144 +:10269000687D00282FD0002205F138006A75007887 +:1026A00000F0F001A973302925D1EA7600F00F047B +:1026B000FFF762FC28B1032C05D305200EE00220B1 +:1026C0000CE009200AE0022C07D0012C0BD0002CD2 +:1026D00011D1BDE87040FFF731BB08206874BDE838 +:1026E0007040FFF759BF07206874FFF755FF95202A +:1026F00028860120E87670BDB40600200A4A01232E +:10270000908D68B1107D002809D00020107550769A +:10271000517A31B1102902D113700220D073704761 +:1027200018465074FFF738BFB40600200149002056 +:102730000870704718050020014901200870704793 +:1027400018050020094A29B192680068904204D80F +:10275000101A04E09168016003E0C043104488420D +:1027600001D3012070470020704700006807002057 +:1027700010B5094C49B1A2680368934201D8D21A36 +:1027800001E0DB431A448A4203D3A16801600120BF +:1027900010BD002010BD00006807002030B52C4C93 +:1027A0002078012852D12B4A0121D068401CD060EA +:1027B0001170002323700524B0FBF4F504FB15040D +:1027C000002C43D1002841D00A24B0FBF4F504FBCF +:1027D0001504517004B991701424B0FBF4F504FB96 +:1027E000150404B9D1703224B0FBF4F504FB1504D0 +:1027F00004B911716424B0FBF4F504FB150404B9A9 +:1028000051714FF4FA74B0FBF4F504FB150404B9EC +:1028100091714FF47A74B0FBF4F504FB150404B91C +:10282000D17140F2DC54B0FBF4F504FB150404B99B +:1028300011724FF4FA64B0FBF4F504FB150404B90B +:10284000517241F27071884200D3D36030BD0000F4 +:10285000680700207C2A00200FB5124801880A2949 +:1028600001D3002101800288009900EB021251601F +:1028700002889DF8041000EB0212117202889DF884 +:102880000D1000EB021251740188DDF8052000EBF9 +:10289000011141F8092FDDF809204A600188491C1F +:1028A00001800FBD5423002070B510480068002837 +:1028B0001BD1F9F71DF9002817D00D4C218860882D +:1028C000814212D000250A2800D36580608804EB7D +:1028D0000010001D0FC801F068F906480121817041 +:1028E00080F828506088401C608070BDB0060020D1 +:1028F000542300205027002010B5044C01462046E8 +:1029000001F0F4F820880006FCD510BD004C004012 +:102910002DE9F041384E40F225573946304601F056 +:1029200054F8364C002590B1304601F0DBF8C1B2C6 +:10293000208BC82804D2324A1154401C208300E066 +:1029400025830A292FD03946304600F0ECFF40F2AB +:1029500024473946304601F038F838B125833046EF +:1029600001F0C0F83946304600F0DDFF40F2277430 +:102970002146304601F029F818B12146304600F0D2 +:10298000D2FF40F226642146304601F01EF818B10D +:102990002146304600F0C7FF0821304601F00EF80E +:1029A000012805D00BE0FEF74FFA2583BDE8F08142 +:1029B0000821304600F0B4FF304601F093F80421BE +:1029C000304600F0FBFF012806D10421304600F01C +:1029D000A7FF304601F086F80221304600F0EEFFF6 +:1029E0000128E3D10221304600F09AFF3046BDE8CD +:1029F000F04101F077B80000004C00407C07002057 +:102A0000DE32002070B5314C40F22556314620466A +:102A100000F0DBFF2E4D98B1204601F063F8AA8B41 +:102A20000021C0B2C82A04D22A4B9854521CAA834F +:102A300000E0A9836983E9703146204600F073FF06 +:102A400040F224463146204600F0BFFF40B1204608 +:102A500001F048F80120E8703146204600F063FF9D +:102A600040F226652946204600F0AFFF18B12946FE +:102A7000204600F058FF0821204600F09FFF012863 +:102A800006D10821204600F04BFF204601F02AF82D +:102A90000421204600F092FF012806D1042120469F +:102AA00000F03EFF204601F01DF80221204600F014 +:102AB00085FF012808D10221204600F031FF204681 +:102AC000BDE8704001F00EB870BD0000005000403D +:102AD0007C070020A633002010B5094CA07E0028FA +:102AE0000DD0607F10280AD1207F00F047FA002027 +:102AF000A076BDE81040FF210248F5F75EBB10BD8F +:102B000050270020501B002010B5074CA07E002845 +:102B100008D0607F112805D104F1290000F0B0FA37 +:102B20000020A07610BD00005027002010B50A4CF0 +:102B3000A07E00280FD0607F14280CD1032104F15F +:102B4000290000F0EFFA0020A076BDE81040FF2138 +:102B50000248F5F732BB10BD50270020501B002063 +:102B600010B5064CA07E002806D0607F192803D13E +:102B700000F0F8F80020A07610BD000050270020DB +:102B800010B5064CA07E002806D0607F222803D115 +:102B900000F058F90020A07610BD0000502700205A +:102BA00070B50F4DA87E00280ED0687F27280BD166 +:102BB00095F8290000240B4A05F12901042804D0C6 +:102BC000032000F0F1FAAC7670BD042000F0ECFABE +:102BD0000448AC76801FEC7740F8064F446070BD27 +:102BE000502700201607002010B50A4CA07E0028B0 +:102BF0000FD0607F28280CD1022104F1290000F0B9 +:102C0000BBFB0020A076BDE81040FF210248F5F78D +:102C1000D4BA10BD50270020501B002010B5094C1D +:102C2000A07E00280CD0607F2E2809D1064800889D +:102C3000401E81B2054800F035F90020E077A0760B +:102C400010BD000050270020DA060020511B002094 +:102C500010B50A4CA07E00280FD0607F31280CD11F +:102C6000032104F1290000F0F9FB0020A076BDE863 +:102C70001040FF210248F5F7A0BA10BD50270020F0 +:102C8000501B002010B5074CA07E002808D0607FA4 +:102C90003E2805D104F1290000F03CF90020A0767F +:102CA00010BD00005027002010B50A4CA07E00285F +:102CB0000FD0607F85280CD1012104F1290000F09C +:102CC00003FC0020A076BDE81040FF210248F5F784 +:102CD00074BA10BD50270020501B0020044A817890 +:102CE0001170C078491C1170801C50707047000032 +:102CF0001607002006490878012808D148780C28D2 +:102D000003D20C3151F820000047002008707047B2 +:102D10001407002002490120087000F02BBC0000BD +:102D20001407002002490020087000F023BC0000B6 +:102D3000140700207047000009480021012280F894 +:102D40002710C17080F82610C27680F8201081719B +:102D5000C18780F8221080F8231080F82510704772 +:102D60005027002070B534484178012963D9334C8D +:102D7000217901295FD11921017000214170E07E84 +:102D800001220221F9F77EF9E8B3B4F840000228E5 +:102D900046D394F8290004F1290600F07F05A81E07 +:102DA000092815D2DFE800F005301914191414149D +:102DB00030002846F9F78CF950B1B4F840000321EF +:102DC0002AE0324629461E48FBF702FBB8B929E043 +:102DD0002079122101282BD127E02846F9F778F92C +:102DE0000028F5D0B4F840000621F9F72BFAB8B165 +:102DF000324629461248FBF7EBFA032812D910494C +:102E0000FBF7E6FE14E00FE02846F9F761F9002829 +:102E1000DED0B4F840000221F9F714FA0028D0D12E +:102E2000132102E0312100E07F211920FBF7B4FEDD +:102E30000A20A4F8440070BD62070020502700203B +:102E4000A4290020144810B54078012823D9134C38 +:102E5000207901281FD1B4F84000032814D3C107FA +:102E600012D0032810D80E48FBF714FB032803D315 +:102E70000B49FBF7ADFE0BE0B4F84C00A0F5E061A8 +:102E8000853905D1312100E013212220FBF784FE92 +:102E90001E20A4F8440010BD620700205027002027 +:102EA000A429002070B5054617480E464078012831 +:102EB00028D9164C2079012824D1E07E0022032154 +:102EC000F9F7E0F8B8B1032E01D2132114E0B61ED1 +:102ED000B1B22846FDF7D2FD08B101460CE00C481E +:102EE0006E21017029784170697881700146032054 +:102EF000FBF76EFE03E07F212E20FBF74DFE28201E +:102F0000A4F8440070BD0000620700205027002094 +:102F1000A429002070B5054615484078012826D917 +:102F2000144C0221B4F84000F9F78CF9C0B12878AC +:102F300010F07F0F03D0207901280DD014E0F9F7AD +:102F40007BF988B10C487E210170297841700146D7 +:102F50000220FBF73DFE07E000202071122100E077 +:102F600013213E20FBF718FE0A20A4F8440070BD90 +:102F70006207002050270020A42900202DE9F047F7 +:102F800007463C484178012971D9102101703A4D1A +:102F9000002680464670B5F840000221F9F752F944 +:102FA00088B307F07F04012C07D0022C05D0032C36 +:102FB00003D0287901284ED054E0E87E4FF0010973 +:102FC000032804D0012814D0022817D013E0022CC3 +:102FD00011D1F9F73DF950B1EC76FDF7C5FE85F852 +:102FE0000C90C82085F80090A877782137E022213E +:102FF00035E0022C08D0032C08D001E0032C03D0CC +:10300000012C05D006E029E07E2128E0EE7301E0E6 +:10301000FBF7FEFFEC76EE8785F82060AE71032C9F +:1030200005D085F8226085F8236085F8256038464C +:10303000F9F702F9B0B1114850210170477086705C +:103040003221C17080F80490F421417106200B49AF +:10305000FBF7BEFD06E02E71122100E013211020C7 +:10306000FBF79AFD0A21A8F80410A5F84410BDE862 +:10307000F08700006207002050270020A4290020CC +:103080002DE9F041044623484178012940D9112116 +:1030900001700026204D46701E218180287901286C +:1030A00036D1B5F840000221F9F7CCF848B32078C2 +:1030B00000F07F00F9F704F8E8B1F9F7C9F8C0B1FA +:1030C0002078F9F7B9F8154F38B1512038702078C9 +:1030D000787039460220FBF77BFD11480179012900 +:1030E00002D106713E707E7001202870C820A8773A +:1030F0000BE0222106E02879012806D12E71122149 +:1031000000E013211120FBF747FD0A20A5F8440039 +:10311000BDE8F0816207002050270020A42900208C +:103120001C27002070B51D494A78012A35D9142280 +:103130000A701E228A8001784278090401EB02217C +:103140008078174C0D180122E07E0221F8F79AFFD3 +:10315000E0B1B4F840000421F9F774F8A0B16FF0C1 +:103160007F40854208D1F9F7E7F80E4954200870EE +:103170000120FBF72DFD0DE0B4F84C00A0F5E06157 +:10318000853907D1312102E0132100E07F2114208D +:10319000FBF702FD0A20A4F8440070BD620700207E +:1031A00050270020A42900202DE9F05FDFF8B4812A +:1031B0000024164698F801000D4601287ED96A4F72 +:1031C000387901287AD10122F87E1146F8F75AFFA2 +:1031D000002874D028784FF0010AA8F10209A3460C +:1031E000032806D00428B7F8400037D0022833D38C +:1031F000B4E089F800B05E46B7F840000221F9F764 +:1032000021F848B3F87801280BD0584C4FF0670BE1 +:1032100084F800B0287860705548FBF7CFF810B1FB +:1032200095E037248FE097F82000012802D1B87983 +:1032300001280FD04E480088608089F800A087F8E8 +:1032400006A088F800B088F8016048490420FBF720 +:10325000BFFC7CE06680F0E7132474E00421F8F7FB +:10326000F1FF0028F8D097F82600032807D899F82E +:10327000001011B1012908D009E0032800D3362439 +:1032800099F80000A0BB24245DE089F800B037481D +:10329000D9460222C0F800B03549F4F7B2FF40B376 +:1032A00033484178007801EB002080B2FBF75DF8ED +:1032B00069783170A9787170E97801E04CE04FE0ED +:1032C000B1702979F1702B49020A0A704870022204 +:1032D0003046F4F796FF68B197F82600FF2802D22F +:1032E000401C87F82600C0B202281ED8352426E0EC +:1032F00028E023E01D4887F82690672202702B788B +:1033000043702878494604280DD0022087F8210010 +:1033100088F8002088F8011087F820A013490220BF +:10332000FBF756FC0BE00120F0E7032807D1362419 +:103330003C2087F8270087F803A000E024240C48ED +:10334000C0F800901CB121462720FBF725FC1E2069 +:10335000A8F80400A7F84400BDE8F09F1224F2E7A3 +:103360007F24F0E76207002050270020A4290020D6 +:10337000AC060020AE0600202DE9F041344E044694 +:10338000682030703348417801295ED928210170C6 +:103390001E21314D81800122E87E1146F8F772FE30 +:1033A00040F28577E0B3B5F840000321F8F74AFF13 +:1033B000B8B3F8F74DFFA8B320784FF0000210F033 +:1033C0007F01607805D0032903D0287901282AD00D +:1033D00038E0012807D0032805D0B5F84C00B842E2 +:1033E00030D131212BE011B1032907D00DE00128A4 +:1033F00085F8222009D085F8232006E00121012844 +:1034000085F8221001D085F823102078F8F714FFF2 +:10341000C0B1207870700E490220FBF7D9FB11E093 +:1034200008E005E002E02A71122108E0222106E00E +:10343000132104E0B5F84C00B84203D17F212820C5 +:10344000FBF7AAFB0A20A5F84400BDE8F0810000C4 +:10345000A42900206207002050270020F8B5064666 +:103460000020ADF8000015480D464178012923D908 +:1034700031210170124C1E218180207901281BD13D +:103480000122E07E1146F8F7FDFD40B16B460D4A82 +:1034900029463046FDF7C0FB010001D104E07F2141 +:1034A0003120FBF779FB04E00649BDF80000FBF78B +:1034B0008FFB0A20A4F84400F8BD0000620700203A +:1034C00050270020A429002070B5044626484178E2 +:1034D000012948D9852101701E21244D81800122B6 +:1034E000E87E1146F8F7CEFD78B3B5F8400002212A +:1034F000F8F7A8FE38B3F8F7ABFE58B120780021F2 +:1035000000F07F00012807D0022808D02879012880 +:1035100016D025E0222120E085F8251002E00120C8 +:1035200085F825002078F8F787FEC8B11048C52136 +:1035300001702178417001460220FBF749FB0FE042 +:103540002971122109E0132107E0FFE7B5F84C00CB +:10355000A0F5E061853903D17F218520FBF71CFBB5 +:103560000A20A5F8440070BD620700205027002003 +:10357000A429002004480021022201704270012287 +:1035800082708180704700006207002010B5084CEF +:10359000A07E00280BD0607F00F00EF80020A076FF +:1035A0006077BDE81040FF210248F4F706BE10BD69 +:1035B00050270020501B0020084910B549780129E8 +:1035C0000BD9074C2179012904D100212171112146 +:1035D000FBF7E2FA0A20A4F8440010BD62070020BD +:1035E000502700202DE9F0411446054669B109290C +:1035F00027D133480178002923D000210170BDE88C +:10360000F041FF212F48F4F7D8BD2F490226487812 +:10361000012806D0022814D120782C4F102823D05E +:1036200025E00D460978207801F1400282420AD156 +:103630002046272904D14178012901D1FFF74EFB0B +:103640006E70BDE8F0817F28FBD160788142F8D1AF +:10365000A078782804D0FFF765FB03206870F0E7B6 +:103660001E20A8800420F9E74E7060783877217812 +:10367000174A184B79770020165C8E4208D13429FE +:1036800001D0362902D11449098829B9587003E0BC +:10369000401CC0B20C28EFD30C2801D10B2058706D +:1036A0000A48142129300646F4F787FD1422611CCC +:1036B0003046F4F769FD0120B876A7F84050C0E71E +:1036C000B5060020501B0020620700205027002074 +:1036D0008CBA010814070020DE06002001490120F1 +:1036E000487070476207002070B5154C40F22551B4 +:1036F000204600F06AF900280ED0204600F0F2F9CA +:10370000104AC1B2108A030406D444044FF00003E7 +:1037100006D50A2901D0138270BD40F400400DE0A7 +:103720000D2909D0C0F30D04074D401C80B2295566 +:103730001082C728EFD870BD40F48040108270BD61 +:10374000003801407C0700205030002010B5044CA8 +:103750000146204600F0CAF920880006FCD510BDBD +:103760000044004070B5304C40F2255631462046AA +:1037700000F02BF92D4D88B1204600F0B3F96A8A8C +:10378000C0B2FE2A04D22A498854521C6A8201E03F +:10379000002068823146204600F0C5F840F22446F9 +:1037A0003146204600F011F940B1204600F09AF968 +:1037B000012068703146204600F0B5F840F22665D9 +:1037C0002946204600F001F918B12946204600F0AC +:1037D000AAF80821204600F0F1F8012806D10821B6 +:1037E000204600F09DF8204600F07CF90421204698 +:1037F00000F0E4F8012806D10421204600F090F8FA +:10380000204600F06FF90221204600F0D7F8012889 +:1038100008D10221204600F083F82046BDE8704020 +:1038200000F060B970BD0000004400407C0700203B +:103830001831002070B5314C40F2255631462046F3 +:1038400000F0C3F82E4D98B1204600F04BF9EA8AFB +:103850000021C0B2C82A04D22A4B9854521CEA82D2 +:1038600000E0E982A982A9703146204600F05BF8A9 +:1038700040F224463146204600F0A7F840B12046E9 +:1038800000F030F90120A8703146204600F04BF8D6 +:1038900040F226652946204600F097F818B12946DF +:1038A000204600F040F80821204600F087F8012863 +:1038B00006D10821204600F033F8204600F012F926 +:1038C0000421204600F07AF8012806D10421204680 +:1038D00000F026F8204600F005F90221204600F00D +:1038E0006DF8012808D10221204600F019F8204681 +:1038F000BDE8704000F0F6B870BD00000048004020 +:103900007C0700201632002010B5044C01462046EA +:1039100000F0ECF820880006FCD510BD00500040F7 +:10392000C943018070470A0A01219140C9430180BF +:1039300070470029818902D041F4005101E021F44F +:103940000051818170470000174910B588420AD1A3 +:1039500001218C032046FCF72FFD2046BDE81040D6 +:103960000021FCF729BD1149884202D101214C04F4 +:1039700010E00F49884202D101218C040AE00D4970 +:10398000884202D10121CC0404E00B4988420AD1CB +:1039900001210C052046FCF7F7FC2046BDE810404D +:1039A0000021FCF7F1BC10BD00380140004400408C +:1039B00000480040004C00400050004002460020FB +:1039C00012880A4200D00120704770B501F01F052F +:1039D00001260024C1F3421306FA05F2012B0FD091 +:1039E000022B0FD0838A4FEA11210088134206FA76 +:1039F00001F600EA060001D000B10124204670BDA6 +:103A00008389F0E7038AEEE710B5C1F3421301F0B2 +:103A10001F040121A140012B07D0022B07D0143035 +:103A2000002A026805D00A4304E00C30F8E71030A1 +:103A3000F6E78A43026010BD30B50446008A85B0BF +:103A40000D464CF6FF710840E98801432182A089A8 +:103A50004EF6F3110840A9882A8911436A89024366 +:103A60001143A181A08A4FF6FF410840A989014373 +:103A7000A1826846FCF7B2FC1948844201D1039840 +:103A800000E00298A189090400EBC00101EB0010DD +:103A9000296801D5490000E08900B0FBF1F06422FB +:103AA000B0FBF2F109010B096FF018056B4300EB55 +:103AB0008300A3891D044FF0320306D503EBC00039 +:103AC000B0FBF2F000F0070005E003EB0010B0FBE4 +:103AD000F2F000F00F000843208105B030BD000077 +:103AE000003801408088C0F308007047C1F3080126 +:103AF0008180704700F008B900F088B90448008858 +:103B0000034A0449121F128842EA00408860704745 +:103B1000BC6C0040F406002004F089BD04F0C0BD78 +:103B20000A494FF0E022486818B99069084B584399 +:103B30004860926943F2856302441844486091B238 +:103B400000EB800041EA004070470000F4060020CE +:103B50000DE37A0570470000034900200978C90782 +:103B600000D00120704700009E060020034900207D +:103B70000978890700D50120704700009E060020C3 +:103B80000FB41FB50DF12301069800909DF8222077 +:103B90008DF804200DF10500F4F7F6FA9DE80F000A +:103BA00000F082F91FBC5DF814FB0FB585B0002052 +:103BB0008DF808009DF8182005998DF80A200091CD +:103BC0008DF809000DF119010DF10B00F4F7DCFA85 +:103BD000684603F06BF909B000BD0000074810B556 +:103BE0000178002909D101210170FBF7C9FCF9F71F +:103BF00009FABDE81040F9F719BB10BDF406002022 +:103C000070B5FAF77FFC2B4D01462B482A78F4F764 +:103C1000BBFA2948697A8830F4F7CFFA2648297A1E +:103C20007A30F4F7CAFA2448A9795930F4F7C5FA7A +:103C300022482A7881682048F4F7A6FA1E4C01260B +:103C400004F1250084F82260AA781DA18B34F4F7D2 +:103C50009BFA2A791EA1A4F14500F4F795FAEA79B6 +:103C60001CA1A4F11F00F4F78FFAEA781DA1A4F1BA +:103C70005700F4F789FA6A791FA1A4F14000F4F71C +:103C800083FAE6705E2020710020E071C821217265 +:103C9000E07282212173E0733C2020747820E0746C +:103CA0002820A0757D206076872020778C20E07703 +:103CB00070BD00000ABA010848170020F406002071 +:103CC000383037303030383834414120200000005F +:103CD0004A374B0030312E30302E3031202020201A +:103CE0000000000030312E30302E303320202020D4 +:103CF00020202020000000003132333435363738A0 +:103D0000393031320000000070B5F8F7AFFA394CA5 +:103D1000217860F30001384821700078022803D22E +:103D200041F00200207006E021F00200207002D96C +:103D300040F0040001E000F0FB00207021782F48E3 +:103D40004FF0000262F3041162F3451190F82B006A +:103D500021F0C0012170617862F3000121F00201BD +:103D600060F3820162F3C30162F304116170A07811 +:103D700020F00400A0704FF0010002F017FF204D6A +:103D8000E07095F8B900C0F341102071D5F8B50086 +:103D9000010F6171010DA171000BE07195F8C60072 +:103DA000207295F8C500607295F8C400A07295F86D +:103DB000C300E07295F8C200207395F8C1006073EB +:103DC000B5F8C900A935010AA173E0730D480E4981 +:103DD0004069F4F784FAF4F7E2FC207435F8A10C9A +:103DE0000521B0FBF1F2B0FBF1F0120A6274A0748D +:103DF00070BD0000F5170020E60400203A2A0020DC +:103E0000FC0D0020E8160020000020412DE9F041C3 +:103E1000214C0127207820B9FFF7F2FEFEF78CFF36 +:103E200027701E4D0026287890B1A87F18B1401E3B +:103E3000A877BDE8F0812E70BFF34F8F184908684E +:103E4000184A00F4E06010430860BFF34F8FFEE7AC +:103E50006088401C80B26080022807D36680FEF72D +:103E600059FFEF716E7600F055F8E680A088401C8F +:103E70000004000CA08004D0A680FEF73BFFFAF7F8 +:103E800049FEFEF711FDFAF71DFDF8F7BBF8BDE896 +:103E9000F041FEF74FBF0000080700205027002028 +:103EA0000CED00E00400FA050FB40098A0F5E06105 +:103EB000DF3907D0A0F5E061853903D080B204B0C6 +:103EC00000F04CB812480188322901D3002101804A +:103ED0000288009900EB0212516002889DF80410DC +:103EE00000EB0212117202889DF80D1000EB021215 +:103EF00051740188DDF8052000EB011141F8092F0C +:103F0000DDF809204A600188491C018004B070472F +:103F1000F82300202DE9F0410D4C00260D4F0E4DE9 +:103F200010E0322800D366806088387004EB0010FF +:103F3000001D0FC8FBF7A8FB6088401C6080286844 +:103F4000401C2860218860888142EAD1BDE8F08168 +:103F5000F823002000070020040700200849097802 +:103F6000C9070CD0B0F58E6F09D10548801D0168D6 +:103F700021F40031016002490020891F0881704747 +:103F80009E0600202DE9FE4F14460D460746FBF71E +:103F900041F8DFF894C2A54E002F59D0012F7DD1F2 +:103FA0006046C07A002879D12878D5F8011040EA17 +:103FB00001207061F6F722F8FBF72CF822469CA04E +:103FC000716900F0B3FBD6E90501814267D0B061A9 +:103FD000F169A4F10D0B01EB0B03C3F30A02D90A3B +:103FE00099A0F36100F0A2FBFAF72AF8318CF0698E +:103FF000DFF88492B1EBD02F0BD0C10A4844C70A36 +:104000003184FF0239469DA000F090FB3846F9F755 +:104010009BFF4FEAEB710BEB9170C0F387082F1DEC +:10402000A007B0F1804F0CD09BA000F07FFB2819B7 +:104030000322FF210938F4F7B9F808F1010000F074 +:10404000FF087A480024426AC1699144416271E0E4 +:104050002C7934706A797270D5F806004FF6FF78C3 +:1040600000BA20F0FF03687A0343736068893081E7 +:10407000297BD5F80D7041EA0721F1602D8A358240 +:104080004FF0FF37B7610027F7617762A6F820800D +:104090008CF80B708DE82300214601E042E0BFE080 +:1040A00083A000F043FB3089328AF1688DE8070075 +:1040B000727831788D48736800F038FBBDE8FE4FA8 +:1040C000F5F7CEBF002657F824104846F9F790FFC1 +:1040D000042808D0761CF6B2032EF4D3494684A0F7 +:1040E00000F024FB1BE0D9F800A01CB1A8F10100EE +:1040F000844206DB57F824205346494685A000F049 +:1041000015FB57F8241051450ED08AA000F00EFB85 +:1041100057F82420534649467EA000F007FB424949 +:104120000120C872BDE8FE8F09F10409032E03D2F5 +:10413000641CE4B24445C5D3FAF76CFF3A4E1FFA4B +:104140008BF1281D728CF6F76BFA384D708402469D +:10415000298981A000F0EAFAFAF75CFFE96868694A +:1041600088425BD12889728C904204D0BDE8FE4F12 +:1041700082A000F0DBBA0024A8468AA000F0D6FA9C +:10418000914D2846F9F7E0FE904F28463946F9F759 +:104190002FFF042807D0641CE4B2032CF5D3294672 +:1041A0008BA000F0C3FA2C68294623463A4659A052 +:1041B00000F0BCFABC421BD1834F002445463F1D92 +:1041C00038466968F9F714FF042807D0641CE4B284 +:1041D000032CF5D3394687A000F0A8FA3C6839468D +:1041E00023468EA06A6800F0A1FA6868A04202D057 +:1041F0000120F07296E7FAF70DFFF5F7FFFE90A0A9 +:1042000000F094FABFF34F8F98490868984A00F479 +:10421000E06010430860BFF34F8FFEE7F9F7C6FE7A +:10422000BDE8FE4FFAF7F6BE7C07002028300020DC +:104230000A0D43757272204261673A25642C206C26 +:10424000656E2025640A0D0057726974652D6164DE +:1042500064723A20736563746F722025642C2C6F2E +:104260006666736574202564202C7265636C656EC8 +:10427000202530640D0A00000060020834344375C4 +:1042800072722045726173652D2D616464723A20EB +:104290002530780D0A0000000A0D6C6173742D2D15 +:1042A0002D2D2D626167212121212121210A0D005F +:1042B0000D0A3636365570642D2D747970653A25A1 +:1042C00064202C7665723A25642C54627974653AC0 +:1042D00025642C204372633A25642C5061673A258B +:1042E000642C506C656E3A25640D0A0020C50108E7 +:1042F000213232212121212121212121577269746A +:10430000652D4661696C2D616464723A20253078B0 +:104310000D0A000061646472202530782C2C5772DD +:10432000697465202530782C2C72656164202530F5 +:10433000780D0A000A0D207265616476616C202197 +:104340003D20557064646174615B695D29212121A0 +:1043500021210A0D00000000313232557064486599 +:1043600061642E46696C654372633D2530782C5438 +:104370004372633D2530780D0A0000005570644893 +:104380006561642E46696C6543726320213D20544B +:10439000437263202121212072657475726E210D94 +:1043A0000A0000002121217570642D696E666F215D +:1043B000212057726974652D746F747061672025B0 +:1043C00064200D0A00000000005802084433221146 +:1043D00055706444617461466C616721205772694D +:1043E00074652D4661696C2D616464723A202530D4 +:1043F000780D0A002121217570642D696E666F2188 +:10440000212057726974652D4661696C2D61646461 +:10441000723A202530780D0A000000003161646492 +:1044200072202530782C2C577269746520253078DD +:104430002C2C72656164202530780D0A0000000084 +:1044400032327570642D616C6C20777269746520EE +:104450004F4F4B4B2121726573746172742121217E +:1044600021212121212121210D0A00000CED00E054 +:104470000400FA0530B50D46094CC1B041F20D01FA +:10448000A4F8051001462A46E01DF3F77DFE65807D +:1044900040AA69462046F8F78DFE41B030BD0000C5 +:1044A0006E34002010B598B0142112A8F3F785FEE1 +:1044B0005A208DF8000001208DF8010088208DF829 +:1044C0000200184C02208DF80300B4F80100010A24 +:1044D0008DF804108DF8050006216846F7F7C2FA3A +:1044E0009DF80320ADF84400694612A8121DF3F7A9 +:1044F0004BFEBDF844009DF8031013AA030A8B5429 +:10450000521C8854B4F8190042F21072904202D240 +:10451000401CA4F8190012A8891DFCF721F818B056 +:1045200010BD000000170020FEE700002DE9F0415B +:10453000204C0027A078B0B1012824D1A7701E49D3 +:104540006069F3F7CCFEF4F776F91C4A1C4BF3F7DD +:1045500042FFF4F79BF91B491B4A48611B499042F3 +:1045600025DA0C2024E01348E578C668142D0CD217 +:1045700014480C38C088F4F7D6F83146F3F757FEE4 +:104580006D1CE060E570BDE8F08111493046F3F73D +:10459000D8FE6FF00B01F3F712FF0E49F3F79FFE01 +:1045A000C4E90470E760E7700120A070EBE7182011 +:1045B0000870E8E7F4040020000030419A999999C6 +:1045C0009999D93FE8160020000070413A2A00204E +:1045D0000000A041CDCC4C40F0B593B00F4606464C +:1045E0000024254634221D496846F3F7CDFD1422E8 +:1045F0001BA10DA8F3F7C8FD6A46315DA1F161006A +:10460000192801D8203906E0A1F14100192803D961 +:10461000303909291FD8C9B2A1F1410019280AD897 +:10462000002012F810308B4202D102EB4001497891 +:10463000401C1A28F5D30DA8005D641C01FB005531 +:10464000112CDAD30B20B5FBF0F100FB11503870C0 +:10465000012013B0F0BD4FF0FF30FAE7B0B1010810 +:10466000080706050403020A0009080706050403F3 +:104670000200000007490020086007490878401C34 +:10468000C0B208701E2803D802497F20083908608C +:1046900070470000082C00405402002043E0322103 +:1046A00000BF00BF00BF00BF00BF00BF00BF00BF12 +:1046B00000BF00BF00BF00BF00BF00BF00BF00BF02 +:1046C00000BF00BF00BF00BF00BF00BF00BF00BFF2 +:1046D00000BF00BF00BF00BF00BF00BF00BF00BFE2 +:1046E00000BF00BF00BF00BF00BF00BF00BF00BFD2 +:1046F00000BF00BF00BF00BF00BF00BF00BF00BFC2 +:1047000000BF00BF00BF00BF00BF00BF00BF00BFB1 +:1047100000BF00BF00BF00BF00BF491E11F0FF0176 +:10472000BED1401EC0B20028B9D170470FB4054BAE +:1047300010B503A9044A029800F0EEF810BC5DF829 +:1047400014FB000085870108100B00200FB4084BF4 +:1047500010B504A902AA039800F0DEF8044602A9E5 +:10476000002000F070FC204610BC5DF814FB000037 +:104770004750010802E008C8121F08C1002AFAD1F8 +:1047800070477047002001E001C1121F002AFBD1D1 +:10479000704700002DE9FF5F82B00021DDE90430A1 +:1047A000020DDDF840B0034318D044F61050A2F2D9 +:1047B000FF3242431514119801281FD0A5EB0B00BE +:1047C000401C5FEA000A4FF000064E4FDFF83891B8 +:1047D000B046504615D5CAF1000413E011980124E3 +:1047E0004AA3012801D16FEA0B010298119AC0E98E +:1047F0000031C0E9024206B0BDE8F09FCBF10000F5 +:10480000DFE704460021404A491842EB0450CDE955 +:10481000001012E0E00707D032463B4640464946CA +:10482000F3F780FE8046894632463B4610461946DD +:10483000F3F778FE06460F466410002CEAD1DDE956 +:104840000401DDE90023BAF1000F06DAF3F76AFE8E +:1048500042464B46F3F766FE05E0F3F7D5FE4246C7 +:104860004B46F3F7D1FE04460E460022284BF3F7E1 +:10487000F5FF03D84FF0FF30014607E00022254B3B +:1048800020463146F3F7A7FDF4F73CF9102409E080 +:10489000002C0ADB0A220023F4F73EF8039B303297 +:1048A0001A55641E50EA0102F2D1641C039AC4F145 +:1048B00011031444119A012A03D0012208430DD197 +:1048C0000AE0084304D000204FF0110B119072E76A +:1048D000A3EB0B056D1E0DE05B4504DD4FF0000200 +:1048E00005F1010504E003DA4FF00002A5F101052E +:1048F000002AECD002981199C0E90231C0E90045C4 +:1049000079E70000000014400000F03F3000000094 +:104910000000F0430000E03F2DE9FF4F95B09B46BB +:104920008946064600250FE2252877D10024274630 +:10493000F84A0121059400E0044316F8013F203BAA +:1049400001FA03F01042F7D130782A2811D06FF025 +:104950002F033078A0F13002092A16D8059A44F0C6 +:10496000020402EB820203EB42021044761C059023 +:10497000EFE759F8042B0592002A03DA504244F479 +:104980000054059044F00204761C30782E2816D18D +:1049900016F8010F44F004042A280DD06FF02F02FE +:1049A0003078A0F13003092B09D807EB870302EB1D +:1049B0004303C718761CF3E759F8047B761C30785C +:1049C0006C280FD006DC4C2817D068280DD06A2838 +:1049D00014D104E0742810D07A280FD10DE044F4EB +:1049E00000140AE044F4801401E044F440147278A6 +:1049F000824202D104F58014761C761C3078662839 +:104A00000BD013DC582877D009DC002875D0452856 +:104A1000F6D04628F4D047281AD19DE118E0632843 +:104A200035D0642879D0652812D195E1702873D0EB +:104A300008DC6728F1D069286FD06E280DD06F2868 +:104A400006D1B5E073282CD0752875D0782874D09D +:104A50005A46179990476D1C75E1C4F3025002281D +:104A600009D003280DD0D9F8001004280DD00D600E +:104A700009F1040967E1D9F80010EA17C1E9005209 +:104A8000F6E7D9F800100D80F2E70D70F0E719F89D +:104A9000041B8DF8001000208DF80100EA4601206B +:104AA00003E059F804AB4FF0FF3061074FF000010D +:104AB00002D40DE008F101018846B9420FDA8045C1 +:104AC000F8DB1AF808100029F4D108E008F1010118 +:104AD00088468142FADB1AF808100029F6D10598B9 +:104AE0005B46A0EB080721463846179A00F094FA77 +:104AF000284400EB080507E04DE029E10DE01AF835 +:104B0000010B5A4617999047B8F10108F7D25B4656 +:104B100021463846179A13E142E00A220092C4F374 +:104B200002524FF0000A022A08D059F804CB032A97 +:104B30004FEAEC710AD00DE029E02AE009F1070103 +:104B400021F00702F2E802C1914609E00FFA8CFC5D +:104B50004FEAEC71042A03D14FFA8CFC4FEAEC7156 +:104B6000002907DA0A460021DCF1000C61EB0201A2 +:104B70002D2202E0220504D52B228DF804200122EB +:104B800003E0E20701D02022F7E7904659E00A212E +:104B900002E010220DE010214FF0000A00910BE01E +:104BA00010224FF0000A44F004040827009203E0AA +:104BB00008224FF0000A0092C4F30252022A05D0E4 +:104BC00059F804CB0021032A08D009E009F10701B4 +:104BD00021F00702F2E802C1914605E01FFA8CFCC1 +:104BE000042A01D10CF0FF0C4FF00008220728D551 +:104BF000702806D0009B83F0100353EA0A0305D007 +:104C00000EE040228DF80420012208E05CEA010257 +:104C100006D030228DF804208DF80500022290463F +:104C2000009B83F0080353EA0A030AD15CEA0102FD +:104C300001D1620705D530228DF804204FF001081C +:104C40007F1E582804D034A003900EA802900DE0D7 +:104C500036A0F9E753466046009AF3F75DFE8446B6 +:104C60000398825C0298401E029002705CEA010088 +:104C7000F0D1029806A9081A00F1200A600702D5AF +:104C800024F4803400E00127574502DDA7EB0A0039 +:104C900000E0002000EB0A01009005984144401A12 +:104CA0000590E00306D45B462146179A059800F06C +:104CB000B3F90544002706E001A85A46C05D1799DC +:104CC00090476D1C7F1C4745F6DBE0030CD55B4627 +:104CD0002146179A059800F09FF9054404E030201A +:104CE0005A46179990476D1C0099481E009000295C +:104CF000F5DC08E0029802995A460078491C0291B6 +:104D0000179990476D1CBAF10001AAF1010AF1DC74 +:104D100065E100000928010030313233343536377F +:104D200038396162636465660000000030313233F7 +:104D30003435363738394142434445460000000097 +:104D400000F058F90544761C307800287FF4ECAD6B +:104D500019B02846BDE8F08F620700D4062709F194 +:104D6000070222F0070CFCE80223E14603F00048AA +:104D70005FEA080C02D00FF2702C0DE05FEA045CD1 +:104D800002D50FF2682C07E05FEAC47C02D00FF274 +:104D9000602C01E0AFF2700C4FF0FF3823F00043BD +:104DA000CDF850C065280CD006DC452809D046282F +:104DB0001DD047283DD13DE0662818D067287ED118 +:104DC00038E00021112F01DB112000E0781CCDE933 +:104DD000000106A90EA8FFF7DDFCDDE90F010E9A20 +:104DE00003910021009207F1010A04914DE04FF078 +:104DF00000400097CDE9011006A90EA8FFF7CAFCF4 +:104E0000DDE90F0203920E9B11990022DDF80CA040 +:104E10000093049211B9791C00EB010AB7EB0A0068 +:104E200004D4C0F1FF3007F1010A0490AAEB070097 +:104E3000019044E0012F00DA01270021112F01DD4C +:104E4000112000E03846CDE9000106A90EA8FFF7C1 +:104E5000A1FCDDE90F010E9A03910021049100925B +:104E6000BA4621070CD40399514500DA8A46BAF1B3 +:104E7000010F05DD009AAAF10101515C302908D02B +:104E8000B84202DA10F1040F06DA0121CDE901106F +:104E900015E0AAF10101E9E7002805DC04990144C5 +:104EA0000491AAEB000102E0411C514500DD8A4655 +:104EB0000499401A401C01904FF0004002902007D6 +:104EC00004D40198504501DBCDF8048000208DF812 +:104ED0004F0002980DF14F07B0F1004F25D02B2065 +:104EE0000E9002984FF0020800280CDA404202901F +:104EF0002D200E9007E00A210298F3F7F7FC3031DD +:104F0000029007F8011DB8F10001A8F10108F2DCD8 +:104F100002980028EFD1791E0E980870307800F0C2 +:104F2000200040F0450007F8020D12A8C01B00F158 +:104F300007081498007800B1012000EB0A010198DD +:104F400001EBE07105984144401A401E0590E003D2 +:104F500006D45B462146179A059800F05DF8054493 +:104F60001498007818B15A46179990476D1CE003C1 +:104F700024D55B462146179A059800F04DF8054464 +:104F80001CE00498002807DBDDE90301884203DD0B +:104F90000098405C179901E0179930205A469047D5 +:104FA000049805F10105401C04900198401E0190F1 +:104FB00004D12E205A46179990476D1CBAF1000172 +:104FC000AAF1010ADDDC05E017F8010B5A46179932 +:104FD00090476D1CB8F10001A8F10108F4DC5B46B4 +:104FE0002146179A0598ABE62D0000002B00000023 +:104FF000200000002DE9F041044600251E4617461A +:10500000880404D405E039462020B0476D1C641E96 +:10501000F9D52846BDE8F0812DE9F0410446002588 +:105020001E469046C80301D5302700E0202788049B +:1050300004D505E041463846B0476D1C641EF9D5DD +:105040002846BDE8F0810A68531C0B601070704759 +:1050500070B58CB001F021FE0026304D27E09DF8A0 +:105060002C3008AA03A80A99F6F746F92C498DF8BE +:105070001F6001208870079803AC009094E80F002F +:1050800000F010FE012810D12448142203A914387E +:10509000F3F77AF82248801CCDE901601F481438E4 +:1050A000016900910FC800F0B3FDF9F7B3FF6C6818 +:1050B0003CB30BAB08AA0AA90020A0470028CED118 +:1050C0001FE09DF82C3008AA03A80A99F6F714F9F6 +:1050D0008DF81F60FEF740FD30B1079803AC0090DB +:1050E00094E80F0000F0E8FC079803AC009094E807 +:1050F0000F00FEF745FD142103A8F3F75EF8F9F75A +:1051000089FFEC6934B10BAB08AA0AA90120A047BA +:105110000028D6D101F0E2FC0CB070BD440F002095 +:10512000DC03002070B520211B48F3F746F81A482D +:1051300030213038F3F741F801F0A8FDF9F7B0FF5E +:10514000F9F7E4FF144A1549303A0020FAF704F859 +:1051500010B113A0FFF7EAFA0F4A1049183A343990 +:105160000120F9F7F9FF10B113A0FFF7DFFA0A4D9C +:10517000303DEC6824B100231A4619461846A04772 +:105180006C6A24B100231A4619460120A047BDE8E5 +:10519000704000F0F9B90000740F0020780400207E +:1051A00063616E3120D0ADD2E9B3F5CABCBBAFB3F9 +:1051B000C9B9A60D0A00000063616E3220D0ADD2DD +:1051C000E9B3F5CABCBBAFB3C9B9A60D0A0000006C +:1051D00010B54FF480710C48F9F7BCF888B14FF462 +:1051E00000710A48F9F7B6F858B109480078022862 +:1051F00007D0032805D0042803D0064800780028EB +:1052000000D0012010BD0000000801400010014046 +:1052100059020020AC04002010B54FF4007104487E +:10522000F9F798F808B1002010BD012010BD00006A +:105230000010014003480078032801D00020704787 +:1052400001207047940F0020704700002DE9F041C5 +:10525000CA4C00252746207807F1200618374FF45E +:10526000FA6806287ED2DFE800F00305679EFDFCA1 +:1052700001207DE1A07820F0B000A070C048417806 +:10528000F9B956214170F7F725F8032821D0F7F72F +:1052900021F8F0B1F7F71EF8002812DDF7F71AF839 +:1052A00003280EDA022000F0B1FA607820F0030043 +:1052B0006070A07840F08000A07000F05FFA00F00D +:1052C00099FAB0480078012809D0FFF7A5FF40B14E +:1052D00018E0052000F09AFA00F092FAF1E70520B4 +:1052E000CBE0FFF775FF68B1022000F08FFA60781D +:1052F00020F003006070A07840F08000A07000F003 +:105300003DFA15E0FFF764FF58B900F043F90028B3 +:1053100028D0607C002825D0607A00F003000228A5 +:1053200020D0607820F003006070032000F06EFA57 +:10533000BDE8F04100F05EBAFFF76EFF10B100F07B +:1053400029F970B9A06920B141463846FDF7FAF94C +:1053500038B9607C002805D0607A00F0030001288D +:1053600000D100E0E6E06574032000F04FFA00F0A1 +:1053700041FAFFF751FF68B100F00CF950B1607CC1 +:1053800040B1607A00F00300022803D0607820F07A +:10539000030003E0607820F00300401C6070BDE86B +:1053A000F04100F0EBB9FFF737FF0028607C18D020 +:1053B00018B1607AC043800709D0A06978B341462C +:1053C0003846FDF7BFF950B3FFF702FF38B36574F5 +:1053D00000F010FA6078C143890720D040F0030044 +:1053E0001AE020B1607A00F00300012809D0A0691A +:1053F000A8B141463846FDF7A5F980B1FFF7E8FEB0 +:1054000068B1657400F0F6F9607800F003010129D5 +:1054100005D020F00300401C607000F0AFF9FFF7EA +:10542000D7FE30B9A06920B141463846FDF78AF968 +:1054300038B9607C00287DD0607A00F00300022833 +:1054400078D16574042000F0E1F9A07820F03000F4 +:105450001030A07000F092F93046BDE8F041002114 +:1054600001E044E001E0FDF76DB9206A58B1642124 +:105470003046FDF767F930B1012000F0C7F9BDE80B +:10548000F04100F0BDB9607C10B1607A80070FD0A8 +:10549000FFF79EFE10B1FFF7BFFE48B100F07AF8AB +:1054A00090B1607C80B1607A00F0030002280BD0DC +:1054B0006574607820F00300607000F09BF9A078BC +:1054C00020F03000A07050E0FFF7A6FE002853D077 +:1054D000FFF77EFE00284FD000F08CF9607840F096 +:1054E00003006070A07820F03000A07026E0E06932 +:1054F00038B1224841461C30FDF724F900287FF4DA +:10550000B7AE607C20B1607A00F00300012819D0AA +:10551000FFF782FED8B1FFF75BFEC0B1607C20B11F +:10552000607A00F0030001280CD0607840F003009E +:10553000607000E020E0657400F05CF900F01EF996 +:10554000032015E0607820F00300401CF0E7FFF72F +:1055500063FE002810D1FFF73BFE00280CD000F0BE +:1055600049F9607820F00300607000F007F902202C +:10557000BDE8F04100F04AB9BDE8F081940F002089 +:10558000AC040020E504002024210148F2F715BEF8 +:10559000940F002010B54FF480710948F8F7DAFE37 +:1055A00058B14FF400710748F8F7D4FE28B1F6F768 +:1055B00087FE401C01D0002010BD012010BD00005E +:1055C00000080140001001401CB51B4C1B4821780D +:1055D00050F821201AA0FFF7A9F8A07AC0F3011211 +:1055E00000F00F01CDE90012617AC20901F0030356 +:1055F000617C1748FFF79AF8A078C0F30111009179 +:10560000617800F00F0301F00302C10911A0FFF758 +:105610008DF818341FA094E80E00FFF787F8FFF705 +:10562000D7FD0446FFF7F8FD02B022460146BDE86B +:10563000104021A0FFF77AB8940F0020B00400209A +:105640007374617475733A2564282573290D0A00F3 +:1056500084C201086E6D5F6672616D653A20414CCF +:105660003A2564204E6574776F726B436F6D6D6180 +:105670006E643A256420636F756E7465723A2564B2 +:1056800020636F6E74726F6C5F7374733A25640D70 +:105690000A00000073615F7469636B3A202564201F +:1056A00074315F7469636B3A25642074325F746986 +:1056B000636B3A25640D0A006170705F71697275E1 +:1056C000695F6E6D5F6163635F6F6E5F6368656383 +:1056D0006B3A202564206170705F71697275695F33 +:1056E0006E6D5F414C5F636865636B3A25640D0ABC +:1056F0000000000070B51F4C40F212600026C4E9A3 +:105700000006267266720220A072FAF721FB1A4D7B +:1057100018B1A87820F00F00A870FFF759FD0028F5 +:10572000A87802D040F0800001E020F08000A8704E +:1057300055F8010F44F80B0F6868606003F02EFD08 +:105740000D4D243570B16C68142C0BD204EB840021 +:1057500005EB8001142207480831F2F715FD641C9F +:105760006C6001E02E606E60BDE87040014801F0A1 +:105770009DBB00002C0C0020940F002070B51B4C2A +:1057800040F212602060002060602072607202208F +:10579000A072FAF7DDFA164D18B1A87820F00F00C4 +:1057A000A870FFF715FD0028A87802D040F080000F +:1057B00001E020F08000A87055F8010F44F80B0FAD +:1057C000686860600A4C2434206814280BD200EB0F +:1057D000800004EB8000142204490830F2F7D4FC66 +:1057E0002068401C00E01420206070BD2C0C0020BC +:1057F000940F002000210148FCF7A4BFAC0F00204B +:1058000000210148FCF79EBFB00F002038B50446C8 +:105810000648074D234650F824100091297850F887 +:10582000212004A0FEF782FF2C7038BDB0040020B8 +:10583000940F002063616E206E6D3A202564282548 +:105840007329202D2D203E202564282573290D0A3B +:105850000000000010B5194C6072A172002104F123 +:105860001400FCF76FFF01206074A07AA17860F348 +:105870000301A170A06968B140F2145104F118004D +:10588000FCF760FF30B1607A00F00300022801D01D +:10589000FFF774FF6078617A00F0030001F0030104 +:1058A000884201D0FFF7D2FC607A00F003000128A3 +:1058B00003D1BDE81040FFF79DBF10BD940F00203D +:1058C00030B5164BA1B041F20B01154D0020A3F8E5 +:1058D000051003F2EA2405EB400100EB40022244EC +:1058E000B1F84010A2F81F1003EB4002401CD17128 +:1058F000090A80B211722828EDD30A495020588035 +:10590000087C401C087408A0FEF710FF20AA694616 +:105910000248F7F74FFC21B030BD00006E34002084 +:10592000FC0D0020F435002053656E642063656C27 +:105930006C2074656D70200A0D00000010B5244ABB +:10594000A2B041F20C01A2F8051002F2EA21214CAA +:1059500091F89730002023F003035B1C23F0C00371 +:1059600081F8973091F8983094F82A4023F01F037B +:10597000240964F3451381F898300023A1F8993085 +:10598000A1F89B3091F89D3023F0FF0381F89D3002 +:1059900091F89E3023F01F0381F89E300B181418E5 +:1059A000401C93F8973080B2E3710828F6D30820A2 +:1059B00050800948017C491C017408A0FEF7B6FE1E +:1059C00020AA69460248F7F7F5FB22B010BD000097 +:1059D0006E340020FC0D0020F435002073656E64E9 +:1059E00020626D735F73746174655F696E666F0AC0 +:1059F0000D00000030B5284AA1B041F20A01002094 +:105A0000A2F80510FF2302F2EA2100EB40040C4447 +:105A1000401C80B284F821302828F6D31F4C002087 +:105A2000A47E2834E4B200EB40050D44401C80B253 +:105A300085F821400828F6D3002000EB40040C44F0 +:105A4000401C80B284F839300828F6D3002000EBDF +:105A500040040C44401C80B284F851300828F6D32E +:105A6000002000EB400314180B44401C93F8213035 +:105A700080B2E3712828F4D3094928205080087C9B +:105A8000401C087407A0FEF751FE20AA6946024890 +:105A9000F7F790FB21B030BD6E340020FC0D0020E4 +:105AA000F435002053656E642063656C6C2074656A +:105AB0006D70200A0D0000000FB414222DE9F0478C +:105AC00008A94E48F2F760FB4C4E4FF4C0613068B5 +:105AD000A0F58062693A58D0A0F580626A3A54D045 +:105AE000A0F580626B3A50D0A0F580626C3A4CD041 +:105AF000A0F580626D3A48D0A0F580626E3A44D03D +:105B0000A0F580626F3A40D0B0F58E6F46D0B0F508 +:105B1000A86F43D0A0F5A062413A36D0A0F5A062AC +:105B2000423A32D0A0F5A062433A2ED0A0F5A0624E +:105B3000443A2AD0A0F5A062453A26D0A0F5A0624A +:105B4000463A22D0A0F5A062473A1ED0B0F5A96F20 +:105B500024D0B0F5AC6F21D0A0F5A062663A14D085 +:105B6000884214D0A0F58062033A17D0B0F5866F52 +:105B700014D0A0F54072913A07D0A0F58062173A90 +:105B800003D0B0F5807F09D033E0884206D11C49AC +:105B90000120087000211B48FCF7D4FD174914228E +:105BA00001F56A70F2F7F0FA80211748F8F7DBFB8D +:105BB000124D002405F52770DFF84880DFF84C907F +:105BC0002746048008F16008296858F8342091427B +:105BD00006D108EBC400416828468847C9F80B7015 +:105BE000641C64B21A2CEFD314210448F2F7E5FACE +:105BF0003760BDE8F00700205DF814FB600B002063 +:105C0000E5040020AC020020001001403A2A0020E8 +:105C10000FB470B5214D0A9C687814280BD200EBA4 +:105C2000800005EB8000142204A9001DF2F7ACFAF5 +:105C30006878401C6870059841F6EC4218490025C8 +:105C4000B2EB104F10D19DF81B00102804D0132880 +:105C500002D0112803D005E09DF81E0001E09DF858 +:105C60001C0088740A200EE041F6EB42B2EB104FA4 +:105C70000AD19DF81B008A7C904203D1142008654C +:105C80008D7401E032200865054800214C30FCF796 +:105C900059FD257070BC5DF814FB0000540C002009 +:105CA000580200200FB4142270B504A92748F2F757 +:105CB0006BFA264D26484FF0FF366C688461A0B21F +:105CC000A0F57441563903D0304670BC5DF814FB22 +:105CD00041F6EC41B1EB144F03D0491EB1EB144F28 +:105CE00006D11A49142201F1B800F2F74DFAEBE798 +:105CF00018498C421AD018498C4217D017498C4247 +:105D000014D017498C4211D016498C420ED0164936 +:105D10008C420BD015498C4208D015498C4205D0D5 +:105D200014498C4202D014498C420CD107491422E8 +:105D300001F1F400F2F728FA0449AA7A00230B31A2 +:105D4000204600F069FC0020BFE700004C0B00205B +:105D5000D802002056F4261856F4011856F40718F5 +:105D600056F4081856F40A1056F4121856F41D1872 +:105D700056F41F0856F41A1056F41A1810B5124C9F +:105D800012490020C4E9000104212172607205203B +:105D9000A072FF22082104F10B00F2F707FAA4F128 +:105DA0002A020223508811881371E172090AC0F592 +:105DB0007A6021736073000AA073E3732046BDE824 +:105DC000104001F053B80000180C0020F4561018D1 +:105DD0002DE9F0410546F4F7E9FB3F4C0421082288 +:105DE0000227002604F10B00012D57D0022D70D19F +:105DF0003A4BC4E9006321726672A272FF22082145 +:105E0000F2F7D4F90120A4F13705E0722888207355 +:105E1000000A60736888C0F57A60A073000AE073B6 +:105E2000A8882074000A6074A879A074204601F044 +:105E30001DF80320F7F747FAE772E8882849000AB7 +:105E40002073287A6073A4F12A0040F6C313C07A45 +:105E500000EB80004000A5F80900A073000AE07381 +:105E6000B1F8A600A0F2E9329A4211D31D4840F2DF +:105E7000A363B0F84200A0F209729A4208D3B1F8C5 +:105E80008E01A0F6F121B1F5957F01D940F6B83029 +:105E9000A5F80B0080B22074000A13E0124BC4E98D +:105EA000006321726672A272FF220821F2F77EF966 +:105EB0001020E0720D2020736673A773FF20E0733B +:105EC000267406206074A674BDE8F041024800F014 +:105ED000CDBFBDE8F0810000180C0020F456EB1C8B +:105EE0008C2A002058020020F456EC1C2DE9F041C9 +:105EF00003463C4C042108220226002504F10B0035 +:105F0000012B19D0022B6AD1374BC4E900532172FF +:105F10006572A272FF220821F2F748F90120E072AF +:105F200032483349334A4068A4F12A070144914278 +:105F300018D2F2F734FC23E02F4BC4E9005321724E +:105F40006572A272FF220821F2F730F91020E07288 +:105F5000092020736573A673FF20E0732574112058 +:105F6000607436E01F482549A438B0F81B00B0F52E +:105F7000FA6F03D9B1F85920904201D3B1F88300E8 +:105F8000A7F8050037F8050F2073000A60737888BA +:105F9000C0F57A60A073000AE073124837380088B1 +:105FA000643840F48050B8802074000A6074B87976 +:105FB000A0740C4800F05AFF0320F7F784F9E6724A +:105FC000B7F807002073000A6073A573E5732574A2 +:105FD0006574A574BDE8F041024800F047BFBDE814 +:105FE000F0810000180C0020F456EB1CE81600208D +:105FF000FFFF1EBBFFBF7900F456EC1C8C2A00206B +:1060000070B50C4C05460C490020C4E90001042180 +:10601000217260720220A072FF22082104F10B009D +:10602000F2F7C4F8E572280A20732046BDE87040F4 +:1060300000F01CBF180C0020F45627182DE9F04F73 +:1060400085B0054614216846F2F7B7F8764C08216A +:1060500002270026042204F10B004FF0100B4FF032 +:106060000709012D7ED0022D7DD1704B9246C4E9E7 +:10607000006322726672A172FF22F2F797F84FF066 +:106080000108A4F1680584F80B80287820736878EB +:106090006073A878A073E878E073A8882074000A79 +:1060A0006074A879A074204600F0E0FE0320F7F7A2 +:1060B0000AF9E772E888000A2073287A6073687A20 +:1060C000A073A87AE073E87A20746674A6742046F8 +:1060D00000F0CCFE0320F7F7F6F80320E07284F816 +:1060E0000C806773287CA073687CE073A87C2074A4 +:1060F000E87C6074287DA074204600F0B7FE032081 +:10610000F7F7E1F84A4890F8870101287ED0FF228E +:1061100011216846F2F74AF884F80BA0687D2073D5 +:106120006673A6739DF80000E0739DF8010020746B +:106130009DF8020060749DF80300A0743A4800F0D6 +:1061400095FE0320F7F7BFF80520E0729DF80400E4 +:1061500020739DF8050060739DF80600A0739DF8FC +:10616000070001E040E03CE0E0739DF80800207487 +:106170009DF8090060749DF80A00A0742A4800F098 +:1061800075FE0320F7F79FF80620E0729DF80B00DC +:1061900020739DF80C0060739DF80D00A0739DF8AE +:1061A0000E00E0739DF80F0020749DF810006074DD +:1061B00084F812B01C4800F059FE0320F7F783F86A +:1061C00084F80B900A2121730B21617384F80E90DF +:1061D000E020E073FF2020746074A074124800F087 +:1061E00045FE05B0BDE8F08F124BC4E90063227292 +:1061F0006672A172FF220821F1F7D8FF84F80BB074 +:1062000031202073667384F80E9000E005E0FF20D3 +:10621000E07326746774A674E0E7034914225039CA +:106220006846F1F7B1FF77E7180C0020F456EB1C35 +:106230008C2A0020F456EC1C70B505460A4C0B481D +:106240000021C4E900100420207261720120A072B4 +:10625000FF22082104F10B00F1F7A8FFE5722046A8 +:10626000BDE8704000F002BE180C0020F456091082 +:1062700070B5144C14490020C4E9000104252572AE +:1062800060720720A072FF22082104F10B00F1F7D1 +:106290008DFF0E4801786420012911D0A4F12A0154 +:1062A000C97AE1724C2121736573B021A173E57342 +:1062B000207469206074BDE87040024800F0D6BDCB +:1062C000E072EFE7180C0020F4561C18820700203B +:1062D0002DE9F84FDFF8BC816F4A40464FF0000AC5 +:1062E000C0E900A2042288F8082088F809A0072144 +:1062F00088F80A10FF2208210B30F1F757FF674C8E +:10630000674E684DA07D684F4FF032094FF0550B36 +:10631000012842D196F8B500F2F705FA0090394607 +:10632000A868F1F784FF0099F2F7CCFA13D296F837 +:10633000B600F2F7F8F900903946A868F1F777FF50 +:106340000099F2F7C9FA06D23946A868F1F76FFF4B +:10635000F2F725FA01E096F8B50020754F4847F2AC +:106360003051A030FCF704FA01280DD1207D617D69 +:10637000884204D9411AC9B2032900D2607547483E +:106380000021A030FCF7F4F9207D322801D284F8F6 +:106390001590552801D384F815B0A07D90BB96F8D0 +:1063A000B500F2F7C0F900903946A868F1F73FFF51 +:1063B0000099F2F787FA13D296F8B600F2F7B3F91C +:1063C00000903946A868F1F732FF0099F2F784FA95 +:1063D00006D23946A868F1F72AFFF2F7E0F901E0A2 +:1063E00096F8B5002075C0B2322803D2484684F82A +:1063F000149004E0552802D9584684F814B060750A +:106400000120A07596F8B500F2F78DF9814639465E +:10641000A868F1F70CFF4946F2F754FA13D296F840 +:10642000B600F2F780F981463946A868F1F7FFFE19 +:106430004946F2F751FA06D23946A868F1F7F7FE55 +:10644000F2F7ADF901E096F8B50020751748807EA7 +:10645000411E402901D232306075052188F80B10A9 +:10646000617D0C484A1E88F80C20122288F80D2005 +:10647000891E88F80E101C2188F80F10054988F82D +:1064800010A02A39097C090188F81110BDE8F84FDD +:1064900000F0ECBC180C0020F45613185802002031 +:1064A0008C2A0020E816002000004842FC0D002045 +:1064B00070B50C4C0C480025C4E900500420207233 +:1064C0006572A072FF22082104F10B00F1F76EFE45 +:1064D0000520E07225736573A5732046BDE8704002 +:1064E00000F0C4BC180C0020F45619102DE9F05F20 +:1064F000344FDFF8CCC0344CFA8FDCF8380002F1AE +:1065000001018EB2798C314D01F101035FEA80689F +:106510004FF47A794FF0020A4FF0030B9BB213D578 +:10652000FE870A2A02D220F0200015E0B1FBF9F222 +:1065300009FB12107B8401281BD125A017E02078CD +:10654000C0BB84F800B035E05FEA406817D5FE872D +:106550000A2A04D220F04000CCF838002DE0B1FB2C +:10656000F9F209FB12107B84012802D11EA0FEF76C +:10657000DDF828780028E2D185F800A0DFE75FEA9F +:1065800000681AD5FE870A2A02D220F08000E3E7CD +:10659000207808B984F800B0287808B985F800A0F8 +:1065A000B1FBF9F209FB12107B84012802D114A07F +:1065B000FEF7BCF80020BDE8F09F0120FBE70000DB +:1065C000740B0020580200207C0700208207002066 +:1065D0005265762053746F702063616E206461741D +:1065E00061310A0D000000005265762053746F700F +:1065F0002063616E206461746120320A0D00000026 +:106600005265762053746F702063616E20646174EC +:1066100061330A0D000000002DE9F04117460C46D9 +:106620000146594A00205A4DDFF860C1C2F8070000 +:106630000126A86BA1EB0C02614551D021DC554A23 +:10664000A1EB0206914276D00ADC534A891871D038 +:10665000524AD1422FD12178A97640F0080066E055 +:106660004F49711829D0B1F5C02F24D11A463946A7 +:106670002046F5F7C9F900281DD0A86B40F00200AC +:1066800055E0B2F5202F48D0B2F5901F53D0B2F5A7 +:10669000A81F5ED0B2F5F01F0DD121463A46032F58 +:1066A00000DD03223A48F1F76FFDA86B40F480400B +:1066B000A8633C480672BDE8F0812178E9706178F2 +:1066C0002971A1786971E178A9712179E9716179FC +:1066D0002972A1796972E179A97240F0010026E07E +:1066E000218869826188A982A1884FF47A6209B2FF +:1066F000914202DDA1F57A6101E0C1F57A61E9829A +:10670000E18809B2914202DDA1F57A6101E0C1F5AB +:106710007A61298340F0040009E01A463946204690 +:10672000F5F742F90028C6D0A86B40F01000A86326 +:10673000C1E700E01AE0217805F8231F617869704D +:10674000A178A970E178E97040F02000C5F8150043 +:10675000B1E7217905F8341F61796970A179A970D1 +:10676000E179E97040F040006860A4E7217805F81D +:10677000271F61786970A178A970E178E97040F00D +:106780008000C5F8110096E73A2A002056F4081850 +:10679000740B002056F41A10AA0BE0F7000015F84D +:1067A000000019F85802002070B50F4C8318A3425E +:1067B00001D9032070BDA2B1012500230BE00478AC +:1067C0000E78A64204D0FF2C01D0022070BD002517 +:1067D000401C491C5B1C9342F1D3012D01D00120C8 +:1067E00070BD002070BD000000000208F8B5012156 +:1067F0000820F9F7D5FD03248DF8024014250F4F2A +:106800008DF803504FF48066ADF800606946384655 +:10681000F7F726FD8DF802407400ADF800408DF8C2 +:10682000035069463846F7F71BFD31463846F7F7FF +:106830009AFD21463846F7F796FDF8BD000C014059 +:1068400010B5094C8318A34202D80AB1002306E010 +:10685000012010BD10F8014B01F8014B5B1C934265 +:10686000F8D3002010BD0000000002082DE9F0411F +:1068700088460646154622492844884202D9012006 +:10688000BDE8F081C5B3E80700D0551C2A46414653 +:106890003046FFF789FF0028F2D0012080F31088EE +:1068A000F7F7CEFB3520F7F749FBF00AC002F7F700 +:1068B0004BFB07464FF47A70401E80B2FCD2002496 +:1068C0000EE008EB440118F81400497840EA012171 +:1068D0003046F7F773FB0746042804D1641CB61C46 +:1068E000B4EB550FEDD3F7F761FB002080F3108870 +:1068F000042F02D00220C3E7FFE70020C0E700001A +:106900000000020810B54FF0000140B1054C2046D0 +:10691000F4F734FF2046F4F7D9FC012010BD024CF7 +:10692000F5E70000006800400064004030B4022831 +:1069300014D20B4A00EB800302EB83021569002D91 +:106940000CD00A7A8B7A042A06D00C6801F10B026B +:106950002146AC4630BC60474C68F7E730BC704716 +:106960009811002010B530B10448F4F794FF0428C2 +:1069700000D1FF2010BD0248F7E70000006800408A +:106980000064004030B4022815D20C4A00EBC0036A +:1069900002EB83040123E2688B401A420BD09A4336 +:1069A000E260064A00EB8003483252F82320002AB6 +:1069B00001D030BC104730BC70470000501100209F +:1069C00010B518B1F4F7F6FA012010BDF4F730FE57 +:1069D000FAE7000010B5832812D10A4C207C012868 +:1069E0000ED0A4F13000C16A09B10120884701200E +:1069F000207404480021BDE810401430FBF7A2BE0B +:106A000010BD0000740F002070B5054600291CD190 +:106A10000E4E002406EB04100168A94203D10021A8 +:106A20000C30FBF78FFE641CA4B2062CF2D308488E +:106A3000817F002909D0017C022906D100218177BC +:106A4000BDE870401830FBF77DBE70BDE403002048 +:106A5000740F0020044B00EBC00203EB8202002104 +:106A60009160FFF74FBF000050110020022811D2A3 +:106A7000094900EB800201EB82018A68002A09D0F3 +:106A8000054B00EBC001483B03EB8101C96801B134 +:106A900001211047704700009811002010B50446EE +:106AA000022817D2F9F7ECFE0B4804EB840100EB47 +:106AB0008100C16809B120468847F9F7EBFE064816 +:106AC00004EBC401483800EB8100C168002901D003 +:106AD0000021C16010BD0000981100202DE9FF4782 +:106AE0004FF000082F4FCDF80880454607F13009D8 +:106AF000CDF80C8009EB05142078012802D002287B +:106B00003AD045E0A089062803D2274931F8101071 +:106B100001E040F2E631201DFBF714FE58B3F9F70F +:106B2000AFFEA08905EB4506401CA08107EBC6001F +:106B3000D0F80CC0BCF1000F04D000231A4619464F +:106B40002846E047022020708DF8088057F836600C +:106B500040463EB140F21261CDE90010082302AA7E +:106B60002846B047F9F796FE04F108000021FBF72C +:106B7000E9FD0120A0730BE004F108006721FBF799 +:106B8000E1FD28B1F8F7C8FFA4F80C8084F8008074 +:106B90006D1CEDB2022DADD3FEF756FBFEF756FB92 +:106BA000BDE8FF87440F0020E4B10108024901EB72 +:106BB0000010808970470000740F002038B5094C20 +:106BC000A0680090A289217807486368FDF7AEFDB0 +:106BD000A0690090A28B217C04486369FDF7A6FDA3 +:106BE00038BD0000740F002030C20108DCC101086C +:106BF0002DE9F041022802D30020BDE8F0810C4FBE +:106C000000EBC00607EB86040125A5600025657131 +:106C10002371E27027F826102146E560FFF7D0FEC9 +:106C200018B10220A0600120E7E7A560E4E70000BA +:106C30005011002070B50546022807D20D4805EB1B +:106C4000C50400EB8404A068022801D0002070BDB8 +:106C500004F110000646F4F76FFB31462846FFF7B3 +:106C600081FEFF28F3D00122E16882401143E160F8 +:106C700070BD0000501100200EB58DE80700694678 +:106C8000014804F0ECF80EBDB015002010B500F07E +:106C9000A5F8BDE8104000F04FB810B500F05EF860 +:106CA000BDE8104000F0A4B810B50C4A002102EB7A +:106CB00001131B6883420AD102EB0110C16851B174 +:106CC00041680C30C91EFBF73DFD20B910BD491CC1 +:106CD00089B20629EBD3012010BD0000E403002097 +:106CE00030B54FF0FF34E8B1124B002253F8325068 +:106CF000854208D103EBC200416011B9002043F87E +:106D00003200002030BD521C142AEFD351B10022B2 +:106D100053F8325045B103EBC2056D6825B1521CE2 +:106D2000142AF5D3204630BD43F8320003EBC200ED +:106D30004160E6E73013002010B54FF42671064895 +:106D4000F1F73BFA04492823A0310C2201F5F07039 +:106D500004F05DF8002010BD301300203EB5104C4B +:106D600004F5207514E06946284604F05CF800211B +:106D7000009A54F83100904207D104EBC1004368F7 +:106D800033B19DE80700984702E0491C1429EFD36E +:106D9000284604F02CF80028E5D000203EBD000075 +:106DA0003013002000280CD00B4A002101EB4103D6 +:106DB00002EB83039B682BB1491C89B21429F5D3DC +:106DC0000020704701EB410302EB83018860002043 +:106DD00042F8230008467047C815002010B5F0217E +:106DE0000248F1F7EAF9002010BD0000C8150020A4 +:106DF0002DE9F84300216846FBF7A4FC009810B386 +:106E0000012820D0DFF84480002505EB450008EB81 +:106E1000800458F82060A76896B18FB1201D3146D4 +:106E2000FBF790FC01280BD1A06838B1606800998D +:106E3000091AB1FBF6F101FB060060602046B84775 +:106E40006D1C142DE1D30020BDE8F883C815002087 +:106E5000002803D002C00021FBF774BC7047002853 +:106E600003D00068002800D0012070471CB50E49EF +:106E70000C68BCB1017A002304290DD00268CDE969 +:106E80000023427A52B10023042909D0016800F19D +:106E90000B020020A0471CBD4268F0E7837AF3E7AD +:106EA0004168F4E700201CBD440F00207CB5044677 +:106EB0002B482C494069F1F712FAF1F770FC2A4B84 +:106EC000002580B299884A1C92B29A800C2911D36D +:106ED000642A01D9642199801A7801219AB1B0F508 +:106EE000207F20D31D705A789AB140F229718842D0 +:106EF00019D85D702068A0F5E061953915D0FCF7D0 +:106F000035FE60B111E040F24E229042EBD2197092 +:106F100009E040F23A729042ECD9597003E0204601 +:106F2000F8F79EF908B101207CBD104886697EB152 +:106F3000207A04280ED02168CDE90015617A59B174 +:106F4000002304280AD0216804F10B020120B04775 +:106F500000207CBD6168EFE7A37AF2E76168F3E7A0 +:106F6000E81600200000C842DC030020440F002087 +:106F7000034800214FF496720171028041807047EE +:106F8000500500202DE9F05FFA4E317EB068FAF727 +:106F900017F80546717EF068FAF712F80446B17EDC +:106FA0003069FAF70DF8022D57D0DFF8CC830127AE +:106FB000F24E082D66D0092D77D04FF0000A0A2D29 +:106FC0006DD04FF6FF7B4FF00A09102D68D0112DC0 +:106FD00067D0122D77D0132D76D00C2D75D00D2DB6 +:106FE00074D0042D73D0162D72D0292D71D02A2D76 +:106FF00070D02B2D6FD0502D6ED0512D6DD0522DC5 +:107000006CD0532D6BD0542D6AD0552D69D0562D90 +:1070100068D0572D67D0582D71D0592D70D05A2D6A +:107020006FD0662D6ED01E2D6DD01F2D6CD1B6F891 +:107030005300A04269D24D46B4FBF5F2B4FBF5F122 +:10704000CFA0FDF773FBB6F853000A3880B2B0FB4F +:10705000F5F1A6F89000D1A0AFE3D94D012C08D0EE +:10706000D8A0FDF763FB2846BDE8F05F2021F7F7C5 +:1070700078B920212846F7F776F9BDE8F05FD4A06B +:10708000FDF754BB022C07D0D4A1D6A0FDF74EFBD0 +:10709000022C07D034B1D2E3D7A1F6E705E023E014 +:1070A00039E04DE086F86B40C9E3B24CD4A0E1680A +:1070B000FDF73CFB657E1021B048F1F77EF82A46CB +:1070C000AE48E1689FE053E05DE06DE078E089E084 +:1070D0009CE0A6E0B5E0C0E0CFE0DEE0F6E00FE146 +:1070E00025E129E12DE13FE3012C0FD0C6A1C8A085 +:1070F000FDF71CFB012C0BD086F887A09FE34DE326 +:1071000054E35DE364E39EE3E9E0A8E3C6A1EEE7B0 +:1071100086F8877093E32146C5A0FDF707FBB6F814 +:10712000590004EB8401B0EB410F04D90BEA410094 +:10713000A6F8830083E3B0FBF9F22146C1A013E077 +:107140002146CAA0FDF7F2FAB6F85B0004EB840111 +:10715000B0EB410F04D90BEA4100A6F885006EE3BD +:10716000B0FBF9F22146C7A0BDE8F05FFDF7DEBA3B +:107170002146D2A0FDF7DAFA04EB84010BEA4100C4 +:10718000A6F859005BE32146D0A0FDF7CFFA04EB47 +:1071900084010BEA41004FF4FA71A6F85B008842C3 +:1071A000ACD9A6F85B104AE3012C05D086F889A07B +:1071B000CBA0FDF7BBFA42E386F88970D0A0F8E7D0 +:1071C000642C08D286F88A402146D4A0FDF7AEFA96 +:1071D00088F8007033E3D8A0FDF7A8FA5A2086F8A3 +:1071E0008A002CE3634DDAA0E968FDF79FFA6C7E14 +:1071F000102C74D86148102110300646F0F7DDFFDE +:1072000022463046E968F0F7BFFF18E34846B4FB72 +:10721000F0F109FB1142B4FBF9F1A6F86340D1A0EB +:10722000B9E2A4F10A005A2804D8E1B286F8931012 +:10723000D3A0C2E22146DAA0FDF778FA86F893A03F +:10724000FDE2A4F16400FA2804D8A1B2A6F8A610C1 +:10725000DDA0B2E22146E4A0AFE2012C08D086F81E +:10726000A8A096F8A800012805D067A1EAA0A4E28A +:1072700086F8A870F5E76CA1F8E7012C08D086F82D +:1072800074A196F87401012805D0EAA1EBA094E25C +:1072900086F87471F5E7EEA1F8E7A4F5F07040F612 +:1072A0004801884202D2A6F8754104E0B4FBF9F126 +:1072B000EBA0FDF73BFAB6F875014946B0FBF1F2D9 +:1072C000B0FBF9F109FB1202EEA064E2A4F1650043 +:1072D00040F28331884203D2A6F8774105E0B0E25C +:1072E000B4FBF9F1EEA0FDF721FAB6F877014946B3 +:1072F000B0FBF1F2B0FBF9F109FB1202F2A04AE295 +:10730000A4F10B008B2802D2A6F8794104E0B4FB6B +:10731000F9F1F3A0FDF70AFAB6F879014946B0FB96 +:10732000F1F2B0FBF9F109FB1202F5A033E2E1B290 +:1073300086F87B11F8A040E2E1B286F87C11FCA04F +:107340003BE2A4F5F07040F2E471884202D2A6F864 +:107350007D4104E0B4FBF9F1FAA0FDF7E7F9B6F8D6 +:107360007D014946B0FBF1F2B0FBF9F109FB1202D5 +:10737000F8E10000D8350020690700208C2A0020A1 +:1073800052657175697265506F7765722564206BFF +:107390007720203A25646B770A0D000052657175DD +:1073A000697265506F776572204175746F204C6902 +:1073B0006D6974202564206B77200A0D00000000A1 +:1073C000001001404B4331206F70656E0A000000D1 +:1073D0004B433120636C6F73650A000047423230C3 +:1073E0003131000050726F746F636F6C5479706547 +:1073F0002025730A0000000047423230313500007A +:10740000736E3A25730A000044697361626C65000B +:10741000517569636B436861726765456E61626C43 +:10742000652025730A000000456E61626C650000EE +:10743000426D52657175697265566F6C7420256472 +:107440000A000000426D52657175697265566F6C75 +:1074500074256420426D734D6178566F6C74256499 +:10746000206661696C65640A0D000000426D73520C +:1074700065717569726543757272656E74202564F5 +:107480000A0000000A0D426D7352657175697265DC +:1074900043757272656E74202564204F7665722084 +:1074A000426D734D617843757272656E7420256408 +:1074B000204661696C65640A0D000000426D734DE1 +:1074C0006178566F6C742025640A0000426D734D1C +:1074D000617843757272656E742025640A0000003D +:1074E000747269636B6C654368617267696E675338 +:1074F0006F63446973456E61626C65200A0D00001C +:10750000747269636B6C654368617267696E675317 +:107510006F63456E61626C650A0D00007472696389 +:107520006B6C65204368617267696E6720536F6397 +:1075300025640A0D00000000747269636B6C65209D +:107540004368617267696E6720536F630A0D0000BC +:10755000626C7565746F6F7468206E616D653A2535 +:10756000730A0000754261744D6178456E657267FB +:10757000792025642E25646B77680A0D00000000D1 +:1075800052657175697265566F6C7461676544699F +:1075900066666572656E6365202564560A0D000097 +:1075A00052657175697265566F6C7461676544697F +:1075B00066666572656E63652D2D4F766572202552 +:1075C00064560A0D0000000053696D756C617465A6 +:1075D0006443757272656E74426174566F6C742088 +:1075E0002564560A0D00000053696D756C61746561 +:1075F0006443757272656E74426174566F6C742068 +:107600002564562D2D4F766572203130302D33355F +:1076100030560A0D00000000446562756720506115 +:1076200067652066756E6374696F6E202573202010 +:10763000200A0D006561737900000000576F726BBE +:107640004D6F64656C2025732020200A0D0000001A +:1076500070726F66657373696F6E616C0000000015 +:10766000444352657175697265566F6C7425643A4E +:107670004F7665722834382D323630292020200A82 +:107680000D000000444352657175697265566F6C58 +:10769000743A25642E2564205620200A0D0000002F +:1076A00044435265717569726543757272656E7493 +:1076B000202564413A4F7665722831302D313030C3 +:1076C00041292020200A0D004443526571756972DA +:1076D0006543757272656E7420256441200A0D0041 +:1076E00044434D6178506F7765722564203A4F7638 +:1076F000657228312D31306B2909200A0D000000F8 +:1077000044434D6178506F7765723A25642E256445 +:10771000206B77090A0D000044435F496E6475636E +:1077200074616E636554656D70202564200A0D00D8 +:1077300044435F4947425454656D70202564200AD4 +:107740000D00000044434D6178566F6C74256456FB +:107750003A4F7665722834382D3230305629202041 +:10776000200A0D0044A016E0A4F1C800B0F5487F3F +:1077700002D8A6F87F4104E0B4FBF9F144A0FCF77D +:10778000D5FFB6F87F014946B0FBF1F2B0FBF9F145 +:1077900009FB120247A0FCF7C9FF50E0962C01D26A +:1077A00086F8814196F8811149A006E0962C01D215 +:1077B00086F8824196F882114BA0FCF7B7FF3EE0B5 +:1077C000022C01D286F8904196F890114BA0F4E774 +:1077D00004EB84010BEA41004E4DA6F88E014E49A0 +:1077E0006868F0F7AEFD81462046F0F79CFF4946F9 +:1077F000F0F76FFDF0F7BAFF41B286F88D1100295E +:1078000002DA494245A000E04BA0FCF78FFF96F951 +:107810008D0100F10901132901D3286808E000EB6C +:1078200080004000F0F776FF6968F0F700FD2860FF +:10783000F1F701F802460B4646A0FCF777FF88F8FF +:107840000070BDE8F09FA0B24946B0FBF1F2B0FB7A +:10785000F9F109FB1202A6F8530045A09BE7A0B27C +:107860004946B0FBF1F2B0FBF9F109FB1202A6F8B0 +:10787000900045A08FE7000044434D6178566F6C3F +:10788000743A25642E2564205620200A0D0000003D +:1078900044434D617843757272656E7425643A4F46 +:1078A0007665722832302D313030292020200A0DA3 +:1078B0000000000044434D617843757272656E7438 +:1078C0003A25642E2564204120200A0D0000000086 +:1078D00043617061636974616E636554656D703195 +:1078E000202564200A0D00004443426F7854656DE2 +:1078F0007032202564200A0D000000004361706191 +:10790000636974616E636554656D7032202564200F +:107910000A0D0000E8160020000020410A0D486909 +:107920006768566F6C746167654F66667365742D22 +:1079300020256456200A0D000A0D48696768566FB5 +:107940006C746167654F66667365742B2025645699 +:10795000200A0D000A0D7248696768566F6C7461E1 +:1079600067654F666673657420256620200A0D00E2 +:107970004F766572506F776572203A25642E2564C4 +:107980006B77680A0D0000000A0D52657175697207 +:1079900065506F7765723A25642E25646B77680AA7 +:1079A0000D0000000D4810B5017E8068F9F708FB56 +:1079B000C0B201220A4901280DD0002008600949FF +:1079C00041F8770F486088600748027007A0BDE85B +:1079D0001040FCF7ABBE09A00A60F8E7D8350020DC +:1079E000780600208C2A002069070020656E636FEE +:1079F0006465636869700D0A000000006465636F68 +:107A0000646520636869700D0A0000000120FFF7BB +:107A100045B8000010B5094C217EA068F9F7D0FAEE +:107A2000617EE068F9F7CCFAA17E2069F9F7C8FA1F +:107A3000FAF77CFE02490020087110BDD8350020FD +:107A40007C0700202DE9F05F504C217EA068F9F7FB +:107A5000B7FA8146617EE068F9F7B2FA05464C480C +:107A600090F82B0010F0600F04D0BDE8F05F49A043 +:107A7000FCF75CBEA9F130004F4E01274F4C4FF090 +:107A8000020B4FF06408A2284DD8E81E4FF6FF7A8B +:107A900061280AD805EB85010AEA4100A4F80B0029 +:107AA000294647A0FCF742FE04E0A4F80B804AA058 +:107AB000FCF73CFEB6F87901A4F8070004F8017B56 +:107AC00086F897B104214E4806F27516F6F74BFC7E +:107AD0004C4909EB89000AEA40024F74228108EB05 +:107AE0004000208005EB850008EB4000A08008885E +:107AF000A4F813004888A4F81500FAF71DFE4248C0 +:107B00000021C8220771414801710280418020890B +:107B100030803F4960897080C8804946BDE8F05F89 +:107B20003CA0FCF703BEB6F87D01A4F801004FF4B9 +:107B30007A7AA4F805A0B6F87901A4F80700334DC5 +:107B4000B946277000272F71C82028806F80042134 +:107B50002B48F6F708FC2B48C82180F8119086F8CE +:107B600097B12F7129806F80A4F809A0A4F80B8029 +:107B70000188A1824088E082FAF7DEFD224981F87F +:107B800004902349A1F806A0BDE8F09FD835002055 +:107B90003A2A002046444320B7B4BDD3B9CAD5CF52 +:107BA0002CC7EBBCECB2E9BDD3CFDFBAF3D4DABF5C +:107BB000AABBFA0A0D0000008C2A00200017002042 +:107BC000444320C9E8B6A8CAE4B3F6B5E7C1F72034 +:107BD000256420410A0D0000444320C9E8B6A8B33B +:107BE000ACB3F6B7B6CEA728332D31303041292CAF +:107BF000BBD6B8B4C4ACC8CF313041200A0D0000A8 +:107C0000000C0140EE0B00207C07002050050020F6 +:107C1000FC0D0020444320C9E8B6A8CAE4B3F6B579 +:107C2000E7D1B920256420560A0D000010B5124C8A +:107C300012A034F8591FFCF779FD618815A0FCF7F4 +:107C400075FD1A480068F0F7AAFD81B218A0FCF78C +:107C50006DFD618D1BA0FCF769FDA18D20A0FCF7D7 +:107C600065FDA07C022805D024A1BDE8104025A018 +:107C7000FCF75CBD28A1F8E78C2A00200A0DD7EE9E +:107C8000B8DFD4CAD0EDB3E4B5E7B5E7D1B9256420 +:107C90000A0D00000A0DD7EEB8DFD4CAD0EDB3E468 +:107CA000B5E7B5E7C1F725640A0D0000E816002026 +:107CB0000A0DB5B1C7B0B2C9D1F9B5E7D1B92564DC +:107CC0000A0D00000A0DD3C3BBA7D7EEB8DFD0E87A +:107CD000C7F3B3E4B5E7B5E7D1B925640A0D0000F1 +:107CE0000A0DD3C3BBA7D7EEB8DFD0E8C7F3B3E420 +:107CF000B5E7B5E7C1F725640A0D0000C0CFB9FAB2 +:107D0000B1EA00000A0DB5B1C7B0B5E7B3D8D0AD40 +:107D1000D2E925730A000000D0C2B9FAB1EA000026 +:107D200070477047F8B54FF480715D48F6F712FB65 +:107D30005C4D4FF4007168725B48F6F70BFBA8725C +:107D40005A485B494068884201D15AA000E062A0CD +:107D5000FCF7ECFC664C2068A0F5806169394FD0D7 +:107D600064A0FCF7E3FC694F04213846F6F7FBFA00 +:107D70006749012048744FF47A70F5F7A4FA65A0BA +:107D8000FCF7D4FC674CA068F0F709FD81B266A04F +:107D9000FCF7CCFCE068F0F702FD81B268A0FCF7CC +:107DA000C5FC2069F0F7FBFC81B26BA0FCF7BEFCC0 +:107DB0006F4E70A03178FCF7B9FC4FF48041384623 +:107DC000F6F7D1FA4FF4FA773846F5F77CFA70A057 +:107DD000FCF7ACFC6068F0F72EFD02460B4672A083 +:107DE000FCF7A4FC2068F0F726FD02460B4676A0BF +:107DF000FCF79CFC7D49606888421FDD7CA01EE08A +:107E000081A0FCF793FC88482668066061684160A1 +:107E1000227A0272627A4272A27A8272D4F80B20BB +:107E2000C0F80B20D4F80F20C0F80F200269009290 +:107E3000D0E902233046FFF739F894E77BA0FCF73E +:107E400075FC30780C2817D07EA0FCF76FFC384604 +:107E5000F5F739FA8148007804280FD005280DD0AD +:107E60007FA0FCF763FC7078062809D082A0FCF79D +:107E70005DFC687A30B109E084A0E6E789A0F0E70C +:107E80008EA0F4E792A194A0FCF750FCA87A0028F9 +:107E900005D1BDE8F8408EA191A0FCF747BCF8BD24 +:107EA000000801407C07002000100140400C002029 +:107EB00056F426180A0DCAD5B5BD63616E2031CEC1 +:107EC000D5CAD6B1A8CEC42C63616EC7FDB6AFD5F6 +:107ED000FDB3A30A0D0000000A0D20CEB4CAD5B52B +:107EE000BD63616E3120B1A8CEC40A0D0000000050 +:107EF000080F00200A0D20CEB4CAD5B5BD63616E4F +:107F000032B1A8CEC43F0A0D00000000000C0140B1 +:107F1000EE0B00200A0D20B1D5BACFBCCCB5E7C618 +:107F2000F70A0D00E81600200A0DB5B1C7B0B0E59C +:107F3000D7D3CEC2B6C8312D2D25640A0D0000005E +:107F40000A0DB5B1C7B0B0E5D7D3CEC2B6C8322D91 +:107F50002D25640A0D0000000A0DB5B1C7B0B0E5CB +:107F6000D7D3CEC2B6C8332D2D25640A0D0000002C +:107F70003A2A00200A0DB5B1C7B0B0E5D7D3CAE49C +:107F8000C8EBB5E7D1B92D2D2564560A0D000000C8 +:107F90000A0D20B1D5BACFB8DFD1B933303056BCD5 +:107FA000CCB5E7C6F70A0D000A0D20B5B1C7B0B2CF +:107FB000C9D1F9B5E7B3D8B5E7D1B9256628302ED0 +:107FC0003156290A0D0000000A0D20B5E7B3D8D0BC +:107FD000A3D7BCBAF3B5C4D0E8C7F3B5E7D1B92588 +:107FE0006628302E3156290A0D000000000091430A +:107FF0000A0D2020626D73B0E5B8DFD1B9B5E7D1C5 +:10800000B9D5FDB3A30A0D000A0DCAD5B5BD63618C +:108010006E32B1A8CEC42C63616E32C7FDB6AFD547 +:10802000FDB3A30A0D0000001C0F00200A0D202044 +:10803000626D73B0E5B8DFD1B9B5E7D1B9D2ECB3B1 +:10804000A30A0D000A0D2020626D73B0E5B5CDD1F5 +:10805000B9B5E7D1B9D2ECB3A30A0D00F4350020CD +:108060000A0DC0B6D1C0C4A3BFE9CEB4CDA8D0C557 +:10807000C9CF0A0D000000000A0D2067756E5F7001 +:108080006C7567696E3132200A0D00000A0D2020E0 +:10809000626D73B0E5B5CDD1B9B5E7D1B9D5FDB352 +:1080A000A30A0D000A0DC0B6D1C0C4A3BFE9CDA874 +:1080B000D0C5D5FDB3A30A0D000000000A0D20674E +:1080C000756E5F706C7567696E36200A0D00000072 +:1080D00077616B6575700000412B2025730D0A00D8 +:1080E0004143432025730D0A00000000012102488E +:1080F000017002A0FCF71ABBAC040020675F746536 +:1081000073745F616C203D2025640D0A000000003F +:1081100008B500216846FAF715FB04A00099FCF7A2 +:1081200005FBFEF74BFDFDF74FFA08BD7469636B65 +:10813000203D2025640D0A0070B590B00C4640210A +:108140006846F0F73AF8164B5878401C58701548B6 +:108150002178C27E8A420CD00025012907D05A7AA4 +:10816000561C5E72052A04D9C1765D7201E05D720B +:10817000C17634F8011F49BA20F81C1F618849BA3A +:108180004180A18849BA8180A1790173E179417365 +:1081900021894181A17A8173E17AC17310B070BDE8 +:1081A00018050020001700202DE9F047DFF89C801B +:1081B00098F80000012813D1254F264D264E4FF088 +:1081C0000009308806280BD30CD14FF0C801204895 +:1081D000EFF7F3FF88F80090A6F80090A5F80A9052 +:1081E000BDE8F0876889384401785A2927D1417859 +:1081F000012924D1C178402921D8021D8B5C421D60 +:108200008A5C091D03EB022294B2F3F72BFCA04217 +:1082100015D169897818041DC77839446981318876 +:10822000C91B3180807801F019F8E8610028D7D0A7 +:1082300043683A462146BDE8F04700201847688960 +:10824000401C68813088401E3080BAE77F070020DC +:10825000A633002018050020980700202DE9F05FC4 +:108260004FF47A717B48FAF76DFA01287ED1DFF876 +:10827000E881D8F80400F0F792FA764C81B2103C0D +:10828000A088F3F728FC0126642805D9D8F8040053 +:10829000F0F785FAA080E68070492078CA7E824295 +:1082A00001D02270E680DFF8B891637899F8000079 +:1082B000834201D06070E680C88C2389984201D047 +:1082C0002081E680E0780A23B0FBF3F503FB15007C +:1082D000012802D0E08801287ED10027E7808A4665 +:1082E0000D4609785FA0FCF721FAAA8BB5F80910B2 +:1082F00064A0FCF71BFAEA8BB5F80B1068A0FCF73A +:1083000015FA6A8C298C6DA0FCF710FAE98C99F8A3 +:10831000002072A0FCF70AFA02F05EFDE8B1DFF877 +:10832000D8B1764DA770A17815F8310003090BEB91 +:10833000430200F00F03B2F82B2006FA03F00242CA +:1083400005D005EBC10041686DA0FCF7EFF9A078FE +:10835000401CC0B2A0701028E5D3BAF826005546DC +:10836000E8B1DFF8B0A1A770A07800E06FE01AF8DC +:108370003020110905EB410102F00F02C98C06FA09 +:1083800002F2114205D00AEBC00041685DA0FCF783 +:10839000CDF9A078401CC0B2A0701028E4D399F8A1 +:1083A00000004E46A0B1A7702A4F0C37A078327853 +:1083B00017F83010914205D107EBC000416856A074 +:1083C000FCF7B4F9A078401CC0B2A0701428EDD31B +:1083D0004446D8F8100000E033E0F0F7C7F907B2E0 +:1083E000E068F0F7C3F906B2A068F0F7BFF901B290 +:1083F0003B4632464CA0FCF799F995F8292015F830 +:10840000281F51A02839283AFCF790F9EA78A97872 +:1084100056A02839283AFCF789F96068F0F70BFA7A +:10842000574A0B46B2F81B500246294655A0FCF7A6 +:108430007DF96069F0F7FFF902460B4659A0FCF799 +:1084400075F9BDE8F05F00210248FAF77BB9BDE895 +:10845000F09F000010000020E81600200017002008 +:108460007C0700204D6F64756C65207377746963B9 +:1084700068202025642073746174652025640D0ACA +:1084800000000000766F6C74207461726765742060 +:108490002564206E6F77202564200D0A00000000FF +:1084A0006375727220746172676574202564206E32 +:1084B0006F77202564200D0A00000000696E70753A +:1084C000745F766F6C7420256420696E7075745FBC +:1084D000637572722025640D0A0000006661756C78 +:1084E00074636F646520256420726561736F6E200C +:1084F00025640D0A000000003A2A002078050020BB +:108500004644435F6661756C74636F6465202573D0 +:108510000D0A0000F805002073746F7052656173D6 +:108520006F6E2025730D0A0054656D70312025642F +:108530002054656D70322025642054656D703320A1 +:1085400025640D0A000000004D6F64756C5F546572 +:108550006D7020256420496E64756374616E636577 +:108560005F54656D702025640D0A000074656D70A0 +:10857000332025642074656D70342025640D0A0055 +:10858000740B002043445A20566F6C7420256420DD +:108590002020494E5055545F566F6C742025660D4F +:1085A0000A00000043445A20417578696C69617281 +:1085B0007920506F77657220566F6C742025660D98 +:1085C0000A0000002DE9F04104460E460D20FAF79E +:1085D00093F90A20FAF790F9002510E02078F6F7D1 +:1085E000F1F901462078F6F7E5F907460846FAF76B +:1085F00083F93846FAF780F96D1CADB2641CB542B8 +:10860000ECD30D20FAF778F9BDE8F0410A20FAF72B +:1086100073B9002242F6E06304E01946491EFDD119 +:10862000521C92B28242F8D37047FEF7DFB82DE9B0 +:10863000F04115460C460746F6F7A6FCA020F6F7D3 +:1086400079FCF6F7C9FC98B9200AF6F773FCF6F73F +:10865000C3FC68B9E0B2F6F76DFCF6F7BDFC38B9BB +:10866000F6F792FCA120F6F765FCF6F7B5FC20B111 +:10867000F6F7A0FC0020BDE8F08100246E1E09E0A2 +:10868000B44201D0012000E00020F6F725FC385567 +:10869000641CA4B2AC42F3D3F6F78CFC0120EAE7E9 +:1086A0002DE9F04116460C46074600252AE035B173 +:1086B000E00618D1F6F77EFC0620F4F704FEF6F784 +:1086C00063FCA020F6F736FCF6F786FC88B9200A92 +:1086D000F6F730FCF6F780FC58B9E0B2F6F72AFC62 +:1086E000F6F77AFC28B9785DF6F724FCF6F774FC07 +:1086F00020B1F6F75FFC0020BDE8F081641C6D1C22 +:10870000A4B2ADB2B542D2D3F6F754FC0120F3E7E0 +:1087100070B541F288311848FAF714F8012829D1C8 +:10872000164CE07E01281FD1134DE18B203D288B94 +:10873000814219D016D2F3F7CEF9C82812D90E49C2 +:1087400001201831087148880A2804D20C4A32F8EE +:108750001000088003E0C82008800920488048886D +:10876000401C4880E08B2883BDE87040002102480F +:10877000F9F7E8BF70BD00003805002000170020A1 +:1087800088B9010870B5104C0546C1B22046FBF708 +:10879000ADF920880006FCD50C4890F8A800012807 +:1087A00010D10B48807802280CD10A4C0A48217A53 +:1087B000962903D24554491C217203E0FBF75AFE67 +:1087C00000202072284670BD004C00408C2A0020FA +:1087D000F43500207C0700202C2F002010B5002845 +:1087E00021D0114B0022001F196803E0814203D8F9 +:1087F0000A4649680029F9D152B11368841A9C428B +:1088000004D1006818441060104602E0506000E097 +:10881000186039B102680B1A934203D10B681A44ED +:1088200002604968416010BD140B002000B5F0F7EC +:1088300019FB0520FFF7EDFEF7F782FF014988805D +:1088400000BD00007C06002070B505460846F5F71F +:108850004BFF040062D00420812D2CD00CDC042DB1 +:1088600017D0802D5AD194F85400032856D3E16CC8 +:10887000002953D0802043E0822D13D0832D4DD189 +:1088800094F85410032949D394F8911002292DD05B +:1088900033E094F85400032840D32046BDE87040EC +:1088A000F6F7B9B994F85400032837D3E16C0029DE +:1088B00034D0822024E094F8541003292ED394F865 +:1088C000911002290DD194F8901094F8442091420F +:1088D00000D2032084F89100227804210120FEF7C1 +:1088E000CBF9E16C002919D0812009E084F89100CE +:1088F000227804210120FEF7BFF9E16C19B1832031 +:10890000BDE870400847207800F033FB2078BDE8D0 +:10891000704000231A46194600F075BB70BD70B553 +:108920000D460446F5F7E0FE00281ED090F85430BE +:10893000022B06D8C168002917D02046BDE8704038 +:108940000847812B0AD0002D0FD1802180F85410C8 +:108950002246BDE870400120FEF78EB9002D04D0FC +:10896000812180F854102246F3E770BDFFF7D7BF8E +:1089700010B50446F5F7B8FE002813D090F854104F +:10898000022906D8C16800290CD02046BDE8104055 +:108990000847832180F854102246BDE8104001208A +:1089A000FEF76AB910BD00002DE9F0411D461646DC +:1089B0000F468046F5F798FE040030D094F8540036 +:1089C00003282CD3802802D1032084F8540094F883 +:1089D0004000C00706D0A36C0BB32A463146384688 +:1089E00098471CE00F48691E2A4607600571072951 +:1089F00003D83146401DEFF7C7FB04F15800094981 +:108A0000054602F02CFA284602F0F9F938B1822026 +:108A100084F85400014642460120FEF72DF901205A +:108A2000BDE8F0812013002010B50C46F5F75CFE80 +:108A3000002815D090F89110E2B2022901D0032944 +:108A40000ED190F8981091420AD1052180F891102A +:108A500090F85410032903D3BDE81040F6F7DBB8B3 +:108A600010BD0020401C80B23C28FBD370470000A2 +:108A700010B50E4C627852B1002161702170E0682F +:108A80000A22B0FBF2F080B22081E16010BDFFF756 +:108A9000CDFEE1680844E0602078411C217009287F +:108AA00001D301206070208910BD00007C060020E9 +:108AB00086B0F8F7C7FEF1F747FBFBF71FF84FF456 +:108AC000004162B60803F6F751FDF8F78BFE6846E1 +:108AD000F7F784FCF6F7FAFCF6F736FC40F2CF2104 +:108AE00040F2F310F8F7F0FEFFF79FFDF0F77EF885 +:108AF000F0F7DCF97C48C06802F0CEF94FF4E130C1 +:108B000002F026FA4FF4165002F076FAF6F78EFAD3 +:108B100040217648F5F727FC02217548F5F723FC3C +:108B2000FCF700FBF5F7AAFEF8F762FAF2F720F976 +:108B300070A0FBF7FBFD76A0FBF7F8FD7B497CA05E +:108B4000FBF7F4FD7E4D0A24B5F859005335B0FB10 +:108B5000F4F17CA0FBF7EAFD2889B0FBF4F17FA0DB +:108B6000FBF7E4FD288EB0FBF4F182A0FBF7DEFDFD +:108B7000688EB0FBF4F186A0FBF7D8FD2888B0FB27 +:108B8000F4F18AA0FBF7D2FD287E533D022834D0B1 +:108B90008BA18DA0FBF7CAFD95F897118FA005F268 +:108BA0007515FBF7C3FD2888B0FBF4F194A0FBF723 +:108BB000BDFD6888B0FBF4F197A0FBF7B7FD2889ED +:108BC000B0FBF4F19AA0FBF7B1FD6889B0FBF4F1BA +:108BD0009DA0FBF7ABFDA888A5F27515B0FBF4F1DD +:108BE0009FA0FBF7A3FD5648EFF704FB102806D221 +:108BF0005349A0A0FBF79AFD0DE0A3A1C9E7A4A0EB +:108C0000FBF794FD0024A6A0295DFBF78FFD641CF3 +:108C1000E4B2102CF7D3F7F705FDF7F7B9FCA14A3A +:108C2000002485F8A840506820F007019EA05160FC +:108C3000FBF77CFDA04DF9F7B1FDFCF709FA2878A8 +:108C400001281FD0687801282ED0A878012831D0BB +:108C5000E87801283ED0287901283DD0687901289C +:108C60003ED0E8790128E6D14102EC719348F5F74E +:108C700078FBF6F72DFDF1F7ABFDF8F783FDFAF77A +:108C8000ADFFD8E72C70F1F747FD8D48007801283B +:108C900001D0F0F78BF9F5F79DFEFFF7DFFAFBF750 +:108CA00045FCFAF729FFC6E76C70FFF77DFAF6F787 +:108CB000B1F9C0E7AC70F2F733FFF1F71DF902200C +:108CC000F5F730FD7F4948600860FAF713FFF6F7C3 +:108CD000B7FDB0E7EC70AEE72C71F6F705FBAAE73D +:108CE000F3F7B6FF6C71A6E700000020001001400A +:108CF000000801400D0A4150502070726F67726188 +:108D00006D2072756E6E696E67202E2E2E0D0A0014 +:108D10000D0A20736F6674776172652056657273F1 +:108D2000696F6E3A20200D0A0000000098BA010811 +:108D30000D0A20B0E6B1BEBAC53A2025730D0A006F +:108D40008C2A00200D0AD7EEB4F3B3E4B5E7B5E7FB +:108D5000D1B93A2025640D0A000000000D0A20D781 +:108D6000EEB4F3B3E4B5E7B5E7C1F73A2025640DF7 +:108D70000A0000000A0DD3C3BBA7D7EEB8DFD0E8C6 +:108D8000C7F3B3E4B5E7B5E7D1B925640A0D000030 +:108D90000A0DD3C3BBA7D7EEB8DFD0E8C7F3B3E45F +:108DA000B5E7B5E7C1F725640A0D00000A0DD3C386 +:108DB000BBA7D7EEB4F3B9A6C2CA25640A0D00005A +:108DC000C0CFB9FAB1EA00000A0DB5B1C7B0B5E736 +:108DD000B3D8D0ADD2E925730A0D00000A0D53793E +:108DE000735061726150696C65442E536F635369AF +:108DF0006D756C61547970652025640A0D00000062 +:108E00000A0D44434443D0E8C7F3B3E4B5E7B5E7FC +:108E1000D1B925640A0D00000A0D44434443D0E84B +:108E2000C7F3B3E4B5E7B5E7C1F725640A0D000061 +:108E30000A0D44434443D7EEB4F3B3E4B5E7B5E7D2 +:108E4000D1B925640A0D00000A0D44434443D7EE0E +:108E5000B4F3B3E4B5E7B5E7C1F725640A0D000044 +:108E60000A0D44434443D7EEB4F3B9A6C2CA2564FD +:108E70000A0D00000A0DC9E8B1B8B5C4736EBAC5D1 +:108E80003A25730A00000000D0C2B9FAB1EA000026 +:108E90000A0DC9E8B1B8B5C4736EBAC53A0A000084 +:108EA00025632000002004E056616C7565203D209C +:108EB00025640D0A000000007C2A0020000C0140FF +:108EC00080070020E8160020F0B50B30154D20F08B +:108ED00007010024144A0FE003688B420BD38B4236 +:108EE00005D95E1A43184768C3E9006700E0436884 +:108EF000136002C004E0021D10680028ECD1204677 +:108F0000002802D1286808B10020F0BD064A0748B1 +:108F10001060074A121A22F00702C0E9002401205B +:108F20002860D7E7180B0020140B0020FC37002026 +:108F3000F857002070B53AB10C4B84189C4203D806 +:108F4000A3F50074A04202D24FF0FF3070BD31B1E2 +:108F5000002302E0CD5CC5545B1C9342FAD3011B95 +:108F600092B289B2FAF7DAFD002070BDA429002080 +:108F7000704770B50546F5F7B7FB040003D094F8C9 +:108F80005400022801D8002070BD022084F854004B +:108F9000E16809B12846884794F8910018B3D4F8DD +:108FA000A8204AB906E00428D4F8A4000AD0032176 +:108FB000904718E0226DB2B10528F4D10021D4F811 +:108FC000A400F5E70121F3E73146284601F02BFF25 +:108FD00068B1D4F8A8200AB9226D42B10321D4F8AF +:108FE000A400904703E004F1940604F170052846BC +:108FF00001F0FDFE0028E7D0202104F19000EFF7FA +:10900000DCF8012070BD2DE9F0411D4616460F46E3 +:109010008046F5F769FB04002CD094F85400012831 +:1090200028D9D4F804C0BCF1000F23D02B46324617 +:1090300039464046E047E8B1D4F88C1031B194F895 +:109040004530182204F1700001F0E1FE94F8400070 +:10905000C00709D1D4F8881031B194F845301022F6 +:1090600004F1580001F0D3FE032084F854000120DD +:10907000BDE8F0810020FBE710B5F5F735FB0028CF +:1090800001D090F8540010BD2DE9FF411E46154651 +:109090000F46F5F729FB04000ED094F8540002287F +:1090A0000AD94DB194F84000C00705D104F1580029 +:1090B000804601F09CFE18B1002004B0BDE8F081AC +:1090C0006946404601F0AFFE0028F6D000983860AF +:1090D0009DF8040030709DF80420501E072804D825 +:1090E00028460DF10501EFF74FF894F85400822857 +:1090F00002D1032084F854000120DEE72DE9F04777 +:1091000086B01D46DDE90E9816460F46F5F7ECFAD7 +:1091100004000BD094F85400022807D9082D05D874 +:1091200004F17000824601F06AFE18B1002006B01A +:10913000BDE8F087F7F7A4FB94F85400832801D02A +:10914000032802D2F7F7A6FBF0E7CDF814800097CA +:109150008DF80550CDF8109016B900208DF8050057 +:109160009DF80520501E072804D831460DF1060051 +:10917000EFF70AF8FF208DF804006946504601F029 +:109180006EFE94F8910010B92046F5F744FDF7F70C +:1091900081FB0120CBE7002070470000044803C892 +:1091A000814201D300207047401AC0B270470000CE +:1091B000B80F002070B51C48C17A1C48462902D25D +:1091C0004FF4FA6101E04FF47A710184184991F883 +:1091D0009711012918D1174D174B002695F8291022 +:1091E00001F003021978012A08D0C28B541CC483F1 +:1091F000048CA24203D9A1B90F2011E0C68395F8CF +:1092000039201AB1A0F84060012070BD30F8402F1D +:10921000541C20F8204900888242F5D909B9102051 +:109220001870002070BD0000EE0B002058020020D6 +:109230008C2A0020FC0D00207C07002004480A68CE +:10924000C2624968016300F12C0102A0FBF76EBA0B +:10925000001700200A0D20257320000010B50423FC +:10926000094A002112F83140844206D1074B002000 +:10927000A3F8190002EBC10010BD491CC9B2994204 +:10928000F0D3002010BD000058050020001700207A +:109290002DE9F04F93B0044640216846EEF78DFF6C +:1092A0004FF0000AADF844A04FF6FF7BFE4D85F865 +:1092B00010A0B4F80580A8F5004020381ED0A8F50D +:1092C000004021381AD0DFF8E4930127F84EB8F5B2 +:1092D000004F7DD05CDCB8F5D06F01F04A8549DCE9 +:1092E000B8F5607F6ED03EDCB8F1800F70D0B8F575 +:1092F000C07F68D0B8F5207F32D18BE066882746E2 +:10930000B6F5967F05D8E8483246E11D3830EEF7CD +:109310003BFFE54831463830FFF754F9B81930F8CB +:10932000024CB01E81B23846F1F790F9074602466A +:109330002146E0A0FBF7FAF9BC4201D0E3A044E0EB +:10934000D94908F1E00885F811A008F0FF0032467D +:109350003831FAF717FEE549642008840420A87024 +:1093600013B0BDE8F08FB8F5906F64D0B8F5B06F6A +:10937000F6D178E0B8F5286F22D0F1DCB8F5F06FBF +:109380001ED0B8F5086F1BD0B8F5186FE8D117E0FC +:1093900048F20701A8EB0100884511D009DC6FF401 +:1093A000004040440628DBD2DFE800F02B34434580 +:1093B0005DFD032804D0D3DC012801D00228CFD1E1 +:1093C00002E005E035E01CE0C9A0FBF7AFF9C7E714 +:1093D000E079012801D0CDA0F7E7AF7086F876706C +:1093E00046F86CAFB249C6F804A0A6F808A0A06879 +:1093F0003060E0687060AF7089F800706C31C8A0B0 +:109400005AE2E079012801D0CDA0DEE70220A87061 +:10941000CFA0DAE7E179D3A0FBF788F9D648D4F8F2 +:10942000091040F8011FB4F80D108180E17B8171B3 +:1094300096E7D2A0C9E7D7A0FBF778F9207A0128F0 +:109440000FD0DAA1DBA0FBF771F9207A002887D1D1 +:10945000A648022181710178002981D1042101707F +:109460007EE7D7A1EEE7DFF8848288F80770E0791D +:10947000A0B1D5A0FBF75AF9E079012810D0002857 +:10948000A5D1277AD4A03946FBF750F9D74A88F8F6 +:1094900005700D2F01F0158401F017BCD4A0E9E789 +:1094A000257AD7A02946FBF741F9012D7CD0022D62 +:1094B0007BD004F109001090042D77D0072D76D0D1 +:1094C000062D75D0082D74D0092D73D00A2D72D0B9 +:1094D0000B2DADD00C2D6FD00D2D6ED04FF00A0896 +:1094E0000E2D6BD00F2D6AD0102D69D0112D68D0A4 +:1094F000122D67D0132D66D0142D65D0162D7DD07A +:109500001D2D7CD01E2D7BD01F2D7AD0202D79D003 +:10951000212D78D0222D77D0232D76D0242D75D0F3 +:10952000252D74D0262D73D0272D72D0282D71D0E3 +:10953000292D70D02A2D6FD02B2D6ED0302D6DD0CF +:10954000312D6CD0322D6BD0332D6AD0342D69D0B3 +:10955000352D68D0362D67D0372D66D0502D7BD075 +:10956000512D7AD0522D79D0532D78D0542D77D0DB +:10957000552D76D0562D75D0572D74D0582D73D0CB +:10958000592D72D05A2D71D0602D70D0612D6FD0B1 +:10959000622D6ED0632D6DD0642D6CD0652D6BD097 +:1095A0006D2D6AD011E0C9E252E163E176E186E116 +:1095B0008DE196E1ADE1C0E1C9E1D3E1E0E1EDE1AA +:1095C000F7E117E22DE239E24BE240F22F226E2D55 +:1095D00054D06F2D53D0702D52D0712D51D0722D8B +:1095E00050D0732D4FD0742D4ED0752D4DD0762D7B +:1095F0004CD0772D4BD0782D4AD017E057E263E25C +:1096000072E281E29BE29BE29BE29BE29BE29BE2B5 +:109610009BE29BE29BE29BE29BE29BE29BE29BE262 +:109620009BE29BE29BE29BE29BE29BE2792D30D0A6 +:109630007A2D2FD07B2D2ED07C2D2DD07D2D2CD092 +:109640007E2D2BD07F2D2AD0802D29D0812D28D082 +:10965000822D27D0832DDBE085E285E285E285E25D +:1096600085E285E285E285E285E285E285E285E2C2 +:1096700085E285E285E285E285E285E285E285E2B2 +:1096800085E285E285E285E285E285E285E285E2A2 +:1096900085E285E285E285E285E285E285E285E292 +:1096A00085E285E285E20000F435002069070020AC +:1096B0008C2A00200A0D44637263202530782C56D2 +:1096C000637263202530780A0D0000000A0D2028FF +:1096D0004463726320213D205663726329207265C2 +:1096E0007475726E21212121210A0D007C07002052 +:1096F0005265636569766520444344432073746111 +:1097000074652061636B0A0D000000007265676973 +:10971000737465726564206661696C65640A0D0026 +:1097200072656769737465726564207375636365D8 +:10973000737365642C436F64652025730A0D000004 +:109740004C6F67696E204661696C65640A0D0000A4 +:109750004C6F67696E205375636365737365640A44 +:109760000D000000686561727420636F756E74206F +:1097700025640A0D000000002C0B00207265636553 +:109780006976652073746174652064617461200A70 +:109790000D0000007265636569766520636861721B +:1097A00067652064617461200A0D0000446973617B +:1097B000626C65006368617267652025730A0D003D +:1097C000456E61626C650000706172616D20777238 +:1097D0006974650A0D000000526561642070617251 +:1097E000616D206E756D2025640A0D006E340020B9 +:1097F000706172616D20726561640A0D0000000085 +:10980000706172616D20616464722025780A0D00B8 +:1098100073D0842D72D0852D71D0862D70D0872D78 +:109820006FD0882D6ED0892D6DD08A2D6CD08B2D68 +:109830006BD08C2D6AD08D2D69D08E2D68D08F2D58 +:109840007FF4C5ADB4F80910A6F8DA11D9A0E8E3A1 +:10985000607A40B9022288F8062098F8002012B9F0 +:10986000042288F80020012802D0D8A1D9A023E042 +:10987000DCA1FBE7617ADD4C012907D0DCA0FAF717 +:1098800055FF04212046F4F76CFD69E5DCA0FAF7EA +:109890004DFF04212046F4F766FD61E50446EEF72E +:1098A000A9FC82B2102A214605D2D948EEF76CFCF9 +:1098B0002146D8A0CBE7DCA0FAF738FF50E5647A60 +:1098C000E0A02146FAF732FFA6F869405AE1647A2F +:1098D000E3A02146FAF72AFF26F84D4F7480B480A2 +:1098E000F4E7607A022803D086F86B70E2A080E388 +:1098F000022086F86B00E6A0F9E7F0E3F0E3F0E37E +:10990000F0E3F0E3F0E3F0E3F0E3F0E3F0E3F0E3BF +:10991000F0E30446EEF76EFC82B2102A21460AD22A +:10992000BB481038EEF730FC2146DFA0FAF7FEFE08 +:1099300089F80070CAE7E2A089E7607A012803D0BD +:1099400086F887A0E5A0D2E786F88770FAE7607A04 +:10995000012803D086F889A0E6A0C8E786F88970B8 +:10996000ECA0C4E7617A642903D286F88A10F1A0DA +:109970006DE7F6A0FAF7DAFE5A2086F88A00A5E726 +:10998000647A4046B4FBF0F108FB1142B4FBF8F1F5 +:10999000F4A0FAF7CBFE86F88B4097E7647AF7A03D +:1099A0002146FAF7C3FE04EB8400400086F88C00E1 +:1099B0008CE7B4F80940F7A02146FAF7B7FEB6F8ED +:1099C000592004EB8400B2EB400F04D90BEA4000AD +:1099D000A6F883007AE704EB84004100F1A0FAF7CF +:1099E000A5FE36F8590F143880B2B0FBF8F1708537 +:1099F000F3A061E7B4F80940F6A02146FAF796FE15 +:109A0000B6F85B2004EB8400B2EB400F04D90BEAFC +:109A10004000A6F8850059E704EB84004100F2A05D +:109A20008CE2B4F80940F6A02146FAF77FFE04EB79 +:109A300084010BEA4100A6F8590047E7B4F8094051 +:109A4000F4A02146FAF772FE04EB84010BEA410010 +:109A50004FF4FA71A6F85B00884290D9A6F85B1023 +:109A600034E7647AF0A02146FAF760FEF34D2868E7 +:109A7000EEF795FE81B2F2A0FAF758FEF54881782C +:109A8000202901D920218170C9B201EBC10100EB6D +:109A900041012A68C1F80320817801EBC10100EB84 +:109AA0004101A1F807408178491C817058E4B4F85D +:109AB00009004146B0FBF1F2B0FBF8F108FB1202DD +:109AC000A6F86300E4A029E2607A012803D0022806 +:109AD00001D0E7A079E486F88D00012802D0EAA140 +:109AE000EAA0B4E6EEA1FBE7607A00EB80010BEAA6 +:109AF00041004146B0FBF1F2B0FBF8F108FB120265 +:109B0000A6F85300E7A009E2B6F89000B6F85310A3 +:109B1000627A884211D94446B1FBF4F2B0FBF4F109 +:109B2000E6A0FAF703FEB6F853000A3880B2B0FB9D +:109B3000F4F1A6F89000ECA089E6E1E12BE3EEE178 +:109B4000FFE10EE212E21EE22AE232E23AE261E2D2 +:109B500068E276E285E295E2A1E2B1E2B5E2B9E23D +:109B6000C9E2DBE2EBE2F7E207E315E315E315E315 +:109B700015E315E315E315E315E315E315E315E325 +:109B800015E315E314E214E314E314E314E314E31C +:109B900014E314E314E314E314E314E314E314E30D +:109BA00014E314E314E314E314E314E314E314E3FD +:109BB00014E314E3536F6343616C69627261746907 +:109BC0006F6E202025642020200A0D0064697361D7 +:109BD000626C65006368617267696E672025730A4D +:109BE0000D000000656E61626C650000000C0140B4 +:109BF0006F70656E2072656C61790A0D000000005F +:109C0000636C6F73652072656C61790A0D000000EA +:109C10009C2A0020626C7565746F6F7468206E6199 +:109C20006D652025730A0D00626C7565746F6F7425 +:109C300068206E616D65206D697374616B652025A8 +:109C4000730A0D0048656172742042656174205486 +:109C5000696D6520256420207365630A0D0000008E +:109C60004F76657254656D7056616C75652025641C +:109C70002020200A0D000000424D532050524F5426 +:109C80004F43414C204742323031310A0D00000031 +:109C9000424D532050524F544F43414C2047423283 +:109CA0003031350A0D0000005379735061726150F4 +:109CB000696C65442E736E3A25730A0D000000002E +:109CC0005379735061726150696C65442E736E20D4 +:109CD0006661756C742025730A0D00005175696307 +:109CE0006B2043686172676520456E61626C650A2E +:109CF0000D000000747269636B6C652043686172CB +:109D000067696E6720536F6320456E61626C6520E2 +:109D1000300A0D00747269636B6C65204368617270 +:109D200067696E6720536F6320456E61626C6520C2 +:109D3000310A0D00747269636B6C65436861726708 +:109D4000696E67536F6325640A0D0000747269635E +:109D50006B6C654368617267696E67536F63203926 +:109D6000300A0D00747269636B6C6520706F7765E3 +:109D7000722025642E25646B770A0D007472696366 +:109D80006B6C652063757272656E742564410A0D93 +:109D900000000000426D734D6178566F6C7425644D +:109DA000200A0D00256420426D734D6178566F6C5A +:109DB00074202564206661696C640A0D000000004F +:109DC000426D52657175697265566F6C74202564B9 +:109DD000200A0D00426D734D617843757272656E95 +:109DE00074202564200A0D00726571202564206F9F +:109DF000766572206D6178202564200A0D000000D0 +:109E0000426D734D6178566F6C74202564200A0D85 +:109E100000000000426D734D617843757272656E8B +:109E2000742564200A0D000073657474696E6720E0 +:109E3000736F63282564290A0D000000E8160020CE +:109E40004241545F566F6C746167652025640A0D4A +:109E500000000000E82C0020754261744D617845D7 +:109E60006E657267792025642E25640A0D00000056 +:109E70004368617267696E674D6F646520466175FE +:109E80006C740A0D000000004356000043686172C4 +:109E900067696E674D6F64653A2573200A0D00008F +:109EA000434300004F766572506F776572203A2504 +:109EB000642E25646B77680A0D0000005265717589 +:109EC000697265506F776572202564206B77204F2B +:109ED000766572506F776572203A25646B772C66D1 +:109EE00061756C740A0D0000526571756972655078 +:109EF0006F776572202564206B77200A0D000000C3 +:109F000002EB82010BEA41004146B0FBF1F2B0FBEB +:109F1000F8F108FB1202A6F89000B1A096E3607A6F +:109F200000EB80010BEA41006421B0FBF1F201FB80 +:109F30001202B0FBF1F1A6F8B300B0A0FAF7F6FBFD +:109F4000A3E4607A00EB80010BEA41006421B0FBDE +:109F5000F1F201FB1202B0FBF1F1A6F8B100AEA0E4 +:109F600074E3617AA6F8B710B2A070E4B4F80900FF +:109F70004146B0FBF1F2B0FBF8F108FB1202A6F883 +:109F80005F00B0A062E3B4F809004146B0FBF1F213 +:109F9000B0FBF8F108FB1202A6F85900B0A055E397 +:109FA000647AB4A02146FAF7C1FB323486F8B54092 +:109FB0004EE3647AB6A02146FAF7B8FB323486F84D +:109FC000B64045E3607A86F8B000012810D0022838 +:109FD00010D0032810D0042810D0052810D006284F +:109FE00010D0072810D0082810D0FF2810D02FE359 +:109FF000AEA0D4E3B3A0D2E3B8A0D0E3BEA0CEE33A +:10A00000C3A0CCE3C8A0CAE3CDA0C8E3D4A0C6E3F4 +:10A01000D9A0C4E3B4F80900A6F85D00B0FBF8F1DC +:10A02000DBA0D8E2617AA1F10A005A2803D886F8A9 +:10A030009310DCA0CFE2E4A0FAF778FB86F893A0B7 +:10A0400006E3B4F8091040F6C412A1F57A70904204 +:10A0500005D8A6F8A610B1FBF8F1E1A0BBE2E8A094 +:10A06000B9E2607A012808D086F8A8A096F8A8007E +:10A07000012805D0ECA1EEA0ADE286F8A870F5E7C6 +:10A08000F2A1F8E7B4F809004146B0FBF1F2B0FBE9 +:10A09000F8F108FB1202A6F86300EEA0D6E2B4F8CD +:10A0A000090000EB80010BEA41004146B0FBF1F2F0 +:10A0B000B0FBF8F108FB1202A6F88E00EBA0C5E297 +:10A0C000617AA6F84D10F0A0EBE3617AA6F84F1084 +:10A0D000F3A0E6E3617AA6F85110F7A0E1E3EDE31F +:10A0E000EDE3EDE3EDE3EDE3EDE3EDE3EDE3EDE3F0 +:10A0F000EDE3EDE3EDE3607A012809D086F892A064 +:10A1000096F89200012806D0AFF66011F0A0C8E3DF +:10A1100086F89270F4E7AFF65811F7E71121F2488C +:10A12000EEF74BF8F04854F8091F953840F8951FA2 +:10A130006168416021890181ECA01099B1E3EA488E +:10A1400054F8091F953840F89F1FA1888180A17994 +:10A150008171ECA01099A4E3607A012808D086F8F8 +:10A1600074A196F87401012805D0EEA1EFA098E340 +:10A1700086F87471F5E7F2A1F8E7B4F80910A1F1D7 +:10A180003000FC2806D201EB81010BEA4100A6F861 +:10A190007501E0E1DCE19DE3E8E102E217E21BE2A8 +:10A1A0001FE239E255E25DE265E277E289E29BE295 +:10A1B000B5E2D1E2E3E2FAE20BE31AE31FE323E3C1 +:10A1C00028E32CE330E334E339E33DE341E345E3C3 +:10A1D00049E34DE351E355E359E35DE368E37AE393 +:10A1E00052657175697265506F776572203A2564A2 +:10A1F0002E25646B77680A0D0000000042617452DE +:10A2000061746564566F6C74616765203A25642ECD +:10A210002564560A0D0000004261744D6178436860 +:10A2200061726765566F6C203A25642E2564560A64 +:10A230000D000000426174436F756E74203A25640E +:10A240000A0D0000546F74616C436170616369743E +:10A2500079203A25642E256441480A0D000000004B +:10A26000426D734D6178566F6C743A25642E256487 +:10A27000760A0D00754261744D617854656D7050B9 +:10A280006C75733530203A2564200A0D00000000FB +:10A29000754261744D696E54656D70506C7573359F +:10A2A00030203A2564200A0D0000000075634261E9 +:10A2B00074547970653AC7A6CBE1B5E7B3D8200AE4 +:10A2C0000D0000007563426174547970653AC4F8FA +:10A2D000C7E2B5E7B3D8200A0D00000075634261FC +:10A2E00074547970653AC1D7CBE1CCFAEFAEB5E7DB +:10A2F000B3D8200A0D000000756342617454797070 +:10A30000653AC3CCCBE1EFAEB5E7B3D8200A0D0078 +:10A310007563426174547970653AEEDCCBE1EFAE5F +:10A32000B5E7B3D8200A0D007563426174547970A3 +:10A33000653AC8FDD4AAEFAEB5E7B3D8200A0D0040 +:10A340007563426174547970653ABEDBBACFCEEF63 +:10A35000EFAEC0EBD7D3B5E7B3D8200A0D000000AD +:10A360007563426174547970653AEED1CBE1EFAE1A +:10A37000B5E7B3D8200A0D00756342617454797053 +:10A38000653AC6E4CBFBB5E7B3D8200A0D00000060 +:10A39000546F74616C566F6C746167653A25642004 +:10A3A000200A0D0052657175697265566F6C746193 +:10A3B0006765446966666572656E6365282564290C +:10A3C00056200A0D00000000202825642956206F21 +:10A3D0007665722072616E6765200A0D00000000CC +:10A3E00053696D756C6174656443757272656E74E2 +:10A3F000426174566F6C74202564560A0D0000008B +:10A4000053696D756C6174656443757272656E74C1 +:10A41000426174566F6C74202564562D2D31303096 +:10A420002D333530560A0D00434C4F534500000084 +:10A4300025732044656275675F506167655F667567 +:10A440006E6374696F6E200A0D0000004F50454E18 +:10A4500000000000754261744D6178456E65726759 +:10A4600079202564202E2564200A0D0053746F7016 +:10A47000566F6C74616765203A25642E25642056FA +:10A4800020200A0D000000004F76657254656D7043 +:10A490003056616C75653A256420200A0D00000075 +:10A4A0004F76657254656D703156616C75653A25ED +:10A4B0006420200A0D0000004F76657254656D70AF +:10A4C0003256616C75653A256420200A0D00000043 +:10A4D0005369676E616C4C6F7373466C61672025BE +:10A4E0007320200A0D000000212B002056656869AA +:10A4F00063686C65496E666F28302D39293A25737B +:10A500000A0D00005665686963686C65496E666F80 +:10A510002056494E2831302D3137293A25730A0DFE +:10A52000000000006561737900000000576F726BD6 +:10A530004D6F64656C20257320200A0D000000001B +:10A5400070726F66657373696F6E616C00000000F6 +:10A55000E1A0FAF7EBF8B6F875014146B0FBF1F26D +:10A56000B0FBF8F108FB1202E4A06FE0B4F80910A8 +:10A57000A1F10B00592806D201EB81010BEA410041 +:10A58000A6F8770102E0E4A0FAF7D0F8B6F8770170 +:10A590004146B0FBF1F2B0FBF8F108FB1202E8A073 +:10A5A00054E0617AA1F10B008B2802D2A6F8791150 +:10A5B00002E0E9A0FAF7BAF8B6F879014146B0FB33 +:10A5C000F1F2B0FBF8F108FB1202EBA03EE0617A79 +:10A5D00086F87B11EEA064E1617A86F87C11F2A026 +:10A5E0005FE1B4F80910A1F13000CA2806D201EBEE +:10A5F00081010BEA4100A6F87D0102E0EFA0FAF725 +:10A6000095F8B6F87D014146B0FBF1F2B0FBF8F1E8 +:10A6100008FB1202F2A019E0B4F80910A1F114002D +:10A62000512806D201EB81010BEA4100A6F87F0117 +:10A6300002E0F2A0FAF77AF8B6F87F014146B0FBE3 +:10A64000F1F2B0FBF8F108FB1202F5A0FAF76EF890 +:10A6500029E1607A962801D286F8810196F8811165 +:10A66000F6A01EE1607A962801D286F8820196F85B +:10A670008211F8A015E1607A012809D086F890A12E +:10A6800096F89001012806D0AFF6E061F6A008E147 +:10A6900086F89071F4E7AFF6D861F7E7607A0128A1 +:10A6A00009D086F887A196F88701012806D0AFF671 +:10A6B0000471F3A0F5E086F88771F4E7AFF6007156 +:10A6C000F7E7607A012809D086F888A196F8880112 +:10A6D000012806D0AFF62C71EDA0E2E086F8887173 +:10A6E000F4E7AFF62471F7E7607A032804D886F818 +:10A6F0008901012803D005E086F889A1D3E0E9A00B +:10A70000FAF714F896F88901022802D1EAA0FAF7BC +:10A710000DF896F8890103281DD1ECA03FE096F8CA +:10A720008901B4F80940012803D12146ECA0F9F7CA +:10A73000FDFF96F88901022803D12146EEA0F9F722 +:10A74000F5FF96F88901032803D12146F0A0F9F717 +:10A75000EDFFA6F88A41A6E0607A012809D086F8C4 +:10A760008CA196F88C01012806D0AFF6C071EEA03E +:10A7700097E086F88C71F4E7AFF6BC71F7E7607A82 +:10A78000012804D0022806D003280BD08BE086F8DD +:10A790009771ECA003E0022086F89701EEA0F9F78C +:10A7A000C5FF80E0032086F89701F0A0F7E7B4F832 +:10A7B0000910A6F89811A1F1C9030846934205D2E1 +:10A7C00000EB80020BEA4201A6F859100146ECA00A +:10A7D00067E0B4F80910A1F1C900904205D201EB7D +:10A7E00081020BEA4200A6F85D00A6F89A11ECA0DF +:10A7F00057E0B4F80910A6F89C11F1A051E0B4F8A4 +:10A800000910A6F89E1103E0B4F80910A6F8A011EB +:10A81000F5A046E0B4F80910A6F8A2110DE0B4F8CE +:10A820000910A6F8A41108E0B4F80910A6F8A611BA +:10A8300003E0B4F80910A6F8A811F3A031E0B4F8C9 +:10A840000910A6F8AA11F8E7B4F80910A6F8AC1197 +:10A85000F3E7B4F80910A6F8AE11EEE7B4F8091062 +:10A86000A6F8B011E9E7B4F80910A6F8B211E4E7C8 +:10A87000B4F80910A6F8B411DFE7B4F80910A6F887 +:10A88000B611DAE7B4F80910A6F8B811D5E7B4F8AC +:10A890000910A6F8BA11D0E7B4F80910A6F8BC114F +:10A8A000E1A0F9F743FF89F8007013B0BDE8F08F1D +:10A8B000B4F80910A6F8BE11FEF7C8BFC5E1C9E19A +:10A8C000CDE1D1E1D5E1D9E1DDE1E1E1E5E1E9E1A8 +:10A8D000EDE1F1E14DE2B3E1444352657175697216 +:10A8E00065566F6C742025643A4F7665722834384B +:10A8F0002D333030292020200A0D000044435265BA +:10A900007175697265566F6C743A25642E256420E2 +:10A910005620200A0D00000044435265717569728B +:10A920006543757272656E742564413A4F7665723F +:10A930002831302D31303041292020200A0D0000EF +:10A9400044435265717569726543757272656E74C0 +:10A95000256441200A0D000044434D6178506F7713 +:10A9600065722564203A4F76657228312D31356B3A +:10A970002909200A0D00000044434D6178506F778B +:10A9800065723A25642E2564206B77090A0D000054 +:10A9900044435F496E64756374616E636554656DAD +:10A9A00070202564200A0D0044435F4947425454F7 +:10A9B000656D70202564200A0D00000044434D6140 +:10A9C00078566F6C74202564563A4F766572283439 +:10A9D000382D32303056292020200A0D000000008A +:10A9E00044432044434D6178566F6C743A25642E7D +:10A9F0002564205620200A0D000000004443204416 +:10AA0000434D617843757272656E7425643A4F7672 +:10AA100065722832302D313130292020200A0D0076 +:10AA200044432044434D617843757272656E743AB5 +:10AA300025642E2564204120200A0D0043617061A9 +:10AA4000636974616E636554656D7031202564209F +:10AA50000A0D00004443426F7854656D7032202522 +:10AA600064200A0D00000000446F75626C6542614D +:10AA700074746572794D6F64652025730A0D00004A +:10AA800056494E205472616E732025730A0D0000E2 +:10AA9000426C75655369676E616C4C6F7373257397 +:10AAA0000A0D00004368617267654D6F64652D2D66 +:10AAB0006B77680A0D0000004368617267654D6F2F +:10AAC00064652D2D74696D650A0D0000436861721F +:10AAD00067654D6F64652D2D534F430A0D000000CF +:10AAE0004368617267654D6F64652D6B77682825D3 +:10AAF00064290A0D000000004368617267654D6FAC +:10AB000064652D74696D65282564290A0D000000AF +:10AB10004368617267654D6F64652D534F43282507 +:10AB200064290A0D000000006869676820766F6C70 +:10AB300074616765206D6F64756C652025730A0DFF +:10AB400000000000536F6353696D756C6154797038 +:10AB5000652D310A0D000000536F6353696D756CEC +:10AB600061547970652D320A0D000000536F6353F4 +:10AB7000696D756C61547970652D330A0D000000A4 +:10AB80000A0D20536F6353696D756C614D61785682 +:10AB90006F6C7420202564205620200A0D000000D0 +:10ABA0000A0D20536F6353696D756C614D696E5664 +:10ABB0006F6C7420202564205620200A0D000000B0 +:10ABC0000A0D20536F6343616C6962726174696F2F +:10ABD0006E566F6C74202025642028302E31295643 +:10ABE00020200A0D000000000A0D20536F6343610E +:10ABF0006C6962726174696F6E566F6C7420202587 +:10AC000064205620200A0D00536F6343616C696213 +:10AC1000726174696F6E566F6C74202025642056C3 +:10AC200020200A0D00000000536F6343616C6962CD +:10AC3000726174696F6E2020256420200A0D000067 +:10AC4000B4F80910A6F8C01136E6B4F80910A6F851 +:10AC5000C21131E6B4F80910A6F8C4112CE6B4F814 +:10AC60000910A6F8C61127E6B4F80910A6F8C8110D +:10AC700022E6B4F80910A6F8CA111DE6B4F80910C6 +:10AC8000A6F8CC1118E6B4F80910A6F8CE1113E610 +:10AC9000B4F80910A6F8D0110EE6B4F80910A6F819 +:10ACA000D21109E6B4F80910A6F8D41104E6B4F8F4 +:10ACB0000910A6F8D611FFE5B4F80910A6F8D811C6 +:10ACC000FAE588F805A0A2F802A09146A2F802A031 +:10ACD00000F0EEF94FF00008DFF8B4B027E004EB25 +:10ACE0000800002590F809A01BF835205146524570 +:10ACF00015D10BEBC50627A07278F9F717FDB9F847 +:10AD0000023007F109004B44727818447168EDF77E +:10AD10003BFAB9F8020071780844A9F802006D1CEA +:10AD2000EDB2672DE0D308F1010000F0FF08B8454F +:10AD3000D5D3B9F80220B81C1044A9F8020041F29A +:10AD40000500A9F80500E07989F80700494689F867 +:10AD50000870002005E022180B18527A401C5A7225 +:10AD6000C0B2B842F7D311AA69461348F2F722FAE3 +:10AD70009BE5E0790128FBD186F8B9A078210F483E +:10AD8000EDF71BFAF6F74EFD0DA0FEF71EBB000017 +:10AD9000D40700207265616420706172616D20616A +:10ADA000646472203078257820706172616D206C47 +:10ADB000656E2025640A0D006E340020462B0020AD +:10ADC00052656365697665207265636F726473208E +:10ADD00061636B0A0D0000000348B0F82B000028E7 +:10ADE00000D00120704700003A2A002070474188B7 +:10ADF00019B1806808B10020704701207047418870 +:10AE00000088814201D3012070470020704710B5AF +:10AE10000380002444808160828002FB0312C0E929 +:10AE20000321416110BD10B5044640880B46A0B116 +:10AE3000A06890B1A28818466169EDF7A5F9A188CC +:10AE4000606908446061E268904201D3A068606173 +:10AE50006088401E6080084610BD002010BD10B5FF +:10AE6000044640882288904213D2A06888B1A28804 +:10AE70002069EDF789F9A188206908442061E1681B +:10AE8000884201D3A06820616088401C6080012056 +:10AE900010BD002010BD000030B5044687B0012170 +:10AEA0000420F5F77DFA01214804F5F761FA042042 +:10AEB000ADF8100003208DF812001820224D8DF8F7 +:10AEC000130004A92846F3F7CBF90820ADF81000C9 +:10AED00048208DF8130004A92846F3F7C1F926206D +:10AEE0008DF8140001218DF815108DF816108DF8CD +:10AEF000171005A8F4F7EEFA0020ADF8040000944E +:10AF0000ADF80600ADF80800ADF80C000C200F4CB1 +:10AF1000ADF80A0069462046F8F78EFD012240F29E +:10AF200025512046F8F770FD012240F224412046C9 +:10AF3000F8F76AFD01212046F8F7FBFC8021204646 +:10AF4000F8F7EEFC07B030BD0008014000440040B7 +:10AF500070B5054686B001211120F5F721FA0121CF +:10AF6000C804F5F705FA4FF48060ADF8100003242B +:10AF70008DF8124018201E4E8DF8130004A930469B +:10AF8000F3F76EF9F014ADF8100048208DF81300B7 +:10AF900004A93046F3F764F934208DF814008DF8D5 +:10AFA00015408DF8164001208DF8170005A8F4F71C +:10AFB00091FA0020ADF80400ADF80600ADF80800E5 +:10AFC000ADF80C000C200B4CADF80A00009569465A +:10AFD0002046F8F731FD01212046F8F7AAFC0122AE +:10AFE00040F225512046F8F70FFD06B070BD000075 +:10AFF00000100140004C004030B5054687B00121EB +:10B000003020F5F7CDF901210805F5F7B1F94FF436 +:10B010008050ADF8100003248DF8124018208DF8F0 +:10B02000130004A91E48F3F71BF90420ADF8100023 +:10B0300048208DF8130004A91A48F3F711F93520B8 +:10B040008DF8140001218DF815108DF816408DF83B +:10B05000171005A8F4F73EFA0020ADF80400ADF88B +:10B060000600ADF80800ADF80C000C200E4CADF851 +:10B070000A00009569462046F8F7DEFC012240F2FE +:10B0800025512046F8F7C0FC012240F22441204619 +:10B09000F8F7BAFC01212046F8F74BFC07B030BDA9 +:10B0A000001001400014014000500040FDF742BF75 +:10B0B000254810B5B0F859100A22B1FBF2F3234924 +:10B0C0000B80B0F85B30B3FBF2F34B80B0F8833009 +:10B0D000B3FBF2F30B82B0F85330B3FBF2F30B8304 +:10B0E000B0F88E30B3FBF2F38B82B0F88530B3FB4F +:10B0F000F2F34B8290F88B30B3FBF2F38B7690F83F +:10B100008C30B3FBF2F3CB76B0F89030B3FBF2F3B4 +:10B11000CB82B0F8B130B3FBF2F4B0F8B340B4FB7B +:10B12000F2F4B3FBF2F2CC838A8390F8B620323A81 +:10B1300081F8212090F8B520323A81F8202090F84B +:10B14000790181F8220010BD8C2A002008360020E9 +:10B1500070B5164E002505EB450000EBC50006EB6B +:10B16000001494F8540003281BD394F8910001288C +:10B1700003D122780421FBF77FFD94F89100022887 +:10B180000FD194F8AC00401CC0B284F8AC00022887 +:10B1900007D3032084F89100227804210120FBF7D3 +:10B1A0006BFD6D1CEDB2022DD5D370BDC01100201A +:10B1B0004101420243034404450546064707480847 +:10B1C00049004A014B024C034D044E054F00500705 +:10B1D000510852095302540355045605570658079F +:10B1E00059085A0962006200620062006200E603C8 +:10B1F00000000000F16B0108356C0108556A010878 +:10B20000000000000000000000000000000000003E +:10B2100001000000F16B0108356C0108556A010856 +:10B22000000000000000000000000000000000001E +:10B2300000008A02020002007602B6030200050046 +:10B2400084034006020005000E063A0702000500CE +:10B250001C07600902000500D8FF0000F8339F4377 +:10B26000D9FF000058699543DAFF0000BA298C43E2 +:10B27000DBFF0000C77B8343DCFF000071BD76432A +:10B28000DDFF0000A09A6743DEFF00000080594305 +:10B29000DFFF0000E75B4C43E0FF0000E71B40439B +:10B2A000E1FF00001BAF3443E2FF00005A042A43D1 +:10B2B000E3FF00008B0C2043E4FF00001DBA16439F +:10B2C000E5FF000042000E43E6FF0000B6D3054351 +:10B2D000E7FF00007B54FC42E8FF0000C3F5ED42AD +:10B2E000E9FF00005879E042EAFF000068D1D3424C +:10B2F000EBFF0000E6EEC742ECFF0000AFC5BC422A +:10B30000EDFF0000C749B242EEFF00002E70A842D8 +:10B31000EFFF0000B22E9F42F0FF0000C07B96427C +:10B32000F1FF00008A4E8E42F2FF0000AB9E864283 +:10B33000F3FF00009AC87E42F4FF0000073071421C +:10B34000F5FF0000FE656442F6FF0000645D5842B0 +:10B35000F7FF0000230A4D42F8FF0000C56042429B +:10B36000F9FF00006D563842FAFF000048E12E4216 +:10B37000FBFF0000B5F72542FCFF000000911D42D5 +:10B38000FDFF0000DDA41542FEFF00009F2B0E42D2 +:10B39000FFFF0000011E0742000000005A75004236 +:10B3A00001000000A156F441020000005474E8417D +:10B3B000030000005238DD4104000000FC98D24137 +:10B3C000050000004A8CC84106000000D509BF41B5 +:10B3D00007000000CE08B64108000000D881AD414A +:10B3E00009000000916DA5410A00000039C59D418A +:10B3F0000B000000758296410C0000008A9F8F416F +:10B400000D000000F01689410E00000088E3824123 +:10B410000F00000069007A4110000000B7D16E41B2 +:10B42000110000006132644112000000CE195A413F +:10B43000130000006F815041140000007C614741FF +:10B440001500000039B43E41160000001973364162 +:10B4500017000000F6972E41180000004F1E2741EC +:10B4600019000000000020411A000000DA381941DC +:10B470001B00000028C412411C000000939D0C41D9 +:10B480001D00000020C106411E000000022B0141EA +:10B490001F00000025AFF74020000000D786ED40D8 +:10B4A00021000000A1D6E340220000009E98DA406F +:10B4B00023000000E7C6D14024000000145CC9400E +:10B4C000250000001153C14026000000DFA6B9404E +:10B4D00027000000FC52B240280000001153AB408E +:10B4E00029000000DBA2A4402A000000963E9E40F6 +:10B4F0002B0000007D2298402C0000000A4B924057 +:10B500002D000000E1B48C402E000000E65C874076 +:10B510002F00000010408240300000002CB77A401D +:10B52000310000006059714032000000D061684075 +:10B530003300000092CB5F4034000000109257406F +:10B5400035000000DEB04F4036000000E2234840E6 +:10B55000370000002EE740403800000027F7394050 +:10B5600039000000DF4F33403A00000063EE2C400A +:10B570003B0000006CCF26403C000000B3EF2040B1 +:10B580003D000000984C1B403E00000054E3154075 +:10B590003F0000001CB1104040000000D0B30B4041 +:10B5A00041000000A7E8064042000000D34D0240E1 +:10B5B00043000000BEC1FB3F44000000FB3FF33FDF +:10B5C000450000001B12EB3F460000002B35E33F17 +:10B5D00047000000E8A4DB3F480000005F5ED43F66 +:10B5E000490000004A5ECD3F4A000000B6A1C63FB8 +:10B5F0004B0000000326C03F4C0000003EE8B93F6E +:10B600004D00000075E5B33F4E000000041CAE3F46 +:10B610004F000000A488A83F50000000062AA33F66 +:10B620005100000037FD9D3F520000009300993FFC +:10B63000530000002332943F54000000EF8F8F3FEF +:10B640005500000001188B3F5600000008C9863FD6 +:10B650005700000062A1823F580000002D3E7D3F50 +:10B6600059000000AE81753F5A0000004E0B6E3F3E +:10B670005B0000001FD7663F5C0000002AE35F3FCD +:10B680005D000000CF2C593F5E00000018B2523F11 +:10B690005F00000065704C3F600000001765463F8A +:10B6A00061000000DE8E403F620000001CEB3A3F6C +:10B6B00063000000D977353F640000006E34303FEE +:10B6C00065000000931D2B3F66000000A032263F5E +:10B6D000670000009F71213F6800000040D91C3FB7 +:10B6E000690000008C67183F6A000000331B143F9C +:10B6F0006B000000E5F20F3F6C00000052ED0B3FC5 +:10B700006D0000002D09083F6E000000CC45043F8D +:10B710006F00000038A1003F700000009335FA3E32 +:10B72000710000006362F33E720000008FC7EC3EC0 +:10B73000730000007862E63E740000007F30E03E57 +:10B7400075000000A531DA3E76000000FA61D43EB3 +:10B75000770000007FC1CE3E78000000944DC93EC6 +:10B76000790000003A06C43E7A00000082E7BE3E3F +:10B770007B0000006BF1B93E7C0000005721B53E14 +:10B780007D0000009678B03E00C1814001C080413C +:10B7900001C0804100C1814001C0804100C18140A1 +:10B7A00000C1814001C0804101C0804100C1814091 +:10B7B00000C1814001C0804100C1814001C0804181 +:10B7C00001C0804100C1814001C0804100C1814071 +:10B7D00000C1814001C0804100C1814001C0804161 +:10B7E00001C0804100C1814000C1814001C0804151 +:10B7F00001C0804100C1814001C0804100C1814041 +:10B8000000C1814001C0804101C0804100C1814030 +:10B8100000C1814001C0804100C1814001C0804120 +:10B8200001C0804100C1814000C1814001C0804110 +:10B8300001C0804100C1814001C0804100C1814000 +:10B8400000C1814001C0804100C1814001C08041F0 +:10B8500001C0804100C1814001C0804100C18140E0 +:10B8600000C1814001C0804101C0804100C18140D0 +:10B8700000C1814001C0804100C1814001C08041C0 +:10B8800001C0804100C1814000C0C101C30302C2A8 +:10B89000C60607C705C5C404CC0C0DCD0FCFCE0E10 +:10B8A0000ACACB0BC90908C8D81819D91BDBDA1A80 +:10B8B0001EDEDF1FDD1D1CDC14D4D515D71716D6F0 +:10B8C000D21213D311D1D010F03031F133F3F23260 +:10B8D00036F6F737F53534F43CFCFD3DFF3F3EFED0 +:10B8E000FA3A3BFB39F9F83828E8E929EB2B2AEA40 +:10B8F000EE2E2FEF2DEDEC2CE42425E527E7E626B0 +:10B9000022E2E323E12120E0A06061A163A3A2621F +:10B9100066A6A767A56564A46CACAD6DAF6F6EAE8F +:10B92000AA6A6BAB69A9A86878B8B979BB7B7ABAFF +:10B93000BE7E7FBF7DBDBC7CB47475B577B7B6766F +:10B9400072B2B373B17170B05090915193535292DF +:10B9500096565797559594549C5C5D9D5F9F9E5E4F +:10B960005A9A9B5B99595898884849894B8B8A4ABF +:10B970004E8E8F4F8D4D4C8C44848545874746862F +:10B9800082424383418180402003BC028A025802E4 +:10B990002602F401C20190015E012C018873C000EF +:10B9A00017801F0016801F0017811F0016811F00BF +:10B9B00019801F0019811F004B801F0012801F007B +:10B9C00012811F001C801F0063801F0098801F00D1 +:10B9D00007801F001E801F001C811F0098811F0010 +:10B9E00029801F00000022002500340046004B0083 +:10B9F00059006C007A0088008E00920096009A0030 +:10BA00009E00A100A400A700AA0020010D10030CB5 +:10BA1000110C0C040202020201010101010080F17B +:10BA200086F187F194F18AF18CF190F191F198F11E +:10BA300099F110FE11FE12FE13FE14FE15FE16FE05 +:10BA400017FE18FE90F198F199F110FE11FE12FE0A +:10BA500013FE14FE15FE16FE17FE18FE000013005E +:10BA6000210027002B002F00330037003A003D0053 +:10BA70004000430011000C0004000200020002001C +:10BA80000200010001000100010001001011141961 +:10BA9000222E273E3128857F423330433830000044 +:10BAA0000000000001000000BCC50108856F01080E +:10BAB000010000006CC50108457A01080100000082 +:10BAC00064C50108157A010801000000B0C501082D +:10BAD0002D7C010801000000A8C50108257D010892 +:10BAE000010000009CC50108237D01080100000041 +:10BAF00074C50108217D01080100000080C501080E +:10BB0000A57901080100000090C501081181010814 +:10BB1000010000008CC501080D7A01080100000039 +:10BB200094C50108ED80010800C1814001C0804139 +:10BB300001C0804100C1814001C0804100C18140FD +:10BB400000C1814001C0804101C0804100C18140ED +:10BB500000C1814001C0804100C1814001C08041DD +:10BB600001C0804100C1814001C0804100C18140CD +:10BB700000C1814001C0804100C1814001C08041BD +:10BB800001C0804100C1814000C1814001C08041AD +:10BB900001C0804100C1814001C0804100C181409D +:10BBA00000C1814001C0804101C0804100C181408D +:10BBB00000C1814001C0804100C1814001C080417D +:10BBC00001C0804100C1814000C1814001C080416D +:10BBD00001C0804100C1814001C0804100C181405D +:10BBE00000C1814001C0804100C1814001C080414D +:10BBF00001C0804100C1814001C0804100C181403D +:10BC000000C1814001C0804101C0804100C181402C +:10BC100000C1814001C0804100C1814001C080411C +:10BC200001C0804100C1814000C0C101C30302C204 +:10BC3000C60607C705C5C404CC0C0DCD0FCFCE0E6C +:10BC40000ACACB0BC90908C8D81819D91BDBDA1ADC +:10BC50001EDEDF1FDD1D1CDC14D4D515D71716D64C +:10BC6000D21213D311D1D010F03031F133F3F232BC +:10BC700036F6F737F53534F43CFCFD3DFF3F3EFE2C +:10BC8000FA3A3BFB39F9F83828E8E929EB2B2AEA9C +:10BC9000EE2E2FEF2DEDEC2CE42425E527E7E6260C +:10BCA00022E2E323E12120E0A06061A163A3A2627C +:10BCB00066A6A767A56564A46CACAD6DAF6F6EAEEC +:10BCC000AA6A6BAB69A9A86878B8B979BB7B7ABA5C +:10BCD000BE7E7FBF7DBDBC7CB47475B577B7B676CC +:10BCE00072B2B373B17170B050909151935352923C +:10BCF00096565797559594549C5C5D9D5F9F9E5EAC +:10BD00005A9A9B5B99595898884849894B8B8A4A1B +:10BD10004E8E8F4F8D4D4C8C44848545874746868B +:10BD20008242438341818040B3E4B5E7D7AEB5E7B3 +:10BD3000C1F7B3ACB9FD626D73D0E8C7F3B5E7C125 +:10BD4000F72FD7EEB4F3B3E4B5E7B5E7C1F720209A +:10BD500000000000BDD3CAD5B3B5C1BEB1A8CEC4E2 +:10BD6000B3ACCAB120000000B3E4B5E7B2E5D7F93F +:10BD7000CEC2B6C8D2ECB3A300000000B3E4B5E76E +:10BD8000D7AECAE4B3F6B5E7D1B9B9FDD1B9B1A31D +:10BD9000BBA40000B3E4B5E7D7AEB3ACB9A6C2CA42 +:10BDA000B1A3BBA400000000B5E7B3D8BCD3C8C89A +:10BDB000BCCCB5E7C6F7D5B3C1AC0000D6F7BCCC58 +:10BDC000B5E7C6F7D5B3C1AC00000000564355D760 +:10BDD000B4CCACB7C7B3E4B5E7D7B4CCAC00000083 +:10BDE000B3E4B5E7D7AEB5E7C1F7B2A8B6AF000088 +:10BDF000B3E4B5E7D7AEB6FEB4CEC6F4B6AF000036 +:10BE0000B5A5CCE5C7B7D1B9B1A8BEAF0000000059 +:10BE1000B5A5CCE5B5CDCEC2B1A8BEAF000000003F +:10BE2000C8C8CAA7BFD8B1A8BEAF0000B5A5CCE5A9 +:10BE3000B8DFCEC2B8E6BEAF00000000BDD3CAD5A1 +:10BE4000B3E4B5E7D7AECAFDBEDDB1A8CEC4B3AC8E +:10BE5000CAB10000464443B6FEB4CEC6F4B6AFB491 +:10BE6000CECAFDB3ACCAB100B5A5CCE5B9FDD1B918 +:10BE700000000000B3A4C6DACEDEB5E7C1F7CDA35B +:10BE8000D6B90000B5E7B3D8CEB4D7BCB1B8BAC301 +:10BE900000000000CAD5B5BDB3E4B5E7D7AECDA369 +:10BEA000D6B9B3E4B5E7B1A8CEC40000B5E7B3D8BE +:10BEB000B0FCB1A3CFD5C8DBB6CF0000B8DFD1B995 +:10BEC000BBD8C2B7D6F7B1A3CFD5D5EFB6CF000058 +:10BED000B5E7B3D8D6F7D5FDD6F7B8BABDD3B4A574 +:10BEE000C6F7CEB4B1D5BACF00000000B5A5B4CE28 +:10BEF000BCD3C8C8CAB1BCE4B3A4B9CAD5CF00008A +:10BF0000BEF8D4B5B9CAD5CF00000000B5E7B3D8A4 +:10BF1000B0FCD7DCD1B9B2C9D1F9BBD8C2B7B9CA64 +:10BF2000D5CF0000D7DCB5E7D1B9B9FDD1B9B9CAD1 +:10BF3000D5CF0000B5A5CCE5B9FDD1B9B9CAD5CFEB +:10BF400000000000B3B5C1BE43414ECDA8D0C5B975 +:10BF5000CAD5CF00564355CDA8D0C5B9CAD5CF0054 +:10BF6000B8A8D6FAB5E7D4B4B5CDB9CAD5CF0000D4 +:10BF7000464443CAE4C8EBB7B4BDD3B9CAD5CF0071 +:10BF8000464443CAE4B3F6B7B4BDD3B9CAD5CF006B +:10BF9000736F6320B8DFB9CAD5CF0000B5E7D4B45A +:10BFA000C4A3BFE9B9CAD5CF00000000B5A5CCE550 +:10BFB000D1B9B2EEB9CAD5CF00000000CEC2B2EE00 +:10BFC000B9CAD5CF00000000B5E7C1F7B4ABB8D00F +:10BFD000C6F7B9CAD5CF0000464443CAE4B3F6BC9D +:10BFE000CCB5E7C6F7B9CAD5CF000000B8DFD1B9E4 +:10BFF000BBB7C2B7BBA5CBF8B9CAD5CF000000000C +:10C00000B5E7B3D8B0FCB3E4B5E7D0C5BAC5D7B48B +:10C01000CCACB2BBB6D40000D4A4B3E4CAA7B0DCA5 +:10C0200000000000B5E7B3D8B5A5CCE5B5E7D1B9B8 +:10C03000B2C9BCAFCFDFB6CFCFDF0000B5A5CCE52E +:10C04000CEC2B8D0B2C9BCAFCFDFB6CFCFDF000011 +:10C05000B9FDB3E400000000626F6F7374C9FDD1D5 +:10C06000B9B5E7D1B9B2BBC6A5C5E400D7DCB5E721 +:10C07000D1B9C7B7D1B9BEAFB8E60000B5E7B3D8FC +:10C08000B5CDCEC2BEAFB8E600000000B5E7B3D86C +:10C09000B8DFCEC2BEAFB8E600000000736F63B574 +:10C0A000CDBEAFB8E6000000736F6320CCF8B1E4FA +:10C0B000BEAFB8E600000000564355BDFBD6B9B38D +:10C0C000E4B5E70056B3B5C1BEB5E7B3D8B0FCB32D +:10C0D000E4B5E7D7B4CCACB7C72D2DBFECB3E4BF04 +:10C0E000C9B3E4B5E7000000B7C5B5E7B9FDC1F7CE +:10C0F00000000000B3E4B5E7B9FDC1F7000000009F +:10C10000B5E7C1F7B2C9D1F900000000B9FDCEC250 +:10C11000BDB5D4D82FCDA3BBFA000000534F43B414 +:10C12000EFB5BD313030CDA3BBFA0000B5E7B3D8D1 +:10C13000B5E7C1F7D0E8C7F3CEAA30CDA3BBFA006C +:10C14000B3E4B5E7B4EFB5BDC9E8B6A8534F43CDE6 +:10C15000A3BBFA00B3E4B5E7C1F7B3CCB3ACCAB143 +:10C16000CDA3BBFA00000000B3E4B5E7D7AECAE444 +:10C17000B3F6B5E7D1B92DB9FDD1B9CDA3BBFA005E +:10C18000B3E4B5E7B4EFB5BDB5E7B3D8C8DDC1BF1B +:10C19000CDA3BBFA00000000B3E4B5E7B4EFB5BD32 +:10C1A000C9E8B6A8CAB1BCE4CDA3BBFA0000000040 +:10C1B000B3E4B5E7D7AEB8A8D6FAB5E7D4B432340D +:10C1C00056C6BDCCA82D2DB3E4B5E7CDA3BBFA0070 +:10C1D000D0A1B3CCD0F2CDA3BBFA000063616E2036 +:10C1E000323A2073746570282564292C20726563A7 +:10C1F0006F7276657279282564292C206C617374BE +:10C2000020627573206F6666207469636B282564ED +:10C21000292020206C617374207265636F766572CB +:10C2200079207469636B28256429210A00000000C5 +:10C2300063616E20313A2073746570282564292C5F +:10C24000207265636F7276657279282564292C20C7 +:10C250006C61737420627573206F66662074696305 +:10C260006B282564292C2020206C61737420726552 +:10C27000636F76657279207469636B282564292160 +:10C280000A0000006E6D5F7265633A206E65772567 +:10C29000643A20414C3A2564204E6574776F726B86 +:10C2A000436F6D6D616E643A256420636F756E74C3 +:10C2B00065723A256420636F6E74726F6C5F73747D +:10C2C000733A25640D0A0000455F4E4D5F5354419B +:10C2D0005455535F504F5745524F4646000000009B +:10C2E000455F4E4D5F5354415455535F4E45544F37 +:10C2F00046460000455F4E4D5F5354415455535FD1 +:10C30000574149545F414354494F4E00455F4E4D9C +:10C310005F5354415455535F4E45544F4E000000F7 +:10C32000455F4E4D5F5354415455535F57414954F7 +:10C330005F5354415254555000000000455F4E4D2C +:10C340005F5354415455535F4E4554534C49454EE9 +:10C35000540000006661756C745F72656C61795F92 +:10C3600065727220200000006661756C745F636FF7 +:10C370006D5F6363752020006661756C745F636F29 +:10C380006D5F7665636869636C6500006661756CF6 +:10C39000745F677269645F696E7075745F726576E9 +:10C3A00065727365000000006661756C745F67728A +:10C3B00069645F6F75747075745F726576657273AA +:10C3C000650000006661756C745F677269645F7612 +:10C3D0006F6C745F756E6465720000006661756CE9 +:10C3E000745F6C6F61645F6F766572006661756C17 +:10C3F000745F74656D705F6F766572006661756CF1 +:10C40000745F677269645F637572725F6F7665727D +:10C41000000000006661756C745F677269645F7626 +:10C420006F6C745F6F766572000000006661756CFA +:10C43000745F706F77657232345F657272000000EE +:10C440006175785F756E6465725F766F6C5F65723B +:10C45000720000006661756C745F6E6F5F63757269 +:10C46000720000006661756C745F4261745F556EA6 +:10C47000646572566F6C7400426174B5E7D1B9B5EA +:10C48000CDD1B92020000000425553B5E7D1B9B550 +:10C49000CDD1B900425553D3D0D0A7B5E7D1B9B962 +:10C4A000FDD1B900426174CBB2D3D0D0A7B5E7D1EA +:10C4B000B9B9FDD1B9000000425553CBB2CAB1B5EC +:10C4C000E7D1B9B9FDD1B900426174CBB2CAB1B5F7 +:10C4D000E7D1B9B9FDD1B900B9FDCEC2B9CAD5CF3E +:10C4E000000000004275636BD3D0D0A7B5E7C1F759 +:10C4F000B9FDC1F7000000004275636BCBB2CAB151 +:10C50000B5E7C1F7B9FDC1F7000000004275636BE4 +:10C51000B5E7C1F7D3B2BCFEB9FDC1F7000000001A +:10C520000D0A3737375570642D2D747970653A25AB +:10C530003078202C7665723A2530782C54627974E4 +:10C54000653A2530782C204372633A2530782C5098 +:10C5500061673A2530782C506C656E3A2530780D3D +:10C560000A0000004F464644434443004F4E4443B4 +:10C570004443000053455441504E5057440000007E +:10C58000434849504445434F444500004F46460008 +:10C5900043414E00414C5F4F4E0000005345544113 +:10C5A000504E55534552000054455354424D53008C +:10C5B000524541444D41535300000000534554003F +:10C5C000E0C50108000000201C0B0000588B00088B +:10C5D00090CB01081C0B0020DC6C00008447010894 +:10C5E000D1BBE8030B32022D58C00108163694BEA9 +:10C5F00001080436D0C101080636E0BD0108071A5B +:10C60000741832081A3C0832091AF018320A1A0C47 +:10C6100028320B1A6808320C1A2818320D1AB0107A +:10C62000320E1A5410320F1AC46032101ACC102A6B +:10C63000111819482A1208192832131A7C183214B2 +:10C640002E9CBF01081588191032161A8010321757 +:10C650001A700832181AD8082A19181938321A1AF2 +:10C660009808321B1A4008321C1A1C08321D1A6026 +:10C67000282A1E98196832321AAC082A33D81908A9 +:10C6800032341A840832351AB898423619083237CB +:10C690001A2C402A380819202A39F019182A3AE8A1 +:10C6A0001950323B1A2410323C1A34102A3D10190A +:10C6B00008323E1AEC08323F1ABC082A40701908AA +:10C6C0002A4110194832421AE8384243196032446C +:10C6D0001AC8204245190832461A90082A473019CC +:10C6E000F832481A183032491AA810324A1A44202F +:10C6F0002A4BD01910324C1A50202A4D781960322A +:10C700004E1A5420324F1A2010325B1A8C20325CA1 +:10C710001A1010425D1908325E1A6C18325F1A9CAA +:10C72000082A6060190832611AF40832621A7C081B +:10C730001184A24A04680D010203040607080902D5 +:10C74000040608106914B13A0F1C2214F2FF0310FA +:10C75000E8030910120171220113A1FD1B0803E671 +:10C76000277D02010821051E2903010810101A095E +:10C77000081A30081AD9181A91AA1AB1281A691079 +:10C780001AC9081A6A0813D5FF1B086B0812691C1E +:10C7900001086C081AED081A6D081E1D0101086ECB +:10C7A000081A75081A6F081AA1081A70081ACD0815 +:10C7B0001A40601365FE1B0841081A8D081A4208CA +:10C7C0001AB5081A43081ADD081A44081A05581A37 +:10C7D00045081A2D081A46081A55081A47081A7DDE +:10C7E000081A48081AA5081A60081A11981A660843 +:10C7F0001A31781122061A7198811A12101AE8B4A7 +:10C80000811A800C1AF4EC811A5290A910DA531094 +:10C81000DA5410DA511000091CD5FBB3B5D0ADD2F3 +:10C82000E95B030A2C08082A690108096A0108342F +:10C83000C11EC8C20108E0041E20C301080C041A6E +:10C840003C041AF41041180A298A01081F890108BA +:10C850006D041A71041AA90461920213F0FF622098 +:10C86000021FA67A01E20530CA08E803328336398E +:10C870008101088536EDAD010887363D92010889B2 +:10C880004B718F981AECBC29651ADC0829A22D146B +:10C89000C40108691AC41032041AFC0832051A8C43 +:10C8A0000832061AA80832071A5428320A1A7810D1 +:10C8B000320B1A6808320C1A2C18320D1A40082A4A +:10C8C0000E281918320F1A641001141AB81829808A +:10C8D0001A940829805AC8801AA40829801AF808CE +:10C8E00029801AE40829804B0CC5801AD8102951D8 +:10C8F0001A88082A0988091560013C14643201125B +:10C900000102811F1BD92AE41D2B01082D041A6185 +:10C91000041A81041E1D2C0108A1081A85081A5149 +:10C92000041AE90C1AA908054E8D35010823FFFFEA +:10C930000330E803230201130C0B5B2001085A03A8 +:10C940000823051013AC2A1B2004081A9C082B0688 +:10C9500002E0111B2007081AF5081A08281AF70820 +:10C960001A09201A8C081A0A1013132B1B200F08FF +:10C970001A18081A0E081A17081A0D081A16081A93 +:10C980000C081A15085A0B601A13481AE7381A12BD +:10C99000081AE5081A11081A11201A10081A0F08A7 +:10C9A0001A140829281A150813EC161B2016081A41 +:10C9B000EF282317041AB0181A18481A3C281A1915 +:10C9C000101AB8101A1AFA1AC008231B111A2118C3 +:10C9D0001B1C08B019101A1F28131E361B201E0816 +:10C9E0001A20081A1D081A19201A20081A26101AC7 +:10C9F00021081A24081A22081A43185A24901A23C4 +:10CA0000081AEB085A27681A26081A29281A25082E +:10CA10001A28081A28201AE9201A29101A1F201A81 +:10CA20002A101A32081A2B101A34085A30B01A3148 +:10CA3000081A1C301A32181AD9101A33081ADB08CF +:10CA40001A34081ADD082A35A019304B360AB823E3 +:10CA500037071A2B081A501811122C1B2051401A94 +:10CA600001081A52081A03081A53181A05081A540A +:10CA7000081A07081A55081A08081A56201A090829 +:10CA80001A57081A0B081A58181A0D081A59081AB2 +:10CA90000E081A5A081A1C081A60081A13081A6194 +:10CAA000081A14081A62081A15081A63381A1608A0 +:10CAB0001A65101A18081A66081A19081A6D081A41 +:10CAC00023081A6E201A24081A6F081A26081A70EA +:10CAD000081A28081A71081A2A081A72081A2C0843 +:10CAE0001A73081A2E081A74081A30081A75081AC8 +:10CAF00032081A76081A34081A77081A36081A788B +:10CB0000081A38081A79081A3A081A7A081A3C08D2 +:10CB10001A7B081A3E081A7C081A40081A7D081A5F +:10CB200042081A7E081A44081A7F081A46081A8012 +:10CB3000081A48081A81081A4A081A82081A4C0862 +:10CB40001A83081A4E081A84081A50081A85081AF7 +:10CB500052081A86081A54081A87081A56081A889A +:10CB6000081A58081A89081A5A081A8A081A5C08F2 +:10CB70001A8B081A5E081A8C081A60081A8D081A8F +:10CB800062081A8E081A64081A8F081A66080110BB +:04000005080081511D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project_GD32F10X_CL.dep b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project_GD32F10X_CL.dep new file mode 100644 index 0000000..22674bb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/Project_GD32F10X_CL.dep @@ -0,0 +1,2269 @@ +Dependencies for Project 'Project', Target 'GD32F10X_CL': (DO NOT MODIFY !) +F (..\gd32f10x_it.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_it.o --omf_browse .\output\gd32f10x_it.crf --depend .\output\gd32f10x_it.d) +I (..\gd32f10x_it.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\main.c)(0x66557807)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\main.o --omf_browse .\output\main.crf --depend .\output\main.d) +I (..\systick.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (..\main.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\chipID\chipid.h)(0x66207443) +I (..\..\Firmware\SYSTEM\delay\delay.h)(0x66207443) +I (..\..\Firmware\HARDWARE\TIMER\timer.h)(0x66207443) +I (..\..\Firmware\SYSTEM\usart\usart.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\CAN\bsp_can.h)(0x66207443) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\ADS1015\ADS1015.h)(0x66207443) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +I (..\..\Firmware\HARDWARE\24C0X\24cxx.h)(0x66207443) +I (..\..\Firmware\HARDWARE\common\common.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h)(0x66207443) +F (..\systick.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\systick.o --omf_browse .\output\systick.crf --depend .\output\systick.d) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\STM32_file\stm32f10x_it.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_it.o --omf_browse .\output\stm32f10x_it.crf --depend .\output\stm32f10x_it.d) +I (..\..\Firmware\STM32_file\stm32f10x_it.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32_file\system_stm32f10x.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\system_stm32f10x.o --omf_browse .\output\system_stm32f10x.crf --depend .\output\system_stm32f10x.d) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_adc.o --omf_browse .\output\gd32f10x_adc.crf --depend .\output\gd32f10x_adc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_adc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_bkp.o --omf_browse .\output\gd32f10x_bkp.crf --depend .\output\gd32f10x_bkp.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_can.o --omf_browse .\output\gd32f10x_can.crf --depend .\output\gd32f10x_can.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_can.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_dac.o --omf_browse .\output\gd32f10x_dac.crf --depend .\output\gd32f10x_dac.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dac.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_dbg.o --omf_browse .\output\gd32f10x_dbg.crf --depend .\output\gd32f10x_dbg.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dbg.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_dma.o --omf_browse .\output\gd32f10x_dma.crf --depend .\output\gd32f10x_dma.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dma.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_enet.o --omf_browse .\output\gd32f10x_enet.crf --depend .\output\gd32f10x_enet.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_enet.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_crc.o --omf_browse .\output\gd32f10x_crc.crf --depend .\output\gd32f10x_crc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_crc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_exmc.o --omf_browse .\output\gd32f10x_exmc.crf --depend .\output\gd32f10x_exmc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_exmc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_exti.o --omf_browse .\output\gd32f10x_exti.crf --depend .\output\gd32f10x_exti.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_exti.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_fmc.o --omf_browse .\output\gd32f10x_fmc.crf --depend .\output\gd32f10x_fmc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_fmc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_fwdgt.o --omf_browse .\output\gd32f10x_fwdgt.crf --depend .\output\gd32f10x_fwdgt.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_fwdgt.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_gpio.o --omf_browse .\output\gd32f10x_gpio.crf --depend .\output\gd32f10x_gpio.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_i2c.o --omf_browse .\output\gd32f10x_i2c.crf --depend .\output\gd32f10x_i2c.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_misc.o --omf_browse .\output\gd32f10x_misc.crf --depend .\output\gd32f10x_misc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_misc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_pmu.o --omf_browse .\output\gd32f10x_pmu.crf --depend .\output\gd32f10x_pmu.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_pmu.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_rcu.o --omf_browse .\output\gd32f10x_rcu.crf --depend .\output\gd32f10x_rcu.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_rcu.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_rtc.o --omf_browse .\output\gd32f10x_rtc.crf --depend .\output\gd32f10x_rtc.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_sdio.o --omf_browse .\output\gd32f10x_sdio.crf --depend .\output\gd32f10x_sdio.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_spi.o --omf_browse .\output\gd32f10x_spi.crf --depend .\output\gd32f10x_spi.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_spi.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_timer.o --omf_browse .\output\gd32f10x_timer.crf --depend .\output\gd32f10x_timer.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_timer.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_usart.o --omf_browse .\output\gd32f10x_usart.crf --depend .\output\gd32f10x_usart.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_usart.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\gd32f10x_wwdgt.o --omf_browse .\output\gd32f10x_wwdgt.crf --depend .\output\gd32f10x_wwdgt.d) +I (..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_wwdgt.h)(0x66207443) +I (..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h)(0x66207443) +F (..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_cl.s)(0x66207443)() +F (..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_hd.s)(0x66207443)() +F (..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_md.s)(0x66207443)() +F (..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_gd32f10x_xd.s)(0x66207443)() +F (..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_stm32f10x_cl.s)(0x66207443)(--cpu Cortex-M3 -g --apcs=interwork --pd "__MICROLIB SETA 1" -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include --pd "__UVISION_VERSION SETA 525" --pd "STM32F10X_CL SETA 1" --list .\list\startup_stm32f10x_cl.lst --xref -o .\output\startup_stm32f10x_cl.o --depend .\output\startup_stm32f10x_cl.d) +F (..\..\Utilities\gd32f10x_eval.c)(0x66207443)() +F (..\readme.txt)(0x66207443)() +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\misc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\misc.o --omf_browse .\output\misc.crf --depend .\output\misc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_adc.o --omf_browse .\output\stm32f10x_adc.crf --depend .\output\stm32f10x_adc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_bkp.o --omf_browse .\output\stm32f10x_bkp.crf --depend .\output\stm32f10x_bkp.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_can.o --omf_browse .\output\stm32f10x_can.crf --depend .\output\stm32f10x_can.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_cec.o --omf_browse .\output\stm32f10x_cec.crf --depend .\output\stm32f10x_cec.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_crc.o --omf_browse .\output\stm32f10x_crc.crf --depend .\output\stm32f10x_crc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_dac.o --omf_browse .\output\stm32f10x_dac.crf --depend .\output\stm32f10x_dac.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_dbgmcu.o --omf_browse .\output\stm32f10x_dbgmcu.crf --depend .\output\stm32f10x_dbgmcu.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_dma.o --omf_browse .\output\stm32f10x_dma.crf --depend .\output\stm32f10x_dma.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_exti.o --omf_browse .\output\stm32f10x_exti.crf --depend .\output\stm32f10x_exti.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_flash.o --omf_browse .\output\stm32f10x_flash.crf --depend .\output\stm32f10x_flash.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_fsmc.o --omf_browse .\output\stm32f10x_fsmc.crf --depend .\output\stm32f10x_fsmc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_gpio.o --omf_browse .\output\stm32f10x_gpio.crf --depend .\output\stm32f10x_gpio.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_i2c.o --omf_browse .\output\stm32f10x_i2c.crf --depend .\output\stm32f10x_i2c.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_iwdg.o --omf_browse .\output\stm32f10x_iwdg.crf --depend .\output\stm32f10x_iwdg.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_pwr.o --omf_browse .\output\stm32f10x_pwr.crf --depend .\output\stm32f10x_pwr.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_rcc.o --omf_browse .\output\stm32f10x_rcc.crf --depend .\output\stm32f10x_rcc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_rtc.o --omf_browse .\output\stm32f10x_rtc.crf --depend .\output\stm32f10x_rtc.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_sdio.o --omf_browse .\output\stm32f10x_sdio.crf --depend .\output\stm32f10x_sdio.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_spi.o --omf_browse .\output\stm32f10x_spi.crf --depend .\output\stm32f10x_spi.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_tim.o --omf_browse .\output\stm32f10x_tim.crf --depend .\output\stm32f10x_tim.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_usart.o --omf_browse .\output\stm32f10x_usart.crf --depend .\output\stm32f10x_usart.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\stm32f10x_wwdg.o --omf_browse .\output\stm32f10x_wwdg.crf --depend .\output\stm32f10x_wwdg.d) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\HARDWARE\LED\led.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\led.o --omf_browse .\output\led.crf --depend .\output\led.d) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\HARDWARE\TIMER\timer.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\timer.o --omf_browse .\output\timer.crf --depend .\output\timer.d) +I (..\..\Firmware\HARDWARE\TIMER\timer.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\bsp_can.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\bsp_can.o --omf_browse .\output\bsp_can.crf --depend .\output\bsp_can.d) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\bsp_can.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\canbusdrv.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\porting.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\can.c)(0x665847F6)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\can.o --omf_browse .\output\can.crf --depend .\output\can.d) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (..\..\Firmware\SYSTEM\usart\usart.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\delay\delay.h)(0x66207443) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h)(0x66207443) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +F (..\..\Firmware\HARDWARE\CAN\can_app.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\can_app.o --omf_browse .\output\can_app.crf --depend .\output\can_app.d) +I (..\..\Firmware\SYSTEM\sys\Sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\CAN\CanBusDrv.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\porting.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\CAN\candrvctrl.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can_nm.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\can_nm.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\can_nm.o --omf_browse .\output\can_nm.crf --depend .\output\can_nm.d) +I (..\..\Firmware\SYSTEM\sys\Sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\CAN\can_nm.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\CanBusDrv.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\canbusdrv.o --omf_browse .\output\canbusdrv.crf --depend .\output\canbusdrv.d) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\HARDWARE\CAN\canbusdrv.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\porting.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\CAN\candrvctrl.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\CanDrvCtrl.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\candrvctrl.o --omf_browse .\output\candrvctrl.crf --depend .\output\candrvctrl.d) +I (..\..\Firmware\HARDWARE\CAN\porting.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\candrvctrl.h)(0x66207443) +F (..\..\Firmware\HARDWARE\CAN\porting.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\porting.o --omf_browse .\output\porting.crf --depend .\output\porting.d) +I (..\..\Firmware\HARDWARE\CAN\porting.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\app_pwr_manage.o --omf_browse .\output\app_pwr_manage.crf --depend .\output\app_pwr_manage.d) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\chipID\chipid.h)(0x66207443) +I (..\..\Firmware\SYSTEM\delay\delay.h)(0x66207443) +I (..\..\Firmware\HARDWARE\TIMER\timer.h)(0x66207443) +I (..\..\Firmware\SYSTEM\usart\usart.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\ADS1015\ADS1015.h)(0x66207443) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +I (..\..\Firmware\HARDWARE\24C0X\24cxx.h)(0x66207443) +I (..\..\Firmware\HARDWARE\common\common.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h)(0x66207443) +F (..\..\Firmware\HARDWARE\24C0X\24cxx.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\24cxx.o --omf_browse .\output\24cxx.crf --depend .\output\24cxx.d) +I (..\..\Firmware\HARDWARE\24C0X\24cxx.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +F (..\..\Firmware\HARDWARE\ADC\adc.c)(0x665844E3)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\adc.o --omf_browse .\output\adc.crf --depend .\output\adc.d) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +F (..\..\Firmware\HARDWARE\DC300\dc300.c)(0x66515161)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\dc300.o --omf_browse .\output\dc300.crf --depend .\output\dc300.d) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\usart\usart.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +F (..\..\Firmware\HARDWARE\chipID\chipid.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\chipid.o --omf_browse .\output\chipid.crf --depend .\output\chipid.d) +I (..\..\Firmware\HARDWARE\chipID\chipid.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +F (..\..\Firmware\HARDWARE\ADS1015\ads1015.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\ads1015.o --omf_browse .\output\ads1015.crf --depend .\output\ads1015.d) +I (..\..\Firmware\HARDWARE\ADS1015\ads1015.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +F (..\..\Firmware\HARDWARE\common\common.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\common.o --omf_browse .\output\common.crf --depend .\output\common.d) +I (..\..\Firmware\HARDWARE\common\common.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\bsp_i2c_gpio.o --omf_browse .\output\bsp_i2c_gpio.crf --depend .\output\bsp_i2c_gpio.d) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.h)(0x66207443) +F (..\..\Firmware\HARDWARE\cupflash\bsp_cpu_flash.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\bsp_cpu_flash.o --omf_browse .\output\bsp_cpu_flash.crf --depend .\output\bsp_cpu_flash.d) +I (..\..\Firmware\SYSTEM\sys\Sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\cupflash\bsp_cpu_flash.h)(0x66207443) +F (..\..\Firmware\UDS\bootloader.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\bootloader.o --omf_browse .\output\bootloader.crf --depend .\output\bootloader.d) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\crc.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\crc.o --omf_browse .\output\crc.crf --depend .\output\crc.d) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\UDS\diagnosis_mid.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\diagnosis_mid.o --omf_browse .\output\diagnosis_mid.crf --depend .\output\diagnosis_mid.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_nvm.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\BSP_CAN.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +F (..\..\Firmware\UDS\tp_cca.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\tp_cca.o --omf_browse .\output\tp_cca.crf --depend .\output\tp_cca.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\uds_api.c)(0x66514C93)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_api.o --omf_browse .\output\uds_api.crf --depend .\output\uds_api.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\24C0X\24cxx.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h)(0x66207443) +F (..\..\Firmware\UDS\uds_can_interface.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_can_interface.o --omf_browse .\output\uds_can_interface.crf --depend .\output\uds_can_interface.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\bsp_can.h)(0x66207443) +F (..\..\Firmware\UDS\uds_did.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_did.o --omf_browse .\output\uds_did.crf --depend .\output\uds_did.d) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\uds_interface.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_interface.o --omf_browse .\output\uds_interface.crf --depend .\output\uds_interface.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\uds_manage.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_manage.o --omf_browse .\output\uds_manage.crf --depend .\output\uds_manage.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\uds_nvm.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_nvm.o --omf_browse .\output\uds_nvm.crf --depend .\output\uds_nvm.d) +I (..\..\Firmware\UDS\uds_nvm.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\UDS\uds_services.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\uds_services.o --omf_browse .\output\uds_services.crf --depend .\output\uds_services.d) +I (..\..\Firmware\UDS\uds_config.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stddef.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (C:\Keil_v5\ARM\ARMCC\include\math.h)(0x599ECD2E) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_types.h)(0x66207443) +I (..\..\Firmware\UDS\bootloader.h)(0x66207443) +I (..\..\Firmware\UDS\uds_did.h)(0x66207443) +I (..\..\Firmware\UDS\uds_dtc.h)(0x66207443) +I (..\..\Firmware\UDS\uds_can_interface.h)(0x66207443) +I (..\..\Firmware\UDS\diagnosis_mid.h)(0x66207443) +I (..\..\Firmware\UDS\tp_15765_2.h)(0x66207443) +I (..\..\Firmware\UDS\tp_config.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x599ECD2C) +I (..\..\Firmware\UDS\uds_interface.h)(0x66207443) +I (..\..\Firmware\UDS\uds_manage.h)(0x66207443) +I (..\..\Firmware\UDS\uds_services.h)(0x66207443) +I (..\..\Firmware\UDS\uds_api.h)(0x66207443) +I (..\..\Firmware\UDS\crc.h)(0x66207443) +F (..\..\Firmware\SYSTEM\delay\delay.c)(0x66207443)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\delay.o --omf_browse .\output\delay.crf --depend .\output\delay.d) +I (..\..\Firmware\SYSTEM\delay\delay.h)(0x66207443) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +F (..\..\Firmware\SYSTEM\sys\sys.c)(0x66584553)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\sys.o --omf_browse .\output\sys.crf --depend .\output\sys.d) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\main.h)(0x66207443) +I (..\systick.h)(0x66207443) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) +F (..\..\Firmware\SYSTEM\usart\usart.c)(0x66554777)(--c99 -c --cpu Cortex-M3 -D__MICROLIB -g -W -O2 --apcs=interwork --split_sections -I ..\..\Firmware\CMSIS\GD\GD32F10x\Include -I ..\..\Firmware\CMSIS -I ..\..\Utilities -I ..\ -I ..\..\Utilities\LCD_common -I ..\..\Firmware\GD32F10x_standard_peripheral\Include -I ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc -I ..\..\Firmware\STM32_file -I ..\..\Firmware\UDS -I ..\..\Firmware\SYSTEM\delay -I ..\..\Firmware\SYSTEM\sys -I ..\..\Firmware\SYSTEM\usart -I ..\..\Firmware\HARDWARE\LED -I ..\..\Firmware\HARDWARE\CAN -I ..\..\Firmware\HARDWARE\LOWPOWER -I ..\..\Firmware\HARDWARE\TIMER -I ..\..\Firmware\HARDWARE\24C0X -I ..\..\Firmware\HARDWARE\ADC -I ..\..\Firmware\HARDWARE\DC300 -I ..\..\Firmware\HARDWARE\chipID -I ..\..\Firmware\HARDWARE\ADS1015 -I ..\..\Firmware\HARDWARE\common -I ..\..\Firmware\HARDWARE\I2C -I ..\..\Firmware\HARDWARE\cupflash --diag_suppress 236 -I.\RTE\_GD32F10X_CL -IC:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="525" -DSTM32F10X_CL -DUSE_STDPERIPH_DRIVER -DSTM32F10X_CL -DUSE_STM3210C_EVAL -o .\output\usart.o --omf_browse .\output\usart.crf --depend .\output\usart.d) +I (..\..\Firmware\SYSTEM\sys\sys.h)(0x66514BE2) +I (..\..\Firmware\STM32_file\stm32f10x.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cm3.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x649BB034) +I (..\..\Firmware\CMSIS\core_cmInstr.h)(0x66207443) +I (..\..\Firmware\CMSIS\core_cmFunc.h)(0x66207443) +I (..\..\Firmware\STM32_file\system_stm32f10x.h)(0x66207443) +I (..\..\Firmware\STM32_file\stm32f10x_conf.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h)(0x66207443) +I (..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h)(0x66207443) +I (..\..\Firmware\SYSTEM\usart\usart.h)(0x66207443) +I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\LED\led.h)(0x66207443) +I (..\..\Firmware\HARDWARE\CAN\can.h)(0x66583147) +I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x599ECD2C) +I (..\..\Firmware\HARDWARE\ADC\adc.h)(0x66207443) +I (..\..\Firmware\HARDWARE\DC300\dc300.h)(0x66514CF4) diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.crf new file mode 100644 index 0000000..f8d53ca Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.d new file mode 100644 index 0000000..e5dac03 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.d @@ -0,0 +1,35 @@ +.\output\adc.o: ..\..\Firmware\HARDWARE\ADC\adc.c +.\output\adc.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\adc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\adc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\adc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\adc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\adc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\adc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\adc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\adc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\adc.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\adc.o: ..\..\Firmware\SYSTEM\sys\sys.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.o new file mode 100644 index 0000000..a9a8be7 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/adc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.crf new file mode 100644 index 0000000..d22c37b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.d new file mode 100644 index 0000000..558f27d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.d @@ -0,0 +1,34 @@ +.\output\ads1015.o: ..\..\Firmware\HARDWARE\ADS1015\ads1015.c +.\output\ads1015.o: ..\..\Firmware\HARDWARE\ADS1015\ads1015.h +.\output\ads1015.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\ads1015.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\ads1015.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\ads1015.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\ads1015.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\ads1015.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\ads1015.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\ads1015.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\ads1015.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\ads1015.o: ..\..\Firmware\SYSTEM\sys\sys.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.o new file mode 100644 index 0000000..0aae225 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/ads1015.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.crf new file mode 100644 index 0000000..a597eee Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.d new file mode 100644 index 0000000..2a74901 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.d @@ -0,0 +1,47 @@ +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.c +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\app_pwr_manage.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\app_pwr_manage.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\app_pwr_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\app_pwr_manage.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\app_pwr_manage.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\app_pwr_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\chipID\chipid.h +.\output\app_pwr_manage.o: ..\..\Firmware\SYSTEM\delay\delay.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\TIMER\timer.h +.\output\app_pwr_manage.o: ..\..\Firmware\SYSTEM\usart\usart.h +.\output\app_pwr_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\ADS1015\ADS1015.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\DC300\dc300.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\24C0X\24cxx.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\common\common.h +.\output\app_pwr_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\app_pwr_manage.o: ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.o new file mode 100644 index 0000000..47e4f1b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/app_pwr_manage.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/boot.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/boot.hex new file mode 100644 index 0000000..44ff50f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/boot.hex @@ -0,0 +1,1482 @@ +:020000040800F2 +:100000002045002085010008991D0008811800087E +:10001000951D0008B7020008B95400080000000050 +:10002000000000000000000000000000D9200008CF +:100030005F0F000800000000A11E00085D270008F7 +:100040009F0100089F0100089F0100089F01000810 +:100050009F0100089F0100089F0100089F01000800 +:100060009F0100089F0100089F0100089F010008F0 +:100070009F0100089F0100089F0100089F010008E0 +:100080009F0100089F0100089F0100089F010008D0 +:10009000BD0200089F010008D90200089F01000866 +:1000A0009F0100089F0100089F0100089F010008B0 +:1000B0009F010008812800089F0100089F01000897 +:1000C0009F0100089F0100089F0100089F01000890 +:1000D0009F0100089F0100089F0100089F01000880 +:1000E0009F0100089F0100089F0100080000000018 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000009F0100089F0100089F +:100110009F0100089F0100089F0100089F0100083F +:100120009F0100089F0100089F0100089F0100082F +:100130009F0100089F0100089F0100089F0100081F +:100140009F01000879040008AD0400089F01000821 +:10015000DFF80CD000F068F800480047C9570008E5 +:1001600020450020EFF30980704780F3098870472D +:10017000EFF30880704780F30888704740BA7047F3 +:10018000C0BA70470648804706480047FEE7FEE7CA +:10019000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE737 +:1001A000152800085101000810B5431A934209D2DE +:1001B0008318881803E010F8011D03F8011D521E72 +:1001C000F9D210BD40EA01039B0703D009E008C93A +:1001D000121F08C0042AFAD203E011F8013B00F80C +:1001E000013B521EF9D210BDD2B201E000F8012B42 +:1001F000491EFBD270470022F6E710B513460A46A7 +:1002000004461946FFF7F0FF204610BD30B50446FE +:100210000020034600E05B1C934203D2E05CCD5C0F +:10022000401BF8D030BD0000064C074D06E0E068EA +:1002300040F0010394E8070098471034AC42F6D32D +:10024000FFF78AFFFC5B00081C5C000870B58C1887 +:1002500010F8015B15F0070301D110F8013B2A11DA +:1002600006D110F8012B03E010F8016B01F8016BC7 +:100270005B1EF9D12B0705D40023521E0DD401F8C3 +:10028000013BFAE710F8013BCB1A921C03E013F88C +:10029000015B01F8015B521EF9D5A142D8D30020C1 +:1002A00070BD10B501214FF0C05001F01FFE0120BC +:1002B00001F0C6FD10BD00BFFEE7000000B585B02F +:1002C000002005F0C5F96A460021024800F095FBC0 +:1002D00005B000BD0064004010B54FF40071154832 +:1002E00000F068FA01280DD11349124800F026FAEF +:1002F000012802D1002005F067F94FF400710D4884 +:1003000000F028F94FF480610A4800F053FA012800 +:100310000ED10949891C074800F010FA012802D1C2 +:10032000002005F065F94FF48061024800F012F9F1 +:1003300010BD0000006400400200F01000B589B05C +:100340000121092001F0F2FD0121480601F0CEFD56 +:100350000121880601F0CAFD4FF40050ADF82000DD +:1003600003208DF8220018208DF8230008A94048AA +:1003700000F033FF4FF48050ADF8200048208DF896 +:10038000230008A93A4800F028FF00208DF81A0041 +:1003900001208DF81B0000208DF81C008DF81D0039 +:1003A0008DF81E008DF81F008DF8160001208DF8C5 +:1003B000170008208DF8180001208DF8190006207C +:1003C000ADF8140005A92B4800F08DFA0E208DF829 +:1003D0000E0000208DF80F0001208DF81000002085 +:1003E000ADF80400ADF80600ADF80800ADF80A005D +:1003F0000120ADF80C008DF8110001A800F01AF9E9 +:10040000012210211B4800F065FA41208DF8000000 +:1004100001208DF8010000208DF8020001208DF8E8 +:100420000300684601F0C0FC012005F005F9012237 +:100430005102104800F04EFA012291020D4800F0DE +:1004400049FA0122D1030B4800F044FA42208DF80A +:10045000000001208DF8010000208DF8020001202D +:100460008DF80300684601F09FFC002009B000BD34 +:10047000000C01400068004010B586B00024012047 +:1004800005F0E6F801AA0121074800F0B6FA059840 +:10049000009001A80FC804F0DFFE142101A8FFF7A7 +:1004A000AAFE06B010BD00000068004010B54FF471 +:1004B0000071184800F07EF9012810D1164915483E +:1004C00000F03CF9012805D105F07EF812491148E9 +:1004D00000F024F84FF400710E4800F03BF84FF4A0 +:1004E00080610C4800F066F9012812D10A49891C84 +:1004F000084800F023F9012806D105F079F80649EB +:10050000891C044800F00AF84FF48061014800F0AB +:1005100021F810BD006800400200F01000220C4BD2 +:10052000994202D10023836111E0C1F3130201F06B +:1005300000730BB1C2600AE001F080630BB102618D +:1005400005E001F000630BB1826000E0426070479B +:100550007000F030B1F5007F3AD00FDC202928D0B0 +:1005600006DC01291CD004291DD0082940D11DE03A +:10057000402921D0B1F5807F3AD126E0B1F5004F76 +:1005800031D006DCB1F5806F25D0B1F5006F2FD1E9 +:1005900024E0B1F5803F12D0B1F5003F28D111E041 +:1005A000154A826025E00822C26022E01022C26063 +:1005B0001FE0082202611CE01022026119E00822FB +:1005C000426016E01022426013E00422426010E014 +:1005D000042242600DE0042242600AE000228261AF +:1005E0000422426005E0002282610422426000E0B1 +:1005F00000BF00BF704700000101010010B50446B4 +:100600000B48844209D10121480601F07FFC0021FA +:100610004FF0007001F07AFC08E00121880601F03B +:1006200075FC00214FF0806001F070FC10BD0000EF +:100630000064004010B50021837A012202FA03F120 +:100640003D4A126842F001023B4B1A603A4A1C32A2 +:1006500012688A43384B1C331A60027BCAB9364A87 +:100660000C3212688A43344B0C331A604288C388B8 +:1006700042EA0343304A4032847A42F834300288F6 +:10068000838842EA03432C4A4032847A02EBC40254 +:100690005360027B012A19D1274A0C3212680A439F +:1006A000254B0C331A604288038842EA0343224AEE +:1006B0004032847A42F83430C288838842EA034365 +:1006C0001D4A4032847A02EBC4025360C27A3AB9BE +:1006D000194A121D12688A43174B1B1D1A6006E047 +:1006E000154A121D12680A43134B1B1D1A6002891A +:1006F00032B9114A143212688A430F4B14331A600C +:100700000289012A06D10C4A143212680A430A4BA4 +:1007100014331A60427B012A06D1074A1C32126840 +:100720000A43054B1C331A60034A126822F0010287 +:10073000014B1A6010BD00000066004010B5024673 +:10074000002001F4700343B19369C1F31304234003 +:100750000BB101202DE000202BE001F0807343B1AC +:100760005368C1F3130423400BB1012021E00020A2 +:100770001FE001F0006343B19368C1F31304234009 +:100780000BB1012015E0002013E001F0007343B12C +:10079000D368C1F3130423400BB1012009E000200A +:1007A00007E01369C1F3130423400BB1012000E0FB +:1007B000002010BD70B504460D4600266069284033 +:1007C000002871D0B5F5807F5CD010DC082D35D0C5 +:1007D00006DC012D20D0022D24D0042D72D127E07B +:1007E000102D31D0202D35D0402D6BD138E0B5F50E +:1007F000004F60D009DCB5F5007F49D0B5F5806FBA +:100800004CD0B5F5006F5DD14FE0B5F5803F2DD0F0 +:10081000B5F5003F56D12FE0A0682D4900F0F2FA5F +:10082000064651E0E068032100F0ECFA06464BE092 +:10083000E068082100F0E6FA064645E0E06810218D +:1008400000F0E0FA06463FE02069032100F0DAFA02 +:10085000064639E02069082100F0D4FA064633E064 +:100860002069102100F0CEFA06462DE060680821CC +:1008700000F0C8FA064627E06068102100F0C2FACE +:10088000064621E0A069012100F0BCFA06461BE003 +:10089000A069022100F0B6FA064615E0A06904211D +:1008A00000F0B0FA06460FE00FE0A069702100F0FA +:1008B000A9FA064608E06068042100F0A3FA06469B +:1008C00002E0FFE7002600BF00E00026304670BDD2 +:1008D000010101001AB143690B43436102E043691E +:1008E0008B434361704730B50246002000231468F3 +:1008F00024F002041460146844F00104146000E061 +:100900005B1C546804F001041CB94FF6FF74A34249 +:10091000F6D1546804F001040CB900206CE08C7925 +:10092000012C04D1146844F08004146003E01468BE +:1009300024F080041460CC79012C04D1146844F0B4 +:100940004004146003E0146824F0400414600C7A3E +:10095000012C04D1146844F02004146003E01468EE +:1009600024F0200414604C7A012C04D1146844F063 +:100970001004146003E0146824F0100414608C7AEE +:10098000012C04D1146844F00804146003E01468D6 +:1009900024F008041460CC7A012C04D1146844F0CB +:1009A0000404146003E0146824F0040414608C78D8 +:1009B000A407CD7844EA05640D7944EA05444D79ED +:1009C00044EA05540D886D1E2C43D461146824F04C +:1009D00001041460002300E05B1C546804F001046F +:1009E0001CB14FF6FF74A342F6D1546804F0010421 +:1009F0000CB1002000E0012030BD10B500F5D87327 +:100A000003EB01131B6803F004031372137A53B949 +:100A100000F5D87303EB01131B6840F2FF7404EA7E +:100A20005353136009E000F5D87303EB01131B68FF +:100A30006FF0604404EAD303536000F5D87303EB0E +:100A400001131B6803F00203537200F5D87303EB24 +:100A500001135B6803F00F03937200F5D87303EB87 +:100A600001135B681B0AD37400F5D87303EB011301 +:100A70009B68D37200F5D87303EB01139B681C0AC3 +:100A8000147300F5D87303EB01139B681C0C5473AB +:100A900000F5D87303EB01139B681B0E937300F5ED +:100AA000D87303EB0113DB68D37300F5D87303EB42 +:100AB0000113DB681C0A147400F5D87303EB0113EF +:100AC000DB681C0C547400F5D87303EB0113DB686E +:100AD0001B0E937421B9C36843F02003C36003E085 +:100AE000036943F02003036110BD10B502460020E6 +:100AF000936803F08063B3F1806F00D110E09368D6 +:100B000003F00063B3F1006F01D1012008E09368A6 +:100B100003F08053B3F1805F01D1022000E0042094 +:100B2000042874D002F5C07303EB00131B6803F0B4 +:100B3000010402F5C07303EB00131C600B7A7BB950 +:100B40004B7A0C8843EA445302F5C07404EB00145A +:100B50002468234302F5C07404EB0014236010E002 +:100B60000B7A4C6843EAC4034C7A234302F5C07401 +:100B700004EB00142468234302F5C07404EB001452 +:100B800023608B7A03F00F038B7202F5C07303EBC3 +:100B900000135B6823F00F0402F5C07303EB00132E +:100BA0005C6002F5C07303EB00135B688C7A23432F +:100BB00002F5C07404EB001463608B7B1C064B7B56 +:100BC00044EA03440B7B44EA0323CC7A234302F533 +:100BD000C07404EB0014A3608B7C1C064B7C44EABD +:100BE00003440B7C44EA0323CC7B234302F5C0740B +:100BF00004EB0014E36002F5C07303EB00131B6801 +:100C000043F0010402F5C07303EB00131C6010BD38 +:100C100010B50246002321B1012907D002290FD1C6 +:100C200009E090681D4C00EA04030BE090681C4C3E +:100C300000EA040306E090681A4C00EA040301E0AD +:100C4000002300BF00BF184C181BA34216D007DCBE +:100C500083B16FF08060184470B1022818D111E0A0 +:100C6000B0F5007F10D0114C204448B1B0F5003FE2 +:100C70000ED10BE002230DE000230BE0002309E07E +:100C8000002307E0012305E0012303E0012301E045 +:100C9000002300BF00BFD8B210BD00000300000455 +:100CA0000003000800000310000100080001FFF726 +:100CB0004FF6FF710180704770B50B4600210BE0C5 +:100CC0005D5C068885EA2624054D35F814500678C3 +:100CD00085EA06250580491C9142F1D370BD0000CC +:100CE00032590008F0B504460D462946204600F06A +:100CF00009F80746615D681C205C41EA002686EA27 +:100D00000700F0BD70B502464FF6FF7048F20505CA +:100D100017E0491E12F8014B80EA042000230EE080 +:100D200000F400462EB14FF6FF7606EA4000684018 +:100D300003E04FF6FF7606EA40005E1CF3B2082B94 +:100D4000EEDB0029E5D170BD30B50B46002104E093 +:100D50005D5C04682C440460491C9142F8D330BDAA +:100D60000FB430B585B00024142208A96846FFF7F7 +:100D70001BFA012004F080FC20B9012005B030BC32 +:100D80005DF814FB69460E48FFF7AFFE05460024E8 +:100D900001E0601C84B2012004F06EFC40B12946E1 +:100DA0000748FFF735FF18B940F6FF708442F0DBC3 +:100DB00040F6FF70844201DB0120DFE70020DDE721 +:100DC00000680040002001207047000010B50B486B +:100DD000C07E0B4981F822000848407801280CD1D8 +:100DE00006488078012808D100200449487088709E +:100DF00000F042FD01200149487110BD4C3A00202D +:100E0000300600200246002002EA01030BB1012057 +:100E100000E0002070470000002003490978C1F37A +:100E2000800101B101207047DD0600200020034948 +:100E30000978C1F3400101B101207047DD060020AF +:100E400010B5034600202AB18B4201D0012006E0F4 +:100E5000002004E08B4201D1012000E0002010BD01 +:100E600001460020084A128A8A420BD0064A528A5A +:100E70008A4207D0044A52888A4203D0024A128822 +:100E80008A4200D1012070476C5B000801460020B7 +:100E9000012901D0032900D101207047014600201B +:100EA00001F0800202B901207047024600208A4208 +:100EB00000D10120704700000020054A937B527B3F +:100EC00003EB022291B2502900DC012070470000A0 +:100ED000DD060020002002490880091D08807047B7 +:100EE000B06C00402DE9F8436946164800F088F8D8 +:100EF000DFF85490002420E0144931F8140000F089 +:100F0000CFFA0546FF2D16D0114830F8150000EB3A +:100F10000908104830F814600F4830F814000099A0 +:100F2000471831463846FFF7DDFE20B932463946CC +:100F30004046FFF739F9601CC4B20C2CDCDBBDE87D +:100F4000F8830000A03A002030060020D65B00089D +:100F5000325B0008BE5B0008A65B00087047704764 +:100F600010B5044606E0142004F0A8FA00F080FD55 +:100F7000601E84B2002CF6DC10BD00002DE9F84F95 +:100F800083464FF0000A00200090584600F09CFA7B +:100F90008046B8F1FF0F27D0584600F081FA054689 +:100FA000FF2D21D01148445DDFF84490114830F8FE +:100FB000150000EB090621463046FFF7A3FE87B275 +:100FC0003755641C38123055641C0B4830F8180033 +:100FD0000A4900EB010ABAF1000F05D000232246AE +:100FE0003146504600F01EF8BDE8F88F585B000807 +:100FF00030060020325B0008A65B0008A03A002003 +:1010000002460748904201D1086007E0044846388C +:10101000904201D1086001E0002070470120FCE708 +:10102000E63A00202DE9F04104460D4616461F46DB +:101030003B4632462946204604F05AFC0120BDE8D2 +:10104000F0812DE9F04104460E4600270025C4F347 +:101050000A0010B10120BDE8F08100F09FF83520B2 +:1010600000F014F8254608E0284600F015F804289A +:1010700001D0012704E005F50065A019A842F3D8C6 +:1010800000BF00F049F83846E5E700000149C860B4 +:10109000704700000020024030B5044604250F4888 +:1010A00000F088F80546042D16D10D48006940F07F +:1010B00002000B49086108464461006940F04000A5 +:1010C0000861064800F076F805460548006941F6D3 +:1010D000FD71084002490861284630BDFFFF0F003E +:1010E0000020024004200B49C96801F0010109B148 +:1010F00001200EE00749C96801F0040109B102208E +:1011000007E00449C96801F0100109B1032000E0BB +:1011100004207047002002400348006940F080002E +:1011200001490861704700000020024078B506467A +:101130000C460425002000904FF6FF7000F03AF8AE +:101140000546042D26D11448006940F001001249DB +:10115000086134804FF6FF7000F02CF80546042D2E +:1011600011D1B01C0090200C009908804FF6FF7040 +:1011700000F020F805460848006941F6FE71084075 +:101180000549086106E00448006941F6FE7108401F +:1011900001490861284678BD002002400248034901 +:1011A00048600348486070472301674500200240BB +:1011B000AB89EFCD00B502460423FFF793FF03464A +:1011C00003E0FFF78FFF0346521E012B01D1002AD7 +:1011D000F7D102B90523184600BD2DE9F0410246BA +:1011E00000250026002000230024002791F803C0DA +:1011F0000CF00F0591F803C00CF0100CBCF1000FBF +:1012000003D091F802C04CEA050591F800C0BCF18A +:10121000000F31D0146800202BE04FF0010C0CFAC5 +:1012200000F3B1F800C00CEA03069E4220D183000F +:101230004FF00F0C0CFA03F7BC4305FA03FC4CEA21 +:10124000040491F803C0BCF1280F06D14FF0010C43 +:101250000CFA00FCC2F814C00AE091F803C0BCF11B +:10126000480F05D14FF0010C0CFA00FCC2F810C079 +:10127000401C0828D1D31460B1F800C0BCF1FF0FA6 +:1012800034DD546800202EE000F1080C4FF0010816 +:1012900008FA0CF3B1F800C00CEA03069E4221D113 +:1012A00083004FF00F0C0CFA03F7BC4305FA03FC64 +:1012B0004CEA040491F803C0BCF1280F05D100F1F9 +:1012C000080C08FA0CF8C2F8148091F803C0BCF1BD +:1012D000480F07D100F1080C4FF0010808FA0CF88C +:1012E000C2F81080401C0828CED35460BDE8F081BD +:1012F000F0B50A46002300240021002500F0004636 +:10130000B6F1004F02D11D4EF16901E01B4E71682C +:10131000C0F3034583B200F44016B6F5401F08D170 +:1013200021F07061154E766826F07066134F7E606E +:1013300012E000F48016B6F5801F06D1032606FAE7 +:1013400005F4A14341F0706106E0460D360103FA51 +:1013500006F6B14341F0706122B1460D360103FA41 +:1013600006F6314300F00046B6F1004F02D1034EBD +:10137000F16101E0014E7160F0BD0000000001402C +:10138000416170470161704718B501460C128DF834 +:101390000040CCB28DF801404FF6FE70002221E0F3 +:1013A0001DF8024080EA0420002317E000F4004406 +:1013B00074B100F080042CB148F2084484EA40047F +:1013C000A0B209E048F2250484EA4004A0B203E098 +:1013D0004FF6FF7404EA40005C1CE3B2082BE5DB27 +:1013E000541CE2B2022ADBDB18BD70B5044603F0E0 +:1013F0000BFF45432570280C6070002070BD000075 +:101400002DE9F047064600240027204890F82A00DE +:101410001E4991F8291000EB012087B26222214673 +:10142000641C72543A0A2146641C72542146641C9E +:101430007754DFF85C90002507E0164830F8150077 +:10144000B84200D103E0681CC5B2132DF5DB00BF24 +:10145000132D01D1022404E03846FFF701FD00B945 +:101460000224022C0ED00C4810F805800B4A32F8EA +:10147000152002EB090130194246FEF795FE04EBF8 +:10148000080084B22046BDE8F08700004C3A0020F6 +:10149000300600206C5B0008585B0008325B0008D7 +:1014A0000246FF20002108E0064B33F8113093423A +:1014B00001D1084603E04B1CD9B21329F4D300BF75 +:1014C000704700006C5B00080246FF20002108E026 +:1014D000064B33F81130934201D1084603E04B1C10 +:1014E000D9B20C29F4D300BF70470000D65B0008C6 +:1014F0000448007820B1002002490870012070479C +:101500000020FCE7580000200648006806490860F3 +:101510000448001F00684860024808380068886076 +:1015200070470000F0F7FF1F600100205C48008852 +:10153000401C80B25A4908800A2879DB00200880C4 +:101540005848C08FB0F5FA7F2FDA5648C08F401C3C +:101550005449C8870846C08FB0F5FA7F25D10020CE +:1015600008720846C07E032803D00846C07E0228C1 +:101570001BD100204B4988760120C876002081F8D5 +:1015800020008871C88781F8220081F8230081F843 +:101590002500C87344480079012803D1002042493E +:1015A000C882087101203F4908703E4890F8220027 +:1015B00058B13E48007820F001003C4908700846C8 +:1015C000007820F0020008700CE03848007820F025 +:1015D0000100401C354908700846007820F00200E0 +:1015E000801C08702F4890F8230058B12F480078CD +:1015F00020F004002D4908700846007820F008000B +:1016000008700CE02948007820F00400001D2749EC +:1016100008700846007820F0080008300870244858 +:101620000088401C80B222490880642801DA704793 +:1016300033E000201E4908801A4890F82700D8B1EE +:10164000184890F82700401E164981F827000846E0 +:1016500090F8270080B90846C07801280CD10020F6 +:10166000C870084690F82600002805DD084690F866 +:101670002600401E81F826000A48007A30B10B4847 +:10168000007820F010000949087006E0074800784B +:1016900020F0100010300549087000BFC7E70000B7 +:1016A0002E0100204C3A0020183200206C0000204F +:1016B0002C0100207047704770B505460E4608485B +:1016C0000670002404E0285D06490855601CC4B279 +:1016D000034800788442F6DB01F092F970BD000007 +:1016E00039010020300100200146002004E0054AB5 +:1016F000125C0A54421CD0B2034A12789042F6DBC4 +:1017000070470000300100203901002070B5044608 +:101710000D4601F081FA064632462946204603F07E +:10172000BFFC70BD70B505460E4608480670002423 +:1017300004E0285D06490855601CC4B203480078DF +:101740008442F6DB01F0E0F970BD000039010020B1 +:101750003001002010B501F0F1FA10BD10B50446BB +:1017600003F032FD00200149087010BD380100204F +:101770000148007870470000390100207FB5054618 +:101780000E48006800900E4800788DF80400002490 +:1017900005E0295D0DF105000155601CC4B2084843 +:1017A00000788442F5DB01208DF80D000549487072 +:1017B0009DE80F0002F08AFB7FBD00003C01002085 +:1017C0003A0100204C3A002001490870704700009F +:1017D0003A01002020B940F29571044A116003E0FB +:1017E00040F29571014A1160704700003C010020F1 +:1017F000704700002DE9F04105460E4601F00CFA55 +:1018000004460A48007878B97F2020706570A67079 +:1018100003270020FFF7DEFF01F0F4FD384601F05A +:101820005BFA012001490870BDE8F0813801002011 +:101830002DE9F04105460E4601F0EEF980460D48CF +:101840000078A8B9A5B1002404E0305D08F80400D0 +:10185000601C84B2AC42F8DB2F460020FFF7BAFFD1 +:1018600001F0D0FD384601F037FA01200149087037 +:10187000BDE8F0813801002010B501F063F810BD1B +:1018800000BFFEE710B54FF400600B49086003F09D +:1018900094FF4FF480600849091F086003F08DFF32 +:1018A0004FF480600449086003F087FF4FF4006044 +:1018B0000149091F086010BD140C014010B54FF418 +:1018C00000600949086003F078FF4FF48060064922 +:1018D000086003F072FF4FF480600349091D08603F +:1018E00003F06BFF10BD0000100C014070B5054601 +:1018F0000024002618E06006040E4FF480600F49B3 +:10190000086003F05AFF0D480838006800F40060D2 +:1019100008B1601CC4B24FF480600849091D08601A +:1019200003F04BFF701CC6B2082EE4DB15B9FFF7BD +:10193000C5FF01E0FFF7A6FF204670BD100C014077 +:1019400070B50446002524E004F0800020B14FF477 +:1019500000601149086004E04FF400600E49091D61 +:10196000086003F02AFF4FF480600B49086003F021 +:1019700024FF4FF480600849091D0860072D02D13B +:101980004000091F08606006040E03F016FF681C83 +:10199000C5B2082DD8DB70BD100C014010B54FF456 +:1019A00000600A4908604010086003F006FF4FF429 +:1019B00000600649091D086003F0FFFE4FF48060D7 +:1019C0000249091D086003F0F8FE10BD100C01402B +:1019D00010B54FF40060074908604010091F086007 +:1019E00003F0EBFE4FF400600249091F086003F0AA +:1019F000E4FE10BD140C014010B54FF400600E4918 +:101A0000086003F0DAFE4FF480600B49086003F0D1 +:101A1000D4FE09480838006800F4006008B10124C9 +:101A200000E000244FF480600349091D086003F0C2 +:101A3000C4FE204610BD0000100C014070B50546E4 +:101A40000C4645F2555000F033F8284600F024F8D3 +:101A5000204600F027F800F017F800F001F870BDFC +:101A60004CF6CC400149086070470000003000404F +:101A700010B500F009F810BD10B540F6354104204E +:101A8000FFF7DCFF10BD00004AF6AA2001490860FC +:101A90007047000000300040014948607047000076 +:101AA000003000400149886070470000003000406D +:101AB0000149086070470000003000402DE9F04700 +:101AC0002D4804682D48844201D0BDE8F0872A489B +:101AD000001D0468B4F5205F02D3B4F5D03F00D9EF +:101AE000F3E7A60804F0030000B1761CDFF890804D +:101AF000244DFFF753FB002724E04FF0000AD8F8ED +:101B00000040C5F30A0010B92846FFF7C5FA0EE0F9 +:101B100021462846FFF70AFB042800D108E00AF115 +:101B2000010000F0FF0ABAF1030F00DB00E0EFE76D +:101B300000BFD5F800904C4500D005E008F104083E +:101B40002D1D7F1CB742D8D300BF0B48FFF7A4FA66 +:101B5000FFF7E2FA0B4840680B4908600846006846 +:101B60000A49086007490868FEF705FB074800684E +:101B7000804700BFA9E70000005802084433221143 +:101B800000600208008000081800002014000020F7 +:101B90000020054A1188121F128842EA0141034AB7 +:101BA000914200D101207047B46C00405CBA55AA44 +:101BB00010B572B6FFF782FFFFF7EAFF28B10120E8 +:101BC0000F490870FFF786F917E00E4800680E49C4 +:101BD0000840B0F1005F10D100F022FD09484068D4 +:101BE0000A4908600846006809490860054908680C +:101BF000FEF7C1FA06480068804762B610BD0000D3 +:101C000058000020008000080000FE2F6000002027 +:101C10005C00002008B501211C2000F087F94FF47A +:101C20000070ADF8000010208DF8030003208DF83F +:101C3000020069465348FFF7D0FA4FF4007151484B +:101C4000FFF7A0FB0120ADF8000010208DF8030085 +:101C500003208DF8020069464A48FFF7BEFA0121C9 +:101C60004848FFF78FFB40F20240ADF8000010201B +:101C70008DF8030003208DF8020069464148FFF704 +:101C8000ACFA02213F48FFF77DFB4FF480613D48ED +:101C9000FFF776FBA020ADF8000010208DF80300C0 +:101CA00003208DF8020069463748FFF796FA202195 +:101CB0003548FFF765FB80213348FFF763FB44F2AB +:101CC0002720ADF8000010208DF8030003208DF8C8 +:101CD000020069462D48FFF780FA4FF400712B4847 +:101CE000FFF750FB01212948FFF74AFB0221274853 +:101CF000FFF746FB04212548FFF742FB4FF48041E4 +:101D00002248FFF73DFB20212048FFF739FB4FF425 +:101D10008070ADF8000048208DF80300694619482E +:101D2000FFF75BFA4FF40070ADF8000048208DF823 +:101D3000030069461448FFF750FA0121084600F0F5 +:101D4000F5F801211248FFF7D3FA1020ADF8000092 +:101D500001208DF8020010208DF8030069460B4821 +:101D6000FFF73BFA10210948FFF70CFB4FF4005036 +:101D7000ADF8000004208DF8030069460248FFF723 +:101D80002CFA08BD0008014000100140000C014081 +:101D90000001300000BFFEE7704710B54FF4A060AF +:101DA00000F03AF810BD000070B5002100230F22AA +:101DB000C47804B3154C246804F4E064C4F5E0640A +:101DC000210AC1F10403CA40447804FA03F184787B +:101DD0001440214309010E4C0678A155047804F003 +:101DE0001F050124AC4005786D11AD0005F1E0251B +:101DF000C5F8004109E0047804F01F050124AC4057 +:101E0000044D0678761145F8264070BD0CED00E0D3 +:101E100000E400E080E100E002490143024A116071 +:101E2000704700000000FA050CED00E010B54FF41B +:101E300000720021014803F0D2F910BDA03A002041 +:101E4000014908627047000000000E421FB50120E2 +:101E5000124908720020C8870098A0F2857010B15E +:101E60005A2818D10BE040F285700C49A1F84C00BB +:101E70009DF804100DF10500FFF754FC0CE040F252 +:101E8000DF700649A1F84C009DF804100DF1050023 +:101E9000FFF712FC00E000BF00BF1FBD4C3A00205E +:101EA00070472DE9F04106460C4617464FF00008F2 +:101EB0000025FFF773F93520FFF7E8F835460CE009 +:101EC00028462168FFF732F928682168884202D045 +:101ED0004FF0010804E02D1D241DF019A842EFD891 +:101EE00000BFFFF719F94046BDE8F08129B1064A65 +:101EF000D2690243044BDA6104E0034AD2698243A7 +:101F0000014BDA61704700000010024029B1064A17 +:101F100012690243044B1A6104E0034A12698243C6 +:101F2000014B1A61704700000010024029B1064AB7 +:101F300092690243044B9A6104E0034A9269824326 +:101F4000014B9A6170470000001002402DE9F041FA +:101F500000210022002500230026002400278C46B3 +:101F6000DFF86081D8F8048008F00C0121B1042961 +:101F700007D0082959D109E0DFF84C81C0F800806A +:101F800058E0DFF84481C0F8008053E0DFF8348186 +:101F9000D8F8048008F47012DFF82881D8F804809B +:101FA00008F48035920C0D2A01D0921C00E0062224 +:101FB00035B9DFF8188102FB08F8C0F8008033E07B +:101FC000DFF80081D8F82C8008F48036DFF8F48040 +:101FD000D8F82C8008F00F0808F1010446B9DFF8A2 +:101FE000E880B8FBF4F808FB02F8C0F800801BE0BA +:101FF000DFF8D080D8F82C80C8F3031808F1010767 +:10200000DFF8C080D8F82C80C8F3032808F1020C50 +:10201000DFF8B480B8FBF7F808FB0CF8B8FBF4F86D +:1020200008FB02F8C0F8008004E0DFF89C80C0F8EC +:10203000008000BF00BFDFF88C80D8F8048008F073 +:10204000F0010909DFF8888018F80130D0F8008025 +:1020500028FA03F8C0F80480DFF86880D8F8048014 +:1020600008F4E061090ADFF8688018F80130D0F858 +:10207000048028FA03F8C0F80880DFF84880D8F810 +:10208000048008F46051C90ADFF8448018F8013070 +:10209000D0F8048028FA03F8C0F80C80DFF8248018 +:1020A000D8F8048008F44041890BDFF8288018F83C +:1020B0000130D0F80C80B8FBF3F8C0F81080BDE810 +:1020C000F08100000010024000127A0000093D007B +:1020D0004300002053000020704700002DE9F0412C +:1020E00004460D46002700266078217800EB012089 +:1020F00086B21A48008AB04211D11948007AA84223 +:102100000BD1184890F8200028B12A46A11C164887 +:10211000FEF74AF81BE0332719E0132717E00F48B2 +:10212000408AB04212D10E48407AA8420CD10D48E4 +:1021300090F8200030B12A46A11C0B480E30FEF763 +:1021400033F804E0332702E0132700E0312717B902 +:102150003046FEF713FF3846BDE8F0816C5B00089F +:10216000585B00084C3A0020AA0600202DE9F04FE9 +:102170008DB0044691469A464FF0000BD846002594 +:1021800000260027F048B0F84000042803DA1320A6 +:102190000DB0BDE8F08F94F80080A078617840EA37 +:1021A000012571223046711C8EB20DF80020227874 +:1021B0003046711C8EB20DF8002062783046711CDA +:1021C0008EB20DF80020A2783046711C8EB20DF848 +:1021D0000020B8F1010F71D1DB49B1F840000621B0 +:1021E000FEF763FE18B14DF60420854215D0D6499E +:1021F000B1F840000C21FEF758FE10B1B5F57F4F45 +:102200000BD0D149B1F840000E21FEF74EFE002858 +:102210007AD04FF6017085427ED1CB4890F82000ED +:10222000002876D0A5F55A40043830B1A0F51050FA +:10223000FC38B8B101286AD141E0C44890F83008B0 +:1022400003280CD12079E17800EB0120BF49888276 +:1022500001273046711C8EB20DF8007001E04FF07E +:10226000220B55E0E0780006217900EB014061790E +:1022700000EB0120A1790844B449C860E079000668 +:10228000217A00EB0140617A00EB0120A17A084439 +:10229000AE4908610846C068AD49884206D04FF093 +:1022A000720B0120A94981F8280806E04FF0780B4D +:1022B0000120A649087081F8240829E03DE0E07873 +:1022C0000006217900EB0140617900EB0120A17942 +:1022D0000844A0490860E0790006217A00EB01403B +:1022E000617A00EB0120A17A08449B490860207BB9 +:1022F000E17A00EB01209949088001273046711CE2 +:102300008EB20DF8007003E006E002E0FFE700BFC8 +:102310000EE14FF0330B0BE14DF60420854206D061 +:10232000B5F57F4F03D04FF60170854202D14FF0D3 +:10233000130BFDE04FF0310BFAE0B8F1030F61D160 +:102340008149B1F840000421FEF7AFFD18B14DF608 +:102350000420854214D07C49B1F840000421FEF7E6 +:10236000A4FD10B1B5F57F4F0AD07749B1F8400010 +:102370000421FEF79AFD78B34FF60170854230D103 +:10238000714890F8200040B3A5F55A40043830B1A8 +:10239000A0F51050FC3850B101281BD100E000BF5F +:1023A00002273046711C8EB20DF8007013E06748AA +:1023B0008079022801D1022706E06448807901284B +:1023C00001D1032700E005273046711C8EB20DF8BD +:1023D000007000E000BFABE003E0FFE74FF0330B1D +:1023E000A6E04DF60420854206D0B5F57F4F03D018 +:1023F0004FF60170854202D14FF0130B98E04FF079 +:10240000310B95E0B8F1020F72D14F49B1F840009D +:102410000421FEF74AFD18B14DF60420854214D080 +:102420004949B1F840000421FEF73FFD10B1B5F570 +:102430007F4F0AD04449B1F840000421FEF735FD32 +:1024400078B34FF60170854258D13F4890F820008C +:1024500040B3A5F55A40043830B1A0F51050FC380F +:1024600008B3012845D128E03848C08A3749898A0D +:10247000884210D13548C06939490840B0F1005F41 +:1024800009D1042231491C313148FFF70AFD08B94E +:10249000012700E002273046711C8EB20DF8007053 +:1024A00028E02BE027E00020284948710427304627 +:1024B000711C8EB20DF800701CE02448C0682549DC +:1024C000096888420BD0214800692349096888427D +:1024D00005D01E48C08A21490988884201D10127B8 +:1024E00000E002273046711C8EB20DF8007001E04A +:1024F00015E000BF1CE04FF0330B19E04DF604204F +:10250000854206D0B5F57F4F03D04FF60170854266 +:1025100002D14FF0130B0BE04FF0310B08E00A48EB +:102520000079012804D10020074908714FF0120BEF +:10253000AAF80060BBF1000F04D132466946484654 +:10254000FDF732FE584623E64C3A002018320020B0 +:102550000080000880000020840000208800002007 +:102560000000FE2F2DE9F04704460F46904699469D +:102570000025002626782648D0F82C182548B0F8E3 +:102580004000801E08442249C1F82C08FEF744FC94 +:1025900008B1922539E0FEF749FC08B1932534E0F3 +:1025A0001C48B0F8400040F60201884201DD1325C6 +:1025B0002BE0174890F83008012806D0144890F80E +:1025C0003008022801D024251FE0114890F829087E +:1025D000B04201D0732518E00D48D0F82C080E4900 +:1025E0000968884201D971250FE001200849487027 +:1025F000022081F830080748B0F84000821E0749E1 +:1026000003482430FDF7D0FD78252846BDE8F08743 +:10261000183200204C3A0020440100201E0A0020FD +:10262000034804490880000C091D08807047000019 +:1026300010590008B86C004010B500F001F810BD4A +:102640000CB50020019000904048006840F48030B4 +:102650003E49086000BF3D48006800F4003000902B +:102660000198401C0190009820B94FF6FF71019825 +:102670008842F0D13548006800F4003010B10120E4 +:10268000009001E000200090009801285CD13048C3 +:10269000006840F010002E4908600846006820F0ED +:1026A000030008600846006840F002000860274800 +:1026B00040682649486008464068486008464068C7 +:1026C00040F4806048600846C06A224908401F49BB +:1026D000C8620846C06A204908431C49C8620846C7 +:1026E000006840F08060086000BF1848006800F093 +:1026F00000600028F9D01548406820F47C10134988 +:1027000048600846406840F4E810486008460068A1 +:1027100040F08070086000BF0C48006800F0007056 +:102720000028F9D00948406820F0030007494860B4 +:102730000846406840F00200486000BF0348406817 +:1027400000F00C000828F9D10CBD00000010024078 +:102750000020024000F0FEFF140801000F4800684E +:10276000401C0E4908600E480068401C0C49086077 +:102770000A4800684FF47A71B0FBF1F201FB1200D5 +:10278000012804D107480068401C06490860064833 +:10279000007810B901200449087070473400002007 +:1027A0002C000020380000203000002030B51648F2 +:1027B00000684FF47A72B0FBF2F1B1F1807F01D37F +:1027C00001201DE021F07F40401E4FF0E0225061CB +:1027D00050170F22002807DA13071D0E0B4B00F0CD +:1027E0000F04241F1D5503E013071C0E084B1C5437 +:1027F00000BF00204FF0E022906107201061002010 +:1028000008B100BFFEE730BD0000002018ED00E079 +:1028100000E400E010B51648006840F001001449DB +:102820000860084640681349084011494860084656 +:102830000068114908400E4908600846006820F405 +:10284000802008600846406820F4FE004860084682 +:10285000006820F0A05008604FF47F0088600020DE +:10286000C862FFF7E9FE4FF000600449086010BD40 +:10287000001002400000FFF0FFFFF6FE08ED00E050 +:1028800010B50121084800F016F858B1012106489A +:1028900000F00EF80548006808B9012000E00020AB +:1028A0000249086010BD000000040040900123426E +:1028B000CA430282704730B502460020002300243C +:1028C000158A05EA0103958905EA010413B10CB1E3 +:1028D000012000E0002030BD10B51248008888B902 +:1028E00000201149087011490870114908701149F8 +:1028F0000870114908700846017810480088FEF7F2 +:1029000005FF0DE00720094908700D480078401CBC +:102910000B49087008460078102801D10020087083 +:1029200010BD0000A6000020C2000020B000002062 +:1029300099000020BE000020B70000209E0000206B +:102940009C00002010B50120214908700020214979 +:10295000087021480078012805D120480078102807 +:1029600001D1FEF7A7FE1C480078012803D11B48BF +:102970000078102805D01A48007858B11948007816 +:1029800040B9962018490880012018490870022093 +:102990001749087016480078012802D115480078B8 +:1029A00048B10E48007830B10B480078042804D1B3 +:1029B0001148008808B900F0F9FC10480078012897 +:1029C00005D105480078062801D100F0EFFC10BDC4 +:1029D000BA000020BF000020B000002094000020BA +:1029E0008C0000208B000020AC000020C1000020E3 +:1029F0008A0000208D000020920000209900002015 +:102A000070B536480078012866D03548007901282D +:102A100004D134480078012800D170BDFEF7A8FE2B +:102A2000314908803148FEF75FFE3048007800F0F9 +:102A3000F0002F49087000202E4908802E48008899 +:102A40002749A1F84000002008712848007800F0CC +:102A50000F0522480078022803D115B901201F492B +:102A6000087020480078012801D100F09FFC204820 +:102A7000007820BB1D48007800F00F001E49088038 +:102A800001240CE01948005D1C491A4A1288885438 +:102A900018480088401C17490880601CC4B21648BA +:102AA00000888442EEDD00F03DFA48B9092014495F +:102AB00008700846017810480088FEF727FE0BE0F2 +:102AC00001201049087000200D490870084601785F +:102AD00009480088FEF71AFE00BF9EE78A00002022 +:102AE0004C3A002099000020A4000020C4000020DF +:102AF000A0000020A20000209E0000201C0A002050 +:102B0000B7000020B900002010B51F480078012848 +:102B100024D001201D490870FEF72AFE1C490880B8 +:102B20001C48FEF7E1FD1B48007800F00F04164832 +:102B30000078022803D114B90120134908701648FF +:102B40000078012801D100F031FC00201349087001 +:102B50000120134908701349087114E00F480078E8 +:102B6000401CC0B20D49087002280CDB02F0FAF9D3 +:102B700000F064F8002009490870034908700A4908 +:102B800008700A49087010BD8A000020BB000020B0 +:102B9000A4000020C400002099000020CD000020E7 +:102BA000CC0000204C3A0020B0000020380100206A +:102BB00010B51148007838B11048407810490870B5 +:102BC00000F0E6FB0F4908700D4800780E490870C8 +:102BD0000C4800780D49087000200D49087000F07D +:102BE00025FC0B48007818B904200A49087002E057 +:102BF00003200849087010BDC3000020C400002055 +:102C00008C0000208D0000208B0000208E00002012 +:102C100090000020B0000020004870471C0A0020EF +:102C200010B505480078012804D100200249087039 +:102C300000F050F910BD0000BB00002000200D493D +:102C400008700D4908700D4908700D4908700D494C +:102C500008700D4908700D4908700D4908700D493C +:102C600008700D4908700D4908700D4908700D492C +:102C700008707047B00000208A00002099000020F2 +:102C8000BD000020BE000020BA000020BB000020D4 +:102C9000BF000020C0000020C1000020C2000020B2 +:102CA000B6000020BC00002010B507480078FEF7F1 +:102CB0008BFD0648FEF762FD46200549088001208D +:102CC0000449087010BD000098000020C4000020D6 +:102CD000A8000020BF00002010B504461148048061 +:102CE0000088072803DC00200F49087002E010204C +:102CF0000D49087001200D49087000200C4908801A +:102D00000C480078012802D100F04EFC09E00C20AC +:102D10000949087008460078FEF720FD00200349A5 +:102D2000087010BD92000020940000208A0000204E +:102D300096000020BD000020B700002010B500F074 +:102D400037FE00F033FB10BD10B50A48007820B103 +:102D5000012805D0022809D105E000F08DFA06E02F +:102D600000F0A6FA03E000F0D9FA00E000BF00BFCF +:102D700010BD00009D00002010B52E4840782D4960 +:102D8000097801F00F0140EA01202B49088008462C +:102D900000882A4908802848008840F602018842B5 +:102DA00013DD0D2026490870084601782248008866 +:102DB000FEF7ACFC02202349087000F07FFB0020E6 +:102DC000204908702049087032E01B480088082814 +:102DD0002EDB00F0A7F848B9092019490870084609 +:102DE000017815480088FEF791FC21E0022411E0EB +:102DF0001048005D1549164A128888540F4800880B +:102E0000401E0E49088012480088401C1049088066 +:102E1000601CC4B2072CEBDD01200E490870064887 +:102E20000088FEF748FC01200B49087000F046FBC3 +:102E300010BD0000C40000209E000020A60000205D +:102E4000B7000020B6000020B00000201C0A0020BF +:102E5000A20000209C0000209900002010B5184816 +:102E6000007800F00F001749088001240CE0144896 +:102E7000005D1549154A1288885414480088401C82 +:102E800012490880601CC4B20E4800888442EEDDFE +:102E900000F048F848B909200D4908700846017843 +:102EA00008480088FEF732FC08E000200849087056 +:102EB0000846017803480088FEF728FC10BD000092 +:102EC000C40000209E0000201C0A0020A200002058 +:102ED000B700002010B50E48007800F0F0000D4952 +:102EE000087000200C4908800C49087009480078D7 +:102EF0000B4948760748007810B9FFF7AFFF05E0A7 +:102F000004480078102801D1FFF736FF10BD0000FB +:102F1000C4000020A0000020A2000020B900002072 +:102F20004C3A002000202149097831B1102912D0F3 +:102F3000202918D0302935D12CE01D49098849B104 +:102F40001C490A881A490988491C8A4201DA00206A +:102F500000E0012027E017490988082901DA00204C +:102F600000E001201FE014490988072907DB114907 +:102F70000988082901DA00200BE0012009E00D4949 +:102F80000A880D490988491C8A4201DA002000E0BC +:102F9000012008E007490988032901DA002000E040 +:102FA000012000E000BF00BF70470000A00000202B +:102FB0009E000020A4000020A60000202B490988C4 +:102FC000072932DA01212A4A1180012016E0294915 +:102FD000095C294A294B1B88D15428490988491C76 +:102FE000264A118026490988491E254A1180204910 +:102FF0000988491C1E4A1180411CC8B21B49098816 +:103000008842E4DD1E49098811B901211D4AD177A2 +:1030100001211D4A117008211C4A117001211C4A0E +:1030200011700021154A11801FE0104909880729F5 +:103030001BDB012011E00F49095C0F4A0F4B1B8875 +:10304000D1540E490988491C0C4A11800C49098841 +:10305000491E0B4A1180411CC8B20728EBDD084904 +:10306000098811B90121074AD1777047B2000020C1 +:10307000B4000020C40000201C0A0020A200002090 +:10308000A60000204C3A00209D000020B000002047 +:10309000BE00002010B52D48008838B903202C4907 +:1030A00008700846007800F0CFF84EE02948007814 +:1030B00001284AD10020274908702749087027486D +:1030C000007800F0F000264908700846007818B132 +:1030D00008460078102809D106201D4908700846C6 +:1030E000007800F0B1F8FFF7F5FE2EE01C480078FC +:1030F00020282AD1FFF716FF38B909201449087093 +:103100000846007800F0A0F81FE01448007800F0AE +:103110000F0014490978884210D100201249087024 +:10312000FFF712FE96200949088001200A4908701D +:103130000D48007848B9FFF7CFFB06E004200449AA +:1031400008700846007800F07FF810BDAE0000203F +:10315000B7000020BB000020C2000020C4000020F7 +:10316000A00000209C0000209D00002010B52C4AEB +:1031700012882C4B1B889A421FDB2A4A11780120A7 +:1031800011E0294A125C294B294C24881A55284AF7 +:103190001288521C264B1A80224A1288521E214B3A +:1031A0001A80421CD0B28842EBDD1E4A1288002AE7 +:1031B00035D101221F4BDA7731E0194A1288194BB9 +:1031C0001B889A422BDA01221B4B1A80012016E041 +:1031D000154A125C154B164C24881A55144A12884D +:1031E000521C134B1A800F4A1288521E0D4B1A8024 +:1031F000114A1288521C104B1A80421CD0B2084A45 +:1032000012889042E4DD02220C4B1A7008220C4B0B +:103210001A7001220B4B1A700022054B1A8010BD48 +:10322000B2000020A6000020C40000201C0A0020DC +:10323000A20000204C3A0020B40000209D00002095 +:10324000B0000020BE00002010B50446214606480C +:103250000088FEF75BFA00200449087004490870F2 +:103260000449087010BD00009E000020B00000203E +:1032700099000020BE00002010B50A48008840F6E2 +:103280000201081A0849088008480088072802DB5C +:10329000FFF794FE05E005480088072801DAFFF7EC +:1032A00065FF10BDA2000020B2000020A600002093 +:1032B0001248007808BB16E0114812490988405CA2 +:1032C0001149124A1288885410480088401C0F493E +:1032D00008800F480088401E0D4908800948008872 +:1032E000401C08490880074800880728E4DD0020C2 +:1032F000084908700720084908707047BE00002080 +:10330000C4000020B40000201C0A0020A2000020FD +:10331000A60000209D000020B0000020144909787C +:1033200021BB1449087816E01349144A1288895CB5 +:10333000134A144B1B88D15412490988491C114A5D +:1033400011800C490988491E0A4A11800B490988D5 +:10335000491C0A4A118009490A88411C8A42E3DD56 +:103360000021094A11700721084A117070470000B6 +:10337000BE000020A6000020C4000020B4000020F1 +:103380001C0A0020A20000209D000020B0000020A8 +:10339000054A917831B17F2900DD7F21C8B2421CF6 +:1033A000D0B200E001207047C400002010B51448DE +:1033B0000078092821D2DFE800F005080B0E11146F +:1033C000171A1D00FFF72CFC18E000F069FC15E04F +:1033D00000F0D4FB12E000F01BF80FE000F02EFB31 +:1033E0000CE000F097FC09E000F02CFC06E0FFF791 +:1033F00051FE03E000F096FB00E000BF00BF10BDEF +:10340000B00000200120014908707047BD00002075 +:1034100010B500F00BF80348007810B904200249F9 +:10342000087010BD90000020B000002010B50A48C0 +:10343000007820B1012805D0022809D105E000F06C +:10344000C9F906E000F0ECF903E000F02BFA00E027 +:1034500000BF00BF10BD0000900000201249098885 +:10346000C1F3032141F01001104A11700E4909788F +:103470005170022011E00E490E4A1288895C0B4AF5 +:1034800011540C490988491C0A4A118006490988C7 +:10349000491E054A1180411CC8B20728EBDD0821EE +:1034A000054A11707047000092000020C4000020FF +:1034B0001C0A0020960000209800002010B5174834 +:1034C000007840F03000164908700020487088707D +:1034D00014490880032014490870032404E00020E4 +:1034E0000F490855601CC4B2072CF8DD08200E49AE +:1034F00008700020FEF76EF90B480078FEF764F9BB +:103500000748FEF73BF9062008490870462008499D +:10351000088001200749087010BD0000B600002097 +:10352000C40000209A00002098000020B000002075 +:10353000AA000020C0000020164A1278164B1A700C +:10354000012001210EE0154A154B1B88D25C124B5D +:103550005A54134A1288521C114B1A80421CD0B282 +:103560004A1CD1B20B4A12889142ECDD094A12780A +:10357000521C0C4B1A7007280ADC04E00022064B90 +:103580001A54421CD0B20728F8DD0822054B1A70E5 +:103590007047000092000020C40000201C0A002098 +:1035A000960000209800002010B51048007810B94F +:1035B000FFF7C2FF05E00D480078102801D1FFF7A2 +:1035C0004DFF01200A4908700A480078FEF7FCF810 +:1035D0000948FEF7D3F80120084908704620084939 +:1035E000088001200749087010BD000094000020E9 +:1035F0008F00002098000020C4000020B0000020B0 +:10360000A8000020BF00002010B52A480088072825 +:103610002BDA012028490880012416E02748284990 +:103620000988405C2749085525480088401C2449E2 +:10363000088025480088401E234908801E480088CD +:10364000401C1D490880601CC4B21A48008884428E +:10365000E4DD01201D49087000201D490870FEF7B7 +:10366000C7F800201649088023E012480088072880 +:103670001FDB012411E0114811490988405C114900 +:1036800008550F480088401C0D4908800E480088E6 +:10369000401E0D490880601CC4B2072CEBDD0820D9 +:1036A0000C490870FFF700FB04200B49087000F07C +:1036B00065F910BDB2000020B40000201C0A0020F3 +:1036C00096000020C40000209200002090000020FE +:1036D000BD00002098000020B000002070B53348E5 +:1036E00000883349098888422DDB01253048067857 +:1036F000012413E02F4830490988405C2F490855C0 +:103700002D480088401C2C49088029480088401E0C +:1037100027490880681CC5B2601CC4B2B442E9DD08 +:103720002748067004E0002024494855681CC5B2AB +:10373000072DF8DD082022490870FFF7B5FA0420AC +:103740002049087030E019480088194909888842E2 +:103750002ADA01201C490880012416E01548164980 +:103760000988405C1549085513480088401C1249D7 +:1037700008800F480088401E0D49088012480088C4 +:10378000401C11490880601CC4B20848008884426B +:10379000E4DD02200D49087000200D490870FEF795 +:1037A00027F800200449088070BD0000B200002006 +:1037B000920000201C0A002096000020C400002077 +:1037C00098000020B0000020B400002090000020ED +:1037D000BD00002010B50D48007840F020000C49D5 +:1037E00008700C48008840F60201081A0A4908804F +:1037F0000A480088072802DBFFF706FF05E00748B4 +:103800000088072801DAFFF769FF10BD8F0000204C +:10381000C400002096000020B2000020920000208A +:1038200010B517480078012828D116E01548164928 +:103830000988405C1549164A128888541248008845 +:10384000401C1149088013480088401E1149088017 +:103850000F480088401C0E4908800D480088072842 +:10386000E4DD08200C490870FFF71EFA00200B4920 +:10387000087004200A49087000F080F810BD0000AC +:10388000BD0000201C0A002096000020C40000207B +:10389000B40000209200002098000020900000203A +:1038A000B000002010B52048007801283AD11F4808 +:1038B000047800781E49097808441E49087018E009 +:1038C0001D481E490988405C1D49184A12888854C1 +:1038D0001A480088401C1949088015480088401E75 +:1038E00013490880601CC4B210480088401C0F496E +:1038F00008800E4800880F4909788842E0DB04E020 +:1039000000200F490855601CC4B2072CF8DD0820C0 +:1039100008490870FFF7C8F900200A490870042018 +:103920000949087010BD0000BD000020B40000204F +:1039300092000020980000201C0A00209600002021 +:10394000C400002090000020B000002010B5044604 +:103950002046FDF703FF0020044908700449087061 +:10396000044908700449087010BD0000B000002030 +:103970008A000020BD000020BA000020094800781D +:10398000401C0849087008460078102801D1002022 +:1039900008700548007820B104480078401E0349AB +:1039A000087070478F0000208C0000208B000020E2 +:1039B0001A480078012808D119480088002804DD39 +:1039C00017480088401E16490880164800780128CC +:1039D00008D115480088002804DD13480088401EDF +:1039E0001149088011480078012808D11048008842 +:1039F000002804DD0E480088401E0D4908800D484F +:103A00000078012808D10C480088002804DD0A4805 +:103A10000088401E0849088070470000BF00002051 +:103A2000A8000020C0000020AA000020C100002043 +:103A3000AC000020C2000020AE00002010B52C48D1 +:103A4000008838B901202B49087008460078FFF734 +:103A50007DFF4CE028480078012803D027480078F3 +:103A6000012844D1002026490870234908702548C0 +:103A7000008838B900201F49087008460078FFF711 +:103A800065FF34E02048007848B12048007830B91C +:103A900000201F49087002201E49087027E01E48B8 +:103AA000007818B11C48007801280CD1FFF7BEFC43 +:103AB0001A48007818B900201049087017E0012052 +:103AC0000E49087013E014480078022803D103203F +:103AD000104908700BE010480078022807DD1048F4 +:103AE0000078401E0E49087005200A49087010BD74 +:103AF000A8000020B7000020BA000020BC00002071 +:103B0000BF000020920000208C0000208B000020CD +:103B1000C3000020B00000208D0000209000002095 +:103B20008E00002010B51148008838B903201049D4 +:103B3000087008460078FFF787FB15E00D4800780D +:103B400001280AD100200B4908700B200849087091 +:103B500008460078FFF778FB06E0FFF7F5F806481F +:103B6000007808B9FEF7B8FE10BD0000AE000020D6 +:103B7000B7000020BB0000209D00002010B52B489E +:103B8000008838B902202A49087008460078FFF7F3 +:103B9000DDFE49E027480078012845D1002025496D +:103BA00008702548007800F0F000244908700846A5 +:103BB0000078302838D10020214908701E4800784C +:103BC00000F00F04FFF7AEF938B909201849087062 +:103BD00008460078FFF7BAFE26E0032C07DB052035 +:103BE0001349087008460078FFF7B0FE1CE0022C6D +:103BF00007D108200E49087008460078FFF7A6FE96 +:103C000012E0012C0DD10720094908700846007800 +:103C1000FFF79CFE9520054908800120084908709F +:103C200002E00CB9FEF7C4FF10BD0000AC0000209C +:103C3000B7000020BB000020C4000020A00000202E +:103C4000C100002010B50F48007801280ED10020D7 +:103C50000C4908700C49087007200C490870962020 +:103C60000B49088001200B49087009E00A480088C8 +:103C700030B901200949087008460078FFF7E4FAD6 +:103C800010BD0000BA000020C0000020B0000020DD +:103C9000AE000020C2000020AA000020B7000020D3 +:103CA00010B51548008838B9012014490870084635 +:103CB0000078FFF74BFE1DE011480078012819D16C +:103CC00000200F4908700F4908700F48007838B974 +:103CD00000200A49087008460078FFF737FE09E01F +:103CE00009480078102805D10120084908700220F1 +:103CF0000749087010BD0000A8000020B700002090 +:103D0000BA000020BF00002094000020C300002063 +:103D1000B000002008480078401E07490870084697 +:103D20000078012806DC0320044908700448007864 +:103D300001490870704700008E000020B00000208C +:103D40008D0000200246002321B90D480068106054 +:103D5000012070470A4803681068984205D8106827 +:103D6000181A884209D30120F3E71068C0F1FF3028 +:103D70001844884201D30120EBE70020E9E7000066 +:103D8000340000204F48007801280AD14E4840896D +:103D9000401C4D49488101200870002049490870A5 +:103DA00000E0704748484089052190FBF1F201FB93 +:103DB000120030B94448408918B101204249487086 +:103DC00000E0EEE7404840890A2190FBF1F201FB58 +:103DD000120028B93C48408910B101203A49887046 +:103DE00039484089142190FBF1F201FB120028B9F7 +:103DF0003548408910B101203349C87032484089A4 +:103E0000322190FBF1F201FB120028B92E484089C3 +:103E100010B101202C4908712B484089642190FB86 +:103E2000F1F201FB120028B92748408910B10120A6 +:103E300025494871244840894FF4FA7190FBF1F20A +:103E400001FB120028B92048408910B101201E4909 +:103E500088711D4840894FF47A7190FBF1F201FBA3 +:103E6000120028B91848408910B101201649C871BC +:103E70001548408940F2DC5190FBF1F201FB120041 +:103E800028B91148408910B101200F4908720E4825 +:103E900040894FF4FA6190FBF1F201FB120028B95E +:103EA0000948408910B101200749487206484089F5 +:103EB00041F27071884202DB00200349488100BF53 +:103EC0006FE7000030000020900100200FB5184877 +:103ED00000880A2802DB002015490880144802885F +:103EE000001D00EB0210009901609DF804101048BD +:103EF0000288001D00EB021001719DF80D100C48A6 +:103F00000288001D00EB0210417309480188001D62 +:103F100000EB0110DDF8051040F8051FDDF8091071 +:103F2000416003480088401C014908800FBD000023 +:103F30002012002010B51748006800B110BDFCF732 +:103F400041FF00B9FAE71BE0134840880A2802DB6A +:103F500000201149488010484188001D00EB0114E1 +:103F600094E80F0001F08FF901200C4988700020BF +:103F700081F8280008484088401C0749488005E02F +:103F800005480088044949888842DDD100BF00BF48 +:103F9000D4E7000068000020201200204C3A0020E6 +:103FA00010B50948807E70B10748407F10280AD1BB +:103FB0000549087F00F05AFB002003498876FF215D +:103FC0000248FCF718F910BD4C3A00201C0A0020EA +:103FD00010B50748807E50B10548407F112806D1B2 +:103FE0000348293000F010FC00200149887610BDFC +:103FF0004C3A002010B50648807E40B10448407F0E +:10400000222804D100F072FA00200149887610BD00 +:104010004C3A002010B51448807E20B31248407FEF +:10402000272820D1104890F82900042809D00F4AE9 +:104030000D492931032000F047FC00200A49887609 +:1040400011E0094890F8290004280CD1074A0649D4 +:10405000293100F039FC002003498876C8770348ED +:1040600000210160416010BD4C3A0020EC000020AE +:1040700010B50A48807E78B10848407F28280BD1C7 +:1040800002210648293000F033FD002003498876DC +:10409000FF210348FCF7AFF810BD00004C3A0020A8 +:1040A0001C0A002010B50948807E70B10748407F87 +:1040B0002E280AD106480088401E81B2054800F02B +:1040C0005BFA00200149C877887610BD4C3A002081 +:1040D000A20000201D0A002010B50A48807E78B199 +:1040E0000848407F31280BD103210648293000F0D1 +:1040F00089FD002003498876FF210348FCF77BF8FF +:1041000010BD00004C3A00201C0A002010B50C48DD +:10411000807E98B10A48407F34280FD10948008832 +:10412000401E81B2084800F0A7FD002004498876AF +:104130004877FF210448401EFCF75DF810BD0000E1 +:104140004C3A0020A20000201D0A002010B50C48A7 +:10415000807EA0B10A48407F362810D109480078F7 +:10416000401EC1B20648293000F014FE0020044968 +:104170008876487740F602010348FCF73CF810BD0A +:104180004C3A0020A20000201C0A002010B509486B +:10419000807E70B10748407F37280AD106480088E2 +:1041A000401E81B2054800F01FFE002001498876BC +:1041B000487710BD4C3A0020A20000201D0A0020C4 +:1041C00010B50748807E50B10548407F3E2806D193 +:1041D0000348293000F010FA00200149887610BD0C +:1041E0004C3A002010B50A48807E78B10848407FDC +:1041F00085280BD101210648293000F04DFE002012 +:1042000003498876FF210348FBF7F5FF10BD000046 +:104210004C3A00201C0A00208178064A1170C178AF +:10422000517011460978491C117011464978891C52 +:1042300051707047EC00002010B509480078012843 +:104240000DD1074840780D2806DA05484078054921 +:1042500051F82040A04702E000200149087010BD3D +:10426000F4000020F800002010B501200249087079 +:1042700000F078FE10BD0000F400002010B5002012 +:104280000249087000F06EFE10BD0000F40000202E +:104290002DE9F04100240125A046002600277E4894 +:1042A000007801281DD100207B490870084640791C +:1042B00088B9012048710846C06878490860764886 +:1042C00000697749086000207649086076490880CF +:1042D00071498871DDE003206F49887100204871C1 +:1042E000D7E06D484079012869D16B4988716C48E5 +:1042F000006890B16A480068B0F5006F08D9684856 +:104300000068A0F50060664908604FF4006704E0AB +:104310006348076800206249086060490968614A8B +:10432000126888183946FCF78CFE05465D4800681F +:1043300038445C4908605C480088401C5A49088041 +:104340002DB103205449887100204871A1E05448E0 +:10435000006830BB022050498871002048717122EA +:104360002046611CCCB251490A5401222046611CEE +:10437000CCB24E490A54FF222046611CCCB24B49B4 +:104380000A5400222046611CCCB248490A5401223A +:104390002046611CCCB245490A542046FDF748FA34 +:1043A00077E041480088142190FBF1F201FB1200F4 +:1043B00000286ED178213120FDF71CFA69E03648DB +:1043C0004078012865D176222046611CCCB237495D +:1043D0000A54314890F829282046611CCCB2334950 +:1043E0000A543348B0F84000861E32462A49243128 +:1043F000081FFCF7A9FC28488068A0B92648163099 +:10440000FCF756FC042224492431A1F10E00FCF7EC +:1044100053FC2148406A2049C861FF2204211E48FC +:104420002430FBF7E1FE1C498968224A881832468D +:1044300019492431FDF735FD054617488068304499 +:10444000154988600846D0F82C081B49096888423D +:1044500009D319480068061F32461649091D0E483F +:104460001630FCF729FC25B910492046FDF7E0F984 +:1044700006E000200849C86172213620FDF7BAF92C +:10448000054890F82908401C034981F829080020B4 +:104490004870BDE8F0810000183200205001002073 +:1044A00054010020580100205C010020A03C0020A5 +:1044B0004C3A0020008000084401002000200A49F6 +:1044C00081F82700C87081F826000120C8760020F6 +:1044D00081F820008871C88781F8220081F82300C4 +:1044E00081F82500704700004C3A002070B5002488 +:1044F00000251E484078012837DD1D480079012835 +:1045000033D11B48B0F84000032824DB1849B1F828 +:10451000400000EBD0714910A0EB4101012918D1F6 +:104520001349B1F84010032913DC1248FCF768FF67 +:104530000546032D04DB0F492846FDF779F90BE00A +:104540000B48B0F84C0040F28571884204D1312408 +:1045500002E0132400E013241CB121462220FDF7C1 +:1045600049F91E200249A1F8440070BD480100200D +:104570004C3A0020A03C00202DE9F04104460D46B5 +:10458000002600271948407801282CDD18480079BA +:10459000012828D11649C87E00220221FCF750FCD0 +:1045A000B8B1032D01DA132714E0A81E81B220460A +:1045B000FDF794FD064656B96E200E490870207826 +:1045C0004870607888700320FDF732F902E03746C2 +:1045D00000E07F271FB139462E20FDF70BF9282078 +:1045E0000349A1F84400BDE8F08100004801002023 +:1045F0004C3A0020A03C002070B50446002500265F +:104600001748407801282ADD1649B1F840000221F8 +:10461000FCF74BFCC8B1207800F07F0666B9207823 +:10462000FCF73CFC90B17E200F4908702078487060 +:104630000220FDF7FDF809E00A480079012805D1BC +:10464000002008490871122500E013251DB12946F4 +:104650003E20FDF7CFF80A200249A1F8440070BDC2 +:10466000480100204C3A0020A03C00202DE9F041F8 +:1046700005460227002600245F48407801287DDD9A +:1046800010205D490870002048705C49B1F8400076 +:104690000221FCF70AFC002871D005F07F04012CF0 +:1046A00003D0022C01D0032C6AD15448C07E0328C9 +:1046B0003AD1022C38D1FCF7FFFB002832D04F480A +:1046C000C476C47600204D4981F820008871C887DF +:1046D00081F8220081F8230081F825002846FCF7A4 +:1046E000DDFB80B150204649087008464570002027 +:1046F00088703220C87001200871F42048710627A4 +:104700003846FDF795F800203E4981F8240881F8E5 +:10471000250881F8260881F8280881F8270881F8FB +:1047200030085AE0222658E03448C07E012801D1E2 +:10473000022C05D03148C07E022803D1032C01D1C0 +:104740007E264AE0032C03D100202C49C8730AE0DE +:10475000012C08D12948C07E022804D10120274914 +:104760000870C82088772548C47600202349C88768 +:1047700081F8200088710846C07E02E03AE02BE014 +:1047800021E0032801D1032C07D000201B4981F828 +:10479000220081F8230081F825002846FCF77EFBE3 +:1047A000D8B150201649087008464570002088701E +:1047B0003220C87001200871F4204871062738465D +:1047C000FDF736F809E00D480079012805D10020F1 +:1047D0000A490871122600E013261EB13146102046 +:1047E000FDF708F80A2004498880084680880349B4 +:1047F000A1F84400BDE8F081480100204C3A0020B7 +:10480000A03C00201832002070B504460025002688 +:104810002948407801284DDD1120274908700020E3 +:1048200048701E20888025480079012842D12349FC +:10483000B1F840000221FCF738FB002830D0207886 +:1048400000F07F063046FCF721FB00B3FCF734FB99 +:10485000D8B12078FCF722FB38B1512018490870F4 +:10486000207848700220FCF7E3FF16480079012801 +:1048700005D10020134908711149087048700120C2 +:104880000E490870C82088770BE0222509E00B4804 +:104890000079012805D1002008490871122500E09F +:1048A00013251DB129461120FCF7A4FF0A20034956 +:1048B000A1F8440070BD0000480100204C3A0020DF +:1048C000A03C0020183200202DE9F04781460C461C +:1048D000154600274FF0FF087F48407801287DDD0E +:1048E0007E480079012879D17C49C87E0122114691 +:1048F000FCF7A6FA002872D0207803283ED10020C9 +:10490000774908707549B1F840000221FCF7CDFAEB +:1049100088B37248C078012801D13727CEE06720DC +:1049200070490870207848706F48FCF75EFD80463B +:10493000B8F1000FF2D1694890F82000012807D1A2 +:1049400066488079012803D166480021418003E050 +:1049500064486549098841800120614908705F49C0 +:10496000887167205C490870002048705D49042008 +:10497000FCF75EFFA2E0FFE713279FE02078042802 +:104980007CD15649B1F840000421FCF78EFA00288A +:1049900075D0524890F82600032802DC5048007871 +:1049A00058B94E4890F82600032800DB36274C48BB +:1049B00000780028B2D1242780E0494800780128F7 +:1049C00002D10020464908704648002101600222B9 +:1049D0004549FBF71BFC00285FD001E079E06CE063 +:1049E00041494978404A127801EB022188B2FCF72C +:1049F000CBFC064660782870A0786870E078A870D4 +:104A00002079E8703012394908704E700222284629 +:104A1000FBF7FCFBF8B90020304981F8260067203D +:104A200030490870207848702078042801D101208E +:104A300000E00220294981F82100672026490870FA +:104A4000002048700120254981F8200025490220D6 +:104A5000FCF7EEFE22E0214890F82600FF2806DA57 +:104A60001E4890F82600401C1C4981F826001B486F +:104A700090F82600022803DC35270FE014E011E04F +:104A8000164890F82600032808D136273C20134901 +:104A900081F827000120C87000E024271248002177 +:104AA00001600BE0132709E00C48B0F84000022831 +:104AB00001DA132702E0122700E07F271FB13946F1 +:104AC0002720FCF797FE1E20034988800349A1F8A0 +:104AD0004400BDE8F0870000480100204C3A002067 +:104AE0005E010020A03C0020780000207A00002019 +:104AF0002DE9F0410446884600270025002668205D +:104B00003D4908703D484078012873DD28203B4925 +:104B100008701E2088803A49C87E01221146FCF7A1 +:104B20008FF9002855D03649B1F840000321FCF731 +:104B3000BCF900284BD0FCF7BFF9002845D02078FD +:104B400000F07F0566780DB1032D35D1012E01D01F +:104B5000032E28D16DB9012E04D10020284981F8F7 +:104B6000220015E00020264981F8220081F8230068 +:104B70000EE0032D0CD1012E04D10120204981F833 +:104B8000220005E001201E4981F8220081F823005F +:104B90002078FCF783F920B3207817494870022069 +:104BA000FCF746FE1DE01648B0F84C0040F2857157 +:104BB000884216D1312714E011480079012810D11C +:104BC00000200F49087112270BE0222709E0132764 +:104BD00007E00B48B0F84C0040F28571884200D1E4 +:104BE0007F271FB139462820FCF704FE0A2004491C +:104BF000A1F84400BDE8F081A03C0020480100205D +:104C00004C3A0020F8B505460E46002400200090DE +:104C100016484078012827DD3120144908701E20ED +:104C200088801348007901281ED11149C87E0122CD +:104C30001146FCF705F938B16B460E4A3146284655 +:104C4000FDF794FA044600E07F2424B12146312088 +:104C5000FCF7D0FD04E00749BDF80000FCF7E8FDD3 +:104C60000A200349A1F84400F8BD000048010020D3 +:104C70004C3A0020A03C00202DE9F04104460E46AD +:104C800000273D484078012874DD3C48007908B988 +:104C9000BDE8F0813949C87E00220221FCF7D0F836 +:104CA000002855D0354890F8200001284ED12578AD +:104CB00094F801800A2E47D115B9B8F1440F01D0FC +:104CC000312746E0A0780006E17840EA01402179EA +:104CD00040EA01206179084329490860A07900066B +:104CE000E17940EA0140217A40EA0120617A0843F3 +:104CF0002449086074202449087008464570202023 +:104D00004870082088700220C87001201F4981F86F +:104D100029080020C1F82C088860194800681C493F +:104D200088420FD117480068B0F5563F0AD217489D +:104D300090F8240820B114490420FCF779FD08E01C +:104D4000222706E0702704E0132702E0332700E063 +:104D50007F2727B139463420FCF74CFD03E00120C2 +:104D60000A4981F830081E2003498880142003492D +:104D7000A1F8440000BF8BE7480100204C3A002016 +:104D80004001002044010020A03C002018320020F7 +:104D900000800008F8B505460E460024002000906B +:104DA0000E484078012818DD36200C4908701E2076 +:104DB00088800B48007901280FD16B46094A31469B +:104DC0002846FDF7CFFB04461CB121463620FCF7F0 +:104DD00011FD1E200249A1F84400F8BD4801002041 +:104DE0004C3A0020A03C002070B505460E46002439 +:104DF00077202549087025484078012843DD24485C +:104E0000007901283FD17720204908701E20888032 +:104E1000002048701E49C87E00220221FCF710F8CD +:104E200038B31B4890F82000012820D11849B1F868 +:104E300040000121FCF739F8B8B1164890F8300865 +:104E4000022810D1772010490870124890F82000ED +:104E5000C043487003200F4981F830080A490220F6 +:104E6000FCF7E6FC06E0242404E0132402E03324EB +:104E700000E07F241CB121463720FCF7BBFC0A2050 +:104E80000349A1F8440070BDA03C00204801002067 +:104E90004C3A0020183200202DE9F04104460F461C +:104EA000002600252C484078012853DD85202A491A +:104EB00008701E2088802949C87E01221146FBF710 +:104EC000BFFF002835D02549B1F840000221FBF78B +:104ED000ECFF60B3FBF7F0FF08B9222631E0207841 +:104EE00000F07F05012D01D0022D17D1012D04D135 +:104EF00000201A4981F8250003E00120174981F8B4 +:104F000025002078FBF7CAFFD8B1C52014490870E6 +:104F1000207848700220FCF78BFC12E00F480079E3 +:104F200001280ED100200D490871122609E0132630 +:104F300007E00A48B0F84C0040F28571884200D181 +:104F40007F261EB131468520FCF754FC0A20034918 +:104F5000A1F84400BDE8F081480100204C3A00204F +:104F6000A03C002010B5FCF7C3FA012823D1022091 +:104F70001649C87601200873002081F82000887146 +:104F8000C88781F8220081F8230081F8250081F884 +:104F90002700C87050200E4908700C48C07E487029 +:104FA000002088703220C87001200871F4204871F8 +:104FB0000620FCF73DFC00200649087002204870DE +:104FC000012088700020888010BD00004C3A00202D +:104FD000A03C00204801002010B50848807E58B150 +:104FE0000649487F00F014F8002004498876487785 +:104FF000FF210348FBF7FFF810BD00004C3A0020EA +:105000001C0A002010B50446FFF738F910BD000057 +:1050100070B50546002415484078012825DD144860 +:10502000407F342807D01248407F362803D01048EC +:10503000407F372808D10E49C87E00220221FBF7A5 +:10504000FFFE48B97F2407E009480079012803D111 +:1050500000200749087111241CB121462846FCF79D +:10506000C9FB0A200249A1F8440070BD4801002094 +:105070004C3A00201E2001498880704748010020DA +:1050800070B505460C4605480078272805D160789C +:10509000012802D12046FFF7BFF870BD480100206B +:1050A0002DE9F04107460E4614464EBB3F48407876 +:1050B000012825D13D48007840302178884207D129 +:1050C00021463846FFF7DCFF0220384948706BE084 +:1050D00020787F2868D1354800786178884263D18C +:1050E000A078782805D1FFF7C5FF04202F49487024 +:1050F0005AE0A078FFF786FF03202C49487053E060 +:10510000002E44D129484078022840D12078102828 +:1051100005D1022025494870607825490877207814 +:1051200023494877002518E02248405D2049497FFF +:10513000884210D11E48407F342803D01C48407F4D +:10514000362805D11C48008820B91C48457001E06C +:105150001A48457003E0681CC5B20D2DE4DB00BFA2 +:105160000D2D02D10C20154948701421104829300A +:10517000FBF741F81422611C0D482930FBF714F8A5 +:1051800001200B4988760846A0F840700CE0092EF3 +:105190000AD10B480078012806D100200849087080 +:1051A000FF210848FBF727F8BDE8F08148010020FF +:1051B0004C3A0020EE5B0008A6000020F40000201E +:1051C000CC0000201C0A00200120014948707047D3 +:1051D00048010020704710B500F098F810BD70B578 +:1051E00004460D46164632462946204600F05AFA35 +:1051F00070BD70B504460D46164632462946204617 +:1052000000F093FA70BD00001149096851B94FF0E0 +:10521000E02189690E4A1160114609680D4A51431F +:105220000B4A11604FF0E0218969094A1268881819 +:105230000749096843F285621144054A116080B24A +:105240001146098801EB810140EA014070470000E6 +:10525000D00000200DE37A050FB41FB5069800902A +:105260009DF822008DF804009DF804200DF1230123 +:105270000DF10500FAF798FF9DE80F0000F0B0F877 +:105280001FBC5DF814FB0FB587B000208DF810002F +:10529000079802909DF820008DF8120000208DF8EC +:1052A00011009DF812200DF121010DF11300FAF704 +:1052B0007BFF0698009002A80FC8FBF751FD0BB0CA +:1052C00000BD10B50A20FBF74BFEFCF7AFFD10BD8B +:1052D00010B50348027803A10B48FAF765FF10BD2B +:1052E000585B0008515246424C5F312E335F3233D7 +:1052F0003036303820202020202020202020202060 +:1053000020202020000000003006002010B52D488D +:10531000007850B9FFF7DCFFFBF7E4FDFBF71EFE5A +:10532000FFF7CCF801202749087027480078D8B14A +:105330002548807F28B12448807F401E22498877F5 +:1053400011E000202049087000BF2048006800F4E8 +:10535000E0601F490843001D1C490860BFF3408FEF +:1053600000BF00BFFEE710BD1A480088401C80B295 +:105370001849088002280DDB00200880FEF774FF22 +:1053800001201149C8710020487600F067F800201C +:105390001149088011480088401C80B20F490880DC +:1053A000012805DB00200880FEF746FFFCF7D2F954 +:1053B000FEF7C0FDFCF7BAF8FBF708FDFEF768FF43 +:1053C00000BFD0E7EA0000204C3A00200CED00E0DE +:1053D0000000FA05E4000020E8000020E6000020BC +:1053E0000FB540F2DF710098884204D040F2857119 +:1053F000009888422FD118480088B0F5FA7F02DB68 +:1054000000201549088014480288001D00EB021096 +:10541000009901609DF804100F480288001D00EB00 +:10542000021001719DF80D100B480288001D00EB61 +:105430000210417308480188001D00EB0110DDF8DF +:10544000051040F8051FDDF809104160024800888A +:10545000401C014908800FBDC412002010B51EE099 +:1054600012484088B0F5FA7F02DB00200F494880DF +:105470000E4880780E4908700C484188001D00EBEA +:10548000011494E80F00FCF7E1FC08484088401C38 +:105490000649488007480068401C064908600348E0 +:1054A0000088024949888842DAD110BDC412002020 +:1054B000D5000020E000002000BFFEE744E03221DC +:1054C0003EE000BF00BF00BF00BF00BF00BF00BF85 +:1054D00000BF00BF00BF00BF00BF00BF00BF00BFD4 +:1054E00000BF00BF00BF00BF00BF00BF00BF00BFC4 +:1054F00000BF00BF00BF00BF00BF00BF00BF00BFB4 +:1055000000BF00BF00BF00BF00BF00BF00BF00BFA3 +:1055100000BF00BF00BF00BF00BF00BF00BF00BF93 +:1055200000BF00BF00BF00BF00BF00BF00BF00BF83 +:1055300000BF00BF00BF00BF00BF00BF4A1ED1B206 +:105540000029BEDC421ED0B20028B8DC704702E061 +:1055500008C8121F08C1002AFAD1704770470020FE +:1055600001E001C1121F002AFBD1704708B50121DB +:105570000820FCF7DBFC03208DF8020014208DF8D6 +:1055800003004FF48060ADF8000069460D48FBF75A +:1055900024FE03208DF802004FF40060ADF80000F7 +:1055A00014208DF8030069460648FBF716FE4FF4F9 +:1055B00080610448FBF7E6FE4FF400610148FBF709 +:1055C000E1FE08BD000C0140022808DA074911F885 +:1055D000301021B1054911F83010032900D170476E +:1055E0000221024A02F8301000BFF8E76C010020E7 +:1055F00010B50446022C03DA0C4810F8340000B948 +:1056000010BD0320094901F8340001EBC401081D55 +:105610000021FEF797FB1CB90548FAF7EFFF02E0FF +:105620000448FAF7EBFF00BFEAE700006C01002036 +:105630000064004000680040022800DB7047012140 +:10564000024A02F8301000BFF8E700006C010020A9 +:10565000022803DA074911F8301001B97047012117 +:10566000044A02F83010002102EBC002517000BF62 +:10567000F4E700006C0100200146022908DA064820 +:1056800010F8310020B1044810F83100032801D18E +:10569000002070470120FCE76C01002010B5FFF7E7 +:1056A00065FF10BD2DE9F04107460C461646FCF794 +:1056B00075F9A020FCF744F9FCF79EF900B130E041 +:1056C000A046E11704EB1161C1F30720FCF738F99C +:1056D000FCF792F900B124E0E0B2FCF731F9FCF7F5 +:1056E0008BF900B11DE0FCF759F9A120FCF728F96E +:1056F000FCF782F900B114E000250BE0711EA9420D +:1057000001D0012100E000210846FCF7EFF87855B0 +:10571000681C85B2B542F1DBFCF75AF90120BDE8FF +:10572000F081FCF755F90020F9E72DE9F04706462E +:105730000F4690463C46002534E035B1E11704EBB6 +:10574000D1614911A4EB411109BB25B1FCF740F926 +:105750000620FBF705FCFCF721F9A020FCF7F0F888 +:10576000FCF74AF900B124E0A146E11704EB11610E +:10577000C1F30720FCF7E4F8FCF73EF900B118E0AC +:10578000E0B2FCF7DDF8FCF737F900B111E0705D2D +:10579000FCF7D6F8FCF730F900B10AE0601C84B2DF +:1057A000681C85B24545C8DBFCF712F90120BDE84D +:1057B000F087FCF70DF90020F9E7002001E0411C1B +:1057C00088B23C28FBDB704786B0FDF723F8FAF778 +:1057D00068FDFCF7EDF9FCF7E9FF01A8FCF7B6FB63 +:1057E000FCF7DBFAFCF716FAFFF758FFFCF744F971 +:1057F000FAF7A4FD4FF400712648FBF7C1FDFFF74F +:1058000060FDFBF781FE43E0FEF7BCFA224800781A +:10581000012805D1002020490870FFF7DCFC37E0A3 +:105820001D484078012805D100201B494870FCF72D +:105830001FF92DE018488078012805D1002016496D +:105840008870FFF7C7FC23E01348C078012803D114 +:1058500000201149C8701BE00F480079012803D1CE +:1058600000200D49087113E00B484079012803D14D +:105870000020094948710BE00748C079012807D189 +:1058800000200549C8714FF400710248FBF778FD0C +:10589000BAE70000000C0140900100202DE9F0471C +:1058A00004460F46154699463DB161190E4881429E +:1058B00003D8A0F50070844203D24FF0FF30BDE85A +:1058C000F08737B1002602E0B85DA055761CAE42E5 +:1058D000FAD30648A4EB0008AAB21FFA88F12046C2 +:1058E000FFF787FC0020EAE7A03C0020A03A002058 +:1058F0002DE9F04104460D4616461F463B4632460A +:1059000029462046FFF7CAFF80464046BDE8F081A1 +:10591000515246424C5F312E335F3233303630388D +:105920002020202020202020202020202020202077 +:10593000000000002110422063308440A550C66062 +:10594000E770088129914AA16BB18CC1ADD1CEE13C +:10595000EFF13112100273325222B5529442F772B3 +:10596000D662399318837BB35AA3BDD39CC3FFF38C +:10597000DEE36224433420040114E664C774A444C3 +:1059800085546AA54BB528850995EEE5CFF5ACC5DC +:105990008DD55336722611163006D776F666955693 +:1059A000B4465BB77AA719973887DFF7FEE79DD72C +:1059B000BCC7C448E5588668A77840086118022823 +:1059C0002338CCC9EDD98EE9AFF9488969990AA97C +:1059D0002BB9F55AD44AB77A966A711A500A333AF3 +:1059E000122AFDDBDCCBBFFB9EEB799B588B3BBBCC +:1059F0001AABA66C877CE44CC55C222C033C600C83 +:105A0000411CAEED8FFDECCDCDDD2AAD0BBD688D1B +:105A1000499D977EB66ED55EF44E133E322E511ED2 +:105A2000700E9FFFBEEFDDDFFCCF1BBF3AAF599F6B +:105A3000788F8891A981CAB1EBA10CD12DC14EF10B +:105A40006FE18010A100C230E32004502540467071 +:105A50006760B9839893FBA3DAB33DC31CD37FE39C +:105A60005EF3B1029012F322D232354214527762C1 +:105A70005672EAB5CBA5A89589856EF54FE52CD56C +:105A80000DC5E234C324A014810466744764245411 +:105A90000544DBA7FAB79987B8975FE77EF71DC77C +:105AA0003CD7D326F2369106B01657667676154661 +:105AB00034564CD96DC90EF92FE9C899E9898AB9CC +:105AC000ABA94458654806782768C018E1088238B1 +:105AD000A3287DCB5CDB3FEB1EFBF98BD89BBBABDC +:105AE0009ABB754A545A376A167AF10AD01AB32A01 +:105AF000923A2EFD0FED6CDD4DCDAABD8BADE89D2C +:105B0000C98D267C076C645C454CA23C832CE01C50 +:105B1000C10C1FEF3EFF5DCF7CDF9BAFBABFD98FBB +:105B2000F89F176E367E554E745E932EB23ED10EA0 +:105B3000F01E000022002500340046004B005900F2 +:105B40006C007A0088008E00920096009A009E00F9 +:105B5000A100A400A700AA0020010D10030C110C45 +:105B60000C040202020201010101010080F186F130 +:105B700087F194F18AF18CF190F191F198F199F11A +:105B800010FE11FE12FE13FE14FE15FE16FE17FE89 +:105B900018FE0000000000000100010101010101E8 +:105BA00001010101010000001300210027002B006A +:105BB0002F00330037003A003D0040004300110041 +:105BC0000C000400020002000200020001000100BB +:105BD00001000100010090F198F199F110FE11FE11 +:105BE00012FE13FE14FE15FE16FE17FE18FE10110F +:105BF000222E273E3128853436377F001C5C000872 +:105C000000000020600100004C0200086C5C0008ED +:105C100060010020C04300005E5500081184A24AC4 +:105C2000040009330102030406070809293B693F00 +:105C3000051502040608EA1F35017B13A13F1B0866 +:105C4000D1041AF50413A5401B08150413C1411B08 +:105C500008D9081A71041AE50C1A0D041A4D042A01 +:0C5C60008D18124F0914D50A1580187118 +:04000005080001519D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.crf new file mode 100644 index 0000000..99aae2b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.d new file mode 100644 index 0000000..7534fc1 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.d @@ -0,0 +1,56 @@ +.\output\bootloader.o: ..\..\Firmware\UDS\bootloader.c +.\output\bootloader.o: ..\..\Firmware\UDS\bootloader.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_config.h +.\output\bootloader.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\bootloader.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bootloader.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\bootloader.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\bootloader.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\bootloader.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\bootloader.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\bootloader.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\bootloader.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_types.h +.\output\bootloader.o: ..\..\Firmware\UDS\bootloader.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_did.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_config.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\bootloader.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\bootloader.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\bootloader.o: ..\..\Firmware\UDS\tp_config.h +.\output\bootloader.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\bootloader.o: ..\..\Firmware\UDS\tp_config.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_interface.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_manage.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_services.h +.\output\bootloader.o: ..\..\Firmware\UDS\uds_api.h +.\output\bootloader.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.o new file mode 100644 index 0000000..1ed129c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bootloader.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.crf new file mode 100644 index 0000000..62aff84 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.d new file mode 100644 index 0000000..eb09048 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.d @@ -0,0 +1,59 @@ +.\output\bsp_can.o: ..\..\Firmware\HARDWARE\CAN\bsp_can.c +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\bsp_can.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\bsp_can.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\bsp_can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_can.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\bsp_can.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\bsp_can.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\bsp_can.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\bsp_can.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\bsp_can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\bsp_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\bsp_can.o: ..\..\Firmware\HARDWARE\CAN\bsp_can.h +.\output\bsp_can.o: ..\..\Firmware\HARDWARE\CAN\canbusdrv.h +.\output\bsp_can.o: ..\..\Firmware\HARDWARE\CAN\porting.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_config.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\bsp_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_types.h +.\output\bsp_can.o: ..\..\Firmware\UDS\bootloader.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_config.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_did.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\bsp_can.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\bsp_can.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\bsp_can.o: ..\..\Firmware\UDS\tp_config.h +.\output\bsp_can.o: ..\..\Firmware\UDS\tp_config.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_interface.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_manage.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_services.h +.\output\bsp_can.o: ..\..\Firmware\UDS\uds_api.h +.\output\bsp_can.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.o new file mode 100644 index 0000000..b92ea64 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_can.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.crf new file mode 100644 index 0000000..8ce0900 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.d new file mode 100644 index 0000000..f456e59 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.d @@ -0,0 +1,34 @@ +.\output\bsp_cpu_flash.o: ..\..\Firmware\HARDWARE\cupflash\bsp_cpu_flash.c +.\output\bsp_cpu_flash.o: ..\..\Firmware\SYSTEM\sys\Sys.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\bsp_cpu_flash.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\bsp_cpu_flash.o: ..\..\Firmware\HARDWARE\cupflash\bsp_cpu_flash.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.o new file mode 100644 index 0000000..245a7cc Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_cpu_flash.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.crf new file mode 100644 index 0000000..8b37ba1 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.d new file mode 100644 index 0000000..d6bdcc8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.d @@ -0,0 +1,33 @@ +.\output\bsp_i2c_gpio.o: ..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.c +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\bsp_i2c_gpio.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\bsp_i2c_gpio.o: ..\..\Firmware\HARDWARE\I2C\bsp_i2c_gpio.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.o new file mode 100644 index 0000000..8242e8f Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/bsp_i2c_gpio.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.crf new file mode 100644 index 0000000..6d83de2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.d new file mode 100644 index 0000000..221bff8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.d @@ -0,0 +1,42 @@ +.\output\can.o: ..\..\Firmware\HARDWARE\CAN\can.c +.\output\can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\can.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\can.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\can.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\can.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\can.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\can.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\can.o: ..\..\Firmware\SYSTEM\usart\usart.h +.\output\can.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\can.o: ..\..\Firmware\SYSTEM\delay\delay.h +.\output\can.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\can.o: ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h +.\output\can.o: ..\..\Firmware\HARDWARE\DC300\dc300.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.o new file mode 100644 index 0000000..08b755e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.crf new file mode 100644 index 0000000..3687fb6 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.d new file mode 100644 index 0000000..ebf1e54 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.d @@ -0,0 +1,43 @@ +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\can_app.c +.\output\can_app.o: ..\..\Firmware\SYSTEM\sys\Sys.h +.\output\can_app.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can_app.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\can_app.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\can_app.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\can_app.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\can_app.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\can_app.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\can_app.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\can_app.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\CanBusDrv.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\porting.h +.\output\can_app.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\can_app.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\can_app.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\candrvctrl.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\CAN\can_nm.h +.\output\can_app.o: ..\..\Firmware\HARDWARE\LED\led.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.o new file mode 100644 index 0000000..77fead1 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_app.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.crf new file mode 100644 index 0000000..18f3ebd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.d new file mode 100644 index 0000000..83bd52b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.d @@ -0,0 +1,37 @@ +.\output\can_nm.o: ..\..\Firmware\HARDWARE\CAN\can_nm.c +.\output\can_nm.o: ..\..\Firmware\SYSTEM\sys\Sys.h +.\output\can_nm.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can_nm.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\can_nm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\can_nm.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\can_nm.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\can_nm.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\can_nm.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\can_nm.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\can_nm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\can_nm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\can_nm.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\can_nm.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\can_nm.o: ..\..\Firmware\HARDWARE\CAN\can_nm.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.o new file mode 100644 index 0000000..75429f4 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/can_nm.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.crf new file mode 100644 index 0000000..37ee562 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.d new file mode 100644 index 0000000..c0e989d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.d @@ -0,0 +1,40 @@ +.\output\canbusdrv.o: ..\..\Firmware\HARDWARE\CAN\CanBusDrv.c +.\output\canbusdrv.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\canbusdrv.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\canbusdrv.o: ..\..\Firmware\HARDWARE\CAN\canbusdrv.h +.\output\canbusdrv.o: ..\..\Firmware\HARDWARE\CAN\porting.h +.\output\canbusdrv.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\canbusdrv.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\canbusdrv.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\canbusdrv.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\canbusdrv.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\canbusdrv.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\canbusdrv.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\canbusdrv.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\canbusdrv.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\canbusdrv.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\canbusdrv.o: ..\..\Firmware\HARDWARE\CAN\candrvctrl.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.o new file mode 100644 index 0000000..11bf3c9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/canbusdrv.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.crf new file mode 100644 index 0000000..0a4c479 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.d new file mode 100644 index 0000000..77d1ade --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.d @@ -0,0 +1,37 @@ +.\output\candrvctrl.o: ..\..\Firmware\HARDWARE\CAN\CanDrvCtrl.c +.\output\candrvctrl.o: ..\..\Firmware\HARDWARE\CAN\porting.h +.\output\candrvctrl.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\candrvctrl.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\candrvctrl.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\candrvctrl.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\candrvctrl.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\candrvctrl.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\candrvctrl.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\candrvctrl.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\candrvctrl.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\candrvctrl.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\candrvctrl.o: ..\..\Firmware\HARDWARE\CAN\candrvctrl.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.o new file mode 100644 index 0000000..4d70f5b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/candrvctrl.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.crf new file mode 100644 index 0000000..8523b4a Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.d new file mode 100644 index 0000000..b6de9d5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.d @@ -0,0 +1,35 @@ +.\output\chipid.o: ..\..\Firmware\HARDWARE\chipID\chipid.c +.\output\chipid.o: ..\..\Firmware\HARDWARE\chipID\chipid.h +.\output\chipid.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\chipid.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\chipid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\chipid.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\chipid.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\chipid.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\chipid.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\chipid.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\chipid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\chipid.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\chipid.o: ..\..\Firmware\SYSTEM\sys\sys.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.o new file mode 100644 index 0000000..b3859fd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/chipid.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.crf new file mode 100644 index 0000000..bcff2bd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.d new file mode 100644 index 0000000..473de5e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.d @@ -0,0 +1,35 @@ +.\output\common.o: ..\..\Firmware\HARDWARE\common\common.c +.\output\common.o: ..\..\Firmware\HARDWARE\common\common.h +.\output\common.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\common.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\common.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\common.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\common.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\common.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\common.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\common.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\common.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\common.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\common.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.o new file mode 100644 index 0000000..50177dd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/common.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.crf new file mode 100644 index 0000000..c2bf6d6 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.d new file mode 100644 index 0000000..728168f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.d @@ -0,0 +1,34 @@ +.\output\crc.o: ..\..\Firmware\UDS\crc.c +.\output\crc.o: ..\..\Firmware\UDS\crc.h +.\output\crc.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\crc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\crc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\crc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\crc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\crc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\crc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\crc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\crc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.o new file mode 100644 index 0000000..589e504 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/crc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.crf new file mode 100644 index 0000000..dfda042 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.d new file mode 100644 index 0000000..ac0988e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.d @@ -0,0 +1,39 @@ +.\output\dc300.o: ..\..\Firmware\HARDWARE\DC300\dc300.c +.\output\dc300.o: ..\..\Firmware\HARDWARE\DC300\dc300.h +.\output\dc300.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\dc300.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\dc300.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\dc300.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\dc300.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\dc300.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\dc300.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\dc300.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\dc300.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\dc300.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\dc300.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\dc300.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\dc300.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\dc300.o: ..\..\Firmware\SYSTEM\usart\usart.h +.\output\dc300.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.o new file mode 100644 index 0000000..cf081bf Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/dc300.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.crf new file mode 100644 index 0000000..41490b5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.d new file mode 100644 index 0000000..26e0ff5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.d @@ -0,0 +1,34 @@ +.\output\delay.o: ..\..\Firmware\SYSTEM\delay\delay.c +.\output\delay.o: ..\..\Firmware\SYSTEM\delay\delay.h +.\output\delay.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\delay.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\delay.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\delay.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\delay.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\delay.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\delay.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\delay.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\delay.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\delay.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.o new file mode 100644 index 0000000..62e9fce Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/delay.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.crf new file mode 100644 index 0000000..e4dd50f Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.d new file mode 100644 index 0000000..e6046a4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.d @@ -0,0 +1,58 @@ +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\diagnosis_mid.c +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_config.h +.\output\diagnosis_mid.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\diagnosis_mid.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\diagnosis_mid.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\diagnosis_mid.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\diagnosis_mid.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_types.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\bootloader.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_config.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_did.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\tp_config.h +.\output\diagnosis_mid.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\tp_config.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_interface.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_manage.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_services.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_api.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\crc.h +.\output\diagnosis_mid.o: ..\..\Firmware\UDS\uds_nvm.h +.\output\diagnosis_mid.o: ..\..\Firmware\HARDWARE\CAN\BSP_CAN.h +.\output\diagnosis_mid.o: ..\..\Firmware\HARDWARE\CAN\can.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.o new file mode 100644 index 0000000..9e97d21 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/diagnosis_mid.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.d new file mode 100644 index 0000000..bacd84d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_adc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_adc.c +.\output\gd32f10x_adc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_adc.h +.\output\gd32f10x_adc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.s new file mode 100644 index 0000000..9a47384 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_adc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.d new file mode 100644 index 0000000..b30d560 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_bkp.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_bkp.c +.\output\gd32f10x_bkp.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_bkp.h +.\output\gd32f10x_bkp.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.s new file mode 100644 index 0000000..b522be3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_bkp.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.d new file mode 100644 index 0000000..2d44428 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_can.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_can.c +.\output\gd32f10x_can.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_can.h +.\output\gd32f10x_can.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.s new file mode 100644 index 0000000..62811ec Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_can.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.d new file mode 100644 index 0000000..16507c2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_crc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_crc.c +.\output\gd32f10x_crc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_crc.h +.\output\gd32f10x_crc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.s new file mode 100644 index 0000000..77622f5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_crc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.d new file mode 100644 index 0000000..d9096b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_dac.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dac.c +.\output\gd32f10x_dac.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dac.h +.\output\gd32f10x_dac.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.s new file mode 100644 index 0000000..1c1f9dc Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dac.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.d new file mode 100644 index 0000000..4cccda2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_dbg.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dbg.c +.\output\gd32f10x_dbg.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dbg.h +.\output\gd32f10x_dbg.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.s new file mode 100644 index 0000000..c478922 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dbg.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.d new file mode 100644 index 0000000..7858451 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_dma.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_dma.c +.\output\gd32f10x_dma.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_dma.h +.\output\gd32f10x_dma.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.s new file mode 100644 index 0000000..175ce83 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_dma.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.d new file mode 100644 index 0000000..fc6b3ed --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_enet.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_enet.c +.\output\gd32f10x_enet.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_enet.h +.\output\gd32f10x_enet.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.s new file mode 100644 index 0000000..8131fa2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_enet.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.d new file mode 100644 index 0000000..8ecb998 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_exmc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exmc.c +.\output\gd32f10x_exmc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_exmc.h +.\output\gd32f10x_exmc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.s new file mode 100644 index 0000000..628e38d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exmc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.d new file mode 100644 index 0000000..5b67001 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_exti.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_exti.c +.\output\gd32f10x_exti.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_exti.h +.\output\gd32f10x_exti.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.s new file mode 100644 index 0000000..399c25e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_exti.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.d new file mode 100644 index 0000000..e1a4200 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_fmc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fmc.c +.\output\gd32f10x_fmc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_fmc.h +.\output\gd32f10x_fmc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.s new file mode 100644 index 0000000..88a2072 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fmc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.d new file mode 100644 index 0000000..8b0ab11 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_fwdgt.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_fwdgt.c +.\output\gd32f10x_fwdgt.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_fwdgt.h +.\output\gd32f10x_fwdgt.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.s new file mode 100644 index 0000000..95a8273 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_fwdgt.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.d new file mode 100644 index 0000000..7e8613f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_gpio.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_gpio.c +.\output\gd32f10x_gpio.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_gpio.h +.\output\gd32f10x_gpio.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.s new file mode 100644 index 0000000..aa4c0ac Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_gpio.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.d new file mode 100644 index 0000000..7b39b4f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_i2c.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_i2c.c +.\output\gd32f10x_i2c.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_i2c.h +.\output\gd32f10x_i2c.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.s new file mode 100644 index 0000000..98e9f49 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_i2c.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_it.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_it.d new file mode 100644 index 0000000..702478d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_it.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_it.o: ..\gd32f10x_it.c +.\output\gd32f10x_it.o: ..\gd32f10x_it.h +.\output\gd32f10x_it.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.d new file mode 100644 index 0000000..4003ea4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_misc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_misc.c +.\output\gd32f10x_misc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_misc.h +.\output\gd32f10x_misc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.s new file mode 100644 index 0000000..15123af Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_misc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.d new file mode 100644 index 0000000..a3f5eea --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_pmu.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_pmu.c +.\output\gd32f10x_pmu.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_pmu.h +.\output\gd32f10x_pmu.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.s new file mode 100644 index 0000000..a6fb231 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_pmu.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.d new file mode 100644 index 0000000..79248ff --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_rcu.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rcu.c +.\output\gd32f10x_rcu.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_rcu.h +.\output\gd32f10x_rcu.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.s new file mode 100644 index 0000000..3841d6d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rcu.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.d new file mode 100644 index 0000000..192106b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_rtc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_rtc.c +.\output\gd32f10x_rtc.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_rtc.h +.\output\gd32f10x_rtc.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.s new file mode 100644 index 0000000..87e626c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_rtc.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.d new file mode 100644 index 0000000..ed2f438 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_sdio.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_sdio.c +.\output\gd32f10x_sdio.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_sdio.h +.\output\gd32f10x_sdio.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.s new file mode 100644 index 0000000..48b4edc Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_sdio.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.d new file mode 100644 index 0000000..79bec7f --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_spi.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_spi.c +.\output\gd32f10x_spi.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_spi.h +.\output\gd32f10x_spi.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.s new file mode 100644 index 0000000..2818ec2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_spi.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.d new file mode 100644 index 0000000..11bff3c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_timer.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_timer.c +.\output\gd32f10x_timer.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_timer.h +.\output\gd32f10x_timer.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.s new file mode 100644 index 0000000..6966eb5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_timer.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.d new file mode 100644 index 0000000..6d7564e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_usart.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_usart.c +.\output\gd32f10x_usart.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_usart.h +.\output\gd32f10x_usart.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.s new file mode 100644 index 0000000..1d47beb Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_usart.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.d new file mode 100644 index 0000000..1efb2cb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.d @@ -0,0 +1,3 @@ +.\output\gd32f10x_wwdgt.o: ..\..\Firmware\GD32F10x_standard_peripheral\Source\gd32f10x_wwdgt.c +.\output\gd32f10x_wwdgt.o: ..\..\Firmware\GD32F10x_standard_peripheral\Include\gd32f10x_wwdgt.h +.\output\gd32f10x_wwdgt.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.s b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.s new file mode 100644 index 0000000..69af8a8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/gd32f10x_wwdgt.s differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.crf new file mode 100644 index 0000000..324007e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.d new file mode 100644 index 0000000..5752f5c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.d @@ -0,0 +1,34 @@ +.\output\led.o: ..\..\Firmware\HARDWARE\LED\led.c +.\output\led.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\led.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\led.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\led.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\led.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\led.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\led.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\led.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\led.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\led.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\led.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.o new file mode 100644 index 0000000..f36190e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/led.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.crf new file mode 100644 index 0000000..ea9505c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.d new file mode 100644 index 0000000..e4c03fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.d @@ -0,0 +1,70 @@ +.\output\main.o: ..\main.c +.\output\main.o: ..\systick.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\main.o: ..\main.h +.\output\main.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\main.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\main.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\main.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\main.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\main.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\main.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\main.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\main.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\main.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\main.o: ..\..\Firmware\HARDWARE\chipID\chipid.h +.\output\main.o: ..\..\Firmware\SYSTEM\delay\delay.h +.\output\main.o: ..\..\Firmware\HARDWARE\TIMER\timer.h +.\output\main.o: ..\..\Firmware\SYSTEM\usart\usart.h +.\output\main.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\main.o: ..\..\Firmware\HARDWARE\CAN\bsp_can.h +.\output\main.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\main.o: ..\..\Firmware\HARDWARE\ADS1015\ADS1015.h +.\output\main.o: ..\..\Firmware\HARDWARE\DC300\dc300.h +.\output\main.o: ..\..\Firmware\HARDWARE\24C0X\24cxx.h +.\output\main.o: ..\..\Firmware\HARDWARE\common\common.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\main.o: ..\..\Firmware\UDS\uds_config.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\main.o: ..\..\Firmware\UDS\uds_types.h +.\output\main.o: ..\..\Firmware\UDS\bootloader.h +.\output\main.o: ..\..\Firmware\UDS\uds_config.h +.\output\main.o: ..\..\Firmware\UDS\uds_did.h +.\output\main.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\main.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\main.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\main.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\main.o: ..\..\Firmware\UDS\tp_config.h +.\output\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\main.o: ..\..\Firmware\UDS\tp_config.h +.\output\main.o: ..\..\Firmware\UDS\uds_interface.h +.\output\main.o: ..\..\Firmware\UDS\uds_manage.h +.\output\main.o: ..\..\Firmware\UDS\uds_services.h +.\output\main.o: ..\..\Firmware\UDS\uds_api.h +.\output\main.o: ..\..\Firmware\UDS\crc.h +.\output\main.o: ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.o new file mode 100644 index 0000000..eff3619 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/main.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/merge.cmd b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/merge.cmd new file mode 100644 index 0000000..343336c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/merge.cmd @@ -0,0 +1,3 @@ +set "cmdDir=%~dp0" +copy %cmdDir%boot.hex %cmdDir%DCBms.hex +type %cmdDir%LED.hex >> %cmdDir%DCBms.hex \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.crf new file mode 100644 index 0000000..3c00a92 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.d new file mode 100644 index 0000000..89816cc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.d @@ -0,0 +1,33 @@ +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\misc.c +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\misc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\misc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\misc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\misc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\misc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\misc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\misc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\misc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\misc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.o new file mode 100644 index 0000000..9fba964 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/misc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.crf new file mode 100644 index 0000000..737f2ba Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.d new file mode 100644 index 0000000..4d20604 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.d @@ -0,0 +1,36 @@ +.\output\porting.o: ..\..\Firmware\HARDWARE\CAN\porting.c +.\output\porting.o: ..\..\Firmware\HARDWARE\CAN\porting.h +.\output\porting.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\porting.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\porting.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\porting.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\porting.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\porting.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\porting.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\porting.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\porting.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\porting.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\porting.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\porting.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.o new file mode 100644 index 0000000..aba6d22 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/porting.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.d new file mode 100644 index 0000000..262f364 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.d @@ -0,0 +1 @@ +.\output\startup_stm32f10x_cl.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Source\ARM\startup_stm32f10x_cl.s diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.o new file mode 100644 index 0000000..5fb9dd3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/startup_stm32f10x_cl.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.crf new file mode 100644 index 0000000..5646cf2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.d new file mode 100644 index 0000000..5e70aa3 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_adc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_adc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_adc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_adc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_adc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.o new file mode 100644 index 0000000..241ed1e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_adc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.crf new file mode 100644 index 0000000..59ba9b8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.d new file mode 100644 index 0000000..92225fb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_bkp.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_bkp.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.o new file mode 100644 index 0000000..f60f118 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_bkp.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.crf new file mode 100644 index 0000000..949959d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.d new file mode 100644 index 0000000..f501ddf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_can.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_can.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_can.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_can.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_can.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.o new file mode 100644 index 0000000..4abb60b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_can.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.crf new file mode 100644 index 0000000..1805252 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.d new file mode 100644 index 0000000..a3192cb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_cec.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_cec.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_cec.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_cec.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_cec.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.o new file mode 100644 index 0000000..8d9598f Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_cec.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.crf new file mode 100644 index 0000000..2324b1c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.d new file mode 100644 index 0000000..ce2fabf --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_crc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_crc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_crc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_crc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_crc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.o new file mode 100644 index 0000000..479c62c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_crc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.crf new file mode 100644 index 0000000..089e9e5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.d new file mode 100644 index 0000000..f58a8cd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dac.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_dac.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_dac.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_dac.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_dac.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.o new file mode 100644 index 0000000..4c4f61b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dac.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.crf new file mode 100644 index 0000000..18b0e0d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.d new file mode 100644 index 0000000..31fb600 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_dbgmcu.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_dbgmcu.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.o new file mode 100644 index 0000000..02efefe Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dbgmcu.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.crf new file mode 100644 index 0000000..3cf4d7c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.d new file mode 100644 index 0000000..44ab76d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dma.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_dma.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_dma.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_dma.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_dma.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.o new file mode 100644 index 0000000..880ecdd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_dma.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.crf new file mode 100644 index 0000000..6633493 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.d new file mode 100644 index 0000000..413f983 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_exti.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_exti.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_exti.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_exti.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_exti.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.o new file mode 100644 index 0000000..5c5a6e1 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_exti.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.crf new file mode 100644 index 0000000..9d7848c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.d new file mode 100644 index 0000000..6abc4c4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_flash.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_flash.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_flash.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_flash.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_flash.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.o new file mode 100644 index 0000000..c8c098c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_flash.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.crf new file mode 100644 index 0000000..00862e3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.d new file mode 100644 index 0000000..ba64929 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_fsmc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_fsmc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.o new file mode 100644 index 0000000..a0aca3a Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_fsmc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.crf new file mode 100644 index 0000000..5c9c82a Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.d new file mode 100644 index 0000000..7f1121d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_gpio.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_gpio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.o new file mode 100644 index 0000000..8b6ab43 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_gpio.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.crf new file mode 100644 index 0000000..7ef326e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.d new file mode 100644 index 0000000..4bcbd3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_i2c.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_i2c.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.o new file mode 100644 index 0000000..b491475 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_i2c.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.crf new file mode 100644 index 0000000..716e0b3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.d new file mode 100644 index 0000000..e3eaf17 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\stm32f10x_it.c +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\stm32f10x_it.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_it.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_it.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_it.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_it.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_it.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.o new file mode 100644 index 0000000..618c460 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_it.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.crf new file mode 100644 index 0000000..5cba7c5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.d new file mode 100644 index 0000000..a3301b2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_iwdg.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_iwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.o new file mode 100644 index 0000000..2470a89 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_iwdg.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.crf new file mode 100644 index 0000000..680e9a5 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.d new file mode 100644 index 0000000..6fd8eda --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_pwr.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_pwr.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.o new file mode 100644 index 0000000..3a92b76 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_pwr.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.crf new file mode 100644 index 0000000..285f190 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.d new file mode 100644 index 0000000..97dff32 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_rcc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_rcc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.o new file mode 100644 index 0000000..6b6129b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rcc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.crf new file mode 100644 index 0000000..4c20220 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.d new file mode 100644 index 0000000..b090315 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_rtc.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_rtc.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.o new file mode 100644 index 0000000..db16167 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_rtc.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.crf new file mode 100644 index 0000000..7effdce Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.d new file mode 100644 index 0000000..0fa5837 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_sdio.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_sdio.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.o new file mode 100644 index 0000000..db8b6a3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_sdio.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.crf new file mode 100644 index 0000000..1cb1362 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.d new file mode 100644 index 0000000..ab8642c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_spi.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_spi.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_spi.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_spi.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_spi.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.o new file mode 100644 index 0000000..9473244 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_spi.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.crf new file mode 100644 index 0000000..9049715 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.d new file mode 100644 index 0000000..be27a3b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_tim.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_tim.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_tim.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_tim.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_tim.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.o new file mode 100644 index 0000000..500ab10 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_tim.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.crf new file mode 100644 index 0000000..7e4e2d8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.d new file mode 100644 index 0000000..a5c33df --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_usart.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_usart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_usart.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_usart.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.o new file mode 100644 index 0000000..7847f4b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_usart.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.crf new file mode 100644 index 0000000..1975ef2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.d new file mode 100644 index 0000000..fbeb14a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.d @@ -0,0 +1,33 @@ +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\stm32f10x_wwdg.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\stm32f10x_wwdg.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.o new file mode 100644 index 0000000..3ba4f9b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/stm32f10x_wwdg.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.crf new file mode 100644 index 0000000..d223ab4 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.d new file mode 100644 index 0000000..ef41b5e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.d @@ -0,0 +1,39 @@ +.\output\sys.o: ..\..\Firmware\SYSTEM\sys\sys.c +.\output\sys.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\sys.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\sys.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\sys.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\sys.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\sys.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\sys.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\sys.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\sys.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\sys.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\sys.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\sys.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\sys.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\sys.o: ..\main.h +.\output\sys.o: ..\systick.h +.\output\sys.o: ..\..\Firmware\HARDWARE\DC300\dc300.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.o new file mode 100644 index 0000000..7bfd5b2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/sys.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.crf new file mode 100644 index 0000000..5f1d1e8 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.d new file mode 100644 index 0000000..2cd0699 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.d @@ -0,0 +1,32 @@ +.\output\system_stm32f10x.o: ..\..\Firmware\STM32_file\system_stm32f10x.c +.\output\system_stm32f10x.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\system_stm32f10x.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\system_stm32f10x.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\system_stm32f10x.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\system_stm32f10x.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\system_stm32f10x.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.o new file mode 100644 index 0000000..e498e88 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/system_stm32f10x.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/systick.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/systick.d new file mode 100644 index 0000000..c2ce49d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/systick.d @@ -0,0 +1,2 @@ +.\output\systick.o: ..\systick.c +.\output\systick.o: ..\..\Firmware\CMSIS\GD\GD32F10x\Include\gd32f10x.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.crf new file mode 100644 index 0000000..64466a9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.d new file mode 100644 index 0000000..3f0f9b6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.d @@ -0,0 +1,35 @@ +.\output\timer.o: ..\..\Firmware\HARDWARE\TIMER\timer.c +.\output\timer.o: ..\..\Firmware\HARDWARE\TIMER\timer.h +.\output\timer.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\timer.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\timer.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\timer.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\timer.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\timer.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\timer.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\timer.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\timer.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\timer.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\timer.o: ..\..\Firmware\HARDWARE\LED\led.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.o new file mode 100644 index 0000000..f1cd594 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/timer.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.crf new file mode 100644 index 0000000..fc47448 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.d new file mode 100644 index 0000000..587ed7c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.d @@ -0,0 +1,55 @@ +.\output\tp_cca.o: ..\..\Firmware\UDS\tp_cca.c +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_config.h +.\output\tp_cca.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\tp_cca.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\tp_cca.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\tp_cca.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\tp_cca.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\tp_cca.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\tp_cca.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\tp_cca.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\tp_cca.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_types.h +.\output\tp_cca.o: ..\..\Firmware\UDS\bootloader.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_config.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_did.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\tp_cca.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\tp_cca.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\tp_cca.o: ..\..\Firmware\UDS\tp_config.h +.\output\tp_cca.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\tp_cca.o: ..\..\Firmware\UDS\tp_config.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_interface.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_manage.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_services.h +.\output\tp_cca.o: ..\..\Firmware\UDS\uds_api.h +.\output\tp_cca.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.o new file mode 100644 index 0000000..07e238c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/tp_cca.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.crf new file mode 100644 index 0000000..7677784 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.d new file mode 100644 index 0000000..9287201 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.d @@ -0,0 +1,60 @@ +.\output\uds_api.o: ..\..\Firmware\UDS\uds_api.c +.\output\uds_api.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_api.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_api.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_api.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_api.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_api.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_api.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_api.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_api.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_api.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_api.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_api.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_api.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_api.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_api.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_api.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_api.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_api.o: ..\..\Firmware\UDS\crc.h +.\output\uds_api.o: ..\..\Firmware\HARDWARE\24C0X\24cxx.h +.\output\uds_api.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\uds_api.o: ..\..\Firmware\HARDWARE\DC300\dc300.h +.\output\uds_api.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\uds_api.o: ..\..\Firmware\HARDWARE\LOWPOWER\app_pwr_manage.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.o new file mode 100644 index 0000000..af3b023 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_api.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.crf new file mode 100644 index 0000000..dce7be6 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.d new file mode 100644 index 0000000..5d71696 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.d @@ -0,0 +1,56 @@ +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_can_interface.c +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_can_interface.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_can_interface.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_can_interface.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_can_interface.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_can_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_can_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_can_interface.o: ..\..\Firmware\UDS\crc.h +.\output\uds_can_interface.o: ..\..\Firmware\HARDWARE\CAN\bsp_can.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.o new file mode 100644 index 0000000..d999d8d Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_can_interface.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.crf new file mode 100644 index 0000000..9b1bf67 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.d new file mode 100644 index 0000000..f909bda --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.d @@ -0,0 +1,56 @@ +.\output\uds_did.o: ..\..\Firmware\UDS\uds_did.c +.\output\uds_did.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_did.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_did.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_did.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_did.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_did.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_did.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_did.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_did.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_did.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_did.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_did.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_did.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_did.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_did.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_did.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_did.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_did.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.o new file mode 100644 index 0000000..7697893 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_did.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.crf new file mode 100644 index 0000000..905ca30 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.d new file mode 100644 index 0000000..f332ca9 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.d @@ -0,0 +1,55 @@ +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_interface.c +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_interface.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_interface.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_interface.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_interface.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_interface.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_interface.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_interface.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_interface.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_interface.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_interface.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_interface.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_interface.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_interface.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_interface.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_interface.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_interface.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_interface.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.o new file mode 100644 index 0000000..05839f9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_interface.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.crf new file mode 100644 index 0000000..78907e9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.d new file mode 100644 index 0000000..8b047c8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.d @@ -0,0 +1,55 @@ +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_manage.c +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_manage.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_manage.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_manage.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_manage.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_manage.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_manage.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_manage.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_manage.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_manage.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_manage.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_manage.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_manage.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_manage.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_manage.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_manage.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_manage.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_manage.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.o new file mode 100644 index 0000000..694b3d7 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_manage.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.crf new file mode 100644 index 0000000..291c9cc Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.d new file mode 100644 index 0000000..d82b2c5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.d @@ -0,0 +1,57 @@ +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_nvm.c +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_nvm.h +.\output\uds_nvm.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_nvm.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_nvm.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_nvm.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_nvm.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_nvm.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_nvm.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_nvm.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_nvm.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.o new file mode 100644 index 0000000..599234c Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_nvm.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.crf new file mode 100644 index 0000000..67e06e2 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.d new file mode 100644 index 0000000..bc7f736 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.d @@ -0,0 +1,55 @@ +.\output\uds_services.o: ..\..\Firmware\UDS\uds_services.c +.\output\uds_services.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_services.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\uds_services.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_services.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\uds_services.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\uds_services.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\uds_services.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\uds_services.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\uds_services.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\uds_services.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_types.h +.\output\uds_services.o: ..\..\Firmware\UDS\bootloader.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_config.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_did.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_dtc.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_can_interface.h +.\output\uds_services.o: ..\..\Firmware\UDS\diagnosis_mid.h +.\output\uds_services.o: ..\..\Firmware\UDS\tp_15765_2.h +.\output\uds_services.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_services.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h +.\output\uds_services.o: ..\..\Firmware\UDS\tp_config.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_interface.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_manage.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_services.h +.\output\uds_services.o: ..\..\Firmware\UDS\uds_api.h +.\output\uds_services.o: ..\..\Firmware\UDS\crc.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.o new file mode 100644 index 0000000..c5402e0 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/uds_services.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.crf b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.crf new file mode 100644 index 0000000..6bd1d65 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.crf differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.d b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.d new file mode 100644 index 0000000..319a7dd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.d @@ -0,0 +1,40 @@ +.\output\usart.o: ..\..\Firmware\SYSTEM\usart\usart.c +.\output\usart.o: ..\..\Firmware\SYSTEM\sys\sys.h +.\output\usart.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\usart.o: ..\..\Firmware\CMSIS\core_cm3.h +.\output\usart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h +.\output\usart.o: ..\..\Firmware\CMSIS\core_cmInstr.h +.\output\usart.o: ..\..\Firmware\CMSIS\core_cmFunc.h +.\output\usart.o: ..\..\Firmware\STM32_file\system_stm32f10x.h +.\output\usart.o: ..\..\Firmware\STM32_file\stm32f10x_conf.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_adc.h +.\output\usart.o: ..\..\Firmware\STM32_file\stm32f10x.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_bkp.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_can.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_cec.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_crc.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dac.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dbgmcu.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_dma.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_exti.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_flash.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_fsmc.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_gpio.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_i2c.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_iwdg.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_pwr.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rcc.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_rtc.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_sdio.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_spi.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_tim.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_usart.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\stm32f10x_wwdg.h +.\output\usart.o: ..\..\Firmware\STM32F10x_StdPeriph_Driver\inc\misc.h +.\output\usart.o: ..\..\Firmware\SYSTEM\usart\usart.h +.\output\usart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h +.\output\usart.o: ..\..\Firmware\HARDWARE\LED\led.h +.\output\usart.o: ..\..\Firmware\HARDWARE\CAN\can.h +.\output\usart.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h +.\output\usart.o: ..\..\Firmware\HARDWARE\ADC\adc.h +.\output\usart.o: ..\..\Firmware\HARDWARE\DC300\dc300.h diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.o b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.o new file mode 100644 index 0000000..6a19d3e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/Keil5_project/output/usart.o differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.c new file mode 100644 index 0000000..89c1152 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.h new file mode 100644 index 0000000..6eaa66a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_it.h @@ -0,0 +1,60 @@ +/*! + \file gd32f10x_it.h + \brief the header file of the ISR + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_IT_H +#define GD32F10X_IT_H + +#include "gd32f10x.h" + +/* function declarations */ +/* this function handles NMI exception */ +void NMI_Handler(void); +/* this function handles HardFault exception */ +void HardFault_Handler(void); +/* this function handles MemManage exception */ +void MemManage_Handler(void); +/* this function handles BusFault exception */ +void BusFault_Handler(void); +/* this function handles UsageFault exception */ +void UsageFault_Handler(void); +/* this function handles SVC exception */ +void SVC_Handler(void); +/* this function handles DebugMon exception */ +void DebugMon_Handler(void); +/* this function handles PendSV exception */ +void PendSV_Handler(void); +/* this function handles SysTick exception */ +void SysTick_Handler(void); + +#endif /* GD32F10X_IT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_libopt.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_libopt.h new file mode 100644 index 0000000..1ad9dee --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/gd32f10x_libopt.h @@ -0,0 +1,62 @@ +/*! + \file gd32f10x_libopt.h + \brief library optional for gd32f10x + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LIBOPT_H +#define GD32F10X_LIBOPT_H + +#include "gd32f10x_fmc.h" +#include "gd32f10x_pmu.h" +#include "gd32f10x_bkp.h" +#include "gd32f10x_rcu.h" +#include "gd32f10x_exti.h" +#include "gd32f10x_gpio.h" +#include "gd32f10x_crc.h" +#include "gd32f10x_dma.h" +#include "gd32f10x_dbg.h" +#include "gd32f10x_adc.h" +#include "gd32f10x_dac.h" +#include "gd32f10x_fwdgt.h" +#include "gd32f10x_wwdgt.h" +#include "gd32f10x_rtc.h" +#include "gd32f10x_timer.h" +#include "gd32f10x_usart.h" +#include "gd32f10x_i2c.h" +#include "gd32f10x_spi.h" +#include "gd32f10x_sdio.h" +#include "gd32f10x_exmc.h" +#include "gd32f10x_can.h" +#include "gd32f10x_enet.h" +#include "gd32f10x_misc.h" + +#endif /* GD32F10X_LIBOPT_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.c new file mode 100644 index 0000000..896ad6e Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.h new file mode 100644 index 0000000..1cd967b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of main + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H + +/* led spark function */ +void led_spark(void); + +#endif /* MAIN_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/output/App.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/output/App.bin new file mode 100644 index 0000000..46a2cf9 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/output/App.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/readme.txt new file mode 100644 index 0000000..14c9536 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/readme.txt @@ -0,0 +1,36 @@ +/*! + \file readme.txt + \brief description of led spark with systick, USART print and key example + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + This example is based on the GD32107C-EVAL-V1.3 board, it provides a +description of SysTick configuration, use of EVAL_COM and key. \ No newline at end of file diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.c new file mode 100644 index 0000000..f9d7ba3 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.c differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.h new file mode 100644 index 0000000..2d355fc --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Template/systick.h @@ -0,0 +1,47 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay decrement */ +void delay_decrement(void); + +#endif /* SYSTICK_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LCD.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LCD.bin new file mode 100644 index 0000000..48b3dfd Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LCD.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LED.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LED.bin new file mode 100644 index 0000000..06d7cec Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/bin/LED.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LCD.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LCD.hex new file mode 100644 index 0000000..84afe15 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LCD.hex @@ -0,0 +1,5260 @@ +:020000040800F2 +:10800000680400200181000899850008C1840008E7 +:1080100095850008EB810008C98C0008000000006D +:10802000000000000000000000000000338800088D +:10803000EF81000800000000E58500086D89000858 +:108040001B8100081B8100081B8100081B810008A0 +:108050001B8100081B8100081B8100081B81000890 +:108060001B8100081B8100081B8100081B81000880 +:108070001B8100081B8100081B8100081B81000870 +:108080001B8100081B8100081B8100081B81000860 +:108090001B8100081B8100081B8100081B81000850 +:1080A0001B8100081B8100081B8100081B81000840 +:1080B0001B8100081B8100081B8100081B81000830 +:1080C0001B8100081B8100081B8100081B81000820 +:1080D0001B8100081B8100081B8100081B81000810 +:1080E0001B8100081B8100081B810008DFF80CD0F1 +:1080F00000F04AF80048004749930008680400204F +:108100000648804706480047FEE7FEE7FEE7FEE731 +:10811000FEE7FEE7FEE7FEE7FEE7FEE775890008FB +:10812000ED8000082DE9F05F0546002092469B4651 +:1081300088460646814640241BE02846414647467D +:10814000224600F042F853465A46C01A914110D3D5 +:1081500011461846224600F029F82D1A67EB01084F +:108160004F4622460120002100F020F817EB0009BD +:108170004E41201EA4F10104DFDC484631462A4668 +:108180004346BDE8F09F0000064C074D06E0E0685E +:1081900040F0010394E8070098471034AC42F6D34E +:1081A000FFF7A8FFFCC701081CC80108202A04DB50 +:1081B000203A00FA02F1002070479140C2F12003FA +:1081C00020FA03F3194390407047202A04DB203A39 +:1081D00021FA02F00021704721FA02F3D040C2F1E7 +:1081E0002002914008431946704700BFFEE77047E0 +:1081F0000349086000BF024909680029FBD17047A4 +:108200004C00002000B597B00220019000200290A1 +:108210000520039000200490059006900790089098 +:1082200009900A9010200B9000200C900D900E9059 +:108230000F9010904FF480501190002012901390E6 +:10824000149001A81590169008A800F021F80121BB +:10825000002000F003F817B000BD000051B14FF04E +:10826000204252F8202042F001024FF0204343F810 +:10827000202009E04FF0204252F82020034B1A4002 +:108280004FF0204343F8202070470000FEFF0F000E +:10829000D0E901121143C2681143026911434269D6 +:1082A000114382691143C2691143026A1143426A50 +:1082B0001143826A1143C26A1143026B11434FF0AA +:1082C0002043026843F822108168082908D11A4621 +:1082D000016852F8211041F04001026843F8221071 +:1082E000416B0968426B526841EA0211426B926825 +:1082F00041EA0221426B928941EA0241426B128AB1 +:1083000041EA0251426B127D41EA0261426B92697D +:1083100011430268521C4FF0204343F82210C16AF7 +:10832000B1F5804F1AD1816B0968826B526841EABE +:108330000211826B926841EA0221826B128A41EA41 +:108340000251826B127D41EA0261826B9269114394 +:10835000026803EB8202C2F8041108E06FF070417A +:108360004FF02043026803EB8202C2F80411704709 +:108370002DE9F041024600250026002000230024BC +:10838000002791F803C00CF00F0591F803C01CF012 +:10839000100F03D091F802C04CEA050591F800C017 +:1083A000BCF1000F31D0146800202BE04FF0010C1D +:1083B0000CFA00F3B1F800C00CEA03069E4220D18B +:1083C00083004FF00F0C0CFA03F7BC4305FA03FCD3 +:1083D0004CEA040491F803C0BCF1280F06D14FF019 +:1083E000010C0CFA00FCC2F814C00AE091F803C0BA +:1083F000BCF1480F05D14FF0010C0CFA00FCC2F89B +:1084000010C0401C0828D1D31460B1F800C0BCF1E2 +:10841000FF0F34DD546800202EE000F1080C4FF00F +:10842000010808FA0CF3B1F800C00CEA03069E42FA +:1084300021D183004FF00F0C0CFA03F7BC4305FA6F +:1084400003FC4CEA040491F803C0BCF1280F05D1E9 +:1084500000F1080C08FA0CF8C2F8148091F803C077 +:10846000BCF1480F07D100F1080C4FF0010808FAE1 +:108470000CF8C2F81080401C0828CED35460BDE828 +:10848000F0810246002093680B4201D0012000E0F9 +:1084900000207047416170470161704706480068DD +:1084A000064908600448001D00684860024808301A +:1084B0000068886070470000E8F7FF1F5800002040 +:1084C00000BFFEE708B54CF23370ADF800000320A2 +:1084D0008DF8020018208DF8030069460C48FFF75C +:1084E00047FF4FF68070ADF8000069460948FFF776 +:1084F0003FFF8020ADF8000069460548FFF738FFD0 +:108500000420ADF8000069460248FFF731FF08BDBE +:10851000001401400018014001464FF0C24210888B +:1085200070474FF0C2410880704722204FF0C04191 +:10853000088070474FF0C04210804FF0C242118057 +:108540007047000008B50520ADF8000003208DF845 +:10855000020010208DF8030069460C48FFF708FF61 +:108560000320ADF800008DF8020010208DF8030004 +:1085700069460748FFF7FCFE05210448FFF78AFF1C +:1085800003210348FFF786FF08BD000000100140EB +:108590000018014000BFFEE7704710B54FF40041DE +:1085A000080300F015F810BD10B5002807DA0A0717 +:1085B000140E054A00F00F031B1FD45403E00A07F2 +:1085C000130E024A135410BD18ED00E000E400E061 +:1085D000024A0A400243024B1A60704780FFFF1FA5 +:1085E00008ED00E07047000029B1064A52690243D5 +:1085F000044B5A6104E0034A52698243014B5A61B9 +:10860000704700000010024029B1064A92690243F7 +:10861000044B9A6104E0034A92698243014B9A61D8 +:10862000704700000010024010B501210420FFF740 +:10863000EBFF01210820FFF7E7FF01211020FFF7E2 +:10864000E3FF01212020FFF7DFFF01214020FFF79A +:10865000DBFF01210846FFF7D7FF01218803FFF761 +:10866000D3FF01210802FFF7BFFF10BD30B5002185 +:108670000022002400232D4D6D6805F00C0121B16E +:10868000042905D0082923D105E0294D056022E001 +:10869000274D05601FE0254D6D6805F47012234DD0 +:1086A0006D6805F48034022505EB92421CB9214D1A +:1086B000554305600BE01D4D6D6815F4003F03D078 +:1086C0001C4D5543056002E0194D5543056002E01D +:1086D000174D056000BF00BF144D6D6805F0F00137 +:1086E0000909154D6B5C0568DD4045600F4D6D68EF +:1086F00005F4E061090A104D6B5C4568DD4085605A +:108700000A4D6D6805F46051C90A0B4D6B5C4568F4 +:10871000DD40C560054D6D6805F44041890B074D8E +:108720006B5CC568B5FBF3F5056130BD0010024018 +:1087300000127A0000093D002400002034000020CF +:1087400008B5A020ADF8000003208DF8020010202D +:108750008DF8030069461448FFF70AFE4020ADF883 +:10876000000004208DF8030069460F48FFF700FE63 +:108770001020ADF8000003208DF8020010208DF8C5 +:10878000030069460948FFF7F3FD08210748FFF792 +:1087900083FE4FF480510648FFF77EFE1021034808 +:1087A000FFF77AFE08BD00000008014000180140F4 +:1087B0000010014010B5044624B120210448FFF701 +:1087C0006BFE03E020210248FFF764FE10BD0000AD +:1087D0000008014010B5044624B110210448FFF7F9 +:1087E0005BFE03E010210248FFF754FE10BD0000BD +:1087F0000018014010B5044624B180210448FFF759 +:108800004BFE03E080210248FFF744FE10BD00004C +:108810000008014010B540210148FFF732FE10BDAD +:1088200000080140002101E04A1C91B28142FBDBBB +:108830007047704710B500F001F810BD0CB500206E +:10884000019000903348006840F48030314908605E +:1088500000BF3048006800F4003000900198401CD0 +:108860000190009820B90198A0F57F41FF39F0D11F +:108870002848006810F4003F02D00120009001E079 +:10888000002000900098012842D12348006840F061 +:108890001000214908600846006820F003000860C5 +:1088A0000846006840F0020008601A48406819490C +:1088B00048600846406848600846406840F4806068 +:1088C00048600846406820F47C10486008464068CC +:1088D00040F4E81048600846006840F08070086086 +:1088E00000BF0C48006810F0007FFAD009484068CB +:1088F00020F00300074948600846406840F0020045 +:10890000486000BF0348406800F00C000828F9D117 +:108910000CBD0000001002400020024010B51248BB +:10892000006842F21071B0FBF1F4B4F1807F01D322 +:10893000012011E024F07F40401E4FF0E02148610B +:108940000F214FF0FF30FFF72FFE00204FF0E02106 +:10895000886107200861002008B100BFFEE7002100 +:10896000481EFFF721FE10BD3800002010B500F0B2 +:1089700031F810BD10B51348006840F001001149EE +:10898000086008464068104908400E49486008469B +:1089900000680E4908400B4908600846006820F44A +:1089A000802008600846406820F4FE0048604FF4CC +:1089B0001F008860FFF73EFF4FF000600449086029 +:1089C00010BD0000001002400000FFF8FFFFF6FE9F +:1089D00008ED00E00448006820B103480068401E2C +:1089E00001490860704700004C00002010B500F0FD +:1089F00045F808B1002010BD00F073F8002000F029 +:108A000081F8D22000F07EF800F052F8F3E710B5BC +:108A100000F034F808B1002010BD00F062F800202A +:108A200000F070F8922000F06DF800F041F8F3E7E4 +:108A300070B50024002509E0FFF7D8FF204484B278 +:108A40004FF47A70FFF7EEFE681CC5B2082DF3DB19 +:108A5000E410204670BD70B50024002509E0FFF742 +:108A6000D6FF204484B24FF47A70FFF7DBFE681C17 +:108A7000C5B2082DF3DBE410204670BD10B52021EF +:108A80000148FFF7FEFC10BD0018014008B520208A +:108A9000ADF8000003208DF8020004208DF80300DB +:108AA00069460248FFF764FC08BD00000018014059 +:108AB00070B50024002510E04FF6FF7000EA440472 +:108AC0000120FFF777FE0020FFF774FEFFF7A2FEFC +:108AD00008B1601C84B2681CC5B20C2DECDB2046CA +:108AE00070BD10B50020FFF765FE0120FFF772FE94 +:108AF0000120FFF77FFE0120FFF75CFE0020FFF75B +:108B000069FE10BD70B506460020FFF753FE002435 +:108B100013E0C4F1070046FA00F000F00105284612 +:108B2000FFF768FE0020FFF745FE0120FFF742FE39 +:108B30000020FFF73FFE601CC4B2082CE9DB70BDCB +:108B40001FB54FF4E13000900020ADF80400ADF8FF +:108B50000600ADF80800ADF80C000C20ADF80A00D6 +:108B60006946044800F040F80121024800F022F86C +:108B70001FBD00000038014008B54FF40070ADF88B +:108B8000000003208DF8020018208DF803006946CC +:108B90000748FFF7EDFB4FF48060ADF800000420BC +:108BA0008DF8030069460248FFF7E2FB08BD0000AC +:108BB0000008014021B1828942F40052828104E020 +:108BC00082894DF6FF731A40828170470246002069 +:108BD000B1F5007F00D100BF13880B4201D0012006 +:108BE00000E00020704700002DE9F04786B0054600 +:108BF0000E460024A24600BFA1460027B08900B15E +:108C000000BF2F462C8A4CF6FF700440F0880443C6 +:108C10002C82AC894EF6F3100440B08831890843A9 +:108C2000718908430443AC81AC8A4FF6FF4004408D +:108C3000B0890443AC8201A8FFF718FD1F488742A2 +:108C400002D1DDF810A001E0DDF80CA0A88910F435 +:108C5000004F08D00AEBCA0000EB0A103168490047 +:108C6000B0FBF1F807E00AEBCA0000EB0A1031682C +:108C70008900B0FBF1F86420B8FBF0F00401200992 +:108C8000642101FB1089A88910F4004F08D032201C +:108C900000EBC900B0FBF1F000F00700044308E06E +:108CA000322000EB09106421B0FBF1F000F00F005E +:108CB00004432C8106B0BDE8F08700000038014075 +:108CC000C1F308028280704700BFFEE7034600BF81 +:108CD000A3F5967202EB0210C0EB022240F6DE50C2 +:108CE000B2FBF0F081B2002901DDF02901DD0020A6 +:108CF00070470846FCE7034600BFA3F1DC02C2EB65 +:108D0000821000EB022240F62E60B2FBF0F081B23E +:108D1000002902DDB1F5A07F01DD00207047084683 +:108D2000FCE700000FB4054B10B503A9044A0298F4 +:108D300000F018F810BC5DF814FB00002590000846 +:108D40005400002002E008C8121F08C1002AFAD10E +:108D500070477047002001E001C1121F002AFBD1BB +:108D6000704700002DE9FF4F8DB09B460F4604462B +:108D7000002638E1252801D00F9959E00025641C10 +:108D80009D49A84601222378203B02FA03F00842BD +:108D900002D00543641CF6E720782E2817D114F87A +:108DA000010F45F004052A280ED06FF02F0220781D +:108DB000A0F1300109290AD808EB880102EB410132 +:108DC00000EB0108641CF2E757F8048B641C207860 +:108DD0006C280DD004DC4C2812D06A2811D104E094 +:108DE00074280DD07A280CD10AE045F4001507E06C +:108DF000617845F48015814202D1641C05F5801527 +:108E0000641C2278692A46D008DC002A70D0582ACF +:108E100069D0632A11D0642A08D13CE0702A69D055 +:108E2000732A14D0752A5CD0782A5CD00F9910462A +:108E30005A46904706F10106D4E017F8040B8DF866 +:108E4000000000208DF80100E946012003E057F8FA +:108E5000049B4FF0FF3069074FF0000501D40AE092 +:108E60006D1C45450DDA8542FADB19F8051000291D +:108E7000F6D106E06D1C8542FCDB19F805100029CF +:108E8000F8D12E4404E019F8010B5A460F99904787 +:108E90006D1EF8D2A6E00A200021CDE90801C5F335 +:108EA000025002280BD001CFC11700290EDA4FF073 +:108EB000000CD0EB0C006CEB01012D2309E007F155 +:108EC000070727F00707F7E80201EEE72B0504D5AF +:108ED0002B238DF82830012330E0EB072ED0202300 +:108EE000F7E70A2000E010200021CDE9080109E0A1 +:108EF0007DE0FFE71020002145F00405CDE90801E1 +:108F00004FF00808C5F3025002281BD001CF002102 +:108F10004FF0000A2B0712D5702A19D0DDE908C3DB +:108F20008CF0100C5CEA030C09D150EA010306D066 +:108F300030238DF828308DF8292002239A46582AAC +:108F400010D00AE0FF1D27F00707F7E80201DFE76E +:108F500040228DF828204FF0010A28A20DF12009A7 +:108F60000B9209E02AA2F9E7DDE90823FFF7DAF816 +:108F70000B9B9B5C09F8013D50EA0102F4D1ADEB7B +:108F8000090000F120000890680701D44FF00108A3 +:108F90000899884502DDA8EB010000E0002080462A +:108FA000002506E00AA85A46405D0F999047761CB6 +:108FB0006D1C5545F6DB04E030205A460F9990476A +:108FC000761CB8F10001A8F10108F5DC05E019F8FC +:108FD000010B5A460F999047761C0899481E089035 +:108FE0000029F4DC641C207800287FF4C3AE11B0A3 +:108FF0003046BDE8F08F00000928010030313233DF +:1090000034353637383961626364656600000000C4 +:1090100030313233343536373839414243444546AE +:109020000000000070B504460D46E1B20548FFF7A8 +:1090300047FE00BF80210348FFF7C8FD0028F9D094 +:10904000204670BD0038014030B50446002500219F +:10905000084600F057F9FFF768FA00BF03E04FF049 +:10906000C24004806D1CB5F5963FF8D330BD2DE9A4 +:10907000F84F04460E4617469946DDF828B02546B7 +:10908000B046381B401CA9EB0601491C4843009020 +:109090004FF0000A10E03BF8022B4146284600F052 +:1090A0003DF9681C85B2BD4204DD08F101001FFADC +:1090B00080F825460AF1010A00988245EBD3BDE805 +:1090C000F88F00B501210020FFF734FA4AF6A40119 +:1090D0000320FFF72FFA00210C20FFF72BFA40F6B0 +:1090E0000C010D20FFF726FA4FF42C510E20FFF74C +:1090F00021FAB0211E20FFF71DFA42F63F31012070 +:10910000FFF718FA4FF4C0610220FFF713FA0021AD +:109110001020FFF70FFA46F270011120FFF70AFA4C +:1091200000210520FFF706FA00210620FFF702FACA +:109130004EF61C711620FFF7FDF903211720FFF7EB +:10914000F9F940F233210720FFF7F4F900210B2051 +:10915000FFF7F0F900210F20FFF7ECF90021412083 +:10916000FFF7E8F900214220FFF7E4F90021482049 +:10917000FFF7E0F940F23F114920FFF7DBF900214A +:109180004A20FFF7D7F900214B20FFF7D3F94FF41E +:109190006F414420FFF7CEF900214520FFF7CAF9BF +:1091A00040F23F114620FFF7C5F940F20771302029 +:1091B000FFF7C0F94FF401713120FFF7BBF94FF40D +:1091C00001713220FFF7B6F940F202513320FFF768 +:1091D000B1F940F207513420FFF7ACF94FF40171B7 +:1091E0003520FFF7A7F94FF401713620FFF7A2F9F8 +:1091F00040F202513720FFF79DF940F202313A2048 +:10920000FFF798F940F202313B20FFF793F9002174 +:109210002320FFF78FF900212420FFF78BF94FF46B +:1092200000412520FFF786F900214E20FFF782F943 +:1092300000214F20FFF77EF94CF2503301E0581E19 +:1092400083B2002BFBDC00BD2DE9F04F06460F4634 +:1092500090469946DDF824A000240025A346BAF1E3 +:10926000010F21D100BF1CE0A8F1200004EB001089 +:10927000234911F800B000250FE0C5F107004BFAB3 +:1092800000F010F0010F06D03A1991B2721990B2A5 +:109290004A4600F043F8681C85B2082DEDDB601CDF +:1092A00084B2102CE0DB28E0002424E0A8F12000A8 +:1092B00004EB0010124911F800B0002517E0C5F1C9 +:1092C00007004BFA00F010F0010F07D03A1991B2E5 +:1092D000721990B24A4600F021F806E03A1991B2AC +:1092E000721990B2524600F019F8681C85B2082D28 +:1092F000E5DB601C84B2102CD8DBBDE8F08F0000E9 +:10930000E496000810B503460C4619464E20FFF7B8 +:1093100011F921464F20FFF70DF910BD70B5064633 +:109320000C461546F02E02DCB4F5A07F00DD70BDC2 +:1093300021463046FFF7E6FFFFF7F7F82846FFF72C +:10934000F0F800BFF3E7000008B5FFF76DF9FFF78D +:1093500024F9FFF7E3FAFFF7F5F8FFF70DFCFFF745 +:10936000EFFB5048FFF7DEFC4FA0FFF7DBFC59A1F5 +:109370005BA0FFF7D7FC66A0FFF7D4FC74A0FFF753 +:10938000D1FC00230522032172A0FFF7CBFC7F480C +:1093900001687FA0FFF7C6FC8748018887A0FFF718 +:1093A000C1FCFFF77BF88D480368426881688CA098 +:1093B000FFF7B8FC98A0FFF7B5FCFEF723FFFFF717 +:1093C00081F8FFF7BDF9FFF761FB4FF4FA70FEF784 +:1093D0000FFF0020FFF7A0F8994908804FF4FA70BA +:1093E000FEF706FF0020FFF797F89549088008462A +:1093F000018894A0FFF796FCFFF763FE1F20FFF79C +:1094000023FE9B489523EF22002100900846FFF79A +:109410002EFE98489849086000209849088019E075 +:109420001F209549009009680A7893490968491CEA +:10943000914C216091490988C900323188B24FF4BA +:1094400078434FF49671FFF7FFFE8C480088401C6C +:109450008A490880894800881228E1D320E0FFF774 +:109460000DFBE8B9FFF7E4FA85490880FFF7F3FA46 +:109470008449088082480088FFF728FC82490880D8 +:1094800080480088FFF737FCC0F5A0707F4908804E +:109490004FF47842084601887B480088FFF73EFF7A +:1094A000DDE70000909600080A0D47443332313062 +:1094B00033432D4556414C2053797374656D2069B3 +:1094C00073205374617274696E672075702E2E2E2E +:1094D0000A0D0000312E302E3030303000000000F8 +:1094E0000A0D47443332313033432D4556414C2029 +:1094F00050726F6772616D2056657273696F6E206E +:109500006E756D6265723A474425730A0D0000005E +:109510000A0D47443332313033432D4556414C20F8 +:1095200050726F6772616D20436F6D70696C65205A +:1095300074696D653A2841756720333120323031C6 +:1095400035202D2031343A30333A333129000000B0 +:109550000D0A00000A0D47443332313033432D45A4 +:1095600056414C2053544D3332463130785F53745A +:10957000645065726970685F56657273696F6E3AA0 +:1095800025642E25642E25640A0D00003800002075 +:109590000A0D47443332313033432D4556414C2078 +:1095A00053797374656D436F7265436C6F636B3A87 +:1095B0002564487A0A0D0000E0F7FF1F0A0D4744B2 +:1095C0003332313033432D4556414C20466C617364 +:1095D000683A25644BD7D6BDDA0A0D005800002042 +:1095E0000A0D47443332313033432D4556414C2028 +:1095F0005468652043505520556E69717565204447 +:1096000065766963652049443A5B25582D25582DB8 +:1096100025585D0A0D0000000D0A474433323130F1 +:1096200033432D4556414C20544654204C4344204E +:10963000636F6E666967757265642E2E2E0A0D0063 +:10964000500000200A0D546865204C434420436FAD +:109650006E74726F6C6C65722044657669636543E5 +:109660006F6465203D20307825580A0D0000000009 +:10967000BCAE0008000000202000002014000020E4 +:10968000180000201A0000201C0000201E000020EE +:109690000A0D2323232323232323232323232323C9 +:1096A000232323232323232323232323232323238A +:1096B000232323232323232323232323232323237A +:1096C000232323232323232323232323232323236A +:1096D000232323232323232323232323232323235A +:1096E000230A0D0000000000000000000000000040 +:1096F000000000000000183C3C3C18181800181826 +:109700000000000000666666240000000000000003 +:10971000000000000000006C6CFE6C6C6CFE6C6C59 +:109720000000000018187CC6C2C07C0686C67C18E3 +:109730001800000000000000C2C60C183060C68689 +:10974000000000000000386C6C3876DCCCCCCC76A5 +:109750000000000000303030600000000000000019 +:109760000000000000000C18303030303030180C91 +:1097700000000000000030180C0C0C0C0C0C183011 +:10978000000000000000000000663CFF3C66000096 +:1097900000000000000000000018187E18180000EB +:1097A0000000000000000000000000000018181871 +:1097B0003000000000000000000000FE000000007B +:1097C0000000000000000000000000000000181869 +:1097D000000000000000000002060C183060C0808D +:1097E0000000000000007CC6C6CED6D6E6C6C67C09 +:1097F0000000000000001838781818181818187E93 +:109800000000000000007CC6060C183060C0C6FED8 +:109810000000000000007CC606063C060606C67C6A +:109820000000000000000C1C3C6CCCFE0C0C0C1E5C +:10983000000000000000FEC0C0C0FC0E0606C67C92 +:109840000000000000003860C0C0FCC6C6C6C67C70 +:10985000000000000000FEC606060C183030303054 +:109860000000000000007CC6C6C67CC6C6C6C67C1A +:109870000000000000007CC6C6C67E0606060C7806 +:109880000000000000000000181800000018180078 +:109890000000000000000000181800000018183038 +:1098A00000000000000000060C18306030180C06A4 +:1098B00000000000000000000000FE0000FE0000AC +:1098C000000000000000006030180C060C1830602A +:1098D0000000000000007CC6C60C181818001818FC +:1098E000000000000000007CC6C6DEDEDEDCC07CBE +:1098F00000000000000010386CC6C6FEC6C6C6C612 +:10990000000000000000FC6666667C66666666FC19 +:109910000000000000003C66C2C0C0C0C0C2663C7F +:10992000000000000000F86C6666666666666CF80B +:10993000000000000000FE6662687868606266FEF3 +:10994000000000000000FE6662687868606060F0F9 +:109950000000000000003C66C2C0C0DEC6C6663A19 +:10996000000000000000C6C6C6C6FEC6C6C6C6C603 +:109970000000000000003C18181818181818183CAF +:109980000000000000001E0C0C0C0C0CCCCCCC78A1 +:10999000000000000000E6666C6C78786C6666E695 +:1099A000000000000000F06060606060606266FEC1 +:1099B000000000000000C6EEFEFED6C6C6C6C6C643 +:1099C000000000000000C6E6F6FEDECEC6C6C6C633 +:1099D000000000000000386CC6C6C6C6C6C66C389B +:1099E000000000000000FC6666667C60606060F05D +:1099F0000000000000007CC6C6C6C6C6C6D6DE7C17 +:109A00000C0E00000000FC6666667C6C666666E60E +:109A10000000000000007CC6C660380C06C6C67C8C +:109A20000000000000007E7E5A1818181818183C14 +:109A3000000000000000C6C6C6C6C6C6C6C6C67CB4 +:109A4000000000000000C6C6C6C6C6C6C66C3810F8 +:109A5000000000000000C6C6C6C6C6D6D6FE6C6CA6 +:109A6000000000000000C6C66C6C38386C6CC6C6BE +:109A7000000000000000666666663C181818183C76 +:109A8000000000000000FEC6860C183060C2C6FE52 +:109A90000000000000003C30303030303030303CCE +:109AA0000000000000000080C0E070381C0E0602BC +:109AB0000000000000003C0C0C0C0C0C0C0C0C3CCE +:109AC0000000000010386CC600000000000000001C +:109AD0000000000000000000000000000000000086 +:109AE00000FF0000303018000000000000000000FF +:109AF000000000000000000000780C7CCCCCCC768C +:109B0000000000000000E06060786C66666666DC5D +:109B10000000000000000000007CC6C0C0C0C67C81 +:109B20000000000000001C0C0C3C6CCCCCCCCC76B3 +:109B30000000000000000000007CC6FEC0C0C67C23 +:109B4000000000000000386C6460F060606060F04D +:109B500000000000000000000076CCCCCCCCCC7C17 +:109B60000CCC78000000E060606C7666666666E6A5 +:109B70000000000000001818003818181818183CC9 +:109B80000000000000000606000E06060606060697 +:109B900066663C000000E06060666C78786C66E6A3 +:109BA0000000000000003818181818181818183C81 +:109BB000000000000000000000ECFED6D6D6D6D68D +:109BC000000000000000000000DC66666666666655 +:109BD0000000000000000000007CC6C6C6C6C67CAF +:109BE000000000000000000000DC66666666667C1F +:109BF0006060F000000000000076CCCCCCCCCC7CC7 +:109C00000C0C1E000000000000DC7662606060F05A +:109C10000000000000000000007CC660380CC67C1C +:109C2000000000000000103030FC30303030361CB6 +:109C3000000000000000000000CCCCCCCCCCCC76E6 +:109C400000000000000000000066666666663C18C2 +:109C5000000000000000000000C6C6C6D6D6FE6C9C +:109C6000000000000000000000C66C3838386CC6E8 +:109C7000000000000000000000C6C6C6C6C6C67EC2 +:109C8000060CF8000000000000FECC183060C6FE94 +:109C90000000000000000E18181870181818180E90 +:109CA00000000000000018181818001818181818DC +:109CB000000000000000701818180E18181818700E +:109CC00000000000000076DC000000000000000042 +:109CD000000000000000000010386CC6C6C6FE0080 +:109CE0000000000000000000000000000000000074 +:109CF0000000000000000000000000000000000064 +:109D00000000000000000000000000000000000053 +:109D100000000000000080018001800180018001BE +:109D2000800180018001800180018001800180012B +:109D30000000000080018001000000000000000021 +:109D40000000000000000000CC00CC00CC00CC00E3 +:109D5000CC00CC000000000000000000000000006B +:109D600000000000000000000000000000000000F3 +:109D700000000000000000000000000000000000E3 +:109D8000600C600C600C30063006FE1FFE1F3006B3 +:109D900038071803FE1FFE1F180318038C018C01DF +:109DA0008C01000000008000E003F80F9C0E8C1C6A +:109DB0008C188C009800F801E007800E801C8C182D +:109DC0008C189C18B80CF00FE00380008000000095 +:109DD000000000000000000000000E181B0C110C19 +:109DE00011061106110311039B018E01C038C06CCE +:109DF00060446044304430441844186C0C3800000F +:109E0000000000000000E001F00338071806180603 +:109E10003003F001F000F8009C310E33061E061CE2 +:109E2000061C063FFC73F02100000000000000004B +:109E300000000000000000000C000C000C000C00F2 +:109E40000C000C00000000000000000000000000FA +:109E50000000000000000000000000000000000002 +:109E6000000000000000000200038001C000C000EC +:109E70006000600030003000300030003000300002 +:109E80003000300060006000C000C00080010003AE +:109E900000020000000020006000C000800180017E +:109EA0000003000300060006000600060006000688 +:109EB000000600060003000380018001C00060006E +:109EC0002000000000000000000000000000000072 +:109ED000C000C000D806F807E001300338070000D2 +:109EE0000000000000000000000000000000000072 +:109EF0000000000000000000000000000000000062 +:109F000080018001800180018001FC3FFC3F8001D5 +:109F1000800180018001800100000000000000003D +:109F20000000000000000000000000000000000031 +:109F30000000000000000000000000000000000021 +:109F4000000000000000800180010001000180008D +:109F50000000000000000000000000000000000001 +:109F6000000000000000000000000000E007E00723 +:109F700000000000000000000000000000000000E1 +:109F800000000000000000000000000000000000D1 +:109F900000000000000000000000000000000000C1 +:109FA000000000000000C000C00000000000000031 +:109FB000000000000000000C000C00060006000677 +:109FC0000003000300038003800180018001C000C2 +:109FD000C000C00060006000000000000000000041 +:109FE000000000000000E003F007380E180C0C1809 +:109FF0000C180C180C180C180C180C180C180C1841 +:10A00000180C380EF007E00300000000000000000C +:10A0100000000000000000018001C001F001980173 +:10A020008801800180018001800180018001800120 +:10A03000800180018001800100000000000000001C +:10A04000000000000000E003F80F180C0C180C18BA +:10A0500000180018000C000600038001C00060001A +:10A0600030001800FC1FFC1F000000000000000072 +:10A07000000000000000E001F807180E0C0C0C0CAA +:10A08000000C0006C003C007000C001800180C18D4 +:10A090000C18180CF807E003000000000000000096 +:10A0A000000000000000000C000E000F000F800DEB +:10A0B000C00C600C600C300C180C0C0CFC3FFC3F0E +:10A0C000000C000C000C000C000000000000000060 +:10A0D000000000000000F80FF80F180018000C0036 +:10A0E000EC03FC071C0E001C0018001800180C18CC +:10A0F0001C0C180EF807E003000000000000000030 +:10A10000000000000000C007F00F381C18181800ED +:10A110000C00CC03EC0F3C0E1C1C0C180C180C187B +:10A12000181C380EF007E0030000000000000000DB +:10A13000000000000000FC1FFC1F000C00060006D1 +:10A14000000380038001C001C000E00060006000E7 +:10A1500070003000300030000000000000000000FF +:10A16000000000000000E003F007380E180C180C87 +:10A17000180C3806F007F007180C0C180C180C18FF +:10A180000C18380CF80FE00300000000000000007D +:10A19000000000000000E003F007380E1C0C0C1853 +:10A1A0000C180C181C1C381EF81BE0190018000CA9 +:10A1B000000C1C0EF807F001000000000000000079 +:10A1C000000000000000000000000000000000008F +:10A1D000800180010000000000000000000000007D +:10A1E000000000008001800100000000000000006D +:10A1F000000000000000000000000000000000005F +:10A20000800180010000000000000000000000004C +:10A2100000000000800180010001000180000000BA +:10A22000000000000000000000000000000000002E +:10A23000000000000010001C800FE003F800180070 +:10A24000F800E003800F001C001000000000000078 +:10A2500000000000000000000000000000000000FE +:10A2600000000000F81F000000000000F81F0000C0 +:10A2700000000000000000000000000000000000DE +:10A2800000000000000000000000000000000000CE +:10A290000000000008003800F001C007001F00188F +:10A2A000001FC007F0013800080000000000000097 +:10A2B000000000000000E003F80F180C0C180C1848 +:10A2C0000018000C000600038001C000C000C000A0 +:10A2D00000000000C000C0000000000000000000FE +:10A2E0000000000000000000E00718180420C22948 +:10A2F000224A114409440944094409221113E20C79 +:10A30000024004201818E0070000000000000000D0 +:10A3100000000000000080038003C006C006C006E5 +:10A32000600C600C301830183018F83FF83F1C7083 +:10A330000C600C6006C006C00000000000000000B9 +:10A34000000000000000FC03FC0F0C0C0C180C18A3 +:10A350000C180C0CFC07FC0F0C180C300C300C30DB +:10A360000C300C18FC1FFC0700000000000000006F +:10A37000000000000000C007F01F38381C300C70CF +:10A3800006600600060006000600060006000660DD +:10A390000C701C30F01FE0070000000000000000FF +:10A3A000000000000000FE03FE0F060E061806184F +:10A3B0000630063006300630063006300630061805 +:10A3C0000618060EFE0FFE0300000000000000004D +:10A3D000000000000000FC3FFC3F0C000C000C00E3 +:10A3E0000C000C00FC1FFC1F0C000C000C000C00EF +:10A3F0000C000C00FC3FFC3F0000000000000000CF +:10A40000000000000000F83FF83F18001800180096 +:10A4100018001800F81FF81F18001800180018007E +:10A4200018001800180018000000000000000000CC +:10A43000000000000000E00FF83F3C780E6006E0EE +:10A4400007C00300030003FE03FE03C007C006C0ED +:10A450000EC03CF0F83FE00F0000000000000000DC +:10A460000000000000000C300C300C300C300C30C0 +:10A470000C300C30FC3FFC3F0C300C300C300C30FE +:10A480000C300C300C300C300000000000000000DC +:10A490000000000000008001800180018001800137 +:10A4A00080018001800180018001800180018001A4 +:10A4B0008001800180018001000000000000000098 +:10A4C000000000000000000600060006000600066E +:10A4D0000006000600060006000600060006180634 +:10A4E00018063807F003E00100000000000000003B +:10A4F00000000000000006300618060C06060603E1 +:10A500008601C60066007600DE008E0106030606A0 +:10A51000060C06180630066000000000000000006F +:10A5200000000000000018001800180018001800B3 +:10A53000180018001800180018001800180018005B +:10A5400018001800F81FF81F0000000000000000AD +:10A550000000000000000EE01EF01EF01EF036D8D5 +:10A5600036D836D836D866CC66CC66CCC6C6C6C613 +:10A57000C6C6C6C686C386C3000000000000000031 +:10A580000000000000000C301C303C303C306C30CF +:10A590006C30CC30CC308C310C330C330C360C3668 +:10A5A0000C3C0C3C0C380C3000000000000000009B +:10A5B000000000000000E007F81F1C380E70066065 +:10A5C00003C003C003C003C003C003C003C00660D0 +:10A5D0000E701C38F81FE0070000000000000000AB +:10A5E000000000000000FC0FFC1F0C380C300C3089 +:10A5F0000C300C300C18FC1FFC070C000C000C007D +:10A600000C000C000C000C0000000000000000001A +:10A61000000000000000E007F81F1C380E70066004 +:10A6200003E003C003C003C003C003C007E0066328 +:10A630000E3F1C3CF83FE0F700C0000000000000A7 +:10A64000000000000000FE0FFE1F06380630063036 +:10A6500006300638FE1FFE0706030606060C06181F +:10A6600006180630063006600000000000000000FA +:10A67000000000000000E003F80F1C0C0C180C1880 +:10A680000C001C00F803E00F001E003806300630F6 +:10A690000E301C1CF80FE007000000000000000056 +:10A6A000000000000000FE7FFE7F8001800180012D +:10A6B0008001800180018001800180018001800192 +:10A6C0008001800180018001000000000000000086 +:10A6D0000000000000000C300C300C300C300C304E +:10A6E0000C300C300C300C300C300C300C300C308A +:10A6F0000C301818F81FE0070000000000000000F0 +:10A7000000000000000003600630063006300C1820 +:10A710000C180C18180C180C380E30063006700780 +:10A7200060036003C001C0010000000000000000E1 +:10A730000000000000000360C361C361C3616633B1 +:10A74000663366336633663366336C1B6C1B6C1B77 +:10A750002C1A3C1E380E380E0000000000000000CD +:10A760000000000000000FE00C7018303018700C72 +:10A77000600EC00780038003C003E006700C301C2D +:10A7800018180C300E6007E0000000000000000008 +:10A7900000000000000003C006600C301C383818B0 +:10A7A000300C6006E007C003800180018001800159 +:10A7B0008001800180018001000000000000000095 +:10A7C000000000000000FC7FFC7F006000300018EB +:10A7D000000C000600038001C0006000300018007B +:10A7E0000C000600FE7FFE7F00000000000000005D +:10A7F000000000000000E003E00360006000600073 +:10A800006000600060006000600060006000600048 +:10A810006000600060006000600060006000E003B5 +:10A82000E0030000000030003000600060006000C5 +:10A83000C000C000C000C001800180018001000391 +:10A8400000030003000600060000000000000000F6 +:10A85000000000000000E003E00300030003000329 +:10A8600000030003000300030003000300030003D0 +:10A870000003000300030003000300030003E003E0 +:10A88000E003000000000000C001C001600360039D +:10A89000600330063006180C180C000000000000A1 +:10A8A00000000000000000000000000000000000A8 +:10A8B0000000000000000000000000000000000098 +:10A8C0000000000000000000000000000000000088 +:10A8D000000000000000FFFFFFFF0000000000007C +:10A8E0000000000000000C000C000C000C000C002C +:10A8F0000C0000000000000000000000000000004C +:10A900000000000000000000000000000000000047 +:10A910000000000000000000000000000000000037 +:10A92000F003F8071C0C0C0C000FF00FF80C0C0CCB +:10A930000C0C1C0FF80FF0180000000000000000C5 +:10A94000000000000000180018001800180018008F +:10A95000D803F80F380C18181818181818181818E1 +:10A960001818380CF80FD803000000000000000091 +:10A9700000000000000000000000000000000000D7 +:10A98000C003F007300E180C18001800180018004B +:10A99000180C300EF007C00300000000000000009B +:10A9A000000000000000001800180018001800182F +:10A9B000C01BF01F301C1818181818181818181871 +:10A9C0001818301CF01FC01B000000000000000021 +:10A9D0000000000000000000000000000000000077 +:10A9E000C003F00F300C1818F81FF81F18001800DB +:10A9F0003818301CF00FC0070000000000000000F5 +:10AA0000000000000000800FC00FC000C000C000A8 +:10AA1000F007F007C000C000C000C000C000C000C8 +:10AA2000C000C000C000C000000000000000000026 +:10AA30000000000000000000000000000000000016 +:10AA4000E00DF80F180E0C0C0C0C0C0C0C0C0C0C74 +:10AA50000C0C180EF80FE00D000C0C0C1C06F8077F +:10AA6000F00100000000180018001800180018007D +:10AA7000D807F80F381C18181818181818181818AC +:10AA80001818181818181818000000000000000006 +:10AA9000000000000000C000C00000000000000036 +:10AAA000C000C000C000C000C000C000C000C000A6 +:10AAB000C000C000C000C000000000000000000096 +:10AAC000000000000000C000C00000000000000006 +:10AAD000C000C000C000C000C000C000C000C00076 +:10AAE000C000C000C000C000C000C000C000F8002E +:10AAF0007800000000000C000C000C000C000C00A2 +:10AB00000C0C0C060C038C01CC006C00FC009C01AE +:10AB10008C030C030C060C0C00000000000000006D +:10AB2000000000000000C000C000C000C000C00065 +:10AB3000C000C000C000C000C000C000C000C00015 +:10AB4000C000C000C000C000000000000000000005 +:10AB500000000000000000000000000000000000F5 +:10AB60007C3CFF7EC7E383C183C183C183C183C1B2 +:10AB700083C183C183C183C10000000000000000C5 +:10AB800000000000000000000000000000000000C5 +:10AB90009807F80F381C18181818181818181818CB +:10ABA00018181818181818180000000000000000E5 +:10ABB0000000000000000000000000000000000095 +:10ABC000C003F00F300C1818181818181818181897 +:10ABD0001818300CF00FC003000000000000000047 +:10ABE0000000000000000000000000000000000065 +:10ABF000D803F80F380C181818181818181818183F +:10AC00001818380CF80FD80318001800180018008E +:10AC1000180000000000000000000000000000001C +:10AC2000C01BF01F301C18181818181818181818FE +:10AC30001818301CF01FC01B00180018001800184E +:10AC400000180000000000000000000000000000EC +:10AC5000B007F003700030003000300030003000EA +:10AC60003000300030003000000000000000000024 +:10AC700000000000000000000000000000000000D4 +:10AC8000E003F003380E180C3800F003C007000C86 +:10AC9000180C380EF007E003000000000000000070 +:10ACA00000000000000000008000C000C000C000E4 +:10ACB000F007F007C000C000C000C000C000C00026 +:10ACC000C000C000C00780070000000000000000B6 +:10ACD0000000000000000000000000000000000074 +:10ACE00018181818181818181818181818181818E4 +:10ACF0001818381CF01FE0190000000000000000C8 +:10AD00000000000000000000000000000000000043 +:10AD10000C18180C180C180C30063006300660039E +:10AD200060036003C001C0010000000000000000DB +:10AD30000000000000000000000000000000000013 +:10AD4000C141C141C36163636363636336363636B1 +:10AD500036361C1C1C1C1C1C0000000000000000DF +:10AD600000000000000000000000000000000000E3 +:10AD70001C38381C300C60066003600360036003FD +:10AD80006006300C381C1C38000000000000000079 +:10AD900000000000000000000000000000000000B3 +:10ADA0001830301830187018600C600CE00CC006B9 +:10ADB000C00680038003800380018001C001F00091 +:10ADC0007000000000000000000000000000000013 +:10ADD000FC1FFC1F000C000600038001C000600087 +:10ADE00030001800FC1FFC1F0000000000000000E5 +:10ADF00000000000000000038001C000C000C0008F +:10AE0000C000C000C0006000600030006000400072 +:10AE1000C000C000C000C000C000C000800100032E +:10AE2000000000000000800180018001800180019D +:10AE3000800180018001800180018001800180010A +:10AE400080018001800180018001800180018001FA +:10AE50008001000000006000C000C001800180018E +:10AE6000800180018001000300030006000300014F +:10AE7000800180018001800180018001C0006000AC +:10AE800000000000000000000000000000000000C2 +:10AE900000000000F010F81F080F00000000000084 +:10AEA00000000000000000000000000000000000A2 +:10AEB000000000000010F0009600011BDEAFDEAFC6 +:10AEC000DFAFDEB7FFBFDEBFBFC7BEC7DEC7FFC78E +:10AED000BEC7BECFDFD7FFE7FFE7FFE7DFE7FFEF44 +:10AEE000FFEFFFE7FFE7FFDFFFE7FFE7DFDF9FCFD2 +:10AEF000FFB6DC6C3B6D9F8EFF961E97BFA79E9F93 +:10AF00009EA7BEAFBFBFBEBFFFBFFFB7DFAFDFAF04 +:10AF1000BEA79EA79EA79FA77FA75EA73EA75FAFDE +:10AF20007FBF9FBF7FBF7FBF7FBF5EBF9EC7BFCFBB +:10AF3000DFCFBFCFBFC7DFC7FFBFBEB7DFBFDFBF3A +:10AF4000BEB7DEB7DFBFDFBFDFCFFFD7DFCFDFC7E3 +:10AF5000DFC7FFC7DFBFBFBF3FBF5FA61F5C1B1AB6 +:10AF6000DA11FB3A7FA6FFDF7FCF1F851E643F64A7 +:10AF7000FF5BBD32F919F611373BFA6CDC85DE9EBA +:10AF80009FAF7EA75E9F9FA7DFBFDFC7BFC7DFCF93 +:10AF9000FFD7DFD7FFD7FFDFDFDFDFDFFFDFDFD761 +:10AFA000DFDFDFDFBFD7BFD77FC7FDB65C9E9B8DDE +:10AFB000185CB632D511760177091D43FFA57FDFF6 +:10AFC000FFF7FFF79FDFFCC65B9ED9853B865C865B +:10AFD0001B7E5B865B8E3A863B863A865B8E9C9EAA +:10AFE000DDA6BCA6BAA637A64F7CC95A0542665252 +:10AFF0004A6B096B4652C449A449834943494341BA +:10B0000064418441C5510652A8622E94D19C32A558 +:10B0100090942E84095BA64A484B884B674B0643A5 +:10B02000C221AF8CFEF7FFF7FFEFFFEFDEDFDFE7B8 +:10B03000FFE7BDDFBCE7BCE7DCEFFDF7FDEFFEEFB0 +:10B04000FEF7BDE7DABE3BC71BC7FBC65CCF5CC7DC +:10B050003CBF1CB71DB73DBF1DBF3DBFDCAEBC9E96 +:10B060009C965B8E9C969B96BC9EDCA61DAF1DB7E6 +:10B07000FCAEDCAEDCA6BBA6DCAE1CB73DBFBBAEF7 +:10B080009B9EFCA6FDA6DC9E7C8E1A7E5B869C8E1B +:10B09000FDA65EB7FFE7DFDFDDA6FA7DFFBFDFB706 +:10B0A000DFBFBEB7BEBFFFC7FFCFDFCFDEC7DEC784 +:10B0B000FFCFFFD7FFDFFFE7FFE7FFEFFFEFFFEF78 +:10B0C000FFEFFFE7FFE7FFE7FFE7DFE7BFDF5FCF68 +:10B0D0007E851A547D759F8E9E863E97BFA7DFAFF3 +:10B0E000DFB7FFBFFFC7DFBFDFBFDEB7BEAFBEAF9B +:10B0F000BEAFBEAFBFB77FAFFDA65FAF1EA73B8E93 +:10B100009985597D39757A851C961FB7FFD7BFCFB2 +:10B11000BFCFBFC77EBF7EB7BFBFDFBFDFBFDFBF51 +:10B12000DFBFDFBFBEBFDFC7FFCFFFCFDFC7DFBFE0 +:10B13000DFC7FFC7BEB77FB71FBFDF9D5D431B1AC9 +:10B14000F9193E5C3FC7DFBEBC741C649D53DA3AFC +:10B150005822B932DC537F85DFA61FAF1FA75FAF30 +:10B160007FAF7EA77FA75EA75EAF3EAF5EB73EB75D +:10B170003EB75EBF3EBF7EC7BFCFBFD7BFCFBFCF3B +:10B18000BFD7BFD7DFD7FFD7DFD7BFCF7FC75FBF5F +:10B190001FBF9FAEDF95FF74DD5BB8323422B33A38 +:10B1A000797C3FB6BFE7FFE79FCFFEAE5B961A867E +:10B1B0009C96BD9EDD9E3EAF1EA7FDA69B9EFDAE4E +:10B1C000BBA6BBAE34858D5B4742C53987524A6BFF +:10B1D0000963C85AA862E549834163416341223942 +:10B1E000A1286020A028E1286339885AED83B09C0B +:10B1F000D19C8F8C2E846A63074B0743474B68535F +:10B20000484B042AC94AF6ADDEEFFFEFBEDFFFE789 +:10B21000DEDFBEE7BDE7FDEFFDEFFDEFBCE7DDEFF5 +:10B22000DDEFFEEFBDDF7CCF7CD75CCF5CCF3CC7D2 +:10B230001BB7FCB61CB71CB7FCB61CB71DAFFDAEE8 +:10B240009B969B969B969B96BCA6DCA6BBA6FCAE4B +:10B25000DCAEDCAE1CAFFCAEDCAE1CB7DCAEDCAEF4 +:10B26000BBA6BB9EBC9E3A8E3B865B869C8EDD96C3 +:10B270001E9F1DAFDFDFFFE71EAF1A86FFCFFFCF98 +:10B28000FFCFFFCFFFC7DEC7DFCFDECFDFCFFFD7D8 +:10B29000FFDFFFDFFFE7FFE7FFEFFFEFFFEFFFEF6E +:10B2A000FFEFFFEFFFE7FFE7DFE7BFDF5FCFBE9511 +:10B2B000DA535C5CDF855E8E9D8E3E9FBFB7DFBF3D +:10B2C000FFC7FFC7FFCFFFC7FFBFBEB7BEAFBEB749 +:10B2D000BFB7BFBFBFC73EB7BDAE1C9EB98DFA9DFD +:10B2E0005CAE5CAE9A95197D996CD753FB7C3FBFE1 +:10B2F0009FC73EB7FDA65EAFBFBFFFC7FFC7DFBF9B +:10B30000BFBFBEBFDFC7FFCFFFCFFFCFDEC7FFC7C7 +:10B31000FFBFBFB77EAF7FB79FAEFF7C9C2AFA11FD +:10B32000992ADF95FFB6FC7CFD5B3C435722F83A37 +:10B33000BC6C3F963FB79FBF7FB75FB73EAFFEA6DF +:10B340001E9F1E9F1E9F1E9FFEA6FEA6DD9E9C9614 +:10B350009C9E9D9E7C9EDEAE3FBF5FBF7FBF5FBF5A +:10B360005FBF3FBF5FBF7FC7DFD7FFDFFFD7BFCF65 +:10B370009FCF5FBF3FBF3FBF1FBF9FAE7D8DD85BDD +:10B38000542AB3197A53DFA59FDFFFE77FCF9BA62F +:10B390009C9EFDAEFDAEBFCFBFCF5EBF3DBF7ECF9B +:10B3A0001CC7F284894A4321432987520963E96211 +:10B3B000C85AA85A675A46526339A1208018E1201A +:10B3C0006439A4416331E22020108120A4416B7BC9 +:10B3D0006F946F8C0D84AC7B2A634642C74A074B3F +:10B3E000684B885364328219CD633CD7FFE7DFE7AF +:10B3F000DFE7BEE7BDE7FEEFFDEFFDEFDCE7DDE7F2 +:10B40000BDE7BDE79CDF9CD77CD77CCF9CCF5BC7DB +:10B410003BBF1BBF1CBFFBAEDCAEFCAEFCAEFDA653 +:10B42000DCA69B9EDC9EDCA6DCAEFCAEDBA6BBA64F +:10B43000BBA6FCAEFCAEFCAE1CB71CBFFCB6FBAEA4 +:10B44000DBAEBBA6BB9E5A969B967B8E9C8EBD9612 +:10B45000BD96BCA69ED7FFEF5FBF5B8EDEC7DFC782 +:10B46000FFCFFFCFDFC7DFC7FFCFFFD7FFD7FFDF9C +:10B47000FFDFFFE7FFEFFFEFFFEFFFEFFFEFFFEF74 +:10B48000FFEFFFEFFFE7DFE7BFDF5FD7FF9DFA5377 +:10B49000BA4B5F751F8E1D86BD967FAFFFC7FFC776 +:10B4A000FFC7DFC7FFC7BEBF9EB7BEB7BEB7DFBF10 +:10B4B000DFC7DFCFBFCFFDBE3BA6BDB69FD7FFE73F +:10B4C000FFEFFFE7BFDF7FD79FB65A6CF63AF95B15 +:10B4D0007F9EFFAE1EA71DA7BFB79EB7BEBFFFC70B +:10B4E000BEBFDFC7FFCFFFCFFFC7FFC7DFBFFFBFB5 +:10B4F000DFB77EAF7FB7FFAEDF95FD5B1A1AF91994 +:10B50000FC5BDFB67F8D7D6C3A4357227D6C7FA656 +:10B510007FBF9FBF5FB73EAF5EB79FBF7FBF7FB7A5 +:10B520003EA7FEA6DE9EDE9EBD9EFEA6FEA61FA731 +:10B530001FA71FA7DE9EBE9EBEA6DEAEFEAEFEAE5F +:10B54000DEA6BEA67DA69DA6DEAEFEB67FC7BFCF99 +:10B55000BFCFBFCF7FBF3EB73FB73FB73FBF1FBFD4 +:10B560005FA65E643722D419B8631FAEFFE7DFD74A +:10B57000FDB6BBAEFCB63DBF5EC77ECF9ED79EDF9D +:10B580003395484202218439885AE962096BA85AE6 +:10B59000A85A6B73096BC5414339475AE96AAC8BAA +:10B5A0000D9C2E9C2E9C2E9CC54900108028A549E0 +:10B5B0008C7B4E940A6B2A736B7B885A2542C74A50 +:10B5C000074B474B8853064B6219E529B5A5FFE7A2 +:10B5D000FFEFBEE7BEE7BDE7DDE7FDEFDDE7DDE757 +:10B5E0009CDF7CDF7BD77BD75BD75BCF5BC75BC741 +:10B5F0007CCF3BC73CBF1CBF3CBF1CB7FCAEDCAE26 +:10B60000DCA6DCA6DCA6FCAE3CBFFBB6FBAEDBAE2C +:10B61000BAA69AA6BAAEBAAEFBBE1BBF1BBFFBB69C +:10B620001BBFDBAEBBA67B969B96BC969C8E7C8E8E +:10B630005B86BC9E7ECFFFEFBFC7BC9EDEBFDEBF7A +:10B64000BFBF9EBFBFBFFFCFFFCFFFD7FFD7FFDF7B +:10B65000FFE7FFEFFFEFFFEFFFEFFFEFFFEFFFEF82 +:10B66000FFEFFFE7DFE7BFDF5FCFFF9D1C5C9B4382 +:10B67000BD6C1F8EFE85BF961FA77FAFBFBFDFC704 +:10B68000DFC7DFC7DFB7BEAFBEAFBEB7BEB7BEB79F +:10B69000DFBFDFCFDFD7FCBE3ECFFFEFFFE7FFE727 +:10B6A000FFE7FFE7FFEFFFE79FDFFF9D1C5C972AA7 +:10B6B000D94B9FA63FAF3DAF5DAF7EAF9EB7BEBF3C +:10B6C000BFBFFFC7FFC7DEBFDFBFBEB7DFB7DFAF9C +:10B6D0009FA75FA79F9EDF953F853C43F919BA322C +:10B6E0005FAE7FAE7E6C193BD63AFF9D9FCFDFC722 +:10B6F0009FBF5FAF1EAF3EB79FC79FC77FBF3EB71D +:10B700001EA7FEA6FEA6DEA6DEA6FEA63EAF7FAF65 +:10B710007FAF7FA73FA7FE9EBE96BE9E9E969E963B +:10B720009E967E967D969E969E9E7D965D9EBEAED4 +:10B730003FBF7FC79FC79FC77FBF5FB7FFAEDFA673 +:10B74000DFAE7FA6BF8DBA53F61917227D741FC7CF +:10B75000FFDFBBB65DCF1CBF1CBF5DCFBEE7B5AD85 +:10B760006842C118264A0963E962A85AC85AA85A09 +:10B77000ED83EE8309638B7B4E9C4EACCCA38BA3F5 +:10B780008AAB49A3299B6B9B4B8B60282020C1303F +:10B79000E651E972E551C549475A06528339C54118 +:10B7A000674AA64AE64A27532753033202112F74E9 +:10B7B000BEE7FFEF9DDF9DD79DD7DEE7FEEFDDEF14 +:10B7C000BDEFDDEF5BDF5AD73ACF5BCF3AC73BC760 +:10B7D0003BC75BCF5BCF5BCF5BCF5BC71BB71CB7F8 +:10B7E0001CB7DBAEFCB61BB71BB71BB7BAAEBAAE05 +:10B7F000BAB6FABEFBBE3BC73BCF1BC75BCF5BCF26 +:10B800003BCFDAB61CB7BBA69C963B867C865B8694 +:10B810007C869C9E7ECFFFEFBFCFBCA6FFCFDFC74D +:10B82000BEC7DFC7DFC7DFC7DECFDFD7FFD7FFDF8A +:10B83000FFE7FFEFFFEFFFEFFFEFFFE7FFEFFFE7B0 +:10B84000FFEFDFE7BFDF1FC79F95FB5B9B431D54E7 +:10B850007F7D9D7DDC85BE9E7FAF3EAF3DA73DAF2A +:10B860007EB79EB79EAFBEAFBEAFDEB7DFB7BEB787 +:10B870009EB7BEC75DBF5DCFFFEFFFEFDFE7DFE73E +:10B88000FFE7FFEFFFEFDFEFBFE7BFBE5E6C3C43BC +:10B89000972A5E7DBFC7BFC7DFBFDFBFDFBFDFBF88 +:10B8A000DFBFDFC7FFC7FFBFFFBFBEAF9EA79EA71B +:10B8B0007FA7BF9E7D859E741F64592A5722DF95FE +:10B8C000DFDFFE9D594BD73ADF9DDFDFDFCFBFC7FC +:10B8D0007EB71EAF3EAF9FC77FC77FCF5EBF1DB78E +:10B8E0001EAF3EAF1EAF3EB73FB75FB79FB77FAF4C +:10B8F0009FAF7FA73F9FDE96BE969E967E8E9E96BA +:10B900007E969E96BF96BF969F967E963E8E1D967D +:10B910007D9EFFB65FBF9FBF3EB73FAFDD9EBE9E21 +:10B920005D963E967F9E1F965F64592295117A53CD +:10B93000DFBE9FD71DC73CC75DCF5CCFB6AD895278 +:10B94000A01006420963096309632A6BED83B09C6A +:10B950009094EE83F1A4D0A4ED9B8B9B6AAB69B36A +:10B960008AC329B3C8AAC8A24AA384592020A228FE +:10B97000C2302339434123414341223922394339DB +:10B980006339E541043A4442A44AA54A043AA0086E +:10B99000EA521BD7FFEFBEDF9DD7DEE7FEEFDEEFFB +:10B9A000DDEFBCEFDCEFBCE77BD75BCF7BCF5BCFC2 +:10B9B0005BCF7BD77BD77BD77BD79BD75BC75CC75E +:10B9C0001BBF1BBF3BBF3BC71ABF1BBFFABE3BC75A +:10B9D0003BC77BCF7BD79CDF7BD79CDFBCDF9BDF6C +:10B9E000BDDF3BCF3CBFDBA67B8E1A865B867C8EA1 +:10B9F0009D96BCA67ED7FFEFDFCFBCA6FFD7FFDFAB +:10BA0000FFD7FFD7FFD7FFD7DECFFFD7DFD7DED7F0 +:10BA1000FFDFFFE7FFE7FFE7DFE7FFE7DFE7DFE75E +:10BA2000DFE7BFDFBFBEFE7CBC537C43DC4B1F7532 +:10BA30007E7DBD7D1D8E3FAF7FB79FB75EA75EA7A2 +:10BA40007EAF9EAF7EA79EA79EA79EA7BEAFDFB785 +:10BA50009EB79EBF5DBFDFD7FFEFFFEFFFE7DFDFE2 +:10BA6000FFE7FFE7FFEFFFEFBFE7FFC65D6C9D4B12 +:10BA7000BA32BB533FC7DFD7BFC7DFBFFFC7FFC760 +:10BA8000FFC7FFC7DFBFDFB7BFAFBFA79EA79FAF8F +:10BA90005FB7FF959D6C1F5C9B2AF719DC7CBFDFAD +:10BAA000FFDF5EAE97539F95FFDFDFDFDFCF5EBF27 +:10BAB000FDAEDDA6FDAE5FC79FCF7ECF9FCF9EC7F9 +:10BAC000BFC7BFCF9FC7BFC7BFBFBFBF9FB7BFB7AE +:10BAD000DFB77FAFFE9E9D96BE9E9E969E96DE969B +:10BAE000DF96BE96BF969F967F963E8E3F963F9678 +:10BAF0005E9E7E9EBEA6FEAEDDA6FEA63EA73FA72C +:10BB0000FF9E7D96FD853F8EFF959F6C9B32182290 +:10BB1000BA5B1FC75FC73CC77DCF78B60B53801099 +:10BB2000A431095BE85A09630963CC7B12A573B59C +:10BB300053AD53B56F9CCC936B9B8BAB8ABBAACB9D +:10BB4000CAD369C3E8B2C8AAC9A2E6718128A220F3 +:10BB500060186120C230023923410239234164490F +:10BB60002231833905420442244224424442864A17 +:10BB7000E218073258BEFFE77DDFDEE7DEEFDDEFDC +:10BB8000BDEFDDEFDCEFFCEFDCE7BCE79BDF7BD755 +:10BB90005BDF7BDF7BD77BD77AD77BD77BCF5BCF56 +:10BBA0001BC73BC75BCF5BCF5BCF9BD77BD79BD7FD +:10BBB000BCDFBBDFBBDF9BE7DCEFDCEFBBE7BBE75A +:10BBC000DCE77BD7FBB69AA65A8E5A8E7B8E9C8E6C +:10BBD000DD9E3EB7DFE7FFEFDFCFDCA6FFE7FFDF4D +:10BBE000FFDFFFDFFFDFFFD7FFD7FFD7FFD7FFD78D +:10BBF000FFDFDFDFFFE7FFE7FFE7DFE7BFDFBFDFF5 +:10BC00007FD73FA69C6C7B4B5D437D435E5C9F7DF5 +:10BC1000DE7D3E869E965FAF3EA73DA75EA77EA7D0 +:10BC2000BFB7DFB7BEAF9EA7BEA7BEA79EA7BEAFDA +:10BC3000BEAFBFBF9EC7FFDFFFE7FFE7FFE7DFDF66 +:10BC4000DFDFFFE7FFEFDFE79FDFDFBE5D6C9E4BCF +:10BC50009B32B932FFA55FCF3FBF3FB77FBF9FBFCA +:10BC6000BFBFDFBFBFB79FAF7FA77FA79FAF7FB724 +:10BC70003F9EDD745F64DB3AD6113C649FDFFFE7D3 +:10BC8000DFE71CA6B653FFC6FFE7FFE7FFD77EC777 +:10BC9000FDB6DDB61DBF9FCFDFD7DFDFDFD7FFD714 +:10BCA000FFD7FFDFFFDFFFD75FB7BD9E9D9EDE9E04 +:10BCB000FEA6BD9E9D96DEA6FFA6DE9E1FA71F9F29 +:10BCC000FF9EBE96BF967F961F8EDF859F857E7DE9 +:10BCD0009F85DF8DDFAEFFAEFFAE1FAF5FAF5EA70C +:10BCE0005FAF1FA73D8E3E8EFF8D5F85DE533922ED +:10BCF000D6199D74BFD77DCF9DD7707CE210E11817 +:10BD0000095BC85A6A6B8B6B6B6B6F8C32AD94B5E9 +:10BD100053AD0E8C465A424122494359A79ACBCB88 +:10BD2000EBDBAAD308C3A7B288A284718130401884 +:10BD30004028C238813020286030E23843416449CD +:10BD40006341A449064A264A054A044AC339244A9B +:10BD5000264AE220242174A5DEEFFEEFDDEFDDEFC1 +:10BD6000DDEFFDEFFDEFFDEFFCEFFDEFFDEFDCE7BD +:10BD7000BCE7DCEFBCE79BDFBBDF9BDF9BD75BCF88 +:10BD80005BC75CCF7CCF7BCFBCDF9BD75BD77BD740 +:10BD90007BDF9BDFBBE7DBEFDCEFDCEFBBE7BBE789 +:10BDA000DCE75BCF99A69A9EFCAEFDA6DCA6BC9E06 +:10BDB000FDAE7EC7FFEFFFEFBFCF9B9EFFDFFFDF34 +:10BDC000FFDFFFDFFFDFFFDFFFDFFFDFFFDFDFDFA3 +:10BDD000DFDFFFDFFFE7FFE7FFE7DFDFBFDF1FC7D3 +:10BDE0005E85FB5B9C4B3C3B3C3B9D435D549F75A0 +:10BDF0005F86FF965FA77FAF9FB75EAF9FB7BEB767 +:10BE0000DFBFDFBFBEB7DFB7DFAFDFAFBEA7BEA705 +:10BE1000BEB7BEBF9EC7FFD7FFDFDFDFDFD7BED70E +:10BE2000FFE7FFE7DFE7DFE71FCF7FB65D647E4B0D +:10BE3000BC329A325D6C9F951F9EBE8D3F961E8EC2 +:10BE40009F9E3FB75FB7FFAE1FA7FFA65F9E5F7DB8 +:10BE50007E64FE5BBB32D6193A6C7FDFFFEFFFEFEB +:10BE6000FFE75CAE364B7F8D5FCFDFDFFFE7FFDFA5 +:10BE7000BFD7BFD7DFDFFFE7FFE7FFE7FFE7FFDF62 +:10BE8000FFE7FFE7FFDF1FBF1D9EFE951E961E9674 +:10BE90009B7D1C8EDEA61FA71FA73FA73EA71EA740 +:10BEA0001EAFFFA67F9E5E7D9D643D54BC4B1A3342 +:10BEB000D832193BBA4BBF8DFFBE5FBF7FB77EB78D +:10BEC0007EB75FB79D9E1D8E5F967E857F643C3BEF +:10BED000B811D9329FB6DFE717B6E5314000C95235 +:10BEE0008B6BAB73CC73AC738F9494B5D5BD7094DE +:10BEF000684A222163316B7312ADA54940304AABC9 +:10BF0000CBD3AADB49D329CBE9B20361202081300E +:10BF10002782A9A2889AA57920380020C130233928 +:10BF200023394339C549E549A4410231C028E130EC +:10BF30006449C5518120C320139DFFF7FEF7FEEF32 +:10BF4000FEEFDDEFDDE7DDE7DDEFDDEFDDE7DCE791 +:10BF5000DDEFDCEFDCE7BCDF9BD79CD79CD79CCF29 +:10BF60009DCF9DCF5CC77CC79DCF5BCF7BD7BCDF10 +:10BF70009BDFBBE7BBE7DBEFBBE7BBE7DCEFBCE787 +:10BF80005BD73BC7FBBE1CB73CB73CB73DB73DB723 +:10BF90005DBF9FD7FFF7FFEF7FBF7B8EBEC7DECFB2 +:10BFA000FFCFFFD7FFD7FFD7FFDFFFDFFFDFFFE7C1 +:10BFB000FFE7FFDFDFDFDFDFFFDF9FD77FAE1C7D27 +:10BFC0001C5C9C4B5B43BD4BDE53DD4BDE64BE759E +:10BFD0001D76BE865E9F9FAFBFB7BFB7FFBF9EB740 +:10BFE000DFBFDFBFBEB79EAF7EA79EA7BEA7BFAF16 +:10BFF000DFB7BFBFDFCFDFD7DFD79ECF9EC7BFCFB3 +:10C00000FFDFFFE7FFE79FDFDFBE1FA63E645E4363 +:10C010005B225A2AFD637D749D749C6C7C647C64F5 +:10C02000DC6C5D7D5D7D5D7DBF855F7D1C5CBC5393 +:10C030007C4B782A3722DE7CBFE7FFF7FFF7FFF75C +:10C04000DFE7BFDFFB84354B5C8D9FBE3FCFDFDF7B +:10C05000DFDFDFE7FFE7FFE7FFE7FFE7FFE7FFE7F8 +:10C060009FDF5FCF9FB61D9EDE9DFF9DDE959C8D61 +:10C070007EA65FBF7FBF3FAF3FA73FA75EAF7FB743 +:10C080009FC75FBFBE8D5B5C5D5C7B4BF832BA5374 +:10C090003C641C5C5A43D63A9D955FC7BFCF7EBFB8 +:10C0A000BFC7BFC75FBF9DA61FB77FA65F857F6461 +:10C0B0007C2239221B853ED72C6340006329CC7338 +:10C0C0008B6BEC7BCC730D84D09C94B56F8C6331FF +:10C0D0002329C95A4B6394AD3CE72B6B6020A88A97 +:10C0E000CBD389DB69DB6AD34BBBC1500028E6693F +:10C0F000EAAAEABA4BCB4BC36892E25000308030D8 +:10C10000E238E130E130C128A128A1308130A138E6 +:10C11000C140A140E34061288118D294FFFFFFF79E +:10C12000FEF7DEEFFEEFDEEFDDE7DDE7BDE7BCE7C4 +:10C13000DCE7DCEFDCE7BCDFBDDF9DD77DCF7DCF6B +:10C140009ECF3DBF3CBF5DBF5DBF5CC77CD79CD76A +:10C150009CDFBCDFDCE7BBDF9BDFDCE7BCE75BD75A +:10C160001AC75CC75CC75CBF5DC75CBF5DBF9ECFC5 +:10C170005DCFFFE7FFF7FFDF1EAF5B869EB77DB7A2 +:10C180009EBFBEBF9EC7DFCFDFD7FFDFFFE7FFE762 +:10C19000DFDFDFD7BFD77FCFBFB63E857D6CFC5BCF +:10C1A000DC53FB535C64DE749E6C3C5CDD64FF7DA1 +:10C1B0009F861E8F5F977F9F5E9FBEAF9EAFBEB76D +:10C1C000BFBFBEBFBEB77EAF9EAF3DA77EAF7EB73F +:10C1D0007EBFDFCFFFD7BFD7BECF9EC7BECFDFD7D3 +:10C1E000FFDFFFDFDFDF5FCF9FB67F8DDE5BDC32FF +:10C1F0005B22DB32DF7CDE7C7D6C3D64FD5BDD53EE +:10C20000DD53DD53FD531D5CFD53BD537D4BFA3AA9 +:10C21000572A584BDEA5FFEFFFF7FFF7FFF7FFF7B1 +:10C22000FFEFDFE79FD7F9845653F963FD84FFA53D +:10C23000DFBE3FCF7FD7BFD79FDF5FD7DFC61FAE41 +:10C240005D9D1D8D3D959E9DFFA5FE9DBB959DAE63 +:10C25000BFD7DFD7BFC73FAF3FA73FAF5EB7BFC7AF +:10C260007FC7BFAEFD749E6CDB53774B7B8DDFBE0B +:10C270001FBF3EA65E8D1643596CBFD7FFDFBFD7E9 +:10C28000BFD7BFD7BFD77FC79FCF5FCF9FAEBF748A +:10C29000DE32181A7974579DE418200888528B737F +:10C2A000CC7BEC7B2E846E8C12A50E84C539264A7D +:10C2B000885AC862885253ADB9D6A95AA128298B89 +:10C2C0002CD4AAD349D36ACB4BBBE2584038888AD6 +:10C2D000EAB22ACB4BD34ACB0AC3E9B2E689A150D2 +:10C2E00060388030A130A130C138A1388140A248E7 +:10C2F000C2500361E250A140402081189194DEF7C2 +:10C30000FFF7FFF7DEEFDEEFDEEFBDE7DEE7BDE7CD +:10C310009DE7BDE7BDE7BDDFBEDFBED77EC71DB76A +:10C320001DB71EB7FDAEFDAEFDAE1CB73DBF3CBF99 +:10C330007CCFBDDF9CD7BCDF9CD79CD75BCF5BCFCE +:10C340005CCF7DCF7DC77DC79ECF9ECFBFCFBED7F1 +:10C35000BEE7FFF7FFEF9FCFBD9E1B7E9FB77EAF6F +:10C360005EAF7FB77FB7FEB63FBF5FC75FCF5FCF20 +:10C370007FCFFFBE7FAE3D7D1B5CBB4B7B4B9B4BA2 +:10C380009D6CBF8D7FAE5FA65E85DC6CBB64DD7D82 +:10C39000FF965F975F975E977E9FBFA7DFAFFFB760 +:10C3A000DFBFDFBF9EB7BFBFBFBF7FB71EAFDDAE72 +:10C3B0005EC7BFD7DFD7DFD7DFD7DFD7FFD7FFD73E +:10C3C000DFD7BFCF7FCFDFBE1FA6BF747E4B3B2220 +:10C3D0005A2ADD5BDF9D7E8DFE7C7D6CFD5BFE5B06 +:10C3E000DE53DE53DE53BD537C4BFA3AD93A594BF8 +:10C3F000DD84FFCEFFF7FEF7DEF7DEF7BEEFDEEF00 +:10C40000DEEFFFEFFFEFDFE79FBEBB7CF863D76394 +:10C41000386CD97C7B959C957C953B8DFB8CDC8422 +:10C42000BC84BC84BB841C8DBE9D1EA65FCFFFDF79 +:10C43000DFDFBFD75EBFDCA6DD9EFDA67FBF7FC767 +:10C44000DFB69C8DBC6CD95BD75BDFBEFFE7BDDF81 +:10C450009DD71DC7FD9D396CD542DFBEFFE7FFE7C5 +:10C46000FFDFFFDFFFDFBFDFBFDF3FCF7F8DBD53CC +:10C47000BD32D719F76B2F5B2100C118C95A096368 +:10C48000AB73CC73B094119DF19C88526B73A85A16 +:10C4900026526339264AD5BD58CEC641C1280CACB8 +:10C4A000CEE42CE4AAD36ACB8BCB63712040888A7C +:10C4B000A9AA0AC34BCB2ACB2AD3E9CAC9BAA8A2D4 +:10C4C000A579E258E248E248C248C250C258E36047 +:10C4D00003694469E3608248A2308218C639DAD61B +:10C4E000BACE5DE7FFFFFFF7DEEFBEEFDEE7DEE788 +:10C4F000BEE7BEE79DDFBDDFBEDF1DC7DCB6FDB614 +:10C500001EBFFDB6FDB61EB75EBF3DBF3DC79ECF89 +:10C51000BEDFBDD79DD7BDDF9CD75BCF5CCF9DCFA6 +:10C520009DCF9ECFBECFBED7BED7BED7BED7FFE76B +:10C53000FFF7FFF7DFDF3EB77C8EFB751FB71EAF3F +:10C540001FAF1FB77FA6DE957E853E851E7DFE7CD4 +:10C55000FE7C3D645A431A3B5B43BC53FB5BDC747B +:10C560009FAEBFCFDFCF9FC73FBF7EA6FD95DC85C7 +:10C570007D8E1F9F5F9F5E977E977E9FBFA7DFAFD9 +:10C58000DFB7BFB79FB7BFBF7FB75FB7FDB63EC7C7 +:10C590009FD7BFD7BFD7BFD7BFD7DFD7DFD7DFCFB3 +:10C5A000BFCF7FC79FAE1FA6FF7C9E537D2AFA197F +:10C5B000982A1F9E3FC75DA69C8D1C857C6CFB5BEB +:10C5C000DC5B9B539A4B794BB95B9A74BC9DFFCE55 +:10C5D000DFEFFFF7FDF7DCF7DCF7FDF7BDEFBDEFB1 +:10C5E000BDEFDEEFFEEFDFEFFFEFDFEF1FCFFBA5CD +:10C5F000D87C576C376417641864186C596C9A743B +:10C60000997CFA8CDCA51EAE1C8D5D95DFBEBFDF6C +:10C61000FFDFBFD73EBFDCA6DCA65FBFBFCF7FC7B3 +:10C62000BFB69D953864366C1ECFFFEFFDEFDCEF93 +:10C63000DCE7BEE7BDBE7C8DF64299535FCFFFE7D6 +:10C64000FFE7FFE7FFE7DFDF1FCF3F8DBD5B1D4348 +:10C650001A1A372A567C662940082329E9624A6B50 +:10C660008B6BEC7BAF9432A52B6BCD7B6B734652FF +:10C67000E54902296C73B9DEB29CE22042416DBCEF +:10C68000ADDC4CE4EBDBABD30CDCA7A20038E679E5 +:10C69000A9AAC9B288B20AC3CCE36ADB09CBC8BA7B +:10C6A00087AA479A0692A581647964716471857935 +:10C6B00085794471E360A250A238A2202842FCDEB2 +:10C6C000DCD676A596AD9EEFFFFFDEEFDEEFDFEF67 +:10C6D000DFE77DD79DDFBEE79EDF5DCF7ED7DFDF63 +:10C6E000DFE7DFDFDFE7FFE7FFE7FFE7FFEFFFEF72 +:10C6F000DFE7DEE7DEE7DEE79DDF7DD79DD79DD76D +:10C700009ED79ED7BED7DFDFDFDFDFE7FFEFFFF784 +:10C71000FFF7FFE79FC7DD9E1B7EFB6D5F9E1F96A9 +:10C72000DF8D5E859D6C5D64DC53BC539C4B3B3B55 +:10C730001B3B1B3B3D439E4B1F5C5D643E7DDFAE60 +:10C74000DFCFDFCFDFCFDFCFDFCFBFCF9FCF5FBF69 +:10C75000BD9EDD9EDD961E975F9F5E9F5E9F7EA7BE +:10C760005EA75EAF5EAF3EAFDDAEBDAE1EBF7FCF9C +:10C77000BFDFDFDFDFD7DFD7DFD7DFD7BFCFBFC771 +:10C780009FC7FFB6FF951F85BE53BD32BA099709F3 +:10C790009C6C7FC77FCF9FD73FC79FAE1FA69E953C +:10C7A0005E8D3D8DBF9D1FAEBFBE7FDFFFEFFEF7ED +:10C7B000FDFFDBF7DBF7DBF7DBF7DCF7BCF79CEF24 +:10C7C000DDF7FEF7BDEFFDF7DDEFFEEFFFEFFFEF6B +:10C7D000DFE77FD73FCFDFC69FBE7FBE7FB6DFC616 +:10C7E0003FCFBFE7FFEFFFCEFC8CFC841EAE9FD790 +:10C7F000FFE7DFD7BFCF9FC79FCFBFD79FD75FCF01 +:10C800005FAEDA7C198D7FDFFDF7DBEFFBEFDBEF4F +:10C81000FCEFFDEF9EDF9EBE3D8DF542B65B1DA693 +:10C82000BFDFDFDF5FCFBFBEDD7CBB5B7D53592A3F +:10C830003722DD84347C810840084331C85A6A6B52 +:10C840008B730D7C8F8C2E848B730D8467524652B4 +:10C850006339C54933AD99D6494AA120256AEEDC32 +:10C860006CDC0BDCEBDBCBDBCBDBCBD3E581C16062 +:10C87000C591E599E5998BD3ABDB8BE3ABE38ADB21 +:10C8800009CB87B267AA06A2E599E691A481A581A2 +:10C89000A5794471E360A2508230A2206A4A1CDF6D +:10C8A0009FE7BCCED4948E6BB7ADFFFFFFF7BEE71A +:10C8B0005DD79ED7FFE7FFE7DFDFBFDFBFDFBFE763 +:10C8C000BFE7BFE7BFDFDFE7FFE7FFEFFFEFFFEF08 +:10C8D000FFEFFFEFFFF7FFF7FFEFFFEFFFEFFFE7E0 +:10C8E000FFE7FFEFFFE7FFEFFFEFFFEFFFF7FFF7D8 +:10C8F000FFEF9FD7FDA63A86FA751B761E5CDD53C7 +:10C900009C4B3C3B1C3BFC3ADB32FC323C3B7D43CA +:10C91000BE4BDF53DF53FE53FC53FD74DFAEBFC786 +:10C92000BFCFDFCF9EC7DFCFDFD7DFD7FFDFFFDF90 +:10C93000DFD79FC7FDA6FDA6DD9EDD9EFD9EFD9E69 +:10C940009C967C96BD9EFDAEFDAEDCAE1DBF9FCF1E +:10C95000FFDFDFDFFFD7FFD7FFD7DFCFBFC79FBF27 +:10C960003FB7DF8D9F6C7E4B7E2AFC1198099B4B55 +:10C97000FFB63FBF5EC7BFD75FC75FC77FCF9FDF31 +:10C980009FDF7FDF7FDF9FE7FFF7FEF7DDF7DCF755 +:10C99000BBF7DBF7BBF7DBF7DCF7DCF7DCF7BCF763 +:10C9A000BCF7FDF7DDF7DDF7BCEFFDF7FEF7DEEFD7 +:10C9B000FFF7FFF7FFEFFFEFFFF7FFEFFFEFFFEFEF +:10C9C000FFEFFFF7FFF77FDF5C9DDC84FB847FB622 +:10C9D000FFE7FFDFFFDFFFDFFFDFFFDF5FCFDE9D72 +:10C9E000F8633A8DBFE7FDF7BBEFDBF7FBF7FCF72A +:10C9F000FCF7FCEFFDEFFFEF3FD71DAE7874554B12 +:10CA0000B75BD95BDA5B9A53B832582A1622B63A2A +:10CA10005D959FE7AB52200860102329C85AAB737D +:10CA2000CC734D84AF948B6B0D84E962675AE549F2 +:10CA30000231C96278D69194C318A028CAABEDE43C +:10CA40006CDC2BDC0BDCCADBAADBAADBABD309C3B7 +:10CA500087B2A8BA6BD3ABDB6ADB69DB8AE38AE314 +:10CA60006ADB29CB09C3E8BAC7B287AA0592C58198 +:10CA700084792369E360A2488130A2208A523DDF95 +:10CA80003FDF7BBEDDCED8AD6A426E631CD7BEE70A +:10CA90005DD7BFDFFFE79ED77EC73DC75DD7DBCE43 +:10CAA0001CD7DFE75ECF5DC79ED7BED7BEDFBEDF38 +:10CAB000DEDFDEDFDEE7FFE7FFE7FFEFFFF7FFF791 +:10CAC000FFF7FFF7FFF7FFF7FFF7FFF7FFEFFFE7CE +:10CAD0009ECF3DBF9B9E5A8E5B8E3B86FC32FC32C6 +:10CAE0001D3B1D3B3E437F439F4BBF4BDF53DF53FB +:10CAF000DE531E5C1D5C3C5CBC6C3E9E1EB79EC73C +:10CB00009FC7BFCF7EC75DC77EC7FFDFFFE7FFE7D9 +:10CB1000FFE7FFDFBFCF9FC75FBF1EAF3EAF3EAF98 +:10CB20003FB71EB7DDAE3EB75FC77FC79FCFFFDF02 +:10CB3000FFE7DFDFBFD7BFCF9FC77FBF5FB7BF9E16 +:10CB40005F7DDC4BFC321C1A9A0998097B43DFAEEF +:10CB50007FC71DB73DBF3DBF1DBF7EC77ECF9EDFD8 +:10CB6000DFE7FFEFDEEFDDEFBDEFDCF7DCF7DBF754 +:10CB7000BBF7BBF7DCF7FCF7DBF7DCF7FCFFDCFF10 +:10CB8000DCF7DCF7FDF7FDF7FEFFFDF7BDF7FDF77E +:10CB9000FEFFFEF7FEF7FDF7FEF7FEF7FEF7FEF7E6 +:10CBA000FFF7FFF7FFF7BFEF1DB6FB8CDB84DA84DE +:10CBB0007EB6DFDFFFE7FFE7BFDF3DAEFB84D75B7D +:10CBC000176C3CB6FEF7FBF7FBF7FBF7FBF7FCF740 +:10CBD000DBF7FCF7FCEFDDEFFEEFDFE75FD75FB6DB +:10CBE0003D8D5B6CFA5BDA5BDB5B1C6C5F8D1FCF92 +:10CBF000FFF7FBD66529200881180229A85AAB73D4 +:10CC0000CC734E844E84AB73AC7B875A4652423110 +:10CC100063390E8CB5B5A639A118E459EDD4EDEC05 +:10CC2000EDEC8CE40BDCEADBCADBA9DBAADBEBE393 +:10CC3000CBE3ABDBABE38ADB69E349DB49DB49DB15 +:10CC400049DB29D329CB08C349CB08BB469AE589E0 +:10CC50004371C260C258C2488130A3208B52FDD6B6 +:10CC6000BDC61BB67CBE5FDFBCCECC526621F38C4A +:10CC7000FFE7FFE77ED77DCF7EC75DCFD7B513A592 +:10CC80003084B6AD9FD75EC77ECF9ED79DD79DD748 +:10CC90009DD79DD75CCF5CCF5CD75CD79EDFBEE7CE +:10CCA000BEE7DFE7FFEFDFE7BEDF9EDF7DCF5DC7DB +:10CCB0003DB7FCAEDB9EDC9EDC9E7B8EBF4BBF4B4C +:10CCC000BF4BBE4BBE4BDE53DE53FE5B1E5C3E6471 +:10CCD0005D649D6CBC6C3C859FAE9FCF3DBF5DBFCE +:10CCE0007EC77EC7DFCFBFCFFCB61DC77ED7FFEFA5 +:10CCF000FFEFFFEFFFE7FFE7FFDFFFDFFFDFFFD71C +:10CD0000DFDFFFDFDFDFFFDFFFDFFFE7FFE7FFE75B +:10CD1000FFE7FFE7FFD79FCF1FB77F9EFF859F5C91 +:10CD20003D3B5C22DC119B09D811DC53DFB65FC7A9 +:10CD30003EBF5DC71DBF5EC73DBFFCB6FCBE7DD715 +:10CD40009EDFDEE7BEE7BDE79DE79CEFBCEFBBF7EC +:10CD5000DBF7DCF7FCFFDCF7FCFFDBF7DCF7DCF7ED +:10CD6000DCF7BCF7BCF7FDF7FDF7FDF7FEFFFEFFB4 +:10CD7000DEFFFEFFFEFFFDF7FEF7FEF7FEF7FDF715 +:10CD8000FDF7FDF7FEF7FFF7FED6BCA53C95DB846B +:10CD9000BB84FC843D8D7E95BC7CD863F96358745C +:10CDA0001BB6DFEFFCF7FBF7DBEFFBF7FBF7FBF75F +:10CDB000DBF7FCF7DBEFDCEFFEF7FFF7DFE7DFE7A2 +:10CDC000FFEF9FDF7FD79FDF7FDF9FE7FFEFFFF75B +:10CDD000FFF717BEA21060088118022946526A6B3D +:10CDE000EC7B6E846E842D844A6BC862C441E1285A +:10CDF0000A6BB5BDA952601080280BAC4EE52DED35 +:10CE000090F5CDE488C34BDC4BE42AE40ADCEADB92 +:10CE1000EADBAADBCBE3AAE3AAE389E369E36AE3FB +:10CE200069DB49DB49D349D38AD308BB459AE489F6 +:10CE3000E260A1508148A24061286118CC5ADCD63A +:10CE40005CBE799DDBA57DBE5FDF3ED7AF6B820008 +:10CE50002C53DBC6DFE79ED79ED79AC657D616E679 +:10CE6000AC9B89621CCF9EC75DC79DD77CCF9CD7EA +:10CE7000BDDF9CDF7CD77CD73BCFFAC63BC71BC747 +:10CE80001BBF3CBF1CBF5DC73CC75CC7FBB61CB724 +:10CE9000FCAEDBA6DBA61CAFFCA65A8EDD53DD5331 +:10CEA000FD531D5C3D5C5D647D6CDE741E7D5E85A6 +:10CEB0005E859E8D1E9E1FBFBFD7BFD79ECFBECFA4 +:10CEC000BFCF7EC77EC7BFCFDFD77ECF9BB63AAE80 +:10CED000DCC6DFE7FFEFFFEFFFEFFFE7FFE7FFE76E +:10CEE000FFE7FFEFFFEFFFEFFFEFFFE7FFE7FFE7F2 +:10CEF000DFDF5FCF1FBF5FA63E753D547C3B7A22CC +:10CF0000FB119A0979093A225D64BFB63FC75CC735 +:10CF10003CC75DC71CBF5EC75DC73CC75CCF9DD724 +:10CF20009DDF9DDFDDE7BDE79DE79CE7BCEFBBEF45 +:10CF3000BCF7DCF7DBF7DBF7FBFFDBF7BCF7DCF775 +:10CF4000FDFFFDFFFDFFFDFFFDF7FEFFFEFFFEFF06 +:10CF5000FEFFFEFFFEFFFEFFFEF7FEF7FDF7FDF70B +:10CF6000DDF7DDF7DDF7FEF7BEEF9CC61CB69CA52E +:10CF70001C8D3974B863B85BD9639B841B957DBEE7 +:10CF8000BEEFFDF7DBEFDBEFFBF7FBF7FBF7FBF7A4 +:10CF9000FBF7FCF7FCF7DCEFDCEFFDF7DDEFDDEF97 +:10CFA000FFF7FFEFDFEFFFF7FFF7FFF7FFF7FFFFF9 +:10CFB000FFFF75AD81086110A220E228264A6A6B46 +:10CFC0000D7C6E846E840C7C086367524231E649A6 +:10CFD0002F8CEA5AA1184018C77A90E56EEDAFF58C +:10CFE000B1F548A3A8BBCCE4CCEC8BE48BE44BE4D8 +:10CFF0004BE42BE4EAE3CAE389E389E369E389E3E9 +:10D000006AE369E369DB69DBAADB69CBA6AA058A67 +:10D010000261A1508148C240812841106E6B7BC6DD +:10D020001BB6967C967CB784B9A55BBEBCCE11744A +:10D0300082006519D6A5FFEF7DDF57CE3AFF14F6C3 +:10D04000EDB3066259BE1CBF3DC77DCF7CD7BCDFA8 +:10D050009CD79CD7BCD77CCF5BCF5BC73BC71AB7ED +:10D06000FAAE9A9E9A9EDBA61BAF5CB73BAFFBA6BF +:10D07000DBA6DBA6DB9EDB9E9A967A8E5E855E85BE +:10D080005E857E859E8DBE95DE95FE9D3EA69FAEFD +:10D09000DFB63FC7BFD7BFD7BFD7BED7DFD79ECF7B +:10D0A0009ECF7EC77EC7BFCFBFCFBFCFDFCF3DBF35 +:10D0B0001AA6588D99959EBE7FDFFFEFFFEFFFEF19 +:10D0C000FFF7FFF7FFEFFFEFDFE7DFDFBFDF9FD700 +:10D0D000FFBEDF95BF6CDE53BC2ADA11BA095801D6 +:10D0E00078093822BB4B7E8DFFBE7FCF3CBF9DCFE2 +:10D0F0005DC75DC75DC79ECF9DD7BDDF9CDF9CDF51 +:10D10000BDDFDDE7BDE7DDE7DEE7BDE7BCE7FCF758 +:10D11000DCF7DBF7FBFFFBFFDBF7DBF7FCFFFCF7E4 +:10D12000FDFFFDFFFDFFFDFFFDF7FEFFFEFFFEFF24 +:10D13000DEF7DEFFFEFFFEFFFEF7FEFFFEFFFDF760 +:10D14000FDF7FDFFFDFFFDF7FDF7DEEF5DDFFCD630 +:10D15000BCCE3BB6BAA57A9D9AA5FAB51CD7FEF708 +:10D16000DCF7FCF7BBEF9AEFDBF7FBFFDBF7DAF757 +:10D17000FBF7FBF7FCF7DCEFDCEFDDEFFDF7FDF78E +:10D18000DEEFDEF7FFF7FFF7FFF7FFFFFFFFFFFF21 +:10D19000FFFF34A5C2188110C220E228264AAB73D3 +:10D1A0000C7C4E840C7CAB73C8628339064A0B63DB +:10D1B000C63961104018C45170DDAFE511F693FE19 +:10D1C0000BACE2714AC42EED4EED2EEDCDE4ACE495 +:10D1D000ABEC6AE40AE4CAE369E369E389E38AE35E +:10D1E00069E389E369E348DB69DB69D307BB259A17 +:10D1F0004369C250A148A24061206210B07378A573 +:10D200001CAE977C566CD463146CD784BAA5DDCE63 +:10D2100097A5C729C30854A55BEFD8EE18FF91ED79 +:10D22000ACB3A559D6AD3CC73CBF3CBF5CC77CC7BF +:10D230007CCF9CCF7BCF7BCF7BC77BCF9CCF7BC76B +:10D24000DAA69996BA96998E9A96BA96DA96999699 +:10D25000DA96FB9EDB9E798E9A8E5986BFB6BFB654 +:10D260005EA65EA6BFB6DFBEDFB61FBF3FC75FC705 +:10D270007FCFBFCFBFD7DFD79ED7BED7DFD77DC782 +:10D28000FCBE5DC77ECF7EC73EB73EB77EBFBFC781 +:10D29000BFD75FC73CAE7995188D5895B9A53BB6F9 +:10D2A0007CBEFFCE3FD7FEC67DB63DAEBC9D1B8586 +:10D2B000D953183B5722D711D811F9197B2A9E4B05 +:10D2C000BF74DF959FAE1FC77FCF7DCF3CC77DCF9B +:10D2D0003CBF1CBF3CC77CCF7CD7BCE7BCE7BCDFF6 +:10D2E000DDE7DDE7DDE7DDE7BDE7BDE7BCEFDCF768 +:10D2F000DCF7FCFFFBF7FBF7FBFFFCF7FCFFFCF7A1 +:10D30000FCFFFDFFFDFFFDFFFEFFFEFFFEFFFEFF3A +:10D31000FEFFFEFFFEFFFDFFFEF7FDF7FEFFFDF740 +:10D32000FDFF18D713B694BE99E7FCF7FDF7FDF79C +:10D33000DEF7DEEFBEEFBFEFBEEFBDF7FCF7FCF7A9 +:10D34000FBF7FCF7DBEFBBEFDBF7FBF7DAF7FBF7FD +:10D35000FBF7FBF7FCF7DBEFDCEFDCEFDCF7FDF7CF +:10D36000FDF7FDF7FEFFFEF7DEF7FEFFFFFFFFFF15 +:10D37000FFFFD6BD0321C2184531A539A4394A6B38 +:10D38000CC7BEC7BCC7B4A6BA441C541685203212A +:10D390006118401863498EBC12EE31EED5FED2E51D +:10D3A000C26989A3EDDC6FED4FED8CD48BDCECEC26 +:10D3B000CBEC6AEC2AE4CAE389E369E389E369E335 +:10D3C00069E369E369E328DB28D328D3E7BA66A2D7 +:10D3D0006371C150A148C24041206210117C78A500 +:10D3E000FBAD977C366C935B735BF46BB7843CB698 +:10D3F0009FE7DCCE2D5B8108909C59FF33FEEFDC6C +:10D400000993434137BE9DD7FBB6DAB6D9AEFAB61B +:10D410001AB71ABF5BC75BC73BBF5BBF5BBF1AB71F +:10D42000FAA6FAA6FA9EBA8EBA96BA8E998E998EF6 +:10D43000788EFA96B98E78869986587E7FCF9FD758 +:10D440005FC77FCFBFD79FD77FCFBFD77FCF7ECFDD +:10D450007EC79ECF9ECFDFD7BFD7BFD79ED77DC712 +:10D460007DC77ECF7ECF3EBF3EB7FDAE1DAF7FBF37 +:10D470007FCF9FCFDFD7DFD77FCFDDB6D99D388570 +:10D4800076747774776CF55B9553554B1543D532AD +:10D49000D632D6325843FB53BC6C9F853F96BFA60D +:10D4A000DFAEDFB61EBF3DC73DC73CC71CC7FCBED5 +:10D4B0001CBF3DC73CC77CD7BCE7DCE7BCE7DDE76A +:10D4C000DCE7BCE7BCE7DCE7DCE7DCEFDCEFDCEF6C +:10D4D000DCF7FCFFFCFFFCFFFBF7FBF7FBF7FBF7C0 +:10D4E000FCFFFCFFFCFFFCFFFDFFFEFFFEFFFEFF5D +:10D4F000FEFFFEFFFEFFFEFFFEFFFEFFFEFFFDFF45 +:10D5000038D7E9634A8D8B8D6D95B9E7FCF7DCEF71 +:10D51000BCEFBCEFDCF7DDF7FCF7FCF7FCF7DBF763 +:10D52000DBEFFCF7FCF7FCF7DBF7DAF7DAF7FBF7F2 +:10D53000FBFFFBF7FBF7FBF7FBF7DBF7FCF7DCF791 +:10D54000FCF7DCF7FCF7FDFFFDFFFEFFFEFFFEFF33 +:10D55000FFFFDAD68531C218A639AE7BC541885A9D +:10D56000AC7B6B73C962A4396439A539A218201049 +:10D5700020180241CAABD1ED93F616FFD6FE699B87 +:10D58000868A2CC42FED4FED2BC488AB0CEDEBEC51 +:10D59000AAEC69EC4AECC9E389DB69E369E369E376 +:10D5A00069E349E369E348DB08D308CBC6B2459A8F +:10D5B000A471C150A148E24861200421F17BB9ADBA +:10D5C00039957774B45BB03AD142114BF56B5995EC +:10D5D0003CB65FDF7FE7928C44292E9C50ED4DD402 +:10D5E0002672C6491AD79DD79CCF7CC73ABF5BBF6E +:10D5F0005BBF3BBF1AB7FAB6FAAE1BAF1AAFD9A6DC +:10D600001BAF1BA7B996B996FA9EDA96B98E988E7B +:10D61000988E988E7886988E988E9886BED77DC77D +:10D620007DC7BECFBECF9ECF5DC7BFCF9ECF5EC7EB +:10D630003DBF7EC77EC75DC77EC79ECF9ECFBFCF93 +:10D64000BFD79ECF9FCF5EBF3EB7FDAEFDAE5FBFE3 +:10D650007EC79FCF7ECFBFD7BFD7DFD7FFD7BFD77C +:10D66000BFCF3FC7FFBEDFB69FAE5FA61F9EDF8D59 +:10D670005F9E5F9E3F9EBFAE3FBF3FBF5FBF3EBF4F +:10D680005EC77ECFBFDFDFDFDFE7DFDFDFDFBED7F5 +:10D690007ED75DCF9DD7BDE7DCE7DCEFDCE7DCE7DD +:10D6A000FDE7BCDFBCE7DCE7FCEFDCEFDCEFFCF721 +:10D6B000FCF7FCF7FCF7FCFFFBF7FBF7FBF7FBF7CE +:10D6C000FCFFFCFFDBF7FCFFFDFFFDFFFDFFFDFFA7 +:10D6D000FBF779E779DF39D7B7C6D8CEFDF7FDF785 +:10D6E00095BEC75B2C96A9858B8D14C7FBF7DCF71D +:10D6F000DCF7DBF7BBEFDBF7DBF7DBF7DCF7BBEFE8 +:10D70000DBEFDCEFFCF7FCF7DBF7DBF7FBF7FBF716 +:10D71000FBFFFBF7DAF7FBF7FBF7DBF7BBEFDBF71A +:10D72000DBF7DBF7DBF7FCFFFCFFFDFFFDFFFDFF99 +:10D73000FDFFBCF7A9526108A210CE7B509447525E +:10D74000885A4752E2208118E320611040102018C7 +:10D7500064516AA34EE551FED4FEB4F68DBC089325 +:10D7600049ABEBC3CEDCCABB448A4BCC0CEDAAEC74 +:10D7700089EC69EC2AECEAE3CAE389E349E349E38B +:10D7800069E369E369E369E328DB28D3C7BA259A2B +:10D790008371C150E250034961186631117C3BBE70 +:10D7A000B7843674935B8F3A2E2A6F327353977C0B +:10D7B0009684789D9DC67FE7B7AD28526BA38BAB4F +:10D7C000E13823310A630A5BF18CD9BE7BCF1ABFE3 +:10D7D0005BBF1AB73BB7B9A6DA9EDA9EFAA65BAF73 +:10D7E0005BB719AFD99EB896D89EF99E19A7F89E37 +:10D7F000D896D796D796F796D796B68E7DBF3CBF6C +:10D800007DC75DBF1CB73DB73DB75DBF5DB73DB7D9 +:10D810003DBF7EC75DBF1CB73DBF3DBF9EC79ECF0E +:10D82000BFCFBFCFBFCF5EBF5EBF3DB71DAFFDAEA9 +:10D830001DB77EC79FCF9FD79FCF7EC79FCF7FCF7C +:10D840007FC77FC79FCF9FCF7FC77FBF3FB7FFAE49 +:10D850001FAF1FB71FB75FBF9FC79FCFBFDFFFEFD0 +:10D86000FFEFFFF7FFF7FFEFFFF7FFF7FFF7FFF718 +:10D87000FFF7FFEFFFEFFEEFDDEFBDEFBCE7BCE72B +:10D88000DCE7BCE7DCEFDBEFDCEFDBEFDCEFFDF749 +:10D89000FCF7FCF7FCF7FBF7FBF7FBF7FBF7FBFFED +:10D8A000DBF7DBF7DCF7FDFFFDFFFDFFFCF7D5C67F +:10D8B00071AE70AE8E8DAB748F95CD7C929DFCF762 +:10D8C00099E70D85A764CA850B96D1B6FAF7FBF7E1 +:10D8D000DBEFDBEFDCF7DCF7BCEFDCF7FCF7DCF7CA +:10D8E000FCF7FCF7DCEFDCF7FCF7FBF7DBF7FBF70B +:10D8F000DBF7DAF7DAF7FAF7FBF7FAF7DBF7FBF71C +:10D90000FBF7FBF7DBF7DBF7DCF7DCF7DCF7FCFF1B +:10D91000DCF7FDFF73ADA110821024210F8CCA62C9 +:10D9200003298118401061104110201061282772CE +:10D930008CB330ED31FE70FE71F6CFED2ABC48ABF2 +:10D9400028AB8AB3658A205947AB0CEDCAECA9EC29 +:10D9500089EC69EC09E4E9E3CAE3AAE369E349E392 +:10D9600069E369E349DB49DB29DB29D328CB87AAB3 +:10D970008379E1580251E2406118042152841BB6B8 +:10D98000567CD463314B4E2A8B192E2AD142D46354 +:10D99000F463146CD68499A5DDCE7ACE8E7BC6490D +:10D9A00000100139867A08838018263A77AE1ABFAC +:10D9B0003ABF5CBF3BB7B99E588E9896F8A639AF70 +:10D9C00018AF17A717A717A717AF17AF37AF36AFFF +:10D9D00036AF36AF36AF36AF56AF56AF1CAFFBAE35 +:10D9E0001CB73DB71CAFFCA6DBA61CAF1CAFDBA66B +:10D9F0003DBFBFCF5EBF1CB71DB79EC79FC75DBFF2 +:10DA00003DBF3DBF5EBF5EBFDFCFBFCF5EBF5EB776 +:10DA10009FC75EC75ECF7ECF5EC73EBF5EC75EC795 +:10DA20005EBF3DBF5DBF5DBF1DB71DAFFDAE1DAF8E +:10DA30001DAFFDAE7EBFBECFDFD7FFE7FFEFFFF725 +:10DA4000FFF7FFEFFFEFDEE7DEE7DEE7DEE7DEE72B +:10DA5000DFEFFFEFFFEFFFF7FFF7FEF7DDEFBCE7CC +:10DA60009CE7DCEFBCEFDCEFDCEFBBE7BCEFDCEF0F +:10DA7000FCF7FCF7FCF7FCFFFBF7FBF7FCFFFBF701 +:10DA8000DBF7DBF7FBF7FCFF38D717CF52AE8D8DF6 +:10DA90008FA6AB852B7D309E15C7B0958D7CFBEF97 +:10DAA000FBF7F3BEEC8D0FAF6C9ECA8D54CFB8E779 +:10DAB000FBF7DCF7DCEFBCEFBCEFDCEFDCEFDCEF1F +:10DAC000DDF7FCF7DCEFFCEFDCF7FCF7FBF7DBF74F +:10DAD000DBF7DBF7FBF7FAF7DAF7FAF7DAF7FAF73B +:10DAE000DAF7DAF7DBF7DBFFDBFFDBF7DBF7DBFF90 +:10DAF000FBFFFBFFFCFF4E8C60080000E320C639F3 +:10DB0000C220611040082008200803316559688A46 +:10DB100026928ABB8FEDD3FE92FE10EE2DE56BD4DC +:10DB200068BB238A237AA9ABECDCCBE4AAE4A9EC9A +:10DB3000A9EC69EC09E4C9E3CAE3A9E369E349E3B1 +:10DB400049E369DB8ADBCBE3CBE38AD3A7BA069A46 +:10DB5000847902590351C23840102521359DB9AD51 +:10DB6000F46B72536E32EC218B192D2AD042725312 +:10DB7000B35B514BD363967C3895BDC69CC651842C +:10DB8000AD7B93CD70E530DD676A20086B5B3AC7EB +:10DB90005AC73ABFF8AED79EB79EF79E37AF57AF7A +:10DBA00057B756B756B756B756B755B775B776BFC6 +:10DBB00096BF96BF95BF95BF95BF95BFDB9EDA9E7A +:10DBC000DA9EFBA63CAF1CA7FBA6FCA61CA7BA9E30 +:10DBD000FCAE7DBF7DBF3CB73DB79EC77FBF5EB784 +:10DBE0001DAF5EBF3EB75EBFBFCF7EC75EBF5EBF2D +:10DBF0009ECF9ECF9FD77ECF3EBF3DB75EC75DBF56 +:10DC00005EC77EC77EC75DBF5DBF3DB71DAF1DAFA1 +:10DC10005EB77EBFBFCFDFDFFFEFFFF7FFEFFFE7AE +:10DC2000DFDFBED79DD7BED7BDD79DD79DDF9DD7A0 +:10DC3000BDDFBDDFDEDFFEE7FEEFFEEFFFF7FEF745 +:10DC4000DEEF9CE7BCEFDCEFBCE79BDFBBE7BCEFA4 +:10DC5000FCEFDCEFDCF7DCF7FCF7FBF7DBF7DBF7DF +:10DC6000FCF7FBF7FAF7B09D664BA64B26548F9E48 +:10DC7000AA7DCC8D0C85D9E778D7B2A5D7CEFBF796 +:10DC800034CF8C8D8A7D0FA7EDA62996E98D8B8DDB +:10DC9000D5C6DCEFDCEFDCEFDDF7DDF7BCEFBCEF8A +:10DCA000DCF7BCEFDCF7FCF7DCF7FBF7DBF7FBF7A7 +:10DCB000DBF7DBF7FBF7DAF7FAFFDAFFDAF7DAF789 +:10DCC000FBFFFBFFFCFFFCFFFBFFFBFFFBFFFBFF82 +:10DCD000FBFFFAFFFBFFFCFF52AD8852A1102000B2 +:10DCE00060086108C218E6390E8457DEEDB3A479E6 +:10DCF000805860586269AAA395F6D5FECFED4DED28 +:10DD0000CADCAADC8EEDAEF52CE5EAE4CAE4CAEC86 +:10DD1000AAEC49E4E8E3C9E3A9E389E369E38AE318 +:10DD20006ADB8ADBEBD3CAC38ABBE8AA069A858979 +:10DD300043710359035181304010083A97AD579D04 +:10DD4000D36B314B0C2ACB196A11EC21AF3A9253A9 +:10DD500091533043314BB35B55749A9DDBA53BB671 +:10DD6000F8BDB8E6D2ED2FE58A9B4020A439D4ADAA +:10DD7000B6B616B714AF54AF54AF75B774B754AF47 +:10DD800054AF54AF54AF54AF54AF54B754B754B763 +:10DD900013AFF2AEF2A6D2A691A6709EBA96BA962C +:10DDA000BA96DB9EDB9EBB9EDB9EFCA6FB9EDB9EAB +:10DDB0001CAF3CAF3CAFFBA6FCAE3DAFFDAE9B9EA7 +:10DDC000DCA65FB71DAF3EB79FC75EBF5DBF7EC716 +:10DDD0007ECF9FD7BFD7BFD77EBF3DB73DBF7ECFDA +:10DDE0007EC75DC79EC77DC75DBF5CBFFCAE5DBF24 +:10DDF0009EC7FFD7DFD7FFE7FFF7FFF7DFDFBED70D +:10DE00009ECF7DC79DCF7DC77DCFBDD7BDDFBDD7A1 +:10DE10009DD79DD7BDDFDEDFDEE7DEE7DEEFDEEF9D +:10DE2000FEF7FEF7FDF7DCEF7BDF9CE7DDEFFCEFB5 +:10DE3000FCEFDCEFDCF7DCF7FCF7FCF7DCF7DBEF03 +:10DE4000FCF7FBF7F0A52343297529754975286D63 +:10DE5000897D0D964E8DFCEFDBEFFCF7FBF751AEA5 +:10DE60008B8DEB8DE86C0FA74EB72CAF2996856490 +:10DE70000D85DBEFDCEFDDF7DDF7DCEFBCEFBCEFB2 +:10DE8000BCEFBCEFDCEFBBEFDBF7FBF7FBF7FBF71F +:10DE9000DBF7DBF7DAF7FAFFFAFFFAFFFBFFFBFF2E +:10DEA000FBFF78F733CE2FADAC9CCC9CCD9C4EAD18 +:10DEB000B0BD8FB5D1BD74D6F7E6D7DE15C611A5B6 +:10DEC000708C909474ADD9DEFDFFDCFF76FE29A343 +:10DED000E691E270404840380DA4DBFFD4FE8EE5A9 +:10DEE0002BED4BEDADF5CEF5AEF58DF54CED0BED27 +:10DEF000CAECAAEC49EC09ECE9E389DB89DBAADB93 +:10DF0000CBE3CAD3CAC32BC4CED4C79AE27065810F +:10DF1000C260E258034961206110CC52D9ADD68C61 +:10DF2000925BF0422C2AAA1949116A110C2A30433B +:10DF30002F43EE3A104331435253F563977C3895A3 +:10DF4000748454B5F7FED1ED2CB48030A1288F94A1 +:10DF5000AA6BF09DD1A6F09EF0A610A7F0A6F0A6A1 +:10DF600031AF31AF11A7F0A6AF9E4E96EC8DAB85C9 +:10DF70008B856A858B858B858B8DAB95BA961CA717 +:10DF80001CA7DB9EFC9EBB96DB9EDB9E1CA7DB9E3C +:10DF9000DB9EDA9EBA96BA96DB9EBB9E9B969B96BC +:10DFA000BC9EDD9EDDA6FDAE5EBF5EBF5EBF5DBFFB +:10DFB0007EC7BFD7BFD79ED79EC77EC79ECFBFD7CE +:10DFC0009ECF3CBF7DBF5CBF7DC77DC75DC77DC7A2 +:10DFD000BECFFFD7FFDFFFEFFFEFBEDF9ECF9EC7B5 +:10DFE0005DBF1CB73CB71CB77DC7BED7BDDFDDDF4B +:10DFF0009DD77CCF9DD7BDD79CD79CD7BCDFBDDF3D +:10E000009CDFDDE7FEF7FDF7BDEFBCE7DCEFDBEF04 +:10E01000DCEFDCEFBBEFFCF7FCF7DCEFDCEFFCF751 +:10E02000DBEF77DF0564277DCBAEECA6AA7D044449 +:10E03000AE9EAC8D9095FCE7FCEF98D72C85297DA2 +:10E040008CA68B9E865CEFA64EB74EB7CCA6255C01 +:10E050002A6CBBE7DCEFBCEFBCEFBCEFDCF7DCF716 +:10E06000DCEFDCEFDCF7DCF7DCF7DBF7DBF7DBF72B +:10E07000DAF7FBFFFBFFFBFFFBFFFBFFFCFF34C6F8 +:10E08000EB8BC46AC36A6483A583E58BC583889CD4 +:10E090002BB54DBDAFC5B0C5B1C591BD0FAD50B528 +:10E0A00097DEFDFFFEFFFEFFFDFFDCFFBBFF31D56E +:10E0B00088A2E69961584040034136E6BAFF32EE45 +:10E0C0006CED4AED6BEDEEF570FE70FE0EFE8DF51B +:10E0D000EAECC9EC69EC49EC0AECC9E3EAE30AE4CE +:10E0E000E9D32ACC6EE532F674FE089B4371A5890C +:10E0F000C260E258034961208218D073F9ADB5843B +:10E10000715BAE424C32CA2169196911EB21CE42D2 +:10E110002E43AC32AE3ACF3A314B7353F56376743B +:10E120003374F17B5BFF96F68EC4E0488030EA7270 +:10E130002552275BB0A6CF96AE968E964C8E2C8E2F +:10E14000EB85AA7D8A85898589852785267D268513 +:10E15000678DC89DE9A509AE2AB64AB6FB9E1CA7E5 +:10E16000DB9EDB9E3CA7FCA6BA9EDB9EFB9EDB9E55 +:10E17000BA96BA96DA96DB96BB96BB96BB96BC96D9 +:10E18000DC965B8E9B96DCA61DB7FCAE3DB75EBFF2 +:10E190005DC77ECF9ED79ECF5DC79ECFDFDFBED748 +:10E1A0009FD77EC79EC77DC77DC7BECFDED7BECFF8 +:10E1B000FFD7FFD7FFE7FFEFFFE7BED77DC75DBF04 +:10E1C0005DBF5DBF1CB73DB73CBF7DCF9DD79DD721 +:10E1D0005CC75CC79DD7BDD77CCF5BCF7CD79CD7B6 +:10E1E0005BCF9CD7BDE7DDEFFEEFFDF7FDF7DCEF82 +:10E1F000DCEF9BE7BBEFFCEFDCEFDCEFDDEFFDEFEF +:10E20000FCEF93BEE4538BA6CAA6288EA13B286DD3 +:10E2100050B70A75D29DFDEF18CF2B644B7DCEA66B +:10E220004DB70DAF244C0C8E70BF0EAF697D6443AB +:10E230007095FCEFDCEFBCEFBCEFBCEFDCEFDCEF8C +:10E24000BCEFDCF7FDF7FCF7DCF7DBF7DBF7DBF720 +:10E25000DAF7DAF7FAFFDBFFFCFFF8E64973403143 +:10E26000435A467B65838483C58BC48BC48B2594BA +:10E27000479C0BBD51DE32DEEEBC0EBD6FC58CA4DB +:10E280002873F0AC7BF7FEFFFDFFFDFFDCFF7BFF9B +:10E29000CDBB479A2471614860380B83DCFF58FF7F +:10E2A000AFED8CED8CEDEDF550FE50FE0FFE8CF5D4 +:10E2B0000AEDC9EC89EC49EC29ECE9E32AE42ADC13 +:10E2C0008BDC6EED73F6F5FED6FE25728481C68971 +:10E2D0002369C250C2408120C318359D1AB6B58447 +:10E2E000D263AE3A2C320B2ACA21AA19CA218C3A1F +:10E2F0004E4B8B32AD322C22F0425253D463156C0C +:10E3000055746F6399DED8F66FBC01516038A97AF5 +:10E31000276200212A7DCA7D887D677D877DA88D43 +:10E32000A88DE99D0AA64AAEACBEABBECCC6ECCE6B +:10E330000CD7ECD6CCD6ABCEABD68AD6DA9EDB9E4B +:10E34000FBA61CAF1CAFFCAE1CAF1CAFFCA6FB9E1B +:10E350007A8E9A8E9A8E7A867A867A867A869B8E3C +:10E36000DC96DC9EFDA61DAF3DB71DB71DB79EC751 +:10E370005EBF5DBF9ECFBECF7DCF7ECFDFDFBFDF75 +:10E38000BFDFBFD7BECF7DC77DC7BECF5CC7BECF07 +:10E39000FFD7DFD7FFEFFFEFDEDFDED7BECF5DBFFA +:10E3A0005DBF3DBF1DB75DB7FCAE1CAF5CBF3CBFE2 +:10E3B0005DBF7EC77DCF7DCF5CC79DCF9DCF5CC746 +:10E3C0005CCF7CCFBDD77CD79CDFDDEFFEF7DCEFE9 +:10E3D000BCEFBCEFDCEFDCEFDCEFDCEFDCEFDCEF25 +:10E3E000FCEF53AE67640B8E6B96A45C813B6D9E15 +:10E3F00010B7686434AEFEF7CF8447436D85EC8D6B +:10E400002EAF4FB7244C297550B70975A64B4F8DC9 +:10E41000DBE7DCEFDCEFBCEFBCEFBCEFBCEFBBEF4E +:10E42000BBF7BBF7DCEFDCF7FCF7DBF7FBF7DAF762 +:10E43000DAF7DAF7FBFFFCFF56CEA239C028468395 +:10E440006683E46AE46AE36A44736473A483E58BD5 +:10E4500068A4CFD52FC589934CBCB1E5B5FE17FF95 +:10E4600076E693BD909C0E8433AD1AE7FEFFFDFF68 +:10E4700098F6C98AE78981586140E24036D6FBFFA9 +:10E48000B4FE0FF6CDED8CEDCDEDAEF5ADF54CED6A +:10E490002BF50BF5A9EC49E46AEC4AE48AE4CCE4F8 +:10E4A0002DEDF1ED37FFDBFFD4D5E14885796479B7 +:10E4B0000369E250E2388118A63139BE3AB6B58414 +:10E4C000136CEF426C322B2AEA29EA21CA214B3223 +:10E4D0006E4B8B2AEE3A2C224E32F0427253F4638A +:10E4E000F463705BB6BDFAF64FB4C14860382B8B4D +:10E4F000686A4018855BEA9D089E48AEEAC60BD75D +:10E500000BD72BDF2CE72CE70CE7CBDEABD66BD69B +:10E510006BD64AD64ACE6AD66AD66AD6FAA6D9A6A3 +:10E520001AAF3BAF1BAFFBAE5CBF7DBFFBA69A969D +:10E53000798E9A8E9A8E59865A867A867A865A86E5 +:10E540007A8E9B96BC9EDCA6FCAEFCAEFCAE1CB7E5 +:10E550003DB71CB71CB75CC75DC79ED7BED7DFDF12 +:10E560009ED7BED79ECF5CC79ECF7DC77DC79DCFB0 +:10E57000FFD7DFD7FFE7FFEFBEDFBED7BECF7DC738 +:10E580009DC75DBF1DB73DB71CAF1CAFFBAEFBAE5B +:10E590001CB73DBF7DC79DCF5CC79DCF7DC75CC706 +:10E5A0007CC79DCF9DCF5CC77CCF9DDFDDEFDDEFCE +:10E5B000DCEFDCEFDCEFBCEFFDEFFDF7DCEFDCEFD9 +:10E5C000FDEF94B60754A65CEB85A13BC664EFAEA5 +:10E5D000CD8D6A6CBBE7FDEF18C7B1958E85264CD3 +:10E5E0006C9650AFC3438A7D4D968443EC7454AE11 +:10E5F0009ADFBCE7DCEFBCEFBCEFBBEFDCEFBBEFBF +:10E60000BBF7BBF7BBEFFCF7DBF7DBF7FBF7DBF7A1 +:10E61000FBFFFBFFBBF7F4C54131E028478B468B7E +:10E62000A372E46A4673266B056B046B447B858397 +:10E630004DBD4FC5A67A8EC4B2F512FE74FEB5FE6E +:10E6400059FFDCFF9BFFD5C56C73064A2B6B94BD4D +:10E650007CFFD5DD68824469814060304C7BFCFFE3 +:10E6600079FF73EEF0E530F6EFF5ADED6CED2BEDE7 +:10E670002BED0BF5EAECAAEC8AEC8AE4CBEC4DED41 +:10E68000AFED94F6BAFFDDFF2FA4803864714371BB +:10E69000E260E248C230A2186A4A9BC6F68C336C2C +:10E6A000915BEF428D3A2B2AEA21C921A9194B2A05 +:10E6B000AF536A2A2F434D220C2A8E3A8E3ACF420C +:10E6C000304BEE4AF49CDAEECEA3A04040308C935F +:10E6D000A97A20188352CCAD0DD70CDFEADEC9DE53 +:10E6E000A9E6A9E689E68AE68AE6ABE6ABE6ABE60A +:10E6F000ACE6ACE6ACE6ACE6ACE6ACE617B758B7D1 +:10E7000039B738B759BF7ABF3ABF5BB7FAAEDAA6A6 +:10E71000DBA61CA79A967A8E39865A869B8E3A86F5 +:10E720009B969B96BB9EFCA6BB9EBB9EFBA6FCAE8F +:10E73000FCAEFCAEDBAE5CBF9ECFBED77ECF5DCF66 +:10E740005DC73CC77DCF9ECF7DCF5DC77DCF9DCFC1 +:10E75000DFD7FFD7DFDFFFE7DEDF9DCF7DC79DC7B8 +:10E760009DBF1CB73CB77DBF7DBF3CB7FBA6FBA6DA +:10E77000FCAEFBAE3CBF3CBF3CBF5DBF3CB75CBF2B +:10E780003BB75CBFBEC75DC75DCFDEDFBDDFBDE7AA +:10E79000DDEFDDEFDCEFDCEFFDF7FDF7FDEFFCEF8C +:10E7A000DCE799D7AF8DCD854D8E402BC97D2C8E62 +:10E7B000E753D5BEFDEFFDEFFDEF57C74B7D497524 +:10E7C00030AFEB8541338E96EB8DC343AA64C953BA +:10E7D000B39DFCEFDCEFBCEFDCEFDCEFDBEFBBF776 +:10E7E000BBF7BBF7BBF7DBF7DBF7DBF7DBF7DBF7F9 +:10E7F000FCFF39E794BD623960202783068B647281 +:10E80000846AC5728462A56A8462635AE472E8937A +:10E8100050C5246A4CC4D2FDD1FDD1FDF1FD33FEBB +:10E8200094FED6FE79FFFCFFFDFF53BD8451A1305D +:10E83000065A73C512BD0662E250A140223977DE46 +:10E84000BCFF39F758FF98FFD4FEEFEDAEF52BE58E +:10E850000BED0BED2BED4CF52CED0CED4DED6EEDC8 +:10E86000F1ED17FFDCFF7CFF686AA2404469236971 +:10E87000A1500349E328C318AF739BCE53741364AC +:10E88000304B8D324C2A2B2AEA21CA19AA196C2A3C +:10E89000B0534A220F3B6D2A0C2A6D3A6D3A2C3246 +:10E8A0004D3A6B3AEF7B1BF76C938038A0388FACF6 +:10E8B000A972402062496362E6834CCE4AD68ADE62 +:10E8C000ABEEABEEABF6CBF6ACF6CCF6CCF6CCF6CC +:10E8D000CCF6CCF6ACEEACEEACEEACEE34C754C736 +:10E8E00054C734BF56CF76C757C738BF59BF7ABF52 +:10E8F0003AB73BB73BAFFBA6BA9EFCA69A96BB9E27 +:10E90000BB9EDB9EFCA6DB9EDBA6FBA6FBA6FCAEAD +:10E91000FCAEDBAEDBAE7EC77ECF3DC75DC75DC75D +:10E920001CBF1CB75DC77ECF5DC79ECFBECF9ECF3D +:10E93000BECFFFD7FFDFFFDFFFDF9DCF7DC75CBF0F +:10E940001BB71BB73CB75CB73CB73CAF1CAF3CAF89 +:10E950003CAF7DBF7DBF5DBF7CBF5BBF7ABF3496E0 +:10E96000D285727DFBAE5DBF9DCFBED79DD7DDE763 +:10E97000FEEFDDEFDDEFDDEFFDEFDDEFDDEFDDEFF6 +:10E98000FDEFF39D495C2A756A75C33BA97DE4439D +:10E990008A6C308DF08CFCEF38CF4D85ED8D50AF0B +:10E9A000CF9E6133C664AD9EAEA66FA6CF8D6B645D +:10E9B000F8C6DCEFDCEFDCEFDCEFBBEFDBF7BBF73F +:10E9C000BBF7BBF7BBF7BBF7BBF7BBF7DBF7FCFF4E +:10E9D000D8DEB4C5A8622018E261E68AA261E369C4 +:10E9E000856A8562856A245AA1496462677B0DB590 +:10E9F000A672089350F570FDB1FDB0FD90FDD0FDFD +:10EA000011FE53FE75F659FFDCFF3AFF2EB44B9B07 +:10EA1000887A6349097BE97A02510351A0384F9CF7 +:10EA2000DDFFFDFFFBFF78FFF4FE71F6EFEDCDEDAE +:10EA30008DED4CED6DEDAEF5AEF56DED6EEDAFE53A +:10EA400074EE7AFFDDFF58DEE33803494461036169 +:10EA5000E250C659E320E418149D9CC6336C304B39 +:10EA6000AE3A2B22EA210B22EB21AA19CB194C2A10 +:10EA70008F4B291AEE3A8D2A0C2A2C324C320B324B +:10EA80002C32EA316D73FBF6EB826030845177EE05 +:10EA9000C9726028235166720031ADC5AEE6ACEE96 +:10EAA000CCF6CCF6CCF6ACF6ACF6ACF6CCF6CCF6B6 +:10EAB000CCFECCF6CCF6CCF6CCF6CCF690E790DFDC +:10EAC00070DF70DF70DF71DF72D753D754CF56C756 +:10EAD00057BF38BF59BF59BF3AB75BBFDAAE3CB773 +:10EAE0001BB7FBAEBAA6BA9EFBAEFCAEDBAE5DBFFB +:10EAF0005DBFDBAEDBAE5DBF5EC73DBF5EC75DC762 +:10EB00003DBF3CB75DC71CBF3DBFBECFBECF5DC7DD +:10EB10005DC7BECFFFD7FFD7FFDFFFDF9DCF9DC70C +:10EB20007DBF5CBF5CBF5CB71BAFDAA63CAF3CB738 +:10EB30005CB75CBF3CB77CBF5ABF37B7D2A6CD85A8 +:10EB40006D75AC5CD9AE1BB7B8AE7BCFDDDFFDE732 +:10EB5000DEE7DEE7FEEFFEEFDEEFDEE7DDE7DDE737 +:10EB6000DCDFA9530A6D2C8E286DE3434C968B8510 +:10EB70000C7D68533195FCF7F3B60D8E30AFAD9E2A +:10EB8000C33B44548B9EABA60C9E2B850E7DF8BEDA +:10EB9000FDE7BCE7DCEFFDF7DCF7DCF7DCF7DBF7E4 +:10EBA000BBF7BBF7BCF7BBF7DCF7FCFFFDFF3AEFA9 +:10EBB00053BD4FA4A0208028A68A037A8161046AED +:10EBC000446A2462456AA251C351E7722A8C2B9C85 +:10EBD00021516ECC0FF52EFD2FFD2FFD8FFD90FDE9 +:10EBE000D0FD11FE12F6D6FE9AFF7BFF32CD4AA36E +:10EBF000CCBBCCC3C89A678A8048E25022510662D7 +:10EC000094D5B4D555E616FF14FFF3FED1FE90F669 +:10EC10002FF6EEF5EFF5EFF5AEF5CFF5CFEDF1E52B +:10EC2000F7F6DCFFDDFF50A40020E3482361025922 +:10EC300044598651C3200519F9B57BC6136C0F439F +:10EC40004C2AEB21AA19EB21EB19CA19EC194C2A11 +:10EC50008F4BC819CD326D2AEB210B2A2B320B3288 +:10EC60004B3A6721319499E6897220206B7B3AF701 +:10EC7000EA7A4028E569E88A60204994CEEEACEE55 +:10EC8000CCF6CCFECCFEACFEACF6CCF6ACF6ACF6DC +:10EC9000ACF6CCF6CCF6CCF6CCF6CCEE6EEF6EE75E +:10ECA0008FEF8FEF8FEFB0EF91E791E772DF73D7C0 +:10ECB00074D754CF95D796CF77CF78CF58C79ACF00 +:10ECC0007AC75ABF1AB7FAAE3BBF3BBF3BB71AB7BA +:10ECD0005BBF3BBF1ABF5BBF3BBF1ABF5BC73AC737 +:10ECE00019BF5ABF5AC719BF19BF5BC75BC73BBF24 +:10ECF0003CBF1BB77DBFBECFFFD7DFD7FFD7DECF6F +:10ED0000BECF9EC7BDC79DBF1BAFFBAEFBA61CAF52 +:10ED10005DBF1BAF1BAF5BB7717DAF854D96EFA697 +:10ED2000CC85719679B75375D48D728575A6D7B693 +:10ED30007BCFFEE7BDDFBEE79DDFBEDF9DD79CD763 +:10ED40009BD7C94BAB7D2FAFAA7D044C8F9E2B7DEB +:10ED50002E85B5BEFBEF35CF6F9E6D960FA7855400 +:10ED600045548D9E8AA6A88D6B8D73B6DBE7FDE7B3 +:10ED70009BD7DCE7BADF39D77ADFFDF7DCF7DCFFBA +:10ED8000FDFFFCFFDCFFFCFF59F7B8DE37CE2F9408 +:10ED900012BD07626018013966826169A2618572DD +:10EDA0004362035A62492041C359E66A2B94656263 +:10EDB000C4718FE4EEF40EFDCDF4CDF42EFD2EFDE6 +:10EDC0006FFD90FDB0F595FE59FF9BFFF8FE2EB448 +:10EDD000C89A4AB30DCC0ECC0A9BE2506459C14884 +:10EDE0008040A040C361F1DD35FF34FF33FF12FFE7 +:10EDF000D1FE2FF6EFEDCFED8EEDCFEDF0EDB4F6C9 +:10EE00007AFFFDFF1AF7075A0028A248E258E2509D +:10EE10000349A328E42087299CCE98A5D363314BCE +:10EE20002C2ACB19CA19CA19EB19EB19EC214C2A57 +:10EE30008F53A711AD328D32EA290B320A32EA31F3 +:10EE40000A32051975BD98E66962402033B5DDFFC9 +:10EE50006C8320204A93867A6018056BCFEEACEE67 +:10EE6000CCF6CCF6CCF6CCF6CCF6CCF6CCF6CCF692 +:10EE7000CBF6CCF6CCEECCEECCEECCEE11DF11DF47 +:10EE800031E731E751E751E750E770EF90EF90EF4E +:10EE900091EF91EF91E7B2E792DF93D774D775CFF7 +:10EEA00076C777C758BF59BF59BF59BF59BF38B781 +:10EEB00078C778C777CF56C756CF76D796D795D726 +:10EEC00075CF95D774D775D776D798D779CF5AC7D6 +:10EED0007CC75CC73CBF3CB77DBF9DC7BEC7DFCF0B +:10EEE000FFD7FFCFDECFBEC77CBF3CB71BAF3CAF69 +:10EEF0005CB7FBAE5DBF3AB72A54AD7D31B7EEA625 +:10EF000048752E8E949E7696D8A6B1856D7D0F8E0F +:10EF1000D18DD7AE9CD7BDDF9DD7BED79DD7DDD7CE +:10EF2000FCDFED74296D4FB70B86044CCA6C32A61A +:10EF3000FDF7FCF791B62D9E2C96AA85AB7D655406 +:10EF40008875CDA60B962EA6F9E7FDF7DCEFBCE79A +:10EF5000FBDFB5AE4E850E7DAD7455B6FEFF9CF75A +:10EF6000F9E6D4CDF0B4EBA3288B877285413194B8 +:10EF7000EF9BE23840206349C479C05881598472BC +:10EF800004738783C2514041A151A56A887B6149BE +:10EF900066922DE4CEF42EFDEDFCEDFCEEFCCDFCF6 +:10EFA000CDFC0EFD90F554FE18FF9AFF9BFF19FF54 +:10EFB0008FB4E98AA882C9924BA3C992C148C56996 +:10EFC000646980488040CBA336FF15FF33FF12FFF2 +:10EFD000F1FED1FE70F6EEEDCEEDEFED52EE37FF25 +:10EFE000DCFFFEFF54BD60304038A250C258E250F2 +:10EFF000E438C420E5204A427FE73795B35B1143EC +:10F000004D2ACA19CA19CB19CB21CB19EC214C2A8C +:10F010006F4BA7116C2A8D32CA21EB29EA290A32DB +:10F02000E931E41816CEB8EEA54144316D6B95B5C3 +:10F030002B6B0652F5DDA77280180563CFE6ACE6B0 +:10F04000ABEEACEEABE6ABEEABEEABEEAAEEAAEE01 +:10F05000ABEECBEEEBEEECE6ECE6ECE655E734E7B8 +:10F0600034E733E733E732E732E730E730E74FE7BB +:10F070004FE76FEF6FEF70EF70E791E792DF93DF8D +:10F0800094D774CF55C756BF36BF56BF56BF76C745 +:10F0900075C775CF75D795D795DF94DF93DF73D795 +:10F0A00093DF93DFB3DFB3DFB4DFB5DFB7DF98D72C +:10F0B00079D77ACF5ABFF9AED9AE1BAF1BAF5DBFC0 +:10F0C000BECF9DC7BECFBEC79DC77DBF5CB73CAF9F +:10F0D0005CB71BAF3CB71AB74E752754CFA66875FF +:10F0E000C97D10AF6E75B28559B7F28DED856A7521 +:10F0F000EA6C6A5C7085BAD77BCF9BCF7AC775A65E +:10F10000B4AE0F96865CCD9ECDA6865CCA6C97CFBA +:10F11000FCEFF5C6E97430B791C74875296D6654A0 +:10F1200067752EAFEB9533C7FBEFFDF7FDEFBADF49 +:10F13000B095AA6C2B7D8D95E96B896BD3C5D0B446 +:10F14000CCA3499B279B079B48A3E98AAB6A16B5CA +:10F15000AB726130202023492269E0608059C4727B +:10F16000247BA683846A0039025AE5722773E0384B +:10F17000879A0DE4ADF40EFD0EFD0EFDCDFC8CFC6A +:10F180008CFCACF4ADE491EDB6FEF7FE38FF9AFFCF +:10F190009BFFB8F632C50EAC6B9B88828461C14878 +:10F1A00007824369C050E46996F6B8FF35FFF2F66E +:10F1B000F1F6F1FEB0FE50F630F630F6D4F698FFD8 +:10F1C000FCFF7CFF4C8300206140E258E258E35092 +:10F1D000C4286831A4106F631ED7557411434E2A9A +:10F1E000CB1989118911AA19AA198A19CB196C2A64 +:10F1F0006E4BA7114B2A8D32CA21A921A921C929F9 +:10F20000C829E41034ADCE83C318083A283A283A06 +:10F21000084270949CFFAB838010AD94D1E66DD60C +:10F220006CD68BDE8BDE8AD6CBE6ECE6EBE6EBE645 +:10F230000CE70CE70CE70CDF0CDF2CDF77E757E778 +:10F2400056E756E756DF55DF55E754DF33DF32DF49 +:10F2500032DF11DF31E731E731E751E751E751E7BD +:10F2600052DF72DF93DF93D773CF53C773C774C76F +:10F2700094CF74CF94D795D795DF94DF94DF94DF44 +:10F28000B5DFB5DFB5DFB5DFB5DFB4DFB4DFD4DFC1 +:10F29000B5DFB5D796CF57C7F8B6D9AEDAA61CAF4B +:10F2A0007DBFFBAEFBAE5CBF5CBF5CB71CAFFBA61B +:10F2B0003CAF1CAF3BB7769E8C5C4854EC856554E4 +:10F2C0006D96EC850C6D4B54B6AE4F756F96E7643A +:10F2D00068758E9E675C91A6B3AE529E0C756C7D70 +:10F2E000D0AE29754554276D6C9E6875A75C2A754C +:10F2F000F2B670A60654EC8D8B85E44B8A7D254CC6 +:10F3000048750EAFEB8D8A858D8DB4B636BF2D7DD9 +:10F31000075C6B8DECADE99C447B4AB4CDD44BD4F7 +:10F3200067C306C3E5BA06BB28ABC5611394759CD9 +:10F330004A626130202003492369C0604061C47A79 +:10F34000247B857B057BC030A051057B066B602844 +:10F35000669ACBDB4CF46CFC8CFCADFC6CFC6BFC5F +:10F360008CF4CDF448BBAED412F632EE73F6B5FE93 +:10F3700038FF9AFFDCFFDDFFBCFFB4D5066A477A91 +:10F380008148A5712361015110C5DAFF98FFF4F699 +:10F3900012FFF1FED1FE6FF60EEE30EED4F699FFBD +:10F3A000BBFF36DE44412028C25044690369245122 +:10F3B000E620CB31A410B48C1BB67253AF3A0D22A9 +:10F3C0006A1149114911691169196911AA198D3216 +:10F3D0006E4B87112A228D32CA21AA21AA21CA2165 +:10F3E000A9216719C8310519A8210A320A326B3AD6 +:10F3F000CC4AEC5AD29C674A063A14B694CEB2D69E +:10F400008ECE8CCE8CC68BBE6BBECDCE2DD72DD7DF +:10F410000DD7EDD6EDCE0DCFEDCEEDCEFAF7D9F777 +:10F42000D9F7D9F7B8EF97EF77E756E755DF54DF0D +:10F4300034DF13DF12E712E712E732E731E730E794 +:10F4400030DF30DF50DF71DF72D772D773CF93CFE9 +:10F4500074CF94CF94D794D794DF74DF74DF74DFC4 +:10F4600075DF75DF75DF95DF94DF94DFB3E7B3E712 +:10F47000B3E7B3DF94D796D777C738BFF8AE19B7DD +:10F480003AB7FAAE1BB71BB71BB7FAAED9A6989E10 +:10F49000D48576967ABF79BFD085AD856E9E276D6F +:10F4A00007654E8E4B75919E35BFF095AB7DA97D5E +:10F4B000224C4B96C76CAC8D4F9ECD8DC86CCC8DBD +:10F4C000CA8D0775287508758985A985697D29758F +:10F4D0008A850C96E86C2554C44B6A7DEC8D6A7D58 +:10F4E000EB8DEB8DCB8D0D9E2C7D864B4A646A6C2B +:10F4F0008C95ACAD8BB588A4A6A386B325B383AA9F +:10F5000062B283C2A3C227C3A692286AD7A4D483B7 +:10F510002A5A82300020E240646921618159A47234 +:10F520004473A683A472A030A051057BE66A4028EC +:10F53000058A8BD30BEC0AF40AFC2BFC0AF46CFC56 +:10F54000CDFCCAD3E391CEE40FDD4BBC53FE53FE9A +:10F5500074F695F6F8F67AFFBCFFBCFF4EACC98A8C +:10F56000277A404044610259098B38FFDAFF16F7C9 +:10F57000D2F6D0F6F1FEB0F66FF691F615F779FFF8 +:10F5800039FFCC930018C240A579E681E679455150 +:10F590008A31AB29C51097AD5995314B8F32CC19B3 +:10F5A0006A1149114911691968196911CB198D320C +:10F5B0004E4B66110A226C32CA21AA21CA21EB21C4 +:10F5C000CA21CA218919A921CA21CB29CA210B32F2 +:10F5D0000E532E5B8E638E63559DF7AD36B695C682 +:10F5E00091C62DB62BAE2BA60AA62AA6CCBEEDC67A +:10F5F000CDBECDBEEEC6EEBEEEC60EC798F798F7EE +:10F6000097EFB8EFB8EFB8EF97EF96EF76E755DFE3 +:10F6100034DF13D713D712DF12DF12DF11E710E741 +:10F6200010E710E710E730E731DF31DF52D753CF73 +:10F6300074CF74CF53D752D752D732D753DF54DF5A +:10F6400054DF54DF54DF54DF53DF53DF53DF53DF26 +:10F6500073DF73DF73DF94DF95DF95D775CF56C700 +:10F6600037BF18B719B75BBFF9AE969E959EF18567 +:10F6700069548D7DCF8556BFD8CFD2AEEB956B9EAA +:10F68000855CEB858D9EEFAEB0AEE974A7646975BD +:10F69000434C8975E86C0D966FA66FA66EA62D9EDD +:10F6A0002C9E4DA66DA66DA64DA64CA64DA64DA6AC +:10F6B0002CA64CA6CEB66DAE8DAEAEB6CFB6F0BE15 +:10F6C000D0B66FAE2FA6AE9D2D8DA963E652075B17 +:10F6D000845AE1514049205120614069407960815C +:10F6E0008091E09942A2C6A26359F193B89CB47B81 +:10F6F0008D6A05392018E1300562035A8562056B71 +:10F70000867BA783804900418051C472E56A6028E6 +:10F71000E4816ACBAAEBEAF3EAFBC9F3EAF3ADFCB6 +:10F720004CDC6279E8BA6EEC28A3E69253FE52FEF6 +:10F7300053FE74FE95F6F7FE7AFF9CFF5AFF6FB4F6 +:10F740006B9BA46900302351A46952D5DCFF99FF5B +:10F75000B3EEB1F66FEE6FF6D1F6F3F677FF9AFFE0 +:10F7600056E6645100202351C5812792287A6741CB +:10F77000AF526A214721D9B59684114B6E32AB192D +:10F78000691168116919691189196911CB194C2A14 +:10F790000E434609C9192B2AA921A921AA19AA1978 +:10F7A0006A118A19AA19A919AA21AA21AA21EB2941 +:10F7B000AD420E4BB15B5374168D7795D9A518AE3B +:10F7C00075B630A6CB8DEA95EA95EA952BA6ADB62F +:10F7D000EEBEEEBECEB6AEAECFB6CFB614E734E7D1 +:10F7E00034E735E755E755E755E755E755DF75DF6A +:10F7F00075DF54DF54DF33DF33DF33DF32E711DF10 +:10F8000011DF11E710E711E711DF12DF33D754D70B +:10F8100055D754D753D753D733D732D733D754DFED +:10F8200033DF54DF54DF33DF33E733E732E733E7E7 +:10F8300033DF53DF32DF52DF72DF72E773E774DFEB +:10F8400076D736C716BF17BFD5B611963096EE8D50 +:10F85000EC8DCFAE4B7D2B75B2AEB1AE2B9E8CA690 +:10F860004875E6640A8EADA6AEAE8B8D497D69758E +:10F870008554EA858764F1B652C752C772CF72CFFA +:10F8800073CF73CF73CF52C752CF32CF31CF31CF77 +:10F8900010CF10CF11CF72D753D712CF2FAE4C95B8 +:10F8A0004974455382428029E018A018A020C03036 +:10F8B0004051A06901828392E4A204B304B304B36B +:10F8C00024BB25B3A7C3E79AC65978BDD8A4158C25 +:10F8D000EE72E85141186018E030E030002940290C +:10F8E000224AC149A049E57AE059C4720573A030A3 +:10F8F00042618BC38ADBCAF3CAFBCAF3EAF3EAEBC1 +:10F9000065A229BB2DEC0DEC2592EBBB70F5F1FD4A +:10F9100052FE73FE73FE95FED6FE39FF9BFF59FF24 +:10F9200093DDEDABA4610028E1506B9B5AFFDBFF38 +:10F9300035FFD2FE6FF6B0F6F2FE34FF98FF79FF86 +:10F940002EA400206038C5792692889AC759CD62C6 +:10F95000AE4A28192A3A3ABE5574AF3ACB2149111A +:10F96000281148114811281169196911CB192C2245 +:10F970000D432509A8192B2AA921AA21CB218A19CF +:10F98000491169198919A919892189218919A92177 +:10F990002B2A8D3A2F43714BF35B7574F78498953E +:10F9A000F79D34A6CE8D6A7D897DA9858985C98D0F +:10F9B0004B9E8DA64D9E4D966E9E2D9612E7F2E6BD +:10F9C000F2E612E713E733DF33DF54DF54DF54DFAF +:10F9D00054DF54DF54DF54DF54DF33DF53DF53DFB2 +:10F9E00053DF33DF12DF12DF13D733DF54DF75DF6E +:10F9F00076DF76DF55D734D734CF34D733D733D704 +:10FA000033D733D733DF53DF32E732E732E731E73B +:10FA100032E711E711E710E710E710E731E731E7C8 +:10FA200052E732DF12D732D732CF32CF31C7F0BEF2 +:10FA30000FBFEFB6AFB6CB95E87C698DEA954B9ECC +:10FA400027752775E66C4C9E497DD3CF2D96865C35 +:10FA5000EA858D9E876C73CF94D774D794D774D76B +:10FA600095D795D775D774CF54CF53CF54D734D7B4 +:10FA700074E7B6EF96EF11BE8C8C275B043A201921 +:10FA8000A018601080186041816A0283C5AB46C42B +:10FA900006CC26D467DC66DC67E446DC46E426DC7C +:10FAA00067E448D4ABCCE3616D833BD638AD559465 +:10FAB0008B62C3282010001040184239A341413105 +:10FAC000601000086041A893C37A816A25732039C9 +:10FAD000C0486BB36AD3ABEBAAF3CAF3CAF328DB13 +:10FAE0008AE30DF4CCEBEBE30CE40FF5CDF44FFD22 +:10FAF000F1FD11FE53FE73FE54FE74FEB6FE17FFB9 +:10FB0000F7FE75FE51D5A7820028A459F4DDDBFF6E +:10FB100098FFD3F6B1F6F1FE13F755FF78FF55E6DF +:10FB2000634100186361879A09B3688A9083B2734E +:10FB30006D42C610CC529CCEF36B4D326919271121 +:10FB40002711271107112811281169198B112C2A47 +:10FB5000EC420509A9192B2AAA21CA21CA21A919EF +:10FB6000681989218921882188218819E9214A2A4F +:10FB7000CC324E43704B504391533464556CD67C19 +:10FB8000B89DF79DF2954D7D2A6D696D486D486D64 +:10FB9000486D0765496D2C860C86EB7D10E710E7F4 +:10FBA00031E731E731E752DF52D752D773DF73DFE6 +:10FBB00073DF73D752D752D773DF73DF73DF73DF0F +:10FBC00073DF73D772DF52DF52DF53DF53DF53DF50 +:10FBD00073DF74DF73DF53D753D752D732DF31D798 +:10FBE00031D752DF52DF52E731E731E731E730EF0B +:10FBF00030EF30EF10EFEFEE10EF10EFF0EE10EF10 +:10FC00000FEF0FEF0FE730E750E770DF91DF91DF85 +:10FC1000B1DF91DF71D751D730CF0FC7CEBEAEB6AF +:10FC2000AEB68EAE8A8D087D6A8D0D9E297D2875B3 +:10FC30000B96C66CCC95D0B632CF73D753D753D76B +:10FC400054D754D754D754D734D754D775DFB7E7E0 +:10FC5000B8F712C6696BA3390021A01840106020C4 +:10FC60006141E67A4AB44CDDCDF5CCFDABFD4AFDF1 +:10FC700087F466ECA7F4E8F4C8F487EC67E4A8EC32 +:10FC80004BF5CEF5CDC4424135BD9CE637B54A5261 +:10FC9000611800108128E2388038C038E03800311F +:10FCA0000442244A4018C0518593C2728683A149F8 +:10FCB00060300A9B8BCB6ADB8AEBABF3EBF3EBF3A5 +:10FCC0008BF38BEB0CF4AEFCEEFCEEFCADFCEDFC30 +:10FCD0002EFD8FFD90FDB1FDF1FDD1FDF2F513F686 +:10FCE00053F695FED6FE55FE8B9B2028466A96EE6F +:10FCF00079FFF5F6B2F6D2F614FF56FFD6F6298351 +:10FD00000020E148879A29BB6AB30B8BDABDF04A21 +:10FD10006C42C5108F6B5BC6515B0C2A69192711A9 +:10FD2000071127112711281129116A11CB196C32DB +:10FD30000D4BE40888190B2AAA21AA21A9198919AF +:10FD40008821882188218821E9216A2ACB326E43C3 +:10FD5000105C525CB04B914B704B514BB2531464DE +:10FD600017851AA636A612960B6D8654085D48654F +:10FD7000E754854CE75C8A6D085DAA6D50DF50DF63 +:10FD800070DF70DF70DF71D750CF30C750CF50CFEA +:10FD900050CF50CF50CF70CF70D770D790D770D78B +:10FDA00090D7B0DF90DFB0DF90DFB0E7B0E7B0EF23 +:10FDB000D0EFB0EF8FE78FE790EF8FEF6FE76FE750 +:10FDC0004FDF2ED74FDF6FE72FDF2FDF2FE70EDF5D +:10FDD0000FE70FE70FEF0FEF0FEFF0EE10EF10EF61 +:10FDE0000FEF0FEF0FEF0FEF2FEF2FEF2FE70FE7D3 +:10FDF00050EF51E751EF72EF72E752DF52DF52DFFF +:10FE000032D731D751D711CFD0C66EB64DAE4DA631 +:10FE1000CA954985AB95698D6A8DAFBE52CF52D7D1 +:10FE200032DF32DF31DF11D732D733D775DFB4CECF +:10FE30000C7C8331801060106018E030016AC7AB21 +:10FE40000ADDACF5CCFDABFD29F509FD67EC06E458 +:10FE5000C6E385DBA6DBA6D3C6D3A6CB66C309CC97 +:10FE60008CCC0FCD097B644119D619D6CB626018B2 +:10FE7000201001392572E471627100618161A47200 +:10FE8000667B8773E24160180383448BA78B6462AF +:10FE9000602888826BC34AD36AE38AEB8AF38BF3C8 +:10FEA0006AF3ABF32DFCCFFC0FFDCDFC8CFC4BF4C7 +:10FEB0004BF48CFCACF4EDF40EFD4FFDB0FD12FEE6 +:10FEC00052FE32FE33FE74FE75FE4DAC8028834137 +:10FED00072C538FFD5F6F4FE15FFF6FE6EAC603045 +:10FEE0004040A8A229CB8BCB6BA3F8D5599D6E3A85 +:10FEF000A929C510327C98A530530C2AAA21481193 +:10FF000028112811281128116A11AB190C2A6C3AF2 +:10FF1000093283006819CA2189218921892189210F +:10FF200089218921C9212A2A4A2A2C3B30549264EA +:10FF3000305C2D3B6B2A2B2AEA21CA190C2A8E3AF7 +:10FF4000314BF6849AB636A68F85885CC754A65482 +:10FF5000A654285D4965085D29654965EAA5EAA5B5 +:10FF60000BA62BA62BA60A9EA98D4785487D277D2B +:10FF7000067DE674067D067D2785268547854785AF +:10FF8000878D878D878D878DA895A895A79D08A6B5 +:10FF900009AE29B66ABE6ABEABC60CD7EDCEECCEB2 +:10FFA0000CCFECCE0CD70CD70DD72DD72DDF0DD71E +:10FFB000ECDEEDDECCDEEDE6EEDEEEE60FE7EFE6C4 +:10FFC000EEE6EEE6EEE6EEE6EEEEEEEEEEEEEFEE70 +:10FFD0000FEF0FEF10EF30EF31EF31E732E732E79D +:10FFE00052E752E752E772E752DF52DF51D751D75B +:10FFF00072D751CFF0BEAEB68EB64DAE8EBEF0CE3D +:020000040801F1 +:1000000010D730DF10DF10D7F1D613D72E9D444222 +:10001000A018401040204149C67AE9B3EBDC2BED33 +:10002000C9E4A8DC88DC47D4C6C385BB25B3C4AA11 +:1000300083A284A24392228A0282A17161698261B1 +:10004000A35984516018084AB6C5AE83C120601810 +:1000500000318472E271C181229222922182A27ABD +:10006000857BC7734763A0184162448B4683487BF6 +:100070006020C5616BBB4AD36ADB6AE36AEB6AF353 +:100080006BF3CCFB2DFC6DFCADFCACFC8CFC4BFC99 +:100090002AF46BFC8CFC8CFC8CF4CDF44FFDD0FD71 +:1000A00011FE52FE53FE73FE74FE95FE31CDA45137 +:1000B0006028AB9395EE58FFF6FE6EACC138002871 +:1000C000E5894BCB4ACB2AB3D2BC5FEF735B4F328F +:1000D0004821A410D58C9584D0422D2A8A19491123 +:1000E00048114811481149118A190C2A2B3206115E +:1000F00063002611AA218921892189218921892149 +:100100008921CA290A2A09228E4B7264AE4B4922E0 +:100110002922092226090609071127114811AA19BF +:100120002D2A304B57959AB6F39D2D75E964C75427 +:10013000A7544965496D29656A6D496D497D497DB9 +:10014000497D4985487D277D0675A5648564655C84 +:10015000455C45544654665C665C665C665C865CE1 +:10016000866486648664A764866445542554455C29 +:10017000455C6664E874E77CE77C077D2885288514 +:10018000688DC99DC8A5A7A5A7A5C7ADE8AD08B648 +:100190008ACEAAD6AAD6AAD6AAD6CBDE0DE72DEF4E +:1001A0000EEFEDE6EEE6EEE6EFE6EFE6EEE6EEE685 +:1001B000EEEEEEEE0FEFEFEEEFEEEFEE10EF10EFF4 +:1001C00010EF10E710E710DF11DF11DF31DF51D73B +:1001D00051D751D772CF72CF51CF31CFF0C6CFC6E2 +:1001E000CEC6CECEEFCE11D7D3CE2B7C422160101F +:1001F00060282051648A29CC4ADC09D409CC87BB09 +:1002000026A3C592637AC261615920492149E03829 +:10021000A030802880208020A020C020A02002299B +:100220000229C21840084C73B0A4A4416010802079 +:10023000636AC382007A619263AB63AB029B817A8B +:100240006473C673876B2029005A24836362AA8B68 +:10025000802043492AAB2AC34AD36ADB4AE36AEBCC +:100260008BF38BF3ABF3ABF30BF46CFC6CFC6CFC1F +:100270006CFCACFCADFC8CF4CDFC0EFD0EF54FF52A +:10028000D1FD52FE73FE73FE73FE54FE75FE14EE36 +:100290002A936030E559ED93C96A402000286479BB +:1002A0002ACB2AD36ABB4FBC9EFF5BBE6F322E2A7D +:1002B00027192621379DD36BAF422D2A8B1949115F +:1002C0006919491169116919CB29EA29C408630020 +:1002D00087190A2AA921892189218921892189212E +:1002E000EA29C921E921F05B1164AB328719E508DD +:1002F000E5080511E510E510E510E61006112811D6 +:10030000CB214D32D26319AEB9BE918DEA648754C8 +:10031000664CC754E85C29650965C85CAB85EB8D04 +:100320000C962C9E6DA68DA64C9E4C9ECA85697D12 +:100330002875C764A664A764C764C864C864E96410 +:10034000096D2A6D4A6D4A756B752A6DE964A85C62 +:10035000C9642A6D2A752A75097549756A7D2975DA +:1003600008758A8DC9958895879D669545954595AB +:10037000659D649D85A5C6ADE7AD28B628BE6ACE4D +:100380006BCEACD6EEDE2FE730DF0FDFEFDEAEDE7A +:10039000CEDEEEE6CEE6CEE6CEEEEEEEEFEEEFEE23 +:1003A000CFE6CEE6CFE6AEDECFD6CFD6EFD6EFD6CF +:1003B000F0D6EFCECFCECFC6EFCEEFCE0FD70FCF4A +:1003C0000FD7EFCEF1CED2CE896B80102010224114 +:1003D000A78A48ABC8C3A7C3A39AC1792061C04804 +:1003E0008038A038C0304339A5412752895A2B6B39 +:1003F000AE73EE7B0F7C7084B28CF39413951395DF +:10040000349D4D63C218B19CAB83C028A018E0286E +:10041000048BC18A408243A3C2B3C2AB4293C17A68 +:10042000847BC673876B0029015A8372836AEB93BE +:100430008020C238099B2ABB2AC34AD34BDB6BDB23 +:100440006BE34BE34AEB6AF3EBFB0AF4EAF30AF4DF +:100450008DFCADFCADFCCDFC0EFD2FFD0EFD4FFD6A +:10046000D0FD32FE72FE73FE53FE53FE12FEF3FD0C +:10047000D4FD0EB4A65141188218E33007724BB375 +:100480002AC38BC34EBCFAF6DFF7F5846F2AED2141 +:10049000E510E939379551532E320D2A6B196A113F +:1004A0008A1949114911CA218921840042008721F2 +:1004B0000A32C921892189218921892189210B2A8F +:1004C000A921A819B05B6F53E92167112611061104 +:1004D000E610E510E510E510E510E51006114719E6 +:1004E000AA19CB21CE42B57CBBBE76AE8B64074C3D +:1004F000464CA754664C464C464C8754EEAEEEB67E +:10050000CEB6EEB6EEB6EEB6EEB6EEB6CDAE0DB7F4 +:100510000DBFECB66AAEA895687D49756A75AB7D6E +:10052000CC85AC7D8B7D4A756A754A754A6D6A7556 +:100530006B75AC7DAC7DAC7DAC7DAB7DAB7D6A7508 +:100540006A7DAA7D8A85A985898D888D468D458D90 +:100550000485E384048D66958695E8A508A6E8AD34 +:10056000A7A5479DEAAD0BB68DC6EFD6AECEAEC6FB +:10057000AECE8DC68DC6CED6ADD6ADD6ADDE8DD6C1 +:100580008CD68CD68CDE8CDE8CD66CCEADD6ADD631 +:10059000ADD68DCE8DCE8CD68CD68CD6CDDEEEDE85 +:1005A000EFDE11DF15DF496360086020267A6ABB41 +:1005B00008BBE7AA247AC038A028A341C862ED830B +:1005C000D1A453ADB6B5F7BD79CEBAD6DBD6FCDE35 +:1005D0003CDF3DE75DE75EE7DCD6BCD6BCCE5AC665 +:1005E0003AC6EC5A6529D1A4E76A8020A02061416F +:1005F0004593A18AC06964A3E3B3E2AB82936383AA +:10060000A47BA673E662A020C251A151C5726DA45D +:10061000C128A128E9924AB32AC36BCB8CCB8CCBDF +:100620008CD38DE36BEB4AEBCBFBCAF3A9F3A9F3B5 +:10063000EBF34CFC6DFCCEFCEEFCADEC2FFD90FD25 +:10064000D1FD11FE31FE31FE31FE32FEF1FD91FD94 +:10065000CFF470DC2D83C9399063F49CF2BC0DACEF +:100660004DBCB2DD3AFFFEFFBDE7158D6E32AB1912 +:10067000C4082A3A757CD0420D22CC194A114A117D +:100680006B116A11AA216819630062008721E929A8 +:10069000A921892189218921892189210B2AC9211F +:1006A0002611B05B90530B2A68192611061106110A +:1006B000061906190619E610061106190711681918 +:1006C000AA21CB212C2A304B979DDABE0F7D4533D2 +:1006D00006440544264405446754264C8CA66B9E6C +:1006E0008CA68CA68CA6ACA6ACA6ACA66B9E2A96B5 +:1006F000099669A62CBF6EC70DB74B9E8885897D6C +:10070000AA7DAB85AB7D6A75296D08650865696D45 +:100710006A756A6D496D296D4A6D6A754A6D496DD4 +:100720006A6DAB75AA7DAA7D8A7DE76CC56C267D56 +:10073000057D257D258525854685057D2585E89DC5 +:100740006AB66795C584C6844895298D298DCC9D48 +:10075000EC9D6A956A95AB9DCAAD4CBE0BB6EAB5E9 +:10076000CAB52AC64BCE4BCE0AC62BC66CCE8CCE93 +:100770008CCE8CD68CD68CDE8BDE8BDE8BDEADDE2B +:10078000D0DE14DFEB7B6010E2308C9BEDCBC8B287 +:10079000C49160486028C862F19C57BE3BDFBEEF41 +:1007A000DEEFBEEF5DDF1CD71CD7FCD6FCD6FCD637 +:1007B000DCD6FDD6BCCE7BC6FAB5B9B5B9B578AD39 +:1007C00057A5A831E741B09C8652A018A0208149C6 +:1007D000659B80824059C28AC4ABE3A3E59BA58B8D +:1007E000A67B66734139A028E0402041477BAEA438 +:1007F00002298028A88A2AB34ABBC8AA837901693A +:10080000E068A489EABAACE3AAEBCAF3EAF30AFC0B +:10081000CAF3EBF30CEC0CE489C3CEE490FDB0FD1D +:10082000F1FD11FE10FE10FE10FE11FEB1FDEFEC09 +:100830004EE44CABA9496C42F684DBC63BEF97E62D +:1008400038F7BBFFFDFFFEF77CD718A610436A11EF +:10085000A4004A3AD3634E2AED21AC198B118B11B7 +:100860006B118A196819830063006721E929A9219E +:1008700088218921892189218A190B2A0B2AC500FF +:10088000B063F1638D3A0B2A6819471127190619CD +:1008900026192719471926190619271948198921D0 +:1008A000CA21EB210C226D32126CF8A516A6A94BB9 +:1008B000853BE53BE543C53B264CE643ADA6AD9EF7 +:1008C000CDA6CDA6AD9ECDA6EDA6AC9E4B8E2A8E16 +:1008D0000A86E985C87D298ECBAECECF6CC748A6E7 +:1008E000A785887DAA7D8A6D2865075D285D486596 +:1008F0004865486548654965496D8A75896D696DC2 +:10090000896D8A6D8A75696D496DC65CE55CC55CEB +:10091000056D0575257D057D2675E56C0575C47429 +:100920008695CBBEA695426C856C6664475CA864D0 +:100930002A756B856B852A7D8B8D6A8D6A8D8A956C +:100940004995EBADEAB5EAB5AAADA9ADC9B5C9B54A +:10095000A9AD0ABE2BCE6CD68CDE8CE66CDE6ED6D4 +:10096000D3DE4C8C6010233950C46FDCE9B243797C +:100970004030886233A5FAD63BDF7CE79DE77EE70F +:100980009EE77EE7FCDEFDD6FCD6FCD6DCD69BCE11 +:100990007BCE7BC63BBEFAB599AD99AD79AD78AD4E +:1009A000B494E418284AD19C6652C0188018413982 +:1009B000E48A828220594059048B8593858B668313 +:1009C000C56A41398030A038A03861492B9CEEAC13 +:1009D00002296020888A4AB3C89AE0584061427A66 +:1009E000E58A40512030478ACBDB0BF44BFC4BFCB3 +:1009F000EBF3CBEBECD3C7A26DCCF2FDB1FDF1FD77 +:100A000031FE30FE2FFE4FFE30FEAFFD0FED0DC468 +:100A10008A824741CA29746CD89D9DDFFEFF5AE740 +:100A2000F4BD5AE7FEFFDDEF3ACFF79DEF4228090C +:100A3000A400ED4A925B0D22AC198C11AC11AB19DC +:100A4000AB216819840862002619C929A9218921C6 +:100A50008921882188218921CB214C32C500AC3ADB +:100A6000368D9053AD3ACA21A92168192711261154 +:100A7000471947196819471907110711C9294C3235 +:100A80004C320C2A0C2A4D320F4B568D38AE728DDB +:100A900067430644474C264CE543264C2B964B9621 +:100AA000AD9EAC9E8C9EAC968C964B8E2B860A8609 +:100AB0000A7E0A7EEA7DA87DA67D27962ABFCDCF35 +:100AC0004CBF088E8775676D6765476568656865A3 +:100AD000686568656865896DA96DC975EA7DC975C0 +:100AE000A9758975486D28652765486DA975C9750B +:100AF000C97D0986098E098EC985A87D677D257502 +:100B00000575E89DAED78AAEC56C655CA85C885457 +:100B1000A85CE964C9640A6DAD852B75A96CA86CE5 +:100B2000097D8B956A95CBA58A9D699D48A548A5A9 +:100B3000079D47A5A9B54BD66CDE6CDE8EDED1E6EF +:100B400070B5E118233133CD90DC4ABB437160406E +:100B5000709C7DE7BEEF7DE79EE77DE75DE75DE7A3 +:100B60005DE7FCD69BCE9CCE9BCEBCCE9BCE5BC61F +:100B70003BC61BBEFAB579AD58A579A579AD99AD3F +:100B80003284A3100C6395B5674AA018A018E0281A +:100B9000C47AC382027220512049226A22628149AA +:100BA000E038C030E138C0382041235A2EB56D9C62 +:100BB000C120602088826AABC371858AE492249345 +:100BC00049ACACB442412028A8A20CEC6CFC6CFCF3 +:100BD0000BF4CBDB67928BAB55FEB1F5B0F5F1FDB5 +:100BE00031FE50FE50FE50FED0F56CCCC892445100 +:100BF0006320A5100F43F67C9AB6FFEF7BDF2A5BDC +:100C0000C110E63133A5FEF73ACFB695EE42E708BC +:100C100083006F5B514BCC198C116B11AB19CB213D +:100C2000A92184084200E510882189218921892190 +:100C3000892188218921A9212C324811250914856F +:100C4000947CF2636D3AA919CA216819271106111B +:100C500027112711481948192719271988194C32C3 +:100C60006D3A6D3A4D326D32CD3A326CB79D36A643 +:100C70004B5CC7438854E95C0A65A85CCA950A9630 +:100C80004B9E4B9E8C9ECDA66C9E0A8EEA85EA8575 +:100C9000A875886DA875A8758775666D656D278EB2 +:100CA0004BBFACCFC9AEA585456D465D875D875D01 +:100CB000875D675D8865A8658765876DA775A7757A +:100CC000A87D298E4B964B968C966B8EE97D097E7E +:100CD000E97DE97DA875E97DEA7DC97DC97D6775F6 +:100CE000E664E56C29A6AED78AAEA46C4554674C81 +:100CF0008754C95C274C2754695CEB6C695C485489 +:100D0000886488648864676C877C499D69A589AD1F +:100D100069AD27A5A9B5CAC50BCE0CCE6FD672D6C4 +:100D2000464AC22094D574E5ACCBA481A140F2B46C +:100D30009DF77EEF7DE77EE75DE73CDF3CDF3DDF53 +:100D40005DE7BCCE3ABE1ABEFABD3ABE5BC67BCEEC +:100D50009CCE3BBEB9AD58A558A559A559A599AD8E +:100D6000906BA4106F7339CE0A6380188010A0189E +:100D7000435A8372837AE16960592051415100419D +:100D80000141014101418149435A2673F1C549732B +:100D9000A018A020467229A3A59AC8BB86AB818261 +:100DA00061728CACE86A40208371CCDBEBF30CF40D +:100DB000EDE387A2267235EED2F5B1FDD0FD10FE2F +:100DC0002FFE30FE10F6EDCCC7826451E43063187C +:100DD00084108821336456859ED7BEE7AE6B6108C8 +:100DE000821041082C63FEF77BCFB5956F53E50069 +:100DF000C50850538E32CD198C118B11AB19EB29CC +:100E0000C5104200A408882189218919A921A92196 +:100E1000A92189218921EB29CA298300AF5BB79DCC +:100E2000537471536D322C2AEB2189192711481103 +:100E3000271127114819681927194719CA296C3A27 +:100E40006D3A6D3A6D3A8D3ACE424F4B937C949504 +:100E5000728D673B484C674C675426440B9EEA9D55 +:100E6000CA95EA950A9E4BA68DAE8DA66C9E0B8EFA +:100E70006875676DA875676D876D876DA7758675D1 +:100E8000857D689E6BC78CC7CA9E287EC76DA76D7F +:100E9000C76D8665A76D0876E87D6A8EEC9EEC9E30 +:100EA000CC9E8B9E6B96E985266D0665065D276553 +:100EB00068654765075D075D275D065D065D8975A9 +:100EC0000765855C6364878D6DCF4AA6645C254C9D +:100ED000464C6754064CC643074C485CC643C64361 +:100EE000E74B485C8964886CC884499D49A569AD15 +:100EF000CABD0BC62BCECAC58ABDACBD92D64C8C22 +:100F0000C118F2B498FECCBBA79AA04890AC7DEF74 +:100F10003DE75DE77EEF7DE73CDF5DE77DE79EE750 +:100F20005EDF7BC63BBE1BBEFABDFAB53BC67CC6C8 +:100F30007CC61BBEDAB59AAD79A559A559A599AD60 +:100F4000ED5AA41091735BD68E7BC12060106010A7 +:100F5000A239A46AA372C482C57A6572C359A25128 +:100F6000C351045A4462E56A0573ACA491BDA33928 +:100F70008018C020A351857A069BA7B366A3C061E1 +:100F800060492B9C875A4020C571ABCBABE3CCE3C7 +:100F90004BBBE150F1BC96F6B2EDD1F511FE11FE5E +:100FA000CFED6BC4647AE04003392531A510A50864 +:100FB0006819EE42167DF895FFEF76A58410841827 +:100FC0000621A4104C63FEEF9CD758AECF63A4005B +:100FD00047110F4BEC21AC198C118B19EB296819B7 +:100FE00063006200471989218921A9218921A9214A +:100FF000A9218921AA212C3206114619969DF8A50E +:10100000957CCE428E328E320C2AEB2189198919B9 +:10101000891948114819481927110611A9214C3A74 +:10102000AD428D3A6D3A8D3AAD3A0E43D063138599 +:10103000F49D0B54E743684CE543C43B2BA60AA63A +:101040002BA62BAE4BAE2BAE2BAE4CAE2BA6AA8D49 +:10105000487D687DEA85486D486DA875C975C87575 +:10106000C87DC77D0886AA9E2BA76CB72CAFEAA6C1 +:10107000CA9E8996EBA60BA7CB9EAB96097E886D80 +:10108000075DC65CE75C4865A754C754E75C085D2C +:10109000285D075D075DE75CE754E75CA6540765DC +:1010A0000865865C45540454277DACAE6BA6646429 +:1010B000C343C543843B6443A64BA64BE653075C3E +:1010C000886CEA7C2A8509852995299D69ADAAB590 +:1010D000CABDCAC5EAC52BCE0CCE2ECE12C68331F0 +:1010E0008C73BDFFD0DC09AB2259EE9B5CF77DEF22 +:1010F0005DE77EEF7DE75CE77DE77EE79EEF5EE7FD +:10110000FDD67BC61BBEFBBDBAB5BAB5FABDFAB5F6 +:10111000FAB5FBBD9AAD99AD9AAD79AD59A558A573 +:101120004A4A8310D17BFAC5D08B864140086010B3 +:10113000A018855A056B667BA77BA77B266BC562CB +:10114000A462056B057304730894F1CD6A73A0184B +:101150008018E441845A6362836A636A0262404190 +:10116000856A2D940129A030099B8BCB8BDBACD3F6 +:10117000C569E6595AFFF9FE56F6F4EDCFC46993F6 +:1011800083592028224169624631840885080B3240 +:101190008819336C5585B68DDABE4A3A4510E82871 +:1011A000A5188310307CFFEFBDD7348D6A328300E1 +:1011B000A921104BEC21AC11AC19CB218C42E510CC +:1011C0008308E41088214819681989216921A92117 +:1011D00089218921EB21EB29C4086D631CD77ABED4 +:1011E000D684514BF03AD0320D220C1ACB19AA19E1 +:1011F000AA19691968192711271127116819A92136 +:101200006C3AAD42AE42EE42CE3AEE422E4BB27C4A +:1012100016A6B395A743474C264445442BA60AA6D9 +:10122000CAA5CAA50AAEEAADEBADAAA5288DE77C92 +:10123000087D287D497D286D48756975CA7DC97509 +:101240000A7EC9750A862986A775E785488E69963C +:10125000699689966996C77D666D2665E65CC65473 +:10126000E75CE75CE85CE85C87546754A754875404 +:10127000A75CA75CA75CE864C75CC75CC764086D33 +:10128000A764465C055487646564A56CC99D0BA67C +:10129000297DA86C6764886C686C886C8974C97CCB +:1012A0000A852A8D0A8DC88429958BA5CBB5CBBD1F +:1012B000EBBD0BC6CBBD0CC60EC692D60C84A539B1 +:1012C0001AEF3AFF4ECC87928B935BF77DEF7EEF60 +:1012D0007EE75DE71CDF5DDF5EE75EE7FDD6BCCE47 +:1012E0009CCE3BBEFBB5BAB579AD9AADBAADBAAD41 +:1012F000BAB59AAD79A579AD9AAD79AD59A538A5AC +:10130000093AA418F283FBC5549C8C62A3202010D8 +:1013100040104129266B666B8673A67BA673456BCE +:10132000246B2573457349944FBD4873A018601012 +:10133000A018244A4352E56A0673E672E351E3516A +:101340004A7B6239C020C77A868249B38BD34BC3AC +:101350008040A96A5BFFD5D5ED9B266A60300020EE +:10136000C138AD8B55BDC84184088500AA294C32CF +:10137000C9193685148513855174A4082A39CA30D1 +:1013800066188310F394FEE77AAE2D4B2A32840060 +:10139000CB212D2ACC198C11AC196D3A2A3AC410E4 +:1013A000A3084621682148216821682168218921F4 +:1013B0008921AA212C326819C408559D7EDF3AB6CE +:1013C000346C524B5243D0324E22EC19EC19CB19EB +:1013D000891169194819271126114719A921C92905 +:1013E000CA294C326D3ACE3AEF42AE3AAD3A726CFF +:1013F00017A6B8B68C64284CE95C6644CA9DAA9DC1 +:10140000899D699DEBADEBADEBAD8A9D288DA77CE9 +:10141000E87CE874866C655C655CE7646975496DB9 +:10142000AA75CA7D6D8E0B7EEA7DA96DA86D676574 +:1014300066658765876567656865486D2865496D78 +:10144000086D296DC7640875E974C86C297D097534 +:101450000975E974E974297D097D297D6A8D6A8D94 +:10146000E97CE97C297D097D2985E87CC77C498D5B +:101470006A8D4A8D09850A8588748874C984C97CF7 +:101480002A8D4B8D4B958B958B95EDAD2EB64EC61B +:101490002EBE2EBE6FC650C611B674C62642F2A42A +:1014A000DDFF56EEECABC78278E67DF77DEF7EEF91 +:1014B0007EE73EE7DDD6DDD6DDD6BCCE5BBE3BBEED +:1014C000DAAD79A579A559A5399D399D59A579AD8B +:1014D00079AD38A538A579A59AAD79AD79A558A586 +:1014E000C8390521538C1CCEB8A43173C951411899 +:1014F000201040106231E662667B858364838483BA +:10150000858B08944A9CEB8B254A400820084010A4 +:10151000801880188020C0280031A341C44942317E +:10152000E128C0288462878B847AC2718BC34ABB4E +:101530008461E240E659E238402860382259E88A5E +:10154000F1C4FAF62D6B84088508E608EE5267119F +:10155000CD32F895758DCE63C7290A3A0F5AAA3055 +:1015600087208410759DBAB6EE42CE3A0A32A500A5 +:10157000CB21CC19AC118B11CB198D42E518C310BE +:10158000E410C83147214721882968216821692151 +:101590008A21EB290A2AE508E729BAC65EDFB8A541 +:1015A000F463B4533243D1326F220D22EC19EC2193 +:1015B000AA19AA2148194719271127198821EA29A8 +:1015C0000B32EA292B2A4D328E3A6D32AD3AB05B9E +:1015D000D79DB8B6B28D09548C6D0955689548955C +:1015E0006995899D699D49956A9D6A9D0885C87C14 +:1015F000E87CE874A76C86648764096D6A75C75CCB +:10160000A75C8A756B6D0965696569658965AA6DF1 +:10161000AA6DA965896569654965496D49756A7DE0 +:10162000497D6A85297D087DE97CC87C097D4A85DC +:101630002A850A850A8509852A8D4A8D4A8D298D34 +:1016400009850A850985A87CC87CE984E87CA87C92 +:10165000877CA87CC8842A8D4B8D2B8DAC9DAD9D3D +:10166000AD9DCE9D71B6B3BE92B652B631B611B62F +:10167000B0ADF1B5F2ADB1A5729DB08CC9527CFF91 +:101680009BFFD4DD6A9311BD1BEF5DEF7EEF7FE71B +:101690005EE7FDD65BC61BB63BBE1BBEFBB5BAAD57 +:1016A000399D189DF894F894F894399D59A579A519 +:1016B00079A559A559A59AAD7AAD59A599AD169DAB +:1016C000C8310521B49CFBC5F9A4747BCF6AC9510C +:1016D000832000102010A020C149836AE472247B7B +:1016E000047BC472A249601800082008A12063414D +:1016F000C449045A455A8562A562C241401840183F +:1017000043316239C151E47A26838038668A8BBBC3 +:101710002AA34782C56906728782299B2DBC93DD67 +:101720003AFFD2A4C418A5088500EB312F5BC50091 +:10173000904B199EB69D641985219494906A0C393A +:1017400009310721B7A590538A11AF3A8821C508FE +:10175000CB21CC19AC11AB190C2AAD4A0419C3101A +:1017600046212A3A672147216829472168216821B3 +:10177000AA212C32E929A3002C53BEE73ED7379586 +:10178000767415643243D1320D1ACC19AB118A1913 +:101790008919891989196819471947194719A921F8 +:1017A0002B320B32EB210B2ACB21EB194C2A2F4B7E +:1017B000148537AE56AEEA4BEA5C4A656995288DCA +:1017C000E784088D088D288D088DE884E87CE8740E +:1017D000666C6664255C465C465CA864E96CA85C43 +:1017E0006754E9640A65096529654A6529654A659A +:1017F000AB756A6D4A656A654A656A6D6A7D4A7D40 +:101800006A856A8D2A85097D09850985E97C097DB6 +:101810002A850A850A850A854B8D0A85E97C2A85F1 +:101820000A850985C87CE98409858B95CC9DECA542 +:10183000CC9DEDA5CC9DAC9D2FA650AE51AECF9DBD +:101840006F959095B39D5295338DD284F38C3495DA +:10185000D38CF494B48C9384D48C4D6313A5BCFFC7 +:10186000F8FEF0C40D9CB9E6BADE9BD61DDF1EDF84 +:101870001FDF7CC6DAB5BAADDBB59AAD59A5399D87 +:10188000F894F894189D189D189D399D389D599D80 +:1018900059A559A579A579A579A579A579A5F69C24 +:1018A000C831E41896B57CD69BBD178CF36A90625C +:1018B0002C5A4541802820180010201060188020E4 +:1018C00060184010200800084018E2386351E459BD +:1018D000456A856AA56AE572C78B4AA48883203168 +:1018E0002008E128C149C4722683A03821514BAB9E +:1018F0002AB309B329BBAAC32BCC0FDDF3EDF9FE44 +:1019000098DE294A8408A500C6080F534B3A0609F9 +:10191000535C1996179E4732F18C1CE7327B8D5130 +:10192000EC492721505B4911CE19CD21E610C51095 +:10193000EC29CC19AC11CC19EF4AAC4A0419E418C3 +:10194000A8294B3AA9296821682147214721682104 +:10195000A9212B328719E30830749EDFBCC6D684D8 +:10196000766CF55BF23AB1322E22AC11AB196911EB +:101970004811691968194711271127194719C929E9 +:101980002B322B322C2A6C324C2A0C222C2AEF427E +:10199000F163558D36A64C64094C2C6D278D6895E6 +:1019A000278DE784E784C684A67C6574A674A67434 +:1019B0004564245C656485648664876C6664465C03 +:1019C00047546754885C885C8854A8548854E95C00 +:1019D0002A650965E9640A650A6509652A6D4A7D13 +:1019E0004A854A852A852A852B852A7DE97CE97CDA +:1019F000E97CA8748874A874A8748874C9744A852A +:101A00006B8D8C95CD9D2EA60E9E6FAE90B62FAE93 +:101A1000AE9D4D8D2D8D4E8D0E850F8D308D118D82 +:101A2000F184D284B384947C747C757C9584958491 +:101A3000557C567C567C357CD6946E73D9EE59FF16 +:101A400054F64CB432BDB9E69ADE7BD69CD69CCE19 +:101A50005CC6DBB599AD59A559A559A539A5189D01 +:101A6000F89CF89CF89C189D38A559A538A558A550 +:101A700058A559A579A579A5589D589D58A5F694BE +:101A8000C831E31817C61DE7DBBD9994356BB36207 +:101A90004F624C6A286A4449402020182018802050 +:101AA000E12860182010A0200131824941494049B5 +:101AB000815140496049E159626A257BECB4CDAC63 +:101AC000213120100031C5724783C0388038C99257 +:101AD0002ABB6AD32CE4CEF46FFD53FEF7FEBCFFA5 +:101AE000EF83A310A50885008A2171634721671938 +:101AF000D5741996DABE5BD7BBE79DF7B38BB16A95 +:101B0000316BA6088600AC19CF19CE21C610C610BD +:101B1000EC29CC198C11EC210F53CD52E418C310D1 +:101B2000A8294B3A0A32A929882188218821A9218C +:101B3000A9214B322511E308148D7ED7FAA596749E +:101B4000766CF55BD1324F220D22AB196919481121 +:101B50006819681927112611271906118821EA2901 +:101B60002B324C324C32AD3AAE3A6D326D32CE3A07 +:101B70009053D37CB59D5185673BAA64478D2685DC +:101B8000268D6695679DA8A5E9AD09AE4AAEABB6B0 +:101B90008CB66BAE8CB6ACB6ACB68CAE0AA627854E +:101BA000866C255427546854485447546754A95C9C +:101BB000A95C8854885CEA64EA64895C48544754A8 +:101BC000885CC96CEA6CCA6CC96CA964A96C88642D +:101BD000A86C6764876CA76C297DAB8DEC958FA68C +:101BE00090AE70A650A6AE8DEC7CAB6CCC746C6CD9 +:101BF0000C640E6C717CB38CB48CF694F794F894EE +:101C0000988C778C5784367C1674777C567C567CFF +:101C1000367C567C567C968CF5A4709C18FF95FEFD +:101C200070E56DBC93CDF6CD79DEBBDE7BCEFABD23 +:101C3000DABDB9B599B578AD58AD38A538A517A5B1 +:101C400017A517A517A517A558AD78B578AD58AD48 +:101C500058A559A559A579AD79A579A559A5179D77 +:101C6000E939031958CE3DE7FBBDB994B77BD4627F +:101C7000525A0E62096A03518140C040A159C57A87 +:101C8000866A8020203903524352C56A066BC56AB2 +:101C9000025A4049204140498151A472E7934DBD09 +:101CA0002C9460186020856A2783A030A038C992E0 +:101CB0004BCBABE32BEC2EFDD1FDB5FE9AFF98DEAE +:101CC000C73184088400A6006D3A505BA408C8217F +:101CD000367D3A9E3CCFFEF7FEF75DEF728353836D +:101CE000B37BB3638F3A6F32302A0F2AA608E6100F +:101CF0000D2AAC198C11CC210F532E5BE318E4187C +:101D000067212B3A2B3A0A32A9298821A921A9292E +:101D1000C9216B3A04112419969D1CCF9995B7746B +:101D2000766CD453D0322E228A11481127112711F4 +:101D300047194819071906190619E6108821E929D3 +:101D40002B324B328C3A8D326C326D326D32EE4228 +:101D5000B05B9374748DF4958843AB646BAE2AA624 +:101D60006BB68CB62AAE4AAE8795678DE47CC47C90 +:101D700023642364636C4364646CE67CE67C898D35 +:101D80006CAE6985E54BE64BE64B074C474CCA5CAD +:101D9000895C8954895CAA5CAA640B65895C685477 +:101DA000A95C885C685C675CA8640A756B7DCD8DF6 +:101DB0004FA6B0AEF1B6F1B6D0AE2F9E4B85EA7409 +:101DC0008A6C2A640A5C2C644E6C4F6CF284F48436 +:101DD000947CD68C389DF994D994FB9C1CA5FC9CD2 +:101DE0001CA5FCA4BB94798C388417841684358494 +:101DF0003584548C5494D3A4D1B410C5B1E54EDDD0 +:101E0000CCD4EECC51CD31BD53C575C576BD76BDB4 +:101E100076BD76B556B535ADF4A4F4A4F4ACD4A42F +:101E2000D4A4F4ACB3A4B2A493A493A472A493A432 +:101E3000D4A4D4A4D4A4F5AC16B536B577BD76B584 +:101E4000284A032177CE7CEF1BC6778C9673156BDF +:101E500073622F622659604060400051A382869BC6 +:101E60006141A020645AC4626673A873266B27730D +:101E7000277BE67A446AA259A2592362248349A4A3 +:101E800090C5045200100452087B4028626109ABDF +:101E9000ABE30BF48BF44EFD53FE17FFBBFF508CEE +:101EA000E518A50885000711EF4A8D4264002A3223 +:101EB0005785BBAEFFEFFFFFFFFFDCDECF72327B4B +:101EC000B3739A9D598DB87474532F328500481995 +:101ED000CC21AC19AC11EC213053D58CC310C310FC +:101EE000C410E939E9310A322B3A4B3A4B3A2A3AD3 +:101EF00088212511A308852138B6BBBE378DD77C34 +:101F0000155C734BD0322D22AA1948110711071105 +:101F1000271127190619E610E61806196719E92985 +:101F20002A326B3AAD3AAD3AAD3AAD3A8D32EE4225 +:101F30004F53726C548D56A6A94BAC6C698DE77CDF +:101F4000856C4564E4530454E453834B6243424339 +:101F5000013B223B423B223B423B423B423B213B3B +:101F6000A574CEBE0975A543A543E743A95CCA5C29 +:101F7000895CAA5CAA5C8A5CCB64AA64A964EA6CEA +:101F80004A7D6A85AB8D2C9EEFB650C731BFF0B647 +:101F9000B0AEED950B754964085CE953E953AE7436 +:101FA0003085739555953695D794B78C199DFA9CC5 +:101FB0001BA5FA9C9994788C3884F77BD773F77BB0 +:101FC00039849A94FC9C1DA5FDACBAA4579C139C23 +:101FD000119C0FA42DB44CBC2BBCCCD40CDDECDC80 +:101FE0000CDD6DE56EDD2ED50ECD2FCDD2DDF3DD12 +:101FF000B3D5B3D5D3D5B3D593CD92CD71C551C596 +:1020000051C551C531C510C510C5EFC48EB44DAC16 +:102010006EB46EB44EB44EB42EBC0DB44EBCB0BC57 +:10202000E651232977CEBDF75BCE97947673D462C1 +:102030007162EC61C34860408038C1612493248B95 +:10204000602061396773A673E873A773C562646221 +:10205000C66A888B099CA47203620462846A878BB7 +:102060008FC50B9440104339666A6038879A4ACB13 +:102070000BF48CFC0DFDF0FDB4FE79FF3AF76952CC +:10208000C410A508A60048198D42AA2964006B3A1D +:102090007785BBAEFFEFFFFFFFFF7AD6AF6A527BBB +:1020A000137C3AAE9CB67CAED5634E32850089294E +:1020B000EC21AC19AC19EC21AE42FAB56F6B620899 +:1020C0004100C4104621C831093AE9314621C41003 +:1020D00041002100A208C73179BE9BBE578DB6745E +:1020E000F45B5243B02A4E2AAA19691948192719D4 +:1020F000061106110619E618061906192719671997 +:10210000E9294B328C3A6C32CE42CE42AD3AEE42A5 +:102110004F4B326C758D57A64C646C6CE453E45392 +:10212000C453834BA44BC54BC54BC54B8443443B65 +:102130006443643B443B2333433B643B64438243FB +:10214000E67C6CAE6764A543C643284C485468548B +:10215000A95CC9644B756B7D8C85AC8D6F9EF1B6A7 +:1021600031BF92C751C7F0B66EAE4A85886CC65370 +:10217000664B874BA9536D6C728D3285F27C7695D8 +:10218000769D36951795199DDA9C7A8C1884B87BC4 +:102190009773556BF45AD35AD352924A914A70426C +:1021A0009152D25A136BF68BB9B476B432ACCFA33A +:1021B000CDA32CB46CC4ECD40CD58EED10F652FE2D +:1021C00093FEB3FE31EE8FDD2ECDEEC48CB4EA9BD0 +:1021D000688B077BC672A572A572C572C572C5727F +:1021E000E67A4783278B6793889BC9A3C9A3EAAB89 +:1021F0002BB42BB40BBC0BBC89B388B388B3EAB344 +:10220000A451022977D6DDFF1EE79AB5B67BD36AC3 +:102210004F624851A240A0402049A47AC59B8172D8 +:1022200040206552E873277C0774E8736773035294 +:10223000E251A56AECB44AA4A259E3594362067B71 +:102240002EB550B5C020E2304249E57909C36ADBBA +:10225000EAF34BF4ECF431FED5FE9AFF15CE652976 +:10226000A408A608071169196D3A68196400AC3A08 +:102270007685BBB6DFEFFFFFFFFF19C66E62327BCC +:10228000F27BFDCEFCBE9CB6F4630D328500CA29FC +:10229000EC21AC11AC19EC214D323474FAB5327C1E +:1022A000093A8308210083086308420021002100C5 +:1022B00082080419A208073299BEBBBEB895177DE3 +:1022C000145C103B2D222D228A19681968192711D8 +:1022D00027190611061906190619061926192611B5 +:1022E0006719EA290A2A6B32AD3A8D3A8D3A0F4BBB +:1022F000B15B526C3485159E1085EA63C44BA443D0 +:10230000A44B433B843BA443A44384430333443B57 +:10231000643B443B443B443B643B633BC44B287DB0 +:102320004CA6C76C0654074C074C4854885CE96CB3 +:102330008B850C9ECEB670C791CF71CF51C7AFAE13 +:10234000EC952A7D68644543E432684BAA532D64BA +:102350002F6CF284548D969DF68C3474357CB88C39 +:10236000988C788C377C956B145BF35AB352D352AC +:10237000B24A914A924AD252D252B252914A4F42F2 +:102380002D4A2C5A6B6ACB828DA3EDB36DC4CECC93 +:102390006FDDD0E572F6D4FEF5FE94EED2D510BD19 +:1023A000EB93C76A455AC3496239A3492552C76AA4 +:1023B000697BCA8B2C9CCEAC30BD70C5B1CDF2D53B +:1023C00033DE54E694EE94F694F6B5F695F6B5F64B +:1023D00094F694F653F632FEB0ED4EED0CDDCCCC17 +:1023E0002562E12876D6DDFFDCDE7AB5B67BF36ABE +:1023F000AF72464902494049626AA593E5A3E05994 +:102400008028E662E77327742774287CE87BA5623E +:10241000E35165620DBD6FC52462C359A251C572F7 +:10242000CCACD1C542316020A569C9AA09D349EB1A +:10243000CAFB0AF48BF4D0FDB5FEBAFFF1A4E31891 +:10244000A508C70828118A196C3A68196400CC3AA3 +:102450007685BBB6BEE7FFFFFFFF97B56E6252837E +:102460002F63FCCEFBBE9BAE146CCC29A608EB29D7 +:10247000CC21EC190D22EC210D22CF42B363F78C55 +:1024800098AD76AD51844942620841002200830034 +:10249000E929C821A208E73117AE59AE968D157DFE +:1024A000135C30432C22AA194711471947192611EA +:1024B000271906110619E518E51006192611271126 +:1024C0004719881988192B328D3A6C32AD3A2F4B47 +:1024D000126C72743485D5957195A95BC543A4437C +:1024E0008443433B643B643B843B433B443B643B0E +:1024F000643B443B0333433BE653E96CAB8DAA8D0D +:102500004564C44B26548864EA6CCC856F9E11B731 +:1025100092C771C730BF6DAEAA95A774E55B434300 +:1025200044436643894BCB534F6C548D358DD484D3 +:102530009584F78C179534741574377C387CF87B48 +:10254000B773766B766B5563556355635563145B50 +:10255000145BF35A145B145BD25AF15AAF5A4C5ABB +:10256000AC6A0B83CC9B6DBCCED491ED53FED4FEF4 +:1025700015FFD5FEF1D5EEB4697B254A01298018F7 +:10258000222947524B73909CB4BD77DE39EF9AFFF6 +:102590009AFFBAFF79FF58FF58FF58FF57FF57FFC0 +:1025A00037FF36FF16FF16FFF6FEF5FED5FED4FE0A +:1025B000B4FE93FE11EED0EDAFEDAEF58DED8EE5F0 +:1025C0002883A020F4C5BDFFDCDE38ADD683757B43 +:1025D000CF72665122498151E372C593E59BE06158 +:1025E000C028066BE773277C07740774A773845AA7 +:1025F000C249A56A0DB54EBD656A456AE359E67ADA +:102600008BA4D1CD83396028889209C34AE349EB72 +:10261000AAF3EAF38BF4B0FD95FE9BFFEE8BA318B3 +:10262000A408E7084919CB212C3207114400AC3A21 +:1026300056859AAE9DE7FFFFFFFF35AD8E6A728328 +:10264000AD52BBC6FCBE9BAE146CCC21C708EB29B7 +:10265000EC212D226E2A4E2A6E2A8F32CF42B2638F +:1026600098ADBFF7DCDE2942610841008308A82944 +:102670008C3A8819C308A6295495137D5164516476 +:10268000B1532F436C2A0A22A819A721261126111B +:10269000261126190619E518E61806192719271113 +:1026A0006819892168190A2A4C328D3AAD3A0E4BC5 +:1026B000F16B72743485F59DD3A5AA63843B443BCA +:1026C000843B8443643B443B443B233B643BA54BFA +:1026D000E64BE553265C297D6B852A7DA864465C24 +:1026E0006664C77469858DAE50C791CF2FBFCEAEDB +:1026F000CB8DC86CE5530333C32AC532E63A8A53FF +:102700001185338DB47C957C547C557C1474F46BAA +:10271000D46BF573F573D673D673B66B766B766B35 +:10272000976B976BB773B873D87BD87BB873977375 +:102730009773B87BD87B9673537B0F7BCB820A93BE +:10274000ABA3AEC4B0DD73EE16FF37FFD6F6B2CD45 +:102750004D9CA762222960108018A5396B7332AD99 +:1027600097D69BFFFCFFFBFFDBFFBAFF99FF99FFAA +:1027700078FF58FF16FFF6F6D5F6D5F6F5FEF5FE0E +:10278000F5FEF5FED5FEB4F6B3FE72F672FE71FEEE +:1027900050FE8DED4CE54BE56CED6CED8CEDCEED2A +:1027A000AA93A020D4BDBDF79BDEF7A4B67B3473FB +:1027B000CF7A665102412041A36AC68BE59B406AED +:1027C000C028066BC773287C07744563E5624352D3 +:1027D0000252A46A4EBD6BA4A251E4592362267B27 +:1027E0008BA46FBD2231A138A8A26BDBABF36AF3D7 +:1027F000AAF3EAF3ADF412FEB6FE9BFFCD83C31835 +:10280000A508E7084911AB210C32071144004C2AF6 +:10281000367D7AAE7DDFFFFFFFFFB39CCF72728300 +:102820004C4A9BBEDBBE9BAE346CAC210811CB2165 +:102830002C2A2D224D2A6E2AAF32AF3AAF3A1374AA +:10284000BCCEFCD6EC5A41084100630868212B320B +:102850004C326819C4086519F27C70648E4BAF5312 +:102860006F4B4F430D3B8A2A492A082A67192611C4 +:1028700006110619E618E61806190619271148194F +:102880006919892189210B2A4C326C326D32AD3A9B +:10289000905B116C148516A697BEAA63C643443B91 +:1028A000843BC543E64BA543C64BA64B485C8964B5 +:1028B0002B752A7D4A858A8549854985AB8DAFA6CA +:1028C00051BF71C750C7AEB6A995087DA353424307 +:1028D000C232A22A431A07338B4B2F64F384148528 +:1028E000D5843474D46BD56BB56BB56BB56B956B08 +:1028F00054637563B66B766B756B766B976BB87359 +:10290000D97BD97BD97BD97BD97BD97BD97BD97B27 +:10291000F983F88BF78BD49390936D9B0DB4EED421 +:10292000B1E594FE16FFF6F6D2CD2C946652E12066 +:1029300040106010E639CD7BB5BD3BEFFDFFFCFFDD +:10294000BBFF7AFF58FF37FF37FF16FFF6FEF5FE95 +:10295000F5FED4FED4FED4FED4FED4FEB4FED4FEE6 +:10296000B4FEB3FE93FE72FE31F6EFF5CEF5AEF592 +:102970008DF56CF56CF56CF5ADFDCDFDCDFDCFF5B0 +:102980002BA4A02093B53BEF9BD6D7A4957B136BCC +:102990008E6A4651E248E040225A8583E59B0383D4 +:1029A0008028645A6673087C087C656B835A2252BF +:1029B0006362099C4FC5A56AC25181492262468360 +:1029C0008BA4EEB4C0280249E9B26AE38BF38AF320 +:1029D000AAFBEBF3CEF413FEB6FE9BFF0F8CE418BC +:1029E000A50848118A190C328D42481965004C32ED +:1029F00016757AA67DDFFFFFFFFF328CAF6A528328 +:102A0000CA419BC61CC79BAE346C8B212911EB2994 +:102A10002D2A2D2A2D2A4D2A4E2A8F3AEF4AFAAD19 +:102A2000FDDEAF736208420063086821CA290C2AE0 +:102A30002D2A6911A3004419B174B1740F5CF053CD +:102A40008F4B2D430C3BAA326932282A8719471134 +:102A5000271906190619E618E61806190711681944 +:102A60006819A921EA292B328D3A8D3A6D326D32DF +:102A70005053B0637174F6AD19CF8A63853B44330C +:102A8000643BC6432754064C485C695CCA6CCA6CFC +:102A9000EA6C8C850D964CA60EBFB0D7F1DF70CFD7 +:102AA0006DA66A854554623BE22A8122211AE532ED +:102AB0008A53ED5B7174F584747C3474557CF46BCB +:102AC00094639463956B956B956B956B9563546369 +:102AD0003463766B966B776B776BB873D97BDA7BE5 +:102AE000FA83FA83DA7BDB7BFB83FB83DB83DA838A +:102AF000D98BD693B0A38CA3EBB3EED412EEF5FE34 +:102B000017FF54E6AFA4C862432940084008643167 +:102B10008C7394B55AEFFDFFFCFFBBFF59FF17F70D +:102B2000F6F6F5F6D5FED4F6B3FE92F672F650F64A +:102B300030F630F630F651FE93FE93FE93FE52F6D9 +:102B400010F6CFED8EED6EED4DED4CED2CED2BED49 +:102B5000CAE4A9E4AAE469DCAAE4EBECA9E40CE584 +:102B60006CB4E02852ADBDF7FCE638ADB67BB2627E +:102B70006F6A8959C248E040E2510473A48BE5931F +:102B8000C051A03043624673A67BC67BA67B467BC2 +:102B9000C8932BA4C67A6149C251E251826A257B4F +:102BA000ABACC98B6028C569E9C24AE36AF36AF332 +:102BB0008AFBEBF3ADF4B1FD75FE59FF2F94E418D9 +:102BC000A408E708AB214D3AEF52EB3185008E3A6D +:102BD000F5745AA67DDFFEF7FFFFF1836F6AF17A85 +:102BE0008939BBCEBFDF7BB65474EC296919EC2957 +:102BF0002C2A2C2A2D2A4D2A4D326D32537C3EDF51 +:102C0000159DC418410063086821CB29CB21EC2114 +:102C10002D2A4911A3080311D27C338550640F5C1F +:102C20008F4B0D3BEB3A8932893229328719471194 +:102C30002619061906190619E6180619271968191A +:102C40008921CA21CA214C328D3AAE3AAE3AAE3A07 +:102C50005053B05B5274D6A519CF8A5B853BA54310 +:102C6000A543653BC643685CCA6C4B7D8B85AC8DC8 +:102C70002E9ED0B6EFB6F3D7B0CFADB6888D246414 +:102C8000223BE23282228422C62A293BCD53B274EF +:102C9000D484947C9684557CF573B56B946374638B +:102CA0007563756375637563956B3563145B355B2D +:102CB0005663976B9773B873D97BDA7BFA83DB83A0 +:102CC000DB83FB83DB83DB83DB83DB8BDA8BD793D9 +:102CD000B3938FA3CCB38CCCD0F5D4FE15FFD2CD5B +:102CE000CB8BE54980182008A1186852909CD8E643 +:102CF000DCFFDCFFBAFF58FFF6F6D6F6D5F6D5FEB8 +:102D0000D4FEB3FE72F671FE51FE30F60FF6CEED34 +:102D1000CEF5CEED8DEDAEEDF0F5F0ED10F6CFED9C +:102D2000AEED6DED2CEDCAE4CAECEAEC0BED0BF563 +:102D3000CAECCAECAAE489E4AAE4AAE469DC8ADC65 +:102D40006DBC0039D0A49CF7DBDE58B5388C757BA0 +:102D50009162EB612451C0406049A3628583848302 +:102D6000A78B015A0041A0516262E46A057BC57AD3 +:102D7000857AA2610151C35964628362C372247B64 +:102D80002EB5245A8030A892E9CA4AEB2AF34AF3B6 +:102D90004AF3CBF38DF470FD54FE38FFD1ACC31869 +:102DA000A508A60049110C32EF524C3AA600AE3AE3 +:102DB000B56C19967DD7FEF7FFFF128C6F6AD17242 +:102DC0008939BCCEDFE79CB65574AB218A190C2A31 +:102DD0002D2A2C2A2C2A4D2A4D32AE42B8AD5AC685 +:102DE000083A4200630088214D3A0D2AED210D2258 +:102DF0002E2A8A19C408C208D17CB5957064716402 +:102E0000D0534E43CB3AAA328A3A6A3AE929671933 +:102E1000471926190619E518061906192611481921 +:102E20006819CA2189192B2A8D32AE32AE3A0F4366 +:102E30007153905B93749595D8BECB63C643E64BB4 +:102E4000074C6964CA6C8C852E968FA68DAECDBE5C +:102E500090D7B0D7EEB6CA8D655C633B601A82220C +:102E60008422862A2A43CF5B126C3374147435741F +:102E700015743674167CF673D673D66BB66BB66B58 +:102E8000756B55635563556356633663576B98731B +:102E9000B97BD97BB97BB97BB97B997BB97BBA7B91 +:102EA000BA7BBB7BDC83DC83DB83D993B59B8FA3AD +:102EB000ABB38BCC4DE592FED5FE50BD29734231AC +:102EC00060102008E2200A6394BD5AF79AFF79FF48 +:102ED00016FFD5F6D4FE93F632EE52F693FE72FE4E +:102EE00072FE51F630F610F6EFF5CEF5CEF5AEF5F2 +:102EF000AEF5CFF5EFF510F6EFF5EFF5CFF5CEF532 +:102F0000CEF5ADF56BF5EAECC9ECA9ECCAECA9EC91 +:102F1000EBECEBECCAECEAEC0BED0BEDEAEC0CE5C0 +:102F2000EECC82414E94BDFF3DF778B5178CB77B50 +:102F3000F36A4E62855941510041025A45736573E7 +:102F400003734583E4824272026AC2696269016165 +:102F5000A160E26062616472E572825AC272089C8A +:102F60004C9CA0288461E9AA09D34AEB2AF329F3EF +:102F70002AEBCBF38DFC2FF5F2F518FFD5CD2421EC +:102F8000A408A608E708AA21AE4A8E4AA7088D32EF +:102F90007464B88D3CCFDEEFFFFF7394D172D172B1 +:102FA000272919B67ECF1A9EB35B29118A19EC2105 +:102FB0000C2A2C2A4D2A4D320C2A7063B8B52D6389 +:102FC0006208420007116D3A6E3A6F324E324E2A55 +:102FD0002E2A8A19C408C208506C58AEB2745164C3 +:102FE000115CB053EC3A8A326A326A3AC9218821BC +:102FF000882168210619E5180619061927194719A5 +:10300000AA210B2ACA21CA212C2A4D2A8E2ACF3A5C +:10301000514B9153936C968DB9B6EC5B685CEA6C3E +:103020006C7D4B85AC8D8FA6F0B651C791CF70CF1C +:103030006BAE2785E353C1326222A422E7324A43B2 +:10304000CE5B1164136CD36BB46BB56BD673F67334 +:10305000F773F673B673B56BD66BD673D673D77337 +:10306000B773B773B773976B776B977398739873DE +:10307000B97B576B166316631663D55AD65AF76237 +:10308000BA7BDB83DB83B98BB793939B6EA3CBBBFC +:10309000CBDCCDF551F64EC5E76A02298010200839 +:1030A000E2204B6BD5C5BBFF9AFFF7F694EEB4F662 +:1030B00093F672F672F630F610F6F0F510F610F69A +:1030C000EFF5EFF5CEF58DED8DF58DF56DED8DED23 +:1030D000CFF50FF610F6EFF5EFF5EFF5EEF5ADF5F0 +:1030E000ADF54BED2AEDE9ECA8E488E489E489E448 +:1030F000AAE4EAEC0BF54BF52BF50BED0BED0CE52B +:103100002FD52462CC837CF7FBE699BD578CB77B27 +:10311000357370628751C56141516049425A4573A8 +:103120004473A26A8272A37A637A037A047A63711F +:103130004371A479457AC57A0473C36A858BABACB5 +:10314000A349A030C892E9B26AE38BF34BF32AF3A8 +:103150006BF32DFC8DFCCEF491F5F7FEB8E607423B +:103160008408A608C60848194C3AEF4A08116D327F +:10317000545C9885FBBEBDE7FEF7949C6F6AF27ABB +:10318000283116953AA6167510430909AB198A1904 +:103190006A118A11CB19EB212B329484728CE418BA +:1031A0004200A4084C3A8E3A6E326F322E2A2E2AF2 +:1031B0002E2A8A19A408C208AD5B99AE3485316401 +:1031C0001264D15B0D43CC3A8B3A4B32C921892131 +:1031D0008821882106190619E5180619261168198B +:1031E0000B2A0B2A0B2AEB212D2A6E2A6F2AF03A82 +:1031F0003143914BB474758D98AEED5BED8D0D96AA +:103200000D9E0B9E6CAE6FCF70CFEEB6CA8D455C37 +:10321000E22A61228322E73A8C53316C126C136CE0 +:10322000D46B9463535B545B7563B66BF673D67360 +:10323000B56B9563756B756375637563966BB773E3 +:10324000D873D873B873B87397733563D35AF45A75 +:103250001563D55AB45AB452B45AB45AD55A1763EE +:1032600059735873787B948B6FA38BB32ACC0CDD86 +:10327000EFED0DC50873423180184008C1184B6B43 +:1032800015C6BBFFB9FFF6F673EE73F6B3F693F609 +:1032900032F631F671FE30F6EFF5AEF58EED8EEDCD +:1032A0006DED8EF56DED4CED2BED2BED2BED8DEDEC +:1032B00010F630F630F6EFEDCEF5CDF5CDF56BF539 +:1032C0000AE54AF52AEDC9ECA9ECA9E4CAECEAEC56 +:1032D0000BED2CF52BF52CF52CF50CF50BEDABDCF3 +:1032E000EED42883296BDDFF3CEFB9BD989C188490 +:1032F000B77BD2622D5A66510472805980510152B7 +:10330000C362456B44738362225A22628572A5723E +:10331000E5722783C57A636AA27A658B8AA4846A78 +:103320006028477AE8AA29CB8BEB8BF36BFB6BF316 +:103330008CF32DFC8EFCCEF4B2F5B7FE7BFF4C6B0C +:103340008408A508A608E710CB29EF4AAA216D3208 +:10335000956498859AB6BEE7FFF7B4A44F62506AA9 +:103360002829537C1A96F67410436A110D2AAB195A +:103370004A116A116A1169112F5356A54A4A620807 +:103380004200A8218E3A6F3A6F3A8F3A4E322E2A77 +:10339000ED218A19C408E308EA4217A6306CAF5B36 +:1033A000B05390532F4BCD3A8D324B2AEA21CA218C +:1033B000A921882106190619061906192611C929F5 +:1033C0000B2A0B2A0B2A0C2A6E2AD032F132114317 +:1033D0001143B25B15857595B9BEED638EA68EAEB1 +:1033E0000FBFB1D74FC70BA6C77443438122621AE0 +:1033F000E62AEC53916C9274136CD46B94637463EF +:103400005563756355635563556355637563345BE5 +:10341000345B55635463345B34635463756B756B11 +:10342000556B546B546B5473336BF1628F5A2D4A46 +:10343000AC39EE412F4A2F4A0F4A104A715AB362F3 +:10344000D36AF37231836E9BEBBB8BDC4CE54CD5BE +:10345000878B6139801040086010C95A93B5BBFF53 +:10346000BAFF57FF15FF92F630F630FE92FE51FE7E +:1034700010F630FE10F6EFF5CEF58DF54CED4DF56E +:103480006DF58DFD8DFD6CF50BED0AED6BF5EEFD2B +:103490000FFE50FE30FE2FFE30FEEEF54BED2AED16 +:1034A0002AED4AF50AEDC9E4CAEC89E469DCCAE40C +:1034B0000BF50BEDEBECEBECAAECAAEC89E46ADC87 +:1034C0008CD46993875A9CF71BE798BD7794F8834F +:1034D000D87B7673D16ACB5144514572E369C159A7 +:1034E000215AE46A6573667B267B067B067B267B16 +:1034F000467B05732262E16104836793C2594028C9 +:103500000572E9A209C36ADB4AEB4BF36BFB6BF371 +:103510008CF3CDF34DF4CFFCD3FD96FE7BFF54B579 +:1035200005218408A508A60048198D420C328E3A60 +:10353000B56C988559A69DD7FFF715AD6F6A0F62D8 +:103540002931916B1A9E166DAE3A8B19ED296A11CD +:103550004A114A114A110B2AD58CD494E3186208F7 +:10356000A4080B324D324E326E32AF3A6F322E2AF1 +:103570000D2A8A19A308A20069323485EF5B8F53A4 +:103580007053504BEE3A8D328D326C320B2ACA2179 +:10359000C921A92126190619061906192719C929A9 +:1035A0000B2A0B2A0B2A2C2AAF32B032F13AD03236 +:1035B000B0329153F584B69DFAC6ED6B6FCFB1D79B +:1035C00050C7EC95A86C0333421AC6326A43AD5318 +:1035D000526C5474F36B735B745B7463545B545B35 +:1035E000555B355B345B355B1453D352D352135365 +:1035F000145B345B7563956BB573736BF05A4D4A0E +:103600000C42A93988396639453965418541A54952 +:103610008549864987498849CA51EB598E72318B51 +:10362000B29BD0ABACB30AC4ECDC4EDDEA9BE34901 +:10363000C12060106008E639F1A47AF7DAFF77FF5D +:1036400015FFD3FE91F630F6CDF58CF54CED2CED53 +:10365000AEFDCFFDCEF5CEFDADFDADFD8DFD6DFD1D +:103660004CF56DF56CF56CF56CFD4BF54BF54BEDD4 +:10367000AEF5EFF5EFF50FF6CEF58DED0AE50AEDB7 +:103680004BED4BED0AED0AEDEAECCAECAAE40BF5C2 +:10369000EAECCAECEAF489EC69EC08E4E8E308DC5B +:1036A0000ACC69A3885A3BDF5CEFF9C5B89CF78365 +:1036B0009773B77B76739162AB514649056A237263 +:1036C000226A426AA36AC36AA47284726472236A19 +:1036D000A2696161A269457A246AA0386038257AB6 +:1036E000E9AA2ACB8BEB4AEB2AF32AF32AF34BF312 +:1036F0006BF3ACF34DFCAEF450FDF3FD18FFD8EEC8 +:10370000CB628308A508C608E708CB294D3A8E325C +:103710007564987DF88DFBBE7DDF16ADB072CF5914 +:10372000E930EF5A1A9E987DCE3A8A19EC216A1137 +:103730004A1149112911CE42779D0C53A208620803 +:103740002719CB29CC21ED294E324E322E2A2E2A92 +:103750004E32CA21A308C208072AF37CCF5B2E4B46 +:103760002F4B0F438D324C2A4C2A2C2A0C2ACA216B +:10377000CA2988214719061906192619A9210A32CA +:103780000B2A0B2A0B2AAE3AF03AF13A113BD0320F +:10379000B0329153F58C18AE5CDFCD6BEEBEAB95BD +:1037A000065CE332E632CB4B4F64D37C536CF2635E +:1037B00093639463545B545B5563345B345B355B58 +:1037C00034533453145B145313531353125353632E +:1037D0007363936B5263D0522C424829A510A410F6 +:1037E000452948520A6BAC8B2D9C8EAC30C591CDCF +:1037F000B2D592D552CDF1BC91B40FAC8E9B4C9BFF +:103800006CA36AAB09C42CE5ECD48472C020801090 +:103810004008E220AC7BB7DEDAFF77FFF4F6B2F6C1 +:1038200071F62FF6EDF5ACF50AEDA8E447DC47E4B8 +:1038300068E4CAEC0BF52CF589E448DC08D429D4FB +:103840008BDCECE4CBE4CBE4CBE40BEDA9E4C9E402 +:103850006CF58DF5ADF5AEF58DED6DED4CF50AED34 +:103860004BED4BED2BED0AED2BF54CF52BF50BF558 +:10387000CAECCAF469ECE7DBE8E3A7DBA7DB87DB8C +:10388000A9D3ABB3A86299CEDDFF9ADE18AD178C31 +:103890009673B773B87B156BB2620D5AA7598461E2 +:1038A000C269E271226A426A236A0262C261A26943 +:1038B0008371A3796269804840406361889209B34B +:1038C0004AD38BEB6BF32AF32AF32AF32AF32AF376 +:1038D0004BF3ACF30DF46DF4EEF470F533FED7FE5C +:1038E00070A4C320A408A608C608E7080C326E32EC +:1038F000D34B787DD885589E59B6B494B172106A6E +:10390000EA382D4ADA95F98D2F438A19AB196B11D4 +:103910006A114A116A11B15B358DA621A20883088C +:103920008921CB21AC21CC210D322D2A2E324E32D1 +:103930004E32EB298300C3088519F3847274ED427B +:10394000EE42AD3A4C2A2B2A0B22AA198A19891960 +:10395000A921271947190611061167210A322B32AE +:103960004C3A2C32AD3AEF42314B3143113B1143CB +:103970001143B25BD48418AE5CDF6B5B443B053310 +:10398000694BAD5B7274B584757C146C936373631F +:1039900074637463345B55631453F352F34AF45203 +:1039A000F4521453345B135B125B726B3484748C6B +:1039B00090738B5267296208A318E741CE7B73B5D9 +:1039C00077D618EF38F717FF17FFF6FEF5FEF5FE6E +:1039D000D4FED4FE94F694FE74F612EE91E50DD565 +:1039E00049C4AAD4AFE58CB4A34940104008801064 +:1039F000054231B558FF77FF15FFD3FE50F6CDEDE8 +:103A00008BED8AED6AEDE8EC87E466EC46EC46EC7B +:103A100007ECE6E386DB66DB25D3E4C284B285A24D +:103A200007A30ABC4BC40ABC09C4E8C3A9DC2BED3C +:103A30004BEDACFDADF58DED8DED6DF5ADFD4CF5C2 +:103A40002BED4BED2BEDEAECCAECEAECCAECCAF438 +:103A500089EC49ECC7E386DB46DB67DB67DB47D3F2 +:103A600027CB8AB3C96217B6FDFF3BE799BD568CD9 +:103A7000F683D77B5673F56294627262B172EE8AF6 +:103A80006892627940694061405920590051E05084 +:103A9000C050A050C050837987A2E9BAE9CA4ADB76 +:103AA0006AF34AF34AF32AF32AF34AF36BF34AF32D +:103AB000ABF3ECF30CF46DF40EFD6FFDB0F533F6E3 +:103AC00035E66852A410C608E708E70849194D32E0 +:103AD000313BF76CD885189659B6548C6D51D06926 +:103AE0000B41ED49D995D98DEF426A198A196B11AD +:103AF0006B118B110D22D25B93744411C308C41057 +:103B0000AA21CB21CC21CC210D2A2D2A2E2A4E32BE +:103B10002E32EB298300C3080309D27C56950D4B46 +:103B20006C322C2A2C2A0B22CA19691169114811EE +:103B300048192719061126196719A9212B322B328A +:103B40004C3A6C3AEE4A0F4B0F4B504B304392536A +:103B5000B25B336CD38457B63AD7E852AB53B074E8 +:103B60009374747C1574F67395637563956BB66B7B +:103B70007563346355637663355B155B155B14536E +:103B8000145B135B125B936B758CF69C3184694AF2 +:103B9000A218400823296C73B4BD5AEFDCFFDBFF89 +:103BA000DAFFB9FF98FF57FF56FF15FF14FF13FF09 +:103BB000F3FED2FED1FEB1FED1FED1FED1FE70FEEB +:103BC0002EFEEEEDE99B002940102008A0206A7B24 +:103BD00095E678FF15FFD3FEB2FE70FECDF5ACF58D +:103BE0008BF508EDA7EC87EC67F447EC06E4C6DB41 +:103BF00086DB66D326CBE5BA23A2818166924AA3EF +:103C0000AB9B0C9CCB9308832893C68AA48AC7B32A +:103C10000BE5ADF5CEF5ADF58DF56CED6DF56CF50F +:103C20000AE52AED2AEDE9EC88E468E427E4E6DB1E +:103C3000A6DB66DB45DB05D347DB47E347DB27D362 +:103C4000A6C229B30A7354A5DDF79DF71ACE19ADA4 +:103C50007794B67B5673945A535A9262538B53BCE3 +:103C600030D4ABD3E8B2669A058AE481E481058A50 +:103C7000268A879AE9AA2ABB2ACB4ADB6BEB6BF32D +:103C80004AF34AFB2AF34AF34AF34AF36BF38BF302 +:103C9000EDF30DF44DF4CEFC0EFD6FFDF0FD32FEA4 +:103CA000B6FE53BD4629E610E7100711C708CC2120 +:103CB000D03214545775F88D19A613842C498F618E +:103CC000AB406C411785B98D8D3A69196A194A1153 +:103CD0006B11AB192D2AB15B516C2409C308051176 +:103CE000AA21CC21CC21CC210D2A0D2A0D2A2D2A46 +:103CF0002D2AEA29A408A308C300717435956F53CF +:103D00004C320B220C220C22CB2169114911481193 +:103D100028192719E6106721EA294B324C3A4C3A08 +:103D20006C3ACE424F534F5350534F4B504BD25B94 +:103D3000F263B47C5495B8BED8CEA74A957C34744F +:103D4000F573D56BB66B956B355B355B5563766BF1 +:103D5000766B5663576B776B976B36635763566317 +:103D6000756BF57BD69CF9C515A58A52C318000062 +:103D70002421EE8398D6FDFFFCFFBBFF9AFF79FF5D +:103D800058FF57FF57FF36FF15FFF3FEB1FE6FF6E2 +:103D90004EF64DFE0CF60CF62CFE4DFE6DFE8FFE23 +:103DA0000FE62783C02860104010C341EEB4F6F63A +:103DB00016FFB3FE72F651FEEFF5ADF54CED2BF5A7 +:103DC0000AF547E426E405E4A5E386E366D346CB9B +:103DD00006B3658A4261A040C5594FA499E6B9DE91 +:103DE000D5BD12A570844C63EB5A2B732A7BA35963 +:103DF000C261E9ABCFED0FFEADF58CF56DF56CF55D +:103E00002AEDC9E4C8E4C9ECC9EC47E4A5DB23D337 +:103E100004D3E4D2A3D283D206DB07E385CA45C22A +:103E200066C209B38D8B718CBDF77CEF1ACE79BD5C +:103E3000979C967BF56A325A7162729392C4D1DC78 +:103E40008EE42CEC0CECECEBECE3CCE3CCE3CDE33C +:103E5000CDE3ACE3ACE3ACEBCDF3CDF3CCF38CF33F +:103E60006AF34AF32AF32AF34AF34AEBACF3CCF3AE +:103E7000EDF30DF46DF4CEFC4EFDAFFD52FE73FE7E +:103E800034F6B8F6F093E620A608E708E8088B19A0 +:103E9000F03AD44BF66CB885F99DB3732D49EE50CA +:103EA0008B40EA30347499956D3A491949192811B3 +:103EB00049118B192C22D25B716C2409A208261996 +:103EC000CA21CC21CC21CC21ED29EC29EC29CB2114 +:103ED000CA21A829A308A208C200CF635595B05BE8 +:103EE0004C320C2A2D2AEC21CB2169114911481999 +:103EF00028112711271188210A324C3A6C3ACE42F8 +:103F00000F4B5053915B905B70534F4B9153D15B70 +:103F1000326CB37C9495B7BE56B6463A7463345B44 +:103F200055635563766B766B566B776B576B976BF8 +:103F30009873B8739873576BD55AD55A566BB67336 +:103F4000B89C7DCE7BD6CF7B24294008A1104B6B3B +:103F500077D6FDFFFCFF9AFF79FF37FF37FF16FF8B +:103F600015FFF5FEF4FE92F671F670F66FFE4DFE4B +:103F70002CFECAED69ED48ED69ED89EDECF54CD507 +:103F80006362802040108018E86A12D615FFB3FEE5 +:103F900031F630F60FFE8DF54CED0BEDCAECCAECA8 +:103FA00048E4A5D3A6DBA6D387D3E5B2449A4169FA +:103FB00060400020A549919C3CE7FFF7FBD679C6FD +:103FC00079C618B6969DB37C8F5B0C534C63AD7B62 +:103FD000E6514028236AABC4EFF5CEF5ADF56CF59C +:103FE0002AEDC8E4E8ECE9ECE9EC88ECC5E344DB55 +:103FF000E3DA62D263CA43CA64D265D2E3C1E4B9E8 +:10400000E4B146A26C8B50849CEF5CE7F8C537ADF9 +:10401000B89CF78BB362916AF39B14CD92EDB1FD1E +:1040200090FD2FFDCEFC4CF4ECEBCCF3CCF3CDF3B8 +:10403000EDF3CDF3CDF3CDF3ACF38CF38CF3ACF324 +:10404000ACFB6BF34AF34AEB6AEBCCF30DF42EF4C2 +:104050000DF4ECEB2DECCEF491FDD2F50FD5EFC4C1 +:1040600032CD74CDB7C5D1836929A700E8088B1973 +:104070006F2AB34BF66C98857895726B2D49ED508D +:10408000AC488A30115B5895AE4248190711E710C9 +:10409000E8086911CB21504B93744509A200061121 +:1040A000CB21CC21EC21CC21CC210D2A0C2ACA21F8 +:1040B00088218721A308A208A2002C4B5595F06304 +:1040C0004C32EB210D220C22CB21691948114811E9 +:1040D000281107118821C9290A320B324C3ACE42E5 +:1040E0005053915BB15BD15B6F536F53D15B1264E3 +:1040F000516CD27CF49DD7BEB3A5E43154633563D3 +:104100003663776B98739973B97B7873576B376B9A +:10411000376B576BD55A9452D55AB77B999CDCC5EF +:104120003FEFF8BD6A5281104008843132ADBBFFC9 +:10413000BBFF79FF58FF37FFF5F6F4FEF3FED3FE21 +:1041400091FE50F60EF6EEEDEEF50DF60DF6ECF5F1 +:10415000CCF56BF5E9ECC8E4A7E40AE5AAC4E2599A +:104160006018401020314C9C73EE93FE72FEEFED10 +:10417000CEF56CF52AEDA8E468E489EC8AEC8AECCB +:10418000E7E3E8DBA8C3E69AE371E0400020001013 +:104190008541919C3CEFFFFF5EE71595F1737384B9 +:1041A000727C769DD7A5D7A5559551744D532D5347 +:1041B0008E6B895220108028C67AECD4ADF56BF551 +:1041C000E8EC49F529F509EDE8EC88EC27EC64DB2F +:1041D000C3D242CA43D223CAE3C1E4C104CAE4B988 +:1041E000C4B146A28D932F841ADFDDF75CEF5AD657 +:1041F0005AAD168C327BF393F2C413EE52F651FE95 +:1042000031FE11FED0FD6FFDCDF42CECECEBEDF3A7 +:104210000DF40DF40DF4EDF38CF36BF34BEB8BF32A +:10422000ACFBCCFBCCF3ECF32DF44EFC4EFC2EF4AB +:104230002EF42DF4AEF431FD90D48DA3D2B49AE6D1 +:104240005DF73EF79FFF5FEF5AA56F420A114A11D3 +:10425000CD19724395647885788D115BEC38AC4844 +:10426000AC408A30EE49D7940F530711C610E708C7 +:10427000E708281169116C2A52648A328200E5101D +:10428000CA21CC21CC21AC21AC210C2A0C2ACA2178 +:10429000A921A829C308A208A200893A7695116429 +:1042A000AD42EB210C220C22EB2169194911481176 +:1042B000281107118821EA292B322B328D3ACE4260 +:1042C0002F4B705370538F5B6F53B05BF16331644E +:1042D0005074118534AE17C710950432B773B77395 +:1042E00098737873586B186BD662B55A945A745297 +:1042F000B55A376B987BF983BB9C7DB59EDE7FF703 +:10430000F4A4653181104008475256D6BAFF78FFB1 +:1043100037FF36FF35FFF3FED2FE91FE4FF60EF665 +:10432000EDF5EDF5CCF5CCF5CCFDCBF5ABF56AEDC7 +:104330004AF5C8E488E468E489DCE8BB60494018D1 +:10434000401062390EBDD4FE72FE51FECEF58DF5E1 +:104350004BEDC8E4A8EC87ECE6DB07E408E429DCD5 +:10436000A7C3439200596030001800082429108424 +:104370003CE7FFFF9FEFB8AD4F5B0B322B3A6C3A37 +:104380008C429063116C149518AEF7A51485D06318 +:104390002D536E63AB5281180010404987A30BDD8B +:1043A0000AE54AF509EDC8ECE9F487EC47ECE6E3E9 +:1043B00025DB83D243CAE3C1E3C1C3B9C4B9C4B9DD +:1043C00026BAE9BAAEA3519478C6DEEFDEF73DEF28 +:1043D000DBBDD7A4B5ACD2B454EEF5FED4FEB4FE2A +:1043E00094FE73FE72FE11FE8FFDCDF44DEC2DF4A4 +:1043F0002DF42EFC2DFC0DF4ABF38BF36BF36BF370 +:104400008BEBCCF30EF44FF46FF44EF42EECEDEB9B +:104410000DEC2EEC4FE44CB3CC8AF9DDDFFFFEE669 +:104420001BC6BAB539A53AA51A9DB98C12536B199A +:104430004B116F2A755C9985588DAF528A306B404D +:104440008C406A382C39D483EF5AC608C608C6088F +:10445000E70808114911CA19904B526405098300F5 +:104460008921CB29AC218B198B19CC21EB29A921CE +:10447000A921A829C410A208A2004832358D116CC8 +:104480002F532C2A6D2A2D2ACB216919491169191C +:10449000481927114719EA294B326C3A8D3ACE4216 +:1044A0002F4B4F536F536E536F53B05B1164306C8F +:1044B0009074719574B6F6C60C746542776B36636A +:1044C000D55A955A9552955AF662376B997BFB8B64 +:1044D0003C945C945B94DBA45BB57DD63EEF518C41 +:1044E000042161084010C96275E616FFB4F6B3FEF8 +:1044F000B2FE91FE6FFE2EFECCF5ABED8BED8BF593 +:104500008AF56AF569F569F549ED28ED28ED29F593 +:1045100029F5A7E466E468DCA8B3405140184018C8 +:104520000352AFCDF3FE50F6EEF58CF54BF52BF5BF +:10453000C8ECA7EC66EC06E4C6E3A6DBA8D3E6A2CB +:104540004159402820180008A2182C6B79CEFFFF93 +:10455000DFF73ABED26BCB2929198B21AB210B2A6D +:104560008D32EE424E536E5BF48CF7AD18B6B6A5A5 +:10457000B37C8F532D538A42A21820106020236AE7 +:1045800049C4EAE4A8EC87ECC8F467EC07E4E7E385 +:10459000C7EB46DBC4D243CA23C2E3C104C205BA97 +:1045A000C7C24ABBCDAB71A4B7AD5ED75EE75BD6E1 +:1045B00058BD16BD70ACF4DD58FF37FF79FF58FFCA +:1045C00017FFF6FED4FE72FEF0FD4FF5CDF48DF42C +:1045D0002DF42DF42DF40CF4ECF3ECF3CCF3CCF33C +:1045E000CDF3EFF3F0EB10EC0FEC0EE4EDE38CD336 +:1045F0006CCB6EC34B92EA713AE6DFFFDEE6FBC599 +:104600003AA5B9945884588C988C5BA5DCB5CF4AF0 +:104610006B19CC19D34B9985798D8F4A8A306B38B9 +:104620008C408B38AB3890628E4AC508C608C608E5 +:10463000E7080811291149116D32F263ED4A630050 +:10464000A500AA21AB218B196B116A196A194819A7 +:1046500068196721C308A208A208C629158D3274FB +:104660002F532C2A6E324E2A0C2A8A19691969197D +:10467000481947194719A921EA296C3A6D3AAD3A08 +:10468000CD420E4B2D4B4D536E538F53F063306C18 +:104690008F74919D74B6F6C60853E752534A74520C +:1046A000F6623773B9833B8C7D945C9C5C941C8C64 +:1046B0001C941B8C7B9C7DBD5DD61DEF1084E2207D +:1046C000811840102973B5EE72F6EEEDEEED0EF6A0 +:1046D0000EF6CCF58BED28E528ED49ED49F549F5C9 +:1046E00028ED07EDE7ECE7ECE7ECE7ECC6E4C7EC18 +:1046F00066E4A7ECC9E429C48159402040186362EC +:10470000EFDDD2FE2FF6CDF54BF5C9E488E447E4A2 +:1047100087ECA7F446EC06E486DB46C3238A804098 +:10472000401820086110694A55ADBFF7FFFF9BCEC6 +:1047300053844C3A2811091109114A196A11AA190E +:104740000B1A2B228C322E4B6F5B527C75A5F7AD6A +:1047500018A6768D526C6E5B8A42C310200800103A +:10476000004967AB69E427DC47E406E4C5DBA6DB68 +:1047700086DB66DB86E3C4D223C243C245C2A6C23F +:1047800009CB4ABB6CAB30AC76A5BCC6BCDE19CE3F +:1047900056BDCE9372CD38FF59FF5AFF9BFF9BFF4A +:1047A0009AFF79FF58FFF5FE93FED0FD2EFDADF484 +:1047B0004DF42CF42CFC2CF40CF42DF40EF4CEE37C +:1047C0002ECB6BAAE991E9894A9A8AA2CBAACBAAF5 +:1047D0008BA2A9798A6959D5BFFF9CD6FBC5BBBD01 +:1047E0007BAD3AA59CB5FDBD3DC6FFDE7FEF76846F +:1047F000AB218B11103B587D9995B052AA306B3884 +:104800008B408B40AB408D49CB39A500C608A6082C +:10481000E708281149114911EC21314BF2632A3282 +:1048200043000611CB218B196B194A19281907115E +:1048300006112619A3088208C2086519B3843274C8 +:10484000EE4AEB290C222D2AEC218A19691948110C +:10485000281127116821A921EA292B322C324C3248 +:104860008D3AAD3A2D4B2D4B4E4B4E4BCF5B2F64BB +:104870008F7CB29D54AE95BE243AAA6B5873FA83CE +:104880005C945D9C7D9C5D945D943C945D9C9E9C41 +:10489000BEA4DDAC9DBD5ED6FDE6318C0421A11821 +:1048A0006018A66AB4F671F6EDEDECF5CCF5CBF533 +:1048B000AAF569F528EDC7E4A6ECA7ECE7ECE7F468 +:1048C000E7F4E7F4C7ECC6ECE7ECC7ECC7F466EC3A +:1048D00025E488E409BCC26160204018826AEDE5E5 +:1048E0008FFE0DF6ACF56BF5E9EC67ECC5DBE6E3A6 +:1048F000E5E306EC47EC07DC67BBC271402800101B +:104900008118494A14A55EE7DFF75BC65484AE4AB6 +:104910004919E910091129190811C608E600E91119 +:10492000ED2A0D33CD32CD3A0E4B6F53D063D38C7D +:10493000D7ADF7ADD79D348531640C4345212008B0 +:104940000010E04088BBE8DBE6DBE6E3C5DBC6E35E +:1049500085DB86E366E3C3CA62C263C285BA08C365 +:104960004ACB8BC34BB3EFAB77AD7BBE7BD6D7CDFA +:10497000AD93EFB438FF79FF7AFF9BFFBCFF9BFF3D +:104980009AFF79FF59FF17FFB4FED0FD6EFDCCFCF6 +:104990004CF40BF4EBF3ECF32DF44FF48FD34CA267 +:1049A0000A694B69B2A3B5BCF3AB6D7AAA698A698F +:1049B0004A618E7A1BDE9FFF9EDE9AB599B51BC6B3 +:1049C0001BC69DD69FEFDFF7DFFF7FEFBED61895A2 +:1049D000CC296A118E2A187D798D8F4AAA306B38BE +:1049E0006B406B38AB402C41C818A608C608C608F7 +:1049F000E60848198A198A190D229353346CD26338 +:104A00004611630048198A218A196919271106116C +:104A100006190619A3088208A2082419927CF163DA +:104A2000CD42CA29EB21EB21CB2149114811281194 +:104A300027114819A921CA294C324C324C324C3228 +:104A40008D3AEE424E4B4E4B4F4B4E4BCF5B506C24 +:104A50001085F3A596BEF3AD4021AD947D947D9C69 +:104A60005D9C5D9C7E9CBEA4DFACBEA4BEA4DEA407 +:104A7000BDA43DB5DCC5BDE6D3A42429A11880188A +:104A8000035211E670F6ECEDABF58AF569F548F5E1 +:104A9000E7ECA6E486E486E446E446DC46E445DC4E +:104AA00066E486EC86EC85EC86EC86EC25E405DC99 +:104AB00047E469D4E26940206020C472ECE52BFE33 +:104AC000CBF56AED4AF5E9F467ECC5DBC5E3C5E370 +:104AD000C5E307E407DC67BB826100184010494A60 +:104AE000F49C1DDF9FEF3ABE74848D424919E81093 +:104AF000E91009110811C70085002601AC22F04316 +:104B00003144AF3B4E43ED42AC3ACC3A0D4B6E5B79 +:104B1000F0733495F8A5189EB78DF47C106C493A63 +:104B200061080010005147BBE8DBC6E3C6E3E6E3DB +:104B300065DB65E304DBC3CA04D3A4CAC5C228CBC2 +:104B40004ACB4AC34BBBAEAB36ADF9B55AD6EF9B99 +:104B50002DA417FF58FF59FF7AFF9BFFBCFF9BFF57 +:104B60005AFF59FF79FF17FF94FED0F570FDCEF480 +:104B70004EF40DF4EDF3EDEBCDE34DCB2C9A0A6939 +:104B80008D699CD5BFFFBFFF1FF77EE69BD5F9BCA3 +:104B90005BCDDFF63FEF5CCEFBC53CCEBDD6FEDE87 +:104BA000FDE65EEFBDF7BDF79EF7BDD6DBB5D88C51 +:104BB0000D2A6A110D1A966C18856E4AAB306B3847 +:104BC0006B408B408B38CA30C818A608C608C60888 +:104BD000E70849118A19AB192E2A93531464536CB0 +:104BE00009326200E6106919691948112719061976 +:104BF00006190519A3086200C3100411106C6F5345 +:104C00008C3ACA21EB21EB21CB21891948190711D4 +:104C1000481989218921EB292C324C324C328D3AAA +:104C2000CE420F4B4F4B4F4B4F4B6F4BAF5B7074A4 +:104C3000519514AED8C6F094E0188FB59E9CBEA4D2 +:104C4000BFA4BFA4BEA4BE9C9D9C5C94FA83B87B09 +:104C5000B77B9794B9BD14ADA639C218A0184139D5 +:104C60002DCD0EF6EDF5ECF5AAF528EDC6E486E4BB +:104C700086E4A7EC88E447D448D469DC48DC27D430 +:104C800006DC06DC25E425EC06EC26EC06EC27E445 +:104C9000AADC8482602860208272ECE52BF6E9FDB4 +:104CA00048EDC7E4A7EC67ECA5DB85E385E385E386 +:104CB00085E3C7DB47ABE0480010E64155AD9EEF0A +:104CC0005EE7D9B5F273AE4AAA210911081108119D +:104CD000C71085086400E5004B12AF2B3134102C4F +:104CE000103C51547174CF6B2D5BCC4AAC3AAC3A4A +:104CF000CC422E5351747695F79DF79D968D147D79 +:104D00008D5B03190010626187CB85DBE6EBA5E3C1 +:104D100024DBE4D2E4DAE4D204DB05D327D389DB55 +:104D20004ACB4BCB4BC36DB3D4B4D7C590A48B8BBC +:104D3000B5F637FF58FF7AFF9BFF7BFF9BFF5AFFBB +:104D40005AFF39FF38FFB6FE12FED2FD91DCAFC329 +:104D50006ECBCFDBAEDB4DD3ECBA6CA22C71EB5833 +:104D6000D8BCBFFF3FF7BDDE3CCE1DCE5ED69FDE7A +:104D7000BFE67EDE3DCE3CCE9DDE7FF7FFFFDFFF50 +:104D80003DEF1CEF7CF71BE79BD61BBE7BA5777C1A +:104D9000ED218B11CB11B353D7844E4ACB388B38CE +:104DA0008B408B408B38AA30A818A608C608C608C6 +:104DB000E70849118B19AC190D2230435364316453 +:104DC00025118308261988216819471926190619FB +:104DD00026192619A3088208E3100411AF5BCC3A08 +:104DE0000A2ACA210B2A2C2ACB218A1948116819B0 +:104DF000A92189218921EA292C326D322C326D3288 +:104E0000CE3A2F4B704B905390539053AF53506CFE +:104E1000929575B6F9CE6A5BA03191CE9EA4BE9CE8 +:104E20003C94DA83997B166BB45A9352524AEF3909 +:104E3000B052348C35AD274AA118C120C0288BB49C +:104E40000EF6CBF5CBFDAAFD49F5E7ECA7E4C8E4E7 +:104E500047D486BBC39A2182A07160718071C081E2 +:104E600083A266C3E7DBC6DB85D385DB85DB08DC95 +:104E7000069BA0382020E2598CE52BFEE9FDC9FDF8 +:104E800007EDC7EC66ECA4DBA5E385E365DB86D321 +:104E9000C7D327ABA038802010845DE7DFF797AD3C +:104EA0004F636C424D3ACB2929110911E708A6003E +:104EB00044008400C8112D331034102C1024102409 +:104EC000513C715451647174517CF06B6F5B0D4BAC +:104ED000AC428B3A8B420D533074548DD695547D31 +:104EE000137D306C65210010238267CB45D3E3D25C +:104EF00004DBC3D2C3D2A2CA82CAA3CAE5CA27D3DB +:104F000008CB0ACBEAC22CB392B4519CE87233E6C8 +:104F100017FF17FF59FF59FF7AFF5AFF5AFF59FF32 +:104F200059FF38FFF6FE13F693ED8DABC871AD92C5 +:104F3000AD9A0A8AA889C989CA814A69EB50B282A6 +:104F40005FFFBFFF9FF71EE77ED61DC6BCB59BB5B2 +:104F5000BBB5DBBD5DCEFEE67FF79FF79EF7BEF7E4 +:104F60009EF73CEF7CF75CEF7BD679AD5A9DD5631D +:104F7000EC218B118B111143D7844F4ACB388B38DE +:104F80008B408B388B38AA30A810A608A608C60814 +:104F9000C70849116B118B112D22B253F47CAB322F +:104FA0008200E510472167214719261906190619BD +:104FB00006190519A308A208C3102411CF5BCC3A27 +:104FC000EA29CA210B220C2ACB2169118919AA21AD +:104FD000CA21A921AA218919EB29EB29EB294C32F5 +:104FE0008D3A8D32EE3A2F432F43704B904B926C9B +:104FF000D49D96BED8CE243AE35252E799731663F5 +:10500000D55A73521142AF318E316D294D214B214A +:105010000F63D4A46D73A118C120A020A69BECF54A +:105020008AF5AAFD68F507F5A7ECA8EC28CCE5926F +:105030004051402820280049C369037A237AE27945 +:10504000606900612069239A26CB26D326CBC5AAA6 +:10505000A03800202059E8C3E9E489FDC9F5E9FD3D +:10506000A9FD07F505DCE5E385E385DB86D30ACCFE +:105070000BB4C038C641F7BDFFFFF9BDB16B4B3A69 +:105080000B320C32EC216A192811C6086300430068 +:1050900027116C2A8F2B1134112C312C5134513C97 +:1050A000713C51445144504C716492747184107C31 +:1050B000AF6B4D5BAB4AAB4AEC5AAE6BF28CB28431 +:1050C000D274F374716CC6296020A692C5C2A3CABB +:1050D000E3DA03DB04DBA3D2A3D2E5DAE6D2A6CA85 +:1050E00046C227C227BA0BBB6EA34862B3D5D6FE11 +:1050F000F6FEF7FE18FF38FF18FF39FF18FF39FFDB +:1051000039FF17FF33FED3F5D0B34861D5BC9FFFFD +:105110007FFF5BE6F6C4B29B108B108315A45DE69F +:105120003FF71EE7DEDE7DD63DCEFCC5DCBDDCBD37 +:10513000FBC55CCEDDDE3EEF5EEF5EEF7EF77DEF22 +:105140007DF77DF79DF7BEFF5EEF3BC6BAA5B46362 +:10515000AB196A118B110D2A525B0F4ACB388B3871 +:10516000AB388B388A38AA308710A600A600A6086C +:10517000A60808116A11AB110F3BF574F063C30068 +:10518000C408262106192719061906190619E51853 +:10519000E518E518A308A208E310451131646F4B28 +:1051A0004C32CB21CB21CB21AA218919AA21EB2179 +:1051B000CA21AA21CA21AA21AA216919A9190B2A3F +:1051C0004C324C326C326C2AAE3A30434F43726CE4 +:1051D000D595F8C6D5AD0011888492E79452534A0C +:1051E000524A3142103ACF31AE316D294B210C3A3F +:1051F000518CB19C6431C120A02043628BE568EDE5 +:1052000027ED07EDA6EC66E4E6D345B34059202828 +:1052100000106341AC9311CDB3E5B3EDB2F591F558 +:1052200031ED2DCCC7A2E068A07065AAC6B2C05807 +:1052300020288038E6AA08E426E4C6ECC9FDE9FD8A +:10524000A9FD85E466EC27ECE7DBE8CB6CCCEFCC82 +:10525000265A6C735DEF9EEF56A5AC4A0B322C328A +:105260000C2AAB21CC19AA19C60843004300872198 +:10527000AD32503BD133F12B3134523C7244524465 +:10528000313C313C313C313CF043105C51749284F0 +:1052900092847184517C7284518CB29CF2A4B1943A +:1052A000B184B174D3749174A6390249E7B2A5CA26 +:1052B000C4D2C4DAC4DAC4DAC4DA06E3A6D2A6D207 +:1052C00047CAE6B928BA89AAA66133C5F7FED5FE52 +:1052D000D6FEF6FEF7FEF7FEF7FE17FF38FF17FFC4 +:1052E00017FFB5FEF3FD12E5CA71939BBFFF9FFF49 +:1052F0009FF7BFFFBFFFBFFF7FFF9FFF9FFFFFEE37 +:105300005CD6FBC51BC61CC63CC63CCE5DCE7DD65E +:10531000DEDE7FF7BFFFBFFFBFF7BFF7BFFFBFFFF7 +:10532000BFFFBEFFDEFFBEFF9FF7FEDE7DBEB77C88 +:10533000AA1949114A11ED292E428D39CB38AB38C3 +:10534000AB38AB388B30CA288710A600A500A6085A +:10535000A60808094A11EB19125CD4746611C30837 +:1053600067212619061906190619E5180619E51800 +:10537000E518E518A308A208E3086519F063D15BF6 +:10538000AE420C2AAA19AA198A1989198A19AA19C6 +:10539000AA19AA19CA21CA21891968198919EA29D9 +:1053A0002B328D3A8D328E32EF3A3043704B9374FC +:1053B000B59D19CF2E7CE008AC9DB1DF524A724AF0 +:1053C000524A524A524A524A103A8D294B21CE52E1 +:1053D00013A52A6BA118A0200039EBCC69ED07EDCD +:1053E000E6ECC6EC46ECA5D3C5A2A04800182010F8 +:1053F0000A7BB4DD15F672ED30ED10F5CFF4CEF486 +:10540000AEF46DF46DEC0CDCE48960504359002877 +:1054100020300582E5CA24DB26EC45E468F5C9FDA9 +:10542000E7EC86E466EC27DC6BCCCFC4B4CD8C7B98 +:10543000508C7EEFF8BD327CEE522B3A2C322C2A67 +:10544000CB19CB21CB2128116300620068196C3283 +:105450008D2AAE2ACE22EE22EF220F2B2F2B2F33B6 +:105460002F2B4F2B4F2B4F2B4F2B6F336F33D04B9B +:10547000315C9274B284D394D29CD2ACF2B4D1ACED +:10548000B19CB18C927C51742D6344410582A7BAC2 +:1054900024CA03D243D264D285D285D2A6D287CA87 +:1054A00088D248C2CAB285710EA47AFFB5FE94FEB6 +:1054B000B5FEB5FEB5FEB6FEB6FEF7FEF6FEF6FE8E +:1054C00094FE13F6B3FD8DABCA617EEEFFEE5CCEAB +:1054D0003CCE7CD6FEE61FEF3FEFDFE65ED61DCE6C +:1054E000FCC5DBBDFBC55CCE9CD6DCDE1DE75EEFFC +:1054F000BFFFBEFFBEFFBEFFBFFF9FFF9FFF9FFF1F +:105500009FFFBFFFBEFF3DEFDEE6BED6BFBEDB9D09 +:105510002C2A0709E7084A190E428D39CB30AB30E7 +:10552000AB30CB30CB30CA28A710A608A500C608E0 +:10553000C608E7086911AE32D47C8A32830067213D +:1055400047210619061906190619E518E518E51880 +:10555000E518E5108308C308C3088619F05BB15B42 +:10556000EF422C2ACB21AA198A194911691949112C +:1055700049114911EB29EB29CA29A9218819EA21E6 +:105580004B326C328D32CF3A31433043D063138D7E +:1055900037B6F9D64642E2310DA66C9E52425242CF +:1055A000524A524A524A724A3142AE31CC31128486 +:1055B000D2A48339C120802065938BED07EDC5EC23 +:1055C000C6EC25DCA5D3E4B2E050002020108D838A +:1055D0001AFFD8FED4F511ED2DDC28C385B285BAAB +:1055E000A6BAE7CA49D3ABDB2EDC679200280020BD +:1055F00020384692E6C2C4CAE7E367E4E7E448F528 +:10560000A7E486E406D449CCEFC473BDF29C928C27 +:1056100059C635A52E636B4A4C424C3A2C2AEB21D5 +:10562000CB19AB19AA21E610220042002619A919AC +:10563000EA19A911A911AA11AA118911A911AA116E +:10564000AA11AA09AA09CA090B0A2B0A4B128C1A19 +:10565000CD328F53F063307C7194B1A4B1ACD1B42E +:10566000D2A4B194717C4E5BEC5A8A72847925B2D3 +:10567000E4C1E4C9E4C904CA66D2A7DA09DBC8D226 +:1056800088CAEAC2C67988725AFF18FF74F673FE98 +:1056900073FE73FE74FE94FE95FEB5FED6FEB5FE57 +:1056A00053FEF3FDB1D4097254ACBFFFDEE63CCE2D +:1056B0003BCEFEE63FE75CCEBBBD9AB59AB5DBC5F7 +:1056C0007DD6BDDEBDDE1DE75DEF9EF7BEFFBEFFF2 +:1056D000BEFF7DF77DF75EF75EF73EF73EF75FF7BB +:1056E0005EF75EEF5EEF1EE75DD6DCB5DDA53DA69D +:1056F00034642701E708E8106B292C31EB30CB30FC +:10570000CA28CB28EB28EA20A708A608C608C6089E +:10571000C6080709A91191536E53A3006721672199 +:105720000619271947214719271906190619E518D7 +:10573000E518E518A308C308C308A621F063B05311 +:10574000CE3A2C2AAA19891169194911491128112F +:1057500049118A19EB21CA21EB29EA29EA292B32BE +:105760008C3A4C326D32CF3A30434F4BF063339525 +:1057700078C693AD0019E97372CFCDAE724A724A02 +:10578000524252423142113AF031AD312D4236A5EA +:105790008D73C018E12081498CDD07E5C6E4C6ECB5 +:1057A00066E484CB66C3C27920284018485A1AF7A9 +:1057B0001AFF36F611EDABCB46B2C3A9C2A1E2A1E6 +:1057C0008191829145B2A7CA09D3CCD3E679003042 +:1057D000203800404171449A67C349DCC9E48BF525 +:1057E00029F567DC68D44BBCF0B433AD13A5D7B54D +:1057F00076ADAF6BCD524B420B3A0B3AEB298A2177 +:105800006A21692149214821A408220001000100E0 +:10581000220062008300A408C508E50806110711EC +:1058200027194819481969198919AA19EA212B2A2F +:105830002B326B3AED4A4E638E73EF8B91A4D1A459 +:10584000F28CD27C11642D53CC6AEA92A7B224C2A6 +:1058500025CA26D205CA06CA27D268D288D2A9CAC2 +:105860000BCB899A645198E69AFFB5F653F673FE0E +:1058700073FE73FE73FE93FE94FE75F634EED4E56C +:10588000D4EDD1D46B82EE825FFFBFFF9FF7FDE6C0 +:105890001EE7BDDEBABD5AAD5AAD7BB51CCEFEE6E5 +:1058A0005EEF9EF77DF79EFFBEFFBDFF9DFF9DFF54 +:1058B0007DFF7EF71EEFDDE6BEDE9EDEBEE61FEF5D +:1058C0001EEF3FEFFEE61FE79FDEDDBD9DA59D9528 +:1058D000DC958D2A0701E8100A210B29EB28EB281B +:1058E000EB28CA28EB28C9188608A608C608C608E7 +:1058F000C60827110A22B05305090511A82147211E +:105900000619271928194819481968210619E6188F +:10591000E518E518A308C310C308C721F0636F4B4F +:10592000CE3A2C2A8A1969114911491928112811CE +:105930006919EB212C2A0B2A2B320B2A2B2A6C3AC1 +:10594000AD422B2A2D2A8E32EF3A4F4B1064959D93 +:1059500099CEAB6B20198DA570DF4DDFD35272420B +:1059600031425142103A8E29AE29AD314C4A15A52B +:10597000484AE120A020A7938BEDC6E4E6ECC6ECF4 +:1059800025DCA5CB47ABA04081286118B1AC3AFF1C +:1059900057F611DDACCB46B225C265CA27D3C9E3A1 +:1059A00068CB03A2A078E4A1A8CA0ACB6BC3E160CC +:1059B000A579A579C05880506050E058007A65AB51 +:1059C00006BC48C48BC46DAC94C5DADE1BE73CDF73 +:1059D0001CDF9BCEF9B5369DB594337C127C1274D6 +:1059E000F373B16B916BF273327C117C6E6B8A52E4 +:1059F000A73104218210410821002100220001006A +:105A000022004300430064088408C610271948197F +:105A1000A9290A326B3A8B428B52CB5AAD832F8C19 +:105A2000917C926C8F4B2D53AA720AA3E7CAA6D21F +:105A300046D2E6C9C6C1C6C1A7B9A7B907C269BAE5 +:105A4000AAA2C148F2B4FDFF38FF74F653FE93FEDC +:105A500073FE93FE93FE94FED2DD51CD94D574CDAA +:105A60004FB48E9BD2A3DEF69FFF7FF77FEFDDDE84 +:105A700078AD37A59AB57AB59BB51CC61DE77DF7FD +:105A80009DF79CFF7DFF9DFF7DFF5CF75DF73DF778 +:105A90001DEFDDE65CD63DCE1DCEFDCD9BBDBABD76 +:105AA000BDDEDDDE9ED63DC6FDBD5CAD3DA57D9D6A +:105AB000DD9DD874290929192A192B21EA200B29DF +:105AC000EA28EB28EA28A8188608A608A608A60847 +:105AD000E6084711CC3A8B32C408A8298821261938 +:105AE000E618271948192819481969210619E610D6 +:105AF000E5180519C310C310A30849328F5B0E4384 +:105B0000AE3A4C2ACA198A19691949194911491119 +:105B10006919AA21EB292C324C320B2A0A2A2B3282 +:105B20000B2AAA190C224D2ACE3A9053727417AE42 +:105B300037BEE43163424EBE6BC6AACED352724228 +:105B400072420F3A8E29AE29AE29AD29CA39AF73F8 +:105B50004429E02820410BCD29E5C6E4E7F485EC93 +:105B600004DC27D4C58A6028A120443916DED8FE7B +:105B700093ED4EDC29D324C224CA24CAE5D2E8EB33 +:105B800069ECABECC6A22058A59969BAE9CA839121 +:105B90006489CDCB8FDCCFD40CBC089324726059C0 +:105BA0004051815962496341074A0B63CE7B918C16 +:105BB00035A5B7ADF8B55AC69BCE9BCEDCD63DDF3A +:105BC0005EE75EE75EE79FEFDFF7FFF7DFF77DEF6A +:105BD00059CEF3A43084CF7B8E736E6B4D632D63EF +:105BE0000C5BCC5AAB52AB4A8B4A8B4A4A424A3A7C +:105BF0004A3A6A3A6A3A293A6A4ACB62EB6A4C6391 +:105C0000CE5BEF536E430C53CA82A8AA66BA05C294 +:105C1000C5B9C6B9A6B9A6B1A8B188A909BA8AB248 +:105C2000E350EA72BDFF7BFFD6FE53F673FE93FE90 +:105C300072FE73FE94FED2DDD4CD5CFFBEFF9EFFEC +:105C40001CF75DFFDFFF9FFFBDE63FEFFABD337C32 +:105C5000F894DBB57AAD9AB5FAC5BCDE7CF7BCFF2B +:105C60009CFF5CF75DF73DF71DEFFDEEFEEEFEEEEF +:105C7000DEEE7EDE3DCE3DCEDDC57CB5BCBDF8A4FE +:105C800017A5BDD69ED6BCB55CA59A945A8C9B8CA4 +:105C9000DC8C9D9D314B08094A192A190A190A21E1 +:105CA000EB20EA202B29A8188608A508A608C60814 +:105CB000271188194E4B45094619A829682106194C +:105CC000E610061928192811281128190619E618AE +:105CD000E5182619C308C308A308CC4A6F5BAD3A80 +:105CE0008D320C22CA19AA19AA19891969194911E0 +:105CF000481148118919EA29CA21CA29EA29CA2161 +:105D000089196911CB19EB19AE3A915BF58C9AC6DA +:105D1000B294C010CB94D3F72EDFECD6F452B24A33 +:105D20007142CE29CE29EF31AE29AD29CA31CC5AE4 +:105D3000E220C02862726BE508E5A5E4A5E465E40D +:105D400004DC48D44372A028A120265297EE77FEA7 +:105D5000F1E40DDCA6CA24CA23D243D263CA05D318 +:105D6000E7E369E4ECE4C2790058A699E6B106BA23 +:105D7000E3882CCBD1F4F5FD56FE76FED4ED72DD32 +:105D800072D593D50E94AD83919CCE7B0B63083A6C +:105D90006621261146118719C821092A4A3A8B3AE9 +:105DA000AB42EC4A0D532E5B4E5B8F638F63D06B1F +:105DB0006E632D5B4D5B4D636E636E636E636E63EE +:105DC0006E634E5B2E5B0D5B0E5B0D53ED4AED4A31 +:105DD000ED4A0D532E530D534E638F738F73F07333 +:105DE000516CB36CB3645174EEA38CC38CD36BDB76 +:105DF0004BDB4CDBAEEBCFEBD0EB90DBB0D3E881F1 +:105E0000E338B9E6BCFF18FF95FE94FE93FE73FEDF +:105E100072FE93FE53F6B3D5BEFFFFFF7FF73EEF52 +:105E20009FFFDFFFDFFF7FF71EE7B59450631895F4 +:105E3000DBADDCB51CC67CD61DEF7DF7BCFFBCFF1F +:105E40007CF75CF73DF7FDEEDEEE7DE6BEEE9FE60D +:105E50001DD6FDCDDDC5FDC59CBD7CB57CB59BB516 +:105E60009694B6949ECE9CB51BA57A8C3A8C1A7CDF +:105E70001A7CDB8CD984AB2109112A190A190A1959 +:105E80000B210B212B29A8188608A608A608C608EE +:105E900047112A2ACC42E400A8218821472106196B +:105EA000E51006110711281928112819E610E61027 +:105EB00005118721A308E310C408D06333742F4B66 +:105EC000AE3AEB21CA19AA19EA21CA198A1949114D +:105ED00049116919892188194819681968196819B7 +:105EE0006919AA21CB21EB21CE3A915B36957AC66E +:105EF000684A8231D2DEB2FF90F790F7F352924AAD +:105F00000F32EF315042303AEF31CD312C424A4A14 +:105F1000E320C028C6A36AED07EDC6EC85E445E49E +:105F2000E4DB27D4036AC028C120475A98F615F647 +:105F30008FDCCCDB86CA04CA23D223D243D263CA05 +:105F400046DB49E4CBE488BB00404579E6B128CA8A +:105F5000A49088A16BC2CFE3F1ECB3F5B3F592ED59 +:105F6000F3EDB6FE52C5B5BD5CEF3CE7B6B5AF6B21 +:105F70006C322B224B224B222B222B22EA190B1A9A +:105F80000B1A0B1A0A1A0A1AEA190A220B1A0A1A07 +:105F90000A22EA19A911A911CA19CA19AA1169096B +:105FA000691149114911280929114911691169110A +:105FB0006911491149118A19CA29EA31EA312A3A83 +:105FC0008C3A2E435254558575BDB5E595F575FD52 +:105FD00054FD13FD13FDF3FCF3FC14F5F0BB82300C +:105FE000B1A4FEFF7AFFF7F6B5FEB4FEB3FE93FE52 +:105FF00092FE93FEF2E5D8F6DFFF9FFF3FEF7CDED7 +:106000009DDE1FEF7FF7BCDE706B0F5B9AADFCB5BA +:10601000DBBD1BC69BD67DF7BDFF9CFF7BF77CF7E6 +:106020003CF7FCEEFDEEDEEE9EE65EE65EDEDDCDEE +:10603000BDC55CB55BB5DDC5DDC57CB55BAD5BAD38 +:106040007BAD936BB894FDBDFB9CBC9C3A8CF983F3 +:106050009873F97BFB949463E8186A292A210A2132 +:10606000EB20EA204B29A8188608A500A608C60838 +:106070002711CC42E8294611A82188214721E610A2 +:10608000E51006110711071107110611E610E510BA +:106090004619C729C308E3106619D063B163D25B00 +:1060A000EF42EB21AA19AA190B22EB21AA19AA196E +:1060B0008A19CB29EA29EA29892168192711481167 +:1060C0006919CB21AA194D32EF42D263779D928490 +:1060D000C110CA7B54EF30EF30F72FF7D24A503A55 +:1060E0000F32504270425042303A2F428E4AC939E4 +:1060F000C320003989C428ED07EDC6ECA6EC65E4A1 +:10610000E5DB28D4036AA020A020C64936E6D4EDFA +:106110008FDCEDE3C7D224CA23D223D223D243CAD1 +:1061200006D329E4CAEC29CC6048E36008BAE8C188 +:10613000E69869A948A9E9B94CCB90E411ED10E5BE +:1061400051E5F3ED11BD53B575B59AD618BE527C25 +:106150008C2A0B0A0B120B1A8C2A4C22EB19CB112E +:10616000EB114D1A8D2A4C22EB192C1A2C1A6D2288 +:106170008D224C220B1ACA11AB11CB11EB19CB1982 +:10618000AA19AA196A114A096A118A11AA19CA19FF +:10619000AB198A196A116A11CB212B322A420D5B85 +:1061A0008F63D05BB364558555AD96D575E554EDD9 +:1061B000F2E490DC4FD4EECB6DBB8DB34449695A09 +:1061C0009DFFBCFF5AFFD6FEB4FE93FEB3FE72FEE7 +:1061D00051FE52FEF2E55AFFDFFF3EEFFEE69DDE86 +:1061E0003CCEFEE63BCE8C522F631BBE5DC69ED6D8 +:1061F0009DD67BD6FBE69CFF7CF73BF73CF75DF733 +:10620000FDEE5BD67DDE3CD61DD6DDCD9DC59DBDAC +:106210001CAD79949A9CFBA43CAD5CAD7DAD5CADAE +:106220003CA5588CAF529BAD3CA5FC9C198C577378 +:106230005773576BB773998C692907214A210A2133 +:106240000A210A212B29A8188608A500A608C60835 +:106250006711EC424611C821882167210619E51013 +:10626000E6102611071107110719E610E6100511AF +:10627000A721A721C208A3082932B05B915BEF4296 +:106280000C2A8A1969118919CB21CA19AA19CB219B +:106290002C32EB29EB29CA29A921CA29A921AA2133 +:1062A000AA218A19CB21AE3A7053957CB8A5483AF9 +:1062B000622953CE12EFAFE6CEEEEFF69142503A9E +:1062C0007142B14A70429142924A904A8F4A0721E4 +:1062D00082186149C9D4C7ECA6ECA5ECA6EC66E42B +:1062E000E5DB49DC847A8020A120E23053C515EE3D +:1062F0006FD40DE408D345CA24CA03D203CA44CAE2 +:1063000027DB09E4CAEC29CC8040C36029BA88B9EC +:10631000E7A069A9A9B92AC28AC24CD3CDD38EE419 +:1063200030E5D3ED11BDF2ACAE7B38C638C6B284D1 +:106330000E332C12EA11EA19F58C32748D3AEB19EE +:10634000EB118D2A2F4B0E4B4C322C220C1A8D2226 +:106350008F4B8F532E4BEE422C2ACB198D32EE42AF +:106360004E5B4F5B8D3ACB21CB192C2AAC42B063EC +:106370002F53CE3A0C22EB218C3A8F635194F3AC1D +:10638000938C11649364157D34A595D5D1D4AFDC7D +:106390006ED4ECCBCCCB6BBB2BAB487AA22837CEE0 +:1063A000FEFF9BFF39FFB5FE94FE93FE72FE71FE69 +:1063B00031FEB0F5B2ED5BFF9EFF3EF79CDE9CDE4A +:1063C0005EEF77ADE931F173DDD6FEDE1EE73DEF1E +:1063D0007DF79DF79CFF9DFF3DF7FDF6DDEEDEEEC0 +:1063E0009EE65DDE7EDEFCCDFECD7CBDFCA4198C80 +:1063F000F883DBA4DBA4398C7A94FCA4DB9CBB94EB +:10640000FC9CFB9C6F4A5684FEBD5DADF9835773BF +:1064100078739873D452798CCF52A61009210A212F +:106420000A210A214B29C8108608A500A608C5081C +:10643000C821CC3A6619E929882147210619E510B7 +:10644000E6100711071107110611E51005110511D6 +:1064500029324511C308C3084F53B15B9253CF4251 +:10646000AB19290949118919CA21AA19AA190B2A94 +:106470004C320B2AEA29EA29CA29EA29EB29CB213D +:10648000AA19AA194C2A304BF363989D1174C110B4 +:10649000A97B75F711EFEFEECEEECEF6303A504213 +:1064A000914A714250427142514270426F4A0721F3 +:1064B0006118A25968D466E485ECA6ECA7EC26DC4A +:1064C000A5D329DC479B6028A020A1208C8B98FEB7 +:1064D000D0DC2EDC8BD387CA24CAE3C104C245CAF0 +:1064E00007D3EADBECEC67AB2038E46009B267B1B4 +:1064F00027A1A8B1A8B109BA8AC26DDBADD32EDC41 +:1065000010EDD3EDF1BC0E94074217BE58C6F38CC4 +:106510000E332B12CA116711F8B5F8B50E4BEB21EB +:10652000CB192C2AAC42527CAE4A2C2AEC192B1ADD +:10653000B05B51741595905B6D32EB216C324A3A29 +:10654000149D35A52F532B2A0B22EA21EC5259C654 +:10655000B4842E4B0B22EB214B324D6313B5F2B4B6 +:1065600031842D4B6E43726C75B5F6DDF1D4F0E4D9 +:10657000CFE40CCC49BBA7A2C98AA1308D7BFEFF1A +:10658000BCFF7BFFF7FE94FE94FE92FE51FE30FEB0 +:106590004DFDEDECCFDC3AFF7EFF5FF75FF77FEF5D +:1065A000938C041131741DD7FDDE5FEF7EFF9DFFDC +:1065B0009CFF9CFFBCFF7DFFFDF6DEEE3CDEFCCDCC +:1065C000FCCD3ED65ED61ECEDEC5BB9C3A8CD662D6 +:1065D0007B9C7A943A8CF983198C1A8CD883198411 +:1065E0007B8CDB94CF5231639FD6BEBDD88377734B +:1065F0007873B97BD55AF773D373C61009210A2172 +:106600000A210A214B29C810A608A608A500C5081A +:10661000092A4A32A719C82967214719E510E51048 +:10662000E610071128192719061106110511461938 +:106630004932C300C3086619F1630F43CF3A0D22F4 +:10664000CC2149116911AA19CA21CA21CA212C2AAF +:106650002C32EB29CA29CA29CA21EA210B2ACB21CB +:106660008A19CB21AE3A7153D67C569586212121C9 +:106670008FBD12EF10EFCFEECEEEEEF60F3A303ABE +:10668000303A303A504250427142914A8F4AE620A5 +:106690004018036A08D4E5DB05E466EC66E406DC32 +:1066A00086D3E8D36ACC405140208118A541F5DD5E +:1066B00077FE11DD2ED42AC387C266CA67CA87CA8D +:1066C000C7CACBD3ADDCE3790038457108AAA6B1BF +:1066D000A6A9C7A9A6A9C6A928B26CD3ACDB0DDCB4 +:1066E000AFDCD3F532C56B7BC218B6B558CE149566 +:1066F0000E332B128811C508B7B539C62F5BCA21D6 +:10670000CB21CB21A821327CEF522C32EB192B1A52 +:10671000AC3A4E5BD8AD90636D3ACB210B32261963 +:1067200055AD59CE4F5B0B2AEB21891929429ACEE0 +:10673000369DCD4AEB21EB21E9298A4A54B513B5A0 +:1067400031842D534E43326C76B554CD6FC48EDCFC +:10675000AEDCAABB08AB2AA3A5514431BAE6DDFFE3 +:106760009CFF59FFB6F694FE92FE71FE50FE8EFD20 +:10677000ACF42BE40CCCD9FE7EFFBFFF9FF7107C5E +:10678000C308717C5DD71CD71CE7FCE6DBE65CF731 +:106790009CFF9CFFBDFF5DF7FEEE5DDEDBCD5ABDCD +:1067A0005BBD1AAD3BB57DB53DAD9C9CDA83B65A59 +:1067B0007C941A8458737873587B587B787BD98380 +:1067C000D97B798CF05AAE525ECE7DB5D883787382 +:1067D000B97BD97B165B966B5584C610E8180A21E5 +:1067E0000A210A214B21C8108508A508A500060921 +:1067F0006A320822092AC82146190619C510E6106E +:106800002719281948194819271906110511E829C7 +:10681000E829C308C308AB42536C724B6E2ACC19EB +:10682000AB196A11AA19CA19AA21CA210C2A4C3219 +:106830002C32EB29CA29CA29EA290B2A0B2AAA19C0 +:10684000AA190C2A10431364979D0C4BA0082763C8 +:106850002FC6AFDECFE6AEE6CFEEF0EE0F3A0F3A40 +:106860000F3A0F32303A504291429042B04A2721BB +:1068700040180472C7CB85DB84DBE5DB27E407DC4B +:1068800066D367CB8AE467AB4028601880202B73FF +:10689000F9FEB8FE16FE32EDEDD3ACD38CD38BD31C +:1068A0000DDCF0E4CCB360402148A791A6A1A5A9D6 +:1068B000C6A9C5A1C5A9C5A926AA2ACB8BD3CCD365 +:1068C0008EDCD3F552CDC96AC21834A558CE55A571 +:1068D0002E434B1A4711630096ADBBD69063CA296D +:1068E000CB2189190511F1730E5B2C32EB192B2288 +:1068F0004619AB4AD7AD90634C32CA21892184082E +:10690000D39C7ACE6F630B2AEB212711872918C6F7 +:1069100056A5CD4A0B220B226719A72975BD54B580 +:1069200051842D534F4B326C75B595D52EC40CCC7C +:106930004CD469B349AB0993A128308CFEFFBCFF4E +:106940009BFF38FFF6FED4FE72FE51FEEFFD0DFDFB +:106950002AF4CAE34ABB36FEDFFF9EF76D6B620086 +:10696000717C3CD75CD71BDFDADE3CEFB6C5BAE6FC +:106970009DFFBDFFBEFF3DF7DEEE7EE61ED67CBD71 +:106980007CBD3CB5DBA4DCA49C94BD9CDB8376522F +:106990001B84DA837973176BD76AD76A3773787376 +:1069A000987B598CCF5A8D523ECE7994D883D97B1F +:1069B000FA83FA83F55A756BB273C610E8180A2188 +:1069C0000A210A192A21C7108508A500A500471128 +:1069D0008B3AE821092A87212619C410A408E61059 +:1069E00028194819481948194721051125118A3ACB +:1069F0004519C308E408AF5BF363514B8F322D2276 +:106A0000CC19EB19CA19AA19CA19EB294D326D32E2 +:106A10004C32EB29CA29CA21EA290B2ACA21AA1910 +:106A2000CB218E32925317853174C208043AAC8C54 +:106A30006FCE4DCE6DD68EDECFDEAFDE0E322F3A6C +:106A4000EE310E320F32503A503A5042904A2821DD +:106A50002018E46988CB66DB65DB45D3A6DBC7DBA2 +:106A6000A8DB47CBA7D38BE4A58A402860188120F8 +:106A70000E9C3AFF3AFF19FF98FED5F573EDB4F579 +:106A800097FE52D584510030A57888A985A1C5A963 +:106A9000C5A1C5A1C4A1C4A1E6A9A8C24AD3ECDB83 +:106AA0008EE4D3F532C50652E320B29438CE34A535 +:106AB0002E4B8C322611830035A59FEF948C2B3200 +:106AC0000B2A6819C4108F6B0F5B4C32EB19EB1952 +:106AD000E510494297ADD06B6D3ACA21471963085A +:106AE000928CFCDE527C2B32EA29E5084521F8BD68 +:106AF00019BE4F5B2B2A2B2A4611662954AD95B53A +:106B000051842E534E4B326C75B5F6DD8FD40CCCC0 +:106B10002CD46AB32A9B434985411BE7DDFF9CFFC8 +:106B20005AFFF7FEF6FE93FE71FEAFFD0DFD8CF4ED +:106B30002BFCEBEBE8B212DD5CFF4D6361003074BF +:106B40003CCF5CCF5BDF7BEFDEFF59D6F7CD7DFF1F +:106B50007DFFBEFF7EFF1EEF9DE67EDE3ED6FECDB4 +:106B6000DEC5BEBD1DAD9C945B8C1B849A7B354AF3 +:106B70005973DB835973D762B6629662B662F76A5D +:106B80007873398C2C420F633FCE967B987BDA83E7 +:106B9000FA83D97B744AB673CF5AA510E8180A193C +:106BA0000A190A192A21C810A608A608A50047191B +:106BB0002A32A7190A3287210619A408A50807193D +:106BC000281928194819682167212611A7218A3A0E +:106BD000E310C30828221164504B8E326E326E329D +:106BE0006D2A2C220B220B22EB210C2A4D326D3206 +:106BF0002C320B2AEA29CA21EA29A921481169194C +:106C00002D2A314B7574F584A721C108EA6B8A845B +:106C10002EC60CC62CCE4DD66ECE2EC60E320E32E1 +:106C20000E324F3A4F3A503A0F3A2F3A6F422821DC +:106C30004118C469A9CB66DB46DB46D386DB86DB1D +:106C400088DB88DB47D3C9DB6CDCA68A60300018A0 +:106C50008028CD93B7EE3AFF5AFF1AFFB8FE57EEE1 +:106C600090B4444900206350289947A945A1C5A183 +:106C7000C5A1C5A1E5A126AA26AAA5A106AA09C360 +:106C8000CBCBB3F5F1BCA541C220CF7B38CE14A548 +:106C90000E4B4C32E5086208928C9EEFD4944B3A2E +:106CA0004C3A2711C410EC5AEE522C32EB19C91988 +:106CB000E410083A55A5F1736D3ACA21E610620056 +:106CC000CF7B5DE71595CD422B32E508E418F7BD83 +:106CD000BBD6B06B6C326C320511252113A5B6BD45 +:106CE00052840D534E4B516C75B5F6E5B0DC2DD486 +:106CF0002DD4ABB3266A60203094FEFFBCFF5AFF50 +:106D000038FFF6FEB4FE72FEF0FDECF42BF40BF44B +:106D10000BF46AD3A7A2ADA3EB6A610071743CC700 +:106D20001CC75CCFDDF7DEFF17CEB7C57DFF7DFF4B +:106D30005DFF5DF71DF7FEEEBEE67EDEFDCDDDC537 +:106D40009DBD5DADDC9C9C947C8CFA7B9A7B5652FD +:106D500056527A7B196BB7629662765AB762B66200 +:106D60005773546B4929D37B7DB55673D562176B26 +:106D70005873B55AB452D67B8929C61029190A19F5 +:106D80000A190A192A21C710A608E608E608882168 +:106D90002A32C821092A4719E510A408E610281943 +:106DA0000719481947194719471926116A32E72167 +:106DB000E308E308F05B946CEF3A6E324D324C32EC +:106DC000AD3A6C2A6C2A2C2AEC21EC212C2A4D326B +:106DD0002C2ACA21EA29EA29AA2148112811AA192C +:106DE000F042356C578DCC428200E94ACA63CB84AD +:106DF000EDB5EBB50CC66DCEEDB5EDB50E320E3280 +:106E00000E320E32503A0F3A2F3A4F3A4F3A6A2921 +:106E100021108359E9D3A7DB86DB65D385DBE7E364 +:106E200067D368D308D308D3AADB2CDC48AB41591D +:106E300000200018465A2E9CB0AC90AC8C83C551F3 +:106E400020200028A668299128A907A945A1C5A145 +:106E5000C5A1E59947A2A8B2A9BA48B206B267B2DD +:106E60006AC3B3F58FB4E228E3204C6B38CEF49CB0 +:106E70000D4B2A2AA3086200F07B9EEFF5942B3A73 +:106E80002B32E508E4108B4A0E5B2C32EB21891182 +:106E9000C408A73135A5117C6D3ACA21C408620027 +:106EA0006D6B5DE71595CD4A2A32A408A30876AD2F +:106EB000DBD6B06B8C3A4B2AE408E310D29CF7BDCA +:106EC00072842E534E4B316C75BDD6E5F1E42DD452 +:106ED0004ED4ABABE238A5411BEFDDFF7BFF19FFC2 +:106EE000F7FED5FE52F611FEEDF44BF4CAF3CAF3E9 +:106EF00029DBC8BAC99A24410000AF53FDAEFDA6F4 +:106F0000FBAE9ED79EEF76BD17CEDEFFBFFF9FFF85 +:106F10001EF7DDEEBDEEDDEEFEF6BEE67ED6FDC56D +:106F20007CAD5DA53DA5FD9CBD943B8CFB837A7B30 +:106F3000F549975AD86AB762976276629662956207 +:106F4000967B0E42AA315AAD7A94F66AB5625452D3 +:106F5000955AB55AF783B052C61048214A210A19EA +:106F60000A190A192A21A708A608E6080711A92163 +:106F70002A32E929C9292619C510E5100719071968 +:106F800028192719E610E51005118719CB4244117D +:106F9000C200282AD474D14BCF3A4D324C326C32D5 +:106FA000AD3A4B2A8D322C2AEC21CB21CB21CB219F +:106FB00089196919AA21CA21481949118A196E32F9 +:106FC000B453598DB063A200C621D17C27430C85F0 +:106FD0006B9DCBAD0DB6ECB5ECAD0DB6EE31EE3133 +:106FE000CD292F3A7042503A503A7042914AEC39CA +:106FF0004210024188C3E8DBC7DBA6DBC6DB07E43F +:10700000C8E347D3E8D266C267C2E8CA8BD3ABCB2A +:10701000A892446140380028002840304030403079 +:10702000C4500A920DB229A908A906A144998499CD +:10703000C5A106A288AAC9B289B269B248B2C9BAC2 +:10704000ECD3D3F52EA4A1180321AA5A17CE14A568 +:107050000D4BE921830061006E6B9FEF159D4B3A4C +:107060000A32A408C3106A422F5B2B32CB2147118E +:10707000A3080421B7B536A5EE4AEA29A4086200A0 +:10708000CB5A5DE7369DED4AE929A3008208D39CDF +:107090001CDFD0738C3AEA21C408A2107194F7C5A2 +:1070A000938C2D534E43316C75BDB5E590DCEDD31B +:1070B0004ECC467260200F84FEFF9CFF3AFFF8FE24 +:1070C000D6FE94FE72FED0FDACF4EAF3AAF36AE3B6 +:1070D000C8C2A8A2235100082D53FCAEDD9EBC9669 +:1070E0005EC71DCF15A51ACEBFFFDCEE78BDBACDA9 +:1070F0009EEEBEEEBDEEDDEEFDEEBDE6DDE69ED61D +:10710000FDBD9DAD5DA5FD9C9C941A841A841B8CCD +:107110005A73154A565A9762766235523452166B34 +:10712000D2620921D57B3CAD36739562545A145214 +:10713000134A156394730819E710AA294A210A19FA +:107140000A190A210921A710A608C60807118821D3 +:10715000C929C929A8212619061926192719071985 +:107160000719E610C510E51005114A324932E3004F +:107170002301105C325CEF32CF3A6E3A2C32EA29AE +:107180004B322B2A4C2A0B22EB21CB21CB21AA21DB +:10719000481928116819691949116A194E2A314B81 +:1071A000D87C95740511E30871748F6CE632CB744A +:1071B0000A856A95AB9DAC9D2EAE2EAE2F3A0E324F +:1071C000EE312F3A0F3A0F325042704291420D3A4F +:1071D000C518612828AB09DCE7DB07E427E427E4CE +:1071E00008EC67DB28D3A8CAE7B9E7B9E8C129C228 +:1071F000AACA0ACBA8B226A2E591A589A58986913B +:10720000A9A18AB129B149B127A905992499439126 +:10721000649107A2A9B2CAB2AAB289B289B20AC35A +:10722000EDD3D4FDCD93C218E320284A74BDF3A456 +:10723000ED4AA82183004100AA527EE7159D4B3AF2 +:10724000E9298300C310093AD1736D42EA21060986 +:10725000A308A31035A5D8B56F5B0A2A8300610087 +:107260004942FCDE569D0E5388218308A3103184C9 +:107270001CDFF1738C3AA921A3008208CE7BF7BDF5 +:10728000D38C2E534E43F16B76BD75E50ED40ABBFD +:107290004BA3A1384431B9DEDDFF7BFF18FFD6FEDA +:1072A000B5FE73FE72FE8FFDACF4EBF3CBEB29CB96 +:1072B000C8A2646100182842BBB61DAF1DA71EAF4F +:1072C0001ECF95945BD6BFFF59BD5383179C548B3B +:1072D000F69B7EEEDDEEFCEEDCEEFCEEBBDE9CD63D +:1072E0007DCE7BAD3CA5FC9C7B8CFA83D97BB97BA6 +:1072F0001873765A3552555A3552545AD4625152EF +:107300002B29D15ABA9C777B345AF351D351F3517C +:10731000535296738B31C61049196B212A190A19D9 +:107320000A190A212921A608A608E608E6106821FC +:10733000A929A82188214719271927212721271999 +:107340000619E618E51005118719EB424411C20031 +:107350000B33B364303B8F2A8F322D2AEB290B2A53 +:107360000B2A2B2A0B22EB21CB21AA21AA21A9210E +:1073700048194811481149114911EC21D03A566C6D +:10738000178DE92962004C53959549438743EA6C70 +:107390004A7D6B85AC8DEC950DA60DA64F3A2F322C +:1073A0000E320E32AD29CD290F320F3A0F320E3A7E +:1073B00049290118C8928CE44AE428E407E407E468 +:1073C000C6E305D3E7DA67CAE8C9C9C968C147B9DE +:1073D000A7C1A7B907C268CA68C248C2C7B166A92F +:1073E00047B107B107A906A925A124994491649141 +:1073F0008591079A89AAA9AAAAB28AB2CABA0ABB6F +:10740000EDCBF5F52B7B8110C318A63991A4B29C66 +:10741000ED4A671962008208494AFBDE369D4B3A05 +:10742000A8218300C310083A127CCE4A2B320509EA +:10743000A308A210928CD7B56F5BE929620062089D +:10744000E7399ACE97A50E534619830882086E6BCA +:107450001CDF117C6C3A6719A308A2106C6BF7BD96 +:1074600014952E532E43D06396C575E530DC2CBBA6 +:10747000C66940202B73DEFF9CFF19F7D7F6D6FEB6 +:1074800094FE73FEF1FD2EFD6DFC0CF48BDBC8AA9F +:10749000A56920200439F8C57DCFDBA6FCA63EBF38 +:1074A000D694BAC5DEE65594B58B9ED5FFE5158317 +:1074B000B593BFF6DDEEDCEEFCEEFCEEBADEBBDE35 +:1074C0009CD6BBB55BAD3CA5BB943A8CD97B78739D +:1074D000545A1452555A755A9562745ACF418D397F +:1074E000D25AF78336733452924972499249F2491B +:1074F00014632E42A60828194A194A112B190A1991 +:107500000A190A2109198608A508E6080711882121 +:10751000A92168212719472126192719472106196A +:1075200006190619061126198A3A6932A200A6110F +:10753000B364D143CF32B0326F2A4D2A0C2A0C2AC1 +:107540002B32EB29EB21CB21AA218A198921891918 +:107550002711481148196911CB196E2AD45B398D4E +:10756000CD424200292A348D128545226A5CEA6C9C +:107570000A6D6B7DCC85ED95ED9DED95EE31EE318F +:10758000CD29AD29CD29AD29AD21AD29AD21CD29FB +:10759000AB314310A5616DD46CE46BECE8E346D3EA +:1075A00066DBE5DAE4C184C186C967C147B968C151 +:1075B00068C147B967B987B9C7C186B146A967B17C +:1075C00048B106A905A12499249944916489447974 +:1075D0006579899A0BB3CAAA8AB269B2A9B2EABA22 +:1075E000ECCBB3EDC9728110E31844294F9CB2A4CF +:1075F000EC52471182008208A6317ACE56A54B4242 +:1076000067216300E410A731D173EE522A32E508F6 +:10761000A308C310CF7BF8B56F5BC8218200620856 +:10762000863118BE97AD2D530519830862080C5B8F +:10763000FCDE117C6B3A0611A308C310AA5AF7BDF1 +:10764000359D4E532E43B06397C556E531DCCBA232 +:10765000C340C22895BDDDFF5AFFD8FEB6FE95FE99 +:1076600074FE32FE2FFD8DF42CFCECEB2ABBE67988 +:1076700061302118CD72F8CD9EEF1BC7FCAE1DB74F +:10768000958CF8A4358497945FDE9ECD1583158381 +:107690001DDEDEF69CEEBCEEBCEEDCEE9ADEBBDE62 +:1076A0005ACE5BCE1CBE5BA5BA94BB9C7B94777311 +:1076B000745A5452124AF149D041F1417352366B17 +:1076C0007773166B755AD34952417241B141356394 +:1076D000B052A708081149194A114B112B112B1947 +:1076E0000B190A21092165088508E6100711882170 +:1076F000A821682106190619061926210619061956 +:107700000619E6180611A821EC4A03090301105CCA +:10771000735CEF2A8F2AB0326E2A2D2AEC21CB21FE +:10772000CB21AA19EB210B2AEB29AA21A92168193F +:10773000061127112811AA192D2A9253388D705B32 +:107740008300E410F0633485CD5B2422CA64C964ED +:10775000E96C2A6D4A758B7DAC850D96EE29AD29B5 +:107760008C218D29AD298C216C218C216C216C21DF +:10777000AC29C7204128ACB34DDC0BE4EAE326D3A7 +:10778000C5CAE6DA24CA84C166C146C127B948C160 +:1077900048C148C168C188C167C167B967B967B1E5 +:1077A00047B126A1249924994491648923694040D2 +:1077B0002030A140C671EAA28AAA69B2A9B2C9B2B0 +:1077C000ACCBB3F50A7B6110E320242970A4B2A4EA +:1077D000ED52671982008208A7317ACE369D4A425F +:1077E00026198300C3104521906B0E5B2A32A4003A +:1077F000A308A3102C63F8BD6F5BA8218200820848 +:10780000C318B6B5B7AD2D530519A30882088A521F +:10781000BBD652846B3AE510C308A210684AD6BDA5 +:10782000559D4E532E4BB06376C556DD52D4E87944 +:107830006120274A3BF77BFFF8FED7FEB6FE74FEB9 +:1078400054FE70F58DF44CF4ECF3ACDBA89AC24016 +:10785000422007312E624D6235B5FFEFFCB6BCA663 +:107860005CB69BA53EC67FD678A4B172B79B1FE6D7 +:10787000BFF69DEEBCEE9CEE9CE69CE67BDE7BD6E6 +:10788000FAC5FBBDDCBD7CADBA943984D97B787375 +:10789000D6625352B462D562D56257737773366B32 +:1078A000B562545AF451524131413039D45A335BA4 +:1078B000E710071129194A114B114A112B112B19E5 +:1078C0000B190A21E82044088508E61007118821D1 +:1078D000A92968210619E510E518E518E518061923 +:1078E0000619E5104619CB428619A2002D3BB36458 +:1078F000503B8F2A8F2A4E2A0D220C22EC21CB21BD +:107900006919AA212C2A0B2A0B2ACA29EA29A9219A +:10791000271927116819AA19AF3A1885F263C40804 +:107920008400EC4A7274B1740522063B895C875C62 +:107930008764875CE96CE96C096DAC7DCD296C21AD +:107940004B196C216C218C216C216C216C216C21D8 +:107950006B216A314220A569ECD3CBE3AAE3E6CAE6 +:10796000A5CA85CA85D2E4C185C166B946C146B9F2 +:1079700048C128B927B947B946B946B968B947B126 +:1079800047A926A125A1249964914471403000188B +:107990008128E2300018C669AAAA8AB289BAA9B2B7 +:1079A0008BCBB3F5AD93C220C218653191A4B1A4BD +:1079B0000D5367196200620808429ACE159D4A422B +:1079C00046196300C3106629D1730E534B3AA400C5 +:1079D000A308A2104D6B39C6AF6BC829620082089C +:1079E0000421F8BDB7AD2D5B0519A30882086A4ACA +:1079F000DBD652846B3AE510A3088210284AB6BD44 +:107A000055AD4D5B2E538F6B75C5B6E5B3BC45497F +:107A1000A220EE8BBCFFF8F6D7FEB6FE95FE74FEF4 +:107A2000F2FDEEF44CF42CF4ECEB4BC36459422021 +:107A30008620AD49B051AE494931159D9FD7BCA6AE +:107A4000BDA6FFBEDEB5757BD272DABCBFDDFFE539 +:107A50007FEE9EEEDDEEDDEEBDEE7DE65CDEDBC5AF +:107A6000DCBDBCB51B9D9B949B8C1A84B97B787341 +:107A7000F66A787B997B5873D66295629562D66276 +:107A8000D662755A724111391031534A946B691993 +:107A9000C608071108112A114A112A112B190B19AE +:107AA0000A190A21E81844086400C508061188214B +:107AB000A9294721E610E618E618E518061906195F +:107AC000061906116A3A493281008A2AB46C503B81 +:107AD0006E226E2A4E2A2D22EC21EC21EC21AB19CC +:107AE000AA19EB210B2AEB29EA29EB29EA2988219B +:107AF00027118919AA212C2AB67C5474E51042005A +:107B00004B3A126CB27CED5B41094643E54BE44BCA +:107B1000E553055C8764C86CC864096DAD29AD295F +:107B2000AD29CD29AD29AD296C218C218D216C2168 +:107B30006C216B2928312128889AECDB8ADBA6C2CC +:107B400065C285CA85CA45CAC6B9C7C1E7C987C162 +:107B500088C127B946B906B105B126B126A906A93B +:107B600026A946A145A18599C68981484018A21831 +:107B7000EF83308CA220C238489207A228AA88B28C +:107B80006AC352ED0E9CC1208118C641F2B492A482 +:107B90002D5BC929A30862088A52DBDE55A5ED5288 +:107BA000E8318308C310E831127CEE526B3AE508E5 +:107BB000A308A310EF7B39C6B06BE93162086208F5 +:107BC000652939C6B7AD4E5B261983086108CB52CB +:107BD0003DE772846B420611A3088210274A95BDC7 +:107BE00013A54D6B0D5BCF7B38DED6DD6D83C328CF +:107BF0002329F5CD5AFFB7F6B6FE95FE74FE53FE67 +:107C0000B1FDCEF44CF40CF4CCE3479A6030631829 +:107C10000A31D051B249B1496C41A618779D1EBFB7 +:107C2000DEAEBB95146B3583DFD53DC5F482B37AE8 +:107C3000D6931DDEFEF6DDEEDEEEBEEE5DDEBCC5ED +:107C40005BB51BA57A8C5A8C9C941A847873176B3D +:107C5000D662D66AF76AB662345AD349F35195624E +:107C60009562F45131391031F241D673CB29E608CF +:107C7000A508C60808112A112A112A112B110B195F +:107C80000A190A21C71823006408C508E6108821CC +:107C9000A929682106190619E618E6180619061911 +:107CA0002619E8296A3AA200E819726491438E22E3 +:107CB0008F2A6E2A2D2A0C22CC19EC21AB19CB214C +:107CC000CB21CB21AA21AA21AA21CA2989210711C6 +:107CD0006919AA210B2A546C947C46112200462172 +:107CE0004F5B326CF3848732A111C7530554A34311 +:107CF000A353C453255CA76CC86CC8648C21AD2900 +:107D0000AD21AD218C218C216C216C216C216C2149 +:107D10006C216B216A31E6300459EDCBCCDBAADB58 +:107D200029D366BA86C287CA67C227C207C2E7B923 +:107D3000A7B987B967B946B147B927B106A906A15E +:107D400026A146A145A1C799246140286118694A26 +:107D500079D6F39C08426128E78185996599C5A188 +:107D6000C8BA10ED8FB4C1206110074A12B5919CBA +:107D70002E5B0A32A3086108CB5AFBE615A52E63D9 +:107D80008B42A308A3082942948CEE528C42261100 +:107D90008308A310D29479CEB06B2A3A62086208A5 +:107DA000C739BAD6B7AD6F638721830862084D6BB8 +:107DB000DBDE5284AC424719A308A210896213B5D6 +:107DC000B2A44D73EC628E7BD2ACEA72074AA22059 +:107DD000475219F7B6F695FE74FE74FE74FE53FE14 +:107DE000B1FD0FFD6DFC2DEC8CCB2461612885204D +:107DF0008E41D1519249B149F051A82068293BBE2A +:107E00007EB69563D46ABFDDFDC47372957A947AA9 +:107E1000B27A5AC57DE65BDE9CE69CDE5CDE1CCE5B +:107E2000B99C1884D87B1A8C3A8CFA833873966282 +:107E3000355A145A145A145A355A145A145A345A70 +:107E4000145AD3499241D141F6736E3AA500C50840 +:107E50006400A608081129114A114B112B110B19A6 +:107E60002B216B29E71823006300A508C608892188 +:107E7000A92148192719061926190619261926199C +:107E8000C8298A3AC3008611D0532F3B6E2A4E2A46 +:107E90004E2A2D220C22CB21EC21EC21EB21EB21CF +:107EA000CB21AA2189216919892189216919891977 +:107EB000CA21AA21915B168DA7212100E408AC42BA +:107EC0006F53116C506C2109832AC64BA44BC353CA +:107ED000A34B834BC453465C8764875C6C196C1955 +:107EE0004B196C216C216C216C216C218C216C2133 +:107EF0008D214C212B216A39C43828820ED4ABD372 +:107F00008BDB29D386C2A7C287C247C206BA07BA8B +:107F1000E7B9E8B908C2E9C1A9C127B127A947A9AA +:107F200047A926A166A1A6894030A220A218928C5A +:107F300038C6AF736A4A622086798699459984A1CA +:107F4000A7BACFE4F0C4433181104852D1AC719C40 +:107F50002E5B2A32A40861084C6B9ADEB39C2D6319 +:107F6000CC4AE4088200AB4AD594EE528D426719A0 +:107F7000A308820855A57ACED0738B4AA308410086 +:107F800029421CE797AD8F63C829830882106D6B67 +:107F9000F7BD117CCD42A821A30882100A7312B547 +:107FA000B2AC6D7BEC6AEB624439CD8B895A811897 +:107FB0000D94F7FE54F654FE74FE74FE74FE33FE08 +:107FC00090FDCEF48DFC2DEC4BBB82488228A62080 +:107FD000F051D251B2519249D1510B310308707313 +:107FE000BFCE7884146B7683936A9793DAA3957ADD +:107FF00075931DE61CDEDBD5FBCD1BCE3BD69ABDB3 +:10800000D68376737773787B5773176B545A1452F1 +:10801000B349724952415241B3499249D351345AFA +:10802000345AD249D139F87B3153E600A50084088F +:108030002300C608E8082A114B116B192B190A19DD +:108040008C21AC29282123006300C508C50889219B +:10805000AA298921271926194721271967210932B9 +:10806000EC4A040145098F53CE322C1A4E2A2E2297 +:108070004E222D22EC210C222D2A0C2AEB21CB2181 +:10808000CA21AA2189218921681969196919AA2196 +:10809000AB21CF42B5846B3A4100C308092A2E5365 +:1080A0008F539274EA420001043B6343A343C44BE1 +:1080B000834B4243A34B255C4654064C6C214B1921 +:1080C0002B194B194B194B192B194B196C216C217E +:1080D0006C214B194B214A296939833868920DDC90 +:1080E000CCDBABDB6AD3E8CA66BA46BA67C267C202 +:1080F00047BA27BA27BAE8B947B127B107A948B1A3 +:1081000068B166A908AA23712020C2200421B6B54F +:10811000D7BDCF73EC52C4206669A79146A1E7B9D9 +:1081200069D3CEE411C5064A6110CA62D1AC919CF4 +:108130002E5B2B3AC4104108CF839ADE929C0D63CC +:108140000D532511A2088E6B36A5CD4A8D3AA92173 +:10815000A308C31096AD7ACED073AC4AE4104200A7 +:10816000494AFCDE77AD6F630A32A40862081084C6 +:10817000F7BD117CAC420A2AC410A2182B7BB1AC0B +:1081800091A44D73EC5A4521A639B5BD6431E1285F +:1081900091CD95FE74FE54FE54FE54FE74FE12FE04 +:1081A0004FFDADF46DFC2DEC4BBB61406328E7281F +:1081B000F151D351F351B251D2516D412310673176 +:1081C0007BBEFFCEFCAD19957AB5FED53683B47A69 +:1081D0007CD53EE6DABC58A41ABD7ABD9BC5F9AC85 +:1081E000767B1673745A545A755A7562F351B349B3 +:1081F000524172495241524152415241D35155620A +:108200007562334A9663166C2811A500A5086300B1 +:108210002300C60809114A116B118C192B116B1917 +:10822000AC29EC31682143008408682127114819E2 +:10823000281948194719472168216719C821CB42D5 +:1082400024096611B053AD2ACB110D1A2E224E22ED +:108250004E220D220D222D2A0C2A0B22EB21CA219F +:10826000AA218921682148192811681989196919D1 +:108270004D2A346C4A3A6200C408C9298C3A4F53DB +:108280003064916C631182196543633BC343E44BD3 +:108290008343423B83430554E54BC5438C214B1933 +:1082A0004B194B194B192B194B194B194B194B19CE +:1082B0006C216C214B192E3AAE5A4B5AE448068277 +:1082C0008CCBECDBCCDBABDB29D346BA05B225B2D9 +:1082D00025B226B227BAE6B986B167A927A947B160 +:1082E00047B1A8B128AA81506028A118074218C632 +:1082F000B7B58F6BAC4A88396661E99966A189CABE +:1083000089DBACE410CDA86A40100B63B1A4B29C29 +:108310006F634B3A261942086D7354B551940C6340 +:108320002D53A7218208F07B369DAD4A8D3A2A2A2B +:10833000A3080419B7B539BE6F6BAC5226194200B9 +:108340008A52BAD676AD2E5B4B3AC4088208719435 +:1083500017C6117CAD424B3AC4108110AD8BD1B41D +:10836000919C2C6B294262006D6B75B5A120E45184 +:1083700053F693FE74FE74FE74FE54FE53FED2FD5B +:108380004FFDADF48DFC6EF44BBB61406328493169 +:10839000525A135AF359F351D351115A8520E41804 +:1083A0001AB6FEC61FC75FCF5FE7779C926A9AB482 +:1083B0007FEED59B548BD7935583BAAC999C188C80 +:1083C000777B377395627562345A355A1452F4517B +:1083D000D451B451B4519349324131417249345A64 +:1083E0005452D45AD9840C22C600A508A4084300CC +:1083F0002300E61049116B116B118C192B118C2184 +:10840000CD29EC3169294300A50889218921691901 +:10841000E708E710271988216719C8298A3204015B +:1084200045098F53CE32CB11CC19CC19ED190D2241 +:10843000ED19ED210D220C2A0C2A0B22CB21CB2188 +:10844000CA21691928112711481168196911EB29E6 +:10845000925B4C326300C408C9292B320E4BF05B8F +:10846000D2744B4BC000642A6443833BA23BA343BA +:10847000623B423B623BE54BE543A43BAD218C2193 +:108480008C218C216C216C196C214B196B196B1987 +:108490006C216B216B211153147C99BDD5AC8A7270 +:1084A000A669CAAA4BC38BD38BDB6ADB08CBA7C2F6 +:1084B00046BA46BA46BA26BA47BA27BA07BAC7B9B9 +:1084C00087B9C7B1079A40408128A118AA5A79CE26 +:1084D000B7A56E5B8C3AC93987594A9AA7A989CA48 +:1084E00088DB2AD4AEC46B836010EB625094519445 +:1084F0006F6B4B42882942084C73B2A4308C0D63D9 +:108500002E5329328208728C369DAD4A8D3A6C32D8 +:10851000E4084519B6ADB7B56F6BAC528729420078 +:10852000EB5ABAD635ADED5A6C42E5108210509434 +:10853000B6BDF0838C426C3AE510C2182F9C32BD58 +:10854000F2A48D7366294100F39C0F8C8020287B58 +:1085500073F672FE73FE74FE74FE54FE33FED1FD9C +:10856000B0FD0DFDADF48EF4CDD3C25062202831A4 +:10857000525A145A145AF351D351325A0931A51888 +:10858000B9ADDEBEFEBE3FCF7DB5B372B593BFF6CB +:108590009AB414833FE67CC5F4729883B88B9883B1 +:1085A000787B3773177395623452555A355A145A7B +:1085B000D4519349B4517349324132415141F3513D +:1085C000334AF8733153C600C600A5088408220058 +:1085D0004300071129112A114B116C192B196B211A +:1085E000AC29EC3189298408E610892189214919AF +:1085F000E710071127198719092A8A3A0401C719B0 +:108600002F436D2ACC192D220D1AED19CC19EC1916 +:108610000D22CC21CB21CB21CB21CB21EC21EC2174 +:10862000CC216A1949114911691969192C2A0F4B72 +:108630000A328400E508C921EA294C324E43726CA3 +:10864000B274C41920010533643BC33BA33BA33B75 +:10865000833B423B623BA443C543E543CE29AD295E +:10866000AD29AD29AD29AD296C216C214B194B19D0 +:108670004B194B19AC29515B958C3BBE7CCE57B541 +:10868000CF9B4C9B6CAB2AAB6BBB8CC3ACCBACD342 +:108690008BD36BD34AD329CB4AD34AD32AD3EAD23A +:1086A000AAD2CAC248924038A128A218EF8379CE34 +:1086B000969D6F536C3A0A3A66516A9229BAA9D2CA +:1086C000A8E329DC6CBCCC93E2202C6B5094309452 +:1086D0004F6B4B42EA3963082C73719CF08BEC6250 +:1086E0000E5BAC4A8208718CF59CED528C42AC4218 +:1086F000661925197184D28C6F6B8B4AC93162005F +:108700000C639ADE56ADED5A8C4A4621A2182F947E +:1087100013B56E7B4C424C3A2621C3184FA433C587 +:10872000D19CAD6B0419821095B50B6B80204CACBD +:1087300052F651FE73FE74FE74FE54FE33FED1FDFC +:10874000D0FD6EFD0EFDCEF4AFEC268A20208520F4 +:10875000AE49F251D251D351D351535AAC49E820CA +:10876000BAADBEBEBFB63EB6567BF57A3FE63EE634 +:10877000D37AFBBCFFF63BBDF572177BD66AF76A6E +:10878000D76AD66AB662755A3552355AF45172496B +:10879000724973497349524132411141724913522E +:1087A000D55A17744919A500A600A5088408220007 +:1087B0004300E71029114A116B116C192B190A1982 +:1087C0004B218C29AA298508E61048194819071158 +:1087D000E7104711882129326A32040908222E4302 +:1087E0002C22CC190D1A2E220D220D1A0C22EC214E +:1087F000EC21CB21AA19AA19CB210D220D22CD21C2 +:108800008C19AC19AC21AB198A190B2AEF4ACA2969 +:1088100063000611EA290B2A0B2A8C3AAF4BD2745B +:108820008C53E0000212653B432BC43BC33BA23B8D +:10883000A343833B8343633B633BC443AD29AD29DF +:10884000AD29AD29AD29AD29AD298C218C216C2113 +:108850006C214B19CC297263179DFABDD9B5D8BDCF +:10886000FCE69ADEF7CDD6CDF7DD74D570BC0EB43C +:10887000CDBBACBB8BC3ACCBACD3ACD3ACDB8BDB59 +:108880008CDBADD30AA38038C228A21896B59AC64D +:10889000B7A5B05B4C3A2B42C851CB9228B2E9DA6B +:1088A000A8E329DC2BBC4DA4C5412C6B2F9430943C +:1088B0004F6B4B422B42C4184C6B3094AF7BEC6235 +:1088C000ED5A2E63E4204D6BD07B2E63ED52ED52BA +:1088D000C8216619917CB28C6F6B6C4A0A3A830886 +:1088E0000C63D7C5D4A4AC528C4AC931C320509C68 +:1088F00013B58E7B4B426C42882904214FA4F1BCF6 +:108900006F94EA52A210E31875AD064A00392FCDD4 +:1089100031F651FE93FE94FE74FE74FE54FE12FE78 +:10892000D0FDAFFD4EFD2EFDEEF48EDC435101185F +:108930000931F051B249B249B351335A0F520D4285 +:108940003DB69EB69FBE798C936A9BB4FFFE78AC11 +:1089500033839FEE7FE6F693B46AD672B56AD66A21 +:10896000B66A9662555A555AD351D351D351B35121 +:1089700072499349B349524132413241D451335241 +:10898000966B114BC608A500A608A5086300020057 +:10899000430007114A194B116B116B192B190A1956 +:1089A0000A190A2129218508A6080711C608C60840 +:1089B000071188212932092AE408092AED3A0B22F5 +:1089C000EC19ED19ED190D1A0D220C22EC21CA1922 +:1089D000CB21AA19AA19AB19EC210D22CD21AD1971 +:1089E000CE21CD21ED21CC212D2ACE42A929640012 +:1089F00007110B2A0B2AEA210B2A0D43D36C137D96 +:108A0000272AE000C42A8433622BA33BE443044CAE +:108A1000C343C34BA34B623B8243C34BAD29AD2938 +:108A2000CD29AD298C21AD298D296C216C218C217A +:108A30006C218C21ED317263179D1ABE98ADB8ADD3 +:108A4000DBCE3DDF3DDFFBD67DEF9DF71BF779E603 +:108A5000D5DDF2CC2EB48CAB2AA30AA32AAB6BBB18 +:108A6000ACC3CDC32B9B6028A220242979CE7AC623 +:108A700018AE326C4C3A2B4229522B9327AAA7CA24 +:108A800067DB09D40BB44EA4EA6A6D73509450941A +:108A90004E734B4A4B4247212D6B508CAF7BEC5AA7 +:108AA000CD5A6E73E7410C6B4E6BED620D638F6BAD +:108AB000EC4AC729918492846E6BAC528C4A462151 +:108AC0004C73F2AC108CAC5A6C4A2A4245312F944C +:108AD000F2B46E7B4B4A6C422A4245314FA4D0B46B +:108AE0002E8C063A8110442914A52331E359D1E58F +:108AF000F0F551FE93FE94FE74FE74FE54FE54FE97 +:108B000032FEF1FDAFFD6EFD2EF54FF5AEC4855181 +:108B1000011029313052D149B149D149CF49536B64 +:108B2000BFBE9FB6DEB535733783FFE5FFDD138328 +:108B300057A41FF7BDCDB68B3783177B177B1773F1 +:108B4000B56A545A1452F45172499349B349D351F6 +:108B5000D451155AD451934952415241D351745270 +:108B6000F673EC21A600A608A608A508630002007B +:108B7000440007114A114A114B114B112B190A19C4 +:108B80000B210A21E8186608A508C608A608E60809 +:108B900088212A32A7210511E9294A320A220B220B +:108BA0002D224D2A0D220D22EC21CB21CB21CA21D1 +:108BB000AA21AA19CB21CC21CD19AD19AD19CE19F5 +:108BC000CE21CE21ED214E32AE4268196300471905 +:108BD0004C322C2AEB210B2A0A226F5395850E5C0E +:108BE00002018211863B632B8333833365544554E2 +:108BF000044C2454455C045C4564245CAD29CD29B7 +:108C0000AD29AD29AD29AD29AD298D218C218C212E +:108C1000AD21AD290D327263758498AD37A5B8B515 +:108C2000BBCE1CD7FCD679C679C6DAD61BDF5CEF83 +:108C30005CF7FBEEBAEE57DE95CDB1B40E9C6C93AB +:108C40000A8BEA82276240186118863159CE9ACE83 +:108C500039B652746C3A4B42AA5AAD9B09B3C6C29C +:108C600026CB88C3EBB32E9CCE83AE73308C72942C +:108C7000B07BAC528C4A6B4AD07BB29411840D63AA +:108C8000ED628F7B4C738D738F730D630C63518C0E +:108C90007184A94AB18CB2948F730E632E63CB5A40 +:108CA0006C73F2A4F08B0D6BED626E6B895A4F946E +:108CB000D2A46E7B8C526C4AED5A28526FACF0BC39 +:108CC000ED836429A110242113A54439C359D1EDA2 +:108CD000AFF5CFFD31FE73FE12FEF2FD13FE33FE43 +:108CE00033FE33FE52FE31FE10FEF0FDF1F5D2E50B +:108CF0002A83A220C6202E529262F049EF41788C3E +:108D00009FC6DFCE7EBDB46A588BFFC4B99BD47AB0 +:108D1000FED55FDE1CBD5683D572F672167B1673C8 +:108D2000B56A5462B3497249734972499349D4513F +:108D3000B34993499349B351B35172495141334AAD +:108D40009463E808A600A608A608A5086308220000 +:108D50006400E71029114A114B116B192B190B19DB +:108D60000B190A21E918A708A608C608E610471932 +:108D7000A82926112619E929C929C921EA210C2A7D +:108D80000C2A2C2AEB21AA198A19AA21AA21AA2184 +:108D9000AA21CB21CC21AC198D19AD19AE19AE1970 +:108DA000CE19ED216E328E420719430048194C321C +:108DB0002C2AEB21CA21EA298B32726C958D672A05 +:108DC000C000C632A63B6323832B82330444654C28 +:108DD0000444044C4454656465646464AD21AD2965 +:108DE000AD298D21AD21AD21AD21AD29AD298D213B +:108DF000AD29AD29ED315263926B179D169DB8AD2B +:108E000059BEDBCEDBCE38B618B6F7B517B638BECE +:108E100018BE17C679CEFBDE3BE75CEF1BEF99DE91 +:108E200037D6D6CD509C8118611024210C63AA52EC +:108E3000CB4A293268216821E839EA72E992E7A22F +:108E4000E7AA28A3AC9B0E94508C6D6BEC62EC628D +:108E50000D636B526C4AAC522D638F738F6BED5A5E +:108E6000ED5A2E6BCE7BCF7BD07B4E6B4E6B728CD4 +:108E7000D394AE6B928C928C4F6B0E634E6BD07B07 +:108E8000CF7BB29CF0832E632E63117CCF7B508C02 +:108E9000D39C8F736C4A6C4A6F636D6B909CF1AC82 +:108EA000CD7BE210C218C21896B56852C038AECC5D +:108EB0006EF56EFD8FFDB0FD90FD91FDB2FDD2FD12 +:108EC000D2F5F2F553FE73FE72FE72FE52FE93FE71 +:108ED000B5F652C5CA6A2631AA41CC49326B5EC684 +:108EE000BFCEBFD69EC5988BD57AD67A756A788361 +:108EF0003CB57DC59BACD572F672F672367B167B9F +:108F0000B56A145A92497349934973499349B349CD +:108F1000B351D3519349524192495241313933525D +:108F2000F152C700A600A608A608C50883080200DB +:108F30008508081109112A114B116C192B190B19ED +:108F40000B190A21E818C710C608E610481988212D +:108F500006114619C929A821A921CA21AA21CA2175 +:108F60000B2AEB21AA2169194811481149116919E5 +:108F7000AB218B196B118C19AD19EE21CE21EE218D +:108F8000EE212E324D32E608430047190B320B2AF0 +:108F9000EB21EB29CA290A2A8F4B5585506C2201F7 +:108FA0002001673BA63B6323832B622B823324443F +:108FB0000444E343655C245C245C4464AD29AD292E +:108FC000AD29CD29CE29CE29CE29CE29CE29CE290B +:108FD000CE29CE31CE297042936B926B179DB8ADDE +:108FE000D8AD3595148D969DF8AD18B6B7ADB6B51C +:108FF00017BE17BEF6B5F7BD17C658CE99D658CED0 +:1090000037CE58D6B5BD242941088A52FCDE76A554 +:10901000517CAC422719E610A410A318C228A1283D +:109020008028A128E2280321442945210421E418AD +:10903000E518051906190619051926214621672183 +:109040008729A831E831E9390A3A2A3A2A426B429B +:109050006B428B42AC4AAC4A4C424C424C42AD4A09 +:10906000CD4A8C4A4C3A2B3A0B324C3A8C3A8C3AD9 +:109070008C3A6C3A0B322C320E43AF5BEE632F6CA2 +:109080002B53A208C2108210D7BDB29C2018A78211 +:109090002FED0DFD4EFD2EFD0EFD0FFD91FDB1FDE1 +:1090A000B1FDB1F513FE54FE94FE74FE73FE73F62B +:1090B00073F6B5FEB6FEB2D5ED93685A4A52F17B0F +:1090C000D69C9AB53BB5DCAC1A94587B7883787BF8 +:1090D000F98B3A941A9C3B9CD993177B1673D672E2 +:1090E000F359924973495249534952417249B3491C +:1090F000355A355AF4597249524131411139535256 +:109100004F42A600A600A608C608A50884082200AB +:10911000C6080811E80809112A112A112B190B1980 +:109120000B190A19C810C610E61827190611E51000 +:109130006721E929A821A921CA210B2A0B2AEB21A1 +:10914000CA21AA21AA2169194911491149114A11B3 +:109150006A196A116B118C19AD19CD19CE210E2225 +:109160004E320C32A500640088210B32AA21A921BD +:10917000A921A921C921CC3A936C7585282AE1003F +:10918000E209452BC533832B632B622B622B043CF6 +:10919000E43B0444665C455C255CC4530F32EE310D +:1091A000CE29CE31CE29CE29CE29AD29CE29AE2940 +:1091B000AE29AE29CE29CE31B04A7263916BB58CFF +:1091C00097A57695526C6E4BD063B384359D56A5AA +:1091D000B7ADF7B517B618BED7B5B6B5F7BDF7BD7D +:1091E00095B595B534ADA63941082C63FFFF1CDF5A +:1091F00059B6527CAD4A6C4ACD526F6BF49C76AD39 +:10920000B394EF7B2C63894AE73945210419C310D5 +:10921000620821000100010001000100210021007D +:10922000210021002200220042006300630063004D +:109230008400A408A508C510C610E6100719071970 +:109240000719E6100711281948194819481148113B +:109250004811481148196819EA218B326D4BCE5BD1 +:10926000AA428108A2108210B294BAD64952402074 +:10927000CBBB0EF5ADF4EDFCADF4CDF42FFD70FDE0 +:1092800070FD91FDF2FD74FEB6FED6FEF6FEF6FE12 +:10929000D5FEB5F694F6B5F6D6F6D7EEB4C5719C04 +:1092A0004D73CD62AE62F16A947BB683967BB783D1 +:1092B000188CB783B88BB88B577BB56A135AF351A8 +:1092C000724131413141113951417141D149335AD2 +:1092D0009462335AB24992497249524151395352B8 +:1092E000ED31A600A600A608A608A508840843003C +:1092F000E608081108112A1109110A110A190A2190 +:109300000B212A2108190719E618C5100619A829E2 +:10931000A829EA2988218921AA21EA21A9198919DC +:1093200069198919691949116A198B196B196B190E +:109330006B196B116B198C19AC19CD19ED214E32CB +:10934000CB218500A500EA290B2ACA21A921882161 +:1093500068194719C921B05B3585105C03092109DB +:109360004633231B0634A42B842BA333A33304449A +:10937000E43BE443044CE44BE553C44B303A503AED +:10938000303A0F320F3A303ACE31CE29EF31303AFF +:109390000F3A103A503A2F3A0F3AB14AB4739163E8 +:1093A000D16BF58C158D326C2E434B22AC3A2F537A +:1093B000B063527CB48CD494738CB39435A555A50A +:1093C00055A596B595B5484A41086D6BDFFFDBD6CC +:1093D00018AE52746C3A0B328D4AB06BB7B5FBDEE7 +:1093E0005DE7BEEFDFF7BEEF7EEFFCD67ACEF8B5D5 +:1093F00076AD149D928CF07B6E6B0C5BAB4A294270 +:10940000C731A7318629452145212521051905198F +:10941000E418E418E518C410C418C410C418A41043 +:10942000A410C410C410C410E410E5182619672154 +:1094300067298729C9316B42AB4A0C5B2D5BEB5A1C +:1094400028426108A2108208CF7B7ACE92844429F8 +:10945000C138ECBB0EF5EDFCEDFC0DFD2EFD2EF53F +:10946000EEF42FFDB1FD33FE95FED6FE38FF79FFF9 +:109470007AFF79FF38FF18FFF8F6D8F6F8F63AFFCA +:109480005AFFB9EEF6CDF3AC52949083707B717BAA +:10949000517BF16AD26AB36A7362F2519149D35136 +:1094A000D3517141504190416D398C41CD412E5283 +:1094B000705A3052F049B149B2499249B349745A8D +:1094C0006C298600A608A500A608C60884004300EB +:1094D000C608E708081109112A112B190A21EA20E8 +:1094E0000A212A212821E510C51027218829A82929 +:1094F000882168218821681968196819681948192C +:109500004819491129114A196A116B116B118C19EB +:10951000AC19AC19AD19CD19CC190D222C32891901 +:10952000440027114C320C2ACA21A919881988191C +:1095300047196719AC3A936C35850722E100652A13 +:109540008A540213E633A42BA42BA333832BC33BEF +:109550002444044404440444C443C4431353545BA8 +:10956000F352B24AB24A914A914271425042503A41 +:10957000303AEF31EF31CF31EF31CE3150425363DA +:109580007263505B905B336C746C504B2C2AEB21F4 +:10959000EA29EA292B3A4B3A6B42AC4AED522E5B50 +:1095A0006F63F073928C8A4A41082C63DFF7DBD635 +:1095B00018AE52742C32AA29EB31EE52F59419BE32 +:1095C00039BE7AC69BCEDCD63DDF7EE7BEEFDFF745 +:1095D000DFF7FFF7FFF7DFF77EEF5DE73DE71CDF23 +:1095E000DBD6BAD69AD67ACE79CE59CE59C659C6D6 +:1095F00059CE39C639C639C659CEF8BD18C618BEB7 +:10960000F8BDF8BDF8BDF8BD18C618C618C639C6ED +:1096100059C67ACEDCDE3DE71CE7FBDEDBE639CE61 +:10962000308C8210821061083084DBD6B37CCB4A48 +:109630008218C1386AAB2FED2FFD2EFD2EFDEEFCFA +:10964000ADF4ADF4ADEC0FF570F5B2F534FE96FE69 +:10965000F8FE59FF5AFF5AFF5AFF7AFF39FFF8FE0A +:10966000D7F618F739FF7AFF5AFF1AF7B9EED7CDB8 +:1096700015BD94AC139C938B338333839272516AE0 +:10968000516272627162A8204939D283749C739CC2 +:10969000949C3394517B906AAE496F41F149925A40 +:1096A0006B29A600A600A500C608A500A5086400B1 +:1096B000A500C708E80809110A114A19E918661037 +:1096C0008710C610E6100619472168218829A821AD +:1096D000671947196821471948194819481948193D +:1096E000281129116A196B198B19AC19AC19AC190D +:1096F000AD19CD19CD21CD210C22EB210709640034 +:1097000089198E3A2C2AEB21CA21891988218819B6 +:109710006819C9218F53F47CAF5BE20000098C6C9F +:109720000B5D43138423C533832B832B622BE33BD5 +:10973000454C2444654C6654254CE4431353345B38 +:10974000545B1353D24AD24AB24AB24AB24AB24ADC +:10975000B24A303A303A0F32303A5042303A303A28 +:109760007042B04A6F3A0D322D320C2A0C2AEB218E +:10977000CA21A921A921CA29EA29EA29EA29EA292B +:109780000B2A0A2A6C3A4B3A4200CB52FFEFBBC677 +:10979000D89D736C2C32CB29EB316D426F63537CB7 +:1097A000537C94849484B48CF594369D76A597ADBF +:1097B000D8ADF8B519BE59BE9ACEBBD6FCD6FCDEE4 +:1097C0001CDF9EEFBEF79EEF9EF7BFF7BFF7FFFFD0 +:1097D000FFFFFFFFFFFFFFFFFFF7FFFFFFF7FFFFA9 +:1097E000FFFFFFFFFFFFFFFFFFFFDFFF9DEF5DE7D5 +:1097F0005CE75DE79EEF7DEF1CE7BAD63CE73CEF08 +:1098000038CEC6396108A210107CFBD6D37C0D433C +:1098100087218218A228477A2DCCCFF4CEFCEEFC0B +:10982000CEFCCDFCADF46CEC6CEC4CEC8DEC0FF59F +:10983000D2FD75FEB7FEF8FE39FF59FF7AFF7AFFB9 +:109840007AFF5AFF59FF39F7F8F6D8F6D8F6B7F687 +:10985000B7F677F636EE36EEF6ED96E555DD56DDE3 +:1098600077DDF9DD97CD29522952308CB6BD1BF733 +:109870003AFF1AFF3AFFB9F697C5138CAF624E5202 +:1098800049218500A608C608A500A608E7088500A6 +:10989000A600C708E8100911E810A608C610ED5286 +:1098A000B073ED52A831472188218821A821882151 +:1098B00068214719271947194819481929114919C1 +:1098C0006A196B196B118C198C19AC19AD19CE1959 +:1098D000EE21EE21ED210C2AAA218500A600EB2124 +:1098E0008E322C2A8A19AA218921A921A92188210D +:1098F00088214B32F05BD374A721C100432A719EAB +:109900008C65A423431BC533832B832B832BE33B21 +:1099100024440344444C6554254C254C345B545B2F +:109920009563345BD24AD352F352F352345B545BA7 +:10993000145BD34AD34A924A5142303A303AEF311B +:109940000F32103A2F3A503A2F3A0E32ED29AB1916 +:109950006A1149112811E708E708280969118A19CD +:10996000CB21CB210B2A0A2A8308293ABEE759B614 +:109970001164B0532C32EB29EB312C3A4C428C421F +:109980004B3A4C3A6C3A8C42AD4ACD4ACD4AED52F4 +:109990000E532E5B4F5B6F63B06BD16BF173F17342 +:1099A000F1737384F494569D97ADD8B519B63ABE49 +:1099B0007BCEDCD69BCE9ACEBBCEDCD6DBCEBBCE6E +:1099C000BBCEBBCE9BCEBBCE9BCE9BCE59C618BECC +:1099D00018BE18BE5AC67AC638BE18BE7ACEFBDE8E +:1099E0001BDF6D6B6108C310EF731CD735852D43EA +:1099F0002A2AC4082A4A864144598892CCCB4EE48C +:109A00008EEC6DF48DFC6DFC6DFC4BFC0BF42BECC3 +:109A1000CEF4B1FD13FE34FE54FE96FED7FEF8FEE2 +:109A200018FF59FF7AFF9AFF79FF78FF38FF17FF79 +:109A3000F6FED6FEB5FE74FE34FE14FED3F5F4F544 +:109A4000F5F536F677FEB8FE94D5ED9B686A265A92 +:109A50008A9330CDD2E554EE18FFBCFFFBF615AD6E +:109A6000AC5AA41043008408A508C508E710A6084E +:109A7000E708E7100811A60085088C4A56A51CDFE8 +:109A8000BEEFDFF7F49467218821A929A821A9292D +:109A900088216821471927192819291149116A199C +:109AA0006B196B198B19AC19AC19AD19CD19EE21C5 +:109AB000ED210D22EC214911650007112C2A4D2AB8 +:109AC000EC218A196919691968198821882188196E +:109AD0000922CC3A926C2D4BC308E108A85370962A +:109AE000AD6D06342213C533832B632B832BA33335 +:109AF00024442444454C454C4554E44B7563545B25 +:109B0000956B9563545B75637563345B545B555B10 +:109B1000355B145334533453F352503ACF31EF3151 +:109B2000303A303A0F32503A303A503A7142503A65 +:109B30002F324F3A4F3A0E32CC212A19A700860015 +:109B40008600A608C608C5104200C3106D638E6368 +:109B500029326B32E9298821A829C9290A3A4B3AC6 +:109B60002B320A2A0B2AEA29EA29EB290B2A2B2A6B +:109B70002B322B2A4C326C326C326C326C326C329F +:109B80004C326C32CD3ACE3AAE3AAE3AAE42CE42DA +:109B9000EE4A0F532F5B7063D16BF273337C738487 +:109BA000948C74847484337CD173B06B906B7063C9 +:109BB0004F639063F173737C9384F48C359D14959B +:109BC000359DAF73A310C3180C5B3DD7978D6E43C3 +:109BD000CC32A8196C3ACD528C5AE9514649297AAF +:109BE0002CB3AEDBCDEBCCF30CFC4CFC6CFC6CFC76 +:109BF0006CF48CEC0EF54FF54FF54FF570F590F5D4 +:109C000091F5D2FD34FE95FEF6FE17FF37FF17FFE4 +:109C100017FF37FF37FFF6FED6FEB6FE75FE13FEC2 +:109C2000B2FD91F530ED71EDD3FD14FED4F58BA3AB +:109C300080386251EBABEED4EDDCD1EDF7FEBBFF2B +:109C40005AFF13AD484AA310420063006400640049 +:109C500085088508A6086C42369D7EE7FFF7FFFF62 +:109C6000FFFFFFFFDFEF107405196721A829A8295E +:109C7000A92989216819481929194A196A196B19DA +:109C80008C19AC19CC19CC19CD19CD21ED21ED21B0 +:109C90000C2ACB21C600850069110C2A0C2ACB2185 +:109CA0008A19691969196819682188196819C821F8 +:109CB0006B2AF05B516C4511E308062A4F7D708ECC +:109CC000EE75673C431B063C842B832BA333A333E5 +:109CD0000444E34304442554254CC44B7463345B6F +:109CE000545B75635463756375635563555B545B6F +:109CF000345B145314533453D34A9242503A303A9B +:109D0000513A513A303A313A513A51427142303A2D +:109D1000513A513A7142B14290420D326A21492181 +:109D20000819A608A608A508A51042002519A7210C +:109D30004509E400A30063008400A408A508E61018 +:109D400027112711271127116819681989198819EE +:109D500088198919A919C919C921CA21EA21EA2131 +:109D6000EA210A220B22EB21AA19AA19AA19891998 +:109D70008919892189218921892189218921A9217B +:109D8000CA29CA29CA29AA21A921AA21AA21CA29DC +:109D9000CA29CA210A2A4B326C32AC3ACC42AC42B4 +:109DA000EC4A4D53452183104942BBC6F47CB04B6D +:109DB000ED324C2A6C32AD428D426C428C52AC6A10 +:109DC0000A72EA898CAA4ED3AEDBCDE30CEC2CF4FC +:109DD0004CF46CFCCDFCCDFCCDFCCDF4CDF4EEFC14 +:109DE000CDFCADF40FF550F591F5F2FD13FE33FE09 +:109DF000F3F5F3F534FE54FE54FE13FEF2FD91FD2F +:109E000050FD0FFDEFFCEFFCCEFC8EECAEEC11ED47 +:109E1000ADAB2030A040C9B3CBE4CBDC2DDD11EEDF +:109E200095F638FFF8F611B56C7B695AC6412531B5 +:109E300005298731B3947EEFFFFFFFFFFEFFFEFF92 +:109E4000FEF7FFFFFFF79EE7117446190511882101 +:109E5000A829A8298821692169198A218B21AC2187 +:109E6000CC21CC21CC21CC21CC21CC21CC21CB218B +:109E70004811850007090B2A0B2AEB21EB21AA19AF +:109E800069196919681988196821881988196B3244 +:109E90004E4BD37C8A3AE308C4085074F2959296EC +:109EA0002F7EA84484238844063CA4338333833321 +:109EB000A3330444E443A343633BA44B7463345B84 +:109EC000345B555B556354635563546375639563A5 +:109ED0007563345B345B1453F34AD24AB24A9142FD +:109EE000B24AD24A714271425142924A92427142FE +:109EF00072427142513A703A2E3A6E3AF052AF5273 +:109F00006E428A290919E810281985008F5B9AAEDC +:109F1000F88D11440D2B2A128811C608C510C510E2 +:109F2000A508840884006400640083008308A308F3 +:109F3000A30883008308A3088300C408C408C408D6 +:109F4000E508E5080511061126112711271127112B +:109F50004719471968196819681968196919691939 +:109F600069198919A919CA19EB21EA19CA19AA117B +:109F7000CA11EB19EB190B1A4B1A2B1A2B1A2A1AA6 +:109F8000AC2A0D438B3AA308E310F7AD3485726415 +:109F9000B053CD3A6C324C324B2AD15BF8AD3AC655 +:109FA000B6A43283CD61AC690D82AD9A2DBB8DD341 +:109FB000ACDBCCEB0CEC0CEC0BF40BF42CF42CF435 +:109FC0000BF40BF44CF46DF48DF48EF4CEF4CFF46A +:109FD000AEF4AEF4CFF4EFFC10FDEFFCCFF48EF452 +:109FE0008DFC2CF4ECF30CF40CF4ECF3ECEB0DE442 +:109FF000EDC3E6710020A3618CDCAAE4ABE40CE5C0 +:10A000002DE58FEDF1F532F693FE74FEB2E510CD3D +:10A01000CFC4D0BC57D6FEFFDEFFFEF7FEF7FEF73B +:10A02000DEF7FFF7DFF7FFF7FFEFB79DCC424611F2 +:10A03000E5104619A829A829A929AA29CB29CB299D +:10A04000CC29CC29CC29CB21CB29CA294819A50850 +:10A05000650069194D322C2ACB21AA21AA19681949 +:10A06000481948196819681968216819E929CC3A0A +:10A07000526CCF5B0411C310293AF7ADB28D5296E2 +:10A080002F86C954642367442644A4338433632B46 +:10A09000A43BE443A443633B8443844395637463D8 +:10A0A0005563756395637563956B956B956BB66B2F +:10A0B000B56BB56B7563345B135313531353135361 +:10A0C0001353F34A13531453F352F352D352B24A75 +:10A0D000924A7242514291422E3A0C32305B926B5C +:10A0E000B26B115B2E3A4A19291108114711F57408 +:10A0F0001986155D934490336D2AE708C610A510A4 +:10A10000C61006190619E610C510840883086308EE +:10A110006308A410C410C410E410E410E410E410A8 +:10A12000C410A30883086300630063006300630036 +:10A130006300630083008400840085008500A5001F +:10A14000C500C600E6002709681188116811480992 +:10A150004809480948098811EA190A1A2A1A2A1AC4 +:10A160002A226A32EC4A45214100CF6B79AEB374A2 +:10A170008F4BED3AAD3A2E439474BCBE7EDFBCCE1D +:10A18000BBB5999C9362D0516E514C596B69CB8190 +:10A190004C9ACCB20DC36DCB8DDB8CDBACE3ACE366 +:10A1A000ACEBABEBCBEBABEBCBEBCBEBCBE3CBE36E +:10A1B000ECEBECEBECEBECEB0CF40CF42CF4ECF344 +:10A1C000CBF3AAF38AF38AF3ABF3CBF3ECF3CCDB58 +:10A1D0006BBB477A202801490AC48AE4AAECAAE4A6 +:10A1E000AAE4CAE4CBE4EBE40CE52DEDACDC8CDCBA +:10A1F000EEE4CED4097B77DEFEFFFEF7FEF7DEEF5E +:10A200009DE77DDF9EE77DDFDFDFFCC67795326C63 +:10A210000D4BE929E508C5080611271148198A19C7 +:10A22000AA21AA218A21CA298921E6106300E61001 +:10A23000CA212C320C22EB21AA19AA19EA21A92140 +:10A2400068194819682188218821C9218B328F53C8 +:10A250007274A619C310C4107384F8AD728D32964F +:10A26000708E0955A42B67446744E53BA43B8333B8 +:10A27000C43B843B843BA443C6538443D56BB56B3A +:10A2800075637563956BB56BB66BB56B956B7463E6 +:10A2900074639463946B335B335B335B535B135333 +:10A2A000D24AF34A3453F34AF34A1453F34AB34AB3 +:10A2B000724271427242B14A6E426921B26B348479 +:10A2C000F37BD3736E4ACC318B212911E7000B1A33 +:10A2D000B13BB44CD54CB1336E22C8086500440084 +:10A2E00044004400650065084500650044004400E2 +:10A2F0006508C61007196829ED522E5B2E5B2E6388 +:10A300002E5B0E5B0E5B2E5B2E5B0D5B0D5B0D53B0 +:10A31000ED52CC4AEC4ACC4ACC4A8B428B426A4240 +:10A320008B428B426A3A6A3A6A426A424A426B4AB2 +:10A330006A4A6A4A8A4AAB52AB4AEB520C5B2D5BC3 +:10A340004D636E6B6E6B6E6B0521E410348DB795AB +:10A35000515CAF4BB04BF57CDBB69EDFFCD65BCEE1 +:10A360005AB5757BD56A7462125AB1594F494F512B +:10A370004E594D59CE690E7A6E8ACE9A0EAB2DB3D8 +:10A380002CBB2CC34BCB6BD36BD36BDBACDB8CDB31 +:10A39000ADE3ACE3ACEB8CEB8BEB8BEB8BF38BF3A8 +:10A3A0008AF38BF38AF38BEBABEBABE38BD34ABB38 +:10A3B0006BABC56120202249EACB8AECAAECA9EC60 +:10A3C000A9E489E48AE46AE46ADC0AD489CB48C354 +:10A3D00069CB6ABB277AE651B9DEFFFFFFF7FFF7CB +:10A3E0009DE73CD71BCF1BC71CBFBBAE7785177D36 +:10A3F000F77CB57413642F4B8D324C2A2C2A4C2ACF +:10A400008E3A0F4B8D42A8296408840889212C2A92 +:10A410004D2A4D2A2C222C22EB212C2A2C320B2ABD +:10A42000EB29EB29CA29A921A821E9214D43D47C94 +:10A43000EC4AC308C3104A42B9AD989DD59D5396C6 +:10A44000918E2A5D8423473CA84C47442644A43B74 +:10A45000E543833B633B64438443A54BB56B946303 +:10A46000956B956B7463B56BB56B9563956B746306 +:10A470005363325B325B335B1253125B135BD24A22 +:10A480009142D34AD34AB242F34AF452F34AB24217 +:10A4900072429242714250424E3A0811505B7484AB +:10A4A000958C958CB2732D3A6B2109114911AB1122 +:10A4B0008D1A0F23702BCE22AB11A800450024006B +:10A4C000240024002400240024002400240024006C +:10A4D000240045004500A60869218929CA31EB39C5 +:10A4E0000B3A2B422B424C42AD4ACD52AD52ED526B +:10A4F000AD4AED524F5B6F638F638F636F634F5B4A +:10A500006F636F636F638F636F6B4F6B6F736F738B +:10A51000B07BD083D07BB07BB07BAF7BD07BB07B7C +:10A52000D07BB07B6F736F6B8C52A4082932726C36 +:10A5300092649264936C79AE9DDF5DDF7BD679BDCA +:10A54000B583D46AD56A75625562D351B349B249AD +:10A550009149D251D251B051AF59AD59CC692C7AF1 +:10A560008D92CD9ACDA2EDAA0DB3ECB2289AC691E8 +:10A57000069247A2A8B22AC36BD3ACDBACE3ACE330 +:10A58000ACE3ABDB8BDB8BDB8BD36BC32AB32AA3B4 +:10A59000C98A8038002005722AD46AEC89ECA9ECBB +:10A5A000A9EC89E46AE46AE4E9DB89D328CB08CB27 +:10A5B00029CB09BBA99A2028C649DAD6FFF7DEEFD6 +:10A5C0009DDF7CD73BC799AEF895777D587DF774B2 +:10A5D000345CD34BF3533464546454643464546C27 +:10A5E0007474705BA929A5082619EA292C322D2A32 +:10A5F0002D2A2D224D2A0B220C2A2B2A0B2A0B2A1C +:10A600000B322B32EA29A921C8214A32516CF0635E +:10A610000411C410E51074841895B9A537A6D5A601 +:10A62000B18E6A5DC52B673CC94CA84C6644E43BBF +:10A63000264CE443C443C54BC54B84431253335BA0 +:10A64000B56B946B536374637463746B7463335B43 +:10A650005363325BF2521253125B1253F252F252B4 +:10A66000B24AD34AF34AF34AF452F34AB242713A35 +:10A670009242D34A9242714270420911EB31137CEB +:10A68000958CB69455848E4A8B2909112A116A112A +:10A69000AB192909E700E700E90887004500240015 +:10A6A000240024002400230023002300230023008F +:10A6B000240024004500E810AB290919E810E8102F +:10A6C000E810C810C810C808C810C810E810C81092 +:10A6D000C810C810081909190919291929190919BF +:10A6E0000919091929192919292129212921E818C4 +:10A6F0006A296A296A296A298A296A298A298A2962 +:10A70000AA296A292921292129212919850007092E +:10A71000CC3AF053F89D9DDF3DDF7BD6BAC5169449 +:10A72000B36A74625462345A135AD251335A9462DF +:10A730001673577BF6729462736252624B4187289C +:10A740002A41ED610F6A3072707A2D72265151B430 +:10A750000FA44B8B2672A46163596359A569E671F6 +:10A76000267A47824782688A888A487AE669234936 +:10A770002020002063618AB36BDC69E489ECA9ECDA +:10A78000AAEC6AEC4AECEADB89D389D308CBC8C2CD +:10A79000C8C2C9BA88AAA57100104529F3943CD74C +:10A7A0009DD77DCF7CCFDAB6567DF66C955C345460 +:10A7B000355C355C1454F453355C3464746CF2636A +:10A7C0004B32C508E610CA290B2A2C2A2D2A4D2AFD +:10A7D0002D2A2D220B220C2A0B2A0B2AEB29EA29DF +:10A7E0000B32EA29A9218821092A8F539274082A59 +:10A7F000A308A3108C4A179DF894B9A537A6B59E57 +:10A80000B18EAB65E52B673CE94CC84C4644043C33 +:10A81000664C8554A65CC764254CC443B14AD14AF2 +:10A82000535B7363536353637363746374635363FE +:10A830007363325BF252F252325B1253F252D24ADB +:10A84000B24AD34AD24AF34AD34A9242713A503A70 +:10A85000513A713A513A714270428B21C608906365 +:10A860005484D694958CF37B4D428B21CC29AC211A +:10A870004A192A19E7104500A7088708450024004F +:10A8800024002400230023002300230023002300AE +:10A8900024004500A708EC314A19C910C910C91095 +:10A8A000EA10EA10C910C910C910C910E910C9107E +:10A8B000C910C910C910C910E910E9100A190A19FC +:10A8C0000A19E910E910E910E910E910E910C910B6 +:10A8D000C810C910C910C910E910E910E910E91031 +:10A8E000E910C910C910E910E910E910E8104C3A54 +:10A8F0002E4BB79D9DDF5DDF5ACE38B5F68B936A40 +:10A9000074625562145A135A135A135A9362D88BAD +:10A91000BBAC7A9CF993D98B977B114A69186C3937 +:10A9200047100B29535A135AF251315AAB49339CF1 +:10A930009EFFDEFF5BFF57DE94C5D1AC2F9C4B7BA7 +:10A94000886A065A8449023980308030A030E13864 +:10A950006349E9826EC42FEDECEC8AE48AECAAEC40 +:10A960008AEC6AEC0AE489D38AD36AD34AD3C8C290 +:10A9700047B247B226A2068A445900102008AA4AC4 +:10A98000549DBABE9DD7FBB67785745C1454355C74 +:10A99000355C1554D34B145C7564F35BCE3A4711A8 +:10A9A000E61088210A320B2A2C2A2D222D222D2254 +:10A9B0004D2A0C22EB212B2AEB29EA29CA29EA2964 +:10A9C000EA29A9218821A819ED429274EB42C30813 +:10A9D000A3102621D69459A57AA5DAA5169E949E91 +:10A9E0009086CB65E52B8844E94C673C4544864C12 +:10A9F000A654854CC554C65C855486547142303A81 +:10AA00005042B14AF15A52635263325B125B536354 +:10AA100052631153B14AB14AF252F252B14A9142D1 +:10AA2000924A9142503A30321032103210320F3284 +:10AA3000303A513A7142503A0F32CD2964000A320D +:10AA4000F273F694D694B58CF373CF528E420D32D6 +:10AA5000ED298B21C61044006400A6106500240077 +:10AA600024002400230023002300230024002400CA +:10AA7000250046008A292D3AE910C910C910C910CD +:10AA8000E910C910C910C910E910E910E910C9107E +:10AA9000E910E910E910E910E910EA10E910E910ED +:10AAA000C910C910E910C910E910C910C910C9109E +:10AAB000C910C910C910C910E910E910C910E9106E +:10AAC000C910C910C910C910C910E8106D420E5341 +:10AAD000348D9EDF5CDF9BD638B537949362135A72 +:10AAE000135AF359F459135A125A7262D78BFAACAB +:10AAF0005CBDBAAC389C799CD262AA18146BD68320 +:10AB00008718C920935A545A1352135A5262EE515D +:10AB1000718397C53CFFDDFFDDFFFDFFFDFFDDFF1E +:10AB20009BFF5AFFD8F6D4D511BDF0BC10C551CD4E +:10AB300092D5B2DD13F6F1F5B0F5ECEC8BEC29E42F +:10AB40004AEC4BECCADB6AD36AD36AD34AD3C8C295 +:10AB500026AA06AAE699C691E6894461402800081B +:10AB60002008E731EF6B348D1685956C7564145CA5 +:10AB7000355C345C3464D25B8D3A481947196819E6 +:10AB8000A921A921A921EB212C222D224E2A4D2ACF +:10AB90002C2A0C2AA919A919A921CA21EA29EA29CA +:10ABA000A921882188198B3A726CEF5B0411A208E5 +:10ABB0008308906BFBB59AA5BBADB9A537A6949E4B +:10ABC0009086CB654634A844094D66446544864C5E +:10ABD000075D075DC654E65CE764C75C714271427D +:10ABE000504270426F42D052115BB04A4F427042A5 +:10ABF000904A9042503A503A503A0E32EE310F326B +:10AC00000F320F320F32CE29CE29EE29CE290F3244 +:10AC10000F320F32EF31CF29AE29CD29C608A40853 +:10AC2000CD4A337CF694179DB694147C5163ED3174 +:10AC3000CC29CC29E710440043006308850845006F +:10AC400024002400230023002300240024002500E6 +:10AC50004600A8108E4A2919C910C910C910C91078 +:10AC6000C910C910C910C910C910C910C910C9101C +:10AC7000C910C910C910C910E910E910E910C910AC +:10AC8000C910C910E910EA10E910C910C910C9109B +:10AC9000C910C910E910C910E910C910C910C910AC +:10ACA000C910C910E910E910C8104D42CD4A927C74 +:10ACB0007DDF7DE7FCE699BD779CD46A135AD351BA +:10ACC0009249B249D251F151315AB683FAAC7BBDA7 +:10ACD0001AB5B9ACD9ACD68B4C3114637994136BDB +:10ACE00045086B313673F772B66A5562345A535A57 +:10ACF0007062AF6A908335B558DEFAF65BFF5BFF92 +:10AD00007BFF9BFFBBFF9AFF9AFF79FF38FF17FF7E +:10AD1000F7FED6FEB4FED0F52EEDACE42BDCA9DBBD +:10AD2000EADBC9DB69D329CBC8C2E9CAC9C288BA80 +:10AD300026AAE6A1A599A5918589C589A571245161 +:10AD400081300010000861082519E9298C3A2F4B41 +:10AD5000D25BF25B8D3A481107118821A92148196D +:10AD6000481968198919EB212D226E2A4D2A2D2A9E +:10AD70004C2ACA21891968198919A921A92189216F +:10AD800088218821C921F163516CA619A208A30862 +:10AD9000C93158A59AA59BA5399D99A537A6B4A6F2 +:10ADA0007086AB5DE42BA8440955A74C864CA6548D +:10ADB000E754C654C654E75CE75C66545042914A77 +:10ADC0007142504270424F3A0F3ACD29AD290E32AE +:10ADD0009042704270425042EF31CE31CE29CE299E +:10ADE000AE29AE298D218D21AE29CE29CE29EF3174 +:10ADF000EF31CE29AE296D214C196C212819430061 +:10AE0000481970637484968CB69475845163CF52DC +:10AE1000CC31CC31CB318608230042006308850851 +:10AE20008508450024002400240025002500460054 +:10AE30006700ED31CB31C710E910C910C910C91036 +:10AE4000C910C910C910C910C910C910C910C9103A +:10AE5000C910C910C910C910E910E910C910C910EA +:10AE6000E910E910E910E910E910E910E910E9101A +:10AE7000E910E910E910E910E910C910E910C9104A +:10AE8000C910C910C910C8104C428C42106C7CD734 +:10AE90007CE75DEFFACD97A4557B535AF351724985 +:10AEA000524192499041F049D68BD9AC7ABD19B53F +:10AEB000D8ACF9AC989C2F52366BF98317848C313F +:10AEC00046084E527683D993F672F77A5462F3515C +:10AED000335A72629262906A518B12A4B2BC33CD23 +:10AEE000B4DD96F639FF79FF59FF38FF17FFD6F624 +:10AEF00054F612F66FEDCCE44BDCEAD389D38AD357 +:10AF00008ADB29CBE9CAA8BA47AA27AA47B227AA47 +:10AF1000E6A1C59984898489648984898581A5810C +:10AF2000C681A579057A256A88624B6B6D6B4942AB +:10AF3000461906112711892168190711E710071111 +:10AF40000711281189110C224E2A6E2A8E324D3299 +:10AF5000EB21681989198921891989212711271954 +:10AF60004719A921ED4A116C2932A3088208C4109F +:10AF700054847AA519951995D89499A536A694A6BE +:10AF80005086AB65C42B8744E94CC74CA74C864C14 +:10AF9000E75CC654854C664C8754054C7042714240 +:10AFA000503A503A7142503ACE31AE29EF31EF313A +:10AFB0002F3AEE31EE31CE29AE29AE29CE29AD2978 +:10AFC0008D21AD29AE296D218D218D218D298D21D8 +:10AFD0008D21AE29CE29AE298D21AD29CC31A608EF +:10AFE00044002B3AF273548455843484916B305B63 +:10AFF0006E42AB31CB318A29640822004300440001 +:10B00000A6088608660045004500460046008708F9 +:10B01000EC312D3A8608C710C910C910C910C910E3 +:10B02000C910C910C910C910C910C910C910C91058 +:10B03000C910C910C910C910E910E910C910C91008 +:10B04000E910C910E910C910C910C910E910E910B8 +:10B05000C910C910C910C910C910C910C910E91008 +:10B06000E910C910C8100C328C424D5B3CCF7CDF1C +:10B070007DEF7BDEF8ACB5837462345AD3519249CC +:10B08000B2494F41AF49957B98A49BBD7ABD39B574 +:10B090003AB53AB5537374731984398C336B87108E +:10B0A00087185373399C3EBD167B7883588354624E +:10B0B000545A345AD251D151EF596F72AE7ACE826E +:10B0C0004E9310A4F7DD3BFF5AFF38FFF7F6F6FE6C +:10B0D00012EE0EDD4BD42ADC0ADC89D329CB29CB36 +:10B0E00029CB87BA87B247B206A2E6A1C6A1C69904 +:10B0F000A59985916489648984898491A591C59174 +:10B10000E691C8A24ECCD4ED56E612AD0B6366298B +:10B110002621472167190711E608C608E608281105 +:10B120006919AA190C224D2AAF32F03AAF3A6D32A2 +:10B130000B2AA921CA29A9218921481927112711D8 +:10B140006821AC42B063AB42C30883088308AD52A8 +:10B15000189D1A9D1995D88CD99499A5159E739E02 +:10B1600050866B5D84238744E94CA74C25442444D6 +:10B170008654A654654C86548754675491422F3A9E +:10B180005042914270422F3AEF31CE29EF31AE2931 +:10B190006D216C218D218D216C218C218C216C21C4 +:10B1A0006C218D218D218C218D218D218D218C2152 +:10B1B0006C218D21AE29AE29AE29EE31ED314A2127 +:10B1C000440084006C42B16B137C758C3484716BC9 +:10B1D000105B0C3A8A29CB318A29C710440024001D +:10B1E00045006608A708C80888086700C910ED3937 +:10B1F0002C428508C710E910C910C910C910C91020 +:10B20000C910C910C910C910C910C910C910C91076 +:10B21000C910C910C910C910C910C910C910C91066 +:10B22000C910E910E910E910E910EA10E910EA1074 +:10B23000E910E910EA10EA18E910EA100A190A19E7 +:10B24000E910E9108A294B3AAB42DBC63BDF7DEFC0 +:10B25000DCE638B5379CD46A5462D351B249F25116 +:10B260006E41AE413794B8A45AB559B579B539ADE8 +:10B2700019AD5794967BF883798C1AA5EB39651034 +:10B280000D4A1BAD3DB5BCA4F5725BA45B9C777BFE +:10B29000587B7562F351B251B251704990498F5148 +:10B2A000AF511062D27A34A417DE18FF16FF93FE56 +:10B2B0008FE54BCCA9C3AAD38AD329CBE8C2E8C275 +:10B2C00088BA06AAE6A1E6A1C599A599A591A5996E +:10B2D000A591849164918491C5A147AAC9B24BB349 +:10B2E0002EBCD1C490AC4C730842051905194719FE +:10B2F0002719E610E608E608C608E7084811AA215B +:10B300000C220D224D2A8E32D03ACF3AAE3A6D320F +:10B310002C320B2A0B328921892127192711471931 +:10B320004B3A4F5BAB4AE41082086208EA39F79463 +:10B330001995F994D994D98CD994999D359E939E59 +:10B340002F7E4A55C42BE94C09556744043C454CB3 +:10B35000654C254C454CC75CA85C6754503A503A44 +:10B36000B14A303AEF31CE29CE29CE29CE29AE29A5 +:10B370008D218D216C218C216C196C216C216C210B +:10B380004C196C216C218C218D216C216C216C213C +:10B390004C214C216D218D218D21AD29AD29ED311F +:10B3A0004821430064000A320F537163F373D3736F +:10B3B0003063EF5A0C3A8B29AB31CB310819A61008 +:10B3C000C710A710C810C908A8082A190D3A8A2959 +:10B3D0004500A6080911E910C910C910C910C91003 +:10B3E000C910C910C910C910C910C910C910C91095 +:10B3F000C910C910C910C910C910C910C910C91085 +:10B40000C910C910C910E910E910EA10E910E910D3 +:10B41000EA10EA10EA180A190A190A190A19E910B1 +:10B42000C910E810A929E93159B65DDF3CE71DEFE5 +:10B4300079BDD9ACB78BD56A345AD251325A6E39EC +:10B440008D3998A43AB59BBDBABDBABD79B5F8A4FB +:10B45000979CB57B967B38847BAD9273A510A5181D +:10B46000779C9DC5FDAC577BF572DCB4DCAC5A9C77 +:10B470001A94B66A155AB35193497249934993493C +:10B48000B351135A125A10620F8313C556EE74F655 +:10B49000B1EDADDCEAD369CB08C3C8BA87BA88BAC4 +:10B4A00047B206A2E6A1A499849184918491A591C2 +:10B4B000C691279A68A2A9A20BAB2BAB2BA32C9BFE +:10B4C0008972C649E320E410061927190711E6100E +:10B4D000C608E608C608C608071127118919EB2116 +:10B4E0004D2A2D224D2A8E32AF3A8E324D322C2AE1 +:10B4F0000B2A2B32AA2147194719271147192B323A +:10B50000EE4AAC4A251962084208E5185584399D6F +:10B51000D98CD98CD98CB98CF994989D159EB39EF1 +:10B5200070866B5DE52B2A5509556644664C875439 +:10B530002444C33B04446654264C88540F32EF31F4 +:10B540000F32EF31CE29AD29CE29CE298D218D2183 +:10B550008D216D216C216C216C196C216C216C2169 +:10B560006C216C218C218C218C218C216C214C191B +:10B570004C194B192B192B194C214C218C21CD29FD +:10B58000ED3108192300430088298C420F5B716359 +:10B59000B26B716BCE524D42CB31AB31CB31AB3153 +:10B5A0008B296A210919E810E8188929E61845004D +:10B5B000A710E818C910C910C910C910C910C910BE +:10B5C000C910C910C910C910C910C910E910E91073 +:10B5D000E910E910E910E910C910C910C910C91023 +:10B5E000C910C910C910C910C910C910C910C91093 +:10B5F000E910E910C910C910E910C910E910C91003 +:10B60000E810E710E510359D1DDFBCD6FEE699C5B4 +:10B61000989C3894577B9562335A535AAE416B3994 +:10B62000D8A4DBC5DAC5FAC5B9BD78B538AD39AD32 +:10B630007894D67BB6739CB559AD682964102B4AB3 +:10B640001DD6BEC51B94966AD6727BA4BBA47B9CF8 +:10B65000D983B66A3562B351B35193499249B2491D +:10B6600054625462145A135AF1594F629193F3C4BD +:10B6700093E591ED0EE52BD489CB08C3A8BAA8BAFF +:10B6800088BA88BA67BA47B206AAE5A146A288A2D4 +:10B69000EAAACA9AAA8A8A7A4962C8492531E42064 +:10B6A000C4180519462126190611E608E7100711E6 +:10B6B0002819471927192711471127114811EA217D +:10B6C0000C2A2C2A4D2A6D324D324C2A0B2ACA21C3 +:10B6D000CA29681906112711071127190A2AEE4AE3 +:10B6E000ED528729820862088408916B199DF994AC +:10B6F000D994B98CB88CD88CF88C9895F48D318607 +:10B70000707E0A55E52B0A550955A74CA74CE85CF5 +:10B71000664C454C244C8654064CE54B8D218D21BE +:10B720006D218D218D21AD29CE298D294C196C21BA +:10B730004C196C216C198C218C216C218C218D2150 +:10B74000CD29AD298C216C218C216C192B192B1939 +:10B750002B192B190A192B192B192B194B196B2182 +:10B760006C216B29071964082300C510EA316C426B +:10B77000AD520E5B0E5B4C4ACA31893169298A2968 +:10B78000AA298A296921C710850844006508C710BD +:10B79000E818C910C910C910C910C910C908C908CA +:10B7A000C910E910C910C910E910E910E910E91031 +:10B7B000E910E910E910E910E910E910C910C91001 +:10B7C000C910C910C910C910C910C910C910C910B1 +:10B7D000C910C910C910C910E910C910E910E91041 +:10B7E0000819C608527C7BC698B5FAC5DBCD97A46C +:10B7F000D78B567BB56A335A9362EF49293138B5F6 +:10B800009DDE3BCE3ACED8BD78B517A559AD19A56A +:10B81000788CB673D99CFCBDCD5AA4108410759C4D +:10B820001ED61DB59983B76A177B7BA4BCA45A9416 +:10B83000577B9562355A93499349B349D249D149C7 +:10B840006E41D049F151F351D351B151AE510D6A0E +:10B850000E8B51B412DD32E5B1DC50DCADCB2CC324 +:10B860004CC36CC38DCBADC3ADC3ADBB6CAB0B9B3D +:10B870002972464905310629262147216821682178 +:10B8800047192719061106110711271148194819D8 +:10B890004819681988218821A921A921A9210B2AE1 +:10B8A000CA21EA214D2A4D324C322C32CA2189213B +:10B8B0002711E608061106114719EA31AD42CD4AB3 +:10B8C000A829830862084200EE52F894F994F9948A +:10B8D000B88CB88CB88CB88CF88C97951386307E61 +:10B8E0004F7E683C683C2A550955E854E85CC754CB +:10B8F000664C8654A75C6654265406546C216C1919 +:10B900004C216D21AD29AD298D218D216C216C211A +:10B910004C194C194C194C216C216C216C216C2157 +:10B920008D218D218D218C218D214C212B194B199D +:10B930002B190A192B192B192B194B214B192B19C0 +:10B940004B194B214B210919C710440023006300F8 +:10B950008308C4100519C410A41083106308840858 +:10B9600064084300430064088508A710C810C81085 +:10B97000C910E910C910C910C910C910C910C910DF +:10B98000C910C910C910C910C910C910E910C910CF +:10B99000C910C910C910C910C910C910C910C910DF +:10B9A000C910C910C910C910C908C908C910C910DF +:10B9B000C910C910C910E910E910E910E910071100 +:10B9C000C5082E539CC699AD99B5DCC51AB5F78B41 +:10B9D0003573D56A535A9362CD41C72016AD1DEF1A +:10B9E0001CE71CE7BBD639CEB8B599B579ADF99C43 +:10B9F000F77B38843DBE948C0519A4100B4A3DD6C4 +:10BA00001FCE7BA4397B966A5883BCA4DCAC5A94C5 +:10BA10003673D66A355AD451D349D249F049C92030 +:10BA20004510250867184C39F251D351D251D151E4 +:10BA3000B051CF597072D082119371A350A370ABE3 +:10BA40004E9B0D930C8BAB7A6A6A295AC8414729E1 +:10BA50000621282149216A218A2189216921681921 +:10BA60000711C608C60807116819A9218921681994 +:10BA700068198821A921C929C929A921EA29CA2126 +:10BA8000A921EA214C322C320B2ACA2189198919A1 +:10BA90000711E71007110611A929CD4ACD4A093A25 +:10BAA000A310620842000A3AD373B88C9884988431 +:10BAB000988CB98C988C9784B7849795F285717E11 +:10BAC0000E762634A8442A5D0955C854C8548754B4 +:10BAD000464C8654A75C875C4654675CAD29AD290B +:10BAE0008D298D218D216C216D216D218D21AD2917 +:10BAF0006C216C194C194C194C194B194C194C21CF +:10BB00006C216D216C216C214C192B192B192B19CF +:10BB10000B190A190A190A190B190B192B192A19C9 +:10BB20000A190B190A190A192A212921E718850867 +:10BB300043082300220022002200220022002200CB +:10BB400043008408A508A610C710E818C910C9103A +:10BB5000C910C910C910C910C910C910C910C9101D +:10BB6000C910C910C910C910A908A908C910C9105D +:10BB7000C910C910C910C910C910C910C910C910FD +:10BB8000C910C910C910C910C908C908C910C910FD +:10BB9000C910C910C910E910C910C8100819C5107A +:10BBA000C8295ABEB9B57AB51DCEDDCDFBACF88B30 +:10BBB0005673D462B362EE498518B49C5DF77DF785 +:10BBC0009DF77CEF1BE7BBD69BD61BC69AB5B994F5 +:10BBD000177C9CA5DAADC831E410C418D7A47FDE69 +:10BBE0007EC5FA93F87A766A9883BCA4BCA439948B +:10BBF000B462F56A555A1452555A735A6C39851005 +:10BC00006310420844106618115275625562B349B8 +:10BC1000934992499149D151AF51CF59EE612E626A +:10BC2000EB510631E528C520E518061927198919B1 +:10BC3000AA21CC21CC21CC218B196A196919281190 +:10BC4000C608A608E7106819AA21CA21AA218919DD +:10BC5000A921A921A92188216819A921A92189211E +:10BC6000A9210B2A0B2ACA2168194819471947111B +:10BC700007112719481989216C42CD522A3AA4107C +:10BC8000820862082A420F5B936B7884577C988401 +:10BC9000988C988C7884777CF784B68DF17D707E53 +:10BCA000CD6D0534094D4A5D095D46440544664C39 +:10BCB00066546654254C4654675C47548D218D214B +:10BCC000AD296C216C216C218C218C216C216C2183 +:10BCD0008C218C218C218C216C216C212B194B19EE +:10BCE0004C194C194C196C192B192B19EA10EA1024 +:10BCF000EA10EA10EA100A190A190A190A190A19A7 +:10BD00000A190A190A190A190A190A190A192921F4 +:10BD1000E818C710A710A610A710A610A610A71005 +:10BD2000C710E818C810C810C810C810C910C9102A +:10BD3000C910C910EA10E910C910C910C910C910FA +:10BD4000C910C910A908A910C910C910A808C9109C +:10BD5000C910C910C910C910C910C910C910C9101B +:10BD6000C910C910C910E9102B190A190A190A11AA +:10BD70000A19C910E910C910C910E81006190519E7 +:10BD800077A51ABE58ADDBC57FDE3BB5F78BB78311 +:10BD9000567335736F524408128C7DF79CF7DCFFA5 +:10BDA0009CF73BE7FBDE1CE71CE7BDD69BAD988408 +:10BDB000FA8C5DB64F53A408C410AC525ED61FCEA9 +:10BDC0005EBDB98BD87A766AF993BCA47B9CF98B5B +:10BDD000525A1573745A545AB562146B4929C518CE +:10BDE000C418A310A3108510AE41F6727562145AE0 +:10BDF000B3499249D351135AF251B251B151D0497A +:10BE00002E4A2821C610E61047212619281969193B +:10BE10008B19AC19AC19CC218A196A19692128111E +:10BE2000C608C608C7084919CB21EB29EB29CA2146 +:10BE3000CA2968210611E610061168210711271981 +:10BE4000A9218821A9218819271127112611061156 +:10BE50002611471988212B3AAD4A4A42C41062087C +:10BE60006208093AF17B4C42D573588478849884EF +:10BE7000788478845784767C3685B585F07D707EAD +:10BE80004B5D2634AC5DAB65295D04440444254418 +:10BE9000454C254C04444654465C465C8C216C1948 +:10BEA0006C218C218C214C194C196C196C214C196A +:10BEB0004C194C196C216C216C218C214B194B199C +:10BEC0002B194B192B192B194B194B190B190A1933 +:10BED000EA10EA10EA180A190A19EA180A190A19DE +:10BEE0000A190A190A190A19EA18EA10EA18EA18C6 +:10BEF000EA18EA180919E918E918E910E810C91050 +:10BF0000C910C810C910C910C910C910C910C9106A +:10BF1000C910C910E910C910C910C910C910C91039 +:10BF2000C910C910A910A910C910C910C910C8108A +:10BF3000C910C910C910A908C910C910C910A8088A +:10BF4000C910C910C9104B21AD318C296C296C2145 +:10BF50004B21E910C910C810E8100719A408117482 +:10BF60009CCE58ADDBC57FDE9DBD3894B77B366B6C +:10BF7000146B705244082E6B5DF77CF7DCFF9BF767 +:10BF80005BEF1BE7FBDEFCDE1CDF9CCE7BA5FA8CA7 +:10BF90003DAEB57C2611E410C51017AD5ED6DEC5EA +:10BFA0001DB59983977297723A94DCA47B9CD883D1 +:10BFB0001052757B156BF56A76739473E618E51865 +:10BFC0002621A839831064102B29B462545A956A2B +:10BFD000D66AD67254625562145AF451D3515352F0 +:10BFE000B14AE808C60807114821271928198A19F3 +:10BFF000AB19AC19AC19CC218B198A198A212919D2 +:10C00000E710C708A608C7084911AB21EB29CB29BF +:10C010004819E610A508C5084819481927194819EC +:10C02000471947198821A921682147210619C510F8 +:10C03000E510E610A9296B426B42C4106208620841 +:10C04000E931D1734F6389295784577C577C577CDA +:10C05000778477847784967C5585D485317E907EED +:10C06000C94C8844CC658B5D085D864CA6548654CB +:10C07000454C244C254C4654465C465C6C216C195E +:10C080004C194C194C192B192B194B194B192B19ED +:10C090004C192B192B194C192C192C194B192B191C +:10C0A0002B194B192B192B192B194B194C194B19EF +:10C0B0002B190A190A190A110A190A190A190A194F +:10C0C0000A190A190A190A190A19EA10EA10EA10D3 +:10C0D000EA10EA10EA100919C910E910C910E910AC +:10C0E000C910E910C910C910C910C910C910C91068 +:10C0F000C910C910A808C910C910C910C908C908B1 +:10C10000C910C910C910C910C910E910E910E91007 +:10C11000EA18EA180A190A192B192B192B192B19C5 +:10C120004B194B198C210E320E3AEE392F3A0E3A3A +:10C130000E3A0E3A0E32AC296929C5088B42BCCEA4 +:10C14000D9BDBABD7EDE3ED6999CD8837773356B58 +:10C15000B15A45102A4AFBE69CF7BCFFDCFF9BF76F +:10C160003CE7FCDEDBD61CDFFDD6DBB51A959D9DDA +:10C17000DA9D2A2AE410A410EE623DD61DCE1FCE11 +:10C18000FDAC99839772B7723A9CDCA45A94B7833A +:10C190002F4A378CF78396731784936BC510C41896 +:10C1A0000A422B4A84108510EA28925AF56A36739F +:10C1B000B8831A94D66A756255625462545AD5622D +:10C1C00094632911C608C6084819271948198A19FD +:10C1D000AC21AD21CD19CD21CC21AB218A2149192A +:10C1E000E810C708A608C70808094A116A192819DB +:10C1F000A508A5088408C510481989218821A92106 +:10C2000088218821A821A92988292719E510A408AF +:10C21000C5104721E939C831C41062084200C8314D +:10C22000906353840A3AEA317784377C577C778469 +:10C230007784577C7784B67C9585F27D917E4F76A6 +:10C240000634C94C8C5D4A55E854285D4865075D45 +:10C25000854C654C2654675C2654E54B4C194C19AB +:10C260004C192B194B196C214C214B192B194B19BB +:10C270004B192B192B192C194C214C194B192B1913 +:10C280002B192B192B192A190B190B192B192B19CF +:10C290002B192B194B194B192B190A190B190B199F +:10C2A0000B190A190A190A190A190A19EA180A1996 +:10C2B000EA10EA10EA10E910E910E910E910E910B3 +:10C2C000E910E910E910E910E910E910E910E910A6 +:10C2D000E9100A192B192A192B194B214B214B2133 +:10C2E0006C216C216C218C298C29AD29AC29AC29BD +:10C2F000AD31AD31CD31CD31CD31AD31CD29CD29BE +:10C30000AD29CD314F3A9042904A704A7042704206 +:10C310004F424F426F424D4206194619F9AD3BBE9E +:10C32000BABD5DD65ED61BADD883B87B9673F2627C +:10C33000A618262979D6BDFFBCFFDCFF9CF75BEF72 +:10C34000FBE6DBDEFCDEDCD69DCE399D3B951DAEEB +:10C350004F53E4080411C51859B51CCE3DD61ECE66 +:10C360001CAD787B566AF87ABCA4FBA47A9CB68391 +:10C37000AD41B89C1BAD3BADBCB5B373A510A410CB +:10C380000F632C4AA418A518A818F36A188CDBA40C +:10C39000BAA49DBD1994D572B66A956AB562156343 +:10C3A00036748A19C608C608E610E61048198A21AC +:10C3B000CC21CD21CE21ED21CD21AC19AB194A19CB +:10C3C000E708A608C608C70829116A194919E70825 +:10C3D0008408E510C51006116821A921EA29EA2977 +:10C3E000EA29C929A821A92968210619C510C5105B +:10C3F000E61888318729831042008308C9312F5BF2 +:10C40000F273537C06196C425784587C7884778485 +:10C410007784577C977C1685D485327E707E8C5DC0 +:10C4200026344B5D6B5D0955E854485D485D275DDA +:10C43000A654C75C6754064CC54346546C214C193E +:10C440002B192B194B216C214B192B192B192B193B +:10C450002B192B192B194B214C214B194B192B192B +:10C460002B192B192B192B192B192A190A110A11FF +:10C47000EA180A190A190A192A192B192B192B1942 +:10C480002B190B190B190A110A190B190A190A1978 +:10C490000A19EA10EA10EA10C910E910E910E910C7 +:10C4A0006B216C216B218C296C218C298C298C2986 +:10C4B000CD312F3A4F4270424F42704290429042EB +:10C4C000704A70424F424F422F3ACD31CD31CD317B +:10C4D000CD31CD31CD29CD31AD31CD31CD31CD3194 +:10C4E000CD31CD31EE390E3A2F3A2F422F3A4F420D +:10C4F0004F422E3A2D4228198300527CBDD699B561 +:10C50000FCC53ED67CB57994D8839673747328297C +:10C51000831074ADFDFFDCFFDCFF9CF75CEF1CE7D4 +:10C52000DBE6DBDEBBD65BCEDCB5D98CDC9DB67C36 +:10C530004611041183080E637EDE1CCEBDDE7ED65E +:10C54000DBA41773766A38831DAD1BAD9A9CF78BFD +:10C550006A31D79C7BB5FDC5FFDE9173A41006211F +:10C56000558C4D4A8410C518C8189473B99C7BB576 +:10C57000BBBDFDCDFBB4167B377BB562B562F56202 +:10C580003674CA190709C608E710E71028198A2166 +:10C59000CC21CD19CE21CE21CD21CD21CD216A199D +:10C5A000C708A608C608E8084A196A192819E61033 +:10C5B000E610261947196821CA290A322B32EA31B6 +:10C5C000EA31EA31C929A9294721E510C510E51842 +:10C5D00067296729830842006308C929AD4A505B6F +:10C5E000337C916B6408CE52778478847784778427 +:10C5F00057849784B7843685D37D30764F760A4D3D +:10C60000883C8C5D4A550855285D485D0755E754C0 +:10C61000285D085DC85C4654E54367542B192B1907 +:10C620002B192B192B194B194B214B214B194B193A +:10C630006C214B196B216B216C214B192B194B1958 +:10C640004B194B192B192B192B192B192B192B198A +:10C650000A190A192B190A194B194B194C214C218B +:10C660004B214B194B214B192B212B192B192B1912 +:10C670002B192B192B192B192A19EA100A19AC2975 +:10C68000EE31EE31EE31ED31ED31ED31ED312E3A6D +:10C690002F4250427042704A704270427042904243 +:10C6A000704A704A7042704270420E3AEE31ED317B +:10C6B000CD31ED31CE31EE31EE310E3A0E3AED3173 +:10C6C0000E3A0E3A2F3A2F3A4F422F3A4F3A7042D3 +:10C6D0007042904AAB31A508CB4ABBCE99B59ABD02 +:10C6E000DCC59BBDFBA49A945A8CB77BAB31640824 +:10C6F000508CDDFFDCFFFBFFBCFF7BEF1BE71CE783 +:10C70000DBE69ADE5ACE5BCE1A9DB98C598D2B2270 +:10C71000E408C410672957AD3DD65DD61EE7DEDEBE +:10C72000FCA4F772766A998B5DB51BA5BA9C5794E9 +:10C730002929B69CDCC55DCE7DD62B428308AC5240 +:10C74000BBBD6D528410C518092115841AADBBBD3F +:10C75000FBC5DCC5FBB4F5723673B5629562D45A7D +:10C76000156CEB21E708C608C608E7100711491940 +:10C77000AC21CD19CD19CD21CE21CD21CD216B11EB +:10C78000C808A608C70808116A1969194819E610E7 +:10C790002719271927194719A9290A32EA29EA2945 +:10C7A000EA29EA31A9292719E618C51006196721CF +:10C7B000472183084108A310A8292B3A8D420F5323 +:10C7C0005484CE522200EE5A77847884577C577C6A +:10C7D0007884B884D7847685F27D507EEE6D262CE1 +:10C7E0002A4D6B5D4A55495D495D485D085D285D90 +:10C7F000285DC754C854C85C8754674C1CC80108DE +:10C800000000002058000000448D000874C8010892 +:10C810005800002010040000548D00087777772E10 +:10C82000476967614465766963652E636F6D0000D3 +:10C8300000000000000000000000000000000000F8 +:10C8400000000000010203040102030406070809B6 +:10C850000204060800A24A040000000000000000D4 +:10C8600001020304060708090000000000000000A0 +:04C8700000000000C4 +:04000005080080ED82 +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LED.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LED.hex new file mode 100644 index 0000000..f2674ef --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBD/hex/LED.hex @@ -0,0 +1,99 @@ +:020000040800F2 +:1080000088200020458100089B810008938100089A +:10801000978100088D81000835820008000000006B +:10802000000000000000000000000000C781000800 +:108030009181000800000000C5810008C981000886 +:108040005F8100085F8100085F8100085F81000890 +:108050005F8100085F8100085F8100085F81000880 +:108060005F8100085F8100085F8100085F81000870 +:108070005F8100085F8100085F8100085F81000860 +:108080005F8100085F8100085F8100085F81000850 +:108090005F8100085F8100085F8100085F81000840 +:1080A0005F8100085F8100085F8100085F81000830 +:1080B0005F8100085F8100085F8100085F81000820 +:1080C0005F8100085F8100085F8100085F81000810 +:1080D0005F8100085F8100085F8100085F81000800 +:1080E0005F8100085F8100085F8100085F810008F0 +:1080F0005F8100085F8100085F8100085F810008E0 +:108100005F8100085F8100085F8100085F810008CF +:108110005F8100085F8100085F8100085F810008BF +:108120005F8100085F8100085F8100085F810008AF +:10813000DFF80CD000F018F80048004789830008E9 +:10814000882000200648804706480047FEE7FEE7F3 +:10815000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7F7 +:10816000D181000831810008064C074D06E0E06827 +:1081700040F0010394E8070098471034AC42F6D36E +:10818000FFF7DAFF4C8500086C85000800BFFEE7AA +:10819000704700BFFEE700BFFEE7704710B500283C +:1081A00007DA0A07140E054A00F00F031B1FD45408 +:1081B00003E00A07130E024A135410BD18ED00E045 +:1081C00000E400E07047704710B500F04FF810BDB4 +:1081D00010B51448006840F00100124908600846D4 +:1081E0004068114908400F494860084600680F4937 +:1081F00008400C4908600846006820F480200860A8 +:10820000084640680A490840064948600846006830 +:1082100006490840034908604FF41F00886000F0D9 +:1082200069F910BD001002400C00FFE8FFFFF6FEE8 +:10823000FFFF00F700BFFEE702E008C8121F08C1F9 +:10824000002AFAD170477047002001E001C1121FD7 +:10825000002AFBD1704700000349086000BF0249B3 +:1082600009680029FBD1704700000020044800681D +:1082700020B103480068401E0149086070470000B3 +:108280000000002010B504460B4931F8140000F03E +:10829000C1F80A4951F82430094951F82400032251 +:1082A000102100F027F8054850F82400044951F83F +:1082B0002410486110BD0000480000201800002074 +:1082C00008000020034951F82010034A52F82020EA +:1082D000516170471800002008000020034951F840 +:1082E0002010034A52F82020116170471800002026 +:1082F00008000020F0B5044616460025002201F0D3 +:108300000F0511F0100F00D03543002018E00127B1 +:1083100087401F4212D022684FEA800C0F2707FACD +:108320000CF7BA43870005FA07F73A43282901D129 +:10833000636102E0482900D123612260471CB8B282 +:108340000828E4D308201CE0012787401F4216D0EC +:108350006268A0F108074FEA870C0F2707FA0CF7AD +:10836000BA43A0F10807BF0005FA07F73A432829E6 +:1083700001D1636102E0482900D123616260471C9A +:10838000B8B21028E0D3F0BD4FF40041080300F06C +:1083900037F80020FFF776FF0120FFF773FF022078 +:1083A000FFF770FF0320FFF76DFF00F0A7F826E04E +:1083B0000020FFF793FFC820FFF74EFF0120FFF7D3 +:1083C0008DFFC820FFF748FF0220FFF787FFC82076 +:1083D000FFF742FF0320FFF781FFC820FFF73CFFB4 +:1083E0000020FFF76FFF0120FFF76CFF0220FFF76F +:1083F00069FF0320FFF766FFC820FFF72DFFD7E7CF +:10840000024A0A400243024B1A60704780FFFF1F76 +:1084100008ED00E0064901EB9011096800F01F0328 +:1084200001229A401143024A02EB901211607047F8 +:1084300000100240002000212B4A126842F48032D2 +:10844000294B1A6000BF401C274A126802F4003111 +:1084500019B9A0F57F42FF3AF5D1234A126812F408 +:10846000003F01D100BFFEE71F4A52681E4B5A6011 +:108470001A4652685A601A46526842F480625A603C +:108480001A46526822F440325A601A46526842F440 +:1084900040325A601A465268144B1A40124B5A60C6 +:1084A0001A465268124B1A430F4B5A601A4612680A +:1084B00042F080721A6000BF0B4A126812F0007F0F +:1084C000FAD0094A526822F00302074B5A601A4652 +:1084D000526842F002025A6000BF034A526812F02A +:1084E000080FFAD07047000000100240FFFFC3F7EA +:1084F0000000280810B5FFF79DFF10BD10B5124809 +:1085000000684FF47A71B0FBF1F4601EB0F1807F27 +:1085100001D301200FE0601E4FF0E02148610F21E0 +:108520004FF0FF30FFF73AFE00204FF0E021886166 +:1085300007200861002008B100BFFEE70021481EA7 +:10854000FFF72CFE10BD0000040000206C85000821 +:10855000000000208800000038820008F485000830 +:108560008800002000200000488200080000000071 +:1085700000F36F0600100140001001400018014098 +:10858000001801400100000004000000010000008C +:10859000020000000E0611070002000004000000A7 +:1085A000000400000800000000080140000801402D +:1085B0000206020604060406060606060008014036 +:1085C00000100140000C01400100000000200000EC +:1085D000004000000206040603060000010000003F +:1085E0000020000000400000000201000D0E0628DF +:0485F000280000005F +:04000005080081313D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LCD.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LCD.bin new file mode 100644 index 0000000..dcba79b Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LCD.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LED.bin b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LED.bin new file mode 100644 index 0000000..8651d96 Binary files /dev/null and b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/bin/LED.bin differ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LCD.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LCD.hex new file mode 100644 index 0000000..0d5a2d2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LCD.hex @@ -0,0 +1,2888 @@ +:020000040800F2 +:10800000C020002065810008BB810008B381000802 +:10801000B7810008AD8100085D8200080000000003 +:10802000000000000000000000000000E7810008E0 +:10803000B181000800000000E5810008E981000826 +:108040007F8100087F8100087F8100087F81000810 +:108050007F8100087F8100087F8100087F81000800 +:108060007F8100087F8100087F8100087F810008F0 +:108070007F8100087F8100087F8100087F810008E0 +:108080007F8100087F8100087F8100087F810008D0 +:108090007F8100087F8100087F8100087F810008C0 +:1080A0007F8100087F8100087F8100087F810008B0 +:1080B0007F8100087F8100087F8100087F810008A0 +:1080C0007F8100087F8100087F8100087F81000890 +:1080D0007F8100087F8100087F8100087F81000880 +:1080E0007F8100087F8100087F8100087F81000870 +:1080F0007F8100087F8100087F8100080000000068 +:108100007F810008000000007F8100087F81000857 +:108110007F8100087F8100087F8100087F8100083F +:108120007F8100087F8100087F8100087F8100082F +:108130007F8100087F8100087F8100087F8100081F +:108140007F8100087F8100087F8100087F8100080F +:10815000DFF80CD000F018F800480047E58D000863 +:10816000C02000200648804706480047FEE7FEE79B +:10817000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7D7 +:10818000F181000851810008064C074D06E0E068C7 +:1081900040F0010394E8070098471034AC42F6D34E +:1081A000FFF7DAFF603301088033010800BFFEE704 +:1081B000704700BFFEE700BFFEE7704710B500281C +:1081C00007DA0A07140E054A00F00F031B1FD454E8 +:1081D00003E00A07130E024A135410BD18ED00E025 +:1081E00000E400E07047704710B500F0CDF910BD15 +:1081F00010B51548006840F00100134908600846B2 +:108200004068124908401049486008460068104913 +:1082100008400D4908600846006820F48020086086 +:10822000084640680B490840074948600020C8627A +:108230000846006808490840034908604FF47F0079 +:10824000886000F0DDFF10BD001002400C00FFE070 +:10825000FFFFF6FEFFFF00DFFFFFF6EA00BFFEE7CD +:1082600002E008C8121F08C1002AFAD170477047FF +:10827000002001E001C1121F002AFBD1704700005D +:10828000FEB50646B348DFF8D0C20090BCF800C087 +:108290000CF14F0C1FFA8CF3DFF8C0C2BCF800C021 +:1082A0000CF1450C1FFA8CF2DFF8ACC2BCF800C030 +:1082B0000CF1280C1FFA8CF1DFF8A0C2BCF800C04A +:1082C0000CF11E0C1FFA8CF000F005FDA148DFF840 +:1082D00088C20090BCF800C00CF14F0C1FFA8CF360 +:1082E000DFF87CC2BCF800C00CF1450C1FFA8CF220 +:1082F000DFF864C2BCF800C00CF1280C1FFA8CF146 +:10830000DFF85CC2BCF800C00CF11E0C1FFA8CF048 +:1083100000F0E1FC8F48DFF84CC20090BCF800C0D0 +:108320000CF14F0C1FFA8CF3DFF830C2BCF800C020 +:108330000CF1450C1FFA8CF2DFF828C2BCF800C023 +:108340000CF1280C1FFA8CF1DFF810C2BCF800C049 +:108350000CF11E0C1FFA8CF000F0BDFC7D48DFF81C +:1083600004C20090BCF800C00CF14F0C1FFA8CF353 +:10837000DFF8ECC1BCF800C00CF1450C1FFA8CF220 +:10838000DFF8E0C1BCF800C00CF1280C1FFA8CF13A +:10839000DFF8CCC1BCF800C00CF11E0C1FFA8CF049 +:1083A00000F099FC1827704D4FF6FF706F498880D8 +:1083B000002411E06D484068009015F8012BE100A1 +:1083C0001E3188B269490B68019349680291BE2148 +:1083D00000F0E2FA601C84B2BC42EBDB36B1012E45 +:1083E00029D0022E4CD0032E6FD16FE06048DFF809 +:1083F00068C10090BCF800C00CF14F0C1FFA8CF360 +:10840000DFF858C1BCF800C00CF1450C1FFA8CF223 +:10841000DFF844C1BCF800C00CF1280C1FFA8CF145 +:10842000DFF838C1BCF800C00CF11E0C1FFA8CF04C +:1084300000F051FC8BE04E48DFF81CC10090BCF806 +:1084400000C00CF14F0C1FFA8CF3DFF814C1BCF81C +:1084500000C00CF1450C1FFA8CF2DFF8FCC0BCF830 +:1084600000C00CF1280C1FFA8CF1DFF8F4C0BCF846 +:1084700000C00CF11E0C1FFA8CF000F02CFC66E022 +:108480003B48DFF8E0C00090BCF800C00CF14F0C96 +:108490001FFA8CF3DFF8C4C0BCF800C00CF1450C27 +:1084A0001FFA8CF2DFF8BCC0BCF800C00CF1280C3D +:1084B0001FFA8CF1DFF8A4C0BCF800C00CF11E0C50 +:1084C0001FFA8CF000F007FC41E024E02848DFF8B8 +:1084D00094C00090BCF800C00CF14F0C1FFA8CF354 +:1084E000DFF87CC0BCF800C00CF1450C1FFA8CF220 +:1084F000DFF870C0BCF800C00CF1280C1FFA8CF13A +:10850000DFF85CC0BCF800C00CF11E0C1FFA8CF048 +:1085100000F0E1FB1BE0144D4FF4784013498880D4 +:10852000002411E011484068009015F8012BE1008B +:108530001E3188B20D490B68019349680291BE2132 +:1085400000F02AFA601C84B2BC42EBDB00BF00BF23 +:10855000FEBD000018BA0008060000200000002040 +:1085600002000020080000200C000020280000204D +:1085700090AD00080349086000BF0249096800295E +:10858000FBD17047300000200448006820B1034848 +:108590000068401E0149086070470000300000205C +:1085A00000B597B04FF4A16000F070FD40F2056097 +:1085B00000F06CFD40F2066000F068FD4CF20373C1 +:1085C00003221821214800F095F94FF68073032209 +:1085D00018211F4800F08EF90423032218211C489B +:1085E00000F088F9302303221821184800F082F99E +:1085F000802303221821154800F07CF90020019007 +:10860000029003900490052005900020069002201F +:1086100007900020089009900A900B900C90012080 +:108620000D9000200E900F9010901190102012903D +:1086300000201390149001A81590169008A800F03F +:1086400015F8002000F006F817B000BD0014014036 +:1086500000180140C100A1F1C041096841F00102C8 +:10866000C100A1F1C0410A607047000070B500214F +:10867000002200230468E400A4F1C04421683D4CBA +:108680002140D0E90B4544EA4504856A2C43456AFC +:1086900044EA0524056A2C43C56944EA85248569B2 +:1086A0002C43456944EA0534056944EA4534856844 +:1086B00044EA8534C56844EAC53445682C432143FF +:1086C000446B247E641E04F00F04456B6D696D1EBF +:1086D000F02606EA05152C43456B2D696D1E4FF4F7 +:1086E0007F4606EA05252C43456BAD896D1E4FF488 +:1086F000702606EA05452C43456BAD682C43456B57 +:108700006D682C43456B2D6844EA0502C46A082C49 +:1087100001D141F040018468012C18D1846B247E82 +:10872000641E04F00F04856B6D696D1EF02606EA69 +:1087300005152C43856B2D696D1E4FF47F4606EAA7 +:1087400005252C43856B2D6844EA050301E06FF095 +:1087500070430468E400A4F1C04421600468E400AC +:10876000A4F1C04462600468E400A4F1C044C4F809 +:10877000043170BD8100F7FF0146002231F812007C +:108780004B88984200DA012231F812008B88984217 +:1087900000DA022231F81200CB88984200DA032274 +:1087A00031F8120000B90422D0B2704710B5044667 +:1087B0000B4931F8140000F069FC0A4951F82430E3 +:1087C000094951F824000322102100F093F80548CC +:1087D00050F82400044951F82410486110BD0000ED +:1087E000780000204800002038000020034951F89C +:1087F0002010034A52F820205161704748000020A1 +:1088000038000020034951F82010034A52F8202074 +:108810001161704748000020380000202F4B1B8852 +:108820004633984212DA2D4B1B881E3398420DDDD9 +:108830002B4B1B881E33994208DD294B1B8846337E +:10884000994203DA13885B1C138046E0254B1B8892 +:108850004633984212DA234B1B881E3398420DDDB3 +:108860001F4B1B881E33994208DD1D4B1B88463366 +:10887000994203DA53885B1C53802EE0174B1B8808 +:108880004633984212DA154B1B881E3398420DDD91 +:10889000154B1B881E33994208DD134B1B8846334A +:1088A000994203DA93885B1C938016E00D4B1B887A +:1088B0004633984211DA0B4B1B881E3398420CDD6D +:1088C000094B1B881E33994207DD074B1B88463333 +:1088D000994202DAD3885B1CD380704700000020E5 +:1088E00006000020020000200800002041617047BF +:1088F00001617047F0B5044616460025002201F0DC +:108900000F0511F0100F00D03543002018E00127AB +:1089100087401F4212D022684FEA800C0F2707FAC7 +:108920000CF7BA43870005FA07F73A43282901D123 +:10893000636102E0482900D123612260471CB8B27C +:108940000828E4D308201CE0012787401F4216D0E6 +:108950006268A0F108074FEA870C0F2707FA0CF7A7 +:10896000BA43A0F10807BF0005FA07F73A432829E0 +:1089700001D1636102E0482900D123616260471C94 +:10898000B8B21028E0D3F0BD02469068084201D08A +:10899000012070470020FCE70FB42DE9F0470646A0 +:1089A0000F46904600250024A146A246BDF82C00A3 +:1089B00000284DD100BF48E0A8F1200005EB0010D1 +:1089C0004D4911F80090BDF82E00F0B9002419E0CF +:1089D000C4F1070049FA00F010F0010F08D0BDF80B +:1089E00030203B1999B2731B98B200F09EF907E052 +:1089F000BDF832203B1999B2731B98B200F095F97B +:108A0000601C84B2082CE3DB1DE0002419E0C4F1F3 +:108A1000070049FA00F010F0010F08D0BDF830202F +:108A20007B1999B2331998B200F07FF907E0BDF8CD +:108A300032207B1999B2331998B200F076F9601C94 +:108A400084B2082CE3DB681C85B2102DB4DB4EE049 +:108A5000BDF82C0001284AD1002546E0A8F12000ED +:108A600000EB400005EBC000244931F810A0BDF830 +:108A70002E00E0B9002417E04AFA04F010F0010FCC +:108A800008D0BDF830203B1999B2731B98B200F0A2 +:108A90004CF907E0BDF832203B1999B2731B98B22C +:108AA00000F043F9601C84B2102CE5DB1BE00024CD +:108AB00017E04AFA04F010F0010F08D0BDF830209A +:108AC0007B1999B2331998B200F02FF907E0BDF87D +:108AD00032207B1999B2331998B200F026F9601C44 +:108AE00084B2102CE5DB681C85B2182DB6DBBDE81E +:108AF000F0075DF814FB0000B8950008B89B00086B +:108B000030B5044600250021084600F00CF800F0BE +:108B10001AF800BF03E04FF0C24004806D1CB5F5A9 +:108B2000963FF8D330BD10B503460C4619464E208B +:108B300000F050F921464F2000F04CF910BD4FF0E5 +:108B4000C2410880704722204FF0C0410880704722 +:108B500000B50121002000F03DF94AF6A4010320F0 +:108B600000F038F900210C2000F034F940F60C0137 +:108B70000D2000F02FF94FF42C510E2000F02AF9AF +:108B8000B0211E2000F026F942F63F31012000F00E +:108B900021F94FF4C061022000F01CF900211020DF +:108BA00000F018F946F27001112000F013F90021CD +:108BB000052000F00FF90021062000F00BF94EF619 +:108BC0001C71162000F006F90321172000F002F9AD +:108BD00040F23321072000F0FDF800210B2000F0C7 +:108BE000F9F800210F2000F0F5F80021412000F0F5 +:108BF000F1F80021422000F0EDF80021482000F0BB +:108C0000E9F840F23F11492000F0E4F800214A2041 +:108C100000F0E0F800214B2000F0DCF84FF46F4149 +:108C2000442000F0D7F80021452000F0D3F840F2AE +:108C30003F11462000F0CEF840F20771302000F0DE +:108C4000C9F84FF40171312000F0C4F84FF40171FC +:108C5000322000F0BFF840F20251332000F0BAF8A1 +:108C600040F20751342000F0B5F84FF4017135207F +:108C700000F0B0F84FF40171362000F0ABF840F28C +:108C80000251372000F0A6F840F202313A2000F0FD +:108C9000A1F840F202313B2000F09CF80021232093 +:108CA00000F098F80021242000F094F84FF40041DF +:108CB000252000F08FF800214E2000F08BF80021D5 +:108CC0004F2000F087F84CF2503301E0581E83B279 +:108CD000002BFBDC00BD2DE9F84F04460E4617467D +:108CE0009946DDF828B02546B046381B401CA9EB54 +:108CF0000601491C484300904FF0000A10E03BF881 +:108D0000022B4146284600F010F8681C85B2BD428F +:108D100004DD08F101001FFA80F825460AF1010A76 +:108D200000988245EBD3BDE8F88F70B506460C4637 +:108D30001546F02E02DCB4F5A07F00DD70BD2146A3 +:108D40003046FFF7F0FEFFF7FEFE2846FFF7F7FE7E +:108D500000BFF3E72DE9F04706460F4690469946D7 +:108D6000DDF820A034463D4600BF06E052462946C5 +:108D70002046FFF7DAFF601C84B24445F6DB3D462F +:108D800006E0524629462046FFF7CFFF681C85B211 +:108D90004D45F6DB444606E0524629462046FFF79D +:108DA000C4FF601E84B2B442F6DC4D4606E0524673 +:108DB00029462046FFF7B9FF681E85B2BD42F6DCA2 +:108DC000BDE8F08701464FF0C04211804FF0C2422B +:108DD000108870474FF0C04210804FF0C24211809F +:108DE000704700008AB00020089009900025974B3A +:108DF000D3E90012D3E90203CDE90603CDE9041259 +:108E000000264FF40041080300F036F90020FFF778 +:108E1000CDFC0120FFF7CAFC0220FFF7C7FC0320AE +:108E2000FFF7C4FC00F0F0F9FFF7BAFB00F0E2FA3C +:108E30003220FFF79FFB0020FFF7C4FF8449088022 +:108E4000FFF786FE4FF6FF70FFF75AFE81484FF49A +:108E50008F73C722C82100902820FFF73CFF1F20F6 +:108E60004FF49B73E6220A2100900846FFF772FF39 +:108E70001F20794988804FF6FF70C8800120488004 +:108E800000200880002461E07348406804AB009033 +:108E90001A5D724B1B88143399B2714B1B882333B4 +:108EA000082707FB043398B26B4B1F6802975B6877 +:108EB00003933B46FFF770FD6748406805AB0090A1 +:108EC0001A5D664B1B88143399B2664B1B8823339B +:108ED000082707FB043398B25F4B1F6802975B6853 +:108EE00003933B46FFF758FD5B48406806AB009094 +:108EF0001A5D5D4B1B88143399B2594B1B88233381 +:108F0000082707FB043398B2534B1F6802975B682E +:108F100003933B46FFF740FD4F48406807AB009086 +:108F20001A5D514B1B88143399B24E4B1B88233367 +:108F3000082707FB043398B2474B1F6802975B680A +:108F400003933B46FFF728FD601C84B2042C9BDB97 +:108F50004648424F00903F884F37BBB2404F3F8852 +:108F60004537BAB23D4F3F882837B9B23C4F3F88AA +:108F70001E37B8B2FFF7AFFE3C48384F00903F882D +:108F80004F37BBB2374F3F884537BAB2334F3F8870 +:108F90002837B9B2334F3F881E37B8B2FFF79BFE70 +:108FA0003248314F00903F884F37BBB22C4F3F883B +:108FB0004537BAB22C4F3F882837B9B2284F3F887F +:108FC0001E37B8B2FFF787FE2848274F00903F882A +:108FD0004F37BBB2234F3F884537BAB2224F3F8845 +:108FE0002837B9B21F4F3F881E37B8B2FFF773FE5C +:108FF0002BE000F051FA012811D1681CC5B21C48C1 +:10900000008800F09BF9C0F5A07087B2194800886D +:1090100000F07FF9804608AA3946FFF7FFFB142DC0 +:1090200013D108A8FFF7A8FB0646304600F087FAE0 +:109030003046FFF725F90020ADF82600ADF82400F2 +:10904000ADF82200ADF820000025D2E7A895000871 +:1090500026000020A0C600082800002006000020EE +:1090600000000020020000200800002018BA0008BC +:10907000B8000020B6000020024A0A400243024B1A +:109080001A60704780FFFF1F08ED00E0064901EB02 +:109090009011096800F01F0301229A401143024A0F +:1090A00002EB9012116070470010024010B50446A8 +:1090B00024B120210448FFF71BFC03E020210248D3 +:1090C000FFF714FC10BD00000008014010B5044675 +:1090D00024B110210448FFF70BFC03E010210248E3 +:1090E000FFF704FC10BD00000018014010B540213E +:1090F0000148FFF749FC10BD0008014010B50446C7 +:1091000024B180210448FFF7F3FB03E080210248EB +:10911000FFF7ECFB10BD000000080140002000211B +:10912000324A126842F48032304B1A6000BF401C51 +:109130002E4A126802F4003119B9A0F57F42FF3AB5 +:10914000F5D12A4A126812F4003F01D100BFFEE7B0 +:10915000264A5268254B5A601A4652685A601A4687 +:10916000526842F480625A601A465268204B1A4094 +:109170001E4B5A601A4652681E4B1A431B4B5A60CC +:109180001A46D26A1C4B1A40184BDA621A46D26A47 +:109190001A4B1A43154BDA621A46126842F0806283 +:1091A0001A6000BF114A126812F0006FFAD00F4A1D +:1091B000126842F080720D4B1A6000BF0B4A1268B1 +:1091C00012F0007FFAD0094A526822F00302074BDE +:1091D0005A601A46526842F002025A6000BF034ABF +:1091E000526812F0080FFAD07047000000100240D9 +:1091F000FFFFC3DF0000292000F0FEFF4906010049 +:1092000010B5FFF78BFF10BD10B5124800684FF482 +:109210007A71B0FBF1F4601EB0F1807F01D30120C0 +:109220000FE0601E4FF0E02148610F214FF0FF304A +:10923000FEF7C4FF00204FF0E0218861072008619D +:10924000002008B100BFFEE70021481EFEF7B6FF70 +:1092500010BD00003400002010B500F0FBF808B18C +:10926000002010BD00F03CF9002000F04AF9D220A7 +:1092700000F047F900F0F6F8F3E72DE9F04704466F +:109280000D4600260027B046B146D22000F06CF80B +:109290000646922000F068F80746D22000F064F8F5 +:1092A0008046922000F060F88146B6EB080101D4B8 +:1092B0000A4600E04A42062A07DCB7EB090001D45F +:1092C000024600E04242062A02DD0020BDE8F087A7 +:1092D00006EB080000EBD071C1F34F01218007EBD2 +:1092E000090000EBD071C1F34F0129800120EDE7A7 +:1092F00010B500F0AFF808B1002010BD00F0F0F894 +:10930000002000F0FEF8922000F0FBF800F0AAF830 +:10931000F3E7034600BFA3F5967202EB0210C0EB21 +:10932000022240F6DE50B2FBF0F081B2002901DDEE +:10933000F02901DD002070470846FCE7034600BF26 +:10934000A3F1DC02C2EB821000EB022240F62E6099 +:10935000B2FBF0F081B2002902DDB1F5A07F01DDA2 +:10936000002070470846FCE72DE9FE43064600242E +:1093700000250027A04600BF0CE0D22E04D1FFF745 +:109380006BFF2DF8140003E0FFF7B2FF2DF8140077 +:10939000601C84B2052CF0DB002416E0601C85B252 +:1093A0000FE03DF814003DF81510884207DD3DF848 +:1093B00014803DF815002DF814002DF81580681C58 +:1093C00085B2052DEDDB601C84B2042CE6DB0027A2 +:1093D000012405E03DF81400384487B2601C84B2D3 +:1093E000042CF7DB032097FBF0F01FFA80F84046CF +:1093F000BDE8FE8310B540F20260FFF747FE40F281 +:109400000660FFF743FE2023032210210F48FFF7D9 +:1094100071FA8023032210210C48FFF76BFA4023D6 +:10942000032204210948FFF765FA10230322194695 +:109430000748FFF75FFA2023032204210448FFF7BF +:1094400059FA10210248FFF753FA10BD00080140F5 +:109450000018014010B520210148FFF795FA10BD12 +:109460000018014070B50024002510E04FF6FF7091 +:1094700000EA44040120FFF719FE0020FFF716FE62 +:10948000FFF734FE08B1601C84B2681CC5B20C2D15 +:10949000ECDB204670BD000010B50024FFF7DAFFBA +:1094A00090B901E0601CC4B20B490C48FFF7E5FE1F +:1094B000012801D0142CF5DB142C0BDB002007490C +:1094C00008800549088010BD002004490880024931 +:1094D0000880F8E70120F6E7B8000020B600002079 +:1094E00010B50020FFF7E2FD0120FFF7EFFD01209E +:1094F000FFF704FE0120FFF7D9FD0020FFF7E6FD8E +:1095000010BD70B506460020FFF7D0FD002413E023 +:10951000C4F1070046FA00F000F001052846FFF705 +:10952000EDFD0020FFF7C2FD0120FFF7BFFD002089 +:10953000FFF7BCFD601CC4B2082CE9DB70BD10B5A0 +:1095400004460020FFF752F90120FFF74FF90220EF +:10955000FFF74CF90320FFF749F934B1012C08D08B +:10956000022C0AD0032C10D10BE00020FFF74AF99F +:1095700018E00120FFF746F914E00220FFF742F956 +:1095800010E00320FFF73EF90CE00020FFF73AF966 +:109590000120FFF737F90220FFF734F90320FFF726 +:1095A00031F900BF00BF10BD4C4544324C45443337 +:1095B0004C4544344C454435000000000000000098 +:1095C00000000000000000000000183C3C3C18189F +:1095D00018001818000000000066666624000000ED +:1095E00000000000000000000000006C6CFE6C6CCD +:1095F0006CFE6C6C0000000018187CC6C2C07C06B3 +:1096000086C67C181800000000000000C2C60C18B6 +:109610003060C686000000000000386C6C3876DCD4 +:10962000CCCCCC7600000000003030306000000070 +:10963000000000000000000000000C183030303046 +:109640003030180C00000000000030180C0C0C0C1E +:109650000C0C1830000000000000000000663CFF09 +:109660003C66000000000000000000000018187EAA +:1096700018180000000000000000000000000000BA +:10968000001818183000000000000000000000FE64 +:1096900000000000000000000000000000000000CA +:1096A00000001818000000000000000002060C185E +:1096B0003060C0800000000000007CC6C6CED6D658 +:1096C000E6C6C67C0000000000001838781818189C +:1096D0001818187E0000000000007CC6060C183028 +:1096E00060C0C6FE0000000000007CC606063C0606 +:1096F0000606C67C0000000000000C1C3C6CCCFE82 +:109700000C0C0C1E000000000000FEC0C0C0FC0ECF +:109710000606C67C0000000000003860C0C0FCC621 +:10972000C6C6C67C000000000000FEC606060C1877 +:10973000303030300000000000007CC6C6C67CC659 +:10974000C6C6C67C0000000000007CC6C6C67E06F9 +:1097500006060C7800000000000000001818000049 +:109760000018180000000000000000001818000099 +:109770000018183000000000000000060C183060CF +:1097800030180C0600000000000000000000FE0081 +:1097900000FE0000000000000000006030180C0611 +:1097A0000C1830600000000000007CC6C60C1818C1 +:1097B00018001818000000000000007CC6C6DEDE9D +:1097C000DEDCC07C00000000000010386CC6C6FE65 +:1097D000C6C6C6C6000000000000FC6666667C6661 +:1097E000666666FC0000000000003C66C2C0C0C0A7 +:1097F000C0C2663C000000000000F86C6666666649 +:1098000066666CF8000000000000FE66626878681A +:10981000606266FE000000000000FE666268786814 +:10982000606060F00000000000003C66C2C0C0DE66 +:10983000C6C6663A000000000000C6C6C6C6FEC620 +:10984000C6C6C6C60000000000003C18181818184C +:109850001818183C0000000000001E0C0C0C0C0C2A +:10986000CCCCCC78000000000000E6666C6C787808 +:109870006C6666E6000000000000F06060606060FA +:10988000606266FE000000000000C6EEFEFED6C666 +:10989000C6C6C6C6000000000000C6E6F6FEDECE64 +:1098A000C6C6C6C6000000000000386CC6C6C6C6E4 +:1098B000C6C66C38000000000000FC6666667C606E +:1098C000606060F00000000000007CC6C6C6C6C62E +:1098D000C6D6DE7C0C0E00000000FC6666667C6C62 +:1098E000666666E60000000000007CC6C660380CB4 +:1098F00006C6C67C0000000000007E7E5A181818BC +:109900001818183C000000000000C6C6C6C6C6C62F +:10991000C6C6C67C000000000000C6C6C6C6C6C6D5 +:10992000C66C3810000000000000C6C6C6C6C6D609 +:10993000D6FE6C6C000000000000C6C66C6C3838A7 +:109940006C6CC6C6000000000000666666663C18C7 +:109950001818183C000000000000FEC6860C1830E5 +:1099600060C2C6FE0000000000003C3030303030E5 +:109970003030303C0000000000000080C0E0703853 +:109980001C0E06020000000000003C0C0C0C0C0C2D +:109990000C0C0C3C0000000010386CC600000000ED +:1099A00000000000000000000000000000000000B7 +:1099B0000000000000FF0000303018000000000030 +:1099C00000000000000000000000000000780C7C97 +:1099D000CCCCCC76000000000000E06060786C66C3 +:1099E000666666DC0000000000000000007CC6C067 +:1099F000C0C0C67C0000000000001C0C0C3C6CCCFD +:109A0000CCCCCC760000000000000000007CC6FE3C +:109A1000C0C0C67C000000000000386C6460F060CC +:109A2000606060F000000000000000000076CCCC18 +:109A3000CCCCCC7C0CCC78000000E060606C76660E +:109A4000666666E600000000000018180038181866 +:109A50001818183C0000000000000606000E06065C +:109A60000606060666663C000000E06060666C78EC +:109A7000786C66E600000000000038181818181806 +:109A80001818183C000000000000000000ECFED692 +:109A9000D6D6D6D6000000000000000000DC6666C6 +:109AA000666666660000000000000000007CC6C616 +:109AB000C6C6C67C000000000000000000DC666630 +:109AC0006666667C6060F000000000000076CCCC2A +:109AD000CCCCCC7C0C0C1E000000000000DC7662BC +:109AE000606060F00000000000000000007CC660C4 +:109AF000380CC67C000000000000103030FC303014 +:109B00003030361C000000000000000000CCCCCC3F +:109B1000CCCCCC7600000000000000000066666639 +:109B200066663C18000000000000000000C6C6C6C3 +:109B3000D6D6FE6C000000000000000000C66C38A5 +:109B400038386CC6000000000000000000C6C6C621 +:109B5000C6C6C67E060CF8000000000000FECC1849 +:109B60003060C6FE0000000000000E1818187018C3 +:109B70001818180E00000000000018181818001817 +:109B800018181818000000000000701818180E1897 +:109B90001818187000000000000076DC00000000BB +:109BA00000000000000000000000000010386CC63B +:109BB000C6C6FE000000000000000000000000001B +:109BC0000000000000000000000000000000000095 +:109BD0000000000000000000000000000000000085 +:109BE00000000000000000000000800180018001F2 +:109BF000800180018001800180018001800180015D +:109C00008001800100000000800180010000000050 +:109C1000000000000000000000000000CC00CC00AC +:109C2000CC00CC00CC00CC00000000000000000004 +:109C30000000000000000000000000000000000024 +:109C40000000000000000000000000000000000014 +:109C500000000000600C600C600C30063006FE1F37 +:109C6000FE1F300638071803FE1FFE1F18031803D7 +:109C70008C018C018C01000000008000E003F80FD3 +:109C80009C0E8C1C8C188C009800F801E007800E4C +:109C9000801C8C188C189C18B80CF00FE003800006 +:109CA00080000000000000000000000000000E180E +:109CB0001B0C110C11061106110311039B018E01DF +:109CC000C038C06C60446044304430441844186C60 +:109CD0000C380000000000000000E001F00338072D +:109CE000180618063003F001F000F8009C310E331E +:109CF000061E061C061C063FFC73F0210000000037 +:109D00000000000000000000000000000C000C003B +:109D10000C000C000C000C00000000000000000013 +:109D20000000000000000000000000000000000033 +:109D3000000000000000000000000002000380019D +:109D4000C000C00060006000300030003000300013 +:109D5000300030003000300060006000C000C00003 +:109D60008001000300020000000020006000C0002D +:109D700080018001000300030006000600060006C3 +:109D800000060006000600060003000380018001B3 +:109D9000C000600020000000000000000000000083 +:109DA00000000000C000C000D806F807E001300342 +:109DB0003807000000000000000000000000000064 +:109DC0000000000000000000000000000000000093 +:109DD0000000000080018001800180018001FC3FC3 +:109DE000FC3F8001800180018001800100000000B3 +:109DF0000000000000000000000000000000000063 +:109E00000000000000000000000000000000000052 +:109E1000000000000000000000008001800100013F +:109E200000018000000000000000000000000000B1 +:109E30000000000000000000000000000000000022 +:109E4000E007E00700000000000000000000000044 +:109E50000000000000000000000000000000000002 +:109E600000000000000000000000000000000000F2 +:109E700000000000000000000000C000C000000062 +:109E800000000000000000000000000C000C0006B4 +:109E90000006000600030003000380038001800128 +:109EA0008001C000C000C000600060000000000031 +:109EB00000000000000000000000E003F007380E82 +:109EC000180C0C180C180C180C180C180C180C1872 +:109ED0000C180C18180C380EF007E00300000000F6 +:109EE0000000000000000000000000018001C0012F +:109EF000F0019801880180018001800180018001CA +:109F0000800180018001800180018001000000004B +:109F100000000000000000000000E003F80F180C33 +:109F20000C180C1800180018000C00060003800123 +:109F3000C000600030001800FC1FFC1F0000000083 +:109F400000000000000000000000E001F807180E0B +:109F50000C0C0C0C000C0006C003C007000C001811 +:109F600000180C180C18180CF807E003000000008B +:109F700000000000000000000000000C000E000FB8 +:109F8000000F800DC00C600C600C300C180C0C0C19 +:109F9000FC3FFC3F000C000C000C000C000000001B +:109FA00000000000000000000000F80FF80F18008B +:109FB00018000C00EC03FC071C0E001C0018001815 +:109FC00000180C181C0C180EF807E0030000000025 +:109FD00000000000000000000000C007F00F381C67 +:109FE000181818000C00CC03EC0F3C0E1C1C0C18AD +:109FF0000C180C18181C380EF007E00300000000C5 +:10A0000000000000000000000000FC1FFC1F000C0E +:10A0100000060006000380038001C001C000E000CC +:10A020006000600070003000300030000000000070 +:10A0300000000000000000000000E003F007380E00 +:10A04000180C180C180C3806F007F007180C0C1830 +:10A050000C180C180C18380CF80FE0030000000066 +:10A0600000000000000000000000E003F007380ED0 +:10A070001C0C0C180C180C181C1C381EF81BE019B2 +:10A080000018000C000C1C0EF807F0010000000086 +:10A0900000000000000000000000000000000000C0 +:10A0A00000000000800180010000000000000000AE +:10A0B000000000000000000080018001000000009E +:10A0C0000000000000000000000000000000000090 +:10A0D000000000008001800100000000000000007E +:10A0E000000000000000000080018001000100016C +:10A0F00080000000000000000000000000000000E0 +:10A1000000000000000000000010001C800FE003B1 +:10A11000F8001800F800E003800F001C0010000099 +:10A12000000000000000000000000000000000002F +:10A130000000000000000000F81F00000000000008 +:10A14000F81F0000000000000000000000000000F8 +:10A1500000000000000000000000000000000000FF +:10A16000000000000000000008003800F001C007F7 +:10A17000001F0018001FC007F00138000800000091 +:10A1800000000000000000000000E003F80F180CC1 +:10A190000C180C180018000C000600038001C00009 +:10A1A000C000C00000000000C000C00000000000AF +:10A1B000000000000000000000000000E007181888 +:10A1C0000420C229224A11440944094409440922AD +:10A1D0001113E20C024004201818E00700000000F0 +:10A1E0000000000000000000000080038003C006A3 +:10A1F000C006C006600C600C301830183018F83FEC +:10A20000F83F1C700C600C6006C006C00000000027 +:10A2100000000000000000000000FC03FC0F0C0C1C +:10A220000C180C180C180C0CFC07FC0F0C180C303C +:10A230000C300C300C300C18FC1FFC070000000028 +:10A2400000000000000000000000C007F01F3838C8 +:10A250001C300C70066006000600060006000600B2 +:10A26000060006600C701C30F01FE00700000000C4 +:10A2700000000000000000000000FE03FE0F060EBC +:10A28000061806180630063006300630063006304E +:10A29000063006180618060EFE0FFE03000000002A +:10A2A00000000000000000000000FC3FFC3F0C002C +:10A2B0000C000C000C000C00FC1FFC1F0C000C0020 +:10A2C0000C000C000C000C00FC3FFC3F00000000E8 +:10A2D00000000000000000000000F83FF83F1800F8 +:10A2E0001800180018001800F81FF81F18001800B0 +:10A2F00018001800180018001800180000000000CE +:10A3000000000000000000000000E00FF83F3C7873 +:10A310000E6006E007C00300030003FE03FE03C057 +:10A3200007C006C00EC03CF0F83FE00F0000000080 +:10A33000000000000000000000000C300C300C3069 +:10A340000C300C300C300C30FC3FFC3F0C300C302F +:10A350000C300C300C300C300C300C300000000095 +:10A36000000000000000000000008001800180016A +:10A3700080018001800180018001800180018001D5 +:10A3800080018001800180018001800100000000C7 +:10A3900000000000000000000000000600060006AB +:10A3A000000600060006000600060006000600067D +:10A3B0000006180618063807F003E0010000000048 +:10A3C0000000000000000000000006300618060C27 +:10A3D000060606038601C60066007600DE008E01D2 +:10A3E00006030606060C061806300660000000008C +:10A3F0000000000000000000000018001800180015 +:10A40000180018001800180018001800180018008C +:10A410001800180018001800F81FF81F00000000AE +:10A42000000000000000000000000EE01EF01EF022 +:10A430001EF036D836D836D836D866CC66CC66CC40 +:10A44000C6C6C6C6C6C6C6C686C386C3000000004A +:10A45000000000000000000000000C301C303C3008 +:10A460003C306C306C30CC30CC308C310C330C3315 +:10A470000C360C360C3C0C3C0C380C300000000048 +:10A4800000000000000000000000E007F81F1C387A +:10A490000E70066003C003C003C003C003C003C046 +:10A4A00003C006600E701C38F81FE00700000000B3 +:10A4B00000000000000000000000FC0FFC1F0C3832 +:10A4C0000C300C300C300C300C18FC1FFC070C004E +:10A4D0000C000C000C000C000C000C000000000034 +:10A4E00000000000000000000000E007F81F1C381A +:10A4F0000E70066003E003C003C003C003C003C0C6 +:10A5000007E006630E3F1C3CF83FE0F700C0000088 +:10A5100000000000000000000000FE0FFE1F0638D3 +:10A520000630063006300638FE1FFE070603060614 +:10A53000060C0618061806300630066000000000FB +:10A5400000000000000000000000E003F80F1C0CF9 +:10A550000C180C180C001C00F803E00F001E00384B +:10A56000063006300E301C1CF80FE007000000001B +:10A5700000000000000000000000FE7FFE7F800160 +:10A5800080018001800180018001800180018001C3 +:10A5900080018001800180018001800100000000B5 +:10A5A000000000000000000000000C300C300C30F7 +:10A5B0000C300C300C300C300C300C300C300C30BB +:10A5C0000C300C300C301818F81FE00700000000A9 +:10A5D00000000000000000000000036006300630AC +:10A5E00006300C180C180C18180C180C380E300605 +:10A5F0003006700760036003C001C0010000000066 +:10A60000000000000000000000000360C361C3619F +:10A61000C3616633663366336633663366336C1BF9 +:10A620006C1B6C1B2C1A3C1E380E380E00000000F0 +:10A63000000000000000000000000FE00C70183067 +:10A640003018700C600EC00780038003C003E00662 +:10A65000700C301C18180C300E6007E00000000071 +:10A660000000000000000000000003C006600C3085 +:10A670001C383818300C6006E007C00380018001E8 +:10A6800080018001800180018001800100000000C4 +:10A6900000000000000000000000FC7FFC7F006064 +:10A6A00000300018000C000600038001C0006000AC +:10A6B000300018000C000600FE7FFE7F0000000046 +:10A6C00000000000000000000000E003E003600064 +:10A6D000600060006000600060006000600060007A +:10A6E000600060006000600060006000600060006A +:10A6F0006000E003E0030000000030003000600074 +:10A7000060006000C000C000C000C0018001800186 +:10A7100080010003000300030006000600000000A3 +:10A7200000000000000000000000E003E003000360 +:10A730000003000300030003000300030003000301 +:10A7400000030003000300030003000300030003F1 +:10A750000003E003E003000000000000C001C001AE +:10A7600060036003600330063006180C180C00000C +:10A7700000000000000000000000000000000000D9 +:10A7800000000000000000000000000000000000C9 +:10A7900000000000000000000000000000000000B9 +:10A7A00000000000000000000000FFFFFFFF0000AD +:10A7B000000000000000000000000C000C000C0075 +:10A7C0000C000C000C000000000000000000000065 +:10A7D0000000000000000000000000000000000079 +:10A7E0000000000000000000000000000000000069 +:10A7F00000000000F003F8071C0C0C0C000FF00F19 +:10A80000F80C0C0C0C0C1C0FF80FF01800000000DA +:10A8100000000000000000000000180018001800F0 +:10A8200018001800D803F80F380C18181818181842 +:10A83000181818181818380CF80FD8030000000062 +:10A840000000000000000000000000000000000008 +:10A8500000000000C003F007300E180C18001800AC +:10A8600018001800180C300EF007C003000000009C +:10A870000000000000000000000000180018001890 +:10A8800000180018C01BF01F301C181818181818D2 +:10A89000181818181818301CF01FC01B00000000F2 +:10A8A00000000000000000000000000000000000A8 +:10A8B00000000000C003F00F300C1818F81FF81F3C +:10A8C000180018003818301CF00FC00700000000F6 +:10A8D00000000000000000000000800FC00FC0005A +:10A8E000C000C000F007F007C000C000C000C000FA +:10A8F000C000C000C000C000C000C00000000000D8 +:10A900000000000000000000000000000000000047 +:10A9100000000000E00DF80F180E0C0C0C0C0C0CD5 +:10A920000C0C0C0C0C0C180EF80FE00D000C0C0CA1 +:10A930001C06F807F00100000000180018001800BD +:10A9400018001800D807F80F381C1818181818180D +:10A9500018181818181818181818181800000000D7 +:10A9600000000000000000000000C000C000000067 +:10A9700000000000C000C000C000C000C000C00057 +:10A98000C000C000C000C000C000C0000000000047 +:10A9900000000000000000000000C000C000000037 +:10A9A00000000000C000C000C000C000C000C00027 +:10A9B000C000C000C000C000C000C000C000C00097 +:10A9C000C000F8007800000000000C000C000C0033 +:10A9D0000C000C000C0C0C060C038C01CC006C0061 +:10A9E000FC009C018C030C030C060C0C0000000006 +:10A9F00000000000000000000000C000C000C00017 +:10AA0000C000C000C000C000C000C000C000C00046 +:10AA1000C000C000C000C000C000C00000000000B6 +:10AA20000000000000000000000000000000000026 +:10AA3000000000007C3CFF7EC7E383C183C183C16B +:10AA400083C183C183C183C183C183C1000000006E +:10AA500000000000000000000000000000000000F6 +:10AA6000000000009807F80F381C1818181818185C +:10AA700018181818181818181818181800000000B6 +:10AA800000000000000000000000000000000000C6 +:10AA900000000000C003F00F300C18181818181828 +:10AAA000181818181818300CF00FC0030000000018 +:10AAB0000000000000000000000000000000000096 +:10AAC00000000000D803F80F380C181818181818D0 +:10AAD000181818181818380CF80FD8031800180090 +:10AAE000180018001800000000000000000000001E +:10AAF00000000000C01BF01F301C18181818181890 +:10AB0000181818181818301CF01FC01B001800184F +:10AB100000180018001800000000000000000000ED +:10AB200000000000B007F00370003000300030007B +:10AB300030003000300030003000300000000000F5 +:10AB40000000000000000000000000000000000005 +:10AB500000000000E003F003380E180C3800F0038A +:10AB6000C007000C180C380EF007E00300000000CE +:10AB70000000000000000000000000008000C00095 +:10AB8000C000C000F007F007C000C000C000C00057 +:10AB9000C000C000C000C000C00780070000000067 +:10ABA00000000000000000000000000000000000A5 +:10ABB0000000000018181818181818181818181875 +:10ABC000181818181818381CF01FE0190000000099 +:10ABD0000000000000000000000000000000000075 +:10ABE000000000000C18180C180C180C3006300669 +:10ABF0003006600360036003C001C0010000000074 +:10AC00000000000000000000000000000000000044 +:10AC100000000000C141C141C361636363636363BA +:10AC20003636363636361C1C1C1C1C1C0000000038 +:10AC30000000000000000000000000000000000014 +:10AC4000000000001C38381C300C600660036003F4 +:10AC5000600360036006300C381C1C3800000000E4 +:10AC600000000000000000000000000000000000E4 +:10AC7000000000001830301830187018600C600C9C +:10AC8000E00CC006C00680038003800380018001C1 +:10AC9000C001F00070000000000000000000000093 +:10ACA00000000000FC1FFC1F000C000600038001D8 +:10ACB000C000600030001800FC1FFC1F00000000F6 +:10ACC0000000000000000000000000038001C00040 +:10ACD000C000C000C000C000C000600060003000C4 +:10ACE00060004000C000C000C000C000C000C00044 +:10ACF000800100030000000000008001800180014D +:10AD0000800180018001800180018001800180013B +:10AD1000800180018001800180018001800180012B +:10AD2000800180018001000000006000C000C001BF +:10AD30008001800180018001800100030003000682 +:10AD400000030001800180018001800180018001F9 +:10AD5000C0006000000000000000000000000000D3 +:10AD60000000000000000000F010F81F080F0000B5 +:10AD700000000000000000000000000000000000D3 +:10AD80000000000000000000001028002800011B47 +:10AD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC3 +:10ADA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB3 +:10ADB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:10ADC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:10ADD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:10ADE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:10ADF000FFFFFFFFFFFFFFFFFFFFFFFFFFFF3BFF27 +:10AE0000D8FE76FE34F614F614F6F4F515F697FE31 +:10AE10003BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:10AE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:10AE3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:10AE4000FFFFFFFFFFFFFFFF7DFFF2F58EF54BEDEC +:10AE5000C9EC47ECC5EBA5EB64EB24EB04EB25EB6D +:10AE600067EB0AEC0FF57CFFFFFFFFFFFFFFFFFF23 +:10AE7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:10AE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:10AE9000FFFFFFFFBFFFEBEC29EDAAED6AED2AED06 +:10AEA000E9ECA9EC48EC08ECC7EBA7EB66EB25EB6B +:10AEB000E5EAA4EA63EA42EA46EB7CFFFFFFFFFF14 +:10AEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:10AED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:10AEE000BEFF90F504EC4AED6BED6BED4AED0AED1B +:10AEF000C9EC89EC48EC07ECC7EB86EB66EB26EB7C +:10AF000006EBE5EAC5EAA4EA23EA80E94CF47CFF13 +:10AF1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:10AF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF9FE38 +:10AF30008AEC26ECC9EC0AED0AED0AED0AEDC9EC43 +:10AF4000A9EC68EC28ECE7EBA7EB86EB46EB26EBED +:10AF500005EBE5EAC5EAA4EA84EA64EAC1E9A5EA00 +:10AF600035FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC +:10AF7000FFFFFFFFFFFFFFFFFFFFFFFFD9FEA6EB75 +:10AF8000E6EB69EC89ECA9ECC9ECC9ECC9EC89ECFD +:10AF900068EC48EC08ECC7EBA7EB66EB46EB26EB5E +:10AFA00005EBC5EAA5EAA4EA84EA64EA44EAE2E930 +:10AFB000C1E914F6FFFFFFFFFFFFFFFFFFFFFFFFE9 +:10AFC000FFFFFFFFFFFFFFFFFFFFD9FE65EBA6EBD3 +:10AFD00008EC28EC48EC68EC69EC89EC68EC48EC8F +:10AFE00028EC08ECC7EBA7EB86EB66EB26EB05EB52 +:10AFF000E5EAC5EAA5EA84EA64EA64EA44EA43EADF +:10B0000003EAA1E9F4F5FFFFFFFFFFFFFFFFFFFFEA +:10B01000FFFFFFFFFFFFFFFFBEFFC8EB25EBA7EB26 +:10B02000C7EBE7EB08EC28EC28EC28EC28EC08EC64 +:10B03000E7EBC7EBA7EB86EB66EB46EB05EB05EB27 +:10B04000E5EAC5EAA4EA84EA64EA44EA44EA23EACF +:10B0500023EAC2E943EA3BFFFFFFFFFFFFFFFFFFD9 +:10B06000FFFFFFFFFFFFFFFF30F5A3EA66EB86EB74 +:10B07000A7EBC7EBC7EBE7EBE7EBE7EBE7EBC7EBE0 +:10B08000C7EBA7EB86EB66EB46EB26EB05EBE5EAB9 +:10B09000C5EAA5EA84EA84EA64EA44EA44EA23EADF +:10B0A00003EA03EA60E9CAEBFFFFFFFFFFFFFFFFD0 +:10B0B000FFFFFFFFFFFFFFFF20EA06EB46EB46EB3B +:10B0C00086EB87EBA7EBA7EBA7EBC7EBA7EBA7EB11 +:10B0D00086EB86EB66EB46EB26EB05EBE5EAC5EA8D +:10B0E000C5EAA4EA84EA64EA64EA44EA24EA23EAD0 +:10B0F00003EA03EAE3E920E15CFFFFFFFFFFFFFF54 +:10B10000FFFFFFFFFFFF0FF542EA05EB05EB26EB24 +:10B1100046EB46EB66EB66EB66EB66EB66EB66EBE7 +:10B1200046EB46EB46EB06EB05EBE5EAC5EAC5EA7E +:10B13000A4EA84EA64EA64EA44EA43EA23EA03EA22 +:10B1400003EAE3E9E3E961E988EBFFFFFFFFFFFFC3 +:10B15000FFFFFFFFFFFFE5EAA4EAE5EAE5EA05EB0A +:10B1600025EB26EB46EB46EB46EB46EB46EB46EB98 +:10B1700026EB25EB05EB05EBE5EAC5EAA5EAA5EA32 +:10B18000A4EA84EA64EA64EA44EA24EA23EA03EAF1 +:10B1900003EAE3E9E3E9E3E9E1E9FFFFFFFFFFFF9A +:10B1A000FFFFFFFFFFFF43EAA4EAC5EAC5EAE5EABD +:10B1B00005EB05EB25EB25EB26EB26EB26EB25EB4C +:10B1C00005EB05EBE5EAE5EAC5EAA5EAA5EA84EAC6 +:10B1D00084EA64EA64EA44EA24EA23EA23EA03EA22 +:10B1E00003EAE3E903EAE3E9C2E91AFFFFFFFFFF2D +:10B1F000FFFFFFFFFAEE43EAA4EAA5EAC5EAC5EAC3 +:10B20000C5EAE5EAE5EA05EB05EB05EB05EBE5EA62 +:10B21000E5EAE5EAC5EAC5EAA4EAA5EA84EA84EA39 +:10B2200064EA64EA44EA43EA23EA23EA03EA03EA33 +:10B23000E3E903EA03EAE3E981E9D5EDFFFFFFFF74 +:10B24000FFFFFFF758DE23EA84EA84EAA4EAA5EACE +:10B25000C5EAC5EAC5EAC5EAC5EAE5EAC5EAC5EA56 +:10B26000C5EAC5EAA5EAA5EAA4EA84EA84EA64EAAA +:10B2700064EA44EA44EA23EA23EA03EA03EAE3E964 +:10B28000E3E9E3E9E3E9E3E9A1E953DDFFF7FFFFE0 +:10B29000FFFF9EE738C643EA64EA84EAA4EAA5EA27 +:10B2A000A4EAC5EAC5EAC5EAC5EAC5EAC5EAA5EA67 +:10B2B000A5EAA4EAA5EA84EA84EA64EA64EA64EA1C +:10B2C00044EA44EA23EA23EA03EA03EA03EAE3E975 +:10B2D000E3E9E3E9E3E9E3E9A2E933CD9FE7FFFF2F +:10B2E000FFFF1CDF39BE83EA64EA84EA84EAA4EA49 +:10B2F000A4EAA5EAA5EAA5EAA5EAA5EAA5EAA5EAD7 +:10B30000A4EAA4EA84EA84EA84EA64EA64EA44EA0D +:10B3100044EA44EA24EA23EA03EA03EAE3E9E3E944 +:10B32000E3E9E3E9E3E9E3E9C2E975CDFDCEFFFF37 +:10B33000DFFF5AC63BB6C4EA44EA84EA84EA84EAF8 +:10B34000A5EAA4EAA4EAA4EAA4EAA4EAA4EAA4EA8C +:10B3500084EA84EA84EA64EA64EA64EA44EA44EA5D +:10B3600023EA23EA23EA03EA03EAE3E903EAE3E957 +:10B37000E3E9E3E903EAE3E9C2E9B7BD5ABEDFFF67 +:10B38000DFFFD8B57CA663EAA4EA84EA84EAA5EAEA +:10B39000A4EAA4EAA4EAA4EAA4EAA5EAA4EA84EA5C +:10B3A00084EA84EA84EA64EA64EA44EA44EA44EA2D +:10B3B00023EA23EA03EA03EA03EAE3E903EAE3E927 +:10B3C000E3E903EAE3E903EAC2E1F9B5B8ADBEF7A0 +:10B3D000BFF797AD3B9E24E205EB84EAA4EAA5EA19 +:10B3E000A5EAA5EAA5EAA5EAA5EAA4EAA4EA84EA08 +:10B3F00084EA84EA64EA64EA64EA64EA44EA44EADD +:10B4000023EA23EA03EA03EA03EA03EA03EAE3E9B5 +:10B41000E3E9E3E903EA23EA81E11AA677A5BEF7A7 +:10B42000BEF776A5FA9D86D263F205EBA4EAC5EADB +:10B43000C5EAC5EAC5EAC5EAA5EAA5EAA5EAA4EA15 +:10B4400084EA84EA64EA64EA64EA64EA44EA44EA8C +:10B4500023EA23EA03EA03EA03EA03EA03EAE3E965 +:10B4600003EA03EA23F2C3D9A2D91A96369DBEF79E +:10B470009EF756A5B99D4BBBC1F105EB05EBE5EA7F +:10B48000E5EAE5EAC5EAC5EAC5EAC5EAA5EAA5EA44 +:10B4900084EA84EA84EA64EA64EA44EA44EA44EA3C +:10B4A00024EA23EA23EA03EA03EA03EAE3E9E3E915 +:10B4B000E3E903F2E3D941C966C2F995369D9EF7E7 +:10B4C0009EF7359D98A53194A0F944EA66EB26EBEA +:10B4D000E5EA05EB05EB05EBE5EAC5EAC5EAA5EA11 +:10B4E000A4EA84EA84EA84EA64EA44EA44EA44EAAC +:10B4F00024EA24EA23EA03EA03EA03EAE3E9E3E9C4 +:10B5000023F2E3E163B120D16D9BB89D56A59EF770 +:10B510009EF7359D77A51595E2D923F264EAA7EB4E +:10B5200066EB46EB66EB46EB26EBE5EAC5EAA5EAF9 +:10B53000A4EAA4EA84EA84EA64EA64EA44EA44EA1B +:10B5400044EA23EA23EA03EA03EA03EAE3E923FA03 +:10B55000E3D903A143B100C9938C97A576ADBEF79B +:10B56000DFFF55A5569D76A50BA302FA44EA64EACF +:10B5700066EBC7EBC7EBA7EB66EB26EBC5EAC5EAC4 +:10B58000C5EAA4EAA5EA84EA84EA64EA64EA44EA49 +:10B5900044EA43EA24EA03EA03EA03F203F283C13A +:10B5A000E29023A101C14892369D77A5D8BDDEFF68 +:10B5B000FFFFD7BD369D77A531A466C223F264EAAA +:10B5C00084EAE5EAC7EBE7EBA7EB46EBE5EAE5EA59 +:10B5D000C5EAC5EAA5EAA4EA84EA84EA64EA64EA78 +:10B5E00044EA24EA23EA43F223F2C3D1E290A280A0 +:10B5F000029902A964A1CF8B36A5B8AD9ACEDFFF20 +:10B60000FFFF99D656A598A5B3ACAE9B23DA64F29A +:10B61000A4EAA5EAC5EA26EB66EB66EB46EBE5EAAB +:10B62000C5EAC5EAA4EA84EA84EA64EA64EA64F260 +:10B6300064F284FA23E2A3C123A18270A280E29083 +:10B64000029902A90C83529C77A559C6DBDEFFFF45 +:10B65000FFFF5DEF56A5F9B5D4AC71B46D8B02F266 +:10B6600084F2A5EAC5EAC5EAA5EAA5E284E2C5E254 +:10B6700005EB05EB25EB25F305F3E5F2A4EA44DA47 +:10B68000C3C12399C388A2808278A280C288E29035 +:10B6900080A0CB7A319C729C19BE7ACE3CEFFFFF22 +:10B6A000FFFFFFFF58CEB8AD39C671B492BC6E8BA8 +:10B6B00064DA84F2C5F2C5EAA5EA84EA44E203DA70 +:10B6C000C3D183C962C102B102A1E298C290C2880B +:10B6D000C288C288C288A288C280A280A288A290A2 +:10B6E000EC72529C119C97AD39C69ACEFFFFFFFFBA +:10B6F000FFFFFFFFBEF796AD7AC618CE30B450BC40 +:10B70000AE9BA7BA84E2A4FAA4EA64E244E223DA94 +:10B71000E3D1C3D1A3C163B943B123A903A1029962 +:10B72000E390C390C288C2888288818045790D7B6E +:10B73000F09B10A4D4A496ADF8BD9EF7FFFFFFFFC9 +:10B74000FFFFFFFFFFFF3CE7B7B51DD7BBDE0FBC18 +:10B75000CEB3EFAB2BA365C263EA63F244E204DA33 +:10B76000E3D1C3D1A3C963B943B123A923A10299EA +:10B77000E298E290A290618803796A7A6E8BCF9BFF +:10B7800011A4728CB38C35A53CE7FFFFFFFFFFFFD0 +:10B79000FFFFFFFFFFFFFFFFBAD618BE7EE7BEEF39 +:10B7A00055CDD2CCB2CC8DB30BA367AA03D2E2E9BC +:10B7B000C2D9A3D182C962C142B922A902A9E2A019 +:10B7C000A198C28865796A7A2D8B8F93AFA311A453 +:10B7D0008F6BD06B928CDBDEFFFFFFFFFFFFFFFF65 +:10B7E000FFFFFFFFFFFFFFFFFFFFDADE59C69EEFFF +:10B7F000FFFFFFFF18E6EEC38CC38DBB6CABEB9A6B +:10B8000088A247AAE5A9C5A1A5A1A591C6890782D5 +:10B810008A7AEC822D934EA38EA38F934E73293A8E +:10B820008B4A728C3CE7FFFFFFFFFFFFFFFFFFFF2C +:10B83000FFFFFFFFFFFFFFFFFFFFFFFF1BE779CECB +:10B840007DEFFFFFFFFFFBEE95DD91CC8CCBE9C2D6 +:10B85000EABAEABACAAAA9AAA9A2AAA2AA9AAAA2B2 +:10B86000CBA26EABAF9B6E832D6B6A426629093A01 +:10B87000B394BEF7FFFFFFFFFFFFFFFFFFFFFFFFD8 +:10B88000FFFFFFFFFFFFFFFFFFFFFFFFFFFF9EF731 +:10B890009AD6BAD6FFFFFFFFFFFF7EEFDBDE39D679 +:10B8A00055CDB2C42FC4EFC3EEBBEFB3F0AB109CC9 +:10B8B000118C6E6B0D5BAB4AE8310419EC5A38C63B +:10B8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:10B8D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10B8E000FFFF7DEF38C6FBDEBEF77EEF3DDFFCCE0F +:10B8F0009BC63AB6D8A5779DD58C737CB06B4F6349 +:10B900000D53AC526B4A29420C6399D6FFFFFFFFDF +:10B91000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:10B92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:10B93000FFFFFFFFFFFF7DEFBAD69AD6BAD67ACEC9 +:10B9400019BED8B576A5F594938C127CB06BB06B0C +:10B95000AF73318455AD1CE7FFFFFFFFFFFFFFFF13 +:10B96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:10B97000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10B98000FFFFFFFFFFFFFFFFFFFFFFFF9DF73CE70C +:10B990001CE7DBDE9AD67ACE59CE59CE9AD6FBDE9C +:10B9A0007DEFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:10B9B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10B9C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87 +:10B9D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF77 +:10B9E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:10B9F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57 +:10BA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46 +:10BA1000001028002800011BFFFFFFFFFFFFFFFFB2 +:10BA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF26 +:10BA3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:10BA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:10BA5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:10BA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:10BA7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:10BA8000FFFFFFFFFFFFFFFFDCEFB8DF95D774CFAD +:10BA900073CF75D797DFDBEFFFFFFFFFFFFFFFFFE0 +:10BAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:10BAB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:10BAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:10BAD000FFFF95D74DC707B708B708AF08A7E79E80 +:10BAE000C796C68EA586A57EA47EE99653C7FEFF9F +:10BAF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:10BB0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:10BB1000FFFFFFFFFFFFFFFFFFFFFFFFDDF74FC747 +:10BB200028BF6AD74BCF4BC72ABF2AB709AFE9A6B0 +:10BB3000E89EC896C78EA786A786A67E8576836E62 +:10BB4000EA96DBEFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10BB5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:10BB6000FFFFFFFFFFFFFFFFFFFF50C707AF4AC701 +:10BB70004BCF4BCF4BC72ABF2AB709AF09A7E8A6BF +:10BB8000E89EC896C78EA786A786A67EA67E8676DE +:10BB9000856E6366EC9EFFFFFFFFFFFFFFFFFFFF69 +:10BBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:10BBB000FFFFFFFFFFFFFDF7E8A608AF2AB72ABF88 +:10BBC0002ABF2AC72ABF2ABF0AB709AF09A7E89E1A +:10BBD000E896C896C78EC786A786A77E867E867695 +:10BBE0008676866E6466646EBAE7FFFFFFFFFFFF2E +:10BBF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:10BC0000FFFFFFFFDBEFC596E8A609AF09B72AB72C +:10BC10002AB72AB72AB70AB709AF09A7E9A6E89E43 +:10BC2000C896C78EC78EA786A786A67EA67E86766E +:10BC30008676866E856E6566425E97D7FFFFFFFF4C +:10BC4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04 +:10BC5000FFFFDDF7A58EE89EE89E09A709AF09AFB3 +:10BC600009AF09AF09AF09AF09A7E9A6E89EE896B1 +:10BC7000C896C78EA786A786A77EA67EA676867656 +:10BC80008676866E866E656E65664256B9E7FFFFFC +:10BC9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:10BCA000FFFFC68EC78EC896E89EE89EE9A609A744 +:10BCB00009A709A709A7E9A6E89EE89EE896C896FD +:10BCC000C78EC78EA786A786A67EA67E8676867630 +:10BCD0008676866E856E856E65666566635EFFFF39 +:10BCE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:10BCF00030B7A686C78EC896C896E896E89EE89E96 +:10BD0000E89EE89EE89EE89EE89EC896C896C78E84 +:10BD1000C78EA786A786A77EA67EA6768676867617 +:10BD2000866E856E656E856E65666566445ECA8ED6 +:10BD3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:10BD40008476A786C78EC78EC88EC896C896E89692 +:10BD5000E896E896E896C896C896C88EC78EC78EAD +:10BD6000A786A786A77EA67E867E86768676867638 +:10BD7000866E856E656E6566656665666566425645 +:10BD8000BAE7FFFFFFFFFFFFFFFFFFFFFFFF52BF0D +:10BD90008576A786A786C786C78EC78EC78EC88EAC +:10BDA000C896C896C88EC78EC78EC78EC78EA78600 +:10BDB000A786A77EA67EA67E867686768676866E01 +:10BDC000856E656E856E6566656665666566445EEC +:10BDD000EC9EFFFFFFFFFFFFFFFFFFFFFFFFC88E8F +:10BDE000867EA77EA786A786A786C786C78EC78EAC +:10BDF000C78EC78EC78EC78EC786A786A786A7861B +:10BE0000A77EA67EA67EA676867686768676866EC1 +:10BE1000856E656E65666566656665666566655EA2 +:10BE20006366FFFFFFFFFFFFFFFFFFFFFFFF636E84 +:10BE3000867EA67EA67EA77EA786A786A786A786DD +:10BE4000A786A786A786A786A786A786A77EA77E9A +:10BE5000A67EA67E8676867686768676866E856EC3 +:10BE6000656E856E6566656665666566656665664A +:10BE7000435EDCEFFFFFFFFFFFFFFFFF7CEF846E01 +:10BE80008676A67EA67EA67EA67EA77EA77EA786AF +:10BE9000A786A786A786A77EA77EA67EA67EA67E65 +:10BEA000867E8676867686768676866E866E656EE3 +:10BEB000856E656665666566656665666566656602 +:10BEC000435E37CFFFFFFFFFFFFFFFFFB9CE846E5A +:10BED000867686768676A67EA67EA67EA67EA67EBA +:10BEE000A67EA67EA67EA67EA67EA67EA67E86765A +:10BEF0008676867686768676866E866E856E856E84 +:10BF000065666566656665666566656665666566D9 +:10BF1000635E94B6FFFFFFFFFFFF7EEF79C6846E7E +:10BF20008676867686768676A676A67EA67EA67E99 +:10BF3000A67EA67E867E867E867E867686768676B9 +:10BF4000867686768676866E856E856E856E656665 +:10BF50006566656665666566656665666566656689 +:10BF6000635E75B63EE7FFFFFFFFDBD63BC6A476F8 +:10BF7000867686768676867686768676867EA67EB1 +:10BF8000A67EA67EA676A676A67686768676867621 +:10BF900086768676866E866E656E856E656E65665D +:10BFA0006566656665666566656665666566656639 +:10BFB000635E57B67BCEFFFFFFFF19BE1BC6A5769B +:10BFC0008676867686768676A676A676A676A67611 +:10BFD0008676867686768676867686768676867681 +:10BFE0008676866E866E856E856E656E656665661E +:10BFF00065666566656665666566656665666566E9 +:10C00000635E19BEF9B5FFFFFFFFB7ADDABD877EEE +:10C0100086768676867686768676A6768676867620 +:10C020008676867686768676867686768676867630 +:10C03000866E866E866E856E656E856E65666566D5 +:10C040006566656665666566656665666566656698 +:10C05000635EDABDD8ADDFFFFFFF77A599B5276E28 +:10C06000C78686768676867EA67EA67EA67E86761F +:10C0700086768676867686768676867686768676E0 +:10C08000866E866E856E656E856E656665666566AE +:10C090006566656665666566656665666566856628 +:10C0A000E35599B597ADBEF7DFFF56A578ADE96DBD +:10C0B000A676A77E867EA67EA67EA67EA67EA67E87 +:10C0C000867E867686768676867686768676867688 +:10C0D000866E866E856E856E656E6566656665665E +:10C0E0006566656665666566656665668566E45D62 +:10C0F000C55D79AD77A59EF7BEF7369D58A58C75C1 +:10C100008466C78EA67EA77EA77EA67EA67EA67E16 +:10C11000A67EA67EA67E86768676867686768676C7 +:10C12000866E866E856E856E856E656665666566ED +:10C130006566656665666566656685662566634DE2 +:10C14000886558AD369D9EF79EF7359D77A5F1849D +:10C15000A4666566C896A786A786A786A786A786CB +:10C16000A67EA67EA67EA676867686768676867657 +:10C17000866E866E866E856E656E656E65666566B4 +:10C18000656665666566656685664566C344A34DF6 +:10C19000ED7458A5369D9EF7BEF7159D77A5F594CD +:10C1A0002566856E656EE89EC78EC78EC78EC78E64 +:10C1B000A786A67EA67EA67E8676867686768676F6 +:10C1C0008676866E866E866E856E856E656E656613 +:10C1D000656665666566A566255E623C0345824DBB +:10C1E000938C77A576ADBEF7FFFF159D77A576A555 +:10C1F000EB6CA46E866E866EC88EE89EE89EE8960E +:10C20000C88EA786A67EA67EA67EA676867686762B +:10C2100086768676866E866E856E856E85666566A2 +:10C2200065668566C56E444D022CA33C2245885C3C +:10C23000359D569DF8BDDFFFFFFF96B557A576A546 +:10C24000F28CC665A56E86768676A77EE89EE99E08 +:10C25000C896C786A77EA67EA67EA67EA67686768A +:10C2600086768676866E866E856E656E856E856E42 +:10C27000C56E045EE22BC22B4234A23CC344707CE8 +:10C28000559DB8AD59CEFFFFFFFF9AD6369D77ADCD +:10C29000B3958F7C6566A6768676A67EA67EA786F3 +:10C2A000C88EC896A786A77EA67EA67EA67E867620 +:10C2B000867686768676866EA66EA66EC676A45539 +:10C2C00002344123A12B022C4234A134ED63328D80 +:10C2D00056A59BCE9AD6FFFFFFFFBEF735A5F9B551 +:10C2E000749DB2956D74656EA676867EA67EA67EDA +:10C2F000867666766676667E867EA77EA786C78603 +:10C30000C77EA67E667605666455833C81238123BD +:10C310008123A123C22B022C4134CB5B1185138DC9 +:10C3200019BE59C69EF7FFFFFFFFFFFF59CEB8ADFC +:10C330003AC6918DB2956E74256EC67EA67EA67E97 +:10C3400086766676456E0566E45DA455444D0345E4 +:10C35000A33C623422340234E22BE22BC22BC22BE8 +:10C36000A12BA12BE12BE12BAB5BF184F07C97ADF2 +:10C3700039C679CEFFFFFFFFFFFFFFFFDFFF96AD5E +:10C380007BC699C69085D18DAF7C4865C57EA67E5B +:10C3900086766676456E2566E55DC45D6455244DFA +:10C3A000E344A33C623C42342234022CE22BC22BF5 +:10C3B000C12BC0238433ED63F07C107D349597B599 +:10C3C000D7BDBEF7FFFFFFFFFFFFFFFFFFFF3CE70B +:10C3D000B7B5FCD6FBD6908DB08D70858C6CA76DF3 +:10C3E000C576856E656E2566E55DA4558455444D1C +:10C3F000E344A33C623C42342234022CE12BE1238F +:10C40000832B894B6E74EF7C107DD28C939455A551 +:10C410003CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +:10C42000DBDE19BE5EE79FF775AE54A6329E6F85C0 +:10C43000AC6C2865A5654466045EE4558455434D9F +:10C440000345C23C823C6234212CC233853BAA5353 +:10C450004D6CAE74EE74F0848F6BD073938CFBE6EE +:10C46000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10C47000FFFFDBDE39C6BFF7FFFFFFFFF8C6AD7D6C +:10C48000CE7DAE7D4D75CB6CC95CC75CA654854C2A +:10C4900065442544E643E74BEA534B648C6CAD6C32 +:10C4A000CD6CF07C6D632A42CC5231843CE7FFFFB7 +:10C4B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C +:10C4C000FFFFFFFF3CE738C6FFFFFFFFFFFFDFFF77 +:10C4D000D6BEEF8DAB75AC75AC758B754B6D2A6D9B +:10C4E000EA64CA64CA64CB64CB64CB640E758F7C87 +:10C4F0006E63E839C831E839B394BEF7FFFFFFFF38 +:10C50000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3B +:10C51000FFFFFFFFFFFFDFFF59CEFBDEFFFFFFFF47 +:10C52000FFFFBFFF5DE7B8C654AE1196F08DAF8533 +:10C530008E856F852F85F084907CF073ED5A4A4A82 +:10C54000093A8629CB5A9AD6FFFFFFFFFFFFFFFF6C +:10C55000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:10C56000FFFFFFFFFFFFFFFFFFFF7DEF79CEFBDE49 +:10C570009EF77EEF3DDFDCD67BCEFABD98AD37A5CA +:10C58000B5943384B1734F630E5BCC526B4A09424E +:10C590006E6B38C6FFFFFFFFFFFFFFFFFFFFFFFFD0 +:10C5A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B +:10C5B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFBEF7D4 +:10C5C000DBDE7ACE7ACE59C639BED8B577A51595B9 +:10C5D0009384F1736F632E5B6F6B318476AD5DEF87 +:10C5E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B +:10C5F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B +:10C60000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:10C61000FFFFFFFFDFFF7DEF1CE7DBDE9AD679CE61 +:10C6200059CE7ACEDBDE7DEFDFFFFFFFFFFFFFFF9E +:10C63000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A +:10C64000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:10C65000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA +:10C66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA +:10C67000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:10C68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10C69000FFFFFFFFFFFFFFFF0010A0005700011B7F +:10C6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10C6B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:10C6C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10C6D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:10C6E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:10C6F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:10C70000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:10C71000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:10C72000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:10C73000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:10C74000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9 +:10C75000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9 +:10C76000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9 +:10C77000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9 +:10C78000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9 +:10C79000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:10C7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99 +:10C7B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:10C7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10C7D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:10C7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:10C7F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:10C80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:10C81000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10C82000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:10C83000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:10C84000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10C85000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10C86000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 +:10C87000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8 +:10C88000FFFFFFFFFFFFFEFFFEFFFEFFFEFFFEFFBD +:10C89000FEFFFEFFFEFFFFFFFFFFFFFFFFFFFFFFAB +:10C8A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF98 +:10C8B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:10C8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10C8D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:10C8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:10C8F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:10C90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:10C91000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:10C92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:10C93000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:10C94000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:10C95000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:10C96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10C97000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10C98000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10C99000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:10C9A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10C9B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87 +:10C9C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF77 +:10C9D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:10C9E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57 +:10C9F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF47 +:10CA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF36 +:10CA1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF26 +:10CA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:10CA3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:10CA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:10CA5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:10CA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:10CA7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:10CA8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:10CA9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:10CAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:10CAB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:10CAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:10CAD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:10CAE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:10CAF000FFFFFFFFFEFFFEFFFEFFFFFFFFFFFEFF4A +:10CB0000FFFFFEFFDFFFDFFFDFFFFFFFFFFFDFFFB6 +:10CB1000FFFFDFFFDFFFFFFFFFFFDEFFDEFFFFFFA7 +:10CB2000DEFFFEFFFFFFFFFFFEFFFEFFFEFFFEFF3B +:10CB3000FEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFF0D +:10CB4000FFFFFEFFFEFFFFFFFFFFFFFFDFFFFFFF17 +:10CB5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:10CB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:10CB7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:10CB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:10CB9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:10CBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:10CBB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:10CBC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:10CBD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:10CBE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:10CBF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:10CC0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:10CC1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:10CC2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:10CC3000FFFFFFFFFEFFFEFFFFFFFFFFFFFFFFFF06 +:10CC4000FFFFDFFFFEFFFEFFFEFFFEFFFEFFFEFF1A +:10CC5000FEFFFDFFFEFFFEFFFEFFFEFFFEFFFEFFED +:10CC6000FEFFFEFFFEFFFEFFFDFFFDFFFDFFFDFFE0 +:10CC7000FDFFFDFFFDFFFDFFFDFFDFFFFFFFFFFFEE +:10CC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:10CC9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:10CCA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:10CCB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:10CCC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:10CCD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:10CCE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:10CCF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:10CD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:10CD1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:10CD2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:10CD3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:10CD4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:10CD5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:10CD6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3 +:10CD7000FFFFFFFFFFFFFFFFDFF7DFF7DFF7FFFF3B +:10CD8000DFF7FFFFFFF7FEF7FEF7FEF7FFF7FEF70F +:10CD9000FEF7FFFFDEEF5EE77FE77FE75EE75EDF40 +:10CDA0005EE75FE77FE75FE77EE79EE7FFF7FFF776 +:10CDB000FFF7FFF7FFF7FFF7FFF7DFF7FFFFDFF7FB +:10CDC000DFF7FFF7DFF7FFFFFFFFDFF7FFFFFFFFF3 +:10CDD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:10CDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:10CDF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:10CE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:10CE1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:10CE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:10CE3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:10CE4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:10CE5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:10CE6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:10CE7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:10CE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:10CE9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:10CEA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:10CEB000FFFFFFFF9EEF5DE71CDFBBCE9BCE5BC697 +:10CEC00099AD58A5B78C377CF673F673F673F67385 +:10CED000D56BB56B9463335B335B1253F2521353D0 +:10CEE000535B13531353335B1153525BB363B363FD +:10CEF000B363B363B363F46B1574B794189D38A52B +:10CF00001BBE7BCEBBD6DBD61CDF7DEFBEF7FFFFA3 +:10CF1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:10CF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:10CF3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:10CF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:10CF5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:10CF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:10CF7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:10CF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:10CF9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:10CFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:10CFB000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFF82 +:10CFC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:10CFD000DDFFFEFFFEFFFEFFFEFFFEFFDDF7FEF7BB +:10CFE000FEF7FFF7DFEFBEE77EDF5EDF3CB61895AA +:10CFF0001674B463765B55539563B56316741674F3 +:10D0000015743574D373B273926B716BF27B127CAF +:10D01000127C327C738497ADD7B5D7B5D8B5F8B547 +:10D0200019BEF8B59ACE5DE77DEF7DEF7DEF7DEF20 +:10D030007DEF1CE738C6F7BDF7BDD8B5D9B556A505 +:10D040005384F27BD173B16B916BEE5A2F63D27321 +:10D05000B59499AD5CC63EE73EE7BFF7BFF7BFF7B3 +:10D06000BFFFBFF7DFFFDFFFFFFFFFFFFFFFFFFF98 +:10D07000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 +:10D08000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10D09000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 +:10D0A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:10D0B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10D0C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:10D0D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60 +:10D0E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF51 +:10D0F000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:10D10000FFFFFFFFFFFFFFFFFFFFFEFFFEFFFEFF32 +:10D11000DDFFFEFFFEFFFFFFFFFFFFF7BFEFFFD6C4 +:10D1200099A5368473637363B573B573387C387CA3 +:10D13000F773B66B93631153726314741895DBB570 +:10D140005CC67FE79FEFBFF7DFF7DFF7DFF7DFF7BB +:10D15000FFFFFFFFDFF7DFF7DFF7DFF7FFFFDFF7A7 +:10D16000DFF7DFF7DFF79EEFFFFFFFFFFFFFFFFFB8 +:10D17000BEF7BEF7DFFFDFFFBEF7DFF7DFF7DFF752 +:10D18000FFF7FFF7FFFFDFF7FFF7BFEFDFF7DFF78F +:10D19000BEF77EE77BC6D8B5F59CD1731184728C3F +:10D1A00097B5DBDE7EEFFFFFFFFFFFFFBEF7FFFF60 +:10D1B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F +:10D1C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:10D1D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5F +:10D1E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:10D1F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:10D20000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:10D21000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E +:10D22000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:10D23000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF1E +:10D24000FFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFF0E +:10D25000FFF7FDD6D9ADF694357CD46BB56B377C32 +:10D26000387C3784B573546B746BB473F99C9BAD85 +:10D270007DCEDDD65DE7BFF7FFFFDFF7FFFFFFFFE6 +:10D28000FFFFFFFFDFFFFFFFFFFFFFFFDFFFFFFFEE +:10D29000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E +:10D2A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:10D2B000FFFFFFFFDFFFFFFFFFFFFEFFFFFFFFFF9F +:10D2C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF8E +:10D2D000FFFFFFFFFFFFDFF7DFF7DFF7DFFF7EF77F +:10D2E0001CE7DBDE9AD618C6D7BD38C659CEDFFF9D +:10D2F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E +:10D30000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:10D31000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D +:10D32000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D +:10D33000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD +:10D34000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED +:10D35000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD +:10D36000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFED +:10D37000DFFFFFFFFFFFFEFFFEFFFFFFFFFFFEFFE0 +:10D38000FEFFFFFFFFFFDFF7DFF71FDFBAAD978C70 +:10D39000D56BF56B167415741574D46BB363357C4B +:10D3A000F894D9AD7BC6FDD67EEFDEF7FEFFFEF723 +:10D3B000FDFFFDFFDEFFFEFFFEFFFEFFFEFFDEFFC7 +:10D3C000FEFFDEFFFEFFFEFFFEFFFFFFFEFFFFFF93 +:10D3D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D +:10D3E000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D +:10D3F000DFFFDFFFFFFFDFFFDFFFFEFFFEFFFEFFC0 +:10D40000FEFFFEFFFEFFFEFFFEFFFEFFFEFFFFFF33 +:10D41000FEFFFEFFDEFFFFFFDEFFFEFFDFFFDFFFA1 +:10D42000FFFFDFFFDFFFDFFFDFFFBEF77DEFFFFF67 +:10D43000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC +:10D44000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:10D45000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10D46000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:10D47000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC +:10D48000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC +:10D49000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C +:10D4A000FFFFFFFFFFFFFFFFFFFFFFFFDFFFDFFFCC +:10D4B000FFFFFFFFFEFFFEFFFEFFFEFFFEFFFFF789 +:10D4C000DFF75EE75BC6589D357C7463D673187CC6 +:10D4D000D66BF6731674F894B9AD7BC69FE7FFF769 +:10D4E000FFF7FFFFFFF7FFF7FEFFFEFFFDFFFDFF6A +:10D4F000FDFFFDFFFEFFFEFFFEFFFEFFFEFFFEFF46 +:10D50000FEFFFFFFFEFFFEFFFEFFDEFFFFFFFFFF50 +:10D51000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B +:10D52000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:10D53000FFFFFFFFFFFFFFFFFFFFFEFFFEFFFFFFFD +:10D54000FFFFFFFFFEFFFFFFFFFFFEFFFFFFFFFFED +:10D55000FFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFFB +:10D56000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB +:10D57000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB +:10D58000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB +:10D59000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B +:10D5A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:10D5B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B +:10D5C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B +:10D5D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B +:10D5E000FFFFFFFFBEF7FFFFFFFFFFFFFFFFFEFF95 +:10D5F000DEF7DEF7FFFFFFFFDFF7BFEF5DE7BBAD55 +:10D60000367C7263D46B567C3574D46BD46BF88CD7 +:10D610005BC65FE7FFF7FFF7FFF7FFFFFFFFFEFFC8 +:10D62000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:10D63000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:10D64000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA +:10D65000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA +:10D66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:10D67000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10D68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:10D69000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10D6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:10D6B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10D6C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:10D6D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:10D6E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:10D6F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:10D70000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:10D71000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:10D72000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFCFF0D +:10D73000FDF7DFF7FFF75FE7D794F15A946B387C7A +:10D740007984956B535B96849DC6FFF7DFEFFFF7F7 +:10D75000FCF7FDF7DDF7FDFFFEFFFFFFFFFFFFFF1B +:10D76000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9 +:10D77000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9 +:10D78000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:10D79000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99 +:10D7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:10D7B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10D7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:10D7D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:10D7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:10D7F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:10D80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10D81000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:10D82000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:10D83000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10D84000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10D85000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 +:10D86000FFFFFFFFDFFFFFFFDFFFDFFFFFF7FFF738 +:10D870003EDF7584936BD5735784D46B7263147CCD +:10D880003CBE5EE7BFEFDFF7DFF7BEF7DEF7FEFF78 +:10D89000FEFFFEFFDDFFFEFFFFFFFFFFFFFFFFFFBD +:10D8A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:10D8B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10D8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:10D8D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:10D8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:10D8F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:10D90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:10D91000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:10D92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:10D93000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:10D94000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:10D95000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10D96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10D97000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10D98000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:10D99000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10D9A000FFFFFFFFFFFFBEF7FFFF1CE778ADF57B32 +:10D9B000B673187CD873966B77845BBE5EDFFDF719 +:10D9C000FDFFFDFFFEFFDEFFFEFFDFFFDFFFBFFF0E +:10D9D000DFFFDFFFDFFFFFFFFFFFFFFFFFFFFEFFB8 +:10D9E000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:10D9F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:10DA0000FEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10DA1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:10DA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:10DA3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:10DA4000FFFFFFFFFFFFFEFFFEFFFEFFFFFFFFFFE9 +:10DA5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:10DA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:10DA7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:10DA8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:10DA9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:10DAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:10DAB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:10DAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:10DAD000FFFFDFFFDFFFDFFFFFFFFFFFDFFFDFFFF6 +:10DAE000FFFFDFF79EE77BC6557CB563F773387C95 +:10DAF000F673F47377A53DE7FFFFDEFFDEFFFFFF60 +:10DB0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:10DB1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF15 +:10DB2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:10DB3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:10DB4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:10DB5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:10DB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:10DB7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:10DB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:10DB9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:10DBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:10DBB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:10DBC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:10DBD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:10DBE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:10DBF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35 +:10DC0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:10DC1000FFFFBEFFFFFFFFFFFFFFFEFFFDFFDEF781 +:10DC20005DE778A5B36BB46B7884377CF573558466 +:10DC3000FAB5FFF7DFF7FFFFDFFFDFFFFFFFFFFFB3 +:10DC4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4 +:10DC5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD4 +:10DC6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC4 +:10DC7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:10DC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:10DC9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:10DCA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:10DCB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:10DCC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:10DCD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:10DCE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:10DCF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:10DD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:10DD1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:10DD2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:10DD3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:10DD4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFE4 +:10DD5000FEFFFEFFFEFFFFFFBEEFFFF7BEEF97A542 +:10DD60003063F6735884F67B3363F89C9FEFFFFFB4 +:10DD7000DEF7FFFFFEFFFFFFFFFFDFFFFFFFFFFFFD +:10DD8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:10DD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:10DDA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:10DDB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:10DDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:10DDD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:10DDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:10DDF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:10DE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:10DE1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:10DE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:10DE3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:10DE4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:10DE5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:10DE6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:10DE7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:10DE8000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFEFFA4 +:10DE9000FEFFFEFFDEF7DFF79EE7F694B363367C06 +:10DEA000998CF6733363DBB5BFF7FFFFFEFFFEFF10 +:10DEB000FEFFFEFFFEFFDEFFFFFFFFFFFFFFFFFF96 +:10DEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:10DED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52 +:10DEE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:10DEF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:10DF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:10DF1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:10DF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:10DF3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:10DF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:10DF5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:10DF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:10DF7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:10DF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:10DF9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:10DFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:10DFB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:10DFC000FFFFFFFFFFFFFFFFFFFFFEFFFEFFFEFF64 +:10DFD000FFFFFFFF7FE7179DD473167C5A7CF77312 +:10DFE000B46BFAB57FEFFFF7FEFFFDFFFEFFFFFF0B +:10DFF000FFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFF32 +:10E00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20 +:10E01000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10 +:10E02000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +:10E03000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:10E04000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 +:10E05000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:10E06000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 +:10E07000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10E08000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 +:10E09000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:10E0A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10E0B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:10E0C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60 +:10E0D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50 +:10E0E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40 +:10E0F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30 +:10E10000FFFFFFFFFFFFFFFFFFFFDEFFFFFFDFF768 +:10E11000BFEFB9ADF473167C377C3884D5739AA5FC +:10E120007EE7DEF7FEF7FEFFFFFFFFFFDFFFFFFFEB +:10E13000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF +:10E14000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF +:10E15000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF +:10E16000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF +:10E17000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAF +:10E18000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F +:10E19000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F +:10E1A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F +:10E1B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:10E1C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5F +:10E1D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:10E1E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:10E1F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F +:10E20000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E +:10E21000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:10E22000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE +:10E23000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE +:10E24000FFFFFFFFFFFFFFFFFFFFDFF7DFF7DDD679 +:10E25000968CD47337843784D573978C3EE7FFFF51 +:10E26000FEF7FDFFFDFFFFFFDFFFDFFFDFFFFFFF2B +:10E27000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE +:10E28000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E +:10E29000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:10E2A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E +:10E2B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:10E2C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5E +:10E2D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E +:10E2E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E +:10E2F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:10E30000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D +:10E31000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D +:10E32000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD +:10E33000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED +:10E34000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD +:10E35000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD +:10E36000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD +:10E37000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD +:10E38000FFFFFFFFFFFFFFFFFFFF9EEF1AB6926345 +:10E390009884377C167C147CFDDEFFF7FEFFDEFFE1 +:10E3A000DEFFDEFFFFFFFFFFFFFFFFFFFFFFFFFFBF +:10E3B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D +:10E3C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D +:10E3D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D +:10E3E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D +:10E3F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:10E40000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1C +:10E41000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C +:10E42000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC +:10E43000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:10E44000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10E45000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:10E46000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC +:10E47000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC +:10E48000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C +:10E49000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C +:10E4A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7C +:10E4B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C +:10E4C000FFFFFFFFDFFFBEF7BEF7127C147C7784EF +:10E4D000577C95635AA5DFF7DFF7FFFFFFFFFFFFCC +:10E4E000DFFFDFFFFFFFFFFFFEFFFDFFFDFFFEFF82 +:10E4F000FEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:10E50000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B +:10E51000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:10E52000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB +:10E53000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:10E54000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB +:10E55000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB +:10E56000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB +:10E57000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB +:10E58000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B +:10E59000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:10E5A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B +:10E5B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B +:10E5C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B +:10E5D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B +:10E5E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3B +:10E5F000FFFFFFFFFFFFFFFFFDFFFFFFDFFFFFFF4D +:10E60000DEF7FEFFDFF77CC6B573597C3774567CA6 +:10E61000D273DCD6FFFFDFF7FFFFDEFFFFFFFFFF58 +:10E62000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:10E63000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA +:10E64000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA +:10E65000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:10E66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10E67000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:10E68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10E69000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:10E6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10E6B000FFFFFFFFFFFFFEFFFEFFDDF7FEFFBEF7E0 +:10E6C000FFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10E6D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:10E6E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:10E6F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A +:10E70000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:10E71000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:10E72000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9 +:10E73000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9 +:10E74000DEF7DFF778ADD5733884577C1574D7942E +:10E75000DFF7FFFFDFF7FFFFFFFFFFFFFFFFFFFF19 +:10E76000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9 +:10E77000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:10E78000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99 +:10E79000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:10E7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10E7B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:10E7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:10E7D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:10E7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:10E7F000FFFFFFFFFFFFFFFFFFFFDFF7DFF7DFF7A1 +:10E80000FFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:10E81000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:10E82000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10E83000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10E84000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 +:10E85000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8 +:10E86000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB8 +:10E87000FFFFFFFFFFFFFFFFDFFFFFFFDEF7FEFFF2 +:10E88000BEEF379DF57358845984147499ADDFF742 +:10E89000DFF7DFF7FFFFFFFFFFFFDFFFFFFFFFFFF8 +:10E8A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10E8B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:10E8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:10E8D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:10E8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:10E8F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10E90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:10E91000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:10E92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:10E93000FFFFFFFFFFFFFFFFFFFFBFEF7BC677ADCE +:10E94000D394BEF7FFFFFFFFFFFFFFFFFFFFFFFFB7 +:10E95000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10E96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10E97000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:10E98000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10E99000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87 +:10E9A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF77 +:10E9B000FFFFFFFFFFFFFFFFDFFFFFFFFEF75DDF52 +:10E9C000337C377C387C1774D46BDCD6DFF7FFFFE1 +:10E9D000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFF67 +:10E9E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:10E9F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:10EA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:10EA1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:10EA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:10EA3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:10EA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:10EA5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:10EA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:10EA7000FFFFFFFFDFFFDFF7DFF71674315B4F5B50 +:10EA8000FCD6DEF7FEFFFFFFFFFFFFFFFFFFFFFFEC +:10EA9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:10EAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:10EAB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:10EAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:10EAD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46 +:10EAE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF36 +:10EAF000FFFFFFFFDFFFFFFFDFF7FFF7DFF7347CEC +:10EB0000387C3A7C397C9363DCCEDFFFFFFFFFFF6C +:10EB1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:10EB2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:10EB3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:10EB4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:10EB5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:10EB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:10EB7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:10EB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:10EB9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:10EBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:10EBB000FFFFDFFFBFF7FFFF948C545B315BFED696 +:10EBC0009FEFFFFFFEFFFFFFFFFFFFFFFFFFFFFFC6 +:10EBD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:10EBE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35 +:10EBF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:10EC0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:10EC1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04 +:10EC2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4 +:10EC3000FFFFFFFFFFFFFFFFDEF7DFF71374D56B6A +:10EC40005B843A7C54637EE7FEF7FEFFFEFFFEFF27 +:10EC5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC4 +:10EC6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:10EC7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:10EC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:10EC9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:10ECA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:10ECB000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFF84 +:10ECC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:10ECD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:10ECE000FFFFFFFFFFFFFFFFFFFFFFFFDFFFDFFF74 +:10ECF000DFF7FFFF9FEFFAB50F5B7263FED6DFF71A +:10ED0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:10ED1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:10ED2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:10ED3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:10ED4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3 +:10ED5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC3 +:10ED6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB3 +:10ED7000FFFFDFFFDFFFDFFFBFEF147C1674798436 +:10ED8000397CB56B9CCE7DE7DDF7FFFFFFFFFFFF12 +:10ED9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:10EDA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:10EDB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:10EDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:10EDD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:10EDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:10EDF000FFFFFFFFFFFFFFFFFFFFDFF7FFFFFFFF4B +:10EE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:10EE1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:10EE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:10EE3000FFFFDFF77BC6305B9263FDD6BFEFDFF7E6 +:10EE4000DFF7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:10EE5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:10EE6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:10EE7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:10EE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:10EE9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:10EEA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF72 +:10EEB000FFFFFFFFBEF7BEF756841774597C387CFE +:10EEC000F46B97A5DFF7FFFFDFFFFFF7FFFFFFFF03 +:10EED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:10EEE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:10EEF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:10EF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:10EF1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:10EF2000FFFFDFFFDFFFDFFFDFFFDFFFDFFFDFFFD1 +:10EF3000DFFFDFFFFFF7FFF7FFF7FFF7FFFFFFFF41 +:10EF4000FFFFFFFFFFFFFFF7FFF7FFF7FFF7FFF7F9 +:10EF5000FFF7FFF7FFF7FFF7FFFFFFFFFFFFFFF7E9 +:10EF6000FFF7FFF7FFF7FFF7FFF7FFFFFFFFDFF701 +:10EF7000DFF79CCE505B31533ED7FEF7FFFFDFFF3C +:10EF8000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:10EF9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:10EFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:10EFB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61 +:10EFC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51 +:10EFD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:10EFE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31 +:10EFF000DEFFBEF7FFFF57A5F7735A84187C367CF7 +:10F00000D58CFEF7BDF7DFFFDFFFFFFFFFFFFFFF40 +:10F01000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +:10F02000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:10F03000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 +:10F04000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:10F05000FFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFC8 +:10F06000FFFFFFF7DFF79EEF9EE73DDF1CDF1CD7BA +:10F070001CDF1CD7FCCE9AC639B639B639B639B6BC +:10F0800039B639B639B639B619B639B63AB63AB626 +:10F090003AB63AB63AB639B639B639B639B639B6F5 +:10F0A00059B639B63AB63AB61BAE7CBEDECE1ED7DE +:10F0B000FED67163B2635FD7BFE7DEF7DEF7FFFF0F +:10F0C000FFFFFFFFDFFFDFFFFFFFFFFFFEFFFEFF92 +:10F0D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40 +:10F0E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30 +:10F0F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20 +:10F10000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F +:10F11000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +:10F12000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFF0 +:10F13000FEFFFFF77CC6D56B597C1774167CD37322 +:10F140003DE7DFFFFEFFFFFFFFFFFFFFFFFFFFFFCA +:10F15000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF +:10F16000FFFFFFFFBEF7FFFFFFFFFFFFFFFFFFFFF8 +:10F17000FFFFFFFFFFFFFFFFFFFFFFFFDFF7DEF7F0 +:10F18000DFF7DFF7FFFFDFFFFFFFDFF79EEF9EEF09 +:10F190009EEF1CD75DDFFCCE7ABE59BEF8B5B7AD89 +:10F1A000559D779D77955695779D19AED8A5D8A58D +:10F1B000F9ADF9A51AA61AA619A619A61AA61AA68D +:10F1C0001AA61AA61AA61AA61AA61AA61AA69895D2 +:10F1D0009895989598959895778D778D788D988D49 +:10F1E000788D998D998D9A8D9A8DBB9539853A8DAB +:10F1F000735BB4631A959042535B915B136C1795E4 +:10F200005CBEFDD67EE7BFF7DFF7BFF7FEFFFEFF70 +:10F21000FEFFFFFFDFFFFFFFFFFFDFFFFEFFFFFF40 +:10F22000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE +:10F23000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE +:10F24000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE +:10F25000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE +:10F26000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE +:10F27000FFFFBFEFD373587C397C587CF5735BC6B6 +:10F28000FFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFF8F +:10F29000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E +:10F2A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:10F2B000FFFFFFFFFFFFDFFFBEF73CE77DEF18BE5C +:10F2C00038C69ACE59C6D7B5D7B559C69ACEFBDE41 +:10F2D000FCD6DFF7BFEFDFF7FFF7DFF7DFF7FFF76A +:10F2E000FFF7FFF7FFF7DFEFFFF7FFF7FFF7FFF796 +:10F2F000FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF75E +:10F30000FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF74D +:10F31000FFF7FFF7DFEFFFEFDFE7DFE7FFEFDFE705 +:10F320003DD7FCC63AAEB8A5F79DB6959795D26382 +:10F330009363577C1453F452155336531653155395 +:10F34000545B325310530F4BD1631695BDCE9FEFD4 +:10F35000DFF7FFFFDFF7FFFFFEFFFEFFFEFFFEFF11 +:10F36000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD +:10F37000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D +:10F38000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D +:10F39000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7D +:10F3A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF8D +:10F3B000DFFFF373367C587C587C577CF373DFF7A0 +:10F3C000FFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFF4E +:10F3D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D +:10F3E000FFFFFFFFDFFFBEF7DFFF7DEF5DE71BDF06 +:10F3F0001CDF3CE7FBDE1CDF9DEF7DEFBEF7BEF7B9 +:10F40000DFF7FFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:10F41000FFFFFFFFFFFFFFFFDFF7FFFFFFFFFFFF24 +:10F42000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:10F43000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10F44000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:10F45000FFFFFFFFFFFFFFFFFFFFFFFFDEF7DEF70E +:10F46000FFF7FFFFDFF7DFF7FFEFFFEF51741274D5 +:10F470001ED79AA55684B56B125BD54AF652365301 +:10F4800035535553334B13433343534B1353125399 +:10F49000B46B389DFED6FFF7FEF7DDF7FEFFFFFFEA +:10F4A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C +:10F4B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5C +:10F4C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4C +:10F4D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3C +:10F4E000FFFFFFFFFFFFFFFFFFFFFFFFDFFFDFF774 +:10F4F000FABDD373587C397C377CB46BFDD6DFF70B +:10F50000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:10F51000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB +:10F52000DFFFBEF79EF77DEFDFFFBEF7DFF7DFF708 +:10F53000FFFFDFFFFFFFDFFFDFF7FFFFFFFFFFFF43 +:10F54000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFEB +:10F55000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB +:10F56000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFAC +:10F57000FFFFFEFFFFFFFFFFFEFFFEFFFFFFFFFF9E +:10F58000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:10F59000FFFFFEFFFEFFDFFFDFFFFFFFFEFFDEFFDF +:10F5A000FEFFFEFFFEFFFEFFBFEF169D948C7FEF78 +:10F5B000DFF7DFF7FFF7DEEF9EE7BDCE9AA5156C0C +:10F5C0003253134B354B364B374B374B3653365341 +:10F5D00015531353525BF3733AB6BFEFFFFFFFFFB0 +:10F5E000FFFFFEFFFEFFFFFFFFFFFFFFFFFFFFFF2D +:10F5F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B +:10F60000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A +:10F61000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:10F62000FFFFFFFFFFFFFFFFFFFFDFFFFFFF9FEF7A +:10F630003163167C7984397C577C315BDFEFFFFFC7 +:10F64000FEFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFCC +:10F65000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10F66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:10F67000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10F68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:10F69000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10F6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:10F6B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:10F6C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:10F6D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF3B +:10F6E000FEFFDEF7FFFFBEF717A5D37B9FF7BFFF37 +:10F6F000DFFFFEFFFDFFFDF7FDF7FEF7FEF7FFF76B +:10F700003EDFB9A5F56B3453154B164B364B3653CC +:10F710003653165315533453F24A36741EDFDFFF47 +:10F72000FFFFFEFFFEFFFFFFFFFFFFFFFFFFFFFFEB +:10F73000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9 +:10F74000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9 +:10F75000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9 +:10F76000FFFFFFFFFFFFDFFFDFFFFFFFFFF75CC6CD +:10F77000B46B5884387C5874167C589DFFF7DDF7BD +:10F78000FEFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF8B +:10F79000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10F7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:10F7B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:10F7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:10F7D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:10F7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:10F7F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:10F80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:10F81000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10F82000FFFFFFFFBEEFB7B5738CBFFFFFFFDEFF2B +:10F83000DEFFFEFFFEFFFFFFFFFFFEFFFEFFFEFFFE +:10F84000FEFFDFF7FFF73BBEB26B31537553F44A4F +:10F85000164B164B3753F64A1653F44AB56BFEDE79 +:10F86000DFF7FEFFFEFFFFFFFFFFFFFFFFFFFFFFD2 +:10F87000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF98 +:10F88000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:10F89000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10F8A000FFFFFFFFFFFFFFFFFFFFDEF7FFF7D27352 +:10F8B0007884597C3874587CD573BFEFFEF7FDFF10 +:10F8C000FEFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF4A +:10F8D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:10F8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10F8F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:10F90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:10F91000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:10F92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:10F93000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10F94000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10F95000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10F96000FFF79EEF59C6D494FFFFFFFFDEFFFEFFB7 +:10F97000FEFFFFFFFFFFDFFFFFFFDFFFDFFFFEFFF9 +:10F98000FEFFBDF7FEFFDEF7BEF777A56F325453DB +:10F9900035531653F64A5753164B35533453F473B5 +:10F9A000FFF7FDF7FEFFFFFFFFFFFFFFFEFFFFFF7B +:10F9B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57 +:10F9C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF47 +:10F9D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:10F9E000FFFFFFFFFFFFFFFFFFFFFFFF7EE7505B13 +:10F9F000377C597C587C5774736BFFFFFEF7FDFF13 +:10FA0000FEFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF08 +:10FA1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:10FA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:10FA3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:10FA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:10FA5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:10FA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:10FA7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:10FA8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:10FA9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:10FAA000BEEF7EE7F494BFEFFFF7FFFFFFFFDEFF3F +:10FAB000FEFFFFFFFFFFFFFFFFFFDFFFFFFFFFFF77 +:10FAC000FEFFFEFFDEFFFFFFBFF7BFF7F88C3253EC +:10FAD0003453154B3653154B144B5553F34A535B64 +:10FAE0009FE7FEF7FEFFFFFFFFFFFFFFFEFFFFFFA9 +:10FAF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:10FB0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:10FB1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:10FB2000FFFFFFFFFFFFDFFFFFFFFFFF5BC6B46BC1 +:10FB3000387C587C577C577CF37BDFF7FFFFFEFF58 +:10FB4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:10FB5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:10FB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:10FB7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:10FB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:10FB9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:10FBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:10FBB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:10FBC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:10FBD000FFFFFFFFFFFFDFFFFFFFFFFFDFFFDFF79D +:10FBE0003CE755ADBEF7DFFFFFFFFFFFDFFFFFFF85 +:10FBF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF15 +:10FC0000FFFFFFFFFFFFDFFFFFFFDFF79FEF335B2C +:10FC1000365B164B154B7553354B154B34535153BF +:10FC20005FDFFFF7FFFFFFFFFFFFFFFFFFFFFFFFAC +:10FC3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD4 +:10FC4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC4 +:10FC5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:10FC6000FFFFFFFFFFFFFFFFFEFFFEFFFAB5F77B81 +:10FC7000397C577C577C577CF37BFFFFFFFFFFFFEE +:10FC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:10FC9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:10FCA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:10FCB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:10FCC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:10FCD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:10FCE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:10FCF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:10FD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:10FD1000FFFFFFFFFFFFFFFFFFFFDFFFFFFF5DEFC5 +:10FD2000D7BDBEF7FFFFDFFFFFFFFFFFFFFFFFFFB6 +:10FD3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3 +:10FD4000FFFFFFFFFFFFFFFFFFFFFFF7DFF7325B64 +:10FD50001653174B354B344B144B565333533474A3 +:10FD6000FFF7DFF7BFFFFFFFFFFFFFFFFFFFFFFF13 +:10FD7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:10FD8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:10FD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:10FDA000FFFFFFFFFFFFFFFFFEFFFEFF98AD177C89 +:10FDB000397C577C577C587CF273DFF7FFFFFEFFDE +:10FDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:10FDD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:10FDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:10FDF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:10FE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:10FE1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:10FE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:10FE3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:10FE4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:10FE5000FFFFFFFFFFFFDFFFFFFFFFFFBEF71CE716 +:10FE6000DFFFFFFF9EF7FFFFFFFFFFFFFFFFFFFF2B +:10FE7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:10FE8000FFFFFFFFFFFFFFFFFFFFFEF7DFEF315335 +:10FE90001553164B354B344B5453F44A525BFCCE3E +:10FEA0009FEFDFF7FFFFFFFFFFFFFFFFFFFFFFFFFA +:10FEB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52 +:10FEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:10FED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:10FEE000FFFFFFFFFFFFFFFFFFFFFFFFB9AD177C25 +:10FEF000397C577C577C597CD273FFF7FFFFFEFF9C +:10FF0000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:10FF1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:10FF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:10FF3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:10FF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:10FF5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:10FF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:10FF7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:10FF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:10FF9000FFFFFFFFFFFFDFFFFFFFDFFFFFFFFFFFB1 +:10FFA000FFFF7DEFFFFFDFFFFFFFFFFFFFFFFFFF13 +:10FFB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51 +:10FFC000FFFFFEFFFEFFFEFFFEFFFEFFDCC6324B23 +:10FFD000F44A164B154B13533253535BBDCEBFEF50 +:10FFE000FFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFF61 +:10FFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:020000040801F1 +:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:10002000FFFFFFFFFFFFFFFFFFFFFEF7D9B5177CC4 +:10003000397C387C587C597C9163FFF7FFFFFEFFC9 +:10004000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:10005000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 +:10007000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:10008000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10009000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:1000A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60 +:1000B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50 +:1000C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40 +:1000D000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFF50 +:1000E000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFF40 +:1000F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10 +:10010000FFFFFEFFFEFFFFFFFFFFBFEF935B144B00 +:10011000365316531453325B505B5EE7BFEFFFFF5D +:10012000BEF7FFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:10013000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF +:10014000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF +:10015000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAF +:10016000FFFFFFFFFFFFDFFFFEFFFEF7DCD6746B34 +:10017000397C587C377C397CF473DDCEDFF7FFFFA8 +:10018000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10019000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:1001A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5F +:1001B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:1001C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:1001D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F +:1001E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1F +:1001F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F +:10020000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE +:10021000FFFFFFFFDFFF5DEF5DEFFFFFFFFFFFFF72 +:10022000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE +:10023000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE +:10024000FFFFFFFFFFFFBFF7BFF795843553154B47 +:10025000575BF44A135396849FEF7DEFFFFFFFFF38 +:10026000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E +:10027000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:10028000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E +:10029000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:1002A000FFFFFFFFFFFFFFFFFEFFFEFF7EE7125B8A +:1002B0005984577C377C597C377C1474FFF7DFFFF7 +:1002C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E +:1002D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:1002E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E +:1002F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:10030000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD +:10031000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED +:10032000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD +:10033000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD +:10034000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF7E5 +:10035000FFFFFFFFFBDEF7BDDFFFBEF7FFFFFFFF85 +:10036000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D +:10037000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFAD +:10038000FFFFBFF7DFF73EDF347C115316531553E1 +:10039000F34A946B1CBEFFF7BFF7FEFFFEFFFFFFA3 +:1003A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D +:1003B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D +:1003C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D +:1003D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:1003E000FFFFFFFFFFFFFFFFFEFFFDFFDFF7978C23 +:1003F0005884367C787C397C387C946BFDD6FFFF42 +:10040000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD +:10041000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:10042000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10043000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:10044000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC +:10045000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC +:10046000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C +:10047000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C +:10048000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFF7A4 +:100490009EEFB7B5738CDFFFDFFFFFFFDFFFFFFFCE +:1004A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5C +:1004B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF6C +:1004C0009FF7BFF73BBE525B545B144B1453325340 +:1004D00017957EE7DFF7BFF7FFFFDEFFFFFFFFFFA8 +:1004E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1C +:1004F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C +:10050000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB +:10051000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:10052000FFFFFFFFFFFFFFFFFEFFFDFFFFF7FED610 +:1005300054637784577C397C397C377C347C9EEFDC +:10054000DEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFDD +:10055000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB +:10056000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B +:10057000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:10058000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B +:10059000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B +:1005A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B +:1005B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B +:1005C000FFFFFFFFFFFFFFFFFFFFFFFFDFF75DE71D +:1005D000738C938CDFF79EF7FFFFDFFFFFFFDFFFDA +:1005E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B +:1005F000FFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFF2B +:100600005DE7958CF1523453D4425653557C5FDFED +:10061000DEEFDDF7FDFFFEFFDFFFDFFFFFFFFFFF88 +:10062000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA +:10063000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:10064000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10065000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:10066000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFBA +:100670007384F473997C196C587C577CD46BF79411 +:10068000BFEFFFFFDEFFFEFFFEFFDFFFDFFFFFFF2D +:10069000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:1006A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:1006B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:1006C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:1006D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A +:1006E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A +:1006F000FFFFFFFFFFFFFFFFFEFFFDFFFCF7FEFF19 +:10070000FFFFFFFFFFF7FFF79FEFFFFF1ABE0F632B +:1007100097ADFFFFDDF7FEFFFEFFFFFFFFFFFFFFCF +:10072000FFFFFFFFFFFFFFFFFDFFFDFFFEFFDEFFFF +:10073000DFFFBFF7FFFFDFFFDFFFFDEFFFEF9B9D59 +:10074000B3421653155BF25A758C7FEFDFFFDFFF64 +:10075000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:10076000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99 +:10077000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:10078000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10079000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:1007A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:1007B000FFF7B26B777C5874587C377C9884D46B85 +:1007C00078A5BFEFDFF7FFFFDEFFDFFFFFFFFFFFD3 +:1007D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:1007E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:1007F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:10080000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10081000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10082000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 +:10083000FFFFFFFFFEFFFFFFFFFFFFFFDFFFFFFFE9 +:10084000FEFFFDFFFEFFBFF77EEFF27B0F63DDDEF5 +:10085000BFF7DFF7FEFFFFFFFFFFFFFFFFFFFFFF19 +:10086000FFFFFFFFFFFFFFFFFFFFDFFFBFFFBFFF38 +:10087000DFFFDFFFFFFFBDF7FEFFFBB57263525BDB +:10088000F24A12537AA57EE7FFFFDEF7DFFFDFFFB4 +:10089000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:1008A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:1008B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:1008C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:1008D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:1008E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:1008F000DFFF7FE7D36B567C597C397C387C587C92 +:10090000D47355843EDFFFF7DEF7FEFFFEFFFEFFE8 +:10091000FEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFE9 +:10092000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10093000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10094000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10095000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:10096000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10097000FFFFFFFFFEFFFFFFDFFFDFFFBFFFDFFF28 +:10098000BDF7DDF75DE7D5942F63B5947FEFDFF713 +:10099000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:1009A000FFFFFEFFFEFFFEFFBFFFFFFFDFFFFEF7C3 +:1009B000DDF7FEF7BFF779ADB373F45AD252D473B3 +:1009C0003BB69FE7FFF7FEF7FEFFDDFFFFFFFFFFF0 +:1009D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:1009E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:1009F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:100A0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:100A1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:100A2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:100A3000BEF7FFFF7EE774841674387C397C597CDE +:100A4000587C1674D36B3ABEBFEFFEF7FEF7FEFF7D +:100A5000FEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFA8 +:100A6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:100A7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:100A8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:100A9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:100AA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:100AB000FFFFFFFFFFFFFEFFFDFFFDFFDEFFBEF7B5 +:100AC000FEDE39A53163137C5BC6FFFFBFF7DFF79E +:100AD000DFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFF86 +:100AE000FFFFFEFFFEFFFEFFFEF7FEF7DEF7FEF75D +:100AF0001DDF57A5726BB2529673F99CFEDEDFF7CD +:100B0000FFF7DDEFFEF7FFFFDFFFDFFFFFFFFFFF78 +:100B1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:100B2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:100B3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:100B4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:100B5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:100B6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF96 +:100B7000FFFFDFFFFFFFFFFFD684F46B377C598454 +:100B8000387C597C788493637784FCD6DFEFFFF759 +:100B9000FFF7FFFFFFFFFEFFFEFFFEFFFFFFFFFF70 +:100BA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:100BB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:100BC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35 +:100BD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:100BE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF15 +:100BF000FFFFFFFFFEFFFEF7FEF7BFEFFCD6179DDE +:100C0000315BD573DBB5BFF7DFF7FFFFFEFFFEFFFC +:100C1000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:100C2000FFFFFFFFFFFFFFFFFDF79DEFBCCE978C9F +:100C3000F35A5363968CFCD6FEF7FFFFFFFFFEF7D7 +:100C4000FEFFFEFFFFFFFFFFDFFFDFFFFFFFFFFFF6 +:100C5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:100C6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:100C7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:100C8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:100C9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:100CA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:100CB000FFFFFFFFFFFFFFFFFFF79CCE305B567C7F +:100CC000587CF773397C387C387CB36B1474DECE77 +:100CD000BFEFFFF7FFFFFEFFFEFFFDFFFFFFFFFF80 +:100CE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:100CF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04 +:100D0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:100D1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:100D2000FFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFD4 +:100D3000FFF7FFFFFFF79EEFBDCED473315B515B32 +:100D4000F9ADFFEFDFF7DFFFFFFFFEFFFDFFFDFF68 +:100D5000FEFFFEFFFFFFFEFFFEFFFEFFDFFFDFFFE8 +:100D6000FFFFFFFFBFF7FEDE988CD052F052758474 +:100D7000DDD6DFF7FFF7FEF7FEF7FCFFFDFFFEFF16 +:100D8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:100D9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:100DA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:100DB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:100DC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:100DD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:100DE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:100DF000FFFFFFFFFFFFFFFFFFFFDFF7DFF7B9B5E3 +:100E00005163F57378841774587C577C7784157414 +:100E10009363BAAD9FEFFFF79EEFFFFFFFFFFFFF6A +:100E2000FFFFDFF7FFFFDFFFFFFFFFFFDFFFDFFF5A +:100E3000DFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFF22 +:100E4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:100E5000FFFFFFFFFFFFFFFFDFFFDFFFDFFFFFFF02 +:100E6000FFFFFFFFFFFFDFFFFFFFFFFFBFEFDFF72A +:100E7000DFEFBDCE377C325B7263B16B19B6DFF743 +:100E8000BDE7FFF7FEF7FFFFFEFFFEFFFEFFFDFFE2 +:100E9000FEFFFEFFFFFFFFFFFFFFDFF7FFFF9EEFFD +:100EA0005EE7D59CCD524F63B894BED6DFF7FEF710 +:100EB000FDF7FDF7FFFFDFFFBFFFFEFFFFFFFFFFB7 +:100EC000FFFFFFFFFFFFFFFFFDFFFDFFFFFFFFFF36 +:100ED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:100EE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:100EF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:100F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:100F1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:100F2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:100F3000FFFFFFFFFFFFFFFFFFFFDFFFDFFFDFFF21 +:100F40005EE71ABED26BB36B767C587C577C587CBC +:100F5000787C1674D46BF473389DFED6DFF7FFF7F8 +:100F6000DFF7DFF7FFFFDFFFDFFFDEFFFFFFFFFF42 +:100F7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:100F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:100F9000FFFFFFFFFFFFFFFFDFFFFFFFDFFFFFFFA1 +:100FA000FFFFDFF7DFF7FFF7FFF71EDF78A5758498 +:100FB000D373315B73639AADFDD6DEF7BDF7DEF711 +:100FC000FEFFFFFFDEFFFFFFFFFFFFFFFFFFFFFF53 +:100FD000DFFFFFFFDFF7DFF7BFF77BCEB494B0731F +:100FE0005284F8BD1DDFBFF7FDF7DDF7FEFFFFFF01 +:100FF000DFFFBFFFDFFFFFFFFFFFFFFFFFFFFFFF81 +:10100000FFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF1 +:10101000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 +:10102000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:10103000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 +:10104000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10105000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 +:10106000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:10107000FFFFFFFFFFFFFFFFBFFFDFFFDFFFBEF749 +:10108000FEFFDFF7DFF79BC6F68CD56BF66B587C5F +:10109000387C387C587C377CF673D46B127CF59C9A +:1010A000B7B59ACE9EEFFFFFFFFFFFFFDFFFDFFF29 +:1010B000DFFFDFFFDFFFDFFFFFFFFFFFFFFFFFFFC0 +:1010C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30 +:1010D000DFFFDFFFDFFFDFFFDFFFFFFFDFFFFFFFE0 +:1010E0001CE73AC677ADF694137C926B9363D46B8E +:1010F000399D9BC6DDF7FEF7FFFFBFF7DFFFBFFFA0 +:10110000DFFFDFFFDEFFDEFFDFFFDFFFDFFFDFFFF1 +:10111000DFFF3DE7D7B59594137CD69C19C65EE7F3 +:10112000DFF7FFFFFFFFFFFFDEFFDEFFDFFFFFFF59 +:10113000FFFFFFFFFEFFFDFFFDFFFFFFFFFFFFFFC4 +:10114000FEFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:10115000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F +:10116000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F +:10117000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F +:10118000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:10119000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5F +:1011A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:1011B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:1011C000FFFFFFFFFFFFFFFFDFFF5EE7B7AD7384A9 +:1011D000D273F4731674377C587C597C5A7C3974FA +:1011E000F76B9563B56336745A95FAAD3ABEDCD6A3 +:1011F0005EE7BFEFDFF7DFF7FEF7FEF7FEF7FEFF74 +:10120000FEFFFEFFFFFFFFFFFFFFDEF7DEF7FFF74A +:10121000BFEF9FE73DD7BCCE1AB6DAADF78C557C51 +:1012200092639463D56BD46B958456A5BAD6DEF7DA +:10123000FEFFFDFFDFFFDFFFFFFFFFFFDFFFDFFF41 +:10124000FFFFFFFFDFF7FFF7FFF7DFF7DBD6F8B5AC +:10125000938C328456A5BBD6BEF7DFFFDFFFDFFFDE +:10126000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:10127000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E +:10128000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:10129000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5E +:1012A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E +:1012B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E +:1012C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:1012D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E +:1012E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:1012F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE +:10130000FFFFFFFFFFFFFFFFFFFFDFF7DFF7FFF745 +:10131000FFF71ED7BAAD557CD46BF5731674577CA6 +:10132000577C367C77849784367C567CF673756B55 +:10133000546333635363946B167C988CD994F994FB +:10134000F99C1A9D1A9DFA9CF99C988C988CD573DF +:10135000946B956B7463956BB673177C956BB673D2 +:10136000578499A51EDFFFF7DFF7FFF7FFFFDFFFC9 +:10137000DEFFFEFFFFFFFFFFDFFFBEF7FFFFFFFF08 +:10138000BEF7DFFF7EEFFCDE55A55184149D1CDF08 +:10139000DFF7FFFFFFFFFFFFFFFFDFFFFFFFFFFFA5 +:1013A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D +:1013B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D +:1013C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:1013D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D +:1013E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D +:1013F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD +:10140000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:10141000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC +:10142000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:10143000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC +:10144000FFFFFFFFFFFFFFFFFFFFFFFFDEF7BEF71E +:10145000FFFFFFF7FFF7FFF7FFF7DFEF5FE7D9AD1C +:1014600094849163716372635263D473F673F873F7 +:10147000397C5984387C798459845984998C58846E +:10148000387C177C177C177C377CB46B535B746398 +:101490007163916B7484D9B59CCE7EE7FFF7FFF73B +:1014A000BEEFFEF7FEF7FEF7FEF7FFFFFFFFFFFFC1 +:1014B000FFFFFFFFFFFFBEF7DFFFDFFFDFFFDFFF05 +:1014C00018C6929455AD3DE7DFF7BFF7DFF7DFFFB2 +:1014D000DFF7FFFFFFFFFFFFFFFFFFFFDFFFFFFF64 +:1014E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C +:1014F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC +:10150000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:10151000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB +:10152000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB +:10153000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB +:10154000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB +:10155000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B +:10156000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:10157000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B +:10158000FFFFFFFFFFFFFFFFFFFFFEFFFEFFFEFF6E +:10159000FFFFFFFFFFFFFEF7FEF7FEF7FFF7DFF7A6 +:1015A000FFFFDFF7BFF75EEF5EEF3EE7BDCE9CC605 +:1015B0007BC6D9AD379D379D379D379D16953ABE71 +:1015C0005BBE7BC69CCEDCCE5DDF5EE77EE79EEF3A +:1015D000DFF7FFFFFFF7FFFFFEF7FEFFDCF7FCF78B +:1015E000FCF7FDFFFDFFFEFFFEFFFEFFFFFFFFFF1D +:1015F000FFFFDFFFFFFF7DEF59CE96B518C61CE752 +:101600007DEFBEF7DFFFDFFFBFF7FFFFDFFFFFFF6D +:10161000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFA +:10162000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:10163000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:10164000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:10165000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10166000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:10167000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:10168000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:10169000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:1016A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:1016B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:1016C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A +:1016D000FEFFFEFFFEFFFEFFFEFFFEFFFFFFFFFF20 +:1016E000FFFFFFFFDFFFFFFFDFFFFFFFFFFFFFF752 +:1016F000FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFFF32 +:10170000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFEFFEB +:10171000DFFFDFFFDFFFDFFFDFFFFFFFDFFFFFFF99 +:10172000FFFFFEFFFEFFFFFFFFFFFFFFFFFFFFFFCB +:10173000FFFFFFFFDFFF9EF75DEFDFFFFFFFFFFF14 +:10174000FFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC9 +:10175000FFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:10176000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:10177000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:10178000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:10179000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:1017A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:1017B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:1017C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:1017D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:1017E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:1017F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9 +:10180000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10181000FFFFFFFFFFFFFEFFFEFFFEFFFFFFFFFFDB +:10182000FFFFFFFFFEFFFEFFFEFFFEFFFEFFFFFFCD +:10183000FFFFFFFFDFFFDFFFDFFFDFFFDFFFDFFF78 +:10184000DFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:10185000FEFFFEFFFEFFFFFFFFFFFFFFFFFFFFFF9B +:10186000FFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFFC8 +:10187000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:10188000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:10189000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:1018A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:1018B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:1018C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:1018D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:1018E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:1018F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:10190000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:10191000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:10192000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:10193000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:10194000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:10195000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:10196000FFFFFFFFFEFFFEFFFEFFFEFFFEFFFEFF8D +:10197000FEFFFEFFFEFFFFFFFFFFFFFFFFFFFFFF7A +:10198000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:10199000FDFFFDFFFDFFFDFFFEFFFEFFFFFFFFFF61 +:1019A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF47 +:1019B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:1019C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:1019D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:1019E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:1019F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:101A0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:101A1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:101A2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:101A3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:101A4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:101A5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:101A6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:101A7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:101A8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:101A9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:101AA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF47 +:101AB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFF37 +:101AC000FEFFFEFFFEFFFEFFFEFFFEFFFEFFFEFF2E +:101AD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:101AE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:101AF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:101B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:101B1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:101B2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:101B3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:101B4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:101B5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:101B6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:101B7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:101B8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:101B9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:101BA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:101BB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35 +:101BC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:101BD000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFF16 +:101BE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:101BF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:101C0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4 +:101C1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD4 +:101C2000FFFFFEFFFEFFFFFFFFFFFFFFFFFFFFFFC6 +:101C3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:101C4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:101C5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:101C6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:101C7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:101C8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:101C9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:101CA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:101CB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:101CC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:101CD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:101CE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFF24 +:101CF000BEF7FFFFDFFFDFFFDFFFBEF7FFFFFFFFE6 +:101D0000FFFFDFFFDFFFFFFFDFFFFFFFFFFFFFFF43 +:101D1000FFFFFFFFDFFFDFFFDFFFBEF7FFFFFFFF7C +:101D2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC3 +:101D3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB3 +:101D4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:101D5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:101D6000FFFFFFFFFFFFFFFFFFFFDFFFDFFFFFFFC3 +:101D7000FFFFDFFFBEF7FFFFDFFFFFFFFFFFFFFFFC +:101D8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:101D9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:101DA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:101DB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:101DC000FFFFFFFFFFFFFFFFFFFFFFFFBEF7FFFF6C +:101DD000DFFFBEF7FFFFFFFFFFFFFFFFFFFFFFFF7C +:101DE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:101DF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:101E0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:101E1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:101E2000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFE2 +:101E3000FFFFDFFFDFFFBEF79EF7DFFFBEF7DFFF2D +:101E4000FFFFDFFFFFFFDFFFFFFFFFFFFFFFFFFFE2 +:101E5000FFFFBEF7FBDE3CE7BEF7DFFFFFFFFFFF44 +:101E6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:101E7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF72 +:101E8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:101E9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52 +:101EA000FFFFFFFFFFFFFFFFFFFFDFFFDFFFDFFFA2 +:101EB000DFFFDFFFDFFFDFFFDFFFDFFFFFFFFFFFF2 +:101EC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:101ED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:101EE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:101EF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:101F0000FFFFFFFFFFFFFFFFDFFFBEF75DEF7DEF8E +:101F1000BEF7DFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:101F2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:101F3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:101F4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:101F5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:101F6000FFFFFFFFFFFFFFFFFFFFFFFFBEF7FFFFCA +:101F70005DEF55AD494AE318A21065290C6396B58B +:101F8000BEF7DFFFFFFFDFFFDFFFFFFFFFFFDFFF2A +:101F9000DFFFD7BD20000421B6B5BEF7DFFFFFFF8E +:101FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:101FB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31 +:101FC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:101FD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:101FE000FFFFFFFFFFFFFFFFFFFFD39C0842494AAF +:101FF0002842694AEF7BB6B5BEF7BEF7FFFFFFFF89 +:10200000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 +:10201000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:10202000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 +:10203000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10204000FFFFFFFFFFFFFFFFDFFFBAD62000A21058 +:10205000D7BDDFFFFFFFFFFFFFFFFFFFFFFFFFFF1A +:10206000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10207000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:10208000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60 +:10209000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50 +:1020A000FFFFFFFFFFFFFFFFFFFFDFFFFFFFDBDEA5 +:1020B000E318200020002000410800006108000013 +:1020C00028423CE7BEF7FFFFFFFFFFFFFFFFDFFFF8 +:1020D000DFFFF39C610841088A52FFFFDFFFFFFF2B +:1020E000FFFFFFFFFFFFFFFFFFFFDFFFDFFFFFFF40 +:1020F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:10210000FFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFF +:10211000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF +:10212000FFFFFFFFFFFFFFFFFFFFEF7B200020000F +:102130000000000000002000C7393CE7FFFFFFFF60 +:10214000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F +:10215000FFFFFFFFFFFFDFFFDFFFFFFFFFFFFFFFCF +:10216000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F +:10217000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:10218000FFFFFFFFFFFFFFFFDFFF79CE2000000012 +:10219000C739BEF7FFFFFFFFFFFFFFFFFFFFFFFF96 +:1021A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:1021B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F +:1021C000FFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFF3F +:1021D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F +:1021E000FFFFFFFFFFFFFFFFDFFFDFFF5DEFA2103D +:1021F000000020002421EF7B9AD6BAD64D6B200038 +:10220000C318AE73BEF7FFFFFFFFFFFFFFFFFFFF27 +:10221000DFFF9EF779CEEB5ABAD6BEF7DFFFFFFF9E +:10222000FFFFFFFFFFFFFFFFBEF7DFFF9EF79AD61E +:102230007DEFBEF7FFFFDFFFFFFFBEF7FFFFFFFFF2 +:10224000FFFFFFFFFFFFFFFFDFFFFFFFFFFF5DEF70 +:10225000BAD6FFFFFFFFDFFFFFFFFFFFDFFFDFFF5C +:10226000DFFFFFFFFFFFFFFFFFFFCF7B00008210BC +:10227000AA524D6B084200004108E3181CE7BEF764 +:10228000FFFFFFFFFFFFFFFFDFFFFFFFDFFFDFFFBE +:10229000FFFF9EF7FBDEBAD6FFFFFFFFBEF7BEF7DC +:1022A000FFFFFFFFFFFFFFFFFFFFFFFF9EF7FFFFA7 +:1022B000FFFFBEF7DFFFFFFFFFFFFFFFFFFFFFFF97 +:1022C000FFFFFFFFFFFFFFFFDFFFDFFF1CE7EB5A12 +:1022D00038C6DFFFFFFFFFFFFFFFFFFFFFFFDFFF4E +:1022E000FFFFDFFFFFFF5DEFBAD65DEFDFFFBEF759 +:1022F000FFFFDFFFFFFFBEF7FFFFFFFFFFFFFFFF57 +:10230000DFFFFFFFFFFF7DEF9AD65DEFFFFFFFFFCF +:10231000DFFFDFFFFFFFDFFFFFFFFFFFFFFFFFFF2D +:10232000FFFFFFFFFFFFDFFFFFFFDFFFB2940000B3 +:102330004108C739BAD6FFFF9EF7DFFFFFFFDBDE9C +:10234000D7BD9EF7DFFFDFFFFFFFFFFFFFFFFFFFB0 +:10235000FFFFF7BD6108821014A5FFFFFFFFFFFF1D +:10236000FFFFFFFFFFFF7DEF7DEFC7394108200032 +:1023700000008631E3184108694A1CE7DFFFFFFFD0 +:10238000FFFFFFFFFFFFFFFFDFFF96B5E318200011 +:1023900020004108694A82106108D39CDFFFFFFFDB +:1023A000DFFFFFFFFFFFFFFFFFFF1084000061085A +:1023B000B294DFFFDFFF59CE821000008A52FFFF88 +:1023C000DFFFDFFFFFFFFFFFFFFFBEF7FFFF59CE7D +:1023D0008631410820004108A2101084DFFFFFFF72 +:1023E000FFFFFFFFFFFFFFFFFFFFDFFFAA524108D4 +:1023F00008423CE7BEF7BEF7452941082842FBDE0C +:10240000FFFFFFFFFFFFFFFFDFFFBAD6821041088B +:10241000B294BEF7FFFFFFFFFFFFFFFFDFFFDFFF0D +:10242000BEF7718CE318200000002000E318718CC7 +:10243000DFFFDFFFDFFFDFFFFFFFFFFFFFFFBEF775 +:102440007DEFB294C318410800004108E31814A5B9 +:10245000FFFFBEF7FFFFFFFFFFFFFFFFFFFFFFFFD5 +:10246000FFFFFFFFFFFFFFFFDFFFDFFF494A200005 +:102470008210D7BDDFFFBEF7DFFFDFFFDFFFFFFF0B +:10248000FFFF9EF7BEF7FFFFBEF7FFFFFFFFFFFF57 +:10249000FFFF18C6000061081084DFFFFFFFFFFF89 +:1024A000FFFFFFFFFFFFBEF7652941082000A210D4 +:1024B000452961082000000045291CE7BEF7FFFF01 +:1024C000FFFFFFFFFFFFFFFF1CE76108200061081F +:1024D0002421A631200000002000EB5ABEF7DFFFC8 +:1024E000FFFFFFFFFFFFFFFFFFFFCF7B000082101A +:1024F000B294FFFFDFFFFFFFE739200004215DEF0B +:10250000DFFFDFFFFFFFFFFFDFFFDFFFDBDEC318C3 +:102510002000E318A6318A52821000008A52FFFF81 +:10252000FFFFDFFFFFFFFFFFFFFFDFFF1CE7821062 +:102530002000718CBEF759CE200061082C63BEF7D5 +:10254000FFFFFFFFFFFFFFFFFFFFDBDE00002000BC +:102550008E73DFFFFFFFFFFFFFFFFFFFDFFFBEF711 +:10256000CF7B0000200082108631652920006108A1 +:102570008E73BEF7BEF7FFFFFFFFFFFFFFFFDFFF1A +:1025800096B520002000C3180842284200006108C8 +:102590001084DFFFBEF7FFFFFFFFFFFFFFFFFFFF1E +:1025A000FFFFFFFFFFFFFFFFDFFFFFFFE739000037 +:1025B000E3181CE7DFFFDFFFAA520842E739E739DB +:1025C000E739694ADBDEDFFFDFFFFFFFFFFFFFFFC9 +:1025D000FFFFF7BD200020004D6BFFFFFFFFFFFF57 +:1025E000FFFFFFFFDFFF5DEF61082000E739B6B5B1 +:1025F0007DEFBAD68210000045291CE7BEF7FFFF29 +:10260000FFFFFFFFFFFFFFFF0C63610861080C6322 +:10261000BAD67DEF929420002000CB5ADFFFFFFF57 +:10262000DFFFFFFFFFFFFFFFFFFFCF7B0000610821 +:10263000B294FFFFFFFFDFFF494A200082103CE712 +:10264000BEF7FFFFDFFFFFFFDFFFFFFF4D6B000067 +:102650008210494A55AD55ADCF7B2000200014A50E +:10266000FFFFDFFFFFFFFFFFFFFFFFFFDFFF8A52DC +:10267000000024213CE7452900002421D7BDDFFFCD +:10268000DFFFFFFFFFFFFFFFFFFFDBDE00000000BB +:102690006D6BDFFFFFFFFFFFFFFFFFFFDFFFFBDED5 +:1026A00000002000452934A5BEF7BEF759CE718C35 +:1026B0001CE7DFFFDFFFFFFFFFFFFFFFFFFFDFFF85 +:1026C00008422000A2100C6375AD55AD2C630000CC +:1026D0002000F7BDFFFFFFFFFFFFFFFFFFFFFFFF32 +:1026E000FFFFFFFFFFFFFFFFDFFFBEF78E73410815 +:1026F0004108FBDE9EF7DFFF452920000000200097 +:10270000200061082C63FFFFFFFFFFFFFFFFFFFFBB +:10271000FFFFF7BD000020008E73BEF7FFFFFFFF35 +:10272000FFFFFFFFFFFFDBDE00006108EF7BDFFF45 +:10273000DFFFFFFF2421000045291CE7DFFFFFFF2B +:10274000FFFFFFFFFFFFDFFFA63100000421D7BD21 +:10275000DFFFDFFFDFFF821000002C63DFFFDFFF02 +:10276000FFFFFFFFFFFFFFFFFFFFEF7B00006108A0 +:10277000B294FFFFBEF7DFFFC7390000E318FBDEAE +:10278000FFFFDFFFFFFFDFFFDFFFBEF72421200099 +:102790000000200000000000000000002000CB5AD4 +:1027A000BEF7FFFFFFFFFFFFDFFFDFFFBEF7FBDE30 +:1027B000610820008A52000041080C63BEF7BEF792 +:1027C000FFFFFFFFFFFFFFFFFFFFDBDE000000005A +:1027D0006D6BDFFFFFFFFFFFFFFFFFFFDFFF96B522 +:1027E000000020008E739EF7FFFFBEF7BEF7DFFFED +:1027F000DFFFDFFFFFFFFFFFFFFFFFFFDFFF9EF7B2 +:10280000A210200000000000000020002000200096 +:102810000000718CDFFFFFFFFFFFFFFFFFFFFFFFE7 +:10282000FFFFFFFFFFFFFFFFFFFFDFFF59CE0000AD +:102830000000EB5ADFFFBEF7BEF714A514A5E3189E +:102840000000E31875ADDFFFBEF7FFFFFFFFFFFFDE +:10285000FFFF38C600004108718CFFFFFFFFFFFF3C +:10286000FFFFFFFFFFFF9EF7200041086D6BDFFFBA +:102870009EF77DEFC31800004529FBDEFFFFFFFF39 +:10288000FFFFFFFFFFFFDFFF0C636108C318F7BD09 +:10289000BEF7DFFF18C620002000CB5ADFFFFFFF86 +:1028A000FFFFFFFFFFFFFFFFFFFFAE73000082107F +:1028B000B294DFFFDFFF929400004108A6319EF73B +:1028C000DFFFDFFFFFFFDFFFBEF7FFFF2842000053 +:1028D00065299294518CF39CB29492949294D39CD7 +:1028E000FFFFDFFFDFFFFFFFFFFFFFFFFFFFFFFF38 +:1028F0008A522000000000000421D7BDFFFFFFFF27 +:10290000FFFFFFFFFFFFFFFFFFFFDBDE0000000018 +:102910006D6BFFFFFFFFFFFFFFFFFFFFFFFF18C60D +:1029200020000000718CDFFF9EF7FFFFBEF7DFFF86 +:10293000FFFFDFFFFFFFBEF7FFFFFFFFFFFFBEF759 +:1029400004218210A631EF7BB294718CD39C108449 +:1029500014A5F7BDDFFFFFFFFFFFFFFFFFFFFFFF36 +:10296000FFFFFFFFFFFFFFFFDFFFDFFFDFFFCF7B8B +:1029700041082000E318B29496B5518CC3180000AA +:102980006108694ABEF7FFFFDFFFFFFFFFFFFFFFA0 +:10299000FFFF38C6200020009294FFFFFFFFFFFFDB +:1029A000FFFFFFFFFFFFDFFF452900006108CB5A53 +:1029B0008E73C3180000000045291CE7FFFFFFFFCE +:1029C000FFFFFFFFFFFFDFFFDBDE41086108A631ED +:1029D00034A5EF7B610800002000AA52FFFFDFFF53 +:1029E000FFFFFFFFFFFFFFFFFFFFCF7B00000000A7 +:1029F00045290842E31800000000A2103084FFFFC0 +:102A0000BEF7FFFFFFFFDFFFFFFFFFFF38C620001D +:102A10000000EB5A7DEF55AD86318A52FBDEDFFFB9 +:102A2000FFFFFFFFDFFFFFFFFFFFFFFFDFFF9EF75F +:102A300079CE200020000000CB5ABEF7FFFFFFFF39 +:102A4000FFFFFFFFFFFFFFFFFFFFDBDE00002000B7 +:102A5000CF7BBEF7FFFFFFFFFFFFFFFFDFFFDFFFC3 +:102A6000694A41084108108438C6718CA2102C6351 +:102A70005DEFDFFFDFFFFFFFFFFFFFFFFFFFDFFF78 +:102A800014A500000000EF7B3CE7B294C3182C6350 +:102A9000BEF7DFFFFFFFFFFFFFFFFFFFFFFFFFFFAF +:102AA000FFFFFFFFFFFFFFFFDFFFDFFFDFFFDFFFB6 +:102AB000F39CA21000002000000020000000821003 +:102AC000494ABAD6BEF7BEF7DFFFFFFFFFFFFFFFA1 +:102AD000FFFF96B5200041083084DFFFFFFFFFFFB6 +:102AE000FFFFFFFFFFFFDFFF9EF7494A20000000C6 +:102AF00000008210200000004529FBDEFFFFFFFFE1 +:102B0000FFFFFFFFFFFFFFFFBEF755AD8210000084 +:102B100000004108410820004108CB5AFFFFDFFFB9 +:102B2000DFFFFFFFFFFFFFFFFFFFAE7300000000AE +:102B30000000000020004108C318CF7B9EF7FFFF74 +:102B4000BEF7FFFFFFFFBEF7FFFFBEF7FFFF14A5B5 +:102B500082102000410820000000A210AA52FFFFAE +:102B6000FFFFFFFFFFFFDFFFFFFFDFFFDFFFFFFFD5 +:102B7000BEF7694A20004529F7BDDFFFFFFFFFFFD1 +:102B8000FFFFFFFFFFFFFFFFDFFFBAD600002000BF +:102B90008E73BEF7FFFFFFFFFFFFFFFFFFFFBEF7D4 +:102BA0005DEF284220000000200000002000C31834 +:102BB0001084DFFFDFFFDFFFFFFFFFFFFFFFFFFFEF +:102BC0007DEF929400002000200000002000821081 +:102BD0004D6BBEF7DFFFDFFFFFFFFFFFFFFFFFFFD4 +:102BE000FFFFFFFFFFFFDFFFFFFFDFFFFFFFBEF77E +:102BF000DFFF1CE7D39C694AA631C739CB5AB29490 +:102C00005DEFDFFFBEF7FFFFFFFFFFFFFFFFFFFFEF +:102C1000FFFF9EF7D39C6D6B14A5BEF7FFFFFFFF70 +:102C2000FFFFFFFFBEF79EF7D7BDD7BDD7BD10840E +:102C3000CF7BEF7B410800000842BEF7BEF7FFFFE5 +:102C4000FFFFFFFFFFFFFFFFDFFFBEF7BAD61084D5 +:102C5000084208429294F39C6D6BB294DFFFDFFF51 +:102C6000FFFFFFFFFFFFFFFFFFFFFBDE718C6D6BC0 +:102C70006D6B4D6B6D6B518C59CEBEF7DFFFDFFF77 +:102C8000DFFFBEF7FFFFFFFFDFFFFFFFDFFFBEF746 +:102C9000DBDE518C694AC739CB5AB2945DEFFFFF36 +:102CA000FFFFDFFFFFFFDFFFFFFFDFFFDFFFDFFFD4 +:102CB000FFFF1CE7518CCF7B7DEFDFFFDFFFFFFFC6 +:102CC000DFFFFFFFFFFFFFFFDFFF9EF755AD8E73B6 +:102CD000F39CDFFFFFFFFFFFFFFFFFFFDFFFDFFFD3 +:102CE000DFFFFFFFD7BD6D6BE739E7390C6375ADCB +:102CF000BEF7DFFFDFFFFFFFFFFFFFFFFFFFFFFF6D +:102D0000FFFFFFFF79CE8E73E739C739CB5A96B5EF +:102D1000BEF7DFFFDFFFFFFFFFFFFFFFFFFFFFFF4C +:102D2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB3 +:102D3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:102D4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:102D5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:102D6000FFFFFFFFDFFF7DEFC31800000421694A6A +:102D7000AA52E318000082104D6BBEF7FFFFFFFF61 +:102D8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:102D9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:102DA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:102DB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:102DC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:102DD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:102DE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:102DF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:102E0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:102E1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:102E2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:102E3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:102E4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:102E5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:102E6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF72 +:102E7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:102E8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52 +:102E9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:102EA000FFFFFFFFFFFFBEF7FFFFA6314108200035 +:102EB000000000004108AA52BAD6DFFFFFFFFFFF63 +:102EC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:102ED000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:102EE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:102EF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:102F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:102F1000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:102F2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:102F3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:102F4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:102F5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:102F6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:102F7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61 +:102F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51 +:102F9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:102FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31 +:102FB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:102FC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:102FD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:102FE000FFFFFFFFFFFF9EF7BEF7DFFF5DEF55AD71 +:102FF000518C929479CEBEF7DFFFFFFFFFFFFFFFFA +:10300000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:10301000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0 +:10302000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:10303000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0 +:10304000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:10305000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80 +:10306000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:10307000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60 +:10308000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50 +:10309000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40 +:1030A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30 +:1030B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20 +:1030C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10 +:1030D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 +:1030E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:1030F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 +:10310000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF +:10311000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBF +:10312000FFFFFFFFFFFFDFFFFFFFDFFFBEF7FFFF38 +:10313000BEF7FFFFBEF7DFFFFFFFBEF7FFFFFFFF9A +:10314000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F +:10315000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7F +:10316000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:10317000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5F +:10318000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:10319000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F +:1031A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F +:1031B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1F +:1031C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F +:1031D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +:1031E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF +:1031F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF +:10320000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE +:10321000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE +:10322000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE +:10323000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E +:10324000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:10325000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E +:10326000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:10327000FFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFF7E +:10328000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E +:10329000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E +:1032A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:1032B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E +:1032C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:1032D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE +:1032E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE +:1032F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE +:10330000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD +:10331000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD +:10332000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD +:10333000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D +:10334000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D +:10335000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7D +:103360008033010800000020BC00000060820008DB +:103370003C340108BC0000200420000070820008DA +:1033800014007800DC000A006400C800506C65611D +:10339000736520707265737320746865206275743C +:1033A000746F6E21000000000000000000000000AB +:1033B0000000000000F36F06001001400010014003 +:1033C0000018014000180140010000000400000046 +:1033D00001000000020000000E06110700020000BC +:1033E0000400000000040000080000000008014084 +:1033F0000008014002060206040604060606060648 +:103400000008014000100140000C014001000000D4 +:103410000020000000400000020604060306000031 +:103420000100000000200000004000000002010038 +:0C3430000D0E062828000000000000001F +:04000005080081511D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LED.hex b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LED.hex new file mode 100644 index 0000000..8f8174e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Binary/USBFS/hex/LED.hex @@ -0,0 +1,103 @@ +:020000040800F2 +:108000008820002065810008BB810008B38100083A +:10801000B7810008AD8100085D8200080000000003 +:10802000000000000000000000000000E7810008E0 +:10803000B181000800000000E5810008E981000826 +:108040007F8100087F8100087F8100087F81000810 +:108050007F8100087F8100087F8100087F81000800 +:108060007F8100087F8100087F8100087F810008F0 +:108070007F8100087F8100087F8100087F810008E0 +:108080007F8100087F8100087F8100087F810008D0 +:108090007F8100087F8100087F8100087F810008C0 +:1080A0007F8100087F8100087F8100087F810008B0 +:1080B0007F8100087F8100087F8100087F810008A0 +:1080C0007F8100087F8100087F8100087F81000890 +:1080D0007F8100087F8100087F8100087F81000880 +:1080E0007F8100087F8100087F8100087F81000870 +:1080F0007F8100087F8100087F8100080000000068 +:108100007F810008000000007F8100087F81000857 +:108110007F8100087F8100087F8100087F8100083F +:108120007F8100087F8100087F8100087F8100082F +:108130007F8100087F8100087F8100087F8100081F +:108140007F8100087F8100087F8100087F8100080F +:10815000DFF80CD000F018F800480047B1830008A1 +:10816000882000200648804706480047FEE7FEE7D3 +:10817000FEE7FEE7FEE7FEE7FEE7FEE7FEE7FEE7D7 +:10818000F181000851810008064C074D06E0E068C7 +:1081900040F0010394E8070098471034AC42F6D34E +:1081A000FFF7DAFF98850008B885000800BFFEE7F2 +:1081B000704700BFFEE700BFFEE7704710B500281C +:1081C00007DA0A07140E054A00F00F031B1FD454E8 +:1081D00003E00A07130E024A135410BD18ED00E025 +:1081E00000E400E07047704710B500F053F810BD90 +:1081F00010B51548006840F00100134908600846B2 +:108200004068124908401049486008460068104913 +:1082100008400D4908600846006820F48020086086 +:10822000084640680B490840074948600020C8627A +:108230000846006808490840034908604FF47F0079 +:10824000886000F07DF910BD001002400C00FFE0D6 +:10825000FFFFF6FEFFFF00DFFFFFF6EA00BFFEE7CD +:1082600002E008C8121F08C1002AFAD170477047FF +:10827000002001E001C1121F002AFBD1704700005D +:108280000349086000BF024909680029FBD1704713 +:10829000000000200448006820B103480068401E28 +:1082A00001490860704700000000002010B5044636 +:1082B0000B4931F8140000F0C1F80A4951F8243094 +:1082C000094951F824000322102100F027F805483D +:1082D00050F82400044951F82410486110BD0000F2 +:1082E000480000201800002008000020034951F831 +:1082F0002010034A52F820205161704718000020D6 +:1083000008000020034951F82010034A52F82020A9 +:10831000116170471800002008000020F0B50446E5 +:1083200016460025002201F00F0511F0100F00D0B5 +:108330003543002018E0012787401F4212D02268F1 +:108340004FEA800C0F2707FA0CF7BA43870005FAAB +:1083500007F73A43282901D1636102E0482900D197 +:1083600023612260471CB8B20828E4D308201CE02F +:10837000012787401F4216D06268A0F108074FEA24 +:10838000870C0F2707FA0CF7BA43A0F10807BF00C4 +:1083900005FA07F73A43282901D1636102E0482929 +:1083A00000D123616260471CB8B21028E0D3F0BD51 +:1083B0004FF40041080300F037F80020FFF776FF84 +:1083C0000120FFF773FF0220FFF770FF0320FFF784 +:1083D0006DFF00F0B9F826E00020FFF793FFC820FA +:1083E000FFF74EFF0120FFF78DFFC820FFF748FF82 +:1083F0000220FFF787FFC820FFF742FF0320FFF7A7 +:1084000081FFC820FFF73CFF0020FFF76FFF01202E +:10841000FFF76CFF0220FFF769FF0320FFF766FFFD +:10842000C820FFF72DFFD7E7024A0A400243024B5C +:108430001A60704780FFFF1F08ED00E0064901EB5E +:108440009011096800F01F0301229A401143024A6B +:1084500002EB9012116070470010024000200021D2 +:10846000324A126842F48032304B1A6000BF401C1E +:108470002E4A126802F4003119B9A0F57F42FF3A82 +:10848000F5D12A4A126812F4003F01D100BFFEE77D +:10849000264A5268254B5A601A4652685A601A4654 +:1084A000526842F480625A601A465268204B1A4061 +:1084B0001E4B5A601A4652681E4B1A431B4B5A6099 +:1084C0001A46D26A1C4B1A40184BDA621A46D26A14 +:1084D0001A4B1A43154BDA621A46126842F0806250 +:1084E0001A6000BF114A126812F0006FFAD00F4AEA +:1084F000126842F080720D4B1A6000BF0B4A12687E +:1085000012F0007FFAD0094A526822F00302074BAA +:108510005A601A46526842F002025A6000BF034A8B +:10852000526812F0080FFAD07047000000100240A5 +:10853000FFFFC3DF0000292000F0FEFF4906010015 +:1085400010B5FFF78BFF10BD10B5124800684FF44F +:108550007A71B0FBF1F4601EB0F1807F01D301208D +:108560000FE0601E4FF0E02148610F214FF0FF3017 +:10857000FFF724FE00204FF0E0218861072008610A +:10858000002008B100BFFEE70021481EFFF716FEDD +:1085900010BD000004000020B88500080000002085 +:1085A00088000000608200084086000888000020E3 +:1085B00000200000708200080000000000F36F0639 +:1085C0000010014000100140001801400018014057 +:1085D0000100000004000000010000000200000093 +:1085E0000E06110700020000040000000004000055 +:1085F00008000000000801400008014002060206D1 +:1086000004060406060606060008014000100140A4 +:10861000000C0140010000000020000000400000AC +:10862000020604060306000001000000002000000E +:1086300000400000000201000D0E06282800000086 +:04000005080081511D +:00000001FF diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.c new file mode 100644 index 0000000..537d75d --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.c @@ -0,0 +1,979 @@ +/*! + \file lcd_font.c + \brief this file provides the LCD font + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "lcd_font.h" +#include + +const uint16_t ASCII16x24_Table [] = { +/* Space ' ' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '!' */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '"' */ + 0x0000, 0x0000, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, 0x00CC, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '#' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C60, 0x0C60, + 0x0C60, 0x0630, 0x0630, 0x1FFE, 0x1FFE, 0x0630, 0x0738, 0x0318, + 0x1FFE, 0x1FFE, 0x0318, 0x0318, 0x018C, 0x018C, 0x018C, 0x0000, +/* '$' */ + 0x0000, 0x0080, 0x03E0, 0x0FF8, 0x0E9C, 0x1C8C, 0x188C, 0x008C, + 0x0098, 0x01F8, 0x07E0, 0x0E80, 0x1C80, 0x188C, 0x188C, 0x189C, + 0x0CB8, 0x0FF0, 0x03E0, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, +/* '%' */ + 0x0000, 0x0000, 0x0000, 0x180E, 0x0C1B, 0x0C11, 0x0611, 0x0611, + 0x0311, 0x0311, 0x019B, 0x018E, 0x38C0, 0x6CC0, 0x4460, 0x4460, + 0x4430, 0x4430, 0x4418, 0x6C18, 0x380C, 0x0000, 0x0000, 0x0000, +/* '&' */ + 0x0000, 0x01E0, 0x03F0, 0x0738, 0x0618, 0x0618, 0x0330, 0x01F0, + 0x00F0, 0x00F8, 0x319C, 0x330E, 0x1E06, 0x1C06, 0x1C06, 0x3F06, + 0x73FC, 0x21F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ''' */ + 0x0000, 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '(' */ + 0x0000, 0x0200, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x0060, 0x0060, + 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0060, 0x0060, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0200, 0x0000, +/* ')' */ + 0x0000, 0x0020, 0x0060, 0x00C0, 0x0180, 0x0180, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0300, 0x0300, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0020, 0x0000, +/* '*' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x06D8, 0x07F8, 0x01E0, 0x0330, 0x0738, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '+' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x3FFC, 0x3FFC, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ',' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, +/* '-' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x07E0, 0x07E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '.' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '/' */ + 0x0000, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, + 0x0300, 0x0380, 0x0180, 0x0180, 0x0180, 0x00C0, 0x00C0, 0x00C0, + 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '0' */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x180C, 0x180C, 0x180C, + 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '1' */ + 0x0000, 0x0100, 0x0180, 0x01C0, 0x01F0, 0x0198, 0x0188, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '2' */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x1800, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '3' */ + 0x0000, 0x01E0, 0x07F8, 0x0E18, 0x0C0C, 0x0C0C, 0x0C00, 0x0600, + 0x03C0, 0x07C0, 0x0C00, 0x1800, 0x1800, 0x180C, 0x180C, 0x0C18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '4' */ + 0x0000, 0x0C00, 0x0E00, 0x0F00, 0x0F00, 0x0D80, 0x0CC0, 0x0C60, + 0x0C60, 0x0C30, 0x0C18, 0x0C0C, 0x3FFC, 0x3FFC, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '5' */ + 0x0000, 0x0FF8, 0x0FF8, 0x0018, 0x0018, 0x000C, 0x03EC, 0x07FC, + 0x0E1C, 0x1C00, 0x1800, 0x1800, 0x1800, 0x180C, 0x0C1C, 0x0E18, + 0x07F8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '6' */ + 0x0000, 0x07C0, 0x0FF0, 0x1C38, 0x1818, 0x0018, 0x000C, 0x03CC, + 0x0FEC, 0x0E3C, 0x1C1C, 0x180C, 0x180C, 0x180C, 0x1C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '7' */ + 0x0000, 0x1FFC, 0x1FFC, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0380, + 0x0180, 0x01C0, 0x00C0, 0x00E0, 0x0060, 0x0060, 0x0070, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '8' */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C18, 0x0C18, 0x0C18, 0x0638, + 0x07F0, 0x07F0, 0x0C18, 0x180C, 0x180C, 0x180C, 0x180C, 0x0C38, + 0x0FF8, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '9' */ + 0x0000, 0x03E0, 0x07F0, 0x0E38, 0x0C1C, 0x180C, 0x180C, 0x180C, + 0x1C1C, 0x1E38, 0x1BF8, 0x19E0, 0x1800, 0x0C00, 0x0C00, 0x0E1C, + 0x07F8, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ':' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ';' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0180, 0x0180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0180, 0x0180, 0x0100, 0x0100, 0x0080, 0x0000, 0x0000, 0x0000, +/* '<' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1000, 0x1C00, 0x0F80, 0x03E0, 0x00F8, 0x0018, 0x00F8, 0x03E0, + 0x0F80, 0x1C00, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '=' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1FF8, 0x0000, 0x0000, 0x0000, 0x1FF8, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '>' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0038, 0x01F0, 0x07C0, 0x1F00, 0x1800, 0x1F00, 0x07C0, + 0x01F0, 0x0038, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '?' */ + 0x0000, 0x03E0, 0x0FF8, 0x0C18, 0x180C, 0x180C, 0x1800, 0x0C00, + 0x0600, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x0000, 0x0000, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '@' */ + 0x0000, 0x0000, 0x07E0, 0x1818, 0x2004, 0x29C2, 0x4A22, 0x4411, + 0x4409, 0x4409, 0x4409, 0x2209, 0x1311, 0x0CE2, 0x4002, 0x2004, + 0x1818, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'A' */ + 0x0000, 0x0380, 0x0380, 0x06C0, 0x06C0, 0x06C0, 0x0C60, 0x0C60, + 0x1830, 0x1830, 0x1830, 0x3FF8, 0x3FF8, 0x701C, 0x600C, 0x600C, + 0xC006, 0xC006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'B' */ + 0x0000, 0x03FC, 0x0FFC, 0x0C0C, 0x180C, 0x180C, 0x180C, 0x0C0C, + 0x07FC, 0x0FFC, 0x180C, 0x300C, 0x300C, 0x300C, 0x300C, 0x180C, + 0x1FFC, 0x07FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'C' */ + 0x0000, 0x07C0, 0x1FF0, 0x3838, 0x301C, 0x700C, 0x6006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x6006, 0x700C, 0x301C, + 0x1FF0, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'D' */ + 0x0000, 0x03FE, 0x0FFE, 0x0E06, 0x1806, 0x1806, 0x3006, 0x3006, + 0x3006, 0x3006, 0x3006, 0x3006, 0x3006, 0x1806, 0x1806, 0x0E06, + 0x0FFE, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'E' */ + 0x0000, 0x3FFC, 0x3FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x1FFC, 0x1FFC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x3FFC, 0x3FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'F' */ + 0x0000, 0x3FF8, 0x3FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'G' */ + 0x0000, 0x0FE0, 0x3FF8, 0x783C, 0x600E, 0xE006, 0xC007, 0x0003, + 0x0003, 0xFE03, 0xFE03, 0xC003, 0xC007, 0xC006, 0xC00E, 0xF03C, + 0x3FF8, 0x0FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'H' */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x3FFC, 0x3FFC, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'I' */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'J' */ + 0x0000, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0618, 0x0618, 0x0738, + 0x03F0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'K' */ + 0x0000, 0x3006, 0x1806, 0x0C06, 0x0606, 0x0306, 0x0186, 0x00C6, + 0x0066, 0x0076, 0x00DE, 0x018E, 0x0306, 0x0606, 0x0C06, 0x1806, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'L' */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, + 0x1FF8, 0x1FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'M' */ + 0x0000, 0xE00E, 0xF01E, 0xF01E, 0xF01E, 0xD836, 0xD836, 0xD836, + 0xD836, 0xCC66, 0xCC66, 0xCC66, 0xC6C6, 0xC6C6, 0xC6C6, 0xC6C6, + 0xC386, 0xC386, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'N' */ + 0x0000, 0x300C, 0x301C, 0x303C, 0x303C, 0x306C, 0x306C, 0x30CC, + 0x30CC, 0x318C, 0x330C, 0x330C, 0x360C, 0x360C, 0x3C0C, 0x3C0C, + 0x380C, 0x300C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'O' */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xC003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xC003, 0x6006, 0x700E, 0x381C, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'P' */ + 0x0000, 0x0FFC, 0x1FFC, 0x380C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x180C, 0x1FFC, 0x07FC, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'Q' */ + 0x0000, 0x07E0, 0x1FF8, 0x381C, 0x700E, 0x6006, 0xE003, 0xC003, + 0xC003, 0xC003, 0xC003, 0xC003, 0xE007, 0x6306, 0x3F0E, 0x3C1C, + 0x3FF8, 0xF7E0, 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'R' */ + 0x0000, 0x0FFE, 0x1FFE, 0x3806, 0x3006, 0x3006, 0x3006, 0x3806, + 0x1FFE, 0x07FE, 0x0306, 0x0606, 0x0C06, 0x1806, 0x1806, 0x3006, + 0x3006, 0x6006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'S' */ + 0x0000, 0x03E0, 0x0FF8, 0x0C1C, 0x180C, 0x180C, 0x000C, 0x001C, + 0x03F8, 0x0FE0, 0x1E00, 0x3800, 0x3006, 0x3006, 0x300E, 0x1C1C, + 0x0FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'T' */ + 0x0000, 0x7FFE, 0x7FFE, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'U' */ + 0x0000, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, + 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x300C, 0x1818, + 0x1FF8, 0x07E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'V' */ + 0x0000, 0x6003, 0x3006, 0x3006, 0x3006, 0x180C, 0x180C, 0x180C, + 0x0C18, 0x0C18, 0x0E38, 0x0630, 0x0630, 0x0770, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'W' */ + 0x0000, 0x6003, 0x61C3, 0x61C3, 0x61C3, 0x3366, 0x3366, 0x3366, + 0x3366, 0x3366, 0x3366, 0x1B6C, 0x1B6C, 0x1B6C, 0x1A2C, 0x1E3C, + 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'X' */ + 0x0000, 0xE00F, 0x700C, 0x3018, 0x1830, 0x0C70, 0x0E60, 0x07C0, + 0x0380, 0x0380, 0x03C0, 0x06E0, 0x0C70, 0x1C30, 0x1818, 0x300C, + 0x600E, 0xE007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'Y' */ + 0x0000, 0xC003, 0x6006, 0x300C, 0x381C, 0x1838, 0x0C30, 0x0660, + 0x07E0, 0x03C0, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'Z' */ + 0x0000, 0x7FFC, 0x7FFC, 0x6000, 0x3000, 0x1800, 0x0C00, 0x0600, + 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, 0x000C, 0x0006, + 0x7FFE, 0x7FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '[' */ + 0x0000, 0x03E0, 0x03E0, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, + 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x03E0, 0x03E0, 0x0000, +/* '\' */ + 0x0000, 0x0030, 0x0030, 0x0060, 0x0060, 0x0060, 0x00C0, 0x00C0, + 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0300, 0x0300, 0x0300, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ']' */ + 0x0000, 0x03E0, 0x03E0, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, + 0x0300, 0x0300, 0x0300, 0x0300, 0x0300, 0x03E0, 0x03E0, 0x0000, +/* '^' */ + 0x0000, 0x0000, 0x01C0, 0x01C0, 0x0360, 0x0360, 0x0360, 0x0630, + 0x0630, 0x0C18, 0x0C18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '_' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* ''' */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'a' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F0, 0x07F8, + 0x0C1C, 0x0C0C, 0x0F00, 0x0FF0, 0x0CF8, 0x0C0C, 0x0C0C, 0x0F1C, + 0x0FF8, 0x18F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'b' */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'c' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x07F0, + 0x0E30, 0x0C18, 0x0018, 0x0018, 0x0018, 0x0018, 0x0C18, 0x0E30, + 0x07F0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'd' */ + 0x0000, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'e' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1FF8, 0x1FF8, 0x0018, 0x0018, 0x1838, 0x1C30, + 0x0FF0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'f' */ + 0x0000, 0x0F80, 0x0FC0, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'g' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0DE0, 0x0FF8, + 0x0E18, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0C0C, 0x0E18, + 0x0FF8, 0x0DE0, 0x0C00, 0x0C0C, 0x061C, 0x07F8, 0x01F0, 0x0000, +/* 'h' */ + 0x0000, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x07D8, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'i' */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'j' */ + 0x0000, 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00F8, 0x0078, 0x0000, +/* 'k' */ + 0x0000, 0x000C, 0x000C, 0x000C, 0x000C, 0x000C, 0x0C0C, 0x060C, + 0x030C, 0x018C, 0x00CC, 0x006C, 0x00FC, 0x019C, 0x038C, 0x030C, + 0x060C, 0x0C0C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'l' */ + 0x0000, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'm' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C7C, 0x7EFF, + 0xE3C7, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, 0xC183, + 0xC183, 0xC183, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'n' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0798, 0x0FF8, + 0x1C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, + 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'o' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C0, 0x0FF0, + 0x0C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C30, + 0x0FF0, 0x03C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'p' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0FF8, + 0x0C38, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x0C38, + 0x0FF8, 0x03D8, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, +/* 'q' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1BC0, 0x1FF0, + 0x1C30, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C30, + 0x1FF0, 0x1BC0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0000, +/* 'r' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07B0, 0x03F0, + 0x0070, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 's' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03F0, + 0x0E38, 0x0C18, 0x0038, 0x03F0, 0x07C0, 0x0C00, 0x0C18, 0x0E38, + 0x07F0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 't' */ + 0x0000, 0x0000, 0x0080, 0x00C0, 0x00C0, 0x00C0, 0x07F0, 0x07F0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x07C0, 0x0780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'u' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, + 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1C38, + 0x1FF0, 0x19E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'v' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x180C, 0x0C18, + 0x0C18, 0x0C18, 0x0630, 0x0630, 0x0630, 0x0360, 0x0360, 0x0360, + 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'w' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x41C1, 0x41C1, + 0x61C3, 0x6363, 0x6363, 0x6363, 0x3636, 0x3636, 0x3636, 0x1C1C, + 0x1C1C, 0x1C1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'x' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x381C, 0x1C38, + 0x0C30, 0x0660, 0x0360, 0x0360, 0x0360, 0x0360, 0x0660, 0x0C30, + 0x1C38, 0x381C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* 'y' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3018, 0x1830, + 0x1830, 0x1870, 0x0C60, 0x0C60, 0x0CE0, 0x06C0, 0x06C0, 0x0380, + 0x0380, 0x0380, 0x0180, 0x0180, 0x01C0, 0x00F0, 0x0070, 0x0000, +/* 'z' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, + 0x0C00, 0x0600, 0x0300, 0x0180, 0x00C0, 0x0060, 0x0030, 0x0018, + 0x1FFC, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +/* '{' */ + 0x0000, 0x0300, 0x0180, 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x00C0, + 0x00C0, 0x0060, 0x0060, 0x0030, 0x0060, 0x0040, 0x00C0, 0x00C0, + 0x00C0, 0x00C0, 0x00C0, 0x00C0, 0x0180, 0x0300, 0x0000, 0x0000, +/* '|' */ + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0000, +/* '}' */ + 0x0000, 0x0060, 0x00C0, 0x01C0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0300, 0x0300, 0x0600, 0x0300, 0x0100, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x00C0, 0x0060, 0x0000, 0x0000, +/* '~' */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x10F0, 0x1FF8, 0x0F08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}; + +const uint16_t ASCII8x16_Table[] = { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, +0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00, +0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xCE,0xD6,0xD6,0xE6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x0E,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00, +0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, +0x00,0x00,0xC6,0xC6,0x6C,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00, +0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00, +0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00, +0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0xDC,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00, +0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00, +0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00, +0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x62,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00, +0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00, +0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, +0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00}; + +const uint16_t ASCII12x12_Table [] = { + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x0000,0x2000,0x0000,0x0000, + 0x0000,0x5000,0x5000,0x5000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0900,0x0900,0x1200,0x7f00,0x1200,0x7f00,0x1200,0x2400,0x2400,0x0000,0x0000, + 0x1000,0x3800,0x5400,0x5000,0x5000,0x3800,0x1400,0x5400,0x5400,0x3800,0x1000,0x0000, + 0x0000,0x3080,0x4900,0x4900,0x4a00,0x32c0,0x0520,0x0920,0x0920,0x10c0,0x0000,0x0000, + 0x0000,0x0c00,0x1200,0x1200,0x1400,0x1800,0x2500,0x2300,0x2300,0x1d80,0x0000,0x0000, + 0x0000,0x4000,0x4000,0x4000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0800,0x1000,0x1000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x1000,0x1000, + 0x0000,0x4000,0x2000,0x2000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x2000,0x2000, + 0x0000,0x2000,0x7000,0x2000,0x5000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0800,0x0800,0x7f00,0x0800,0x0800,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2000,0x2000,0x4000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2000,0x0000,0x0000, + 0x0000,0x1000,0x1000,0x1000,0x2000,0x2000,0x2000,0x2000,0x4000,0x4000,0x0000,0x0000, + 0x0000,0x1000,0x2800,0x4400,0x4400,0x4400,0x4400,0x4400,0x2800,0x1000,0x0000,0x0000, + 0x0000,0x1000,0x3000,0x5000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x0000,0x0000, + 0x0000,0x3000,0x4800,0x4400,0x0400,0x0800,0x1000,0x2000,0x4000,0x7c00,0x0000,0x0000, + 0x0000,0x3000,0x4800,0x0400,0x0800,0x1000,0x0800,0x4400,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x0800,0x1800,0x1800,0x2800,0x2800,0x4800,0x7c00,0x0800,0x0800,0x0000,0x0000, + 0x0000,0x3c00,0x2000,0x4000,0x7000,0x4800,0x0400,0x4400,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x1800,0x2400,0x4000,0x5000,0x6800,0x4400,0x4400,0x2800,0x1000,0x0000,0x0000, + 0x0000,0x7c00,0x0400,0x0800,0x1000,0x1000,0x1000,0x2000,0x2000,0x2000,0x0000,0x0000, + 0x0000,0x1000,0x2800,0x4400,0x2800,0x1000,0x2800,0x4400,0x2800,0x1000,0x0000,0x0000, + 0x0000,0x1000,0x2800,0x4400,0x4400,0x2c00,0x1400,0x0400,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x2000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x2000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2000,0x2000,0x4000, + 0x0000,0x0000,0x0400,0x0800,0x3000,0x4000,0x3000,0x0800,0x0400,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x7c00,0x0000,0x0000,0x7c00,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x4000,0x2000,0x1800,0x0400,0x1800,0x2000,0x4000,0x0000,0x0000,0x0000, + 0x0000,0x3800,0x6400,0x4400,0x0400,0x0800,0x1000,0x1000,0x0000,0x1000,0x0000,0x0000, + 0x0000,0x0f80,0x1040,0x2ea0,0x51a0,0x5120,0x5120,0x5120,0x5320,0x4dc0,0x2020,0x1040, + 0x0000,0x0800,0x1400,0x1400,0x1400,0x2200,0x3e00,0x2200,0x4100,0x4100,0x0000,0x0000, + 0x0000,0x3c00,0x2200,0x2200,0x2200,0x3c00,0x2200,0x2200,0x2200,0x3c00,0x0000,0x0000, + 0x0000,0x0e00,0x1100,0x2100,0x2000,0x2000,0x2000,0x2100,0x1100,0x0e00,0x0000,0x0000, + 0x0000,0x3c00,0x2200,0x2100,0x2100,0x2100,0x2100,0x2100,0x2200,0x3c00,0x0000,0x0000, + 0x0000,0x3e00,0x2000,0x2000,0x2000,0x3e00,0x2000,0x2000,0x2000,0x3e00,0x0000,0x0000, + 0x0000,0x3e00,0x2000,0x2000,0x2000,0x3c00,0x2000,0x2000,0x2000,0x2000,0x0000,0x0000, + 0x0000,0x0e00,0x1100,0x2100,0x2000,0x2700,0x2100,0x2100,0x1100,0x0e00,0x0000,0x0000, + 0x0000,0x2100,0x2100,0x2100,0x2100,0x3f00,0x2100,0x2100,0x2100,0x2100,0x0000,0x0000, + 0x0000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x0000,0x0000, + 0x0000,0x0800,0x0800,0x0800,0x0800,0x0800,0x0800,0x4800,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x2200,0x2400,0x2800,0x2800,0x3800,0x2800,0x2400,0x2400,0x2200,0x0000,0x0000, + 0x0000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x3e00,0x0000,0x0000, + 0x0000,0x2080,0x3180,0x3180,0x3180,0x2a80,0x2a80,0x2a80,0x2a80,0x2480,0x0000,0x0000, + 0x0000,0x2100,0x3100,0x3100,0x2900,0x2900,0x2500,0x2300,0x2300,0x2100,0x0000,0x0000, + 0x0000,0x0c00,0x1200,0x2100,0x2100,0x2100,0x2100,0x2100,0x1200,0x0c00,0x0000,0x0000, + 0x0000,0x3c00,0x2200,0x2200,0x2200,0x3c00,0x2000,0x2000,0x2000,0x2000,0x0000,0x0000, + 0x0000,0x0c00,0x1200,0x2100,0x2100,0x2100,0x2100,0x2100,0x1600,0x0d00,0x0100,0x0000, + 0x0000,0x3e00,0x2100,0x2100,0x2100,0x3e00,0x2400,0x2200,0x2100,0x2080,0x0000,0x0000, + 0x0000,0x1c00,0x2200,0x2200,0x2000,0x1c00,0x0200,0x2200,0x2200,0x1c00,0x0000,0x0000, + 0x0000,0x3e00,0x0800,0x0800,0x0800,0x0800,0x0800,0x0800,0x0800,0x0800,0x0000,0x0000, + 0x0000,0x2100,0x2100,0x2100,0x2100,0x2100,0x2100,0x2100,0x1200,0x0c00,0x0000,0x0000, + 0x0000,0x4100,0x4100,0x2200,0x2200,0x2200,0x1400,0x1400,0x1400,0x0800,0x0000,0x0000, + 0x0000,0x4440,0x4a40,0x2a40,0x2a80,0x2a80,0x2a80,0x2a80,0x2a80,0x1100,0x0000,0x0000, + 0x0000,0x4100,0x2200,0x1400,0x1400,0x0800,0x1400,0x1400,0x2200,0x4100,0x0000,0x0000, + 0x0000,0x4100,0x2200,0x2200,0x1400,0x0800,0x0800,0x0800,0x0800,0x0800,0x0000,0x0000, + 0x0000,0x7e00,0x0200,0x0400,0x0800,0x1000,0x1000,0x2000,0x4000,0x7e00,0x0000,0x0000, + 0x0000,0x3000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000, + 0x0000,0x4000,0x4000,0x2000,0x2000,0x2000,0x2000,0x2000,0x1000,0x1000,0x0000,0x0000, + 0x0000,0x6000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000, + 0x0000,0x1000,0x2800,0x2800,0x2800,0x4400,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7e00, + 0x4000,0x2000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3800,0x4400,0x0400,0x3c00,0x4400,0x4400,0x3c00,0x0000,0x0000, + 0x0000,0x4000,0x4000,0x5800,0x6400,0x4400,0x4400,0x4400,0x6400,0x5800,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3000,0x4800,0x4000,0x4000,0x4000,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x0400,0x0400,0x3400,0x4c00,0x4400,0x4400,0x4400,0x4c00,0x3400,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3800,0x4400,0x4400,0x7c00,0x4000,0x4400,0x3800,0x0000,0x0000, + 0x0000,0x6000,0x4000,0xe000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3400,0x4c00,0x4400,0x4400,0x4400,0x4c00,0x3400,0x0400,0x4400, + 0x0000,0x4000,0x4000,0x5800,0x6400,0x4400,0x4400,0x4400,0x4400,0x4400,0x0000,0x0000, + 0x0000,0x4000,0x0000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x0000,0x0000, + 0x0000,0x4000,0x0000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000, + 0x0000,0x4000,0x4000,0x4800,0x5000,0x6000,0x5000,0x5000,0x4800,0x4800,0x0000,0x0000, + 0x0000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x4000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x5200,0x6d00,0x4900,0x4900,0x4900,0x4900,0x4900,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x5800,0x6400,0x4400,0x4400,0x4400,0x4400,0x4400,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3800,0x4400,0x4400,0x4400,0x4400,0x4400,0x3800,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x5800,0x6400,0x4400,0x4400,0x4400,0x6400,0x5800,0x4000,0x4000, + 0x0000,0x0000,0x0000,0x3400,0x4c00,0x4400,0x4400,0x4400,0x4c00,0x3400,0x0400,0x0400, + 0x0000,0x0000,0x0000,0x5000,0x6000,0x4000,0x4000,0x4000,0x4000,0x4000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x3000,0x4800,0x4000,0x3000,0x0800,0x4800,0x3000,0x0000,0x0000, + 0x0000,0x4000,0x4000,0xe000,0x4000,0x4000,0x4000,0x4000,0x4000,0x6000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x4400,0x4400,0x4400,0x4400,0x4400,0x4c00,0x3400,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x4400,0x4400,0x2800,0x2800,0x2800,0x2800,0x1000,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x4900,0x4900,0x5500,0x5500,0x5500,0x5500,0x2200,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x4400,0x2800,0x2800,0x1000,0x2800,0x2800,0x4400,0x0000,0x0000, + 0x0000,0x0000,0x0000,0x4400,0x4400,0x2800,0x2800,0x2800,0x1000,0x1000,0x1000,0x1000, + 0x0000,0x0000,0x0000,0x7800,0x0800,0x1000,0x2000,0x2000,0x4000,0x7800,0x0000,0x0000, + 0x0000,0x1000,0x2000,0x2000,0x2000,0x2000,0x4000,0x2000,0x2000,0x2000,0x2000,0x2000, + 0x0000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000, + 0x0000,0x4000,0x2000,0x2000,0x2000,0x2000,0x1000,0x2000,0x2000,0x2000,0x2000,0x2000, + 0x0000,0x0000,0x0000,0x0000,0x7400,0x5800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, + 0x0000,0x0000,0x7000,0x5000,0x5000,0x5000,0x5000,0x5000,0x5000,0x7000,0x0000,0x0000}; + +const uint16_t ASCII8x12_Table [] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x00, + 0x00,0x00,0x00,0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x14,0x14,0x3e,0x14,0x28,0x7c,0x28,0x28,0x00, + 0x00,0x00,0x10,0x38,0x54,0x50,0x38,0x14,0x14,0x54,0x38,0x10, + 0x00,0x00,0x00,0x44,0xa8,0xa8,0x50,0x14,0x1a,0x2a,0x24,0x00, + 0x00,0x00,0x00,0x20,0x50,0x50,0x20,0xe8,0x98,0x98,0x60,0x00, + 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x00,0x00,0x00,0x40,0xe0,0x40,0xa0,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, + 0x00,0x00,0x00,0x20,0x20,0x20,0x40,0x40,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x60,0x00, + 0x00,0x00,0x00,0x20,0x60,0xa0,0x20,0x20,0x20,0x20,0x20,0x00, + 0x00,0x00,0x00,0x60,0x90,0x10,0x10,0x20,0x40,0x80,0xf0,0x00, + 0x00,0x00,0x00,0x60,0x90,0x10,0x60,0x10,0x10,0x90,0x60,0x00, + 0x00,0x00,0x00,0x10,0x30,0x50,0x50,0x90,0xf8,0x10,0x10,0x00, + 0x00,0x00,0x00,0x70,0x40,0x80,0xe0,0x10,0x10,0x90,0x60,0x00, + 0x00,0x00,0x00,0x60,0x90,0x80,0xa0,0xd0,0x90,0x90,0x60,0x00, + 0x00,0x00,0x00,0xf0,0x10,0x20,0x20,0x20,0x40,0x40,0x40,0x00, + 0x00,0x00,0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x90,0x60,0x00, + 0x00,0x00,0x00,0x60,0x90,0x90,0xb0,0x50,0x10,0x90,0x60,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x40,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x10,0x60,0x80,0x60,0x10,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0xf0,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x60,0x80,0x00,0x00, + 0x00,0x00,0x00,0x60,0x90,0x10,0x20,0x40,0x40,0x00,0x40,0x00, + 0x00,0x00,0x00,0x1c,0x22,0x5b,0xa5,0xa5,0xa5,0xa5,0x9e,0x41, + 0x00,0x00,0x00,0x20,0x50,0x50,0x50,0x50,0x70,0x88,0x88,0x00, + 0x00,0x00,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0x88,0xf0,0x00, + 0x00,0x00,0x00,0x38,0x44,0x84,0x80,0x80,0x84,0x44,0x38,0x00, + 0x00,0x00,0x00,0xe0,0x90,0x88,0x88,0x88,0x88,0x90,0xe0,0x00, + 0x00,0x00,0x00,0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x00, + 0x00,0x00,0x00,0x78,0x40,0x40,0x70,0x40,0x40,0x40,0x40,0x00, + 0x00,0x00,0x00,0x38,0x44,0x84,0x80,0x9c,0x84,0x44,0x38,0x00, + 0x00,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x88,0x00, + 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x90,0x90,0x60,0x00, + 0x00,0x00,0x00,0x88,0x90,0xa0,0xe0,0xa0,0x90,0x90,0x88,0x00, + 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0,0x00, + 0x00,0x00,0x00,0x82,0xc6,0xc6,0xaa,0xaa,0xaa,0xaa,0x92,0x00, + 0x00,0x00,0x00,0x84,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x84,0x00, + 0x00,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x84,0x48,0x30,0x00, + 0x00,0x00,0x00,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x84,0x58,0x34,0x04, + 0x00,0x00,0x00,0x78,0x44,0x44,0x78,0x50,0x48,0x44,0x42,0x00, + 0x00,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x88,0x70,0x00, + 0x00,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00, + 0x00,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0x84,0x48,0x30,0x00, + 0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x50,0x50,0x50,0x20,0x00, + 0x00,0x00,0x00,0x92,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0x44,0x00, + 0x00,0x00,0x00,0x84,0x48,0x48,0x30,0x30,0x48,0x48,0x84,0x00, + 0x00,0x00,0x00,0x88,0x50,0x50,0x20,0x20,0x20,0x20,0x20,0x00, + 0x00,0x00,0x00,0xf8,0x08,0x10,0x20,0x20,0x40,0x80,0xf8,0x00, + 0x00,0x00,0x00,0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20,0x00, + 0x00,0x00,0x00,0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x00,0x00,0x00,0x40,0xa0,0xa0,0xa0,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8, + 0x00,0x00,0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xe0,0x10,0x70,0x90,0x90,0x70,0x00, + 0x00,0x00,0x00,0x80,0x80,0xa0,0xd0,0x90,0x90,0xd0,0xa0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0x80,0x80,0x90,0x60,0x00, + 0x00,0x00,0x00,0x10,0x10,0x50,0xb0,0x90,0x90,0xb0,0x50,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0xf0,0x80,0x90,0x60,0x00, + 0x00,0x00,0x00,0xc0,0x80,0xc0,0x80,0x80,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x00,0x00,0x50,0xb0,0x90,0x90,0xb0,0x50,0x10, + 0x00,0x00,0x00,0x80,0x80,0xa0,0xd0,0x90,0x90,0x90,0x90,0x00, + 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x80,0x80,0x90,0xa0,0xc0,0xa0,0x90,0x90,0x00, + 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x00,0x00,0xa6,0xda,0x92,0x92,0x92,0x92,0x00, + 0x00,0x00,0x00,0x00,0x00,0xa0,0xd0,0x90,0x90,0x90,0x90,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x60,0x00, + 0x00,0x00,0x00,0x00,0x00,0xa0,0xd0,0x90,0x90,0xd0,0xa0,0x80, + 0x00,0x00,0x00,0x00,0x00,0x50,0xb0,0x90,0x90,0xb0,0x50,0x10, + 0x00,0x00,0x00,0x00,0x00,0xa0,0xc0,0x80,0x80,0x80,0x80,0x00, + 0x00,0x00,0x00,0x00,0x00,0xe0,0x90,0x40,0x20,0x90,0x60,0x00, + 0x00,0x00,0x00,0x80,0x80,0xc0,0x80,0x80,0x80,0x80,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x90,0x90,0xb0,0x50,0x00, + 0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x50,0x20,0x00, + 0x00,0x00,0x00,0x00,0x00,0x92,0xaa,0xaa,0xaa,0xaa,0x44,0x00, + 0x00,0x00,0x00,0x00,0x00,0x88,0x50,0x20,0x20,0x50,0x88,0x00, + 0x00,0x00,0x00,0x00,0x00,0x88,0x50,0x50,0x50,0x20,0x20,0x20, + 0x00,0x00,0x00,0x00,0x00,0xf0,0x10,0x20,0x40,0x80,0xf0,0x00, + 0x00,0x00,0x00,0xc0,0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x00,0x00,0x00,0xc0,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0xe8,0xb0,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xe0,0xa0,0xa0,0xa0,0xa0,0xa0,0xe0,0x00}; + +const uint16_t ASCII8x8_Table [] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, + 0xa0, 0xa0, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x24, 0xfe, 0x48, 0xfc, 0x48, 0x48, + 0x38, 0x54, 0x50, 0x38, 0x14, 0x14, 0x54, 0x38, + 0x44, 0xa8, 0xa8, 0x50, 0x14, 0x1a, 0x2a, 0x24, + 0x10, 0x28, 0x28, 0x10, 0x74, 0x4c, 0x4c, 0x30, + 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, + 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, + 0x00, 0x00, 0x24, 0x18, 0x3c, 0x18, 0x24, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x08, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x20, + 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, + 0x08, 0x18, 0x28, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x38, 0x44, 0x00, 0x04, 0x08, 0x10, 0x20, 0x7c, + 0x18, 0x24, 0x04, 0x18, 0x04, 0x04, 0x24, 0x18, + 0x04, 0x0c, 0x14, 0x24, 0x44, 0x7e, 0x04, 0x04, + 0x3c, 0x20, 0x20, 0x38, 0x04, 0x04, 0x24, 0x18, + 0x18, 0x24, 0x20, 0x38, 0x24, 0x24, 0x24, 0x18, + 0x3c, 0x04, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, + 0x18, 0x24, 0x24, 0x18, 0x24, 0x24, 0x24, 0x18, + 0x18, 0x24, 0x24, 0x24, 0x1c, 0x04, 0x24, 0x18, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x10, 0x00, + 0x00, 0x00, 0x04, 0x18, 0x20, 0x18, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x18, 0x04, 0x18, 0x20, 0x00, + 0x18, 0x24, 0x04, 0x08, 0x10, 0x10, 0x00, 0x10, + 0x3c, 0x42, 0x99, 0xa5, 0xa5, 0x9d, 0x42, 0x38, + 0x38, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, + 0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x44, 0x78, + 0x1c, 0x22, 0x42, 0x40, 0x40, 0x42, 0x22, 0x1c, + 0x70, 0x48, 0x44, 0x44, 0x44, 0x44, 0x48, 0x70, + 0x7c, 0x40, 0x40, 0x7c, 0x40, 0x40, 0x40, 0x7c, + 0x3c, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x20, + 0x1c, 0x22, 0x42, 0x40, 0x4e, 0x42, 0x22, 0x1c, + 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x44, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x24, 0x24, 0x18, + 0x44, 0x48, 0x50, 0x70, 0x50, 0x48, 0x48, 0x44, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, + 0x82, 0xc6, 0xc6, 0xaa, 0xaa, 0xaa, 0xaa, 0x92, + 0x42, 0x62, 0x52, 0x52, 0x4a, 0x4a, 0x46, 0x42, + 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, + 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, + 0x18, 0x24, 0x42, 0x42, 0x42, 0x42, 0x2c, 0x1a, + 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x42, + 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x44, 0x38, + 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, + 0x44, 0x44, 0x28, 0x28, 0x28, 0x28, 0x28, 0x10, + 0x92, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, + 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, + 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x7c, 0x04, 0x08, 0x10, 0x10, 0x20, 0x40, 0x7c, + 0x1c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1c, + 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, + 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1c, + 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x04, 0x1c, 0x24, 0x24, 0x1c, + 0x20, 0x20, 0x28, 0x34, 0x24, 0x24, 0x34, 0x28, + 0x00, 0x00, 0x18, 0x24, 0x20, 0x20, 0x24, 0x18, + 0x04, 0x04, 0x14, 0x2c, 0x24, 0x24, 0x2c, 0x14, + 0x00, 0x00, 0x18, 0x24, 0x3c, 0x20, 0x24, 0x18, + 0x00, 0x18, 0x10, 0x10, 0x18, 0x10, 0x10, 0x10, + 0x00, 0x18, 0x24, 0x24, 0x18, 0x04, 0x24, 0x18, + 0x20, 0x20, 0x28, 0x34, 0x24, 0x24, 0x24, 0x24, + 0x10, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x28, 0x10, + 0x20, 0x20, 0x24, 0x28, 0x30, 0x28, 0x24, 0x24, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0xa6, 0xda, 0x92, 0x92, 0x92, 0x92, + 0x00, 0x00, 0x28, 0x34, 0x24, 0x24, 0x24, 0x24, + 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x18, + 0x00, 0x28, 0x34, 0x24, 0x38, 0x20, 0x20, 0x20, + 0x00, 0x14, 0x2c, 0x24, 0x1c, 0x04, 0x04, 0x04, + 0x00, 0x00, 0x2c, 0x30, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x18, 0x24, 0x10, 0x08, 0x24, 0x18, + 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x10, 0x18, + 0x00, 0x00, 0x24, 0x24, 0x24, 0x24, 0x2c, 0x14, + 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x28, 0x10, + 0x00, 0x00, 0x92, 0xaa, 0xaa, 0xaa, 0xaa, 0x44, + 0x00, 0x00, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, + 0x00, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x3c, 0x04, 0x08, 0x10, 0x20, 0x3c, + 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x10, 0x08, 0x08, 0x04, 0x08, 0x08, 0x10, + 0x00, 0x00, 0x00, 0x60, 0x92, 0x0c, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + +const unsigned char ASCII16[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* " " */ + 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x00, /* "!" */ + 0x00,0x00,0x6C,0x6C,0x24,0x24,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* """ */ + 0x00,0x24,0x24,0x24,0x24,0xFE,0x48,0x48,0x48,0x48,0xFC,0x90,0x90,0x90,0x90,0x00, /* "#" */ + 0x00,0x10,0x3C,0x54,0x92,0x90,0x50,0x38,0x14,0x12,0x12,0x92,0x54,0x78,0x10,0x00, /* "$" */ + 0x00,0x00,0x22,0x5C,0x94,0xA8,0x48,0x10,0x10,0x24,0x2A,0x52,0x54,0x88,0x00,0x00, /* "%" */ + 0x00,0x00,0x30,0x48,0x48,0x50,0x20,0x6E,0x54,0x94,0x8C,0x88,0x8A,0x74,0x00,0x00, /* "&" */ + 0x00,0x00,0x30,0x30,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "'" */ + 0x00,0x04,0x08,0x10,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0x10,0x10,0x08,0x04,0x00, /* "(" */ + 0x00,0x80,0x40,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x40,0x80,0x00, /* ")" */ + 0x00,0x00,0x00,0x00,0x10,0x54,0x38,0x10,0x38,0x54,0x10,0x00,0x00,0x00,0x00,0x00, /* "*" */ + 0x00,0x00,0x00,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00, /* "+" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20,0x00, /* "," */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "-" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00, /* "." */ + 0x00,0x00,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00,0x00, /* "/" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "0" */ + 0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00, /* "1" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x04,0x08,0x10,0x20,0x40,0x82,0x84,0xFC,0x00,0x00, /* "2" */ + 0x00,0x00,0x38,0x44,0x82,0x02,0x04,0x38,0x04,0x02,0x02,0x82,0x44,0x38,0x00,0x00, /* "3" */ + 0x00,0x00,0x04,0x0C,0x14,0x14,0x24,0x24,0x44,0x44,0xFE,0x04,0x04,0x0E,0x00,0x00, /* "4" */ + 0x00,0x00,0xFC,0x80,0x80,0x80,0xB8,0xC4,0x82,0x02,0x02,0x82,0x84,0x78,0x00,0x00, /* "5" */ + 0x00,0x00,0x3C,0x42,0x82,0x80,0xB8,0xC4,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "6" */ + 0x00,0x00,0x7E,0x42,0x82,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x10,0x10,0x00,0x00, /* "7" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "8" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x46,0x3A,0x02,0x82,0x44,0x38,0x00,0x00, /* "9" */ + 0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00, /* ":" */ + 0x00,0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20,0x00,0x00, /* ";" */ + 0x00,0x00,0x00,0x00,0x06,0x18,0x60,0x80,0x60,0x18,0x06,0x00,0x00,0x00,0x00,0x00, /* "<" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, /* "=" */ + 0x00,0x00,0x00,0x00,0xC0,0x30,0x0C,0x02,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00, /* ">" */ + 0x00,0x38,0x44,0x82,0x82,0x02,0x04,0x08,0x10,0x10,0x10,0x00,0x10,0x10,0x00,0x00, /* "?" */ + 0x00,0x00,0x38,0x44,0x82,0x9A,0xAA,0xAA,0xAA,0xAA,0xAA,0x96,0x80,0x42,0x3C,0x00, /* "@" */ + 0x00,0x00,0x10,0x10,0x10,0x28,0x28,0x28,0x44,0x44,0x7C,0x44,0x44,0xEE,0x00,0x00, /* "A" */ + 0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x42,0x42,0x42,0x42,0x42,0xFC,0x00,0x00, /* "B" */ + 0x00,0x00,0x3C,0x44,0x82,0x80,0x80,0x80,0x80,0x80,0x82,0x82,0x44,0x38,0x00,0x00, /* "C" */ + 0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00, /* "D" */ + 0x00,0x00,0xFC,0x44,0x42,0x40,0x44,0x7C,0x44,0x40,0x40,0x42,0x44,0xFC,0x00,0x00, /* "E" */ + 0x00,0x00,0xFC,0x44,0x42,0x40,0x44,0x7C,0x44,0x40,0x40,0x40,0x40,0xF0,0x00,0x00, /* "F" */ + 0x00,0x00,0x34,0x4C,0x82,0x80,0x80,0x80,0x8E,0x84,0x84,0x84,0x4C,0x34,0x00,0x00, /* "G" */ + 0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "H" */ + 0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00, /* "I" */ + 0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0x88,0x70,0x00,0x00, /* "J" */ + 0x00,0x00,0xEE,0x44,0x48,0x48,0x50,0x60,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00, /* "K" */ + 0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0x44,0xFC,0x00,0x00, /* "L" */ + 0x00,0x00,0xC6,0x44,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x44,0x44,0x44,0xEE,0x00,0x00, /* "M" */ + 0x00,0x00,0xCE,0x44,0x64,0x64,0x64,0x54,0x54,0x4C,0x4C,0x4C,0x44,0xE4,0x00,0x00, /* "N" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "O" */ + 0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x44,0x78,0x40,0x40,0x40,0x40,0xE0,0x00,0x00, /* "P" */ + 0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xBA,0x44,0x3C,0x02,0x00, /* "Q" */ + 0x00,0x00,0xF0,0x48,0x44,0x44,0x44,0x48,0x70,0x48,0x44,0x44,0x44,0xE6,0x00,0x00, /* "R" */ + 0x00,0x00,0x3C,0x44,0x82,0x80,0x40,0x30,0x0C,0x02,0x02,0x82,0x44,0x78,0x00,0x00, /* "S" */ + 0x00,0x00,0x7C,0x54,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "T" */ + 0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00, /* "U" */ + 0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x28,0x28,0x28,0x28,0x10,0x10,0x10,0x00,0x00, /* "V" */ + 0x00,0x00,0xEE,0x44,0x54,0x54,0x54,0x54,0x54,0x54,0x28,0x28,0x28,0x28,0x00,0x00, /* "W" */ + 0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x28,0x28,0x44,0x44,0xEE,0x00,0x00, /* "X" */ + 0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "Y" */ + 0x00,0x00,0x7E,0x44,0x84,0x08,0x08,0x10,0x20,0x20,0x40,0x82,0x84,0xFC,0x00,0x00, /* "Z" */ + 0x00,0x1C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1C,0x00, /* "[" */ + 0x00,0x00,0xEE,0x44,0x54,0x54,0xFE,0x54,0x54,0x54,0x28,0x28,0x28,0x28,0x00,0x00, /* "\" */ + 0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00, /* "]" */ + 0x00,0x30,0x48,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "^" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00, /* "_" */ + 0x00,0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "`" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x04,0x7C,0x84,0x84,0x8C,0x76,0x00,0x00, /* "a" */ + 0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x42,0x64,0x58,0x00,0x00, /* "b" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x80,0x80,0x80,0x80,0x44,0x38,0x00,0x00, /* "c" */ + 0x00,0x00,0x0C,0x04,0x04,0x04,0x34,0x4C,0x84,0x84,0x84,0x84,0x4C,0x36,0x00,0x00, /* "d" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x84,0x84,0xFC,0x80,0x80,0x84,0x78,0x00,0x00, /* "e" */ + 0x00,0x00,0x18,0x24,0x20,0x20,0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* "f" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x3A,0x44,0x44,0x78,0x80,0x7C,0x82,0x82,0x7C,0x00, /* "g" */ + 0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "h" */ + 0x00,0x00,0x10,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00, /* "i" */ + 0x00,0x00,0x10,0x10,0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00, /* "j" */ + 0x00,0x00,0xC0,0x40,0x40,0x40,0x5C,0x48,0x50,0x60,0x50,0x48,0x44,0xEE,0x00,0x00, /* "k" */ + 0x00,0x00,0x30,0x10,0x10,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x39,0x00,0x00, /* "l" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xD2,0x92,0x92,0x92,0x92,0x92,0xD6,0x00,0x00, /* "m" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x58,0xE4,0x44,0x44,0x44,0x44,0x44,0xEE,0x00,0x00, /* "n" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00, /* "o" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x64,0x58,0x40,0xE0,0x00, /* "p" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x4C,0x84,0x84,0x84,0x4C,0x34,0x04,0x0E,0x00, /* "q" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x30,0x20,0x20,0x20,0x20,0x20,0x70,0x00,0x00, /* "r" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x88,0x84,0x60,0x18,0x84,0x44,0x78,0x00,0x00, /* "s" */ + 0x00,0x00,0x00,0x20,0x20,0x20,0xF8,0x20,0x20,0x20,0x20,0x20,0x24,0x18,0x00,0x00, /* "t" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00, /* "u" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x28,0x10,0x10,0x00,0x00, /* "v" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x54,0x54,0x28,0x28,0x28,0x00,0x00, /* "w" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x28,0x10,0x10,0x28,0x44,0xEE,0x00,0x00, /* "x" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0xA0,0xC0,0x00, /* "y" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x88,0x10,0x20,0x42,0x84,0xFC,0x00,0x00, /* "z" */ + 0x00,0x0C,0x10,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x10,0x10,0x0C,0x00, /* "{" */ + 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, /* "|" */ + 0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x18,0x20,0x20,0x20,0x20,0x20,0x20,0xC0,0x00, /* "}" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* "~" */ + 0x00, +}; + +/* Digital tube font */ +const unsigned char sz32[]={ + /* "0" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00, + /* "1" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, + /* "2" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0xFF,0xF0,0x00,0x01,0xFF,0xE0,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xF8,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xFC,0x00,0x00,0x1F,0xFE,0x00, + /* "3" */ + 0x00,0x00,0x00,0x00,0x03,0xFF,0x80,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x7F,0x8C,0x00,0x01,0xFF,0xE0,0x00,0x01,0xFF,0xF0,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x18,0x00,0x00,0x7F,0x80,0x00,0x00,0xFF,0xC0,0x00,0x01,0xFF,0xC0,0x00,0x03,0xFF,0x80,0x00, + /* "4" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x03,0x00,0x03,0x00,0x03,0x80,0x07,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + /* "5" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x1F,0xE0,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xF8,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,0x00,0x3F,0xE0,0x00,0x00,0x7F,0xF0,0x00,0x00,0xFF,0xF0,0x00,0x01,0xFF,0xE0,0x00, + /* "6" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x00,0x00,0x3F,0xF8,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x1F,0xE0,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00, + /* "7" */ + 0x00,0x00,0x00,0x00,0x07,0xFF,0xE0,0x00,0x03,0xFF,0xC0,0x00,0x01,0xFF,0x88,0x00,0x00,0xFF,0x18,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00, + /* "8" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x03,0x00,0x03,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x01,0x80,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00, + /* "9" */ + 0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x1F,0xE0,0x00,0x01,0x80,0x06,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0xC0,0x0F,0x00,0x03,0x1F,0xE3,0x00,0x00,0x7F,0xF8,0x00,0x00,0x7F,0xFC,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x06,0x00,0x00,0x1F,0xE0,0x00,0x00,0x3F,0xF0,0x00,0x00,0x7F,0xF0,0x00,0x00,0xFF,0xE0,0x00, + /* "." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + /* ":" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + /* "%" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x06,0x00,0x0F,0xE0,0x06,0x00,0x00,0x00,0x0C,0x00,0x30,0x18,0x18,0x00,0x30,0x18,0x18,0x00,0x30,0x18,0x30,0x00,0x30,0x18,0x30,0x00,0x30,0x18,0x60,0x00,0x30,0x08,0xC0,0x00,0x07,0xC0,0xC0,0x00,0x0F,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x00,0x06,0x07,0xC0,0x00,0x06,0x30,0x18,0x00,0x0C,0x30,0x18,0x00,0x0C,0x30,0x18,0x00,0x18,0x30,0x18,0x00,0x30,0x30,0x18,0x00,0x30,0x30,0x18,0x00,0x60,0x00,0x00,0x00,0xC0,0x0F,0xE0,0x00,0xC0,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + /* "¡æ" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xE0,0x00,0x08,0x87,0xFC,0x00,0x08,0x8E,0x03,0x00,0x08,0x98,0x01,0x80,0x07,0x18,0x00,0x80,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x0C,0x03,0x00,0x00,0x07,0xFC,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + /* "-" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x7F,0xF0,0x00,0x00,0x7F,0xE0,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00, +}; + +font_struct font16x24 = +{ + ASCII16x24_Table, + 16, /* width */ + 24, /* height */ +}; + +font_struct font8x16 = +{ + ASCII8x16_Table, + 8, /* width */ + 16, /* height */ +}; + +font_struct font12x12 = +{ + ASCII12x12_Table, + 12, /* width */ + 12, /* height */ +}; + +font_struct font8x12 = +{ + ASCII8x12_Table, + 8, /* width */ + 12, /* height */ +}; + +font_struct font8x8 = +{ + ASCII8x8_Table, + 8, /* width */ + 8, /* height */ +}; diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.h new file mode 100644 index 0000000..8715432 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_font.h @@ -0,0 +1,77 @@ +/*! + \file lcd_font.h + \brief the header file of lcd_font.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef LCD_FONTS_H +#define LCD_FONTS_H + +#include + +typedef struct +{ + const uint16_t *table; + + uint16_t width; + uint16_t height; +} font_struct; + +typedef struct +{ + unsigned char index[3]; + char mask[32]; +} typefont_GB162; + +typedef struct +{ + unsigned char index[3]; + char mask[72]; +} typefont_GB242; + +#define hz16_num 100 +#define hz24_num 100 + +extern font_struct font16x24; +extern font_struct font12x12; +extern font_struct font8x16; +extern font_struct font8x12; +extern font_struct font8x8; + +extern const unsigned char ASCII16[]; +extern const unsigned char sz32[]; + +extern const typefont_GB162 hz16[]; +extern const typefont_GB242 hz24[]; + +#define LINE(x) ((x) * (((font_struct *)lcd_font_get())->height)) + +#endif /* LCD_FONTS_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.c new file mode 100644 index 0000000..ee3fb68 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.c @@ -0,0 +1,244 @@ +/*! + \file lcd_log.c + \brief this file provides all the LCD Log firmware functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "lcd_log.h" +#include "usb_lcd_conf.h" +#include + +LCD_LOG_line LCD_CacheBuffer[LCD_CACHE_DEPTH]; +uint32_t LCD_LineColor; +uint16_t LCD_CacheBuffer_xptr; +uint16_t LCD_CacheBuffer_yptr_top; +uint16_t LCD_CacheBuffer_yptr_bottom; + +uint16_t LCD_CacheBuffer_yptr_top_bak; +uint16_t LCD_CacheBuffer_yptr_bottom_bak; + +ControlStatus LCD_CacheBuffer_yptr_invert; +ControlStatus LCD_ScrollActive; +ControlStatus LCD_Lock; +ControlStatus LCD_Scrolled; +uint16_t LCD_ScrollBackStep; + +/*! + \brief initialize the LCD Log module + \param[in] none + \param[out] none + \retval none +*/ +void lcd_log_init (void) +{ + lcd_log_deinit(); + + lcd_clear(LCD_COLOR_BLACK); +} + +/*! + \brief de-initialize the LCD Log module + \param[in] none + \param[out] none + \retval none +*/ +void lcd_log_deinit (void) +{ + LCD_LineColor = LCD_LOG_TEXT_COLOR; + LCD_CacheBuffer_xptr = 0; + LCD_CacheBuffer_yptr_top = 0; + LCD_CacheBuffer_yptr_bottom = 0; + + LCD_CacheBuffer_yptr_top_bak = 0; + LCD_CacheBuffer_yptr_bottom_bak = 0; + + LCD_CacheBuffer_yptr_invert= ENABLE; + LCD_ScrollActive = DISABLE; + LCD_Lock = DISABLE; + LCD_Scrolled = DISABLE; + LCD_ScrollBackStep = 0; +} + +/*! + \brief display the application header (title) on the LCD screen + \param[in] ptitle: pointer to the string to be displayed + \param[in] start_x: x location + \param[out] none + \retval none +*/ +void lcd_log_header_set (uint8_t *ptitle, uint16_t start_x) +{ + lcd_font_set(&font8x16); + + lcd_text_color_set(LCD_COLOR_BLUE); + + lcd_rectangle_fill(LCD_HEADER_X, LCD_HEADER_Y, LCD_FLAG_WIDTH, LCD_FLAG_HEIGHT); + + lcd_background_color_set(LCD_COLOR_BLUE); + lcd_text_color_set(LCD_COLOR_RED); + + lcd_vertical_string_display(LCD_HEADER_LINE, start_x, ptitle); + + lcd_background_color_set(LCD_COLOR_BLACK); +} + +/*! + \brief display the application footer (status) on the LCD screen + \param[in] pstatus: pointer to the string to be displayed + \param[in] start_x: x location + \param[out] none + \retval none +*/ +void lcd_log_footer_set (uint8_t *pstatus, uint16_t start_x) +{ + lcd_text_color_set(LCD_COLOR_BLUE); + + lcd_rectangle_fill(LCD_FOOTER_X, LCD_FOOTER_Y, LCD_FLAG_WIDTH, LCD_FLAG_HEIGHT); + + lcd_background_color_set(LCD_COLOR_BLUE); + lcd_text_color_set(LCD_COLOR_RED); + + lcd_vertical_string_display(LCD_FOOTER_LINE, start_x, pstatus); + + lcd_background_color_set(LCD_COLOR_BLACK); +} + +/*! + \brief clear the text zone + \param[in] start_x, start_y, end_x, end_y: zone location + \param[out] none + \retval none +*/ +void lcd_log_textzone_clear (uint16_t start_x, + uint16_t start_y, + uint16_t width, + uint16_t height) +{ + lcd_rectangle_fill(start_x, start_y, width, height); +} + +/*! + \brief redirect the printf to the LCD + \param[in] ch: character to be displayed + \param[in] f: output file pointer + \param[out] none + \retval none +*/ +LCD_LOG_PUTCHAR +{ + font_struct *cFont = lcd_font_get(); + uint32_t idx; + + if (LCD_Lock == DISABLE) { + if (LCD_ScrollActive == ENABLE) { + LCD_CacheBuffer_yptr_bottom = LCD_CacheBuffer_yptr_bottom_bak; + LCD_CacheBuffer_yptr_top = LCD_CacheBuffer_yptr_top_bak; + LCD_ScrollActive = DISABLE; + LCD_Scrolled = DISABLE; + LCD_ScrollBackStep = 0; + } + + if ((LCD_CacheBuffer_xptr < LCD_FLAG_HEIGHT / cFont->width) && (ch != '\n')) { + if (ch != '\r') { + LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch; + } + } else { + if (LCD_CacheBuffer_yptr_top >= LCD_CacheBuffer_yptr_bottom) { + if (LCD_CacheBuffer_yptr_invert == DISABLE) { + LCD_CacheBuffer_yptr_top++; + + if (LCD_CacheBuffer_yptr_top == LCD_CACHE_DEPTH) { + LCD_CacheBuffer_yptr_top = 0; + } + } else { + LCD_CacheBuffer_yptr_invert= DISABLE; + } + } + + for (idx = LCD_CacheBuffer_xptr; idx < LCD_FLAG_HEIGHT / cFont->width; idx++) { + LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = ' '; + } + + LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].color = LCD_LineColor; + LCD_CacheBuffer_xptr = 0; + LCD_LOG_UpdateDisplay(); + LCD_CacheBuffer_yptr_bottom ++; + + if (LCD_CacheBuffer_yptr_bottom == LCD_CACHE_DEPTH) { + LCD_CacheBuffer_yptr_bottom = 0; + LCD_CacheBuffer_yptr_top = 1; + LCD_CacheBuffer_yptr_invert = ENABLE; + } + + if ((ch != '\n') && (ch != '\r')) { + LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch; + } + } + } + + return ch; +} + +/*! + \brief update the text area display + \param[in] none + \param[out] none + \retval none +*/ +void LCD_LOG_UpdateDisplay (void) +{ + uint8_t cnt = 0 ; + uint16_t length = 0 ; + uint16_t ptr = 0, index = 0; + + font_struct *cFont = lcd_font_get(); + + if ((LCD_CacheBuffer_yptr_bottom < (YWINDOW_SIZE - 1)) && (LCD_CacheBuffer_yptr_bottom >= LCD_CacheBuffer_yptr_top)) { + lcd_text_color_set (LCD_CacheBuffer[cnt + LCD_CacheBuffer_yptr_bottom].color); + lcd_vertical_string_display ((YWINDOW_MIN + LCD_CacheBuffer_yptr_bottom) * cFont->height, 0, (uint8_t *)(LCD_CacheBuffer[cnt + LCD_CacheBuffer_yptr_bottom].line)); + } else { + if (LCD_CacheBuffer_yptr_bottom < LCD_CacheBuffer_yptr_top) { + /* Virtual length for rolling */ + length = LCD_CACHE_DEPTH + LCD_CacheBuffer_yptr_bottom ; + } else { + length = LCD_CacheBuffer_yptr_bottom; + } + + ptr = length - YWINDOW_SIZE + 1; + + for (cnt = 0; cnt < YWINDOW_SIZE; cnt ++) { + index = (cnt + ptr ) % LCD_CACHE_DEPTH; + + lcd_text_color_set (LCD_CacheBuffer[index].color); + lcd_vertical_string_display ((cnt + YWINDOW_MIN) * cFont->height, 0, (uint8_t *)(LCD_CacheBuffer[index].line)); + } + } +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.h new file mode 100644 index 0000000..93ff21c --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/LCD_common/lcd_log.h @@ -0,0 +1,98 @@ +/*! + \file lcd_log.h + \brief the header file of the lcd_log.c file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef __LCD_LOG_H +#define __LCD_LOG_H + +#include "usb_conf.h" +#include "usb_lcd_conf.h" +#include + +extern uint32_t LCD_LineColor; + +#define LCD_ErrLog(...) do { \ + LCD_LineColor = LCD_COLOR_RED;\ + printf("ERROR: ") ;\ + printf(__VA_ARGS__);\ + LCD_LineColor = LCD_LOG_DEFAULT_COLOR;\ + }while (0) + +#define LCD_UsrLog(...) do { \ + LCD_LineColor = LCD_LOG_TEXT_COLOR;\ + printf(__VA_ARGS__);\ + } while (0) + + +#define LCD_DbgLog(...) do { \ + LCD_LineColor = LCD_COLOR_RED;\ + printf(__VA_ARGS__);\ + LCD_LineColor = LCD_LOG_DEFAULT_COLOR;\ + }while (0) + +#define LCD_DevInformation(...) do { \ + LCD_LineColor = LCD_COLOR_BLUE; \ + printf(__VA_ARGS__); \ + LCD_LineColor = LCD_LOG_DEFAULT_COLOR; \ + }while(0) + +#if (LCD_SCROLL_ENABLED == 1) + #define LCD_CACHE_DEPTH (YWINDOW_SIZE + CACHE_SIZE) +#else + #define LCD_CACHE_DEPTH YWINDOW_SIZE +#endif + +typedef struct _LCD_LOG_line +{ + uint8_t line[128]; + uint32_t color; +}LCD_LOG_line; + +/* function declarations */ +/* initialize the LCD Log module */ +void lcd_log_init (void); +/* de-initialize the LCD Log module */ +void lcd_log_deinit (void); +/* display the application header (title) on the LCD screen */ +void lcd_log_header_set (uint8_t *ptitle, uint16_t start_x); +/* display the application footer (status) on the LCD screen */ +void lcd_log_footer_set (uint8_t *pstatus, uint16_t start_x); +/* clear the text zone */ +void lcd_log_textzone_clear (uint16_t start_x, + uint16_t start_y, + uint16_t end_x, + uint16_t end_y); + +void LCD_LOG_UpdateDisplay (void); + +#endif /* __LCD_LOG_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00history.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00history.txt new file mode 100644 index 0000000..db12a9e --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00history.txt @@ -0,0 +1,330 @@ +---------------------------------------------------------------------------- + Revision history of FatFs module +---------------------------------------------------------------------------- + +R0.00 (February 26, 2006) + + Prototype. + + + +R0.01 (April 29, 2006) + + The first release. + + + +R0.02 (June 01, 2006) + + Added FAT12 support. + Removed unbuffered mode. + Fixed a problem on small (<32M) partition. + + + +R0.02a (June 10, 2006) + + Added a configuration option (_FS_MINIMUM). + + + +R0.03 (September 22, 2006) + + Added f_rename(). + Changed option _FS_MINIMUM to _FS_MINIMIZE. + + + +R0.03a (December 11, 2006) + + Improved cluster scan algorithm to write files fast. + Fixed f_mkdir() creates incorrect directory on FAT32. + + + +R0.04 (February 04, 2007) + + Added f_mkfs(). + Supported multiple drive system. + Changed some interfaces for multiple drive system. + Changed f_mountdrv() to f_mount(). + + + +R0.04a (April 01, 2007) + + Supported multiple partitions on a physical drive. + Added a capability of extending file size to f_lseek(). + Added minimization level 3. + Fixed an endian sensitive code in f_mkfs(). + + + +R0.04b (May 05, 2007) + + Added a configuration option _USE_NTFLAG. + Added FSINFO support. + Fixed DBCS name can result FR_INVALID_NAME. + Fixed short seek (<= csize) collapses the file object. + + + +R0.05 (August 25, 2007) + + Changed arguments of f_read(), f_write() and f_mkfs(). + Fixed f_mkfs() on FAT32 creates incorrect FSINFO. + Fixed f_mkdir() on FAT32 creates incorrect directory. + + + +R0.05a (February 03, 2008) + + Added f_truncate() and f_utime(). + Fixed off by one error at FAT sub-type determination. + Fixed btr in f_read() can be mistruncated. + Fixed cached sector is not flushed when create and close without write. + + + +R0.06 (April 01, 2008) + + Added fputc(), fputs(), fprintf() and fgets(). + Improved performance of f_lseek() on moving to the same or following cluster. + + + +R0.07 (April 01, 2009) + + Merged Tiny-FatFs as a configuration option. (_FS_TINY) + Added long file name feature. (_USE_LFN) + Added multiple code page feature. (_CODE_PAGE) + Added re-entrancy for multitask operation. (_FS_REENTRANT) + Added auto cluster size selection to f_mkfs(). + Added rewind option to f_readdir(). + Changed result code of critical errors. + Renamed string functions to avoid name collision. + + + +R0.07a (April 14, 2009) + + Septemberarated out OS dependent code on reentrant cfg. + Added multiple sector size feature. + + + +R0.07c (June 21, 2009) + + Fixed f_unlink() can return FR_OK on error. + Fixed wrong cache control in f_lseek(). + Added relative path feature. + Added f_chdir() and f_chdrive(). + Added proper case conversion to extended character. + + + +R0.07e (November 03, 2009) + + Septemberarated out configuration options from ff.h to ffconf.h. + Fixed f_unlink() fails to remove a sub-directory on _FS_RPATH. + Fixed name matching error on the 13 character boundary. + Added a configuration option, _LFN_UNICODE. + Changed f_readdir() to return the SFN with always upper case on non-LFN cfg. + + + +R0.08 (May 15, 2010) + + Added a memory configuration option. (_USE_LFN = 3) + Added file lock feature. (_FS_SHARE) + Added fast seek feature. (_USE_FASTSEEK) + Changed some types on the API, XCHAR->TCHAR. + Changed .fname in the FILINFO structure on Unicode cfg. + String functions support UTF-8 encoding files on Unicode cfg. + + + +R0.08a (August 16, 2010) + + Added f_getcwd(). (_FS_RPATH = 2) + Added sector erase feature. (_USE_ERASE) + Moved file lock semaphore table from fs object to the bss. + Fixed f_mkfs() creates wrong FAT32 volume. + + + +R0.08b (January 15, 2011) + + Fast seek feature is also applied to f_read() and f_write(). + f_lseek() reports required table size on creating CLMP. + Extended format syntax of f_printf(). + Ignores duplicated directory separators in given path name. + + + +R0.09 (September 06, 2011) + + f_mkfs() supports multiple partition to complete the multiple partition feature. + Added f_fdisk(). + + + +R0.09a (August 27, 2012) + + Changed f_open() and f_opendir() reject null object pointer to avoid crash. + Changed option name _FS_SHARE to _FS_LOCK. + Fixed assertion failure due to OS/2 EA on FAT12/16 volume. + + + +R0.09b (January 24, 2013) + + Added f_setlabel() and f_getlabel(). + + + +R0.10 (October 02, 2013) + + Added selection of character encoding on the file. (_STRF_ENCODE) + Added f_closedir(). + Added forced full FAT scan for f_getfree(). (_FS_NOFSINFO) + Added forced mount feature with changes of f_mount(). + Improved behavior of volume auto detection. + Improved write throughput of f_puts() and f_printf(). + Changed argument of f_chdrive(), f_mkfs(), disk_read() and disk_write(). + Fixed f_write() can be truncated when the file size is close to 4GB. + Fixed f_open(), f_mkdir() and f_setlabel() can return incorrect value on error. + + + +R0.10a (January 15, 2014) + + Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID) + Added a configuration option of minimum sector size. (_MIN_SS) + 2nd argument of f_rename() can have a drive number and it will be ignored. + Fixed f_mount() with forced mount fails when drive number is >= 1. (appeared at R0.10) + Fixed f_close() invalidates the file object without volume lock. + Fixed f_closedir() returns but the volume lock is left acquired. (appeared at R0.10) + Fixed creation of an entry with LFN fails on too many SFN collisions. (appeared at R0.07) + + + +R0.10b (May 19, 2014) + + Fixed a hard error in the disk I/O layer can collapse the directory entry. + Fixed LFN entry is not deleted when delete/rename an object with lossy converted SFN. (appeared at R0.07) + + + +R0.10c (November 09, 2014) + + Added a configuration option for the platforms without RTC. (_FS_NORTC) + Changed option name _USE_ERASE to _USE_TRIM. + Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel(). (appeared at R0.09b) + Fixed a potential problem of FAT access that can appear on disk error. + Fixed null pointer dereference on attempting to delete the root direcotry. (appeared at R0.08) + + + +R0.11 (February 09, 2015) + + Added f_findfirst(), f_findnext() and f_findclose(). (_USE_FIND) + Fixed f_unlink() does not remove cluster chain of the file. (appeared at R0.10c) + Fixed _FS_NORTC option does not work properly. (appeared at R0.10c) + + + +R0.11a (September 05, 2015) + + Fixed wrong media change can lead a deadlock at thread-safe configuration. + Added code page 771, 860, 861, 863, 864, 865 and 869. (_CODE_PAGE) + Removed some code pages actually not exist on the standard systems. (_CODE_PAGE) + Fixed errors in the case conversion teble of code page 437 and 850 (ff.c). + Fixed errors in the case conversion teble of Unicode (cc*.c). + + + +R0.12 (April 12, 2016) + + Added support for exFAT file system. (_FS_EXFAT) + Added f_expand(). (_USE_EXPAND) + Changed some members in FINFO structure and behavior of f_readdir(). + Added an option _USE_CHMOD. + Removed an option _WORD_ACCESS. + Fixed errors in the case conversion table of Unicode (cc*.c). + + + +R0.12a (July 10, 2016) + + Added support for creating exFAT volume with some changes of f_mkfs(). + Added a file open method FA_OPEN_APPEND. An f_lseek() following f_open() is no longer needed. + f_forward() is available regardless of _FS_TINY. + Fixed f_mkfs() creates wrong volume. (appeared at R0.12) + Fixed wrong memory read in create_name(). (appeared at R0.12) + Fixed compilation fails at some configurations, _USE_FASTSEEK and _USE_FORWARD. + + + +R0.12b (September 04, 2016) + + Made f_rename() be able to rename objects with the same name but case. + Fixed an error in the case conversion teble of code page 866. (ff.c) + Fixed writing data is truncated at the file offset 4GiB on the exFAT volume. (appeared at R0.12) + Fixed creating a file in the root directory of exFAT volume can fail. (appeared at R0.12) + Fixed f_mkfs() creating exFAT volume with too small cluster size can collapse unallocated memory. (appeared at R0.12) + Fixed wrong object name can be returned when read directory at Unicode cfg. (appeared at R0.12) + Fixed large file allocation/removing on the exFAT volume collapses allocation bitmap. (appeared at R0.12) + Fixed some internal errors in f_expand() and f_lseek(). (appeared at R0.12) + + + +R0.12c (March 04, 2017) + + Improved write throughput at the fragmented file on the exFAT volume. + Made memory usage for exFAT be able to be reduced as decreasing _MAX_LFN. + Fixed successive f_getfree() can return wrong count on the FAT12/16 volume. (appeared at R0.12) + Fixed configuration option _VOLUMES cannot be set 10. (appeared at R0.10c) + + + +R0.13 (May 21, 2017) + + Changed heading character of configuration keywords "_" to "FF_". + Removed ASCII-only configuration, FF_CODE_PAGE = 1. Use FF_CODE_PAGE = 437 instead. + Added f_setcp(), run-time code page configuration. (FF_CODE_PAGE = 0) + Improved cluster allocation time on stretch a deep buried cluster chain. + Improved processing time of f_mkdir() with large cluster size by using FF_USE_LFN = 3. + Improved NoFatChain flag of the fragmented file to be set after it is truncated and got contiguous. + Fixed archive attribute is left not set when a file on the exFAT volume is renamed. (appeared at R0.12) + Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c) + Fixed creating a file can fail when a new cluster allocation to the exFAT directory occures. (appeared at R0.12c) + + + +R0.13a (October 14, 2017) + + Added support for UTF-8 encoding on the API. (FF_LFN_UNICODE = 2) + Added options for file name output buffer. (FF_LFN_BUF, FF_SFN_BUF). + Added dynamic memory allocation option for working buffer of f_mkfs() and f_fdisk(). + Fixed f_fdisk() and f_mkfs() create the partition table with wrong CHS parameters. (appeared at R0.09) + Fixed f_unlink() can cause lost clusters at fragmented file on the exFAT volume. (appeared at R0.12c) + Fixed f_setlabel() rejects some valid characters for exFAT volume. (appeared at R0.12) + + + +R0.13b (April 07, 2018) + + Added support for UTF-32 encoding on the API. (FF_LFN_UNICODE = 3) + Added support for Unix style volume ID. (FF_STR_VOLUME_ID = 2) + Fixed accesing any object on the exFAT root directory beyond the cluster boundary can fail. (appeared at R0.12c) + Fixed f_setlabel() does not reject some invalid characters. (appeared at R0.09b) + + + +R0.13c (October 14, 2018) + Supported stdint.h for C99 and later. (integer.h was included in ff.h) + Fixed reading a directory gets infinite loop when the last directory entry is not empty. (appeared at R0.12) + Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12) + Fixed f_getcwd() cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b) + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00readme.txt new file mode 100644 index 0000000..dcccbdb --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/00readme.txt @@ -0,0 +1,21 @@ +FatFs Module Source Files R0.13c + + +FILES + + 00readme.txt This file. + 00history.txt Revision history. + ff.c FatFs module. + ffconf.h Configuration file of FatFs module. + ff.h Common include file for FatFs and application module. + diskio.h Common include file for FatFs and disk I/O module. + diskio.c An example of glue function to attach existing disk I/O module to FatFs. + ffunicode.c Optional Unicode utility functions. + ffsystem.c An example of optional O/S related functions. + + + Low level disk I/O module is not included in this archive because the FatFs + module is only a generic file system layer and it does not depend on any specific + storage device. You need to provide a low level disk I/O module written to + control the storage device that attached to the target system. + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/diskio.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/diskio.h new file mode 100644 index 0000000..4c145f5 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/diskio.h @@ -0,0 +1,79 @@ +/*-----------------------------------------------------------------------/ +/ Low level disk interface modlue include file (C)ChaN, 2014 / +/-----------------------------------------------------------------------*/ + +#ifndef _DISKIO_DEFINED +#define _DISKIO_DEFINED + +#ifdef __cplusplus +extern "C" { +#endif + +#define _USE_WRITE 1 /* 1: Enable disk_write function */ +#define _USE_IOCTL 1 /* 1: Enable disk_ioctl function */ + +#include "ff.h" + +/* Status of Disk Functions */ +typedef BYTE DSTATUS; + +/* Results of Disk Functions */ +typedef enum { + RES_OK = 0, /* 0: Successful */ + RES_ERROR, /* 1: R/W Error */ + RES_WRPRT, /* 2: Write Protected */ + RES_NOTRDY, /* 3: Not Ready */ + RES_PARERR /* 4: Invalid Parameter */ +} DRESULT; + + +/*---------------------------------------*/ +/* Prototypes for disk control functions */ + + +DSTATUS disk_initialize (BYTE pdrv); +DSTATUS disk_status (BYTE pdrv); +DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); +DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); +DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); +DWORD get_fattime (void); + +/* Disk Status Bits (DSTATUS) */ + +#define STA_NOINIT 0x01 /* Drive not initialized */ +#define STA_NODISK 0x02 /* No medium in the drive */ +#define STA_PROTECT 0x04 /* Write protected */ + + +/* Command code for disk_ioctrl fucntion */ + +/* Generic command (Used by FatFs) */ +#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ +#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ +#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ + +/* Generic command (Not used by FatFs) */ +#define CTRL_POWER 5 /* Get/Set power status */ +#define CTRL_LOCK 6 /* Lock/Unlock media removal */ +#define CTRL_EJECT 7 /* Eject media */ +#define CTRL_FORMAT 8 /* Create physical format on the media */ + +/* MMC/SDC specific ioctl command */ +#define MMC_GET_TYPE 10 /* Get card type */ +#define MMC_GET_CSD 11 /* Get CSD */ +#define MMC_GET_CID 12 /* Get CID */ +#define MMC_GET_OCR 13 /* Get OCR */ +#define MMC_GET_SDSTAT 14 /* Get SD status */ + +/* ATA/CF specific ioctl command */ +#define ATA_GET_REV 20 /* Get F/W revision */ +#define ATA_GET_MODEL 21 /* Get model name */ +#define ATA_GET_SN 22 /* Get serial number */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/fattime.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/fattime.h new file mode 100644 index 0000000..94b7068 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/fattime.h @@ -0,0 +1,7 @@ +#ifndef FATTIME_H_ + +#include "integer.h" + +DWORD get_fattime (void); + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff.h new file mode 100644 index 0000000..a0792b2 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff.h @@ -0,0 +1,405 @@ +/*----------------------------------------------------------------------------/ +/ FatFs - Generic FAT Filesystem module R0.13c / +/-----------------------------------------------------------------------------/ +/ +/ Copyright (C) 2018, ChaN, all right reserved. +/ +/ FatFs module is an open source software. Redistribution and use of FatFs in +/ source and binary forms, with or without modification, are permitted provided +/ that the following condition is met: + +/ 1. Redistributions of source code must retain the above copyright notice, +/ this condition and the following disclaimer. +/ +/ This software is provided by the copyright holder and contributors "AS IS" +/ and any warranties related to this software are DISCLAIMED. +/ The copyright owner or contributors be NOT LIABLE for any damages caused +/ by use of this software. +/ +/----------------------------------------------------------------------------*/ + + +#ifndef FF_DEFINED +#define FF_DEFINED 86604 /* Revision ID */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ffconf.h" /* FatFs configuration options */ + +#if FF_DEFINED != FFCONF_DEF +#error Wrong configuration file (ffconf.h). +#endif + + +/* Integer types used for FatFs API */ + +#if defined(_WIN32) /* Main development platform */ +#define FF_INTDEF 2 +#include +typedef unsigned __int64 QWORD; +#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */ +#define FF_INTDEF 2 +#include +typedef unsigned int UINT; /* int must be 16-bit or 32-bit */ +typedef unsigned char BYTE; /* char must be 8-bit */ +typedef uint16_t WORD; /* 16-bit unsigned integer */ +typedef uint16_t WCHAR; /* 16-bit unsigned integer */ +typedef uint32_t DWORD; /* 32-bit unsigned integer */ +typedef uint64_t QWORD; /* 64-bit unsigned integer */ +#else /* Earlier than C99 */ +#define FF_INTDEF 1 +typedef unsigned int UINT; /* int must be 16-bit or 32-bit */ +typedef unsigned char BYTE; /* char must be 8-bit */ +typedef unsigned short WORD; /* 16-bit unsigned integer */ +typedef unsigned short WCHAR; /* 16-bit unsigned integer */ +typedef unsigned long DWORD; /* 32-bit unsigned integer */ +#endif + + +/* Definitions of volume management */ + +#if FF_MULTI_PARTITION /* Multiple partition configuration */ +typedef struct { + BYTE pd; /* Physical drive number */ + BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */ +} PARTITION; +extern PARTITION VolToPart[]; /* Volume - Partition resolution table */ +#endif + +#if FF_STR_VOLUME_ID +#ifndef FF_VOLUME_STRS +extern const char* VolumeStr[FF_VOLUMES]; /* User defied volume ID */ +#endif +#endif + + + +/* Type of path name strings on FatFs API */ + +#ifndef _INC_TCHAR +#define _INC_TCHAR + +#if FF_USE_LFN && FF_LFN_UNICODE == 1 /* Unicode in UTF-16 encoding */ +typedef WCHAR TCHAR; +#define _T(x) L ## x +#define _TEXT(x) L ## x +#elif FF_USE_LFN && FF_LFN_UNICODE == 2 /* Unicode in UTF-8 encoding */ +typedef char TCHAR; +#define _T(x) u8 ## x +#define _TEXT(x) u8 ## x +#elif FF_USE_LFN && FF_LFN_UNICODE == 3 /* Unicode in UTF-32 encoding */ +typedef DWORD TCHAR; +#define _T(x) U ## x +#define _TEXT(x) U ## x +#elif FF_USE_LFN && (FF_LFN_UNICODE < 0 || FF_LFN_UNICODE > 3) +#error Wrong FF_LFN_UNICODE setting +#else /* ANSI/OEM code in SBCS/DBCS */ +typedef char TCHAR; +#define _T(x) x +#define _TEXT(x) x +#endif + +#endif + + + +/* Type of file size variables */ + +#if FF_FS_EXFAT +#if FF_INTDEF != 2 +#error exFAT feature wants C99 or later +#endif +typedef QWORD FSIZE_t; +#else +typedef DWORD FSIZE_t; +#endif + + + +/* Filesystem object structure (FATFS) */ + +typedef struct { + BYTE fs_type; /* Filesystem type (0:not mounted) */ + BYTE pdrv; /* Associated physical drive */ + BYTE n_fats; /* Number of FATs (1 or 2) */ + BYTE wflag; /* win[] flag (b0:dirty) */ + BYTE fsi_flag; /* FSINFO flags (b7:disabled, b0:dirty) */ + WORD id; /* Volume mount ID */ + WORD n_rootdir; /* Number of root directory entries (FAT12/16) */ + WORD csize; /* Cluster size [sectors] */ +#if FF_MAX_SS != FF_MIN_SS + WORD ssize; /* Sector size (512, 1024, 2048 or 4096) */ +#endif +#if FF_USE_LFN + WCHAR* lfnbuf; /* LFN working buffer */ +#endif +#if FF_FS_EXFAT + BYTE* dirbuf; /* Directory entry block scratchpad buffer for exFAT */ +#endif +#if FF_FS_REENTRANT + FF_SYNC_t sobj; /* Identifier of sync object */ +#endif +#if !FF_FS_READONLY + DWORD last_clst; /* Last allocated cluster */ + DWORD free_clst; /* Number of free clusters */ +#endif +#if FF_FS_RPATH + DWORD cdir; /* Current directory start cluster (0:root) */ +#if FF_FS_EXFAT + DWORD cdc_scl; /* Containing directory start cluster (invalid when cdir is 0) */ + DWORD cdc_size; /* b31-b8:Size of containing directory, b7-b0: Chain status */ + DWORD cdc_ofs; /* Offset in the containing directory (invalid when cdir is 0) */ +#endif +#endif + DWORD n_fatent; /* Number of FAT entries (number of clusters + 2) */ + DWORD fsize; /* Size of an FAT [sectors] */ + DWORD volbase; /* Volume base sector */ + DWORD fatbase; /* FAT base sector */ + DWORD dirbase; /* Root directory base sector/cluster */ + DWORD database; /* Data base sector */ +#if FF_FS_EXFAT + DWORD bitbase; /* Allocation bitmap base sector */ +#endif + DWORD winsect; /* Current sector appearing in the win[] */ + BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */ +} FATFS; + + + +/* Object ID and allocation information (FFOBJID) */ + +typedef struct { + FATFS* fs; /* Pointer to the hosting volume of this object */ + WORD id; /* Hosting volume mount ID */ + BYTE attr; /* Object attribute */ + BYTE stat; /* Object chain status (b1-0: =0:not contiguous, =2:contiguous, =3:fragmented in this session, b2:sub-directory stretched) */ + DWORD sclust; /* Object data start cluster (0:no cluster or root directory) */ + FSIZE_t objsize; /* Object size (valid when sclust != 0) */ +#if FF_FS_EXFAT + DWORD n_cont; /* Size of first fragment - 1 (valid when stat == 3) */ + DWORD n_frag; /* Size of last fragment needs to be written to FAT (valid when not zero) */ + DWORD c_scl; /* Containing directory start cluster (valid when sclust != 0) */ + DWORD c_size; /* b31-b8:Size of containing directory, b7-b0: Chain status (valid when c_scl != 0) */ + DWORD c_ofs; /* Offset in the containing directory (valid when file object and sclust != 0) */ +#endif +#if FF_FS_LOCK + UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */ +#endif +} FFOBJID; + + + +/* File object structure (FIL) */ + +typedef struct { + FFOBJID obj; /* Object identifier (must be the 1st member to detect invalid object pointer) */ + BYTE flag; /* File status flags */ + BYTE err; /* Abort flag (error code) */ + FSIZE_t fptr; /* File read/write pointer (Zeroed on file open) */ + DWORD clust; /* Current cluster of fpter (invalid when fptr is 0) */ + DWORD sect; /* Sector number appearing in buf[] (0:invalid) */ +#if !FF_FS_READONLY + DWORD dir_sect; /* Sector number containing the directory entry (not used at exFAT) */ + BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (not used at exFAT) */ +#endif +#if FF_USE_FASTSEEK + DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */ +#endif +#if !FF_FS_TINY + BYTE buf[FF_MAX_SS]; /* File private data read/write window */ +#endif +} FIL; + + + +/* Directory object structure (DIR) */ + +typedef struct { + FFOBJID obj; /* Object identifier */ + DWORD dptr; /* Current read/write offset */ + DWORD clust; /* Current cluster */ + DWORD sect; /* Current sector (0:Read operation has terminated) */ + BYTE* dir; /* Pointer to the directory item in the win[] */ + BYTE fn[12]; /* SFN (in/out) {body[8],ext[3],status[1]} */ +#if FF_USE_LFN + DWORD blk_ofs; /* Offset of current entry block being processed (0xFFFFFFFF:Invalid) */ +#endif +#if FF_USE_FIND + const TCHAR* pat; /* Pointer to the name matching pattern */ +#endif +} DIR; + + + +/* File information structure (FILINFO) */ + +typedef struct { + FSIZE_t fsize; /* File size */ + WORD fdate; /* Modified date */ + WORD ftime; /* Modified time */ + BYTE fattrib; /* File attribute */ +#if FF_USE_LFN + TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */ + TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */ +#else + TCHAR fname[12 + 1]; /* File name */ +#endif +} FILINFO; + + + +/* File function return code (FRESULT) */ + +typedef enum { + FR_OK = 0, /* (0) Succeeded */ + FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */ + FR_INT_ERR, /* (2) Assertion failed */ + FR_NOT_READY, /* (3) The physical drive cannot work */ + FR_NO_FILE, /* (4) Could not find the file */ + FR_NO_PATH, /* (5) Could not find the path */ + FR_INVALID_NAME, /* (6) The path name format is invalid */ + FR_DENIED, /* (7) Access denied due to prohibited access or directory full */ + FR_EXIST, /* (8) Access denied due to prohibited access */ + FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */ + FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */ + FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */ + FR_NOT_ENABLED, /* (12) The volume has no work area */ + FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */ + FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any problem */ + FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */ + FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ + FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ + FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ + FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ +} FRESULT; + + + +/*--------------------------------------------------------------*/ +/* FatFs module application interface */ + +FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */ +FRESULT f_close (FIL* fp); /* Close an open file object */ +FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from the file */ +FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to the file */ +FRESULT f_lseek (FIL* fp, FSIZE_t ofs); /* Move file pointer of the file object */ +FRESULT f_truncate (FIL* fp); /* Truncate the file */ +FRESULT f_sync (FIL* fp); /* Flush cached data of the writing file */ +FRESULT f_opendir (DIR* dp, const TCHAR* path); /* Open a directory */ +FRESULT f_closedir (DIR* dp); /* Close an open directory */ +FRESULT f_readdir (DIR* dp, FILINFO* fno); /* Read a directory item */ +FRESULT f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern); /* Find first file */ +FRESULT f_findnext (DIR* dp, FILINFO* fno); /* Find next file */ +FRESULT f_mkdir (const TCHAR* path); /* Create a sub directory */ +FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */ +FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */ +FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */ +FRESULT f_chmod (const TCHAR* path, BYTE attr, BYTE mask); /* Change attribute of a file/dir */ +FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change timestamp of a file/dir */ +FRESULT f_chdir (const TCHAR* path); /* Change current directory */ +FRESULT f_chdrive (const TCHAR* path); /* Change current drive */ +FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */ +FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */ +FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn); /* Get volume label */ +FRESULT f_setlabel (const TCHAR* label); /* Set volume label */ +FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */ +FRESULT f_expand (FIL* fp, FSIZE_t szf, BYTE opt); /* Allocate a contiguous block to the file */ +FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt); /* Mount/Unmount a logical drive */ +FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len); /* Create a FAT volume */ +FRESULT f_fdisk (BYTE pdrv, const DWORD* szt, void* work); /* Divide a physical drive into some partitions */ +FRESULT f_setcp (WORD cp); /* Set current code page */ +int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */ +int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */ +int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */ +TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */ + +#define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize)) +#define f_error(fp) ((fp)->err) +#define f_tell(fp) ((fp)->fptr) +#define f_size(fp) ((fp)->obj.objsize) +#define f_rewind(fp) f_lseek((fp), 0) +#define f_rewinddir(dp) f_readdir((dp), 0) +#define f_rmdir(path) f_unlink(path) +#define f_unmount(path) f_mount(0, path, 0) + +#ifndef EOF +#define EOF (-1) +#endif + + + + +/*--------------------------------------------------------------*/ +/* Additional user defined functions */ + +/* RTC function */ +#if !FF_FS_READONLY && !FF_FS_NORTC +DWORD get_fattime (void); +#endif + +/* LFN support functions */ +#if FF_USE_LFN >= 1 /* Code conversion (defined in unicode.c) */ +WCHAR ff_oem2uni (WCHAR oem, WORD cp); /* OEM code to Unicode conversion */ +WCHAR ff_uni2oem (DWORD uni, WORD cp); /* Unicode to OEM code conversion */ +DWORD ff_wtoupper (DWORD uni); /* Unicode upper-case conversion */ +#endif +#if FF_USE_LFN == 3 /* Dynamic memory allocation */ +void* ff_memalloc (UINT msize); /* Allocate memory block */ +void ff_memfree (void* mblock); /* Free memory block */ +#endif + +/* Sync functions */ +#if FF_FS_REENTRANT +int ff_cre_syncobj (BYTE vol, FF_SYNC_t* sobj); /* Create a sync object */ +int ff_req_grant (FF_SYNC_t sobj); /* Lock sync object */ +void ff_rel_grant (FF_SYNC_t sobj); /* Unlock sync object */ +int ff_del_syncobj (FF_SYNC_t sobj); /* Delete a sync object */ +#endif + + + + +/*--------------------------------------------------------------*/ +/* Flags and offset address */ + + +/* File access mode and open method flags (3rd argument of f_open) */ +#define FA_READ 0x01 +#define FA_WRITE 0x02 +#define FA_OPEN_EXISTING 0x00 +#define FA_CREATE_NEW 0x04 +#define FA_CREATE_ALWAYS 0x08 +#define FA_OPEN_ALWAYS 0x10 +#define FA_OPEN_APPEND 0x30 + +/* Fast seek controls (2nd argument of f_lseek) */ +#define CREATE_LINKMAP ((FSIZE_t)0 - 1) + +/* Format options (2nd argument of f_mkfs) */ +#define FM_FAT 0x01 +#define FM_FAT32 0x02 +#define FM_EXFAT 0x04 +#define FM_ANY 0x07 +#define FM_SFD 0x08 + +/* Filesystem type (FATFS.fs_type) */ +#define FS_FAT12 1 +#define FS_FAT16 2 +#define FS_FAT32 3 +#define FS_EXFAT 4 + +/* File attribute bits for directory entry (FILINFO.fattrib) */ +#define AM_RDO 0x01 /* Read only */ +#define AM_HID 0x02 /* Hidden */ +#define AM_SYS 0x04 /* System */ +#define AM_DIR 0x10 /* Directory */ +#define AM_ARC 0x20 /* Archive */ + + +#ifdef __cplusplus +} +#endif + +#endif /* FF_DEFINED */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff_gen_drv.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff_gen_drv.h new file mode 100644 index 0000000..786d603 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ff_gen_drv.h @@ -0,0 +1,84 @@ +/*! + \file ff_gen_drv.h + \brief header for ff_gen_drv.c module + + \version 2021-05-20, V1.0.0, firmware for GD32 USBFS +*/ + +/* + Copyright (c) 2021, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + + +#ifndef __FF_GEN_DRV_H +#define __FF_GEN_DRV_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "diskio.h" +#include "ff.h" +#include "stdint.h" + +/* Disk IO Driver structure definition */ +typedef struct +{ + DSTATUS (*disk_initialize) (BYTE); /*!< Initialize Disk Drive */ + DSTATUS (*disk_status) (BYTE); /*!< Get Disk Status */ + DRESULT (*disk_read) (BYTE, BYTE*, DWORD, UINT); /*!< Read Sector(s) */ +#if _USE_WRITE == 1 + DRESULT (*disk_write) (BYTE, const BYTE*, DWORD, UINT); /*!< Write Sector(s) when _USE_WRITE = 0 */ +#endif /* _USE_WRITE == 1 */ +#if _USE_IOCTL == 1 + DRESULT (*disk_ioctl) (BYTE, BYTE, void*); /*!< I/O control operation when _USE_IOCTL = 1 */ +#endif /* _USE_IOCTL == 1 */ + +}Diskio_drvTypeDef; + +/* Global Disk IO Drivers structure definition */ +typedef struct +{ + uint8_t is_initialized[_VOLUMES]; + const Diskio_drvTypeDef *drv[_VOLUMES]; + uint8_t lun[_VOLUMES]; + volatile uint8_t nbr; + +}Disk_drvTypeDef; + + +uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path); +uint8_t FATFS_UnLinkDriver(char *path); +uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, BYTE lun); +uint8_t FATFS_UnLinkDriverEx(char *path, BYTE lun); +uint8_t FATFS_GetAttachedDriversNbr(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __FF_GEN_DRV_H */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ffconf.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ffconf.h new file mode 100644 index 0000000..e7d5ff6 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/ffconf.h @@ -0,0 +1,292 @@ +/*---------------------------------------------------------------------------/ +/ FatFs Functional Configurations +/---------------------------------------------------------------------------*/ + +#define FFCONF_DEF 86604 /* Revision ID */ + +/*---------------------------------------------------------------------------/ +/ Function Configurations +/---------------------------------------------------------------------------*/ + +#define FF_FS_READONLY 0 +/* This option switches read-only configuration. (0:Read/Write or 1:Read-only) +/ Read-only configuration removes writing API functions, f_write(), f_sync(), +/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() +/ and optional writing functions as well. */ + + +#define FF_FS_MINIMIZE 0 +/* This option defines minimization level to remove some basic API functions. +/ +/ 0: Basic functions are fully enabled. +/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() +/ are removed. +/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. +/ 3: f_lseek() function is removed in addition to 2. */ + + +#define FF_USE_STRFUNC 0 +/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf(). +/ +/ 0: Disable string functions. +/ 1: Enable without LF-CRLF conversion. +/ 2: Enable with LF-CRLF conversion. */ + + +#define FF_USE_FIND 0 +/* This option switches filtered directory read functions, f_findfirst() and +/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ + + +#define FF_USE_MKFS 1 +/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ + + +#define _USE_FASTSEEK 1 +/* This option switches fast seek function. (0:Disable or 1:Enable) */ + + +#define FF_USE_EXPAND 0 +/* This option switches f_expand function. (0:Disable or 1:Enable) */ + + +#define FF_USE_CHMOD 0 +/* This option switches attribute manipulation functions, f_chmod() and f_utime(). +/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ + + +#define FF_USE_LABEL 0 +/* This option switches volume label functions, f_getlabel() and f_setlabel(). +/ (0:Disable or 1:Enable) */ + + +#define FF_USE_FORWARD 0 +/* This option switches f_forward() function. (0:Disable or 1:Enable) */ + + +/*---------------------------------------------------------------------------/ +/ Locale and Namespace Configurations +/---------------------------------------------------------------------------*/ + +#define FF_CODE_PAGE 932 +/* This option specifies the OEM code page to be used on the target system. +/ Incorrect code page setting can cause a file open failure. +/ +/ 437 - U.S. +/ 720 - Arabic +/ 737 - Greek +/ 771 - KBL +/ 775 - Baltic +/ 850 - Latin 1 +/ 852 - Latin 2 +/ 855 - Cyrillic +/ 857 - Turkish +/ 860 - Portuguese +/ 861 - Icelandic +/ 862 - Hebrew +/ 863 - Canadian French +/ 864 - Arabic +/ 865 - Nordic +/ 866 - Russian +/ 869 - Greek 2 +/ 932 - Japanese (DBCS) +/ 936 - Simplified Chinese (DBCS) +/ 949 - Korean (DBCS) +/ 950 - Traditional Chinese (DBCS) +/ 0 - Include all code pages above and configured by f_setcp() +*/ + + +#define FF_USE_LFN 1 + +#define FF_MAX_LFN 255 +/* The FF_USE_LFN switches the support for LFN (long file name). +/ +/ 0: Disable LFN. FF_MAX_LFN has no effect. +/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. +/ 2: Enable LFN with dynamic working buffer on the STACK. +/ 3: Enable LFN with dynamic working buffer on the HEAP. +/ +/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function +/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. +/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can +/ be in range of 12 to 255. It is recommended to be set 255 to fully support LFN +/ specification. +/ When use stack for the working buffer, take care on stack overflow. When use heap +/ memory for the working buffer, memory management functions, ff_memalloc() and +/ ff_memfree() in ffsystem.c, need to be added to the project. */ + + +#define FF_LFN_UNICODE 0 +/* This option switches the character encoding on the API when LFN is enabled. +/ +/ 0: ANSI/OEM in current CP (TCHAR = char) +/ 1: Unicode in UTF-16 (TCHAR = WCHAR) +/ 2: Unicode in UTF-8 (TCHAR = char) +/ 3: Unicode in UTF-32 (TCHAR = DWORD) +/ +/ Also behavior of string I/O functions will be affected by this option. +/ When LFN is not enabled, this option has no effect. */ + + +#define FF_LFN_BUF 255 +#define FF_SFN_BUF 12 +/* This set of options defines size of file name members in the FILINFO structure +/ which is used to read out directory items. These values should be suffcient for +/ the file names to read. The maximum possible length of the read file name depends +/ on character encoding. When LFN is not enabled, these options have no effect. */ + + +#define FF_STRF_ENCODE 3 +/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(), +/ f_putc(), f_puts and f_printf() convert the character encoding in it. +/ This option selects assumption of character encoding ON THE FILE to be +/ read/written via those functions. +/ +/ 0: ANSI/OEM in current CP +/ 1: Unicode in UTF-16LE +/ 2: Unicode in UTF-16BE +/ 3: Unicode in UTF-8 +*/ + + +#define FF_FS_RPATH 0 +/* This option configures support for relative path. +/ +/ 0: Disable relative path and remove related functions. +/ 1: Enable relative path. f_chdir() and f_chdrive() are available. +/ 2: f_getcwd() function is available in addition to 1. +*/ + + +/*---------------------------------------------------------------------------/ +/ Drive/Volume Configurations +/---------------------------------------------------------------------------*/ + +#define _VOLUMES 2 + +#define FF_VOLUMES 5 +/* Number of volumes (logical drives) to be used. (1-10) */ + + +#define FF_STR_VOLUME_ID 0 +#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" +/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings. +/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive +/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each +/ logical drives. Number of items must not be less than FF_VOLUMES. Valid +/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are +/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is +/ not defined, a user defined volume string table needs to be defined as: +/ +/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",... +*/ + + +#define FF_MULTI_PARTITION 0 +/* This option switches support for multiple volumes on the physical drive. +/ By default (0), each logical drive number is bound to the same physical drive +/ number and only an FAT volume found on the physical drive will be mounted. +/ When this function is enabled (1), each logical drive number can be bound to +/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() +/ funciton will be available. */ + + +#define FF_MIN_SS 512 +#define FF_MAX_SS 512 + +/* This set of options configures the range of sector size to be supported. (512, +/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and +/ harddisk. But a larger value may be required for on-board flash memory and some +/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured +/ for variable sector size mode and disk_ioctl() function needs to implement +/ GET_SECTOR_SIZE command. */ + + +#define FF_USE_TRIM 0 +/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable) +/ To enable Trim function, also CTRL_TRIM command should be implemented to the +/ disk_ioctl() function. */ + + +#define FF_FS_NOFSINFO 0 +/* If you need to know correct free space on the FAT32 volume, set bit 0 of this +/ option, and f_getfree() function at first time after volume mount will force +/ a full FAT scan. Bit 1 controls the use of last allocated cluster number. +/ +/ bit0=0: Use free cluster count in the FSINFO if available. +/ bit0=1: Do not trust free cluster count in the FSINFO. +/ bit1=0: Use last allocated cluster number in the FSINFO if available. +/ bit1=1: Do not trust last allocated cluster number in the FSINFO. +*/ + + + +/*---------------------------------------------------------------------------/ +/ System Configurations +/---------------------------------------------------------------------------*/ + +#define FF_FS_TINY 0 +/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) +/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. +/ Instead of private sector buffer eliminated from the file object, common sector +/ buffer in the filesystem object (FATFS) is used for the file data transfer. */ + + +#define FF_FS_EXFAT 1 +/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) +/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1) +/ Note that enabling exFAT discards ANSI C (C89) compatibility. */ + + +#define FF_FS_NORTC 0 +#define FF_NORTC_MON 1 +#define FF_NORTC_MDAY 1 +#define FF_NORTC_YEAR 2018 +/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable +/ the timestamp function. Every object modified by FatFs will have a fixed timestamp +/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. +/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be +/ added to the project to read current time form real-time clock. FF_NORTC_MON, +/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect. +/ These options have no effect at read-only configuration (FF_FS_READONLY = 1). */ + + +#define FF_FS_LOCK 0 +/* The option FF_FS_LOCK switches file lock function to control duplicated file open +/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY +/ is 1. +/ +/ 0: Disable file lock function. To avoid volume corruption, application program +/ should avoid illegal open, remove and rename to the open objects. +/ >0: Enable file lock function. The value defines how many files/sub-directories +/ can be opened simultaneously under file lock control. Note that the file +/ lock control is independent of re-entrancy. */ + + +/* #include // O/S definitions */ +#define FF_FS_REENTRANT 0 +#define FF_FS_TIMEOUT 1000 +#define FF_SYNC_t HANDLE +/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs +/ module itself. Note that regardless of this option, file access to different +/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs() +/ and f_fdisk() function, are always not re-entrant. Only file/directory access +/ to the same volume is under control of this function. +/ +/ 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect. +/ 1: Enable re-entrancy. Also user provided synchronization handlers, +/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() +/ function, must be added to the project. Samples are available in +/ option/syscall.c. +/ +/ The FF_FS_TIMEOUT defines timeout period in unit of time tick. +/ The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, +/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be +/ included somewhere in the scope of ff.h. */ + + + +/*--- End of configuration options ---*/ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/integer.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/integer.h new file mode 100644 index 0000000..2741b70 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/inc/integer.h @@ -0,0 +1,46 @@ +/*-------------------------------------------*/ +/* Integer type definitions for FatFs module */ +/*-------------------------------------------*/ + +#ifndef _INTEGER + +#if 0 +#include +#else + +#include "usb_conf.h" + +/* These types must be 16-bit, 32-bit or larger integer */ +typedef int INT; +typedef unsigned int UINT; + +/* These types must be 8-bit integer */ +typedef signed char CHAR; +typedef unsigned char UCHAR; +typedef unsigned char BYTE; + +/* These types must be 16-bit integer */ +typedef short SHORT; +typedef unsigned short USHORT; +typedef unsigned short WORD; +typedef unsigned short WCHAR; + +/* These types must be 32-bit integer */ +typedef long LONG; +typedef unsigned long ULONG; +typedef unsigned long DWORD; + +/* Boolean type */ +// typedef enum { FALSE = 0, TRUE } BOOL; +#include +//typedef bool BOOL; +#ifndef FALSE +#define FALSE false +#define TRUE true +#endif + + +#endif + +#define _INTEGER +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/readme.txt b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/readme.txt new file mode 100644 index 0000000..689e973 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/readme.txt @@ -0,0 +1,110 @@ +FatFs Module Source Files R0.07e (C)ChaN, 2009 + + +FILES + + ffconf.h Configuration file for FatFs module. + ff.h Common include file for FatFs and application module. + ff.c FatFs module. + diskio.h Common include file for FatFs and disk I/O module. + diskio.c Skeleton of low level disk I/O module. + integer.h Alternative type definitions for integer variables. + option Optional external functions. + + Low level disk I/O module is not included in this archive because the FatFs + module is only a generic file system layer and not depend on any specific + storage device. You have to provide a low level disk I/O module that written + to control your storage device. + + + +AGREEMENTS + + FatFs module is an open source software to implement FAT file system to + small embedded systems. This is a free software and is opened for education, + research and commercial developments under license policy of following trems. + + Copyright (C) 2009, ChaN, all right reserved. + + * The FatFs module is a free software and there is NO WARRANTY. + * No restriction on use. You can use, modify and redistribute it for + personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY. + * Redistributions of source code must retain the above copyright notice. + + + +REVISION HISTORY + + Feb 26, 2006 R0.00 Prototype + + Apr 29, 2006 R0.01 First release. + + Jun 01, 2006 R0.02 Added FAT12. + Removed unbuffered mode. + Fixed a problem on small (<32M) patition. + + Jun 10, 2006 R0.02a Added a configuration option _FS_MINIMUM. + + Sep 22, 2006 R0.03 Added f_rename. + Changed option _FS_MINIMUM to _FS_MINIMIZE. + + Dec 11, 2006 R0.03a Improved cluster scan algolithm to write files fast. + Fixed f_mkdir creates incorrect directory on FAT32. + + Feb 04, 2007 R0.04 Supported multiple drive system. (FatFs) + Changed some APIs for multiple drive system. + Added f_mkfs. (FatFs) + Added _USE_FAT32 option. (Tiny-FatFs) + + Apr 01, 2007 R0.04a Supported multiple partitions on a plysical drive. (FatFs) + Fixed an endian sensitive code in f_mkfs. (FatFs) + Added a capability of extending the file size to f_lseek. + Added minimization level 3. + Fixed a problem that can collapse a sector when recreate an + existing file in any sub-directory at non FAT32 cfg. (Tiny-FatFs) + + May 05, 2007 R0.04b Added _USE_NTFLAG option. + Added FSInfo support. + Fixed some problems corresponds to FAT32. (Tiny-FatFs) + Fixed DBCS name can result FR_INVALID_NAME. + Fixed short seek (0 < ofs <= csize) collapses the file object. + + Aug 25, 2007 R0.05 Changed arguments of f_read, f_write. + Changed arguments of f_mkfs. (FatFs) + Fixed f_mkfs on FAT32 creates incorrect FSInfo. (FatFs) + Fixed f_mkdir on FAT32 creates incorrect directory. (FatFs) + + Feb 03, 2008 R0.05a Added f_truncate(). + Added f_utime(). + Fixed off by one error at FAT sub-type determination. + Fixed btr in f_read() can be mistruncated. + Fixed cached sector is not flushed when create and close without write. + + Apr 01, 2008 R0.06 Added f_forward(). (Tiny-FatFs) + Added string functions: fputc(), fputs(), fprintf() and fgets(). + Improved performance of f_lseek() on move to the same or following cluster. + + Apr 01, 2009, R0.07 Merged Tiny-FatFs as a buffer configuration option. + Added long file name support. + Added multiple code page support. + Added re-entrancy for multitask operation. + Added auto cluster size selection to f_mkfs(). + Added rewind option to f_readdir(). + Changed result code of critical errors. + Renamed string functions to avoid name collision. + + Apr 14, 2009, R0.07a Separated out OS dependent code on reentrant cfg. + Added multiple sector size support. + + Jun 21, 2009, R0.07c Fixed f_unlink() may return FR_OK on error. + Fixed wrong cache control in f_lseek(). + Added relative path feature. + Added f_chdir(). + Added f_chdrive(). + Added proper case conversion for extended characters. + + Nov 03,'2009 R0.07e Separated out configuration options from ff.h to ffconf.h. + Added a configuration option, _LFN_UNICODE. + Fixed f_unlink() fails to remove a sub-dir on _FS_RPATH. + Fixed name matching error on the 13 char boundary. + Changed f_readdir() to return the SFN with always upper case on non-LFN cfg. diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/diskio.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/diskio.c new file mode 100644 index 0000000..05a47b7 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/diskio.c @@ -0,0 +1,164 @@ +/*! + \file diskio.c + \brief Low level disk interface driver + + \version 2021-05-20, V1.0.0, firmware for GD32 USBFS +*/ + +/* + Copyright (c) 2021, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +/* Includes ------------------------------------------------------------------*/ +#include "diskio.h" +#include "ff_gen_drv.h" + +#if defined ( __GNUC__ ) +#ifndef __weak +#define __weak __attribute__((weak)) +#endif +#endif + +extern Disk_drvTypeDef disk; + +/*! + \brief Gets Disk Status + \param[in] pdrv: Physical drive number (0..) + \param[out] none + \retval DSTATUS: Operation status +*/ +DSTATUS disk_status ( + BYTE pdrv /* Physical drive number to identify the drive */ +) +{ + DSTATUS stat; + + stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]); + + return stat; +} + +/*! + \brief Initializes a Drive + \param[in] pdrv: Physical drive number (0..) + \param[out] none + \retval DSTATUS: Operation status +*/ +DSTATUS disk_initialize ( + BYTE pdrv /* Physical drive nmuber to identify the drive */ +) +{ + DSTATUS stat = RES_OK; + + if (disk.is_initialized[pdrv] == 0) { + disk.is_initialized[pdrv] = 1; + stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]); + } + + return stat; +} + +/*! + \brief Reads Sector(s) + \param[in] pdrv: Physical drive number (0..) + \param[in] buff: Data buffer to store read data + \param[in] sector: Sector address (LBA) + \param[in] count: Number of sectors to write (1..128) + \param[out] none + \retval DRESULT: Operation result +*/ +DRESULT disk_read ( + BYTE pdrv, /* Physical drive nmuber to identify the drive */ + BYTE *buff, /* Data buffer to store read data */ + DWORD sector, /* Sector address in LBA */ + UINT count /* Number of sectors to read */ +) +{ + DRESULT res; + + res = disk.drv[pdrv]->disk_read(disk.lun[pdrv], buff, sector, count); + + return res; +} + +/*! + \brief Writes Sector(s) + \param[in] pdrv: Physical drive number (0..) + \param[in] buff: Data to be written + \param[in] sector: Sector address (LBA) + \param[in] count: Number of sectors to write (1..128) + \param[out] none + \retval DRESULT: Operation result +*/ +#if _USE_WRITE == 1 +DRESULT disk_write ( + BYTE pdrv, /* Physical drive nmuber to identify the drive */ + const BYTE *buff, /* Data to be written */ + DWORD sector, /* Sector address in LBA */ + UINT count /* Number of sectors to write */ +) +{ + DRESULT res; + + res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count); + + return res; +} +#endif /* _USE_WRITE == 1 */ + +/*! + \brief I/O control operation + \param[in] pdrv: Physical drive number (0..) + \param[in] cmd: Control code + \param[in] buff: Buffer to send/receive control data + \param[out] none + \retval DRESULT: Operation result +*/ +#if _USE_IOCTL == 1 +DRESULT disk_ioctl ( + BYTE pdrv, /* Physical drive nmuber (0..) */ + BYTE cmd, /* Control code */ + void *buff /* Buffer to send/receive control data */ +) +{ + DRESULT res; + + res = disk.drv[pdrv]->disk_ioctl(disk.lun[pdrv], cmd, buff); + + return res; +} +#endif /* _USE_IOCTL == 1 */ + +/*! + \brief Gets Time from RTC + \param[in] none + \param[out] none + \retval Time in DWORD +*/ +__weak DWORD get_fattime (void) +{ + return 0; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/fattime.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/fattime.c new file mode 100644 index 0000000..2e16b4a --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/fattime.c @@ -0,0 +1,11 @@ + + +#include "integer.h" +#include "fattime.h" +//#include "rtc.h" //RPi + +DWORD get_fattime (void) +{ + return 0; +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff.c new file mode 100644 index 0000000..290f577 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff.c @@ -0,0 +1,6554 @@ +/*----------------------------------------------------------------------------/ +/ FatFs - Generic FAT Filesystem Module R0.13c / +/-----------------------------------------------------------------------------/ +/ +/ Copyright (C) 2018, ChaN, all right reserved. +/ +/ FatFs module is an open source software. Redistribution and use of FatFs in +/ source and binary forms, with or without modification, are permitted provided +/ that the following condition is met: +/ +/ 1. Redistributions of source code must retain the above copyright notice, +/ this condition and the following disclaimer. +/ +/ This software is provided by the copyright holder and contributors "AS IS" +/ and any warranties related to this software are DISCLAIMED. +/ The copyright owner or contributors be NOT LIABLE for any damages caused +/ by use of this software. +/ +/----------------------------------------------------------------------------*/ + + +#include "ff.h" /* Declarations of FatFs API */ +#include "diskio.h" /* Declarations of device I/O functions */ + + +/*-------------------------------------------------------------------------- + + Module Private Definitions + +---------------------------------------------------------------------------*/ + +#if FF_DEFINED != 86604 /* Revision ID */ +#error Wrong include file (ff.h). +#endif + + +/* Limits and boundaries */ +#define MAX_DIR 0x200000 /* Max size of FAT directory */ +#define MAX_DIR_EX 0x10000000 /* Max size of exFAT directory */ +#define MAX_FAT12 0xFF5 /* Max FAT12 clusters (differs from specs, but right for real DOS/Windows behavior) */ +#define MAX_FAT16 0xFFF5 /* Max FAT16 clusters (differs from specs, but right for real DOS/Windows behavior) */ +#define MAX_FAT32 0x0FFFFFF5 /* Max FAT32 clusters (not specified, practical limit) */ +#define MAX_EXFAT 0x7FFFFFFD /* Max exFAT clusters (differs from specs, implementation limit) */ + + +/* Character code support macros */ +#define IsUpper(c) ((c) >= 'A' && (c) <= 'Z') +#define IsLower(c) ((c) >= 'a' && (c) <= 'z') +#define IsDigit(c) ((c) >= '0' && (c) <= '9') +#define IsSurrogate(c) ((c) >= 0xD800 && (c) <= 0xDFFF) +#define IsSurrogateH(c) ((c) >= 0xD800 && (c) <= 0xDBFF) +#define IsSurrogateL(c) ((c) >= 0xDC00 && (c) <= 0xDFFF) + + +/* Additional file access control and file status flags for internal use */ +#define FA_SEEKEND 0x20 /* Seek to end of the file on file open */ +#define FA_MODIFIED 0x40 /* File has been modified */ +#define FA_DIRTY 0x80 /* FIL.buf[] needs to be written-back */ + + +/* Additional file attribute bits for internal use */ +#define AM_VOL 0x08 /* Volume label */ +#define AM_LFN 0x0F /* LFN entry */ +#define AM_MASK 0x3F /* Mask of defined bits */ + + +/* Name status flags in fn[11] */ +#define NSFLAG 11 /* Index of the name status byte */ +#define NS_LOSS 0x01 /* Out of 8.3 format */ +#define NS_LFN 0x02 /* Force to create LFN entry */ +#define NS_LAST 0x04 /* Last segment */ +#define NS_BODY 0x08 /* Lower case flag (body) */ +#define NS_EXT 0x10 /* Lower case flag (ext) */ +#define NS_DOT 0x20 /* Dot entry */ +#define NS_NOLFN 0x40 /* Do not find LFN */ +#define NS_NONAME 0x80 /* Not followed */ + + +/* exFAT directory entry types */ +#define ET_BITMAP 0x81 /* Allocation bitmap */ +#define ET_UPCASE 0x82 /* Up-case table */ +#define ET_VLABEL 0x83 /* Volume label */ +#define ET_FILEDIR 0x85 /* File and directory */ +#define ET_STREAM 0xC0 /* Stream extension */ +#define ET_FILENAME 0xC1 /* Name extension */ + + +/* FatFs refers the FAT structure as simple byte array instead of structure member +/ because the C structure is not binary compatible between different platforms */ + +#define BS_JmpBoot 0 /* x86 jump instruction (3-byte) */ +#define BS_OEMName 3 /* OEM name (8-byte) */ +#define BPB_BytsPerSec 11 /* Sector size [byte] (WORD) */ +#define BPB_SecPerClus 13 /* Cluster size [sector] (BYTE) */ +#define BPB_RsvdSecCnt 14 /* Size of reserved area [sector] (WORD) */ +#define BPB_NumFATs 16 /* Number of FATs (BYTE) */ +#define BPB_RootEntCnt 17 /* Size of root directory area for FAT [entry] (WORD) */ +#define BPB_TotSec16 19 /* Volume size (16-bit) [sector] (WORD) */ +#define BPB_Media 21 /* Media descriptor byte (BYTE) */ +#define BPB_FATSz16 22 /* FAT size (16-bit) [sector] (WORD) */ +#define BPB_SecPerTrk 24 /* Number of sectors per track for int13h [sector] (WORD) */ +#define BPB_NumHeads 26 /* Number of heads for int13h (WORD) */ +#define BPB_HiddSec 28 /* Volume offset from top of the drive (DWORD) */ +#define BPB_TotSec32 32 /* Volume size (32-bit) [sector] (DWORD) */ +#define BS_DrvNum 36 /* Physical drive number for int13h (BYTE) */ +#define BS_NTres 37 /* WindowsNT error flag (BYTE) */ +#define BS_BootSig 38 /* Extended boot signature (BYTE) */ +#define BS_VolID 39 /* Volume serial number (DWORD) */ +#define BS_VolLab 43 /* Volume label string (8-byte) */ +#define BS_FilSysType 54 /* Filesystem type string (8-byte) */ +#define BS_BootCode 62 /* Boot code (448-byte) */ +#define BS_55AA 510 /* Signature word (WORD) */ + +#define BPB_FATSz32 36 /* FAT32: FAT size [sector] (DWORD) */ +#define BPB_ExtFlags32 40 /* FAT32: Extended flags (WORD) */ +#define BPB_FSVer32 42 /* FAT32: Filesystem version (WORD) */ +#define BPB_RootClus32 44 /* FAT32: Root directory cluster (DWORD) */ +#define BPB_FSInfo32 48 /* FAT32: Offset of FSINFO sector (WORD) */ +#define BPB_BkBootSec32 50 /* FAT32: Offset of backup boot sector (WORD) */ +#define BS_DrvNum32 64 /* FAT32: Physical drive number for int13h (BYTE) */ +#define BS_NTres32 65 /* FAT32: Error flag (BYTE) */ +#define BS_BootSig32 66 /* FAT32: Extended boot signature (BYTE) */ +#define BS_VolID32 67 /* FAT32: Volume serial number (DWORD) */ +#define BS_VolLab32 71 /* FAT32: Volume label string (8-byte) */ +#define BS_FilSysType32 82 /* FAT32: Filesystem type string (8-byte) */ +#define BS_BootCode32 90 /* FAT32: Boot code (420-byte) */ + +#define BPB_ZeroedEx 11 /* exFAT: MBZ field (53-byte) */ +#define BPB_VolOfsEx 64 /* exFAT: Volume offset from top of the drive [sector] (QWORD) */ +#define BPB_TotSecEx 72 /* exFAT: Volume size [sector] (QWORD) */ +#define BPB_FatOfsEx 80 /* exFAT: FAT offset from top of the volume [sector] (DWORD) */ +#define BPB_FatSzEx 84 /* exFAT: FAT size [sector] (DWORD) */ +#define BPB_DataOfsEx 88 /* exFAT: Data offset from top of the volume [sector] (DWORD) */ +#define BPB_NumClusEx 92 /* exFAT: Number of clusters (DWORD) */ +#define BPB_RootClusEx 96 /* exFAT: Root directory start cluster (DWORD) */ +#define BPB_VolIDEx 100 /* exFAT: Volume serial number (DWORD) */ +#define BPB_FSVerEx 104 /* exFAT: Filesystem version (WORD) */ +#define BPB_VolFlagEx 106 /* exFAT: Volume flags (WORD) */ +#define BPB_BytsPerSecEx 108 /* exFAT: Log2 of sector size in unit of byte (BYTE) */ +#define BPB_SecPerClusEx 109 /* exFAT: Log2 of cluster size in unit of sector (BYTE) */ +#define BPB_NumFATsEx 110 /* exFAT: Number of FATs (BYTE) */ +#define BPB_DrvNumEx 111 /* exFAT: Physical drive number for int13h (BYTE) */ +#define BPB_PercInUseEx 112 /* exFAT: Percent in use (BYTE) */ +#define BPB_RsvdEx 113 /* exFAT: Reserved (7-byte) */ +#define BS_BootCodeEx 120 /* exFAT: Boot code (390-byte) */ + +#define DIR_Name 0 /* Short file name (11-byte) */ +#define DIR_Attr 11 /* Attribute (BYTE) */ +#define DIR_NTres 12 /* Lower case flag (BYTE) */ +#define DIR_CrtTime10 13 /* Created time sub-second (BYTE) */ +#define DIR_CrtTime 14 /* Created time (DWORD) */ +#define DIR_LstAccDate 18 /* Last accessed date (WORD) */ +#define DIR_FstClusHI 20 /* Higher 16-bit of first cluster (WORD) */ +#define DIR_ModTime 22 /* Modified time (DWORD) */ +#define DIR_FstClusLO 26 /* Lower 16-bit of first cluster (WORD) */ +#define DIR_FileSize 28 /* File size (DWORD) */ +#define LDIR_Ord 0 /* LFN: LFN order and LLE flag (BYTE) */ +#define LDIR_Attr 11 /* LFN: LFN attribute (BYTE) */ +#define LDIR_Type 12 /* LFN: Entry type (BYTE) */ +#define LDIR_Chksum 13 /* LFN: Checksum of the SFN (BYTE) */ +#define LDIR_FstClusLO 26 /* LFN: MBZ field (WORD) */ +#define XDIR_Type 0 /* exFAT: Type of exFAT directory entry (BYTE) */ +#define XDIR_NumLabel 1 /* exFAT: Number of volume label characters (BYTE) */ +#define XDIR_Label 2 /* exFAT: Volume label (11-WORD) */ +#define XDIR_CaseSum 4 /* exFAT: Sum of case conversion table (DWORD) */ +#define XDIR_NumSec 1 /* exFAT: Number of secondary entries (BYTE) */ +#define XDIR_SetSum 2 /* exFAT: Sum of the set of directory entries (WORD) */ +#define XDIR_Attr 4 /* exFAT: File attribute (WORD) */ +#define XDIR_CrtTime 8 /* exFAT: Created time (DWORD) */ +#define XDIR_ModTime 12 /* exFAT: Modified time (DWORD) */ +#define XDIR_AccTime 16 /* exFAT: Last accessed time (DWORD) */ +#define XDIR_CrtTime10 20 /* exFAT: Created time subsecond (BYTE) */ +#define XDIR_ModTime10 21 /* exFAT: Modified time subsecond (BYTE) */ +#define XDIR_CrtTZ 22 /* exFAT: Created timezone (BYTE) */ +#define XDIR_ModTZ 23 /* exFAT: Modified timezone (BYTE) */ +#define XDIR_AccTZ 24 /* exFAT: Last accessed timezone (BYTE) */ +#define XDIR_GenFlags 33 /* exFAT: General secondary flags (BYTE) */ +#define XDIR_NumName 35 /* exFAT: Number of file name characters (BYTE) */ +#define XDIR_NameHash 36 /* exFAT: Hash of file name (WORD) */ +#define XDIR_ValidFileSize 40 /* exFAT: Valid file size (QWORD) */ +#define XDIR_FstClus 52 /* exFAT: First cluster of the file data (DWORD) */ +#define XDIR_FileSize 56 /* exFAT: File/Directory size (QWORD) */ + +#define SZDIRE 32 /* Size of a directory entry */ +#define DDEM 0xE5 /* Deleted directory entry mark set to DIR_Name[0] */ +#define RDDEM 0x05 /* Replacement of the character collides with DDEM */ +#define LLEF 0x40 /* Last long entry flag in LDIR_Ord */ + +#define FSI_LeadSig 0 /* FAT32 FSI: Leading signature (DWORD) */ +#define FSI_StrucSig 484 /* FAT32 FSI: Structure signature (DWORD) */ +#define FSI_Free_Count 488 /* FAT32 FSI: Number of free clusters (DWORD) */ +#define FSI_Nxt_Free 492 /* FAT32 FSI: Last allocated cluster (DWORD) */ + +#define MBR_Table 446 /* MBR: Offset of partition table in the MBR */ +#define SZ_PTE 16 /* MBR: Size of a partition table entry */ +#define PTE_Boot 0 /* MBR PTE: Boot indicator */ +#define PTE_StHead 1 /* MBR PTE: Start head */ +#define PTE_StSec 2 /* MBR PTE: Start sector */ +#define PTE_StCyl 3 /* MBR PTE: Start cylinder */ +#define PTE_System 4 /* MBR PTE: System ID */ +#define PTE_EdHead 5 /* MBR PTE: End head */ +#define PTE_EdSec 6 /* MBR PTE: End sector */ +#define PTE_EdCyl 7 /* MBR PTE: End cylinder */ +#define PTE_StLba 8 /* MBR PTE: Start in LBA */ +#define PTE_SizLba 12 /* MBR PTE: Size in LBA */ + + +/* Post process on fatal error in the file operations */ +#define ABORT(fs, res) { fp->err = (BYTE)(res); LEAVE_FF(fs, res); } + + +/* Re-entrancy related */ +#if FF_FS_REENTRANT +#if FF_USE_LFN == 1 +#error Static LFN work area cannot be used at thread-safe configuration +#endif +#define LEAVE_FF(fs, res) { unlock_fs(fs, res); return res; } +#else +#define LEAVE_FF(fs, res) return res +#endif + + +/* Definitions of volume - physical location conversion */ +#if FF_MULTI_PARTITION +#define LD2PD(vol) VolToPart[vol].pd /* Get physical drive number */ +#define LD2PT(vol) VolToPart[vol].pt /* Get partition index */ +#else +#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */ +#define LD2PT(vol) 0 /* Find first valid partition or in SFD */ +#endif + + +/* Definitions of sector size */ +#if (FF_MAX_SS < FF_MIN_SS) || (FF_MAX_SS != 512 && FF_MAX_SS != 1024 && FF_MAX_SS != 2048 && FF_MAX_SS != 4096) || (FF_MIN_SS != 512 && FF_MIN_SS != 1024 && FF_MIN_SS != 2048 && FF_MIN_SS != 4096) +#error Wrong sector size configuration +#endif +#if FF_MAX_SS == FF_MIN_SS +#define SS(fs) ((UINT)FF_MAX_SS) /* Fixed sector size */ +#else +#define SS(fs) ((fs)->ssize) /* Variable sector size */ +#endif + + +/* Timestamp */ +#if FF_FS_NORTC == 1 +#if FF_NORTC_YEAR < 1980 || FF_NORTC_YEAR > 2107 || FF_NORTC_MON < 1 || FF_NORTC_MON > 12 || FF_NORTC_MDAY < 1 || FF_NORTC_MDAY > 31 +#error Invalid FF_FS_NORTC settings +#endif +#define GET_FATTIME() ((DWORD)(FF_NORTC_YEAR - 1980) << 25 | (DWORD)FF_NORTC_MON << 21 | (DWORD)FF_NORTC_MDAY << 16) +#else +#define GET_FATTIME() get_fattime() +#endif + + +/* File lock controls */ +#if FF_FS_LOCK != 0 +#if FF_FS_READONLY +#error FF_FS_LOCK must be 0 at read-only configuration +#endif +typedef struct { + FATFS *fs; /* Object ID 1, volume (NULL:blank entry) */ + DWORD clu; /* Object ID 2, containing directory (0:root) */ + DWORD ofs; /* Object ID 3, offset in the directory */ + WORD ctr; /* Object open counter, 0:none, 0x01..0xFF:read mode open count, 0x100:write mode */ +} FILESEM; +#endif + + +/* SBCS up-case tables (\x80-\xFF) */ +#define TBL_CT437 {0x80,0x9A,0x45,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, \ + 0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT720 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT737 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \ + 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xEF,0xF5,0xF0,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT771 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDC,0xDE,0xDE, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF} +#define TBL_CT775 {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F, \ + 0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \ + 0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT850 {0x43,0x55,0x45,0x41,0x41,0x41,0x41,0x43,0x45,0x45,0x45,0x49,0x49,0x49,0x41,0x41, \ + 0x45,0x92,0x92,0x4F,0x4F,0x4F,0x55,0x55,0x59,0x4F,0x55,0x4F,0x9C,0x4F,0x9E,0x9F, \ + 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0x41,0x41,0x41,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0x41,0x41,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD1,0xD1,0x45,0x45,0x45,0x49,0x49,0x49,0x49,0xD9,0xDA,0xDB,0xDC,0xDD,0x49,0xDF, \ + 0x4F,0xE1,0x4F,0x4F,0x4F,0x4F,0xE6,0xE8,0xE8,0x55,0x55,0x55,0x59,0x59,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT852 {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0xAC, \ + 0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF} +#define TBL_CT855 {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F, \ + 0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \ + 0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \ + 0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF, \ + 0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT857 {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x49,0x8E,0x8F, \ + 0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \ + 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0x49,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT860 {0x80,0x9A,0x90,0x8F,0x8E,0x91,0x86,0x80,0x89,0x89,0x92,0x8B,0x8C,0x98,0x8E,0x8F, \ + 0x90,0x91,0x92,0x8C,0x99,0xA9,0x96,0x9D,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x86,0x8B,0x9F,0x96,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT861 {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x8B,0x8B,0x8D,0x8E,0x8F, \ + 0x90,0x92,0x92,0x4F,0x99,0x8D,0x55,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \ + 0xA4,0xA5,0xA6,0xA7,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT862 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT863 {0x43,0x55,0x45,0x41,0x41,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x41,0x8F, \ + 0x45,0x45,0x45,0x4F,0x45,0x49,0x55,0x55,0x98,0x4F,0x55,0x9B,0x9C,0x55,0x55,0x9F, \ + 0xA0,0xA1,0x4F,0x55,0xA4,0xA5,0xA6,0xA7,0x49,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT864 {0x80,0x9A,0x45,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, \ + 0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT865 {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F, \ + 0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, \ + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT866 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ + 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} +#define TBL_CT869 {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, \ + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x86,0x9C,0x8D,0x8F,0x90, \ + 0x91,0x90,0x92,0x95,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, \ + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, \ + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xA4,0xA5,0xA6,0xD9,0xDA,0xDB,0xDC,0xA7,0xA8,0xDF, \ + 0xA9,0xAA,0xAC,0xAD,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xCF,0xCF,0xD0,0xEF, \ + 0xF0,0xF1,0xD1,0xD2,0xD3,0xF5,0xD4,0xF7,0xF8,0xF9,0xD5,0x96,0x95,0x98,0xFE,0xFF} + + +/* DBCS code range |----- 1st byte -----| |----------- 2nd byte -----------| */ +#define TBL_DC932 {0x81, 0x9F, 0xE0, 0xFC, 0x40, 0x7E, 0x80, 0xFC, 0x00, 0x00} +#define TBL_DC936 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0x80, 0xFE, 0x00, 0x00} +#define TBL_DC949 {0x81, 0xFE, 0x00, 0x00, 0x41, 0x5A, 0x61, 0x7A, 0x81, 0xFE} +#define TBL_DC950 {0x81, 0xFE, 0x00, 0x00, 0x40, 0x7E, 0xA1, 0xFE, 0x00, 0x00} + + +/* Macros for table definitions */ +#define MERGE_2STR(a, b) a ## b +#define MKCVTBL(hd, cp) MERGE_2STR(hd, cp) + + + + +/*-------------------------------------------------------------------------- + + Module Private Work Area + +---------------------------------------------------------------------------*/ +/* Remark: Variables defined here without initial value shall be guaranteed +/ zero/null at start-up. If not, the linker option or start-up routine is +/ not compliance with C standard. */ + +/*--------------------------------*/ +/* File/Volume controls */ +/*--------------------------------*/ + +#if FF_VOLUMES < 1 || FF_VOLUMES > 10 +#error Wrong FF_VOLUMES setting +#endif +static FATFS* FatFs[FF_VOLUMES]; /* Pointer to the filesystem objects (logical drives) */ +static WORD Fsid; /* Filesystem mount ID */ + +#if FF_FS_RPATH != 0 +static BYTE CurrVol; /* Current drive */ +#endif + +#if FF_FS_LOCK != 0 +static FILESEM Files[FF_FS_LOCK]; /* Open object lock semaphores */ +#endif + +#if FF_STR_VOLUME_ID +#ifdef FF_VOLUME_STRS +static const char* const VolumeStr[FF_VOLUMES] = {FF_VOLUME_STRS}; /* Pre-defined volume ID */ +#endif +#endif + + +/*--------------------------------*/ +/* LFN/Directory working buffer */ +/*--------------------------------*/ + +#if FF_USE_LFN == 0 /* Non-LFN configuration */ +#if FF_FS_EXFAT +#error LFN must be enabled when enable exFAT +#endif +#define DEF_NAMBUF +#define INIT_NAMBUF(fs) +#define FREE_NAMBUF() +#define LEAVE_MKFS(res) return res + +#else /* LFN configurations */ +#if FF_MAX_LFN < 12 || FF_MAX_LFN > 255 +#error Wrong setting of FF_MAX_LFN +#endif +#if FF_LFN_BUF < FF_SFN_BUF || FF_SFN_BUF < 12 +#error Wrong setting of FF_LFN_BUF or FF_SFN_BUF +#endif +#if FF_LFN_UNICODE < 0 || FF_LFN_UNICODE > 3 +#error Wrong setting of FF_LFN_UNICODE +#endif +static const BYTE LfnOfs[] = {1,3,5,7,9,14,16,18,20,22,24,28,30}; /* FAT: Offset of LFN characters in the directory entry */ +#define MAXDIRB(nc) ((nc + 44U) / 15 * SZDIRE) /* exFAT: Size of directory entry block scratchpad buffer needed for the name length */ + +#if FF_USE_LFN == 1 /* LFN enabled with static working buffer */ +#if FF_FS_EXFAT +static BYTE DirBuf[MAXDIRB(FF_MAX_LFN)]; /* Directory entry block scratchpad buffer */ +#endif +static WCHAR LfnBuf[FF_MAX_LFN + 1]; /* LFN working buffer */ +#define DEF_NAMBUF +#define INIT_NAMBUF(fs) +#define FREE_NAMBUF() +#define LEAVE_MKFS(res) return res + +#elif FF_USE_LFN == 2 /* LFN enabled with dynamic working buffer on the stack */ +#if FF_FS_EXFAT +#define DEF_NAMBUF WCHAR lbuf[FF_MAX_LFN+1]; BYTE dbuf[MAXDIRB(FF_MAX_LFN)]; /* LFN working buffer and directory entry block scratchpad buffer */ +#define INIT_NAMBUF(fs) { (fs)->lfnbuf = lbuf; (fs)->dirbuf = dbuf; } +#define FREE_NAMBUF() +#else +#define DEF_NAMBUF WCHAR lbuf[FF_MAX_LFN+1]; /* LFN working buffer */ +#define INIT_NAMBUF(fs) { (fs)->lfnbuf = lbuf; } +#define FREE_NAMBUF() +#endif +#define LEAVE_MKFS(res) return res + +#elif FF_USE_LFN == 3 /* LFN enabled with dynamic working buffer on the heap */ +#if FF_FS_EXFAT +#define DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer and directory entry block scratchpad buffer */ +#define INIT_NAMBUF(fs) { lfn = ff_memalloc((FF_MAX_LFN+1)*2 + MAXDIRB(FF_MAX_LFN)); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1); } +#define FREE_NAMBUF() ff_memfree(lfn) +#else +#define DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer */ +#define INIT_NAMBUF(fs) { lfn = ff_memalloc((FF_MAX_LFN+1)*2); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; } +#define FREE_NAMBUF() ff_memfree(lfn) +#endif +#define LEAVE_MKFS(res) { if (!work) ff_memfree(buf); return res; } +#define MAX_MALLOC 0x8000 /* Must be >=FF_MAX_SS */ + +#else +#error Wrong setting of FF_USE_LFN + +#endif /* FF_USE_LFN == 1 */ +#endif /* FF_USE_LFN == 0 */ + + + +/*--------------------------------*/ +/* Code conversion tables */ +/*--------------------------------*/ + +#if FF_CODE_PAGE == 0 /* Run-time code page configuration */ +#define CODEPAGE CodePage +static WORD CodePage; /* Current code page */ +static const BYTE *ExCvt, *DbcTbl; /* Pointer to current SBCS up-case table and DBCS code range table below */ + +static const BYTE Ct437[] = TBL_CT437; +static const BYTE Ct720[] = TBL_CT720; +static const BYTE Ct737[] = TBL_CT737; +static const BYTE Ct771[] = TBL_CT771; +static const BYTE Ct775[] = TBL_CT775; +static const BYTE Ct850[] = TBL_CT850; +static const BYTE Ct852[] = TBL_CT852; +static const BYTE Ct855[] = TBL_CT855; +static const BYTE Ct857[] = TBL_CT857; +static const BYTE Ct860[] = TBL_CT860; +static const BYTE Ct861[] = TBL_CT861; +static const BYTE Ct862[] = TBL_CT862; +static const BYTE Ct863[] = TBL_CT863; +static const BYTE Ct864[] = TBL_CT864; +static const BYTE Ct865[] = TBL_CT865; +static const BYTE Ct866[] = TBL_CT866; +static const BYTE Ct869[] = TBL_CT869; +static const BYTE Dc932[] = TBL_DC932; +static const BYTE Dc936[] = TBL_DC936; +static const BYTE Dc949[] = TBL_DC949; +static const BYTE Dc950[] = TBL_DC950; + +#elif FF_CODE_PAGE < 900 /* Static code page configuration (SBCS) */ +#define CODEPAGE FF_CODE_PAGE +static const BYTE ExCvt[] = MKCVTBL(TBL_CT, FF_CODE_PAGE); + +#else /* Static code page configuration (DBCS) */ +#define CODEPAGE FF_CODE_PAGE +static const BYTE DbcTbl[] = MKCVTBL(TBL_DC, FF_CODE_PAGE); + +#endif + + + + +/*-------------------------------------------------------------------------- + + Module Private Functions + +---------------------------------------------------------------------------*/ + + +/*-----------------------------------------------------------------------*/ +/* Load/Store multi-byte word in the FAT structure */ +/*-----------------------------------------------------------------------*/ + +static WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */ +{ + WORD rv; + + rv = ptr[1]; + rv = rv << 8 | ptr[0]; + return rv; +} + +static DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */ +{ + DWORD rv; + + rv = ptr[3]; + rv = rv << 8 | ptr[2]; + rv = rv << 8 | ptr[1]; + rv = rv << 8 | ptr[0]; + return rv; +} + +#if FF_FS_EXFAT +static QWORD ld_qword (const BYTE* ptr) /* Load an 8-byte little-endian word */ +{ + QWORD rv; + + rv = ptr[7]; + rv = rv << 8 | ptr[6]; + rv = rv << 8 | ptr[5]; + rv = rv << 8 | ptr[4]; + rv = rv << 8 | ptr[3]; + rv = rv << 8 | ptr[2]; + rv = rv << 8 | ptr[1]; + rv = rv << 8 | ptr[0]; + return rv; +} +#endif + +#if !FF_FS_READONLY +static void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */ +{ + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; +} + +static void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */ +{ + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; +} + +#if FF_FS_EXFAT +static void st_qword (BYTE* ptr, QWORD val) /* Store an 8-byte word in little-endian */ +{ + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; val >>= 8; + *ptr++ = (BYTE)val; +} +#endif +#endif /* !FF_FS_READONLY */ + + + +/*-----------------------------------------------------------------------*/ +/* String functions */ +/*-----------------------------------------------------------------------*/ + +/* Copy memory to memory */ +static void mem_cpy (void* dst, const void* src, UINT cnt) +{ + BYTE *d = (BYTE*)dst; + const BYTE *s = (const BYTE*)src; + + if (cnt != 0) { + do { + *d++ = *s++; + } while (--cnt); + } +} + + +/* Fill memory block */ +static void mem_set (void* dst, int val, UINT cnt) +{ + BYTE *d = (BYTE*)dst; + + do { + *d++ = (BYTE)val; + } while (--cnt); +} + + +/* Compare memory block */ +static int mem_cmp (const void* dst, const void* src, UINT cnt) /* ZR:same, NZ:different */ +{ + const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src; + int r = 0; + + do { + r = *d++ - *s++; + } while (--cnt && r == 0); + + return r; +} + + +/* Check if chr is contained in the string */ +static int chk_chr (const char* str, int chr) /* NZ:contained, ZR:not contained */ +{ + while (*str && *str != chr) str++; + return *str; +} + + +/* Test if the character is DBC 1st byte */ +static int dbc_1st (BYTE c) +{ +#if FF_CODE_PAGE == 0 /* Variable code page */ + if (DbcTbl && c >= DbcTbl[0]) { + if (c <= DbcTbl[1]) return 1; /* 1st byte range 1 */ + if (c >= DbcTbl[2] && c <= DbcTbl[3]) return 1; /* 1st byte range 2 */ + } +#elif FF_CODE_PAGE >= 900 /* DBCS fixed code page */ + if (c >= DbcTbl[0]) { + if (c <= DbcTbl[1]) return 1; + if (c >= DbcTbl[2] && c <= DbcTbl[3]) return 1; + } +#else /* SBCS fixed code page */ + if (c != 0) return 0; /* Always false */ +#endif + return 0; +} + + +/* Test if the character is DBC 2nd byte */ +static int dbc_2nd (BYTE c) +{ +#if FF_CODE_PAGE == 0 /* Variable code page */ + if (DbcTbl && c >= DbcTbl[4]) { + if (c <= DbcTbl[5]) return 1; /* 2nd byte range 1 */ + if (c >= DbcTbl[6] && c <= DbcTbl[7]) return 1; /* 2nd byte range 2 */ + if (c >= DbcTbl[8] && c <= DbcTbl[9]) return 1; /* 2nd byte range 3 */ + } +#elif FF_CODE_PAGE >= 900 /* DBCS fixed code page */ + if (c >= DbcTbl[4]) { + if (c <= DbcTbl[5]) return 1; + if (c >= DbcTbl[6] && c <= DbcTbl[7]) return 1; + if (c >= DbcTbl[8] && c <= DbcTbl[9]) return 1; + } +#else /* SBCS fixed code page */ + if (c != 0) return 0; /* Always false */ +#endif + return 0; +} + + +#if FF_USE_LFN + +/* Get a character from TCHAR string in defined API encodeing */ +static DWORD tchar2uni ( /* Returns character in UTF-16 encoding (>=0x10000 on double encoding unit, 0xFFFFFFFF on decode error) */ + const TCHAR** str /* Pointer to pointer to TCHAR string in configured encoding */ +) +{ + DWORD uc; + const TCHAR *p = *str; + +#if FF_LFN_UNICODE == 1 /* UTF-16 input */ + WCHAR wc; + + uc = *p++; /* Get a unit */ + if (IsSurrogate(uc)) { /* Surrogate? */ + wc = *p++; /* Get low surrogate */ + if (!IsSurrogateH(uc) || !IsSurrogateL(wc)) return 0xFFFFFFFF; /* Wrong surrogate? */ + uc = uc << 16 | wc; + } + +#elif FF_LFN_UNICODE == 2 /* UTF-8 input */ + BYTE b; + int nf; + + uc = (BYTE)*p++; /* Get a unit */ + if (uc & 0x80) { /* Multiple byte code? */ + if ((uc & 0xE0) == 0xC0) { /* 2-byte sequence? */ + uc &= 0x1F; nf = 1; + } else { + if ((uc & 0xF0) == 0xE0) { /* 3-byte sequence? */ + uc &= 0x0F; nf = 2; + } else { + if ((uc & 0xF8) == 0xF0) { /* 4-byte sequence? */ + uc &= 0x07; nf = 3; + } else { /* Wrong sequence */ + return 0xFFFFFFFF; + } + } + } + do { /* Get trailing bytes */ + b = (BYTE)*p++; + if ((b & 0xC0) != 0x80) return 0xFFFFFFFF; /* Wrong sequence? */ + uc = uc << 6 | (b & 0x3F); + } while (--nf != 0); + if (uc < 0x80 || IsSurrogate(uc) || uc >= 0x110000) return 0xFFFFFFFF; /* Wrong code? */ + if (uc >= 0x010000) uc = 0xD800DC00 | ((uc - 0x10000) << 6 & 0x3FF0000) | (uc & 0x3FF); /* Make a surrogate pair if needed */ + } + +#elif FF_LFN_UNICODE == 3 /* UTF-32 input */ + uc = (TCHAR)*p++; /* Get a unit */ + if (uc >= 0x110000) return 0xFFFFFFFF; /* Wrong code? */ + if (uc >= 0x010000) uc = 0xD800DC00 | ((uc - 0x10000) << 6 & 0x3FF0000) | (uc & 0x3FF); /* Make a surrogate pair if needed */ + +#else /* ANSI/OEM input */ + BYTE b; + WCHAR wc; + + wc = (BYTE)*p++; /* Get a byte */ + if (dbc_1st((BYTE)wc)) { /* Is it a DBC 1st byte? */ + b = (BYTE)*p++; /* Get 2nd byte */ + if (!dbc_2nd(b)) return 0xFFFFFFFF; /* Invalid code? */ + wc = (wc << 8) + b; /* Make a DBC */ + } + if (wc != 0) { + wc = ff_oem2uni(wc, CODEPAGE); /* ANSI/OEM ==> Unicode */ + if (wc == 0) return 0xFFFFFFFF; /* Invalid code? */ + } + uc = wc; + +#endif + *str = p; /* Next read pointer */ + return uc; +} + + +/* Output a TCHAR string in defined API encoding */ +static BYTE put_utf ( /* Returns number of encoding units written (0:buffer overflow or wrong encoding) */ + DWORD chr, /* UTF-16 encoded character (Double encoding unit char if >=0x10000) */ + TCHAR* buf, /* Output buffer */ + UINT szb /* Size of the buffer */ +) +{ +#if FF_LFN_UNICODE == 1 /* UTF-16 output */ + WCHAR hs, wc; + + hs = (WCHAR)(chr >> 16); + wc = (WCHAR)chr; + if (hs == 0) { /* Single encoding unit? */ + if (szb < 1 || IsSurrogate(wc)) return 0; /* Buffer overflow or wrong code? */ + *buf = wc; + return 1; + } + if (szb < 2 || !IsSurrogateH(hs) || !IsSurrogateL(wc)) return 0; /* Buffer overflow or wrong surrogate? */ + *buf++ = hs; + *buf++ = wc; + return 2; + +#elif FF_LFN_UNICODE == 2 /* UTF-8 output */ + DWORD hc; + + if (chr < 0x80) { /* Single byte code? */ + if (szb < 1) return 0; /* Buffer overflow? */ + *buf = (TCHAR)chr; + return 1; + } + if (chr < 0x800) { /* 2-byte sequence? */ + if (szb < 2) return 0; /* Buffer overflow? */ + *buf++ = (TCHAR)(0xC0 | (chr >> 6 & 0x1F)); + *buf++ = (TCHAR)(0x80 | (chr >> 0 & 0x3F)); + return 2; + } + if (chr < 0x10000) { /* 3-byte sequence? */ + if (szb < 3 || IsSurrogate(chr)) return 0; /* Buffer overflow or wrong code? */ + *buf++ = (TCHAR)(0xE0 | (chr >> 12 & 0x0F)); + *buf++ = (TCHAR)(0x80 | (chr >> 6 & 0x3F)); + *buf++ = (TCHAR)(0x80 | (chr >> 0 & 0x3F)); + return 3; + } + /* 4-byte sequence */ + if (szb < 4) return 0; /* Buffer overflow? */ + hc = ((chr & 0xFFFF0000) - 0xD8000000) >> 6; /* Get high 10 bits */ + chr = (chr & 0xFFFF) - 0xDC00; /* Get low 10 bits */ + if (hc >= 0x100000 || chr >= 0x400) return 0; /* Wrong surrogate? */ + chr = (hc | chr) + 0x10000; + *buf++ = (TCHAR)(0xF0 | (chr >> 18 & 0x07)); + *buf++ = (TCHAR)(0x80 | (chr >> 12 & 0x3F)); + *buf++ = (TCHAR)(0x80 | (chr >> 6 & 0x3F)); + *buf++ = (TCHAR)(0x80 | (chr >> 0 & 0x3F)); + return 4; + +#elif FF_LFN_UNICODE == 3 /* UTF-32 output */ + DWORD hc; + + if (szb < 1) return 0; /* Buffer overflow? */ + if (chr >= 0x10000) { /* Out of BMP? */ + hc = ((chr & 0xFFFF0000) - 0xD8000000) >> 6; /* Get high 10 bits */ + chr = (chr & 0xFFFF) - 0xDC00; /* Get low 10 bits */ + if (hc >= 0x100000 || chr >= 0x400) return 0; /* Wrong surrogate? */ + chr = (hc | chr) + 0x10000; + } + *buf++ = (TCHAR)chr; + return 1; + +#else /* ANSI/OEM output */ + WCHAR wc; + + wc = ff_uni2oem(chr, CODEPAGE); + if (wc >= 0x100) { /* Is this a DBC? */ + if (szb < 2) return 0; + *buf++ = (char)(wc >> 8); /* Store DBC 1st byte */ + *buf++ = (TCHAR)wc; /* Store DBC 2nd byte */ + return 2; + } + if (wc == 0 || szb < 1) return 0; /* Invalid char or buffer overflow? */ + *buf++ = (TCHAR)wc; /* Store the character */ + return 1; +#endif +} +#endif /* FF_USE_LFN */ + + +#if FF_FS_REENTRANT +/*-----------------------------------------------------------------------*/ +/* Request/Release grant to access the volume */ +/*-----------------------------------------------------------------------*/ +static int lock_fs ( /* 1:Ok, 0:timeout */ + FATFS* fs /* Filesystem object */ +) +{ + return ff_req_grant(fs->sobj); +} + + +static void unlock_fs ( + FATFS* fs, /* Filesystem object */ + FRESULT res /* Result code to be returned */ +) +{ + if (fs && res != FR_NOT_ENABLED && res != FR_INVALID_DRIVE && res != FR_TIMEOUT) { + ff_rel_grant(fs->sobj); + } +} + +#endif + + + +#if FF_FS_LOCK != 0 +/*-----------------------------------------------------------------------*/ +/* File lock control functions */ +/*-----------------------------------------------------------------------*/ + +static FRESULT chk_lock ( /* Check if the file can be accessed */ + DIR* dp, /* Directory object pointing the file to be checked */ + int acc /* Desired access type (0:Read mode open, 1:Write mode open, 2:Delete or rename) */ +) +{ + UINT i, be; + + /* Search open object table for the object */ + be = 0; + for (i = 0; i < FF_FS_LOCK; i++) { + if (Files[i].fs) { /* Existing entry */ + if (Files[i].fs == dp->obj.fs && /* Check if the object matches with an open object */ + Files[i].clu == dp->obj.sclust && + Files[i].ofs == dp->dptr) break; + } else { /* Blank entry */ + be = 1; + } + } + if (i == FF_FS_LOCK) { /* The object has not been opened */ + return (!be && acc != 2) ? FR_TOO_MANY_OPEN_FILES : FR_OK; /* Is there a blank entry for new object? */ + } + + /* The object was opened. Reject any open against writing file and all write mode open */ + return (acc != 0 || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK; +} + + +static int enq_lock (void) /* Check if an entry is available for a new object */ +{ + UINT i; + + for (i = 0; i < FF_FS_LOCK && Files[i].fs; i++) ; + return (i == FF_FS_LOCK) ? 0 : 1; +} + + +static UINT inc_lock ( /* Increment object open counter and returns its index (0:Internal error) */ + DIR* dp, /* Directory object pointing the file to register or increment */ + int acc /* Desired access (0:Read, 1:Write, 2:Delete/Rename) */ +) +{ + UINT i; + + + for (i = 0; i < FF_FS_LOCK; i++) { /* Find the object */ + if (Files[i].fs == dp->obj.fs && + Files[i].clu == dp->obj.sclust && + Files[i].ofs == dp->dptr) break; + } + + if (i == FF_FS_LOCK) { /* Not opened. Register it as new. */ + for (i = 0; i < FF_FS_LOCK && Files[i].fs; i++) ; + if (i == FF_FS_LOCK) return 0; /* No free entry to register (int err) */ + Files[i].fs = dp->obj.fs; + Files[i].clu = dp->obj.sclust; + Files[i].ofs = dp->dptr; + Files[i].ctr = 0; + } + + if (acc >= 1 && Files[i].ctr) return 0; /* Access violation (int err) */ + + Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1; /* Set semaphore value */ + + return i + 1; /* Index number origin from 1 */ +} + + +static FRESULT dec_lock ( /* Decrement object open counter */ + UINT i /* Semaphore index (1..) */ +) +{ + WORD n; + FRESULT res; + + + if (--i < FF_FS_LOCK) { /* Index number origin from 0 */ + n = Files[i].ctr; + if (n == 0x100) n = 0; /* If write mode open, delete the entry */ + if (n > 0) n--; /* Decrement read mode open count */ + Files[i].ctr = n; + if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */ + res = FR_OK; + } else { + res = FR_INT_ERR; /* Invalid index nunber */ + } + return res; +} + + +static void clear_lock ( /* Clear lock entries of the volume */ + FATFS *fs +) +{ + UINT i; + + for (i = 0; i < FF_FS_LOCK; i++) { + if (Files[i].fs == fs) Files[i].fs = 0; + } +} + +#endif /* FF_FS_LOCK != 0 */ + + + +/*-----------------------------------------------------------------------*/ +/* Move/Flush disk access window in the filesystem object */ +/*-----------------------------------------------------------------------*/ +#if !FF_FS_READONLY +static FRESULT sync_window ( /* Returns FR_OK or FR_DISK_ERR */ + FATFS* fs /* Filesystem object */ +) +{ + FRESULT res = FR_OK; + + + if (fs->wflag) { /* Is the disk access window dirty */ + if (disk_write(fs->pdrv, fs->win, fs->winsect, 1) == RES_OK) { /* Write back the window */ + fs->wflag = 0; /* Clear window dirty flag */ + if (fs->winsect - fs->fatbase < fs->fsize) { /* Is it in the 1st FAT? */ + if (fs->n_fats == 2) disk_write(fs->pdrv, fs->win, fs->winsect + fs->fsize, 1); /* Reflect it to 2nd FAT if needed */ + } + } else { + res = FR_DISK_ERR; + } + } + return res; +} +#endif + + +static FRESULT move_window ( /* Returns FR_OK or FR_DISK_ERR */ + FATFS* fs, /* Filesystem object */ + DWORD sector /* Sector number to make appearance in the fs->win[] */ +) +{ + FRESULT res = FR_OK; + + + if (sector != fs->winsect) { /* Window offset changed? */ +#if !FF_FS_READONLY + res = sync_window(fs); /* Write-back changes */ +#endif + if (res == FR_OK) { /* Fill sector window with new data */ + if (disk_read(fs->pdrv, fs->win, sector, 1) != RES_OK) { + sector = 0xFFFFFFFF; /* Invalidate window if read data is not valid */ + res = FR_DISK_ERR; + } + fs->winsect = sector; + } + } + return res; +} + + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Synchronize filesystem and data on the storage */ +/*-----------------------------------------------------------------------*/ + +static FRESULT sync_fs ( /* Returns FR_OK or FR_DISK_ERR */ + FATFS* fs /* Filesystem object */ +) +{ + FRESULT res; + + + res = sync_window(fs); + if (res == FR_OK) { + if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) { /* FAT32: Update FSInfo sector if needed */ + /* Create FSInfo structure */ + mem_set(fs->win, 0, sizeof fs->win); + st_word(fs->win + BS_55AA, 0xAA55); + st_dword(fs->win + FSI_LeadSig, 0x41615252); + st_dword(fs->win + FSI_StrucSig, 0x61417272); + st_dword(fs->win + FSI_Free_Count, fs->free_clst); + st_dword(fs->win + FSI_Nxt_Free, fs->last_clst); + /* Write it into the FSInfo sector */ + fs->winsect = fs->volbase + 1; + disk_write(fs->pdrv, fs->win, fs->winsect, 1); + fs->fsi_flag = 0; + } + /* Make sure that no pending write process in the lower layer */ + if (disk_ioctl(fs->pdrv, CTRL_SYNC, 0) != RES_OK) res = FR_DISK_ERR; + } + + return res; +} + +#endif + + + +/*-----------------------------------------------------------------------*/ +/* Get physical sector number from cluster number */ +/*-----------------------------------------------------------------------*/ + +static DWORD clst2sect ( /* !=0:Sector number, 0:Failed (invalid cluster#) */ + FATFS* fs, /* Filesystem object */ + DWORD clst /* Cluster# to be converted */ +) +{ + clst -= 2; /* Cluster number is origin from 2 */ + if (clst >= fs->n_fatent - 2) return 0; /* Is it invalid cluster number? */ + return fs->database + fs->csize * clst; /* Start sector number of the cluster */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* FAT access - Read value of a FAT entry */ +/*-----------------------------------------------------------------------*/ + +static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluster status */ + FFOBJID* obj, /* Corresponding object */ + DWORD clst /* Cluster number to get the value */ +) +{ + UINT wc, bc; + DWORD val; + FATFS *fs = obj->fs; + + + if (clst < 2 || clst >= fs->n_fatent) { /* Check if in valid range */ + val = 1; /* Internal error */ + + } else { + val = 0xFFFFFFFF; /* Default value falls on disk error */ + + switch (fs->fs_type) { + case FS_FAT12 : + bc = (UINT)clst; bc += bc / 2; + if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; + wc = fs->win[bc++ % SS(fs)]; /* Get 1st byte of the entry */ + if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; + wc |= fs->win[bc % SS(fs)] << 8; /* Merge 2nd byte of the entry */ + val = (clst & 1) ? (wc >> 4) : (wc & 0xFFF); /* Adjust bit position */ + break; + + case FS_FAT16 : + if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break; + val = ld_word(fs->win + clst * 2 % SS(fs)); /* Simple WORD array */ + break; + + case FS_FAT32 : + if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; + val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF; /* Simple DWORD array but mask out upper 4 bits */ + break; +#if FF_FS_EXFAT + case FS_EXFAT : + if ((obj->objsize != 0 && obj->sclust != 0) || obj->stat == 0) { /* Object except root dir must have valid data length */ + DWORD cofs = clst - obj->sclust; /* Offset from start cluster */ + DWORD clen = (DWORD)((obj->objsize - 1) / SS(fs)) / fs->csize; /* Number of clusters - 1 */ + + if (obj->stat == 2 && cofs <= clen) { /* Is it a contiguous chain? */ + val = (cofs == clen) ? 0x7FFFFFFF : clst + 1; /* No data on the FAT, generate the value */ + break; + } + if (obj->stat == 3 && cofs < obj->n_cont) { /* Is it in the 1st fragment? */ + val = clst + 1; /* Generate the value */ + break; + } + if (obj->stat != 2) { /* Get value from FAT if FAT chain is valid */ + if (obj->n_frag != 0) { /* Is it on the growing edge? */ + val = 0x7FFFFFFF; /* Generate EOC */ + } else { + if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; + val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x7FFFFFFF; + } + break; + } + } + /* go to default */ +#endif + default: + val = 1; /* Internal error */ + } + } + + return val; +} + + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* FAT access - Change value of a FAT entry */ +/*-----------------------------------------------------------------------*/ + +static FRESULT put_fat ( /* FR_OK(0):succeeded, !=0:error */ + FATFS* fs, /* Corresponding filesystem object */ + DWORD clst, /* FAT index number (cluster number) to be changed */ + DWORD val /* New value to be set to the entry */ +) +{ + UINT bc; + BYTE *p; + FRESULT res = FR_INT_ERR; + + + if (clst >= 2 && clst < fs->n_fatent) { /* Check if in valid range */ + switch (fs->fs_type) { + case FS_FAT12 : + bc = (UINT)clst; bc += bc / 2; /* bc: byte offset of the entry */ + res = move_window(fs, fs->fatbase + (bc / SS(fs))); + if (res != FR_OK) break; + p = fs->win + bc++ % SS(fs); + *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val; /* Put 1st byte */ + fs->wflag = 1; + res = move_window(fs, fs->fatbase + (bc / SS(fs))); + if (res != FR_OK) break; + p = fs->win + bc % SS(fs); + *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F)); /* Put 2nd byte */ + fs->wflag = 1; + break; + + case FS_FAT16 : + res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))); + if (res != FR_OK) break; + st_word(fs->win + clst * 2 % SS(fs), (WORD)val); /* Simple WORD array */ + fs->wflag = 1; + break; + + case FS_FAT32 : +#if FF_FS_EXFAT + case FS_EXFAT : +#endif + res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))); + if (res != FR_OK) break; + if (!FF_FS_EXFAT || fs->fs_type != FS_EXFAT) { + val = (val & 0x0FFFFFFF) | (ld_dword(fs->win + clst * 4 % SS(fs)) & 0xF0000000); + } + st_dword(fs->win + clst * 4 % SS(fs), val); + fs->wflag = 1; + break; + } + } + return res; +} + +#endif /* !FF_FS_READONLY */ + + + + +#if FF_FS_EXFAT && !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* exFAT: Accessing FAT and Allocation Bitmap */ +/*-----------------------------------------------------------------------*/ + +/*--------------------------------------*/ +/* Find a contiguous free cluster block */ +/*--------------------------------------*/ + +static DWORD find_bitmap ( /* 0:Not found, 2..:Cluster block found, 0xFFFFFFFF:Disk error */ + FATFS* fs, /* Filesystem object */ + DWORD clst, /* Cluster number to scan from */ + DWORD ncl /* Number of contiguous clusters to find (1..) */ +) +{ + BYTE bm, bv; + UINT i; + DWORD val, scl, ctr; + + + clst -= 2; /* The first bit in the bitmap corresponds to cluster #2 */ + if (clst >= fs->n_fatent - 2) clst = 0; + scl = val = clst; ctr = 0; + for (;;) { + if (move_window(fs, fs->bitbase + val / 8 / SS(fs)) != FR_OK) return 0xFFFFFFFF; + i = val / 8 % SS(fs); bm = 1 << (val % 8); + do { + do { + bv = fs->win[i] & bm; bm <<= 1; /* Get bit value */ + if (++val >= fs->n_fatent - 2) { /* Next cluster (with wrap-around) */ + val = 0; bm = 0; i = SS(fs); + } + if (bv == 0) { /* Is it a free cluster? */ + if (++ctr == ncl) return scl + 2; /* Check if run length is sufficient for required */ + } else { + scl = val; ctr = 0; /* Encountered a cluster in-use, restart to scan */ + } + if (val == clst) return 0; /* All cluster scanned? */ + } while (bm != 0); + bm = 1; + } while (++i < SS(fs)); + } +} + + +/*----------------------------------------*/ +/* Set/Clear a block of allocation bitmap */ +/*----------------------------------------*/ + +static FRESULT change_bitmap ( + FATFS* fs, /* Filesystem object */ + DWORD clst, /* Cluster number to change from */ + DWORD ncl, /* Number of clusters to be changed */ + int bv /* bit value to be set (0 or 1) */ +) +{ + BYTE bm; + UINT i; + DWORD sect; + + + clst -= 2; /* The first bit corresponds to cluster #2 */ + sect = fs->bitbase + clst / 8 / SS(fs); /* Sector address */ + i = clst / 8 % SS(fs); /* Byte offset in the sector */ + bm = 1 << (clst % 8); /* Bit mask in the byte */ + for (;;) { + if (move_window(fs, sect++) != FR_OK) return FR_DISK_ERR; + do { + do { + if (bv == (int)((fs->win[i] & bm) != 0)) return FR_INT_ERR; /* Is the bit expected value? */ + fs->win[i] ^= bm; /* Flip the bit */ + fs->wflag = 1; + if (--ncl == 0) return FR_OK; /* All bits processed? */ + } while (bm <<= 1); /* Next bit */ + bm = 1; + } while (++i < SS(fs)); /* Next byte */ + i = 0; + } +} + + +/*---------------------------------------------*/ +/* Fill the first fragment of the FAT chain */ +/*---------------------------------------------*/ + +static FRESULT fill_first_frag ( + FFOBJID* obj /* Pointer to the corresponding object */ +) +{ + FRESULT res; + DWORD cl, n; + + + if (obj->stat == 3) { /* Has the object been changed 'fragmented' in this session? */ + for (cl = obj->sclust, n = obj->n_cont; n; cl++, n--) { /* Create cluster chain on the FAT */ + res = put_fat(obj->fs, cl, cl + 1); + if (res != FR_OK) return res; + } + obj->stat = 0; /* Change status 'FAT chain is valid' */ + } + return FR_OK; +} + + +/*---------------------------------------------*/ +/* Fill the last fragment of the FAT chain */ +/*---------------------------------------------*/ + +static FRESULT fill_last_frag ( + FFOBJID* obj, /* Pointer to the corresponding object */ + DWORD lcl, /* Last cluster of the fragment */ + DWORD term /* Value to set the last FAT entry */ +) +{ + FRESULT res; + + + while (obj->n_frag > 0) { /* Create the chain of last fragment */ + res = put_fat(obj->fs, lcl - obj->n_frag + 1, (obj->n_frag > 1) ? lcl - obj->n_frag + 2 : term); + if (res != FR_OK) return res; + obj->n_frag--; + } + return FR_OK; +} + +#endif /* FF_FS_EXFAT && !FF_FS_READONLY */ + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* FAT handling - Remove a cluster chain */ +/*-----------------------------------------------------------------------*/ + +static FRESULT remove_chain ( /* FR_OK(0):succeeded, !=0:error */ + FFOBJID* obj, /* Corresponding object */ + DWORD clst, /* Cluster to remove a chain from */ + DWORD pclst /* Previous cluster of clst (0 if entire chain) */ +) +{ + FRESULT res = FR_OK; + DWORD nxt; + FATFS *fs = obj->fs; +#if FF_FS_EXFAT || FF_USE_TRIM + DWORD scl = clst, ecl = clst; +#endif +#if FF_USE_TRIM + DWORD rt[2]; +#endif + + if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Check if in valid range */ + + /* Mark the previous cluster 'EOC' on the FAT if it exists */ + if (pclst != 0 && (!FF_FS_EXFAT || fs->fs_type != FS_EXFAT || obj->stat != 2)) { + res = put_fat(fs, pclst, 0xFFFFFFFF); + if (res != FR_OK) return res; + } + + /* Remove the chain */ + do { + nxt = get_fat(obj, clst); /* Get cluster status */ + if (nxt == 0) break; /* Empty cluster? */ + if (nxt == 1) return FR_INT_ERR; /* Internal error? */ + if (nxt == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error? */ + if (!FF_FS_EXFAT || fs->fs_type != FS_EXFAT) { + res = put_fat(fs, clst, 0); /* Mark the cluster 'free' on the FAT */ + if (res != FR_OK) return res; + } + if (fs->free_clst < fs->n_fatent - 2) { /* Update FSINFO */ + fs->free_clst++; + fs->fsi_flag |= 1; + } +#if FF_FS_EXFAT || FF_USE_TRIM + if (ecl + 1 == nxt) { /* Is next cluster contiguous? */ + ecl = nxt; + } else { /* End of contiguous cluster block */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + res = change_bitmap(fs, scl, ecl - scl + 1, 0); /* Mark the cluster block 'free' on the bitmap */ + if (res != FR_OK) return res; + } +#endif +#if FF_USE_TRIM + rt[0] = clst2sect(fs, scl); /* Start of data area freed */ + rt[1] = clst2sect(fs, ecl) + fs->csize - 1; /* End of data area freed */ + disk_ioctl(fs->pdrv, CTRL_TRIM, rt); /* Inform device the data in the block is no longer needed */ +#endif + scl = ecl = nxt; + } +#endif + clst = nxt; /* Next cluster */ + } while (clst < fs->n_fatent); /* Repeat while not the last link */ + +#if FF_FS_EXFAT + /* Some post processes for chain status */ + if (fs->fs_type == FS_EXFAT) { + if (pclst == 0) { /* Has the entire chain been removed? */ + obj->stat = 0; /* Change the chain status 'initial' */ + } else { + if (obj->stat == 0) { /* Is it a fragmented chain from the beginning of this session? */ + clst = obj->sclust; /* Follow the chain to check if it gets contiguous */ + while (clst != pclst) { + nxt = get_fat(obj, clst); + if (nxt < 2) return FR_INT_ERR; + if (nxt == 0xFFFFFFFF) return FR_DISK_ERR; + if (nxt != clst + 1) break; /* Not contiguous? */ + clst++; + } + if (clst == pclst) { /* Has the chain got contiguous again? */ + obj->stat = 2; /* Change the chain status 'contiguous' */ + } + } else { + if (obj->stat == 3 && pclst >= obj->sclust && pclst <= obj->sclust + obj->n_cont) { /* Was the chain fragmented in this session and got contiguous again? */ + obj->stat = 2; /* Change the chain status 'contiguous' */ + } + } + } + } +#endif + return FR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* FAT handling - Stretch a chain or Create a new chain */ +/*-----------------------------------------------------------------------*/ + +static DWORD create_chain ( /* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */ + FFOBJID* obj, /* Corresponding object */ + DWORD clst /* Cluster# to stretch, 0:Create a new chain */ +) +{ + DWORD cs, ncl, scl; + FRESULT res; + FATFS *fs = obj->fs; + + + if (clst == 0) { /* Create a new chain */ + scl = fs->last_clst; /* Suggested cluster to start to find */ + if (scl == 0 || scl >= fs->n_fatent) scl = 1; + } + else { /* Stretch a chain */ + cs = get_fat(obj, clst); /* Check the cluster status */ + if (cs < 2) return 1; /* Test for insanity */ + if (cs == 0xFFFFFFFF) return cs; /* Test for disk error */ + if (cs < fs->n_fatent) return cs; /* It is already followed by next cluster */ + scl = clst; /* Cluster to start to find */ + } + if (fs->free_clst == 0) return 0; /* No free cluster */ + +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + ncl = find_bitmap(fs, scl, 1); /* Find a free cluster */ + if (ncl == 0 || ncl == 0xFFFFFFFF) return ncl; /* No free cluster or hard error? */ + res = change_bitmap(fs, ncl, 1, 1); /* Mark the cluster 'in use' */ + if (res == FR_INT_ERR) return 1; + if (res == FR_DISK_ERR) return 0xFFFFFFFF; + if (clst == 0) { /* Is it a new chain? */ + obj->stat = 2; /* Set status 'contiguous' */ + } else { /* It is a stretched chain */ + if (obj->stat == 2 && ncl != scl + 1) { /* Is the chain got fragmented? */ + obj->n_cont = scl - obj->sclust; /* Set size of the contiguous part */ + obj->stat = 3; /* Change status 'just fragmented' */ + } + } + if (obj->stat != 2) { /* Is the file non-contiguous? */ + if (ncl == clst + 1) { /* Is the cluster next to previous one? */ + obj->n_frag = obj->n_frag ? obj->n_frag + 1 : 2; /* Increment size of last framgent */ + } else { /* New fragment */ + if (obj->n_frag == 0) obj->n_frag = 1; + res = fill_last_frag(obj, clst, ncl); /* Fill last fragment on the FAT and link it to new one */ + if (res == FR_OK) obj->n_frag = 1; + } + } + } else +#endif + { /* On the FAT/FAT32 volume */ + ncl = 0; + if (scl == clst) { /* Stretching an existing chain? */ + ncl = scl + 1; /* Test if next cluster is free */ + if (ncl >= fs->n_fatent) ncl = 2; + cs = get_fat(obj, ncl); /* Get next cluster status */ + if (cs == 1 || cs == 0xFFFFFFFF) return cs; /* Test for error */ + if (cs != 0) { /* Not free? */ + cs = fs->last_clst; /* Start at suggested cluster if it is valid */ + if (cs >= 2 && cs < fs->n_fatent) scl = cs; + ncl = 0; + } + } + if (ncl == 0) { /* The new cluster cannot be contiguous and find another fragment */ + ncl = scl; /* Start cluster */ + for (;;) { + ncl++; /* Next cluster */ + if (ncl >= fs->n_fatent) { /* Check wrap-around */ + ncl = 2; + if (ncl > scl) return 0; /* No free cluster found? */ + } + cs = get_fat(obj, ncl); /* Get the cluster status */ + if (cs == 0) break; /* Found a free cluster? */ + if (cs == 1 || cs == 0xFFFFFFFF) return cs; /* Test for error */ + if (ncl == scl) return 0; /* No free cluster found? */ + } + } + res = put_fat(fs, ncl, 0xFFFFFFFF); /* Mark the new cluster 'EOC' */ + if (res == FR_OK && clst != 0) { + res = put_fat(fs, clst, ncl); /* Link it from the previous one if needed */ + } + } + + if (res == FR_OK) { /* Update FSINFO if function succeeded. */ + fs->last_clst = ncl; + if (fs->free_clst <= fs->n_fatent - 2) fs->free_clst--; + fs->fsi_flag |= 1; + } else { + ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1; /* Failed. Generate error status */ + } + + return ncl; /* Return new cluster number or error status */ +} + +#endif /* !FF_FS_READONLY */ + + + + +#if FF_USE_FASTSEEK +/*-----------------------------------------------------------------------*/ +/* FAT handling - Convert offset into cluster with link map table */ +/*-----------------------------------------------------------------------*/ + +static DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */ + FIL* fp, /* Pointer to the file object */ + FSIZE_t ofs /* File offset to be converted to cluster# */ +) +{ + DWORD cl, ncl, *tbl; + FATFS *fs = fp->obj.fs; + + + tbl = fp->cltbl + 1; /* Top of CLMT */ + cl = (DWORD)(ofs / SS(fs) / fs->csize); /* Cluster order from top of the file */ + for (;;) { + ncl = *tbl++; /* Number of cluters in the fragment */ + if (ncl == 0) return 0; /* End of table? (error) */ + if (cl < ncl) break; /* In this fragment? */ + cl -= ncl; tbl++; /* Next fragment */ + } + return cl + *tbl; /* Return the cluster number */ +} + +#endif /* FF_USE_FASTSEEK */ + + + + +/*-----------------------------------------------------------------------*/ +/* Directory handling - Fill a cluster with zeros */ +/*-----------------------------------------------------------------------*/ + +#if !FF_FS_READONLY +static FRESULT dir_clear ( /* Returns FR_OK or FR_DISK_ERR */ + FATFS *fs, /* Filesystem object */ + DWORD clst /* Directory table to clear */ +) +{ + DWORD sect; + UINT n, szb; + BYTE *ibuf; + + + if (sync_window(fs) != FR_OK) return FR_DISK_ERR; /* Flush disk access window */ + sect = clst2sect(fs, clst); /* Top of the cluster */ + fs->winsect = sect; /* Set window to top of the cluster */ + mem_set(fs->win, 0, sizeof fs->win); /* Clear window buffer */ +#if FF_USE_LFN == 3 /* Quick table clear by using multi-secter write */ + /* Allocate a temporary buffer */ + for (szb = ((DWORD)fs->csize * SS(fs) >= MAX_MALLOC) ? MAX_MALLOC : fs->csize * SS(fs), ibuf = 0; szb > SS(fs) && (ibuf = ff_memalloc(szb)) == 0; szb /= 2) ; + if (szb > SS(fs)) { /* Buffer allocated? */ + mem_set(ibuf, 0, szb); + szb /= SS(fs); /* Bytes -> Sectors */ + for (n = 0; n < fs->csize && disk_write(fs->pdrv, ibuf, sect + n, szb) == RES_OK; n += szb) ; /* Fill the cluster with 0 */ + ff_memfree(ibuf); + } else +#endif + { + ibuf = fs->win; szb = 1; /* Use window buffer (many single-sector writes may take a time) */ + for (n = 0; n < fs->csize && disk_write(fs->pdrv, ibuf, sect + n, szb) == RES_OK; n += szb) ; /* Fill the cluster with 0 */ + } + return (n == fs->csize) ? FR_OK : FR_DISK_ERR; +} +#endif /* !FF_FS_READONLY */ + + + + +/*-----------------------------------------------------------------------*/ +/* Directory handling - Set directory index */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_sdi ( /* FR_OK(0):succeeded, !=0:error */ + DIR* dp, /* Pointer to directory object */ + DWORD ofs /* Offset of directory table */ +) +{ + DWORD csz, clst; + FATFS *fs = dp->obj.fs; + + + if (ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR) || ofs % SZDIRE) { /* Check range of offset and alignment */ + return FR_INT_ERR; + } + dp->dptr = ofs; /* Set current offset */ + clst = dp->obj.sclust; /* Table start cluster (0:root) */ + if (clst == 0 && fs->fs_type >= FS_FAT32) { /* Replace cluster# 0 with root cluster# */ + clst = fs->dirbase; + if (FF_FS_EXFAT) dp->obj.stat = 0; /* exFAT: Root dir has an FAT chain */ + } + + if (clst == 0) { /* Static table (root-directory on the FAT volume) */ + if (ofs / SZDIRE >= fs->n_rootdir) return FR_INT_ERR; /* Is index out of range? */ + dp->sect = fs->dirbase; + + } else { /* Dynamic table (sub-directory or root-directory on the FAT32/exFAT volume) */ + csz = (DWORD)fs->csize * SS(fs); /* Bytes per cluster */ + while (ofs >= csz) { /* Follow cluster chain */ + clst = get_fat(&dp->obj, clst); /* Get next cluster */ + if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ + if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Reached to end of table or internal error */ + ofs -= csz; + } + dp->sect = clst2sect(fs, clst); + } + dp->clust = clst; /* Current cluster# */ + if (dp->sect == 0) return FR_INT_ERR; + dp->sect += ofs / SS(fs); /* Sector# of the directory entry */ + dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */ + + return FR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Directory handling - Move directory table index next */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */ + DIR* dp, /* Pointer to the directory object */ + int stretch /* 0: Do not stretch table, 1: Stretch table if needed */ +) +{ + DWORD ofs, clst; + FATFS *fs = dp->obj.fs; + + + ofs = dp->dptr + SZDIRE; /* Next entry */ + if (ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) dp->sect = 0; /* Disable it if the offset reached the max value */ + if (dp->sect == 0) return FR_NO_FILE; /* Report EOT if it has been disabled */ + + if (ofs % SS(fs) == 0) { /* Sector changed? */ + dp->sect++; /* Next sector */ + + if (dp->clust == 0) { /* Static table */ + if (ofs / SZDIRE >= fs->n_rootdir) { /* Report EOT if it reached end of static table */ + dp->sect = 0; return FR_NO_FILE; + } + } + else { /* Dynamic table */ + if ((ofs / SS(fs) & (fs->csize - 1)) == 0) { /* Cluster changed? */ + clst = get_fat(&dp->obj, dp->clust); /* Get next cluster */ + if (clst <= 1) return FR_INT_ERR; /* Internal error */ + if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ + if (clst >= fs->n_fatent) { /* It reached end of dynamic table */ +#if !FF_FS_READONLY + if (!stretch) { /* If no stretch, report EOT */ + dp->sect = 0; return FR_NO_FILE; + } + clst = create_chain(&dp->obj, dp->clust); /* Allocate a cluster */ + if (clst == 0) return FR_DENIED; /* No free cluster */ + if (clst == 1) return FR_INT_ERR; /* Internal error */ + if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ + if (dir_clear(fs, clst) != FR_OK) return FR_DISK_ERR; /* Clean up the stretched table */ + if (FF_FS_EXFAT) dp->obj.stat |= 4; /* exFAT: The directory has been stretched */ +#else + if (!stretch) dp->sect = 0; /* (this line is to suppress compiler warning) */ + dp->sect = 0; return FR_NO_FILE; /* Report EOT */ +#endif + } + dp->clust = clst; /* Initialize data for new cluster */ + dp->sect = clst2sect(fs, clst); + } + } + } + dp->dptr = ofs; /* Current entry */ + dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */ + + return FR_OK; +} + + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Directory handling - Reserve a block of directory entries */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_alloc ( /* FR_OK(0):succeeded, !=0:error */ + DIR* dp, /* Pointer to the directory object */ + UINT nent /* Number of contiguous entries to allocate */ +) +{ + FRESULT res; + UINT n; + FATFS *fs = dp->obj.fs; + + + res = dir_sdi(dp, 0); + if (res == FR_OK) { + n = 0; + do { + res = move_window(fs, dp->sect); + if (res != FR_OK) break; +#if FF_FS_EXFAT + if ((fs->fs_type == FS_EXFAT) ? (int)((dp->dir[XDIR_Type] & 0x80) == 0) : (int)(dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0)) { +#else + if (dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0) { +#endif + if (++n == nent) break; /* A block of contiguous free entries is found */ + } else { + n = 0; /* Not a blank entry. Restart to search */ + } + res = dir_next(dp, 1); + } while (res == FR_OK); /* Next entry with table stretch enabled */ + } + + if (res == FR_NO_FILE) res = FR_DENIED; /* No directory entry to allocate */ + return res; +} + +#endif /* !FF_FS_READONLY */ + + + + +/*-----------------------------------------------------------------------*/ +/* FAT: Directory handling - Load/Store start cluster number */ +/*-----------------------------------------------------------------------*/ + +static DWORD ld_clust ( /* Returns the top cluster value of the SFN entry */ + FATFS* fs, /* Pointer to the fs object */ + const BYTE* dir /* Pointer to the key entry */ +) +{ + DWORD cl; + + cl = ld_word(dir + DIR_FstClusLO); + if (fs->fs_type == FS_FAT32) { + cl |= (DWORD)ld_word(dir + DIR_FstClusHI) << 16; + } + + return cl; +} + + +#if !FF_FS_READONLY +static void st_clust ( + FATFS* fs, /* Pointer to the fs object */ + BYTE* dir, /* Pointer to the key entry */ + DWORD cl /* Value to be set */ +) +{ + st_word(dir + DIR_FstClusLO, (WORD)cl); + if (fs->fs_type == FS_FAT32) { + st_word(dir + DIR_FstClusHI, (WORD)(cl >> 16)); + } +} +#endif + + + +#if FF_USE_LFN +/*--------------------------------------------------------*/ +/* FAT-LFN: Compare a part of file name with an LFN entry */ +/*--------------------------------------------------------*/ + +static int cmp_lfn ( /* 1:matched, 0:not matched */ + const WCHAR* lfnbuf, /* Pointer to the LFN working buffer to be compared */ + BYTE* dir /* Pointer to the directory entry containing the part of LFN */ +) +{ + UINT i, s; + WCHAR wc, uc; + + + if (ld_word(dir + LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO */ + + i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13; /* Offset in the LFN buffer */ + + for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */ + uc = ld_word(dir + LfnOfs[s]); /* Pick an LFN character */ + if (wc != 0) { + if (i >= FF_MAX_LFN || ff_wtoupper(uc) != ff_wtoupper(lfnbuf[i++])) { /* Compare it */ + return 0; /* Not matched */ + } + wc = uc; + } else { + if (uc != 0xFFFF) return 0; /* Check filler */ + } + } + + if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i]) return 0; /* Last segment matched but different length */ + + return 1; /* The part of LFN matched */ +} + + +#if FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 || FF_USE_LABEL || FF_FS_EXFAT +/*-----------------------------------------------------*/ +/* FAT-LFN: Pick a part of file name from an LFN entry */ +/*-----------------------------------------------------*/ + +static int pick_lfn ( /* 1:succeeded, 0:buffer overflow or invalid LFN entry */ + WCHAR* lfnbuf, /* Pointer to the LFN working buffer */ + BYTE* dir /* Pointer to the LFN entry */ +) +{ + UINT i, s; + WCHAR wc, uc; + + + if (ld_word(dir + LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO is 0 */ + + i = ((dir[LDIR_Ord] & ~LLEF) - 1) * 13; /* Offset in the LFN buffer */ + + for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */ + uc = ld_word(dir + LfnOfs[s]); /* Pick an LFN character */ + if (wc != 0) { + if (i >= FF_MAX_LFN) return 0; /* Buffer overflow? */ + lfnbuf[i++] = wc = uc; /* Store it */ + } else { + if (uc != 0xFFFF) return 0; /* Check filler */ + } + } + + if (dir[LDIR_Ord] & LLEF) { /* Put terminator if it is the last LFN part */ + if (i >= FF_MAX_LFN) return 0; /* Buffer overflow? */ + lfnbuf[i] = 0; + } + + return 1; /* The part of LFN is valid */ +} +#endif + + +#if !FF_FS_READONLY +/*-----------------------------------------*/ +/* FAT-LFN: Create an entry of LFN entries */ +/*-----------------------------------------*/ + +static void put_lfn ( + const WCHAR* lfn, /* Pointer to the LFN */ + BYTE* dir, /* Pointer to the LFN entry to be created */ + BYTE ord, /* LFN order (1-20) */ + BYTE sum /* Checksum of the corresponding SFN */ +) +{ + UINT i, s; + WCHAR wc; + + + dir[LDIR_Chksum] = sum; /* Set checksum */ + dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */ + dir[LDIR_Type] = 0; + st_word(dir + LDIR_FstClusLO, 0); + + i = (ord - 1) * 13; /* Get offset in the LFN working buffer */ + s = wc = 0; + do { + if (wc != 0xFFFF) wc = lfn[i++]; /* Get an effective character */ + st_word(dir + LfnOfs[s], wc); /* Put it */ + if (wc == 0) wc = 0xFFFF; /* Padding characters for left locations */ + } while (++s < 13); + if (wc == 0xFFFF || !lfn[i]) ord |= LLEF; /* Last LFN part is the start of LFN sequence */ + dir[LDIR_Ord] = ord; /* Set the LFN order */ +} + +#endif /* !FF_FS_READONLY */ +#endif /* FF_USE_LFN */ + + + +#if FF_USE_LFN && !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* FAT-LFN: Create a Numbered SFN */ +/*-----------------------------------------------------------------------*/ + +static void gen_numname ( + BYTE* dst, /* Pointer to the buffer to store numbered SFN */ + const BYTE* src, /* Pointer to SFN */ + const WCHAR* lfn, /* Pointer to LFN */ + UINT seq /* Sequence number */ +) +{ + BYTE ns[8], c; + UINT i, j; + WCHAR wc; + DWORD sr; + + + mem_cpy(dst, src, 11); + + if (seq > 5) { /* In case of many collisions, generate a hash number instead of sequential number */ + sr = seq; + while (*lfn) { /* Create a CRC as hash value */ + wc = *lfn++; + for (i = 0; i < 16; i++) { + sr = (sr << 1) + (wc & 1); + wc >>= 1; + if (sr & 0x10000) sr ^= 0x11021; + } + } + seq = (UINT)sr; + } + + /* itoa (hexdecimal) */ + i = 7; + do { + c = (BYTE)((seq % 16) + '0'); + if (c > '9') c += 7; + ns[i--] = c; + seq /= 16; + } while (seq); + ns[i] = '~'; + + /* Append the number to the SFN body */ + for (j = 0; j < i && dst[j] != ' '; j++) { + if (dbc_1st(dst[j])) { + if (j == i - 1) break; + j++; + } + } + do { + dst[j++] = (i < 8) ? ns[i++] : ' '; + } while (j < 8); +} +#endif /* FF_USE_LFN && !FF_FS_READONLY */ + + + +#if FF_USE_LFN +/*-----------------------------------------------------------------------*/ +/* FAT-LFN: Calculate checksum of an SFN entry */ +/*-----------------------------------------------------------------------*/ + +static BYTE sum_sfn ( + const BYTE* dir /* Pointer to the SFN entry */ +) +{ + BYTE sum = 0; + UINT n = 11; + + do { + sum = (sum >> 1) + (sum << 7) + *dir++; + } while (--n); + return sum; +} + +#endif /* FF_USE_LFN */ + + + +#if FF_FS_EXFAT +/*-----------------------------------------------------------------------*/ +/* exFAT: Checksum */ +/*-----------------------------------------------------------------------*/ + +static WORD xdir_sum ( /* Get checksum of the directoly entry block */ + const BYTE* dir /* Directory entry block to be calculated */ +) +{ + UINT i, szblk; + WORD sum; + + + szblk = (dir[XDIR_NumSec] + 1) * SZDIRE; /* Number of bytes of the entry block */ + for (i = sum = 0; i < szblk; i++) { + if (i == XDIR_SetSum) { /* Skip 2-byte sum field */ + i++; + } else { + sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + dir[i]; + } + } + return sum; +} + + + +static WORD xname_sum ( /* Get check sum (to be used as hash) of the file name */ + const WCHAR* name /* File name to be calculated */ +) +{ + WCHAR chr; + WORD sum = 0; + + + while ((chr = *name++) != 0) { + chr = (WCHAR)ff_wtoupper(chr); /* File name needs to be up-case converted */ + sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + (chr & 0xFF); + sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + (chr >> 8); + } + return sum; +} + + +#if !FF_FS_READONLY && FF_USE_MKFS +static DWORD xsum32 ( /* Returns 32-bit checksum */ + BYTE dat, /* Byte to be calculated (byte-by-byte processing) */ + DWORD sum /* Previous sum value */ +) +{ + sum = ((sum & 1) ? 0x80000000 : 0) + (sum >> 1) + dat; + return sum; +} +#endif + + +#if FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 +/*------------------------------------------------------*/ +/* exFAT: Get object information from a directory block */ +/*------------------------------------------------------*/ + +static void get_xfileinfo ( + BYTE* dirb, /* Pointer to the direcotry entry block 85+C0+C1s */ + FILINFO* fno /* Buffer to store the extracted file information */ +) +{ + WCHAR wc, hs; + UINT di, si, nc; + + /* Get file name from the entry block */ + si = SZDIRE * 2; /* 1st C1 entry */ + nc = 0; hs = 0; di = 0; + while (nc < dirb[XDIR_NumName]) { + if (si >= MAXDIRB(FF_MAX_LFN)) { di = 0; break; } /* Truncated directory block? */ + if ((si % SZDIRE) == 0) si += 2; /* Skip entry type field */ + wc = ld_word(dirb + si); si += 2; nc++; /* Get a character */ + if (hs == 0 && IsSurrogate(wc)) { /* Is it a surrogate? */ + hs = wc; continue; /* Get low surrogate */ + } + wc = put_utf((DWORD)hs << 16 | wc, &fno->fname[di], FF_LFN_BUF - di); /* Store it in API encoding */ + if (wc == 0) { di = 0; break; } /* Buffer overflow or wrong encoding? */ + di += wc; + hs = 0; + } + if (hs != 0) di = 0; /* Broken surrogate pair? */ + if (di == 0) fno->fname[di++] = '?'; /* Inaccessible object name? */ + fno->fname[di] = 0; /* Terminate the name */ + fno->altname[0] = 0; /* exFAT does not support SFN */ + + fno->fattrib = dirb[XDIR_Attr]; /* Attribute */ + fno->fsize = (fno->fattrib & AM_DIR) ? 0 : ld_qword(dirb + XDIR_FileSize); /* Size */ + fno->ftime = ld_word(dirb + XDIR_ModTime + 0); /* Time */ + fno->fdate = ld_word(dirb + XDIR_ModTime + 2); /* Date */ +} + +#endif /* FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 */ + + +/*-----------------------------------*/ +/* exFAT: Get a directry entry block */ +/*-----------------------------------*/ + +static FRESULT load_xdir ( /* FR_INT_ERR: invalid entry block */ + DIR* dp /* Reading direcotry object pointing top of the entry block to load */ +) +{ + FRESULT res; + UINT i, sz_ent; + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the on-memory direcotry entry block 85+C0+C1s */ + + + /* Load file-directory entry */ + res = move_window(dp->obj.fs, dp->sect); + if (res != FR_OK) return res; + if (dp->dir[XDIR_Type] != ET_FILEDIR) return FR_INT_ERR; /* Invalid order */ + mem_cpy(dirb + 0 * SZDIRE, dp->dir, SZDIRE); + sz_ent = (dirb[XDIR_NumSec] + 1) * SZDIRE; + if (sz_ent < 3 * SZDIRE || sz_ent > 19 * SZDIRE) return FR_INT_ERR; + + /* Load stream-extension entry */ + res = dir_next(dp, 0); + if (res == FR_NO_FILE) res = FR_INT_ERR; /* It cannot be */ + if (res != FR_OK) return res; + res = move_window(dp->obj.fs, dp->sect); + if (res != FR_OK) return res; + if (dp->dir[XDIR_Type] != ET_STREAM) return FR_INT_ERR; /* Invalid order */ + mem_cpy(dirb + 1 * SZDIRE, dp->dir, SZDIRE); + if (MAXDIRB(dirb[XDIR_NumName]) > sz_ent) return FR_INT_ERR; + + /* Load file-name entries */ + i = 2 * SZDIRE; /* Name offset to load */ + do { + res = dir_next(dp, 0); + if (res == FR_NO_FILE) res = FR_INT_ERR; /* It cannot be */ + if (res != FR_OK) return res; + res = move_window(dp->obj.fs, dp->sect); + if (res != FR_OK) return res; + if (dp->dir[XDIR_Type] != ET_FILENAME) return FR_INT_ERR; /* Invalid order */ + if (i < MAXDIRB(FF_MAX_LFN)) mem_cpy(dirb + i, dp->dir, SZDIRE); + } while ((i += SZDIRE) < sz_ent); + + /* Sanity check (do it for only accessible object) */ + if (i <= MAXDIRB(FF_MAX_LFN)) { + if (xdir_sum(dirb) != ld_word(dirb + XDIR_SetSum)) return FR_INT_ERR; + } + return FR_OK; +} + + +/*------------------------------------------------------------------*/ +/* exFAT: Initialize object allocation info with loaded entry block */ +/*------------------------------------------------------------------*/ + +static void init_alloc_info ( + FATFS* fs, /* Filesystem object */ + FFOBJID* obj /* Object allocation information to be initialized */ +) +{ + obj->sclust = ld_dword(fs->dirbuf + XDIR_FstClus); /* Start cluster */ + obj->objsize = ld_qword(fs->dirbuf + XDIR_FileSize); /* Size */ + obj->stat = fs->dirbuf[XDIR_GenFlags] & 2; /* Allocation status */ + obj->n_frag = 0; /* No last fragment info */ +} + + + +#if !FF_FS_READONLY || FF_FS_RPATH != 0 +/*------------------------------------------------*/ +/* exFAT: Load the object's directory entry block */ +/*------------------------------------------------*/ + +static FRESULT load_obj_xdir ( + DIR* dp, /* Blank directory object to be used to access containing direcotry */ + const FFOBJID* obj /* Object with its containing directory information */ +) +{ + FRESULT res; + + /* Open object containing directory */ + dp->obj.fs = obj->fs; + dp->obj.sclust = obj->c_scl; + dp->obj.stat = (BYTE)obj->c_size; + dp->obj.objsize = obj->c_size & 0xFFFFFF00; + dp->obj.n_frag = 0; + dp->blk_ofs = obj->c_ofs; + + res = dir_sdi(dp, dp->blk_ofs); /* Goto object's entry block */ + if (res == FR_OK) { + res = load_xdir(dp); /* Load the object's entry block */ + } + return res; +} +#endif + + +#if !FF_FS_READONLY +/*----------------------------------------*/ +/* exFAT: Store the directory entry block */ +/*----------------------------------------*/ + +static FRESULT store_xdir ( + DIR* dp /* Pointer to the direcotry object */ +) +{ + FRESULT res; + UINT nent; + BYTE* dirb = dp->obj.fs->dirbuf; /* Pointer to the direcotry entry block 85+C0+C1s */ + + /* Create set sum */ + st_word(dirb + XDIR_SetSum, xdir_sum(dirb)); + nent = dirb[XDIR_NumSec] + 1; + + /* Store the direcotry entry block to the directory */ + res = dir_sdi(dp, dp->blk_ofs); + while (res == FR_OK) { + res = move_window(dp->obj.fs, dp->sect); + if (res != FR_OK) break; + mem_cpy(dp->dir, dirb, SZDIRE); + dp->obj.fs->wflag = 1; + if (--nent == 0) break; + dirb += SZDIRE; + res = dir_next(dp, 0); + } + return (res == FR_OK || res == FR_DISK_ERR) ? res : FR_INT_ERR; +} + + + +/*-------------------------------------------*/ +/* exFAT: Create a new directory enrty block */ +/*-------------------------------------------*/ + +static void create_xdir ( + BYTE* dirb, /* Pointer to the direcotry entry block buffer */ + const WCHAR* lfn /* Pointer to the object name */ +) +{ + UINT i; + BYTE nc1, nlen; + WCHAR wc; + + + /* Create file-directory and stream-extension entry */ + mem_set(dirb, 0, 2 * SZDIRE); + dirb[0 * SZDIRE + XDIR_Type] = ET_FILEDIR; + dirb[1 * SZDIRE + XDIR_Type] = ET_STREAM; + + /* Create file-name entries */ + i = SZDIRE * 2; /* Top of file_name entries */ + nlen = nc1 = 0; wc = 1; + do { + dirb[i++] = ET_FILENAME; dirb[i++] = 0; + do { /* Fill name field */ + if (wc != 0 && (wc = lfn[nlen]) != 0) nlen++; /* Get a character if exist */ + st_word(dirb + i, wc); /* Store it */ + i += 2; + } while (i % SZDIRE != 0); + nc1++; + } while (lfn[nlen]); /* Fill next entry if any char follows */ + + dirb[XDIR_NumName] = nlen; /* Set name length */ + dirb[XDIR_NumSec] = 1 + nc1; /* Set secondary count (C0 + C1s) */ + st_word(dirb + XDIR_NameHash, xname_sum(lfn)); /* Set name hash */ +} + +#endif /* !FF_FS_READONLY */ +#endif /* FF_FS_EXFAT */ + + + +#if FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 || FF_USE_LABEL || FF_FS_EXFAT +/*-----------------------------------------------------------------------*/ +/* Read an object from the directory */ +/*-----------------------------------------------------------------------*/ + +#define DIR_READ_FILE(dp) dir_read(dp, 0) +#define DIR_READ_LABEL(dp) dir_read(dp, 1) + +static FRESULT dir_read ( + DIR* dp, /* Pointer to the directory object */ + int vol /* Filtered by 0:file/directory or 1:volume label */ +) +{ + FRESULT res = FR_NO_FILE; + FATFS *fs = dp->obj.fs; + BYTE attr, b; +#if FF_USE_LFN + BYTE ord = 0xFF, sum = 0xFF; +#endif + + while (dp->sect) { + res = move_window(fs, dp->sect); + if (res != FR_OK) break; + b = dp->dir[DIR_Name]; /* Test for the entry type */ + if (b == 0) { + res = FR_NO_FILE; break; /* Reached to end of the directory */ + } +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + if (FF_USE_LABEL && vol) { + if (b == ET_VLABEL) break; /* Volume label entry? */ + } else { + if (b == ET_FILEDIR) { /* Start of the file entry block? */ + dp->blk_ofs = dp->dptr; /* Get location of the block */ + res = load_xdir(dp); /* Load the entry block */ + if (res == FR_OK) { + dp->obj.attr = fs->dirbuf[XDIR_Attr] & AM_MASK; /* Get attribute */ + } + break; + } + } + } else +#endif + { /* On the FAT/FAT32 volume */ + dp->obj.attr = attr = dp->dir[DIR_Attr] & AM_MASK; /* Get attribute */ +#if FF_USE_LFN /* LFN configuration */ + if (b == DDEM || b == '.' || (int)((attr & ~AM_ARC) == AM_VOL) != vol) { /* An entry without valid data */ + ord = 0xFF; + } else { + if (attr == AM_LFN) { /* An LFN entry is found */ + if (b & LLEF) { /* Is it start of an LFN sequence? */ + sum = dp->dir[LDIR_Chksum]; + b &= (BYTE)~LLEF; ord = b; + dp->blk_ofs = dp->dptr; + } + /* Check LFN validity and capture it */ + ord = (b == ord && sum == dp->dir[LDIR_Chksum] && pick_lfn(fs->lfnbuf, dp->dir)) ? ord - 1 : 0xFF; + } else { /* An SFN entry is found */ + if (ord != 0 || sum != sum_sfn(dp->dir)) { /* Is there a valid LFN? */ + dp->blk_ofs = 0xFFFFFFFF; /* It has no LFN. */ + } + break; + } + } +#else /* Non LFN configuration */ + if (b != DDEM && b != '.' && attr != AM_LFN && (int)((attr & ~AM_ARC) == AM_VOL) == vol) { /* Is it a valid entry? */ + break; + } +#endif + } + res = dir_next(dp, 0); /* Next entry */ + if (res != FR_OK) break; + } + + if (res != FR_OK) dp->sect = 0; /* Terminate the read operation on error or EOT */ + return res; +} + +#endif /* FF_FS_MINIMIZE <= 1 || FF_USE_LABEL || FF_FS_RPATH >= 2 */ + + + +/*-----------------------------------------------------------------------*/ +/* Directory handling - Find an object in the directory */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_find ( /* FR_OK(0):succeeded, !=0:error */ + DIR* dp /* Pointer to the directory object with the file name */ +) +{ + FRESULT res; + FATFS *fs = dp->obj.fs; + BYTE c; +#if FF_USE_LFN + BYTE a, ord, sum; +#endif + + res = dir_sdi(dp, 0); /* Rewind directory object */ + if (res != FR_OK) return res; +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + BYTE nc; + UINT di, ni; + WORD hash = xname_sum(fs->lfnbuf); /* Hash value of the name to find */ + + while ((res = DIR_READ_FILE(dp)) == FR_OK) { /* Read an item */ +#if FF_MAX_LFN < 255 + if (fs->dirbuf[XDIR_NumName] > FF_MAX_LFN) continue; /* Skip comparison if inaccessible object name */ +#endif + if (ld_word(fs->dirbuf + XDIR_NameHash) != hash) continue; /* Skip comparison if hash mismatched */ + for (nc = fs->dirbuf[XDIR_NumName], di = SZDIRE * 2, ni = 0; nc; nc--, di += 2, ni++) { /* Compare the name */ + if ((di % SZDIRE) == 0) di += 2; + if (ff_wtoupper(ld_word(fs->dirbuf + di)) != ff_wtoupper(fs->lfnbuf[ni])) break; + } + if (nc == 0 && !fs->lfnbuf[ni]) break; /* Name matched? */ + } + return res; + } +#endif + /* On the FAT/FAT32 volume */ +#if FF_USE_LFN + ord = sum = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ +#endif + do { + res = move_window(fs, dp->sect); + if (res != FR_OK) break; + c = dp->dir[DIR_Name]; + if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */ +#if FF_USE_LFN /* LFN configuration */ + dp->obj.attr = a = dp->dir[DIR_Attr] & AM_MASK; + if (c == DDEM || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */ + ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ + } else { + if (a == AM_LFN) { /* An LFN entry is found */ + if (!(dp->fn[NSFLAG] & NS_NOLFN)) { + if (c & LLEF) { /* Is it start of LFN sequence? */ + sum = dp->dir[LDIR_Chksum]; + c &= (BYTE)~LLEF; ord = c; /* LFN start order */ + dp->blk_ofs = dp->dptr; /* Start offset of LFN */ + } + /* Check validity of the LFN entry and compare it with given name */ + ord = (c == ord && sum == dp->dir[LDIR_Chksum] && cmp_lfn(fs->lfnbuf, dp->dir)) ? ord - 1 : 0xFF; + } + } else { /* An SFN entry is found */ + if (ord == 0 && sum == sum_sfn(dp->dir)) break; /* LFN matched? */ + if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */ + ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ + } + } +#else /* Non LFN configuration */ + dp->obj.attr = dp->dir[DIR_Attr] & AM_MASK; + if (!(dp->dir[DIR_Attr] & AM_VOL) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* Is it a valid entry? */ +#endif + res = dir_next(dp, 0); /* Next entry */ + } while (res == FR_OK); + + return res; +} + + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Register an object to the directory */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_register ( /* FR_OK:succeeded, FR_DENIED:no free entry or too many SFN collision, FR_DISK_ERR:disk error */ + DIR* dp /* Target directory with object name to be created */ +) +{ + FRESULT res; + FATFS *fs = dp->obj.fs; +#if FF_USE_LFN /* LFN configuration */ + UINT n, nlen, nent; + BYTE sn[12], sum; + + + if (dp->fn[NSFLAG] & (NS_DOT | NS_NONAME)) return FR_INVALID_NAME; /* Check name validity */ + for (nlen = 0; fs->lfnbuf[nlen]; nlen++) ; /* Get lfn length */ + +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + nent = (nlen + 14) / 15 + 2; /* Number of entries to allocate (85+C0+C1s) */ + res = dir_alloc(dp, nent); /* Allocate directory entries */ + if (res != FR_OK) return res; + dp->blk_ofs = dp->dptr - SZDIRE * (nent - 1); /* Set the allocated entry block offset */ + + if (dp->obj.stat & 4) { /* Has the directory been stretched by new allocation? */ + dp->obj.stat &= ~4; + res = fill_first_frag(&dp->obj); /* Fill the first fragment on the FAT if needed */ + if (res != FR_OK) return res; + res = fill_last_frag(&dp->obj, dp->clust, 0xFFFFFFFF); /* Fill the last fragment on the FAT if needed */ + if (res != FR_OK) return res; + if (dp->obj.sclust != 0) { /* Is it a sub-directory? */ + DIR dj; + + res = load_obj_xdir(&dj, &dp->obj); /* Load the object status */ + if (res != FR_OK) return res; + dp->obj.objsize += (DWORD)fs->csize * SS(fs); /* Increase the directory size by cluster size */ + st_qword(fs->dirbuf + XDIR_FileSize, dp->obj.objsize); /* Update the allocation status */ + st_qword(fs->dirbuf + XDIR_ValidFileSize, dp->obj.objsize); + fs->dirbuf[XDIR_GenFlags] = dp->obj.stat | 1; + res = store_xdir(&dj); /* Store the object status */ + if (res != FR_OK) return res; + } + } + + create_xdir(fs->dirbuf, fs->lfnbuf); /* Create on-memory directory block to be written later */ + return FR_OK; + } +#endif + /* On the FAT/FAT32 volume */ + mem_cpy(sn, dp->fn, 12); + if (sn[NSFLAG] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */ + dp->fn[NSFLAG] = NS_NOLFN; /* Find only SFN */ + for (n = 1; n < 100; n++) { + gen_numname(dp->fn, sn, fs->lfnbuf, n); /* Generate a numbered name */ + res = dir_find(dp); /* Check if the name collides with existing SFN */ + if (res != FR_OK) break; + } + if (n == 100) return FR_DENIED; /* Abort if too many collisions */ + if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */ + dp->fn[NSFLAG] = sn[NSFLAG]; + } + + /* Create an SFN with/without LFNs. */ + nent = (sn[NSFLAG] & NS_LFN) ? (nlen + 12) / 13 + 1 : 1; /* Number of entries to allocate */ + res = dir_alloc(dp, nent); /* Allocate entries */ + if (res == FR_OK && --nent) { /* Set LFN entry if needed */ + res = dir_sdi(dp, dp->dptr - nent * SZDIRE); + if (res == FR_OK) { + sum = sum_sfn(dp->fn); /* Checksum value of the SFN tied to the LFN */ + do { /* Store LFN entries in bottom first */ + res = move_window(fs, dp->sect); + if (res != FR_OK) break; + put_lfn(fs->lfnbuf, dp->dir, (BYTE)nent, sum); + fs->wflag = 1; + res = dir_next(dp, 0); /* Next entry */ + } while (res == FR_OK && --nent); + } + } + +#else /* Non LFN configuration */ + res = dir_alloc(dp, 1); /* Allocate an entry for SFN */ + +#endif + + /* Set SFN entry */ + if (res == FR_OK) { + res = move_window(fs, dp->sect); + if (res == FR_OK) { + mem_set(dp->dir, 0, SZDIRE); /* Clean the entry */ + mem_cpy(dp->dir + DIR_Name, dp->fn, 11); /* Put SFN */ +#if FF_USE_LFN + dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT); /* Put NT flag */ +#endif + fs->wflag = 1; + } + } + + return res; +} + +#endif /* !FF_FS_READONLY */ + + + +#if !FF_FS_READONLY && FF_FS_MINIMIZE == 0 +/*-----------------------------------------------------------------------*/ +/* Remove an object from the directory */ +/*-----------------------------------------------------------------------*/ + +static FRESULT dir_remove ( /* FR_OK:Succeeded, FR_DISK_ERR:A disk error */ + DIR* dp /* Directory object pointing the entry to be removed */ +) +{ + FRESULT res; + FATFS *fs = dp->obj.fs; +#if FF_USE_LFN /* LFN configuration */ + DWORD last = dp->dptr; + + res = (dp->blk_ofs == 0xFFFFFFFF) ? FR_OK : dir_sdi(dp, dp->blk_ofs); /* Goto top of the entry block if LFN is exist */ + if (res == FR_OK) { + do { + res = move_window(fs, dp->sect); + if (res != FR_OK) break; + if (FF_FS_EXFAT && fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + dp->dir[XDIR_Type] &= 0x7F; /* Clear the entry InUse flag. */ + } else { /* On the FAT/FAT32 volume */ + dp->dir[DIR_Name] = DDEM; /* Mark the entry 'deleted'. */ + } + fs->wflag = 1; + if (dp->dptr >= last) break; /* If reached last entry then all entries of the object has been deleted. */ + res = dir_next(dp, 0); /* Next entry */ + } while (res == FR_OK); + if (res == FR_NO_FILE) res = FR_INT_ERR; + } +#else /* Non LFN configuration */ + + res = move_window(fs, dp->sect); + if (res == FR_OK) { + dp->dir[DIR_Name] = DDEM; /* Mark the entry 'deleted'.*/ + fs->wflag = 1; + } +#endif + + return res; +} + +#endif /* !FF_FS_READONLY && FF_FS_MINIMIZE == 0 */ + + + +#if FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 +/*-----------------------------------------------------------------------*/ +/* Get file information from directory entry */ +/*-----------------------------------------------------------------------*/ + +static void get_fileinfo ( + DIR* dp, /* Pointer to the directory object */ + FILINFO* fno /* Pointer to the file information to be filled */ +) +{ + UINT si, di; +#if FF_USE_LFN + WCHAR wc, hs; + FATFS *fs = dp->obj.fs; +#else + TCHAR c; +#endif + + + fno->fname[0] = 0; /* Invaidate file info */ + if (dp->sect == 0) return; /* Exit if read pointer has reached end of directory */ + +#if FF_USE_LFN /* LFN configuration */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + get_xfileinfo(fs->dirbuf, fno); + return; + } else +#endif + { /* On the FAT/FAT32 volume */ + if (dp->blk_ofs != 0xFFFFFFFF) { /* Get LFN if available */ + si = di = hs = 0; + while (fs->lfnbuf[si] != 0) { + wc = fs->lfnbuf[si++]; /* Get an LFN character (UTF-16) */ + if (hs == 0 && IsSurrogate(wc)) { /* Is it a surrogate? */ + hs = wc; continue; /* Get low surrogate */ + } + wc = put_utf((DWORD)hs << 16 | wc, &fno->fname[di], FF_LFN_BUF - di); /* Store it in UTF-16 or UTF-8 encoding */ + if (wc == 0) { di = 0; break; } /* Invalid char or buffer overflow? */ + di += wc; + hs = 0; + } + if (hs != 0) di = 0; /* Broken surrogate pair? */ + fno->fname[di] = 0; /* Terminate the LFN (null string means LFN is invalid) */ + } + } + + si = di = 0; + while (si < 11) { /* Get SFN from SFN entry */ + wc = dp->dir[si++]; /* Get a char */ + if (wc == ' ') continue; /* Skip padding spaces */ + if (wc == RDDEM) wc = DDEM; /* Restore replaced DDEM character */ + if (si == 9 && di < FF_SFN_BUF) fno->altname[di++] = '.'; /* Insert a . if extension is exist */ +#if FF_LFN_UNICODE >= 1 /* Unicode output */ + if (dbc_1st((BYTE)wc) && si != 8 && si != 11 && dbc_2nd(dp->dir[si])) { /* Make a DBC if needed */ + wc = wc << 8 | dp->dir[si++]; + } + wc = ff_oem2uni(wc, CODEPAGE); /* ANSI/OEM -> Unicode */ + if (wc == 0) { di = 0; break; } /* Wrong char in the current code page? */ + wc = put_utf(wc, &fno->altname[di], FF_SFN_BUF - di); /* Store it in Unicode */ + if (wc == 0) { di = 0; break; } /* Buffer overflow? */ + di += wc; +#else /* ANSI/OEM output */ + fno->altname[di++] = (TCHAR)wc; /* Store it without any conversion */ +#endif + } + fno->altname[di] = 0; /* Terminate the SFN (null string means SFN is invalid) */ + + if (fno->fname[0] == 0) { /* If LFN is invalid, altname[] needs to be copied to fname[] */ + if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccesible */ + fno->fname[di++] = '?'; + } else { + for (si = di = 0; fno->altname[si]; si++, di++) { /* Copy altname[] to fname[] with case information */ + wc = (WCHAR)fno->altname[si]; + if (IsUpper(wc) && (dp->dir[DIR_NTres] & ((si >= 9) ? NS_EXT : NS_BODY))) wc += 0x20; + fno->fname[di] = (TCHAR)wc; + } + } + fno->fname[di] = 0; /* Terminate the LFN */ + if (!dp->dir[DIR_NTres]) fno->altname[0] = 0; /* Altname is not needed if neither LFN nor case info is exist. */ + } + +#else /* Non-LFN configuration */ + si = di = 0; + while (si < 11) { /* Copy name body and extension */ + c = (TCHAR)dp->dir[si++]; + if (c == ' ') continue; /* Skip padding spaces */ + if (c == RDDEM) c = DDEM; /* Restore replaced DDEM character */ + if (si == 9) fno->fname[di++] = '.';/* Insert a . if extension is exist */ + fno->fname[di++] = c; + } + fno->fname[di] = 0; +#endif + + fno->fattrib = dp->dir[DIR_Attr]; /* Attribute */ + fno->fsize = ld_dword(dp->dir + DIR_FileSize); /* Size */ + fno->ftime = ld_word(dp->dir + DIR_ModTime + 0); /* Time */ + fno->fdate = ld_word(dp->dir + DIR_ModTime + 2); /* Date */ +} + +#endif /* FF_FS_MINIMIZE <= 1 || FF_FS_RPATH >= 2 */ + + + +#if FF_USE_FIND && FF_FS_MINIMIZE <= 1 +/*-----------------------------------------------------------------------*/ +/* Pattern matching */ +/*-----------------------------------------------------------------------*/ + +static DWORD get_achar ( /* Get a character and advances ptr */ + const TCHAR** ptr /* Pointer to pointer to the ANSI/OEM or Unicode string */ +) +{ + DWORD chr; + + +#if FF_USE_LFN && FF_LFN_UNICODE >= 1 /* Unicode input */ + chr = tchar2uni(ptr); + if (chr == 0xFFFFFFFF) chr = 0; /* Wrong UTF encoding is recognized as end of the string */ + chr = ff_wtoupper(chr); + +#else /* ANSI/OEM input */ + chr = (BYTE)*(*ptr)++; /* Get a byte */ + if (IsLower(chr)) chr -= 0x20; /* To upper ASCII char */ +#if FF_CODE_PAGE == 0 + if (ExCvt && chr >= 0x80) chr = ExCvt[chr - 0x80]; /* To upper SBCS extended char */ +#elif FF_CODE_PAGE < 900 + if (chr >= 0x80) chr = ExCvt[chr - 0x80]; /* To upper SBCS extended char */ +#endif +#if FF_CODE_PAGE == 0 || FF_CODE_PAGE >= 900 + if (dbc_1st((BYTE)chr)) { /* Get DBC 2nd byte if needed */ + chr = dbc_2nd((BYTE)**ptr) ? chr << 8 | (BYTE)*(*ptr)++ : 0; + } +#endif + +#endif + return chr; +} + + +static int pattern_matching ( /* 0:not matched, 1:matched */ + const TCHAR* pat, /* Matching pattern */ + const TCHAR* nam, /* String to be tested */ + int skip, /* Number of pre-skip chars (number of ?s) */ + int inf /* Infinite search (* specified) */ +) +{ + const TCHAR *pp, *np; + DWORD pc, nc; + int nm, nx; + + + while (skip--) { /* Pre-skip name chars */ + if (!get_achar(&nam)) return 0; /* Branch mismatched if less name chars */ + } + if (*pat == 0 && inf) return 1; /* (short circuit) */ + + do { + pp = pat; np = nam; /* Top of pattern and name to match */ + for (;;) { + if (*pp == '?' || *pp == '*') { /* Wildcard? */ + nm = nx = 0; + do { /* Analyze the wildcard block */ + if (*pp++ == '?') nm++; else nx = 1; + } while (*pp == '?' || *pp == '*'); + if (pattern_matching(pp, np, nm, nx)) return 1; /* Test new branch (recurs upto number of wildcard blocks in the pattern) */ + nc = *np; break; /* Branch mismatched */ + } + pc = get_achar(&pp); /* Get a pattern char */ + nc = get_achar(&np); /* Get a name char */ + if (pc != nc) break; /* Branch mismatched? */ + if (pc == 0) return 1; /* Branch matched? (matched at end of both strings) */ + } + get_achar(&nam); /* nam++ */ + } while (inf && nc); /* Retry until end of name if infinite search is specified */ + + return 0; +} + +#endif /* FF_USE_FIND && FF_FS_MINIMIZE <= 1 */ + + + +/*-----------------------------------------------------------------------*/ +/* Pick a top segment and create the object name in directory form */ +/*-----------------------------------------------------------------------*/ + +static FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not create */ + DIR* dp, /* Pointer to the directory object */ + const TCHAR** path /* Pointer to pointer to the segment in the path string */ +) +{ +#if FF_USE_LFN /* LFN configuration */ + BYTE b, cf; + WCHAR wc, *lfn; + DWORD uc; + UINT i, ni, si, di; + const TCHAR *p; + + + /* Create LFN into LFN working buffer */ + p = *path; lfn = dp->obj.fs->lfnbuf; di = 0; + for (;;) { + uc = tchar2uni(&p); /* Get a character */ + if (uc == 0xFFFFFFFF) return FR_INVALID_NAME; /* Invalid code or UTF decode error */ + if (uc >= 0x10000) lfn[di++] = (WCHAR)(uc >> 16); /* Store high surrogate if needed */ + wc = (WCHAR)uc; + if (wc < ' ' || wc == '/' || wc == '\\') break; /* Break if end of the path or a separator is found */ + if (wc < 0x80 && chk_chr("\"*:<>\?|\x7F", wc)) return FR_INVALID_NAME; /* Reject illegal characters for LFN */ + if (di >= FF_MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */ + lfn[di++] = wc; /* Store the Unicode character */ + } + while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */ + *path = p; /* Return pointer to the next segment */ + cf = (wc < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */ + +#if FF_FS_RPATH != 0 + if ((di == 1 && lfn[di - 1] == '.') || + (di == 2 && lfn[di - 1] == '.' && lfn[di - 2] == '.')) { /* Is this segment a dot name? */ + lfn[di] = 0; + for (i = 0; i < 11; i++) { /* Create dot name for SFN entry */ + dp->fn[i] = (i < di) ? '.' : ' '; + } + dp->fn[i] = cf | NS_DOT; /* This is a dot entry */ + return FR_OK; + } +#endif + while (di) { /* Snip off trailing spaces and dots if exist */ + wc = lfn[di - 1]; + if (wc != ' ' && wc != '.') break; + di--; + } + lfn[di] = 0; /* LFN is created into the working buffer */ + if (di == 0) return FR_INVALID_NAME; /* Reject null name */ + + /* Create SFN in directory form */ + for (si = 0; lfn[si] == ' '; si++) ; /* Remove leading spaces */ + if (si > 0 || lfn[si] == '.') cf |= NS_LOSS | NS_LFN; /* Is there any leading space or dot? */ + while (di > 0 && lfn[di - 1] != '.') di--; /* Find last dot (di<=si: no extension) */ + + mem_set(dp->fn, ' ', 11); + i = b = 0; ni = 8; + for (;;) { + wc = lfn[si++]; /* Get an LFN character */ + if (wc == 0) break; /* Break on end of the LFN */ + if (wc == ' ' || (wc == '.' && si != di)) { /* Remove embedded spaces and dots */ + cf |= NS_LOSS | NS_LFN; + continue; + } + + if (i >= ni || si == di) { /* End of field? */ + if (ni == 11) { /* Name extension overflow? */ + cf |= NS_LOSS | NS_LFN; + break; + } + if (si != di) cf |= NS_LOSS | NS_LFN; /* Name body overflow? */ + if (si > di) break; /* No name extension? */ + si = di; i = 8; ni = 11; b <<= 2; /* Enter name extension */ + continue; + } + + if (wc >= 0x80) { /* Is this a non-ASCII character? */ + cf |= NS_LFN; /* LFN entry needs to be created */ +#if FF_CODE_PAGE == 0 + if (ExCvt) { /* At SBCS */ + wc = ff_uni2oem(wc, CODEPAGE); /* Unicode ==> ANSI/OEM code */ + if (wc & 0x80) wc = ExCvt[wc & 0x7F]; /* Convert extended character to upper (SBCS) */ + } else { /* At DBCS */ + wc = ff_uni2oem(ff_wtoupper(wc), CODEPAGE); /* Unicode ==> Upper convert ==> ANSI/OEM code */ + } +#elif FF_CODE_PAGE < 900 /* SBCS cfg */ + wc = ff_uni2oem(wc, CODEPAGE); /* Unicode ==> ANSI/OEM code */ + if (wc & 0x80) wc = ExCvt[wc & 0x7F]; /* Convert extended character to upper (SBCS) */ +#else /* DBCS cfg */ + wc = ff_uni2oem(ff_wtoupper(wc), CODEPAGE); /* Unicode ==> Upper convert ==> ANSI/OEM code */ +#endif + } + + if (wc >= 0x100) { /* Is this a DBC? */ + if (i >= ni - 1) { /* Field overflow? */ + cf |= NS_LOSS | NS_LFN; + i = ni; continue; /* Next field */ + } + dp->fn[i++] = (BYTE)(wc >> 8); /* Put 1st byte */ + } else { /* SBC */ + if (wc == 0 || chk_chr("+,;=[]", wc)) { /* Replace illegal characters for SFN if needed */ + wc = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */ + } else { + if (IsUpper(wc)) { /* ASCII upper case? */ + b |= 2; + } + if (IsLower(wc)) { /* ASCII lower case? */ + b |= 1; wc -= 0x20; + } + } + } + dp->fn[i++] = (BYTE)wc; + } + + if (dp->fn[0] == DDEM) dp->fn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */ + + if (ni == 8) b <<= 2; /* Shift capital flags if no extension */ + if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03) cf |= NS_LFN; /* LFN entry needs to be created if composite capitals */ + if (!(cf & NS_LFN)) { /* When LFN is in 8.3 format without extended character, NT flags are created */ + if (b & 0x01) cf |= NS_EXT; /* NT flag (Extension has small capital letters only) */ + if (b & 0x04) cf |= NS_BODY; /* NT flag (Body has small capital letters only) */ + } + + dp->fn[NSFLAG] = cf; /* SFN is created into dp->fn[] */ + + return FR_OK; + + +#else /* FF_USE_LFN : Non-LFN configuration */ + BYTE c, d, *sfn; + UINT ni, si, i; + const char *p; + + /* Create file name in directory form */ + p = *path; sfn = dp->fn; + mem_set(sfn, ' ', 11); + si = i = 0; ni = 8; +#if FF_FS_RPATH != 0 + if (p[si] == '.') { /* Is this a dot entry? */ + for (;;) { + c = (BYTE)p[si++]; + if (c != '.' || si >= 3) break; + sfn[i++] = c; + } + if (c != '/' && c != '\\' && c > ' ') return FR_INVALID_NAME; + *path = p + si; /* Return pointer to the next segment */ + sfn[NSFLAG] = (c <= ' ') ? NS_LAST | NS_DOT : NS_DOT; /* Set last segment flag if end of the path */ + return FR_OK; + } +#endif + for (;;) { + c = (BYTE)p[si++]; /* Get a byte */ + if (c <= ' ') break; /* Break if end of the path name */ + if (c == '/' || c == '\\') { /* Break if a separator is found */ + while (p[si] == '/' || p[si] == '\\') si++; /* Skip duplicated separator if exist */ + break; + } + if (c == '.' || i >= ni) { /* End of body or field overflow? */ + if (ni == 11 || c != '.') return FR_INVALID_NAME; /* Field overflow or invalid dot? */ + i = 8; ni = 11; /* Enter file extension field */ + continue; + } +#if FF_CODE_PAGE == 0 + if (ExCvt && c >= 0x80) { /* Is SBC extended character? */ + c = ExCvt[c & 0x7F]; /* To upper SBC extended character */ + } +#elif FF_CODE_PAGE < 900 + if (c >= 0x80) { /* Is SBC extended character? */ + c = ExCvt[c & 0x7F]; /* To upper SBC extended character */ + } +#endif + if (dbc_1st(c)) { /* Check if it is a DBC 1st byte */ + d = (BYTE)p[si++]; /* Get 2nd byte */ + if (!dbc_2nd(d) || i >= ni - 1) return FR_INVALID_NAME; /* Reject invalid DBC */ + sfn[i++] = c; + sfn[i++] = d; + } else { /* SBC */ + if (chk_chr("\"*+,:;<=>\?[]|\x7F", c)) return FR_INVALID_NAME; /* Reject illegal chrs for SFN */ + if (IsLower(c)) c -= 0x20; /* To upper */ + sfn[i++] = c; + } + } + *path = p + si; /* Return pointer to the next segment */ + if (i == 0) return FR_INVALID_NAME; /* Reject nul string */ + + if (sfn[0] == DDEM) sfn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */ + sfn[NSFLAG] = (c <= ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */ + + return FR_OK; +#endif /* FF_USE_LFN */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Follow a file path */ +/*-----------------------------------------------------------------------*/ + +static FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */ + DIR* dp, /* Directory object to return last directory and found object */ + const TCHAR* path /* Full-path string to find a file or directory */ +) +{ + FRESULT res; + BYTE ns; + FATFS *fs = dp->obj.fs; + + +#if FF_FS_RPATH != 0 + if (*path != '/' && *path != '\\') { /* Without heading separator */ + dp->obj.sclust = fs->cdir; /* Start from current directory */ + } else +#endif + { /* With heading separator */ + while (*path == '/' || *path == '\\') path++; /* Strip heading separator */ + dp->obj.sclust = 0; /* Start from root directory */ + } +#if FF_FS_EXFAT + dp->obj.n_frag = 0; /* Invalidate last fragment counter of the object */ +#if FF_FS_RPATH != 0 + if (fs->fs_type == FS_EXFAT && dp->obj.sclust) { /* exFAT: Retrieve the sub-directory's status */ + DIR dj; + + dp->obj.c_scl = fs->cdc_scl; + dp->obj.c_size = fs->cdc_size; + dp->obj.c_ofs = fs->cdc_ofs; + res = load_obj_xdir(&dj, &dp->obj); + if (res != FR_OK) return res; + dp->obj.objsize = ld_dword(fs->dirbuf + XDIR_FileSize); + dp->obj.stat = fs->dirbuf[XDIR_GenFlags] & 2; + } +#endif +#endif + + if ((UINT)*path < ' ') { /* Null path name is the origin directory itself */ + dp->fn[NSFLAG] = NS_NONAME; + res = dir_sdi(dp, 0); + + } else { /* Follow path */ + for (;;) { + res = create_name(dp, &path); /* Get a segment name of the path */ + if (res != FR_OK) break; + res = dir_find(dp); /* Find an object with the segment name */ + ns = dp->fn[NSFLAG]; + if (res != FR_OK) { /* Failed to find the object */ + if (res == FR_NO_FILE) { /* Object is not found */ + if (FF_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exist, stay there */ + if (!(ns & NS_LAST)) continue; /* Continue to follow if not last segment */ + dp->fn[NSFLAG] = NS_NONAME; + res = FR_OK; + } else { /* Could not find the object */ + if (!(ns & NS_LAST)) res = FR_NO_PATH; /* Adjust error code if not last segment */ + } + } + break; + } + if (ns & NS_LAST) break; /* Last segment matched. Function completed. */ + /* Get into the sub-directory */ + if (!(dp->obj.attr & AM_DIR)) { /* It is not a sub-directory and cannot follow */ + res = FR_NO_PATH; break; + } +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* Save containing directory information for next dir */ + dp->obj.c_scl = dp->obj.sclust; + dp->obj.c_size = ((DWORD)dp->obj.objsize & 0xFFFFFF00) | dp->obj.stat; + dp->obj.c_ofs = dp->blk_ofs; + init_alloc_info(fs, &dp->obj); /* Open next directory */ + } else +#endif + { + dp->obj.sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */ + } + } + } + + return res; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Get logical drive number from path name */ +/*-----------------------------------------------------------------------*/ + +static int get_ldnumber ( /* Returns logical drive number (-1:invalid drive number or null pointer) */ + const TCHAR** path /* Pointer to pointer to the path name */ +) +{ + const TCHAR *tp, *tt; + TCHAR tc; + int i, vol = -1; +#if FF_STR_VOLUME_ID /* Find string volume ID */ + const char *sp; + char c; +#endif + + tt = tp = *path; + if (!tp) return vol; /* Invalid path name? */ + do tc = *tt++; while ((UINT)tc >= (FF_USE_LFN ? ' ' : '!') && tc != ':'); /* Find a colon in the path */ + + if (tc == ':') { /* DOS/Windows style volume ID? */ + i = FF_VOLUMES; + if (IsDigit(*tp) && tp + 2 == tt) { /* Is there a numeric volume ID + colon? */ + i = (int)*tp - '0'; /* Get the LD number */ + } +#if FF_STR_VOLUME_ID == 1 /* Arbitrary string is enabled */ + else { + i = 0; + do { + sp = VolumeStr[i]; tp = *path; /* This string volume ID and path name */ + do { /* Compare the volume ID with path name */ + c = *sp++; tc = *tp++; + if (IsLower(c)) c -= 0x20; + if (IsLower(tc)) tc -= 0x20; + } while (c && (TCHAR)c == tc); + } while ((c || tp != tt) && ++i < FF_VOLUMES); /* Repeat for each id until pattern match */ + } +#endif + if (i < FF_VOLUMES) { /* If a volume ID is found, get the drive number and strip it */ + vol = i; /* Drive number */ + *path = tt; /* Snip the drive prefix off */ + } + return vol; + } +#if FF_STR_VOLUME_ID == 2 /* Unix style volume ID is enabled */ + if (*tp == '/') { + i = 0; + do { + sp = VolumeStr[i]; tp = *path; /* This string volume ID and path name */ + do { /* Compare the volume ID with path name */ + c = *sp++; tc = *(++tp); + if (IsLower(c)) c -= 0x20; + if (IsLower(tc)) tc -= 0x20; + } while (c && (TCHAR)c == tc); + } while ((c || (tc != '/' && (UINT)tc >= (FF_USE_LFN ? ' ' : '!'))) && ++i < FF_VOLUMES); /* Repeat for each ID until pattern match */ + if (i < FF_VOLUMES) { /* If a volume ID is found, get the drive number and strip it */ + vol = i; /* Drive number */ + *path = tp; /* Snip the drive prefix off */ + return vol; + } + } +#endif + /* No drive prefix is found */ +#if FF_FS_RPATH != 0 + vol = CurrVol; /* Default drive is current drive */ +#else + vol = 0; /* Default drive is 0 */ +#endif + return vol; /* Return the default drive */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Load a sector and check if it is an FAT VBR */ +/*-----------------------------------------------------------------------*/ + +static BYTE check_fs ( /* 0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error */ + FATFS* fs, /* Filesystem object */ + DWORD sect /* Sector# (lba) to load and check if it is an FAT-VBR or not */ +) +{ + fs->wflag = 0; fs->winsect = 0xFFFFFFFF; /* Invaidate window */ + if (move_window(fs, sect) != FR_OK) return 4; /* Load boot record */ + + if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3; /* Check boot record signature (always here regardless of the sector size) */ + +#if FF_FS_EXFAT + if (!mem_cmp(fs->win + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11)) return 1; /* Check if exFAT VBR */ +#endif + if (fs->win[BS_JmpBoot] == 0xE9 || fs->win[BS_JmpBoot] == 0xEB || fs->win[BS_JmpBoot] == 0xE8) { /* Valid JumpBoot code? */ + if (!mem_cmp(fs->win + BS_FilSysType, "FAT", 3)) return 0; /* Is it an FAT VBR? */ + if (!mem_cmp(fs->win + BS_FilSysType32, "FAT32", 5)) return 0; /* Is it an FAT32 VBR? */ + } + return 2; /* Valid BS but not FAT */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Determine logical drive number and mount the volume if needed */ +/*-----------------------------------------------------------------------*/ + +static FRESULT find_volume ( /* FR_OK(0): successful, !=0: an error occurred */ + const TCHAR** path, /* Pointer to pointer to the path name (drive number) */ + FATFS** rfs, /* Pointer to pointer to the found filesystem object */ + BYTE mode /* !=0: Check write protection for write access */ +) +{ + BYTE fmt, *pt; + int vol; + DSTATUS stat; + DWORD bsect, fasize, tsect, sysect, nclst, szbfat, br[4]; + WORD nrsv; + FATFS *fs; + UINT i; + + + /* Get logical drive number */ + *rfs = 0; + vol = get_ldnumber(path); + if (vol < 0) return FR_INVALID_DRIVE; + + /* Check if the filesystem object is valid or not */ + fs = FatFs[vol]; /* Get pointer to the filesystem object */ + if (!fs) return FR_NOT_ENABLED; /* Is the filesystem object available? */ +#if FF_FS_REENTRANT + if (!lock_fs(fs)) return FR_TIMEOUT; /* Lock the volume */ +#endif + *rfs = fs; /* Return pointer to the filesystem object */ + + mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */ + if (fs->fs_type != 0) { /* If the volume has been mounted */ + stat = disk_status(fs->pdrv); + if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized */ + if (!FF_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check write protection if needed */ + return FR_WRITE_PROTECTED; + } + return FR_OK; /* The filesystem object is valid */ + } + } + + /* The filesystem object is not valid. */ + /* Following code attempts to mount the volume. (analyze BPB and initialize the filesystem object) */ + + fs->fs_type = 0; /* Clear the filesystem object */ + fs->pdrv = LD2PD(vol); /* Bind the logical drive and a physical drive */ + stat = disk_initialize(fs->pdrv); /* Initialize the physical drive */ + if (stat & STA_NOINIT) { /* Check if the initialization succeeded */ + return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */ + } + if (!FF_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check disk write protection if needed */ + return FR_WRITE_PROTECTED; + } +#if FF_MAX_SS != FF_MIN_SS /* Get sector size (multiple sector size cfg only) */ + if (disk_ioctl(fs->pdrv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR; + if (SS(fs) > FF_MAX_SS || SS(fs) < FF_MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR; +#endif + + /* Find an FAT partition on the drive. Supports only generic partitioning rules, FDISK (MBR) and SFD (w/o partition). */ + bsect = 0; + fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT-VBR as SFD */ + if (fmt == 2 || (fmt < 2 && LD2PT(vol) != 0)) { /* Not an FAT-VBR or forced partition number */ + for (i = 0; i < 4; i++) { /* Get partition offset */ + pt = fs->win + (MBR_Table + i * SZ_PTE); + br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0; + } + i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */ + if (i != 0) i--; + do { /* Find an FAT volume */ + bsect = br[i]; + fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */ + } while (LD2PT(vol) == 0 && fmt >= 2 && ++i < 4); + } + if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */ + if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */ + + /* An FAT volume is found (bsect). Following code initializes the filesystem object */ + +#if FF_FS_EXFAT + if (fmt == 1) { + QWORD maxlba; + DWORD so, cv, bcl; + + for (i = BPB_ZeroedEx; i < BPB_ZeroedEx + 53 && fs->win[i] == 0; i++) ; /* Check zero filler */ + if (i < BPB_ZeroedEx + 53) return FR_NO_FILESYSTEM; + + if (ld_word(fs->win + BPB_FSVerEx) != 0x100) return FR_NO_FILESYSTEM; /* Check exFAT version (must be version 1.0) */ + + if (1 << fs->win[BPB_BytsPerSecEx] != SS(fs)) { /* (BPB_BytsPerSecEx must be equal to the physical sector size) */ + return FR_NO_FILESYSTEM; + } + + maxlba = ld_qword(fs->win + BPB_TotSecEx) + bsect; /* Last LBA + 1 of the volume */ + if (maxlba >= 0x100000000) return FR_NO_FILESYSTEM; /* (It cannot be handled in 32-bit LBA) */ + + fs->fsize = ld_dword(fs->win + BPB_FatSzEx); /* Number of sectors per FAT */ + + fs->n_fats = fs->win[BPB_NumFATsEx]; /* Number of FATs */ + if (fs->n_fats != 1) return FR_NO_FILESYSTEM; /* (Supports only 1 FAT) */ + + fs->csize = 1 << fs->win[BPB_SecPerClusEx]; /* Cluster size */ + if (fs->csize == 0) return FR_NO_FILESYSTEM; /* (Must be 1..32768) */ + + nclst = ld_dword(fs->win + BPB_NumClusEx); /* Number of clusters */ + if (nclst > MAX_EXFAT) return FR_NO_FILESYSTEM; /* (Too many clusters) */ + fs->n_fatent = nclst + 2; + + /* Boundaries and Limits */ + fs->volbase = bsect; + fs->database = bsect + ld_dword(fs->win + BPB_DataOfsEx); + fs->fatbase = bsect + ld_dword(fs->win + BPB_FatOfsEx); + if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM; /* (Volume size must not be smaller than the size requiered) */ + fs->dirbase = ld_dword(fs->win + BPB_RootClusEx); + + /* Get bitmap location and check if it is contiguous (implementation assumption) */ + so = i = 0; + for (;;) { /* Find the bitmap entry in the root directory (in only first cluster) */ + if (i == 0) { + if (so >= fs->csize) return FR_NO_FILESYSTEM; /* Not found? */ + if (move_window(fs, clst2sect(fs, fs->dirbase) + so) != FR_OK) return FR_DISK_ERR; + so++; + } + if (fs->win[i] == ET_BITMAP) break; /* Is it a bitmap entry? */ + i = (i + SZDIRE) % SS(fs); /* Next entry */ + } + bcl = ld_dword(fs->win + i + 20); /* Bitmap cluster */ + if (bcl < 2 || bcl >= fs->n_fatent) return FR_NO_FILESYSTEM; + fs->bitbase = fs->database + fs->csize * (bcl - 2); /* Bitmap sector */ + for (;;) { /* Check if bitmap is contiguous */ + if (move_window(fs, fs->fatbase + bcl / (SS(fs) / 4)) != FR_OK) return FR_DISK_ERR; + cv = ld_dword(fs->win + bcl % (SS(fs) / 4) * 4); + if (cv == 0xFFFFFFFF) break; /* Last link? */ + if (cv != ++bcl) return FR_NO_FILESYSTEM; /* Fragmented? */ + } + +#if !FF_FS_READONLY + fs->last_clst = fs->free_clst = 0xFFFFFFFF; /* Initialize cluster allocation information */ +#endif + fmt = FS_EXFAT; /* FAT sub-type */ + } else +#endif /* FF_FS_EXFAT */ + { + if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_BytsPerSec must be equal to the physical sector size) */ + + fasize = ld_word(fs->win + BPB_FATSz16); /* Number of sectors per FAT */ + if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32); + fs->fsize = fasize; + + fs->n_fats = fs->win[BPB_NumFATs]; /* Number of FATs */ + if (fs->n_fats != 1 && fs->n_fats != 2) return FR_NO_FILESYSTEM; /* (Must be 1 or 2) */ + fasize *= fs->n_fats; /* Number of sectors for FAT area */ + + fs->csize = fs->win[BPB_SecPerClus]; /* Cluster size */ + if (fs->csize == 0 || (fs->csize & (fs->csize - 1))) return FR_NO_FILESYSTEM; /* (Must be power of 2) */ + + fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt); /* Number of root directory entries */ + if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM; /* (Must be sector aligned) */ + + tsect = ld_word(fs->win + BPB_TotSec16); /* Number of sectors on the volume */ + if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32); + + nrsv = ld_word(fs->win + BPB_RsvdSecCnt); /* Number of reserved sectors */ + if (nrsv == 0) return FR_NO_FILESYSTEM; /* (Must not be 0) */ + + /* Determine the FAT sub type */ + sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE); /* RSV + FAT + DIR */ + if (tsect < sysect) return FR_NO_FILESYSTEM; /* (Invalid volume size) */ + nclst = (tsect - sysect) / fs->csize; /* Number of clusters */ + if (nclst == 0) return FR_NO_FILESYSTEM; /* (Invalid volume size) */ + fmt = 0; + if (nclst <= MAX_FAT32) fmt = FS_FAT32; + if (nclst <= MAX_FAT16) fmt = FS_FAT16; + if (nclst <= MAX_FAT12) fmt = FS_FAT12; + if (fmt == 0) return FR_NO_FILESYSTEM; + + /* Boundaries and Limits */ + fs->n_fatent = nclst + 2; /* Number of FAT entries */ + fs->volbase = bsect; /* Volume start sector */ + fs->fatbase = bsect + nrsv; /* FAT start sector */ + fs->database = bsect + sysect; /* Data start sector */ + if (fmt == FS_FAT32) { + if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM; /* (Must be FAT32 revision 0.0) */ + if (fs->n_rootdir != 0) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */ + fs->dirbase = ld_dword(fs->win + BPB_RootClus32); /* Root directory start cluster */ + szbfat = fs->n_fatent * 4; /* (Needed FAT size) */ + } else { + if (fs->n_rootdir == 0) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must not be 0) */ + fs->dirbase = fs->fatbase + fasize; /* Root directory start sector */ + szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */ + fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1); + } + if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_FATSz must not be less than the size needed) */ + +#if !FF_FS_READONLY + /* Get FSInfo if available */ + fs->last_clst = fs->free_clst = 0xFFFFFFFF; /* Initialize cluster allocation information */ + fs->fsi_flag = 0x80; +#if (FF_FS_NOFSINFO & 3) != 3 + if (fmt == FS_FAT32 /* Allow to update FSInfo only if BPB_FSInfo32 == 1 */ + && ld_word(fs->win + BPB_FSInfo32) == 1 + && move_window(fs, bsect + 1) == FR_OK) + { + fs->fsi_flag = 0; + if (ld_word(fs->win + BS_55AA) == 0xAA55 /* Load FSInfo data if available */ + && ld_dword(fs->win + FSI_LeadSig) == 0x41615252 + && ld_dword(fs->win + FSI_StrucSig) == 0x61417272) + { +#if (FF_FS_NOFSINFO & 1) == 0 + fs->free_clst = ld_dword(fs->win + FSI_Free_Count); +#endif +#if (FF_FS_NOFSINFO & 2) == 0 + fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free); +#endif + } + } +#endif /* (FF_FS_NOFSINFO & 3) != 3 */ +#endif /* !FF_FS_READONLY */ + } + + fs->fs_type = fmt; /* FAT sub-type */ + fs->id = ++Fsid; /* Volume mount ID */ +#if FF_USE_LFN == 1 + fs->lfnbuf = LfnBuf; /* Static LFN working buffer */ +#if FF_FS_EXFAT + fs->dirbuf = DirBuf; /* Static directory block scratchpad buuffer */ +#endif +#endif +#if FF_FS_RPATH != 0 + fs->cdir = 0; /* Initialize current directory */ +#endif +#if FF_FS_LOCK != 0 /* Clear file lock semaphores */ + clear_lock(fs); +#endif + return FR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Check if the file/directory object is valid or not */ +/*-----------------------------------------------------------------------*/ + +static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ + FFOBJID* obj, /* Pointer to the FFOBJID, the 1st member in the FIL/DIR object, to check validity */ + FATFS** rfs /* Pointer to pointer to the owner filesystem object to return */ +) +{ + FRESULT res = FR_INVALID_OBJECT; + + + if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */ +#if FF_FS_REENTRANT + if (lock_fs(obj->fs)) { /* Obtain the filesystem object */ + if (!(disk_status(obj->fs->pdrv) & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ + res = FR_OK; + } else { + unlock_fs(obj->fs, FR_OK); + } + } else { + res = FR_TIMEOUT; + } +#else + if (!(disk_status(obj->fs->pdrv) & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ + res = FR_OK; + } +#endif + } + *rfs = (res == FR_OK) ? obj->fs : 0; /* Corresponding filesystem object */ + return res; +} + + + + +/*--------------------------------------------------------------------------- + + Public Functions (FatFs API) + +----------------------------------------------------------------------------*/ + + + +/*-----------------------------------------------------------------------*/ +/* Mount/Unmount a Logical Drive */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_mount ( + FATFS* fs, /* Pointer to the filesystem object (NULL:unmount)*/ + const TCHAR* path, /* Logical drive number to be mounted/unmounted */ + BYTE opt /* Mode option 0:Do not mount (delayed mount), 1:Mount immediately */ +) +{ + FATFS *cfs; + int vol; + FRESULT res; + const TCHAR *rp = path; + + + /* Get logical drive number */ + vol = get_ldnumber(&rp); + if (vol < 0) return FR_INVALID_DRIVE; + cfs = FatFs[vol]; /* Pointer to fs object */ + + if (cfs) { +#if FF_FS_LOCK != 0 + clear_lock(cfs); +#endif +#if FF_FS_REENTRANT /* Discard sync object of the current volume */ + if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR; +#endif + cfs->fs_type = 0; /* Clear old fs object */ + } + + if (fs) { + fs->fs_type = 0; /* Clear new fs object */ +#if FF_FS_REENTRANT /* Create sync object for the new volume */ + if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR; +#endif + } + FatFs[vol] = fs; /* Register new fs object */ + + if (opt == 0) return FR_OK; /* Do not mount now, it will be mounted later */ + + res = find_volume(&path, &fs, 0); /* Force mounted the volume */ + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Open or Create a File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_open ( + FIL* fp, /* Pointer to the blank file object */ + const TCHAR* path, /* Pointer to the file name */ + BYTE mode /* Access mode and file open mode flags */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; +#if !FF_FS_READONLY + DWORD dw, cl, bcs, clst, sc; + FSIZE_t ofs; +#endif + DEF_NAMBUF + + + if (!fp) return FR_INVALID_OBJECT; + + /* Get logical drive number */ + mode &= FF_FS_READONLY ? FA_READ : FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_CREATE_NEW | FA_OPEN_ALWAYS | FA_OPEN_APPEND; + res = find_volume(&path, &fs, mode); + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the file path */ +#if !FF_FS_READONLY /* Read/Write configuration */ + if (res == FR_OK) { + if (dj.fn[NSFLAG] & NS_NONAME) { /* Origin directory itself? */ + res = FR_INVALID_NAME; + } +#if FF_FS_LOCK != 0 + else { + res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0); /* Check if the file can be used */ + } +#endif + } + /* Create or Open a file */ + if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) { + if (res != FR_OK) { /* No file, create new */ + if (res == FR_NO_FILE) { /* There is no file to open, create a new entry */ +#if FF_FS_LOCK != 0 + res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES; +#else + res = dir_register(&dj); +#endif + } + mode |= FA_CREATE_ALWAYS; /* File is created */ + } + else { /* Any object with the same name is already existing */ + if (dj.obj.attr & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */ + res = FR_DENIED; + } else { + if (mode & FA_CREATE_NEW) res = FR_EXIST; /* Cannot create as new file */ + } + } + if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate the file if overwrite mode */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + /* Get current allocation info */ + fp->obj.fs = fs; + init_alloc_info(fs, &fp->obj); + /* Set directory entry block initial state */ + mem_set(fs->dirbuf + 2, 0, 30); /* Clear 85 entry except for NumSec */ + mem_set(fs->dirbuf + 38, 0, 26); /* Clear C0 entry except for NumName and NameHash */ + fs->dirbuf[XDIR_Attr] = AM_ARC; + st_dword(fs->dirbuf + XDIR_CrtTime, GET_FATTIME()); + fs->dirbuf[XDIR_GenFlags] = 1; + res = store_xdir(&dj); + if (res == FR_OK && fp->obj.sclust != 0) { /* Remove the cluster chain if exist */ + res = remove_chain(&fp->obj, fp->obj.sclust, 0); + fs->last_clst = fp->obj.sclust - 1; /* Reuse the cluster hole */ + } + } else +#endif + { + /* Set directory entry initial state */ + cl = ld_clust(fs, dj.dir); /* Get current cluster chain */ + st_dword(dj.dir + DIR_CrtTime, GET_FATTIME()); /* Set created time */ + dj.dir[DIR_Attr] = AM_ARC; /* Reset attribute */ + st_clust(fs, dj.dir, 0); /* Reset file allocation info */ + st_dword(dj.dir + DIR_FileSize, 0); + fs->wflag = 1; + if (cl != 0) { /* Remove the cluster chain if exist */ + dw = fs->winsect; + res = remove_chain(&dj.obj, cl, 0); + if (res == FR_OK) { + res = move_window(fs, dw); + fs->last_clst = cl - 1; /* Reuse the cluster hole */ + } + } + } + } + } + else { /* Open an existing file */ + if (res == FR_OK) { /* Is the object exsiting? */ + if (dj.obj.attr & AM_DIR) { /* File open against a directory */ + res = FR_NO_FILE; + } else { + if ((mode & FA_WRITE) && (dj.obj.attr & AM_RDO)) { /* Write mode open against R/O file */ + res = FR_DENIED; + } + } + } + } + if (res == FR_OK) { + if (mode & FA_CREATE_ALWAYS) mode |= FA_MODIFIED; /* Set file change flag if created or overwritten */ + fp->dir_sect = fs->winsect; /* Pointer to the directory entry */ + fp->dir_ptr = dj.dir; +#if FF_FS_LOCK != 0 + fp->obj.lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0); /* Lock the file for this session */ + if (fp->obj.lockid == 0) res = FR_INT_ERR; +#endif + } +#else /* R/O configuration */ + if (res == FR_OK) { + if (dj.fn[NSFLAG] & NS_NONAME) { /* Is it origin directory itself? */ + res = FR_INVALID_NAME; + } else { + if (dj.obj.attr & AM_DIR) { /* Is it a directory? */ + res = FR_NO_FILE; + } + } + } +#endif + + if (res == FR_OK) { +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + fp->obj.c_scl = dj.obj.sclust; /* Get containing directory info */ + fp->obj.c_size = ((DWORD)dj.obj.objsize & 0xFFFFFF00) | dj.obj.stat; + fp->obj.c_ofs = dj.blk_ofs; + init_alloc_info(fs, &fp->obj); + } else +#endif + { + fp->obj.sclust = ld_clust(fs, dj.dir); /* Get object allocation info */ + fp->obj.objsize = ld_dword(dj.dir + DIR_FileSize); + } +#if FF_USE_FASTSEEK + fp->cltbl = 0; /* Disable fast seek mode */ +#endif + fp->obj.fs = fs; /* Validate the file object */ + fp->obj.id = fs->id; + fp->flag = mode; /* Set file access mode */ + fp->err = 0; /* Clear error flag */ + fp->sect = 0; /* Invalidate current data sector */ + fp->fptr = 0; /* Set file pointer top of the file */ +#if !FF_FS_READONLY +#if !FF_FS_TINY + mem_set(fp->buf, 0, sizeof fp->buf); /* Clear sector buffer */ +#endif + if ((mode & FA_SEEKEND) && fp->obj.objsize > 0) { /* Seek to end of file if FA_OPEN_APPEND is specified */ + fp->fptr = fp->obj.objsize; /* Offset to seek */ + bcs = (DWORD)fs->csize * SS(fs); /* Cluster size in byte */ + clst = fp->obj.sclust; /* Follow the cluster chain */ + for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) { + clst = get_fat(&fp->obj, clst); + if (clst <= 1) res = FR_INT_ERR; + if (clst == 0xFFFFFFFF) res = FR_DISK_ERR; + } + fp->clust = clst; + if (res == FR_OK && ofs % SS(fs)) { /* Fill sector buffer if not on the sector boundary */ + if ((sc = clst2sect(fs, clst)) == 0) { + res = FR_INT_ERR; + } else { + fp->sect = sc + (DWORD)(ofs / SS(fs)); +#if !FF_FS_TINY + if (disk_read(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) res = FR_DISK_ERR; +#endif + } + } + } +#endif + } + + FREE_NAMBUF(); + } + + if (res != FR_OK) fp->obj.fs = 0; /* Invalidate file object on error */ + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Read File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_read ( + FIL* fp, /* Pointer to the file object */ + void* buff, /* Pointer to data buffer */ + UINT btr, /* Number of bytes to read */ + UINT* br /* Pointer to number of bytes read */ +) +{ + FRESULT res; + FATFS *fs; + DWORD clst, sect; + FSIZE_t remain; + UINT rcnt, cc, csect; + BYTE *rbuff = (BYTE*)buff; + + + *br = 0; /* Clear read byte counter */ + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */ + if (!(fp->flag & FA_READ)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */ + remain = fp->obj.objsize - fp->fptr; + if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */ + + for ( ; btr; /* Repeat until btr bytes read */ + btr -= rcnt, *br += rcnt, rbuff += rcnt, fp->fptr += rcnt) { + if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */ + csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */ + if (csect == 0) { /* On the cluster boundary? */ + if (fp->fptr == 0) { /* On the top of the file? */ + clst = fp->obj.sclust; /* Follow cluster chain from the origin */ + } else { /* Middle or end of the file */ +#if FF_USE_FASTSEEK + if (fp->cltbl) { + clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */ + } else +#endif + { + clst = get_fat(&fp->obj, fp->clust); /* Follow cluster chain on the FAT */ + } + } + if (clst < 2) ABORT(fs, FR_INT_ERR); + if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + fp->clust = clst; /* Update current cluster */ + } + sect = clst2sect(fs, fp->clust); /* Get current sector */ + if (sect == 0) ABORT(fs, FR_INT_ERR); + sect += csect; + cc = btr / SS(fs); /* When remaining bytes >= sector size, */ + if (cc > 0) { /* Read maximum contiguous sectors directly */ + if (csect + cc > fs->csize) { /* Clip at cluster boundary */ + cc = fs->csize - csect; + } + if (disk_read(fs->pdrv, rbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR); +#if !FF_FS_READONLY && FF_FS_MINIMIZE <= 2 /* Replace one of the read sectors with cached data if it contains a dirty sector */ +#if FF_FS_TINY + if (fs->wflag && fs->winsect - sect < cc) { + mem_cpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs)); + } +#else + if ((fp->flag & FA_DIRTY) && fp->sect - sect < cc) { + mem_cpy(rbuff + ((fp->sect - sect) * SS(fs)), fp->buf, SS(fs)); + } +#endif +#endif + rcnt = SS(fs) * cc; /* Number of bytes transferred */ + continue; + } +#if !FF_FS_TINY + if (fp->sect != sect) { /* Load data sector if not in cache */ +#if !FF_FS_READONLY + if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + if (disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Fill sector cache */ + } +#endif + fp->sect = sect; + } + rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */ + if (rcnt > btr) rcnt = btr; /* Clip it by btr if needed */ +#if FF_FS_TINY + if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */ + mem_cpy(rbuff, fs->win + fp->fptr % SS(fs), rcnt); /* Extract partial sector */ +#else + mem_cpy(rbuff, fp->buf + fp->fptr % SS(fs), rcnt); /* Extract partial sector */ +#endif + } + + LEAVE_FF(fs, FR_OK); +} + + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Write File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_write ( + FIL* fp, /* Pointer to the file object */ + const void* buff, /* Pointer to the data to be written */ + UINT btw, /* Number of bytes to write */ + UINT* bw /* Pointer to number of bytes written */ +) +{ + FRESULT res; + FATFS *fs; + DWORD clst, sect; + UINT wcnt, cc, csect; + const BYTE *wbuff = (const BYTE*)buff; + + + *bw = 0; /* Clear write byte counter */ + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */ + if (!(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */ + + /* Check fptr wrap-around (file size cannot reach 4 GiB at FAT volume) */ + if ((!FF_FS_EXFAT || fs->fs_type != FS_EXFAT) && (DWORD)(fp->fptr + btw) < (DWORD)fp->fptr) { + btw = (UINT)(0xFFFFFFFF - (DWORD)fp->fptr); + } + + for ( ; btw; /* Repeat until all data written */ + btw -= wcnt, *bw += wcnt, wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize) { + if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */ + csect = (UINT)(fp->fptr / SS(fs)) & (fs->csize - 1); /* Sector offset in the cluster */ + if (csect == 0) { /* On the cluster boundary? */ + if (fp->fptr == 0) { /* On the top of the file? */ + clst = fp->obj.sclust; /* Follow from the origin */ + if (clst == 0) { /* If no cluster is allocated, */ + clst = create_chain(&fp->obj, 0); /* create a new cluster chain */ + } + } else { /* On the middle or end of the file */ +#if FF_USE_FASTSEEK + if (fp->cltbl) { + clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */ + } else +#endif + { + clst = create_chain(&fp->obj, fp->clust); /* Follow or stretch cluster chain on the FAT */ + } + } + if (clst == 0) break; /* Could not allocate a new cluster (disk full) */ + if (clst == 1) ABORT(fs, FR_INT_ERR); + if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + fp->clust = clst; /* Update current cluster */ + if (fp->obj.sclust == 0) fp->obj.sclust = clst; /* Set start cluster if the first write */ + } +#if FF_FS_TINY + if (fs->winsect == fp->sect && sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Write-back sector cache */ +#else + if (fp->flag & FA_DIRTY) { /* Write-back sector cache */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + sect = clst2sect(fs, fp->clust); /* Get current sector */ + if (sect == 0) ABORT(fs, FR_INT_ERR); + sect += csect; + cc = btw / SS(fs); /* When remaining bytes >= sector size, */ + if (cc > 0) { /* Write maximum contiguous sectors directly */ + if (csect + cc > fs->csize) { /* Clip at cluster boundary */ + cc = fs->csize - csect; + } + if (disk_write(fs->pdrv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR); +#if FF_FS_MINIMIZE <= 2 +#if FF_FS_TINY + if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ + mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs)); + fs->wflag = 0; + } +#else + if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ + mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs)); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif +#endif + wcnt = SS(fs) * cc; /* Number of bytes transferred */ + continue; + } +#if FF_FS_TINY + if (fp->fptr >= fp->obj.objsize) { /* Avoid silly cache filling on the growing edge */ + if (sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); + fs->winsect = sect; + } +#else + if (fp->sect != sect && /* Fill sector cache with file data */ + fp->fptr < fp->obj.objsize && + disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) { + ABORT(fs, FR_DISK_ERR); + } +#endif + fp->sect = sect; + } + wcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */ + if (wcnt > btw) wcnt = btw; /* Clip it by btw if needed */ +#if FF_FS_TINY + if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */ + mem_cpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */ + fs->wflag = 1; +#else + mem_cpy(fp->buf + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */ + fp->flag |= FA_DIRTY; +#endif + } + + fp->flag |= FA_MODIFIED; /* Set file change flag */ + + LEAVE_FF(fs, FR_OK); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Synchronize the File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_sync ( + FIL* fp /* Pointer to the file object */ +) +{ + FRESULT res; + FATFS *fs; + DWORD tm; + BYTE *dir; + + + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res == FR_OK) { + if (fp->flag & FA_MODIFIED) { /* Is there any change to the file? */ +#if !FF_FS_TINY + if (fp->flag & FA_DIRTY) { /* Write-back cached data if needed */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + /* Update the directory entry */ + tm = GET_FATTIME(); /* Modified time */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + res = fill_first_frag(&fp->obj); /* Fill first fragment on the FAT if needed */ + if (res == FR_OK) { + res = fill_last_frag(&fp->obj, fp->clust, 0xFFFFFFFF); /* Fill last fragment on the FAT if needed */ + } + if (res == FR_OK) { + DIR dj; + DEF_NAMBUF + + INIT_NAMBUF(fs); + res = load_obj_xdir(&dj, &fp->obj); /* Load directory entry block */ + if (res == FR_OK) { + fs->dirbuf[XDIR_Attr] |= AM_ARC; /* Set archive attribute to indicate that the file has been changed */ + fs->dirbuf[XDIR_GenFlags] = fp->obj.stat | 1; /* Update file allocation information */ + st_dword(fs->dirbuf + XDIR_FstClus, fp->obj.sclust); + st_qword(fs->dirbuf + XDIR_FileSize, fp->obj.objsize); + st_qword(fs->dirbuf + XDIR_ValidFileSize, fp->obj.objsize); + st_dword(fs->dirbuf + XDIR_ModTime, tm); /* Update modified time */ + fs->dirbuf[XDIR_ModTime10] = 0; + st_dword(fs->dirbuf + XDIR_AccTime, 0); + res = store_xdir(&dj); /* Restore it to the directory */ + if (res == FR_OK) { + res = sync_fs(fs); + fp->flag &= (BYTE)~FA_MODIFIED; + } + } + FREE_NAMBUF(); + } + } else +#endif + { + res = move_window(fs, fp->dir_sect); + if (res == FR_OK) { + dir = fp->dir_ptr; + dir[DIR_Attr] |= AM_ARC; /* Set archive attribute to indicate that the file has been changed */ + st_clust(fp->obj.fs, dir, fp->obj.sclust); /* Update file allocation information */ + st_dword(dir + DIR_FileSize, (DWORD)fp->obj.objsize); /* Update file size */ + st_dword(dir + DIR_ModTime, tm); /* Update modified time */ + st_word(dir + DIR_LstAccDate, 0); + fs->wflag = 1; + res = sync_fs(fs); /* Restore it to the directory */ + fp->flag &= (BYTE)~FA_MODIFIED; + } + } + } + } + + LEAVE_FF(fs, res); +} + +#endif /* !FF_FS_READONLY */ + + + + +/*-----------------------------------------------------------------------*/ +/* Close File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_close ( + FIL* fp /* Pointer to the file object to be closed */ +) +{ + FRESULT res; + FATFS *fs; + +#if !FF_FS_READONLY + res = f_sync(fp); /* Flush cached data */ + if (res == FR_OK) +#endif + { + res = validate(&fp->obj, &fs); /* Lock volume */ + if (res == FR_OK) { +#if FF_FS_LOCK != 0 + res = dec_lock(fp->obj.lockid); /* Decrement file open counter */ + if (res == FR_OK) fp->obj.fs = 0; /* Invalidate file object */ +#else + fp->obj.fs = 0; /* Invalidate file object */ +#endif +#if FF_FS_REENTRANT + unlock_fs(fs, FR_OK); /* Unlock volume */ +#endif + } + } + return res; +} + + + + +#if FF_FS_RPATH >= 1 +/*-----------------------------------------------------------------------*/ +/* Change Current Directory or Current Drive, Get Current Directory */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_chdrive ( + const TCHAR* path /* Drive number to set */ +) +{ + int vol; + + + /* Get logical drive number */ + vol = get_ldnumber(&path); + if (vol < 0) return FR_INVALID_DRIVE; + CurrVol = (BYTE)vol; /* Set it as current volume */ + + return FR_OK; +} + + + +FRESULT f_chdir ( + const TCHAR* path /* Pointer to the directory path */ +) +{ +#if FF_STR_VOLUME_ID == 2 + UINT i; +#endif + FRESULT res; + DIR dj; + FATFS *fs; + DEF_NAMBUF + + + /* Get logical drive */ + res = find_volume(&path, &fs, 0); + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the path */ + if (res == FR_OK) { /* Follow completed */ + if (dj.fn[NSFLAG] & NS_NONAME) { /* Is it the start directory itself? */ + fs->cdir = dj.obj.sclust; +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + fs->cdc_scl = dj.obj.c_scl; + fs->cdc_size = dj.obj.c_size; + fs->cdc_ofs = dj.obj.c_ofs; + } +#endif + } else { + if (dj.obj.attr & AM_DIR) { /* It is a sub-directory */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + fs->cdir = ld_dword(fs->dirbuf + XDIR_FstClus); /* Sub-directory cluster */ + fs->cdc_scl = dj.obj.sclust; /* Save containing directory information */ + fs->cdc_size = ((DWORD)dj.obj.objsize & 0xFFFFFF00) | dj.obj.stat; + fs->cdc_ofs = dj.blk_ofs; + } else +#endif + { + fs->cdir = ld_clust(fs, dj.dir); /* Sub-directory cluster */ + } + } else { + res = FR_NO_PATH; /* Reached but a file */ + } + } + } + FREE_NAMBUF(); + if (res == FR_NO_FILE) res = FR_NO_PATH; +#if FF_STR_VOLUME_ID == 2 /* Also current drive is changed at Unix style volume ID */ + if (res == FR_OK) { + for (i = FF_VOLUMES - 1; i && fs != FatFs[i]; i--) ; /* Set current drive */ + CurrVol = (BYTE)i; + } +#endif + } + + LEAVE_FF(fs, res); +} + + +#if FF_FS_RPATH >= 2 +FRESULT f_getcwd ( + TCHAR* buff, /* Pointer to the directory path */ + UINT len /* Size of buff in unit of TCHAR */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; + UINT i, n; + DWORD ccl; + TCHAR *tp = buff; +#if FF_VOLUMES >= 2 + UINT vl; +#endif +#if FF_STR_VOLUME_ID + const char *vp; +#endif + FILINFO fno; + DEF_NAMBUF + + + /* Get logical drive */ + buff[0] = 0; /* Set null string to get current volume */ + res = find_volume((const TCHAR**)&buff, &fs, 0); /* Get current volume */ + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + + /* Follow parent directories and create the path */ + i = len; /* Bottom of buffer (directory stack base) */ + if (!FF_FS_EXFAT || fs->fs_type != FS_EXFAT) { /* (Cannot do getcwd on exFAT and returns root path) */ + dj.obj.sclust = fs->cdir; /* Start to follow upper directory from current directory */ + while ((ccl = dj.obj.sclust) != 0) { /* Repeat while current directory is a sub-directory */ + res = dir_sdi(&dj, 1 * SZDIRE); /* Get parent directory */ + if (res != FR_OK) break; + res = move_window(fs, dj.sect); + if (res != FR_OK) break; + dj.obj.sclust = ld_clust(fs, dj.dir); /* Goto parent directory */ + res = dir_sdi(&dj, 0); + if (res != FR_OK) break; + do { /* Find the entry links to the child directory */ + res = DIR_READ_FILE(&dj); + if (res != FR_OK) break; + if (ccl == ld_clust(fs, dj.dir)) break; /* Found the entry */ + res = dir_next(&dj, 0); + } while (res == FR_OK); + if (res == FR_NO_FILE) res = FR_INT_ERR;/* It cannot be 'not found'. */ + if (res != FR_OK) break; + get_fileinfo(&dj, &fno); /* Get the directory name and push it to the buffer */ + for (n = 0; fno.fname[n]; n++) ; /* Name length */ + if (i < n + 1) { /* Insufficient space to store the path name? */ + res = FR_NOT_ENOUGH_CORE; break; + } + while (n) buff[--i] = fno.fname[--n]; /* Stack the name */ + buff[--i] = '/'; + } + } + if (res == FR_OK) { + if (i == len) buff[--i] = '/'; /* Is it the root-directory? */ +#if FF_VOLUMES >= 2 /* Put drive prefix */ + vl = 0; +#if FF_STR_VOLUME_ID >= 1 /* String volume ID */ + for (n = 0, vp = (const char*)VolumeStr[CurrVol]; vp[n]; n++) ; + if (i >= n + 2) { + if (FF_STR_VOLUME_ID == 2) *tp++ = (TCHAR)'/'; + for (vl = 0; vl < n; *tp++ = (TCHAR)vp[vl], vl++) ; + if (FF_STR_VOLUME_ID == 1) *tp++ = (TCHAR)':'; + vl++; + } +#else /* Numeric volume ID */ + if (i >= 3) { + *tp++ = (TCHAR)'0' + CurrVol; + *tp++ = (TCHAR)':'; + vl = 2; + } +#endif + if (vl == 0) res = FR_NOT_ENOUGH_CORE; +#endif + /* Add current directory path */ + if (res == FR_OK) { + do *tp++ = buff[i++]; while (i < len); /* Copy stacked path string */ + } + } + FREE_NAMBUF(); + } + + *tp = 0; + LEAVE_FF(fs, res); +} + +#endif /* FF_FS_RPATH >= 2 */ +#endif /* FF_FS_RPATH >= 1 */ + + + +#if FF_FS_MINIMIZE <= 2 +/*-----------------------------------------------------------------------*/ +/* Seek File Read/Write Pointer */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_lseek ( + FIL* fp, /* Pointer to the file object */ + FSIZE_t ofs /* File pointer from top of file */ +) +{ + FRESULT res; + FATFS *fs; + DWORD clst, bcs, nsect; + FSIZE_t ifptr; +#if FF_USE_FASTSEEK + DWORD cl, pcl, ncl, tcl, dsc, tlen, ulen, *tbl; +#endif + + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res == FR_OK) res = (FRESULT)fp->err; +#if FF_FS_EXFAT && !FF_FS_READONLY + if (res == FR_OK && fs->fs_type == FS_EXFAT) { + res = fill_last_frag(&fp->obj, fp->clust, 0xFFFFFFFF); /* Fill last fragment on the FAT if needed */ + } +#endif + if (res != FR_OK) LEAVE_FF(fs, res); + +#if FF_USE_FASTSEEK + if (fp->cltbl) { /* Fast seek */ + if (ofs == CREATE_LINKMAP) { /* Create CLMT */ + tbl = fp->cltbl; + tlen = *tbl++; ulen = 2; /* Given table size and required table size */ + cl = fp->obj.sclust; /* Origin of the chain */ + if (cl != 0) { + do { + /* Get a fragment */ + tcl = cl; ncl = 0; ulen += 2; /* Top, length and used items */ + do { + pcl = cl; ncl++; + cl = get_fat(&fp->obj, cl); + if (cl <= 1) ABORT(fs, FR_INT_ERR); + if (cl == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + } while (cl == pcl + 1); + if (ulen <= tlen) { /* Store the length and top of the fragment */ + *tbl++ = ncl; *tbl++ = tcl; + } + } while (cl < fs->n_fatent); /* Repeat until end of chain */ + } + *fp->cltbl = ulen; /* Number of items used */ + if (ulen <= tlen) { + *tbl = 0; /* Terminate table */ + } else { + res = FR_NOT_ENOUGH_CORE; /* Given table size is smaller than required */ + } + } else { /* Fast seek */ + if (ofs > fp->obj.objsize) ofs = fp->obj.objsize; /* Clip offset at the file size */ + fp->fptr = ofs; /* Set file pointer */ + if (ofs > 0) { + fp->clust = clmt_clust(fp, ofs - 1); + dsc = clst2sect(fs, fp->clust); + if (dsc == 0) ABORT(fs, FR_INT_ERR); + dsc += (DWORD)((ofs - 1) / SS(fs)) & (fs->csize - 1); + if (fp->fptr % SS(fs) && dsc != fp->sect) { /* Refill sector cache if needed */ +#if !FF_FS_TINY +#if !FF_FS_READONLY + if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + if (disk_read(fs->pdrv, fp->buf, dsc, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Load current sector */ +#endif + fp->sect = dsc; + } + } + } + } else +#endif + + /* Normal Seek */ + { +#if FF_FS_EXFAT + if (fs->fs_type != FS_EXFAT && ofs >= 0x100000000) ofs = 0xFFFFFFFF; /* Clip at 4 GiB - 1 if at FATxx */ +#endif + if (ofs > fp->obj.objsize && (FF_FS_READONLY || !(fp->flag & FA_WRITE))) { /* In read-only mode, clip offset with the file size */ + ofs = fp->obj.objsize; + } + ifptr = fp->fptr; + fp->fptr = nsect = 0; + if (ofs > 0) { + bcs = (DWORD)fs->csize * SS(fs); /* Cluster size (byte) */ + if (ifptr > 0 && + (ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */ + fp->fptr = (ifptr - 1) & ~(FSIZE_t)(bcs - 1); /* start from the current cluster */ + ofs -= fp->fptr; + clst = fp->clust; + } else { /* When seek to back cluster, */ + clst = fp->obj.sclust; /* start from the first cluster */ +#if !FF_FS_READONLY + if (clst == 0) { /* If no cluster chain, create a new chain */ + clst = create_chain(&fp->obj, 0); + if (clst == 1) ABORT(fs, FR_INT_ERR); + if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + fp->obj.sclust = clst; + } +#endif + fp->clust = clst; + } + if (clst != 0) { + while (ofs > bcs) { /* Cluster following loop */ + ofs -= bcs; fp->fptr += bcs; +#if !FF_FS_READONLY + if (fp->flag & FA_WRITE) { /* Check if in write mode or not */ + if (FF_FS_EXFAT && fp->fptr > fp->obj.objsize) { /* No FAT chain object needs correct objsize to generate FAT value */ + fp->obj.objsize = fp->fptr; + fp->flag |= FA_MODIFIED; + } + clst = create_chain(&fp->obj, clst); /* Follow chain with forceed stretch */ + if (clst == 0) { /* Clip file size in case of disk full */ + ofs = 0; break; + } + } else +#endif + { + clst = get_fat(&fp->obj, clst); /* Follow cluster chain if not in write mode */ + } + if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + if (clst <= 1 || clst >= fs->n_fatent) ABORT(fs, FR_INT_ERR); + fp->clust = clst; + } + fp->fptr += ofs; + if (ofs % SS(fs)) { + nsect = clst2sect(fs, clst); /* Current sector */ + if (nsect == 0) ABORT(fs, FR_INT_ERR); + nsect += (DWORD)(ofs / SS(fs)); + } + } + } + if (!FF_FS_READONLY && fp->fptr > fp->obj.objsize) { /* Set file change flag if the file size is extended */ + fp->obj.objsize = fp->fptr; + fp->flag |= FA_MODIFIED; + } + if (fp->fptr % SS(fs) && nsect != fp->sect) { /* Fill sector cache if needed */ +#if !FF_FS_TINY +#if !FF_FS_READONLY + if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + if (disk_read(fs->pdrv, fp->buf, nsect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Fill sector cache */ +#endif + fp->sect = nsect; + } + } + + LEAVE_FF(fs, res); +} + + + +#if FF_FS_MINIMIZE <= 1 +/*-----------------------------------------------------------------------*/ +/* Create a Directory Object */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_opendir ( + DIR* dp, /* Pointer to directory object to create */ + const TCHAR* path /* Pointer to the directory path */ +) +{ + FRESULT res; + FATFS *fs; + DEF_NAMBUF + + + if (!dp) return FR_INVALID_OBJECT; + + /* Get logical drive */ + res = find_volume(&path, &fs, 0); + if (res == FR_OK) { + dp->obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(dp, path); /* Follow the path to the directory */ + if (res == FR_OK) { /* Follow completed */ + if (!(dp->fn[NSFLAG] & NS_NONAME)) { /* It is not the origin directory itself */ + if (dp->obj.attr & AM_DIR) { /* This object is a sub-directory */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + dp->obj.c_scl = dp->obj.sclust; /* Get containing directory inforamation */ + dp->obj.c_size = ((DWORD)dp->obj.objsize & 0xFFFFFF00) | dp->obj.stat; + dp->obj.c_ofs = dp->blk_ofs; + init_alloc_info(fs, &dp->obj); /* Get object allocation info */ + } else +#endif + { + dp->obj.sclust = ld_clust(fs, dp->dir); /* Get object allocation info */ + } + } else { /* This object is a file */ + res = FR_NO_PATH; + } + } + if (res == FR_OK) { + dp->obj.id = fs->id; + res = dir_sdi(dp, 0); /* Rewind directory */ +#if FF_FS_LOCK != 0 + if (res == FR_OK) { + if (dp->obj.sclust != 0) { + dp->obj.lockid = inc_lock(dp, 0); /* Lock the sub directory */ + if (!dp->obj.lockid) res = FR_TOO_MANY_OPEN_FILES; + } else { + dp->obj.lockid = 0; /* Root directory need not to be locked */ + } + } +#endif + } + } + FREE_NAMBUF(); + if (res == FR_NO_FILE) res = FR_NO_PATH; + } + if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function faild */ + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Close Directory */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_closedir ( + DIR *dp /* Pointer to the directory object to be closed */ +) +{ + FRESULT res; + FATFS *fs; + + + res = validate(&dp->obj, &fs); /* Check validity of the file object */ + if (res == FR_OK) { +#if FF_FS_LOCK != 0 + if (dp->obj.lockid) res = dec_lock(dp->obj.lockid); /* Decrement sub-directory open counter */ + if (res == FR_OK) dp->obj.fs = 0; /* Invalidate directory object */ +#else + dp->obj.fs = 0; /* Invalidate directory object */ +#endif +#if FF_FS_REENTRANT + unlock_fs(fs, FR_OK); /* Unlock volume */ +#endif + } + return res; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Read Directory Entries in Sequence */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_readdir ( + DIR* dp, /* Pointer to the open directory object */ + FILINFO* fno /* Pointer to file information to return */ +) +{ + FRESULT res; + FATFS *fs; + DEF_NAMBUF + + + res = validate(&dp->obj, &fs); /* Check validity of the directory object */ + if (res == FR_OK) { + if (!fno) { + res = dir_sdi(dp, 0); /* Rewind the directory object */ + } else { + INIT_NAMBUF(fs); + res = DIR_READ_FILE(dp); /* Read an item */ + if (res == FR_NO_FILE) res = FR_OK; /* Ignore end of directory */ + if (res == FR_OK) { /* A valid entry is found */ + get_fileinfo(dp, fno); /* Get the object information */ + res = dir_next(dp, 0); /* Increment index for next */ + if (res == FR_NO_FILE) res = FR_OK; /* Ignore end of directory now */ + } + FREE_NAMBUF(); + } + } + LEAVE_FF(fs, res); +} + + + +#if FF_USE_FIND +/*-----------------------------------------------------------------------*/ +/* Find Next File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_findnext ( + DIR* dp, /* Pointer to the open directory object */ + FILINFO* fno /* Pointer to the file information structure */ +) +{ + FRESULT res; + + + for (;;) { + res = f_readdir(dp, fno); /* Get a directory item */ + if (res != FR_OK || !fno || !fno->fname[0]) break; /* Terminate if any error or end of directory */ + if (pattern_matching(dp->pat, fno->fname, 0, 0)) break; /* Test for the file name */ +#if FF_USE_LFN && FF_USE_FIND == 2 + if (pattern_matching(dp->pat, fno->altname, 0, 0)) break; /* Test for alternative name if exist */ +#endif + } + return res; +} + + + +/*-----------------------------------------------------------------------*/ +/* Find First File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_findfirst ( + DIR* dp, /* Pointer to the blank directory object */ + FILINFO* fno, /* Pointer to the file information structure */ + const TCHAR* path, /* Pointer to the directory to open */ + const TCHAR* pattern /* Pointer to the matching pattern */ +) +{ + FRESULT res; + + + dp->pat = pattern; /* Save pointer to pattern string */ + res = f_opendir(dp, path); /* Open the target directory */ + if (res == FR_OK) { + res = f_findnext(dp, fno); /* Find the first item */ + } + return res; +} + +#endif /* FF_USE_FIND */ + + + +#if FF_FS_MINIMIZE == 0 +/*-----------------------------------------------------------------------*/ +/* Get File Status */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_stat ( + const TCHAR* path, /* Pointer to the file path */ + FILINFO* fno /* Pointer to file information to return */ +) +{ + FRESULT res; + DIR dj; + DEF_NAMBUF + + + /* Get logical drive */ + res = find_volume(&path, &dj.obj.fs, 0); + if (res == FR_OK) { + INIT_NAMBUF(dj.obj.fs); + res = follow_path(&dj, path); /* Follow the file path */ + if (res == FR_OK) { /* Follow completed */ + if (dj.fn[NSFLAG] & NS_NONAME) { /* It is origin directory */ + res = FR_INVALID_NAME; + } else { /* Found an object */ + if (fno) get_fileinfo(&dj, fno); + } + } + FREE_NAMBUF(); + } + + LEAVE_FF(dj.obj.fs, res); +} + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Get Number of Free Clusters */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_getfree ( + const TCHAR* path, /* Logical drive number */ + DWORD* nclst, /* Pointer to a variable to return number of free clusters */ + FATFS** fatfs /* Pointer to return pointer to corresponding filesystem object */ +) +{ + FRESULT res; + FATFS *fs; + DWORD nfree, clst, sect, stat; + UINT i; + FFOBJID obj; + + + /* Get logical drive */ + res = find_volume(&path, &fs, 0); + if (res == FR_OK) { + *fatfs = fs; /* Return ptr to the fs object */ + /* If free_clst is valid, return it without full FAT scan */ + if (fs->free_clst <= fs->n_fatent - 2) { + *nclst = fs->free_clst; + } else { + /* Scan FAT to obtain number of free clusters */ + nfree = 0; + if (fs->fs_type == FS_FAT12) { /* FAT12: Scan bit field FAT entries */ + clst = 2; obj.fs = fs; + do { + stat = get_fat(&obj, clst); + if (stat == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } + if (stat == 1) { res = FR_INT_ERR; break; } + if (stat == 0) nfree++; + } while (++clst < fs->n_fatent); + } else { +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* exFAT: Scan allocation bitmap */ + BYTE bm; + UINT b; + + clst = fs->n_fatent - 2; /* Number of clusters */ + sect = fs->bitbase; /* Bitmap sector */ + i = 0; /* Offset in the sector */ + do { /* Counts numbuer of bits with zero in the bitmap */ + if (i == 0) { + res = move_window(fs, sect++); + if (res != FR_OK) break; + } + for (b = 8, bm = fs->win[i]; b && clst; b--, clst--) { + if (!(bm & 1)) nfree++; + bm >>= 1; + } + i = (i + 1) % SS(fs); + } while (clst); + } else +#endif + { /* FAT16/32: Scan WORD/DWORD FAT entries */ + clst = fs->n_fatent; /* Number of entries */ + sect = fs->fatbase; /* Top of the FAT */ + i = 0; /* Offset in the sector */ + do { /* Counts numbuer of entries with zero in the FAT */ + if (i == 0) { + res = move_window(fs, sect++); + if (res != FR_OK) break; + } + if (fs->fs_type == FS_FAT16) { + if (ld_word(fs->win + i) == 0) nfree++; + i += 2; + } else { + if ((ld_dword(fs->win + i) & 0x0FFFFFFF) == 0) nfree++; + i += 4; + } + i %= SS(fs); + } while (--clst); + } + } + *nclst = nfree; /* Return the free clusters */ + fs->free_clst = nfree; /* Now free_clst is valid */ + fs->fsi_flag |= 1; /* FAT32: FSInfo is to be updated */ + } + } + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Truncate File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_truncate ( + FIL* fp /* Pointer to the file object */ +) +{ + FRESULT res; + FATFS *fs; + DWORD ncl; + + + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); + if (!(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */ + + if (fp->fptr < fp->obj.objsize) { /* Process when fptr is not on the eof */ + if (fp->fptr == 0) { /* When set file size to zero, remove entire cluster chain */ + res = remove_chain(&fp->obj, fp->obj.sclust, 0); + fp->obj.sclust = 0; + } else { /* When truncate a part of the file, remove remaining clusters */ + ncl = get_fat(&fp->obj, fp->clust); + res = FR_OK; + if (ncl == 0xFFFFFFFF) res = FR_DISK_ERR; + if (ncl == 1) res = FR_INT_ERR; + if (res == FR_OK && ncl < fs->n_fatent) { + res = remove_chain(&fp->obj, ncl, fp->clust); + } + } + fp->obj.objsize = fp->fptr; /* Set file size to current read/write point */ + fp->flag |= FA_MODIFIED; +#if !FF_FS_TINY + if (res == FR_OK && (fp->flag & FA_DIRTY)) { + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) { + res = FR_DISK_ERR; + } else { + fp->flag &= (BYTE)~FA_DIRTY; + } + } +#endif + if (res != FR_OK) ABORT(fs, res); + } + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Delete a File/Directory */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_unlink ( + const TCHAR* path /* Pointer to the file or directory path */ +) +{ + FRESULT res; + DIR dj, sdj; + DWORD dclst = 0; + FATFS *fs; +#if FF_FS_EXFAT + FFOBJID obj; +#endif + DEF_NAMBUF + + + /* Get logical drive */ + res = find_volume(&path, &fs, FA_WRITE); + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the file path */ + if (FF_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT)) { + res = FR_INVALID_NAME; /* Cannot remove dot entry */ + } +#if FF_FS_LOCK != 0 + if (res == FR_OK) res = chk_lock(&dj, 2); /* Check if it is an open object */ +#endif + if (res == FR_OK) { /* The object is accessible */ + if (dj.fn[NSFLAG] & NS_NONAME) { + res = FR_INVALID_NAME; /* Cannot remove the origin directory */ + } else { + if (dj.obj.attr & AM_RDO) { + res = FR_DENIED; /* Cannot remove R/O object */ + } + } + if (res == FR_OK) { +#if FF_FS_EXFAT + obj.fs = fs; + if (fs->fs_type == FS_EXFAT) { + init_alloc_info(fs, &obj); + dclst = obj.sclust; + } else +#endif + { + dclst = ld_clust(fs, dj.dir); + } + if (dj.obj.attr & AM_DIR) { /* Is it a sub-directory? */ +#if FF_FS_RPATH != 0 + if (dclst == fs->cdir) { /* Is it the current directory? */ + res = FR_DENIED; + } else +#endif + { + sdj.obj.fs = fs; /* Open the sub-directory */ + sdj.obj.sclust = dclst; +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + sdj.obj.objsize = obj.objsize; + sdj.obj.stat = obj.stat; + } +#endif + res = dir_sdi(&sdj, 0); + if (res == FR_OK) { + res = DIR_READ_FILE(&sdj); /* Test if the directory is empty */ + if (res == FR_OK) res = FR_DENIED; /* Not empty? */ + if (res == FR_NO_FILE) res = FR_OK; /* Empty? */ + } + } + } + } + if (res == FR_OK) { + res = dir_remove(&dj); /* Remove the directory entry */ + if (res == FR_OK && dclst != 0) { /* Remove the cluster chain if exist */ +#if FF_FS_EXFAT + res = remove_chain(&obj, dclst, 0); +#else + res = remove_chain(&dj.obj, dclst, 0); +#endif + } + if (res == FR_OK) res = sync_fs(fs); + } + } + FREE_NAMBUF(); + } + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Create a Directory */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_mkdir ( + const TCHAR* path /* Pointer to the directory path */ +) +{ + FRESULT res; + DIR dj; + FFOBJID sobj; + FATFS *fs; + DWORD dcl, pcl, tm; + DEF_NAMBUF + + + res = find_volume(&path, &fs, FA_WRITE); /* Get logical drive */ + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the file path */ + if (res == FR_OK) res = FR_EXIST; /* Name collision? */ + if (FF_FS_RPATH && res == FR_NO_FILE && (dj.fn[NSFLAG] & NS_DOT)) { /* Invalid name? */ + res = FR_INVALID_NAME; + } + if (res == FR_NO_FILE) { /* It is clear to create a new directory */ + sobj.fs = fs; /* New object id to create a new chain */ + dcl = create_chain(&sobj, 0); /* Allocate a cluster for the new directory */ + res = FR_OK; + if (dcl == 0) res = FR_DENIED; /* No space to allocate a new cluster? */ + if (dcl == 1) res = FR_INT_ERR; /* Any insanity? */ + if (dcl == 0xFFFFFFFF) res = FR_DISK_ERR; /* Disk error? */ + tm = GET_FATTIME(); + if (res == FR_OK) { + res = dir_clear(fs, dcl); /* Clean up the new table */ + if (res == FR_OK) { + if (!FF_FS_EXFAT || fs->fs_type != FS_EXFAT) { /* Create dot entries (FAT only) */ + mem_set(fs->win + DIR_Name, ' ', 11); /* Create "." entry */ + fs->win[DIR_Name] = '.'; + fs->win[DIR_Attr] = AM_DIR; + st_dword(fs->win + DIR_ModTime, tm); + st_clust(fs, fs->win, dcl); + mem_cpy(fs->win + SZDIRE, fs->win, SZDIRE); /* Create ".." entry */ + fs->win[SZDIRE + 1] = '.'; pcl = dj.obj.sclust; + st_clust(fs, fs->win + SZDIRE, pcl); + fs->wflag = 1; + } + res = dir_register(&dj); /* Register the object to the parent directoy */ + } + } + if (res == FR_OK) { +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* Initialize directory entry block */ + st_dword(fs->dirbuf + XDIR_ModTime, tm); /* Created time */ + st_dword(fs->dirbuf + XDIR_FstClus, dcl); /* Table start cluster */ + st_dword(fs->dirbuf + XDIR_FileSize, (DWORD)fs->csize * SS(fs)); /* File size needs to be valid */ + st_dword(fs->dirbuf + XDIR_ValidFileSize, (DWORD)fs->csize * SS(fs)); + fs->dirbuf[XDIR_GenFlags] = 3; /* Initialize the object flag */ + fs->dirbuf[XDIR_Attr] = AM_DIR; /* Attribute */ + res = store_xdir(&dj); + } else +#endif + { + st_dword(dj.dir + DIR_ModTime, tm); /* Created time */ + st_clust(fs, dj.dir, dcl); /* Table start cluster */ + dj.dir[DIR_Attr] = AM_DIR; /* Attribute */ + fs->wflag = 1; + } + if (res == FR_OK) { + res = sync_fs(fs); + } + } else { + remove_chain(&sobj, dcl, 0); /* Could not register, remove the allocated cluster */ + } + } + FREE_NAMBUF(); + } + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Rename a File/Directory */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_rename ( + const TCHAR* path_old, /* Pointer to the object name to be renamed */ + const TCHAR* path_new /* Pointer to the new name */ +) +{ + FRESULT res; + DIR djo, djn; + FATFS *fs; + BYTE buf[FF_FS_EXFAT ? SZDIRE * 2 : SZDIRE], *dir; + DWORD dw; + DEF_NAMBUF + + + get_ldnumber(&path_new); /* Snip the drive number of new name off */ + res = find_volume(&path_old, &fs, FA_WRITE); /* Get logical drive of the old object */ + if (res == FR_OK) { + djo.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&djo, path_old); /* Check old object */ + if (res == FR_OK && (djo.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME; /* Check validity of name */ +#if FF_FS_LOCK != 0 + if (res == FR_OK) { + res = chk_lock(&djo, 2); + } +#endif + if (res == FR_OK) { /* Object to be renamed is found */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* At exFAT volume */ + BYTE nf, nn; + WORD nh; + + mem_cpy(buf, fs->dirbuf, SZDIRE * 2); /* Save 85+C0 entry of old object */ + mem_cpy(&djn, &djo, sizeof djo); + res = follow_path(&djn, path_new); /* Make sure if new object name is not in use */ + if (res == FR_OK) { /* Is new name already in use by any other object? */ + res = (djn.obj.sclust == djo.obj.sclust && djn.dptr == djo.dptr) ? FR_NO_FILE : FR_EXIST; + } + if (res == FR_NO_FILE) { /* It is a valid path and no name collision */ + res = dir_register(&djn); /* Register the new entry */ + if (res == FR_OK) { + nf = fs->dirbuf[XDIR_NumSec]; nn = fs->dirbuf[XDIR_NumName]; + nh = ld_word(fs->dirbuf + XDIR_NameHash); + mem_cpy(fs->dirbuf, buf, SZDIRE * 2); /* Restore 85+C0 entry */ + fs->dirbuf[XDIR_NumSec] = nf; fs->dirbuf[XDIR_NumName] = nn; + st_word(fs->dirbuf + XDIR_NameHash, nh); + if (!(fs->dirbuf[XDIR_Attr] & AM_DIR)) fs->dirbuf[XDIR_Attr] |= AM_ARC; /* Set archive attribute if it is a file */ +/* Start of critical section where an interruption can cause a cross-link */ + res = store_xdir(&djn); + } + } + } else +#endif + { /* At FAT/FAT32 volume */ + mem_cpy(buf, djo.dir, SZDIRE); /* Save directory entry of the object */ + mem_cpy(&djn, &djo, sizeof (DIR)); /* Duplicate the directory object */ + res = follow_path(&djn, path_new); /* Make sure if new object name is not in use */ + if (res == FR_OK) { /* Is new name already in use by any other object? */ + res = (djn.obj.sclust == djo.obj.sclust && djn.dptr == djo.dptr) ? FR_NO_FILE : FR_EXIST; + } + if (res == FR_NO_FILE) { /* It is a valid path and no name collision */ + res = dir_register(&djn); /* Register the new entry */ + if (res == FR_OK) { + dir = djn.dir; /* Copy directory entry of the object except name */ + mem_cpy(dir + 13, buf + 13, SZDIRE - 13); + dir[DIR_Attr] = buf[DIR_Attr]; + if (!(dir[DIR_Attr] & AM_DIR)) dir[DIR_Attr] |= AM_ARC; /* Set archive attribute if it is a file */ + fs->wflag = 1; + if ((dir[DIR_Attr] & AM_DIR) && djo.obj.sclust != djn.obj.sclust) { /* Update .. entry in the sub-directory if needed */ + dw = clst2sect(fs, ld_clust(fs, dir)); + if (dw == 0) { + res = FR_INT_ERR; + } else { +/* Start of critical section where an interruption can cause a cross-link */ + res = move_window(fs, dw); + dir = fs->win + SZDIRE * 1; /* Ptr to .. entry */ + if (res == FR_OK && dir[1] == '.') { + st_clust(fs, dir, djn.obj.sclust); + fs->wflag = 1; + } + } + } + } + } + } + if (res == FR_OK) { + res = dir_remove(&djo); /* Remove old entry */ + if (res == FR_OK) { + res = sync_fs(fs); + } + } +/* End of the critical section */ + } + FREE_NAMBUF(); + } + + LEAVE_FF(fs, res); +} + +#endif /* !FF_FS_READONLY */ +#endif /* FF_FS_MINIMIZE == 0 */ +#endif /* FF_FS_MINIMIZE <= 1 */ +#endif /* FF_FS_MINIMIZE <= 2 */ + + + +#if FF_USE_CHMOD && !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Change Attribute */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_chmod ( + const TCHAR* path, /* Pointer to the file path */ + BYTE attr, /* Attribute bits */ + BYTE mask /* Attribute mask to change */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; + DEF_NAMBUF + + + res = find_volume(&path, &fs, FA_WRITE); /* Get logical drive */ + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the file path */ + if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME; /* Check object validity */ + if (res == FR_OK) { + mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC; /* Valid attribute mask */ +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + fs->dirbuf[XDIR_Attr] = (attr & mask) | (fs->dirbuf[XDIR_Attr] & (BYTE)~mask); /* Apply attribute change */ + res = store_xdir(&dj); + } else +#endif + { + dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */ + fs->wflag = 1; + } + if (res == FR_OK) { + res = sync_fs(fs); + } + } + FREE_NAMBUF(); + } + + LEAVE_FF(fs, res); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Change Timestamp */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_utime ( + const TCHAR* path, /* Pointer to the file/directory name */ + const FILINFO* fno /* Pointer to the timestamp to be set */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; + DEF_NAMBUF + + + res = find_volume(&path, &fs, FA_WRITE); /* Get logical drive */ + if (res == FR_OK) { + dj.obj.fs = fs; + INIT_NAMBUF(fs); + res = follow_path(&dj, path); /* Follow the file path */ + if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME; /* Check object validity */ + if (res == FR_OK) { +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + st_dword(fs->dirbuf + XDIR_ModTime, (DWORD)fno->fdate << 16 | fno->ftime); + res = store_xdir(&dj); + } else +#endif + { + st_dword(dj.dir + DIR_ModTime, (DWORD)fno->fdate << 16 | fno->ftime); + fs->wflag = 1; + } + if (res == FR_OK) { + res = sync_fs(fs); + } + } + FREE_NAMBUF(); + } + + LEAVE_FF(fs, res); +} + +#endif /* FF_USE_CHMOD && !FF_FS_READONLY */ + + + +#if FF_USE_LABEL +/*-----------------------------------------------------------------------*/ +/* Get Volume Label */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_getlabel ( + const TCHAR* path, /* Logical drive number */ + TCHAR* label, /* Buffer to store the volume label */ + DWORD* vsn /* Variable to store the volume serial number */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; + UINT si, di; + WCHAR wc; + + /* Get logical drive */ + res = find_volume(&path, &fs, 0); + + /* Get volume label */ + if (res == FR_OK && label) { + dj.obj.fs = fs; dj.obj.sclust = 0; /* Open root directory */ + res = dir_sdi(&dj, 0); + if (res == FR_OK) { + res = DIR_READ_LABEL(&dj); /* Find a volume label entry */ + if (res == FR_OK) { +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + WCHAR hs; + + for (si = di = hs = 0; si < dj.dir[XDIR_NumLabel]; si++) { /* Extract volume label from 83 entry */ + wc = ld_word(dj.dir + XDIR_Label + si * 2); + if (hs == 0 && IsSurrogate(wc)) { /* Is the code a surrogate? */ + hs = wc; continue; + } + wc = put_utf((DWORD)hs << 16 | wc, &label[di], 4); + if (wc == 0) { di = 0; break; } + di += wc; + hs = 0; + } + if (hs != 0) di = 0; /* Broken surrogate pair? */ + label[di] = 0; + } else +#endif + { + si = di = 0; /* Extract volume label from AM_VOL entry */ + while (si < 11) { + wc = dj.dir[si++]; +#if FF_USE_LFN && FF_LFN_UNICODE >= 1 /* Unicode output */ + if (dbc_1st((BYTE)wc) && si < 11) wc = wc << 8 | dj.dir[si++]; /* Is it a DBC? */ + wc = ff_oem2uni(wc, CODEPAGE); /* Convert it into Unicode */ + if (wc != 0) wc = put_utf(wc, &label[di], 4); /* Put it in Unicode */ + if (wc == 0) { di = 0; break; } + di += wc; +#else /* ANSI/OEM output */ + label[di++] = (TCHAR)wc; +#endif + } + do { /* Truncate trailing spaces */ + label[di] = 0; + if (di == 0) break; + } while (label[--di] == ' '); + } + } + } + if (res == FR_NO_FILE) { /* No label entry and return nul string */ + label[0] = 0; + res = FR_OK; + } + } + + /* Get volume serial number */ + if (res == FR_OK && vsn) { + res = move_window(fs, fs->volbase); + if (res == FR_OK) { + switch (fs->fs_type) { + case FS_EXFAT: + di = BPB_VolIDEx; break; + + case FS_FAT32: + di = BS_VolID32; break; + + default: + di = BS_VolID; + } + *vsn = ld_dword(fs->win + di); + } + } + + LEAVE_FF(fs, res); +} + + + +#if !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Set Volume Label */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_setlabel ( + const TCHAR* label /* Volume label to set with heading logical drive number */ +) +{ + FRESULT res; + DIR dj; + FATFS *fs; + BYTE dirvn[22]; + UINT di; + WCHAR wc; + static const char badchr[] = "+.,;=[]/\\\"*:<>\?|\x7F"; /* [0..] for FAT, [7..] for exFAT */ +#if FF_USE_LFN + DWORD dc; +#endif + + /* Get logical drive */ + res = find_volume(&label, &fs, FA_WRITE); + if (res != FR_OK) LEAVE_FF(fs, res); + +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */ + mem_set(dirvn, 0, 22); + di = 0; + while ((UINT)*label >= ' ') { /* Create volume label */ + dc = tchar2uni(&label); /* Get a Unicode character */ + if (dc >= 0x10000) { + if (dc == 0xFFFFFFFF || di >= 10) { /* Wrong surrogate or buffer overflow */ + dc = 0; + } else { + st_word(dirvn + di * 2, (WCHAR)(dc >> 16)); di++; + } + } + if (dc == 0 || chk_chr(badchr + 7, (int)dc) || di >= 11) { /* Check validity of the volume label */ + LEAVE_FF(fs, FR_INVALID_NAME); + } + st_word(dirvn + di * 2, (WCHAR)dc); di++; + } + } else +#endif + { /* On the FAT/FAT32 volume */ + mem_set(dirvn, ' ', 11); + di = 0; + while ((UINT)*label >= ' ') { /* Create volume label */ +#if FF_USE_LFN + dc = tchar2uni(&label); + wc = (dc < 0x10000) ? ff_uni2oem(ff_wtoupper(dc), CODEPAGE) : 0; +#else /* ANSI/OEM input */ + wc = (BYTE)*label++; + if (dbc_1st((BYTE)wc)) wc = dbc_2nd((BYTE)*label) ? wc << 8 | (BYTE)*label++ : 0; + if (IsLower(wc)) wc -= 0x20; /* To upper ASCII characters */ +#if FF_CODE_PAGE == 0 + if (ExCvt && wc >= 0x80) wc = ExCvt[wc - 0x80]; /* To upper extended characters (SBCS cfg) */ +#elif FF_CODE_PAGE < 900 + if (wc >= 0x80) wc = ExCvt[wc - 0x80]; /* To upper extended characters (SBCS cfg) */ +#endif +#endif + if (wc == 0 || chk_chr(badchr + 0, (int)wc) || di >= (UINT)((wc >= 0x100) ? 10 : 11)) { /* Reject invalid characters for volume label */ + LEAVE_FF(fs, FR_INVALID_NAME); + } + if (wc >= 0x100) dirvn[di++] = (BYTE)(wc >> 8); + dirvn[di++] = (BYTE)wc; + } + if (dirvn[0] == DDEM) LEAVE_FF(fs, FR_INVALID_NAME); /* Reject illegal name (heading DDEM) */ + while (di && dirvn[di - 1] == ' ') di--; /* Snip trailing spaces */ + } + + /* Set volume label */ + dj.obj.fs = fs; dj.obj.sclust = 0; /* Open root directory */ + res = dir_sdi(&dj, 0); + if (res == FR_OK) { + res = DIR_READ_LABEL(&dj); /* Get volume label entry */ + if (res == FR_OK) { + if (FF_FS_EXFAT && fs->fs_type == FS_EXFAT) { + dj.dir[XDIR_NumLabel] = (BYTE)di; /* Change the volume label */ + mem_cpy(dj.dir + XDIR_Label, dirvn, 22); + } else { + if (di != 0) { + mem_cpy(dj.dir, dirvn, 11); /* Change the volume label */ + } else { + dj.dir[DIR_Name] = DDEM; /* Remove the volume label */ + } + } + fs->wflag = 1; + res = sync_fs(fs); + } else { /* No volume label entry or an error */ + if (res == FR_NO_FILE) { + res = FR_OK; + if (di != 0) { /* Create a volume label entry */ + res = dir_alloc(&dj, 1); /* Allocate an entry */ + if (res == FR_OK) { + mem_set(dj.dir, 0, SZDIRE); /* Clean the entry */ + if (FF_FS_EXFAT && fs->fs_type == FS_EXFAT) { + dj.dir[XDIR_Type] = ET_VLABEL; /* Create volume label entry */ + dj.dir[XDIR_NumLabel] = (BYTE)di; + mem_cpy(dj.dir + XDIR_Label, dirvn, 22); + } else { + dj.dir[DIR_Attr] = AM_VOL; /* Create volume label entry */ + mem_cpy(dj.dir, dirvn, 11); + } + fs->wflag = 1; + res = sync_fs(fs); + } + } + } + } + } + + LEAVE_FF(fs, res); +} + +#endif /* !FF_FS_READONLY */ +#endif /* FF_USE_LABEL */ + + + +#if FF_USE_EXPAND && !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Allocate a Contiguous Blocks to the File */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_expand ( + FIL* fp, /* Pointer to the file object */ + FSIZE_t fsz, /* File size to be expanded to */ + BYTE opt /* Operation mode 0:Find and prepare or 1:Find and allocate */ +) +{ + FRESULT res; + FATFS *fs; + DWORD n, clst, stcl, scl, ncl, tcl, lclst; + + + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); + if (fsz == 0 || fp->obj.objsize != 0 || !(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); +#if FF_FS_EXFAT + if (fs->fs_type != FS_EXFAT && fsz >= 0x100000000) LEAVE_FF(fs, FR_DENIED); /* Check if in size limit */ +#endif + n = (DWORD)fs->csize * SS(fs); /* Cluster size */ + tcl = (DWORD)(fsz / n) + ((fsz & (n - 1)) ? 1 : 0); /* Number of clusters required */ + stcl = fs->last_clst; lclst = 0; + if (stcl < 2 || stcl >= fs->n_fatent) stcl = 2; + +#if FF_FS_EXFAT + if (fs->fs_type == FS_EXFAT) { + scl = find_bitmap(fs, stcl, tcl); /* Find a contiguous cluster block */ + if (scl == 0) res = FR_DENIED; /* No contiguous cluster block was found */ + if (scl == 0xFFFFFFFF) res = FR_DISK_ERR; + if (res == FR_OK) { /* A contiguous free area is found */ + if (opt) { /* Allocate it now */ + res = change_bitmap(fs, scl, tcl, 1); /* Mark the cluster block 'in use' */ + lclst = scl + tcl - 1; + } else { /* Set it as suggested point for next allocation */ + lclst = scl - 1; + } + } + } else +#endif + { + scl = clst = stcl; ncl = 0; + for (;;) { /* Find a contiguous cluster block */ + n = get_fat(&fp->obj, clst); + if (++clst >= fs->n_fatent) clst = 2; + if (n == 1) { res = FR_INT_ERR; break; } + if (n == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } + if (n == 0) { /* Is it a free cluster? */ + if (++ncl == tcl) break; /* Break if a contiguous cluster block is found */ + } else { + scl = clst; ncl = 0; /* Not a free cluster */ + } + if (clst == stcl) { res = FR_DENIED; break; } /* No contiguous cluster? */ + } + if (res == FR_OK) { /* A contiguous free area is found */ + if (opt) { /* Allocate it now */ + for (clst = scl, n = tcl; n; clst++, n--) { /* Create a cluster chain on the FAT */ + res = put_fat(fs, clst, (n == 1) ? 0xFFFFFFFF : clst + 1); + if (res != FR_OK) break; + lclst = clst; + } + } else { /* Set it as suggested point for next allocation */ + lclst = scl - 1; + } + } + } + + if (res == FR_OK) { + fs->last_clst = lclst; /* Set suggested start cluster to start next */ + if (opt) { /* Is it allocated now? */ + fp->obj.sclust = scl; /* Update object allocation information */ + fp->obj.objsize = fsz; + if (FF_FS_EXFAT) fp->obj.stat = 2; /* Set status 'contiguous chain' */ + fp->flag |= FA_MODIFIED; + if (fs->free_clst <= fs->n_fatent - 2) { /* Update FSINFO */ + fs->free_clst -= tcl; + fs->fsi_flag |= 1; + } + } + } + + LEAVE_FF(fs, res); +} + +#endif /* FF_USE_EXPAND && !FF_FS_READONLY */ + + + +#if FF_USE_FORWARD +/*-----------------------------------------------------------------------*/ +/* Forward Data to the Stream Directly */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_forward ( + FIL* fp, /* Pointer to the file object */ + UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */ + UINT btf, /* Number of bytes to forward */ + UINT* bf /* Pointer to number of bytes forwarded */ +) +{ + FRESULT res; + FATFS *fs; + DWORD clst, sect; + FSIZE_t remain; + UINT rcnt, csect; + BYTE *dbuf; + + + *bf = 0; /* Clear transfer byte counter */ + res = validate(&fp->obj, &fs); /* Check validity of the file object */ + if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); + if (!(fp->flag & FA_READ)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */ + + remain = fp->obj.objsize - fp->fptr; + if (btf > remain) btf = (UINT)remain; /* Truncate btf by remaining bytes */ + + for ( ; btf && (*func)(0, 0); /* Repeat until all data transferred or stream goes busy */ + fp->fptr += rcnt, *bf += rcnt, btf -= rcnt) { + csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */ + if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */ + if (csect == 0) { /* On the cluster boundary? */ + clst = (fp->fptr == 0) ? /* On the top of the file? */ + fp->obj.sclust : get_fat(&fp->obj, fp->clust); + if (clst <= 1) ABORT(fs, FR_INT_ERR); + if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); + fp->clust = clst; /* Update current cluster */ + } + } + sect = clst2sect(fs, fp->clust); /* Get current data sector */ + if (sect == 0) ABORT(fs, FR_INT_ERR); + sect += csect; +#if FF_FS_TINY + if (move_window(fs, sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window to the file data */ + dbuf = fs->win; +#else + if (fp->sect != sect) { /* Fill sector cache with file data */ +#if !FF_FS_READONLY + if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */ + if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + fp->flag &= (BYTE)~FA_DIRTY; + } +#endif + if (disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); + } + dbuf = fp->buf; +#endif + fp->sect = sect; + rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */ + if (rcnt > btf) rcnt = btf; /* Clip it by btr if needed */ + rcnt = (*func)(dbuf + ((UINT)fp->fptr % SS(fs)), rcnt); /* Forward the file data */ + if (rcnt == 0) ABORT(fs, FR_INT_ERR); + } + + LEAVE_FF(fs, FR_OK); +} +#endif /* FF_USE_FORWARD */ + + + +#if FF_USE_MKFS && !FF_FS_READONLY +/*-----------------------------------------------------------------------*/ +/* Create an FAT/exFAT volume */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_mkfs ( + const TCHAR* path, /* Logical drive number */ + BYTE opt, /* Format option */ + DWORD au, /* Size of allocation unit (cluster) [byte] */ + void* work, /* Pointer to working buffer (null: use heap memory) */ + UINT len /* Size of working buffer [byte] */ +) +{ + const UINT n_fats = 1; /* Number of FATs for FAT/FAT32 volume (1 or 2) */ + const UINT n_rootdir = 512; /* Number of root directory entries for FAT volume */ + static const WORD cst[] = {1, 4, 16, 64, 256, 512, 0}; /* Cluster size boundary for FAT volume (4Ks unit) */ + static const WORD cst32[] = {1, 2, 4, 8, 16, 32, 0}; /* Cluster size boundary for FAT32 volume (128Ks unit) */ + BYTE fmt, sys, *buf, *pte, pdrv, part; + WORD ss; /* Sector size */ + DWORD szb_buf, sz_buf, sz_blk, n_clst, pau, sect, nsect, n; + DWORD b_vol, b_fat, b_data; /* Base LBA for volume, fat, data */ + DWORD sz_vol, sz_rsv, sz_fat, sz_dir; /* Size for volume, fat, dir, data */ + UINT i; + int vol; + DSTATUS stat; +#if FF_USE_TRIM || FF_FS_EXFAT + DWORD tbl[3]; +#endif + + + /* Check mounted drive and clear work area */ + vol = get_ldnumber(&path); /* Get target logical drive */ + if (vol < 0) return FR_INVALID_DRIVE; + if (FatFs[vol]) FatFs[vol]->fs_type = 0; /* Clear the volume if mounted */ + pdrv = LD2PD(vol); /* Physical drive */ + part = LD2PT(vol); /* Partition (0:create as new, 1-4:get from partition table) */ + + /* Check physical drive status */ + stat = disk_initialize(pdrv); + if (stat & STA_NOINIT) return FR_NOT_READY; + if (stat & STA_PROTECT) return FR_WRITE_PROTECTED; + if (disk_ioctl(pdrv, GET_BLOCK_SIZE, &sz_blk) != RES_OK || !sz_blk || sz_blk > 32768 || (sz_blk & (sz_blk - 1))) sz_blk = 1; /* Erase block to align data area */ +#if FF_MAX_SS != FF_MIN_SS /* Get sector size of the medium if variable sector size cfg. */ + if (disk_ioctl(pdrv, GET_SECTOR_SIZE, &ss) != RES_OK) return FR_DISK_ERR; + if (ss > FF_MAX_SS || ss < FF_MIN_SS || (ss & (ss - 1))) return FR_DISK_ERR; +#else + ss = FF_MAX_SS; +#endif + if ((au != 0 && au < ss) || au > 0x1000000 || (au & (au - 1))) return FR_INVALID_PARAMETER; /* Check if au is valid */ + au /= ss; /* Cluster size in unit of sector */ + + /* Get working buffer */ +#if FF_USE_LFN == 3 + if (!work) { /* Use heap memory for working buffer */ + for (szb_buf = MAX_MALLOC, buf = 0; szb_buf >= ss && (buf = ff_memalloc(szb_buf)) == 0; szb_buf /= 2) ; + sz_buf = szb_buf / ss; /* Size of working buffer (sector) */ + } else +#endif + { + buf = (BYTE*)work; /* Working buffer */ + sz_buf = len / ss; /* Size of working buffer (sector) */ + szb_buf = sz_buf * ss; /* Size of working buffer (byte) */ + } + if (!buf || sz_buf == 0) return FR_NOT_ENOUGH_CORE; + + /* Determine where the volume to be located (b_vol, sz_vol) */ + if (FF_MULTI_PARTITION && part != 0) { + /* Get partition information from partition table in the MBR */ + if (disk_read(pdrv, buf, 0, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Load MBR */ + if (ld_word(buf + BS_55AA) != 0xAA55) LEAVE_MKFS(FR_MKFS_ABORTED); /* Check if MBR is valid */ + pte = buf + (MBR_Table + (part - 1) * SZ_PTE); + if (pte[PTE_System] == 0) LEAVE_MKFS(FR_MKFS_ABORTED); /* No partition? */ + b_vol = ld_dword(pte + PTE_StLba); /* Get volume start sector */ + sz_vol = ld_dword(pte + PTE_SizLba); /* Get volume size */ + } else { + /* Create a single-partition in this function */ + if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &sz_vol) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + b_vol = (opt & FM_SFD) ? 0 : 63; /* Volume start sector */ + if (sz_vol < b_vol) LEAVE_MKFS(FR_MKFS_ABORTED); + sz_vol -= b_vol; /* Volume size */ + } + if (sz_vol < 128) LEAVE_MKFS(FR_MKFS_ABORTED); /* Check if volume size is >=128s */ + + /* Pre-determine the FAT type */ + do { + if (FF_FS_EXFAT && (opt & FM_EXFAT)) { /* exFAT possible? */ + if ((opt & FM_ANY) == FM_EXFAT || sz_vol >= 0x4000000 || au > 128) { /* exFAT only, vol >= 64Ms or au > 128s ? */ + fmt = FS_EXFAT; break; + } + } + if (au > 128) LEAVE_MKFS(FR_INVALID_PARAMETER); /* Too large au for FAT/FAT32 */ + if (opt & FM_FAT32) { /* FAT32 possible? */ + if ((opt & FM_ANY) == FM_FAT32 || !(opt & FM_FAT)) { /* FAT32 only or no-FAT? */ + fmt = FS_FAT32; break; + } + } + if (!(opt & FM_FAT)) LEAVE_MKFS(FR_INVALID_PARAMETER); /* no-FAT? */ + fmt = FS_FAT16; + } while (0); + +#if FF_FS_EXFAT + if (fmt == FS_EXFAT) { /* Create an exFAT volume */ + DWORD szb_bit, szb_case, sum, nb, cl; + WCHAR ch, si; + UINT j, st; + BYTE b; + + if (sz_vol < 0x1000) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too small volume? */ +#if FF_USE_TRIM + tbl[0] = b_vol; tbl[1] = b_vol + sz_vol - 1; /* Inform the device the volume area may be erased */ + disk_ioctl(pdrv, CTRL_TRIM, tbl); +#endif + /* Determine FAT location, data location and number of clusters */ + if (au == 0) { /* au auto-selection */ + au = 8; + if (sz_vol >= 0x80000) au = 64; /* >= 512Ks */ + if (sz_vol >= 0x4000000) au = 256; /* >= 64Ms */ + } + b_fat = b_vol + 32; /* FAT start at offset 32 */ + sz_fat = ((sz_vol / au + 2) * 4 + ss - 1) / ss; /* Number of FAT sectors */ + b_data = (b_fat + sz_fat + sz_blk - 1) & ~(sz_blk - 1); /* Align data area to the erase block boundary */ + if (b_data >= sz_vol / 2) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too small volume? */ + n_clst = (sz_vol - (b_data - b_vol)) / au; /* Number of clusters */ + if (n_clst <16) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too few clusters? */ + if (n_clst > MAX_EXFAT) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too many clusters? */ + + szb_bit = (n_clst + 7) / 8; /* Size of allocation bitmap */ + tbl[0] = (szb_bit + au * ss - 1) / (au * ss); /* Number of allocation bitmap clusters */ + + /* Create a compressed up-case table */ + sect = b_data + au * tbl[0]; /* Table start sector */ + sum = 0; /* Table checksum to be stored in the 82 entry */ + st = 0; si = 0; i = 0; j = 0; szb_case = 0; + do { + switch (st) { + case 0: + ch = (WCHAR)ff_wtoupper(si); /* Get an up-case char */ + if (ch != si) { + si++; break; /* Store the up-case char if exist */ + } + for (j = 1; (WCHAR)(si + j) && (WCHAR)(si + j) == ff_wtoupper((WCHAR)(si + j)); j++) ; /* Get run length of no-case block */ + if (j >= 128) { + ch = 0xFFFF; st = 2; break; /* Compress the no-case block if run is >= 128 */ + } + st = 1; /* Do not compress short run */ + /* go to next case */ + case 1: + ch = si++; /* Fill the short run */ + if (--j == 0) st = 0; + break; + + default: + ch = (WCHAR)j; si += (WCHAR)j; /* Number of chars to skip */ + st = 0; + } + sum = xsum32(buf[i + 0] = (BYTE)ch, sum); /* Put it into the write buffer */ + sum = xsum32(buf[i + 1] = (BYTE)(ch >> 8), sum); + i += 2; szb_case += 2; + if (si == 0 || i == szb_buf) { /* Write buffered data when buffer full or end of process */ + n = (i + ss - 1) / ss; + if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + sect += n; i = 0; + } + } while (si); + tbl[1] = (szb_case + au * ss - 1) / (au * ss); /* Number of up-case table clusters */ + tbl[2] = 1; /* Number of root dir clusters */ + + /* Initialize the allocation bitmap */ + sect = b_data; nsect = (szb_bit + ss - 1) / ss; /* Start of bitmap and number of sectors */ + nb = tbl[0] + tbl[1] + tbl[2]; /* Number of clusters in-use by system */ + do { + mem_set(buf, 0, szb_buf); + for (i = 0; nb >= 8 && i < szb_buf; buf[i++] = 0xFF, nb -= 8) ; + for (b = 1; nb != 0 && i < szb_buf; buf[i] |= b, b <<= 1, nb--) ; + n = (nsect > sz_buf) ? sz_buf : nsect; /* Write the buffered data */ + if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + sect += n; nsect -= n; + } while (nsect); + + /* Initialize the FAT */ + sect = b_fat; nsect = sz_fat; /* Start of FAT and number of FAT sectors */ + j = nb = cl = 0; + do { + mem_set(buf, 0, szb_buf); i = 0; /* Clear work area and reset write index */ + if (cl == 0) { /* Set entry 0 and 1 */ + st_dword(buf + i, 0xFFFFFFF8); i += 4; cl++; + st_dword(buf + i, 0xFFFFFFFF); i += 4; cl++; + } + do { /* Create chains of bitmap, up-case and root dir */ + while (nb != 0 && i < szb_buf) { /* Create a chain */ + st_dword(buf + i, (nb > 1) ? cl + 1 : 0xFFFFFFFF); + i += 4; cl++; nb--; + } + if (nb == 0 && j < 3) nb = tbl[j++]; /* Next chain */ + } while (nb != 0 && i < szb_buf); + n = (nsect > sz_buf) ? sz_buf : nsect; /* Write the buffered data */ + if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + sect += n; nsect -= n; + } while (nsect); + + /* Initialize the root directory */ + mem_set(buf, 0, szb_buf); + buf[SZDIRE * 0 + 0] = ET_VLABEL; /* Volume label entry */ + buf[SZDIRE * 1 + 0] = ET_BITMAP; /* Bitmap entry */ + st_dword(buf + SZDIRE * 1 + 20, 2); /* cluster */ + st_dword(buf + SZDIRE * 1 + 24, szb_bit); /* size */ + buf[SZDIRE * 2 + 0] = ET_UPCASE; /* Up-case table entry */ + st_dword(buf + SZDIRE * 2 + 4, sum); /* sum */ + st_dword(buf + SZDIRE * 2 + 20, 2 + tbl[0]); /* cluster */ + st_dword(buf + SZDIRE * 2 + 24, szb_case); /* size */ + sect = b_data + au * (tbl[0] + tbl[1]); nsect = au; /* Start of the root directory and number of sectors */ + do { /* Fill root directory sectors */ + n = (nsect > sz_buf) ? sz_buf : nsect; + if (disk_write(pdrv, buf, sect, n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + mem_set(buf, 0, ss); + sect += n; nsect -= n; + } while (nsect); + + /* Create two set of the exFAT VBR blocks */ + sect = b_vol; + for (n = 0; n < 2; n++) { + /* Main record (+0) */ + mem_set(buf, 0, ss); + mem_cpy(buf + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11); /* Boot jump code (x86), OEM name */ + st_dword(buf + BPB_VolOfsEx, b_vol); /* Volume offset in the physical drive [sector] */ + st_dword(buf + BPB_TotSecEx, sz_vol); /* Volume size [sector] */ + st_dword(buf + BPB_FatOfsEx, b_fat - b_vol); /* FAT offset [sector] */ + st_dword(buf + BPB_FatSzEx, sz_fat); /* FAT size [sector] */ + st_dword(buf + BPB_DataOfsEx, b_data - b_vol); /* Data offset [sector] */ + st_dword(buf + BPB_NumClusEx, n_clst); /* Number of clusters */ + st_dword(buf + BPB_RootClusEx, 2 + tbl[0] + tbl[1]); /* Root dir cluster # */ + st_dword(buf + BPB_VolIDEx, GET_FATTIME()); /* VSN */ + st_word(buf + BPB_FSVerEx, 0x100); /* Filesystem version (1.00) */ + for (buf[BPB_BytsPerSecEx] = 0, i = ss; i >>= 1; buf[BPB_BytsPerSecEx]++) ; /* Log2 of sector size [byte] */ + for (buf[BPB_SecPerClusEx] = 0, i = au; i >>= 1; buf[BPB_SecPerClusEx]++) ; /* Log2 of cluster size [sector] */ + buf[BPB_NumFATsEx] = 1; /* Number of FATs */ + buf[BPB_DrvNumEx] = 0x80; /* Drive number (for int13) */ + st_word(buf + BS_BootCodeEx, 0xFEEB); /* Boot code (x86) */ + st_word(buf + BS_55AA, 0xAA55); /* Signature (placed here regardless of sector size) */ + for (i = sum = 0; i < ss; i++) { /* VBR checksum */ + if (i != BPB_VolFlagEx && i != BPB_VolFlagEx + 1 && i != BPB_PercInUseEx) sum = xsum32(buf[i], sum); + } + if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + /* Extended bootstrap record (+1..+8) */ + mem_set(buf, 0, ss); + st_word(buf + ss - 2, 0xAA55); /* Signature (placed at end of sector) */ + for (j = 1; j < 9; j++) { + for (i = 0; i < ss; sum = xsum32(buf[i++], sum)) ; /* VBR checksum */ + if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + } + /* OEM/Reserved record (+9..+10) */ + mem_set(buf, 0, ss); + for ( ; j < 11; j++) { + for (i = 0; i < ss; sum = xsum32(buf[i++], sum)) ; /* VBR checksum */ + if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + } + /* Sum record (+11) */ + for (i = 0; i < ss; i += 4) st_dword(buf + i, sum); /* Fill with checksum value */ + if (disk_write(pdrv, buf, sect++, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + } + + } else +#endif /* FF_FS_EXFAT */ + { /* Create an FAT/FAT32 volume */ + do { + pau = au; + /* Pre-determine number of clusters and FAT sub-type */ + if (fmt == FS_FAT32) { /* FAT32 volume */ + if (pau == 0) { /* au auto-selection */ + n = sz_vol / 0x20000; /* Volume size in unit of 128KS */ + for (i = 0, pau = 1; cst32[i] && cst32[i] <= n; i++, pau <<= 1) ; /* Get from table */ + } + n_clst = sz_vol / pau; /* Number of clusters */ + sz_fat = (n_clst * 4 + 8 + ss - 1) / ss; /* FAT size [sector] */ + sz_rsv = 32; /* Number of reserved sectors */ + sz_dir = 0; /* No static directory */ + if (n_clst <= MAX_FAT16 || n_clst > MAX_FAT32) LEAVE_MKFS(FR_MKFS_ABORTED); + } else { /* FAT volume */ + if (pau == 0) { /* au auto-selection */ + n = sz_vol / 0x1000; /* Volume size in unit of 4KS */ + for (i = 0, pau = 1; cst[i] && cst[i] <= n; i++, pau <<= 1) ; /* Get from table */ + } + n_clst = sz_vol / pau; + if (n_clst > MAX_FAT12) { + n = n_clst * 2 + 4; /* FAT size [byte] */ + } else { + fmt = FS_FAT12; + n = (n_clst * 3 + 1) / 2 + 3; /* FAT size [byte] */ + } + sz_fat = (n + ss - 1) / ss; /* FAT size [sector] */ + sz_rsv = 1; /* Number of reserved sectors */ + sz_dir = (DWORD)n_rootdir * SZDIRE / ss; /* Rootdir size [sector] */ + } + b_fat = b_vol + sz_rsv; /* FAT base */ + b_data = b_fat + sz_fat * n_fats + sz_dir; /* Data base */ + + /* Align data base to erase block boundary (for flash memory media) */ + n = ((b_data + sz_blk - 1) & ~(sz_blk - 1)) - b_data; /* Next nearest erase block from current data base */ + if (fmt == FS_FAT32) { /* FAT32: Move FAT base */ + sz_rsv += n; b_fat += n; + } else { /* FAT: Expand FAT size */ + sz_fat += n / n_fats; + } + + /* Determine number of clusters and final check of validity of the FAT sub-type */ + if (sz_vol < b_data + pau * 16 - b_vol) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too small volume */ + n_clst = (sz_vol - sz_rsv - sz_fat * n_fats - sz_dir) / pau; + if (fmt == FS_FAT32) { + if (n_clst <= MAX_FAT16) { /* Too few clusters for FAT32 */ + if (au == 0 && (au = pau / 2) != 0) continue; /* Adjust cluster size and retry */ + LEAVE_MKFS(FR_MKFS_ABORTED); + } + } + if (fmt == FS_FAT16) { + if (n_clst > MAX_FAT16) { /* Too many clusters for FAT16 */ + if (au == 0 && (pau * 2) <= 64) { + au = pau * 2; continue; /* Adjust cluster size and retry */ + } + if ((opt & FM_FAT32)) { + fmt = FS_FAT32; continue; /* Switch type to FAT32 and retry */ + } + if (au == 0 && (au = pau * 2) <= 128) continue; /* Adjust cluster size and retry */ + LEAVE_MKFS(FR_MKFS_ABORTED); + } + if (n_clst <= MAX_FAT12) { /* Too few clusters for FAT16 */ + if (au == 0 && (au = pau * 2) <= 128) continue; /* Adjust cluster size and retry */ + LEAVE_MKFS(FR_MKFS_ABORTED); + } + } + if (fmt == FS_FAT12 && n_clst > MAX_FAT12) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too many clusters for FAT12 */ + + /* Ok, it is the valid cluster configuration */ + break; + } while (1); + +#if FF_USE_TRIM + tbl[0] = b_vol; tbl[1] = b_vol + sz_vol - 1; /* Inform the device the volume area can be erased */ + disk_ioctl(pdrv, CTRL_TRIM, tbl); +#endif + /* Create FAT VBR */ + mem_set(buf, 0, ss); + mem_cpy(buf + BS_JmpBoot, "\xEB\xFE\x90" "MSDOS5.0", 11);/* Boot jump code (x86), OEM name */ + st_word(buf + BPB_BytsPerSec, ss); /* Sector size [byte] */ + buf[BPB_SecPerClus] = (BYTE)pau; /* Cluster size [sector] */ + st_word(buf + BPB_RsvdSecCnt, (WORD)sz_rsv); /* Size of reserved area */ + buf[BPB_NumFATs] = (BYTE)n_fats; /* Number of FATs */ + st_word(buf + BPB_RootEntCnt, (WORD)((fmt == FS_FAT32) ? 0 : n_rootdir)); /* Number of root directory entries */ + if (sz_vol < 0x10000) { + st_word(buf + BPB_TotSec16, (WORD)sz_vol); /* Volume size in 16-bit LBA */ + } else { + st_dword(buf + BPB_TotSec32, sz_vol); /* Volume size in 32-bit LBA */ + } + buf[BPB_Media] = 0xF8; /* Media descriptor byte */ + st_word(buf + BPB_SecPerTrk, 63); /* Number of sectors per track (for int13) */ + st_word(buf + BPB_NumHeads, 255); /* Number of heads (for int13) */ + st_dword(buf + BPB_HiddSec, b_vol); /* Volume offset in the physical drive [sector] */ + if (fmt == FS_FAT32) { + st_dword(buf + BS_VolID32, GET_FATTIME()); /* VSN */ + st_dword(buf + BPB_FATSz32, sz_fat); /* FAT size [sector] */ + st_dword(buf + BPB_RootClus32, 2); /* Root directory cluster # (2) */ + st_word(buf + BPB_FSInfo32, 1); /* Offset of FSINFO sector (VBR + 1) */ + st_word(buf + BPB_BkBootSec32, 6); /* Offset of backup VBR (VBR + 6) */ + buf[BS_DrvNum32] = 0x80; /* Drive number (for int13) */ + buf[BS_BootSig32] = 0x29; /* Extended boot signature */ + mem_cpy(buf + BS_VolLab32, "NO NAME " "FAT32 ", 19); /* Volume label, FAT signature */ + } else { + st_dword(buf + BS_VolID, GET_FATTIME()); /* VSN */ + st_word(buf + BPB_FATSz16, (WORD)sz_fat); /* FAT size [sector] */ + buf[BS_DrvNum] = 0x80; /* Drive number (for int13) */ + buf[BS_BootSig] = 0x29; /* Extended boot signature */ + mem_cpy(buf + BS_VolLab, "NO NAME " "FAT ", 19); /* Volume label, FAT signature */ + } + st_word(buf + BS_55AA, 0xAA55); /* Signature (offset is fixed here regardless of sector size) */ + if (disk_write(pdrv, buf, b_vol, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Write it to the VBR sector */ + + /* Create FSINFO record if needed */ + if (fmt == FS_FAT32) { + disk_write(pdrv, buf, b_vol + 6, 1); /* Write backup VBR (VBR + 6) */ + mem_set(buf, 0, ss); + st_dword(buf + FSI_LeadSig, 0x41615252); + st_dword(buf + FSI_StrucSig, 0x61417272); + st_dword(buf + FSI_Free_Count, n_clst - 1); /* Number of free clusters */ + st_dword(buf + FSI_Nxt_Free, 2); /* Last allocated cluster# */ + st_word(buf + BS_55AA, 0xAA55); + disk_write(pdrv, buf, b_vol + 7, 1); /* Write backup FSINFO (VBR + 7) */ + disk_write(pdrv, buf, b_vol + 1, 1); /* Write original FSINFO (VBR + 1) */ + } + + /* Initialize FAT area */ + mem_set(buf, 0, (UINT)szb_buf); + sect = b_fat; /* FAT start sector */ + for (i = 0; i < n_fats; i++) { /* Initialize FATs each */ + if (fmt == FS_FAT32) { + st_dword(buf + 0, 0xFFFFFFF8); /* Entry 0 */ + st_dword(buf + 4, 0xFFFFFFFF); /* Entry 1 */ + st_dword(buf + 8, 0x0FFFFFFF); /* Entry 2 (root directory) */ + } else { + st_dword(buf + 0, (fmt == FS_FAT12) ? 0xFFFFF8 : 0xFFFFFFF8); /* Entry 0 and 1 */ + } + nsect = sz_fat; /* Number of FAT sectors */ + do { /* Fill FAT sectors */ + n = (nsect > sz_buf) ? sz_buf : nsect; + if (disk_write(pdrv, buf, sect, (UINT)n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + mem_set(buf, 0, ss); + sect += n; nsect -= n; + } while (nsect); + } + + /* Initialize root directory (fill with zero) */ + nsect = (fmt == FS_FAT32) ? pau : sz_dir; /* Number of root directory sectors */ + do { + n = (nsect > sz_buf) ? sz_buf : nsect; + if (disk_write(pdrv, buf, sect, (UINT)n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + sect += n; nsect -= n; + } while (nsect); + } + + /* Determine system ID in the partition table */ + if (FF_FS_EXFAT && fmt == FS_EXFAT) { + sys = 0x07; /* HPFS/NTFS/exFAT */ + } else { + if (fmt == FS_FAT32) { + sys = 0x0C; /* FAT32X */ + } else { + if (sz_vol >= 0x10000) { + sys = 0x06; /* FAT12/16 (large) */ + } else { + sys = (fmt == FS_FAT16) ? 0x04 : 0x01; /* FAT16 : FAT12 */ + } + } + } + + /* Update partition information */ + if (FF_MULTI_PARTITION && part != 0) { /* Created in the existing partition */ + /* Update system ID in the partition table */ + if (disk_read(pdrv, buf, 0, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Read the MBR */ + buf[MBR_Table + (part - 1) * SZ_PTE + PTE_System] = sys; /* Set system ID */ + if (disk_write(pdrv, buf, 0, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Write it back to the MBR */ + } else { /* Created as a new single partition */ + if (!(opt & FM_SFD)) { /* Create partition table if in FDISK format */ + mem_set(buf, 0, ss); + st_word(buf + BS_55AA, 0xAA55); /* MBR signature */ + pte = buf + MBR_Table; /* Create partition table for single partition in the drive */ + pte[PTE_Boot] = 0; /* Boot indicator */ + pte[PTE_StHead] = 1; /* Start head */ + pte[PTE_StSec] = 1; /* Start sector */ + pte[PTE_StCyl] = 0; /* Start cylinder */ + pte[PTE_System] = sys; /* System type */ + n = (b_vol + sz_vol) / (63 * 255); /* (End CHS may be invalid) */ + pte[PTE_EdHead] = 254; /* End head */ + pte[PTE_EdSec] = (BYTE)(((n >> 2) & 0xC0) | 63); /* End sector */ + pte[PTE_EdCyl] = (BYTE)n; /* End cylinder */ + st_dword(pte + PTE_StLba, b_vol); /* Start offset in LBA */ + st_dword(pte + PTE_SizLba, sz_vol); /* Size in sectors */ + if (disk_write(pdrv, buf, 0, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Write it to the MBR */ + } + } + + if (disk_ioctl(pdrv, CTRL_SYNC, 0) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); + + LEAVE_MKFS(FR_OK); +} + + + +#if FF_MULTI_PARTITION +/*-----------------------------------------------------------------------*/ +/* Create Partition Table on the Physical Drive */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_fdisk ( + BYTE pdrv, /* Physical drive number */ + const DWORD* szt, /* Pointer to the size table for each partitions */ + void* work /* Pointer to the working buffer (null: use heap memory) */ +) +{ + UINT i, n, sz_cyl, tot_cyl, b_cyl, e_cyl, p_cyl; + BYTE s_hd, e_hd, *p, *buf = (BYTE*)work; + DSTATUS stat; + DWORD sz_disk, sz_part, s_part; + FRESULT res; + + + stat = disk_initialize(pdrv); + if (stat & STA_NOINIT) return FR_NOT_READY; + if (stat & STA_PROTECT) return FR_WRITE_PROTECTED; + if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &sz_disk)) return FR_DISK_ERR; + + buf = (BYTE*)work; +#if FF_USE_LFN == 3 + if (!buf) buf = ff_memalloc(FF_MAX_SS); /* Use heap memory for working buffer */ +#endif + if (!buf) return FR_NOT_ENOUGH_CORE; + + /* Determine the CHS without any consideration of the drive geometry */ + for (n = 16; n < 256 && sz_disk / n / 63 > 1024; n *= 2) ; + if (n == 256) n--; + e_hd = (BYTE)(n - 1); + sz_cyl = 63 * n; + tot_cyl = sz_disk / sz_cyl; + + /* Create partition table */ + mem_set(buf, 0, FF_MAX_SS); + p = buf + MBR_Table; b_cyl = 0; + for (i = 0; i < 4; i++, p += SZ_PTE) { + p_cyl = (szt[i] <= 100U) ? (DWORD)tot_cyl * szt[i] / 100 : szt[i] / sz_cyl; /* Number of cylinders */ + if (p_cyl == 0) continue; + s_part = (DWORD)sz_cyl * b_cyl; + sz_part = (DWORD)sz_cyl * p_cyl; + if (i == 0) { /* Exclude first track of cylinder 0 */ + s_hd = 1; + s_part += 63; sz_part -= 63; + } else { + s_hd = 0; + } + e_cyl = b_cyl + p_cyl - 1; /* End cylinder */ + if (e_cyl >= tot_cyl) LEAVE_MKFS(FR_INVALID_PARAMETER); + + /* Set partition table */ + p[1] = s_hd; /* Start head */ + p[2] = (BYTE)(((b_cyl >> 2) & 0xC0) | 1); /* Start sector */ + p[3] = (BYTE)b_cyl; /* Start cylinder */ + p[4] = 0x07; /* System type (temporary setting) */ + p[5] = e_hd; /* End head */ + p[6] = (BYTE)(((e_cyl >> 2) & 0xC0) | 63); /* End sector */ + p[7] = (BYTE)e_cyl; /* End cylinder */ + st_dword(p + 8, s_part); /* Start sector in LBA */ + st_dword(p + 12, sz_part); /* Number of sectors */ + + /* Next partition */ + b_cyl += p_cyl; + } + st_word(p, 0xAA55); /* MBR signature (always at offset 510) */ + + /* Write it to the MBR */ + res = (disk_write(pdrv, buf, 0, 1) == RES_OK && disk_ioctl(pdrv, CTRL_SYNC, 0) == RES_OK) ? FR_OK : FR_DISK_ERR; + LEAVE_MKFS(res); +} + +#endif /* FF_MULTI_PARTITION */ +#endif /* FF_USE_MKFS && !FF_FS_READONLY */ + + + + +#if FF_USE_STRFUNC +#if FF_USE_LFN && FF_LFN_UNICODE && (FF_STRF_ENCODE < 0 || FF_STRF_ENCODE > 3) +#error Wrong FF_STRF_ENCODE setting +#endif +/*-----------------------------------------------------------------------*/ +/* Get a String from the File */ +/*-----------------------------------------------------------------------*/ + +TCHAR* f_gets ( + TCHAR* buff, /* Pointer to the string buffer to read */ + int len, /* Size of string buffer (items) */ + FIL* fp /* Pointer to the file object */ +) +{ + int nc = 0; + TCHAR *p = buff; + BYTE s[4]; + UINT rc; + DWORD dc; +#if FF_USE_LFN && FF_LFN_UNICODE && FF_STRF_ENCODE <= 2 + WCHAR wc; +#endif +#if FF_USE_LFN && FF_LFN_UNICODE && FF_STRF_ENCODE == 3 + UINT ct; +#endif + +#if FF_USE_LFN && FF_LFN_UNICODE /* With code conversion (Unicode API) */ + /* Make a room for the character and terminator */ + if (FF_LFN_UNICODE == 1) len -= (FF_STRF_ENCODE == 0) ? 1 : 2; + if (FF_LFN_UNICODE == 2) len -= (FF_STRF_ENCODE == 0) ? 3 : 4; + if (FF_LFN_UNICODE == 3) len -= 1; + while (nc < len) { +#if FF_STRF_ENCODE == 0 /* Read a character in ANSI/OEM */ + f_read(fp, s, 1, &rc); + if (rc != 1) break; + wc = s[0]; + if (dbc_1st((BYTE)wc)) { + f_read(fp, s, 1, &rc); + if (rc != 1 || !dbc_2nd(s[0])) continue; + wc = wc << 8 | s[0]; + } + dc = ff_oem2uni(wc, CODEPAGE); + if (dc == 0) continue; +#elif FF_STRF_ENCODE == 1 || FF_STRF_ENCODE == 2 /* Read a character in UTF-16LE/BE */ + f_read(fp, s, 2, &rc); + if (rc != 2) break; + dc = (FF_STRF_ENCODE == 1) ? ld_word(s) : s[0] << 8 | s[1]; + if (IsSurrogateL(dc)) continue; + if (IsSurrogateH(dc)) { + f_read(fp, s, 2, &rc); + if (rc != 2) break; + wc = (FF_STRF_ENCODE == 1) ? ld_word(s) : s[0] << 8 | s[1]; + if (!IsSurrogateL(wc)) continue; + dc = ((dc & 0x3FF) + 0x40) << 10 | (wc & 0x3FF); + } +#else /* Read a character in UTF-8 */ + f_read(fp, s, 1, &rc); + if (rc != 1) break; + dc = s[0]; + if (dc >= 0x80) { /* Multi-byte character? */ + ct = 0; + if ((dc & 0xE0) == 0xC0) { dc &= 0x1F; ct = 1; } /* 2-byte? */ + if ((dc & 0xF0) == 0xE0) { dc &= 0x0F; ct = 2; } /* 3-byte? */ + if ((dc & 0xF8) == 0xF0) { dc &= 0x07; ct = 3; } /* 4-byte? */ + if (ct == 0) continue; + f_read(fp, s, ct, &rc); /* Get trailing bytes */ + if (rc != ct) break; + rc = 0; + do { /* Merge trailing bytes */ + if ((s[rc] & 0xC0) != 0x80) break; + dc = dc << 6 | (s[rc] & 0x3F); + } while (++rc < ct); + if (rc != ct || dc < 0x80 || IsSurrogate(dc) || dc >= 0x110000) continue; /* Wrong encoding? */ + } +#endif + if (FF_USE_STRFUNC == 2 && dc == '\r') continue; /* Strip \r off if needed */ +#if FF_LFN_UNICODE == 1 || FF_LFN_UNICODE == 3 /* Output it in UTF-16/32 encoding */ + if (FF_LFN_UNICODE == 1 && dc >= 0x10000) { /* Out of BMP at UTF-16? */ + *p++ = (TCHAR)(0xD800 | ((dc >> 10) - 0x40)); nc++; /* Make and output high surrogate */ + dc = 0xDC00 | (dc & 0x3FF); /* Make low surrogate */ + } + *p++ = (TCHAR)dc; nc++; + if (dc == '\n') break; /* End of line? */ +#elif FF_LFN_UNICODE == 2 /* Output it in UTF-8 encoding */ + if (dc < 0x80) { /* 1-byte */ + *p++ = (TCHAR)dc; + nc++; + if (dc == '\n') break; /* End of line? */ + } else { + if (dc < 0x800) { /* 2-byte */ + *p++ = (TCHAR)(0xC0 | (dc >> 6 & 0x1F)); + *p++ = (TCHAR)(0x80 | (dc >> 0 & 0x3F)); + nc += 2; + } else { + if (dc < 0x10000) { /* 3-byte */ + *p++ = (TCHAR)(0xE0 | (dc >> 12 & 0x0F)); + *p++ = (TCHAR)(0x80 | (dc >> 6 & 0x3F)); + *p++ = (TCHAR)(0x80 | (dc >> 0 & 0x3F)); + nc += 3; + } else { /* 4-byte */ + *p++ = (TCHAR)(0xF0 | (dc >> 18 & 0x07)); + *p++ = (TCHAR)(0x80 | (dc >> 12 & 0x3F)); + *p++ = (TCHAR)(0x80 | (dc >> 6 & 0x3F)); + *p++ = (TCHAR)(0x80 | (dc >> 0 & 0x3F)); + nc += 4; + } + } + } +#endif + } + +#else /* Byte-by-byte without any conversion (ANSI/OEM API) */ + len -= 1; /* Make a room for the terminator */ + while (nc < len) { + f_read(fp, s, 1, &rc); + if (rc != 1) break; + dc = s[0]; + if (FF_USE_STRFUNC == 2 && dc == '\r') continue; + *p++ = (TCHAR)dc; nc++; + if (dc == '\n') break; + } +#endif + + *p = 0; /* Terminate the string */ + return nc ? buff : 0; /* When no data read due to EOF or error, return with error. */ +} + + + + +#if !FF_FS_READONLY +#include +/*-----------------------------------------------------------------------*/ +/* Put a Character to the File */ +/*-----------------------------------------------------------------------*/ + +typedef struct { /* Putchar output buffer and work area */ + FIL *fp; /* Ptr to the writing file */ + int idx, nchr; /* Write index of buf[] (-1:error), number of encoding units written */ +#if FF_USE_LFN && FF_LFN_UNICODE == 1 + WCHAR hs; +#elif FF_USE_LFN && FF_LFN_UNICODE == 2 + BYTE bs[4]; + UINT wi, ct; +#endif + BYTE buf[64]; /* Write buffer */ +} putbuff; + + +static void putc_bfd ( /* Buffered write with code conversion */ + putbuff* pb, + TCHAR c +) +{ + UINT n; + int i, nc; +#if FF_USE_LFN && FF_LFN_UNICODE + WCHAR hs, wc; +#if FF_LFN_UNICODE == 2 + DWORD dc; + TCHAR *tp; +#endif +#endif + + if (FF_USE_STRFUNC == 2 && c == '\n') { /* LF -> CRLF conversion */ + putc_bfd(pb, '\r'); + } + + i = pb->idx; /* Write index of pb->buf[] */ + if (i < 0) return; + nc = pb->nchr; /* Write unit counter */ + +#if FF_USE_LFN && FF_LFN_UNICODE +#if FF_LFN_UNICODE == 1 /* UTF-16 input */ + if (IsSurrogateH(c)) { + pb->hs = c; return; + } + hs = pb->hs; pb->hs = 0; + if (hs != 0) { + if (!IsSurrogateL(c)) hs = 0; + } else { + if (IsSurrogateL(c)) return; + } + wc = c; +#elif FF_LFN_UNICODE == 2 /* UTF-8 input */ + for (;;) { + if (pb->ct == 0) { /* Out of multi-byte sequence? */ + pb->bs[pb->wi = 0] = (BYTE)c; /* Save 1st byte */ + if ((BYTE)c < 0x80) break; /* 1-byte? */ + if (((BYTE)c & 0xE0) == 0xC0) pb->ct = 1; /* 2-byte? */ + if (((BYTE)c & 0xF0) == 0xE0) pb->ct = 2; /* 3-byte? */ + if (((BYTE)c & 0xF1) == 0xF0) pb->ct = 3; /* 4-byte? */ + return; + } else { /* In the multi-byte sequence */ + if (((BYTE)c & 0xC0) != 0x80) { /* Broken sequence? */ + pb->ct = 0; continue; + } + pb->bs[++pb->wi] = (BYTE)c; /* Save the trailing byte */ + if (--pb->ct == 0) break; /* End of multi-byte sequence? */ + return; + } + } + tp = (TCHAR*)pb->bs; + dc = tchar2uni(&tp); /* UTF-8 ==> UTF-16 */ + if (dc == 0xFFFFFFFF) return; + wc = (WCHAR)dc; + hs = (WCHAR)(dc >> 16); +#elif FF_LFN_UNICODE == 3 /* UTF-32 input */ + if (IsSurrogate(c) || c >= 0x110000) return; + if (c >= 0x10000) { + hs = (WCHAR)(0xD800 | ((c >> 10) - 0x40)); /* Make high surrogate */ + wc = 0xDC00 | (c & 0x3FF); /* Make low surrogate */ + } else { + hs = 0; + wc = (WCHAR)c; + } +#endif + +#if FF_STRF_ENCODE == 1 /* Write a character in UTF-16LE */ + if (hs != 0) { + st_word(&pb->buf[i], hs); + i += 2; + nc++; + } + st_word(&pb->buf[i], wc); + i += 2; +#elif FF_STRF_ENCODE == 2 /* Write a character in UTF-16BE */ + if (hs != 0) { + pb->buf[i++] = (BYTE)(hs >> 8); + pb->buf[i++] = (BYTE)hs; + nc++; + } + pb->buf[i++] = (BYTE)(wc >> 8); + pb->buf[i++] = (BYTE)wc; +#elif FF_STRF_ENCODE == 3 /* Write it in UTF-8 */ + if (hs != 0) { /* 4-byte */ + nc += 3; + hs = (hs & 0x3FF) + 0x40; + pb->buf[i++] = (BYTE)(0xF0 | hs >> 8); + pb->buf[i++] = (BYTE)(0x80 | (hs >> 2 & 0x3F)); + pb->buf[i++] = (BYTE)(0x80 | (hs & 3) << 4 | (wc >> 6 & 0x0F)); + pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F)); + } else { + if (wc < 0x80) { /* 1-byte */ + pb->buf[i++] = (BYTE)wc; + } else { + if (wc < 0x800) { /* 2-byte */ + nc += 1; + pb->buf[i++] = (BYTE)(0xC0 | wc >> 6); + } else { /* 3-byte */ + nc += 2; + pb->buf[i++] = (BYTE)(0xE0 | wc >> 12); + pb->buf[i++] = (BYTE)(0x80 | (wc >> 6 & 0x3F)); + } + pb->buf[i++] = (BYTE)(0x80 | (wc & 0x3F)); + } + } +#else /* Write it in ANSI/OEM */ + if (hs != 0) return; + wc = ff_uni2oem(wc, CODEPAGE); /* UTF-16 ==> ANSI/OEM */ + if (wc == 0) return; + if (wc >= 0x100) { + pb->buf[i++] = (BYTE)(wc >> 8); nc++; + } + pb->buf[i++] = (BYTE)wc; +#endif + +#else /* ANSI/OEM input (without re-encode) */ + pb->buf[i++] = (BYTE)c; +#endif + + if (i >= (int)(sizeof pb->buf) - 4) { /* Write buffered characters to the file */ + f_write(pb->fp, pb->buf, (UINT)i, &n); + i = (n == (UINT)i) ? 0 : -1; + } + pb->idx = i; + pb->nchr = nc + 1; +} + + +static int putc_flush ( /* Flush left characters in the buffer */ + putbuff* pb +) +{ + UINT nw; + + if ( pb->idx >= 0 /* Flush buffered characters to the file */ + && f_write(pb->fp, pb->buf, (UINT)pb->idx, &nw) == FR_OK + && (UINT)pb->idx == nw) return pb->nchr; + return EOF; +} + + +static void putc_init ( /* Initialize write buffer */ + putbuff* pb, + FIL* fp +) +{ + mem_set(pb, 0, sizeof (putbuff)); + pb->fp = fp; +} + + + +int f_putc ( + TCHAR c, /* A character to be output */ + FIL* fp /* Pointer to the file object */ +) +{ + putbuff pb; + + + putc_init(&pb, fp); + putc_bfd(&pb, c); /* Put the character */ + return putc_flush(&pb); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Put a String to the File */ +/*-----------------------------------------------------------------------*/ + +int f_puts ( + const TCHAR* str, /* Pointer to the string to be output */ + FIL* fp /* Pointer to the file object */ +) +{ + putbuff pb; + + + putc_init(&pb, fp); + while (*str) putc_bfd(&pb, *str++); /* Put the string */ + return putc_flush(&pb); +} + + + + +/*-----------------------------------------------------------------------*/ +/* Put a Formatted String to the File */ +/*-----------------------------------------------------------------------*/ + +int f_printf ( + FIL* fp, /* Pointer to the file object */ + const TCHAR* fmt, /* Pointer to the format string */ + ... /* Optional arguments... */ +) +{ + va_list arp; + putbuff pb; + BYTE f, r; + UINT i, j, w; + DWORD v; + TCHAR c, d, str[32], *p; + + + putc_init(&pb, fp); + + va_start(arp, fmt); + + for (;;) { + c = *fmt++; + if (c == 0) break; /* End of string */ + if (c != '%') { /* Non escape character */ + putc_bfd(&pb, c); + continue; + } + w = f = 0; + c = *fmt++; + if (c == '0') { /* Flag: '0' padding */ + f = 1; c = *fmt++; + } else { + if (c == '-') { /* Flag: left justified */ + f = 2; c = *fmt++; + } + } + if (c == '*') { /* Minimum width by argument */ + w = va_arg(arp, int); + c = *fmt++; + } else { + while (IsDigit(c)) { /* Minimum width */ + w = w * 10 + c - '0'; + c = *fmt++; + } + } + if (c == 'l' || c == 'L') { /* Type prefix: Size is long int */ + f |= 4; c = *fmt++; + } + if (c == 0) break; + d = c; + if (IsLower(d)) d -= 0x20; + switch (d) { /* Atgument type is... */ + case 'S' : /* String */ + p = va_arg(arp, TCHAR*); + for (j = 0; p[j]; j++) ; + if (!(f & 2)) { /* Right padded */ + while (j++ < w) putc_bfd(&pb, ' ') ; + } + while (*p) putc_bfd(&pb, *p++) ; /* String body */ + while (j++ < w) putc_bfd(&pb, ' ') ; /* Left padded */ + continue; + + case 'C' : /* Character */ + putc_bfd(&pb, (TCHAR)va_arg(arp, int)); continue; + + case 'B' : /* Unsigned binary */ + r = 2; break; + + case 'O' : /* Unsigned octal */ + r = 8; break; + + case 'D' : /* Signed decimal */ + case 'U' : /* Unsigned decimal */ + r = 10; break; + + case 'X' : /* Unsigned hexdecimal */ + r = 16; break; + + default: /* Unknown type (pass-through) */ + putc_bfd(&pb, c); continue; + } + + /* Get an argument and put it in numeral */ + v = (f & 4) ? (DWORD)va_arg(arp, long) : ((d == 'D') ? (DWORD)(long)va_arg(arp, int) : (DWORD)va_arg(arp, unsigned int)); + if (d == 'D' && (v & 0x80000000)) { + v = 0 - v; + f |= 8; + } + i = 0; + do { + d = (TCHAR)(v % r); v /= r; + if (d > 9) d += (c == 'x') ? 0x27 : 0x07; + str[i++] = d + '0'; + } while (v && i < sizeof str / sizeof *str); + if (f & 8) str[i++] = '-'; + j = i; d = (f & 1) ? '0' : ' '; + if (!(f & 2)) { + while (j++ < w) putc_bfd(&pb, d); /* Right pad */ + } + do { + putc_bfd(&pb, str[--i]); /* Number body */ + } while (i); + while (j++ < w) putc_bfd(&pb, d); /* Left pad */ + } + + va_end(arp); + + return putc_flush(&pb); +} + +#endif /* !FF_FS_READONLY */ +#endif /* FF_USE_STRFUNC */ + + + +#if FF_CODE_PAGE == 0 +/*-----------------------------------------------------------------------*/ +/* Set Active Codepage for the Path Name */ +/*-----------------------------------------------------------------------*/ + +FRESULT f_setcp ( + WORD cp /* Value to be set as active code page */ +) +{ + static const WORD validcp[] = { 437, 720, 737, 771, 775, 850, 852, 857, 860, 861, 862, 863, 864, 865, 866, 869, 932, 936, 949, 950, 0}; + static const BYTE* const tables[] = {Ct437, Ct720, Ct737, Ct771, Ct775, Ct850, Ct852, Ct857, Ct860, Ct861, Ct862, Ct863, Ct864, Ct865, Ct866, Ct869, Dc932, Dc936, Dc949, Dc950, 0}; + UINT i; + + + for (i = 0; validcp[i] != 0 && validcp[i] != cp; i++) ; /* Find the code page */ + if (validcp[i] != cp) return FR_INVALID_PARAMETER; /* Not found? */ + + CodePage = cp; + if (cp >= 900) { /* DBCS */ + ExCvt = 0; + DbcTbl = tables[i]; + } else { /* SBCS */ + ExCvt = tables[i]; + DbcTbl = 0; + } + return FR_OK; +} +#endif /* FF_CODE_PAGE == 0 */ + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff_gen_drv.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff_gen_drv.c new file mode 100644 index 0000000..2528ed8 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ff_gen_drv.c @@ -0,0 +1,128 @@ +/*! + \file ff_gen_drv.c + \brief FatFs generic low level driver + + \version 2021-05-20, V1.0.0, firmware for GD32 USBFS +*/ + +/* + Copyright (c) 2021, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "ff_gen_drv.h" + + +Disk_drvTypeDef disk = {{0},{0},{0},0}; + +/*! + \brief Links a compatible diskio driver/lun id and increments the number of active linked drivers + \note The number of linked drivers (volumes) is up to 10 due to FatFs limits + \param[in] drv: pointer to the disk IO Driver structure + \param[in] path: pointer to the logical drive path + \param[in] lun: only used for USB Key Disk to add multi-lun management else the parameter must be equal to 0 + \param[out] none + \retval Returns 0 in case of success, otherwise 1 +*/ +uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, uint8_t lun) +{ + uint8_t ret = 1; + uint8_t DiskNum = 0; + + if(disk.nbr < _VOLUMES) { + disk.is_initialized[disk.nbr] = 0; + disk.drv[disk.nbr] = drv; + disk.lun[disk.nbr] = lun; + DiskNum = disk.nbr++; + path[0] = DiskNum + '0'; + path[1] = ':'; + path[2] = '/'; + path[3] = 0; + ret = 0; + } + + return ret; +} + +/*! + \brief Links a compatible diskio driver/lun id and increments the number of active linked drivers + \note The number of linked drivers (volumes) is up to 10 due to FatFs limits + \param[in] drv: pointer to the disk IO Driver structure + \param[in] path: pointer to the logical drive path + \param[out] none + \retval Returns 0 in case of success, otherwise 1 +*/ +uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path) +{ + return FATFS_LinkDriverEx(drv, path, 0); +} + +/*! + \brief Unlinks a diskio driver and decrements the number of active linked drivers + \param[in] path: pointer to the logical drive path + \param[in] lun: only used for USB Key Disk to add multi-lun management else the parameter must be equal to 0 + \param[out] none + \retval Returns 0 in case of success, otherwise 1 +*/ +uint8_t FATFS_UnLinkDriverEx(char *path, uint8_t lun) +{ + uint8_t DiskNum = 0; + uint8_t ret = 1; + + if (disk.nbr >= 1) { + DiskNum = path[0] - '0'; + + if (disk.drv[DiskNum] != 0) { + disk.drv[DiskNum] = 0; + disk.lun[DiskNum] = 0; + disk.nbr--; + ret = 0; + } + } + + return ret; +} + +/*! + \brief Unlinks a diskio driver and decrements the number of active linked drivers + \param[in] path: pointer to the logical drive path + \param[out] none + \retval Returns 0 in case of success, otherwise 1 +*/ +uint8_t FATFS_UnLinkDriver(char *path) +{ + return FATFS_UnLinkDriverEx(path, 0); +} + +/*! + \brief Gets number of linked drivers to the FatFs module + \param[in] none + \param[out] none + \retval Number of attached drivers +*/ +uint8_t FATFS_GetAttachedDriversNbr(void) +{ + return disk.nbr; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffsystem.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffsystem.c new file mode 100644 index 0000000..b88ce15 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffsystem.c @@ -0,0 +1,170 @@ +/*------------------------------------------------------------------------*/ +/* Sample Code of OS Dependent Functions for FatFs */ +/* (C)ChaN, 2018 */ +/*------------------------------------------------------------------------*/ + + +#include "ff.h" + + +#if FF_USE_LFN == 3 /* Dynamic memory allocation */ + +/*------------------------------------------------------------------------*/ +/* Allocate a memory block */ +/*------------------------------------------------------------------------*/ + +void* ff_memalloc ( /* Returns pointer to the allocated memory block (null if not enough core) */ + UINT msize /* Number of bytes to allocate */ +) +{ + return malloc(msize); /* Allocate a new memory block with POSIX API */ +} + + +/*------------------------------------------------------------------------*/ +/* Free a memory block */ +/*------------------------------------------------------------------------*/ + +void ff_memfree ( + void* mblock /* Pointer to the memory block to free (nothing to do if null) */ +) +{ + free(mblock); /* Free the memory block with POSIX API */ +} + +#endif + + + +#if FF_FS_REENTRANT /* Mutal exclusion */ + +/*------------------------------------------------------------------------*/ +/* Create a Synchronization Object */ +/*------------------------------------------------------------------------*/ +/* This function is called in f_mount() function to create a new +/ synchronization object for the volume, such as semaphore and mutex. +/ When a 0 is returned, the f_mount() function fails with FR_INT_ERR. +*/ + +//const osMutexDef_t Mutex[FF_VOLUMES]; /* Table of CMSIS-RTOS mutex */ + + +int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create the sync object */ + BYTE vol, /* Corresponding volume (logical drive number) */ + FF_SYNC_t* sobj /* Pointer to return the created sync object */ +) +{ + /* Win32 */ + *sobj = CreateMutex(NULL, FALSE, NULL); + return (int)(*sobj != INVALID_HANDLE_VALUE); + + /* uITRON */ +// T_CSEM csem = {TA_TPRI,1,1}; +// *sobj = acre_sem(&csem); +// return (int)(*sobj > 0); + + /* uC/OS-II */ +// OS_ERR err; +// *sobj = OSMutexCreate(0, &err); +// return (int)(err == OS_NO_ERR); + + /* FreeRTOS */ +// *sobj = xSemaphoreCreateMutex(); +// return (int)(*sobj != NULL); + + /* CMSIS-RTOS */ +// *sobj = osMutexCreate(&Mutex[vol]); +// return (int)(*sobj != NULL); +} + + +/*------------------------------------------------------------------------*/ +/* Delete a Synchronization Object */ +/*------------------------------------------------------------------------*/ +/* This function is called in f_mount() function to delete a synchronization +/ object that created with ff_cre_syncobj() function. When a 0 is returned, +/ the f_mount() function fails with FR_INT_ERR. +*/ + +int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to an error */ + FF_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */ +) +{ + /* Win32 */ + return (int)CloseHandle(sobj); + + /* uITRON */ +// return (int)(del_sem(sobj) == E_OK); + + /* uC/OS-II */ +// OS_ERR err; +// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); +// return (int)(err == OS_NO_ERR); + + /* FreeRTOS */ +// vSemaphoreDelete(sobj); +// return 1; + + /* CMSIS-RTOS */ +// return (int)(osMutexDelete(sobj) == osOK); +} + + +/*------------------------------------------------------------------------*/ +/* Request Grant to Access the Volume */ +/*------------------------------------------------------------------------*/ +/* This function is called on entering file functions to lock the volume. +/ When a 0 is returned, the file function fails with FR_TIMEOUT. +*/ + +int ff_req_grant ( /* 1:Got a grant to access the volume, 0:Could not get a grant */ + FF_SYNC_t sobj /* Sync object to wait */ +) +{ + /* Win32 */ + return (int)(WaitForSingleObject(sobj, FF_FS_TIMEOUT) == WAIT_OBJECT_0); + + /* uITRON */ +// return (int)(wai_sem(sobj) == E_OK); + + /* uC/OS-II */ +// OS_ERR err; +// OSMutexPend(sobj, FF_FS_TIMEOUT, &err)); +// return (int)(err == OS_NO_ERR); + + /* FreeRTOS */ +// return (int)(xSemaphoreTake(sobj, FF_FS_TIMEOUT) == pdTRUE); + + /* CMSIS-RTOS */ +// return (int)(osMutexWait(sobj, FF_FS_TIMEOUT) == osOK); +} + + +/*------------------------------------------------------------------------*/ +/* Release Grant to Access the Volume */ +/*------------------------------------------------------------------------*/ +/* This function is called on leaving file functions to unlock the volume. +*/ + +void ff_rel_grant ( + FF_SYNC_t sobj /* Sync object to be signaled */ +) +{ + /* Win32 */ + ReleaseMutex(sobj); + + /* uITRON */ +// sig_sem(sobj); + + /* uC/OS-II */ +// OSMutexPost(sobj); + + /* FreeRTOS */ +// xSemaphoreGive(sobj); + + /* CMSIS-RTOS */ +// osMutexRelease(sobj); +} + +#endif + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffunicode.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffunicode.c new file mode 100644 index 0000000..349901b --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/ffunicode.c @@ -0,0 +1,15597 @@ +/*------------------------------------------------------------------------*/ +/* Unicode handling functions for FatFs R0.13c */ +/*------------------------------------------------------------------------*/ +/* This module will occupy a huge memory in the .const section when the / +/ FatFs is configured for LFN with DBCS. If the system has any Unicode / +/ utilitiy for the code conversion, this module should be modified to use / +/ that function to avoid silly memory consumption. / +/-------------------------------------------------------------------------*/ +/* +/ Copyright (C) 2018, ChaN, all right reserved. +/ +/ FatFs module is an open source software. Redistribution and use of FatFs in +/ source and binary forms, with or without modification, are permitted provided +/ that the following condition is met: +/ +/ 1. Redistributions of source code must retain the above copyright notice, +/ this condition and the following disclaimer. +/ +/ This software is provided by the copyright holder and contributors "AS IS" +/ and any warranties related to this software are DISCLAIMED. +/ The copyright owner or contributors be NOT LIABLE for any damages caused +/ by use of this software. +*/ + + +#include "ff.h" + +#if FF_USE_LFN /* This module will be blanked at non-LFN configuration */ + +#if FF_DEFINED != 86604 /* Revision ID */ +#error Wrong include file (ff.h). +#endif + +#define MERGE2(a, b) a ## b +#define CVTBL(tbl, cp) MERGE2(tbl, cp) + + +/*------------------------------------------------------------------------*/ +/* Code Conversion Tables */ +/*------------------------------------------------------------------------*/ + +#if FF_CODE_PAGE == 932 || FF_CODE_PAGE == 0 /* Japanese */ +static const WCHAR uni2oem932[] = { /* Unicode --> Shift_JIS pairs */ + 0x00A7, 0x8198, 0x00A8, 0x814E, 0x00B0, 0x818B, 0x00B1, 0x817D, 0x00B4, 0x814C, 0x00B6, 0x81F7, 0x00D7, 0x817E, 0x00F7, 0x8180, + 0x0391, 0x839F, 0x0392, 0x83A0, 0x0393, 0x83A1, 0x0394, 0x83A2, 0x0395, 0x83A3, 0x0396, 0x83A4, 0x0397, 0x83A5, 0x0398, 0x83A6, + 0x0399, 0x83A7, 0x039A, 0x83A8, 0x039B, 0x83A9, 0x039C, 0x83AA, 0x039D, 0x83AB, 0x039E, 0x83AC, 0x039F, 0x83AD, 0x03A0, 0x83AE, + 0x03A1, 0x83AF, 0x03A3, 0x83B0, 0x03A4, 0x83B1, 0x03A5, 0x83B2, 0x03A6, 0x83B3, 0x03A7, 0x83B4, 0x03A8, 0x83B5, 0x03A9, 0x83B6, + 0x03B1, 0x83BF, 0x03B2, 0x83C0, 0x03B3, 0x83C1, 0x03B4, 0x83C2, 0x03B5, 0x83C3, 0x03B6, 0x83C4, 0x03B7, 0x83C5, 0x03B8, 0x83C6, + 0x03B9, 0x83C7, 0x03BA, 0x83C8, 0x03BB, 0x83C9, 0x03BC, 0x83CA, 0x03BD, 0x83CB, 0x03BE, 0x83CC, 0x03BF, 0x83CD, 0x03C0, 0x83CE, + 0x03C1, 0x83CF, 0x03C3, 0x83D0, 0x03C4, 0x83D1, 0x03C5, 0x83D2, 0x03C6, 0x83D3, 0x03C7, 0x83D4, 0x03C8, 0x83D5, 0x03C9, 0x83D6, + 0x0401, 0x8446, 0x0410, 0x8440, 0x0411, 0x8441, 0x0412, 0x8442, 0x0413, 0x8443, 0x0414, 0x8444, 0x0415, 0x8445, 0x0416, 0x8447, + 0x0417, 0x8448, 0x0418, 0x8449, 0x0419, 0x844A, 0x041A, 0x844B, 0x041B, 0x844C, 0x041C, 0x844D, 0x041D, 0x844E, 0x041E, 0x844F, + 0x041F, 0x8450, 0x0420, 0x8451, 0x0421, 0x8452, 0x0422, 0x8453, 0x0423, 0x8454, 0x0424, 0x8455, 0x0425, 0x8456, 0x0426, 0x8457, + 0x0427, 0x8458, 0x0428, 0x8459, 0x0429, 0x845A, 0x042A, 0x845B, 0x042B, 0x845C, 0x042C, 0x845D, 0x042D, 0x845E, 0x042E, 0x845F, + 0x042F, 0x8460, 0x0430, 0x8470, 0x0431, 0x8471, 0x0432, 0x8472, 0x0433, 0x8473, 0x0434, 0x8474, 0x0435, 0x8475, 0x0436, 0x8477, + 0x0437, 0x8478, 0x0438, 0x8479, 0x0439, 0x847A, 0x043A, 0x847B, 0x043B, 0x847C, 0x043C, 0x847D, 0x043D, 0x847E, 0x043E, 0x8480, + 0x043F, 0x8481, 0x0440, 0x8482, 0x0441, 0x8483, 0x0442, 0x8484, 0x0443, 0x8485, 0x0444, 0x8486, 0x0445, 0x8487, 0x0446, 0x8488, + 0x0447, 0x8489, 0x0448, 0x848A, 0x0449, 0x848B, 0x044A, 0x848C, 0x044B, 0x848D, 0x044C, 0x848E, 0x044D, 0x848F, 0x044E, 0x8490, + 0x044F, 0x8491, 0x0451, 0x8476, 0x2010, 0x815D, 0x2015, 0x815C, 0x2018, 0x8165, 0x2019, 0x8166, 0x201C, 0x8167, 0x201D, 0x8168, + 0x2020, 0x81F5, 0x2021, 0x81F6, 0x2025, 0x8164, 0x2026, 0x8163, 0x2030, 0x81F1, 0x2032, 0x818C, 0x2033, 0x818D, 0x203B, 0x81A6, + 0x2103, 0x818E, 0x2116, 0x8782, 0x2121, 0x8784, 0x212B, 0x81F0, 0x2160, 0x8754, 0x2161, 0x8755, 0x2162, 0x8756, 0x2163, 0x8757, + 0x2164, 0x8758, 0x2165, 0x8759, 0x2166, 0x875A, 0x2167, 0x875B, 0x2168, 0x875C, 0x2169, 0x875D, 0x2170, 0xFA40, 0x2171, 0xFA41, + 0x2172, 0xFA42, 0x2173, 0xFA43, 0x2174, 0xFA44, 0x2175, 0xFA45, 0x2176, 0xFA46, 0x2177, 0xFA47, 0x2178, 0xFA48, 0x2179, 0xFA49, + 0x2190, 0x81A9, 0x2191, 0x81AA, 0x2192, 0x81A8, 0x2193, 0x81AB, 0x21D2, 0x81CB, 0x21D4, 0x81CC, 0x2200, 0x81CD, 0x2202, 0x81DD, + 0x2203, 0x81CE, 0x2207, 0x81DE, 0x2208, 0x81B8, 0x220B, 0x81B9, 0x2211, 0x8794, 0x221A, 0x81E3, 0x221D, 0x81E5, 0x221E, 0x8187, + 0x221F, 0x8798, 0x2220, 0x81DA, 0x2225, 0x8161, 0x2227, 0x81C8, 0x2228, 0x81C9, 0x2229, 0x81BF, 0x222A, 0x81BE, 0x222B, 0x81E7, + 0x222C, 0x81E8, 0x222E, 0x8793, 0x2234, 0x8188, 0x2235, 0x81E6, 0x223D, 0x81E4, 0x2252, 0x81E0, 0x2260, 0x8182, 0x2261, 0x81DF, + 0x2266, 0x8185, 0x2267, 0x8186, 0x226A, 0x81E1, 0x226B, 0x81E2, 0x2282, 0x81BC, 0x2283, 0x81BD, 0x2286, 0x81BA, 0x2287, 0x81BB, + 0x22A5, 0x81DB, 0x22BF, 0x8799, 0x2312, 0x81DC, 0x2460, 0x8740, 0x2461, 0x8741, 0x2462, 0x8742, 0x2463, 0x8743, 0x2464, 0x8744, + 0x2465, 0x8745, 0x2466, 0x8746, 0x2467, 0x8747, 0x2468, 0x8748, 0x2469, 0x8749, 0x246A, 0x874A, 0x246B, 0x874B, 0x246C, 0x874C, + 0x246D, 0x874D, 0x246E, 0x874E, 0x246F, 0x874F, 0x2470, 0x8750, 0x2471, 0x8751, 0x2472, 0x8752, 0x2473, 0x8753, 0x2500, 0x849F, + 0x2501, 0x84AA, 0x2502, 0x84A0, 0x2503, 0x84AB, 0x250C, 0x84A1, 0x250F, 0x84AC, 0x2510, 0x84A2, 0x2513, 0x84AD, 0x2514, 0x84A4, + 0x2517, 0x84AF, 0x2518, 0x84A3, 0x251B, 0x84AE, 0x251C, 0x84A5, 0x251D, 0x84BA, 0x2520, 0x84B5, 0x2523, 0x84B0, 0x2524, 0x84A7, + 0x2525, 0x84BC, 0x2528, 0x84B7, 0x252B, 0x84B2, 0x252C, 0x84A6, 0x252F, 0x84B6, 0x2530, 0x84BB, 0x2533, 0x84B1, 0x2534, 0x84A8, + 0x2537, 0x84B8, 0x2538, 0x84BD, 0x253B, 0x84B3, 0x253C, 0x84A9, 0x253F, 0x84B9, 0x2542, 0x84BE, 0x254B, 0x84B4, 0x25A0, 0x81A1, + 0x25A1, 0x81A0, 0x25B2, 0x81A3, 0x25B3, 0x81A2, 0x25BC, 0x81A5, 0x25BD, 0x81A4, 0x25C6, 0x819F, 0x25C7, 0x819E, 0x25CB, 0x819B, + 0x25CE, 0x819D, 0x25CF, 0x819C, 0x25EF, 0x81FC, 0x2605, 0x819A, 0x2606, 0x8199, 0x2640, 0x818A, 0x2642, 0x8189, 0x266A, 0x81F4, + 0x266D, 0x81F3, 0x266F, 0x81F2, 0x3000, 0x8140, 0x3001, 0x8141, 0x3002, 0x8142, 0x3003, 0x8156, 0x3005, 0x8158, 0x3006, 0x8159, + 0x3007, 0x815A, 0x3008, 0x8171, 0x3009, 0x8172, 0x300A, 0x8173, 0x300B, 0x8174, 0x300C, 0x8175, 0x300D, 0x8176, 0x300E, 0x8177, + 0x300F, 0x8178, 0x3010, 0x8179, 0x3011, 0x817A, 0x3012, 0x81A7, 0x3013, 0x81AC, 0x3014, 0x816B, 0x3015, 0x816C, 0x301D, 0x8780, + 0x301F, 0x8781, 0x3041, 0x829F, 0x3042, 0x82A0, 0x3043, 0x82A1, 0x3044, 0x82A2, 0x3045, 0x82A3, 0x3046, 0x82A4, 0x3047, 0x82A5, + 0x3048, 0x82A6, 0x3049, 0x82A7, 0x304A, 0x82A8, 0x304B, 0x82A9, 0x304C, 0x82AA, 0x304D, 0x82AB, 0x304E, 0x82AC, 0x304F, 0x82AD, + 0x3050, 0x82AE, 0x3051, 0x82AF, 0x3052, 0x82B0, 0x3053, 0x82B1, 0x3054, 0x82B2, 0x3055, 0x82B3, 0x3056, 0x82B4, 0x3057, 0x82B5, + 0x3058, 0x82B6, 0x3059, 0x82B7, 0x305A, 0x82B8, 0x305B, 0x82B9, 0x305C, 0x82BA, 0x305D, 0x82BB, 0x305E, 0x82BC, 0x305F, 0x82BD, + 0x3060, 0x82BE, 0x3061, 0x82BF, 0x3062, 0x82C0, 0x3063, 0x82C1, 0x3064, 0x82C2, 0x3065, 0x82C3, 0x3066, 0x82C4, 0x3067, 0x82C5, + 0x3068, 0x82C6, 0x3069, 0x82C7, 0x306A, 0x82C8, 0x306B, 0x82C9, 0x306C, 0x82CA, 0x306D, 0x82CB, 0x306E, 0x82CC, 0x306F, 0x82CD, + 0x3070, 0x82CE, 0x3071, 0x82CF, 0x3072, 0x82D0, 0x3073, 0x82D1, 0x3074, 0x82D2, 0x3075, 0x82D3, 0x3076, 0x82D4, 0x3077, 0x82D5, + 0x3078, 0x82D6, 0x3079, 0x82D7, 0x307A, 0x82D8, 0x307B, 0x82D9, 0x307C, 0x82DA, 0x307D, 0x82DB, 0x307E, 0x82DC, 0x307F, 0x82DD, + 0x3080, 0x82DE, 0x3081, 0x82DF, 0x3082, 0x82E0, 0x3083, 0x82E1, 0x3084, 0x82E2, 0x3085, 0x82E3, 0x3086, 0x82E4, 0x3087, 0x82E5, + 0x3088, 0x82E6, 0x3089, 0x82E7, 0x308A, 0x82E8, 0x308B, 0x82E9, 0x308C, 0x82EA, 0x308D, 0x82EB, 0x308E, 0x82EC, 0x308F, 0x82ED, + 0x3090, 0x82EE, 0x3091, 0x82EF, 0x3092, 0x82F0, 0x3093, 0x82F1, 0x309B, 0x814A, 0x309C, 0x814B, 0x309D, 0x8154, 0x309E, 0x8155, + 0x30A1, 0x8340, 0x30A2, 0x8341, 0x30A3, 0x8342, 0x30A4, 0x8343, 0x30A5, 0x8344, 0x30A6, 0x8345, 0x30A7, 0x8346, 0x30A8, 0x8347, + 0x30A9, 0x8348, 0x30AA, 0x8349, 0x30AB, 0x834A, 0x30AC, 0x834B, 0x30AD, 0x834C, 0x30AE, 0x834D, 0x30AF, 0x834E, 0x30B0, 0x834F, + 0x30B1, 0x8350, 0x30B2, 0x8351, 0x30B3, 0x8352, 0x30B4, 0x8353, 0x30B5, 0x8354, 0x30B6, 0x8355, 0x30B7, 0x8356, 0x30B8, 0x8357, + 0x30B9, 0x8358, 0x30BA, 0x8359, 0x30BB, 0x835A, 0x30BC, 0x835B, 0x30BD, 0x835C, 0x30BE, 0x835D, 0x30BF, 0x835E, 0x30C0, 0x835F, + 0x30C1, 0x8360, 0x30C2, 0x8361, 0x30C3, 0x8362, 0x30C4, 0x8363, 0x30C5, 0x8364, 0x30C6, 0x8365, 0x30C7, 0x8366, 0x30C8, 0x8367, + 0x30C9, 0x8368, 0x30CA, 0x8369, 0x30CB, 0x836A, 0x30CC, 0x836B, 0x30CD, 0x836C, 0x30CE, 0x836D, 0x30CF, 0x836E, 0x30D0, 0x836F, + 0x30D1, 0x8370, 0x30D2, 0x8371, 0x30D3, 0x8372, 0x30D4, 0x8373, 0x30D5, 0x8374, 0x30D6, 0x8375, 0x30D7, 0x8376, 0x30D8, 0x8377, + 0x30D9, 0x8378, 0x30DA, 0x8379, 0x30DB, 0x837A, 0x30DC, 0x837B, 0x30DD, 0x837C, 0x30DE, 0x837D, 0x30DF, 0x837E, 0x30E0, 0x8380, + 0x30E1, 0x8381, 0x30E2, 0x8382, 0x30E3, 0x8383, 0x30E4, 0x8384, 0x30E5, 0x8385, 0x30E6, 0x8386, 0x30E7, 0x8387, 0x30E8, 0x8388, + 0x30E9, 0x8389, 0x30EA, 0x838A, 0x30EB, 0x838B, 0x30EC, 0x838C, 0x30ED, 0x838D, 0x30EE, 0x838E, 0x30EF, 0x838F, 0x30F0, 0x8390, + 0x30F1, 0x8391, 0x30F2, 0x8392, 0x30F3, 0x8393, 0x30F4, 0x8394, 0x30F5, 0x8395, 0x30F6, 0x8396, 0x30FB, 0x8145, 0x30FC, 0x815B, + 0x30FD, 0x8152, 0x30FE, 0x8153, 0x3231, 0x878A, 0x3232, 0x878B, 0x3239, 0x878C, 0x32A4, 0x8785, 0x32A5, 0x8786, 0x32A6, 0x8787, + 0x32A7, 0x8788, 0x32A8, 0x8789, 0x3303, 0x8765, 0x330D, 0x8769, 0x3314, 0x8760, 0x3318, 0x8763, 0x3322, 0x8761, 0x3323, 0x876B, + 0x3326, 0x876A, 0x3327, 0x8764, 0x332B, 0x876C, 0x3336, 0x8766, 0x333B, 0x876E, 0x3349, 0x875F, 0x334A, 0x876D, 0x334D, 0x8762, + 0x3351, 0x8767, 0x3357, 0x8768, 0x337B, 0x877E, 0x337C, 0x878F, 0x337D, 0x878E, 0x337E, 0x878D, 0x338E, 0x8772, 0x338F, 0x8773, + 0x339C, 0x876F, 0x339D, 0x8770, 0x339E, 0x8771, 0x33A1, 0x8775, 0x33C4, 0x8774, 0x33CD, 0x8783, 0x4E00, 0x88EA, 0x4E01, 0x929A, + 0x4E03, 0x8EB5, 0x4E07, 0x969C, 0x4E08, 0x8FE4, 0x4E09, 0x8E4F, 0x4E0A, 0x8FE3, 0x4E0B, 0x89BA, 0x4E0D, 0x9573, 0x4E0E, 0x975E, + 0x4E10, 0x98A0, 0x4E11, 0x894E, 0x4E14, 0x8A8E, 0x4E15, 0x98A1, 0x4E16, 0x90A2, 0x4E17, 0x99C0, 0x4E18, 0x8B75, 0x4E19, 0x95B8, + 0x4E1E, 0x8FE5, 0x4E21, 0x97BC, 0x4E26, 0x95C0, 0x4E28, 0xFA68, 0x4E2A, 0x98A2, 0x4E2D, 0x9286, 0x4E31, 0x98A3, 0x4E32, 0x8BF8, + 0x4E36, 0x98A4, 0x4E38, 0x8ADB, 0x4E39, 0x924F, 0x4E3B, 0x8EE5, 0x4E3C, 0x98A5, 0x4E3F, 0x98A6, 0x4E42, 0x98A7, 0x4E43, 0x9454, + 0x4E45, 0x8B76, 0x4E4B, 0x9456, 0x4E4D, 0x93E1, 0x4E4E, 0x8CC1, 0x4E4F, 0x9652, 0x4E55, 0xE568, 0x4E56, 0x98A8, 0x4E57, 0x8FE6, + 0x4E58, 0x98A9, 0x4E59, 0x89B3, 0x4E5D, 0x8BE3, 0x4E5E, 0x8CEE, 0x4E5F, 0x96E7, 0x4E62, 0x9BA4, 0x4E71, 0x9790, 0x4E73, 0x93FB, + 0x4E7E, 0x8AA3, 0x4E80, 0x8B54, 0x4E82, 0x98AA, 0x4E85, 0x98AB, 0x4E86, 0x97B9, 0x4E88, 0x975C, 0x4E89, 0x9188, 0x4E8A, 0x98AD, + 0x4E8B, 0x8E96, 0x4E8C, 0x93F1, 0x4E8E, 0x98B0, 0x4E91, 0x895D, 0x4E92, 0x8CDD, 0x4E94, 0x8CDC, 0x4E95, 0x88E4, 0x4E98, 0x986A, + 0x4E99, 0x9869, 0x4E9B, 0x8DB1, 0x4E9C, 0x889F, 0x4E9E, 0x98B1, 0x4E9F, 0x98B2, 0x4EA0, 0x98B3, 0x4EA1, 0x9653, 0x4EA2, 0x98B4, + 0x4EA4, 0x8CF0, 0x4EA5, 0x88E5, 0x4EA6, 0x9692, 0x4EA8, 0x8B9C, 0x4EAB, 0x8B9D, 0x4EAC, 0x8B9E, 0x4EAD, 0x92E0, 0x4EAE, 0x97BA, + 0x4EB0, 0x98B5, 0x4EB3, 0x98B6, 0x4EB6, 0x98B7, 0x4EBA, 0x906C, 0x4EC0, 0x8F59, 0x4EC1, 0x906D, 0x4EC2, 0x98BC, 0x4EC4, 0x98BA, + 0x4EC6, 0x98BB, 0x4EC7, 0x8B77, 0x4ECA, 0x8DA1, 0x4ECB, 0x89EE, 0x4ECD, 0x98B9, 0x4ECE, 0x98B8, 0x4ECF, 0x95A7, 0x4ED4, 0x8E65, + 0x4ED5, 0x8E64, 0x4ED6, 0x91BC, 0x4ED7, 0x98BD, 0x4ED8, 0x9574, 0x4ED9, 0x90E5, 0x4EDD, 0x8157, 0x4EDE, 0x98BE, 0x4EDF, 0x98C0, + 0x4EE1, 0xFA69, 0x4EE3, 0x91E3, 0x4EE4, 0x97DF, 0x4EE5, 0x88C8, 0x4EED, 0x98BF, 0x4EEE, 0x89BC, 0x4EF0, 0x8BC2, 0x4EF2, 0x9287, + 0x4EF6, 0x8C8F, 0x4EF7, 0x98C1, 0x4EFB, 0x9443, 0x4EFC, 0xFA6A, 0x4F00, 0xFA6B, 0x4F01, 0x8AE9, 0x4F03, 0xFA6C, 0x4F09, 0x98C2, + 0x4F0A, 0x88C9, 0x4F0D, 0x8CDE, 0x4F0E, 0x8AEA, 0x4F0F, 0x959A, 0x4F10, 0x94B0, 0x4F11, 0x8B78, 0x4F1A, 0x89EF, 0x4F1C, 0x98E5, + 0x4F1D, 0x9360, 0x4F2F, 0x948C, 0x4F30, 0x98C4, 0x4F34, 0x94BA, 0x4F36, 0x97E0, 0x4F38, 0x904C, 0x4F39, 0xFA6D, 0x4F3A, 0x8E66, + 0x4F3C, 0x8E97, 0x4F3D, 0x89BE, 0x4F43, 0x92CF, 0x4F46, 0x9241, 0x4F47, 0x98C8, 0x4F4D, 0x88CA, 0x4F4E, 0x92E1, 0x4F4F, 0x8F5A, + 0x4F50, 0x8DB2, 0x4F51, 0x9743, 0x4F53, 0x91CC, 0x4F55, 0x89BD, 0x4F56, 0xFA6E, 0x4F57, 0x98C7, 0x4F59, 0x975D, 0x4F5A, 0x98C3, + 0x4F5B, 0x98C5, 0x4F5C, 0x8DEC, 0x4F5D, 0x98C6, 0x4F5E, 0x9B43, 0x4F69, 0x98CE, 0x4F6F, 0x98D1, 0x4F70, 0x98CF, 0x4F73, 0x89C0, + 0x4F75, 0x95B9, 0x4F76, 0x98C9, 0x4F7B, 0x98CD, 0x4F7C, 0x8CF1, 0x4F7F, 0x8E67, 0x4F83, 0x8AA4, 0x4F86, 0x98D2, 0x4F88, 0x98CA, + 0x4F8A, 0xFA70, 0x4F8B, 0x97E1, 0x4F8D, 0x8E98, 0x4F8F, 0x98CB, 0x4F91, 0x98D0, 0x4F92, 0xFA6F, 0x4F94, 0xFA72, 0x4F96, 0x98D3, + 0x4F98, 0x98CC, 0x4F9A, 0xFA71, 0x4F9B, 0x8B9F, 0x4F9D, 0x88CB, 0x4FA0, 0x8BA0, 0x4FA1, 0x89BF, 0x4FAB, 0x9B44, 0x4FAD, 0x9699, + 0x4FAE, 0x958E, 0x4FAF, 0x8CF2, 0x4FB5, 0x904E, 0x4FB6, 0x97B5, 0x4FBF, 0x95D6, 0x4FC2, 0x8C57, 0x4FC3, 0x91A3, 0x4FC4, 0x89E2, + 0x4FC9, 0xFA61, 0x4FCA, 0x8F72, 0x4FCD, 0xFA73, 0x4FCE, 0x98D7, 0x4FD0, 0x98DC, 0x4FD1, 0x98DA, 0x4FD4, 0x98D5, 0x4FD7, 0x91AD, + 0x4FD8, 0x98D8, 0x4FDA, 0x98DB, 0x4FDB, 0x98D9, 0x4FDD, 0x95DB, 0x4FDF, 0x98D6, 0x4FE1, 0x904D, 0x4FE3, 0x9693, 0x4FE4, 0x98DD, + 0x4FE5, 0x98DE, 0x4FEE, 0x8F43, 0x4FEF, 0x98EB, 0x4FF3, 0x946F, 0x4FF5, 0x9555, 0x4FF6, 0x98E6, 0x4FF8, 0x95EE, 0x4FFA, 0x89B4, + 0x4FFE, 0x98EA, 0x4FFF, 0xFA76, 0x5005, 0x98E4, 0x5006, 0x98ED, 0x5009, 0x9171, 0x500B, 0x8CC2, 0x500D, 0x947B, 0x500F, 0xE0C5, + 0x5011, 0x98EC, 0x5012, 0x937C, 0x5014, 0x98E1, 0x5016, 0x8CF4, 0x5019, 0x8CF3, 0x501A, 0x98DF, 0x501E, 0xFA77, 0x501F, 0x8ED8, + 0x5021, 0x98E7, 0x5022, 0xFA75, 0x5023, 0x95ED, 0x5024, 0x926C, 0x5025, 0x98E3, 0x5026, 0x8C91, 0x5028, 0x98E0, 0x5029, 0x98E8, + 0x502A, 0x98E2, 0x502B, 0x97CF, 0x502C, 0x98E9, 0x502D, 0x9860, 0x5036, 0x8BE4, 0x5039, 0x8C90, 0x5040, 0xFA74, 0x5042, 0xFA7A, + 0x5043, 0x98EE, 0x5046, 0xFA78, 0x5047, 0x98EF, 0x5048, 0x98F3, 0x5049, 0x88CC, 0x504F, 0x95CE, 0x5050, 0x98F2, 0x5055, 0x98F1, + 0x5056, 0x98F5, 0x505A, 0x98F4, 0x505C, 0x92E2, 0x5065, 0x8C92, 0x506C, 0x98F6, 0x5070, 0xFA79, 0x5072, 0x8EC3, 0x5074, 0x91A4, + 0x5075, 0x92E3, 0x5076, 0x8BF4, 0x5078, 0x98F7, 0x507D, 0x8B55, 0x5080, 0x98F8, 0x5085, 0x98FA, 0x508D, 0x9654, 0x5091, 0x8C86, + 0x5094, 0xFA7B, 0x5098, 0x8E50, 0x5099, 0x94F5, 0x509A, 0x98F9, 0x50AC, 0x8DC3, 0x50AD, 0x9762, 0x50B2, 0x98FC, 0x50B3, 0x9942, + 0x50B4, 0x98FB, 0x50B5, 0x8DC2, 0x50B7, 0x8F9D, 0x50BE, 0x8C58, 0x50C2, 0x9943, 0x50C5, 0x8BCD, 0x50C9, 0x9940, 0x50CA, 0x9941, + 0x50CD, 0x93AD, 0x50CF, 0x919C, 0x50D1, 0x8BA1, 0x50D5, 0x966C, 0x50D6, 0x9944, 0x50D8, 0xFA7D, 0x50DA, 0x97BB, 0x50DE, 0x9945, + 0x50E3, 0x9948, 0x50E5, 0x9946, 0x50E7, 0x916D, 0x50ED, 0x9947, 0x50EE, 0x9949, 0x50F4, 0xFA7C, 0x50F5, 0x994B, 0x50F9, 0x994A, + 0x50FB, 0x95C6, 0x5100, 0x8B56, 0x5101, 0x994D, 0x5102, 0x994E, 0x5104, 0x89AD, 0x5109, 0x994C, 0x5112, 0x8EF2, 0x5114, 0x9951, + 0x5115, 0x9950, 0x5116, 0x994F, 0x5118, 0x98D4, 0x511A, 0x9952, 0x511F, 0x8F9E, 0x5121, 0x9953, 0x512A, 0x9744, 0x5132, 0x96D7, + 0x5137, 0x9955, 0x513A, 0x9954, 0x513B, 0x9957, 0x513C, 0x9956, 0x513F, 0x9958, 0x5140, 0x9959, 0x5141, 0x88F2, 0x5143, 0x8CB3, + 0x5144, 0x8C5A, 0x5145, 0x8F5B, 0x5146, 0x929B, 0x5147, 0x8BA2, 0x5148, 0x90E6, 0x5149, 0x8CF5, 0x514A, 0xFA7E, 0x514B, 0x8D8E, + 0x514C, 0x995B, 0x514D, 0x96C6, 0x514E, 0x9365, 0x5150, 0x8E99, 0x5152, 0x995A, 0x5154, 0x995C, 0x515A, 0x937D, 0x515C, 0x8A95, + 0x5162, 0x995D, 0x5164, 0xFA80, 0x5165, 0x93FC, 0x5168, 0x9153, 0x5169, 0x995F, 0x516A, 0x9960, 0x516B, 0x94AA, 0x516C, 0x8CF6, + 0x516D, 0x985A, 0x516E, 0x9961, 0x5171, 0x8BA4, 0x5175, 0x95BA, 0x5176, 0x91B4, 0x5177, 0x8BEF, 0x5178, 0x9354, 0x517C, 0x8C93, + 0x5180, 0x9962, 0x5182, 0x9963, 0x5185, 0x93E0, 0x5186, 0x897E, 0x5189, 0x9966, 0x518A, 0x8DFB, 0x518C, 0x9965, 0x518D, 0x8DC4, + 0x518F, 0x9967, 0x5190, 0xE3EC, 0x5191, 0x9968, 0x5192, 0x9660, 0x5193, 0x9969, 0x5195, 0x996A, 0x5196, 0x996B, 0x5197, 0x8FE7, + 0x5199, 0x8ECA, 0x519D, 0xFA81, 0x51A0, 0x8AA5, 0x51A2, 0x996E, 0x51A4, 0x996C, 0x51A5, 0x96BB, 0x51A6, 0x996D, 0x51A8, 0x9579, + 0x51A9, 0x996F, 0x51AA, 0x9970, 0x51AB, 0x9971, 0x51AC, 0x937E, 0x51B0, 0x9975, 0x51B1, 0x9973, 0x51B2, 0x9974, 0x51B3, 0x9972, + 0x51B4, 0x8DE1, 0x51B5, 0x9976, 0x51B6, 0x96E8, 0x51B7, 0x97E2, 0x51BD, 0x9977, 0x51BE, 0xFA82, 0x51C4, 0x90A6, 0x51C5, 0x9978, + 0x51C6, 0x8F79, 0x51C9, 0x9979, 0x51CB, 0x929C, 0x51CC, 0x97BD, 0x51CD, 0x9380, 0x51D6, 0x99C3, 0x51DB, 0x997A, 0x51DC, 0xEAA3, + 0x51DD, 0x8BC3, 0x51E0, 0x997B, 0x51E1, 0x967D, 0x51E6, 0x8F88, 0x51E7, 0x91FA, 0x51E9, 0x997D, 0x51EA, 0x93E2, 0x51EC, 0xFA83, + 0x51ED, 0x997E, 0x51F0, 0x9980, 0x51F1, 0x8A4D, 0x51F5, 0x9981, 0x51F6, 0x8BA5, 0x51F8, 0x93CA, 0x51F9, 0x899A, 0x51FA, 0x8F6F, + 0x51FD, 0x949F, 0x51FE, 0x9982, 0x5200, 0x9381, 0x5203, 0x906E, 0x5204, 0x9983, 0x5206, 0x95AA, 0x5207, 0x90D8, 0x5208, 0x8AA0, + 0x520A, 0x8AA7, 0x520B, 0x9984, 0x520E, 0x9986, 0x5211, 0x8C59, 0x5214, 0x9985, 0x5215, 0xFA84, 0x5217, 0x97F1, 0x521D, 0x8F89, + 0x5224, 0x94BB, 0x5225, 0x95CA, 0x5227, 0x9987, 0x5229, 0x9798, 0x522A, 0x9988, 0x522E, 0x9989, 0x5230, 0x939E, 0x5233, 0x998A, + 0x5236, 0x90A7, 0x5237, 0x8DFC, 0x5238, 0x8C94, 0x5239, 0x998B, 0x523A, 0x8E68, 0x523B, 0x8D8F, 0x5243, 0x92E4, 0x5244, 0x998D, + 0x5247, 0x91A5, 0x524A, 0x8DED, 0x524B, 0x998E, 0x524C, 0x998F, 0x524D, 0x914F, 0x524F, 0x998C, 0x5254, 0x9991, 0x5256, 0x9655, + 0x525B, 0x8D84, 0x525E, 0x9990, 0x5263, 0x8C95, 0x5264, 0x8DDC, 0x5265, 0x948D, 0x5269, 0x9994, 0x526A, 0x9992, 0x526F, 0x959B, + 0x5270, 0x8FE8, 0x5271, 0x999B, 0x5272, 0x8A84, 0x5273, 0x9995, 0x5274, 0x9993, 0x5275, 0x916E, 0x527D, 0x9997, 0x527F, 0x9996, + 0x5283, 0x8A63, 0x5287, 0x8C80, 0x5288, 0x999C, 0x5289, 0x97AB, 0x528D, 0x9998, 0x5291, 0x999D, 0x5292, 0x999A, 0x5294, 0x9999, + 0x529B, 0x97CD, 0x529C, 0xFA85, 0x529F, 0x8CF7, 0x52A0, 0x89C1, 0x52A3, 0x97F2, 0x52A6, 0xFA86, 0x52A9, 0x8F95, 0x52AA, 0x9377, + 0x52AB, 0x8D85, 0x52AC, 0x99A0, 0x52AD, 0x99A1, 0x52AF, 0xFB77, 0x52B1, 0x97E3, 0x52B4, 0x984A, 0x52B5, 0x99A3, 0x52B9, 0x8CF8, + 0x52BC, 0x99A2, 0x52BE, 0x8A4E, 0x52C0, 0xFA87, 0x52C1, 0x99A4, 0x52C3, 0x9675, 0x52C5, 0x92BA, 0x52C7, 0x9745, 0x52C9, 0x95D7, + 0x52CD, 0x99A5, 0x52D2, 0xE8D3, 0x52D5, 0x93AE, 0x52D7, 0x99A6, 0x52D8, 0x8AA8, 0x52D9, 0x96B1, 0x52DB, 0xFA88, 0x52DD, 0x8F9F, + 0x52DE, 0x99A7, 0x52DF, 0x95E5, 0x52E0, 0x99AB, 0x52E2, 0x90A8, 0x52E3, 0x99A8, 0x52E4, 0x8BCE, 0x52E6, 0x99A9, 0x52E7, 0x8AA9, + 0x52F2, 0x8C4D, 0x52F3, 0x99AC, 0x52F5, 0x99AD, 0x52F8, 0x99AE, 0x52F9, 0x99AF, 0x52FA, 0x8ED9, 0x52FE, 0x8CF9, 0x52FF, 0x96DC, + 0x5300, 0xFA89, 0x5301, 0x96E6, 0x5302, 0x93F5, 0x5305, 0x95EF, 0x5306, 0x99B0, 0x5307, 0xFA8A, 0x5308, 0x99B1, 0x530D, 0x99B3, + 0x530F, 0x99B5, 0x5310, 0x99B4, 0x5315, 0x99B6, 0x5316, 0x89BB, 0x5317, 0x966B, 0x5319, 0x8DFA, 0x531A, 0x99B7, 0x531D, 0x9178, + 0x5320, 0x8FA0, 0x5321, 0x8BA7, 0x5323, 0x99B8, 0x5324, 0xFA8B, 0x532A, 0x94D9, 0x532F, 0x99B9, 0x5331, 0x99BA, 0x5333, 0x99BB, + 0x5338, 0x99BC, 0x5339, 0x9543, 0x533A, 0x8BE6, 0x533B, 0x88E3, 0x533F, 0x93BD, 0x5340, 0x99BD, 0x5341, 0x8F5C, 0x5343, 0x90E7, + 0x5345, 0x99BF, 0x5346, 0x99BE, 0x5347, 0x8FA1, 0x5348, 0x8CDF, 0x5349, 0x99C1, 0x534A, 0x94BC, 0x534D, 0x99C2, 0x5351, 0x94DA, + 0x5352, 0x91B2, 0x5353, 0x91EC, 0x5354, 0x8BA6, 0x5357, 0x93EC, 0x5358, 0x9250, 0x535A, 0x948E, 0x535C, 0x966D, 0x535E, 0x99C4, + 0x5360, 0x90E8, 0x5366, 0x8C54, 0x5369, 0x99C5, 0x536E, 0x99C6, 0x536F, 0x894B, 0x5370, 0x88F3, 0x5371, 0x8AEB, 0x5372, 0xFA8C, + 0x5373, 0x91A6, 0x5374, 0x8B70, 0x5375, 0x9791, 0x5377, 0x99C9, 0x5378, 0x89B5, 0x537B, 0x99C8, 0x537F, 0x8BA8, 0x5382, 0x99CA, + 0x5384, 0x96EF, 0x5393, 0xFA8D, 0x5396, 0x99CB, 0x5398, 0x97D0, 0x539A, 0x8CFA, 0x539F, 0x8CB4, 0x53A0, 0x99CC, 0x53A5, 0x99CE, + 0x53A6, 0x99CD, 0x53A8, 0x907E, 0x53A9, 0x8958, 0x53AD, 0x897D, 0x53AE, 0x99CF, 0x53B0, 0x99D0, 0x53B2, 0xFA8E, 0x53B3, 0x8CB5, + 0x53B6, 0x99D1, 0x53BB, 0x8B8E, 0x53C2, 0x8E51, 0x53C3, 0x99D2, 0x53C8, 0x9694, 0x53C9, 0x8DB3, 0x53CA, 0x8B79, 0x53CB, 0x9746, + 0x53CC, 0x916F, 0x53CD, 0x94BD, 0x53CE, 0x8EFB, 0x53D4, 0x8F66, 0x53D6, 0x8EE6, 0x53D7, 0x8EF3, 0x53D9, 0x8F96, 0x53DB, 0x94BE, + 0x53DD, 0xFA8F, 0x53DF, 0x99D5, 0x53E1, 0x8962, 0x53E2, 0x9170, 0x53E3, 0x8CFB, 0x53E4, 0x8CC3, 0x53E5, 0x8BE5, 0x53E8, 0x99D9, + 0x53E9, 0x9240, 0x53EA, 0x91FC, 0x53EB, 0x8BA9, 0x53EC, 0x8FA2, 0x53ED, 0x99DA, 0x53EE, 0x99D8, 0x53EF, 0x89C2, 0x53F0, 0x91E4, + 0x53F1, 0x8EB6, 0x53F2, 0x8E6A, 0x53F3, 0x8945, 0x53F6, 0x8A90, 0x53F7, 0x8D86, 0x53F8, 0x8E69, 0x53FA, 0x99DB, 0x5401, 0x99DC, + 0x5403, 0x8B68, 0x5404, 0x8A65, 0x5408, 0x8D87, 0x5409, 0x8B67, 0x540A, 0x92DD, 0x540B, 0x8944, 0x540C, 0x93AF, 0x540D, 0x96BC, + 0x540E, 0x8D40, 0x540F, 0x9799, 0x5410, 0x9366, 0x5411, 0x8CFC, 0x541B, 0x8C4E, 0x541D, 0x99E5, 0x541F, 0x8BE1, 0x5420, 0x9669, + 0x5426, 0x94DB, 0x5429, 0x99E4, 0x542B, 0x8ADC, 0x542C, 0x99DF, 0x542D, 0x99E0, 0x542E, 0x99E2, 0x5436, 0x99E3, 0x5438, 0x8B7A, + 0x5439, 0x9081, 0x543B, 0x95AB, 0x543C, 0x99E1, 0x543D, 0x99DD, 0x543E, 0x8CE1, 0x5440, 0x99DE, 0x5442, 0x9843, 0x5446, 0x95F0, + 0x5448, 0x92E6, 0x5449, 0x8CE0, 0x544A, 0x8D90, 0x544E, 0x99E6, 0x5451, 0x93DB, 0x545F, 0x99EA, 0x5468, 0x8EFC, 0x546A, 0x8EF4, + 0x5470, 0x99ED, 0x5471, 0x99EB, 0x5473, 0x96A1, 0x5475, 0x99E8, 0x5476, 0x99F1, 0x5477, 0x99EC, 0x547B, 0x99EF, 0x547C, 0x8CC4, + 0x547D, 0x96BD, 0x5480, 0x99F0, 0x5484, 0x99F2, 0x5486, 0x99F4, 0x548A, 0xFA92, 0x548B, 0x8DEE, 0x548C, 0x9861, 0x548E, 0x99E9, + 0x548F, 0x99E7, 0x5490, 0x99F3, 0x5492, 0x99EE, 0x549C, 0xFA91, 0x54A2, 0x99F6, 0x54A4, 0x9A42, 0x54A5, 0x99F8, 0x54A8, 0x99FC, + 0x54A9, 0xFA93, 0x54AB, 0x9A40, 0x54AC, 0x99F9, 0x54AF, 0x9A5D, 0x54B2, 0x8DE7, 0x54B3, 0x8A50, 0x54B8, 0x99F7, 0x54BC, 0x9A44, + 0x54BD, 0x88F4, 0x54BE, 0x9A43, 0x54C0, 0x88A3, 0x54C1, 0x9569, 0x54C2, 0x9A41, 0x54C4, 0x99FA, 0x54C7, 0x99F5, 0x54C8, 0x99FB, + 0x54C9, 0x8DC6, 0x54D8, 0x9A45, 0x54E1, 0x88F5, 0x54E2, 0x9A4E, 0x54E5, 0x9A46, 0x54E6, 0x9A47, 0x54E8, 0x8FA3, 0x54E9, 0x9689, + 0x54ED, 0x9A4C, 0x54EE, 0x9A4B, 0x54F2, 0x934E, 0x54FA, 0x9A4D, 0x54FD, 0x9A4A, 0x54FF, 0xFA94, 0x5504, 0x8953, 0x5506, 0x8DB4, + 0x5507, 0x904F, 0x550F, 0x9A48, 0x5510, 0x9382, 0x5514, 0x9A49, 0x5516, 0x88A0, 0x552E, 0x9A53, 0x552F, 0x9742, 0x5531, 0x8FA5, + 0x5533, 0x9A59, 0x5538, 0x9A58, 0x5539, 0x9A4F, 0x553E, 0x91C1, 0x5540, 0x9A50, 0x5544, 0x91ED, 0x5545, 0x9A55, 0x5546, 0x8FA4, + 0x554C, 0x9A52, 0x554F, 0x96E2, 0x5553, 0x8C5B, 0x5556, 0x9A56, 0x5557, 0x9A57, 0x555C, 0x9A54, 0x555D, 0x9A5A, 0x5563, 0x9A51, + 0x557B, 0x9A60, 0x557C, 0x9A65, 0x557E, 0x9A61, 0x5580, 0x9A5C, 0x5583, 0x9A66, 0x5584, 0x9150, 0x5586, 0xFA95, 0x5587, 0x9A68, + 0x5589, 0x8D41, 0x558A, 0x9A5E, 0x558B, 0x929D, 0x5598, 0x9A62, 0x5599, 0x9A5B, 0x559A, 0x8AAB, 0x559C, 0x8AEC, 0x559D, 0x8A85, + 0x559E, 0x9A63, 0x559F, 0x9A5F, 0x55A7, 0x8C96, 0x55A8, 0x9A69, 0x55A9, 0x9A67, 0x55AA, 0x9172, 0x55AB, 0x8B69, 0x55AC, 0x8BAA, + 0x55AE, 0x9A64, 0x55B0, 0x8BF2, 0x55B6, 0x8963, 0x55C4, 0x9A6D, 0x55C5, 0x9A6B, 0x55C7, 0x9AA5, 0x55D4, 0x9A70, 0x55DA, 0x9A6A, + 0x55DC, 0x9A6E, 0x55DF, 0x9A6C, 0x55E3, 0x8E6B, 0x55E4, 0x9A6F, 0x55F7, 0x9A72, 0x55F9, 0x9A77, 0x55FD, 0x9A75, 0x55FE, 0x9A74, + 0x5606, 0x9251, 0x5609, 0x89C3, 0x5614, 0x9A71, 0x5616, 0x9A73, 0x5617, 0x8FA6, 0x5618, 0x8952, 0x561B, 0x9A76, 0x5629, 0x89DC, + 0x562F, 0x9A82, 0x5631, 0x8FFA, 0x5632, 0x9A7D, 0x5634, 0x9A7B, 0x5636, 0x9A7C, 0x5638, 0x9A7E, 0x5642, 0x895C, 0x564C, 0x9158, + 0x564E, 0x9A78, 0x5650, 0x9A79, 0x565B, 0x8A9A, 0x5664, 0x9A81, 0x5668, 0x8AED, 0x566A, 0x9A84, 0x566B, 0x9A80, 0x566C, 0x9A83, + 0x5674, 0x95AC, 0x5678, 0x93D3, 0x567A, 0x94B6, 0x5680, 0x9A86, 0x5686, 0x9A85, 0x5687, 0x8A64, 0x568A, 0x9A87, 0x568F, 0x9A8A, + 0x5694, 0x9A89, 0x56A0, 0x9A88, 0x56A2, 0x9458, 0x56A5, 0x9A8B, 0x56AE, 0x9A8C, 0x56B4, 0x9A8E, 0x56B6, 0x9A8D, 0x56BC, 0x9A90, + 0x56C0, 0x9A93, 0x56C1, 0x9A91, 0x56C2, 0x9A8F, 0x56C3, 0x9A92, 0x56C8, 0x9A94, 0x56CE, 0x9A95, 0x56D1, 0x9A96, 0x56D3, 0x9A97, + 0x56D7, 0x9A98, 0x56D8, 0x9964, 0x56DA, 0x8EFA, 0x56DB, 0x8E6C, 0x56DE, 0x89F1, 0x56E0, 0x88F6, 0x56E3, 0x9263, 0x56EE, 0x9A99, + 0x56F0, 0x8DA2, 0x56F2, 0x88CD, 0x56F3, 0x907D, 0x56F9, 0x9A9A, 0x56FA, 0x8CC5, 0x56FD, 0x8D91, 0x56FF, 0x9A9C, 0x5700, 0x9A9B, + 0x5703, 0x95DE, 0x5704, 0x9A9D, 0x5708, 0x9A9F, 0x5709, 0x9A9E, 0x570B, 0x9AA0, 0x570D, 0x9AA1, 0x570F, 0x8C97, 0x5712, 0x8980, + 0x5713, 0x9AA2, 0x5716, 0x9AA4, 0x5718, 0x9AA3, 0x571C, 0x9AA6, 0x571F, 0x9379, 0x5726, 0x9AA7, 0x5727, 0x88B3, 0x5728, 0x8DDD, + 0x572D, 0x8C5C, 0x5730, 0x926E, 0x5737, 0x9AA8, 0x5738, 0x9AA9, 0x573B, 0x9AAB, 0x5740, 0x9AAC, 0x5742, 0x8DE2, 0x5747, 0x8BCF, + 0x574A, 0x9656, 0x574E, 0x9AAA, 0x574F, 0x9AAD, 0x5750, 0x8DBF, 0x5751, 0x8D42, 0x5759, 0xFA96, 0x5761, 0x9AB1, 0x5764, 0x8DA3, + 0x5765, 0xFA97, 0x5766, 0x9252, 0x5769, 0x9AAE, 0x576A, 0x92D8, 0x577F, 0x9AB2, 0x5782, 0x9082, 0x5788, 0x9AB0, 0x5789, 0x9AB3, + 0x578B, 0x8C5E, 0x5793, 0x9AB4, 0x57A0, 0x9AB5, 0x57A2, 0x8D43, 0x57A3, 0x8A5F, 0x57A4, 0x9AB7, 0x57AA, 0x9AB8, 0x57AC, 0xFA98, + 0x57B0, 0x9AB9, 0x57B3, 0x9AB6, 0x57C0, 0x9AAF, 0x57C3, 0x9ABA, 0x57C6, 0x9ABB, 0x57C7, 0xFA9A, 0x57C8, 0xFA99, 0x57CB, 0x9684, + 0x57CE, 0x8FE9, 0x57D2, 0x9ABD, 0x57D3, 0x9ABE, 0x57D4, 0x9ABC, 0x57D6, 0x9AC0, 0x57DC, 0x9457, 0x57DF, 0x88E6, 0x57E0, 0x9575, + 0x57E3, 0x9AC1, 0x57F4, 0x8FFB, 0x57F7, 0x8EB7, 0x57F9, 0x947C, 0x57FA, 0x8AEE, 0x57FC, 0x8DE9, 0x5800, 0x9678, 0x5802, 0x93B0, + 0x5805, 0x8C98, 0x5806, 0x91CD, 0x580A, 0x9ABF, 0x580B, 0x9AC2, 0x5815, 0x91C2, 0x5819, 0x9AC3, 0x581D, 0x9AC4, 0x5821, 0x9AC6, + 0x5824, 0x92E7, 0x582A, 0x8AAC, 0x582F, 0xEA9F, 0x5830, 0x8981, 0x5831, 0x95F1, 0x5834, 0x8FEA, 0x5835, 0x9367, 0x583A, 0x8DE4, + 0x583D, 0x9ACC, 0x5840, 0x95BB, 0x5841, 0x97DB, 0x584A, 0x89F2, 0x584B, 0x9AC8, 0x5851, 0x9159, 0x5852, 0x9ACB, 0x5854, 0x9383, + 0x5857, 0x9368, 0x5858, 0x9384, 0x5859, 0x94B7, 0x585A, 0x92CB, 0x585E, 0x8DC7, 0x5862, 0x9AC7, 0x5869, 0x8996, 0x586B, 0x9355, + 0x5870, 0x9AC9, 0x5872, 0x9AC5, 0x5875, 0x906F, 0x5879, 0x9ACD, 0x587E, 0x8F6D, 0x5883, 0x8BAB, 0x5885, 0x9ACE, 0x5893, 0x95E6, + 0x5897, 0x919D, 0x589C, 0x92C4, 0x589E, 0xFA9D, 0x589F, 0x9AD0, 0x58A8, 0x966E, 0x58AB, 0x9AD1, 0x58AE, 0x9AD6, 0x58B2, 0xFA9E, + 0x58B3, 0x95AD, 0x58B8, 0x9AD5, 0x58B9, 0x9ACF, 0x58BA, 0x9AD2, 0x58BB, 0x9AD4, 0x58BE, 0x8DA4, 0x58C1, 0x95C7, 0x58C5, 0x9AD7, + 0x58C7, 0x9264, 0x58CA, 0x89F3, 0x58CC, 0x8FEB, 0x58D1, 0x9AD9, 0x58D3, 0x9AD8, 0x58D5, 0x8D88, 0x58D7, 0x9ADA, 0x58D8, 0x9ADC, + 0x58D9, 0x9ADB, 0x58DC, 0x9ADE, 0x58DE, 0x9AD3, 0x58DF, 0x9AE0, 0x58E4, 0x9ADF, 0x58E5, 0x9ADD, 0x58EB, 0x8E6D, 0x58EC, 0x9070, + 0x58EE, 0x9173, 0x58EF, 0x9AE1, 0x58F0, 0x90BA, 0x58F1, 0x88EB, 0x58F2, 0x9484, 0x58F7, 0x92D9, 0x58F9, 0x9AE3, 0x58FA, 0x9AE2, + 0x58FB, 0x9AE4, 0x58FC, 0x9AE5, 0x58FD, 0x9AE6, 0x5902, 0x9AE7, 0x5909, 0x95CF, 0x590A, 0x9AE8, 0x590B, 0xFA9F, 0x590F, 0x89C4, + 0x5910, 0x9AE9, 0x5915, 0x975B, 0x5916, 0x8A4F, 0x5918, 0x99C7, 0x5919, 0x8F67, 0x591A, 0x91BD, 0x591B, 0x9AEA, 0x591C, 0x96E9, + 0x5922, 0x96B2, 0x5925, 0x9AEC, 0x5927, 0x91E5, 0x5929, 0x9356, 0x592A, 0x91BE, 0x592B, 0x9576, 0x592C, 0x9AED, 0x592D, 0x9AEE, + 0x592E, 0x899B, 0x5931, 0x8EB8, 0x5932, 0x9AEF, 0x5937, 0x88CE, 0x5938, 0x9AF0, 0x593E, 0x9AF1, 0x5944, 0x8982, 0x5947, 0x8AEF, + 0x5948, 0x93DE, 0x5949, 0x95F2, 0x594E, 0x9AF5, 0x594F, 0x9174, 0x5950, 0x9AF4, 0x5951, 0x8C5F, 0x5953, 0xFAA0, 0x5954, 0x967A, + 0x5955, 0x9AF3, 0x5957, 0x9385, 0x5958, 0x9AF7, 0x595A, 0x9AF6, 0x595B, 0xFAA1, 0x595D, 0xFAA2, 0x5960, 0x9AF9, 0x5962, 0x9AF8, + 0x5963, 0xFAA3, 0x5965, 0x899C, 0x5967, 0x9AFA, 0x5968, 0x8FA7, 0x5969, 0x9AFC, 0x596A, 0x9244, 0x596C, 0x9AFB, 0x596E, 0x95B1, + 0x5973, 0x8F97, 0x5974, 0x937A, 0x5978, 0x9B40, 0x597D, 0x8D44, 0x5981, 0x9B41, 0x5982, 0x9440, 0x5983, 0x94DC, 0x5984, 0x96CF, + 0x598A, 0x9444, 0x598D, 0x9B4A, 0x5993, 0x8B57, 0x5996, 0x9764, 0x5999, 0x96AD, 0x599B, 0x9BAA, 0x599D, 0x9B42, 0x59A3, 0x9B45, + 0x59A4, 0xFAA4, 0x59A5, 0x91C3, 0x59A8, 0x9657, 0x59AC, 0x9369, 0x59B2, 0x9B46, 0x59B9, 0x9685, 0x59BA, 0xFAA5, 0x59BB, 0x8DC8, + 0x59BE, 0x8FA8, 0x59C6, 0x9B47, 0x59C9, 0x8E6F, 0x59CB, 0x8E6E, 0x59D0, 0x88B7, 0x59D1, 0x8CC6, 0x59D3, 0x90A9, 0x59D4, 0x88CF, + 0x59D9, 0x9B4B, 0x59DA, 0x9B4C, 0x59DC, 0x9B49, 0x59E5, 0x8957, 0x59E6, 0x8AAD, 0x59E8, 0x9B48, 0x59EA, 0x96C3, 0x59EB, 0x9550, + 0x59F6, 0x88A6, 0x59FB, 0x88F7, 0x59FF, 0x8E70, 0x5A01, 0x88D0, 0x5A03, 0x88A1, 0x5A09, 0x9B51, 0x5A11, 0x9B4F, 0x5A18, 0x96BA, + 0x5A1A, 0x9B52, 0x5A1C, 0x9B50, 0x5A1F, 0x9B4E, 0x5A20, 0x9050, 0x5A25, 0x9B4D, 0x5A29, 0x95D8, 0x5A2F, 0x8CE2, 0x5A35, 0x9B56, + 0x5A36, 0x9B57, 0x5A3C, 0x8FA9, 0x5A40, 0x9B53, 0x5A41, 0x984B, 0x5A46, 0x946B, 0x5A49, 0x9B55, 0x5A5A, 0x8DA5, 0x5A62, 0x9B58, + 0x5A66, 0x9577, 0x5A6A, 0x9B59, 0x5A6C, 0x9B54, 0x5A7F, 0x96B9, 0x5A92, 0x947D, 0x5A9A, 0x9B5A, 0x5A9B, 0x9551, 0x5ABC, 0x9B5B, + 0x5ABD, 0x9B5F, 0x5ABE, 0x9B5C, 0x5AC1, 0x89C5, 0x5AC2, 0x9B5E, 0x5AC9, 0x8EB9, 0x5ACB, 0x9B5D, 0x5ACC, 0x8C99, 0x5AD0, 0x9B6B, + 0x5AD6, 0x9B64, 0x5AD7, 0x9B61, 0x5AE1, 0x9284, 0x5AE3, 0x9B60, 0x5AE6, 0x9B62, 0x5AE9, 0x9B63, 0x5AFA, 0x9B65, 0x5AFB, 0x9B66, + 0x5B09, 0x8AF0, 0x5B0B, 0x9B68, 0x5B0C, 0x9B67, 0x5B16, 0x9B69, 0x5B22, 0x8FEC, 0x5B2A, 0x9B6C, 0x5B2C, 0x92DA, 0x5B30, 0x8964, + 0x5B32, 0x9B6A, 0x5B36, 0x9B6D, 0x5B3E, 0x9B6E, 0x5B40, 0x9B71, 0x5B43, 0x9B6F, 0x5B45, 0x9B70, 0x5B50, 0x8E71, 0x5B51, 0x9B72, + 0x5B54, 0x8D45, 0x5B55, 0x9B73, 0x5B56, 0xFAA6, 0x5B57, 0x8E9A, 0x5B58, 0x91B6, 0x5B5A, 0x9B74, 0x5B5B, 0x9B75, 0x5B5C, 0x8E79, + 0x5B5D, 0x8D46, 0x5B5F, 0x96D0, 0x5B63, 0x8B47, 0x5B64, 0x8CC7, 0x5B65, 0x9B76, 0x5B66, 0x8A77, 0x5B69, 0x9B77, 0x5B6B, 0x91B7, + 0x5B70, 0x9B78, 0x5B71, 0x9BA1, 0x5B73, 0x9B79, 0x5B75, 0x9B7A, 0x5B78, 0x9B7B, 0x5B7A, 0x9B7D, 0x5B80, 0x9B7E, 0x5B83, 0x9B80, + 0x5B85, 0x91EE, 0x5B87, 0x8946, 0x5B88, 0x8EE7, 0x5B89, 0x88C0, 0x5B8B, 0x9176, 0x5B8C, 0x8AAE, 0x5B8D, 0x8EB3, 0x5B8F, 0x8D47, + 0x5B95, 0x9386, 0x5B97, 0x8F40, 0x5B98, 0x8AAF, 0x5B99, 0x9288, 0x5B9A, 0x92E8, 0x5B9B, 0x88B6, 0x5B9C, 0x8B58, 0x5B9D, 0x95F3, + 0x5B9F, 0x8EC0, 0x5BA2, 0x8B71, 0x5BA3, 0x90E9, 0x5BA4, 0x8EBA, 0x5BA5, 0x9747, 0x5BA6, 0x9B81, 0x5BAE, 0x8B7B, 0x5BB0, 0x8DC9, + 0x5BB3, 0x8A51, 0x5BB4, 0x8983, 0x5BB5, 0x8FAA, 0x5BB6, 0x89C6, 0x5BB8, 0x9B82, 0x5BB9, 0x9765, 0x5BBF, 0x8F68, 0x5BC0, 0xFAA7, + 0x5BC2, 0x8EE2, 0x5BC3, 0x9B83, 0x5BC4, 0x8AF1, 0x5BC5, 0x93D0, 0x5BC6, 0x96A7, 0x5BC7, 0x9B84, 0x5BC9, 0x9B85, 0x5BCC, 0x9578, + 0x5BD0, 0x9B87, 0x5BD2, 0x8AA6, 0x5BD3, 0x8BF5, 0x5BD4, 0x9B86, 0x5BD8, 0xFAA9, 0x5BDB, 0x8AB0, 0x5BDD, 0x9051, 0x5BDE, 0x9B8B, + 0x5BDF, 0x8E40, 0x5BE1, 0x89C7, 0x5BE2, 0x9B8A, 0x5BE4, 0x9B88, 0x5BE5, 0x9B8C, 0x5BE6, 0x9B89, 0x5BE7, 0x944A, 0x5BE8, 0x9ECB, + 0x5BE9, 0x9052, 0x5BEB, 0x9B8D, 0x5BEC, 0xFAAA, 0x5BEE, 0x97BE, 0x5BF0, 0x9B8E, 0x5BF3, 0x9B90, 0x5BF5, 0x929E, 0x5BF6, 0x9B8F, + 0x5BF8, 0x90A1, 0x5BFA, 0x8E9B, 0x5BFE, 0x91CE, 0x5BFF, 0x8EF5, 0x5C01, 0x9595, 0x5C02, 0x90EA, 0x5C04, 0x8ECB, 0x5C05, 0x9B91, + 0x5C06, 0x8FAB, 0x5C07, 0x9B92, 0x5C08, 0x9B93, 0x5C09, 0x88D1, 0x5C0A, 0x91B8, 0x5C0B, 0x9071, 0x5C0D, 0x9B94, 0x5C0E, 0x93B1, + 0x5C0F, 0x8FAC, 0x5C11, 0x8FAD, 0x5C13, 0x9B95, 0x5C16, 0x90EB, 0x5C1A, 0x8FAE, 0x5C1E, 0xFAAB, 0x5C20, 0x9B96, 0x5C22, 0x9B97, + 0x5C24, 0x96DE, 0x5C28, 0x9B98, 0x5C2D, 0x8BC4, 0x5C31, 0x8F41, 0x5C38, 0x9B99, 0x5C39, 0x9B9A, 0x5C3A, 0x8EDA, 0x5C3B, 0x904B, + 0x5C3C, 0x93F2, 0x5C3D, 0x9073, 0x5C3E, 0x94F6, 0x5C3F, 0x9441, 0x5C40, 0x8BC7, 0x5C41, 0x9B9B, 0x5C45, 0x8B8F, 0x5C46, 0x9B9C, + 0x5C48, 0x8BFC, 0x5C4A, 0x93CD, 0x5C4B, 0x89AE, 0x5C4D, 0x8E72, 0x5C4E, 0x9B9D, 0x5C4F, 0x9BA0, 0x5C50, 0x9B9F, 0x5C51, 0x8BFB, + 0x5C53, 0x9B9E, 0x5C55, 0x9357, 0x5C5E, 0x91AE, 0x5C60, 0x936A, 0x5C61, 0x8EC6, 0x5C64, 0x9177, 0x5C65, 0x979A, 0x5C6C, 0x9BA2, + 0x5C6E, 0x9BA3, 0x5C6F, 0x93D4, 0x5C71, 0x8E52, 0x5C76, 0x9BA5, 0x5C79, 0x9BA6, 0x5C8C, 0x9BA7, 0x5C90, 0x8AF2, 0x5C91, 0x9BA8, + 0x5C94, 0x9BA9, 0x5CA1, 0x89AA, 0x5CA6, 0xFAAC, 0x5CA8, 0x915A, 0x5CA9, 0x8AE2, 0x5CAB, 0x9BAB, 0x5CAC, 0x96A6, 0x5CB1, 0x91D0, + 0x5CB3, 0x8A78, 0x5CB6, 0x9BAD, 0x5CB7, 0x9BAF, 0x5CB8, 0x8ADD, 0x5CBA, 0xFAAD, 0x5CBB, 0x9BAC, 0x5CBC, 0x9BAE, 0x5CBE, 0x9BB1, + 0x5CC5, 0x9BB0, 0x5CC7, 0x9BB2, 0x5CD9, 0x9BB3, 0x5CE0, 0x93BB, 0x5CE1, 0x8BAC, 0x5CE8, 0x89E3, 0x5CE9, 0x9BB4, 0x5CEA, 0x9BB9, + 0x5CED, 0x9BB7, 0x5CEF, 0x95F5, 0x5CF0, 0x95F4, 0x5CF5, 0xFAAE, 0x5CF6, 0x9387, 0x5CFA, 0x9BB6, 0x5CFB, 0x8F73, 0x5CFD, 0x9BB5, + 0x5D07, 0x9092, 0x5D0B, 0x9BBA, 0x5D0E, 0x8DE8, 0x5D11, 0x9BC0, 0x5D14, 0x9BC1, 0x5D15, 0x9BBB, 0x5D16, 0x8A52, 0x5D17, 0x9BBC, + 0x5D18, 0x9BC5, 0x5D19, 0x9BC4, 0x5D1A, 0x9BC3, 0x5D1B, 0x9BBF, 0x5D1F, 0x9BBE, 0x5D22, 0x9BC2, 0x5D27, 0xFAAF, 0x5D29, 0x95F6, + 0x5D42, 0xFAB2, 0x5D4B, 0x9BC9, 0x5D4C, 0x9BC6, 0x5D4E, 0x9BC8, 0x5D50, 0x9792, 0x5D52, 0x9BC7, 0x5D53, 0xFAB0, 0x5D5C, 0x9BBD, + 0x5D69, 0x9093, 0x5D6C, 0x9BCA, 0x5D6D, 0xFAB3, 0x5D6F, 0x8DB5, 0x5D73, 0x9BCB, 0x5D76, 0x9BCC, 0x5D82, 0x9BCF, 0x5D84, 0x9BCE, + 0x5D87, 0x9BCD, 0x5D8B, 0x9388, 0x5D8C, 0x9BB8, 0x5D90, 0x9BD5, 0x5D9D, 0x9BD1, 0x5DA2, 0x9BD0, 0x5DAC, 0x9BD2, 0x5DAE, 0x9BD3, + 0x5DB7, 0x9BD6, 0x5DB8, 0xFAB4, 0x5DB9, 0xFAB5, 0x5DBA, 0x97E4, 0x5DBC, 0x9BD7, 0x5DBD, 0x9BD4, 0x5DC9, 0x9BD8, 0x5DCC, 0x8ADE, + 0x5DCD, 0x9BD9, 0x5DD0, 0xFAB6, 0x5DD2, 0x9BDB, 0x5DD3, 0x9BDA, 0x5DD6, 0x9BDC, 0x5DDB, 0x9BDD, 0x5DDD, 0x90EC, 0x5DDE, 0x8F42, + 0x5DE1, 0x8F84, 0x5DE3, 0x9183, 0x5DE5, 0x8D48, 0x5DE6, 0x8DB6, 0x5DE7, 0x8D49, 0x5DE8, 0x8B90, 0x5DEB, 0x9BDE, 0x5DEE, 0x8DB7, + 0x5DF1, 0x8CC8, 0x5DF2, 0x9BDF, 0x5DF3, 0x96A4, 0x5DF4, 0x9462, 0x5DF5, 0x9BE0, 0x5DF7, 0x8D4A, 0x5DFB, 0x8AAA, 0x5DFD, 0x9246, + 0x5DFE, 0x8BD0, 0x5E02, 0x8E73, 0x5E03, 0x957A, 0x5E06, 0x94BF, 0x5E0B, 0x9BE1, 0x5E0C, 0x8AF3, 0x5E11, 0x9BE4, 0x5E16, 0x929F, + 0x5E19, 0x9BE3, 0x5E1A, 0x9BE2, 0x5E1B, 0x9BE5, 0x5E1D, 0x92E9, 0x5E25, 0x9083, 0x5E2B, 0x8E74, 0x5E2D, 0x90C8, 0x5E2F, 0x91D1, + 0x5E30, 0x8B41, 0x5E33, 0x92A0, 0x5E36, 0x9BE6, 0x5E37, 0x9BE7, 0x5E38, 0x8FED, 0x5E3D, 0x9658, 0x5E40, 0x9BEA, 0x5E43, 0x9BE9, + 0x5E44, 0x9BE8, 0x5E45, 0x959D, 0x5E47, 0x9BF1, 0x5E4C, 0x9679, 0x5E4E, 0x9BEB, 0x5E54, 0x9BED, 0x5E55, 0x968B, 0x5E57, 0x9BEC, + 0x5E5F, 0x9BEE, 0x5E61, 0x94A6, 0x5E62, 0x9BEF, 0x5E63, 0x95BC, 0x5E64, 0x9BF0, 0x5E72, 0x8AB1, 0x5E73, 0x95BD, 0x5E74, 0x944E, + 0x5E75, 0x9BF2, 0x5E76, 0x9BF3, 0x5E78, 0x8D4B, 0x5E79, 0x8AB2, 0x5E7A, 0x9BF4, 0x5E7B, 0x8CB6, 0x5E7C, 0x9763, 0x5E7D, 0x9748, + 0x5E7E, 0x8AF4, 0x5E7F, 0x9BF6, 0x5E81, 0x92A1, 0x5E83, 0x8D4C, 0x5E84, 0x8FAF, 0x5E87, 0x94DD, 0x5E8A, 0x8FB0, 0x5E8F, 0x8F98, + 0x5E95, 0x92EA, 0x5E96, 0x95F7, 0x5E97, 0x9358, 0x5E9A, 0x8D4D, 0x5E9C, 0x957B, 0x5EA0, 0x9BF7, 0x5EA6, 0x9378, 0x5EA7, 0x8DC0, + 0x5EAB, 0x8CC9, 0x5EAD, 0x92EB, 0x5EB5, 0x88C1, 0x5EB6, 0x8F8E, 0x5EB7, 0x8D4E, 0x5EB8, 0x9766, 0x5EC1, 0x9BF8, 0x5EC2, 0x9BF9, + 0x5EC3, 0x9470, 0x5EC8, 0x9BFA, 0x5EC9, 0x97F5, 0x5ECA, 0x984C, 0x5ECF, 0x9BFC, 0x5ED0, 0x9BFB, 0x5ED3, 0x8A66, 0x5ED6, 0x9C40, + 0x5EDA, 0x9C43, 0x5EDB, 0x9C44, 0x5EDD, 0x9C42, 0x5EDF, 0x955F, 0x5EE0, 0x8FB1, 0x5EE1, 0x9C46, 0x5EE2, 0x9C45, 0x5EE3, 0x9C41, + 0x5EE8, 0x9C47, 0x5EE9, 0x9C48, 0x5EEC, 0x9C49, 0x5EF0, 0x9C4C, 0x5EF1, 0x9C4A, 0x5EF3, 0x9C4B, 0x5EF4, 0x9C4D, 0x5EF6, 0x8984, + 0x5EF7, 0x92EC, 0x5EF8, 0x9C4E, 0x5EFA, 0x8C9A, 0x5EFB, 0x89F4, 0x5EFC, 0x9455, 0x5EFE, 0x9C4F, 0x5EFF, 0x93F9, 0x5F01, 0x95D9, + 0x5F03, 0x9C50, 0x5F04, 0x984D, 0x5F09, 0x9C51, 0x5F0A, 0x95BE, 0x5F0B, 0x9C54, 0x5F0C, 0x989F, 0x5F0D, 0x98AF, 0x5F0F, 0x8EAE, + 0x5F10, 0x93F3, 0x5F11, 0x9C55, 0x5F13, 0x8B7C, 0x5F14, 0x92A2, 0x5F15, 0x88F8, 0x5F16, 0x9C56, 0x5F17, 0x95A4, 0x5F18, 0x8D4F, + 0x5F1B, 0x926F, 0x5F1F, 0x92ED, 0x5F21, 0xFAB7, 0x5F25, 0x96ED, 0x5F26, 0x8CB7, 0x5F27, 0x8CCA, 0x5F29, 0x9C57, 0x5F2D, 0x9C58, + 0x5F2F, 0x9C5E, 0x5F31, 0x8EE3, 0x5F34, 0xFAB8, 0x5F35, 0x92A3, 0x5F37, 0x8BAD, 0x5F38, 0x9C59, 0x5F3C, 0x954A, 0x5F3E, 0x9265, + 0x5F41, 0x9C5A, 0x5F45, 0xFA67, 0x5F48, 0x9C5B, 0x5F4A, 0x8BAE, 0x5F4C, 0x9C5C, 0x5F4E, 0x9C5D, 0x5F51, 0x9C5F, 0x5F53, 0x9396, + 0x5F56, 0x9C60, 0x5F57, 0x9C61, 0x5F59, 0x9C62, 0x5F5C, 0x9C53, 0x5F5D, 0x9C52, 0x5F61, 0x9C63, 0x5F62, 0x8C60, 0x5F66, 0x9546, + 0x5F67, 0xFAB9, 0x5F69, 0x8DCA, 0x5F6A, 0x9556, 0x5F6B, 0x92A4, 0x5F6C, 0x956A, 0x5F6D, 0x9C64, 0x5F70, 0x8FB2, 0x5F71, 0x8965, + 0x5F73, 0x9C65, 0x5F77, 0x9C66, 0x5F79, 0x96F0, 0x5F7C, 0x94DE, 0x5F7F, 0x9C69, 0x5F80, 0x899D, 0x5F81, 0x90AA, 0x5F82, 0x9C68, + 0x5F83, 0x9C67, 0x5F84, 0x8C61, 0x5F85, 0x91D2, 0x5F87, 0x9C6D, 0x5F88, 0x9C6B, 0x5F8A, 0x9C6A, 0x5F8B, 0x97A5, 0x5F8C, 0x8CE3, + 0x5F90, 0x8F99, 0x5F91, 0x9C6C, 0x5F92, 0x936B, 0x5F93, 0x8F5D, 0x5F97, 0x93BE, 0x5F98, 0x9C70, 0x5F99, 0x9C6F, 0x5F9E, 0x9C6E, + 0x5FA0, 0x9C71, 0x5FA1, 0x8CE4, 0x5FA8, 0x9C72, 0x5FA9, 0x959C, 0x5FAA, 0x8F7A, 0x5FAD, 0x9C73, 0x5FAE, 0x94F7, 0x5FB3, 0x93BF, + 0x5FB4, 0x92A5, 0x5FB7, 0xFABA, 0x5FB9, 0x934F, 0x5FBC, 0x9C74, 0x5FBD, 0x8B4A, 0x5FC3, 0x9053, 0x5FC5, 0x954B, 0x5FCC, 0x8AF5, + 0x5FCD, 0x9445, 0x5FD6, 0x9C75, 0x5FD7, 0x8E75, 0x5FD8, 0x9659, 0x5FD9, 0x965A, 0x5FDC, 0x899E, 0x5FDD, 0x9C7A, 0x5FDE, 0xFABB, + 0x5FE0, 0x9289, 0x5FE4, 0x9C77, 0x5FEB, 0x89F5, 0x5FF0, 0x9CAB, 0x5FF1, 0x9C79, 0x5FF5, 0x944F, 0x5FF8, 0x9C78, 0x5FFB, 0x9C76, + 0x5FFD, 0x8D9A, 0x5FFF, 0x9C7C, 0x600E, 0x9C83, 0x600F, 0x9C89, 0x6010, 0x9C81, 0x6012, 0x937B, 0x6015, 0x9C86, 0x6016, 0x957C, + 0x6019, 0x9C80, 0x601B, 0x9C85, 0x601C, 0x97E5, 0x601D, 0x8E76, 0x6020, 0x91D3, 0x6021, 0x9C7D, 0x6025, 0x8B7D, 0x6026, 0x9C88, + 0x6027, 0x90AB, 0x6028, 0x8985, 0x6029, 0x9C82, 0x602A, 0x89F6, 0x602B, 0x9C87, 0x602F, 0x8BAF, 0x6031, 0x9C84, 0x603A, 0x9C8A, + 0x6041, 0x9C8C, 0x6042, 0x9C96, 0x6043, 0x9C94, 0x6046, 0x9C91, 0x604A, 0x9C90, 0x604B, 0x97F6, 0x604D, 0x9C92, 0x6050, 0x8BB0, + 0x6052, 0x8D50, 0x6055, 0x8F9A, 0x6059, 0x9C99, 0x605A, 0x9C8B, 0x605D, 0xFABC, 0x605F, 0x9C8F, 0x6060, 0x9C7E, 0x6062, 0x89F8, + 0x6063, 0x9C93, 0x6064, 0x9C95, 0x6065, 0x9270, 0x6068, 0x8DA6, 0x6069, 0x89B6, 0x606A, 0x9C8D, 0x606B, 0x9C98, 0x606C, 0x9C97, + 0x606D, 0x8BB1, 0x606F, 0x91A7, 0x6070, 0x8A86, 0x6075, 0x8C62, 0x6077, 0x9C8E, 0x6081, 0x9C9A, 0x6083, 0x9C9D, 0x6084, 0x9C9F, + 0x6085, 0xFABD, 0x6089, 0x8EBB, 0x608A, 0xFABE, 0x608B, 0x9CA5, 0x608C, 0x92EE, 0x608D, 0x9C9B, 0x6092, 0x9CA3, 0x6094, 0x89F7, + 0x6096, 0x9CA1, 0x6097, 0x9CA2, 0x609A, 0x9C9E, 0x609B, 0x9CA0, 0x609F, 0x8CE5, 0x60A0, 0x9749, 0x60A3, 0x8AB3, 0x60A6, 0x8978, + 0x60A7, 0x9CA4, 0x60A9, 0x9459, 0x60AA, 0x88AB, 0x60B2, 0x94DF, 0x60B3, 0x9C7B, 0x60B4, 0x9CAA, 0x60B5, 0x9CAE, 0x60B6, 0x96E3, + 0x60B8, 0x9CA7, 0x60BC, 0x9389, 0x60BD, 0x9CAC, 0x60C5, 0x8FEE, 0x60C6, 0x9CAD, 0x60C7, 0x93D5, 0x60D1, 0x9866, 0x60D3, 0x9CA9, + 0x60D5, 0xFAC0, 0x60D8, 0x9CAF, 0x60DA, 0x8D9B, 0x60DC, 0x90C9, 0x60DE, 0xFABF, 0x60DF, 0x88D2, 0x60E0, 0x9CA8, 0x60E1, 0x9CA6, + 0x60E3, 0x9179, 0x60E7, 0x9C9C, 0x60E8, 0x8E53, 0x60F0, 0x91C4, 0x60F1, 0x9CBB, 0x60F2, 0xFAC2, 0x60F3, 0x917A, 0x60F4, 0x9CB6, + 0x60F6, 0x9CB3, 0x60F7, 0x9CB4, 0x60F9, 0x8EE4, 0x60FA, 0x9CB7, 0x60FB, 0x9CBA, 0x6100, 0x9CB5, 0x6101, 0x8F44, 0x6103, 0x9CB8, + 0x6106, 0x9CB2, 0x6108, 0x96FA, 0x6109, 0x96F9, 0x610D, 0x9CBC, 0x610E, 0x9CBD, 0x610F, 0x88D3, 0x6111, 0xFAC3, 0x6115, 0x9CB1, + 0x611A, 0x8BF0, 0x611B, 0x88A4, 0x611F, 0x8AB4, 0x6120, 0xFAC1, 0x6121, 0x9CB9, 0x6127, 0x9CC1, 0x6128, 0x9CC0, 0x612C, 0x9CC5, + 0x6130, 0xFAC5, 0x6134, 0x9CC6, 0x6137, 0xFAC4, 0x613C, 0x9CC4, 0x613D, 0x9CC7, 0x613E, 0x9CBF, 0x613F, 0x9CC3, 0x6142, 0x9CC8, + 0x6144, 0x9CC9, 0x6147, 0x9CBE, 0x6148, 0x8E9C, 0x614A, 0x9CC2, 0x614B, 0x91D4, 0x614C, 0x8D51, 0x614D, 0x9CB0, 0x614E, 0x9054, + 0x6153, 0x9CD6, 0x6155, 0x95E7, 0x6158, 0x9CCC, 0x6159, 0x9CCD, 0x615A, 0x9CCE, 0x615D, 0x9CD5, 0x615F, 0x9CD4, 0x6162, 0x969D, + 0x6163, 0x8AB5, 0x6165, 0x9CD2, 0x6167, 0x8C64, 0x6168, 0x8A53, 0x616B, 0x9CCF, 0x616E, 0x97B6, 0x616F, 0x9CD1, 0x6170, 0x88D4, + 0x6171, 0x9CD3, 0x6173, 0x9CCA, 0x6174, 0x9CD0, 0x6175, 0x9CD7, 0x6176, 0x8C63, 0x6177, 0x9CCB, 0x617E, 0x977C, 0x6182, 0x974A, + 0x6187, 0x9CDA, 0x618A, 0x9CDE, 0x618E, 0x919E, 0x6190, 0x97F7, 0x6191, 0x9CDF, 0x6194, 0x9CDC, 0x6196, 0x9CD9, 0x6198, 0xFAC6, + 0x6199, 0x9CD8, 0x619A, 0x9CDD, 0x61A4, 0x95AE, 0x61A7, 0x93B2, 0x61A9, 0x8C65, 0x61AB, 0x9CE0, 0x61AC, 0x9CDB, 0x61AE, 0x9CE1, + 0x61B2, 0x8C9B, 0x61B6, 0x89AF, 0x61BA, 0x9CE9, 0x61BE, 0x8AB6, 0x61C3, 0x9CE7, 0x61C6, 0x9CE8, 0x61C7, 0x8DA7, 0x61C8, 0x9CE6, + 0x61C9, 0x9CE4, 0x61CA, 0x9CE3, 0x61CB, 0x9CEA, 0x61CC, 0x9CE2, 0x61CD, 0x9CEC, 0x61D0, 0x89F9, 0x61E3, 0x9CEE, 0x61E6, 0x9CED, + 0x61F2, 0x92A6, 0x61F4, 0x9CF1, 0x61F6, 0x9CEF, 0x61F7, 0x9CE5, 0x61F8, 0x8C9C, 0x61FA, 0x9CF0, 0x61FC, 0x9CF4, 0x61FD, 0x9CF3, + 0x61FE, 0x9CF5, 0x61FF, 0x9CF2, 0x6200, 0x9CF6, 0x6208, 0x9CF7, 0x6209, 0x9CF8, 0x620A, 0x95E8, 0x620C, 0x9CFA, 0x620D, 0x9CF9, + 0x620E, 0x8F5E, 0x6210, 0x90AC, 0x6211, 0x89E4, 0x6212, 0x89FA, 0x6213, 0xFAC7, 0x6214, 0x9CFB, 0x6216, 0x88BD, 0x621A, 0x90CA, + 0x621B, 0x9CFC, 0x621D, 0xE6C1, 0x621E, 0x9D40, 0x621F, 0x8C81, 0x6221, 0x9D41, 0x6226, 0x90ED, 0x622A, 0x9D42, 0x622E, 0x9D43, + 0x622F, 0x8B59, 0x6230, 0x9D44, 0x6232, 0x9D45, 0x6233, 0x9D46, 0x6234, 0x91D5, 0x6238, 0x8CCB, 0x623B, 0x96DF, 0x623F, 0x965B, + 0x6240, 0x8F8A, 0x6241, 0x9D47, 0x6247, 0x90EE, 0x6248, 0xE7BB, 0x6249, 0x94E0, 0x624B, 0x8EE8, 0x624D, 0x8DCB, 0x624E, 0x9D48, + 0x6253, 0x91C5, 0x6255, 0x95A5, 0x6258, 0x91EF, 0x625B, 0x9D4B, 0x625E, 0x9D49, 0x6260, 0x9D4C, 0x6263, 0x9D4A, 0x6268, 0x9D4D, + 0x626E, 0x95AF, 0x6271, 0x88B5, 0x6276, 0x957D, 0x6279, 0x94E1, 0x627C, 0x9D4E, 0x627E, 0x9D51, 0x627F, 0x8FB3, 0x6280, 0x8B5A, + 0x6282, 0x9D4F, 0x6283, 0x9D56, 0x6284, 0x8FB4, 0x6289, 0x9D50, 0x628A, 0x9463, 0x6291, 0x977D, 0x6292, 0x9D52, 0x6293, 0x9D53, + 0x6294, 0x9D57, 0x6295, 0x938A, 0x6296, 0x9D54, 0x6297, 0x8D52, 0x6298, 0x90DC, 0x629B, 0x9D65, 0x629C, 0x94B2, 0x629E, 0x91F0, + 0x62A6, 0xFAC8, 0x62AB, 0x94E2, 0x62AC, 0x9DAB, 0x62B1, 0x95F8, 0x62B5, 0x92EF, 0x62B9, 0x9695, 0x62BB, 0x9D5A, 0x62BC, 0x899F, + 0x62BD, 0x928A, 0x62C2, 0x9D63, 0x62C5, 0x9253, 0x62C6, 0x9D5D, 0x62C7, 0x9D64, 0x62C8, 0x9D5F, 0x62C9, 0x9D66, 0x62CA, 0x9D62, + 0x62CC, 0x9D61, 0x62CD, 0x948F, 0x62CF, 0x9D5B, 0x62D0, 0x89FB, 0x62D1, 0x9D59, 0x62D2, 0x8B91, 0x62D3, 0x91F1, 0x62D4, 0x9D55, + 0x62D7, 0x9D58, 0x62D8, 0x8D53, 0x62D9, 0x90D9, 0x62DB, 0x8FB5, 0x62DC, 0x9D60, 0x62DD, 0x9471, 0x62E0, 0x8B92, 0x62E1, 0x8A67, + 0x62EC, 0x8A87, 0x62ED, 0x9040, 0x62EE, 0x9D68, 0x62EF, 0x9D6D, 0x62F1, 0x9D69, 0x62F3, 0x8C9D, 0x62F5, 0x9D6E, 0x62F6, 0x8E41, + 0x62F7, 0x8D89, 0x62FE, 0x8F45, 0x62FF, 0x9D5C, 0x6301, 0x8E9D, 0x6302, 0x9D6B, 0x6307, 0x8E77, 0x6308, 0x9D6C, 0x6309, 0x88C2, + 0x630C, 0x9D67, 0x6311, 0x92A7, 0x6319, 0x8B93, 0x631F, 0x8BB2, 0x6327, 0x9D6A, 0x6328, 0x88A5, 0x632B, 0x8DC1, 0x632F, 0x9055, + 0x633A, 0x92F0, 0x633D, 0x94D2, 0x633E, 0x9D70, 0x633F, 0x917D, 0x6349, 0x91A8, 0x634C, 0x8E4A, 0x634D, 0x9D71, 0x634F, 0x9D73, + 0x6350, 0x9D6F, 0x6355, 0x95DF, 0x6357, 0x92BB, 0x635C, 0x917B, 0x6367, 0x95F9, 0x6368, 0x8ECC, 0x6369, 0x9D80, 0x636B, 0x9D7E, + 0x636E, 0x9098, 0x6372, 0x8C9E, 0x6376, 0x9D78, 0x6377, 0x8FB7, 0x637A, 0x93E6, 0x637B, 0x9450, 0x6380, 0x9D76, 0x6383, 0x917C, + 0x6388, 0x8EF6, 0x6389, 0x9D7B, 0x638C, 0x8FB6, 0x638E, 0x9D75, 0x638F, 0x9D7A, 0x6392, 0x9472, 0x6396, 0x9D74, 0x6398, 0x8C40, + 0x639B, 0x8A7C, 0x639F, 0x9D7C, 0x63A0, 0x97A9, 0x63A1, 0x8DCC, 0x63A2, 0x9254, 0x63A3, 0x9D79, 0x63A5, 0x90DA, 0x63A7, 0x8D54, + 0x63A8, 0x9084, 0x63A9, 0x8986, 0x63AA, 0x915B, 0x63AB, 0x9D77, 0x63AC, 0x8B64, 0x63B2, 0x8C66, 0x63B4, 0x92CD, 0x63B5, 0x9D7D, + 0x63BB, 0x917E, 0x63BE, 0x9D81, 0x63C0, 0x9D83, 0x63C3, 0x91B5, 0x63C4, 0x9D89, 0x63C6, 0x9D84, 0x63C9, 0x9D86, 0x63CF, 0x9560, + 0x63D0, 0x92F1, 0x63D2, 0x9D87, 0x63D6, 0x974B, 0x63DA, 0x9767, 0x63DB, 0x8AB7, 0x63E1, 0x88AC, 0x63E3, 0x9D85, 0x63E9, 0x9D82, + 0x63EE, 0x8AF6, 0x63F4, 0x8987, 0x63F5, 0xFAC9, 0x63F6, 0x9D88, 0x63FA, 0x9768, 0x6406, 0x9D8C, 0x640D, 0x91B9, 0x640F, 0x9D93, + 0x6413, 0x9D8D, 0x6416, 0x9D8A, 0x6417, 0x9D91, 0x641C, 0x9D72, 0x6426, 0x9D8E, 0x6428, 0x9D92, 0x642C, 0x94C0, 0x642D, 0x938B, + 0x6434, 0x9D8B, 0x6436, 0x9D8F, 0x643A, 0x8C67, 0x643E, 0x8DEF, 0x6442, 0x90DB, 0x644E, 0x9D97, 0x6458, 0x9345, 0x6460, 0xFACA, + 0x6467, 0x9D94, 0x6469, 0x9680, 0x646F, 0x9D95, 0x6476, 0x9D96, 0x6478, 0x96CC, 0x647A, 0x90A0, 0x6483, 0x8C82, 0x6488, 0x9D9D, + 0x6492, 0x8E54, 0x6493, 0x9D9A, 0x6495, 0x9D99, 0x649A, 0x9451, 0x649D, 0xFACB, 0x649E, 0x93B3, 0x64A4, 0x9350, 0x64A5, 0x9D9B, + 0x64A9, 0x9D9C, 0x64AB, 0x958F, 0x64AD, 0x9464, 0x64AE, 0x8E42, 0x64B0, 0x90EF, 0x64B2, 0x966F, 0x64B9, 0x8A68, 0x64BB, 0x9DA3, + 0x64BC, 0x9D9E, 0x64C1, 0x9769, 0x64C2, 0x9DA5, 0x64C5, 0x9DA1, 0x64C7, 0x9DA2, 0x64CD, 0x9180, 0x64CE, 0xFACC, 0x64D2, 0x9DA0, + 0x64D4, 0x9D5E, 0x64D8, 0x9DA4, 0x64DA, 0x9D9F, 0x64E0, 0x9DA9, 0x64E1, 0x9DAA, 0x64E2, 0x9346, 0x64E3, 0x9DAC, 0x64E6, 0x8E43, + 0x64E7, 0x9DA7, 0x64EC, 0x8B5B, 0x64EF, 0x9DAD, 0x64F1, 0x9DA6, 0x64F2, 0x9DB1, 0x64F4, 0x9DB0, 0x64F6, 0x9DAF, 0x64FA, 0x9DB2, + 0x64FD, 0x9DB4, 0x64FE, 0x8FEF, 0x6500, 0x9DB3, 0x6505, 0x9DB7, 0x6518, 0x9DB5, 0x651C, 0x9DB6, 0x651D, 0x9D90, 0x6523, 0x9DB9, + 0x6524, 0x9DB8, 0x652A, 0x9D98, 0x652B, 0x9DBA, 0x652C, 0x9DAE, 0x652F, 0x8E78, 0x6534, 0x9DBB, 0x6535, 0x9DBC, 0x6536, 0x9DBE, + 0x6537, 0x9DBD, 0x6538, 0x9DBF, 0x6539, 0x89FC, 0x653B, 0x8D55, 0x653E, 0x95FA, 0x653F, 0x90AD, 0x6545, 0x8CCC, 0x6548, 0x9DC1, + 0x654D, 0x9DC4, 0x654E, 0xFACD, 0x654F, 0x9571, 0x6551, 0x8B7E, 0x6555, 0x9DC3, 0x6556, 0x9DC2, 0x6557, 0x9473, 0x6558, 0x9DC5, + 0x6559, 0x8BB3, 0x655D, 0x9DC7, 0x655E, 0x9DC6, 0x6562, 0x8AB8, 0x6563, 0x8E55, 0x6566, 0x93D6, 0x656C, 0x8C68, 0x6570, 0x9094, + 0x6572, 0x9DC8, 0x6574, 0x90AE, 0x6575, 0x9347, 0x6577, 0x957E, 0x6578, 0x9DC9, 0x6582, 0x9DCA, 0x6583, 0x9DCB, 0x6587, 0x95B6, + 0x6588, 0x9B7C, 0x6589, 0x90C4, 0x658C, 0x956B, 0x658E, 0x8DD6, 0x6590, 0x94E3, 0x6591, 0x94C1, 0x6597, 0x936C, 0x6599, 0x97BF, + 0x659B, 0x9DCD, 0x659C, 0x8ECE, 0x659F, 0x9DCE, 0x65A1, 0x88B4, 0x65A4, 0x8BD2, 0x65A5, 0x90CB, 0x65A7, 0x9580, 0x65AB, 0x9DCF, + 0x65AC, 0x8E61, 0x65AD, 0x9266, 0x65AF, 0x8E7A, 0x65B0, 0x9056, 0x65B7, 0x9DD0, 0x65B9, 0x95FB, 0x65BC, 0x8997, 0x65BD, 0x8E7B, + 0x65C1, 0x9DD3, 0x65C3, 0x9DD1, 0x65C4, 0x9DD4, 0x65C5, 0x97B7, 0x65C6, 0x9DD2, 0x65CB, 0x90F9, 0x65CC, 0x9DD5, 0x65CF, 0x91B0, + 0x65D2, 0x9DD6, 0x65D7, 0x8AF8, 0x65D9, 0x9DD8, 0x65DB, 0x9DD7, 0x65E0, 0x9DD9, 0x65E1, 0x9DDA, 0x65E2, 0x8AF9, 0x65E5, 0x93FA, + 0x65E6, 0x9255, 0x65E7, 0x8B8C, 0x65E8, 0x8E7C, 0x65E9, 0x9181, 0x65EC, 0x8F7B, 0x65ED, 0x88AE, 0x65F1, 0x9DDB, 0x65FA, 0x89A0, + 0x65FB, 0x9DDF, 0x6600, 0xFACE, 0x6602, 0x8D56, 0x6603, 0x9DDE, 0x6606, 0x8DA9, 0x6607, 0x8FB8, 0x6609, 0xFAD1, 0x660A, 0x9DDD, + 0x660C, 0x8FB9, 0x660E, 0x96BE, 0x660F, 0x8DA8, 0x6613, 0x88D5, 0x6614, 0x90CC, 0x6615, 0xFACF, 0x661C, 0x9DE4, 0x661E, 0xFAD3, + 0x661F, 0x90AF, 0x6620, 0x8966, 0x6624, 0xFAD4, 0x6625, 0x8F74, 0x6627, 0x9686, 0x6628, 0x8DF0, 0x662D, 0x8FBA, 0x662E, 0xFAD2, + 0x662F, 0x90A5, 0x6631, 0xFA63, 0x6634, 0x9DE3, 0x6635, 0x9DE1, 0x6636, 0x9DE2, 0x663B, 0xFAD0, 0x663C, 0x928B, 0x663F, 0x9E45, + 0x6641, 0x9DE8, 0x6642, 0x8E9E, 0x6643, 0x8D57, 0x6644, 0x9DE6, 0x6649, 0x9DE7, 0x664B, 0x9057, 0x664F, 0x9DE5, 0x6652, 0x8E4E, + 0x6657, 0xFAD6, 0x6659, 0xFAD7, 0x665D, 0x9DEA, 0x665E, 0x9DE9, 0x665F, 0x9DEE, 0x6662, 0x9DEF, 0x6664, 0x9DEB, 0x6665, 0xFAD5, + 0x6666, 0x8A41, 0x6667, 0x9DEC, 0x6668, 0x9DED, 0x6669, 0x94D3, 0x666E, 0x9581, 0x666F, 0x8C69, 0x6670, 0x9DF0, 0x6673, 0xFAD9, + 0x6674, 0x90B0, 0x6676, 0x8FBB, 0x667A, 0x9271, 0x6681, 0x8BC5, 0x6683, 0x9DF1, 0x6684, 0x9DF5, 0x6687, 0x89C9, 0x6688, 0x9DF2, + 0x6689, 0x9DF4, 0x668E, 0x9DF3, 0x6691, 0x8F8B, 0x6696, 0x9267, 0x6697, 0x88C3, 0x6698, 0x9DF6, 0x6699, 0xFADA, 0x669D, 0x9DF7, + 0x66A0, 0xFADB, 0x66A2, 0x92A8, 0x66A6, 0x97EF, 0x66AB, 0x8E62, 0x66AE, 0x95E9, 0x66B2, 0xFADC, 0x66B4, 0x965C, 0x66B8, 0x9E41, + 0x66B9, 0x9DF9, 0x66BC, 0x9DFC, 0x66BE, 0x9DFB, 0x66BF, 0xFADD, 0x66C1, 0x9DF8, 0x66C4, 0x9E40, 0x66C7, 0x93DC, 0x66C9, 0x9DFA, + 0x66D6, 0x9E42, 0x66D9, 0x8F8C, 0x66DA, 0x9E43, 0x66DC, 0x976A, 0x66DD, 0x9498, 0x66E0, 0x9E44, 0x66E6, 0x9E46, 0x66E9, 0x9E47, + 0x66F0, 0x9E48, 0x66F2, 0x8BC8, 0x66F3, 0x8967, 0x66F4, 0x8D58, 0x66F5, 0x9E49, 0x66F7, 0x9E4A, 0x66F8, 0x8F91, 0x66F9, 0x9182, + 0x66FA, 0xFADE, 0x66FB, 0xFA66, 0x66FC, 0x99D6, 0x66FD, 0x915D, 0x66FE, 0x915C, 0x66FF, 0x91D6, 0x6700, 0x8DC5, 0x6703, 0x98F0, + 0x6708, 0x8C8E, 0x6709, 0x974C, 0x670B, 0x95FC, 0x670D, 0x959E, 0x670E, 0xFADF, 0x670F, 0x9E4B, 0x6714, 0x8DF1, 0x6715, 0x92BD, + 0x6716, 0x9E4C, 0x6717, 0x984E, 0x671B, 0x965D, 0x671D, 0x92A9, 0x671E, 0x9E4D, 0x671F, 0x8AFA, 0x6726, 0x9E4E, 0x6727, 0x9E4F, + 0x6728, 0x96D8, 0x672A, 0x96A2, 0x672B, 0x9696, 0x672C, 0x967B, 0x672D, 0x8E44, 0x672E, 0x9E51, 0x6731, 0x8EE9, 0x6734, 0x9670, + 0x6736, 0x9E53, 0x6737, 0x9E56, 0x6738, 0x9E55, 0x673A, 0x8AF7, 0x673D, 0x8B80, 0x673F, 0x9E52, 0x6741, 0x9E54, 0x6746, 0x9E57, + 0x6749, 0x9099, 0x674E, 0x979B, 0x674F, 0x88C7, 0x6750, 0x8DDE, 0x6751, 0x91BA, 0x6753, 0x8EDB, 0x6756, 0x8FF1, 0x6759, 0x9E5A, + 0x675C, 0x936D, 0x675E, 0x9E58, 0x675F, 0x91A9, 0x6760, 0x9E59, 0x6761, 0x8FF0, 0x6762, 0x96DB, 0x6763, 0x9E5B, 0x6764, 0x9E5C, + 0x6765, 0x9788, 0x6766, 0xFAE1, 0x676A, 0x9E61, 0x676D, 0x8D59, 0x676F, 0x9474, 0x6770, 0x9E5E, 0x6771, 0x938C, 0x6772, 0x9DDC, + 0x6773, 0x9DE0, 0x6775, 0x8B6E, 0x6777, 0x9466, 0x677C, 0x9E60, 0x677E, 0x8FBC, 0x677F, 0x94C2, 0x6785, 0x9E66, 0x6787, 0x94F8, + 0x6789, 0x9E5D, 0x678B, 0x9E63, 0x678C, 0x9E62, 0x6790, 0x90CD, 0x6795, 0x968D, 0x6797, 0x97D1, 0x679A, 0x9687, 0x679C, 0x89CA, + 0x679D, 0x8E7D, 0x67A0, 0x9867, 0x67A1, 0x9E65, 0x67A2, 0x9095, 0x67A6, 0x9E64, 0x67A9, 0x9E5F, 0x67AF, 0x8CCD, 0x67B3, 0x9E6B, + 0x67B4, 0x9E69, 0x67B6, 0x89CB, 0x67B7, 0x9E67, 0x67B8, 0x9E6D, 0x67B9, 0x9E73, 0x67BB, 0xFAE2, 0x67C0, 0xFAE4, 0x67C1, 0x91C6, + 0x67C4, 0x95BF, 0x67C6, 0x9E75, 0x67CA, 0x9541, 0x67CE, 0x9E74, 0x67CF, 0x9490, 0x67D0, 0x965E, 0x67D1, 0x8AB9, 0x67D3, 0x90F5, + 0x67D4, 0x8F5F, 0x67D8, 0x92D1, 0x67DA, 0x974D, 0x67DD, 0x9E70, 0x67DE, 0x9E6F, 0x67E2, 0x9E71, 0x67E4, 0x9E6E, 0x67E7, 0x9E76, + 0x67E9, 0x9E6C, 0x67EC, 0x9E6A, 0x67EE, 0x9E72, 0x67EF, 0x9E68, 0x67F1, 0x928C, 0x67F3, 0x96F6, 0x67F4, 0x8EC4, 0x67F5, 0x8DF2, + 0x67FB, 0x8DB8, 0x67FE, 0x968F, 0x67FF, 0x8A60, 0x6801, 0xFAE5, 0x6802, 0x92CC, 0x6803, 0x93C8, 0x6804, 0x8968, 0x6813, 0x90F0, + 0x6816, 0x90B2, 0x6817, 0x8C49, 0x681E, 0x9E78, 0x6821, 0x8D5A, 0x6822, 0x8A9C, 0x6829, 0x9E7A, 0x682A, 0x8A94, 0x682B, 0x9E81, + 0x6832, 0x9E7D, 0x6834, 0x90F1, 0x6838, 0x8A6A, 0x6839, 0x8DAA, 0x683C, 0x8A69, 0x683D, 0x8DCD, 0x6840, 0x9E7B, 0x6841, 0x8C85, + 0x6842, 0x8C6A, 0x6843, 0x938D, 0x6844, 0xFAE6, 0x6846, 0x9E79, 0x6848, 0x88C4, 0x684D, 0x9E7C, 0x684E, 0x9E7E, 0x6850, 0x8BCB, + 0x6851, 0x8C4B, 0x6852, 0xFAE3, 0x6853, 0x8ABA, 0x6854, 0x8B6A, 0x6859, 0x9E82, 0x685C, 0x8DF7, 0x685D, 0x9691, 0x685F, 0x8E56, + 0x6863, 0x9E83, 0x6867, 0x954F, 0x6874, 0x9E8F, 0x6876, 0x89B1, 0x6877, 0x9E84, 0x687E, 0x9E95, 0x687F, 0x9E85, 0x6881, 0x97C0, + 0x6883, 0x9E8C, 0x6885, 0x947E, 0x688D, 0x9E94, 0x688F, 0x9E87, 0x6893, 0x88B2, 0x6894, 0x9E89, 0x6897, 0x8D5B, 0x689B, 0x9E8B, + 0x689D, 0x9E8A, 0x689F, 0x9E86, 0x68A0, 0x9E91, 0x68A2, 0x8FBD, 0x68A6, 0x9AEB, 0x68A7, 0x8CE6, 0x68A8, 0x979C, 0x68AD, 0x9E88, + 0x68AF, 0x92F2, 0x68B0, 0x8A42, 0x68B1, 0x8DAB, 0x68B3, 0x9E80, 0x68B5, 0x9E90, 0x68B6, 0x8A81, 0x68B9, 0x9E8E, 0x68BA, 0x9E92, + 0x68BC, 0x938E, 0x68C4, 0x8AFC, 0x68C6, 0x9EB0, 0x68C8, 0xFA64, 0x68C9, 0x96C7, 0x68CA, 0x9E97, 0x68CB, 0x8AFB, 0x68CD, 0x9E9E, + 0x68CF, 0xFAE7, 0x68D2, 0x965F, 0x68D4, 0x9E9F, 0x68D5, 0x9EA1, 0x68D7, 0x9EA5, 0x68D8, 0x9E99, 0x68DA, 0x9249, 0x68DF, 0x938F, + 0x68E0, 0x9EA9, 0x68E1, 0x9E9C, 0x68E3, 0x9EA6, 0x68E7, 0x9EA0, 0x68EE, 0x9058, 0x68EF, 0x9EAA, 0x68F2, 0x90B1, 0x68F9, 0x9EA8, + 0x68FA, 0x8ABB, 0x6900, 0x986F, 0x6901, 0x9E96, 0x6904, 0x9EA4, 0x6905, 0x88D6, 0x6908, 0x9E98, 0x690B, 0x96B8, 0x690C, 0x9E9D, + 0x690D, 0x9041, 0x690E, 0x92C5, 0x690F, 0x9E93, 0x6912, 0x9EA3, 0x6919, 0x909A, 0x691A, 0x9EAD, 0x691B, 0x8A91, 0x691C, 0x8C9F, + 0x6921, 0x9EAF, 0x6922, 0x9E9A, 0x6923, 0x9EAE, 0x6925, 0x9EA7, 0x6926, 0x9E9B, 0x6928, 0x9EAB, 0x692A, 0x9EAC, 0x6930, 0x9EBD, + 0x6934, 0x93CC, 0x6936, 0x9EA2, 0x6939, 0x9EB9, 0x693D, 0x9EBB, 0x693F, 0x92D6, 0x694A, 0x976B, 0x6953, 0x9596, 0x6954, 0x9EB6, + 0x6955, 0x91C8, 0x6959, 0x9EBC, 0x695A, 0x915E, 0x695C, 0x9EB3, 0x695D, 0x9EC0, 0x695E, 0x9EBF, 0x6960, 0x93ED, 0x6961, 0x9EBE, + 0x6962, 0x93E8, 0x6968, 0xFAE9, 0x696A, 0x9EC2, 0x696B, 0x9EB5, 0x696D, 0x8BC6, 0x696E, 0x9EB8, 0x696F, 0x8F7C, 0x6973, 0x9480, + 0x6974, 0x9EBA, 0x6975, 0x8BC9, 0x6977, 0x9EB2, 0x6978, 0x9EB4, 0x6979, 0x9EB1, 0x697C, 0x984F, 0x697D, 0x8A79, 0x697E, 0x9EB7, + 0x6981, 0x9EC1, 0x6982, 0x8A54, 0x698A, 0x8DE5, 0x698E, 0x897C, 0x6991, 0x9ED2, 0x6994, 0x9850, 0x6995, 0x9ED5, 0x6998, 0xFAEB, + 0x699B, 0x9059, 0x699C, 0x9ED4, 0x69A0, 0x9ED3, 0x69A7, 0x9ED0, 0x69AE, 0x9EC4, 0x69B1, 0x9EE1, 0x69B2, 0x9EC3, 0x69B4, 0x9ED6, + 0x69BB, 0x9ECE, 0x69BE, 0x9EC9, 0x69BF, 0x9EC6, 0x69C1, 0x9EC7, 0x69C3, 0x9ECF, 0x69C7, 0xEAA0, 0x69CA, 0x9ECC, 0x69CB, 0x8D5C, + 0x69CC, 0x92C6, 0x69CD, 0x9184, 0x69CE, 0x9ECA, 0x69D0, 0x9EC5, 0x69D3, 0x9EC8, 0x69D8, 0x976C, 0x69D9, 0x968A, 0x69DD, 0x9ECD, + 0x69DE, 0x9ED7, 0x69E2, 0xFAEC, 0x69E7, 0x9EDF, 0x69E8, 0x9ED8, 0x69EB, 0x9EE5, 0x69ED, 0x9EE3, 0x69F2, 0x9EDE, 0x69F9, 0x9EDD, + 0x69FB, 0x92CE, 0x69FD, 0x9185, 0x69FF, 0x9EDB, 0x6A02, 0x9ED9, 0x6A05, 0x9EE0, 0x6A0A, 0x9EE6, 0x6A0B, 0x94F3, 0x6A0C, 0x9EEC, + 0x6A12, 0x9EE7, 0x6A13, 0x9EEA, 0x6A14, 0x9EE4, 0x6A17, 0x9294, 0x6A19, 0x9557, 0x6A1B, 0x9EDA, 0x6A1E, 0x9EE2, 0x6A1F, 0x8FBE, + 0x6A21, 0x96CD, 0x6A22, 0x9EF6, 0x6A23, 0x9EE9, 0x6A29, 0x8CA0, 0x6A2A, 0x89A1, 0x6A2B, 0x8A7E, 0x6A2E, 0x9ED1, 0x6A30, 0xFAED, + 0x6A35, 0x8FBF, 0x6A36, 0x9EEE, 0x6A38, 0x9EF5, 0x6A39, 0x8EF7, 0x6A3A, 0x8A92, 0x6A3D, 0x924D, 0x6A44, 0x9EEB, 0x6A46, 0xFAEF, + 0x6A47, 0x9EF0, 0x6A48, 0x9EF4, 0x6A4B, 0x8BB4, 0x6A58, 0x8B6B, 0x6A59, 0x9EF2, 0x6A5F, 0x8B40, 0x6A61, 0x93C9, 0x6A62, 0x9EF1, + 0x6A66, 0x9EF3, 0x6A6B, 0xFAEE, 0x6A72, 0x9EED, 0x6A73, 0xFAF0, 0x6A78, 0x9EEF, 0x6A7E, 0xFAF1, 0x6A7F, 0x8A80, 0x6A80, 0x9268, + 0x6A84, 0x9EFA, 0x6A8D, 0x9EF8, 0x6A8E, 0x8CE7, 0x6A90, 0x9EF7, 0x6A97, 0x9F40, 0x6A9C, 0x9E77, 0x6AA0, 0x9EF9, 0x6AA2, 0x9EFB, + 0x6AA3, 0x9EFC, 0x6AAA, 0x9F4B, 0x6AAC, 0x9F47, 0x6AAE, 0x9E8D, 0x6AB3, 0x9F46, 0x6AB8, 0x9F45, 0x6ABB, 0x9F42, 0x6AC1, 0x9EE8, + 0x6AC2, 0x9F44, 0x6AC3, 0x9F43, 0x6AD1, 0x9F49, 0x6AD3, 0x9845, 0x6ADA, 0x9F4C, 0x6ADB, 0x8BF9, 0x6ADE, 0x9F48, 0x6ADF, 0x9F4A, + 0x6AE2, 0xFAF2, 0x6AE4, 0xFAF3, 0x6AE8, 0x94A5, 0x6AEA, 0x9F4D, 0x6AFA, 0x9F51, 0x6AFB, 0x9F4E, 0x6B04, 0x9793, 0x6B05, 0x9F4F, + 0x6B0A, 0x9EDC, 0x6B12, 0x9F52, 0x6B16, 0x9F53, 0x6B1D, 0x8954, 0x6B1F, 0x9F55, 0x6B20, 0x8C87, 0x6B21, 0x8E9F, 0x6B23, 0x8BD3, + 0x6B27, 0x89A2, 0x6B32, 0x977E, 0x6B37, 0x9F57, 0x6B38, 0x9F56, 0x6B39, 0x9F59, 0x6B3A, 0x8B5C, 0x6B3D, 0x8BD4, 0x6B3E, 0x8ABC, + 0x6B43, 0x9F5C, 0x6B47, 0x9F5B, 0x6B49, 0x9F5D, 0x6B4C, 0x89CC, 0x6B4E, 0x9256, 0x6B50, 0x9F5E, 0x6B53, 0x8ABD, 0x6B54, 0x9F60, + 0x6B59, 0x9F5F, 0x6B5B, 0x9F61, 0x6B5F, 0x9F62, 0x6B61, 0x9F63, 0x6B62, 0x8E7E, 0x6B63, 0x90B3, 0x6B64, 0x8D9F, 0x6B66, 0x9590, + 0x6B69, 0x95E0, 0x6B6A, 0x9863, 0x6B6F, 0x8E95, 0x6B73, 0x8DCE, 0x6B74, 0x97F0, 0x6B78, 0x9F64, 0x6B79, 0x9F65, 0x6B7B, 0x8E80, + 0x6B7F, 0x9F66, 0x6B80, 0x9F67, 0x6B83, 0x9F69, 0x6B84, 0x9F68, 0x6B86, 0x9677, 0x6B89, 0x8F7D, 0x6B8A, 0x8EEA, 0x6B8B, 0x8E63, + 0x6B8D, 0x9F6A, 0x6B95, 0x9F6C, 0x6B96, 0x9042, 0x6B98, 0x9F6B, 0x6B9E, 0x9F6D, 0x6BA4, 0x9F6E, 0x6BAA, 0x9F6F, 0x6BAB, 0x9F70, + 0x6BAF, 0x9F71, 0x6BB1, 0x9F73, 0x6BB2, 0x9F72, 0x6BB3, 0x9F74, 0x6BB4, 0x89A3, 0x6BB5, 0x9269, 0x6BB7, 0x9F75, 0x6BBA, 0x8E45, + 0x6BBB, 0x8A6B, 0x6BBC, 0x9F76, 0x6BBF, 0x9361, 0x6BC0, 0x9ACA, 0x6BC5, 0x8B42, 0x6BC6, 0x9F77, 0x6BCB, 0x9F78, 0x6BCD, 0x95EA, + 0x6BCE, 0x9688, 0x6BD2, 0x93C5, 0x6BD3, 0x9F79, 0x6BD4, 0x94E4, 0x6BD6, 0xFAF4, 0x6BD8, 0x94F9, 0x6BDB, 0x96D1, 0x6BDF, 0x9F7A, + 0x6BEB, 0x9F7C, 0x6BEC, 0x9F7B, 0x6BEF, 0x9F7E, 0x6BF3, 0x9F7D, 0x6C08, 0x9F81, 0x6C0F, 0x8E81, 0x6C11, 0x96AF, 0x6C13, 0x9F82, + 0x6C14, 0x9F83, 0x6C17, 0x8B43, 0x6C1B, 0x9F84, 0x6C23, 0x9F86, 0x6C24, 0x9F85, 0x6C34, 0x9085, 0x6C37, 0x9558, 0x6C38, 0x8969, + 0x6C3E, 0x94C3, 0x6C3F, 0xFAF5, 0x6C40, 0x92F3, 0x6C41, 0x8F60, 0x6C42, 0x8B81, 0x6C4E, 0x94C4, 0x6C50, 0x8EAC, 0x6C55, 0x9F88, + 0x6C57, 0x8ABE, 0x6C5A, 0x8998, 0x6C5C, 0xFAF6, 0x6C5D, 0x93F0, 0x6C5E, 0x9F87, 0x6C5F, 0x8D5D, 0x6C60, 0x9272, 0x6C62, 0x9F89, + 0x6C68, 0x9F91, 0x6C6A, 0x9F8A, 0x6C6F, 0xFAF8, 0x6C70, 0x91BF, 0x6C72, 0x8B82, 0x6C73, 0x9F92, 0x6C7A, 0x8C88, 0x6C7D, 0x8B44, + 0x6C7E, 0x9F90, 0x6C81, 0x9F8E, 0x6C82, 0x9F8B, 0x6C83, 0x9780, 0x6C86, 0xFAF7, 0x6C88, 0x92BE, 0x6C8C, 0x93D7, 0x6C8D, 0x9F8C, + 0x6C90, 0x9F94, 0x6C92, 0x9F93, 0x6C93, 0x8C42, 0x6C96, 0x89AB, 0x6C99, 0x8DB9, 0x6C9A, 0x9F8D, 0x6C9B, 0x9F8F, 0x6CA1, 0x9676, + 0x6CA2, 0x91F2, 0x6CAB, 0x9697, 0x6CAE, 0x9F9C, 0x6CB1, 0x9F9D, 0x6CB3, 0x89CD, 0x6CB8, 0x95A6, 0x6CB9, 0x96FB, 0x6CBA, 0x9F9F, + 0x6CBB, 0x8EA1, 0x6CBC, 0x8FC0, 0x6CBD, 0x9F98, 0x6CBE, 0x9F9E, 0x6CBF, 0x8988, 0x6CC1, 0x8BB5, 0x6CC4, 0x9F95, 0x6CC5, 0x9F9A, + 0x6CC9, 0x90F2, 0x6CCA, 0x9491, 0x6CCC, 0x94E5, 0x6CD3, 0x9F97, 0x6CD5, 0x9640, 0x6CD7, 0x9F99, 0x6CD9, 0x9FA2, 0x6CDA, 0xFAF9, + 0x6CDB, 0x9FA0, 0x6CDD, 0x9F9B, 0x6CE1, 0x9641, 0x6CE2, 0x9467, 0x6CE3, 0x8B83, 0x6CE5, 0x9344, 0x6CE8, 0x928D, 0x6CEA, 0x9FA3, + 0x6CEF, 0x9FA1, 0x6CF0, 0x91D7, 0x6CF1, 0x9F96, 0x6CF3, 0x896A, 0x6D04, 0xFAFA, 0x6D0B, 0x976D, 0x6D0C, 0x9FAE, 0x6D12, 0x9FAD, + 0x6D17, 0x90F4, 0x6D19, 0x9FAA, 0x6D1B, 0x978C, 0x6D1E, 0x93B4, 0x6D1F, 0x9FA4, 0x6D25, 0x92C3, 0x6D29, 0x896B, 0x6D2A, 0x8D5E, + 0x6D2B, 0x9FA7, 0x6D32, 0x8F46, 0x6D33, 0x9FAC, 0x6D35, 0x9FAB, 0x6D36, 0x9FA6, 0x6D38, 0x9FA9, 0x6D3B, 0x8A88, 0x6D3D, 0x9FA8, + 0x6D3E, 0x9468, 0x6D41, 0x97AC, 0x6D44, 0x8FF2, 0x6D45, 0x90F3, 0x6D59, 0x9FB4, 0x6D5A, 0x9FB2, 0x6D5C, 0x956C, 0x6D63, 0x9FAF, + 0x6D64, 0x9FB1, 0x6D66, 0x8959, 0x6D69, 0x8D5F, 0x6D6A, 0x9851, 0x6D6C, 0x8A5C, 0x6D6E, 0x9582, 0x6D6F, 0xFAFC, 0x6D74, 0x9781, + 0x6D77, 0x8A43, 0x6D78, 0x905A, 0x6D79, 0x9FB3, 0x6D85, 0x9FB8, 0x6D87, 0xFAFB, 0x6D88, 0x8FC1, 0x6D8C, 0x974F, 0x6D8E, 0x9FB5, + 0x6D93, 0x9FB0, 0x6D95, 0x9FB6, 0x6D96, 0xFB40, 0x6D99, 0x97DC, 0x6D9B, 0x9393, 0x6D9C, 0x93C0, 0x6DAC, 0xFB41, 0x6DAF, 0x8A55, + 0x6DB2, 0x8974, 0x6DB5, 0x9FBC, 0x6DB8, 0x9FBF, 0x6DBC, 0x97C1, 0x6DC0, 0x9784, 0x6DC5, 0x9FC6, 0x6DC6, 0x9FC0, 0x6DC7, 0x9FBD, + 0x6DCB, 0x97D2, 0x6DCC, 0x9FC3, 0x6DCF, 0xFB42, 0x6DD1, 0x8F69, 0x6DD2, 0x9FC5, 0x6DD5, 0x9FCA, 0x6DD8, 0x9391, 0x6DD9, 0x9FC8, + 0x6DDE, 0x9FC2, 0x6DE1, 0x9257, 0x6DE4, 0x9FC9, 0x6DE6, 0x9FBE, 0x6DE8, 0x9FC4, 0x6DEA, 0x9FCB, 0x6DEB, 0x88FA, 0x6DEC, 0x9FC1, + 0x6DEE, 0x9FCC, 0x6DF1, 0x905B, 0x6DF2, 0xFB44, 0x6DF3, 0x8F7E, 0x6DF5, 0x95A3, 0x6DF7, 0x8DAC, 0x6DF8, 0xFB43, 0x6DF9, 0x9FB9, + 0x6DFA, 0x9FC7, 0x6DFB, 0x9359, 0x6DFC, 0xFB45, 0x6E05, 0x90B4, 0x6E07, 0x8A89, 0x6E08, 0x8DCF, 0x6E09, 0x8FC2, 0x6E0A, 0x9FBB, + 0x6E0B, 0x8F61, 0x6E13, 0x8C6B, 0x6E15, 0x9FBA, 0x6E19, 0x9FD0, 0x6E1A, 0x8F8D, 0x6E1B, 0x8CB8, 0x6E1D, 0x9FDF, 0x6E1F, 0x9FD9, + 0x6E20, 0x8B94, 0x6E21, 0x936E, 0x6E23, 0x9FD4, 0x6E24, 0x9FDD, 0x6E25, 0x88AD, 0x6E26, 0x8951, 0x6E27, 0xFB48, 0x6E29, 0x89B7, + 0x6E2B, 0x9FD6, 0x6E2C, 0x91AA, 0x6E2D, 0x9FCD, 0x6E2E, 0x9FCF, 0x6E2F, 0x8D60, 0x6E38, 0x9FE0, 0x6E39, 0xFB46, 0x6E3A, 0x9FDB, + 0x6E3C, 0xFB49, 0x6E3E, 0x9FD3, 0x6E43, 0x9FDA, 0x6E4A, 0x96A9, 0x6E4D, 0x9FD8, 0x6E4E, 0x9FDC, 0x6E56, 0x8CCE, 0x6E58, 0x8FC3, + 0x6E5B, 0x9258, 0x6E5C, 0xFB47, 0x6E5F, 0x9FD2, 0x6E67, 0x974E, 0x6E6B, 0x9FD5, 0x6E6E, 0x9FCE, 0x6E6F, 0x9392, 0x6E72, 0x9FD1, + 0x6E76, 0x9FD7, 0x6E7E, 0x9870, 0x6E7F, 0x8EBC, 0x6E80, 0x969E, 0x6E82, 0x9FE1, 0x6E8C, 0x94AC, 0x6E8F, 0x9FED, 0x6E90, 0x8CB9, + 0x6E96, 0x8F80, 0x6E98, 0x9FE3, 0x6E9C, 0x97AD, 0x6E9D, 0x8D61, 0x6E9F, 0x9FF0, 0x6EA2, 0x88EC, 0x6EA5, 0x9FEE, 0x6EAA, 0x9FE2, + 0x6EAF, 0x9FE8, 0x6EB2, 0x9FEA, 0x6EB6, 0x976E, 0x6EB7, 0x9FE5, 0x6EBA, 0x934D, 0x6EBD, 0x9FE7, 0x6EBF, 0xFB4A, 0x6EC2, 0x9FEF, + 0x6EC4, 0x9FE9, 0x6EC5, 0x96C5, 0x6EC9, 0x9FE4, 0x6ECB, 0x8EA0, 0x6ECC, 0x9FFC, 0x6ED1, 0x8A8A, 0x6ED3, 0x9FE6, 0x6ED4, 0x9FEB, + 0x6ED5, 0x9FEC, 0x6EDD, 0x91EA, 0x6EDE, 0x91D8, 0x6EEC, 0x9FF4, 0x6EEF, 0x9FFA, 0x6EF2, 0x9FF8, 0x6EF4, 0x9348, 0x6EF7, 0xE042, + 0x6EF8, 0x9FF5, 0x6EFE, 0x9FF6, 0x6EFF, 0x9FDE, 0x6F01, 0x8B99, 0x6F02, 0x9559, 0x6F06, 0x8EBD, 0x6F09, 0x8D97, 0x6F0F, 0x9852, + 0x6F11, 0x9FF2, 0x6F13, 0xE041, 0x6F14, 0x8989, 0x6F15, 0x9186, 0x6F20, 0x9499, 0x6F22, 0x8ABF, 0x6F23, 0x97F8, 0x6F2B, 0x969F, + 0x6F2C, 0x92D0, 0x6F31, 0x9FF9, 0x6F32, 0x9FFB, 0x6F38, 0x9151, 0x6F3E, 0xE040, 0x6F3F, 0x9FF7, 0x6F41, 0x9FF1, 0x6F45, 0x8AC1, + 0x6F54, 0x8C89, 0x6F58, 0xE04E, 0x6F5B, 0xE049, 0x6F5C, 0x90F6, 0x6F5F, 0x8A83, 0x6F64, 0x8F81, 0x6F66, 0xE052, 0x6F6D, 0xE04B, + 0x6F6E, 0x92AA, 0x6F6F, 0xE048, 0x6F70, 0x92D7, 0x6F74, 0xE06B, 0x6F78, 0xE045, 0x6F7A, 0xE044, 0x6F7C, 0xE04D, 0x6F80, 0xE047, + 0x6F81, 0xE046, 0x6F82, 0xE04C, 0x6F84, 0x909F, 0x6F86, 0xE043, 0x6F88, 0xFB4B, 0x6F8E, 0xE04F, 0x6F91, 0xE050, 0x6F97, 0x8AC0, + 0x6FA1, 0xE055, 0x6FA3, 0xE054, 0x6FA4, 0xE056, 0x6FAA, 0xE059, 0x6FB1, 0x9362, 0x6FB3, 0xE053, 0x6FB5, 0xFB4C, 0x6FB9, 0xE057, + 0x6FC0, 0x8C83, 0x6FC1, 0x91F7, 0x6FC2, 0xE051, 0x6FC3, 0x945A, 0x6FC6, 0xE058, 0x6FD4, 0xE05D, 0x6FD5, 0xE05B, 0x6FD8, 0xE05E, + 0x6FDB, 0xE061, 0x6FDF, 0xE05A, 0x6FE0, 0x8D8A, 0x6FE1, 0x9447, 0x6FE4, 0x9FB7, 0x6FEB, 0x9794, 0x6FEC, 0xE05C, 0x6FEE, 0xE060, + 0x6FEF, 0x91F3, 0x6FF1, 0xE05F, 0x6FF3, 0xE04A, 0x6FF5, 0xFB4D, 0x6FF6, 0xE889, 0x6FFA, 0xE064, 0x6FFE, 0xE068, 0x7001, 0xE066, + 0x7005, 0xFB4E, 0x7007, 0xFB4F, 0x7009, 0xE062, 0x700B, 0xE063, 0x700F, 0xE067, 0x7011, 0xE065, 0x7015, 0x956D, 0x7018, 0xE06D, + 0x701A, 0xE06A, 0x701B, 0xE069, 0x701D, 0xE06C, 0x701E, 0x93D2, 0x701F, 0xE06E, 0x7026, 0x9295, 0x7027, 0x91EB, 0x7028, 0xFB50, + 0x702C, 0x90A3, 0x7030, 0xE06F, 0x7032, 0xE071, 0x703E, 0xE070, 0x704C, 0x9FF3, 0x7051, 0xE072, 0x7058, 0x93E5, 0x7063, 0xE073, + 0x706B, 0x89CE, 0x706F, 0x9394, 0x7070, 0x8A44, 0x7078, 0x8B84, 0x707C, 0x8EDC, 0x707D, 0x8DD0, 0x7085, 0xFB51, 0x7089, 0x9846, + 0x708A, 0x9086, 0x708E, 0x898A, 0x7092, 0xE075, 0x7099, 0xE074, 0x70AB, 0xFB52, 0x70AC, 0xE078, 0x70AD, 0x9259, 0x70AE, 0xE07B, + 0x70AF, 0xE076, 0x70B3, 0xE07A, 0x70B8, 0xE079, 0x70B9, 0x935F, 0x70BA, 0x88D7, 0x70BB, 0xFA62, 0x70C8, 0x97F3, 0x70CB, 0xE07D, + 0x70CF, 0x8947, 0x70D9, 0xE080, 0x70DD, 0xE07E, 0x70DF, 0xE07C, 0x70F1, 0xE077, 0x70F9, 0x9642, 0x70FD, 0xE082, 0x7104, 0xFB54, + 0x7109, 0xE081, 0x710F, 0xFB53, 0x7114, 0x898B, 0x7119, 0xE084, 0x711A, 0x95B0, 0x711C, 0xE083, 0x7121, 0x96B3, 0x7126, 0x8FC5, + 0x7136, 0x9152, 0x713C, 0x8FC4, 0x7146, 0xFB56, 0x7147, 0xFB57, 0x7149, 0x97F9, 0x714C, 0xE08A, 0x714E, 0x90F7, 0x7155, 0xE086, + 0x7156, 0xE08B, 0x7159, 0x898C, 0x715C, 0xFB55, 0x7162, 0xE089, 0x7164, 0x9481, 0x7165, 0xE085, 0x7166, 0xE088, 0x7167, 0x8FC6, + 0x7169, 0x94CF, 0x716C, 0xE08C, 0x716E, 0x8ECF, 0x717D, 0x90F8, 0x7184, 0xE08F, 0x7188, 0xE087, 0x718A, 0x8C46, 0x718F, 0xE08D, + 0x7194, 0x976F, 0x7195, 0xE090, 0x7199, 0xEAA4, 0x719F, 0x8F6E, 0x71A8, 0xE091, 0x71AC, 0xE092, 0x71B1, 0x944D, 0x71B9, 0xE094, + 0x71BE, 0xE095, 0x71C1, 0xFB59, 0x71C3, 0x9452, 0x71C8, 0x9395, 0x71C9, 0xE097, 0x71CE, 0xE099, 0x71D0, 0x97D3, 0x71D2, 0xE096, + 0x71D4, 0xE098, 0x71D5, 0x898D, 0x71D7, 0xE093, 0x71DF, 0x9A7A, 0x71E0, 0xE09A, 0x71E5, 0x9187, 0x71E6, 0x8E57, 0x71E7, 0xE09C, + 0x71EC, 0xE09B, 0x71ED, 0x9043, 0x71EE, 0x99D7, 0x71F5, 0xE09D, 0x71F9, 0xE09F, 0x71FB, 0xE08E, 0x71FC, 0xE09E, 0x71FE, 0xFB5A, + 0x71FF, 0xE0A0, 0x7206, 0x949A, 0x720D, 0xE0A1, 0x7210, 0xE0A2, 0x721B, 0xE0A3, 0x7228, 0xE0A4, 0x722A, 0x92DC, 0x722C, 0xE0A6, + 0x722D, 0xE0A5, 0x7230, 0xE0A7, 0x7232, 0xE0A8, 0x7235, 0x8EDD, 0x7236, 0x9583, 0x723A, 0x96EA, 0x723B, 0xE0A9, 0x723C, 0xE0AA, + 0x723D, 0x9175, 0x723E, 0x8EA2, 0x723F, 0xE0AB, 0x7240, 0xE0AC, 0x7246, 0xE0AD, 0x7247, 0x95D0, 0x7248, 0x94C5, 0x724B, 0xE0AE, + 0x724C, 0x9476, 0x7252, 0x92AB, 0x7258, 0xE0AF, 0x7259, 0x89E5, 0x725B, 0x8B8D, 0x725D, 0x96C4, 0x725F, 0x96B4, 0x7261, 0x89B2, + 0x7262, 0x9853, 0x7267, 0x9671, 0x7269, 0x95A8, 0x7272, 0x90B5, 0x7274, 0xE0B0, 0x7279, 0x93C1, 0x727D, 0x8CA1, 0x727E, 0xE0B1, + 0x7280, 0x8DD2, 0x7281, 0xE0B3, 0x7282, 0xE0B2, 0x7287, 0xE0B4, 0x7292, 0xE0B5, 0x7296, 0xE0B6, 0x72A0, 0x8B5D, 0x72A2, 0xE0B7, + 0x72A7, 0xE0B8, 0x72AC, 0x8CA2, 0x72AF, 0x94C6, 0x72B1, 0xFB5B, 0x72B2, 0xE0BA, 0x72B6, 0x8FF3, 0x72B9, 0xE0B9, 0x72BE, 0xFB5C, + 0x72C2, 0x8BB6, 0x72C3, 0xE0BB, 0x72C4, 0xE0BD, 0x72C6, 0xE0BC, 0x72CE, 0xE0BE, 0x72D0, 0x8CCF, 0x72D2, 0xE0BF, 0x72D7, 0x8BE7, + 0x72D9, 0x915F, 0x72DB, 0x8D9D, 0x72E0, 0xE0C1, 0x72E1, 0xE0C2, 0x72E2, 0xE0C0, 0x72E9, 0x8EEB, 0x72EC, 0x93C6, 0x72ED, 0x8BB7, + 0x72F7, 0xE0C4, 0x72F8, 0x924B, 0x72F9, 0xE0C3, 0x72FC, 0x9854, 0x72FD, 0x9482, 0x730A, 0xE0C7, 0x7316, 0xE0C9, 0x7317, 0xE0C6, + 0x731B, 0x96D2, 0x731C, 0xE0C8, 0x731D, 0xE0CA, 0x731F, 0x97C2, 0x7324, 0xFB5D, 0x7325, 0xE0CE, 0x7329, 0xE0CD, 0x732A, 0x9296, + 0x732B, 0x944C, 0x732E, 0x8CA3, 0x732F, 0xE0CC, 0x7334, 0xE0CB, 0x7336, 0x9750, 0x7337, 0x9751, 0x733E, 0xE0CF, 0x733F, 0x898E, + 0x7344, 0x8D96, 0x7345, 0x8E82, 0x734E, 0xE0D0, 0x734F, 0xE0D1, 0x7357, 0xE0D3, 0x7363, 0x8F62, 0x7368, 0xE0D5, 0x736A, 0xE0D4, + 0x7370, 0xE0D6, 0x7372, 0x8A6C, 0x7375, 0xE0D8, 0x7377, 0xFB5F, 0x7378, 0xE0D7, 0x737A, 0xE0DA, 0x737B, 0xE0D9, 0x7384, 0x8CBA, + 0x7387, 0x97A6, 0x7389, 0x8BCA, 0x738B, 0x89A4, 0x7396, 0x8BE8, 0x73A9, 0x8ADF, 0x73B2, 0x97E6, 0x73B3, 0xE0DC, 0x73BB, 0xE0DE, + 0x73BD, 0xFB60, 0x73C0, 0xE0DF, 0x73C2, 0x89CF, 0x73C8, 0xE0DB, 0x73C9, 0xFB61, 0x73CA, 0x8E58, 0x73CD, 0x92BF, 0x73CE, 0xE0DD, + 0x73D2, 0xFB64, 0x73D6, 0xFB62, 0x73DE, 0xE0E2, 0x73E0, 0x8EEC, 0x73E3, 0xFB63, 0x73E5, 0xE0E0, 0x73EA, 0x8C5D, 0x73ED, 0x94C7, + 0x73EE, 0xE0E1, 0x73F1, 0xE0FC, 0x73F5, 0xFB66, 0x73F8, 0xE0E7, 0x73FE, 0x8CBB, 0x7403, 0x8B85, 0x7405, 0xE0E4, 0x7406, 0x979D, + 0x7407, 0xFB65, 0x7409, 0x97AE, 0x7422, 0x91F4, 0x7425, 0xE0E6, 0x7426, 0xFB67, 0x7429, 0xFB69, 0x742A, 0xFB68, 0x742E, 0xFB6A, + 0x7432, 0xE0E8, 0x7433, 0x97D4, 0x7434, 0x8BD5, 0x7435, 0x94FA, 0x7436, 0x9469, 0x743A, 0xE0E9, 0x743F, 0xE0EB, 0x7441, 0xE0EE, + 0x7455, 0xE0EA, 0x7459, 0xE0ED, 0x745A, 0x8CE8, 0x745B, 0x896C, 0x745C, 0xE0EF, 0x745E, 0x9090, 0x745F, 0xE0EC, 0x7460, 0x97DA, + 0x7462, 0xFB6B, 0x7463, 0xE0F2, 0x7464, 0xEAA2, 0x7469, 0xE0F0, 0x746A, 0xE0F3, 0x746F, 0xE0E5, 0x7470, 0xE0F1, 0x7473, 0x8DBA, + 0x7476, 0xE0F4, 0x747E, 0xE0F5, 0x7483, 0x979E, 0x7489, 0xFB6C, 0x748B, 0xE0F6, 0x749E, 0xE0F7, 0x749F, 0xFB6D, 0x74A2, 0xE0E3, + 0x74A7, 0xE0F8, 0x74B0, 0x8AC2, 0x74BD, 0x8EA3, 0x74CA, 0xE0F9, 0x74CF, 0xE0FA, 0x74D4, 0xE0FB, 0x74DC, 0x895A, 0x74E0, 0xE140, + 0x74E2, 0x955A, 0x74E3, 0xE141, 0x74E6, 0x8AA2, 0x74E7, 0xE142, 0x74E9, 0xE143, 0x74EE, 0xE144, 0x74F0, 0xE146, 0x74F1, 0xE147, + 0x74F2, 0xE145, 0x74F6, 0x9572, 0x74F7, 0xE149, 0x74F8, 0xE148, 0x7501, 0xFB6E, 0x7503, 0xE14B, 0x7504, 0xE14A, 0x7505, 0xE14C, + 0x750C, 0xE14D, 0x750D, 0xE14F, 0x750E, 0xE14E, 0x7511, 0x8D99, 0x7513, 0xE151, 0x7515, 0xE150, 0x7518, 0x8AC3, 0x751A, 0x9072, + 0x751C, 0x935B, 0x751E, 0xE152, 0x751F, 0x90B6, 0x7523, 0x8E59, 0x7525, 0x8999, 0x7526, 0xE153, 0x7528, 0x9770, 0x752B, 0x95E1, + 0x752C, 0xE154, 0x752F, 0xFAA8, 0x7530, 0x9363, 0x7531, 0x9752, 0x7532, 0x8D62, 0x7533, 0x905C, 0x7537, 0x926A, 0x7538, 0x99B2, + 0x753A, 0x92AC, 0x753B, 0x89E6, 0x753C, 0xE155, 0x7544, 0xE156, 0x7546, 0xE15B, 0x7549, 0xE159, 0x754A, 0xE158, 0x754B, 0x9DC0, + 0x754C, 0x8A45, 0x754D, 0xE157, 0x754F, 0x88D8, 0x7551, 0x94A8, 0x7554, 0x94C8, 0x7559, 0x97AF, 0x755A, 0xE15C, 0x755B, 0xE15A, + 0x755C, 0x927B, 0x755D, 0x90A4, 0x7560, 0x94A9, 0x7562, 0x954C, 0x7564, 0xE15E, 0x7565, 0x97AA, 0x7566, 0x8C6C, 0x7567, 0xE15F, + 0x7569, 0xE15D, 0x756A, 0x94D4, 0x756B, 0xE160, 0x756D, 0xE161, 0x756F, 0xFB6F, 0x7570, 0x88D9, 0x7573, 0x8FF4, 0x7574, 0xE166, + 0x7576, 0xE163, 0x7577, 0x93EB, 0x7578, 0xE162, 0x757F, 0x8B45, 0x7582, 0xE169, 0x7586, 0xE164, 0x7587, 0xE165, 0x7589, 0xE168, + 0x758A, 0xE167, 0x758B, 0x9544, 0x758E, 0x9161, 0x758F, 0x9160, 0x7591, 0x8B5E, 0x7594, 0xE16A, 0x759A, 0xE16B, 0x759D, 0xE16C, + 0x75A3, 0xE16E, 0x75A5, 0xE16D, 0x75AB, 0x8975, 0x75B1, 0xE176, 0x75B2, 0x94E6, 0x75B3, 0xE170, 0x75B5, 0xE172, 0x75B8, 0xE174, + 0x75B9, 0x905D, 0x75BC, 0xE175, 0x75BD, 0xE173, 0x75BE, 0x8EBE, 0x75C2, 0xE16F, 0x75C3, 0xE171, 0x75C5, 0x9561, 0x75C7, 0x8FC7, + 0x75CA, 0xE178, 0x75CD, 0xE177, 0x75D2, 0xE179, 0x75D4, 0x8EA4, 0x75D5, 0x8DAD, 0x75D8, 0x9397, 0x75D9, 0xE17A, 0x75DB, 0x92C9, + 0x75DE, 0xE17C, 0x75E2, 0x979F, 0x75E3, 0xE17B, 0x75E9, 0x9189, 0x75F0, 0xE182, 0x75F2, 0xE184, 0x75F3, 0xE185, 0x75F4, 0x9273, + 0x75FA, 0xE183, 0x75FC, 0xE180, 0x75FE, 0xE17D, 0x75FF, 0xE17E, 0x7601, 0xE181, 0x7609, 0xE188, 0x760B, 0xE186, 0x760D, 0xE187, + 0x761F, 0xE189, 0x7620, 0xE18B, 0x7621, 0xE18C, 0x7622, 0xE18D, 0x7624, 0xE18E, 0x7627, 0xE18A, 0x7630, 0xE190, 0x7634, 0xE18F, + 0x763B, 0xE191, 0x7642, 0x97C3, 0x7646, 0xE194, 0x7647, 0xE192, 0x7648, 0xE193, 0x764C, 0x8AE0, 0x7652, 0x96FC, 0x7656, 0x95C8, + 0x7658, 0xE196, 0x765C, 0xE195, 0x7661, 0xE197, 0x7662, 0xE198, 0x7667, 0xE19C, 0x7668, 0xE199, 0x7669, 0xE19A, 0x766A, 0xE19B, + 0x766C, 0xE19D, 0x7670, 0xE19E, 0x7672, 0xE19F, 0x7676, 0xE1A0, 0x7678, 0xE1A1, 0x767A, 0x94AD, 0x767B, 0x936F, 0x767C, 0xE1A2, + 0x767D, 0x9492, 0x767E, 0x9553, 0x7680, 0xE1A3, 0x7682, 0xFB70, 0x7683, 0xE1A4, 0x7684, 0x9349, 0x7686, 0x8A46, 0x7687, 0x8D63, + 0x7688, 0xE1A5, 0x768B, 0xE1A6, 0x768E, 0xE1A7, 0x7690, 0x8E48, 0x7693, 0xE1A9, 0x7696, 0xE1A8, 0x7699, 0xE1AA, 0x769A, 0xE1AB, + 0x769B, 0xFB73, 0x769C, 0xFB71, 0x769E, 0xFB72, 0x76A6, 0xFB74, 0x76AE, 0x94E7, 0x76B0, 0xE1AC, 0x76B4, 0xE1AD, 0x76B7, 0xEA89, + 0x76B8, 0xE1AE, 0x76B9, 0xE1AF, 0x76BA, 0xE1B0, 0x76BF, 0x8E4D, 0x76C2, 0xE1B1, 0x76C3, 0x9475, 0x76C6, 0x967E, 0x76C8, 0x896D, + 0x76CA, 0x8976, 0x76CD, 0xE1B2, 0x76D2, 0xE1B4, 0x76D6, 0xE1B3, 0x76D7, 0x9390, 0x76DB, 0x90B7, 0x76DC, 0x9F58, 0x76DE, 0xE1B5, + 0x76DF, 0x96BF, 0x76E1, 0xE1B6, 0x76E3, 0x8AC4, 0x76E4, 0x94D5, 0x76E5, 0xE1B7, 0x76E7, 0xE1B8, 0x76EA, 0xE1B9, 0x76EE, 0x96DA, + 0x76F2, 0x96D3, 0x76F4, 0x92BC, 0x76F8, 0x918A, 0x76FB, 0xE1BB, 0x76FE, 0x8F82, 0x7701, 0x8FC8, 0x7704, 0xE1BE, 0x7707, 0xE1BD, + 0x7708, 0xE1BC, 0x7709, 0x94FB, 0x770B, 0x8AC5, 0x770C, 0x8CA7, 0x771B, 0xE1C4, 0x771E, 0xE1C1, 0x771F, 0x905E, 0x7720, 0x96B0, + 0x7724, 0xE1C0, 0x7725, 0xE1C2, 0x7726, 0xE1C3, 0x7729, 0xE1BF, 0x7737, 0xE1C5, 0x7738, 0xE1C6, 0x773A, 0x92AD, 0x773C, 0x8AE1, + 0x7740, 0x9285, 0x7746, 0xFB76, 0x7747, 0xE1C7, 0x775A, 0xE1C8, 0x775B, 0xE1CB, 0x7761, 0x9087, 0x7763, 0x93C2, 0x7765, 0xE1CC, + 0x7766, 0x9672, 0x7768, 0xE1C9, 0x776B, 0xE1CA, 0x7779, 0xE1CF, 0x777E, 0xE1CE, 0x777F, 0xE1CD, 0x778B, 0xE1D1, 0x778E, 0xE1D0, + 0x7791, 0xE1D2, 0x779E, 0xE1D4, 0x77A0, 0xE1D3, 0x77A5, 0x95CB, 0x77AC, 0x8F75, 0x77AD, 0x97C4, 0x77B0, 0xE1D5, 0x77B3, 0x93B5, + 0x77B6, 0xE1D6, 0x77B9, 0xE1D7, 0x77BB, 0xE1DB, 0x77BC, 0xE1D9, 0x77BD, 0xE1DA, 0x77BF, 0xE1D8, 0x77C7, 0xE1DC, 0x77CD, 0xE1DD, + 0x77D7, 0xE1DE, 0x77DA, 0xE1DF, 0x77DB, 0x96B5, 0x77DC, 0xE1E0, 0x77E2, 0x96EE, 0x77E3, 0xE1E1, 0x77E5, 0x926D, 0x77E7, 0x948A, + 0x77E9, 0x8BE9, 0x77ED, 0x925A, 0x77EE, 0xE1E2, 0x77EF, 0x8BB8, 0x77F3, 0x90CE, 0x77FC, 0xE1E3, 0x7802, 0x8DBB, 0x780C, 0xE1E4, + 0x7812, 0xE1E5, 0x7814, 0x8CA4, 0x7815, 0x8DD3, 0x7820, 0xE1E7, 0x7821, 0xFB78, 0x7825, 0x9375, 0x7826, 0x8DD4, 0x7827, 0x8B6D, + 0x7832, 0x9643, 0x7834, 0x946A, 0x783A, 0x9376, 0x783F, 0x8D7B, 0x7845, 0xE1E9, 0x784E, 0xFB79, 0x785D, 0x8FC9, 0x7864, 0xFB7A, + 0x786B, 0x97B0, 0x786C, 0x8D64, 0x786F, 0x8CA5, 0x7872, 0x94A1, 0x7874, 0xE1EB, 0x787A, 0xFB7B, 0x787C, 0xE1ED, 0x7881, 0x8CE9, + 0x7886, 0xE1EC, 0x7887, 0x92F4, 0x788C, 0xE1EF, 0x788D, 0x8A56, 0x788E, 0xE1EA, 0x7891, 0x94E8, 0x7893, 0x894F, 0x7895, 0x8DEA, + 0x7897, 0x9871, 0x789A, 0xE1EE, 0x78A3, 0xE1F0, 0x78A7, 0x95C9, 0x78A9, 0x90D7, 0x78AA, 0xE1F2, 0x78AF, 0xE1F3, 0x78B5, 0xE1F1, + 0x78BA, 0x8A6D, 0x78BC, 0xE1F9, 0x78BE, 0xE1F8, 0x78C1, 0x8EA5, 0x78C5, 0xE1FA, 0x78C6, 0xE1F5, 0x78CA, 0xE1FB, 0x78CB, 0xE1F6, + 0x78D0, 0x94D6, 0x78D1, 0xE1F4, 0x78D4, 0xE1F7, 0x78DA, 0xE241, 0x78E7, 0xE240, 0x78E8, 0x9681, 0x78EC, 0xE1FC, 0x78EF, 0x88E9, + 0x78F4, 0xE243, 0x78FD, 0xE242, 0x7901, 0x8FCA, 0x7907, 0xE244, 0x790E, 0x9162, 0x7911, 0xE246, 0x7912, 0xE245, 0x7919, 0xE247, + 0x7926, 0xE1E6, 0x792A, 0xE1E8, 0x792B, 0xE249, 0x792C, 0xE248, 0x7930, 0xFB7C, 0x793A, 0x8EA6, 0x793C, 0x97E7, 0x793E, 0x8ED0, + 0x7940, 0xE24A, 0x7941, 0x8C56, 0x7947, 0x8B5F, 0x7948, 0x8B46, 0x7949, 0x8E83, 0x7950, 0x9753, 0x7953, 0xE250, 0x7955, 0xE24F, + 0x7956, 0x9163, 0x7957, 0xE24C, 0x795A, 0xE24E, 0x795D, 0x8F6A, 0x795E, 0x905F, 0x795F, 0xE24D, 0x7960, 0xE24B, 0x7962, 0x9449, + 0x7965, 0x8FCB, 0x7968, 0x955B, 0x796D, 0x8DD5, 0x7977, 0x9398, 0x797A, 0xE251, 0x797F, 0xE252, 0x7980, 0xE268, 0x7981, 0x8BD6, + 0x7984, 0x985C, 0x7985, 0x9154, 0x798A, 0xE253, 0x798D, 0x89D0, 0x798E, 0x92F5, 0x798F, 0x959F, 0x7994, 0xFB81, 0x799B, 0xFB83, + 0x799D, 0xE254, 0x79A6, 0x8B9A, 0x79A7, 0xE255, 0x79AA, 0xE257, 0x79AE, 0xE258, 0x79B0, 0x9448, 0x79B3, 0xE259, 0x79B9, 0xE25A, + 0x79BA, 0xE25B, 0x79BD, 0x8BD7, 0x79BE, 0x89D1, 0x79BF, 0x93C3, 0x79C0, 0x8F47, 0x79C1, 0x8E84, 0x79C9, 0xE25C, 0x79CB, 0x8F48, + 0x79D1, 0x89C8, 0x79D2, 0x9562, 0x79D5, 0xE25D, 0x79D8, 0x94E9, 0x79DF, 0x9164, 0x79E1, 0xE260, 0x79E3, 0xE261, 0x79E4, 0x9489, + 0x79E6, 0x9060, 0x79E7, 0xE25E, 0x79E9, 0x9281, 0x79EC, 0xE25F, 0x79F0, 0x8FCC, 0x79FB, 0x88DA, 0x7A00, 0x8B48, 0x7A08, 0xE262, + 0x7A0B, 0x92F6, 0x7A0D, 0xE263, 0x7A0E, 0x90C5, 0x7A14, 0x96AB, 0x7A17, 0x9542, 0x7A18, 0xE264, 0x7A19, 0xE265, 0x7A1A, 0x9274, + 0x7A1C, 0x97C5, 0x7A1F, 0xE267, 0x7A20, 0xE266, 0x7A2E, 0x8EED, 0x7A31, 0xE269, 0x7A32, 0x88EE, 0x7A37, 0xE26C, 0x7A3B, 0xE26A, + 0x7A3C, 0x89D2, 0x7A3D, 0x8C6D, 0x7A3E, 0xE26B, 0x7A3F, 0x8D65, 0x7A40, 0x8D92, 0x7A42, 0x95E4, 0x7A43, 0xE26D, 0x7A46, 0x9673, + 0x7A49, 0xE26F, 0x7A4D, 0x90CF, 0x7A4E, 0x896E, 0x7A4F, 0x89B8, 0x7A50, 0x88AA, 0x7A57, 0xE26E, 0x7A61, 0xE270, 0x7A62, 0xE271, + 0x7A63, 0x8FF5, 0x7A69, 0xE272, 0x7A6B, 0x8A6E, 0x7A70, 0xE274, 0x7A74, 0x8C8A, 0x7A76, 0x8B86, 0x7A79, 0xE275, 0x7A7A, 0x8BF3, + 0x7A7D, 0xE276, 0x7A7F, 0x90FA, 0x7A81, 0x93CB, 0x7A83, 0x90DE, 0x7A84, 0x8DF3, 0x7A88, 0xE277, 0x7A92, 0x9282, 0x7A93, 0x918B, + 0x7A95, 0xE279, 0x7A96, 0xE27B, 0x7A97, 0xE278, 0x7A98, 0xE27A, 0x7A9F, 0x8C41, 0x7AA9, 0xE27C, 0x7AAA, 0x8C45, 0x7AAE, 0x8B87, + 0x7AAF, 0x9771, 0x7AB0, 0xE27E, 0x7AB6, 0xE280, 0x7ABA, 0x894D, 0x7ABF, 0xE283, 0x7AC3, 0x8A96, 0x7AC4, 0xE282, 0x7AC5, 0xE281, + 0x7AC7, 0xE285, 0x7AC8, 0xE27D, 0x7ACA, 0xE286, 0x7ACB, 0x97A7, 0x7ACD, 0xE287, 0x7ACF, 0xE288, 0x7AD1, 0xFB84, 0x7AD2, 0x9AF2, + 0x7AD3, 0xE28A, 0x7AD5, 0xE289, 0x7AD9, 0xE28B, 0x7ADA, 0xE28C, 0x7ADC, 0x97B3, 0x7ADD, 0xE28D, 0x7ADF, 0xE8ED, 0x7AE0, 0x8FCD, + 0x7AE1, 0xE28E, 0x7AE2, 0xE28F, 0x7AE3, 0x8F76, 0x7AE5, 0x93B6, 0x7AE6, 0xE290, 0x7AE7, 0xFB85, 0x7AEA, 0x9247, 0x7AEB, 0xFB87, + 0x7AED, 0xE291, 0x7AEF, 0x925B, 0x7AF0, 0xE292, 0x7AF6, 0x8BA3, 0x7AF8, 0x995E, 0x7AF9, 0x927C, 0x7AFA, 0x8EB1, 0x7AFF, 0x8AC6, + 0x7B02, 0xE293, 0x7B04, 0xE2A0, 0x7B06, 0xE296, 0x7B08, 0x8B88, 0x7B0A, 0xE295, 0x7B0B, 0xE2A2, 0x7B0F, 0xE294, 0x7B11, 0x8FCE, + 0x7B18, 0xE298, 0x7B19, 0xE299, 0x7B1B, 0x934A, 0x7B1E, 0xE29A, 0x7B20, 0x8A7D, 0x7B25, 0x9079, 0x7B26, 0x9584, 0x7B28, 0xE29C, + 0x7B2C, 0x91E6, 0x7B33, 0xE297, 0x7B35, 0xE29B, 0x7B36, 0xE29D, 0x7B39, 0x8DF9, 0x7B45, 0xE2A4, 0x7B46, 0x954D, 0x7B48, 0x94A4, + 0x7B49, 0x9399, 0x7B4B, 0x8BD8, 0x7B4C, 0xE2A3, 0x7B4D, 0xE2A1, 0x7B4F, 0x94B3, 0x7B50, 0xE29E, 0x7B51, 0x927D, 0x7B52, 0x939B, + 0x7B54, 0x939A, 0x7B56, 0x8DF4, 0x7B5D, 0xE2B6, 0x7B65, 0xE2A6, 0x7B67, 0xE2A8, 0x7B6C, 0xE2AB, 0x7B6E, 0xE2AC, 0x7B70, 0xE2A9, + 0x7B71, 0xE2AA, 0x7B74, 0xE2A7, 0x7B75, 0xE2A5, 0x7B7A, 0xE29F, 0x7B86, 0x95CD, 0x7B87, 0x89D3, 0x7B8B, 0xE2B3, 0x7B8D, 0xE2B0, + 0x7B8F, 0xE2B5, 0x7B92, 0xE2B4, 0x7B94, 0x9493, 0x7B95, 0x96A5, 0x7B97, 0x8E5A, 0x7B98, 0xE2AE, 0x7B99, 0xE2B7, 0x7B9A, 0xE2B2, + 0x7B9C, 0xE2B1, 0x7B9D, 0xE2AD, 0x7B9E, 0xFB88, 0x7B9F, 0xE2AF, 0x7BA1, 0x8AC7, 0x7BAA, 0x925C, 0x7BAD, 0x90FB, 0x7BB1, 0x94A0, + 0x7BB4, 0xE2BC, 0x7BB8, 0x94A2, 0x7BC0, 0x90DF, 0x7BC1, 0xE2B9, 0x7BC4, 0x94CD, 0x7BC6, 0xE2BD, 0x7BC7, 0x95D1, 0x7BC9, 0x927A, + 0x7BCB, 0xE2B8, 0x7BCC, 0xE2BA, 0x7BCF, 0xE2BB, 0x7BDD, 0xE2BE, 0x7BE0, 0x8EC2, 0x7BE4, 0x93C4, 0x7BE5, 0xE2C3, 0x7BE6, 0xE2C2, + 0x7BE9, 0xE2BF, 0x7BED, 0x9855, 0x7BF3, 0xE2C8, 0x7BF6, 0xE2CC, 0x7BF7, 0xE2C9, 0x7C00, 0xE2C5, 0x7C07, 0xE2C6, 0x7C0D, 0xE2CB, + 0x7C11, 0xE2C0, 0x7C12, 0x99D3, 0x7C13, 0xE2C7, 0x7C14, 0xE2C1, 0x7C17, 0xE2CA, 0x7C1F, 0xE2D0, 0x7C21, 0x8AC8, 0x7C23, 0xE2CD, + 0x7C27, 0xE2CE, 0x7C2A, 0xE2CF, 0x7C2B, 0xE2D2, 0x7C37, 0xE2D1, 0x7C38, 0x94F4, 0x7C3D, 0xE2D3, 0x7C3E, 0x97FA, 0x7C3F, 0x95EB, + 0x7C40, 0xE2D8, 0x7C43, 0xE2D5, 0x7C4C, 0xE2D4, 0x7C4D, 0x90D0, 0x7C4F, 0xE2D7, 0x7C50, 0xE2D9, 0x7C54, 0xE2D6, 0x7C56, 0xE2DD, + 0x7C58, 0xE2DA, 0x7C5F, 0xE2DB, 0x7C60, 0xE2C4, 0x7C64, 0xE2DC, 0x7C65, 0xE2DE, 0x7C6C, 0xE2DF, 0x7C73, 0x95C4, 0x7C75, 0xE2E0, + 0x7C7E, 0x96E0, 0x7C81, 0x8BCC, 0x7C82, 0x8C48, 0x7C83, 0xE2E1, 0x7C89, 0x95B2, 0x7C8B, 0x9088, 0x7C8D, 0x96AE, 0x7C90, 0xE2E2, + 0x7C92, 0x97B1, 0x7C95, 0x9494, 0x7C97, 0x9165, 0x7C98, 0x9453, 0x7C9B, 0x8F6C, 0x7C9F, 0x88BE, 0x7CA1, 0xE2E7, 0x7CA2, 0xE2E5, + 0x7CA4, 0xE2E3, 0x7CA5, 0x8A9F, 0x7CA7, 0x8FCF, 0x7CA8, 0xE2E8, 0x7CAB, 0xE2E6, 0x7CAD, 0xE2E4, 0x7CAE, 0xE2EC, 0x7CB1, 0xE2EB, + 0x7CB2, 0xE2EA, 0x7CB3, 0xE2E9, 0x7CB9, 0xE2ED, 0x7CBD, 0xE2EE, 0x7CBE, 0x90B8, 0x7CC0, 0xE2EF, 0x7CC2, 0xE2F1, 0x7CC5, 0xE2F0, + 0x7CCA, 0x8CD0, 0x7CCE, 0x9157, 0x7CD2, 0xE2F3, 0x7CD6, 0x939C, 0x7CD8, 0xE2F2, 0x7CDC, 0xE2F4, 0x7CDE, 0x95B3, 0x7CDF, 0x918C, + 0x7CE0, 0x8D66, 0x7CE2, 0xE2F5, 0x7CE7, 0x97C6, 0x7CEF, 0xE2F7, 0x7CF2, 0xE2F8, 0x7CF4, 0xE2F9, 0x7CF6, 0xE2FA, 0x7CF8, 0x8E85, + 0x7CFA, 0xE2FB, 0x7CFB, 0x8C6E, 0x7CFE, 0x8B8A, 0x7D00, 0x8B49, 0x7D02, 0xE340, 0x7D04, 0x96F1, 0x7D05, 0x8D67, 0x7D06, 0xE2FC, + 0x7D0A, 0xE343, 0x7D0B, 0x96E4, 0x7D0D, 0x945B, 0x7D10, 0x9552, 0x7D14, 0x8F83, 0x7D15, 0xE342, 0x7D17, 0x8ED1, 0x7D18, 0x8D68, + 0x7D19, 0x8E86, 0x7D1A, 0x8B89, 0x7D1B, 0x95B4, 0x7D1C, 0xE341, 0x7D20, 0x9166, 0x7D21, 0x9661, 0x7D22, 0x8DF5, 0x7D2B, 0x8E87, + 0x7D2C, 0x92DB, 0x7D2E, 0xE346, 0x7D2F, 0x97DD, 0x7D30, 0x8DD7, 0x7D32, 0xE347, 0x7D33, 0x9061, 0x7D35, 0xE349, 0x7D39, 0x8FD0, + 0x7D3A, 0x8DAE, 0x7D3F, 0xE348, 0x7D42, 0x8F49, 0x7D43, 0x8CBC, 0x7D44, 0x9167, 0x7D45, 0xE344, 0x7D46, 0xE34A, 0x7D48, 0xFB8A, + 0x7D4B, 0xE345, 0x7D4C, 0x8C6F, 0x7D4E, 0xE34D, 0x7D4F, 0xE351, 0x7D50, 0x8C8B, 0x7D56, 0xE34C, 0x7D5B, 0xE355, 0x7D5C, 0xFB8B, + 0x7D5E, 0x8D69, 0x7D61, 0x978D, 0x7D62, 0x88BA, 0x7D63, 0xE352, 0x7D66, 0x8B8B, 0x7D68, 0xE34F, 0x7D6E, 0xE350, 0x7D71, 0x939D, + 0x7D72, 0xE34E, 0x7D73, 0xE34B, 0x7D75, 0x8A47, 0x7D76, 0x90E2, 0x7D79, 0x8CA6, 0x7D7D, 0xE357, 0x7D89, 0xE354, 0x7D8F, 0xE356, + 0x7D93, 0xE353, 0x7D99, 0x8C70, 0x7D9A, 0x91B1, 0x7D9B, 0xE358, 0x7D9C, 0x918E, 0x7D9F, 0xE365, 0x7DA0, 0xFB8D, 0x7DA2, 0xE361, + 0x7DA3, 0xE35B, 0x7DAB, 0xE35F, 0x7DAC, 0x8EF8, 0x7DAD, 0x88DB, 0x7DAE, 0xE35A, 0x7DAF, 0xE362, 0x7DB0, 0xE366, 0x7DB1, 0x8D6A, + 0x7DB2, 0x96D4, 0x7DB4, 0x92D4, 0x7DB5, 0xE35C, 0x7DB7, 0xFB8C, 0x7DB8, 0xE364, 0x7DBA, 0xE359, 0x7DBB, 0x925D, 0x7DBD, 0xE35E, + 0x7DBE, 0x88BB, 0x7DBF, 0x96C8, 0x7DC7, 0xE35D, 0x7DCA, 0x8BD9, 0x7DCB, 0x94EA, 0x7DCF, 0x918D, 0x7DD1, 0x97CE, 0x7DD2, 0x8F8F, + 0x7DD5, 0xE38E, 0x7DD6, 0xFB8E, 0x7DD8, 0xE367, 0x7DDA, 0x90FC, 0x7DDC, 0xE363, 0x7DDD, 0xE368, 0x7DDE, 0xE36A, 0x7DE0, 0x92F7, + 0x7DE1, 0xE36D, 0x7DE4, 0xE369, 0x7DE8, 0x95D2, 0x7DE9, 0x8AC9, 0x7DEC, 0x96C9, 0x7DEF, 0x88DC, 0x7DF2, 0xE36C, 0x7DF4, 0x97FB, + 0x7DFB, 0xE36B, 0x7E01, 0x898F, 0x7E04, 0x93EA, 0x7E05, 0xE36E, 0x7E09, 0xE375, 0x7E0A, 0xE36F, 0x7E0B, 0xE376, 0x7E12, 0xE372, + 0x7E1B, 0x949B, 0x7E1E, 0x8EC8, 0x7E1F, 0xE374, 0x7E21, 0xE371, 0x7E22, 0xE377, 0x7E23, 0xE370, 0x7E26, 0x8F63, 0x7E2B, 0x9644, + 0x7E2E, 0x8F6B, 0x7E31, 0xE373, 0x7E32, 0xE380, 0x7E35, 0xE37B, 0x7E37, 0xE37E, 0x7E39, 0xE37C, 0x7E3A, 0xE381, 0x7E3B, 0xE37A, + 0x7E3D, 0xE360, 0x7E3E, 0x90D1, 0x7E41, 0x94C9, 0x7E43, 0xE37D, 0x7E46, 0xE378, 0x7E4A, 0x9140, 0x7E4B, 0x8C71, 0x7E4D, 0x8F4A, + 0x7E52, 0xFB8F, 0x7E54, 0x9044, 0x7E55, 0x9155, 0x7E56, 0xE384, 0x7E59, 0xE386, 0x7E5A, 0xE387, 0x7E5D, 0xE383, 0x7E5E, 0xE385, + 0x7E66, 0xE379, 0x7E67, 0xE382, 0x7E69, 0xE38A, 0x7E6A, 0xE389, 0x7E6D, 0x969A, 0x7E70, 0x8C4A, 0x7E79, 0xE388, 0x7E7B, 0xE38C, + 0x7E7C, 0xE38B, 0x7E7D, 0xE38F, 0x7E7F, 0xE391, 0x7E82, 0x8E5B, 0x7E83, 0xE38D, 0x7E88, 0xE392, 0x7E89, 0xE393, 0x7E8A, 0xFA5C, + 0x7E8C, 0xE394, 0x7E8E, 0xE39A, 0x7E8F, 0x935A, 0x7E90, 0xE396, 0x7E92, 0xE395, 0x7E93, 0xE397, 0x7E94, 0xE398, 0x7E96, 0xE399, + 0x7E9B, 0xE39B, 0x7E9C, 0xE39C, 0x7F36, 0x8ACA, 0x7F38, 0xE39D, 0x7F3A, 0xE39E, 0x7F45, 0xE39F, 0x7F47, 0xFB90, 0x7F4C, 0xE3A0, + 0x7F4D, 0xE3A1, 0x7F4E, 0xE3A2, 0x7F50, 0xE3A3, 0x7F51, 0xE3A4, 0x7F54, 0xE3A6, 0x7F55, 0xE3A5, 0x7F58, 0xE3A7, 0x7F5F, 0xE3A8, + 0x7F60, 0xE3A9, 0x7F67, 0xE3AC, 0x7F68, 0xE3AA, 0x7F69, 0xE3AB, 0x7F6A, 0x8DDF, 0x7F6B, 0x8C72, 0x7F6E, 0x9275, 0x7F70, 0x94B1, + 0x7F72, 0x8F90, 0x7F75, 0x946C, 0x7F77, 0x94EB, 0x7F78, 0xE3AD, 0x7F79, 0x9CEB, 0x7F82, 0xE3AE, 0x7F83, 0xE3B0, 0x7F85, 0x9785, + 0x7F86, 0xE3AF, 0x7F87, 0xE3B2, 0x7F88, 0xE3B1, 0x7F8A, 0x9772, 0x7F8C, 0xE3B3, 0x7F8E, 0x94FC, 0x7F94, 0xE3B4, 0x7F9A, 0xE3B7, + 0x7F9D, 0xE3B6, 0x7F9E, 0xE3B5, 0x7FA1, 0xFB91, 0x7FA3, 0xE3B8, 0x7FA4, 0x8C51, 0x7FA8, 0x9141, 0x7FA9, 0x8B60, 0x7FAE, 0xE3BC, + 0x7FAF, 0xE3B9, 0x7FB2, 0xE3BA, 0x7FB6, 0xE3BD, 0x7FB8, 0xE3BE, 0x7FB9, 0xE3BB, 0x7FBD, 0x8948, 0x7FC1, 0x89A5, 0x7FC5, 0xE3C0, + 0x7FC6, 0xE3C1, 0x7FCA, 0xE3C2, 0x7FCC, 0x9782, 0x7FD2, 0x8F4B, 0x7FD4, 0xE3C4, 0x7FD5, 0xE3C3, 0x7FE0, 0x9089, 0x7FE1, 0xE3C5, + 0x7FE6, 0xE3C6, 0x7FE9, 0xE3C7, 0x7FEB, 0x8AE3, 0x7FF0, 0x8ACB, 0x7FF3, 0xE3C8, 0x7FF9, 0xE3C9, 0x7FFB, 0x967C, 0x7FFC, 0x9783, + 0x8000, 0x9773, 0x8001, 0x9856, 0x8003, 0x8D6C, 0x8004, 0xE3CC, 0x8005, 0x8ED2, 0x8006, 0xE3CB, 0x800B, 0xE3CD, 0x800C, 0x8EA7, + 0x8010, 0x91CF, 0x8012, 0xE3CE, 0x8015, 0x8D6B, 0x8017, 0x96D5, 0x8018, 0xE3CF, 0x8019, 0xE3D0, 0x801C, 0xE3D1, 0x8021, 0xE3D2, + 0x8028, 0xE3D3, 0x8033, 0x8EA8, 0x8036, 0x96EB, 0x803B, 0xE3D5, 0x803D, 0x925E, 0x803F, 0xE3D4, 0x8046, 0xE3D7, 0x804A, 0xE3D6, + 0x8052, 0xE3D8, 0x8056, 0x90B9, 0x8058, 0xE3D9, 0x805A, 0xE3DA, 0x805E, 0x95B7, 0x805F, 0xE3DB, 0x8061, 0x918F, 0x8062, 0xE3DC, + 0x8068, 0xE3DD, 0x806F, 0x97FC, 0x8070, 0xE3E0, 0x8072, 0xE3DF, 0x8073, 0xE3DE, 0x8074, 0x92AE, 0x8076, 0xE3E1, 0x8077, 0x9045, + 0x8079, 0xE3E2, 0x807D, 0xE3E3, 0x807E, 0x9857, 0x807F, 0xE3E4, 0x8084, 0xE3E5, 0x8085, 0xE3E7, 0x8086, 0xE3E6, 0x8087, 0x94A3, + 0x8089, 0x93F7, 0x808B, 0x985D, 0x808C, 0x94A7, 0x8093, 0xE3E9, 0x8096, 0x8FD1, 0x8098, 0x9549, 0x809A, 0xE3EA, 0x809B, 0xE3E8, + 0x809D, 0x8ACC, 0x80A1, 0x8CD2, 0x80A2, 0x8E88, 0x80A5, 0x94EC, 0x80A9, 0x8CA8, 0x80AA, 0x9662, 0x80AC, 0xE3ED, 0x80AD, 0xE3EB, + 0x80AF, 0x8D6D, 0x80B1, 0x8D6E, 0x80B2, 0x88E7, 0x80B4, 0x8DE6, 0x80BA, 0x9478, 0x80C3, 0x88DD, 0x80C4, 0xE3F2, 0x80C6, 0x925F, + 0x80CC, 0x9477, 0x80CE, 0x91D9, 0x80D6, 0xE3F4, 0x80D9, 0xE3F0, 0x80DA, 0xE3F3, 0x80DB, 0xE3EE, 0x80DD, 0xE3F1, 0x80DE, 0x9645, + 0x80E1, 0x8CD3, 0x80E4, 0x88FB, 0x80E5, 0xE3EF, 0x80EF, 0xE3F6, 0x80F1, 0xE3F7, 0x80F4, 0x93B7, 0x80F8, 0x8BB9, 0x80FC, 0xE445, + 0x80FD, 0x945C, 0x8102, 0x8E89, 0x8105, 0x8BBA, 0x8106, 0x90C6, 0x8107, 0x9865, 0x8108, 0x96AC, 0x8109, 0xE3F5, 0x810A, 0x90D2, + 0x811A, 0x8B72, 0x811B, 0xE3F8, 0x8123, 0xE3FA, 0x8129, 0xE3F9, 0x812F, 0xE3FB, 0x8131, 0x9245, 0x8133, 0x945D, 0x8139, 0x92AF, + 0x813E, 0xE442, 0x8146, 0xE441, 0x814B, 0xE3FC, 0x814E, 0x9074, 0x8150, 0x9585, 0x8151, 0xE444, 0x8153, 0xE443, 0x8154, 0x8D6F, + 0x8155, 0x9872, 0x815F, 0xE454, 0x8165, 0xE448, 0x8166, 0xE449, 0x816B, 0x8EEE, 0x816E, 0xE447, 0x8170, 0x8D98, 0x8171, 0xE446, + 0x8174, 0xE44A, 0x8178, 0x92B0, 0x8179, 0x95A0, 0x817A, 0x9142, 0x817F, 0x91DA, 0x8180, 0xE44E, 0x8182, 0xE44F, 0x8183, 0xE44B, + 0x8188, 0xE44C, 0x818A, 0xE44D, 0x818F, 0x8D70, 0x8193, 0xE455, 0x8195, 0xE451, 0x819A, 0x9586, 0x819C, 0x968C, 0x819D, 0x9547, + 0x81A0, 0xE450, 0x81A3, 0xE453, 0x81A4, 0xE452, 0x81A8, 0x9663, 0x81A9, 0xE456, 0x81B0, 0xE457, 0x81B3, 0x9156, 0x81B5, 0xE458, + 0x81B8, 0xE45A, 0x81BA, 0xE45E, 0x81BD, 0xE45B, 0x81BE, 0xE459, 0x81BF, 0x945E, 0x81C0, 0xE45C, 0x81C2, 0xE45D, 0x81C6, 0x89B0, + 0x81C8, 0xE464, 0x81C9, 0xE45F, 0x81CD, 0xE460, 0x81D1, 0xE461, 0x81D3, 0x919F, 0x81D8, 0xE463, 0x81D9, 0xE462, 0x81DA, 0xE465, + 0x81DF, 0xE466, 0x81E0, 0xE467, 0x81E3, 0x9062, 0x81E5, 0x89E7, 0x81E7, 0xE468, 0x81E8, 0x97D5, 0x81EA, 0x8EA9, 0x81ED, 0x8F4C, + 0x81F3, 0x8E8A, 0x81F4, 0x9276, 0x81FA, 0xE469, 0x81FB, 0xE46A, 0x81FC, 0x8950, 0x81FE, 0xE46B, 0x8201, 0xE46C, 0x8202, 0xE46D, + 0x8205, 0xE46E, 0x8207, 0xE46F, 0x8208, 0x8BBB, 0x8209, 0x9DA8, 0x820A, 0xE470, 0x820C, 0x90E3, 0x820D, 0xE471, 0x820E, 0x8EC9, + 0x8210, 0xE472, 0x8212, 0x98AE, 0x8216, 0xE473, 0x8217, 0x95DC, 0x8218, 0x8ADA, 0x821B, 0x9143, 0x821C, 0x8F77, 0x821E, 0x9591, + 0x821F, 0x8F4D, 0x8229, 0xE474, 0x822A, 0x8D71, 0x822B, 0xE475, 0x822C, 0x94CA, 0x822E, 0xE484, 0x8233, 0xE477, 0x8235, 0x91C7, + 0x8236, 0x9495, 0x8237, 0x8CBD, 0x8238, 0xE476, 0x8239, 0x9144, 0x8240, 0xE478, 0x8247, 0x92F8, 0x8258, 0xE47A, 0x8259, 0xE479, + 0x825A, 0xE47C, 0x825D, 0xE47B, 0x825F, 0xE47D, 0x8262, 0xE480, 0x8264, 0xE47E, 0x8266, 0x8ACD, 0x8268, 0xE481, 0x826A, 0xE482, + 0x826B, 0xE483, 0x826E, 0x8DAF, 0x826F, 0x97C7, 0x8271, 0xE485, 0x8272, 0x9046, 0x8276, 0x8990, 0x8277, 0xE486, 0x8278, 0xE487, + 0x827E, 0xE488, 0x828B, 0x88F0, 0x828D, 0xE489, 0x8292, 0xE48A, 0x8299, 0x9587, 0x829D, 0x8EC5, 0x829F, 0xE48C, 0x82A5, 0x8A48, + 0x82A6, 0x88B0, 0x82AB, 0xE48B, 0x82AC, 0xE48E, 0x82AD, 0x946D, 0x82AF, 0x9063, 0x82B1, 0x89D4, 0x82B3, 0x9646, 0x82B8, 0x8C7C, + 0x82B9, 0x8BDA, 0x82BB, 0xE48D, 0x82BD, 0x89E8, 0x82C5, 0x8AA1, 0x82D1, 0x8991, 0x82D2, 0xE492, 0x82D3, 0x97E8, 0x82D4, 0x91DB, + 0x82D7, 0x9563, 0x82D9, 0xE49E, 0x82DB, 0x89D5, 0x82DC, 0xE49C, 0x82DE, 0xE49A, 0x82DF, 0xE491, 0x82E1, 0xE48F, 0x82E3, 0xE490, + 0x82E5, 0x8EE1, 0x82E6, 0x8BEA, 0x82E7, 0x9297, 0x82EB, 0x93CF, 0x82F1, 0x8970, 0x82F3, 0xE494, 0x82F4, 0xE493, 0x82F9, 0xE499, + 0x82FA, 0xE495, 0x82FB, 0xE498, 0x8301, 0xFB93, 0x8302, 0x96CE, 0x8303, 0xE497, 0x8304, 0x89D6, 0x8305, 0x8A9D, 0x8306, 0xE49B, + 0x8309, 0xE49D, 0x830E, 0x8C73, 0x8316, 0xE4A1, 0x8317, 0xE4AA, 0x8318, 0xE4AB, 0x831C, 0x88A9, 0x8323, 0xE4B2, 0x8328, 0x88EF, + 0x832B, 0xE4A9, 0x832F, 0xE4A8, 0x8331, 0xE4A3, 0x8332, 0xE4A2, 0x8334, 0xE4A0, 0x8335, 0xE49F, 0x8336, 0x9283, 0x8338, 0x91F9, + 0x8339, 0xE4A5, 0x8340, 0xE4A4, 0x8345, 0xE4A7, 0x8349, 0x9190, 0x834A, 0x8C74, 0x834F, 0x8960, 0x8350, 0xE4A6, 0x8352, 0x8D72, + 0x8358, 0x9191, 0x8362, 0xFB94, 0x8373, 0xE4B8, 0x8375, 0xE4B9, 0x8377, 0x89D7, 0x837B, 0x89AC, 0x837C, 0xE4B6, 0x837F, 0xFB95, + 0x8385, 0xE4AC, 0x8387, 0xE4B4, 0x8389, 0xE4BB, 0x838A, 0xE4B5, 0x838E, 0xE4B3, 0x8393, 0xE496, 0x8396, 0xE4B1, 0x839A, 0xE4AD, + 0x839E, 0x8ACE, 0x839F, 0xE4AF, 0x83A0, 0xE4BA, 0x83A2, 0xE4B0, 0x83A8, 0xE4BC, 0x83AA, 0xE4AE, 0x83AB, 0x949C, 0x83B1, 0x9789, + 0x83B5, 0xE4B7, 0x83BD, 0xE4CD, 0x83C1, 0xE4C5, 0x83C5, 0x909B, 0x83C7, 0xFB96, 0x83CA, 0x8B65, 0x83CC, 0x8BDB, 0x83CE, 0xE4C0, + 0x83D3, 0x89D9, 0x83D6, 0x8FD2, 0x83D8, 0xE4C3, 0x83DC, 0x8DD8, 0x83DF, 0x9370, 0x83E0, 0xE4C8, 0x83E9, 0x95EC, 0x83EB, 0xE4BF, + 0x83EF, 0x89D8, 0x83F0, 0x8CD4, 0x83F1, 0x9548, 0x83F2, 0xE4C9, 0x83F4, 0xE4BD, 0x83F6, 0xFB97, 0x83F7, 0xE4C6, 0x83FB, 0xE4D0, + 0x83FD, 0xE4C1, 0x8403, 0xE4C2, 0x8404, 0x93B8, 0x8407, 0xE4C7, 0x840B, 0xE4C4, 0x840C, 0x9647, 0x840D, 0xE4CA, 0x840E, 0x88DE, + 0x8413, 0xE4BE, 0x8420, 0xE4CC, 0x8422, 0xE4CB, 0x8429, 0x948B, 0x842A, 0xE4D2, 0x842C, 0xE4DD, 0x8431, 0x8A9E, 0x8435, 0xE4E0, + 0x8438, 0xE4CE, 0x843C, 0xE4D3, 0x843D, 0x978E, 0x8446, 0xE4DC, 0x8448, 0xFB98, 0x8449, 0x9774, 0x844E, 0x97A8, 0x8457, 0x9298, + 0x845B, 0x8A8B, 0x8461, 0x9592, 0x8462, 0xE4E2, 0x8463, 0x939F, 0x8466, 0x88AF, 0x8469, 0xE4DB, 0x846B, 0xE4D7, 0x846C, 0x9192, + 0x846D, 0xE4D1, 0x846E, 0xE4D9, 0x846F, 0xE4DE, 0x8471, 0x944B, 0x8475, 0x88A8, 0x8477, 0xE4D6, 0x8479, 0xE4DF, 0x847A, 0x9598, + 0x8482, 0xE4DA, 0x8484, 0xE4D5, 0x848B, 0x8FD3, 0x8490, 0x8F4E, 0x8494, 0x8EAA, 0x8499, 0x96D6, 0x849C, 0x9566, 0x849F, 0xE4E5, + 0x84A1, 0xE4EE, 0x84AD, 0xE4D8, 0x84B2, 0x8A97, 0x84B4, 0xFB99, 0x84B8, 0x8FF6, 0x84B9, 0xE4E3, 0x84BB, 0xE4E8, 0x84BC, 0x9193, + 0x84BF, 0xE4E4, 0x84C1, 0xE4EB, 0x84C4, 0x927E, 0x84C6, 0xE4EC, 0x84C9, 0x9775, 0x84CA, 0xE4E1, 0x84CB, 0x8A57, 0x84CD, 0xE4E7, + 0x84D0, 0xE4EA, 0x84D1, 0x96AA, 0x84D6, 0xE4ED, 0x84D9, 0xE4E6, 0x84DA, 0xE4E9, 0x84DC, 0xFA60, 0x84EC, 0x9648, 0x84EE, 0x9840, + 0x84F4, 0xE4F1, 0x84FC, 0xE4F8, 0x84FF, 0xE4F0, 0x8500, 0x8EC1, 0x8506, 0xE4CF, 0x8511, 0x95CC, 0x8513, 0x96A0, 0x8514, 0xE4F7, + 0x8515, 0xE4F6, 0x8517, 0xE4F2, 0x8518, 0xE4F3, 0x851A, 0x8955, 0x851F, 0xE4F5, 0x8521, 0xE4EF, 0x8526, 0x92D3, 0x852C, 0xE4F4, + 0x852D, 0x88FC, 0x8535, 0x91A0, 0x853D, 0x95C1, 0x8540, 0xE4F9, 0x8541, 0xE540, 0x8543, 0x94D7, 0x8548, 0xE4FC, 0x8549, 0x8FD4, + 0x854A, 0x8EC7, 0x854B, 0xE542, 0x854E, 0x8BBC, 0x8553, 0xFB9A, 0x8555, 0xE543, 0x8557, 0x9599, 0x8558, 0xE4FB, 0x8559, 0xFB9B, + 0x855A, 0xE4D4, 0x8563, 0xE4FA, 0x8568, 0x986E, 0x8569, 0x93A0, 0x856A, 0x9593, 0x856B, 0xFB9C, 0x856D, 0xE54A, 0x8577, 0xE550, + 0x857E, 0xE551, 0x8580, 0xE544, 0x8584, 0x9496, 0x8587, 0xE54E, 0x8588, 0xE546, 0x858A, 0xE548, 0x8590, 0xE552, 0x8591, 0xE547, + 0x8594, 0xE54B, 0x8597, 0x8992, 0x8599, 0x93E3, 0x859B, 0xE54C, 0x859C, 0xE54F, 0x85A4, 0xE545, 0x85A6, 0x9145, 0x85A8, 0xE549, + 0x85A9, 0x8E46, 0x85AA, 0x9064, 0x85AB, 0x8C4F, 0x85AC, 0x96F2, 0x85AE, 0x96F7, 0x85AF, 0x8F92, 0x85B0, 0xFB9E, 0x85B9, 0xE556, + 0x85BA, 0xE554, 0x85C1, 0x986D, 0x85C9, 0xE553, 0x85CD, 0x9795, 0x85CF, 0xE555, 0x85D0, 0xE557, 0x85D5, 0xE558, 0x85DC, 0xE55B, + 0x85DD, 0xE559, 0x85E4, 0x93A1, 0x85E5, 0xE55A, 0x85E9, 0x94CB, 0x85EA, 0xE54D, 0x85F7, 0x8F93, 0x85F9, 0xE55C, 0x85FA, 0xE561, + 0x85FB, 0x9194, 0x85FE, 0xE560, 0x8602, 0xE541, 0x8606, 0xE562, 0x8607, 0x9168, 0x860A, 0xE55D, 0x860B, 0xE55F, 0x8613, 0xE55E, + 0x8616, 0x9F50, 0x8617, 0x9F41, 0x861A, 0xE564, 0x8622, 0xE563, 0x862D, 0x9796, 0x862F, 0xE1BA, 0x8630, 0xE565, 0x863F, 0xE566, + 0x864D, 0xE567, 0x864E, 0x8CD5, 0x8650, 0x8B73, 0x8654, 0xE569, 0x8655, 0x997C, 0x865A, 0x8B95, 0x865C, 0x97B8, 0x865E, 0x8BF1, + 0x865F, 0xE56A, 0x8667, 0xE56B, 0x866B, 0x928E, 0x8671, 0xE56C, 0x8679, 0x93F8, 0x867B, 0x88B8, 0x868A, 0x89E1, 0x868B, 0xE571, + 0x868C, 0xE572, 0x8693, 0xE56D, 0x8695, 0x8E5C, 0x86A3, 0xE56E, 0x86A4, 0x9461, 0x86A9, 0xE56F, 0x86AA, 0xE570, 0x86AB, 0xE57A, + 0x86AF, 0xE574, 0x86B0, 0xE577, 0x86B6, 0xE573, 0x86C4, 0xE575, 0x86C6, 0xE576, 0x86C7, 0x8ED6, 0x86C9, 0xE578, 0x86CB, 0x9260, + 0x86CD, 0x8C75, 0x86CE, 0x8A61, 0x86D4, 0xE57B, 0x86D9, 0x8A5E, 0x86DB, 0xE581, 0x86DE, 0xE57C, 0x86DF, 0xE580, 0x86E4, 0x94B8, + 0x86E9, 0xE57D, 0x86EC, 0xE57E, 0x86ED, 0x9567, 0x86EE, 0x94D8, 0x86EF, 0xE582, 0x86F8, 0x91FB, 0x86F9, 0xE58C, 0x86FB, 0xE588, + 0x86FE, 0x89E9, 0x8700, 0xE586, 0x8702, 0x9649, 0x8703, 0xE587, 0x8706, 0xE584, 0x8708, 0xE585, 0x8709, 0xE58A, 0x870A, 0xE58D, + 0x870D, 0xE58B, 0x8711, 0xE589, 0x8712, 0xE583, 0x8718, 0x9277, 0x871A, 0xE594, 0x871C, 0x96A8, 0x8725, 0xE592, 0x8729, 0xE593, + 0x8734, 0xE58E, 0x8737, 0xE590, 0x873B, 0xE591, 0x873F, 0xE58F, 0x8749, 0x90E4, 0x874B, 0x9858, 0x874C, 0xE598, 0x874E, 0xE599, + 0x8753, 0xE59F, 0x8755, 0x9049, 0x8757, 0xE59B, 0x8759, 0xE59E, 0x875F, 0xE596, 0x8760, 0xE595, 0x8763, 0xE5A0, 0x8766, 0x89DA, + 0x8768, 0xE59C, 0x876A, 0xE5A1, 0x876E, 0xE59D, 0x8774, 0xE59A, 0x8776, 0x92B1, 0x8778, 0xE597, 0x877F, 0x9488, 0x8782, 0xE5A5, + 0x878D, 0x975A, 0x879F, 0xE5A4, 0x87A2, 0xE5A3, 0x87AB, 0xE5AC, 0x87AF, 0xE5A6, 0x87B3, 0xE5AE, 0x87BA, 0x9786, 0x87BB, 0xE5B1, + 0x87BD, 0xE5A8, 0x87C0, 0xE5A9, 0x87C4, 0xE5AD, 0x87C6, 0xE5B0, 0x87C7, 0xE5AF, 0x87CB, 0xE5A7, 0x87D0, 0xE5AA, 0x87D2, 0xE5BB, + 0x87E0, 0xE5B4, 0x87EF, 0xE5B2, 0x87F2, 0xE5B3, 0x87F6, 0xE5B8, 0x87F7, 0xE5B9, 0x87F9, 0x8A49, 0x87FB, 0x8B61, 0x87FE, 0xE5B7, + 0x8805, 0xE5A2, 0x8807, 0xFBA1, 0x880D, 0xE5B6, 0x880E, 0xE5BA, 0x880F, 0xE5B5, 0x8811, 0xE5BC, 0x8815, 0xE5BE, 0x8816, 0xE5BD, + 0x8821, 0xE5C0, 0x8822, 0xE5BF, 0x8823, 0xE579, 0x8827, 0xE5C4, 0x8831, 0xE5C1, 0x8836, 0xE5C2, 0x8839, 0xE5C3, 0x883B, 0xE5C5, + 0x8840, 0x8C8C, 0x8842, 0xE5C7, 0x8844, 0xE5C6, 0x8846, 0x8F4F, 0x884C, 0x8D73, 0x884D, 0x9FA5, 0x8852, 0xE5C8, 0x8853, 0x8F70, + 0x8857, 0x8A58, 0x8859, 0xE5C9, 0x885B, 0x8971, 0x885D, 0x8FD5, 0x885E, 0xE5CA, 0x8861, 0x8D74, 0x8862, 0xE5CB, 0x8863, 0x88DF, + 0x8868, 0x955C, 0x886B, 0xE5CC, 0x8870, 0x908A, 0x8872, 0xE5D3, 0x8875, 0xE5D0, 0x8877, 0x928F, 0x887D, 0xE5D1, 0x887E, 0xE5CE, + 0x887F, 0x8BDC, 0x8881, 0xE5CD, 0x8882, 0xE5D4, 0x8888, 0x8C55, 0x888B, 0x91DC, 0x888D, 0xE5DA, 0x8892, 0xE5D6, 0x8896, 0x91B3, + 0x8897, 0xE5D5, 0x8899, 0xE5D8, 0x889E, 0xE5CF, 0x88A2, 0xE5D9, 0x88A4, 0xE5DB, 0x88AB, 0x94ED, 0x88AE, 0xE5D7, 0x88B0, 0xE5DC, + 0x88B1, 0xE5DE, 0x88B4, 0x8CD1, 0x88B5, 0xE5D2, 0x88B7, 0x88BF, 0x88BF, 0xE5DD, 0x88C1, 0x8DD9, 0x88C2, 0x97F4, 0x88C3, 0xE5DF, + 0x88C4, 0xE5E0, 0x88C5, 0x9195, 0x88CF, 0x97A0, 0x88D4, 0xE5E1, 0x88D5, 0x9754, 0x88D8, 0xE5E2, 0x88D9, 0xE5E3, 0x88DC, 0x95E2, + 0x88DD, 0xE5E4, 0x88DF, 0x8DBE, 0x88E1, 0x97A1, 0x88E8, 0xE5E9, 0x88F2, 0xE5EA, 0x88F3, 0x8FD6, 0x88F4, 0xE5E8, 0x88F5, 0xFBA2, + 0x88F8, 0x9787, 0x88F9, 0xE5E5, 0x88FC, 0xE5E7, 0x88FD, 0x90BB, 0x88FE, 0x909E, 0x8902, 0xE5E6, 0x8904, 0xE5EB, 0x8907, 0x95A1, + 0x890A, 0xE5ED, 0x890C, 0xE5EC, 0x8910, 0x8A8C, 0x8912, 0x964A, 0x8913, 0xE5EE, 0x891C, 0xFA5D, 0x891D, 0xE5FA, 0x891E, 0xE5F0, + 0x8925, 0xE5F1, 0x892A, 0xE5F2, 0x892B, 0xE5F3, 0x8936, 0xE5F7, 0x8938, 0xE5F8, 0x893B, 0xE5F6, 0x8941, 0xE5F4, 0x8943, 0xE5EF, + 0x8944, 0xE5F5, 0x894C, 0xE5F9, 0x894D, 0xE8B5, 0x8956, 0x89A6, 0x895E, 0xE5FC, 0x895F, 0x8BDD, 0x8960, 0xE5FB, 0x8964, 0xE641, + 0x8966, 0xE640, 0x896A, 0xE643, 0x896D, 0xE642, 0x896F, 0xE644, 0x8972, 0x8F50, 0x8974, 0xE645, 0x8977, 0xE646, 0x897E, 0xE647, + 0x897F, 0x90BC, 0x8981, 0x9776, 0x8983, 0xE648, 0x8986, 0x95A2, 0x8987, 0x9465, 0x8988, 0xE649, 0x898A, 0xE64A, 0x898B, 0x8CA9, + 0x898F, 0x8B4B, 0x8993, 0xE64B, 0x8996, 0x8E8B, 0x8997, 0x9460, 0x8998, 0xE64C, 0x899A, 0x8A6F, 0x89A1, 0xE64D, 0x89A6, 0xE64F, + 0x89A7, 0x9797, 0x89A9, 0xE64E, 0x89AA, 0x9065, 0x89AC, 0xE650, 0x89AF, 0xE651, 0x89B2, 0xE652, 0x89B3, 0x8ACF, 0x89BA, 0xE653, + 0x89BD, 0xE654, 0x89BF, 0xE655, 0x89C0, 0xE656, 0x89D2, 0x8A70, 0x89DA, 0xE657, 0x89DC, 0xE658, 0x89DD, 0xE659, 0x89E3, 0x89F0, + 0x89E6, 0x9047, 0x89E7, 0xE65A, 0x89F4, 0xE65B, 0x89F8, 0xE65C, 0x8A00, 0x8CBE, 0x8A02, 0x92F9, 0x8A03, 0xE65D, 0x8A08, 0x8C76, + 0x8A0A, 0x9075, 0x8A0C, 0xE660, 0x8A0E, 0x93A2, 0x8A10, 0xE65F, 0x8A12, 0xFBA3, 0x8A13, 0x8C50, 0x8A16, 0xE65E, 0x8A17, 0x91F5, + 0x8A18, 0x8B4C, 0x8A1B, 0xE661, 0x8A1D, 0xE662, 0x8A1F, 0x8FD7, 0x8A23, 0x8C8D, 0x8A25, 0xE663, 0x8A2A, 0x964B, 0x8A2D, 0x90DD, + 0x8A31, 0x8B96, 0x8A33, 0x96F3, 0x8A34, 0x9169, 0x8A36, 0xE664, 0x8A37, 0xFBA4, 0x8A3A, 0x9066, 0x8A3B, 0x9290, 0x8A3C, 0x8FD8, + 0x8A41, 0xE665, 0x8A46, 0xE668, 0x8A48, 0xE669, 0x8A50, 0x8DBC, 0x8A51, 0x91C0, 0x8A52, 0xE667, 0x8A54, 0x8FD9, 0x8A55, 0x955D, + 0x8A5B, 0xE666, 0x8A5E, 0x8E8C, 0x8A60, 0x8972, 0x8A62, 0xE66D, 0x8A63, 0x8C77, 0x8A66, 0x8E8E, 0x8A69, 0x8E8D, 0x8A6B, 0x986C, + 0x8A6C, 0xE66C, 0x8A6D, 0xE66B, 0x8A6E, 0x9146, 0x8A70, 0x8B6C, 0x8A71, 0x9862, 0x8A72, 0x8A59, 0x8A73, 0x8FDA, 0x8A79, 0xFBA5, + 0x8A7C, 0xE66A, 0x8A82, 0xE66F, 0x8A84, 0xE670, 0x8A85, 0xE66E, 0x8A87, 0x8CD6, 0x8A89, 0x975F, 0x8A8C, 0x8E8F, 0x8A8D, 0x9446, + 0x8A91, 0xE673, 0x8A93, 0x90BE, 0x8A95, 0x9261, 0x8A98, 0x9755, 0x8A9A, 0xE676, 0x8A9E, 0x8CEA, 0x8AA0, 0x90BD, 0x8AA1, 0xE672, + 0x8AA3, 0xE677, 0x8AA4, 0x8CEB, 0x8AA5, 0xE674, 0x8AA6, 0xE675, 0x8AA7, 0xFBA6, 0x8AA8, 0xE671, 0x8AAC, 0x90E0, 0x8AAD, 0x93C7, + 0x8AB0, 0x924E, 0x8AB2, 0x89DB, 0x8AB9, 0x94EE, 0x8ABC, 0x8B62, 0x8ABE, 0xFBA7, 0x8ABF, 0x92B2, 0x8AC2, 0xE67A, 0x8AC4, 0xE678, + 0x8AC7, 0x926B, 0x8ACB, 0x90BF, 0x8ACC, 0x8AD0, 0x8ACD, 0xE679, 0x8ACF, 0x907A, 0x8AD2, 0x97C8, 0x8AD6, 0x985F, 0x8ADA, 0xE67B, + 0x8ADB, 0xE687, 0x8ADC, 0x92B3, 0x8ADE, 0xE686, 0x8ADF, 0xFBA8, 0x8AE0, 0xE683, 0x8AE1, 0xE68B, 0x8AE2, 0xE684, 0x8AE4, 0xE680, + 0x8AE6, 0x92FA, 0x8AE7, 0xE67E, 0x8AEB, 0xE67C, 0x8AED, 0x9740, 0x8AEE, 0x8E90, 0x8AF1, 0xE681, 0x8AF3, 0xE67D, 0x8AF6, 0xFBAA, + 0x8AF7, 0xE685, 0x8AF8, 0x8F94, 0x8AFA, 0x8CBF, 0x8AFE, 0x91F8, 0x8B00, 0x9664, 0x8B01, 0x8979, 0x8B02, 0x88E0, 0x8B04, 0x93A3, + 0x8B07, 0xE689, 0x8B0C, 0xE688, 0x8B0E, 0x93E4, 0x8B10, 0xE68D, 0x8B14, 0xE682, 0x8B16, 0xE68C, 0x8B17, 0xE68E, 0x8B19, 0x8CAA, + 0x8B1A, 0xE68A, 0x8B1B, 0x8D75, 0x8B1D, 0x8ED3, 0x8B20, 0xE68F, 0x8B21, 0x9777, 0x8B26, 0xE692, 0x8B28, 0xE695, 0x8B2B, 0xE693, + 0x8B2C, 0x9554, 0x8B33, 0xE690, 0x8B39, 0x8BDE, 0x8B3E, 0xE694, 0x8B41, 0xE696, 0x8B49, 0xE69A, 0x8B4C, 0xE697, 0x8B4E, 0xE699, + 0x8B4F, 0xE698, 0x8B53, 0xFBAB, 0x8B56, 0xE69B, 0x8B58, 0x8EAF, 0x8B5A, 0xE69D, 0x8B5B, 0xE69C, 0x8B5C, 0x9588, 0x8B5F, 0xE69F, + 0x8B66, 0x8C78, 0x8B6B, 0xE69E, 0x8B6C, 0xE6A0, 0x8B6F, 0xE6A1, 0x8B70, 0x8B63, 0x8B71, 0xE3BF, 0x8B72, 0x8FF7, 0x8B74, 0xE6A2, + 0x8B77, 0x8CEC, 0x8B7D, 0xE6A3, 0x8B7F, 0xFBAC, 0x8B80, 0xE6A4, 0x8B83, 0x8E5D, 0x8B8A, 0x9DCC, 0x8B8C, 0xE6A5, 0x8B8E, 0xE6A6, + 0x8B90, 0x8F51, 0x8B92, 0xE6A7, 0x8B93, 0xE6A8, 0x8B96, 0xE6A9, 0x8B99, 0xE6AA, 0x8B9A, 0xE6AB, 0x8C37, 0x924A, 0x8C3A, 0xE6AC, + 0x8C3F, 0xE6AE, 0x8C41, 0xE6AD, 0x8C46, 0x93A4, 0x8C48, 0xE6AF, 0x8C4A, 0x964C, 0x8C4C, 0xE6B0, 0x8C4E, 0xE6B1, 0x8C50, 0xE6B2, + 0x8C55, 0xE6B3, 0x8C5A, 0x93D8, 0x8C61, 0x8FDB, 0x8C62, 0xE6B4, 0x8C6A, 0x8D8B, 0x8C6B, 0x98AC, 0x8C6C, 0xE6B5, 0x8C78, 0xE6B6, + 0x8C79, 0x955E, 0x8C7A, 0xE6B7, 0x8C7C, 0xE6BF, 0x8C82, 0xE6B8, 0x8C85, 0xE6BA, 0x8C89, 0xE6B9, 0x8C8A, 0xE6BB, 0x8C8C, 0x9665, + 0x8C8D, 0xE6BC, 0x8C8E, 0xE6BD, 0x8C94, 0xE6BE, 0x8C98, 0xE6C0, 0x8C9D, 0x8A4C, 0x8C9E, 0x92E5, 0x8CA0, 0x9589, 0x8CA1, 0x8DE0, + 0x8CA2, 0x8D76, 0x8CA7, 0x956E, 0x8CA8, 0x89DD, 0x8CA9, 0x94CC, 0x8CAA, 0xE6C3, 0x8CAB, 0x8AD1, 0x8CAC, 0x90D3, 0x8CAD, 0xE6C2, + 0x8CAE, 0xE6C7, 0x8CAF, 0x9299, 0x8CB0, 0x96E1, 0x8CB2, 0xE6C5, 0x8CB3, 0xE6C6, 0x8CB4, 0x8B4D, 0x8CB6, 0xE6C8, 0x8CB7, 0x9483, + 0x8CB8, 0x91DD, 0x8CBB, 0x94EF, 0x8CBC, 0x935C, 0x8CBD, 0xE6C4, 0x8CBF, 0x9666, 0x8CC0, 0x89EA, 0x8CC1, 0xE6CA, 0x8CC2, 0x9847, + 0x8CC3, 0x92C0, 0x8CC4, 0x9864, 0x8CC7, 0x8E91, 0x8CC8, 0xE6C9, 0x8CCA, 0x91AF, 0x8CCD, 0xE6DA, 0x8CCE, 0x9147, 0x8CD1, 0x93F6, + 0x8CD3, 0x956F, 0x8CDA, 0xE6CD, 0x8CDB, 0x8E5E, 0x8CDC, 0x8E92, 0x8CDE, 0x8FDC, 0x8CE0, 0x9485, 0x8CE2, 0x8CAB, 0x8CE3, 0xE6CC, + 0x8CE4, 0xE6CB, 0x8CE6, 0x958A, 0x8CEA, 0x8EBF, 0x8CED, 0x9371, 0x8CF0, 0xFBAD, 0x8CF4, 0xFBAE, 0x8CFA, 0xE6CF, 0x8CFB, 0xE6D0, + 0x8CFC, 0x8D77, 0x8CFD, 0xE6CE, 0x8D04, 0xE6D1, 0x8D05, 0xE6D2, 0x8D07, 0xE6D4, 0x8D08, 0x91A1, 0x8D0A, 0xE6D3, 0x8D0B, 0x8AE4, + 0x8D0D, 0xE6D6, 0x8D0F, 0xE6D5, 0x8D10, 0xE6D7, 0x8D12, 0xFBAF, 0x8D13, 0xE6D9, 0x8D14, 0xE6DB, 0x8D16, 0xE6DC, 0x8D64, 0x90D4, + 0x8D66, 0x8ECD, 0x8D67, 0xE6DD, 0x8D6B, 0x8A71, 0x8D6D, 0xE6DE, 0x8D70, 0x9196, 0x8D71, 0xE6DF, 0x8D73, 0xE6E0, 0x8D74, 0x958B, + 0x8D76, 0xFBB0, 0x8D77, 0x8B4E, 0x8D81, 0xE6E1, 0x8D85, 0x92B4, 0x8D8A, 0x897A, 0x8D99, 0xE6E2, 0x8DA3, 0x8EEF, 0x8DA8, 0x9096, + 0x8DB3, 0x91AB, 0x8DBA, 0xE6E5, 0x8DBE, 0xE6E4, 0x8DC2, 0xE6E3, 0x8DCB, 0xE6EB, 0x8DCC, 0xE6E9, 0x8DCF, 0xE6E6, 0x8DD6, 0xE6E8, + 0x8DDA, 0xE6E7, 0x8DDB, 0xE6EA, 0x8DDD, 0x8B97, 0x8DDF, 0xE6EE, 0x8DE1, 0x90D5, 0x8DE3, 0xE6EF, 0x8DE8, 0x8CD7, 0x8DEA, 0xE6EC, + 0x8DEB, 0xE6ED, 0x8DEF, 0x9848, 0x8DF3, 0x92B5, 0x8DF5, 0x9148, 0x8DFC, 0xE6F0, 0x8DFF, 0xE6F3, 0x8E08, 0xE6F1, 0x8E09, 0xE6F2, + 0x8E0A, 0x9778, 0x8E0F, 0x93A5, 0x8E10, 0xE6F6, 0x8E1D, 0xE6F4, 0x8E1E, 0xE6F5, 0x8E1F, 0xE6F7, 0x8E2A, 0xE748, 0x8E30, 0xE6FA, + 0x8E34, 0xE6FB, 0x8E35, 0xE6F9, 0x8E42, 0xE6F8, 0x8E44, 0x92FB, 0x8E47, 0xE740, 0x8E48, 0xE744, 0x8E49, 0xE741, 0x8E4A, 0xE6FC, + 0x8E4C, 0xE742, 0x8E50, 0xE743, 0x8E55, 0xE74A, 0x8E59, 0xE745, 0x8E5F, 0x90D6, 0x8E60, 0xE747, 0x8E63, 0xE749, 0x8E64, 0xE746, + 0x8E72, 0xE74C, 0x8E74, 0x8F52, 0x8E76, 0xE74B, 0x8E7C, 0xE74D, 0x8E81, 0xE74E, 0x8E84, 0xE751, 0x8E85, 0xE750, 0x8E87, 0xE74F, + 0x8E8A, 0xE753, 0x8E8B, 0xE752, 0x8E8D, 0x96F4, 0x8E91, 0xE755, 0x8E93, 0xE754, 0x8E94, 0xE756, 0x8E99, 0xE757, 0x8EA1, 0xE759, + 0x8EAA, 0xE758, 0x8EAB, 0x9067, 0x8EAC, 0xE75A, 0x8EAF, 0x8BEB, 0x8EB0, 0xE75B, 0x8EB1, 0xE75D, 0x8EBE, 0xE75E, 0x8EC5, 0xE75F, + 0x8EC6, 0xE75C, 0x8EC8, 0xE760, 0x8ECA, 0x8ED4, 0x8ECB, 0xE761, 0x8ECC, 0x8B4F, 0x8ECD, 0x8C52, 0x8ECF, 0xFBB2, 0x8ED2, 0x8CAC, + 0x8EDB, 0xE762, 0x8EDF, 0x93EE, 0x8EE2, 0x935D, 0x8EE3, 0xE763, 0x8EEB, 0xE766, 0x8EF8, 0x8EB2, 0x8EFB, 0xE765, 0x8EFC, 0xE764, + 0x8EFD, 0x8C79, 0x8EFE, 0xE767, 0x8F03, 0x8A72, 0x8F05, 0xE769, 0x8F09, 0x8DDA, 0x8F0A, 0xE768, 0x8F0C, 0xE771, 0x8F12, 0xE76B, + 0x8F13, 0xE76D, 0x8F14, 0x95E3, 0x8F15, 0xE76A, 0x8F19, 0xE76C, 0x8F1B, 0xE770, 0x8F1C, 0xE76E, 0x8F1D, 0x8B50, 0x8F1F, 0xE76F, + 0x8F26, 0xE772, 0x8F29, 0x9479, 0x8F2A, 0x97D6, 0x8F2F, 0x8F53, 0x8F33, 0xE773, 0x8F38, 0x9741, 0x8F39, 0xE775, 0x8F3B, 0xE774, + 0x8F3E, 0xE778, 0x8F3F, 0x9760, 0x8F42, 0xE777, 0x8F44, 0x8A8D, 0x8F45, 0xE776, 0x8F46, 0xE77B, 0x8F49, 0xE77A, 0x8F4C, 0xE779, + 0x8F4D, 0x9351, 0x8F4E, 0xE77C, 0x8F57, 0xE77D, 0x8F5C, 0xE77E, 0x8F5F, 0x8D8C, 0x8F61, 0x8C44, 0x8F62, 0xE780, 0x8F63, 0xE781, + 0x8F64, 0xE782, 0x8F9B, 0x9068, 0x8F9C, 0xE783, 0x8F9E, 0x8EAB, 0x8F9F, 0xE784, 0x8FA3, 0xE785, 0x8FA7, 0x999F, 0x8FA8, 0x999E, + 0x8FAD, 0xE786, 0x8FAE, 0xE390, 0x8FAF, 0xE787, 0x8FB0, 0x9243, 0x8FB1, 0x904A, 0x8FB2, 0x945F, 0x8FB7, 0xE788, 0x8FBA, 0x95D3, + 0x8FBB, 0x92D2, 0x8FBC, 0x8D9E, 0x8FBF, 0x9248, 0x8FC2, 0x8949, 0x8FC4, 0x9698, 0x8FC5, 0x9076, 0x8FCE, 0x8C7D, 0x8FD1, 0x8BDF, + 0x8FD4, 0x95D4, 0x8FDA, 0xE789, 0x8FE2, 0xE78B, 0x8FE5, 0xE78A, 0x8FE6, 0x89DE, 0x8FE9, 0x93F4, 0x8FEA, 0xE78C, 0x8FEB, 0x9497, + 0x8FED, 0x9352, 0x8FEF, 0xE78D, 0x8FF0, 0x8F71, 0x8FF4, 0xE78F, 0x8FF7, 0x96C0, 0x8FF8, 0xE79E, 0x8FF9, 0xE791, 0x8FFA, 0xE792, + 0x8FFD, 0x92C7, 0x9000, 0x91DE, 0x9001, 0x9197, 0x9003, 0x93A6, 0x9005, 0xE790, 0x9006, 0x8B74, 0x900B, 0xE799, 0x900D, 0xE796, + 0x900E, 0xE7A3, 0x900F, 0x93A7, 0x9010, 0x9280, 0x9011, 0xE793, 0x9013, 0x92FC, 0x9014, 0x9372, 0x9015, 0xE794, 0x9016, 0xE798, + 0x9017, 0x9080, 0x9019, 0x9487, 0x901A, 0x92CA, 0x901D, 0x90C0, 0x901E, 0xE797, 0x901F, 0x91AC, 0x9020, 0x91A2, 0x9021, 0xE795, + 0x9022, 0x88A7, 0x9023, 0x9841, 0x9027, 0xE79A, 0x902E, 0x91DF, 0x9031, 0x8F54, 0x9032, 0x9069, 0x9035, 0xE79C, 0x9036, 0xE79B, + 0x9038, 0x88ED, 0x9039, 0xE79D, 0x903C, 0x954E, 0x903E, 0xE7A5, 0x9041, 0x93D9, 0x9042, 0x908B, 0x9045, 0x9278, 0x9047, 0x8BF6, + 0x9049, 0xE7A4, 0x904A, 0x9756, 0x904B, 0x895E, 0x904D, 0x95D5, 0x904E, 0x89DF, 0x904F, 0xE79F, 0x9050, 0xE7A0, 0x9051, 0xE7A1, + 0x9052, 0xE7A2, 0x9053, 0x93B9, 0x9054, 0x9242, 0x9055, 0x88E1, 0x9056, 0xE7A6, 0x9058, 0xE7A7, 0x9059, 0xEAA1, 0x905C, 0x91BB, + 0x905E, 0xE7A8, 0x9060, 0x8993, 0x9061, 0x916B, 0x9063, 0x8CAD, 0x9065, 0x9779, 0x9067, 0xFBB5, 0x9068, 0xE7A9, 0x9069, 0x934B, + 0x906D, 0x9198, 0x906E, 0x8ED5, 0x906F, 0xE7AA, 0x9072, 0xE7AD, 0x9075, 0x8F85, 0x9076, 0xE7AB, 0x9077, 0x914A, 0x9078, 0x9149, + 0x907A, 0x88E2, 0x907C, 0x97C9, 0x907D, 0xE7AF, 0x907F, 0x94F0, 0x9080, 0xE7B1, 0x9081, 0xE7B0, 0x9082, 0xE7AE, 0x9083, 0xE284, + 0x9084, 0x8AD2, 0x9087, 0xE78E, 0x9089, 0xE7B3, 0x908A, 0xE7B2, 0x908F, 0xE7B4, 0x9091, 0x9757, 0x90A3, 0x93DF, 0x90A6, 0x964D, + 0x90A8, 0xE7B5, 0x90AA, 0x8ED7, 0x90AF, 0xE7B6, 0x90B1, 0xE7B7, 0x90B5, 0xE7B8, 0x90B8, 0x9340, 0x90C1, 0x88E8, 0x90CA, 0x8D78, + 0x90CE, 0x9859, 0x90DB, 0xE7BC, 0x90DE, 0xFBB6, 0x90E1, 0x8C53, 0x90E2, 0xE7B9, 0x90E4, 0xE7BA, 0x90E8, 0x9594, 0x90ED, 0x8A73, + 0x90F5, 0x9758, 0x90F7, 0x8BBD, 0x90FD, 0x9373, 0x9102, 0xE7BD, 0x9112, 0xE7BE, 0x9115, 0xFBB8, 0x9119, 0xE7BF, 0x9127, 0xFBB9, + 0x912D, 0x9341, 0x9130, 0xE7C1, 0x9132, 0xE7C0, 0x9149, 0x93D1, 0x914A, 0xE7C2, 0x914B, 0x8F55, 0x914C, 0x8EDE, 0x914D, 0x947A, + 0x914E, 0x9291, 0x9152, 0x8EF0, 0x9154, 0x908C, 0x9156, 0xE7C3, 0x9158, 0xE7C4, 0x9162, 0x907C, 0x9163, 0xE7C5, 0x9165, 0xE7C6, + 0x9169, 0xE7C7, 0x916A, 0x978F, 0x916C, 0x8F56, 0x9172, 0xE7C9, 0x9173, 0xE7C8, 0x9175, 0x8D79, 0x9177, 0x8D93, 0x9178, 0x8E5F, + 0x9182, 0xE7CC, 0x9187, 0x8F86, 0x9189, 0xE7CB, 0x918B, 0xE7CA, 0x918D, 0x91E7, 0x9190, 0x8CED, 0x9192, 0x90C1, 0x9197, 0x94AE, + 0x919C, 0x8F58, 0x91A2, 0xE7CD, 0x91A4, 0x8FDD, 0x91AA, 0xE7D0, 0x91AB, 0xE7CE, 0x91AF, 0xE7CF, 0x91B4, 0xE7D2, 0x91B5, 0xE7D1, + 0x91B8, 0x8FF8, 0x91BA, 0xE7D3, 0x91C0, 0xE7D4, 0x91C1, 0xE7D5, 0x91C6, 0x94CE, 0x91C7, 0x8DD1, 0x91C8, 0x8EDF, 0x91C9, 0xE7D6, + 0x91CB, 0xE7D7, 0x91CC, 0x97A2, 0x91CD, 0x8F64, 0x91CE, 0x96EC, 0x91CF, 0x97CA, 0x91D0, 0xE7D8, 0x91D1, 0x8BE0, 0x91D6, 0xE7D9, + 0x91D7, 0xFBBB, 0x91D8, 0x9342, 0x91DA, 0xFBBA, 0x91DB, 0xE7DC, 0x91DC, 0x8A98, 0x91DD, 0x906A, 0x91DE, 0xFBBC, 0x91DF, 0xE7DA, + 0x91E1, 0xE7DB, 0x91E3, 0x92DE, 0x91E4, 0xFBBF, 0x91E5, 0xFBC0, 0x91E6, 0x9674, 0x91E7, 0x8BFA, 0x91ED, 0xFBBD, 0x91EE, 0xFBBE, + 0x91F5, 0xE7DE, 0x91F6, 0xE7DF, 0x91FC, 0xE7DD, 0x91FF, 0xE7E1, 0x9206, 0xFBC1, 0x920A, 0xFBC3, 0x920D, 0x93DD, 0x920E, 0x8A62, + 0x9210, 0xFBC2, 0x9211, 0xE7E5, 0x9214, 0xE7E2, 0x9215, 0xE7E4, 0x921E, 0xE7E0, 0x9229, 0xE86E, 0x922C, 0xE7E3, 0x9234, 0x97E9, + 0x9237, 0x8CD8, 0x9239, 0xFBCA, 0x923A, 0xFBC4, 0x923C, 0xFBC6, 0x923F, 0xE7ED, 0x9240, 0xFBC5, 0x9244, 0x9353, 0x9245, 0xE7E8, + 0x9248, 0xE7EB, 0x9249, 0xE7E9, 0x924B, 0xE7EE, 0x924E, 0xFBC7, 0x9250, 0xE7EF, 0x9251, 0xFBC9, 0x9257, 0xE7E7, 0x9259, 0xFBC8, + 0x925A, 0xE7F4, 0x925B, 0x8994, 0x925E, 0xE7E6, 0x9262, 0x94AB, 0x9264, 0xE7EA, 0x9266, 0x8FDE, 0x9267, 0xFBCB, 0x9271, 0x8D7A, + 0x9277, 0xFBCD, 0x9278, 0xFBCE, 0x927E, 0x9667, 0x9280, 0x8BE2, 0x9283, 0x8F65, 0x9285, 0x93BA, 0x9288, 0xFA5F, 0x9291, 0x914C, + 0x9293, 0xE7F2, 0x9295, 0xE7EC, 0x9296, 0xE7F1, 0x9298, 0x96C1, 0x929A, 0x92B6, 0x929B, 0xE7F3, 0x929C, 0xE7F0, 0x92A7, 0xFBCC, + 0x92AD, 0x914B, 0x92B7, 0xE7F7, 0x92B9, 0xE7F6, 0x92CF, 0xE7F5, 0x92D0, 0xFBD2, 0x92D2, 0x964E, 0x92D3, 0xFBD6, 0x92D5, 0xFBD4, + 0x92D7, 0xFBD0, 0x92D9, 0xFBD1, 0x92E0, 0xFBD5, 0x92E4, 0x8F9B, 0x92E7, 0xFBCF, 0x92E9, 0xE7F8, 0x92EA, 0x95DD, 0x92ED, 0x8973, + 0x92F2, 0x9565, 0x92F3, 0x9292, 0x92F8, 0x8B98, 0x92F9, 0xFA65, 0x92FA, 0xE7FA, 0x92FB, 0xFBD9, 0x92FC, 0x8D7C, 0x92FF, 0xFBDC, + 0x9302, 0xFBDE, 0x9306, 0x8E4B, 0x930F, 0xE7F9, 0x9310, 0x908D, 0x9318, 0x908E, 0x9319, 0xE840, 0x931A, 0xE842, 0x931D, 0xFBDD, + 0x931E, 0xFBDB, 0x9320, 0x8FF9, 0x9321, 0xFBD8, 0x9322, 0xE841, 0x9323, 0xE843, 0x9325, 0xFBD7, 0x9326, 0x8BD1, 0x9328, 0x9564, + 0x932B, 0x8EE0, 0x932C, 0x9842, 0x932E, 0xE7FC, 0x932F, 0x8DF6, 0x9332, 0x985E, 0x9335, 0xE845, 0x933A, 0xE844, 0x933B, 0xE846, + 0x9344, 0xE7FB, 0x9348, 0xFA5E, 0x934B, 0x93E7, 0x934D, 0x9374, 0x9354, 0x92D5, 0x9356, 0xE84B, 0x9357, 0xFBE0, 0x935B, 0x9262, + 0x935C, 0xE847, 0x9360, 0xE848, 0x936C, 0x8C4C, 0x936E, 0xE84A, 0x9370, 0xFBDF, 0x9375, 0x8CAE, 0x937C, 0xE849, 0x937E, 0x8FDF, + 0x938C, 0x8A99, 0x9394, 0xE84F, 0x9396, 0x8DBD, 0x9397, 0x9199, 0x939A, 0x92C8, 0x93A4, 0xFBE1, 0x93A7, 0x8A5A, 0x93AC, 0xE84D, + 0x93AD, 0xE84E, 0x93AE, 0x92C1, 0x93B0, 0xE84C, 0x93B9, 0xE850, 0x93C3, 0xE856, 0x93C6, 0xFBE2, 0x93C8, 0xE859, 0x93D0, 0xE858, + 0x93D1, 0x934C, 0x93D6, 0xE851, 0x93D7, 0xE852, 0x93D8, 0xE855, 0x93DD, 0xE857, 0x93DE, 0xFBE3, 0x93E1, 0x8BBE, 0x93E4, 0xE85A, + 0x93E5, 0xE854, 0x93E8, 0xE853, 0x93F8, 0xFBE4, 0x9403, 0xE85E, 0x9407, 0xE85F, 0x9410, 0xE860, 0x9413, 0xE85D, 0x9414, 0xE85C, + 0x9418, 0x8FE0, 0x9419, 0x93A8, 0x941A, 0xE85B, 0x9421, 0xE864, 0x942B, 0xE862, 0x9431, 0xFBE5, 0x9435, 0xE863, 0x9436, 0xE861, + 0x9438, 0x91F6, 0x943A, 0xE865, 0x9441, 0xE866, 0x9444, 0xE868, 0x9445, 0xFBE6, 0x9448, 0xFBE7, 0x9451, 0x8AD3, 0x9452, 0xE867, + 0x9453, 0x96F8, 0x945A, 0xE873, 0x945B, 0xE869, 0x945E, 0xE86C, 0x9460, 0xE86A, 0x9462, 0xE86B, 0x946A, 0xE86D, 0x9470, 0xE86F, + 0x9475, 0xE870, 0x9477, 0xE871, 0x947C, 0xE874, 0x947D, 0xE872, 0x947E, 0xE875, 0x947F, 0xE877, 0x9481, 0xE876, 0x9577, 0x92B7, + 0x9580, 0x96E5, 0x9582, 0xE878, 0x9583, 0x914D, 0x9587, 0xE879, 0x9589, 0x95C2, 0x958A, 0xE87A, 0x958B, 0x8A4A, 0x958F, 0x895B, + 0x9591, 0x8AD5, 0x9592, 0xFBE8, 0x9593, 0x8AD4, 0x9594, 0xE87B, 0x9596, 0xE87C, 0x9598, 0xE87D, 0x9599, 0xE87E, 0x95A0, 0xE880, + 0x95A2, 0x8AD6, 0x95A3, 0x8A74, 0x95A4, 0x8D7D, 0x95A5, 0x94B4, 0x95A7, 0xE882, 0x95A8, 0xE881, 0x95AD, 0xE883, 0x95B2, 0x897B, + 0x95B9, 0xE886, 0x95BB, 0xE885, 0x95BC, 0xE884, 0x95BE, 0xE887, 0x95C3, 0xE88A, 0x95C7, 0x88C5, 0x95CA, 0xE888, 0x95CC, 0xE88C, + 0x95CD, 0xE88B, 0x95D4, 0xE88E, 0x95D5, 0xE88D, 0x95D6, 0xE88F, 0x95D8, 0x93AC, 0x95DC, 0xE890, 0x95E1, 0xE891, 0x95E2, 0xE893, + 0x95E5, 0xE892, 0x961C, 0x958C, 0x9621, 0xE894, 0x9628, 0xE895, 0x962A, 0x8DE3, 0x962E, 0xE896, 0x962F, 0xE897, 0x9632, 0x9668, + 0x963B, 0x916A, 0x963F, 0x88A2, 0x9640, 0x91C9, 0x9642, 0xE898, 0x9644, 0x958D, 0x964B, 0xE89B, 0x964C, 0xE899, 0x964D, 0x8D7E, + 0x964F, 0xE89A, 0x9650, 0x8CC0, 0x965B, 0x95C3, 0x965C, 0xE89D, 0x965D, 0xE89F, 0x965E, 0xE89E, 0x965F, 0xE8A0, 0x9662, 0x8940, + 0x9663, 0x9077, 0x9664, 0x8F9C, 0x9665, 0x8AD7, 0x9666, 0xE8A1, 0x966A, 0x9486, 0x966C, 0xE8A3, 0x9670, 0x8941, 0x9672, 0xE8A2, + 0x9673, 0x92C2, 0x9675, 0x97CB, 0x9676, 0x93A9, 0x9677, 0xE89C, 0x9678, 0x97A4, 0x967A, 0x8CAF, 0x967D, 0x977A, 0x9685, 0x8BF7, + 0x9686, 0x97B2, 0x9688, 0x8C47, 0x968A, 0x91E0, 0x968B, 0xE440, 0x968D, 0xE8A4, 0x968E, 0x8A4B, 0x968F, 0x908F, 0x9694, 0x8A75, + 0x9695, 0xE8A6, 0x9697, 0xE8A7, 0x9698, 0xE8A5, 0x9699, 0x8C84, 0x969B, 0x8DDB, 0x969C, 0x8FE1, 0x969D, 0xFBEB, 0x96A0, 0x8942, + 0x96A3, 0x97D7, 0x96A7, 0xE8A9, 0x96A8, 0xE7AC, 0x96AA, 0xE8A8, 0x96AF, 0xFBEC, 0x96B0, 0xE8AC, 0x96B1, 0xE8AA, 0x96B2, 0xE8AB, + 0x96B4, 0xE8AD, 0x96B6, 0xE8AE, 0x96B7, 0x97EA, 0x96B8, 0xE8AF, 0x96B9, 0xE8B0, 0x96BB, 0x90C7, 0x96BC, 0x94B9, 0x96C0, 0x909D, + 0x96C1, 0x8AE5, 0x96C4, 0x9759, 0x96C5, 0x89EB, 0x96C6, 0x8F57, 0x96C7, 0x8CD9, 0x96C9, 0xE8B3, 0x96CB, 0xE8B2, 0x96CC, 0x8E93, + 0x96CD, 0xE8B4, 0x96CE, 0xE8B1, 0x96D1, 0x8E47, 0x96D5, 0xE8B8, 0x96D6, 0xE5AB, 0x96D9, 0x99D4, 0x96DB, 0x9097, 0x96DC, 0xE8B6, + 0x96E2, 0x97A3, 0x96E3, 0x93EF, 0x96E8, 0x894A, 0x96EA, 0x90E1, 0x96EB, 0x8EB4, 0x96F0, 0x95B5, 0x96F2, 0x895F, 0x96F6, 0x97EB, + 0x96F7, 0x978B, 0x96F9, 0xE8B9, 0x96FB, 0x9364, 0x9700, 0x8EF9, 0x9704, 0xE8BA, 0x9706, 0xE8BB, 0x9707, 0x906B, 0x9708, 0xE8BC, + 0x970A, 0x97EC, 0x970D, 0xE8B7, 0x970E, 0xE8BE, 0x970F, 0xE8C0, 0x9711, 0xE8BF, 0x9713, 0xE8BD, 0x9716, 0xE8C1, 0x9719, 0xE8C2, + 0x971C, 0x919A, 0x971E, 0x89E0, 0x9724, 0xE8C3, 0x9727, 0x96B6, 0x972A, 0xE8C4, 0x9730, 0xE8C5, 0x9732, 0x9849, 0x9733, 0xFBED, + 0x9738, 0x9E50, 0x9739, 0xE8C6, 0x973B, 0xFBEE, 0x973D, 0xE8C7, 0x973E, 0xE8C8, 0x9742, 0xE8CC, 0x9743, 0xFBEF, 0x9744, 0xE8C9, + 0x9746, 0xE8CA, 0x9748, 0xE8CB, 0x9749, 0xE8CD, 0x974D, 0xFBF0, 0x974F, 0xFBF1, 0x9751, 0xFBF2, 0x9752, 0x90C2, 0x9755, 0xFBF3, + 0x9756, 0x96F5, 0x9759, 0x90C3, 0x975C, 0xE8CE, 0x975E, 0x94F1, 0x9760, 0xE8CF, 0x9761, 0xEA72, 0x9762, 0x96CA, 0x9764, 0xE8D0, + 0x9766, 0xE8D1, 0x9768, 0xE8D2, 0x9769, 0x8A76, 0x976B, 0xE8D4, 0x976D, 0x9078, 0x9771, 0xE8D5, 0x9774, 0x8C43, 0x9779, 0xE8D6, + 0x977A, 0xE8DA, 0x977C, 0xE8D8, 0x9781, 0xE8D9, 0x9784, 0x8A93, 0x9785, 0xE8D7, 0x9786, 0xE8DB, 0x978B, 0xE8DC, 0x978D, 0x88C6, + 0x978F, 0xE8DD, 0x9790, 0xE8DE, 0x9798, 0x8FE2, 0x979C, 0xE8DF, 0x97A0, 0x8B66, 0x97A3, 0xE8E2, 0x97A6, 0xE8E1, 0x97A8, 0xE8E0, + 0x97AB, 0xE691, 0x97AD, 0x95DA, 0x97B3, 0xE8E3, 0x97B4, 0xE8E4, 0x97C3, 0xE8E5, 0x97C6, 0xE8E6, 0x97C8, 0xE8E7, 0x97CB, 0xE8E8, + 0x97D3, 0x8AD8, 0x97DC, 0xE8E9, 0x97ED, 0xE8EA, 0x97EE, 0x9442, 0x97F2, 0xE8EC, 0x97F3, 0x89B9, 0x97F5, 0xE8EF, 0x97F6, 0xE8EE, + 0x97FB, 0x8943, 0x97FF, 0x8BBF, 0x9801, 0x95C5, 0x9802, 0x92B8, 0x9803, 0x8DA0, 0x9805, 0x8D80, 0x9806, 0x8F87, 0x9808, 0x907B, + 0x980C, 0xE8F1, 0x980F, 0xE8F0, 0x9810, 0x9761, 0x9811, 0x8AE6, 0x9812, 0x94D0, 0x9813, 0x93DA, 0x9817, 0x909C, 0x9818, 0x97CC, + 0x981A, 0x8C7A, 0x9821, 0xE8F4, 0x9824, 0xE8F3, 0x982C, 0x966A, 0x982D, 0x93AA, 0x9834, 0x896F, 0x9837, 0xE8F5, 0x9838, 0xE8F2, + 0x983B, 0x9570, 0x983C, 0x978A, 0x983D, 0xE8F6, 0x9846, 0xE8F7, 0x984B, 0xE8F9, 0x984C, 0x91E8, 0x984D, 0x8A7A, 0x984E, 0x8A7B, + 0x984F, 0xE8F8, 0x9854, 0x8AE7, 0x9855, 0x8CB0, 0x9857, 0xFBF4, 0x9858, 0x8AE8, 0x985B, 0x935E, 0x985E, 0x97DE, 0x9865, 0xFBF5, + 0x9867, 0x8CDA, 0x986B, 0xE8FA, 0x986F, 0xE8FB, 0x9870, 0xE8FC, 0x9871, 0xE940, 0x9873, 0xE942, 0x9874, 0xE941, 0x98A8, 0x9597, + 0x98AA, 0xE943, 0x98AF, 0xE944, 0x98B1, 0xE945, 0x98B6, 0xE946, 0x98C3, 0xE948, 0x98C4, 0xE947, 0x98C6, 0xE949, 0x98DB, 0x94F2, + 0x98DC, 0xE3CA, 0x98DF, 0x9048, 0x98E2, 0x8B51, 0x98E9, 0xE94A, 0x98EB, 0xE94B, 0x98ED, 0x99AA, 0x98EE, 0x9F5A, 0x98EF, 0x94D1, + 0x98F2, 0x88F9, 0x98F4, 0x88B9, 0x98FC, 0x8E94, 0x98FD, 0x964F, 0x98FE, 0x8FFC, 0x9903, 0xE94C, 0x9905, 0x96DD, 0x9909, 0xE94D, + 0x990A, 0x977B, 0x990C, 0x8961, 0x9910, 0x8E60, 0x9912, 0xE94E, 0x9913, 0x89EC, 0x9914, 0xE94F, 0x9918, 0xE950, 0x991D, 0xE952, + 0x991E, 0xE953, 0x9920, 0xE955, 0x9921, 0xE951, 0x9924, 0xE954, 0x9927, 0xFBF8, 0x9928, 0x8AD9, 0x992C, 0xE956, 0x992E, 0xE957, + 0x993D, 0xE958, 0x993E, 0xE959, 0x9942, 0xE95A, 0x9945, 0xE95C, 0x9949, 0xE95B, 0x994B, 0xE95E, 0x994C, 0xE961, 0x9950, 0xE95D, + 0x9951, 0xE95F, 0x9952, 0xE960, 0x9955, 0xE962, 0x9957, 0x8BC0, 0x9996, 0x8EF1, 0x9997, 0xE963, 0x9998, 0xE964, 0x9999, 0x8D81, + 0x999E, 0xFBFA, 0x99A5, 0xE965, 0x99A8, 0x8A5D, 0x99AC, 0x946E, 0x99AD, 0xE966, 0x99AE, 0xE967, 0x99B3, 0x9279, 0x99B4, 0x93E9, + 0x99BC, 0xE968, 0x99C1, 0x949D, 0x99C4, 0x91CA, 0x99C5, 0x8977, 0x99C6, 0x8BEC, 0x99C8, 0x8BED, 0x99D0, 0x9293, 0x99D1, 0xE96D, + 0x99D2, 0x8BEE, 0x99D5, 0x89ED, 0x99D8, 0xE96C, 0x99DB, 0xE96A, 0x99DD, 0xE96B, 0x99DF, 0xE969, 0x99E2, 0xE977, 0x99ED, 0xE96E, + 0x99EE, 0xE96F, 0x99F1, 0xE970, 0x99F2, 0xE971, 0x99F8, 0xE973, 0x99FB, 0xE972, 0x99FF, 0x8F78, 0x9A01, 0xE974, 0x9A05, 0xE976, + 0x9A0E, 0x8B52, 0x9A0F, 0xE975, 0x9A12, 0x919B, 0x9A13, 0x8CB1, 0x9A19, 0xE978, 0x9A28, 0x91CB, 0x9A2B, 0xE979, 0x9A30, 0x93AB, + 0x9A37, 0xE97A, 0x9A3E, 0xE980, 0x9A40, 0xE97D, 0x9A42, 0xE97C, 0x9A43, 0xE97E, 0x9A45, 0xE97B, 0x9A4D, 0xE982, 0x9A4E, 0xFBFB, + 0x9A55, 0xE981, 0x9A57, 0xE984, 0x9A5A, 0x8BC1, 0x9A5B, 0xE983, 0x9A5F, 0xE985, 0x9A62, 0xE986, 0x9A64, 0xE988, 0x9A65, 0xE987, + 0x9A69, 0xE989, 0x9A6A, 0xE98B, 0x9A6B, 0xE98A, 0x9AA8, 0x8D9C, 0x9AAD, 0xE98C, 0x9AB0, 0xE98D, 0x9AB8, 0x8A5B, 0x9ABC, 0xE98E, + 0x9AC0, 0xE98F, 0x9AC4, 0x9091, 0x9ACF, 0xE990, 0x9AD1, 0xE991, 0x9AD3, 0xE992, 0x9AD4, 0xE993, 0x9AD8, 0x8D82, 0x9AD9, 0xFBFC, + 0x9ADC, 0xFC40, 0x9ADE, 0xE994, 0x9ADF, 0xE995, 0x9AE2, 0xE996, 0x9AE3, 0xE997, 0x9AE6, 0xE998, 0x9AEA, 0x94AF, 0x9AEB, 0xE99A, + 0x9AED, 0x9545, 0x9AEE, 0xE99B, 0x9AEF, 0xE999, 0x9AF1, 0xE99D, 0x9AF4, 0xE99C, 0x9AF7, 0xE99E, 0x9AFB, 0xE99F, 0x9B06, 0xE9A0, + 0x9B18, 0xE9A1, 0x9B1A, 0xE9A2, 0x9B1F, 0xE9A3, 0x9B22, 0xE9A4, 0x9B23, 0xE9A5, 0x9B25, 0xE9A6, 0x9B27, 0xE9A7, 0x9B28, 0xE9A8, + 0x9B29, 0xE9A9, 0x9B2A, 0xE9AA, 0x9B2E, 0xE9AB, 0x9B2F, 0xE9AC, 0x9B31, 0x9F54, 0x9B32, 0xE9AD, 0x9B3B, 0xE2F6, 0x9B3C, 0x8B53, + 0x9B41, 0x8A40, 0x9B42, 0x8DB0, 0x9B43, 0xE9AF, 0x9B44, 0xE9AE, 0x9B45, 0x96A3, 0x9B4D, 0xE9B1, 0x9B4E, 0xE9B2, 0x9B4F, 0xE9B0, + 0x9B51, 0xE9B3, 0x9B54, 0x9682, 0x9B58, 0xE9B4, 0x9B5A, 0x8B9B, 0x9B6F, 0x9844, 0x9B72, 0xFC42, 0x9B74, 0xE9B5, 0x9B75, 0xFC41, + 0x9B83, 0xE9B7, 0x9B8E, 0x88BC, 0x9B8F, 0xFC43, 0x9B91, 0xE9B8, 0x9B92, 0x95A9, 0x9B93, 0xE9B6, 0x9B96, 0xE9B9, 0x9B97, 0xE9BA, + 0x9B9F, 0xE9BB, 0x9BA0, 0xE9BC, 0x9BA8, 0xE9BD, 0x9BAA, 0x968E, 0x9BAB, 0x8E4C, 0x9BAD, 0x8DF8, 0x9BAE, 0x914E, 0x9BB1, 0xFC44, + 0x9BB4, 0xE9BE, 0x9BB9, 0xE9C1, 0x9BBB, 0xFC45, 0x9BC0, 0xE9BF, 0x9BC6, 0xE9C2, 0x9BC9, 0x8CEF, 0x9BCA, 0xE9C0, 0x9BCF, 0xE9C3, + 0x9BD1, 0xE9C4, 0x9BD2, 0xE9C5, 0x9BD4, 0xE9C9, 0x9BD6, 0x8E49, 0x9BDB, 0x91E2, 0x9BE1, 0xE9CA, 0x9BE2, 0xE9C7, 0x9BE3, 0xE9C6, + 0x9BE4, 0xE9C8, 0x9BE8, 0x8C7E, 0x9BF0, 0xE9CE, 0x9BF1, 0xE9CD, 0x9BF2, 0xE9CC, 0x9BF5, 0x88B1, 0x9C00, 0xFC46, 0x9C04, 0xE9D8, + 0x9C06, 0xE9D4, 0x9C08, 0xE9D5, 0x9C09, 0xE9D1, 0x9C0A, 0xE9D7, 0x9C0C, 0xE9D3, 0x9C0D, 0x8A82, 0x9C10, 0x986B, 0x9C12, 0xE9D6, + 0x9C13, 0xE9D2, 0x9C14, 0xE9D0, 0x9C15, 0xE9CF, 0x9C1B, 0xE9DA, 0x9C21, 0xE9DD, 0x9C24, 0xE9DC, 0x9C25, 0xE9DB, 0x9C2D, 0x9568, + 0x9C2E, 0xE9D9, 0x9C2F, 0x88F1, 0x9C30, 0xE9DE, 0x9C32, 0xE9E0, 0x9C39, 0x8A8F, 0x9C3A, 0xE9CB, 0x9C3B, 0x8956, 0x9C3E, 0xE9E2, + 0x9C46, 0xE9E1, 0x9C47, 0xE9DF, 0x9C48, 0x924C, 0x9C52, 0x9690, 0x9C57, 0x97D8, 0x9C5A, 0xE9E3, 0x9C60, 0xE9E4, 0x9C67, 0xE9E5, + 0x9C76, 0xE9E6, 0x9C78, 0xE9E7, 0x9CE5, 0x92B9, 0x9CE7, 0xE9E8, 0x9CE9, 0x94B5, 0x9CEB, 0xE9ED, 0x9CEC, 0xE9E9, 0x9CF0, 0xE9EA, + 0x9CF3, 0x9650, 0x9CF4, 0x96C2, 0x9CF6, 0x93CE, 0x9D03, 0xE9EE, 0x9D06, 0xE9EF, 0x9D07, 0x93BC, 0x9D08, 0xE9EC, 0x9D09, 0xE9EB, + 0x9D0E, 0x89A8, 0x9D12, 0xE9F7, 0x9D15, 0xE9F6, 0x9D1B, 0x8995, 0x9D1F, 0xE9F4, 0x9D23, 0xE9F3, 0x9D26, 0xE9F1, 0x9D28, 0x8A9B, + 0x9D2A, 0xE9F0, 0x9D2B, 0x8EB0, 0x9D2C, 0x89A7, 0x9D3B, 0x8D83, 0x9D3E, 0xE9FA, 0x9D3F, 0xE9F9, 0x9D41, 0xE9F8, 0x9D44, 0xE9F5, + 0x9D46, 0xE9FB, 0x9D48, 0xE9FC, 0x9D50, 0xEA44, 0x9D51, 0xEA43, 0x9D59, 0xEA45, 0x9D5C, 0x894C, 0x9D5D, 0xEA40, 0x9D5E, 0xEA41, + 0x9D60, 0x8D94, 0x9D61, 0x96B7, 0x9D64, 0xEA42, 0x9D6B, 0xFC48, 0x9D6C, 0x9651, 0x9D6F, 0xEA4A, 0x9D70, 0xFC47, 0x9D72, 0xEA46, + 0x9D7A, 0xEA4B, 0x9D87, 0xEA48, 0x9D89, 0xEA47, 0x9D8F, 0x8C7B, 0x9D9A, 0xEA4C, 0x9DA4, 0xEA4D, 0x9DA9, 0xEA4E, 0x9DAB, 0xEA49, + 0x9DAF, 0xE9F2, 0x9DB2, 0xEA4F, 0x9DB4, 0x92DF, 0x9DB8, 0xEA53, 0x9DBA, 0xEA54, 0x9DBB, 0xEA52, 0x9DC1, 0xEA51, 0x9DC2, 0xEA57, + 0x9DC4, 0xEA50, 0x9DC6, 0xEA55, 0x9DCF, 0xEA56, 0x9DD3, 0xEA59, 0x9DD9, 0xEA58, 0x9DE6, 0xEA5B, 0x9DED, 0xEA5C, 0x9DEF, 0xEA5D, + 0x9DF2, 0x9868, 0x9DF8, 0xEA5A, 0x9DF9, 0x91E9, 0x9DFA, 0x8DEB, 0x9DFD, 0xEA5E, 0x9E19, 0xFC4A, 0x9E1A, 0xEA5F, 0x9E1B, 0xEA60, + 0x9E1E, 0xEA61, 0x9E75, 0xEA62, 0x9E78, 0x8CB2, 0x9E79, 0xEA63, 0x9E7D, 0xEA64, 0x9E7F, 0x8EAD, 0x9E81, 0xEA65, 0x9E88, 0xEA66, + 0x9E8B, 0xEA67, 0x9E8C, 0xEA68, 0x9E91, 0xEA6B, 0x9E92, 0xEA69, 0x9E93, 0x985B, 0x9E95, 0xEA6A, 0x9E97, 0x97ED, 0x9E9D, 0xEA6C, + 0x9E9F, 0x97D9, 0x9EA5, 0xEA6D, 0x9EA6, 0x949E, 0x9EA9, 0xEA6E, 0x9EAA, 0xEA70, 0x9EAD, 0xEA71, 0x9EB8, 0xEA6F, 0x9EB9, 0x8D8D, + 0x9EBA, 0x96CB, 0x9EBB, 0x9683, 0x9EBC, 0x9BF5, 0x9EBE, 0x9F80, 0x9EBF, 0x969B, 0x9EC4, 0x89A9, 0x9ECC, 0xEA73, 0x9ECD, 0x8B6F, + 0x9ECE, 0xEA74, 0x9ECF, 0xEA75, 0x9ED0, 0xEA76, 0x9ED1, 0xFC4B, 0x9ED2, 0x8D95, 0x9ED4, 0xEA77, 0x9ED8, 0xE0D2, 0x9ED9, 0x96D9, + 0x9EDB, 0x91E1, 0x9EDC, 0xEA78, 0x9EDD, 0xEA7A, 0x9EDE, 0xEA79, 0x9EE0, 0xEA7B, 0x9EE5, 0xEA7C, 0x9EE8, 0xEA7D, 0x9EEF, 0xEA7E, + 0x9EF4, 0xEA80, 0x9EF6, 0xEA81, 0x9EF7, 0xEA82, 0x9EF9, 0xEA83, 0x9EFB, 0xEA84, 0x9EFC, 0xEA85, 0x9EFD, 0xEA86, 0x9F07, 0xEA87, + 0x9F08, 0xEA88, 0x9F0E, 0x9343, 0x9F13, 0x8CDB, 0x9F15, 0xEA8A, 0x9F20, 0x916C, 0x9F21, 0xEA8B, 0x9F2C, 0xEA8C, 0x9F3B, 0x9540, + 0x9F3E, 0xEA8D, 0x9F4A, 0xEA8E, 0x9F4B, 0xE256, 0x9F4E, 0xE6D8, 0x9F4F, 0xE8EB, 0x9F52, 0xEA8F, 0x9F54, 0xEA90, 0x9F5F, 0xEA92, + 0x9F60, 0xEA93, 0x9F61, 0xEA94, 0x9F62, 0x97EE, 0x9F63, 0xEA91, 0x9F66, 0xEA95, 0x9F67, 0xEA96, 0x9F6A, 0xEA98, 0x9F6C, 0xEA97, + 0x9F72, 0xEA9A, 0x9F76, 0xEA9B, 0x9F77, 0xEA99, 0x9F8D, 0x97B4, 0x9F95, 0xEA9C, 0x9F9C, 0xEA9D, 0x9F9D, 0xE273, 0x9FA0, 0xEA9E, + 0xF929, 0xFAE0, 0xF9DC, 0xFBE9, 0xFA0E, 0xFA90, 0xFA0F, 0xFA9B, 0xFA10, 0xFA9C, 0xFA11, 0xFAB1, 0xFA12, 0xFAD8, 0xFA13, 0xFAE8, + 0xFA14, 0xFAEA, 0xFA15, 0xFB58, 0xFA16, 0xFB5E, 0xFA17, 0xFB75, 0xFA18, 0xFB7D, 0xFA19, 0xFB7E, 0xFA1A, 0xFB80, 0xFA1B, 0xFB82, + 0xFA1C, 0xFB86, 0xFA1D, 0xFB89, 0xFA1E, 0xFB92, 0xFA1F, 0xFB9D, 0xFA20, 0xFB9F, 0xFA21, 0xFBA0, 0xFA22, 0xFBA9, 0xFA23, 0xFBB1, + 0xFA24, 0xFBB3, 0xFA25, 0xFBB4, 0xFA26, 0xFBB7, 0xFA27, 0xFBD3, 0xFA28, 0xFBDA, 0xFA29, 0xFBEA, 0xFA2A, 0xFBF6, 0xFA2B, 0xFBF7, + 0xFA2C, 0xFBF9, 0xFA2D, 0xFC49, 0xFF01, 0x8149, 0xFF02, 0xFA57, 0xFF03, 0x8194, 0xFF04, 0x8190, 0xFF05, 0x8193, 0xFF06, 0x8195, + 0xFF07, 0xFA56, 0xFF08, 0x8169, 0xFF09, 0x816A, 0xFF0A, 0x8196, 0xFF0B, 0x817B, 0xFF0C, 0x8143, 0xFF0D, 0x817C, 0xFF0E, 0x8144, + 0xFF0F, 0x815E, 0xFF10, 0x824F, 0xFF11, 0x8250, 0xFF12, 0x8251, 0xFF13, 0x8252, 0xFF14, 0x8253, 0xFF15, 0x8254, 0xFF16, 0x8255, + 0xFF17, 0x8256, 0xFF18, 0x8257, 0xFF19, 0x8258, 0xFF1A, 0x8146, 0xFF1B, 0x8147, 0xFF1C, 0x8183, 0xFF1D, 0x8181, 0xFF1E, 0x8184, + 0xFF1F, 0x8148, 0xFF20, 0x8197, 0xFF21, 0x8260, 0xFF22, 0x8261, 0xFF23, 0x8262, 0xFF24, 0x8263, 0xFF25, 0x8264, 0xFF26, 0x8265, + 0xFF27, 0x8266, 0xFF28, 0x8267, 0xFF29, 0x8268, 0xFF2A, 0x8269, 0xFF2B, 0x826A, 0xFF2C, 0x826B, 0xFF2D, 0x826C, 0xFF2E, 0x826D, + 0xFF2F, 0x826E, 0xFF30, 0x826F, 0xFF31, 0x8270, 0xFF32, 0x8271, 0xFF33, 0x8272, 0xFF34, 0x8273, 0xFF35, 0x8274, 0xFF36, 0x8275, + 0xFF37, 0x8276, 0xFF38, 0x8277, 0xFF39, 0x8278, 0xFF3A, 0x8279, 0xFF3B, 0x816D, 0xFF3C, 0x815F, 0xFF3D, 0x816E, 0xFF3E, 0x814F, + 0xFF3F, 0x8151, 0xFF40, 0x814D, 0xFF41, 0x8281, 0xFF42, 0x8282, 0xFF43, 0x8283, 0xFF44, 0x8284, 0xFF45, 0x8285, 0xFF46, 0x8286, + 0xFF47, 0x8287, 0xFF48, 0x8288, 0xFF49, 0x8289, 0xFF4A, 0x828A, 0xFF4B, 0x828B, 0xFF4C, 0x828C, 0xFF4D, 0x828D, 0xFF4E, 0x828E, + 0xFF4F, 0x828F, 0xFF50, 0x8290, 0xFF51, 0x8291, 0xFF52, 0x8292, 0xFF53, 0x8293, 0xFF54, 0x8294, 0xFF55, 0x8295, 0xFF56, 0x8296, + 0xFF57, 0x8297, 0xFF58, 0x8298, 0xFF59, 0x8299, 0xFF5A, 0x829A, 0xFF5B, 0x816F, 0xFF5C, 0x8162, 0xFF5D, 0x8170, 0xFF5E, 0x8160, + 0xFF61, 0x00A1, 0xFF62, 0x00A2, 0xFF63, 0x00A3, 0xFF64, 0x00A4, 0xFF65, 0x00A5, 0xFF66, 0x00A6, 0xFF67, 0x00A7, 0xFF68, 0x00A8, + 0xFF69, 0x00A9, 0xFF6A, 0x00AA, 0xFF6B, 0x00AB, 0xFF6C, 0x00AC, 0xFF6D, 0x00AD, 0xFF6E, 0x00AE, 0xFF6F, 0x00AF, 0xFF70, 0x00B0, + 0xFF71, 0x00B1, 0xFF72, 0x00B2, 0xFF73, 0x00B3, 0xFF74, 0x00B4, 0xFF75, 0x00B5, 0xFF76, 0x00B6, 0xFF77, 0x00B7, 0xFF78, 0x00B8, + 0xFF79, 0x00B9, 0xFF7A, 0x00BA, 0xFF7B, 0x00BB, 0xFF7C, 0x00BC, 0xFF7D, 0x00BD, 0xFF7E, 0x00BE, 0xFF7F, 0x00BF, 0xFF80, 0x00C0, + 0xFF81, 0x00C1, 0xFF82, 0x00C2, 0xFF83, 0x00C3, 0xFF84, 0x00C4, 0xFF85, 0x00C5, 0xFF86, 0x00C6, 0xFF87, 0x00C7, 0xFF88, 0x00C8, + 0xFF89, 0x00C9, 0xFF8A, 0x00CA, 0xFF8B, 0x00CB, 0xFF8C, 0x00CC, 0xFF8D, 0x00CD, 0xFF8E, 0x00CE, 0xFF8F, 0x00CF, 0xFF90, 0x00D0, + 0xFF91, 0x00D1, 0xFF92, 0x00D2, 0xFF93, 0x00D3, 0xFF94, 0x00D4, 0xFF95, 0x00D5, 0xFF96, 0x00D6, 0xFF97, 0x00D7, 0xFF98, 0x00D8, + 0xFF99, 0x00D9, 0xFF9A, 0x00DA, 0xFF9B, 0x00DB, 0xFF9C, 0x00DC, 0xFF9D, 0x00DD, 0xFF9E, 0x00DE, 0xFF9F, 0x00DF, 0xFFE0, 0x8191, + 0xFFE1, 0x8192, 0xFFE2, 0x81CA, 0xFFE3, 0x8150, 0xFFE4, 0xFA55, 0xFFE5, 0x818F, 0, 0 +}; + +static const WCHAR oem2uni932[] = { /* Shift_JIS --> Unicode pairs */ + 0x00A1, 0xFF61, 0x00A2, 0xFF62, 0x00A3, 0xFF63, 0x00A4, 0xFF64, 0x00A5, 0xFF65, 0x00A6, 0xFF66, 0x00A7, 0xFF67, 0x00A8, 0xFF68, + 0x00A9, 0xFF69, 0x00AA, 0xFF6A, 0x00AB, 0xFF6B, 0x00AC, 0xFF6C, 0x00AD, 0xFF6D, 0x00AE, 0xFF6E, 0x00AF, 0xFF6F, 0x00B0, 0xFF70, + 0x00B1, 0xFF71, 0x00B2, 0xFF72, 0x00B3, 0xFF73, 0x00B4, 0xFF74, 0x00B5, 0xFF75, 0x00B6, 0xFF76, 0x00B7, 0xFF77, 0x00B8, 0xFF78, + 0x00B9, 0xFF79, 0x00BA, 0xFF7A, 0x00BB, 0xFF7B, 0x00BC, 0xFF7C, 0x00BD, 0xFF7D, 0x00BE, 0xFF7E, 0x00BF, 0xFF7F, 0x00C0, 0xFF80, + 0x00C1, 0xFF81, 0x00C2, 0xFF82, 0x00C3, 0xFF83, 0x00C4, 0xFF84, 0x00C5, 0xFF85, 0x00C6, 0xFF86, 0x00C7, 0xFF87, 0x00C8, 0xFF88, + 0x00C9, 0xFF89, 0x00CA, 0xFF8A, 0x00CB, 0xFF8B, 0x00CC, 0xFF8C, 0x00CD, 0xFF8D, 0x00CE, 0xFF8E, 0x00CF, 0xFF8F, 0x00D0, 0xFF90, + 0x00D1, 0xFF91, 0x00D2, 0xFF92, 0x00D3, 0xFF93, 0x00D4, 0xFF94, 0x00D5, 0xFF95, 0x00D6, 0xFF96, 0x00D7, 0xFF97, 0x00D8, 0xFF98, + 0x00D9, 0xFF99, 0x00DA, 0xFF9A, 0x00DB, 0xFF9B, 0x00DC, 0xFF9C, 0x00DD, 0xFF9D, 0x00DE, 0xFF9E, 0x00DF, 0xFF9F, 0x8140, 0x3000, + 0x8141, 0x3001, 0x8142, 0x3002, 0x8143, 0xFF0C, 0x8144, 0xFF0E, 0x8145, 0x30FB, 0x8146, 0xFF1A, 0x8147, 0xFF1B, 0x8148, 0xFF1F, + 0x8149, 0xFF01, 0x814A, 0x309B, 0x814B, 0x309C, 0x814C, 0x00B4, 0x814D, 0xFF40, 0x814E, 0x00A8, 0x814F, 0xFF3E, 0x8150, 0xFFE3, + 0x8151, 0xFF3F, 0x8152, 0x30FD, 0x8153, 0x30FE, 0x8154, 0x309D, 0x8155, 0x309E, 0x8156, 0x3003, 0x8157, 0x4EDD, 0x8158, 0x3005, + 0x8159, 0x3006, 0x815A, 0x3007, 0x815B, 0x30FC, 0x815C, 0x2015, 0x815D, 0x2010, 0x815E, 0xFF0F, 0x815F, 0xFF3C, 0x8160, 0xFF5E, + 0x8161, 0x2225, 0x8162, 0xFF5C, 0x8163, 0x2026, 0x8164, 0x2025, 0x8165, 0x2018, 0x8166, 0x2019, 0x8167, 0x201C, 0x8168, 0x201D, + 0x8169, 0xFF08, 0x816A, 0xFF09, 0x816B, 0x3014, 0x816C, 0x3015, 0x816D, 0xFF3B, 0x816E, 0xFF3D, 0x816F, 0xFF5B, 0x8170, 0xFF5D, + 0x8171, 0x3008, 0x8172, 0x3009, 0x8173, 0x300A, 0x8174, 0x300B, 0x8175, 0x300C, 0x8176, 0x300D, 0x8177, 0x300E, 0x8178, 0x300F, + 0x8179, 0x3010, 0x817A, 0x3011, 0x817B, 0xFF0B, 0x817C, 0xFF0D, 0x817D, 0x00B1, 0x817E, 0x00D7, 0x8180, 0x00F7, 0x8181, 0xFF1D, + 0x8182, 0x2260, 0x8183, 0xFF1C, 0x8184, 0xFF1E, 0x8185, 0x2266, 0x8186, 0x2267, 0x8187, 0x221E, 0x8188, 0x2234, 0x8189, 0x2642, + 0x818A, 0x2640, 0x818B, 0x00B0, 0x818C, 0x2032, 0x818D, 0x2033, 0x818E, 0x2103, 0x818F, 0xFFE5, 0x8190, 0xFF04, 0x8191, 0xFFE0, + 0x8192, 0xFFE1, 0x8193, 0xFF05, 0x8194, 0xFF03, 0x8195, 0xFF06, 0x8196, 0xFF0A, 0x8197, 0xFF20, 0x8198, 0x00A7, 0x8199, 0x2606, + 0x819A, 0x2605, 0x819B, 0x25CB, 0x819C, 0x25CF, 0x819D, 0x25CE, 0x819E, 0x25C7, 0x819F, 0x25C6, 0x81A0, 0x25A1, 0x81A1, 0x25A0, + 0x81A2, 0x25B3, 0x81A3, 0x25B2, 0x81A4, 0x25BD, 0x81A5, 0x25BC, 0x81A6, 0x203B, 0x81A7, 0x3012, 0x81A8, 0x2192, 0x81A9, 0x2190, + 0x81AA, 0x2191, 0x81AB, 0x2193, 0x81AC, 0x3013, 0x81B8, 0x2208, 0x81B9, 0x220B, 0x81BA, 0x2286, 0x81BB, 0x2287, 0x81BC, 0x2282, + 0x81BD, 0x2283, 0x81BE, 0x222A, 0x81BF, 0x2229, 0x81C8, 0x2227, 0x81C9, 0x2228, 0x81CA, 0xFFE2, 0x81CB, 0x21D2, 0x81CC, 0x21D4, + 0x81CD, 0x2200, 0x81CE, 0x2203, 0x81DA, 0x2220, 0x81DB, 0x22A5, 0x81DC, 0x2312, 0x81DD, 0x2202, 0x81DE, 0x2207, 0x81DF, 0x2261, + 0x81E0, 0x2252, 0x81E1, 0x226A, 0x81E2, 0x226B, 0x81E3, 0x221A, 0x81E4, 0x223D, 0x81E5, 0x221D, 0x81E6, 0x2235, 0x81E7, 0x222B, + 0x81E8, 0x222C, 0x81F0, 0x212B, 0x81F1, 0x2030, 0x81F2, 0x266F, 0x81F3, 0x266D, 0x81F4, 0x266A, 0x81F5, 0x2020, 0x81F6, 0x2021, + 0x81F7, 0x00B6, 0x81FC, 0x25EF, 0x824F, 0xFF10, 0x8250, 0xFF11, 0x8251, 0xFF12, 0x8252, 0xFF13, 0x8253, 0xFF14, 0x8254, 0xFF15, + 0x8255, 0xFF16, 0x8256, 0xFF17, 0x8257, 0xFF18, 0x8258, 0xFF19, 0x8260, 0xFF21, 0x8261, 0xFF22, 0x8262, 0xFF23, 0x8263, 0xFF24, + 0x8264, 0xFF25, 0x8265, 0xFF26, 0x8266, 0xFF27, 0x8267, 0xFF28, 0x8268, 0xFF29, 0x8269, 0xFF2A, 0x826A, 0xFF2B, 0x826B, 0xFF2C, + 0x826C, 0xFF2D, 0x826D, 0xFF2E, 0x826E, 0xFF2F, 0x826F, 0xFF30, 0x8270, 0xFF31, 0x8271, 0xFF32, 0x8272, 0xFF33, 0x8273, 0xFF34, + 0x8274, 0xFF35, 0x8275, 0xFF36, 0x8276, 0xFF37, 0x8277, 0xFF38, 0x8278, 0xFF39, 0x8279, 0xFF3A, 0x8281, 0xFF41, 0x8282, 0xFF42, + 0x8283, 0xFF43, 0x8284, 0xFF44, 0x8285, 0xFF45, 0x8286, 0xFF46, 0x8287, 0xFF47, 0x8288, 0xFF48, 0x8289, 0xFF49, 0x828A, 0xFF4A, + 0x828B, 0xFF4B, 0x828C, 0xFF4C, 0x828D, 0xFF4D, 0x828E, 0xFF4E, 0x828F, 0xFF4F, 0x8290, 0xFF50, 0x8291, 0xFF51, 0x8292, 0xFF52, + 0x8293, 0xFF53, 0x8294, 0xFF54, 0x8295, 0xFF55, 0x8296, 0xFF56, 0x8297, 0xFF57, 0x8298, 0xFF58, 0x8299, 0xFF59, 0x829A, 0xFF5A, + 0x829F, 0x3041, 0x82A0, 0x3042, 0x82A1, 0x3043, 0x82A2, 0x3044, 0x82A3, 0x3045, 0x82A4, 0x3046, 0x82A5, 0x3047, 0x82A6, 0x3048, + 0x82A7, 0x3049, 0x82A8, 0x304A, 0x82A9, 0x304B, 0x82AA, 0x304C, 0x82AB, 0x304D, 0x82AC, 0x304E, 0x82AD, 0x304F, 0x82AE, 0x3050, + 0x82AF, 0x3051, 0x82B0, 0x3052, 0x82B1, 0x3053, 0x82B2, 0x3054, 0x82B3, 0x3055, 0x82B4, 0x3056, 0x82B5, 0x3057, 0x82B6, 0x3058, + 0x82B7, 0x3059, 0x82B8, 0x305A, 0x82B9, 0x305B, 0x82BA, 0x305C, 0x82BB, 0x305D, 0x82BC, 0x305E, 0x82BD, 0x305F, 0x82BE, 0x3060, + 0x82BF, 0x3061, 0x82C0, 0x3062, 0x82C1, 0x3063, 0x82C2, 0x3064, 0x82C3, 0x3065, 0x82C4, 0x3066, 0x82C5, 0x3067, 0x82C6, 0x3068, + 0x82C7, 0x3069, 0x82C8, 0x306A, 0x82C9, 0x306B, 0x82CA, 0x306C, 0x82CB, 0x306D, 0x82CC, 0x306E, 0x82CD, 0x306F, 0x82CE, 0x3070, + 0x82CF, 0x3071, 0x82D0, 0x3072, 0x82D1, 0x3073, 0x82D2, 0x3074, 0x82D3, 0x3075, 0x82D4, 0x3076, 0x82D5, 0x3077, 0x82D6, 0x3078, + 0x82D7, 0x3079, 0x82D8, 0x307A, 0x82D9, 0x307B, 0x82DA, 0x307C, 0x82DB, 0x307D, 0x82DC, 0x307E, 0x82DD, 0x307F, 0x82DE, 0x3080, + 0x82DF, 0x3081, 0x82E0, 0x3082, 0x82E1, 0x3083, 0x82E2, 0x3084, 0x82E3, 0x3085, 0x82E4, 0x3086, 0x82E5, 0x3087, 0x82E6, 0x3088, + 0x82E7, 0x3089, 0x82E8, 0x308A, 0x82E9, 0x308B, 0x82EA, 0x308C, 0x82EB, 0x308D, 0x82EC, 0x308E, 0x82ED, 0x308F, 0x82EE, 0x3090, + 0x82EF, 0x3091, 0x82F0, 0x3092, 0x82F1, 0x3093, 0x8340, 0x30A1, 0x8341, 0x30A2, 0x8342, 0x30A3, 0x8343, 0x30A4, 0x8344, 0x30A5, + 0x8345, 0x30A6, 0x8346, 0x30A7, 0x8347, 0x30A8, 0x8348, 0x30A9, 0x8349, 0x30AA, 0x834A, 0x30AB, 0x834B, 0x30AC, 0x834C, 0x30AD, + 0x834D, 0x30AE, 0x834E, 0x30AF, 0x834F, 0x30B0, 0x8350, 0x30B1, 0x8351, 0x30B2, 0x8352, 0x30B3, 0x8353, 0x30B4, 0x8354, 0x30B5, + 0x8355, 0x30B6, 0x8356, 0x30B7, 0x8357, 0x30B8, 0x8358, 0x30B9, 0x8359, 0x30BA, 0x835A, 0x30BB, 0x835B, 0x30BC, 0x835C, 0x30BD, + 0x835D, 0x30BE, 0x835E, 0x30BF, 0x835F, 0x30C0, 0x8360, 0x30C1, 0x8361, 0x30C2, 0x8362, 0x30C3, 0x8363, 0x30C4, 0x8364, 0x30C5, + 0x8365, 0x30C6, 0x8366, 0x30C7, 0x8367, 0x30C8, 0x8368, 0x30C9, 0x8369, 0x30CA, 0x836A, 0x30CB, 0x836B, 0x30CC, 0x836C, 0x30CD, + 0x836D, 0x30CE, 0x836E, 0x30CF, 0x836F, 0x30D0, 0x8370, 0x30D1, 0x8371, 0x30D2, 0x8372, 0x30D3, 0x8373, 0x30D4, 0x8374, 0x30D5, + 0x8375, 0x30D6, 0x8376, 0x30D7, 0x8377, 0x30D8, 0x8378, 0x30D9, 0x8379, 0x30DA, 0x837A, 0x30DB, 0x837B, 0x30DC, 0x837C, 0x30DD, + 0x837D, 0x30DE, 0x837E, 0x30DF, 0x8380, 0x30E0, 0x8381, 0x30E1, 0x8382, 0x30E2, 0x8383, 0x30E3, 0x8384, 0x30E4, 0x8385, 0x30E5, + 0x8386, 0x30E6, 0x8387, 0x30E7, 0x8388, 0x30E8, 0x8389, 0x30E9, 0x838A, 0x30EA, 0x838B, 0x30EB, 0x838C, 0x30EC, 0x838D, 0x30ED, + 0x838E, 0x30EE, 0x838F, 0x30EF, 0x8390, 0x30F0, 0x8391, 0x30F1, 0x8392, 0x30F2, 0x8393, 0x30F3, 0x8394, 0x30F4, 0x8395, 0x30F5, + 0x8396, 0x30F6, 0x839F, 0x0391, 0x83A0, 0x0392, 0x83A1, 0x0393, 0x83A2, 0x0394, 0x83A3, 0x0395, 0x83A4, 0x0396, 0x83A5, 0x0397, + 0x83A6, 0x0398, 0x83A7, 0x0399, 0x83A8, 0x039A, 0x83A9, 0x039B, 0x83AA, 0x039C, 0x83AB, 0x039D, 0x83AC, 0x039E, 0x83AD, 0x039F, + 0x83AE, 0x03A0, 0x83AF, 0x03A1, 0x83B0, 0x03A3, 0x83B1, 0x03A4, 0x83B2, 0x03A5, 0x83B3, 0x03A6, 0x83B4, 0x03A7, 0x83B5, 0x03A8, + 0x83B6, 0x03A9, 0x83BF, 0x03B1, 0x83C0, 0x03B2, 0x83C1, 0x03B3, 0x83C2, 0x03B4, 0x83C3, 0x03B5, 0x83C4, 0x03B6, 0x83C5, 0x03B7, + 0x83C6, 0x03B8, 0x83C7, 0x03B9, 0x83C8, 0x03BA, 0x83C9, 0x03BB, 0x83CA, 0x03BC, 0x83CB, 0x03BD, 0x83CC, 0x03BE, 0x83CD, 0x03BF, + 0x83CE, 0x03C0, 0x83CF, 0x03C1, 0x83D0, 0x03C3, 0x83D1, 0x03C4, 0x83D2, 0x03C5, 0x83D3, 0x03C6, 0x83D4, 0x03C7, 0x83D5, 0x03C8, + 0x83D6, 0x03C9, 0x8440, 0x0410, 0x8441, 0x0411, 0x8442, 0x0412, 0x8443, 0x0413, 0x8444, 0x0414, 0x8445, 0x0415, 0x8446, 0x0401, + 0x8447, 0x0416, 0x8448, 0x0417, 0x8449, 0x0418, 0x844A, 0x0419, 0x844B, 0x041A, 0x844C, 0x041B, 0x844D, 0x041C, 0x844E, 0x041D, + 0x844F, 0x041E, 0x8450, 0x041F, 0x8451, 0x0420, 0x8452, 0x0421, 0x8453, 0x0422, 0x8454, 0x0423, 0x8455, 0x0424, 0x8456, 0x0425, + 0x8457, 0x0426, 0x8458, 0x0427, 0x8459, 0x0428, 0x845A, 0x0429, 0x845B, 0x042A, 0x845C, 0x042B, 0x845D, 0x042C, 0x845E, 0x042D, + 0x845F, 0x042E, 0x8460, 0x042F, 0x8470, 0x0430, 0x8471, 0x0431, 0x8472, 0x0432, 0x8473, 0x0433, 0x8474, 0x0434, 0x8475, 0x0435, + 0x8476, 0x0451, 0x8477, 0x0436, 0x8478, 0x0437, 0x8479, 0x0438, 0x847A, 0x0439, 0x847B, 0x043A, 0x847C, 0x043B, 0x847D, 0x043C, + 0x847E, 0x043D, 0x8480, 0x043E, 0x8481, 0x043F, 0x8482, 0x0440, 0x8483, 0x0441, 0x8484, 0x0442, 0x8485, 0x0443, 0x8486, 0x0444, + 0x8487, 0x0445, 0x8488, 0x0446, 0x8489, 0x0447, 0x848A, 0x0448, 0x848B, 0x0449, 0x848C, 0x044A, 0x848D, 0x044B, 0x848E, 0x044C, + 0x848F, 0x044D, 0x8490, 0x044E, 0x8491, 0x044F, 0x849F, 0x2500, 0x84A0, 0x2502, 0x84A1, 0x250C, 0x84A2, 0x2510, 0x84A3, 0x2518, + 0x84A4, 0x2514, 0x84A5, 0x251C, 0x84A6, 0x252C, 0x84A7, 0x2524, 0x84A8, 0x2534, 0x84A9, 0x253C, 0x84AA, 0x2501, 0x84AB, 0x2503, + 0x84AC, 0x250F, 0x84AD, 0x2513, 0x84AE, 0x251B, 0x84AF, 0x2517, 0x84B0, 0x2523, 0x84B1, 0x2533, 0x84B2, 0x252B, 0x84B3, 0x253B, + 0x84B4, 0x254B, 0x84B5, 0x2520, 0x84B6, 0x252F, 0x84B7, 0x2528, 0x84B8, 0x2537, 0x84B9, 0x253F, 0x84BA, 0x251D, 0x84BB, 0x2530, + 0x84BC, 0x2525, 0x84BD, 0x2538, 0x84BE, 0x2542, 0x8740, 0x2460, 0x8741, 0x2461, 0x8742, 0x2462, 0x8743, 0x2463, 0x8744, 0x2464, + 0x8745, 0x2465, 0x8746, 0x2466, 0x8747, 0x2467, 0x8748, 0x2468, 0x8749, 0x2469, 0x874A, 0x246A, 0x874B, 0x246B, 0x874C, 0x246C, + 0x874D, 0x246D, 0x874E, 0x246E, 0x874F, 0x246F, 0x8750, 0x2470, 0x8751, 0x2471, 0x8752, 0x2472, 0x8753, 0x2473, 0x8754, 0x2160, + 0x8755, 0x2161, 0x8756, 0x2162, 0x8757, 0x2163, 0x8758, 0x2164, 0x8759, 0x2165, 0x875A, 0x2166, 0x875B, 0x2167, 0x875C, 0x2168, + 0x875D, 0x2169, 0x875F, 0x3349, 0x8760, 0x3314, 0x8761, 0x3322, 0x8762, 0x334D, 0x8763, 0x3318, 0x8764, 0x3327, 0x8765, 0x3303, + 0x8766, 0x3336, 0x8767, 0x3351, 0x8768, 0x3357, 0x8769, 0x330D, 0x876A, 0x3326, 0x876B, 0x3323, 0x876C, 0x332B, 0x876D, 0x334A, + 0x876E, 0x333B, 0x876F, 0x339C, 0x8770, 0x339D, 0x8771, 0x339E, 0x8772, 0x338E, 0x8773, 0x338F, 0x8774, 0x33C4, 0x8775, 0x33A1, + 0x877E, 0x337B, 0x8780, 0x301D, 0x8781, 0x301F, 0x8782, 0x2116, 0x8783, 0x33CD, 0x8784, 0x2121, 0x8785, 0x32A4, 0x8786, 0x32A5, + 0x8787, 0x32A6, 0x8788, 0x32A7, 0x8789, 0x32A8, 0x878A, 0x3231, 0x878B, 0x3232, 0x878C, 0x3239, 0x878D, 0x337E, 0x878E, 0x337D, + 0x878F, 0x337C, 0x8793, 0x222E, 0x8794, 0x2211, 0x8798, 0x221F, 0x8799, 0x22BF, 0x889F, 0x4E9C, 0x88A0, 0x5516, 0x88A1, 0x5A03, + 0x88A2, 0x963F, 0x88A3, 0x54C0, 0x88A4, 0x611B, 0x88A5, 0x6328, 0x88A6, 0x59F6, 0x88A7, 0x9022, 0x88A8, 0x8475, 0x88A9, 0x831C, + 0x88AA, 0x7A50, 0x88AB, 0x60AA, 0x88AC, 0x63E1, 0x88AD, 0x6E25, 0x88AE, 0x65ED, 0x88AF, 0x8466, 0x88B0, 0x82A6, 0x88B1, 0x9BF5, + 0x88B2, 0x6893, 0x88B3, 0x5727, 0x88B4, 0x65A1, 0x88B5, 0x6271, 0x88B6, 0x5B9B, 0x88B7, 0x59D0, 0x88B8, 0x867B, 0x88B9, 0x98F4, + 0x88BA, 0x7D62, 0x88BB, 0x7DBE, 0x88BC, 0x9B8E, 0x88BD, 0x6216, 0x88BE, 0x7C9F, 0x88BF, 0x88B7, 0x88C0, 0x5B89, 0x88C1, 0x5EB5, + 0x88C2, 0x6309, 0x88C3, 0x6697, 0x88C4, 0x6848, 0x88C5, 0x95C7, 0x88C6, 0x978D, 0x88C7, 0x674F, 0x88C8, 0x4EE5, 0x88C9, 0x4F0A, + 0x88CA, 0x4F4D, 0x88CB, 0x4F9D, 0x88CC, 0x5049, 0x88CD, 0x56F2, 0x88CE, 0x5937, 0x88CF, 0x59D4, 0x88D0, 0x5A01, 0x88D1, 0x5C09, + 0x88D2, 0x60DF, 0x88D3, 0x610F, 0x88D4, 0x6170, 0x88D5, 0x6613, 0x88D6, 0x6905, 0x88D7, 0x70BA, 0x88D8, 0x754F, 0x88D9, 0x7570, + 0x88DA, 0x79FB, 0x88DB, 0x7DAD, 0x88DC, 0x7DEF, 0x88DD, 0x80C3, 0x88DE, 0x840E, 0x88DF, 0x8863, 0x88E0, 0x8B02, 0x88E1, 0x9055, + 0x88E2, 0x907A, 0x88E3, 0x533B, 0x88E4, 0x4E95, 0x88E5, 0x4EA5, 0x88E6, 0x57DF, 0x88E7, 0x80B2, 0x88E8, 0x90C1, 0x88E9, 0x78EF, + 0x88EA, 0x4E00, 0x88EB, 0x58F1, 0x88EC, 0x6EA2, 0x88ED, 0x9038, 0x88EE, 0x7A32, 0x88EF, 0x8328, 0x88F0, 0x828B, 0x88F1, 0x9C2F, + 0x88F2, 0x5141, 0x88F3, 0x5370, 0x88F4, 0x54BD, 0x88F5, 0x54E1, 0x88F6, 0x56E0, 0x88F7, 0x59FB, 0x88F8, 0x5F15, 0x88F9, 0x98F2, + 0x88FA, 0x6DEB, 0x88FB, 0x80E4, 0x88FC, 0x852D, 0x8940, 0x9662, 0x8941, 0x9670, 0x8942, 0x96A0, 0x8943, 0x97FB, 0x8944, 0x540B, + 0x8945, 0x53F3, 0x8946, 0x5B87, 0x8947, 0x70CF, 0x8948, 0x7FBD, 0x8949, 0x8FC2, 0x894A, 0x96E8, 0x894B, 0x536F, 0x894C, 0x9D5C, + 0x894D, 0x7ABA, 0x894E, 0x4E11, 0x894F, 0x7893, 0x8950, 0x81FC, 0x8951, 0x6E26, 0x8952, 0x5618, 0x8953, 0x5504, 0x8954, 0x6B1D, + 0x8955, 0x851A, 0x8956, 0x9C3B, 0x8957, 0x59E5, 0x8958, 0x53A9, 0x8959, 0x6D66, 0x895A, 0x74DC, 0x895B, 0x958F, 0x895C, 0x5642, + 0x895D, 0x4E91, 0x895E, 0x904B, 0x895F, 0x96F2, 0x8960, 0x834F, 0x8961, 0x990C, 0x8962, 0x53E1, 0x8963, 0x55B6, 0x8964, 0x5B30, + 0x8965, 0x5F71, 0x8966, 0x6620, 0x8967, 0x66F3, 0x8968, 0x6804, 0x8969, 0x6C38, 0x896A, 0x6CF3, 0x896B, 0x6D29, 0x896C, 0x745B, + 0x896D, 0x76C8, 0x896E, 0x7A4E, 0x896F, 0x9834, 0x8970, 0x82F1, 0x8971, 0x885B, 0x8972, 0x8A60, 0x8973, 0x92ED, 0x8974, 0x6DB2, + 0x8975, 0x75AB, 0x8976, 0x76CA, 0x8977, 0x99C5, 0x8978, 0x60A6, 0x8979, 0x8B01, 0x897A, 0x8D8A, 0x897B, 0x95B2, 0x897C, 0x698E, + 0x897D, 0x53AD, 0x897E, 0x5186, 0x8980, 0x5712, 0x8981, 0x5830, 0x8982, 0x5944, 0x8983, 0x5BB4, 0x8984, 0x5EF6, 0x8985, 0x6028, + 0x8986, 0x63A9, 0x8987, 0x63F4, 0x8988, 0x6CBF, 0x8989, 0x6F14, 0x898A, 0x708E, 0x898B, 0x7114, 0x898C, 0x7159, 0x898D, 0x71D5, + 0x898E, 0x733F, 0x898F, 0x7E01, 0x8990, 0x8276, 0x8991, 0x82D1, 0x8992, 0x8597, 0x8993, 0x9060, 0x8994, 0x925B, 0x8995, 0x9D1B, + 0x8996, 0x5869, 0x8997, 0x65BC, 0x8998, 0x6C5A, 0x8999, 0x7525, 0x899A, 0x51F9, 0x899B, 0x592E, 0x899C, 0x5965, 0x899D, 0x5F80, + 0x899E, 0x5FDC, 0x899F, 0x62BC, 0x89A0, 0x65FA, 0x89A1, 0x6A2A, 0x89A2, 0x6B27, 0x89A3, 0x6BB4, 0x89A4, 0x738B, 0x89A5, 0x7FC1, + 0x89A6, 0x8956, 0x89A7, 0x9D2C, 0x89A8, 0x9D0E, 0x89A9, 0x9EC4, 0x89AA, 0x5CA1, 0x89AB, 0x6C96, 0x89AC, 0x837B, 0x89AD, 0x5104, + 0x89AE, 0x5C4B, 0x89AF, 0x61B6, 0x89B0, 0x81C6, 0x89B1, 0x6876, 0x89B2, 0x7261, 0x89B3, 0x4E59, 0x89B4, 0x4FFA, 0x89B5, 0x5378, + 0x89B6, 0x6069, 0x89B7, 0x6E29, 0x89B8, 0x7A4F, 0x89B9, 0x97F3, 0x89BA, 0x4E0B, 0x89BB, 0x5316, 0x89BC, 0x4EEE, 0x89BD, 0x4F55, + 0x89BE, 0x4F3D, 0x89BF, 0x4FA1, 0x89C0, 0x4F73, 0x89C1, 0x52A0, 0x89C2, 0x53EF, 0x89C3, 0x5609, 0x89C4, 0x590F, 0x89C5, 0x5AC1, + 0x89C6, 0x5BB6, 0x89C7, 0x5BE1, 0x89C8, 0x79D1, 0x89C9, 0x6687, 0x89CA, 0x679C, 0x89CB, 0x67B6, 0x89CC, 0x6B4C, 0x89CD, 0x6CB3, + 0x89CE, 0x706B, 0x89CF, 0x73C2, 0x89D0, 0x798D, 0x89D1, 0x79BE, 0x89D2, 0x7A3C, 0x89D3, 0x7B87, 0x89D4, 0x82B1, 0x89D5, 0x82DB, + 0x89D6, 0x8304, 0x89D7, 0x8377, 0x89D8, 0x83EF, 0x89D9, 0x83D3, 0x89DA, 0x8766, 0x89DB, 0x8AB2, 0x89DC, 0x5629, 0x89DD, 0x8CA8, + 0x89DE, 0x8FE6, 0x89DF, 0x904E, 0x89E0, 0x971E, 0x89E1, 0x868A, 0x89E2, 0x4FC4, 0x89E3, 0x5CE8, 0x89E4, 0x6211, 0x89E5, 0x7259, + 0x89E6, 0x753B, 0x89E7, 0x81E5, 0x89E8, 0x82BD, 0x89E9, 0x86FE, 0x89EA, 0x8CC0, 0x89EB, 0x96C5, 0x89EC, 0x9913, 0x89ED, 0x99D5, + 0x89EE, 0x4ECB, 0x89EF, 0x4F1A, 0x89F0, 0x89E3, 0x89F1, 0x56DE, 0x89F2, 0x584A, 0x89F3, 0x58CA, 0x89F4, 0x5EFB, 0x89F5, 0x5FEB, + 0x89F6, 0x602A, 0x89F7, 0x6094, 0x89F8, 0x6062, 0x89F9, 0x61D0, 0x89FA, 0x6212, 0x89FB, 0x62D0, 0x89FC, 0x6539, 0x8A40, 0x9B41, + 0x8A41, 0x6666, 0x8A42, 0x68B0, 0x8A43, 0x6D77, 0x8A44, 0x7070, 0x8A45, 0x754C, 0x8A46, 0x7686, 0x8A47, 0x7D75, 0x8A48, 0x82A5, + 0x8A49, 0x87F9, 0x8A4A, 0x958B, 0x8A4B, 0x968E, 0x8A4C, 0x8C9D, 0x8A4D, 0x51F1, 0x8A4E, 0x52BE, 0x8A4F, 0x5916, 0x8A50, 0x54B3, + 0x8A51, 0x5BB3, 0x8A52, 0x5D16, 0x8A53, 0x6168, 0x8A54, 0x6982, 0x8A55, 0x6DAF, 0x8A56, 0x788D, 0x8A57, 0x84CB, 0x8A58, 0x8857, + 0x8A59, 0x8A72, 0x8A5A, 0x93A7, 0x8A5B, 0x9AB8, 0x8A5C, 0x6D6C, 0x8A5D, 0x99A8, 0x8A5E, 0x86D9, 0x8A5F, 0x57A3, 0x8A60, 0x67FF, + 0x8A61, 0x86CE, 0x8A62, 0x920E, 0x8A63, 0x5283, 0x8A64, 0x5687, 0x8A65, 0x5404, 0x8A66, 0x5ED3, 0x8A67, 0x62E1, 0x8A68, 0x64B9, + 0x8A69, 0x683C, 0x8A6A, 0x6838, 0x8A6B, 0x6BBB, 0x8A6C, 0x7372, 0x8A6D, 0x78BA, 0x8A6E, 0x7A6B, 0x8A6F, 0x899A, 0x8A70, 0x89D2, + 0x8A71, 0x8D6B, 0x8A72, 0x8F03, 0x8A73, 0x90ED, 0x8A74, 0x95A3, 0x8A75, 0x9694, 0x8A76, 0x9769, 0x8A77, 0x5B66, 0x8A78, 0x5CB3, + 0x8A79, 0x697D, 0x8A7A, 0x984D, 0x8A7B, 0x984E, 0x8A7C, 0x639B, 0x8A7D, 0x7B20, 0x8A7E, 0x6A2B, 0x8A80, 0x6A7F, 0x8A81, 0x68B6, + 0x8A82, 0x9C0D, 0x8A83, 0x6F5F, 0x8A84, 0x5272, 0x8A85, 0x559D, 0x8A86, 0x6070, 0x8A87, 0x62EC, 0x8A88, 0x6D3B, 0x8A89, 0x6E07, + 0x8A8A, 0x6ED1, 0x8A8B, 0x845B, 0x8A8C, 0x8910, 0x8A8D, 0x8F44, 0x8A8E, 0x4E14, 0x8A8F, 0x9C39, 0x8A90, 0x53F6, 0x8A91, 0x691B, + 0x8A92, 0x6A3A, 0x8A93, 0x9784, 0x8A94, 0x682A, 0x8A95, 0x515C, 0x8A96, 0x7AC3, 0x8A97, 0x84B2, 0x8A98, 0x91DC, 0x8A99, 0x938C, + 0x8A9A, 0x565B, 0x8A9B, 0x9D28, 0x8A9C, 0x6822, 0x8A9D, 0x8305, 0x8A9E, 0x8431, 0x8A9F, 0x7CA5, 0x8AA0, 0x5208, 0x8AA1, 0x82C5, + 0x8AA2, 0x74E6, 0x8AA3, 0x4E7E, 0x8AA4, 0x4F83, 0x8AA5, 0x51A0, 0x8AA6, 0x5BD2, 0x8AA7, 0x520A, 0x8AA8, 0x52D8, 0x8AA9, 0x52E7, + 0x8AAA, 0x5DFB, 0x8AAB, 0x559A, 0x8AAC, 0x582A, 0x8AAD, 0x59E6, 0x8AAE, 0x5B8C, 0x8AAF, 0x5B98, 0x8AB0, 0x5BDB, 0x8AB1, 0x5E72, + 0x8AB2, 0x5E79, 0x8AB3, 0x60A3, 0x8AB4, 0x611F, 0x8AB5, 0x6163, 0x8AB6, 0x61BE, 0x8AB7, 0x63DB, 0x8AB8, 0x6562, 0x8AB9, 0x67D1, + 0x8ABA, 0x6853, 0x8ABB, 0x68FA, 0x8ABC, 0x6B3E, 0x8ABD, 0x6B53, 0x8ABE, 0x6C57, 0x8ABF, 0x6F22, 0x8AC0, 0x6F97, 0x8AC1, 0x6F45, + 0x8AC2, 0x74B0, 0x8AC3, 0x7518, 0x8AC4, 0x76E3, 0x8AC5, 0x770B, 0x8AC6, 0x7AFF, 0x8AC7, 0x7BA1, 0x8AC8, 0x7C21, 0x8AC9, 0x7DE9, + 0x8ACA, 0x7F36, 0x8ACB, 0x7FF0, 0x8ACC, 0x809D, 0x8ACD, 0x8266, 0x8ACE, 0x839E, 0x8ACF, 0x89B3, 0x8AD0, 0x8ACC, 0x8AD1, 0x8CAB, + 0x8AD2, 0x9084, 0x8AD3, 0x9451, 0x8AD4, 0x9593, 0x8AD5, 0x9591, 0x8AD6, 0x95A2, 0x8AD7, 0x9665, 0x8AD8, 0x97D3, 0x8AD9, 0x9928, + 0x8ADA, 0x8218, 0x8ADB, 0x4E38, 0x8ADC, 0x542B, 0x8ADD, 0x5CB8, 0x8ADE, 0x5DCC, 0x8ADF, 0x73A9, 0x8AE0, 0x764C, 0x8AE1, 0x773C, + 0x8AE2, 0x5CA9, 0x8AE3, 0x7FEB, 0x8AE4, 0x8D0B, 0x8AE5, 0x96C1, 0x8AE6, 0x9811, 0x8AE7, 0x9854, 0x8AE8, 0x9858, 0x8AE9, 0x4F01, + 0x8AEA, 0x4F0E, 0x8AEB, 0x5371, 0x8AEC, 0x559C, 0x8AED, 0x5668, 0x8AEE, 0x57FA, 0x8AEF, 0x5947, 0x8AF0, 0x5B09, 0x8AF1, 0x5BC4, + 0x8AF2, 0x5C90, 0x8AF3, 0x5E0C, 0x8AF4, 0x5E7E, 0x8AF5, 0x5FCC, 0x8AF6, 0x63EE, 0x8AF7, 0x673A, 0x8AF8, 0x65D7, 0x8AF9, 0x65E2, + 0x8AFA, 0x671F, 0x8AFB, 0x68CB, 0x8AFC, 0x68C4, 0x8B40, 0x6A5F, 0x8B41, 0x5E30, 0x8B42, 0x6BC5, 0x8B43, 0x6C17, 0x8B44, 0x6C7D, + 0x8B45, 0x757F, 0x8B46, 0x7948, 0x8B47, 0x5B63, 0x8B48, 0x7A00, 0x8B49, 0x7D00, 0x8B4A, 0x5FBD, 0x8B4B, 0x898F, 0x8B4C, 0x8A18, + 0x8B4D, 0x8CB4, 0x8B4E, 0x8D77, 0x8B4F, 0x8ECC, 0x8B50, 0x8F1D, 0x8B51, 0x98E2, 0x8B52, 0x9A0E, 0x8B53, 0x9B3C, 0x8B54, 0x4E80, + 0x8B55, 0x507D, 0x8B56, 0x5100, 0x8B57, 0x5993, 0x8B58, 0x5B9C, 0x8B59, 0x622F, 0x8B5A, 0x6280, 0x8B5B, 0x64EC, 0x8B5C, 0x6B3A, + 0x8B5D, 0x72A0, 0x8B5E, 0x7591, 0x8B5F, 0x7947, 0x8B60, 0x7FA9, 0x8B61, 0x87FB, 0x8B62, 0x8ABC, 0x8B63, 0x8B70, 0x8B64, 0x63AC, + 0x8B65, 0x83CA, 0x8B66, 0x97A0, 0x8B67, 0x5409, 0x8B68, 0x5403, 0x8B69, 0x55AB, 0x8B6A, 0x6854, 0x8B6B, 0x6A58, 0x8B6C, 0x8A70, + 0x8B6D, 0x7827, 0x8B6E, 0x6775, 0x8B6F, 0x9ECD, 0x8B70, 0x5374, 0x8B71, 0x5BA2, 0x8B72, 0x811A, 0x8B73, 0x8650, 0x8B74, 0x9006, + 0x8B75, 0x4E18, 0x8B76, 0x4E45, 0x8B77, 0x4EC7, 0x8B78, 0x4F11, 0x8B79, 0x53CA, 0x8B7A, 0x5438, 0x8B7B, 0x5BAE, 0x8B7C, 0x5F13, + 0x8B7D, 0x6025, 0x8B7E, 0x6551, 0x8B80, 0x673D, 0x8B81, 0x6C42, 0x8B82, 0x6C72, 0x8B83, 0x6CE3, 0x8B84, 0x7078, 0x8B85, 0x7403, + 0x8B86, 0x7A76, 0x8B87, 0x7AAE, 0x8B88, 0x7B08, 0x8B89, 0x7D1A, 0x8B8A, 0x7CFE, 0x8B8B, 0x7D66, 0x8B8C, 0x65E7, 0x8B8D, 0x725B, + 0x8B8E, 0x53BB, 0x8B8F, 0x5C45, 0x8B90, 0x5DE8, 0x8B91, 0x62D2, 0x8B92, 0x62E0, 0x8B93, 0x6319, 0x8B94, 0x6E20, 0x8B95, 0x865A, + 0x8B96, 0x8A31, 0x8B97, 0x8DDD, 0x8B98, 0x92F8, 0x8B99, 0x6F01, 0x8B9A, 0x79A6, 0x8B9B, 0x9B5A, 0x8B9C, 0x4EA8, 0x8B9D, 0x4EAB, + 0x8B9E, 0x4EAC, 0x8B9F, 0x4F9B, 0x8BA0, 0x4FA0, 0x8BA1, 0x50D1, 0x8BA2, 0x5147, 0x8BA3, 0x7AF6, 0x8BA4, 0x5171, 0x8BA5, 0x51F6, + 0x8BA6, 0x5354, 0x8BA7, 0x5321, 0x8BA8, 0x537F, 0x8BA9, 0x53EB, 0x8BAA, 0x55AC, 0x8BAB, 0x5883, 0x8BAC, 0x5CE1, 0x8BAD, 0x5F37, + 0x8BAE, 0x5F4A, 0x8BAF, 0x602F, 0x8BB0, 0x6050, 0x8BB1, 0x606D, 0x8BB2, 0x631F, 0x8BB3, 0x6559, 0x8BB4, 0x6A4B, 0x8BB5, 0x6CC1, + 0x8BB6, 0x72C2, 0x8BB7, 0x72ED, 0x8BB8, 0x77EF, 0x8BB9, 0x80F8, 0x8BBA, 0x8105, 0x8BBB, 0x8208, 0x8BBC, 0x854E, 0x8BBD, 0x90F7, + 0x8BBE, 0x93E1, 0x8BBF, 0x97FF, 0x8BC0, 0x9957, 0x8BC1, 0x9A5A, 0x8BC2, 0x4EF0, 0x8BC3, 0x51DD, 0x8BC4, 0x5C2D, 0x8BC5, 0x6681, + 0x8BC6, 0x696D, 0x8BC7, 0x5C40, 0x8BC8, 0x66F2, 0x8BC9, 0x6975, 0x8BCA, 0x7389, 0x8BCB, 0x6850, 0x8BCC, 0x7C81, 0x8BCD, 0x50C5, + 0x8BCE, 0x52E4, 0x8BCF, 0x5747, 0x8BD0, 0x5DFE, 0x8BD1, 0x9326, 0x8BD2, 0x65A4, 0x8BD3, 0x6B23, 0x8BD4, 0x6B3D, 0x8BD5, 0x7434, + 0x8BD6, 0x7981, 0x8BD7, 0x79BD, 0x8BD8, 0x7B4B, 0x8BD9, 0x7DCA, 0x8BDA, 0x82B9, 0x8BDB, 0x83CC, 0x8BDC, 0x887F, 0x8BDD, 0x895F, + 0x8BDE, 0x8B39, 0x8BDF, 0x8FD1, 0x8BE0, 0x91D1, 0x8BE1, 0x541F, 0x8BE2, 0x9280, 0x8BE3, 0x4E5D, 0x8BE4, 0x5036, 0x8BE5, 0x53E5, + 0x8BE6, 0x533A, 0x8BE7, 0x72D7, 0x8BE8, 0x7396, 0x8BE9, 0x77E9, 0x8BEA, 0x82E6, 0x8BEB, 0x8EAF, 0x8BEC, 0x99C6, 0x8BED, 0x99C8, + 0x8BEE, 0x99D2, 0x8BEF, 0x5177, 0x8BF0, 0x611A, 0x8BF1, 0x865E, 0x8BF2, 0x55B0, 0x8BF3, 0x7A7A, 0x8BF4, 0x5076, 0x8BF5, 0x5BD3, + 0x8BF6, 0x9047, 0x8BF7, 0x9685, 0x8BF8, 0x4E32, 0x8BF9, 0x6ADB, 0x8BFA, 0x91E7, 0x8BFB, 0x5C51, 0x8BFC, 0x5C48, 0x8C40, 0x6398, + 0x8C41, 0x7A9F, 0x8C42, 0x6C93, 0x8C43, 0x9774, 0x8C44, 0x8F61, 0x8C45, 0x7AAA, 0x8C46, 0x718A, 0x8C47, 0x9688, 0x8C48, 0x7C82, + 0x8C49, 0x6817, 0x8C4A, 0x7E70, 0x8C4B, 0x6851, 0x8C4C, 0x936C, 0x8C4D, 0x52F2, 0x8C4E, 0x541B, 0x8C4F, 0x85AB, 0x8C50, 0x8A13, + 0x8C51, 0x7FA4, 0x8C52, 0x8ECD, 0x8C53, 0x90E1, 0x8C54, 0x5366, 0x8C55, 0x8888, 0x8C56, 0x7941, 0x8C57, 0x4FC2, 0x8C58, 0x50BE, + 0x8C59, 0x5211, 0x8C5A, 0x5144, 0x8C5B, 0x5553, 0x8C5C, 0x572D, 0x8C5D, 0x73EA, 0x8C5E, 0x578B, 0x8C5F, 0x5951, 0x8C60, 0x5F62, + 0x8C61, 0x5F84, 0x8C62, 0x6075, 0x8C63, 0x6176, 0x8C64, 0x6167, 0x8C65, 0x61A9, 0x8C66, 0x63B2, 0x8C67, 0x643A, 0x8C68, 0x656C, + 0x8C69, 0x666F, 0x8C6A, 0x6842, 0x8C6B, 0x6E13, 0x8C6C, 0x7566, 0x8C6D, 0x7A3D, 0x8C6E, 0x7CFB, 0x8C6F, 0x7D4C, 0x8C70, 0x7D99, + 0x8C71, 0x7E4B, 0x8C72, 0x7F6B, 0x8C73, 0x830E, 0x8C74, 0x834A, 0x8C75, 0x86CD, 0x8C76, 0x8A08, 0x8C77, 0x8A63, 0x8C78, 0x8B66, + 0x8C79, 0x8EFD, 0x8C7A, 0x981A, 0x8C7B, 0x9D8F, 0x8C7C, 0x82B8, 0x8C7D, 0x8FCE, 0x8C7E, 0x9BE8, 0x8C80, 0x5287, 0x8C81, 0x621F, + 0x8C82, 0x6483, 0x8C83, 0x6FC0, 0x8C84, 0x9699, 0x8C85, 0x6841, 0x8C86, 0x5091, 0x8C87, 0x6B20, 0x8C88, 0x6C7A, 0x8C89, 0x6F54, + 0x8C8A, 0x7A74, 0x8C8B, 0x7D50, 0x8C8C, 0x8840, 0x8C8D, 0x8A23, 0x8C8E, 0x6708, 0x8C8F, 0x4EF6, 0x8C90, 0x5039, 0x8C91, 0x5026, + 0x8C92, 0x5065, 0x8C93, 0x517C, 0x8C94, 0x5238, 0x8C95, 0x5263, 0x8C96, 0x55A7, 0x8C97, 0x570F, 0x8C98, 0x5805, 0x8C99, 0x5ACC, + 0x8C9A, 0x5EFA, 0x8C9B, 0x61B2, 0x8C9C, 0x61F8, 0x8C9D, 0x62F3, 0x8C9E, 0x6372, 0x8C9F, 0x691C, 0x8CA0, 0x6A29, 0x8CA1, 0x727D, + 0x8CA2, 0x72AC, 0x8CA3, 0x732E, 0x8CA4, 0x7814, 0x8CA5, 0x786F, 0x8CA6, 0x7D79, 0x8CA7, 0x770C, 0x8CA8, 0x80A9, 0x8CA9, 0x898B, + 0x8CAA, 0x8B19, 0x8CAB, 0x8CE2, 0x8CAC, 0x8ED2, 0x8CAD, 0x9063, 0x8CAE, 0x9375, 0x8CAF, 0x967A, 0x8CB0, 0x9855, 0x8CB1, 0x9A13, + 0x8CB2, 0x9E78, 0x8CB3, 0x5143, 0x8CB4, 0x539F, 0x8CB5, 0x53B3, 0x8CB6, 0x5E7B, 0x8CB7, 0x5F26, 0x8CB8, 0x6E1B, 0x8CB9, 0x6E90, + 0x8CBA, 0x7384, 0x8CBB, 0x73FE, 0x8CBC, 0x7D43, 0x8CBD, 0x8237, 0x8CBE, 0x8A00, 0x8CBF, 0x8AFA, 0x8CC0, 0x9650, 0x8CC1, 0x4E4E, + 0x8CC2, 0x500B, 0x8CC3, 0x53E4, 0x8CC4, 0x547C, 0x8CC5, 0x56FA, 0x8CC6, 0x59D1, 0x8CC7, 0x5B64, 0x8CC8, 0x5DF1, 0x8CC9, 0x5EAB, + 0x8CCA, 0x5F27, 0x8CCB, 0x6238, 0x8CCC, 0x6545, 0x8CCD, 0x67AF, 0x8CCE, 0x6E56, 0x8CCF, 0x72D0, 0x8CD0, 0x7CCA, 0x8CD1, 0x88B4, + 0x8CD2, 0x80A1, 0x8CD3, 0x80E1, 0x8CD4, 0x83F0, 0x8CD5, 0x864E, 0x8CD6, 0x8A87, 0x8CD7, 0x8DE8, 0x8CD8, 0x9237, 0x8CD9, 0x96C7, + 0x8CDA, 0x9867, 0x8CDB, 0x9F13, 0x8CDC, 0x4E94, 0x8CDD, 0x4E92, 0x8CDE, 0x4F0D, 0x8CDF, 0x5348, 0x8CE0, 0x5449, 0x8CE1, 0x543E, + 0x8CE2, 0x5A2F, 0x8CE3, 0x5F8C, 0x8CE4, 0x5FA1, 0x8CE5, 0x609F, 0x8CE6, 0x68A7, 0x8CE7, 0x6A8E, 0x8CE8, 0x745A, 0x8CE9, 0x7881, + 0x8CEA, 0x8A9E, 0x8CEB, 0x8AA4, 0x8CEC, 0x8B77, 0x8CED, 0x9190, 0x8CEE, 0x4E5E, 0x8CEF, 0x9BC9, 0x8CF0, 0x4EA4, 0x8CF1, 0x4F7C, + 0x8CF2, 0x4FAF, 0x8CF3, 0x5019, 0x8CF4, 0x5016, 0x8CF5, 0x5149, 0x8CF6, 0x516C, 0x8CF7, 0x529F, 0x8CF8, 0x52B9, 0x8CF9, 0x52FE, + 0x8CFA, 0x539A, 0x8CFB, 0x53E3, 0x8CFC, 0x5411, 0x8D40, 0x540E, 0x8D41, 0x5589, 0x8D42, 0x5751, 0x8D43, 0x57A2, 0x8D44, 0x597D, + 0x8D45, 0x5B54, 0x8D46, 0x5B5D, 0x8D47, 0x5B8F, 0x8D48, 0x5DE5, 0x8D49, 0x5DE7, 0x8D4A, 0x5DF7, 0x8D4B, 0x5E78, 0x8D4C, 0x5E83, + 0x8D4D, 0x5E9A, 0x8D4E, 0x5EB7, 0x8D4F, 0x5F18, 0x8D50, 0x6052, 0x8D51, 0x614C, 0x8D52, 0x6297, 0x8D53, 0x62D8, 0x8D54, 0x63A7, + 0x8D55, 0x653B, 0x8D56, 0x6602, 0x8D57, 0x6643, 0x8D58, 0x66F4, 0x8D59, 0x676D, 0x8D5A, 0x6821, 0x8D5B, 0x6897, 0x8D5C, 0x69CB, + 0x8D5D, 0x6C5F, 0x8D5E, 0x6D2A, 0x8D5F, 0x6D69, 0x8D60, 0x6E2F, 0x8D61, 0x6E9D, 0x8D62, 0x7532, 0x8D63, 0x7687, 0x8D64, 0x786C, + 0x8D65, 0x7A3F, 0x8D66, 0x7CE0, 0x8D67, 0x7D05, 0x8D68, 0x7D18, 0x8D69, 0x7D5E, 0x8D6A, 0x7DB1, 0x8D6B, 0x8015, 0x8D6C, 0x8003, + 0x8D6D, 0x80AF, 0x8D6E, 0x80B1, 0x8D6F, 0x8154, 0x8D70, 0x818F, 0x8D71, 0x822A, 0x8D72, 0x8352, 0x8D73, 0x884C, 0x8D74, 0x8861, + 0x8D75, 0x8B1B, 0x8D76, 0x8CA2, 0x8D77, 0x8CFC, 0x8D78, 0x90CA, 0x8D79, 0x9175, 0x8D7A, 0x9271, 0x8D7B, 0x783F, 0x8D7C, 0x92FC, + 0x8D7D, 0x95A4, 0x8D7E, 0x964D, 0x8D80, 0x9805, 0x8D81, 0x9999, 0x8D82, 0x9AD8, 0x8D83, 0x9D3B, 0x8D84, 0x525B, 0x8D85, 0x52AB, + 0x8D86, 0x53F7, 0x8D87, 0x5408, 0x8D88, 0x58D5, 0x8D89, 0x62F7, 0x8D8A, 0x6FE0, 0x8D8B, 0x8C6A, 0x8D8C, 0x8F5F, 0x8D8D, 0x9EB9, + 0x8D8E, 0x514B, 0x8D8F, 0x523B, 0x8D90, 0x544A, 0x8D91, 0x56FD, 0x8D92, 0x7A40, 0x8D93, 0x9177, 0x8D94, 0x9D60, 0x8D95, 0x9ED2, + 0x8D96, 0x7344, 0x8D97, 0x6F09, 0x8D98, 0x8170, 0x8D99, 0x7511, 0x8D9A, 0x5FFD, 0x8D9B, 0x60DA, 0x8D9C, 0x9AA8, 0x8D9D, 0x72DB, + 0x8D9E, 0x8FBC, 0x8D9F, 0x6B64, 0x8DA0, 0x9803, 0x8DA1, 0x4ECA, 0x8DA2, 0x56F0, 0x8DA3, 0x5764, 0x8DA4, 0x58BE, 0x8DA5, 0x5A5A, + 0x8DA6, 0x6068, 0x8DA7, 0x61C7, 0x8DA8, 0x660F, 0x8DA9, 0x6606, 0x8DAA, 0x6839, 0x8DAB, 0x68B1, 0x8DAC, 0x6DF7, 0x8DAD, 0x75D5, + 0x8DAE, 0x7D3A, 0x8DAF, 0x826E, 0x8DB0, 0x9B42, 0x8DB1, 0x4E9B, 0x8DB2, 0x4F50, 0x8DB3, 0x53C9, 0x8DB4, 0x5506, 0x8DB5, 0x5D6F, + 0x8DB6, 0x5DE6, 0x8DB7, 0x5DEE, 0x8DB8, 0x67FB, 0x8DB9, 0x6C99, 0x8DBA, 0x7473, 0x8DBB, 0x7802, 0x8DBC, 0x8A50, 0x8DBD, 0x9396, + 0x8DBE, 0x88DF, 0x8DBF, 0x5750, 0x8DC0, 0x5EA7, 0x8DC1, 0x632B, 0x8DC2, 0x50B5, 0x8DC3, 0x50AC, 0x8DC4, 0x518D, 0x8DC5, 0x6700, + 0x8DC6, 0x54C9, 0x8DC7, 0x585E, 0x8DC8, 0x59BB, 0x8DC9, 0x5BB0, 0x8DCA, 0x5F69, 0x8DCB, 0x624D, 0x8DCC, 0x63A1, 0x8DCD, 0x683D, + 0x8DCE, 0x6B73, 0x8DCF, 0x6E08, 0x8DD0, 0x707D, 0x8DD1, 0x91C7, 0x8DD2, 0x7280, 0x8DD3, 0x7815, 0x8DD4, 0x7826, 0x8DD5, 0x796D, + 0x8DD6, 0x658E, 0x8DD7, 0x7D30, 0x8DD8, 0x83DC, 0x8DD9, 0x88C1, 0x8DDA, 0x8F09, 0x8DDB, 0x969B, 0x8DDC, 0x5264, 0x8DDD, 0x5728, + 0x8DDE, 0x6750, 0x8DDF, 0x7F6A, 0x8DE0, 0x8CA1, 0x8DE1, 0x51B4, 0x8DE2, 0x5742, 0x8DE3, 0x962A, 0x8DE4, 0x583A, 0x8DE5, 0x698A, + 0x8DE6, 0x80B4, 0x8DE7, 0x54B2, 0x8DE8, 0x5D0E, 0x8DE9, 0x57FC, 0x8DEA, 0x7895, 0x8DEB, 0x9DFA, 0x8DEC, 0x4F5C, 0x8DED, 0x524A, + 0x8DEE, 0x548B, 0x8DEF, 0x643E, 0x8DF0, 0x6628, 0x8DF1, 0x6714, 0x8DF2, 0x67F5, 0x8DF3, 0x7A84, 0x8DF4, 0x7B56, 0x8DF5, 0x7D22, + 0x8DF6, 0x932F, 0x8DF7, 0x685C, 0x8DF8, 0x9BAD, 0x8DF9, 0x7B39, 0x8DFA, 0x5319, 0x8DFB, 0x518A, 0x8DFC, 0x5237, 0x8E40, 0x5BDF, + 0x8E41, 0x62F6, 0x8E42, 0x64AE, 0x8E43, 0x64E6, 0x8E44, 0x672D, 0x8E45, 0x6BBA, 0x8E46, 0x85A9, 0x8E47, 0x96D1, 0x8E48, 0x7690, + 0x8E49, 0x9BD6, 0x8E4A, 0x634C, 0x8E4B, 0x9306, 0x8E4C, 0x9BAB, 0x8E4D, 0x76BF, 0x8E4E, 0x6652, 0x8E4F, 0x4E09, 0x8E50, 0x5098, + 0x8E51, 0x53C2, 0x8E52, 0x5C71, 0x8E53, 0x60E8, 0x8E54, 0x6492, 0x8E55, 0x6563, 0x8E56, 0x685F, 0x8E57, 0x71E6, 0x8E58, 0x73CA, + 0x8E59, 0x7523, 0x8E5A, 0x7B97, 0x8E5B, 0x7E82, 0x8E5C, 0x8695, 0x8E5D, 0x8B83, 0x8E5E, 0x8CDB, 0x8E5F, 0x9178, 0x8E60, 0x9910, + 0x8E61, 0x65AC, 0x8E62, 0x66AB, 0x8E63, 0x6B8B, 0x8E64, 0x4ED5, 0x8E65, 0x4ED4, 0x8E66, 0x4F3A, 0x8E67, 0x4F7F, 0x8E68, 0x523A, + 0x8E69, 0x53F8, 0x8E6A, 0x53F2, 0x8E6B, 0x55E3, 0x8E6C, 0x56DB, 0x8E6D, 0x58EB, 0x8E6E, 0x59CB, 0x8E6F, 0x59C9, 0x8E70, 0x59FF, + 0x8E71, 0x5B50, 0x8E72, 0x5C4D, 0x8E73, 0x5E02, 0x8E74, 0x5E2B, 0x8E75, 0x5FD7, 0x8E76, 0x601D, 0x8E77, 0x6307, 0x8E78, 0x652F, + 0x8E79, 0x5B5C, 0x8E7A, 0x65AF, 0x8E7B, 0x65BD, 0x8E7C, 0x65E8, 0x8E7D, 0x679D, 0x8E7E, 0x6B62, 0x8E80, 0x6B7B, 0x8E81, 0x6C0F, + 0x8E82, 0x7345, 0x8E83, 0x7949, 0x8E84, 0x79C1, 0x8E85, 0x7CF8, 0x8E86, 0x7D19, 0x8E87, 0x7D2B, 0x8E88, 0x80A2, 0x8E89, 0x8102, + 0x8E8A, 0x81F3, 0x8E8B, 0x8996, 0x8E8C, 0x8A5E, 0x8E8D, 0x8A69, 0x8E8E, 0x8A66, 0x8E8F, 0x8A8C, 0x8E90, 0x8AEE, 0x8E91, 0x8CC7, + 0x8E92, 0x8CDC, 0x8E93, 0x96CC, 0x8E94, 0x98FC, 0x8E95, 0x6B6F, 0x8E96, 0x4E8B, 0x8E97, 0x4F3C, 0x8E98, 0x4F8D, 0x8E99, 0x5150, + 0x8E9A, 0x5B57, 0x8E9B, 0x5BFA, 0x8E9C, 0x6148, 0x8E9D, 0x6301, 0x8E9E, 0x6642, 0x8E9F, 0x6B21, 0x8EA0, 0x6ECB, 0x8EA1, 0x6CBB, + 0x8EA2, 0x723E, 0x8EA3, 0x74BD, 0x8EA4, 0x75D4, 0x8EA5, 0x78C1, 0x8EA6, 0x793A, 0x8EA7, 0x800C, 0x8EA8, 0x8033, 0x8EA9, 0x81EA, + 0x8EAA, 0x8494, 0x8EAB, 0x8F9E, 0x8EAC, 0x6C50, 0x8EAD, 0x9E7F, 0x8EAE, 0x5F0F, 0x8EAF, 0x8B58, 0x8EB0, 0x9D2B, 0x8EB1, 0x7AFA, + 0x8EB2, 0x8EF8, 0x8EB3, 0x5B8D, 0x8EB4, 0x96EB, 0x8EB5, 0x4E03, 0x8EB6, 0x53F1, 0x8EB7, 0x57F7, 0x8EB8, 0x5931, 0x8EB9, 0x5AC9, + 0x8EBA, 0x5BA4, 0x8EBB, 0x6089, 0x8EBC, 0x6E7F, 0x8EBD, 0x6F06, 0x8EBE, 0x75BE, 0x8EBF, 0x8CEA, 0x8EC0, 0x5B9F, 0x8EC1, 0x8500, + 0x8EC2, 0x7BE0, 0x8EC3, 0x5072, 0x8EC4, 0x67F4, 0x8EC5, 0x829D, 0x8EC6, 0x5C61, 0x8EC7, 0x854A, 0x8EC8, 0x7E1E, 0x8EC9, 0x820E, + 0x8ECA, 0x5199, 0x8ECB, 0x5C04, 0x8ECC, 0x6368, 0x8ECD, 0x8D66, 0x8ECE, 0x659C, 0x8ECF, 0x716E, 0x8ED0, 0x793E, 0x8ED1, 0x7D17, + 0x8ED2, 0x8005, 0x8ED3, 0x8B1D, 0x8ED4, 0x8ECA, 0x8ED5, 0x906E, 0x8ED6, 0x86C7, 0x8ED7, 0x90AA, 0x8ED8, 0x501F, 0x8ED9, 0x52FA, + 0x8EDA, 0x5C3A, 0x8EDB, 0x6753, 0x8EDC, 0x707C, 0x8EDD, 0x7235, 0x8EDE, 0x914C, 0x8EDF, 0x91C8, 0x8EE0, 0x932B, 0x8EE1, 0x82E5, + 0x8EE2, 0x5BC2, 0x8EE3, 0x5F31, 0x8EE4, 0x60F9, 0x8EE5, 0x4E3B, 0x8EE6, 0x53D6, 0x8EE7, 0x5B88, 0x8EE8, 0x624B, 0x8EE9, 0x6731, + 0x8EEA, 0x6B8A, 0x8EEB, 0x72E9, 0x8EEC, 0x73E0, 0x8EED, 0x7A2E, 0x8EEE, 0x816B, 0x8EEF, 0x8DA3, 0x8EF0, 0x9152, 0x8EF1, 0x9996, + 0x8EF2, 0x5112, 0x8EF3, 0x53D7, 0x8EF4, 0x546A, 0x8EF5, 0x5BFF, 0x8EF6, 0x6388, 0x8EF7, 0x6A39, 0x8EF8, 0x7DAC, 0x8EF9, 0x9700, + 0x8EFA, 0x56DA, 0x8EFB, 0x53CE, 0x8EFC, 0x5468, 0x8F40, 0x5B97, 0x8F41, 0x5C31, 0x8F42, 0x5DDE, 0x8F43, 0x4FEE, 0x8F44, 0x6101, + 0x8F45, 0x62FE, 0x8F46, 0x6D32, 0x8F47, 0x79C0, 0x8F48, 0x79CB, 0x8F49, 0x7D42, 0x8F4A, 0x7E4D, 0x8F4B, 0x7FD2, 0x8F4C, 0x81ED, + 0x8F4D, 0x821F, 0x8F4E, 0x8490, 0x8F4F, 0x8846, 0x8F50, 0x8972, 0x8F51, 0x8B90, 0x8F52, 0x8E74, 0x8F53, 0x8F2F, 0x8F54, 0x9031, + 0x8F55, 0x914B, 0x8F56, 0x916C, 0x8F57, 0x96C6, 0x8F58, 0x919C, 0x8F59, 0x4EC0, 0x8F5A, 0x4F4F, 0x8F5B, 0x5145, 0x8F5C, 0x5341, + 0x8F5D, 0x5F93, 0x8F5E, 0x620E, 0x8F5F, 0x67D4, 0x8F60, 0x6C41, 0x8F61, 0x6E0B, 0x8F62, 0x7363, 0x8F63, 0x7E26, 0x8F64, 0x91CD, + 0x8F65, 0x9283, 0x8F66, 0x53D4, 0x8F67, 0x5919, 0x8F68, 0x5BBF, 0x8F69, 0x6DD1, 0x8F6A, 0x795D, 0x8F6B, 0x7E2E, 0x8F6C, 0x7C9B, + 0x8F6D, 0x587E, 0x8F6E, 0x719F, 0x8F6F, 0x51FA, 0x8F70, 0x8853, 0x8F71, 0x8FF0, 0x8F72, 0x4FCA, 0x8F73, 0x5CFB, 0x8F74, 0x6625, + 0x8F75, 0x77AC, 0x8F76, 0x7AE3, 0x8F77, 0x821C, 0x8F78, 0x99FF, 0x8F79, 0x51C6, 0x8F7A, 0x5FAA, 0x8F7B, 0x65EC, 0x8F7C, 0x696F, + 0x8F7D, 0x6B89, 0x8F7E, 0x6DF3, 0x8F80, 0x6E96, 0x8F81, 0x6F64, 0x8F82, 0x76FE, 0x8F83, 0x7D14, 0x8F84, 0x5DE1, 0x8F85, 0x9075, + 0x8F86, 0x9187, 0x8F87, 0x9806, 0x8F88, 0x51E6, 0x8F89, 0x521D, 0x8F8A, 0x6240, 0x8F8B, 0x6691, 0x8F8C, 0x66D9, 0x8F8D, 0x6E1A, + 0x8F8E, 0x5EB6, 0x8F8F, 0x7DD2, 0x8F90, 0x7F72, 0x8F91, 0x66F8, 0x8F92, 0x85AF, 0x8F93, 0x85F7, 0x8F94, 0x8AF8, 0x8F95, 0x52A9, + 0x8F96, 0x53D9, 0x8F97, 0x5973, 0x8F98, 0x5E8F, 0x8F99, 0x5F90, 0x8F9A, 0x6055, 0x8F9B, 0x92E4, 0x8F9C, 0x9664, 0x8F9D, 0x50B7, + 0x8F9E, 0x511F, 0x8F9F, 0x52DD, 0x8FA0, 0x5320, 0x8FA1, 0x5347, 0x8FA2, 0x53EC, 0x8FA3, 0x54E8, 0x8FA4, 0x5546, 0x8FA5, 0x5531, + 0x8FA6, 0x5617, 0x8FA7, 0x5968, 0x8FA8, 0x59BE, 0x8FA9, 0x5A3C, 0x8FAA, 0x5BB5, 0x8FAB, 0x5C06, 0x8FAC, 0x5C0F, 0x8FAD, 0x5C11, + 0x8FAE, 0x5C1A, 0x8FAF, 0x5E84, 0x8FB0, 0x5E8A, 0x8FB1, 0x5EE0, 0x8FB2, 0x5F70, 0x8FB3, 0x627F, 0x8FB4, 0x6284, 0x8FB5, 0x62DB, + 0x8FB6, 0x638C, 0x8FB7, 0x6377, 0x8FB8, 0x6607, 0x8FB9, 0x660C, 0x8FBA, 0x662D, 0x8FBB, 0x6676, 0x8FBC, 0x677E, 0x8FBD, 0x68A2, + 0x8FBE, 0x6A1F, 0x8FBF, 0x6A35, 0x8FC0, 0x6CBC, 0x8FC1, 0x6D88, 0x8FC2, 0x6E09, 0x8FC3, 0x6E58, 0x8FC4, 0x713C, 0x8FC5, 0x7126, + 0x8FC6, 0x7167, 0x8FC7, 0x75C7, 0x8FC8, 0x7701, 0x8FC9, 0x785D, 0x8FCA, 0x7901, 0x8FCB, 0x7965, 0x8FCC, 0x79F0, 0x8FCD, 0x7AE0, + 0x8FCE, 0x7B11, 0x8FCF, 0x7CA7, 0x8FD0, 0x7D39, 0x8FD1, 0x8096, 0x8FD2, 0x83D6, 0x8FD3, 0x848B, 0x8FD4, 0x8549, 0x8FD5, 0x885D, + 0x8FD6, 0x88F3, 0x8FD7, 0x8A1F, 0x8FD8, 0x8A3C, 0x8FD9, 0x8A54, 0x8FDA, 0x8A73, 0x8FDB, 0x8C61, 0x8FDC, 0x8CDE, 0x8FDD, 0x91A4, + 0x8FDE, 0x9266, 0x8FDF, 0x937E, 0x8FE0, 0x9418, 0x8FE1, 0x969C, 0x8FE2, 0x9798, 0x8FE3, 0x4E0A, 0x8FE4, 0x4E08, 0x8FE5, 0x4E1E, + 0x8FE6, 0x4E57, 0x8FE7, 0x5197, 0x8FE8, 0x5270, 0x8FE9, 0x57CE, 0x8FEA, 0x5834, 0x8FEB, 0x58CC, 0x8FEC, 0x5B22, 0x8FED, 0x5E38, + 0x8FEE, 0x60C5, 0x8FEF, 0x64FE, 0x8FF0, 0x6761, 0x8FF1, 0x6756, 0x8FF2, 0x6D44, 0x8FF3, 0x72B6, 0x8FF4, 0x7573, 0x8FF5, 0x7A63, + 0x8FF6, 0x84B8, 0x8FF7, 0x8B72, 0x8FF8, 0x91B8, 0x8FF9, 0x9320, 0x8FFA, 0x5631, 0x8FFB, 0x57F4, 0x8FFC, 0x98FE, 0x9040, 0x62ED, + 0x9041, 0x690D, 0x9042, 0x6B96, 0x9043, 0x71ED, 0x9044, 0x7E54, 0x9045, 0x8077, 0x9046, 0x8272, 0x9047, 0x89E6, 0x9048, 0x98DF, + 0x9049, 0x8755, 0x904A, 0x8FB1, 0x904B, 0x5C3B, 0x904C, 0x4F38, 0x904D, 0x4FE1, 0x904E, 0x4FB5, 0x904F, 0x5507, 0x9050, 0x5A20, + 0x9051, 0x5BDD, 0x9052, 0x5BE9, 0x9053, 0x5FC3, 0x9054, 0x614E, 0x9055, 0x632F, 0x9056, 0x65B0, 0x9057, 0x664B, 0x9058, 0x68EE, + 0x9059, 0x699B, 0x905A, 0x6D78, 0x905B, 0x6DF1, 0x905C, 0x7533, 0x905D, 0x75B9, 0x905E, 0x771F, 0x905F, 0x795E, 0x9060, 0x79E6, + 0x9061, 0x7D33, 0x9062, 0x81E3, 0x9063, 0x82AF, 0x9064, 0x85AA, 0x9065, 0x89AA, 0x9066, 0x8A3A, 0x9067, 0x8EAB, 0x9068, 0x8F9B, + 0x9069, 0x9032, 0x906A, 0x91DD, 0x906B, 0x9707, 0x906C, 0x4EBA, 0x906D, 0x4EC1, 0x906E, 0x5203, 0x906F, 0x5875, 0x9070, 0x58EC, + 0x9071, 0x5C0B, 0x9072, 0x751A, 0x9073, 0x5C3D, 0x9074, 0x814E, 0x9075, 0x8A0A, 0x9076, 0x8FC5, 0x9077, 0x9663, 0x9078, 0x976D, + 0x9079, 0x7B25, 0x907A, 0x8ACF, 0x907B, 0x9808, 0x907C, 0x9162, 0x907D, 0x56F3, 0x907E, 0x53A8, 0x9080, 0x9017, 0x9081, 0x5439, + 0x9082, 0x5782, 0x9083, 0x5E25, 0x9084, 0x63A8, 0x9085, 0x6C34, 0x9086, 0x708A, 0x9087, 0x7761, 0x9088, 0x7C8B, 0x9089, 0x7FE0, + 0x908A, 0x8870, 0x908B, 0x9042, 0x908C, 0x9154, 0x908D, 0x9310, 0x908E, 0x9318, 0x908F, 0x968F, 0x9090, 0x745E, 0x9091, 0x9AC4, + 0x9092, 0x5D07, 0x9093, 0x5D69, 0x9094, 0x6570, 0x9095, 0x67A2, 0x9096, 0x8DA8, 0x9097, 0x96DB, 0x9098, 0x636E, 0x9099, 0x6749, + 0x909A, 0x6919, 0x909B, 0x83C5, 0x909C, 0x9817, 0x909D, 0x96C0, 0x909E, 0x88FE, 0x909F, 0x6F84, 0x90A0, 0x647A, 0x90A1, 0x5BF8, + 0x90A2, 0x4E16, 0x90A3, 0x702C, 0x90A4, 0x755D, 0x90A5, 0x662F, 0x90A6, 0x51C4, 0x90A7, 0x5236, 0x90A8, 0x52E2, 0x90A9, 0x59D3, + 0x90AA, 0x5F81, 0x90AB, 0x6027, 0x90AC, 0x6210, 0x90AD, 0x653F, 0x90AE, 0x6574, 0x90AF, 0x661F, 0x90B0, 0x6674, 0x90B1, 0x68F2, + 0x90B2, 0x6816, 0x90B3, 0x6B63, 0x90B4, 0x6E05, 0x90B5, 0x7272, 0x90B6, 0x751F, 0x90B7, 0x76DB, 0x90B8, 0x7CBE, 0x90B9, 0x8056, + 0x90BA, 0x58F0, 0x90BB, 0x88FD, 0x90BC, 0x897F, 0x90BD, 0x8AA0, 0x90BE, 0x8A93, 0x90BF, 0x8ACB, 0x90C0, 0x901D, 0x90C1, 0x9192, + 0x90C2, 0x9752, 0x90C3, 0x9759, 0x90C4, 0x6589, 0x90C5, 0x7A0E, 0x90C6, 0x8106, 0x90C7, 0x96BB, 0x90C8, 0x5E2D, 0x90C9, 0x60DC, + 0x90CA, 0x621A, 0x90CB, 0x65A5, 0x90CC, 0x6614, 0x90CD, 0x6790, 0x90CE, 0x77F3, 0x90CF, 0x7A4D, 0x90D0, 0x7C4D, 0x90D1, 0x7E3E, + 0x90D2, 0x810A, 0x90D3, 0x8CAC, 0x90D4, 0x8D64, 0x90D5, 0x8DE1, 0x90D6, 0x8E5F, 0x90D7, 0x78A9, 0x90D8, 0x5207, 0x90D9, 0x62D9, + 0x90DA, 0x63A5, 0x90DB, 0x6442, 0x90DC, 0x6298, 0x90DD, 0x8A2D, 0x90DE, 0x7A83, 0x90DF, 0x7BC0, 0x90E0, 0x8AAC, 0x90E1, 0x96EA, + 0x90E2, 0x7D76, 0x90E3, 0x820C, 0x90E4, 0x8749, 0x90E5, 0x4ED9, 0x90E6, 0x5148, 0x90E7, 0x5343, 0x90E8, 0x5360, 0x90E9, 0x5BA3, + 0x90EA, 0x5C02, 0x90EB, 0x5C16, 0x90EC, 0x5DDD, 0x90ED, 0x6226, 0x90EE, 0x6247, 0x90EF, 0x64B0, 0x90F0, 0x6813, 0x90F1, 0x6834, + 0x90F2, 0x6CC9, 0x90F3, 0x6D45, 0x90F4, 0x6D17, 0x90F5, 0x67D3, 0x90F6, 0x6F5C, 0x90F7, 0x714E, 0x90F8, 0x717D, 0x90F9, 0x65CB, + 0x90FA, 0x7A7F, 0x90FB, 0x7BAD, 0x90FC, 0x7DDA, 0x9140, 0x7E4A, 0x9141, 0x7FA8, 0x9142, 0x817A, 0x9143, 0x821B, 0x9144, 0x8239, + 0x9145, 0x85A6, 0x9146, 0x8A6E, 0x9147, 0x8CCE, 0x9148, 0x8DF5, 0x9149, 0x9078, 0x914A, 0x9077, 0x914B, 0x92AD, 0x914C, 0x9291, + 0x914D, 0x9583, 0x914E, 0x9BAE, 0x914F, 0x524D, 0x9150, 0x5584, 0x9151, 0x6F38, 0x9152, 0x7136, 0x9153, 0x5168, 0x9154, 0x7985, + 0x9155, 0x7E55, 0x9156, 0x81B3, 0x9157, 0x7CCE, 0x9158, 0x564C, 0x9159, 0x5851, 0x915A, 0x5CA8, 0x915B, 0x63AA, 0x915C, 0x66FE, + 0x915D, 0x66FD, 0x915E, 0x695A, 0x915F, 0x72D9, 0x9160, 0x758F, 0x9161, 0x758E, 0x9162, 0x790E, 0x9163, 0x7956, 0x9164, 0x79DF, + 0x9165, 0x7C97, 0x9166, 0x7D20, 0x9167, 0x7D44, 0x9168, 0x8607, 0x9169, 0x8A34, 0x916A, 0x963B, 0x916B, 0x9061, 0x916C, 0x9F20, + 0x916D, 0x50E7, 0x916E, 0x5275, 0x916F, 0x53CC, 0x9170, 0x53E2, 0x9171, 0x5009, 0x9172, 0x55AA, 0x9173, 0x58EE, 0x9174, 0x594F, + 0x9175, 0x723D, 0x9176, 0x5B8B, 0x9177, 0x5C64, 0x9178, 0x531D, 0x9179, 0x60E3, 0x917A, 0x60F3, 0x917B, 0x635C, 0x917C, 0x6383, + 0x917D, 0x633F, 0x917E, 0x63BB, 0x9180, 0x64CD, 0x9181, 0x65E9, 0x9182, 0x66F9, 0x9183, 0x5DE3, 0x9184, 0x69CD, 0x9185, 0x69FD, + 0x9186, 0x6F15, 0x9187, 0x71E5, 0x9188, 0x4E89, 0x9189, 0x75E9, 0x918A, 0x76F8, 0x918B, 0x7A93, 0x918C, 0x7CDF, 0x918D, 0x7DCF, + 0x918E, 0x7D9C, 0x918F, 0x8061, 0x9190, 0x8349, 0x9191, 0x8358, 0x9192, 0x846C, 0x9193, 0x84BC, 0x9194, 0x85FB, 0x9195, 0x88C5, + 0x9196, 0x8D70, 0x9197, 0x9001, 0x9198, 0x906D, 0x9199, 0x9397, 0x919A, 0x971C, 0x919B, 0x9A12, 0x919C, 0x50CF, 0x919D, 0x5897, + 0x919E, 0x618E, 0x919F, 0x81D3, 0x91A0, 0x8535, 0x91A1, 0x8D08, 0x91A2, 0x9020, 0x91A3, 0x4FC3, 0x91A4, 0x5074, 0x91A5, 0x5247, + 0x91A6, 0x5373, 0x91A7, 0x606F, 0x91A8, 0x6349, 0x91A9, 0x675F, 0x91AA, 0x6E2C, 0x91AB, 0x8DB3, 0x91AC, 0x901F, 0x91AD, 0x4FD7, + 0x91AE, 0x5C5E, 0x91AF, 0x8CCA, 0x91B0, 0x65CF, 0x91B1, 0x7D9A, 0x91B2, 0x5352, 0x91B3, 0x8896, 0x91B4, 0x5176, 0x91B5, 0x63C3, + 0x91B6, 0x5B58, 0x91B7, 0x5B6B, 0x91B8, 0x5C0A, 0x91B9, 0x640D, 0x91BA, 0x6751, 0x91BB, 0x905C, 0x91BC, 0x4ED6, 0x91BD, 0x591A, + 0x91BE, 0x592A, 0x91BF, 0x6C70, 0x91C0, 0x8A51, 0x91C1, 0x553E, 0x91C2, 0x5815, 0x91C3, 0x59A5, 0x91C4, 0x60F0, 0x91C5, 0x6253, + 0x91C6, 0x67C1, 0x91C7, 0x8235, 0x91C8, 0x6955, 0x91C9, 0x9640, 0x91CA, 0x99C4, 0x91CB, 0x9A28, 0x91CC, 0x4F53, 0x91CD, 0x5806, + 0x91CE, 0x5BFE, 0x91CF, 0x8010, 0x91D0, 0x5CB1, 0x91D1, 0x5E2F, 0x91D2, 0x5F85, 0x91D3, 0x6020, 0x91D4, 0x614B, 0x91D5, 0x6234, + 0x91D6, 0x66FF, 0x91D7, 0x6CF0, 0x91D8, 0x6EDE, 0x91D9, 0x80CE, 0x91DA, 0x817F, 0x91DB, 0x82D4, 0x91DC, 0x888B, 0x91DD, 0x8CB8, + 0x91DE, 0x9000, 0x91DF, 0x902E, 0x91E0, 0x968A, 0x91E1, 0x9EDB, 0x91E2, 0x9BDB, 0x91E3, 0x4EE3, 0x91E4, 0x53F0, 0x91E5, 0x5927, + 0x91E6, 0x7B2C, 0x91E7, 0x918D, 0x91E8, 0x984C, 0x91E9, 0x9DF9, 0x91EA, 0x6EDD, 0x91EB, 0x7027, 0x91EC, 0x5353, 0x91ED, 0x5544, + 0x91EE, 0x5B85, 0x91EF, 0x6258, 0x91F0, 0x629E, 0x91F1, 0x62D3, 0x91F2, 0x6CA2, 0x91F3, 0x6FEF, 0x91F4, 0x7422, 0x91F5, 0x8A17, + 0x91F6, 0x9438, 0x91F7, 0x6FC1, 0x91F8, 0x8AFE, 0x91F9, 0x8338, 0x91FA, 0x51E7, 0x91FB, 0x86F8, 0x91FC, 0x53EA, 0x9240, 0x53E9, + 0x9241, 0x4F46, 0x9242, 0x9054, 0x9243, 0x8FB0, 0x9244, 0x596A, 0x9245, 0x8131, 0x9246, 0x5DFD, 0x9247, 0x7AEA, 0x9248, 0x8FBF, + 0x9249, 0x68DA, 0x924A, 0x8C37, 0x924B, 0x72F8, 0x924C, 0x9C48, 0x924D, 0x6A3D, 0x924E, 0x8AB0, 0x924F, 0x4E39, 0x9250, 0x5358, + 0x9251, 0x5606, 0x9252, 0x5766, 0x9253, 0x62C5, 0x9254, 0x63A2, 0x9255, 0x65E6, 0x9256, 0x6B4E, 0x9257, 0x6DE1, 0x9258, 0x6E5B, + 0x9259, 0x70AD, 0x925A, 0x77ED, 0x925B, 0x7AEF, 0x925C, 0x7BAA, 0x925D, 0x7DBB, 0x925E, 0x803D, 0x925F, 0x80C6, 0x9260, 0x86CB, + 0x9261, 0x8A95, 0x9262, 0x935B, 0x9263, 0x56E3, 0x9264, 0x58C7, 0x9265, 0x5F3E, 0x9266, 0x65AD, 0x9267, 0x6696, 0x9268, 0x6A80, + 0x9269, 0x6BB5, 0x926A, 0x7537, 0x926B, 0x8AC7, 0x926C, 0x5024, 0x926D, 0x77E5, 0x926E, 0x5730, 0x926F, 0x5F1B, 0x9270, 0x6065, + 0x9271, 0x667A, 0x9272, 0x6C60, 0x9273, 0x75F4, 0x9274, 0x7A1A, 0x9275, 0x7F6E, 0x9276, 0x81F4, 0x9277, 0x8718, 0x9278, 0x9045, + 0x9279, 0x99B3, 0x927A, 0x7BC9, 0x927B, 0x755C, 0x927C, 0x7AF9, 0x927D, 0x7B51, 0x927E, 0x84C4, 0x9280, 0x9010, 0x9281, 0x79E9, + 0x9282, 0x7A92, 0x9283, 0x8336, 0x9284, 0x5AE1, 0x9285, 0x7740, 0x9286, 0x4E2D, 0x9287, 0x4EF2, 0x9288, 0x5B99, 0x9289, 0x5FE0, + 0x928A, 0x62BD, 0x928B, 0x663C, 0x928C, 0x67F1, 0x928D, 0x6CE8, 0x928E, 0x866B, 0x928F, 0x8877, 0x9290, 0x8A3B, 0x9291, 0x914E, + 0x9292, 0x92F3, 0x9293, 0x99D0, 0x9294, 0x6A17, 0x9295, 0x7026, 0x9296, 0x732A, 0x9297, 0x82E7, 0x9298, 0x8457, 0x9299, 0x8CAF, + 0x929A, 0x4E01, 0x929B, 0x5146, 0x929C, 0x51CB, 0x929D, 0x558B, 0x929E, 0x5BF5, 0x929F, 0x5E16, 0x92A0, 0x5E33, 0x92A1, 0x5E81, + 0x92A2, 0x5F14, 0x92A3, 0x5F35, 0x92A4, 0x5F6B, 0x92A5, 0x5FB4, 0x92A6, 0x61F2, 0x92A7, 0x6311, 0x92A8, 0x66A2, 0x92A9, 0x671D, + 0x92AA, 0x6F6E, 0x92AB, 0x7252, 0x92AC, 0x753A, 0x92AD, 0x773A, 0x92AE, 0x8074, 0x92AF, 0x8139, 0x92B0, 0x8178, 0x92B1, 0x8776, + 0x92B2, 0x8ABF, 0x92B3, 0x8ADC, 0x92B4, 0x8D85, 0x92B5, 0x8DF3, 0x92B6, 0x929A, 0x92B7, 0x9577, 0x92B8, 0x9802, 0x92B9, 0x9CE5, + 0x92BA, 0x52C5, 0x92BB, 0x6357, 0x92BC, 0x76F4, 0x92BD, 0x6715, 0x92BE, 0x6C88, 0x92BF, 0x73CD, 0x92C0, 0x8CC3, 0x92C1, 0x93AE, + 0x92C2, 0x9673, 0x92C3, 0x6D25, 0x92C4, 0x589C, 0x92C5, 0x690E, 0x92C6, 0x69CC, 0x92C7, 0x8FFD, 0x92C8, 0x939A, 0x92C9, 0x75DB, + 0x92CA, 0x901A, 0x92CB, 0x585A, 0x92CC, 0x6802, 0x92CD, 0x63B4, 0x92CE, 0x69FB, 0x92CF, 0x4F43, 0x92D0, 0x6F2C, 0x92D1, 0x67D8, + 0x92D2, 0x8FBB, 0x92D3, 0x8526, 0x92D4, 0x7DB4, 0x92D5, 0x9354, 0x92D6, 0x693F, 0x92D7, 0x6F70, 0x92D8, 0x576A, 0x92D9, 0x58F7, + 0x92DA, 0x5B2C, 0x92DB, 0x7D2C, 0x92DC, 0x722A, 0x92DD, 0x540A, 0x92DE, 0x91E3, 0x92DF, 0x9DB4, 0x92E0, 0x4EAD, 0x92E1, 0x4F4E, + 0x92E2, 0x505C, 0x92E3, 0x5075, 0x92E4, 0x5243, 0x92E5, 0x8C9E, 0x92E6, 0x5448, 0x92E7, 0x5824, 0x92E8, 0x5B9A, 0x92E9, 0x5E1D, + 0x92EA, 0x5E95, 0x92EB, 0x5EAD, 0x92EC, 0x5EF7, 0x92ED, 0x5F1F, 0x92EE, 0x608C, 0x92EF, 0x62B5, 0x92F0, 0x633A, 0x92F1, 0x63D0, + 0x92F2, 0x68AF, 0x92F3, 0x6C40, 0x92F4, 0x7887, 0x92F5, 0x798E, 0x92F6, 0x7A0B, 0x92F7, 0x7DE0, 0x92F8, 0x8247, 0x92F9, 0x8A02, + 0x92FA, 0x8AE6, 0x92FB, 0x8E44, 0x92FC, 0x9013, 0x9340, 0x90B8, 0x9341, 0x912D, 0x9342, 0x91D8, 0x9343, 0x9F0E, 0x9344, 0x6CE5, + 0x9345, 0x6458, 0x9346, 0x64E2, 0x9347, 0x6575, 0x9348, 0x6EF4, 0x9349, 0x7684, 0x934A, 0x7B1B, 0x934B, 0x9069, 0x934C, 0x93D1, + 0x934D, 0x6EBA, 0x934E, 0x54F2, 0x934F, 0x5FB9, 0x9350, 0x64A4, 0x9351, 0x8F4D, 0x9352, 0x8FED, 0x9353, 0x9244, 0x9354, 0x5178, + 0x9355, 0x586B, 0x9356, 0x5929, 0x9357, 0x5C55, 0x9358, 0x5E97, 0x9359, 0x6DFB, 0x935A, 0x7E8F, 0x935B, 0x751C, 0x935C, 0x8CBC, + 0x935D, 0x8EE2, 0x935E, 0x985B, 0x935F, 0x70B9, 0x9360, 0x4F1D, 0x9361, 0x6BBF, 0x9362, 0x6FB1, 0x9363, 0x7530, 0x9364, 0x96FB, + 0x9365, 0x514E, 0x9366, 0x5410, 0x9367, 0x5835, 0x9368, 0x5857, 0x9369, 0x59AC, 0x936A, 0x5C60, 0x936B, 0x5F92, 0x936C, 0x6597, + 0x936D, 0x675C, 0x936E, 0x6E21, 0x936F, 0x767B, 0x9370, 0x83DF, 0x9371, 0x8CED, 0x9372, 0x9014, 0x9373, 0x90FD, 0x9374, 0x934D, + 0x9375, 0x7825, 0x9376, 0x783A, 0x9377, 0x52AA, 0x9378, 0x5EA6, 0x9379, 0x571F, 0x937A, 0x5974, 0x937B, 0x6012, 0x937C, 0x5012, + 0x937D, 0x515A, 0x937E, 0x51AC, 0x9380, 0x51CD, 0x9381, 0x5200, 0x9382, 0x5510, 0x9383, 0x5854, 0x9384, 0x5858, 0x9385, 0x5957, + 0x9386, 0x5B95, 0x9387, 0x5CF6, 0x9388, 0x5D8B, 0x9389, 0x60BC, 0x938A, 0x6295, 0x938B, 0x642D, 0x938C, 0x6771, 0x938D, 0x6843, + 0x938E, 0x68BC, 0x938F, 0x68DF, 0x9390, 0x76D7, 0x9391, 0x6DD8, 0x9392, 0x6E6F, 0x9393, 0x6D9B, 0x9394, 0x706F, 0x9395, 0x71C8, + 0x9396, 0x5F53, 0x9397, 0x75D8, 0x9398, 0x7977, 0x9399, 0x7B49, 0x939A, 0x7B54, 0x939B, 0x7B52, 0x939C, 0x7CD6, 0x939D, 0x7D71, + 0x939E, 0x5230, 0x939F, 0x8463, 0x93A0, 0x8569, 0x93A1, 0x85E4, 0x93A2, 0x8A0E, 0x93A3, 0x8B04, 0x93A4, 0x8C46, 0x93A5, 0x8E0F, + 0x93A6, 0x9003, 0x93A7, 0x900F, 0x93A8, 0x9419, 0x93A9, 0x9676, 0x93AA, 0x982D, 0x93AB, 0x9A30, 0x93AC, 0x95D8, 0x93AD, 0x50CD, + 0x93AE, 0x52D5, 0x93AF, 0x540C, 0x93B0, 0x5802, 0x93B1, 0x5C0E, 0x93B2, 0x61A7, 0x93B3, 0x649E, 0x93B4, 0x6D1E, 0x93B5, 0x77B3, + 0x93B6, 0x7AE5, 0x93B7, 0x80F4, 0x93B8, 0x8404, 0x93B9, 0x9053, 0x93BA, 0x9285, 0x93BB, 0x5CE0, 0x93BC, 0x9D07, 0x93BD, 0x533F, + 0x93BE, 0x5F97, 0x93BF, 0x5FB3, 0x93C0, 0x6D9C, 0x93C1, 0x7279, 0x93C2, 0x7763, 0x93C3, 0x79BF, 0x93C4, 0x7BE4, 0x93C5, 0x6BD2, + 0x93C6, 0x72EC, 0x93C7, 0x8AAD, 0x93C8, 0x6803, 0x93C9, 0x6A61, 0x93CA, 0x51F8, 0x93CB, 0x7A81, 0x93CC, 0x6934, 0x93CD, 0x5C4A, + 0x93CE, 0x9CF6, 0x93CF, 0x82EB, 0x93D0, 0x5BC5, 0x93D1, 0x9149, 0x93D2, 0x701E, 0x93D3, 0x5678, 0x93D4, 0x5C6F, 0x93D5, 0x60C7, + 0x93D6, 0x6566, 0x93D7, 0x6C8C, 0x93D8, 0x8C5A, 0x93D9, 0x9041, 0x93DA, 0x9813, 0x93DB, 0x5451, 0x93DC, 0x66C7, 0x93DD, 0x920D, + 0x93DE, 0x5948, 0x93DF, 0x90A3, 0x93E0, 0x5185, 0x93E1, 0x4E4D, 0x93E2, 0x51EA, 0x93E3, 0x8599, 0x93E4, 0x8B0E, 0x93E5, 0x7058, + 0x93E6, 0x637A, 0x93E7, 0x934B, 0x93E8, 0x6962, 0x93E9, 0x99B4, 0x93EA, 0x7E04, 0x93EB, 0x7577, 0x93EC, 0x5357, 0x93ED, 0x6960, + 0x93EE, 0x8EDF, 0x93EF, 0x96E3, 0x93F0, 0x6C5D, 0x93F1, 0x4E8C, 0x93F2, 0x5C3C, 0x93F3, 0x5F10, 0x93F4, 0x8FE9, 0x93F5, 0x5302, + 0x93F6, 0x8CD1, 0x93F7, 0x8089, 0x93F8, 0x8679, 0x93F9, 0x5EFF, 0x93FA, 0x65E5, 0x93FB, 0x4E73, 0x93FC, 0x5165, 0x9440, 0x5982, + 0x9441, 0x5C3F, 0x9442, 0x97EE, 0x9443, 0x4EFB, 0x9444, 0x598A, 0x9445, 0x5FCD, 0x9446, 0x8A8D, 0x9447, 0x6FE1, 0x9448, 0x79B0, + 0x9449, 0x7962, 0x944A, 0x5BE7, 0x944B, 0x8471, 0x944C, 0x732B, 0x944D, 0x71B1, 0x944E, 0x5E74, 0x944F, 0x5FF5, 0x9450, 0x637B, + 0x9451, 0x649A, 0x9452, 0x71C3, 0x9453, 0x7C98, 0x9454, 0x4E43, 0x9455, 0x5EFC, 0x9456, 0x4E4B, 0x9457, 0x57DC, 0x9458, 0x56A2, + 0x9459, 0x60A9, 0x945A, 0x6FC3, 0x945B, 0x7D0D, 0x945C, 0x80FD, 0x945D, 0x8133, 0x945E, 0x81BF, 0x945F, 0x8FB2, 0x9460, 0x8997, + 0x9461, 0x86A4, 0x9462, 0x5DF4, 0x9463, 0x628A, 0x9464, 0x64AD, 0x9465, 0x8987, 0x9466, 0x6777, 0x9467, 0x6CE2, 0x9468, 0x6D3E, + 0x9469, 0x7436, 0x946A, 0x7834, 0x946B, 0x5A46, 0x946C, 0x7F75, 0x946D, 0x82AD, 0x946E, 0x99AC, 0x946F, 0x4FF3, 0x9470, 0x5EC3, + 0x9471, 0x62DD, 0x9472, 0x6392, 0x9473, 0x6557, 0x9474, 0x676F, 0x9475, 0x76C3, 0x9476, 0x724C, 0x9477, 0x80CC, 0x9478, 0x80BA, + 0x9479, 0x8F29, 0x947A, 0x914D, 0x947B, 0x500D, 0x947C, 0x57F9, 0x947D, 0x5A92, 0x947E, 0x6885, 0x9480, 0x6973, 0x9481, 0x7164, + 0x9482, 0x72FD, 0x9483, 0x8CB7, 0x9484, 0x58F2, 0x9485, 0x8CE0, 0x9486, 0x966A, 0x9487, 0x9019, 0x9488, 0x877F, 0x9489, 0x79E4, + 0x948A, 0x77E7, 0x948B, 0x8429, 0x948C, 0x4F2F, 0x948D, 0x5265, 0x948E, 0x535A, 0x948F, 0x62CD, 0x9490, 0x67CF, 0x9491, 0x6CCA, + 0x9492, 0x767D, 0x9493, 0x7B94, 0x9494, 0x7C95, 0x9495, 0x8236, 0x9496, 0x8584, 0x9497, 0x8FEB, 0x9498, 0x66DD, 0x9499, 0x6F20, + 0x949A, 0x7206, 0x949B, 0x7E1B, 0x949C, 0x83AB, 0x949D, 0x99C1, 0x949E, 0x9EA6, 0x949F, 0x51FD, 0x94A0, 0x7BB1, 0x94A1, 0x7872, + 0x94A2, 0x7BB8, 0x94A3, 0x8087, 0x94A4, 0x7B48, 0x94A5, 0x6AE8, 0x94A6, 0x5E61, 0x94A7, 0x808C, 0x94A8, 0x7551, 0x94A9, 0x7560, + 0x94AA, 0x516B, 0x94AB, 0x9262, 0x94AC, 0x6E8C, 0x94AD, 0x767A, 0x94AE, 0x9197, 0x94AF, 0x9AEA, 0x94B0, 0x4F10, 0x94B1, 0x7F70, + 0x94B2, 0x629C, 0x94B3, 0x7B4F, 0x94B4, 0x95A5, 0x94B5, 0x9CE9, 0x94B6, 0x567A, 0x94B7, 0x5859, 0x94B8, 0x86E4, 0x94B9, 0x96BC, + 0x94BA, 0x4F34, 0x94BB, 0x5224, 0x94BC, 0x534A, 0x94BD, 0x53CD, 0x94BE, 0x53DB, 0x94BF, 0x5E06, 0x94C0, 0x642C, 0x94C1, 0x6591, + 0x94C2, 0x677F, 0x94C3, 0x6C3E, 0x94C4, 0x6C4E, 0x94C5, 0x7248, 0x94C6, 0x72AF, 0x94C7, 0x73ED, 0x94C8, 0x7554, 0x94C9, 0x7E41, + 0x94CA, 0x822C, 0x94CB, 0x85E9, 0x94CC, 0x8CA9, 0x94CD, 0x7BC4, 0x94CE, 0x91C6, 0x94CF, 0x7169, 0x94D0, 0x9812, 0x94D1, 0x98EF, + 0x94D2, 0x633D, 0x94D3, 0x6669, 0x94D4, 0x756A, 0x94D5, 0x76E4, 0x94D6, 0x78D0, 0x94D7, 0x8543, 0x94D8, 0x86EE, 0x94D9, 0x532A, + 0x94DA, 0x5351, 0x94DB, 0x5426, 0x94DC, 0x5983, 0x94DD, 0x5E87, 0x94DE, 0x5F7C, 0x94DF, 0x60B2, 0x94E0, 0x6249, 0x94E1, 0x6279, + 0x94E2, 0x62AB, 0x94E3, 0x6590, 0x94E4, 0x6BD4, 0x94E5, 0x6CCC, 0x94E6, 0x75B2, 0x94E7, 0x76AE, 0x94E8, 0x7891, 0x94E9, 0x79D8, + 0x94EA, 0x7DCB, 0x94EB, 0x7F77, 0x94EC, 0x80A5, 0x94ED, 0x88AB, 0x94EE, 0x8AB9, 0x94EF, 0x8CBB, 0x94F0, 0x907F, 0x94F1, 0x975E, + 0x94F2, 0x98DB, 0x94F3, 0x6A0B, 0x94F4, 0x7C38, 0x94F5, 0x5099, 0x94F6, 0x5C3E, 0x94F7, 0x5FAE, 0x94F8, 0x6787, 0x94F9, 0x6BD8, + 0x94FA, 0x7435, 0x94FB, 0x7709, 0x94FC, 0x7F8E, 0x9540, 0x9F3B, 0x9541, 0x67CA, 0x9542, 0x7A17, 0x9543, 0x5339, 0x9544, 0x758B, + 0x9545, 0x9AED, 0x9546, 0x5F66, 0x9547, 0x819D, 0x9548, 0x83F1, 0x9549, 0x8098, 0x954A, 0x5F3C, 0x954B, 0x5FC5, 0x954C, 0x7562, + 0x954D, 0x7B46, 0x954E, 0x903C, 0x954F, 0x6867, 0x9550, 0x59EB, 0x9551, 0x5A9B, 0x9552, 0x7D10, 0x9553, 0x767E, 0x9554, 0x8B2C, + 0x9555, 0x4FF5, 0x9556, 0x5F6A, 0x9557, 0x6A19, 0x9558, 0x6C37, 0x9559, 0x6F02, 0x955A, 0x74E2, 0x955B, 0x7968, 0x955C, 0x8868, + 0x955D, 0x8A55, 0x955E, 0x8C79, 0x955F, 0x5EDF, 0x9560, 0x63CF, 0x9561, 0x75C5, 0x9562, 0x79D2, 0x9563, 0x82D7, 0x9564, 0x9328, + 0x9565, 0x92F2, 0x9566, 0x849C, 0x9567, 0x86ED, 0x9568, 0x9C2D, 0x9569, 0x54C1, 0x956A, 0x5F6C, 0x956B, 0x658C, 0x956C, 0x6D5C, + 0x956D, 0x7015, 0x956E, 0x8CA7, 0x956F, 0x8CD3, 0x9570, 0x983B, 0x9571, 0x654F, 0x9572, 0x74F6, 0x9573, 0x4E0D, 0x9574, 0x4ED8, + 0x9575, 0x57E0, 0x9576, 0x592B, 0x9577, 0x5A66, 0x9578, 0x5BCC, 0x9579, 0x51A8, 0x957A, 0x5E03, 0x957B, 0x5E9C, 0x957C, 0x6016, + 0x957D, 0x6276, 0x957E, 0x6577, 0x9580, 0x65A7, 0x9581, 0x666E, 0x9582, 0x6D6E, 0x9583, 0x7236, 0x9584, 0x7B26, 0x9585, 0x8150, + 0x9586, 0x819A, 0x9587, 0x8299, 0x9588, 0x8B5C, 0x9589, 0x8CA0, 0x958A, 0x8CE6, 0x958B, 0x8D74, 0x958C, 0x961C, 0x958D, 0x9644, + 0x958E, 0x4FAE, 0x958F, 0x64AB, 0x9590, 0x6B66, 0x9591, 0x821E, 0x9592, 0x8461, 0x9593, 0x856A, 0x9594, 0x90E8, 0x9595, 0x5C01, + 0x9596, 0x6953, 0x9597, 0x98A8, 0x9598, 0x847A, 0x9599, 0x8557, 0x959A, 0x4F0F, 0x959B, 0x526F, 0x959C, 0x5FA9, 0x959D, 0x5E45, + 0x959E, 0x670D, 0x959F, 0x798F, 0x95A0, 0x8179, 0x95A1, 0x8907, 0x95A2, 0x8986, 0x95A3, 0x6DF5, 0x95A4, 0x5F17, 0x95A5, 0x6255, + 0x95A6, 0x6CB8, 0x95A7, 0x4ECF, 0x95A8, 0x7269, 0x95A9, 0x9B92, 0x95AA, 0x5206, 0x95AB, 0x543B, 0x95AC, 0x5674, 0x95AD, 0x58B3, + 0x95AE, 0x61A4, 0x95AF, 0x626E, 0x95B0, 0x711A, 0x95B1, 0x596E, 0x95B2, 0x7C89, 0x95B3, 0x7CDE, 0x95B4, 0x7D1B, 0x95B5, 0x96F0, + 0x95B6, 0x6587, 0x95B7, 0x805E, 0x95B8, 0x4E19, 0x95B9, 0x4F75, 0x95BA, 0x5175, 0x95BB, 0x5840, 0x95BC, 0x5E63, 0x95BD, 0x5E73, + 0x95BE, 0x5F0A, 0x95BF, 0x67C4, 0x95C0, 0x4E26, 0x95C1, 0x853D, 0x95C2, 0x9589, 0x95C3, 0x965B, 0x95C4, 0x7C73, 0x95C5, 0x9801, + 0x95C6, 0x50FB, 0x95C7, 0x58C1, 0x95C8, 0x7656, 0x95C9, 0x78A7, 0x95CA, 0x5225, 0x95CB, 0x77A5, 0x95CC, 0x8511, 0x95CD, 0x7B86, + 0x95CE, 0x504F, 0x95CF, 0x5909, 0x95D0, 0x7247, 0x95D1, 0x7BC7, 0x95D2, 0x7DE8, 0x95D3, 0x8FBA, 0x95D4, 0x8FD4, 0x95D5, 0x904D, + 0x95D6, 0x4FBF, 0x95D7, 0x52C9, 0x95D8, 0x5A29, 0x95D9, 0x5F01, 0x95DA, 0x97AD, 0x95DB, 0x4FDD, 0x95DC, 0x8217, 0x95DD, 0x92EA, + 0x95DE, 0x5703, 0x95DF, 0x6355, 0x95E0, 0x6B69, 0x95E1, 0x752B, 0x95E2, 0x88DC, 0x95E3, 0x8F14, 0x95E4, 0x7A42, 0x95E5, 0x52DF, + 0x95E6, 0x5893, 0x95E7, 0x6155, 0x95E8, 0x620A, 0x95E9, 0x66AE, 0x95EA, 0x6BCD, 0x95EB, 0x7C3F, 0x95EC, 0x83E9, 0x95ED, 0x5023, + 0x95EE, 0x4FF8, 0x95EF, 0x5305, 0x95F0, 0x5446, 0x95F1, 0x5831, 0x95F2, 0x5949, 0x95F3, 0x5B9D, 0x95F4, 0x5CF0, 0x95F5, 0x5CEF, + 0x95F6, 0x5D29, 0x95F7, 0x5E96, 0x95F8, 0x62B1, 0x95F9, 0x6367, 0x95FA, 0x653E, 0x95FB, 0x65B9, 0x95FC, 0x670B, 0x9640, 0x6CD5, + 0x9641, 0x6CE1, 0x9642, 0x70F9, 0x9643, 0x7832, 0x9644, 0x7E2B, 0x9645, 0x80DE, 0x9646, 0x82B3, 0x9647, 0x840C, 0x9648, 0x84EC, + 0x9649, 0x8702, 0x964A, 0x8912, 0x964B, 0x8A2A, 0x964C, 0x8C4A, 0x964D, 0x90A6, 0x964E, 0x92D2, 0x964F, 0x98FD, 0x9650, 0x9CF3, + 0x9651, 0x9D6C, 0x9652, 0x4E4F, 0x9653, 0x4EA1, 0x9654, 0x508D, 0x9655, 0x5256, 0x9656, 0x574A, 0x9657, 0x59A8, 0x9658, 0x5E3D, + 0x9659, 0x5FD8, 0x965A, 0x5FD9, 0x965B, 0x623F, 0x965C, 0x66B4, 0x965D, 0x671B, 0x965E, 0x67D0, 0x965F, 0x68D2, 0x9660, 0x5192, + 0x9661, 0x7D21, 0x9662, 0x80AA, 0x9663, 0x81A8, 0x9664, 0x8B00, 0x9665, 0x8C8C, 0x9666, 0x8CBF, 0x9667, 0x927E, 0x9668, 0x9632, + 0x9669, 0x5420, 0x966A, 0x982C, 0x966B, 0x5317, 0x966C, 0x50D5, 0x966D, 0x535C, 0x966E, 0x58A8, 0x966F, 0x64B2, 0x9670, 0x6734, + 0x9671, 0x7267, 0x9672, 0x7766, 0x9673, 0x7A46, 0x9674, 0x91E6, 0x9675, 0x52C3, 0x9676, 0x6CA1, 0x9677, 0x6B86, 0x9678, 0x5800, + 0x9679, 0x5E4C, 0x967A, 0x5954, 0x967B, 0x672C, 0x967C, 0x7FFB, 0x967D, 0x51E1, 0x967E, 0x76C6, 0x9680, 0x6469, 0x9681, 0x78E8, + 0x9682, 0x9B54, 0x9683, 0x9EBB, 0x9684, 0x57CB, 0x9685, 0x59B9, 0x9686, 0x6627, 0x9687, 0x679A, 0x9688, 0x6BCE, 0x9689, 0x54E9, + 0x968A, 0x69D9, 0x968B, 0x5E55, 0x968C, 0x819C, 0x968D, 0x6795, 0x968E, 0x9BAA, 0x968F, 0x67FE, 0x9690, 0x9C52, 0x9691, 0x685D, + 0x9692, 0x4EA6, 0x9693, 0x4FE3, 0x9694, 0x53C8, 0x9695, 0x62B9, 0x9696, 0x672B, 0x9697, 0x6CAB, 0x9698, 0x8FC4, 0x9699, 0x4FAD, + 0x969A, 0x7E6D, 0x969B, 0x9EBF, 0x969C, 0x4E07, 0x969D, 0x6162, 0x969E, 0x6E80, 0x969F, 0x6F2B, 0x96A0, 0x8513, 0x96A1, 0x5473, + 0x96A2, 0x672A, 0x96A3, 0x9B45, 0x96A4, 0x5DF3, 0x96A5, 0x7B95, 0x96A6, 0x5CAC, 0x96A7, 0x5BC6, 0x96A8, 0x871C, 0x96A9, 0x6E4A, + 0x96AA, 0x84D1, 0x96AB, 0x7A14, 0x96AC, 0x8108, 0x96AD, 0x5999, 0x96AE, 0x7C8D, 0x96AF, 0x6C11, 0x96B0, 0x7720, 0x96B1, 0x52D9, + 0x96B2, 0x5922, 0x96B3, 0x7121, 0x96B4, 0x725F, 0x96B5, 0x77DB, 0x96B6, 0x9727, 0x96B7, 0x9D61, 0x96B8, 0x690B, 0x96B9, 0x5A7F, + 0x96BA, 0x5A18, 0x96BB, 0x51A5, 0x96BC, 0x540D, 0x96BD, 0x547D, 0x96BE, 0x660E, 0x96BF, 0x76DF, 0x96C0, 0x8FF7, 0x96C1, 0x9298, + 0x96C2, 0x9CF4, 0x96C3, 0x59EA, 0x96C4, 0x725D, 0x96C5, 0x6EC5, 0x96C6, 0x514D, 0x96C7, 0x68C9, 0x96C8, 0x7DBF, 0x96C9, 0x7DEC, + 0x96CA, 0x9762, 0x96CB, 0x9EBA, 0x96CC, 0x6478, 0x96CD, 0x6A21, 0x96CE, 0x8302, 0x96CF, 0x5984, 0x96D0, 0x5B5F, 0x96D1, 0x6BDB, + 0x96D2, 0x731B, 0x96D3, 0x76F2, 0x96D4, 0x7DB2, 0x96D5, 0x8017, 0x96D6, 0x8499, 0x96D7, 0x5132, 0x96D8, 0x6728, 0x96D9, 0x9ED9, + 0x96DA, 0x76EE, 0x96DB, 0x6762, 0x96DC, 0x52FF, 0x96DD, 0x9905, 0x96DE, 0x5C24, 0x96DF, 0x623B, 0x96E0, 0x7C7E, 0x96E1, 0x8CB0, + 0x96E2, 0x554F, 0x96E3, 0x60B6, 0x96E4, 0x7D0B, 0x96E5, 0x9580, 0x96E6, 0x5301, 0x96E7, 0x4E5F, 0x96E8, 0x51B6, 0x96E9, 0x591C, + 0x96EA, 0x723A, 0x96EB, 0x8036, 0x96EC, 0x91CE, 0x96ED, 0x5F25, 0x96EE, 0x77E2, 0x96EF, 0x5384, 0x96F0, 0x5F79, 0x96F1, 0x7D04, + 0x96F2, 0x85AC, 0x96F3, 0x8A33, 0x96F4, 0x8E8D, 0x96F5, 0x9756, 0x96F6, 0x67F3, 0x96F7, 0x85AE, 0x96F8, 0x9453, 0x96F9, 0x6109, + 0x96FA, 0x6108, 0x96FB, 0x6CB9, 0x96FC, 0x7652, 0x9740, 0x8AED, 0x9741, 0x8F38, 0x9742, 0x552F, 0x9743, 0x4F51, 0x9744, 0x512A, + 0x9745, 0x52C7, 0x9746, 0x53CB, 0x9747, 0x5BA5, 0x9748, 0x5E7D, 0x9749, 0x60A0, 0x974A, 0x6182, 0x974B, 0x63D6, 0x974C, 0x6709, + 0x974D, 0x67DA, 0x974E, 0x6E67, 0x974F, 0x6D8C, 0x9750, 0x7336, 0x9751, 0x7337, 0x9752, 0x7531, 0x9753, 0x7950, 0x9754, 0x88D5, + 0x9755, 0x8A98, 0x9756, 0x904A, 0x9757, 0x9091, 0x9758, 0x90F5, 0x9759, 0x96C4, 0x975A, 0x878D, 0x975B, 0x5915, 0x975C, 0x4E88, + 0x975D, 0x4F59, 0x975E, 0x4E0E, 0x975F, 0x8A89, 0x9760, 0x8F3F, 0x9761, 0x9810, 0x9762, 0x50AD, 0x9763, 0x5E7C, 0x9764, 0x5996, + 0x9765, 0x5BB9, 0x9766, 0x5EB8, 0x9767, 0x63DA, 0x9768, 0x63FA, 0x9769, 0x64C1, 0x976A, 0x66DC, 0x976B, 0x694A, 0x976C, 0x69D8, + 0x976D, 0x6D0B, 0x976E, 0x6EB6, 0x976F, 0x7194, 0x9770, 0x7528, 0x9771, 0x7AAF, 0x9772, 0x7F8A, 0x9773, 0x8000, 0x9774, 0x8449, + 0x9775, 0x84C9, 0x9776, 0x8981, 0x9777, 0x8B21, 0x9778, 0x8E0A, 0x9779, 0x9065, 0x977A, 0x967D, 0x977B, 0x990A, 0x977C, 0x617E, + 0x977D, 0x6291, 0x977E, 0x6B32, 0x9780, 0x6C83, 0x9781, 0x6D74, 0x9782, 0x7FCC, 0x9783, 0x7FFC, 0x9784, 0x6DC0, 0x9785, 0x7F85, + 0x9786, 0x87BA, 0x9787, 0x88F8, 0x9788, 0x6765, 0x9789, 0x83B1, 0x978A, 0x983C, 0x978B, 0x96F7, 0x978C, 0x6D1B, 0x978D, 0x7D61, + 0x978E, 0x843D, 0x978F, 0x916A, 0x9790, 0x4E71, 0x9791, 0x5375, 0x9792, 0x5D50, 0x9793, 0x6B04, 0x9794, 0x6FEB, 0x9795, 0x85CD, + 0x9796, 0x862D, 0x9797, 0x89A7, 0x9798, 0x5229, 0x9799, 0x540F, 0x979A, 0x5C65, 0x979B, 0x674E, 0x979C, 0x68A8, 0x979D, 0x7406, + 0x979E, 0x7483, 0x979F, 0x75E2, 0x97A0, 0x88CF, 0x97A1, 0x88E1, 0x97A2, 0x91CC, 0x97A3, 0x96E2, 0x97A4, 0x9678, 0x97A5, 0x5F8B, + 0x97A6, 0x7387, 0x97A7, 0x7ACB, 0x97A8, 0x844E, 0x97A9, 0x63A0, 0x97AA, 0x7565, 0x97AB, 0x5289, 0x97AC, 0x6D41, 0x97AD, 0x6E9C, + 0x97AE, 0x7409, 0x97AF, 0x7559, 0x97B0, 0x786B, 0x97B1, 0x7C92, 0x97B2, 0x9686, 0x97B3, 0x7ADC, 0x97B4, 0x9F8D, 0x97B5, 0x4FB6, + 0x97B6, 0x616E, 0x97B7, 0x65C5, 0x97B8, 0x865C, 0x97B9, 0x4E86, 0x97BA, 0x4EAE, 0x97BB, 0x50DA, 0x97BC, 0x4E21, 0x97BD, 0x51CC, + 0x97BE, 0x5BEE, 0x97BF, 0x6599, 0x97C0, 0x6881, 0x97C1, 0x6DBC, 0x97C2, 0x731F, 0x97C3, 0x7642, 0x97C4, 0x77AD, 0x97C5, 0x7A1C, + 0x97C6, 0x7CE7, 0x97C7, 0x826F, 0x97C8, 0x8AD2, 0x97C9, 0x907C, 0x97CA, 0x91CF, 0x97CB, 0x9675, 0x97CC, 0x9818, 0x97CD, 0x529B, + 0x97CE, 0x7DD1, 0x97CF, 0x502B, 0x97D0, 0x5398, 0x97D1, 0x6797, 0x97D2, 0x6DCB, 0x97D3, 0x71D0, 0x97D4, 0x7433, 0x97D5, 0x81E8, + 0x97D6, 0x8F2A, 0x97D7, 0x96A3, 0x97D8, 0x9C57, 0x97D9, 0x9E9F, 0x97DA, 0x7460, 0x97DB, 0x5841, 0x97DC, 0x6D99, 0x97DD, 0x7D2F, + 0x97DE, 0x985E, 0x97DF, 0x4EE4, 0x97E0, 0x4F36, 0x97E1, 0x4F8B, 0x97E2, 0x51B7, 0x97E3, 0x52B1, 0x97E4, 0x5DBA, 0x97E5, 0x601C, + 0x97E6, 0x73B2, 0x97E7, 0x793C, 0x97E8, 0x82D3, 0x97E9, 0x9234, 0x97EA, 0x96B7, 0x97EB, 0x96F6, 0x97EC, 0x970A, 0x97ED, 0x9E97, + 0x97EE, 0x9F62, 0x97EF, 0x66A6, 0x97F0, 0x6B74, 0x97F1, 0x5217, 0x97F2, 0x52A3, 0x97F3, 0x70C8, 0x97F4, 0x88C2, 0x97F5, 0x5EC9, + 0x97F6, 0x604B, 0x97F7, 0x6190, 0x97F8, 0x6F23, 0x97F9, 0x7149, 0x97FA, 0x7C3E, 0x97FB, 0x7DF4, 0x97FC, 0x806F, 0x9840, 0x84EE, + 0x9841, 0x9023, 0x9842, 0x932C, 0x9843, 0x5442, 0x9844, 0x9B6F, 0x9845, 0x6AD3, 0x9846, 0x7089, 0x9847, 0x8CC2, 0x9848, 0x8DEF, + 0x9849, 0x9732, 0x984A, 0x52B4, 0x984B, 0x5A41, 0x984C, 0x5ECA, 0x984D, 0x5F04, 0x984E, 0x6717, 0x984F, 0x697C, 0x9850, 0x6994, + 0x9851, 0x6D6A, 0x9852, 0x6F0F, 0x9853, 0x7262, 0x9854, 0x72FC, 0x9855, 0x7BED, 0x9856, 0x8001, 0x9857, 0x807E, 0x9858, 0x874B, + 0x9859, 0x90CE, 0x985A, 0x516D, 0x985B, 0x9E93, 0x985C, 0x7984, 0x985D, 0x808B, 0x985E, 0x9332, 0x985F, 0x8AD6, 0x9860, 0x502D, + 0x9861, 0x548C, 0x9862, 0x8A71, 0x9863, 0x6B6A, 0x9864, 0x8CC4, 0x9865, 0x8107, 0x9866, 0x60D1, 0x9867, 0x67A0, 0x9868, 0x9DF2, + 0x9869, 0x4E99, 0x986A, 0x4E98, 0x986B, 0x9C10, 0x986C, 0x8A6B, 0x986D, 0x85C1, 0x986E, 0x8568, 0x986F, 0x6900, 0x9870, 0x6E7E, + 0x9871, 0x7897, 0x9872, 0x8155, 0x989F, 0x5F0C, 0x98A0, 0x4E10, 0x98A1, 0x4E15, 0x98A2, 0x4E2A, 0x98A3, 0x4E31, 0x98A4, 0x4E36, + 0x98A5, 0x4E3C, 0x98A6, 0x4E3F, 0x98A7, 0x4E42, 0x98A8, 0x4E56, 0x98A9, 0x4E58, 0x98AA, 0x4E82, 0x98AB, 0x4E85, 0x98AC, 0x8C6B, + 0x98AD, 0x4E8A, 0x98AE, 0x8212, 0x98AF, 0x5F0D, 0x98B0, 0x4E8E, 0x98B1, 0x4E9E, 0x98B2, 0x4E9F, 0x98B3, 0x4EA0, 0x98B4, 0x4EA2, + 0x98B5, 0x4EB0, 0x98B6, 0x4EB3, 0x98B7, 0x4EB6, 0x98B8, 0x4ECE, 0x98B9, 0x4ECD, 0x98BA, 0x4EC4, 0x98BB, 0x4EC6, 0x98BC, 0x4EC2, + 0x98BD, 0x4ED7, 0x98BE, 0x4EDE, 0x98BF, 0x4EED, 0x98C0, 0x4EDF, 0x98C1, 0x4EF7, 0x98C2, 0x4F09, 0x98C3, 0x4F5A, 0x98C4, 0x4F30, + 0x98C5, 0x4F5B, 0x98C6, 0x4F5D, 0x98C7, 0x4F57, 0x98C8, 0x4F47, 0x98C9, 0x4F76, 0x98CA, 0x4F88, 0x98CB, 0x4F8F, 0x98CC, 0x4F98, + 0x98CD, 0x4F7B, 0x98CE, 0x4F69, 0x98CF, 0x4F70, 0x98D0, 0x4F91, 0x98D1, 0x4F6F, 0x98D2, 0x4F86, 0x98D3, 0x4F96, 0x98D4, 0x5118, + 0x98D5, 0x4FD4, 0x98D6, 0x4FDF, 0x98D7, 0x4FCE, 0x98D8, 0x4FD8, 0x98D9, 0x4FDB, 0x98DA, 0x4FD1, 0x98DB, 0x4FDA, 0x98DC, 0x4FD0, + 0x98DD, 0x4FE4, 0x98DE, 0x4FE5, 0x98DF, 0x501A, 0x98E0, 0x5028, 0x98E1, 0x5014, 0x98E2, 0x502A, 0x98E3, 0x5025, 0x98E4, 0x5005, + 0x98E5, 0x4F1C, 0x98E6, 0x4FF6, 0x98E7, 0x5021, 0x98E8, 0x5029, 0x98E9, 0x502C, 0x98EA, 0x4FFE, 0x98EB, 0x4FEF, 0x98EC, 0x5011, + 0x98ED, 0x5006, 0x98EE, 0x5043, 0x98EF, 0x5047, 0x98F0, 0x6703, 0x98F1, 0x5055, 0x98F2, 0x5050, 0x98F3, 0x5048, 0x98F4, 0x505A, + 0x98F5, 0x5056, 0x98F6, 0x506C, 0x98F7, 0x5078, 0x98F8, 0x5080, 0x98F9, 0x509A, 0x98FA, 0x5085, 0x98FB, 0x50B4, 0x98FC, 0x50B2, + 0x9940, 0x50C9, 0x9941, 0x50CA, 0x9942, 0x50B3, 0x9943, 0x50C2, 0x9944, 0x50D6, 0x9945, 0x50DE, 0x9946, 0x50E5, 0x9947, 0x50ED, + 0x9948, 0x50E3, 0x9949, 0x50EE, 0x994A, 0x50F9, 0x994B, 0x50F5, 0x994C, 0x5109, 0x994D, 0x5101, 0x994E, 0x5102, 0x994F, 0x5116, + 0x9950, 0x5115, 0x9951, 0x5114, 0x9952, 0x511A, 0x9953, 0x5121, 0x9954, 0x513A, 0x9955, 0x5137, 0x9956, 0x513C, 0x9957, 0x513B, + 0x9958, 0x513F, 0x9959, 0x5140, 0x995A, 0x5152, 0x995B, 0x514C, 0x995C, 0x5154, 0x995D, 0x5162, 0x995E, 0x7AF8, 0x995F, 0x5169, + 0x9960, 0x516A, 0x9961, 0x516E, 0x9962, 0x5180, 0x9963, 0x5182, 0x9964, 0x56D8, 0x9965, 0x518C, 0x9966, 0x5189, 0x9967, 0x518F, + 0x9968, 0x5191, 0x9969, 0x5193, 0x996A, 0x5195, 0x996B, 0x5196, 0x996C, 0x51A4, 0x996D, 0x51A6, 0x996E, 0x51A2, 0x996F, 0x51A9, + 0x9970, 0x51AA, 0x9971, 0x51AB, 0x9972, 0x51B3, 0x9973, 0x51B1, 0x9974, 0x51B2, 0x9975, 0x51B0, 0x9976, 0x51B5, 0x9977, 0x51BD, + 0x9978, 0x51C5, 0x9979, 0x51C9, 0x997A, 0x51DB, 0x997B, 0x51E0, 0x997C, 0x8655, 0x997D, 0x51E9, 0x997E, 0x51ED, 0x9980, 0x51F0, + 0x9981, 0x51F5, 0x9982, 0x51FE, 0x9983, 0x5204, 0x9984, 0x520B, 0x9985, 0x5214, 0x9986, 0x520E, 0x9987, 0x5227, 0x9988, 0x522A, + 0x9989, 0x522E, 0x998A, 0x5233, 0x998B, 0x5239, 0x998C, 0x524F, 0x998D, 0x5244, 0x998E, 0x524B, 0x998F, 0x524C, 0x9990, 0x525E, + 0x9991, 0x5254, 0x9992, 0x526A, 0x9993, 0x5274, 0x9994, 0x5269, 0x9995, 0x5273, 0x9996, 0x527F, 0x9997, 0x527D, 0x9998, 0x528D, + 0x9999, 0x5294, 0x999A, 0x5292, 0x999B, 0x5271, 0x999C, 0x5288, 0x999D, 0x5291, 0x999E, 0x8FA8, 0x999F, 0x8FA7, 0x99A0, 0x52AC, + 0x99A1, 0x52AD, 0x99A2, 0x52BC, 0x99A3, 0x52B5, 0x99A4, 0x52C1, 0x99A5, 0x52CD, 0x99A6, 0x52D7, 0x99A7, 0x52DE, 0x99A8, 0x52E3, + 0x99A9, 0x52E6, 0x99AA, 0x98ED, 0x99AB, 0x52E0, 0x99AC, 0x52F3, 0x99AD, 0x52F5, 0x99AE, 0x52F8, 0x99AF, 0x52F9, 0x99B0, 0x5306, + 0x99B1, 0x5308, 0x99B2, 0x7538, 0x99B3, 0x530D, 0x99B4, 0x5310, 0x99B5, 0x530F, 0x99B6, 0x5315, 0x99B7, 0x531A, 0x99B8, 0x5323, + 0x99B9, 0x532F, 0x99BA, 0x5331, 0x99BB, 0x5333, 0x99BC, 0x5338, 0x99BD, 0x5340, 0x99BE, 0x5346, 0x99BF, 0x5345, 0x99C0, 0x4E17, + 0x99C1, 0x5349, 0x99C2, 0x534D, 0x99C3, 0x51D6, 0x99C4, 0x535E, 0x99C5, 0x5369, 0x99C6, 0x536E, 0x99C7, 0x5918, 0x99C8, 0x537B, + 0x99C9, 0x5377, 0x99CA, 0x5382, 0x99CB, 0x5396, 0x99CC, 0x53A0, 0x99CD, 0x53A6, 0x99CE, 0x53A5, 0x99CF, 0x53AE, 0x99D0, 0x53B0, + 0x99D1, 0x53B6, 0x99D2, 0x53C3, 0x99D3, 0x7C12, 0x99D4, 0x96D9, 0x99D5, 0x53DF, 0x99D6, 0x66FC, 0x99D7, 0x71EE, 0x99D8, 0x53EE, + 0x99D9, 0x53E8, 0x99DA, 0x53ED, 0x99DB, 0x53FA, 0x99DC, 0x5401, 0x99DD, 0x543D, 0x99DE, 0x5440, 0x99DF, 0x542C, 0x99E0, 0x542D, + 0x99E1, 0x543C, 0x99E2, 0x542E, 0x99E3, 0x5436, 0x99E4, 0x5429, 0x99E5, 0x541D, 0x99E6, 0x544E, 0x99E7, 0x548F, 0x99E8, 0x5475, + 0x99E9, 0x548E, 0x99EA, 0x545F, 0x99EB, 0x5471, 0x99EC, 0x5477, 0x99ED, 0x5470, 0x99EE, 0x5492, 0x99EF, 0x547B, 0x99F0, 0x5480, + 0x99F1, 0x5476, 0x99F2, 0x5484, 0x99F3, 0x5490, 0x99F4, 0x5486, 0x99F5, 0x54C7, 0x99F6, 0x54A2, 0x99F7, 0x54B8, 0x99F8, 0x54A5, + 0x99F9, 0x54AC, 0x99FA, 0x54C4, 0x99FB, 0x54C8, 0x99FC, 0x54A8, 0x9A40, 0x54AB, 0x9A41, 0x54C2, 0x9A42, 0x54A4, 0x9A43, 0x54BE, + 0x9A44, 0x54BC, 0x9A45, 0x54D8, 0x9A46, 0x54E5, 0x9A47, 0x54E6, 0x9A48, 0x550F, 0x9A49, 0x5514, 0x9A4A, 0x54FD, 0x9A4B, 0x54EE, + 0x9A4C, 0x54ED, 0x9A4D, 0x54FA, 0x9A4E, 0x54E2, 0x9A4F, 0x5539, 0x9A50, 0x5540, 0x9A51, 0x5563, 0x9A52, 0x554C, 0x9A53, 0x552E, + 0x9A54, 0x555C, 0x9A55, 0x5545, 0x9A56, 0x5556, 0x9A57, 0x5557, 0x9A58, 0x5538, 0x9A59, 0x5533, 0x9A5A, 0x555D, 0x9A5B, 0x5599, + 0x9A5C, 0x5580, 0x9A5D, 0x54AF, 0x9A5E, 0x558A, 0x9A5F, 0x559F, 0x9A60, 0x557B, 0x9A61, 0x557E, 0x9A62, 0x5598, 0x9A63, 0x559E, + 0x9A64, 0x55AE, 0x9A65, 0x557C, 0x9A66, 0x5583, 0x9A67, 0x55A9, 0x9A68, 0x5587, 0x9A69, 0x55A8, 0x9A6A, 0x55DA, 0x9A6B, 0x55C5, + 0x9A6C, 0x55DF, 0x9A6D, 0x55C4, 0x9A6E, 0x55DC, 0x9A6F, 0x55E4, 0x9A70, 0x55D4, 0x9A71, 0x5614, 0x9A72, 0x55F7, 0x9A73, 0x5616, + 0x9A74, 0x55FE, 0x9A75, 0x55FD, 0x9A76, 0x561B, 0x9A77, 0x55F9, 0x9A78, 0x564E, 0x9A79, 0x5650, 0x9A7A, 0x71DF, 0x9A7B, 0x5634, + 0x9A7C, 0x5636, 0x9A7D, 0x5632, 0x9A7E, 0x5638, 0x9A80, 0x566B, 0x9A81, 0x5664, 0x9A82, 0x562F, 0x9A83, 0x566C, 0x9A84, 0x566A, + 0x9A85, 0x5686, 0x9A86, 0x5680, 0x9A87, 0x568A, 0x9A88, 0x56A0, 0x9A89, 0x5694, 0x9A8A, 0x568F, 0x9A8B, 0x56A5, 0x9A8C, 0x56AE, + 0x9A8D, 0x56B6, 0x9A8E, 0x56B4, 0x9A8F, 0x56C2, 0x9A90, 0x56BC, 0x9A91, 0x56C1, 0x9A92, 0x56C3, 0x9A93, 0x56C0, 0x9A94, 0x56C8, + 0x9A95, 0x56CE, 0x9A96, 0x56D1, 0x9A97, 0x56D3, 0x9A98, 0x56D7, 0x9A99, 0x56EE, 0x9A9A, 0x56F9, 0x9A9B, 0x5700, 0x9A9C, 0x56FF, + 0x9A9D, 0x5704, 0x9A9E, 0x5709, 0x9A9F, 0x5708, 0x9AA0, 0x570B, 0x9AA1, 0x570D, 0x9AA2, 0x5713, 0x9AA3, 0x5718, 0x9AA4, 0x5716, + 0x9AA5, 0x55C7, 0x9AA6, 0x571C, 0x9AA7, 0x5726, 0x9AA8, 0x5737, 0x9AA9, 0x5738, 0x9AAA, 0x574E, 0x9AAB, 0x573B, 0x9AAC, 0x5740, + 0x9AAD, 0x574F, 0x9AAE, 0x5769, 0x9AAF, 0x57C0, 0x9AB0, 0x5788, 0x9AB1, 0x5761, 0x9AB2, 0x577F, 0x9AB3, 0x5789, 0x9AB4, 0x5793, + 0x9AB5, 0x57A0, 0x9AB6, 0x57B3, 0x9AB7, 0x57A4, 0x9AB8, 0x57AA, 0x9AB9, 0x57B0, 0x9ABA, 0x57C3, 0x9ABB, 0x57C6, 0x9ABC, 0x57D4, + 0x9ABD, 0x57D2, 0x9ABE, 0x57D3, 0x9ABF, 0x580A, 0x9AC0, 0x57D6, 0x9AC1, 0x57E3, 0x9AC2, 0x580B, 0x9AC3, 0x5819, 0x9AC4, 0x581D, + 0x9AC5, 0x5872, 0x9AC6, 0x5821, 0x9AC7, 0x5862, 0x9AC8, 0x584B, 0x9AC9, 0x5870, 0x9ACA, 0x6BC0, 0x9ACB, 0x5852, 0x9ACC, 0x583D, + 0x9ACD, 0x5879, 0x9ACE, 0x5885, 0x9ACF, 0x58B9, 0x9AD0, 0x589F, 0x9AD1, 0x58AB, 0x9AD2, 0x58BA, 0x9AD3, 0x58DE, 0x9AD4, 0x58BB, + 0x9AD5, 0x58B8, 0x9AD6, 0x58AE, 0x9AD7, 0x58C5, 0x9AD8, 0x58D3, 0x9AD9, 0x58D1, 0x9ADA, 0x58D7, 0x9ADB, 0x58D9, 0x9ADC, 0x58D8, + 0x9ADD, 0x58E5, 0x9ADE, 0x58DC, 0x9ADF, 0x58E4, 0x9AE0, 0x58DF, 0x9AE1, 0x58EF, 0x9AE2, 0x58FA, 0x9AE3, 0x58F9, 0x9AE4, 0x58FB, + 0x9AE5, 0x58FC, 0x9AE6, 0x58FD, 0x9AE7, 0x5902, 0x9AE8, 0x590A, 0x9AE9, 0x5910, 0x9AEA, 0x591B, 0x9AEB, 0x68A6, 0x9AEC, 0x5925, + 0x9AED, 0x592C, 0x9AEE, 0x592D, 0x9AEF, 0x5932, 0x9AF0, 0x5938, 0x9AF1, 0x593E, 0x9AF2, 0x7AD2, 0x9AF3, 0x5955, 0x9AF4, 0x5950, + 0x9AF5, 0x594E, 0x9AF6, 0x595A, 0x9AF7, 0x5958, 0x9AF8, 0x5962, 0x9AF9, 0x5960, 0x9AFA, 0x5967, 0x9AFB, 0x596C, 0x9AFC, 0x5969, + 0x9B40, 0x5978, 0x9B41, 0x5981, 0x9B42, 0x599D, 0x9B43, 0x4F5E, 0x9B44, 0x4FAB, 0x9B45, 0x59A3, 0x9B46, 0x59B2, 0x9B47, 0x59C6, + 0x9B48, 0x59E8, 0x9B49, 0x59DC, 0x9B4A, 0x598D, 0x9B4B, 0x59D9, 0x9B4C, 0x59DA, 0x9B4D, 0x5A25, 0x9B4E, 0x5A1F, 0x9B4F, 0x5A11, + 0x9B50, 0x5A1C, 0x9B51, 0x5A09, 0x9B52, 0x5A1A, 0x9B53, 0x5A40, 0x9B54, 0x5A6C, 0x9B55, 0x5A49, 0x9B56, 0x5A35, 0x9B57, 0x5A36, + 0x9B58, 0x5A62, 0x9B59, 0x5A6A, 0x9B5A, 0x5A9A, 0x9B5B, 0x5ABC, 0x9B5C, 0x5ABE, 0x9B5D, 0x5ACB, 0x9B5E, 0x5AC2, 0x9B5F, 0x5ABD, + 0x9B60, 0x5AE3, 0x9B61, 0x5AD7, 0x9B62, 0x5AE6, 0x9B63, 0x5AE9, 0x9B64, 0x5AD6, 0x9B65, 0x5AFA, 0x9B66, 0x5AFB, 0x9B67, 0x5B0C, + 0x9B68, 0x5B0B, 0x9B69, 0x5B16, 0x9B6A, 0x5B32, 0x9B6B, 0x5AD0, 0x9B6C, 0x5B2A, 0x9B6D, 0x5B36, 0x9B6E, 0x5B3E, 0x9B6F, 0x5B43, + 0x9B70, 0x5B45, 0x9B71, 0x5B40, 0x9B72, 0x5B51, 0x9B73, 0x5B55, 0x9B74, 0x5B5A, 0x9B75, 0x5B5B, 0x9B76, 0x5B65, 0x9B77, 0x5B69, + 0x9B78, 0x5B70, 0x9B79, 0x5B73, 0x9B7A, 0x5B75, 0x9B7B, 0x5B78, 0x9B7C, 0x6588, 0x9B7D, 0x5B7A, 0x9B7E, 0x5B80, 0x9B80, 0x5B83, + 0x9B81, 0x5BA6, 0x9B82, 0x5BB8, 0x9B83, 0x5BC3, 0x9B84, 0x5BC7, 0x9B85, 0x5BC9, 0x9B86, 0x5BD4, 0x9B87, 0x5BD0, 0x9B88, 0x5BE4, + 0x9B89, 0x5BE6, 0x9B8A, 0x5BE2, 0x9B8B, 0x5BDE, 0x9B8C, 0x5BE5, 0x9B8D, 0x5BEB, 0x9B8E, 0x5BF0, 0x9B8F, 0x5BF6, 0x9B90, 0x5BF3, + 0x9B91, 0x5C05, 0x9B92, 0x5C07, 0x9B93, 0x5C08, 0x9B94, 0x5C0D, 0x9B95, 0x5C13, 0x9B96, 0x5C20, 0x9B97, 0x5C22, 0x9B98, 0x5C28, + 0x9B99, 0x5C38, 0x9B9A, 0x5C39, 0x9B9B, 0x5C41, 0x9B9C, 0x5C46, 0x9B9D, 0x5C4E, 0x9B9E, 0x5C53, 0x9B9F, 0x5C50, 0x9BA0, 0x5C4F, + 0x9BA1, 0x5B71, 0x9BA2, 0x5C6C, 0x9BA3, 0x5C6E, 0x9BA4, 0x4E62, 0x9BA5, 0x5C76, 0x9BA6, 0x5C79, 0x9BA7, 0x5C8C, 0x9BA8, 0x5C91, + 0x9BA9, 0x5C94, 0x9BAA, 0x599B, 0x9BAB, 0x5CAB, 0x9BAC, 0x5CBB, 0x9BAD, 0x5CB6, 0x9BAE, 0x5CBC, 0x9BAF, 0x5CB7, 0x9BB0, 0x5CC5, + 0x9BB1, 0x5CBE, 0x9BB2, 0x5CC7, 0x9BB3, 0x5CD9, 0x9BB4, 0x5CE9, 0x9BB5, 0x5CFD, 0x9BB6, 0x5CFA, 0x9BB7, 0x5CED, 0x9BB8, 0x5D8C, + 0x9BB9, 0x5CEA, 0x9BBA, 0x5D0B, 0x9BBB, 0x5D15, 0x9BBC, 0x5D17, 0x9BBD, 0x5D5C, 0x9BBE, 0x5D1F, 0x9BBF, 0x5D1B, 0x9BC0, 0x5D11, + 0x9BC1, 0x5D14, 0x9BC2, 0x5D22, 0x9BC3, 0x5D1A, 0x9BC4, 0x5D19, 0x9BC5, 0x5D18, 0x9BC6, 0x5D4C, 0x9BC7, 0x5D52, 0x9BC8, 0x5D4E, + 0x9BC9, 0x5D4B, 0x9BCA, 0x5D6C, 0x9BCB, 0x5D73, 0x9BCC, 0x5D76, 0x9BCD, 0x5D87, 0x9BCE, 0x5D84, 0x9BCF, 0x5D82, 0x9BD0, 0x5DA2, + 0x9BD1, 0x5D9D, 0x9BD2, 0x5DAC, 0x9BD3, 0x5DAE, 0x9BD4, 0x5DBD, 0x9BD5, 0x5D90, 0x9BD6, 0x5DB7, 0x9BD7, 0x5DBC, 0x9BD8, 0x5DC9, + 0x9BD9, 0x5DCD, 0x9BDA, 0x5DD3, 0x9BDB, 0x5DD2, 0x9BDC, 0x5DD6, 0x9BDD, 0x5DDB, 0x9BDE, 0x5DEB, 0x9BDF, 0x5DF2, 0x9BE0, 0x5DF5, + 0x9BE1, 0x5E0B, 0x9BE2, 0x5E1A, 0x9BE3, 0x5E19, 0x9BE4, 0x5E11, 0x9BE5, 0x5E1B, 0x9BE6, 0x5E36, 0x9BE7, 0x5E37, 0x9BE8, 0x5E44, + 0x9BE9, 0x5E43, 0x9BEA, 0x5E40, 0x9BEB, 0x5E4E, 0x9BEC, 0x5E57, 0x9BED, 0x5E54, 0x9BEE, 0x5E5F, 0x9BEF, 0x5E62, 0x9BF0, 0x5E64, + 0x9BF1, 0x5E47, 0x9BF2, 0x5E75, 0x9BF3, 0x5E76, 0x9BF4, 0x5E7A, 0x9BF5, 0x9EBC, 0x9BF6, 0x5E7F, 0x9BF7, 0x5EA0, 0x9BF8, 0x5EC1, + 0x9BF9, 0x5EC2, 0x9BFA, 0x5EC8, 0x9BFB, 0x5ED0, 0x9BFC, 0x5ECF, 0x9C40, 0x5ED6, 0x9C41, 0x5EE3, 0x9C42, 0x5EDD, 0x9C43, 0x5EDA, + 0x9C44, 0x5EDB, 0x9C45, 0x5EE2, 0x9C46, 0x5EE1, 0x9C47, 0x5EE8, 0x9C48, 0x5EE9, 0x9C49, 0x5EEC, 0x9C4A, 0x5EF1, 0x9C4B, 0x5EF3, + 0x9C4C, 0x5EF0, 0x9C4D, 0x5EF4, 0x9C4E, 0x5EF8, 0x9C4F, 0x5EFE, 0x9C50, 0x5F03, 0x9C51, 0x5F09, 0x9C52, 0x5F5D, 0x9C53, 0x5F5C, + 0x9C54, 0x5F0B, 0x9C55, 0x5F11, 0x9C56, 0x5F16, 0x9C57, 0x5F29, 0x9C58, 0x5F2D, 0x9C59, 0x5F38, 0x9C5A, 0x5F41, 0x9C5B, 0x5F48, + 0x9C5C, 0x5F4C, 0x9C5D, 0x5F4E, 0x9C5E, 0x5F2F, 0x9C5F, 0x5F51, 0x9C60, 0x5F56, 0x9C61, 0x5F57, 0x9C62, 0x5F59, 0x9C63, 0x5F61, + 0x9C64, 0x5F6D, 0x9C65, 0x5F73, 0x9C66, 0x5F77, 0x9C67, 0x5F83, 0x9C68, 0x5F82, 0x9C69, 0x5F7F, 0x9C6A, 0x5F8A, 0x9C6B, 0x5F88, + 0x9C6C, 0x5F91, 0x9C6D, 0x5F87, 0x9C6E, 0x5F9E, 0x9C6F, 0x5F99, 0x9C70, 0x5F98, 0x9C71, 0x5FA0, 0x9C72, 0x5FA8, 0x9C73, 0x5FAD, + 0x9C74, 0x5FBC, 0x9C75, 0x5FD6, 0x9C76, 0x5FFB, 0x9C77, 0x5FE4, 0x9C78, 0x5FF8, 0x9C79, 0x5FF1, 0x9C7A, 0x5FDD, 0x9C7B, 0x60B3, + 0x9C7C, 0x5FFF, 0x9C7D, 0x6021, 0x9C7E, 0x6060, 0x9C80, 0x6019, 0x9C81, 0x6010, 0x9C82, 0x6029, 0x9C83, 0x600E, 0x9C84, 0x6031, + 0x9C85, 0x601B, 0x9C86, 0x6015, 0x9C87, 0x602B, 0x9C88, 0x6026, 0x9C89, 0x600F, 0x9C8A, 0x603A, 0x9C8B, 0x605A, 0x9C8C, 0x6041, + 0x9C8D, 0x606A, 0x9C8E, 0x6077, 0x9C8F, 0x605F, 0x9C90, 0x604A, 0x9C91, 0x6046, 0x9C92, 0x604D, 0x9C93, 0x6063, 0x9C94, 0x6043, + 0x9C95, 0x6064, 0x9C96, 0x6042, 0x9C97, 0x606C, 0x9C98, 0x606B, 0x9C99, 0x6059, 0x9C9A, 0x6081, 0x9C9B, 0x608D, 0x9C9C, 0x60E7, + 0x9C9D, 0x6083, 0x9C9E, 0x609A, 0x9C9F, 0x6084, 0x9CA0, 0x609B, 0x9CA1, 0x6096, 0x9CA2, 0x6097, 0x9CA3, 0x6092, 0x9CA4, 0x60A7, + 0x9CA5, 0x608B, 0x9CA6, 0x60E1, 0x9CA7, 0x60B8, 0x9CA8, 0x60E0, 0x9CA9, 0x60D3, 0x9CAA, 0x60B4, 0x9CAB, 0x5FF0, 0x9CAC, 0x60BD, + 0x9CAD, 0x60C6, 0x9CAE, 0x60B5, 0x9CAF, 0x60D8, 0x9CB0, 0x614D, 0x9CB1, 0x6115, 0x9CB2, 0x6106, 0x9CB3, 0x60F6, 0x9CB4, 0x60F7, + 0x9CB5, 0x6100, 0x9CB6, 0x60F4, 0x9CB7, 0x60FA, 0x9CB8, 0x6103, 0x9CB9, 0x6121, 0x9CBA, 0x60FB, 0x9CBB, 0x60F1, 0x9CBC, 0x610D, + 0x9CBD, 0x610E, 0x9CBE, 0x6147, 0x9CBF, 0x613E, 0x9CC0, 0x6128, 0x9CC1, 0x6127, 0x9CC2, 0x614A, 0x9CC3, 0x613F, 0x9CC4, 0x613C, + 0x9CC5, 0x612C, 0x9CC6, 0x6134, 0x9CC7, 0x613D, 0x9CC8, 0x6142, 0x9CC9, 0x6144, 0x9CCA, 0x6173, 0x9CCB, 0x6177, 0x9CCC, 0x6158, + 0x9CCD, 0x6159, 0x9CCE, 0x615A, 0x9CCF, 0x616B, 0x9CD0, 0x6174, 0x9CD1, 0x616F, 0x9CD2, 0x6165, 0x9CD3, 0x6171, 0x9CD4, 0x615F, + 0x9CD5, 0x615D, 0x9CD6, 0x6153, 0x9CD7, 0x6175, 0x9CD8, 0x6199, 0x9CD9, 0x6196, 0x9CDA, 0x6187, 0x9CDB, 0x61AC, 0x9CDC, 0x6194, + 0x9CDD, 0x619A, 0x9CDE, 0x618A, 0x9CDF, 0x6191, 0x9CE0, 0x61AB, 0x9CE1, 0x61AE, 0x9CE2, 0x61CC, 0x9CE3, 0x61CA, 0x9CE4, 0x61C9, + 0x9CE5, 0x61F7, 0x9CE6, 0x61C8, 0x9CE7, 0x61C3, 0x9CE8, 0x61C6, 0x9CE9, 0x61BA, 0x9CEA, 0x61CB, 0x9CEB, 0x7F79, 0x9CEC, 0x61CD, + 0x9CED, 0x61E6, 0x9CEE, 0x61E3, 0x9CEF, 0x61F6, 0x9CF0, 0x61FA, 0x9CF1, 0x61F4, 0x9CF2, 0x61FF, 0x9CF3, 0x61FD, 0x9CF4, 0x61FC, + 0x9CF5, 0x61FE, 0x9CF6, 0x6200, 0x9CF7, 0x6208, 0x9CF8, 0x6209, 0x9CF9, 0x620D, 0x9CFA, 0x620C, 0x9CFB, 0x6214, 0x9CFC, 0x621B, + 0x9D40, 0x621E, 0x9D41, 0x6221, 0x9D42, 0x622A, 0x9D43, 0x622E, 0x9D44, 0x6230, 0x9D45, 0x6232, 0x9D46, 0x6233, 0x9D47, 0x6241, + 0x9D48, 0x624E, 0x9D49, 0x625E, 0x9D4A, 0x6263, 0x9D4B, 0x625B, 0x9D4C, 0x6260, 0x9D4D, 0x6268, 0x9D4E, 0x627C, 0x9D4F, 0x6282, + 0x9D50, 0x6289, 0x9D51, 0x627E, 0x9D52, 0x6292, 0x9D53, 0x6293, 0x9D54, 0x6296, 0x9D55, 0x62D4, 0x9D56, 0x6283, 0x9D57, 0x6294, + 0x9D58, 0x62D7, 0x9D59, 0x62D1, 0x9D5A, 0x62BB, 0x9D5B, 0x62CF, 0x9D5C, 0x62FF, 0x9D5D, 0x62C6, 0x9D5E, 0x64D4, 0x9D5F, 0x62C8, + 0x9D60, 0x62DC, 0x9D61, 0x62CC, 0x9D62, 0x62CA, 0x9D63, 0x62C2, 0x9D64, 0x62C7, 0x9D65, 0x629B, 0x9D66, 0x62C9, 0x9D67, 0x630C, + 0x9D68, 0x62EE, 0x9D69, 0x62F1, 0x9D6A, 0x6327, 0x9D6B, 0x6302, 0x9D6C, 0x6308, 0x9D6D, 0x62EF, 0x9D6E, 0x62F5, 0x9D6F, 0x6350, + 0x9D70, 0x633E, 0x9D71, 0x634D, 0x9D72, 0x641C, 0x9D73, 0x634F, 0x9D74, 0x6396, 0x9D75, 0x638E, 0x9D76, 0x6380, 0x9D77, 0x63AB, + 0x9D78, 0x6376, 0x9D79, 0x63A3, 0x9D7A, 0x638F, 0x9D7B, 0x6389, 0x9D7C, 0x639F, 0x9D7D, 0x63B5, 0x9D7E, 0x636B, 0x9D80, 0x6369, + 0x9D81, 0x63BE, 0x9D82, 0x63E9, 0x9D83, 0x63C0, 0x9D84, 0x63C6, 0x9D85, 0x63E3, 0x9D86, 0x63C9, 0x9D87, 0x63D2, 0x9D88, 0x63F6, + 0x9D89, 0x63C4, 0x9D8A, 0x6416, 0x9D8B, 0x6434, 0x9D8C, 0x6406, 0x9D8D, 0x6413, 0x9D8E, 0x6426, 0x9D8F, 0x6436, 0x9D90, 0x651D, + 0x9D91, 0x6417, 0x9D92, 0x6428, 0x9D93, 0x640F, 0x9D94, 0x6467, 0x9D95, 0x646F, 0x9D96, 0x6476, 0x9D97, 0x644E, 0x9D98, 0x652A, + 0x9D99, 0x6495, 0x9D9A, 0x6493, 0x9D9B, 0x64A5, 0x9D9C, 0x64A9, 0x9D9D, 0x6488, 0x9D9E, 0x64BC, 0x9D9F, 0x64DA, 0x9DA0, 0x64D2, + 0x9DA1, 0x64C5, 0x9DA2, 0x64C7, 0x9DA3, 0x64BB, 0x9DA4, 0x64D8, 0x9DA5, 0x64C2, 0x9DA6, 0x64F1, 0x9DA7, 0x64E7, 0x9DA8, 0x8209, + 0x9DA9, 0x64E0, 0x9DAA, 0x64E1, 0x9DAB, 0x62AC, 0x9DAC, 0x64E3, 0x9DAD, 0x64EF, 0x9DAE, 0x652C, 0x9DAF, 0x64F6, 0x9DB0, 0x64F4, + 0x9DB1, 0x64F2, 0x9DB2, 0x64FA, 0x9DB3, 0x6500, 0x9DB4, 0x64FD, 0x9DB5, 0x6518, 0x9DB6, 0x651C, 0x9DB7, 0x6505, 0x9DB8, 0x6524, + 0x9DB9, 0x6523, 0x9DBA, 0x652B, 0x9DBB, 0x6534, 0x9DBC, 0x6535, 0x9DBD, 0x6537, 0x9DBE, 0x6536, 0x9DBF, 0x6538, 0x9DC0, 0x754B, + 0x9DC1, 0x6548, 0x9DC2, 0x6556, 0x9DC3, 0x6555, 0x9DC4, 0x654D, 0x9DC5, 0x6558, 0x9DC6, 0x655E, 0x9DC7, 0x655D, 0x9DC8, 0x6572, + 0x9DC9, 0x6578, 0x9DCA, 0x6582, 0x9DCB, 0x6583, 0x9DCC, 0x8B8A, 0x9DCD, 0x659B, 0x9DCE, 0x659F, 0x9DCF, 0x65AB, 0x9DD0, 0x65B7, + 0x9DD1, 0x65C3, 0x9DD2, 0x65C6, 0x9DD3, 0x65C1, 0x9DD4, 0x65C4, 0x9DD5, 0x65CC, 0x9DD6, 0x65D2, 0x9DD7, 0x65DB, 0x9DD8, 0x65D9, + 0x9DD9, 0x65E0, 0x9DDA, 0x65E1, 0x9DDB, 0x65F1, 0x9DDC, 0x6772, 0x9DDD, 0x660A, 0x9DDE, 0x6603, 0x9DDF, 0x65FB, 0x9DE0, 0x6773, + 0x9DE1, 0x6635, 0x9DE2, 0x6636, 0x9DE3, 0x6634, 0x9DE4, 0x661C, 0x9DE5, 0x664F, 0x9DE6, 0x6644, 0x9DE7, 0x6649, 0x9DE8, 0x6641, + 0x9DE9, 0x665E, 0x9DEA, 0x665D, 0x9DEB, 0x6664, 0x9DEC, 0x6667, 0x9DED, 0x6668, 0x9DEE, 0x665F, 0x9DEF, 0x6662, 0x9DF0, 0x6670, + 0x9DF1, 0x6683, 0x9DF2, 0x6688, 0x9DF3, 0x668E, 0x9DF4, 0x6689, 0x9DF5, 0x6684, 0x9DF6, 0x6698, 0x9DF7, 0x669D, 0x9DF8, 0x66C1, + 0x9DF9, 0x66B9, 0x9DFA, 0x66C9, 0x9DFB, 0x66BE, 0x9DFC, 0x66BC, 0x9E40, 0x66C4, 0x9E41, 0x66B8, 0x9E42, 0x66D6, 0x9E43, 0x66DA, + 0x9E44, 0x66E0, 0x9E45, 0x663F, 0x9E46, 0x66E6, 0x9E47, 0x66E9, 0x9E48, 0x66F0, 0x9E49, 0x66F5, 0x9E4A, 0x66F7, 0x9E4B, 0x670F, + 0x9E4C, 0x6716, 0x9E4D, 0x671E, 0x9E4E, 0x6726, 0x9E4F, 0x6727, 0x9E50, 0x9738, 0x9E51, 0x672E, 0x9E52, 0x673F, 0x9E53, 0x6736, + 0x9E54, 0x6741, 0x9E55, 0x6738, 0x9E56, 0x6737, 0x9E57, 0x6746, 0x9E58, 0x675E, 0x9E59, 0x6760, 0x9E5A, 0x6759, 0x9E5B, 0x6763, + 0x9E5C, 0x6764, 0x9E5D, 0x6789, 0x9E5E, 0x6770, 0x9E5F, 0x67A9, 0x9E60, 0x677C, 0x9E61, 0x676A, 0x9E62, 0x678C, 0x9E63, 0x678B, + 0x9E64, 0x67A6, 0x9E65, 0x67A1, 0x9E66, 0x6785, 0x9E67, 0x67B7, 0x9E68, 0x67EF, 0x9E69, 0x67B4, 0x9E6A, 0x67EC, 0x9E6B, 0x67B3, + 0x9E6C, 0x67E9, 0x9E6D, 0x67B8, 0x9E6E, 0x67E4, 0x9E6F, 0x67DE, 0x9E70, 0x67DD, 0x9E71, 0x67E2, 0x9E72, 0x67EE, 0x9E73, 0x67B9, + 0x9E74, 0x67CE, 0x9E75, 0x67C6, 0x9E76, 0x67E7, 0x9E77, 0x6A9C, 0x9E78, 0x681E, 0x9E79, 0x6846, 0x9E7A, 0x6829, 0x9E7B, 0x6840, + 0x9E7C, 0x684D, 0x9E7D, 0x6832, 0x9E7E, 0x684E, 0x9E80, 0x68B3, 0x9E81, 0x682B, 0x9E82, 0x6859, 0x9E83, 0x6863, 0x9E84, 0x6877, + 0x9E85, 0x687F, 0x9E86, 0x689F, 0x9E87, 0x688F, 0x9E88, 0x68AD, 0x9E89, 0x6894, 0x9E8A, 0x689D, 0x9E8B, 0x689B, 0x9E8C, 0x6883, + 0x9E8D, 0x6AAE, 0x9E8E, 0x68B9, 0x9E8F, 0x6874, 0x9E90, 0x68B5, 0x9E91, 0x68A0, 0x9E92, 0x68BA, 0x9E93, 0x690F, 0x9E94, 0x688D, + 0x9E95, 0x687E, 0x9E96, 0x6901, 0x9E97, 0x68CA, 0x9E98, 0x6908, 0x9E99, 0x68D8, 0x9E9A, 0x6922, 0x9E9B, 0x6926, 0x9E9C, 0x68E1, + 0x9E9D, 0x690C, 0x9E9E, 0x68CD, 0x9E9F, 0x68D4, 0x9EA0, 0x68E7, 0x9EA1, 0x68D5, 0x9EA2, 0x6936, 0x9EA3, 0x6912, 0x9EA4, 0x6904, + 0x9EA5, 0x68D7, 0x9EA6, 0x68E3, 0x9EA7, 0x6925, 0x9EA8, 0x68F9, 0x9EA9, 0x68E0, 0x9EAA, 0x68EF, 0x9EAB, 0x6928, 0x9EAC, 0x692A, + 0x9EAD, 0x691A, 0x9EAE, 0x6923, 0x9EAF, 0x6921, 0x9EB0, 0x68C6, 0x9EB1, 0x6979, 0x9EB2, 0x6977, 0x9EB3, 0x695C, 0x9EB4, 0x6978, + 0x9EB5, 0x696B, 0x9EB6, 0x6954, 0x9EB7, 0x697E, 0x9EB8, 0x696E, 0x9EB9, 0x6939, 0x9EBA, 0x6974, 0x9EBB, 0x693D, 0x9EBC, 0x6959, + 0x9EBD, 0x6930, 0x9EBE, 0x6961, 0x9EBF, 0x695E, 0x9EC0, 0x695D, 0x9EC1, 0x6981, 0x9EC2, 0x696A, 0x9EC3, 0x69B2, 0x9EC4, 0x69AE, + 0x9EC5, 0x69D0, 0x9EC6, 0x69BF, 0x9EC7, 0x69C1, 0x9EC8, 0x69D3, 0x9EC9, 0x69BE, 0x9ECA, 0x69CE, 0x9ECB, 0x5BE8, 0x9ECC, 0x69CA, + 0x9ECD, 0x69DD, 0x9ECE, 0x69BB, 0x9ECF, 0x69C3, 0x9ED0, 0x69A7, 0x9ED1, 0x6A2E, 0x9ED2, 0x6991, 0x9ED3, 0x69A0, 0x9ED4, 0x699C, + 0x9ED5, 0x6995, 0x9ED6, 0x69B4, 0x9ED7, 0x69DE, 0x9ED8, 0x69E8, 0x9ED9, 0x6A02, 0x9EDA, 0x6A1B, 0x9EDB, 0x69FF, 0x9EDC, 0x6B0A, + 0x9EDD, 0x69F9, 0x9EDE, 0x69F2, 0x9EDF, 0x69E7, 0x9EE0, 0x6A05, 0x9EE1, 0x69B1, 0x9EE2, 0x6A1E, 0x9EE3, 0x69ED, 0x9EE4, 0x6A14, + 0x9EE5, 0x69EB, 0x9EE6, 0x6A0A, 0x9EE7, 0x6A12, 0x9EE8, 0x6AC1, 0x9EE9, 0x6A23, 0x9EEA, 0x6A13, 0x9EEB, 0x6A44, 0x9EEC, 0x6A0C, + 0x9EED, 0x6A72, 0x9EEE, 0x6A36, 0x9EEF, 0x6A78, 0x9EF0, 0x6A47, 0x9EF1, 0x6A62, 0x9EF2, 0x6A59, 0x9EF3, 0x6A66, 0x9EF4, 0x6A48, + 0x9EF5, 0x6A38, 0x9EF6, 0x6A22, 0x9EF7, 0x6A90, 0x9EF8, 0x6A8D, 0x9EF9, 0x6AA0, 0x9EFA, 0x6A84, 0x9EFB, 0x6AA2, 0x9EFC, 0x6AA3, + 0x9F40, 0x6A97, 0x9F41, 0x8617, 0x9F42, 0x6ABB, 0x9F43, 0x6AC3, 0x9F44, 0x6AC2, 0x9F45, 0x6AB8, 0x9F46, 0x6AB3, 0x9F47, 0x6AAC, + 0x9F48, 0x6ADE, 0x9F49, 0x6AD1, 0x9F4A, 0x6ADF, 0x9F4B, 0x6AAA, 0x9F4C, 0x6ADA, 0x9F4D, 0x6AEA, 0x9F4E, 0x6AFB, 0x9F4F, 0x6B05, + 0x9F50, 0x8616, 0x9F51, 0x6AFA, 0x9F52, 0x6B12, 0x9F53, 0x6B16, 0x9F54, 0x9B31, 0x9F55, 0x6B1F, 0x9F56, 0x6B38, 0x9F57, 0x6B37, + 0x9F58, 0x76DC, 0x9F59, 0x6B39, 0x9F5A, 0x98EE, 0x9F5B, 0x6B47, 0x9F5C, 0x6B43, 0x9F5D, 0x6B49, 0x9F5E, 0x6B50, 0x9F5F, 0x6B59, + 0x9F60, 0x6B54, 0x9F61, 0x6B5B, 0x9F62, 0x6B5F, 0x9F63, 0x6B61, 0x9F64, 0x6B78, 0x9F65, 0x6B79, 0x9F66, 0x6B7F, 0x9F67, 0x6B80, + 0x9F68, 0x6B84, 0x9F69, 0x6B83, 0x9F6A, 0x6B8D, 0x9F6B, 0x6B98, 0x9F6C, 0x6B95, 0x9F6D, 0x6B9E, 0x9F6E, 0x6BA4, 0x9F6F, 0x6BAA, + 0x9F70, 0x6BAB, 0x9F71, 0x6BAF, 0x9F72, 0x6BB2, 0x9F73, 0x6BB1, 0x9F74, 0x6BB3, 0x9F75, 0x6BB7, 0x9F76, 0x6BBC, 0x9F77, 0x6BC6, + 0x9F78, 0x6BCB, 0x9F79, 0x6BD3, 0x9F7A, 0x6BDF, 0x9F7B, 0x6BEC, 0x9F7C, 0x6BEB, 0x9F7D, 0x6BF3, 0x9F7E, 0x6BEF, 0x9F80, 0x9EBE, + 0x9F81, 0x6C08, 0x9F82, 0x6C13, 0x9F83, 0x6C14, 0x9F84, 0x6C1B, 0x9F85, 0x6C24, 0x9F86, 0x6C23, 0x9F87, 0x6C5E, 0x9F88, 0x6C55, + 0x9F89, 0x6C62, 0x9F8A, 0x6C6A, 0x9F8B, 0x6C82, 0x9F8C, 0x6C8D, 0x9F8D, 0x6C9A, 0x9F8E, 0x6C81, 0x9F8F, 0x6C9B, 0x9F90, 0x6C7E, + 0x9F91, 0x6C68, 0x9F92, 0x6C73, 0x9F93, 0x6C92, 0x9F94, 0x6C90, 0x9F95, 0x6CC4, 0x9F96, 0x6CF1, 0x9F97, 0x6CD3, 0x9F98, 0x6CBD, + 0x9F99, 0x6CD7, 0x9F9A, 0x6CC5, 0x9F9B, 0x6CDD, 0x9F9C, 0x6CAE, 0x9F9D, 0x6CB1, 0x9F9E, 0x6CBE, 0x9F9F, 0x6CBA, 0x9FA0, 0x6CDB, + 0x9FA1, 0x6CEF, 0x9FA2, 0x6CD9, 0x9FA3, 0x6CEA, 0x9FA4, 0x6D1F, 0x9FA5, 0x884D, 0x9FA6, 0x6D36, 0x9FA7, 0x6D2B, 0x9FA8, 0x6D3D, + 0x9FA9, 0x6D38, 0x9FAA, 0x6D19, 0x9FAB, 0x6D35, 0x9FAC, 0x6D33, 0x9FAD, 0x6D12, 0x9FAE, 0x6D0C, 0x9FAF, 0x6D63, 0x9FB0, 0x6D93, + 0x9FB1, 0x6D64, 0x9FB2, 0x6D5A, 0x9FB3, 0x6D79, 0x9FB4, 0x6D59, 0x9FB5, 0x6D8E, 0x9FB6, 0x6D95, 0x9FB7, 0x6FE4, 0x9FB8, 0x6D85, + 0x9FB9, 0x6DF9, 0x9FBA, 0x6E15, 0x9FBB, 0x6E0A, 0x9FBC, 0x6DB5, 0x9FBD, 0x6DC7, 0x9FBE, 0x6DE6, 0x9FBF, 0x6DB8, 0x9FC0, 0x6DC6, + 0x9FC1, 0x6DEC, 0x9FC2, 0x6DDE, 0x9FC3, 0x6DCC, 0x9FC4, 0x6DE8, 0x9FC5, 0x6DD2, 0x9FC6, 0x6DC5, 0x9FC7, 0x6DFA, 0x9FC8, 0x6DD9, + 0x9FC9, 0x6DE4, 0x9FCA, 0x6DD5, 0x9FCB, 0x6DEA, 0x9FCC, 0x6DEE, 0x9FCD, 0x6E2D, 0x9FCE, 0x6E6E, 0x9FCF, 0x6E2E, 0x9FD0, 0x6E19, + 0x9FD1, 0x6E72, 0x9FD2, 0x6E5F, 0x9FD3, 0x6E3E, 0x9FD4, 0x6E23, 0x9FD5, 0x6E6B, 0x9FD6, 0x6E2B, 0x9FD7, 0x6E76, 0x9FD8, 0x6E4D, + 0x9FD9, 0x6E1F, 0x9FDA, 0x6E43, 0x9FDB, 0x6E3A, 0x9FDC, 0x6E4E, 0x9FDD, 0x6E24, 0x9FDE, 0x6EFF, 0x9FDF, 0x6E1D, 0x9FE0, 0x6E38, + 0x9FE1, 0x6E82, 0x9FE2, 0x6EAA, 0x9FE3, 0x6E98, 0x9FE4, 0x6EC9, 0x9FE5, 0x6EB7, 0x9FE6, 0x6ED3, 0x9FE7, 0x6EBD, 0x9FE8, 0x6EAF, + 0x9FE9, 0x6EC4, 0x9FEA, 0x6EB2, 0x9FEB, 0x6ED4, 0x9FEC, 0x6ED5, 0x9FED, 0x6E8F, 0x9FEE, 0x6EA5, 0x9FEF, 0x6EC2, 0x9FF0, 0x6E9F, + 0x9FF1, 0x6F41, 0x9FF2, 0x6F11, 0x9FF3, 0x704C, 0x9FF4, 0x6EEC, 0x9FF5, 0x6EF8, 0x9FF6, 0x6EFE, 0x9FF7, 0x6F3F, 0x9FF8, 0x6EF2, + 0x9FF9, 0x6F31, 0x9FFA, 0x6EEF, 0x9FFB, 0x6F32, 0x9FFC, 0x6ECC, 0xE040, 0x6F3E, 0xE041, 0x6F13, 0xE042, 0x6EF7, 0xE043, 0x6F86, + 0xE044, 0x6F7A, 0xE045, 0x6F78, 0xE046, 0x6F81, 0xE047, 0x6F80, 0xE048, 0x6F6F, 0xE049, 0x6F5B, 0xE04A, 0x6FF3, 0xE04B, 0x6F6D, + 0xE04C, 0x6F82, 0xE04D, 0x6F7C, 0xE04E, 0x6F58, 0xE04F, 0x6F8E, 0xE050, 0x6F91, 0xE051, 0x6FC2, 0xE052, 0x6F66, 0xE053, 0x6FB3, + 0xE054, 0x6FA3, 0xE055, 0x6FA1, 0xE056, 0x6FA4, 0xE057, 0x6FB9, 0xE058, 0x6FC6, 0xE059, 0x6FAA, 0xE05A, 0x6FDF, 0xE05B, 0x6FD5, + 0xE05C, 0x6FEC, 0xE05D, 0x6FD4, 0xE05E, 0x6FD8, 0xE05F, 0x6FF1, 0xE060, 0x6FEE, 0xE061, 0x6FDB, 0xE062, 0x7009, 0xE063, 0x700B, + 0xE064, 0x6FFA, 0xE065, 0x7011, 0xE066, 0x7001, 0xE067, 0x700F, 0xE068, 0x6FFE, 0xE069, 0x701B, 0xE06A, 0x701A, 0xE06B, 0x6F74, + 0xE06C, 0x701D, 0xE06D, 0x7018, 0xE06E, 0x701F, 0xE06F, 0x7030, 0xE070, 0x703E, 0xE071, 0x7032, 0xE072, 0x7051, 0xE073, 0x7063, + 0xE074, 0x7099, 0xE075, 0x7092, 0xE076, 0x70AF, 0xE077, 0x70F1, 0xE078, 0x70AC, 0xE079, 0x70B8, 0xE07A, 0x70B3, 0xE07B, 0x70AE, + 0xE07C, 0x70DF, 0xE07D, 0x70CB, 0xE07E, 0x70DD, 0xE080, 0x70D9, 0xE081, 0x7109, 0xE082, 0x70FD, 0xE083, 0x711C, 0xE084, 0x7119, + 0xE085, 0x7165, 0xE086, 0x7155, 0xE087, 0x7188, 0xE088, 0x7166, 0xE089, 0x7162, 0xE08A, 0x714C, 0xE08B, 0x7156, 0xE08C, 0x716C, + 0xE08D, 0x718F, 0xE08E, 0x71FB, 0xE08F, 0x7184, 0xE090, 0x7195, 0xE091, 0x71A8, 0xE092, 0x71AC, 0xE093, 0x71D7, 0xE094, 0x71B9, + 0xE095, 0x71BE, 0xE096, 0x71D2, 0xE097, 0x71C9, 0xE098, 0x71D4, 0xE099, 0x71CE, 0xE09A, 0x71E0, 0xE09B, 0x71EC, 0xE09C, 0x71E7, + 0xE09D, 0x71F5, 0xE09E, 0x71FC, 0xE09F, 0x71F9, 0xE0A0, 0x71FF, 0xE0A1, 0x720D, 0xE0A2, 0x7210, 0xE0A3, 0x721B, 0xE0A4, 0x7228, + 0xE0A5, 0x722D, 0xE0A6, 0x722C, 0xE0A7, 0x7230, 0xE0A8, 0x7232, 0xE0A9, 0x723B, 0xE0AA, 0x723C, 0xE0AB, 0x723F, 0xE0AC, 0x7240, + 0xE0AD, 0x7246, 0xE0AE, 0x724B, 0xE0AF, 0x7258, 0xE0B0, 0x7274, 0xE0B1, 0x727E, 0xE0B2, 0x7282, 0xE0B3, 0x7281, 0xE0B4, 0x7287, + 0xE0B5, 0x7292, 0xE0B6, 0x7296, 0xE0B7, 0x72A2, 0xE0B8, 0x72A7, 0xE0B9, 0x72B9, 0xE0BA, 0x72B2, 0xE0BB, 0x72C3, 0xE0BC, 0x72C6, + 0xE0BD, 0x72C4, 0xE0BE, 0x72CE, 0xE0BF, 0x72D2, 0xE0C0, 0x72E2, 0xE0C1, 0x72E0, 0xE0C2, 0x72E1, 0xE0C3, 0x72F9, 0xE0C4, 0x72F7, + 0xE0C5, 0x500F, 0xE0C6, 0x7317, 0xE0C7, 0x730A, 0xE0C8, 0x731C, 0xE0C9, 0x7316, 0xE0CA, 0x731D, 0xE0CB, 0x7334, 0xE0CC, 0x732F, + 0xE0CD, 0x7329, 0xE0CE, 0x7325, 0xE0CF, 0x733E, 0xE0D0, 0x734E, 0xE0D1, 0x734F, 0xE0D2, 0x9ED8, 0xE0D3, 0x7357, 0xE0D4, 0x736A, + 0xE0D5, 0x7368, 0xE0D6, 0x7370, 0xE0D7, 0x7378, 0xE0D8, 0x7375, 0xE0D9, 0x737B, 0xE0DA, 0x737A, 0xE0DB, 0x73C8, 0xE0DC, 0x73B3, + 0xE0DD, 0x73CE, 0xE0DE, 0x73BB, 0xE0DF, 0x73C0, 0xE0E0, 0x73E5, 0xE0E1, 0x73EE, 0xE0E2, 0x73DE, 0xE0E3, 0x74A2, 0xE0E4, 0x7405, + 0xE0E5, 0x746F, 0xE0E6, 0x7425, 0xE0E7, 0x73F8, 0xE0E8, 0x7432, 0xE0E9, 0x743A, 0xE0EA, 0x7455, 0xE0EB, 0x743F, 0xE0EC, 0x745F, + 0xE0ED, 0x7459, 0xE0EE, 0x7441, 0xE0EF, 0x745C, 0xE0F0, 0x7469, 0xE0F1, 0x7470, 0xE0F2, 0x7463, 0xE0F3, 0x746A, 0xE0F4, 0x7476, + 0xE0F5, 0x747E, 0xE0F6, 0x748B, 0xE0F7, 0x749E, 0xE0F8, 0x74A7, 0xE0F9, 0x74CA, 0xE0FA, 0x74CF, 0xE0FB, 0x74D4, 0xE0FC, 0x73F1, + 0xE140, 0x74E0, 0xE141, 0x74E3, 0xE142, 0x74E7, 0xE143, 0x74E9, 0xE144, 0x74EE, 0xE145, 0x74F2, 0xE146, 0x74F0, 0xE147, 0x74F1, + 0xE148, 0x74F8, 0xE149, 0x74F7, 0xE14A, 0x7504, 0xE14B, 0x7503, 0xE14C, 0x7505, 0xE14D, 0x750C, 0xE14E, 0x750E, 0xE14F, 0x750D, + 0xE150, 0x7515, 0xE151, 0x7513, 0xE152, 0x751E, 0xE153, 0x7526, 0xE154, 0x752C, 0xE155, 0x753C, 0xE156, 0x7544, 0xE157, 0x754D, + 0xE158, 0x754A, 0xE159, 0x7549, 0xE15A, 0x755B, 0xE15B, 0x7546, 0xE15C, 0x755A, 0xE15D, 0x7569, 0xE15E, 0x7564, 0xE15F, 0x7567, + 0xE160, 0x756B, 0xE161, 0x756D, 0xE162, 0x7578, 0xE163, 0x7576, 0xE164, 0x7586, 0xE165, 0x7587, 0xE166, 0x7574, 0xE167, 0x758A, + 0xE168, 0x7589, 0xE169, 0x7582, 0xE16A, 0x7594, 0xE16B, 0x759A, 0xE16C, 0x759D, 0xE16D, 0x75A5, 0xE16E, 0x75A3, 0xE16F, 0x75C2, + 0xE170, 0x75B3, 0xE171, 0x75C3, 0xE172, 0x75B5, 0xE173, 0x75BD, 0xE174, 0x75B8, 0xE175, 0x75BC, 0xE176, 0x75B1, 0xE177, 0x75CD, + 0xE178, 0x75CA, 0xE179, 0x75D2, 0xE17A, 0x75D9, 0xE17B, 0x75E3, 0xE17C, 0x75DE, 0xE17D, 0x75FE, 0xE17E, 0x75FF, 0xE180, 0x75FC, + 0xE181, 0x7601, 0xE182, 0x75F0, 0xE183, 0x75FA, 0xE184, 0x75F2, 0xE185, 0x75F3, 0xE186, 0x760B, 0xE187, 0x760D, 0xE188, 0x7609, + 0xE189, 0x761F, 0xE18A, 0x7627, 0xE18B, 0x7620, 0xE18C, 0x7621, 0xE18D, 0x7622, 0xE18E, 0x7624, 0xE18F, 0x7634, 0xE190, 0x7630, + 0xE191, 0x763B, 0xE192, 0x7647, 0xE193, 0x7648, 0xE194, 0x7646, 0xE195, 0x765C, 0xE196, 0x7658, 0xE197, 0x7661, 0xE198, 0x7662, + 0xE199, 0x7668, 0xE19A, 0x7669, 0xE19B, 0x766A, 0xE19C, 0x7667, 0xE19D, 0x766C, 0xE19E, 0x7670, 0xE19F, 0x7672, 0xE1A0, 0x7676, + 0xE1A1, 0x7678, 0xE1A2, 0x767C, 0xE1A3, 0x7680, 0xE1A4, 0x7683, 0xE1A5, 0x7688, 0xE1A6, 0x768B, 0xE1A7, 0x768E, 0xE1A8, 0x7696, + 0xE1A9, 0x7693, 0xE1AA, 0x7699, 0xE1AB, 0x769A, 0xE1AC, 0x76B0, 0xE1AD, 0x76B4, 0xE1AE, 0x76B8, 0xE1AF, 0x76B9, 0xE1B0, 0x76BA, + 0xE1B1, 0x76C2, 0xE1B2, 0x76CD, 0xE1B3, 0x76D6, 0xE1B4, 0x76D2, 0xE1B5, 0x76DE, 0xE1B6, 0x76E1, 0xE1B7, 0x76E5, 0xE1B8, 0x76E7, + 0xE1B9, 0x76EA, 0xE1BA, 0x862F, 0xE1BB, 0x76FB, 0xE1BC, 0x7708, 0xE1BD, 0x7707, 0xE1BE, 0x7704, 0xE1BF, 0x7729, 0xE1C0, 0x7724, + 0xE1C1, 0x771E, 0xE1C2, 0x7725, 0xE1C3, 0x7726, 0xE1C4, 0x771B, 0xE1C5, 0x7737, 0xE1C6, 0x7738, 0xE1C7, 0x7747, 0xE1C8, 0x775A, + 0xE1C9, 0x7768, 0xE1CA, 0x776B, 0xE1CB, 0x775B, 0xE1CC, 0x7765, 0xE1CD, 0x777F, 0xE1CE, 0x777E, 0xE1CF, 0x7779, 0xE1D0, 0x778E, + 0xE1D1, 0x778B, 0xE1D2, 0x7791, 0xE1D3, 0x77A0, 0xE1D4, 0x779E, 0xE1D5, 0x77B0, 0xE1D6, 0x77B6, 0xE1D7, 0x77B9, 0xE1D8, 0x77BF, + 0xE1D9, 0x77BC, 0xE1DA, 0x77BD, 0xE1DB, 0x77BB, 0xE1DC, 0x77C7, 0xE1DD, 0x77CD, 0xE1DE, 0x77D7, 0xE1DF, 0x77DA, 0xE1E0, 0x77DC, + 0xE1E1, 0x77E3, 0xE1E2, 0x77EE, 0xE1E3, 0x77FC, 0xE1E4, 0x780C, 0xE1E5, 0x7812, 0xE1E6, 0x7926, 0xE1E7, 0x7820, 0xE1E8, 0x792A, + 0xE1E9, 0x7845, 0xE1EA, 0x788E, 0xE1EB, 0x7874, 0xE1EC, 0x7886, 0xE1ED, 0x787C, 0xE1EE, 0x789A, 0xE1EF, 0x788C, 0xE1F0, 0x78A3, + 0xE1F1, 0x78B5, 0xE1F2, 0x78AA, 0xE1F3, 0x78AF, 0xE1F4, 0x78D1, 0xE1F5, 0x78C6, 0xE1F6, 0x78CB, 0xE1F7, 0x78D4, 0xE1F8, 0x78BE, + 0xE1F9, 0x78BC, 0xE1FA, 0x78C5, 0xE1FB, 0x78CA, 0xE1FC, 0x78EC, 0xE240, 0x78E7, 0xE241, 0x78DA, 0xE242, 0x78FD, 0xE243, 0x78F4, + 0xE244, 0x7907, 0xE245, 0x7912, 0xE246, 0x7911, 0xE247, 0x7919, 0xE248, 0x792C, 0xE249, 0x792B, 0xE24A, 0x7940, 0xE24B, 0x7960, + 0xE24C, 0x7957, 0xE24D, 0x795F, 0xE24E, 0x795A, 0xE24F, 0x7955, 0xE250, 0x7953, 0xE251, 0x797A, 0xE252, 0x797F, 0xE253, 0x798A, + 0xE254, 0x799D, 0xE255, 0x79A7, 0xE256, 0x9F4B, 0xE257, 0x79AA, 0xE258, 0x79AE, 0xE259, 0x79B3, 0xE25A, 0x79B9, 0xE25B, 0x79BA, + 0xE25C, 0x79C9, 0xE25D, 0x79D5, 0xE25E, 0x79E7, 0xE25F, 0x79EC, 0xE260, 0x79E1, 0xE261, 0x79E3, 0xE262, 0x7A08, 0xE263, 0x7A0D, + 0xE264, 0x7A18, 0xE265, 0x7A19, 0xE266, 0x7A20, 0xE267, 0x7A1F, 0xE268, 0x7980, 0xE269, 0x7A31, 0xE26A, 0x7A3B, 0xE26B, 0x7A3E, + 0xE26C, 0x7A37, 0xE26D, 0x7A43, 0xE26E, 0x7A57, 0xE26F, 0x7A49, 0xE270, 0x7A61, 0xE271, 0x7A62, 0xE272, 0x7A69, 0xE273, 0x9F9D, + 0xE274, 0x7A70, 0xE275, 0x7A79, 0xE276, 0x7A7D, 0xE277, 0x7A88, 0xE278, 0x7A97, 0xE279, 0x7A95, 0xE27A, 0x7A98, 0xE27B, 0x7A96, + 0xE27C, 0x7AA9, 0xE27D, 0x7AC8, 0xE27E, 0x7AB0, 0xE280, 0x7AB6, 0xE281, 0x7AC5, 0xE282, 0x7AC4, 0xE283, 0x7ABF, 0xE284, 0x9083, + 0xE285, 0x7AC7, 0xE286, 0x7ACA, 0xE287, 0x7ACD, 0xE288, 0x7ACF, 0xE289, 0x7AD5, 0xE28A, 0x7AD3, 0xE28B, 0x7AD9, 0xE28C, 0x7ADA, + 0xE28D, 0x7ADD, 0xE28E, 0x7AE1, 0xE28F, 0x7AE2, 0xE290, 0x7AE6, 0xE291, 0x7AED, 0xE292, 0x7AF0, 0xE293, 0x7B02, 0xE294, 0x7B0F, + 0xE295, 0x7B0A, 0xE296, 0x7B06, 0xE297, 0x7B33, 0xE298, 0x7B18, 0xE299, 0x7B19, 0xE29A, 0x7B1E, 0xE29B, 0x7B35, 0xE29C, 0x7B28, + 0xE29D, 0x7B36, 0xE29E, 0x7B50, 0xE29F, 0x7B7A, 0xE2A0, 0x7B04, 0xE2A1, 0x7B4D, 0xE2A2, 0x7B0B, 0xE2A3, 0x7B4C, 0xE2A4, 0x7B45, + 0xE2A5, 0x7B75, 0xE2A6, 0x7B65, 0xE2A7, 0x7B74, 0xE2A8, 0x7B67, 0xE2A9, 0x7B70, 0xE2AA, 0x7B71, 0xE2AB, 0x7B6C, 0xE2AC, 0x7B6E, + 0xE2AD, 0x7B9D, 0xE2AE, 0x7B98, 0xE2AF, 0x7B9F, 0xE2B0, 0x7B8D, 0xE2B1, 0x7B9C, 0xE2B2, 0x7B9A, 0xE2B3, 0x7B8B, 0xE2B4, 0x7B92, + 0xE2B5, 0x7B8F, 0xE2B6, 0x7B5D, 0xE2B7, 0x7B99, 0xE2B8, 0x7BCB, 0xE2B9, 0x7BC1, 0xE2BA, 0x7BCC, 0xE2BB, 0x7BCF, 0xE2BC, 0x7BB4, + 0xE2BD, 0x7BC6, 0xE2BE, 0x7BDD, 0xE2BF, 0x7BE9, 0xE2C0, 0x7C11, 0xE2C1, 0x7C14, 0xE2C2, 0x7BE6, 0xE2C3, 0x7BE5, 0xE2C4, 0x7C60, + 0xE2C5, 0x7C00, 0xE2C6, 0x7C07, 0xE2C7, 0x7C13, 0xE2C8, 0x7BF3, 0xE2C9, 0x7BF7, 0xE2CA, 0x7C17, 0xE2CB, 0x7C0D, 0xE2CC, 0x7BF6, + 0xE2CD, 0x7C23, 0xE2CE, 0x7C27, 0xE2CF, 0x7C2A, 0xE2D0, 0x7C1F, 0xE2D1, 0x7C37, 0xE2D2, 0x7C2B, 0xE2D3, 0x7C3D, 0xE2D4, 0x7C4C, + 0xE2D5, 0x7C43, 0xE2D6, 0x7C54, 0xE2D7, 0x7C4F, 0xE2D8, 0x7C40, 0xE2D9, 0x7C50, 0xE2DA, 0x7C58, 0xE2DB, 0x7C5F, 0xE2DC, 0x7C64, + 0xE2DD, 0x7C56, 0xE2DE, 0x7C65, 0xE2DF, 0x7C6C, 0xE2E0, 0x7C75, 0xE2E1, 0x7C83, 0xE2E2, 0x7C90, 0xE2E3, 0x7CA4, 0xE2E4, 0x7CAD, + 0xE2E5, 0x7CA2, 0xE2E6, 0x7CAB, 0xE2E7, 0x7CA1, 0xE2E8, 0x7CA8, 0xE2E9, 0x7CB3, 0xE2EA, 0x7CB2, 0xE2EB, 0x7CB1, 0xE2EC, 0x7CAE, + 0xE2ED, 0x7CB9, 0xE2EE, 0x7CBD, 0xE2EF, 0x7CC0, 0xE2F0, 0x7CC5, 0xE2F1, 0x7CC2, 0xE2F2, 0x7CD8, 0xE2F3, 0x7CD2, 0xE2F4, 0x7CDC, + 0xE2F5, 0x7CE2, 0xE2F6, 0x9B3B, 0xE2F7, 0x7CEF, 0xE2F8, 0x7CF2, 0xE2F9, 0x7CF4, 0xE2FA, 0x7CF6, 0xE2FB, 0x7CFA, 0xE2FC, 0x7D06, + 0xE340, 0x7D02, 0xE341, 0x7D1C, 0xE342, 0x7D15, 0xE343, 0x7D0A, 0xE344, 0x7D45, 0xE345, 0x7D4B, 0xE346, 0x7D2E, 0xE347, 0x7D32, + 0xE348, 0x7D3F, 0xE349, 0x7D35, 0xE34A, 0x7D46, 0xE34B, 0x7D73, 0xE34C, 0x7D56, 0xE34D, 0x7D4E, 0xE34E, 0x7D72, 0xE34F, 0x7D68, + 0xE350, 0x7D6E, 0xE351, 0x7D4F, 0xE352, 0x7D63, 0xE353, 0x7D93, 0xE354, 0x7D89, 0xE355, 0x7D5B, 0xE356, 0x7D8F, 0xE357, 0x7D7D, + 0xE358, 0x7D9B, 0xE359, 0x7DBA, 0xE35A, 0x7DAE, 0xE35B, 0x7DA3, 0xE35C, 0x7DB5, 0xE35D, 0x7DC7, 0xE35E, 0x7DBD, 0xE35F, 0x7DAB, + 0xE360, 0x7E3D, 0xE361, 0x7DA2, 0xE362, 0x7DAF, 0xE363, 0x7DDC, 0xE364, 0x7DB8, 0xE365, 0x7D9F, 0xE366, 0x7DB0, 0xE367, 0x7DD8, + 0xE368, 0x7DDD, 0xE369, 0x7DE4, 0xE36A, 0x7DDE, 0xE36B, 0x7DFB, 0xE36C, 0x7DF2, 0xE36D, 0x7DE1, 0xE36E, 0x7E05, 0xE36F, 0x7E0A, + 0xE370, 0x7E23, 0xE371, 0x7E21, 0xE372, 0x7E12, 0xE373, 0x7E31, 0xE374, 0x7E1F, 0xE375, 0x7E09, 0xE376, 0x7E0B, 0xE377, 0x7E22, + 0xE378, 0x7E46, 0xE379, 0x7E66, 0xE37A, 0x7E3B, 0xE37B, 0x7E35, 0xE37C, 0x7E39, 0xE37D, 0x7E43, 0xE37E, 0x7E37, 0xE380, 0x7E32, + 0xE381, 0x7E3A, 0xE382, 0x7E67, 0xE383, 0x7E5D, 0xE384, 0x7E56, 0xE385, 0x7E5E, 0xE386, 0x7E59, 0xE387, 0x7E5A, 0xE388, 0x7E79, + 0xE389, 0x7E6A, 0xE38A, 0x7E69, 0xE38B, 0x7E7C, 0xE38C, 0x7E7B, 0xE38D, 0x7E83, 0xE38E, 0x7DD5, 0xE38F, 0x7E7D, 0xE390, 0x8FAE, + 0xE391, 0x7E7F, 0xE392, 0x7E88, 0xE393, 0x7E89, 0xE394, 0x7E8C, 0xE395, 0x7E92, 0xE396, 0x7E90, 0xE397, 0x7E93, 0xE398, 0x7E94, + 0xE399, 0x7E96, 0xE39A, 0x7E8E, 0xE39B, 0x7E9B, 0xE39C, 0x7E9C, 0xE39D, 0x7F38, 0xE39E, 0x7F3A, 0xE39F, 0x7F45, 0xE3A0, 0x7F4C, + 0xE3A1, 0x7F4D, 0xE3A2, 0x7F4E, 0xE3A3, 0x7F50, 0xE3A4, 0x7F51, 0xE3A5, 0x7F55, 0xE3A6, 0x7F54, 0xE3A7, 0x7F58, 0xE3A8, 0x7F5F, + 0xE3A9, 0x7F60, 0xE3AA, 0x7F68, 0xE3AB, 0x7F69, 0xE3AC, 0x7F67, 0xE3AD, 0x7F78, 0xE3AE, 0x7F82, 0xE3AF, 0x7F86, 0xE3B0, 0x7F83, + 0xE3B1, 0x7F88, 0xE3B2, 0x7F87, 0xE3B3, 0x7F8C, 0xE3B4, 0x7F94, 0xE3B5, 0x7F9E, 0xE3B6, 0x7F9D, 0xE3B7, 0x7F9A, 0xE3B8, 0x7FA3, + 0xE3B9, 0x7FAF, 0xE3BA, 0x7FB2, 0xE3BB, 0x7FB9, 0xE3BC, 0x7FAE, 0xE3BD, 0x7FB6, 0xE3BE, 0x7FB8, 0xE3BF, 0x8B71, 0xE3C0, 0x7FC5, + 0xE3C1, 0x7FC6, 0xE3C2, 0x7FCA, 0xE3C3, 0x7FD5, 0xE3C4, 0x7FD4, 0xE3C5, 0x7FE1, 0xE3C6, 0x7FE6, 0xE3C7, 0x7FE9, 0xE3C8, 0x7FF3, + 0xE3C9, 0x7FF9, 0xE3CA, 0x98DC, 0xE3CB, 0x8006, 0xE3CC, 0x8004, 0xE3CD, 0x800B, 0xE3CE, 0x8012, 0xE3CF, 0x8018, 0xE3D0, 0x8019, + 0xE3D1, 0x801C, 0xE3D2, 0x8021, 0xE3D3, 0x8028, 0xE3D4, 0x803F, 0xE3D5, 0x803B, 0xE3D6, 0x804A, 0xE3D7, 0x8046, 0xE3D8, 0x8052, + 0xE3D9, 0x8058, 0xE3DA, 0x805A, 0xE3DB, 0x805F, 0xE3DC, 0x8062, 0xE3DD, 0x8068, 0xE3DE, 0x8073, 0xE3DF, 0x8072, 0xE3E0, 0x8070, + 0xE3E1, 0x8076, 0xE3E2, 0x8079, 0xE3E3, 0x807D, 0xE3E4, 0x807F, 0xE3E5, 0x8084, 0xE3E6, 0x8086, 0xE3E7, 0x8085, 0xE3E8, 0x809B, + 0xE3E9, 0x8093, 0xE3EA, 0x809A, 0xE3EB, 0x80AD, 0xE3EC, 0x5190, 0xE3ED, 0x80AC, 0xE3EE, 0x80DB, 0xE3EF, 0x80E5, 0xE3F0, 0x80D9, + 0xE3F1, 0x80DD, 0xE3F2, 0x80C4, 0xE3F3, 0x80DA, 0xE3F4, 0x80D6, 0xE3F5, 0x8109, 0xE3F6, 0x80EF, 0xE3F7, 0x80F1, 0xE3F8, 0x811B, + 0xE3F9, 0x8129, 0xE3FA, 0x8123, 0xE3FB, 0x812F, 0xE3FC, 0x814B, 0xE440, 0x968B, 0xE441, 0x8146, 0xE442, 0x813E, 0xE443, 0x8153, + 0xE444, 0x8151, 0xE445, 0x80FC, 0xE446, 0x8171, 0xE447, 0x816E, 0xE448, 0x8165, 0xE449, 0x8166, 0xE44A, 0x8174, 0xE44B, 0x8183, + 0xE44C, 0x8188, 0xE44D, 0x818A, 0xE44E, 0x8180, 0xE44F, 0x8182, 0xE450, 0x81A0, 0xE451, 0x8195, 0xE452, 0x81A4, 0xE453, 0x81A3, + 0xE454, 0x815F, 0xE455, 0x8193, 0xE456, 0x81A9, 0xE457, 0x81B0, 0xE458, 0x81B5, 0xE459, 0x81BE, 0xE45A, 0x81B8, 0xE45B, 0x81BD, + 0xE45C, 0x81C0, 0xE45D, 0x81C2, 0xE45E, 0x81BA, 0xE45F, 0x81C9, 0xE460, 0x81CD, 0xE461, 0x81D1, 0xE462, 0x81D9, 0xE463, 0x81D8, + 0xE464, 0x81C8, 0xE465, 0x81DA, 0xE466, 0x81DF, 0xE467, 0x81E0, 0xE468, 0x81E7, 0xE469, 0x81FA, 0xE46A, 0x81FB, 0xE46B, 0x81FE, + 0xE46C, 0x8201, 0xE46D, 0x8202, 0xE46E, 0x8205, 0xE46F, 0x8207, 0xE470, 0x820A, 0xE471, 0x820D, 0xE472, 0x8210, 0xE473, 0x8216, + 0xE474, 0x8229, 0xE475, 0x822B, 0xE476, 0x8238, 0xE477, 0x8233, 0xE478, 0x8240, 0xE479, 0x8259, 0xE47A, 0x8258, 0xE47B, 0x825D, + 0xE47C, 0x825A, 0xE47D, 0x825F, 0xE47E, 0x8264, 0xE480, 0x8262, 0xE481, 0x8268, 0xE482, 0x826A, 0xE483, 0x826B, 0xE484, 0x822E, + 0xE485, 0x8271, 0xE486, 0x8277, 0xE487, 0x8278, 0xE488, 0x827E, 0xE489, 0x828D, 0xE48A, 0x8292, 0xE48B, 0x82AB, 0xE48C, 0x829F, + 0xE48D, 0x82BB, 0xE48E, 0x82AC, 0xE48F, 0x82E1, 0xE490, 0x82E3, 0xE491, 0x82DF, 0xE492, 0x82D2, 0xE493, 0x82F4, 0xE494, 0x82F3, + 0xE495, 0x82FA, 0xE496, 0x8393, 0xE497, 0x8303, 0xE498, 0x82FB, 0xE499, 0x82F9, 0xE49A, 0x82DE, 0xE49B, 0x8306, 0xE49C, 0x82DC, + 0xE49D, 0x8309, 0xE49E, 0x82D9, 0xE49F, 0x8335, 0xE4A0, 0x8334, 0xE4A1, 0x8316, 0xE4A2, 0x8332, 0xE4A3, 0x8331, 0xE4A4, 0x8340, + 0xE4A5, 0x8339, 0xE4A6, 0x8350, 0xE4A7, 0x8345, 0xE4A8, 0x832F, 0xE4A9, 0x832B, 0xE4AA, 0x8317, 0xE4AB, 0x8318, 0xE4AC, 0x8385, + 0xE4AD, 0x839A, 0xE4AE, 0x83AA, 0xE4AF, 0x839F, 0xE4B0, 0x83A2, 0xE4B1, 0x8396, 0xE4B2, 0x8323, 0xE4B3, 0x838E, 0xE4B4, 0x8387, + 0xE4B5, 0x838A, 0xE4B6, 0x837C, 0xE4B7, 0x83B5, 0xE4B8, 0x8373, 0xE4B9, 0x8375, 0xE4BA, 0x83A0, 0xE4BB, 0x8389, 0xE4BC, 0x83A8, + 0xE4BD, 0x83F4, 0xE4BE, 0x8413, 0xE4BF, 0x83EB, 0xE4C0, 0x83CE, 0xE4C1, 0x83FD, 0xE4C2, 0x8403, 0xE4C3, 0x83D8, 0xE4C4, 0x840B, + 0xE4C5, 0x83C1, 0xE4C6, 0x83F7, 0xE4C7, 0x8407, 0xE4C8, 0x83E0, 0xE4C9, 0x83F2, 0xE4CA, 0x840D, 0xE4CB, 0x8422, 0xE4CC, 0x8420, + 0xE4CD, 0x83BD, 0xE4CE, 0x8438, 0xE4CF, 0x8506, 0xE4D0, 0x83FB, 0xE4D1, 0x846D, 0xE4D2, 0x842A, 0xE4D3, 0x843C, 0xE4D4, 0x855A, + 0xE4D5, 0x8484, 0xE4D6, 0x8477, 0xE4D7, 0x846B, 0xE4D8, 0x84AD, 0xE4D9, 0x846E, 0xE4DA, 0x8482, 0xE4DB, 0x8469, 0xE4DC, 0x8446, + 0xE4DD, 0x842C, 0xE4DE, 0x846F, 0xE4DF, 0x8479, 0xE4E0, 0x8435, 0xE4E1, 0x84CA, 0xE4E2, 0x8462, 0xE4E3, 0x84B9, 0xE4E4, 0x84BF, + 0xE4E5, 0x849F, 0xE4E6, 0x84D9, 0xE4E7, 0x84CD, 0xE4E8, 0x84BB, 0xE4E9, 0x84DA, 0xE4EA, 0x84D0, 0xE4EB, 0x84C1, 0xE4EC, 0x84C6, + 0xE4ED, 0x84D6, 0xE4EE, 0x84A1, 0xE4EF, 0x8521, 0xE4F0, 0x84FF, 0xE4F1, 0x84F4, 0xE4F2, 0x8517, 0xE4F3, 0x8518, 0xE4F4, 0x852C, + 0xE4F5, 0x851F, 0xE4F6, 0x8515, 0xE4F7, 0x8514, 0xE4F8, 0x84FC, 0xE4F9, 0x8540, 0xE4FA, 0x8563, 0xE4FB, 0x8558, 0xE4FC, 0x8548, + 0xE540, 0x8541, 0xE541, 0x8602, 0xE542, 0x854B, 0xE543, 0x8555, 0xE544, 0x8580, 0xE545, 0x85A4, 0xE546, 0x8588, 0xE547, 0x8591, + 0xE548, 0x858A, 0xE549, 0x85A8, 0xE54A, 0x856D, 0xE54B, 0x8594, 0xE54C, 0x859B, 0xE54D, 0x85EA, 0xE54E, 0x8587, 0xE54F, 0x859C, + 0xE550, 0x8577, 0xE551, 0x857E, 0xE552, 0x8590, 0xE553, 0x85C9, 0xE554, 0x85BA, 0xE555, 0x85CF, 0xE556, 0x85B9, 0xE557, 0x85D0, + 0xE558, 0x85D5, 0xE559, 0x85DD, 0xE55A, 0x85E5, 0xE55B, 0x85DC, 0xE55C, 0x85F9, 0xE55D, 0x860A, 0xE55E, 0x8613, 0xE55F, 0x860B, + 0xE560, 0x85FE, 0xE561, 0x85FA, 0xE562, 0x8606, 0xE563, 0x8622, 0xE564, 0x861A, 0xE565, 0x8630, 0xE566, 0x863F, 0xE567, 0x864D, + 0xE568, 0x4E55, 0xE569, 0x8654, 0xE56A, 0x865F, 0xE56B, 0x8667, 0xE56C, 0x8671, 0xE56D, 0x8693, 0xE56E, 0x86A3, 0xE56F, 0x86A9, + 0xE570, 0x86AA, 0xE571, 0x868B, 0xE572, 0x868C, 0xE573, 0x86B6, 0xE574, 0x86AF, 0xE575, 0x86C4, 0xE576, 0x86C6, 0xE577, 0x86B0, + 0xE578, 0x86C9, 0xE579, 0x8823, 0xE57A, 0x86AB, 0xE57B, 0x86D4, 0xE57C, 0x86DE, 0xE57D, 0x86E9, 0xE57E, 0x86EC, 0xE580, 0x86DF, + 0xE581, 0x86DB, 0xE582, 0x86EF, 0xE583, 0x8712, 0xE584, 0x8706, 0xE585, 0x8708, 0xE586, 0x8700, 0xE587, 0x8703, 0xE588, 0x86FB, + 0xE589, 0x8711, 0xE58A, 0x8709, 0xE58B, 0x870D, 0xE58C, 0x86F9, 0xE58D, 0x870A, 0xE58E, 0x8734, 0xE58F, 0x873F, 0xE590, 0x8737, + 0xE591, 0x873B, 0xE592, 0x8725, 0xE593, 0x8729, 0xE594, 0x871A, 0xE595, 0x8760, 0xE596, 0x875F, 0xE597, 0x8778, 0xE598, 0x874C, + 0xE599, 0x874E, 0xE59A, 0x8774, 0xE59B, 0x8757, 0xE59C, 0x8768, 0xE59D, 0x876E, 0xE59E, 0x8759, 0xE59F, 0x8753, 0xE5A0, 0x8763, + 0xE5A1, 0x876A, 0xE5A2, 0x8805, 0xE5A3, 0x87A2, 0xE5A4, 0x879F, 0xE5A5, 0x8782, 0xE5A6, 0x87AF, 0xE5A7, 0x87CB, 0xE5A8, 0x87BD, + 0xE5A9, 0x87C0, 0xE5AA, 0x87D0, 0xE5AB, 0x96D6, 0xE5AC, 0x87AB, 0xE5AD, 0x87C4, 0xE5AE, 0x87B3, 0xE5AF, 0x87C7, 0xE5B0, 0x87C6, + 0xE5B1, 0x87BB, 0xE5B2, 0x87EF, 0xE5B3, 0x87F2, 0xE5B4, 0x87E0, 0xE5B5, 0x880F, 0xE5B6, 0x880D, 0xE5B7, 0x87FE, 0xE5B8, 0x87F6, + 0xE5B9, 0x87F7, 0xE5BA, 0x880E, 0xE5BB, 0x87D2, 0xE5BC, 0x8811, 0xE5BD, 0x8816, 0xE5BE, 0x8815, 0xE5BF, 0x8822, 0xE5C0, 0x8821, + 0xE5C1, 0x8831, 0xE5C2, 0x8836, 0xE5C3, 0x8839, 0xE5C4, 0x8827, 0xE5C5, 0x883B, 0xE5C6, 0x8844, 0xE5C7, 0x8842, 0xE5C8, 0x8852, + 0xE5C9, 0x8859, 0xE5CA, 0x885E, 0xE5CB, 0x8862, 0xE5CC, 0x886B, 0xE5CD, 0x8881, 0xE5CE, 0x887E, 0xE5CF, 0x889E, 0xE5D0, 0x8875, + 0xE5D1, 0x887D, 0xE5D2, 0x88B5, 0xE5D3, 0x8872, 0xE5D4, 0x8882, 0xE5D5, 0x8897, 0xE5D6, 0x8892, 0xE5D7, 0x88AE, 0xE5D8, 0x8899, + 0xE5D9, 0x88A2, 0xE5DA, 0x888D, 0xE5DB, 0x88A4, 0xE5DC, 0x88B0, 0xE5DD, 0x88BF, 0xE5DE, 0x88B1, 0xE5DF, 0x88C3, 0xE5E0, 0x88C4, + 0xE5E1, 0x88D4, 0xE5E2, 0x88D8, 0xE5E3, 0x88D9, 0xE5E4, 0x88DD, 0xE5E5, 0x88F9, 0xE5E6, 0x8902, 0xE5E7, 0x88FC, 0xE5E8, 0x88F4, + 0xE5E9, 0x88E8, 0xE5EA, 0x88F2, 0xE5EB, 0x8904, 0xE5EC, 0x890C, 0xE5ED, 0x890A, 0xE5EE, 0x8913, 0xE5EF, 0x8943, 0xE5F0, 0x891E, + 0xE5F1, 0x8925, 0xE5F2, 0x892A, 0xE5F3, 0x892B, 0xE5F4, 0x8941, 0xE5F5, 0x8944, 0xE5F6, 0x893B, 0xE5F7, 0x8936, 0xE5F8, 0x8938, + 0xE5F9, 0x894C, 0xE5FA, 0x891D, 0xE5FB, 0x8960, 0xE5FC, 0x895E, 0xE640, 0x8966, 0xE641, 0x8964, 0xE642, 0x896D, 0xE643, 0x896A, + 0xE644, 0x896F, 0xE645, 0x8974, 0xE646, 0x8977, 0xE647, 0x897E, 0xE648, 0x8983, 0xE649, 0x8988, 0xE64A, 0x898A, 0xE64B, 0x8993, + 0xE64C, 0x8998, 0xE64D, 0x89A1, 0xE64E, 0x89A9, 0xE64F, 0x89A6, 0xE650, 0x89AC, 0xE651, 0x89AF, 0xE652, 0x89B2, 0xE653, 0x89BA, + 0xE654, 0x89BD, 0xE655, 0x89BF, 0xE656, 0x89C0, 0xE657, 0x89DA, 0xE658, 0x89DC, 0xE659, 0x89DD, 0xE65A, 0x89E7, 0xE65B, 0x89F4, + 0xE65C, 0x89F8, 0xE65D, 0x8A03, 0xE65E, 0x8A16, 0xE65F, 0x8A10, 0xE660, 0x8A0C, 0xE661, 0x8A1B, 0xE662, 0x8A1D, 0xE663, 0x8A25, + 0xE664, 0x8A36, 0xE665, 0x8A41, 0xE666, 0x8A5B, 0xE667, 0x8A52, 0xE668, 0x8A46, 0xE669, 0x8A48, 0xE66A, 0x8A7C, 0xE66B, 0x8A6D, + 0xE66C, 0x8A6C, 0xE66D, 0x8A62, 0xE66E, 0x8A85, 0xE66F, 0x8A82, 0xE670, 0x8A84, 0xE671, 0x8AA8, 0xE672, 0x8AA1, 0xE673, 0x8A91, + 0xE674, 0x8AA5, 0xE675, 0x8AA6, 0xE676, 0x8A9A, 0xE677, 0x8AA3, 0xE678, 0x8AC4, 0xE679, 0x8ACD, 0xE67A, 0x8AC2, 0xE67B, 0x8ADA, + 0xE67C, 0x8AEB, 0xE67D, 0x8AF3, 0xE67E, 0x8AE7, 0xE680, 0x8AE4, 0xE681, 0x8AF1, 0xE682, 0x8B14, 0xE683, 0x8AE0, 0xE684, 0x8AE2, + 0xE685, 0x8AF7, 0xE686, 0x8ADE, 0xE687, 0x8ADB, 0xE688, 0x8B0C, 0xE689, 0x8B07, 0xE68A, 0x8B1A, 0xE68B, 0x8AE1, 0xE68C, 0x8B16, + 0xE68D, 0x8B10, 0xE68E, 0x8B17, 0xE68F, 0x8B20, 0xE690, 0x8B33, 0xE691, 0x97AB, 0xE692, 0x8B26, 0xE693, 0x8B2B, 0xE694, 0x8B3E, + 0xE695, 0x8B28, 0xE696, 0x8B41, 0xE697, 0x8B4C, 0xE698, 0x8B4F, 0xE699, 0x8B4E, 0xE69A, 0x8B49, 0xE69B, 0x8B56, 0xE69C, 0x8B5B, + 0xE69D, 0x8B5A, 0xE69E, 0x8B6B, 0xE69F, 0x8B5F, 0xE6A0, 0x8B6C, 0xE6A1, 0x8B6F, 0xE6A2, 0x8B74, 0xE6A3, 0x8B7D, 0xE6A4, 0x8B80, + 0xE6A5, 0x8B8C, 0xE6A6, 0x8B8E, 0xE6A7, 0x8B92, 0xE6A8, 0x8B93, 0xE6A9, 0x8B96, 0xE6AA, 0x8B99, 0xE6AB, 0x8B9A, 0xE6AC, 0x8C3A, + 0xE6AD, 0x8C41, 0xE6AE, 0x8C3F, 0xE6AF, 0x8C48, 0xE6B0, 0x8C4C, 0xE6B1, 0x8C4E, 0xE6B2, 0x8C50, 0xE6B3, 0x8C55, 0xE6B4, 0x8C62, + 0xE6B5, 0x8C6C, 0xE6B6, 0x8C78, 0xE6B7, 0x8C7A, 0xE6B8, 0x8C82, 0xE6B9, 0x8C89, 0xE6BA, 0x8C85, 0xE6BB, 0x8C8A, 0xE6BC, 0x8C8D, + 0xE6BD, 0x8C8E, 0xE6BE, 0x8C94, 0xE6BF, 0x8C7C, 0xE6C0, 0x8C98, 0xE6C1, 0x621D, 0xE6C2, 0x8CAD, 0xE6C3, 0x8CAA, 0xE6C4, 0x8CBD, + 0xE6C5, 0x8CB2, 0xE6C6, 0x8CB3, 0xE6C7, 0x8CAE, 0xE6C8, 0x8CB6, 0xE6C9, 0x8CC8, 0xE6CA, 0x8CC1, 0xE6CB, 0x8CE4, 0xE6CC, 0x8CE3, + 0xE6CD, 0x8CDA, 0xE6CE, 0x8CFD, 0xE6CF, 0x8CFA, 0xE6D0, 0x8CFB, 0xE6D1, 0x8D04, 0xE6D2, 0x8D05, 0xE6D3, 0x8D0A, 0xE6D4, 0x8D07, + 0xE6D5, 0x8D0F, 0xE6D6, 0x8D0D, 0xE6D7, 0x8D10, 0xE6D8, 0x9F4E, 0xE6D9, 0x8D13, 0xE6DA, 0x8CCD, 0xE6DB, 0x8D14, 0xE6DC, 0x8D16, + 0xE6DD, 0x8D67, 0xE6DE, 0x8D6D, 0xE6DF, 0x8D71, 0xE6E0, 0x8D73, 0xE6E1, 0x8D81, 0xE6E2, 0x8D99, 0xE6E3, 0x8DC2, 0xE6E4, 0x8DBE, + 0xE6E5, 0x8DBA, 0xE6E6, 0x8DCF, 0xE6E7, 0x8DDA, 0xE6E8, 0x8DD6, 0xE6E9, 0x8DCC, 0xE6EA, 0x8DDB, 0xE6EB, 0x8DCB, 0xE6EC, 0x8DEA, + 0xE6ED, 0x8DEB, 0xE6EE, 0x8DDF, 0xE6EF, 0x8DE3, 0xE6F0, 0x8DFC, 0xE6F1, 0x8E08, 0xE6F2, 0x8E09, 0xE6F3, 0x8DFF, 0xE6F4, 0x8E1D, + 0xE6F5, 0x8E1E, 0xE6F6, 0x8E10, 0xE6F7, 0x8E1F, 0xE6F8, 0x8E42, 0xE6F9, 0x8E35, 0xE6FA, 0x8E30, 0xE6FB, 0x8E34, 0xE6FC, 0x8E4A, + 0xE740, 0x8E47, 0xE741, 0x8E49, 0xE742, 0x8E4C, 0xE743, 0x8E50, 0xE744, 0x8E48, 0xE745, 0x8E59, 0xE746, 0x8E64, 0xE747, 0x8E60, + 0xE748, 0x8E2A, 0xE749, 0x8E63, 0xE74A, 0x8E55, 0xE74B, 0x8E76, 0xE74C, 0x8E72, 0xE74D, 0x8E7C, 0xE74E, 0x8E81, 0xE74F, 0x8E87, + 0xE750, 0x8E85, 0xE751, 0x8E84, 0xE752, 0x8E8B, 0xE753, 0x8E8A, 0xE754, 0x8E93, 0xE755, 0x8E91, 0xE756, 0x8E94, 0xE757, 0x8E99, + 0xE758, 0x8EAA, 0xE759, 0x8EA1, 0xE75A, 0x8EAC, 0xE75B, 0x8EB0, 0xE75C, 0x8EC6, 0xE75D, 0x8EB1, 0xE75E, 0x8EBE, 0xE75F, 0x8EC5, + 0xE760, 0x8EC8, 0xE761, 0x8ECB, 0xE762, 0x8EDB, 0xE763, 0x8EE3, 0xE764, 0x8EFC, 0xE765, 0x8EFB, 0xE766, 0x8EEB, 0xE767, 0x8EFE, + 0xE768, 0x8F0A, 0xE769, 0x8F05, 0xE76A, 0x8F15, 0xE76B, 0x8F12, 0xE76C, 0x8F19, 0xE76D, 0x8F13, 0xE76E, 0x8F1C, 0xE76F, 0x8F1F, + 0xE770, 0x8F1B, 0xE771, 0x8F0C, 0xE772, 0x8F26, 0xE773, 0x8F33, 0xE774, 0x8F3B, 0xE775, 0x8F39, 0xE776, 0x8F45, 0xE777, 0x8F42, + 0xE778, 0x8F3E, 0xE779, 0x8F4C, 0xE77A, 0x8F49, 0xE77B, 0x8F46, 0xE77C, 0x8F4E, 0xE77D, 0x8F57, 0xE77E, 0x8F5C, 0xE780, 0x8F62, + 0xE781, 0x8F63, 0xE782, 0x8F64, 0xE783, 0x8F9C, 0xE784, 0x8F9F, 0xE785, 0x8FA3, 0xE786, 0x8FAD, 0xE787, 0x8FAF, 0xE788, 0x8FB7, + 0xE789, 0x8FDA, 0xE78A, 0x8FE5, 0xE78B, 0x8FE2, 0xE78C, 0x8FEA, 0xE78D, 0x8FEF, 0xE78E, 0x9087, 0xE78F, 0x8FF4, 0xE790, 0x9005, + 0xE791, 0x8FF9, 0xE792, 0x8FFA, 0xE793, 0x9011, 0xE794, 0x9015, 0xE795, 0x9021, 0xE796, 0x900D, 0xE797, 0x901E, 0xE798, 0x9016, + 0xE799, 0x900B, 0xE79A, 0x9027, 0xE79B, 0x9036, 0xE79C, 0x9035, 0xE79D, 0x9039, 0xE79E, 0x8FF8, 0xE79F, 0x904F, 0xE7A0, 0x9050, + 0xE7A1, 0x9051, 0xE7A2, 0x9052, 0xE7A3, 0x900E, 0xE7A4, 0x9049, 0xE7A5, 0x903E, 0xE7A6, 0x9056, 0xE7A7, 0x9058, 0xE7A8, 0x905E, + 0xE7A9, 0x9068, 0xE7AA, 0x906F, 0xE7AB, 0x9076, 0xE7AC, 0x96A8, 0xE7AD, 0x9072, 0xE7AE, 0x9082, 0xE7AF, 0x907D, 0xE7B0, 0x9081, + 0xE7B1, 0x9080, 0xE7B2, 0x908A, 0xE7B3, 0x9089, 0xE7B4, 0x908F, 0xE7B5, 0x90A8, 0xE7B6, 0x90AF, 0xE7B7, 0x90B1, 0xE7B8, 0x90B5, + 0xE7B9, 0x90E2, 0xE7BA, 0x90E4, 0xE7BB, 0x6248, 0xE7BC, 0x90DB, 0xE7BD, 0x9102, 0xE7BE, 0x9112, 0xE7BF, 0x9119, 0xE7C0, 0x9132, + 0xE7C1, 0x9130, 0xE7C2, 0x914A, 0xE7C3, 0x9156, 0xE7C4, 0x9158, 0xE7C5, 0x9163, 0xE7C6, 0x9165, 0xE7C7, 0x9169, 0xE7C8, 0x9173, + 0xE7C9, 0x9172, 0xE7CA, 0x918B, 0xE7CB, 0x9189, 0xE7CC, 0x9182, 0xE7CD, 0x91A2, 0xE7CE, 0x91AB, 0xE7CF, 0x91AF, 0xE7D0, 0x91AA, + 0xE7D1, 0x91B5, 0xE7D2, 0x91B4, 0xE7D3, 0x91BA, 0xE7D4, 0x91C0, 0xE7D5, 0x91C1, 0xE7D6, 0x91C9, 0xE7D7, 0x91CB, 0xE7D8, 0x91D0, + 0xE7D9, 0x91D6, 0xE7DA, 0x91DF, 0xE7DB, 0x91E1, 0xE7DC, 0x91DB, 0xE7DD, 0x91FC, 0xE7DE, 0x91F5, 0xE7DF, 0x91F6, 0xE7E0, 0x921E, + 0xE7E1, 0x91FF, 0xE7E2, 0x9214, 0xE7E3, 0x922C, 0xE7E4, 0x9215, 0xE7E5, 0x9211, 0xE7E6, 0x925E, 0xE7E7, 0x9257, 0xE7E8, 0x9245, + 0xE7E9, 0x9249, 0xE7EA, 0x9264, 0xE7EB, 0x9248, 0xE7EC, 0x9295, 0xE7ED, 0x923F, 0xE7EE, 0x924B, 0xE7EF, 0x9250, 0xE7F0, 0x929C, + 0xE7F1, 0x9296, 0xE7F2, 0x9293, 0xE7F3, 0x929B, 0xE7F4, 0x925A, 0xE7F5, 0x92CF, 0xE7F6, 0x92B9, 0xE7F7, 0x92B7, 0xE7F8, 0x92E9, + 0xE7F9, 0x930F, 0xE7FA, 0x92FA, 0xE7FB, 0x9344, 0xE7FC, 0x932E, 0xE840, 0x9319, 0xE841, 0x9322, 0xE842, 0x931A, 0xE843, 0x9323, + 0xE844, 0x933A, 0xE845, 0x9335, 0xE846, 0x933B, 0xE847, 0x935C, 0xE848, 0x9360, 0xE849, 0x937C, 0xE84A, 0x936E, 0xE84B, 0x9356, + 0xE84C, 0x93B0, 0xE84D, 0x93AC, 0xE84E, 0x93AD, 0xE84F, 0x9394, 0xE850, 0x93B9, 0xE851, 0x93D6, 0xE852, 0x93D7, 0xE853, 0x93E8, + 0xE854, 0x93E5, 0xE855, 0x93D8, 0xE856, 0x93C3, 0xE857, 0x93DD, 0xE858, 0x93D0, 0xE859, 0x93C8, 0xE85A, 0x93E4, 0xE85B, 0x941A, + 0xE85C, 0x9414, 0xE85D, 0x9413, 0xE85E, 0x9403, 0xE85F, 0x9407, 0xE860, 0x9410, 0xE861, 0x9436, 0xE862, 0x942B, 0xE863, 0x9435, + 0xE864, 0x9421, 0xE865, 0x943A, 0xE866, 0x9441, 0xE867, 0x9452, 0xE868, 0x9444, 0xE869, 0x945B, 0xE86A, 0x9460, 0xE86B, 0x9462, + 0xE86C, 0x945E, 0xE86D, 0x946A, 0xE86E, 0x9229, 0xE86F, 0x9470, 0xE870, 0x9475, 0xE871, 0x9477, 0xE872, 0x947D, 0xE873, 0x945A, + 0xE874, 0x947C, 0xE875, 0x947E, 0xE876, 0x9481, 0xE877, 0x947F, 0xE878, 0x9582, 0xE879, 0x9587, 0xE87A, 0x958A, 0xE87B, 0x9594, + 0xE87C, 0x9596, 0xE87D, 0x9598, 0xE87E, 0x9599, 0xE880, 0x95A0, 0xE881, 0x95A8, 0xE882, 0x95A7, 0xE883, 0x95AD, 0xE884, 0x95BC, + 0xE885, 0x95BB, 0xE886, 0x95B9, 0xE887, 0x95BE, 0xE888, 0x95CA, 0xE889, 0x6FF6, 0xE88A, 0x95C3, 0xE88B, 0x95CD, 0xE88C, 0x95CC, + 0xE88D, 0x95D5, 0xE88E, 0x95D4, 0xE88F, 0x95D6, 0xE890, 0x95DC, 0xE891, 0x95E1, 0xE892, 0x95E5, 0xE893, 0x95E2, 0xE894, 0x9621, + 0xE895, 0x9628, 0xE896, 0x962E, 0xE897, 0x962F, 0xE898, 0x9642, 0xE899, 0x964C, 0xE89A, 0x964F, 0xE89B, 0x964B, 0xE89C, 0x9677, + 0xE89D, 0x965C, 0xE89E, 0x965E, 0xE89F, 0x965D, 0xE8A0, 0x965F, 0xE8A1, 0x9666, 0xE8A2, 0x9672, 0xE8A3, 0x966C, 0xE8A4, 0x968D, + 0xE8A5, 0x9698, 0xE8A6, 0x9695, 0xE8A7, 0x9697, 0xE8A8, 0x96AA, 0xE8A9, 0x96A7, 0xE8AA, 0x96B1, 0xE8AB, 0x96B2, 0xE8AC, 0x96B0, + 0xE8AD, 0x96B4, 0xE8AE, 0x96B6, 0xE8AF, 0x96B8, 0xE8B0, 0x96B9, 0xE8B1, 0x96CE, 0xE8B2, 0x96CB, 0xE8B3, 0x96C9, 0xE8B4, 0x96CD, + 0xE8B5, 0x894D, 0xE8B6, 0x96DC, 0xE8B7, 0x970D, 0xE8B8, 0x96D5, 0xE8B9, 0x96F9, 0xE8BA, 0x9704, 0xE8BB, 0x9706, 0xE8BC, 0x9708, + 0xE8BD, 0x9713, 0xE8BE, 0x970E, 0xE8BF, 0x9711, 0xE8C0, 0x970F, 0xE8C1, 0x9716, 0xE8C2, 0x9719, 0xE8C3, 0x9724, 0xE8C4, 0x972A, + 0xE8C5, 0x9730, 0xE8C6, 0x9739, 0xE8C7, 0x973D, 0xE8C8, 0x973E, 0xE8C9, 0x9744, 0xE8CA, 0x9746, 0xE8CB, 0x9748, 0xE8CC, 0x9742, + 0xE8CD, 0x9749, 0xE8CE, 0x975C, 0xE8CF, 0x9760, 0xE8D0, 0x9764, 0xE8D1, 0x9766, 0xE8D2, 0x9768, 0xE8D3, 0x52D2, 0xE8D4, 0x976B, + 0xE8D5, 0x9771, 0xE8D6, 0x9779, 0xE8D7, 0x9785, 0xE8D8, 0x977C, 0xE8D9, 0x9781, 0xE8DA, 0x977A, 0xE8DB, 0x9786, 0xE8DC, 0x978B, + 0xE8DD, 0x978F, 0xE8DE, 0x9790, 0xE8DF, 0x979C, 0xE8E0, 0x97A8, 0xE8E1, 0x97A6, 0xE8E2, 0x97A3, 0xE8E3, 0x97B3, 0xE8E4, 0x97B4, + 0xE8E5, 0x97C3, 0xE8E6, 0x97C6, 0xE8E7, 0x97C8, 0xE8E8, 0x97CB, 0xE8E9, 0x97DC, 0xE8EA, 0x97ED, 0xE8EB, 0x9F4F, 0xE8EC, 0x97F2, + 0xE8ED, 0x7ADF, 0xE8EE, 0x97F6, 0xE8EF, 0x97F5, 0xE8F0, 0x980F, 0xE8F1, 0x980C, 0xE8F2, 0x9838, 0xE8F3, 0x9824, 0xE8F4, 0x9821, + 0xE8F5, 0x9837, 0xE8F6, 0x983D, 0xE8F7, 0x9846, 0xE8F8, 0x984F, 0xE8F9, 0x984B, 0xE8FA, 0x986B, 0xE8FB, 0x986F, 0xE8FC, 0x9870, + 0xE940, 0x9871, 0xE941, 0x9874, 0xE942, 0x9873, 0xE943, 0x98AA, 0xE944, 0x98AF, 0xE945, 0x98B1, 0xE946, 0x98B6, 0xE947, 0x98C4, + 0xE948, 0x98C3, 0xE949, 0x98C6, 0xE94A, 0x98E9, 0xE94B, 0x98EB, 0xE94C, 0x9903, 0xE94D, 0x9909, 0xE94E, 0x9912, 0xE94F, 0x9914, + 0xE950, 0x9918, 0xE951, 0x9921, 0xE952, 0x991D, 0xE953, 0x991E, 0xE954, 0x9924, 0xE955, 0x9920, 0xE956, 0x992C, 0xE957, 0x992E, + 0xE958, 0x993D, 0xE959, 0x993E, 0xE95A, 0x9942, 0xE95B, 0x9949, 0xE95C, 0x9945, 0xE95D, 0x9950, 0xE95E, 0x994B, 0xE95F, 0x9951, + 0xE960, 0x9952, 0xE961, 0x994C, 0xE962, 0x9955, 0xE963, 0x9997, 0xE964, 0x9998, 0xE965, 0x99A5, 0xE966, 0x99AD, 0xE967, 0x99AE, + 0xE968, 0x99BC, 0xE969, 0x99DF, 0xE96A, 0x99DB, 0xE96B, 0x99DD, 0xE96C, 0x99D8, 0xE96D, 0x99D1, 0xE96E, 0x99ED, 0xE96F, 0x99EE, + 0xE970, 0x99F1, 0xE971, 0x99F2, 0xE972, 0x99FB, 0xE973, 0x99F8, 0xE974, 0x9A01, 0xE975, 0x9A0F, 0xE976, 0x9A05, 0xE977, 0x99E2, + 0xE978, 0x9A19, 0xE979, 0x9A2B, 0xE97A, 0x9A37, 0xE97B, 0x9A45, 0xE97C, 0x9A42, 0xE97D, 0x9A40, 0xE97E, 0x9A43, 0xE980, 0x9A3E, + 0xE981, 0x9A55, 0xE982, 0x9A4D, 0xE983, 0x9A5B, 0xE984, 0x9A57, 0xE985, 0x9A5F, 0xE986, 0x9A62, 0xE987, 0x9A65, 0xE988, 0x9A64, + 0xE989, 0x9A69, 0xE98A, 0x9A6B, 0xE98B, 0x9A6A, 0xE98C, 0x9AAD, 0xE98D, 0x9AB0, 0xE98E, 0x9ABC, 0xE98F, 0x9AC0, 0xE990, 0x9ACF, + 0xE991, 0x9AD1, 0xE992, 0x9AD3, 0xE993, 0x9AD4, 0xE994, 0x9ADE, 0xE995, 0x9ADF, 0xE996, 0x9AE2, 0xE997, 0x9AE3, 0xE998, 0x9AE6, + 0xE999, 0x9AEF, 0xE99A, 0x9AEB, 0xE99B, 0x9AEE, 0xE99C, 0x9AF4, 0xE99D, 0x9AF1, 0xE99E, 0x9AF7, 0xE99F, 0x9AFB, 0xE9A0, 0x9B06, + 0xE9A1, 0x9B18, 0xE9A2, 0x9B1A, 0xE9A3, 0x9B1F, 0xE9A4, 0x9B22, 0xE9A5, 0x9B23, 0xE9A6, 0x9B25, 0xE9A7, 0x9B27, 0xE9A8, 0x9B28, + 0xE9A9, 0x9B29, 0xE9AA, 0x9B2A, 0xE9AB, 0x9B2E, 0xE9AC, 0x9B2F, 0xE9AD, 0x9B32, 0xE9AE, 0x9B44, 0xE9AF, 0x9B43, 0xE9B0, 0x9B4F, + 0xE9B1, 0x9B4D, 0xE9B2, 0x9B4E, 0xE9B3, 0x9B51, 0xE9B4, 0x9B58, 0xE9B5, 0x9B74, 0xE9B6, 0x9B93, 0xE9B7, 0x9B83, 0xE9B8, 0x9B91, + 0xE9B9, 0x9B96, 0xE9BA, 0x9B97, 0xE9BB, 0x9B9F, 0xE9BC, 0x9BA0, 0xE9BD, 0x9BA8, 0xE9BE, 0x9BB4, 0xE9BF, 0x9BC0, 0xE9C0, 0x9BCA, + 0xE9C1, 0x9BB9, 0xE9C2, 0x9BC6, 0xE9C3, 0x9BCF, 0xE9C4, 0x9BD1, 0xE9C5, 0x9BD2, 0xE9C6, 0x9BE3, 0xE9C7, 0x9BE2, 0xE9C8, 0x9BE4, + 0xE9C9, 0x9BD4, 0xE9CA, 0x9BE1, 0xE9CB, 0x9C3A, 0xE9CC, 0x9BF2, 0xE9CD, 0x9BF1, 0xE9CE, 0x9BF0, 0xE9CF, 0x9C15, 0xE9D0, 0x9C14, + 0xE9D1, 0x9C09, 0xE9D2, 0x9C13, 0xE9D3, 0x9C0C, 0xE9D4, 0x9C06, 0xE9D5, 0x9C08, 0xE9D6, 0x9C12, 0xE9D7, 0x9C0A, 0xE9D8, 0x9C04, + 0xE9D9, 0x9C2E, 0xE9DA, 0x9C1B, 0xE9DB, 0x9C25, 0xE9DC, 0x9C24, 0xE9DD, 0x9C21, 0xE9DE, 0x9C30, 0xE9DF, 0x9C47, 0xE9E0, 0x9C32, + 0xE9E1, 0x9C46, 0xE9E2, 0x9C3E, 0xE9E3, 0x9C5A, 0xE9E4, 0x9C60, 0xE9E5, 0x9C67, 0xE9E6, 0x9C76, 0xE9E7, 0x9C78, 0xE9E8, 0x9CE7, + 0xE9E9, 0x9CEC, 0xE9EA, 0x9CF0, 0xE9EB, 0x9D09, 0xE9EC, 0x9D08, 0xE9ED, 0x9CEB, 0xE9EE, 0x9D03, 0xE9EF, 0x9D06, 0xE9F0, 0x9D2A, + 0xE9F1, 0x9D26, 0xE9F2, 0x9DAF, 0xE9F3, 0x9D23, 0xE9F4, 0x9D1F, 0xE9F5, 0x9D44, 0xE9F6, 0x9D15, 0xE9F7, 0x9D12, 0xE9F8, 0x9D41, + 0xE9F9, 0x9D3F, 0xE9FA, 0x9D3E, 0xE9FB, 0x9D46, 0xE9FC, 0x9D48, 0xEA40, 0x9D5D, 0xEA41, 0x9D5E, 0xEA42, 0x9D64, 0xEA43, 0x9D51, + 0xEA44, 0x9D50, 0xEA45, 0x9D59, 0xEA46, 0x9D72, 0xEA47, 0x9D89, 0xEA48, 0x9D87, 0xEA49, 0x9DAB, 0xEA4A, 0x9D6F, 0xEA4B, 0x9D7A, + 0xEA4C, 0x9D9A, 0xEA4D, 0x9DA4, 0xEA4E, 0x9DA9, 0xEA4F, 0x9DB2, 0xEA50, 0x9DC4, 0xEA51, 0x9DC1, 0xEA52, 0x9DBB, 0xEA53, 0x9DB8, + 0xEA54, 0x9DBA, 0xEA55, 0x9DC6, 0xEA56, 0x9DCF, 0xEA57, 0x9DC2, 0xEA58, 0x9DD9, 0xEA59, 0x9DD3, 0xEA5A, 0x9DF8, 0xEA5B, 0x9DE6, + 0xEA5C, 0x9DED, 0xEA5D, 0x9DEF, 0xEA5E, 0x9DFD, 0xEA5F, 0x9E1A, 0xEA60, 0x9E1B, 0xEA61, 0x9E1E, 0xEA62, 0x9E75, 0xEA63, 0x9E79, + 0xEA64, 0x9E7D, 0xEA65, 0x9E81, 0xEA66, 0x9E88, 0xEA67, 0x9E8B, 0xEA68, 0x9E8C, 0xEA69, 0x9E92, 0xEA6A, 0x9E95, 0xEA6B, 0x9E91, + 0xEA6C, 0x9E9D, 0xEA6D, 0x9EA5, 0xEA6E, 0x9EA9, 0xEA6F, 0x9EB8, 0xEA70, 0x9EAA, 0xEA71, 0x9EAD, 0xEA72, 0x9761, 0xEA73, 0x9ECC, + 0xEA74, 0x9ECE, 0xEA75, 0x9ECF, 0xEA76, 0x9ED0, 0xEA77, 0x9ED4, 0xEA78, 0x9EDC, 0xEA79, 0x9EDE, 0xEA7A, 0x9EDD, 0xEA7B, 0x9EE0, + 0xEA7C, 0x9EE5, 0xEA7D, 0x9EE8, 0xEA7E, 0x9EEF, 0xEA80, 0x9EF4, 0xEA81, 0x9EF6, 0xEA82, 0x9EF7, 0xEA83, 0x9EF9, 0xEA84, 0x9EFB, + 0xEA85, 0x9EFC, 0xEA86, 0x9EFD, 0xEA87, 0x9F07, 0xEA88, 0x9F08, 0xEA89, 0x76B7, 0xEA8A, 0x9F15, 0xEA8B, 0x9F21, 0xEA8C, 0x9F2C, + 0xEA8D, 0x9F3E, 0xEA8E, 0x9F4A, 0xEA8F, 0x9F52, 0xEA90, 0x9F54, 0xEA91, 0x9F63, 0xEA92, 0x9F5F, 0xEA93, 0x9F60, 0xEA94, 0x9F61, + 0xEA95, 0x9F66, 0xEA96, 0x9F67, 0xEA97, 0x9F6C, 0xEA98, 0x9F6A, 0xEA99, 0x9F77, 0xEA9A, 0x9F72, 0xEA9B, 0x9F76, 0xEA9C, 0x9F95, + 0xEA9D, 0x9F9C, 0xEA9E, 0x9FA0, 0xEA9F, 0x582F, 0xEAA0, 0x69C7, 0xEAA1, 0x9059, 0xEAA2, 0x7464, 0xEAA3, 0x51DC, 0xEAA4, 0x7199, + 0xFA40, 0x2170, 0xFA41, 0x2171, 0xFA42, 0x2172, 0xFA43, 0x2173, 0xFA44, 0x2174, 0xFA45, 0x2175, 0xFA46, 0x2176, 0xFA47, 0x2177, + 0xFA48, 0x2178, 0xFA49, 0x2179, 0xFA55, 0xFFE4, 0xFA56, 0xFF07, 0xFA57, 0xFF02, 0xFA5C, 0x7E8A, 0xFA5D, 0x891C, 0xFA5E, 0x9348, + 0xFA5F, 0x9288, 0xFA60, 0x84DC, 0xFA61, 0x4FC9, 0xFA62, 0x70BB, 0xFA63, 0x6631, 0xFA64, 0x68C8, 0xFA65, 0x92F9, 0xFA66, 0x66FB, + 0xFA67, 0x5F45, 0xFA68, 0x4E28, 0xFA69, 0x4EE1, 0xFA6A, 0x4EFC, 0xFA6B, 0x4F00, 0xFA6C, 0x4F03, 0xFA6D, 0x4F39, 0xFA6E, 0x4F56, + 0xFA6F, 0x4F92, 0xFA70, 0x4F8A, 0xFA71, 0x4F9A, 0xFA72, 0x4F94, 0xFA73, 0x4FCD, 0xFA74, 0x5040, 0xFA75, 0x5022, 0xFA76, 0x4FFF, + 0xFA77, 0x501E, 0xFA78, 0x5046, 0xFA79, 0x5070, 0xFA7A, 0x5042, 0xFA7B, 0x5094, 0xFA7C, 0x50F4, 0xFA7D, 0x50D8, 0xFA7E, 0x514A, + 0xFA80, 0x5164, 0xFA81, 0x519D, 0xFA82, 0x51BE, 0xFA83, 0x51EC, 0xFA84, 0x5215, 0xFA85, 0x529C, 0xFA86, 0x52A6, 0xFA87, 0x52C0, + 0xFA88, 0x52DB, 0xFA89, 0x5300, 0xFA8A, 0x5307, 0xFA8B, 0x5324, 0xFA8C, 0x5372, 0xFA8D, 0x5393, 0xFA8E, 0x53B2, 0xFA8F, 0x53DD, + 0xFA90, 0xFA0E, 0xFA91, 0x549C, 0xFA92, 0x548A, 0xFA93, 0x54A9, 0xFA94, 0x54FF, 0xFA95, 0x5586, 0xFA96, 0x5759, 0xFA97, 0x5765, + 0xFA98, 0x57AC, 0xFA99, 0x57C8, 0xFA9A, 0x57C7, 0xFA9B, 0xFA0F, 0xFA9C, 0xFA10, 0xFA9D, 0x589E, 0xFA9E, 0x58B2, 0xFA9F, 0x590B, + 0xFAA0, 0x5953, 0xFAA1, 0x595B, 0xFAA2, 0x595D, 0xFAA3, 0x5963, 0xFAA4, 0x59A4, 0xFAA5, 0x59BA, 0xFAA6, 0x5B56, 0xFAA7, 0x5BC0, + 0xFAA8, 0x752F, 0xFAA9, 0x5BD8, 0xFAAA, 0x5BEC, 0xFAAB, 0x5C1E, 0xFAAC, 0x5CA6, 0xFAAD, 0x5CBA, 0xFAAE, 0x5CF5, 0xFAAF, 0x5D27, + 0xFAB0, 0x5D53, 0xFAB1, 0xFA11, 0xFAB2, 0x5D42, 0xFAB3, 0x5D6D, 0xFAB4, 0x5DB8, 0xFAB5, 0x5DB9, 0xFAB6, 0x5DD0, 0xFAB7, 0x5F21, + 0xFAB8, 0x5F34, 0xFAB9, 0x5F67, 0xFABA, 0x5FB7, 0xFABB, 0x5FDE, 0xFABC, 0x605D, 0xFABD, 0x6085, 0xFABE, 0x608A, 0xFABF, 0x60DE, + 0xFAC0, 0x60D5, 0xFAC1, 0x6120, 0xFAC2, 0x60F2, 0xFAC3, 0x6111, 0xFAC4, 0x6137, 0xFAC5, 0x6130, 0xFAC6, 0x6198, 0xFAC7, 0x6213, + 0xFAC8, 0x62A6, 0xFAC9, 0x63F5, 0xFACA, 0x6460, 0xFACB, 0x649D, 0xFACC, 0x64CE, 0xFACD, 0x654E, 0xFACE, 0x6600, 0xFACF, 0x6615, + 0xFAD0, 0x663B, 0xFAD1, 0x6609, 0xFAD2, 0x662E, 0xFAD3, 0x661E, 0xFAD4, 0x6624, 0xFAD5, 0x6665, 0xFAD6, 0x6657, 0xFAD7, 0x6659, + 0xFAD8, 0xFA12, 0xFAD9, 0x6673, 0xFADA, 0x6699, 0xFADB, 0x66A0, 0xFADC, 0x66B2, 0xFADD, 0x66BF, 0xFADE, 0x66FA, 0xFADF, 0x670E, + 0xFAE0, 0xF929, 0xFAE1, 0x6766, 0xFAE2, 0x67BB, 0xFAE3, 0x6852, 0xFAE4, 0x67C0, 0xFAE5, 0x6801, 0xFAE6, 0x6844, 0xFAE7, 0x68CF, + 0xFAE8, 0xFA13, 0xFAE9, 0x6968, 0xFAEA, 0xFA14, 0xFAEB, 0x6998, 0xFAEC, 0x69E2, 0xFAED, 0x6A30, 0xFAEE, 0x6A6B, 0xFAEF, 0x6A46, + 0xFAF0, 0x6A73, 0xFAF1, 0x6A7E, 0xFAF2, 0x6AE2, 0xFAF3, 0x6AE4, 0xFAF4, 0x6BD6, 0xFAF5, 0x6C3F, 0xFAF6, 0x6C5C, 0xFAF7, 0x6C86, + 0xFAF8, 0x6C6F, 0xFAF9, 0x6CDA, 0xFAFA, 0x6D04, 0xFAFB, 0x6D87, 0xFAFC, 0x6D6F, 0xFB40, 0x6D96, 0xFB41, 0x6DAC, 0xFB42, 0x6DCF, + 0xFB43, 0x6DF8, 0xFB44, 0x6DF2, 0xFB45, 0x6DFC, 0xFB46, 0x6E39, 0xFB47, 0x6E5C, 0xFB48, 0x6E27, 0xFB49, 0x6E3C, 0xFB4A, 0x6EBF, + 0xFB4B, 0x6F88, 0xFB4C, 0x6FB5, 0xFB4D, 0x6FF5, 0xFB4E, 0x7005, 0xFB4F, 0x7007, 0xFB50, 0x7028, 0xFB51, 0x7085, 0xFB52, 0x70AB, + 0xFB53, 0x710F, 0xFB54, 0x7104, 0xFB55, 0x715C, 0xFB56, 0x7146, 0xFB57, 0x7147, 0xFB58, 0xFA15, 0xFB59, 0x71C1, 0xFB5A, 0x71FE, + 0xFB5B, 0x72B1, 0xFB5C, 0x72BE, 0xFB5D, 0x7324, 0xFB5E, 0xFA16, 0xFB5F, 0x7377, 0xFB60, 0x73BD, 0xFB61, 0x73C9, 0xFB62, 0x73D6, + 0xFB63, 0x73E3, 0xFB64, 0x73D2, 0xFB65, 0x7407, 0xFB66, 0x73F5, 0xFB67, 0x7426, 0xFB68, 0x742A, 0xFB69, 0x7429, 0xFB6A, 0x742E, + 0xFB6B, 0x7462, 0xFB6C, 0x7489, 0xFB6D, 0x749F, 0xFB6E, 0x7501, 0xFB6F, 0x756F, 0xFB70, 0x7682, 0xFB71, 0x769C, 0xFB72, 0x769E, + 0xFB73, 0x769B, 0xFB74, 0x76A6, 0xFB75, 0xFA17, 0xFB76, 0x7746, 0xFB77, 0x52AF, 0xFB78, 0x7821, 0xFB79, 0x784E, 0xFB7A, 0x7864, + 0xFB7B, 0x787A, 0xFB7C, 0x7930, 0xFB7D, 0xFA18, 0xFB7E, 0xFA19, 0xFB80, 0xFA1A, 0xFB81, 0x7994, 0xFB82, 0xFA1B, 0xFB83, 0x799B, + 0xFB84, 0x7AD1, 0xFB85, 0x7AE7, 0xFB86, 0xFA1C, 0xFB87, 0x7AEB, 0xFB88, 0x7B9E, 0xFB89, 0xFA1D, 0xFB8A, 0x7D48, 0xFB8B, 0x7D5C, + 0xFB8C, 0x7DB7, 0xFB8D, 0x7DA0, 0xFB8E, 0x7DD6, 0xFB8F, 0x7E52, 0xFB90, 0x7F47, 0xFB91, 0x7FA1, 0xFB92, 0xFA1E, 0xFB93, 0x8301, + 0xFB94, 0x8362, 0xFB95, 0x837F, 0xFB96, 0x83C7, 0xFB97, 0x83F6, 0xFB98, 0x8448, 0xFB99, 0x84B4, 0xFB9A, 0x8553, 0xFB9B, 0x8559, + 0xFB9C, 0x856B, 0xFB9D, 0xFA1F, 0xFB9E, 0x85B0, 0xFB9F, 0xFA20, 0xFBA0, 0xFA21, 0xFBA1, 0x8807, 0xFBA2, 0x88F5, 0xFBA3, 0x8A12, + 0xFBA4, 0x8A37, 0xFBA5, 0x8A79, 0xFBA6, 0x8AA7, 0xFBA7, 0x8ABE, 0xFBA8, 0x8ADF, 0xFBA9, 0xFA22, 0xFBAA, 0x8AF6, 0xFBAB, 0x8B53, + 0xFBAC, 0x8B7F, 0xFBAD, 0x8CF0, 0xFBAE, 0x8CF4, 0xFBAF, 0x8D12, 0xFBB0, 0x8D76, 0xFBB1, 0xFA23, 0xFBB2, 0x8ECF, 0xFBB3, 0xFA24, + 0xFBB4, 0xFA25, 0xFBB5, 0x9067, 0xFBB6, 0x90DE, 0xFBB7, 0xFA26, 0xFBB8, 0x9115, 0xFBB9, 0x9127, 0xFBBA, 0x91DA, 0xFBBB, 0x91D7, + 0xFBBC, 0x91DE, 0xFBBD, 0x91ED, 0xFBBE, 0x91EE, 0xFBBF, 0x91E4, 0xFBC0, 0x91E5, 0xFBC1, 0x9206, 0xFBC2, 0x9210, 0xFBC3, 0x920A, + 0xFBC4, 0x923A, 0xFBC5, 0x9240, 0xFBC6, 0x923C, 0xFBC7, 0x924E, 0xFBC8, 0x9259, 0xFBC9, 0x9251, 0xFBCA, 0x9239, 0xFBCB, 0x9267, + 0xFBCC, 0x92A7, 0xFBCD, 0x9277, 0xFBCE, 0x9278, 0xFBCF, 0x92E7, 0xFBD0, 0x92D7, 0xFBD1, 0x92D9, 0xFBD2, 0x92D0, 0xFBD3, 0xFA27, + 0xFBD4, 0x92D5, 0xFBD5, 0x92E0, 0xFBD6, 0x92D3, 0xFBD7, 0x9325, 0xFBD8, 0x9321, 0xFBD9, 0x92FB, 0xFBDA, 0xFA28, 0xFBDB, 0x931E, + 0xFBDC, 0x92FF, 0xFBDD, 0x931D, 0xFBDE, 0x9302, 0xFBDF, 0x9370, 0xFBE0, 0x9357, 0xFBE1, 0x93A4, 0xFBE2, 0x93C6, 0xFBE3, 0x93DE, + 0xFBE4, 0x93F8, 0xFBE5, 0x9431, 0xFBE6, 0x9445, 0xFBE7, 0x9448, 0xFBE8, 0x9592, 0xFBE9, 0xF9DC, 0xFBEA, 0xFA29, 0xFBEB, 0x969D, + 0xFBEC, 0x96AF, 0xFBED, 0x9733, 0xFBEE, 0x973B, 0xFBEF, 0x9743, 0xFBF0, 0x974D, 0xFBF1, 0x974F, 0xFBF2, 0x9751, 0xFBF3, 0x9755, + 0xFBF4, 0x9857, 0xFBF5, 0x9865, 0xFBF6, 0xFA2A, 0xFBF7, 0xFA2B, 0xFBF8, 0x9927, 0xFBF9, 0xFA2C, 0xFBFA, 0x999E, 0xFBFB, 0x9A4E, + 0xFBFC, 0x9AD9, 0xFC40, 0x9ADC, 0xFC41, 0x9B75, 0xFC42, 0x9B72, 0xFC43, 0x9B8F, 0xFC44, 0x9BB1, 0xFC45, 0x9BBB, 0xFC46, 0x9C00, + 0xFC47, 0x9D70, 0xFC48, 0x9D6B, 0xFC49, 0xFA2D, 0xFC4A, 0x9E19, 0xFC4B, 0x9ED1, 0, 0 +}; +#endif + +#if FF_CODE_PAGE == 936 || FF_CODE_PAGE == 0 /* Simplified Chinese */ +static const WCHAR uni2oem936[] = { /* Unicode --> GBK pairs */ + 0x00A4, 0xA1E8, 0x00A7, 0xA1EC, 0x00A8, 0xA1A7, 0x00B0, 0xA1E3, 0x00B1, 0xA1C0, 0x00B7, 0xA1A4, 0x00D7, 0xA1C1, 0x00E0, 0xA8A4, + 0x00E1, 0xA8A2, 0x00E8, 0xA8A8, 0x00E9, 0xA8A6, 0x00EA, 0xA8BA, 0x00EC, 0xA8AC, 0x00ED, 0xA8AA, 0x00F2, 0xA8B0, 0x00F3, 0xA8AE, + 0x00F7, 0xA1C2, 0x00F9, 0xA8B4, 0x00FA, 0xA8B2, 0x00FC, 0xA8B9, 0x0101, 0xA8A1, 0x0113, 0xA8A5, 0x011B, 0xA8A7, 0x012B, 0xA8A9, + 0x0144, 0xA8BD, 0x0148, 0xA8BE, 0x014D, 0xA8AD, 0x016B, 0xA8B1, 0x01CE, 0xA8A3, 0x01D0, 0xA8AB, 0x01D2, 0xA8AF, 0x01D4, 0xA8B3, + 0x01D6, 0xA8B5, 0x01D8, 0xA8B6, 0x01DA, 0xA8B7, 0x01DC, 0xA8B8, 0x0251, 0xA8BB, 0x0261, 0xA8C0, 0x02C7, 0xA1A6, 0x02C9, 0xA1A5, + 0x02CA, 0xA840, 0x02CB, 0xA841, 0x02D9, 0xA842, 0x0391, 0xA6A1, 0x0392, 0xA6A2, 0x0393, 0xA6A3, 0x0394, 0xA6A4, 0x0395, 0xA6A5, + 0x0396, 0xA6A6, 0x0397, 0xA6A7, 0x0398, 0xA6A8, 0x0399, 0xA6A9, 0x039A, 0xA6AA, 0x039B, 0xA6AB, 0x039C, 0xA6AC, 0x039D, 0xA6AD, + 0x039E, 0xA6AE, 0x039F, 0xA6AF, 0x03A0, 0xA6B0, 0x03A1, 0xA6B1, 0x03A3, 0xA6B2, 0x03A4, 0xA6B3, 0x03A5, 0xA6B4, 0x03A6, 0xA6B5, + 0x03A7, 0xA6B6, 0x03A8, 0xA6B7, 0x03A9, 0xA6B8, 0x03B1, 0xA6C1, 0x03B2, 0xA6C2, 0x03B3, 0xA6C3, 0x03B4, 0xA6C4, 0x03B5, 0xA6C5, + 0x03B6, 0xA6C6, 0x03B7, 0xA6C7, 0x03B8, 0xA6C8, 0x03B9, 0xA6C9, 0x03BA, 0xA6CA, 0x03BB, 0xA6CB, 0x03BC, 0xA6CC, 0x03BD, 0xA6CD, + 0x03BE, 0xA6CE, 0x03BF, 0xA6CF, 0x03C0, 0xA6D0, 0x03C1, 0xA6D1, 0x03C3, 0xA6D2, 0x03C4, 0xA6D3, 0x03C5, 0xA6D4, 0x03C6, 0xA6D5, + 0x03C7, 0xA6D6, 0x03C8, 0xA6D7, 0x03C9, 0xA6D8, 0x0401, 0xA7A7, 0x0410, 0xA7A1, 0x0411, 0xA7A2, 0x0412, 0xA7A3, 0x0413, 0xA7A4, + 0x0414, 0xA7A5, 0x0415, 0xA7A6, 0x0416, 0xA7A8, 0x0417, 0xA7A9, 0x0418, 0xA7AA, 0x0419, 0xA7AB, 0x041A, 0xA7AC, 0x041B, 0xA7AD, + 0x041C, 0xA7AE, 0x041D, 0xA7AF, 0x041E, 0xA7B0, 0x041F, 0xA7B1, 0x0420, 0xA7B2, 0x0421, 0xA7B3, 0x0422, 0xA7B4, 0x0423, 0xA7B5, + 0x0424, 0xA7B6, 0x0425, 0xA7B7, 0x0426, 0xA7B8, 0x0427, 0xA7B9, 0x0428, 0xA7BA, 0x0429, 0xA7BB, 0x042A, 0xA7BC, 0x042B, 0xA7BD, + 0x042C, 0xA7BE, 0x042D, 0xA7BF, 0x042E, 0xA7C0, 0x042F, 0xA7C1, 0x0430, 0xA7D1, 0x0431, 0xA7D2, 0x0432, 0xA7D3, 0x0433, 0xA7D4, + 0x0434, 0xA7D5, 0x0435, 0xA7D6, 0x0436, 0xA7D8, 0x0437, 0xA7D9, 0x0438, 0xA7DA, 0x0439, 0xA7DB, 0x043A, 0xA7DC, 0x043B, 0xA7DD, + 0x043C, 0xA7DE, 0x043D, 0xA7DF, 0x043E, 0xA7E0, 0x043F, 0xA7E1, 0x0440, 0xA7E2, 0x0441, 0xA7E3, 0x0442, 0xA7E4, 0x0443, 0xA7E5, + 0x0444, 0xA7E6, 0x0445, 0xA7E7, 0x0446, 0xA7E8, 0x0447, 0xA7E9, 0x0448, 0xA7EA, 0x0449, 0xA7EB, 0x044A, 0xA7EC, 0x044B, 0xA7ED, + 0x044C, 0xA7EE, 0x044D, 0xA7EF, 0x044E, 0xA7F0, 0x044F, 0xA7F1, 0x0451, 0xA7D7, 0x2010, 0xA95C, 0x2013, 0xA843, 0x2014, 0xA1AA, + 0x2015, 0xA844, 0x2016, 0xA1AC, 0x2018, 0xA1AE, 0x2019, 0xA1AF, 0x201C, 0xA1B0, 0x201D, 0xA1B1, 0x2025, 0xA845, 0x2026, 0xA1AD, + 0x2030, 0xA1EB, 0x2032, 0xA1E4, 0x2033, 0xA1E5, 0x2035, 0xA846, 0x203B, 0xA1F9, 0x20AC, 0x0080, 0x2103, 0xA1E6, 0x2105, 0xA847, + 0x2109, 0xA848, 0x2116, 0xA1ED, 0x2121, 0xA959, 0x2160, 0xA2F1, 0x2161, 0xA2F2, 0x2162, 0xA2F3, 0x2163, 0xA2F4, 0x2164, 0xA2F5, + 0x2165, 0xA2F6, 0x2166, 0xA2F7, 0x2167, 0xA2F8, 0x2168, 0xA2F9, 0x2169, 0xA2FA, 0x216A, 0xA2FB, 0x216B, 0xA2FC, 0x2170, 0xA2A1, + 0x2171, 0xA2A2, 0x2172, 0xA2A3, 0x2173, 0xA2A4, 0x2174, 0xA2A5, 0x2175, 0xA2A6, 0x2176, 0xA2A7, 0x2177, 0xA2A8, 0x2178, 0xA2A9, + 0x2179, 0xA2AA, 0x2190, 0xA1FB, 0x2191, 0xA1FC, 0x2192, 0xA1FA, 0x2193, 0xA1FD, 0x2196, 0xA849, 0x2197, 0xA84A, 0x2198, 0xA84B, + 0x2199, 0xA84C, 0x2208, 0xA1CA, 0x220F, 0xA1C7, 0x2211, 0xA1C6, 0x2215, 0xA84D, 0x221A, 0xA1CC, 0x221D, 0xA1D8, 0x221E, 0xA1DE, + 0x221F, 0xA84E, 0x2220, 0xA1CF, 0x2223, 0xA84F, 0x2225, 0xA1CE, 0x2227, 0xA1C4, 0x2228, 0xA1C5, 0x2229, 0xA1C9, 0x222A, 0xA1C8, + 0x222B, 0xA1D2, 0x222E, 0xA1D3, 0x2234, 0xA1E0, 0x2235, 0xA1DF, 0x2236, 0xA1C3, 0x2237, 0xA1CB, 0x223D, 0xA1D7, 0x2248, 0xA1D6, + 0x224C, 0xA1D5, 0x2252, 0xA850, 0x2260, 0xA1D9, 0x2261, 0xA1D4, 0x2264, 0xA1DC, 0x2265, 0xA1DD, 0x2266, 0xA851, 0x2267, 0xA852, + 0x226E, 0xA1DA, 0x226F, 0xA1DB, 0x2295, 0xA892, 0x2299, 0xA1D1, 0x22A5, 0xA1CD, 0x22BF, 0xA853, 0x2312, 0xA1D0, 0x2460, 0xA2D9, + 0x2461, 0xA2DA, 0x2462, 0xA2DB, 0x2463, 0xA2DC, 0x2464, 0xA2DD, 0x2465, 0xA2DE, 0x2466, 0xA2DF, 0x2467, 0xA2E0, 0x2468, 0xA2E1, + 0x2469, 0xA2E2, 0x2474, 0xA2C5, 0x2475, 0xA2C6, 0x2476, 0xA2C7, 0x2477, 0xA2C8, 0x2478, 0xA2C9, 0x2479, 0xA2CA, 0x247A, 0xA2CB, + 0x247B, 0xA2CC, 0x247C, 0xA2CD, 0x247D, 0xA2CE, 0x247E, 0xA2CF, 0x247F, 0xA2D0, 0x2480, 0xA2D1, 0x2481, 0xA2D2, 0x2482, 0xA2D3, + 0x2483, 0xA2D4, 0x2484, 0xA2D5, 0x2485, 0xA2D6, 0x2486, 0xA2D7, 0x2487, 0xA2D8, 0x2488, 0xA2B1, 0x2489, 0xA2B2, 0x248A, 0xA2B3, + 0x248B, 0xA2B4, 0x248C, 0xA2B5, 0x248D, 0xA2B6, 0x248E, 0xA2B7, 0x248F, 0xA2B8, 0x2490, 0xA2B9, 0x2491, 0xA2BA, 0x2492, 0xA2BB, + 0x2493, 0xA2BC, 0x2494, 0xA2BD, 0x2495, 0xA2BE, 0x2496, 0xA2BF, 0x2497, 0xA2C0, 0x2498, 0xA2C1, 0x2499, 0xA2C2, 0x249A, 0xA2C3, + 0x249B, 0xA2C4, 0x2500, 0xA9A4, 0x2501, 0xA9A5, 0x2502, 0xA9A6, 0x2503, 0xA9A7, 0x2504, 0xA9A8, 0x2505, 0xA9A9, 0x2506, 0xA9AA, + 0x2507, 0xA9AB, 0x2508, 0xA9AC, 0x2509, 0xA9AD, 0x250A, 0xA9AE, 0x250B, 0xA9AF, 0x250C, 0xA9B0, 0x250D, 0xA9B1, 0x250E, 0xA9B2, + 0x250F, 0xA9B3, 0x2510, 0xA9B4, 0x2511, 0xA9B5, 0x2512, 0xA9B6, 0x2513, 0xA9B7, 0x2514, 0xA9B8, 0x2515, 0xA9B9, 0x2516, 0xA9BA, + 0x2517, 0xA9BB, 0x2518, 0xA9BC, 0x2519, 0xA9BD, 0x251A, 0xA9BE, 0x251B, 0xA9BF, 0x251C, 0xA9C0, 0x251D, 0xA9C1, 0x251E, 0xA9C2, + 0x251F, 0xA9C3, 0x2520, 0xA9C4, 0x2521, 0xA9C5, 0x2522, 0xA9C6, 0x2523, 0xA9C7, 0x2524, 0xA9C8, 0x2525, 0xA9C9, 0x2526, 0xA9CA, + 0x2527, 0xA9CB, 0x2528, 0xA9CC, 0x2529, 0xA9CD, 0x252A, 0xA9CE, 0x252B, 0xA9CF, 0x252C, 0xA9D0, 0x252D, 0xA9D1, 0x252E, 0xA9D2, + 0x252F, 0xA9D3, 0x2530, 0xA9D4, 0x2531, 0xA9D5, 0x2532, 0xA9D6, 0x2533, 0xA9D7, 0x2534, 0xA9D8, 0x2535, 0xA9D9, 0x2536, 0xA9DA, + 0x2537, 0xA9DB, 0x2538, 0xA9DC, 0x2539, 0xA9DD, 0x253A, 0xA9DE, 0x253B, 0xA9DF, 0x253C, 0xA9E0, 0x253D, 0xA9E1, 0x253E, 0xA9E2, + 0x253F, 0xA9E3, 0x2540, 0xA9E4, 0x2541, 0xA9E5, 0x2542, 0xA9E6, 0x2543, 0xA9E7, 0x2544, 0xA9E8, 0x2545, 0xA9E9, 0x2546, 0xA9EA, + 0x2547, 0xA9EB, 0x2548, 0xA9EC, 0x2549, 0xA9ED, 0x254A, 0xA9EE, 0x254B, 0xA9EF, 0x2550, 0xA854, 0x2551, 0xA855, 0x2552, 0xA856, + 0x2553, 0xA857, 0x2554, 0xA858, 0x2555, 0xA859, 0x2556, 0xA85A, 0x2557, 0xA85B, 0x2558, 0xA85C, 0x2559, 0xA85D, 0x255A, 0xA85E, + 0x255B, 0xA85F, 0x255C, 0xA860, 0x255D, 0xA861, 0x255E, 0xA862, 0x255F, 0xA863, 0x2560, 0xA864, 0x2561, 0xA865, 0x2562, 0xA866, + 0x2563, 0xA867, 0x2564, 0xA868, 0x2565, 0xA869, 0x2566, 0xA86A, 0x2567, 0xA86B, 0x2568, 0xA86C, 0x2569, 0xA86D, 0x256A, 0xA86E, + 0x256B, 0xA86F, 0x256C, 0xA870, 0x256D, 0xA871, 0x256E, 0xA872, 0x256F, 0xA873, 0x2570, 0xA874, 0x2571, 0xA875, 0x2572, 0xA876, + 0x2573, 0xA877, 0x2581, 0xA878, 0x2582, 0xA879, 0x2583, 0xA87A, 0x2584, 0xA87B, 0x2585, 0xA87C, 0x2586, 0xA87D, 0x2587, 0xA87E, + 0x2588, 0xA880, 0x2589, 0xA881, 0x258A, 0xA882, 0x258B, 0xA883, 0x258C, 0xA884, 0x258D, 0xA885, 0x258E, 0xA886, 0x258F, 0xA887, + 0x2593, 0xA888, 0x2594, 0xA889, 0x2595, 0xA88A, 0x25A0, 0xA1F6, 0x25A1, 0xA1F5, 0x25B2, 0xA1F8, 0x25B3, 0xA1F7, 0x25BC, 0xA88B, + 0x25BD, 0xA88C, 0x25C6, 0xA1F4, 0x25C7, 0xA1F3, 0x25CB, 0xA1F0, 0x25CE, 0xA1F2, 0x25CF, 0xA1F1, 0x25E2, 0xA88D, 0x25E3, 0xA88E, + 0x25E4, 0xA88F, 0x25E5, 0xA890, 0x2605, 0xA1EF, 0x2606, 0xA1EE, 0x2609, 0xA891, 0x2640, 0xA1E2, 0x2642, 0xA1E1, 0x3000, 0xA1A1, + 0x3001, 0xA1A2, 0x3002, 0xA1A3, 0x3003, 0xA1A8, 0x3005, 0xA1A9, 0x3006, 0xA965, 0x3007, 0xA996, 0x3008, 0xA1B4, 0x3009, 0xA1B5, + 0x300A, 0xA1B6, 0x300B, 0xA1B7, 0x300C, 0xA1B8, 0x300D, 0xA1B9, 0x300E, 0xA1BA, 0x300F, 0xA1BB, 0x3010, 0xA1BE, 0x3011, 0xA1BF, + 0x3012, 0xA893, 0x3013, 0xA1FE, 0x3014, 0xA1B2, 0x3015, 0xA1B3, 0x3016, 0xA1BC, 0x3017, 0xA1BD, 0x301D, 0xA894, 0x301E, 0xA895, + 0x3021, 0xA940, 0x3022, 0xA941, 0x3023, 0xA942, 0x3024, 0xA943, 0x3025, 0xA944, 0x3026, 0xA945, 0x3027, 0xA946, 0x3028, 0xA947, + 0x3029, 0xA948, 0x3041, 0xA4A1, 0x3042, 0xA4A2, 0x3043, 0xA4A3, 0x3044, 0xA4A4, 0x3045, 0xA4A5, 0x3046, 0xA4A6, 0x3047, 0xA4A7, + 0x3048, 0xA4A8, 0x3049, 0xA4A9, 0x304A, 0xA4AA, 0x304B, 0xA4AB, 0x304C, 0xA4AC, 0x304D, 0xA4AD, 0x304E, 0xA4AE, 0x304F, 0xA4AF, + 0x3050, 0xA4B0, 0x3051, 0xA4B1, 0x3052, 0xA4B2, 0x3053, 0xA4B3, 0x3054, 0xA4B4, 0x3055, 0xA4B5, 0x3056, 0xA4B6, 0x3057, 0xA4B7, + 0x3058, 0xA4B8, 0x3059, 0xA4B9, 0x305A, 0xA4BA, 0x305B, 0xA4BB, 0x305C, 0xA4BC, 0x305D, 0xA4BD, 0x305E, 0xA4BE, 0x305F, 0xA4BF, + 0x3060, 0xA4C0, 0x3061, 0xA4C1, 0x3062, 0xA4C2, 0x3063, 0xA4C3, 0x3064, 0xA4C4, 0x3065, 0xA4C5, 0x3066, 0xA4C6, 0x3067, 0xA4C7, + 0x3068, 0xA4C8, 0x3069, 0xA4C9, 0x306A, 0xA4CA, 0x306B, 0xA4CB, 0x306C, 0xA4CC, 0x306D, 0xA4CD, 0x306E, 0xA4CE, 0x306F, 0xA4CF, + 0x3070, 0xA4D0, 0x3071, 0xA4D1, 0x3072, 0xA4D2, 0x3073, 0xA4D3, 0x3074, 0xA4D4, 0x3075, 0xA4D5, 0x3076, 0xA4D6, 0x3077, 0xA4D7, + 0x3078, 0xA4D8, 0x3079, 0xA4D9, 0x307A, 0xA4DA, 0x307B, 0xA4DB, 0x307C, 0xA4DC, 0x307D, 0xA4DD, 0x307E, 0xA4DE, 0x307F, 0xA4DF, + 0x3080, 0xA4E0, 0x3081, 0xA4E1, 0x3082, 0xA4E2, 0x3083, 0xA4E3, 0x3084, 0xA4E4, 0x3085, 0xA4E5, 0x3086, 0xA4E6, 0x3087, 0xA4E7, + 0x3088, 0xA4E8, 0x3089, 0xA4E9, 0x308A, 0xA4EA, 0x308B, 0xA4EB, 0x308C, 0xA4EC, 0x308D, 0xA4ED, 0x308E, 0xA4EE, 0x308F, 0xA4EF, + 0x3090, 0xA4F0, 0x3091, 0xA4F1, 0x3092, 0xA4F2, 0x3093, 0xA4F3, 0x309B, 0xA961, 0x309C, 0xA962, 0x309D, 0xA966, 0x309E, 0xA967, + 0x30A1, 0xA5A1, 0x30A2, 0xA5A2, 0x30A3, 0xA5A3, 0x30A4, 0xA5A4, 0x30A5, 0xA5A5, 0x30A6, 0xA5A6, 0x30A7, 0xA5A7, 0x30A8, 0xA5A8, + 0x30A9, 0xA5A9, 0x30AA, 0xA5AA, 0x30AB, 0xA5AB, 0x30AC, 0xA5AC, 0x30AD, 0xA5AD, 0x30AE, 0xA5AE, 0x30AF, 0xA5AF, 0x30B0, 0xA5B0, + 0x30B1, 0xA5B1, 0x30B2, 0xA5B2, 0x30B3, 0xA5B3, 0x30B4, 0xA5B4, 0x30B5, 0xA5B5, 0x30B6, 0xA5B6, 0x30B7, 0xA5B7, 0x30B8, 0xA5B8, + 0x30B9, 0xA5B9, 0x30BA, 0xA5BA, 0x30BB, 0xA5BB, 0x30BC, 0xA5BC, 0x30BD, 0xA5BD, 0x30BE, 0xA5BE, 0x30BF, 0xA5BF, 0x30C0, 0xA5C0, + 0x30C1, 0xA5C1, 0x30C2, 0xA5C2, 0x30C3, 0xA5C3, 0x30C4, 0xA5C4, 0x30C5, 0xA5C5, 0x30C6, 0xA5C6, 0x30C7, 0xA5C7, 0x30C8, 0xA5C8, + 0x30C9, 0xA5C9, 0x30CA, 0xA5CA, 0x30CB, 0xA5CB, 0x30CC, 0xA5CC, 0x30CD, 0xA5CD, 0x30CE, 0xA5CE, 0x30CF, 0xA5CF, 0x30D0, 0xA5D0, + 0x30D1, 0xA5D1, 0x30D2, 0xA5D2, 0x30D3, 0xA5D3, 0x30D4, 0xA5D4, 0x30D5, 0xA5D5, 0x30D6, 0xA5D6, 0x30D7, 0xA5D7, 0x30D8, 0xA5D8, + 0x30D9, 0xA5D9, 0x30DA, 0xA5DA, 0x30DB, 0xA5DB, 0x30DC, 0xA5DC, 0x30DD, 0xA5DD, 0x30DE, 0xA5DE, 0x30DF, 0xA5DF, 0x30E0, 0xA5E0, + 0x30E1, 0xA5E1, 0x30E2, 0xA5E2, 0x30E3, 0xA5E3, 0x30E4, 0xA5E4, 0x30E5, 0xA5E5, 0x30E6, 0xA5E6, 0x30E7, 0xA5E7, 0x30E8, 0xA5E8, + 0x30E9, 0xA5E9, 0x30EA, 0xA5EA, 0x30EB, 0xA5EB, 0x30EC, 0xA5EC, 0x30ED, 0xA5ED, 0x30EE, 0xA5EE, 0x30EF, 0xA5EF, 0x30F0, 0xA5F0, + 0x30F1, 0xA5F1, 0x30F2, 0xA5F2, 0x30F3, 0xA5F3, 0x30F4, 0xA5F4, 0x30F5, 0xA5F5, 0x30F6, 0xA5F6, 0x30FC, 0xA960, 0x30FD, 0xA963, + 0x30FE, 0xA964, 0x3105, 0xA8C5, 0x3106, 0xA8C6, 0x3107, 0xA8C7, 0x3108, 0xA8C8, 0x3109, 0xA8C9, 0x310A, 0xA8CA, 0x310B, 0xA8CB, + 0x310C, 0xA8CC, 0x310D, 0xA8CD, 0x310E, 0xA8CE, 0x310F, 0xA8CF, 0x3110, 0xA8D0, 0x3111, 0xA8D1, 0x3112, 0xA8D2, 0x3113, 0xA8D3, + 0x3114, 0xA8D4, 0x3115, 0xA8D5, 0x3116, 0xA8D6, 0x3117, 0xA8D7, 0x3118, 0xA8D8, 0x3119, 0xA8D9, 0x311A, 0xA8DA, 0x311B, 0xA8DB, + 0x311C, 0xA8DC, 0x311D, 0xA8DD, 0x311E, 0xA8DE, 0x311F, 0xA8DF, 0x3120, 0xA8E0, 0x3121, 0xA8E1, 0x3122, 0xA8E2, 0x3123, 0xA8E3, + 0x3124, 0xA8E4, 0x3125, 0xA8E5, 0x3126, 0xA8E6, 0x3127, 0xA8E7, 0x3128, 0xA8E8, 0x3129, 0xA8E9, 0x3220, 0xA2E5, 0x3221, 0xA2E6, + 0x3222, 0xA2E7, 0x3223, 0xA2E8, 0x3224, 0xA2E9, 0x3225, 0xA2EA, 0x3226, 0xA2EB, 0x3227, 0xA2EC, 0x3228, 0xA2ED, 0x3229, 0xA2EE, + 0x3231, 0xA95A, 0x32A3, 0xA949, 0x338E, 0xA94A, 0x338F, 0xA94B, 0x339C, 0xA94C, 0x339D, 0xA94D, 0x339E, 0xA94E, 0x33A1, 0xA94F, + 0x33C4, 0xA950, 0x33CE, 0xA951, 0x33D1, 0xA952, 0x33D2, 0xA953, 0x33D5, 0xA954, 0x4E00, 0xD2BB, 0x4E01, 0xB6A1, 0x4E02, 0x8140, + 0x4E03, 0xC6DF, 0x4E04, 0x8141, 0x4E05, 0x8142, 0x4E06, 0x8143, 0x4E07, 0xCDF2, 0x4E08, 0xD5C9, 0x4E09, 0xC8FD, 0x4E0A, 0xC9CF, + 0x4E0B, 0xCFC2, 0x4E0C, 0xD8A2, 0x4E0D, 0xB2BB, 0x4E0E, 0xD3EB, 0x4E0F, 0x8144, 0x4E10, 0xD8A4, 0x4E11, 0xB3F3, 0x4E12, 0x8145, + 0x4E13, 0xD7A8, 0x4E14, 0xC7D2, 0x4E15, 0xD8A7, 0x4E16, 0xCAC0, 0x4E17, 0x8146, 0x4E18, 0xC7F0, 0x4E19, 0xB1FB, 0x4E1A, 0xD2B5, + 0x4E1B, 0xB4D4, 0x4E1C, 0xB6AB, 0x4E1D, 0xCBBF, 0x4E1E, 0xD8A9, 0x4E1F, 0x8147, 0x4E20, 0x8148, 0x4E21, 0x8149, 0x4E22, 0xB6AA, + 0x4E23, 0x814A, 0x4E24, 0xC1BD, 0x4E25, 0xD1CF, 0x4E26, 0x814B, 0x4E27, 0xC9A5, 0x4E28, 0xD8AD, 0x4E29, 0x814C, 0x4E2A, 0xB8F6, + 0x4E2B, 0xD1BE, 0x4E2C, 0xE3DC, 0x4E2D, 0xD6D0, 0x4E2E, 0x814D, 0x4E2F, 0x814E, 0x4E30, 0xB7E1, 0x4E31, 0x814F, 0x4E32, 0xB4AE, + 0x4E33, 0x8150, 0x4E34, 0xC1D9, 0x4E35, 0x8151, 0x4E36, 0xD8BC, 0x4E37, 0x8152, 0x4E38, 0xCDE8, 0x4E39, 0xB5A4, 0x4E3A, 0xCEAA, + 0x4E3B, 0xD6F7, 0x4E3C, 0x8153, 0x4E3D, 0xC0F6, 0x4E3E, 0xBED9, 0x4E3F, 0xD8AF, 0x4E40, 0x8154, 0x4E41, 0x8155, 0x4E42, 0x8156, + 0x4E43, 0xC4CB, 0x4E44, 0x8157, 0x4E45, 0xBEC3, 0x4E46, 0x8158, 0x4E47, 0xD8B1, 0x4E48, 0xC3B4, 0x4E49, 0xD2E5, 0x4E4A, 0x8159, + 0x4E4B, 0xD6AE, 0x4E4C, 0xCEDA, 0x4E4D, 0xD5A7, 0x4E4E, 0xBAF5, 0x4E4F, 0xB7A6, 0x4E50, 0xC0D6, 0x4E51, 0x815A, 0x4E52, 0xC6B9, + 0x4E53, 0xC5D2, 0x4E54, 0xC7C7, 0x4E55, 0x815B, 0x4E56, 0xB9D4, 0x4E57, 0x815C, 0x4E58, 0xB3CB, 0x4E59, 0xD2D2, 0x4E5A, 0x815D, + 0x4E5B, 0x815E, 0x4E5C, 0xD8BF, 0x4E5D, 0xBEC5, 0x4E5E, 0xC6F2, 0x4E5F, 0xD2B2, 0x4E60, 0xCFB0, 0x4E61, 0xCFE7, 0x4E62, 0x815F, + 0x4E63, 0x8160, 0x4E64, 0x8161, 0x4E65, 0x8162, 0x4E66, 0xCAE9, 0x4E67, 0x8163, 0x4E68, 0x8164, 0x4E69, 0xD8C0, 0x4E6A, 0x8165, + 0x4E6B, 0x8166, 0x4E6C, 0x8167, 0x4E6D, 0x8168, 0x4E6E, 0x8169, 0x4E6F, 0x816A, 0x4E70, 0xC2F2, 0x4E71, 0xC2D2, 0x4E72, 0x816B, + 0x4E73, 0xC8E9, 0x4E74, 0x816C, 0x4E75, 0x816D, 0x4E76, 0x816E, 0x4E77, 0x816F, 0x4E78, 0x8170, 0x4E79, 0x8171, 0x4E7A, 0x8172, + 0x4E7B, 0x8173, 0x4E7C, 0x8174, 0x4E7D, 0x8175, 0x4E7E, 0xC7AC, 0x4E7F, 0x8176, 0x4E80, 0x8177, 0x4E81, 0x8178, 0x4E82, 0x8179, + 0x4E83, 0x817A, 0x4E84, 0x817B, 0x4E85, 0x817C, 0x4E86, 0xC1CB, 0x4E87, 0x817D, 0x4E88, 0xD3E8, 0x4E89, 0xD5F9, 0x4E8A, 0x817E, + 0x4E8B, 0xCAC2, 0x4E8C, 0xB6FE, 0x4E8D, 0xD8A1, 0x4E8E, 0xD3DA, 0x4E8F, 0xBFF7, 0x4E90, 0x8180, 0x4E91, 0xD4C6, 0x4E92, 0xBBA5, + 0x4E93, 0xD8C1, 0x4E94, 0xCEE5, 0x4E95, 0xBEAE, 0x4E96, 0x8181, 0x4E97, 0x8182, 0x4E98, 0xD8A8, 0x4E99, 0x8183, 0x4E9A, 0xD1C7, + 0x4E9B, 0xD0A9, 0x4E9C, 0x8184, 0x4E9D, 0x8185, 0x4E9E, 0x8186, 0x4E9F, 0xD8BD, 0x4EA0, 0xD9EF, 0x4EA1, 0xCDF6, 0x4EA2, 0xBFBA, + 0x4EA3, 0x8187, 0x4EA4, 0xBDBB, 0x4EA5, 0xBAA5, 0x4EA6, 0xD2E0, 0x4EA7, 0xB2FA, 0x4EA8, 0xBAE0, 0x4EA9, 0xC4B6, 0x4EAA, 0x8188, + 0x4EAB, 0xCFED, 0x4EAC, 0xBEA9, 0x4EAD, 0xCDA4, 0x4EAE, 0xC1C1, 0x4EAF, 0x8189, 0x4EB0, 0x818A, 0x4EB1, 0x818B, 0x4EB2, 0xC7D7, + 0x4EB3, 0xD9F1, 0x4EB4, 0x818C, 0x4EB5, 0xD9F4, 0x4EB6, 0x818D, 0x4EB7, 0x818E, 0x4EB8, 0x818F, 0x4EB9, 0x8190, 0x4EBA, 0xC8CB, + 0x4EBB, 0xD8E9, 0x4EBC, 0x8191, 0x4EBD, 0x8192, 0x4EBE, 0x8193, 0x4EBF, 0xD2DA, 0x4EC0, 0xCAB2, 0x4EC1, 0xC8CA, 0x4EC2, 0xD8EC, + 0x4EC3, 0xD8EA, 0x4EC4, 0xD8C6, 0x4EC5, 0xBDF6, 0x4EC6, 0xC6CD, 0x4EC7, 0xB3F0, 0x4EC8, 0x8194, 0x4EC9, 0xD8EB, 0x4ECA, 0xBDF1, + 0x4ECB, 0xBDE9, 0x4ECC, 0x8195, 0x4ECD, 0xC8D4, 0x4ECE, 0xB4D3, 0x4ECF, 0x8196, 0x4ED0, 0x8197, 0x4ED1, 0xC2D8, 0x4ED2, 0x8198, + 0x4ED3, 0xB2D6, 0x4ED4, 0xD7D0, 0x4ED5, 0xCACB, 0x4ED6, 0xCBFB, 0x4ED7, 0xD5CC, 0x4ED8, 0xB8B6, 0x4ED9, 0xCFC9, 0x4EDA, 0x8199, + 0x4EDB, 0x819A, 0x4EDC, 0x819B, 0x4EDD, 0xD9DA, 0x4EDE, 0xD8F0, 0x4EDF, 0xC7AA, 0x4EE0, 0x819C, 0x4EE1, 0xD8EE, 0x4EE2, 0x819D, + 0x4EE3, 0xB4FA, 0x4EE4, 0xC1EE, 0x4EE5, 0xD2D4, 0x4EE6, 0x819E, 0x4EE7, 0x819F, 0x4EE8, 0xD8ED, 0x4EE9, 0x81A0, 0x4EEA, 0xD2C7, + 0x4EEB, 0xD8EF, 0x4EEC, 0xC3C7, 0x4EED, 0x81A1, 0x4EEE, 0x81A2, 0x4EEF, 0x81A3, 0x4EF0, 0xD1F6, 0x4EF1, 0x81A4, 0x4EF2, 0xD6D9, + 0x4EF3, 0xD8F2, 0x4EF4, 0x81A5, 0x4EF5, 0xD8F5, 0x4EF6, 0xBCFE, 0x4EF7, 0xBCDB, 0x4EF8, 0x81A6, 0x4EF9, 0x81A7, 0x4EFA, 0x81A8, + 0x4EFB, 0xC8CE, 0x4EFC, 0x81A9, 0x4EFD, 0xB7DD, 0x4EFE, 0x81AA, 0x4EFF, 0xB7C2, 0x4F00, 0x81AB, 0x4F01, 0xC6F3, 0x4F02, 0x81AC, + 0x4F03, 0x81AD, 0x4F04, 0x81AE, 0x4F05, 0x81AF, 0x4F06, 0x81B0, 0x4F07, 0x81B1, 0x4F08, 0x81B2, 0x4F09, 0xD8F8, 0x4F0A, 0xD2C1, + 0x4F0B, 0x81B3, 0x4F0C, 0x81B4, 0x4F0D, 0xCEE9, 0x4F0E, 0xBCBF, 0x4F0F, 0xB7FC, 0x4F10, 0xB7A5, 0x4F11, 0xD0DD, 0x4F12, 0x81B5, + 0x4F13, 0x81B6, 0x4F14, 0x81B7, 0x4F15, 0x81B8, 0x4F16, 0x81B9, 0x4F17, 0xD6DA, 0x4F18, 0xD3C5, 0x4F19, 0xBBEF, 0x4F1A, 0xBBE1, + 0x4F1B, 0xD8F1, 0x4F1C, 0x81BA, 0x4F1D, 0x81BB, 0x4F1E, 0xC9A1, 0x4F1F, 0xCEB0, 0x4F20, 0xB4AB, 0x4F21, 0x81BC, 0x4F22, 0xD8F3, + 0x4F23, 0x81BD, 0x4F24, 0xC9CB, 0x4F25, 0xD8F6, 0x4F26, 0xC2D7, 0x4F27, 0xD8F7, 0x4F28, 0x81BE, 0x4F29, 0x81BF, 0x4F2A, 0xCEB1, + 0x4F2B, 0xD8F9, 0x4F2C, 0x81C0, 0x4F2D, 0x81C1, 0x4F2E, 0x81C2, 0x4F2F, 0xB2AE, 0x4F30, 0xB9C0, 0x4F31, 0x81C3, 0x4F32, 0xD9A3, + 0x4F33, 0x81C4, 0x4F34, 0xB0E9, 0x4F35, 0x81C5, 0x4F36, 0xC1E6, 0x4F37, 0x81C6, 0x4F38, 0xC9EC, 0x4F39, 0x81C7, 0x4F3A, 0xCBC5, + 0x4F3B, 0x81C8, 0x4F3C, 0xCBC6, 0x4F3D, 0xD9A4, 0x4F3E, 0x81C9, 0x4F3F, 0x81CA, 0x4F40, 0x81CB, 0x4F41, 0x81CC, 0x4F42, 0x81CD, + 0x4F43, 0xB5E8, 0x4F44, 0x81CE, 0x4F45, 0x81CF, 0x4F46, 0xB5AB, 0x4F47, 0x81D0, 0x4F48, 0x81D1, 0x4F49, 0x81D2, 0x4F4A, 0x81D3, + 0x4F4B, 0x81D4, 0x4F4C, 0x81D5, 0x4F4D, 0xCEBB, 0x4F4E, 0xB5CD, 0x4F4F, 0xD7A1, 0x4F50, 0xD7F4, 0x4F51, 0xD3D3, 0x4F52, 0x81D6, + 0x4F53, 0xCCE5, 0x4F54, 0x81D7, 0x4F55, 0xBACE, 0x4F56, 0x81D8, 0x4F57, 0xD9A2, 0x4F58, 0xD9DC, 0x4F59, 0xD3E0, 0x4F5A, 0xD8FD, + 0x4F5B, 0xB7F0, 0x4F5C, 0xD7F7, 0x4F5D, 0xD8FE, 0x4F5E, 0xD8FA, 0x4F5F, 0xD9A1, 0x4F60, 0xC4E3, 0x4F61, 0x81D9, 0x4F62, 0x81DA, + 0x4F63, 0xD3B6, 0x4F64, 0xD8F4, 0x4F65, 0xD9DD, 0x4F66, 0x81DB, 0x4F67, 0xD8FB, 0x4F68, 0x81DC, 0x4F69, 0xC5E5, 0x4F6A, 0x81DD, + 0x4F6B, 0x81DE, 0x4F6C, 0xC0D0, 0x4F6D, 0x81DF, 0x4F6E, 0x81E0, 0x4F6F, 0xD1F0, 0x4F70, 0xB0DB, 0x4F71, 0x81E1, 0x4F72, 0x81E2, + 0x4F73, 0xBCD1, 0x4F74, 0xD9A6, 0x4F75, 0x81E3, 0x4F76, 0xD9A5, 0x4F77, 0x81E4, 0x4F78, 0x81E5, 0x4F79, 0x81E6, 0x4F7A, 0x81E7, + 0x4F7B, 0xD9AC, 0x4F7C, 0xD9AE, 0x4F7D, 0x81E8, 0x4F7E, 0xD9AB, 0x4F7F, 0xCAB9, 0x4F80, 0x81E9, 0x4F81, 0x81EA, 0x4F82, 0x81EB, + 0x4F83, 0xD9A9, 0x4F84, 0xD6B6, 0x4F85, 0x81EC, 0x4F86, 0x81ED, 0x4F87, 0x81EE, 0x4F88, 0xB3DE, 0x4F89, 0xD9A8, 0x4F8A, 0x81EF, + 0x4F8B, 0xC0FD, 0x4F8C, 0x81F0, 0x4F8D, 0xCACC, 0x4F8E, 0x81F1, 0x4F8F, 0xD9AA, 0x4F90, 0x81F2, 0x4F91, 0xD9A7, 0x4F92, 0x81F3, + 0x4F93, 0x81F4, 0x4F94, 0xD9B0, 0x4F95, 0x81F5, 0x4F96, 0x81F6, 0x4F97, 0xB6B1, 0x4F98, 0x81F7, 0x4F99, 0x81F8, 0x4F9A, 0x81F9, + 0x4F9B, 0xB9A9, 0x4F9C, 0x81FA, 0x4F9D, 0xD2C0, 0x4F9E, 0x81FB, 0x4F9F, 0x81FC, 0x4FA0, 0xCFC0, 0x4FA1, 0x81FD, 0x4FA2, 0x81FE, + 0x4FA3, 0xC2C2, 0x4FA4, 0x8240, 0x4FA5, 0xBDC4, 0x4FA6, 0xD5EC, 0x4FA7, 0xB2E0, 0x4FA8, 0xC7C8, 0x4FA9, 0xBFEB, 0x4FAA, 0xD9AD, + 0x4FAB, 0x8241, 0x4FAC, 0xD9AF, 0x4FAD, 0x8242, 0x4FAE, 0xCEEA, 0x4FAF, 0xBAEE, 0x4FB0, 0x8243, 0x4FB1, 0x8244, 0x4FB2, 0x8245, + 0x4FB3, 0x8246, 0x4FB4, 0x8247, 0x4FB5, 0xC7D6, 0x4FB6, 0x8248, 0x4FB7, 0x8249, 0x4FB8, 0x824A, 0x4FB9, 0x824B, 0x4FBA, 0x824C, + 0x4FBB, 0x824D, 0x4FBC, 0x824E, 0x4FBD, 0x824F, 0x4FBE, 0x8250, 0x4FBF, 0xB1E3, 0x4FC0, 0x8251, 0x4FC1, 0x8252, 0x4FC2, 0x8253, + 0x4FC3, 0xB4D9, 0x4FC4, 0xB6ED, 0x4FC5, 0xD9B4, 0x4FC6, 0x8254, 0x4FC7, 0x8255, 0x4FC8, 0x8256, 0x4FC9, 0x8257, 0x4FCA, 0xBFA1, + 0x4FCB, 0x8258, 0x4FCC, 0x8259, 0x4FCD, 0x825A, 0x4FCE, 0xD9DE, 0x4FCF, 0xC7CE, 0x4FD0, 0xC0FE, 0x4FD1, 0xD9B8, 0x4FD2, 0x825B, + 0x4FD3, 0x825C, 0x4FD4, 0x825D, 0x4FD5, 0x825E, 0x4FD6, 0x825F, 0x4FD7, 0xCBD7, 0x4FD8, 0xB7FD, 0x4FD9, 0x8260, 0x4FDA, 0xD9B5, + 0x4FDB, 0x8261, 0x4FDC, 0xD9B7, 0x4FDD, 0xB1A3, 0x4FDE, 0xD3E1, 0x4FDF, 0xD9B9, 0x4FE0, 0x8262, 0x4FE1, 0xD0C5, 0x4FE2, 0x8263, + 0x4FE3, 0xD9B6, 0x4FE4, 0x8264, 0x4FE5, 0x8265, 0x4FE6, 0xD9B1, 0x4FE7, 0x8266, 0x4FE8, 0xD9B2, 0x4FE9, 0xC1A9, 0x4FEA, 0xD9B3, + 0x4FEB, 0x8267, 0x4FEC, 0x8268, 0x4FED, 0xBCF3, 0x4FEE, 0xD0DE, 0x4FEF, 0xB8A9, 0x4FF0, 0x8269, 0x4FF1, 0xBEE3, 0x4FF2, 0x826A, + 0x4FF3, 0xD9BD, 0x4FF4, 0x826B, 0x4FF5, 0x826C, 0x4FF6, 0x826D, 0x4FF7, 0x826E, 0x4FF8, 0xD9BA, 0x4FF9, 0x826F, 0x4FFA, 0xB0B3, + 0x4FFB, 0x8270, 0x4FFC, 0x8271, 0x4FFD, 0x8272, 0x4FFE, 0xD9C2, 0x4FFF, 0x8273, 0x5000, 0x8274, 0x5001, 0x8275, 0x5002, 0x8276, + 0x5003, 0x8277, 0x5004, 0x8278, 0x5005, 0x8279, 0x5006, 0x827A, 0x5007, 0x827B, 0x5008, 0x827C, 0x5009, 0x827D, 0x500A, 0x827E, + 0x500B, 0x8280, 0x500C, 0xD9C4, 0x500D, 0xB1B6, 0x500E, 0x8281, 0x500F, 0xD9BF, 0x5010, 0x8282, 0x5011, 0x8283, 0x5012, 0xB5B9, + 0x5013, 0x8284, 0x5014, 0xBEF3, 0x5015, 0x8285, 0x5016, 0x8286, 0x5017, 0x8287, 0x5018, 0xCCC8, 0x5019, 0xBAF2, 0x501A, 0xD2D0, + 0x501B, 0x8288, 0x501C, 0xD9C3, 0x501D, 0x8289, 0x501E, 0x828A, 0x501F, 0xBDE8, 0x5020, 0x828B, 0x5021, 0xB3AB, 0x5022, 0x828C, + 0x5023, 0x828D, 0x5024, 0x828E, 0x5025, 0xD9C5, 0x5026, 0xBEEB, 0x5027, 0x828F, 0x5028, 0xD9C6, 0x5029, 0xD9BB, 0x502A, 0xC4DF, + 0x502B, 0x8290, 0x502C, 0xD9BE, 0x502D, 0xD9C1, 0x502E, 0xD9C0, 0x502F, 0x8291, 0x5030, 0x8292, 0x5031, 0x8293, 0x5032, 0x8294, + 0x5033, 0x8295, 0x5034, 0x8296, 0x5035, 0x8297, 0x5036, 0x8298, 0x5037, 0x8299, 0x5038, 0x829A, 0x5039, 0x829B, 0x503A, 0xD5AE, + 0x503B, 0x829C, 0x503C, 0xD6B5, 0x503D, 0x829D, 0x503E, 0xC7E3, 0x503F, 0x829E, 0x5040, 0x829F, 0x5041, 0x82A0, 0x5042, 0x82A1, + 0x5043, 0xD9C8, 0x5044, 0x82A2, 0x5045, 0x82A3, 0x5046, 0x82A4, 0x5047, 0xBCD9, 0x5048, 0xD9CA, 0x5049, 0x82A5, 0x504A, 0x82A6, + 0x504B, 0x82A7, 0x504C, 0xD9BC, 0x504D, 0x82A8, 0x504E, 0xD9CB, 0x504F, 0xC6AB, 0x5050, 0x82A9, 0x5051, 0x82AA, 0x5052, 0x82AB, + 0x5053, 0x82AC, 0x5054, 0x82AD, 0x5055, 0xD9C9, 0x5056, 0x82AE, 0x5057, 0x82AF, 0x5058, 0x82B0, 0x5059, 0x82B1, 0x505A, 0xD7F6, + 0x505B, 0x82B2, 0x505C, 0xCDA3, 0x505D, 0x82B3, 0x505E, 0x82B4, 0x505F, 0x82B5, 0x5060, 0x82B6, 0x5061, 0x82B7, 0x5062, 0x82B8, + 0x5063, 0x82B9, 0x5064, 0x82BA, 0x5065, 0xBDA1, 0x5066, 0x82BB, 0x5067, 0x82BC, 0x5068, 0x82BD, 0x5069, 0x82BE, 0x506A, 0x82BF, + 0x506B, 0x82C0, 0x506C, 0xD9CC, 0x506D, 0x82C1, 0x506E, 0x82C2, 0x506F, 0x82C3, 0x5070, 0x82C4, 0x5071, 0x82C5, 0x5072, 0x82C6, + 0x5073, 0x82C7, 0x5074, 0x82C8, 0x5075, 0x82C9, 0x5076, 0xC5BC, 0x5077, 0xCDB5, 0x5078, 0x82CA, 0x5079, 0x82CB, 0x507A, 0x82CC, + 0x507B, 0xD9CD, 0x507C, 0x82CD, 0x507D, 0x82CE, 0x507E, 0xD9C7, 0x507F, 0xB3A5, 0x5080, 0xBFFE, 0x5081, 0x82CF, 0x5082, 0x82D0, + 0x5083, 0x82D1, 0x5084, 0x82D2, 0x5085, 0xB8B5, 0x5086, 0x82D3, 0x5087, 0x82D4, 0x5088, 0xC0FC, 0x5089, 0x82D5, 0x508A, 0x82D6, + 0x508B, 0x82D7, 0x508C, 0x82D8, 0x508D, 0xB0F8, 0x508E, 0x82D9, 0x508F, 0x82DA, 0x5090, 0x82DB, 0x5091, 0x82DC, 0x5092, 0x82DD, + 0x5093, 0x82DE, 0x5094, 0x82DF, 0x5095, 0x82E0, 0x5096, 0x82E1, 0x5097, 0x82E2, 0x5098, 0x82E3, 0x5099, 0x82E4, 0x509A, 0x82E5, + 0x509B, 0x82E6, 0x509C, 0x82E7, 0x509D, 0x82E8, 0x509E, 0x82E9, 0x509F, 0x82EA, 0x50A0, 0x82EB, 0x50A1, 0x82EC, 0x50A2, 0x82ED, + 0x50A3, 0xB4F6, 0x50A4, 0x82EE, 0x50A5, 0xD9CE, 0x50A6, 0x82EF, 0x50A7, 0xD9CF, 0x50A8, 0xB4A2, 0x50A9, 0xD9D0, 0x50AA, 0x82F0, + 0x50AB, 0x82F1, 0x50AC, 0xB4DF, 0x50AD, 0x82F2, 0x50AE, 0x82F3, 0x50AF, 0x82F4, 0x50B0, 0x82F5, 0x50B1, 0x82F6, 0x50B2, 0xB0C1, + 0x50B3, 0x82F7, 0x50B4, 0x82F8, 0x50B5, 0x82F9, 0x50B6, 0x82FA, 0x50B7, 0x82FB, 0x50B8, 0x82FC, 0x50B9, 0x82FD, 0x50BA, 0xD9D1, + 0x50BB, 0xC9B5, 0x50BC, 0x82FE, 0x50BD, 0x8340, 0x50BE, 0x8341, 0x50BF, 0x8342, 0x50C0, 0x8343, 0x50C1, 0x8344, 0x50C2, 0x8345, + 0x50C3, 0x8346, 0x50C4, 0x8347, 0x50C5, 0x8348, 0x50C6, 0x8349, 0x50C7, 0x834A, 0x50C8, 0x834B, 0x50C9, 0x834C, 0x50CA, 0x834D, + 0x50CB, 0x834E, 0x50CC, 0x834F, 0x50CD, 0x8350, 0x50CE, 0x8351, 0x50CF, 0xCFF1, 0x50D0, 0x8352, 0x50D1, 0x8353, 0x50D2, 0x8354, + 0x50D3, 0x8355, 0x50D4, 0x8356, 0x50D5, 0x8357, 0x50D6, 0xD9D2, 0x50D7, 0x8358, 0x50D8, 0x8359, 0x50D9, 0x835A, 0x50DA, 0xC1C5, + 0x50DB, 0x835B, 0x50DC, 0x835C, 0x50DD, 0x835D, 0x50DE, 0x835E, 0x50DF, 0x835F, 0x50E0, 0x8360, 0x50E1, 0x8361, 0x50E2, 0x8362, + 0x50E3, 0x8363, 0x50E4, 0x8364, 0x50E5, 0x8365, 0x50E6, 0xD9D6, 0x50E7, 0xC9AE, 0x50E8, 0x8366, 0x50E9, 0x8367, 0x50EA, 0x8368, + 0x50EB, 0x8369, 0x50EC, 0xD9D5, 0x50ED, 0xD9D4, 0x50EE, 0xD9D7, 0x50EF, 0x836A, 0x50F0, 0x836B, 0x50F1, 0x836C, 0x50F2, 0x836D, + 0x50F3, 0xCBDB, 0x50F4, 0x836E, 0x50F5, 0xBDA9, 0x50F6, 0x836F, 0x50F7, 0x8370, 0x50F8, 0x8371, 0x50F9, 0x8372, 0x50FA, 0x8373, + 0x50FB, 0xC6A7, 0x50FC, 0x8374, 0x50FD, 0x8375, 0x50FE, 0x8376, 0x50FF, 0x8377, 0x5100, 0x8378, 0x5101, 0x8379, 0x5102, 0x837A, + 0x5103, 0x837B, 0x5104, 0x837C, 0x5105, 0x837D, 0x5106, 0xD9D3, 0x5107, 0xD9D8, 0x5108, 0x837E, 0x5109, 0x8380, 0x510A, 0x8381, + 0x510B, 0xD9D9, 0x510C, 0x8382, 0x510D, 0x8383, 0x510E, 0x8384, 0x510F, 0x8385, 0x5110, 0x8386, 0x5111, 0x8387, 0x5112, 0xC8E5, + 0x5113, 0x8388, 0x5114, 0x8389, 0x5115, 0x838A, 0x5116, 0x838B, 0x5117, 0x838C, 0x5118, 0x838D, 0x5119, 0x838E, 0x511A, 0x838F, + 0x511B, 0x8390, 0x511C, 0x8391, 0x511D, 0x8392, 0x511E, 0x8393, 0x511F, 0x8394, 0x5120, 0x8395, 0x5121, 0xC0DC, 0x5122, 0x8396, + 0x5123, 0x8397, 0x5124, 0x8398, 0x5125, 0x8399, 0x5126, 0x839A, 0x5127, 0x839B, 0x5128, 0x839C, 0x5129, 0x839D, 0x512A, 0x839E, + 0x512B, 0x839F, 0x512C, 0x83A0, 0x512D, 0x83A1, 0x512E, 0x83A2, 0x512F, 0x83A3, 0x5130, 0x83A4, 0x5131, 0x83A5, 0x5132, 0x83A6, + 0x5133, 0x83A7, 0x5134, 0x83A8, 0x5135, 0x83A9, 0x5136, 0x83AA, 0x5137, 0x83AB, 0x5138, 0x83AC, 0x5139, 0x83AD, 0x513A, 0x83AE, + 0x513B, 0x83AF, 0x513C, 0x83B0, 0x513D, 0x83B1, 0x513E, 0x83B2, 0x513F, 0xB6F9, 0x5140, 0xD8A3, 0x5141, 0xD4CA, 0x5142, 0x83B3, + 0x5143, 0xD4AA, 0x5144, 0xD0D6, 0x5145, 0xB3E4, 0x5146, 0xD5D7, 0x5147, 0x83B4, 0x5148, 0xCFC8, 0x5149, 0xB9E2, 0x514A, 0x83B5, + 0x514B, 0xBFCB, 0x514C, 0x83B6, 0x514D, 0xC3E2, 0x514E, 0x83B7, 0x514F, 0x83B8, 0x5150, 0x83B9, 0x5151, 0xB6D2, 0x5152, 0x83BA, + 0x5153, 0x83BB, 0x5154, 0xCDC3, 0x5155, 0xD9EE, 0x5156, 0xD9F0, 0x5157, 0x83BC, 0x5158, 0x83BD, 0x5159, 0x83BE, 0x515A, 0xB5B3, + 0x515B, 0x83BF, 0x515C, 0xB6B5, 0x515D, 0x83C0, 0x515E, 0x83C1, 0x515F, 0x83C2, 0x5160, 0x83C3, 0x5161, 0x83C4, 0x5162, 0xBEA4, + 0x5163, 0x83C5, 0x5164, 0x83C6, 0x5165, 0xC8EB, 0x5166, 0x83C7, 0x5167, 0x83C8, 0x5168, 0xC8AB, 0x5169, 0x83C9, 0x516A, 0x83CA, + 0x516B, 0xB0CB, 0x516C, 0xB9AB, 0x516D, 0xC1F9, 0x516E, 0xD9E2, 0x516F, 0x83CB, 0x5170, 0xC0BC, 0x5171, 0xB9B2, 0x5172, 0x83CC, + 0x5173, 0xB9D8, 0x5174, 0xD0CB, 0x5175, 0xB1F8, 0x5176, 0xC6E4, 0x5177, 0xBEDF, 0x5178, 0xB5E4, 0x5179, 0xD7C8, 0x517A, 0x83CD, + 0x517B, 0xD1F8, 0x517C, 0xBCE6, 0x517D, 0xCADE, 0x517E, 0x83CE, 0x517F, 0x83CF, 0x5180, 0xBCBD, 0x5181, 0xD9E6, 0x5182, 0xD8E7, + 0x5183, 0x83D0, 0x5184, 0x83D1, 0x5185, 0xC4DA, 0x5186, 0x83D2, 0x5187, 0x83D3, 0x5188, 0xB8D4, 0x5189, 0xC8BD, 0x518A, 0x83D4, + 0x518B, 0x83D5, 0x518C, 0xB2E1, 0x518D, 0xD4D9, 0x518E, 0x83D6, 0x518F, 0x83D7, 0x5190, 0x83D8, 0x5191, 0x83D9, 0x5192, 0xC3B0, + 0x5193, 0x83DA, 0x5194, 0x83DB, 0x5195, 0xC3E1, 0x5196, 0xDAA2, 0x5197, 0xC8DF, 0x5198, 0x83DC, 0x5199, 0xD0B4, 0x519A, 0x83DD, + 0x519B, 0xBEFC, 0x519C, 0xC5A9, 0x519D, 0x83DE, 0x519E, 0x83DF, 0x519F, 0x83E0, 0x51A0, 0xB9DA, 0x51A1, 0x83E1, 0x51A2, 0xDAA3, + 0x51A3, 0x83E2, 0x51A4, 0xD4A9, 0x51A5, 0xDAA4, 0x51A6, 0x83E3, 0x51A7, 0x83E4, 0x51A8, 0x83E5, 0x51A9, 0x83E6, 0x51AA, 0x83E7, + 0x51AB, 0xD9FB, 0x51AC, 0xB6AC, 0x51AD, 0x83E8, 0x51AE, 0x83E9, 0x51AF, 0xB7EB, 0x51B0, 0xB1F9, 0x51B1, 0xD9FC, 0x51B2, 0xB3E5, + 0x51B3, 0xBEF6, 0x51B4, 0x83EA, 0x51B5, 0xBFF6, 0x51B6, 0xD2B1, 0x51B7, 0xC0E4, 0x51B8, 0x83EB, 0x51B9, 0x83EC, 0x51BA, 0x83ED, + 0x51BB, 0xB6B3, 0x51BC, 0xD9FE, 0x51BD, 0xD9FD, 0x51BE, 0x83EE, 0x51BF, 0x83EF, 0x51C0, 0xBEBB, 0x51C1, 0x83F0, 0x51C2, 0x83F1, + 0x51C3, 0x83F2, 0x51C4, 0xC6E0, 0x51C5, 0x83F3, 0x51C6, 0xD7BC, 0x51C7, 0xDAA1, 0x51C8, 0x83F4, 0x51C9, 0xC1B9, 0x51CA, 0x83F5, + 0x51CB, 0xB5F2, 0x51CC, 0xC1E8, 0x51CD, 0x83F6, 0x51CE, 0x83F7, 0x51CF, 0xBCF5, 0x51D0, 0x83F8, 0x51D1, 0xB4D5, 0x51D2, 0x83F9, + 0x51D3, 0x83FA, 0x51D4, 0x83FB, 0x51D5, 0x83FC, 0x51D6, 0x83FD, 0x51D7, 0x83FE, 0x51D8, 0x8440, 0x51D9, 0x8441, 0x51DA, 0x8442, + 0x51DB, 0xC1DD, 0x51DC, 0x8443, 0x51DD, 0xC4FD, 0x51DE, 0x8444, 0x51DF, 0x8445, 0x51E0, 0xBCB8, 0x51E1, 0xB7B2, 0x51E2, 0x8446, + 0x51E3, 0x8447, 0x51E4, 0xB7EF, 0x51E5, 0x8448, 0x51E6, 0x8449, 0x51E7, 0x844A, 0x51E8, 0x844B, 0x51E9, 0x844C, 0x51EA, 0x844D, + 0x51EB, 0xD9EC, 0x51EC, 0x844E, 0x51ED, 0xC6BE, 0x51EE, 0x844F, 0x51EF, 0xBFAD, 0x51F0, 0xBBCB, 0x51F1, 0x8450, 0x51F2, 0x8451, + 0x51F3, 0xB5CA, 0x51F4, 0x8452, 0x51F5, 0xDBC9, 0x51F6, 0xD0D7, 0x51F7, 0x8453, 0x51F8, 0xCDB9, 0x51F9, 0xB0BC, 0x51FA, 0xB3F6, + 0x51FB, 0xBBF7, 0x51FC, 0xDBCA, 0x51FD, 0xBAAF, 0x51FE, 0x8454, 0x51FF, 0xD4E4, 0x5200, 0xB5B6, 0x5201, 0xB5F3, 0x5202, 0xD8D6, + 0x5203, 0xC8D0, 0x5204, 0x8455, 0x5205, 0x8456, 0x5206, 0xB7D6, 0x5207, 0xC7D0, 0x5208, 0xD8D7, 0x5209, 0x8457, 0x520A, 0xBFAF, + 0x520B, 0x8458, 0x520C, 0x8459, 0x520D, 0xDBBB, 0x520E, 0xD8D8, 0x520F, 0x845A, 0x5210, 0x845B, 0x5211, 0xD0CC, 0x5212, 0xBBAE, + 0x5213, 0x845C, 0x5214, 0x845D, 0x5215, 0x845E, 0x5216, 0xEBBE, 0x5217, 0xC1D0, 0x5218, 0xC1F5, 0x5219, 0xD4F2, 0x521A, 0xB8D5, + 0x521B, 0xB4B4, 0x521C, 0x845F, 0x521D, 0xB3F5, 0x521E, 0x8460, 0x521F, 0x8461, 0x5220, 0xC9BE, 0x5221, 0x8462, 0x5222, 0x8463, + 0x5223, 0x8464, 0x5224, 0xC5D0, 0x5225, 0x8465, 0x5226, 0x8466, 0x5227, 0x8467, 0x5228, 0xC5D9, 0x5229, 0xC0FB, 0x522A, 0x8468, + 0x522B, 0xB1F0, 0x522C, 0x8469, 0x522D, 0xD8D9, 0x522E, 0xB9CE, 0x522F, 0x846A, 0x5230, 0xB5BD, 0x5231, 0x846B, 0x5232, 0x846C, + 0x5233, 0xD8DA, 0x5234, 0x846D, 0x5235, 0x846E, 0x5236, 0xD6C6, 0x5237, 0xCBA2, 0x5238, 0xC8AF, 0x5239, 0xC9B2, 0x523A, 0xB4CC, + 0x523B, 0xBFCC, 0x523C, 0x846F, 0x523D, 0xB9F4, 0x523E, 0x8470, 0x523F, 0xD8DB, 0x5240, 0xD8DC, 0x5241, 0xB6E7, 0x5242, 0xBCC1, + 0x5243, 0xCCEA, 0x5244, 0x8471, 0x5245, 0x8472, 0x5246, 0x8473, 0x5247, 0x8474, 0x5248, 0x8475, 0x5249, 0x8476, 0x524A, 0xCFF7, + 0x524B, 0x8477, 0x524C, 0xD8DD, 0x524D, 0xC7B0, 0x524E, 0x8478, 0x524F, 0x8479, 0x5250, 0xB9D0, 0x5251, 0xBDA3, 0x5252, 0x847A, + 0x5253, 0x847B, 0x5254, 0xCCDE, 0x5255, 0x847C, 0x5256, 0xC6CA, 0x5257, 0x847D, 0x5258, 0x847E, 0x5259, 0x8480, 0x525A, 0x8481, + 0x525B, 0x8482, 0x525C, 0xD8E0, 0x525D, 0x8483, 0x525E, 0xD8DE, 0x525F, 0x8484, 0x5260, 0x8485, 0x5261, 0xD8DF, 0x5262, 0x8486, + 0x5263, 0x8487, 0x5264, 0x8488, 0x5265, 0xB0FE, 0x5266, 0x8489, 0x5267, 0xBEE7, 0x5268, 0x848A, 0x5269, 0xCAA3, 0x526A, 0xBCF4, + 0x526B, 0x848B, 0x526C, 0x848C, 0x526D, 0x848D, 0x526E, 0x848E, 0x526F, 0xB8B1, 0x5270, 0x848F, 0x5271, 0x8490, 0x5272, 0xB8EE, + 0x5273, 0x8491, 0x5274, 0x8492, 0x5275, 0x8493, 0x5276, 0x8494, 0x5277, 0x8495, 0x5278, 0x8496, 0x5279, 0x8497, 0x527A, 0x8498, + 0x527B, 0x8499, 0x527C, 0x849A, 0x527D, 0xD8E2, 0x527E, 0x849B, 0x527F, 0xBDCB, 0x5280, 0x849C, 0x5281, 0xD8E4, 0x5282, 0xD8E3, + 0x5283, 0x849D, 0x5284, 0x849E, 0x5285, 0x849F, 0x5286, 0x84A0, 0x5287, 0x84A1, 0x5288, 0xC5FC, 0x5289, 0x84A2, 0x528A, 0x84A3, + 0x528B, 0x84A4, 0x528C, 0x84A5, 0x528D, 0x84A6, 0x528E, 0x84A7, 0x528F, 0x84A8, 0x5290, 0xD8E5, 0x5291, 0x84A9, 0x5292, 0x84AA, + 0x5293, 0xD8E6, 0x5294, 0x84AB, 0x5295, 0x84AC, 0x5296, 0x84AD, 0x5297, 0x84AE, 0x5298, 0x84AF, 0x5299, 0x84B0, 0x529A, 0x84B1, + 0x529B, 0xC1A6, 0x529C, 0x84B2, 0x529D, 0xC8B0, 0x529E, 0xB0EC, 0x529F, 0xB9A6, 0x52A0, 0xBCD3, 0x52A1, 0xCEF1, 0x52A2, 0xDBBD, + 0x52A3, 0xC1D3, 0x52A4, 0x84B3, 0x52A5, 0x84B4, 0x52A6, 0x84B5, 0x52A7, 0x84B6, 0x52A8, 0xB6AF, 0x52A9, 0xD6FA, 0x52AA, 0xC5AC, + 0x52AB, 0xBDD9, 0x52AC, 0xDBBE, 0x52AD, 0xDBBF, 0x52AE, 0x84B7, 0x52AF, 0x84B8, 0x52B0, 0x84B9, 0x52B1, 0xC0F8, 0x52B2, 0xBEA2, + 0x52B3, 0xC0CD, 0x52B4, 0x84BA, 0x52B5, 0x84BB, 0x52B6, 0x84BC, 0x52B7, 0x84BD, 0x52B8, 0x84BE, 0x52B9, 0x84BF, 0x52BA, 0x84C0, + 0x52BB, 0x84C1, 0x52BC, 0x84C2, 0x52BD, 0x84C3, 0x52BE, 0xDBC0, 0x52BF, 0xCAC6, 0x52C0, 0x84C4, 0x52C1, 0x84C5, 0x52C2, 0x84C6, + 0x52C3, 0xB2AA, 0x52C4, 0x84C7, 0x52C5, 0x84C8, 0x52C6, 0x84C9, 0x52C7, 0xD3C2, 0x52C8, 0x84CA, 0x52C9, 0xC3E3, 0x52CA, 0x84CB, + 0x52CB, 0xD1AB, 0x52CC, 0x84CC, 0x52CD, 0x84CD, 0x52CE, 0x84CE, 0x52CF, 0x84CF, 0x52D0, 0xDBC2, 0x52D1, 0x84D0, 0x52D2, 0xC0D5, + 0x52D3, 0x84D1, 0x52D4, 0x84D2, 0x52D5, 0x84D3, 0x52D6, 0xDBC3, 0x52D7, 0x84D4, 0x52D8, 0xBFB1, 0x52D9, 0x84D5, 0x52DA, 0x84D6, + 0x52DB, 0x84D7, 0x52DC, 0x84D8, 0x52DD, 0x84D9, 0x52DE, 0x84DA, 0x52DF, 0xC4BC, 0x52E0, 0x84DB, 0x52E1, 0x84DC, 0x52E2, 0x84DD, + 0x52E3, 0x84DE, 0x52E4, 0xC7DA, 0x52E5, 0x84DF, 0x52E6, 0x84E0, 0x52E7, 0x84E1, 0x52E8, 0x84E2, 0x52E9, 0x84E3, 0x52EA, 0x84E4, + 0x52EB, 0x84E5, 0x52EC, 0x84E6, 0x52ED, 0x84E7, 0x52EE, 0x84E8, 0x52EF, 0x84E9, 0x52F0, 0xDBC4, 0x52F1, 0x84EA, 0x52F2, 0x84EB, + 0x52F3, 0x84EC, 0x52F4, 0x84ED, 0x52F5, 0x84EE, 0x52F6, 0x84EF, 0x52F7, 0x84F0, 0x52F8, 0x84F1, 0x52F9, 0xD9E8, 0x52FA, 0xC9D7, + 0x52FB, 0x84F2, 0x52FC, 0x84F3, 0x52FD, 0x84F4, 0x52FE, 0xB9B4, 0x52FF, 0xCEF0, 0x5300, 0xD4C8, 0x5301, 0x84F5, 0x5302, 0x84F6, + 0x5303, 0x84F7, 0x5304, 0x84F8, 0x5305, 0xB0FC, 0x5306, 0xB4D2, 0x5307, 0x84F9, 0x5308, 0xD0D9, 0x5309, 0x84FA, 0x530A, 0x84FB, + 0x530B, 0x84FC, 0x530C, 0x84FD, 0x530D, 0xD9E9, 0x530E, 0x84FE, 0x530F, 0xDECB, 0x5310, 0xD9EB, 0x5311, 0x8540, 0x5312, 0x8541, + 0x5313, 0x8542, 0x5314, 0x8543, 0x5315, 0xD8B0, 0x5316, 0xBBAF, 0x5317, 0xB1B1, 0x5318, 0x8544, 0x5319, 0xB3D7, 0x531A, 0xD8CE, + 0x531B, 0x8545, 0x531C, 0x8546, 0x531D, 0xD4D1, 0x531E, 0x8547, 0x531F, 0x8548, 0x5320, 0xBDB3, 0x5321, 0xBFEF, 0x5322, 0x8549, + 0x5323, 0xCFBB, 0x5324, 0x854A, 0x5325, 0x854B, 0x5326, 0xD8D0, 0x5327, 0x854C, 0x5328, 0x854D, 0x5329, 0x854E, 0x532A, 0xB7CB, + 0x532B, 0x854F, 0x532C, 0x8550, 0x532D, 0x8551, 0x532E, 0xD8D1, 0x532F, 0x8552, 0x5330, 0x8553, 0x5331, 0x8554, 0x5332, 0x8555, + 0x5333, 0x8556, 0x5334, 0x8557, 0x5335, 0x8558, 0x5336, 0x8559, 0x5337, 0x855A, 0x5338, 0x855B, 0x5339, 0xC6A5, 0x533A, 0xC7F8, + 0x533B, 0xD2BD, 0x533C, 0x855C, 0x533D, 0x855D, 0x533E, 0xD8D2, 0x533F, 0xC4E4, 0x5340, 0x855E, 0x5341, 0xCAAE, 0x5342, 0x855F, + 0x5343, 0xC7A7, 0x5344, 0x8560, 0x5345, 0xD8A6, 0x5346, 0x8561, 0x5347, 0xC9FD, 0x5348, 0xCEE7, 0x5349, 0xBBDC, 0x534A, 0xB0EB, + 0x534B, 0x8562, 0x534C, 0x8563, 0x534D, 0x8564, 0x534E, 0xBBAA, 0x534F, 0xD0AD, 0x5350, 0x8565, 0x5351, 0xB1B0, 0x5352, 0xD7E4, + 0x5353, 0xD7BF, 0x5354, 0x8566, 0x5355, 0xB5A5, 0x5356, 0xC2F4, 0x5357, 0xC4CF, 0x5358, 0x8567, 0x5359, 0x8568, 0x535A, 0xB2A9, + 0x535B, 0x8569, 0x535C, 0xB2B7, 0x535D, 0x856A, 0x535E, 0xB1E5, 0x535F, 0xDFB2, 0x5360, 0xD5BC, 0x5361, 0xBFA8, 0x5362, 0xC2AC, + 0x5363, 0xD8D5, 0x5364, 0xC2B1, 0x5365, 0x856B, 0x5366, 0xD8D4, 0x5367, 0xCED4, 0x5368, 0x856C, 0x5369, 0xDAE0, 0x536A, 0x856D, + 0x536B, 0xCEC0, 0x536C, 0x856E, 0x536D, 0x856F, 0x536E, 0xD8B4, 0x536F, 0xC3AE, 0x5370, 0xD3A1, 0x5371, 0xCEA3, 0x5372, 0x8570, + 0x5373, 0xBCB4, 0x5374, 0xC8B4, 0x5375, 0xC2D1, 0x5376, 0x8571, 0x5377, 0xBEED, 0x5378, 0xD0B6, 0x5379, 0x8572, 0x537A, 0xDAE1, + 0x537B, 0x8573, 0x537C, 0x8574, 0x537D, 0x8575, 0x537E, 0x8576, 0x537F, 0xC7E4, 0x5380, 0x8577, 0x5381, 0x8578, 0x5382, 0xB3A7, + 0x5383, 0x8579, 0x5384, 0xB6F2, 0x5385, 0xCCFC, 0x5386, 0xC0FA, 0x5387, 0x857A, 0x5388, 0x857B, 0x5389, 0xC0F7, 0x538A, 0x857C, + 0x538B, 0xD1B9, 0x538C, 0xD1E1, 0x538D, 0xD8C7, 0x538E, 0x857D, 0x538F, 0x857E, 0x5390, 0x8580, 0x5391, 0x8581, 0x5392, 0x8582, + 0x5393, 0x8583, 0x5394, 0x8584, 0x5395, 0xB2DE, 0x5396, 0x8585, 0x5397, 0x8586, 0x5398, 0xC0E5, 0x5399, 0x8587, 0x539A, 0xBAF1, + 0x539B, 0x8588, 0x539C, 0x8589, 0x539D, 0xD8C8, 0x539E, 0x858A, 0x539F, 0xD4AD, 0x53A0, 0x858B, 0x53A1, 0x858C, 0x53A2, 0xCFE1, + 0x53A3, 0xD8C9, 0x53A4, 0x858D, 0x53A5, 0xD8CA, 0x53A6, 0xCFC3, 0x53A7, 0x858E, 0x53A8, 0xB3F8, 0x53A9, 0xBEC7, 0x53AA, 0x858F, + 0x53AB, 0x8590, 0x53AC, 0x8591, 0x53AD, 0x8592, 0x53AE, 0xD8CB, 0x53AF, 0x8593, 0x53B0, 0x8594, 0x53B1, 0x8595, 0x53B2, 0x8596, + 0x53B3, 0x8597, 0x53B4, 0x8598, 0x53B5, 0x8599, 0x53B6, 0xDBCC, 0x53B7, 0x859A, 0x53B8, 0x859B, 0x53B9, 0x859C, 0x53BA, 0x859D, + 0x53BB, 0xC8A5, 0x53BC, 0x859E, 0x53BD, 0x859F, 0x53BE, 0x85A0, 0x53BF, 0xCFD8, 0x53C0, 0x85A1, 0x53C1, 0xC8FE, 0x53C2, 0xB2CE, + 0x53C3, 0x85A2, 0x53C4, 0x85A3, 0x53C5, 0x85A4, 0x53C6, 0x85A5, 0x53C7, 0x85A6, 0x53C8, 0xD3D6, 0x53C9, 0xB2E6, 0x53CA, 0xBCB0, + 0x53CB, 0xD3D1, 0x53CC, 0xCBAB, 0x53CD, 0xB7B4, 0x53CE, 0x85A7, 0x53CF, 0x85A8, 0x53D0, 0x85A9, 0x53D1, 0xB7A2, 0x53D2, 0x85AA, + 0x53D3, 0x85AB, 0x53D4, 0xCAE5, 0x53D5, 0x85AC, 0x53D6, 0xC8A1, 0x53D7, 0xCADC, 0x53D8, 0xB1E4, 0x53D9, 0xD0F0, 0x53DA, 0x85AD, + 0x53DB, 0xC5D1, 0x53DC, 0x85AE, 0x53DD, 0x85AF, 0x53DE, 0x85B0, 0x53DF, 0xDBC5, 0x53E0, 0xB5FE, 0x53E1, 0x85B1, 0x53E2, 0x85B2, + 0x53E3, 0xBFDA, 0x53E4, 0xB9C5, 0x53E5, 0xBEE4, 0x53E6, 0xC1ED, 0x53E7, 0x85B3, 0x53E8, 0xDFB6, 0x53E9, 0xDFB5, 0x53EA, 0xD6BB, + 0x53EB, 0xBDD0, 0x53EC, 0xD5D9, 0x53ED, 0xB0C8, 0x53EE, 0xB6A3, 0x53EF, 0xBFC9, 0x53F0, 0xCCA8, 0x53F1, 0xDFB3, 0x53F2, 0xCAB7, + 0x53F3, 0xD3D2, 0x53F4, 0x85B4, 0x53F5, 0xD8CF, 0x53F6, 0xD2B6, 0x53F7, 0xBAC5, 0x53F8, 0xCBBE, 0x53F9, 0xCCBE, 0x53FA, 0x85B5, + 0x53FB, 0xDFB7, 0x53FC, 0xB5F0, 0x53FD, 0xDFB4, 0x53FE, 0x85B6, 0x53FF, 0x85B7, 0x5400, 0x85B8, 0x5401, 0xD3F5, 0x5402, 0x85B9, + 0x5403, 0xB3D4, 0x5404, 0xB8F7, 0x5405, 0x85BA, 0x5406, 0xDFBA, 0x5407, 0x85BB, 0x5408, 0xBACF, 0x5409, 0xBCAA, 0x540A, 0xB5F5, + 0x540B, 0x85BC, 0x540C, 0xCDAC, 0x540D, 0xC3FB, 0x540E, 0xBAF3, 0x540F, 0xC0F4, 0x5410, 0xCDC2, 0x5411, 0xCFF2, 0x5412, 0xDFB8, + 0x5413, 0xCFC5, 0x5414, 0x85BD, 0x5415, 0xC2C0, 0x5416, 0xDFB9, 0x5417, 0xC2F0, 0x5418, 0x85BE, 0x5419, 0x85BF, 0x541A, 0x85C0, + 0x541B, 0xBEFD, 0x541C, 0x85C1, 0x541D, 0xC1DF, 0x541E, 0xCDCC, 0x541F, 0xD2F7, 0x5420, 0xB7CD, 0x5421, 0xDFC1, 0x5422, 0x85C2, + 0x5423, 0xDFC4, 0x5424, 0x85C3, 0x5425, 0x85C4, 0x5426, 0xB7F1, 0x5427, 0xB0C9, 0x5428, 0xB6D6, 0x5429, 0xB7D4, 0x542A, 0x85C5, + 0x542B, 0xBAAC, 0x542C, 0xCCFD, 0x542D, 0xBFD4, 0x542E, 0xCBB1, 0x542F, 0xC6F4, 0x5430, 0x85C6, 0x5431, 0xD6A8, 0x5432, 0xDFC5, + 0x5433, 0x85C7, 0x5434, 0xCEE2, 0x5435, 0xB3B3, 0x5436, 0x85C8, 0x5437, 0x85C9, 0x5438, 0xCEFC, 0x5439, 0xB4B5, 0x543A, 0x85CA, + 0x543B, 0xCEC7, 0x543C, 0xBAF0, 0x543D, 0x85CB, 0x543E, 0xCEE1, 0x543F, 0x85CC, 0x5440, 0xD1BD, 0x5441, 0x85CD, 0x5442, 0x85CE, + 0x5443, 0xDFC0, 0x5444, 0x85CF, 0x5445, 0x85D0, 0x5446, 0xB4F4, 0x5447, 0x85D1, 0x5448, 0xB3CA, 0x5449, 0x85D2, 0x544A, 0xB8E6, + 0x544B, 0xDFBB, 0x544C, 0x85D3, 0x544D, 0x85D4, 0x544E, 0x85D5, 0x544F, 0x85D6, 0x5450, 0xC4C5, 0x5451, 0x85D7, 0x5452, 0xDFBC, + 0x5453, 0xDFBD, 0x5454, 0xDFBE, 0x5455, 0xC5BB, 0x5456, 0xDFBF, 0x5457, 0xDFC2, 0x5458, 0xD4B1, 0x5459, 0xDFC3, 0x545A, 0x85D8, + 0x545B, 0xC7BA, 0x545C, 0xCED8, 0x545D, 0x85D9, 0x545E, 0x85DA, 0x545F, 0x85DB, 0x5460, 0x85DC, 0x5461, 0x85DD, 0x5462, 0xC4D8, + 0x5463, 0x85DE, 0x5464, 0xDFCA, 0x5465, 0x85DF, 0x5466, 0xDFCF, 0x5467, 0x85E0, 0x5468, 0xD6DC, 0x5469, 0x85E1, 0x546A, 0x85E2, + 0x546B, 0x85E3, 0x546C, 0x85E4, 0x546D, 0x85E5, 0x546E, 0x85E6, 0x546F, 0x85E7, 0x5470, 0x85E8, 0x5471, 0xDFC9, 0x5472, 0xDFDA, + 0x5473, 0xCEB6, 0x5474, 0x85E9, 0x5475, 0xBAC7, 0x5476, 0xDFCE, 0x5477, 0xDFC8, 0x5478, 0xC5DE, 0x5479, 0x85EA, 0x547A, 0x85EB, + 0x547B, 0xC9EB, 0x547C, 0xBAF4, 0x547D, 0xC3FC, 0x547E, 0x85EC, 0x547F, 0x85ED, 0x5480, 0xBED7, 0x5481, 0x85EE, 0x5482, 0xDFC6, + 0x5483, 0x85EF, 0x5484, 0xDFCD, 0x5485, 0x85F0, 0x5486, 0xC5D8, 0x5487, 0x85F1, 0x5488, 0x85F2, 0x5489, 0x85F3, 0x548A, 0x85F4, + 0x548B, 0xD5A6, 0x548C, 0xBACD, 0x548D, 0x85F5, 0x548E, 0xBECC, 0x548F, 0xD3BD, 0x5490, 0xB8C0, 0x5491, 0x85F6, 0x5492, 0xD6E4, + 0x5493, 0x85F7, 0x5494, 0xDFC7, 0x5495, 0xB9BE, 0x5496, 0xBFA7, 0x5497, 0x85F8, 0x5498, 0x85F9, 0x5499, 0xC1FC, 0x549A, 0xDFCB, + 0x549B, 0xDFCC, 0x549C, 0x85FA, 0x549D, 0xDFD0, 0x549E, 0x85FB, 0x549F, 0x85FC, 0x54A0, 0x85FD, 0x54A1, 0x85FE, 0x54A2, 0x8640, + 0x54A3, 0xDFDB, 0x54A4, 0xDFE5, 0x54A5, 0x8641, 0x54A6, 0xDFD7, 0x54A7, 0xDFD6, 0x54A8, 0xD7C9, 0x54A9, 0xDFE3, 0x54AA, 0xDFE4, + 0x54AB, 0xE5EB, 0x54AC, 0xD2A7, 0x54AD, 0xDFD2, 0x54AE, 0x8642, 0x54AF, 0xBFA9, 0x54B0, 0x8643, 0x54B1, 0xD4DB, 0x54B2, 0x8644, + 0x54B3, 0xBFC8, 0x54B4, 0xDFD4, 0x54B5, 0x8645, 0x54B6, 0x8646, 0x54B7, 0x8647, 0x54B8, 0xCFCC, 0x54B9, 0x8648, 0x54BA, 0x8649, + 0x54BB, 0xDFDD, 0x54BC, 0x864A, 0x54BD, 0xD1CA, 0x54BE, 0x864B, 0x54BF, 0xDFDE, 0x54C0, 0xB0A7, 0x54C1, 0xC6B7, 0x54C2, 0xDFD3, + 0x54C3, 0x864C, 0x54C4, 0xBAE5, 0x54C5, 0x864D, 0x54C6, 0xB6DF, 0x54C7, 0xCDDB, 0x54C8, 0xB9FE, 0x54C9, 0xD4D5, 0x54CA, 0x864E, + 0x54CB, 0x864F, 0x54CC, 0xDFDF, 0x54CD, 0xCFEC, 0x54CE, 0xB0A5, 0x54CF, 0xDFE7, 0x54D0, 0xDFD1, 0x54D1, 0xD1C6, 0x54D2, 0xDFD5, + 0x54D3, 0xDFD8, 0x54D4, 0xDFD9, 0x54D5, 0xDFDC, 0x54D6, 0x8650, 0x54D7, 0xBBA9, 0x54D8, 0x8651, 0x54D9, 0xDFE0, 0x54DA, 0xDFE1, + 0x54DB, 0x8652, 0x54DC, 0xDFE2, 0x54DD, 0xDFE6, 0x54DE, 0xDFE8, 0x54DF, 0xD3B4, 0x54E0, 0x8653, 0x54E1, 0x8654, 0x54E2, 0x8655, + 0x54E3, 0x8656, 0x54E4, 0x8657, 0x54E5, 0xB8E7, 0x54E6, 0xC5B6, 0x54E7, 0xDFEA, 0x54E8, 0xC9DA, 0x54E9, 0xC1A8, 0x54EA, 0xC4C4, + 0x54EB, 0x8658, 0x54EC, 0x8659, 0x54ED, 0xBFDE, 0x54EE, 0xCFF8, 0x54EF, 0x865A, 0x54F0, 0x865B, 0x54F1, 0x865C, 0x54F2, 0xD5DC, + 0x54F3, 0xDFEE, 0x54F4, 0x865D, 0x54F5, 0x865E, 0x54F6, 0x865F, 0x54F7, 0x8660, 0x54F8, 0x8661, 0x54F9, 0x8662, 0x54FA, 0xB2B8, + 0x54FB, 0x8663, 0x54FC, 0xBADF, 0x54FD, 0xDFEC, 0x54FE, 0x8664, 0x54FF, 0xDBC1, 0x5500, 0x8665, 0x5501, 0xD1E4, 0x5502, 0x8666, + 0x5503, 0x8667, 0x5504, 0x8668, 0x5505, 0x8669, 0x5506, 0xCBF4, 0x5507, 0xB4BD, 0x5508, 0x866A, 0x5509, 0xB0A6, 0x550A, 0x866B, + 0x550B, 0x866C, 0x550C, 0x866D, 0x550D, 0x866E, 0x550E, 0x866F, 0x550F, 0xDFF1, 0x5510, 0xCCC6, 0x5511, 0xDFF2, 0x5512, 0x8670, + 0x5513, 0x8671, 0x5514, 0xDFED, 0x5515, 0x8672, 0x5516, 0x8673, 0x5517, 0x8674, 0x5518, 0x8675, 0x5519, 0x8676, 0x551A, 0x8677, + 0x551B, 0xDFE9, 0x551C, 0x8678, 0x551D, 0x8679, 0x551E, 0x867A, 0x551F, 0x867B, 0x5520, 0xDFEB, 0x5521, 0x867C, 0x5522, 0xDFEF, + 0x5523, 0xDFF0, 0x5524, 0xBBBD, 0x5525, 0x867D, 0x5526, 0x867E, 0x5527, 0xDFF3, 0x5528, 0x8680, 0x5529, 0x8681, 0x552A, 0xDFF4, + 0x552B, 0x8682, 0x552C, 0xBBA3, 0x552D, 0x8683, 0x552E, 0xCADB, 0x552F, 0xCEA8, 0x5530, 0xE0A7, 0x5531, 0xB3AA, 0x5532, 0x8684, + 0x5533, 0xE0A6, 0x5534, 0x8685, 0x5535, 0x8686, 0x5536, 0x8687, 0x5537, 0xE0A1, 0x5538, 0x8688, 0x5539, 0x8689, 0x553A, 0x868A, + 0x553B, 0x868B, 0x553C, 0xDFFE, 0x553D, 0x868C, 0x553E, 0xCDD9, 0x553F, 0xDFFC, 0x5540, 0x868D, 0x5541, 0xDFFA, 0x5542, 0x868E, + 0x5543, 0xBFD0, 0x5544, 0xD7C4, 0x5545, 0x868F, 0x5546, 0xC9CC, 0x5547, 0x8690, 0x5548, 0x8691, 0x5549, 0xDFF8, 0x554A, 0xB0A1, + 0x554B, 0x8692, 0x554C, 0x8693, 0x554D, 0x8694, 0x554E, 0x8695, 0x554F, 0x8696, 0x5550, 0xDFFD, 0x5551, 0x8697, 0x5552, 0x8698, + 0x5553, 0x8699, 0x5554, 0x869A, 0x5555, 0xDFFB, 0x5556, 0xE0A2, 0x5557, 0x869B, 0x5558, 0x869C, 0x5559, 0x869D, 0x555A, 0x869E, + 0x555B, 0x869F, 0x555C, 0xE0A8, 0x555D, 0x86A0, 0x555E, 0x86A1, 0x555F, 0x86A2, 0x5560, 0x86A3, 0x5561, 0xB7C8, 0x5562, 0x86A4, + 0x5563, 0x86A5, 0x5564, 0xC6A1, 0x5565, 0xC9B6, 0x5566, 0xC0B2, 0x5567, 0xDFF5, 0x5568, 0x86A6, 0x5569, 0x86A7, 0x556A, 0xC5BE, + 0x556B, 0x86A8, 0x556C, 0xD8C4, 0x556D, 0xDFF9, 0x556E, 0xC4F6, 0x556F, 0x86A9, 0x5570, 0x86AA, 0x5571, 0x86AB, 0x5572, 0x86AC, + 0x5573, 0x86AD, 0x5574, 0x86AE, 0x5575, 0xE0A3, 0x5576, 0xE0A4, 0x5577, 0xE0A5, 0x5578, 0xD0A5, 0x5579, 0x86AF, 0x557A, 0x86B0, + 0x557B, 0xE0B4, 0x557C, 0xCCE4, 0x557D, 0x86B1, 0x557E, 0xE0B1, 0x557F, 0x86B2, 0x5580, 0xBFA6, 0x5581, 0xE0AF, 0x5582, 0xCEB9, + 0x5583, 0xE0AB, 0x5584, 0xC9C6, 0x5585, 0x86B3, 0x5586, 0x86B4, 0x5587, 0xC0AE, 0x5588, 0xE0AE, 0x5589, 0xBAED, 0x558A, 0xBAB0, + 0x558B, 0xE0A9, 0x558C, 0x86B5, 0x558D, 0x86B6, 0x558E, 0x86B7, 0x558F, 0xDFF6, 0x5590, 0x86B8, 0x5591, 0xE0B3, 0x5592, 0x86B9, + 0x5593, 0x86BA, 0x5594, 0xE0B8, 0x5595, 0x86BB, 0x5596, 0x86BC, 0x5597, 0x86BD, 0x5598, 0xB4AD, 0x5599, 0xE0B9, 0x559A, 0x86BE, + 0x559B, 0x86BF, 0x559C, 0xCFB2, 0x559D, 0xBAC8, 0x559E, 0x86C0, 0x559F, 0xE0B0, 0x55A0, 0x86C1, 0x55A1, 0x86C2, 0x55A2, 0x86C3, + 0x55A3, 0x86C4, 0x55A4, 0x86C5, 0x55A5, 0x86C6, 0x55A6, 0x86C7, 0x55A7, 0xD0FA, 0x55A8, 0x86C8, 0x55A9, 0x86C9, 0x55AA, 0x86CA, + 0x55AB, 0x86CB, 0x55AC, 0x86CC, 0x55AD, 0x86CD, 0x55AE, 0x86CE, 0x55AF, 0x86CF, 0x55B0, 0x86D0, 0x55B1, 0xE0AC, 0x55B2, 0x86D1, + 0x55B3, 0xD4FB, 0x55B4, 0x86D2, 0x55B5, 0xDFF7, 0x55B6, 0x86D3, 0x55B7, 0xC5E7, 0x55B8, 0x86D4, 0x55B9, 0xE0AD, 0x55BA, 0x86D5, + 0x55BB, 0xD3F7, 0x55BC, 0x86D6, 0x55BD, 0xE0B6, 0x55BE, 0xE0B7, 0x55BF, 0x86D7, 0x55C0, 0x86D8, 0x55C1, 0x86D9, 0x55C2, 0x86DA, + 0x55C3, 0x86DB, 0x55C4, 0xE0C4, 0x55C5, 0xD0E1, 0x55C6, 0x86DC, 0x55C7, 0x86DD, 0x55C8, 0x86DE, 0x55C9, 0xE0BC, 0x55CA, 0x86DF, + 0x55CB, 0x86E0, 0x55CC, 0xE0C9, 0x55CD, 0xE0CA, 0x55CE, 0x86E1, 0x55CF, 0x86E2, 0x55D0, 0x86E3, 0x55D1, 0xE0BE, 0x55D2, 0xE0AA, + 0x55D3, 0xC9A4, 0x55D4, 0xE0C1, 0x55D5, 0x86E4, 0x55D6, 0xE0B2, 0x55D7, 0x86E5, 0x55D8, 0x86E6, 0x55D9, 0x86E7, 0x55DA, 0x86E8, + 0x55DB, 0x86E9, 0x55DC, 0xCAC8, 0x55DD, 0xE0C3, 0x55DE, 0x86EA, 0x55DF, 0xE0B5, 0x55E0, 0x86EB, 0x55E1, 0xCECB, 0x55E2, 0x86EC, + 0x55E3, 0xCBC3, 0x55E4, 0xE0CD, 0x55E5, 0xE0C6, 0x55E6, 0xE0C2, 0x55E7, 0x86ED, 0x55E8, 0xE0CB, 0x55E9, 0x86EE, 0x55EA, 0xE0BA, + 0x55EB, 0xE0BF, 0x55EC, 0xE0C0, 0x55ED, 0x86EF, 0x55EE, 0x86F0, 0x55EF, 0xE0C5, 0x55F0, 0x86F1, 0x55F1, 0x86F2, 0x55F2, 0xE0C7, + 0x55F3, 0xE0C8, 0x55F4, 0x86F3, 0x55F5, 0xE0CC, 0x55F6, 0x86F4, 0x55F7, 0xE0BB, 0x55F8, 0x86F5, 0x55F9, 0x86F6, 0x55FA, 0x86F7, + 0x55FB, 0x86F8, 0x55FC, 0x86F9, 0x55FD, 0xCBD4, 0x55FE, 0xE0D5, 0x55FF, 0x86FA, 0x5600, 0xE0D6, 0x5601, 0xE0D2, 0x5602, 0x86FB, + 0x5603, 0x86FC, 0x5604, 0x86FD, 0x5605, 0x86FE, 0x5606, 0x8740, 0x5607, 0x8741, 0x5608, 0xE0D0, 0x5609, 0xBCCE, 0x560A, 0x8742, + 0x560B, 0x8743, 0x560C, 0xE0D1, 0x560D, 0x8744, 0x560E, 0xB8C2, 0x560F, 0xD8C5, 0x5610, 0x8745, 0x5611, 0x8746, 0x5612, 0x8747, + 0x5613, 0x8748, 0x5614, 0x8749, 0x5615, 0x874A, 0x5616, 0x874B, 0x5617, 0x874C, 0x5618, 0xD0EA, 0x5619, 0x874D, 0x561A, 0x874E, + 0x561B, 0xC2EF, 0x561C, 0x874F, 0x561D, 0x8750, 0x561E, 0xE0CF, 0x561F, 0xE0BD, 0x5620, 0x8751, 0x5621, 0x8752, 0x5622, 0x8753, + 0x5623, 0xE0D4, 0x5624, 0xE0D3, 0x5625, 0x8754, 0x5626, 0x8755, 0x5627, 0xE0D7, 0x5628, 0x8756, 0x5629, 0x8757, 0x562A, 0x8758, + 0x562B, 0x8759, 0x562C, 0xE0DC, 0x562D, 0xE0D8, 0x562E, 0x875A, 0x562F, 0x875B, 0x5630, 0x875C, 0x5631, 0xD6F6, 0x5632, 0xB3B0, + 0x5633, 0x875D, 0x5634, 0xD7EC, 0x5635, 0x875E, 0x5636, 0xCBBB, 0x5637, 0x875F, 0x5638, 0x8760, 0x5639, 0xE0DA, 0x563A, 0x8761, + 0x563B, 0xCEFB, 0x563C, 0x8762, 0x563D, 0x8763, 0x563E, 0x8764, 0x563F, 0xBAD9, 0x5640, 0x8765, 0x5641, 0x8766, 0x5642, 0x8767, + 0x5643, 0x8768, 0x5644, 0x8769, 0x5645, 0x876A, 0x5646, 0x876B, 0x5647, 0x876C, 0x5648, 0x876D, 0x5649, 0x876E, 0x564A, 0x876F, + 0x564B, 0x8770, 0x564C, 0xE0E1, 0x564D, 0xE0DD, 0x564E, 0xD2AD, 0x564F, 0x8771, 0x5650, 0x8772, 0x5651, 0x8773, 0x5652, 0x8774, + 0x5653, 0x8775, 0x5654, 0xE0E2, 0x5655, 0x8776, 0x5656, 0x8777, 0x5657, 0xE0DB, 0x5658, 0xE0D9, 0x5659, 0xE0DF, 0x565A, 0x8778, + 0x565B, 0x8779, 0x565C, 0xE0E0, 0x565D, 0x877A, 0x565E, 0x877B, 0x565F, 0x877C, 0x5660, 0x877D, 0x5661, 0x877E, 0x5662, 0xE0DE, + 0x5663, 0x8780, 0x5664, 0xE0E4, 0x5665, 0x8781, 0x5666, 0x8782, 0x5667, 0x8783, 0x5668, 0xC6F7, 0x5669, 0xD8AC, 0x566A, 0xD4EB, + 0x566B, 0xE0E6, 0x566C, 0xCAC9, 0x566D, 0x8784, 0x566E, 0x8785, 0x566F, 0x8786, 0x5670, 0x8787, 0x5671, 0xE0E5, 0x5672, 0x8788, + 0x5673, 0x8789, 0x5674, 0x878A, 0x5675, 0x878B, 0x5676, 0xB8C1, 0x5677, 0x878C, 0x5678, 0x878D, 0x5679, 0x878E, 0x567A, 0x878F, + 0x567B, 0xE0E7, 0x567C, 0xE0E8, 0x567D, 0x8790, 0x567E, 0x8791, 0x567F, 0x8792, 0x5680, 0x8793, 0x5681, 0x8794, 0x5682, 0x8795, + 0x5683, 0x8796, 0x5684, 0x8797, 0x5685, 0xE0E9, 0x5686, 0xE0E3, 0x5687, 0x8798, 0x5688, 0x8799, 0x5689, 0x879A, 0x568A, 0x879B, + 0x568B, 0x879C, 0x568C, 0x879D, 0x568D, 0x879E, 0x568E, 0xBABF, 0x568F, 0xCCE7, 0x5690, 0x879F, 0x5691, 0x87A0, 0x5692, 0x87A1, + 0x5693, 0xE0EA, 0x5694, 0x87A2, 0x5695, 0x87A3, 0x5696, 0x87A4, 0x5697, 0x87A5, 0x5698, 0x87A6, 0x5699, 0x87A7, 0x569A, 0x87A8, + 0x569B, 0x87A9, 0x569C, 0x87AA, 0x569D, 0x87AB, 0x569E, 0x87AC, 0x569F, 0x87AD, 0x56A0, 0x87AE, 0x56A1, 0x87AF, 0x56A2, 0x87B0, + 0x56A3, 0xCFF9, 0x56A4, 0x87B1, 0x56A5, 0x87B2, 0x56A6, 0x87B3, 0x56A7, 0x87B4, 0x56A8, 0x87B5, 0x56A9, 0x87B6, 0x56AA, 0x87B7, + 0x56AB, 0x87B8, 0x56AC, 0x87B9, 0x56AD, 0x87BA, 0x56AE, 0x87BB, 0x56AF, 0xE0EB, 0x56B0, 0x87BC, 0x56B1, 0x87BD, 0x56B2, 0x87BE, + 0x56B3, 0x87BF, 0x56B4, 0x87C0, 0x56B5, 0x87C1, 0x56B6, 0x87C2, 0x56B7, 0xC8C2, 0x56B8, 0x87C3, 0x56B9, 0x87C4, 0x56BA, 0x87C5, + 0x56BB, 0x87C6, 0x56BC, 0xBDC0, 0x56BD, 0x87C7, 0x56BE, 0x87C8, 0x56BF, 0x87C9, 0x56C0, 0x87CA, 0x56C1, 0x87CB, 0x56C2, 0x87CC, + 0x56C3, 0x87CD, 0x56C4, 0x87CE, 0x56C5, 0x87CF, 0x56C6, 0x87D0, 0x56C7, 0x87D1, 0x56C8, 0x87D2, 0x56C9, 0x87D3, 0x56CA, 0xC4D2, + 0x56CB, 0x87D4, 0x56CC, 0x87D5, 0x56CD, 0x87D6, 0x56CE, 0x87D7, 0x56CF, 0x87D8, 0x56D0, 0x87D9, 0x56D1, 0x87DA, 0x56D2, 0x87DB, + 0x56D3, 0x87DC, 0x56D4, 0xE0EC, 0x56D5, 0x87DD, 0x56D6, 0x87DE, 0x56D7, 0xE0ED, 0x56D8, 0x87DF, 0x56D9, 0x87E0, 0x56DA, 0xC7F4, + 0x56DB, 0xCBC4, 0x56DC, 0x87E1, 0x56DD, 0xE0EE, 0x56DE, 0xBBD8, 0x56DF, 0xD8B6, 0x56E0, 0xD2F2, 0x56E1, 0xE0EF, 0x56E2, 0xCDC5, + 0x56E3, 0x87E2, 0x56E4, 0xB6DA, 0x56E5, 0x87E3, 0x56E6, 0x87E4, 0x56E7, 0x87E5, 0x56E8, 0x87E6, 0x56E9, 0x87E7, 0x56EA, 0x87E8, + 0x56EB, 0xE0F1, 0x56EC, 0x87E9, 0x56ED, 0xD4B0, 0x56EE, 0x87EA, 0x56EF, 0x87EB, 0x56F0, 0xC0A7, 0x56F1, 0xB4D1, 0x56F2, 0x87EC, + 0x56F3, 0x87ED, 0x56F4, 0xCEA7, 0x56F5, 0xE0F0, 0x56F6, 0x87EE, 0x56F7, 0x87EF, 0x56F8, 0x87F0, 0x56F9, 0xE0F2, 0x56FA, 0xB9CC, + 0x56FB, 0x87F1, 0x56FC, 0x87F2, 0x56FD, 0xB9FA, 0x56FE, 0xCDBC, 0x56FF, 0xE0F3, 0x5700, 0x87F3, 0x5701, 0x87F4, 0x5702, 0x87F5, + 0x5703, 0xC6D4, 0x5704, 0xE0F4, 0x5705, 0x87F6, 0x5706, 0xD4B2, 0x5707, 0x87F7, 0x5708, 0xC8A6, 0x5709, 0xE0F6, 0x570A, 0xE0F5, + 0x570B, 0x87F8, 0x570C, 0x87F9, 0x570D, 0x87FA, 0x570E, 0x87FB, 0x570F, 0x87FC, 0x5710, 0x87FD, 0x5711, 0x87FE, 0x5712, 0x8840, + 0x5713, 0x8841, 0x5714, 0x8842, 0x5715, 0x8843, 0x5716, 0x8844, 0x5717, 0x8845, 0x5718, 0x8846, 0x5719, 0x8847, 0x571A, 0x8848, + 0x571B, 0x8849, 0x571C, 0xE0F7, 0x571D, 0x884A, 0x571E, 0x884B, 0x571F, 0xCDC1, 0x5720, 0x884C, 0x5721, 0x884D, 0x5722, 0x884E, + 0x5723, 0xCAA5, 0x5724, 0x884F, 0x5725, 0x8850, 0x5726, 0x8851, 0x5727, 0x8852, 0x5728, 0xD4DA, 0x5729, 0xDBD7, 0x572A, 0xDBD9, + 0x572B, 0x8853, 0x572C, 0xDBD8, 0x572D, 0xB9E7, 0x572E, 0xDBDC, 0x572F, 0xDBDD, 0x5730, 0xB5D8, 0x5731, 0x8854, 0x5732, 0x8855, + 0x5733, 0xDBDA, 0x5734, 0x8856, 0x5735, 0x8857, 0x5736, 0x8858, 0x5737, 0x8859, 0x5738, 0x885A, 0x5739, 0xDBDB, 0x573A, 0xB3A1, + 0x573B, 0xDBDF, 0x573C, 0x885B, 0x573D, 0x885C, 0x573E, 0xBBF8, 0x573F, 0x885D, 0x5740, 0xD6B7, 0x5741, 0x885E, 0x5742, 0xDBE0, + 0x5743, 0x885F, 0x5744, 0x8860, 0x5745, 0x8861, 0x5746, 0x8862, 0x5747, 0xBEF9, 0x5748, 0x8863, 0x5749, 0x8864, 0x574A, 0xB7BB, + 0x574B, 0x8865, 0x574C, 0xDBD0, 0x574D, 0xCCAE, 0x574E, 0xBFB2, 0x574F, 0xBBB5, 0x5750, 0xD7F8, 0x5751, 0xBFD3, 0x5752, 0x8866, + 0x5753, 0x8867, 0x5754, 0x8868, 0x5755, 0x8869, 0x5756, 0x886A, 0x5757, 0xBFE9, 0x5758, 0x886B, 0x5759, 0x886C, 0x575A, 0xBCE1, + 0x575B, 0xCCB3, 0x575C, 0xDBDE, 0x575D, 0xB0D3, 0x575E, 0xCEEB, 0x575F, 0xB7D8, 0x5760, 0xD7B9, 0x5761, 0xC6C2, 0x5762, 0x886D, + 0x5763, 0x886E, 0x5764, 0xC0A4, 0x5765, 0x886F, 0x5766, 0xCCB9, 0x5767, 0x8870, 0x5768, 0xDBE7, 0x5769, 0xDBE1, 0x576A, 0xC6BA, + 0x576B, 0xDBE3, 0x576C, 0x8871, 0x576D, 0xDBE8, 0x576E, 0x8872, 0x576F, 0xC5F7, 0x5770, 0x8873, 0x5771, 0x8874, 0x5772, 0x8875, + 0x5773, 0xDBEA, 0x5774, 0x8876, 0x5775, 0x8877, 0x5776, 0xDBE9, 0x5777, 0xBFC0, 0x5778, 0x8878, 0x5779, 0x8879, 0x577A, 0x887A, + 0x577B, 0xDBE6, 0x577C, 0xDBE5, 0x577D, 0x887B, 0x577E, 0x887C, 0x577F, 0x887D, 0x5780, 0x887E, 0x5781, 0x8880, 0x5782, 0xB4B9, + 0x5783, 0xC0AC, 0x5784, 0xC2A2, 0x5785, 0xDBE2, 0x5786, 0xDBE4, 0x5787, 0x8881, 0x5788, 0x8882, 0x5789, 0x8883, 0x578A, 0x8884, + 0x578B, 0xD0CD, 0x578C, 0xDBED, 0x578D, 0x8885, 0x578E, 0x8886, 0x578F, 0x8887, 0x5790, 0x8888, 0x5791, 0x8889, 0x5792, 0xC0DD, + 0x5793, 0xDBF2, 0x5794, 0x888A, 0x5795, 0x888B, 0x5796, 0x888C, 0x5797, 0x888D, 0x5798, 0x888E, 0x5799, 0x888F, 0x579A, 0x8890, + 0x579B, 0xB6E2, 0x579C, 0x8891, 0x579D, 0x8892, 0x579E, 0x8893, 0x579F, 0x8894, 0x57A0, 0xDBF3, 0x57A1, 0xDBD2, 0x57A2, 0xB9B8, + 0x57A3, 0xD4AB, 0x57A4, 0xDBEC, 0x57A5, 0x8895, 0x57A6, 0xBFD1, 0x57A7, 0xDBF0, 0x57A8, 0x8896, 0x57A9, 0xDBD1, 0x57AA, 0x8897, + 0x57AB, 0xB5E6, 0x57AC, 0x8898, 0x57AD, 0xDBEB, 0x57AE, 0xBFE5, 0x57AF, 0x8899, 0x57B0, 0x889A, 0x57B1, 0x889B, 0x57B2, 0xDBEE, + 0x57B3, 0x889C, 0x57B4, 0xDBF1, 0x57B5, 0x889D, 0x57B6, 0x889E, 0x57B7, 0x889F, 0x57B8, 0xDBF9, 0x57B9, 0x88A0, 0x57BA, 0x88A1, + 0x57BB, 0x88A2, 0x57BC, 0x88A3, 0x57BD, 0x88A4, 0x57BE, 0x88A5, 0x57BF, 0x88A6, 0x57C0, 0x88A7, 0x57C1, 0x88A8, 0x57C2, 0xB9A1, + 0x57C3, 0xB0A3, 0x57C4, 0x88A9, 0x57C5, 0x88AA, 0x57C6, 0x88AB, 0x57C7, 0x88AC, 0x57C8, 0x88AD, 0x57C9, 0x88AE, 0x57CA, 0x88AF, + 0x57CB, 0xC2F1, 0x57CC, 0x88B0, 0x57CD, 0x88B1, 0x57CE, 0xB3C7, 0x57CF, 0xDBEF, 0x57D0, 0x88B2, 0x57D1, 0x88B3, 0x57D2, 0xDBF8, + 0x57D3, 0x88B4, 0x57D4, 0xC6D2, 0x57D5, 0xDBF4, 0x57D6, 0x88B5, 0x57D7, 0x88B6, 0x57D8, 0xDBF5, 0x57D9, 0xDBF7, 0x57DA, 0xDBF6, + 0x57DB, 0x88B7, 0x57DC, 0x88B8, 0x57DD, 0xDBFE, 0x57DE, 0x88B9, 0x57DF, 0xD3F2, 0x57E0, 0xB2BA, 0x57E1, 0x88BA, 0x57E2, 0x88BB, + 0x57E3, 0x88BC, 0x57E4, 0xDBFD, 0x57E5, 0x88BD, 0x57E6, 0x88BE, 0x57E7, 0x88BF, 0x57E8, 0x88C0, 0x57E9, 0x88C1, 0x57EA, 0x88C2, + 0x57EB, 0x88C3, 0x57EC, 0x88C4, 0x57ED, 0xDCA4, 0x57EE, 0x88C5, 0x57EF, 0xDBFB, 0x57F0, 0x88C6, 0x57F1, 0x88C7, 0x57F2, 0x88C8, + 0x57F3, 0x88C9, 0x57F4, 0xDBFA, 0x57F5, 0x88CA, 0x57F6, 0x88CB, 0x57F7, 0x88CC, 0x57F8, 0xDBFC, 0x57F9, 0xC5E0, 0x57FA, 0xBBF9, + 0x57FB, 0x88CD, 0x57FC, 0x88CE, 0x57FD, 0xDCA3, 0x57FE, 0x88CF, 0x57FF, 0x88D0, 0x5800, 0xDCA5, 0x5801, 0x88D1, 0x5802, 0xCCC3, + 0x5803, 0x88D2, 0x5804, 0x88D3, 0x5805, 0x88D4, 0x5806, 0xB6D1, 0x5807, 0xDDC0, 0x5808, 0x88D5, 0x5809, 0x88D6, 0x580A, 0x88D7, + 0x580B, 0xDCA1, 0x580C, 0x88D8, 0x580D, 0xDCA2, 0x580E, 0x88D9, 0x580F, 0x88DA, 0x5810, 0x88DB, 0x5811, 0xC7B5, 0x5812, 0x88DC, + 0x5813, 0x88DD, 0x5814, 0x88DE, 0x5815, 0xB6E9, 0x5816, 0x88DF, 0x5817, 0x88E0, 0x5818, 0x88E1, 0x5819, 0xDCA7, 0x581A, 0x88E2, + 0x581B, 0x88E3, 0x581C, 0x88E4, 0x581D, 0x88E5, 0x581E, 0xDCA6, 0x581F, 0x88E6, 0x5820, 0xDCA9, 0x5821, 0xB1A4, 0x5822, 0x88E7, + 0x5823, 0x88E8, 0x5824, 0xB5CC, 0x5825, 0x88E9, 0x5826, 0x88EA, 0x5827, 0x88EB, 0x5828, 0x88EC, 0x5829, 0x88ED, 0x582A, 0xBFB0, + 0x582B, 0x88EE, 0x582C, 0x88EF, 0x582D, 0x88F0, 0x582E, 0x88F1, 0x582F, 0x88F2, 0x5830, 0xD1DF, 0x5831, 0x88F3, 0x5832, 0x88F4, + 0x5833, 0x88F5, 0x5834, 0x88F6, 0x5835, 0xB6C2, 0x5836, 0x88F7, 0x5837, 0x88F8, 0x5838, 0x88F9, 0x5839, 0x88FA, 0x583A, 0x88FB, + 0x583B, 0x88FC, 0x583C, 0x88FD, 0x583D, 0x88FE, 0x583E, 0x8940, 0x583F, 0x8941, 0x5840, 0x8942, 0x5841, 0x8943, 0x5842, 0x8944, + 0x5843, 0x8945, 0x5844, 0xDCA8, 0x5845, 0x8946, 0x5846, 0x8947, 0x5847, 0x8948, 0x5848, 0x8949, 0x5849, 0x894A, 0x584A, 0x894B, + 0x584B, 0x894C, 0x584C, 0xCBFA, 0x584D, 0xEBF3, 0x584E, 0x894D, 0x584F, 0x894E, 0x5850, 0x894F, 0x5851, 0xCBDC, 0x5852, 0x8950, + 0x5853, 0x8951, 0x5854, 0xCBFE, 0x5855, 0x8952, 0x5856, 0x8953, 0x5857, 0x8954, 0x5858, 0xCCC1, 0x5859, 0x8955, 0x585A, 0x8956, + 0x585B, 0x8957, 0x585C, 0x8958, 0x585D, 0x8959, 0x585E, 0xC8FB, 0x585F, 0x895A, 0x5860, 0x895B, 0x5861, 0x895C, 0x5862, 0x895D, + 0x5863, 0x895E, 0x5864, 0x895F, 0x5865, 0xDCAA, 0x5866, 0x8960, 0x5867, 0x8961, 0x5868, 0x8962, 0x5869, 0x8963, 0x586A, 0x8964, + 0x586B, 0xCCEE, 0x586C, 0xDCAB, 0x586D, 0x8965, 0x586E, 0x8966, 0x586F, 0x8967, 0x5870, 0x8968, 0x5871, 0x8969, 0x5872, 0x896A, + 0x5873, 0x896B, 0x5874, 0x896C, 0x5875, 0x896D, 0x5876, 0x896E, 0x5877, 0x896F, 0x5878, 0x8970, 0x5879, 0x8971, 0x587A, 0x8972, + 0x587B, 0x8973, 0x587C, 0x8974, 0x587D, 0x8975, 0x587E, 0xDBD3, 0x587F, 0x8976, 0x5880, 0xDCAF, 0x5881, 0xDCAC, 0x5882, 0x8977, + 0x5883, 0xBEB3, 0x5884, 0x8978, 0x5885, 0xCAFB, 0x5886, 0x8979, 0x5887, 0x897A, 0x5888, 0x897B, 0x5889, 0xDCAD, 0x588A, 0x897C, + 0x588B, 0x897D, 0x588C, 0x897E, 0x588D, 0x8980, 0x588E, 0x8981, 0x588F, 0x8982, 0x5890, 0x8983, 0x5891, 0x8984, 0x5892, 0xC9CA, + 0x5893, 0xC4B9, 0x5894, 0x8985, 0x5895, 0x8986, 0x5896, 0x8987, 0x5897, 0x8988, 0x5898, 0x8989, 0x5899, 0xC7BD, 0x589A, 0xDCAE, + 0x589B, 0x898A, 0x589C, 0x898B, 0x589D, 0x898C, 0x589E, 0xD4F6, 0x589F, 0xD0E6, 0x58A0, 0x898D, 0x58A1, 0x898E, 0x58A2, 0x898F, + 0x58A3, 0x8990, 0x58A4, 0x8991, 0x58A5, 0x8992, 0x58A6, 0x8993, 0x58A7, 0x8994, 0x58A8, 0xC4AB, 0x58A9, 0xB6D5, 0x58AA, 0x8995, + 0x58AB, 0x8996, 0x58AC, 0x8997, 0x58AD, 0x8998, 0x58AE, 0x8999, 0x58AF, 0x899A, 0x58B0, 0x899B, 0x58B1, 0x899C, 0x58B2, 0x899D, + 0x58B3, 0x899E, 0x58B4, 0x899F, 0x58B5, 0x89A0, 0x58B6, 0x89A1, 0x58B7, 0x89A2, 0x58B8, 0x89A3, 0x58B9, 0x89A4, 0x58BA, 0x89A5, + 0x58BB, 0x89A6, 0x58BC, 0xDBD4, 0x58BD, 0x89A7, 0x58BE, 0x89A8, 0x58BF, 0x89A9, 0x58C0, 0x89AA, 0x58C1, 0xB1DA, 0x58C2, 0x89AB, + 0x58C3, 0x89AC, 0x58C4, 0x89AD, 0x58C5, 0xDBD5, 0x58C6, 0x89AE, 0x58C7, 0x89AF, 0x58C8, 0x89B0, 0x58C9, 0x89B1, 0x58CA, 0x89B2, + 0x58CB, 0x89B3, 0x58CC, 0x89B4, 0x58CD, 0x89B5, 0x58CE, 0x89B6, 0x58CF, 0x89B7, 0x58D0, 0x89B8, 0x58D1, 0xDBD6, 0x58D2, 0x89B9, + 0x58D3, 0x89BA, 0x58D4, 0x89BB, 0x58D5, 0xBABE, 0x58D6, 0x89BC, 0x58D7, 0x89BD, 0x58D8, 0x89BE, 0x58D9, 0x89BF, 0x58DA, 0x89C0, + 0x58DB, 0x89C1, 0x58DC, 0x89C2, 0x58DD, 0x89C3, 0x58DE, 0x89C4, 0x58DF, 0x89C5, 0x58E0, 0x89C6, 0x58E1, 0x89C7, 0x58E2, 0x89C8, + 0x58E3, 0x89C9, 0x58E4, 0xC8C0, 0x58E5, 0x89CA, 0x58E6, 0x89CB, 0x58E7, 0x89CC, 0x58E8, 0x89CD, 0x58E9, 0x89CE, 0x58EA, 0x89CF, + 0x58EB, 0xCABF, 0x58EC, 0xC8C9, 0x58ED, 0x89D0, 0x58EE, 0xD7B3, 0x58EF, 0x89D1, 0x58F0, 0xC9F9, 0x58F1, 0x89D2, 0x58F2, 0x89D3, + 0x58F3, 0xBFC7, 0x58F4, 0x89D4, 0x58F5, 0x89D5, 0x58F6, 0xBAF8, 0x58F7, 0x89D6, 0x58F8, 0x89D7, 0x58F9, 0xD2BC, 0x58FA, 0x89D8, + 0x58FB, 0x89D9, 0x58FC, 0x89DA, 0x58FD, 0x89DB, 0x58FE, 0x89DC, 0x58FF, 0x89DD, 0x5900, 0x89DE, 0x5901, 0x89DF, 0x5902, 0xE2BA, + 0x5903, 0x89E0, 0x5904, 0xB4A6, 0x5905, 0x89E1, 0x5906, 0x89E2, 0x5907, 0xB1B8, 0x5908, 0x89E3, 0x5909, 0x89E4, 0x590A, 0x89E5, + 0x590B, 0x89E6, 0x590C, 0x89E7, 0x590D, 0xB8B4, 0x590E, 0x89E8, 0x590F, 0xCFC4, 0x5910, 0x89E9, 0x5911, 0x89EA, 0x5912, 0x89EB, + 0x5913, 0x89EC, 0x5914, 0xD9E7, 0x5915, 0xCFA6, 0x5916, 0xCDE2, 0x5917, 0x89ED, 0x5918, 0x89EE, 0x5919, 0xD9ED, 0x591A, 0xB6E0, + 0x591B, 0x89EF, 0x591C, 0xD2B9, 0x591D, 0x89F0, 0x591E, 0x89F1, 0x591F, 0xB9BB, 0x5920, 0x89F2, 0x5921, 0x89F3, 0x5922, 0x89F4, + 0x5923, 0x89F5, 0x5924, 0xE2B9, 0x5925, 0xE2B7, 0x5926, 0x89F6, 0x5927, 0xB4F3, 0x5928, 0x89F7, 0x5929, 0xCCEC, 0x592A, 0xCCAB, + 0x592B, 0xB7F2, 0x592C, 0x89F8, 0x592D, 0xD8B2, 0x592E, 0xD1EB, 0x592F, 0xBABB, 0x5930, 0x89F9, 0x5931, 0xCAA7, 0x5932, 0x89FA, + 0x5933, 0x89FB, 0x5934, 0xCDB7, 0x5935, 0x89FC, 0x5936, 0x89FD, 0x5937, 0xD2C4, 0x5938, 0xBFE4, 0x5939, 0xBCD0, 0x593A, 0xB6E1, + 0x593B, 0x89FE, 0x593C, 0xDEC5, 0x593D, 0x8A40, 0x593E, 0x8A41, 0x593F, 0x8A42, 0x5940, 0x8A43, 0x5941, 0xDEC6, 0x5942, 0xDBBC, + 0x5943, 0x8A44, 0x5944, 0xD1D9, 0x5945, 0x8A45, 0x5946, 0x8A46, 0x5947, 0xC6E6, 0x5948, 0xC4CE, 0x5949, 0xB7EE, 0x594A, 0x8A47, + 0x594B, 0xB7DC, 0x594C, 0x8A48, 0x594D, 0x8A49, 0x594E, 0xBFFC, 0x594F, 0xD7E0, 0x5950, 0x8A4A, 0x5951, 0xC6F5, 0x5952, 0x8A4B, + 0x5953, 0x8A4C, 0x5954, 0xB1BC, 0x5955, 0xDEC8, 0x5956, 0xBDB1, 0x5957, 0xCCD7, 0x5958, 0xDECA, 0x5959, 0x8A4D, 0x595A, 0xDEC9, + 0x595B, 0x8A4E, 0x595C, 0x8A4F, 0x595D, 0x8A50, 0x595E, 0x8A51, 0x595F, 0x8A52, 0x5960, 0xB5EC, 0x5961, 0x8A53, 0x5962, 0xC9DD, + 0x5963, 0x8A54, 0x5964, 0x8A55, 0x5965, 0xB0C2, 0x5966, 0x8A56, 0x5967, 0x8A57, 0x5968, 0x8A58, 0x5969, 0x8A59, 0x596A, 0x8A5A, + 0x596B, 0x8A5B, 0x596C, 0x8A5C, 0x596D, 0x8A5D, 0x596E, 0x8A5E, 0x596F, 0x8A5F, 0x5970, 0x8A60, 0x5971, 0x8A61, 0x5972, 0x8A62, + 0x5973, 0xC5AE, 0x5974, 0xC5AB, 0x5975, 0x8A63, 0x5976, 0xC4CC, 0x5977, 0x8A64, 0x5978, 0xBCE9, 0x5979, 0xCBFD, 0x597A, 0x8A65, + 0x597B, 0x8A66, 0x597C, 0x8A67, 0x597D, 0xBAC3, 0x597E, 0x8A68, 0x597F, 0x8A69, 0x5980, 0x8A6A, 0x5981, 0xE5F9, 0x5982, 0xC8E7, + 0x5983, 0xE5FA, 0x5984, 0xCDFD, 0x5985, 0x8A6B, 0x5986, 0xD7B1, 0x5987, 0xB8BE, 0x5988, 0xC2E8, 0x5989, 0x8A6C, 0x598A, 0xC8D1, + 0x598B, 0x8A6D, 0x598C, 0x8A6E, 0x598D, 0xE5FB, 0x598E, 0x8A6F, 0x598F, 0x8A70, 0x5990, 0x8A71, 0x5991, 0x8A72, 0x5992, 0xB6CA, + 0x5993, 0xBCCB, 0x5994, 0x8A73, 0x5995, 0x8A74, 0x5996, 0xD1FD, 0x5997, 0xE6A1, 0x5998, 0x8A75, 0x5999, 0xC3EE, 0x599A, 0x8A76, + 0x599B, 0x8A77, 0x599C, 0x8A78, 0x599D, 0x8A79, 0x599E, 0xE6A4, 0x599F, 0x8A7A, 0x59A0, 0x8A7B, 0x59A1, 0x8A7C, 0x59A2, 0x8A7D, + 0x59A3, 0xE5FE, 0x59A4, 0xE6A5, 0x59A5, 0xCDD7, 0x59A6, 0x8A7E, 0x59A7, 0x8A80, 0x59A8, 0xB7C1, 0x59A9, 0xE5FC, 0x59AA, 0xE5FD, + 0x59AB, 0xE6A3, 0x59AC, 0x8A81, 0x59AD, 0x8A82, 0x59AE, 0xC4DD, 0x59AF, 0xE6A8, 0x59B0, 0x8A83, 0x59B1, 0x8A84, 0x59B2, 0xE6A7, + 0x59B3, 0x8A85, 0x59B4, 0x8A86, 0x59B5, 0x8A87, 0x59B6, 0x8A88, 0x59B7, 0x8A89, 0x59B8, 0x8A8A, 0x59B9, 0xC3C3, 0x59BA, 0x8A8B, + 0x59BB, 0xC6DE, 0x59BC, 0x8A8C, 0x59BD, 0x8A8D, 0x59BE, 0xE6AA, 0x59BF, 0x8A8E, 0x59C0, 0x8A8F, 0x59C1, 0x8A90, 0x59C2, 0x8A91, + 0x59C3, 0x8A92, 0x59C4, 0x8A93, 0x59C5, 0x8A94, 0x59C6, 0xC4B7, 0x59C7, 0x8A95, 0x59C8, 0x8A96, 0x59C9, 0x8A97, 0x59CA, 0xE6A2, + 0x59CB, 0xCABC, 0x59CC, 0x8A98, 0x59CD, 0x8A99, 0x59CE, 0x8A9A, 0x59CF, 0x8A9B, 0x59D0, 0xBDE3, 0x59D1, 0xB9C3, 0x59D2, 0xE6A6, + 0x59D3, 0xD0D5, 0x59D4, 0xCEAF, 0x59D5, 0x8A9C, 0x59D6, 0x8A9D, 0x59D7, 0xE6A9, 0x59D8, 0xE6B0, 0x59D9, 0x8A9E, 0x59DA, 0xD2A6, + 0x59DB, 0x8A9F, 0x59DC, 0xBDAA, 0x59DD, 0xE6AD, 0x59DE, 0x8AA0, 0x59DF, 0x8AA1, 0x59E0, 0x8AA2, 0x59E1, 0x8AA3, 0x59E2, 0x8AA4, + 0x59E3, 0xE6AF, 0x59E4, 0x8AA5, 0x59E5, 0xC0D1, 0x59E6, 0x8AA6, 0x59E7, 0x8AA7, 0x59E8, 0xD2CC, 0x59E9, 0x8AA8, 0x59EA, 0x8AA9, + 0x59EB, 0x8AAA, 0x59EC, 0xBCA7, 0x59ED, 0x8AAB, 0x59EE, 0x8AAC, 0x59EF, 0x8AAD, 0x59F0, 0x8AAE, 0x59F1, 0x8AAF, 0x59F2, 0x8AB0, + 0x59F3, 0x8AB1, 0x59F4, 0x8AB2, 0x59F5, 0x8AB3, 0x59F6, 0x8AB4, 0x59F7, 0x8AB5, 0x59F8, 0x8AB6, 0x59F9, 0xE6B1, 0x59FA, 0x8AB7, + 0x59FB, 0xD2F6, 0x59FC, 0x8AB8, 0x59FD, 0x8AB9, 0x59FE, 0x8ABA, 0x59FF, 0xD7CB, 0x5A00, 0x8ABB, 0x5A01, 0xCDFE, 0x5A02, 0x8ABC, + 0x5A03, 0xCDDE, 0x5A04, 0xC2A6, 0x5A05, 0xE6AB, 0x5A06, 0xE6AC, 0x5A07, 0xBDBF, 0x5A08, 0xE6AE, 0x5A09, 0xE6B3, 0x5A0A, 0x8ABD, + 0x5A0B, 0x8ABE, 0x5A0C, 0xE6B2, 0x5A0D, 0x8ABF, 0x5A0E, 0x8AC0, 0x5A0F, 0x8AC1, 0x5A10, 0x8AC2, 0x5A11, 0xE6B6, 0x5A12, 0x8AC3, + 0x5A13, 0xE6B8, 0x5A14, 0x8AC4, 0x5A15, 0x8AC5, 0x5A16, 0x8AC6, 0x5A17, 0x8AC7, 0x5A18, 0xC4EF, 0x5A19, 0x8AC8, 0x5A1A, 0x8AC9, + 0x5A1B, 0x8ACA, 0x5A1C, 0xC4C8, 0x5A1D, 0x8ACB, 0x5A1E, 0x8ACC, 0x5A1F, 0xBEEA, 0x5A20, 0xC9EF, 0x5A21, 0x8ACD, 0x5A22, 0x8ACE, + 0x5A23, 0xE6B7, 0x5A24, 0x8ACF, 0x5A25, 0xB6F0, 0x5A26, 0x8AD0, 0x5A27, 0x8AD1, 0x5A28, 0x8AD2, 0x5A29, 0xC3E4, 0x5A2A, 0x8AD3, + 0x5A2B, 0x8AD4, 0x5A2C, 0x8AD5, 0x5A2D, 0x8AD6, 0x5A2E, 0x8AD7, 0x5A2F, 0x8AD8, 0x5A30, 0x8AD9, 0x5A31, 0xD3E9, 0x5A32, 0xE6B4, + 0x5A33, 0x8ADA, 0x5A34, 0xE6B5, 0x5A35, 0x8ADB, 0x5A36, 0xC8A2, 0x5A37, 0x8ADC, 0x5A38, 0x8ADD, 0x5A39, 0x8ADE, 0x5A3A, 0x8ADF, + 0x5A3B, 0x8AE0, 0x5A3C, 0xE6BD, 0x5A3D, 0x8AE1, 0x5A3E, 0x8AE2, 0x5A3F, 0x8AE3, 0x5A40, 0xE6B9, 0x5A41, 0x8AE4, 0x5A42, 0x8AE5, + 0x5A43, 0x8AE6, 0x5A44, 0x8AE7, 0x5A45, 0x8AE8, 0x5A46, 0xC6C5, 0x5A47, 0x8AE9, 0x5A48, 0x8AEA, 0x5A49, 0xCDF1, 0x5A4A, 0xE6BB, + 0x5A4B, 0x8AEB, 0x5A4C, 0x8AEC, 0x5A4D, 0x8AED, 0x5A4E, 0x8AEE, 0x5A4F, 0x8AEF, 0x5A50, 0x8AF0, 0x5A51, 0x8AF1, 0x5A52, 0x8AF2, + 0x5A53, 0x8AF3, 0x5A54, 0x8AF4, 0x5A55, 0xE6BC, 0x5A56, 0x8AF5, 0x5A57, 0x8AF6, 0x5A58, 0x8AF7, 0x5A59, 0x8AF8, 0x5A5A, 0xBBE9, + 0x5A5B, 0x8AF9, 0x5A5C, 0x8AFA, 0x5A5D, 0x8AFB, 0x5A5E, 0x8AFC, 0x5A5F, 0x8AFD, 0x5A60, 0x8AFE, 0x5A61, 0x8B40, 0x5A62, 0xE6BE, + 0x5A63, 0x8B41, 0x5A64, 0x8B42, 0x5A65, 0x8B43, 0x5A66, 0x8B44, 0x5A67, 0xE6BA, 0x5A68, 0x8B45, 0x5A69, 0x8B46, 0x5A6A, 0xC0B7, + 0x5A6B, 0x8B47, 0x5A6C, 0x8B48, 0x5A6D, 0x8B49, 0x5A6E, 0x8B4A, 0x5A6F, 0x8B4B, 0x5A70, 0x8B4C, 0x5A71, 0x8B4D, 0x5A72, 0x8B4E, + 0x5A73, 0x8B4F, 0x5A74, 0xD3A4, 0x5A75, 0xE6BF, 0x5A76, 0xC9F4, 0x5A77, 0xE6C3, 0x5A78, 0x8B50, 0x5A79, 0x8B51, 0x5A7A, 0xE6C4, + 0x5A7B, 0x8B52, 0x5A7C, 0x8B53, 0x5A7D, 0x8B54, 0x5A7E, 0x8B55, 0x5A7F, 0xD0F6, 0x5A80, 0x8B56, 0x5A81, 0x8B57, 0x5A82, 0x8B58, + 0x5A83, 0x8B59, 0x5A84, 0x8B5A, 0x5A85, 0x8B5B, 0x5A86, 0x8B5C, 0x5A87, 0x8B5D, 0x5A88, 0x8B5E, 0x5A89, 0x8B5F, 0x5A8A, 0x8B60, + 0x5A8B, 0x8B61, 0x5A8C, 0x8B62, 0x5A8D, 0x8B63, 0x5A8E, 0x8B64, 0x5A8F, 0x8B65, 0x5A90, 0x8B66, 0x5A91, 0x8B67, 0x5A92, 0xC3BD, + 0x5A93, 0x8B68, 0x5A94, 0x8B69, 0x5A95, 0x8B6A, 0x5A96, 0x8B6B, 0x5A97, 0x8B6C, 0x5A98, 0x8B6D, 0x5A99, 0x8B6E, 0x5A9A, 0xC3C4, + 0x5A9B, 0xE6C2, 0x5A9C, 0x8B6F, 0x5A9D, 0x8B70, 0x5A9E, 0x8B71, 0x5A9F, 0x8B72, 0x5AA0, 0x8B73, 0x5AA1, 0x8B74, 0x5AA2, 0x8B75, + 0x5AA3, 0x8B76, 0x5AA4, 0x8B77, 0x5AA5, 0x8B78, 0x5AA6, 0x8B79, 0x5AA7, 0x8B7A, 0x5AA8, 0x8B7B, 0x5AA9, 0x8B7C, 0x5AAA, 0xE6C1, + 0x5AAB, 0x8B7D, 0x5AAC, 0x8B7E, 0x5AAD, 0x8B80, 0x5AAE, 0x8B81, 0x5AAF, 0x8B82, 0x5AB0, 0x8B83, 0x5AB1, 0x8B84, 0x5AB2, 0xE6C7, + 0x5AB3, 0xCFB1, 0x5AB4, 0x8B85, 0x5AB5, 0xEBF4, 0x5AB6, 0x8B86, 0x5AB7, 0x8B87, 0x5AB8, 0xE6CA, 0x5AB9, 0x8B88, 0x5ABA, 0x8B89, + 0x5ABB, 0x8B8A, 0x5ABC, 0x8B8B, 0x5ABD, 0x8B8C, 0x5ABE, 0xE6C5, 0x5ABF, 0x8B8D, 0x5AC0, 0x8B8E, 0x5AC1, 0xBCDE, 0x5AC2, 0xC9A9, + 0x5AC3, 0x8B8F, 0x5AC4, 0x8B90, 0x5AC5, 0x8B91, 0x5AC6, 0x8B92, 0x5AC7, 0x8B93, 0x5AC8, 0x8B94, 0x5AC9, 0xBCB5, 0x5ACA, 0x8B95, + 0x5ACB, 0x8B96, 0x5ACC, 0xCFD3, 0x5ACD, 0x8B97, 0x5ACE, 0x8B98, 0x5ACF, 0x8B99, 0x5AD0, 0x8B9A, 0x5AD1, 0x8B9B, 0x5AD2, 0xE6C8, + 0x5AD3, 0x8B9C, 0x5AD4, 0xE6C9, 0x5AD5, 0x8B9D, 0x5AD6, 0xE6CE, 0x5AD7, 0x8B9E, 0x5AD8, 0xE6D0, 0x5AD9, 0x8B9F, 0x5ADA, 0x8BA0, + 0x5ADB, 0x8BA1, 0x5ADC, 0xE6D1, 0x5ADD, 0x8BA2, 0x5ADE, 0x8BA3, 0x5ADF, 0x8BA4, 0x5AE0, 0xE6CB, 0x5AE1, 0xB5D5, 0x5AE2, 0x8BA5, + 0x5AE3, 0xE6CC, 0x5AE4, 0x8BA6, 0x5AE5, 0x8BA7, 0x5AE6, 0xE6CF, 0x5AE7, 0x8BA8, 0x5AE8, 0x8BA9, 0x5AE9, 0xC4DB, 0x5AEA, 0x8BAA, + 0x5AEB, 0xE6C6, 0x5AEC, 0x8BAB, 0x5AED, 0x8BAC, 0x5AEE, 0x8BAD, 0x5AEF, 0x8BAE, 0x5AF0, 0x8BAF, 0x5AF1, 0xE6CD, 0x5AF2, 0x8BB0, + 0x5AF3, 0x8BB1, 0x5AF4, 0x8BB2, 0x5AF5, 0x8BB3, 0x5AF6, 0x8BB4, 0x5AF7, 0x8BB5, 0x5AF8, 0x8BB6, 0x5AF9, 0x8BB7, 0x5AFA, 0x8BB8, + 0x5AFB, 0x8BB9, 0x5AFC, 0x8BBA, 0x5AFD, 0x8BBB, 0x5AFE, 0x8BBC, 0x5AFF, 0x8BBD, 0x5B00, 0x8BBE, 0x5B01, 0x8BBF, 0x5B02, 0x8BC0, + 0x5B03, 0x8BC1, 0x5B04, 0x8BC2, 0x5B05, 0x8BC3, 0x5B06, 0x8BC4, 0x5B07, 0x8BC5, 0x5B08, 0x8BC6, 0x5B09, 0xE6D2, 0x5B0A, 0x8BC7, + 0x5B0B, 0x8BC8, 0x5B0C, 0x8BC9, 0x5B0D, 0x8BCA, 0x5B0E, 0x8BCB, 0x5B0F, 0x8BCC, 0x5B10, 0x8BCD, 0x5B11, 0x8BCE, 0x5B12, 0x8BCF, + 0x5B13, 0x8BD0, 0x5B14, 0x8BD1, 0x5B15, 0x8BD2, 0x5B16, 0xE6D4, 0x5B17, 0xE6D3, 0x5B18, 0x8BD3, 0x5B19, 0x8BD4, 0x5B1A, 0x8BD5, + 0x5B1B, 0x8BD6, 0x5B1C, 0x8BD7, 0x5B1D, 0x8BD8, 0x5B1E, 0x8BD9, 0x5B1F, 0x8BDA, 0x5B20, 0x8BDB, 0x5B21, 0x8BDC, 0x5B22, 0x8BDD, + 0x5B23, 0x8BDE, 0x5B24, 0x8BDF, 0x5B25, 0x8BE0, 0x5B26, 0x8BE1, 0x5B27, 0x8BE2, 0x5B28, 0x8BE3, 0x5B29, 0x8BE4, 0x5B2A, 0x8BE5, + 0x5B2B, 0x8BE6, 0x5B2C, 0x8BE7, 0x5B2D, 0x8BE8, 0x5B2E, 0x8BE9, 0x5B2F, 0x8BEA, 0x5B30, 0x8BEB, 0x5B31, 0x8BEC, 0x5B32, 0xE6D5, + 0x5B33, 0x8BED, 0x5B34, 0xD9F8, 0x5B35, 0x8BEE, 0x5B36, 0x8BEF, 0x5B37, 0xE6D6, 0x5B38, 0x8BF0, 0x5B39, 0x8BF1, 0x5B3A, 0x8BF2, + 0x5B3B, 0x8BF3, 0x5B3C, 0x8BF4, 0x5B3D, 0x8BF5, 0x5B3E, 0x8BF6, 0x5B3F, 0x8BF7, 0x5B40, 0xE6D7, 0x5B41, 0x8BF8, 0x5B42, 0x8BF9, + 0x5B43, 0x8BFA, 0x5B44, 0x8BFB, 0x5B45, 0x8BFC, 0x5B46, 0x8BFD, 0x5B47, 0x8BFE, 0x5B48, 0x8C40, 0x5B49, 0x8C41, 0x5B4A, 0x8C42, + 0x5B4B, 0x8C43, 0x5B4C, 0x8C44, 0x5B4D, 0x8C45, 0x5B4E, 0x8C46, 0x5B4F, 0x8C47, 0x5B50, 0xD7D3, 0x5B51, 0xE6DD, 0x5B52, 0x8C48, + 0x5B53, 0xE6DE, 0x5B54, 0xBFD7, 0x5B55, 0xD4D0, 0x5B56, 0x8C49, 0x5B57, 0xD7D6, 0x5B58, 0xB4E6, 0x5B59, 0xCBEF, 0x5B5A, 0xE6DA, + 0x5B5B, 0xD8C3, 0x5B5C, 0xD7CE, 0x5B5D, 0xD0A2, 0x5B5E, 0x8C4A, 0x5B5F, 0xC3CF, 0x5B60, 0x8C4B, 0x5B61, 0x8C4C, 0x5B62, 0xE6DF, + 0x5B63, 0xBCBE, 0x5B64, 0xB9C2, 0x5B65, 0xE6DB, 0x5B66, 0xD1A7, 0x5B67, 0x8C4D, 0x5B68, 0x8C4E, 0x5B69, 0xBAA2, 0x5B6A, 0xC2CF, + 0x5B6B, 0x8C4F, 0x5B6C, 0xD8AB, 0x5B6D, 0x8C50, 0x5B6E, 0x8C51, 0x5B6F, 0x8C52, 0x5B70, 0xCAEB, 0x5B71, 0xE5EE, 0x5B72, 0x8C53, + 0x5B73, 0xE6DC, 0x5B74, 0x8C54, 0x5B75, 0xB7F5, 0x5B76, 0x8C55, 0x5B77, 0x8C56, 0x5B78, 0x8C57, 0x5B79, 0x8C58, 0x5B7A, 0xC8E6, + 0x5B7B, 0x8C59, 0x5B7C, 0x8C5A, 0x5B7D, 0xC4F5, 0x5B7E, 0x8C5B, 0x5B7F, 0x8C5C, 0x5B80, 0xE5B2, 0x5B81, 0xC4FE, 0x5B82, 0x8C5D, + 0x5B83, 0xCBFC, 0x5B84, 0xE5B3, 0x5B85, 0xD5AC, 0x5B86, 0x8C5E, 0x5B87, 0xD3EE, 0x5B88, 0xCAD8, 0x5B89, 0xB0B2, 0x5B8A, 0x8C5F, + 0x5B8B, 0xCBCE, 0x5B8C, 0xCDEA, 0x5B8D, 0x8C60, 0x5B8E, 0x8C61, 0x5B8F, 0xBAEA, 0x5B90, 0x8C62, 0x5B91, 0x8C63, 0x5B92, 0x8C64, + 0x5B93, 0xE5B5, 0x5B94, 0x8C65, 0x5B95, 0xE5B4, 0x5B96, 0x8C66, 0x5B97, 0xD7DA, 0x5B98, 0xB9D9, 0x5B99, 0xD6E6, 0x5B9A, 0xB6A8, + 0x5B9B, 0xCDF0, 0x5B9C, 0xD2CB, 0x5B9D, 0xB1A6, 0x5B9E, 0xCAB5, 0x5B9F, 0x8C67, 0x5BA0, 0xB3E8, 0x5BA1, 0xC9F3, 0x5BA2, 0xBFCD, + 0x5BA3, 0xD0FB, 0x5BA4, 0xCAD2, 0x5BA5, 0xE5B6, 0x5BA6, 0xBBC2, 0x5BA7, 0x8C68, 0x5BA8, 0x8C69, 0x5BA9, 0x8C6A, 0x5BAA, 0xCFDC, + 0x5BAB, 0xB9AC, 0x5BAC, 0x8C6B, 0x5BAD, 0x8C6C, 0x5BAE, 0x8C6D, 0x5BAF, 0x8C6E, 0x5BB0, 0xD4D7, 0x5BB1, 0x8C6F, 0x5BB2, 0x8C70, + 0x5BB3, 0xBAA6, 0x5BB4, 0xD1E7, 0x5BB5, 0xCFFC, 0x5BB6, 0xBCD2, 0x5BB7, 0x8C71, 0x5BB8, 0xE5B7, 0x5BB9, 0xC8DD, 0x5BBA, 0x8C72, + 0x5BBB, 0x8C73, 0x5BBC, 0x8C74, 0x5BBD, 0xBFED, 0x5BBE, 0xB1F6, 0x5BBF, 0xCBDE, 0x5BC0, 0x8C75, 0x5BC1, 0x8C76, 0x5BC2, 0xBCC5, + 0x5BC3, 0x8C77, 0x5BC4, 0xBCC4, 0x5BC5, 0xD2FA, 0x5BC6, 0xC3DC, 0x5BC7, 0xBFDC, 0x5BC8, 0x8C78, 0x5BC9, 0x8C79, 0x5BCA, 0x8C7A, + 0x5BCB, 0x8C7B, 0x5BCC, 0xB8BB, 0x5BCD, 0x8C7C, 0x5BCE, 0x8C7D, 0x5BCF, 0x8C7E, 0x5BD0, 0xC3C2, 0x5BD1, 0x8C80, 0x5BD2, 0xBAAE, + 0x5BD3, 0xD4A2, 0x5BD4, 0x8C81, 0x5BD5, 0x8C82, 0x5BD6, 0x8C83, 0x5BD7, 0x8C84, 0x5BD8, 0x8C85, 0x5BD9, 0x8C86, 0x5BDA, 0x8C87, + 0x5BDB, 0x8C88, 0x5BDC, 0x8C89, 0x5BDD, 0xC7DE, 0x5BDE, 0xC4AF, 0x5BDF, 0xB2EC, 0x5BE0, 0x8C8A, 0x5BE1, 0xB9D1, 0x5BE2, 0x8C8B, + 0x5BE3, 0x8C8C, 0x5BE4, 0xE5BB, 0x5BE5, 0xC1C8, 0x5BE6, 0x8C8D, 0x5BE7, 0x8C8E, 0x5BE8, 0xD5AF, 0x5BE9, 0x8C8F, 0x5BEA, 0x8C90, + 0x5BEB, 0x8C91, 0x5BEC, 0x8C92, 0x5BED, 0x8C93, 0x5BEE, 0xE5BC, 0x5BEF, 0x8C94, 0x5BF0, 0xE5BE, 0x5BF1, 0x8C95, 0x5BF2, 0x8C96, + 0x5BF3, 0x8C97, 0x5BF4, 0x8C98, 0x5BF5, 0x8C99, 0x5BF6, 0x8C9A, 0x5BF7, 0x8C9B, 0x5BF8, 0xB4E7, 0x5BF9, 0xB6D4, 0x5BFA, 0xCBC2, + 0x5BFB, 0xD1B0, 0x5BFC, 0xB5BC, 0x5BFD, 0x8C9C, 0x5BFE, 0x8C9D, 0x5BFF, 0xCAD9, 0x5C00, 0x8C9E, 0x5C01, 0xB7E2, 0x5C02, 0x8C9F, + 0x5C03, 0x8CA0, 0x5C04, 0xC9E4, 0x5C05, 0x8CA1, 0x5C06, 0xBDAB, 0x5C07, 0x8CA2, 0x5C08, 0x8CA3, 0x5C09, 0xCEBE, 0x5C0A, 0xD7F0, + 0x5C0B, 0x8CA4, 0x5C0C, 0x8CA5, 0x5C0D, 0x8CA6, 0x5C0E, 0x8CA7, 0x5C0F, 0xD0A1, 0x5C10, 0x8CA8, 0x5C11, 0xC9D9, 0x5C12, 0x8CA9, + 0x5C13, 0x8CAA, 0x5C14, 0xB6FB, 0x5C15, 0xE6D8, 0x5C16, 0xBCE2, 0x5C17, 0x8CAB, 0x5C18, 0xB3BE, 0x5C19, 0x8CAC, 0x5C1A, 0xC9D0, + 0x5C1B, 0x8CAD, 0x5C1C, 0xE6D9, 0x5C1D, 0xB3A2, 0x5C1E, 0x8CAE, 0x5C1F, 0x8CAF, 0x5C20, 0x8CB0, 0x5C21, 0x8CB1, 0x5C22, 0xDECC, + 0x5C23, 0x8CB2, 0x5C24, 0xD3C8, 0x5C25, 0xDECD, 0x5C26, 0x8CB3, 0x5C27, 0xD2A2, 0x5C28, 0x8CB4, 0x5C29, 0x8CB5, 0x5C2A, 0x8CB6, + 0x5C2B, 0x8CB7, 0x5C2C, 0xDECE, 0x5C2D, 0x8CB8, 0x5C2E, 0x8CB9, 0x5C2F, 0x8CBA, 0x5C30, 0x8CBB, 0x5C31, 0xBECD, 0x5C32, 0x8CBC, + 0x5C33, 0x8CBD, 0x5C34, 0xDECF, 0x5C35, 0x8CBE, 0x5C36, 0x8CBF, 0x5C37, 0x8CC0, 0x5C38, 0xCAAC, 0x5C39, 0xD2FC, 0x5C3A, 0xB3DF, + 0x5C3B, 0xE5EA, 0x5C3C, 0xC4E1, 0x5C3D, 0xBEA1, 0x5C3E, 0xCEB2, 0x5C3F, 0xC4F2, 0x5C40, 0xBED6, 0x5C41, 0xC6A8, 0x5C42, 0xB2E3, + 0x5C43, 0x8CC1, 0x5C44, 0x8CC2, 0x5C45, 0xBED3, 0x5C46, 0x8CC3, 0x5C47, 0x8CC4, 0x5C48, 0xC7FC, 0x5C49, 0xCCEB, 0x5C4A, 0xBDEC, + 0x5C4B, 0xCEDD, 0x5C4C, 0x8CC5, 0x5C4D, 0x8CC6, 0x5C4E, 0xCABA, 0x5C4F, 0xC6C1, 0x5C50, 0xE5EC, 0x5C51, 0xD0BC, 0x5C52, 0x8CC7, + 0x5C53, 0x8CC8, 0x5C54, 0x8CC9, 0x5C55, 0xD5B9, 0x5C56, 0x8CCA, 0x5C57, 0x8CCB, 0x5C58, 0x8CCC, 0x5C59, 0xE5ED, 0x5C5A, 0x8CCD, + 0x5C5B, 0x8CCE, 0x5C5C, 0x8CCF, 0x5C5D, 0x8CD0, 0x5C5E, 0xCAF4, 0x5C5F, 0x8CD1, 0x5C60, 0xCDC0, 0x5C61, 0xC2C5, 0x5C62, 0x8CD2, + 0x5C63, 0xE5EF, 0x5C64, 0x8CD3, 0x5C65, 0xC2C4, 0x5C66, 0xE5F0, 0x5C67, 0x8CD4, 0x5C68, 0x8CD5, 0x5C69, 0x8CD6, 0x5C6A, 0x8CD7, + 0x5C6B, 0x8CD8, 0x5C6C, 0x8CD9, 0x5C6D, 0x8CDA, 0x5C6E, 0xE5F8, 0x5C6F, 0xCDCD, 0x5C70, 0x8CDB, 0x5C71, 0xC9BD, 0x5C72, 0x8CDC, + 0x5C73, 0x8CDD, 0x5C74, 0x8CDE, 0x5C75, 0x8CDF, 0x5C76, 0x8CE0, 0x5C77, 0x8CE1, 0x5C78, 0x8CE2, 0x5C79, 0xD2D9, 0x5C7A, 0xE1A8, + 0x5C7B, 0x8CE3, 0x5C7C, 0x8CE4, 0x5C7D, 0x8CE5, 0x5C7E, 0x8CE6, 0x5C7F, 0xD3EC, 0x5C80, 0x8CE7, 0x5C81, 0xCBEA, 0x5C82, 0xC6F1, + 0x5C83, 0x8CE8, 0x5C84, 0x8CE9, 0x5C85, 0x8CEA, 0x5C86, 0x8CEB, 0x5C87, 0x8CEC, 0x5C88, 0xE1AC, 0x5C89, 0x8CED, 0x5C8A, 0x8CEE, + 0x5C8B, 0x8CEF, 0x5C8C, 0xE1A7, 0x5C8D, 0xE1A9, 0x5C8E, 0x8CF0, 0x5C8F, 0x8CF1, 0x5C90, 0xE1AA, 0x5C91, 0xE1AF, 0x5C92, 0x8CF2, + 0x5C93, 0x8CF3, 0x5C94, 0xB2ED, 0x5C95, 0x8CF4, 0x5C96, 0xE1AB, 0x5C97, 0xB8DA, 0x5C98, 0xE1AD, 0x5C99, 0xE1AE, 0x5C9A, 0xE1B0, + 0x5C9B, 0xB5BA, 0x5C9C, 0xE1B1, 0x5C9D, 0x8CF5, 0x5C9E, 0x8CF6, 0x5C9F, 0x8CF7, 0x5CA0, 0x8CF8, 0x5CA1, 0x8CF9, 0x5CA2, 0xE1B3, + 0x5CA3, 0xE1B8, 0x5CA4, 0x8CFA, 0x5CA5, 0x8CFB, 0x5CA6, 0x8CFC, 0x5CA7, 0x8CFD, 0x5CA8, 0x8CFE, 0x5CA9, 0xD1D2, 0x5CAA, 0x8D40, + 0x5CAB, 0xE1B6, 0x5CAC, 0xE1B5, 0x5CAD, 0xC1EB, 0x5CAE, 0x8D41, 0x5CAF, 0x8D42, 0x5CB0, 0x8D43, 0x5CB1, 0xE1B7, 0x5CB2, 0x8D44, + 0x5CB3, 0xD4C0, 0x5CB4, 0x8D45, 0x5CB5, 0xE1B2, 0x5CB6, 0x8D46, 0x5CB7, 0xE1BA, 0x5CB8, 0xB0B6, 0x5CB9, 0x8D47, 0x5CBA, 0x8D48, + 0x5CBB, 0x8D49, 0x5CBC, 0x8D4A, 0x5CBD, 0xE1B4, 0x5CBE, 0x8D4B, 0x5CBF, 0xBFF9, 0x5CC0, 0x8D4C, 0x5CC1, 0xE1B9, 0x5CC2, 0x8D4D, + 0x5CC3, 0x8D4E, 0x5CC4, 0xE1BB, 0x5CC5, 0x8D4F, 0x5CC6, 0x8D50, 0x5CC7, 0x8D51, 0x5CC8, 0x8D52, 0x5CC9, 0x8D53, 0x5CCA, 0x8D54, + 0x5CCB, 0xE1BE, 0x5CCC, 0x8D55, 0x5CCD, 0x8D56, 0x5CCE, 0x8D57, 0x5CCF, 0x8D58, 0x5CD0, 0x8D59, 0x5CD1, 0x8D5A, 0x5CD2, 0xE1BC, + 0x5CD3, 0x8D5B, 0x5CD4, 0x8D5C, 0x5CD5, 0x8D5D, 0x5CD6, 0x8D5E, 0x5CD7, 0x8D5F, 0x5CD8, 0x8D60, 0x5CD9, 0xD6C5, 0x5CDA, 0x8D61, + 0x5CDB, 0x8D62, 0x5CDC, 0x8D63, 0x5CDD, 0x8D64, 0x5CDE, 0x8D65, 0x5CDF, 0x8D66, 0x5CE0, 0x8D67, 0x5CE1, 0xCFBF, 0x5CE2, 0x8D68, + 0x5CE3, 0x8D69, 0x5CE4, 0xE1BD, 0x5CE5, 0xE1BF, 0x5CE6, 0xC2CD, 0x5CE7, 0x8D6A, 0x5CE8, 0xB6EB, 0x5CE9, 0x8D6B, 0x5CEA, 0xD3F8, + 0x5CEB, 0x8D6C, 0x5CEC, 0x8D6D, 0x5CED, 0xC7CD, 0x5CEE, 0x8D6E, 0x5CEF, 0x8D6F, 0x5CF0, 0xB7E5, 0x5CF1, 0x8D70, 0x5CF2, 0x8D71, + 0x5CF3, 0x8D72, 0x5CF4, 0x8D73, 0x5CF5, 0x8D74, 0x5CF6, 0x8D75, 0x5CF7, 0x8D76, 0x5CF8, 0x8D77, 0x5CF9, 0x8D78, 0x5CFA, 0x8D79, + 0x5CFB, 0xBEFE, 0x5CFC, 0x8D7A, 0x5CFD, 0x8D7B, 0x5CFE, 0x8D7C, 0x5CFF, 0x8D7D, 0x5D00, 0x8D7E, 0x5D01, 0x8D80, 0x5D02, 0xE1C0, + 0x5D03, 0xE1C1, 0x5D04, 0x8D81, 0x5D05, 0x8D82, 0x5D06, 0xE1C7, 0x5D07, 0xB3E7, 0x5D08, 0x8D83, 0x5D09, 0x8D84, 0x5D0A, 0x8D85, + 0x5D0B, 0x8D86, 0x5D0C, 0x8D87, 0x5D0D, 0x8D88, 0x5D0E, 0xC6E9, 0x5D0F, 0x8D89, 0x5D10, 0x8D8A, 0x5D11, 0x8D8B, 0x5D12, 0x8D8C, + 0x5D13, 0x8D8D, 0x5D14, 0xB4DE, 0x5D15, 0x8D8E, 0x5D16, 0xD1C2, 0x5D17, 0x8D8F, 0x5D18, 0x8D90, 0x5D19, 0x8D91, 0x5D1A, 0x8D92, + 0x5D1B, 0xE1C8, 0x5D1C, 0x8D93, 0x5D1D, 0x8D94, 0x5D1E, 0xE1C6, 0x5D1F, 0x8D95, 0x5D20, 0x8D96, 0x5D21, 0x8D97, 0x5D22, 0x8D98, + 0x5D23, 0x8D99, 0x5D24, 0xE1C5, 0x5D25, 0x8D9A, 0x5D26, 0xE1C3, 0x5D27, 0xE1C2, 0x5D28, 0x8D9B, 0x5D29, 0xB1C0, 0x5D2A, 0x8D9C, + 0x5D2B, 0x8D9D, 0x5D2C, 0x8D9E, 0x5D2D, 0xD5B8, 0x5D2E, 0xE1C4, 0x5D2F, 0x8D9F, 0x5D30, 0x8DA0, 0x5D31, 0x8DA1, 0x5D32, 0x8DA2, + 0x5D33, 0x8DA3, 0x5D34, 0xE1CB, 0x5D35, 0x8DA4, 0x5D36, 0x8DA5, 0x5D37, 0x8DA6, 0x5D38, 0x8DA7, 0x5D39, 0x8DA8, 0x5D3A, 0x8DA9, + 0x5D3B, 0x8DAA, 0x5D3C, 0x8DAB, 0x5D3D, 0xE1CC, 0x5D3E, 0xE1CA, 0x5D3F, 0x8DAC, 0x5D40, 0x8DAD, 0x5D41, 0x8DAE, 0x5D42, 0x8DAF, + 0x5D43, 0x8DB0, 0x5D44, 0x8DB1, 0x5D45, 0x8DB2, 0x5D46, 0x8DB3, 0x5D47, 0xEFFA, 0x5D48, 0x8DB4, 0x5D49, 0x8DB5, 0x5D4A, 0xE1D3, + 0x5D4B, 0xE1D2, 0x5D4C, 0xC7B6, 0x5D4D, 0x8DB6, 0x5D4E, 0x8DB7, 0x5D4F, 0x8DB8, 0x5D50, 0x8DB9, 0x5D51, 0x8DBA, 0x5D52, 0x8DBB, + 0x5D53, 0x8DBC, 0x5D54, 0x8DBD, 0x5D55, 0x8DBE, 0x5D56, 0x8DBF, 0x5D57, 0x8DC0, 0x5D58, 0xE1C9, 0x5D59, 0x8DC1, 0x5D5A, 0x8DC2, + 0x5D5B, 0xE1CE, 0x5D5C, 0x8DC3, 0x5D5D, 0xE1D0, 0x5D5E, 0x8DC4, 0x5D5F, 0x8DC5, 0x5D60, 0x8DC6, 0x5D61, 0x8DC7, 0x5D62, 0x8DC8, + 0x5D63, 0x8DC9, 0x5D64, 0x8DCA, 0x5D65, 0x8DCB, 0x5D66, 0x8DCC, 0x5D67, 0x8DCD, 0x5D68, 0x8DCE, 0x5D69, 0xE1D4, 0x5D6A, 0x8DCF, + 0x5D6B, 0xE1D1, 0x5D6C, 0xE1CD, 0x5D6D, 0x8DD0, 0x5D6E, 0x8DD1, 0x5D6F, 0xE1CF, 0x5D70, 0x8DD2, 0x5D71, 0x8DD3, 0x5D72, 0x8DD4, + 0x5D73, 0x8DD5, 0x5D74, 0xE1D5, 0x5D75, 0x8DD6, 0x5D76, 0x8DD7, 0x5D77, 0x8DD8, 0x5D78, 0x8DD9, 0x5D79, 0x8DDA, 0x5D7A, 0x8DDB, + 0x5D7B, 0x8DDC, 0x5D7C, 0x8DDD, 0x5D7D, 0x8DDE, 0x5D7E, 0x8DDF, 0x5D7F, 0x8DE0, 0x5D80, 0x8DE1, 0x5D81, 0x8DE2, 0x5D82, 0xE1D6, + 0x5D83, 0x8DE3, 0x5D84, 0x8DE4, 0x5D85, 0x8DE5, 0x5D86, 0x8DE6, 0x5D87, 0x8DE7, 0x5D88, 0x8DE8, 0x5D89, 0x8DE9, 0x5D8A, 0x8DEA, + 0x5D8B, 0x8DEB, 0x5D8C, 0x8DEC, 0x5D8D, 0x8DED, 0x5D8E, 0x8DEE, 0x5D8F, 0x8DEF, 0x5D90, 0x8DF0, 0x5D91, 0x8DF1, 0x5D92, 0x8DF2, + 0x5D93, 0x8DF3, 0x5D94, 0x8DF4, 0x5D95, 0x8DF5, 0x5D96, 0x8DF6, 0x5D97, 0x8DF7, 0x5D98, 0x8DF8, 0x5D99, 0xE1D7, 0x5D9A, 0x8DF9, + 0x5D9B, 0x8DFA, 0x5D9C, 0x8DFB, 0x5D9D, 0xE1D8, 0x5D9E, 0x8DFC, 0x5D9F, 0x8DFD, 0x5DA0, 0x8DFE, 0x5DA1, 0x8E40, 0x5DA2, 0x8E41, + 0x5DA3, 0x8E42, 0x5DA4, 0x8E43, 0x5DA5, 0x8E44, 0x5DA6, 0x8E45, 0x5DA7, 0x8E46, 0x5DA8, 0x8E47, 0x5DA9, 0x8E48, 0x5DAA, 0x8E49, + 0x5DAB, 0x8E4A, 0x5DAC, 0x8E4B, 0x5DAD, 0x8E4C, 0x5DAE, 0x8E4D, 0x5DAF, 0x8E4E, 0x5DB0, 0x8E4F, 0x5DB1, 0x8E50, 0x5DB2, 0x8E51, + 0x5DB3, 0x8E52, 0x5DB4, 0x8E53, 0x5DB5, 0x8E54, 0x5DB6, 0x8E55, 0x5DB7, 0xE1DA, 0x5DB8, 0x8E56, 0x5DB9, 0x8E57, 0x5DBA, 0x8E58, + 0x5DBB, 0x8E59, 0x5DBC, 0x8E5A, 0x5DBD, 0x8E5B, 0x5DBE, 0x8E5C, 0x5DBF, 0x8E5D, 0x5DC0, 0x8E5E, 0x5DC1, 0x8E5F, 0x5DC2, 0x8E60, + 0x5DC3, 0x8E61, 0x5DC4, 0x8E62, 0x5DC5, 0xE1DB, 0x5DC6, 0x8E63, 0x5DC7, 0x8E64, 0x5DC8, 0x8E65, 0x5DC9, 0x8E66, 0x5DCA, 0x8E67, + 0x5DCB, 0x8E68, 0x5DCC, 0x8E69, 0x5DCD, 0xCEA1, 0x5DCE, 0x8E6A, 0x5DCF, 0x8E6B, 0x5DD0, 0x8E6C, 0x5DD1, 0x8E6D, 0x5DD2, 0x8E6E, + 0x5DD3, 0x8E6F, 0x5DD4, 0x8E70, 0x5DD5, 0x8E71, 0x5DD6, 0x8E72, 0x5DD7, 0x8E73, 0x5DD8, 0x8E74, 0x5DD9, 0x8E75, 0x5DDA, 0x8E76, + 0x5DDB, 0xE7DD, 0x5DDC, 0x8E77, 0x5DDD, 0xB4A8, 0x5DDE, 0xD6DD, 0x5DDF, 0x8E78, 0x5DE0, 0x8E79, 0x5DE1, 0xD1B2, 0x5DE2, 0xB3B2, + 0x5DE3, 0x8E7A, 0x5DE4, 0x8E7B, 0x5DE5, 0xB9A4, 0x5DE6, 0xD7F3, 0x5DE7, 0xC7C9, 0x5DE8, 0xBEDE, 0x5DE9, 0xB9AE, 0x5DEA, 0x8E7C, + 0x5DEB, 0xCED7, 0x5DEC, 0x8E7D, 0x5DED, 0x8E7E, 0x5DEE, 0xB2EE, 0x5DEF, 0xDBCF, 0x5DF0, 0x8E80, 0x5DF1, 0xBCBA, 0x5DF2, 0xD2D1, + 0x5DF3, 0xCBC8, 0x5DF4, 0xB0CD, 0x5DF5, 0x8E81, 0x5DF6, 0x8E82, 0x5DF7, 0xCFEF, 0x5DF8, 0x8E83, 0x5DF9, 0x8E84, 0x5DFA, 0x8E85, + 0x5DFB, 0x8E86, 0x5DFC, 0x8E87, 0x5DFD, 0xD9E3, 0x5DFE, 0xBDED, 0x5DFF, 0x8E88, 0x5E00, 0x8E89, 0x5E01, 0xB1D2, 0x5E02, 0xCAD0, + 0x5E03, 0xB2BC, 0x5E04, 0x8E8A, 0x5E05, 0xCBA7, 0x5E06, 0xB7AB, 0x5E07, 0x8E8B, 0x5E08, 0xCAA6, 0x5E09, 0x8E8C, 0x5E0A, 0x8E8D, + 0x5E0B, 0x8E8E, 0x5E0C, 0xCFA3, 0x5E0D, 0x8E8F, 0x5E0E, 0x8E90, 0x5E0F, 0xE0F8, 0x5E10, 0xD5CA, 0x5E11, 0xE0FB, 0x5E12, 0x8E91, + 0x5E13, 0x8E92, 0x5E14, 0xE0FA, 0x5E15, 0xC5C1, 0x5E16, 0xCCFB, 0x5E17, 0x8E93, 0x5E18, 0xC1B1, 0x5E19, 0xE0F9, 0x5E1A, 0xD6E3, + 0x5E1B, 0xB2AF, 0x5E1C, 0xD6C4, 0x5E1D, 0xB5DB, 0x5E1E, 0x8E94, 0x5E1F, 0x8E95, 0x5E20, 0x8E96, 0x5E21, 0x8E97, 0x5E22, 0x8E98, + 0x5E23, 0x8E99, 0x5E24, 0x8E9A, 0x5E25, 0x8E9B, 0x5E26, 0xB4F8, 0x5E27, 0xD6A1, 0x5E28, 0x8E9C, 0x5E29, 0x8E9D, 0x5E2A, 0x8E9E, + 0x5E2B, 0x8E9F, 0x5E2C, 0x8EA0, 0x5E2D, 0xCFAF, 0x5E2E, 0xB0EF, 0x5E2F, 0x8EA1, 0x5E30, 0x8EA2, 0x5E31, 0xE0FC, 0x5E32, 0x8EA3, + 0x5E33, 0x8EA4, 0x5E34, 0x8EA5, 0x5E35, 0x8EA6, 0x5E36, 0x8EA7, 0x5E37, 0xE1A1, 0x5E38, 0xB3A3, 0x5E39, 0x8EA8, 0x5E3A, 0x8EA9, + 0x5E3B, 0xE0FD, 0x5E3C, 0xE0FE, 0x5E3D, 0xC3B1, 0x5E3E, 0x8EAA, 0x5E3F, 0x8EAB, 0x5E40, 0x8EAC, 0x5E41, 0x8EAD, 0x5E42, 0xC3DD, + 0x5E43, 0x8EAE, 0x5E44, 0xE1A2, 0x5E45, 0xB7F9, 0x5E46, 0x8EAF, 0x5E47, 0x8EB0, 0x5E48, 0x8EB1, 0x5E49, 0x8EB2, 0x5E4A, 0x8EB3, + 0x5E4B, 0x8EB4, 0x5E4C, 0xBBCF, 0x5E4D, 0x8EB5, 0x5E4E, 0x8EB6, 0x5E4F, 0x8EB7, 0x5E50, 0x8EB8, 0x5E51, 0x8EB9, 0x5E52, 0x8EBA, + 0x5E53, 0x8EBB, 0x5E54, 0xE1A3, 0x5E55, 0xC4BB, 0x5E56, 0x8EBC, 0x5E57, 0x8EBD, 0x5E58, 0x8EBE, 0x5E59, 0x8EBF, 0x5E5A, 0x8EC0, + 0x5E5B, 0xE1A4, 0x5E5C, 0x8EC1, 0x5E5D, 0x8EC2, 0x5E5E, 0xE1A5, 0x5E5F, 0x8EC3, 0x5E60, 0x8EC4, 0x5E61, 0xE1A6, 0x5E62, 0xB4B1, + 0x5E63, 0x8EC5, 0x5E64, 0x8EC6, 0x5E65, 0x8EC7, 0x5E66, 0x8EC8, 0x5E67, 0x8EC9, 0x5E68, 0x8ECA, 0x5E69, 0x8ECB, 0x5E6A, 0x8ECC, + 0x5E6B, 0x8ECD, 0x5E6C, 0x8ECE, 0x5E6D, 0x8ECF, 0x5E6E, 0x8ED0, 0x5E6F, 0x8ED1, 0x5E70, 0x8ED2, 0x5E71, 0x8ED3, 0x5E72, 0xB8C9, + 0x5E73, 0xC6BD, 0x5E74, 0xC4EA, 0x5E75, 0x8ED4, 0x5E76, 0xB2A2, 0x5E77, 0x8ED5, 0x5E78, 0xD0D2, 0x5E79, 0x8ED6, 0x5E7A, 0xE7DB, + 0x5E7B, 0xBBC3, 0x5E7C, 0xD3D7, 0x5E7D, 0xD3C4, 0x5E7E, 0x8ED7, 0x5E7F, 0xB9E3, 0x5E80, 0xE2CF, 0x5E81, 0x8ED8, 0x5E82, 0x8ED9, + 0x5E83, 0x8EDA, 0x5E84, 0xD7AF, 0x5E85, 0x8EDB, 0x5E86, 0xC7EC, 0x5E87, 0xB1D3, 0x5E88, 0x8EDC, 0x5E89, 0x8EDD, 0x5E8A, 0xB4B2, + 0x5E8B, 0xE2D1, 0x5E8C, 0x8EDE, 0x5E8D, 0x8EDF, 0x5E8E, 0x8EE0, 0x5E8F, 0xD0F2, 0x5E90, 0xC2AE, 0x5E91, 0xE2D0, 0x5E92, 0x8EE1, + 0x5E93, 0xBFE2, 0x5E94, 0xD3A6, 0x5E95, 0xB5D7, 0x5E96, 0xE2D2, 0x5E97, 0xB5EA, 0x5E98, 0x8EE2, 0x5E99, 0xC3ED, 0x5E9A, 0xB8FD, + 0x5E9B, 0x8EE3, 0x5E9C, 0xB8AE, 0x5E9D, 0x8EE4, 0x5E9E, 0xC5D3, 0x5E9F, 0xB7CF, 0x5EA0, 0xE2D4, 0x5EA1, 0x8EE5, 0x5EA2, 0x8EE6, + 0x5EA3, 0x8EE7, 0x5EA4, 0x8EE8, 0x5EA5, 0xE2D3, 0x5EA6, 0xB6C8, 0x5EA7, 0xD7F9, 0x5EA8, 0x8EE9, 0x5EA9, 0x8EEA, 0x5EAA, 0x8EEB, + 0x5EAB, 0x8EEC, 0x5EAC, 0x8EED, 0x5EAD, 0xCDA5, 0x5EAE, 0x8EEE, 0x5EAF, 0x8EEF, 0x5EB0, 0x8EF0, 0x5EB1, 0x8EF1, 0x5EB2, 0x8EF2, + 0x5EB3, 0xE2D8, 0x5EB4, 0x8EF3, 0x5EB5, 0xE2D6, 0x5EB6, 0xCAFC, 0x5EB7, 0xBFB5, 0x5EB8, 0xD3B9, 0x5EB9, 0xE2D5, 0x5EBA, 0x8EF4, + 0x5EBB, 0x8EF5, 0x5EBC, 0x8EF6, 0x5EBD, 0x8EF7, 0x5EBE, 0xE2D7, 0x5EBF, 0x8EF8, 0x5EC0, 0x8EF9, 0x5EC1, 0x8EFA, 0x5EC2, 0x8EFB, + 0x5EC3, 0x8EFC, 0x5EC4, 0x8EFD, 0x5EC5, 0x8EFE, 0x5EC6, 0x8F40, 0x5EC7, 0x8F41, 0x5EC8, 0x8F42, 0x5EC9, 0xC1AE, 0x5ECA, 0xC0C8, + 0x5ECB, 0x8F43, 0x5ECC, 0x8F44, 0x5ECD, 0x8F45, 0x5ECE, 0x8F46, 0x5ECF, 0x8F47, 0x5ED0, 0x8F48, 0x5ED1, 0xE2DB, 0x5ED2, 0xE2DA, + 0x5ED3, 0xC0AA, 0x5ED4, 0x8F49, 0x5ED5, 0x8F4A, 0x5ED6, 0xC1CE, 0x5ED7, 0x8F4B, 0x5ED8, 0x8F4C, 0x5ED9, 0x8F4D, 0x5EDA, 0x8F4E, + 0x5EDB, 0xE2DC, 0x5EDC, 0x8F4F, 0x5EDD, 0x8F50, 0x5EDE, 0x8F51, 0x5EDF, 0x8F52, 0x5EE0, 0x8F53, 0x5EE1, 0x8F54, 0x5EE2, 0x8F55, + 0x5EE3, 0x8F56, 0x5EE4, 0x8F57, 0x5EE5, 0x8F58, 0x5EE6, 0x8F59, 0x5EE7, 0x8F5A, 0x5EE8, 0xE2DD, 0x5EE9, 0x8F5B, 0x5EEA, 0xE2DE, + 0x5EEB, 0x8F5C, 0x5EEC, 0x8F5D, 0x5EED, 0x8F5E, 0x5EEE, 0x8F5F, 0x5EEF, 0x8F60, 0x5EF0, 0x8F61, 0x5EF1, 0x8F62, 0x5EF2, 0x8F63, + 0x5EF3, 0x8F64, 0x5EF4, 0xDBC8, 0x5EF5, 0x8F65, 0x5EF6, 0xD1D3, 0x5EF7, 0xCDA2, 0x5EF8, 0x8F66, 0x5EF9, 0x8F67, 0x5EFA, 0xBDA8, + 0x5EFB, 0x8F68, 0x5EFC, 0x8F69, 0x5EFD, 0x8F6A, 0x5EFE, 0xDEC3, 0x5EFF, 0xD8A5, 0x5F00, 0xBFAA, 0x5F01, 0xDBCD, 0x5F02, 0xD2EC, + 0x5F03, 0xC6FA, 0x5F04, 0xC5AA, 0x5F05, 0x8F6B, 0x5F06, 0x8F6C, 0x5F07, 0x8F6D, 0x5F08, 0xDEC4, 0x5F09, 0x8F6E, 0x5F0A, 0xB1D7, + 0x5F0B, 0xDFAE, 0x5F0C, 0x8F6F, 0x5F0D, 0x8F70, 0x5F0E, 0x8F71, 0x5F0F, 0xCABD, 0x5F10, 0x8F72, 0x5F11, 0xDFB1, 0x5F12, 0x8F73, + 0x5F13, 0xB9AD, 0x5F14, 0x8F74, 0x5F15, 0xD2FD, 0x5F16, 0x8F75, 0x5F17, 0xB8A5, 0x5F18, 0xBAEB, 0x5F19, 0x8F76, 0x5F1A, 0x8F77, + 0x5F1B, 0xB3DA, 0x5F1C, 0x8F78, 0x5F1D, 0x8F79, 0x5F1E, 0x8F7A, 0x5F1F, 0xB5DC, 0x5F20, 0xD5C5, 0x5F21, 0x8F7B, 0x5F22, 0x8F7C, + 0x5F23, 0x8F7D, 0x5F24, 0x8F7E, 0x5F25, 0xC3D6, 0x5F26, 0xCFD2, 0x5F27, 0xBBA1, 0x5F28, 0x8F80, 0x5F29, 0xE5F3, 0x5F2A, 0xE5F2, + 0x5F2B, 0x8F81, 0x5F2C, 0x8F82, 0x5F2D, 0xE5F4, 0x5F2E, 0x8F83, 0x5F2F, 0xCDE4, 0x5F30, 0x8F84, 0x5F31, 0xC8F5, 0x5F32, 0x8F85, + 0x5F33, 0x8F86, 0x5F34, 0x8F87, 0x5F35, 0x8F88, 0x5F36, 0x8F89, 0x5F37, 0x8F8A, 0x5F38, 0x8F8B, 0x5F39, 0xB5AF, 0x5F3A, 0xC7BF, + 0x5F3B, 0x8F8C, 0x5F3C, 0xE5F6, 0x5F3D, 0x8F8D, 0x5F3E, 0x8F8E, 0x5F3F, 0x8F8F, 0x5F40, 0xECB0, 0x5F41, 0x8F90, 0x5F42, 0x8F91, + 0x5F43, 0x8F92, 0x5F44, 0x8F93, 0x5F45, 0x8F94, 0x5F46, 0x8F95, 0x5F47, 0x8F96, 0x5F48, 0x8F97, 0x5F49, 0x8F98, 0x5F4A, 0x8F99, + 0x5F4B, 0x8F9A, 0x5F4C, 0x8F9B, 0x5F4D, 0x8F9C, 0x5F4E, 0x8F9D, 0x5F4F, 0x8F9E, 0x5F50, 0xE5E6, 0x5F51, 0x8F9F, 0x5F52, 0xB9E9, + 0x5F53, 0xB5B1, 0x5F54, 0x8FA0, 0x5F55, 0xC2BC, 0x5F56, 0xE5E8, 0x5F57, 0xE5E7, 0x5F58, 0xE5E9, 0x5F59, 0x8FA1, 0x5F5A, 0x8FA2, + 0x5F5B, 0x8FA3, 0x5F5C, 0x8FA4, 0x5F5D, 0xD2CD, 0x5F5E, 0x8FA5, 0x5F5F, 0x8FA6, 0x5F60, 0x8FA7, 0x5F61, 0xE1EA, 0x5F62, 0xD0CE, + 0x5F63, 0x8FA8, 0x5F64, 0xCDAE, 0x5F65, 0x8FA9, 0x5F66, 0xD1E5, 0x5F67, 0x8FAA, 0x5F68, 0x8FAB, 0x5F69, 0xB2CA, 0x5F6A, 0xB1EB, + 0x5F6B, 0x8FAC, 0x5F6C, 0xB1F2, 0x5F6D, 0xC5ED, 0x5F6E, 0x8FAD, 0x5F6F, 0x8FAE, 0x5F70, 0xD5C3, 0x5F71, 0xD3B0, 0x5F72, 0x8FAF, + 0x5F73, 0xE1DC, 0x5F74, 0x8FB0, 0x5F75, 0x8FB1, 0x5F76, 0x8FB2, 0x5F77, 0xE1DD, 0x5F78, 0x8FB3, 0x5F79, 0xD2DB, 0x5F7A, 0x8FB4, + 0x5F7B, 0xB3B9, 0x5F7C, 0xB1CB, 0x5F7D, 0x8FB5, 0x5F7E, 0x8FB6, 0x5F7F, 0x8FB7, 0x5F80, 0xCDF9, 0x5F81, 0xD5F7, 0x5F82, 0xE1DE, + 0x5F83, 0x8FB8, 0x5F84, 0xBEB6, 0x5F85, 0xB4FD, 0x5F86, 0x8FB9, 0x5F87, 0xE1DF, 0x5F88, 0xBADC, 0x5F89, 0xE1E0, 0x5F8A, 0xBBB2, + 0x5F8B, 0xC2C9, 0x5F8C, 0xE1E1, 0x5F8D, 0x8FBA, 0x5F8E, 0x8FBB, 0x5F8F, 0x8FBC, 0x5F90, 0xD0EC, 0x5F91, 0x8FBD, 0x5F92, 0xCDBD, + 0x5F93, 0x8FBE, 0x5F94, 0x8FBF, 0x5F95, 0xE1E2, 0x5F96, 0x8FC0, 0x5F97, 0xB5C3, 0x5F98, 0xC5C7, 0x5F99, 0xE1E3, 0x5F9A, 0x8FC1, + 0x5F9B, 0x8FC2, 0x5F9C, 0xE1E4, 0x5F9D, 0x8FC3, 0x5F9E, 0x8FC4, 0x5F9F, 0x8FC5, 0x5FA0, 0x8FC6, 0x5FA1, 0xD3F9, 0x5FA2, 0x8FC7, + 0x5FA3, 0x8FC8, 0x5FA4, 0x8FC9, 0x5FA5, 0x8FCA, 0x5FA6, 0x8FCB, 0x5FA7, 0x8FCC, 0x5FA8, 0xE1E5, 0x5FA9, 0x8FCD, 0x5FAA, 0xD1AD, + 0x5FAB, 0x8FCE, 0x5FAC, 0x8FCF, 0x5FAD, 0xE1E6, 0x5FAE, 0xCEA2, 0x5FAF, 0x8FD0, 0x5FB0, 0x8FD1, 0x5FB1, 0x8FD2, 0x5FB2, 0x8FD3, + 0x5FB3, 0x8FD4, 0x5FB4, 0x8FD5, 0x5FB5, 0xE1E7, 0x5FB6, 0x8FD6, 0x5FB7, 0xB5C2, 0x5FB8, 0x8FD7, 0x5FB9, 0x8FD8, 0x5FBA, 0x8FD9, + 0x5FBB, 0x8FDA, 0x5FBC, 0xE1E8, 0x5FBD, 0xBBD5, 0x5FBE, 0x8FDB, 0x5FBF, 0x8FDC, 0x5FC0, 0x8FDD, 0x5FC1, 0x8FDE, 0x5FC2, 0x8FDF, + 0x5FC3, 0xD0C4, 0x5FC4, 0xE2E0, 0x5FC5, 0xB1D8, 0x5FC6, 0xD2E4, 0x5FC7, 0x8FE0, 0x5FC8, 0x8FE1, 0x5FC9, 0xE2E1, 0x5FCA, 0x8FE2, + 0x5FCB, 0x8FE3, 0x5FCC, 0xBCC9, 0x5FCD, 0xC8CC, 0x5FCE, 0x8FE4, 0x5FCF, 0xE2E3, 0x5FD0, 0xECFE, 0x5FD1, 0xECFD, 0x5FD2, 0xDFAF, + 0x5FD3, 0x8FE5, 0x5FD4, 0x8FE6, 0x5FD5, 0x8FE7, 0x5FD6, 0xE2E2, 0x5FD7, 0xD6BE, 0x5FD8, 0xCDFC, 0x5FD9, 0xC3A6, 0x5FDA, 0x8FE8, + 0x5FDB, 0x8FE9, 0x5FDC, 0x8FEA, 0x5FDD, 0xE3C3, 0x5FDE, 0x8FEB, 0x5FDF, 0x8FEC, 0x5FE0, 0xD6D2, 0x5FE1, 0xE2E7, 0x5FE2, 0x8FED, + 0x5FE3, 0x8FEE, 0x5FE4, 0xE2E8, 0x5FE5, 0x8FEF, 0x5FE6, 0x8FF0, 0x5FE7, 0xD3C7, 0x5FE8, 0x8FF1, 0x5FE9, 0x8FF2, 0x5FEA, 0xE2EC, + 0x5FEB, 0xBFEC, 0x5FEC, 0x8FF3, 0x5FED, 0xE2ED, 0x5FEE, 0xE2E5, 0x5FEF, 0x8FF4, 0x5FF0, 0x8FF5, 0x5FF1, 0xB3C0, 0x5FF2, 0x8FF6, + 0x5FF3, 0x8FF7, 0x5FF4, 0x8FF8, 0x5FF5, 0xC4EE, 0x5FF6, 0x8FF9, 0x5FF7, 0x8FFA, 0x5FF8, 0xE2EE, 0x5FF9, 0x8FFB, 0x5FFA, 0x8FFC, + 0x5FFB, 0xD0C3, 0x5FFC, 0x8FFD, 0x5FFD, 0xBAF6, 0x5FFE, 0xE2E9, 0x5FFF, 0xB7DE, 0x6000, 0xBBB3, 0x6001, 0xCCAC, 0x6002, 0xCBCB, + 0x6003, 0xE2E4, 0x6004, 0xE2E6, 0x6005, 0xE2EA, 0x6006, 0xE2EB, 0x6007, 0x8FFE, 0x6008, 0x9040, 0x6009, 0x9041, 0x600A, 0xE2F7, + 0x600B, 0x9042, 0x600C, 0x9043, 0x600D, 0xE2F4, 0x600E, 0xD4F5, 0x600F, 0xE2F3, 0x6010, 0x9044, 0x6011, 0x9045, 0x6012, 0xC5AD, + 0x6013, 0x9046, 0x6014, 0xD5FA, 0x6015, 0xC5C2, 0x6016, 0xB2C0, 0x6017, 0x9047, 0x6018, 0x9048, 0x6019, 0xE2EF, 0x601A, 0x9049, + 0x601B, 0xE2F2, 0x601C, 0xC1AF, 0x601D, 0xCBBC, 0x601E, 0x904A, 0x601F, 0x904B, 0x6020, 0xB5A1, 0x6021, 0xE2F9, 0x6022, 0x904C, + 0x6023, 0x904D, 0x6024, 0x904E, 0x6025, 0xBCB1, 0x6026, 0xE2F1, 0x6027, 0xD0D4, 0x6028, 0xD4B9, 0x6029, 0xE2F5, 0x602A, 0xB9D6, + 0x602B, 0xE2F6, 0x602C, 0x904F, 0x602D, 0x9050, 0x602E, 0x9051, 0x602F, 0xC7D3, 0x6030, 0x9052, 0x6031, 0x9053, 0x6032, 0x9054, + 0x6033, 0x9055, 0x6034, 0x9056, 0x6035, 0xE2F0, 0x6036, 0x9057, 0x6037, 0x9058, 0x6038, 0x9059, 0x6039, 0x905A, 0x603A, 0x905B, + 0x603B, 0xD7DC, 0x603C, 0xEDA1, 0x603D, 0x905C, 0x603E, 0x905D, 0x603F, 0xE2F8, 0x6040, 0x905E, 0x6041, 0xEDA5, 0x6042, 0xE2FE, + 0x6043, 0xCAD1, 0x6044, 0x905F, 0x6045, 0x9060, 0x6046, 0x9061, 0x6047, 0x9062, 0x6048, 0x9063, 0x6049, 0x9064, 0x604A, 0x9065, + 0x604B, 0xC1B5, 0x604C, 0x9066, 0x604D, 0xBBD0, 0x604E, 0x9067, 0x604F, 0x9068, 0x6050, 0xBFD6, 0x6051, 0x9069, 0x6052, 0xBAE3, + 0x6053, 0x906A, 0x6054, 0x906B, 0x6055, 0xCBA1, 0x6056, 0x906C, 0x6057, 0x906D, 0x6058, 0x906E, 0x6059, 0xEDA6, 0x605A, 0xEDA3, + 0x605B, 0x906F, 0x605C, 0x9070, 0x605D, 0xEDA2, 0x605E, 0x9071, 0x605F, 0x9072, 0x6060, 0x9073, 0x6061, 0x9074, 0x6062, 0xBBD6, + 0x6063, 0xEDA7, 0x6064, 0xD0F4, 0x6065, 0x9075, 0x6066, 0x9076, 0x6067, 0xEDA4, 0x6068, 0xBADE, 0x6069, 0xB6F7, 0x606A, 0xE3A1, + 0x606B, 0xB6B2, 0x606C, 0xCCF1, 0x606D, 0xB9A7, 0x606E, 0x9077, 0x606F, 0xCFA2, 0x6070, 0xC7A1, 0x6071, 0x9078, 0x6072, 0x9079, + 0x6073, 0xBFD2, 0x6074, 0x907A, 0x6075, 0x907B, 0x6076, 0xB6F1, 0x6077, 0x907C, 0x6078, 0xE2FA, 0x6079, 0xE2FB, 0x607A, 0xE2FD, + 0x607B, 0xE2FC, 0x607C, 0xC4D5, 0x607D, 0xE3A2, 0x607E, 0x907D, 0x607F, 0xD3C1, 0x6080, 0x907E, 0x6081, 0x9080, 0x6082, 0x9081, + 0x6083, 0xE3A7, 0x6084, 0xC7C4, 0x6085, 0x9082, 0x6086, 0x9083, 0x6087, 0x9084, 0x6088, 0x9085, 0x6089, 0xCFA4, 0x608A, 0x9086, + 0x608B, 0x9087, 0x608C, 0xE3A9, 0x608D, 0xBAB7, 0x608E, 0x9088, 0x608F, 0x9089, 0x6090, 0x908A, 0x6091, 0x908B, 0x6092, 0xE3A8, + 0x6093, 0x908C, 0x6094, 0xBBDA, 0x6095, 0x908D, 0x6096, 0xE3A3, 0x6097, 0x908E, 0x6098, 0x908F, 0x6099, 0x9090, 0x609A, 0xE3A4, + 0x609B, 0xE3AA, 0x609C, 0x9091, 0x609D, 0xE3A6, 0x609E, 0x9092, 0x609F, 0xCEF2, 0x60A0, 0xD3C6, 0x60A1, 0x9093, 0x60A2, 0x9094, + 0x60A3, 0xBBBC, 0x60A4, 0x9095, 0x60A5, 0x9096, 0x60A6, 0xD4C3, 0x60A7, 0x9097, 0x60A8, 0xC4FA, 0x60A9, 0x9098, 0x60AA, 0x9099, + 0x60AB, 0xEDA8, 0x60AC, 0xD0FC, 0x60AD, 0xE3A5, 0x60AE, 0x909A, 0x60AF, 0xC3F5, 0x60B0, 0x909B, 0x60B1, 0xE3AD, 0x60B2, 0xB1AF, + 0x60B3, 0x909C, 0x60B4, 0xE3B2, 0x60B5, 0x909D, 0x60B6, 0x909E, 0x60B7, 0x909F, 0x60B8, 0xBCC2, 0x60B9, 0x90A0, 0x60BA, 0x90A1, + 0x60BB, 0xE3AC, 0x60BC, 0xB5BF, 0x60BD, 0x90A2, 0x60BE, 0x90A3, 0x60BF, 0x90A4, 0x60C0, 0x90A5, 0x60C1, 0x90A6, 0x60C2, 0x90A7, + 0x60C3, 0x90A8, 0x60C4, 0x90A9, 0x60C5, 0xC7E9, 0x60C6, 0xE3B0, 0x60C7, 0x90AA, 0x60C8, 0x90AB, 0x60C9, 0x90AC, 0x60CA, 0xBEAA, + 0x60CB, 0xCDEF, 0x60CC, 0x90AD, 0x60CD, 0x90AE, 0x60CE, 0x90AF, 0x60CF, 0x90B0, 0x60D0, 0x90B1, 0x60D1, 0xBBF3, 0x60D2, 0x90B2, + 0x60D3, 0x90B3, 0x60D4, 0x90B4, 0x60D5, 0xCCE8, 0x60D6, 0x90B5, 0x60D7, 0x90B6, 0x60D8, 0xE3AF, 0x60D9, 0x90B7, 0x60DA, 0xE3B1, + 0x60DB, 0x90B8, 0x60DC, 0xCFA7, 0x60DD, 0xE3AE, 0x60DE, 0x90B9, 0x60DF, 0xCEA9, 0x60E0, 0xBBDD, 0x60E1, 0x90BA, 0x60E2, 0x90BB, + 0x60E3, 0x90BC, 0x60E4, 0x90BD, 0x60E5, 0x90BE, 0x60E6, 0xB5EB, 0x60E7, 0xBEE5, 0x60E8, 0xB2D2, 0x60E9, 0xB3CD, 0x60EA, 0x90BF, + 0x60EB, 0xB1B9, 0x60EC, 0xE3AB, 0x60ED, 0xB2D1, 0x60EE, 0xB5AC, 0x60EF, 0xB9DF, 0x60F0, 0xB6E8, 0x60F1, 0x90C0, 0x60F2, 0x90C1, + 0x60F3, 0xCFEB, 0x60F4, 0xE3B7, 0x60F5, 0x90C2, 0x60F6, 0xBBCC, 0x60F7, 0x90C3, 0x60F8, 0x90C4, 0x60F9, 0xC8C7, 0x60FA, 0xD0CA, + 0x60FB, 0x90C5, 0x60FC, 0x90C6, 0x60FD, 0x90C7, 0x60FE, 0x90C8, 0x60FF, 0x90C9, 0x6100, 0xE3B8, 0x6101, 0xB3EE, 0x6102, 0x90CA, + 0x6103, 0x90CB, 0x6104, 0x90CC, 0x6105, 0x90CD, 0x6106, 0xEDA9, 0x6107, 0x90CE, 0x6108, 0xD3FA, 0x6109, 0xD3E4, 0x610A, 0x90CF, + 0x610B, 0x90D0, 0x610C, 0x90D1, 0x610D, 0xEDAA, 0x610E, 0xE3B9, 0x610F, 0xD2E2, 0x6110, 0x90D2, 0x6111, 0x90D3, 0x6112, 0x90D4, + 0x6113, 0x90D5, 0x6114, 0x90D6, 0x6115, 0xE3B5, 0x6116, 0x90D7, 0x6117, 0x90D8, 0x6118, 0x90D9, 0x6119, 0x90DA, 0x611A, 0xD3DE, + 0x611B, 0x90DB, 0x611C, 0x90DC, 0x611D, 0x90DD, 0x611E, 0x90DE, 0x611F, 0xB8D0, 0x6120, 0xE3B3, 0x6121, 0x90DF, 0x6122, 0x90E0, + 0x6123, 0xE3B6, 0x6124, 0xB7DF, 0x6125, 0x90E1, 0x6126, 0xE3B4, 0x6127, 0xC0A2, 0x6128, 0x90E2, 0x6129, 0x90E3, 0x612A, 0x90E4, + 0x612B, 0xE3BA, 0x612C, 0x90E5, 0x612D, 0x90E6, 0x612E, 0x90E7, 0x612F, 0x90E8, 0x6130, 0x90E9, 0x6131, 0x90EA, 0x6132, 0x90EB, + 0x6133, 0x90EC, 0x6134, 0x90ED, 0x6135, 0x90EE, 0x6136, 0x90EF, 0x6137, 0x90F0, 0x6138, 0x90F1, 0x6139, 0x90F2, 0x613A, 0x90F3, + 0x613B, 0x90F4, 0x613C, 0x90F5, 0x613D, 0x90F6, 0x613E, 0x90F7, 0x613F, 0xD4B8, 0x6140, 0x90F8, 0x6141, 0x90F9, 0x6142, 0x90FA, + 0x6143, 0x90FB, 0x6144, 0x90FC, 0x6145, 0x90FD, 0x6146, 0x90FE, 0x6147, 0x9140, 0x6148, 0xB4C8, 0x6149, 0x9141, 0x614A, 0xE3BB, + 0x614B, 0x9142, 0x614C, 0xBBC5, 0x614D, 0x9143, 0x614E, 0xC9F7, 0x614F, 0x9144, 0x6150, 0x9145, 0x6151, 0xC9E5, 0x6152, 0x9146, + 0x6153, 0x9147, 0x6154, 0x9148, 0x6155, 0xC4BD, 0x6156, 0x9149, 0x6157, 0x914A, 0x6158, 0x914B, 0x6159, 0x914C, 0x615A, 0x914D, + 0x615B, 0x914E, 0x615C, 0x914F, 0x615D, 0xEDAB, 0x615E, 0x9150, 0x615F, 0x9151, 0x6160, 0x9152, 0x6161, 0x9153, 0x6162, 0xC2FD, + 0x6163, 0x9154, 0x6164, 0x9155, 0x6165, 0x9156, 0x6166, 0x9157, 0x6167, 0xBBDB, 0x6168, 0xBFAE, 0x6169, 0x9158, 0x616A, 0x9159, + 0x616B, 0x915A, 0x616C, 0x915B, 0x616D, 0x915C, 0x616E, 0x915D, 0x616F, 0x915E, 0x6170, 0xCEBF, 0x6171, 0x915F, 0x6172, 0x9160, + 0x6173, 0x9161, 0x6174, 0x9162, 0x6175, 0xE3BC, 0x6176, 0x9163, 0x6177, 0xBFB6, 0x6178, 0x9164, 0x6179, 0x9165, 0x617A, 0x9166, + 0x617B, 0x9167, 0x617C, 0x9168, 0x617D, 0x9169, 0x617E, 0x916A, 0x617F, 0x916B, 0x6180, 0x916C, 0x6181, 0x916D, 0x6182, 0x916E, + 0x6183, 0x916F, 0x6184, 0x9170, 0x6185, 0x9171, 0x6186, 0x9172, 0x6187, 0x9173, 0x6188, 0x9174, 0x6189, 0x9175, 0x618A, 0x9176, + 0x618B, 0xB1EF, 0x618C, 0x9177, 0x618D, 0x9178, 0x618E, 0xD4F7, 0x618F, 0x9179, 0x6190, 0x917A, 0x6191, 0x917B, 0x6192, 0x917C, + 0x6193, 0x917D, 0x6194, 0xE3BE, 0x6195, 0x917E, 0x6196, 0x9180, 0x6197, 0x9181, 0x6198, 0x9182, 0x6199, 0x9183, 0x619A, 0x9184, + 0x619B, 0x9185, 0x619C, 0x9186, 0x619D, 0xEDAD, 0x619E, 0x9187, 0x619F, 0x9188, 0x61A0, 0x9189, 0x61A1, 0x918A, 0x61A2, 0x918B, + 0x61A3, 0x918C, 0x61A4, 0x918D, 0x61A5, 0x918E, 0x61A6, 0x918F, 0x61A7, 0xE3BF, 0x61A8, 0xBAA9, 0x61A9, 0xEDAC, 0x61AA, 0x9190, + 0x61AB, 0x9191, 0x61AC, 0xE3BD, 0x61AD, 0x9192, 0x61AE, 0x9193, 0x61AF, 0x9194, 0x61B0, 0x9195, 0x61B1, 0x9196, 0x61B2, 0x9197, + 0x61B3, 0x9198, 0x61B4, 0x9199, 0x61B5, 0x919A, 0x61B6, 0x919B, 0x61B7, 0xE3C0, 0x61B8, 0x919C, 0x61B9, 0x919D, 0x61BA, 0x919E, + 0x61BB, 0x919F, 0x61BC, 0x91A0, 0x61BD, 0x91A1, 0x61BE, 0xBAB6, 0x61BF, 0x91A2, 0x61C0, 0x91A3, 0x61C1, 0x91A4, 0x61C2, 0xB6AE, + 0x61C3, 0x91A5, 0x61C4, 0x91A6, 0x61C5, 0x91A7, 0x61C6, 0x91A8, 0x61C7, 0x91A9, 0x61C8, 0xD0B8, 0x61C9, 0x91AA, 0x61CA, 0xB0C3, + 0x61CB, 0xEDAE, 0x61CC, 0x91AB, 0x61CD, 0x91AC, 0x61CE, 0x91AD, 0x61CF, 0x91AE, 0x61D0, 0x91AF, 0x61D1, 0xEDAF, 0x61D2, 0xC0C1, + 0x61D3, 0x91B0, 0x61D4, 0xE3C1, 0x61D5, 0x91B1, 0x61D6, 0x91B2, 0x61D7, 0x91B3, 0x61D8, 0x91B4, 0x61D9, 0x91B5, 0x61DA, 0x91B6, + 0x61DB, 0x91B7, 0x61DC, 0x91B8, 0x61DD, 0x91B9, 0x61DE, 0x91BA, 0x61DF, 0x91BB, 0x61E0, 0x91BC, 0x61E1, 0x91BD, 0x61E2, 0x91BE, + 0x61E3, 0x91BF, 0x61E4, 0x91C0, 0x61E5, 0x91C1, 0x61E6, 0xC5B3, 0x61E7, 0x91C2, 0x61E8, 0x91C3, 0x61E9, 0x91C4, 0x61EA, 0x91C5, + 0x61EB, 0x91C6, 0x61EC, 0x91C7, 0x61ED, 0x91C8, 0x61EE, 0x91C9, 0x61EF, 0x91CA, 0x61F0, 0x91CB, 0x61F1, 0x91CC, 0x61F2, 0x91CD, + 0x61F3, 0x91CE, 0x61F4, 0x91CF, 0x61F5, 0xE3C2, 0x61F6, 0x91D0, 0x61F7, 0x91D1, 0x61F8, 0x91D2, 0x61F9, 0x91D3, 0x61FA, 0x91D4, + 0x61FB, 0x91D5, 0x61FC, 0x91D6, 0x61FD, 0x91D7, 0x61FE, 0x91D8, 0x61FF, 0xDCB2, 0x6200, 0x91D9, 0x6201, 0x91DA, 0x6202, 0x91DB, + 0x6203, 0x91DC, 0x6204, 0x91DD, 0x6205, 0x91DE, 0x6206, 0xEDB0, 0x6207, 0x91DF, 0x6208, 0xB8EA, 0x6209, 0x91E0, 0x620A, 0xCEEC, + 0x620B, 0xEAA7, 0x620C, 0xD0E7, 0x620D, 0xCAF9, 0x620E, 0xC8D6, 0x620F, 0xCFB7, 0x6210, 0xB3C9, 0x6211, 0xCED2, 0x6212, 0xBDE4, + 0x6213, 0x91E1, 0x6214, 0x91E2, 0x6215, 0xE3DE, 0x6216, 0xBBF2, 0x6217, 0xEAA8, 0x6218, 0xD5BD, 0x6219, 0x91E3, 0x621A, 0xC6DD, + 0x621B, 0xEAA9, 0x621C, 0x91E4, 0x621D, 0x91E5, 0x621E, 0x91E6, 0x621F, 0xEAAA, 0x6220, 0x91E7, 0x6221, 0xEAAC, 0x6222, 0xEAAB, + 0x6223, 0x91E8, 0x6224, 0xEAAE, 0x6225, 0xEAAD, 0x6226, 0x91E9, 0x6227, 0x91EA, 0x6228, 0x91EB, 0x6229, 0x91EC, 0x622A, 0xBDD8, + 0x622B, 0x91ED, 0x622C, 0xEAAF, 0x622D, 0x91EE, 0x622E, 0xC2BE, 0x622F, 0x91EF, 0x6230, 0x91F0, 0x6231, 0x91F1, 0x6232, 0x91F2, + 0x6233, 0xB4C1, 0x6234, 0xB4F7, 0x6235, 0x91F3, 0x6236, 0x91F4, 0x6237, 0xBBA7, 0x6238, 0x91F5, 0x6239, 0x91F6, 0x623A, 0x91F7, + 0x623B, 0x91F8, 0x623C, 0x91F9, 0x623D, 0xECE6, 0x623E, 0xECE5, 0x623F, 0xB7BF, 0x6240, 0xCBF9, 0x6241, 0xB1E2, 0x6242, 0x91FA, + 0x6243, 0xECE7, 0x6244, 0x91FB, 0x6245, 0x91FC, 0x6246, 0x91FD, 0x6247, 0xC9C8, 0x6248, 0xECE8, 0x6249, 0xECE9, 0x624A, 0x91FE, + 0x624B, 0xCAD6, 0x624C, 0xDED0, 0x624D, 0xB2C5, 0x624E, 0xD4FA, 0x624F, 0x9240, 0x6250, 0x9241, 0x6251, 0xC6CB, 0x6252, 0xB0C7, + 0x6253, 0xB4F2, 0x6254, 0xC8D3, 0x6255, 0x9242, 0x6256, 0x9243, 0x6257, 0x9244, 0x6258, 0xCDD0, 0x6259, 0x9245, 0x625A, 0x9246, + 0x625B, 0xBFB8, 0x625C, 0x9247, 0x625D, 0x9248, 0x625E, 0x9249, 0x625F, 0x924A, 0x6260, 0x924B, 0x6261, 0x924C, 0x6262, 0x924D, + 0x6263, 0xBFDB, 0x6264, 0x924E, 0x6265, 0x924F, 0x6266, 0xC7A4, 0x6267, 0xD6B4, 0x6268, 0x9250, 0x6269, 0xC0A9, 0x626A, 0xDED1, + 0x626B, 0xC9A8, 0x626C, 0xD1EF, 0x626D, 0xC5A4, 0x626E, 0xB0E7, 0x626F, 0xB3B6, 0x6270, 0xC8C5, 0x6271, 0x9251, 0x6272, 0x9252, + 0x6273, 0xB0E2, 0x6274, 0x9253, 0x6275, 0x9254, 0x6276, 0xB7F6, 0x6277, 0x9255, 0x6278, 0x9256, 0x6279, 0xC5FA, 0x627A, 0x9257, + 0x627B, 0x9258, 0x627C, 0xB6F3, 0x627D, 0x9259, 0x627E, 0xD5D2, 0x627F, 0xB3D0, 0x6280, 0xBCBC, 0x6281, 0x925A, 0x6282, 0x925B, + 0x6283, 0x925C, 0x6284, 0xB3AD, 0x6285, 0x925D, 0x6286, 0x925E, 0x6287, 0x925F, 0x6288, 0x9260, 0x6289, 0xBEF1, 0x628A, 0xB0D1, + 0x628B, 0x9261, 0x628C, 0x9262, 0x628D, 0x9263, 0x628E, 0x9264, 0x628F, 0x9265, 0x6290, 0x9266, 0x6291, 0xD2D6, 0x6292, 0xCAE3, + 0x6293, 0xD7A5, 0x6294, 0x9267, 0x6295, 0xCDB6, 0x6296, 0xB6B6, 0x6297, 0xBFB9, 0x6298, 0xD5DB, 0x6299, 0x9268, 0x629A, 0xB8A7, + 0x629B, 0xC5D7, 0x629C, 0x9269, 0x629D, 0x926A, 0x629E, 0x926B, 0x629F, 0xDED2, 0x62A0, 0xBFD9, 0x62A1, 0xC2D5, 0x62A2, 0xC7C0, + 0x62A3, 0x926C, 0x62A4, 0xBBA4, 0x62A5, 0xB1A8, 0x62A6, 0x926D, 0x62A7, 0x926E, 0x62A8, 0xC5EA, 0x62A9, 0x926F, 0x62AA, 0x9270, + 0x62AB, 0xC5FB, 0x62AC, 0xCCA7, 0x62AD, 0x9271, 0x62AE, 0x9272, 0x62AF, 0x9273, 0x62B0, 0x9274, 0x62B1, 0xB1A7, 0x62B2, 0x9275, + 0x62B3, 0x9276, 0x62B4, 0x9277, 0x62B5, 0xB5D6, 0x62B6, 0x9278, 0x62B7, 0x9279, 0x62B8, 0x927A, 0x62B9, 0xC4A8, 0x62BA, 0x927B, + 0x62BB, 0xDED3, 0x62BC, 0xD1BA, 0x62BD, 0xB3E9, 0x62BE, 0x927C, 0x62BF, 0xC3F2, 0x62C0, 0x927D, 0x62C1, 0x927E, 0x62C2, 0xB7F7, + 0x62C3, 0x9280, 0x62C4, 0xD6F4, 0x62C5, 0xB5A3, 0x62C6, 0xB2F0, 0x62C7, 0xC4B4, 0x62C8, 0xC4E9, 0x62C9, 0xC0AD, 0x62CA, 0xDED4, + 0x62CB, 0x9281, 0x62CC, 0xB0E8, 0x62CD, 0xC5C4, 0x62CE, 0xC1E0, 0x62CF, 0x9282, 0x62D0, 0xB9D5, 0x62D1, 0x9283, 0x62D2, 0xBEDC, + 0x62D3, 0xCDD8, 0x62D4, 0xB0CE, 0x62D5, 0x9284, 0x62D6, 0xCDCF, 0x62D7, 0xDED6, 0x62D8, 0xBED0, 0x62D9, 0xD7BE, 0x62DA, 0xDED5, + 0x62DB, 0xD5D0, 0x62DC, 0xB0DD, 0x62DD, 0x9285, 0x62DE, 0x9286, 0x62DF, 0xC4E2, 0x62E0, 0x9287, 0x62E1, 0x9288, 0x62E2, 0xC2A3, + 0x62E3, 0xBCF0, 0x62E4, 0x9289, 0x62E5, 0xD3B5, 0x62E6, 0xC0B9, 0x62E7, 0xC5A1, 0x62E8, 0xB2A6, 0x62E9, 0xD4F1, 0x62EA, 0x928A, + 0x62EB, 0x928B, 0x62EC, 0xC0A8, 0x62ED, 0xCAC3, 0x62EE, 0xDED7, 0x62EF, 0xD5FC, 0x62F0, 0x928C, 0x62F1, 0xB9B0, 0x62F2, 0x928D, + 0x62F3, 0xC8AD, 0x62F4, 0xCBA9, 0x62F5, 0x928E, 0x62F6, 0xDED9, 0x62F7, 0xBFBD, 0x62F8, 0x928F, 0x62F9, 0x9290, 0x62FA, 0x9291, + 0x62FB, 0x9292, 0x62FC, 0xC6B4, 0x62FD, 0xD7A7, 0x62FE, 0xCAB0, 0x62FF, 0xC4C3, 0x6300, 0x9293, 0x6301, 0xB3D6, 0x6302, 0xB9D2, + 0x6303, 0x9294, 0x6304, 0x9295, 0x6305, 0x9296, 0x6306, 0x9297, 0x6307, 0xD6B8, 0x6308, 0xEAFC, 0x6309, 0xB0B4, 0x630A, 0x9298, + 0x630B, 0x9299, 0x630C, 0x929A, 0x630D, 0x929B, 0x630E, 0xBFE6, 0x630F, 0x929C, 0x6310, 0x929D, 0x6311, 0xCCF4, 0x6312, 0x929E, + 0x6313, 0x929F, 0x6314, 0x92A0, 0x6315, 0x92A1, 0x6316, 0xCDDA, 0x6317, 0x92A2, 0x6318, 0x92A3, 0x6319, 0x92A4, 0x631A, 0xD6BF, + 0x631B, 0xC2CE, 0x631C, 0x92A5, 0x631D, 0xCECE, 0x631E, 0xCCA2, 0x631F, 0xD0AE, 0x6320, 0xC4D3, 0x6321, 0xB5B2, 0x6322, 0xDED8, + 0x6323, 0xD5F5, 0x6324, 0xBCB7, 0x6325, 0xBBD3, 0x6326, 0x92A6, 0x6327, 0x92A7, 0x6328, 0xB0A4, 0x6329, 0x92A8, 0x632A, 0xC5B2, + 0x632B, 0xB4EC, 0x632C, 0x92A9, 0x632D, 0x92AA, 0x632E, 0x92AB, 0x632F, 0xD5F1, 0x6330, 0x92AC, 0x6331, 0x92AD, 0x6332, 0xEAFD, + 0x6333, 0x92AE, 0x6334, 0x92AF, 0x6335, 0x92B0, 0x6336, 0x92B1, 0x6337, 0x92B2, 0x6338, 0x92B3, 0x6339, 0xDEDA, 0x633A, 0xCDA6, + 0x633B, 0x92B4, 0x633C, 0x92B5, 0x633D, 0xCDEC, 0x633E, 0x92B6, 0x633F, 0x92B7, 0x6340, 0x92B8, 0x6341, 0x92B9, 0x6342, 0xCEE6, + 0x6343, 0xDEDC, 0x6344, 0x92BA, 0x6345, 0xCDB1, 0x6346, 0xC0A6, 0x6347, 0x92BB, 0x6348, 0x92BC, 0x6349, 0xD7BD, 0x634A, 0x92BD, + 0x634B, 0xDEDB, 0x634C, 0xB0C6, 0x634D, 0xBAB4, 0x634E, 0xC9D3, 0x634F, 0xC4F3, 0x6350, 0xBEE8, 0x6351, 0x92BE, 0x6352, 0x92BF, + 0x6353, 0x92C0, 0x6354, 0x92C1, 0x6355, 0xB2B6, 0x6356, 0x92C2, 0x6357, 0x92C3, 0x6358, 0x92C4, 0x6359, 0x92C5, 0x635A, 0x92C6, + 0x635B, 0x92C7, 0x635C, 0x92C8, 0x635D, 0x92C9, 0x635E, 0xC0CC, 0x635F, 0xCBF0, 0x6360, 0x92CA, 0x6361, 0xBCF1, 0x6362, 0xBBBB, + 0x6363, 0xB5B7, 0x6364, 0x92CB, 0x6365, 0x92CC, 0x6366, 0x92CD, 0x6367, 0xC5F5, 0x6368, 0x92CE, 0x6369, 0xDEE6, 0x636A, 0x92CF, + 0x636B, 0x92D0, 0x636C, 0x92D1, 0x636D, 0xDEE3, 0x636E, 0xBEDD, 0x636F, 0x92D2, 0x6370, 0x92D3, 0x6371, 0xDEDF, 0x6372, 0x92D4, + 0x6373, 0x92D5, 0x6374, 0x92D6, 0x6375, 0x92D7, 0x6376, 0xB4B7, 0x6377, 0xBDDD, 0x6378, 0x92D8, 0x6379, 0x92D9, 0x637A, 0xDEE0, + 0x637B, 0xC4ED, 0x637C, 0x92DA, 0x637D, 0x92DB, 0x637E, 0x92DC, 0x637F, 0x92DD, 0x6380, 0xCFC6, 0x6381, 0x92DE, 0x6382, 0xB5E0, + 0x6383, 0x92DF, 0x6384, 0x92E0, 0x6385, 0x92E1, 0x6386, 0x92E2, 0x6387, 0xB6DE, 0x6388, 0xCADA, 0x6389, 0xB5F4, 0x638A, 0xDEE5, + 0x638B, 0x92E3, 0x638C, 0xD5C6, 0x638D, 0x92E4, 0x638E, 0xDEE1, 0x638F, 0xCCCD, 0x6390, 0xC6FE, 0x6391, 0x92E5, 0x6392, 0xC5C5, + 0x6393, 0x92E6, 0x6394, 0x92E7, 0x6395, 0x92E8, 0x6396, 0xD2B4, 0x6397, 0x92E9, 0x6398, 0xBEF2, 0x6399, 0x92EA, 0x639A, 0x92EB, + 0x639B, 0x92EC, 0x639C, 0x92ED, 0x639D, 0x92EE, 0x639E, 0x92EF, 0x639F, 0x92F0, 0x63A0, 0xC2D3, 0x63A1, 0x92F1, 0x63A2, 0xCCBD, + 0x63A3, 0xB3B8, 0x63A4, 0x92F2, 0x63A5, 0xBDD3, 0x63A6, 0x92F3, 0x63A7, 0xBFD8, 0x63A8, 0xCDC6, 0x63A9, 0xD1DA, 0x63AA, 0xB4EB, + 0x63AB, 0x92F4, 0x63AC, 0xDEE4, 0x63AD, 0xDEDD, 0x63AE, 0xDEE7, 0x63AF, 0x92F5, 0x63B0, 0xEAFE, 0x63B1, 0x92F6, 0x63B2, 0x92F7, + 0x63B3, 0xC2B0, 0x63B4, 0xDEE2, 0x63B5, 0x92F8, 0x63B6, 0x92F9, 0x63B7, 0xD6C0, 0x63B8, 0xB5A7, 0x63B9, 0x92FA, 0x63BA, 0xB2F4, + 0x63BB, 0x92FB, 0x63BC, 0xDEE8, 0x63BD, 0x92FC, 0x63BE, 0xDEF2, 0x63BF, 0x92FD, 0x63C0, 0x92FE, 0x63C1, 0x9340, 0x63C2, 0x9341, + 0x63C3, 0x9342, 0x63C4, 0xDEED, 0x63C5, 0x9343, 0x63C6, 0xDEF1, 0x63C7, 0x9344, 0x63C8, 0x9345, 0x63C9, 0xC8E0, 0x63CA, 0x9346, + 0x63CB, 0x9347, 0x63CC, 0x9348, 0x63CD, 0xD7E1, 0x63CE, 0xDEEF, 0x63CF, 0xC3E8, 0x63D0, 0xCCE1, 0x63D1, 0x9349, 0x63D2, 0xB2E5, + 0x63D3, 0x934A, 0x63D4, 0x934B, 0x63D5, 0x934C, 0x63D6, 0xD2BE, 0x63D7, 0x934D, 0x63D8, 0x934E, 0x63D9, 0x934F, 0x63DA, 0x9350, + 0x63DB, 0x9351, 0x63DC, 0x9352, 0x63DD, 0x9353, 0x63DE, 0xDEEE, 0x63DF, 0x9354, 0x63E0, 0xDEEB, 0x63E1, 0xCED5, 0x63E2, 0x9355, + 0x63E3, 0xB4A7, 0x63E4, 0x9356, 0x63E5, 0x9357, 0x63E6, 0x9358, 0x63E7, 0x9359, 0x63E8, 0x935A, 0x63E9, 0xBFAB, 0x63EA, 0xBEBE, + 0x63EB, 0x935B, 0x63EC, 0x935C, 0x63ED, 0xBDD2, 0x63EE, 0x935D, 0x63EF, 0x935E, 0x63F0, 0x935F, 0x63F1, 0x9360, 0x63F2, 0xDEE9, + 0x63F3, 0x9361, 0x63F4, 0xD4AE, 0x63F5, 0x9362, 0x63F6, 0xDEDE, 0x63F7, 0x9363, 0x63F8, 0xDEEA, 0x63F9, 0x9364, 0x63FA, 0x9365, + 0x63FB, 0x9366, 0x63FC, 0x9367, 0x63FD, 0xC0BF, 0x63FE, 0x9368, 0x63FF, 0xDEEC, 0x6400, 0xB2F3, 0x6401, 0xB8E9, 0x6402, 0xC2A7, + 0x6403, 0x9369, 0x6404, 0x936A, 0x6405, 0xBDC1, 0x6406, 0x936B, 0x6407, 0x936C, 0x6408, 0x936D, 0x6409, 0x936E, 0x640A, 0x936F, + 0x640B, 0xDEF5, 0x640C, 0xDEF8, 0x640D, 0x9370, 0x640E, 0x9371, 0x640F, 0xB2AB, 0x6410, 0xB4A4, 0x6411, 0x9372, 0x6412, 0x9373, + 0x6413, 0xB4EA, 0x6414, 0xC9A6, 0x6415, 0x9374, 0x6416, 0x9375, 0x6417, 0x9376, 0x6418, 0x9377, 0x6419, 0x9378, 0x641A, 0x9379, + 0x641B, 0xDEF6, 0x641C, 0xCBD1, 0x641D, 0x937A, 0x641E, 0xB8E3, 0x641F, 0x937B, 0x6420, 0xDEF7, 0x6421, 0xDEFA, 0x6422, 0x937C, + 0x6423, 0x937D, 0x6424, 0x937E, 0x6425, 0x9380, 0x6426, 0xDEF9, 0x6427, 0x9381, 0x6428, 0x9382, 0x6429, 0x9383, 0x642A, 0xCCC2, + 0x642B, 0x9384, 0x642C, 0xB0E1, 0x642D, 0xB4EE, 0x642E, 0x9385, 0x642F, 0x9386, 0x6430, 0x9387, 0x6431, 0x9388, 0x6432, 0x9389, + 0x6433, 0x938A, 0x6434, 0xE5BA, 0x6435, 0x938B, 0x6436, 0x938C, 0x6437, 0x938D, 0x6438, 0x938E, 0x6439, 0x938F, 0x643A, 0xD0AF, + 0x643B, 0x9390, 0x643C, 0x9391, 0x643D, 0xB2EB, 0x643E, 0x9392, 0x643F, 0xEBA1, 0x6440, 0x9393, 0x6441, 0xDEF4, 0x6442, 0x9394, + 0x6443, 0x9395, 0x6444, 0xC9E3, 0x6445, 0xDEF3, 0x6446, 0xB0DA, 0x6447, 0xD2A1, 0x6448, 0xB1F7, 0x6449, 0x9396, 0x644A, 0xCCAF, + 0x644B, 0x9397, 0x644C, 0x9398, 0x644D, 0x9399, 0x644E, 0x939A, 0x644F, 0x939B, 0x6450, 0x939C, 0x6451, 0x939D, 0x6452, 0xDEF0, + 0x6453, 0x939E, 0x6454, 0xCBA4, 0x6455, 0x939F, 0x6456, 0x93A0, 0x6457, 0x93A1, 0x6458, 0xD5AA, 0x6459, 0x93A2, 0x645A, 0x93A3, + 0x645B, 0x93A4, 0x645C, 0x93A5, 0x645D, 0x93A6, 0x645E, 0xDEFB, 0x645F, 0x93A7, 0x6460, 0x93A8, 0x6461, 0x93A9, 0x6462, 0x93AA, + 0x6463, 0x93AB, 0x6464, 0x93AC, 0x6465, 0x93AD, 0x6466, 0x93AE, 0x6467, 0xB4DD, 0x6468, 0x93AF, 0x6469, 0xC4A6, 0x646A, 0x93B0, + 0x646B, 0x93B1, 0x646C, 0x93B2, 0x646D, 0xDEFD, 0x646E, 0x93B3, 0x646F, 0x93B4, 0x6470, 0x93B5, 0x6471, 0x93B6, 0x6472, 0x93B7, + 0x6473, 0x93B8, 0x6474, 0x93B9, 0x6475, 0x93BA, 0x6476, 0x93BB, 0x6477, 0x93BC, 0x6478, 0xC3FE, 0x6479, 0xC4A1, 0x647A, 0xDFA1, + 0x647B, 0x93BD, 0x647C, 0x93BE, 0x647D, 0x93BF, 0x647E, 0x93C0, 0x647F, 0x93C1, 0x6480, 0x93C2, 0x6481, 0x93C3, 0x6482, 0xC1CC, + 0x6483, 0x93C4, 0x6484, 0xDEFC, 0x6485, 0xBEEF, 0x6486, 0x93C5, 0x6487, 0xC6B2, 0x6488, 0x93C6, 0x6489, 0x93C7, 0x648A, 0x93C8, + 0x648B, 0x93C9, 0x648C, 0x93CA, 0x648D, 0x93CB, 0x648E, 0x93CC, 0x648F, 0x93CD, 0x6490, 0x93CE, 0x6491, 0xB3C5, 0x6492, 0xC8F6, + 0x6493, 0x93CF, 0x6494, 0x93D0, 0x6495, 0xCBBA, 0x6496, 0xDEFE, 0x6497, 0x93D1, 0x6498, 0x93D2, 0x6499, 0xDFA4, 0x649A, 0x93D3, + 0x649B, 0x93D4, 0x649C, 0x93D5, 0x649D, 0x93D6, 0x649E, 0xD7B2, 0x649F, 0x93D7, 0x64A0, 0x93D8, 0x64A1, 0x93D9, 0x64A2, 0x93DA, + 0x64A3, 0x93DB, 0x64A4, 0xB3B7, 0x64A5, 0x93DC, 0x64A6, 0x93DD, 0x64A7, 0x93DE, 0x64A8, 0x93DF, 0x64A9, 0xC1C3, 0x64AA, 0x93E0, + 0x64AB, 0x93E1, 0x64AC, 0xC7CB, 0x64AD, 0xB2A5, 0x64AE, 0xB4E9, 0x64AF, 0x93E2, 0x64B0, 0xD7AB, 0x64B1, 0x93E3, 0x64B2, 0x93E4, + 0x64B3, 0x93E5, 0x64B4, 0x93E6, 0x64B5, 0xC4EC, 0x64B6, 0x93E7, 0x64B7, 0xDFA2, 0x64B8, 0xDFA3, 0x64B9, 0x93E8, 0x64BA, 0xDFA5, + 0x64BB, 0x93E9, 0x64BC, 0xBAB3, 0x64BD, 0x93EA, 0x64BE, 0x93EB, 0x64BF, 0x93EC, 0x64C0, 0xDFA6, 0x64C1, 0x93ED, 0x64C2, 0xC0DE, + 0x64C3, 0x93EE, 0x64C4, 0x93EF, 0x64C5, 0xC9C3, 0x64C6, 0x93F0, 0x64C7, 0x93F1, 0x64C8, 0x93F2, 0x64C9, 0x93F3, 0x64CA, 0x93F4, + 0x64CB, 0x93F5, 0x64CC, 0x93F6, 0x64CD, 0xB2D9, 0x64CE, 0xC7E6, 0x64CF, 0x93F7, 0x64D0, 0xDFA7, 0x64D1, 0x93F8, 0x64D2, 0xC7DC, + 0x64D3, 0x93F9, 0x64D4, 0x93FA, 0x64D5, 0x93FB, 0x64D6, 0x93FC, 0x64D7, 0xDFA8, 0x64D8, 0xEBA2, 0x64D9, 0x93FD, 0x64DA, 0x93FE, + 0x64DB, 0x9440, 0x64DC, 0x9441, 0x64DD, 0x9442, 0x64DE, 0xCBD3, 0x64DF, 0x9443, 0x64E0, 0x9444, 0x64E1, 0x9445, 0x64E2, 0xDFAA, + 0x64E3, 0x9446, 0x64E4, 0xDFA9, 0x64E5, 0x9447, 0x64E6, 0xB2C1, 0x64E7, 0x9448, 0x64E8, 0x9449, 0x64E9, 0x944A, 0x64EA, 0x944B, + 0x64EB, 0x944C, 0x64EC, 0x944D, 0x64ED, 0x944E, 0x64EE, 0x944F, 0x64EF, 0x9450, 0x64F0, 0x9451, 0x64F1, 0x9452, 0x64F2, 0x9453, + 0x64F3, 0x9454, 0x64F4, 0x9455, 0x64F5, 0x9456, 0x64F6, 0x9457, 0x64F7, 0x9458, 0x64F8, 0x9459, 0x64F9, 0x945A, 0x64FA, 0x945B, + 0x64FB, 0x945C, 0x64FC, 0x945D, 0x64FD, 0x945E, 0x64FE, 0x945F, 0x64FF, 0x9460, 0x6500, 0xC5CA, 0x6501, 0x9461, 0x6502, 0x9462, + 0x6503, 0x9463, 0x6504, 0x9464, 0x6505, 0x9465, 0x6506, 0x9466, 0x6507, 0x9467, 0x6508, 0x9468, 0x6509, 0xDFAB, 0x650A, 0x9469, + 0x650B, 0x946A, 0x650C, 0x946B, 0x650D, 0x946C, 0x650E, 0x946D, 0x650F, 0x946E, 0x6510, 0x946F, 0x6511, 0x9470, 0x6512, 0xD4DC, + 0x6513, 0x9471, 0x6514, 0x9472, 0x6515, 0x9473, 0x6516, 0x9474, 0x6517, 0x9475, 0x6518, 0xC8C1, 0x6519, 0x9476, 0x651A, 0x9477, + 0x651B, 0x9478, 0x651C, 0x9479, 0x651D, 0x947A, 0x651E, 0x947B, 0x651F, 0x947C, 0x6520, 0x947D, 0x6521, 0x947E, 0x6522, 0x9480, + 0x6523, 0x9481, 0x6524, 0x9482, 0x6525, 0xDFAC, 0x6526, 0x9483, 0x6527, 0x9484, 0x6528, 0x9485, 0x6529, 0x9486, 0x652A, 0x9487, + 0x652B, 0xBEF0, 0x652C, 0x9488, 0x652D, 0x9489, 0x652E, 0xDFAD, 0x652F, 0xD6A7, 0x6530, 0x948A, 0x6531, 0x948B, 0x6532, 0x948C, + 0x6533, 0x948D, 0x6534, 0xEAB7, 0x6535, 0xEBB6, 0x6536, 0xCAD5, 0x6537, 0x948E, 0x6538, 0xD8FC, 0x6539, 0xB8C4, 0x653A, 0x948F, + 0x653B, 0xB9A5, 0x653C, 0x9490, 0x653D, 0x9491, 0x653E, 0xB7C5, 0x653F, 0xD5FE, 0x6540, 0x9492, 0x6541, 0x9493, 0x6542, 0x9494, + 0x6543, 0x9495, 0x6544, 0x9496, 0x6545, 0xB9CA, 0x6546, 0x9497, 0x6547, 0x9498, 0x6548, 0xD0A7, 0x6549, 0xF4CD, 0x654A, 0x9499, + 0x654B, 0x949A, 0x654C, 0xB5D0, 0x654D, 0x949B, 0x654E, 0x949C, 0x654F, 0xC3F4, 0x6550, 0x949D, 0x6551, 0xBEC8, 0x6552, 0x949E, + 0x6553, 0x949F, 0x6554, 0x94A0, 0x6555, 0xEBB7, 0x6556, 0xB0BD, 0x6557, 0x94A1, 0x6558, 0x94A2, 0x6559, 0xBDCC, 0x655A, 0x94A3, + 0x655B, 0xC1B2, 0x655C, 0x94A4, 0x655D, 0xB1D6, 0x655E, 0xB3A8, 0x655F, 0x94A5, 0x6560, 0x94A6, 0x6561, 0x94A7, 0x6562, 0xB8D2, + 0x6563, 0xC9A2, 0x6564, 0x94A8, 0x6565, 0x94A9, 0x6566, 0xB6D8, 0x6567, 0x94AA, 0x6568, 0x94AB, 0x6569, 0x94AC, 0x656A, 0x94AD, + 0x656B, 0xEBB8, 0x656C, 0xBEB4, 0x656D, 0x94AE, 0x656E, 0x94AF, 0x656F, 0x94B0, 0x6570, 0xCAFD, 0x6571, 0x94B1, 0x6572, 0xC7C3, + 0x6573, 0x94B2, 0x6574, 0xD5FB, 0x6575, 0x94B3, 0x6576, 0x94B4, 0x6577, 0xB7F3, 0x6578, 0x94B5, 0x6579, 0x94B6, 0x657A, 0x94B7, + 0x657B, 0x94B8, 0x657C, 0x94B9, 0x657D, 0x94BA, 0x657E, 0x94BB, 0x657F, 0x94BC, 0x6580, 0x94BD, 0x6581, 0x94BE, 0x6582, 0x94BF, + 0x6583, 0x94C0, 0x6584, 0x94C1, 0x6585, 0x94C2, 0x6586, 0x94C3, 0x6587, 0xCEC4, 0x6588, 0x94C4, 0x6589, 0x94C5, 0x658A, 0x94C6, + 0x658B, 0xD5AB, 0x658C, 0xB1F3, 0x658D, 0x94C7, 0x658E, 0x94C8, 0x658F, 0x94C9, 0x6590, 0xECB3, 0x6591, 0xB0DF, 0x6592, 0x94CA, + 0x6593, 0xECB5, 0x6594, 0x94CB, 0x6595, 0x94CC, 0x6596, 0x94CD, 0x6597, 0xB6B7, 0x6598, 0x94CE, 0x6599, 0xC1CF, 0x659A, 0x94CF, + 0x659B, 0xF5FA, 0x659C, 0xD0B1, 0x659D, 0x94D0, 0x659E, 0x94D1, 0x659F, 0xD5E5, 0x65A0, 0x94D2, 0x65A1, 0xCED3, 0x65A2, 0x94D3, + 0x65A3, 0x94D4, 0x65A4, 0xBDEF, 0x65A5, 0xB3E2, 0x65A6, 0x94D5, 0x65A7, 0xB8AB, 0x65A8, 0x94D6, 0x65A9, 0xD5B6, 0x65AA, 0x94D7, + 0x65AB, 0xEDBD, 0x65AC, 0x94D8, 0x65AD, 0xB6CF, 0x65AE, 0x94D9, 0x65AF, 0xCBB9, 0x65B0, 0xD0C2, 0x65B1, 0x94DA, 0x65B2, 0x94DB, + 0x65B3, 0x94DC, 0x65B4, 0x94DD, 0x65B5, 0x94DE, 0x65B6, 0x94DF, 0x65B7, 0x94E0, 0x65B8, 0x94E1, 0x65B9, 0xB7BD, 0x65BA, 0x94E2, + 0x65BB, 0x94E3, 0x65BC, 0xECB6, 0x65BD, 0xCAA9, 0x65BE, 0x94E4, 0x65BF, 0x94E5, 0x65C0, 0x94E6, 0x65C1, 0xC5D4, 0x65C2, 0x94E7, + 0x65C3, 0xECB9, 0x65C4, 0xECB8, 0x65C5, 0xC2C3, 0x65C6, 0xECB7, 0x65C7, 0x94E8, 0x65C8, 0x94E9, 0x65C9, 0x94EA, 0x65CA, 0x94EB, + 0x65CB, 0xD0FD, 0x65CC, 0xECBA, 0x65CD, 0x94EC, 0x65CE, 0xECBB, 0x65CF, 0xD7E5, 0x65D0, 0x94ED, 0x65D1, 0x94EE, 0x65D2, 0xECBC, + 0x65D3, 0x94EF, 0x65D4, 0x94F0, 0x65D5, 0x94F1, 0x65D6, 0xECBD, 0x65D7, 0xC6EC, 0x65D8, 0x94F2, 0x65D9, 0x94F3, 0x65DA, 0x94F4, + 0x65DB, 0x94F5, 0x65DC, 0x94F6, 0x65DD, 0x94F7, 0x65DE, 0x94F8, 0x65DF, 0x94F9, 0x65E0, 0xCEDE, 0x65E1, 0x94FA, 0x65E2, 0xBCC8, + 0x65E3, 0x94FB, 0x65E4, 0x94FC, 0x65E5, 0xC8D5, 0x65E6, 0xB5A9, 0x65E7, 0xBEC9, 0x65E8, 0xD6BC, 0x65E9, 0xD4E7, 0x65EA, 0x94FD, + 0x65EB, 0x94FE, 0x65EC, 0xD1AE, 0x65ED, 0xD0F1, 0x65EE, 0xEAB8, 0x65EF, 0xEAB9, 0x65F0, 0xEABA, 0x65F1, 0xBAB5, 0x65F2, 0x9540, + 0x65F3, 0x9541, 0x65F4, 0x9542, 0x65F5, 0x9543, 0x65F6, 0xCAB1, 0x65F7, 0xBFF5, 0x65F8, 0x9544, 0x65F9, 0x9545, 0x65FA, 0xCDFA, + 0x65FB, 0x9546, 0x65FC, 0x9547, 0x65FD, 0x9548, 0x65FE, 0x9549, 0x65FF, 0x954A, 0x6600, 0xEAC0, 0x6601, 0x954B, 0x6602, 0xB0BA, + 0x6603, 0xEABE, 0x6604, 0x954C, 0x6605, 0x954D, 0x6606, 0xC0A5, 0x6607, 0x954E, 0x6608, 0x954F, 0x6609, 0x9550, 0x660A, 0xEABB, + 0x660B, 0x9551, 0x660C, 0xB2FD, 0x660D, 0x9552, 0x660E, 0xC3F7, 0x660F, 0xBBE8, 0x6610, 0x9553, 0x6611, 0x9554, 0x6612, 0x9555, + 0x6613, 0xD2D7, 0x6614, 0xCEF4, 0x6615, 0xEABF, 0x6616, 0x9556, 0x6617, 0x9557, 0x6618, 0x9558, 0x6619, 0xEABC, 0x661A, 0x9559, + 0x661B, 0x955A, 0x661C, 0x955B, 0x661D, 0xEAC3, 0x661E, 0x955C, 0x661F, 0xD0C7, 0x6620, 0xD3B3, 0x6621, 0x955D, 0x6622, 0x955E, + 0x6623, 0x955F, 0x6624, 0x9560, 0x6625, 0xB4BA, 0x6626, 0x9561, 0x6627, 0xC3C1, 0x6628, 0xD7F2, 0x6629, 0x9562, 0x662A, 0x9563, + 0x662B, 0x9564, 0x662C, 0x9565, 0x662D, 0xD5D1, 0x662E, 0x9566, 0x662F, 0xCAC7, 0x6630, 0x9567, 0x6631, 0xEAC5, 0x6632, 0x9568, + 0x6633, 0x9569, 0x6634, 0xEAC4, 0x6635, 0xEAC7, 0x6636, 0xEAC6, 0x6637, 0x956A, 0x6638, 0x956B, 0x6639, 0x956C, 0x663A, 0x956D, + 0x663B, 0x956E, 0x663C, 0xD6E7, 0x663D, 0x956F, 0x663E, 0xCFD4, 0x663F, 0x9570, 0x6640, 0x9571, 0x6641, 0xEACB, 0x6642, 0x9572, + 0x6643, 0xBBCE, 0x6644, 0x9573, 0x6645, 0x9574, 0x6646, 0x9575, 0x6647, 0x9576, 0x6648, 0x9577, 0x6649, 0x9578, 0x664A, 0x9579, + 0x664B, 0xBDFA, 0x664C, 0xC9CE, 0x664D, 0x957A, 0x664E, 0x957B, 0x664F, 0xEACC, 0x6650, 0x957C, 0x6651, 0x957D, 0x6652, 0xC9B9, + 0x6653, 0xCFFE, 0x6654, 0xEACA, 0x6655, 0xD4CE, 0x6656, 0xEACD, 0x6657, 0xEACF, 0x6658, 0x957E, 0x6659, 0x9580, 0x665A, 0xCDED, + 0x665B, 0x9581, 0x665C, 0x9582, 0x665D, 0x9583, 0x665E, 0x9584, 0x665F, 0xEAC9, 0x6660, 0x9585, 0x6661, 0xEACE, 0x6662, 0x9586, + 0x6663, 0x9587, 0x6664, 0xCEEE, 0x6665, 0x9588, 0x6666, 0xBBDE, 0x6667, 0x9589, 0x6668, 0xB3BF, 0x6669, 0x958A, 0x666A, 0x958B, + 0x666B, 0x958C, 0x666C, 0x958D, 0x666D, 0x958E, 0x666E, 0xC6D5, 0x666F, 0xBEB0, 0x6670, 0xCEFA, 0x6671, 0x958F, 0x6672, 0x9590, + 0x6673, 0x9591, 0x6674, 0xC7E7, 0x6675, 0x9592, 0x6676, 0xBEA7, 0x6677, 0xEAD0, 0x6678, 0x9593, 0x6679, 0x9594, 0x667A, 0xD6C7, + 0x667B, 0x9595, 0x667C, 0x9596, 0x667D, 0x9597, 0x667E, 0xC1C0, 0x667F, 0x9598, 0x6680, 0x9599, 0x6681, 0x959A, 0x6682, 0xD4DD, + 0x6683, 0x959B, 0x6684, 0xEAD1, 0x6685, 0x959C, 0x6686, 0x959D, 0x6687, 0xCFBE, 0x6688, 0x959E, 0x6689, 0x959F, 0x668A, 0x95A0, + 0x668B, 0x95A1, 0x668C, 0xEAD2, 0x668D, 0x95A2, 0x668E, 0x95A3, 0x668F, 0x95A4, 0x6690, 0x95A5, 0x6691, 0xCAEE, 0x6692, 0x95A6, + 0x6693, 0x95A7, 0x6694, 0x95A8, 0x6695, 0x95A9, 0x6696, 0xC5AF, 0x6697, 0xB0B5, 0x6698, 0x95AA, 0x6699, 0x95AB, 0x669A, 0x95AC, + 0x669B, 0x95AD, 0x669C, 0x95AE, 0x669D, 0xEAD4, 0x669E, 0x95AF, 0x669F, 0x95B0, 0x66A0, 0x95B1, 0x66A1, 0x95B2, 0x66A2, 0x95B3, + 0x66A3, 0x95B4, 0x66A4, 0x95B5, 0x66A5, 0x95B6, 0x66A6, 0x95B7, 0x66A7, 0xEAD3, 0x66A8, 0xF4DF, 0x66A9, 0x95B8, 0x66AA, 0x95B9, + 0x66AB, 0x95BA, 0x66AC, 0x95BB, 0x66AD, 0x95BC, 0x66AE, 0xC4BA, 0x66AF, 0x95BD, 0x66B0, 0x95BE, 0x66B1, 0x95BF, 0x66B2, 0x95C0, + 0x66B3, 0x95C1, 0x66B4, 0xB1A9, 0x66B5, 0x95C2, 0x66B6, 0x95C3, 0x66B7, 0x95C4, 0x66B8, 0x95C5, 0x66B9, 0xE5DF, 0x66BA, 0x95C6, + 0x66BB, 0x95C7, 0x66BC, 0x95C8, 0x66BD, 0x95C9, 0x66BE, 0xEAD5, 0x66BF, 0x95CA, 0x66C0, 0x95CB, 0x66C1, 0x95CC, 0x66C2, 0x95CD, + 0x66C3, 0x95CE, 0x66C4, 0x95CF, 0x66C5, 0x95D0, 0x66C6, 0x95D1, 0x66C7, 0x95D2, 0x66C8, 0x95D3, 0x66C9, 0x95D4, 0x66CA, 0x95D5, + 0x66CB, 0x95D6, 0x66CC, 0x95D7, 0x66CD, 0x95D8, 0x66CE, 0x95D9, 0x66CF, 0x95DA, 0x66D0, 0x95DB, 0x66D1, 0x95DC, 0x66D2, 0x95DD, + 0x66D3, 0x95DE, 0x66D4, 0x95DF, 0x66D5, 0x95E0, 0x66D6, 0x95E1, 0x66D7, 0x95E2, 0x66D8, 0x95E3, 0x66D9, 0xCAEF, 0x66DA, 0x95E4, + 0x66DB, 0xEAD6, 0x66DC, 0xEAD7, 0x66DD, 0xC6D8, 0x66DE, 0x95E5, 0x66DF, 0x95E6, 0x66E0, 0x95E7, 0x66E1, 0x95E8, 0x66E2, 0x95E9, + 0x66E3, 0x95EA, 0x66E4, 0x95EB, 0x66E5, 0x95EC, 0x66E6, 0xEAD8, 0x66E7, 0x95ED, 0x66E8, 0x95EE, 0x66E9, 0xEAD9, 0x66EA, 0x95EF, + 0x66EB, 0x95F0, 0x66EC, 0x95F1, 0x66ED, 0x95F2, 0x66EE, 0x95F3, 0x66EF, 0x95F4, 0x66F0, 0xD4BB, 0x66F1, 0x95F5, 0x66F2, 0xC7FA, + 0x66F3, 0xD2B7, 0x66F4, 0xB8FC, 0x66F5, 0x95F6, 0x66F6, 0x95F7, 0x66F7, 0xEAC2, 0x66F8, 0x95F8, 0x66F9, 0xB2DC, 0x66FA, 0x95F9, + 0x66FB, 0x95FA, 0x66FC, 0xC2FC, 0x66FD, 0x95FB, 0x66FE, 0xD4F8, 0x66FF, 0xCCE6, 0x6700, 0xD7EE, 0x6701, 0x95FC, 0x6702, 0x95FD, + 0x6703, 0x95FE, 0x6704, 0x9640, 0x6705, 0x9641, 0x6706, 0x9642, 0x6707, 0x9643, 0x6708, 0xD4C2, 0x6709, 0xD3D0, 0x670A, 0xEBC3, + 0x670B, 0xC5F3, 0x670C, 0x9644, 0x670D, 0xB7FE, 0x670E, 0x9645, 0x670F, 0x9646, 0x6710, 0xEBD4, 0x6711, 0x9647, 0x6712, 0x9648, + 0x6713, 0x9649, 0x6714, 0xCBB7, 0x6715, 0xEBDE, 0x6716, 0x964A, 0x6717, 0xC0CA, 0x6718, 0x964B, 0x6719, 0x964C, 0x671A, 0x964D, + 0x671B, 0xCDFB, 0x671C, 0x964E, 0x671D, 0xB3AF, 0x671E, 0x964F, 0x671F, 0xC6DA, 0x6720, 0x9650, 0x6721, 0x9651, 0x6722, 0x9652, + 0x6723, 0x9653, 0x6724, 0x9654, 0x6725, 0x9655, 0x6726, 0xEBFC, 0x6727, 0x9656, 0x6728, 0xC4BE, 0x6729, 0x9657, 0x672A, 0xCEB4, + 0x672B, 0xC4A9, 0x672C, 0xB1BE, 0x672D, 0xD4FD, 0x672E, 0x9658, 0x672F, 0xCAF5, 0x6730, 0x9659, 0x6731, 0xD6EC, 0x6732, 0x965A, + 0x6733, 0x965B, 0x6734, 0xC6D3, 0x6735, 0xB6E4, 0x6736, 0x965C, 0x6737, 0x965D, 0x6738, 0x965E, 0x6739, 0x965F, 0x673A, 0xBBFA, + 0x673B, 0x9660, 0x673C, 0x9661, 0x673D, 0xD0E0, 0x673E, 0x9662, 0x673F, 0x9663, 0x6740, 0xC9B1, 0x6741, 0x9664, 0x6742, 0xD4D3, + 0x6743, 0xC8A8, 0x6744, 0x9665, 0x6745, 0x9666, 0x6746, 0xB8CB, 0x6747, 0x9667, 0x6748, 0xE8BE, 0x6749, 0xC9BC, 0x674A, 0x9668, + 0x674B, 0x9669, 0x674C, 0xE8BB, 0x674D, 0x966A, 0x674E, 0xC0EE, 0x674F, 0xD0D3, 0x6750, 0xB2C4, 0x6751, 0xB4E5, 0x6752, 0x966B, + 0x6753, 0xE8BC, 0x6754, 0x966C, 0x6755, 0x966D, 0x6756, 0xD5C8, 0x6757, 0x966E, 0x6758, 0x966F, 0x6759, 0x9670, 0x675A, 0x9671, + 0x675B, 0x9672, 0x675C, 0xB6C5, 0x675D, 0x9673, 0x675E, 0xE8BD, 0x675F, 0xCAF8, 0x6760, 0xB8DC, 0x6761, 0xCCF5, 0x6762, 0x9674, + 0x6763, 0x9675, 0x6764, 0x9676, 0x6765, 0xC0B4, 0x6766, 0x9677, 0x6767, 0x9678, 0x6768, 0xD1EE, 0x6769, 0xE8BF, 0x676A, 0xE8C2, + 0x676B, 0x9679, 0x676C, 0x967A, 0x676D, 0xBABC, 0x676E, 0x967B, 0x676F, 0xB1AD, 0x6770, 0xBDDC, 0x6771, 0x967C, 0x6772, 0xEABD, + 0x6773, 0xE8C3, 0x6774, 0x967D, 0x6775, 0xE8C6, 0x6776, 0x967E, 0x6777, 0xE8CB, 0x6778, 0x9680, 0x6779, 0x9681, 0x677A, 0x9682, + 0x677B, 0x9683, 0x677C, 0xE8CC, 0x677D, 0x9684, 0x677E, 0xCBC9, 0x677F, 0xB0E5, 0x6780, 0x9685, 0x6781, 0xBCAB, 0x6782, 0x9686, + 0x6783, 0x9687, 0x6784, 0xB9B9, 0x6785, 0x9688, 0x6786, 0x9689, 0x6787, 0xE8C1, 0x6788, 0x968A, 0x6789, 0xCDF7, 0x678A, 0x968B, + 0x678B, 0xE8CA, 0x678C, 0x968C, 0x678D, 0x968D, 0x678E, 0x968E, 0x678F, 0x968F, 0x6790, 0xCEF6, 0x6791, 0x9690, 0x6792, 0x9691, + 0x6793, 0x9692, 0x6794, 0x9693, 0x6795, 0xD5ED, 0x6796, 0x9694, 0x6797, 0xC1D6, 0x6798, 0xE8C4, 0x6799, 0x9695, 0x679A, 0xC3B6, + 0x679B, 0x9696, 0x679C, 0xB9FB, 0x679D, 0xD6A6, 0x679E, 0xE8C8, 0x679F, 0x9697, 0x67A0, 0x9698, 0x67A1, 0x9699, 0x67A2, 0xCAE0, + 0x67A3, 0xD4E6, 0x67A4, 0x969A, 0x67A5, 0xE8C0, 0x67A6, 0x969B, 0x67A7, 0xE8C5, 0x67A8, 0xE8C7, 0x67A9, 0x969C, 0x67AA, 0xC7B9, + 0x67AB, 0xB7E3, 0x67AC, 0x969D, 0x67AD, 0xE8C9, 0x67AE, 0x969E, 0x67AF, 0xBFDD, 0x67B0, 0xE8D2, 0x67B1, 0x969F, 0x67B2, 0x96A0, + 0x67B3, 0xE8D7, 0x67B4, 0x96A1, 0x67B5, 0xE8D5, 0x67B6, 0xBCDC, 0x67B7, 0xBCCF, 0x67B8, 0xE8DB, 0x67B9, 0x96A2, 0x67BA, 0x96A3, + 0x67BB, 0x96A4, 0x67BC, 0x96A5, 0x67BD, 0x96A6, 0x67BE, 0x96A7, 0x67BF, 0x96A8, 0x67C0, 0x96A9, 0x67C1, 0xE8DE, 0x67C2, 0x96AA, + 0x67C3, 0xE8DA, 0x67C4, 0xB1FA, 0x67C5, 0x96AB, 0x67C6, 0x96AC, 0x67C7, 0x96AD, 0x67C8, 0x96AE, 0x67C9, 0x96AF, 0x67CA, 0x96B0, + 0x67CB, 0x96B1, 0x67CC, 0x96B2, 0x67CD, 0x96B3, 0x67CE, 0x96B4, 0x67CF, 0xB0D8, 0x67D0, 0xC4B3, 0x67D1, 0xB8CC, 0x67D2, 0xC6E2, + 0x67D3, 0xC8BE, 0x67D4, 0xC8E1, 0x67D5, 0x96B5, 0x67D6, 0x96B6, 0x67D7, 0x96B7, 0x67D8, 0xE8CF, 0x67D9, 0xE8D4, 0x67DA, 0xE8D6, + 0x67DB, 0x96B8, 0x67DC, 0xB9F1, 0x67DD, 0xE8D8, 0x67DE, 0xD7F5, 0x67DF, 0x96B9, 0x67E0, 0xC4FB, 0x67E1, 0x96BA, 0x67E2, 0xE8DC, + 0x67E3, 0x96BB, 0x67E4, 0x96BC, 0x67E5, 0xB2E9, 0x67E6, 0x96BD, 0x67E7, 0x96BE, 0x67E8, 0x96BF, 0x67E9, 0xE8D1, 0x67EA, 0x96C0, + 0x67EB, 0x96C1, 0x67EC, 0xBCED, 0x67ED, 0x96C2, 0x67EE, 0x96C3, 0x67EF, 0xBFC2, 0x67F0, 0xE8CD, 0x67F1, 0xD6F9, 0x67F2, 0x96C4, + 0x67F3, 0xC1F8, 0x67F4, 0xB2F1, 0x67F5, 0x96C5, 0x67F6, 0x96C6, 0x67F7, 0x96C7, 0x67F8, 0x96C8, 0x67F9, 0x96C9, 0x67FA, 0x96CA, + 0x67FB, 0x96CB, 0x67FC, 0x96CC, 0x67FD, 0xE8DF, 0x67FE, 0x96CD, 0x67FF, 0xCAC1, 0x6800, 0xE8D9, 0x6801, 0x96CE, 0x6802, 0x96CF, + 0x6803, 0x96D0, 0x6804, 0x96D1, 0x6805, 0xD5A4, 0x6806, 0x96D2, 0x6807, 0xB1EA, 0x6808, 0xD5BB, 0x6809, 0xE8CE, 0x680A, 0xE8D0, + 0x680B, 0xB6B0, 0x680C, 0xE8D3, 0x680D, 0x96D3, 0x680E, 0xE8DD, 0x680F, 0xC0B8, 0x6810, 0x96D4, 0x6811, 0xCAF7, 0x6812, 0x96D5, + 0x6813, 0xCBA8, 0x6814, 0x96D6, 0x6815, 0x96D7, 0x6816, 0xC6DC, 0x6817, 0xC0F5, 0x6818, 0x96D8, 0x6819, 0x96D9, 0x681A, 0x96DA, + 0x681B, 0x96DB, 0x681C, 0x96DC, 0x681D, 0xE8E9, 0x681E, 0x96DD, 0x681F, 0x96DE, 0x6820, 0x96DF, 0x6821, 0xD0A3, 0x6822, 0x96E0, + 0x6823, 0x96E1, 0x6824, 0x96E2, 0x6825, 0x96E3, 0x6826, 0x96E4, 0x6827, 0x96E5, 0x6828, 0x96E6, 0x6829, 0xE8F2, 0x682A, 0xD6EA, + 0x682B, 0x96E7, 0x682C, 0x96E8, 0x682D, 0x96E9, 0x682E, 0x96EA, 0x682F, 0x96EB, 0x6830, 0x96EC, 0x6831, 0x96ED, 0x6832, 0xE8E0, + 0x6833, 0xE8E1, 0x6834, 0x96EE, 0x6835, 0x96EF, 0x6836, 0x96F0, 0x6837, 0xD1F9, 0x6838, 0xBACB, 0x6839, 0xB8F9, 0x683A, 0x96F1, + 0x683B, 0x96F2, 0x683C, 0xB8F1, 0x683D, 0xD4D4, 0x683E, 0xE8EF, 0x683F, 0x96F3, 0x6840, 0xE8EE, 0x6841, 0xE8EC, 0x6842, 0xB9F0, + 0x6843, 0xCCD2, 0x6844, 0xE8E6, 0x6845, 0xCEA6, 0x6846, 0xBFF2, 0x6847, 0x96F4, 0x6848, 0xB0B8, 0x6849, 0xE8F1, 0x684A, 0xE8F0, + 0x684B, 0x96F5, 0x684C, 0xD7C0, 0x684D, 0x96F6, 0x684E, 0xE8E4, 0x684F, 0x96F7, 0x6850, 0xCDA9, 0x6851, 0xC9A3, 0x6852, 0x96F8, + 0x6853, 0xBBB8, 0x6854, 0xBDDB, 0x6855, 0xE8EA, 0x6856, 0x96F9, 0x6857, 0x96FA, 0x6858, 0x96FB, 0x6859, 0x96FC, 0x685A, 0x96FD, + 0x685B, 0x96FE, 0x685C, 0x9740, 0x685D, 0x9741, 0x685E, 0x9742, 0x685F, 0x9743, 0x6860, 0xE8E2, 0x6861, 0xE8E3, 0x6862, 0xE8E5, + 0x6863, 0xB5B5, 0x6864, 0xE8E7, 0x6865, 0xC7C5, 0x6866, 0xE8EB, 0x6867, 0xE8ED, 0x6868, 0xBDB0, 0x6869, 0xD7AE, 0x686A, 0x9744, + 0x686B, 0xE8F8, 0x686C, 0x9745, 0x686D, 0x9746, 0x686E, 0x9747, 0x686F, 0x9748, 0x6870, 0x9749, 0x6871, 0x974A, 0x6872, 0x974B, + 0x6873, 0x974C, 0x6874, 0xE8F5, 0x6875, 0x974D, 0x6876, 0xCDB0, 0x6877, 0xE8F6, 0x6878, 0x974E, 0x6879, 0x974F, 0x687A, 0x9750, + 0x687B, 0x9751, 0x687C, 0x9752, 0x687D, 0x9753, 0x687E, 0x9754, 0x687F, 0x9755, 0x6880, 0x9756, 0x6881, 0xC1BA, 0x6882, 0x9757, + 0x6883, 0xE8E8, 0x6884, 0x9758, 0x6885, 0xC3B7, 0x6886, 0xB0F0, 0x6887, 0x9759, 0x6888, 0x975A, 0x6889, 0x975B, 0x688A, 0x975C, + 0x688B, 0x975D, 0x688C, 0x975E, 0x688D, 0x975F, 0x688E, 0x9760, 0x688F, 0xE8F4, 0x6890, 0x9761, 0x6891, 0x9762, 0x6892, 0x9763, + 0x6893, 0xE8F7, 0x6894, 0x9764, 0x6895, 0x9765, 0x6896, 0x9766, 0x6897, 0xB9A3, 0x6898, 0x9767, 0x6899, 0x9768, 0x689A, 0x9769, + 0x689B, 0x976A, 0x689C, 0x976B, 0x689D, 0x976C, 0x689E, 0x976D, 0x689F, 0x976E, 0x68A0, 0x976F, 0x68A1, 0x9770, 0x68A2, 0xC9D2, + 0x68A3, 0x9771, 0x68A4, 0x9772, 0x68A5, 0x9773, 0x68A6, 0xC3CE, 0x68A7, 0xCEE0, 0x68A8, 0xC0E6, 0x68A9, 0x9774, 0x68AA, 0x9775, + 0x68AB, 0x9776, 0x68AC, 0x9777, 0x68AD, 0xCBF3, 0x68AE, 0x9778, 0x68AF, 0xCCDD, 0x68B0, 0xD0B5, 0x68B1, 0x9779, 0x68B2, 0x977A, + 0x68B3, 0xCAE1, 0x68B4, 0x977B, 0x68B5, 0xE8F3, 0x68B6, 0x977C, 0x68B7, 0x977D, 0x68B8, 0x977E, 0x68B9, 0x9780, 0x68BA, 0x9781, + 0x68BB, 0x9782, 0x68BC, 0x9783, 0x68BD, 0x9784, 0x68BE, 0x9785, 0x68BF, 0x9786, 0x68C0, 0xBCEC, 0x68C1, 0x9787, 0x68C2, 0xE8F9, + 0x68C3, 0x9788, 0x68C4, 0x9789, 0x68C5, 0x978A, 0x68C6, 0x978B, 0x68C7, 0x978C, 0x68C8, 0x978D, 0x68C9, 0xC3DE, 0x68CA, 0x978E, + 0x68CB, 0xC6E5, 0x68CC, 0x978F, 0x68CD, 0xB9F7, 0x68CE, 0x9790, 0x68CF, 0x9791, 0x68D0, 0x9792, 0x68D1, 0x9793, 0x68D2, 0xB0F4, + 0x68D3, 0x9794, 0x68D4, 0x9795, 0x68D5, 0xD7D8, 0x68D6, 0x9796, 0x68D7, 0x9797, 0x68D8, 0xBCAC, 0x68D9, 0x9798, 0x68DA, 0xC5EF, + 0x68DB, 0x9799, 0x68DC, 0x979A, 0x68DD, 0x979B, 0x68DE, 0x979C, 0x68DF, 0x979D, 0x68E0, 0xCCC4, 0x68E1, 0x979E, 0x68E2, 0x979F, + 0x68E3, 0xE9A6, 0x68E4, 0x97A0, 0x68E5, 0x97A1, 0x68E6, 0x97A2, 0x68E7, 0x97A3, 0x68E8, 0x97A4, 0x68E9, 0x97A5, 0x68EA, 0x97A6, + 0x68EB, 0x97A7, 0x68EC, 0x97A8, 0x68ED, 0x97A9, 0x68EE, 0xC9AD, 0x68EF, 0x97AA, 0x68F0, 0xE9A2, 0x68F1, 0xC0E2, 0x68F2, 0x97AB, + 0x68F3, 0x97AC, 0x68F4, 0x97AD, 0x68F5, 0xBFC3, 0x68F6, 0x97AE, 0x68F7, 0x97AF, 0x68F8, 0x97B0, 0x68F9, 0xE8FE, 0x68FA, 0xB9D7, + 0x68FB, 0x97B1, 0x68FC, 0xE8FB, 0x68FD, 0x97B2, 0x68FE, 0x97B3, 0x68FF, 0x97B4, 0x6900, 0x97B5, 0x6901, 0xE9A4, 0x6902, 0x97B6, + 0x6903, 0x97B7, 0x6904, 0x97B8, 0x6905, 0xD2CE, 0x6906, 0x97B9, 0x6907, 0x97BA, 0x6908, 0x97BB, 0x6909, 0x97BC, 0x690A, 0x97BD, + 0x690B, 0xE9A3, 0x690C, 0x97BE, 0x690D, 0xD6B2, 0x690E, 0xD7B5, 0x690F, 0x97BF, 0x6910, 0xE9A7, 0x6911, 0x97C0, 0x6912, 0xBDB7, + 0x6913, 0x97C1, 0x6914, 0x97C2, 0x6915, 0x97C3, 0x6916, 0x97C4, 0x6917, 0x97C5, 0x6918, 0x97C6, 0x6919, 0x97C7, 0x691A, 0x97C8, + 0x691B, 0x97C9, 0x691C, 0x97CA, 0x691D, 0x97CB, 0x691E, 0x97CC, 0x691F, 0xE8FC, 0x6920, 0xE8FD, 0x6921, 0x97CD, 0x6922, 0x97CE, + 0x6923, 0x97CF, 0x6924, 0xE9A1, 0x6925, 0x97D0, 0x6926, 0x97D1, 0x6927, 0x97D2, 0x6928, 0x97D3, 0x6929, 0x97D4, 0x692A, 0x97D5, + 0x692B, 0x97D6, 0x692C, 0x97D7, 0x692D, 0xCDD6, 0x692E, 0x97D8, 0x692F, 0x97D9, 0x6930, 0xD2AC, 0x6931, 0x97DA, 0x6932, 0x97DB, + 0x6933, 0x97DC, 0x6934, 0xE9B2, 0x6935, 0x97DD, 0x6936, 0x97DE, 0x6937, 0x97DF, 0x6938, 0x97E0, 0x6939, 0xE9A9, 0x693A, 0x97E1, + 0x693B, 0x97E2, 0x693C, 0x97E3, 0x693D, 0xB4AA, 0x693E, 0x97E4, 0x693F, 0xB4BB, 0x6940, 0x97E5, 0x6941, 0x97E6, 0x6942, 0xE9AB, + 0x6943, 0x97E7, 0x6944, 0x97E8, 0x6945, 0x97E9, 0x6946, 0x97EA, 0x6947, 0x97EB, 0x6948, 0x97EC, 0x6949, 0x97ED, 0x694A, 0x97EE, + 0x694B, 0x97EF, 0x694C, 0x97F0, 0x694D, 0x97F1, 0x694E, 0x97F2, 0x694F, 0x97F3, 0x6950, 0x97F4, 0x6951, 0x97F5, 0x6952, 0x97F6, + 0x6953, 0x97F7, 0x6954, 0xD0A8, 0x6955, 0x97F8, 0x6956, 0x97F9, 0x6957, 0xE9A5, 0x6958, 0x97FA, 0x6959, 0x97FB, 0x695A, 0xB3FE, + 0x695B, 0x97FC, 0x695C, 0x97FD, 0x695D, 0xE9AC, 0x695E, 0xC0E3, 0x695F, 0x97FE, 0x6960, 0xE9AA, 0x6961, 0x9840, 0x6962, 0x9841, + 0x6963, 0xE9B9, 0x6964, 0x9842, 0x6965, 0x9843, 0x6966, 0xE9B8, 0x6967, 0x9844, 0x6968, 0x9845, 0x6969, 0x9846, 0x696A, 0x9847, + 0x696B, 0xE9AE, 0x696C, 0x9848, 0x696D, 0x9849, 0x696E, 0xE8FA, 0x696F, 0x984A, 0x6970, 0x984B, 0x6971, 0xE9A8, 0x6972, 0x984C, + 0x6973, 0x984D, 0x6974, 0x984E, 0x6975, 0x984F, 0x6976, 0x9850, 0x6977, 0xBFAC, 0x6978, 0xE9B1, 0x6979, 0xE9BA, 0x697A, 0x9851, + 0x697B, 0x9852, 0x697C, 0xC2A5, 0x697D, 0x9853, 0x697E, 0x9854, 0x697F, 0x9855, 0x6980, 0xE9AF, 0x6981, 0x9856, 0x6982, 0xB8C5, + 0x6983, 0x9857, 0x6984, 0xE9AD, 0x6985, 0x9858, 0x6986, 0xD3DC, 0x6987, 0xE9B4, 0x6988, 0xE9B5, 0x6989, 0xE9B7, 0x698A, 0x9859, + 0x698B, 0x985A, 0x698C, 0x985B, 0x698D, 0xE9C7, 0x698E, 0x985C, 0x698F, 0x985D, 0x6990, 0x985E, 0x6991, 0x985F, 0x6992, 0x9860, + 0x6993, 0x9861, 0x6994, 0xC0C6, 0x6995, 0xE9C5, 0x6996, 0x9862, 0x6997, 0x9863, 0x6998, 0xE9B0, 0x6999, 0x9864, 0x699A, 0x9865, + 0x699B, 0xE9BB, 0x699C, 0xB0F1, 0x699D, 0x9866, 0x699E, 0x9867, 0x699F, 0x9868, 0x69A0, 0x9869, 0x69A1, 0x986A, 0x69A2, 0x986B, + 0x69A3, 0x986C, 0x69A4, 0x986D, 0x69A5, 0x986E, 0x69A6, 0x986F, 0x69A7, 0xE9BC, 0x69A8, 0xD5A5, 0x69A9, 0x9870, 0x69AA, 0x9871, + 0x69AB, 0xE9BE, 0x69AC, 0x9872, 0x69AD, 0xE9BF, 0x69AE, 0x9873, 0x69AF, 0x9874, 0x69B0, 0x9875, 0x69B1, 0xE9C1, 0x69B2, 0x9876, + 0x69B3, 0x9877, 0x69B4, 0xC1F1, 0x69B5, 0x9878, 0x69B6, 0x9879, 0x69B7, 0xC8B6, 0x69B8, 0x987A, 0x69B9, 0x987B, 0x69BA, 0x987C, + 0x69BB, 0xE9BD, 0x69BC, 0x987D, 0x69BD, 0x987E, 0x69BE, 0x9880, 0x69BF, 0x9881, 0x69C0, 0x9882, 0x69C1, 0xE9C2, 0x69C2, 0x9883, + 0x69C3, 0x9884, 0x69C4, 0x9885, 0x69C5, 0x9886, 0x69C6, 0x9887, 0x69C7, 0x9888, 0x69C8, 0x9889, 0x69C9, 0x988A, 0x69CA, 0xE9C3, + 0x69CB, 0x988B, 0x69CC, 0xE9B3, 0x69CD, 0x988C, 0x69CE, 0xE9B6, 0x69CF, 0x988D, 0x69D0, 0xBBB1, 0x69D1, 0x988E, 0x69D2, 0x988F, + 0x69D3, 0x9890, 0x69D4, 0xE9C0, 0x69D5, 0x9891, 0x69D6, 0x9892, 0x69D7, 0x9893, 0x69D8, 0x9894, 0x69D9, 0x9895, 0x69DA, 0x9896, + 0x69DB, 0xBCF7, 0x69DC, 0x9897, 0x69DD, 0x9898, 0x69DE, 0x9899, 0x69DF, 0xE9C4, 0x69E0, 0xE9C6, 0x69E1, 0x989A, 0x69E2, 0x989B, + 0x69E3, 0x989C, 0x69E4, 0x989D, 0x69E5, 0x989E, 0x69E6, 0x989F, 0x69E7, 0x98A0, 0x69E8, 0x98A1, 0x69E9, 0x98A2, 0x69EA, 0x98A3, + 0x69EB, 0x98A4, 0x69EC, 0x98A5, 0x69ED, 0xE9CA, 0x69EE, 0x98A6, 0x69EF, 0x98A7, 0x69F0, 0x98A8, 0x69F1, 0x98A9, 0x69F2, 0xE9CE, + 0x69F3, 0x98AA, 0x69F4, 0x98AB, 0x69F5, 0x98AC, 0x69F6, 0x98AD, 0x69F7, 0x98AE, 0x69F8, 0x98AF, 0x69F9, 0x98B0, 0x69FA, 0x98B1, + 0x69FB, 0x98B2, 0x69FC, 0x98B3, 0x69FD, 0xB2DB, 0x69FE, 0x98B4, 0x69FF, 0xE9C8, 0x6A00, 0x98B5, 0x6A01, 0x98B6, 0x6A02, 0x98B7, + 0x6A03, 0x98B8, 0x6A04, 0x98B9, 0x6A05, 0x98BA, 0x6A06, 0x98BB, 0x6A07, 0x98BC, 0x6A08, 0x98BD, 0x6A09, 0x98BE, 0x6A0A, 0xB7AE, + 0x6A0B, 0x98BF, 0x6A0C, 0x98C0, 0x6A0D, 0x98C1, 0x6A0E, 0x98C2, 0x6A0F, 0x98C3, 0x6A10, 0x98C4, 0x6A11, 0x98C5, 0x6A12, 0x98C6, + 0x6A13, 0x98C7, 0x6A14, 0x98C8, 0x6A15, 0x98C9, 0x6A16, 0x98CA, 0x6A17, 0xE9CB, 0x6A18, 0xE9CC, 0x6A19, 0x98CB, 0x6A1A, 0x98CC, + 0x6A1B, 0x98CD, 0x6A1C, 0x98CE, 0x6A1D, 0x98CF, 0x6A1E, 0x98D0, 0x6A1F, 0xD5C1, 0x6A20, 0x98D1, 0x6A21, 0xC4A3, 0x6A22, 0x98D2, + 0x6A23, 0x98D3, 0x6A24, 0x98D4, 0x6A25, 0x98D5, 0x6A26, 0x98D6, 0x6A27, 0x98D7, 0x6A28, 0xE9D8, 0x6A29, 0x98D8, 0x6A2A, 0xBAE1, + 0x6A2B, 0x98D9, 0x6A2C, 0x98DA, 0x6A2D, 0x98DB, 0x6A2E, 0x98DC, 0x6A2F, 0xE9C9, 0x6A30, 0x98DD, 0x6A31, 0xD3A3, 0x6A32, 0x98DE, + 0x6A33, 0x98DF, 0x6A34, 0x98E0, 0x6A35, 0xE9D4, 0x6A36, 0x98E1, 0x6A37, 0x98E2, 0x6A38, 0x98E3, 0x6A39, 0x98E4, 0x6A3A, 0x98E5, + 0x6A3B, 0x98E6, 0x6A3C, 0x98E7, 0x6A3D, 0xE9D7, 0x6A3E, 0xE9D0, 0x6A3F, 0x98E8, 0x6A40, 0x98E9, 0x6A41, 0x98EA, 0x6A42, 0x98EB, + 0x6A43, 0x98EC, 0x6A44, 0xE9CF, 0x6A45, 0x98ED, 0x6A46, 0x98EE, 0x6A47, 0xC7C1, 0x6A48, 0x98EF, 0x6A49, 0x98F0, 0x6A4A, 0x98F1, + 0x6A4B, 0x98F2, 0x6A4C, 0x98F3, 0x6A4D, 0x98F4, 0x6A4E, 0x98F5, 0x6A4F, 0x98F6, 0x6A50, 0xE9D2, 0x6A51, 0x98F7, 0x6A52, 0x98F8, + 0x6A53, 0x98F9, 0x6A54, 0x98FA, 0x6A55, 0x98FB, 0x6A56, 0x98FC, 0x6A57, 0x98FD, 0x6A58, 0xE9D9, 0x6A59, 0xB3C8, 0x6A5A, 0x98FE, + 0x6A5B, 0xE9D3, 0x6A5C, 0x9940, 0x6A5D, 0x9941, 0x6A5E, 0x9942, 0x6A5F, 0x9943, 0x6A60, 0x9944, 0x6A61, 0xCFF0, 0x6A62, 0x9945, + 0x6A63, 0x9946, 0x6A64, 0x9947, 0x6A65, 0xE9CD, 0x6A66, 0x9948, 0x6A67, 0x9949, 0x6A68, 0x994A, 0x6A69, 0x994B, 0x6A6A, 0x994C, + 0x6A6B, 0x994D, 0x6A6C, 0x994E, 0x6A6D, 0x994F, 0x6A6E, 0x9950, 0x6A6F, 0x9951, 0x6A70, 0x9952, 0x6A71, 0xB3F7, 0x6A72, 0x9953, + 0x6A73, 0x9954, 0x6A74, 0x9955, 0x6A75, 0x9956, 0x6A76, 0x9957, 0x6A77, 0x9958, 0x6A78, 0x9959, 0x6A79, 0xE9D6, 0x6A7A, 0x995A, + 0x6A7B, 0x995B, 0x6A7C, 0xE9DA, 0x6A7D, 0x995C, 0x6A7E, 0x995D, 0x6A7F, 0x995E, 0x6A80, 0xCCB4, 0x6A81, 0x995F, 0x6A82, 0x9960, + 0x6A83, 0x9961, 0x6A84, 0xCFAD, 0x6A85, 0x9962, 0x6A86, 0x9963, 0x6A87, 0x9964, 0x6A88, 0x9965, 0x6A89, 0x9966, 0x6A8A, 0x9967, + 0x6A8B, 0x9968, 0x6A8C, 0x9969, 0x6A8D, 0x996A, 0x6A8E, 0xE9D5, 0x6A8F, 0x996B, 0x6A90, 0xE9DC, 0x6A91, 0xE9DB, 0x6A92, 0x996C, + 0x6A93, 0x996D, 0x6A94, 0x996E, 0x6A95, 0x996F, 0x6A96, 0x9970, 0x6A97, 0xE9DE, 0x6A98, 0x9971, 0x6A99, 0x9972, 0x6A9A, 0x9973, + 0x6A9B, 0x9974, 0x6A9C, 0x9975, 0x6A9D, 0x9976, 0x6A9E, 0x9977, 0x6A9F, 0x9978, 0x6AA0, 0xE9D1, 0x6AA1, 0x9979, 0x6AA2, 0x997A, + 0x6AA3, 0x997B, 0x6AA4, 0x997C, 0x6AA5, 0x997D, 0x6AA6, 0x997E, 0x6AA7, 0x9980, 0x6AA8, 0x9981, 0x6AA9, 0xE9DD, 0x6AAA, 0x9982, + 0x6AAB, 0xE9DF, 0x6AAC, 0xC3CA, 0x6AAD, 0x9983, 0x6AAE, 0x9984, 0x6AAF, 0x9985, 0x6AB0, 0x9986, 0x6AB1, 0x9987, 0x6AB2, 0x9988, + 0x6AB3, 0x9989, 0x6AB4, 0x998A, 0x6AB5, 0x998B, 0x6AB6, 0x998C, 0x6AB7, 0x998D, 0x6AB8, 0x998E, 0x6AB9, 0x998F, 0x6ABA, 0x9990, + 0x6ABB, 0x9991, 0x6ABC, 0x9992, 0x6ABD, 0x9993, 0x6ABE, 0x9994, 0x6ABF, 0x9995, 0x6AC0, 0x9996, 0x6AC1, 0x9997, 0x6AC2, 0x9998, + 0x6AC3, 0x9999, 0x6AC4, 0x999A, 0x6AC5, 0x999B, 0x6AC6, 0x999C, 0x6AC7, 0x999D, 0x6AC8, 0x999E, 0x6AC9, 0x999F, 0x6ACA, 0x99A0, + 0x6ACB, 0x99A1, 0x6ACC, 0x99A2, 0x6ACD, 0x99A3, 0x6ACE, 0x99A4, 0x6ACF, 0x99A5, 0x6AD0, 0x99A6, 0x6AD1, 0x99A7, 0x6AD2, 0x99A8, + 0x6AD3, 0x99A9, 0x6AD4, 0x99AA, 0x6AD5, 0x99AB, 0x6AD6, 0x99AC, 0x6AD7, 0x99AD, 0x6AD8, 0x99AE, 0x6AD9, 0x99AF, 0x6ADA, 0x99B0, + 0x6ADB, 0x99B1, 0x6ADC, 0x99B2, 0x6ADD, 0x99B3, 0x6ADE, 0x99B4, 0x6ADF, 0x99B5, 0x6AE0, 0x99B6, 0x6AE1, 0x99B7, 0x6AE2, 0x99B8, + 0x6AE3, 0x99B9, 0x6AE4, 0x99BA, 0x6AE5, 0x99BB, 0x6AE6, 0x99BC, 0x6AE7, 0x99BD, 0x6AE8, 0x99BE, 0x6AE9, 0x99BF, 0x6AEA, 0x99C0, + 0x6AEB, 0x99C1, 0x6AEC, 0x99C2, 0x6AED, 0x99C3, 0x6AEE, 0x99C4, 0x6AEF, 0x99C5, 0x6AF0, 0x99C6, 0x6AF1, 0x99C7, 0x6AF2, 0x99C8, + 0x6AF3, 0x99C9, 0x6AF4, 0x99CA, 0x6AF5, 0x99CB, 0x6AF6, 0x99CC, 0x6AF7, 0x99CD, 0x6AF8, 0x99CE, 0x6AF9, 0x99CF, 0x6AFA, 0x99D0, + 0x6AFB, 0x99D1, 0x6AFC, 0x99D2, 0x6AFD, 0x99D3, 0x6AFE, 0x99D4, 0x6AFF, 0x99D5, 0x6B00, 0x99D6, 0x6B01, 0x99D7, 0x6B02, 0x99D8, + 0x6B03, 0x99D9, 0x6B04, 0x99DA, 0x6B05, 0x99DB, 0x6B06, 0x99DC, 0x6B07, 0x99DD, 0x6B08, 0x99DE, 0x6B09, 0x99DF, 0x6B0A, 0x99E0, + 0x6B0B, 0x99E1, 0x6B0C, 0x99E2, 0x6B0D, 0x99E3, 0x6B0E, 0x99E4, 0x6B0F, 0x99E5, 0x6B10, 0x99E6, 0x6B11, 0x99E7, 0x6B12, 0x99E8, + 0x6B13, 0x99E9, 0x6B14, 0x99EA, 0x6B15, 0x99EB, 0x6B16, 0x99EC, 0x6B17, 0x99ED, 0x6B18, 0x99EE, 0x6B19, 0x99EF, 0x6B1A, 0x99F0, + 0x6B1B, 0x99F1, 0x6B1C, 0x99F2, 0x6B1D, 0x99F3, 0x6B1E, 0x99F4, 0x6B1F, 0x99F5, 0x6B20, 0xC7B7, 0x6B21, 0xB4CE, 0x6B22, 0xBBB6, + 0x6B23, 0xD0C0, 0x6B24, 0xECA3, 0x6B25, 0x99F6, 0x6B26, 0x99F7, 0x6B27, 0xC5B7, 0x6B28, 0x99F8, 0x6B29, 0x99F9, 0x6B2A, 0x99FA, + 0x6B2B, 0x99FB, 0x6B2C, 0x99FC, 0x6B2D, 0x99FD, 0x6B2E, 0x99FE, 0x6B2F, 0x9A40, 0x6B30, 0x9A41, 0x6B31, 0x9A42, 0x6B32, 0xD3FB, + 0x6B33, 0x9A43, 0x6B34, 0x9A44, 0x6B35, 0x9A45, 0x6B36, 0x9A46, 0x6B37, 0xECA4, 0x6B38, 0x9A47, 0x6B39, 0xECA5, 0x6B3A, 0xC6DB, + 0x6B3B, 0x9A48, 0x6B3C, 0x9A49, 0x6B3D, 0x9A4A, 0x6B3E, 0xBFEE, 0x6B3F, 0x9A4B, 0x6B40, 0x9A4C, 0x6B41, 0x9A4D, 0x6B42, 0x9A4E, + 0x6B43, 0xECA6, 0x6B44, 0x9A4F, 0x6B45, 0x9A50, 0x6B46, 0xECA7, 0x6B47, 0xD0AA, 0x6B48, 0x9A51, 0x6B49, 0xC7B8, 0x6B4A, 0x9A52, + 0x6B4B, 0x9A53, 0x6B4C, 0xB8E8, 0x6B4D, 0x9A54, 0x6B4E, 0x9A55, 0x6B4F, 0x9A56, 0x6B50, 0x9A57, 0x6B51, 0x9A58, 0x6B52, 0x9A59, + 0x6B53, 0x9A5A, 0x6B54, 0x9A5B, 0x6B55, 0x9A5C, 0x6B56, 0x9A5D, 0x6B57, 0x9A5E, 0x6B58, 0x9A5F, 0x6B59, 0xECA8, 0x6B5A, 0x9A60, + 0x6B5B, 0x9A61, 0x6B5C, 0x9A62, 0x6B5D, 0x9A63, 0x6B5E, 0x9A64, 0x6B5F, 0x9A65, 0x6B60, 0x9A66, 0x6B61, 0x9A67, 0x6B62, 0xD6B9, + 0x6B63, 0xD5FD, 0x6B64, 0xB4CB, 0x6B65, 0xB2BD, 0x6B66, 0xCEE4, 0x6B67, 0xC6E7, 0x6B68, 0x9A68, 0x6B69, 0x9A69, 0x6B6A, 0xCDE1, + 0x6B6B, 0x9A6A, 0x6B6C, 0x9A6B, 0x6B6D, 0x9A6C, 0x6B6E, 0x9A6D, 0x6B6F, 0x9A6E, 0x6B70, 0x9A6F, 0x6B71, 0x9A70, 0x6B72, 0x9A71, + 0x6B73, 0x9A72, 0x6B74, 0x9A73, 0x6B75, 0x9A74, 0x6B76, 0x9A75, 0x6B77, 0x9A76, 0x6B78, 0x9A77, 0x6B79, 0xB4F5, 0x6B7A, 0x9A78, + 0x6B7B, 0xCBC0, 0x6B7C, 0xBCDF, 0x6B7D, 0x9A79, 0x6B7E, 0x9A7A, 0x6B7F, 0x9A7B, 0x6B80, 0x9A7C, 0x6B81, 0xE9E2, 0x6B82, 0xE9E3, + 0x6B83, 0xD1EA, 0x6B84, 0xE9E5, 0x6B85, 0x9A7D, 0x6B86, 0xB4F9, 0x6B87, 0xE9E4, 0x6B88, 0x9A7E, 0x6B89, 0xD1B3, 0x6B8A, 0xCAE2, + 0x6B8B, 0xB2D0, 0x6B8C, 0x9A80, 0x6B8D, 0xE9E8, 0x6B8E, 0x9A81, 0x6B8F, 0x9A82, 0x6B90, 0x9A83, 0x6B91, 0x9A84, 0x6B92, 0xE9E6, + 0x6B93, 0xE9E7, 0x6B94, 0x9A85, 0x6B95, 0x9A86, 0x6B96, 0xD6B3, 0x6B97, 0x9A87, 0x6B98, 0x9A88, 0x6B99, 0x9A89, 0x6B9A, 0xE9E9, + 0x6B9B, 0xE9EA, 0x6B9C, 0x9A8A, 0x6B9D, 0x9A8B, 0x6B9E, 0x9A8C, 0x6B9F, 0x9A8D, 0x6BA0, 0x9A8E, 0x6BA1, 0xE9EB, 0x6BA2, 0x9A8F, + 0x6BA3, 0x9A90, 0x6BA4, 0x9A91, 0x6BA5, 0x9A92, 0x6BA6, 0x9A93, 0x6BA7, 0x9A94, 0x6BA8, 0x9A95, 0x6BA9, 0x9A96, 0x6BAA, 0xE9EC, + 0x6BAB, 0x9A97, 0x6BAC, 0x9A98, 0x6BAD, 0x9A99, 0x6BAE, 0x9A9A, 0x6BAF, 0x9A9B, 0x6BB0, 0x9A9C, 0x6BB1, 0x9A9D, 0x6BB2, 0x9A9E, + 0x6BB3, 0xECAF, 0x6BB4, 0xC5B9, 0x6BB5, 0xB6CE, 0x6BB6, 0x9A9F, 0x6BB7, 0xD2F3, 0x6BB8, 0x9AA0, 0x6BB9, 0x9AA1, 0x6BBA, 0x9AA2, + 0x6BBB, 0x9AA3, 0x6BBC, 0x9AA4, 0x6BBD, 0x9AA5, 0x6BBE, 0x9AA6, 0x6BBF, 0xB5EE, 0x6BC0, 0x9AA7, 0x6BC1, 0xBBD9, 0x6BC2, 0xECB1, + 0x6BC3, 0x9AA8, 0x6BC4, 0x9AA9, 0x6BC5, 0xD2E3, 0x6BC6, 0x9AAA, 0x6BC7, 0x9AAB, 0x6BC8, 0x9AAC, 0x6BC9, 0x9AAD, 0x6BCA, 0x9AAE, + 0x6BCB, 0xCEE3, 0x6BCC, 0x9AAF, 0x6BCD, 0xC4B8, 0x6BCE, 0x9AB0, 0x6BCF, 0xC3BF, 0x6BD0, 0x9AB1, 0x6BD1, 0x9AB2, 0x6BD2, 0xB6BE, + 0x6BD3, 0xD8B9, 0x6BD4, 0xB1C8, 0x6BD5, 0xB1CF, 0x6BD6, 0xB1D1, 0x6BD7, 0xC5FE, 0x6BD8, 0x9AB3, 0x6BD9, 0xB1D0, 0x6BDA, 0x9AB4, + 0x6BDB, 0xC3AB, 0x6BDC, 0x9AB5, 0x6BDD, 0x9AB6, 0x6BDE, 0x9AB7, 0x6BDF, 0x9AB8, 0x6BE0, 0x9AB9, 0x6BE1, 0xD5B1, 0x6BE2, 0x9ABA, + 0x6BE3, 0x9ABB, 0x6BE4, 0x9ABC, 0x6BE5, 0x9ABD, 0x6BE6, 0x9ABE, 0x6BE7, 0x9ABF, 0x6BE8, 0x9AC0, 0x6BE9, 0x9AC1, 0x6BEA, 0xEBA4, + 0x6BEB, 0xBAC1, 0x6BEC, 0x9AC2, 0x6BED, 0x9AC3, 0x6BEE, 0x9AC4, 0x6BEF, 0xCCBA, 0x6BF0, 0x9AC5, 0x6BF1, 0x9AC6, 0x6BF2, 0x9AC7, + 0x6BF3, 0xEBA5, 0x6BF4, 0x9AC8, 0x6BF5, 0xEBA7, 0x6BF6, 0x9AC9, 0x6BF7, 0x9ACA, 0x6BF8, 0x9ACB, 0x6BF9, 0xEBA8, 0x6BFA, 0x9ACC, + 0x6BFB, 0x9ACD, 0x6BFC, 0x9ACE, 0x6BFD, 0xEBA6, 0x6BFE, 0x9ACF, 0x6BFF, 0x9AD0, 0x6C00, 0x9AD1, 0x6C01, 0x9AD2, 0x6C02, 0x9AD3, + 0x6C03, 0x9AD4, 0x6C04, 0x9AD5, 0x6C05, 0xEBA9, 0x6C06, 0xEBAB, 0x6C07, 0xEBAA, 0x6C08, 0x9AD6, 0x6C09, 0x9AD7, 0x6C0A, 0x9AD8, + 0x6C0B, 0x9AD9, 0x6C0C, 0x9ADA, 0x6C0D, 0xEBAC, 0x6C0E, 0x9ADB, 0x6C0F, 0xCACF, 0x6C10, 0xD8B5, 0x6C11, 0xC3F1, 0x6C12, 0x9ADC, + 0x6C13, 0xC3A5, 0x6C14, 0xC6F8, 0x6C15, 0xEBAD, 0x6C16, 0xC4CA, 0x6C17, 0x9ADD, 0x6C18, 0xEBAE, 0x6C19, 0xEBAF, 0x6C1A, 0xEBB0, + 0x6C1B, 0xB7D5, 0x6C1C, 0x9ADE, 0x6C1D, 0x9ADF, 0x6C1E, 0x9AE0, 0x6C1F, 0xB7FA, 0x6C20, 0x9AE1, 0x6C21, 0xEBB1, 0x6C22, 0xC7E2, + 0x6C23, 0x9AE2, 0x6C24, 0xEBB3, 0x6C25, 0x9AE3, 0x6C26, 0xBAA4, 0x6C27, 0xD1F5, 0x6C28, 0xB0B1, 0x6C29, 0xEBB2, 0x6C2A, 0xEBB4, + 0x6C2B, 0x9AE4, 0x6C2C, 0x9AE5, 0x6C2D, 0x9AE6, 0x6C2E, 0xB5AA, 0x6C2F, 0xC2C8, 0x6C30, 0xC7E8, 0x6C31, 0x9AE7, 0x6C32, 0xEBB5, + 0x6C33, 0x9AE8, 0x6C34, 0xCBAE, 0x6C35, 0xE3DF, 0x6C36, 0x9AE9, 0x6C37, 0x9AEA, 0x6C38, 0xD3C0, 0x6C39, 0x9AEB, 0x6C3A, 0x9AEC, + 0x6C3B, 0x9AED, 0x6C3C, 0x9AEE, 0x6C3D, 0xD9DB, 0x6C3E, 0x9AEF, 0x6C3F, 0x9AF0, 0x6C40, 0xCDA1, 0x6C41, 0xD6AD, 0x6C42, 0xC7F3, + 0x6C43, 0x9AF1, 0x6C44, 0x9AF2, 0x6C45, 0x9AF3, 0x6C46, 0xD9E0, 0x6C47, 0xBBE3, 0x6C48, 0x9AF4, 0x6C49, 0xBABA, 0x6C4A, 0xE3E2, + 0x6C4B, 0x9AF5, 0x6C4C, 0x9AF6, 0x6C4D, 0x9AF7, 0x6C4E, 0x9AF8, 0x6C4F, 0x9AF9, 0x6C50, 0xCFAB, 0x6C51, 0x9AFA, 0x6C52, 0x9AFB, + 0x6C53, 0x9AFC, 0x6C54, 0xE3E0, 0x6C55, 0xC9C7, 0x6C56, 0x9AFD, 0x6C57, 0xBAB9, 0x6C58, 0x9AFE, 0x6C59, 0x9B40, 0x6C5A, 0x9B41, + 0x6C5B, 0xD1B4, 0x6C5C, 0xE3E1, 0x6C5D, 0xC8EA, 0x6C5E, 0xB9AF, 0x6C5F, 0xBDAD, 0x6C60, 0xB3D8, 0x6C61, 0xCEDB, 0x6C62, 0x9B42, + 0x6C63, 0x9B43, 0x6C64, 0xCCC0, 0x6C65, 0x9B44, 0x6C66, 0x9B45, 0x6C67, 0x9B46, 0x6C68, 0xE3E8, 0x6C69, 0xE3E9, 0x6C6A, 0xCDF4, + 0x6C6B, 0x9B47, 0x6C6C, 0x9B48, 0x6C6D, 0x9B49, 0x6C6E, 0x9B4A, 0x6C6F, 0x9B4B, 0x6C70, 0xCCAD, 0x6C71, 0x9B4C, 0x6C72, 0xBCB3, + 0x6C73, 0x9B4D, 0x6C74, 0xE3EA, 0x6C75, 0x9B4E, 0x6C76, 0xE3EB, 0x6C77, 0x9B4F, 0x6C78, 0x9B50, 0x6C79, 0xD0DA, 0x6C7A, 0x9B51, + 0x6C7B, 0x9B52, 0x6C7C, 0x9B53, 0x6C7D, 0xC6FB, 0x6C7E, 0xB7DA, 0x6C7F, 0x9B54, 0x6C80, 0x9B55, 0x6C81, 0xC7DF, 0x6C82, 0xD2CA, + 0x6C83, 0xCED6, 0x6C84, 0x9B56, 0x6C85, 0xE3E4, 0x6C86, 0xE3EC, 0x6C87, 0x9B57, 0x6C88, 0xC9F2, 0x6C89, 0xB3C1, 0x6C8A, 0x9B58, + 0x6C8B, 0x9B59, 0x6C8C, 0xE3E7, 0x6C8D, 0x9B5A, 0x6C8E, 0x9B5B, 0x6C8F, 0xC6E3, 0x6C90, 0xE3E5, 0x6C91, 0x9B5C, 0x6C92, 0x9B5D, + 0x6C93, 0xEDB3, 0x6C94, 0xE3E6, 0x6C95, 0x9B5E, 0x6C96, 0x9B5F, 0x6C97, 0x9B60, 0x6C98, 0x9B61, 0x6C99, 0xC9B3, 0x6C9A, 0x9B62, + 0x6C9B, 0xC5E6, 0x6C9C, 0x9B63, 0x6C9D, 0x9B64, 0x6C9E, 0x9B65, 0x6C9F, 0xB9B5, 0x6CA0, 0x9B66, 0x6CA1, 0xC3BB, 0x6CA2, 0x9B67, + 0x6CA3, 0xE3E3, 0x6CA4, 0xC5BD, 0x6CA5, 0xC1A4, 0x6CA6, 0xC2D9, 0x6CA7, 0xB2D7, 0x6CA8, 0x9B68, 0x6CA9, 0xE3ED, 0x6CAA, 0xBBA6, + 0x6CAB, 0xC4AD, 0x6CAC, 0x9B69, 0x6CAD, 0xE3F0, 0x6CAE, 0xBEDA, 0x6CAF, 0x9B6A, 0x6CB0, 0x9B6B, 0x6CB1, 0xE3FB, 0x6CB2, 0xE3F5, + 0x6CB3, 0xBAD3, 0x6CB4, 0x9B6C, 0x6CB5, 0x9B6D, 0x6CB6, 0x9B6E, 0x6CB7, 0x9B6F, 0x6CB8, 0xB7D0, 0x6CB9, 0xD3CD, 0x6CBA, 0x9B70, + 0x6CBB, 0xD6CE, 0x6CBC, 0xD5D3, 0x6CBD, 0xB9C1, 0x6CBE, 0xD5B4, 0x6CBF, 0xD1D8, 0x6CC0, 0x9B71, 0x6CC1, 0x9B72, 0x6CC2, 0x9B73, + 0x6CC3, 0x9B74, 0x6CC4, 0xD0B9, 0x6CC5, 0xC7F6, 0x6CC6, 0x9B75, 0x6CC7, 0x9B76, 0x6CC8, 0x9B77, 0x6CC9, 0xC8AA, 0x6CCA, 0xB2B4, + 0x6CCB, 0x9B78, 0x6CCC, 0xC3DA, 0x6CCD, 0x9B79, 0x6CCE, 0x9B7A, 0x6CCF, 0x9B7B, 0x6CD0, 0xE3EE, 0x6CD1, 0x9B7C, 0x6CD2, 0x9B7D, + 0x6CD3, 0xE3FC, 0x6CD4, 0xE3EF, 0x6CD5, 0xB7A8, 0x6CD6, 0xE3F7, 0x6CD7, 0xE3F4, 0x6CD8, 0x9B7E, 0x6CD9, 0x9B80, 0x6CDA, 0x9B81, + 0x6CDB, 0xB7BA, 0x6CDC, 0x9B82, 0x6CDD, 0x9B83, 0x6CDE, 0xC5A2, 0x6CDF, 0x9B84, 0x6CE0, 0xE3F6, 0x6CE1, 0xC5DD, 0x6CE2, 0xB2A8, + 0x6CE3, 0xC6FC, 0x6CE4, 0x9B85, 0x6CE5, 0xC4E0, 0x6CE6, 0x9B86, 0x6CE7, 0x9B87, 0x6CE8, 0xD7A2, 0x6CE9, 0x9B88, 0x6CEA, 0xC0E1, + 0x6CEB, 0xE3F9, 0x6CEC, 0x9B89, 0x6CED, 0x9B8A, 0x6CEE, 0xE3FA, 0x6CEF, 0xE3FD, 0x6CF0, 0xCCA9, 0x6CF1, 0xE3F3, 0x6CF2, 0x9B8B, + 0x6CF3, 0xD3BE, 0x6CF4, 0x9B8C, 0x6CF5, 0xB1C3, 0x6CF6, 0xEDB4, 0x6CF7, 0xE3F1, 0x6CF8, 0xE3F2, 0x6CF9, 0x9B8D, 0x6CFA, 0xE3F8, + 0x6CFB, 0xD0BA, 0x6CFC, 0xC6C3, 0x6CFD, 0xD4F3, 0x6CFE, 0xE3FE, 0x6CFF, 0x9B8E, 0x6D00, 0x9B8F, 0x6D01, 0xBDE0, 0x6D02, 0x9B90, + 0x6D03, 0x9B91, 0x6D04, 0xE4A7, 0x6D05, 0x9B92, 0x6D06, 0x9B93, 0x6D07, 0xE4A6, 0x6D08, 0x9B94, 0x6D09, 0x9B95, 0x6D0A, 0x9B96, + 0x6D0B, 0xD1F3, 0x6D0C, 0xE4A3, 0x6D0D, 0x9B97, 0x6D0E, 0xE4A9, 0x6D0F, 0x9B98, 0x6D10, 0x9B99, 0x6D11, 0x9B9A, 0x6D12, 0xC8F7, + 0x6D13, 0x9B9B, 0x6D14, 0x9B9C, 0x6D15, 0x9B9D, 0x6D16, 0x9B9E, 0x6D17, 0xCFB4, 0x6D18, 0x9B9F, 0x6D19, 0xE4A8, 0x6D1A, 0xE4AE, + 0x6D1B, 0xC2E5, 0x6D1C, 0x9BA0, 0x6D1D, 0x9BA1, 0x6D1E, 0xB6B4, 0x6D1F, 0x9BA2, 0x6D20, 0x9BA3, 0x6D21, 0x9BA4, 0x6D22, 0x9BA5, + 0x6D23, 0x9BA6, 0x6D24, 0x9BA7, 0x6D25, 0xBDF2, 0x6D26, 0x9BA8, 0x6D27, 0xE4A2, 0x6D28, 0x9BA9, 0x6D29, 0x9BAA, 0x6D2A, 0xBAE9, + 0x6D2B, 0xE4AA, 0x6D2C, 0x9BAB, 0x6D2D, 0x9BAC, 0x6D2E, 0xE4AC, 0x6D2F, 0x9BAD, 0x6D30, 0x9BAE, 0x6D31, 0xB6FD, 0x6D32, 0xD6DE, + 0x6D33, 0xE4B2, 0x6D34, 0x9BAF, 0x6D35, 0xE4AD, 0x6D36, 0x9BB0, 0x6D37, 0x9BB1, 0x6D38, 0x9BB2, 0x6D39, 0xE4A1, 0x6D3A, 0x9BB3, + 0x6D3B, 0xBBEE, 0x6D3C, 0xCDDD, 0x6D3D, 0xC7A2, 0x6D3E, 0xC5C9, 0x6D3F, 0x9BB4, 0x6D40, 0x9BB5, 0x6D41, 0xC1F7, 0x6D42, 0x9BB6, + 0x6D43, 0xE4A4, 0x6D44, 0x9BB7, 0x6D45, 0xC7B3, 0x6D46, 0xBDAC, 0x6D47, 0xBDBD, 0x6D48, 0xE4A5, 0x6D49, 0x9BB8, 0x6D4A, 0xD7C7, + 0x6D4B, 0xB2E2, 0x6D4C, 0x9BB9, 0x6D4D, 0xE4AB, 0x6D4E, 0xBCC3, 0x6D4F, 0xE4AF, 0x6D50, 0x9BBA, 0x6D51, 0xBBEB, 0x6D52, 0xE4B0, + 0x6D53, 0xC5A8, 0x6D54, 0xE4B1, 0x6D55, 0x9BBB, 0x6D56, 0x9BBC, 0x6D57, 0x9BBD, 0x6D58, 0x9BBE, 0x6D59, 0xD5E3, 0x6D5A, 0xBFA3, + 0x6D5B, 0x9BBF, 0x6D5C, 0xE4BA, 0x6D5D, 0x9BC0, 0x6D5E, 0xE4B7, 0x6D5F, 0x9BC1, 0x6D60, 0xE4BB, 0x6D61, 0x9BC2, 0x6D62, 0x9BC3, + 0x6D63, 0xE4BD, 0x6D64, 0x9BC4, 0x6D65, 0x9BC5, 0x6D66, 0xC6D6, 0x6D67, 0x9BC6, 0x6D68, 0x9BC7, 0x6D69, 0xBAC6, 0x6D6A, 0xC0CB, + 0x6D6B, 0x9BC8, 0x6D6C, 0x9BC9, 0x6D6D, 0x9BCA, 0x6D6E, 0xB8A1, 0x6D6F, 0xE4B4, 0x6D70, 0x9BCB, 0x6D71, 0x9BCC, 0x6D72, 0x9BCD, + 0x6D73, 0x9BCE, 0x6D74, 0xD4A1, 0x6D75, 0x9BCF, 0x6D76, 0x9BD0, 0x6D77, 0xBAA3, 0x6D78, 0xBDFE, 0x6D79, 0x9BD1, 0x6D7A, 0x9BD2, + 0x6D7B, 0x9BD3, 0x6D7C, 0xE4BC, 0x6D7D, 0x9BD4, 0x6D7E, 0x9BD5, 0x6D7F, 0x9BD6, 0x6D80, 0x9BD7, 0x6D81, 0x9BD8, 0x6D82, 0xCDBF, + 0x6D83, 0x9BD9, 0x6D84, 0x9BDA, 0x6D85, 0xC4F9, 0x6D86, 0x9BDB, 0x6D87, 0x9BDC, 0x6D88, 0xCFFB, 0x6D89, 0xC9E6, 0x6D8A, 0x9BDD, + 0x6D8B, 0x9BDE, 0x6D8C, 0xD3BF, 0x6D8D, 0x9BDF, 0x6D8E, 0xCFD1, 0x6D8F, 0x9BE0, 0x6D90, 0x9BE1, 0x6D91, 0xE4B3, 0x6D92, 0x9BE2, + 0x6D93, 0xE4B8, 0x6D94, 0xE4B9, 0x6D95, 0xCCE9, 0x6D96, 0x9BE3, 0x6D97, 0x9BE4, 0x6D98, 0x9BE5, 0x6D99, 0x9BE6, 0x6D9A, 0x9BE7, + 0x6D9B, 0xCCCE, 0x6D9C, 0x9BE8, 0x6D9D, 0xC0D4, 0x6D9E, 0xE4B5, 0x6D9F, 0xC1B0, 0x6DA0, 0xE4B6, 0x6DA1, 0xCED0, 0x6DA2, 0x9BE9, + 0x6DA3, 0xBBC1, 0x6DA4, 0xB5D3, 0x6DA5, 0x9BEA, 0x6DA6, 0xC8F3, 0x6DA7, 0xBDA7, 0x6DA8, 0xD5C7, 0x6DA9, 0xC9AC, 0x6DAA, 0xB8A2, + 0x6DAB, 0xE4CA, 0x6DAC, 0x9BEB, 0x6DAD, 0x9BEC, 0x6DAE, 0xE4CC, 0x6DAF, 0xD1C4, 0x6DB0, 0x9BED, 0x6DB1, 0x9BEE, 0x6DB2, 0xD2BA, + 0x6DB3, 0x9BEF, 0x6DB4, 0x9BF0, 0x6DB5, 0xBAAD, 0x6DB6, 0x9BF1, 0x6DB7, 0x9BF2, 0x6DB8, 0xBAD4, 0x6DB9, 0x9BF3, 0x6DBA, 0x9BF4, + 0x6DBB, 0x9BF5, 0x6DBC, 0x9BF6, 0x6DBD, 0x9BF7, 0x6DBE, 0x9BF8, 0x6DBF, 0xE4C3, 0x6DC0, 0xB5ED, 0x6DC1, 0x9BF9, 0x6DC2, 0x9BFA, + 0x6DC3, 0x9BFB, 0x6DC4, 0xD7CD, 0x6DC5, 0xE4C0, 0x6DC6, 0xCFFD, 0x6DC7, 0xE4BF, 0x6DC8, 0x9BFC, 0x6DC9, 0x9BFD, 0x6DCA, 0x9BFE, + 0x6DCB, 0xC1DC, 0x6DCC, 0xCCCA, 0x6DCD, 0x9C40, 0x6DCE, 0x9C41, 0x6DCF, 0x9C42, 0x6DD0, 0x9C43, 0x6DD1, 0xCAE7, 0x6DD2, 0x9C44, + 0x6DD3, 0x9C45, 0x6DD4, 0x9C46, 0x6DD5, 0x9C47, 0x6DD6, 0xC4D7, 0x6DD7, 0x9C48, 0x6DD8, 0xCCD4, 0x6DD9, 0xE4C8, 0x6DDA, 0x9C49, + 0x6DDB, 0x9C4A, 0x6DDC, 0x9C4B, 0x6DDD, 0xE4C7, 0x6DDE, 0xE4C1, 0x6DDF, 0x9C4C, 0x6DE0, 0xE4C4, 0x6DE1, 0xB5AD, 0x6DE2, 0x9C4D, + 0x6DE3, 0x9C4E, 0x6DE4, 0xD3D9, 0x6DE5, 0x9C4F, 0x6DE6, 0xE4C6, 0x6DE7, 0x9C50, 0x6DE8, 0x9C51, 0x6DE9, 0x9C52, 0x6DEA, 0x9C53, + 0x6DEB, 0xD2F9, 0x6DEC, 0xB4E3, 0x6DED, 0x9C54, 0x6DEE, 0xBBB4, 0x6DEF, 0x9C55, 0x6DF0, 0x9C56, 0x6DF1, 0xC9EE, 0x6DF2, 0x9C57, + 0x6DF3, 0xB4BE, 0x6DF4, 0x9C58, 0x6DF5, 0x9C59, 0x6DF6, 0x9C5A, 0x6DF7, 0xBBEC, 0x6DF8, 0x9C5B, 0x6DF9, 0xD1CD, 0x6DFA, 0x9C5C, + 0x6DFB, 0xCCED, 0x6DFC, 0xEDB5, 0x6DFD, 0x9C5D, 0x6DFE, 0x9C5E, 0x6DFF, 0x9C5F, 0x6E00, 0x9C60, 0x6E01, 0x9C61, 0x6E02, 0x9C62, + 0x6E03, 0x9C63, 0x6E04, 0x9C64, 0x6E05, 0xC7E5, 0x6E06, 0x9C65, 0x6E07, 0x9C66, 0x6E08, 0x9C67, 0x6E09, 0x9C68, 0x6E0A, 0xD4A8, + 0x6E0B, 0x9C69, 0x6E0C, 0xE4CB, 0x6E0D, 0xD7D5, 0x6E0E, 0xE4C2, 0x6E0F, 0x9C6A, 0x6E10, 0xBDA5, 0x6E11, 0xE4C5, 0x6E12, 0x9C6B, + 0x6E13, 0x9C6C, 0x6E14, 0xD3E6, 0x6E15, 0x9C6D, 0x6E16, 0xE4C9, 0x6E17, 0xC9F8, 0x6E18, 0x9C6E, 0x6E19, 0x9C6F, 0x6E1A, 0xE4BE, + 0x6E1B, 0x9C70, 0x6E1C, 0x9C71, 0x6E1D, 0xD3E5, 0x6E1E, 0x9C72, 0x6E1F, 0x9C73, 0x6E20, 0xC7FE, 0x6E21, 0xB6C9, 0x6E22, 0x9C74, + 0x6E23, 0xD4FC, 0x6E24, 0xB2B3, 0x6E25, 0xE4D7, 0x6E26, 0x9C75, 0x6E27, 0x9C76, 0x6E28, 0x9C77, 0x6E29, 0xCEC2, 0x6E2A, 0x9C78, + 0x6E2B, 0xE4CD, 0x6E2C, 0x9C79, 0x6E2D, 0xCEBC, 0x6E2E, 0x9C7A, 0x6E2F, 0xB8DB, 0x6E30, 0x9C7B, 0x6E31, 0x9C7C, 0x6E32, 0xE4D6, + 0x6E33, 0x9C7D, 0x6E34, 0xBFCA, 0x6E35, 0x9C7E, 0x6E36, 0x9C80, 0x6E37, 0x9C81, 0x6E38, 0xD3CE, 0x6E39, 0x9C82, 0x6E3A, 0xC3EC, + 0x6E3B, 0x9C83, 0x6E3C, 0x9C84, 0x6E3D, 0x9C85, 0x6E3E, 0x9C86, 0x6E3F, 0x9C87, 0x6E40, 0x9C88, 0x6E41, 0x9C89, 0x6E42, 0x9C8A, + 0x6E43, 0xC5C8, 0x6E44, 0xE4D8, 0x6E45, 0x9C8B, 0x6E46, 0x9C8C, 0x6E47, 0x9C8D, 0x6E48, 0x9C8E, 0x6E49, 0x9C8F, 0x6E4A, 0x9C90, + 0x6E4B, 0x9C91, 0x6E4C, 0x9C92, 0x6E4D, 0xCDC4, 0x6E4E, 0xE4CF, 0x6E4F, 0x9C93, 0x6E50, 0x9C94, 0x6E51, 0x9C95, 0x6E52, 0x9C96, + 0x6E53, 0xE4D4, 0x6E54, 0xE4D5, 0x6E55, 0x9C97, 0x6E56, 0xBAFE, 0x6E57, 0x9C98, 0x6E58, 0xCFE6, 0x6E59, 0x9C99, 0x6E5A, 0x9C9A, + 0x6E5B, 0xD5BF, 0x6E5C, 0x9C9B, 0x6E5D, 0x9C9C, 0x6E5E, 0x9C9D, 0x6E5F, 0xE4D2, 0x6E60, 0x9C9E, 0x6E61, 0x9C9F, 0x6E62, 0x9CA0, + 0x6E63, 0x9CA1, 0x6E64, 0x9CA2, 0x6E65, 0x9CA3, 0x6E66, 0x9CA4, 0x6E67, 0x9CA5, 0x6E68, 0x9CA6, 0x6E69, 0x9CA7, 0x6E6A, 0x9CA8, + 0x6E6B, 0xE4D0, 0x6E6C, 0x9CA9, 0x6E6D, 0x9CAA, 0x6E6E, 0xE4CE, 0x6E6F, 0x9CAB, 0x6E70, 0x9CAC, 0x6E71, 0x9CAD, 0x6E72, 0x9CAE, + 0x6E73, 0x9CAF, 0x6E74, 0x9CB0, 0x6E75, 0x9CB1, 0x6E76, 0x9CB2, 0x6E77, 0x9CB3, 0x6E78, 0x9CB4, 0x6E79, 0x9CB5, 0x6E7A, 0x9CB6, + 0x6E7B, 0x9CB7, 0x6E7C, 0x9CB8, 0x6E7D, 0x9CB9, 0x6E7E, 0xCDE5, 0x6E7F, 0xCAAA, 0x6E80, 0x9CBA, 0x6E81, 0x9CBB, 0x6E82, 0x9CBC, + 0x6E83, 0xC0A3, 0x6E84, 0x9CBD, 0x6E85, 0xBDA6, 0x6E86, 0xE4D3, 0x6E87, 0x9CBE, 0x6E88, 0x9CBF, 0x6E89, 0xB8C8, 0x6E8A, 0x9CC0, + 0x6E8B, 0x9CC1, 0x6E8C, 0x9CC2, 0x6E8D, 0x9CC3, 0x6E8E, 0x9CC4, 0x6E8F, 0xE4E7, 0x6E90, 0xD4B4, 0x6E91, 0x9CC5, 0x6E92, 0x9CC6, + 0x6E93, 0x9CC7, 0x6E94, 0x9CC8, 0x6E95, 0x9CC9, 0x6E96, 0x9CCA, 0x6E97, 0x9CCB, 0x6E98, 0xE4DB, 0x6E99, 0x9CCC, 0x6E9A, 0x9CCD, + 0x6E9B, 0x9CCE, 0x6E9C, 0xC1EF, 0x6E9D, 0x9CCF, 0x6E9E, 0x9CD0, 0x6E9F, 0xE4E9, 0x6EA0, 0x9CD1, 0x6EA1, 0x9CD2, 0x6EA2, 0xD2E7, + 0x6EA3, 0x9CD3, 0x6EA4, 0x9CD4, 0x6EA5, 0xE4DF, 0x6EA6, 0x9CD5, 0x6EA7, 0xE4E0, 0x6EA8, 0x9CD6, 0x6EA9, 0x9CD7, 0x6EAA, 0xCFAA, + 0x6EAB, 0x9CD8, 0x6EAC, 0x9CD9, 0x6EAD, 0x9CDA, 0x6EAE, 0x9CDB, 0x6EAF, 0xCBDD, 0x6EB0, 0x9CDC, 0x6EB1, 0xE4DA, 0x6EB2, 0xE4D1, + 0x6EB3, 0x9CDD, 0x6EB4, 0xE4E5, 0x6EB5, 0x9CDE, 0x6EB6, 0xC8DC, 0x6EB7, 0xE4E3, 0x6EB8, 0x9CDF, 0x6EB9, 0x9CE0, 0x6EBA, 0xC4E7, + 0x6EBB, 0xE4E2, 0x6EBC, 0x9CE1, 0x6EBD, 0xE4E1, 0x6EBE, 0x9CE2, 0x6EBF, 0x9CE3, 0x6EC0, 0x9CE4, 0x6EC1, 0xB3FC, 0x6EC2, 0xE4E8, + 0x6EC3, 0x9CE5, 0x6EC4, 0x9CE6, 0x6EC5, 0x9CE7, 0x6EC6, 0x9CE8, 0x6EC7, 0xB5E1, 0x6EC8, 0x9CE9, 0x6EC9, 0x9CEA, 0x6ECA, 0x9CEB, + 0x6ECB, 0xD7CC, 0x6ECC, 0x9CEC, 0x6ECD, 0x9CED, 0x6ECE, 0x9CEE, 0x6ECF, 0xE4E6, 0x6ED0, 0x9CEF, 0x6ED1, 0xBBAC, 0x6ED2, 0x9CF0, + 0x6ED3, 0xD7D2, 0x6ED4, 0xCCCF, 0x6ED5, 0xEBF8, 0x6ED6, 0x9CF1, 0x6ED7, 0xE4E4, 0x6ED8, 0x9CF2, 0x6ED9, 0x9CF3, 0x6EDA, 0xB9F6, + 0x6EDB, 0x9CF4, 0x6EDC, 0x9CF5, 0x6EDD, 0x9CF6, 0x6EDE, 0xD6CD, 0x6EDF, 0xE4D9, 0x6EE0, 0xE4DC, 0x6EE1, 0xC2FA, 0x6EE2, 0xE4DE, + 0x6EE3, 0x9CF7, 0x6EE4, 0xC2CB, 0x6EE5, 0xC0C4, 0x6EE6, 0xC2D0, 0x6EE7, 0x9CF8, 0x6EE8, 0xB1F5, 0x6EE9, 0xCCB2, 0x6EEA, 0x9CF9, + 0x6EEB, 0x9CFA, 0x6EEC, 0x9CFB, 0x6EED, 0x9CFC, 0x6EEE, 0x9CFD, 0x6EEF, 0x9CFE, 0x6EF0, 0x9D40, 0x6EF1, 0x9D41, 0x6EF2, 0x9D42, + 0x6EF3, 0x9D43, 0x6EF4, 0xB5CE, 0x6EF5, 0x9D44, 0x6EF6, 0x9D45, 0x6EF7, 0x9D46, 0x6EF8, 0x9D47, 0x6EF9, 0xE4EF, 0x6EFA, 0x9D48, + 0x6EFB, 0x9D49, 0x6EFC, 0x9D4A, 0x6EFD, 0x9D4B, 0x6EFE, 0x9D4C, 0x6EFF, 0x9D4D, 0x6F00, 0x9D4E, 0x6F01, 0x9D4F, 0x6F02, 0xC6AF, + 0x6F03, 0x9D50, 0x6F04, 0x9D51, 0x6F05, 0x9D52, 0x6F06, 0xC6E1, 0x6F07, 0x9D53, 0x6F08, 0x9D54, 0x6F09, 0xE4F5, 0x6F0A, 0x9D55, + 0x6F0B, 0x9D56, 0x6F0C, 0x9D57, 0x6F0D, 0x9D58, 0x6F0E, 0x9D59, 0x6F0F, 0xC2A9, 0x6F10, 0x9D5A, 0x6F11, 0x9D5B, 0x6F12, 0x9D5C, + 0x6F13, 0xC0EC, 0x6F14, 0xD1DD, 0x6F15, 0xE4EE, 0x6F16, 0x9D5D, 0x6F17, 0x9D5E, 0x6F18, 0x9D5F, 0x6F19, 0x9D60, 0x6F1A, 0x9D61, + 0x6F1B, 0x9D62, 0x6F1C, 0x9D63, 0x6F1D, 0x9D64, 0x6F1E, 0x9D65, 0x6F1F, 0x9D66, 0x6F20, 0xC4AE, 0x6F21, 0x9D67, 0x6F22, 0x9D68, + 0x6F23, 0x9D69, 0x6F24, 0xE4ED, 0x6F25, 0x9D6A, 0x6F26, 0x9D6B, 0x6F27, 0x9D6C, 0x6F28, 0x9D6D, 0x6F29, 0xE4F6, 0x6F2A, 0xE4F4, + 0x6F2B, 0xC2FE, 0x6F2C, 0x9D6E, 0x6F2D, 0xE4DD, 0x6F2E, 0x9D6F, 0x6F2F, 0xE4F0, 0x6F30, 0x9D70, 0x6F31, 0xCAFE, 0x6F32, 0x9D71, + 0x6F33, 0xD5C4, 0x6F34, 0x9D72, 0x6F35, 0x9D73, 0x6F36, 0xE4F1, 0x6F37, 0x9D74, 0x6F38, 0x9D75, 0x6F39, 0x9D76, 0x6F3A, 0x9D77, + 0x6F3B, 0x9D78, 0x6F3C, 0x9D79, 0x6F3D, 0x9D7A, 0x6F3E, 0xD1FA, 0x6F3F, 0x9D7B, 0x6F40, 0x9D7C, 0x6F41, 0x9D7D, 0x6F42, 0x9D7E, + 0x6F43, 0x9D80, 0x6F44, 0x9D81, 0x6F45, 0x9D82, 0x6F46, 0xE4EB, 0x6F47, 0xE4EC, 0x6F48, 0x9D83, 0x6F49, 0x9D84, 0x6F4A, 0x9D85, + 0x6F4B, 0xE4F2, 0x6F4C, 0x9D86, 0x6F4D, 0xCEAB, 0x6F4E, 0x9D87, 0x6F4F, 0x9D88, 0x6F50, 0x9D89, 0x6F51, 0x9D8A, 0x6F52, 0x9D8B, + 0x6F53, 0x9D8C, 0x6F54, 0x9D8D, 0x6F55, 0x9D8E, 0x6F56, 0x9D8F, 0x6F57, 0x9D90, 0x6F58, 0xC5CB, 0x6F59, 0x9D91, 0x6F5A, 0x9D92, + 0x6F5B, 0x9D93, 0x6F5C, 0xC7B1, 0x6F5D, 0x9D94, 0x6F5E, 0xC2BA, 0x6F5F, 0x9D95, 0x6F60, 0x9D96, 0x6F61, 0x9D97, 0x6F62, 0xE4EA, + 0x6F63, 0x9D98, 0x6F64, 0x9D99, 0x6F65, 0x9D9A, 0x6F66, 0xC1CA, 0x6F67, 0x9D9B, 0x6F68, 0x9D9C, 0x6F69, 0x9D9D, 0x6F6A, 0x9D9E, + 0x6F6B, 0x9D9F, 0x6F6C, 0x9DA0, 0x6F6D, 0xCCB6, 0x6F6E, 0xB3B1, 0x6F6F, 0x9DA1, 0x6F70, 0x9DA2, 0x6F71, 0x9DA3, 0x6F72, 0xE4FB, + 0x6F73, 0x9DA4, 0x6F74, 0xE4F3, 0x6F75, 0x9DA5, 0x6F76, 0x9DA6, 0x6F77, 0x9DA7, 0x6F78, 0xE4FA, 0x6F79, 0x9DA8, 0x6F7A, 0xE4FD, + 0x6F7B, 0x9DA9, 0x6F7C, 0xE4FC, 0x6F7D, 0x9DAA, 0x6F7E, 0x9DAB, 0x6F7F, 0x9DAC, 0x6F80, 0x9DAD, 0x6F81, 0x9DAE, 0x6F82, 0x9DAF, + 0x6F83, 0x9DB0, 0x6F84, 0xB3CE, 0x6F85, 0x9DB1, 0x6F86, 0x9DB2, 0x6F87, 0x9DB3, 0x6F88, 0xB3BA, 0x6F89, 0xE4F7, 0x6F8A, 0x9DB4, + 0x6F8B, 0x9DB5, 0x6F8C, 0xE4F9, 0x6F8D, 0xE4F8, 0x6F8E, 0xC5EC, 0x6F8F, 0x9DB6, 0x6F90, 0x9DB7, 0x6F91, 0x9DB8, 0x6F92, 0x9DB9, + 0x6F93, 0x9DBA, 0x6F94, 0x9DBB, 0x6F95, 0x9DBC, 0x6F96, 0x9DBD, 0x6F97, 0x9DBE, 0x6F98, 0x9DBF, 0x6F99, 0x9DC0, 0x6F9A, 0x9DC1, + 0x6F9B, 0x9DC2, 0x6F9C, 0xC0BD, 0x6F9D, 0x9DC3, 0x6F9E, 0x9DC4, 0x6F9F, 0x9DC5, 0x6FA0, 0x9DC6, 0x6FA1, 0xD4E8, 0x6FA2, 0x9DC7, + 0x6FA3, 0x9DC8, 0x6FA4, 0x9DC9, 0x6FA5, 0x9DCA, 0x6FA6, 0x9DCB, 0x6FA7, 0xE5A2, 0x6FA8, 0x9DCC, 0x6FA9, 0x9DCD, 0x6FAA, 0x9DCE, + 0x6FAB, 0x9DCF, 0x6FAC, 0x9DD0, 0x6FAD, 0x9DD1, 0x6FAE, 0x9DD2, 0x6FAF, 0x9DD3, 0x6FB0, 0x9DD4, 0x6FB1, 0x9DD5, 0x6FB2, 0x9DD6, + 0x6FB3, 0xB0C4, 0x6FB4, 0x9DD7, 0x6FB5, 0x9DD8, 0x6FB6, 0xE5A4, 0x6FB7, 0x9DD9, 0x6FB8, 0x9DDA, 0x6FB9, 0xE5A3, 0x6FBA, 0x9DDB, + 0x6FBB, 0x9DDC, 0x6FBC, 0x9DDD, 0x6FBD, 0x9DDE, 0x6FBE, 0x9DDF, 0x6FBF, 0x9DE0, 0x6FC0, 0xBCA4, 0x6FC1, 0x9DE1, 0x6FC2, 0xE5A5, + 0x6FC3, 0x9DE2, 0x6FC4, 0x9DE3, 0x6FC5, 0x9DE4, 0x6FC6, 0x9DE5, 0x6FC7, 0x9DE6, 0x6FC8, 0x9DE7, 0x6FC9, 0xE5A1, 0x6FCA, 0x9DE8, + 0x6FCB, 0x9DE9, 0x6FCC, 0x9DEA, 0x6FCD, 0x9DEB, 0x6FCE, 0x9DEC, 0x6FCF, 0x9DED, 0x6FD0, 0x9DEE, 0x6FD1, 0xE4FE, 0x6FD2, 0xB1F4, + 0x6FD3, 0x9DEF, 0x6FD4, 0x9DF0, 0x6FD5, 0x9DF1, 0x6FD6, 0x9DF2, 0x6FD7, 0x9DF3, 0x6FD8, 0x9DF4, 0x6FD9, 0x9DF5, 0x6FDA, 0x9DF6, + 0x6FDB, 0x9DF7, 0x6FDC, 0x9DF8, 0x6FDD, 0x9DF9, 0x6FDE, 0xE5A8, 0x6FDF, 0x9DFA, 0x6FE0, 0xE5A9, 0x6FE1, 0xE5A6, 0x6FE2, 0x9DFB, + 0x6FE3, 0x9DFC, 0x6FE4, 0x9DFD, 0x6FE5, 0x9DFE, 0x6FE6, 0x9E40, 0x6FE7, 0x9E41, 0x6FE8, 0x9E42, 0x6FE9, 0x9E43, 0x6FEA, 0x9E44, + 0x6FEB, 0x9E45, 0x6FEC, 0x9E46, 0x6FED, 0x9E47, 0x6FEE, 0xE5A7, 0x6FEF, 0xE5AA, 0x6FF0, 0x9E48, 0x6FF1, 0x9E49, 0x6FF2, 0x9E4A, + 0x6FF3, 0x9E4B, 0x6FF4, 0x9E4C, 0x6FF5, 0x9E4D, 0x6FF6, 0x9E4E, 0x6FF7, 0x9E4F, 0x6FF8, 0x9E50, 0x6FF9, 0x9E51, 0x6FFA, 0x9E52, + 0x6FFB, 0x9E53, 0x6FFC, 0x9E54, 0x6FFD, 0x9E55, 0x6FFE, 0x9E56, 0x6FFF, 0x9E57, 0x7000, 0x9E58, 0x7001, 0x9E59, 0x7002, 0x9E5A, + 0x7003, 0x9E5B, 0x7004, 0x9E5C, 0x7005, 0x9E5D, 0x7006, 0x9E5E, 0x7007, 0x9E5F, 0x7008, 0x9E60, 0x7009, 0x9E61, 0x700A, 0x9E62, + 0x700B, 0x9E63, 0x700C, 0x9E64, 0x700D, 0x9E65, 0x700E, 0x9E66, 0x700F, 0x9E67, 0x7010, 0x9E68, 0x7011, 0xC6D9, 0x7012, 0x9E69, + 0x7013, 0x9E6A, 0x7014, 0x9E6B, 0x7015, 0x9E6C, 0x7016, 0x9E6D, 0x7017, 0x9E6E, 0x7018, 0x9E6F, 0x7019, 0x9E70, 0x701A, 0xE5AB, + 0x701B, 0xE5AD, 0x701C, 0x9E71, 0x701D, 0x9E72, 0x701E, 0x9E73, 0x701F, 0x9E74, 0x7020, 0x9E75, 0x7021, 0x9E76, 0x7022, 0x9E77, + 0x7023, 0xE5AC, 0x7024, 0x9E78, 0x7025, 0x9E79, 0x7026, 0x9E7A, 0x7027, 0x9E7B, 0x7028, 0x9E7C, 0x7029, 0x9E7D, 0x702A, 0x9E7E, + 0x702B, 0x9E80, 0x702C, 0x9E81, 0x702D, 0x9E82, 0x702E, 0x9E83, 0x702F, 0x9E84, 0x7030, 0x9E85, 0x7031, 0x9E86, 0x7032, 0x9E87, + 0x7033, 0x9E88, 0x7034, 0x9E89, 0x7035, 0xE5AF, 0x7036, 0x9E8A, 0x7037, 0x9E8B, 0x7038, 0x9E8C, 0x7039, 0xE5AE, 0x703A, 0x9E8D, + 0x703B, 0x9E8E, 0x703C, 0x9E8F, 0x703D, 0x9E90, 0x703E, 0x9E91, 0x703F, 0x9E92, 0x7040, 0x9E93, 0x7041, 0x9E94, 0x7042, 0x9E95, + 0x7043, 0x9E96, 0x7044, 0x9E97, 0x7045, 0x9E98, 0x7046, 0x9E99, 0x7047, 0x9E9A, 0x7048, 0x9E9B, 0x7049, 0x9E9C, 0x704A, 0x9E9D, + 0x704B, 0x9E9E, 0x704C, 0xB9E0, 0x704D, 0x9E9F, 0x704E, 0x9EA0, 0x704F, 0xE5B0, 0x7050, 0x9EA1, 0x7051, 0x9EA2, 0x7052, 0x9EA3, + 0x7053, 0x9EA4, 0x7054, 0x9EA5, 0x7055, 0x9EA6, 0x7056, 0x9EA7, 0x7057, 0x9EA8, 0x7058, 0x9EA9, 0x7059, 0x9EAA, 0x705A, 0x9EAB, + 0x705B, 0x9EAC, 0x705C, 0x9EAD, 0x705D, 0x9EAE, 0x705E, 0xE5B1, 0x705F, 0x9EAF, 0x7060, 0x9EB0, 0x7061, 0x9EB1, 0x7062, 0x9EB2, + 0x7063, 0x9EB3, 0x7064, 0x9EB4, 0x7065, 0x9EB5, 0x7066, 0x9EB6, 0x7067, 0x9EB7, 0x7068, 0x9EB8, 0x7069, 0x9EB9, 0x706A, 0x9EBA, + 0x706B, 0xBBF0, 0x706C, 0xECE1, 0x706D, 0xC3F0, 0x706E, 0x9EBB, 0x706F, 0xB5C6, 0x7070, 0xBBD2, 0x7071, 0x9EBC, 0x7072, 0x9EBD, + 0x7073, 0x9EBE, 0x7074, 0x9EBF, 0x7075, 0xC1E9, 0x7076, 0xD4EE, 0x7077, 0x9EC0, 0x7078, 0xBEC4, 0x7079, 0x9EC1, 0x707A, 0x9EC2, + 0x707B, 0x9EC3, 0x707C, 0xD7C6, 0x707D, 0x9EC4, 0x707E, 0xD4D6, 0x707F, 0xB2D3, 0x7080, 0xECBE, 0x7081, 0x9EC5, 0x7082, 0x9EC6, + 0x7083, 0x9EC7, 0x7084, 0x9EC8, 0x7085, 0xEAC1, 0x7086, 0x9EC9, 0x7087, 0x9ECA, 0x7088, 0x9ECB, 0x7089, 0xC2AF, 0x708A, 0xB4B6, + 0x708B, 0x9ECC, 0x708C, 0x9ECD, 0x708D, 0x9ECE, 0x708E, 0xD1D7, 0x708F, 0x9ECF, 0x7090, 0x9ED0, 0x7091, 0x9ED1, 0x7092, 0xB3B4, + 0x7093, 0x9ED2, 0x7094, 0xC8B2, 0x7095, 0xBFBB, 0x7096, 0xECC0, 0x7097, 0x9ED3, 0x7098, 0x9ED4, 0x7099, 0xD6CB, 0x709A, 0x9ED5, + 0x709B, 0x9ED6, 0x709C, 0xECBF, 0x709D, 0xECC1, 0x709E, 0x9ED7, 0x709F, 0x9ED8, 0x70A0, 0x9ED9, 0x70A1, 0x9EDA, 0x70A2, 0x9EDB, + 0x70A3, 0x9EDC, 0x70A4, 0x9EDD, 0x70A5, 0x9EDE, 0x70A6, 0x9EDF, 0x70A7, 0x9EE0, 0x70A8, 0x9EE1, 0x70A9, 0x9EE2, 0x70AA, 0x9EE3, + 0x70AB, 0xECC5, 0x70AC, 0xBEE6, 0x70AD, 0xCCBF, 0x70AE, 0xC5DA, 0x70AF, 0xBEBC, 0x70B0, 0x9EE4, 0x70B1, 0xECC6, 0x70B2, 0x9EE5, + 0x70B3, 0xB1FE, 0x70B4, 0x9EE6, 0x70B5, 0x9EE7, 0x70B6, 0x9EE8, 0x70B7, 0xECC4, 0x70B8, 0xD5A8, 0x70B9, 0xB5E3, 0x70BA, 0x9EE9, + 0x70BB, 0xECC2, 0x70BC, 0xC1B6, 0x70BD, 0xB3E3, 0x70BE, 0x9EEA, 0x70BF, 0x9EEB, 0x70C0, 0xECC3, 0x70C1, 0xCBB8, 0x70C2, 0xC0C3, + 0x70C3, 0xCCFE, 0x70C4, 0x9EEC, 0x70C5, 0x9EED, 0x70C6, 0x9EEE, 0x70C7, 0x9EEF, 0x70C8, 0xC1D2, 0x70C9, 0x9EF0, 0x70CA, 0xECC8, + 0x70CB, 0x9EF1, 0x70CC, 0x9EF2, 0x70CD, 0x9EF3, 0x70CE, 0x9EF4, 0x70CF, 0x9EF5, 0x70D0, 0x9EF6, 0x70D1, 0x9EF7, 0x70D2, 0x9EF8, + 0x70D3, 0x9EF9, 0x70D4, 0x9EFA, 0x70D5, 0x9EFB, 0x70D6, 0x9EFC, 0x70D7, 0x9EFD, 0x70D8, 0xBAE6, 0x70D9, 0xC0D3, 0x70DA, 0x9EFE, + 0x70DB, 0xD6F2, 0x70DC, 0x9F40, 0x70DD, 0x9F41, 0x70DE, 0x9F42, 0x70DF, 0xD1CC, 0x70E0, 0x9F43, 0x70E1, 0x9F44, 0x70E2, 0x9F45, + 0x70E3, 0x9F46, 0x70E4, 0xBFBE, 0x70E5, 0x9F47, 0x70E6, 0xB7B3, 0x70E7, 0xC9D5, 0x70E8, 0xECC7, 0x70E9, 0xBBE2, 0x70EA, 0x9F48, + 0x70EB, 0xCCCC, 0x70EC, 0xBDFD, 0x70ED, 0xC8C8, 0x70EE, 0x9F49, 0x70EF, 0xCFA9, 0x70F0, 0x9F4A, 0x70F1, 0x9F4B, 0x70F2, 0x9F4C, + 0x70F3, 0x9F4D, 0x70F4, 0x9F4E, 0x70F5, 0x9F4F, 0x70F6, 0x9F50, 0x70F7, 0xCDE9, 0x70F8, 0x9F51, 0x70F9, 0xC5EB, 0x70FA, 0x9F52, + 0x70FB, 0x9F53, 0x70FC, 0x9F54, 0x70FD, 0xB7E9, 0x70FE, 0x9F55, 0x70FF, 0x9F56, 0x7100, 0x9F57, 0x7101, 0x9F58, 0x7102, 0x9F59, + 0x7103, 0x9F5A, 0x7104, 0x9F5B, 0x7105, 0x9F5C, 0x7106, 0x9F5D, 0x7107, 0x9F5E, 0x7108, 0x9F5F, 0x7109, 0xD1C9, 0x710A, 0xBAB8, + 0x710B, 0x9F60, 0x710C, 0x9F61, 0x710D, 0x9F62, 0x710E, 0x9F63, 0x710F, 0x9F64, 0x7110, 0xECC9, 0x7111, 0x9F65, 0x7112, 0x9F66, + 0x7113, 0xECCA, 0x7114, 0x9F67, 0x7115, 0xBBC0, 0x7116, 0xECCB, 0x7117, 0x9F68, 0x7118, 0xECE2, 0x7119, 0xB1BA, 0x711A, 0xB7D9, + 0x711B, 0x9F69, 0x711C, 0x9F6A, 0x711D, 0x9F6B, 0x711E, 0x9F6C, 0x711F, 0x9F6D, 0x7120, 0x9F6E, 0x7121, 0x9F6F, 0x7122, 0x9F70, + 0x7123, 0x9F71, 0x7124, 0x9F72, 0x7125, 0x9F73, 0x7126, 0xBDB9, 0x7127, 0x9F74, 0x7128, 0x9F75, 0x7129, 0x9F76, 0x712A, 0x9F77, + 0x712B, 0x9F78, 0x712C, 0x9F79, 0x712D, 0x9F7A, 0x712E, 0x9F7B, 0x712F, 0xECCC, 0x7130, 0xD1E6, 0x7131, 0xECCD, 0x7132, 0x9F7C, + 0x7133, 0x9F7D, 0x7134, 0x9F7E, 0x7135, 0x9F80, 0x7136, 0xC8BB, 0x7137, 0x9F81, 0x7138, 0x9F82, 0x7139, 0x9F83, 0x713A, 0x9F84, + 0x713B, 0x9F85, 0x713C, 0x9F86, 0x713D, 0x9F87, 0x713E, 0x9F88, 0x713F, 0x9F89, 0x7140, 0x9F8A, 0x7141, 0x9F8B, 0x7142, 0x9F8C, + 0x7143, 0x9F8D, 0x7144, 0x9F8E, 0x7145, 0xECD1, 0x7146, 0x9F8F, 0x7147, 0x9F90, 0x7148, 0x9F91, 0x7149, 0x9F92, 0x714A, 0xECD3, + 0x714B, 0x9F93, 0x714C, 0xBBCD, 0x714D, 0x9F94, 0x714E, 0xBCE5, 0x714F, 0x9F95, 0x7150, 0x9F96, 0x7151, 0x9F97, 0x7152, 0x9F98, + 0x7153, 0x9F99, 0x7154, 0x9F9A, 0x7155, 0x9F9B, 0x7156, 0x9F9C, 0x7157, 0x9F9D, 0x7158, 0x9F9E, 0x7159, 0x9F9F, 0x715A, 0x9FA0, + 0x715B, 0x9FA1, 0x715C, 0xECCF, 0x715D, 0x9FA2, 0x715E, 0xC9B7, 0x715F, 0x9FA3, 0x7160, 0x9FA4, 0x7161, 0x9FA5, 0x7162, 0x9FA6, + 0x7163, 0x9FA7, 0x7164, 0xC3BA, 0x7165, 0x9FA8, 0x7166, 0xECE3, 0x7167, 0xD5D5, 0x7168, 0xECD0, 0x7169, 0x9FA9, 0x716A, 0x9FAA, + 0x716B, 0x9FAB, 0x716C, 0x9FAC, 0x716D, 0x9FAD, 0x716E, 0xD6F3, 0x716F, 0x9FAE, 0x7170, 0x9FAF, 0x7171, 0x9FB0, 0x7172, 0xECD2, + 0x7173, 0xECCE, 0x7174, 0x9FB1, 0x7175, 0x9FB2, 0x7176, 0x9FB3, 0x7177, 0x9FB4, 0x7178, 0xECD4, 0x7179, 0x9FB5, 0x717A, 0xECD5, + 0x717B, 0x9FB6, 0x717C, 0x9FB7, 0x717D, 0xC9BF, 0x717E, 0x9FB8, 0x717F, 0x9FB9, 0x7180, 0x9FBA, 0x7181, 0x9FBB, 0x7182, 0x9FBC, + 0x7183, 0x9FBD, 0x7184, 0xCFA8, 0x7185, 0x9FBE, 0x7186, 0x9FBF, 0x7187, 0x9FC0, 0x7188, 0x9FC1, 0x7189, 0x9FC2, 0x718A, 0xD0DC, + 0x718B, 0x9FC3, 0x718C, 0x9FC4, 0x718D, 0x9FC5, 0x718E, 0x9FC6, 0x718F, 0xD1AC, 0x7190, 0x9FC7, 0x7191, 0x9FC8, 0x7192, 0x9FC9, + 0x7193, 0x9FCA, 0x7194, 0xC8DB, 0x7195, 0x9FCB, 0x7196, 0x9FCC, 0x7197, 0x9FCD, 0x7198, 0xECD6, 0x7199, 0xCEF5, 0x719A, 0x9FCE, + 0x719B, 0x9FCF, 0x719C, 0x9FD0, 0x719D, 0x9FD1, 0x719E, 0x9FD2, 0x719F, 0xCAEC, 0x71A0, 0xECDA, 0x71A1, 0x9FD3, 0x71A2, 0x9FD4, + 0x71A3, 0x9FD5, 0x71A4, 0x9FD6, 0x71A5, 0x9FD7, 0x71A6, 0x9FD8, 0x71A7, 0x9FD9, 0x71A8, 0xECD9, 0x71A9, 0x9FDA, 0x71AA, 0x9FDB, + 0x71AB, 0x9FDC, 0x71AC, 0xB0BE, 0x71AD, 0x9FDD, 0x71AE, 0x9FDE, 0x71AF, 0x9FDF, 0x71B0, 0x9FE0, 0x71B1, 0x9FE1, 0x71B2, 0x9FE2, + 0x71B3, 0xECD7, 0x71B4, 0x9FE3, 0x71B5, 0xECD8, 0x71B6, 0x9FE4, 0x71B7, 0x9FE5, 0x71B8, 0x9FE6, 0x71B9, 0xECE4, 0x71BA, 0x9FE7, + 0x71BB, 0x9FE8, 0x71BC, 0x9FE9, 0x71BD, 0x9FEA, 0x71BE, 0x9FEB, 0x71BF, 0x9FEC, 0x71C0, 0x9FED, 0x71C1, 0x9FEE, 0x71C2, 0x9FEF, + 0x71C3, 0xC8BC, 0x71C4, 0x9FF0, 0x71C5, 0x9FF1, 0x71C6, 0x9FF2, 0x71C7, 0x9FF3, 0x71C8, 0x9FF4, 0x71C9, 0x9FF5, 0x71CA, 0x9FF6, + 0x71CB, 0x9FF7, 0x71CC, 0x9FF8, 0x71CD, 0x9FF9, 0x71CE, 0xC1C7, 0x71CF, 0x9FFA, 0x71D0, 0x9FFB, 0x71D1, 0x9FFC, 0x71D2, 0x9FFD, + 0x71D3, 0x9FFE, 0x71D4, 0xECDC, 0x71D5, 0xD1E0, 0x71D6, 0xA040, 0x71D7, 0xA041, 0x71D8, 0xA042, 0x71D9, 0xA043, 0x71DA, 0xA044, + 0x71DB, 0xA045, 0x71DC, 0xA046, 0x71DD, 0xA047, 0x71DE, 0xA048, 0x71DF, 0xA049, 0x71E0, 0xECDB, 0x71E1, 0xA04A, 0x71E2, 0xA04B, + 0x71E3, 0xA04C, 0x71E4, 0xA04D, 0x71E5, 0xD4EF, 0x71E6, 0xA04E, 0x71E7, 0xECDD, 0x71E8, 0xA04F, 0x71E9, 0xA050, 0x71EA, 0xA051, + 0x71EB, 0xA052, 0x71EC, 0xA053, 0x71ED, 0xA054, 0x71EE, 0xDBC6, 0x71EF, 0xA055, 0x71F0, 0xA056, 0x71F1, 0xA057, 0x71F2, 0xA058, + 0x71F3, 0xA059, 0x71F4, 0xA05A, 0x71F5, 0xA05B, 0x71F6, 0xA05C, 0x71F7, 0xA05D, 0x71F8, 0xA05E, 0x71F9, 0xECDE, 0x71FA, 0xA05F, + 0x71FB, 0xA060, 0x71FC, 0xA061, 0x71FD, 0xA062, 0x71FE, 0xA063, 0x71FF, 0xA064, 0x7200, 0xA065, 0x7201, 0xA066, 0x7202, 0xA067, + 0x7203, 0xA068, 0x7204, 0xA069, 0x7205, 0xA06A, 0x7206, 0xB1AC, 0x7207, 0xA06B, 0x7208, 0xA06C, 0x7209, 0xA06D, 0x720A, 0xA06E, + 0x720B, 0xA06F, 0x720C, 0xA070, 0x720D, 0xA071, 0x720E, 0xA072, 0x720F, 0xA073, 0x7210, 0xA074, 0x7211, 0xA075, 0x7212, 0xA076, + 0x7213, 0xA077, 0x7214, 0xA078, 0x7215, 0xA079, 0x7216, 0xA07A, 0x7217, 0xA07B, 0x7218, 0xA07C, 0x7219, 0xA07D, 0x721A, 0xA07E, + 0x721B, 0xA080, 0x721C, 0xA081, 0x721D, 0xECDF, 0x721E, 0xA082, 0x721F, 0xA083, 0x7220, 0xA084, 0x7221, 0xA085, 0x7222, 0xA086, + 0x7223, 0xA087, 0x7224, 0xA088, 0x7225, 0xA089, 0x7226, 0xA08A, 0x7227, 0xA08B, 0x7228, 0xECE0, 0x7229, 0xA08C, 0x722A, 0xD7A6, + 0x722B, 0xA08D, 0x722C, 0xC5C0, 0x722D, 0xA08E, 0x722E, 0xA08F, 0x722F, 0xA090, 0x7230, 0xEBBC, 0x7231, 0xB0AE, 0x7232, 0xA091, + 0x7233, 0xA092, 0x7234, 0xA093, 0x7235, 0xBEF4, 0x7236, 0xB8B8, 0x7237, 0xD2AF, 0x7238, 0xB0D6, 0x7239, 0xB5F9, 0x723A, 0xA094, + 0x723B, 0xD8B3, 0x723C, 0xA095, 0x723D, 0xCBAC, 0x723E, 0xA096, 0x723F, 0xE3DD, 0x7240, 0xA097, 0x7241, 0xA098, 0x7242, 0xA099, + 0x7243, 0xA09A, 0x7244, 0xA09B, 0x7245, 0xA09C, 0x7246, 0xA09D, 0x7247, 0xC6AC, 0x7248, 0xB0E6, 0x7249, 0xA09E, 0x724A, 0xA09F, + 0x724B, 0xA0A0, 0x724C, 0xC5C6, 0x724D, 0xEBB9, 0x724E, 0xA0A1, 0x724F, 0xA0A2, 0x7250, 0xA0A3, 0x7251, 0xA0A4, 0x7252, 0xEBBA, + 0x7253, 0xA0A5, 0x7254, 0xA0A6, 0x7255, 0xA0A7, 0x7256, 0xEBBB, 0x7257, 0xA0A8, 0x7258, 0xA0A9, 0x7259, 0xD1C0, 0x725A, 0xA0AA, + 0x725B, 0xC5A3, 0x725C, 0xA0AB, 0x725D, 0xEAF2, 0x725E, 0xA0AC, 0x725F, 0xC4B2, 0x7260, 0xA0AD, 0x7261, 0xC4B5, 0x7262, 0xC0CE, + 0x7263, 0xA0AE, 0x7264, 0xA0AF, 0x7265, 0xA0B0, 0x7266, 0xEAF3, 0x7267, 0xC4C1, 0x7268, 0xA0B1, 0x7269, 0xCEEF, 0x726A, 0xA0B2, + 0x726B, 0xA0B3, 0x726C, 0xA0B4, 0x726D, 0xA0B5, 0x726E, 0xEAF0, 0x726F, 0xEAF4, 0x7270, 0xA0B6, 0x7271, 0xA0B7, 0x7272, 0xC9FC, + 0x7273, 0xA0B8, 0x7274, 0xA0B9, 0x7275, 0xC7A3, 0x7276, 0xA0BA, 0x7277, 0xA0BB, 0x7278, 0xA0BC, 0x7279, 0xCCD8, 0x727A, 0xCEFE, + 0x727B, 0xA0BD, 0x727C, 0xA0BE, 0x727D, 0xA0BF, 0x727E, 0xEAF5, 0x727F, 0xEAF6, 0x7280, 0xCFAC, 0x7281, 0xC0E7, 0x7282, 0xA0C0, + 0x7283, 0xA0C1, 0x7284, 0xEAF7, 0x7285, 0xA0C2, 0x7286, 0xA0C3, 0x7287, 0xA0C4, 0x7288, 0xA0C5, 0x7289, 0xA0C6, 0x728A, 0xB6BF, + 0x728B, 0xEAF8, 0x728C, 0xA0C7, 0x728D, 0xEAF9, 0x728E, 0xA0C8, 0x728F, 0xEAFA, 0x7290, 0xA0C9, 0x7291, 0xA0CA, 0x7292, 0xEAFB, + 0x7293, 0xA0CB, 0x7294, 0xA0CC, 0x7295, 0xA0CD, 0x7296, 0xA0CE, 0x7297, 0xA0CF, 0x7298, 0xA0D0, 0x7299, 0xA0D1, 0x729A, 0xA0D2, + 0x729B, 0xA0D3, 0x729C, 0xA0D4, 0x729D, 0xA0D5, 0x729E, 0xA0D6, 0x729F, 0xEAF1, 0x72A0, 0xA0D7, 0x72A1, 0xA0D8, 0x72A2, 0xA0D9, + 0x72A3, 0xA0DA, 0x72A4, 0xA0DB, 0x72A5, 0xA0DC, 0x72A6, 0xA0DD, 0x72A7, 0xA0DE, 0x72A8, 0xA0DF, 0x72A9, 0xA0E0, 0x72AA, 0xA0E1, + 0x72AB, 0xA0E2, 0x72AC, 0xC8AE, 0x72AD, 0xE1EB, 0x72AE, 0xA0E3, 0x72AF, 0xB7B8, 0x72B0, 0xE1EC, 0x72B1, 0xA0E4, 0x72B2, 0xA0E5, + 0x72B3, 0xA0E6, 0x72B4, 0xE1ED, 0x72B5, 0xA0E7, 0x72B6, 0xD7B4, 0x72B7, 0xE1EE, 0x72B8, 0xE1EF, 0x72B9, 0xD3CC, 0x72BA, 0xA0E8, + 0x72BB, 0xA0E9, 0x72BC, 0xA0EA, 0x72BD, 0xA0EB, 0x72BE, 0xA0EC, 0x72BF, 0xA0ED, 0x72C0, 0xA0EE, 0x72C1, 0xE1F1, 0x72C2, 0xBFF1, + 0x72C3, 0xE1F0, 0x72C4, 0xB5D2, 0x72C5, 0xA0EF, 0x72C6, 0xA0F0, 0x72C7, 0xA0F1, 0x72C8, 0xB1B7, 0x72C9, 0xA0F2, 0x72CA, 0xA0F3, + 0x72CB, 0xA0F4, 0x72CC, 0xA0F5, 0x72CD, 0xE1F3, 0x72CE, 0xE1F2, 0x72CF, 0xA0F6, 0x72D0, 0xBAFC, 0x72D1, 0xA0F7, 0x72D2, 0xE1F4, + 0x72D3, 0xA0F8, 0x72D4, 0xA0F9, 0x72D5, 0xA0FA, 0x72D6, 0xA0FB, 0x72D7, 0xB9B7, 0x72D8, 0xA0FC, 0x72D9, 0xBED1, 0x72DA, 0xA0FD, + 0x72DB, 0xA0FE, 0x72DC, 0xAA40, 0x72DD, 0xAA41, 0x72DE, 0xC4FC, 0x72DF, 0xAA42, 0x72E0, 0xBADD, 0x72E1, 0xBDC6, 0x72E2, 0xAA43, + 0x72E3, 0xAA44, 0x72E4, 0xAA45, 0x72E5, 0xAA46, 0x72E6, 0xAA47, 0x72E7, 0xAA48, 0x72E8, 0xE1F5, 0x72E9, 0xE1F7, 0x72EA, 0xAA49, + 0x72EB, 0xAA4A, 0x72EC, 0xB6C0, 0x72ED, 0xCFC1, 0x72EE, 0xCAA8, 0x72EF, 0xE1F6, 0x72F0, 0xD5F8, 0x72F1, 0xD3FC, 0x72F2, 0xE1F8, + 0x72F3, 0xE1FC, 0x72F4, 0xE1F9, 0x72F5, 0xAA4B, 0x72F6, 0xAA4C, 0x72F7, 0xE1FA, 0x72F8, 0xC0EA, 0x72F9, 0xAA4D, 0x72FA, 0xE1FE, + 0x72FB, 0xE2A1, 0x72FC, 0xC0C7, 0x72FD, 0xAA4E, 0x72FE, 0xAA4F, 0x72FF, 0xAA50, 0x7300, 0xAA51, 0x7301, 0xE1FB, 0x7302, 0xAA52, + 0x7303, 0xE1FD, 0x7304, 0xAA53, 0x7305, 0xAA54, 0x7306, 0xAA55, 0x7307, 0xAA56, 0x7308, 0xAA57, 0x7309, 0xAA58, 0x730A, 0xE2A5, + 0x730B, 0xAA59, 0x730C, 0xAA5A, 0x730D, 0xAA5B, 0x730E, 0xC1D4, 0x730F, 0xAA5C, 0x7310, 0xAA5D, 0x7311, 0xAA5E, 0x7312, 0xAA5F, + 0x7313, 0xE2A3, 0x7314, 0xAA60, 0x7315, 0xE2A8, 0x7316, 0xB2FE, 0x7317, 0xE2A2, 0x7318, 0xAA61, 0x7319, 0xAA62, 0x731A, 0xAA63, + 0x731B, 0xC3CD, 0x731C, 0xB2C2, 0x731D, 0xE2A7, 0x731E, 0xE2A6, 0x731F, 0xAA64, 0x7320, 0xAA65, 0x7321, 0xE2A4, 0x7322, 0xE2A9, + 0x7323, 0xAA66, 0x7324, 0xAA67, 0x7325, 0xE2AB, 0x7326, 0xAA68, 0x7327, 0xAA69, 0x7328, 0xAA6A, 0x7329, 0xD0C9, 0x732A, 0xD6ED, + 0x732B, 0xC3A8, 0x732C, 0xE2AC, 0x732D, 0xAA6B, 0x732E, 0xCFD7, 0x732F, 0xAA6C, 0x7330, 0xAA6D, 0x7331, 0xE2AE, 0x7332, 0xAA6E, + 0x7333, 0xAA6F, 0x7334, 0xBAEF, 0x7335, 0xAA70, 0x7336, 0xAA71, 0x7337, 0xE9E0, 0x7338, 0xE2AD, 0x7339, 0xE2AA, 0x733A, 0xAA72, + 0x733B, 0xAA73, 0x733C, 0xAA74, 0x733D, 0xAA75, 0x733E, 0xBBAB, 0x733F, 0xD4B3, 0x7340, 0xAA76, 0x7341, 0xAA77, 0x7342, 0xAA78, + 0x7343, 0xAA79, 0x7344, 0xAA7A, 0x7345, 0xAA7B, 0x7346, 0xAA7C, 0x7347, 0xAA7D, 0x7348, 0xAA7E, 0x7349, 0xAA80, 0x734A, 0xAA81, + 0x734B, 0xAA82, 0x734C, 0xAA83, 0x734D, 0xE2B0, 0x734E, 0xAA84, 0x734F, 0xAA85, 0x7350, 0xE2AF, 0x7351, 0xAA86, 0x7352, 0xE9E1, + 0x7353, 0xAA87, 0x7354, 0xAA88, 0x7355, 0xAA89, 0x7356, 0xAA8A, 0x7357, 0xE2B1, 0x7358, 0xAA8B, 0x7359, 0xAA8C, 0x735A, 0xAA8D, + 0x735B, 0xAA8E, 0x735C, 0xAA8F, 0x735D, 0xAA90, 0x735E, 0xAA91, 0x735F, 0xAA92, 0x7360, 0xE2B2, 0x7361, 0xAA93, 0x7362, 0xAA94, + 0x7363, 0xAA95, 0x7364, 0xAA96, 0x7365, 0xAA97, 0x7366, 0xAA98, 0x7367, 0xAA99, 0x7368, 0xAA9A, 0x7369, 0xAA9B, 0x736A, 0xAA9C, + 0x736B, 0xAA9D, 0x736C, 0xE2B3, 0x736D, 0xCCA1, 0x736E, 0xAA9E, 0x736F, 0xE2B4, 0x7370, 0xAA9F, 0x7371, 0xAAA0, 0x7372, 0xAB40, + 0x7373, 0xAB41, 0x7374, 0xAB42, 0x7375, 0xAB43, 0x7376, 0xAB44, 0x7377, 0xAB45, 0x7378, 0xAB46, 0x7379, 0xAB47, 0x737A, 0xAB48, + 0x737B, 0xAB49, 0x737C, 0xAB4A, 0x737D, 0xAB4B, 0x737E, 0xE2B5, 0x737F, 0xAB4C, 0x7380, 0xAB4D, 0x7381, 0xAB4E, 0x7382, 0xAB4F, + 0x7383, 0xAB50, 0x7384, 0xD0FE, 0x7385, 0xAB51, 0x7386, 0xAB52, 0x7387, 0xC2CA, 0x7388, 0xAB53, 0x7389, 0xD3F1, 0x738A, 0xAB54, + 0x738B, 0xCDF5, 0x738C, 0xAB55, 0x738D, 0xAB56, 0x738E, 0xE7E0, 0x738F, 0xAB57, 0x7390, 0xAB58, 0x7391, 0xE7E1, 0x7392, 0xAB59, + 0x7393, 0xAB5A, 0x7394, 0xAB5B, 0x7395, 0xAB5C, 0x7396, 0xBEC1, 0x7397, 0xAB5D, 0x7398, 0xAB5E, 0x7399, 0xAB5F, 0x739A, 0xAB60, + 0x739B, 0xC2EA, 0x739C, 0xAB61, 0x739D, 0xAB62, 0x739E, 0xAB63, 0x739F, 0xE7E4, 0x73A0, 0xAB64, 0x73A1, 0xAB65, 0x73A2, 0xE7E3, + 0x73A3, 0xAB66, 0x73A4, 0xAB67, 0x73A5, 0xAB68, 0x73A6, 0xAB69, 0x73A7, 0xAB6A, 0x73A8, 0xAB6B, 0x73A9, 0xCDE6, 0x73AA, 0xAB6C, + 0x73AB, 0xC3B5, 0x73AC, 0xAB6D, 0x73AD, 0xAB6E, 0x73AE, 0xE7E2, 0x73AF, 0xBBB7, 0x73B0, 0xCFD6, 0x73B1, 0xAB6F, 0x73B2, 0xC1E1, + 0x73B3, 0xE7E9, 0x73B4, 0xAB70, 0x73B5, 0xAB71, 0x73B6, 0xAB72, 0x73B7, 0xE7E8, 0x73B8, 0xAB73, 0x73B9, 0xAB74, 0x73BA, 0xE7F4, + 0x73BB, 0xB2A3, 0x73BC, 0xAB75, 0x73BD, 0xAB76, 0x73BE, 0xAB77, 0x73BF, 0xAB78, 0x73C0, 0xE7EA, 0x73C1, 0xAB79, 0x73C2, 0xE7E6, + 0x73C3, 0xAB7A, 0x73C4, 0xAB7B, 0x73C5, 0xAB7C, 0x73C6, 0xAB7D, 0x73C7, 0xAB7E, 0x73C8, 0xE7EC, 0x73C9, 0xE7EB, 0x73CA, 0xC9BA, + 0x73CB, 0xAB80, 0x73CC, 0xAB81, 0x73CD, 0xD5E4, 0x73CE, 0xAB82, 0x73CF, 0xE7E5, 0x73D0, 0xB7A9, 0x73D1, 0xE7E7, 0x73D2, 0xAB83, + 0x73D3, 0xAB84, 0x73D4, 0xAB85, 0x73D5, 0xAB86, 0x73D6, 0xAB87, 0x73D7, 0xAB88, 0x73D8, 0xAB89, 0x73D9, 0xE7EE, 0x73DA, 0xAB8A, + 0x73DB, 0xAB8B, 0x73DC, 0xAB8C, 0x73DD, 0xAB8D, 0x73DE, 0xE7F3, 0x73DF, 0xAB8E, 0x73E0, 0xD6E9, 0x73E1, 0xAB8F, 0x73E2, 0xAB90, + 0x73E3, 0xAB91, 0x73E4, 0xAB92, 0x73E5, 0xE7ED, 0x73E6, 0xAB93, 0x73E7, 0xE7F2, 0x73E8, 0xAB94, 0x73E9, 0xE7F1, 0x73EA, 0xAB95, + 0x73EB, 0xAB96, 0x73EC, 0xAB97, 0x73ED, 0xB0E0, 0x73EE, 0xAB98, 0x73EF, 0xAB99, 0x73F0, 0xAB9A, 0x73F1, 0xAB9B, 0x73F2, 0xE7F5, + 0x73F3, 0xAB9C, 0x73F4, 0xAB9D, 0x73F5, 0xAB9E, 0x73F6, 0xAB9F, 0x73F7, 0xABA0, 0x73F8, 0xAC40, 0x73F9, 0xAC41, 0x73FA, 0xAC42, + 0x73FB, 0xAC43, 0x73FC, 0xAC44, 0x73FD, 0xAC45, 0x73FE, 0xAC46, 0x73FF, 0xAC47, 0x7400, 0xAC48, 0x7401, 0xAC49, 0x7402, 0xAC4A, + 0x7403, 0xC7F2, 0x7404, 0xAC4B, 0x7405, 0xC0C5, 0x7406, 0xC0ED, 0x7407, 0xAC4C, 0x7408, 0xAC4D, 0x7409, 0xC1F0, 0x740A, 0xE7F0, + 0x740B, 0xAC4E, 0x740C, 0xAC4F, 0x740D, 0xAC50, 0x740E, 0xAC51, 0x740F, 0xE7F6, 0x7410, 0xCBF6, 0x7411, 0xAC52, 0x7412, 0xAC53, + 0x7413, 0xAC54, 0x7414, 0xAC55, 0x7415, 0xAC56, 0x7416, 0xAC57, 0x7417, 0xAC58, 0x7418, 0xAC59, 0x7419, 0xAC5A, 0x741A, 0xE8A2, + 0x741B, 0xE8A1, 0x741C, 0xAC5B, 0x741D, 0xAC5C, 0x741E, 0xAC5D, 0x741F, 0xAC5E, 0x7420, 0xAC5F, 0x7421, 0xAC60, 0x7422, 0xD7C1, + 0x7423, 0xAC61, 0x7424, 0xAC62, 0x7425, 0xE7FA, 0x7426, 0xE7F9, 0x7427, 0xAC63, 0x7428, 0xE7FB, 0x7429, 0xAC64, 0x742A, 0xE7F7, + 0x742B, 0xAC65, 0x742C, 0xE7FE, 0x742D, 0xAC66, 0x742E, 0xE7FD, 0x742F, 0xAC67, 0x7430, 0xE7FC, 0x7431, 0xAC68, 0x7432, 0xAC69, + 0x7433, 0xC1D5, 0x7434, 0xC7D9, 0x7435, 0xC5FD, 0x7436, 0xC5C3, 0x7437, 0xAC6A, 0x7438, 0xAC6B, 0x7439, 0xAC6C, 0x743A, 0xAC6D, + 0x743B, 0xAC6E, 0x743C, 0xC7ED, 0x743D, 0xAC6F, 0x743E, 0xAC70, 0x743F, 0xAC71, 0x7440, 0xAC72, 0x7441, 0xE8A3, 0x7442, 0xAC73, + 0x7443, 0xAC74, 0x7444, 0xAC75, 0x7445, 0xAC76, 0x7446, 0xAC77, 0x7447, 0xAC78, 0x7448, 0xAC79, 0x7449, 0xAC7A, 0x744A, 0xAC7B, + 0x744B, 0xAC7C, 0x744C, 0xAC7D, 0x744D, 0xAC7E, 0x744E, 0xAC80, 0x744F, 0xAC81, 0x7450, 0xAC82, 0x7451, 0xAC83, 0x7452, 0xAC84, + 0x7453, 0xAC85, 0x7454, 0xAC86, 0x7455, 0xE8A6, 0x7456, 0xAC87, 0x7457, 0xE8A5, 0x7458, 0xAC88, 0x7459, 0xE8A7, 0x745A, 0xBAF7, + 0x745B, 0xE7F8, 0x745C, 0xE8A4, 0x745D, 0xAC89, 0x745E, 0xC8F0, 0x745F, 0xC9AA, 0x7460, 0xAC8A, 0x7461, 0xAC8B, 0x7462, 0xAC8C, + 0x7463, 0xAC8D, 0x7464, 0xAC8E, 0x7465, 0xAC8F, 0x7466, 0xAC90, 0x7467, 0xAC91, 0x7468, 0xAC92, 0x7469, 0xAC93, 0x746A, 0xAC94, + 0x746B, 0xAC95, 0x746C, 0xAC96, 0x746D, 0xE8A9, 0x746E, 0xAC97, 0x746F, 0xAC98, 0x7470, 0xB9E5, 0x7471, 0xAC99, 0x7472, 0xAC9A, + 0x7473, 0xAC9B, 0x7474, 0xAC9C, 0x7475, 0xAC9D, 0x7476, 0xD1FE, 0x7477, 0xE8A8, 0x7478, 0xAC9E, 0x7479, 0xAC9F, 0x747A, 0xACA0, + 0x747B, 0xAD40, 0x747C, 0xAD41, 0x747D, 0xAD42, 0x747E, 0xE8AA, 0x747F, 0xAD43, 0x7480, 0xE8AD, 0x7481, 0xE8AE, 0x7482, 0xAD44, + 0x7483, 0xC1A7, 0x7484, 0xAD45, 0x7485, 0xAD46, 0x7486, 0xAD47, 0x7487, 0xE8AF, 0x7488, 0xAD48, 0x7489, 0xAD49, 0x748A, 0xAD4A, + 0x748B, 0xE8B0, 0x748C, 0xAD4B, 0x748D, 0xAD4C, 0x748E, 0xE8AC, 0x748F, 0xAD4D, 0x7490, 0xE8B4, 0x7491, 0xAD4E, 0x7492, 0xAD4F, + 0x7493, 0xAD50, 0x7494, 0xAD51, 0x7495, 0xAD52, 0x7496, 0xAD53, 0x7497, 0xAD54, 0x7498, 0xAD55, 0x7499, 0xAD56, 0x749A, 0xAD57, + 0x749B, 0xAD58, 0x749C, 0xE8AB, 0x749D, 0xAD59, 0x749E, 0xE8B1, 0x749F, 0xAD5A, 0x74A0, 0xAD5B, 0x74A1, 0xAD5C, 0x74A2, 0xAD5D, + 0x74A3, 0xAD5E, 0x74A4, 0xAD5F, 0x74A5, 0xAD60, 0x74A6, 0xAD61, 0x74A7, 0xE8B5, 0x74A8, 0xE8B2, 0x74A9, 0xE8B3, 0x74AA, 0xAD62, + 0x74AB, 0xAD63, 0x74AC, 0xAD64, 0x74AD, 0xAD65, 0x74AE, 0xAD66, 0x74AF, 0xAD67, 0x74B0, 0xAD68, 0x74B1, 0xAD69, 0x74B2, 0xAD6A, + 0x74B3, 0xAD6B, 0x74B4, 0xAD6C, 0x74B5, 0xAD6D, 0x74B6, 0xAD6E, 0x74B7, 0xAD6F, 0x74B8, 0xAD70, 0x74B9, 0xAD71, 0x74BA, 0xE8B7, + 0x74BB, 0xAD72, 0x74BC, 0xAD73, 0x74BD, 0xAD74, 0x74BE, 0xAD75, 0x74BF, 0xAD76, 0x74C0, 0xAD77, 0x74C1, 0xAD78, 0x74C2, 0xAD79, + 0x74C3, 0xAD7A, 0x74C4, 0xAD7B, 0x74C5, 0xAD7C, 0x74C6, 0xAD7D, 0x74C7, 0xAD7E, 0x74C8, 0xAD80, 0x74C9, 0xAD81, 0x74CA, 0xAD82, + 0x74CB, 0xAD83, 0x74CC, 0xAD84, 0x74CD, 0xAD85, 0x74CE, 0xAD86, 0x74CF, 0xAD87, 0x74D0, 0xAD88, 0x74D1, 0xAD89, 0x74D2, 0xE8B6, + 0x74D3, 0xAD8A, 0x74D4, 0xAD8B, 0x74D5, 0xAD8C, 0x74D6, 0xAD8D, 0x74D7, 0xAD8E, 0x74D8, 0xAD8F, 0x74D9, 0xAD90, 0x74DA, 0xAD91, + 0x74DB, 0xAD92, 0x74DC, 0xB9CF, 0x74DD, 0xAD93, 0x74DE, 0xF0AC, 0x74DF, 0xAD94, 0x74E0, 0xF0AD, 0x74E1, 0xAD95, 0x74E2, 0xC6B0, + 0x74E3, 0xB0EA, 0x74E4, 0xC8BF, 0x74E5, 0xAD96, 0x74E6, 0xCDDF, 0x74E7, 0xAD97, 0x74E8, 0xAD98, 0x74E9, 0xAD99, 0x74EA, 0xAD9A, + 0x74EB, 0xAD9B, 0x74EC, 0xAD9C, 0x74ED, 0xAD9D, 0x74EE, 0xCECD, 0x74EF, 0xEAB1, 0x74F0, 0xAD9E, 0x74F1, 0xAD9F, 0x74F2, 0xADA0, + 0x74F3, 0xAE40, 0x74F4, 0xEAB2, 0x74F5, 0xAE41, 0x74F6, 0xC6BF, 0x74F7, 0xB4C9, 0x74F8, 0xAE42, 0x74F9, 0xAE43, 0x74FA, 0xAE44, + 0x74FB, 0xAE45, 0x74FC, 0xAE46, 0x74FD, 0xAE47, 0x74FE, 0xAE48, 0x74FF, 0xEAB3, 0x7500, 0xAE49, 0x7501, 0xAE4A, 0x7502, 0xAE4B, + 0x7503, 0xAE4C, 0x7504, 0xD5E7, 0x7505, 0xAE4D, 0x7506, 0xAE4E, 0x7507, 0xAE4F, 0x7508, 0xAE50, 0x7509, 0xAE51, 0x750A, 0xAE52, + 0x750B, 0xAE53, 0x750C, 0xAE54, 0x750D, 0xDDF9, 0x750E, 0xAE55, 0x750F, 0xEAB4, 0x7510, 0xAE56, 0x7511, 0xEAB5, 0x7512, 0xAE57, + 0x7513, 0xEAB6, 0x7514, 0xAE58, 0x7515, 0xAE59, 0x7516, 0xAE5A, 0x7517, 0xAE5B, 0x7518, 0xB8CA, 0x7519, 0xDFB0, 0x751A, 0xC9F5, + 0x751B, 0xAE5C, 0x751C, 0xCCF0, 0x751D, 0xAE5D, 0x751E, 0xAE5E, 0x751F, 0xC9FA, 0x7520, 0xAE5F, 0x7521, 0xAE60, 0x7522, 0xAE61, + 0x7523, 0xAE62, 0x7524, 0xAE63, 0x7525, 0xC9FB, 0x7526, 0xAE64, 0x7527, 0xAE65, 0x7528, 0xD3C3, 0x7529, 0xCBA6, 0x752A, 0xAE66, + 0x752B, 0xB8A6, 0x752C, 0xF0AE, 0x752D, 0xB1C2, 0x752E, 0xAE67, 0x752F, 0xE5B8, 0x7530, 0xCCEF, 0x7531, 0xD3C9, 0x7532, 0xBCD7, + 0x7533, 0xC9EA, 0x7534, 0xAE68, 0x7535, 0xB5E7, 0x7536, 0xAE69, 0x7537, 0xC4D0, 0x7538, 0xB5E9, 0x7539, 0xAE6A, 0x753A, 0xEEAE, + 0x753B, 0xBBAD, 0x753C, 0xAE6B, 0x753D, 0xAE6C, 0x753E, 0xE7DE, 0x753F, 0xAE6D, 0x7540, 0xEEAF, 0x7541, 0xAE6E, 0x7542, 0xAE6F, + 0x7543, 0xAE70, 0x7544, 0xAE71, 0x7545, 0xB3A9, 0x7546, 0xAE72, 0x7547, 0xAE73, 0x7548, 0xEEB2, 0x7549, 0xAE74, 0x754A, 0xAE75, + 0x754B, 0xEEB1, 0x754C, 0xBDE7, 0x754D, 0xAE76, 0x754E, 0xEEB0, 0x754F, 0xCEB7, 0x7550, 0xAE77, 0x7551, 0xAE78, 0x7552, 0xAE79, + 0x7553, 0xAE7A, 0x7554, 0xC5CF, 0x7555, 0xAE7B, 0x7556, 0xAE7C, 0x7557, 0xAE7D, 0x7558, 0xAE7E, 0x7559, 0xC1F4, 0x755A, 0xDBCE, + 0x755B, 0xEEB3, 0x755C, 0xD0F3, 0x755D, 0xAE80, 0x755E, 0xAE81, 0x755F, 0xAE82, 0x7560, 0xAE83, 0x7561, 0xAE84, 0x7562, 0xAE85, + 0x7563, 0xAE86, 0x7564, 0xAE87, 0x7565, 0xC2D4, 0x7566, 0xC6E8, 0x7567, 0xAE88, 0x7568, 0xAE89, 0x7569, 0xAE8A, 0x756A, 0xB7AC, + 0x756B, 0xAE8B, 0x756C, 0xAE8C, 0x756D, 0xAE8D, 0x756E, 0xAE8E, 0x756F, 0xAE8F, 0x7570, 0xAE90, 0x7571, 0xAE91, 0x7572, 0xEEB4, + 0x7573, 0xAE92, 0x7574, 0xB3EB, 0x7575, 0xAE93, 0x7576, 0xAE94, 0x7577, 0xAE95, 0x7578, 0xBBFB, 0x7579, 0xEEB5, 0x757A, 0xAE96, + 0x757B, 0xAE97, 0x757C, 0xAE98, 0x757D, 0xAE99, 0x757E, 0xAE9A, 0x757F, 0xE7DC, 0x7580, 0xAE9B, 0x7581, 0xAE9C, 0x7582, 0xAE9D, + 0x7583, 0xEEB6, 0x7584, 0xAE9E, 0x7585, 0xAE9F, 0x7586, 0xBDAE, 0x7587, 0xAEA0, 0x7588, 0xAF40, 0x7589, 0xAF41, 0x758A, 0xAF42, + 0x758B, 0xF1E2, 0x758C, 0xAF43, 0x758D, 0xAF44, 0x758E, 0xAF45, 0x758F, 0xCAE8, 0x7590, 0xAF46, 0x7591, 0xD2C9, 0x7592, 0xF0DA, + 0x7593, 0xAF47, 0x7594, 0xF0DB, 0x7595, 0xAF48, 0x7596, 0xF0DC, 0x7597, 0xC1C6, 0x7598, 0xAF49, 0x7599, 0xB8ED, 0x759A, 0xBECE, + 0x759B, 0xAF4A, 0x759C, 0xAF4B, 0x759D, 0xF0DE, 0x759E, 0xAF4C, 0x759F, 0xC5B1, 0x75A0, 0xF0DD, 0x75A1, 0xD1F1, 0x75A2, 0xAF4D, + 0x75A3, 0xF0E0, 0x75A4, 0xB0CC, 0x75A5, 0xBDEA, 0x75A6, 0xAF4E, 0x75A7, 0xAF4F, 0x75A8, 0xAF50, 0x75A9, 0xAF51, 0x75AA, 0xAF52, + 0x75AB, 0xD2DF, 0x75AC, 0xF0DF, 0x75AD, 0xAF53, 0x75AE, 0xB4AF, 0x75AF, 0xB7E8, 0x75B0, 0xF0E6, 0x75B1, 0xF0E5, 0x75B2, 0xC6A3, + 0x75B3, 0xF0E1, 0x75B4, 0xF0E2, 0x75B5, 0xB4C3, 0x75B6, 0xAF54, 0x75B7, 0xAF55, 0x75B8, 0xF0E3, 0x75B9, 0xD5EE, 0x75BA, 0xAF56, + 0x75BB, 0xAF57, 0x75BC, 0xCCDB, 0x75BD, 0xBED2, 0x75BE, 0xBCB2, 0x75BF, 0xAF58, 0x75C0, 0xAF59, 0x75C1, 0xAF5A, 0x75C2, 0xF0E8, + 0x75C3, 0xF0E7, 0x75C4, 0xF0E4, 0x75C5, 0xB2A1, 0x75C6, 0xAF5B, 0x75C7, 0xD6A2, 0x75C8, 0xD3B8, 0x75C9, 0xBEB7, 0x75CA, 0xC8AC, + 0x75CB, 0xAF5C, 0x75CC, 0xAF5D, 0x75CD, 0xF0EA, 0x75CE, 0xAF5E, 0x75CF, 0xAF5F, 0x75D0, 0xAF60, 0x75D1, 0xAF61, 0x75D2, 0xD1F7, + 0x75D3, 0xAF62, 0x75D4, 0xD6CC, 0x75D5, 0xBADB, 0x75D6, 0xF0E9, 0x75D7, 0xAF63, 0x75D8, 0xB6BB, 0x75D9, 0xAF64, 0x75DA, 0xAF65, + 0x75DB, 0xCDB4, 0x75DC, 0xAF66, 0x75DD, 0xAF67, 0x75DE, 0xC6A6, 0x75DF, 0xAF68, 0x75E0, 0xAF69, 0x75E1, 0xAF6A, 0x75E2, 0xC1A1, + 0x75E3, 0xF0EB, 0x75E4, 0xF0EE, 0x75E5, 0xAF6B, 0x75E6, 0xF0ED, 0x75E7, 0xF0F0, 0x75E8, 0xF0EC, 0x75E9, 0xAF6C, 0x75EA, 0xBBBE, + 0x75EB, 0xF0EF, 0x75EC, 0xAF6D, 0x75ED, 0xAF6E, 0x75EE, 0xAF6F, 0x75EF, 0xAF70, 0x75F0, 0xCCB5, 0x75F1, 0xF0F2, 0x75F2, 0xAF71, + 0x75F3, 0xAF72, 0x75F4, 0xB3D5, 0x75F5, 0xAF73, 0x75F6, 0xAF74, 0x75F7, 0xAF75, 0x75F8, 0xAF76, 0x75F9, 0xB1D4, 0x75FA, 0xAF77, + 0x75FB, 0xAF78, 0x75FC, 0xF0F3, 0x75FD, 0xAF79, 0x75FE, 0xAF7A, 0x75FF, 0xF0F4, 0x7600, 0xF0F6, 0x7601, 0xB4E1, 0x7602, 0xAF7B, + 0x7603, 0xF0F1, 0x7604, 0xAF7C, 0x7605, 0xF0F7, 0x7606, 0xAF7D, 0x7607, 0xAF7E, 0x7608, 0xAF80, 0x7609, 0xAF81, 0x760A, 0xF0FA, + 0x760B, 0xAF82, 0x760C, 0xF0F8, 0x760D, 0xAF83, 0x760E, 0xAF84, 0x760F, 0xAF85, 0x7610, 0xF0F5, 0x7611, 0xAF86, 0x7612, 0xAF87, + 0x7613, 0xAF88, 0x7614, 0xAF89, 0x7615, 0xF0FD, 0x7616, 0xAF8A, 0x7617, 0xF0F9, 0x7618, 0xF0FC, 0x7619, 0xF0FE, 0x761A, 0xAF8B, + 0x761B, 0xF1A1, 0x761C, 0xAF8C, 0x761D, 0xAF8D, 0x761E, 0xAF8E, 0x761F, 0xCEC1, 0x7620, 0xF1A4, 0x7621, 0xAF8F, 0x7622, 0xF1A3, + 0x7623, 0xAF90, 0x7624, 0xC1F6, 0x7625, 0xF0FB, 0x7626, 0xCADD, 0x7627, 0xAF91, 0x7628, 0xAF92, 0x7629, 0xB4F1, 0x762A, 0xB1F1, + 0x762B, 0xCCB1, 0x762C, 0xAF93, 0x762D, 0xF1A6, 0x762E, 0xAF94, 0x762F, 0xAF95, 0x7630, 0xF1A7, 0x7631, 0xAF96, 0x7632, 0xAF97, + 0x7633, 0xF1AC, 0x7634, 0xD5CE, 0x7635, 0xF1A9, 0x7636, 0xAF98, 0x7637, 0xAF99, 0x7638, 0xC8B3, 0x7639, 0xAF9A, 0x763A, 0xAF9B, + 0x763B, 0xAF9C, 0x763C, 0xF1A2, 0x763D, 0xAF9D, 0x763E, 0xF1AB, 0x763F, 0xF1A8, 0x7640, 0xF1A5, 0x7641, 0xAF9E, 0x7642, 0xAF9F, + 0x7643, 0xF1AA, 0x7644, 0xAFA0, 0x7645, 0xB040, 0x7646, 0xB041, 0x7647, 0xB042, 0x7648, 0xB043, 0x7649, 0xB044, 0x764A, 0xB045, + 0x764B, 0xB046, 0x764C, 0xB0A9, 0x764D, 0xF1AD, 0x764E, 0xB047, 0x764F, 0xB048, 0x7650, 0xB049, 0x7651, 0xB04A, 0x7652, 0xB04B, + 0x7653, 0xB04C, 0x7654, 0xF1AF, 0x7655, 0xB04D, 0x7656, 0xF1B1, 0x7657, 0xB04E, 0x7658, 0xB04F, 0x7659, 0xB050, 0x765A, 0xB051, + 0x765B, 0xB052, 0x765C, 0xF1B0, 0x765D, 0xB053, 0x765E, 0xF1AE, 0x765F, 0xB054, 0x7660, 0xB055, 0x7661, 0xB056, 0x7662, 0xB057, + 0x7663, 0xD1A2, 0x7664, 0xB058, 0x7665, 0xB059, 0x7666, 0xB05A, 0x7667, 0xB05B, 0x7668, 0xB05C, 0x7669, 0xB05D, 0x766A, 0xB05E, + 0x766B, 0xF1B2, 0x766C, 0xB05F, 0x766D, 0xB060, 0x766E, 0xB061, 0x766F, 0xF1B3, 0x7670, 0xB062, 0x7671, 0xB063, 0x7672, 0xB064, + 0x7673, 0xB065, 0x7674, 0xB066, 0x7675, 0xB067, 0x7676, 0xB068, 0x7677, 0xB069, 0x7678, 0xB9EF, 0x7679, 0xB06A, 0x767A, 0xB06B, + 0x767B, 0xB5C7, 0x767C, 0xB06C, 0x767D, 0xB0D7, 0x767E, 0xB0D9, 0x767F, 0xB06D, 0x7680, 0xB06E, 0x7681, 0xB06F, 0x7682, 0xD4ED, + 0x7683, 0xB070, 0x7684, 0xB5C4, 0x7685, 0xB071, 0x7686, 0xBDD4, 0x7687, 0xBBCA, 0x7688, 0xF0A7, 0x7689, 0xB072, 0x768A, 0xB073, + 0x768B, 0xB8DE, 0x768C, 0xB074, 0x768D, 0xB075, 0x768E, 0xF0A8, 0x768F, 0xB076, 0x7690, 0xB077, 0x7691, 0xB0A8, 0x7692, 0xB078, + 0x7693, 0xF0A9, 0x7694, 0xB079, 0x7695, 0xB07A, 0x7696, 0xCDEE, 0x7697, 0xB07B, 0x7698, 0xB07C, 0x7699, 0xF0AA, 0x769A, 0xB07D, + 0x769B, 0xB07E, 0x769C, 0xB080, 0x769D, 0xB081, 0x769E, 0xB082, 0x769F, 0xB083, 0x76A0, 0xB084, 0x76A1, 0xB085, 0x76A2, 0xB086, + 0x76A3, 0xB087, 0x76A4, 0xF0AB, 0x76A5, 0xB088, 0x76A6, 0xB089, 0x76A7, 0xB08A, 0x76A8, 0xB08B, 0x76A9, 0xB08C, 0x76AA, 0xB08D, + 0x76AB, 0xB08E, 0x76AC, 0xB08F, 0x76AD, 0xB090, 0x76AE, 0xC6A4, 0x76AF, 0xB091, 0x76B0, 0xB092, 0x76B1, 0xD6E5, 0x76B2, 0xF1E4, + 0x76B3, 0xB093, 0x76B4, 0xF1E5, 0x76B5, 0xB094, 0x76B6, 0xB095, 0x76B7, 0xB096, 0x76B8, 0xB097, 0x76B9, 0xB098, 0x76BA, 0xB099, + 0x76BB, 0xB09A, 0x76BC, 0xB09B, 0x76BD, 0xB09C, 0x76BE, 0xB09D, 0x76BF, 0xC3F3, 0x76C0, 0xB09E, 0x76C1, 0xB09F, 0x76C2, 0xD3DB, + 0x76C3, 0xB0A0, 0x76C4, 0xB140, 0x76C5, 0xD6D1, 0x76C6, 0xC5E8, 0x76C7, 0xB141, 0x76C8, 0xD3AF, 0x76C9, 0xB142, 0x76CA, 0xD2E6, + 0x76CB, 0xB143, 0x76CC, 0xB144, 0x76CD, 0xEEC1, 0x76CE, 0xB0BB, 0x76CF, 0xD5B5, 0x76D0, 0xD1CE, 0x76D1, 0xBCE0, 0x76D2, 0xBAD0, + 0x76D3, 0xB145, 0x76D4, 0xBFF8, 0x76D5, 0xB146, 0x76D6, 0xB8C7, 0x76D7, 0xB5C1, 0x76D8, 0xC5CC, 0x76D9, 0xB147, 0x76DA, 0xB148, + 0x76DB, 0xCAA2, 0x76DC, 0xB149, 0x76DD, 0xB14A, 0x76DE, 0xB14B, 0x76DF, 0xC3CB, 0x76E0, 0xB14C, 0x76E1, 0xB14D, 0x76E2, 0xB14E, + 0x76E3, 0xB14F, 0x76E4, 0xB150, 0x76E5, 0xEEC2, 0x76E6, 0xB151, 0x76E7, 0xB152, 0x76E8, 0xB153, 0x76E9, 0xB154, 0x76EA, 0xB155, + 0x76EB, 0xB156, 0x76EC, 0xB157, 0x76ED, 0xB158, 0x76EE, 0xC4BF, 0x76EF, 0xB6A2, 0x76F0, 0xB159, 0x76F1, 0xEDEC, 0x76F2, 0xC3A4, + 0x76F3, 0xB15A, 0x76F4, 0xD6B1, 0x76F5, 0xB15B, 0x76F6, 0xB15C, 0x76F7, 0xB15D, 0x76F8, 0xCFE0, 0x76F9, 0xEDEF, 0x76FA, 0xB15E, + 0x76FB, 0xB15F, 0x76FC, 0xC5CE, 0x76FD, 0xB160, 0x76FE, 0xB6DC, 0x76FF, 0xB161, 0x7700, 0xB162, 0x7701, 0xCAA1, 0x7702, 0xB163, + 0x7703, 0xB164, 0x7704, 0xEDED, 0x7705, 0xB165, 0x7706, 0xB166, 0x7707, 0xEDF0, 0x7708, 0xEDF1, 0x7709, 0xC3BC, 0x770A, 0xB167, + 0x770B, 0xBFB4, 0x770C, 0xB168, 0x770D, 0xEDEE, 0x770E, 0xB169, 0x770F, 0xB16A, 0x7710, 0xB16B, 0x7711, 0xB16C, 0x7712, 0xB16D, + 0x7713, 0xB16E, 0x7714, 0xB16F, 0x7715, 0xB170, 0x7716, 0xB171, 0x7717, 0xB172, 0x7718, 0xB173, 0x7719, 0xEDF4, 0x771A, 0xEDF2, + 0x771B, 0xB174, 0x771C, 0xB175, 0x771D, 0xB176, 0x771E, 0xB177, 0x771F, 0xD5E6, 0x7720, 0xC3DF, 0x7721, 0xB178, 0x7722, 0xEDF3, + 0x7723, 0xB179, 0x7724, 0xB17A, 0x7725, 0xB17B, 0x7726, 0xEDF6, 0x7727, 0xB17C, 0x7728, 0xD5A3, 0x7729, 0xD1A3, 0x772A, 0xB17D, + 0x772B, 0xB17E, 0x772C, 0xB180, 0x772D, 0xEDF5, 0x772E, 0xB181, 0x772F, 0xC3D0, 0x7730, 0xB182, 0x7731, 0xB183, 0x7732, 0xB184, + 0x7733, 0xB185, 0x7734, 0xB186, 0x7735, 0xEDF7, 0x7736, 0xBFF4, 0x7737, 0xBEEC, 0x7738, 0xEDF8, 0x7739, 0xB187, 0x773A, 0xCCF7, + 0x773B, 0xB188, 0x773C, 0xD1DB, 0x773D, 0xB189, 0x773E, 0xB18A, 0x773F, 0xB18B, 0x7740, 0xD7C5, 0x7741, 0xD5F6, 0x7742, 0xB18C, + 0x7743, 0xEDFC, 0x7744, 0xB18D, 0x7745, 0xB18E, 0x7746, 0xB18F, 0x7747, 0xEDFB, 0x7748, 0xB190, 0x7749, 0xB191, 0x774A, 0xB192, + 0x774B, 0xB193, 0x774C, 0xB194, 0x774D, 0xB195, 0x774E, 0xB196, 0x774F, 0xB197, 0x7750, 0xEDF9, 0x7751, 0xEDFA, 0x7752, 0xB198, + 0x7753, 0xB199, 0x7754, 0xB19A, 0x7755, 0xB19B, 0x7756, 0xB19C, 0x7757, 0xB19D, 0x7758, 0xB19E, 0x7759, 0xB19F, 0x775A, 0xEDFD, + 0x775B, 0xBEA6, 0x775C, 0xB1A0, 0x775D, 0xB240, 0x775E, 0xB241, 0x775F, 0xB242, 0x7760, 0xB243, 0x7761, 0xCBAF, 0x7762, 0xEEA1, + 0x7763, 0xB6BD, 0x7764, 0xB244, 0x7765, 0xEEA2, 0x7766, 0xC4C0, 0x7767, 0xB245, 0x7768, 0xEDFE, 0x7769, 0xB246, 0x776A, 0xB247, + 0x776B, 0xBDDE, 0x776C, 0xB2C7, 0x776D, 0xB248, 0x776E, 0xB249, 0x776F, 0xB24A, 0x7770, 0xB24B, 0x7771, 0xB24C, 0x7772, 0xB24D, + 0x7773, 0xB24E, 0x7774, 0xB24F, 0x7775, 0xB250, 0x7776, 0xB251, 0x7777, 0xB252, 0x7778, 0xB253, 0x7779, 0xB6C3, 0x777A, 0xB254, + 0x777B, 0xB255, 0x777C, 0xB256, 0x777D, 0xEEA5, 0x777E, 0xD8BA, 0x777F, 0xEEA3, 0x7780, 0xEEA6, 0x7781, 0xB257, 0x7782, 0xB258, + 0x7783, 0xB259, 0x7784, 0xC3E9, 0x7785, 0xB3F2, 0x7786, 0xB25A, 0x7787, 0xB25B, 0x7788, 0xB25C, 0x7789, 0xB25D, 0x778A, 0xB25E, + 0x778B, 0xB25F, 0x778C, 0xEEA7, 0x778D, 0xEEA4, 0x778E, 0xCFB9, 0x778F, 0xB260, 0x7790, 0xB261, 0x7791, 0xEEA8, 0x7792, 0xC2F7, + 0x7793, 0xB262, 0x7794, 0xB263, 0x7795, 0xB264, 0x7796, 0xB265, 0x7797, 0xB266, 0x7798, 0xB267, 0x7799, 0xB268, 0x779A, 0xB269, + 0x779B, 0xB26A, 0x779C, 0xB26B, 0x779D, 0xB26C, 0x779E, 0xB26D, 0x779F, 0xEEA9, 0x77A0, 0xEEAA, 0x77A1, 0xB26E, 0x77A2, 0xDEAB, + 0x77A3, 0xB26F, 0x77A4, 0xB270, 0x77A5, 0xC6B3, 0x77A6, 0xB271, 0x77A7, 0xC7C6, 0x77A8, 0xB272, 0x77A9, 0xD6F5, 0x77AA, 0xB5C9, + 0x77AB, 0xB273, 0x77AC, 0xCBB2, 0x77AD, 0xB274, 0x77AE, 0xB275, 0x77AF, 0xB276, 0x77B0, 0xEEAB, 0x77B1, 0xB277, 0x77B2, 0xB278, + 0x77B3, 0xCDAB, 0x77B4, 0xB279, 0x77B5, 0xEEAC, 0x77B6, 0xB27A, 0x77B7, 0xB27B, 0x77B8, 0xB27C, 0x77B9, 0xB27D, 0x77BA, 0xB27E, + 0x77BB, 0xD5B0, 0x77BC, 0xB280, 0x77BD, 0xEEAD, 0x77BE, 0xB281, 0x77BF, 0xF6C4, 0x77C0, 0xB282, 0x77C1, 0xB283, 0x77C2, 0xB284, + 0x77C3, 0xB285, 0x77C4, 0xB286, 0x77C5, 0xB287, 0x77C6, 0xB288, 0x77C7, 0xB289, 0x77C8, 0xB28A, 0x77C9, 0xB28B, 0x77CA, 0xB28C, + 0x77CB, 0xB28D, 0x77CC, 0xB28E, 0x77CD, 0xDBC7, 0x77CE, 0xB28F, 0x77CF, 0xB290, 0x77D0, 0xB291, 0x77D1, 0xB292, 0x77D2, 0xB293, + 0x77D3, 0xB294, 0x77D4, 0xB295, 0x77D5, 0xB296, 0x77D6, 0xB297, 0x77D7, 0xB4A3, 0x77D8, 0xB298, 0x77D9, 0xB299, 0x77DA, 0xB29A, + 0x77DB, 0xC3AC, 0x77DC, 0xF1E6, 0x77DD, 0xB29B, 0x77DE, 0xB29C, 0x77DF, 0xB29D, 0x77E0, 0xB29E, 0x77E1, 0xB29F, 0x77E2, 0xCAB8, + 0x77E3, 0xD2D3, 0x77E4, 0xB2A0, 0x77E5, 0xD6AA, 0x77E6, 0xB340, 0x77E7, 0xEFF2, 0x77E8, 0xB341, 0x77E9, 0xBED8, 0x77EA, 0xB342, + 0x77EB, 0xBDC3, 0x77EC, 0xEFF3, 0x77ED, 0xB6CC, 0x77EE, 0xB0AB, 0x77EF, 0xB343, 0x77F0, 0xB344, 0x77F1, 0xB345, 0x77F2, 0xB346, + 0x77F3, 0xCAAF, 0x77F4, 0xB347, 0x77F5, 0xB348, 0x77F6, 0xEDB6, 0x77F7, 0xB349, 0x77F8, 0xEDB7, 0x77F9, 0xB34A, 0x77FA, 0xB34B, + 0x77FB, 0xB34C, 0x77FC, 0xB34D, 0x77FD, 0xCEF9, 0x77FE, 0xB7AF, 0x77FF, 0xBFF3, 0x7800, 0xEDB8, 0x7801, 0xC2EB, 0x7802, 0xC9B0, + 0x7803, 0xB34E, 0x7804, 0xB34F, 0x7805, 0xB350, 0x7806, 0xB351, 0x7807, 0xB352, 0x7808, 0xB353, 0x7809, 0xEDB9, 0x780A, 0xB354, + 0x780B, 0xB355, 0x780C, 0xC6F6, 0x780D, 0xBFB3, 0x780E, 0xB356, 0x780F, 0xB357, 0x7810, 0xB358, 0x7811, 0xEDBC, 0x7812, 0xC5F8, + 0x7813, 0xB359, 0x7814, 0xD1D0, 0x7815, 0xB35A, 0x7816, 0xD7A9, 0x7817, 0xEDBA, 0x7818, 0xEDBB, 0x7819, 0xB35B, 0x781A, 0xD1E2, + 0x781B, 0xB35C, 0x781C, 0xEDBF, 0x781D, 0xEDC0, 0x781E, 0xB35D, 0x781F, 0xEDC4, 0x7820, 0xB35E, 0x7821, 0xB35F, 0x7822, 0xB360, + 0x7823, 0xEDC8, 0x7824, 0xB361, 0x7825, 0xEDC6, 0x7826, 0xEDCE, 0x7827, 0xD5E8, 0x7828, 0xB362, 0x7829, 0xEDC9, 0x782A, 0xB363, + 0x782B, 0xB364, 0x782C, 0xEDC7, 0x782D, 0xEDBE, 0x782E, 0xB365, 0x782F, 0xB366, 0x7830, 0xC5E9, 0x7831, 0xB367, 0x7832, 0xB368, + 0x7833, 0xB369, 0x7834, 0xC6C6, 0x7835, 0xB36A, 0x7836, 0xB36B, 0x7837, 0xC9E9, 0x7838, 0xD4D2, 0x7839, 0xEDC1, 0x783A, 0xEDC2, + 0x783B, 0xEDC3, 0x783C, 0xEDC5, 0x783D, 0xB36C, 0x783E, 0xC0F9, 0x783F, 0xB36D, 0x7840, 0xB4A1, 0x7841, 0xB36E, 0x7842, 0xB36F, + 0x7843, 0xB370, 0x7844, 0xB371, 0x7845, 0xB9E8, 0x7846, 0xB372, 0x7847, 0xEDD0, 0x7848, 0xB373, 0x7849, 0xB374, 0x784A, 0xB375, + 0x784B, 0xB376, 0x784C, 0xEDD1, 0x784D, 0xB377, 0x784E, 0xEDCA, 0x784F, 0xB378, 0x7850, 0xEDCF, 0x7851, 0xB379, 0x7852, 0xCEF8, + 0x7853, 0xB37A, 0x7854, 0xB37B, 0x7855, 0xCBB6, 0x7856, 0xEDCC, 0x7857, 0xEDCD, 0x7858, 0xB37C, 0x7859, 0xB37D, 0x785A, 0xB37E, + 0x785B, 0xB380, 0x785C, 0xB381, 0x785D, 0xCFF5, 0x785E, 0xB382, 0x785F, 0xB383, 0x7860, 0xB384, 0x7861, 0xB385, 0x7862, 0xB386, + 0x7863, 0xB387, 0x7864, 0xB388, 0x7865, 0xB389, 0x7866, 0xB38A, 0x7867, 0xB38B, 0x7868, 0xB38C, 0x7869, 0xB38D, 0x786A, 0xEDD2, + 0x786B, 0xC1F2, 0x786C, 0xD3B2, 0x786D, 0xEDCB, 0x786E, 0xC8B7, 0x786F, 0xB38E, 0x7870, 0xB38F, 0x7871, 0xB390, 0x7872, 0xB391, + 0x7873, 0xB392, 0x7874, 0xB393, 0x7875, 0xB394, 0x7876, 0xB395, 0x7877, 0xBCEF, 0x7878, 0xB396, 0x7879, 0xB397, 0x787A, 0xB398, + 0x787B, 0xB399, 0x787C, 0xC5F0, 0x787D, 0xB39A, 0x787E, 0xB39B, 0x787F, 0xB39C, 0x7880, 0xB39D, 0x7881, 0xB39E, 0x7882, 0xB39F, + 0x7883, 0xB3A0, 0x7884, 0xB440, 0x7885, 0xB441, 0x7886, 0xB442, 0x7887, 0xEDD6, 0x7888, 0xB443, 0x7889, 0xB5EF, 0x788A, 0xB444, + 0x788B, 0xB445, 0x788C, 0xC2B5, 0x788D, 0xB0AD, 0x788E, 0xCBE9, 0x788F, 0xB446, 0x7890, 0xB447, 0x7891, 0xB1AE, 0x7892, 0xB448, + 0x7893, 0xEDD4, 0x7894, 0xB449, 0x7895, 0xB44A, 0x7896, 0xB44B, 0x7897, 0xCDEB, 0x7898, 0xB5E2, 0x7899, 0xB44C, 0x789A, 0xEDD5, + 0x789B, 0xEDD3, 0x789C, 0xEDD7, 0x789D, 0xB44D, 0x789E, 0xB44E, 0x789F, 0xB5FA, 0x78A0, 0xB44F, 0x78A1, 0xEDD8, 0x78A2, 0xB450, + 0x78A3, 0xEDD9, 0x78A4, 0xB451, 0x78A5, 0xEDDC, 0x78A6, 0xB452, 0x78A7, 0xB1CC, 0x78A8, 0xB453, 0x78A9, 0xB454, 0x78AA, 0xB455, + 0x78AB, 0xB456, 0x78AC, 0xB457, 0x78AD, 0xB458, 0x78AE, 0xB459, 0x78AF, 0xB45A, 0x78B0, 0xC5F6, 0x78B1, 0xBCEE, 0x78B2, 0xEDDA, + 0x78B3, 0xCCBC, 0x78B4, 0xB2EA, 0x78B5, 0xB45B, 0x78B6, 0xB45C, 0x78B7, 0xB45D, 0x78B8, 0xB45E, 0x78B9, 0xEDDB, 0x78BA, 0xB45F, + 0x78BB, 0xB460, 0x78BC, 0xB461, 0x78BD, 0xB462, 0x78BE, 0xC4EB, 0x78BF, 0xB463, 0x78C0, 0xB464, 0x78C1, 0xB4C5, 0x78C2, 0xB465, + 0x78C3, 0xB466, 0x78C4, 0xB467, 0x78C5, 0xB0F5, 0x78C6, 0xB468, 0x78C7, 0xB469, 0x78C8, 0xB46A, 0x78C9, 0xEDDF, 0x78CA, 0xC0DA, + 0x78CB, 0xB4E8, 0x78CC, 0xB46B, 0x78CD, 0xB46C, 0x78CE, 0xB46D, 0x78CF, 0xB46E, 0x78D0, 0xC5CD, 0x78D1, 0xB46F, 0x78D2, 0xB470, + 0x78D3, 0xB471, 0x78D4, 0xEDDD, 0x78D5, 0xBFC4, 0x78D6, 0xB472, 0x78D7, 0xB473, 0x78D8, 0xB474, 0x78D9, 0xEDDE, 0x78DA, 0xB475, + 0x78DB, 0xB476, 0x78DC, 0xB477, 0x78DD, 0xB478, 0x78DE, 0xB479, 0x78DF, 0xB47A, 0x78E0, 0xB47B, 0x78E1, 0xB47C, 0x78E2, 0xB47D, + 0x78E3, 0xB47E, 0x78E4, 0xB480, 0x78E5, 0xB481, 0x78E6, 0xB482, 0x78E7, 0xB483, 0x78E8, 0xC4A5, 0x78E9, 0xB484, 0x78EA, 0xB485, + 0x78EB, 0xB486, 0x78EC, 0xEDE0, 0x78ED, 0xB487, 0x78EE, 0xB488, 0x78EF, 0xB489, 0x78F0, 0xB48A, 0x78F1, 0xB48B, 0x78F2, 0xEDE1, + 0x78F3, 0xB48C, 0x78F4, 0xEDE3, 0x78F5, 0xB48D, 0x78F6, 0xB48E, 0x78F7, 0xC1D7, 0x78F8, 0xB48F, 0x78F9, 0xB490, 0x78FA, 0xBBC7, + 0x78FB, 0xB491, 0x78FC, 0xB492, 0x78FD, 0xB493, 0x78FE, 0xB494, 0x78FF, 0xB495, 0x7900, 0xB496, 0x7901, 0xBDB8, 0x7902, 0xB497, + 0x7903, 0xB498, 0x7904, 0xB499, 0x7905, 0xEDE2, 0x7906, 0xB49A, 0x7907, 0xB49B, 0x7908, 0xB49C, 0x7909, 0xB49D, 0x790A, 0xB49E, + 0x790B, 0xB49F, 0x790C, 0xB4A0, 0x790D, 0xB540, 0x790E, 0xB541, 0x790F, 0xB542, 0x7910, 0xB543, 0x7911, 0xB544, 0x7912, 0xB545, + 0x7913, 0xEDE4, 0x7914, 0xB546, 0x7915, 0xB547, 0x7916, 0xB548, 0x7917, 0xB549, 0x7918, 0xB54A, 0x7919, 0xB54B, 0x791A, 0xB54C, + 0x791B, 0xB54D, 0x791C, 0xB54E, 0x791D, 0xB54F, 0x791E, 0xEDE6, 0x791F, 0xB550, 0x7920, 0xB551, 0x7921, 0xB552, 0x7922, 0xB553, + 0x7923, 0xB554, 0x7924, 0xEDE5, 0x7925, 0xB555, 0x7926, 0xB556, 0x7927, 0xB557, 0x7928, 0xB558, 0x7929, 0xB559, 0x792A, 0xB55A, + 0x792B, 0xB55B, 0x792C, 0xB55C, 0x792D, 0xB55D, 0x792E, 0xB55E, 0x792F, 0xB55F, 0x7930, 0xB560, 0x7931, 0xB561, 0x7932, 0xB562, + 0x7933, 0xB563, 0x7934, 0xEDE7, 0x7935, 0xB564, 0x7936, 0xB565, 0x7937, 0xB566, 0x7938, 0xB567, 0x7939, 0xB568, 0x793A, 0xCABE, + 0x793B, 0xECEA, 0x793C, 0xC0F1, 0x793D, 0xB569, 0x793E, 0xC9E7, 0x793F, 0xB56A, 0x7940, 0xECEB, 0x7941, 0xC6EE, 0x7942, 0xB56B, + 0x7943, 0xB56C, 0x7944, 0xB56D, 0x7945, 0xB56E, 0x7946, 0xECEC, 0x7947, 0xB56F, 0x7948, 0xC6ED, 0x7949, 0xECED, 0x794A, 0xB570, + 0x794B, 0xB571, 0x794C, 0xB572, 0x794D, 0xB573, 0x794E, 0xB574, 0x794F, 0xB575, 0x7950, 0xB576, 0x7951, 0xB577, 0x7952, 0xB578, + 0x7953, 0xECF0, 0x7954, 0xB579, 0x7955, 0xB57A, 0x7956, 0xD7E6, 0x7957, 0xECF3, 0x7958, 0xB57B, 0x7959, 0xB57C, 0x795A, 0xECF1, + 0x795B, 0xECEE, 0x795C, 0xECEF, 0x795D, 0xD7A3, 0x795E, 0xC9F1, 0x795F, 0xCBEE, 0x7960, 0xECF4, 0x7961, 0xB57D, 0x7962, 0xECF2, + 0x7963, 0xB57E, 0x7964, 0xB580, 0x7965, 0xCFE9, 0x7966, 0xB581, 0x7967, 0xECF6, 0x7968, 0xC6B1, 0x7969, 0xB582, 0x796A, 0xB583, + 0x796B, 0xB584, 0x796C, 0xB585, 0x796D, 0xBCC0, 0x796E, 0xB586, 0x796F, 0xECF5, 0x7970, 0xB587, 0x7971, 0xB588, 0x7972, 0xB589, + 0x7973, 0xB58A, 0x7974, 0xB58B, 0x7975, 0xB58C, 0x7976, 0xB58D, 0x7977, 0xB5BB, 0x7978, 0xBBF6, 0x7979, 0xB58E, 0x797A, 0xECF7, + 0x797B, 0xB58F, 0x797C, 0xB590, 0x797D, 0xB591, 0x797E, 0xB592, 0x797F, 0xB593, 0x7980, 0xD9F7, 0x7981, 0xBDFB, 0x7982, 0xB594, + 0x7983, 0xB595, 0x7984, 0xC2BB, 0x7985, 0xECF8, 0x7986, 0xB596, 0x7987, 0xB597, 0x7988, 0xB598, 0x7989, 0xB599, 0x798A, 0xECF9, + 0x798B, 0xB59A, 0x798C, 0xB59B, 0x798D, 0xB59C, 0x798E, 0xB59D, 0x798F, 0xB8A3, 0x7990, 0xB59E, 0x7991, 0xB59F, 0x7992, 0xB5A0, + 0x7993, 0xB640, 0x7994, 0xB641, 0x7995, 0xB642, 0x7996, 0xB643, 0x7997, 0xB644, 0x7998, 0xB645, 0x7999, 0xB646, 0x799A, 0xECFA, + 0x799B, 0xB647, 0x799C, 0xB648, 0x799D, 0xB649, 0x799E, 0xB64A, 0x799F, 0xB64B, 0x79A0, 0xB64C, 0x79A1, 0xB64D, 0x79A2, 0xB64E, + 0x79A3, 0xB64F, 0x79A4, 0xB650, 0x79A5, 0xB651, 0x79A6, 0xB652, 0x79A7, 0xECFB, 0x79A8, 0xB653, 0x79A9, 0xB654, 0x79AA, 0xB655, + 0x79AB, 0xB656, 0x79AC, 0xB657, 0x79AD, 0xB658, 0x79AE, 0xB659, 0x79AF, 0xB65A, 0x79B0, 0xB65B, 0x79B1, 0xB65C, 0x79B2, 0xB65D, + 0x79B3, 0xECFC, 0x79B4, 0xB65E, 0x79B5, 0xB65F, 0x79B6, 0xB660, 0x79B7, 0xB661, 0x79B8, 0xB662, 0x79B9, 0xD3ED, 0x79BA, 0xD8AE, + 0x79BB, 0xC0EB, 0x79BC, 0xB663, 0x79BD, 0xC7DD, 0x79BE, 0xBACC, 0x79BF, 0xB664, 0x79C0, 0xD0E3, 0x79C1, 0xCBBD, 0x79C2, 0xB665, + 0x79C3, 0xCDBA, 0x79C4, 0xB666, 0x79C5, 0xB667, 0x79C6, 0xB8D1, 0x79C7, 0xB668, 0x79C8, 0xB669, 0x79C9, 0xB1FC, 0x79CA, 0xB66A, + 0x79CB, 0xC7EF, 0x79CC, 0xB66B, 0x79CD, 0xD6D6, 0x79CE, 0xB66C, 0x79CF, 0xB66D, 0x79D0, 0xB66E, 0x79D1, 0xBFC6, 0x79D2, 0xC3EB, + 0x79D3, 0xB66F, 0x79D4, 0xB670, 0x79D5, 0xEFF5, 0x79D6, 0xB671, 0x79D7, 0xB672, 0x79D8, 0xC3D8, 0x79D9, 0xB673, 0x79DA, 0xB674, + 0x79DB, 0xB675, 0x79DC, 0xB676, 0x79DD, 0xB677, 0x79DE, 0xB678, 0x79DF, 0xD7E2, 0x79E0, 0xB679, 0x79E1, 0xB67A, 0x79E2, 0xB67B, + 0x79E3, 0xEFF7, 0x79E4, 0xB3D3, 0x79E5, 0xB67C, 0x79E6, 0xC7D8, 0x79E7, 0xD1ED, 0x79E8, 0xB67D, 0x79E9, 0xD6C8, 0x79EA, 0xB67E, + 0x79EB, 0xEFF8, 0x79EC, 0xB680, 0x79ED, 0xEFF6, 0x79EE, 0xB681, 0x79EF, 0xBBFD, 0x79F0, 0xB3C6, 0x79F1, 0xB682, 0x79F2, 0xB683, + 0x79F3, 0xB684, 0x79F4, 0xB685, 0x79F5, 0xB686, 0x79F6, 0xB687, 0x79F7, 0xB688, 0x79F8, 0xBDD5, 0x79F9, 0xB689, 0x79FA, 0xB68A, + 0x79FB, 0xD2C6, 0x79FC, 0xB68B, 0x79FD, 0xBBE0, 0x79FE, 0xB68C, 0x79FF, 0xB68D, 0x7A00, 0xCFA1, 0x7A01, 0xB68E, 0x7A02, 0xEFFC, + 0x7A03, 0xEFFB, 0x7A04, 0xB68F, 0x7A05, 0xB690, 0x7A06, 0xEFF9, 0x7A07, 0xB691, 0x7A08, 0xB692, 0x7A09, 0xB693, 0x7A0A, 0xB694, + 0x7A0B, 0xB3CC, 0x7A0C, 0xB695, 0x7A0D, 0xC9D4, 0x7A0E, 0xCBB0, 0x7A0F, 0xB696, 0x7A10, 0xB697, 0x7A11, 0xB698, 0x7A12, 0xB699, + 0x7A13, 0xB69A, 0x7A14, 0xEFFE, 0x7A15, 0xB69B, 0x7A16, 0xB69C, 0x7A17, 0xB0DE, 0x7A18, 0xB69D, 0x7A19, 0xB69E, 0x7A1A, 0xD6C9, + 0x7A1B, 0xB69F, 0x7A1C, 0xB6A0, 0x7A1D, 0xB740, 0x7A1E, 0xEFFD, 0x7A1F, 0xB741, 0x7A20, 0xB3ED, 0x7A21, 0xB742, 0x7A22, 0xB743, + 0x7A23, 0xF6D5, 0x7A24, 0xB744, 0x7A25, 0xB745, 0x7A26, 0xB746, 0x7A27, 0xB747, 0x7A28, 0xB748, 0x7A29, 0xB749, 0x7A2A, 0xB74A, + 0x7A2B, 0xB74B, 0x7A2C, 0xB74C, 0x7A2D, 0xB74D, 0x7A2E, 0xB74E, 0x7A2F, 0xB74F, 0x7A30, 0xB750, 0x7A31, 0xB751, 0x7A32, 0xB752, + 0x7A33, 0xCEC8, 0x7A34, 0xB753, 0x7A35, 0xB754, 0x7A36, 0xB755, 0x7A37, 0xF0A2, 0x7A38, 0xB756, 0x7A39, 0xF0A1, 0x7A3A, 0xB757, + 0x7A3B, 0xB5BE, 0x7A3C, 0xBCDA, 0x7A3D, 0xBBFC, 0x7A3E, 0xB758, 0x7A3F, 0xB8E5, 0x7A40, 0xB759, 0x7A41, 0xB75A, 0x7A42, 0xB75B, + 0x7A43, 0xB75C, 0x7A44, 0xB75D, 0x7A45, 0xB75E, 0x7A46, 0xC4C2, 0x7A47, 0xB75F, 0x7A48, 0xB760, 0x7A49, 0xB761, 0x7A4A, 0xB762, + 0x7A4B, 0xB763, 0x7A4C, 0xB764, 0x7A4D, 0xB765, 0x7A4E, 0xB766, 0x7A4F, 0xB767, 0x7A50, 0xB768, 0x7A51, 0xF0A3, 0x7A52, 0xB769, + 0x7A53, 0xB76A, 0x7A54, 0xB76B, 0x7A55, 0xB76C, 0x7A56, 0xB76D, 0x7A57, 0xCBEB, 0x7A58, 0xB76E, 0x7A59, 0xB76F, 0x7A5A, 0xB770, + 0x7A5B, 0xB771, 0x7A5C, 0xB772, 0x7A5D, 0xB773, 0x7A5E, 0xB774, 0x7A5F, 0xB775, 0x7A60, 0xB776, 0x7A61, 0xB777, 0x7A62, 0xB778, + 0x7A63, 0xB779, 0x7A64, 0xB77A, 0x7A65, 0xB77B, 0x7A66, 0xB77C, 0x7A67, 0xB77D, 0x7A68, 0xB77E, 0x7A69, 0xB780, 0x7A6A, 0xB781, + 0x7A6B, 0xB782, 0x7A6C, 0xB783, 0x7A6D, 0xB784, 0x7A6E, 0xB785, 0x7A6F, 0xB786, 0x7A70, 0xF0A6, 0x7A71, 0xB787, 0x7A72, 0xB788, + 0x7A73, 0xB789, 0x7A74, 0xD1A8, 0x7A75, 0xB78A, 0x7A76, 0xBEBF, 0x7A77, 0xC7EE, 0x7A78, 0xF1B6, 0x7A79, 0xF1B7, 0x7A7A, 0xBFD5, + 0x7A7B, 0xB78B, 0x7A7C, 0xB78C, 0x7A7D, 0xB78D, 0x7A7E, 0xB78E, 0x7A7F, 0xB4A9, 0x7A80, 0xF1B8, 0x7A81, 0xCDBB, 0x7A82, 0xB78F, + 0x7A83, 0xC7D4, 0x7A84, 0xD5AD, 0x7A85, 0xB790, 0x7A86, 0xF1B9, 0x7A87, 0xB791, 0x7A88, 0xF1BA, 0x7A89, 0xB792, 0x7A8A, 0xB793, + 0x7A8B, 0xB794, 0x7A8C, 0xB795, 0x7A8D, 0xC7CF, 0x7A8E, 0xB796, 0x7A8F, 0xB797, 0x7A90, 0xB798, 0x7A91, 0xD2A4, 0x7A92, 0xD6CF, + 0x7A93, 0xB799, 0x7A94, 0xB79A, 0x7A95, 0xF1BB, 0x7A96, 0xBDD1, 0x7A97, 0xB4B0, 0x7A98, 0xBEBD, 0x7A99, 0xB79B, 0x7A9A, 0xB79C, + 0x7A9B, 0xB79D, 0x7A9C, 0xB4DC, 0x7A9D, 0xCED1, 0x7A9E, 0xB79E, 0x7A9F, 0xBFDF, 0x7AA0, 0xF1BD, 0x7AA1, 0xB79F, 0x7AA2, 0xB7A0, + 0x7AA3, 0xB840, 0x7AA4, 0xB841, 0x7AA5, 0xBFFA, 0x7AA6, 0xF1BC, 0x7AA7, 0xB842, 0x7AA8, 0xF1BF, 0x7AA9, 0xB843, 0x7AAA, 0xB844, + 0x7AAB, 0xB845, 0x7AAC, 0xF1BE, 0x7AAD, 0xF1C0, 0x7AAE, 0xB846, 0x7AAF, 0xB847, 0x7AB0, 0xB848, 0x7AB1, 0xB849, 0x7AB2, 0xB84A, + 0x7AB3, 0xF1C1, 0x7AB4, 0xB84B, 0x7AB5, 0xB84C, 0x7AB6, 0xB84D, 0x7AB7, 0xB84E, 0x7AB8, 0xB84F, 0x7AB9, 0xB850, 0x7ABA, 0xB851, + 0x7ABB, 0xB852, 0x7ABC, 0xB853, 0x7ABD, 0xB854, 0x7ABE, 0xB855, 0x7ABF, 0xC1FE, 0x7AC0, 0xB856, 0x7AC1, 0xB857, 0x7AC2, 0xB858, + 0x7AC3, 0xB859, 0x7AC4, 0xB85A, 0x7AC5, 0xB85B, 0x7AC6, 0xB85C, 0x7AC7, 0xB85D, 0x7AC8, 0xB85E, 0x7AC9, 0xB85F, 0x7ACA, 0xB860, + 0x7ACB, 0xC1A2, 0x7ACC, 0xB861, 0x7ACD, 0xB862, 0x7ACE, 0xB863, 0x7ACF, 0xB864, 0x7AD0, 0xB865, 0x7AD1, 0xB866, 0x7AD2, 0xB867, + 0x7AD3, 0xB868, 0x7AD4, 0xB869, 0x7AD5, 0xB86A, 0x7AD6, 0xCAFA, 0x7AD7, 0xB86B, 0x7AD8, 0xB86C, 0x7AD9, 0xD5BE, 0x7ADA, 0xB86D, + 0x7ADB, 0xB86E, 0x7ADC, 0xB86F, 0x7ADD, 0xB870, 0x7ADE, 0xBEBA, 0x7ADF, 0xBEB9, 0x7AE0, 0xD5C2, 0x7AE1, 0xB871, 0x7AE2, 0xB872, + 0x7AE3, 0xBFA2, 0x7AE4, 0xB873, 0x7AE5, 0xCDAF, 0x7AE6, 0xF1B5, 0x7AE7, 0xB874, 0x7AE8, 0xB875, 0x7AE9, 0xB876, 0x7AEA, 0xB877, + 0x7AEB, 0xB878, 0x7AEC, 0xB879, 0x7AED, 0xBDDF, 0x7AEE, 0xB87A, 0x7AEF, 0xB6CB, 0x7AF0, 0xB87B, 0x7AF1, 0xB87C, 0x7AF2, 0xB87D, + 0x7AF3, 0xB87E, 0x7AF4, 0xB880, 0x7AF5, 0xB881, 0x7AF6, 0xB882, 0x7AF7, 0xB883, 0x7AF8, 0xB884, 0x7AF9, 0xD6F1, 0x7AFA, 0xF3C3, + 0x7AFB, 0xB885, 0x7AFC, 0xB886, 0x7AFD, 0xF3C4, 0x7AFE, 0xB887, 0x7AFF, 0xB8CD, 0x7B00, 0xB888, 0x7B01, 0xB889, 0x7B02, 0xB88A, + 0x7B03, 0xF3C6, 0x7B04, 0xF3C7, 0x7B05, 0xB88B, 0x7B06, 0xB0CA, 0x7B07, 0xB88C, 0x7B08, 0xF3C5, 0x7B09, 0xB88D, 0x7B0A, 0xF3C9, + 0x7B0B, 0xCBF1, 0x7B0C, 0xB88E, 0x7B0D, 0xB88F, 0x7B0E, 0xB890, 0x7B0F, 0xF3CB, 0x7B10, 0xB891, 0x7B11, 0xD0A6, 0x7B12, 0xB892, + 0x7B13, 0xB893, 0x7B14, 0xB1CA, 0x7B15, 0xF3C8, 0x7B16, 0xB894, 0x7B17, 0xB895, 0x7B18, 0xB896, 0x7B19, 0xF3CF, 0x7B1A, 0xB897, + 0x7B1B, 0xB5D1, 0x7B1C, 0xB898, 0x7B1D, 0xB899, 0x7B1E, 0xF3D7, 0x7B1F, 0xB89A, 0x7B20, 0xF3D2, 0x7B21, 0xB89B, 0x7B22, 0xB89C, + 0x7B23, 0xB89D, 0x7B24, 0xF3D4, 0x7B25, 0xF3D3, 0x7B26, 0xB7FB, 0x7B27, 0xB89E, 0x7B28, 0xB1BF, 0x7B29, 0xB89F, 0x7B2A, 0xF3CE, + 0x7B2B, 0xF3CA, 0x7B2C, 0xB5DA, 0x7B2D, 0xB8A0, 0x7B2E, 0xF3D0, 0x7B2F, 0xB940, 0x7B30, 0xB941, 0x7B31, 0xF3D1, 0x7B32, 0xB942, + 0x7B33, 0xF3D5, 0x7B34, 0xB943, 0x7B35, 0xB944, 0x7B36, 0xB945, 0x7B37, 0xB946, 0x7B38, 0xF3CD, 0x7B39, 0xB947, 0x7B3A, 0xBCE3, + 0x7B3B, 0xB948, 0x7B3C, 0xC1FD, 0x7B3D, 0xB949, 0x7B3E, 0xF3D6, 0x7B3F, 0xB94A, 0x7B40, 0xB94B, 0x7B41, 0xB94C, 0x7B42, 0xB94D, + 0x7B43, 0xB94E, 0x7B44, 0xB94F, 0x7B45, 0xF3DA, 0x7B46, 0xB950, 0x7B47, 0xF3CC, 0x7B48, 0xB951, 0x7B49, 0xB5C8, 0x7B4A, 0xB952, + 0x7B4B, 0xBDEE, 0x7B4C, 0xF3DC, 0x7B4D, 0xB953, 0x7B4E, 0xB954, 0x7B4F, 0xB7A4, 0x7B50, 0xBFF0, 0x7B51, 0xD6FE, 0x7B52, 0xCDB2, + 0x7B53, 0xB955, 0x7B54, 0xB4F0, 0x7B55, 0xB956, 0x7B56, 0xB2DF, 0x7B57, 0xB957, 0x7B58, 0xF3D8, 0x7B59, 0xB958, 0x7B5A, 0xF3D9, + 0x7B5B, 0xC9B8, 0x7B5C, 0xB959, 0x7B5D, 0xF3DD, 0x7B5E, 0xB95A, 0x7B5F, 0xB95B, 0x7B60, 0xF3DE, 0x7B61, 0xB95C, 0x7B62, 0xF3E1, + 0x7B63, 0xB95D, 0x7B64, 0xB95E, 0x7B65, 0xB95F, 0x7B66, 0xB960, 0x7B67, 0xB961, 0x7B68, 0xB962, 0x7B69, 0xB963, 0x7B6A, 0xB964, + 0x7B6B, 0xB965, 0x7B6C, 0xB966, 0x7B6D, 0xB967, 0x7B6E, 0xF3DF, 0x7B6F, 0xB968, 0x7B70, 0xB969, 0x7B71, 0xF3E3, 0x7B72, 0xF3E2, + 0x7B73, 0xB96A, 0x7B74, 0xB96B, 0x7B75, 0xF3DB, 0x7B76, 0xB96C, 0x7B77, 0xBFEA, 0x7B78, 0xB96D, 0x7B79, 0xB3EF, 0x7B7A, 0xB96E, + 0x7B7B, 0xF3E0, 0x7B7C, 0xB96F, 0x7B7D, 0xB970, 0x7B7E, 0xC7A9, 0x7B7F, 0xB971, 0x7B80, 0xBCF2, 0x7B81, 0xB972, 0x7B82, 0xB973, + 0x7B83, 0xB974, 0x7B84, 0xB975, 0x7B85, 0xF3EB, 0x7B86, 0xB976, 0x7B87, 0xB977, 0x7B88, 0xB978, 0x7B89, 0xB979, 0x7B8A, 0xB97A, + 0x7B8B, 0xB97B, 0x7B8C, 0xB97C, 0x7B8D, 0xB9BF, 0x7B8E, 0xB97D, 0x7B8F, 0xB97E, 0x7B90, 0xF3E4, 0x7B91, 0xB980, 0x7B92, 0xB981, + 0x7B93, 0xB982, 0x7B94, 0xB2AD, 0x7B95, 0xBBFE, 0x7B96, 0xB983, 0x7B97, 0xCBE3, 0x7B98, 0xB984, 0x7B99, 0xB985, 0x7B9A, 0xB986, + 0x7B9B, 0xB987, 0x7B9C, 0xF3ED, 0x7B9D, 0xF3E9, 0x7B9E, 0xB988, 0x7B9F, 0xB989, 0x7BA0, 0xB98A, 0x7BA1, 0xB9DC, 0x7BA2, 0xF3EE, + 0x7BA3, 0xB98B, 0x7BA4, 0xB98C, 0x7BA5, 0xB98D, 0x7BA6, 0xF3E5, 0x7BA7, 0xF3E6, 0x7BA8, 0xF3EA, 0x7BA9, 0xC2E1, 0x7BAA, 0xF3EC, + 0x7BAB, 0xF3EF, 0x7BAC, 0xF3E8, 0x7BAD, 0xBCFD, 0x7BAE, 0xB98E, 0x7BAF, 0xB98F, 0x7BB0, 0xB990, 0x7BB1, 0xCFE4, 0x7BB2, 0xB991, + 0x7BB3, 0xB992, 0x7BB4, 0xF3F0, 0x7BB5, 0xB993, 0x7BB6, 0xB994, 0x7BB7, 0xB995, 0x7BB8, 0xF3E7, 0x7BB9, 0xB996, 0x7BBA, 0xB997, + 0x7BBB, 0xB998, 0x7BBC, 0xB999, 0x7BBD, 0xB99A, 0x7BBE, 0xB99B, 0x7BBF, 0xB99C, 0x7BC0, 0xB99D, 0x7BC1, 0xF3F2, 0x7BC2, 0xB99E, + 0x7BC3, 0xB99F, 0x7BC4, 0xB9A0, 0x7BC5, 0xBA40, 0x7BC6, 0xD7AD, 0x7BC7, 0xC6AA, 0x7BC8, 0xBA41, 0x7BC9, 0xBA42, 0x7BCA, 0xBA43, + 0x7BCB, 0xBA44, 0x7BCC, 0xF3F3, 0x7BCD, 0xBA45, 0x7BCE, 0xBA46, 0x7BCF, 0xBA47, 0x7BD0, 0xBA48, 0x7BD1, 0xF3F1, 0x7BD2, 0xBA49, + 0x7BD3, 0xC2A8, 0x7BD4, 0xBA4A, 0x7BD5, 0xBA4B, 0x7BD6, 0xBA4C, 0x7BD7, 0xBA4D, 0x7BD8, 0xBA4E, 0x7BD9, 0xB8DD, 0x7BDA, 0xF3F5, + 0x7BDB, 0xBA4F, 0x7BDC, 0xBA50, 0x7BDD, 0xF3F4, 0x7BDE, 0xBA51, 0x7BDF, 0xBA52, 0x7BE0, 0xBA53, 0x7BE1, 0xB4DB, 0x7BE2, 0xBA54, + 0x7BE3, 0xBA55, 0x7BE4, 0xBA56, 0x7BE5, 0xF3F6, 0x7BE6, 0xF3F7, 0x7BE7, 0xBA57, 0x7BE8, 0xBA58, 0x7BE9, 0xBA59, 0x7BEA, 0xF3F8, + 0x7BEB, 0xBA5A, 0x7BEC, 0xBA5B, 0x7BED, 0xBA5C, 0x7BEE, 0xC0BA, 0x7BEF, 0xBA5D, 0x7BF0, 0xBA5E, 0x7BF1, 0xC0E9, 0x7BF2, 0xBA5F, + 0x7BF3, 0xBA60, 0x7BF4, 0xBA61, 0x7BF5, 0xBA62, 0x7BF6, 0xBA63, 0x7BF7, 0xC5F1, 0x7BF8, 0xBA64, 0x7BF9, 0xBA65, 0x7BFA, 0xBA66, + 0x7BFB, 0xBA67, 0x7BFC, 0xF3FB, 0x7BFD, 0xBA68, 0x7BFE, 0xF3FA, 0x7BFF, 0xBA69, 0x7C00, 0xBA6A, 0x7C01, 0xBA6B, 0x7C02, 0xBA6C, + 0x7C03, 0xBA6D, 0x7C04, 0xBA6E, 0x7C05, 0xBA6F, 0x7C06, 0xBA70, 0x7C07, 0xB4D8, 0x7C08, 0xBA71, 0x7C09, 0xBA72, 0x7C0A, 0xBA73, + 0x7C0B, 0xF3FE, 0x7C0C, 0xF3F9, 0x7C0D, 0xBA74, 0x7C0E, 0xBA75, 0x7C0F, 0xF3FC, 0x7C10, 0xBA76, 0x7C11, 0xBA77, 0x7C12, 0xBA78, + 0x7C13, 0xBA79, 0x7C14, 0xBA7A, 0x7C15, 0xBA7B, 0x7C16, 0xF3FD, 0x7C17, 0xBA7C, 0x7C18, 0xBA7D, 0x7C19, 0xBA7E, 0x7C1A, 0xBA80, + 0x7C1B, 0xBA81, 0x7C1C, 0xBA82, 0x7C1D, 0xBA83, 0x7C1E, 0xBA84, 0x7C1F, 0xF4A1, 0x7C20, 0xBA85, 0x7C21, 0xBA86, 0x7C22, 0xBA87, + 0x7C23, 0xBA88, 0x7C24, 0xBA89, 0x7C25, 0xBA8A, 0x7C26, 0xF4A3, 0x7C27, 0xBBC9, 0x7C28, 0xBA8B, 0x7C29, 0xBA8C, 0x7C2A, 0xF4A2, + 0x7C2B, 0xBA8D, 0x7C2C, 0xBA8E, 0x7C2D, 0xBA8F, 0x7C2E, 0xBA90, 0x7C2F, 0xBA91, 0x7C30, 0xBA92, 0x7C31, 0xBA93, 0x7C32, 0xBA94, + 0x7C33, 0xBA95, 0x7C34, 0xBA96, 0x7C35, 0xBA97, 0x7C36, 0xBA98, 0x7C37, 0xBA99, 0x7C38, 0xF4A4, 0x7C39, 0xBA9A, 0x7C3A, 0xBA9B, + 0x7C3B, 0xBA9C, 0x7C3C, 0xBA9D, 0x7C3D, 0xBA9E, 0x7C3E, 0xBA9F, 0x7C3F, 0xB2BE, 0x7C40, 0xF4A6, 0x7C41, 0xF4A5, 0x7C42, 0xBAA0, + 0x7C43, 0xBB40, 0x7C44, 0xBB41, 0x7C45, 0xBB42, 0x7C46, 0xBB43, 0x7C47, 0xBB44, 0x7C48, 0xBB45, 0x7C49, 0xBB46, 0x7C4A, 0xBB47, + 0x7C4B, 0xBB48, 0x7C4C, 0xBB49, 0x7C4D, 0xBCAE, 0x7C4E, 0xBB4A, 0x7C4F, 0xBB4B, 0x7C50, 0xBB4C, 0x7C51, 0xBB4D, 0x7C52, 0xBB4E, + 0x7C53, 0xBB4F, 0x7C54, 0xBB50, 0x7C55, 0xBB51, 0x7C56, 0xBB52, 0x7C57, 0xBB53, 0x7C58, 0xBB54, 0x7C59, 0xBB55, 0x7C5A, 0xBB56, + 0x7C5B, 0xBB57, 0x7C5C, 0xBB58, 0x7C5D, 0xBB59, 0x7C5E, 0xBB5A, 0x7C5F, 0xBB5B, 0x7C60, 0xBB5C, 0x7C61, 0xBB5D, 0x7C62, 0xBB5E, + 0x7C63, 0xBB5F, 0x7C64, 0xBB60, 0x7C65, 0xBB61, 0x7C66, 0xBB62, 0x7C67, 0xBB63, 0x7C68, 0xBB64, 0x7C69, 0xBB65, 0x7C6A, 0xBB66, + 0x7C6B, 0xBB67, 0x7C6C, 0xBB68, 0x7C6D, 0xBB69, 0x7C6E, 0xBB6A, 0x7C6F, 0xBB6B, 0x7C70, 0xBB6C, 0x7C71, 0xBB6D, 0x7C72, 0xBB6E, + 0x7C73, 0xC3D7, 0x7C74, 0xD9E1, 0x7C75, 0xBB6F, 0x7C76, 0xBB70, 0x7C77, 0xBB71, 0x7C78, 0xBB72, 0x7C79, 0xBB73, 0x7C7A, 0xBB74, + 0x7C7B, 0xC0E0, 0x7C7C, 0xF4CC, 0x7C7D, 0xD7D1, 0x7C7E, 0xBB75, 0x7C7F, 0xBB76, 0x7C80, 0xBB77, 0x7C81, 0xBB78, 0x7C82, 0xBB79, + 0x7C83, 0xBB7A, 0x7C84, 0xBB7B, 0x7C85, 0xBB7C, 0x7C86, 0xBB7D, 0x7C87, 0xBB7E, 0x7C88, 0xBB80, 0x7C89, 0xB7DB, 0x7C8A, 0xBB81, + 0x7C8B, 0xBB82, 0x7C8C, 0xBB83, 0x7C8D, 0xBB84, 0x7C8E, 0xBB85, 0x7C8F, 0xBB86, 0x7C90, 0xBB87, 0x7C91, 0xF4CE, 0x7C92, 0xC1A3, + 0x7C93, 0xBB88, 0x7C94, 0xBB89, 0x7C95, 0xC6C9, 0x7C96, 0xBB8A, 0x7C97, 0xB4D6, 0x7C98, 0xD5B3, 0x7C99, 0xBB8B, 0x7C9A, 0xBB8C, + 0x7C9B, 0xBB8D, 0x7C9C, 0xF4D0, 0x7C9D, 0xF4CF, 0x7C9E, 0xF4D1, 0x7C9F, 0xCBDA, 0x7CA0, 0xBB8E, 0x7CA1, 0xBB8F, 0x7CA2, 0xF4D2, + 0x7CA3, 0xBB90, 0x7CA4, 0xD4C1, 0x7CA5, 0xD6E0, 0x7CA6, 0xBB91, 0x7CA7, 0xBB92, 0x7CA8, 0xBB93, 0x7CA9, 0xBB94, 0x7CAA, 0xB7E0, + 0x7CAB, 0xBB95, 0x7CAC, 0xBB96, 0x7CAD, 0xBB97, 0x7CAE, 0xC1B8, 0x7CAF, 0xBB98, 0x7CB0, 0xBB99, 0x7CB1, 0xC1BB, 0x7CB2, 0xF4D3, + 0x7CB3, 0xBEAC, 0x7CB4, 0xBB9A, 0x7CB5, 0xBB9B, 0x7CB6, 0xBB9C, 0x7CB7, 0xBB9D, 0x7CB8, 0xBB9E, 0x7CB9, 0xB4E2, 0x7CBA, 0xBB9F, + 0x7CBB, 0xBBA0, 0x7CBC, 0xF4D4, 0x7CBD, 0xF4D5, 0x7CBE, 0xBEAB, 0x7CBF, 0xBC40, 0x7CC0, 0xBC41, 0x7CC1, 0xF4D6, 0x7CC2, 0xBC42, + 0x7CC3, 0xBC43, 0x7CC4, 0xBC44, 0x7CC5, 0xF4DB, 0x7CC6, 0xBC45, 0x7CC7, 0xF4D7, 0x7CC8, 0xF4DA, 0x7CC9, 0xBC46, 0x7CCA, 0xBAFD, + 0x7CCB, 0xBC47, 0x7CCC, 0xF4D8, 0x7CCD, 0xF4D9, 0x7CCE, 0xBC48, 0x7CCF, 0xBC49, 0x7CD0, 0xBC4A, 0x7CD1, 0xBC4B, 0x7CD2, 0xBC4C, + 0x7CD3, 0xBC4D, 0x7CD4, 0xBC4E, 0x7CD5, 0xB8E2, 0x7CD6, 0xCCC7, 0x7CD7, 0xF4DC, 0x7CD8, 0xBC4F, 0x7CD9, 0xB2DA, 0x7CDA, 0xBC50, + 0x7CDB, 0xBC51, 0x7CDC, 0xC3D3, 0x7CDD, 0xBC52, 0x7CDE, 0xBC53, 0x7CDF, 0xD4E3, 0x7CE0, 0xBFB7, 0x7CE1, 0xBC54, 0x7CE2, 0xBC55, + 0x7CE3, 0xBC56, 0x7CE4, 0xBC57, 0x7CE5, 0xBC58, 0x7CE6, 0xBC59, 0x7CE7, 0xBC5A, 0x7CE8, 0xF4DD, 0x7CE9, 0xBC5B, 0x7CEA, 0xBC5C, + 0x7CEB, 0xBC5D, 0x7CEC, 0xBC5E, 0x7CED, 0xBC5F, 0x7CEE, 0xBC60, 0x7CEF, 0xC5B4, 0x7CF0, 0xBC61, 0x7CF1, 0xBC62, 0x7CF2, 0xBC63, + 0x7CF3, 0xBC64, 0x7CF4, 0xBC65, 0x7CF5, 0xBC66, 0x7CF6, 0xBC67, 0x7CF7, 0xBC68, 0x7CF8, 0xF4E9, 0x7CF9, 0xBC69, 0x7CFA, 0xBC6A, + 0x7CFB, 0xCFB5, 0x7CFC, 0xBC6B, 0x7CFD, 0xBC6C, 0x7CFE, 0xBC6D, 0x7CFF, 0xBC6E, 0x7D00, 0xBC6F, 0x7D01, 0xBC70, 0x7D02, 0xBC71, + 0x7D03, 0xBC72, 0x7D04, 0xBC73, 0x7D05, 0xBC74, 0x7D06, 0xBC75, 0x7D07, 0xBC76, 0x7D08, 0xBC77, 0x7D09, 0xBC78, 0x7D0A, 0xCEC9, + 0x7D0B, 0xBC79, 0x7D0C, 0xBC7A, 0x7D0D, 0xBC7B, 0x7D0E, 0xBC7C, 0x7D0F, 0xBC7D, 0x7D10, 0xBC7E, 0x7D11, 0xBC80, 0x7D12, 0xBC81, + 0x7D13, 0xBC82, 0x7D14, 0xBC83, 0x7D15, 0xBC84, 0x7D16, 0xBC85, 0x7D17, 0xBC86, 0x7D18, 0xBC87, 0x7D19, 0xBC88, 0x7D1A, 0xBC89, + 0x7D1B, 0xBC8A, 0x7D1C, 0xBC8B, 0x7D1D, 0xBC8C, 0x7D1E, 0xBC8D, 0x7D1F, 0xBC8E, 0x7D20, 0xCBD8, 0x7D21, 0xBC8F, 0x7D22, 0xCBF7, + 0x7D23, 0xBC90, 0x7D24, 0xBC91, 0x7D25, 0xBC92, 0x7D26, 0xBC93, 0x7D27, 0xBDF4, 0x7D28, 0xBC94, 0x7D29, 0xBC95, 0x7D2A, 0xBC96, + 0x7D2B, 0xD7CF, 0x7D2C, 0xBC97, 0x7D2D, 0xBC98, 0x7D2E, 0xBC99, 0x7D2F, 0xC0DB, 0x7D30, 0xBC9A, 0x7D31, 0xBC9B, 0x7D32, 0xBC9C, + 0x7D33, 0xBC9D, 0x7D34, 0xBC9E, 0x7D35, 0xBC9F, 0x7D36, 0xBCA0, 0x7D37, 0xBD40, 0x7D38, 0xBD41, 0x7D39, 0xBD42, 0x7D3A, 0xBD43, + 0x7D3B, 0xBD44, 0x7D3C, 0xBD45, 0x7D3D, 0xBD46, 0x7D3E, 0xBD47, 0x7D3F, 0xBD48, 0x7D40, 0xBD49, 0x7D41, 0xBD4A, 0x7D42, 0xBD4B, + 0x7D43, 0xBD4C, 0x7D44, 0xBD4D, 0x7D45, 0xBD4E, 0x7D46, 0xBD4F, 0x7D47, 0xBD50, 0x7D48, 0xBD51, 0x7D49, 0xBD52, 0x7D4A, 0xBD53, + 0x7D4B, 0xBD54, 0x7D4C, 0xBD55, 0x7D4D, 0xBD56, 0x7D4E, 0xBD57, 0x7D4F, 0xBD58, 0x7D50, 0xBD59, 0x7D51, 0xBD5A, 0x7D52, 0xBD5B, + 0x7D53, 0xBD5C, 0x7D54, 0xBD5D, 0x7D55, 0xBD5E, 0x7D56, 0xBD5F, 0x7D57, 0xBD60, 0x7D58, 0xBD61, 0x7D59, 0xBD62, 0x7D5A, 0xBD63, + 0x7D5B, 0xBD64, 0x7D5C, 0xBD65, 0x7D5D, 0xBD66, 0x7D5E, 0xBD67, 0x7D5F, 0xBD68, 0x7D60, 0xBD69, 0x7D61, 0xBD6A, 0x7D62, 0xBD6B, + 0x7D63, 0xBD6C, 0x7D64, 0xBD6D, 0x7D65, 0xBD6E, 0x7D66, 0xBD6F, 0x7D67, 0xBD70, 0x7D68, 0xBD71, 0x7D69, 0xBD72, 0x7D6A, 0xBD73, + 0x7D6B, 0xBD74, 0x7D6C, 0xBD75, 0x7D6D, 0xBD76, 0x7D6E, 0xD0F5, 0x7D6F, 0xBD77, 0x7D70, 0xBD78, 0x7D71, 0xBD79, 0x7D72, 0xBD7A, + 0x7D73, 0xBD7B, 0x7D74, 0xBD7C, 0x7D75, 0xBD7D, 0x7D76, 0xBD7E, 0x7D77, 0xF4EA, 0x7D78, 0xBD80, 0x7D79, 0xBD81, 0x7D7A, 0xBD82, + 0x7D7B, 0xBD83, 0x7D7C, 0xBD84, 0x7D7D, 0xBD85, 0x7D7E, 0xBD86, 0x7D7F, 0xBD87, 0x7D80, 0xBD88, 0x7D81, 0xBD89, 0x7D82, 0xBD8A, + 0x7D83, 0xBD8B, 0x7D84, 0xBD8C, 0x7D85, 0xBD8D, 0x7D86, 0xBD8E, 0x7D87, 0xBD8F, 0x7D88, 0xBD90, 0x7D89, 0xBD91, 0x7D8A, 0xBD92, + 0x7D8B, 0xBD93, 0x7D8C, 0xBD94, 0x7D8D, 0xBD95, 0x7D8E, 0xBD96, 0x7D8F, 0xBD97, 0x7D90, 0xBD98, 0x7D91, 0xBD99, 0x7D92, 0xBD9A, + 0x7D93, 0xBD9B, 0x7D94, 0xBD9C, 0x7D95, 0xBD9D, 0x7D96, 0xBD9E, 0x7D97, 0xBD9F, 0x7D98, 0xBDA0, 0x7D99, 0xBE40, 0x7D9A, 0xBE41, + 0x7D9B, 0xBE42, 0x7D9C, 0xBE43, 0x7D9D, 0xBE44, 0x7D9E, 0xBE45, 0x7D9F, 0xBE46, 0x7DA0, 0xBE47, 0x7DA1, 0xBE48, 0x7DA2, 0xBE49, + 0x7DA3, 0xBE4A, 0x7DA4, 0xBE4B, 0x7DA5, 0xBE4C, 0x7DA6, 0xF4EB, 0x7DA7, 0xBE4D, 0x7DA8, 0xBE4E, 0x7DA9, 0xBE4F, 0x7DAA, 0xBE50, + 0x7DAB, 0xBE51, 0x7DAC, 0xBE52, 0x7DAD, 0xBE53, 0x7DAE, 0xF4EC, 0x7DAF, 0xBE54, 0x7DB0, 0xBE55, 0x7DB1, 0xBE56, 0x7DB2, 0xBE57, + 0x7DB3, 0xBE58, 0x7DB4, 0xBE59, 0x7DB5, 0xBE5A, 0x7DB6, 0xBE5B, 0x7DB7, 0xBE5C, 0x7DB8, 0xBE5D, 0x7DB9, 0xBE5E, 0x7DBA, 0xBE5F, + 0x7DBB, 0xBE60, 0x7DBC, 0xBE61, 0x7DBD, 0xBE62, 0x7DBE, 0xBE63, 0x7DBF, 0xBE64, 0x7DC0, 0xBE65, 0x7DC1, 0xBE66, 0x7DC2, 0xBE67, + 0x7DC3, 0xBE68, 0x7DC4, 0xBE69, 0x7DC5, 0xBE6A, 0x7DC6, 0xBE6B, 0x7DC7, 0xBE6C, 0x7DC8, 0xBE6D, 0x7DC9, 0xBE6E, 0x7DCA, 0xBE6F, + 0x7DCB, 0xBE70, 0x7DCC, 0xBE71, 0x7DCD, 0xBE72, 0x7DCE, 0xBE73, 0x7DCF, 0xBE74, 0x7DD0, 0xBE75, 0x7DD1, 0xBE76, 0x7DD2, 0xBE77, + 0x7DD3, 0xBE78, 0x7DD4, 0xBE79, 0x7DD5, 0xBE7A, 0x7DD6, 0xBE7B, 0x7DD7, 0xBE7C, 0x7DD8, 0xBE7D, 0x7DD9, 0xBE7E, 0x7DDA, 0xBE80, + 0x7DDB, 0xBE81, 0x7DDC, 0xBE82, 0x7DDD, 0xBE83, 0x7DDE, 0xBE84, 0x7DDF, 0xBE85, 0x7DE0, 0xBE86, 0x7DE1, 0xBE87, 0x7DE2, 0xBE88, + 0x7DE3, 0xBE89, 0x7DE4, 0xBE8A, 0x7DE5, 0xBE8B, 0x7DE6, 0xBE8C, 0x7DE7, 0xBE8D, 0x7DE8, 0xBE8E, 0x7DE9, 0xBE8F, 0x7DEA, 0xBE90, + 0x7DEB, 0xBE91, 0x7DEC, 0xBE92, 0x7DED, 0xBE93, 0x7DEE, 0xBE94, 0x7DEF, 0xBE95, 0x7DF0, 0xBE96, 0x7DF1, 0xBE97, 0x7DF2, 0xBE98, + 0x7DF3, 0xBE99, 0x7DF4, 0xBE9A, 0x7DF5, 0xBE9B, 0x7DF6, 0xBE9C, 0x7DF7, 0xBE9D, 0x7DF8, 0xBE9E, 0x7DF9, 0xBE9F, 0x7DFA, 0xBEA0, + 0x7DFB, 0xBF40, 0x7DFC, 0xBF41, 0x7DFD, 0xBF42, 0x7DFE, 0xBF43, 0x7DFF, 0xBF44, 0x7E00, 0xBF45, 0x7E01, 0xBF46, 0x7E02, 0xBF47, + 0x7E03, 0xBF48, 0x7E04, 0xBF49, 0x7E05, 0xBF4A, 0x7E06, 0xBF4B, 0x7E07, 0xBF4C, 0x7E08, 0xBF4D, 0x7E09, 0xBF4E, 0x7E0A, 0xBF4F, + 0x7E0B, 0xBF50, 0x7E0C, 0xBF51, 0x7E0D, 0xBF52, 0x7E0E, 0xBF53, 0x7E0F, 0xBF54, 0x7E10, 0xBF55, 0x7E11, 0xBF56, 0x7E12, 0xBF57, + 0x7E13, 0xBF58, 0x7E14, 0xBF59, 0x7E15, 0xBF5A, 0x7E16, 0xBF5B, 0x7E17, 0xBF5C, 0x7E18, 0xBF5D, 0x7E19, 0xBF5E, 0x7E1A, 0xBF5F, + 0x7E1B, 0xBF60, 0x7E1C, 0xBF61, 0x7E1D, 0xBF62, 0x7E1E, 0xBF63, 0x7E1F, 0xBF64, 0x7E20, 0xBF65, 0x7E21, 0xBF66, 0x7E22, 0xBF67, + 0x7E23, 0xBF68, 0x7E24, 0xBF69, 0x7E25, 0xBF6A, 0x7E26, 0xBF6B, 0x7E27, 0xBF6C, 0x7E28, 0xBF6D, 0x7E29, 0xBF6E, 0x7E2A, 0xBF6F, + 0x7E2B, 0xBF70, 0x7E2C, 0xBF71, 0x7E2D, 0xBF72, 0x7E2E, 0xBF73, 0x7E2F, 0xBF74, 0x7E30, 0xBF75, 0x7E31, 0xBF76, 0x7E32, 0xBF77, + 0x7E33, 0xBF78, 0x7E34, 0xBF79, 0x7E35, 0xBF7A, 0x7E36, 0xBF7B, 0x7E37, 0xBF7C, 0x7E38, 0xBF7D, 0x7E39, 0xBF7E, 0x7E3A, 0xBF80, + 0x7E3B, 0xF7E3, 0x7E3C, 0xBF81, 0x7E3D, 0xBF82, 0x7E3E, 0xBF83, 0x7E3F, 0xBF84, 0x7E40, 0xBF85, 0x7E41, 0xB7B1, 0x7E42, 0xBF86, + 0x7E43, 0xBF87, 0x7E44, 0xBF88, 0x7E45, 0xBF89, 0x7E46, 0xBF8A, 0x7E47, 0xF4ED, 0x7E48, 0xBF8B, 0x7E49, 0xBF8C, 0x7E4A, 0xBF8D, + 0x7E4B, 0xBF8E, 0x7E4C, 0xBF8F, 0x7E4D, 0xBF90, 0x7E4E, 0xBF91, 0x7E4F, 0xBF92, 0x7E50, 0xBF93, 0x7E51, 0xBF94, 0x7E52, 0xBF95, + 0x7E53, 0xBF96, 0x7E54, 0xBF97, 0x7E55, 0xBF98, 0x7E56, 0xBF99, 0x7E57, 0xBF9A, 0x7E58, 0xBF9B, 0x7E59, 0xBF9C, 0x7E5A, 0xBF9D, + 0x7E5B, 0xBF9E, 0x7E5C, 0xBF9F, 0x7E5D, 0xBFA0, 0x7E5E, 0xC040, 0x7E5F, 0xC041, 0x7E60, 0xC042, 0x7E61, 0xC043, 0x7E62, 0xC044, + 0x7E63, 0xC045, 0x7E64, 0xC046, 0x7E65, 0xC047, 0x7E66, 0xC048, 0x7E67, 0xC049, 0x7E68, 0xC04A, 0x7E69, 0xC04B, 0x7E6A, 0xC04C, + 0x7E6B, 0xC04D, 0x7E6C, 0xC04E, 0x7E6D, 0xC04F, 0x7E6E, 0xC050, 0x7E6F, 0xC051, 0x7E70, 0xC052, 0x7E71, 0xC053, 0x7E72, 0xC054, + 0x7E73, 0xC055, 0x7E74, 0xC056, 0x7E75, 0xC057, 0x7E76, 0xC058, 0x7E77, 0xC059, 0x7E78, 0xC05A, 0x7E79, 0xC05B, 0x7E7A, 0xC05C, + 0x7E7B, 0xC05D, 0x7E7C, 0xC05E, 0x7E7D, 0xC05F, 0x7E7E, 0xC060, 0x7E7F, 0xC061, 0x7E80, 0xC062, 0x7E81, 0xC063, 0x7E82, 0xD7EB, + 0x7E83, 0xC064, 0x7E84, 0xC065, 0x7E85, 0xC066, 0x7E86, 0xC067, 0x7E87, 0xC068, 0x7E88, 0xC069, 0x7E89, 0xC06A, 0x7E8A, 0xC06B, + 0x7E8B, 0xC06C, 0x7E8C, 0xC06D, 0x7E8D, 0xC06E, 0x7E8E, 0xC06F, 0x7E8F, 0xC070, 0x7E90, 0xC071, 0x7E91, 0xC072, 0x7E92, 0xC073, + 0x7E93, 0xC074, 0x7E94, 0xC075, 0x7E95, 0xC076, 0x7E96, 0xC077, 0x7E97, 0xC078, 0x7E98, 0xC079, 0x7E99, 0xC07A, 0x7E9A, 0xC07B, + 0x7E9B, 0xF4EE, 0x7E9C, 0xC07C, 0x7E9D, 0xC07D, 0x7E9E, 0xC07E, 0x7E9F, 0xE6F9, 0x7EA0, 0xBEC0, 0x7EA1, 0xE6FA, 0x7EA2, 0xBAEC, + 0x7EA3, 0xE6FB, 0x7EA4, 0xCFCB, 0x7EA5, 0xE6FC, 0x7EA6, 0xD4BC, 0x7EA7, 0xBCB6, 0x7EA8, 0xE6FD, 0x7EA9, 0xE6FE, 0x7EAA, 0xBCCD, + 0x7EAB, 0xC8D2, 0x7EAC, 0xCEB3, 0x7EAD, 0xE7A1, 0x7EAE, 0xC080, 0x7EAF, 0xB4BF, 0x7EB0, 0xE7A2, 0x7EB1, 0xC9B4, 0x7EB2, 0xB8D9, + 0x7EB3, 0xC4C9, 0x7EB4, 0xC081, 0x7EB5, 0xD7DD, 0x7EB6, 0xC2DA, 0x7EB7, 0xB7D7, 0x7EB8, 0xD6BD, 0x7EB9, 0xCEC6, 0x7EBA, 0xB7C4, + 0x7EBB, 0xC082, 0x7EBC, 0xC083, 0x7EBD, 0xC5A6, 0x7EBE, 0xE7A3, 0x7EBF, 0xCFDF, 0x7EC0, 0xE7A4, 0x7EC1, 0xE7A5, 0x7EC2, 0xE7A6, + 0x7EC3, 0xC1B7, 0x7EC4, 0xD7E9, 0x7EC5, 0xC9F0, 0x7EC6, 0xCFB8, 0x7EC7, 0xD6AF, 0x7EC8, 0xD6D5, 0x7EC9, 0xE7A7, 0x7ECA, 0xB0ED, + 0x7ECB, 0xE7A8, 0x7ECC, 0xE7A9, 0x7ECD, 0xC9DC, 0x7ECE, 0xD2EF, 0x7ECF, 0xBEAD, 0x7ED0, 0xE7AA, 0x7ED1, 0xB0F3, 0x7ED2, 0xC8DE, + 0x7ED3, 0xBDE1, 0x7ED4, 0xE7AB, 0x7ED5, 0xC8C6, 0x7ED6, 0xC084, 0x7ED7, 0xE7AC, 0x7ED8, 0xBBE6, 0x7ED9, 0xB8F8, 0x7EDA, 0xD1A4, + 0x7EDB, 0xE7AD, 0x7EDC, 0xC2E7, 0x7EDD, 0xBEF8, 0x7EDE, 0xBDCA, 0x7EDF, 0xCDB3, 0x7EE0, 0xE7AE, 0x7EE1, 0xE7AF, 0x7EE2, 0xBEEE, + 0x7EE3, 0xD0E5, 0x7EE4, 0xC085, 0x7EE5, 0xCBE7, 0x7EE6, 0xCCD0, 0x7EE7, 0xBCCC, 0x7EE8, 0xE7B0, 0x7EE9, 0xBCA8, 0x7EEA, 0xD0F7, + 0x7EEB, 0xE7B1, 0x7EEC, 0xC086, 0x7EED, 0xD0F8, 0x7EEE, 0xE7B2, 0x7EEF, 0xE7B3, 0x7EF0, 0xB4C2, 0x7EF1, 0xE7B4, 0x7EF2, 0xE7B5, + 0x7EF3, 0xC9FE, 0x7EF4, 0xCEAC, 0x7EF5, 0xC3E0, 0x7EF6, 0xE7B7, 0x7EF7, 0xB1C1, 0x7EF8, 0xB3F1, 0x7EF9, 0xC087, 0x7EFA, 0xE7B8, + 0x7EFB, 0xE7B9, 0x7EFC, 0xD7DB, 0x7EFD, 0xD5C0, 0x7EFE, 0xE7BA, 0x7EFF, 0xC2CC, 0x7F00, 0xD7BA, 0x7F01, 0xE7BB, 0x7F02, 0xE7BC, + 0x7F03, 0xE7BD, 0x7F04, 0xBCEA, 0x7F05, 0xC3E5, 0x7F06, 0xC0C2, 0x7F07, 0xE7BE, 0x7F08, 0xE7BF, 0x7F09, 0xBCA9, 0x7F0A, 0xC088, + 0x7F0B, 0xE7C0, 0x7F0C, 0xE7C1, 0x7F0D, 0xE7B6, 0x7F0E, 0xB6D0, 0x7F0F, 0xE7C2, 0x7F10, 0xC089, 0x7F11, 0xE7C3, 0x7F12, 0xE7C4, + 0x7F13, 0xBBBA, 0x7F14, 0xB5DE, 0x7F15, 0xC2C6, 0x7F16, 0xB1E0, 0x7F17, 0xE7C5, 0x7F18, 0xD4B5, 0x7F19, 0xE7C6, 0x7F1A, 0xB8BF, + 0x7F1B, 0xE7C8, 0x7F1C, 0xE7C7, 0x7F1D, 0xB7EC, 0x7F1E, 0xC08A, 0x7F1F, 0xE7C9, 0x7F20, 0xB2F8, 0x7F21, 0xE7CA, 0x7F22, 0xE7CB, + 0x7F23, 0xE7CC, 0x7F24, 0xE7CD, 0x7F25, 0xE7CE, 0x7F26, 0xE7CF, 0x7F27, 0xE7D0, 0x7F28, 0xD3A7, 0x7F29, 0xCBF5, 0x7F2A, 0xE7D1, + 0x7F2B, 0xE7D2, 0x7F2C, 0xE7D3, 0x7F2D, 0xE7D4, 0x7F2E, 0xC9C9, 0x7F2F, 0xE7D5, 0x7F30, 0xE7D6, 0x7F31, 0xE7D7, 0x7F32, 0xE7D8, + 0x7F33, 0xE7D9, 0x7F34, 0xBDC9, 0x7F35, 0xE7DA, 0x7F36, 0xF3BE, 0x7F37, 0xC08B, 0x7F38, 0xB8D7, 0x7F39, 0xC08C, 0x7F3A, 0xC8B1, + 0x7F3B, 0xC08D, 0x7F3C, 0xC08E, 0x7F3D, 0xC08F, 0x7F3E, 0xC090, 0x7F3F, 0xC091, 0x7F40, 0xC092, 0x7F41, 0xC093, 0x7F42, 0xF3BF, + 0x7F43, 0xC094, 0x7F44, 0xF3C0, 0x7F45, 0xF3C1, 0x7F46, 0xC095, 0x7F47, 0xC096, 0x7F48, 0xC097, 0x7F49, 0xC098, 0x7F4A, 0xC099, + 0x7F4B, 0xC09A, 0x7F4C, 0xC09B, 0x7F4D, 0xC09C, 0x7F4E, 0xC09D, 0x7F4F, 0xC09E, 0x7F50, 0xB9DE, 0x7F51, 0xCDF8, 0x7F52, 0xC09F, + 0x7F53, 0xC0A0, 0x7F54, 0xD8E8, 0x7F55, 0xBAB1, 0x7F56, 0xC140, 0x7F57, 0xC2DE, 0x7F58, 0xEEB7, 0x7F59, 0xC141, 0x7F5A, 0xB7A3, + 0x7F5B, 0xC142, 0x7F5C, 0xC143, 0x7F5D, 0xC144, 0x7F5E, 0xC145, 0x7F5F, 0xEEB9, 0x7F60, 0xC146, 0x7F61, 0xEEB8, 0x7F62, 0xB0D5, + 0x7F63, 0xC147, 0x7F64, 0xC148, 0x7F65, 0xC149, 0x7F66, 0xC14A, 0x7F67, 0xC14B, 0x7F68, 0xEEBB, 0x7F69, 0xD5D6, 0x7F6A, 0xD7EF, + 0x7F6B, 0xC14C, 0x7F6C, 0xC14D, 0x7F6D, 0xC14E, 0x7F6E, 0xD6C3, 0x7F6F, 0xC14F, 0x7F70, 0xC150, 0x7F71, 0xEEBD, 0x7F72, 0xCAF0, + 0x7F73, 0xC151, 0x7F74, 0xEEBC, 0x7F75, 0xC152, 0x7F76, 0xC153, 0x7F77, 0xC154, 0x7F78, 0xC155, 0x7F79, 0xEEBE, 0x7F7A, 0xC156, + 0x7F7B, 0xC157, 0x7F7C, 0xC158, 0x7F7D, 0xC159, 0x7F7E, 0xEEC0, 0x7F7F, 0xC15A, 0x7F80, 0xC15B, 0x7F81, 0xEEBF, 0x7F82, 0xC15C, + 0x7F83, 0xC15D, 0x7F84, 0xC15E, 0x7F85, 0xC15F, 0x7F86, 0xC160, 0x7F87, 0xC161, 0x7F88, 0xC162, 0x7F89, 0xC163, 0x7F8A, 0xD1F2, + 0x7F8B, 0xC164, 0x7F8C, 0xC7BC, 0x7F8D, 0xC165, 0x7F8E, 0xC3C0, 0x7F8F, 0xC166, 0x7F90, 0xC167, 0x7F91, 0xC168, 0x7F92, 0xC169, + 0x7F93, 0xC16A, 0x7F94, 0xB8E1, 0x7F95, 0xC16B, 0x7F96, 0xC16C, 0x7F97, 0xC16D, 0x7F98, 0xC16E, 0x7F99, 0xC16F, 0x7F9A, 0xC1E7, + 0x7F9B, 0xC170, 0x7F9C, 0xC171, 0x7F9D, 0xF4C6, 0x7F9E, 0xD0DF, 0x7F9F, 0xF4C7, 0x7FA0, 0xC172, 0x7FA1, 0xCFDB, 0x7FA2, 0xC173, + 0x7FA3, 0xC174, 0x7FA4, 0xC8BA, 0x7FA5, 0xC175, 0x7FA6, 0xC176, 0x7FA7, 0xF4C8, 0x7FA8, 0xC177, 0x7FA9, 0xC178, 0x7FAA, 0xC179, + 0x7FAB, 0xC17A, 0x7FAC, 0xC17B, 0x7FAD, 0xC17C, 0x7FAE, 0xC17D, 0x7FAF, 0xF4C9, 0x7FB0, 0xF4CA, 0x7FB1, 0xC17E, 0x7FB2, 0xF4CB, + 0x7FB3, 0xC180, 0x7FB4, 0xC181, 0x7FB5, 0xC182, 0x7FB6, 0xC183, 0x7FB7, 0xC184, 0x7FB8, 0xD9FA, 0x7FB9, 0xB8FE, 0x7FBA, 0xC185, + 0x7FBB, 0xC186, 0x7FBC, 0xE5F1, 0x7FBD, 0xD3F0, 0x7FBE, 0xC187, 0x7FBF, 0xF4E0, 0x7FC0, 0xC188, 0x7FC1, 0xCECC, 0x7FC2, 0xC189, + 0x7FC3, 0xC18A, 0x7FC4, 0xC18B, 0x7FC5, 0xB3E1, 0x7FC6, 0xC18C, 0x7FC7, 0xC18D, 0x7FC8, 0xC18E, 0x7FC9, 0xC18F, 0x7FCA, 0xF1B4, + 0x7FCB, 0xC190, 0x7FCC, 0xD2EE, 0x7FCD, 0xC191, 0x7FCE, 0xF4E1, 0x7FCF, 0xC192, 0x7FD0, 0xC193, 0x7FD1, 0xC194, 0x7FD2, 0xC195, + 0x7FD3, 0xC196, 0x7FD4, 0xCFE8, 0x7FD5, 0xF4E2, 0x7FD6, 0xC197, 0x7FD7, 0xC198, 0x7FD8, 0xC7CC, 0x7FD9, 0xC199, 0x7FDA, 0xC19A, + 0x7FDB, 0xC19B, 0x7FDC, 0xC19C, 0x7FDD, 0xC19D, 0x7FDE, 0xC19E, 0x7FDF, 0xB5D4, 0x7FE0, 0xB4E4, 0x7FE1, 0xF4E4, 0x7FE2, 0xC19F, + 0x7FE3, 0xC1A0, 0x7FE4, 0xC240, 0x7FE5, 0xF4E3, 0x7FE6, 0xF4E5, 0x7FE7, 0xC241, 0x7FE8, 0xC242, 0x7FE9, 0xF4E6, 0x7FEA, 0xC243, + 0x7FEB, 0xC244, 0x7FEC, 0xC245, 0x7FED, 0xC246, 0x7FEE, 0xF4E7, 0x7FEF, 0xC247, 0x7FF0, 0xBAB2, 0x7FF1, 0xB0BF, 0x7FF2, 0xC248, + 0x7FF3, 0xF4E8, 0x7FF4, 0xC249, 0x7FF5, 0xC24A, 0x7FF6, 0xC24B, 0x7FF7, 0xC24C, 0x7FF8, 0xC24D, 0x7FF9, 0xC24E, 0x7FFA, 0xC24F, + 0x7FFB, 0xB7AD, 0x7FFC, 0xD2ED, 0x7FFD, 0xC250, 0x7FFE, 0xC251, 0x7FFF, 0xC252, 0x8000, 0xD2AB, 0x8001, 0xC0CF, 0x8002, 0xC253, + 0x8003, 0xBFBC, 0x8004, 0xEBA3, 0x8005, 0xD5DF, 0x8006, 0xEAC8, 0x8007, 0xC254, 0x8008, 0xC255, 0x8009, 0xC256, 0x800A, 0xC257, + 0x800B, 0xF1F3, 0x800C, 0xB6F8, 0x800D, 0xCBA3, 0x800E, 0xC258, 0x800F, 0xC259, 0x8010, 0xC4CD, 0x8011, 0xC25A, 0x8012, 0xF1E7, + 0x8013, 0xC25B, 0x8014, 0xF1E8, 0x8015, 0xB8FB, 0x8016, 0xF1E9, 0x8017, 0xBAC4, 0x8018, 0xD4C5, 0x8019, 0xB0D2, 0x801A, 0xC25C, + 0x801B, 0xC25D, 0x801C, 0xF1EA, 0x801D, 0xC25E, 0x801E, 0xC25F, 0x801F, 0xC260, 0x8020, 0xF1EB, 0x8021, 0xC261, 0x8022, 0xF1EC, + 0x8023, 0xC262, 0x8024, 0xC263, 0x8025, 0xF1ED, 0x8026, 0xF1EE, 0x8027, 0xF1EF, 0x8028, 0xF1F1, 0x8029, 0xF1F0, 0x802A, 0xC5D5, + 0x802B, 0xC264, 0x802C, 0xC265, 0x802D, 0xC266, 0x802E, 0xC267, 0x802F, 0xC268, 0x8030, 0xC269, 0x8031, 0xF1F2, 0x8032, 0xC26A, + 0x8033, 0xB6FA, 0x8034, 0xC26B, 0x8035, 0xF1F4, 0x8036, 0xD2AE, 0x8037, 0xDEC7, 0x8038, 0xCBCA, 0x8039, 0xC26C, 0x803A, 0xC26D, + 0x803B, 0xB3DC, 0x803C, 0xC26E, 0x803D, 0xB5A2, 0x803E, 0xC26F, 0x803F, 0xB9A2, 0x8040, 0xC270, 0x8041, 0xC271, 0x8042, 0xC4F4, + 0x8043, 0xF1F5, 0x8044, 0xC272, 0x8045, 0xC273, 0x8046, 0xF1F6, 0x8047, 0xC274, 0x8048, 0xC275, 0x8049, 0xC276, 0x804A, 0xC1C4, + 0x804B, 0xC1FB, 0x804C, 0xD6B0, 0x804D, 0xF1F7, 0x804E, 0xC277, 0x804F, 0xC278, 0x8050, 0xC279, 0x8051, 0xC27A, 0x8052, 0xF1F8, + 0x8053, 0xC27B, 0x8054, 0xC1AA, 0x8055, 0xC27C, 0x8056, 0xC27D, 0x8057, 0xC27E, 0x8058, 0xC6B8, 0x8059, 0xC280, 0x805A, 0xBEDB, + 0x805B, 0xC281, 0x805C, 0xC282, 0x805D, 0xC283, 0x805E, 0xC284, 0x805F, 0xC285, 0x8060, 0xC286, 0x8061, 0xC287, 0x8062, 0xC288, + 0x8063, 0xC289, 0x8064, 0xC28A, 0x8065, 0xC28B, 0x8066, 0xC28C, 0x8067, 0xC28D, 0x8068, 0xC28E, 0x8069, 0xF1F9, 0x806A, 0xB4CF, + 0x806B, 0xC28F, 0x806C, 0xC290, 0x806D, 0xC291, 0x806E, 0xC292, 0x806F, 0xC293, 0x8070, 0xC294, 0x8071, 0xF1FA, 0x8072, 0xC295, + 0x8073, 0xC296, 0x8074, 0xC297, 0x8075, 0xC298, 0x8076, 0xC299, 0x8077, 0xC29A, 0x8078, 0xC29B, 0x8079, 0xC29C, 0x807A, 0xC29D, + 0x807B, 0xC29E, 0x807C, 0xC29F, 0x807D, 0xC2A0, 0x807E, 0xC340, 0x807F, 0xEDB2, 0x8080, 0xEDB1, 0x8081, 0xC341, 0x8082, 0xC342, + 0x8083, 0xCBE0, 0x8084, 0xD2DE, 0x8085, 0xC343, 0x8086, 0xCBC1, 0x8087, 0xD5D8, 0x8088, 0xC344, 0x8089, 0xC8E2, 0x808A, 0xC345, + 0x808B, 0xC0DF, 0x808C, 0xBCA1, 0x808D, 0xC346, 0x808E, 0xC347, 0x808F, 0xC348, 0x8090, 0xC349, 0x8091, 0xC34A, 0x8092, 0xC34B, + 0x8093, 0xEBC1, 0x8094, 0xC34C, 0x8095, 0xC34D, 0x8096, 0xD0A4, 0x8097, 0xC34E, 0x8098, 0xD6E2, 0x8099, 0xC34F, 0x809A, 0xB6C7, + 0x809B, 0xB8D8, 0x809C, 0xEBC0, 0x809D, 0xB8CE, 0x809E, 0xC350, 0x809F, 0xEBBF, 0x80A0, 0xB3A6, 0x80A1, 0xB9C9, 0x80A2, 0xD6AB, + 0x80A3, 0xC351, 0x80A4, 0xB7F4, 0x80A5, 0xB7CA, 0x80A6, 0xC352, 0x80A7, 0xC353, 0x80A8, 0xC354, 0x80A9, 0xBCE7, 0x80AA, 0xB7BE, + 0x80AB, 0xEBC6, 0x80AC, 0xC355, 0x80AD, 0xEBC7, 0x80AE, 0xB0B9, 0x80AF, 0xBFCF, 0x80B0, 0xC356, 0x80B1, 0xEBC5, 0x80B2, 0xD3FD, + 0x80B3, 0xC357, 0x80B4, 0xEBC8, 0x80B5, 0xC358, 0x80B6, 0xC359, 0x80B7, 0xEBC9, 0x80B8, 0xC35A, 0x80B9, 0xC35B, 0x80BA, 0xB7CE, + 0x80BB, 0xC35C, 0x80BC, 0xEBC2, 0x80BD, 0xEBC4, 0x80BE, 0xC9F6, 0x80BF, 0xD6D7, 0x80C0, 0xD5CD, 0x80C1, 0xD0B2, 0x80C2, 0xEBCF, + 0x80C3, 0xCEB8, 0x80C4, 0xEBD0, 0x80C5, 0xC35D, 0x80C6, 0xB5A8, 0x80C7, 0xC35E, 0x80C8, 0xC35F, 0x80C9, 0xC360, 0x80CA, 0xC361, + 0x80CB, 0xC362, 0x80CC, 0xB1B3, 0x80CD, 0xEBD2, 0x80CE, 0xCCA5, 0x80CF, 0xC363, 0x80D0, 0xC364, 0x80D1, 0xC365, 0x80D2, 0xC366, + 0x80D3, 0xC367, 0x80D4, 0xC368, 0x80D5, 0xC369, 0x80D6, 0xC5D6, 0x80D7, 0xEBD3, 0x80D8, 0xC36A, 0x80D9, 0xEBD1, 0x80DA, 0xC5DF, + 0x80DB, 0xEBCE, 0x80DC, 0xCAA4, 0x80DD, 0xEBD5, 0x80DE, 0xB0FB, 0x80DF, 0xC36B, 0x80E0, 0xC36C, 0x80E1, 0xBAFA, 0x80E2, 0xC36D, + 0x80E3, 0xC36E, 0x80E4, 0xD8B7, 0x80E5, 0xF1E3, 0x80E6, 0xC36F, 0x80E7, 0xEBCA, 0x80E8, 0xEBCB, 0x80E9, 0xEBCC, 0x80EA, 0xEBCD, + 0x80EB, 0xEBD6, 0x80EC, 0xE6C0, 0x80ED, 0xEBD9, 0x80EE, 0xC370, 0x80EF, 0xBFE8, 0x80F0, 0xD2C8, 0x80F1, 0xEBD7, 0x80F2, 0xEBDC, + 0x80F3, 0xB8EC, 0x80F4, 0xEBD8, 0x80F5, 0xC371, 0x80F6, 0xBDBA, 0x80F7, 0xC372, 0x80F8, 0xD0D8, 0x80F9, 0xC373, 0x80FA, 0xB0B7, + 0x80FB, 0xC374, 0x80FC, 0xEBDD, 0x80FD, 0xC4DC, 0x80FE, 0xC375, 0x80FF, 0xC376, 0x8100, 0xC377, 0x8101, 0xC378, 0x8102, 0xD6AC, + 0x8103, 0xC379, 0x8104, 0xC37A, 0x8105, 0xC37B, 0x8106, 0xB4E0, 0x8107, 0xC37C, 0x8108, 0xC37D, 0x8109, 0xC2F6, 0x810A, 0xBCB9, + 0x810B, 0xC37E, 0x810C, 0xC380, 0x810D, 0xEBDA, 0x810E, 0xEBDB, 0x810F, 0xD4E0, 0x8110, 0xC6EA, 0x8111, 0xC4D4, 0x8112, 0xEBDF, + 0x8113, 0xC5A7, 0x8114, 0xD9F5, 0x8115, 0xC381, 0x8116, 0xB2B1, 0x8117, 0xC382, 0x8118, 0xEBE4, 0x8119, 0xC383, 0x811A, 0xBDC5, + 0x811B, 0xC384, 0x811C, 0xC385, 0x811D, 0xC386, 0x811E, 0xEBE2, 0x811F, 0xC387, 0x8120, 0xC388, 0x8121, 0xC389, 0x8122, 0xC38A, + 0x8123, 0xC38B, 0x8124, 0xC38C, 0x8125, 0xC38D, 0x8126, 0xC38E, 0x8127, 0xC38F, 0x8128, 0xC390, 0x8129, 0xC391, 0x812A, 0xC392, + 0x812B, 0xC393, 0x812C, 0xEBE3, 0x812D, 0xC394, 0x812E, 0xC395, 0x812F, 0xB8AC, 0x8130, 0xC396, 0x8131, 0xCDD1, 0x8132, 0xEBE5, + 0x8133, 0xC397, 0x8134, 0xC398, 0x8135, 0xC399, 0x8136, 0xEBE1, 0x8137, 0xC39A, 0x8138, 0xC1B3, 0x8139, 0xC39B, 0x813A, 0xC39C, + 0x813B, 0xC39D, 0x813C, 0xC39E, 0x813D, 0xC39F, 0x813E, 0xC6A2, 0x813F, 0xC3A0, 0x8140, 0xC440, 0x8141, 0xC441, 0x8142, 0xC442, + 0x8143, 0xC443, 0x8144, 0xC444, 0x8145, 0xC445, 0x8146, 0xCCF3, 0x8147, 0xC446, 0x8148, 0xEBE6, 0x8149, 0xC447, 0x814A, 0xC0B0, + 0x814B, 0xD2B8, 0x814C, 0xEBE7, 0x814D, 0xC448, 0x814E, 0xC449, 0x814F, 0xC44A, 0x8150, 0xB8AF, 0x8151, 0xB8AD, 0x8152, 0xC44B, + 0x8153, 0xEBE8, 0x8154, 0xC7BB, 0x8155, 0xCDF3, 0x8156, 0xC44C, 0x8157, 0xC44D, 0x8158, 0xC44E, 0x8159, 0xEBEA, 0x815A, 0xEBEB, + 0x815B, 0xC44F, 0x815C, 0xC450, 0x815D, 0xC451, 0x815E, 0xC452, 0x815F, 0xC453, 0x8160, 0xEBED, 0x8161, 0xC454, 0x8162, 0xC455, + 0x8163, 0xC456, 0x8164, 0xC457, 0x8165, 0xD0C8, 0x8166, 0xC458, 0x8167, 0xEBF2, 0x8168, 0xC459, 0x8169, 0xEBEE, 0x816A, 0xC45A, + 0x816B, 0xC45B, 0x816C, 0xC45C, 0x816D, 0xEBF1, 0x816E, 0xC8F9, 0x816F, 0xC45D, 0x8170, 0xD1FC, 0x8171, 0xEBEC, 0x8172, 0xC45E, + 0x8173, 0xC45F, 0x8174, 0xEBE9, 0x8175, 0xC460, 0x8176, 0xC461, 0x8177, 0xC462, 0x8178, 0xC463, 0x8179, 0xB8B9, 0x817A, 0xCFD9, + 0x817B, 0xC4E5, 0x817C, 0xEBEF, 0x817D, 0xEBF0, 0x817E, 0xCCDA, 0x817F, 0xCDC8, 0x8180, 0xB0F2, 0x8181, 0xC464, 0x8182, 0xEBF6, + 0x8183, 0xC465, 0x8184, 0xC466, 0x8185, 0xC467, 0x8186, 0xC468, 0x8187, 0xC469, 0x8188, 0xEBF5, 0x8189, 0xC46A, 0x818A, 0xB2B2, + 0x818B, 0xC46B, 0x818C, 0xC46C, 0x818D, 0xC46D, 0x818E, 0xC46E, 0x818F, 0xB8E0, 0x8190, 0xC46F, 0x8191, 0xEBF7, 0x8192, 0xC470, + 0x8193, 0xC471, 0x8194, 0xC472, 0x8195, 0xC473, 0x8196, 0xC474, 0x8197, 0xC475, 0x8198, 0xB1EC, 0x8199, 0xC476, 0x819A, 0xC477, + 0x819B, 0xCCC5, 0x819C, 0xC4A4, 0x819D, 0xCFA5, 0x819E, 0xC478, 0x819F, 0xC479, 0x81A0, 0xC47A, 0x81A1, 0xC47B, 0x81A2, 0xC47C, + 0x81A3, 0xEBF9, 0x81A4, 0xC47D, 0x81A5, 0xC47E, 0x81A6, 0xECA2, 0x81A7, 0xC480, 0x81A8, 0xC5F2, 0x81A9, 0xC481, 0x81AA, 0xEBFA, + 0x81AB, 0xC482, 0x81AC, 0xC483, 0x81AD, 0xC484, 0x81AE, 0xC485, 0x81AF, 0xC486, 0x81B0, 0xC487, 0x81B1, 0xC488, 0x81B2, 0xC489, + 0x81B3, 0xC9C5, 0x81B4, 0xC48A, 0x81B5, 0xC48B, 0x81B6, 0xC48C, 0x81B7, 0xC48D, 0x81B8, 0xC48E, 0x81B9, 0xC48F, 0x81BA, 0xE2DF, + 0x81BB, 0xEBFE, 0x81BC, 0xC490, 0x81BD, 0xC491, 0x81BE, 0xC492, 0x81BF, 0xC493, 0x81C0, 0xCDCE, 0x81C1, 0xECA1, 0x81C2, 0xB1DB, + 0x81C3, 0xD3B7, 0x81C4, 0xC494, 0x81C5, 0xC495, 0x81C6, 0xD2DC, 0x81C7, 0xC496, 0x81C8, 0xC497, 0x81C9, 0xC498, 0x81CA, 0xEBFD, + 0x81CB, 0xC499, 0x81CC, 0xEBFB, 0x81CD, 0xC49A, 0x81CE, 0xC49B, 0x81CF, 0xC49C, 0x81D0, 0xC49D, 0x81D1, 0xC49E, 0x81D2, 0xC49F, + 0x81D3, 0xC4A0, 0x81D4, 0xC540, 0x81D5, 0xC541, 0x81D6, 0xC542, 0x81D7, 0xC543, 0x81D8, 0xC544, 0x81D9, 0xC545, 0x81DA, 0xC546, + 0x81DB, 0xC547, 0x81DC, 0xC548, 0x81DD, 0xC549, 0x81DE, 0xC54A, 0x81DF, 0xC54B, 0x81E0, 0xC54C, 0x81E1, 0xC54D, 0x81E2, 0xC54E, + 0x81E3, 0xB3BC, 0x81E4, 0xC54F, 0x81E5, 0xC550, 0x81E6, 0xC551, 0x81E7, 0xEAB0, 0x81E8, 0xC552, 0x81E9, 0xC553, 0x81EA, 0xD7D4, + 0x81EB, 0xC554, 0x81EC, 0xF4AB, 0x81ED, 0xB3F4, 0x81EE, 0xC555, 0x81EF, 0xC556, 0x81F0, 0xC557, 0x81F1, 0xC558, 0x81F2, 0xC559, + 0x81F3, 0xD6C1, 0x81F4, 0xD6C2, 0x81F5, 0xC55A, 0x81F6, 0xC55B, 0x81F7, 0xC55C, 0x81F8, 0xC55D, 0x81F9, 0xC55E, 0x81FA, 0xC55F, + 0x81FB, 0xD5E9, 0x81FC, 0xBECA, 0x81FD, 0xC560, 0x81FE, 0xF4A7, 0x81FF, 0xC561, 0x8200, 0xD2A8, 0x8201, 0xF4A8, 0x8202, 0xF4A9, + 0x8203, 0xC562, 0x8204, 0xF4AA, 0x8205, 0xBECB, 0x8206, 0xD3DF, 0x8207, 0xC563, 0x8208, 0xC564, 0x8209, 0xC565, 0x820A, 0xC566, + 0x820B, 0xC567, 0x820C, 0xC9E0, 0x820D, 0xC9E1, 0x820E, 0xC568, 0x820F, 0xC569, 0x8210, 0xF3C2, 0x8211, 0xC56A, 0x8212, 0xCAE6, + 0x8213, 0xC56B, 0x8214, 0xCCF2, 0x8215, 0xC56C, 0x8216, 0xC56D, 0x8217, 0xC56E, 0x8218, 0xC56F, 0x8219, 0xC570, 0x821A, 0xC571, + 0x821B, 0xE2B6, 0x821C, 0xCBB4, 0x821D, 0xC572, 0x821E, 0xCEE8, 0x821F, 0xD6DB, 0x8220, 0xC573, 0x8221, 0xF4AD, 0x8222, 0xF4AE, + 0x8223, 0xF4AF, 0x8224, 0xC574, 0x8225, 0xC575, 0x8226, 0xC576, 0x8227, 0xC577, 0x8228, 0xF4B2, 0x8229, 0xC578, 0x822A, 0xBABD, + 0x822B, 0xF4B3, 0x822C, 0xB0E3, 0x822D, 0xF4B0, 0x822E, 0xC579, 0x822F, 0xF4B1, 0x8230, 0xBDA2, 0x8231, 0xB2D5, 0x8232, 0xC57A, + 0x8233, 0xF4B6, 0x8234, 0xF4B7, 0x8235, 0xB6E6, 0x8236, 0xB2B0, 0x8237, 0xCFCF, 0x8238, 0xF4B4, 0x8239, 0xB4AC, 0x823A, 0xC57B, + 0x823B, 0xF4B5, 0x823C, 0xC57C, 0x823D, 0xC57D, 0x823E, 0xF4B8, 0x823F, 0xC57E, 0x8240, 0xC580, 0x8241, 0xC581, 0x8242, 0xC582, + 0x8243, 0xC583, 0x8244, 0xF4B9, 0x8245, 0xC584, 0x8246, 0xC585, 0x8247, 0xCDA7, 0x8248, 0xC586, 0x8249, 0xF4BA, 0x824A, 0xC587, + 0x824B, 0xF4BB, 0x824C, 0xC588, 0x824D, 0xC589, 0x824E, 0xC58A, 0x824F, 0xF4BC, 0x8250, 0xC58B, 0x8251, 0xC58C, 0x8252, 0xC58D, + 0x8253, 0xC58E, 0x8254, 0xC58F, 0x8255, 0xC590, 0x8256, 0xC591, 0x8257, 0xC592, 0x8258, 0xCBD2, 0x8259, 0xC593, 0x825A, 0xF4BD, + 0x825B, 0xC594, 0x825C, 0xC595, 0x825D, 0xC596, 0x825E, 0xC597, 0x825F, 0xF4BE, 0x8260, 0xC598, 0x8261, 0xC599, 0x8262, 0xC59A, + 0x8263, 0xC59B, 0x8264, 0xC59C, 0x8265, 0xC59D, 0x8266, 0xC59E, 0x8267, 0xC59F, 0x8268, 0xF4BF, 0x8269, 0xC5A0, 0x826A, 0xC640, + 0x826B, 0xC641, 0x826C, 0xC642, 0x826D, 0xC643, 0x826E, 0xF4DE, 0x826F, 0xC1BC, 0x8270, 0xBCE8, 0x8271, 0xC644, 0x8272, 0xC9AB, + 0x8273, 0xD1DE, 0x8274, 0xE5F5, 0x8275, 0xC645, 0x8276, 0xC646, 0x8277, 0xC647, 0x8278, 0xC648, 0x8279, 0xDCB3, 0x827A, 0xD2D5, + 0x827B, 0xC649, 0x827C, 0xC64A, 0x827D, 0xDCB4, 0x827E, 0xB0AC, 0x827F, 0xDCB5, 0x8280, 0xC64B, 0x8281, 0xC64C, 0x8282, 0xBDDA, + 0x8283, 0xC64D, 0x8284, 0xDCB9, 0x8285, 0xC64E, 0x8286, 0xC64F, 0x8287, 0xC650, 0x8288, 0xD8C2, 0x8289, 0xC651, 0x828A, 0xDCB7, + 0x828B, 0xD3F3, 0x828C, 0xC652, 0x828D, 0xC9D6, 0x828E, 0xDCBA, 0x828F, 0xDCB6, 0x8290, 0xC653, 0x8291, 0xDCBB, 0x8292, 0xC3A2, + 0x8293, 0xC654, 0x8294, 0xC655, 0x8295, 0xC656, 0x8296, 0xC657, 0x8297, 0xDCBC, 0x8298, 0xDCC5, 0x8299, 0xDCBD, 0x829A, 0xC658, + 0x829B, 0xC659, 0x829C, 0xCEDF, 0x829D, 0xD6A5, 0x829E, 0xC65A, 0x829F, 0xDCCF, 0x82A0, 0xC65B, 0x82A1, 0xDCCD, 0x82A2, 0xC65C, + 0x82A3, 0xC65D, 0x82A4, 0xDCD2, 0x82A5, 0xBDE6, 0x82A6, 0xC2AB, 0x82A7, 0xC65E, 0x82A8, 0xDCB8, 0x82A9, 0xDCCB, 0x82AA, 0xDCCE, + 0x82AB, 0xDCBE, 0x82AC, 0xB7D2, 0x82AD, 0xB0C5, 0x82AE, 0xDCC7, 0x82AF, 0xD0BE, 0x82B0, 0xDCC1, 0x82B1, 0xBBA8, 0x82B2, 0xC65F, + 0x82B3, 0xB7BC, 0x82B4, 0xDCCC, 0x82B5, 0xC660, 0x82B6, 0xC661, 0x82B7, 0xDCC6, 0x82B8, 0xDCBF, 0x82B9, 0xC7DB, 0x82BA, 0xC662, + 0x82BB, 0xC663, 0x82BC, 0xC664, 0x82BD, 0xD1BF, 0x82BE, 0xDCC0, 0x82BF, 0xC665, 0x82C0, 0xC666, 0x82C1, 0xDCCA, 0x82C2, 0xC667, + 0x82C3, 0xC668, 0x82C4, 0xDCD0, 0x82C5, 0xC669, 0x82C6, 0xC66A, 0x82C7, 0xCEAD, 0x82C8, 0xDCC2, 0x82C9, 0xC66B, 0x82CA, 0xDCC3, + 0x82CB, 0xDCC8, 0x82CC, 0xDCC9, 0x82CD, 0xB2D4, 0x82CE, 0xDCD1, 0x82CF, 0xCBD5, 0x82D0, 0xC66C, 0x82D1, 0xD4B7, 0x82D2, 0xDCDB, + 0x82D3, 0xDCDF, 0x82D4, 0xCCA6, 0x82D5, 0xDCE6, 0x82D6, 0xC66D, 0x82D7, 0xC3E7, 0x82D8, 0xDCDC, 0x82D9, 0xC66E, 0x82DA, 0xC66F, + 0x82DB, 0xBFC1, 0x82DC, 0xDCD9, 0x82DD, 0xC670, 0x82DE, 0xB0FA, 0x82DF, 0xB9B6, 0x82E0, 0xDCE5, 0x82E1, 0xDCD3, 0x82E2, 0xC671, + 0x82E3, 0xDCC4, 0x82E4, 0xDCD6, 0x82E5, 0xC8F4, 0x82E6, 0xBFE0, 0x82E7, 0xC672, 0x82E8, 0xC673, 0x82E9, 0xC674, 0x82EA, 0xC675, + 0x82EB, 0xC9BB, 0x82EC, 0xC676, 0x82ED, 0xC677, 0x82EE, 0xC678, 0x82EF, 0xB1BD, 0x82F0, 0xC679, 0x82F1, 0xD3A2, 0x82F2, 0xC67A, + 0x82F3, 0xC67B, 0x82F4, 0xDCDA, 0x82F5, 0xC67C, 0x82F6, 0xC67D, 0x82F7, 0xDCD5, 0x82F8, 0xC67E, 0x82F9, 0xC6BB, 0x82FA, 0xC680, + 0x82FB, 0xDCDE, 0x82FC, 0xC681, 0x82FD, 0xC682, 0x82FE, 0xC683, 0x82FF, 0xC684, 0x8300, 0xC685, 0x8301, 0xD7C2, 0x8302, 0xC3AF, + 0x8303, 0xB7B6, 0x8304, 0xC7D1, 0x8305, 0xC3A9, 0x8306, 0xDCE2, 0x8307, 0xDCD8, 0x8308, 0xDCEB, 0x8309, 0xDCD4, 0x830A, 0xC686, + 0x830B, 0xC687, 0x830C, 0xDCDD, 0x830D, 0xC688, 0x830E, 0xBEA5, 0x830F, 0xDCD7, 0x8310, 0xC689, 0x8311, 0xDCE0, 0x8312, 0xC68A, + 0x8313, 0xC68B, 0x8314, 0xDCE3, 0x8315, 0xDCE4, 0x8316, 0xC68C, 0x8317, 0xDCF8, 0x8318, 0xC68D, 0x8319, 0xC68E, 0x831A, 0xDCE1, + 0x831B, 0xDDA2, 0x831C, 0xDCE7, 0x831D, 0xC68F, 0x831E, 0xC690, 0x831F, 0xC691, 0x8320, 0xC692, 0x8321, 0xC693, 0x8322, 0xC694, + 0x8323, 0xC695, 0x8324, 0xC696, 0x8325, 0xC697, 0x8326, 0xC698, 0x8327, 0xBCEB, 0x8328, 0xB4C4, 0x8329, 0xC699, 0x832A, 0xC69A, + 0x832B, 0xC3A3, 0x832C, 0xB2E7, 0x832D, 0xDCFA, 0x832E, 0xC69B, 0x832F, 0xDCF2, 0x8330, 0xC69C, 0x8331, 0xDCEF, 0x8332, 0xC69D, + 0x8333, 0xDCFC, 0x8334, 0xDCEE, 0x8335, 0xD2F0, 0x8336, 0xB2E8, 0x8337, 0xC69E, 0x8338, 0xC8D7, 0x8339, 0xC8E3, 0x833A, 0xDCFB, + 0x833B, 0xC69F, 0x833C, 0xDCED, 0x833D, 0xC6A0, 0x833E, 0xC740, 0x833F, 0xC741, 0x8340, 0xDCF7, 0x8341, 0xC742, 0x8342, 0xC743, + 0x8343, 0xDCF5, 0x8344, 0xC744, 0x8345, 0xC745, 0x8346, 0xBEA3, 0x8347, 0xDCF4, 0x8348, 0xC746, 0x8349, 0xB2DD, 0x834A, 0xC747, + 0x834B, 0xC748, 0x834C, 0xC749, 0x834D, 0xC74A, 0x834E, 0xC74B, 0x834F, 0xDCF3, 0x8350, 0xBCF6, 0x8351, 0xDCE8, 0x8352, 0xBBC4, + 0x8353, 0xC74C, 0x8354, 0xC0F3, 0x8355, 0xC74D, 0x8356, 0xC74E, 0x8357, 0xC74F, 0x8358, 0xC750, 0x8359, 0xC751, 0x835A, 0xBCD4, + 0x835B, 0xDCE9, 0x835C, 0xDCEA, 0x835D, 0xC752, 0x835E, 0xDCF1, 0x835F, 0xDCF6, 0x8360, 0xDCF9, 0x8361, 0xB5B4, 0x8362, 0xC753, + 0x8363, 0xC8D9, 0x8364, 0xBBE7, 0x8365, 0xDCFE, 0x8366, 0xDCFD, 0x8367, 0xD3AB, 0x8368, 0xDDA1, 0x8369, 0xDDA3, 0x836A, 0xDDA5, + 0x836B, 0xD2F1, 0x836C, 0xDDA4, 0x836D, 0xDDA6, 0x836E, 0xDDA7, 0x836F, 0xD2A9, 0x8370, 0xC754, 0x8371, 0xC755, 0x8372, 0xC756, + 0x8373, 0xC757, 0x8374, 0xC758, 0x8375, 0xC759, 0x8376, 0xC75A, 0x8377, 0xBAC9, 0x8378, 0xDDA9, 0x8379, 0xC75B, 0x837A, 0xC75C, + 0x837B, 0xDDB6, 0x837C, 0xDDB1, 0x837D, 0xDDB4, 0x837E, 0xC75D, 0x837F, 0xC75E, 0x8380, 0xC75F, 0x8381, 0xC760, 0x8382, 0xC761, + 0x8383, 0xC762, 0x8384, 0xC763, 0x8385, 0xDDB0, 0x8386, 0xC6CE, 0x8387, 0xC764, 0x8388, 0xC765, 0x8389, 0xC0F2, 0x838A, 0xC766, + 0x838B, 0xC767, 0x838C, 0xC768, 0x838D, 0xC769, 0x838E, 0xC9AF, 0x838F, 0xC76A, 0x8390, 0xC76B, 0x8391, 0xC76C, 0x8392, 0xDCEC, + 0x8393, 0xDDAE, 0x8394, 0xC76D, 0x8395, 0xC76E, 0x8396, 0xC76F, 0x8397, 0xC770, 0x8398, 0xDDB7, 0x8399, 0xC771, 0x839A, 0xC772, + 0x839B, 0xDCF0, 0x839C, 0xDDAF, 0x839D, 0xC773, 0x839E, 0xDDB8, 0x839F, 0xC774, 0x83A0, 0xDDAC, 0x83A1, 0xC775, 0x83A2, 0xC776, + 0x83A3, 0xC777, 0x83A4, 0xC778, 0x83A5, 0xC779, 0x83A6, 0xC77A, 0x83A7, 0xC77B, 0x83A8, 0xDDB9, 0x83A9, 0xDDB3, 0x83AA, 0xDDAD, + 0x83AB, 0xC4AA, 0x83AC, 0xC77C, 0x83AD, 0xC77D, 0x83AE, 0xC77E, 0x83AF, 0xC780, 0x83B0, 0xDDA8, 0x83B1, 0xC0B3, 0x83B2, 0xC1AB, + 0x83B3, 0xDDAA, 0x83B4, 0xDDAB, 0x83B5, 0xC781, 0x83B6, 0xDDB2, 0x83B7, 0xBBF1, 0x83B8, 0xDDB5, 0x83B9, 0xD3A8, 0x83BA, 0xDDBA, + 0x83BB, 0xC782, 0x83BC, 0xDDBB, 0x83BD, 0xC3A7, 0x83BE, 0xC783, 0x83BF, 0xC784, 0x83C0, 0xDDD2, 0x83C1, 0xDDBC, 0x83C2, 0xC785, + 0x83C3, 0xC786, 0x83C4, 0xC787, 0x83C5, 0xDDD1, 0x83C6, 0xC788, 0x83C7, 0xB9BD, 0x83C8, 0xC789, 0x83C9, 0xC78A, 0x83CA, 0xBED5, + 0x83CB, 0xC78B, 0x83CC, 0xBEFA, 0x83CD, 0xC78C, 0x83CE, 0xC78D, 0x83CF, 0xBACA, 0x83D0, 0xC78E, 0x83D1, 0xC78F, 0x83D2, 0xC790, + 0x83D3, 0xC791, 0x83D4, 0xDDCA, 0x83D5, 0xC792, 0x83D6, 0xDDC5, 0x83D7, 0xC793, 0x83D8, 0xDDBF, 0x83D9, 0xC794, 0x83DA, 0xC795, + 0x83DB, 0xC796, 0x83DC, 0xB2CB, 0x83DD, 0xDDC3, 0x83DE, 0xC797, 0x83DF, 0xDDCB, 0x83E0, 0xB2A4, 0x83E1, 0xDDD5, 0x83E2, 0xC798, + 0x83E3, 0xC799, 0x83E4, 0xC79A, 0x83E5, 0xDDBE, 0x83E6, 0xC79B, 0x83E7, 0xC79C, 0x83E8, 0xC79D, 0x83E9, 0xC6D0, 0x83EA, 0xDDD0, + 0x83EB, 0xC79E, 0x83EC, 0xC79F, 0x83ED, 0xC7A0, 0x83EE, 0xC840, 0x83EF, 0xC841, 0x83F0, 0xDDD4, 0x83F1, 0xC1E2, 0x83F2, 0xB7C6, + 0x83F3, 0xC842, 0x83F4, 0xC843, 0x83F5, 0xC844, 0x83F6, 0xC845, 0x83F7, 0xC846, 0x83F8, 0xDDCE, 0x83F9, 0xDDCF, 0x83FA, 0xC847, + 0x83FB, 0xC848, 0x83FC, 0xC849, 0x83FD, 0xDDC4, 0x83FE, 0xC84A, 0x83FF, 0xC84B, 0x8400, 0xC84C, 0x8401, 0xDDBD, 0x8402, 0xC84D, + 0x8403, 0xDDCD, 0x8404, 0xCCD1, 0x8405, 0xC84E, 0x8406, 0xDDC9, 0x8407, 0xC84F, 0x8408, 0xC850, 0x8409, 0xC851, 0x840A, 0xC852, + 0x840B, 0xDDC2, 0x840C, 0xC3C8, 0x840D, 0xC6BC, 0x840E, 0xCEAE, 0x840F, 0xDDCC, 0x8410, 0xC853, 0x8411, 0xDDC8, 0x8412, 0xC854, + 0x8413, 0xC855, 0x8414, 0xC856, 0x8415, 0xC857, 0x8416, 0xC858, 0x8417, 0xC859, 0x8418, 0xDDC1, 0x8419, 0xC85A, 0x841A, 0xC85B, + 0x841B, 0xC85C, 0x841C, 0xDDC6, 0x841D, 0xC2DC, 0x841E, 0xC85D, 0x841F, 0xC85E, 0x8420, 0xC85F, 0x8421, 0xC860, 0x8422, 0xC861, + 0x8423, 0xC862, 0x8424, 0xD3A9, 0x8425, 0xD3AA, 0x8426, 0xDDD3, 0x8427, 0xCFF4, 0x8428, 0xC8F8, 0x8429, 0xC863, 0x842A, 0xC864, + 0x842B, 0xC865, 0x842C, 0xC866, 0x842D, 0xC867, 0x842E, 0xC868, 0x842F, 0xC869, 0x8430, 0xC86A, 0x8431, 0xDDE6, 0x8432, 0xC86B, + 0x8433, 0xC86C, 0x8434, 0xC86D, 0x8435, 0xC86E, 0x8436, 0xC86F, 0x8437, 0xC870, 0x8438, 0xDDC7, 0x8439, 0xC871, 0x843A, 0xC872, + 0x843B, 0xC873, 0x843C, 0xDDE0, 0x843D, 0xC2E4, 0x843E, 0xC874, 0x843F, 0xC875, 0x8440, 0xC876, 0x8441, 0xC877, 0x8442, 0xC878, + 0x8443, 0xC879, 0x8444, 0xC87A, 0x8445, 0xC87B, 0x8446, 0xDDE1, 0x8447, 0xC87C, 0x8448, 0xC87D, 0x8449, 0xC87E, 0x844A, 0xC880, + 0x844B, 0xC881, 0x844C, 0xC882, 0x844D, 0xC883, 0x844E, 0xC884, 0x844F, 0xC885, 0x8450, 0xC886, 0x8451, 0xDDD7, 0x8452, 0xC887, + 0x8453, 0xC888, 0x8454, 0xC889, 0x8455, 0xC88A, 0x8456, 0xC88B, 0x8457, 0xD6F8, 0x8458, 0xC88C, 0x8459, 0xDDD9, 0x845A, 0xDDD8, + 0x845B, 0xB8F0, 0x845C, 0xDDD6, 0x845D, 0xC88D, 0x845E, 0xC88E, 0x845F, 0xC88F, 0x8460, 0xC890, 0x8461, 0xC6CF, 0x8462, 0xC891, + 0x8463, 0xB6AD, 0x8464, 0xC892, 0x8465, 0xC893, 0x8466, 0xC894, 0x8467, 0xC895, 0x8468, 0xC896, 0x8469, 0xDDE2, 0x846A, 0xC897, + 0x846B, 0xBAF9, 0x846C, 0xD4E1, 0x846D, 0xDDE7, 0x846E, 0xC898, 0x846F, 0xC899, 0x8470, 0xC89A, 0x8471, 0xB4D0, 0x8472, 0xC89B, + 0x8473, 0xDDDA, 0x8474, 0xC89C, 0x8475, 0xBFFB, 0x8476, 0xDDE3, 0x8477, 0xC89D, 0x8478, 0xDDDF, 0x8479, 0xC89E, 0x847A, 0xDDDD, + 0x847B, 0xC89F, 0x847C, 0xC8A0, 0x847D, 0xC940, 0x847E, 0xC941, 0x847F, 0xC942, 0x8480, 0xC943, 0x8481, 0xC944, 0x8482, 0xB5D9, + 0x8483, 0xC945, 0x8484, 0xC946, 0x8485, 0xC947, 0x8486, 0xC948, 0x8487, 0xDDDB, 0x8488, 0xDDDC, 0x8489, 0xDDDE, 0x848A, 0xC949, + 0x848B, 0xBDAF, 0x848C, 0xDDE4, 0x848D, 0xC94A, 0x848E, 0xDDE5, 0x848F, 0xC94B, 0x8490, 0xC94C, 0x8491, 0xC94D, 0x8492, 0xC94E, + 0x8493, 0xC94F, 0x8494, 0xC950, 0x8495, 0xC951, 0x8496, 0xC952, 0x8497, 0xDDF5, 0x8498, 0xC953, 0x8499, 0xC3C9, 0x849A, 0xC954, + 0x849B, 0xC955, 0x849C, 0xCBE2, 0x849D, 0xC956, 0x849E, 0xC957, 0x849F, 0xC958, 0x84A0, 0xC959, 0x84A1, 0xDDF2, 0x84A2, 0xC95A, + 0x84A3, 0xC95B, 0x84A4, 0xC95C, 0x84A5, 0xC95D, 0x84A6, 0xC95E, 0x84A7, 0xC95F, 0x84A8, 0xC960, 0x84A9, 0xC961, 0x84AA, 0xC962, + 0x84AB, 0xC963, 0x84AC, 0xC964, 0x84AD, 0xC965, 0x84AE, 0xC966, 0x84AF, 0xD8E1, 0x84B0, 0xC967, 0x84B1, 0xC968, 0x84B2, 0xC6D1, + 0x84B3, 0xC969, 0x84B4, 0xDDF4, 0x84B5, 0xC96A, 0x84B6, 0xC96B, 0x84B7, 0xC96C, 0x84B8, 0xD5F4, 0x84B9, 0xDDF3, 0x84BA, 0xDDF0, + 0x84BB, 0xC96D, 0x84BC, 0xC96E, 0x84BD, 0xDDEC, 0x84BE, 0xC96F, 0x84BF, 0xDDEF, 0x84C0, 0xC970, 0x84C1, 0xDDE8, 0x84C2, 0xC971, + 0x84C3, 0xC972, 0x84C4, 0xD0EE, 0x84C5, 0xC973, 0x84C6, 0xC974, 0x84C7, 0xC975, 0x84C8, 0xC976, 0x84C9, 0xC8D8, 0x84CA, 0xDDEE, + 0x84CB, 0xC977, 0x84CC, 0xC978, 0x84CD, 0xDDE9, 0x84CE, 0xC979, 0x84CF, 0xC97A, 0x84D0, 0xDDEA, 0x84D1, 0xCBF2, 0x84D2, 0xC97B, + 0x84D3, 0xDDED, 0x84D4, 0xC97C, 0x84D5, 0xC97D, 0x84D6, 0xB1CD, 0x84D7, 0xC97E, 0x84D8, 0xC980, 0x84D9, 0xC981, 0x84DA, 0xC982, + 0x84DB, 0xC983, 0x84DC, 0xC984, 0x84DD, 0xC0B6, 0x84DE, 0xC985, 0x84DF, 0xBCBB, 0x84E0, 0xDDF1, 0x84E1, 0xC986, 0x84E2, 0xC987, + 0x84E3, 0xDDF7, 0x84E4, 0xC988, 0x84E5, 0xDDF6, 0x84E6, 0xDDEB, 0x84E7, 0xC989, 0x84E8, 0xC98A, 0x84E9, 0xC98B, 0x84EA, 0xC98C, + 0x84EB, 0xC98D, 0x84EC, 0xC5EE, 0x84ED, 0xC98E, 0x84EE, 0xC98F, 0x84EF, 0xC990, 0x84F0, 0xDDFB, 0x84F1, 0xC991, 0x84F2, 0xC992, + 0x84F3, 0xC993, 0x84F4, 0xC994, 0x84F5, 0xC995, 0x84F6, 0xC996, 0x84F7, 0xC997, 0x84F8, 0xC998, 0x84F9, 0xC999, 0x84FA, 0xC99A, + 0x84FB, 0xC99B, 0x84FC, 0xDEA4, 0x84FD, 0xC99C, 0x84FE, 0xC99D, 0x84FF, 0xDEA3, 0x8500, 0xC99E, 0x8501, 0xC99F, 0x8502, 0xC9A0, + 0x8503, 0xCA40, 0x8504, 0xCA41, 0x8505, 0xCA42, 0x8506, 0xCA43, 0x8507, 0xCA44, 0x8508, 0xCA45, 0x8509, 0xCA46, 0x850A, 0xCA47, + 0x850B, 0xCA48, 0x850C, 0xDDF8, 0x850D, 0xCA49, 0x850E, 0xCA4A, 0x850F, 0xCA4B, 0x8510, 0xCA4C, 0x8511, 0xC3EF, 0x8512, 0xCA4D, + 0x8513, 0xC2FB, 0x8514, 0xCA4E, 0x8515, 0xCA4F, 0x8516, 0xCA50, 0x8517, 0xD5E1, 0x8518, 0xCA51, 0x8519, 0xCA52, 0x851A, 0xCEB5, + 0x851B, 0xCA53, 0x851C, 0xCA54, 0x851D, 0xCA55, 0x851E, 0xCA56, 0x851F, 0xDDFD, 0x8520, 0xCA57, 0x8521, 0xB2CC, 0x8522, 0xCA58, + 0x8523, 0xCA59, 0x8524, 0xCA5A, 0x8525, 0xCA5B, 0x8526, 0xCA5C, 0x8527, 0xCA5D, 0x8528, 0xCA5E, 0x8529, 0xCA5F, 0x852A, 0xCA60, + 0x852B, 0xC4E8, 0x852C, 0xCADF, 0x852D, 0xCA61, 0x852E, 0xCA62, 0x852F, 0xCA63, 0x8530, 0xCA64, 0x8531, 0xCA65, 0x8532, 0xCA66, + 0x8533, 0xCA67, 0x8534, 0xCA68, 0x8535, 0xCA69, 0x8536, 0xCA6A, 0x8537, 0xC7BE, 0x8538, 0xDDFA, 0x8539, 0xDDFC, 0x853A, 0xDDFE, + 0x853B, 0xDEA2, 0x853C, 0xB0AA, 0x853D, 0xB1CE, 0x853E, 0xCA6B, 0x853F, 0xCA6C, 0x8540, 0xCA6D, 0x8541, 0xCA6E, 0x8542, 0xCA6F, + 0x8543, 0xDEAC, 0x8544, 0xCA70, 0x8545, 0xCA71, 0x8546, 0xCA72, 0x8547, 0xCA73, 0x8548, 0xDEA6, 0x8549, 0xBDB6, 0x854A, 0xC8EF, + 0x854B, 0xCA74, 0x854C, 0xCA75, 0x854D, 0xCA76, 0x854E, 0xCA77, 0x854F, 0xCA78, 0x8550, 0xCA79, 0x8551, 0xCA7A, 0x8552, 0xCA7B, + 0x8553, 0xCA7C, 0x8554, 0xCA7D, 0x8555, 0xCA7E, 0x8556, 0xDEA1, 0x8557, 0xCA80, 0x8558, 0xCA81, 0x8559, 0xDEA5, 0x855A, 0xCA82, + 0x855B, 0xCA83, 0x855C, 0xCA84, 0x855D, 0xCA85, 0x855E, 0xDEA9, 0x855F, 0xCA86, 0x8560, 0xCA87, 0x8561, 0xCA88, 0x8562, 0xCA89, + 0x8563, 0xCA8A, 0x8564, 0xDEA8, 0x8565, 0xCA8B, 0x8566, 0xCA8C, 0x8567, 0xCA8D, 0x8568, 0xDEA7, 0x8569, 0xCA8E, 0x856A, 0xCA8F, + 0x856B, 0xCA90, 0x856C, 0xCA91, 0x856D, 0xCA92, 0x856E, 0xCA93, 0x856F, 0xCA94, 0x8570, 0xCA95, 0x8571, 0xCA96, 0x8572, 0xDEAD, + 0x8573, 0xCA97, 0x8574, 0xD4CC, 0x8575, 0xCA98, 0x8576, 0xCA99, 0x8577, 0xCA9A, 0x8578, 0xCA9B, 0x8579, 0xDEB3, 0x857A, 0xDEAA, + 0x857B, 0xDEAE, 0x857C, 0xCA9C, 0x857D, 0xCA9D, 0x857E, 0xC0D9, 0x857F, 0xCA9E, 0x8580, 0xCA9F, 0x8581, 0xCAA0, 0x8582, 0xCB40, + 0x8583, 0xCB41, 0x8584, 0xB1A1, 0x8585, 0xDEB6, 0x8586, 0xCB42, 0x8587, 0xDEB1, 0x8588, 0xCB43, 0x8589, 0xCB44, 0x858A, 0xCB45, + 0x858B, 0xCB46, 0x858C, 0xCB47, 0x858D, 0xCB48, 0x858E, 0xCB49, 0x858F, 0xDEB2, 0x8590, 0xCB4A, 0x8591, 0xCB4B, 0x8592, 0xCB4C, + 0x8593, 0xCB4D, 0x8594, 0xCB4E, 0x8595, 0xCB4F, 0x8596, 0xCB50, 0x8597, 0xCB51, 0x8598, 0xCB52, 0x8599, 0xCB53, 0x859A, 0xCB54, + 0x859B, 0xD1A6, 0x859C, 0xDEB5, 0x859D, 0xCB55, 0x859E, 0xCB56, 0x859F, 0xCB57, 0x85A0, 0xCB58, 0x85A1, 0xCB59, 0x85A2, 0xCB5A, + 0x85A3, 0xCB5B, 0x85A4, 0xDEAF, 0x85A5, 0xCB5C, 0x85A6, 0xCB5D, 0x85A7, 0xCB5E, 0x85A8, 0xDEB0, 0x85A9, 0xCB5F, 0x85AA, 0xD0BD, + 0x85AB, 0xCB60, 0x85AC, 0xCB61, 0x85AD, 0xCB62, 0x85AE, 0xDEB4, 0x85AF, 0xCAED, 0x85B0, 0xDEB9, 0x85B1, 0xCB63, 0x85B2, 0xCB64, + 0x85B3, 0xCB65, 0x85B4, 0xCB66, 0x85B5, 0xCB67, 0x85B6, 0xCB68, 0x85B7, 0xDEB8, 0x85B8, 0xCB69, 0x85B9, 0xDEB7, 0x85BA, 0xCB6A, + 0x85BB, 0xCB6B, 0x85BC, 0xCB6C, 0x85BD, 0xCB6D, 0x85BE, 0xCB6E, 0x85BF, 0xCB6F, 0x85C0, 0xCB70, 0x85C1, 0xDEBB, 0x85C2, 0xCB71, + 0x85C3, 0xCB72, 0x85C4, 0xCB73, 0x85C5, 0xCB74, 0x85C6, 0xCB75, 0x85C7, 0xCB76, 0x85C8, 0xCB77, 0x85C9, 0xBDE5, 0x85CA, 0xCB78, + 0x85CB, 0xCB79, 0x85CC, 0xCB7A, 0x85CD, 0xCB7B, 0x85CE, 0xCB7C, 0x85CF, 0xB2D8, 0x85D0, 0xC3EA, 0x85D1, 0xCB7D, 0x85D2, 0xCB7E, + 0x85D3, 0xDEBA, 0x85D4, 0xCB80, 0x85D5, 0xC5BA, 0x85D6, 0xCB81, 0x85D7, 0xCB82, 0x85D8, 0xCB83, 0x85D9, 0xCB84, 0x85DA, 0xCB85, + 0x85DB, 0xCB86, 0x85DC, 0xDEBC, 0x85DD, 0xCB87, 0x85DE, 0xCB88, 0x85DF, 0xCB89, 0x85E0, 0xCB8A, 0x85E1, 0xCB8B, 0x85E2, 0xCB8C, + 0x85E3, 0xCB8D, 0x85E4, 0xCCD9, 0x85E5, 0xCB8E, 0x85E6, 0xCB8F, 0x85E7, 0xCB90, 0x85E8, 0xCB91, 0x85E9, 0xB7AA, 0x85EA, 0xCB92, + 0x85EB, 0xCB93, 0x85EC, 0xCB94, 0x85ED, 0xCB95, 0x85EE, 0xCB96, 0x85EF, 0xCB97, 0x85F0, 0xCB98, 0x85F1, 0xCB99, 0x85F2, 0xCB9A, + 0x85F3, 0xCB9B, 0x85F4, 0xCB9C, 0x85F5, 0xCB9D, 0x85F6, 0xCB9E, 0x85F7, 0xCB9F, 0x85F8, 0xCBA0, 0x85F9, 0xCC40, 0x85FA, 0xCC41, + 0x85FB, 0xD4E5, 0x85FC, 0xCC42, 0x85FD, 0xCC43, 0x85FE, 0xCC44, 0x85FF, 0xDEBD, 0x8600, 0xCC45, 0x8601, 0xCC46, 0x8602, 0xCC47, + 0x8603, 0xCC48, 0x8604, 0xCC49, 0x8605, 0xDEBF, 0x8606, 0xCC4A, 0x8607, 0xCC4B, 0x8608, 0xCC4C, 0x8609, 0xCC4D, 0x860A, 0xCC4E, + 0x860B, 0xCC4F, 0x860C, 0xCC50, 0x860D, 0xCC51, 0x860E, 0xCC52, 0x860F, 0xCC53, 0x8610, 0xCC54, 0x8611, 0xC4A2, 0x8612, 0xCC55, + 0x8613, 0xCC56, 0x8614, 0xCC57, 0x8615, 0xCC58, 0x8616, 0xDEC1, 0x8617, 0xCC59, 0x8618, 0xCC5A, 0x8619, 0xCC5B, 0x861A, 0xCC5C, + 0x861B, 0xCC5D, 0x861C, 0xCC5E, 0x861D, 0xCC5F, 0x861E, 0xCC60, 0x861F, 0xCC61, 0x8620, 0xCC62, 0x8621, 0xCC63, 0x8622, 0xCC64, + 0x8623, 0xCC65, 0x8624, 0xCC66, 0x8625, 0xCC67, 0x8626, 0xCC68, 0x8627, 0xDEBE, 0x8628, 0xCC69, 0x8629, 0xDEC0, 0x862A, 0xCC6A, + 0x862B, 0xCC6B, 0x862C, 0xCC6C, 0x862D, 0xCC6D, 0x862E, 0xCC6E, 0x862F, 0xCC6F, 0x8630, 0xCC70, 0x8631, 0xCC71, 0x8632, 0xCC72, + 0x8633, 0xCC73, 0x8634, 0xCC74, 0x8635, 0xCC75, 0x8636, 0xCC76, 0x8637, 0xCC77, 0x8638, 0xD5BA, 0x8639, 0xCC78, 0x863A, 0xCC79, + 0x863B, 0xCC7A, 0x863C, 0xDEC2, 0x863D, 0xCC7B, 0x863E, 0xCC7C, 0x863F, 0xCC7D, 0x8640, 0xCC7E, 0x8641, 0xCC80, 0x8642, 0xCC81, + 0x8643, 0xCC82, 0x8644, 0xCC83, 0x8645, 0xCC84, 0x8646, 0xCC85, 0x8647, 0xCC86, 0x8648, 0xCC87, 0x8649, 0xCC88, 0x864A, 0xCC89, + 0x864B, 0xCC8A, 0x864C, 0xCC8B, 0x864D, 0xF2AE, 0x864E, 0xBBA2, 0x864F, 0xC2B2, 0x8650, 0xC5B0, 0x8651, 0xC2C7, 0x8652, 0xCC8C, + 0x8653, 0xCC8D, 0x8654, 0xF2AF, 0x8655, 0xCC8E, 0x8656, 0xCC8F, 0x8657, 0xCC90, 0x8658, 0xCC91, 0x8659, 0xCC92, 0x865A, 0xD0E9, + 0x865B, 0xCC93, 0x865C, 0xCC94, 0x865D, 0xCC95, 0x865E, 0xD3DD, 0x865F, 0xCC96, 0x8660, 0xCC97, 0x8661, 0xCC98, 0x8662, 0xEBBD, + 0x8663, 0xCC99, 0x8664, 0xCC9A, 0x8665, 0xCC9B, 0x8666, 0xCC9C, 0x8667, 0xCC9D, 0x8668, 0xCC9E, 0x8669, 0xCC9F, 0x866A, 0xCCA0, + 0x866B, 0xB3E6, 0x866C, 0xF2B0, 0x866D, 0xCD40, 0x866E, 0xF2B1, 0x866F, 0xCD41, 0x8670, 0xCD42, 0x8671, 0xCAAD, 0x8672, 0xCD43, + 0x8673, 0xCD44, 0x8674, 0xCD45, 0x8675, 0xCD46, 0x8676, 0xCD47, 0x8677, 0xCD48, 0x8678, 0xCD49, 0x8679, 0xBAE7, 0x867A, 0xF2B3, + 0x867B, 0xF2B5, 0x867C, 0xF2B4, 0x867D, 0xCBE4, 0x867E, 0xCFBA, 0x867F, 0xF2B2, 0x8680, 0xCAB4, 0x8681, 0xD2CF, 0x8682, 0xC2EC, + 0x8683, 0xCD4A, 0x8684, 0xCD4B, 0x8685, 0xCD4C, 0x8686, 0xCD4D, 0x8687, 0xCD4E, 0x8688, 0xCD4F, 0x8689, 0xCD50, 0x868A, 0xCEC3, + 0x868B, 0xF2B8, 0x868C, 0xB0F6, 0x868D, 0xF2B7, 0x868E, 0xCD51, 0x868F, 0xCD52, 0x8690, 0xCD53, 0x8691, 0xCD54, 0x8692, 0xCD55, + 0x8693, 0xF2BE, 0x8694, 0xCD56, 0x8695, 0xB2CF, 0x8696, 0xCD57, 0x8697, 0xCD58, 0x8698, 0xCD59, 0x8699, 0xCD5A, 0x869A, 0xCD5B, + 0x869B, 0xCD5C, 0x869C, 0xD1C1, 0x869D, 0xF2BA, 0x869E, 0xCD5D, 0x869F, 0xCD5E, 0x86A0, 0xCD5F, 0x86A1, 0xCD60, 0x86A2, 0xCD61, + 0x86A3, 0xF2BC, 0x86A4, 0xD4E9, 0x86A5, 0xCD62, 0x86A6, 0xCD63, 0x86A7, 0xF2BB, 0x86A8, 0xF2B6, 0x86A9, 0xF2BF, 0x86AA, 0xF2BD, + 0x86AB, 0xCD64, 0x86AC, 0xF2B9, 0x86AD, 0xCD65, 0x86AE, 0xCD66, 0x86AF, 0xF2C7, 0x86B0, 0xF2C4, 0x86B1, 0xF2C6, 0x86B2, 0xCD67, + 0x86B3, 0xCD68, 0x86B4, 0xF2CA, 0x86B5, 0xF2C2, 0x86B6, 0xF2C0, 0x86B7, 0xCD69, 0x86B8, 0xCD6A, 0x86B9, 0xCD6B, 0x86BA, 0xF2C5, + 0x86BB, 0xCD6C, 0x86BC, 0xCD6D, 0x86BD, 0xCD6E, 0x86BE, 0xCD6F, 0x86BF, 0xCD70, 0x86C0, 0xD6FB, 0x86C1, 0xCD71, 0x86C2, 0xCD72, + 0x86C3, 0xCD73, 0x86C4, 0xF2C1, 0x86C5, 0xCD74, 0x86C6, 0xC7F9, 0x86C7, 0xC9DF, 0x86C8, 0xCD75, 0x86C9, 0xF2C8, 0x86CA, 0xB9C6, + 0x86CB, 0xB5B0, 0x86CC, 0xCD76, 0x86CD, 0xCD77, 0x86CE, 0xF2C3, 0x86CF, 0xF2C9, 0x86D0, 0xF2D0, 0x86D1, 0xF2D6, 0x86D2, 0xCD78, + 0x86D3, 0xCD79, 0x86D4, 0xBBD7, 0x86D5, 0xCD7A, 0x86D6, 0xCD7B, 0x86D7, 0xCD7C, 0x86D8, 0xF2D5, 0x86D9, 0xCDDC, 0x86DA, 0xCD7D, + 0x86DB, 0xD6EB, 0x86DC, 0xCD7E, 0x86DD, 0xCD80, 0x86DE, 0xF2D2, 0x86DF, 0xF2D4, 0x86E0, 0xCD81, 0x86E1, 0xCD82, 0x86E2, 0xCD83, + 0x86E3, 0xCD84, 0x86E4, 0xB8F2, 0x86E5, 0xCD85, 0x86E6, 0xCD86, 0x86E7, 0xCD87, 0x86E8, 0xCD88, 0x86E9, 0xF2CB, 0x86EA, 0xCD89, + 0x86EB, 0xCD8A, 0x86EC, 0xCD8B, 0x86ED, 0xF2CE, 0x86EE, 0xC2F9, 0x86EF, 0xCD8C, 0x86F0, 0xD5DD, 0x86F1, 0xF2CC, 0x86F2, 0xF2CD, + 0x86F3, 0xF2CF, 0x86F4, 0xF2D3, 0x86F5, 0xCD8D, 0x86F6, 0xCD8E, 0x86F7, 0xCD8F, 0x86F8, 0xF2D9, 0x86F9, 0xD3BC, 0x86FA, 0xCD90, + 0x86FB, 0xCD91, 0x86FC, 0xCD92, 0x86FD, 0xCD93, 0x86FE, 0xB6EA, 0x86FF, 0xCD94, 0x8700, 0xCAF1, 0x8701, 0xCD95, 0x8702, 0xB7E4, + 0x8703, 0xF2D7, 0x8704, 0xCD96, 0x8705, 0xCD97, 0x8706, 0xCD98, 0x8707, 0xF2D8, 0x8708, 0xF2DA, 0x8709, 0xF2DD, 0x870A, 0xF2DB, + 0x870B, 0xCD99, 0x870C, 0xCD9A, 0x870D, 0xF2DC, 0x870E, 0xCD9B, 0x870F, 0xCD9C, 0x8710, 0xCD9D, 0x8711, 0xCD9E, 0x8712, 0xD1D1, + 0x8713, 0xF2D1, 0x8714, 0xCD9F, 0x8715, 0xCDC9, 0x8716, 0xCDA0, 0x8717, 0xCECF, 0x8718, 0xD6A9, 0x8719, 0xCE40, 0x871A, 0xF2E3, + 0x871B, 0xCE41, 0x871C, 0xC3DB, 0x871D, 0xCE42, 0x871E, 0xF2E0, 0x871F, 0xCE43, 0x8720, 0xCE44, 0x8721, 0xC0AF, 0x8722, 0xF2EC, + 0x8723, 0xF2DE, 0x8724, 0xCE45, 0x8725, 0xF2E1, 0x8726, 0xCE46, 0x8727, 0xCE47, 0x8728, 0xCE48, 0x8729, 0xF2E8, 0x872A, 0xCE49, + 0x872B, 0xCE4A, 0x872C, 0xCE4B, 0x872D, 0xCE4C, 0x872E, 0xF2E2, 0x872F, 0xCE4D, 0x8730, 0xCE4E, 0x8731, 0xF2E7, 0x8732, 0xCE4F, + 0x8733, 0xCE50, 0x8734, 0xF2E6, 0x8735, 0xCE51, 0x8736, 0xCE52, 0x8737, 0xF2E9, 0x8738, 0xCE53, 0x8739, 0xCE54, 0x873A, 0xCE55, + 0x873B, 0xF2DF, 0x873C, 0xCE56, 0x873D, 0xCE57, 0x873E, 0xF2E4, 0x873F, 0xF2EA, 0x8740, 0xCE58, 0x8741, 0xCE59, 0x8742, 0xCE5A, + 0x8743, 0xCE5B, 0x8744, 0xCE5C, 0x8745, 0xCE5D, 0x8746, 0xCE5E, 0x8747, 0xD3AC, 0x8748, 0xF2E5, 0x8749, 0xB2F5, 0x874A, 0xCE5F, + 0x874B, 0xCE60, 0x874C, 0xF2F2, 0x874D, 0xCE61, 0x874E, 0xD0AB, 0x874F, 0xCE62, 0x8750, 0xCE63, 0x8751, 0xCE64, 0x8752, 0xCE65, + 0x8753, 0xF2F5, 0x8754, 0xCE66, 0x8755, 0xCE67, 0x8756, 0xCE68, 0x8757, 0xBBC8, 0x8758, 0xCE69, 0x8759, 0xF2F9, 0x875A, 0xCE6A, + 0x875B, 0xCE6B, 0x875C, 0xCE6C, 0x875D, 0xCE6D, 0x875E, 0xCE6E, 0x875F, 0xCE6F, 0x8760, 0xF2F0, 0x8761, 0xCE70, 0x8762, 0xCE71, + 0x8763, 0xF2F6, 0x8764, 0xF2F8, 0x8765, 0xF2FA, 0x8766, 0xCE72, 0x8767, 0xCE73, 0x8768, 0xCE74, 0x8769, 0xCE75, 0x876A, 0xCE76, + 0x876B, 0xCE77, 0x876C, 0xCE78, 0x876D, 0xCE79, 0x876E, 0xF2F3, 0x876F, 0xCE7A, 0x8770, 0xF2F1, 0x8771, 0xCE7B, 0x8772, 0xCE7C, + 0x8773, 0xCE7D, 0x8774, 0xBAFB, 0x8775, 0xCE7E, 0x8776, 0xB5FB, 0x8777, 0xCE80, 0x8778, 0xCE81, 0x8779, 0xCE82, 0x877A, 0xCE83, + 0x877B, 0xF2EF, 0x877C, 0xF2F7, 0x877D, 0xF2ED, 0x877E, 0xF2EE, 0x877F, 0xCE84, 0x8780, 0xCE85, 0x8781, 0xCE86, 0x8782, 0xF2EB, + 0x8783, 0xF3A6, 0x8784, 0xCE87, 0x8785, 0xF3A3, 0x8786, 0xCE88, 0x8787, 0xCE89, 0x8788, 0xF3A2, 0x8789, 0xCE8A, 0x878A, 0xCE8B, + 0x878B, 0xF2F4, 0x878C, 0xCE8C, 0x878D, 0xC8DA, 0x878E, 0xCE8D, 0x878F, 0xCE8E, 0x8790, 0xCE8F, 0x8791, 0xCE90, 0x8792, 0xCE91, + 0x8793, 0xF2FB, 0x8794, 0xCE92, 0x8795, 0xCE93, 0x8796, 0xCE94, 0x8797, 0xF3A5, 0x8798, 0xCE95, 0x8799, 0xCE96, 0x879A, 0xCE97, + 0x879B, 0xCE98, 0x879C, 0xCE99, 0x879D, 0xCE9A, 0x879E, 0xCE9B, 0x879F, 0xC3F8, 0x87A0, 0xCE9C, 0x87A1, 0xCE9D, 0x87A2, 0xCE9E, + 0x87A3, 0xCE9F, 0x87A4, 0xCEA0, 0x87A5, 0xCF40, 0x87A6, 0xCF41, 0x87A7, 0xCF42, 0x87A8, 0xF2FD, 0x87A9, 0xCF43, 0x87AA, 0xCF44, + 0x87AB, 0xF3A7, 0x87AC, 0xF3A9, 0x87AD, 0xF3A4, 0x87AE, 0xCF45, 0x87AF, 0xF2FC, 0x87B0, 0xCF46, 0x87B1, 0xCF47, 0x87B2, 0xCF48, + 0x87B3, 0xF3AB, 0x87B4, 0xCF49, 0x87B5, 0xF3AA, 0x87B6, 0xCF4A, 0x87B7, 0xCF4B, 0x87B8, 0xCF4C, 0x87B9, 0xCF4D, 0x87BA, 0xC2DD, + 0x87BB, 0xCF4E, 0x87BC, 0xCF4F, 0x87BD, 0xF3AE, 0x87BE, 0xCF50, 0x87BF, 0xCF51, 0x87C0, 0xF3B0, 0x87C1, 0xCF52, 0x87C2, 0xCF53, + 0x87C3, 0xCF54, 0x87C4, 0xCF55, 0x87C5, 0xCF56, 0x87C6, 0xF3A1, 0x87C7, 0xCF57, 0x87C8, 0xCF58, 0x87C9, 0xCF59, 0x87CA, 0xF3B1, + 0x87CB, 0xF3AC, 0x87CC, 0xCF5A, 0x87CD, 0xCF5B, 0x87CE, 0xCF5C, 0x87CF, 0xCF5D, 0x87D0, 0xCF5E, 0x87D1, 0xF3AF, 0x87D2, 0xF2FE, + 0x87D3, 0xF3AD, 0x87D4, 0xCF5F, 0x87D5, 0xCF60, 0x87D6, 0xCF61, 0x87D7, 0xCF62, 0x87D8, 0xCF63, 0x87D9, 0xCF64, 0x87DA, 0xCF65, + 0x87DB, 0xF3B2, 0x87DC, 0xCF66, 0x87DD, 0xCF67, 0x87DE, 0xCF68, 0x87DF, 0xCF69, 0x87E0, 0xF3B4, 0x87E1, 0xCF6A, 0x87E2, 0xCF6B, + 0x87E3, 0xCF6C, 0x87E4, 0xCF6D, 0x87E5, 0xF3A8, 0x87E6, 0xCF6E, 0x87E7, 0xCF6F, 0x87E8, 0xCF70, 0x87E9, 0xCF71, 0x87EA, 0xF3B3, + 0x87EB, 0xCF72, 0x87EC, 0xCF73, 0x87ED, 0xCF74, 0x87EE, 0xF3B5, 0x87EF, 0xCF75, 0x87F0, 0xCF76, 0x87F1, 0xCF77, 0x87F2, 0xCF78, + 0x87F3, 0xCF79, 0x87F4, 0xCF7A, 0x87F5, 0xCF7B, 0x87F6, 0xCF7C, 0x87F7, 0xCF7D, 0x87F8, 0xCF7E, 0x87F9, 0xD0B7, 0x87FA, 0xCF80, + 0x87FB, 0xCF81, 0x87FC, 0xCF82, 0x87FD, 0xCF83, 0x87FE, 0xF3B8, 0x87FF, 0xCF84, 0x8800, 0xCF85, 0x8801, 0xCF86, 0x8802, 0xCF87, + 0x8803, 0xD9F9, 0x8804, 0xCF88, 0x8805, 0xCF89, 0x8806, 0xCF8A, 0x8807, 0xCF8B, 0x8808, 0xCF8C, 0x8809, 0xCF8D, 0x880A, 0xF3B9, + 0x880B, 0xCF8E, 0x880C, 0xCF8F, 0x880D, 0xCF90, 0x880E, 0xCF91, 0x880F, 0xCF92, 0x8810, 0xCF93, 0x8811, 0xCF94, 0x8812, 0xCF95, + 0x8813, 0xF3B7, 0x8814, 0xCF96, 0x8815, 0xC8E4, 0x8816, 0xF3B6, 0x8817, 0xCF97, 0x8818, 0xCF98, 0x8819, 0xCF99, 0x881A, 0xCF9A, + 0x881B, 0xF3BA, 0x881C, 0xCF9B, 0x881D, 0xCF9C, 0x881E, 0xCF9D, 0x881F, 0xCF9E, 0x8820, 0xCF9F, 0x8821, 0xF3BB, 0x8822, 0xB4C0, + 0x8823, 0xCFA0, 0x8824, 0xD040, 0x8825, 0xD041, 0x8826, 0xD042, 0x8827, 0xD043, 0x8828, 0xD044, 0x8829, 0xD045, 0x882A, 0xD046, + 0x882B, 0xD047, 0x882C, 0xD048, 0x882D, 0xD049, 0x882E, 0xD04A, 0x882F, 0xD04B, 0x8830, 0xD04C, 0x8831, 0xD04D, 0x8832, 0xEEC3, + 0x8833, 0xD04E, 0x8834, 0xD04F, 0x8835, 0xD050, 0x8836, 0xD051, 0x8837, 0xD052, 0x8838, 0xD053, 0x8839, 0xF3BC, 0x883A, 0xD054, + 0x883B, 0xD055, 0x883C, 0xF3BD, 0x883D, 0xD056, 0x883E, 0xD057, 0x883F, 0xD058, 0x8840, 0xD1AA, 0x8841, 0xD059, 0x8842, 0xD05A, + 0x8843, 0xD05B, 0x8844, 0xF4AC, 0x8845, 0xD0C6, 0x8846, 0xD05C, 0x8847, 0xD05D, 0x8848, 0xD05E, 0x8849, 0xD05F, 0x884A, 0xD060, + 0x884B, 0xD061, 0x884C, 0xD0D0, 0x884D, 0xD1DC, 0x884E, 0xD062, 0x884F, 0xD063, 0x8850, 0xD064, 0x8851, 0xD065, 0x8852, 0xD066, + 0x8853, 0xD067, 0x8854, 0xCFCE, 0x8855, 0xD068, 0x8856, 0xD069, 0x8857, 0xBDD6, 0x8858, 0xD06A, 0x8859, 0xD1C3, 0x885A, 0xD06B, + 0x885B, 0xD06C, 0x885C, 0xD06D, 0x885D, 0xD06E, 0x885E, 0xD06F, 0x885F, 0xD070, 0x8860, 0xD071, 0x8861, 0xBAE2, 0x8862, 0xE1E9, + 0x8863, 0xD2C2, 0x8864, 0xF1C2, 0x8865, 0xB2B9, 0x8866, 0xD072, 0x8867, 0xD073, 0x8868, 0xB1ED, 0x8869, 0xF1C3, 0x886A, 0xD074, + 0x886B, 0xC9C0, 0x886C, 0xB3C4, 0x886D, 0xD075, 0x886E, 0xD9F2, 0x886F, 0xD076, 0x8870, 0xCBA5, 0x8871, 0xD077, 0x8872, 0xF1C4, + 0x8873, 0xD078, 0x8874, 0xD079, 0x8875, 0xD07A, 0x8876, 0xD07B, 0x8877, 0xD6D4, 0x8878, 0xD07C, 0x8879, 0xD07D, 0x887A, 0xD07E, + 0x887B, 0xD080, 0x887C, 0xD081, 0x887D, 0xF1C5, 0x887E, 0xF4C0, 0x887F, 0xF1C6, 0x8880, 0xD082, 0x8881, 0xD4AC, 0x8882, 0xF1C7, + 0x8883, 0xD083, 0x8884, 0xB0C0, 0x8885, 0xF4C1, 0x8886, 0xD084, 0x8887, 0xD085, 0x8888, 0xF4C2, 0x8889, 0xD086, 0x888A, 0xD087, + 0x888B, 0xB4FC, 0x888C, 0xD088, 0x888D, 0xC5DB, 0x888E, 0xD089, 0x888F, 0xD08A, 0x8890, 0xD08B, 0x8891, 0xD08C, 0x8892, 0xCCBB, + 0x8893, 0xD08D, 0x8894, 0xD08E, 0x8895, 0xD08F, 0x8896, 0xD0E4, 0x8897, 0xD090, 0x8898, 0xD091, 0x8899, 0xD092, 0x889A, 0xD093, + 0x889B, 0xD094, 0x889C, 0xCDE0, 0x889D, 0xD095, 0x889E, 0xD096, 0x889F, 0xD097, 0x88A0, 0xD098, 0x88A1, 0xD099, 0x88A2, 0xF1C8, + 0x88A3, 0xD09A, 0x88A4, 0xD9F3, 0x88A5, 0xD09B, 0x88A6, 0xD09C, 0x88A7, 0xD09D, 0x88A8, 0xD09E, 0x88A9, 0xD09F, 0x88AA, 0xD0A0, + 0x88AB, 0xB1BB, 0x88AC, 0xD140, 0x88AD, 0xCFAE, 0x88AE, 0xD141, 0x88AF, 0xD142, 0x88B0, 0xD143, 0x88B1, 0xB8A4, 0x88B2, 0xD144, + 0x88B3, 0xD145, 0x88B4, 0xD146, 0x88B5, 0xD147, 0x88B6, 0xD148, 0x88B7, 0xF1CA, 0x88B8, 0xD149, 0x88B9, 0xD14A, 0x88BA, 0xD14B, + 0x88BB, 0xD14C, 0x88BC, 0xF1CB, 0x88BD, 0xD14D, 0x88BE, 0xD14E, 0x88BF, 0xD14F, 0x88C0, 0xD150, 0x88C1, 0xB2C3, 0x88C2, 0xC1D1, + 0x88C3, 0xD151, 0x88C4, 0xD152, 0x88C5, 0xD7B0, 0x88C6, 0xF1C9, 0x88C7, 0xD153, 0x88C8, 0xD154, 0x88C9, 0xF1CC, 0x88CA, 0xD155, + 0x88CB, 0xD156, 0x88CC, 0xD157, 0x88CD, 0xD158, 0x88CE, 0xF1CE, 0x88CF, 0xD159, 0x88D0, 0xD15A, 0x88D1, 0xD15B, 0x88D2, 0xD9F6, + 0x88D3, 0xD15C, 0x88D4, 0xD2E1, 0x88D5, 0xD4A3, 0x88D6, 0xD15D, 0x88D7, 0xD15E, 0x88D8, 0xF4C3, 0x88D9, 0xC8B9, 0x88DA, 0xD15F, + 0x88DB, 0xD160, 0x88DC, 0xD161, 0x88DD, 0xD162, 0x88DE, 0xD163, 0x88DF, 0xF4C4, 0x88E0, 0xD164, 0x88E1, 0xD165, 0x88E2, 0xF1CD, + 0x88E3, 0xF1CF, 0x88E4, 0xBFE3, 0x88E5, 0xF1D0, 0x88E6, 0xD166, 0x88E7, 0xD167, 0x88E8, 0xF1D4, 0x88E9, 0xD168, 0x88EA, 0xD169, + 0x88EB, 0xD16A, 0x88EC, 0xD16B, 0x88ED, 0xD16C, 0x88EE, 0xD16D, 0x88EF, 0xD16E, 0x88F0, 0xF1D6, 0x88F1, 0xF1D1, 0x88F2, 0xD16F, + 0x88F3, 0xC9D1, 0x88F4, 0xC5E1, 0x88F5, 0xD170, 0x88F6, 0xD171, 0x88F7, 0xD172, 0x88F8, 0xC2E3, 0x88F9, 0xB9FC, 0x88FA, 0xD173, + 0x88FB, 0xD174, 0x88FC, 0xF1D3, 0x88FD, 0xD175, 0x88FE, 0xF1D5, 0x88FF, 0xD176, 0x8900, 0xD177, 0x8901, 0xD178, 0x8902, 0xB9D3, + 0x8903, 0xD179, 0x8904, 0xD17A, 0x8905, 0xD17B, 0x8906, 0xD17C, 0x8907, 0xD17D, 0x8908, 0xD17E, 0x8909, 0xD180, 0x890A, 0xF1DB, + 0x890B, 0xD181, 0x890C, 0xD182, 0x890D, 0xD183, 0x890E, 0xD184, 0x890F, 0xD185, 0x8910, 0xBAD6, 0x8911, 0xD186, 0x8912, 0xB0FD, + 0x8913, 0xF1D9, 0x8914, 0xD187, 0x8915, 0xD188, 0x8916, 0xD189, 0x8917, 0xD18A, 0x8918, 0xD18B, 0x8919, 0xF1D8, 0x891A, 0xF1D2, + 0x891B, 0xF1DA, 0x891C, 0xD18C, 0x891D, 0xD18D, 0x891E, 0xD18E, 0x891F, 0xD18F, 0x8920, 0xD190, 0x8921, 0xF1D7, 0x8922, 0xD191, + 0x8923, 0xD192, 0x8924, 0xD193, 0x8925, 0xC8EC, 0x8926, 0xD194, 0x8927, 0xD195, 0x8928, 0xD196, 0x8929, 0xD197, 0x892A, 0xCDCA, + 0x892B, 0xF1DD, 0x892C, 0xD198, 0x892D, 0xD199, 0x892E, 0xD19A, 0x892F, 0xD19B, 0x8930, 0xE5BD, 0x8931, 0xD19C, 0x8932, 0xD19D, + 0x8933, 0xD19E, 0x8934, 0xF1DC, 0x8935, 0xD19F, 0x8936, 0xF1DE, 0x8937, 0xD1A0, 0x8938, 0xD240, 0x8939, 0xD241, 0x893A, 0xD242, + 0x893B, 0xD243, 0x893C, 0xD244, 0x893D, 0xD245, 0x893E, 0xD246, 0x893F, 0xD247, 0x8940, 0xD248, 0x8941, 0xF1DF, 0x8942, 0xD249, + 0x8943, 0xD24A, 0x8944, 0xCFE5, 0x8945, 0xD24B, 0x8946, 0xD24C, 0x8947, 0xD24D, 0x8948, 0xD24E, 0x8949, 0xD24F, 0x894A, 0xD250, + 0x894B, 0xD251, 0x894C, 0xD252, 0x894D, 0xD253, 0x894E, 0xD254, 0x894F, 0xD255, 0x8950, 0xD256, 0x8951, 0xD257, 0x8952, 0xD258, + 0x8953, 0xD259, 0x8954, 0xD25A, 0x8955, 0xD25B, 0x8956, 0xD25C, 0x8957, 0xD25D, 0x8958, 0xD25E, 0x8959, 0xD25F, 0x895A, 0xD260, + 0x895B, 0xD261, 0x895C, 0xD262, 0x895D, 0xD263, 0x895E, 0xF4C5, 0x895F, 0xBDF3, 0x8960, 0xD264, 0x8961, 0xD265, 0x8962, 0xD266, + 0x8963, 0xD267, 0x8964, 0xD268, 0x8965, 0xD269, 0x8966, 0xF1E0, 0x8967, 0xD26A, 0x8968, 0xD26B, 0x8969, 0xD26C, 0x896A, 0xD26D, + 0x896B, 0xD26E, 0x896C, 0xD26F, 0x896D, 0xD270, 0x896E, 0xD271, 0x896F, 0xD272, 0x8970, 0xD273, 0x8971, 0xD274, 0x8972, 0xD275, + 0x8973, 0xD276, 0x8974, 0xD277, 0x8975, 0xD278, 0x8976, 0xD279, 0x8977, 0xD27A, 0x8978, 0xD27B, 0x8979, 0xD27C, 0x897A, 0xD27D, + 0x897B, 0xF1E1, 0x897C, 0xD27E, 0x897D, 0xD280, 0x897E, 0xD281, 0x897F, 0xCEF7, 0x8980, 0xD282, 0x8981, 0xD2AA, 0x8982, 0xD283, + 0x8983, 0xF1FB, 0x8984, 0xD284, 0x8985, 0xD285, 0x8986, 0xB8B2, 0x8987, 0xD286, 0x8988, 0xD287, 0x8989, 0xD288, 0x898A, 0xD289, + 0x898B, 0xD28A, 0x898C, 0xD28B, 0x898D, 0xD28C, 0x898E, 0xD28D, 0x898F, 0xD28E, 0x8990, 0xD28F, 0x8991, 0xD290, 0x8992, 0xD291, + 0x8993, 0xD292, 0x8994, 0xD293, 0x8995, 0xD294, 0x8996, 0xD295, 0x8997, 0xD296, 0x8998, 0xD297, 0x8999, 0xD298, 0x899A, 0xD299, + 0x899B, 0xD29A, 0x899C, 0xD29B, 0x899D, 0xD29C, 0x899E, 0xD29D, 0x899F, 0xD29E, 0x89A0, 0xD29F, 0x89A1, 0xD2A0, 0x89A2, 0xD340, + 0x89A3, 0xD341, 0x89A4, 0xD342, 0x89A5, 0xD343, 0x89A6, 0xD344, 0x89A7, 0xD345, 0x89A8, 0xD346, 0x89A9, 0xD347, 0x89AA, 0xD348, + 0x89AB, 0xD349, 0x89AC, 0xD34A, 0x89AD, 0xD34B, 0x89AE, 0xD34C, 0x89AF, 0xD34D, 0x89B0, 0xD34E, 0x89B1, 0xD34F, 0x89B2, 0xD350, + 0x89B3, 0xD351, 0x89B4, 0xD352, 0x89B5, 0xD353, 0x89B6, 0xD354, 0x89B7, 0xD355, 0x89B8, 0xD356, 0x89B9, 0xD357, 0x89BA, 0xD358, + 0x89BB, 0xD359, 0x89BC, 0xD35A, 0x89BD, 0xD35B, 0x89BE, 0xD35C, 0x89BF, 0xD35D, 0x89C0, 0xD35E, 0x89C1, 0xBCFB, 0x89C2, 0xB9DB, + 0x89C3, 0xD35F, 0x89C4, 0xB9E6, 0x89C5, 0xC3D9, 0x89C6, 0xCAD3, 0x89C7, 0xEAE8, 0x89C8, 0xC0C0, 0x89C9, 0xBEF5, 0x89CA, 0xEAE9, + 0x89CB, 0xEAEA, 0x89CC, 0xEAEB, 0x89CD, 0xD360, 0x89CE, 0xEAEC, 0x89CF, 0xEAED, 0x89D0, 0xEAEE, 0x89D1, 0xEAEF, 0x89D2, 0xBDC7, + 0x89D3, 0xD361, 0x89D4, 0xD362, 0x89D5, 0xD363, 0x89D6, 0xF5FB, 0x89D7, 0xD364, 0x89D8, 0xD365, 0x89D9, 0xD366, 0x89DA, 0xF5FD, + 0x89DB, 0xD367, 0x89DC, 0xF5FE, 0x89DD, 0xD368, 0x89DE, 0xF5FC, 0x89DF, 0xD369, 0x89E0, 0xD36A, 0x89E1, 0xD36B, 0x89E2, 0xD36C, + 0x89E3, 0xBDE2, 0x89E4, 0xD36D, 0x89E5, 0xF6A1, 0x89E6, 0xB4A5, 0x89E7, 0xD36E, 0x89E8, 0xD36F, 0x89E9, 0xD370, 0x89EA, 0xD371, + 0x89EB, 0xF6A2, 0x89EC, 0xD372, 0x89ED, 0xD373, 0x89EE, 0xD374, 0x89EF, 0xF6A3, 0x89F0, 0xD375, 0x89F1, 0xD376, 0x89F2, 0xD377, + 0x89F3, 0xECB2, 0x89F4, 0xD378, 0x89F5, 0xD379, 0x89F6, 0xD37A, 0x89F7, 0xD37B, 0x89F8, 0xD37C, 0x89F9, 0xD37D, 0x89FA, 0xD37E, + 0x89FB, 0xD380, 0x89FC, 0xD381, 0x89FD, 0xD382, 0x89FE, 0xD383, 0x89FF, 0xD384, 0x8A00, 0xD1D4, 0x8A01, 0xD385, 0x8A02, 0xD386, + 0x8A03, 0xD387, 0x8A04, 0xD388, 0x8A05, 0xD389, 0x8A06, 0xD38A, 0x8A07, 0xD9EA, 0x8A08, 0xD38B, 0x8A09, 0xD38C, 0x8A0A, 0xD38D, + 0x8A0B, 0xD38E, 0x8A0C, 0xD38F, 0x8A0D, 0xD390, 0x8A0E, 0xD391, 0x8A0F, 0xD392, 0x8A10, 0xD393, 0x8A11, 0xD394, 0x8A12, 0xD395, + 0x8A13, 0xD396, 0x8A14, 0xD397, 0x8A15, 0xD398, 0x8A16, 0xD399, 0x8A17, 0xD39A, 0x8A18, 0xD39B, 0x8A19, 0xD39C, 0x8A1A, 0xD39D, + 0x8A1B, 0xD39E, 0x8A1C, 0xD39F, 0x8A1D, 0xD3A0, 0x8A1E, 0xD440, 0x8A1F, 0xD441, 0x8A20, 0xD442, 0x8A21, 0xD443, 0x8A22, 0xD444, + 0x8A23, 0xD445, 0x8A24, 0xD446, 0x8A25, 0xD447, 0x8A26, 0xD448, 0x8A27, 0xD449, 0x8A28, 0xD44A, 0x8A29, 0xD44B, 0x8A2A, 0xD44C, + 0x8A2B, 0xD44D, 0x8A2C, 0xD44E, 0x8A2D, 0xD44F, 0x8A2E, 0xD450, 0x8A2F, 0xD451, 0x8A30, 0xD452, 0x8A31, 0xD453, 0x8A32, 0xD454, + 0x8A33, 0xD455, 0x8A34, 0xD456, 0x8A35, 0xD457, 0x8A36, 0xD458, 0x8A37, 0xD459, 0x8A38, 0xD45A, 0x8A39, 0xD45B, 0x8A3A, 0xD45C, + 0x8A3B, 0xD45D, 0x8A3C, 0xD45E, 0x8A3D, 0xD45F, 0x8A3E, 0xF6A4, 0x8A3F, 0xD460, 0x8A40, 0xD461, 0x8A41, 0xD462, 0x8A42, 0xD463, + 0x8A43, 0xD464, 0x8A44, 0xD465, 0x8A45, 0xD466, 0x8A46, 0xD467, 0x8A47, 0xD468, 0x8A48, 0xEEBA, 0x8A49, 0xD469, 0x8A4A, 0xD46A, + 0x8A4B, 0xD46B, 0x8A4C, 0xD46C, 0x8A4D, 0xD46D, 0x8A4E, 0xD46E, 0x8A4F, 0xD46F, 0x8A50, 0xD470, 0x8A51, 0xD471, 0x8A52, 0xD472, + 0x8A53, 0xD473, 0x8A54, 0xD474, 0x8A55, 0xD475, 0x8A56, 0xD476, 0x8A57, 0xD477, 0x8A58, 0xD478, 0x8A59, 0xD479, 0x8A5A, 0xD47A, + 0x8A5B, 0xD47B, 0x8A5C, 0xD47C, 0x8A5D, 0xD47D, 0x8A5E, 0xD47E, 0x8A5F, 0xD480, 0x8A60, 0xD481, 0x8A61, 0xD482, 0x8A62, 0xD483, + 0x8A63, 0xD484, 0x8A64, 0xD485, 0x8A65, 0xD486, 0x8A66, 0xD487, 0x8A67, 0xD488, 0x8A68, 0xD489, 0x8A69, 0xD48A, 0x8A6A, 0xD48B, + 0x8A6B, 0xD48C, 0x8A6C, 0xD48D, 0x8A6D, 0xD48E, 0x8A6E, 0xD48F, 0x8A6F, 0xD490, 0x8A70, 0xD491, 0x8A71, 0xD492, 0x8A72, 0xD493, + 0x8A73, 0xD494, 0x8A74, 0xD495, 0x8A75, 0xD496, 0x8A76, 0xD497, 0x8A77, 0xD498, 0x8A78, 0xD499, 0x8A79, 0xD5B2, 0x8A7A, 0xD49A, + 0x8A7B, 0xD49B, 0x8A7C, 0xD49C, 0x8A7D, 0xD49D, 0x8A7E, 0xD49E, 0x8A7F, 0xD49F, 0x8A80, 0xD4A0, 0x8A81, 0xD540, 0x8A82, 0xD541, + 0x8A83, 0xD542, 0x8A84, 0xD543, 0x8A85, 0xD544, 0x8A86, 0xD545, 0x8A87, 0xD546, 0x8A88, 0xD547, 0x8A89, 0xD3FE, 0x8A8A, 0xCCDC, + 0x8A8B, 0xD548, 0x8A8C, 0xD549, 0x8A8D, 0xD54A, 0x8A8E, 0xD54B, 0x8A8F, 0xD54C, 0x8A90, 0xD54D, 0x8A91, 0xD54E, 0x8A92, 0xD54F, + 0x8A93, 0xCAC4, 0x8A94, 0xD550, 0x8A95, 0xD551, 0x8A96, 0xD552, 0x8A97, 0xD553, 0x8A98, 0xD554, 0x8A99, 0xD555, 0x8A9A, 0xD556, + 0x8A9B, 0xD557, 0x8A9C, 0xD558, 0x8A9D, 0xD559, 0x8A9E, 0xD55A, 0x8A9F, 0xD55B, 0x8AA0, 0xD55C, 0x8AA1, 0xD55D, 0x8AA2, 0xD55E, + 0x8AA3, 0xD55F, 0x8AA4, 0xD560, 0x8AA5, 0xD561, 0x8AA6, 0xD562, 0x8AA7, 0xD563, 0x8AA8, 0xD564, 0x8AA9, 0xD565, 0x8AAA, 0xD566, + 0x8AAB, 0xD567, 0x8AAC, 0xD568, 0x8AAD, 0xD569, 0x8AAE, 0xD56A, 0x8AAF, 0xD56B, 0x8AB0, 0xD56C, 0x8AB1, 0xD56D, 0x8AB2, 0xD56E, + 0x8AB3, 0xD56F, 0x8AB4, 0xD570, 0x8AB5, 0xD571, 0x8AB6, 0xD572, 0x8AB7, 0xD573, 0x8AB8, 0xD574, 0x8AB9, 0xD575, 0x8ABA, 0xD576, + 0x8ABB, 0xD577, 0x8ABC, 0xD578, 0x8ABD, 0xD579, 0x8ABE, 0xD57A, 0x8ABF, 0xD57B, 0x8AC0, 0xD57C, 0x8AC1, 0xD57D, 0x8AC2, 0xD57E, + 0x8AC3, 0xD580, 0x8AC4, 0xD581, 0x8AC5, 0xD582, 0x8AC6, 0xD583, 0x8AC7, 0xD584, 0x8AC8, 0xD585, 0x8AC9, 0xD586, 0x8ACA, 0xD587, + 0x8ACB, 0xD588, 0x8ACC, 0xD589, 0x8ACD, 0xD58A, 0x8ACE, 0xD58B, 0x8ACF, 0xD58C, 0x8AD0, 0xD58D, 0x8AD1, 0xD58E, 0x8AD2, 0xD58F, + 0x8AD3, 0xD590, 0x8AD4, 0xD591, 0x8AD5, 0xD592, 0x8AD6, 0xD593, 0x8AD7, 0xD594, 0x8AD8, 0xD595, 0x8AD9, 0xD596, 0x8ADA, 0xD597, + 0x8ADB, 0xD598, 0x8ADC, 0xD599, 0x8ADD, 0xD59A, 0x8ADE, 0xD59B, 0x8ADF, 0xD59C, 0x8AE0, 0xD59D, 0x8AE1, 0xD59E, 0x8AE2, 0xD59F, + 0x8AE3, 0xD5A0, 0x8AE4, 0xD640, 0x8AE5, 0xD641, 0x8AE6, 0xD642, 0x8AE7, 0xD643, 0x8AE8, 0xD644, 0x8AE9, 0xD645, 0x8AEA, 0xD646, + 0x8AEB, 0xD647, 0x8AEC, 0xD648, 0x8AED, 0xD649, 0x8AEE, 0xD64A, 0x8AEF, 0xD64B, 0x8AF0, 0xD64C, 0x8AF1, 0xD64D, 0x8AF2, 0xD64E, + 0x8AF3, 0xD64F, 0x8AF4, 0xD650, 0x8AF5, 0xD651, 0x8AF6, 0xD652, 0x8AF7, 0xD653, 0x8AF8, 0xD654, 0x8AF9, 0xD655, 0x8AFA, 0xD656, + 0x8AFB, 0xD657, 0x8AFC, 0xD658, 0x8AFD, 0xD659, 0x8AFE, 0xD65A, 0x8AFF, 0xD65B, 0x8B00, 0xD65C, 0x8B01, 0xD65D, 0x8B02, 0xD65E, + 0x8B03, 0xD65F, 0x8B04, 0xD660, 0x8B05, 0xD661, 0x8B06, 0xD662, 0x8B07, 0xE5C0, 0x8B08, 0xD663, 0x8B09, 0xD664, 0x8B0A, 0xD665, + 0x8B0B, 0xD666, 0x8B0C, 0xD667, 0x8B0D, 0xD668, 0x8B0E, 0xD669, 0x8B0F, 0xD66A, 0x8B10, 0xD66B, 0x8B11, 0xD66C, 0x8B12, 0xD66D, + 0x8B13, 0xD66E, 0x8B14, 0xD66F, 0x8B15, 0xD670, 0x8B16, 0xD671, 0x8B17, 0xD672, 0x8B18, 0xD673, 0x8B19, 0xD674, 0x8B1A, 0xD675, + 0x8B1B, 0xD676, 0x8B1C, 0xD677, 0x8B1D, 0xD678, 0x8B1E, 0xD679, 0x8B1F, 0xD67A, 0x8B20, 0xD67B, 0x8B21, 0xD67C, 0x8B22, 0xD67D, + 0x8B23, 0xD67E, 0x8B24, 0xD680, 0x8B25, 0xD681, 0x8B26, 0xF6A5, 0x8B27, 0xD682, 0x8B28, 0xD683, 0x8B29, 0xD684, 0x8B2A, 0xD685, + 0x8B2B, 0xD686, 0x8B2C, 0xD687, 0x8B2D, 0xD688, 0x8B2E, 0xD689, 0x8B2F, 0xD68A, 0x8B30, 0xD68B, 0x8B31, 0xD68C, 0x8B32, 0xD68D, + 0x8B33, 0xD68E, 0x8B34, 0xD68F, 0x8B35, 0xD690, 0x8B36, 0xD691, 0x8B37, 0xD692, 0x8B38, 0xD693, 0x8B39, 0xD694, 0x8B3A, 0xD695, + 0x8B3B, 0xD696, 0x8B3C, 0xD697, 0x8B3D, 0xD698, 0x8B3E, 0xD699, 0x8B3F, 0xD69A, 0x8B40, 0xD69B, 0x8B41, 0xD69C, 0x8B42, 0xD69D, + 0x8B43, 0xD69E, 0x8B44, 0xD69F, 0x8B45, 0xD6A0, 0x8B46, 0xD740, 0x8B47, 0xD741, 0x8B48, 0xD742, 0x8B49, 0xD743, 0x8B4A, 0xD744, + 0x8B4B, 0xD745, 0x8B4C, 0xD746, 0x8B4D, 0xD747, 0x8B4E, 0xD748, 0x8B4F, 0xD749, 0x8B50, 0xD74A, 0x8B51, 0xD74B, 0x8B52, 0xD74C, + 0x8B53, 0xD74D, 0x8B54, 0xD74E, 0x8B55, 0xD74F, 0x8B56, 0xD750, 0x8B57, 0xD751, 0x8B58, 0xD752, 0x8B59, 0xD753, 0x8B5A, 0xD754, + 0x8B5B, 0xD755, 0x8B5C, 0xD756, 0x8B5D, 0xD757, 0x8B5E, 0xD758, 0x8B5F, 0xD759, 0x8B60, 0xD75A, 0x8B61, 0xD75B, 0x8B62, 0xD75C, + 0x8B63, 0xD75D, 0x8B64, 0xD75E, 0x8B65, 0xD75F, 0x8B66, 0xBEAF, 0x8B67, 0xD760, 0x8B68, 0xD761, 0x8B69, 0xD762, 0x8B6A, 0xD763, + 0x8B6B, 0xD764, 0x8B6C, 0xC6A9, 0x8B6D, 0xD765, 0x8B6E, 0xD766, 0x8B6F, 0xD767, 0x8B70, 0xD768, 0x8B71, 0xD769, 0x8B72, 0xD76A, + 0x8B73, 0xD76B, 0x8B74, 0xD76C, 0x8B75, 0xD76D, 0x8B76, 0xD76E, 0x8B77, 0xD76F, 0x8B78, 0xD770, 0x8B79, 0xD771, 0x8B7A, 0xD772, + 0x8B7B, 0xD773, 0x8B7C, 0xD774, 0x8B7D, 0xD775, 0x8B7E, 0xD776, 0x8B7F, 0xD777, 0x8B80, 0xD778, 0x8B81, 0xD779, 0x8B82, 0xD77A, + 0x8B83, 0xD77B, 0x8B84, 0xD77C, 0x8B85, 0xD77D, 0x8B86, 0xD77E, 0x8B87, 0xD780, 0x8B88, 0xD781, 0x8B89, 0xD782, 0x8B8A, 0xD783, + 0x8B8B, 0xD784, 0x8B8C, 0xD785, 0x8B8D, 0xD786, 0x8B8E, 0xD787, 0x8B8F, 0xD788, 0x8B90, 0xD789, 0x8B91, 0xD78A, 0x8B92, 0xD78B, + 0x8B93, 0xD78C, 0x8B94, 0xD78D, 0x8B95, 0xD78E, 0x8B96, 0xD78F, 0x8B97, 0xD790, 0x8B98, 0xD791, 0x8B99, 0xD792, 0x8B9A, 0xD793, + 0x8B9B, 0xD794, 0x8B9C, 0xD795, 0x8B9D, 0xD796, 0x8B9E, 0xD797, 0x8B9F, 0xD798, 0x8BA0, 0xDAA5, 0x8BA1, 0xBCC6, 0x8BA2, 0xB6A9, + 0x8BA3, 0xB8BC, 0x8BA4, 0xC8CF, 0x8BA5, 0xBCA5, 0x8BA6, 0xDAA6, 0x8BA7, 0xDAA7, 0x8BA8, 0xCCD6, 0x8BA9, 0xC8C3, 0x8BAA, 0xDAA8, + 0x8BAB, 0xC6FD, 0x8BAC, 0xD799, 0x8BAD, 0xD1B5, 0x8BAE, 0xD2E9, 0x8BAF, 0xD1B6, 0x8BB0, 0xBCC7, 0x8BB1, 0xD79A, 0x8BB2, 0xBDB2, + 0x8BB3, 0xBBE4, 0x8BB4, 0xDAA9, 0x8BB5, 0xDAAA, 0x8BB6, 0xD1C8, 0x8BB7, 0xDAAB, 0x8BB8, 0xD0ED, 0x8BB9, 0xB6EF, 0x8BBA, 0xC2DB, + 0x8BBB, 0xD79B, 0x8BBC, 0xCBCF, 0x8BBD, 0xB7ED, 0x8BBE, 0xC9E8, 0x8BBF, 0xB7C3, 0x8BC0, 0xBEF7, 0x8BC1, 0xD6A4, 0x8BC2, 0xDAAC, + 0x8BC3, 0xDAAD, 0x8BC4, 0xC6C0, 0x8BC5, 0xD7E7, 0x8BC6, 0xCAB6, 0x8BC7, 0xD79C, 0x8BC8, 0xD5A9, 0x8BC9, 0xCBDF, 0x8BCA, 0xD5EF, + 0x8BCB, 0xDAAE, 0x8BCC, 0xD6DF, 0x8BCD, 0xB4CA, 0x8BCE, 0xDAB0, 0x8BCF, 0xDAAF, 0x8BD0, 0xD79D, 0x8BD1, 0xD2EB, 0x8BD2, 0xDAB1, + 0x8BD3, 0xDAB2, 0x8BD4, 0xDAB3, 0x8BD5, 0xCAD4, 0x8BD6, 0xDAB4, 0x8BD7, 0xCAAB, 0x8BD8, 0xDAB5, 0x8BD9, 0xDAB6, 0x8BDA, 0xB3CF, + 0x8BDB, 0xD6EF, 0x8BDC, 0xDAB7, 0x8BDD, 0xBBB0, 0x8BDE, 0xB5AE, 0x8BDF, 0xDAB8, 0x8BE0, 0xDAB9, 0x8BE1, 0xB9EE, 0x8BE2, 0xD1AF, + 0x8BE3, 0xD2E8, 0x8BE4, 0xDABA, 0x8BE5, 0xB8C3, 0x8BE6, 0xCFEA, 0x8BE7, 0xB2EF, 0x8BE8, 0xDABB, 0x8BE9, 0xDABC, 0x8BEA, 0xD79E, + 0x8BEB, 0xBDEB, 0x8BEC, 0xCEDC, 0x8BED, 0xD3EF, 0x8BEE, 0xDABD, 0x8BEF, 0xCEF3, 0x8BF0, 0xDABE, 0x8BF1, 0xD3D5, 0x8BF2, 0xBBE5, + 0x8BF3, 0xDABF, 0x8BF4, 0xCBB5, 0x8BF5, 0xCBD0, 0x8BF6, 0xDAC0, 0x8BF7, 0xC7EB, 0x8BF8, 0xD6EE, 0x8BF9, 0xDAC1, 0x8BFA, 0xC5B5, + 0x8BFB, 0xB6C1, 0x8BFC, 0xDAC2, 0x8BFD, 0xB7CC, 0x8BFE, 0xBFCE, 0x8BFF, 0xDAC3, 0x8C00, 0xDAC4, 0x8C01, 0xCBAD, 0x8C02, 0xDAC5, + 0x8C03, 0xB5F7, 0x8C04, 0xDAC6, 0x8C05, 0xC1C2, 0x8C06, 0xD7BB, 0x8C07, 0xDAC7, 0x8C08, 0xCCB8, 0x8C09, 0xD79F, 0x8C0A, 0xD2EA, + 0x8C0B, 0xC4B1, 0x8C0C, 0xDAC8, 0x8C0D, 0xB5FD, 0x8C0E, 0xBBD1, 0x8C0F, 0xDAC9, 0x8C10, 0xD0B3, 0x8C11, 0xDACA, 0x8C12, 0xDACB, + 0x8C13, 0xCEBD, 0x8C14, 0xDACC, 0x8C15, 0xDACD, 0x8C16, 0xDACE, 0x8C17, 0xB2F7, 0x8C18, 0xDAD1, 0x8C19, 0xDACF, 0x8C1A, 0xD1E8, + 0x8C1B, 0xDAD0, 0x8C1C, 0xC3D5, 0x8C1D, 0xDAD2, 0x8C1E, 0xD7A0, 0x8C1F, 0xDAD3, 0x8C20, 0xDAD4, 0x8C21, 0xDAD5, 0x8C22, 0xD0BB, + 0x8C23, 0xD2A5, 0x8C24, 0xB0F9, 0x8C25, 0xDAD6, 0x8C26, 0xC7AB, 0x8C27, 0xDAD7, 0x8C28, 0xBDF7, 0x8C29, 0xC3A1, 0x8C2A, 0xDAD8, + 0x8C2B, 0xDAD9, 0x8C2C, 0xC3FD, 0x8C2D, 0xCCB7, 0x8C2E, 0xDADA, 0x8C2F, 0xDADB, 0x8C30, 0xC0BE, 0x8C31, 0xC6D7, 0x8C32, 0xDADC, + 0x8C33, 0xDADD, 0x8C34, 0xC7B4, 0x8C35, 0xDADE, 0x8C36, 0xDADF, 0x8C37, 0xB9C8, 0x8C38, 0xD840, 0x8C39, 0xD841, 0x8C3A, 0xD842, + 0x8C3B, 0xD843, 0x8C3C, 0xD844, 0x8C3D, 0xD845, 0x8C3E, 0xD846, 0x8C3F, 0xD847, 0x8C40, 0xD848, 0x8C41, 0xBBED, 0x8C42, 0xD849, + 0x8C43, 0xD84A, 0x8C44, 0xD84B, 0x8C45, 0xD84C, 0x8C46, 0xB6B9, 0x8C47, 0xF4F8, 0x8C48, 0xD84D, 0x8C49, 0xF4F9, 0x8C4A, 0xD84E, + 0x8C4B, 0xD84F, 0x8C4C, 0xCDE3, 0x8C4D, 0xD850, 0x8C4E, 0xD851, 0x8C4F, 0xD852, 0x8C50, 0xD853, 0x8C51, 0xD854, 0x8C52, 0xD855, + 0x8C53, 0xD856, 0x8C54, 0xD857, 0x8C55, 0xF5B9, 0x8C56, 0xD858, 0x8C57, 0xD859, 0x8C58, 0xD85A, 0x8C59, 0xD85B, 0x8C5A, 0xEBE0, + 0x8C5B, 0xD85C, 0x8C5C, 0xD85D, 0x8C5D, 0xD85E, 0x8C5E, 0xD85F, 0x8C5F, 0xD860, 0x8C60, 0xD861, 0x8C61, 0xCFF3, 0x8C62, 0xBBBF, + 0x8C63, 0xD862, 0x8C64, 0xD863, 0x8C65, 0xD864, 0x8C66, 0xD865, 0x8C67, 0xD866, 0x8C68, 0xD867, 0x8C69, 0xD868, 0x8C6A, 0xBAC0, + 0x8C6B, 0xD4A5, 0x8C6C, 0xD869, 0x8C6D, 0xD86A, 0x8C6E, 0xD86B, 0x8C6F, 0xD86C, 0x8C70, 0xD86D, 0x8C71, 0xD86E, 0x8C72, 0xD86F, + 0x8C73, 0xE1D9, 0x8C74, 0xD870, 0x8C75, 0xD871, 0x8C76, 0xD872, 0x8C77, 0xD873, 0x8C78, 0xF5F4, 0x8C79, 0xB1AA, 0x8C7A, 0xB2F2, + 0x8C7B, 0xD874, 0x8C7C, 0xD875, 0x8C7D, 0xD876, 0x8C7E, 0xD877, 0x8C7F, 0xD878, 0x8C80, 0xD879, 0x8C81, 0xD87A, 0x8C82, 0xF5F5, + 0x8C83, 0xD87B, 0x8C84, 0xD87C, 0x8C85, 0xF5F7, 0x8C86, 0xD87D, 0x8C87, 0xD87E, 0x8C88, 0xD880, 0x8C89, 0xBAD1, 0x8C8A, 0xF5F6, + 0x8C8B, 0xD881, 0x8C8C, 0xC3B2, 0x8C8D, 0xD882, 0x8C8E, 0xD883, 0x8C8F, 0xD884, 0x8C90, 0xD885, 0x8C91, 0xD886, 0x8C92, 0xD887, + 0x8C93, 0xD888, 0x8C94, 0xF5F9, 0x8C95, 0xD889, 0x8C96, 0xD88A, 0x8C97, 0xD88B, 0x8C98, 0xF5F8, 0x8C99, 0xD88C, 0x8C9A, 0xD88D, + 0x8C9B, 0xD88E, 0x8C9C, 0xD88F, 0x8C9D, 0xD890, 0x8C9E, 0xD891, 0x8C9F, 0xD892, 0x8CA0, 0xD893, 0x8CA1, 0xD894, 0x8CA2, 0xD895, + 0x8CA3, 0xD896, 0x8CA4, 0xD897, 0x8CA5, 0xD898, 0x8CA6, 0xD899, 0x8CA7, 0xD89A, 0x8CA8, 0xD89B, 0x8CA9, 0xD89C, 0x8CAA, 0xD89D, + 0x8CAB, 0xD89E, 0x8CAC, 0xD89F, 0x8CAD, 0xD8A0, 0x8CAE, 0xD940, 0x8CAF, 0xD941, 0x8CB0, 0xD942, 0x8CB1, 0xD943, 0x8CB2, 0xD944, + 0x8CB3, 0xD945, 0x8CB4, 0xD946, 0x8CB5, 0xD947, 0x8CB6, 0xD948, 0x8CB7, 0xD949, 0x8CB8, 0xD94A, 0x8CB9, 0xD94B, 0x8CBA, 0xD94C, + 0x8CBB, 0xD94D, 0x8CBC, 0xD94E, 0x8CBD, 0xD94F, 0x8CBE, 0xD950, 0x8CBF, 0xD951, 0x8CC0, 0xD952, 0x8CC1, 0xD953, 0x8CC2, 0xD954, + 0x8CC3, 0xD955, 0x8CC4, 0xD956, 0x8CC5, 0xD957, 0x8CC6, 0xD958, 0x8CC7, 0xD959, 0x8CC8, 0xD95A, 0x8CC9, 0xD95B, 0x8CCA, 0xD95C, + 0x8CCB, 0xD95D, 0x8CCC, 0xD95E, 0x8CCD, 0xD95F, 0x8CCE, 0xD960, 0x8CCF, 0xD961, 0x8CD0, 0xD962, 0x8CD1, 0xD963, 0x8CD2, 0xD964, + 0x8CD3, 0xD965, 0x8CD4, 0xD966, 0x8CD5, 0xD967, 0x8CD6, 0xD968, 0x8CD7, 0xD969, 0x8CD8, 0xD96A, 0x8CD9, 0xD96B, 0x8CDA, 0xD96C, + 0x8CDB, 0xD96D, 0x8CDC, 0xD96E, 0x8CDD, 0xD96F, 0x8CDE, 0xD970, 0x8CDF, 0xD971, 0x8CE0, 0xD972, 0x8CE1, 0xD973, 0x8CE2, 0xD974, + 0x8CE3, 0xD975, 0x8CE4, 0xD976, 0x8CE5, 0xD977, 0x8CE6, 0xD978, 0x8CE7, 0xD979, 0x8CE8, 0xD97A, 0x8CE9, 0xD97B, 0x8CEA, 0xD97C, + 0x8CEB, 0xD97D, 0x8CEC, 0xD97E, 0x8CED, 0xD980, 0x8CEE, 0xD981, 0x8CEF, 0xD982, 0x8CF0, 0xD983, 0x8CF1, 0xD984, 0x8CF2, 0xD985, + 0x8CF3, 0xD986, 0x8CF4, 0xD987, 0x8CF5, 0xD988, 0x8CF6, 0xD989, 0x8CF7, 0xD98A, 0x8CF8, 0xD98B, 0x8CF9, 0xD98C, 0x8CFA, 0xD98D, + 0x8CFB, 0xD98E, 0x8CFC, 0xD98F, 0x8CFD, 0xD990, 0x8CFE, 0xD991, 0x8CFF, 0xD992, 0x8D00, 0xD993, 0x8D01, 0xD994, 0x8D02, 0xD995, + 0x8D03, 0xD996, 0x8D04, 0xD997, 0x8D05, 0xD998, 0x8D06, 0xD999, 0x8D07, 0xD99A, 0x8D08, 0xD99B, 0x8D09, 0xD99C, 0x8D0A, 0xD99D, + 0x8D0B, 0xD99E, 0x8D0C, 0xD99F, 0x8D0D, 0xD9A0, 0x8D0E, 0xDA40, 0x8D0F, 0xDA41, 0x8D10, 0xDA42, 0x8D11, 0xDA43, 0x8D12, 0xDA44, + 0x8D13, 0xDA45, 0x8D14, 0xDA46, 0x8D15, 0xDA47, 0x8D16, 0xDA48, 0x8D17, 0xDA49, 0x8D18, 0xDA4A, 0x8D19, 0xDA4B, 0x8D1A, 0xDA4C, + 0x8D1B, 0xDA4D, 0x8D1C, 0xDA4E, 0x8D1D, 0xB1B4, 0x8D1E, 0xD5EA, 0x8D1F, 0xB8BA, 0x8D20, 0xDA4F, 0x8D21, 0xB9B1, 0x8D22, 0xB2C6, + 0x8D23, 0xD4F0, 0x8D24, 0xCFCD, 0x8D25, 0xB0DC, 0x8D26, 0xD5CB, 0x8D27, 0xBBF5, 0x8D28, 0xD6CA, 0x8D29, 0xB7B7, 0x8D2A, 0xCCB0, + 0x8D2B, 0xC6B6, 0x8D2C, 0xB1E1, 0x8D2D, 0xB9BA, 0x8D2E, 0xD6FC, 0x8D2F, 0xB9E1, 0x8D30, 0xB7A1, 0x8D31, 0xBCFA, 0x8D32, 0xEADA, + 0x8D33, 0xEADB, 0x8D34, 0xCCF9, 0x8D35, 0xB9F3, 0x8D36, 0xEADC, 0x8D37, 0xB4FB, 0x8D38, 0xC3B3, 0x8D39, 0xB7D1, 0x8D3A, 0xBAD8, + 0x8D3B, 0xEADD, 0x8D3C, 0xD4F4, 0x8D3D, 0xEADE, 0x8D3E, 0xBCD6, 0x8D3F, 0xBBDF, 0x8D40, 0xEADF, 0x8D41, 0xC1DE, 0x8D42, 0xC2B8, + 0x8D43, 0xD4DF, 0x8D44, 0xD7CA, 0x8D45, 0xEAE0, 0x8D46, 0xEAE1, 0x8D47, 0xEAE4, 0x8D48, 0xEAE2, 0x8D49, 0xEAE3, 0x8D4A, 0xC9DE, + 0x8D4B, 0xB8B3, 0x8D4C, 0xB6C4, 0x8D4D, 0xEAE5, 0x8D4E, 0xCAEA, 0x8D4F, 0xC9CD, 0x8D50, 0xB4CD, 0x8D51, 0xDA50, 0x8D52, 0xDA51, + 0x8D53, 0xE2D9, 0x8D54, 0xC5E2, 0x8D55, 0xEAE6, 0x8D56, 0xC0B5, 0x8D57, 0xDA52, 0x8D58, 0xD7B8, 0x8D59, 0xEAE7, 0x8D5A, 0xD7AC, + 0x8D5B, 0xC8FC, 0x8D5C, 0xD8D3, 0x8D5D, 0xD8CD, 0x8D5E, 0xD4DE, 0x8D5F, 0xDA53, 0x8D60, 0xD4F9, 0x8D61, 0xC9C4, 0x8D62, 0xD3AE, + 0x8D63, 0xB8D3, 0x8D64, 0xB3E0, 0x8D65, 0xDA54, 0x8D66, 0xC9E2, 0x8D67, 0xF4F6, 0x8D68, 0xDA55, 0x8D69, 0xDA56, 0x8D6A, 0xDA57, + 0x8D6B, 0xBAD5, 0x8D6C, 0xDA58, 0x8D6D, 0xF4F7, 0x8D6E, 0xDA59, 0x8D6F, 0xDA5A, 0x8D70, 0xD7DF, 0x8D71, 0xDA5B, 0x8D72, 0xDA5C, + 0x8D73, 0xF4F1, 0x8D74, 0xB8B0, 0x8D75, 0xD5D4, 0x8D76, 0xB8CF, 0x8D77, 0xC6F0, 0x8D78, 0xDA5D, 0x8D79, 0xDA5E, 0x8D7A, 0xDA5F, + 0x8D7B, 0xDA60, 0x8D7C, 0xDA61, 0x8D7D, 0xDA62, 0x8D7E, 0xDA63, 0x8D7F, 0xDA64, 0x8D80, 0xDA65, 0x8D81, 0xB3C3, 0x8D82, 0xDA66, + 0x8D83, 0xDA67, 0x8D84, 0xF4F2, 0x8D85, 0xB3AC, 0x8D86, 0xDA68, 0x8D87, 0xDA69, 0x8D88, 0xDA6A, 0x8D89, 0xDA6B, 0x8D8A, 0xD4BD, + 0x8D8B, 0xC7F7, 0x8D8C, 0xDA6C, 0x8D8D, 0xDA6D, 0x8D8E, 0xDA6E, 0x8D8F, 0xDA6F, 0x8D90, 0xDA70, 0x8D91, 0xF4F4, 0x8D92, 0xDA71, + 0x8D93, 0xDA72, 0x8D94, 0xF4F3, 0x8D95, 0xDA73, 0x8D96, 0xDA74, 0x8D97, 0xDA75, 0x8D98, 0xDA76, 0x8D99, 0xDA77, 0x8D9A, 0xDA78, + 0x8D9B, 0xDA79, 0x8D9C, 0xDA7A, 0x8D9D, 0xDA7B, 0x8D9E, 0xDA7C, 0x8D9F, 0xCCCB, 0x8DA0, 0xDA7D, 0x8DA1, 0xDA7E, 0x8DA2, 0xDA80, + 0x8DA3, 0xC8A4, 0x8DA4, 0xDA81, 0x8DA5, 0xDA82, 0x8DA6, 0xDA83, 0x8DA7, 0xDA84, 0x8DA8, 0xDA85, 0x8DA9, 0xDA86, 0x8DAA, 0xDA87, + 0x8DAB, 0xDA88, 0x8DAC, 0xDA89, 0x8DAD, 0xDA8A, 0x8DAE, 0xDA8B, 0x8DAF, 0xDA8C, 0x8DB0, 0xDA8D, 0x8DB1, 0xF4F5, 0x8DB2, 0xDA8E, + 0x8DB3, 0xD7E3, 0x8DB4, 0xC5BF, 0x8DB5, 0xF5C0, 0x8DB6, 0xDA8F, 0x8DB7, 0xDA90, 0x8DB8, 0xF5BB, 0x8DB9, 0xDA91, 0x8DBA, 0xF5C3, + 0x8DBB, 0xDA92, 0x8DBC, 0xF5C2, 0x8DBD, 0xDA93, 0x8DBE, 0xD6BA, 0x8DBF, 0xF5C1, 0x8DC0, 0xDA94, 0x8DC1, 0xDA95, 0x8DC2, 0xDA96, + 0x8DC3, 0xD4BE, 0x8DC4, 0xF5C4, 0x8DC5, 0xDA97, 0x8DC6, 0xF5CC, 0x8DC7, 0xDA98, 0x8DC8, 0xDA99, 0x8DC9, 0xDA9A, 0x8DCA, 0xDA9B, + 0x8DCB, 0xB0CF, 0x8DCC, 0xB5F8, 0x8DCD, 0xDA9C, 0x8DCE, 0xF5C9, 0x8DCF, 0xF5CA, 0x8DD0, 0xDA9D, 0x8DD1, 0xC5DC, 0x8DD2, 0xDA9E, + 0x8DD3, 0xDA9F, 0x8DD4, 0xDAA0, 0x8DD5, 0xDB40, 0x8DD6, 0xF5C5, 0x8DD7, 0xF5C6, 0x8DD8, 0xDB41, 0x8DD9, 0xDB42, 0x8DDA, 0xF5C7, + 0x8DDB, 0xF5CB, 0x8DDC, 0xDB43, 0x8DDD, 0xBEE0, 0x8DDE, 0xF5C8, 0x8DDF, 0xB8FA, 0x8DE0, 0xDB44, 0x8DE1, 0xDB45, 0x8DE2, 0xDB46, + 0x8DE3, 0xF5D0, 0x8DE4, 0xF5D3, 0x8DE5, 0xDB47, 0x8DE6, 0xDB48, 0x8DE7, 0xDB49, 0x8DE8, 0xBFE7, 0x8DE9, 0xDB4A, 0x8DEA, 0xB9F2, + 0x8DEB, 0xF5BC, 0x8DEC, 0xF5CD, 0x8DED, 0xDB4B, 0x8DEE, 0xDB4C, 0x8DEF, 0xC2B7, 0x8DF0, 0xDB4D, 0x8DF1, 0xDB4E, 0x8DF2, 0xDB4F, + 0x8DF3, 0xCCF8, 0x8DF4, 0xDB50, 0x8DF5, 0xBCF9, 0x8DF6, 0xDB51, 0x8DF7, 0xF5CE, 0x8DF8, 0xF5CF, 0x8DF9, 0xF5D1, 0x8DFA, 0xB6E5, + 0x8DFB, 0xF5D2, 0x8DFC, 0xDB52, 0x8DFD, 0xF5D5, 0x8DFE, 0xDB53, 0x8DFF, 0xDB54, 0x8E00, 0xDB55, 0x8E01, 0xDB56, 0x8E02, 0xDB57, + 0x8E03, 0xDB58, 0x8E04, 0xDB59, 0x8E05, 0xF5BD, 0x8E06, 0xDB5A, 0x8E07, 0xDB5B, 0x8E08, 0xDB5C, 0x8E09, 0xF5D4, 0x8E0A, 0xD3BB, + 0x8E0B, 0xDB5D, 0x8E0C, 0xB3EC, 0x8E0D, 0xDB5E, 0x8E0E, 0xDB5F, 0x8E0F, 0xCCA4, 0x8E10, 0xDB60, 0x8E11, 0xDB61, 0x8E12, 0xDB62, + 0x8E13, 0xDB63, 0x8E14, 0xF5D6, 0x8E15, 0xDB64, 0x8E16, 0xDB65, 0x8E17, 0xDB66, 0x8E18, 0xDB67, 0x8E19, 0xDB68, 0x8E1A, 0xDB69, + 0x8E1B, 0xDB6A, 0x8E1C, 0xDB6B, 0x8E1D, 0xF5D7, 0x8E1E, 0xBEE1, 0x8E1F, 0xF5D8, 0x8E20, 0xDB6C, 0x8E21, 0xDB6D, 0x8E22, 0xCCDF, + 0x8E23, 0xF5DB, 0x8E24, 0xDB6E, 0x8E25, 0xDB6F, 0x8E26, 0xDB70, 0x8E27, 0xDB71, 0x8E28, 0xDB72, 0x8E29, 0xB2C8, 0x8E2A, 0xD7D9, + 0x8E2B, 0xDB73, 0x8E2C, 0xF5D9, 0x8E2D, 0xDB74, 0x8E2E, 0xF5DA, 0x8E2F, 0xF5DC, 0x8E30, 0xDB75, 0x8E31, 0xF5E2, 0x8E32, 0xDB76, + 0x8E33, 0xDB77, 0x8E34, 0xDB78, 0x8E35, 0xF5E0, 0x8E36, 0xDB79, 0x8E37, 0xDB7A, 0x8E38, 0xDB7B, 0x8E39, 0xF5DF, 0x8E3A, 0xF5DD, + 0x8E3B, 0xDB7C, 0x8E3C, 0xDB7D, 0x8E3D, 0xF5E1, 0x8E3E, 0xDB7E, 0x8E3F, 0xDB80, 0x8E40, 0xF5DE, 0x8E41, 0xF5E4, 0x8E42, 0xF5E5, + 0x8E43, 0xDB81, 0x8E44, 0xCCE3, 0x8E45, 0xDB82, 0x8E46, 0xDB83, 0x8E47, 0xE5BF, 0x8E48, 0xB5B8, 0x8E49, 0xF5E3, 0x8E4A, 0xF5E8, + 0x8E4B, 0xCCA3, 0x8E4C, 0xDB84, 0x8E4D, 0xDB85, 0x8E4E, 0xDB86, 0x8E4F, 0xDB87, 0x8E50, 0xDB88, 0x8E51, 0xF5E6, 0x8E52, 0xF5E7, + 0x8E53, 0xDB89, 0x8E54, 0xDB8A, 0x8E55, 0xDB8B, 0x8E56, 0xDB8C, 0x8E57, 0xDB8D, 0x8E58, 0xDB8E, 0x8E59, 0xF5BE, 0x8E5A, 0xDB8F, + 0x8E5B, 0xDB90, 0x8E5C, 0xDB91, 0x8E5D, 0xDB92, 0x8E5E, 0xDB93, 0x8E5F, 0xDB94, 0x8E60, 0xDB95, 0x8E61, 0xDB96, 0x8E62, 0xDB97, + 0x8E63, 0xDB98, 0x8E64, 0xDB99, 0x8E65, 0xDB9A, 0x8E66, 0xB1C4, 0x8E67, 0xDB9B, 0x8E68, 0xDB9C, 0x8E69, 0xF5BF, 0x8E6A, 0xDB9D, + 0x8E6B, 0xDB9E, 0x8E6C, 0xB5C5, 0x8E6D, 0xB2E4, 0x8E6E, 0xDB9F, 0x8E6F, 0xF5EC, 0x8E70, 0xF5E9, 0x8E71, 0xDBA0, 0x8E72, 0xB6D7, + 0x8E73, 0xDC40, 0x8E74, 0xF5ED, 0x8E75, 0xDC41, 0x8E76, 0xF5EA, 0x8E77, 0xDC42, 0x8E78, 0xDC43, 0x8E79, 0xDC44, 0x8E7A, 0xDC45, + 0x8E7B, 0xDC46, 0x8E7C, 0xF5EB, 0x8E7D, 0xDC47, 0x8E7E, 0xDC48, 0x8E7F, 0xB4DA, 0x8E80, 0xDC49, 0x8E81, 0xD4EA, 0x8E82, 0xDC4A, + 0x8E83, 0xDC4B, 0x8E84, 0xDC4C, 0x8E85, 0xF5EE, 0x8E86, 0xDC4D, 0x8E87, 0xB3F9, 0x8E88, 0xDC4E, 0x8E89, 0xDC4F, 0x8E8A, 0xDC50, + 0x8E8B, 0xDC51, 0x8E8C, 0xDC52, 0x8E8D, 0xDC53, 0x8E8E, 0xDC54, 0x8E8F, 0xF5EF, 0x8E90, 0xF5F1, 0x8E91, 0xDC55, 0x8E92, 0xDC56, + 0x8E93, 0xDC57, 0x8E94, 0xF5F0, 0x8E95, 0xDC58, 0x8E96, 0xDC59, 0x8E97, 0xDC5A, 0x8E98, 0xDC5B, 0x8E99, 0xDC5C, 0x8E9A, 0xDC5D, + 0x8E9B, 0xDC5E, 0x8E9C, 0xF5F2, 0x8E9D, 0xDC5F, 0x8E9E, 0xF5F3, 0x8E9F, 0xDC60, 0x8EA0, 0xDC61, 0x8EA1, 0xDC62, 0x8EA2, 0xDC63, + 0x8EA3, 0xDC64, 0x8EA4, 0xDC65, 0x8EA5, 0xDC66, 0x8EA6, 0xDC67, 0x8EA7, 0xDC68, 0x8EA8, 0xDC69, 0x8EA9, 0xDC6A, 0x8EAA, 0xDC6B, + 0x8EAB, 0xC9ED, 0x8EAC, 0xB9AA, 0x8EAD, 0xDC6C, 0x8EAE, 0xDC6D, 0x8EAF, 0xC7FB, 0x8EB0, 0xDC6E, 0x8EB1, 0xDC6F, 0x8EB2, 0xB6E3, + 0x8EB3, 0xDC70, 0x8EB4, 0xDC71, 0x8EB5, 0xDC72, 0x8EB6, 0xDC73, 0x8EB7, 0xDC74, 0x8EB8, 0xDC75, 0x8EB9, 0xDC76, 0x8EBA, 0xCCC9, + 0x8EBB, 0xDC77, 0x8EBC, 0xDC78, 0x8EBD, 0xDC79, 0x8EBE, 0xDC7A, 0x8EBF, 0xDC7B, 0x8EC0, 0xDC7C, 0x8EC1, 0xDC7D, 0x8EC2, 0xDC7E, + 0x8EC3, 0xDC80, 0x8EC4, 0xDC81, 0x8EC5, 0xDC82, 0x8EC6, 0xDC83, 0x8EC7, 0xDC84, 0x8EC8, 0xDC85, 0x8EC9, 0xDC86, 0x8ECA, 0xDC87, + 0x8ECB, 0xDC88, 0x8ECC, 0xDC89, 0x8ECD, 0xDC8A, 0x8ECE, 0xEAA6, 0x8ECF, 0xDC8B, 0x8ED0, 0xDC8C, 0x8ED1, 0xDC8D, 0x8ED2, 0xDC8E, + 0x8ED3, 0xDC8F, 0x8ED4, 0xDC90, 0x8ED5, 0xDC91, 0x8ED6, 0xDC92, 0x8ED7, 0xDC93, 0x8ED8, 0xDC94, 0x8ED9, 0xDC95, 0x8EDA, 0xDC96, + 0x8EDB, 0xDC97, 0x8EDC, 0xDC98, 0x8EDD, 0xDC99, 0x8EDE, 0xDC9A, 0x8EDF, 0xDC9B, 0x8EE0, 0xDC9C, 0x8EE1, 0xDC9D, 0x8EE2, 0xDC9E, + 0x8EE3, 0xDC9F, 0x8EE4, 0xDCA0, 0x8EE5, 0xDD40, 0x8EE6, 0xDD41, 0x8EE7, 0xDD42, 0x8EE8, 0xDD43, 0x8EE9, 0xDD44, 0x8EEA, 0xDD45, + 0x8EEB, 0xDD46, 0x8EEC, 0xDD47, 0x8EED, 0xDD48, 0x8EEE, 0xDD49, 0x8EEF, 0xDD4A, 0x8EF0, 0xDD4B, 0x8EF1, 0xDD4C, 0x8EF2, 0xDD4D, + 0x8EF3, 0xDD4E, 0x8EF4, 0xDD4F, 0x8EF5, 0xDD50, 0x8EF6, 0xDD51, 0x8EF7, 0xDD52, 0x8EF8, 0xDD53, 0x8EF9, 0xDD54, 0x8EFA, 0xDD55, + 0x8EFB, 0xDD56, 0x8EFC, 0xDD57, 0x8EFD, 0xDD58, 0x8EFE, 0xDD59, 0x8EFF, 0xDD5A, 0x8F00, 0xDD5B, 0x8F01, 0xDD5C, 0x8F02, 0xDD5D, + 0x8F03, 0xDD5E, 0x8F04, 0xDD5F, 0x8F05, 0xDD60, 0x8F06, 0xDD61, 0x8F07, 0xDD62, 0x8F08, 0xDD63, 0x8F09, 0xDD64, 0x8F0A, 0xDD65, + 0x8F0B, 0xDD66, 0x8F0C, 0xDD67, 0x8F0D, 0xDD68, 0x8F0E, 0xDD69, 0x8F0F, 0xDD6A, 0x8F10, 0xDD6B, 0x8F11, 0xDD6C, 0x8F12, 0xDD6D, + 0x8F13, 0xDD6E, 0x8F14, 0xDD6F, 0x8F15, 0xDD70, 0x8F16, 0xDD71, 0x8F17, 0xDD72, 0x8F18, 0xDD73, 0x8F19, 0xDD74, 0x8F1A, 0xDD75, + 0x8F1B, 0xDD76, 0x8F1C, 0xDD77, 0x8F1D, 0xDD78, 0x8F1E, 0xDD79, 0x8F1F, 0xDD7A, 0x8F20, 0xDD7B, 0x8F21, 0xDD7C, 0x8F22, 0xDD7D, + 0x8F23, 0xDD7E, 0x8F24, 0xDD80, 0x8F25, 0xDD81, 0x8F26, 0xDD82, 0x8F27, 0xDD83, 0x8F28, 0xDD84, 0x8F29, 0xDD85, 0x8F2A, 0xDD86, + 0x8F2B, 0xDD87, 0x8F2C, 0xDD88, 0x8F2D, 0xDD89, 0x8F2E, 0xDD8A, 0x8F2F, 0xDD8B, 0x8F30, 0xDD8C, 0x8F31, 0xDD8D, 0x8F32, 0xDD8E, + 0x8F33, 0xDD8F, 0x8F34, 0xDD90, 0x8F35, 0xDD91, 0x8F36, 0xDD92, 0x8F37, 0xDD93, 0x8F38, 0xDD94, 0x8F39, 0xDD95, 0x8F3A, 0xDD96, + 0x8F3B, 0xDD97, 0x8F3C, 0xDD98, 0x8F3D, 0xDD99, 0x8F3E, 0xDD9A, 0x8F3F, 0xDD9B, 0x8F40, 0xDD9C, 0x8F41, 0xDD9D, 0x8F42, 0xDD9E, + 0x8F43, 0xDD9F, 0x8F44, 0xDDA0, 0x8F45, 0xDE40, 0x8F46, 0xDE41, 0x8F47, 0xDE42, 0x8F48, 0xDE43, 0x8F49, 0xDE44, 0x8F4A, 0xDE45, + 0x8F4B, 0xDE46, 0x8F4C, 0xDE47, 0x8F4D, 0xDE48, 0x8F4E, 0xDE49, 0x8F4F, 0xDE4A, 0x8F50, 0xDE4B, 0x8F51, 0xDE4C, 0x8F52, 0xDE4D, + 0x8F53, 0xDE4E, 0x8F54, 0xDE4F, 0x8F55, 0xDE50, 0x8F56, 0xDE51, 0x8F57, 0xDE52, 0x8F58, 0xDE53, 0x8F59, 0xDE54, 0x8F5A, 0xDE55, + 0x8F5B, 0xDE56, 0x8F5C, 0xDE57, 0x8F5D, 0xDE58, 0x8F5E, 0xDE59, 0x8F5F, 0xDE5A, 0x8F60, 0xDE5B, 0x8F61, 0xDE5C, 0x8F62, 0xDE5D, + 0x8F63, 0xDE5E, 0x8F64, 0xDE5F, 0x8F65, 0xDE60, 0x8F66, 0xB3B5, 0x8F67, 0xD4FE, 0x8F68, 0xB9EC, 0x8F69, 0xD0F9, 0x8F6A, 0xDE61, + 0x8F6B, 0xE9ED, 0x8F6C, 0xD7AA, 0x8F6D, 0xE9EE, 0x8F6E, 0xC2D6, 0x8F6F, 0xC8ED, 0x8F70, 0xBAE4, 0x8F71, 0xE9EF, 0x8F72, 0xE9F0, + 0x8F73, 0xE9F1, 0x8F74, 0xD6E1, 0x8F75, 0xE9F2, 0x8F76, 0xE9F3, 0x8F77, 0xE9F5, 0x8F78, 0xE9F4, 0x8F79, 0xE9F6, 0x8F7A, 0xE9F7, + 0x8F7B, 0xC7E1, 0x8F7C, 0xE9F8, 0x8F7D, 0xD4D8, 0x8F7E, 0xE9F9, 0x8F7F, 0xBDCE, 0x8F80, 0xDE62, 0x8F81, 0xE9FA, 0x8F82, 0xE9FB, + 0x8F83, 0xBDCF, 0x8F84, 0xE9FC, 0x8F85, 0xB8A8, 0x8F86, 0xC1BE, 0x8F87, 0xE9FD, 0x8F88, 0xB1B2, 0x8F89, 0xBBD4, 0x8F8A, 0xB9F5, + 0x8F8B, 0xE9FE, 0x8F8C, 0xDE63, 0x8F8D, 0xEAA1, 0x8F8E, 0xEAA2, 0x8F8F, 0xEAA3, 0x8F90, 0xB7F8, 0x8F91, 0xBCAD, 0x8F92, 0xDE64, + 0x8F93, 0xCAE4, 0x8F94, 0xE0CE, 0x8F95, 0xD4AF, 0x8F96, 0xCFBD, 0x8F97, 0xD5B7, 0x8F98, 0xEAA4, 0x8F99, 0xD5DE, 0x8F9A, 0xEAA5, + 0x8F9B, 0xD0C1, 0x8F9C, 0xB9BC, 0x8F9D, 0xDE65, 0x8F9E, 0xB4C7, 0x8F9F, 0xB1D9, 0x8FA0, 0xDE66, 0x8FA1, 0xDE67, 0x8FA2, 0xDE68, + 0x8FA3, 0xC0B1, 0x8FA4, 0xDE69, 0x8FA5, 0xDE6A, 0x8FA6, 0xDE6B, 0x8FA7, 0xDE6C, 0x8FA8, 0xB1E6, 0x8FA9, 0xB1E7, 0x8FAA, 0xDE6D, + 0x8FAB, 0xB1E8, 0x8FAC, 0xDE6E, 0x8FAD, 0xDE6F, 0x8FAE, 0xDE70, 0x8FAF, 0xDE71, 0x8FB0, 0xB3BD, 0x8FB1, 0xC8E8, 0x8FB2, 0xDE72, + 0x8FB3, 0xDE73, 0x8FB4, 0xDE74, 0x8FB5, 0xDE75, 0x8FB6, 0xE5C1, 0x8FB7, 0xDE76, 0x8FB8, 0xDE77, 0x8FB9, 0xB1DF, 0x8FBA, 0xDE78, + 0x8FBB, 0xDE79, 0x8FBC, 0xDE7A, 0x8FBD, 0xC1C9, 0x8FBE, 0xB4EF, 0x8FBF, 0xDE7B, 0x8FC0, 0xDE7C, 0x8FC1, 0xC7A8, 0x8FC2, 0xD3D8, + 0x8FC3, 0xDE7D, 0x8FC4, 0xC6F9, 0x8FC5, 0xD1B8, 0x8FC6, 0xDE7E, 0x8FC7, 0xB9FD, 0x8FC8, 0xC2F5, 0x8FC9, 0xDE80, 0x8FCA, 0xDE81, + 0x8FCB, 0xDE82, 0x8FCC, 0xDE83, 0x8FCD, 0xDE84, 0x8FCE, 0xD3AD, 0x8FCF, 0xDE85, 0x8FD0, 0xD4CB, 0x8FD1, 0xBDFC, 0x8FD2, 0xDE86, + 0x8FD3, 0xE5C2, 0x8FD4, 0xB7B5, 0x8FD5, 0xE5C3, 0x8FD6, 0xDE87, 0x8FD7, 0xDE88, 0x8FD8, 0xBBB9, 0x8FD9, 0xD5E2, 0x8FDA, 0xDE89, + 0x8FDB, 0xBDF8, 0x8FDC, 0xD4B6, 0x8FDD, 0xCEA5, 0x8FDE, 0xC1AC, 0x8FDF, 0xB3D9, 0x8FE0, 0xDE8A, 0x8FE1, 0xDE8B, 0x8FE2, 0xCCF6, + 0x8FE3, 0xDE8C, 0x8FE4, 0xE5C6, 0x8FE5, 0xE5C4, 0x8FE6, 0xE5C8, 0x8FE7, 0xDE8D, 0x8FE8, 0xE5CA, 0x8FE9, 0xE5C7, 0x8FEA, 0xB5CF, + 0x8FEB, 0xC6C8, 0x8FEC, 0xDE8E, 0x8FED, 0xB5FC, 0x8FEE, 0xE5C5, 0x8FEF, 0xDE8F, 0x8FF0, 0xCAF6, 0x8FF1, 0xDE90, 0x8FF2, 0xDE91, + 0x8FF3, 0xE5C9, 0x8FF4, 0xDE92, 0x8FF5, 0xDE93, 0x8FF6, 0xDE94, 0x8FF7, 0xC3D4, 0x8FF8, 0xB1C5, 0x8FF9, 0xBCA3, 0x8FFA, 0xDE95, + 0x8FFB, 0xDE96, 0x8FFC, 0xDE97, 0x8FFD, 0xD7B7, 0x8FFE, 0xDE98, 0x8FFF, 0xDE99, 0x9000, 0xCDCB, 0x9001, 0xCBCD, 0x9002, 0xCACA, + 0x9003, 0xCCD3, 0x9004, 0xE5CC, 0x9005, 0xE5CB, 0x9006, 0xC4E6, 0x9007, 0xDE9A, 0x9008, 0xDE9B, 0x9009, 0xD1A1, 0x900A, 0xD1B7, + 0x900B, 0xE5CD, 0x900C, 0xDE9C, 0x900D, 0xE5D0, 0x900E, 0xDE9D, 0x900F, 0xCDB8, 0x9010, 0xD6F0, 0x9011, 0xE5CF, 0x9012, 0xB5DD, + 0x9013, 0xDE9E, 0x9014, 0xCDBE, 0x9015, 0xDE9F, 0x9016, 0xE5D1, 0x9017, 0xB6BA, 0x9018, 0xDEA0, 0x9019, 0xDF40, 0x901A, 0xCDA8, + 0x901B, 0xB9E4, 0x901C, 0xDF41, 0x901D, 0xCAC5, 0x901E, 0xB3D1, 0x901F, 0xCBD9, 0x9020, 0xD4EC, 0x9021, 0xE5D2, 0x9022, 0xB7EA, + 0x9023, 0xDF42, 0x9024, 0xDF43, 0x9025, 0xDF44, 0x9026, 0xE5CE, 0x9027, 0xDF45, 0x9028, 0xDF46, 0x9029, 0xDF47, 0x902A, 0xDF48, + 0x902B, 0xDF49, 0x902C, 0xDF4A, 0x902D, 0xE5D5, 0x902E, 0xB4FE, 0x902F, 0xE5D6, 0x9030, 0xDF4B, 0x9031, 0xDF4C, 0x9032, 0xDF4D, + 0x9033, 0xDF4E, 0x9034, 0xDF4F, 0x9035, 0xE5D3, 0x9036, 0xE5D4, 0x9037, 0xDF50, 0x9038, 0xD2DD, 0x9039, 0xDF51, 0x903A, 0xDF52, + 0x903B, 0xC2DF, 0x903C, 0xB1C6, 0x903D, 0xDF53, 0x903E, 0xD3E2, 0x903F, 0xDF54, 0x9040, 0xDF55, 0x9041, 0xB6DD, 0x9042, 0xCBEC, + 0x9043, 0xDF56, 0x9044, 0xE5D7, 0x9045, 0xDF57, 0x9046, 0xDF58, 0x9047, 0xD3F6, 0x9048, 0xDF59, 0x9049, 0xDF5A, 0x904A, 0xDF5B, + 0x904B, 0xDF5C, 0x904C, 0xDF5D, 0x904D, 0xB1E9, 0x904E, 0xDF5E, 0x904F, 0xB6F4, 0x9050, 0xE5DA, 0x9051, 0xE5D8, 0x9052, 0xE5D9, + 0x9053, 0xB5C0, 0x9054, 0xDF5F, 0x9055, 0xDF60, 0x9056, 0xDF61, 0x9057, 0xD2C5, 0x9058, 0xE5DC, 0x9059, 0xDF62, 0x905A, 0xDF63, + 0x905B, 0xE5DE, 0x905C, 0xDF64, 0x905D, 0xDF65, 0x905E, 0xDF66, 0x905F, 0xDF67, 0x9060, 0xDF68, 0x9061, 0xDF69, 0x9062, 0xE5DD, + 0x9063, 0xC7B2, 0x9064, 0xDF6A, 0x9065, 0xD2A3, 0x9066, 0xDF6B, 0x9067, 0xDF6C, 0x9068, 0xE5DB, 0x9069, 0xDF6D, 0x906A, 0xDF6E, + 0x906B, 0xDF6F, 0x906C, 0xDF70, 0x906D, 0xD4E2, 0x906E, 0xD5DA, 0x906F, 0xDF71, 0x9070, 0xDF72, 0x9071, 0xDF73, 0x9072, 0xDF74, + 0x9073, 0xDF75, 0x9074, 0xE5E0, 0x9075, 0xD7F1, 0x9076, 0xDF76, 0x9077, 0xDF77, 0x9078, 0xDF78, 0x9079, 0xDF79, 0x907A, 0xDF7A, + 0x907B, 0xDF7B, 0x907C, 0xDF7C, 0x907D, 0xE5E1, 0x907E, 0xDF7D, 0x907F, 0xB1DC, 0x9080, 0xD1FB, 0x9081, 0xDF7E, 0x9082, 0xE5E2, + 0x9083, 0xE5E4, 0x9084, 0xDF80, 0x9085, 0xDF81, 0x9086, 0xDF82, 0x9087, 0xDF83, 0x9088, 0xE5E3, 0x9089, 0xDF84, 0x908A, 0xDF85, + 0x908B, 0xE5E5, 0x908C, 0xDF86, 0x908D, 0xDF87, 0x908E, 0xDF88, 0x908F, 0xDF89, 0x9090, 0xDF8A, 0x9091, 0xD2D8, 0x9092, 0xDF8B, + 0x9093, 0xB5CB, 0x9094, 0xDF8C, 0x9095, 0xE7DF, 0x9096, 0xDF8D, 0x9097, 0xDAF5, 0x9098, 0xDF8E, 0x9099, 0xDAF8, 0x909A, 0xDF8F, + 0x909B, 0xDAF6, 0x909C, 0xDF90, 0x909D, 0xDAF7, 0x909E, 0xDF91, 0x909F, 0xDF92, 0x90A0, 0xDF93, 0x90A1, 0xDAFA, 0x90A2, 0xD0CF, + 0x90A3, 0xC4C7, 0x90A4, 0xDF94, 0x90A5, 0xDF95, 0x90A6, 0xB0EE, 0x90A7, 0xDF96, 0x90A8, 0xDF97, 0x90A9, 0xDF98, 0x90AA, 0xD0B0, + 0x90AB, 0xDF99, 0x90AC, 0xDAF9, 0x90AD, 0xDF9A, 0x90AE, 0xD3CA, 0x90AF, 0xBAAA, 0x90B0, 0xDBA2, 0x90B1, 0xC7F1, 0x90B2, 0xDF9B, + 0x90B3, 0xDAFC, 0x90B4, 0xDAFB, 0x90B5, 0xC9DB, 0x90B6, 0xDAFD, 0x90B7, 0xDF9C, 0x90B8, 0xDBA1, 0x90B9, 0xD7DE, 0x90BA, 0xDAFE, + 0x90BB, 0xC1DA, 0x90BC, 0xDF9D, 0x90BD, 0xDF9E, 0x90BE, 0xDBA5, 0x90BF, 0xDF9F, 0x90C0, 0xDFA0, 0x90C1, 0xD3F4, 0x90C2, 0xE040, + 0x90C3, 0xE041, 0x90C4, 0xDBA7, 0x90C5, 0xDBA4, 0x90C6, 0xE042, 0x90C7, 0xDBA8, 0x90C8, 0xE043, 0x90C9, 0xE044, 0x90CA, 0xBDBC, + 0x90CB, 0xE045, 0x90CC, 0xE046, 0x90CD, 0xE047, 0x90CE, 0xC0C9, 0x90CF, 0xDBA3, 0x90D0, 0xDBA6, 0x90D1, 0xD6A3, 0x90D2, 0xE048, + 0x90D3, 0xDBA9, 0x90D4, 0xE049, 0x90D5, 0xE04A, 0x90D6, 0xE04B, 0x90D7, 0xDBAD, 0x90D8, 0xE04C, 0x90D9, 0xE04D, 0x90DA, 0xE04E, + 0x90DB, 0xDBAE, 0x90DC, 0xDBAC, 0x90DD, 0xBAC2, 0x90DE, 0xE04F, 0x90DF, 0xE050, 0x90E0, 0xE051, 0x90E1, 0xBFA4, 0x90E2, 0xDBAB, + 0x90E3, 0xE052, 0x90E4, 0xE053, 0x90E5, 0xE054, 0x90E6, 0xDBAA, 0x90E7, 0xD4C7, 0x90E8, 0xB2BF, 0x90E9, 0xE055, 0x90EA, 0xE056, + 0x90EB, 0xDBAF, 0x90EC, 0xE057, 0x90ED, 0xB9F9, 0x90EE, 0xE058, 0x90EF, 0xDBB0, 0x90F0, 0xE059, 0x90F1, 0xE05A, 0x90F2, 0xE05B, + 0x90F3, 0xE05C, 0x90F4, 0xB3BB, 0x90F5, 0xE05D, 0x90F6, 0xE05E, 0x90F7, 0xE05F, 0x90F8, 0xB5A6, 0x90F9, 0xE060, 0x90FA, 0xE061, + 0x90FB, 0xE062, 0x90FC, 0xE063, 0x90FD, 0xB6BC, 0x90FE, 0xDBB1, 0x90FF, 0xE064, 0x9100, 0xE065, 0x9101, 0xE066, 0x9102, 0xB6F5, + 0x9103, 0xE067, 0x9104, 0xDBB2, 0x9105, 0xE068, 0x9106, 0xE069, 0x9107, 0xE06A, 0x9108, 0xE06B, 0x9109, 0xE06C, 0x910A, 0xE06D, + 0x910B, 0xE06E, 0x910C, 0xE06F, 0x910D, 0xE070, 0x910E, 0xE071, 0x910F, 0xE072, 0x9110, 0xE073, 0x9111, 0xE074, 0x9112, 0xE075, + 0x9113, 0xE076, 0x9114, 0xE077, 0x9115, 0xE078, 0x9116, 0xE079, 0x9117, 0xE07A, 0x9118, 0xE07B, 0x9119, 0xB1C9, 0x911A, 0xE07C, + 0x911B, 0xE07D, 0x911C, 0xE07E, 0x911D, 0xE080, 0x911E, 0xDBB4, 0x911F, 0xE081, 0x9120, 0xE082, 0x9121, 0xE083, 0x9122, 0xDBB3, + 0x9123, 0xDBB5, 0x9124, 0xE084, 0x9125, 0xE085, 0x9126, 0xE086, 0x9127, 0xE087, 0x9128, 0xE088, 0x9129, 0xE089, 0x912A, 0xE08A, + 0x912B, 0xE08B, 0x912C, 0xE08C, 0x912D, 0xE08D, 0x912E, 0xE08E, 0x912F, 0xDBB7, 0x9130, 0xE08F, 0x9131, 0xDBB6, 0x9132, 0xE090, + 0x9133, 0xE091, 0x9134, 0xE092, 0x9135, 0xE093, 0x9136, 0xE094, 0x9137, 0xE095, 0x9138, 0xE096, 0x9139, 0xDBB8, 0x913A, 0xE097, + 0x913B, 0xE098, 0x913C, 0xE099, 0x913D, 0xE09A, 0x913E, 0xE09B, 0x913F, 0xE09C, 0x9140, 0xE09D, 0x9141, 0xE09E, 0x9142, 0xE09F, + 0x9143, 0xDBB9, 0x9144, 0xE0A0, 0x9145, 0xE140, 0x9146, 0xDBBA, 0x9147, 0xE141, 0x9148, 0xE142, 0x9149, 0xD3CF, 0x914A, 0xF4FA, + 0x914B, 0xC7F5, 0x914C, 0xD7C3, 0x914D, 0xC5E4, 0x914E, 0xF4FC, 0x914F, 0xF4FD, 0x9150, 0xF4FB, 0x9151, 0xE143, 0x9152, 0xBEC6, + 0x9153, 0xE144, 0x9154, 0xE145, 0x9155, 0xE146, 0x9156, 0xE147, 0x9157, 0xD0EF, 0x9158, 0xE148, 0x9159, 0xE149, 0x915A, 0xB7D3, + 0x915B, 0xE14A, 0x915C, 0xE14B, 0x915D, 0xD4CD, 0x915E, 0xCCAA, 0x915F, 0xE14C, 0x9160, 0xE14D, 0x9161, 0xF5A2, 0x9162, 0xF5A1, + 0x9163, 0xBAA8, 0x9164, 0xF4FE, 0x9165, 0xCBD6, 0x9166, 0xE14E, 0x9167, 0xE14F, 0x9168, 0xE150, 0x9169, 0xF5A4, 0x916A, 0xC0D2, + 0x916B, 0xE151, 0x916C, 0xB3EA, 0x916D, 0xE152, 0x916E, 0xCDAA, 0x916F, 0xF5A5, 0x9170, 0xF5A3, 0x9171, 0xBDB4, 0x9172, 0xF5A8, + 0x9173, 0xE153, 0x9174, 0xF5A9, 0x9175, 0xBDCD, 0x9176, 0xC3B8, 0x9177, 0xBFE1, 0x9178, 0xCBE1, 0x9179, 0xF5AA, 0x917A, 0xE154, + 0x917B, 0xE155, 0x917C, 0xE156, 0x917D, 0xF5A6, 0x917E, 0xF5A7, 0x917F, 0xC4F0, 0x9180, 0xE157, 0x9181, 0xE158, 0x9182, 0xE159, + 0x9183, 0xE15A, 0x9184, 0xE15B, 0x9185, 0xF5AC, 0x9186, 0xE15C, 0x9187, 0xB4BC, 0x9188, 0xE15D, 0x9189, 0xD7ED, 0x918A, 0xE15E, + 0x918B, 0xB4D7, 0x918C, 0xF5AB, 0x918D, 0xF5AE, 0x918E, 0xE15F, 0x918F, 0xE160, 0x9190, 0xF5AD, 0x9191, 0xF5AF, 0x9192, 0xD0D1, + 0x9193, 0xE161, 0x9194, 0xE162, 0x9195, 0xE163, 0x9196, 0xE164, 0x9197, 0xE165, 0x9198, 0xE166, 0x9199, 0xE167, 0x919A, 0xC3D1, + 0x919B, 0xC8A9, 0x919C, 0xE168, 0x919D, 0xE169, 0x919E, 0xE16A, 0x919F, 0xE16B, 0x91A0, 0xE16C, 0x91A1, 0xE16D, 0x91A2, 0xF5B0, + 0x91A3, 0xF5B1, 0x91A4, 0xE16E, 0x91A5, 0xE16F, 0x91A6, 0xE170, 0x91A7, 0xE171, 0x91A8, 0xE172, 0x91A9, 0xE173, 0x91AA, 0xF5B2, + 0x91AB, 0xE174, 0x91AC, 0xE175, 0x91AD, 0xF5B3, 0x91AE, 0xF5B4, 0x91AF, 0xF5B5, 0x91B0, 0xE176, 0x91B1, 0xE177, 0x91B2, 0xE178, + 0x91B3, 0xE179, 0x91B4, 0xF5B7, 0x91B5, 0xF5B6, 0x91B6, 0xE17A, 0x91B7, 0xE17B, 0x91B8, 0xE17C, 0x91B9, 0xE17D, 0x91BA, 0xF5B8, + 0x91BB, 0xE17E, 0x91BC, 0xE180, 0x91BD, 0xE181, 0x91BE, 0xE182, 0x91BF, 0xE183, 0x91C0, 0xE184, 0x91C1, 0xE185, 0x91C2, 0xE186, + 0x91C3, 0xE187, 0x91C4, 0xE188, 0x91C5, 0xE189, 0x91C6, 0xE18A, 0x91C7, 0xB2C9, 0x91C8, 0xE18B, 0x91C9, 0xD3D4, 0x91CA, 0xCACD, + 0x91CB, 0xE18C, 0x91CC, 0xC0EF, 0x91CD, 0xD6D8, 0x91CE, 0xD2B0, 0x91CF, 0xC1BF, 0x91D0, 0xE18D, 0x91D1, 0xBDF0, 0x91D2, 0xE18E, + 0x91D3, 0xE18F, 0x91D4, 0xE190, 0x91D5, 0xE191, 0x91D6, 0xE192, 0x91D7, 0xE193, 0x91D8, 0xE194, 0x91D9, 0xE195, 0x91DA, 0xE196, + 0x91DB, 0xE197, 0x91DC, 0xB8AA, 0x91DD, 0xE198, 0x91DE, 0xE199, 0x91DF, 0xE19A, 0x91E0, 0xE19B, 0x91E1, 0xE19C, 0x91E2, 0xE19D, + 0x91E3, 0xE19E, 0x91E4, 0xE19F, 0x91E5, 0xE1A0, 0x91E6, 0xE240, 0x91E7, 0xE241, 0x91E8, 0xE242, 0x91E9, 0xE243, 0x91EA, 0xE244, + 0x91EB, 0xE245, 0x91EC, 0xE246, 0x91ED, 0xE247, 0x91EE, 0xE248, 0x91EF, 0xE249, 0x91F0, 0xE24A, 0x91F1, 0xE24B, 0x91F2, 0xE24C, + 0x91F3, 0xE24D, 0x91F4, 0xE24E, 0x91F5, 0xE24F, 0x91F6, 0xE250, 0x91F7, 0xE251, 0x91F8, 0xE252, 0x91F9, 0xE253, 0x91FA, 0xE254, + 0x91FB, 0xE255, 0x91FC, 0xE256, 0x91FD, 0xE257, 0x91FE, 0xE258, 0x91FF, 0xE259, 0x9200, 0xE25A, 0x9201, 0xE25B, 0x9202, 0xE25C, + 0x9203, 0xE25D, 0x9204, 0xE25E, 0x9205, 0xE25F, 0x9206, 0xE260, 0x9207, 0xE261, 0x9208, 0xE262, 0x9209, 0xE263, 0x920A, 0xE264, + 0x920B, 0xE265, 0x920C, 0xE266, 0x920D, 0xE267, 0x920E, 0xE268, 0x920F, 0xE269, 0x9210, 0xE26A, 0x9211, 0xE26B, 0x9212, 0xE26C, + 0x9213, 0xE26D, 0x9214, 0xE26E, 0x9215, 0xE26F, 0x9216, 0xE270, 0x9217, 0xE271, 0x9218, 0xE272, 0x9219, 0xE273, 0x921A, 0xE274, + 0x921B, 0xE275, 0x921C, 0xE276, 0x921D, 0xE277, 0x921E, 0xE278, 0x921F, 0xE279, 0x9220, 0xE27A, 0x9221, 0xE27B, 0x9222, 0xE27C, + 0x9223, 0xE27D, 0x9224, 0xE27E, 0x9225, 0xE280, 0x9226, 0xE281, 0x9227, 0xE282, 0x9228, 0xE283, 0x9229, 0xE284, 0x922A, 0xE285, + 0x922B, 0xE286, 0x922C, 0xE287, 0x922D, 0xE288, 0x922E, 0xE289, 0x922F, 0xE28A, 0x9230, 0xE28B, 0x9231, 0xE28C, 0x9232, 0xE28D, + 0x9233, 0xE28E, 0x9234, 0xE28F, 0x9235, 0xE290, 0x9236, 0xE291, 0x9237, 0xE292, 0x9238, 0xE293, 0x9239, 0xE294, 0x923A, 0xE295, + 0x923B, 0xE296, 0x923C, 0xE297, 0x923D, 0xE298, 0x923E, 0xE299, 0x923F, 0xE29A, 0x9240, 0xE29B, 0x9241, 0xE29C, 0x9242, 0xE29D, + 0x9243, 0xE29E, 0x9244, 0xE29F, 0x9245, 0xE2A0, 0x9246, 0xE340, 0x9247, 0xE341, 0x9248, 0xE342, 0x9249, 0xE343, 0x924A, 0xE344, + 0x924B, 0xE345, 0x924C, 0xE346, 0x924D, 0xE347, 0x924E, 0xE348, 0x924F, 0xE349, 0x9250, 0xE34A, 0x9251, 0xE34B, 0x9252, 0xE34C, + 0x9253, 0xE34D, 0x9254, 0xE34E, 0x9255, 0xE34F, 0x9256, 0xE350, 0x9257, 0xE351, 0x9258, 0xE352, 0x9259, 0xE353, 0x925A, 0xE354, + 0x925B, 0xE355, 0x925C, 0xE356, 0x925D, 0xE357, 0x925E, 0xE358, 0x925F, 0xE359, 0x9260, 0xE35A, 0x9261, 0xE35B, 0x9262, 0xE35C, + 0x9263, 0xE35D, 0x9264, 0xE35E, 0x9265, 0xE35F, 0x9266, 0xE360, 0x9267, 0xE361, 0x9268, 0xE362, 0x9269, 0xE363, 0x926A, 0xE364, + 0x926B, 0xE365, 0x926C, 0xE366, 0x926D, 0xE367, 0x926E, 0xE368, 0x926F, 0xE369, 0x9270, 0xE36A, 0x9271, 0xE36B, 0x9272, 0xE36C, + 0x9273, 0xE36D, 0x9274, 0xBCF8, 0x9275, 0xE36E, 0x9276, 0xE36F, 0x9277, 0xE370, 0x9278, 0xE371, 0x9279, 0xE372, 0x927A, 0xE373, + 0x927B, 0xE374, 0x927C, 0xE375, 0x927D, 0xE376, 0x927E, 0xE377, 0x927F, 0xE378, 0x9280, 0xE379, 0x9281, 0xE37A, 0x9282, 0xE37B, + 0x9283, 0xE37C, 0x9284, 0xE37D, 0x9285, 0xE37E, 0x9286, 0xE380, 0x9287, 0xE381, 0x9288, 0xE382, 0x9289, 0xE383, 0x928A, 0xE384, + 0x928B, 0xE385, 0x928C, 0xE386, 0x928D, 0xE387, 0x928E, 0xF6C6, 0x928F, 0xE388, 0x9290, 0xE389, 0x9291, 0xE38A, 0x9292, 0xE38B, + 0x9293, 0xE38C, 0x9294, 0xE38D, 0x9295, 0xE38E, 0x9296, 0xE38F, 0x9297, 0xE390, 0x9298, 0xE391, 0x9299, 0xE392, 0x929A, 0xE393, + 0x929B, 0xE394, 0x929C, 0xE395, 0x929D, 0xE396, 0x929E, 0xE397, 0x929F, 0xE398, 0x92A0, 0xE399, 0x92A1, 0xE39A, 0x92A2, 0xE39B, + 0x92A3, 0xE39C, 0x92A4, 0xE39D, 0x92A5, 0xE39E, 0x92A6, 0xE39F, 0x92A7, 0xE3A0, 0x92A8, 0xE440, 0x92A9, 0xE441, 0x92AA, 0xE442, + 0x92AB, 0xE443, 0x92AC, 0xE444, 0x92AD, 0xE445, 0x92AE, 0xF6C7, 0x92AF, 0xE446, 0x92B0, 0xE447, 0x92B1, 0xE448, 0x92B2, 0xE449, + 0x92B3, 0xE44A, 0x92B4, 0xE44B, 0x92B5, 0xE44C, 0x92B6, 0xE44D, 0x92B7, 0xE44E, 0x92B8, 0xE44F, 0x92B9, 0xE450, 0x92BA, 0xE451, + 0x92BB, 0xE452, 0x92BC, 0xE453, 0x92BD, 0xE454, 0x92BE, 0xE455, 0x92BF, 0xE456, 0x92C0, 0xE457, 0x92C1, 0xE458, 0x92C2, 0xE459, + 0x92C3, 0xE45A, 0x92C4, 0xE45B, 0x92C5, 0xE45C, 0x92C6, 0xE45D, 0x92C7, 0xE45E, 0x92C8, 0xF6C8, 0x92C9, 0xE45F, 0x92CA, 0xE460, + 0x92CB, 0xE461, 0x92CC, 0xE462, 0x92CD, 0xE463, 0x92CE, 0xE464, 0x92CF, 0xE465, 0x92D0, 0xE466, 0x92D1, 0xE467, 0x92D2, 0xE468, + 0x92D3, 0xE469, 0x92D4, 0xE46A, 0x92D5, 0xE46B, 0x92D6, 0xE46C, 0x92D7, 0xE46D, 0x92D8, 0xE46E, 0x92D9, 0xE46F, 0x92DA, 0xE470, + 0x92DB, 0xE471, 0x92DC, 0xE472, 0x92DD, 0xE473, 0x92DE, 0xE474, 0x92DF, 0xE475, 0x92E0, 0xE476, 0x92E1, 0xE477, 0x92E2, 0xE478, + 0x92E3, 0xE479, 0x92E4, 0xE47A, 0x92E5, 0xE47B, 0x92E6, 0xE47C, 0x92E7, 0xE47D, 0x92E8, 0xE47E, 0x92E9, 0xE480, 0x92EA, 0xE481, + 0x92EB, 0xE482, 0x92EC, 0xE483, 0x92ED, 0xE484, 0x92EE, 0xE485, 0x92EF, 0xE486, 0x92F0, 0xE487, 0x92F1, 0xE488, 0x92F2, 0xE489, + 0x92F3, 0xE48A, 0x92F4, 0xE48B, 0x92F5, 0xE48C, 0x92F6, 0xE48D, 0x92F7, 0xE48E, 0x92F8, 0xE48F, 0x92F9, 0xE490, 0x92FA, 0xE491, + 0x92FB, 0xE492, 0x92FC, 0xE493, 0x92FD, 0xE494, 0x92FE, 0xE495, 0x92FF, 0xE496, 0x9300, 0xE497, 0x9301, 0xE498, 0x9302, 0xE499, + 0x9303, 0xE49A, 0x9304, 0xE49B, 0x9305, 0xE49C, 0x9306, 0xE49D, 0x9307, 0xE49E, 0x9308, 0xE49F, 0x9309, 0xE4A0, 0x930A, 0xE540, + 0x930B, 0xE541, 0x930C, 0xE542, 0x930D, 0xE543, 0x930E, 0xE544, 0x930F, 0xE545, 0x9310, 0xE546, 0x9311, 0xE547, 0x9312, 0xE548, + 0x9313, 0xE549, 0x9314, 0xE54A, 0x9315, 0xE54B, 0x9316, 0xE54C, 0x9317, 0xE54D, 0x9318, 0xE54E, 0x9319, 0xE54F, 0x931A, 0xE550, + 0x931B, 0xE551, 0x931C, 0xE552, 0x931D, 0xE553, 0x931E, 0xE554, 0x931F, 0xE555, 0x9320, 0xE556, 0x9321, 0xE557, 0x9322, 0xE558, + 0x9323, 0xE559, 0x9324, 0xE55A, 0x9325, 0xE55B, 0x9326, 0xE55C, 0x9327, 0xE55D, 0x9328, 0xE55E, 0x9329, 0xE55F, 0x932A, 0xE560, + 0x932B, 0xE561, 0x932C, 0xE562, 0x932D, 0xE563, 0x932E, 0xE564, 0x932F, 0xE565, 0x9330, 0xE566, 0x9331, 0xE567, 0x9332, 0xE568, + 0x9333, 0xE569, 0x9334, 0xE56A, 0x9335, 0xE56B, 0x9336, 0xE56C, 0x9337, 0xE56D, 0x9338, 0xE56E, 0x9339, 0xE56F, 0x933A, 0xE570, + 0x933B, 0xE571, 0x933C, 0xE572, 0x933D, 0xE573, 0x933E, 0xF6C9, 0x933F, 0xE574, 0x9340, 0xE575, 0x9341, 0xE576, 0x9342, 0xE577, + 0x9343, 0xE578, 0x9344, 0xE579, 0x9345, 0xE57A, 0x9346, 0xE57B, 0x9347, 0xE57C, 0x9348, 0xE57D, 0x9349, 0xE57E, 0x934A, 0xE580, + 0x934B, 0xE581, 0x934C, 0xE582, 0x934D, 0xE583, 0x934E, 0xE584, 0x934F, 0xE585, 0x9350, 0xE586, 0x9351, 0xE587, 0x9352, 0xE588, + 0x9353, 0xE589, 0x9354, 0xE58A, 0x9355, 0xE58B, 0x9356, 0xE58C, 0x9357, 0xE58D, 0x9358, 0xE58E, 0x9359, 0xE58F, 0x935A, 0xE590, + 0x935B, 0xE591, 0x935C, 0xE592, 0x935D, 0xE593, 0x935E, 0xE594, 0x935F, 0xE595, 0x9360, 0xE596, 0x9361, 0xE597, 0x9362, 0xE598, + 0x9363, 0xE599, 0x9364, 0xE59A, 0x9365, 0xE59B, 0x9366, 0xE59C, 0x9367, 0xE59D, 0x9368, 0xE59E, 0x9369, 0xE59F, 0x936A, 0xF6CA, + 0x936B, 0xE5A0, 0x936C, 0xE640, 0x936D, 0xE641, 0x936E, 0xE642, 0x936F, 0xE643, 0x9370, 0xE644, 0x9371, 0xE645, 0x9372, 0xE646, + 0x9373, 0xE647, 0x9374, 0xE648, 0x9375, 0xE649, 0x9376, 0xE64A, 0x9377, 0xE64B, 0x9378, 0xE64C, 0x9379, 0xE64D, 0x937A, 0xE64E, + 0x937B, 0xE64F, 0x937C, 0xE650, 0x937D, 0xE651, 0x937E, 0xE652, 0x937F, 0xE653, 0x9380, 0xE654, 0x9381, 0xE655, 0x9382, 0xE656, + 0x9383, 0xE657, 0x9384, 0xE658, 0x9385, 0xE659, 0x9386, 0xE65A, 0x9387, 0xE65B, 0x9388, 0xE65C, 0x9389, 0xE65D, 0x938A, 0xE65E, + 0x938B, 0xE65F, 0x938C, 0xE660, 0x938D, 0xE661, 0x938E, 0xE662, 0x938F, 0xF6CC, 0x9390, 0xE663, 0x9391, 0xE664, 0x9392, 0xE665, + 0x9393, 0xE666, 0x9394, 0xE667, 0x9395, 0xE668, 0x9396, 0xE669, 0x9397, 0xE66A, 0x9398, 0xE66B, 0x9399, 0xE66C, 0x939A, 0xE66D, + 0x939B, 0xE66E, 0x939C, 0xE66F, 0x939D, 0xE670, 0x939E, 0xE671, 0x939F, 0xE672, 0x93A0, 0xE673, 0x93A1, 0xE674, 0x93A2, 0xE675, + 0x93A3, 0xE676, 0x93A4, 0xE677, 0x93A5, 0xE678, 0x93A6, 0xE679, 0x93A7, 0xE67A, 0x93A8, 0xE67B, 0x93A9, 0xE67C, 0x93AA, 0xE67D, + 0x93AB, 0xE67E, 0x93AC, 0xE680, 0x93AD, 0xE681, 0x93AE, 0xE682, 0x93AF, 0xE683, 0x93B0, 0xE684, 0x93B1, 0xE685, 0x93B2, 0xE686, + 0x93B3, 0xE687, 0x93B4, 0xE688, 0x93B5, 0xE689, 0x93B6, 0xE68A, 0x93B7, 0xE68B, 0x93B8, 0xE68C, 0x93B9, 0xE68D, 0x93BA, 0xE68E, + 0x93BB, 0xE68F, 0x93BC, 0xE690, 0x93BD, 0xE691, 0x93BE, 0xE692, 0x93BF, 0xE693, 0x93C0, 0xE694, 0x93C1, 0xE695, 0x93C2, 0xE696, + 0x93C3, 0xE697, 0x93C4, 0xE698, 0x93C5, 0xE699, 0x93C6, 0xE69A, 0x93C7, 0xE69B, 0x93C8, 0xE69C, 0x93C9, 0xE69D, 0x93CA, 0xF6CB, + 0x93CB, 0xE69E, 0x93CC, 0xE69F, 0x93CD, 0xE6A0, 0x93CE, 0xE740, 0x93CF, 0xE741, 0x93D0, 0xE742, 0x93D1, 0xE743, 0x93D2, 0xE744, + 0x93D3, 0xE745, 0x93D4, 0xE746, 0x93D5, 0xE747, 0x93D6, 0xF7E9, 0x93D7, 0xE748, 0x93D8, 0xE749, 0x93D9, 0xE74A, 0x93DA, 0xE74B, + 0x93DB, 0xE74C, 0x93DC, 0xE74D, 0x93DD, 0xE74E, 0x93DE, 0xE74F, 0x93DF, 0xE750, 0x93E0, 0xE751, 0x93E1, 0xE752, 0x93E2, 0xE753, + 0x93E3, 0xE754, 0x93E4, 0xE755, 0x93E5, 0xE756, 0x93E6, 0xE757, 0x93E7, 0xE758, 0x93E8, 0xE759, 0x93E9, 0xE75A, 0x93EA, 0xE75B, + 0x93EB, 0xE75C, 0x93EC, 0xE75D, 0x93ED, 0xE75E, 0x93EE, 0xE75F, 0x93EF, 0xE760, 0x93F0, 0xE761, 0x93F1, 0xE762, 0x93F2, 0xE763, + 0x93F3, 0xE764, 0x93F4, 0xE765, 0x93F5, 0xE766, 0x93F6, 0xE767, 0x93F7, 0xE768, 0x93F8, 0xE769, 0x93F9, 0xE76A, 0x93FA, 0xE76B, + 0x93FB, 0xE76C, 0x93FC, 0xE76D, 0x93FD, 0xE76E, 0x93FE, 0xE76F, 0x93FF, 0xE770, 0x9400, 0xE771, 0x9401, 0xE772, 0x9402, 0xE773, + 0x9403, 0xE774, 0x9404, 0xE775, 0x9405, 0xE776, 0x9406, 0xE777, 0x9407, 0xE778, 0x9408, 0xE779, 0x9409, 0xE77A, 0x940A, 0xE77B, + 0x940B, 0xE77C, 0x940C, 0xE77D, 0x940D, 0xE77E, 0x940E, 0xE780, 0x940F, 0xE781, 0x9410, 0xE782, 0x9411, 0xE783, 0x9412, 0xE784, + 0x9413, 0xE785, 0x9414, 0xE786, 0x9415, 0xE787, 0x9416, 0xE788, 0x9417, 0xE789, 0x9418, 0xE78A, 0x9419, 0xE78B, 0x941A, 0xE78C, + 0x941B, 0xE78D, 0x941C, 0xE78E, 0x941D, 0xE78F, 0x941E, 0xE790, 0x941F, 0xE791, 0x9420, 0xE792, 0x9421, 0xE793, 0x9422, 0xE794, + 0x9423, 0xE795, 0x9424, 0xE796, 0x9425, 0xE797, 0x9426, 0xE798, 0x9427, 0xE799, 0x9428, 0xE79A, 0x9429, 0xE79B, 0x942A, 0xE79C, + 0x942B, 0xE79D, 0x942C, 0xE79E, 0x942D, 0xE79F, 0x942E, 0xE7A0, 0x942F, 0xE840, 0x9430, 0xE841, 0x9431, 0xE842, 0x9432, 0xE843, + 0x9433, 0xE844, 0x9434, 0xE845, 0x9435, 0xE846, 0x9436, 0xE847, 0x9437, 0xE848, 0x9438, 0xE849, 0x9439, 0xE84A, 0x943A, 0xE84B, + 0x943B, 0xE84C, 0x943C, 0xE84D, 0x943D, 0xE84E, 0x943E, 0xF6CD, 0x943F, 0xE84F, 0x9440, 0xE850, 0x9441, 0xE851, 0x9442, 0xE852, + 0x9443, 0xE853, 0x9444, 0xE854, 0x9445, 0xE855, 0x9446, 0xE856, 0x9447, 0xE857, 0x9448, 0xE858, 0x9449, 0xE859, 0x944A, 0xE85A, + 0x944B, 0xE85B, 0x944C, 0xE85C, 0x944D, 0xE85D, 0x944E, 0xE85E, 0x944F, 0xE85F, 0x9450, 0xE860, 0x9451, 0xE861, 0x9452, 0xE862, + 0x9453, 0xE863, 0x9454, 0xE864, 0x9455, 0xE865, 0x9456, 0xE866, 0x9457, 0xE867, 0x9458, 0xE868, 0x9459, 0xE869, 0x945A, 0xE86A, + 0x945B, 0xE86B, 0x945C, 0xE86C, 0x945D, 0xE86D, 0x945E, 0xE86E, 0x945F, 0xE86F, 0x9460, 0xE870, 0x9461, 0xE871, 0x9462, 0xE872, + 0x9463, 0xE873, 0x9464, 0xE874, 0x9465, 0xE875, 0x9466, 0xE876, 0x9467, 0xE877, 0x9468, 0xE878, 0x9469, 0xE879, 0x946A, 0xE87A, + 0x946B, 0xF6CE, 0x946C, 0xE87B, 0x946D, 0xE87C, 0x946E, 0xE87D, 0x946F, 0xE87E, 0x9470, 0xE880, 0x9471, 0xE881, 0x9472, 0xE882, + 0x9473, 0xE883, 0x9474, 0xE884, 0x9475, 0xE885, 0x9476, 0xE886, 0x9477, 0xE887, 0x9478, 0xE888, 0x9479, 0xE889, 0x947A, 0xE88A, + 0x947B, 0xE88B, 0x947C, 0xE88C, 0x947D, 0xE88D, 0x947E, 0xE88E, 0x947F, 0xE88F, 0x9480, 0xE890, 0x9481, 0xE891, 0x9482, 0xE892, + 0x9483, 0xE893, 0x9484, 0xE894, 0x9485, 0xEEC4, 0x9486, 0xEEC5, 0x9487, 0xEEC6, 0x9488, 0xD5EB, 0x9489, 0xB6A4, 0x948A, 0xEEC8, + 0x948B, 0xEEC7, 0x948C, 0xEEC9, 0x948D, 0xEECA, 0x948E, 0xC7A5, 0x948F, 0xEECB, 0x9490, 0xEECC, 0x9491, 0xE895, 0x9492, 0xB7B0, + 0x9493, 0xB5F6, 0x9494, 0xEECD, 0x9495, 0xEECF, 0x9496, 0xE896, 0x9497, 0xEECE, 0x9498, 0xE897, 0x9499, 0xB8C6, 0x949A, 0xEED0, + 0x949B, 0xEED1, 0x949C, 0xEED2, 0x949D, 0xB6DB, 0x949E, 0xB3AE, 0x949F, 0xD6D3, 0x94A0, 0xC4C6, 0x94A1, 0xB1B5, 0x94A2, 0xB8D6, + 0x94A3, 0xEED3, 0x94A4, 0xEED4, 0x94A5, 0xD4BF, 0x94A6, 0xC7D5, 0x94A7, 0xBEFB, 0x94A8, 0xCED9, 0x94A9, 0xB9B3, 0x94AA, 0xEED6, + 0x94AB, 0xEED5, 0x94AC, 0xEED8, 0x94AD, 0xEED7, 0x94AE, 0xC5A5, 0x94AF, 0xEED9, 0x94B0, 0xEEDA, 0x94B1, 0xC7AE, 0x94B2, 0xEEDB, + 0x94B3, 0xC7AF, 0x94B4, 0xEEDC, 0x94B5, 0xB2A7, 0x94B6, 0xEEDD, 0x94B7, 0xEEDE, 0x94B8, 0xEEDF, 0x94B9, 0xEEE0, 0x94BA, 0xEEE1, + 0x94BB, 0xD7EA, 0x94BC, 0xEEE2, 0x94BD, 0xEEE3, 0x94BE, 0xBCD8, 0x94BF, 0xEEE4, 0x94C0, 0xD3CB, 0x94C1, 0xCCFA, 0x94C2, 0xB2AC, + 0x94C3, 0xC1E5, 0x94C4, 0xEEE5, 0x94C5, 0xC7A6, 0x94C6, 0xC3AD, 0x94C7, 0xE898, 0x94C8, 0xEEE6, 0x94C9, 0xEEE7, 0x94CA, 0xEEE8, + 0x94CB, 0xEEE9, 0x94CC, 0xEEEA, 0x94CD, 0xEEEB, 0x94CE, 0xEEEC, 0x94CF, 0xE899, 0x94D0, 0xEEED, 0x94D1, 0xEEEE, 0x94D2, 0xEEEF, + 0x94D3, 0xE89A, 0x94D4, 0xE89B, 0x94D5, 0xEEF0, 0x94D6, 0xEEF1, 0x94D7, 0xEEF2, 0x94D8, 0xEEF4, 0x94D9, 0xEEF3, 0x94DA, 0xE89C, + 0x94DB, 0xEEF5, 0x94DC, 0xCDAD, 0x94DD, 0xC2C1, 0x94DE, 0xEEF6, 0x94DF, 0xEEF7, 0x94E0, 0xEEF8, 0x94E1, 0xD5A1, 0x94E2, 0xEEF9, + 0x94E3, 0xCFB3, 0x94E4, 0xEEFA, 0x94E5, 0xEEFB, 0x94E6, 0xE89D, 0x94E7, 0xEEFC, 0x94E8, 0xEEFD, 0x94E9, 0xEFA1, 0x94EA, 0xEEFE, + 0x94EB, 0xEFA2, 0x94EC, 0xB8F5, 0x94ED, 0xC3FA, 0x94EE, 0xEFA3, 0x94EF, 0xEFA4, 0x94F0, 0xBDC2, 0x94F1, 0xD2BF, 0x94F2, 0xB2F9, + 0x94F3, 0xEFA5, 0x94F4, 0xEFA6, 0x94F5, 0xEFA7, 0x94F6, 0xD2F8, 0x94F7, 0xEFA8, 0x94F8, 0xD6FD, 0x94F9, 0xEFA9, 0x94FA, 0xC6CC, + 0x94FB, 0xE89E, 0x94FC, 0xEFAA, 0x94FD, 0xEFAB, 0x94FE, 0xC1B4, 0x94FF, 0xEFAC, 0x9500, 0xCFFA, 0x9501, 0xCBF8, 0x9502, 0xEFAE, + 0x9503, 0xEFAD, 0x9504, 0xB3FA, 0x9505, 0xB9F8, 0x9506, 0xEFAF, 0x9507, 0xEFB0, 0x9508, 0xD0E2, 0x9509, 0xEFB1, 0x950A, 0xEFB2, + 0x950B, 0xB7E6, 0x950C, 0xD0BF, 0x950D, 0xEFB3, 0x950E, 0xEFB4, 0x950F, 0xEFB5, 0x9510, 0xC8F1, 0x9511, 0xCCE0, 0x9512, 0xEFB6, + 0x9513, 0xEFB7, 0x9514, 0xEFB8, 0x9515, 0xEFB9, 0x9516, 0xEFBA, 0x9517, 0xD5E0, 0x9518, 0xEFBB, 0x9519, 0xB4ED, 0x951A, 0xC3AA, + 0x951B, 0xEFBC, 0x951C, 0xE89F, 0x951D, 0xEFBD, 0x951E, 0xEFBE, 0x951F, 0xEFBF, 0x9520, 0xE8A0, 0x9521, 0xCEFD, 0x9522, 0xEFC0, + 0x9523, 0xC2E0, 0x9524, 0xB4B8, 0x9525, 0xD7B6, 0x9526, 0xBDF5, 0x9527, 0xE940, 0x9528, 0xCFC7, 0x9529, 0xEFC3, 0x952A, 0xEFC1, + 0x952B, 0xEFC2, 0x952C, 0xEFC4, 0x952D, 0xB6A7, 0x952E, 0xBCFC, 0x952F, 0xBEE2, 0x9530, 0xC3CC, 0x9531, 0xEFC5, 0x9532, 0xEFC6, + 0x9533, 0xE941, 0x9534, 0xEFC7, 0x9535, 0xEFCF, 0x9536, 0xEFC8, 0x9537, 0xEFC9, 0x9538, 0xEFCA, 0x9539, 0xC7C2, 0x953A, 0xEFF1, + 0x953B, 0xB6CD, 0x953C, 0xEFCB, 0x953D, 0xE942, 0x953E, 0xEFCC, 0x953F, 0xEFCD, 0x9540, 0xB6C6, 0x9541, 0xC3BE, 0x9542, 0xEFCE, + 0x9543, 0xE943, 0x9544, 0xEFD0, 0x9545, 0xEFD1, 0x9546, 0xEFD2, 0x9547, 0xD5F2, 0x9548, 0xE944, 0x9549, 0xEFD3, 0x954A, 0xC4F7, + 0x954B, 0xE945, 0x954C, 0xEFD4, 0x954D, 0xC4F8, 0x954E, 0xEFD5, 0x954F, 0xEFD6, 0x9550, 0xB8E4, 0x9551, 0xB0F7, 0x9552, 0xEFD7, + 0x9553, 0xEFD8, 0x9554, 0xEFD9, 0x9555, 0xE946, 0x9556, 0xEFDA, 0x9557, 0xEFDB, 0x9558, 0xEFDC, 0x9559, 0xEFDD, 0x955A, 0xE947, + 0x955B, 0xEFDE, 0x955C, 0xBEB5, 0x955D, 0xEFE1, 0x955E, 0xEFDF, 0x955F, 0xEFE0, 0x9560, 0xE948, 0x9561, 0xEFE2, 0x9562, 0xEFE3, + 0x9563, 0xC1CD, 0x9564, 0xEFE4, 0x9565, 0xEFE5, 0x9566, 0xEFE6, 0x9567, 0xEFE7, 0x9568, 0xEFE8, 0x9569, 0xEFE9, 0x956A, 0xEFEA, + 0x956B, 0xEFEB, 0x956C, 0xEFEC, 0x956D, 0xC0D8, 0x956E, 0xE949, 0x956F, 0xEFED, 0x9570, 0xC1AD, 0x9571, 0xEFEE, 0x9572, 0xEFEF, + 0x9573, 0xEFF0, 0x9574, 0xE94A, 0x9575, 0xE94B, 0x9576, 0xCFE2, 0x9577, 0xE94C, 0x9578, 0xE94D, 0x9579, 0xE94E, 0x957A, 0xE94F, + 0x957B, 0xE950, 0x957C, 0xE951, 0x957D, 0xE952, 0x957E, 0xE953, 0x957F, 0xB3A4, 0x9580, 0xE954, 0x9581, 0xE955, 0x9582, 0xE956, + 0x9583, 0xE957, 0x9584, 0xE958, 0x9585, 0xE959, 0x9586, 0xE95A, 0x9587, 0xE95B, 0x9588, 0xE95C, 0x9589, 0xE95D, 0x958A, 0xE95E, + 0x958B, 0xE95F, 0x958C, 0xE960, 0x958D, 0xE961, 0x958E, 0xE962, 0x958F, 0xE963, 0x9590, 0xE964, 0x9591, 0xE965, 0x9592, 0xE966, + 0x9593, 0xE967, 0x9594, 0xE968, 0x9595, 0xE969, 0x9596, 0xE96A, 0x9597, 0xE96B, 0x9598, 0xE96C, 0x9599, 0xE96D, 0x959A, 0xE96E, + 0x959B, 0xE96F, 0x959C, 0xE970, 0x959D, 0xE971, 0x959E, 0xE972, 0x959F, 0xE973, 0x95A0, 0xE974, 0x95A1, 0xE975, 0x95A2, 0xE976, + 0x95A3, 0xE977, 0x95A4, 0xE978, 0x95A5, 0xE979, 0x95A6, 0xE97A, 0x95A7, 0xE97B, 0x95A8, 0xE97C, 0x95A9, 0xE97D, 0x95AA, 0xE97E, + 0x95AB, 0xE980, 0x95AC, 0xE981, 0x95AD, 0xE982, 0x95AE, 0xE983, 0x95AF, 0xE984, 0x95B0, 0xE985, 0x95B1, 0xE986, 0x95B2, 0xE987, + 0x95B3, 0xE988, 0x95B4, 0xE989, 0x95B5, 0xE98A, 0x95B6, 0xE98B, 0x95B7, 0xE98C, 0x95B8, 0xE98D, 0x95B9, 0xE98E, 0x95BA, 0xE98F, + 0x95BB, 0xE990, 0x95BC, 0xE991, 0x95BD, 0xE992, 0x95BE, 0xE993, 0x95BF, 0xE994, 0x95C0, 0xE995, 0x95C1, 0xE996, 0x95C2, 0xE997, + 0x95C3, 0xE998, 0x95C4, 0xE999, 0x95C5, 0xE99A, 0x95C6, 0xE99B, 0x95C7, 0xE99C, 0x95C8, 0xE99D, 0x95C9, 0xE99E, 0x95CA, 0xE99F, + 0x95CB, 0xE9A0, 0x95CC, 0xEA40, 0x95CD, 0xEA41, 0x95CE, 0xEA42, 0x95CF, 0xEA43, 0x95D0, 0xEA44, 0x95D1, 0xEA45, 0x95D2, 0xEA46, + 0x95D3, 0xEA47, 0x95D4, 0xEA48, 0x95D5, 0xEA49, 0x95D6, 0xEA4A, 0x95D7, 0xEA4B, 0x95D8, 0xEA4C, 0x95D9, 0xEA4D, 0x95DA, 0xEA4E, + 0x95DB, 0xEA4F, 0x95DC, 0xEA50, 0x95DD, 0xEA51, 0x95DE, 0xEA52, 0x95DF, 0xEA53, 0x95E0, 0xEA54, 0x95E1, 0xEA55, 0x95E2, 0xEA56, + 0x95E3, 0xEA57, 0x95E4, 0xEA58, 0x95E5, 0xEA59, 0x95E6, 0xEA5A, 0x95E7, 0xEA5B, 0x95E8, 0xC3C5, 0x95E9, 0xE3C5, 0x95EA, 0xC9C1, + 0x95EB, 0xE3C6, 0x95EC, 0xEA5C, 0x95ED, 0xB1D5, 0x95EE, 0xCECA, 0x95EF, 0xB4B3, 0x95F0, 0xC8F2, 0x95F1, 0xE3C7, 0x95F2, 0xCFD0, + 0x95F3, 0xE3C8, 0x95F4, 0xBCE4, 0x95F5, 0xE3C9, 0x95F6, 0xE3CA, 0x95F7, 0xC3C6, 0x95F8, 0xD5A2, 0x95F9, 0xC4D6, 0x95FA, 0xB9EB, + 0x95FB, 0xCEC5, 0x95FC, 0xE3CB, 0x95FD, 0xC3F6, 0x95FE, 0xE3CC, 0x95FF, 0xEA5D, 0x9600, 0xB7A7, 0x9601, 0xB8F3, 0x9602, 0xBAD2, + 0x9603, 0xE3CD, 0x9604, 0xE3CE, 0x9605, 0xD4C4, 0x9606, 0xE3CF, 0x9607, 0xEA5E, 0x9608, 0xE3D0, 0x9609, 0xD1CB, 0x960A, 0xE3D1, + 0x960B, 0xE3D2, 0x960C, 0xE3D3, 0x960D, 0xE3D4, 0x960E, 0xD1D6, 0x960F, 0xE3D5, 0x9610, 0xB2FB, 0x9611, 0xC0BB, 0x9612, 0xE3D6, + 0x9613, 0xEA5F, 0x9614, 0xC0AB, 0x9615, 0xE3D7, 0x9616, 0xE3D8, 0x9617, 0xE3D9, 0x9618, 0xEA60, 0x9619, 0xE3DA, 0x961A, 0xE3DB, + 0x961B, 0xEA61, 0x961C, 0xB8B7, 0x961D, 0xDAE2, 0x961E, 0xEA62, 0x961F, 0xB6D3, 0x9620, 0xEA63, 0x9621, 0xDAE4, 0x9622, 0xDAE3, + 0x9623, 0xEA64, 0x9624, 0xEA65, 0x9625, 0xEA66, 0x9626, 0xEA67, 0x9627, 0xEA68, 0x9628, 0xEA69, 0x9629, 0xEA6A, 0x962A, 0xDAE6, + 0x962B, 0xEA6B, 0x962C, 0xEA6C, 0x962D, 0xEA6D, 0x962E, 0xC8EE, 0x962F, 0xEA6E, 0x9630, 0xEA6F, 0x9631, 0xDAE5, 0x9632, 0xB7C0, + 0x9633, 0xD1F4, 0x9634, 0xD2F5, 0x9635, 0xD5F3, 0x9636, 0xBDD7, 0x9637, 0xEA70, 0x9638, 0xEA71, 0x9639, 0xEA72, 0x963A, 0xEA73, + 0x963B, 0xD7E8, 0x963C, 0xDAE8, 0x963D, 0xDAE7, 0x963E, 0xEA74, 0x963F, 0xB0A2, 0x9640, 0xCDD3, 0x9641, 0xEA75, 0x9642, 0xDAE9, + 0x9643, 0xEA76, 0x9644, 0xB8BD, 0x9645, 0xBCCA, 0x9646, 0xC2BD, 0x9647, 0xC2A4, 0x9648, 0xB3C2, 0x9649, 0xDAEA, 0x964A, 0xEA77, + 0x964B, 0xC2AA, 0x964C, 0xC4B0, 0x964D, 0xBDB5, 0x964E, 0xEA78, 0x964F, 0xEA79, 0x9650, 0xCFDE, 0x9651, 0xEA7A, 0x9652, 0xEA7B, + 0x9653, 0xEA7C, 0x9654, 0xDAEB, 0x9655, 0xC9C2, 0x9656, 0xEA7D, 0x9657, 0xEA7E, 0x9658, 0xEA80, 0x9659, 0xEA81, 0x965A, 0xEA82, + 0x965B, 0xB1DD, 0x965C, 0xEA83, 0x965D, 0xEA84, 0x965E, 0xEA85, 0x965F, 0xDAEC, 0x9660, 0xEA86, 0x9661, 0xB6B8, 0x9662, 0xD4BA, + 0x9663, 0xEA87, 0x9664, 0xB3FD, 0x9665, 0xEA88, 0x9666, 0xEA89, 0x9667, 0xDAED, 0x9668, 0xD4C9, 0x9669, 0xCFD5, 0x966A, 0xC5E3, + 0x966B, 0xEA8A, 0x966C, 0xDAEE, 0x966D, 0xEA8B, 0x966E, 0xEA8C, 0x966F, 0xEA8D, 0x9670, 0xEA8E, 0x9671, 0xEA8F, 0x9672, 0xDAEF, + 0x9673, 0xEA90, 0x9674, 0xDAF0, 0x9675, 0xC1EA, 0x9676, 0xCCD5, 0x9677, 0xCFDD, 0x9678, 0xEA91, 0x9679, 0xEA92, 0x967A, 0xEA93, + 0x967B, 0xEA94, 0x967C, 0xEA95, 0x967D, 0xEA96, 0x967E, 0xEA97, 0x967F, 0xEA98, 0x9680, 0xEA99, 0x9681, 0xEA9A, 0x9682, 0xEA9B, + 0x9683, 0xEA9C, 0x9684, 0xEA9D, 0x9685, 0xD3E7, 0x9686, 0xC2A1, 0x9687, 0xEA9E, 0x9688, 0xDAF1, 0x9689, 0xEA9F, 0x968A, 0xEAA0, + 0x968B, 0xCBE5, 0x968C, 0xEB40, 0x968D, 0xDAF2, 0x968E, 0xEB41, 0x968F, 0xCBE6, 0x9690, 0xD2FE, 0x9691, 0xEB42, 0x9692, 0xEB43, + 0x9693, 0xEB44, 0x9694, 0xB8F4, 0x9695, 0xEB45, 0x9696, 0xEB46, 0x9697, 0xDAF3, 0x9698, 0xB0AF, 0x9699, 0xCFB6, 0x969A, 0xEB47, + 0x969B, 0xEB48, 0x969C, 0xD5CF, 0x969D, 0xEB49, 0x969E, 0xEB4A, 0x969F, 0xEB4B, 0x96A0, 0xEB4C, 0x96A1, 0xEB4D, 0x96A2, 0xEB4E, + 0x96A3, 0xEB4F, 0x96A4, 0xEB50, 0x96A5, 0xEB51, 0x96A6, 0xEB52, 0x96A7, 0xCBED, 0x96A8, 0xEB53, 0x96A9, 0xEB54, 0x96AA, 0xEB55, + 0x96AB, 0xEB56, 0x96AC, 0xEB57, 0x96AD, 0xEB58, 0x96AE, 0xEB59, 0x96AF, 0xEB5A, 0x96B0, 0xDAF4, 0x96B1, 0xEB5B, 0x96B2, 0xEB5C, + 0x96B3, 0xE3C4, 0x96B4, 0xEB5D, 0x96B5, 0xEB5E, 0x96B6, 0xC1A5, 0x96B7, 0xEB5F, 0x96B8, 0xEB60, 0x96B9, 0xF6BF, 0x96BA, 0xEB61, + 0x96BB, 0xEB62, 0x96BC, 0xF6C0, 0x96BD, 0xF6C1, 0x96BE, 0xC4D1, 0x96BF, 0xEB63, 0x96C0, 0xC8B8, 0x96C1, 0xD1E3, 0x96C2, 0xEB64, + 0x96C3, 0xEB65, 0x96C4, 0xD0DB, 0x96C5, 0xD1C5, 0x96C6, 0xBCAF, 0x96C7, 0xB9CD, 0x96C8, 0xEB66, 0x96C9, 0xEFF4, 0x96CA, 0xEB67, + 0x96CB, 0xEB68, 0x96CC, 0xB4C6, 0x96CD, 0xD3BA, 0x96CE, 0xF6C2, 0x96CF, 0xB3FB, 0x96D0, 0xEB69, 0x96D1, 0xEB6A, 0x96D2, 0xF6C3, + 0x96D3, 0xEB6B, 0x96D4, 0xEB6C, 0x96D5, 0xB5F1, 0x96D6, 0xEB6D, 0x96D7, 0xEB6E, 0x96D8, 0xEB6F, 0x96D9, 0xEB70, 0x96DA, 0xEB71, + 0x96DB, 0xEB72, 0x96DC, 0xEB73, 0x96DD, 0xEB74, 0x96DE, 0xEB75, 0x96DF, 0xEB76, 0x96E0, 0xF6C5, 0x96E1, 0xEB77, 0x96E2, 0xEB78, + 0x96E3, 0xEB79, 0x96E4, 0xEB7A, 0x96E5, 0xEB7B, 0x96E6, 0xEB7C, 0x96E7, 0xEB7D, 0x96E8, 0xD3EA, 0x96E9, 0xF6A7, 0x96EA, 0xD1A9, + 0x96EB, 0xEB7E, 0x96EC, 0xEB80, 0x96ED, 0xEB81, 0x96EE, 0xEB82, 0x96EF, 0xF6A9, 0x96F0, 0xEB83, 0x96F1, 0xEB84, 0x96F2, 0xEB85, + 0x96F3, 0xF6A8, 0x96F4, 0xEB86, 0x96F5, 0xEB87, 0x96F6, 0xC1E3, 0x96F7, 0xC0D7, 0x96F8, 0xEB88, 0x96F9, 0xB1A2, 0x96FA, 0xEB89, + 0x96FB, 0xEB8A, 0x96FC, 0xEB8B, 0x96FD, 0xEB8C, 0x96FE, 0xCEED, 0x96FF, 0xEB8D, 0x9700, 0xD0E8, 0x9701, 0xF6AB, 0x9702, 0xEB8E, + 0x9703, 0xEB8F, 0x9704, 0xCFF6, 0x9705, 0xEB90, 0x9706, 0xF6AA, 0x9707, 0xD5F0, 0x9708, 0xF6AC, 0x9709, 0xC3B9, 0x970A, 0xEB91, + 0x970B, 0xEB92, 0x970C, 0xEB93, 0x970D, 0xBBF4, 0x970E, 0xF6AE, 0x970F, 0xF6AD, 0x9710, 0xEB94, 0x9711, 0xEB95, 0x9712, 0xEB96, + 0x9713, 0xC4DE, 0x9714, 0xEB97, 0x9715, 0xEB98, 0x9716, 0xC1D8, 0x9717, 0xEB99, 0x9718, 0xEB9A, 0x9719, 0xEB9B, 0x971A, 0xEB9C, + 0x971B, 0xEB9D, 0x971C, 0xCBAA, 0x971D, 0xEB9E, 0x971E, 0xCFBC, 0x971F, 0xEB9F, 0x9720, 0xEBA0, 0x9721, 0xEC40, 0x9722, 0xEC41, + 0x9723, 0xEC42, 0x9724, 0xEC43, 0x9725, 0xEC44, 0x9726, 0xEC45, 0x9727, 0xEC46, 0x9728, 0xEC47, 0x9729, 0xEC48, 0x972A, 0xF6AF, + 0x972B, 0xEC49, 0x972C, 0xEC4A, 0x972D, 0xF6B0, 0x972E, 0xEC4B, 0x972F, 0xEC4C, 0x9730, 0xF6B1, 0x9731, 0xEC4D, 0x9732, 0xC2B6, + 0x9733, 0xEC4E, 0x9734, 0xEC4F, 0x9735, 0xEC50, 0x9736, 0xEC51, 0x9737, 0xEC52, 0x9738, 0xB0D4, 0x9739, 0xC5F9, 0x973A, 0xEC53, + 0x973B, 0xEC54, 0x973C, 0xEC55, 0x973D, 0xEC56, 0x973E, 0xF6B2, 0x973F, 0xEC57, 0x9740, 0xEC58, 0x9741, 0xEC59, 0x9742, 0xEC5A, + 0x9743, 0xEC5B, 0x9744, 0xEC5C, 0x9745, 0xEC5D, 0x9746, 0xEC5E, 0x9747, 0xEC5F, 0x9748, 0xEC60, 0x9749, 0xEC61, 0x974A, 0xEC62, + 0x974B, 0xEC63, 0x974C, 0xEC64, 0x974D, 0xEC65, 0x974E, 0xEC66, 0x974F, 0xEC67, 0x9750, 0xEC68, 0x9751, 0xEC69, 0x9752, 0xC7E0, + 0x9753, 0xF6A6, 0x9754, 0xEC6A, 0x9755, 0xEC6B, 0x9756, 0xBEB8, 0x9757, 0xEC6C, 0x9758, 0xEC6D, 0x9759, 0xBEB2, 0x975A, 0xEC6E, + 0x975B, 0xB5E5, 0x975C, 0xEC6F, 0x975D, 0xEC70, 0x975E, 0xB7C7, 0x975F, 0xEC71, 0x9760, 0xBFBF, 0x9761, 0xC3D2, 0x9762, 0xC3E6, + 0x9763, 0xEC72, 0x9764, 0xEC73, 0x9765, 0xD8CC, 0x9766, 0xEC74, 0x9767, 0xEC75, 0x9768, 0xEC76, 0x9769, 0xB8EF, 0x976A, 0xEC77, + 0x976B, 0xEC78, 0x976C, 0xEC79, 0x976D, 0xEC7A, 0x976E, 0xEC7B, 0x976F, 0xEC7C, 0x9770, 0xEC7D, 0x9771, 0xEC7E, 0x9772, 0xEC80, + 0x9773, 0xBDF9, 0x9774, 0xD1A5, 0x9775, 0xEC81, 0x9776, 0xB0D0, 0x9777, 0xEC82, 0x9778, 0xEC83, 0x9779, 0xEC84, 0x977A, 0xEC85, + 0x977B, 0xEC86, 0x977C, 0xF7B0, 0x977D, 0xEC87, 0x977E, 0xEC88, 0x977F, 0xEC89, 0x9780, 0xEC8A, 0x9781, 0xEC8B, 0x9782, 0xEC8C, + 0x9783, 0xEC8D, 0x9784, 0xEC8E, 0x9785, 0xF7B1, 0x9786, 0xEC8F, 0x9787, 0xEC90, 0x9788, 0xEC91, 0x9789, 0xEC92, 0x978A, 0xEC93, + 0x978B, 0xD0AC, 0x978C, 0xEC94, 0x978D, 0xB0B0, 0x978E, 0xEC95, 0x978F, 0xEC96, 0x9790, 0xEC97, 0x9791, 0xF7B2, 0x9792, 0xF7B3, + 0x9793, 0xEC98, 0x9794, 0xF7B4, 0x9795, 0xEC99, 0x9796, 0xEC9A, 0x9797, 0xEC9B, 0x9798, 0xC7CA, 0x9799, 0xEC9C, 0x979A, 0xEC9D, + 0x979B, 0xEC9E, 0x979C, 0xEC9F, 0x979D, 0xECA0, 0x979E, 0xED40, 0x979F, 0xED41, 0x97A0, 0xBECF, 0x97A1, 0xED42, 0x97A2, 0xED43, + 0x97A3, 0xF7B7, 0x97A4, 0xED44, 0x97A5, 0xED45, 0x97A6, 0xED46, 0x97A7, 0xED47, 0x97A8, 0xED48, 0x97A9, 0xED49, 0x97AA, 0xED4A, + 0x97AB, 0xF7B6, 0x97AC, 0xED4B, 0x97AD, 0xB1DE, 0x97AE, 0xED4C, 0x97AF, 0xF7B5, 0x97B0, 0xED4D, 0x97B1, 0xED4E, 0x97B2, 0xF7B8, + 0x97B3, 0xED4F, 0x97B4, 0xF7B9, 0x97B5, 0xED50, 0x97B6, 0xED51, 0x97B7, 0xED52, 0x97B8, 0xED53, 0x97B9, 0xED54, 0x97BA, 0xED55, + 0x97BB, 0xED56, 0x97BC, 0xED57, 0x97BD, 0xED58, 0x97BE, 0xED59, 0x97BF, 0xED5A, 0x97C0, 0xED5B, 0x97C1, 0xED5C, 0x97C2, 0xED5D, + 0x97C3, 0xED5E, 0x97C4, 0xED5F, 0x97C5, 0xED60, 0x97C6, 0xED61, 0x97C7, 0xED62, 0x97C8, 0xED63, 0x97C9, 0xED64, 0x97CA, 0xED65, + 0x97CB, 0xED66, 0x97CC, 0xED67, 0x97CD, 0xED68, 0x97CE, 0xED69, 0x97CF, 0xED6A, 0x97D0, 0xED6B, 0x97D1, 0xED6C, 0x97D2, 0xED6D, + 0x97D3, 0xED6E, 0x97D4, 0xED6F, 0x97D5, 0xED70, 0x97D6, 0xED71, 0x97D7, 0xED72, 0x97D8, 0xED73, 0x97D9, 0xED74, 0x97DA, 0xED75, + 0x97DB, 0xED76, 0x97DC, 0xED77, 0x97DD, 0xED78, 0x97DE, 0xED79, 0x97DF, 0xED7A, 0x97E0, 0xED7B, 0x97E1, 0xED7C, 0x97E2, 0xED7D, + 0x97E3, 0xED7E, 0x97E4, 0xED80, 0x97E5, 0xED81, 0x97E6, 0xCEA4, 0x97E7, 0xC8CD, 0x97E8, 0xED82, 0x97E9, 0xBAAB, 0x97EA, 0xE8B8, + 0x97EB, 0xE8B9, 0x97EC, 0xE8BA, 0x97ED, 0xBEC2, 0x97EE, 0xED83, 0x97EF, 0xED84, 0x97F0, 0xED85, 0x97F1, 0xED86, 0x97F2, 0xED87, + 0x97F3, 0xD2F4, 0x97F4, 0xED88, 0x97F5, 0xD4CF, 0x97F6, 0xC9D8, 0x97F7, 0xED89, 0x97F8, 0xED8A, 0x97F9, 0xED8B, 0x97FA, 0xED8C, + 0x97FB, 0xED8D, 0x97FC, 0xED8E, 0x97FD, 0xED8F, 0x97FE, 0xED90, 0x97FF, 0xED91, 0x9800, 0xED92, 0x9801, 0xED93, 0x9802, 0xED94, + 0x9803, 0xED95, 0x9804, 0xED96, 0x9805, 0xED97, 0x9806, 0xED98, 0x9807, 0xED99, 0x9808, 0xED9A, 0x9809, 0xED9B, 0x980A, 0xED9C, + 0x980B, 0xED9D, 0x980C, 0xED9E, 0x980D, 0xED9F, 0x980E, 0xEDA0, 0x980F, 0xEE40, 0x9810, 0xEE41, 0x9811, 0xEE42, 0x9812, 0xEE43, + 0x9813, 0xEE44, 0x9814, 0xEE45, 0x9815, 0xEE46, 0x9816, 0xEE47, 0x9817, 0xEE48, 0x9818, 0xEE49, 0x9819, 0xEE4A, 0x981A, 0xEE4B, + 0x981B, 0xEE4C, 0x981C, 0xEE4D, 0x981D, 0xEE4E, 0x981E, 0xEE4F, 0x981F, 0xEE50, 0x9820, 0xEE51, 0x9821, 0xEE52, 0x9822, 0xEE53, + 0x9823, 0xEE54, 0x9824, 0xEE55, 0x9825, 0xEE56, 0x9826, 0xEE57, 0x9827, 0xEE58, 0x9828, 0xEE59, 0x9829, 0xEE5A, 0x982A, 0xEE5B, + 0x982B, 0xEE5C, 0x982C, 0xEE5D, 0x982D, 0xEE5E, 0x982E, 0xEE5F, 0x982F, 0xEE60, 0x9830, 0xEE61, 0x9831, 0xEE62, 0x9832, 0xEE63, + 0x9833, 0xEE64, 0x9834, 0xEE65, 0x9835, 0xEE66, 0x9836, 0xEE67, 0x9837, 0xEE68, 0x9838, 0xEE69, 0x9839, 0xEE6A, 0x983A, 0xEE6B, + 0x983B, 0xEE6C, 0x983C, 0xEE6D, 0x983D, 0xEE6E, 0x983E, 0xEE6F, 0x983F, 0xEE70, 0x9840, 0xEE71, 0x9841, 0xEE72, 0x9842, 0xEE73, + 0x9843, 0xEE74, 0x9844, 0xEE75, 0x9845, 0xEE76, 0x9846, 0xEE77, 0x9847, 0xEE78, 0x9848, 0xEE79, 0x9849, 0xEE7A, 0x984A, 0xEE7B, + 0x984B, 0xEE7C, 0x984C, 0xEE7D, 0x984D, 0xEE7E, 0x984E, 0xEE80, 0x984F, 0xEE81, 0x9850, 0xEE82, 0x9851, 0xEE83, 0x9852, 0xEE84, + 0x9853, 0xEE85, 0x9854, 0xEE86, 0x9855, 0xEE87, 0x9856, 0xEE88, 0x9857, 0xEE89, 0x9858, 0xEE8A, 0x9859, 0xEE8B, 0x985A, 0xEE8C, + 0x985B, 0xEE8D, 0x985C, 0xEE8E, 0x985D, 0xEE8F, 0x985E, 0xEE90, 0x985F, 0xEE91, 0x9860, 0xEE92, 0x9861, 0xEE93, 0x9862, 0xEE94, + 0x9863, 0xEE95, 0x9864, 0xEE96, 0x9865, 0xEE97, 0x9866, 0xEE98, 0x9867, 0xEE99, 0x9868, 0xEE9A, 0x9869, 0xEE9B, 0x986A, 0xEE9C, + 0x986B, 0xEE9D, 0x986C, 0xEE9E, 0x986D, 0xEE9F, 0x986E, 0xEEA0, 0x986F, 0xEF40, 0x9870, 0xEF41, 0x9871, 0xEF42, 0x9872, 0xEF43, + 0x9873, 0xEF44, 0x9874, 0xEF45, 0x9875, 0xD2B3, 0x9876, 0xB6A5, 0x9877, 0xC7EA, 0x9878, 0xF1FC, 0x9879, 0xCFEE, 0x987A, 0xCBB3, + 0x987B, 0xD0EB, 0x987C, 0xE7EF, 0x987D, 0xCDE7, 0x987E, 0xB9CB, 0x987F, 0xB6D9, 0x9880, 0xF1FD, 0x9881, 0xB0E4, 0x9882, 0xCBCC, + 0x9883, 0xF1FE, 0x9884, 0xD4A4, 0x9885, 0xC2AD, 0x9886, 0xC1EC, 0x9887, 0xC6C4, 0x9888, 0xBEB1, 0x9889, 0xF2A1, 0x988A, 0xBCD5, + 0x988B, 0xEF46, 0x988C, 0xF2A2, 0x988D, 0xF2A3, 0x988E, 0xEF47, 0x988F, 0xF2A4, 0x9890, 0xD2C3, 0x9891, 0xC6B5, 0x9892, 0xEF48, + 0x9893, 0xCDC7, 0x9894, 0xF2A5, 0x9895, 0xEF49, 0x9896, 0xD3B1, 0x9897, 0xBFC5, 0x9898, 0xCCE2, 0x9899, 0xEF4A, 0x989A, 0xF2A6, + 0x989B, 0xF2A7, 0x989C, 0xD1D5, 0x989D, 0xB6EE, 0x989E, 0xF2A8, 0x989F, 0xF2A9, 0x98A0, 0xB5DF, 0x98A1, 0xF2AA, 0x98A2, 0xF2AB, + 0x98A3, 0xEF4B, 0x98A4, 0xB2FC, 0x98A5, 0xF2AC, 0x98A6, 0xF2AD, 0x98A7, 0xC8A7, 0x98A8, 0xEF4C, 0x98A9, 0xEF4D, 0x98AA, 0xEF4E, + 0x98AB, 0xEF4F, 0x98AC, 0xEF50, 0x98AD, 0xEF51, 0x98AE, 0xEF52, 0x98AF, 0xEF53, 0x98B0, 0xEF54, 0x98B1, 0xEF55, 0x98B2, 0xEF56, + 0x98B3, 0xEF57, 0x98B4, 0xEF58, 0x98B5, 0xEF59, 0x98B6, 0xEF5A, 0x98B7, 0xEF5B, 0x98B8, 0xEF5C, 0x98B9, 0xEF5D, 0x98BA, 0xEF5E, + 0x98BB, 0xEF5F, 0x98BC, 0xEF60, 0x98BD, 0xEF61, 0x98BE, 0xEF62, 0x98BF, 0xEF63, 0x98C0, 0xEF64, 0x98C1, 0xEF65, 0x98C2, 0xEF66, + 0x98C3, 0xEF67, 0x98C4, 0xEF68, 0x98C5, 0xEF69, 0x98C6, 0xEF6A, 0x98C7, 0xEF6B, 0x98C8, 0xEF6C, 0x98C9, 0xEF6D, 0x98CA, 0xEF6E, + 0x98CB, 0xEF6F, 0x98CC, 0xEF70, 0x98CD, 0xEF71, 0x98CE, 0xB7E7, 0x98CF, 0xEF72, 0x98D0, 0xEF73, 0x98D1, 0xECA9, 0x98D2, 0xECAA, + 0x98D3, 0xECAB, 0x98D4, 0xEF74, 0x98D5, 0xECAC, 0x98D6, 0xEF75, 0x98D7, 0xEF76, 0x98D8, 0xC6AE, 0x98D9, 0xECAD, 0x98DA, 0xECAE, + 0x98DB, 0xEF77, 0x98DC, 0xEF78, 0x98DD, 0xEF79, 0x98DE, 0xB7C9, 0x98DF, 0xCAB3, 0x98E0, 0xEF7A, 0x98E1, 0xEF7B, 0x98E2, 0xEF7C, + 0x98E3, 0xEF7D, 0x98E4, 0xEF7E, 0x98E5, 0xEF80, 0x98E6, 0xEF81, 0x98E7, 0xE2B8, 0x98E8, 0xF7CF, 0x98E9, 0xEF82, 0x98EA, 0xEF83, + 0x98EB, 0xEF84, 0x98EC, 0xEF85, 0x98ED, 0xEF86, 0x98EE, 0xEF87, 0x98EF, 0xEF88, 0x98F0, 0xEF89, 0x98F1, 0xEF8A, 0x98F2, 0xEF8B, + 0x98F3, 0xEF8C, 0x98F4, 0xEF8D, 0x98F5, 0xEF8E, 0x98F6, 0xEF8F, 0x98F7, 0xEF90, 0x98F8, 0xEF91, 0x98F9, 0xEF92, 0x98FA, 0xEF93, + 0x98FB, 0xEF94, 0x98FC, 0xEF95, 0x98FD, 0xEF96, 0x98FE, 0xEF97, 0x98FF, 0xEF98, 0x9900, 0xEF99, 0x9901, 0xEF9A, 0x9902, 0xEF9B, + 0x9903, 0xEF9C, 0x9904, 0xEF9D, 0x9905, 0xEF9E, 0x9906, 0xEF9F, 0x9907, 0xEFA0, 0x9908, 0xF040, 0x9909, 0xF041, 0x990A, 0xF042, + 0x990B, 0xF043, 0x990C, 0xF044, 0x990D, 0xF7D0, 0x990E, 0xF045, 0x990F, 0xF046, 0x9910, 0xB2CD, 0x9911, 0xF047, 0x9912, 0xF048, + 0x9913, 0xF049, 0x9914, 0xF04A, 0x9915, 0xF04B, 0x9916, 0xF04C, 0x9917, 0xF04D, 0x9918, 0xF04E, 0x9919, 0xF04F, 0x991A, 0xF050, + 0x991B, 0xF051, 0x991C, 0xF052, 0x991D, 0xF053, 0x991E, 0xF054, 0x991F, 0xF055, 0x9920, 0xF056, 0x9921, 0xF057, 0x9922, 0xF058, + 0x9923, 0xF059, 0x9924, 0xF05A, 0x9925, 0xF05B, 0x9926, 0xF05C, 0x9927, 0xF05D, 0x9928, 0xF05E, 0x9929, 0xF05F, 0x992A, 0xF060, + 0x992B, 0xF061, 0x992C, 0xF062, 0x992D, 0xF063, 0x992E, 0xF7D1, 0x992F, 0xF064, 0x9930, 0xF065, 0x9931, 0xF066, 0x9932, 0xF067, + 0x9933, 0xF068, 0x9934, 0xF069, 0x9935, 0xF06A, 0x9936, 0xF06B, 0x9937, 0xF06C, 0x9938, 0xF06D, 0x9939, 0xF06E, 0x993A, 0xF06F, + 0x993B, 0xF070, 0x993C, 0xF071, 0x993D, 0xF072, 0x993E, 0xF073, 0x993F, 0xF074, 0x9940, 0xF075, 0x9941, 0xF076, 0x9942, 0xF077, + 0x9943, 0xF078, 0x9944, 0xF079, 0x9945, 0xF07A, 0x9946, 0xF07B, 0x9947, 0xF07C, 0x9948, 0xF07D, 0x9949, 0xF07E, 0x994A, 0xF080, + 0x994B, 0xF081, 0x994C, 0xF082, 0x994D, 0xF083, 0x994E, 0xF084, 0x994F, 0xF085, 0x9950, 0xF086, 0x9951, 0xF087, 0x9952, 0xF088, + 0x9953, 0xF089, 0x9954, 0xF7D3, 0x9955, 0xF7D2, 0x9956, 0xF08A, 0x9957, 0xF08B, 0x9958, 0xF08C, 0x9959, 0xF08D, 0x995A, 0xF08E, + 0x995B, 0xF08F, 0x995C, 0xF090, 0x995D, 0xF091, 0x995E, 0xF092, 0x995F, 0xF093, 0x9960, 0xF094, 0x9961, 0xF095, 0x9962, 0xF096, + 0x9963, 0xE2BB, 0x9964, 0xF097, 0x9965, 0xBCA2, 0x9966, 0xF098, 0x9967, 0xE2BC, 0x9968, 0xE2BD, 0x9969, 0xE2BE, 0x996A, 0xE2BF, + 0x996B, 0xE2C0, 0x996C, 0xE2C1, 0x996D, 0xB7B9, 0x996E, 0xD2FB, 0x996F, 0xBDA4, 0x9970, 0xCACE, 0x9971, 0xB1A5, 0x9972, 0xCBC7, + 0x9973, 0xF099, 0x9974, 0xE2C2, 0x9975, 0xB6FC, 0x9976, 0xC8C4, 0x9977, 0xE2C3, 0x9978, 0xF09A, 0x9979, 0xF09B, 0x997A, 0xBDC8, + 0x997B, 0xF09C, 0x997C, 0xB1FD, 0x997D, 0xE2C4, 0x997E, 0xF09D, 0x997F, 0xB6F6, 0x9980, 0xE2C5, 0x9981, 0xC4D9, 0x9982, 0xF09E, + 0x9983, 0xF09F, 0x9984, 0xE2C6, 0x9985, 0xCFDA, 0x9986, 0xB9DD, 0x9987, 0xE2C7, 0x9988, 0xC0A1, 0x9989, 0xF0A0, 0x998A, 0xE2C8, + 0x998B, 0xB2F6, 0x998C, 0xF140, 0x998D, 0xE2C9, 0x998E, 0xF141, 0x998F, 0xC1F3, 0x9990, 0xE2CA, 0x9991, 0xE2CB, 0x9992, 0xC2F8, + 0x9993, 0xE2CC, 0x9994, 0xE2CD, 0x9995, 0xE2CE, 0x9996, 0xCAD7, 0x9997, 0xD8B8, 0x9998, 0xD9E5, 0x9999, 0xCFE3, 0x999A, 0xF142, + 0x999B, 0xF143, 0x999C, 0xF144, 0x999D, 0xF145, 0x999E, 0xF146, 0x999F, 0xF147, 0x99A0, 0xF148, 0x99A1, 0xF149, 0x99A2, 0xF14A, + 0x99A3, 0xF14B, 0x99A4, 0xF14C, 0x99A5, 0xF0A5, 0x99A6, 0xF14D, 0x99A7, 0xF14E, 0x99A8, 0xDCB0, 0x99A9, 0xF14F, 0x99AA, 0xF150, + 0x99AB, 0xF151, 0x99AC, 0xF152, 0x99AD, 0xF153, 0x99AE, 0xF154, 0x99AF, 0xF155, 0x99B0, 0xF156, 0x99B1, 0xF157, 0x99B2, 0xF158, + 0x99B3, 0xF159, 0x99B4, 0xF15A, 0x99B5, 0xF15B, 0x99B6, 0xF15C, 0x99B7, 0xF15D, 0x99B8, 0xF15E, 0x99B9, 0xF15F, 0x99BA, 0xF160, + 0x99BB, 0xF161, 0x99BC, 0xF162, 0x99BD, 0xF163, 0x99BE, 0xF164, 0x99BF, 0xF165, 0x99C0, 0xF166, 0x99C1, 0xF167, 0x99C2, 0xF168, + 0x99C3, 0xF169, 0x99C4, 0xF16A, 0x99C5, 0xF16B, 0x99C6, 0xF16C, 0x99C7, 0xF16D, 0x99C8, 0xF16E, 0x99C9, 0xF16F, 0x99CA, 0xF170, + 0x99CB, 0xF171, 0x99CC, 0xF172, 0x99CD, 0xF173, 0x99CE, 0xF174, 0x99CF, 0xF175, 0x99D0, 0xF176, 0x99D1, 0xF177, 0x99D2, 0xF178, + 0x99D3, 0xF179, 0x99D4, 0xF17A, 0x99D5, 0xF17B, 0x99D6, 0xF17C, 0x99D7, 0xF17D, 0x99D8, 0xF17E, 0x99D9, 0xF180, 0x99DA, 0xF181, + 0x99DB, 0xF182, 0x99DC, 0xF183, 0x99DD, 0xF184, 0x99DE, 0xF185, 0x99DF, 0xF186, 0x99E0, 0xF187, 0x99E1, 0xF188, 0x99E2, 0xF189, + 0x99E3, 0xF18A, 0x99E4, 0xF18B, 0x99E5, 0xF18C, 0x99E6, 0xF18D, 0x99E7, 0xF18E, 0x99E8, 0xF18F, 0x99E9, 0xF190, 0x99EA, 0xF191, + 0x99EB, 0xF192, 0x99EC, 0xF193, 0x99ED, 0xF194, 0x99EE, 0xF195, 0x99EF, 0xF196, 0x99F0, 0xF197, 0x99F1, 0xF198, 0x99F2, 0xF199, + 0x99F3, 0xF19A, 0x99F4, 0xF19B, 0x99F5, 0xF19C, 0x99F6, 0xF19D, 0x99F7, 0xF19E, 0x99F8, 0xF19F, 0x99F9, 0xF1A0, 0x99FA, 0xF240, + 0x99FB, 0xF241, 0x99FC, 0xF242, 0x99FD, 0xF243, 0x99FE, 0xF244, 0x99FF, 0xF245, 0x9A00, 0xF246, 0x9A01, 0xF247, 0x9A02, 0xF248, + 0x9A03, 0xF249, 0x9A04, 0xF24A, 0x9A05, 0xF24B, 0x9A06, 0xF24C, 0x9A07, 0xF24D, 0x9A08, 0xF24E, 0x9A09, 0xF24F, 0x9A0A, 0xF250, + 0x9A0B, 0xF251, 0x9A0C, 0xF252, 0x9A0D, 0xF253, 0x9A0E, 0xF254, 0x9A0F, 0xF255, 0x9A10, 0xF256, 0x9A11, 0xF257, 0x9A12, 0xF258, + 0x9A13, 0xF259, 0x9A14, 0xF25A, 0x9A15, 0xF25B, 0x9A16, 0xF25C, 0x9A17, 0xF25D, 0x9A18, 0xF25E, 0x9A19, 0xF25F, 0x9A1A, 0xF260, + 0x9A1B, 0xF261, 0x9A1C, 0xF262, 0x9A1D, 0xF263, 0x9A1E, 0xF264, 0x9A1F, 0xF265, 0x9A20, 0xF266, 0x9A21, 0xF267, 0x9A22, 0xF268, + 0x9A23, 0xF269, 0x9A24, 0xF26A, 0x9A25, 0xF26B, 0x9A26, 0xF26C, 0x9A27, 0xF26D, 0x9A28, 0xF26E, 0x9A29, 0xF26F, 0x9A2A, 0xF270, + 0x9A2B, 0xF271, 0x9A2C, 0xF272, 0x9A2D, 0xF273, 0x9A2E, 0xF274, 0x9A2F, 0xF275, 0x9A30, 0xF276, 0x9A31, 0xF277, 0x9A32, 0xF278, + 0x9A33, 0xF279, 0x9A34, 0xF27A, 0x9A35, 0xF27B, 0x9A36, 0xF27C, 0x9A37, 0xF27D, 0x9A38, 0xF27E, 0x9A39, 0xF280, 0x9A3A, 0xF281, + 0x9A3B, 0xF282, 0x9A3C, 0xF283, 0x9A3D, 0xF284, 0x9A3E, 0xF285, 0x9A3F, 0xF286, 0x9A40, 0xF287, 0x9A41, 0xF288, 0x9A42, 0xF289, + 0x9A43, 0xF28A, 0x9A44, 0xF28B, 0x9A45, 0xF28C, 0x9A46, 0xF28D, 0x9A47, 0xF28E, 0x9A48, 0xF28F, 0x9A49, 0xF290, 0x9A4A, 0xF291, + 0x9A4B, 0xF292, 0x9A4C, 0xF293, 0x9A4D, 0xF294, 0x9A4E, 0xF295, 0x9A4F, 0xF296, 0x9A50, 0xF297, 0x9A51, 0xF298, 0x9A52, 0xF299, + 0x9A53, 0xF29A, 0x9A54, 0xF29B, 0x9A55, 0xF29C, 0x9A56, 0xF29D, 0x9A57, 0xF29E, 0x9A58, 0xF29F, 0x9A59, 0xF2A0, 0x9A5A, 0xF340, + 0x9A5B, 0xF341, 0x9A5C, 0xF342, 0x9A5D, 0xF343, 0x9A5E, 0xF344, 0x9A5F, 0xF345, 0x9A60, 0xF346, 0x9A61, 0xF347, 0x9A62, 0xF348, + 0x9A63, 0xF349, 0x9A64, 0xF34A, 0x9A65, 0xF34B, 0x9A66, 0xF34C, 0x9A67, 0xF34D, 0x9A68, 0xF34E, 0x9A69, 0xF34F, 0x9A6A, 0xF350, + 0x9A6B, 0xF351, 0x9A6C, 0xC2ED, 0x9A6D, 0xD4A6, 0x9A6E, 0xCDD4, 0x9A6F, 0xD1B1, 0x9A70, 0xB3DB, 0x9A71, 0xC7FD, 0x9A72, 0xF352, + 0x9A73, 0xB2B5, 0x9A74, 0xC2BF, 0x9A75, 0xE6E0, 0x9A76, 0xCABB, 0x9A77, 0xE6E1, 0x9A78, 0xE6E2, 0x9A79, 0xBED4, 0x9A7A, 0xE6E3, + 0x9A7B, 0xD7A4, 0x9A7C, 0xCDD5, 0x9A7D, 0xE6E5, 0x9A7E, 0xBCDD, 0x9A7F, 0xE6E4, 0x9A80, 0xE6E6, 0x9A81, 0xE6E7, 0x9A82, 0xC2EE, + 0x9A83, 0xF353, 0x9A84, 0xBDBE, 0x9A85, 0xE6E8, 0x9A86, 0xC2E6, 0x9A87, 0xBAA7, 0x9A88, 0xE6E9, 0x9A89, 0xF354, 0x9A8A, 0xE6EA, + 0x9A8B, 0xB3D2, 0x9A8C, 0xD1E9, 0x9A8D, 0xF355, 0x9A8E, 0xF356, 0x9A8F, 0xBFA5, 0x9A90, 0xE6EB, 0x9A91, 0xC6EF, 0x9A92, 0xE6EC, + 0x9A93, 0xE6ED, 0x9A94, 0xF357, 0x9A95, 0xF358, 0x9A96, 0xE6EE, 0x9A97, 0xC6AD, 0x9A98, 0xE6EF, 0x9A99, 0xF359, 0x9A9A, 0xC9A7, + 0x9A9B, 0xE6F0, 0x9A9C, 0xE6F1, 0x9A9D, 0xE6F2, 0x9A9E, 0xE5B9, 0x9A9F, 0xE6F3, 0x9AA0, 0xE6F4, 0x9AA1, 0xC2E2, 0x9AA2, 0xE6F5, + 0x9AA3, 0xE6F6, 0x9AA4, 0xD6E8, 0x9AA5, 0xE6F7, 0x9AA6, 0xF35A, 0x9AA7, 0xE6F8, 0x9AA8, 0xB9C7, 0x9AA9, 0xF35B, 0x9AAA, 0xF35C, + 0x9AAB, 0xF35D, 0x9AAC, 0xF35E, 0x9AAD, 0xF35F, 0x9AAE, 0xF360, 0x9AAF, 0xF361, 0x9AB0, 0xF7BB, 0x9AB1, 0xF7BA, 0x9AB2, 0xF362, + 0x9AB3, 0xF363, 0x9AB4, 0xF364, 0x9AB5, 0xF365, 0x9AB6, 0xF7BE, 0x9AB7, 0xF7BC, 0x9AB8, 0xBAA1, 0x9AB9, 0xF366, 0x9ABA, 0xF7BF, + 0x9ABB, 0xF367, 0x9ABC, 0xF7C0, 0x9ABD, 0xF368, 0x9ABE, 0xF369, 0x9ABF, 0xF36A, 0x9AC0, 0xF7C2, 0x9AC1, 0xF7C1, 0x9AC2, 0xF7C4, + 0x9AC3, 0xF36B, 0x9AC4, 0xF36C, 0x9AC5, 0xF7C3, 0x9AC6, 0xF36D, 0x9AC7, 0xF36E, 0x9AC8, 0xF36F, 0x9AC9, 0xF370, 0x9ACA, 0xF371, + 0x9ACB, 0xF7C5, 0x9ACC, 0xF7C6, 0x9ACD, 0xF372, 0x9ACE, 0xF373, 0x9ACF, 0xF374, 0x9AD0, 0xF375, 0x9AD1, 0xF7C7, 0x9AD2, 0xF376, + 0x9AD3, 0xCBE8, 0x9AD4, 0xF377, 0x9AD5, 0xF378, 0x9AD6, 0xF379, 0x9AD7, 0xF37A, 0x9AD8, 0xB8DF, 0x9AD9, 0xF37B, 0x9ADA, 0xF37C, + 0x9ADB, 0xF37D, 0x9ADC, 0xF37E, 0x9ADD, 0xF380, 0x9ADE, 0xF381, 0x9ADF, 0xF7D4, 0x9AE0, 0xF382, 0x9AE1, 0xF7D5, 0x9AE2, 0xF383, + 0x9AE3, 0xF384, 0x9AE4, 0xF385, 0x9AE5, 0xF386, 0x9AE6, 0xF7D6, 0x9AE7, 0xF387, 0x9AE8, 0xF388, 0x9AE9, 0xF389, 0x9AEA, 0xF38A, + 0x9AEB, 0xF7D8, 0x9AEC, 0xF38B, 0x9AED, 0xF7DA, 0x9AEE, 0xF38C, 0x9AEF, 0xF7D7, 0x9AF0, 0xF38D, 0x9AF1, 0xF38E, 0x9AF2, 0xF38F, + 0x9AF3, 0xF390, 0x9AF4, 0xF391, 0x9AF5, 0xF392, 0x9AF6, 0xF393, 0x9AF7, 0xF394, 0x9AF8, 0xF395, 0x9AF9, 0xF7DB, 0x9AFA, 0xF396, + 0x9AFB, 0xF7D9, 0x9AFC, 0xF397, 0x9AFD, 0xF398, 0x9AFE, 0xF399, 0x9AFF, 0xF39A, 0x9B00, 0xF39B, 0x9B01, 0xF39C, 0x9B02, 0xF39D, + 0x9B03, 0xD7D7, 0x9B04, 0xF39E, 0x9B05, 0xF39F, 0x9B06, 0xF3A0, 0x9B07, 0xF440, 0x9B08, 0xF7DC, 0x9B09, 0xF441, 0x9B0A, 0xF442, + 0x9B0B, 0xF443, 0x9B0C, 0xF444, 0x9B0D, 0xF445, 0x9B0E, 0xF446, 0x9B0F, 0xF7DD, 0x9B10, 0xF447, 0x9B11, 0xF448, 0x9B12, 0xF449, + 0x9B13, 0xF7DE, 0x9B14, 0xF44A, 0x9B15, 0xF44B, 0x9B16, 0xF44C, 0x9B17, 0xF44D, 0x9B18, 0xF44E, 0x9B19, 0xF44F, 0x9B1A, 0xF450, + 0x9B1B, 0xF451, 0x9B1C, 0xF452, 0x9B1D, 0xF453, 0x9B1E, 0xF454, 0x9B1F, 0xF7DF, 0x9B20, 0xF455, 0x9B21, 0xF456, 0x9B22, 0xF457, + 0x9B23, 0xF7E0, 0x9B24, 0xF458, 0x9B25, 0xF459, 0x9B26, 0xF45A, 0x9B27, 0xF45B, 0x9B28, 0xF45C, 0x9B29, 0xF45D, 0x9B2A, 0xF45E, + 0x9B2B, 0xF45F, 0x9B2C, 0xF460, 0x9B2D, 0xF461, 0x9B2E, 0xF462, 0x9B2F, 0xDBCB, 0x9B30, 0xF463, 0x9B31, 0xF464, 0x9B32, 0xD8AA, + 0x9B33, 0xF465, 0x9B34, 0xF466, 0x9B35, 0xF467, 0x9B36, 0xF468, 0x9B37, 0xF469, 0x9B38, 0xF46A, 0x9B39, 0xF46B, 0x9B3A, 0xF46C, + 0x9B3B, 0xE5F7, 0x9B3C, 0xB9ED, 0x9B3D, 0xF46D, 0x9B3E, 0xF46E, 0x9B3F, 0xF46F, 0x9B40, 0xF470, 0x9B41, 0xBFFD, 0x9B42, 0xBBEA, + 0x9B43, 0xF7C9, 0x9B44, 0xC6C7, 0x9B45, 0xF7C8, 0x9B46, 0xF471, 0x9B47, 0xF7CA, 0x9B48, 0xF7CC, 0x9B49, 0xF7CB, 0x9B4A, 0xF472, + 0x9B4B, 0xF473, 0x9B4C, 0xF474, 0x9B4D, 0xF7CD, 0x9B4E, 0xF475, 0x9B4F, 0xCEBA, 0x9B50, 0xF476, 0x9B51, 0xF7CE, 0x9B52, 0xF477, + 0x9B53, 0xF478, 0x9B54, 0xC4A7, 0x9B55, 0xF479, 0x9B56, 0xF47A, 0x9B57, 0xF47B, 0x9B58, 0xF47C, 0x9B59, 0xF47D, 0x9B5A, 0xF47E, + 0x9B5B, 0xF480, 0x9B5C, 0xF481, 0x9B5D, 0xF482, 0x9B5E, 0xF483, 0x9B5F, 0xF484, 0x9B60, 0xF485, 0x9B61, 0xF486, 0x9B62, 0xF487, + 0x9B63, 0xF488, 0x9B64, 0xF489, 0x9B65, 0xF48A, 0x9B66, 0xF48B, 0x9B67, 0xF48C, 0x9B68, 0xF48D, 0x9B69, 0xF48E, 0x9B6A, 0xF48F, + 0x9B6B, 0xF490, 0x9B6C, 0xF491, 0x9B6D, 0xF492, 0x9B6E, 0xF493, 0x9B6F, 0xF494, 0x9B70, 0xF495, 0x9B71, 0xF496, 0x9B72, 0xF497, + 0x9B73, 0xF498, 0x9B74, 0xF499, 0x9B75, 0xF49A, 0x9B76, 0xF49B, 0x9B77, 0xF49C, 0x9B78, 0xF49D, 0x9B79, 0xF49E, 0x9B7A, 0xF49F, + 0x9B7B, 0xF4A0, 0x9B7C, 0xF540, 0x9B7D, 0xF541, 0x9B7E, 0xF542, 0x9B7F, 0xF543, 0x9B80, 0xF544, 0x9B81, 0xF545, 0x9B82, 0xF546, + 0x9B83, 0xF547, 0x9B84, 0xF548, 0x9B85, 0xF549, 0x9B86, 0xF54A, 0x9B87, 0xF54B, 0x9B88, 0xF54C, 0x9B89, 0xF54D, 0x9B8A, 0xF54E, + 0x9B8B, 0xF54F, 0x9B8C, 0xF550, 0x9B8D, 0xF551, 0x9B8E, 0xF552, 0x9B8F, 0xF553, 0x9B90, 0xF554, 0x9B91, 0xF555, 0x9B92, 0xF556, + 0x9B93, 0xF557, 0x9B94, 0xF558, 0x9B95, 0xF559, 0x9B96, 0xF55A, 0x9B97, 0xF55B, 0x9B98, 0xF55C, 0x9B99, 0xF55D, 0x9B9A, 0xF55E, + 0x9B9B, 0xF55F, 0x9B9C, 0xF560, 0x9B9D, 0xF561, 0x9B9E, 0xF562, 0x9B9F, 0xF563, 0x9BA0, 0xF564, 0x9BA1, 0xF565, 0x9BA2, 0xF566, + 0x9BA3, 0xF567, 0x9BA4, 0xF568, 0x9BA5, 0xF569, 0x9BA6, 0xF56A, 0x9BA7, 0xF56B, 0x9BA8, 0xF56C, 0x9BA9, 0xF56D, 0x9BAA, 0xF56E, + 0x9BAB, 0xF56F, 0x9BAC, 0xF570, 0x9BAD, 0xF571, 0x9BAE, 0xF572, 0x9BAF, 0xF573, 0x9BB0, 0xF574, 0x9BB1, 0xF575, 0x9BB2, 0xF576, + 0x9BB3, 0xF577, 0x9BB4, 0xF578, 0x9BB5, 0xF579, 0x9BB6, 0xF57A, 0x9BB7, 0xF57B, 0x9BB8, 0xF57C, 0x9BB9, 0xF57D, 0x9BBA, 0xF57E, + 0x9BBB, 0xF580, 0x9BBC, 0xF581, 0x9BBD, 0xF582, 0x9BBE, 0xF583, 0x9BBF, 0xF584, 0x9BC0, 0xF585, 0x9BC1, 0xF586, 0x9BC2, 0xF587, + 0x9BC3, 0xF588, 0x9BC4, 0xF589, 0x9BC5, 0xF58A, 0x9BC6, 0xF58B, 0x9BC7, 0xF58C, 0x9BC8, 0xF58D, 0x9BC9, 0xF58E, 0x9BCA, 0xF58F, + 0x9BCB, 0xF590, 0x9BCC, 0xF591, 0x9BCD, 0xF592, 0x9BCE, 0xF593, 0x9BCF, 0xF594, 0x9BD0, 0xF595, 0x9BD1, 0xF596, 0x9BD2, 0xF597, + 0x9BD3, 0xF598, 0x9BD4, 0xF599, 0x9BD5, 0xF59A, 0x9BD6, 0xF59B, 0x9BD7, 0xF59C, 0x9BD8, 0xF59D, 0x9BD9, 0xF59E, 0x9BDA, 0xF59F, + 0x9BDB, 0xF5A0, 0x9BDC, 0xF640, 0x9BDD, 0xF641, 0x9BDE, 0xF642, 0x9BDF, 0xF643, 0x9BE0, 0xF644, 0x9BE1, 0xF645, 0x9BE2, 0xF646, + 0x9BE3, 0xF647, 0x9BE4, 0xF648, 0x9BE5, 0xF649, 0x9BE6, 0xF64A, 0x9BE7, 0xF64B, 0x9BE8, 0xF64C, 0x9BE9, 0xF64D, 0x9BEA, 0xF64E, + 0x9BEB, 0xF64F, 0x9BEC, 0xF650, 0x9BED, 0xF651, 0x9BEE, 0xF652, 0x9BEF, 0xF653, 0x9BF0, 0xF654, 0x9BF1, 0xF655, 0x9BF2, 0xF656, + 0x9BF3, 0xF657, 0x9BF4, 0xF658, 0x9BF5, 0xF659, 0x9BF6, 0xF65A, 0x9BF7, 0xF65B, 0x9BF8, 0xF65C, 0x9BF9, 0xF65D, 0x9BFA, 0xF65E, + 0x9BFB, 0xF65F, 0x9BFC, 0xF660, 0x9BFD, 0xF661, 0x9BFE, 0xF662, 0x9BFF, 0xF663, 0x9C00, 0xF664, 0x9C01, 0xF665, 0x9C02, 0xF666, + 0x9C03, 0xF667, 0x9C04, 0xF668, 0x9C05, 0xF669, 0x9C06, 0xF66A, 0x9C07, 0xF66B, 0x9C08, 0xF66C, 0x9C09, 0xF66D, 0x9C0A, 0xF66E, + 0x9C0B, 0xF66F, 0x9C0C, 0xF670, 0x9C0D, 0xF671, 0x9C0E, 0xF672, 0x9C0F, 0xF673, 0x9C10, 0xF674, 0x9C11, 0xF675, 0x9C12, 0xF676, + 0x9C13, 0xF677, 0x9C14, 0xF678, 0x9C15, 0xF679, 0x9C16, 0xF67A, 0x9C17, 0xF67B, 0x9C18, 0xF67C, 0x9C19, 0xF67D, 0x9C1A, 0xF67E, + 0x9C1B, 0xF680, 0x9C1C, 0xF681, 0x9C1D, 0xF682, 0x9C1E, 0xF683, 0x9C1F, 0xF684, 0x9C20, 0xF685, 0x9C21, 0xF686, 0x9C22, 0xF687, + 0x9C23, 0xF688, 0x9C24, 0xF689, 0x9C25, 0xF68A, 0x9C26, 0xF68B, 0x9C27, 0xF68C, 0x9C28, 0xF68D, 0x9C29, 0xF68E, 0x9C2A, 0xF68F, + 0x9C2B, 0xF690, 0x9C2C, 0xF691, 0x9C2D, 0xF692, 0x9C2E, 0xF693, 0x9C2F, 0xF694, 0x9C30, 0xF695, 0x9C31, 0xF696, 0x9C32, 0xF697, + 0x9C33, 0xF698, 0x9C34, 0xF699, 0x9C35, 0xF69A, 0x9C36, 0xF69B, 0x9C37, 0xF69C, 0x9C38, 0xF69D, 0x9C39, 0xF69E, 0x9C3A, 0xF69F, + 0x9C3B, 0xF6A0, 0x9C3C, 0xF740, 0x9C3D, 0xF741, 0x9C3E, 0xF742, 0x9C3F, 0xF743, 0x9C40, 0xF744, 0x9C41, 0xF745, 0x9C42, 0xF746, + 0x9C43, 0xF747, 0x9C44, 0xF748, 0x9C45, 0xF749, 0x9C46, 0xF74A, 0x9C47, 0xF74B, 0x9C48, 0xF74C, 0x9C49, 0xF74D, 0x9C4A, 0xF74E, + 0x9C4B, 0xF74F, 0x9C4C, 0xF750, 0x9C4D, 0xF751, 0x9C4E, 0xF752, 0x9C4F, 0xF753, 0x9C50, 0xF754, 0x9C51, 0xF755, 0x9C52, 0xF756, + 0x9C53, 0xF757, 0x9C54, 0xF758, 0x9C55, 0xF759, 0x9C56, 0xF75A, 0x9C57, 0xF75B, 0x9C58, 0xF75C, 0x9C59, 0xF75D, 0x9C5A, 0xF75E, + 0x9C5B, 0xF75F, 0x9C5C, 0xF760, 0x9C5D, 0xF761, 0x9C5E, 0xF762, 0x9C5F, 0xF763, 0x9C60, 0xF764, 0x9C61, 0xF765, 0x9C62, 0xF766, + 0x9C63, 0xF767, 0x9C64, 0xF768, 0x9C65, 0xF769, 0x9C66, 0xF76A, 0x9C67, 0xF76B, 0x9C68, 0xF76C, 0x9C69, 0xF76D, 0x9C6A, 0xF76E, + 0x9C6B, 0xF76F, 0x9C6C, 0xF770, 0x9C6D, 0xF771, 0x9C6E, 0xF772, 0x9C6F, 0xF773, 0x9C70, 0xF774, 0x9C71, 0xF775, 0x9C72, 0xF776, + 0x9C73, 0xF777, 0x9C74, 0xF778, 0x9C75, 0xF779, 0x9C76, 0xF77A, 0x9C77, 0xF77B, 0x9C78, 0xF77C, 0x9C79, 0xF77D, 0x9C7A, 0xF77E, + 0x9C7B, 0xF780, 0x9C7C, 0xD3E3, 0x9C7D, 0xF781, 0x9C7E, 0xF782, 0x9C7F, 0xF6CF, 0x9C80, 0xF783, 0x9C81, 0xC2B3, 0x9C82, 0xF6D0, + 0x9C83, 0xF784, 0x9C84, 0xF785, 0x9C85, 0xF6D1, 0x9C86, 0xF6D2, 0x9C87, 0xF6D3, 0x9C88, 0xF6D4, 0x9C89, 0xF786, 0x9C8A, 0xF787, + 0x9C8B, 0xF6D6, 0x9C8C, 0xF788, 0x9C8D, 0xB1AB, 0x9C8E, 0xF6D7, 0x9C8F, 0xF789, 0x9C90, 0xF6D8, 0x9C91, 0xF6D9, 0x9C92, 0xF6DA, + 0x9C93, 0xF78A, 0x9C94, 0xF6DB, 0x9C95, 0xF6DC, 0x9C96, 0xF78B, 0x9C97, 0xF78C, 0x9C98, 0xF78D, 0x9C99, 0xF78E, 0x9C9A, 0xF6DD, + 0x9C9B, 0xF6DE, 0x9C9C, 0xCFCA, 0x9C9D, 0xF78F, 0x9C9E, 0xF6DF, 0x9C9F, 0xF6E0, 0x9CA0, 0xF6E1, 0x9CA1, 0xF6E2, 0x9CA2, 0xF6E3, + 0x9CA3, 0xF6E4, 0x9CA4, 0xC0F0, 0x9CA5, 0xF6E5, 0x9CA6, 0xF6E6, 0x9CA7, 0xF6E7, 0x9CA8, 0xF6E8, 0x9CA9, 0xF6E9, 0x9CAA, 0xF790, + 0x9CAB, 0xF6EA, 0x9CAC, 0xF791, 0x9CAD, 0xF6EB, 0x9CAE, 0xF6EC, 0x9CAF, 0xF792, 0x9CB0, 0xF6ED, 0x9CB1, 0xF6EE, 0x9CB2, 0xF6EF, + 0x9CB3, 0xF6F0, 0x9CB4, 0xF6F1, 0x9CB5, 0xF6F2, 0x9CB6, 0xF6F3, 0x9CB7, 0xF6F4, 0x9CB8, 0xBEA8, 0x9CB9, 0xF793, 0x9CBA, 0xF6F5, + 0x9CBB, 0xF6F6, 0x9CBC, 0xF6F7, 0x9CBD, 0xF6F8, 0x9CBE, 0xF794, 0x9CBF, 0xF795, 0x9CC0, 0xF796, 0x9CC1, 0xF797, 0x9CC2, 0xF798, + 0x9CC3, 0xC8FA, 0x9CC4, 0xF6F9, 0x9CC5, 0xF6FA, 0x9CC6, 0xF6FB, 0x9CC7, 0xF6FC, 0x9CC8, 0xF799, 0x9CC9, 0xF79A, 0x9CCA, 0xF6FD, + 0x9CCB, 0xF6FE, 0x9CCC, 0xF7A1, 0x9CCD, 0xF7A2, 0x9CCE, 0xF7A3, 0x9CCF, 0xF7A4, 0x9CD0, 0xF7A5, 0x9CD1, 0xF79B, 0x9CD2, 0xF79C, + 0x9CD3, 0xF7A6, 0x9CD4, 0xF7A7, 0x9CD5, 0xF7A8, 0x9CD6, 0xB1EE, 0x9CD7, 0xF7A9, 0x9CD8, 0xF7AA, 0x9CD9, 0xF7AB, 0x9CDA, 0xF79D, + 0x9CDB, 0xF79E, 0x9CDC, 0xF7AC, 0x9CDD, 0xF7AD, 0x9CDE, 0xC1DB, 0x9CDF, 0xF7AE, 0x9CE0, 0xF79F, 0x9CE1, 0xF7A0, 0x9CE2, 0xF7AF, + 0x9CE3, 0xF840, 0x9CE4, 0xF841, 0x9CE5, 0xF842, 0x9CE6, 0xF843, 0x9CE7, 0xF844, 0x9CE8, 0xF845, 0x9CE9, 0xF846, 0x9CEA, 0xF847, + 0x9CEB, 0xF848, 0x9CEC, 0xF849, 0x9CED, 0xF84A, 0x9CEE, 0xF84B, 0x9CEF, 0xF84C, 0x9CF0, 0xF84D, 0x9CF1, 0xF84E, 0x9CF2, 0xF84F, + 0x9CF3, 0xF850, 0x9CF4, 0xF851, 0x9CF5, 0xF852, 0x9CF6, 0xF853, 0x9CF7, 0xF854, 0x9CF8, 0xF855, 0x9CF9, 0xF856, 0x9CFA, 0xF857, + 0x9CFB, 0xF858, 0x9CFC, 0xF859, 0x9CFD, 0xF85A, 0x9CFE, 0xF85B, 0x9CFF, 0xF85C, 0x9D00, 0xF85D, 0x9D01, 0xF85E, 0x9D02, 0xF85F, + 0x9D03, 0xF860, 0x9D04, 0xF861, 0x9D05, 0xF862, 0x9D06, 0xF863, 0x9D07, 0xF864, 0x9D08, 0xF865, 0x9D09, 0xF866, 0x9D0A, 0xF867, + 0x9D0B, 0xF868, 0x9D0C, 0xF869, 0x9D0D, 0xF86A, 0x9D0E, 0xF86B, 0x9D0F, 0xF86C, 0x9D10, 0xF86D, 0x9D11, 0xF86E, 0x9D12, 0xF86F, + 0x9D13, 0xF870, 0x9D14, 0xF871, 0x9D15, 0xF872, 0x9D16, 0xF873, 0x9D17, 0xF874, 0x9D18, 0xF875, 0x9D19, 0xF876, 0x9D1A, 0xF877, + 0x9D1B, 0xF878, 0x9D1C, 0xF879, 0x9D1D, 0xF87A, 0x9D1E, 0xF87B, 0x9D1F, 0xF87C, 0x9D20, 0xF87D, 0x9D21, 0xF87E, 0x9D22, 0xF880, + 0x9D23, 0xF881, 0x9D24, 0xF882, 0x9D25, 0xF883, 0x9D26, 0xF884, 0x9D27, 0xF885, 0x9D28, 0xF886, 0x9D29, 0xF887, 0x9D2A, 0xF888, + 0x9D2B, 0xF889, 0x9D2C, 0xF88A, 0x9D2D, 0xF88B, 0x9D2E, 0xF88C, 0x9D2F, 0xF88D, 0x9D30, 0xF88E, 0x9D31, 0xF88F, 0x9D32, 0xF890, + 0x9D33, 0xF891, 0x9D34, 0xF892, 0x9D35, 0xF893, 0x9D36, 0xF894, 0x9D37, 0xF895, 0x9D38, 0xF896, 0x9D39, 0xF897, 0x9D3A, 0xF898, + 0x9D3B, 0xF899, 0x9D3C, 0xF89A, 0x9D3D, 0xF89B, 0x9D3E, 0xF89C, 0x9D3F, 0xF89D, 0x9D40, 0xF89E, 0x9D41, 0xF89F, 0x9D42, 0xF8A0, + 0x9D43, 0xF940, 0x9D44, 0xF941, 0x9D45, 0xF942, 0x9D46, 0xF943, 0x9D47, 0xF944, 0x9D48, 0xF945, 0x9D49, 0xF946, 0x9D4A, 0xF947, + 0x9D4B, 0xF948, 0x9D4C, 0xF949, 0x9D4D, 0xF94A, 0x9D4E, 0xF94B, 0x9D4F, 0xF94C, 0x9D50, 0xF94D, 0x9D51, 0xF94E, 0x9D52, 0xF94F, + 0x9D53, 0xF950, 0x9D54, 0xF951, 0x9D55, 0xF952, 0x9D56, 0xF953, 0x9D57, 0xF954, 0x9D58, 0xF955, 0x9D59, 0xF956, 0x9D5A, 0xF957, + 0x9D5B, 0xF958, 0x9D5C, 0xF959, 0x9D5D, 0xF95A, 0x9D5E, 0xF95B, 0x9D5F, 0xF95C, 0x9D60, 0xF95D, 0x9D61, 0xF95E, 0x9D62, 0xF95F, + 0x9D63, 0xF960, 0x9D64, 0xF961, 0x9D65, 0xF962, 0x9D66, 0xF963, 0x9D67, 0xF964, 0x9D68, 0xF965, 0x9D69, 0xF966, 0x9D6A, 0xF967, + 0x9D6B, 0xF968, 0x9D6C, 0xF969, 0x9D6D, 0xF96A, 0x9D6E, 0xF96B, 0x9D6F, 0xF96C, 0x9D70, 0xF96D, 0x9D71, 0xF96E, 0x9D72, 0xF96F, + 0x9D73, 0xF970, 0x9D74, 0xF971, 0x9D75, 0xF972, 0x9D76, 0xF973, 0x9D77, 0xF974, 0x9D78, 0xF975, 0x9D79, 0xF976, 0x9D7A, 0xF977, + 0x9D7B, 0xF978, 0x9D7C, 0xF979, 0x9D7D, 0xF97A, 0x9D7E, 0xF97B, 0x9D7F, 0xF97C, 0x9D80, 0xF97D, 0x9D81, 0xF97E, 0x9D82, 0xF980, + 0x9D83, 0xF981, 0x9D84, 0xF982, 0x9D85, 0xF983, 0x9D86, 0xF984, 0x9D87, 0xF985, 0x9D88, 0xF986, 0x9D89, 0xF987, 0x9D8A, 0xF988, + 0x9D8B, 0xF989, 0x9D8C, 0xF98A, 0x9D8D, 0xF98B, 0x9D8E, 0xF98C, 0x9D8F, 0xF98D, 0x9D90, 0xF98E, 0x9D91, 0xF98F, 0x9D92, 0xF990, + 0x9D93, 0xF991, 0x9D94, 0xF992, 0x9D95, 0xF993, 0x9D96, 0xF994, 0x9D97, 0xF995, 0x9D98, 0xF996, 0x9D99, 0xF997, 0x9D9A, 0xF998, + 0x9D9B, 0xF999, 0x9D9C, 0xF99A, 0x9D9D, 0xF99B, 0x9D9E, 0xF99C, 0x9D9F, 0xF99D, 0x9DA0, 0xF99E, 0x9DA1, 0xF99F, 0x9DA2, 0xF9A0, + 0x9DA3, 0xFA40, 0x9DA4, 0xFA41, 0x9DA5, 0xFA42, 0x9DA6, 0xFA43, 0x9DA7, 0xFA44, 0x9DA8, 0xFA45, 0x9DA9, 0xFA46, 0x9DAA, 0xFA47, + 0x9DAB, 0xFA48, 0x9DAC, 0xFA49, 0x9DAD, 0xFA4A, 0x9DAE, 0xFA4B, 0x9DAF, 0xFA4C, 0x9DB0, 0xFA4D, 0x9DB1, 0xFA4E, 0x9DB2, 0xFA4F, + 0x9DB3, 0xFA50, 0x9DB4, 0xFA51, 0x9DB5, 0xFA52, 0x9DB6, 0xFA53, 0x9DB7, 0xFA54, 0x9DB8, 0xFA55, 0x9DB9, 0xFA56, 0x9DBA, 0xFA57, + 0x9DBB, 0xFA58, 0x9DBC, 0xFA59, 0x9DBD, 0xFA5A, 0x9DBE, 0xFA5B, 0x9DBF, 0xFA5C, 0x9DC0, 0xFA5D, 0x9DC1, 0xFA5E, 0x9DC2, 0xFA5F, + 0x9DC3, 0xFA60, 0x9DC4, 0xFA61, 0x9DC5, 0xFA62, 0x9DC6, 0xFA63, 0x9DC7, 0xFA64, 0x9DC8, 0xFA65, 0x9DC9, 0xFA66, 0x9DCA, 0xFA67, + 0x9DCB, 0xFA68, 0x9DCC, 0xFA69, 0x9DCD, 0xFA6A, 0x9DCE, 0xFA6B, 0x9DCF, 0xFA6C, 0x9DD0, 0xFA6D, 0x9DD1, 0xFA6E, 0x9DD2, 0xFA6F, + 0x9DD3, 0xFA70, 0x9DD4, 0xFA71, 0x9DD5, 0xFA72, 0x9DD6, 0xFA73, 0x9DD7, 0xFA74, 0x9DD8, 0xFA75, 0x9DD9, 0xFA76, 0x9DDA, 0xFA77, + 0x9DDB, 0xFA78, 0x9DDC, 0xFA79, 0x9DDD, 0xFA7A, 0x9DDE, 0xFA7B, 0x9DDF, 0xFA7C, 0x9DE0, 0xFA7D, 0x9DE1, 0xFA7E, 0x9DE2, 0xFA80, + 0x9DE3, 0xFA81, 0x9DE4, 0xFA82, 0x9DE5, 0xFA83, 0x9DE6, 0xFA84, 0x9DE7, 0xFA85, 0x9DE8, 0xFA86, 0x9DE9, 0xFA87, 0x9DEA, 0xFA88, + 0x9DEB, 0xFA89, 0x9DEC, 0xFA8A, 0x9DED, 0xFA8B, 0x9DEE, 0xFA8C, 0x9DEF, 0xFA8D, 0x9DF0, 0xFA8E, 0x9DF1, 0xFA8F, 0x9DF2, 0xFA90, + 0x9DF3, 0xFA91, 0x9DF4, 0xFA92, 0x9DF5, 0xFA93, 0x9DF6, 0xFA94, 0x9DF7, 0xFA95, 0x9DF8, 0xFA96, 0x9DF9, 0xFA97, 0x9DFA, 0xFA98, + 0x9DFB, 0xFA99, 0x9DFC, 0xFA9A, 0x9DFD, 0xFA9B, 0x9DFE, 0xFA9C, 0x9DFF, 0xFA9D, 0x9E00, 0xFA9E, 0x9E01, 0xFA9F, 0x9E02, 0xFAA0, + 0x9E03, 0xFB40, 0x9E04, 0xFB41, 0x9E05, 0xFB42, 0x9E06, 0xFB43, 0x9E07, 0xFB44, 0x9E08, 0xFB45, 0x9E09, 0xFB46, 0x9E0A, 0xFB47, + 0x9E0B, 0xFB48, 0x9E0C, 0xFB49, 0x9E0D, 0xFB4A, 0x9E0E, 0xFB4B, 0x9E0F, 0xFB4C, 0x9E10, 0xFB4D, 0x9E11, 0xFB4E, 0x9E12, 0xFB4F, + 0x9E13, 0xFB50, 0x9E14, 0xFB51, 0x9E15, 0xFB52, 0x9E16, 0xFB53, 0x9E17, 0xFB54, 0x9E18, 0xFB55, 0x9E19, 0xFB56, 0x9E1A, 0xFB57, + 0x9E1B, 0xFB58, 0x9E1C, 0xFB59, 0x9E1D, 0xFB5A, 0x9E1E, 0xFB5B, 0x9E1F, 0xC4F1, 0x9E20, 0xF0AF, 0x9E21, 0xBCA6, 0x9E22, 0xF0B0, + 0x9E23, 0xC3F9, 0x9E24, 0xFB5C, 0x9E25, 0xC5B8, 0x9E26, 0xD1BB, 0x9E27, 0xFB5D, 0x9E28, 0xF0B1, 0x9E29, 0xF0B2, 0x9E2A, 0xF0B3, + 0x9E2B, 0xF0B4, 0x9E2C, 0xF0B5, 0x9E2D, 0xD1BC, 0x9E2E, 0xFB5E, 0x9E2F, 0xD1EC, 0x9E30, 0xFB5F, 0x9E31, 0xF0B7, 0x9E32, 0xF0B6, + 0x9E33, 0xD4A7, 0x9E34, 0xFB60, 0x9E35, 0xCDD2, 0x9E36, 0xF0B8, 0x9E37, 0xF0BA, 0x9E38, 0xF0B9, 0x9E39, 0xF0BB, 0x9E3A, 0xF0BC, + 0x9E3B, 0xFB61, 0x9E3C, 0xFB62, 0x9E3D, 0xB8EB, 0x9E3E, 0xF0BD, 0x9E3F, 0xBAE8, 0x9E40, 0xFB63, 0x9E41, 0xF0BE, 0x9E42, 0xF0BF, + 0x9E43, 0xBEE9, 0x9E44, 0xF0C0, 0x9E45, 0xB6EC, 0x9E46, 0xF0C1, 0x9E47, 0xF0C2, 0x9E48, 0xF0C3, 0x9E49, 0xF0C4, 0x9E4A, 0xC8B5, + 0x9E4B, 0xF0C5, 0x9E4C, 0xF0C6, 0x9E4D, 0xFB64, 0x9E4E, 0xF0C7, 0x9E4F, 0xC5F4, 0x9E50, 0xFB65, 0x9E51, 0xF0C8, 0x9E52, 0xFB66, + 0x9E53, 0xFB67, 0x9E54, 0xFB68, 0x9E55, 0xF0C9, 0x9E56, 0xFB69, 0x9E57, 0xF0CA, 0x9E58, 0xF7BD, 0x9E59, 0xFB6A, 0x9E5A, 0xF0CB, + 0x9E5B, 0xF0CC, 0x9E5C, 0xF0CD, 0x9E5D, 0xFB6B, 0x9E5E, 0xF0CE, 0x9E5F, 0xFB6C, 0x9E60, 0xFB6D, 0x9E61, 0xFB6E, 0x9E62, 0xFB6F, + 0x9E63, 0xF0CF, 0x9E64, 0xBAD7, 0x9E65, 0xFB70, 0x9E66, 0xF0D0, 0x9E67, 0xF0D1, 0x9E68, 0xF0D2, 0x9E69, 0xF0D3, 0x9E6A, 0xF0D4, + 0x9E6B, 0xF0D5, 0x9E6C, 0xF0D6, 0x9E6D, 0xF0D8, 0x9E6E, 0xFB71, 0x9E6F, 0xFB72, 0x9E70, 0xD3A5, 0x9E71, 0xF0D7, 0x9E72, 0xFB73, + 0x9E73, 0xF0D9, 0x9E74, 0xFB74, 0x9E75, 0xFB75, 0x9E76, 0xFB76, 0x9E77, 0xFB77, 0x9E78, 0xFB78, 0x9E79, 0xFB79, 0x9E7A, 0xFB7A, + 0x9E7B, 0xFB7B, 0x9E7C, 0xFB7C, 0x9E7D, 0xFB7D, 0x9E7E, 0xF5BA, 0x9E7F, 0xC2B9, 0x9E80, 0xFB7E, 0x9E81, 0xFB80, 0x9E82, 0xF7E4, + 0x9E83, 0xFB81, 0x9E84, 0xFB82, 0x9E85, 0xFB83, 0x9E86, 0xFB84, 0x9E87, 0xF7E5, 0x9E88, 0xF7E6, 0x9E89, 0xFB85, 0x9E8A, 0xFB86, + 0x9E8B, 0xF7E7, 0x9E8C, 0xFB87, 0x9E8D, 0xFB88, 0x9E8E, 0xFB89, 0x9E8F, 0xFB8A, 0x9E90, 0xFB8B, 0x9E91, 0xFB8C, 0x9E92, 0xF7E8, + 0x9E93, 0xC2B4, 0x9E94, 0xFB8D, 0x9E95, 0xFB8E, 0x9E96, 0xFB8F, 0x9E97, 0xFB90, 0x9E98, 0xFB91, 0x9E99, 0xFB92, 0x9E9A, 0xFB93, + 0x9E9B, 0xFB94, 0x9E9C, 0xFB95, 0x9E9D, 0xF7EA, 0x9E9E, 0xFB96, 0x9E9F, 0xF7EB, 0x9EA0, 0xFB97, 0x9EA1, 0xFB98, 0x9EA2, 0xFB99, + 0x9EA3, 0xFB9A, 0x9EA4, 0xFB9B, 0x9EA5, 0xFB9C, 0x9EA6, 0xC2F3, 0x9EA7, 0xFB9D, 0x9EA8, 0xFB9E, 0x9EA9, 0xFB9F, 0x9EAA, 0xFBA0, + 0x9EAB, 0xFC40, 0x9EAC, 0xFC41, 0x9EAD, 0xFC42, 0x9EAE, 0xFC43, 0x9EAF, 0xFC44, 0x9EB0, 0xFC45, 0x9EB1, 0xFC46, 0x9EB2, 0xFC47, + 0x9EB3, 0xFC48, 0x9EB4, 0xF4F0, 0x9EB5, 0xFC49, 0x9EB6, 0xFC4A, 0x9EB7, 0xFC4B, 0x9EB8, 0xF4EF, 0x9EB9, 0xFC4C, 0x9EBA, 0xFC4D, + 0x9EBB, 0xC2E9, 0x9EBC, 0xFC4E, 0x9EBD, 0xF7E1, 0x9EBE, 0xF7E2, 0x9EBF, 0xFC4F, 0x9EC0, 0xFC50, 0x9EC1, 0xFC51, 0x9EC2, 0xFC52, + 0x9EC3, 0xFC53, 0x9EC4, 0xBBC6, 0x9EC5, 0xFC54, 0x9EC6, 0xFC55, 0x9EC7, 0xFC56, 0x9EC8, 0xFC57, 0x9EC9, 0xD9E4, 0x9ECA, 0xFC58, + 0x9ECB, 0xFC59, 0x9ECC, 0xFC5A, 0x9ECD, 0xCAF2, 0x9ECE, 0xC0E8, 0x9ECF, 0xF0A4, 0x9ED0, 0xFC5B, 0x9ED1, 0xBADA, 0x9ED2, 0xFC5C, + 0x9ED3, 0xFC5D, 0x9ED4, 0xC7AD, 0x9ED5, 0xFC5E, 0x9ED6, 0xFC5F, 0x9ED7, 0xFC60, 0x9ED8, 0xC4AC, 0x9ED9, 0xFC61, 0x9EDA, 0xFC62, + 0x9EDB, 0xF7EC, 0x9EDC, 0xF7ED, 0x9EDD, 0xF7EE, 0x9EDE, 0xFC63, 0x9EDF, 0xF7F0, 0x9EE0, 0xF7EF, 0x9EE1, 0xFC64, 0x9EE2, 0xF7F1, + 0x9EE3, 0xFC65, 0x9EE4, 0xFC66, 0x9EE5, 0xF7F4, 0x9EE6, 0xFC67, 0x9EE7, 0xF7F3, 0x9EE8, 0xFC68, 0x9EE9, 0xF7F2, 0x9EEA, 0xF7F5, + 0x9EEB, 0xFC69, 0x9EEC, 0xFC6A, 0x9EED, 0xFC6B, 0x9EEE, 0xFC6C, 0x9EEF, 0xF7F6, 0x9EF0, 0xFC6D, 0x9EF1, 0xFC6E, 0x9EF2, 0xFC6F, + 0x9EF3, 0xFC70, 0x9EF4, 0xFC71, 0x9EF5, 0xFC72, 0x9EF6, 0xFC73, 0x9EF7, 0xFC74, 0x9EF8, 0xFC75, 0x9EF9, 0xEDE9, 0x9EFA, 0xFC76, + 0x9EFB, 0xEDEA, 0x9EFC, 0xEDEB, 0x9EFD, 0xFC77, 0x9EFE, 0xF6BC, 0x9EFF, 0xFC78, 0x9F00, 0xFC79, 0x9F01, 0xFC7A, 0x9F02, 0xFC7B, + 0x9F03, 0xFC7C, 0x9F04, 0xFC7D, 0x9F05, 0xFC7E, 0x9F06, 0xFC80, 0x9F07, 0xFC81, 0x9F08, 0xFC82, 0x9F09, 0xFC83, 0x9F0A, 0xFC84, + 0x9F0B, 0xF6BD, 0x9F0C, 0xFC85, 0x9F0D, 0xF6BE, 0x9F0E, 0xB6A6, 0x9F0F, 0xFC86, 0x9F10, 0xD8BE, 0x9F11, 0xFC87, 0x9F12, 0xFC88, + 0x9F13, 0xB9C4, 0x9F14, 0xFC89, 0x9F15, 0xFC8A, 0x9F16, 0xFC8B, 0x9F17, 0xD8BB, 0x9F18, 0xFC8C, 0x9F19, 0xDCB1, 0x9F1A, 0xFC8D, + 0x9F1B, 0xFC8E, 0x9F1C, 0xFC8F, 0x9F1D, 0xFC90, 0x9F1E, 0xFC91, 0x9F1F, 0xFC92, 0x9F20, 0xCAF3, 0x9F21, 0xFC93, 0x9F22, 0xF7F7, + 0x9F23, 0xFC94, 0x9F24, 0xFC95, 0x9F25, 0xFC96, 0x9F26, 0xFC97, 0x9F27, 0xFC98, 0x9F28, 0xFC99, 0x9F29, 0xFC9A, 0x9F2A, 0xFC9B, + 0x9F2B, 0xFC9C, 0x9F2C, 0xF7F8, 0x9F2D, 0xFC9D, 0x9F2E, 0xFC9E, 0x9F2F, 0xF7F9, 0x9F30, 0xFC9F, 0x9F31, 0xFCA0, 0x9F32, 0xFD40, + 0x9F33, 0xFD41, 0x9F34, 0xFD42, 0x9F35, 0xFD43, 0x9F36, 0xFD44, 0x9F37, 0xF7FB, 0x9F38, 0xFD45, 0x9F39, 0xF7FA, 0x9F3A, 0xFD46, + 0x9F3B, 0xB1C7, 0x9F3C, 0xFD47, 0x9F3D, 0xF7FC, 0x9F3E, 0xF7FD, 0x9F3F, 0xFD48, 0x9F40, 0xFD49, 0x9F41, 0xFD4A, 0x9F42, 0xFD4B, + 0x9F43, 0xFD4C, 0x9F44, 0xF7FE, 0x9F45, 0xFD4D, 0x9F46, 0xFD4E, 0x9F47, 0xFD4F, 0x9F48, 0xFD50, 0x9F49, 0xFD51, 0x9F4A, 0xFD52, + 0x9F4B, 0xFD53, 0x9F4C, 0xFD54, 0x9F4D, 0xFD55, 0x9F4E, 0xFD56, 0x9F4F, 0xFD57, 0x9F50, 0xC6EB, 0x9F51, 0xECB4, 0x9F52, 0xFD58, + 0x9F53, 0xFD59, 0x9F54, 0xFD5A, 0x9F55, 0xFD5B, 0x9F56, 0xFD5C, 0x9F57, 0xFD5D, 0x9F58, 0xFD5E, 0x9F59, 0xFD5F, 0x9F5A, 0xFD60, + 0x9F5B, 0xFD61, 0x9F5C, 0xFD62, 0x9F5D, 0xFD63, 0x9F5E, 0xFD64, 0x9F5F, 0xFD65, 0x9F60, 0xFD66, 0x9F61, 0xFD67, 0x9F62, 0xFD68, + 0x9F63, 0xFD69, 0x9F64, 0xFD6A, 0x9F65, 0xFD6B, 0x9F66, 0xFD6C, 0x9F67, 0xFD6D, 0x9F68, 0xFD6E, 0x9F69, 0xFD6F, 0x9F6A, 0xFD70, + 0x9F6B, 0xFD71, 0x9F6C, 0xFD72, 0x9F6D, 0xFD73, 0x9F6E, 0xFD74, 0x9F6F, 0xFD75, 0x9F70, 0xFD76, 0x9F71, 0xFD77, 0x9F72, 0xFD78, + 0x9F73, 0xFD79, 0x9F74, 0xFD7A, 0x9F75, 0xFD7B, 0x9F76, 0xFD7C, 0x9F77, 0xFD7D, 0x9F78, 0xFD7E, 0x9F79, 0xFD80, 0x9F7A, 0xFD81, + 0x9F7B, 0xFD82, 0x9F7C, 0xFD83, 0x9F7D, 0xFD84, 0x9F7E, 0xFD85, 0x9F7F, 0xB3DD, 0x9F80, 0xF6B3, 0x9F81, 0xFD86, 0x9F82, 0xFD87, + 0x9F83, 0xF6B4, 0x9F84, 0xC1E4, 0x9F85, 0xF6B5, 0x9F86, 0xF6B6, 0x9F87, 0xF6B7, 0x9F88, 0xF6B8, 0x9F89, 0xF6B9, 0x9F8A, 0xF6BA, + 0x9F8B, 0xC8A3, 0x9F8C, 0xF6BB, 0x9F8D, 0xFD88, 0x9F8E, 0xFD89, 0x9F8F, 0xFD8A, 0x9F90, 0xFD8B, 0x9F91, 0xFD8C, 0x9F92, 0xFD8D, + 0x9F93, 0xFD8E, 0x9F94, 0xFD8F, 0x9F95, 0xFD90, 0x9F96, 0xFD91, 0x9F97, 0xFD92, 0x9F98, 0xFD93, 0x9F99, 0xC1FA, 0x9F9A, 0xB9A8, + 0x9F9B, 0xEDE8, 0x9F9C, 0xFD94, 0x9F9D, 0xFD95, 0x9F9E, 0xFD96, 0x9F9F, 0xB9EA, 0x9FA0, 0xD9DF, 0x9FA1, 0xFD97, 0x9FA2, 0xFD98, + 0x9FA3, 0xFD99, 0x9FA4, 0xFD9A, 0x9FA5, 0xFD9B, 0xF92C, 0xFD9C, 0xF979, 0xFD9D, 0xF995, 0xFD9E, 0xF9E7, 0xFD9F, 0xF9F1, 0xFDA0, + 0xFA0C, 0xFE40, 0xFA0D, 0xFE41, 0xFA0E, 0xFE42, 0xFA0F, 0xFE43, 0xFA11, 0xFE44, 0xFA13, 0xFE45, 0xFA14, 0xFE46, 0xFA18, 0xFE47, + 0xFA1F, 0xFE48, 0xFA20, 0xFE49, 0xFA21, 0xFE4A, 0xFA23, 0xFE4B, 0xFA24, 0xFE4C, 0xFA27, 0xFE4D, 0xFA28, 0xFE4E, 0xFA29, 0xFE4F, + 0xFE30, 0xA955, 0xFE31, 0xA6F2, 0xFE33, 0xA6F4, 0xFE34, 0xA6F5, 0xFE35, 0xA6E0, 0xFE36, 0xA6E1, 0xFE37, 0xA6F0, 0xFE38, 0xA6F1, + 0xFE39, 0xA6E2, 0xFE3A, 0xA6E3, 0xFE3B, 0xA6EE, 0xFE3C, 0xA6EF, 0xFE3D, 0xA6E6, 0xFE3E, 0xA6E7, 0xFE3F, 0xA6E4, 0xFE40, 0xA6E5, + 0xFE41, 0xA6E8, 0xFE42, 0xA6E9, 0xFE43, 0xA6EA, 0xFE44, 0xA6EB, 0xFE49, 0xA968, 0xFE4A, 0xA969, 0xFE4B, 0xA96A, 0xFE4C, 0xA96B, + 0xFE4D, 0xA96C, 0xFE4E, 0xA96D, 0xFE4F, 0xA96E, 0xFE50, 0xA96F, 0xFE51, 0xA970, 0xFE52, 0xA971, 0xFE54, 0xA972, 0xFE55, 0xA973, + 0xFE56, 0xA974, 0xFE57, 0xA975, 0xFE59, 0xA976, 0xFE5A, 0xA977, 0xFE5B, 0xA978, 0xFE5C, 0xA979, 0xFE5D, 0xA97A, 0xFE5E, 0xA97B, + 0xFE5F, 0xA97C, 0xFE60, 0xA97D, 0xFE61, 0xA97E, 0xFE62, 0xA980, 0xFE63, 0xA981, 0xFE64, 0xA982, 0xFE65, 0xA983, 0xFE66, 0xA984, + 0xFE68, 0xA985, 0xFE69, 0xA986, 0xFE6A, 0xA987, 0xFE6B, 0xA988, 0xFF01, 0xA3A1, 0xFF02, 0xA3A2, 0xFF03, 0xA3A3, 0xFF04, 0xA1E7, + 0xFF05, 0xA3A5, 0xFF06, 0xA3A6, 0xFF07, 0xA3A7, 0xFF08, 0xA3A8, 0xFF09, 0xA3A9, 0xFF0A, 0xA3AA, 0xFF0B, 0xA3AB, 0xFF0C, 0xA3AC, + 0xFF0D, 0xA3AD, 0xFF0E, 0xA3AE, 0xFF0F, 0xA3AF, 0xFF10, 0xA3B0, 0xFF11, 0xA3B1, 0xFF12, 0xA3B2, 0xFF13, 0xA3B3, 0xFF14, 0xA3B4, + 0xFF15, 0xA3B5, 0xFF16, 0xA3B6, 0xFF17, 0xA3B7, 0xFF18, 0xA3B8, 0xFF19, 0xA3B9, 0xFF1A, 0xA3BA, 0xFF1B, 0xA3BB, 0xFF1C, 0xA3BC, + 0xFF1D, 0xA3BD, 0xFF1E, 0xA3BE, 0xFF1F, 0xA3BF, 0xFF20, 0xA3C0, 0xFF21, 0xA3C1, 0xFF22, 0xA3C2, 0xFF23, 0xA3C3, 0xFF24, 0xA3C4, + 0xFF25, 0xA3C5, 0xFF26, 0xA3C6, 0xFF27, 0xA3C7, 0xFF28, 0xA3C8, 0xFF29, 0xA3C9, 0xFF2A, 0xA3CA, 0xFF2B, 0xA3CB, 0xFF2C, 0xA3CC, + 0xFF2D, 0xA3CD, 0xFF2E, 0xA3CE, 0xFF2F, 0xA3CF, 0xFF30, 0xA3D0, 0xFF31, 0xA3D1, 0xFF32, 0xA3D2, 0xFF33, 0xA3D3, 0xFF34, 0xA3D4, + 0xFF35, 0xA3D5, 0xFF36, 0xA3D6, 0xFF37, 0xA3D7, 0xFF38, 0xA3D8, 0xFF39, 0xA3D9, 0xFF3A, 0xA3DA, 0xFF3B, 0xA3DB, 0xFF3C, 0xA3DC, + 0xFF3D, 0xA3DD, 0xFF3E, 0xA3DE, 0xFF3F, 0xA3DF, 0xFF40, 0xA3E0, 0xFF41, 0xA3E1, 0xFF42, 0xA3E2, 0xFF43, 0xA3E3, 0xFF44, 0xA3E4, + 0xFF45, 0xA3E5, 0xFF46, 0xA3E6, 0xFF47, 0xA3E7, 0xFF48, 0xA3E8, 0xFF49, 0xA3E9, 0xFF4A, 0xA3EA, 0xFF4B, 0xA3EB, 0xFF4C, 0xA3EC, + 0xFF4D, 0xA3ED, 0xFF4E, 0xA3EE, 0xFF4F, 0xA3EF, 0xFF50, 0xA3F0, 0xFF51, 0xA3F1, 0xFF52, 0xA3F2, 0xFF53, 0xA3F3, 0xFF54, 0xA3F4, + 0xFF55, 0xA3F5, 0xFF56, 0xA3F6, 0xFF57, 0xA3F7, 0xFF58, 0xA3F8, 0xFF59, 0xA3F9, 0xFF5A, 0xA3FA, 0xFF5B, 0xA3FB, 0xFF5C, 0xA3FC, + 0xFF5D, 0xA3FD, 0xFF5E, 0xA1AB, 0xFFE0, 0xA1E9, 0xFFE1, 0xA1EA, 0xFFE2, 0xA956, 0xFFE3, 0xA3FE, 0xFFE4, 0xA957, 0xFFE5, 0xA3A4, + 0, 0 +}; + +static const WCHAR oem2uni936[] = { /* GBK --> Unicode pairs */ + 0x0080, 0x20AC, 0x8140, 0x4E02, 0x8141, 0x4E04, 0x8142, 0x4E05, 0x8143, 0x4E06, 0x8144, 0x4E0F, 0x8145, 0x4E12, 0x8146, 0x4E17, + 0x8147, 0x4E1F, 0x8148, 0x4E20, 0x8149, 0x4E21, 0x814A, 0x4E23, 0x814B, 0x4E26, 0x814C, 0x4E29, 0x814D, 0x4E2E, 0x814E, 0x4E2F, + 0x814F, 0x4E31, 0x8150, 0x4E33, 0x8151, 0x4E35, 0x8152, 0x4E37, 0x8153, 0x4E3C, 0x8154, 0x4E40, 0x8155, 0x4E41, 0x8156, 0x4E42, + 0x8157, 0x4E44, 0x8158, 0x4E46, 0x8159, 0x4E4A, 0x815A, 0x4E51, 0x815B, 0x4E55, 0x815C, 0x4E57, 0x815D, 0x4E5A, 0x815E, 0x4E5B, + 0x815F, 0x4E62, 0x8160, 0x4E63, 0x8161, 0x4E64, 0x8162, 0x4E65, 0x8163, 0x4E67, 0x8164, 0x4E68, 0x8165, 0x4E6A, 0x8166, 0x4E6B, + 0x8167, 0x4E6C, 0x8168, 0x4E6D, 0x8169, 0x4E6E, 0x816A, 0x4E6F, 0x816B, 0x4E72, 0x816C, 0x4E74, 0x816D, 0x4E75, 0x816E, 0x4E76, + 0x816F, 0x4E77, 0x8170, 0x4E78, 0x8171, 0x4E79, 0x8172, 0x4E7A, 0x8173, 0x4E7B, 0x8174, 0x4E7C, 0x8175, 0x4E7D, 0x8176, 0x4E7F, + 0x8177, 0x4E80, 0x8178, 0x4E81, 0x8179, 0x4E82, 0x817A, 0x4E83, 0x817B, 0x4E84, 0x817C, 0x4E85, 0x817D, 0x4E87, 0x817E, 0x4E8A, + 0x8180, 0x4E90, 0x8181, 0x4E96, 0x8182, 0x4E97, 0x8183, 0x4E99, 0x8184, 0x4E9C, 0x8185, 0x4E9D, 0x8186, 0x4E9E, 0x8187, 0x4EA3, + 0x8188, 0x4EAA, 0x8189, 0x4EAF, 0x818A, 0x4EB0, 0x818B, 0x4EB1, 0x818C, 0x4EB4, 0x818D, 0x4EB6, 0x818E, 0x4EB7, 0x818F, 0x4EB8, + 0x8190, 0x4EB9, 0x8191, 0x4EBC, 0x8192, 0x4EBD, 0x8193, 0x4EBE, 0x8194, 0x4EC8, 0x8195, 0x4ECC, 0x8196, 0x4ECF, 0x8197, 0x4ED0, + 0x8198, 0x4ED2, 0x8199, 0x4EDA, 0x819A, 0x4EDB, 0x819B, 0x4EDC, 0x819C, 0x4EE0, 0x819D, 0x4EE2, 0x819E, 0x4EE6, 0x819F, 0x4EE7, + 0x81A0, 0x4EE9, 0x81A1, 0x4EED, 0x81A2, 0x4EEE, 0x81A3, 0x4EEF, 0x81A4, 0x4EF1, 0x81A5, 0x4EF4, 0x81A6, 0x4EF8, 0x81A7, 0x4EF9, + 0x81A8, 0x4EFA, 0x81A9, 0x4EFC, 0x81AA, 0x4EFE, 0x81AB, 0x4F00, 0x81AC, 0x4F02, 0x81AD, 0x4F03, 0x81AE, 0x4F04, 0x81AF, 0x4F05, + 0x81B0, 0x4F06, 0x81B1, 0x4F07, 0x81B2, 0x4F08, 0x81B3, 0x4F0B, 0x81B4, 0x4F0C, 0x81B5, 0x4F12, 0x81B6, 0x4F13, 0x81B7, 0x4F14, + 0x81B8, 0x4F15, 0x81B9, 0x4F16, 0x81BA, 0x4F1C, 0x81BB, 0x4F1D, 0x81BC, 0x4F21, 0x81BD, 0x4F23, 0x81BE, 0x4F28, 0x81BF, 0x4F29, + 0x81C0, 0x4F2C, 0x81C1, 0x4F2D, 0x81C2, 0x4F2E, 0x81C3, 0x4F31, 0x81C4, 0x4F33, 0x81C5, 0x4F35, 0x81C6, 0x4F37, 0x81C7, 0x4F39, + 0x81C8, 0x4F3B, 0x81C9, 0x4F3E, 0x81CA, 0x4F3F, 0x81CB, 0x4F40, 0x81CC, 0x4F41, 0x81CD, 0x4F42, 0x81CE, 0x4F44, 0x81CF, 0x4F45, + 0x81D0, 0x4F47, 0x81D1, 0x4F48, 0x81D2, 0x4F49, 0x81D3, 0x4F4A, 0x81D4, 0x4F4B, 0x81D5, 0x4F4C, 0x81D6, 0x4F52, 0x81D7, 0x4F54, + 0x81D8, 0x4F56, 0x81D9, 0x4F61, 0x81DA, 0x4F62, 0x81DB, 0x4F66, 0x81DC, 0x4F68, 0x81DD, 0x4F6A, 0x81DE, 0x4F6B, 0x81DF, 0x4F6D, + 0x81E0, 0x4F6E, 0x81E1, 0x4F71, 0x81E2, 0x4F72, 0x81E3, 0x4F75, 0x81E4, 0x4F77, 0x81E5, 0x4F78, 0x81E6, 0x4F79, 0x81E7, 0x4F7A, + 0x81E8, 0x4F7D, 0x81E9, 0x4F80, 0x81EA, 0x4F81, 0x81EB, 0x4F82, 0x81EC, 0x4F85, 0x81ED, 0x4F86, 0x81EE, 0x4F87, 0x81EF, 0x4F8A, + 0x81F0, 0x4F8C, 0x81F1, 0x4F8E, 0x81F2, 0x4F90, 0x81F3, 0x4F92, 0x81F4, 0x4F93, 0x81F5, 0x4F95, 0x81F6, 0x4F96, 0x81F7, 0x4F98, + 0x81F8, 0x4F99, 0x81F9, 0x4F9A, 0x81FA, 0x4F9C, 0x81FB, 0x4F9E, 0x81FC, 0x4F9F, 0x81FD, 0x4FA1, 0x81FE, 0x4FA2, 0x8240, 0x4FA4, + 0x8241, 0x4FAB, 0x8242, 0x4FAD, 0x8243, 0x4FB0, 0x8244, 0x4FB1, 0x8245, 0x4FB2, 0x8246, 0x4FB3, 0x8247, 0x4FB4, 0x8248, 0x4FB6, + 0x8249, 0x4FB7, 0x824A, 0x4FB8, 0x824B, 0x4FB9, 0x824C, 0x4FBA, 0x824D, 0x4FBB, 0x824E, 0x4FBC, 0x824F, 0x4FBD, 0x8250, 0x4FBE, + 0x8251, 0x4FC0, 0x8252, 0x4FC1, 0x8253, 0x4FC2, 0x8254, 0x4FC6, 0x8255, 0x4FC7, 0x8256, 0x4FC8, 0x8257, 0x4FC9, 0x8258, 0x4FCB, + 0x8259, 0x4FCC, 0x825A, 0x4FCD, 0x825B, 0x4FD2, 0x825C, 0x4FD3, 0x825D, 0x4FD4, 0x825E, 0x4FD5, 0x825F, 0x4FD6, 0x8260, 0x4FD9, + 0x8261, 0x4FDB, 0x8262, 0x4FE0, 0x8263, 0x4FE2, 0x8264, 0x4FE4, 0x8265, 0x4FE5, 0x8266, 0x4FE7, 0x8267, 0x4FEB, 0x8268, 0x4FEC, + 0x8269, 0x4FF0, 0x826A, 0x4FF2, 0x826B, 0x4FF4, 0x826C, 0x4FF5, 0x826D, 0x4FF6, 0x826E, 0x4FF7, 0x826F, 0x4FF9, 0x8270, 0x4FFB, + 0x8271, 0x4FFC, 0x8272, 0x4FFD, 0x8273, 0x4FFF, 0x8274, 0x5000, 0x8275, 0x5001, 0x8276, 0x5002, 0x8277, 0x5003, 0x8278, 0x5004, + 0x8279, 0x5005, 0x827A, 0x5006, 0x827B, 0x5007, 0x827C, 0x5008, 0x827D, 0x5009, 0x827E, 0x500A, 0x8280, 0x500B, 0x8281, 0x500E, + 0x8282, 0x5010, 0x8283, 0x5011, 0x8284, 0x5013, 0x8285, 0x5015, 0x8286, 0x5016, 0x8287, 0x5017, 0x8288, 0x501B, 0x8289, 0x501D, + 0x828A, 0x501E, 0x828B, 0x5020, 0x828C, 0x5022, 0x828D, 0x5023, 0x828E, 0x5024, 0x828F, 0x5027, 0x8290, 0x502B, 0x8291, 0x502F, + 0x8292, 0x5030, 0x8293, 0x5031, 0x8294, 0x5032, 0x8295, 0x5033, 0x8296, 0x5034, 0x8297, 0x5035, 0x8298, 0x5036, 0x8299, 0x5037, + 0x829A, 0x5038, 0x829B, 0x5039, 0x829C, 0x503B, 0x829D, 0x503D, 0x829E, 0x503F, 0x829F, 0x5040, 0x82A0, 0x5041, 0x82A1, 0x5042, + 0x82A2, 0x5044, 0x82A3, 0x5045, 0x82A4, 0x5046, 0x82A5, 0x5049, 0x82A6, 0x504A, 0x82A7, 0x504B, 0x82A8, 0x504D, 0x82A9, 0x5050, + 0x82AA, 0x5051, 0x82AB, 0x5052, 0x82AC, 0x5053, 0x82AD, 0x5054, 0x82AE, 0x5056, 0x82AF, 0x5057, 0x82B0, 0x5058, 0x82B1, 0x5059, + 0x82B2, 0x505B, 0x82B3, 0x505D, 0x82B4, 0x505E, 0x82B5, 0x505F, 0x82B6, 0x5060, 0x82B7, 0x5061, 0x82B8, 0x5062, 0x82B9, 0x5063, + 0x82BA, 0x5064, 0x82BB, 0x5066, 0x82BC, 0x5067, 0x82BD, 0x5068, 0x82BE, 0x5069, 0x82BF, 0x506A, 0x82C0, 0x506B, 0x82C1, 0x506D, + 0x82C2, 0x506E, 0x82C3, 0x506F, 0x82C4, 0x5070, 0x82C5, 0x5071, 0x82C6, 0x5072, 0x82C7, 0x5073, 0x82C8, 0x5074, 0x82C9, 0x5075, + 0x82CA, 0x5078, 0x82CB, 0x5079, 0x82CC, 0x507A, 0x82CD, 0x507C, 0x82CE, 0x507D, 0x82CF, 0x5081, 0x82D0, 0x5082, 0x82D1, 0x5083, + 0x82D2, 0x5084, 0x82D3, 0x5086, 0x82D4, 0x5087, 0x82D5, 0x5089, 0x82D6, 0x508A, 0x82D7, 0x508B, 0x82D8, 0x508C, 0x82D9, 0x508E, + 0x82DA, 0x508F, 0x82DB, 0x5090, 0x82DC, 0x5091, 0x82DD, 0x5092, 0x82DE, 0x5093, 0x82DF, 0x5094, 0x82E0, 0x5095, 0x82E1, 0x5096, + 0x82E2, 0x5097, 0x82E3, 0x5098, 0x82E4, 0x5099, 0x82E5, 0x509A, 0x82E6, 0x509B, 0x82E7, 0x509C, 0x82E8, 0x509D, 0x82E9, 0x509E, + 0x82EA, 0x509F, 0x82EB, 0x50A0, 0x82EC, 0x50A1, 0x82ED, 0x50A2, 0x82EE, 0x50A4, 0x82EF, 0x50A6, 0x82F0, 0x50AA, 0x82F1, 0x50AB, + 0x82F2, 0x50AD, 0x82F3, 0x50AE, 0x82F4, 0x50AF, 0x82F5, 0x50B0, 0x82F6, 0x50B1, 0x82F7, 0x50B3, 0x82F8, 0x50B4, 0x82F9, 0x50B5, + 0x82FA, 0x50B6, 0x82FB, 0x50B7, 0x82FC, 0x50B8, 0x82FD, 0x50B9, 0x82FE, 0x50BC, 0x8340, 0x50BD, 0x8341, 0x50BE, 0x8342, 0x50BF, + 0x8343, 0x50C0, 0x8344, 0x50C1, 0x8345, 0x50C2, 0x8346, 0x50C3, 0x8347, 0x50C4, 0x8348, 0x50C5, 0x8349, 0x50C6, 0x834A, 0x50C7, + 0x834B, 0x50C8, 0x834C, 0x50C9, 0x834D, 0x50CA, 0x834E, 0x50CB, 0x834F, 0x50CC, 0x8350, 0x50CD, 0x8351, 0x50CE, 0x8352, 0x50D0, + 0x8353, 0x50D1, 0x8354, 0x50D2, 0x8355, 0x50D3, 0x8356, 0x50D4, 0x8357, 0x50D5, 0x8358, 0x50D7, 0x8359, 0x50D8, 0x835A, 0x50D9, + 0x835B, 0x50DB, 0x835C, 0x50DC, 0x835D, 0x50DD, 0x835E, 0x50DE, 0x835F, 0x50DF, 0x8360, 0x50E0, 0x8361, 0x50E1, 0x8362, 0x50E2, + 0x8363, 0x50E3, 0x8364, 0x50E4, 0x8365, 0x50E5, 0x8366, 0x50E8, 0x8367, 0x50E9, 0x8368, 0x50EA, 0x8369, 0x50EB, 0x836A, 0x50EF, + 0x836B, 0x50F0, 0x836C, 0x50F1, 0x836D, 0x50F2, 0x836E, 0x50F4, 0x836F, 0x50F6, 0x8370, 0x50F7, 0x8371, 0x50F8, 0x8372, 0x50F9, + 0x8373, 0x50FA, 0x8374, 0x50FC, 0x8375, 0x50FD, 0x8376, 0x50FE, 0x8377, 0x50FF, 0x8378, 0x5100, 0x8379, 0x5101, 0x837A, 0x5102, + 0x837B, 0x5103, 0x837C, 0x5104, 0x837D, 0x5105, 0x837E, 0x5108, 0x8380, 0x5109, 0x8381, 0x510A, 0x8382, 0x510C, 0x8383, 0x510D, + 0x8384, 0x510E, 0x8385, 0x510F, 0x8386, 0x5110, 0x8387, 0x5111, 0x8388, 0x5113, 0x8389, 0x5114, 0x838A, 0x5115, 0x838B, 0x5116, + 0x838C, 0x5117, 0x838D, 0x5118, 0x838E, 0x5119, 0x838F, 0x511A, 0x8390, 0x511B, 0x8391, 0x511C, 0x8392, 0x511D, 0x8393, 0x511E, + 0x8394, 0x511F, 0x8395, 0x5120, 0x8396, 0x5122, 0x8397, 0x5123, 0x8398, 0x5124, 0x8399, 0x5125, 0x839A, 0x5126, 0x839B, 0x5127, + 0x839C, 0x5128, 0x839D, 0x5129, 0x839E, 0x512A, 0x839F, 0x512B, 0x83A0, 0x512C, 0x83A1, 0x512D, 0x83A2, 0x512E, 0x83A3, 0x512F, + 0x83A4, 0x5130, 0x83A5, 0x5131, 0x83A6, 0x5132, 0x83A7, 0x5133, 0x83A8, 0x5134, 0x83A9, 0x5135, 0x83AA, 0x5136, 0x83AB, 0x5137, + 0x83AC, 0x5138, 0x83AD, 0x5139, 0x83AE, 0x513A, 0x83AF, 0x513B, 0x83B0, 0x513C, 0x83B1, 0x513D, 0x83B2, 0x513E, 0x83B3, 0x5142, + 0x83B4, 0x5147, 0x83B5, 0x514A, 0x83B6, 0x514C, 0x83B7, 0x514E, 0x83B8, 0x514F, 0x83B9, 0x5150, 0x83BA, 0x5152, 0x83BB, 0x5153, + 0x83BC, 0x5157, 0x83BD, 0x5158, 0x83BE, 0x5159, 0x83BF, 0x515B, 0x83C0, 0x515D, 0x83C1, 0x515E, 0x83C2, 0x515F, 0x83C3, 0x5160, + 0x83C4, 0x5161, 0x83C5, 0x5163, 0x83C6, 0x5164, 0x83C7, 0x5166, 0x83C8, 0x5167, 0x83C9, 0x5169, 0x83CA, 0x516A, 0x83CB, 0x516F, + 0x83CC, 0x5172, 0x83CD, 0x517A, 0x83CE, 0x517E, 0x83CF, 0x517F, 0x83D0, 0x5183, 0x83D1, 0x5184, 0x83D2, 0x5186, 0x83D3, 0x5187, + 0x83D4, 0x518A, 0x83D5, 0x518B, 0x83D6, 0x518E, 0x83D7, 0x518F, 0x83D8, 0x5190, 0x83D9, 0x5191, 0x83DA, 0x5193, 0x83DB, 0x5194, + 0x83DC, 0x5198, 0x83DD, 0x519A, 0x83DE, 0x519D, 0x83DF, 0x519E, 0x83E0, 0x519F, 0x83E1, 0x51A1, 0x83E2, 0x51A3, 0x83E3, 0x51A6, + 0x83E4, 0x51A7, 0x83E5, 0x51A8, 0x83E6, 0x51A9, 0x83E7, 0x51AA, 0x83E8, 0x51AD, 0x83E9, 0x51AE, 0x83EA, 0x51B4, 0x83EB, 0x51B8, + 0x83EC, 0x51B9, 0x83ED, 0x51BA, 0x83EE, 0x51BE, 0x83EF, 0x51BF, 0x83F0, 0x51C1, 0x83F1, 0x51C2, 0x83F2, 0x51C3, 0x83F3, 0x51C5, + 0x83F4, 0x51C8, 0x83F5, 0x51CA, 0x83F6, 0x51CD, 0x83F7, 0x51CE, 0x83F8, 0x51D0, 0x83F9, 0x51D2, 0x83FA, 0x51D3, 0x83FB, 0x51D4, + 0x83FC, 0x51D5, 0x83FD, 0x51D6, 0x83FE, 0x51D7, 0x8440, 0x51D8, 0x8441, 0x51D9, 0x8442, 0x51DA, 0x8443, 0x51DC, 0x8444, 0x51DE, + 0x8445, 0x51DF, 0x8446, 0x51E2, 0x8447, 0x51E3, 0x8448, 0x51E5, 0x8449, 0x51E6, 0x844A, 0x51E7, 0x844B, 0x51E8, 0x844C, 0x51E9, + 0x844D, 0x51EA, 0x844E, 0x51EC, 0x844F, 0x51EE, 0x8450, 0x51F1, 0x8451, 0x51F2, 0x8452, 0x51F4, 0x8453, 0x51F7, 0x8454, 0x51FE, + 0x8455, 0x5204, 0x8456, 0x5205, 0x8457, 0x5209, 0x8458, 0x520B, 0x8459, 0x520C, 0x845A, 0x520F, 0x845B, 0x5210, 0x845C, 0x5213, + 0x845D, 0x5214, 0x845E, 0x5215, 0x845F, 0x521C, 0x8460, 0x521E, 0x8461, 0x521F, 0x8462, 0x5221, 0x8463, 0x5222, 0x8464, 0x5223, + 0x8465, 0x5225, 0x8466, 0x5226, 0x8467, 0x5227, 0x8468, 0x522A, 0x8469, 0x522C, 0x846A, 0x522F, 0x846B, 0x5231, 0x846C, 0x5232, + 0x846D, 0x5234, 0x846E, 0x5235, 0x846F, 0x523C, 0x8470, 0x523E, 0x8471, 0x5244, 0x8472, 0x5245, 0x8473, 0x5246, 0x8474, 0x5247, + 0x8475, 0x5248, 0x8476, 0x5249, 0x8477, 0x524B, 0x8478, 0x524E, 0x8479, 0x524F, 0x847A, 0x5252, 0x847B, 0x5253, 0x847C, 0x5255, + 0x847D, 0x5257, 0x847E, 0x5258, 0x8480, 0x5259, 0x8481, 0x525A, 0x8482, 0x525B, 0x8483, 0x525D, 0x8484, 0x525F, 0x8485, 0x5260, + 0x8486, 0x5262, 0x8487, 0x5263, 0x8488, 0x5264, 0x8489, 0x5266, 0x848A, 0x5268, 0x848B, 0x526B, 0x848C, 0x526C, 0x848D, 0x526D, + 0x848E, 0x526E, 0x848F, 0x5270, 0x8490, 0x5271, 0x8491, 0x5273, 0x8492, 0x5274, 0x8493, 0x5275, 0x8494, 0x5276, 0x8495, 0x5277, + 0x8496, 0x5278, 0x8497, 0x5279, 0x8498, 0x527A, 0x8499, 0x527B, 0x849A, 0x527C, 0x849B, 0x527E, 0x849C, 0x5280, 0x849D, 0x5283, + 0x849E, 0x5284, 0x849F, 0x5285, 0x84A0, 0x5286, 0x84A1, 0x5287, 0x84A2, 0x5289, 0x84A3, 0x528A, 0x84A4, 0x528B, 0x84A5, 0x528C, + 0x84A6, 0x528D, 0x84A7, 0x528E, 0x84A8, 0x528F, 0x84A9, 0x5291, 0x84AA, 0x5292, 0x84AB, 0x5294, 0x84AC, 0x5295, 0x84AD, 0x5296, + 0x84AE, 0x5297, 0x84AF, 0x5298, 0x84B0, 0x5299, 0x84B1, 0x529A, 0x84B2, 0x529C, 0x84B3, 0x52A4, 0x84B4, 0x52A5, 0x84B5, 0x52A6, + 0x84B6, 0x52A7, 0x84B7, 0x52AE, 0x84B8, 0x52AF, 0x84B9, 0x52B0, 0x84BA, 0x52B4, 0x84BB, 0x52B5, 0x84BC, 0x52B6, 0x84BD, 0x52B7, + 0x84BE, 0x52B8, 0x84BF, 0x52B9, 0x84C0, 0x52BA, 0x84C1, 0x52BB, 0x84C2, 0x52BC, 0x84C3, 0x52BD, 0x84C4, 0x52C0, 0x84C5, 0x52C1, + 0x84C6, 0x52C2, 0x84C7, 0x52C4, 0x84C8, 0x52C5, 0x84C9, 0x52C6, 0x84CA, 0x52C8, 0x84CB, 0x52CA, 0x84CC, 0x52CC, 0x84CD, 0x52CD, + 0x84CE, 0x52CE, 0x84CF, 0x52CF, 0x84D0, 0x52D1, 0x84D1, 0x52D3, 0x84D2, 0x52D4, 0x84D3, 0x52D5, 0x84D4, 0x52D7, 0x84D5, 0x52D9, + 0x84D6, 0x52DA, 0x84D7, 0x52DB, 0x84D8, 0x52DC, 0x84D9, 0x52DD, 0x84DA, 0x52DE, 0x84DB, 0x52E0, 0x84DC, 0x52E1, 0x84DD, 0x52E2, + 0x84DE, 0x52E3, 0x84DF, 0x52E5, 0x84E0, 0x52E6, 0x84E1, 0x52E7, 0x84E2, 0x52E8, 0x84E3, 0x52E9, 0x84E4, 0x52EA, 0x84E5, 0x52EB, + 0x84E6, 0x52EC, 0x84E7, 0x52ED, 0x84E8, 0x52EE, 0x84E9, 0x52EF, 0x84EA, 0x52F1, 0x84EB, 0x52F2, 0x84EC, 0x52F3, 0x84ED, 0x52F4, + 0x84EE, 0x52F5, 0x84EF, 0x52F6, 0x84F0, 0x52F7, 0x84F1, 0x52F8, 0x84F2, 0x52FB, 0x84F3, 0x52FC, 0x84F4, 0x52FD, 0x84F5, 0x5301, + 0x84F6, 0x5302, 0x84F7, 0x5303, 0x84F8, 0x5304, 0x84F9, 0x5307, 0x84FA, 0x5309, 0x84FB, 0x530A, 0x84FC, 0x530B, 0x84FD, 0x530C, + 0x84FE, 0x530E, 0x8540, 0x5311, 0x8541, 0x5312, 0x8542, 0x5313, 0x8543, 0x5314, 0x8544, 0x5318, 0x8545, 0x531B, 0x8546, 0x531C, + 0x8547, 0x531E, 0x8548, 0x531F, 0x8549, 0x5322, 0x854A, 0x5324, 0x854B, 0x5325, 0x854C, 0x5327, 0x854D, 0x5328, 0x854E, 0x5329, + 0x854F, 0x532B, 0x8550, 0x532C, 0x8551, 0x532D, 0x8552, 0x532F, 0x8553, 0x5330, 0x8554, 0x5331, 0x8555, 0x5332, 0x8556, 0x5333, + 0x8557, 0x5334, 0x8558, 0x5335, 0x8559, 0x5336, 0x855A, 0x5337, 0x855B, 0x5338, 0x855C, 0x533C, 0x855D, 0x533D, 0x855E, 0x5340, + 0x855F, 0x5342, 0x8560, 0x5344, 0x8561, 0x5346, 0x8562, 0x534B, 0x8563, 0x534C, 0x8564, 0x534D, 0x8565, 0x5350, 0x8566, 0x5354, + 0x8567, 0x5358, 0x8568, 0x5359, 0x8569, 0x535B, 0x856A, 0x535D, 0x856B, 0x5365, 0x856C, 0x5368, 0x856D, 0x536A, 0x856E, 0x536C, + 0x856F, 0x536D, 0x8570, 0x5372, 0x8571, 0x5376, 0x8572, 0x5379, 0x8573, 0x537B, 0x8574, 0x537C, 0x8575, 0x537D, 0x8576, 0x537E, + 0x8577, 0x5380, 0x8578, 0x5381, 0x8579, 0x5383, 0x857A, 0x5387, 0x857B, 0x5388, 0x857C, 0x538A, 0x857D, 0x538E, 0x857E, 0x538F, + 0x8580, 0x5390, 0x8581, 0x5391, 0x8582, 0x5392, 0x8583, 0x5393, 0x8584, 0x5394, 0x8585, 0x5396, 0x8586, 0x5397, 0x8587, 0x5399, + 0x8588, 0x539B, 0x8589, 0x539C, 0x858A, 0x539E, 0x858B, 0x53A0, 0x858C, 0x53A1, 0x858D, 0x53A4, 0x858E, 0x53A7, 0x858F, 0x53AA, + 0x8590, 0x53AB, 0x8591, 0x53AC, 0x8592, 0x53AD, 0x8593, 0x53AF, 0x8594, 0x53B0, 0x8595, 0x53B1, 0x8596, 0x53B2, 0x8597, 0x53B3, + 0x8598, 0x53B4, 0x8599, 0x53B5, 0x859A, 0x53B7, 0x859B, 0x53B8, 0x859C, 0x53B9, 0x859D, 0x53BA, 0x859E, 0x53BC, 0x859F, 0x53BD, + 0x85A0, 0x53BE, 0x85A1, 0x53C0, 0x85A2, 0x53C3, 0x85A3, 0x53C4, 0x85A4, 0x53C5, 0x85A5, 0x53C6, 0x85A6, 0x53C7, 0x85A7, 0x53CE, + 0x85A8, 0x53CF, 0x85A9, 0x53D0, 0x85AA, 0x53D2, 0x85AB, 0x53D3, 0x85AC, 0x53D5, 0x85AD, 0x53DA, 0x85AE, 0x53DC, 0x85AF, 0x53DD, + 0x85B0, 0x53DE, 0x85B1, 0x53E1, 0x85B2, 0x53E2, 0x85B3, 0x53E7, 0x85B4, 0x53F4, 0x85B5, 0x53FA, 0x85B6, 0x53FE, 0x85B7, 0x53FF, + 0x85B8, 0x5400, 0x85B9, 0x5402, 0x85BA, 0x5405, 0x85BB, 0x5407, 0x85BC, 0x540B, 0x85BD, 0x5414, 0x85BE, 0x5418, 0x85BF, 0x5419, + 0x85C0, 0x541A, 0x85C1, 0x541C, 0x85C2, 0x5422, 0x85C3, 0x5424, 0x85C4, 0x5425, 0x85C5, 0x542A, 0x85C6, 0x5430, 0x85C7, 0x5433, + 0x85C8, 0x5436, 0x85C9, 0x5437, 0x85CA, 0x543A, 0x85CB, 0x543D, 0x85CC, 0x543F, 0x85CD, 0x5441, 0x85CE, 0x5442, 0x85CF, 0x5444, + 0x85D0, 0x5445, 0x85D1, 0x5447, 0x85D2, 0x5449, 0x85D3, 0x544C, 0x85D4, 0x544D, 0x85D5, 0x544E, 0x85D6, 0x544F, 0x85D7, 0x5451, + 0x85D8, 0x545A, 0x85D9, 0x545D, 0x85DA, 0x545E, 0x85DB, 0x545F, 0x85DC, 0x5460, 0x85DD, 0x5461, 0x85DE, 0x5463, 0x85DF, 0x5465, + 0x85E0, 0x5467, 0x85E1, 0x5469, 0x85E2, 0x546A, 0x85E3, 0x546B, 0x85E4, 0x546C, 0x85E5, 0x546D, 0x85E6, 0x546E, 0x85E7, 0x546F, + 0x85E8, 0x5470, 0x85E9, 0x5474, 0x85EA, 0x5479, 0x85EB, 0x547A, 0x85EC, 0x547E, 0x85ED, 0x547F, 0x85EE, 0x5481, 0x85EF, 0x5483, + 0x85F0, 0x5485, 0x85F1, 0x5487, 0x85F2, 0x5488, 0x85F3, 0x5489, 0x85F4, 0x548A, 0x85F5, 0x548D, 0x85F6, 0x5491, 0x85F7, 0x5493, + 0x85F8, 0x5497, 0x85F9, 0x5498, 0x85FA, 0x549C, 0x85FB, 0x549E, 0x85FC, 0x549F, 0x85FD, 0x54A0, 0x85FE, 0x54A1, 0x8640, 0x54A2, + 0x8641, 0x54A5, 0x8642, 0x54AE, 0x8643, 0x54B0, 0x8644, 0x54B2, 0x8645, 0x54B5, 0x8646, 0x54B6, 0x8647, 0x54B7, 0x8648, 0x54B9, + 0x8649, 0x54BA, 0x864A, 0x54BC, 0x864B, 0x54BE, 0x864C, 0x54C3, 0x864D, 0x54C5, 0x864E, 0x54CA, 0x864F, 0x54CB, 0x8650, 0x54D6, + 0x8651, 0x54D8, 0x8652, 0x54DB, 0x8653, 0x54E0, 0x8654, 0x54E1, 0x8655, 0x54E2, 0x8656, 0x54E3, 0x8657, 0x54E4, 0x8658, 0x54EB, + 0x8659, 0x54EC, 0x865A, 0x54EF, 0x865B, 0x54F0, 0x865C, 0x54F1, 0x865D, 0x54F4, 0x865E, 0x54F5, 0x865F, 0x54F6, 0x8660, 0x54F7, + 0x8661, 0x54F8, 0x8662, 0x54F9, 0x8663, 0x54FB, 0x8664, 0x54FE, 0x8665, 0x5500, 0x8666, 0x5502, 0x8667, 0x5503, 0x8668, 0x5504, + 0x8669, 0x5505, 0x866A, 0x5508, 0x866B, 0x550A, 0x866C, 0x550B, 0x866D, 0x550C, 0x866E, 0x550D, 0x866F, 0x550E, 0x8670, 0x5512, + 0x8671, 0x5513, 0x8672, 0x5515, 0x8673, 0x5516, 0x8674, 0x5517, 0x8675, 0x5518, 0x8676, 0x5519, 0x8677, 0x551A, 0x8678, 0x551C, + 0x8679, 0x551D, 0x867A, 0x551E, 0x867B, 0x551F, 0x867C, 0x5521, 0x867D, 0x5525, 0x867E, 0x5526, 0x8680, 0x5528, 0x8681, 0x5529, + 0x8682, 0x552B, 0x8683, 0x552D, 0x8684, 0x5532, 0x8685, 0x5534, 0x8686, 0x5535, 0x8687, 0x5536, 0x8688, 0x5538, 0x8689, 0x5539, + 0x868A, 0x553A, 0x868B, 0x553B, 0x868C, 0x553D, 0x868D, 0x5540, 0x868E, 0x5542, 0x868F, 0x5545, 0x8690, 0x5547, 0x8691, 0x5548, + 0x8692, 0x554B, 0x8693, 0x554C, 0x8694, 0x554D, 0x8695, 0x554E, 0x8696, 0x554F, 0x8697, 0x5551, 0x8698, 0x5552, 0x8699, 0x5553, + 0x869A, 0x5554, 0x869B, 0x5557, 0x869C, 0x5558, 0x869D, 0x5559, 0x869E, 0x555A, 0x869F, 0x555B, 0x86A0, 0x555D, 0x86A1, 0x555E, + 0x86A2, 0x555F, 0x86A3, 0x5560, 0x86A4, 0x5562, 0x86A5, 0x5563, 0x86A6, 0x5568, 0x86A7, 0x5569, 0x86A8, 0x556B, 0x86A9, 0x556F, + 0x86AA, 0x5570, 0x86AB, 0x5571, 0x86AC, 0x5572, 0x86AD, 0x5573, 0x86AE, 0x5574, 0x86AF, 0x5579, 0x86B0, 0x557A, 0x86B1, 0x557D, + 0x86B2, 0x557F, 0x86B3, 0x5585, 0x86B4, 0x5586, 0x86B5, 0x558C, 0x86B6, 0x558D, 0x86B7, 0x558E, 0x86B8, 0x5590, 0x86B9, 0x5592, + 0x86BA, 0x5593, 0x86BB, 0x5595, 0x86BC, 0x5596, 0x86BD, 0x5597, 0x86BE, 0x559A, 0x86BF, 0x559B, 0x86C0, 0x559E, 0x86C1, 0x55A0, + 0x86C2, 0x55A1, 0x86C3, 0x55A2, 0x86C4, 0x55A3, 0x86C5, 0x55A4, 0x86C6, 0x55A5, 0x86C7, 0x55A6, 0x86C8, 0x55A8, 0x86C9, 0x55A9, + 0x86CA, 0x55AA, 0x86CB, 0x55AB, 0x86CC, 0x55AC, 0x86CD, 0x55AD, 0x86CE, 0x55AE, 0x86CF, 0x55AF, 0x86D0, 0x55B0, 0x86D1, 0x55B2, + 0x86D2, 0x55B4, 0x86D3, 0x55B6, 0x86D4, 0x55B8, 0x86D5, 0x55BA, 0x86D6, 0x55BC, 0x86D7, 0x55BF, 0x86D8, 0x55C0, 0x86D9, 0x55C1, + 0x86DA, 0x55C2, 0x86DB, 0x55C3, 0x86DC, 0x55C6, 0x86DD, 0x55C7, 0x86DE, 0x55C8, 0x86DF, 0x55CA, 0x86E0, 0x55CB, 0x86E1, 0x55CE, + 0x86E2, 0x55CF, 0x86E3, 0x55D0, 0x86E4, 0x55D5, 0x86E5, 0x55D7, 0x86E6, 0x55D8, 0x86E7, 0x55D9, 0x86E8, 0x55DA, 0x86E9, 0x55DB, + 0x86EA, 0x55DE, 0x86EB, 0x55E0, 0x86EC, 0x55E2, 0x86ED, 0x55E7, 0x86EE, 0x55E9, 0x86EF, 0x55ED, 0x86F0, 0x55EE, 0x86F1, 0x55F0, + 0x86F2, 0x55F1, 0x86F3, 0x55F4, 0x86F4, 0x55F6, 0x86F5, 0x55F8, 0x86F6, 0x55F9, 0x86F7, 0x55FA, 0x86F8, 0x55FB, 0x86F9, 0x55FC, + 0x86FA, 0x55FF, 0x86FB, 0x5602, 0x86FC, 0x5603, 0x86FD, 0x5604, 0x86FE, 0x5605, 0x8740, 0x5606, 0x8741, 0x5607, 0x8742, 0x560A, + 0x8743, 0x560B, 0x8744, 0x560D, 0x8745, 0x5610, 0x8746, 0x5611, 0x8747, 0x5612, 0x8748, 0x5613, 0x8749, 0x5614, 0x874A, 0x5615, + 0x874B, 0x5616, 0x874C, 0x5617, 0x874D, 0x5619, 0x874E, 0x561A, 0x874F, 0x561C, 0x8750, 0x561D, 0x8751, 0x5620, 0x8752, 0x5621, + 0x8753, 0x5622, 0x8754, 0x5625, 0x8755, 0x5626, 0x8756, 0x5628, 0x8757, 0x5629, 0x8758, 0x562A, 0x8759, 0x562B, 0x875A, 0x562E, + 0x875B, 0x562F, 0x875C, 0x5630, 0x875D, 0x5633, 0x875E, 0x5635, 0x875F, 0x5637, 0x8760, 0x5638, 0x8761, 0x563A, 0x8762, 0x563C, + 0x8763, 0x563D, 0x8764, 0x563E, 0x8765, 0x5640, 0x8766, 0x5641, 0x8767, 0x5642, 0x8768, 0x5643, 0x8769, 0x5644, 0x876A, 0x5645, + 0x876B, 0x5646, 0x876C, 0x5647, 0x876D, 0x5648, 0x876E, 0x5649, 0x876F, 0x564A, 0x8770, 0x564B, 0x8771, 0x564F, 0x8772, 0x5650, + 0x8773, 0x5651, 0x8774, 0x5652, 0x8775, 0x5653, 0x8776, 0x5655, 0x8777, 0x5656, 0x8778, 0x565A, 0x8779, 0x565B, 0x877A, 0x565D, + 0x877B, 0x565E, 0x877C, 0x565F, 0x877D, 0x5660, 0x877E, 0x5661, 0x8780, 0x5663, 0x8781, 0x5665, 0x8782, 0x5666, 0x8783, 0x5667, + 0x8784, 0x566D, 0x8785, 0x566E, 0x8786, 0x566F, 0x8787, 0x5670, 0x8788, 0x5672, 0x8789, 0x5673, 0x878A, 0x5674, 0x878B, 0x5675, + 0x878C, 0x5677, 0x878D, 0x5678, 0x878E, 0x5679, 0x878F, 0x567A, 0x8790, 0x567D, 0x8791, 0x567E, 0x8792, 0x567F, 0x8793, 0x5680, + 0x8794, 0x5681, 0x8795, 0x5682, 0x8796, 0x5683, 0x8797, 0x5684, 0x8798, 0x5687, 0x8799, 0x5688, 0x879A, 0x5689, 0x879B, 0x568A, + 0x879C, 0x568B, 0x879D, 0x568C, 0x879E, 0x568D, 0x879F, 0x5690, 0x87A0, 0x5691, 0x87A1, 0x5692, 0x87A2, 0x5694, 0x87A3, 0x5695, + 0x87A4, 0x5696, 0x87A5, 0x5697, 0x87A6, 0x5698, 0x87A7, 0x5699, 0x87A8, 0x569A, 0x87A9, 0x569B, 0x87AA, 0x569C, 0x87AB, 0x569D, + 0x87AC, 0x569E, 0x87AD, 0x569F, 0x87AE, 0x56A0, 0x87AF, 0x56A1, 0x87B0, 0x56A2, 0x87B1, 0x56A4, 0x87B2, 0x56A5, 0x87B3, 0x56A6, + 0x87B4, 0x56A7, 0x87B5, 0x56A8, 0x87B6, 0x56A9, 0x87B7, 0x56AA, 0x87B8, 0x56AB, 0x87B9, 0x56AC, 0x87BA, 0x56AD, 0x87BB, 0x56AE, + 0x87BC, 0x56B0, 0x87BD, 0x56B1, 0x87BE, 0x56B2, 0x87BF, 0x56B3, 0x87C0, 0x56B4, 0x87C1, 0x56B5, 0x87C2, 0x56B6, 0x87C3, 0x56B8, + 0x87C4, 0x56B9, 0x87C5, 0x56BA, 0x87C6, 0x56BB, 0x87C7, 0x56BD, 0x87C8, 0x56BE, 0x87C9, 0x56BF, 0x87CA, 0x56C0, 0x87CB, 0x56C1, + 0x87CC, 0x56C2, 0x87CD, 0x56C3, 0x87CE, 0x56C4, 0x87CF, 0x56C5, 0x87D0, 0x56C6, 0x87D1, 0x56C7, 0x87D2, 0x56C8, 0x87D3, 0x56C9, + 0x87D4, 0x56CB, 0x87D5, 0x56CC, 0x87D6, 0x56CD, 0x87D7, 0x56CE, 0x87D8, 0x56CF, 0x87D9, 0x56D0, 0x87DA, 0x56D1, 0x87DB, 0x56D2, + 0x87DC, 0x56D3, 0x87DD, 0x56D5, 0x87DE, 0x56D6, 0x87DF, 0x56D8, 0x87E0, 0x56D9, 0x87E1, 0x56DC, 0x87E2, 0x56E3, 0x87E3, 0x56E5, + 0x87E4, 0x56E6, 0x87E5, 0x56E7, 0x87E6, 0x56E8, 0x87E7, 0x56E9, 0x87E8, 0x56EA, 0x87E9, 0x56EC, 0x87EA, 0x56EE, 0x87EB, 0x56EF, + 0x87EC, 0x56F2, 0x87ED, 0x56F3, 0x87EE, 0x56F6, 0x87EF, 0x56F7, 0x87F0, 0x56F8, 0x87F1, 0x56FB, 0x87F2, 0x56FC, 0x87F3, 0x5700, + 0x87F4, 0x5701, 0x87F5, 0x5702, 0x87F6, 0x5705, 0x87F7, 0x5707, 0x87F8, 0x570B, 0x87F9, 0x570C, 0x87FA, 0x570D, 0x87FB, 0x570E, + 0x87FC, 0x570F, 0x87FD, 0x5710, 0x87FE, 0x5711, 0x8840, 0x5712, 0x8841, 0x5713, 0x8842, 0x5714, 0x8843, 0x5715, 0x8844, 0x5716, + 0x8845, 0x5717, 0x8846, 0x5718, 0x8847, 0x5719, 0x8848, 0x571A, 0x8849, 0x571B, 0x884A, 0x571D, 0x884B, 0x571E, 0x884C, 0x5720, + 0x884D, 0x5721, 0x884E, 0x5722, 0x884F, 0x5724, 0x8850, 0x5725, 0x8851, 0x5726, 0x8852, 0x5727, 0x8853, 0x572B, 0x8854, 0x5731, + 0x8855, 0x5732, 0x8856, 0x5734, 0x8857, 0x5735, 0x8858, 0x5736, 0x8859, 0x5737, 0x885A, 0x5738, 0x885B, 0x573C, 0x885C, 0x573D, + 0x885D, 0x573F, 0x885E, 0x5741, 0x885F, 0x5743, 0x8860, 0x5744, 0x8861, 0x5745, 0x8862, 0x5746, 0x8863, 0x5748, 0x8864, 0x5749, + 0x8865, 0x574B, 0x8866, 0x5752, 0x8867, 0x5753, 0x8868, 0x5754, 0x8869, 0x5755, 0x886A, 0x5756, 0x886B, 0x5758, 0x886C, 0x5759, + 0x886D, 0x5762, 0x886E, 0x5763, 0x886F, 0x5765, 0x8870, 0x5767, 0x8871, 0x576C, 0x8872, 0x576E, 0x8873, 0x5770, 0x8874, 0x5771, + 0x8875, 0x5772, 0x8876, 0x5774, 0x8877, 0x5775, 0x8878, 0x5778, 0x8879, 0x5779, 0x887A, 0x577A, 0x887B, 0x577D, 0x887C, 0x577E, + 0x887D, 0x577F, 0x887E, 0x5780, 0x8880, 0x5781, 0x8881, 0x5787, 0x8882, 0x5788, 0x8883, 0x5789, 0x8884, 0x578A, 0x8885, 0x578D, + 0x8886, 0x578E, 0x8887, 0x578F, 0x8888, 0x5790, 0x8889, 0x5791, 0x888A, 0x5794, 0x888B, 0x5795, 0x888C, 0x5796, 0x888D, 0x5797, + 0x888E, 0x5798, 0x888F, 0x5799, 0x8890, 0x579A, 0x8891, 0x579C, 0x8892, 0x579D, 0x8893, 0x579E, 0x8894, 0x579F, 0x8895, 0x57A5, + 0x8896, 0x57A8, 0x8897, 0x57AA, 0x8898, 0x57AC, 0x8899, 0x57AF, 0x889A, 0x57B0, 0x889B, 0x57B1, 0x889C, 0x57B3, 0x889D, 0x57B5, + 0x889E, 0x57B6, 0x889F, 0x57B7, 0x88A0, 0x57B9, 0x88A1, 0x57BA, 0x88A2, 0x57BB, 0x88A3, 0x57BC, 0x88A4, 0x57BD, 0x88A5, 0x57BE, + 0x88A6, 0x57BF, 0x88A7, 0x57C0, 0x88A8, 0x57C1, 0x88A9, 0x57C4, 0x88AA, 0x57C5, 0x88AB, 0x57C6, 0x88AC, 0x57C7, 0x88AD, 0x57C8, + 0x88AE, 0x57C9, 0x88AF, 0x57CA, 0x88B0, 0x57CC, 0x88B1, 0x57CD, 0x88B2, 0x57D0, 0x88B3, 0x57D1, 0x88B4, 0x57D3, 0x88B5, 0x57D6, + 0x88B6, 0x57D7, 0x88B7, 0x57DB, 0x88B8, 0x57DC, 0x88B9, 0x57DE, 0x88BA, 0x57E1, 0x88BB, 0x57E2, 0x88BC, 0x57E3, 0x88BD, 0x57E5, + 0x88BE, 0x57E6, 0x88BF, 0x57E7, 0x88C0, 0x57E8, 0x88C1, 0x57E9, 0x88C2, 0x57EA, 0x88C3, 0x57EB, 0x88C4, 0x57EC, 0x88C5, 0x57EE, + 0x88C6, 0x57F0, 0x88C7, 0x57F1, 0x88C8, 0x57F2, 0x88C9, 0x57F3, 0x88CA, 0x57F5, 0x88CB, 0x57F6, 0x88CC, 0x57F7, 0x88CD, 0x57FB, + 0x88CE, 0x57FC, 0x88CF, 0x57FE, 0x88D0, 0x57FF, 0x88D1, 0x5801, 0x88D2, 0x5803, 0x88D3, 0x5804, 0x88D4, 0x5805, 0x88D5, 0x5808, + 0x88D6, 0x5809, 0x88D7, 0x580A, 0x88D8, 0x580C, 0x88D9, 0x580E, 0x88DA, 0x580F, 0x88DB, 0x5810, 0x88DC, 0x5812, 0x88DD, 0x5813, + 0x88DE, 0x5814, 0x88DF, 0x5816, 0x88E0, 0x5817, 0x88E1, 0x5818, 0x88E2, 0x581A, 0x88E3, 0x581B, 0x88E4, 0x581C, 0x88E5, 0x581D, + 0x88E6, 0x581F, 0x88E7, 0x5822, 0x88E8, 0x5823, 0x88E9, 0x5825, 0x88EA, 0x5826, 0x88EB, 0x5827, 0x88EC, 0x5828, 0x88ED, 0x5829, + 0x88EE, 0x582B, 0x88EF, 0x582C, 0x88F0, 0x582D, 0x88F1, 0x582E, 0x88F2, 0x582F, 0x88F3, 0x5831, 0x88F4, 0x5832, 0x88F5, 0x5833, + 0x88F6, 0x5834, 0x88F7, 0x5836, 0x88F8, 0x5837, 0x88F9, 0x5838, 0x88FA, 0x5839, 0x88FB, 0x583A, 0x88FC, 0x583B, 0x88FD, 0x583C, + 0x88FE, 0x583D, 0x8940, 0x583E, 0x8941, 0x583F, 0x8942, 0x5840, 0x8943, 0x5841, 0x8944, 0x5842, 0x8945, 0x5843, 0x8946, 0x5845, + 0x8947, 0x5846, 0x8948, 0x5847, 0x8949, 0x5848, 0x894A, 0x5849, 0x894B, 0x584A, 0x894C, 0x584B, 0x894D, 0x584E, 0x894E, 0x584F, + 0x894F, 0x5850, 0x8950, 0x5852, 0x8951, 0x5853, 0x8952, 0x5855, 0x8953, 0x5856, 0x8954, 0x5857, 0x8955, 0x5859, 0x8956, 0x585A, + 0x8957, 0x585B, 0x8958, 0x585C, 0x8959, 0x585D, 0x895A, 0x585F, 0x895B, 0x5860, 0x895C, 0x5861, 0x895D, 0x5862, 0x895E, 0x5863, + 0x895F, 0x5864, 0x8960, 0x5866, 0x8961, 0x5867, 0x8962, 0x5868, 0x8963, 0x5869, 0x8964, 0x586A, 0x8965, 0x586D, 0x8966, 0x586E, + 0x8967, 0x586F, 0x8968, 0x5870, 0x8969, 0x5871, 0x896A, 0x5872, 0x896B, 0x5873, 0x896C, 0x5874, 0x896D, 0x5875, 0x896E, 0x5876, + 0x896F, 0x5877, 0x8970, 0x5878, 0x8971, 0x5879, 0x8972, 0x587A, 0x8973, 0x587B, 0x8974, 0x587C, 0x8975, 0x587D, 0x8976, 0x587F, + 0x8977, 0x5882, 0x8978, 0x5884, 0x8979, 0x5886, 0x897A, 0x5887, 0x897B, 0x5888, 0x897C, 0x588A, 0x897D, 0x588B, 0x897E, 0x588C, + 0x8980, 0x588D, 0x8981, 0x588E, 0x8982, 0x588F, 0x8983, 0x5890, 0x8984, 0x5891, 0x8985, 0x5894, 0x8986, 0x5895, 0x8987, 0x5896, + 0x8988, 0x5897, 0x8989, 0x5898, 0x898A, 0x589B, 0x898B, 0x589C, 0x898C, 0x589D, 0x898D, 0x58A0, 0x898E, 0x58A1, 0x898F, 0x58A2, + 0x8990, 0x58A3, 0x8991, 0x58A4, 0x8992, 0x58A5, 0x8993, 0x58A6, 0x8994, 0x58A7, 0x8995, 0x58AA, 0x8996, 0x58AB, 0x8997, 0x58AC, + 0x8998, 0x58AD, 0x8999, 0x58AE, 0x899A, 0x58AF, 0x899B, 0x58B0, 0x899C, 0x58B1, 0x899D, 0x58B2, 0x899E, 0x58B3, 0x899F, 0x58B4, + 0x89A0, 0x58B5, 0x89A1, 0x58B6, 0x89A2, 0x58B7, 0x89A3, 0x58B8, 0x89A4, 0x58B9, 0x89A5, 0x58BA, 0x89A6, 0x58BB, 0x89A7, 0x58BD, + 0x89A8, 0x58BE, 0x89A9, 0x58BF, 0x89AA, 0x58C0, 0x89AB, 0x58C2, 0x89AC, 0x58C3, 0x89AD, 0x58C4, 0x89AE, 0x58C6, 0x89AF, 0x58C7, + 0x89B0, 0x58C8, 0x89B1, 0x58C9, 0x89B2, 0x58CA, 0x89B3, 0x58CB, 0x89B4, 0x58CC, 0x89B5, 0x58CD, 0x89B6, 0x58CE, 0x89B7, 0x58CF, + 0x89B8, 0x58D0, 0x89B9, 0x58D2, 0x89BA, 0x58D3, 0x89BB, 0x58D4, 0x89BC, 0x58D6, 0x89BD, 0x58D7, 0x89BE, 0x58D8, 0x89BF, 0x58D9, + 0x89C0, 0x58DA, 0x89C1, 0x58DB, 0x89C2, 0x58DC, 0x89C3, 0x58DD, 0x89C4, 0x58DE, 0x89C5, 0x58DF, 0x89C6, 0x58E0, 0x89C7, 0x58E1, + 0x89C8, 0x58E2, 0x89C9, 0x58E3, 0x89CA, 0x58E5, 0x89CB, 0x58E6, 0x89CC, 0x58E7, 0x89CD, 0x58E8, 0x89CE, 0x58E9, 0x89CF, 0x58EA, + 0x89D0, 0x58ED, 0x89D1, 0x58EF, 0x89D2, 0x58F1, 0x89D3, 0x58F2, 0x89D4, 0x58F4, 0x89D5, 0x58F5, 0x89D6, 0x58F7, 0x89D7, 0x58F8, + 0x89D8, 0x58FA, 0x89D9, 0x58FB, 0x89DA, 0x58FC, 0x89DB, 0x58FD, 0x89DC, 0x58FE, 0x89DD, 0x58FF, 0x89DE, 0x5900, 0x89DF, 0x5901, + 0x89E0, 0x5903, 0x89E1, 0x5905, 0x89E2, 0x5906, 0x89E3, 0x5908, 0x89E4, 0x5909, 0x89E5, 0x590A, 0x89E6, 0x590B, 0x89E7, 0x590C, + 0x89E8, 0x590E, 0x89E9, 0x5910, 0x89EA, 0x5911, 0x89EB, 0x5912, 0x89EC, 0x5913, 0x89ED, 0x5917, 0x89EE, 0x5918, 0x89EF, 0x591B, + 0x89F0, 0x591D, 0x89F1, 0x591E, 0x89F2, 0x5920, 0x89F3, 0x5921, 0x89F4, 0x5922, 0x89F5, 0x5923, 0x89F6, 0x5926, 0x89F7, 0x5928, + 0x89F8, 0x592C, 0x89F9, 0x5930, 0x89FA, 0x5932, 0x89FB, 0x5933, 0x89FC, 0x5935, 0x89FD, 0x5936, 0x89FE, 0x593B, 0x8A40, 0x593D, + 0x8A41, 0x593E, 0x8A42, 0x593F, 0x8A43, 0x5940, 0x8A44, 0x5943, 0x8A45, 0x5945, 0x8A46, 0x5946, 0x8A47, 0x594A, 0x8A48, 0x594C, + 0x8A49, 0x594D, 0x8A4A, 0x5950, 0x8A4B, 0x5952, 0x8A4C, 0x5953, 0x8A4D, 0x5959, 0x8A4E, 0x595B, 0x8A4F, 0x595C, 0x8A50, 0x595D, + 0x8A51, 0x595E, 0x8A52, 0x595F, 0x8A53, 0x5961, 0x8A54, 0x5963, 0x8A55, 0x5964, 0x8A56, 0x5966, 0x8A57, 0x5967, 0x8A58, 0x5968, + 0x8A59, 0x5969, 0x8A5A, 0x596A, 0x8A5B, 0x596B, 0x8A5C, 0x596C, 0x8A5D, 0x596D, 0x8A5E, 0x596E, 0x8A5F, 0x596F, 0x8A60, 0x5970, + 0x8A61, 0x5971, 0x8A62, 0x5972, 0x8A63, 0x5975, 0x8A64, 0x5977, 0x8A65, 0x597A, 0x8A66, 0x597B, 0x8A67, 0x597C, 0x8A68, 0x597E, + 0x8A69, 0x597F, 0x8A6A, 0x5980, 0x8A6B, 0x5985, 0x8A6C, 0x5989, 0x8A6D, 0x598B, 0x8A6E, 0x598C, 0x8A6F, 0x598E, 0x8A70, 0x598F, + 0x8A71, 0x5990, 0x8A72, 0x5991, 0x8A73, 0x5994, 0x8A74, 0x5995, 0x8A75, 0x5998, 0x8A76, 0x599A, 0x8A77, 0x599B, 0x8A78, 0x599C, + 0x8A79, 0x599D, 0x8A7A, 0x599F, 0x8A7B, 0x59A0, 0x8A7C, 0x59A1, 0x8A7D, 0x59A2, 0x8A7E, 0x59A6, 0x8A80, 0x59A7, 0x8A81, 0x59AC, + 0x8A82, 0x59AD, 0x8A83, 0x59B0, 0x8A84, 0x59B1, 0x8A85, 0x59B3, 0x8A86, 0x59B4, 0x8A87, 0x59B5, 0x8A88, 0x59B6, 0x8A89, 0x59B7, + 0x8A8A, 0x59B8, 0x8A8B, 0x59BA, 0x8A8C, 0x59BC, 0x8A8D, 0x59BD, 0x8A8E, 0x59BF, 0x8A8F, 0x59C0, 0x8A90, 0x59C1, 0x8A91, 0x59C2, + 0x8A92, 0x59C3, 0x8A93, 0x59C4, 0x8A94, 0x59C5, 0x8A95, 0x59C7, 0x8A96, 0x59C8, 0x8A97, 0x59C9, 0x8A98, 0x59CC, 0x8A99, 0x59CD, + 0x8A9A, 0x59CE, 0x8A9B, 0x59CF, 0x8A9C, 0x59D5, 0x8A9D, 0x59D6, 0x8A9E, 0x59D9, 0x8A9F, 0x59DB, 0x8AA0, 0x59DE, 0x8AA1, 0x59DF, + 0x8AA2, 0x59E0, 0x8AA3, 0x59E1, 0x8AA4, 0x59E2, 0x8AA5, 0x59E4, 0x8AA6, 0x59E6, 0x8AA7, 0x59E7, 0x8AA8, 0x59E9, 0x8AA9, 0x59EA, + 0x8AAA, 0x59EB, 0x8AAB, 0x59ED, 0x8AAC, 0x59EE, 0x8AAD, 0x59EF, 0x8AAE, 0x59F0, 0x8AAF, 0x59F1, 0x8AB0, 0x59F2, 0x8AB1, 0x59F3, + 0x8AB2, 0x59F4, 0x8AB3, 0x59F5, 0x8AB4, 0x59F6, 0x8AB5, 0x59F7, 0x8AB6, 0x59F8, 0x8AB7, 0x59FA, 0x8AB8, 0x59FC, 0x8AB9, 0x59FD, + 0x8ABA, 0x59FE, 0x8ABB, 0x5A00, 0x8ABC, 0x5A02, 0x8ABD, 0x5A0A, 0x8ABE, 0x5A0B, 0x8ABF, 0x5A0D, 0x8AC0, 0x5A0E, 0x8AC1, 0x5A0F, + 0x8AC2, 0x5A10, 0x8AC3, 0x5A12, 0x8AC4, 0x5A14, 0x8AC5, 0x5A15, 0x8AC6, 0x5A16, 0x8AC7, 0x5A17, 0x8AC8, 0x5A19, 0x8AC9, 0x5A1A, + 0x8ACA, 0x5A1B, 0x8ACB, 0x5A1D, 0x8ACC, 0x5A1E, 0x8ACD, 0x5A21, 0x8ACE, 0x5A22, 0x8ACF, 0x5A24, 0x8AD0, 0x5A26, 0x8AD1, 0x5A27, + 0x8AD2, 0x5A28, 0x8AD3, 0x5A2A, 0x8AD4, 0x5A2B, 0x8AD5, 0x5A2C, 0x8AD6, 0x5A2D, 0x8AD7, 0x5A2E, 0x8AD8, 0x5A2F, 0x8AD9, 0x5A30, + 0x8ADA, 0x5A33, 0x8ADB, 0x5A35, 0x8ADC, 0x5A37, 0x8ADD, 0x5A38, 0x8ADE, 0x5A39, 0x8ADF, 0x5A3A, 0x8AE0, 0x5A3B, 0x8AE1, 0x5A3D, + 0x8AE2, 0x5A3E, 0x8AE3, 0x5A3F, 0x8AE4, 0x5A41, 0x8AE5, 0x5A42, 0x8AE6, 0x5A43, 0x8AE7, 0x5A44, 0x8AE8, 0x5A45, 0x8AE9, 0x5A47, + 0x8AEA, 0x5A48, 0x8AEB, 0x5A4B, 0x8AEC, 0x5A4C, 0x8AED, 0x5A4D, 0x8AEE, 0x5A4E, 0x8AEF, 0x5A4F, 0x8AF0, 0x5A50, 0x8AF1, 0x5A51, + 0x8AF2, 0x5A52, 0x8AF3, 0x5A53, 0x8AF4, 0x5A54, 0x8AF5, 0x5A56, 0x8AF6, 0x5A57, 0x8AF7, 0x5A58, 0x8AF8, 0x5A59, 0x8AF9, 0x5A5B, + 0x8AFA, 0x5A5C, 0x8AFB, 0x5A5D, 0x8AFC, 0x5A5E, 0x8AFD, 0x5A5F, 0x8AFE, 0x5A60, 0x8B40, 0x5A61, 0x8B41, 0x5A63, 0x8B42, 0x5A64, + 0x8B43, 0x5A65, 0x8B44, 0x5A66, 0x8B45, 0x5A68, 0x8B46, 0x5A69, 0x8B47, 0x5A6B, 0x8B48, 0x5A6C, 0x8B49, 0x5A6D, 0x8B4A, 0x5A6E, + 0x8B4B, 0x5A6F, 0x8B4C, 0x5A70, 0x8B4D, 0x5A71, 0x8B4E, 0x5A72, 0x8B4F, 0x5A73, 0x8B50, 0x5A78, 0x8B51, 0x5A79, 0x8B52, 0x5A7B, + 0x8B53, 0x5A7C, 0x8B54, 0x5A7D, 0x8B55, 0x5A7E, 0x8B56, 0x5A80, 0x8B57, 0x5A81, 0x8B58, 0x5A82, 0x8B59, 0x5A83, 0x8B5A, 0x5A84, + 0x8B5B, 0x5A85, 0x8B5C, 0x5A86, 0x8B5D, 0x5A87, 0x8B5E, 0x5A88, 0x8B5F, 0x5A89, 0x8B60, 0x5A8A, 0x8B61, 0x5A8B, 0x8B62, 0x5A8C, + 0x8B63, 0x5A8D, 0x8B64, 0x5A8E, 0x8B65, 0x5A8F, 0x8B66, 0x5A90, 0x8B67, 0x5A91, 0x8B68, 0x5A93, 0x8B69, 0x5A94, 0x8B6A, 0x5A95, + 0x8B6B, 0x5A96, 0x8B6C, 0x5A97, 0x8B6D, 0x5A98, 0x8B6E, 0x5A99, 0x8B6F, 0x5A9C, 0x8B70, 0x5A9D, 0x8B71, 0x5A9E, 0x8B72, 0x5A9F, + 0x8B73, 0x5AA0, 0x8B74, 0x5AA1, 0x8B75, 0x5AA2, 0x8B76, 0x5AA3, 0x8B77, 0x5AA4, 0x8B78, 0x5AA5, 0x8B79, 0x5AA6, 0x8B7A, 0x5AA7, + 0x8B7B, 0x5AA8, 0x8B7C, 0x5AA9, 0x8B7D, 0x5AAB, 0x8B7E, 0x5AAC, 0x8B80, 0x5AAD, 0x8B81, 0x5AAE, 0x8B82, 0x5AAF, 0x8B83, 0x5AB0, + 0x8B84, 0x5AB1, 0x8B85, 0x5AB4, 0x8B86, 0x5AB6, 0x8B87, 0x5AB7, 0x8B88, 0x5AB9, 0x8B89, 0x5ABA, 0x8B8A, 0x5ABB, 0x8B8B, 0x5ABC, + 0x8B8C, 0x5ABD, 0x8B8D, 0x5ABF, 0x8B8E, 0x5AC0, 0x8B8F, 0x5AC3, 0x8B90, 0x5AC4, 0x8B91, 0x5AC5, 0x8B92, 0x5AC6, 0x8B93, 0x5AC7, + 0x8B94, 0x5AC8, 0x8B95, 0x5ACA, 0x8B96, 0x5ACB, 0x8B97, 0x5ACD, 0x8B98, 0x5ACE, 0x8B99, 0x5ACF, 0x8B9A, 0x5AD0, 0x8B9B, 0x5AD1, + 0x8B9C, 0x5AD3, 0x8B9D, 0x5AD5, 0x8B9E, 0x5AD7, 0x8B9F, 0x5AD9, 0x8BA0, 0x5ADA, 0x8BA1, 0x5ADB, 0x8BA2, 0x5ADD, 0x8BA3, 0x5ADE, + 0x8BA4, 0x5ADF, 0x8BA5, 0x5AE2, 0x8BA6, 0x5AE4, 0x8BA7, 0x5AE5, 0x8BA8, 0x5AE7, 0x8BA9, 0x5AE8, 0x8BAA, 0x5AEA, 0x8BAB, 0x5AEC, + 0x8BAC, 0x5AED, 0x8BAD, 0x5AEE, 0x8BAE, 0x5AEF, 0x8BAF, 0x5AF0, 0x8BB0, 0x5AF2, 0x8BB1, 0x5AF3, 0x8BB2, 0x5AF4, 0x8BB3, 0x5AF5, + 0x8BB4, 0x5AF6, 0x8BB5, 0x5AF7, 0x8BB6, 0x5AF8, 0x8BB7, 0x5AF9, 0x8BB8, 0x5AFA, 0x8BB9, 0x5AFB, 0x8BBA, 0x5AFC, 0x8BBB, 0x5AFD, + 0x8BBC, 0x5AFE, 0x8BBD, 0x5AFF, 0x8BBE, 0x5B00, 0x8BBF, 0x5B01, 0x8BC0, 0x5B02, 0x8BC1, 0x5B03, 0x8BC2, 0x5B04, 0x8BC3, 0x5B05, + 0x8BC4, 0x5B06, 0x8BC5, 0x5B07, 0x8BC6, 0x5B08, 0x8BC7, 0x5B0A, 0x8BC8, 0x5B0B, 0x8BC9, 0x5B0C, 0x8BCA, 0x5B0D, 0x8BCB, 0x5B0E, + 0x8BCC, 0x5B0F, 0x8BCD, 0x5B10, 0x8BCE, 0x5B11, 0x8BCF, 0x5B12, 0x8BD0, 0x5B13, 0x8BD1, 0x5B14, 0x8BD2, 0x5B15, 0x8BD3, 0x5B18, + 0x8BD4, 0x5B19, 0x8BD5, 0x5B1A, 0x8BD6, 0x5B1B, 0x8BD7, 0x5B1C, 0x8BD8, 0x5B1D, 0x8BD9, 0x5B1E, 0x8BDA, 0x5B1F, 0x8BDB, 0x5B20, + 0x8BDC, 0x5B21, 0x8BDD, 0x5B22, 0x8BDE, 0x5B23, 0x8BDF, 0x5B24, 0x8BE0, 0x5B25, 0x8BE1, 0x5B26, 0x8BE2, 0x5B27, 0x8BE3, 0x5B28, + 0x8BE4, 0x5B29, 0x8BE5, 0x5B2A, 0x8BE6, 0x5B2B, 0x8BE7, 0x5B2C, 0x8BE8, 0x5B2D, 0x8BE9, 0x5B2E, 0x8BEA, 0x5B2F, 0x8BEB, 0x5B30, + 0x8BEC, 0x5B31, 0x8BED, 0x5B33, 0x8BEE, 0x5B35, 0x8BEF, 0x5B36, 0x8BF0, 0x5B38, 0x8BF1, 0x5B39, 0x8BF2, 0x5B3A, 0x8BF3, 0x5B3B, + 0x8BF4, 0x5B3C, 0x8BF5, 0x5B3D, 0x8BF6, 0x5B3E, 0x8BF7, 0x5B3F, 0x8BF8, 0x5B41, 0x8BF9, 0x5B42, 0x8BFA, 0x5B43, 0x8BFB, 0x5B44, + 0x8BFC, 0x5B45, 0x8BFD, 0x5B46, 0x8BFE, 0x5B47, 0x8C40, 0x5B48, 0x8C41, 0x5B49, 0x8C42, 0x5B4A, 0x8C43, 0x5B4B, 0x8C44, 0x5B4C, + 0x8C45, 0x5B4D, 0x8C46, 0x5B4E, 0x8C47, 0x5B4F, 0x8C48, 0x5B52, 0x8C49, 0x5B56, 0x8C4A, 0x5B5E, 0x8C4B, 0x5B60, 0x8C4C, 0x5B61, + 0x8C4D, 0x5B67, 0x8C4E, 0x5B68, 0x8C4F, 0x5B6B, 0x8C50, 0x5B6D, 0x8C51, 0x5B6E, 0x8C52, 0x5B6F, 0x8C53, 0x5B72, 0x8C54, 0x5B74, + 0x8C55, 0x5B76, 0x8C56, 0x5B77, 0x8C57, 0x5B78, 0x8C58, 0x5B79, 0x8C59, 0x5B7B, 0x8C5A, 0x5B7C, 0x8C5B, 0x5B7E, 0x8C5C, 0x5B7F, + 0x8C5D, 0x5B82, 0x8C5E, 0x5B86, 0x8C5F, 0x5B8A, 0x8C60, 0x5B8D, 0x8C61, 0x5B8E, 0x8C62, 0x5B90, 0x8C63, 0x5B91, 0x8C64, 0x5B92, + 0x8C65, 0x5B94, 0x8C66, 0x5B96, 0x8C67, 0x5B9F, 0x8C68, 0x5BA7, 0x8C69, 0x5BA8, 0x8C6A, 0x5BA9, 0x8C6B, 0x5BAC, 0x8C6C, 0x5BAD, + 0x8C6D, 0x5BAE, 0x8C6E, 0x5BAF, 0x8C6F, 0x5BB1, 0x8C70, 0x5BB2, 0x8C71, 0x5BB7, 0x8C72, 0x5BBA, 0x8C73, 0x5BBB, 0x8C74, 0x5BBC, + 0x8C75, 0x5BC0, 0x8C76, 0x5BC1, 0x8C77, 0x5BC3, 0x8C78, 0x5BC8, 0x8C79, 0x5BC9, 0x8C7A, 0x5BCA, 0x8C7B, 0x5BCB, 0x8C7C, 0x5BCD, + 0x8C7D, 0x5BCE, 0x8C7E, 0x5BCF, 0x8C80, 0x5BD1, 0x8C81, 0x5BD4, 0x8C82, 0x5BD5, 0x8C83, 0x5BD6, 0x8C84, 0x5BD7, 0x8C85, 0x5BD8, + 0x8C86, 0x5BD9, 0x8C87, 0x5BDA, 0x8C88, 0x5BDB, 0x8C89, 0x5BDC, 0x8C8A, 0x5BE0, 0x8C8B, 0x5BE2, 0x8C8C, 0x5BE3, 0x8C8D, 0x5BE6, + 0x8C8E, 0x5BE7, 0x8C8F, 0x5BE9, 0x8C90, 0x5BEA, 0x8C91, 0x5BEB, 0x8C92, 0x5BEC, 0x8C93, 0x5BED, 0x8C94, 0x5BEF, 0x8C95, 0x5BF1, + 0x8C96, 0x5BF2, 0x8C97, 0x5BF3, 0x8C98, 0x5BF4, 0x8C99, 0x5BF5, 0x8C9A, 0x5BF6, 0x8C9B, 0x5BF7, 0x8C9C, 0x5BFD, 0x8C9D, 0x5BFE, + 0x8C9E, 0x5C00, 0x8C9F, 0x5C02, 0x8CA0, 0x5C03, 0x8CA1, 0x5C05, 0x8CA2, 0x5C07, 0x8CA3, 0x5C08, 0x8CA4, 0x5C0B, 0x8CA5, 0x5C0C, + 0x8CA6, 0x5C0D, 0x8CA7, 0x5C0E, 0x8CA8, 0x5C10, 0x8CA9, 0x5C12, 0x8CAA, 0x5C13, 0x8CAB, 0x5C17, 0x8CAC, 0x5C19, 0x8CAD, 0x5C1B, + 0x8CAE, 0x5C1E, 0x8CAF, 0x5C1F, 0x8CB0, 0x5C20, 0x8CB1, 0x5C21, 0x8CB2, 0x5C23, 0x8CB3, 0x5C26, 0x8CB4, 0x5C28, 0x8CB5, 0x5C29, + 0x8CB6, 0x5C2A, 0x8CB7, 0x5C2B, 0x8CB8, 0x5C2D, 0x8CB9, 0x5C2E, 0x8CBA, 0x5C2F, 0x8CBB, 0x5C30, 0x8CBC, 0x5C32, 0x8CBD, 0x5C33, + 0x8CBE, 0x5C35, 0x8CBF, 0x5C36, 0x8CC0, 0x5C37, 0x8CC1, 0x5C43, 0x8CC2, 0x5C44, 0x8CC3, 0x5C46, 0x8CC4, 0x5C47, 0x8CC5, 0x5C4C, + 0x8CC6, 0x5C4D, 0x8CC7, 0x5C52, 0x8CC8, 0x5C53, 0x8CC9, 0x5C54, 0x8CCA, 0x5C56, 0x8CCB, 0x5C57, 0x8CCC, 0x5C58, 0x8CCD, 0x5C5A, + 0x8CCE, 0x5C5B, 0x8CCF, 0x5C5C, 0x8CD0, 0x5C5D, 0x8CD1, 0x5C5F, 0x8CD2, 0x5C62, 0x8CD3, 0x5C64, 0x8CD4, 0x5C67, 0x8CD5, 0x5C68, + 0x8CD6, 0x5C69, 0x8CD7, 0x5C6A, 0x8CD8, 0x5C6B, 0x8CD9, 0x5C6C, 0x8CDA, 0x5C6D, 0x8CDB, 0x5C70, 0x8CDC, 0x5C72, 0x8CDD, 0x5C73, + 0x8CDE, 0x5C74, 0x8CDF, 0x5C75, 0x8CE0, 0x5C76, 0x8CE1, 0x5C77, 0x8CE2, 0x5C78, 0x8CE3, 0x5C7B, 0x8CE4, 0x5C7C, 0x8CE5, 0x5C7D, + 0x8CE6, 0x5C7E, 0x8CE7, 0x5C80, 0x8CE8, 0x5C83, 0x8CE9, 0x5C84, 0x8CEA, 0x5C85, 0x8CEB, 0x5C86, 0x8CEC, 0x5C87, 0x8CED, 0x5C89, + 0x8CEE, 0x5C8A, 0x8CEF, 0x5C8B, 0x8CF0, 0x5C8E, 0x8CF1, 0x5C8F, 0x8CF2, 0x5C92, 0x8CF3, 0x5C93, 0x8CF4, 0x5C95, 0x8CF5, 0x5C9D, + 0x8CF6, 0x5C9E, 0x8CF7, 0x5C9F, 0x8CF8, 0x5CA0, 0x8CF9, 0x5CA1, 0x8CFA, 0x5CA4, 0x8CFB, 0x5CA5, 0x8CFC, 0x5CA6, 0x8CFD, 0x5CA7, + 0x8CFE, 0x5CA8, 0x8D40, 0x5CAA, 0x8D41, 0x5CAE, 0x8D42, 0x5CAF, 0x8D43, 0x5CB0, 0x8D44, 0x5CB2, 0x8D45, 0x5CB4, 0x8D46, 0x5CB6, + 0x8D47, 0x5CB9, 0x8D48, 0x5CBA, 0x8D49, 0x5CBB, 0x8D4A, 0x5CBC, 0x8D4B, 0x5CBE, 0x8D4C, 0x5CC0, 0x8D4D, 0x5CC2, 0x8D4E, 0x5CC3, + 0x8D4F, 0x5CC5, 0x8D50, 0x5CC6, 0x8D51, 0x5CC7, 0x8D52, 0x5CC8, 0x8D53, 0x5CC9, 0x8D54, 0x5CCA, 0x8D55, 0x5CCC, 0x8D56, 0x5CCD, + 0x8D57, 0x5CCE, 0x8D58, 0x5CCF, 0x8D59, 0x5CD0, 0x8D5A, 0x5CD1, 0x8D5B, 0x5CD3, 0x8D5C, 0x5CD4, 0x8D5D, 0x5CD5, 0x8D5E, 0x5CD6, + 0x8D5F, 0x5CD7, 0x8D60, 0x5CD8, 0x8D61, 0x5CDA, 0x8D62, 0x5CDB, 0x8D63, 0x5CDC, 0x8D64, 0x5CDD, 0x8D65, 0x5CDE, 0x8D66, 0x5CDF, + 0x8D67, 0x5CE0, 0x8D68, 0x5CE2, 0x8D69, 0x5CE3, 0x8D6A, 0x5CE7, 0x8D6B, 0x5CE9, 0x8D6C, 0x5CEB, 0x8D6D, 0x5CEC, 0x8D6E, 0x5CEE, + 0x8D6F, 0x5CEF, 0x8D70, 0x5CF1, 0x8D71, 0x5CF2, 0x8D72, 0x5CF3, 0x8D73, 0x5CF4, 0x8D74, 0x5CF5, 0x8D75, 0x5CF6, 0x8D76, 0x5CF7, + 0x8D77, 0x5CF8, 0x8D78, 0x5CF9, 0x8D79, 0x5CFA, 0x8D7A, 0x5CFC, 0x8D7B, 0x5CFD, 0x8D7C, 0x5CFE, 0x8D7D, 0x5CFF, 0x8D7E, 0x5D00, + 0x8D80, 0x5D01, 0x8D81, 0x5D04, 0x8D82, 0x5D05, 0x8D83, 0x5D08, 0x8D84, 0x5D09, 0x8D85, 0x5D0A, 0x8D86, 0x5D0B, 0x8D87, 0x5D0C, + 0x8D88, 0x5D0D, 0x8D89, 0x5D0F, 0x8D8A, 0x5D10, 0x8D8B, 0x5D11, 0x8D8C, 0x5D12, 0x8D8D, 0x5D13, 0x8D8E, 0x5D15, 0x8D8F, 0x5D17, + 0x8D90, 0x5D18, 0x8D91, 0x5D19, 0x8D92, 0x5D1A, 0x8D93, 0x5D1C, 0x8D94, 0x5D1D, 0x8D95, 0x5D1F, 0x8D96, 0x5D20, 0x8D97, 0x5D21, + 0x8D98, 0x5D22, 0x8D99, 0x5D23, 0x8D9A, 0x5D25, 0x8D9B, 0x5D28, 0x8D9C, 0x5D2A, 0x8D9D, 0x5D2B, 0x8D9E, 0x5D2C, 0x8D9F, 0x5D2F, + 0x8DA0, 0x5D30, 0x8DA1, 0x5D31, 0x8DA2, 0x5D32, 0x8DA3, 0x5D33, 0x8DA4, 0x5D35, 0x8DA5, 0x5D36, 0x8DA6, 0x5D37, 0x8DA7, 0x5D38, + 0x8DA8, 0x5D39, 0x8DA9, 0x5D3A, 0x8DAA, 0x5D3B, 0x8DAB, 0x5D3C, 0x8DAC, 0x5D3F, 0x8DAD, 0x5D40, 0x8DAE, 0x5D41, 0x8DAF, 0x5D42, + 0x8DB0, 0x5D43, 0x8DB1, 0x5D44, 0x8DB2, 0x5D45, 0x8DB3, 0x5D46, 0x8DB4, 0x5D48, 0x8DB5, 0x5D49, 0x8DB6, 0x5D4D, 0x8DB7, 0x5D4E, + 0x8DB8, 0x5D4F, 0x8DB9, 0x5D50, 0x8DBA, 0x5D51, 0x8DBB, 0x5D52, 0x8DBC, 0x5D53, 0x8DBD, 0x5D54, 0x8DBE, 0x5D55, 0x8DBF, 0x5D56, + 0x8DC0, 0x5D57, 0x8DC1, 0x5D59, 0x8DC2, 0x5D5A, 0x8DC3, 0x5D5C, 0x8DC4, 0x5D5E, 0x8DC5, 0x5D5F, 0x8DC6, 0x5D60, 0x8DC7, 0x5D61, + 0x8DC8, 0x5D62, 0x8DC9, 0x5D63, 0x8DCA, 0x5D64, 0x8DCB, 0x5D65, 0x8DCC, 0x5D66, 0x8DCD, 0x5D67, 0x8DCE, 0x5D68, 0x8DCF, 0x5D6A, + 0x8DD0, 0x5D6D, 0x8DD1, 0x5D6E, 0x8DD2, 0x5D70, 0x8DD3, 0x5D71, 0x8DD4, 0x5D72, 0x8DD5, 0x5D73, 0x8DD6, 0x5D75, 0x8DD7, 0x5D76, + 0x8DD8, 0x5D77, 0x8DD9, 0x5D78, 0x8DDA, 0x5D79, 0x8DDB, 0x5D7A, 0x8DDC, 0x5D7B, 0x8DDD, 0x5D7C, 0x8DDE, 0x5D7D, 0x8DDF, 0x5D7E, + 0x8DE0, 0x5D7F, 0x8DE1, 0x5D80, 0x8DE2, 0x5D81, 0x8DE3, 0x5D83, 0x8DE4, 0x5D84, 0x8DE5, 0x5D85, 0x8DE6, 0x5D86, 0x8DE7, 0x5D87, + 0x8DE8, 0x5D88, 0x8DE9, 0x5D89, 0x8DEA, 0x5D8A, 0x8DEB, 0x5D8B, 0x8DEC, 0x5D8C, 0x8DED, 0x5D8D, 0x8DEE, 0x5D8E, 0x8DEF, 0x5D8F, + 0x8DF0, 0x5D90, 0x8DF1, 0x5D91, 0x8DF2, 0x5D92, 0x8DF3, 0x5D93, 0x8DF4, 0x5D94, 0x8DF5, 0x5D95, 0x8DF6, 0x5D96, 0x8DF7, 0x5D97, + 0x8DF8, 0x5D98, 0x8DF9, 0x5D9A, 0x8DFA, 0x5D9B, 0x8DFB, 0x5D9C, 0x8DFC, 0x5D9E, 0x8DFD, 0x5D9F, 0x8DFE, 0x5DA0, 0x8E40, 0x5DA1, + 0x8E41, 0x5DA2, 0x8E42, 0x5DA3, 0x8E43, 0x5DA4, 0x8E44, 0x5DA5, 0x8E45, 0x5DA6, 0x8E46, 0x5DA7, 0x8E47, 0x5DA8, 0x8E48, 0x5DA9, + 0x8E49, 0x5DAA, 0x8E4A, 0x5DAB, 0x8E4B, 0x5DAC, 0x8E4C, 0x5DAD, 0x8E4D, 0x5DAE, 0x8E4E, 0x5DAF, 0x8E4F, 0x5DB0, 0x8E50, 0x5DB1, + 0x8E51, 0x5DB2, 0x8E52, 0x5DB3, 0x8E53, 0x5DB4, 0x8E54, 0x5DB5, 0x8E55, 0x5DB6, 0x8E56, 0x5DB8, 0x8E57, 0x5DB9, 0x8E58, 0x5DBA, + 0x8E59, 0x5DBB, 0x8E5A, 0x5DBC, 0x8E5B, 0x5DBD, 0x8E5C, 0x5DBE, 0x8E5D, 0x5DBF, 0x8E5E, 0x5DC0, 0x8E5F, 0x5DC1, 0x8E60, 0x5DC2, + 0x8E61, 0x5DC3, 0x8E62, 0x5DC4, 0x8E63, 0x5DC6, 0x8E64, 0x5DC7, 0x8E65, 0x5DC8, 0x8E66, 0x5DC9, 0x8E67, 0x5DCA, 0x8E68, 0x5DCB, + 0x8E69, 0x5DCC, 0x8E6A, 0x5DCE, 0x8E6B, 0x5DCF, 0x8E6C, 0x5DD0, 0x8E6D, 0x5DD1, 0x8E6E, 0x5DD2, 0x8E6F, 0x5DD3, 0x8E70, 0x5DD4, + 0x8E71, 0x5DD5, 0x8E72, 0x5DD6, 0x8E73, 0x5DD7, 0x8E74, 0x5DD8, 0x8E75, 0x5DD9, 0x8E76, 0x5DDA, 0x8E77, 0x5DDC, 0x8E78, 0x5DDF, + 0x8E79, 0x5DE0, 0x8E7A, 0x5DE3, 0x8E7B, 0x5DE4, 0x8E7C, 0x5DEA, 0x8E7D, 0x5DEC, 0x8E7E, 0x5DED, 0x8E80, 0x5DF0, 0x8E81, 0x5DF5, + 0x8E82, 0x5DF6, 0x8E83, 0x5DF8, 0x8E84, 0x5DF9, 0x8E85, 0x5DFA, 0x8E86, 0x5DFB, 0x8E87, 0x5DFC, 0x8E88, 0x5DFF, 0x8E89, 0x5E00, + 0x8E8A, 0x5E04, 0x8E8B, 0x5E07, 0x8E8C, 0x5E09, 0x8E8D, 0x5E0A, 0x8E8E, 0x5E0B, 0x8E8F, 0x5E0D, 0x8E90, 0x5E0E, 0x8E91, 0x5E12, + 0x8E92, 0x5E13, 0x8E93, 0x5E17, 0x8E94, 0x5E1E, 0x8E95, 0x5E1F, 0x8E96, 0x5E20, 0x8E97, 0x5E21, 0x8E98, 0x5E22, 0x8E99, 0x5E23, + 0x8E9A, 0x5E24, 0x8E9B, 0x5E25, 0x8E9C, 0x5E28, 0x8E9D, 0x5E29, 0x8E9E, 0x5E2A, 0x8E9F, 0x5E2B, 0x8EA0, 0x5E2C, 0x8EA1, 0x5E2F, + 0x8EA2, 0x5E30, 0x8EA3, 0x5E32, 0x8EA4, 0x5E33, 0x8EA5, 0x5E34, 0x8EA6, 0x5E35, 0x8EA7, 0x5E36, 0x8EA8, 0x5E39, 0x8EA9, 0x5E3A, + 0x8EAA, 0x5E3E, 0x8EAB, 0x5E3F, 0x8EAC, 0x5E40, 0x8EAD, 0x5E41, 0x8EAE, 0x5E43, 0x8EAF, 0x5E46, 0x8EB0, 0x5E47, 0x8EB1, 0x5E48, + 0x8EB2, 0x5E49, 0x8EB3, 0x5E4A, 0x8EB4, 0x5E4B, 0x8EB5, 0x5E4D, 0x8EB6, 0x5E4E, 0x8EB7, 0x5E4F, 0x8EB8, 0x5E50, 0x8EB9, 0x5E51, + 0x8EBA, 0x5E52, 0x8EBB, 0x5E53, 0x8EBC, 0x5E56, 0x8EBD, 0x5E57, 0x8EBE, 0x5E58, 0x8EBF, 0x5E59, 0x8EC0, 0x5E5A, 0x8EC1, 0x5E5C, + 0x8EC2, 0x5E5D, 0x8EC3, 0x5E5F, 0x8EC4, 0x5E60, 0x8EC5, 0x5E63, 0x8EC6, 0x5E64, 0x8EC7, 0x5E65, 0x8EC8, 0x5E66, 0x8EC9, 0x5E67, + 0x8ECA, 0x5E68, 0x8ECB, 0x5E69, 0x8ECC, 0x5E6A, 0x8ECD, 0x5E6B, 0x8ECE, 0x5E6C, 0x8ECF, 0x5E6D, 0x8ED0, 0x5E6E, 0x8ED1, 0x5E6F, + 0x8ED2, 0x5E70, 0x8ED3, 0x5E71, 0x8ED4, 0x5E75, 0x8ED5, 0x5E77, 0x8ED6, 0x5E79, 0x8ED7, 0x5E7E, 0x8ED8, 0x5E81, 0x8ED9, 0x5E82, + 0x8EDA, 0x5E83, 0x8EDB, 0x5E85, 0x8EDC, 0x5E88, 0x8EDD, 0x5E89, 0x8EDE, 0x5E8C, 0x8EDF, 0x5E8D, 0x8EE0, 0x5E8E, 0x8EE1, 0x5E92, + 0x8EE2, 0x5E98, 0x8EE3, 0x5E9B, 0x8EE4, 0x5E9D, 0x8EE5, 0x5EA1, 0x8EE6, 0x5EA2, 0x8EE7, 0x5EA3, 0x8EE8, 0x5EA4, 0x8EE9, 0x5EA8, + 0x8EEA, 0x5EA9, 0x8EEB, 0x5EAA, 0x8EEC, 0x5EAB, 0x8EED, 0x5EAC, 0x8EEE, 0x5EAE, 0x8EEF, 0x5EAF, 0x8EF0, 0x5EB0, 0x8EF1, 0x5EB1, + 0x8EF2, 0x5EB2, 0x8EF3, 0x5EB4, 0x8EF4, 0x5EBA, 0x8EF5, 0x5EBB, 0x8EF6, 0x5EBC, 0x8EF7, 0x5EBD, 0x8EF8, 0x5EBF, 0x8EF9, 0x5EC0, + 0x8EFA, 0x5EC1, 0x8EFB, 0x5EC2, 0x8EFC, 0x5EC3, 0x8EFD, 0x5EC4, 0x8EFE, 0x5EC5, 0x8F40, 0x5EC6, 0x8F41, 0x5EC7, 0x8F42, 0x5EC8, + 0x8F43, 0x5ECB, 0x8F44, 0x5ECC, 0x8F45, 0x5ECD, 0x8F46, 0x5ECE, 0x8F47, 0x5ECF, 0x8F48, 0x5ED0, 0x8F49, 0x5ED4, 0x8F4A, 0x5ED5, + 0x8F4B, 0x5ED7, 0x8F4C, 0x5ED8, 0x8F4D, 0x5ED9, 0x8F4E, 0x5EDA, 0x8F4F, 0x5EDC, 0x8F50, 0x5EDD, 0x8F51, 0x5EDE, 0x8F52, 0x5EDF, + 0x8F53, 0x5EE0, 0x8F54, 0x5EE1, 0x8F55, 0x5EE2, 0x8F56, 0x5EE3, 0x8F57, 0x5EE4, 0x8F58, 0x5EE5, 0x8F59, 0x5EE6, 0x8F5A, 0x5EE7, + 0x8F5B, 0x5EE9, 0x8F5C, 0x5EEB, 0x8F5D, 0x5EEC, 0x8F5E, 0x5EED, 0x8F5F, 0x5EEE, 0x8F60, 0x5EEF, 0x8F61, 0x5EF0, 0x8F62, 0x5EF1, + 0x8F63, 0x5EF2, 0x8F64, 0x5EF3, 0x8F65, 0x5EF5, 0x8F66, 0x5EF8, 0x8F67, 0x5EF9, 0x8F68, 0x5EFB, 0x8F69, 0x5EFC, 0x8F6A, 0x5EFD, + 0x8F6B, 0x5F05, 0x8F6C, 0x5F06, 0x8F6D, 0x5F07, 0x8F6E, 0x5F09, 0x8F6F, 0x5F0C, 0x8F70, 0x5F0D, 0x8F71, 0x5F0E, 0x8F72, 0x5F10, + 0x8F73, 0x5F12, 0x8F74, 0x5F14, 0x8F75, 0x5F16, 0x8F76, 0x5F19, 0x8F77, 0x5F1A, 0x8F78, 0x5F1C, 0x8F79, 0x5F1D, 0x8F7A, 0x5F1E, + 0x8F7B, 0x5F21, 0x8F7C, 0x5F22, 0x8F7D, 0x5F23, 0x8F7E, 0x5F24, 0x8F80, 0x5F28, 0x8F81, 0x5F2B, 0x8F82, 0x5F2C, 0x8F83, 0x5F2E, + 0x8F84, 0x5F30, 0x8F85, 0x5F32, 0x8F86, 0x5F33, 0x8F87, 0x5F34, 0x8F88, 0x5F35, 0x8F89, 0x5F36, 0x8F8A, 0x5F37, 0x8F8B, 0x5F38, + 0x8F8C, 0x5F3B, 0x8F8D, 0x5F3D, 0x8F8E, 0x5F3E, 0x8F8F, 0x5F3F, 0x8F90, 0x5F41, 0x8F91, 0x5F42, 0x8F92, 0x5F43, 0x8F93, 0x5F44, + 0x8F94, 0x5F45, 0x8F95, 0x5F46, 0x8F96, 0x5F47, 0x8F97, 0x5F48, 0x8F98, 0x5F49, 0x8F99, 0x5F4A, 0x8F9A, 0x5F4B, 0x8F9B, 0x5F4C, + 0x8F9C, 0x5F4D, 0x8F9D, 0x5F4E, 0x8F9E, 0x5F4F, 0x8F9F, 0x5F51, 0x8FA0, 0x5F54, 0x8FA1, 0x5F59, 0x8FA2, 0x5F5A, 0x8FA3, 0x5F5B, + 0x8FA4, 0x5F5C, 0x8FA5, 0x5F5E, 0x8FA6, 0x5F5F, 0x8FA7, 0x5F60, 0x8FA8, 0x5F63, 0x8FA9, 0x5F65, 0x8FAA, 0x5F67, 0x8FAB, 0x5F68, + 0x8FAC, 0x5F6B, 0x8FAD, 0x5F6E, 0x8FAE, 0x5F6F, 0x8FAF, 0x5F72, 0x8FB0, 0x5F74, 0x8FB1, 0x5F75, 0x8FB2, 0x5F76, 0x8FB3, 0x5F78, + 0x8FB4, 0x5F7A, 0x8FB5, 0x5F7D, 0x8FB6, 0x5F7E, 0x8FB7, 0x5F7F, 0x8FB8, 0x5F83, 0x8FB9, 0x5F86, 0x8FBA, 0x5F8D, 0x8FBB, 0x5F8E, + 0x8FBC, 0x5F8F, 0x8FBD, 0x5F91, 0x8FBE, 0x5F93, 0x8FBF, 0x5F94, 0x8FC0, 0x5F96, 0x8FC1, 0x5F9A, 0x8FC2, 0x5F9B, 0x8FC3, 0x5F9D, + 0x8FC4, 0x5F9E, 0x8FC5, 0x5F9F, 0x8FC6, 0x5FA0, 0x8FC7, 0x5FA2, 0x8FC8, 0x5FA3, 0x8FC9, 0x5FA4, 0x8FCA, 0x5FA5, 0x8FCB, 0x5FA6, + 0x8FCC, 0x5FA7, 0x8FCD, 0x5FA9, 0x8FCE, 0x5FAB, 0x8FCF, 0x5FAC, 0x8FD0, 0x5FAF, 0x8FD1, 0x5FB0, 0x8FD2, 0x5FB1, 0x8FD3, 0x5FB2, + 0x8FD4, 0x5FB3, 0x8FD5, 0x5FB4, 0x8FD6, 0x5FB6, 0x8FD7, 0x5FB8, 0x8FD8, 0x5FB9, 0x8FD9, 0x5FBA, 0x8FDA, 0x5FBB, 0x8FDB, 0x5FBE, + 0x8FDC, 0x5FBF, 0x8FDD, 0x5FC0, 0x8FDE, 0x5FC1, 0x8FDF, 0x5FC2, 0x8FE0, 0x5FC7, 0x8FE1, 0x5FC8, 0x8FE2, 0x5FCA, 0x8FE3, 0x5FCB, + 0x8FE4, 0x5FCE, 0x8FE5, 0x5FD3, 0x8FE6, 0x5FD4, 0x8FE7, 0x5FD5, 0x8FE8, 0x5FDA, 0x8FE9, 0x5FDB, 0x8FEA, 0x5FDC, 0x8FEB, 0x5FDE, + 0x8FEC, 0x5FDF, 0x8FED, 0x5FE2, 0x8FEE, 0x5FE3, 0x8FEF, 0x5FE5, 0x8FF0, 0x5FE6, 0x8FF1, 0x5FE8, 0x8FF2, 0x5FE9, 0x8FF3, 0x5FEC, + 0x8FF4, 0x5FEF, 0x8FF5, 0x5FF0, 0x8FF6, 0x5FF2, 0x8FF7, 0x5FF3, 0x8FF8, 0x5FF4, 0x8FF9, 0x5FF6, 0x8FFA, 0x5FF7, 0x8FFB, 0x5FF9, + 0x8FFC, 0x5FFA, 0x8FFD, 0x5FFC, 0x8FFE, 0x6007, 0x9040, 0x6008, 0x9041, 0x6009, 0x9042, 0x600B, 0x9043, 0x600C, 0x9044, 0x6010, + 0x9045, 0x6011, 0x9046, 0x6013, 0x9047, 0x6017, 0x9048, 0x6018, 0x9049, 0x601A, 0x904A, 0x601E, 0x904B, 0x601F, 0x904C, 0x6022, + 0x904D, 0x6023, 0x904E, 0x6024, 0x904F, 0x602C, 0x9050, 0x602D, 0x9051, 0x602E, 0x9052, 0x6030, 0x9053, 0x6031, 0x9054, 0x6032, + 0x9055, 0x6033, 0x9056, 0x6034, 0x9057, 0x6036, 0x9058, 0x6037, 0x9059, 0x6038, 0x905A, 0x6039, 0x905B, 0x603A, 0x905C, 0x603D, + 0x905D, 0x603E, 0x905E, 0x6040, 0x905F, 0x6044, 0x9060, 0x6045, 0x9061, 0x6046, 0x9062, 0x6047, 0x9063, 0x6048, 0x9064, 0x6049, + 0x9065, 0x604A, 0x9066, 0x604C, 0x9067, 0x604E, 0x9068, 0x604F, 0x9069, 0x6051, 0x906A, 0x6053, 0x906B, 0x6054, 0x906C, 0x6056, + 0x906D, 0x6057, 0x906E, 0x6058, 0x906F, 0x605B, 0x9070, 0x605C, 0x9071, 0x605E, 0x9072, 0x605F, 0x9073, 0x6060, 0x9074, 0x6061, + 0x9075, 0x6065, 0x9076, 0x6066, 0x9077, 0x606E, 0x9078, 0x6071, 0x9079, 0x6072, 0x907A, 0x6074, 0x907B, 0x6075, 0x907C, 0x6077, + 0x907D, 0x607E, 0x907E, 0x6080, 0x9080, 0x6081, 0x9081, 0x6082, 0x9082, 0x6085, 0x9083, 0x6086, 0x9084, 0x6087, 0x9085, 0x6088, + 0x9086, 0x608A, 0x9087, 0x608B, 0x9088, 0x608E, 0x9089, 0x608F, 0x908A, 0x6090, 0x908B, 0x6091, 0x908C, 0x6093, 0x908D, 0x6095, + 0x908E, 0x6097, 0x908F, 0x6098, 0x9090, 0x6099, 0x9091, 0x609C, 0x9092, 0x609E, 0x9093, 0x60A1, 0x9094, 0x60A2, 0x9095, 0x60A4, + 0x9096, 0x60A5, 0x9097, 0x60A7, 0x9098, 0x60A9, 0x9099, 0x60AA, 0x909A, 0x60AE, 0x909B, 0x60B0, 0x909C, 0x60B3, 0x909D, 0x60B5, + 0x909E, 0x60B6, 0x909F, 0x60B7, 0x90A0, 0x60B9, 0x90A1, 0x60BA, 0x90A2, 0x60BD, 0x90A3, 0x60BE, 0x90A4, 0x60BF, 0x90A5, 0x60C0, + 0x90A6, 0x60C1, 0x90A7, 0x60C2, 0x90A8, 0x60C3, 0x90A9, 0x60C4, 0x90AA, 0x60C7, 0x90AB, 0x60C8, 0x90AC, 0x60C9, 0x90AD, 0x60CC, + 0x90AE, 0x60CD, 0x90AF, 0x60CE, 0x90B0, 0x60CF, 0x90B1, 0x60D0, 0x90B2, 0x60D2, 0x90B3, 0x60D3, 0x90B4, 0x60D4, 0x90B5, 0x60D6, + 0x90B6, 0x60D7, 0x90B7, 0x60D9, 0x90B8, 0x60DB, 0x90B9, 0x60DE, 0x90BA, 0x60E1, 0x90BB, 0x60E2, 0x90BC, 0x60E3, 0x90BD, 0x60E4, + 0x90BE, 0x60E5, 0x90BF, 0x60EA, 0x90C0, 0x60F1, 0x90C1, 0x60F2, 0x90C2, 0x60F5, 0x90C3, 0x60F7, 0x90C4, 0x60F8, 0x90C5, 0x60FB, + 0x90C6, 0x60FC, 0x90C7, 0x60FD, 0x90C8, 0x60FE, 0x90C9, 0x60FF, 0x90CA, 0x6102, 0x90CB, 0x6103, 0x90CC, 0x6104, 0x90CD, 0x6105, + 0x90CE, 0x6107, 0x90CF, 0x610A, 0x90D0, 0x610B, 0x90D1, 0x610C, 0x90D2, 0x6110, 0x90D3, 0x6111, 0x90D4, 0x6112, 0x90D5, 0x6113, + 0x90D6, 0x6114, 0x90D7, 0x6116, 0x90D8, 0x6117, 0x90D9, 0x6118, 0x90DA, 0x6119, 0x90DB, 0x611B, 0x90DC, 0x611C, 0x90DD, 0x611D, + 0x90DE, 0x611E, 0x90DF, 0x6121, 0x90E0, 0x6122, 0x90E1, 0x6125, 0x90E2, 0x6128, 0x90E3, 0x6129, 0x90E4, 0x612A, 0x90E5, 0x612C, + 0x90E6, 0x612D, 0x90E7, 0x612E, 0x90E8, 0x612F, 0x90E9, 0x6130, 0x90EA, 0x6131, 0x90EB, 0x6132, 0x90EC, 0x6133, 0x90ED, 0x6134, + 0x90EE, 0x6135, 0x90EF, 0x6136, 0x90F0, 0x6137, 0x90F1, 0x6138, 0x90F2, 0x6139, 0x90F3, 0x613A, 0x90F4, 0x613B, 0x90F5, 0x613C, + 0x90F6, 0x613D, 0x90F7, 0x613E, 0x90F8, 0x6140, 0x90F9, 0x6141, 0x90FA, 0x6142, 0x90FB, 0x6143, 0x90FC, 0x6144, 0x90FD, 0x6145, + 0x90FE, 0x6146, 0x9140, 0x6147, 0x9141, 0x6149, 0x9142, 0x614B, 0x9143, 0x614D, 0x9144, 0x614F, 0x9145, 0x6150, 0x9146, 0x6152, + 0x9147, 0x6153, 0x9148, 0x6154, 0x9149, 0x6156, 0x914A, 0x6157, 0x914B, 0x6158, 0x914C, 0x6159, 0x914D, 0x615A, 0x914E, 0x615B, + 0x914F, 0x615C, 0x9150, 0x615E, 0x9151, 0x615F, 0x9152, 0x6160, 0x9153, 0x6161, 0x9154, 0x6163, 0x9155, 0x6164, 0x9156, 0x6165, + 0x9157, 0x6166, 0x9158, 0x6169, 0x9159, 0x616A, 0x915A, 0x616B, 0x915B, 0x616C, 0x915C, 0x616D, 0x915D, 0x616E, 0x915E, 0x616F, + 0x915F, 0x6171, 0x9160, 0x6172, 0x9161, 0x6173, 0x9162, 0x6174, 0x9163, 0x6176, 0x9164, 0x6178, 0x9165, 0x6179, 0x9166, 0x617A, + 0x9167, 0x617B, 0x9168, 0x617C, 0x9169, 0x617D, 0x916A, 0x617E, 0x916B, 0x617F, 0x916C, 0x6180, 0x916D, 0x6181, 0x916E, 0x6182, + 0x916F, 0x6183, 0x9170, 0x6184, 0x9171, 0x6185, 0x9172, 0x6186, 0x9173, 0x6187, 0x9174, 0x6188, 0x9175, 0x6189, 0x9176, 0x618A, + 0x9177, 0x618C, 0x9178, 0x618D, 0x9179, 0x618F, 0x917A, 0x6190, 0x917B, 0x6191, 0x917C, 0x6192, 0x917D, 0x6193, 0x917E, 0x6195, + 0x9180, 0x6196, 0x9181, 0x6197, 0x9182, 0x6198, 0x9183, 0x6199, 0x9184, 0x619A, 0x9185, 0x619B, 0x9186, 0x619C, 0x9187, 0x619E, + 0x9188, 0x619F, 0x9189, 0x61A0, 0x918A, 0x61A1, 0x918B, 0x61A2, 0x918C, 0x61A3, 0x918D, 0x61A4, 0x918E, 0x61A5, 0x918F, 0x61A6, + 0x9190, 0x61AA, 0x9191, 0x61AB, 0x9192, 0x61AD, 0x9193, 0x61AE, 0x9194, 0x61AF, 0x9195, 0x61B0, 0x9196, 0x61B1, 0x9197, 0x61B2, + 0x9198, 0x61B3, 0x9199, 0x61B4, 0x919A, 0x61B5, 0x919B, 0x61B6, 0x919C, 0x61B8, 0x919D, 0x61B9, 0x919E, 0x61BA, 0x919F, 0x61BB, + 0x91A0, 0x61BC, 0x91A1, 0x61BD, 0x91A2, 0x61BF, 0x91A3, 0x61C0, 0x91A4, 0x61C1, 0x91A5, 0x61C3, 0x91A6, 0x61C4, 0x91A7, 0x61C5, + 0x91A8, 0x61C6, 0x91A9, 0x61C7, 0x91AA, 0x61C9, 0x91AB, 0x61CC, 0x91AC, 0x61CD, 0x91AD, 0x61CE, 0x91AE, 0x61CF, 0x91AF, 0x61D0, + 0x91B0, 0x61D3, 0x91B1, 0x61D5, 0x91B2, 0x61D6, 0x91B3, 0x61D7, 0x91B4, 0x61D8, 0x91B5, 0x61D9, 0x91B6, 0x61DA, 0x91B7, 0x61DB, + 0x91B8, 0x61DC, 0x91B9, 0x61DD, 0x91BA, 0x61DE, 0x91BB, 0x61DF, 0x91BC, 0x61E0, 0x91BD, 0x61E1, 0x91BE, 0x61E2, 0x91BF, 0x61E3, + 0x91C0, 0x61E4, 0x91C1, 0x61E5, 0x91C2, 0x61E7, 0x91C3, 0x61E8, 0x91C4, 0x61E9, 0x91C5, 0x61EA, 0x91C6, 0x61EB, 0x91C7, 0x61EC, + 0x91C8, 0x61ED, 0x91C9, 0x61EE, 0x91CA, 0x61EF, 0x91CB, 0x61F0, 0x91CC, 0x61F1, 0x91CD, 0x61F2, 0x91CE, 0x61F3, 0x91CF, 0x61F4, + 0x91D0, 0x61F6, 0x91D1, 0x61F7, 0x91D2, 0x61F8, 0x91D3, 0x61F9, 0x91D4, 0x61FA, 0x91D5, 0x61FB, 0x91D6, 0x61FC, 0x91D7, 0x61FD, + 0x91D8, 0x61FE, 0x91D9, 0x6200, 0x91DA, 0x6201, 0x91DB, 0x6202, 0x91DC, 0x6203, 0x91DD, 0x6204, 0x91DE, 0x6205, 0x91DF, 0x6207, + 0x91E0, 0x6209, 0x91E1, 0x6213, 0x91E2, 0x6214, 0x91E3, 0x6219, 0x91E4, 0x621C, 0x91E5, 0x621D, 0x91E6, 0x621E, 0x91E7, 0x6220, + 0x91E8, 0x6223, 0x91E9, 0x6226, 0x91EA, 0x6227, 0x91EB, 0x6228, 0x91EC, 0x6229, 0x91ED, 0x622B, 0x91EE, 0x622D, 0x91EF, 0x622F, + 0x91F0, 0x6230, 0x91F1, 0x6231, 0x91F2, 0x6232, 0x91F3, 0x6235, 0x91F4, 0x6236, 0x91F5, 0x6238, 0x91F6, 0x6239, 0x91F7, 0x623A, + 0x91F8, 0x623B, 0x91F9, 0x623C, 0x91FA, 0x6242, 0x91FB, 0x6244, 0x91FC, 0x6245, 0x91FD, 0x6246, 0x91FE, 0x624A, 0x9240, 0x624F, + 0x9241, 0x6250, 0x9242, 0x6255, 0x9243, 0x6256, 0x9244, 0x6257, 0x9245, 0x6259, 0x9246, 0x625A, 0x9247, 0x625C, 0x9248, 0x625D, + 0x9249, 0x625E, 0x924A, 0x625F, 0x924B, 0x6260, 0x924C, 0x6261, 0x924D, 0x6262, 0x924E, 0x6264, 0x924F, 0x6265, 0x9250, 0x6268, + 0x9251, 0x6271, 0x9252, 0x6272, 0x9253, 0x6274, 0x9254, 0x6275, 0x9255, 0x6277, 0x9256, 0x6278, 0x9257, 0x627A, 0x9258, 0x627B, + 0x9259, 0x627D, 0x925A, 0x6281, 0x925B, 0x6282, 0x925C, 0x6283, 0x925D, 0x6285, 0x925E, 0x6286, 0x925F, 0x6287, 0x9260, 0x6288, + 0x9261, 0x628B, 0x9262, 0x628C, 0x9263, 0x628D, 0x9264, 0x628E, 0x9265, 0x628F, 0x9266, 0x6290, 0x9267, 0x6294, 0x9268, 0x6299, + 0x9269, 0x629C, 0x926A, 0x629D, 0x926B, 0x629E, 0x926C, 0x62A3, 0x926D, 0x62A6, 0x926E, 0x62A7, 0x926F, 0x62A9, 0x9270, 0x62AA, + 0x9271, 0x62AD, 0x9272, 0x62AE, 0x9273, 0x62AF, 0x9274, 0x62B0, 0x9275, 0x62B2, 0x9276, 0x62B3, 0x9277, 0x62B4, 0x9278, 0x62B6, + 0x9279, 0x62B7, 0x927A, 0x62B8, 0x927B, 0x62BA, 0x927C, 0x62BE, 0x927D, 0x62C0, 0x927E, 0x62C1, 0x9280, 0x62C3, 0x9281, 0x62CB, + 0x9282, 0x62CF, 0x9283, 0x62D1, 0x9284, 0x62D5, 0x9285, 0x62DD, 0x9286, 0x62DE, 0x9287, 0x62E0, 0x9288, 0x62E1, 0x9289, 0x62E4, + 0x928A, 0x62EA, 0x928B, 0x62EB, 0x928C, 0x62F0, 0x928D, 0x62F2, 0x928E, 0x62F5, 0x928F, 0x62F8, 0x9290, 0x62F9, 0x9291, 0x62FA, + 0x9292, 0x62FB, 0x9293, 0x6300, 0x9294, 0x6303, 0x9295, 0x6304, 0x9296, 0x6305, 0x9297, 0x6306, 0x9298, 0x630A, 0x9299, 0x630B, + 0x929A, 0x630C, 0x929B, 0x630D, 0x929C, 0x630F, 0x929D, 0x6310, 0x929E, 0x6312, 0x929F, 0x6313, 0x92A0, 0x6314, 0x92A1, 0x6315, + 0x92A2, 0x6317, 0x92A3, 0x6318, 0x92A4, 0x6319, 0x92A5, 0x631C, 0x92A6, 0x6326, 0x92A7, 0x6327, 0x92A8, 0x6329, 0x92A9, 0x632C, + 0x92AA, 0x632D, 0x92AB, 0x632E, 0x92AC, 0x6330, 0x92AD, 0x6331, 0x92AE, 0x6333, 0x92AF, 0x6334, 0x92B0, 0x6335, 0x92B1, 0x6336, + 0x92B2, 0x6337, 0x92B3, 0x6338, 0x92B4, 0x633B, 0x92B5, 0x633C, 0x92B6, 0x633E, 0x92B7, 0x633F, 0x92B8, 0x6340, 0x92B9, 0x6341, + 0x92BA, 0x6344, 0x92BB, 0x6347, 0x92BC, 0x6348, 0x92BD, 0x634A, 0x92BE, 0x6351, 0x92BF, 0x6352, 0x92C0, 0x6353, 0x92C1, 0x6354, + 0x92C2, 0x6356, 0x92C3, 0x6357, 0x92C4, 0x6358, 0x92C5, 0x6359, 0x92C6, 0x635A, 0x92C7, 0x635B, 0x92C8, 0x635C, 0x92C9, 0x635D, + 0x92CA, 0x6360, 0x92CB, 0x6364, 0x92CC, 0x6365, 0x92CD, 0x6366, 0x92CE, 0x6368, 0x92CF, 0x636A, 0x92D0, 0x636B, 0x92D1, 0x636C, + 0x92D2, 0x636F, 0x92D3, 0x6370, 0x92D4, 0x6372, 0x92D5, 0x6373, 0x92D6, 0x6374, 0x92D7, 0x6375, 0x92D8, 0x6378, 0x92D9, 0x6379, + 0x92DA, 0x637C, 0x92DB, 0x637D, 0x92DC, 0x637E, 0x92DD, 0x637F, 0x92DE, 0x6381, 0x92DF, 0x6383, 0x92E0, 0x6384, 0x92E1, 0x6385, + 0x92E2, 0x6386, 0x92E3, 0x638B, 0x92E4, 0x638D, 0x92E5, 0x6391, 0x92E6, 0x6393, 0x92E7, 0x6394, 0x92E8, 0x6395, 0x92E9, 0x6397, + 0x92EA, 0x6399, 0x92EB, 0x639A, 0x92EC, 0x639B, 0x92ED, 0x639C, 0x92EE, 0x639D, 0x92EF, 0x639E, 0x92F0, 0x639F, 0x92F1, 0x63A1, + 0x92F2, 0x63A4, 0x92F3, 0x63A6, 0x92F4, 0x63AB, 0x92F5, 0x63AF, 0x92F6, 0x63B1, 0x92F7, 0x63B2, 0x92F8, 0x63B5, 0x92F9, 0x63B6, + 0x92FA, 0x63B9, 0x92FB, 0x63BB, 0x92FC, 0x63BD, 0x92FD, 0x63BF, 0x92FE, 0x63C0, 0x9340, 0x63C1, 0x9341, 0x63C2, 0x9342, 0x63C3, + 0x9343, 0x63C5, 0x9344, 0x63C7, 0x9345, 0x63C8, 0x9346, 0x63CA, 0x9347, 0x63CB, 0x9348, 0x63CC, 0x9349, 0x63D1, 0x934A, 0x63D3, + 0x934B, 0x63D4, 0x934C, 0x63D5, 0x934D, 0x63D7, 0x934E, 0x63D8, 0x934F, 0x63D9, 0x9350, 0x63DA, 0x9351, 0x63DB, 0x9352, 0x63DC, + 0x9353, 0x63DD, 0x9354, 0x63DF, 0x9355, 0x63E2, 0x9356, 0x63E4, 0x9357, 0x63E5, 0x9358, 0x63E6, 0x9359, 0x63E7, 0x935A, 0x63E8, + 0x935B, 0x63EB, 0x935C, 0x63EC, 0x935D, 0x63EE, 0x935E, 0x63EF, 0x935F, 0x63F0, 0x9360, 0x63F1, 0x9361, 0x63F3, 0x9362, 0x63F5, + 0x9363, 0x63F7, 0x9364, 0x63F9, 0x9365, 0x63FA, 0x9366, 0x63FB, 0x9367, 0x63FC, 0x9368, 0x63FE, 0x9369, 0x6403, 0x936A, 0x6404, + 0x936B, 0x6406, 0x936C, 0x6407, 0x936D, 0x6408, 0x936E, 0x6409, 0x936F, 0x640A, 0x9370, 0x640D, 0x9371, 0x640E, 0x9372, 0x6411, + 0x9373, 0x6412, 0x9374, 0x6415, 0x9375, 0x6416, 0x9376, 0x6417, 0x9377, 0x6418, 0x9378, 0x6419, 0x9379, 0x641A, 0x937A, 0x641D, + 0x937B, 0x641F, 0x937C, 0x6422, 0x937D, 0x6423, 0x937E, 0x6424, 0x9380, 0x6425, 0x9381, 0x6427, 0x9382, 0x6428, 0x9383, 0x6429, + 0x9384, 0x642B, 0x9385, 0x642E, 0x9386, 0x642F, 0x9387, 0x6430, 0x9388, 0x6431, 0x9389, 0x6432, 0x938A, 0x6433, 0x938B, 0x6435, + 0x938C, 0x6436, 0x938D, 0x6437, 0x938E, 0x6438, 0x938F, 0x6439, 0x9390, 0x643B, 0x9391, 0x643C, 0x9392, 0x643E, 0x9393, 0x6440, + 0x9394, 0x6442, 0x9395, 0x6443, 0x9396, 0x6449, 0x9397, 0x644B, 0x9398, 0x644C, 0x9399, 0x644D, 0x939A, 0x644E, 0x939B, 0x644F, + 0x939C, 0x6450, 0x939D, 0x6451, 0x939E, 0x6453, 0x939F, 0x6455, 0x93A0, 0x6456, 0x93A1, 0x6457, 0x93A2, 0x6459, 0x93A3, 0x645A, + 0x93A4, 0x645B, 0x93A5, 0x645C, 0x93A6, 0x645D, 0x93A7, 0x645F, 0x93A8, 0x6460, 0x93A9, 0x6461, 0x93AA, 0x6462, 0x93AB, 0x6463, + 0x93AC, 0x6464, 0x93AD, 0x6465, 0x93AE, 0x6466, 0x93AF, 0x6468, 0x93B0, 0x646A, 0x93B1, 0x646B, 0x93B2, 0x646C, 0x93B3, 0x646E, + 0x93B4, 0x646F, 0x93B5, 0x6470, 0x93B6, 0x6471, 0x93B7, 0x6472, 0x93B8, 0x6473, 0x93B9, 0x6474, 0x93BA, 0x6475, 0x93BB, 0x6476, + 0x93BC, 0x6477, 0x93BD, 0x647B, 0x93BE, 0x647C, 0x93BF, 0x647D, 0x93C0, 0x647E, 0x93C1, 0x647F, 0x93C2, 0x6480, 0x93C3, 0x6481, + 0x93C4, 0x6483, 0x93C5, 0x6486, 0x93C6, 0x6488, 0x93C7, 0x6489, 0x93C8, 0x648A, 0x93C9, 0x648B, 0x93CA, 0x648C, 0x93CB, 0x648D, + 0x93CC, 0x648E, 0x93CD, 0x648F, 0x93CE, 0x6490, 0x93CF, 0x6493, 0x93D0, 0x6494, 0x93D1, 0x6497, 0x93D2, 0x6498, 0x93D3, 0x649A, + 0x93D4, 0x649B, 0x93D5, 0x649C, 0x93D6, 0x649D, 0x93D7, 0x649F, 0x93D8, 0x64A0, 0x93D9, 0x64A1, 0x93DA, 0x64A2, 0x93DB, 0x64A3, + 0x93DC, 0x64A5, 0x93DD, 0x64A6, 0x93DE, 0x64A7, 0x93DF, 0x64A8, 0x93E0, 0x64AA, 0x93E1, 0x64AB, 0x93E2, 0x64AF, 0x93E3, 0x64B1, + 0x93E4, 0x64B2, 0x93E5, 0x64B3, 0x93E6, 0x64B4, 0x93E7, 0x64B6, 0x93E8, 0x64B9, 0x93E9, 0x64BB, 0x93EA, 0x64BD, 0x93EB, 0x64BE, + 0x93EC, 0x64BF, 0x93ED, 0x64C1, 0x93EE, 0x64C3, 0x93EF, 0x64C4, 0x93F0, 0x64C6, 0x93F1, 0x64C7, 0x93F2, 0x64C8, 0x93F3, 0x64C9, + 0x93F4, 0x64CA, 0x93F5, 0x64CB, 0x93F6, 0x64CC, 0x93F7, 0x64CF, 0x93F8, 0x64D1, 0x93F9, 0x64D3, 0x93FA, 0x64D4, 0x93FB, 0x64D5, + 0x93FC, 0x64D6, 0x93FD, 0x64D9, 0x93FE, 0x64DA, 0x9440, 0x64DB, 0x9441, 0x64DC, 0x9442, 0x64DD, 0x9443, 0x64DF, 0x9444, 0x64E0, + 0x9445, 0x64E1, 0x9446, 0x64E3, 0x9447, 0x64E5, 0x9448, 0x64E7, 0x9449, 0x64E8, 0x944A, 0x64E9, 0x944B, 0x64EA, 0x944C, 0x64EB, + 0x944D, 0x64EC, 0x944E, 0x64ED, 0x944F, 0x64EE, 0x9450, 0x64EF, 0x9451, 0x64F0, 0x9452, 0x64F1, 0x9453, 0x64F2, 0x9454, 0x64F3, + 0x9455, 0x64F4, 0x9456, 0x64F5, 0x9457, 0x64F6, 0x9458, 0x64F7, 0x9459, 0x64F8, 0x945A, 0x64F9, 0x945B, 0x64FA, 0x945C, 0x64FB, + 0x945D, 0x64FC, 0x945E, 0x64FD, 0x945F, 0x64FE, 0x9460, 0x64FF, 0x9461, 0x6501, 0x9462, 0x6502, 0x9463, 0x6503, 0x9464, 0x6504, + 0x9465, 0x6505, 0x9466, 0x6506, 0x9467, 0x6507, 0x9468, 0x6508, 0x9469, 0x650A, 0x946A, 0x650B, 0x946B, 0x650C, 0x946C, 0x650D, + 0x946D, 0x650E, 0x946E, 0x650F, 0x946F, 0x6510, 0x9470, 0x6511, 0x9471, 0x6513, 0x9472, 0x6514, 0x9473, 0x6515, 0x9474, 0x6516, + 0x9475, 0x6517, 0x9476, 0x6519, 0x9477, 0x651A, 0x9478, 0x651B, 0x9479, 0x651C, 0x947A, 0x651D, 0x947B, 0x651E, 0x947C, 0x651F, + 0x947D, 0x6520, 0x947E, 0x6521, 0x9480, 0x6522, 0x9481, 0x6523, 0x9482, 0x6524, 0x9483, 0x6526, 0x9484, 0x6527, 0x9485, 0x6528, + 0x9486, 0x6529, 0x9487, 0x652A, 0x9488, 0x652C, 0x9489, 0x652D, 0x948A, 0x6530, 0x948B, 0x6531, 0x948C, 0x6532, 0x948D, 0x6533, + 0x948E, 0x6537, 0x948F, 0x653A, 0x9490, 0x653C, 0x9491, 0x653D, 0x9492, 0x6540, 0x9493, 0x6541, 0x9494, 0x6542, 0x9495, 0x6543, + 0x9496, 0x6544, 0x9497, 0x6546, 0x9498, 0x6547, 0x9499, 0x654A, 0x949A, 0x654B, 0x949B, 0x654D, 0x949C, 0x654E, 0x949D, 0x6550, + 0x949E, 0x6552, 0x949F, 0x6553, 0x94A0, 0x6554, 0x94A1, 0x6557, 0x94A2, 0x6558, 0x94A3, 0x655A, 0x94A4, 0x655C, 0x94A5, 0x655F, + 0x94A6, 0x6560, 0x94A7, 0x6561, 0x94A8, 0x6564, 0x94A9, 0x6565, 0x94AA, 0x6567, 0x94AB, 0x6568, 0x94AC, 0x6569, 0x94AD, 0x656A, + 0x94AE, 0x656D, 0x94AF, 0x656E, 0x94B0, 0x656F, 0x94B1, 0x6571, 0x94B2, 0x6573, 0x94B3, 0x6575, 0x94B4, 0x6576, 0x94B5, 0x6578, + 0x94B6, 0x6579, 0x94B7, 0x657A, 0x94B8, 0x657B, 0x94B9, 0x657C, 0x94BA, 0x657D, 0x94BB, 0x657E, 0x94BC, 0x657F, 0x94BD, 0x6580, + 0x94BE, 0x6581, 0x94BF, 0x6582, 0x94C0, 0x6583, 0x94C1, 0x6584, 0x94C2, 0x6585, 0x94C3, 0x6586, 0x94C4, 0x6588, 0x94C5, 0x6589, + 0x94C6, 0x658A, 0x94C7, 0x658D, 0x94C8, 0x658E, 0x94C9, 0x658F, 0x94CA, 0x6592, 0x94CB, 0x6594, 0x94CC, 0x6595, 0x94CD, 0x6596, + 0x94CE, 0x6598, 0x94CF, 0x659A, 0x94D0, 0x659D, 0x94D1, 0x659E, 0x94D2, 0x65A0, 0x94D3, 0x65A2, 0x94D4, 0x65A3, 0x94D5, 0x65A6, + 0x94D6, 0x65A8, 0x94D7, 0x65AA, 0x94D8, 0x65AC, 0x94D9, 0x65AE, 0x94DA, 0x65B1, 0x94DB, 0x65B2, 0x94DC, 0x65B3, 0x94DD, 0x65B4, + 0x94DE, 0x65B5, 0x94DF, 0x65B6, 0x94E0, 0x65B7, 0x94E1, 0x65B8, 0x94E2, 0x65BA, 0x94E3, 0x65BB, 0x94E4, 0x65BE, 0x94E5, 0x65BF, + 0x94E6, 0x65C0, 0x94E7, 0x65C2, 0x94E8, 0x65C7, 0x94E9, 0x65C8, 0x94EA, 0x65C9, 0x94EB, 0x65CA, 0x94EC, 0x65CD, 0x94ED, 0x65D0, + 0x94EE, 0x65D1, 0x94EF, 0x65D3, 0x94F0, 0x65D4, 0x94F1, 0x65D5, 0x94F2, 0x65D8, 0x94F3, 0x65D9, 0x94F4, 0x65DA, 0x94F5, 0x65DB, + 0x94F6, 0x65DC, 0x94F7, 0x65DD, 0x94F8, 0x65DE, 0x94F9, 0x65DF, 0x94FA, 0x65E1, 0x94FB, 0x65E3, 0x94FC, 0x65E4, 0x94FD, 0x65EA, + 0x94FE, 0x65EB, 0x9540, 0x65F2, 0x9541, 0x65F3, 0x9542, 0x65F4, 0x9543, 0x65F5, 0x9544, 0x65F8, 0x9545, 0x65F9, 0x9546, 0x65FB, + 0x9547, 0x65FC, 0x9548, 0x65FD, 0x9549, 0x65FE, 0x954A, 0x65FF, 0x954B, 0x6601, 0x954C, 0x6604, 0x954D, 0x6605, 0x954E, 0x6607, + 0x954F, 0x6608, 0x9550, 0x6609, 0x9551, 0x660B, 0x9552, 0x660D, 0x9553, 0x6610, 0x9554, 0x6611, 0x9555, 0x6612, 0x9556, 0x6616, + 0x9557, 0x6617, 0x9558, 0x6618, 0x9559, 0x661A, 0x955A, 0x661B, 0x955B, 0x661C, 0x955C, 0x661E, 0x955D, 0x6621, 0x955E, 0x6622, + 0x955F, 0x6623, 0x9560, 0x6624, 0x9561, 0x6626, 0x9562, 0x6629, 0x9563, 0x662A, 0x9564, 0x662B, 0x9565, 0x662C, 0x9566, 0x662E, + 0x9567, 0x6630, 0x9568, 0x6632, 0x9569, 0x6633, 0x956A, 0x6637, 0x956B, 0x6638, 0x956C, 0x6639, 0x956D, 0x663A, 0x956E, 0x663B, + 0x956F, 0x663D, 0x9570, 0x663F, 0x9571, 0x6640, 0x9572, 0x6642, 0x9573, 0x6644, 0x9574, 0x6645, 0x9575, 0x6646, 0x9576, 0x6647, + 0x9577, 0x6648, 0x9578, 0x6649, 0x9579, 0x664A, 0x957A, 0x664D, 0x957B, 0x664E, 0x957C, 0x6650, 0x957D, 0x6651, 0x957E, 0x6658, + 0x9580, 0x6659, 0x9581, 0x665B, 0x9582, 0x665C, 0x9583, 0x665D, 0x9584, 0x665E, 0x9585, 0x6660, 0x9586, 0x6662, 0x9587, 0x6663, + 0x9588, 0x6665, 0x9589, 0x6667, 0x958A, 0x6669, 0x958B, 0x666A, 0x958C, 0x666B, 0x958D, 0x666C, 0x958E, 0x666D, 0x958F, 0x6671, + 0x9590, 0x6672, 0x9591, 0x6673, 0x9592, 0x6675, 0x9593, 0x6678, 0x9594, 0x6679, 0x9595, 0x667B, 0x9596, 0x667C, 0x9597, 0x667D, + 0x9598, 0x667F, 0x9599, 0x6680, 0x959A, 0x6681, 0x959B, 0x6683, 0x959C, 0x6685, 0x959D, 0x6686, 0x959E, 0x6688, 0x959F, 0x6689, + 0x95A0, 0x668A, 0x95A1, 0x668B, 0x95A2, 0x668D, 0x95A3, 0x668E, 0x95A4, 0x668F, 0x95A5, 0x6690, 0x95A6, 0x6692, 0x95A7, 0x6693, + 0x95A8, 0x6694, 0x95A9, 0x6695, 0x95AA, 0x6698, 0x95AB, 0x6699, 0x95AC, 0x669A, 0x95AD, 0x669B, 0x95AE, 0x669C, 0x95AF, 0x669E, + 0x95B0, 0x669F, 0x95B1, 0x66A0, 0x95B2, 0x66A1, 0x95B3, 0x66A2, 0x95B4, 0x66A3, 0x95B5, 0x66A4, 0x95B6, 0x66A5, 0x95B7, 0x66A6, + 0x95B8, 0x66A9, 0x95B9, 0x66AA, 0x95BA, 0x66AB, 0x95BB, 0x66AC, 0x95BC, 0x66AD, 0x95BD, 0x66AF, 0x95BE, 0x66B0, 0x95BF, 0x66B1, + 0x95C0, 0x66B2, 0x95C1, 0x66B3, 0x95C2, 0x66B5, 0x95C3, 0x66B6, 0x95C4, 0x66B7, 0x95C5, 0x66B8, 0x95C6, 0x66BA, 0x95C7, 0x66BB, + 0x95C8, 0x66BC, 0x95C9, 0x66BD, 0x95CA, 0x66BF, 0x95CB, 0x66C0, 0x95CC, 0x66C1, 0x95CD, 0x66C2, 0x95CE, 0x66C3, 0x95CF, 0x66C4, + 0x95D0, 0x66C5, 0x95D1, 0x66C6, 0x95D2, 0x66C7, 0x95D3, 0x66C8, 0x95D4, 0x66C9, 0x95D5, 0x66CA, 0x95D6, 0x66CB, 0x95D7, 0x66CC, + 0x95D8, 0x66CD, 0x95D9, 0x66CE, 0x95DA, 0x66CF, 0x95DB, 0x66D0, 0x95DC, 0x66D1, 0x95DD, 0x66D2, 0x95DE, 0x66D3, 0x95DF, 0x66D4, + 0x95E0, 0x66D5, 0x95E1, 0x66D6, 0x95E2, 0x66D7, 0x95E3, 0x66D8, 0x95E4, 0x66DA, 0x95E5, 0x66DE, 0x95E6, 0x66DF, 0x95E7, 0x66E0, + 0x95E8, 0x66E1, 0x95E9, 0x66E2, 0x95EA, 0x66E3, 0x95EB, 0x66E4, 0x95EC, 0x66E5, 0x95ED, 0x66E7, 0x95EE, 0x66E8, 0x95EF, 0x66EA, + 0x95F0, 0x66EB, 0x95F1, 0x66EC, 0x95F2, 0x66ED, 0x95F3, 0x66EE, 0x95F4, 0x66EF, 0x95F5, 0x66F1, 0x95F6, 0x66F5, 0x95F7, 0x66F6, + 0x95F8, 0x66F8, 0x95F9, 0x66FA, 0x95FA, 0x66FB, 0x95FB, 0x66FD, 0x95FC, 0x6701, 0x95FD, 0x6702, 0x95FE, 0x6703, 0x9640, 0x6704, + 0x9641, 0x6705, 0x9642, 0x6706, 0x9643, 0x6707, 0x9644, 0x670C, 0x9645, 0x670E, 0x9646, 0x670F, 0x9647, 0x6711, 0x9648, 0x6712, + 0x9649, 0x6713, 0x964A, 0x6716, 0x964B, 0x6718, 0x964C, 0x6719, 0x964D, 0x671A, 0x964E, 0x671C, 0x964F, 0x671E, 0x9650, 0x6720, + 0x9651, 0x6721, 0x9652, 0x6722, 0x9653, 0x6723, 0x9654, 0x6724, 0x9655, 0x6725, 0x9656, 0x6727, 0x9657, 0x6729, 0x9658, 0x672E, + 0x9659, 0x6730, 0x965A, 0x6732, 0x965B, 0x6733, 0x965C, 0x6736, 0x965D, 0x6737, 0x965E, 0x6738, 0x965F, 0x6739, 0x9660, 0x673B, + 0x9661, 0x673C, 0x9662, 0x673E, 0x9663, 0x673F, 0x9664, 0x6741, 0x9665, 0x6744, 0x9666, 0x6745, 0x9667, 0x6747, 0x9668, 0x674A, + 0x9669, 0x674B, 0x966A, 0x674D, 0x966B, 0x6752, 0x966C, 0x6754, 0x966D, 0x6755, 0x966E, 0x6757, 0x966F, 0x6758, 0x9670, 0x6759, + 0x9671, 0x675A, 0x9672, 0x675B, 0x9673, 0x675D, 0x9674, 0x6762, 0x9675, 0x6763, 0x9676, 0x6764, 0x9677, 0x6766, 0x9678, 0x6767, + 0x9679, 0x676B, 0x967A, 0x676C, 0x967B, 0x676E, 0x967C, 0x6771, 0x967D, 0x6774, 0x967E, 0x6776, 0x9680, 0x6778, 0x9681, 0x6779, + 0x9682, 0x677A, 0x9683, 0x677B, 0x9684, 0x677D, 0x9685, 0x6780, 0x9686, 0x6782, 0x9687, 0x6783, 0x9688, 0x6785, 0x9689, 0x6786, + 0x968A, 0x6788, 0x968B, 0x678A, 0x968C, 0x678C, 0x968D, 0x678D, 0x968E, 0x678E, 0x968F, 0x678F, 0x9690, 0x6791, 0x9691, 0x6792, + 0x9692, 0x6793, 0x9693, 0x6794, 0x9694, 0x6796, 0x9695, 0x6799, 0x9696, 0x679B, 0x9697, 0x679F, 0x9698, 0x67A0, 0x9699, 0x67A1, + 0x969A, 0x67A4, 0x969B, 0x67A6, 0x969C, 0x67A9, 0x969D, 0x67AC, 0x969E, 0x67AE, 0x969F, 0x67B1, 0x96A0, 0x67B2, 0x96A1, 0x67B4, + 0x96A2, 0x67B9, 0x96A3, 0x67BA, 0x96A4, 0x67BB, 0x96A5, 0x67BC, 0x96A6, 0x67BD, 0x96A7, 0x67BE, 0x96A8, 0x67BF, 0x96A9, 0x67C0, + 0x96AA, 0x67C2, 0x96AB, 0x67C5, 0x96AC, 0x67C6, 0x96AD, 0x67C7, 0x96AE, 0x67C8, 0x96AF, 0x67C9, 0x96B0, 0x67CA, 0x96B1, 0x67CB, + 0x96B2, 0x67CC, 0x96B3, 0x67CD, 0x96B4, 0x67CE, 0x96B5, 0x67D5, 0x96B6, 0x67D6, 0x96B7, 0x67D7, 0x96B8, 0x67DB, 0x96B9, 0x67DF, + 0x96BA, 0x67E1, 0x96BB, 0x67E3, 0x96BC, 0x67E4, 0x96BD, 0x67E6, 0x96BE, 0x67E7, 0x96BF, 0x67E8, 0x96C0, 0x67EA, 0x96C1, 0x67EB, + 0x96C2, 0x67ED, 0x96C3, 0x67EE, 0x96C4, 0x67F2, 0x96C5, 0x67F5, 0x96C6, 0x67F6, 0x96C7, 0x67F7, 0x96C8, 0x67F8, 0x96C9, 0x67F9, + 0x96CA, 0x67FA, 0x96CB, 0x67FB, 0x96CC, 0x67FC, 0x96CD, 0x67FE, 0x96CE, 0x6801, 0x96CF, 0x6802, 0x96D0, 0x6803, 0x96D1, 0x6804, + 0x96D2, 0x6806, 0x96D3, 0x680D, 0x96D4, 0x6810, 0x96D5, 0x6812, 0x96D6, 0x6814, 0x96D7, 0x6815, 0x96D8, 0x6818, 0x96D9, 0x6819, + 0x96DA, 0x681A, 0x96DB, 0x681B, 0x96DC, 0x681C, 0x96DD, 0x681E, 0x96DE, 0x681F, 0x96DF, 0x6820, 0x96E0, 0x6822, 0x96E1, 0x6823, + 0x96E2, 0x6824, 0x96E3, 0x6825, 0x96E4, 0x6826, 0x96E5, 0x6827, 0x96E6, 0x6828, 0x96E7, 0x682B, 0x96E8, 0x682C, 0x96E9, 0x682D, + 0x96EA, 0x682E, 0x96EB, 0x682F, 0x96EC, 0x6830, 0x96ED, 0x6831, 0x96EE, 0x6834, 0x96EF, 0x6835, 0x96F0, 0x6836, 0x96F1, 0x683A, + 0x96F2, 0x683B, 0x96F3, 0x683F, 0x96F4, 0x6847, 0x96F5, 0x684B, 0x96F6, 0x684D, 0x96F7, 0x684F, 0x96F8, 0x6852, 0x96F9, 0x6856, + 0x96FA, 0x6857, 0x96FB, 0x6858, 0x96FC, 0x6859, 0x96FD, 0x685A, 0x96FE, 0x685B, 0x9740, 0x685C, 0x9741, 0x685D, 0x9742, 0x685E, + 0x9743, 0x685F, 0x9744, 0x686A, 0x9745, 0x686C, 0x9746, 0x686D, 0x9747, 0x686E, 0x9748, 0x686F, 0x9749, 0x6870, 0x974A, 0x6871, + 0x974B, 0x6872, 0x974C, 0x6873, 0x974D, 0x6875, 0x974E, 0x6878, 0x974F, 0x6879, 0x9750, 0x687A, 0x9751, 0x687B, 0x9752, 0x687C, + 0x9753, 0x687D, 0x9754, 0x687E, 0x9755, 0x687F, 0x9756, 0x6880, 0x9757, 0x6882, 0x9758, 0x6884, 0x9759, 0x6887, 0x975A, 0x6888, + 0x975B, 0x6889, 0x975C, 0x688A, 0x975D, 0x688B, 0x975E, 0x688C, 0x975F, 0x688D, 0x9760, 0x688E, 0x9761, 0x6890, 0x9762, 0x6891, + 0x9763, 0x6892, 0x9764, 0x6894, 0x9765, 0x6895, 0x9766, 0x6896, 0x9767, 0x6898, 0x9768, 0x6899, 0x9769, 0x689A, 0x976A, 0x689B, + 0x976B, 0x689C, 0x976C, 0x689D, 0x976D, 0x689E, 0x976E, 0x689F, 0x976F, 0x68A0, 0x9770, 0x68A1, 0x9771, 0x68A3, 0x9772, 0x68A4, + 0x9773, 0x68A5, 0x9774, 0x68A9, 0x9775, 0x68AA, 0x9776, 0x68AB, 0x9777, 0x68AC, 0x9778, 0x68AE, 0x9779, 0x68B1, 0x977A, 0x68B2, + 0x977B, 0x68B4, 0x977C, 0x68B6, 0x977D, 0x68B7, 0x977E, 0x68B8, 0x9780, 0x68B9, 0x9781, 0x68BA, 0x9782, 0x68BB, 0x9783, 0x68BC, + 0x9784, 0x68BD, 0x9785, 0x68BE, 0x9786, 0x68BF, 0x9787, 0x68C1, 0x9788, 0x68C3, 0x9789, 0x68C4, 0x978A, 0x68C5, 0x978B, 0x68C6, + 0x978C, 0x68C7, 0x978D, 0x68C8, 0x978E, 0x68CA, 0x978F, 0x68CC, 0x9790, 0x68CE, 0x9791, 0x68CF, 0x9792, 0x68D0, 0x9793, 0x68D1, + 0x9794, 0x68D3, 0x9795, 0x68D4, 0x9796, 0x68D6, 0x9797, 0x68D7, 0x9798, 0x68D9, 0x9799, 0x68DB, 0x979A, 0x68DC, 0x979B, 0x68DD, + 0x979C, 0x68DE, 0x979D, 0x68DF, 0x979E, 0x68E1, 0x979F, 0x68E2, 0x97A0, 0x68E4, 0x97A1, 0x68E5, 0x97A2, 0x68E6, 0x97A3, 0x68E7, + 0x97A4, 0x68E8, 0x97A5, 0x68E9, 0x97A6, 0x68EA, 0x97A7, 0x68EB, 0x97A8, 0x68EC, 0x97A9, 0x68ED, 0x97AA, 0x68EF, 0x97AB, 0x68F2, + 0x97AC, 0x68F3, 0x97AD, 0x68F4, 0x97AE, 0x68F6, 0x97AF, 0x68F7, 0x97B0, 0x68F8, 0x97B1, 0x68FB, 0x97B2, 0x68FD, 0x97B3, 0x68FE, + 0x97B4, 0x68FF, 0x97B5, 0x6900, 0x97B6, 0x6902, 0x97B7, 0x6903, 0x97B8, 0x6904, 0x97B9, 0x6906, 0x97BA, 0x6907, 0x97BB, 0x6908, + 0x97BC, 0x6909, 0x97BD, 0x690A, 0x97BE, 0x690C, 0x97BF, 0x690F, 0x97C0, 0x6911, 0x97C1, 0x6913, 0x97C2, 0x6914, 0x97C3, 0x6915, + 0x97C4, 0x6916, 0x97C5, 0x6917, 0x97C6, 0x6918, 0x97C7, 0x6919, 0x97C8, 0x691A, 0x97C9, 0x691B, 0x97CA, 0x691C, 0x97CB, 0x691D, + 0x97CC, 0x691E, 0x97CD, 0x6921, 0x97CE, 0x6922, 0x97CF, 0x6923, 0x97D0, 0x6925, 0x97D1, 0x6926, 0x97D2, 0x6927, 0x97D3, 0x6928, + 0x97D4, 0x6929, 0x97D5, 0x692A, 0x97D6, 0x692B, 0x97D7, 0x692C, 0x97D8, 0x692E, 0x97D9, 0x692F, 0x97DA, 0x6931, 0x97DB, 0x6932, + 0x97DC, 0x6933, 0x97DD, 0x6935, 0x97DE, 0x6936, 0x97DF, 0x6937, 0x97E0, 0x6938, 0x97E1, 0x693A, 0x97E2, 0x693B, 0x97E3, 0x693C, + 0x97E4, 0x693E, 0x97E5, 0x6940, 0x97E6, 0x6941, 0x97E7, 0x6943, 0x97E8, 0x6944, 0x97E9, 0x6945, 0x97EA, 0x6946, 0x97EB, 0x6947, + 0x97EC, 0x6948, 0x97ED, 0x6949, 0x97EE, 0x694A, 0x97EF, 0x694B, 0x97F0, 0x694C, 0x97F1, 0x694D, 0x97F2, 0x694E, 0x97F3, 0x694F, + 0x97F4, 0x6950, 0x97F5, 0x6951, 0x97F6, 0x6952, 0x97F7, 0x6953, 0x97F8, 0x6955, 0x97F9, 0x6956, 0x97FA, 0x6958, 0x97FB, 0x6959, + 0x97FC, 0x695B, 0x97FD, 0x695C, 0x97FE, 0x695F, 0x9840, 0x6961, 0x9841, 0x6962, 0x9842, 0x6964, 0x9843, 0x6965, 0x9844, 0x6967, + 0x9845, 0x6968, 0x9846, 0x6969, 0x9847, 0x696A, 0x9848, 0x696C, 0x9849, 0x696D, 0x984A, 0x696F, 0x984B, 0x6970, 0x984C, 0x6972, + 0x984D, 0x6973, 0x984E, 0x6974, 0x984F, 0x6975, 0x9850, 0x6976, 0x9851, 0x697A, 0x9852, 0x697B, 0x9853, 0x697D, 0x9854, 0x697E, + 0x9855, 0x697F, 0x9856, 0x6981, 0x9857, 0x6983, 0x9858, 0x6985, 0x9859, 0x698A, 0x985A, 0x698B, 0x985B, 0x698C, 0x985C, 0x698E, + 0x985D, 0x698F, 0x985E, 0x6990, 0x985F, 0x6991, 0x9860, 0x6992, 0x9861, 0x6993, 0x9862, 0x6996, 0x9863, 0x6997, 0x9864, 0x6999, + 0x9865, 0x699A, 0x9866, 0x699D, 0x9867, 0x699E, 0x9868, 0x699F, 0x9869, 0x69A0, 0x986A, 0x69A1, 0x986B, 0x69A2, 0x986C, 0x69A3, + 0x986D, 0x69A4, 0x986E, 0x69A5, 0x986F, 0x69A6, 0x9870, 0x69A9, 0x9871, 0x69AA, 0x9872, 0x69AC, 0x9873, 0x69AE, 0x9874, 0x69AF, + 0x9875, 0x69B0, 0x9876, 0x69B2, 0x9877, 0x69B3, 0x9878, 0x69B5, 0x9879, 0x69B6, 0x987A, 0x69B8, 0x987B, 0x69B9, 0x987C, 0x69BA, + 0x987D, 0x69BC, 0x987E, 0x69BD, 0x9880, 0x69BE, 0x9881, 0x69BF, 0x9882, 0x69C0, 0x9883, 0x69C2, 0x9884, 0x69C3, 0x9885, 0x69C4, + 0x9886, 0x69C5, 0x9887, 0x69C6, 0x9888, 0x69C7, 0x9889, 0x69C8, 0x988A, 0x69C9, 0x988B, 0x69CB, 0x988C, 0x69CD, 0x988D, 0x69CF, + 0x988E, 0x69D1, 0x988F, 0x69D2, 0x9890, 0x69D3, 0x9891, 0x69D5, 0x9892, 0x69D6, 0x9893, 0x69D7, 0x9894, 0x69D8, 0x9895, 0x69D9, + 0x9896, 0x69DA, 0x9897, 0x69DC, 0x9898, 0x69DD, 0x9899, 0x69DE, 0x989A, 0x69E1, 0x989B, 0x69E2, 0x989C, 0x69E3, 0x989D, 0x69E4, + 0x989E, 0x69E5, 0x989F, 0x69E6, 0x98A0, 0x69E7, 0x98A1, 0x69E8, 0x98A2, 0x69E9, 0x98A3, 0x69EA, 0x98A4, 0x69EB, 0x98A5, 0x69EC, + 0x98A6, 0x69EE, 0x98A7, 0x69EF, 0x98A8, 0x69F0, 0x98A9, 0x69F1, 0x98AA, 0x69F3, 0x98AB, 0x69F4, 0x98AC, 0x69F5, 0x98AD, 0x69F6, + 0x98AE, 0x69F7, 0x98AF, 0x69F8, 0x98B0, 0x69F9, 0x98B1, 0x69FA, 0x98B2, 0x69FB, 0x98B3, 0x69FC, 0x98B4, 0x69FE, 0x98B5, 0x6A00, + 0x98B6, 0x6A01, 0x98B7, 0x6A02, 0x98B8, 0x6A03, 0x98B9, 0x6A04, 0x98BA, 0x6A05, 0x98BB, 0x6A06, 0x98BC, 0x6A07, 0x98BD, 0x6A08, + 0x98BE, 0x6A09, 0x98BF, 0x6A0B, 0x98C0, 0x6A0C, 0x98C1, 0x6A0D, 0x98C2, 0x6A0E, 0x98C3, 0x6A0F, 0x98C4, 0x6A10, 0x98C5, 0x6A11, + 0x98C6, 0x6A12, 0x98C7, 0x6A13, 0x98C8, 0x6A14, 0x98C9, 0x6A15, 0x98CA, 0x6A16, 0x98CB, 0x6A19, 0x98CC, 0x6A1A, 0x98CD, 0x6A1B, + 0x98CE, 0x6A1C, 0x98CF, 0x6A1D, 0x98D0, 0x6A1E, 0x98D1, 0x6A20, 0x98D2, 0x6A22, 0x98D3, 0x6A23, 0x98D4, 0x6A24, 0x98D5, 0x6A25, + 0x98D6, 0x6A26, 0x98D7, 0x6A27, 0x98D8, 0x6A29, 0x98D9, 0x6A2B, 0x98DA, 0x6A2C, 0x98DB, 0x6A2D, 0x98DC, 0x6A2E, 0x98DD, 0x6A30, + 0x98DE, 0x6A32, 0x98DF, 0x6A33, 0x98E0, 0x6A34, 0x98E1, 0x6A36, 0x98E2, 0x6A37, 0x98E3, 0x6A38, 0x98E4, 0x6A39, 0x98E5, 0x6A3A, + 0x98E6, 0x6A3B, 0x98E7, 0x6A3C, 0x98E8, 0x6A3F, 0x98E9, 0x6A40, 0x98EA, 0x6A41, 0x98EB, 0x6A42, 0x98EC, 0x6A43, 0x98ED, 0x6A45, + 0x98EE, 0x6A46, 0x98EF, 0x6A48, 0x98F0, 0x6A49, 0x98F1, 0x6A4A, 0x98F2, 0x6A4B, 0x98F3, 0x6A4C, 0x98F4, 0x6A4D, 0x98F5, 0x6A4E, + 0x98F6, 0x6A4F, 0x98F7, 0x6A51, 0x98F8, 0x6A52, 0x98F9, 0x6A53, 0x98FA, 0x6A54, 0x98FB, 0x6A55, 0x98FC, 0x6A56, 0x98FD, 0x6A57, + 0x98FE, 0x6A5A, 0x9940, 0x6A5C, 0x9941, 0x6A5D, 0x9942, 0x6A5E, 0x9943, 0x6A5F, 0x9944, 0x6A60, 0x9945, 0x6A62, 0x9946, 0x6A63, + 0x9947, 0x6A64, 0x9948, 0x6A66, 0x9949, 0x6A67, 0x994A, 0x6A68, 0x994B, 0x6A69, 0x994C, 0x6A6A, 0x994D, 0x6A6B, 0x994E, 0x6A6C, + 0x994F, 0x6A6D, 0x9950, 0x6A6E, 0x9951, 0x6A6F, 0x9952, 0x6A70, 0x9953, 0x6A72, 0x9954, 0x6A73, 0x9955, 0x6A74, 0x9956, 0x6A75, + 0x9957, 0x6A76, 0x9958, 0x6A77, 0x9959, 0x6A78, 0x995A, 0x6A7A, 0x995B, 0x6A7B, 0x995C, 0x6A7D, 0x995D, 0x6A7E, 0x995E, 0x6A7F, + 0x995F, 0x6A81, 0x9960, 0x6A82, 0x9961, 0x6A83, 0x9962, 0x6A85, 0x9963, 0x6A86, 0x9964, 0x6A87, 0x9965, 0x6A88, 0x9966, 0x6A89, + 0x9967, 0x6A8A, 0x9968, 0x6A8B, 0x9969, 0x6A8C, 0x996A, 0x6A8D, 0x996B, 0x6A8F, 0x996C, 0x6A92, 0x996D, 0x6A93, 0x996E, 0x6A94, + 0x996F, 0x6A95, 0x9970, 0x6A96, 0x9971, 0x6A98, 0x9972, 0x6A99, 0x9973, 0x6A9A, 0x9974, 0x6A9B, 0x9975, 0x6A9C, 0x9976, 0x6A9D, + 0x9977, 0x6A9E, 0x9978, 0x6A9F, 0x9979, 0x6AA1, 0x997A, 0x6AA2, 0x997B, 0x6AA3, 0x997C, 0x6AA4, 0x997D, 0x6AA5, 0x997E, 0x6AA6, + 0x9980, 0x6AA7, 0x9981, 0x6AA8, 0x9982, 0x6AAA, 0x9983, 0x6AAD, 0x9984, 0x6AAE, 0x9985, 0x6AAF, 0x9986, 0x6AB0, 0x9987, 0x6AB1, + 0x9988, 0x6AB2, 0x9989, 0x6AB3, 0x998A, 0x6AB4, 0x998B, 0x6AB5, 0x998C, 0x6AB6, 0x998D, 0x6AB7, 0x998E, 0x6AB8, 0x998F, 0x6AB9, + 0x9990, 0x6ABA, 0x9991, 0x6ABB, 0x9992, 0x6ABC, 0x9993, 0x6ABD, 0x9994, 0x6ABE, 0x9995, 0x6ABF, 0x9996, 0x6AC0, 0x9997, 0x6AC1, + 0x9998, 0x6AC2, 0x9999, 0x6AC3, 0x999A, 0x6AC4, 0x999B, 0x6AC5, 0x999C, 0x6AC6, 0x999D, 0x6AC7, 0x999E, 0x6AC8, 0x999F, 0x6AC9, + 0x99A0, 0x6ACA, 0x99A1, 0x6ACB, 0x99A2, 0x6ACC, 0x99A3, 0x6ACD, 0x99A4, 0x6ACE, 0x99A5, 0x6ACF, 0x99A6, 0x6AD0, 0x99A7, 0x6AD1, + 0x99A8, 0x6AD2, 0x99A9, 0x6AD3, 0x99AA, 0x6AD4, 0x99AB, 0x6AD5, 0x99AC, 0x6AD6, 0x99AD, 0x6AD7, 0x99AE, 0x6AD8, 0x99AF, 0x6AD9, + 0x99B0, 0x6ADA, 0x99B1, 0x6ADB, 0x99B2, 0x6ADC, 0x99B3, 0x6ADD, 0x99B4, 0x6ADE, 0x99B5, 0x6ADF, 0x99B6, 0x6AE0, 0x99B7, 0x6AE1, + 0x99B8, 0x6AE2, 0x99B9, 0x6AE3, 0x99BA, 0x6AE4, 0x99BB, 0x6AE5, 0x99BC, 0x6AE6, 0x99BD, 0x6AE7, 0x99BE, 0x6AE8, 0x99BF, 0x6AE9, + 0x99C0, 0x6AEA, 0x99C1, 0x6AEB, 0x99C2, 0x6AEC, 0x99C3, 0x6AED, 0x99C4, 0x6AEE, 0x99C5, 0x6AEF, 0x99C6, 0x6AF0, 0x99C7, 0x6AF1, + 0x99C8, 0x6AF2, 0x99C9, 0x6AF3, 0x99CA, 0x6AF4, 0x99CB, 0x6AF5, 0x99CC, 0x6AF6, 0x99CD, 0x6AF7, 0x99CE, 0x6AF8, 0x99CF, 0x6AF9, + 0x99D0, 0x6AFA, 0x99D1, 0x6AFB, 0x99D2, 0x6AFC, 0x99D3, 0x6AFD, 0x99D4, 0x6AFE, 0x99D5, 0x6AFF, 0x99D6, 0x6B00, 0x99D7, 0x6B01, + 0x99D8, 0x6B02, 0x99D9, 0x6B03, 0x99DA, 0x6B04, 0x99DB, 0x6B05, 0x99DC, 0x6B06, 0x99DD, 0x6B07, 0x99DE, 0x6B08, 0x99DF, 0x6B09, + 0x99E0, 0x6B0A, 0x99E1, 0x6B0B, 0x99E2, 0x6B0C, 0x99E3, 0x6B0D, 0x99E4, 0x6B0E, 0x99E5, 0x6B0F, 0x99E6, 0x6B10, 0x99E7, 0x6B11, + 0x99E8, 0x6B12, 0x99E9, 0x6B13, 0x99EA, 0x6B14, 0x99EB, 0x6B15, 0x99EC, 0x6B16, 0x99ED, 0x6B17, 0x99EE, 0x6B18, 0x99EF, 0x6B19, + 0x99F0, 0x6B1A, 0x99F1, 0x6B1B, 0x99F2, 0x6B1C, 0x99F3, 0x6B1D, 0x99F4, 0x6B1E, 0x99F5, 0x6B1F, 0x99F6, 0x6B25, 0x99F7, 0x6B26, + 0x99F8, 0x6B28, 0x99F9, 0x6B29, 0x99FA, 0x6B2A, 0x99FB, 0x6B2B, 0x99FC, 0x6B2C, 0x99FD, 0x6B2D, 0x99FE, 0x6B2E, 0x9A40, 0x6B2F, + 0x9A41, 0x6B30, 0x9A42, 0x6B31, 0x9A43, 0x6B33, 0x9A44, 0x6B34, 0x9A45, 0x6B35, 0x9A46, 0x6B36, 0x9A47, 0x6B38, 0x9A48, 0x6B3B, + 0x9A49, 0x6B3C, 0x9A4A, 0x6B3D, 0x9A4B, 0x6B3F, 0x9A4C, 0x6B40, 0x9A4D, 0x6B41, 0x9A4E, 0x6B42, 0x9A4F, 0x6B44, 0x9A50, 0x6B45, + 0x9A51, 0x6B48, 0x9A52, 0x6B4A, 0x9A53, 0x6B4B, 0x9A54, 0x6B4D, 0x9A55, 0x6B4E, 0x9A56, 0x6B4F, 0x9A57, 0x6B50, 0x9A58, 0x6B51, + 0x9A59, 0x6B52, 0x9A5A, 0x6B53, 0x9A5B, 0x6B54, 0x9A5C, 0x6B55, 0x9A5D, 0x6B56, 0x9A5E, 0x6B57, 0x9A5F, 0x6B58, 0x9A60, 0x6B5A, + 0x9A61, 0x6B5B, 0x9A62, 0x6B5C, 0x9A63, 0x6B5D, 0x9A64, 0x6B5E, 0x9A65, 0x6B5F, 0x9A66, 0x6B60, 0x9A67, 0x6B61, 0x9A68, 0x6B68, + 0x9A69, 0x6B69, 0x9A6A, 0x6B6B, 0x9A6B, 0x6B6C, 0x9A6C, 0x6B6D, 0x9A6D, 0x6B6E, 0x9A6E, 0x6B6F, 0x9A6F, 0x6B70, 0x9A70, 0x6B71, + 0x9A71, 0x6B72, 0x9A72, 0x6B73, 0x9A73, 0x6B74, 0x9A74, 0x6B75, 0x9A75, 0x6B76, 0x9A76, 0x6B77, 0x9A77, 0x6B78, 0x9A78, 0x6B7A, + 0x9A79, 0x6B7D, 0x9A7A, 0x6B7E, 0x9A7B, 0x6B7F, 0x9A7C, 0x6B80, 0x9A7D, 0x6B85, 0x9A7E, 0x6B88, 0x9A80, 0x6B8C, 0x9A81, 0x6B8E, + 0x9A82, 0x6B8F, 0x9A83, 0x6B90, 0x9A84, 0x6B91, 0x9A85, 0x6B94, 0x9A86, 0x6B95, 0x9A87, 0x6B97, 0x9A88, 0x6B98, 0x9A89, 0x6B99, + 0x9A8A, 0x6B9C, 0x9A8B, 0x6B9D, 0x9A8C, 0x6B9E, 0x9A8D, 0x6B9F, 0x9A8E, 0x6BA0, 0x9A8F, 0x6BA2, 0x9A90, 0x6BA3, 0x9A91, 0x6BA4, + 0x9A92, 0x6BA5, 0x9A93, 0x6BA6, 0x9A94, 0x6BA7, 0x9A95, 0x6BA8, 0x9A96, 0x6BA9, 0x9A97, 0x6BAB, 0x9A98, 0x6BAC, 0x9A99, 0x6BAD, + 0x9A9A, 0x6BAE, 0x9A9B, 0x6BAF, 0x9A9C, 0x6BB0, 0x9A9D, 0x6BB1, 0x9A9E, 0x6BB2, 0x9A9F, 0x6BB6, 0x9AA0, 0x6BB8, 0x9AA1, 0x6BB9, + 0x9AA2, 0x6BBA, 0x9AA3, 0x6BBB, 0x9AA4, 0x6BBC, 0x9AA5, 0x6BBD, 0x9AA6, 0x6BBE, 0x9AA7, 0x6BC0, 0x9AA8, 0x6BC3, 0x9AA9, 0x6BC4, + 0x9AAA, 0x6BC6, 0x9AAB, 0x6BC7, 0x9AAC, 0x6BC8, 0x9AAD, 0x6BC9, 0x9AAE, 0x6BCA, 0x9AAF, 0x6BCC, 0x9AB0, 0x6BCE, 0x9AB1, 0x6BD0, + 0x9AB2, 0x6BD1, 0x9AB3, 0x6BD8, 0x9AB4, 0x6BDA, 0x9AB5, 0x6BDC, 0x9AB6, 0x6BDD, 0x9AB7, 0x6BDE, 0x9AB8, 0x6BDF, 0x9AB9, 0x6BE0, + 0x9ABA, 0x6BE2, 0x9ABB, 0x6BE3, 0x9ABC, 0x6BE4, 0x9ABD, 0x6BE5, 0x9ABE, 0x6BE6, 0x9ABF, 0x6BE7, 0x9AC0, 0x6BE8, 0x9AC1, 0x6BE9, + 0x9AC2, 0x6BEC, 0x9AC3, 0x6BED, 0x9AC4, 0x6BEE, 0x9AC5, 0x6BF0, 0x9AC6, 0x6BF1, 0x9AC7, 0x6BF2, 0x9AC8, 0x6BF4, 0x9AC9, 0x6BF6, + 0x9ACA, 0x6BF7, 0x9ACB, 0x6BF8, 0x9ACC, 0x6BFA, 0x9ACD, 0x6BFB, 0x9ACE, 0x6BFC, 0x9ACF, 0x6BFE, 0x9AD0, 0x6BFF, 0x9AD1, 0x6C00, + 0x9AD2, 0x6C01, 0x9AD3, 0x6C02, 0x9AD4, 0x6C03, 0x9AD5, 0x6C04, 0x9AD6, 0x6C08, 0x9AD7, 0x6C09, 0x9AD8, 0x6C0A, 0x9AD9, 0x6C0B, + 0x9ADA, 0x6C0C, 0x9ADB, 0x6C0E, 0x9ADC, 0x6C12, 0x9ADD, 0x6C17, 0x9ADE, 0x6C1C, 0x9ADF, 0x6C1D, 0x9AE0, 0x6C1E, 0x9AE1, 0x6C20, + 0x9AE2, 0x6C23, 0x9AE3, 0x6C25, 0x9AE4, 0x6C2B, 0x9AE5, 0x6C2C, 0x9AE6, 0x6C2D, 0x9AE7, 0x6C31, 0x9AE8, 0x6C33, 0x9AE9, 0x6C36, + 0x9AEA, 0x6C37, 0x9AEB, 0x6C39, 0x9AEC, 0x6C3A, 0x9AED, 0x6C3B, 0x9AEE, 0x6C3C, 0x9AEF, 0x6C3E, 0x9AF0, 0x6C3F, 0x9AF1, 0x6C43, + 0x9AF2, 0x6C44, 0x9AF3, 0x6C45, 0x9AF4, 0x6C48, 0x9AF5, 0x6C4B, 0x9AF6, 0x6C4C, 0x9AF7, 0x6C4D, 0x9AF8, 0x6C4E, 0x9AF9, 0x6C4F, + 0x9AFA, 0x6C51, 0x9AFB, 0x6C52, 0x9AFC, 0x6C53, 0x9AFD, 0x6C56, 0x9AFE, 0x6C58, 0x9B40, 0x6C59, 0x9B41, 0x6C5A, 0x9B42, 0x6C62, + 0x9B43, 0x6C63, 0x9B44, 0x6C65, 0x9B45, 0x6C66, 0x9B46, 0x6C67, 0x9B47, 0x6C6B, 0x9B48, 0x6C6C, 0x9B49, 0x6C6D, 0x9B4A, 0x6C6E, + 0x9B4B, 0x6C6F, 0x9B4C, 0x6C71, 0x9B4D, 0x6C73, 0x9B4E, 0x6C75, 0x9B4F, 0x6C77, 0x9B50, 0x6C78, 0x9B51, 0x6C7A, 0x9B52, 0x6C7B, + 0x9B53, 0x6C7C, 0x9B54, 0x6C7F, 0x9B55, 0x6C80, 0x9B56, 0x6C84, 0x9B57, 0x6C87, 0x9B58, 0x6C8A, 0x9B59, 0x6C8B, 0x9B5A, 0x6C8D, + 0x9B5B, 0x6C8E, 0x9B5C, 0x6C91, 0x9B5D, 0x6C92, 0x9B5E, 0x6C95, 0x9B5F, 0x6C96, 0x9B60, 0x6C97, 0x9B61, 0x6C98, 0x9B62, 0x6C9A, + 0x9B63, 0x6C9C, 0x9B64, 0x6C9D, 0x9B65, 0x6C9E, 0x9B66, 0x6CA0, 0x9B67, 0x6CA2, 0x9B68, 0x6CA8, 0x9B69, 0x6CAC, 0x9B6A, 0x6CAF, + 0x9B6B, 0x6CB0, 0x9B6C, 0x6CB4, 0x9B6D, 0x6CB5, 0x9B6E, 0x6CB6, 0x9B6F, 0x6CB7, 0x9B70, 0x6CBA, 0x9B71, 0x6CC0, 0x9B72, 0x6CC1, + 0x9B73, 0x6CC2, 0x9B74, 0x6CC3, 0x9B75, 0x6CC6, 0x9B76, 0x6CC7, 0x9B77, 0x6CC8, 0x9B78, 0x6CCB, 0x9B79, 0x6CCD, 0x9B7A, 0x6CCE, + 0x9B7B, 0x6CCF, 0x9B7C, 0x6CD1, 0x9B7D, 0x6CD2, 0x9B7E, 0x6CD8, 0x9B80, 0x6CD9, 0x9B81, 0x6CDA, 0x9B82, 0x6CDC, 0x9B83, 0x6CDD, + 0x9B84, 0x6CDF, 0x9B85, 0x6CE4, 0x9B86, 0x6CE6, 0x9B87, 0x6CE7, 0x9B88, 0x6CE9, 0x9B89, 0x6CEC, 0x9B8A, 0x6CED, 0x9B8B, 0x6CF2, + 0x9B8C, 0x6CF4, 0x9B8D, 0x6CF9, 0x9B8E, 0x6CFF, 0x9B8F, 0x6D00, 0x9B90, 0x6D02, 0x9B91, 0x6D03, 0x9B92, 0x6D05, 0x9B93, 0x6D06, + 0x9B94, 0x6D08, 0x9B95, 0x6D09, 0x9B96, 0x6D0A, 0x9B97, 0x6D0D, 0x9B98, 0x6D0F, 0x9B99, 0x6D10, 0x9B9A, 0x6D11, 0x9B9B, 0x6D13, + 0x9B9C, 0x6D14, 0x9B9D, 0x6D15, 0x9B9E, 0x6D16, 0x9B9F, 0x6D18, 0x9BA0, 0x6D1C, 0x9BA1, 0x6D1D, 0x9BA2, 0x6D1F, 0x9BA3, 0x6D20, + 0x9BA4, 0x6D21, 0x9BA5, 0x6D22, 0x9BA6, 0x6D23, 0x9BA7, 0x6D24, 0x9BA8, 0x6D26, 0x9BA9, 0x6D28, 0x9BAA, 0x6D29, 0x9BAB, 0x6D2C, + 0x9BAC, 0x6D2D, 0x9BAD, 0x6D2F, 0x9BAE, 0x6D30, 0x9BAF, 0x6D34, 0x9BB0, 0x6D36, 0x9BB1, 0x6D37, 0x9BB2, 0x6D38, 0x9BB3, 0x6D3A, + 0x9BB4, 0x6D3F, 0x9BB5, 0x6D40, 0x9BB6, 0x6D42, 0x9BB7, 0x6D44, 0x9BB8, 0x6D49, 0x9BB9, 0x6D4C, 0x9BBA, 0x6D50, 0x9BBB, 0x6D55, + 0x9BBC, 0x6D56, 0x9BBD, 0x6D57, 0x9BBE, 0x6D58, 0x9BBF, 0x6D5B, 0x9BC0, 0x6D5D, 0x9BC1, 0x6D5F, 0x9BC2, 0x6D61, 0x9BC3, 0x6D62, + 0x9BC4, 0x6D64, 0x9BC5, 0x6D65, 0x9BC6, 0x6D67, 0x9BC7, 0x6D68, 0x9BC8, 0x6D6B, 0x9BC9, 0x6D6C, 0x9BCA, 0x6D6D, 0x9BCB, 0x6D70, + 0x9BCC, 0x6D71, 0x9BCD, 0x6D72, 0x9BCE, 0x6D73, 0x9BCF, 0x6D75, 0x9BD0, 0x6D76, 0x9BD1, 0x6D79, 0x9BD2, 0x6D7A, 0x9BD3, 0x6D7B, + 0x9BD4, 0x6D7D, 0x9BD5, 0x6D7E, 0x9BD6, 0x6D7F, 0x9BD7, 0x6D80, 0x9BD8, 0x6D81, 0x9BD9, 0x6D83, 0x9BDA, 0x6D84, 0x9BDB, 0x6D86, + 0x9BDC, 0x6D87, 0x9BDD, 0x6D8A, 0x9BDE, 0x6D8B, 0x9BDF, 0x6D8D, 0x9BE0, 0x6D8F, 0x9BE1, 0x6D90, 0x9BE2, 0x6D92, 0x9BE3, 0x6D96, + 0x9BE4, 0x6D97, 0x9BE5, 0x6D98, 0x9BE6, 0x6D99, 0x9BE7, 0x6D9A, 0x9BE8, 0x6D9C, 0x9BE9, 0x6DA2, 0x9BEA, 0x6DA5, 0x9BEB, 0x6DAC, + 0x9BEC, 0x6DAD, 0x9BED, 0x6DB0, 0x9BEE, 0x6DB1, 0x9BEF, 0x6DB3, 0x9BF0, 0x6DB4, 0x9BF1, 0x6DB6, 0x9BF2, 0x6DB7, 0x9BF3, 0x6DB9, + 0x9BF4, 0x6DBA, 0x9BF5, 0x6DBB, 0x9BF6, 0x6DBC, 0x9BF7, 0x6DBD, 0x9BF8, 0x6DBE, 0x9BF9, 0x6DC1, 0x9BFA, 0x6DC2, 0x9BFB, 0x6DC3, + 0x9BFC, 0x6DC8, 0x9BFD, 0x6DC9, 0x9BFE, 0x6DCA, 0x9C40, 0x6DCD, 0x9C41, 0x6DCE, 0x9C42, 0x6DCF, 0x9C43, 0x6DD0, 0x9C44, 0x6DD2, + 0x9C45, 0x6DD3, 0x9C46, 0x6DD4, 0x9C47, 0x6DD5, 0x9C48, 0x6DD7, 0x9C49, 0x6DDA, 0x9C4A, 0x6DDB, 0x9C4B, 0x6DDC, 0x9C4C, 0x6DDF, + 0x9C4D, 0x6DE2, 0x9C4E, 0x6DE3, 0x9C4F, 0x6DE5, 0x9C50, 0x6DE7, 0x9C51, 0x6DE8, 0x9C52, 0x6DE9, 0x9C53, 0x6DEA, 0x9C54, 0x6DED, + 0x9C55, 0x6DEF, 0x9C56, 0x6DF0, 0x9C57, 0x6DF2, 0x9C58, 0x6DF4, 0x9C59, 0x6DF5, 0x9C5A, 0x6DF6, 0x9C5B, 0x6DF8, 0x9C5C, 0x6DFA, + 0x9C5D, 0x6DFD, 0x9C5E, 0x6DFE, 0x9C5F, 0x6DFF, 0x9C60, 0x6E00, 0x9C61, 0x6E01, 0x9C62, 0x6E02, 0x9C63, 0x6E03, 0x9C64, 0x6E04, + 0x9C65, 0x6E06, 0x9C66, 0x6E07, 0x9C67, 0x6E08, 0x9C68, 0x6E09, 0x9C69, 0x6E0B, 0x9C6A, 0x6E0F, 0x9C6B, 0x6E12, 0x9C6C, 0x6E13, + 0x9C6D, 0x6E15, 0x9C6E, 0x6E18, 0x9C6F, 0x6E19, 0x9C70, 0x6E1B, 0x9C71, 0x6E1C, 0x9C72, 0x6E1E, 0x9C73, 0x6E1F, 0x9C74, 0x6E22, + 0x9C75, 0x6E26, 0x9C76, 0x6E27, 0x9C77, 0x6E28, 0x9C78, 0x6E2A, 0x9C79, 0x6E2C, 0x9C7A, 0x6E2E, 0x9C7B, 0x6E30, 0x9C7C, 0x6E31, + 0x9C7D, 0x6E33, 0x9C7E, 0x6E35, 0x9C80, 0x6E36, 0x9C81, 0x6E37, 0x9C82, 0x6E39, 0x9C83, 0x6E3B, 0x9C84, 0x6E3C, 0x9C85, 0x6E3D, + 0x9C86, 0x6E3E, 0x9C87, 0x6E3F, 0x9C88, 0x6E40, 0x9C89, 0x6E41, 0x9C8A, 0x6E42, 0x9C8B, 0x6E45, 0x9C8C, 0x6E46, 0x9C8D, 0x6E47, + 0x9C8E, 0x6E48, 0x9C8F, 0x6E49, 0x9C90, 0x6E4A, 0x9C91, 0x6E4B, 0x9C92, 0x6E4C, 0x9C93, 0x6E4F, 0x9C94, 0x6E50, 0x9C95, 0x6E51, + 0x9C96, 0x6E52, 0x9C97, 0x6E55, 0x9C98, 0x6E57, 0x9C99, 0x6E59, 0x9C9A, 0x6E5A, 0x9C9B, 0x6E5C, 0x9C9C, 0x6E5D, 0x9C9D, 0x6E5E, + 0x9C9E, 0x6E60, 0x9C9F, 0x6E61, 0x9CA0, 0x6E62, 0x9CA1, 0x6E63, 0x9CA2, 0x6E64, 0x9CA3, 0x6E65, 0x9CA4, 0x6E66, 0x9CA5, 0x6E67, + 0x9CA6, 0x6E68, 0x9CA7, 0x6E69, 0x9CA8, 0x6E6A, 0x9CA9, 0x6E6C, 0x9CAA, 0x6E6D, 0x9CAB, 0x6E6F, 0x9CAC, 0x6E70, 0x9CAD, 0x6E71, + 0x9CAE, 0x6E72, 0x9CAF, 0x6E73, 0x9CB0, 0x6E74, 0x9CB1, 0x6E75, 0x9CB2, 0x6E76, 0x9CB3, 0x6E77, 0x9CB4, 0x6E78, 0x9CB5, 0x6E79, + 0x9CB6, 0x6E7A, 0x9CB7, 0x6E7B, 0x9CB8, 0x6E7C, 0x9CB9, 0x6E7D, 0x9CBA, 0x6E80, 0x9CBB, 0x6E81, 0x9CBC, 0x6E82, 0x9CBD, 0x6E84, + 0x9CBE, 0x6E87, 0x9CBF, 0x6E88, 0x9CC0, 0x6E8A, 0x9CC1, 0x6E8B, 0x9CC2, 0x6E8C, 0x9CC3, 0x6E8D, 0x9CC4, 0x6E8E, 0x9CC5, 0x6E91, + 0x9CC6, 0x6E92, 0x9CC7, 0x6E93, 0x9CC8, 0x6E94, 0x9CC9, 0x6E95, 0x9CCA, 0x6E96, 0x9CCB, 0x6E97, 0x9CCC, 0x6E99, 0x9CCD, 0x6E9A, + 0x9CCE, 0x6E9B, 0x9CCF, 0x6E9D, 0x9CD0, 0x6E9E, 0x9CD1, 0x6EA0, 0x9CD2, 0x6EA1, 0x9CD3, 0x6EA3, 0x9CD4, 0x6EA4, 0x9CD5, 0x6EA6, + 0x9CD6, 0x6EA8, 0x9CD7, 0x6EA9, 0x9CD8, 0x6EAB, 0x9CD9, 0x6EAC, 0x9CDA, 0x6EAD, 0x9CDB, 0x6EAE, 0x9CDC, 0x6EB0, 0x9CDD, 0x6EB3, + 0x9CDE, 0x6EB5, 0x9CDF, 0x6EB8, 0x9CE0, 0x6EB9, 0x9CE1, 0x6EBC, 0x9CE2, 0x6EBE, 0x9CE3, 0x6EBF, 0x9CE4, 0x6EC0, 0x9CE5, 0x6EC3, + 0x9CE6, 0x6EC4, 0x9CE7, 0x6EC5, 0x9CE8, 0x6EC6, 0x9CE9, 0x6EC8, 0x9CEA, 0x6EC9, 0x9CEB, 0x6ECA, 0x9CEC, 0x6ECC, 0x9CED, 0x6ECD, + 0x9CEE, 0x6ECE, 0x9CEF, 0x6ED0, 0x9CF0, 0x6ED2, 0x9CF1, 0x6ED6, 0x9CF2, 0x6ED8, 0x9CF3, 0x6ED9, 0x9CF4, 0x6EDB, 0x9CF5, 0x6EDC, + 0x9CF6, 0x6EDD, 0x9CF7, 0x6EE3, 0x9CF8, 0x6EE7, 0x9CF9, 0x6EEA, 0x9CFA, 0x6EEB, 0x9CFB, 0x6EEC, 0x9CFC, 0x6EED, 0x9CFD, 0x6EEE, + 0x9CFE, 0x6EEF, 0x9D40, 0x6EF0, 0x9D41, 0x6EF1, 0x9D42, 0x6EF2, 0x9D43, 0x6EF3, 0x9D44, 0x6EF5, 0x9D45, 0x6EF6, 0x9D46, 0x6EF7, + 0x9D47, 0x6EF8, 0x9D48, 0x6EFA, 0x9D49, 0x6EFB, 0x9D4A, 0x6EFC, 0x9D4B, 0x6EFD, 0x9D4C, 0x6EFE, 0x9D4D, 0x6EFF, 0x9D4E, 0x6F00, + 0x9D4F, 0x6F01, 0x9D50, 0x6F03, 0x9D51, 0x6F04, 0x9D52, 0x6F05, 0x9D53, 0x6F07, 0x9D54, 0x6F08, 0x9D55, 0x6F0A, 0x9D56, 0x6F0B, + 0x9D57, 0x6F0C, 0x9D58, 0x6F0D, 0x9D59, 0x6F0E, 0x9D5A, 0x6F10, 0x9D5B, 0x6F11, 0x9D5C, 0x6F12, 0x9D5D, 0x6F16, 0x9D5E, 0x6F17, + 0x9D5F, 0x6F18, 0x9D60, 0x6F19, 0x9D61, 0x6F1A, 0x9D62, 0x6F1B, 0x9D63, 0x6F1C, 0x9D64, 0x6F1D, 0x9D65, 0x6F1E, 0x9D66, 0x6F1F, + 0x9D67, 0x6F21, 0x9D68, 0x6F22, 0x9D69, 0x6F23, 0x9D6A, 0x6F25, 0x9D6B, 0x6F26, 0x9D6C, 0x6F27, 0x9D6D, 0x6F28, 0x9D6E, 0x6F2C, + 0x9D6F, 0x6F2E, 0x9D70, 0x6F30, 0x9D71, 0x6F32, 0x9D72, 0x6F34, 0x9D73, 0x6F35, 0x9D74, 0x6F37, 0x9D75, 0x6F38, 0x9D76, 0x6F39, + 0x9D77, 0x6F3A, 0x9D78, 0x6F3B, 0x9D79, 0x6F3C, 0x9D7A, 0x6F3D, 0x9D7B, 0x6F3F, 0x9D7C, 0x6F40, 0x9D7D, 0x6F41, 0x9D7E, 0x6F42, + 0x9D80, 0x6F43, 0x9D81, 0x6F44, 0x9D82, 0x6F45, 0x9D83, 0x6F48, 0x9D84, 0x6F49, 0x9D85, 0x6F4A, 0x9D86, 0x6F4C, 0x9D87, 0x6F4E, + 0x9D88, 0x6F4F, 0x9D89, 0x6F50, 0x9D8A, 0x6F51, 0x9D8B, 0x6F52, 0x9D8C, 0x6F53, 0x9D8D, 0x6F54, 0x9D8E, 0x6F55, 0x9D8F, 0x6F56, + 0x9D90, 0x6F57, 0x9D91, 0x6F59, 0x9D92, 0x6F5A, 0x9D93, 0x6F5B, 0x9D94, 0x6F5D, 0x9D95, 0x6F5F, 0x9D96, 0x6F60, 0x9D97, 0x6F61, + 0x9D98, 0x6F63, 0x9D99, 0x6F64, 0x9D9A, 0x6F65, 0x9D9B, 0x6F67, 0x9D9C, 0x6F68, 0x9D9D, 0x6F69, 0x9D9E, 0x6F6A, 0x9D9F, 0x6F6B, + 0x9DA0, 0x6F6C, 0x9DA1, 0x6F6F, 0x9DA2, 0x6F70, 0x9DA3, 0x6F71, 0x9DA4, 0x6F73, 0x9DA5, 0x6F75, 0x9DA6, 0x6F76, 0x9DA7, 0x6F77, + 0x9DA8, 0x6F79, 0x9DA9, 0x6F7B, 0x9DAA, 0x6F7D, 0x9DAB, 0x6F7E, 0x9DAC, 0x6F7F, 0x9DAD, 0x6F80, 0x9DAE, 0x6F81, 0x9DAF, 0x6F82, + 0x9DB0, 0x6F83, 0x9DB1, 0x6F85, 0x9DB2, 0x6F86, 0x9DB3, 0x6F87, 0x9DB4, 0x6F8A, 0x9DB5, 0x6F8B, 0x9DB6, 0x6F8F, 0x9DB7, 0x6F90, + 0x9DB8, 0x6F91, 0x9DB9, 0x6F92, 0x9DBA, 0x6F93, 0x9DBB, 0x6F94, 0x9DBC, 0x6F95, 0x9DBD, 0x6F96, 0x9DBE, 0x6F97, 0x9DBF, 0x6F98, + 0x9DC0, 0x6F99, 0x9DC1, 0x6F9A, 0x9DC2, 0x6F9B, 0x9DC3, 0x6F9D, 0x9DC4, 0x6F9E, 0x9DC5, 0x6F9F, 0x9DC6, 0x6FA0, 0x9DC7, 0x6FA2, + 0x9DC8, 0x6FA3, 0x9DC9, 0x6FA4, 0x9DCA, 0x6FA5, 0x9DCB, 0x6FA6, 0x9DCC, 0x6FA8, 0x9DCD, 0x6FA9, 0x9DCE, 0x6FAA, 0x9DCF, 0x6FAB, + 0x9DD0, 0x6FAC, 0x9DD1, 0x6FAD, 0x9DD2, 0x6FAE, 0x9DD3, 0x6FAF, 0x9DD4, 0x6FB0, 0x9DD5, 0x6FB1, 0x9DD6, 0x6FB2, 0x9DD7, 0x6FB4, + 0x9DD8, 0x6FB5, 0x9DD9, 0x6FB7, 0x9DDA, 0x6FB8, 0x9DDB, 0x6FBA, 0x9DDC, 0x6FBB, 0x9DDD, 0x6FBC, 0x9DDE, 0x6FBD, 0x9DDF, 0x6FBE, + 0x9DE0, 0x6FBF, 0x9DE1, 0x6FC1, 0x9DE2, 0x6FC3, 0x9DE3, 0x6FC4, 0x9DE4, 0x6FC5, 0x9DE5, 0x6FC6, 0x9DE6, 0x6FC7, 0x9DE7, 0x6FC8, + 0x9DE8, 0x6FCA, 0x9DE9, 0x6FCB, 0x9DEA, 0x6FCC, 0x9DEB, 0x6FCD, 0x9DEC, 0x6FCE, 0x9DED, 0x6FCF, 0x9DEE, 0x6FD0, 0x9DEF, 0x6FD3, + 0x9DF0, 0x6FD4, 0x9DF1, 0x6FD5, 0x9DF2, 0x6FD6, 0x9DF3, 0x6FD7, 0x9DF4, 0x6FD8, 0x9DF5, 0x6FD9, 0x9DF6, 0x6FDA, 0x9DF7, 0x6FDB, + 0x9DF8, 0x6FDC, 0x9DF9, 0x6FDD, 0x9DFA, 0x6FDF, 0x9DFB, 0x6FE2, 0x9DFC, 0x6FE3, 0x9DFD, 0x6FE4, 0x9DFE, 0x6FE5, 0x9E40, 0x6FE6, + 0x9E41, 0x6FE7, 0x9E42, 0x6FE8, 0x9E43, 0x6FE9, 0x9E44, 0x6FEA, 0x9E45, 0x6FEB, 0x9E46, 0x6FEC, 0x9E47, 0x6FED, 0x9E48, 0x6FF0, + 0x9E49, 0x6FF1, 0x9E4A, 0x6FF2, 0x9E4B, 0x6FF3, 0x9E4C, 0x6FF4, 0x9E4D, 0x6FF5, 0x9E4E, 0x6FF6, 0x9E4F, 0x6FF7, 0x9E50, 0x6FF8, + 0x9E51, 0x6FF9, 0x9E52, 0x6FFA, 0x9E53, 0x6FFB, 0x9E54, 0x6FFC, 0x9E55, 0x6FFD, 0x9E56, 0x6FFE, 0x9E57, 0x6FFF, 0x9E58, 0x7000, + 0x9E59, 0x7001, 0x9E5A, 0x7002, 0x9E5B, 0x7003, 0x9E5C, 0x7004, 0x9E5D, 0x7005, 0x9E5E, 0x7006, 0x9E5F, 0x7007, 0x9E60, 0x7008, + 0x9E61, 0x7009, 0x9E62, 0x700A, 0x9E63, 0x700B, 0x9E64, 0x700C, 0x9E65, 0x700D, 0x9E66, 0x700E, 0x9E67, 0x700F, 0x9E68, 0x7010, + 0x9E69, 0x7012, 0x9E6A, 0x7013, 0x9E6B, 0x7014, 0x9E6C, 0x7015, 0x9E6D, 0x7016, 0x9E6E, 0x7017, 0x9E6F, 0x7018, 0x9E70, 0x7019, + 0x9E71, 0x701C, 0x9E72, 0x701D, 0x9E73, 0x701E, 0x9E74, 0x701F, 0x9E75, 0x7020, 0x9E76, 0x7021, 0x9E77, 0x7022, 0x9E78, 0x7024, + 0x9E79, 0x7025, 0x9E7A, 0x7026, 0x9E7B, 0x7027, 0x9E7C, 0x7028, 0x9E7D, 0x7029, 0x9E7E, 0x702A, 0x9E80, 0x702B, 0x9E81, 0x702C, + 0x9E82, 0x702D, 0x9E83, 0x702E, 0x9E84, 0x702F, 0x9E85, 0x7030, 0x9E86, 0x7031, 0x9E87, 0x7032, 0x9E88, 0x7033, 0x9E89, 0x7034, + 0x9E8A, 0x7036, 0x9E8B, 0x7037, 0x9E8C, 0x7038, 0x9E8D, 0x703A, 0x9E8E, 0x703B, 0x9E8F, 0x703C, 0x9E90, 0x703D, 0x9E91, 0x703E, + 0x9E92, 0x703F, 0x9E93, 0x7040, 0x9E94, 0x7041, 0x9E95, 0x7042, 0x9E96, 0x7043, 0x9E97, 0x7044, 0x9E98, 0x7045, 0x9E99, 0x7046, + 0x9E9A, 0x7047, 0x9E9B, 0x7048, 0x9E9C, 0x7049, 0x9E9D, 0x704A, 0x9E9E, 0x704B, 0x9E9F, 0x704D, 0x9EA0, 0x704E, 0x9EA1, 0x7050, + 0x9EA2, 0x7051, 0x9EA3, 0x7052, 0x9EA4, 0x7053, 0x9EA5, 0x7054, 0x9EA6, 0x7055, 0x9EA7, 0x7056, 0x9EA8, 0x7057, 0x9EA9, 0x7058, + 0x9EAA, 0x7059, 0x9EAB, 0x705A, 0x9EAC, 0x705B, 0x9EAD, 0x705C, 0x9EAE, 0x705D, 0x9EAF, 0x705F, 0x9EB0, 0x7060, 0x9EB1, 0x7061, + 0x9EB2, 0x7062, 0x9EB3, 0x7063, 0x9EB4, 0x7064, 0x9EB5, 0x7065, 0x9EB6, 0x7066, 0x9EB7, 0x7067, 0x9EB8, 0x7068, 0x9EB9, 0x7069, + 0x9EBA, 0x706A, 0x9EBB, 0x706E, 0x9EBC, 0x7071, 0x9EBD, 0x7072, 0x9EBE, 0x7073, 0x9EBF, 0x7074, 0x9EC0, 0x7077, 0x9EC1, 0x7079, + 0x9EC2, 0x707A, 0x9EC3, 0x707B, 0x9EC4, 0x707D, 0x9EC5, 0x7081, 0x9EC6, 0x7082, 0x9EC7, 0x7083, 0x9EC8, 0x7084, 0x9EC9, 0x7086, + 0x9ECA, 0x7087, 0x9ECB, 0x7088, 0x9ECC, 0x708B, 0x9ECD, 0x708C, 0x9ECE, 0x708D, 0x9ECF, 0x708F, 0x9ED0, 0x7090, 0x9ED1, 0x7091, + 0x9ED2, 0x7093, 0x9ED3, 0x7097, 0x9ED4, 0x7098, 0x9ED5, 0x709A, 0x9ED6, 0x709B, 0x9ED7, 0x709E, 0x9ED8, 0x709F, 0x9ED9, 0x70A0, + 0x9EDA, 0x70A1, 0x9EDB, 0x70A2, 0x9EDC, 0x70A3, 0x9EDD, 0x70A4, 0x9EDE, 0x70A5, 0x9EDF, 0x70A6, 0x9EE0, 0x70A7, 0x9EE1, 0x70A8, + 0x9EE2, 0x70A9, 0x9EE3, 0x70AA, 0x9EE4, 0x70B0, 0x9EE5, 0x70B2, 0x9EE6, 0x70B4, 0x9EE7, 0x70B5, 0x9EE8, 0x70B6, 0x9EE9, 0x70BA, + 0x9EEA, 0x70BE, 0x9EEB, 0x70BF, 0x9EEC, 0x70C4, 0x9EED, 0x70C5, 0x9EEE, 0x70C6, 0x9EEF, 0x70C7, 0x9EF0, 0x70C9, 0x9EF1, 0x70CB, + 0x9EF2, 0x70CC, 0x9EF3, 0x70CD, 0x9EF4, 0x70CE, 0x9EF5, 0x70CF, 0x9EF6, 0x70D0, 0x9EF7, 0x70D1, 0x9EF8, 0x70D2, 0x9EF9, 0x70D3, + 0x9EFA, 0x70D4, 0x9EFB, 0x70D5, 0x9EFC, 0x70D6, 0x9EFD, 0x70D7, 0x9EFE, 0x70DA, 0x9F40, 0x70DC, 0x9F41, 0x70DD, 0x9F42, 0x70DE, + 0x9F43, 0x70E0, 0x9F44, 0x70E1, 0x9F45, 0x70E2, 0x9F46, 0x70E3, 0x9F47, 0x70E5, 0x9F48, 0x70EA, 0x9F49, 0x70EE, 0x9F4A, 0x70F0, + 0x9F4B, 0x70F1, 0x9F4C, 0x70F2, 0x9F4D, 0x70F3, 0x9F4E, 0x70F4, 0x9F4F, 0x70F5, 0x9F50, 0x70F6, 0x9F51, 0x70F8, 0x9F52, 0x70FA, + 0x9F53, 0x70FB, 0x9F54, 0x70FC, 0x9F55, 0x70FE, 0x9F56, 0x70FF, 0x9F57, 0x7100, 0x9F58, 0x7101, 0x9F59, 0x7102, 0x9F5A, 0x7103, + 0x9F5B, 0x7104, 0x9F5C, 0x7105, 0x9F5D, 0x7106, 0x9F5E, 0x7107, 0x9F5F, 0x7108, 0x9F60, 0x710B, 0x9F61, 0x710C, 0x9F62, 0x710D, + 0x9F63, 0x710E, 0x9F64, 0x710F, 0x9F65, 0x7111, 0x9F66, 0x7112, 0x9F67, 0x7114, 0x9F68, 0x7117, 0x9F69, 0x711B, 0x9F6A, 0x711C, + 0x9F6B, 0x711D, 0x9F6C, 0x711E, 0x9F6D, 0x711F, 0x9F6E, 0x7120, 0x9F6F, 0x7121, 0x9F70, 0x7122, 0x9F71, 0x7123, 0x9F72, 0x7124, + 0x9F73, 0x7125, 0x9F74, 0x7127, 0x9F75, 0x7128, 0x9F76, 0x7129, 0x9F77, 0x712A, 0x9F78, 0x712B, 0x9F79, 0x712C, 0x9F7A, 0x712D, + 0x9F7B, 0x712E, 0x9F7C, 0x7132, 0x9F7D, 0x7133, 0x9F7E, 0x7134, 0x9F80, 0x7135, 0x9F81, 0x7137, 0x9F82, 0x7138, 0x9F83, 0x7139, + 0x9F84, 0x713A, 0x9F85, 0x713B, 0x9F86, 0x713C, 0x9F87, 0x713D, 0x9F88, 0x713E, 0x9F89, 0x713F, 0x9F8A, 0x7140, 0x9F8B, 0x7141, + 0x9F8C, 0x7142, 0x9F8D, 0x7143, 0x9F8E, 0x7144, 0x9F8F, 0x7146, 0x9F90, 0x7147, 0x9F91, 0x7148, 0x9F92, 0x7149, 0x9F93, 0x714B, + 0x9F94, 0x714D, 0x9F95, 0x714F, 0x9F96, 0x7150, 0x9F97, 0x7151, 0x9F98, 0x7152, 0x9F99, 0x7153, 0x9F9A, 0x7154, 0x9F9B, 0x7155, + 0x9F9C, 0x7156, 0x9F9D, 0x7157, 0x9F9E, 0x7158, 0x9F9F, 0x7159, 0x9FA0, 0x715A, 0x9FA1, 0x715B, 0x9FA2, 0x715D, 0x9FA3, 0x715F, + 0x9FA4, 0x7160, 0x9FA5, 0x7161, 0x9FA6, 0x7162, 0x9FA7, 0x7163, 0x9FA8, 0x7165, 0x9FA9, 0x7169, 0x9FAA, 0x716A, 0x9FAB, 0x716B, + 0x9FAC, 0x716C, 0x9FAD, 0x716D, 0x9FAE, 0x716F, 0x9FAF, 0x7170, 0x9FB0, 0x7171, 0x9FB1, 0x7174, 0x9FB2, 0x7175, 0x9FB3, 0x7176, + 0x9FB4, 0x7177, 0x9FB5, 0x7179, 0x9FB6, 0x717B, 0x9FB7, 0x717C, 0x9FB8, 0x717E, 0x9FB9, 0x717F, 0x9FBA, 0x7180, 0x9FBB, 0x7181, + 0x9FBC, 0x7182, 0x9FBD, 0x7183, 0x9FBE, 0x7185, 0x9FBF, 0x7186, 0x9FC0, 0x7187, 0x9FC1, 0x7188, 0x9FC2, 0x7189, 0x9FC3, 0x718B, + 0x9FC4, 0x718C, 0x9FC5, 0x718D, 0x9FC6, 0x718E, 0x9FC7, 0x7190, 0x9FC8, 0x7191, 0x9FC9, 0x7192, 0x9FCA, 0x7193, 0x9FCB, 0x7195, + 0x9FCC, 0x7196, 0x9FCD, 0x7197, 0x9FCE, 0x719A, 0x9FCF, 0x719B, 0x9FD0, 0x719C, 0x9FD1, 0x719D, 0x9FD2, 0x719E, 0x9FD3, 0x71A1, + 0x9FD4, 0x71A2, 0x9FD5, 0x71A3, 0x9FD6, 0x71A4, 0x9FD7, 0x71A5, 0x9FD8, 0x71A6, 0x9FD9, 0x71A7, 0x9FDA, 0x71A9, 0x9FDB, 0x71AA, + 0x9FDC, 0x71AB, 0x9FDD, 0x71AD, 0x9FDE, 0x71AE, 0x9FDF, 0x71AF, 0x9FE0, 0x71B0, 0x9FE1, 0x71B1, 0x9FE2, 0x71B2, 0x9FE3, 0x71B4, + 0x9FE4, 0x71B6, 0x9FE5, 0x71B7, 0x9FE6, 0x71B8, 0x9FE7, 0x71BA, 0x9FE8, 0x71BB, 0x9FE9, 0x71BC, 0x9FEA, 0x71BD, 0x9FEB, 0x71BE, + 0x9FEC, 0x71BF, 0x9FED, 0x71C0, 0x9FEE, 0x71C1, 0x9FEF, 0x71C2, 0x9FF0, 0x71C4, 0x9FF1, 0x71C5, 0x9FF2, 0x71C6, 0x9FF3, 0x71C7, + 0x9FF4, 0x71C8, 0x9FF5, 0x71C9, 0x9FF6, 0x71CA, 0x9FF7, 0x71CB, 0x9FF8, 0x71CC, 0x9FF9, 0x71CD, 0x9FFA, 0x71CF, 0x9FFB, 0x71D0, + 0x9FFC, 0x71D1, 0x9FFD, 0x71D2, 0x9FFE, 0x71D3, 0xA040, 0x71D6, 0xA041, 0x71D7, 0xA042, 0x71D8, 0xA043, 0x71D9, 0xA044, 0x71DA, + 0xA045, 0x71DB, 0xA046, 0x71DC, 0xA047, 0x71DD, 0xA048, 0x71DE, 0xA049, 0x71DF, 0xA04A, 0x71E1, 0xA04B, 0x71E2, 0xA04C, 0x71E3, + 0xA04D, 0x71E4, 0xA04E, 0x71E6, 0xA04F, 0x71E8, 0xA050, 0x71E9, 0xA051, 0x71EA, 0xA052, 0x71EB, 0xA053, 0x71EC, 0xA054, 0x71ED, + 0xA055, 0x71EF, 0xA056, 0x71F0, 0xA057, 0x71F1, 0xA058, 0x71F2, 0xA059, 0x71F3, 0xA05A, 0x71F4, 0xA05B, 0x71F5, 0xA05C, 0x71F6, + 0xA05D, 0x71F7, 0xA05E, 0x71F8, 0xA05F, 0x71FA, 0xA060, 0x71FB, 0xA061, 0x71FC, 0xA062, 0x71FD, 0xA063, 0x71FE, 0xA064, 0x71FF, + 0xA065, 0x7200, 0xA066, 0x7201, 0xA067, 0x7202, 0xA068, 0x7203, 0xA069, 0x7204, 0xA06A, 0x7205, 0xA06B, 0x7207, 0xA06C, 0x7208, + 0xA06D, 0x7209, 0xA06E, 0x720A, 0xA06F, 0x720B, 0xA070, 0x720C, 0xA071, 0x720D, 0xA072, 0x720E, 0xA073, 0x720F, 0xA074, 0x7210, + 0xA075, 0x7211, 0xA076, 0x7212, 0xA077, 0x7213, 0xA078, 0x7214, 0xA079, 0x7215, 0xA07A, 0x7216, 0xA07B, 0x7217, 0xA07C, 0x7218, + 0xA07D, 0x7219, 0xA07E, 0x721A, 0xA080, 0x721B, 0xA081, 0x721C, 0xA082, 0x721E, 0xA083, 0x721F, 0xA084, 0x7220, 0xA085, 0x7221, + 0xA086, 0x7222, 0xA087, 0x7223, 0xA088, 0x7224, 0xA089, 0x7225, 0xA08A, 0x7226, 0xA08B, 0x7227, 0xA08C, 0x7229, 0xA08D, 0x722B, + 0xA08E, 0x722D, 0xA08F, 0x722E, 0xA090, 0x722F, 0xA091, 0x7232, 0xA092, 0x7233, 0xA093, 0x7234, 0xA094, 0x723A, 0xA095, 0x723C, + 0xA096, 0x723E, 0xA097, 0x7240, 0xA098, 0x7241, 0xA099, 0x7242, 0xA09A, 0x7243, 0xA09B, 0x7244, 0xA09C, 0x7245, 0xA09D, 0x7246, + 0xA09E, 0x7249, 0xA09F, 0x724A, 0xA0A0, 0x724B, 0xA0A1, 0x724E, 0xA0A2, 0x724F, 0xA0A3, 0x7250, 0xA0A4, 0x7251, 0xA0A5, 0x7253, + 0xA0A6, 0x7254, 0xA0A7, 0x7255, 0xA0A8, 0x7257, 0xA0A9, 0x7258, 0xA0AA, 0x725A, 0xA0AB, 0x725C, 0xA0AC, 0x725E, 0xA0AD, 0x7260, + 0xA0AE, 0x7263, 0xA0AF, 0x7264, 0xA0B0, 0x7265, 0xA0B1, 0x7268, 0xA0B2, 0x726A, 0xA0B3, 0x726B, 0xA0B4, 0x726C, 0xA0B5, 0x726D, + 0xA0B6, 0x7270, 0xA0B7, 0x7271, 0xA0B8, 0x7273, 0xA0B9, 0x7274, 0xA0BA, 0x7276, 0xA0BB, 0x7277, 0xA0BC, 0x7278, 0xA0BD, 0x727B, + 0xA0BE, 0x727C, 0xA0BF, 0x727D, 0xA0C0, 0x7282, 0xA0C1, 0x7283, 0xA0C2, 0x7285, 0xA0C3, 0x7286, 0xA0C4, 0x7287, 0xA0C5, 0x7288, + 0xA0C6, 0x7289, 0xA0C7, 0x728C, 0xA0C8, 0x728E, 0xA0C9, 0x7290, 0xA0CA, 0x7291, 0xA0CB, 0x7293, 0xA0CC, 0x7294, 0xA0CD, 0x7295, + 0xA0CE, 0x7296, 0xA0CF, 0x7297, 0xA0D0, 0x7298, 0xA0D1, 0x7299, 0xA0D2, 0x729A, 0xA0D3, 0x729B, 0xA0D4, 0x729C, 0xA0D5, 0x729D, + 0xA0D6, 0x729E, 0xA0D7, 0x72A0, 0xA0D8, 0x72A1, 0xA0D9, 0x72A2, 0xA0DA, 0x72A3, 0xA0DB, 0x72A4, 0xA0DC, 0x72A5, 0xA0DD, 0x72A6, + 0xA0DE, 0x72A7, 0xA0DF, 0x72A8, 0xA0E0, 0x72A9, 0xA0E1, 0x72AA, 0xA0E2, 0x72AB, 0xA0E3, 0x72AE, 0xA0E4, 0x72B1, 0xA0E5, 0x72B2, + 0xA0E6, 0x72B3, 0xA0E7, 0x72B5, 0xA0E8, 0x72BA, 0xA0E9, 0x72BB, 0xA0EA, 0x72BC, 0xA0EB, 0x72BD, 0xA0EC, 0x72BE, 0xA0ED, 0x72BF, + 0xA0EE, 0x72C0, 0xA0EF, 0x72C5, 0xA0F0, 0x72C6, 0xA0F1, 0x72C7, 0xA0F2, 0x72C9, 0xA0F3, 0x72CA, 0xA0F4, 0x72CB, 0xA0F5, 0x72CC, + 0xA0F6, 0x72CF, 0xA0F7, 0x72D1, 0xA0F8, 0x72D3, 0xA0F9, 0x72D4, 0xA0FA, 0x72D5, 0xA0FB, 0x72D6, 0xA0FC, 0x72D8, 0xA0FD, 0x72DA, + 0xA0FE, 0x72DB, 0xA1A1, 0x3000, 0xA1A2, 0x3001, 0xA1A3, 0x3002, 0xA1A4, 0x00B7, 0xA1A5, 0x02C9, 0xA1A6, 0x02C7, 0xA1A7, 0x00A8, + 0xA1A8, 0x3003, 0xA1A9, 0x3005, 0xA1AA, 0x2014, 0xA1AB, 0xFF5E, 0xA1AC, 0x2016, 0xA1AD, 0x2026, 0xA1AE, 0x2018, 0xA1AF, 0x2019, + 0xA1B0, 0x201C, 0xA1B1, 0x201D, 0xA1B2, 0x3014, 0xA1B3, 0x3015, 0xA1B4, 0x3008, 0xA1B5, 0x3009, 0xA1B6, 0x300A, 0xA1B7, 0x300B, + 0xA1B8, 0x300C, 0xA1B9, 0x300D, 0xA1BA, 0x300E, 0xA1BB, 0x300F, 0xA1BC, 0x3016, 0xA1BD, 0x3017, 0xA1BE, 0x3010, 0xA1BF, 0x3011, + 0xA1C0, 0x00B1, 0xA1C1, 0x00D7, 0xA1C2, 0x00F7, 0xA1C3, 0x2236, 0xA1C4, 0x2227, 0xA1C5, 0x2228, 0xA1C6, 0x2211, 0xA1C7, 0x220F, + 0xA1C8, 0x222A, 0xA1C9, 0x2229, 0xA1CA, 0x2208, 0xA1CB, 0x2237, 0xA1CC, 0x221A, 0xA1CD, 0x22A5, 0xA1CE, 0x2225, 0xA1CF, 0x2220, + 0xA1D0, 0x2312, 0xA1D1, 0x2299, 0xA1D2, 0x222B, 0xA1D3, 0x222E, 0xA1D4, 0x2261, 0xA1D5, 0x224C, 0xA1D6, 0x2248, 0xA1D7, 0x223D, + 0xA1D8, 0x221D, 0xA1D9, 0x2260, 0xA1DA, 0x226E, 0xA1DB, 0x226F, 0xA1DC, 0x2264, 0xA1DD, 0x2265, 0xA1DE, 0x221E, 0xA1DF, 0x2235, + 0xA1E0, 0x2234, 0xA1E1, 0x2642, 0xA1E2, 0x2640, 0xA1E3, 0x00B0, 0xA1E4, 0x2032, 0xA1E5, 0x2033, 0xA1E6, 0x2103, 0xA1E7, 0xFF04, + 0xA1E8, 0x00A4, 0xA1E9, 0xFFE0, 0xA1EA, 0xFFE1, 0xA1EB, 0x2030, 0xA1EC, 0x00A7, 0xA1ED, 0x2116, 0xA1EE, 0x2606, 0xA1EF, 0x2605, + 0xA1F0, 0x25CB, 0xA1F1, 0x25CF, 0xA1F2, 0x25CE, 0xA1F3, 0x25C7, 0xA1F4, 0x25C6, 0xA1F5, 0x25A1, 0xA1F6, 0x25A0, 0xA1F7, 0x25B3, + 0xA1F8, 0x25B2, 0xA1F9, 0x203B, 0xA1FA, 0x2192, 0xA1FB, 0x2190, 0xA1FC, 0x2191, 0xA1FD, 0x2193, 0xA1FE, 0x3013, 0xA2A1, 0x2170, + 0xA2A2, 0x2171, 0xA2A3, 0x2172, 0xA2A4, 0x2173, 0xA2A5, 0x2174, 0xA2A6, 0x2175, 0xA2A7, 0x2176, 0xA2A8, 0x2177, 0xA2A9, 0x2178, + 0xA2AA, 0x2179, 0xA2B1, 0x2488, 0xA2B2, 0x2489, 0xA2B3, 0x248A, 0xA2B4, 0x248B, 0xA2B5, 0x248C, 0xA2B6, 0x248D, 0xA2B7, 0x248E, + 0xA2B8, 0x248F, 0xA2B9, 0x2490, 0xA2BA, 0x2491, 0xA2BB, 0x2492, 0xA2BC, 0x2493, 0xA2BD, 0x2494, 0xA2BE, 0x2495, 0xA2BF, 0x2496, + 0xA2C0, 0x2497, 0xA2C1, 0x2498, 0xA2C2, 0x2499, 0xA2C3, 0x249A, 0xA2C4, 0x249B, 0xA2C5, 0x2474, 0xA2C6, 0x2475, 0xA2C7, 0x2476, + 0xA2C8, 0x2477, 0xA2C9, 0x2478, 0xA2CA, 0x2479, 0xA2CB, 0x247A, 0xA2CC, 0x247B, 0xA2CD, 0x247C, 0xA2CE, 0x247D, 0xA2CF, 0x247E, + 0xA2D0, 0x247F, 0xA2D1, 0x2480, 0xA2D2, 0x2481, 0xA2D3, 0x2482, 0xA2D4, 0x2483, 0xA2D5, 0x2484, 0xA2D6, 0x2485, 0xA2D7, 0x2486, + 0xA2D8, 0x2487, 0xA2D9, 0x2460, 0xA2DA, 0x2461, 0xA2DB, 0x2462, 0xA2DC, 0x2463, 0xA2DD, 0x2464, 0xA2DE, 0x2465, 0xA2DF, 0x2466, + 0xA2E0, 0x2467, 0xA2E1, 0x2468, 0xA2E2, 0x2469, 0xA2E5, 0x3220, 0xA2E6, 0x3221, 0xA2E7, 0x3222, 0xA2E8, 0x3223, 0xA2E9, 0x3224, + 0xA2EA, 0x3225, 0xA2EB, 0x3226, 0xA2EC, 0x3227, 0xA2ED, 0x3228, 0xA2EE, 0x3229, 0xA2F1, 0x2160, 0xA2F2, 0x2161, 0xA2F3, 0x2162, + 0xA2F4, 0x2163, 0xA2F5, 0x2164, 0xA2F6, 0x2165, 0xA2F7, 0x2166, 0xA2F8, 0x2167, 0xA2F9, 0x2168, 0xA2FA, 0x2169, 0xA2FB, 0x216A, + 0xA2FC, 0x216B, 0xA3A1, 0xFF01, 0xA3A2, 0xFF02, 0xA3A3, 0xFF03, 0xA3A4, 0xFFE5, 0xA3A5, 0xFF05, 0xA3A6, 0xFF06, 0xA3A7, 0xFF07, + 0xA3A8, 0xFF08, 0xA3A9, 0xFF09, 0xA3AA, 0xFF0A, 0xA3AB, 0xFF0B, 0xA3AC, 0xFF0C, 0xA3AD, 0xFF0D, 0xA3AE, 0xFF0E, 0xA3AF, 0xFF0F, + 0xA3B0, 0xFF10, 0xA3B1, 0xFF11, 0xA3B2, 0xFF12, 0xA3B3, 0xFF13, 0xA3B4, 0xFF14, 0xA3B5, 0xFF15, 0xA3B6, 0xFF16, 0xA3B7, 0xFF17, + 0xA3B8, 0xFF18, 0xA3B9, 0xFF19, 0xA3BA, 0xFF1A, 0xA3BB, 0xFF1B, 0xA3BC, 0xFF1C, 0xA3BD, 0xFF1D, 0xA3BE, 0xFF1E, 0xA3BF, 0xFF1F, + 0xA3C0, 0xFF20, 0xA3C1, 0xFF21, 0xA3C2, 0xFF22, 0xA3C3, 0xFF23, 0xA3C4, 0xFF24, 0xA3C5, 0xFF25, 0xA3C6, 0xFF26, 0xA3C7, 0xFF27, + 0xA3C8, 0xFF28, 0xA3C9, 0xFF29, 0xA3CA, 0xFF2A, 0xA3CB, 0xFF2B, 0xA3CC, 0xFF2C, 0xA3CD, 0xFF2D, 0xA3CE, 0xFF2E, 0xA3CF, 0xFF2F, + 0xA3D0, 0xFF30, 0xA3D1, 0xFF31, 0xA3D2, 0xFF32, 0xA3D3, 0xFF33, 0xA3D4, 0xFF34, 0xA3D5, 0xFF35, 0xA3D6, 0xFF36, 0xA3D7, 0xFF37, + 0xA3D8, 0xFF38, 0xA3D9, 0xFF39, 0xA3DA, 0xFF3A, 0xA3DB, 0xFF3B, 0xA3DC, 0xFF3C, 0xA3DD, 0xFF3D, 0xA3DE, 0xFF3E, 0xA3DF, 0xFF3F, + 0xA3E0, 0xFF40, 0xA3E1, 0xFF41, 0xA3E2, 0xFF42, 0xA3E3, 0xFF43, 0xA3E4, 0xFF44, 0xA3E5, 0xFF45, 0xA3E6, 0xFF46, 0xA3E7, 0xFF47, + 0xA3E8, 0xFF48, 0xA3E9, 0xFF49, 0xA3EA, 0xFF4A, 0xA3EB, 0xFF4B, 0xA3EC, 0xFF4C, 0xA3ED, 0xFF4D, 0xA3EE, 0xFF4E, 0xA3EF, 0xFF4F, + 0xA3F0, 0xFF50, 0xA3F1, 0xFF51, 0xA3F2, 0xFF52, 0xA3F3, 0xFF53, 0xA3F4, 0xFF54, 0xA3F5, 0xFF55, 0xA3F6, 0xFF56, 0xA3F7, 0xFF57, + 0xA3F8, 0xFF58, 0xA3F9, 0xFF59, 0xA3FA, 0xFF5A, 0xA3FB, 0xFF5B, 0xA3FC, 0xFF5C, 0xA3FD, 0xFF5D, 0xA3FE, 0xFFE3, 0xA4A1, 0x3041, + 0xA4A2, 0x3042, 0xA4A3, 0x3043, 0xA4A4, 0x3044, 0xA4A5, 0x3045, 0xA4A6, 0x3046, 0xA4A7, 0x3047, 0xA4A8, 0x3048, 0xA4A9, 0x3049, + 0xA4AA, 0x304A, 0xA4AB, 0x304B, 0xA4AC, 0x304C, 0xA4AD, 0x304D, 0xA4AE, 0x304E, 0xA4AF, 0x304F, 0xA4B0, 0x3050, 0xA4B1, 0x3051, + 0xA4B2, 0x3052, 0xA4B3, 0x3053, 0xA4B4, 0x3054, 0xA4B5, 0x3055, 0xA4B6, 0x3056, 0xA4B7, 0x3057, 0xA4B8, 0x3058, 0xA4B9, 0x3059, + 0xA4BA, 0x305A, 0xA4BB, 0x305B, 0xA4BC, 0x305C, 0xA4BD, 0x305D, 0xA4BE, 0x305E, 0xA4BF, 0x305F, 0xA4C0, 0x3060, 0xA4C1, 0x3061, + 0xA4C2, 0x3062, 0xA4C3, 0x3063, 0xA4C4, 0x3064, 0xA4C5, 0x3065, 0xA4C6, 0x3066, 0xA4C7, 0x3067, 0xA4C8, 0x3068, 0xA4C9, 0x3069, + 0xA4CA, 0x306A, 0xA4CB, 0x306B, 0xA4CC, 0x306C, 0xA4CD, 0x306D, 0xA4CE, 0x306E, 0xA4CF, 0x306F, 0xA4D0, 0x3070, 0xA4D1, 0x3071, + 0xA4D2, 0x3072, 0xA4D3, 0x3073, 0xA4D4, 0x3074, 0xA4D5, 0x3075, 0xA4D6, 0x3076, 0xA4D7, 0x3077, 0xA4D8, 0x3078, 0xA4D9, 0x3079, + 0xA4DA, 0x307A, 0xA4DB, 0x307B, 0xA4DC, 0x307C, 0xA4DD, 0x307D, 0xA4DE, 0x307E, 0xA4DF, 0x307F, 0xA4E0, 0x3080, 0xA4E1, 0x3081, + 0xA4E2, 0x3082, 0xA4E3, 0x3083, 0xA4E4, 0x3084, 0xA4E5, 0x3085, 0xA4E6, 0x3086, 0xA4E7, 0x3087, 0xA4E8, 0x3088, 0xA4E9, 0x3089, + 0xA4EA, 0x308A, 0xA4EB, 0x308B, 0xA4EC, 0x308C, 0xA4ED, 0x308D, 0xA4EE, 0x308E, 0xA4EF, 0x308F, 0xA4F0, 0x3090, 0xA4F1, 0x3091, + 0xA4F2, 0x3092, 0xA4F3, 0x3093, 0xA5A1, 0x30A1, 0xA5A2, 0x30A2, 0xA5A3, 0x30A3, 0xA5A4, 0x30A4, 0xA5A5, 0x30A5, 0xA5A6, 0x30A6, + 0xA5A7, 0x30A7, 0xA5A8, 0x30A8, 0xA5A9, 0x30A9, 0xA5AA, 0x30AA, 0xA5AB, 0x30AB, 0xA5AC, 0x30AC, 0xA5AD, 0x30AD, 0xA5AE, 0x30AE, + 0xA5AF, 0x30AF, 0xA5B0, 0x30B0, 0xA5B1, 0x30B1, 0xA5B2, 0x30B2, 0xA5B3, 0x30B3, 0xA5B4, 0x30B4, 0xA5B5, 0x30B5, 0xA5B6, 0x30B6, + 0xA5B7, 0x30B7, 0xA5B8, 0x30B8, 0xA5B9, 0x30B9, 0xA5BA, 0x30BA, 0xA5BB, 0x30BB, 0xA5BC, 0x30BC, 0xA5BD, 0x30BD, 0xA5BE, 0x30BE, + 0xA5BF, 0x30BF, 0xA5C0, 0x30C0, 0xA5C1, 0x30C1, 0xA5C2, 0x30C2, 0xA5C3, 0x30C3, 0xA5C4, 0x30C4, 0xA5C5, 0x30C5, 0xA5C6, 0x30C6, + 0xA5C7, 0x30C7, 0xA5C8, 0x30C8, 0xA5C9, 0x30C9, 0xA5CA, 0x30CA, 0xA5CB, 0x30CB, 0xA5CC, 0x30CC, 0xA5CD, 0x30CD, 0xA5CE, 0x30CE, + 0xA5CF, 0x30CF, 0xA5D0, 0x30D0, 0xA5D1, 0x30D1, 0xA5D2, 0x30D2, 0xA5D3, 0x30D3, 0xA5D4, 0x30D4, 0xA5D5, 0x30D5, 0xA5D6, 0x30D6, + 0xA5D7, 0x30D7, 0xA5D8, 0x30D8, 0xA5D9, 0x30D9, 0xA5DA, 0x30DA, 0xA5DB, 0x30DB, 0xA5DC, 0x30DC, 0xA5DD, 0x30DD, 0xA5DE, 0x30DE, + 0xA5DF, 0x30DF, 0xA5E0, 0x30E0, 0xA5E1, 0x30E1, 0xA5E2, 0x30E2, 0xA5E3, 0x30E3, 0xA5E4, 0x30E4, 0xA5E5, 0x30E5, 0xA5E6, 0x30E6, + 0xA5E7, 0x30E7, 0xA5E8, 0x30E8, 0xA5E9, 0x30E9, 0xA5EA, 0x30EA, 0xA5EB, 0x30EB, 0xA5EC, 0x30EC, 0xA5ED, 0x30ED, 0xA5EE, 0x30EE, + 0xA5EF, 0x30EF, 0xA5F0, 0x30F0, 0xA5F1, 0x30F1, 0xA5F2, 0x30F2, 0xA5F3, 0x30F3, 0xA5F4, 0x30F4, 0xA5F5, 0x30F5, 0xA5F6, 0x30F6, + 0xA6A1, 0x0391, 0xA6A2, 0x0392, 0xA6A3, 0x0393, 0xA6A4, 0x0394, 0xA6A5, 0x0395, 0xA6A6, 0x0396, 0xA6A7, 0x0397, 0xA6A8, 0x0398, + 0xA6A9, 0x0399, 0xA6AA, 0x039A, 0xA6AB, 0x039B, 0xA6AC, 0x039C, 0xA6AD, 0x039D, 0xA6AE, 0x039E, 0xA6AF, 0x039F, 0xA6B0, 0x03A0, + 0xA6B1, 0x03A1, 0xA6B2, 0x03A3, 0xA6B3, 0x03A4, 0xA6B4, 0x03A5, 0xA6B5, 0x03A6, 0xA6B6, 0x03A7, 0xA6B7, 0x03A8, 0xA6B8, 0x03A9, + 0xA6C1, 0x03B1, 0xA6C2, 0x03B2, 0xA6C3, 0x03B3, 0xA6C4, 0x03B4, 0xA6C5, 0x03B5, 0xA6C6, 0x03B6, 0xA6C7, 0x03B7, 0xA6C8, 0x03B8, + 0xA6C9, 0x03B9, 0xA6CA, 0x03BA, 0xA6CB, 0x03BB, 0xA6CC, 0x03BC, 0xA6CD, 0x03BD, 0xA6CE, 0x03BE, 0xA6CF, 0x03BF, 0xA6D0, 0x03C0, + 0xA6D1, 0x03C1, 0xA6D2, 0x03C3, 0xA6D3, 0x03C4, 0xA6D4, 0x03C5, 0xA6D5, 0x03C6, 0xA6D6, 0x03C7, 0xA6D7, 0x03C8, 0xA6D8, 0x03C9, + 0xA6E0, 0xFE35, 0xA6E1, 0xFE36, 0xA6E2, 0xFE39, 0xA6E3, 0xFE3A, 0xA6E4, 0xFE3F, 0xA6E5, 0xFE40, 0xA6E6, 0xFE3D, 0xA6E7, 0xFE3E, + 0xA6E8, 0xFE41, 0xA6E9, 0xFE42, 0xA6EA, 0xFE43, 0xA6EB, 0xFE44, 0xA6EE, 0xFE3B, 0xA6EF, 0xFE3C, 0xA6F0, 0xFE37, 0xA6F1, 0xFE38, + 0xA6F2, 0xFE31, 0xA6F4, 0xFE33, 0xA6F5, 0xFE34, 0xA7A1, 0x0410, 0xA7A2, 0x0411, 0xA7A3, 0x0412, 0xA7A4, 0x0413, 0xA7A5, 0x0414, + 0xA7A6, 0x0415, 0xA7A7, 0x0401, 0xA7A8, 0x0416, 0xA7A9, 0x0417, 0xA7AA, 0x0418, 0xA7AB, 0x0419, 0xA7AC, 0x041A, 0xA7AD, 0x041B, + 0xA7AE, 0x041C, 0xA7AF, 0x041D, 0xA7B0, 0x041E, 0xA7B1, 0x041F, 0xA7B2, 0x0420, 0xA7B3, 0x0421, 0xA7B4, 0x0422, 0xA7B5, 0x0423, + 0xA7B6, 0x0424, 0xA7B7, 0x0425, 0xA7B8, 0x0426, 0xA7B9, 0x0427, 0xA7BA, 0x0428, 0xA7BB, 0x0429, 0xA7BC, 0x042A, 0xA7BD, 0x042B, + 0xA7BE, 0x042C, 0xA7BF, 0x042D, 0xA7C0, 0x042E, 0xA7C1, 0x042F, 0xA7D1, 0x0430, 0xA7D2, 0x0431, 0xA7D3, 0x0432, 0xA7D4, 0x0433, + 0xA7D5, 0x0434, 0xA7D6, 0x0435, 0xA7D7, 0x0451, 0xA7D8, 0x0436, 0xA7D9, 0x0437, 0xA7DA, 0x0438, 0xA7DB, 0x0439, 0xA7DC, 0x043A, + 0xA7DD, 0x043B, 0xA7DE, 0x043C, 0xA7DF, 0x043D, 0xA7E0, 0x043E, 0xA7E1, 0x043F, 0xA7E2, 0x0440, 0xA7E3, 0x0441, 0xA7E4, 0x0442, + 0xA7E5, 0x0443, 0xA7E6, 0x0444, 0xA7E7, 0x0445, 0xA7E8, 0x0446, 0xA7E9, 0x0447, 0xA7EA, 0x0448, 0xA7EB, 0x0449, 0xA7EC, 0x044A, + 0xA7ED, 0x044B, 0xA7EE, 0x044C, 0xA7EF, 0x044D, 0xA7F0, 0x044E, 0xA7F1, 0x044F, 0xA840, 0x02CA, 0xA841, 0x02CB, 0xA842, 0x02D9, + 0xA843, 0x2013, 0xA844, 0x2015, 0xA845, 0x2025, 0xA846, 0x2035, 0xA847, 0x2105, 0xA848, 0x2109, 0xA849, 0x2196, 0xA84A, 0x2197, + 0xA84B, 0x2198, 0xA84C, 0x2199, 0xA84D, 0x2215, 0xA84E, 0x221F, 0xA84F, 0x2223, 0xA850, 0x2252, 0xA851, 0x2266, 0xA852, 0x2267, + 0xA853, 0x22BF, 0xA854, 0x2550, 0xA855, 0x2551, 0xA856, 0x2552, 0xA857, 0x2553, 0xA858, 0x2554, 0xA859, 0x2555, 0xA85A, 0x2556, + 0xA85B, 0x2557, 0xA85C, 0x2558, 0xA85D, 0x2559, 0xA85E, 0x255A, 0xA85F, 0x255B, 0xA860, 0x255C, 0xA861, 0x255D, 0xA862, 0x255E, + 0xA863, 0x255F, 0xA864, 0x2560, 0xA865, 0x2561, 0xA866, 0x2562, 0xA867, 0x2563, 0xA868, 0x2564, 0xA869, 0x2565, 0xA86A, 0x2566, + 0xA86B, 0x2567, 0xA86C, 0x2568, 0xA86D, 0x2569, 0xA86E, 0x256A, 0xA86F, 0x256B, 0xA870, 0x256C, 0xA871, 0x256D, 0xA872, 0x256E, + 0xA873, 0x256F, 0xA874, 0x2570, 0xA875, 0x2571, 0xA876, 0x2572, 0xA877, 0x2573, 0xA878, 0x2581, 0xA879, 0x2582, 0xA87A, 0x2583, + 0xA87B, 0x2584, 0xA87C, 0x2585, 0xA87D, 0x2586, 0xA87E, 0x2587, 0xA880, 0x2588, 0xA881, 0x2589, 0xA882, 0x258A, 0xA883, 0x258B, + 0xA884, 0x258C, 0xA885, 0x258D, 0xA886, 0x258E, 0xA887, 0x258F, 0xA888, 0x2593, 0xA889, 0x2594, 0xA88A, 0x2595, 0xA88B, 0x25BC, + 0xA88C, 0x25BD, 0xA88D, 0x25E2, 0xA88E, 0x25E3, 0xA88F, 0x25E4, 0xA890, 0x25E5, 0xA891, 0x2609, 0xA892, 0x2295, 0xA893, 0x3012, + 0xA894, 0x301D, 0xA895, 0x301E, 0xA8A1, 0x0101, 0xA8A2, 0x00E1, 0xA8A3, 0x01CE, 0xA8A4, 0x00E0, 0xA8A5, 0x0113, 0xA8A6, 0x00E9, + 0xA8A7, 0x011B, 0xA8A8, 0x00E8, 0xA8A9, 0x012B, 0xA8AA, 0x00ED, 0xA8AB, 0x01D0, 0xA8AC, 0x00EC, 0xA8AD, 0x014D, 0xA8AE, 0x00F3, + 0xA8AF, 0x01D2, 0xA8B0, 0x00F2, 0xA8B1, 0x016B, 0xA8B2, 0x00FA, 0xA8B3, 0x01D4, 0xA8B4, 0x00F9, 0xA8B5, 0x01D6, 0xA8B6, 0x01D8, + 0xA8B7, 0x01DA, 0xA8B8, 0x01DC, 0xA8B9, 0x00FC, 0xA8BA, 0x00EA, 0xA8BB, 0x0251, 0xA8BD, 0x0144, 0xA8BE, 0x0148, 0xA8C0, 0x0261, + 0xA8C5, 0x3105, 0xA8C6, 0x3106, 0xA8C7, 0x3107, 0xA8C8, 0x3108, 0xA8C9, 0x3109, 0xA8CA, 0x310A, 0xA8CB, 0x310B, 0xA8CC, 0x310C, + 0xA8CD, 0x310D, 0xA8CE, 0x310E, 0xA8CF, 0x310F, 0xA8D0, 0x3110, 0xA8D1, 0x3111, 0xA8D2, 0x3112, 0xA8D3, 0x3113, 0xA8D4, 0x3114, + 0xA8D5, 0x3115, 0xA8D6, 0x3116, 0xA8D7, 0x3117, 0xA8D8, 0x3118, 0xA8D9, 0x3119, 0xA8DA, 0x311A, 0xA8DB, 0x311B, 0xA8DC, 0x311C, + 0xA8DD, 0x311D, 0xA8DE, 0x311E, 0xA8DF, 0x311F, 0xA8E0, 0x3120, 0xA8E1, 0x3121, 0xA8E2, 0x3122, 0xA8E3, 0x3123, 0xA8E4, 0x3124, + 0xA8E5, 0x3125, 0xA8E6, 0x3126, 0xA8E7, 0x3127, 0xA8E8, 0x3128, 0xA8E9, 0x3129, 0xA940, 0x3021, 0xA941, 0x3022, 0xA942, 0x3023, + 0xA943, 0x3024, 0xA944, 0x3025, 0xA945, 0x3026, 0xA946, 0x3027, 0xA947, 0x3028, 0xA948, 0x3029, 0xA949, 0x32A3, 0xA94A, 0x338E, + 0xA94B, 0x338F, 0xA94C, 0x339C, 0xA94D, 0x339D, 0xA94E, 0x339E, 0xA94F, 0x33A1, 0xA950, 0x33C4, 0xA951, 0x33CE, 0xA952, 0x33D1, + 0xA953, 0x33D2, 0xA954, 0x33D5, 0xA955, 0xFE30, 0xA956, 0xFFE2, 0xA957, 0xFFE4, 0xA959, 0x2121, 0xA95A, 0x3231, 0xA95C, 0x2010, + 0xA960, 0x30FC, 0xA961, 0x309B, 0xA962, 0x309C, 0xA963, 0x30FD, 0xA964, 0x30FE, 0xA965, 0x3006, 0xA966, 0x309D, 0xA967, 0x309E, + 0xA968, 0xFE49, 0xA969, 0xFE4A, 0xA96A, 0xFE4B, 0xA96B, 0xFE4C, 0xA96C, 0xFE4D, 0xA96D, 0xFE4E, 0xA96E, 0xFE4F, 0xA96F, 0xFE50, + 0xA970, 0xFE51, 0xA971, 0xFE52, 0xA972, 0xFE54, 0xA973, 0xFE55, 0xA974, 0xFE56, 0xA975, 0xFE57, 0xA976, 0xFE59, 0xA977, 0xFE5A, + 0xA978, 0xFE5B, 0xA979, 0xFE5C, 0xA97A, 0xFE5D, 0xA97B, 0xFE5E, 0xA97C, 0xFE5F, 0xA97D, 0xFE60, 0xA97E, 0xFE61, 0xA980, 0xFE62, + 0xA981, 0xFE63, 0xA982, 0xFE64, 0xA983, 0xFE65, 0xA984, 0xFE66, 0xA985, 0xFE68, 0xA986, 0xFE69, 0xA987, 0xFE6A, 0xA988, 0xFE6B, + 0xA996, 0x3007, 0xA9A4, 0x2500, 0xA9A5, 0x2501, 0xA9A6, 0x2502, 0xA9A7, 0x2503, 0xA9A8, 0x2504, 0xA9A9, 0x2505, 0xA9AA, 0x2506, + 0xA9AB, 0x2507, 0xA9AC, 0x2508, 0xA9AD, 0x2509, 0xA9AE, 0x250A, 0xA9AF, 0x250B, 0xA9B0, 0x250C, 0xA9B1, 0x250D, 0xA9B2, 0x250E, + 0xA9B3, 0x250F, 0xA9B4, 0x2510, 0xA9B5, 0x2511, 0xA9B6, 0x2512, 0xA9B7, 0x2513, 0xA9B8, 0x2514, 0xA9B9, 0x2515, 0xA9BA, 0x2516, + 0xA9BB, 0x2517, 0xA9BC, 0x2518, 0xA9BD, 0x2519, 0xA9BE, 0x251A, 0xA9BF, 0x251B, 0xA9C0, 0x251C, 0xA9C1, 0x251D, 0xA9C2, 0x251E, + 0xA9C3, 0x251F, 0xA9C4, 0x2520, 0xA9C5, 0x2521, 0xA9C6, 0x2522, 0xA9C7, 0x2523, 0xA9C8, 0x2524, 0xA9C9, 0x2525, 0xA9CA, 0x2526, + 0xA9CB, 0x2527, 0xA9CC, 0x2528, 0xA9CD, 0x2529, 0xA9CE, 0x252A, 0xA9CF, 0x252B, 0xA9D0, 0x252C, 0xA9D1, 0x252D, 0xA9D2, 0x252E, + 0xA9D3, 0x252F, 0xA9D4, 0x2530, 0xA9D5, 0x2531, 0xA9D6, 0x2532, 0xA9D7, 0x2533, 0xA9D8, 0x2534, 0xA9D9, 0x2535, 0xA9DA, 0x2536, + 0xA9DB, 0x2537, 0xA9DC, 0x2538, 0xA9DD, 0x2539, 0xA9DE, 0x253A, 0xA9DF, 0x253B, 0xA9E0, 0x253C, 0xA9E1, 0x253D, 0xA9E2, 0x253E, + 0xA9E3, 0x253F, 0xA9E4, 0x2540, 0xA9E5, 0x2541, 0xA9E6, 0x2542, 0xA9E7, 0x2543, 0xA9E8, 0x2544, 0xA9E9, 0x2545, 0xA9EA, 0x2546, + 0xA9EB, 0x2547, 0xA9EC, 0x2548, 0xA9ED, 0x2549, 0xA9EE, 0x254A, 0xA9EF, 0x254B, 0xAA40, 0x72DC, 0xAA41, 0x72DD, 0xAA42, 0x72DF, + 0xAA43, 0x72E2, 0xAA44, 0x72E3, 0xAA45, 0x72E4, 0xAA46, 0x72E5, 0xAA47, 0x72E6, 0xAA48, 0x72E7, 0xAA49, 0x72EA, 0xAA4A, 0x72EB, + 0xAA4B, 0x72F5, 0xAA4C, 0x72F6, 0xAA4D, 0x72F9, 0xAA4E, 0x72FD, 0xAA4F, 0x72FE, 0xAA50, 0x72FF, 0xAA51, 0x7300, 0xAA52, 0x7302, + 0xAA53, 0x7304, 0xAA54, 0x7305, 0xAA55, 0x7306, 0xAA56, 0x7307, 0xAA57, 0x7308, 0xAA58, 0x7309, 0xAA59, 0x730B, 0xAA5A, 0x730C, + 0xAA5B, 0x730D, 0xAA5C, 0x730F, 0xAA5D, 0x7310, 0xAA5E, 0x7311, 0xAA5F, 0x7312, 0xAA60, 0x7314, 0xAA61, 0x7318, 0xAA62, 0x7319, + 0xAA63, 0x731A, 0xAA64, 0x731F, 0xAA65, 0x7320, 0xAA66, 0x7323, 0xAA67, 0x7324, 0xAA68, 0x7326, 0xAA69, 0x7327, 0xAA6A, 0x7328, + 0xAA6B, 0x732D, 0xAA6C, 0x732F, 0xAA6D, 0x7330, 0xAA6E, 0x7332, 0xAA6F, 0x7333, 0xAA70, 0x7335, 0xAA71, 0x7336, 0xAA72, 0x733A, + 0xAA73, 0x733B, 0xAA74, 0x733C, 0xAA75, 0x733D, 0xAA76, 0x7340, 0xAA77, 0x7341, 0xAA78, 0x7342, 0xAA79, 0x7343, 0xAA7A, 0x7344, + 0xAA7B, 0x7345, 0xAA7C, 0x7346, 0xAA7D, 0x7347, 0xAA7E, 0x7348, 0xAA80, 0x7349, 0xAA81, 0x734A, 0xAA82, 0x734B, 0xAA83, 0x734C, + 0xAA84, 0x734E, 0xAA85, 0x734F, 0xAA86, 0x7351, 0xAA87, 0x7353, 0xAA88, 0x7354, 0xAA89, 0x7355, 0xAA8A, 0x7356, 0xAA8B, 0x7358, + 0xAA8C, 0x7359, 0xAA8D, 0x735A, 0xAA8E, 0x735B, 0xAA8F, 0x735C, 0xAA90, 0x735D, 0xAA91, 0x735E, 0xAA92, 0x735F, 0xAA93, 0x7361, + 0xAA94, 0x7362, 0xAA95, 0x7363, 0xAA96, 0x7364, 0xAA97, 0x7365, 0xAA98, 0x7366, 0xAA99, 0x7367, 0xAA9A, 0x7368, 0xAA9B, 0x7369, + 0xAA9C, 0x736A, 0xAA9D, 0x736B, 0xAA9E, 0x736E, 0xAA9F, 0x7370, 0xAAA0, 0x7371, 0xAB40, 0x7372, 0xAB41, 0x7373, 0xAB42, 0x7374, + 0xAB43, 0x7375, 0xAB44, 0x7376, 0xAB45, 0x7377, 0xAB46, 0x7378, 0xAB47, 0x7379, 0xAB48, 0x737A, 0xAB49, 0x737B, 0xAB4A, 0x737C, + 0xAB4B, 0x737D, 0xAB4C, 0x737F, 0xAB4D, 0x7380, 0xAB4E, 0x7381, 0xAB4F, 0x7382, 0xAB50, 0x7383, 0xAB51, 0x7385, 0xAB52, 0x7386, + 0xAB53, 0x7388, 0xAB54, 0x738A, 0xAB55, 0x738C, 0xAB56, 0x738D, 0xAB57, 0x738F, 0xAB58, 0x7390, 0xAB59, 0x7392, 0xAB5A, 0x7393, + 0xAB5B, 0x7394, 0xAB5C, 0x7395, 0xAB5D, 0x7397, 0xAB5E, 0x7398, 0xAB5F, 0x7399, 0xAB60, 0x739A, 0xAB61, 0x739C, 0xAB62, 0x739D, + 0xAB63, 0x739E, 0xAB64, 0x73A0, 0xAB65, 0x73A1, 0xAB66, 0x73A3, 0xAB67, 0x73A4, 0xAB68, 0x73A5, 0xAB69, 0x73A6, 0xAB6A, 0x73A7, + 0xAB6B, 0x73A8, 0xAB6C, 0x73AA, 0xAB6D, 0x73AC, 0xAB6E, 0x73AD, 0xAB6F, 0x73B1, 0xAB70, 0x73B4, 0xAB71, 0x73B5, 0xAB72, 0x73B6, + 0xAB73, 0x73B8, 0xAB74, 0x73B9, 0xAB75, 0x73BC, 0xAB76, 0x73BD, 0xAB77, 0x73BE, 0xAB78, 0x73BF, 0xAB79, 0x73C1, 0xAB7A, 0x73C3, + 0xAB7B, 0x73C4, 0xAB7C, 0x73C5, 0xAB7D, 0x73C6, 0xAB7E, 0x73C7, 0xAB80, 0x73CB, 0xAB81, 0x73CC, 0xAB82, 0x73CE, 0xAB83, 0x73D2, + 0xAB84, 0x73D3, 0xAB85, 0x73D4, 0xAB86, 0x73D5, 0xAB87, 0x73D6, 0xAB88, 0x73D7, 0xAB89, 0x73D8, 0xAB8A, 0x73DA, 0xAB8B, 0x73DB, + 0xAB8C, 0x73DC, 0xAB8D, 0x73DD, 0xAB8E, 0x73DF, 0xAB8F, 0x73E1, 0xAB90, 0x73E2, 0xAB91, 0x73E3, 0xAB92, 0x73E4, 0xAB93, 0x73E6, + 0xAB94, 0x73E8, 0xAB95, 0x73EA, 0xAB96, 0x73EB, 0xAB97, 0x73EC, 0xAB98, 0x73EE, 0xAB99, 0x73EF, 0xAB9A, 0x73F0, 0xAB9B, 0x73F1, + 0xAB9C, 0x73F3, 0xAB9D, 0x73F4, 0xAB9E, 0x73F5, 0xAB9F, 0x73F6, 0xABA0, 0x73F7, 0xAC40, 0x73F8, 0xAC41, 0x73F9, 0xAC42, 0x73FA, + 0xAC43, 0x73FB, 0xAC44, 0x73FC, 0xAC45, 0x73FD, 0xAC46, 0x73FE, 0xAC47, 0x73FF, 0xAC48, 0x7400, 0xAC49, 0x7401, 0xAC4A, 0x7402, + 0xAC4B, 0x7404, 0xAC4C, 0x7407, 0xAC4D, 0x7408, 0xAC4E, 0x740B, 0xAC4F, 0x740C, 0xAC50, 0x740D, 0xAC51, 0x740E, 0xAC52, 0x7411, + 0xAC53, 0x7412, 0xAC54, 0x7413, 0xAC55, 0x7414, 0xAC56, 0x7415, 0xAC57, 0x7416, 0xAC58, 0x7417, 0xAC59, 0x7418, 0xAC5A, 0x7419, + 0xAC5B, 0x741C, 0xAC5C, 0x741D, 0xAC5D, 0x741E, 0xAC5E, 0x741F, 0xAC5F, 0x7420, 0xAC60, 0x7421, 0xAC61, 0x7423, 0xAC62, 0x7424, + 0xAC63, 0x7427, 0xAC64, 0x7429, 0xAC65, 0x742B, 0xAC66, 0x742D, 0xAC67, 0x742F, 0xAC68, 0x7431, 0xAC69, 0x7432, 0xAC6A, 0x7437, + 0xAC6B, 0x7438, 0xAC6C, 0x7439, 0xAC6D, 0x743A, 0xAC6E, 0x743B, 0xAC6F, 0x743D, 0xAC70, 0x743E, 0xAC71, 0x743F, 0xAC72, 0x7440, + 0xAC73, 0x7442, 0xAC74, 0x7443, 0xAC75, 0x7444, 0xAC76, 0x7445, 0xAC77, 0x7446, 0xAC78, 0x7447, 0xAC79, 0x7448, 0xAC7A, 0x7449, + 0xAC7B, 0x744A, 0xAC7C, 0x744B, 0xAC7D, 0x744C, 0xAC7E, 0x744D, 0xAC80, 0x744E, 0xAC81, 0x744F, 0xAC82, 0x7450, 0xAC83, 0x7451, + 0xAC84, 0x7452, 0xAC85, 0x7453, 0xAC86, 0x7454, 0xAC87, 0x7456, 0xAC88, 0x7458, 0xAC89, 0x745D, 0xAC8A, 0x7460, 0xAC8B, 0x7461, + 0xAC8C, 0x7462, 0xAC8D, 0x7463, 0xAC8E, 0x7464, 0xAC8F, 0x7465, 0xAC90, 0x7466, 0xAC91, 0x7467, 0xAC92, 0x7468, 0xAC93, 0x7469, + 0xAC94, 0x746A, 0xAC95, 0x746B, 0xAC96, 0x746C, 0xAC97, 0x746E, 0xAC98, 0x746F, 0xAC99, 0x7471, 0xAC9A, 0x7472, 0xAC9B, 0x7473, + 0xAC9C, 0x7474, 0xAC9D, 0x7475, 0xAC9E, 0x7478, 0xAC9F, 0x7479, 0xACA0, 0x747A, 0xAD40, 0x747B, 0xAD41, 0x747C, 0xAD42, 0x747D, + 0xAD43, 0x747F, 0xAD44, 0x7482, 0xAD45, 0x7484, 0xAD46, 0x7485, 0xAD47, 0x7486, 0xAD48, 0x7488, 0xAD49, 0x7489, 0xAD4A, 0x748A, + 0xAD4B, 0x748C, 0xAD4C, 0x748D, 0xAD4D, 0x748F, 0xAD4E, 0x7491, 0xAD4F, 0x7492, 0xAD50, 0x7493, 0xAD51, 0x7494, 0xAD52, 0x7495, + 0xAD53, 0x7496, 0xAD54, 0x7497, 0xAD55, 0x7498, 0xAD56, 0x7499, 0xAD57, 0x749A, 0xAD58, 0x749B, 0xAD59, 0x749D, 0xAD5A, 0x749F, + 0xAD5B, 0x74A0, 0xAD5C, 0x74A1, 0xAD5D, 0x74A2, 0xAD5E, 0x74A3, 0xAD5F, 0x74A4, 0xAD60, 0x74A5, 0xAD61, 0x74A6, 0xAD62, 0x74AA, + 0xAD63, 0x74AB, 0xAD64, 0x74AC, 0xAD65, 0x74AD, 0xAD66, 0x74AE, 0xAD67, 0x74AF, 0xAD68, 0x74B0, 0xAD69, 0x74B1, 0xAD6A, 0x74B2, + 0xAD6B, 0x74B3, 0xAD6C, 0x74B4, 0xAD6D, 0x74B5, 0xAD6E, 0x74B6, 0xAD6F, 0x74B7, 0xAD70, 0x74B8, 0xAD71, 0x74B9, 0xAD72, 0x74BB, + 0xAD73, 0x74BC, 0xAD74, 0x74BD, 0xAD75, 0x74BE, 0xAD76, 0x74BF, 0xAD77, 0x74C0, 0xAD78, 0x74C1, 0xAD79, 0x74C2, 0xAD7A, 0x74C3, + 0xAD7B, 0x74C4, 0xAD7C, 0x74C5, 0xAD7D, 0x74C6, 0xAD7E, 0x74C7, 0xAD80, 0x74C8, 0xAD81, 0x74C9, 0xAD82, 0x74CA, 0xAD83, 0x74CB, + 0xAD84, 0x74CC, 0xAD85, 0x74CD, 0xAD86, 0x74CE, 0xAD87, 0x74CF, 0xAD88, 0x74D0, 0xAD89, 0x74D1, 0xAD8A, 0x74D3, 0xAD8B, 0x74D4, + 0xAD8C, 0x74D5, 0xAD8D, 0x74D6, 0xAD8E, 0x74D7, 0xAD8F, 0x74D8, 0xAD90, 0x74D9, 0xAD91, 0x74DA, 0xAD92, 0x74DB, 0xAD93, 0x74DD, + 0xAD94, 0x74DF, 0xAD95, 0x74E1, 0xAD96, 0x74E5, 0xAD97, 0x74E7, 0xAD98, 0x74E8, 0xAD99, 0x74E9, 0xAD9A, 0x74EA, 0xAD9B, 0x74EB, + 0xAD9C, 0x74EC, 0xAD9D, 0x74ED, 0xAD9E, 0x74F0, 0xAD9F, 0x74F1, 0xADA0, 0x74F2, 0xAE40, 0x74F3, 0xAE41, 0x74F5, 0xAE42, 0x74F8, + 0xAE43, 0x74F9, 0xAE44, 0x74FA, 0xAE45, 0x74FB, 0xAE46, 0x74FC, 0xAE47, 0x74FD, 0xAE48, 0x74FE, 0xAE49, 0x7500, 0xAE4A, 0x7501, + 0xAE4B, 0x7502, 0xAE4C, 0x7503, 0xAE4D, 0x7505, 0xAE4E, 0x7506, 0xAE4F, 0x7507, 0xAE50, 0x7508, 0xAE51, 0x7509, 0xAE52, 0x750A, + 0xAE53, 0x750B, 0xAE54, 0x750C, 0xAE55, 0x750E, 0xAE56, 0x7510, 0xAE57, 0x7512, 0xAE58, 0x7514, 0xAE59, 0x7515, 0xAE5A, 0x7516, + 0xAE5B, 0x7517, 0xAE5C, 0x751B, 0xAE5D, 0x751D, 0xAE5E, 0x751E, 0xAE5F, 0x7520, 0xAE60, 0x7521, 0xAE61, 0x7522, 0xAE62, 0x7523, + 0xAE63, 0x7524, 0xAE64, 0x7526, 0xAE65, 0x7527, 0xAE66, 0x752A, 0xAE67, 0x752E, 0xAE68, 0x7534, 0xAE69, 0x7536, 0xAE6A, 0x7539, + 0xAE6B, 0x753C, 0xAE6C, 0x753D, 0xAE6D, 0x753F, 0xAE6E, 0x7541, 0xAE6F, 0x7542, 0xAE70, 0x7543, 0xAE71, 0x7544, 0xAE72, 0x7546, + 0xAE73, 0x7547, 0xAE74, 0x7549, 0xAE75, 0x754A, 0xAE76, 0x754D, 0xAE77, 0x7550, 0xAE78, 0x7551, 0xAE79, 0x7552, 0xAE7A, 0x7553, + 0xAE7B, 0x7555, 0xAE7C, 0x7556, 0xAE7D, 0x7557, 0xAE7E, 0x7558, 0xAE80, 0x755D, 0xAE81, 0x755E, 0xAE82, 0x755F, 0xAE83, 0x7560, + 0xAE84, 0x7561, 0xAE85, 0x7562, 0xAE86, 0x7563, 0xAE87, 0x7564, 0xAE88, 0x7567, 0xAE89, 0x7568, 0xAE8A, 0x7569, 0xAE8B, 0x756B, + 0xAE8C, 0x756C, 0xAE8D, 0x756D, 0xAE8E, 0x756E, 0xAE8F, 0x756F, 0xAE90, 0x7570, 0xAE91, 0x7571, 0xAE92, 0x7573, 0xAE93, 0x7575, + 0xAE94, 0x7576, 0xAE95, 0x7577, 0xAE96, 0x757A, 0xAE97, 0x757B, 0xAE98, 0x757C, 0xAE99, 0x757D, 0xAE9A, 0x757E, 0xAE9B, 0x7580, + 0xAE9C, 0x7581, 0xAE9D, 0x7582, 0xAE9E, 0x7584, 0xAE9F, 0x7585, 0xAEA0, 0x7587, 0xAF40, 0x7588, 0xAF41, 0x7589, 0xAF42, 0x758A, + 0xAF43, 0x758C, 0xAF44, 0x758D, 0xAF45, 0x758E, 0xAF46, 0x7590, 0xAF47, 0x7593, 0xAF48, 0x7595, 0xAF49, 0x7598, 0xAF4A, 0x759B, + 0xAF4B, 0x759C, 0xAF4C, 0x759E, 0xAF4D, 0x75A2, 0xAF4E, 0x75A6, 0xAF4F, 0x75A7, 0xAF50, 0x75A8, 0xAF51, 0x75A9, 0xAF52, 0x75AA, + 0xAF53, 0x75AD, 0xAF54, 0x75B6, 0xAF55, 0x75B7, 0xAF56, 0x75BA, 0xAF57, 0x75BB, 0xAF58, 0x75BF, 0xAF59, 0x75C0, 0xAF5A, 0x75C1, + 0xAF5B, 0x75C6, 0xAF5C, 0x75CB, 0xAF5D, 0x75CC, 0xAF5E, 0x75CE, 0xAF5F, 0x75CF, 0xAF60, 0x75D0, 0xAF61, 0x75D1, 0xAF62, 0x75D3, + 0xAF63, 0x75D7, 0xAF64, 0x75D9, 0xAF65, 0x75DA, 0xAF66, 0x75DC, 0xAF67, 0x75DD, 0xAF68, 0x75DF, 0xAF69, 0x75E0, 0xAF6A, 0x75E1, + 0xAF6B, 0x75E5, 0xAF6C, 0x75E9, 0xAF6D, 0x75EC, 0xAF6E, 0x75ED, 0xAF6F, 0x75EE, 0xAF70, 0x75EF, 0xAF71, 0x75F2, 0xAF72, 0x75F3, + 0xAF73, 0x75F5, 0xAF74, 0x75F6, 0xAF75, 0x75F7, 0xAF76, 0x75F8, 0xAF77, 0x75FA, 0xAF78, 0x75FB, 0xAF79, 0x75FD, 0xAF7A, 0x75FE, + 0xAF7B, 0x7602, 0xAF7C, 0x7604, 0xAF7D, 0x7606, 0xAF7E, 0x7607, 0xAF80, 0x7608, 0xAF81, 0x7609, 0xAF82, 0x760B, 0xAF83, 0x760D, + 0xAF84, 0x760E, 0xAF85, 0x760F, 0xAF86, 0x7611, 0xAF87, 0x7612, 0xAF88, 0x7613, 0xAF89, 0x7614, 0xAF8A, 0x7616, 0xAF8B, 0x761A, + 0xAF8C, 0x761C, 0xAF8D, 0x761D, 0xAF8E, 0x761E, 0xAF8F, 0x7621, 0xAF90, 0x7623, 0xAF91, 0x7627, 0xAF92, 0x7628, 0xAF93, 0x762C, + 0xAF94, 0x762E, 0xAF95, 0x762F, 0xAF96, 0x7631, 0xAF97, 0x7632, 0xAF98, 0x7636, 0xAF99, 0x7637, 0xAF9A, 0x7639, 0xAF9B, 0x763A, + 0xAF9C, 0x763B, 0xAF9D, 0x763D, 0xAF9E, 0x7641, 0xAF9F, 0x7642, 0xAFA0, 0x7644, 0xB040, 0x7645, 0xB041, 0x7646, 0xB042, 0x7647, + 0xB043, 0x7648, 0xB044, 0x7649, 0xB045, 0x764A, 0xB046, 0x764B, 0xB047, 0x764E, 0xB048, 0x764F, 0xB049, 0x7650, 0xB04A, 0x7651, + 0xB04B, 0x7652, 0xB04C, 0x7653, 0xB04D, 0x7655, 0xB04E, 0x7657, 0xB04F, 0x7658, 0xB050, 0x7659, 0xB051, 0x765A, 0xB052, 0x765B, + 0xB053, 0x765D, 0xB054, 0x765F, 0xB055, 0x7660, 0xB056, 0x7661, 0xB057, 0x7662, 0xB058, 0x7664, 0xB059, 0x7665, 0xB05A, 0x7666, + 0xB05B, 0x7667, 0xB05C, 0x7668, 0xB05D, 0x7669, 0xB05E, 0x766A, 0xB05F, 0x766C, 0xB060, 0x766D, 0xB061, 0x766E, 0xB062, 0x7670, + 0xB063, 0x7671, 0xB064, 0x7672, 0xB065, 0x7673, 0xB066, 0x7674, 0xB067, 0x7675, 0xB068, 0x7676, 0xB069, 0x7677, 0xB06A, 0x7679, + 0xB06B, 0x767A, 0xB06C, 0x767C, 0xB06D, 0x767F, 0xB06E, 0x7680, 0xB06F, 0x7681, 0xB070, 0x7683, 0xB071, 0x7685, 0xB072, 0x7689, + 0xB073, 0x768A, 0xB074, 0x768C, 0xB075, 0x768D, 0xB076, 0x768F, 0xB077, 0x7690, 0xB078, 0x7692, 0xB079, 0x7694, 0xB07A, 0x7695, + 0xB07B, 0x7697, 0xB07C, 0x7698, 0xB07D, 0x769A, 0xB07E, 0x769B, 0xB080, 0x769C, 0xB081, 0x769D, 0xB082, 0x769E, 0xB083, 0x769F, + 0xB084, 0x76A0, 0xB085, 0x76A1, 0xB086, 0x76A2, 0xB087, 0x76A3, 0xB088, 0x76A5, 0xB089, 0x76A6, 0xB08A, 0x76A7, 0xB08B, 0x76A8, + 0xB08C, 0x76A9, 0xB08D, 0x76AA, 0xB08E, 0x76AB, 0xB08F, 0x76AC, 0xB090, 0x76AD, 0xB091, 0x76AF, 0xB092, 0x76B0, 0xB093, 0x76B3, + 0xB094, 0x76B5, 0xB095, 0x76B6, 0xB096, 0x76B7, 0xB097, 0x76B8, 0xB098, 0x76B9, 0xB099, 0x76BA, 0xB09A, 0x76BB, 0xB09B, 0x76BC, + 0xB09C, 0x76BD, 0xB09D, 0x76BE, 0xB09E, 0x76C0, 0xB09F, 0x76C1, 0xB0A0, 0x76C3, 0xB0A1, 0x554A, 0xB0A2, 0x963F, 0xB0A3, 0x57C3, + 0xB0A4, 0x6328, 0xB0A5, 0x54CE, 0xB0A6, 0x5509, 0xB0A7, 0x54C0, 0xB0A8, 0x7691, 0xB0A9, 0x764C, 0xB0AA, 0x853C, 0xB0AB, 0x77EE, + 0xB0AC, 0x827E, 0xB0AD, 0x788D, 0xB0AE, 0x7231, 0xB0AF, 0x9698, 0xB0B0, 0x978D, 0xB0B1, 0x6C28, 0xB0B2, 0x5B89, 0xB0B3, 0x4FFA, + 0xB0B4, 0x6309, 0xB0B5, 0x6697, 0xB0B6, 0x5CB8, 0xB0B7, 0x80FA, 0xB0B8, 0x6848, 0xB0B9, 0x80AE, 0xB0BA, 0x6602, 0xB0BB, 0x76CE, + 0xB0BC, 0x51F9, 0xB0BD, 0x6556, 0xB0BE, 0x71AC, 0xB0BF, 0x7FF1, 0xB0C0, 0x8884, 0xB0C1, 0x50B2, 0xB0C2, 0x5965, 0xB0C3, 0x61CA, + 0xB0C4, 0x6FB3, 0xB0C5, 0x82AD, 0xB0C6, 0x634C, 0xB0C7, 0x6252, 0xB0C8, 0x53ED, 0xB0C9, 0x5427, 0xB0CA, 0x7B06, 0xB0CB, 0x516B, + 0xB0CC, 0x75A4, 0xB0CD, 0x5DF4, 0xB0CE, 0x62D4, 0xB0CF, 0x8DCB, 0xB0D0, 0x9776, 0xB0D1, 0x628A, 0xB0D2, 0x8019, 0xB0D3, 0x575D, + 0xB0D4, 0x9738, 0xB0D5, 0x7F62, 0xB0D6, 0x7238, 0xB0D7, 0x767D, 0xB0D8, 0x67CF, 0xB0D9, 0x767E, 0xB0DA, 0x6446, 0xB0DB, 0x4F70, + 0xB0DC, 0x8D25, 0xB0DD, 0x62DC, 0xB0DE, 0x7A17, 0xB0DF, 0x6591, 0xB0E0, 0x73ED, 0xB0E1, 0x642C, 0xB0E2, 0x6273, 0xB0E3, 0x822C, + 0xB0E4, 0x9881, 0xB0E5, 0x677F, 0xB0E6, 0x7248, 0xB0E7, 0x626E, 0xB0E8, 0x62CC, 0xB0E9, 0x4F34, 0xB0EA, 0x74E3, 0xB0EB, 0x534A, + 0xB0EC, 0x529E, 0xB0ED, 0x7ECA, 0xB0EE, 0x90A6, 0xB0EF, 0x5E2E, 0xB0F0, 0x6886, 0xB0F1, 0x699C, 0xB0F2, 0x8180, 0xB0F3, 0x7ED1, + 0xB0F4, 0x68D2, 0xB0F5, 0x78C5, 0xB0F6, 0x868C, 0xB0F7, 0x9551, 0xB0F8, 0x508D, 0xB0F9, 0x8C24, 0xB0FA, 0x82DE, 0xB0FB, 0x80DE, + 0xB0FC, 0x5305, 0xB0FD, 0x8912, 0xB0FE, 0x5265, 0xB140, 0x76C4, 0xB141, 0x76C7, 0xB142, 0x76C9, 0xB143, 0x76CB, 0xB144, 0x76CC, + 0xB145, 0x76D3, 0xB146, 0x76D5, 0xB147, 0x76D9, 0xB148, 0x76DA, 0xB149, 0x76DC, 0xB14A, 0x76DD, 0xB14B, 0x76DE, 0xB14C, 0x76E0, + 0xB14D, 0x76E1, 0xB14E, 0x76E2, 0xB14F, 0x76E3, 0xB150, 0x76E4, 0xB151, 0x76E6, 0xB152, 0x76E7, 0xB153, 0x76E8, 0xB154, 0x76E9, + 0xB155, 0x76EA, 0xB156, 0x76EB, 0xB157, 0x76EC, 0xB158, 0x76ED, 0xB159, 0x76F0, 0xB15A, 0x76F3, 0xB15B, 0x76F5, 0xB15C, 0x76F6, + 0xB15D, 0x76F7, 0xB15E, 0x76FA, 0xB15F, 0x76FB, 0xB160, 0x76FD, 0xB161, 0x76FF, 0xB162, 0x7700, 0xB163, 0x7702, 0xB164, 0x7703, + 0xB165, 0x7705, 0xB166, 0x7706, 0xB167, 0x770A, 0xB168, 0x770C, 0xB169, 0x770E, 0xB16A, 0x770F, 0xB16B, 0x7710, 0xB16C, 0x7711, + 0xB16D, 0x7712, 0xB16E, 0x7713, 0xB16F, 0x7714, 0xB170, 0x7715, 0xB171, 0x7716, 0xB172, 0x7717, 0xB173, 0x7718, 0xB174, 0x771B, + 0xB175, 0x771C, 0xB176, 0x771D, 0xB177, 0x771E, 0xB178, 0x7721, 0xB179, 0x7723, 0xB17A, 0x7724, 0xB17B, 0x7725, 0xB17C, 0x7727, + 0xB17D, 0x772A, 0xB17E, 0x772B, 0xB180, 0x772C, 0xB181, 0x772E, 0xB182, 0x7730, 0xB183, 0x7731, 0xB184, 0x7732, 0xB185, 0x7733, + 0xB186, 0x7734, 0xB187, 0x7739, 0xB188, 0x773B, 0xB189, 0x773D, 0xB18A, 0x773E, 0xB18B, 0x773F, 0xB18C, 0x7742, 0xB18D, 0x7744, + 0xB18E, 0x7745, 0xB18F, 0x7746, 0xB190, 0x7748, 0xB191, 0x7749, 0xB192, 0x774A, 0xB193, 0x774B, 0xB194, 0x774C, 0xB195, 0x774D, + 0xB196, 0x774E, 0xB197, 0x774F, 0xB198, 0x7752, 0xB199, 0x7753, 0xB19A, 0x7754, 0xB19B, 0x7755, 0xB19C, 0x7756, 0xB19D, 0x7757, + 0xB19E, 0x7758, 0xB19F, 0x7759, 0xB1A0, 0x775C, 0xB1A1, 0x8584, 0xB1A2, 0x96F9, 0xB1A3, 0x4FDD, 0xB1A4, 0x5821, 0xB1A5, 0x9971, + 0xB1A6, 0x5B9D, 0xB1A7, 0x62B1, 0xB1A8, 0x62A5, 0xB1A9, 0x66B4, 0xB1AA, 0x8C79, 0xB1AB, 0x9C8D, 0xB1AC, 0x7206, 0xB1AD, 0x676F, + 0xB1AE, 0x7891, 0xB1AF, 0x60B2, 0xB1B0, 0x5351, 0xB1B1, 0x5317, 0xB1B2, 0x8F88, 0xB1B3, 0x80CC, 0xB1B4, 0x8D1D, 0xB1B5, 0x94A1, + 0xB1B6, 0x500D, 0xB1B7, 0x72C8, 0xB1B8, 0x5907, 0xB1B9, 0x60EB, 0xB1BA, 0x7119, 0xB1BB, 0x88AB, 0xB1BC, 0x5954, 0xB1BD, 0x82EF, + 0xB1BE, 0x672C, 0xB1BF, 0x7B28, 0xB1C0, 0x5D29, 0xB1C1, 0x7EF7, 0xB1C2, 0x752D, 0xB1C3, 0x6CF5, 0xB1C4, 0x8E66, 0xB1C5, 0x8FF8, + 0xB1C6, 0x903C, 0xB1C7, 0x9F3B, 0xB1C8, 0x6BD4, 0xB1C9, 0x9119, 0xB1CA, 0x7B14, 0xB1CB, 0x5F7C, 0xB1CC, 0x78A7, 0xB1CD, 0x84D6, + 0xB1CE, 0x853D, 0xB1CF, 0x6BD5, 0xB1D0, 0x6BD9, 0xB1D1, 0x6BD6, 0xB1D2, 0x5E01, 0xB1D3, 0x5E87, 0xB1D4, 0x75F9, 0xB1D5, 0x95ED, + 0xB1D6, 0x655D, 0xB1D7, 0x5F0A, 0xB1D8, 0x5FC5, 0xB1D9, 0x8F9F, 0xB1DA, 0x58C1, 0xB1DB, 0x81C2, 0xB1DC, 0x907F, 0xB1DD, 0x965B, + 0xB1DE, 0x97AD, 0xB1DF, 0x8FB9, 0xB1E0, 0x7F16, 0xB1E1, 0x8D2C, 0xB1E2, 0x6241, 0xB1E3, 0x4FBF, 0xB1E4, 0x53D8, 0xB1E5, 0x535E, + 0xB1E6, 0x8FA8, 0xB1E7, 0x8FA9, 0xB1E8, 0x8FAB, 0xB1E9, 0x904D, 0xB1EA, 0x6807, 0xB1EB, 0x5F6A, 0xB1EC, 0x8198, 0xB1ED, 0x8868, + 0xB1EE, 0x9CD6, 0xB1EF, 0x618B, 0xB1F0, 0x522B, 0xB1F1, 0x762A, 0xB1F2, 0x5F6C, 0xB1F3, 0x658C, 0xB1F4, 0x6FD2, 0xB1F5, 0x6EE8, + 0xB1F6, 0x5BBE, 0xB1F7, 0x6448, 0xB1F8, 0x5175, 0xB1F9, 0x51B0, 0xB1FA, 0x67C4, 0xB1FB, 0x4E19, 0xB1FC, 0x79C9, 0xB1FD, 0x997C, + 0xB1FE, 0x70B3, 0xB240, 0x775D, 0xB241, 0x775E, 0xB242, 0x775F, 0xB243, 0x7760, 0xB244, 0x7764, 0xB245, 0x7767, 0xB246, 0x7769, + 0xB247, 0x776A, 0xB248, 0x776D, 0xB249, 0x776E, 0xB24A, 0x776F, 0xB24B, 0x7770, 0xB24C, 0x7771, 0xB24D, 0x7772, 0xB24E, 0x7773, + 0xB24F, 0x7774, 0xB250, 0x7775, 0xB251, 0x7776, 0xB252, 0x7777, 0xB253, 0x7778, 0xB254, 0x777A, 0xB255, 0x777B, 0xB256, 0x777C, + 0xB257, 0x7781, 0xB258, 0x7782, 0xB259, 0x7783, 0xB25A, 0x7786, 0xB25B, 0x7787, 0xB25C, 0x7788, 0xB25D, 0x7789, 0xB25E, 0x778A, + 0xB25F, 0x778B, 0xB260, 0x778F, 0xB261, 0x7790, 0xB262, 0x7793, 0xB263, 0x7794, 0xB264, 0x7795, 0xB265, 0x7796, 0xB266, 0x7797, + 0xB267, 0x7798, 0xB268, 0x7799, 0xB269, 0x779A, 0xB26A, 0x779B, 0xB26B, 0x779C, 0xB26C, 0x779D, 0xB26D, 0x779E, 0xB26E, 0x77A1, + 0xB26F, 0x77A3, 0xB270, 0x77A4, 0xB271, 0x77A6, 0xB272, 0x77A8, 0xB273, 0x77AB, 0xB274, 0x77AD, 0xB275, 0x77AE, 0xB276, 0x77AF, + 0xB277, 0x77B1, 0xB278, 0x77B2, 0xB279, 0x77B4, 0xB27A, 0x77B6, 0xB27B, 0x77B7, 0xB27C, 0x77B8, 0xB27D, 0x77B9, 0xB27E, 0x77BA, + 0xB280, 0x77BC, 0xB281, 0x77BE, 0xB282, 0x77C0, 0xB283, 0x77C1, 0xB284, 0x77C2, 0xB285, 0x77C3, 0xB286, 0x77C4, 0xB287, 0x77C5, + 0xB288, 0x77C6, 0xB289, 0x77C7, 0xB28A, 0x77C8, 0xB28B, 0x77C9, 0xB28C, 0x77CA, 0xB28D, 0x77CB, 0xB28E, 0x77CC, 0xB28F, 0x77CE, + 0xB290, 0x77CF, 0xB291, 0x77D0, 0xB292, 0x77D1, 0xB293, 0x77D2, 0xB294, 0x77D3, 0xB295, 0x77D4, 0xB296, 0x77D5, 0xB297, 0x77D6, + 0xB298, 0x77D8, 0xB299, 0x77D9, 0xB29A, 0x77DA, 0xB29B, 0x77DD, 0xB29C, 0x77DE, 0xB29D, 0x77DF, 0xB29E, 0x77E0, 0xB29F, 0x77E1, + 0xB2A0, 0x77E4, 0xB2A1, 0x75C5, 0xB2A2, 0x5E76, 0xB2A3, 0x73BB, 0xB2A4, 0x83E0, 0xB2A5, 0x64AD, 0xB2A6, 0x62E8, 0xB2A7, 0x94B5, + 0xB2A8, 0x6CE2, 0xB2A9, 0x535A, 0xB2AA, 0x52C3, 0xB2AB, 0x640F, 0xB2AC, 0x94C2, 0xB2AD, 0x7B94, 0xB2AE, 0x4F2F, 0xB2AF, 0x5E1B, + 0xB2B0, 0x8236, 0xB2B1, 0x8116, 0xB2B2, 0x818A, 0xB2B3, 0x6E24, 0xB2B4, 0x6CCA, 0xB2B5, 0x9A73, 0xB2B6, 0x6355, 0xB2B7, 0x535C, + 0xB2B8, 0x54FA, 0xB2B9, 0x8865, 0xB2BA, 0x57E0, 0xB2BB, 0x4E0D, 0xB2BC, 0x5E03, 0xB2BD, 0x6B65, 0xB2BE, 0x7C3F, 0xB2BF, 0x90E8, + 0xB2C0, 0x6016, 0xB2C1, 0x64E6, 0xB2C2, 0x731C, 0xB2C3, 0x88C1, 0xB2C4, 0x6750, 0xB2C5, 0x624D, 0xB2C6, 0x8D22, 0xB2C7, 0x776C, + 0xB2C8, 0x8E29, 0xB2C9, 0x91C7, 0xB2CA, 0x5F69, 0xB2CB, 0x83DC, 0xB2CC, 0x8521, 0xB2CD, 0x9910, 0xB2CE, 0x53C2, 0xB2CF, 0x8695, + 0xB2D0, 0x6B8B, 0xB2D1, 0x60ED, 0xB2D2, 0x60E8, 0xB2D3, 0x707F, 0xB2D4, 0x82CD, 0xB2D5, 0x8231, 0xB2D6, 0x4ED3, 0xB2D7, 0x6CA7, + 0xB2D8, 0x85CF, 0xB2D9, 0x64CD, 0xB2DA, 0x7CD9, 0xB2DB, 0x69FD, 0xB2DC, 0x66F9, 0xB2DD, 0x8349, 0xB2DE, 0x5395, 0xB2DF, 0x7B56, + 0xB2E0, 0x4FA7, 0xB2E1, 0x518C, 0xB2E2, 0x6D4B, 0xB2E3, 0x5C42, 0xB2E4, 0x8E6D, 0xB2E5, 0x63D2, 0xB2E6, 0x53C9, 0xB2E7, 0x832C, + 0xB2E8, 0x8336, 0xB2E9, 0x67E5, 0xB2EA, 0x78B4, 0xB2EB, 0x643D, 0xB2EC, 0x5BDF, 0xB2ED, 0x5C94, 0xB2EE, 0x5DEE, 0xB2EF, 0x8BE7, + 0xB2F0, 0x62C6, 0xB2F1, 0x67F4, 0xB2F2, 0x8C7A, 0xB2F3, 0x6400, 0xB2F4, 0x63BA, 0xB2F5, 0x8749, 0xB2F6, 0x998B, 0xB2F7, 0x8C17, + 0xB2F8, 0x7F20, 0xB2F9, 0x94F2, 0xB2FA, 0x4EA7, 0xB2FB, 0x9610, 0xB2FC, 0x98A4, 0xB2FD, 0x660C, 0xB2FE, 0x7316, 0xB340, 0x77E6, + 0xB341, 0x77E8, 0xB342, 0x77EA, 0xB343, 0x77EF, 0xB344, 0x77F0, 0xB345, 0x77F1, 0xB346, 0x77F2, 0xB347, 0x77F4, 0xB348, 0x77F5, + 0xB349, 0x77F7, 0xB34A, 0x77F9, 0xB34B, 0x77FA, 0xB34C, 0x77FB, 0xB34D, 0x77FC, 0xB34E, 0x7803, 0xB34F, 0x7804, 0xB350, 0x7805, + 0xB351, 0x7806, 0xB352, 0x7807, 0xB353, 0x7808, 0xB354, 0x780A, 0xB355, 0x780B, 0xB356, 0x780E, 0xB357, 0x780F, 0xB358, 0x7810, + 0xB359, 0x7813, 0xB35A, 0x7815, 0xB35B, 0x7819, 0xB35C, 0x781B, 0xB35D, 0x781E, 0xB35E, 0x7820, 0xB35F, 0x7821, 0xB360, 0x7822, + 0xB361, 0x7824, 0xB362, 0x7828, 0xB363, 0x782A, 0xB364, 0x782B, 0xB365, 0x782E, 0xB366, 0x782F, 0xB367, 0x7831, 0xB368, 0x7832, + 0xB369, 0x7833, 0xB36A, 0x7835, 0xB36B, 0x7836, 0xB36C, 0x783D, 0xB36D, 0x783F, 0xB36E, 0x7841, 0xB36F, 0x7842, 0xB370, 0x7843, + 0xB371, 0x7844, 0xB372, 0x7846, 0xB373, 0x7848, 0xB374, 0x7849, 0xB375, 0x784A, 0xB376, 0x784B, 0xB377, 0x784D, 0xB378, 0x784F, + 0xB379, 0x7851, 0xB37A, 0x7853, 0xB37B, 0x7854, 0xB37C, 0x7858, 0xB37D, 0x7859, 0xB37E, 0x785A, 0xB380, 0x785B, 0xB381, 0x785C, + 0xB382, 0x785E, 0xB383, 0x785F, 0xB384, 0x7860, 0xB385, 0x7861, 0xB386, 0x7862, 0xB387, 0x7863, 0xB388, 0x7864, 0xB389, 0x7865, + 0xB38A, 0x7866, 0xB38B, 0x7867, 0xB38C, 0x7868, 0xB38D, 0x7869, 0xB38E, 0x786F, 0xB38F, 0x7870, 0xB390, 0x7871, 0xB391, 0x7872, + 0xB392, 0x7873, 0xB393, 0x7874, 0xB394, 0x7875, 0xB395, 0x7876, 0xB396, 0x7878, 0xB397, 0x7879, 0xB398, 0x787A, 0xB399, 0x787B, + 0xB39A, 0x787D, 0xB39B, 0x787E, 0xB39C, 0x787F, 0xB39D, 0x7880, 0xB39E, 0x7881, 0xB39F, 0x7882, 0xB3A0, 0x7883, 0xB3A1, 0x573A, + 0xB3A2, 0x5C1D, 0xB3A3, 0x5E38, 0xB3A4, 0x957F, 0xB3A5, 0x507F, 0xB3A6, 0x80A0, 0xB3A7, 0x5382, 0xB3A8, 0x655E, 0xB3A9, 0x7545, + 0xB3AA, 0x5531, 0xB3AB, 0x5021, 0xB3AC, 0x8D85, 0xB3AD, 0x6284, 0xB3AE, 0x949E, 0xB3AF, 0x671D, 0xB3B0, 0x5632, 0xB3B1, 0x6F6E, + 0xB3B2, 0x5DE2, 0xB3B3, 0x5435, 0xB3B4, 0x7092, 0xB3B5, 0x8F66, 0xB3B6, 0x626F, 0xB3B7, 0x64A4, 0xB3B8, 0x63A3, 0xB3B9, 0x5F7B, + 0xB3BA, 0x6F88, 0xB3BB, 0x90F4, 0xB3BC, 0x81E3, 0xB3BD, 0x8FB0, 0xB3BE, 0x5C18, 0xB3BF, 0x6668, 0xB3C0, 0x5FF1, 0xB3C1, 0x6C89, + 0xB3C2, 0x9648, 0xB3C3, 0x8D81, 0xB3C4, 0x886C, 0xB3C5, 0x6491, 0xB3C6, 0x79F0, 0xB3C7, 0x57CE, 0xB3C8, 0x6A59, 0xB3C9, 0x6210, + 0xB3CA, 0x5448, 0xB3CB, 0x4E58, 0xB3CC, 0x7A0B, 0xB3CD, 0x60E9, 0xB3CE, 0x6F84, 0xB3CF, 0x8BDA, 0xB3D0, 0x627F, 0xB3D1, 0x901E, + 0xB3D2, 0x9A8B, 0xB3D3, 0x79E4, 0xB3D4, 0x5403, 0xB3D5, 0x75F4, 0xB3D6, 0x6301, 0xB3D7, 0x5319, 0xB3D8, 0x6C60, 0xB3D9, 0x8FDF, + 0xB3DA, 0x5F1B, 0xB3DB, 0x9A70, 0xB3DC, 0x803B, 0xB3DD, 0x9F7F, 0xB3DE, 0x4F88, 0xB3DF, 0x5C3A, 0xB3E0, 0x8D64, 0xB3E1, 0x7FC5, + 0xB3E2, 0x65A5, 0xB3E3, 0x70BD, 0xB3E4, 0x5145, 0xB3E5, 0x51B2, 0xB3E6, 0x866B, 0xB3E7, 0x5D07, 0xB3E8, 0x5BA0, 0xB3E9, 0x62BD, + 0xB3EA, 0x916C, 0xB3EB, 0x7574, 0xB3EC, 0x8E0C, 0xB3ED, 0x7A20, 0xB3EE, 0x6101, 0xB3EF, 0x7B79, 0xB3F0, 0x4EC7, 0xB3F1, 0x7EF8, + 0xB3F2, 0x7785, 0xB3F3, 0x4E11, 0xB3F4, 0x81ED, 0xB3F5, 0x521D, 0xB3F6, 0x51FA, 0xB3F7, 0x6A71, 0xB3F8, 0x53A8, 0xB3F9, 0x8E87, + 0xB3FA, 0x9504, 0xB3FB, 0x96CF, 0xB3FC, 0x6EC1, 0xB3FD, 0x9664, 0xB3FE, 0x695A, 0xB440, 0x7884, 0xB441, 0x7885, 0xB442, 0x7886, + 0xB443, 0x7888, 0xB444, 0x788A, 0xB445, 0x788B, 0xB446, 0x788F, 0xB447, 0x7890, 0xB448, 0x7892, 0xB449, 0x7894, 0xB44A, 0x7895, + 0xB44B, 0x7896, 0xB44C, 0x7899, 0xB44D, 0x789D, 0xB44E, 0x789E, 0xB44F, 0x78A0, 0xB450, 0x78A2, 0xB451, 0x78A4, 0xB452, 0x78A6, + 0xB453, 0x78A8, 0xB454, 0x78A9, 0xB455, 0x78AA, 0xB456, 0x78AB, 0xB457, 0x78AC, 0xB458, 0x78AD, 0xB459, 0x78AE, 0xB45A, 0x78AF, + 0xB45B, 0x78B5, 0xB45C, 0x78B6, 0xB45D, 0x78B7, 0xB45E, 0x78B8, 0xB45F, 0x78BA, 0xB460, 0x78BB, 0xB461, 0x78BC, 0xB462, 0x78BD, + 0xB463, 0x78BF, 0xB464, 0x78C0, 0xB465, 0x78C2, 0xB466, 0x78C3, 0xB467, 0x78C4, 0xB468, 0x78C6, 0xB469, 0x78C7, 0xB46A, 0x78C8, + 0xB46B, 0x78CC, 0xB46C, 0x78CD, 0xB46D, 0x78CE, 0xB46E, 0x78CF, 0xB46F, 0x78D1, 0xB470, 0x78D2, 0xB471, 0x78D3, 0xB472, 0x78D6, + 0xB473, 0x78D7, 0xB474, 0x78D8, 0xB475, 0x78DA, 0xB476, 0x78DB, 0xB477, 0x78DC, 0xB478, 0x78DD, 0xB479, 0x78DE, 0xB47A, 0x78DF, + 0xB47B, 0x78E0, 0xB47C, 0x78E1, 0xB47D, 0x78E2, 0xB47E, 0x78E3, 0xB480, 0x78E4, 0xB481, 0x78E5, 0xB482, 0x78E6, 0xB483, 0x78E7, + 0xB484, 0x78E9, 0xB485, 0x78EA, 0xB486, 0x78EB, 0xB487, 0x78ED, 0xB488, 0x78EE, 0xB489, 0x78EF, 0xB48A, 0x78F0, 0xB48B, 0x78F1, + 0xB48C, 0x78F3, 0xB48D, 0x78F5, 0xB48E, 0x78F6, 0xB48F, 0x78F8, 0xB490, 0x78F9, 0xB491, 0x78FB, 0xB492, 0x78FC, 0xB493, 0x78FD, + 0xB494, 0x78FE, 0xB495, 0x78FF, 0xB496, 0x7900, 0xB497, 0x7902, 0xB498, 0x7903, 0xB499, 0x7904, 0xB49A, 0x7906, 0xB49B, 0x7907, + 0xB49C, 0x7908, 0xB49D, 0x7909, 0xB49E, 0x790A, 0xB49F, 0x790B, 0xB4A0, 0x790C, 0xB4A1, 0x7840, 0xB4A2, 0x50A8, 0xB4A3, 0x77D7, + 0xB4A4, 0x6410, 0xB4A5, 0x89E6, 0xB4A6, 0x5904, 0xB4A7, 0x63E3, 0xB4A8, 0x5DDD, 0xB4A9, 0x7A7F, 0xB4AA, 0x693D, 0xB4AB, 0x4F20, + 0xB4AC, 0x8239, 0xB4AD, 0x5598, 0xB4AE, 0x4E32, 0xB4AF, 0x75AE, 0xB4B0, 0x7A97, 0xB4B1, 0x5E62, 0xB4B2, 0x5E8A, 0xB4B3, 0x95EF, + 0xB4B4, 0x521B, 0xB4B5, 0x5439, 0xB4B6, 0x708A, 0xB4B7, 0x6376, 0xB4B8, 0x9524, 0xB4B9, 0x5782, 0xB4BA, 0x6625, 0xB4BB, 0x693F, + 0xB4BC, 0x9187, 0xB4BD, 0x5507, 0xB4BE, 0x6DF3, 0xB4BF, 0x7EAF, 0xB4C0, 0x8822, 0xB4C1, 0x6233, 0xB4C2, 0x7EF0, 0xB4C3, 0x75B5, + 0xB4C4, 0x8328, 0xB4C5, 0x78C1, 0xB4C6, 0x96CC, 0xB4C7, 0x8F9E, 0xB4C8, 0x6148, 0xB4C9, 0x74F7, 0xB4CA, 0x8BCD, 0xB4CB, 0x6B64, + 0xB4CC, 0x523A, 0xB4CD, 0x8D50, 0xB4CE, 0x6B21, 0xB4CF, 0x806A, 0xB4D0, 0x8471, 0xB4D1, 0x56F1, 0xB4D2, 0x5306, 0xB4D3, 0x4ECE, + 0xB4D4, 0x4E1B, 0xB4D5, 0x51D1, 0xB4D6, 0x7C97, 0xB4D7, 0x918B, 0xB4D8, 0x7C07, 0xB4D9, 0x4FC3, 0xB4DA, 0x8E7F, 0xB4DB, 0x7BE1, + 0xB4DC, 0x7A9C, 0xB4DD, 0x6467, 0xB4DE, 0x5D14, 0xB4DF, 0x50AC, 0xB4E0, 0x8106, 0xB4E1, 0x7601, 0xB4E2, 0x7CB9, 0xB4E3, 0x6DEC, + 0xB4E4, 0x7FE0, 0xB4E5, 0x6751, 0xB4E6, 0x5B58, 0xB4E7, 0x5BF8, 0xB4E8, 0x78CB, 0xB4E9, 0x64AE, 0xB4EA, 0x6413, 0xB4EB, 0x63AA, + 0xB4EC, 0x632B, 0xB4ED, 0x9519, 0xB4EE, 0x642D, 0xB4EF, 0x8FBE, 0xB4F0, 0x7B54, 0xB4F1, 0x7629, 0xB4F2, 0x6253, 0xB4F3, 0x5927, + 0xB4F4, 0x5446, 0xB4F5, 0x6B79, 0xB4F6, 0x50A3, 0xB4F7, 0x6234, 0xB4F8, 0x5E26, 0xB4F9, 0x6B86, 0xB4FA, 0x4EE3, 0xB4FB, 0x8D37, + 0xB4FC, 0x888B, 0xB4FD, 0x5F85, 0xB4FE, 0x902E, 0xB540, 0x790D, 0xB541, 0x790E, 0xB542, 0x790F, 0xB543, 0x7910, 0xB544, 0x7911, + 0xB545, 0x7912, 0xB546, 0x7914, 0xB547, 0x7915, 0xB548, 0x7916, 0xB549, 0x7917, 0xB54A, 0x7918, 0xB54B, 0x7919, 0xB54C, 0x791A, + 0xB54D, 0x791B, 0xB54E, 0x791C, 0xB54F, 0x791D, 0xB550, 0x791F, 0xB551, 0x7920, 0xB552, 0x7921, 0xB553, 0x7922, 0xB554, 0x7923, + 0xB555, 0x7925, 0xB556, 0x7926, 0xB557, 0x7927, 0xB558, 0x7928, 0xB559, 0x7929, 0xB55A, 0x792A, 0xB55B, 0x792B, 0xB55C, 0x792C, + 0xB55D, 0x792D, 0xB55E, 0x792E, 0xB55F, 0x792F, 0xB560, 0x7930, 0xB561, 0x7931, 0xB562, 0x7932, 0xB563, 0x7933, 0xB564, 0x7935, + 0xB565, 0x7936, 0xB566, 0x7937, 0xB567, 0x7938, 0xB568, 0x7939, 0xB569, 0x793D, 0xB56A, 0x793F, 0xB56B, 0x7942, 0xB56C, 0x7943, + 0xB56D, 0x7944, 0xB56E, 0x7945, 0xB56F, 0x7947, 0xB570, 0x794A, 0xB571, 0x794B, 0xB572, 0x794C, 0xB573, 0x794D, 0xB574, 0x794E, + 0xB575, 0x794F, 0xB576, 0x7950, 0xB577, 0x7951, 0xB578, 0x7952, 0xB579, 0x7954, 0xB57A, 0x7955, 0xB57B, 0x7958, 0xB57C, 0x7959, + 0xB57D, 0x7961, 0xB57E, 0x7963, 0xB580, 0x7964, 0xB581, 0x7966, 0xB582, 0x7969, 0xB583, 0x796A, 0xB584, 0x796B, 0xB585, 0x796C, + 0xB586, 0x796E, 0xB587, 0x7970, 0xB588, 0x7971, 0xB589, 0x7972, 0xB58A, 0x7973, 0xB58B, 0x7974, 0xB58C, 0x7975, 0xB58D, 0x7976, + 0xB58E, 0x7979, 0xB58F, 0x797B, 0xB590, 0x797C, 0xB591, 0x797D, 0xB592, 0x797E, 0xB593, 0x797F, 0xB594, 0x7982, 0xB595, 0x7983, + 0xB596, 0x7986, 0xB597, 0x7987, 0xB598, 0x7988, 0xB599, 0x7989, 0xB59A, 0x798B, 0xB59B, 0x798C, 0xB59C, 0x798D, 0xB59D, 0x798E, + 0xB59E, 0x7990, 0xB59F, 0x7991, 0xB5A0, 0x7992, 0xB5A1, 0x6020, 0xB5A2, 0x803D, 0xB5A3, 0x62C5, 0xB5A4, 0x4E39, 0xB5A5, 0x5355, + 0xB5A6, 0x90F8, 0xB5A7, 0x63B8, 0xB5A8, 0x80C6, 0xB5A9, 0x65E6, 0xB5AA, 0x6C2E, 0xB5AB, 0x4F46, 0xB5AC, 0x60EE, 0xB5AD, 0x6DE1, + 0xB5AE, 0x8BDE, 0xB5AF, 0x5F39, 0xB5B0, 0x86CB, 0xB5B1, 0x5F53, 0xB5B2, 0x6321, 0xB5B3, 0x515A, 0xB5B4, 0x8361, 0xB5B5, 0x6863, + 0xB5B6, 0x5200, 0xB5B7, 0x6363, 0xB5B8, 0x8E48, 0xB5B9, 0x5012, 0xB5BA, 0x5C9B, 0xB5BB, 0x7977, 0xB5BC, 0x5BFC, 0xB5BD, 0x5230, + 0xB5BE, 0x7A3B, 0xB5BF, 0x60BC, 0xB5C0, 0x9053, 0xB5C1, 0x76D7, 0xB5C2, 0x5FB7, 0xB5C3, 0x5F97, 0xB5C4, 0x7684, 0xB5C5, 0x8E6C, + 0xB5C6, 0x706F, 0xB5C7, 0x767B, 0xB5C8, 0x7B49, 0xB5C9, 0x77AA, 0xB5CA, 0x51F3, 0xB5CB, 0x9093, 0xB5CC, 0x5824, 0xB5CD, 0x4F4E, + 0xB5CE, 0x6EF4, 0xB5CF, 0x8FEA, 0xB5D0, 0x654C, 0xB5D1, 0x7B1B, 0xB5D2, 0x72C4, 0xB5D3, 0x6DA4, 0xB5D4, 0x7FDF, 0xB5D5, 0x5AE1, + 0xB5D6, 0x62B5, 0xB5D7, 0x5E95, 0xB5D8, 0x5730, 0xB5D9, 0x8482, 0xB5DA, 0x7B2C, 0xB5DB, 0x5E1D, 0xB5DC, 0x5F1F, 0xB5DD, 0x9012, + 0xB5DE, 0x7F14, 0xB5DF, 0x98A0, 0xB5E0, 0x6382, 0xB5E1, 0x6EC7, 0xB5E2, 0x7898, 0xB5E3, 0x70B9, 0xB5E4, 0x5178, 0xB5E5, 0x975B, + 0xB5E6, 0x57AB, 0xB5E7, 0x7535, 0xB5E8, 0x4F43, 0xB5E9, 0x7538, 0xB5EA, 0x5E97, 0xB5EB, 0x60E6, 0xB5EC, 0x5960, 0xB5ED, 0x6DC0, + 0xB5EE, 0x6BBF, 0xB5EF, 0x7889, 0xB5F0, 0x53FC, 0xB5F1, 0x96D5, 0xB5F2, 0x51CB, 0xB5F3, 0x5201, 0xB5F4, 0x6389, 0xB5F5, 0x540A, + 0xB5F6, 0x9493, 0xB5F7, 0x8C03, 0xB5F8, 0x8DCC, 0xB5F9, 0x7239, 0xB5FA, 0x789F, 0xB5FB, 0x8776, 0xB5FC, 0x8FED, 0xB5FD, 0x8C0D, + 0xB5FE, 0x53E0, 0xB640, 0x7993, 0xB641, 0x7994, 0xB642, 0x7995, 0xB643, 0x7996, 0xB644, 0x7997, 0xB645, 0x7998, 0xB646, 0x7999, + 0xB647, 0x799B, 0xB648, 0x799C, 0xB649, 0x799D, 0xB64A, 0x799E, 0xB64B, 0x799F, 0xB64C, 0x79A0, 0xB64D, 0x79A1, 0xB64E, 0x79A2, + 0xB64F, 0x79A3, 0xB650, 0x79A4, 0xB651, 0x79A5, 0xB652, 0x79A6, 0xB653, 0x79A8, 0xB654, 0x79A9, 0xB655, 0x79AA, 0xB656, 0x79AB, + 0xB657, 0x79AC, 0xB658, 0x79AD, 0xB659, 0x79AE, 0xB65A, 0x79AF, 0xB65B, 0x79B0, 0xB65C, 0x79B1, 0xB65D, 0x79B2, 0xB65E, 0x79B4, + 0xB65F, 0x79B5, 0xB660, 0x79B6, 0xB661, 0x79B7, 0xB662, 0x79B8, 0xB663, 0x79BC, 0xB664, 0x79BF, 0xB665, 0x79C2, 0xB666, 0x79C4, + 0xB667, 0x79C5, 0xB668, 0x79C7, 0xB669, 0x79C8, 0xB66A, 0x79CA, 0xB66B, 0x79CC, 0xB66C, 0x79CE, 0xB66D, 0x79CF, 0xB66E, 0x79D0, + 0xB66F, 0x79D3, 0xB670, 0x79D4, 0xB671, 0x79D6, 0xB672, 0x79D7, 0xB673, 0x79D9, 0xB674, 0x79DA, 0xB675, 0x79DB, 0xB676, 0x79DC, + 0xB677, 0x79DD, 0xB678, 0x79DE, 0xB679, 0x79E0, 0xB67A, 0x79E1, 0xB67B, 0x79E2, 0xB67C, 0x79E5, 0xB67D, 0x79E8, 0xB67E, 0x79EA, + 0xB680, 0x79EC, 0xB681, 0x79EE, 0xB682, 0x79F1, 0xB683, 0x79F2, 0xB684, 0x79F3, 0xB685, 0x79F4, 0xB686, 0x79F5, 0xB687, 0x79F6, + 0xB688, 0x79F7, 0xB689, 0x79F9, 0xB68A, 0x79FA, 0xB68B, 0x79FC, 0xB68C, 0x79FE, 0xB68D, 0x79FF, 0xB68E, 0x7A01, 0xB68F, 0x7A04, + 0xB690, 0x7A05, 0xB691, 0x7A07, 0xB692, 0x7A08, 0xB693, 0x7A09, 0xB694, 0x7A0A, 0xB695, 0x7A0C, 0xB696, 0x7A0F, 0xB697, 0x7A10, + 0xB698, 0x7A11, 0xB699, 0x7A12, 0xB69A, 0x7A13, 0xB69B, 0x7A15, 0xB69C, 0x7A16, 0xB69D, 0x7A18, 0xB69E, 0x7A19, 0xB69F, 0x7A1B, + 0xB6A0, 0x7A1C, 0xB6A1, 0x4E01, 0xB6A2, 0x76EF, 0xB6A3, 0x53EE, 0xB6A4, 0x9489, 0xB6A5, 0x9876, 0xB6A6, 0x9F0E, 0xB6A7, 0x952D, + 0xB6A8, 0x5B9A, 0xB6A9, 0x8BA2, 0xB6AA, 0x4E22, 0xB6AB, 0x4E1C, 0xB6AC, 0x51AC, 0xB6AD, 0x8463, 0xB6AE, 0x61C2, 0xB6AF, 0x52A8, + 0xB6B0, 0x680B, 0xB6B1, 0x4F97, 0xB6B2, 0x606B, 0xB6B3, 0x51BB, 0xB6B4, 0x6D1E, 0xB6B5, 0x515C, 0xB6B6, 0x6296, 0xB6B7, 0x6597, + 0xB6B8, 0x9661, 0xB6B9, 0x8C46, 0xB6BA, 0x9017, 0xB6BB, 0x75D8, 0xB6BC, 0x90FD, 0xB6BD, 0x7763, 0xB6BE, 0x6BD2, 0xB6BF, 0x728A, + 0xB6C0, 0x72EC, 0xB6C1, 0x8BFB, 0xB6C2, 0x5835, 0xB6C3, 0x7779, 0xB6C4, 0x8D4C, 0xB6C5, 0x675C, 0xB6C6, 0x9540, 0xB6C7, 0x809A, + 0xB6C8, 0x5EA6, 0xB6C9, 0x6E21, 0xB6CA, 0x5992, 0xB6CB, 0x7AEF, 0xB6CC, 0x77ED, 0xB6CD, 0x953B, 0xB6CE, 0x6BB5, 0xB6CF, 0x65AD, + 0xB6D0, 0x7F0E, 0xB6D1, 0x5806, 0xB6D2, 0x5151, 0xB6D3, 0x961F, 0xB6D4, 0x5BF9, 0xB6D5, 0x58A9, 0xB6D6, 0x5428, 0xB6D7, 0x8E72, + 0xB6D8, 0x6566, 0xB6D9, 0x987F, 0xB6DA, 0x56E4, 0xB6DB, 0x949D, 0xB6DC, 0x76FE, 0xB6DD, 0x9041, 0xB6DE, 0x6387, 0xB6DF, 0x54C6, + 0xB6E0, 0x591A, 0xB6E1, 0x593A, 0xB6E2, 0x579B, 0xB6E3, 0x8EB2, 0xB6E4, 0x6735, 0xB6E5, 0x8DFA, 0xB6E6, 0x8235, 0xB6E7, 0x5241, + 0xB6E8, 0x60F0, 0xB6E9, 0x5815, 0xB6EA, 0x86FE, 0xB6EB, 0x5CE8, 0xB6EC, 0x9E45, 0xB6ED, 0x4FC4, 0xB6EE, 0x989D, 0xB6EF, 0x8BB9, + 0xB6F0, 0x5A25, 0xB6F1, 0x6076, 0xB6F2, 0x5384, 0xB6F3, 0x627C, 0xB6F4, 0x904F, 0xB6F5, 0x9102, 0xB6F6, 0x997F, 0xB6F7, 0x6069, + 0xB6F8, 0x800C, 0xB6F9, 0x513F, 0xB6FA, 0x8033, 0xB6FB, 0x5C14, 0xB6FC, 0x9975, 0xB6FD, 0x6D31, 0xB6FE, 0x4E8C, 0xB740, 0x7A1D, + 0xB741, 0x7A1F, 0xB742, 0x7A21, 0xB743, 0x7A22, 0xB744, 0x7A24, 0xB745, 0x7A25, 0xB746, 0x7A26, 0xB747, 0x7A27, 0xB748, 0x7A28, + 0xB749, 0x7A29, 0xB74A, 0x7A2A, 0xB74B, 0x7A2B, 0xB74C, 0x7A2C, 0xB74D, 0x7A2D, 0xB74E, 0x7A2E, 0xB74F, 0x7A2F, 0xB750, 0x7A30, + 0xB751, 0x7A31, 0xB752, 0x7A32, 0xB753, 0x7A34, 0xB754, 0x7A35, 0xB755, 0x7A36, 0xB756, 0x7A38, 0xB757, 0x7A3A, 0xB758, 0x7A3E, + 0xB759, 0x7A40, 0xB75A, 0x7A41, 0xB75B, 0x7A42, 0xB75C, 0x7A43, 0xB75D, 0x7A44, 0xB75E, 0x7A45, 0xB75F, 0x7A47, 0xB760, 0x7A48, + 0xB761, 0x7A49, 0xB762, 0x7A4A, 0xB763, 0x7A4B, 0xB764, 0x7A4C, 0xB765, 0x7A4D, 0xB766, 0x7A4E, 0xB767, 0x7A4F, 0xB768, 0x7A50, + 0xB769, 0x7A52, 0xB76A, 0x7A53, 0xB76B, 0x7A54, 0xB76C, 0x7A55, 0xB76D, 0x7A56, 0xB76E, 0x7A58, 0xB76F, 0x7A59, 0xB770, 0x7A5A, + 0xB771, 0x7A5B, 0xB772, 0x7A5C, 0xB773, 0x7A5D, 0xB774, 0x7A5E, 0xB775, 0x7A5F, 0xB776, 0x7A60, 0xB777, 0x7A61, 0xB778, 0x7A62, + 0xB779, 0x7A63, 0xB77A, 0x7A64, 0xB77B, 0x7A65, 0xB77C, 0x7A66, 0xB77D, 0x7A67, 0xB77E, 0x7A68, 0xB780, 0x7A69, 0xB781, 0x7A6A, + 0xB782, 0x7A6B, 0xB783, 0x7A6C, 0xB784, 0x7A6D, 0xB785, 0x7A6E, 0xB786, 0x7A6F, 0xB787, 0x7A71, 0xB788, 0x7A72, 0xB789, 0x7A73, + 0xB78A, 0x7A75, 0xB78B, 0x7A7B, 0xB78C, 0x7A7C, 0xB78D, 0x7A7D, 0xB78E, 0x7A7E, 0xB78F, 0x7A82, 0xB790, 0x7A85, 0xB791, 0x7A87, + 0xB792, 0x7A89, 0xB793, 0x7A8A, 0xB794, 0x7A8B, 0xB795, 0x7A8C, 0xB796, 0x7A8E, 0xB797, 0x7A8F, 0xB798, 0x7A90, 0xB799, 0x7A93, + 0xB79A, 0x7A94, 0xB79B, 0x7A99, 0xB79C, 0x7A9A, 0xB79D, 0x7A9B, 0xB79E, 0x7A9E, 0xB79F, 0x7AA1, 0xB7A0, 0x7AA2, 0xB7A1, 0x8D30, + 0xB7A2, 0x53D1, 0xB7A3, 0x7F5A, 0xB7A4, 0x7B4F, 0xB7A5, 0x4F10, 0xB7A6, 0x4E4F, 0xB7A7, 0x9600, 0xB7A8, 0x6CD5, 0xB7A9, 0x73D0, + 0xB7AA, 0x85E9, 0xB7AB, 0x5E06, 0xB7AC, 0x756A, 0xB7AD, 0x7FFB, 0xB7AE, 0x6A0A, 0xB7AF, 0x77FE, 0xB7B0, 0x9492, 0xB7B1, 0x7E41, + 0xB7B2, 0x51E1, 0xB7B3, 0x70E6, 0xB7B4, 0x53CD, 0xB7B5, 0x8FD4, 0xB7B6, 0x8303, 0xB7B7, 0x8D29, 0xB7B8, 0x72AF, 0xB7B9, 0x996D, + 0xB7BA, 0x6CDB, 0xB7BB, 0x574A, 0xB7BC, 0x82B3, 0xB7BD, 0x65B9, 0xB7BE, 0x80AA, 0xB7BF, 0x623F, 0xB7C0, 0x9632, 0xB7C1, 0x59A8, + 0xB7C2, 0x4EFF, 0xB7C3, 0x8BBF, 0xB7C4, 0x7EBA, 0xB7C5, 0x653E, 0xB7C6, 0x83F2, 0xB7C7, 0x975E, 0xB7C8, 0x5561, 0xB7C9, 0x98DE, + 0xB7CA, 0x80A5, 0xB7CB, 0x532A, 0xB7CC, 0x8BFD, 0xB7CD, 0x5420, 0xB7CE, 0x80BA, 0xB7CF, 0x5E9F, 0xB7D0, 0x6CB8, 0xB7D1, 0x8D39, + 0xB7D2, 0x82AC, 0xB7D3, 0x915A, 0xB7D4, 0x5429, 0xB7D5, 0x6C1B, 0xB7D6, 0x5206, 0xB7D7, 0x7EB7, 0xB7D8, 0x575F, 0xB7D9, 0x711A, + 0xB7DA, 0x6C7E, 0xB7DB, 0x7C89, 0xB7DC, 0x594B, 0xB7DD, 0x4EFD, 0xB7DE, 0x5FFF, 0xB7DF, 0x6124, 0xB7E0, 0x7CAA, 0xB7E1, 0x4E30, + 0xB7E2, 0x5C01, 0xB7E3, 0x67AB, 0xB7E4, 0x8702, 0xB7E5, 0x5CF0, 0xB7E6, 0x950B, 0xB7E7, 0x98CE, 0xB7E8, 0x75AF, 0xB7E9, 0x70FD, + 0xB7EA, 0x9022, 0xB7EB, 0x51AF, 0xB7EC, 0x7F1D, 0xB7ED, 0x8BBD, 0xB7EE, 0x5949, 0xB7EF, 0x51E4, 0xB7F0, 0x4F5B, 0xB7F1, 0x5426, + 0xB7F2, 0x592B, 0xB7F3, 0x6577, 0xB7F4, 0x80A4, 0xB7F5, 0x5B75, 0xB7F6, 0x6276, 0xB7F7, 0x62C2, 0xB7F8, 0x8F90, 0xB7F9, 0x5E45, + 0xB7FA, 0x6C1F, 0xB7FB, 0x7B26, 0xB7FC, 0x4F0F, 0xB7FD, 0x4FD8, 0xB7FE, 0x670D, 0xB840, 0x7AA3, 0xB841, 0x7AA4, 0xB842, 0x7AA7, + 0xB843, 0x7AA9, 0xB844, 0x7AAA, 0xB845, 0x7AAB, 0xB846, 0x7AAE, 0xB847, 0x7AAF, 0xB848, 0x7AB0, 0xB849, 0x7AB1, 0xB84A, 0x7AB2, + 0xB84B, 0x7AB4, 0xB84C, 0x7AB5, 0xB84D, 0x7AB6, 0xB84E, 0x7AB7, 0xB84F, 0x7AB8, 0xB850, 0x7AB9, 0xB851, 0x7ABA, 0xB852, 0x7ABB, + 0xB853, 0x7ABC, 0xB854, 0x7ABD, 0xB855, 0x7ABE, 0xB856, 0x7AC0, 0xB857, 0x7AC1, 0xB858, 0x7AC2, 0xB859, 0x7AC3, 0xB85A, 0x7AC4, + 0xB85B, 0x7AC5, 0xB85C, 0x7AC6, 0xB85D, 0x7AC7, 0xB85E, 0x7AC8, 0xB85F, 0x7AC9, 0xB860, 0x7ACA, 0xB861, 0x7ACC, 0xB862, 0x7ACD, + 0xB863, 0x7ACE, 0xB864, 0x7ACF, 0xB865, 0x7AD0, 0xB866, 0x7AD1, 0xB867, 0x7AD2, 0xB868, 0x7AD3, 0xB869, 0x7AD4, 0xB86A, 0x7AD5, + 0xB86B, 0x7AD7, 0xB86C, 0x7AD8, 0xB86D, 0x7ADA, 0xB86E, 0x7ADB, 0xB86F, 0x7ADC, 0xB870, 0x7ADD, 0xB871, 0x7AE1, 0xB872, 0x7AE2, + 0xB873, 0x7AE4, 0xB874, 0x7AE7, 0xB875, 0x7AE8, 0xB876, 0x7AE9, 0xB877, 0x7AEA, 0xB878, 0x7AEB, 0xB879, 0x7AEC, 0xB87A, 0x7AEE, + 0xB87B, 0x7AF0, 0xB87C, 0x7AF1, 0xB87D, 0x7AF2, 0xB87E, 0x7AF3, 0xB880, 0x7AF4, 0xB881, 0x7AF5, 0xB882, 0x7AF6, 0xB883, 0x7AF7, + 0xB884, 0x7AF8, 0xB885, 0x7AFB, 0xB886, 0x7AFC, 0xB887, 0x7AFE, 0xB888, 0x7B00, 0xB889, 0x7B01, 0xB88A, 0x7B02, 0xB88B, 0x7B05, + 0xB88C, 0x7B07, 0xB88D, 0x7B09, 0xB88E, 0x7B0C, 0xB88F, 0x7B0D, 0xB890, 0x7B0E, 0xB891, 0x7B10, 0xB892, 0x7B12, 0xB893, 0x7B13, + 0xB894, 0x7B16, 0xB895, 0x7B17, 0xB896, 0x7B18, 0xB897, 0x7B1A, 0xB898, 0x7B1C, 0xB899, 0x7B1D, 0xB89A, 0x7B1F, 0xB89B, 0x7B21, + 0xB89C, 0x7B22, 0xB89D, 0x7B23, 0xB89E, 0x7B27, 0xB89F, 0x7B29, 0xB8A0, 0x7B2D, 0xB8A1, 0x6D6E, 0xB8A2, 0x6DAA, 0xB8A3, 0x798F, + 0xB8A4, 0x88B1, 0xB8A5, 0x5F17, 0xB8A6, 0x752B, 0xB8A7, 0x629A, 0xB8A8, 0x8F85, 0xB8A9, 0x4FEF, 0xB8AA, 0x91DC, 0xB8AB, 0x65A7, + 0xB8AC, 0x812F, 0xB8AD, 0x8151, 0xB8AE, 0x5E9C, 0xB8AF, 0x8150, 0xB8B0, 0x8D74, 0xB8B1, 0x526F, 0xB8B2, 0x8986, 0xB8B3, 0x8D4B, + 0xB8B4, 0x590D, 0xB8B5, 0x5085, 0xB8B6, 0x4ED8, 0xB8B7, 0x961C, 0xB8B8, 0x7236, 0xB8B9, 0x8179, 0xB8BA, 0x8D1F, 0xB8BB, 0x5BCC, + 0xB8BC, 0x8BA3, 0xB8BD, 0x9644, 0xB8BE, 0x5987, 0xB8BF, 0x7F1A, 0xB8C0, 0x5490, 0xB8C1, 0x5676, 0xB8C2, 0x560E, 0xB8C3, 0x8BE5, + 0xB8C4, 0x6539, 0xB8C5, 0x6982, 0xB8C6, 0x9499, 0xB8C7, 0x76D6, 0xB8C8, 0x6E89, 0xB8C9, 0x5E72, 0xB8CA, 0x7518, 0xB8CB, 0x6746, + 0xB8CC, 0x67D1, 0xB8CD, 0x7AFF, 0xB8CE, 0x809D, 0xB8CF, 0x8D76, 0xB8D0, 0x611F, 0xB8D1, 0x79C6, 0xB8D2, 0x6562, 0xB8D3, 0x8D63, + 0xB8D4, 0x5188, 0xB8D5, 0x521A, 0xB8D6, 0x94A2, 0xB8D7, 0x7F38, 0xB8D8, 0x809B, 0xB8D9, 0x7EB2, 0xB8DA, 0x5C97, 0xB8DB, 0x6E2F, + 0xB8DC, 0x6760, 0xB8DD, 0x7BD9, 0xB8DE, 0x768B, 0xB8DF, 0x9AD8, 0xB8E0, 0x818F, 0xB8E1, 0x7F94, 0xB8E2, 0x7CD5, 0xB8E3, 0x641E, + 0xB8E4, 0x9550, 0xB8E5, 0x7A3F, 0xB8E6, 0x544A, 0xB8E7, 0x54E5, 0xB8E8, 0x6B4C, 0xB8E9, 0x6401, 0xB8EA, 0x6208, 0xB8EB, 0x9E3D, + 0xB8EC, 0x80F3, 0xB8ED, 0x7599, 0xB8EE, 0x5272, 0xB8EF, 0x9769, 0xB8F0, 0x845B, 0xB8F1, 0x683C, 0xB8F2, 0x86E4, 0xB8F3, 0x9601, + 0xB8F4, 0x9694, 0xB8F5, 0x94EC, 0xB8F6, 0x4E2A, 0xB8F7, 0x5404, 0xB8F8, 0x7ED9, 0xB8F9, 0x6839, 0xB8FA, 0x8DDF, 0xB8FB, 0x8015, + 0xB8FC, 0x66F4, 0xB8FD, 0x5E9A, 0xB8FE, 0x7FB9, 0xB940, 0x7B2F, 0xB941, 0x7B30, 0xB942, 0x7B32, 0xB943, 0x7B34, 0xB944, 0x7B35, + 0xB945, 0x7B36, 0xB946, 0x7B37, 0xB947, 0x7B39, 0xB948, 0x7B3B, 0xB949, 0x7B3D, 0xB94A, 0x7B3F, 0xB94B, 0x7B40, 0xB94C, 0x7B41, + 0xB94D, 0x7B42, 0xB94E, 0x7B43, 0xB94F, 0x7B44, 0xB950, 0x7B46, 0xB951, 0x7B48, 0xB952, 0x7B4A, 0xB953, 0x7B4D, 0xB954, 0x7B4E, + 0xB955, 0x7B53, 0xB956, 0x7B55, 0xB957, 0x7B57, 0xB958, 0x7B59, 0xB959, 0x7B5C, 0xB95A, 0x7B5E, 0xB95B, 0x7B5F, 0xB95C, 0x7B61, + 0xB95D, 0x7B63, 0xB95E, 0x7B64, 0xB95F, 0x7B65, 0xB960, 0x7B66, 0xB961, 0x7B67, 0xB962, 0x7B68, 0xB963, 0x7B69, 0xB964, 0x7B6A, + 0xB965, 0x7B6B, 0xB966, 0x7B6C, 0xB967, 0x7B6D, 0xB968, 0x7B6F, 0xB969, 0x7B70, 0xB96A, 0x7B73, 0xB96B, 0x7B74, 0xB96C, 0x7B76, + 0xB96D, 0x7B78, 0xB96E, 0x7B7A, 0xB96F, 0x7B7C, 0xB970, 0x7B7D, 0xB971, 0x7B7F, 0xB972, 0x7B81, 0xB973, 0x7B82, 0xB974, 0x7B83, + 0xB975, 0x7B84, 0xB976, 0x7B86, 0xB977, 0x7B87, 0xB978, 0x7B88, 0xB979, 0x7B89, 0xB97A, 0x7B8A, 0xB97B, 0x7B8B, 0xB97C, 0x7B8C, + 0xB97D, 0x7B8E, 0xB97E, 0x7B8F, 0xB980, 0x7B91, 0xB981, 0x7B92, 0xB982, 0x7B93, 0xB983, 0x7B96, 0xB984, 0x7B98, 0xB985, 0x7B99, + 0xB986, 0x7B9A, 0xB987, 0x7B9B, 0xB988, 0x7B9E, 0xB989, 0x7B9F, 0xB98A, 0x7BA0, 0xB98B, 0x7BA3, 0xB98C, 0x7BA4, 0xB98D, 0x7BA5, + 0xB98E, 0x7BAE, 0xB98F, 0x7BAF, 0xB990, 0x7BB0, 0xB991, 0x7BB2, 0xB992, 0x7BB3, 0xB993, 0x7BB5, 0xB994, 0x7BB6, 0xB995, 0x7BB7, + 0xB996, 0x7BB9, 0xB997, 0x7BBA, 0xB998, 0x7BBB, 0xB999, 0x7BBC, 0xB99A, 0x7BBD, 0xB99B, 0x7BBE, 0xB99C, 0x7BBF, 0xB99D, 0x7BC0, + 0xB99E, 0x7BC2, 0xB99F, 0x7BC3, 0xB9A0, 0x7BC4, 0xB9A1, 0x57C2, 0xB9A2, 0x803F, 0xB9A3, 0x6897, 0xB9A4, 0x5DE5, 0xB9A5, 0x653B, + 0xB9A6, 0x529F, 0xB9A7, 0x606D, 0xB9A8, 0x9F9A, 0xB9A9, 0x4F9B, 0xB9AA, 0x8EAC, 0xB9AB, 0x516C, 0xB9AC, 0x5BAB, 0xB9AD, 0x5F13, + 0xB9AE, 0x5DE9, 0xB9AF, 0x6C5E, 0xB9B0, 0x62F1, 0xB9B1, 0x8D21, 0xB9B2, 0x5171, 0xB9B3, 0x94A9, 0xB9B4, 0x52FE, 0xB9B5, 0x6C9F, + 0xB9B6, 0x82DF, 0xB9B7, 0x72D7, 0xB9B8, 0x57A2, 0xB9B9, 0x6784, 0xB9BA, 0x8D2D, 0xB9BB, 0x591F, 0xB9BC, 0x8F9C, 0xB9BD, 0x83C7, + 0xB9BE, 0x5495, 0xB9BF, 0x7B8D, 0xB9C0, 0x4F30, 0xB9C1, 0x6CBD, 0xB9C2, 0x5B64, 0xB9C3, 0x59D1, 0xB9C4, 0x9F13, 0xB9C5, 0x53E4, + 0xB9C6, 0x86CA, 0xB9C7, 0x9AA8, 0xB9C8, 0x8C37, 0xB9C9, 0x80A1, 0xB9CA, 0x6545, 0xB9CB, 0x987E, 0xB9CC, 0x56FA, 0xB9CD, 0x96C7, + 0xB9CE, 0x522E, 0xB9CF, 0x74DC, 0xB9D0, 0x5250, 0xB9D1, 0x5BE1, 0xB9D2, 0x6302, 0xB9D3, 0x8902, 0xB9D4, 0x4E56, 0xB9D5, 0x62D0, + 0xB9D6, 0x602A, 0xB9D7, 0x68FA, 0xB9D8, 0x5173, 0xB9D9, 0x5B98, 0xB9DA, 0x51A0, 0xB9DB, 0x89C2, 0xB9DC, 0x7BA1, 0xB9DD, 0x9986, + 0xB9DE, 0x7F50, 0xB9DF, 0x60EF, 0xB9E0, 0x704C, 0xB9E1, 0x8D2F, 0xB9E2, 0x5149, 0xB9E3, 0x5E7F, 0xB9E4, 0x901B, 0xB9E5, 0x7470, + 0xB9E6, 0x89C4, 0xB9E7, 0x572D, 0xB9E8, 0x7845, 0xB9E9, 0x5F52, 0xB9EA, 0x9F9F, 0xB9EB, 0x95FA, 0xB9EC, 0x8F68, 0xB9ED, 0x9B3C, + 0xB9EE, 0x8BE1, 0xB9EF, 0x7678, 0xB9F0, 0x6842, 0xB9F1, 0x67DC, 0xB9F2, 0x8DEA, 0xB9F3, 0x8D35, 0xB9F4, 0x523D, 0xB9F5, 0x8F8A, + 0xB9F6, 0x6EDA, 0xB9F7, 0x68CD, 0xB9F8, 0x9505, 0xB9F9, 0x90ED, 0xB9FA, 0x56FD, 0xB9FB, 0x679C, 0xB9FC, 0x88F9, 0xB9FD, 0x8FC7, + 0xB9FE, 0x54C8, 0xBA40, 0x7BC5, 0xBA41, 0x7BC8, 0xBA42, 0x7BC9, 0xBA43, 0x7BCA, 0xBA44, 0x7BCB, 0xBA45, 0x7BCD, 0xBA46, 0x7BCE, + 0xBA47, 0x7BCF, 0xBA48, 0x7BD0, 0xBA49, 0x7BD2, 0xBA4A, 0x7BD4, 0xBA4B, 0x7BD5, 0xBA4C, 0x7BD6, 0xBA4D, 0x7BD7, 0xBA4E, 0x7BD8, + 0xBA4F, 0x7BDB, 0xBA50, 0x7BDC, 0xBA51, 0x7BDE, 0xBA52, 0x7BDF, 0xBA53, 0x7BE0, 0xBA54, 0x7BE2, 0xBA55, 0x7BE3, 0xBA56, 0x7BE4, + 0xBA57, 0x7BE7, 0xBA58, 0x7BE8, 0xBA59, 0x7BE9, 0xBA5A, 0x7BEB, 0xBA5B, 0x7BEC, 0xBA5C, 0x7BED, 0xBA5D, 0x7BEF, 0xBA5E, 0x7BF0, + 0xBA5F, 0x7BF2, 0xBA60, 0x7BF3, 0xBA61, 0x7BF4, 0xBA62, 0x7BF5, 0xBA63, 0x7BF6, 0xBA64, 0x7BF8, 0xBA65, 0x7BF9, 0xBA66, 0x7BFA, + 0xBA67, 0x7BFB, 0xBA68, 0x7BFD, 0xBA69, 0x7BFF, 0xBA6A, 0x7C00, 0xBA6B, 0x7C01, 0xBA6C, 0x7C02, 0xBA6D, 0x7C03, 0xBA6E, 0x7C04, + 0xBA6F, 0x7C05, 0xBA70, 0x7C06, 0xBA71, 0x7C08, 0xBA72, 0x7C09, 0xBA73, 0x7C0A, 0xBA74, 0x7C0D, 0xBA75, 0x7C0E, 0xBA76, 0x7C10, + 0xBA77, 0x7C11, 0xBA78, 0x7C12, 0xBA79, 0x7C13, 0xBA7A, 0x7C14, 0xBA7B, 0x7C15, 0xBA7C, 0x7C17, 0xBA7D, 0x7C18, 0xBA7E, 0x7C19, + 0xBA80, 0x7C1A, 0xBA81, 0x7C1B, 0xBA82, 0x7C1C, 0xBA83, 0x7C1D, 0xBA84, 0x7C1E, 0xBA85, 0x7C20, 0xBA86, 0x7C21, 0xBA87, 0x7C22, + 0xBA88, 0x7C23, 0xBA89, 0x7C24, 0xBA8A, 0x7C25, 0xBA8B, 0x7C28, 0xBA8C, 0x7C29, 0xBA8D, 0x7C2B, 0xBA8E, 0x7C2C, 0xBA8F, 0x7C2D, + 0xBA90, 0x7C2E, 0xBA91, 0x7C2F, 0xBA92, 0x7C30, 0xBA93, 0x7C31, 0xBA94, 0x7C32, 0xBA95, 0x7C33, 0xBA96, 0x7C34, 0xBA97, 0x7C35, + 0xBA98, 0x7C36, 0xBA99, 0x7C37, 0xBA9A, 0x7C39, 0xBA9B, 0x7C3A, 0xBA9C, 0x7C3B, 0xBA9D, 0x7C3C, 0xBA9E, 0x7C3D, 0xBA9F, 0x7C3E, + 0xBAA0, 0x7C42, 0xBAA1, 0x9AB8, 0xBAA2, 0x5B69, 0xBAA3, 0x6D77, 0xBAA4, 0x6C26, 0xBAA5, 0x4EA5, 0xBAA6, 0x5BB3, 0xBAA7, 0x9A87, + 0xBAA8, 0x9163, 0xBAA9, 0x61A8, 0xBAAA, 0x90AF, 0xBAAB, 0x97E9, 0xBAAC, 0x542B, 0xBAAD, 0x6DB5, 0xBAAE, 0x5BD2, 0xBAAF, 0x51FD, + 0xBAB0, 0x558A, 0xBAB1, 0x7F55, 0xBAB2, 0x7FF0, 0xBAB3, 0x64BC, 0xBAB4, 0x634D, 0xBAB5, 0x65F1, 0xBAB6, 0x61BE, 0xBAB7, 0x608D, + 0xBAB8, 0x710A, 0xBAB9, 0x6C57, 0xBABA, 0x6C49, 0xBABB, 0x592F, 0xBABC, 0x676D, 0xBABD, 0x822A, 0xBABE, 0x58D5, 0xBABF, 0x568E, + 0xBAC0, 0x8C6A, 0xBAC1, 0x6BEB, 0xBAC2, 0x90DD, 0xBAC3, 0x597D, 0xBAC4, 0x8017, 0xBAC5, 0x53F7, 0xBAC6, 0x6D69, 0xBAC7, 0x5475, + 0xBAC8, 0x559D, 0xBAC9, 0x8377, 0xBACA, 0x83CF, 0xBACB, 0x6838, 0xBACC, 0x79BE, 0xBACD, 0x548C, 0xBACE, 0x4F55, 0xBACF, 0x5408, + 0xBAD0, 0x76D2, 0xBAD1, 0x8C89, 0xBAD2, 0x9602, 0xBAD3, 0x6CB3, 0xBAD4, 0x6DB8, 0xBAD5, 0x8D6B, 0xBAD6, 0x8910, 0xBAD7, 0x9E64, + 0xBAD8, 0x8D3A, 0xBAD9, 0x563F, 0xBADA, 0x9ED1, 0xBADB, 0x75D5, 0xBADC, 0x5F88, 0xBADD, 0x72E0, 0xBADE, 0x6068, 0xBADF, 0x54FC, + 0xBAE0, 0x4EA8, 0xBAE1, 0x6A2A, 0xBAE2, 0x8861, 0xBAE3, 0x6052, 0xBAE4, 0x8F70, 0xBAE5, 0x54C4, 0xBAE6, 0x70D8, 0xBAE7, 0x8679, + 0xBAE8, 0x9E3F, 0xBAE9, 0x6D2A, 0xBAEA, 0x5B8F, 0xBAEB, 0x5F18, 0xBAEC, 0x7EA2, 0xBAED, 0x5589, 0xBAEE, 0x4FAF, 0xBAEF, 0x7334, + 0xBAF0, 0x543C, 0xBAF1, 0x539A, 0xBAF2, 0x5019, 0xBAF3, 0x540E, 0xBAF4, 0x547C, 0xBAF5, 0x4E4E, 0xBAF6, 0x5FFD, 0xBAF7, 0x745A, + 0xBAF8, 0x58F6, 0xBAF9, 0x846B, 0xBAFA, 0x80E1, 0xBAFB, 0x8774, 0xBAFC, 0x72D0, 0xBAFD, 0x7CCA, 0xBAFE, 0x6E56, 0xBB40, 0x7C43, + 0xBB41, 0x7C44, 0xBB42, 0x7C45, 0xBB43, 0x7C46, 0xBB44, 0x7C47, 0xBB45, 0x7C48, 0xBB46, 0x7C49, 0xBB47, 0x7C4A, 0xBB48, 0x7C4B, + 0xBB49, 0x7C4C, 0xBB4A, 0x7C4E, 0xBB4B, 0x7C4F, 0xBB4C, 0x7C50, 0xBB4D, 0x7C51, 0xBB4E, 0x7C52, 0xBB4F, 0x7C53, 0xBB50, 0x7C54, + 0xBB51, 0x7C55, 0xBB52, 0x7C56, 0xBB53, 0x7C57, 0xBB54, 0x7C58, 0xBB55, 0x7C59, 0xBB56, 0x7C5A, 0xBB57, 0x7C5B, 0xBB58, 0x7C5C, + 0xBB59, 0x7C5D, 0xBB5A, 0x7C5E, 0xBB5B, 0x7C5F, 0xBB5C, 0x7C60, 0xBB5D, 0x7C61, 0xBB5E, 0x7C62, 0xBB5F, 0x7C63, 0xBB60, 0x7C64, + 0xBB61, 0x7C65, 0xBB62, 0x7C66, 0xBB63, 0x7C67, 0xBB64, 0x7C68, 0xBB65, 0x7C69, 0xBB66, 0x7C6A, 0xBB67, 0x7C6B, 0xBB68, 0x7C6C, + 0xBB69, 0x7C6D, 0xBB6A, 0x7C6E, 0xBB6B, 0x7C6F, 0xBB6C, 0x7C70, 0xBB6D, 0x7C71, 0xBB6E, 0x7C72, 0xBB6F, 0x7C75, 0xBB70, 0x7C76, + 0xBB71, 0x7C77, 0xBB72, 0x7C78, 0xBB73, 0x7C79, 0xBB74, 0x7C7A, 0xBB75, 0x7C7E, 0xBB76, 0x7C7F, 0xBB77, 0x7C80, 0xBB78, 0x7C81, + 0xBB79, 0x7C82, 0xBB7A, 0x7C83, 0xBB7B, 0x7C84, 0xBB7C, 0x7C85, 0xBB7D, 0x7C86, 0xBB7E, 0x7C87, 0xBB80, 0x7C88, 0xBB81, 0x7C8A, + 0xBB82, 0x7C8B, 0xBB83, 0x7C8C, 0xBB84, 0x7C8D, 0xBB85, 0x7C8E, 0xBB86, 0x7C8F, 0xBB87, 0x7C90, 0xBB88, 0x7C93, 0xBB89, 0x7C94, + 0xBB8A, 0x7C96, 0xBB8B, 0x7C99, 0xBB8C, 0x7C9A, 0xBB8D, 0x7C9B, 0xBB8E, 0x7CA0, 0xBB8F, 0x7CA1, 0xBB90, 0x7CA3, 0xBB91, 0x7CA6, + 0xBB92, 0x7CA7, 0xBB93, 0x7CA8, 0xBB94, 0x7CA9, 0xBB95, 0x7CAB, 0xBB96, 0x7CAC, 0xBB97, 0x7CAD, 0xBB98, 0x7CAF, 0xBB99, 0x7CB0, + 0xBB9A, 0x7CB4, 0xBB9B, 0x7CB5, 0xBB9C, 0x7CB6, 0xBB9D, 0x7CB7, 0xBB9E, 0x7CB8, 0xBB9F, 0x7CBA, 0xBBA0, 0x7CBB, 0xBBA1, 0x5F27, + 0xBBA2, 0x864E, 0xBBA3, 0x552C, 0xBBA4, 0x62A4, 0xBBA5, 0x4E92, 0xBBA6, 0x6CAA, 0xBBA7, 0x6237, 0xBBA8, 0x82B1, 0xBBA9, 0x54D7, + 0xBBAA, 0x534E, 0xBBAB, 0x733E, 0xBBAC, 0x6ED1, 0xBBAD, 0x753B, 0xBBAE, 0x5212, 0xBBAF, 0x5316, 0xBBB0, 0x8BDD, 0xBBB1, 0x69D0, + 0xBBB2, 0x5F8A, 0xBBB3, 0x6000, 0xBBB4, 0x6DEE, 0xBBB5, 0x574F, 0xBBB6, 0x6B22, 0xBBB7, 0x73AF, 0xBBB8, 0x6853, 0xBBB9, 0x8FD8, + 0xBBBA, 0x7F13, 0xBBBB, 0x6362, 0xBBBC, 0x60A3, 0xBBBD, 0x5524, 0xBBBE, 0x75EA, 0xBBBF, 0x8C62, 0xBBC0, 0x7115, 0xBBC1, 0x6DA3, + 0xBBC2, 0x5BA6, 0xBBC3, 0x5E7B, 0xBBC4, 0x8352, 0xBBC5, 0x614C, 0xBBC6, 0x9EC4, 0xBBC7, 0x78FA, 0xBBC8, 0x8757, 0xBBC9, 0x7C27, + 0xBBCA, 0x7687, 0xBBCB, 0x51F0, 0xBBCC, 0x60F6, 0xBBCD, 0x714C, 0xBBCE, 0x6643, 0xBBCF, 0x5E4C, 0xBBD0, 0x604D, 0xBBD1, 0x8C0E, + 0xBBD2, 0x7070, 0xBBD3, 0x6325, 0xBBD4, 0x8F89, 0xBBD5, 0x5FBD, 0xBBD6, 0x6062, 0xBBD7, 0x86D4, 0xBBD8, 0x56DE, 0xBBD9, 0x6BC1, + 0xBBDA, 0x6094, 0xBBDB, 0x6167, 0xBBDC, 0x5349, 0xBBDD, 0x60E0, 0xBBDE, 0x6666, 0xBBDF, 0x8D3F, 0xBBE0, 0x79FD, 0xBBE1, 0x4F1A, + 0xBBE2, 0x70E9, 0xBBE3, 0x6C47, 0xBBE4, 0x8BB3, 0xBBE5, 0x8BF2, 0xBBE6, 0x7ED8, 0xBBE7, 0x8364, 0xBBE8, 0x660F, 0xBBE9, 0x5A5A, + 0xBBEA, 0x9B42, 0xBBEB, 0x6D51, 0xBBEC, 0x6DF7, 0xBBED, 0x8C41, 0xBBEE, 0x6D3B, 0xBBEF, 0x4F19, 0xBBF0, 0x706B, 0xBBF1, 0x83B7, + 0xBBF2, 0x6216, 0xBBF3, 0x60D1, 0xBBF4, 0x970D, 0xBBF5, 0x8D27, 0xBBF6, 0x7978, 0xBBF7, 0x51FB, 0xBBF8, 0x573E, 0xBBF9, 0x57FA, + 0xBBFA, 0x673A, 0xBBFB, 0x7578, 0xBBFC, 0x7A3D, 0xBBFD, 0x79EF, 0xBBFE, 0x7B95, 0xBC40, 0x7CBF, 0xBC41, 0x7CC0, 0xBC42, 0x7CC2, + 0xBC43, 0x7CC3, 0xBC44, 0x7CC4, 0xBC45, 0x7CC6, 0xBC46, 0x7CC9, 0xBC47, 0x7CCB, 0xBC48, 0x7CCE, 0xBC49, 0x7CCF, 0xBC4A, 0x7CD0, + 0xBC4B, 0x7CD1, 0xBC4C, 0x7CD2, 0xBC4D, 0x7CD3, 0xBC4E, 0x7CD4, 0xBC4F, 0x7CD8, 0xBC50, 0x7CDA, 0xBC51, 0x7CDB, 0xBC52, 0x7CDD, + 0xBC53, 0x7CDE, 0xBC54, 0x7CE1, 0xBC55, 0x7CE2, 0xBC56, 0x7CE3, 0xBC57, 0x7CE4, 0xBC58, 0x7CE5, 0xBC59, 0x7CE6, 0xBC5A, 0x7CE7, + 0xBC5B, 0x7CE9, 0xBC5C, 0x7CEA, 0xBC5D, 0x7CEB, 0xBC5E, 0x7CEC, 0xBC5F, 0x7CED, 0xBC60, 0x7CEE, 0xBC61, 0x7CF0, 0xBC62, 0x7CF1, + 0xBC63, 0x7CF2, 0xBC64, 0x7CF3, 0xBC65, 0x7CF4, 0xBC66, 0x7CF5, 0xBC67, 0x7CF6, 0xBC68, 0x7CF7, 0xBC69, 0x7CF9, 0xBC6A, 0x7CFA, + 0xBC6B, 0x7CFC, 0xBC6C, 0x7CFD, 0xBC6D, 0x7CFE, 0xBC6E, 0x7CFF, 0xBC6F, 0x7D00, 0xBC70, 0x7D01, 0xBC71, 0x7D02, 0xBC72, 0x7D03, + 0xBC73, 0x7D04, 0xBC74, 0x7D05, 0xBC75, 0x7D06, 0xBC76, 0x7D07, 0xBC77, 0x7D08, 0xBC78, 0x7D09, 0xBC79, 0x7D0B, 0xBC7A, 0x7D0C, + 0xBC7B, 0x7D0D, 0xBC7C, 0x7D0E, 0xBC7D, 0x7D0F, 0xBC7E, 0x7D10, 0xBC80, 0x7D11, 0xBC81, 0x7D12, 0xBC82, 0x7D13, 0xBC83, 0x7D14, + 0xBC84, 0x7D15, 0xBC85, 0x7D16, 0xBC86, 0x7D17, 0xBC87, 0x7D18, 0xBC88, 0x7D19, 0xBC89, 0x7D1A, 0xBC8A, 0x7D1B, 0xBC8B, 0x7D1C, + 0xBC8C, 0x7D1D, 0xBC8D, 0x7D1E, 0xBC8E, 0x7D1F, 0xBC8F, 0x7D21, 0xBC90, 0x7D23, 0xBC91, 0x7D24, 0xBC92, 0x7D25, 0xBC93, 0x7D26, + 0xBC94, 0x7D28, 0xBC95, 0x7D29, 0xBC96, 0x7D2A, 0xBC97, 0x7D2C, 0xBC98, 0x7D2D, 0xBC99, 0x7D2E, 0xBC9A, 0x7D30, 0xBC9B, 0x7D31, + 0xBC9C, 0x7D32, 0xBC9D, 0x7D33, 0xBC9E, 0x7D34, 0xBC9F, 0x7D35, 0xBCA0, 0x7D36, 0xBCA1, 0x808C, 0xBCA2, 0x9965, 0xBCA3, 0x8FF9, + 0xBCA4, 0x6FC0, 0xBCA5, 0x8BA5, 0xBCA6, 0x9E21, 0xBCA7, 0x59EC, 0xBCA8, 0x7EE9, 0xBCA9, 0x7F09, 0xBCAA, 0x5409, 0xBCAB, 0x6781, + 0xBCAC, 0x68D8, 0xBCAD, 0x8F91, 0xBCAE, 0x7C4D, 0xBCAF, 0x96C6, 0xBCB0, 0x53CA, 0xBCB1, 0x6025, 0xBCB2, 0x75BE, 0xBCB3, 0x6C72, + 0xBCB4, 0x5373, 0xBCB5, 0x5AC9, 0xBCB6, 0x7EA7, 0xBCB7, 0x6324, 0xBCB8, 0x51E0, 0xBCB9, 0x810A, 0xBCBA, 0x5DF1, 0xBCBB, 0x84DF, + 0xBCBC, 0x6280, 0xBCBD, 0x5180, 0xBCBE, 0x5B63, 0xBCBF, 0x4F0E, 0xBCC0, 0x796D, 0xBCC1, 0x5242, 0xBCC2, 0x60B8, 0xBCC3, 0x6D4E, + 0xBCC4, 0x5BC4, 0xBCC5, 0x5BC2, 0xBCC6, 0x8BA1, 0xBCC7, 0x8BB0, 0xBCC8, 0x65E2, 0xBCC9, 0x5FCC, 0xBCCA, 0x9645, 0xBCCB, 0x5993, + 0xBCCC, 0x7EE7, 0xBCCD, 0x7EAA, 0xBCCE, 0x5609, 0xBCCF, 0x67B7, 0xBCD0, 0x5939, 0xBCD1, 0x4F73, 0xBCD2, 0x5BB6, 0xBCD3, 0x52A0, + 0xBCD4, 0x835A, 0xBCD5, 0x988A, 0xBCD6, 0x8D3E, 0xBCD7, 0x7532, 0xBCD8, 0x94BE, 0xBCD9, 0x5047, 0xBCDA, 0x7A3C, 0xBCDB, 0x4EF7, + 0xBCDC, 0x67B6, 0xBCDD, 0x9A7E, 0xBCDE, 0x5AC1, 0xBCDF, 0x6B7C, 0xBCE0, 0x76D1, 0xBCE1, 0x575A, 0xBCE2, 0x5C16, 0xBCE3, 0x7B3A, + 0xBCE4, 0x95F4, 0xBCE5, 0x714E, 0xBCE6, 0x517C, 0xBCE7, 0x80A9, 0xBCE8, 0x8270, 0xBCE9, 0x5978, 0xBCEA, 0x7F04, 0xBCEB, 0x8327, + 0xBCEC, 0x68C0, 0xBCED, 0x67EC, 0xBCEE, 0x78B1, 0xBCEF, 0x7877, 0xBCF0, 0x62E3, 0xBCF1, 0x6361, 0xBCF2, 0x7B80, 0xBCF3, 0x4FED, + 0xBCF4, 0x526A, 0xBCF5, 0x51CF, 0xBCF6, 0x8350, 0xBCF7, 0x69DB, 0xBCF8, 0x9274, 0xBCF9, 0x8DF5, 0xBCFA, 0x8D31, 0xBCFB, 0x89C1, + 0xBCFC, 0x952E, 0xBCFD, 0x7BAD, 0xBCFE, 0x4EF6, 0xBD40, 0x7D37, 0xBD41, 0x7D38, 0xBD42, 0x7D39, 0xBD43, 0x7D3A, 0xBD44, 0x7D3B, + 0xBD45, 0x7D3C, 0xBD46, 0x7D3D, 0xBD47, 0x7D3E, 0xBD48, 0x7D3F, 0xBD49, 0x7D40, 0xBD4A, 0x7D41, 0xBD4B, 0x7D42, 0xBD4C, 0x7D43, + 0xBD4D, 0x7D44, 0xBD4E, 0x7D45, 0xBD4F, 0x7D46, 0xBD50, 0x7D47, 0xBD51, 0x7D48, 0xBD52, 0x7D49, 0xBD53, 0x7D4A, 0xBD54, 0x7D4B, + 0xBD55, 0x7D4C, 0xBD56, 0x7D4D, 0xBD57, 0x7D4E, 0xBD58, 0x7D4F, 0xBD59, 0x7D50, 0xBD5A, 0x7D51, 0xBD5B, 0x7D52, 0xBD5C, 0x7D53, + 0xBD5D, 0x7D54, 0xBD5E, 0x7D55, 0xBD5F, 0x7D56, 0xBD60, 0x7D57, 0xBD61, 0x7D58, 0xBD62, 0x7D59, 0xBD63, 0x7D5A, 0xBD64, 0x7D5B, + 0xBD65, 0x7D5C, 0xBD66, 0x7D5D, 0xBD67, 0x7D5E, 0xBD68, 0x7D5F, 0xBD69, 0x7D60, 0xBD6A, 0x7D61, 0xBD6B, 0x7D62, 0xBD6C, 0x7D63, + 0xBD6D, 0x7D64, 0xBD6E, 0x7D65, 0xBD6F, 0x7D66, 0xBD70, 0x7D67, 0xBD71, 0x7D68, 0xBD72, 0x7D69, 0xBD73, 0x7D6A, 0xBD74, 0x7D6B, + 0xBD75, 0x7D6C, 0xBD76, 0x7D6D, 0xBD77, 0x7D6F, 0xBD78, 0x7D70, 0xBD79, 0x7D71, 0xBD7A, 0x7D72, 0xBD7B, 0x7D73, 0xBD7C, 0x7D74, + 0xBD7D, 0x7D75, 0xBD7E, 0x7D76, 0xBD80, 0x7D78, 0xBD81, 0x7D79, 0xBD82, 0x7D7A, 0xBD83, 0x7D7B, 0xBD84, 0x7D7C, 0xBD85, 0x7D7D, + 0xBD86, 0x7D7E, 0xBD87, 0x7D7F, 0xBD88, 0x7D80, 0xBD89, 0x7D81, 0xBD8A, 0x7D82, 0xBD8B, 0x7D83, 0xBD8C, 0x7D84, 0xBD8D, 0x7D85, + 0xBD8E, 0x7D86, 0xBD8F, 0x7D87, 0xBD90, 0x7D88, 0xBD91, 0x7D89, 0xBD92, 0x7D8A, 0xBD93, 0x7D8B, 0xBD94, 0x7D8C, 0xBD95, 0x7D8D, + 0xBD96, 0x7D8E, 0xBD97, 0x7D8F, 0xBD98, 0x7D90, 0xBD99, 0x7D91, 0xBD9A, 0x7D92, 0xBD9B, 0x7D93, 0xBD9C, 0x7D94, 0xBD9D, 0x7D95, + 0xBD9E, 0x7D96, 0xBD9F, 0x7D97, 0xBDA0, 0x7D98, 0xBDA1, 0x5065, 0xBDA2, 0x8230, 0xBDA3, 0x5251, 0xBDA4, 0x996F, 0xBDA5, 0x6E10, + 0xBDA6, 0x6E85, 0xBDA7, 0x6DA7, 0xBDA8, 0x5EFA, 0xBDA9, 0x50F5, 0xBDAA, 0x59DC, 0xBDAB, 0x5C06, 0xBDAC, 0x6D46, 0xBDAD, 0x6C5F, + 0xBDAE, 0x7586, 0xBDAF, 0x848B, 0xBDB0, 0x6868, 0xBDB1, 0x5956, 0xBDB2, 0x8BB2, 0xBDB3, 0x5320, 0xBDB4, 0x9171, 0xBDB5, 0x964D, + 0xBDB6, 0x8549, 0xBDB7, 0x6912, 0xBDB8, 0x7901, 0xBDB9, 0x7126, 0xBDBA, 0x80F6, 0xBDBB, 0x4EA4, 0xBDBC, 0x90CA, 0xBDBD, 0x6D47, + 0xBDBE, 0x9A84, 0xBDBF, 0x5A07, 0xBDC0, 0x56BC, 0xBDC1, 0x6405, 0xBDC2, 0x94F0, 0xBDC3, 0x77EB, 0xBDC4, 0x4FA5, 0xBDC5, 0x811A, + 0xBDC6, 0x72E1, 0xBDC7, 0x89D2, 0xBDC8, 0x997A, 0xBDC9, 0x7F34, 0xBDCA, 0x7EDE, 0xBDCB, 0x527F, 0xBDCC, 0x6559, 0xBDCD, 0x9175, + 0xBDCE, 0x8F7F, 0xBDCF, 0x8F83, 0xBDD0, 0x53EB, 0xBDD1, 0x7A96, 0xBDD2, 0x63ED, 0xBDD3, 0x63A5, 0xBDD4, 0x7686, 0xBDD5, 0x79F8, + 0xBDD6, 0x8857, 0xBDD7, 0x9636, 0xBDD8, 0x622A, 0xBDD9, 0x52AB, 0xBDDA, 0x8282, 0xBDDB, 0x6854, 0xBDDC, 0x6770, 0xBDDD, 0x6377, + 0xBDDE, 0x776B, 0xBDDF, 0x7AED, 0xBDE0, 0x6D01, 0xBDE1, 0x7ED3, 0xBDE2, 0x89E3, 0xBDE3, 0x59D0, 0xBDE4, 0x6212, 0xBDE5, 0x85C9, + 0xBDE6, 0x82A5, 0xBDE7, 0x754C, 0xBDE8, 0x501F, 0xBDE9, 0x4ECB, 0xBDEA, 0x75A5, 0xBDEB, 0x8BEB, 0xBDEC, 0x5C4A, 0xBDED, 0x5DFE, + 0xBDEE, 0x7B4B, 0xBDEF, 0x65A4, 0xBDF0, 0x91D1, 0xBDF1, 0x4ECA, 0xBDF2, 0x6D25, 0xBDF3, 0x895F, 0xBDF4, 0x7D27, 0xBDF5, 0x9526, + 0xBDF6, 0x4EC5, 0xBDF7, 0x8C28, 0xBDF8, 0x8FDB, 0xBDF9, 0x9773, 0xBDFA, 0x664B, 0xBDFB, 0x7981, 0xBDFC, 0x8FD1, 0xBDFD, 0x70EC, + 0xBDFE, 0x6D78, 0xBE40, 0x7D99, 0xBE41, 0x7D9A, 0xBE42, 0x7D9B, 0xBE43, 0x7D9C, 0xBE44, 0x7D9D, 0xBE45, 0x7D9E, 0xBE46, 0x7D9F, + 0xBE47, 0x7DA0, 0xBE48, 0x7DA1, 0xBE49, 0x7DA2, 0xBE4A, 0x7DA3, 0xBE4B, 0x7DA4, 0xBE4C, 0x7DA5, 0xBE4D, 0x7DA7, 0xBE4E, 0x7DA8, + 0xBE4F, 0x7DA9, 0xBE50, 0x7DAA, 0xBE51, 0x7DAB, 0xBE52, 0x7DAC, 0xBE53, 0x7DAD, 0xBE54, 0x7DAF, 0xBE55, 0x7DB0, 0xBE56, 0x7DB1, + 0xBE57, 0x7DB2, 0xBE58, 0x7DB3, 0xBE59, 0x7DB4, 0xBE5A, 0x7DB5, 0xBE5B, 0x7DB6, 0xBE5C, 0x7DB7, 0xBE5D, 0x7DB8, 0xBE5E, 0x7DB9, + 0xBE5F, 0x7DBA, 0xBE60, 0x7DBB, 0xBE61, 0x7DBC, 0xBE62, 0x7DBD, 0xBE63, 0x7DBE, 0xBE64, 0x7DBF, 0xBE65, 0x7DC0, 0xBE66, 0x7DC1, + 0xBE67, 0x7DC2, 0xBE68, 0x7DC3, 0xBE69, 0x7DC4, 0xBE6A, 0x7DC5, 0xBE6B, 0x7DC6, 0xBE6C, 0x7DC7, 0xBE6D, 0x7DC8, 0xBE6E, 0x7DC9, + 0xBE6F, 0x7DCA, 0xBE70, 0x7DCB, 0xBE71, 0x7DCC, 0xBE72, 0x7DCD, 0xBE73, 0x7DCE, 0xBE74, 0x7DCF, 0xBE75, 0x7DD0, 0xBE76, 0x7DD1, + 0xBE77, 0x7DD2, 0xBE78, 0x7DD3, 0xBE79, 0x7DD4, 0xBE7A, 0x7DD5, 0xBE7B, 0x7DD6, 0xBE7C, 0x7DD7, 0xBE7D, 0x7DD8, 0xBE7E, 0x7DD9, + 0xBE80, 0x7DDA, 0xBE81, 0x7DDB, 0xBE82, 0x7DDC, 0xBE83, 0x7DDD, 0xBE84, 0x7DDE, 0xBE85, 0x7DDF, 0xBE86, 0x7DE0, 0xBE87, 0x7DE1, + 0xBE88, 0x7DE2, 0xBE89, 0x7DE3, 0xBE8A, 0x7DE4, 0xBE8B, 0x7DE5, 0xBE8C, 0x7DE6, 0xBE8D, 0x7DE7, 0xBE8E, 0x7DE8, 0xBE8F, 0x7DE9, + 0xBE90, 0x7DEA, 0xBE91, 0x7DEB, 0xBE92, 0x7DEC, 0xBE93, 0x7DED, 0xBE94, 0x7DEE, 0xBE95, 0x7DEF, 0xBE96, 0x7DF0, 0xBE97, 0x7DF1, + 0xBE98, 0x7DF2, 0xBE99, 0x7DF3, 0xBE9A, 0x7DF4, 0xBE9B, 0x7DF5, 0xBE9C, 0x7DF6, 0xBE9D, 0x7DF7, 0xBE9E, 0x7DF8, 0xBE9F, 0x7DF9, + 0xBEA0, 0x7DFA, 0xBEA1, 0x5C3D, 0xBEA2, 0x52B2, 0xBEA3, 0x8346, 0xBEA4, 0x5162, 0xBEA5, 0x830E, 0xBEA6, 0x775B, 0xBEA7, 0x6676, + 0xBEA8, 0x9CB8, 0xBEA9, 0x4EAC, 0xBEAA, 0x60CA, 0xBEAB, 0x7CBE, 0xBEAC, 0x7CB3, 0xBEAD, 0x7ECF, 0xBEAE, 0x4E95, 0xBEAF, 0x8B66, + 0xBEB0, 0x666F, 0xBEB1, 0x9888, 0xBEB2, 0x9759, 0xBEB3, 0x5883, 0xBEB4, 0x656C, 0xBEB5, 0x955C, 0xBEB6, 0x5F84, 0xBEB7, 0x75C9, + 0xBEB8, 0x9756, 0xBEB9, 0x7ADF, 0xBEBA, 0x7ADE, 0xBEBB, 0x51C0, 0xBEBC, 0x70AF, 0xBEBD, 0x7A98, 0xBEBE, 0x63EA, 0xBEBF, 0x7A76, + 0xBEC0, 0x7EA0, 0xBEC1, 0x7396, 0xBEC2, 0x97ED, 0xBEC3, 0x4E45, 0xBEC4, 0x7078, 0xBEC5, 0x4E5D, 0xBEC6, 0x9152, 0xBEC7, 0x53A9, + 0xBEC8, 0x6551, 0xBEC9, 0x65E7, 0xBECA, 0x81FC, 0xBECB, 0x8205, 0xBECC, 0x548E, 0xBECD, 0x5C31, 0xBECE, 0x759A, 0xBECF, 0x97A0, + 0xBED0, 0x62D8, 0xBED1, 0x72D9, 0xBED2, 0x75BD, 0xBED3, 0x5C45, 0xBED4, 0x9A79, 0xBED5, 0x83CA, 0xBED6, 0x5C40, 0xBED7, 0x5480, + 0xBED8, 0x77E9, 0xBED9, 0x4E3E, 0xBEDA, 0x6CAE, 0xBEDB, 0x805A, 0xBEDC, 0x62D2, 0xBEDD, 0x636E, 0xBEDE, 0x5DE8, 0xBEDF, 0x5177, + 0xBEE0, 0x8DDD, 0xBEE1, 0x8E1E, 0xBEE2, 0x952F, 0xBEE3, 0x4FF1, 0xBEE4, 0x53E5, 0xBEE5, 0x60E7, 0xBEE6, 0x70AC, 0xBEE7, 0x5267, + 0xBEE8, 0x6350, 0xBEE9, 0x9E43, 0xBEEA, 0x5A1F, 0xBEEB, 0x5026, 0xBEEC, 0x7737, 0xBEED, 0x5377, 0xBEEE, 0x7EE2, 0xBEEF, 0x6485, + 0xBEF0, 0x652B, 0xBEF1, 0x6289, 0xBEF2, 0x6398, 0xBEF3, 0x5014, 0xBEF4, 0x7235, 0xBEF5, 0x89C9, 0xBEF6, 0x51B3, 0xBEF7, 0x8BC0, + 0xBEF8, 0x7EDD, 0xBEF9, 0x5747, 0xBEFA, 0x83CC, 0xBEFB, 0x94A7, 0xBEFC, 0x519B, 0xBEFD, 0x541B, 0xBEFE, 0x5CFB, 0xBF40, 0x7DFB, + 0xBF41, 0x7DFC, 0xBF42, 0x7DFD, 0xBF43, 0x7DFE, 0xBF44, 0x7DFF, 0xBF45, 0x7E00, 0xBF46, 0x7E01, 0xBF47, 0x7E02, 0xBF48, 0x7E03, + 0xBF49, 0x7E04, 0xBF4A, 0x7E05, 0xBF4B, 0x7E06, 0xBF4C, 0x7E07, 0xBF4D, 0x7E08, 0xBF4E, 0x7E09, 0xBF4F, 0x7E0A, 0xBF50, 0x7E0B, + 0xBF51, 0x7E0C, 0xBF52, 0x7E0D, 0xBF53, 0x7E0E, 0xBF54, 0x7E0F, 0xBF55, 0x7E10, 0xBF56, 0x7E11, 0xBF57, 0x7E12, 0xBF58, 0x7E13, + 0xBF59, 0x7E14, 0xBF5A, 0x7E15, 0xBF5B, 0x7E16, 0xBF5C, 0x7E17, 0xBF5D, 0x7E18, 0xBF5E, 0x7E19, 0xBF5F, 0x7E1A, 0xBF60, 0x7E1B, + 0xBF61, 0x7E1C, 0xBF62, 0x7E1D, 0xBF63, 0x7E1E, 0xBF64, 0x7E1F, 0xBF65, 0x7E20, 0xBF66, 0x7E21, 0xBF67, 0x7E22, 0xBF68, 0x7E23, + 0xBF69, 0x7E24, 0xBF6A, 0x7E25, 0xBF6B, 0x7E26, 0xBF6C, 0x7E27, 0xBF6D, 0x7E28, 0xBF6E, 0x7E29, 0xBF6F, 0x7E2A, 0xBF70, 0x7E2B, + 0xBF71, 0x7E2C, 0xBF72, 0x7E2D, 0xBF73, 0x7E2E, 0xBF74, 0x7E2F, 0xBF75, 0x7E30, 0xBF76, 0x7E31, 0xBF77, 0x7E32, 0xBF78, 0x7E33, + 0xBF79, 0x7E34, 0xBF7A, 0x7E35, 0xBF7B, 0x7E36, 0xBF7C, 0x7E37, 0xBF7D, 0x7E38, 0xBF7E, 0x7E39, 0xBF80, 0x7E3A, 0xBF81, 0x7E3C, + 0xBF82, 0x7E3D, 0xBF83, 0x7E3E, 0xBF84, 0x7E3F, 0xBF85, 0x7E40, 0xBF86, 0x7E42, 0xBF87, 0x7E43, 0xBF88, 0x7E44, 0xBF89, 0x7E45, + 0xBF8A, 0x7E46, 0xBF8B, 0x7E48, 0xBF8C, 0x7E49, 0xBF8D, 0x7E4A, 0xBF8E, 0x7E4B, 0xBF8F, 0x7E4C, 0xBF90, 0x7E4D, 0xBF91, 0x7E4E, + 0xBF92, 0x7E4F, 0xBF93, 0x7E50, 0xBF94, 0x7E51, 0xBF95, 0x7E52, 0xBF96, 0x7E53, 0xBF97, 0x7E54, 0xBF98, 0x7E55, 0xBF99, 0x7E56, + 0xBF9A, 0x7E57, 0xBF9B, 0x7E58, 0xBF9C, 0x7E59, 0xBF9D, 0x7E5A, 0xBF9E, 0x7E5B, 0xBF9F, 0x7E5C, 0xBFA0, 0x7E5D, 0xBFA1, 0x4FCA, + 0xBFA2, 0x7AE3, 0xBFA3, 0x6D5A, 0xBFA4, 0x90E1, 0xBFA5, 0x9A8F, 0xBFA6, 0x5580, 0xBFA7, 0x5496, 0xBFA8, 0x5361, 0xBFA9, 0x54AF, + 0xBFAA, 0x5F00, 0xBFAB, 0x63E9, 0xBFAC, 0x6977, 0xBFAD, 0x51EF, 0xBFAE, 0x6168, 0xBFAF, 0x520A, 0xBFB0, 0x582A, 0xBFB1, 0x52D8, + 0xBFB2, 0x574E, 0xBFB3, 0x780D, 0xBFB4, 0x770B, 0xBFB5, 0x5EB7, 0xBFB6, 0x6177, 0xBFB7, 0x7CE0, 0xBFB8, 0x625B, 0xBFB9, 0x6297, + 0xBFBA, 0x4EA2, 0xBFBB, 0x7095, 0xBFBC, 0x8003, 0xBFBD, 0x62F7, 0xBFBE, 0x70E4, 0xBFBF, 0x9760, 0xBFC0, 0x5777, 0xBFC1, 0x82DB, + 0xBFC2, 0x67EF, 0xBFC3, 0x68F5, 0xBFC4, 0x78D5, 0xBFC5, 0x9897, 0xBFC6, 0x79D1, 0xBFC7, 0x58F3, 0xBFC8, 0x54B3, 0xBFC9, 0x53EF, + 0xBFCA, 0x6E34, 0xBFCB, 0x514B, 0xBFCC, 0x523B, 0xBFCD, 0x5BA2, 0xBFCE, 0x8BFE, 0xBFCF, 0x80AF, 0xBFD0, 0x5543, 0xBFD1, 0x57A6, + 0xBFD2, 0x6073, 0xBFD3, 0x5751, 0xBFD4, 0x542D, 0xBFD5, 0x7A7A, 0xBFD6, 0x6050, 0xBFD7, 0x5B54, 0xBFD8, 0x63A7, 0xBFD9, 0x62A0, + 0xBFDA, 0x53E3, 0xBFDB, 0x6263, 0xBFDC, 0x5BC7, 0xBFDD, 0x67AF, 0xBFDE, 0x54ED, 0xBFDF, 0x7A9F, 0xBFE0, 0x82E6, 0xBFE1, 0x9177, + 0xBFE2, 0x5E93, 0xBFE3, 0x88E4, 0xBFE4, 0x5938, 0xBFE5, 0x57AE, 0xBFE6, 0x630E, 0xBFE7, 0x8DE8, 0xBFE8, 0x80EF, 0xBFE9, 0x5757, + 0xBFEA, 0x7B77, 0xBFEB, 0x4FA9, 0xBFEC, 0x5FEB, 0xBFED, 0x5BBD, 0xBFEE, 0x6B3E, 0xBFEF, 0x5321, 0xBFF0, 0x7B50, 0xBFF1, 0x72C2, + 0xBFF2, 0x6846, 0xBFF3, 0x77FF, 0xBFF4, 0x7736, 0xBFF5, 0x65F7, 0xBFF6, 0x51B5, 0xBFF7, 0x4E8F, 0xBFF8, 0x76D4, 0xBFF9, 0x5CBF, + 0xBFFA, 0x7AA5, 0xBFFB, 0x8475, 0xBFFC, 0x594E, 0xBFFD, 0x9B41, 0xBFFE, 0x5080, 0xC040, 0x7E5E, 0xC041, 0x7E5F, 0xC042, 0x7E60, + 0xC043, 0x7E61, 0xC044, 0x7E62, 0xC045, 0x7E63, 0xC046, 0x7E64, 0xC047, 0x7E65, 0xC048, 0x7E66, 0xC049, 0x7E67, 0xC04A, 0x7E68, + 0xC04B, 0x7E69, 0xC04C, 0x7E6A, 0xC04D, 0x7E6B, 0xC04E, 0x7E6C, 0xC04F, 0x7E6D, 0xC050, 0x7E6E, 0xC051, 0x7E6F, 0xC052, 0x7E70, + 0xC053, 0x7E71, 0xC054, 0x7E72, 0xC055, 0x7E73, 0xC056, 0x7E74, 0xC057, 0x7E75, 0xC058, 0x7E76, 0xC059, 0x7E77, 0xC05A, 0x7E78, + 0xC05B, 0x7E79, 0xC05C, 0x7E7A, 0xC05D, 0x7E7B, 0xC05E, 0x7E7C, 0xC05F, 0x7E7D, 0xC060, 0x7E7E, 0xC061, 0x7E7F, 0xC062, 0x7E80, + 0xC063, 0x7E81, 0xC064, 0x7E83, 0xC065, 0x7E84, 0xC066, 0x7E85, 0xC067, 0x7E86, 0xC068, 0x7E87, 0xC069, 0x7E88, 0xC06A, 0x7E89, + 0xC06B, 0x7E8A, 0xC06C, 0x7E8B, 0xC06D, 0x7E8C, 0xC06E, 0x7E8D, 0xC06F, 0x7E8E, 0xC070, 0x7E8F, 0xC071, 0x7E90, 0xC072, 0x7E91, + 0xC073, 0x7E92, 0xC074, 0x7E93, 0xC075, 0x7E94, 0xC076, 0x7E95, 0xC077, 0x7E96, 0xC078, 0x7E97, 0xC079, 0x7E98, 0xC07A, 0x7E99, + 0xC07B, 0x7E9A, 0xC07C, 0x7E9C, 0xC07D, 0x7E9D, 0xC07E, 0x7E9E, 0xC080, 0x7EAE, 0xC081, 0x7EB4, 0xC082, 0x7EBB, 0xC083, 0x7EBC, + 0xC084, 0x7ED6, 0xC085, 0x7EE4, 0xC086, 0x7EEC, 0xC087, 0x7EF9, 0xC088, 0x7F0A, 0xC089, 0x7F10, 0xC08A, 0x7F1E, 0xC08B, 0x7F37, + 0xC08C, 0x7F39, 0xC08D, 0x7F3B, 0xC08E, 0x7F3C, 0xC08F, 0x7F3D, 0xC090, 0x7F3E, 0xC091, 0x7F3F, 0xC092, 0x7F40, 0xC093, 0x7F41, + 0xC094, 0x7F43, 0xC095, 0x7F46, 0xC096, 0x7F47, 0xC097, 0x7F48, 0xC098, 0x7F49, 0xC099, 0x7F4A, 0xC09A, 0x7F4B, 0xC09B, 0x7F4C, + 0xC09C, 0x7F4D, 0xC09D, 0x7F4E, 0xC09E, 0x7F4F, 0xC09F, 0x7F52, 0xC0A0, 0x7F53, 0xC0A1, 0x9988, 0xC0A2, 0x6127, 0xC0A3, 0x6E83, + 0xC0A4, 0x5764, 0xC0A5, 0x6606, 0xC0A6, 0x6346, 0xC0A7, 0x56F0, 0xC0A8, 0x62EC, 0xC0A9, 0x6269, 0xC0AA, 0x5ED3, 0xC0AB, 0x9614, + 0xC0AC, 0x5783, 0xC0AD, 0x62C9, 0xC0AE, 0x5587, 0xC0AF, 0x8721, 0xC0B0, 0x814A, 0xC0B1, 0x8FA3, 0xC0B2, 0x5566, 0xC0B3, 0x83B1, + 0xC0B4, 0x6765, 0xC0B5, 0x8D56, 0xC0B6, 0x84DD, 0xC0B7, 0x5A6A, 0xC0B8, 0x680F, 0xC0B9, 0x62E6, 0xC0BA, 0x7BEE, 0xC0BB, 0x9611, + 0xC0BC, 0x5170, 0xC0BD, 0x6F9C, 0xC0BE, 0x8C30, 0xC0BF, 0x63FD, 0xC0C0, 0x89C8, 0xC0C1, 0x61D2, 0xC0C2, 0x7F06, 0xC0C3, 0x70C2, + 0xC0C4, 0x6EE5, 0xC0C5, 0x7405, 0xC0C6, 0x6994, 0xC0C7, 0x72FC, 0xC0C8, 0x5ECA, 0xC0C9, 0x90CE, 0xC0CA, 0x6717, 0xC0CB, 0x6D6A, + 0xC0CC, 0x635E, 0xC0CD, 0x52B3, 0xC0CE, 0x7262, 0xC0CF, 0x8001, 0xC0D0, 0x4F6C, 0xC0D1, 0x59E5, 0xC0D2, 0x916A, 0xC0D3, 0x70D9, + 0xC0D4, 0x6D9D, 0xC0D5, 0x52D2, 0xC0D6, 0x4E50, 0xC0D7, 0x96F7, 0xC0D8, 0x956D, 0xC0D9, 0x857E, 0xC0DA, 0x78CA, 0xC0DB, 0x7D2F, + 0xC0DC, 0x5121, 0xC0DD, 0x5792, 0xC0DE, 0x64C2, 0xC0DF, 0x808B, 0xC0E0, 0x7C7B, 0xC0E1, 0x6CEA, 0xC0E2, 0x68F1, 0xC0E3, 0x695E, + 0xC0E4, 0x51B7, 0xC0E5, 0x5398, 0xC0E6, 0x68A8, 0xC0E7, 0x7281, 0xC0E8, 0x9ECE, 0xC0E9, 0x7BF1, 0xC0EA, 0x72F8, 0xC0EB, 0x79BB, + 0xC0EC, 0x6F13, 0xC0ED, 0x7406, 0xC0EE, 0x674E, 0xC0EF, 0x91CC, 0xC0F0, 0x9CA4, 0xC0F1, 0x793C, 0xC0F2, 0x8389, 0xC0F3, 0x8354, + 0xC0F4, 0x540F, 0xC0F5, 0x6817, 0xC0F6, 0x4E3D, 0xC0F7, 0x5389, 0xC0F8, 0x52B1, 0xC0F9, 0x783E, 0xC0FA, 0x5386, 0xC0FB, 0x5229, + 0xC0FC, 0x5088, 0xC0FD, 0x4F8B, 0xC0FE, 0x4FD0, 0xC140, 0x7F56, 0xC141, 0x7F59, 0xC142, 0x7F5B, 0xC143, 0x7F5C, 0xC144, 0x7F5D, + 0xC145, 0x7F5E, 0xC146, 0x7F60, 0xC147, 0x7F63, 0xC148, 0x7F64, 0xC149, 0x7F65, 0xC14A, 0x7F66, 0xC14B, 0x7F67, 0xC14C, 0x7F6B, + 0xC14D, 0x7F6C, 0xC14E, 0x7F6D, 0xC14F, 0x7F6F, 0xC150, 0x7F70, 0xC151, 0x7F73, 0xC152, 0x7F75, 0xC153, 0x7F76, 0xC154, 0x7F77, + 0xC155, 0x7F78, 0xC156, 0x7F7A, 0xC157, 0x7F7B, 0xC158, 0x7F7C, 0xC159, 0x7F7D, 0xC15A, 0x7F7F, 0xC15B, 0x7F80, 0xC15C, 0x7F82, + 0xC15D, 0x7F83, 0xC15E, 0x7F84, 0xC15F, 0x7F85, 0xC160, 0x7F86, 0xC161, 0x7F87, 0xC162, 0x7F88, 0xC163, 0x7F89, 0xC164, 0x7F8B, + 0xC165, 0x7F8D, 0xC166, 0x7F8F, 0xC167, 0x7F90, 0xC168, 0x7F91, 0xC169, 0x7F92, 0xC16A, 0x7F93, 0xC16B, 0x7F95, 0xC16C, 0x7F96, + 0xC16D, 0x7F97, 0xC16E, 0x7F98, 0xC16F, 0x7F99, 0xC170, 0x7F9B, 0xC171, 0x7F9C, 0xC172, 0x7FA0, 0xC173, 0x7FA2, 0xC174, 0x7FA3, + 0xC175, 0x7FA5, 0xC176, 0x7FA6, 0xC177, 0x7FA8, 0xC178, 0x7FA9, 0xC179, 0x7FAA, 0xC17A, 0x7FAB, 0xC17B, 0x7FAC, 0xC17C, 0x7FAD, + 0xC17D, 0x7FAE, 0xC17E, 0x7FB1, 0xC180, 0x7FB3, 0xC181, 0x7FB4, 0xC182, 0x7FB5, 0xC183, 0x7FB6, 0xC184, 0x7FB7, 0xC185, 0x7FBA, + 0xC186, 0x7FBB, 0xC187, 0x7FBE, 0xC188, 0x7FC0, 0xC189, 0x7FC2, 0xC18A, 0x7FC3, 0xC18B, 0x7FC4, 0xC18C, 0x7FC6, 0xC18D, 0x7FC7, + 0xC18E, 0x7FC8, 0xC18F, 0x7FC9, 0xC190, 0x7FCB, 0xC191, 0x7FCD, 0xC192, 0x7FCF, 0xC193, 0x7FD0, 0xC194, 0x7FD1, 0xC195, 0x7FD2, + 0xC196, 0x7FD3, 0xC197, 0x7FD6, 0xC198, 0x7FD7, 0xC199, 0x7FD9, 0xC19A, 0x7FDA, 0xC19B, 0x7FDB, 0xC19C, 0x7FDC, 0xC19D, 0x7FDD, + 0xC19E, 0x7FDE, 0xC19F, 0x7FE2, 0xC1A0, 0x7FE3, 0xC1A1, 0x75E2, 0xC1A2, 0x7ACB, 0xC1A3, 0x7C92, 0xC1A4, 0x6CA5, 0xC1A5, 0x96B6, + 0xC1A6, 0x529B, 0xC1A7, 0x7483, 0xC1A8, 0x54E9, 0xC1A9, 0x4FE9, 0xC1AA, 0x8054, 0xC1AB, 0x83B2, 0xC1AC, 0x8FDE, 0xC1AD, 0x9570, + 0xC1AE, 0x5EC9, 0xC1AF, 0x601C, 0xC1B0, 0x6D9F, 0xC1B1, 0x5E18, 0xC1B2, 0x655B, 0xC1B3, 0x8138, 0xC1B4, 0x94FE, 0xC1B5, 0x604B, + 0xC1B6, 0x70BC, 0xC1B7, 0x7EC3, 0xC1B8, 0x7CAE, 0xC1B9, 0x51C9, 0xC1BA, 0x6881, 0xC1BB, 0x7CB1, 0xC1BC, 0x826F, 0xC1BD, 0x4E24, + 0xC1BE, 0x8F86, 0xC1BF, 0x91CF, 0xC1C0, 0x667E, 0xC1C1, 0x4EAE, 0xC1C2, 0x8C05, 0xC1C3, 0x64A9, 0xC1C4, 0x804A, 0xC1C5, 0x50DA, + 0xC1C6, 0x7597, 0xC1C7, 0x71CE, 0xC1C8, 0x5BE5, 0xC1C9, 0x8FBD, 0xC1CA, 0x6F66, 0xC1CB, 0x4E86, 0xC1CC, 0x6482, 0xC1CD, 0x9563, + 0xC1CE, 0x5ED6, 0xC1CF, 0x6599, 0xC1D0, 0x5217, 0xC1D1, 0x88C2, 0xC1D2, 0x70C8, 0xC1D3, 0x52A3, 0xC1D4, 0x730E, 0xC1D5, 0x7433, + 0xC1D6, 0x6797, 0xC1D7, 0x78F7, 0xC1D8, 0x9716, 0xC1D9, 0x4E34, 0xC1DA, 0x90BB, 0xC1DB, 0x9CDE, 0xC1DC, 0x6DCB, 0xC1DD, 0x51DB, + 0xC1DE, 0x8D41, 0xC1DF, 0x541D, 0xC1E0, 0x62CE, 0xC1E1, 0x73B2, 0xC1E2, 0x83F1, 0xC1E3, 0x96F6, 0xC1E4, 0x9F84, 0xC1E5, 0x94C3, + 0xC1E6, 0x4F36, 0xC1E7, 0x7F9A, 0xC1E8, 0x51CC, 0xC1E9, 0x7075, 0xC1EA, 0x9675, 0xC1EB, 0x5CAD, 0xC1EC, 0x9886, 0xC1ED, 0x53E6, + 0xC1EE, 0x4EE4, 0xC1EF, 0x6E9C, 0xC1F0, 0x7409, 0xC1F1, 0x69B4, 0xC1F2, 0x786B, 0xC1F3, 0x998F, 0xC1F4, 0x7559, 0xC1F5, 0x5218, + 0xC1F6, 0x7624, 0xC1F7, 0x6D41, 0xC1F8, 0x67F3, 0xC1F9, 0x516D, 0xC1FA, 0x9F99, 0xC1FB, 0x804B, 0xC1FC, 0x5499, 0xC1FD, 0x7B3C, + 0xC1FE, 0x7ABF, 0xC240, 0x7FE4, 0xC241, 0x7FE7, 0xC242, 0x7FE8, 0xC243, 0x7FEA, 0xC244, 0x7FEB, 0xC245, 0x7FEC, 0xC246, 0x7FED, + 0xC247, 0x7FEF, 0xC248, 0x7FF2, 0xC249, 0x7FF4, 0xC24A, 0x7FF5, 0xC24B, 0x7FF6, 0xC24C, 0x7FF7, 0xC24D, 0x7FF8, 0xC24E, 0x7FF9, + 0xC24F, 0x7FFA, 0xC250, 0x7FFD, 0xC251, 0x7FFE, 0xC252, 0x7FFF, 0xC253, 0x8002, 0xC254, 0x8007, 0xC255, 0x8008, 0xC256, 0x8009, + 0xC257, 0x800A, 0xC258, 0x800E, 0xC259, 0x800F, 0xC25A, 0x8011, 0xC25B, 0x8013, 0xC25C, 0x801A, 0xC25D, 0x801B, 0xC25E, 0x801D, + 0xC25F, 0x801E, 0xC260, 0x801F, 0xC261, 0x8021, 0xC262, 0x8023, 0xC263, 0x8024, 0xC264, 0x802B, 0xC265, 0x802C, 0xC266, 0x802D, + 0xC267, 0x802E, 0xC268, 0x802F, 0xC269, 0x8030, 0xC26A, 0x8032, 0xC26B, 0x8034, 0xC26C, 0x8039, 0xC26D, 0x803A, 0xC26E, 0x803C, + 0xC26F, 0x803E, 0xC270, 0x8040, 0xC271, 0x8041, 0xC272, 0x8044, 0xC273, 0x8045, 0xC274, 0x8047, 0xC275, 0x8048, 0xC276, 0x8049, + 0xC277, 0x804E, 0xC278, 0x804F, 0xC279, 0x8050, 0xC27A, 0x8051, 0xC27B, 0x8053, 0xC27C, 0x8055, 0xC27D, 0x8056, 0xC27E, 0x8057, + 0xC280, 0x8059, 0xC281, 0x805B, 0xC282, 0x805C, 0xC283, 0x805D, 0xC284, 0x805E, 0xC285, 0x805F, 0xC286, 0x8060, 0xC287, 0x8061, + 0xC288, 0x8062, 0xC289, 0x8063, 0xC28A, 0x8064, 0xC28B, 0x8065, 0xC28C, 0x8066, 0xC28D, 0x8067, 0xC28E, 0x8068, 0xC28F, 0x806B, + 0xC290, 0x806C, 0xC291, 0x806D, 0xC292, 0x806E, 0xC293, 0x806F, 0xC294, 0x8070, 0xC295, 0x8072, 0xC296, 0x8073, 0xC297, 0x8074, + 0xC298, 0x8075, 0xC299, 0x8076, 0xC29A, 0x8077, 0xC29B, 0x8078, 0xC29C, 0x8079, 0xC29D, 0x807A, 0xC29E, 0x807B, 0xC29F, 0x807C, + 0xC2A0, 0x807D, 0xC2A1, 0x9686, 0xC2A2, 0x5784, 0xC2A3, 0x62E2, 0xC2A4, 0x9647, 0xC2A5, 0x697C, 0xC2A6, 0x5A04, 0xC2A7, 0x6402, + 0xC2A8, 0x7BD3, 0xC2A9, 0x6F0F, 0xC2AA, 0x964B, 0xC2AB, 0x82A6, 0xC2AC, 0x5362, 0xC2AD, 0x9885, 0xC2AE, 0x5E90, 0xC2AF, 0x7089, + 0xC2B0, 0x63B3, 0xC2B1, 0x5364, 0xC2B2, 0x864F, 0xC2B3, 0x9C81, 0xC2B4, 0x9E93, 0xC2B5, 0x788C, 0xC2B6, 0x9732, 0xC2B7, 0x8DEF, + 0xC2B8, 0x8D42, 0xC2B9, 0x9E7F, 0xC2BA, 0x6F5E, 0xC2BB, 0x7984, 0xC2BC, 0x5F55, 0xC2BD, 0x9646, 0xC2BE, 0x622E, 0xC2BF, 0x9A74, + 0xC2C0, 0x5415, 0xC2C1, 0x94DD, 0xC2C2, 0x4FA3, 0xC2C3, 0x65C5, 0xC2C4, 0x5C65, 0xC2C5, 0x5C61, 0xC2C6, 0x7F15, 0xC2C7, 0x8651, + 0xC2C8, 0x6C2F, 0xC2C9, 0x5F8B, 0xC2CA, 0x7387, 0xC2CB, 0x6EE4, 0xC2CC, 0x7EFF, 0xC2CD, 0x5CE6, 0xC2CE, 0x631B, 0xC2CF, 0x5B6A, + 0xC2D0, 0x6EE6, 0xC2D1, 0x5375, 0xC2D2, 0x4E71, 0xC2D3, 0x63A0, 0xC2D4, 0x7565, 0xC2D5, 0x62A1, 0xC2D6, 0x8F6E, 0xC2D7, 0x4F26, + 0xC2D8, 0x4ED1, 0xC2D9, 0x6CA6, 0xC2DA, 0x7EB6, 0xC2DB, 0x8BBA, 0xC2DC, 0x841D, 0xC2DD, 0x87BA, 0xC2DE, 0x7F57, 0xC2DF, 0x903B, + 0xC2E0, 0x9523, 0xC2E1, 0x7BA9, 0xC2E2, 0x9AA1, 0xC2E3, 0x88F8, 0xC2E4, 0x843D, 0xC2E5, 0x6D1B, 0xC2E6, 0x9A86, 0xC2E7, 0x7EDC, + 0xC2E8, 0x5988, 0xC2E9, 0x9EBB, 0xC2EA, 0x739B, 0xC2EB, 0x7801, 0xC2EC, 0x8682, 0xC2ED, 0x9A6C, 0xC2EE, 0x9A82, 0xC2EF, 0x561B, + 0xC2F0, 0x5417, 0xC2F1, 0x57CB, 0xC2F2, 0x4E70, 0xC2F3, 0x9EA6, 0xC2F4, 0x5356, 0xC2F5, 0x8FC8, 0xC2F6, 0x8109, 0xC2F7, 0x7792, + 0xC2F8, 0x9992, 0xC2F9, 0x86EE, 0xC2FA, 0x6EE1, 0xC2FB, 0x8513, 0xC2FC, 0x66FC, 0xC2FD, 0x6162, 0xC2FE, 0x6F2B, 0xC340, 0x807E, + 0xC341, 0x8081, 0xC342, 0x8082, 0xC343, 0x8085, 0xC344, 0x8088, 0xC345, 0x808A, 0xC346, 0x808D, 0xC347, 0x808E, 0xC348, 0x808F, + 0xC349, 0x8090, 0xC34A, 0x8091, 0xC34B, 0x8092, 0xC34C, 0x8094, 0xC34D, 0x8095, 0xC34E, 0x8097, 0xC34F, 0x8099, 0xC350, 0x809E, + 0xC351, 0x80A3, 0xC352, 0x80A6, 0xC353, 0x80A7, 0xC354, 0x80A8, 0xC355, 0x80AC, 0xC356, 0x80B0, 0xC357, 0x80B3, 0xC358, 0x80B5, + 0xC359, 0x80B6, 0xC35A, 0x80B8, 0xC35B, 0x80B9, 0xC35C, 0x80BB, 0xC35D, 0x80C5, 0xC35E, 0x80C7, 0xC35F, 0x80C8, 0xC360, 0x80C9, + 0xC361, 0x80CA, 0xC362, 0x80CB, 0xC363, 0x80CF, 0xC364, 0x80D0, 0xC365, 0x80D1, 0xC366, 0x80D2, 0xC367, 0x80D3, 0xC368, 0x80D4, + 0xC369, 0x80D5, 0xC36A, 0x80D8, 0xC36B, 0x80DF, 0xC36C, 0x80E0, 0xC36D, 0x80E2, 0xC36E, 0x80E3, 0xC36F, 0x80E6, 0xC370, 0x80EE, + 0xC371, 0x80F5, 0xC372, 0x80F7, 0xC373, 0x80F9, 0xC374, 0x80FB, 0xC375, 0x80FE, 0xC376, 0x80FF, 0xC377, 0x8100, 0xC378, 0x8101, + 0xC379, 0x8103, 0xC37A, 0x8104, 0xC37B, 0x8105, 0xC37C, 0x8107, 0xC37D, 0x8108, 0xC37E, 0x810B, 0xC380, 0x810C, 0xC381, 0x8115, + 0xC382, 0x8117, 0xC383, 0x8119, 0xC384, 0x811B, 0xC385, 0x811C, 0xC386, 0x811D, 0xC387, 0x811F, 0xC388, 0x8120, 0xC389, 0x8121, + 0xC38A, 0x8122, 0xC38B, 0x8123, 0xC38C, 0x8124, 0xC38D, 0x8125, 0xC38E, 0x8126, 0xC38F, 0x8127, 0xC390, 0x8128, 0xC391, 0x8129, + 0xC392, 0x812A, 0xC393, 0x812B, 0xC394, 0x812D, 0xC395, 0x812E, 0xC396, 0x8130, 0xC397, 0x8133, 0xC398, 0x8134, 0xC399, 0x8135, + 0xC39A, 0x8137, 0xC39B, 0x8139, 0xC39C, 0x813A, 0xC39D, 0x813B, 0xC39E, 0x813C, 0xC39F, 0x813D, 0xC3A0, 0x813F, 0xC3A1, 0x8C29, + 0xC3A2, 0x8292, 0xC3A3, 0x832B, 0xC3A4, 0x76F2, 0xC3A5, 0x6C13, 0xC3A6, 0x5FD9, 0xC3A7, 0x83BD, 0xC3A8, 0x732B, 0xC3A9, 0x8305, + 0xC3AA, 0x951A, 0xC3AB, 0x6BDB, 0xC3AC, 0x77DB, 0xC3AD, 0x94C6, 0xC3AE, 0x536F, 0xC3AF, 0x8302, 0xC3B0, 0x5192, 0xC3B1, 0x5E3D, + 0xC3B2, 0x8C8C, 0xC3B3, 0x8D38, 0xC3B4, 0x4E48, 0xC3B5, 0x73AB, 0xC3B6, 0x679A, 0xC3B7, 0x6885, 0xC3B8, 0x9176, 0xC3B9, 0x9709, + 0xC3BA, 0x7164, 0xC3BB, 0x6CA1, 0xC3BC, 0x7709, 0xC3BD, 0x5A92, 0xC3BE, 0x9541, 0xC3BF, 0x6BCF, 0xC3C0, 0x7F8E, 0xC3C1, 0x6627, + 0xC3C2, 0x5BD0, 0xC3C3, 0x59B9, 0xC3C4, 0x5A9A, 0xC3C5, 0x95E8, 0xC3C6, 0x95F7, 0xC3C7, 0x4EEC, 0xC3C8, 0x840C, 0xC3C9, 0x8499, + 0xC3CA, 0x6AAC, 0xC3CB, 0x76DF, 0xC3CC, 0x9530, 0xC3CD, 0x731B, 0xC3CE, 0x68A6, 0xC3CF, 0x5B5F, 0xC3D0, 0x772F, 0xC3D1, 0x919A, + 0xC3D2, 0x9761, 0xC3D3, 0x7CDC, 0xC3D4, 0x8FF7, 0xC3D5, 0x8C1C, 0xC3D6, 0x5F25, 0xC3D7, 0x7C73, 0xC3D8, 0x79D8, 0xC3D9, 0x89C5, + 0xC3DA, 0x6CCC, 0xC3DB, 0x871C, 0xC3DC, 0x5BC6, 0xC3DD, 0x5E42, 0xC3DE, 0x68C9, 0xC3DF, 0x7720, 0xC3E0, 0x7EF5, 0xC3E1, 0x5195, + 0xC3E2, 0x514D, 0xC3E3, 0x52C9, 0xC3E4, 0x5A29, 0xC3E5, 0x7F05, 0xC3E6, 0x9762, 0xC3E7, 0x82D7, 0xC3E8, 0x63CF, 0xC3E9, 0x7784, + 0xC3EA, 0x85D0, 0xC3EB, 0x79D2, 0xC3EC, 0x6E3A, 0xC3ED, 0x5E99, 0xC3EE, 0x5999, 0xC3EF, 0x8511, 0xC3F0, 0x706D, 0xC3F1, 0x6C11, + 0xC3F2, 0x62BF, 0xC3F3, 0x76BF, 0xC3F4, 0x654F, 0xC3F5, 0x60AF, 0xC3F6, 0x95FD, 0xC3F7, 0x660E, 0xC3F8, 0x879F, 0xC3F9, 0x9E23, + 0xC3FA, 0x94ED, 0xC3FB, 0x540D, 0xC3FC, 0x547D, 0xC3FD, 0x8C2C, 0xC3FE, 0x6478, 0xC440, 0x8140, 0xC441, 0x8141, 0xC442, 0x8142, + 0xC443, 0x8143, 0xC444, 0x8144, 0xC445, 0x8145, 0xC446, 0x8147, 0xC447, 0x8149, 0xC448, 0x814D, 0xC449, 0x814E, 0xC44A, 0x814F, + 0xC44B, 0x8152, 0xC44C, 0x8156, 0xC44D, 0x8157, 0xC44E, 0x8158, 0xC44F, 0x815B, 0xC450, 0x815C, 0xC451, 0x815D, 0xC452, 0x815E, + 0xC453, 0x815F, 0xC454, 0x8161, 0xC455, 0x8162, 0xC456, 0x8163, 0xC457, 0x8164, 0xC458, 0x8166, 0xC459, 0x8168, 0xC45A, 0x816A, + 0xC45B, 0x816B, 0xC45C, 0x816C, 0xC45D, 0x816F, 0xC45E, 0x8172, 0xC45F, 0x8173, 0xC460, 0x8175, 0xC461, 0x8176, 0xC462, 0x8177, + 0xC463, 0x8178, 0xC464, 0x8181, 0xC465, 0x8183, 0xC466, 0x8184, 0xC467, 0x8185, 0xC468, 0x8186, 0xC469, 0x8187, 0xC46A, 0x8189, + 0xC46B, 0x818B, 0xC46C, 0x818C, 0xC46D, 0x818D, 0xC46E, 0x818E, 0xC46F, 0x8190, 0xC470, 0x8192, 0xC471, 0x8193, 0xC472, 0x8194, + 0xC473, 0x8195, 0xC474, 0x8196, 0xC475, 0x8197, 0xC476, 0x8199, 0xC477, 0x819A, 0xC478, 0x819E, 0xC479, 0x819F, 0xC47A, 0x81A0, + 0xC47B, 0x81A1, 0xC47C, 0x81A2, 0xC47D, 0x81A4, 0xC47E, 0x81A5, 0xC480, 0x81A7, 0xC481, 0x81A9, 0xC482, 0x81AB, 0xC483, 0x81AC, + 0xC484, 0x81AD, 0xC485, 0x81AE, 0xC486, 0x81AF, 0xC487, 0x81B0, 0xC488, 0x81B1, 0xC489, 0x81B2, 0xC48A, 0x81B4, 0xC48B, 0x81B5, + 0xC48C, 0x81B6, 0xC48D, 0x81B7, 0xC48E, 0x81B8, 0xC48F, 0x81B9, 0xC490, 0x81BC, 0xC491, 0x81BD, 0xC492, 0x81BE, 0xC493, 0x81BF, + 0xC494, 0x81C4, 0xC495, 0x81C5, 0xC496, 0x81C7, 0xC497, 0x81C8, 0xC498, 0x81C9, 0xC499, 0x81CB, 0xC49A, 0x81CD, 0xC49B, 0x81CE, + 0xC49C, 0x81CF, 0xC49D, 0x81D0, 0xC49E, 0x81D1, 0xC49F, 0x81D2, 0xC4A0, 0x81D3, 0xC4A1, 0x6479, 0xC4A2, 0x8611, 0xC4A3, 0x6A21, + 0xC4A4, 0x819C, 0xC4A5, 0x78E8, 0xC4A6, 0x6469, 0xC4A7, 0x9B54, 0xC4A8, 0x62B9, 0xC4A9, 0x672B, 0xC4AA, 0x83AB, 0xC4AB, 0x58A8, + 0xC4AC, 0x9ED8, 0xC4AD, 0x6CAB, 0xC4AE, 0x6F20, 0xC4AF, 0x5BDE, 0xC4B0, 0x964C, 0xC4B1, 0x8C0B, 0xC4B2, 0x725F, 0xC4B3, 0x67D0, + 0xC4B4, 0x62C7, 0xC4B5, 0x7261, 0xC4B6, 0x4EA9, 0xC4B7, 0x59C6, 0xC4B8, 0x6BCD, 0xC4B9, 0x5893, 0xC4BA, 0x66AE, 0xC4BB, 0x5E55, + 0xC4BC, 0x52DF, 0xC4BD, 0x6155, 0xC4BE, 0x6728, 0xC4BF, 0x76EE, 0xC4C0, 0x7766, 0xC4C1, 0x7267, 0xC4C2, 0x7A46, 0xC4C3, 0x62FF, + 0xC4C4, 0x54EA, 0xC4C5, 0x5450, 0xC4C6, 0x94A0, 0xC4C7, 0x90A3, 0xC4C8, 0x5A1C, 0xC4C9, 0x7EB3, 0xC4CA, 0x6C16, 0xC4CB, 0x4E43, + 0xC4CC, 0x5976, 0xC4CD, 0x8010, 0xC4CE, 0x5948, 0xC4CF, 0x5357, 0xC4D0, 0x7537, 0xC4D1, 0x96BE, 0xC4D2, 0x56CA, 0xC4D3, 0x6320, + 0xC4D4, 0x8111, 0xC4D5, 0x607C, 0xC4D6, 0x95F9, 0xC4D7, 0x6DD6, 0xC4D8, 0x5462, 0xC4D9, 0x9981, 0xC4DA, 0x5185, 0xC4DB, 0x5AE9, + 0xC4DC, 0x80FD, 0xC4DD, 0x59AE, 0xC4DE, 0x9713, 0xC4DF, 0x502A, 0xC4E0, 0x6CE5, 0xC4E1, 0x5C3C, 0xC4E2, 0x62DF, 0xC4E3, 0x4F60, + 0xC4E4, 0x533F, 0xC4E5, 0x817B, 0xC4E6, 0x9006, 0xC4E7, 0x6EBA, 0xC4E8, 0x852B, 0xC4E9, 0x62C8, 0xC4EA, 0x5E74, 0xC4EB, 0x78BE, + 0xC4EC, 0x64B5, 0xC4ED, 0x637B, 0xC4EE, 0x5FF5, 0xC4EF, 0x5A18, 0xC4F0, 0x917F, 0xC4F1, 0x9E1F, 0xC4F2, 0x5C3F, 0xC4F3, 0x634F, + 0xC4F4, 0x8042, 0xC4F5, 0x5B7D, 0xC4F6, 0x556E, 0xC4F7, 0x954A, 0xC4F8, 0x954D, 0xC4F9, 0x6D85, 0xC4FA, 0x60A8, 0xC4FB, 0x67E0, + 0xC4FC, 0x72DE, 0xC4FD, 0x51DD, 0xC4FE, 0x5B81, 0xC540, 0x81D4, 0xC541, 0x81D5, 0xC542, 0x81D6, 0xC543, 0x81D7, 0xC544, 0x81D8, + 0xC545, 0x81D9, 0xC546, 0x81DA, 0xC547, 0x81DB, 0xC548, 0x81DC, 0xC549, 0x81DD, 0xC54A, 0x81DE, 0xC54B, 0x81DF, 0xC54C, 0x81E0, + 0xC54D, 0x81E1, 0xC54E, 0x81E2, 0xC54F, 0x81E4, 0xC550, 0x81E5, 0xC551, 0x81E6, 0xC552, 0x81E8, 0xC553, 0x81E9, 0xC554, 0x81EB, + 0xC555, 0x81EE, 0xC556, 0x81EF, 0xC557, 0x81F0, 0xC558, 0x81F1, 0xC559, 0x81F2, 0xC55A, 0x81F5, 0xC55B, 0x81F6, 0xC55C, 0x81F7, + 0xC55D, 0x81F8, 0xC55E, 0x81F9, 0xC55F, 0x81FA, 0xC560, 0x81FD, 0xC561, 0x81FF, 0xC562, 0x8203, 0xC563, 0x8207, 0xC564, 0x8208, + 0xC565, 0x8209, 0xC566, 0x820A, 0xC567, 0x820B, 0xC568, 0x820E, 0xC569, 0x820F, 0xC56A, 0x8211, 0xC56B, 0x8213, 0xC56C, 0x8215, + 0xC56D, 0x8216, 0xC56E, 0x8217, 0xC56F, 0x8218, 0xC570, 0x8219, 0xC571, 0x821A, 0xC572, 0x821D, 0xC573, 0x8220, 0xC574, 0x8224, + 0xC575, 0x8225, 0xC576, 0x8226, 0xC577, 0x8227, 0xC578, 0x8229, 0xC579, 0x822E, 0xC57A, 0x8232, 0xC57B, 0x823A, 0xC57C, 0x823C, + 0xC57D, 0x823D, 0xC57E, 0x823F, 0xC580, 0x8240, 0xC581, 0x8241, 0xC582, 0x8242, 0xC583, 0x8243, 0xC584, 0x8245, 0xC585, 0x8246, + 0xC586, 0x8248, 0xC587, 0x824A, 0xC588, 0x824C, 0xC589, 0x824D, 0xC58A, 0x824E, 0xC58B, 0x8250, 0xC58C, 0x8251, 0xC58D, 0x8252, + 0xC58E, 0x8253, 0xC58F, 0x8254, 0xC590, 0x8255, 0xC591, 0x8256, 0xC592, 0x8257, 0xC593, 0x8259, 0xC594, 0x825B, 0xC595, 0x825C, + 0xC596, 0x825D, 0xC597, 0x825E, 0xC598, 0x8260, 0xC599, 0x8261, 0xC59A, 0x8262, 0xC59B, 0x8263, 0xC59C, 0x8264, 0xC59D, 0x8265, + 0xC59E, 0x8266, 0xC59F, 0x8267, 0xC5A0, 0x8269, 0xC5A1, 0x62E7, 0xC5A2, 0x6CDE, 0xC5A3, 0x725B, 0xC5A4, 0x626D, 0xC5A5, 0x94AE, + 0xC5A6, 0x7EBD, 0xC5A7, 0x8113, 0xC5A8, 0x6D53, 0xC5A9, 0x519C, 0xC5AA, 0x5F04, 0xC5AB, 0x5974, 0xC5AC, 0x52AA, 0xC5AD, 0x6012, + 0xC5AE, 0x5973, 0xC5AF, 0x6696, 0xC5B0, 0x8650, 0xC5B1, 0x759F, 0xC5B2, 0x632A, 0xC5B3, 0x61E6, 0xC5B4, 0x7CEF, 0xC5B5, 0x8BFA, + 0xC5B6, 0x54E6, 0xC5B7, 0x6B27, 0xC5B8, 0x9E25, 0xC5B9, 0x6BB4, 0xC5BA, 0x85D5, 0xC5BB, 0x5455, 0xC5BC, 0x5076, 0xC5BD, 0x6CA4, + 0xC5BE, 0x556A, 0xC5BF, 0x8DB4, 0xC5C0, 0x722C, 0xC5C1, 0x5E15, 0xC5C2, 0x6015, 0xC5C3, 0x7436, 0xC5C4, 0x62CD, 0xC5C5, 0x6392, + 0xC5C6, 0x724C, 0xC5C7, 0x5F98, 0xC5C8, 0x6E43, 0xC5C9, 0x6D3E, 0xC5CA, 0x6500, 0xC5CB, 0x6F58, 0xC5CC, 0x76D8, 0xC5CD, 0x78D0, + 0xC5CE, 0x76FC, 0xC5CF, 0x7554, 0xC5D0, 0x5224, 0xC5D1, 0x53DB, 0xC5D2, 0x4E53, 0xC5D3, 0x5E9E, 0xC5D4, 0x65C1, 0xC5D5, 0x802A, + 0xC5D6, 0x80D6, 0xC5D7, 0x629B, 0xC5D8, 0x5486, 0xC5D9, 0x5228, 0xC5DA, 0x70AE, 0xC5DB, 0x888D, 0xC5DC, 0x8DD1, 0xC5DD, 0x6CE1, + 0xC5DE, 0x5478, 0xC5DF, 0x80DA, 0xC5E0, 0x57F9, 0xC5E1, 0x88F4, 0xC5E2, 0x8D54, 0xC5E3, 0x966A, 0xC5E4, 0x914D, 0xC5E5, 0x4F69, + 0xC5E6, 0x6C9B, 0xC5E7, 0x55B7, 0xC5E8, 0x76C6, 0xC5E9, 0x7830, 0xC5EA, 0x62A8, 0xC5EB, 0x70F9, 0xC5EC, 0x6F8E, 0xC5ED, 0x5F6D, + 0xC5EE, 0x84EC, 0xC5EF, 0x68DA, 0xC5F0, 0x787C, 0xC5F1, 0x7BF7, 0xC5F2, 0x81A8, 0xC5F3, 0x670B, 0xC5F4, 0x9E4F, 0xC5F5, 0x6367, + 0xC5F6, 0x78B0, 0xC5F7, 0x576F, 0xC5F8, 0x7812, 0xC5F9, 0x9739, 0xC5FA, 0x6279, 0xC5FB, 0x62AB, 0xC5FC, 0x5288, 0xC5FD, 0x7435, + 0xC5FE, 0x6BD7, 0xC640, 0x826A, 0xC641, 0x826B, 0xC642, 0x826C, 0xC643, 0x826D, 0xC644, 0x8271, 0xC645, 0x8275, 0xC646, 0x8276, + 0xC647, 0x8277, 0xC648, 0x8278, 0xC649, 0x827B, 0xC64A, 0x827C, 0xC64B, 0x8280, 0xC64C, 0x8281, 0xC64D, 0x8283, 0xC64E, 0x8285, + 0xC64F, 0x8286, 0xC650, 0x8287, 0xC651, 0x8289, 0xC652, 0x828C, 0xC653, 0x8290, 0xC654, 0x8293, 0xC655, 0x8294, 0xC656, 0x8295, + 0xC657, 0x8296, 0xC658, 0x829A, 0xC659, 0x829B, 0xC65A, 0x829E, 0xC65B, 0x82A0, 0xC65C, 0x82A2, 0xC65D, 0x82A3, 0xC65E, 0x82A7, + 0xC65F, 0x82B2, 0xC660, 0x82B5, 0xC661, 0x82B6, 0xC662, 0x82BA, 0xC663, 0x82BB, 0xC664, 0x82BC, 0xC665, 0x82BF, 0xC666, 0x82C0, + 0xC667, 0x82C2, 0xC668, 0x82C3, 0xC669, 0x82C5, 0xC66A, 0x82C6, 0xC66B, 0x82C9, 0xC66C, 0x82D0, 0xC66D, 0x82D6, 0xC66E, 0x82D9, + 0xC66F, 0x82DA, 0xC670, 0x82DD, 0xC671, 0x82E2, 0xC672, 0x82E7, 0xC673, 0x82E8, 0xC674, 0x82E9, 0xC675, 0x82EA, 0xC676, 0x82EC, + 0xC677, 0x82ED, 0xC678, 0x82EE, 0xC679, 0x82F0, 0xC67A, 0x82F2, 0xC67B, 0x82F3, 0xC67C, 0x82F5, 0xC67D, 0x82F6, 0xC67E, 0x82F8, + 0xC680, 0x82FA, 0xC681, 0x82FC, 0xC682, 0x82FD, 0xC683, 0x82FE, 0xC684, 0x82FF, 0xC685, 0x8300, 0xC686, 0x830A, 0xC687, 0x830B, + 0xC688, 0x830D, 0xC689, 0x8310, 0xC68A, 0x8312, 0xC68B, 0x8313, 0xC68C, 0x8316, 0xC68D, 0x8318, 0xC68E, 0x8319, 0xC68F, 0x831D, + 0xC690, 0x831E, 0xC691, 0x831F, 0xC692, 0x8320, 0xC693, 0x8321, 0xC694, 0x8322, 0xC695, 0x8323, 0xC696, 0x8324, 0xC697, 0x8325, + 0xC698, 0x8326, 0xC699, 0x8329, 0xC69A, 0x832A, 0xC69B, 0x832E, 0xC69C, 0x8330, 0xC69D, 0x8332, 0xC69E, 0x8337, 0xC69F, 0x833B, + 0xC6A0, 0x833D, 0xC6A1, 0x5564, 0xC6A2, 0x813E, 0xC6A3, 0x75B2, 0xC6A4, 0x76AE, 0xC6A5, 0x5339, 0xC6A6, 0x75DE, 0xC6A7, 0x50FB, + 0xC6A8, 0x5C41, 0xC6A9, 0x8B6C, 0xC6AA, 0x7BC7, 0xC6AB, 0x504F, 0xC6AC, 0x7247, 0xC6AD, 0x9A97, 0xC6AE, 0x98D8, 0xC6AF, 0x6F02, + 0xC6B0, 0x74E2, 0xC6B1, 0x7968, 0xC6B2, 0x6487, 0xC6B3, 0x77A5, 0xC6B4, 0x62FC, 0xC6B5, 0x9891, 0xC6B6, 0x8D2B, 0xC6B7, 0x54C1, + 0xC6B8, 0x8058, 0xC6B9, 0x4E52, 0xC6BA, 0x576A, 0xC6BB, 0x82F9, 0xC6BC, 0x840D, 0xC6BD, 0x5E73, 0xC6BE, 0x51ED, 0xC6BF, 0x74F6, + 0xC6C0, 0x8BC4, 0xC6C1, 0x5C4F, 0xC6C2, 0x5761, 0xC6C3, 0x6CFC, 0xC6C4, 0x9887, 0xC6C5, 0x5A46, 0xC6C6, 0x7834, 0xC6C7, 0x9B44, + 0xC6C8, 0x8FEB, 0xC6C9, 0x7C95, 0xC6CA, 0x5256, 0xC6CB, 0x6251, 0xC6CC, 0x94FA, 0xC6CD, 0x4EC6, 0xC6CE, 0x8386, 0xC6CF, 0x8461, + 0xC6D0, 0x83E9, 0xC6D1, 0x84B2, 0xC6D2, 0x57D4, 0xC6D3, 0x6734, 0xC6D4, 0x5703, 0xC6D5, 0x666E, 0xC6D6, 0x6D66, 0xC6D7, 0x8C31, + 0xC6D8, 0x66DD, 0xC6D9, 0x7011, 0xC6DA, 0x671F, 0xC6DB, 0x6B3A, 0xC6DC, 0x6816, 0xC6DD, 0x621A, 0xC6DE, 0x59BB, 0xC6DF, 0x4E03, + 0xC6E0, 0x51C4, 0xC6E1, 0x6F06, 0xC6E2, 0x67D2, 0xC6E3, 0x6C8F, 0xC6E4, 0x5176, 0xC6E5, 0x68CB, 0xC6E6, 0x5947, 0xC6E7, 0x6B67, + 0xC6E8, 0x7566, 0xC6E9, 0x5D0E, 0xC6EA, 0x8110, 0xC6EB, 0x9F50, 0xC6EC, 0x65D7, 0xC6ED, 0x7948, 0xC6EE, 0x7941, 0xC6EF, 0x9A91, + 0xC6F0, 0x8D77, 0xC6F1, 0x5C82, 0xC6F2, 0x4E5E, 0xC6F3, 0x4F01, 0xC6F4, 0x542F, 0xC6F5, 0x5951, 0xC6F6, 0x780C, 0xC6F7, 0x5668, + 0xC6F8, 0x6C14, 0xC6F9, 0x8FC4, 0xC6FA, 0x5F03, 0xC6FB, 0x6C7D, 0xC6FC, 0x6CE3, 0xC6FD, 0x8BAB, 0xC6FE, 0x6390, 0xC740, 0x833E, + 0xC741, 0x833F, 0xC742, 0x8341, 0xC743, 0x8342, 0xC744, 0x8344, 0xC745, 0x8345, 0xC746, 0x8348, 0xC747, 0x834A, 0xC748, 0x834B, + 0xC749, 0x834C, 0xC74A, 0x834D, 0xC74B, 0x834E, 0xC74C, 0x8353, 0xC74D, 0x8355, 0xC74E, 0x8356, 0xC74F, 0x8357, 0xC750, 0x8358, + 0xC751, 0x8359, 0xC752, 0x835D, 0xC753, 0x8362, 0xC754, 0x8370, 0xC755, 0x8371, 0xC756, 0x8372, 0xC757, 0x8373, 0xC758, 0x8374, + 0xC759, 0x8375, 0xC75A, 0x8376, 0xC75B, 0x8379, 0xC75C, 0x837A, 0xC75D, 0x837E, 0xC75E, 0x837F, 0xC75F, 0x8380, 0xC760, 0x8381, + 0xC761, 0x8382, 0xC762, 0x8383, 0xC763, 0x8384, 0xC764, 0x8387, 0xC765, 0x8388, 0xC766, 0x838A, 0xC767, 0x838B, 0xC768, 0x838C, + 0xC769, 0x838D, 0xC76A, 0x838F, 0xC76B, 0x8390, 0xC76C, 0x8391, 0xC76D, 0x8394, 0xC76E, 0x8395, 0xC76F, 0x8396, 0xC770, 0x8397, + 0xC771, 0x8399, 0xC772, 0x839A, 0xC773, 0x839D, 0xC774, 0x839F, 0xC775, 0x83A1, 0xC776, 0x83A2, 0xC777, 0x83A3, 0xC778, 0x83A4, + 0xC779, 0x83A5, 0xC77A, 0x83A6, 0xC77B, 0x83A7, 0xC77C, 0x83AC, 0xC77D, 0x83AD, 0xC77E, 0x83AE, 0xC780, 0x83AF, 0xC781, 0x83B5, + 0xC782, 0x83BB, 0xC783, 0x83BE, 0xC784, 0x83BF, 0xC785, 0x83C2, 0xC786, 0x83C3, 0xC787, 0x83C4, 0xC788, 0x83C6, 0xC789, 0x83C8, + 0xC78A, 0x83C9, 0xC78B, 0x83CB, 0xC78C, 0x83CD, 0xC78D, 0x83CE, 0xC78E, 0x83D0, 0xC78F, 0x83D1, 0xC790, 0x83D2, 0xC791, 0x83D3, + 0xC792, 0x83D5, 0xC793, 0x83D7, 0xC794, 0x83D9, 0xC795, 0x83DA, 0xC796, 0x83DB, 0xC797, 0x83DE, 0xC798, 0x83E2, 0xC799, 0x83E3, + 0xC79A, 0x83E4, 0xC79B, 0x83E6, 0xC79C, 0x83E7, 0xC79D, 0x83E8, 0xC79E, 0x83EB, 0xC79F, 0x83EC, 0xC7A0, 0x83ED, 0xC7A1, 0x6070, + 0xC7A2, 0x6D3D, 0xC7A3, 0x7275, 0xC7A4, 0x6266, 0xC7A5, 0x948E, 0xC7A6, 0x94C5, 0xC7A7, 0x5343, 0xC7A8, 0x8FC1, 0xC7A9, 0x7B7E, + 0xC7AA, 0x4EDF, 0xC7AB, 0x8C26, 0xC7AC, 0x4E7E, 0xC7AD, 0x9ED4, 0xC7AE, 0x94B1, 0xC7AF, 0x94B3, 0xC7B0, 0x524D, 0xC7B1, 0x6F5C, + 0xC7B2, 0x9063, 0xC7B3, 0x6D45, 0xC7B4, 0x8C34, 0xC7B5, 0x5811, 0xC7B6, 0x5D4C, 0xC7B7, 0x6B20, 0xC7B8, 0x6B49, 0xC7B9, 0x67AA, + 0xC7BA, 0x545B, 0xC7BB, 0x8154, 0xC7BC, 0x7F8C, 0xC7BD, 0x5899, 0xC7BE, 0x8537, 0xC7BF, 0x5F3A, 0xC7C0, 0x62A2, 0xC7C1, 0x6A47, + 0xC7C2, 0x9539, 0xC7C3, 0x6572, 0xC7C4, 0x6084, 0xC7C5, 0x6865, 0xC7C6, 0x77A7, 0xC7C7, 0x4E54, 0xC7C8, 0x4FA8, 0xC7C9, 0x5DE7, + 0xC7CA, 0x9798, 0xC7CB, 0x64AC, 0xC7CC, 0x7FD8, 0xC7CD, 0x5CED, 0xC7CE, 0x4FCF, 0xC7CF, 0x7A8D, 0xC7D0, 0x5207, 0xC7D1, 0x8304, + 0xC7D2, 0x4E14, 0xC7D3, 0x602F, 0xC7D4, 0x7A83, 0xC7D5, 0x94A6, 0xC7D6, 0x4FB5, 0xC7D7, 0x4EB2, 0xC7D8, 0x79E6, 0xC7D9, 0x7434, + 0xC7DA, 0x52E4, 0xC7DB, 0x82B9, 0xC7DC, 0x64D2, 0xC7DD, 0x79BD, 0xC7DE, 0x5BDD, 0xC7DF, 0x6C81, 0xC7E0, 0x9752, 0xC7E1, 0x8F7B, + 0xC7E2, 0x6C22, 0xC7E3, 0x503E, 0xC7E4, 0x537F, 0xC7E5, 0x6E05, 0xC7E6, 0x64CE, 0xC7E7, 0x6674, 0xC7E8, 0x6C30, 0xC7E9, 0x60C5, + 0xC7EA, 0x9877, 0xC7EB, 0x8BF7, 0xC7EC, 0x5E86, 0xC7ED, 0x743C, 0xC7EE, 0x7A77, 0xC7EF, 0x79CB, 0xC7F0, 0x4E18, 0xC7F1, 0x90B1, + 0xC7F2, 0x7403, 0xC7F3, 0x6C42, 0xC7F4, 0x56DA, 0xC7F5, 0x914B, 0xC7F6, 0x6CC5, 0xC7F7, 0x8D8B, 0xC7F8, 0x533A, 0xC7F9, 0x86C6, + 0xC7FA, 0x66F2, 0xC7FB, 0x8EAF, 0xC7FC, 0x5C48, 0xC7FD, 0x9A71, 0xC7FE, 0x6E20, 0xC840, 0x83EE, 0xC841, 0x83EF, 0xC842, 0x83F3, + 0xC843, 0x83F4, 0xC844, 0x83F5, 0xC845, 0x83F6, 0xC846, 0x83F7, 0xC847, 0x83FA, 0xC848, 0x83FB, 0xC849, 0x83FC, 0xC84A, 0x83FE, + 0xC84B, 0x83FF, 0xC84C, 0x8400, 0xC84D, 0x8402, 0xC84E, 0x8405, 0xC84F, 0x8407, 0xC850, 0x8408, 0xC851, 0x8409, 0xC852, 0x840A, + 0xC853, 0x8410, 0xC854, 0x8412, 0xC855, 0x8413, 0xC856, 0x8414, 0xC857, 0x8415, 0xC858, 0x8416, 0xC859, 0x8417, 0xC85A, 0x8419, + 0xC85B, 0x841A, 0xC85C, 0x841B, 0xC85D, 0x841E, 0xC85E, 0x841F, 0xC85F, 0x8420, 0xC860, 0x8421, 0xC861, 0x8422, 0xC862, 0x8423, + 0xC863, 0x8429, 0xC864, 0x842A, 0xC865, 0x842B, 0xC866, 0x842C, 0xC867, 0x842D, 0xC868, 0x842E, 0xC869, 0x842F, 0xC86A, 0x8430, + 0xC86B, 0x8432, 0xC86C, 0x8433, 0xC86D, 0x8434, 0xC86E, 0x8435, 0xC86F, 0x8436, 0xC870, 0x8437, 0xC871, 0x8439, 0xC872, 0x843A, + 0xC873, 0x843B, 0xC874, 0x843E, 0xC875, 0x843F, 0xC876, 0x8440, 0xC877, 0x8441, 0xC878, 0x8442, 0xC879, 0x8443, 0xC87A, 0x8444, + 0xC87B, 0x8445, 0xC87C, 0x8447, 0xC87D, 0x8448, 0xC87E, 0x8449, 0xC880, 0x844A, 0xC881, 0x844B, 0xC882, 0x844C, 0xC883, 0x844D, + 0xC884, 0x844E, 0xC885, 0x844F, 0xC886, 0x8450, 0xC887, 0x8452, 0xC888, 0x8453, 0xC889, 0x8454, 0xC88A, 0x8455, 0xC88B, 0x8456, + 0xC88C, 0x8458, 0xC88D, 0x845D, 0xC88E, 0x845E, 0xC88F, 0x845F, 0xC890, 0x8460, 0xC891, 0x8462, 0xC892, 0x8464, 0xC893, 0x8465, + 0xC894, 0x8466, 0xC895, 0x8467, 0xC896, 0x8468, 0xC897, 0x846A, 0xC898, 0x846E, 0xC899, 0x846F, 0xC89A, 0x8470, 0xC89B, 0x8472, + 0xC89C, 0x8474, 0xC89D, 0x8477, 0xC89E, 0x8479, 0xC89F, 0x847B, 0xC8A0, 0x847C, 0xC8A1, 0x53D6, 0xC8A2, 0x5A36, 0xC8A3, 0x9F8B, + 0xC8A4, 0x8DA3, 0xC8A5, 0x53BB, 0xC8A6, 0x5708, 0xC8A7, 0x98A7, 0xC8A8, 0x6743, 0xC8A9, 0x919B, 0xC8AA, 0x6CC9, 0xC8AB, 0x5168, + 0xC8AC, 0x75CA, 0xC8AD, 0x62F3, 0xC8AE, 0x72AC, 0xC8AF, 0x5238, 0xC8B0, 0x529D, 0xC8B1, 0x7F3A, 0xC8B2, 0x7094, 0xC8B3, 0x7638, + 0xC8B4, 0x5374, 0xC8B5, 0x9E4A, 0xC8B6, 0x69B7, 0xC8B7, 0x786E, 0xC8B8, 0x96C0, 0xC8B9, 0x88D9, 0xC8BA, 0x7FA4, 0xC8BB, 0x7136, + 0xC8BC, 0x71C3, 0xC8BD, 0x5189, 0xC8BE, 0x67D3, 0xC8BF, 0x74E4, 0xC8C0, 0x58E4, 0xC8C1, 0x6518, 0xC8C2, 0x56B7, 0xC8C3, 0x8BA9, + 0xC8C4, 0x9976, 0xC8C5, 0x6270, 0xC8C6, 0x7ED5, 0xC8C7, 0x60F9, 0xC8C8, 0x70ED, 0xC8C9, 0x58EC, 0xC8CA, 0x4EC1, 0xC8CB, 0x4EBA, + 0xC8CC, 0x5FCD, 0xC8CD, 0x97E7, 0xC8CE, 0x4EFB, 0xC8CF, 0x8BA4, 0xC8D0, 0x5203, 0xC8D1, 0x598A, 0xC8D2, 0x7EAB, 0xC8D3, 0x6254, + 0xC8D4, 0x4ECD, 0xC8D5, 0x65E5, 0xC8D6, 0x620E, 0xC8D7, 0x8338, 0xC8D8, 0x84C9, 0xC8D9, 0x8363, 0xC8DA, 0x878D, 0xC8DB, 0x7194, + 0xC8DC, 0x6EB6, 0xC8DD, 0x5BB9, 0xC8DE, 0x7ED2, 0xC8DF, 0x5197, 0xC8E0, 0x63C9, 0xC8E1, 0x67D4, 0xC8E2, 0x8089, 0xC8E3, 0x8339, + 0xC8E4, 0x8815, 0xC8E5, 0x5112, 0xC8E6, 0x5B7A, 0xC8E7, 0x5982, 0xC8E8, 0x8FB1, 0xC8E9, 0x4E73, 0xC8EA, 0x6C5D, 0xC8EB, 0x5165, + 0xC8EC, 0x8925, 0xC8ED, 0x8F6F, 0xC8EE, 0x962E, 0xC8EF, 0x854A, 0xC8F0, 0x745E, 0xC8F1, 0x9510, 0xC8F2, 0x95F0, 0xC8F3, 0x6DA6, + 0xC8F4, 0x82E5, 0xC8F5, 0x5F31, 0xC8F6, 0x6492, 0xC8F7, 0x6D12, 0xC8F8, 0x8428, 0xC8F9, 0x816E, 0xC8FA, 0x9CC3, 0xC8FB, 0x585E, + 0xC8FC, 0x8D5B, 0xC8FD, 0x4E09, 0xC8FE, 0x53C1, 0xC940, 0x847D, 0xC941, 0x847E, 0xC942, 0x847F, 0xC943, 0x8480, 0xC944, 0x8481, + 0xC945, 0x8483, 0xC946, 0x8484, 0xC947, 0x8485, 0xC948, 0x8486, 0xC949, 0x848A, 0xC94A, 0x848D, 0xC94B, 0x848F, 0xC94C, 0x8490, + 0xC94D, 0x8491, 0xC94E, 0x8492, 0xC94F, 0x8493, 0xC950, 0x8494, 0xC951, 0x8495, 0xC952, 0x8496, 0xC953, 0x8498, 0xC954, 0x849A, + 0xC955, 0x849B, 0xC956, 0x849D, 0xC957, 0x849E, 0xC958, 0x849F, 0xC959, 0x84A0, 0xC95A, 0x84A2, 0xC95B, 0x84A3, 0xC95C, 0x84A4, + 0xC95D, 0x84A5, 0xC95E, 0x84A6, 0xC95F, 0x84A7, 0xC960, 0x84A8, 0xC961, 0x84A9, 0xC962, 0x84AA, 0xC963, 0x84AB, 0xC964, 0x84AC, + 0xC965, 0x84AD, 0xC966, 0x84AE, 0xC967, 0x84B0, 0xC968, 0x84B1, 0xC969, 0x84B3, 0xC96A, 0x84B5, 0xC96B, 0x84B6, 0xC96C, 0x84B7, + 0xC96D, 0x84BB, 0xC96E, 0x84BC, 0xC96F, 0x84BE, 0xC970, 0x84C0, 0xC971, 0x84C2, 0xC972, 0x84C3, 0xC973, 0x84C5, 0xC974, 0x84C6, + 0xC975, 0x84C7, 0xC976, 0x84C8, 0xC977, 0x84CB, 0xC978, 0x84CC, 0xC979, 0x84CE, 0xC97A, 0x84CF, 0xC97B, 0x84D2, 0xC97C, 0x84D4, + 0xC97D, 0x84D5, 0xC97E, 0x84D7, 0xC980, 0x84D8, 0xC981, 0x84D9, 0xC982, 0x84DA, 0xC983, 0x84DB, 0xC984, 0x84DC, 0xC985, 0x84DE, + 0xC986, 0x84E1, 0xC987, 0x84E2, 0xC988, 0x84E4, 0xC989, 0x84E7, 0xC98A, 0x84E8, 0xC98B, 0x84E9, 0xC98C, 0x84EA, 0xC98D, 0x84EB, + 0xC98E, 0x84ED, 0xC98F, 0x84EE, 0xC990, 0x84EF, 0xC991, 0x84F1, 0xC992, 0x84F2, 0xC993, 0x84F3, 0xC994, 0x84F4, 0xC995, 0x84F5, + 0xC996, 0x84F6, 0xC997, 0x84F7, 0xC998, 0x84F8, 0xC999, 0x84F9, 0xC99A, 0x84FA, 0xC99B, 0x84FB, 0xC99C, 0x84FD, 0xC99D, 0x84FE, + 0xC99E, 0x8500, 0xC99F, 0x8501, 0xC9A0, 0x8502, 0xC9A1, 0x4F1E, 0xC9A2, 0x6563, 0xC9A3, 0x6851, 0xC9A4, 0x55D3, 0xC9A5, 0x4E27, + 0xC9A6, 0x6414, 0xC9A7, 0x9A9A, 0xC9A8, 0x626B, 0xC9A9, 0x5AC2, 0xC9AA, 0x745F, 0xC9AB, 0x8272, 0xC9AC, 0x6DA9, 0xC9AD, 0x68EE, + 0xC9AE, 0x50E7, 0xC9AF, 0x838E, 0xC9B0, 0x7802, 0xC9B1, 0x6740, 0xC9B2, 0x5239, 0xC9B3, 0x6C99, 0xC9B4, 0x7EB1, 0xC9B5, 0x50BB, + 0xC9B6, 0x5565, 0xC9B7, 0x715E, 0xC9B8, 0x7B5B, 0xC9B9, 0x6652, 0xC9BA, 0x73CA, 0xC9BB, 0x82EB, 0xC9BC, 0x6749, 0xC9BD, 0x5C71, + 0xC9BE, 0x5220, 0xC9BF, 0x717D, 0xC9C0, 0x886B, 0xC9C1, 0x95EA, 0xC9C2, 0x9655, 0xC9C3, 0x64C5, 0xC9C4, 0x8D61, 0xC9C5, 0x81B3, + 0xC9C6, 0x5584, 0xC9C7, 0x6C55, 0xC9C8, 0x6247, 0xC9C9, 0x7F2E, 0xC9CA, 0x5892, 0xC9CB, 0x4F24, 0xC9CC, 0x5546, 0xC9CD, 0x8D4F, + 0xC9CE, 0x664C, 0xC9CF, 0x4E0A, 0xC9D0, 0x5C1A, 0xC9D1, 0x88F3, 0xC9D2, 0x68A2, 0xC9D3, 0x634E, 0xC9D4, 0x7A0D, 0xC9D5, 0x70E7, + 0xC9D6, 0x828D, 0xC9D7, 0x52FA, 0xC9D8, 0x97F6, 0xC9D9, 0x5C11, 0xC9DA, 0x54E8, 0xC9DB, 0x90B5, 0xC9DC, 0x7ECD, 0xC9DD, 0x5962, + 0xC9DE, 0x8D4A, 0xC9DF, 0x86C7, 0xC9E0, 0x820C, 0xC9E1, 0x820D, 0xC9E2, 0x8D66, 0xC9E3, 0x6444, 0xC9E4, 0x5C04, 0xC9E5, 0x6151, + 0xC9E6, 0x6D89, 0xC9E7, 0x793E, 0xC9E8, 0x8BBE, 0xC9E9, 0x7837, 0xC9EA, 0x7533, 0xC9EB, 0x547B, 0xC9EC, 0x4F38, 0xC9ED, 0x8EAB, + 0xC9EE, 0x6DF1, 0xC9EF, 0x5A20, 0xC9F0, 0x7EC5, 0xC9F1, 0x795E, 0xC9F2, 0x6C88, 0xC9F3, 0x5BA1, 0xC9F4, 0x5A76, 0xC9F5, 0x751A, + 0xC9F6, 0x80BE, 0xC9F7, 0x614E, 0xC9F8, 0x6E17, 0xC9F9, 0x58F0, 0xC9FA, 0x751F, 0xC9FB, 0x7525, 0xC9FC, 0x7272, 0xC9FD, 0x5347, + 0xC9FE, 0x7EF3, 0xCA40, 0x8503, 0xCA41, 0x8504, 0xCA42, 0x8505, 0xCA43, 0x8506, 0xCA44, 0x8507, 0xCA45, 0x8508, 0xCA46, 0x8509, + 0xCA47, 0x850A, 0xCA48, 0x850B, 0xCA49, 0x850D, 0xCA4A, 0x850E, 0xCA4B, 0x850F, 0xCA4C, 0x8510, 0xCA4D, 0x8512, 0xCA4E, 0x8514, + 0xCA4F, 0x8515, 0xCA50, 0x8516, 0xCA51, 0x8518, 0xCA52, 0x8519, 0xCA53, 0x851B, 0xCA54, 0x851C, 0xCA55, 0x851D, 0xCA56, 0x851E, + 0xCA57, 0x8520, 0xCA58, 0x8522, 0xCA59, 0x8523, 0xCA5A, 0x8524, 0xCA5B, 0x8525, 0xCA5C, 0x8526, 0xCA5D, 0x8527, 0xCA5E, 0x8528, + 0xCA5F, 0x8529, 0xCA60, 0x852A, 0xCA61, 0x852D, 0xCA62, 0x852E, 0xCA63, 0x852F, 0xCA64, 0x8530, 0xCA65, 0x8531, 0xCA66, 0x8532, + 0xCA67, 0x8533, 0xCA68, 0x8534, 0xCA69, 0x8535, 0xCA6A, 0x8536, 0xCA6B, 0x853E, 0xCA6C, 0x853F, 0xCA6D, 0x8540, 0xCA6E, 0x8541, + 0xCA6F, 0x8542, 0xCA70, 0x8544, 0xCA71, 0x8545, 0xCA72, 0x8546, 0xCA73, 0x8547, 0xCA74, 0x854B, 0xCA75, 0x854C, 0xCA76, 0x854D, + 0xCA77, 0x854E, 0xCA78, 0x854F, 0xCA79, 0x8550, 0xCA7A, 0x8551, 0xCA7B, 0x8552, 0xCA7C, 0x8553, 0xCA7D, 0x8554, 0xCA7E, 0x8555, + 0xCA80, 0x8557, 0xCA81, 0x8558, 0xCA82, 0x855A, 0xCA83, 0x855B, 0xCA84, 0x855C, 0xCA85, 0x855D, 0xCA86, 0x855F, 0xCA87, 0x8560, + 0xCA88, 0x8561, 0xCA89, 0x8562, 0xCA8A, 0x8563, 0xCA8B, 0x8565, 0xCA8C, 0x8566, 0xCA8D, 0x8567, 0xCA8E, 0x8569, 0xCA8F, 0x856A, + 0xCA90, 0x856B, 0xCA91, 0x856C, 0xCA92, 0x856D, 0xCA93, 0x856E, 0xCA94, 0x856F, 0xCA95, 0x8570, 0xCA96, 0x8571, 0xCA97, 0x8573, + 0xCA98, 0x8575, 0xCA99, 0x8576, 0xCA9A, 0x8577, 0xCA9B, 0x8578, 0xCA9C, 0x857C, 0xCA9D, 0x857D, 0xCA9E, 0x857F, 0xCA9F, 0x8580, + 0xCAA0, 0x8581, 0xCAA1, 0x7701, 0xCAA2, 0x76DB, 0xCAA3, 0x5269, 0xCAA4, 0x80DC, 0xCAA5, 0x5723, 0xCAA6, 0x5E08, 0xCAA7, 0x5931, + 0xCAA8, 0x72EE, 0xCAA9, 0x65BD, 0xCAAA, 0x6E7F, 0xCAAB, 0x8BD7, 0xCAAC, 0x5C38, 0xCAAD, 0x8671, 0xCAAE, 0x5341, 0xCAAF, 0x77F3, + 0xCAB0, 0x62FE, 0xCAB1, 0x65F6, 0xCAB2, 0x4EC0, 0xCAB3, 0x98DF, 0xCAB4, 0x8680, 0xCAB5, 0x5B9E, 0xCAB6, 0x8BC6, 0xCAB7, 0x53F2, + 0xCAB8, 0x77E2, 0xCAB9, 0x4F7F, 0xCABA, 0x5C4E, 0xCABB, 0x9A76, 0xCABC, 0x59CB, 0xCABD, 0x5F0F, 0xCABE, 0x793A, 0xCABF, 0x58EB, + 0xCAC0, 0x4E16, 0xCAC1, 0x67FF, 0xCAC2, 0x4E8B, 0xCAC3, 0x62ED, 0xCAC4, 0x8A93, 0xCAC5, 0x901D, 0xCAC6, 0x52BF, 0xCAC7, 0x662F, + 0xCAC8, 0x55DC, 0xCAC9, 0x566C, 0xCACA, 0x9002, 0xCACB, 0x4ED5, 0xCACC, 0x4F8D, 0xCACD, 0x91CA, 0xCACE, 0x9970, 0xCACF, 0x6C0F, + 0xCAD0, 0x5E02, 0xCAD1, 0x6043, 0xCAD2, 0x5BA4, 0xCAD3, 0x89C6, 0xCAD4, 0x8BD5, 0xCAD5, 0x6536, 0xCAD6, 0x624B, 0xCAD7, 0x9996, + 0xCAD8, 0x5B88, 0xCAD9, 0x5BFF, 0xCADA, 0x6388, 0xCADB, 0x552E, 0xCADC, 0x53D7, 0xCADD, 0x7626, 0xCADE, 0x517D, 0xCADF, 0x852C, + 0xCAE0, 0x67A2, 0xCAE1, 0x68B3, 0xCAE2, 0x6B8A, 0xCAE3, 0x6292, 0xCAE4, 0x8F93, 0xCAE5, 0x53D4, 0xCAE6, 0x8212, 0xCAE7, 0x6DD1, + 0xCAE8, 0x758F, 0xCAE9, 0x4E66, 0xCAEA, 0x8D4E, 0xCAEB, 0x5B70, 0xCAEC, 0x719F, 0xCAED, 0x85AF, 0xCAEE, 0x6691, 0xCAEF, 0x66D9, + 0xCAF0, 0x7F72, 0xCAF1, 0x8700, 0xCAF2, 0x9ECD, 0xCAF3, 0x9F20, 0xCAF4, 0x5C5E, 0xCAF5, 0x672F, 0xCAF6, 0x8FF0, 0xCAF7, 0x6811, + 0xCAF8, 0x675F, 0xCAF9, 0x620D, 0xCAFA, 0x7AD6, 0xCAFB, 0x5885, 0xCAFC, 0x5EB6, 0xCAFD, 0x6570, 0xCAFE, 0x6F31, 0xCB40, 0x8582, + 0xCB41, 0x8583, 0xCB42, 0x8586, 0xCB43, 0x8588, 0xCB44, 0x8589, 0xCB45, 0x858A, 0xCB46, 0x858B, 0xCB47, 0x858C, 0xCB48, 0x858D, + 0xCB49, 0x858E, 0xCB4A, 0x8590, 0xCB4B, 0x8591, 0xCB4C, 0x8592, 0xCB4D, 0x8593, 0xCB4E, 0x8594, 0xCB4F, 0x8595, 0xCB50, 0x8596, + 0xCB51, 0x8597, 0xCB52, 0x8598, 0xCB53, 0x8599, 0xCB54, 0x859A, 0xCB55, 0x859D, 0xCB56, 0x859E, 0xCB57, 0x859F, 0xCB58, 0x85A0, + 0xCB59, 0x85A1, 0xCB5A, 0x85A2, 0xCB5B, 0x85A3, 0xCB5C, 0x85A5, 0xCB5D, 0x85A6, 0xCB5E, 0x85A7, 0xCB5F, 0x85A9, 0xCB60, 0x85AB, + 0xCB61, 0x85AC, 0xCB62, 0x85AD, 0xCB63, 0x85B1, 0xCB64, 0x85B2, 0xCB65, 0x85B3, 0xCB66, 0x85B4, 0xCB67, 0x85B5, 0xCB68, 0x85B6, + 0xCB69, 0x85B8, 0xCB6A, 0x85BA, 0xCB6B, 0x85BB, 0xCB6C, 0x85BC, 0xCB6D, 0x85BD, 0xCB6E, 0x85BE, 0xCB6F, 0x85BF, 0xCB70, 0x85C0, + 0xCB71, 0x85C2, 0xCB72, 0x85C3, 0xCB73, 0x85C4, 0xCB74, 0x85C5, 0xCB75, 0x85C6, 0xCB76, 0x85C7, 0xCB77, 0x85C8, 0xCB78, 0x85CA, + 0xCB79, 0x85CB, 0xCB7A, 0x85CC, 0xCB7B, 0x85CD, 0xCB7C, 0x85CE, 0xCB7D, 0x85D1, 0xCB7E, 0x85D2, 0xCB80, 0x85D4, 0xCB81, 0x85D6, + 0xCB82, 0x85D7, 0xCB83, 0x85D8, 0xCB84, 0x85D9, 0xCB85, 0x85DA, 0xCB86, 0x85DB, 0xCB87, 0x85DD, 0xCB88, 0x85DE, 0xCB89, 0x85DF, + 0xCB8A, 0x85E0, 0xCB8B, 0x85E1, 0xCB8C, 0x85E2, 0xCB8D, 0x85E3, 0xCB8E, 0x85E5, 0xCB8F, 0x85E6, 0xCB90, 0x85E7, 0xCB91, 0x85E8, + 0xCB92, 0x85EA, 0xCB93, 0x85EB, 0xCB94, 0x85EC, 0xCB95, 0x85ED, 0xCB96, 0x85EE, 0xCB97, 0x85EF, 0xCB98, 0x85F0, 0xCB99, 0x85F1, + 0xCB9A, 0x85F2, 0xCB9B, 0x85F3, 0xCB9C, 0x85F4, 0xCB9D, 0x85F5, 0xCB9E, 0x85F6, 0xCB9F, 0x85F7, 0xCBA0, 0x85F8, 0xCBA1, 0x6055, + 0xCBA2, 0x5237, 0xCBA3, 0x800D, 0xCBA4, 0x6454, 0xCBA5, 0x8870, 0xCBA6, 0x7529, 0xCBA7, 0x5E05, 0xCBA8, 0x6813, 0xCBA9, 0x62F4, + 0xCBAA, 0x971C, 0xCBAB, 0x53CC, 0xCBAC, 0x723D, 0xCBAD, 0x8C01, 0xCBAE, 0x6C34, 0xCBAF, 0x7761, 0xCBB0, 0x7A0E, 0xCBB1, 0x542E, + 0xCBB2, 0x77AC, 0xCBB3, 0x987A, 0xCBB4, 0x821C, 0xCBB5, 0x8BF4, 0xCBB6, 0x7855, 0xCBB7, 0x6714, 0xCBB8, 0x70C1, 0xCBB9, 0x65AF, + 0xCBBA, 0x6495, 0xCBBB, 0x5636, 0xCBBC, 0x601D, 0xCBBD, 0x79C1, 0xCBBE, 0x53F8, 0xCBBF, 0x4E1D, 0xCBC0, 0x6B7B, 0xCBC1, 0x8086, + 0xCBC2, 0x5BFA, 0xCBC3, 0x55E3, 0xCBC4, 0x56DB, 0xCBC5, 0x4F3A, 0xCBC6, 0x4F3C, 0xCBC7, 0x9972, 0xCBC8, 0x5DF3, 0xCBC9, 0x677E, + 0xCBCA, 0x8038, 0xCBCB, 0x6002, 0xCBCC, 0x9882, 0xCBCD, 0x9001, 0xCBCE, 0x5B8B, 0xCBCF, 0x8BBC, 0xCBD0, 0x8BF5, 0xCBD1, 0x641C, + 0xCBD2, 0x8258, 0xCBD3, 0x64DE, 0xCBD4, 0x55FD, 0xCBD5, 0x82CF, 0xCBD6, 0x9165, 0xCBD7, 0x4FD7, 0xCBD8, 0x7D20, 0xCBD9, 0x901F, + 0xCBDA, 0x7C9F, 0xCBDB, 0x50F3, 0xCBDC, 0x5851, 0xCBDD, 0x6EAF, 0xCBDE, 0x5BBF, 0xCBDF, 0x8BC9, 0xCBE0, 0x8083, 0xCBE1, 0x9178, + 0xCBE2, 0x849C, 0xCBE3, 0x7B97, 0xCBE4, 0x867D, 0xCBE5, 0x968B, 0xCBE6, 0x968F, 0xCBE7, 0x7EE5, 0xCBE8, 0x9AD3, 0xCBE9, 0x788E, + 0xCBEA, 0x5C81, 0xCBEB, 0x7A57, 0xCBEC, 0x9042, 0xCBED, 0x96A7, 0xCBEE, 0x795F, 0xCBEF, 0x5B59, 0xCBF0, 0x635F, 0xCBF1, 0x7B0B, + 0xCBF2, 0x84D1, 0xCBF3, 0x68AD, 0xCBF4, 0x5506, 0xCBF5, 0x7F29, 0xCBF6, 0x7410, 0xCBF7, 0x7D22, 0xCBF8, 0x9501, 0xCBF9, 0x6240, + 0xCBFA, 0x584C, 0xCBFB, 0x4ED6, 0xCBFC, 0x5B83, 0xCBFD, 0x5979, 0xCBFE, 0x5854, 0xCC40, 0x85F9, 0xCC41, 0x85FA, 0xCC42, 0x85FC, + 0xCC43, 0x85FD, 0xCC44, 0x85FE, 0xCC45, 0x8600, 0xCC46, 0x8601, 0xCC47, 0x8602, 0xCC48, 0x8603, 0xCC49, 0x8604, 0xCC4A, 0x8606, + 0xCC4B, 0x8607, 0xCC4C, 0x8608, 0xCC4D, 0x8609, 0xCC4E, 0x860A, 0xCC4F, 0x860B, 0xCC50, 0x860C, 0xCC51, 0x860D, 0xCC52, 0x860E, + 0xCC53, 0x860F, 0xCC54, 0x8610, 0xCC55, 0x8612, 0xCC56, 0x8613, 0xCC57, 0x8614, 0xCC58, 0x8615, 0xCC59, 0x8617, 0xCC5A, 0x8618, + 0xCC5B, 0x8619, 0xCC5C, 0x861A, 0xCC5D, 0x861B, 0xCC5E, 0x861C, 0xCC5F, 0x861D, 0xCC60, 0x861E, 0xCC61, 0x861F, 0xCC62, 0x8620, + 0xCC63, 0x8621, 0xCC64, 0x8622, 0xCC65, 0x8623, 0xCC66, 0x8624, 0xCC67, 0x8625, 0xCC68, 0x8626, 0xCC69, 0x8628, 0xCC6A, 0x862A, + 0xCC6B, 0x862B, 0xCC6C, 0x862C, 0xCC6D, 0x862D, 0xCC6E, 0x862E, 0xCC6F, 0x862F, 0xCC70, 0x8630, 0xCC71, 0x8631, 0xCC72, 0x8632, + 0xCC73, 0x8633, 0xCC74, 0x8634, 0xCC75, 0x8635, 0xCC76, 0x8636, 0xCC77, 0x8637, 0xCC78, 0x8639, 0xCC79, 0x863A, 0xCC7A, 0x863B, + 0xCC7B, 0x863D, 0xCC7C, 0x863E, 0xCC7D, 0x863F, 0xCC7E, 0x8640, 0xCC80, 0x8641, 0xCC81, 0x8642, 0xCC82, 0x8643, 0xCC83, 0x8644, + 0xCC84, 0x8645, 0xCC85, 0x8646, 0xCC86, 0x8647, 0xCC87, 0x8648, 0xCC88, 0x8649, 0xCC89, 0x864A, 0xCC8A, 0x864B, 0xCC8B, 0x864C, + 0xCC8C, 0x8652, 0xCC8D, 0x8653, 0xCC8E, 0x8655, 0xCC8F, 0x8656, 0xCC90, 0x8657, 0xCC91, 0x8658, 0xCC92, 0x8659, 0xCC93, 0x865B, + 0xCC94, 0x865C, 0xCC95, 0x865D, 0xCC96, 0x865F, 0xCC97, 0x8660, 0xCC98, 0x8661, 0xCC99, 0x8663, 0xCC9A, 0x8664, 0xCC9B, 0x8665, + 0xCC9C, 0x8666, 0xCC9D, 0x8667, 0xCC9E, 0x8668, 0xCC9F, 0x8669, 0xCCA0, 0x866A, 0xCCA1, 0x736D, 0xCCA2, 0x631E, 0xCCA3, 0x8E4B, + 0xCCA4, 0x8E0F, 0xCCA5, 0x80CE, 0xCCA6, 0x82D4, 0xCCA7, 0x62AC, 0xCCA8, 0x53F0, 0xCCA9, 0x6CF0, 0xCCAA, 0x915E, 0xCCAB, 0x592A, + 0xCCAC, 0x6001, 0xCCAD, 0x6C70, 0xCCAE, 0x574D, 0xCCAF, 0x644A, 0xCCB0, 0x8D2A, 0xCCB1, 0x762B, 0xCCB2, 0x6EE9, 0xCCB3, 0x575B, + 0xCCB4, 0x6A80, 0xCCB5, 0x75F0, 0xCCB6, 0x6F6D, 0xCCB7, 0x8C2D, 0xCCB8, 0x8C08, 0xCCB9, 0x5766, 0xCCBA, 0x6BEF, 0xCCBB, 0x8892, + 0xCCBC, 0x78B3, 0xCCBD, 0x63A2, 0xCCBE, 0x53F9, 0xCCBF, 0x70AD, 0xCCC0, 0x6C64, 0xCCC1, 0x5858, 0xCCC2, 0x642A, 0xCCC3, 0x5802, + 0xCCC4, 0x68E0, 0xCCC5, 0x819B, 0xCCC6, 0x5510, 0xCCC7, 0x7CD6, 0xCCC8, 0x5018, 0xCCC9, 0x8EBA, 0xCCCA, 0x6DCC, 0xCCCB, 0x8D9F, + 0xCCCC, 0x70EB, 0xCCCD, 0x638F, 0xCCCE, 0x6D9B, 0xCCCF, 0x6ED4, 0xCCD0, 0x7EE6, 0xCCD1, 0x8404, 0xCCD2, 0x6843, 0xCCD3, 0x9003, + 0xCCD4, 0x6DD8, 0xCCD5, 0x9676, 0xCCD6, 0x8BA8, 0xCCD7, 0x5957, 0xCCD8, 0x7279, 0xCCD9, 0x85E4, 0xCCDA, 0x817E, 0xCCDB, 0x75BC, + 0xCCDC, 0x8A8A, 0xCCDD, 0x68AF, 0xCCDE, 0x5254, 0xCCDF, 0x8E22, 0xCCE0, 0x9511, 0xCCE1, 0x63D0, 0xCCE2, 0x9898, 0xCCE3, 0x8E44, + 0xCCE4, 0x557C, 0xCCE5, 0x4F53, 0xCCE6, 0x66FF, 0xCCE7, 0x568F, 0xCCE8, 0x60D5, 0xCCE9, 0x6D95, 0xCCEA, 0x5243, 0xCCEB, 0x5C49, + 0xCCEC, 0x5929, 0xCCED, 0x6DFB, 0xCCEE, 0x586B, 0xCCEF, 0x7530, 0xCCF0, 0x751C, 0xCCF1, 0x606C, 0xCCF2, 0x8214, 0xCCF3, 0x8146, + 0xCCF4, 0x6311, 0xCCF5, 0x6761, 0xCCF6, 0x8FE2, 0xCCF7, 0x773A, 0xCCF8, 0x8DF3, 0xCCF9, 0x8D34, 0xCCFA, 0x94C1, 0xCCFB, 0x5E16, + 0xCCFC, 0x5385, 0xCCFD, 0x542C, 0xCCFE, 0x70C3, 0xCD40, 0x866D, 0xCD41, 0x866F, 0xCD42, 0x8670, 0xCD43, 0x8672, 0xCD44, 0x8673, + 0xCD45, 0x8674, 0xCD46, 0x8675, 0xCD47, 0x8676, 0xCD48, 0x8677, 0xCD49, 0x8678, 0xCD4A, 0x8683, 0xCD4B, 0x8684, 0xCD4C, 0x8685, + 0xCD4D, 0x8686, 0xCD4E, 0x8687, 0xCD4F, 0x8688, 0xCD50, 0x8689, 0xCD51, 0x868E, 0xCD52, 0x868F, 0xCD53, 0x8690, 0xCD54, 0x8691, + 0xCD55, 0x8692, 0xCD56, 0x8694, 0xCD57, 0x8696, 0xCD58, 0x8697, 0xCD59, 0x8698, 0xCD5A, 0x8699, 0xCD5B, 0x869A, 0xCD5C, 0x869B, + 0xCD5D, 0x869E, 0xCD5E, 0x869F, 0xCD5F, 0x86A0, 0xCD60, 0x86A1, 0xCD61, 0x86A2, 0xCD62, 0x86A5, 0xCD63, 0x86A6, 0xCD64, 0x86AB, + 0xCD65, 0x86AD, 0xCD66, 0x86AE, 0xCD67, 0x86B2, 0xCD68, 0x86B3, 0xCD69, 0x86B7, 0xCD6A, 0x86B8, 0xCD6B, 0x86B9, 0xCD6C, 0x86BB, + 0xCD6D, 0x86BC, 0xCD6E, 0x86BD, 0xCD6F, 0x86BE, 0xCD70, 0x86BF, 0xCD71, 0x86C1, 0xCD72, 0x86C2, 0xCD73, 0x86C3, 0xCD74, 0x86C5, + 0xCD75, 0x86C8, 0xCD76, 0x86CC, 0xCD77, 0x86CD, 0xCD78, 0x86D2, 0xCD79, 0x86D3, 0xCD7A, 0x86D5, 0xCD7B, 0x86D6, 0xCD7C, 0x86D7, + 0xCD7D, 0x86DA, 0xCD7E, 0x86DC, 0xCD80, 0x86DD, 0xCD81, 0x86E0, 0xCD82, 0x86E1, 0xCD83, 0x86E2, 0xCD84, 0x86E3, 0xCD85, 0x86E5, + 0xCD86, 0x86E6, 0xCD87, 0x86E7, 0xCD88, 0x86E8, 0xCD89, 0x86EA, 0xCD8A, 0x86EB, 0xCD8B, 0x86EC, 0xCD8C, 0x86EF, 0xCD8D, 0x86F5, + 0xCD8E, 0x86F6, 0xCD8F, 0x86F7, 0xCD90, 0x86FA, 0xCD91, 0x86FB, 0xCD92, 0x86FC, 0xCD93, 0x86FD, 0xCD94, 0x86FF, 0xCD95, 0x8701, + 0xCD96, 0x8704, 0xCD97, 0x8705, 0xCD98, 0x8706, 0xCD99, 0x870B, 0xCD9A, 0x870C, 0xCD9B, 0x870E, 0xCD9C, 0x870F, 0xCD9D, 0x8710, + 0xCD9E, 0x8711, 0xCD9F, 0x8714, 0xCDA0, 0x8716, 0xCDA1, 0x6C40, 0xCDA2, 0x5EF7, 0xCDA3, 0x505C, 0xCDA4, 0x4EAD, 0xCDA5, 0x5EAD, + 0xCDA6, 0x633A, 0xCDA7, 0x8247, 0xCDA8, 0x901A, 0xCDA9, 0x6850, 0xCDAA, 0x916E, 0xCDAB, 0x77B3, 0xCDAC, 0x540C, 0xCDAD, 0x94DC, + 0xCDAE, 0x5F64, 0xCDAF, 0x7AE5, 0xCDB0, 0x6876, 0xCDB1, 0x6345, 0xCDB2, 0x7B52, 0xCDB3, 0x7EDF, 0xCDB4, 0x75DB, 0xCDB5, 0x5077, + 0xCDB6, 0x6295, 0xCDB7, 0x5934, 0xCDB8, 0x900F, 0xCDB9, 0x51F8, 0xCDBA, 0x79C3, 0xCDBB, 0x7A81, 0xCDBC, 0x56FE, 0xCDBD, 0x5F92, + 0xCDBE, 0x9014, 0xCDBF, 0x6D82, 0xCDC0, 0x5C60, 0xCDC1, 0x571F, 0xCDC2, 0x5410, 0xCDC3, 0x5154, 0xCDC4, 0x6E4D, 0xCDC5, 0x56E2, + 0xCDC6, 0x63A8, 0xCDC7, 0x9893, 0xCDC8, 0x817F, 0xCDC9, 0x8715, 0xCDCA, 0x892A, 0xCDCB, 0x9000, 0xCDCC, 0x541E, 0xCDCD, 0x5C6F, + 0xCDCE, 0x81C0, 0xCDCF, 0x62D6, 0xCDD0, 0x6258, 0xCDD1, 0x8131, 0xCDD2, 0x9E35, 0xCDD3, 0x9640, 0xCDD4, 0x9A6E, 0xCDD5, 0x9A7C, + 0xCDD6, 0x692D, 0xCDD7, 0x59A5, 0xCDD8, 0x62D3, 0xCDD9, 0x553E, 0xCDDA, 0x6316, 0xCDDB, 0x54C7, 0xCDDC, 0x86D9, 0xCDDD, 0x6D3C, + 0xCDDE, 0x5A03, 0xCDDF, 0x74E6, 0xCDE0, 0x889C, 0xCDE1, 0x6B6A, 0xCDE2, 0x5916, 0xCDE3, 0x8C4C, 0xCDE4, 0x5F2F, 0xCDE5, 0x6E7E, + 0xCDE6, 0x73A9, 0xCDE7, 0x987D, 0xCDE8, 0x4E38, 0xCDE9, 0x70F7, 0xCDEA, 0x5B8C, 0xCDEB, 0x7897, 0xCDEC, 0x633D, 0xCDED, 0x665A, + 0xCDEE, 0x7696, 0xCDEF, 0x60CB, 0xCDF0, 0x5B9B, 0xCDF1, 0x5A49, 0xCDF2, 0x4E07, 0xCDF3, 0x8155, 0xCDF4, 0x6C6A, 0xCDF5, 0x738B, + 0xCDF6, 0x4EA1, 0xCDF7, 0x6789, 0xCDF8, 0x7F51, 0xCDF9, 0x5F80, 0xCDFA, 0x65FA, 0xCDFB, 0x671B, 0xCDFC, 0x5FD8, 0xCDFD, 0x5984, + 0xCDFE, 0x5A01, 0xCE40, 0x8719, 0xCE41, 0x871B, 0xCE42, 0x871D, 0xCE43, 0x871F, 0xCE44, 0x8720, 0xCE45, 0x8724, 0xCE46, 0x8726, + 0xCE47, 0x8727, 0xCE48, 0x8728, 0xCE49, 0x872A, 0xCE4A, 0x872B, 0xCE4B, 0x872C, 0xCE4C, 0x872D, 0xCE4D, 0x872F, 0xCE4E, 0x8730, + 0xCE4F, 0x8732, 0xCE50, 0x8733, 0xCE51, 0x8735, 0xCE52, 0x8736, 0xCE53, 0x8738, 0xCE54, 0x8739, 0xCE55, 0x873A, 0xCE56, 0x873C, + 0xCE57, 0x873D, 0xCE58, 0x8740, 0xCE59, 0x8741, 0xCE5A, 0x8742, 0xCE5B, 0x8743, 0xCE5C, 0x8744, 0xCE5D, 0x8745, 0xCE5E, 0x8746, + 0xCE5F, 0x874A, 0xCE60, 0x874B, 0xCE61, 0x874D, 0xCE62, 0x874F, 0xCE63, 0x8750, 0xCE64, 0x8751, 0xCE65, 0x8752, 0xCE66, 0x8754, + 0xCE67, 0x8755, 0xCE68, 0x8756, 0xCE69, 0x8758, 0xCE6A, 0x875A, 0xCE6B, 0x875B, 0xCE6C, 0x875C, 0xCE6D, 0x875D, 0xCE6E, 0x875E, + 0xCE6F, 0x875F, 0xCE70, 0x8761, 0xCE71, 0x8762, 0xCE72, 0x8766, 0xCE73, 0x8767, 0xCE74, 0x8768, 0xCE75, 0x8769, 0xCE76, 0x876A, + 0xCE77, 0x876B, 0xCE78, 0x876C, 0xCE79, 0x876D, 0xCE7A, 0x876F, 0xCE7B, 0x8771, 0xCE7C, 0x8772, 0xCE7D, 0x8773, 0xCE7E, 0x8775, + 0xCE80, 0x8777, 0xCE81, 0x8778, 0xCE82, 0x8779, 0xCE83, 0x877A, 0xCE84, 0x877F, 0xCE85, 0x8780, 0xCE86, 0x8781, 0xCE87, 0x8784, + 0xCE88, 0x8786, 0xCE89, 0x8787, 0xCE8A, 0x8789, 0xCE8B, 0x878A, 0xCE8C, 0x878C, 0xCE8D, 0x878E, 0xCE8E, 0x878F, 0xCE8F, 0x8790, + 0xCE90, 0x8791, 0xCE91, 0x8792, 0xCE92, 0x8794, 0xCE93, 0x8795, 0xCE94, 0x8796, 0xCE95, 0x8798, 0xCE96, 0x8799, 0xCE97, 0x879A, + 0xCE98, 0x879B, 0xCE99, 0x879C, 0xCE9A, 0x879D, 0xCE9B, 0x879E, 0xCE9C, 0x87A0, 0xCE9D, 0x87A1, 0xCE9E, 0x87A2, 0xCE9F, 0x87A3, + 0xCEA0, 0x87A4, 0xCEA1, 0x5DCD, 0xCEA2, 0x5FAE, 0xCEA3, 0x5371, 0xCEA4, 0x97E6, 0xCEA5, 0x8FDD, 0xCEA6, 0x6845, 0xCEA7, 0x56F4, + 0xCEA8, 0x552F, 0xCEA9, 0x60DF, 0xCEAA, 0x4E3A, 0xCEAB, 0x6F4D, 0xCEAC, 0x7EF4, 0xCEAD, 0x82C7, 0xCEAE, 0x840E, 0xCEAF, 0x59D4, + 0xCEB0, 0x4F1F, 0xCEB1, 0x4F2A, 0xCEB2, 0x5C3E, 0xCEB3, 0x7EAC, 0xCEB4, 0x672A, 0xCEB5, 0x851A, 0xCEB6, 0x5473, 0xCEB7, 0x754F, + 0xCEB8, 0x80C3, 0xCEB9, 0x5582, 0xCEBA, 0x9B4F, 0xCEBB, 0x4F4D, 0xCEBC, 0x6E2D, 0xCEBD, 0x8C13, 0xCEBE, 0x5C09, 0xCEBF, 0x6170, + 0xCEC0, 0x536B, 0xCEC1, 0x761F, 0xCEC2, 0x6E29, 0xCEC3, 0x868A, 0xCEC4, 0x6587, 0xCEC5, 0x95FB, 0xCEC6, 0x7EB9, 0xCEC7, 0x543B, + 0xCEC8, 0x7A33, 0xCEC9, 0x7D0A, 0xCECA, 0x95EE, 0xCECB, 0x55E1, 0xCECC, 0x7FC1, 0xCECD, 0x74EE, 0xCECE, 0x631D, 0xCECF, 0x8717, + 0xCED0, 0x6DA1, 0xCED1, 0x7A9D, 0xCED2, 0x6211, 0xCED3, 0x65A1, 0xCED4, 0x5367, 0xCED5, 0x63E1, 0xCED6, 0x6C83, 0xCED7, 0x5DEB, + 0xCED8, 0x545C, 0xCED9, 0x94A8, 0xCEDA, 0x4E4C, 0xCEDB, 0x6C61, 0xCEDC, 0x8BEC, 0xCEDD, 0x5C4B, 0xCEDE, 0x65E0, 0xCEDF, 0x829C, + 0xCEE0, 0x68A7, 0xCEE1, 0x543E, 0xCEE2, 0x5434, 0xCEE3, 0x6BCB, 0xCEE4, 0x6B66, 0xCEE5, 0x4E94, 0xCEE6, 0x6342, 0xCEE7, 0x5348, + 0xCEE8, 0x821E, 0xCEE9, 0x4F0D, 0xCEEA, 0x4FAE, 0xCEEB, 0x575E, 0xCEEC, 0x620A, 0xCEED, 0x96FE, 0xCEEE, 0x6664, 0xCEEF, 0x7269, + 0xCEF0, 0x52FF, 0xCEF1, 0x52A1, 0xCEF2, 0x609F, 0xCEF3, 0x8BEF, 0xCEF4, 0x6614, 0xCEF5, 0x7199, 0xCEF6, 0x6790, 0xCEF7, 0x897F, + 0xCEF8, 0x7852, 0xCEF9, 0x77FD, 0xCEFA, 0x6670, 0xCEFB, 0x563B, 0xCEFC, 0x5438, 0xCEFD, 0x9521, 0xCEFE, 0x727A, 0xCF40, 0x87A5, + 0xCF41, 0x87A6, 0xCF42, 0x87A7, 0xCF43, 0x87A9, 0xCF44, 0x87AA, 0xCF45, 0x87AE, 0xCF46, 0x87B0, 0xCF47, 0x87B1, 0xCF48, 0x87B2, + 0xCF49, 0x87B4, 0xCF4A, 0x87B6, 0xCF4B, 0x87B7, 0xCF4C, 0x87B8, 0xCF4D, 0x87B9, 0xCF4E, 0x87BB, 0xCF4F, 0x87BC, 0xCF50, 0x87BE, + 0xCF51, 0x87BF, 0xCF52, 0x87C1, 0xCF53, 0x87C2, 0xCF54, 0x87C3, 0xCF55, 0x87C4, 0xCF56, 0x87C5, 0xCF57, 0x87C7, 0xCF58, 0x87C8, + 0xCF59, 0x87C9, 0xCF5A, 0x87CC, 0xCF5B, 0x87CD, 0xCF5C, 0x87CE, 0xCF5D, 0x87CF, 0xCF5E, 0x87D0, 0xCF5F, 0x87D4, 0xCF60, 0x87D5, + 0xCF61, 0x87D6, 0xCF62, 0x87D7, 0xCF63, 0x87D8, 0xCF64, 0x87D9, 0xCF65, 0x87DA, 0xCF66, 0x87DC, 0xCF67, 0x87DD, 0xCF68, 0x87DE, + 0xCF69, 0x87DF, 0xCF6A, 0x87E1, 0xCF6B, 0x87E2, 0xCF6C, 0x87E3, 0xCF6D, 0x87E4, 0xCF6E, 0x87E6, 0xCF6F, 0x87E7, 0xCF70, 0x87E8, + 0xCF71, 0x87E9, 0xCF72, 0x87EB, 0xCF73, 0x87EC, 0xCF74, 0x87ED, 0xCF75, 0x87EF, 0xCF76, 0x87F0, 0xCF77, 0x87F1, 0xCF78, 0x87F2, + 0xCF79, 0x87F3, 0xCF7A, 0x87F4, 0xCF7B, 0x87F5, 0xCF7C, 0x87F6, 0xCF7D, 0x87F7, 0xCF7E, 0x87F8, 0xCF80, 0x87FA, 0xCF81, 0x87FB, + 0xCF82, 0x87FC, 0xCF83, 0x87FD, 0xCF84, 0x87FF, 0xCF85, 0x8800, 0xCF86, 0x8801, 0xCF87, 0x8802, 0xCF88, 0x8804, 0xCF89, 0x8805, + 0xCF8A, 0x8806, 0xCF8B, 0x8807, 0xCF8C, 0x8808, 0xCF8D, 0x8809, 0xCF8E, 0x880B, 0xCF8F, 0x880C, 0xCF90, 0x880D, 0xCF91, 0x880E, + 0xCF92, 0x880F, 0xCF93, 0x8810, 0xCF94, 0x8811, 0xCF95, 0x8812, 0xCF96, 0x8814, 0xCF97, 0x8817, 0xCF98, 0x8818, 0xCF99, 0x8819, + 0xCF9A, 0x881A, 0xCF9B, 0x881C, 0xCF9C, 0x881D, 0xCF9D, 0x881E, 0xCF9E, 0x881F, 0xCF9F, 0x8820, 0xCFA0, 0x8823, 0xCFA1, 0x7A00, + 0xCFA2, 0x606F, 0xCFA3, 0x5E0C, 0xCFA4, 0x6089, 0xCFA5, 0x819D, 0xCFA6, 0x5915, 0xCFA7, 0x60DC, 0xCFA8, 0x7184, 0xCFA9, 0x70EF, + 0xCFAA, 0x6EAA, 0xCFAB, 0x6C50, 0xCFAC, 0x7280, 0xCFAD, 0x6A84, 0xCFAE, 0x88AD, 0xCFAF, 0x5E2D, 0xCFB0, 0x4E60, 0xCFB1, 0x5AB3, + 0xCFB2, 0x559C, 0xCFB3, 0x94E3, 0xCFB4, 0x6D17, 0xCFB5, 0x7CFB, 0xCFB6, 0x9699, 0xCFB7, 0x620F, 0xCFB8, 0x7EC6, 0xCFB9, 0x778E, + 0xCFBA, 0x867E, 0xCFBB, 0x5323, 0xCFBC, 0x971E, 0xCFBD, 0x8F96, 0xCFBE, 0x6687, 0xCFBF, 0x5CE1, 0xCFC0, 0x4FA0, 0xCFC1, 0x72ED, + 0xCFC2, 0x4E0B, 0xCFC3, 0x53A6, 0xCFC4, 0x590F, 0xCFC5, 0x5413, 0xCFC6, 0x6380, 0xCFC7, 0x9528, 0xCFC8, 0x5148, 0xCFC9, 0x4ED9, + 0xCFCA, 0x9C9C, 0xCFCB, 0x7EA4, 0xCFCC, 0x54B8, 0xCFCD, 0x8D24, 0xCFCE, 0x8854, 0xCFCF, 0x8237, 0xCFD0, 0x95F2, 0xCFD1, 0x6D8E, + 0xCFD2, 0x5F26, 0xCFD3, 0x5ACC, 0xCFD4, 0x663E, 0xCFD5, 0x9669, 0xCFD6, 0x73B0, 0xCFD7, 0x732E, 0xCFD8, 0x53BF, 0xCFD9, 0x817A, + 0xCFDA, 0x9985, 0xCFDB, 0x7FA1, 0xCFDC, 0x5BAA, 0xCFDD, 0x9677, 0xCFDE, 0x9650, 0xCFDF, 0x7EBF, 0xCFE0, 0x76F8, 0xCFE1, 0x53A2, + 0xCFE2, 0x9576, 0xCFE3, 0x9999, 0xCFE4, 0x7BB1, 0xCFE5, 0x8944, 0xCFE6, 0x6E58, 0xCFE7, 0x4E61, 0xCFE8, 0x7FD4, 0xCFE9, 0x7965, + 0xCFEA, 0x8BE6, 0xCFEB, 0x60F3, 0xCFEC, 0x54CD, 0xCFED, 0x4EAB, 0xCFEE, 0x9879, 0xCFEF, 0x5DF7, 0xCFF0, 0x6A61, 0xCFF1, 0x50CF, + 0xCFF2, 0x5411, 0xCFF3, 0x8C61, 0xCFF4, 0x8427, 0xCFF5, 0x785D, 0xCFF6, 0x9704, 0xCFF7, 0x524A, 0xCFF8, 0x54EE, 0xCFF9, 0x56A3, + 0xCFFA, 0x9500, 0xCFFB, 0x6D88, 0xCFFC, 0x5BB5, 0xCFFD, 0x6DC6, 0xCFFE, 0x6653, 0xD040, 0x8824, 0xD041, 0x8825, 0xD042, 0x8826, + 0xD043, 0x8827, 0xD044, 0x8828, 0xD045, 0x8829, 0xD046, 0x882A, 0xD047, 0x882B, 0xD048, 0x882C, 0xD049, 0x882D, 0xD04A, 0x882E, + 0xD04B, 0x882F, 0xD04C, 0x8830, 0xD04D, 0x8831, 0xD04E, 0x8833, 0xD04F, 0x8834, 0xD050, 0x8835, 0xD051, 0x8836, 0xD052, 0x8837, + 0xD053, 0x8838, 0xD054, 0x883A, 0xD055, 0x883B, 0xD056, 0x883D, 0xD057, 0x883E, 0xD058, 0x883F, 0xD059, 0x8841, 0xD05A, 0x8842, + 0xD05B, 0x8843, 0xD05C, 0x8846, 0xD05D, 0x8847, 0xD05E, 0x8848, 0xD05F, 0x8849, 0xD060, 0x884A, 0xD061, 0x884B, 0xD062, 0x884E, + 0xD063, 0x884F, 0xD064, 0x8850, 0xD065, 0x8851, 0xD066, 0x8852, 0xD067, 0x8853, 0xD068, 0x8855, 0xD069, 0x8856, 0xD06A, 0x8858, + 0xD06B, 0x885A, 0xD06C, 0x885B, 0xD06D, 0x885C, 0xD06E, 0x885D, 0xD06F, 0x885E, 0xD070, 0x885F, 0xD071, 0x8860, 0xD072, 0x8866, + 0xD073, 0x8867, 0xD074, 0x886A, 0xD075, 0x886D, 0xD076, 0x886F, 0xD077, 0x8871, 0xD078, 0x8873, 0xD079, 0x8874, 0xD07A, 0x8875, + 0xD07B, 0x8876, 0xD07C, 0x8878, 0xD07D, 0x8879, 0xD07E, 0x887A, 0xD080, 0x887B, 0xD081, 0x887C, 0xD082, 0x8880, 0xD083, 0x8883, + 0xD084, 0x8886, 0xD085, 0x8887, 0xD086, 0x8889, 0xD087, 0x888A, 0xD088, 0x888C, 0xD089, 0x888E, 0xD08A, 0x888F, 0xD08B, 0x8890, + 0xD08C, 0x8891, 0xD08D, 0x8893, 0xD08E, 0x8894, 0xD08F, 0x8895, 0xD090, 0x8897, 0xD091, 0x8898, 0xD092, 0x8899, 0xD093, 0x889A, + 0xD094, 0x889B, 0xD095, 0x889D, 0xD096, 0x889E, 0xD097, 0x889F, 0xD098, 0x88A0, 0xD099, 0x88A1, 0xD09A, 0x88A3, 0xD09B, 0x88A5, + 0xD09C, 0x88A6, 0xD09D, 0x88A7, 0xD09E, 0x88A8, 0xD09F, 0x88A9, 0xD0A0, 0x88AA, 0xD0A1, 0x5C0F, 0xD0A2, 0x5B5D, 0xD0A3, 0x6821, + 0xD0A4, 0x8096, 0xD0A5, 0x5578, 0xD0A6, 0x7B11, 0xD0A7, 0x6548, 0xD0A8, 0x6954, 0xD0A9, 0x4E9B, 0xD0AA, 0x6B47, 0xD0AB, 0x874E, + 0xD0AC, 0x978B, 0xD0AD, 0x534F, 0xD0AE, 0x631F, 0xD0AF, 0x643A, 0xD0B0, 0x90AA, 0xD0B1, 0x659C, 0xD0B2, 0x80C1, 0xD0B3, 0x8C10, + 0xD0B4, 0x5199, 0xD0B5, 0x68B0, 0xD0B6, 0x5378, 0xD0B7, 0x87F9, 0xD0B8, 0x61C8, 0xD0B9, 0x6CC4, 0xD0BA, 0x6CFB, 0xD0BB, 0x8C22, + 0xD0BC, 0x5C51, 0xD0BD, 0x85AA, 0xD0BE, 0x82AF, 0xD0BF, 0x950C, 0xD0C0, 0x6B23, 0xD0C1, 0x8F9B, 0xD0C2, 0x65B0, 0xD0C3, 0x5FFB, + 0xD0C4, 0x5FC3, 0xD0C5, 0x4FE1, 0xD0C6, 0x8845, 0xD0C7, 0x661F, 0xD0C8, 0x8165, 0xD0C9, 0x7329, 0xD0CA, 0x60FA, 0xD0CB, 0x5174, + 0xD0CC, 0x5211, 0xD0CD, 0x578B, 0xD0CE, 0x5F62, 0xD0CF, 0x90A2, 0xD0D0, 0x884C, 0xD0D1, 0x9192, 0xD0D2, 0x5E78, 0xD0D3, 0x674F, + 0xD0D4, 0x6027, 0xD0D5, 0x59D3, 0xD0D6, 0x5144, 0xD0D7, 0x51F6, 0xD0D8, 0x80F8, 0xD0D9, 0x5308, 0xD0DA, 0x6C79, 0xD0DB, 0x96C4, + 0xD0DC, 0x718A, 0xD0DD, 0x4F11, 0xD0DE, 0x4FEE, 0xD0DF, 0x7F9E, 0xD0E0, 0x673D, 0xD0E1, 0x55C5, 0xD0E2, 0x9508, 0xD0E3, 0x79C0, + 0xD0E4, 0x8896, 0xD0E5, 0x7EE3, 0xD0E6, 0x589F, 0xD0E7, 0x620C, 0xD0E8, 0x9700, 0xD0E9, 0x865A, 0xD0EA, 0x5618, 0xD0EB, 0x987B, + 0xD0EC, 0x5F90, 0xD0ED, 0x8BB8, 0xD0EE, 0x84C4, 0xD0EF, 0x9157, 0xD0F0, 0x53D9, 0xD0F1, 0x65ED, 0xD0F2, 0x5E8F, 0xD0F3, 0x755C, + 0xD0F4, 0x6064, 0xD0F5, 0x7D6E, 0xD0F6, 0x5A7F, 0xD0F7, 0x7EEA, 0xD0F8, 0x7EED, 0xD0F9, 0x8F69, 0xD0FA, 0x55A7, 0xD0FB, 0x5BA3, + 0xD0FC, 0x60AC, 0xD0FD, 0x65CB, 0xD0FE, 0x7384, 0xD140, 0x88AC, 0xD141, 0x88AE, 0xD142, 0x88AF, 0xD143, 0x88B0, 0xD144, 0x88B2, + 0xD145, 0x88B3, 0xD146, 0x88B4, 0xD147, 0x88B5, 0xD148, 0x88B6, 0xD149, 0x88B8, 0xD14A, 0x88B9, 0xD14B, 0x88BA, 0xD14C, 0x88BB, + 0xD14D, 0x88BD, 0xD14E, 0x88BE, 0xD14F, 0x88BF, 0xD150, 0x88C0, 0xD151, 0x88C3, 0xD152, 0x88C4, 0xD153, 0x88C7, 0xD154, 0x88C8, + 0xD155, 0x88CA, 0xD156, 0x88CB, 0xD157, 0x88CC, 0xD158, 0x88CD, 0xD159, 0x88CF, 0xD15A, 0x88D0, 0xD15B, 0x88D1, 0xD15C, 0x88D3, + 0xD15D, 0x88D6, 0xD15E, 0x88D7, 0xD15F, 0x88DA, 0xD160, 0x88DB, 0xD161, 0x88DC, 0xD162, 0x88DD, 0xD163, 0x88DE, 0xD164, 0x88E0, + 0xD165, 0x88E1, 0xD166, 0x88E6, 0xD167, 0x88E7, 0xD168, 0x88E9, 0xD169, 0x88EA, 0xD16A, 0x88EB, 0xD16B, 0x88EC, 0xD16C, 0x88ED, + 0xD16D, 0x88EE, 0xD16E, 0x88EF, 0xD16F, 0x88F2, 0xD170, 0x88F5, 0xD171, 0x88F6, 0xD172, 0x88F7, 0xD173, 0x88FA, 0xD174, 0x88FB, + 0xD175, 0x88FD, 0xD176, 0x88FF, 0xD177, 0x8900, 0xD178, 0x8901, 0xD179, 0x8903, 0xD17A, 0x8904, 0xD17B, 0x8905, 0xD17C, 0x8906, + 0xD17D, 0x8907, 0xD17E, 0x8908, 0xD180, 0x8909, 0xD181, 0x890B, 0xD182, 0x890C, 0xD183, 0x890D, 0xD184, 0x890E, 0xD185, 0x890F, + 0xD186, 0x8911, 0xD187, 0x8914, 0xD188, 0x8915, 0xD189, 0x8916, 0xD18A, 0x8917, 0xD18B, 0x8918, 0xD18C, 0x891C, 0xD18D, 0x891D, + 0xD18E, 0x891E, 0xD18F, 0x891F, 0xD190, 0x8920, 0xD191, 0x8922, 0xD192, 0x8923, 0xD193, 0x8924, 0xD194, 0x8926, 0xD195, 0x8927, + 0xD196, 0x8928, 0xD197, 0x8929, 0xD198, 0x892C, 0xD199, 0x892D, 0xD19A, 0x892E, 0xD19B, 0x892F, 0xD19C, 0x8931, 0xD19D, 0x8932, + 0xD19E, 0x8933, 0xD19F, 0x8935, 0xD1A0, 0x8937, 0xD1A1, 0x9009, 0xD1A2, 0x7663, 0xD1A3, 0x7729, 0xD1A4, 0x7EDA, 0xD1A5, 0x9774, + 0xD1A6, 0x859B, 0xD1A7, 0x5B66, 0xD1A8, 0x7A74, 0xD1A9, 0x96EA, 0xD1AA, 0x8840, 0xD1AB, 0x52CB, 0xD1AC, 0x718F, 0xD1AD, 0x5FAA, + 0xD1AE, 0x65EC, 0xD1AF, 0x8BE2, 0xD1B0, 0x5BFB, 0xD1B1, 0x9A6F, 0xD1B2, 0x5DE1, 0xD1B3, 0x6B89, 0xD1B4, 0x6C5B, 0xD1B5, 0x8BAD, + 0xD1B6, 0x8BAF, 0xD1B7, 0x900A, 0xD1B8, 0x8FC5, 0xD1B9, 0x538B, 0xD1BA, 0x62BC, 0xD1BB, 0x9E26, 0xD1BC, 0x9E2D, 0xD1BD, 0x5440, + 0xD1BE, 0x4E2B, 0xD1BF, 0x82BD, 0xD1C0, 0x7259, 0xD1C1, 0x869C, 0xD1C2, 0x5D16, 0xD1C3, 0x8859, 0xD1C4, 0x6DAF, 0xD1C5, 0x96C5, + 0xD1C6, 0x54D1, 0xD1C7, 0x4E9A, 0xD1C8, 0x8BB6, 0xD1C9, 0x7109, 0xD1CA, 0x54BD, 0xD1CB, 0x9609, 0xD1CC, 0x70DF, 0xD1CD, 0x6DF9, + 0xD1CE, 0x76D0, 0xD1CF, 0x4E25, 0xD1D0, 0x7814, 0xD1D1, 0x8712, 0xD1D2, 0x5CA9, 0xD1D3, 0x5EF6, 0xD1D4, 0x8A00, 0xD1D5, 0x989C, + 0xD1D6, 0x960E, 0xD1D7, 0x708E, 0xD1D8, 0x6CBF, 0xD1D9, 0x5944, 0xD1DA, 0x63A9, 0xD1DB, 0x773C, 0xD1DC, 0x884D, 0xD1DD, 0x6F14, + 0xD1DE, 0x8273, 0xD1DF, 0x5830, 0xD1E0, 0x71D5, 0xD1E1, 0x538C, 0xD1E2, 0x781A, 0xD1E3, 0x96C1, 0xD1E4, 0x5501, 0xD1E5, 0x5F66, + 0xD1E6, 0x7130, 0xD1E7, 0x5BB4, 0xD1E8, 0x8C1A, 0xD1E9, 0x9A8C, 0xD1EA, 0x6B83, 0xD1EB, 0x592E, 0xD1EC, 0x9E2F, 0xD1ED, 0x79E7, + 0xD1EE, 0x6768, 0xD1EF, 0x626C, 0xD1F0, 0x4F6F, 0xD1F1, 0x75A1, 0xD1F2, 0x7F8A, 0xD1F3, 0x6D0B, 0xD1F4, 0x9633, 0xD1F5, 0x6C27, + 0xD1F6, 0x4EF0, 0xD1F7, 0x75D2, 0xD1F8, 0x517B, 0xD1F9, 0x6837, 0xD1FA, 0x6F3E, 0xD1FB, 0x9080, 0xD1FC, 0x8170, 0xD1FD, 0x5996, + 0xD1FE, 0x7476, 0xD240, 0x8938, 0xD241, 0x8939, 0xD242, 0x893A, 0xD243, 0x893B, 0xD244, 0x893C, 0xD245, 0x893D, 0xD246, 0x893E, + 0xD247, 0x893F, 0xD248, 0x8940, 0xD249, 0x8942, 0xD24A, 0x8943, 0xD24B, 0x8945, 0xD24C, 0x8946, 0xD24D, 0x8947, 0xD24E, 0x8948, + 0xD24F, 0x8949, 0xD250, 0x894A, 0xD251, 0x894B, 0xD252, 0x894C, 0xD253, 0x894D, 0xD254, 0x894E, 0xD255, 0x894F, 0xD256, 0x8950, + 0xD257, 0x8951, 0xD258, 0x8952, 0xD259, 0x8953, 0xD25A, 0x8954, 0xD25B, 0x8955, 0xD25C, 0x8956, 0xD25D, 0x8957, 0xD25E, 0x8958, + 0xD25F, 0x8959, 0xD260, 0x895A, 0xD261, 0x895B, 0xD262, 0x895C, 0xD263, 0x895D, 0xD264, 0x8960, 0xD265, 0x8961, 0xD266, 0x8962, + 0xD267, 0x8963, 0xD268, 0x8964, 0xD269, 0x8965, 0xD26A, 0x8967, 0xD26B, 0x8968, 0xD26C, 0x8969, 0xD26D, 0x896A, 0xD26E, 0x896B, + 0xD26F, 0x896C, 0xD270, 0x896D, 0xD271, 0x896E, 0xD272, 0x896F, 0xD273, 0x8970, 0xD274, 0x8971, 0xD275, 0x8972, 0xD276, 0x8973, + 0xD277, 0x8974, 0xD278, 0x8975, 0xD279, 0x8976, 0xD27A, 0x8977, 0xD27B, 0x8978, 0xD27C, 0x8979, 0xD27D, 0x897A, 0xD27E, 0x897C, + 0xD280, 0x897D, 0xD281, 0x897E, 0xD282, 0x8980, 0xD283, 0x8982, 0xD284, 0x8984, 0xD285, 0x8985, 0xD286, 0x8987, 0xD287, 0x8988, + 0xD288, 0x8989, 0xD289, 0x898A, 0xD28A, 0x898B, 0xD28B, 0x898C, 0xD28C, 0x898D, 0xD28D, 0x898E, 0xD28E, 0x898F, 0xD28F, 0x8990, + 0xD290, 0x8991, 0xD291, 0x8992, 0xD292, 0x8993, 0xD293, 0x8994, 0xD294, 0x8995, 0xD295, 0x8996, 0xD296, 0x8997, 0xD297, 0x8998, + 0xD298, 0x8999, 0xD299, 0x899A, 0xD29A, 0x899B, 0xD29B, 0x899C, 0xD29C, 0x899D, 0xD29D, 0x899E, 0xD29E, 0x899F, 0xD29F, 0x89A0, + 0xD2A0, 0x89A1, 0xD2A1, 0x6447, 0xD2A2, 0x5C27, 0xD2A3, 0x9065, 0xD2A4, 0x7A91, 0xD2A5, 0x8C23, 0xD2A6, 0x59DA, 0xD2A7, 0x54AC, + 0xD2A8, 0x8200, 0xD2A9, 0x836F, 0xD2AA, 0x8981, 0xD2AB, 0x8000, 0xD2AC, 0x6930, 0xD2AD, 0x564E, 0xD2AE, 0x8036, 0xD2AF, 0x7237, + 0xD2B0, 0x91CE, 0xD2B1, 0x51B6, 0xD2B2, 0x4E5F, 0xD2B3, 0x9875, 0xD2B4, 0x6396, 0xD2B5, 0x4E1A, 0xD2B6, 0x53F6, 0xD2B7, 0x66F3, + 0xD2B8, 0x814B, 0xD2B9, 0x591C, 0xD2BA, 0x6DB2, 0xD2BB, 0x4E00, 0xD2BC, 0x58F9, 0xD2BD, 0x533B, 0xD2BE, 0x63D6, 0xD2BF, 0x94F1, + 0xD2C0, 0x4F9D, 0xD2C1, 0x4F0A, 0xD2C2, 0x8863, 0xD2C3, 0x9890, 0xD2C4, 0x5937, 0xD2C5, 0x9057, 0xD2C6, 0x79FB, 0xD2C7, 0x4EEA, + 0xD2C8, 0x80F0, 0xD2C9, 0x7591, 0xD2CA, 0x6C82, 0xD2CB, 0x5B9C, 0xD2CC, 0x59E8, 0xD2CD, 0x5F5D, 0xD2CE, 0x6905, 0xD2CF, 0x8681, + 0xD2D0, 0x501A, 0xD2D1, 0x5DF2, 0xD2D2, 0x4E59, 0xD2D3, 0x77E3, 0xD2D4, 0x4EE5, 0xD2D5, 0x827A, 0xD2D6, 0x6291, 0xD2D7, 0x6613, + 0xD2D8, 0x9091, 0xD2D9, 0x5C79, 0xD2DA, 0x4EBF, 0xD2DB, 0x5F79, 0xD2DC, 0x81C6, 0xD2DD, 0x9038, 0xD2DE, 0x8084, 0xD2DF, 0x75AB, + 0xD2E0, 0x4EA6, 0xD2E1, 0x88D4, 0xD2E2, 0x610F, 0xD2E3, 0x6BC5, 0xD2E4, 0x5FC6, 0xD2E5, 0x4E49, 0xD2E6, 0x76CA, 0xD2E7, 0x6EA2, + 0xD2E8, 0x8BE3, 0xD2E9, 0x8BAE, 0xD2EA, 0x8C0A, 0xD2EB, 0x8BD1, 0xD2EC, 0x5F02, 0xD2ED, 0x7FFC, 0xD2EE, 0x7FCC, 0xD2EF, 0x7ECE, + 0xD2F0, 0x8335, 0xD2F1, 0x836B, 0xD2F2, 0x56E0, 0xD2F3, 0x6BB7, 0xD2F4, 0x97F3, 0xD2F5, 0x9634, 0xD2F6, 0x59FB, 0xD2F7, 0x541F, + 0xD2F8, 0x94F6, 0xD2F9, 0x6DEB, 0xD2FA, 0x5BC5, 0xD2FB, 0x996E, 0xD2FC, 0x5C39, 0xD2FD, 0x5F15, 0xD2FE, 0x9690, 0xD340, 0x89A2, + 0xD341, 0x89A3, 0xD342, 0x89A4, 0xD343, 0x89A5, 0xD344, 0x89A6, 0xD345, 0x89A7, 0xD346, 0x89A8, 0xD347, 0x89A9, 0xD348, 0x89AA, + 0xD349, 0x89AB, 0xD34A, 0x89AC, 0xD34B, 0x89AD, 0xD34C, 0x89AE, 0xD34D, 0x89AF, 0xD34E, 0x89B0, 0xD34F, 0x89B1, 0xD350, 0x89B2, + 0xD351, 0x89B3, 0xD352, 0x89B4, 0xD353, 0x89B5, 0xD354, 0x89B6, 0xD355, 0x89B7, 0xD356, 0x89B8, 0xD357, 0x89B9, 0xD358, 0x89BA, + 0xD359, 0x89BB, 0xD35A, 0x89BC, 0xD35B, 0x89BD, 0xD35C, 0x89BE, 0xD35D, 0x89BF, 0xD35E, 0x89C0, 0xD35F, 0x89C3, 0xD360, 0x89CD, + 0xD361, 0x89D3, 0xD362, 0x89D4, 0xD363, 0x89D5, 0xD364, 0x89D7, 0xD365, 0x89D8, 0xD366, 0x89D9, 0xD367, 0x89DB, 0xD368, 0x89DD, + 0xD369, 0x89DF, 0xD36A, 0x89E0, 0xD36B, 0x89E1, 0xD36C, 0x89E2, 0xD36D, 0x89E4, 0xD36E, 0x89E7, 0xD36F, 0x89E8, 0xD370, 0x89E9, + 0xD371, 0x89EA, 0xD372, 0x89EC, 0xD373, 0x89ED, 0xD374, 0x89EE, 0xD375, 0x89F0, 0xD376, 0x89F1, 0xD377, 0x89F2, 0xD378, 0x89F4, + 0xD379, 0x89F5, 0xD37A, 0x89F6, 0xD37B, 0x89F7, 0xD37C, 0x89F8, 0xD37D, 0x89F9, 0xD37E, 0x89FA, 0xD380, 0x89FB, 0xD381, 0x89FC, + 0xD382, 0x89FD, 0xD383, 0x89FE, 0xD384, 0x89FF, 0xD385, 0x8A01, 0xD386, 0x8A02, 0xD387, 0x8A03, 0xD388, 0x8A04, 0xD389, 0x8A05, + 0xD38A, 0x8A06, 0xD38B, 0x8A08, 0xD38C, 0x8A09, 0xD38D, 0x8A0A, 0xD38E, 0x8A0B, 0xD38F, 0x8A0C, 0xD390, 0x8A0D, 0xD391, 0x8A0E, + 0xD392, 0x8A0F, 0xD393, 0x8A10, 0xD394, 0x8A11, 0xD395, 0x8A12, 0xD396, 0x8A13, 0xD397, 0x8A14, 0xD398, 0x8A15, 0xD399, 0x8A16, + 0xD39A, 0x8A17, 0xD39B, 0x8A18, 0xD39C, 0x8A19, 0xD39D, 0x8A1A, 0xD39E, 0x8A1B, 0xD39F, 0x8A1C, 0xD3A0, 0x8A1D, 0xD3A1, 0x5370, + 0xD3A2, 0x82F1, 0xD3A3, 0x6A31, 0xD3A4, 0x5A74, 0xD3A5, 0x9E70, 0xD3A6, 0x5E94, 0xD3A7, 0x7F28, 0xD3A8, 0x83B9, 0xD3A9, 0x8424, + 0xD3AA, 0x8425, 0xD3AB, 0x8367, 0xD3AC, 0x8747, 0xD3AD, 0x8FCE, 0xD3AE, 0x8D62, 0xD3AF, 0x76C8, 0xD3B0, 0x5F71, 0xD3B1, 0x9896, + 0xD3B2, 0x786C, 0xD3B3, 0x6620, 0xD3B4, 0x54DF, 0xD3B5, 0x62E5, 0xD3B6, 0x4F63, 0xD3B7, 0x81C3, 0xD3B8, 0x75C8, 0xD3B9, 0x5EB8, + 0xD3BA, 0x96CD, 0xD3BB, 0x8E0A, 0xD3BC, 0x86F9, 0xD3BD, 0x548F, 0xD3BE, 0x6CF3, 0xD3BF, 0x6D8C, 0xD3C0, 0x6C38, 0xD3C1, 0x607F, + 0xD3C2, 0x52C7, 0xD3C3, 0x7528, 0xD3C4, 0x5E7D, 0xD3C5, 0x4F18, 0xD3C6, 0x60A0, 0xD3C7, 0x5FE7, 0xD3C8, 0x5C24, 0xD3C9, 0x7531, + 0xD3CA, 0x90AE, 0xD3CB, 0x94C0, 0xD3CC, 0x72B9, 0xD3CD, 0x6CB9, 0xD3CE, 0x6E38, 0xD3CF, 0x9149, 0xD3D0, 0x6709, 0xD3D1, 0x53CB, + 0xD3D2, 0x53F3, 0xD3D3, 0x4F51, 0xD3D4, 0x91C9, 0xD3D5, 0x8BF1, 0xD3D6, 0x53C8, 0xD3D7, 0x5E7C, 0xD3D8, 0x8FC2, 0xD3D9, 0x6DE4, + 0xD3DA, 0x4E8E, 0xD3DB, 0x76C2, 0xD3DC, 0x6986, 0xD3DD, 0x865E, 0xD3DE, 0x611A, 0xD3DF, 0x8206, 0xD3E0, 0x4F59, 0xD3E1, 0x4FDE, + 0xD3E2, 0x903E, 0xD3E3, 0x9C7C, 0xD3E4, 0x6109, 0xD3E5, 0x6E1D, 0xD3E6, 0x6E14, 0xD3E7, 0x9685, 0xD3E8, 0x4E88, 0xD3E9, 0x5A31, + 0xD3EA, 0x96E8, 0xD3EB, 0x4E0E, 0xD3EC, 0x5C7F, 0xD3ED, 0x79B9, 0xD3EE, 0x5B87, 0xD3EF, 0x8BED, 0xD3F0, 0x7FBD, 0xD3F1, 0x7389, + 0xD3F2, 0x57DF, 0xD3F3, 0x828B, 0xD3F4, 0x90C1, 0xD3F5, 0x5401, 0xD3F6, 0x9047, 0xD3F7, 0x55BB, 0xD3F8, 0x5CEA, 0xD3F9, 0x5FA1, + 0xD3FA, 0x6108, 0xD3FB, 0x6B32, 0xD3FC, 0x72F1, 0xD3FD, 0x80B2, 0xD3FE, 0x8A89, 0xD440, 0x8A1E, 0xD441, 0x8A1F, 0xD442, 0x8A20, + 0xD443, 0x8A21, 0xD444, 0x8A22, 0xD445, 0x8A23, 0xD446, 0x8A24, 0xD447, 0x8A25, 0xD448, 0x8A26, 0xD449, 0x8A27, 0xD44A, 0x8A28, + 0xD44B, 0x8A29, 0xD44C, 0x8A2A, 0xD44D, 0x8A2B, 0xD44E, 0x8A2C, 0xD44F, 0x8A2D, 0xD450, 0x8A2E, 0xD451, 0x8A2F, 0xD452, 0x8A30, + 0xD453, 0x8A31, 0xD454, 0x8A32, 0xD455, 0x8A33, 0xD456, 0x8A34, 0xD457, 0x8A35, 0xD458, 0x8A36, 0xD459, 0x8A37, 0xD45A, 0x8A38, + 0xD45B, 0x8A39, 0xD45C, 0x8A3A, 0xD45D, 0x8A3B, 0xD45E, 0x8A3C, 0xD45F, 0x8A3D, 0xD460, 0x8A3F, 0xD461, 0x8A40, 0xD462, 0x8A41, + 0xD463, 0x8A42, 0xD464, 0x8A43, 0xD465, 0x8A44, 0xD466, 0x8A45, 0xD467, 0x8A46, 0xD468, 0x8A47, 0xD469, 0x8A49, 0xD46A, 0x8A4A, + 0xD46B, 0x8A4B, 0xD46C, 0x8A4C, 0xD46D, 0x8A4D, 0xD46E, 0x8A4E, 0xD46F, 0x8A4F, 0xD470, 0x8A50, 0xD471, 0x8A51, 0xD472, 0x8A52, + 0xD473, 0x8A53, 0xD474, 0x8A54, 0xD475, 0x8A55, 0xD476, 0x8A56, 0xD477, 0x8A57, 0xD478, 0x8A58, 0xD479, 0x8A59, 0xD47A, 0x8A5A, + 0xD47B, 0x8A5B, 0xD47C, 0x8A5C, 0xD47D, 0x8A5D, 0xD47E, 0x8A5E, 0xD480, 0x8A5F, 0xD481, 0x8A60, 0xD482, 0x8A61, 0xD483, 0x8A62, + 0xD484, 0x8A63, 0xD485, 0x8A64, 0xD486, 0x8A65, 0xD487, 0x8A66, 0xD488, 0x8A67, 0xD489, 0x8A68, 0xD48A, 0x8A69, 0xD48B, 0x8A6A, + 0xD48C, 0x8A6B, 0xD48D, 0x8A6C, 0xD48E, 0x8A6D, 0xD48F, 0x8A6E, 0xD490, 0x8A6F, 0xD491, 0x8A70, 0xD492, 0x8A71, 0xD493, 0x8A72, + 0xD494, 0x8A73, 0xD495, 0x8A74, 0xD496, 0x8A75, 0xD497, 0x8A76, 0xD498, 0x8A77, 0xD499, 0x8A78, 0xD49A, 0x8A7A, 0xD49B, 0x8A7B, + 0xD49C, 0x8A7C, 0xD49D, 0x8A7D, 0xD49E, 0x8A7E, 0xD49F, 0x8A7F, 0xD4A0, 0x8A80, 0xD4A1, 0x6D74, 0xD4A2, 0x5BD3, 0xD4A3, 0x88D5, + 0xD4A4, 0x9884, 0xD4A5, 0x8C6B, 0xD4A6, 0x9A6D, 0xD4A7, 0x9E33, 0xD4A8, 0x6E0A, 0xD4A9, 0x51A4, 0xD4AA, 0x5143, 0xD4AB, 0x57A3, + 0xD4AC, 0x8881, 0xD4AD, 0x539F, 0xD4AE, 0x63F4, 0xD4AF, 0x8F95, 0xD4B0, 0x56ED, 0xD4B1, 0x5458, 0xD4B2, 0x5706, 0xD4B3, 0x733F, + 0xD4B4, 0x6E90, 0xD4B5, 0x7F18, 0xD4B6, 0x8FDC, 0xD4B7, 0x82D1, 0xD4B8, 0x613F, 0xD4B9, 0x6028, 0xD4BA, 0x9662, 0xD4BB, 0x66F0, + 0xD4BC, 0x7EA6, 0xD4BD, 0x8D8A, 0xD4BE, 0x8DC3, 0xD4BF, 0x94A5, 0xD4C0, 0x5CB3, 0xD4C1, 0x7CA4, 0xD4C2, 0x6708, 0xD4C3, 0x60A6, + 0xD4C4, 0x9605, 0xD4C5, 0x8018, 0xD4C6, 0x4E91, 0xD4C7, 0x90E7, 0xD4C8, 0x5300, 0xD4C9, 0x9668, 0xD4CA, 0x5141, 0xD4CB, 0x8FD0, + 0xD4CC, 0x8574, 0xD4CD, 0x915D, 0xD4CE, 0x6655, 0xD4CF, 0x97F5, 0xD4D0, 0x5B55, 0xD4D1, 0x531D, 0xD4D2, 0x7838, 0xD4D3, 0x6742, + 0xD4D4, 0x683D, 0xD4D5, 0x54C9, 0xD4D6, 0x707E, 0xD4D7, 0x5BB0, 0xD4D8, 0x8F7D, 0xD4D9, 0x518D, 0xD4DA, 0x5728, 0xD4DB, 0x54B1, + 0xD4DC, 0x6512, 0xD4DD, 0x6682, 0xD4DE, 0x8D5E, 0xD4DF, 0x8D43, 0xD4E0, 0x810F, 0xD4E1, 0x846C, 0xD4E2, 0x906D, 0xD4E3, 0x7CDF, + 0xD4E4, 0x51FF, 0xD4E5, 0x85FB, 0xD4E6, 0x67A3, 0xD4E7, 0x65E9, 0xD4E8, 0x6FA1, 0xD4E9, 0x86A4, 0xD4EA, 0x8E81, 0xD4EB, 0x566A, + 0xD4EC, 0x9020, 0xD4ED, 0x7682, 0xD4EE, 0x7076, 0xD4EF, 0x71E5, 0xD4F0, 0x8D23, 0xD4F1, 0x62E9, 0xD4F2, 0x5219, 0xD4F3, 0x6CFD, + 0xD4F4, 0x8D3C, 0xD4F5, 0x600E, 0xD4F6, 0x589E, 0xD4F7, 0x618E, 0xD4F8, 0x66FE, 0xD4F9, 0x8D60, 0xD4FA, 0x624E, 0xD4FB, 0x55B3, + 0xD4FC, 0x6E23, 0xD4FD, 0x672D, 0xD4FE, 0x8F67, 0xD540, 0x8A81, 0xD541, 0x8A82, 0xD542, 0x8A83, 0xD543, 0x8A84, 0xD544, 0x8A85, + 0xD545, 0x8A86, 0xD546, 0x8A87, 0xD547, 0x8A88, 0xD548, 0x8A8B, 0xD549, 0x8A8C, 0xD54A, 0x8A8D, 0xD54B, 0x8A8E, 0xD54C, 0x8A8F, + 0xD54D, 0x8A90, 0xD54E, 0x8A91, 0xD54F, 0x8A92, 0xD550, 0x8A94, 0xD551, 0x8A95, 0xD552, 0x8A96, 0xD553, 0x8A97, 0xD554, 0x8A98, + 0xD555, 0x8A99, 0xD556, 0x8A9A, 0xD557, 0x8A9B, 0xD558, 0x8A9C, 0xD559, 0x8A9D, 0xD55A, 0x8A9E, 0xD55B, 0x8A9F, 0xD55C, 0x8AA0, + 0xD55D, 0x8AA1, 0xD55E, 0x8AA2, 0xD55F, 0x8AA3, 0xD560, 0x8AA4, 0xD561, 0x8AA5, 0xD562, 0x8AA6, 0xD563, 0x8AA7, 0xD564, 0x8AA8, + 0xD565, 0x8AA9, 0xD566, 0x8AAA, 0xD567, 0x8AAB, 0xD568, 0x8AAC, 0xD569, 0x8AAD, 0xD56A, 0x8AAE, 0xD56B, 0x8AAF, 0xD56C, 0x8AB0, + 0xD56D, 0x8AB1, 0xD56E, 0x8AB2, 0xD56F, 0x8AB3, 0xD570, 0x8AB4, 0xD571, 0x8AB5, 0xD572, 0x8AB6, 0xD573, 0x8AB7, 0xD574, 0x8AB8, + 0xD575, 0x8AB9, 0xD576, 0x8ABA, 0xD577, 0x8ABB, 0xD578, 0x8ABC, 0xD579, 0x8ABD, 0xD57A, 0x8ABE, 0xD57B, 0x8ABF, 0xD57C, 0x8AC0, + 0xD57D, 0x8AC1, 0xD57E, 0x8AC2, 0xD580, 0x8AC3, 0xD581, 0x8AC4, 0xD582, 0x8AC5, 0xD583, 0x8AC6, 0xD584, 0x8AC7, 0xD585, 0x8AC8, + 0xD586, 0x8AC9, 0xD587, 0x8ACA, 0xD588, 0x8ACB, 0xD589, 0x8ACC, 0xD58A, 0x8ACD, 0xD58B, 0x8ACE, 0xD58C, 0x8ACF, 0xD58D, 0x8AD0, + 0xD58E, 0x8AD1, 0xD58F, 0x8AD2, 0xD590, 0x8AD3, 0xD591, 0x8AD4, 0xD592, 0x8AD5, 0xD593, 0x8AD6, 0xD594, 0x8AD7, 0xD595, 0x8AD8, + 0xD596, 0x8AD9, 0xD597, 0x8ADA, 0xD598, 0x8ADB, 0xD599, 0x8ADC, 0xD59A, 0x8ADD, 0xD59B, 0x8ADE, 0xD59C, 0x8ADF, 0xD59D, 0x8AE0, + 0xD59E, 0x8AE1, 0xD59F, 0x8AE2, 0xD5A0, 0x8AE3, 0xD5A1, 0x94E1, 0xD5A2, 0x95F8, 0xD5A3, 0x7728, 0xD5A4, 0x6805, 0xD5A5, 0x69A8, + 0xD5A6, 0x548B, 0xD5A7, 0x4E4D, 0xD5A8, 0x70B8, 0xD5A9, 0x8BC8, 0xD5AA, 0x6458, 0xD5AB, 0x658B, 0xD5AC, 0x5B85, 0xD5AD, 0x7A84, + 0xD5AE, 0x503A, 0xD5AF, 0x5BE8, 0xD5B0, 0x77BB, 0xD5B1, 0x6BE1, 0xD5B2, 0x8A79, 0xD5B3, 0x7C98, 0xD5B4, 0x6CBE, 0xD5B5, 0x76CF, + 0xD5B6, 0x65A9, 0xD5B7, 0x8F97, 0xD5B8, 0x5D2D, 0xD5B9, 0x5C55, 0xD5BA, 0x8638, 0xD5BB, 0x6808, 0xD5BC, 0x5360, 0xD5BD, 0x6218, + 0xD5BE, 0x7AD9, 0xD5BF, 0x6E5B, 0xD5C0, 0x7EFD, 0xD5C1, 0x6A1F, 0xD5C2, 0x7AE0, 0xD5C3, 0x5F70, 0xD5C4, 0x6F33, 0xD5C5, 0x5F20, + 0xD5C6, 0x638C, 0xD5C7, 0x6DA8, 0xD5C8, 0x6756, 0xD5C9, 0x4E08, 0xD5CA, 0x5E10, 0xD5CB, 0x8D26, 0xD5CC, 0x4ED7, 0xD5CD, 0x80C0, + 0xD5CE, 0x7634, 0xD5CF, 0x969C, 0xD5D0, 0x62DB, 0xD5D1, 0x662D, 0xD5D2, 0x627E, 0xD5D3, 0x6CBC, 0xD5D4, 0x8D75, 0xD5D5, 0x7167, + 0xD5D6, 0x7F69, 0xD5D7, 0x5146, 0xD5D8, 0x8087, 0xD5D9, 0x53EC, 0xD5DA, 0x906E, 0xD5DB, 0x6298, 0xD5DC, 0x54F2, 0xD5DD, 0x86F0, + 0xD5DE, 0x8F99, 0xD5DF, 0x8005, 0xD5E0, 0x9517, 0xD5E1, 0x8517, 0xD5E2, 0x8FD9, 0xD5E3, 0x6D59, 0xD5E4, 0x73CD, 0xD5E5, 0x659F, + 0xD5E6, 0x771F, 0xD5E7, 0x7504, 0xD5E8, 0x7827, 0xD5E9, 0x81FB, 0xD5EA, 0x8D1E, 0xD5EB, 0x9488, 0xD5EC, 0x4FA6, 0xD5ED, 0x6795, + 0xD5EE, 0x75B9, 0xD5EF, 0x8BCA, 0xD5F0, 0x9707, 0xD5F1, 0x632F, 0xD5F2, 0x9547, 0xD5F3, 0x9635, 0xD5F4, 0x84B8, 0xD5F5, 0x6323, + 0xD5F6, 0x7741, 0xD5F7, 0x5F81, 0xD5F8, 0x72F0, 0xD5F9, 0x4E89, 0xD5FA, 0x6014, 0xD5FB, 0x6574, 0xD5FC, 0x62EF, 0xD5FD, 0x6B63, + 0xD5FE, 0x653F, 0xD640, 0x8AE4, 0xD641, 0x8AE5, 0xD642, 0x8AE6, 0xD643, 0x8AE7, 0xD644, 0x8AE8, 0xD645, 0x8AE9, 0xD646, 0x8AEA, + 0xD647, 0x8AEB, 0xD648, 0x8AEC, 0xD649, 0x8AED, 0xD64A, 0x8AEE, 0xD64B, 0x8AEF, 0xD64C, 0x8AF0, 0xD64D, 0x8AF1, 0xD64E, 0x8AF2, + 0xD64F, 0x8AF3, 0xD650, 0x8AF4, 0xD651, 0x8AF5, 0xD652, 0x8AF6, 0xD653, 0x8AF7, 0xD654, 0x8AF8, 0xD655, 0x8AF9, 0xD656, 0x8AFA, + 0xD657, 0x8AFB, 0xD658, 0x8AFC, 0xD659, 0x8AFD, 0xD65A, 0x8AFE, 0xD65B, 0x8AFF, 0xD65C, 0x8B00, 0xD65D, 0x8B01, 0xD65E, 0x8B02, + 0xD65F, 0x8B03, 0xD660, 0x8B04, 0xD661, 0x8B05, 0xD662, 0x8B06, 0xD663, 0x8B08, 0xD664, 0x8B09, 0xD665, 0x8B0A, 0xD666, 0x8B0B, + 0xD667, 0x8B0C, 0xD668, 0x8B0D, 0xD669, 0x8B0E, 0xD66A, 0x8B0F, 0xD66B, 0x8B10, 0xD66C, 0x8B11, 0xD66D, 0x8B12, 0xD66E, 0x8B13, + 0xD66F, 0x8B14, 0xD670, 0x8B15, 0xD671, 0x8B16, 0xD672, 0x8B17, 0xD673, 0x8B18, 0xD674, 0x8B19, 0xD675, 0x8B1A, 0xD676, 0x8B1B, + 0xD677, 0x8B1C, 0xD678, 0x8B1D, 0xD679, 0x8B1E, 0xD67A, 0x8B1F, 0xD67B, 0x8B20, 0xD67C, 0x8B21, 0xD67D, 0x8B22, 0xD67E, 0x8B23, + 0xD680, 0x8B24, 0xD681, 0x8B25, 0xD682, 0x8B27, 0xD683, 0x8B28, 0xD684, 0x8B29, 0xD685, 0x8B2A, 0xD686, 0x8B2B, 0xD687, 0x8B2C, + 0xD688, 0x8B2D, 0xD689, 0x8B2E, 0xD68A, 0x8B2F, 0xD68B, 0x8B30, 0xD68C, 0x8B31, 0xD68D, 0x8B32, 0xD68E, 0x8B33, 0xD68F, 0x8B34, + 0xD690, 0x8B35, 0xD691, 0x8B36, 0xD692, 0x8B37, 0xD693, 0x8B38, 0xD694, 0x8B39, 0xD695, 0x8B3A, 0xD696, 0x8B3B, 0xD697, 0x8B3C, + 0xD698, 0x8B3D, 0xD699, 0x8B3E, 0xD69A, 0x8B3F, 0xD69B, 0x8B40, 0xD69C, 0x8B41, 0xD69D, 0x8B42, 0xD69E, 0x8B43, 0xD69F, 0x8B44, + 0xD6A0, 0x8B45, 0xD6A1, 0x5E27, 0xD6A2, 0x75C7, 0xD6A3, 0x90D1, 0xD6A4, 0x8BC1, 0xD6A5, 0x829D, 0xD6A6, 0x679D, 0xD6A7, 0x652F, + 0xD6A8, 0x5431, 0xD6A9, 0x8718, 0xD6AA, 0x77E5, 0xD6AB, 0x80A2, 0xD6AC, 0x8102, 0xD6AD, 0x6C41, 0xD6AE, 0x4E4B, 0xD6AF, 0x7EC7, + 0xD6B0, 0x804C, 0xD6B1, 0x76F4, 0xD6B2, 0x690D, 0xD6B3, 0x6B96, 0xD6B4, 0x6267, 0xD6B5, 0x503C, 0xD6B6, 0x4F84, 0xD6B7, 0x5740, + 0xD6B8, 0x6307, 0xD6B9, 0x6B62, 0xD6BA, 0x8DBE, 0xD6BB, 0x53EA, 0xD6BC, 0x65E8, 0xD6BD, 0x7EB8, 0xD6BE, 0x5FD7, 0xD6BF, 0x631A, + 0xD6C0, 0x63B7, 0xD6C1, 0x81F3, 0xD6C2, 0x81F4, 0xD6C3, 0x7F6E, 0xD6C4, 0x5E1C, 0xD6C5, 0x5CD9, 0xD6C6, 0x5236, 0xD6C7, 0x667A, + 0xD6C8, 0x79E9, 0xD6C9, 0x7A1A, 0xD6CA, 0x8D28, 0xD6CB, 0x7099, 0xD6CC, 0x75D4, 0xD6CD, 0x6EDE, 0xD6CE, 0x6CBB, 0xD6CF, 0x7A92, + 0xD6D0, 0x4E2D, 0xD6D1, 0x76C5, 0xD6D2, 0x5FE0, 0xD6D3, 0x949F, 0xD6D4, 0x8877, 0xD6D5, 0x7EC8, 0xD6D6, 0x79CD, 0xD6D7, 0x80BF, + 0xD6D8, 0x91CD, 0xD6D9, 0x4EF2, 0xD6DA, 0x4F17, 0xD6DB, 0x821F, 0xD6DC, 0x5468, 0xD6DD, 0x5DDE, 0xD6DE, 0x6D32, 0xD6DF, 0x8BCC, + 0xD6E0, 0x7CA5, 0xD6E1, 0x8F74, 0xD6E2, 0x8098, 0xD6E3, 0x5E1A, 0xD6E4, 0x5492, 0xD6E5, 0x76B1, 0xD6E6, 0x5B99, 0xD6E7, 0x663C, + 0xD6E8, 0x9AA4, 0xD6E9, 0x73E0, 0xD6EA, 0x682A, 0xD6EB, 0x86DB, 0xD6EC, 0x6731, 0xD6ED, 0x732A, 0xD6EE, 0x8BF8, 0xD6EF, 0x8BDB, + 0xD6F0, 0x9010, 0xD6F1, 0x7AF9, 0xD6F2, 0x70DB, 0xD6F3, 0x716E, 0xD6F4, 0x62C4, 0xD6F5, 0x77A9, 0xD6F6, 0x5631, 0xD6F7, 0x4E3B, + 0xD6F8, 0x8457, 0xD6F9, 0x67F1, 0xD6FA, 0x52A9, 0xD6FB, 0x86C0, 0xD6FC, 0x8D2E, 0xD6FD, 0x94F8, 0xD6FE, 0x7B51, 0xD740, 0x8B46, + 0xD741, 0x8B47, 0xD742, 0x8B48, 0xD743, 0x8B49, 0xD744, 0x8B4A, 0xD745, 0x8B4B, 0xD746, 0x8B4C, 0xD747, 0x8B4D, 0xD748, 0x8B4E, + 0xD749, 0x8B4F, 0xD74A, 0x8B50, 0xD74B, 0x8B51, 0xD74C, 0x8B52, 0xD74D, 0x8B53, 0xD74E, 0x8B54, 0xD74F, 0x8B55, 0xD750, 0x8B56, + 0xD751, 0x8B57, 0xD752, 0x8B58, 0xD753, 0x8B59, 0xD754, 0x8B5A, 0xD755, 0x8B5B, 0xD756, 0x8B5C, 0xD757, 0x8B5D, 0xD758, 0x8B5E, + 0xD759, 0x8B5F, 0xD75A, 0x8B60, 0xD75B, 0x8B61, 0xD75C, 0x8B62, 0xD75D, 0x8B63, 0xD75E, 0x8B64, 0xD75F, 0x8B65, 0xD760, 0x8B67, + 0xD761, 0x8B68, 0xD762, 0x8B69, 0xD763, 0x8B6A, 0xD764, 0x8B6B, 0xD765, 0x8B6D, 0xD766, 0x8B6E, 0xD767, 0x8B6F, 0xD768, 0x8B70, + 0xD769, 0x8B71, 0xD76A, 0x8B72, 0xD76B, 0x8B73, 0xD76C, 0x8B74, 0xD76D, 0x8B75, 0xD76E, 0x8B76, 0xD76F, 0x8B77, 0xD770, 0x8B78, + 0xD771, 0x8B79, 0xD772, 0x8B7A, 0xD773, 0x8B7B, 0xD774, 0x8B7C, 0xD775, 0x8B7D, 0xD776, 0x8B7E, 0xD777, 0x8B7F, 0xD778, 0x8B80, + 0xD779, 0x8B81, 0xD77A, 0x8B82, 0xD77B, 0x8B83, 0xD77C, 0x8B84, 0xD77D, 0x8B85, 0xD77E, 0x8B86, 0xD780, 0x8B87, 0xD781, 0x8B88, + 0xD782, 0x8B89, 0xD783, 0x8B8A, 0xD784, 0x8B8B, 0xD785, 0x8B8C, 0xD786, 0x8B8D, 0xD787, 0x8B8E, 0xD788, 0x8B8F, 0xD789, 0x8B90, + 0xD78A, 0x8B91, 0xD78B, 0x8B92, 0xD78C, 0x8B93, 0xD78D, 0x8B94, 0xD78E, 0x8B95, 0xD78F, 0x8B96, 0xD790, 0x8B97, 0xD791, 0x8B98, + 0xD792, 0x8B99, 0xD793, 0x8B9A, 0xD794, 0x8B9B, 0xD795, 0x8B9C, 0xD796, 0x8B9D, 0xD797, 0x8B9E, 0xD798, 0x8B9F, 0xD799, 0x8BAC, + 0xD79A, 0x8BB1, 0xD79B, 0x8BBB, 0xD79C, 0x8BC7, 0xD79D, 0x8BD0, 0xD79E, 0x8BEA, 0xD79F, 0x8C09, 0xD7A0, 0x8C1E, 0xD7A1, 0x4F4F, + 0xD7A2, 0x6CE8, 0xD7A3, 0x795D, 0xD7A4, 0x9A7B, 0xD7A5, 0x6293, 0xD7A6, 0x722A, 0xD7A7, 0x62FD, 0xD7A8, 0x4E13, 0xD7A9, 0x7816, + 0xD7AA, 0x8F6C, 0xD7AB, 0x64B0, 0xD7AC, 0x8D5A, 0xD7AD, 0x7BC6, 0xD7AE, 0x6869, 0xD7AF, 0x5E84, 0xD7B0, 0x88C5, 0xD7B1, 0x5986, + 0xD7B2, 0x649E, 0xD7B3, 0x58EE, 0xD7B4, 0x72B6, 0xD7B5, 0x690E, 0xD7B6, 0x9525, 0xD7B7, 0x8FFD, 0xD7B8, 0x8D58, 0xD7B9, 0x5760, + 0xD7BA, 0x7F00, 0xD7BB, 0x8C06, 0xD7BC, 0x51C6, 0xD7BD, 0x6349, 0xD7BE, 0x62D9, 0xD7BF, 0x5353, 0xD7C0, 0x684C, 0xD7C1, 0x7422, + 0xD7C2, 0x8301, 0xD7C3, 0x914C, 0xD7C4, 0x5544, 0xD7C5, 0x7740, 0xD7C6, 0x707C, 0xD7C7, 0x6D4A, 0xD7C8, 0x5179, 0xD7C9, 0x54A8, + 0xD7CA, 0x8D44, 0xD7CB, 0x59FF, 0xD7CC, 0x6ECB, 0xD7CD, 0x6DC4, 0xD7CE, 0x5B5C, 0xD7CF, 0x7D2B, 0xD7D0, 0x4ED4, 0xD7D1, 0x7C7D, + 0xD7D2, 0x6ED3, 0xD7D3, 0x5B50, 0xD7D4, 0x81EA, 0xD7D5, 0x6E0D, 0xD7D6, 0x5B57, 0xD7D7, 0x9B03, 0xD7D8, 0x68D5, 0xD7D9, 0x8E2A, + 0xD7DA, 0x5B97, 0xD7DB, 0x7EFC, 0xD7DC, 0x603B, 0xD7DD, 0x7EB5, 0xD7DE, 0x90B9, 0xD7DF, 0x8D70, 0xD7E0, 0x594F, 0xD7E1, 0x63CD, + 0xD7E2, 0x79DF, 0xD7E3, 0x8DB3, 0xD7E4, 0x5352, 0xD7E5, 0x65CF, 0xD7E6, 0x7956, 0xD7E7, 0x8BC5, 0xD7E8, 0x963B, 0xD7E9, 0x7EC4, + 0xD7EA, 0x94BB, 0xD7EB, 0x7E82, 0xD7EC, 0x5634, 0xD7ED, 0x9189, 0xD7EE, 0x6700, 0xD7EF, 0x7F6A, 0xD7F0, 0x5C0A, 0xD7F1, 0x9075, + 0xD7F2, 0x6628, 0xD7F3, 0x5DE6, 0xD7F4, 0x4F50, 0xD7F5, 0x67DE, 0xD7F6, 0x505A, 0xD7F7, 0x4F5C, 0xD7F8, 0x5750, 0xD7F9, 0x5EA7, + 0xD840, 0x8C38, 0xD841, 0x8C39, 0xD842, 0x8C3A, 0xD843, 0x8C3B, 0xD844, 0x8C3C, 0xD845, 0x8C3D, 0xD846, 0x8C3E, 0xD847, 0x8C3F, + 0xD848, 0x8C40, 0xD849, 0x8C42, 0xD84A, 0x8C43, 0xD84B, 0x8C44, 0xD84C, 0x8C45, 0xD84D, 0x8C48, 0xD84E, 0x8C4A, 0xD84F, 0x8C4B, + 0xD850, 0x8C4D, 0xD851, 0x8C4E, 0xD852, 0x8C4F, 0xD853, 0x8C50, 0xD854, 0x8C51, 0xD855, 0x8C52, 0xD856, 0x8C53, 0xD857, 0x8C54, + 0xD858, 0x8C56, 0xD859, 0x8C57, 0xD85A, 0x8C58, 0xD85B, 0x8C59, 0xD85C, 0x8C5B, 0xD85D, 0x8C5C, 0xD85E, 0x8C5D, 0xD85F, 0x8C5E, + 0xD860, 0x8C5F, 0xD861, 0x8C60, 0xD862, 0x8C63, 0xD863, 0x8C64, 0xD864, 0x8C65, 0xD865, 0x8C66, 0xD866, 0x8C67, 0xD867, 0x8C68, + 0xD868, 0x8C69, 0xD869, 0x8C6C, 0xD86A, 0x8C6D, 0xD86B, 0x8C6E, 0xD86C, 0x8C6F, 0xD86D, 0x8C70, 0xD86E, 0x8C71, 0xD86F, 0x8C72, + 0xD870, 0x8C74, 0xD871, 0x8C75, 0xD872, 0x8C76, 0xD873, 0x8C77, 0xD874, 0x8C7B, 0xD875, 0x8C7C, 0xD876, 0x8C7D, 0xD877, 0x8C7E, + 0xD878, 0x8C7F, 0xD879, 0x8C80, 0xD87A, 0x8C81, 0xD87B, 0x8C83, 0xD87C, 0x8C84, 0xD87D, 0x8C86, 0xD87E, 0x8C87, 0xD880, 0x8C88, + 0xD881, 0x8C8B, 0xD882, 0x8C8D, 0xD883, 0x8C8E, 0xD884, 0x8C8F, 0xD885, 0x8C90, 0xD886, 0x8C91, 0xD887, 0x8C92, 0xD888, 0x8C93, + 0xD889, 0x8C95, 0xD88A, 0x8C96, 0xD88B, 0x8C97, 0xD88C, 0x8C99, 0xD88D, 0x8C9A, 0xD88E, 0x8C9B, 0xD88F, 0x8C9C, 0xD890, 0x8C9D, + 0xD891, 0x8C9E, 0xD892, 0x8C9F, 0xD893, 0x8CA0, 0xD894, 0x8CA1, 0xD895, 0x8CA2, 0xD896, 0x8CA3, 0xD897, 0x8CA4, 0xD898, 0x8CA5, + 0xD899, 0x8CA6, 0xD89A, 0x8CA7, 0xD89B, 0x8CA8, 0xD89C, 0x8CA9, 0xD89D, 0x8CAA, 0xD89E, 0x8CAB, 0xD89F, 0x8CAC, 0xD8A0, 0x8CAD, + 0xD8A1, 0x4E8D, 0xD8A2, 0x4E0C, 0xD8A3, 0x5140, 0xD8A4, 0x4E10, 0xD8A5, 0x5EFF, 0xD8A6, 0x5345, 0xD8A7, 0x4E15, 0xD8A8, 0x4E98, + 0xD8A9, 0x4E1E, 0xD8AA, 0x9B32, 0xD8AB, 0x5B6C, 0xD8AC, 0x5669, 0xD8AD, 0x4E28, 0xD8AE, 0x79BA, 0xD8AF, 0x4E3F, 0xD8B0, 0x5315, + 0xD8B1, 0x4E47, 0xD8B2, 0x592D, 0xD8B3, 0x723B, 0xD8B4, 0x536E, 0xD8B5, 0x6C10, 0xD8B6, 0x56DF, 0xD8B7, 0x80E4, 0xD8B8, 0x9997, + 0xD8B9, 0x6BD3, 0xD8BA, 0x777E, 0xD8BB, 0x9F17, 0xD8BC, 0x4E36, 0xD8BD, 0x4E9F, 0xD8BE, 0x9F10, 0xD8BF, 0x4E5C, 0xD8C0, 0x4E69, + 0xD8C1, 0x4E93, 0xD8C2, 0x8288, 0xD8C3, 0x5B5B, 0xD8C4, 0x556C, 0xD8C5, 0x560F, 0xD8C6, 0x4EC4, 0xD8C7, 0x538D, 0xD8C8, 0x539D, + 0xD8C9, 0x53A3, 0xD8CA, 0x53A5, 0xD8CB, 0x53AE, 0xD8CC, 0x9765, 0xD8CD, 0x8D5D, 0xD8CE, 0x531A, 0xD8CF, 0x53F5, 0xD8D0, 0x5326, + 0xD8D1, 0x532E, 0xD8D2, 0x533E, 0xD8D3, 0x8D5C, 0xD8D4, 0x5366, 0xD8D5, 0x5363, 0xD8D6, 0x5202, 0xD8D7, 0x5208, 0xD8D8, 0x520E, + 0xD8D9, 0x522D, 0xD8DA, 0x5233, 0xD8DB, 0x523F, 0xD8DC, 0x5240, 0xD8DD, 0x524C, 0xD8DE, 0x525E, 0xD8DF, 0x5261, 0xD8E0, 0x525C, + 0xD8E1, 0x84AF, 0xD8E2, 0x527D, 0xD8E3, 0x5282, 0xD8E4, 0x5281, 0xD8E5, 0x5290, 0xD8E6, 0x5293, 0xD8E7, 0x5182, 0xD8E8, 0x7F54, + 0xD8E9, 0x4EBB, 0xD8EA, 0x4EC3, 0xD8EB, 0x4EC9, 0xD8EC, 0x4EC2, 0xD8ED, 0x4EE8, 0xD8EE, 0x4EE1, 0xD8EF, 0x4EEB, 0xD8F0, 0x4EDE, + 0xD8F1, 0x4F1B, 0xD8F2, 0x4EF3, 0xD8F3, 0x4F22, 0xD8F4, 0x4F64, 0xD8F5, 0x4EF5, 0xD8F6, 0x4F25, 0xD8F7, 0x4F27, 0xD8F8, 0x4F09, + 0xD8F9, 0x4F2B, 0xD8FA, 0x4F5E, 0xD8FB, 0x4F67, 0xD8FC, 0x6538, 0xD8FD, 0x4F5A, 0xD8FE, 0x4F5D, 0xD940, 0x8CAE, 0xD941, 0x8CAF, + 0xD942, 0x8CB0, 0xD943, 0x8CB1, 0xD944, 0x8CB2, 0xD945, 0x8CB3, 0xD946, 0x8CB4, 0xD947, 0x8CB5, 0xD948, 0x8CB6, 0xD949, 0x8CB7, + 0xD94A, 0x8CB8, 0xD94B, 0x8CB9, 0xD94C, 0x8CBA, 0xD94D, 0x8CBB, 0xD94E, 0x8CBC, 0xD94F, 0x8CBD, 0xD950, 0x8CBE, 0xD951, 0x8CBF, + 0xD952, 0x8CC0, 0xD953, 0x8CC1, 0xD954, 0x8CC2, 0xD955, 0x8CC3, 0xD956, 0x8CC4, 0xD957, 0x8CC5, 0xD958, 0x8CC6, 0xD959, 0x8CC7, + 0xD95A, 0x8CC8, 0xD95B, 0x8CC9, 0xD95C, 0x8CCA, 0xD95D, 0x8CCB, 0xD95E, 0x8CCC, 0xD95F, 0x8CCD, 0xD960, 0x8CCE, 0xD961, 0x8CCF, + 0xD962, 0x8CD0, 0xD963, 0x8CD1, 0xD964, 0x8CD2, 0xD965, 0x8CD3, 0xD966, 0x8CD4, 0xD967, 0x8CD5, 0xD968, 0x8CD6, 0xD969, 0x8CD7, + 0xD96A, 0x8CD8, 0xD96B, 0x8CD9, 0xD96C, 0x8CDA, 0xD96D, 0x8CDB, 0xD96E, 0x8CDC, 0xD96F, 0x8CDD, 0xD970, 0x8CDE, 0xD971, 0x8CDF, + 0xD972, 0x8CE0, 0xD973, 0x8CE1, 0xD974, 0x8CE2, 0xD975, 0x8CE3, 0xD976, 0x8CE4, 0xD977, 0x8CE5, 0xD978, 0x8CE6, 0xD979, 0x8CE7, + 0xD97A, 0x8CE8, 0xD97B, 0x8CE9, 0xD97C, 0x8CEA, 0xD97D, 0x8CEB, 0xD97E, 0x8CEC, 0xD980, 0x8CED, 0xD981, 0x8CEE, 0xD982, 0x8CEF, + 0xD983, 0x8CF0, 0xD984, 0x8CF1, 0xD985, 0x8CF2, 0xD986, 0x8CF3, 0xD987, 0x8CF4, 0xD988, 0x8CF5, 0xD989, 0x8CF6, 0xD98A, 0x8CF7, + 0xD98B, 0x8CF8, 0xD98C, 0x8CF9, 0xD98D, 0x8CFA, 0xD98E, 0x8CFB, 0xD98F, 0x8CFC, 0xD990, 0x8CFD, 0xD991, 0x8CFE, 0xD992, 0x8CFF, + 0xD993, 0x8D00, 0xD994, 0x8D01, 0xD995, 0x8D02, 0xD996, 0x8D03, 0xD997, 0x8D04, 0xD998, 0x8D05, 0xD999, 0x8D06, 0xD99A, 0x8D07, + 0xD99B, 0x8D08, 0xD99C, 0x8D09, 0xD99D, 0x8D0A, 0xD99E, 0x8D0B, 0xD99F, 0x8D0C, 0xD9A0, 0x8D0D, 0xD9A1, 0x4F5F, 0xD9A2, 0x4F57, + 0xD9A3, 0x4F32, 0xD9A4, 0x4F3D, 0xD9A5, 0x4F76, 0xD9A6, 0x4F74, 0xD9A7, 0x4F91, 0xD9A8, 0x4F89, 0xD9A9, 0x4F83, 0xD9AA, 0x4F8F, + 0xD9AB, 0x4F7E, 0xD9AC, 0x4F7B, 0xD9AD, 0x4FAA, 0xD9AE, 0x4F7C, 0xD9AF, 0x4FAC, 0xD9B0, 0x4F94, 0xD9B1, 0x4FE6, 0xD9B2, 0x4FE8, + 0xD9B3, 0x4FEA, 0xD9B4, 0x4FC5, 0xD9B5, 0x4FDA, 0xD9B6, 0x4FE3, 0xD9B7, 0x4FDC, 0xD9B8, 0x4FD1, 0xD9B9, 0x4FDF, 0xD9BA, 0x4FF8, + 0xD9BB, 0x5029, 0xD9BC, 0x504C, 0xD9BD, 0x4FF3, 0xD9BE, 0x502C, 0xD9BF, 0x500F, 0xD9C0, 0x502E, 0xD9C1, 0x502D, 0xD9C2, 0x4FFE, + 0xD9C3, 0x501C, 0xD9C4, 0x500C, 0xD9C5, 0x5025, 0xD9C6, 0x5028, 0xD9C7, 0x507E, 0xD9C8, 0x5043, 0xD9C9, 0x5055, 0xD9CA, 0x5048, + 0xD9CB, 0x504E, 0xD9CC, 0x506C, 0xD9CD, 0x507B, 0xD9CE, 0x50A5, 0xD9CF, 0x50A7, 0xD9D0, 0x50A9, 0xD9D1, 0x50BA, 0xD9D2, 0x50D6, + 0xD9D3, 0x5106, 0xD9D4, 0x50ED, 0xD9D5, 0x50EC, 0xD9D6, 0x50E6, 0xD9D7, 0x50EE, 0xD9D8, 0x5107, 0xD9D9, 0x510B, 0xD9DA, 0x4EDD, + 0xD9DB, 0x6C3D, 0xD9DC, 0x4F58, 0xD9DD, 0x4F65, 0xD9DE, 0x4FCE, 0xD9DF, 0x9FA0, 0xD9E0, 0x6C46, 0xD9E1, 0x7C74, 0xD9E2, 0x516E, + 0xD9E3, 0x5DFD, 0xD9E4, 0x9EC9, 0xD9E5, 0x9998, 0xD9E6, 0x5181, 0xD9E7, 0x5914, 0xD9E8, 0x52F9, 0xD9E9, 0x530D, 0xD9EA, 0x8A07, + 0xD9EB, 0x5310, 0xD9EC, 0x51EB, 0xD9ED, 0x5919, 0xD9EE, 0x5155, 0xD9EF, 0x4EA0, 0xD9F0, 0x5156, 0xD9F1, 0x4EB3, 0xD9F2, 0x886E, + 0xD9F3, 0x88A4, 0xD9F4, 0x4EB5, 0xD9F5, 0x8114, 0xD9F6, 0x88D2, 0xD9F7, 0x7980, 0xD9F8, 0x5B34, 0xD9F9, 0x8803, 0xD9FA, 0x7FB8, + 0xD9FB, 0x51AB, 0xD9FC, 0x51B1, 0xD9FD, 0x51BD, 0xD9FE, 0x51BC, 0xDA40, 0x8D0E, 0xDA41, 0x8D0F, 0xDA42, 0x8D10, 0xDA43, 0x8D11, + 0xDA44, 0x8D12, 0xDA45, 0x8D13, 0xDA46, 0x8D14, 0xDA47, 0x8D15, 0xDA48, 0x8D16, 0xDA49, 0x8D17, 0xDA4A, 0x8D18, 0xDA4B, 0x8D19, + 0xDA4C, 0x8D1A, 0xDA4D, 0x8D1B, 0xDA4E, 0x8D1C, 0xDA4F, 0x8D20, 0xDA50, 0x8D51, 0xDA51, 0x8D52, 0xDA52, 0x8D57, 0xDA53, 0x8D5F, + 0xDA54, 0x8D65, 0xDA55, 0x8D68, 0xDA56, 0x8D69, 0xDA57, 0x8D6A, 0xDA58, 0x8D6C, 0xDA59, 0x8D6E, 0xDA5A, 0x8D6F, 0xDA5B, 0x8D71, + 0xDA5C, 0x8D72, 0xDA5D, 0x8D78, 0xDA5E, 0x8D79, 0xDA5F, 0x8D7A, 0xDA60, 0x8D7B, 0xDA61, 0x8D7C, 0xDA62, 0x8D7D, 0xDA63, 0x8D7E, + 0xDA64, 0x8D7F, 0xDA65, 0x8D80, 0xDA66, 0x8D82, 0xDA67, 0x8D83, 0xDA68, 0x8D86, 0xDA69, 0x8D87, 0xDA6A, 0x8D88, 0xDA6B, 0x8D89, + 0xDA6C, 0x8D8C, 0xDA6D, 0x8D8D, 0xDA6E, 0x8D8E, 0xDA6F, 0x8D8F, 0xDA70, 0x8D90, 0xDA71, 0x8D92, 0xDA72, 0x8D93, 0xDA73, 0x8D95, + 0xDA74, 0x8D96, 0xDA75, 0x8D97, 0xDA76, 0x8D98, 0xDA77, 0x8D99, 0xDA78, 0x8D9A, 0xDA79, 0x8D9B, 0xDA7A, 0x8D9C, 0xDA7B, 0x8D9D, + 0xDA7C, 0x8D9E, 0xDA7D, 0x8DA0, 0xDA7E, 0x8DA1, 0xDA80, 0x8DA2, 0xDA81, 0x8DA4, 0xDA82, 0x8DA5, 0xDA83, 0x8DA6, 0xDA84, 0x8DA7, + 0xDA85, 0x8DA8, 0xDA86, 0x8DA9, 0xDA87, 0x8DAA, 0xDA88, 0x8DAB, 0xDA89, 0x8DAC, 0xDA8A, 0x8DAD, 0xDA8B, 0x8DAE, 0xDA8C, 0x8DAF, + 0xDA8D, 0x8DB0, 0xDA8E, 0x8DB2, 0xDA8F, 0x8DB6, 0xDA90, 0x8DB7, 0xDA91, 0x8DB9, 0xDA92, 0x8DBB, 0xDA93, 0x8DBD, 0xDA94, 0x8DC0, + 0xDA95, 0x8DC1, 0xDA96, 0x8DC2, 0xDA97, 0x8DC5, 0xDA98, 0x8DC7, 0xDA99, 0x8DC8, 0xDA9A, 0x8DC9, 0xDA9B, 0x8DCA, 0xDA9C, 0x8DCD, + 0xDA9D, 0x8DD0, 0xDA9E, 0x8DD2, 0xDA9F, 0x8DD3, 0xDAA0, 0x8DD4, 0xDAA1, 0x51C7, 0xDAA2, 0x5196, 0xDAA3, 0x51A2, 0xDAA4, 0x51A5, + 0xDAA5, 0x8BA0, 0xDAA6, 0x8BA6, 0xDAA7, 0x8BA7, 0xDAA8, 0x8BAA, 0xDAA9, 0x8BB4, 0xDAAA, 0x8BB5, 0xDAAB, 0x8BB7, 0xDAAC, 0x8BC2, + 0xDAAD, 0x8BC3, 0xDAAE, 0x8BCB, 0xDAAF, 0x8BCF, 0xDAB0, 0x8BCE, 0xDAB1, 0x8BD2, 0xDAB2, 0x8BD3, 0xDAB3, 0x8BD4, 0xDAB4, 0x8BD6, + 0xDAB5, 0x8BD8, 0xDAB6, 0x8BD9, 0xDAB7, 0x8BDC, 0xDAB8, 0x8BDF, 0xDAB9, 0x8BE0, 0xDABA, 0x8BE4, 0xDABB, 0x8BE8, 0xDABC, 0x8BE9, + 0xDABD, 0x8BEE, 0xDABE, 0x8BF0, 0xDABF, 0x8BF3, 0xDAC0, 0x8BF6, 0xDAC1, 0x8BF9, 0xDAC2, 0x8BFC, 0xDAC3, 0x8BFF, 0xDAC4, 0x8C00, + 0xDAC5, 0x8C02, 0xDAC6, 0x8C04, 0xDAC7, 0x8C07, 0xDAC8, 0x8C0C, 0xDAC9, 0x8C0F, 0xDACA, 0x8C11, 0xDACB, 0x8C12, 0xDACC, 0x8C14, + 0xDACD, 0x8C15, 0xDACE, 0x8C16, 0xDACF, 0x8C19, 0xDAD0, 0x8C1B, 0xDAD1, 0x8C18, 0xDAD2, 0x8C1D, 0xDAD3, 0x8C1F, 0xDAD4, 0x8C20, + 0xDAD5, 0x8C21, 0xDAD6, 0x8C25, 0xDAD7, 0x8C27, 0xDAD8, 0x8C2A, 0xDAD9, 0x8C2B, 0xDADA, 0x8C2E, 0xDADB, 0x8C2F, 0xDADC, 0x8C32, + 0xDADD, 0x8C33, 0xDADE, 0x8C35, 0xDADF, 0x8C36, 0xDAE0, 0x5369, 0xDAE1, 0x537A, 0xDAE2, 0x961D, 0xDAE3, 0x9622, 0xDAE4, 0x9621, + 0xDAE5, 0x9631, 0xDAE6, 0x962A, 0xDAE7, 0x963D, 0xDAE8, 0x963C, 0xDAE9, 0x9642, 0xDAEA, 0x9649, 0xDAEB, 0x9654, 0xDAEC, 0x965F, + 0xDAED, 0x9667, 0xDAEE, 0x966C, 0xDAEF, 0x9672, 0xDAF0, 0x9674, 0xDAF1, 0x9688, 0xDAF2, 0x968D, 0xDAF3, 0x9697, 0xDAF4, 0x96B0, + 0xDAF5, 0x9097, 0xDAF6, 0x909B, 0xDAF7, 0x909D, 0xDAF8, 0x9099, 0xDAF9, 0x90AC, 0xDAFA, 0x90A1, 0xDAFB, 0x90B4, 0xDAFC, 0x90B3, + 0xDAFD, 0x90B6, 0xDAFE, 0x90BA, 0xDB40, 0x8DD5, 0xDB41, 0x8DD8, 0xDB42, 0x8DD9, 0xDB43, 0x8DDC, 0xDB44, 0x8DE0, 0xDB45, 0x8DE1, + 0xDB46, 0x8DE2, 0xDB47, 0x8DE5, 0xDB48, 0x8DE6, 0xDB49, 0x8DE7, 0xDB4A, 0x8DE9, 0xDB4B, 0x8DED, 0xDB4C, 0x8DEE, 0xDB4D, 0x8DF0, + 0xDB4E, 0x8DF1, 0xDB4F, 0x8DF2, 0xDB50, 0x8DF4, 0xDB51, 0x8DF6, 0xDB52, 0x8DFC, 0xDB53, 0x8DFE, 0xDB54, 0x8DFF, 0xDB55, 0x8E00, + 0xDB56, 0x8E01, 0xDB57, 0x8E02, 0xDB58, 0x8E03, 0xDB59, 0x8E04, 0xDB5A, 0x8E06, 0xDB5B, 0x8E07, 0xDB5C, 0x8E08, 0xDB5D, 0x8E0B, + 0xDB5E, 0x8E0D, 0xDB5F, 0x8E0E, 0xDB60, 0x8E10, 0xDB61, 0x8E11, 0xDB62, 0x8E12, 0xDB63, 0x8E13, 0xDB64, 0x8E15, 0xDB65, 0x8E16, + 0xDB66, 0x8E17, 0xDB67, 0x8E18, 0xDB68, 0x8E19, 0xDB69, 0x8E1A, 0xDB6A, 0x8E1B, 0xDB6B, 0x8E1C, 0xDB6C, 0x8E20, 0xDB6D, 0x8E21, + 0xDB6E, 0x8E24, 0xDB6F, 0x8E25, 0xDB70, 0x8E26, 0xDB71, 0x8E27, 0xDB72, 0x8E28, 0xDB73, 0x8E2B, 0xDB74, 0x8E2D, 0xDB75, 0x8E30, + 0xDB76, 0x8E32, 0xDB77, 0x8E33, 0xDB78, 0x8E34, 0xDB79, 0x8E36, 0xDB7A, 0x8E37, 0xDB7B, 0x8E38, 0xDB7C, 0x8E3B, 0xDB7D, 0x8E3C, + 0xDB7E, 0x8E3E, 0xDB80, 0x8E3F, 0xDB81, 0x8E43, 0xDB82, 0x8E45, 0xDB83, 0x8E46, 0xDB84, 0x8E4C, 0xDB85, 0x8E4D, 0xDB86, 0x8E4E, + 0xDB87, 0x8E4F, 0xDB88, 0x8E50, 0xDB89, 0x8E53, 0xDB8A, 0x8E54, 0xDB8B, 0x8E55, 0xDB8C, 0x8E56, 0xDB8D, 0x8E57, 0xDB8E, 0x8E58, + 0xDB8F, 0x8E5A, 0xDB90, 0x8E5B, 0xDB91, 0x8E5C, 0xDB92, 0x8E5D, 0xDB93, 0x8E5E, 0xDB94, 0x8E5F, 0xDB95, 0x8E60, 0xDB96, 0x8E61, + 0xDB97, 0x8E62, 0xDB98, 0x8E63, 0xDB99, 0x8E64, 0xDB9A, 0x8E65, 0xDB9B, 0x8E67, 0xDB9C, 0x8E68, 0xDB9D, 0x8E6A, 0xDB9E, 0x8E6B, + 0xDB9F, 0x8E6E, 0xDBA0, 0x8E71, 0xDBA1, 0x90B8, 0xDBA2, 0x90B0, 0xDBA3, 0x90CF, 0xDBA4, 0x90C5, 0xDBA5, 0x90BE, 0xDBA6, 0x90D0, + 0xDBA7, 0x90C4, 0xDBA8, 0x90C7, 0xDBA9, 0x90D3, 0xDBAA, 0x90E6, 0xDBAB, 0x90E2, 0xDBAC, 0x90DC, 0xDBAD, 0x90D7, 0xDBAE, 0x90DB, + 0xDBAF, 0x90EB, 0xDBB0, 0x90EF, 0xDBB1, 0x90FE, 0xDBB2, 0x9104, 0xDBB3, 0x9122, 0xDBB4, 0x911E, 0xDBB5, 0x9123, 0xDBB6, 0x9131, + 0xDBB7, 0x912F, 0xDBB8, 0x9139, 0xDBB9, 0x9143, 0xDBBA, 0x9146, 0xDBBB, 0x520D, 0xDBBC, 0x5942, 0xDBBD, 0x52A2, 0xDBBE, 0x52AC, + 0xDBBF, 0x52AD, 0xDBC0, 0x52BE, 0xDBC1, 0x54FF, 0xDBC2, 0x52D0, 0xDBC3, 0x52D6, 0xDBC4, 0x52F0, 0xDBC5, 0x53DF, 0xDBC6, 0x71EE, + 0xDBC7, 0x77CD, 0xDBC8, 0x5EF4, 0xDBC9, 0x51F5, 0xDBCA, 0x51FC, 0xDBCB, 0x9B2F, 0xDBCC, 0x53B6, 0xDBCD, 0x5F01, 0xDBCE, 0x755A, + 0xDBCF, 0x5DEF, 0xDBD0, 0x574C, 0xDBD1, 0x57A9, 0xDBD2, 0x57A1, 0xDBD3, 0x587E, 0xDBD4, 0x58BC, 0xDBD5, 0x58C5, 0xDBD6, 0x58D1, + 0xDBD7, 0x5729, 0xDBD8, 0x572C, 0xDBD9, 0x572A, 0xDBDA, 0x5733, 0xDBDB, 0x5739, 0xDBDC, 0x572E, 0xDBDD, 0x572F, 0xDBDE, 0x575C, + 0xDBDF, 0x573B, 0xDBE0, 0x5742, 0xDBE1, 0x5769, 0xDBE2, 0x5785, 0xDBE3, 0x576B, 0xDBE4, 0x5786, 0xDBE5, 0x577C, 0xDBE6, 0x577B, + 0xDBE7, 0x5768, 0xDBE8, 0x576D, 0xDBE9, 0x5776, 0xDBEA, 0x5773, 0xDBEB, 0x57AD, 0xDBEC, 0x57A4, 0xDBED, 0x578C, 0xDBEE, 0x57B2, + 0xDBEF, 0x57CF, 0xDBF0, 0x57A7, 0xDBF1, 0x57B4, 0xDBF2, 0x5793, 0xDBF3, 0x57A0, 0xDBF4, 0x57D5, 0xDBF5, 0x57D8, 0xDBF6, 0x57DA, + 0xDBF7, 0x57D9, 0xDBF8, 0x57D2, 0xDBF9, 0x57B8, 0xDBFA, 0x57F4, 0xDBFB, 0x57EF, 0xDBFC, 0x57F8, 0xDBFD, 0x57E4, 0xDBFE, 0x57DD, + 0xDC40, 0x8E73, 0xDC41, 0x8E75, 0xDC42, 0x8E77, 0xDC43, 0x8E78, 0xDC44, 0x8E79, 0xDC45, 0x8E7A, 0xDC46, 0x8E7B, 0xDC47, 0x8E7D, + 0xDC48, 0x8E7E, 0xDC49, 0x8E80, 0xDC4A, 0x8E82, 0xDC4B, 0x8E83, 0xDC4C, 0x8E84, 0xDC4D, 0x8E86, 0xDC4E, 0x8E88, 0xDC4F, 0x8E89, + 0xDC50, 0x8E8A, 0xDC51, 0x8E8B, 0xDC52, 0x8E8C, 0xDC53, 0x8E8D, 0xDC54, 0x8E8E, 0xDC55, 0x8E91, 0xDC56, 0x8E92, 0xDC57, 0x8E93, + 0xDC58, 0x8E95, 0xDC59, 0x8E96, 0xDC5A, 0x8E97, 0xDC5B, 0x8E98, 0xDC5C, 0x8E99, 0xDC5D, 0x8E9A, 0xDC5E, 0x8E9B, 0xDC5F, 0x8E9D, + 0xDC60, 0x8E9F, 0xDC61, 0x8EA0, 0xDC62, 0x8EA1, 0xDC63, 0x8EA2, 0xDC64, 0x8EA3, 0xDC65, 0x8EA4, 0xDC66, 0x8EA5, 0xDC67, 0x8EA6, + 0xDC68, 0x8EA7, 0xDC69, 0x8EA8, 0xDC6A, 0x8EA9, 0xDC6B, 0x8EAA, 0xDC6C, 0x8EAD, 0xDC6D, 0x8EAE, 0xDC6E, 0x8EB0, 0xDC6F, 0x8EB1, + 0xDC70, 0x8EB3, 0xDC71, 0x8EB4, 0xDC72, 0x8EB5, 0xDC73, 0x8EB6, 0xDC74, 0x8EB7, 0xDC75, 0x8EB8, 0xDC76, 0x8EB9, 0xDC77, 0x8EBB, + 0xDC78, 0x8EBC, 0xDC79, 0x8EBD, 0xDC7A, 0x8EBE, 0xDC7B, 0x8EBF, 0xDC7C, 0x8EC0, 0xDC7D, 0x8EC1, 0xDC7E, 0x8EC2, 0xDC80, 0x8EC3, + 0xDC81, 0x8EC4, 0xDC82, 0x8EC5, 0xDC83, 0x8EC6, 0xDC84, 0x8EC7, 0xDC85, 0x8EC8, 0xDC86, 0x8EC9, 0xDC87, 0x8ECA, 0xDC88, 0x8ECB, + 0xDC89, 0x8ECC, 0xDC8A, 0x8ECD, 0xDC8B, 0x8ECF, 0xDC8C, 0x8ED0, 0xDC8D, 0x8ED1, 0xDC8E, 0x8ED2, 0xDC8F, 0x8ED3, 0xDC90, 0x8ED4, + 0xDC91, 0x8ED5, 0xDC92, 0x8ED6, 0xDC93, 0x8ED7, 0xDC94, 0x8ED8, 0xDC95, 0x8ED9, 0xDC96, 0x8EDA, 0xDC97, 0x8EDB, 0xDC98, 0x8EDC, + 0xDC99, 0x8EDD, 0xDC9A, 0x8EDE, 0xDC9B, 0x8EDF, 0xDC9C, 0x8EE0, 0xDC9D, 0x8EE1, 0xDC9E, 0x8EE2, 0xDC9F, 0x8EE3, 0xDCA0, 0x8EE4, + 0xDCA1, 0x580B, 0xDCA2, 0x580D, 0xDCA3, 0x57FD, 0xDCA4, 0x57ED, 0xDCA5, 0x5800, 0xDCA6, 0x581E, 0xDCA7, 0x5819, 0xDCA8, 0x5844, + 0xDCA9, 0x5820, 0xDCAA, 0x5865, 0xDCAB, 0x586C, 0xDCAC, 0x5881, 0xDCAD, 0x5889, 0xDCAE, 0x589A, 0xDCAF, 0x5880, 0xDCB0, 0x99A8, + 0xDCB1, 0x9F19, 0xDCB2, 0x61FF, 0xDCB3, 0x8279, 0xDCB4, 0x827D, 0xDCB5, 0x827F, 0xDCB6, 0x828F, 0xDCB7, 0x828A, 0xDCB8, 0x82A8, + 0xDCB9, 0x8284, 0xDCBA, 0x828E, 0xDCBB, 0x8291, 0xDCBC, 0x8297, 0xDCBD, 0x8299, 0xDCBE, 0x82AB, 0xDCBF, 0x82B8, 0xDCC0, 0x82BE, + 0xDCC1, 0x82B0, 0xDCC2, 0x82C8, 0xDCC3, 0x82CA, 0xDCC4, 0x82E3, 0xDCC5, 0x8298, 0xDCC6, 0x82B7, 0xDCC7, 0x82AE, 0xDCC8, 0x82CB, + 0xDCC9, 0x82CC, 0xDCCA, 0x82C1, 0xDCCB, 0x82A9, 0xDCCC, 0x82B4, 0xDCCD, 0x82A1, 0xDCCE, 0x82AA, 0xDCCF, 0x829F, 0xDCD0, 0x82C4, + 0xDCD1, 0x82CE, 0xDCD2, 0x82A4, 0xDCD3, 0x82E1, 0xDCD4, 0x8309, 0xDCD5, 0x82F7, 0xDCD6, 0x82E4, 0xDCD7, 0x830F, 0xDCD8, 0x8307, + 0xDCD9, 0x82DC, 0xDCDA, 0x82F4, 0xDCDB, 0x82D2, 0xDCDC, 0x82D8, 0xDCDD, 0x830C, 0xDCDE, 0x82FB, 0xDCDF, 0x82D3, 0xDCE0, 0x8311, + 0xDCE1, 0x831A, 0xDCE2, 0x8306, 0xDCE3, 0x8314, 0xDCE4, 0x8315, 0xDCE5, 0x82E0, 0xDCE6, 0x82D5, 0xDCE7, 0x831C, 0xDCE8, 0x8351, + 0xDCE9, 0x835B, 0xDCEA, 0x835C, 0xDCEB, 0x8308, 0xDCEC, 0x8392, 0xDCED, 0x833C, 0xDCEE, 0x8334, 0xDCEF, 0x8331, 0xDCF0, 0x839B, + 0xDCF1, 0x835E, 0xDCF2, 0x832F, 0xDCF3, 0x834F, 0xDCF4, 0x8347, 0xDCF5, 0x8343, 0xDCF6, 0x835F, 0xDCF7, 0x8340, 0xDCF8, 0x8317, + 0xDCF9, 0x8360, 0xDCFA, 0x832D, 0xDCFB, 0x833A, 0xDCFC, 0x8333, 0xDCFD, 0x8366, 0xDCFE, 0x8365, 0xDD40, 0x8EE5, 0xDD41, 0x8EE6, + 0xDD42, 0x8EE7, 0xDD43, 0x8EE8, 0xDD44, 0x8EE9, 0xDD45, 0x8EEA, 0xDD46, 0x8EEB, 0xDD47, 0x8EEC, 0xDD48, 0x8EED, 0xDD49, 0x8EEE, + 0xDD4A, 0x8EEF, 0xDD4B, 0x8EF0, 0xDD4C, 0x8EF1, 0xDD4D, 0x8EF2, 0xDD4E, 0x8EF3, 0xDD4F, 0x8EF4, 0xDD50, 0x8EF5, 0xDD51, 0x8EF6, + 0xDD52, 0x8EF7, 0xDD53, 0x8EF8, 0xDD54, 0x8EF9, 0xDD55, 0x8EFA, 0xDD56, 0x8EFB, 0xDD57, 0x8EFC, 0xDD58, 0x8EFD, 0xDD59, 0x8EFE, + 0xDD5A, 0x8EFF, 0xDD5B, 0x8F00, 0xDD5C, 0x8F01, 0xDD5D, 0x8F02, 0xDD5E, 0x8F03, 0xDD5F, 0x8F04, 0xDD60, 0x8F05, 0xDD61, 0x8F06, + 0xDD62, 0x8F07, 0xDD63, 0x8F08, 0xDD64, 0x8F09, 0xDD65, 0x8F0A, 0xDD66, 0x8F0B, 0xDD67, 0x8F0C, 0xDD68, 0x8F0D, 0xDD69, 0x8F0E, + 0xDD6A, 0x8F0F, 0xDD6B, 0x8F10, 0xDD6C, 0x8F11, 0xDD6D, 0x8F12, 0xDD6E, 0x8F13, 0xDD6F, 0x8F14, 0xDD70, 0x8F15, 0xDD71, 0x8F16, + 0xDD72, 0x8F17, 0xDD73, 0x8F18, 0xDD74, 0x8F19, 0xDD75, 0x8F1A, 0xDD76, 0x8F1B, 0xDD77, 0x8F1C, 0xDD78, 0x8F1D, 0xDD79, 0x8F1E, + 0xDD7A, 0x8F1F, 0xDD7B, 0x8F20, 0xDD7C, 0x8F21, 0xDD7D, 0x8F22, 0xDD7E, 0x8F23, 0xDD80, 0x8F24, 0xDD81, 0x8F25, 0xDD82, 0x8F26, + 0xDD83, 0x8F27, 0xDD84, 0x8F28, 0xDD85, 0x8F29, 0xDD86, 0x8F2A, 0xDD87, 0x8F2B, 0xDD88, 0x8F2C, 0xDD89, 0x8F2D, 0xDD8A, 0x8F2E, + 0xDD8B, 0x8F2F, 0xDD8C, 0x8F30, 0xDD8D, 0x8F31, 0xDD8E, 0x8F32, 0xDD8F, 0x8F33, 0xDD90, 0x8F34, 0xDD91, 0x8F35, 0xDD92, 0x8F36, + 0xDD93, 0x8F37, 0xDD94, 0x8F38, 0xDD95, 0x8F39, 0xDD96, 0x8F3A, 0xDD97, 0x8F3B, 0xDD98, 0x8F3C, 0xDD99, 0x8F3D, 0xDD9A, 0x8F3E, + 0xDD9B, 0x8F3F, 0xDD9C, 0x8F40, 0xDD9D, 0x8F41, 0xDD9E, 0x8F42, 0xDD9F, 0x8F43, 0xDDA0, 0x8F44, 0xDDA1, 0x8368, 0xDDA2, 0x831B, + 0xDDA3, 0x8369, 0xDDA4, 0x836C, 0xDDA5, 0x836A, 0xDDA6, 0x836D, 0xDDA7, 0x836E, 0xDDA8, 0x83B0, 0xDDA9, 0x8378, 0xDDAA, 0x83B3, + 0xDDAB, 0x83B4, 0xDDAC, 0x83A0, 0xDDAD, 0x83AA, 0xDDAE, 0x8393, 0xDDAF, 0x839C, 0xDDB0, 0x8385, 0xDDB1, 0x837C, 0xDDB2, 0x83B6, + 0xDDB3, 0x83A9, 0xDDB4, 0x837D, 0xDDB5, 0x83B8, 0xDDB6, 0x837B, 0xDDB7, 0x8398, 0xDDB8, 0x839E, 0xDDB9, 0x83A8, 0xDDBA, 0x83BA, + 0xDDBB, 0x83BC, 0xDDBC, 0x83C1, 0xDDBD, 0x8401, 0xDDBE, 0x83E5, 0xDDBF, 0x83D8, 0xDDC0, 0x5807, 0xDDC1, 0x8418, 0xDDC2, 0x840B, + 0xDDC3, 0x83DD, 0xDDC4, 0x83FD, 0xDDC5, 0x83D6, 0xDDC6, 0x841C, 0xDDC7, 0x8438, 0xDDC8, 0x8411, 0xDDC9, 0x8406, 0xDDCA, 0x83D4, + 0xDDCB, 0x83DF, 0xDDCC, 0x840F, 0xDDCD, 0x8403, 0xDDCE, 0x83F8, 0xDDCF, 0x83F9, 0xDDD0, 0x83EA, 0xDDD1, 0x83C5, 0xDDD2, 0x83C0, + 0xDDD3, 0x8426, 0xDDD4, 0x83F0, 0xDDD5, 0x83E1, 0xDDD6, 0x845C, 0xDDD7, 0x8451, 0xDDD8, 0x845A, 0xDDD9, 0x8459, 0xDDDA, 0x8473, + 0xDDDB, 0x8487, 0xDDDC, 0x8488, 0xDDDD, 0x847A, 0xDDDE, 0x8489, 0xDDDF, 0x8478, 0xDDE0, 0x843C, 0xDDE1, 0x8446, 0xDDE2, 0x8469, + 0xDDE3, 0x8476, 0xDDE4, 0x848C, 0xDDE5, 0x848E, 0xDDE6, 0x8431, 0xDDE7, 0x846D, 0xDDE8, 0x84C1, 0xDDE9, 0x84CD, 0xDDEA, 0x84D0, + 0xDDEB, 0x84E6, 0xDDEC, 0x84BD, 0xDDED, 0x84D3, 0xDDEE, 0x84CA, 0xDDEF, 0x84BF, 0xDDF0, 0x84BA, 0xDDF1, 0x84E0, 0xDDF2, 0x84A1, + 0xDDF3, 0x84B9, 0xDDF4, 0x84B4, 0xDDF5, 0x8497, 0xDDF6, 0x84E5, 0xDDF7, 0x84E3, 0xDDF8, 0x850C, 0xDDF9, 0x750D, 0xDDFA, 0x8538, + 0xDDFB, 0x84F0, 0xDDFC, 0x8539, 0xDDFD, 0x851F, 0xDDFE, 0x853A, 0xDE40, 0x8F45, 0xDE41, 0x8F46, 0xDE42, 0x8F47, 0xDE43, 0x8F48, + 0xDE44, 0x8F49, 0xDE45, 0x8F4A, 0xDE46, 0x8F4B, 0xDE47, 0x8F4C, 0xDE48, 0x8F4D, 0xDE49, 0x8F4E, 0xDE4A, 0x8F4F, 0xDE4B, 0x8F50, + 0xDE4C, 0x8F51, 0xDE4D, 0x8F52, 0xDE4E, 0x8F53, 0xDE4F, 0x8F54, 0xDE50, 0x8F55, 0xDE51, 0x8F56, 0xDE52, 0x8F57, 0xDE53, 0x8F58, + 0xDE54, 0x8F59, 0xDE55, 0x8F5A, 0xDE56, 0x8F5B, 0xDE57, 0x8F5C, 0xDE58, 0x8F5D, 0xDE59, 0x8F5E, 0xDE5A, 0x8F5F, 0xDE5B, 0x8F60, + 0xDE5C, 0x8F61, 0xDE5D, 0x8F62, 0xDE5E, 0x8F63, 0xDE5F, 0x8F64, 0xDE60, 0x8F65, 0xDE61, 0x8F6A, 0xDE62, 0x8F80, 0xDE63, 0x8F8C, + 0xDE64, 0x8F92, 0xDE65, 0x8F9D, 0xDE66, 0x8FA0, 0xDE67, 0x8FA1, 0xDE68, 0x8FA2, 0xDE69, 0x8FA4, 0xDE6A, 0x8FA5, 0xDE6B, 0x8FA6, + 0xDE6C, 0x8FA7, 0xDE6D, 0x8FAA, 0xDE6E, 0x8FAC, 0xDE6F, 0x8FAD, 0xDE70, 0x8FAE, 0xDE71, 0x8FAF, 0xDE72, 0x8FB2, 0xDE73, 0x8FB3, + 0xDE74, 0x8FB4, 0xDE75, 0x8FB5, 0xDE76, 0x8FB7, 0xDE77, 0x8FB8, 0xDE78, 0x8FBA, 0xDE79, 0x8FBB, 0xDE7A, 0x8FBC, 0xDE7B, 0x8FBF, + 0xDE7C, 0x8FC0, 0xDE7D, 0x8FC3, 0xDE7E, 0x8FC6, 0xDE80, 0x8FC9, 0xDE81, 0x8FCA, 0xDE82, 0x8FCB, 0xDE83, 0x8FCC, 0xDE84, 0x8FCD, + 0xDE85, 0x8FCF, 0xDE86, 0x8FD2, 0xDE87, 0x8FD6, 0xDE88, 0x8FD7, 0xDE89, 0x8FDA, 0xDE8A, 0x8FE0, 0xDE8B, 0x8FE1, 0xDE8C, 0x8FE3, + 0xDE8D, 0x8FE7, 0xDE8E, 0x8FEC, 0xDE8F, 0x8FEF, 0xDE90, 0x8FF1, 0xDE91, 0x8FF2, 0xDE92, 0x8FF4, 0xDE93, 0x8FF5, 0xDE94, 0x8FF6, + 0xDE95, 0x8FFA, 0xDE96, 0x8FFB, 0xDE97, 0x8FFC, 0xDE98, 0x8FFE, 0xDE99, 0x8FFF, 0xDE9A, 0x9007, 0xDE9B, 0x9008, 0xDE9C, 0x900C, + 0xDE9D, 0x900E, 0xDE9E, 0x9013, 0xDE9F, 0x9015, 0xDEA0, 0x9018, 0xDEA1, 0x8556, 0xDEA2, 0x853B, 0xDEA3, 0x84FF, 0xDEA4, 0x84FC, + 0xDEA5, 0x8559, 0xDEA6, 0x8548, 0xDEA7, 0x8568, 0xDEA8, 0x8564, 0xDEA9, 0x855E, 0xDEAA, 0x857A, 0xDEAB, 0x77A2, 0xDEAC, 0x8543, + 0xDEAD, 0x8572, 0xDEAE, 0x857B, 0xDEAF, 0x85A4, 0xDEB0, 0x85A8, 0xDEB1, 0x8587, 0xDEB2, 0x858F, 0xDEB3, 0x8579, 0xDEB4, 0x85AE, + 0xDEB5, 0x859C, 0xDEB6, 0x8585, 0xDEB7, 0x85B9, 0xDEB8, 0x85B7, 0xDEB9, 0x85B0, 0xDEBA, 0x85D3, 0xDEBB, 0x85C1, 0xDEBC, 0x85DC, + 0xDEBD, 0x85FF, 0xDEBE, 0x8627, 0xDEBF, 0x8605, 0xDEC0, 0x8629, 0xDEC1, 0x8616, 0xDEC2, 0x863C, 0xDEC3, 0x5EFE, 0xDEC4, 0x5F08, + 0xDEC5, 0x593C, 0xDEC6, 0x5941, 0xDEC7, 0x8037, 0xDEC8, 0x5955, 0xDEC9, 0x595A, 0xDECA, 0x5958, 0xDECB, 0x530F, 0xDECC, 0x5C22, + 0xDECD, 0x5C25, 0xDECE, 0x5C2C, 0xDECF, 0x5C34, 0xDED0, 0x624C, 0xDED1, 0x626A, 0xDED2, 0x629F, 0xDED3, 0x62BB, 0xDED4, 0x62CA, + 0xDED5, 0x62DA, 0xDED6, 0x62D7, 0xDED7, 0x62EE, 0xDED8, 0x6322, 0xDED9, 0x62F6, 0xDEDA, 0x6339, 0xDEDB, 0x634B, 0xDEDC, 0x6343, + 0xDEDD, 0x63AD, 0xDEDE, 0x63F6, 0xDEDF, 0x6371, 0xDEE0, 0x637A, 0xDEE1, 0x638E, 0xDEE2, 0x63B4, 0xDEE3, 0x636D, 0xDEE4, 0x63AC, + 0xDEE5, 0x638A, 0xDEE6, 0x6369, 0xDEE7, 0x63AE, 0xDEE8, 0x63BC, 0xDEE9, 0x63F2, 0xDEEA, 0x63F8, 0xDEEB, 0x63E0, 0xDEEC, 0x63FF, + 0xDEED, 0x63C4, 0xDEEE, 0x63DE, 0xDEEF, 0x63CE, 0xDEF0, 0x6452, 0xDEF1, 0x63C6, 0xDEF2, 0x63BE, 0xDEF3, 0x6445, 0xDEF4, 0x6441, + 0xDEF5, 0x640B, 0xDEF6, 0x641B, 0xDEF7, 0x6420, 0xDEF8, 0x640C, 0xDEF9, 0x6426, 0xDEFA, 0x6421, 0xDEFB, 0x645E, 0xDEFC, 0x6484, + 0xDEFD, 0x646D, 0xDEFE, 0x6496, 0xDF40, 0x9019, 0xDF41, 0x901C, 0xDF42, 0x9023, 0xDF43, 0x9024, 0xDF44, 0x9025, 0xDF45, 0x9027, + 0xDF46, 0x9028, 0xDF47, 0x9029, 0xDF48, 0x902A, 0xDF49, 0x902B, 0xDF4A, 0x902C, 0xDF4B, 0x9030, 0xDF4C, 0x9031, 0xDF4D, 0x9032, + 0xDF4E, 0x9033, 0xDF4F, 0x9034, 0xDF50, 0x9037, 0xDF51, 0x9039, 0xDF52, 0x903A, 0xDF53, 0x903D, 0xDF54, 0x903F, 0xDF55, 0x9040, + 0xDF56, 0x9043, 0xDF57, 0x9045, 0xDF58, 0x9046, 0xDF59, 0x9048, 0xDF5A, 0x9049, 0xDF5B, 0x904A, 0xDF5C, 0x904B, 0xDF5D, 0x904C, + 0xDF5E, 0x904E, 0xDF5F, 0x9054, 0xDF60, 0x9055, 0xDF61, 0x9056, 0xDF62, 0x9059, 0xDF63, 0x905A, 0xDF64, 0x905C, 0xDF65, 0x905D, + 0xDF66, 0x905E, 0xDF67, 0x905F, 0xDF68, 0x9060, 0xDF69, 0x9061, 0xDF6A, 0x9064, 0xDF6B, 0x9066, 0xDF6C, 0x9067, 0xDF6D, 0x9069, + 0xDF6E, 0x906A, 0xDF6F, 0x906B, 0xDF70, 0x906C, 0xDF71, 0x906F, 0xDF72, 0x9070, 0xDF73, 0x9071, 0xDF74, 0x9072, 0xDF75, 0x9073, + 0xDF76, 0x9076, 0xDF77, 0x9077, 0xDF78, 0x9078, 0xDF79, 0x9079, 0xDF7A, 0x907A, 0xDF7B, 0x907B, 0xDF7C, 0x907C, 0xDF7D, 0x907E, + 0xDF7E, 0x9081, 0xDF80, 0x9084, 0xDF81, 0x9085, 0xDF82, 0x9086, 0xDF83, 0x9087, 0xDF84, 0x9089, 0xDF85, 0x908A, 0xDF86, 0x908C, + 0xDF87, 0x908D, 0xDF88, 0x908E, 0xDF89, 0x908F, 0xDF8A, 0x9090, 0xDF8B, 0x9092, 0xDF8C, 0x9094, 0xDF8D, 0x9096, 0xDF8E, 0x9098, + 0xDF8F, 0x909A, 0xDF90, 0x909C, 0xDF91, 0x909E, 0xDF92, 0x909F, 0xDF93, 0x90A0, 0xDF94, 0x90A4, 0xDF95, 0x90A5, 0xDF96, 0x90A7, + 0xDF97, 0x90A8, 0xDF98, 0x90A9, 0xDF99, 0x90AB, 0xDF9A, 0x90AD, 0xDF9B, 0x90B2, 0xDF9C, 0x90B7, 0xDF9D, 0x90BC, 0xDF9E, 0x90BD, + 0xDF9F, 0x90BF, 0xDFA0, 0x90C0, 0xDFA1, 0x647A, 0xDFA2, 0x64B7, 0xDFA3, 0x64B8, 0xDFA4, 0x6499, 0xDFA5, 0x64BA, 0xDFA6, 0x64C0, + 0xDFA7, 0x64D0, 0xDFA8, 0x64D7, 0xDFA9, 0x64E4, 0xDFAA, 0x64E2, 0xDFAB, 0x6509, 0xDFAC, 0x6525, 0xDFAD, 0x652E, 0xDFAE, 0x5F0B, + 0xDFAF, 0x5FD2, 0xDFB0, 0x7519, 0xDFB1, 0x5F11, 0xDFB2, 0x535F, 0xDFB3, 0x53F1, 0xDFB4, 0x53FD, 0xDFB5, 0x53E9, 0xDFB6, 0x53E8, + 0xDFB7, 0x53FB, 0xDFB8, 0x5412, 0xDFB9, 0x5416, 0xDFBA, 0x5406, 0xDFBB, 0x544B, 0xDFBC, 0x5452, 0xDFBD, 0x5453, 0xDFBE, 0x5454, + 0xDFBF, 0x5456, 0xDFC0, 0x5443, 0xDFC1, 0x5421, 0xDFC2, 0x5457, 0xDFC3, 0x5459, 0xDFC4, 0x5423, 0xDFC5, 0x5432, 0xDFC6, 0x5482, + 0xDFC7, 0x5494, 0xDFC8, 0x5477, 0xDFC9, 0x5471, 0xDFCA, 0x5464, 0xDFCB, 0x549A, 0xDFCC, 0x549B, 0xDFCD, 0x5484, 0xDFCE, 0x5476, + 0xDFCF, 0x5466, 0xDFD0, 0x549D, 0xDFD1, 0x54D0, 0xDFD2, 0x54AD, 0xDFD3, 0x54C2, 0xDFD4, 0x54B4, 0xDFD5, 0x54D2, 0xDFD6, 0x54A7, + 0xDFD7, 0x54A6, 0xDFD8, 0x54D3, 0xDFD9, 0x54D4, 0xDFDA, 0x5472, 0xDFDB, 0x54A3, 0xDFDC, 0x54D5, 0xDFDD, 0x54BB, 0xDFDE, 0x54BF, + 0xDFDF, 0x54CC, 0xDFE0, 0x54D9, 0xDFE1, 0x54DA, 0xDFE2, 0x54DC, 0xDFE3, 0x54A9, 0xDFE4, 0x54AA, 0xDFE5, 0x54A4, 0xDFE6, 0x54DD, + 0xDFE7, 0x54CF, 0xDFE8, 0x54DE, 0xDFE9, 0x551B, 0xDFEA, 0x54E7, 0xDFEB, 0x5520, 0xDFEC, 0x54FD, 0xDFED, 0x5514, 0xDFEE, 0x54F3, + 0xDFEF, 0x5522, 0xDFF0, 0x5523, 0xDFF1, 0x550F, 0xDFF2, 0x5511, 0xDFF3, 0x5527, 0xDFF4, 0x552A, 0xDFF5, 0x5567, 0xDFF6, 0x558F, + 0xDFF7, 0x55B5, 0xDFF8, 0x5549, 0xDFF9, 0x556D, 0xDFFA, 0x5541, 0xDFFB, 0x5555, 0xDFFC, 0x553F, 0xDFFD, 0x5550, 0xDFFE, 0x553C, + 0xE040, 0x90C2, 0xE041, 0x90C3, 0xE042, 0x90C6, 0xE043, 0x90C8, 0xE044, 0x90C9, 0xE045, 0x90CB, 0xE046, 0x90CC, 0xE047, 0x90CD, + 0xE048, 0x90D2, 0xE049, 0x90D4, 0xE04A, 0x90D5, 0xE04B, 0x90D6, 0xE04C, 0x90D8, 0xE04D, 0x90D9, 0xE04E, 0x90DA, 0xE04F, 0x90DE, + 0xE050, 0x90DF, 0xE051, 0x90E0, 0xE052, 0x90E3, 0xE053, 0x90E4, 0xE054, 0x90E5, 0xE055, 0x90E9, 0xE056, 0x90EA, 0xE057, 0x90EC, + 0xE058, 0x90EE, 0xE059, 0x90F0, 0xE05A, 0x90F1, 0xE05B, 0x90F2, 0xE05C, 0x90F3, 0xE05D, 0x90F5, 0xE05E, 0x90F6, 0xE05F, 0x90F7, + 0xE060, 0x90F9, 0xE061, 0x90FA, 0xE062, 0x90FB, 0xE063, 0x90FC, 0xE064, 0x90FF, 0xE065, 0x9100, 0xE066, 0x9101, 0xE067, 0x9103, + 0xE068, 0x9105, 0xE069, 0x9106, 0xE06A, 0x9107, 0xE06B, 0x9108, 0xE06C, 0x9109, 0xE06D, 0x910A, 0xE06E, 0x910B, 0xE06F, 0x910C, + 0xE070, 0x910D, 0xE071, 0x910E, 0xE072, 0x910F, 0xE073, 0x9110, 0xE074, 0x9111, 0xE075, 0x9112, 0xE076, 0x9113, 0xE077, 0x9114, + 0xE078, 0x9115, 0xE079, 0x9116, 0xE07A, 0x9117, 0xE07B, 0x9118, 0xE07C, 0x911A, 0xE07D, 0x911B, 0xE07E, 0x911C, 0xE080, 0x911D, + 0xE081, 0x911F, 0xE082, 0x9120, 0xE083, 0x9121, 0xE084, 0x9124, 0xE085, 0x9125, 0xE086, 0x9126, 0xE087, 0x9127, 0xE088, 0x9128, + 0xE089, 0x9129, 0xE08A, 0x912A, 0xE08B, 0x912B, 0xE08C, 0x912C, 0xE08D, 0x912D, 0xE08E, 0x912E, 0xE08F, 0x9130, 0xE090, 0x9132, + 0xE091, 0x9133, 0xE092, 0x9134, 0xE093, 0x9135, 0xE094, 0x9136, 0xE095, 0x9137, 0xE096, 0x9138, 0xE097, 0x913A, 0xE098, 0x913B, + 0xE099, 0x913C, 0xE09A, 0x913D, 0xE09B, 0x913E, 0xE09C, 0x913F, 0xE09D, 0x9140, 0xE09E, 0x9141, 0xE09F, 0x9142, 0xE0A0, 0x9144, + 0xE0A1, 0x5537, 0xE0A2, 0x5556, 0xE0A3, 0x5575, 0xE0A4, 0x5576, 0xE0A5, 0x5577, 0xE0A6, 0x5533, 0xE0A7, 0x5530, 0xE0A8, 0x555C, + 0xE0A9, 0x558B, 0xE0AA, 0x55D2, 0xE0AB, 0x5583, 0xE0AC, 0x55B1, 0xE0AD, 0x55B9, 0xE0AE, 0x5588, 0xE0AF, 0x5581, 0xE0B0, 0x559F, + 0xE0B1, 0x557E, 0xE0B2, 0x55D6, 0xE0B3, 0x5591, 0xE0B4, 0x557B, 0xE0B5, 0x55DF, 0xE0B6, 0x55BD, 0xE0B7, 0x55BE, 0xE0B8, 0x5594, + 0xE0B9, 0x5599, 0xE0BA, 0x55EA, 0xE0BB, 0x55F7, 0xE0BC, 0x55C9, 0xE0BD, 0x561F, 0xE0BE, 0x55D1, 0xE0BF, 0x55EB, 0xE0C0, 0x55EC, + 0xE0C1, 0x55D4, 0xE0C2, 0x55E6, 0xE0C3, 0x55DD, 0xE0C4, 0x55C4, 0xE0C5, 0x55EF, 0xE0C6, 0x55E5, 0xE0C7, 0x55F2, 0xE0C8, 0x55F3, + 0xE0C9, 0x55CC, 0xE0CA, 0x55CD, 0xE0CB, 0x55E8, 0xE0CC, 0x55F5, 0xE0CD, 0x55E4, 0xE0CE, 0x8F94, 0xE0CF, 0x561E, 0xE0D0, 0x5608, + 0xE0D1, 0x560C, 0xE0D2, 0x5601, 0xE0D3, 0x5624, 0xE0D4, 0x5623, 0xE0D5, 0x55FE, 0xE0D6, 0x5600, 0xE0D7, 0x5627, 0xE0D8, 0x562D, + 0xE0D9, 0x5658, 0xE0DA, 0x5639, 0xE0DB, 0x5657, 0xE0DC, 0x562C, 0xE0DD, 0x564D, 0xE0DE, 0x5662, 0xE0DF, 0x5659, 0xE0E0, 0x565C, + 0xE0E1, 0x564C, 0xE0E2, 0x5654, 0xE0E3, 0x5686, 0xE0E4, 0x5664, 0xE0E5, 0x5671, 0xE0E6, 0x566B, 0xE0E7, 0x567B, 0xE0E8, 0x567C, + 0xE0E9, 0x5685, 0xE0EA, 0x5693, 0xE0EB, 0x56AF, 0xE0EC, 0x56D4, 0xE0ED, 0x56D7, 0xE0EE, 0x56DD, 0xE0EF, 0x56E1, 0xE0F0, 0x56F5, + 0xE0F1, 0x56EB, 0xE0F2, 0x56F9, 0xE0F3, 0x56FF, 0xE0F4, 0x5704, 0xE0F5, 0x570A, 0xE0F6, 0x5709, 0xE0F7, 0x571C, 0xE0F8, 0x5E0F, + 0xE0F9, 0x5E19, 0xE0FA, 0x5E14, 0xE0FB, 0x5E11, 0xE0FC, 0x5E31, 0xE0FD, 0x5E3B, 0xE0FE, 0x5E3C, 0xE140, 0x9145, 0xE141, 0x9147, + 0xE142, 0x9148, 0xE143, 0x9151, 0xE144, 0x9153, 0xE145, 0x9154, 0xE146, 0x9155, 0xE147, 0x9156, 0xE148, 0x9158, 0xE149, 0x9159, + 0xE14A, 0x915B, 0xE14B, 0x915C, 0xE14C, 0x915F, 0xE14D, 0x9160, 0xE14E, 0x9166, 0xE14F, 0x9167, 0xE150, 0x9168, 0xE151, 0x916B, + 0xE152, 0x916D, 0xE153, 0x9173, 0xE154, 0x917A, 0xE155, 0x917B, 0xE156, 0x917C, 0xE157, 0x9180, 0xE158, 0x9181, 0xE159, 0x9182, + 0xE15A, 0x9183, 0xE15B, 0x9184, 0xE15C, 0x9186, 0xE15D, 0x9188, 0xE15E, 0x918A, 0xE15F, 0x918E, 0xE160, 0x918F, 0xE161, 0x9193, + 0xE162, 0x9194, 0xE163, 0x9195, 0xE164, 0x9196, 0xE165, 0x9197, 0xE166, 0x9198, 0xE167, 0x9199, 0xE168, 0x919C, 0xE169, 0x919D, + 0xE16A, 0x919E, 0xE16B, 0x919F, 0xE16C, 0x91A0, 0xE16D, 0x91A1, 0xE16E, 0x91A4, 0xE16F, 0x91A5, 0xE170, 0x91A6, 0xE171, 0x91A7, + 0xE172, 0x91A8, 0xE173, 0x91A9, 0xE174, 0x91AB, 0xE175, 0x91AC, 0xE176, 0x91B0, 0xE177, 0x91B1, 0xE178, 0x91B2, 0xE179, 0x91B3, + 0xE17A, 0x91B6, 0xE17B, 0x91B7, 0xE17C, 0x91B8, 0xE17D, 0x91B9, 0xE17E, 0x91BB, 0xE180, 0x91BC, 0xE181, 0x91BD, 0xE182, 0x91BE, + 0xE183, 0x91BF, 0xE184, 0x91C0, 0xE185, 0x91C1, 0xE186, 0x91C2, 0xE187, 0x91C3, 0xE188, 0x91C4, 0xE189, 0x91C5, 0xE18A, 0x91C6, + 0xE18B, 0x91C8, 0xE18C, 0x91CB, 0xE18D, 0x91D0, 0xE18E, 0x91D2, 0xE18F, 0x91D3, 0xE190, 0x91D4, 0xE191, 0x91D5, 0xE192, 0x91D6, + 0xE193, 0x91D7, 0xE194, 0x91D8, 0xE195, 0x91D9, 0xE196, 0x91DA, 0xE197, 0x91DB, 0xE198, 0x91DD, 0xE199, 0x91DE, 0xE19A, 0x91DF, + 0xE19B, 0x91E0, 0xE19C, 0x91E1, 0xE19D, 0x91E2, 0xE19E, 0x91E3, 0xE19F, 0x91E4, 0xE1A0, 0x91E5, 0xE1A1, 0x5E37, 0xE1A2, 0x5E44, + 0xE1A3, 0x5E54, 0xE1A4, 0x5E5B, 0xE1A5, 0x5E5E, 0xE1A6, 0x5E61, 0xE1A7, 0x5C8C, 0xE1A8, 0x5C7A, 0xE1A9, 0x5C8D, 0xE1AA, 0x5C90, + 0xE1AB, 0x5C96, 0xE1AC, 0x5C88, 0xE1AD, 0x5C98, 0xE1AE, 0x5C99, 0xE1AF, 0x5C91, 0xE1B0, 0x5C9A, 0xE1B1, 0x5C9C, 0xE1B2, 0x5CB5, + 0xE1B3, 0x5CA2, 0xE1B4, 0x5CBD, 0xE1B5, 0x5CAC, 0xE1B6, 0x5CAB, 0xE1B7, 0x5CB1, 0xE1B8, 0x5CA3, 0xE1B9, 0x5CC1, 0xE1BA, 0x5CB7, + 0xE1BB, 0x5CC4, 0xE1BC, 0x5CD2, 0xE1BD, 0x5CE4, 0xE1BE, 0x5CCB, 0xE1BF, 0x5CE5, 0xE1C0, 0x5D02, 0xE1C1, 0x5D03, 0xE1C2, 0x5D27, + 0xE1C3, 0x5D26, 0xE1C4, 0x5D2E, 0xE1C5, 0x5D24, 0xE1C6, 0x5D1E, 0xE1C7, 0x5D06, 0xE1C8, 0x5D1B, 0xE1C9, 0x5D58, 0xE1CA, 0x5D3E, + 0xE1CB, 0x5D34, 0xE1CC, 0x5D3D, 0xE1CD, 0x5D6C, 0xE1CE, 0x5D5B, 0xE1CF, 0x5D6F, 0xE1D0, 0x5D5D, 0xE1D1, 0x5D6B, 0xE1D2, 0x5D4B, + 0xE1D3, 0x5D4A, 0xE1D4, 0x5D69, 0xE1D5, 0x5D74, 0xE1D6, 0x5D82, 0xE1D7, 0x5D99, 0xE1D8, 0x5D9D, 0xE1D9, 0x8C73, 0xE1DA, 0x5DB7, + 0xE1DB, 0x5DC5, 0xE1DC, 0x5F73, 0xE1DD, 0x5F77, 0xE1DE, 0x5F82, 0xE1DF, 0x5F87, 0xE1E0, 0x5F89, 0xE1E1, 0x5F8C, 0xE1E2, 0x5F95, + 0xE1E3, 0x5F99, 0xE1E4, 0x5F9C, 0xE1E5, 0x5FA8, 0xE1E6, 0x5FAD, 0xE1E7, 0x5FB5, 0xE1E8, 0x5FBC, 0xE1E9, 0x8862, 0xE1EA, 0x5F61, + 0xE1EB, 0x72AD, 0xE1EC, 0x72B0, 0xE1ED, 0x72B4, 0xE1EE, 0x72B7, 0xE1EF, 0x72B8, 0xE1F0, 0x72C3, 0xE1F1, 0x72C1, 0xE1F2, 0x72CE, + 0xE1F3, 0x72CD, 0xE1F4, 0x72D2, 0xE1F5, 0x72E8, 0xE1F6, 0x72EF, 0xE1F7, 0x72E9, 0xE1F8, 0x72F2, 0xE1F9, 0x72F4, 0xE1FA, 0x72F7, + 0xE1FB, 0x7301, 0xE1FC, 0x72F3, 0xE1FD, 0x7303, 0xE1FE, 0x72FA, 0xE240, 0x91E6, 0xE241, 0x91E7, 0xE242, 0x91E8, 0xE243, 0x91E9, + 0xE244, 0x91EA, 0xE245, 0x91EB, 0xE246, 0x91EC, 0xE247, 0x91ED, 0xE248, 0x91EE, 0xE249, 0x91EF, 0xE24A, 0x91F0, 0xE24B, 0x91F1, + 0xE24C, 0x91F2, 0xE24D, 0x91F3, 0xE24E, 0x91F4, 0xE24F, 0x91F5, 0xE250, 0x91F6, 0xE251, 0x91F7, 0xE252, 0x91F8, 0xE253, 0x91F9, + 0xE254, 0x91FA, 0xE255, 0x91FB, 0xE256, 0x91FC, 0xE257, 0x91FD, 0xE258, 0x91FE, 0xE259, 0x91FF, 0xE25A, 0x9200, 0xE25B, 0x9201, + 0xE25C, 0x9202, 0xE25D, 0x9203, 0xE25E, 0x9204, 0xE25F, 0x9205, 0xE260, 0x9206, 0xE261, 0x9207, 0xE262, 0x9208, 0xE263, 0x9209, + 0xE264, 0x920A, 0xE265, 0x920B, 0xE266, 0x920C, 0xE267, 0x920D, 0xE268, 0x920E, 0xE269, 0x920F, 0xE26A, 0x9210, 0xE26B, 0x9211, + 0xE26C, 0x9212, 0xE26D, 0x9213, 0xE26E, 0x9214, 0xE26F, 0x9215, 0xE270, 0x9216, 0xE271, 0x9217, 0xE272, 0x9218, 0xE273, 0x9219, + 0xE274, 0x921A, 0xE275, 0x921B, 0xE276, 0x921C, 0xE277, 0x921D, 0xE278, 0x921E, 0xE279, 0x921F, 0xE27A, 0x9220, 0xE27B, 0x9221, + 0xE27C, 0x9222, 0xE27D, 0x9223, 0xE27E, 0x9224, 0xE280, 0x9225, 0xE281, 0x9226, 0xE282, 0x9227, 0xE283, 0x9228, 0xE284, 0x9229, + 0xE285, 0x922A, 0xE286, 0x922B, 0xE287, 0x922C, 0xE288, 0x922D, 0xE289, 0x922E, 0xE28A, 0x922F, 0xE28B, 0x9230, 0xE28C, 0x9231, + 0xE28D, 0x9232, 0xE28E, 0x9233, 0xE28F, 0x9234, 0xE290, 0x9235, 0xE291, 0x9236, 0xE292, 0x9237, 0xE293, 0x9238, 0xE294, 0x9239, + 0xE295, 0x923A, 0xE296, 0x923B, 0xE297, 0x923C, 0xE298, 0x923D, 0xE299, 0x923E, 0xE29A, 0x923F, 0xE29B, 0x9240, 0xE29C, 0x9241, + 0xE29D, 0x9242, 0xE29E, 0x9243, 0xE29F, 0x9244, 0xE2A0, 0x9245, 0xE2A1, 0x72FB, 0xE2A2, 0x7317, 0xE2A3, 0x7313, 0xE2A4, 0x7321, + 0xE2A5, 0x730A, 0xE2A6, 0x731E, 0xE2A7, 0x731D, 0xE2A8, 0x7315, 0xE2A9, 0x7322, 0xE2AA, 0x7339, 0xE2AB, 0x7325, 0xE2AC, 0x732C, + 0xE2AD, 0x7338, 0xE2AE, 0x7331, 0xE2AF, 0x7350, 0xE2B0, 0x734D, 0xE2B1, 0x7357, 0xE2B2, 0x7360, 0xE2B3, 0x736C, 0xE2B4, 0x736F, + 0xE2B5, 0x737E, 0xE2B6, 0x821B, 0xE2B7, 0x5925, 0xE2B8, 0x98E7, 0xE2B9, 0x5924, 0xE2BA, 0x5902, 0xE2BB, 0x9963, 0xE2BC, 0x9967, + 0xE2BD, 0x9968, 0xE2BE, 0x9969, 0xE2BF, 0x996A, 0xE2C0, 0x996B, 0xE2C1, 0x996C, 0xE2C2, 0x9974, 0xE2C3, 0x9977, 0xE2C4, 0x997D, + 0xE2C5, 0x9980, 0xE2C6, 0x9984, 0xE2C7, 0x9987, 0xE2C8, 0x998A, 0xE2C9, 0x998D, 0xE2CA, 0x9990, 0xE2CB, 0x9991, 0xE2CC, 0x9993, + 0xE2CD, 0x9994, 0xE2CE, 0x9995, 0xE2CF, 0x5E80, 0xE2D0, 0x5E91, 0xE2D1, 0x5E8B, 0xE2D2, 0x5E96, 0xE2D3, 0x5EA5, 0xE2D4, 0x5EA0, + 0xE2D5, 0x5EB9, 0xE2D6, 0x5EB5, 0xE2D7, 0x5EBE, 0xE2D8, 0x5EB3, 0xE2D9, 0x8D53, 0xE2DA, 0x5ED2, 0xE2DB, 0x5ED1, 0xE2DC, 0x5EDB, + 0xE2DD, 0x5EE8, 0xE2DE, 0x5EEA, 0xE2DF, 0x81BA, 0xE2E0, 0x5FC4, 0xE2E1, 0x5FC9, 0xE2E2, 0x5FD6, 0xE2E3, 0x5FCF, 0xE2E4, 0x6003, + 0xE2E5, 0x5FEE, 0xE2E6, 0x6004, 0xE2E7, 0x5FE1, 0xE2E8, 0x5FE4, 0xE2E9, 0x5FFE, 0xE2EA, 0x6005, 0xE2EB, 0x6006, 0xE2EC, 0x5FEA, + 0xE2ED, 0x5FED, 0xE2EE, 0x5FF8, 0xE2EF, 0x6019, 0xE2F0, 0x6035, 0xE2F1, 0x6026, 0xE2F2, 0x601B, 0xE2F3, 0x600F, 0xE2F4, 0x600D, + 0xE2F5, 0x6029, 0xE2F6, 0x602B, 0xE2F7, 0x600A, 0xE2F8, 0x603F, 0xE2F9, 0x6021, 0xE2FA, 0x6078, 0xE2FB, 0x6079, 0xE2FC, 0x607B, + 0xE2FD, 0x607A, 0xE2FE, 0x6042, 0xE340, 0x9246, 0xE341, 0x9247, 0xE342, 0x9248, 0xE343, 0x9249, 0xE344, 0x924A, 0xE345, 0x924B, + 0xE346, 0x924C, 0xE347, 0x924D, 0xE348, 0x924E, 0xE349, 0x924F, 0xE34A, 0x9250, 0xE34B, 0x9251, 0xE34C, 0x9252, 0xE34D, 0x9253, + 0xE34E, 0x9254, 0xE34F, 0x9255, 0xE350, 0x9256, 0xE351, 0x9257, 0xE352, 0x9258, 0xE353, 0x9259, 0xE354, 0x925A, 0xE355, 0x925B, + 0xE356, 0x925C, 0xE357, 0x925D, 0xE358, 0x925E, 0xE359, 0x925F, 0xE35A, 0x9260, 0xE35B, 0x9261, 0xE35C, 0x9262, 0xE35D, 0x9263, + 0xE35E, 0x9264, 0xE35F, 0x9265, 0xE360, 0x9266, 0xE361, 0x9267, 0xE362, 0x9268, 0xE363, 0x9269, 0xE364, 0x926A, 0xE365, 0x926B, + 0xE366, 0x926C, 0xE367, 0x926D, 0xE368, 0x926E, 0xE369, 0x926F, 0xE36A, 0x9270, 0xE36B, 0x9271, 0xE36C, 0x9272, 0xE36D, 0x9273, + 0xE36E, 0x9275, 0xE36F, 0x9276, 0xE370, 0x9277, 0xE371, 0x9278, 0xE372, 0x9279, 0xE373, 0x927A, 0xE374, 0x927B, 0xE375, 0x927C, + 0xE376, 0x927D, 0xE377, 0x927E, 0xE378, 0x927F, 0xE379, 0x9280, 0xE37A, 0x9281, 0xE37B, 0x9282, 0xE37C, 0x9283, 0xE37D, 0x9284, + 0xE37E, 0x9285, 0xE380, 0x9286, 0xE381, 0x9287, 0xE382, 0x9288, 0xE383, 0x9289, 0xE384, 0x928A, 0xE385, 0x928B, 0xE386, 0x928C, + 0xE387, 0x928D, 0xE388, 0x928F, 0xE389, 0x9290, 0xE38A, 0x9291, 0xE38B, 0x9292, 0xE38C, 0x9293, 0xE38D, 0x9294, 0xE38E, 0x9295, + 0xE38F, 0x9296, 0xE390, 0x9297, 0xE391, 0x9298, 0xE392, 0x9299, 0xE393, 0x929A, 0xE394, 0x929B, 0xE395, 0x929C, 0xE396, 0x929D, + 0xE397, 0x929E, 0xE398, 0x929F, 0xE399, 0x92A0, 0xE39A, 0x92A1, 0xE39B, 0x92A2, 0xE39C, 0x92A3, 0xE39D, 0x92A4, 0xE39E, 0x92A5, + 0xE39F, 0x92A6, 0xE3A0, 0x92A7, 0xE3A1, 0x606A, 0xE3A2, 0x607D, 0xE3A3, 0x6096, 0xE3A4, 0x609A, 0xE3A5, 0x60AD, 0xE3A6, 0x609D, + 0xE3A7, 0x6083, 0xE3A8, 0x6092, 0xE3A9, 0x608C, 0xE3AA, 0x609B, 0xE3AB, 0x60EC, 0xE3AC, 0x60BB, 0xE3AD, 0x60B1, 0xE3AE, 0x60DD, + 0xE3AF, 0x60D8, 0xE3B0, 0x60C6, 0xE3B1, 0x60DA, 0xE3B2, 0x60B4, 0xE3B3, 0x6120, 0xE3B4, 0x6126, 0xE3B5, 0x6115, 0xE3B6, 0x6123, + 0xE3B7, 0x60F4, 0xE3B8, 0x6100, 0xE3B9, 0x610E, 0xE3BA, 0x612B, 0xE3BB, 0x614A, 0xE3BC, 0x6175, 0xE3BD, 0x61AC, 0xE3BE, 0x6194, + 0xE3BF, 0x61A7, 0xE3C0, 0x61B7, 0xE3C1, 0x61D4, 0xE3C2, 0x61F5, 0xE3C3, 0x5FDD, 0xE3C4, 0x96B3, 0xE3C5, 0x95E9, 0xE3C6, 0x95EB, + 0xE3C7, 0x95F1, 0xE3C8, 0x95F3, 0xE3C9, 0x95F5, 0xE3CA, 0x95F6, 0xE3CB, 0x95FC, 0xE3CC, 0x95FE, 0xE3CD, 0x9603, 0xE3CE, 0x9604, + 0xE3CF, 0x9606, 0xE3D0, 0x9608, 0xE3D1, 0x960A, 0xE3D2, 0x960B, 0xE3D3, 0x960C, 0xE3D4, 0x960D, 0xE3D5, 0x960F, 0xE3D6, 0x9612, + 0xE3D7, 0x9615, 0xE3D8, 0x9616, 0xE3D9, 0x9617, 0xE3DA, 0x9619, 0xE3DB, 0x961A, 0xE3DC, 0x4E2C, 0xE3DD, 0x723F, 0xE3DE, 0x6215, + 0xE3DF, 0x6C35, 0xE3E0, 0x6C54, 0xE3E1, 0x6C5C, 0xE3E2, 0x6C4A, 0xE3E3, 0x6CA3, 0xE3E4, 0x6C85, 0xE3E5, 0x6C90, 0xE3E6, 0x6C94, + 0xE3E7, 0x6C8C, 0xE3E8, 0x6C68, 0xE3E9, 0x6C69, 0xE3EA, 0x6C74, 0xE3EB, 0x6C76, 0xE3EC, 0x6C86, 0xE3ED, 0x6CA9, 0xE3EE, 0x6CD0, + 0xE3EF, 0x6CD4, 0xE3F0, 0x6CAD, 0xE3F1, 0x6CF7, 0xE3F2, 0x6CF8, 0xE3F3, 0x6CF1, 0xE3F4, 0x6CD7, 0xE3F5, 0x6CB2, 0xE3F6, 0x6CE0, + 0xE3F7, 0x6CD6, 0xE3F8, 0x6CFA, 0xE3F9, 0x6CEB, 0xE3FA, 0x6CEE, 0xE3FB, 0x6CB1, 0xE3FC, 0x6CD3, 0xE3FD, 0x6CEF, 0xE3FE, 0x6CFE, + 0xE440, 0x92A8, 0xE441, 0x92A9, 0xE442, 0x92AA, 0xE443, 0x92AB, 0xE444, 0x92AC, 0xE445, 0x92AD, 0xE446, 0x92AF, 0xE447, 0x92B0, + 0xE448, 0x92B1, 0xE449, 0x92B2, 0xE44A, 0x92B3, 0xE44B, 0x92B4, 0xE44C, 0x92B5, 0xE44D, 0x92B6, 0xE44E, 0x92B7, 0xE44F, 0x92B8, + 0xE450, 0x92B9, 0xE451, 0x92BA, 0xE452, 0x92BB, 0xE453, 0x92BC, 0xE454, 0x92BD, 0xE455, 0x92BE, 0xE456, 0x92BF, 0xE457, 0x92C0, + 0xE458, 0x92C1, 0xE459, 0x92C2, 0xE45A, 0x92C3, 0xE45B, 0x92C4, 0xE45C, 0x92C5, 0xE45D, 0x92C6, 0xE45E, 0x92C7, 0xE45F, 0x92C9, + 0xE460, 0x92CA, 0xE461, 0x92CB, 0xE462, 0x92CC, 0xE463, 0x92CD, 0xE464, 0x92CE, 0xE465, 0x92CF, 0xE466, 0x92D0, 0xE467, 0x92D1, + 0xE468, 0x92D2, 0xE469, 0x92D3, 0xE46A, 0x92D4, 0xE46B, 0x92D5, 0xE46C, 0x92D6, 0xE46D, 0x92D7, 0xE46E, 0x92D8, 0xE46F, 0x92D9, + 0xE470, 0x92DA, 0xE471, 0x92DB, 0xE472, 0x92DC, 0xE473, 0x92DD, 0xE474, 0x92DE, 0xE475, 0x92DF, 0xE476, 0x92E0, 0xE477, 0x92E1, + 0xE478, 0x92E2, 0xE479, 0x92E3, 0xE47A, 0x92E4, 0xE47B, 0x92E5, 0xE47C, 0x92E6, 0xE47D, 0x92E7, 0xE47E, 0x92E8, 0xE480, 0x92E9, + 0xE481, 0x92EA, 0xE482, 0x92EB, 0xE483, 0x92EC, 0xE484, 0x92ED, 0xE485, 0x92EE, 0xE486, 0x92EF, 0xE487, 0x92F0, 0xE488, 0x92F1, + 0xE489, 0x92F2, 0xE48A, 0x92F3, 0xE48B, 0x92F4, 0xE48C, 0x92F5, 0xE48D, 0x92F6, 0xE48E, 0x92F7, 0xE48F, 0x92F8, 0xE490, 0x92F9, + 0xE491, 0x92FA, 0xE492, 0x92FB, 0xE493, 0x92FC, 0xE494, 0x92FD, 0xE495, 0x92FE, 0xE496, 0x92FF, 0xE497, 0x9300, 0xE498, 0x9301, + 0xE499, 0x9302, 0xE49A, 0x9303, 0xE49B, 0x9304, 0xE49C, 0x9305, 0xE49D, 0x9306, 0xE49E, 0x9307, 0xE49F, 0x9308, 0xE4A0, 0x9309, + 0xE4A1, 0x6D39, 0xE4A2, 0x6D27, 0xE4A3, 0x6D0C, 0xE4A4, 0x6D43, 0xE4A5, 0x6D48, 0xE4A6, 0x6D07, 0xE4A7, 0x6D04, 0xE4A8, 0x6D19, + 0xE4A9, 0x6D0E, 0xE4AA, 0x6D2B, 0xE4AB, 0x6D4D, 0xE4AC, 0x6D2E, 0xE4AD, 0x6D35, 0xE4AE, 0x6D1A, 0xE4AF, 0x6D4F, 0xE4B0, 0x6D52, + 0xE4B1, 0x6D54, 0xE4B2, 0x6D33, 0xE4B3, 0x6D91, 0xE4B4, 0x6D6F, 0xE4B5, 0x6D9E, 0xE4B6, 0x6DA0, 0xE4B7, 0x6D5E, 0xE4B8, 0x6D93, + 0xE4B9, 0x6D94, 0xE4BA, 0x6D5C, 0xE4BB, 0x6D60, 0xE4BC, 0x6D7C, 0xE4BD, 0x6D63, 0xE4BE, 0x6E1A, 0xE4BF, 0x6DC7, 0xE4C0, 0x6DC5, + 0xE4C1, 0x6DDE, 0xE4C2, 0x6E0E, 0xE4C3, 0x6DBF, 0xE4C4, 0x6DE0, 0xE4C5, 0x6E11, 0xE4C6, 0x6DE6, 0xE4C7, 0x6DDD, 0xE4C8, 0x6DD9, + 0xE4C9, 0x6E16, 0xE4CA, 0x6DAB, 0xE4CB, 0x6E0C, 0xE4CC, 0x6DAE, 0xE4CD, 0x6E2B, 0xE4CE, 0x6E6E, 0xE4CF, 0x6E4E, 0xE4D0, 0x6E6B, + 0xE4D1, 0x6EB2, 0xE4D2, 0x6E5F, 0xE4D3, 0x6E86, 0xE4D4, 0x6E53, 0xE4D5, 0x6E54, 0xE4D6, 0x6E32, 0xE4D7, 0x6E25, 0xE4D8, 0x6E44, + 0xE4D9, 0x6EDF, 0xE4DA, 0x6EB1, 0xE4DB, 0x6E98, 0xE4DC, 0x6EE0, 0xE4DD, 0x6F2D, 0xE4DE, 0x6EE2, 0xE4DF, 0x6EA5, 0xE4E0, 0x6EA7, + 0xE4E1, 0x6EBD, 0xE4E2, 0x6EBB, 0xE4E3, 0x6EB7, 0xE4E4, 0x6ED7, 0xE4E5, 0x6EB4, 0xE4E6, 0x6ECF, 0xE4E7, 0x6E8F, 0xE4E8, 0x6EC2, + 0xE4E9, 0x6E9F, 0xE4EA, 0x6F62, 0xE4EB, 0x6F46, 0xE4EC, 0x6F47, 0xE4ED, 0x6F24, 0xE4EE, 0x6F15, 0xE4EF, 0x6EF9, 0xE4F0, 0x6F2F, + 0xE4F1, 0x6F36, 0xE4F2, 0x6F4B, 0xE4F3, 0x6F74, 0xE4F4, 0x6F2A, 0xE4F5, 0x6F09, 0xE4F6, 0x6F29, 0xE4F7, 0x6F89, 0xE4F8, 0x6F8D, + 0xE4F9, 0x6F8C, 0xE4FA, 0x6F78, 0xE4FB, 0x6F72, 0xE4FC, 0x6F7C, 0xE4FD, 0x6F7A, 0xE4FE, 0x6FD1, 0xE540, 0x930A, 0xE541, 0x930B, + 0xE542, 0x930C, 0xE543, 0x930D, 0xE544, 0x930E, 0xE545, 0x930F, 0xE546, 0x9310, 0xE547, 0x9311, 0xE548, 0x9312, 0xE549, 0x9313, + 0xE54A, 0x9314, 0xE54B, 0x9315, 0xE54C, 0x9316, 0xE54D, 0x9317, 0xE54E, 0x9318, 0xE54F, 0x9319, 0xE550, 0x931A, 0xE551, 0x931B, + 0xE552, 0x931C, 0xE553, 0x931D, 0xE554, 0x931E, 0xE555, 0x931F, 0xE556, 0x9320, 0xE557, 0x9321, 0xE558, 0x9322, 0xE559, 0x9323, + 0xE55A, 0x9324, 0xE55B, 0x9325, 0xE55C, 0x9326, 0xE55D, 0x9327, 0xE55E, 0x9328, 0xE55F, 0x9329, 0xE560, 0x932A, 0xE561, 0x932B, + 0xE562, 0x932C, 0xE563, 0x932D, 0xE564, 0x932E, 0xE565, 0x932F, 0xE566, 0x9330, 0xE567, 0x9331, 0xE568, 0x9332, 0xE569, 0x9333, + 0xE56A, 0x9334, 0xE56B, 0x9335, 0xE56C, 0x9336, 0xE56D, 0x9337, 0xE56E, 0x9338, 0xE56F, 0x9339, 0xE570, 0x933A, 0xE571, 0x933B, + 0xE572, 0x933C, 0xE573, 0x933D, 0xE574, 0x933F, 0xE575, 0x9340, 0xE576, 0x9341, 0xE577, 0x9342, 0xE578, 0x9343, 0xE579, 0x9344, + 0xE57A, 0x9345, 0xE57B, 0x9346, 0xE57C, 0x9347, 0xE57D, 0x9348, 0xE57E, 0x9349, 0xE580, 0x934A, 0xE581, 0x934B, 0xE582, 0x934C, + 0xE583, 0x934D, 0xE584, 0x934E, 0xE585, 0x934F, 0xE586, 0x9350, 0xE587, 0x9351, 0xE588, 0x9352, 0xE589, 0x9353, 0xE58A, 0x9354, + 0xE58B, 0x9355, 0xE58C, 0x9356, 0xE58D, 0x9357, 0xE58E, 0x9358, 0xE58F, 0x9359, 0xE590, 0x935A, 0xE591, 0x935B, 0xE592, 0x935C, + 0xE593, 0x935D, 0xE594, 0x935E, 0xE595, 0x935F, 0xE596, 0x9360, 0xE597, 0x9361, 0xE598, 0x9362, 0xE599, 0x9363, 0xE59A, 0x9364, + 0xE59B, 0x9365, 0xE59C, 0x9366, 0xE59D, 0x9367, 0xE59E, 0x9368, 0xE59F, 0x9369, 0xE5A0, 0x936B, 0xE5A1, 0x6FC9, 0xE5A2, 0x6FA7, + 0xE5A3, 0x6FB9, 0xE5A4, 0x6FB6, 0xE5A5, 0x6FC2, 0xE5A6, 0x6FE1, 0xE5A7, 0x6FEE, 0xE5A8, 0x6FDE, 0xE5A9, 0x6FE0, 0xE5AA, 0x6FEF, + 0xE5AB, 0x701A, 0xE5AC, 0x7023, 0xE5AD, 0x701B, 0xE5AE, 0x7039, 0xE5AF, 0x7035, 0xE5B0, 0x704F, 0xE5B1, 0x705E, 0xE5B2, 0x5B80, + 0xE5B3, 0x5B84, 0xE5B4, 0x5B95, 0xE5B5, 0x5B93, 0xE5B6, 0x5BA5, 0xE5B7, 0x5BB8, 0xE5B8, 0x752F, 0xE5B9, 0x9A9E, 0xE5BA, 0x6434, + 0xE5BB, 0x5BE4, 0xE5BC, 0x5BEE, 0xE5BD, 0x8930, 0xE5BE, 0x5BF0, 0xE5BF, 0x8E47, 0xE5C0, 0x8B07, 0xE5C1, 0x8FB6, 0xE5C2, 0x8FD3, + 0xE5C3, 0x8FD5, 0xE5C4, 0x8FE5, 0xE5C5, 0x8FEE, 0xE5C6, 0x8FE4, 0xE5C7, 0x8FE9, 0xE5C8, 0x8FE6, 0xE5C9, 0x8FF3, 0xE5CA, 0x8FE8, + 0xE5CB, 0x9005, 0xE5CC, 0x9004, 0xE5CD, 0x900B, 0xE5CE, 0x9026, 0xE5CF, 0x9011, 0xE5D0, 0x900D, 0xE5D1, 0x9016, 0xE5D2, 0x9021, + 0xE5D3, 0x9035, 0xE5D4, 0x9036, 0xE5D5, 0x902D, 0xE5D6, 0x902F, 0xE5D7, 0x9044, 0xE5D8, 0x9051, 0xE5D9, 0x9052, 0xE5DA, 0x9050, + 0xE5DB, 0x9068, 0xE5DC, 0x9058, 0xE5DD, 0x9062, 0xE5DE, 0x905B, 0xE5DF, 0x66B9, 0xE5E0, 0x9074, 0xE5E1, 0x907D, 0xE5E2, 0x9082, + 0xE5E3, 0x9088, 0xE5E4, 0x9083, 0xE5E5, 0x908B, 0xE5E6, 0x5F50, 0xE5E7, 0x5F57, 0xE5E8, 0x5F56, 0xE5E9, 0x5F58, 0xE5EA, 0x5C3B, + 0xE5EB, 0x54AB, 0xE5EC, 0x5C50, 0xE5ED, 0x5C59, 0xE5EE, 0x5B71, 0xE5EF, 0x5C63, 0xE5F0, 0x5C66, 0xE5F1, 0x7FBC, 0xE5F2, 0x5F2A, + 0xE5F3, 0x5F29, 0xE5F4, 0x5F2D, 0xE5F5, 0x8274, 0xE5F6, 0x5F3C, 0xE5F7, 0x9B3B, 0xE5F8, 0x5C6E, 0xE5F9, 0x5981, 0xE5FA, 0x5983, + 0xE5FB, 0x598D, 0xE5FC, 0x59A9, 0xE5FD, 0x59AA, 0xE5FE, 0x59A3, 0xE640, 0x936C, 0xE641, 0x936D, 0xE642, 0x936E, 0xE643, 0x936F, + 0xE644, 0x9370, 0xE645, 0x9371, 0xE646, 0x9372, 0xE647, 0x9373, 0xE648, 0x9374, 0xE649, 0x9375, 0xE64A, 0x9376, 0xE64B, 0x9377, + 0xE64C, 0x9378, 0xE64D, 0x9379, 0xE64E, 0x937A, 0xE64F, 0x937B, 0xE650, 0x937C, 0xE651, 0x937D, 0xE652, 0x937E, 0xE653, 0x937F, + 0xE654, 0x9380, 0xE655, 0x9381, 0xE656, 0x9382, 0xE657, 0x9383, 0xE658, 0x9384, 0xE659, 0x9385, 0xE65A, 0x9386, 0xE65B, 0x9387, + 0xE65C, 0x9388, 0xE65D, 0x9389, 0xE65E, 0x938A, 0xE65F, 0x938B, 0xE660, 0x938C, 0xE661, 0x938D, 0xE662, 0x938E, 0xE663, 0x9390, + 0xE664, 0x9391, 0xE665, 0x9392, 0xE666, 0x9393, 0xE667, 0x9394, 0xE668, 0x9395, 0xE669, 0x9396, 0xE66A, 0x9397, 0xE66B, 0x9398, + 0xE66C, 0x9399, 0xE66D, 0x939A, 0xE66E, 0x939B, 0xE66F, 0x939C, 0xE670, 0x939D, 0xE671, 0x939E, 0xE672, 0x939F, 0xE673, 0x93A0, + 0xE674, 0x93A1, 0xE675, 0x93A2, 0xE676, 0x93A3, 0xE677, 0x93A4, 0xE678, 0x93A5, 0xE679, 0x93A6, 0xE67A, 0x93A7, 0xE67B, 0x93A8, + 0xE67C, 0x93A9, 0xE67D, 0x93AA, 0xE67E, 0x93AB, 0xE680, 0x93AC, 0xE681, 0x93AD, 0xE682, 0x93AE, 0xE683, 0x93AF, 0xE684, 0x93B0, + 0xE685, 0x93B1, 0xE686, 0x93B2, 0xE687, 0x93B3, 0xE688, 0x93B4, 0xE689, 0x93B5, 0xE68A, 0x93B6, 0xE68B, 0x93B7, 0xE68C, 0x93B8, + 0xE68D, 0x93B9, 0xE68E, 0x93BA, 0xE68F, 0x93BB, 0xE690, 0x93BC, 0xE691, 0x93BD, 0xE692, 0x93BE, 0xE693, 0x93BF, 0xE694, 0x93C0, + 0xE695, 0x93C1, 0xE696, 0x93C2, 0xE697, 0x93C3, 0xE698, 0x93C4, 0xE699, 0x93C5, 0xE69A, 0x93C6, 0xE69B, 0x93C7, 0xE69C, 0x93C8, + 0xE69D, 0x93C9, 0xE69E, 0x93CB, 0xE69F, 0x93CC, 0xE6A0, 0x93CD, 0xE6A1, 0x5997, 0xE6A2, 0x59CA, 0xE6A3, 0x59AB, 0xE6A4, 0x599E, + 0xE6A5, 0x59A4, 0xE6A6, 0x59D2, 0xE6A7, 0x59B2, 0xE6A8, 0x59AF, 0xE6A9, 0x59D7, 0xE6AA, 0x59BE, 0xE6AB, 0x5A05, 0xE6AC, 0x5A06, + 0xE6AD, 0x59DD, 0xE6AE, 0x5A08, 0xE6AF, 0x59E3, 0xE6B0, 0x59D8, 0xE6B1, 0x59F9, 0xE6B2, 0x5A0C, 0xE6B3, 0x5A09, 0xE6B4, 0x5A32, + 0xE6B5, 0x5A34, 0xE6B6, 0x5A11, 0xE6B7, 0x5A23, 0xE6B8, 0x5A13, 0xE6B9, 0x5A40, 0xE6BA, 0x5A67, 0xE6BB, 0x5A4A, 0xE6BC, 0x5A55, + 0xE6BD, 0x5A3C, 0xE6BE, 0x5A62, 0xE6BF, 0x5A75, 0xE6C0, 0x80EC, 0xE6C1, 0x5AAA, 0xE6C2, 0x5A9B, 0xE6C3, 0x5A77, 0xE6C4, 0x5A7A, + 0xE6C5, 0x5ABE, 0xE6C6, 0x5AEB, 0xE6C7, 0x5AB2, 0xE6C8, 0x5AD2, 0xE6C9, 0x5AD4, 0xE6CA, 0x5AB8, 0xE6CB, 0x5AE0, 0xE6CC, 0x5AE3, + 0xE6CD, 0x5AF1, 0xE6CE, 0x5AD6, 0xE6CF, 0x5AE6, 0xE6D0, 0x5AD8, 0xE6D1, 0x5ADC, 0xE6D2, 0x5B09, 0xE6D3, 0x5B17, 0xE6D4, 0x5B16, + 0xE6D5, 0x5B32, 0xE6D6, 0x5B37, 0xE6D7, 0x5B40, 0xE6D8, 0x5C15, 0xE6D9, 0x5C1C, 0xE6DA, 0x5B5A, 0xE6DB, 0x5B65, 0xE6DC, 0x5B73, + 0xE6DD, 0x5B51, 0xE6DE, 0x5B53, 0xE6DF, 0x5B62, 0xE6E0, 0x9A75, 0xE6E1, 0x9A77, 0xE6E2, 0x9A78, 0xE6E3, 0x9A7A, 0xE6E4, 0x9A7F, + 0xE6E5, 0x9A7D, 0xE6E6, 0x9A80, 0xE6E7, 0x9A81, 0xE6E8, 0x9A85, 0xE6E9, 0x9A88, 0xE6EA, 0x9A8A, 0xE6EB, 0x9A90, 0xE6EC, 0x9A92, + 0xE6ED, 0x9A93, 0xE6EE, 0x9A96, 0xE6EF, 0x9A98, 0xE6F0, 0x9A9B, 0xE6F1, 0x9A9C, 0xE6F2, 0x9A9D, 0xE6F3, 0x9A9F, 0xE6F4, 0x9AA0, + 0xE6F5, 0x9AA2, 0xE6F6, 0x9AA3, 0xE6F7, 0x9AA5, 0xE6F8, 0x9AA7, 0xE6F9, 0x7E9F, 0xE6FA, 0x7EA1, 0xE6FB, 0x7EA3, 0xE6FC, 0x7EA5, + 0xE6FD, 0x7EA8, 0xE6FE, 0x7EA9, 0xE740, 0x93CE, 0xE741, 0x93CF, 0xE742, 0x93D0, 0xE743, 0x93D1, 0xE744, 0x93D2, 0xE745, 0x93D3, + 0xE746, 0x93D4, 0xE747, 0x93D5, 0xE748, 0x93D7, 0xE749, 0x93D8, 0xE74A, 0x93D9, 0xE74B, 0x93DA, 0xE74C, 0x93DB, 0xE74D, 0x93DC, + 0xE74E, 0x93DD, 0xE74F, 0x93DE, 0xE750, 0x93DF, 0xE751, 0x93E0, 0xE752, 0x93E1, 0xE753, 0x93E2, 0xE754, 0x93E3, 0xE755, 0x93E4, + 0xE756, 0x93E5, 0xE757, 0x93E6, 0xE758, 0x93E7, 0xE759, 0x93E8, 0xE75A, 0x93E9, 0xE75B, 0x93EA, 0xE75C, 0x93EB, 0xE75D, 0x93EC, + 0xE75E, 0x93ED, 0xE75F, 0x93EE, 0xE760, 0x93EF, 0xE761, 0x93F0, 0xE762, 0x93F1, 0xE763, 0x93F2, 0xE764, 0x93F3, 0xE765, 0x93F4, + 0xE766, 0x93F5, 0xE767, 0x93F6, 0xE768, 0x93F7, 0xE769, 0x93F8, 0xE76A, 0x93F9, 0xE76B, 0x93FA, 0xE76C, 0x93FB, 0xE76D, 0x93FC, + 0xE76E, 0x93FD, 0xE76F, 0x93FE, 0xE770, 0x93FF, 0xE771, 0x9400, 0xE772, 0x9401, 0xE773, 0x9402, 0xE774, 0x9403, 0xE775, 0x9404, + 0xE776, 0x9405, 0xE777, 0x9406, 0xE778, 0x9407, 0xE779, 0x9408, 0xE77A, 0x9409, 0xE77B, 0x940A, 0xE77C, 0x940B, 0xE77D, 0x940C, + 0xE77E, 0x940D, 0xE780, 0x940E, 0xE781, 0x940F, 0xE782, 0x9410, 0xE783, 0x9411, 0xE784, 0x9412, 0xE785, 0x9413, 0xE786, 0x9414, + 0xE787, 0x9415, 0xE788, 0x9416, 0xE789, 0x9417, 0xE78A, 0x9418, 0xE78B, 0x9419, 0xE78C, 0x941A, 0xE78D, 0x941B, 0xE78E, 0x941C, + 0xE78F, 0x941D, 0xE790, 0x941E, 0xE791, 0x941F, 0xE792, 0x9420, 0xE793, 0x9421, 0xE794, 0x9422, 0xE795, 0x9423, 0xE796, 0x9424, + 0xE797, 0x9425, 0xE798, 0x9426, 0xE799, 0x9427, 0xE79A, 0x9428, 0xE79B, 0x9429, 0xE79C, 0x942A, 0xE79D, 0x942B, 0xE79E, 0x942C, + 0xE79F, 0x942D, 0xE7A0, 0x942E, 0xE7A1, 0x7EAD, 0xE7A2, 0x7EB0, 0xE7A3, 0x7EBE, 0xE7A4, 0x7EC0, 0xE7A5, 0x7EC1, 0xE7A6, 0x7EC2, + 0xE7A7, 0x7EC9, 0xE7A8, 0x7ECB, 0xE7A9, 0x7ECC, 0xE7AA, 0x7ED0, 0xE7AB, 0x7ED4, 0xE7AC, 0x7ED7, 0xE7AD, 0x7EDB, 0xE7AE, 0x7EE0, + 0xE7AF, 0x7EE1, 0xE7B0, 0x7EE8, 0xE7B1, 0x7EEB, 0xE7B2, 0x7EEE, 0xE7B3, 0x7EEF, 0xE7B4, 0x7EF1, 0xE7B5, 0x7EF2, 0xE7B6, 0x7F0D, + 0xE7B7, 0x7EF6, 0xE7B8, 0x7EFA, 0xE7B9, 0x7EFB, 0xE7BA, 0x7EFE, 0xE7BB, 0x7F01, 0xE7BC, 0x7F02, 0xE7BD, 0x7F03, 0xE7BE, 0x7F07, + 0xE7BF, 0x7F08, 0xE7C0, 0x7F0B, 0xE7C1, 0x7F0C, 0xE7C2, 0x7F0F, 0xE7C3, 0x7F11, 0xE7C4, 0x7F12, 0xE7C5, 0x7F17, 0xE7C6, 0x7F19, + 0xE7C7, 0x7F1C, 0xE7C8, 0x7F1B, 0xE7C9, 0x7F1F, 0xE7CA, 0x7F21, 0xE7CB, 0x7F22, 0xE7CC, 0x7F23, 0xE7CD, 0x7F24, 0xE7CE, 0x7F25, + 0xE7CF, 0x7F26, 0xE7D0, 0x7F27, 0xE7D1, 0x7F2A, 0xE7D2, 0x7F2B, 0xE7D3, 0x7F2C, 0xE7D4, 0x7F2D, 0xE7D5, 0x7F2F, 0xE7D6, 0x7F30, + 0xE7D7, 0x7F31, 0xE7D8, 0x7F32, 0xE7D9, 0x7F33, 0xE7DA, 0x7F35, 0xE7DB, 0x5E7A, 0xE7DC, 0x757F, 0xE7DD, 0x5DDB, 0xE7DE, 0x753E, + 0xE7DF, 0x9095, 0xE7E0, 0x738E, 0xE7E1, 0x7391, 0xE7E2, 0x73AE, 0xE7E3, 0x73A2, 0xE7E4, 0x739F, 0xE7E5, 0x73CF, 0xE7E6, 0x73C2, + 0xE7E7, 0x73D1, 0xE7E8, 0x73B7, 0xE7E9, 0x73B3, 0xE7EA, 0x73C0, 0xE7EB, 0x73C9, 0xE7EC, 0x73C8, 0xE7ED, 0x73E5, 0xE7EE, 0x73D9, + 0xE7EF, 0x987C, 0xE7F0, 0x740A, 0xE7F1, 0x73E9, 0xE7F2, 0x73E7, 0xE7F3, 0x73DE, 0xE7F4, 0x73BA, 0xE7F5, 0x73F2, 0xE7F6, 0x740F, + 0xE7F7, 0x742A, 0xE7F8, 0x745B, 0xE7F9, 0x7426, 0xE7FA, 0x7425, 0xE7FB, 0x7428, 0xE7FC, 0x7430, 0xE7FD, 0x742E, 0xE7FE, 0x742C, + 0xE840, 0x942F, 0xE841, 0x9430, 0xE842, 0x9431, 0xE843, 0x9432, 0xE844, 0x9433, 0xE845, 0x9434, 0xE846, 0x9435, 0xE847, 0x9436, + 0xE848, 0x9437, 0xE849, 0x9438, 0xE84A, 0x9439, 0xE84B, 0x943A, 0xE84C, 0x943B, 0xE84D, 0x943C, 0xE84E, 0x943D, 0xE84F, 0x943F, + 0xE850, 0x9440, 0xE851, 0x9441, 0xE852, 0x9442, 0xE853, 0x9443, 0xE854, 0x9444, 0xE855, 0x9445, 0xE856, 0x9446, 0xE857, 0x9447, + 0xE858, 0x9448, 0xE859, 0x9449, 0xE85A, 0x944A, 0xE85B, 0x944B, 0xE85C, 0x944C, 0xE85D, 0x944D, 0xE85E, 0x944E, 0xE85F, 0x944F, + 0xE860, 0x9450, 0xE861, 0x9451, 0xE862, 0x9452, 0xE863, 0x9453, 0xE864, 0x9454, 0xE865, 0x9455, 0xE866, 0x9456, 0xE867, 0x9457, + 0xE868, 0x9458, 0xE869, 0x9459, 0xE86A, 0x945A, 0xE86B, 0x945B, 0xE86C, 0x945C, 0xE86D, 0x945D, 0xE86E, 0x945E, 0xE86F, 0x945F, + 0xE870, 0x9460, 0xE871, 0x9461, 0xE872, 0x9462, 0xE873, 0x9463, 0xE874, 0x9464, 0xE875, 0x9465, 0xE876, 0x9466, 0xE877, 0x9467, + 0xE878, 0x9468, 0xE879, 0x9469, 0xE87A, 0x946A, 0xE87B, 0x946C, 0xE87C, 0x946D, 0xE87D, 0x946E, 0xE87E, 0x946F, 0xE880, 0x9470, + 0xE881, 0x9471, 0xE882, 0x9472, 0xE883, 0x9473, 0xE884, 0x9474, 0xE885, 0x9475, 0xE886, 0x9476, 0xE887, 0x9477, 0xE888, 0x9478, + 0xE889, 0x9479, 0xE88A, 0x947A, 0xE88B, 0x947B, 0xE88C, 0x947C, 0xE88D, 0x947D, 0xE88E, 0x947E, 0xE88F, 0x947F, 0xE890, 0x9480, + 0xE891, 0x9481, 0xE892, 0x9482, 0xE893, 0x9483, 0xE894, 0x9484, 0xE895, 0x9491, 0xE896, 0x9496, 0xE897, 0x9498, 0xE898, 0x94C7, + 0xE899, 0x94CF, 0xE89A, 0x94D3, 0xE89B, 0x94D4, 0xE89C, 0x94DA, 0xE89D, 0x94E6, 0xE89E, 0x94FB, 0xE89F, 0x951C, 0xE8A0, 0x9520, + 0xE8A1, 0x741B, 0xE8A2, 0x741A, 0xE8A3, 0x7441, 0xE8A4, 0x745C, 0xE8A5, 0x7457, 0xE8A6, 0x7455, 0xE8A7, 0x7459, 0xE8A8, 0x7477, + 0xE8A9, 0x746D, 0xE8AA, 0x747E, 0xE8AB, 0x749C, 0xE8AC, 0x748E, 0xE8AD, 0x7480, 0xE8AE, 0x7481, 0xE8AF, 0x7487, 0xE8B0, 0x748B, + 0xE8B1, 0x749E, 0xE8B2, 0x74A8, 0xE8B3, 0x74A9, 0xE8B4, 0x7490, 0xE8B5, 0x74A7, 0xE8B6, 0x74D2, 0xE8B7, 0x74BA, 0xE8B8, 0x97EA, + 0xE8B9, 0x97EB, 0xE8BA, 0x97EC, 0xE8BB, 0x674C, 0xE8BC, 0x6753, 0xE8BD, 0x675E, 0xE8BE, 0x6748, 0xE8BF, 0x6769, 0xE8C0, 0x67A5, + 0xE8C1, 0x6787, 0xE8C2, 0x676A, 0xE8C3, 0x6773, 0xE8C4, 0x6798, 0xE8C5, 0x67A7, 0xE8C6, 0x6775, 0xE8C7, 0x67A8, 0xE8C8, 0x679E, + 0xE8C9, 0x67AD, 0xE8CA, 0x678B, 0xE8CB, 0x6777, 0xE8CC, 0x677C, 0xE8CD, 0x67F0, 0xE8CE, 0x6809, 0xE8CF, 0x67D8, 0xE8D0, 0x680A, + 0xE8D1, 0x67E9, 0xE8D2, 0x67B0, 0xE8D3, 0x680C, 0xE8D4, 0x67D9, 0xE8D5, 0x67B5, 0xE8D6, 0x67DA, 0xE8D7, 0x67B3, 0xE8D8, 0x67DD, + 0xE8D9, 0x6800, 0xE8DA, 0x67C3, 0xE8DB, 0x67B8, 0xE8DC, 0x67E2, 0xE8DD, 0x680E, 0xE8DE, 0x67C1, 0xE8DF, 0x67FD, 0xE8E0, 0x6832, + 0xE8E1, 0x6833, 0xE8E2, 0x6860, 0xE8E3, 0x6861, 0xE8E4, 0x684E, 0xE8E5, 0x6862, 0xE8E6, 0x6844, 0xE8E7, 0x6864, 0xE8E8, 0x6883, + 0xE8E9, 0x681D, 0xE8EA, 0x6855, 0xE8EB, 0x6866, 0xE8EC, 0x6841, 0xE8ED, 0x6867, 0xE8EE, 0x6840, 0xE8EF, 0x683E, 0xE8F0, 0x684A, + 0xE8F1, 0x6849, 0xE8F2, 0x6829, 0xE8F3, 0x68B5, 0xE8F4, 0x688F, 0xE8F5, 0x6874, 0xE8F6, 0x6877, 0xE8F7, 0x6893, 0xE8F8, 0x686B, + 0xE8F9, 0x68C2, 0xE8FA, 0x696E, 0xE8FB, 0x68FC, 0xE8FC, 0x691F, 0xE8FD, 0x6920, 0xE8FE, 0x68F9, 0xE940, 0x9527, 0xE941, 0x9533, + 0xE942, 0x953D, 0xE943, 0x9543, 0xE944, 0x9548, 0xE945, 0x954B, 0xE946, 0x9555, 0xE947, 0x955A, 0xE948, 0x9560, 0xE949, 0x956E, + 0xE94A, 0x9574, 0xE94B, 0x9575, 0xE94C, 0x9577, 0xE94D, 0x9578, 0xE94E, 0x9579, 0xE94F, 0x957A, 0xE950, 0x957B, 0xE951, 0x957C, + 0xE952, 0x957D, 0xE953, 0x957E, 0xE954, 0x9580, 0xE955, 0x9581, 0xE956, 0x9582, 0xE957, 0x9583, 0xE958, 0x9584, 0xE959, 0x9585, + 0xE95A, 0x9586, 0xE95B, 0x9587, 0xE95C, 0x9588, 0xE95D, 0x9589, 0xE95E, 0x958A, 0xE95F, 0x958B, 0xE960, 0x958C, 0xE961, 0x958D, + 0xE962, 0x958E, 0xE963, 0x958F, 0xE964, 0x9590, 0xE965, 0x9591, 0xE966, 0x9592, 0xE967, 0x9593, 0xE968, 0x9594, 0xE969, 0x9595, + 0xE96A, 0x9596, 0xE96B, 0x9597, 0xE96C, 0x9598, 0xE96D, 0x9599, 0xE96E, 0x959A, 0xE96F, 0x959B, 0xE970, 0x959C, 0xE971, 0x959D, + 0xE972, 0x959E, 0xE973, 0x959F, 0xE974, 0x95A0, 0xE975, 0x95A1, 0xE976, 0x95A2, 0xE977, 0x95A3, 0xE978, 0x95A4, 0xE979, 0x95A5, + 0xE97A, 0x95A6, 0xE97B, 0x95A7, 0xE97C, 0x95A8, 0xE97D, 0x95A9, 0xE97E, 0x95AA, 0xE980, 0x95AB, 0xE981, 0x95AC, 0xE982, 0x95AD, + 0xE983, 0x95AE, 0xE984, 0x95AF, 0xE985, 0x95B0, 0xE986, 0x95B1, 0xE987, 0x95B2, 0xE988, 0x95B3, 0xE989, 0x95B4, 0xE98A, 0x95B5, + 0xE98B, 0x95B6, 0xE98C, 0x95B7, 0xE98D, 0x95B8, 0xE98E, 0x95B9, 0xE98F, 0x95BA, 0xE990, 0x95BB, 0xE991, 0x95BC, 0xE992, 0x95BD, + 0xE993, 0x95BE, 0xE994, 0x95BF, 0xE995, 0x95C0, 0xE996, 0x95C1, 0xE997, 0x95C2, 0xE998, 0x95C3, 0xE999, 0x95C4, 0xE99A, 0x95C5, + 0xE99B, 0x95C6, 0xE99C, 0x95C7, 0xE99D, 0x95C8, 0xE99E, 0x95C9, 0xE99F, 0x95CA, 0xE9A0, 0x95CB, 0xE9A1, 0x6924, 0xE9A2, 0x68F0, + 0xE9A3, 0x690B, 0xE9A4, 0x6901, 0xE9A5, 0x6957, 0xE9A6, 0x68E3, 0xE9A7, 0x6910, 0xE9A8, 0x6971, 0xE9A9, 0x6939, 0xE9AA, 0x6960, + 0xE9AB, 0x6942, 0xE9AC, 0x695D, 0xE9AD, 0x6984, 0xE9AE, 0x696B, 0xE9AF, 0x6980, 0xE9B0, 0x6998, 0xE9B1, 0x6978, 0xE9B2, 0x6934, + 0xE9B3, 0x69CC, 0xE9B4, 0x6987, 0xE9B5, 0x6988, 0xE9B6, 0x69CE, 0xE9B7, 0x6989, 0xE9B8, 0x6966, 0xE9B9, 0x6963, 0xE9BA, 0x6979, + 0xE9BB, 0x699B, 0xE9BC, 0x69A7, 0xE9BD, 0x69BB, 0xE9BE, 0x69AB, 0xE9BF, 0x69AD, 0xE9C0, 0x69D4, 0xE9C1, 0x69B1, 0xE9C2, 0x69C1, + 0xE9C3, 0x69CA, 0xE9C4, 0x69DF, 0xE9C5, 0x6995, 0xE9C6, 0x69E0, 0xE9C7, 0x698D, 0xE9C8, 0x69FF, 0xE9C9, 0x6A2F, 0xE9CA, 0x69ED, + 0xE9CB, 0x6A17, 0xE9CC, 0x6A18, 0xE9CD, 0x6A65, 0xE9CE, 0x69F2, 0xE9CF, 0x6A44, 0xE9D0, 0x6A3E, 0xE9D1, 0x6AA0, 0xE9D2, 0x6A50, + 0xE9D3, 0x6A5B, 0xE9D4, 0x6A35, 0xE9D5, 0x6A8E, 0xE9D6, 0x6A79, 0xE9D7, 0x6A3D, 0xE9D8, 0x6A28, 0xE9D9, 0x6A58, 0xE9DA, 0x6A7C, + 0xE9DB, 0x6A91, 0xE9DC, 0x6A90, 0xE9DD, 0x6AA9, 0xE9DE, 0x6A97, 0xE9DF, 0x6AAB, 0xE9E0, 0x7337, 0xE9E1, 0x7352, 0xE9E2, 0x6B81, + 0xE9E3, 0x6B82, 0xE9E4, 0x6B87, 0xE9E5, 0x6B84, 0xE9E6, 0x6B92, 0xE9E7, 0x6B93, 0xE9E8, 0x6B8D, 0xE9E9, 0x6B9A, 0xE9EA, 0x6B9B, + 0xE9EB, 0x6BA1, 0xE9EC, 0x6BAA, 0xE9ED, 0x8F6B, 0xE9EE, 0x8F6D, 0xE9EF, 0x8F71, 0xE9F0, 0x8F72, 0xE9F1, 0x8F73, 0xE9F2, 0x8F75, + 0xE9F3, 0x8F76, 0xE9F4, 0x8F78, 0xE9F5, 0x8F77, 0xE9F6, 0x8F79, 0xE9F7, 0x8F7A, 0xE9F8, 0x8F7C, 0xE9F9, 0x8F7E, 0xE9FA, 0x8F81, + 0xE9FB, 0x8F82, 0xE9FC, 0x8F84, 0xE9FD, 0x8F87, 0xE9FE, 0x8F8B, 0xEA40, 0x95CC, 0xEA41, 0x95CD, 0xEA42, 0x95CE, 0xEA43, 0x95CF, + 0xEA44, 0x95D0, 0xEA45, 0x95D1, 0xEA46, 0x95D2, 0xEA47, 0x95D3, 0xEA48, 0x95D4, 0xEA49, 0x95D5, 0xEA4A, 0x95D6, 0xEA4B, 0x95D7, + 0xEA4C, 0x95D8, 0xEA4D, 0x95D9, 0xEA4E, 0x95DA, 0xEA4F, 0x95DB, 0xEA50, 0x95DC, 0xEA51, 0x95DD, 0xEA52, 0x95DE, 0xEA53, 0x95DF, + 0xEA54, 0x95E0, 0xEA55, 0x95E1, 0xEA56, 0x95E2, 0xEA57, 0x95E3, 0xEA58, 0x95E4, 0xEA59, 0x95E5, 0xEA5A, 0x95E6, 0xEA5B, 0x95E7, + 0xEA5C, 0x95EC, 0xEA5D, 0x95FF, 0xEA5E, 0x9607, 0xEA5F, 0x9613, 0xEA60, 0x9618, 0xEA61, 0x961B, 0xEA62, 0x961E, 0xEA63, 0x9620, + 0xEA64, 0x9623, 0xEA65, 0x9624, 0xEA66, 0x9625, 0xEA67, 0x9626, 0xEA68, 0x9627, 0xEA69, 0x9628, 0xEA6A, 0x9629, 0xEA6B, 0x962B, + 0xEA6C, 0x962C, 0xEA6D, 0x962D, 0xEA6E, 0x962F, 0xEA6F, 0x9630, 0xEA70, 0x9637, 0xEA71, 0x9638, 0xEA72, 0x9639, 0xEA73, 0x963A, + 0xEA74, 0x963E, 0xEA75, 0x9641, 0xEA76, 0x9643, 0xEA77, 0x964A, 0xEA78, 0x964E, 0xEA79, 0x964F, 0xEA7A, 0x9651, 0xEA7B, 0x9652, + 0xEA7C, 0x9653, 0xEA7D, 0x9656, 0xEA7E, 0x9657, 0xEA80, 0x9658, 0xEA81, 0x9659, 0xEA82, 0x965A, 0xEA83, 0x965C, 0xEA84, 0x965D, + 0xEA85, 0x965E, 0xEA86, 0x9660, 0xEA87, 0x9663, 0xEA88, 0x9665, 0xEA89, 0x9666, 0xEA8A, 0x966B, 0xEA8B, 0x966D, 0xEA8C, 0x966E, + 0xEA8D, 0x966F, 0xEA8E, 0x9670, 0xEA8F, 0x9671, 0xEA90, 0x9673, 0xEA91, 0x9678, 0xEA92, 0x9679, 0xEA93, 0x967A, 0xEA94, 0x967B, + 0xEA95, 0x967C, 0xEA96, 0x967D, 0xEA97, 0x967E, 0xEA98, 0x967F, 0xEA99, 0x9680, 0xEA9A, 0x9681, 0xEA9B, 0x9682, 0xEA9C, 0x9683, + 0xEA9D, 0x9684, 0xEA9E, 0x9687, 0xEA9F, 0x9689, 0xEAA0, 0x968A, 0xEAA1, 0x8F8D, 0xEAA2, 0x8F8E, 0xEAA3, 0x8F8F, 0xEAA4, 0x8F98, + 0xEAA5, 0x8F9A, 0xEAA6, 0x8ECE, 0xEAA7, 0x620B, 0xEAA8, 0x6217, 0xEAA9, 0x621B, 0xEAAA, 0x621F, 0xEAAB, 0x6222, 0xEAAC, 0x6221, + 0xEAAD, 0x6225, 0xEAAE, 0x6224, 0xEAAF, 0x622C, 0xEAB0, 0x81E7, 0xEAB1, 0x74EF, 0xEAB2, 0x74F4, 0xEAB3, 0x74FF, 0xEAB4, 0x750F, + 0xEAB5, 0x7511, 0xEAB6, 0x7513, 0xEAB7, 0x6534, 0xEAB8, 0x65EE, 0xEAB9, 0x65EF, 0xEABA, 0x65F0, 0xEABB, 0x660A, 0xEABC, 0x6619, + 0xEABD, 0x6772, 0xEABE, 0x6603, 0xEABF, 0x6615, 0xEAC0, 0x6600, 0xEAC1, 0x7085, 0xEAC2, 0x66F7, 0xEAC3, 0x661D, 0xEAC4, 0x6634, + 0xEAC5, 0x6631, 0xEAC6, 0x6636, 0xEAC7, 0x6635, 0xEAC8, 0x8006, 0xEAC9, 0x665F, 0xEACA, 0x6654, 0xEACB, 0x6641, 0xEACC, 0x664F, + 0xEACD, 0x6656, 0xEACE, 0x6661, 0xEACF, 0x6657, 0xEAD0, 0x6677, 0xEAD1, 0x6684, 0xEAD2, 0x668C, 0xEAD3, 0x66A7, 0xEAD4, 0x669D, + 0xEAD5, 0x66BE, 0xEAD6, 0x66DB, 0xEAD7, 0x66DC, 0xEAD8, 0x66E6, 0xEAD9, 0x66E9, 0xEADA, 0x8D32, 0xEADB, 0x8D33, 0xEADC, 0x8D36, + 0xEADD, 0x8D3B, 0xEADE, 0x8D3D, 0xEADF, 0x8D40, 0xEAE0, 0x8D45, 0xEAE1, 0x8D46, 0xEAE2, 0x8D48, 0xEAE3, 0x8D49, 0xEAE4, 0x8D47, + 0xEAE5, 0x8D4D, 0xEAE6, 0x8D55, 0xEAE7, 0x8D59, 0xEAE8, 0x89C7, 0xEAE9, 0x89CA, 0xEAEA, 0x89CB, 0xEAEB, 0x89CC, 0xEAEC, 0x89CE, + 0xEAED, 0x89CF, 0xEAEE, 0x89D0, 0xEAEF, 0x89D1, 0xEAF0, 0x726E, 0xEAF1, 0x729F, 0xEAF2, 0x725D, 0xEAF3, 0x7266, 0xEAF4, 0x726F, + 0xEAF5, 0x727E, 0xEAF6, 0x727F, 0xEAF7, 0x7284, 0xEAF8, 0x728B, 0xEAF9, 0x728D, 0xEAFA, 0x728F, 0xEAFB, 0x7292, 0xEAFC, 0x6308, + 0xEAFD, 0x6332, 0xEAFE, 0x63B0, 0xEB40, 0x968C, 0xEB41, 0x968E, 0xEB42, 0x9691, 0xEB43, 0x9692, 0xEB44, 0x9693, 0xEB45, 0x9695, + 0xEB46, 0x9696, 0xEB47, 0x969A, 0xEB48, 0x969B, 0xEB49, 0x969D, 0xEB4A, 0x969E, 0xEB4B, 0x969F, 0xEB4C, 0x96A0, 0xEB4D, 0x96A1, + 0xEB4E, 0x96A2, 0xEB4F, 0x96A3, 0xEB50, 0x96A4, 0xEB51, 0x96A5, 0xEB52, 0x96A6, 0xEB53, 0x96A8, 0xEB54, 0x96A9, 0xEB55, 0x96AA, + 0xEB56, 0x96AB, 0xEB57, 0x96AC, 0xEB58, 0x96AD, 0xEB59, 0x96AE, 0xEB5A, 0x96AF, 0xEB5B, 0x96B1, 0xEB5C, 0x96B2, 0xEB5D, 0x96B4, + 0xEB5E, 0x96B5, 0xEB5F, 0x96B7, 0xEB60, 0x96B8, 0xEB61, 0x96BA, 0xEB62, 0x96BB, 0xEB63, 0x96BF, 0xEB64, 0x96C2, 0xEB65, 0x96C3, + 0xEB66, 0x96C8, 0xEB67, 0x96CA, 0xEB68, 0x96CB, 0xEB69, 0x96D0, 0xEB6A, 0x96D1, 0xEB6B, 0x96D3, 0xEB6C, 0x96D4, 0xEB6D, 0x96D6, + 0xEB6E, 0x96D7, 0xEB6F, 0x96D8, 0xEB70, 0x96D9, 0xEB71, 0x96DA, 0xEB72, 0x96DB, 0xEB73, 0x96DC, 0xEB74, 0x96DD, 0xEB75, 0x96DE, + 0xEB76, 0x96DF, 0xEB77, 0x96E1, 0xEB78, 0x96E2, 0xEB79, 0x96E3, 0xEB7A, 0x96E4, 0xEB7B, 0x96E5, 0xEB7C, 0x96E6, 0xEB7D, 0x96E7, + 0xEB7E, 0x96EB, 0xEB80, 0x96EC, 0xEB81, 0x96ED, 0xEB82, 0x96EE, 0xEB83, 0x96F0, 0xEB84, 0x96F1, 0xEB85, 0x96F2, 0xEB86, 0x96F4, + 0xEB87, 0x96F5, 0xEB88, 0x96F8, 0xEB89, 0x96FA, 0xEB8A, 0x96FB, 0xEB8B, 0x96FC, 0xEB8C, 0x96FD, 0xEB8D, 0x96FF, 0xEB8E, 0x9702, + 0xEB8F, 0x9703, 0xEB90, 0x9705, 0xEB91, 0x970A, 0xEB92, 0x970B, 0xEB93, 0x970C, 0xEB94, 0x9710, 0xEB95, 0x9711, 0xEB96, 0x9712, + 0xEB97, 0x9714, 0xEB98, 0x9715, 0xEB99, 0x9717, 0xEB9A, 0x9718, 0xEB9B, 0x9719, 0xEB9C, 0x971A, 0xEB9D, 0x971B, 0xEB9E, 0x971D, + 0xEB9F, 0x971F, 0xEBA0, 0x9720, 0xEBA1, 0x643F, 0xEBA2, 0x64D8, 0xEBA3, 0x8004, 0xEBA4, 0x6BEA, 0xEBA5, 0x6BF3, 0xEBA6, 0x6BFD, + 0xEBA7, 0x6BF5, 0xEBA8, 0x6BF9, 0xEBA9, 0x6C05, 0xEBAA, 0x6C07, 0xEBAB, 0x6C06, 0xEBAC, 0x6C0D, 0xEBAD, 0x6C15, 0xEBAE, 0x6C18, + 0xEBAF, 0x6C19, 0xEBB0, 0x6C1A, 0xEBB1, 0x6C21, 0xEBB2, 0x6C29, 0xEBB3, 0x6C24, 0xEBB4, 0x6C2A, 0xEBB5, 0x6C32, 0xEBB6, 0x6535, + 0xEBB7, 0x6555, 0xEBB8, 0x656B, 0xEBB9, 0x724D, 0xEBBA, 0x7252, 0xEBBB, 0x7256, 0xEBBC, 0x7230, 0xEBBD, 0x8662, 0xEBBE, 0x5216, + 0xEBBF, 0x809F, 0xEBC0, 0x809C, 0xEBC1, 0x8093, 0xEBC2, 0x80BC, 0xEBC3, 0x670A, 0xEBC4, 0x80BD, 0xEBC5, 0x80B1, 0xEBC6, 0x80AB, + 0xEBC7, 0x80AD, 0xEBC8, 0x80B4, 0xEBC9, 0x80B7, 0xEBCA, 0x80E7, 0xEBCB, 0x80E8, 0xEBCC, 0x80E9, 0xEBCD, 0x80EA, 0xEBCE, 0x80DB, + 0xEBCF, 0x80C2, 0xEBD0, 0x80C4, 0xEBD1, 0x80D9, 0xEBD2, 0x80CD, 0xEBD3, 0x80D7, 0xEBD4, 0x6710, 0xEBD5, 0x80DD, 0xEBD6, 0x80EB, + 0xEBD7, 0x80F1, 0xEBD8, 0x80F4, 0xEBD9, 0x80ED, 0xEBDA, 0x810D, 0xEBDB, 0x810E, 0xEBDC, 0x80F2, 0xEBDD, 0x80FC, 0xEBDE, 0x6715, + 0xEBDF, 0x8112, 0xEBE0, 0x8C5A, 0xEBE1, 0x8136, 0xEBE2, 0x811E, 0xEBE3, 0x812C, 0xEBE4, 0x8118, 0xEBE5, 0x8132, 0xEBE6, 0x8148, + 0xEBE7, 0x814C, 0xEBE8, 0x8153, 0xEBE9, 0x8174, 0xEBEA, 0x8159, 0xEBEB, 0x815A, 0xEBEC, 0x8171, 0xEBED, 0x8160, 0xEBEE, 0x8169, + 0xEBEF, 0x817C, 0xEBF0, 0x817D, 0xEBF1, 0x816D, 0xEBF2, 0x8167, 0xEBF3, 0x584D, 0xEBF4, 0x5AB5, 0xEBF5, 0x8188, 0xEBF6, 0x8182, + 0xEBF7, 0x8191, 0xEBF8, 0x6ED5, 0xEBF9, 0x81A3, 0xEBFA, 0x81AA, 0xEBFB, 0x81CC, 0xEBFC, 0x6726, 0xEBFD, 0x81CA, 0xEBFE, 0x81BB, + 0xEC40, 0x9721, 0xEC41, 0x9722, 0xEC42, 0x9723, 0xEC43, 0x9724, 0xEC44, 0x9725, 0xEC45, 0x9726, 0xEC46, 0x9727, 0xEC47, 0x9728, + 0xEC48, 0x9729, 0xEC49, 0x972B, 0xEC4A, 0x972C, 0xEC4B, 0x972E, 0xEC4C, 0x972F, 0xEC4D, 0x9731, 0xEC4E, 0x9733, 0xEC4F, 0x9734, + 0xEC50, 0x9735, 0xEC51, 0x9736, 0xEC52, 0x9737, 0xEC53, 0x973A, 0xEC54, 0x973B, 0xEC55, 0x973C, 0xEC56, 0x973D, 0xEC57, 0x973F, + 0xEC58, 0x9740, 0xEC59, 0x9741, 0xEC5A, 0x9742, 0xEC5B, 0x9743, 0xEC5C, 0x9744, 0xEC5D, 0x9745, 0xEC5E, 0x9746, 0xEC5F, 0x9747, + 0xEC60, 0x9748, 0xEC61, 0x9749, 0xEC62, 0x974A, 0xEC63, 0x974B, 0xEC64, 0x974C, 0xEC65, 0x974D, 0xEC66, 0x974E, 0xEC67, 0x974F, + 0xEC68, 0x9750, 0xEC69, 0x9751, 0xEC6A, 0x9754, 0xEC6B, 0x9755, 0xEC6C, 0x9757, 0xEC6D, 0x9758, 0xEC6E, 0x975A, 0xEC6F, 0x975C, + 0xEC70, 0x975D, 0xEC71, 0x975F, 0xEC72, 0x9763, 0xEC73, 0x9764, 0xEC74, 0x9766, 0xEC75, 0x9767, 0xEC76, 0x9768, 0xEC77, 0x976A, + 0xEC78, 0x976B, 0xEC79, 0x976C, 0xEC7A, 0x976D, 0xEC7B, 0x976E, 0xEC7C, 0x976F, 0xEC7D, 0x9770, 0xEC7E, 0x9771, 0xEC80, 0x9772, + 0xEC81, 0x9775, 0xEC82, 0x9777, 0xEC83, 0x9778, 0xEC84, 0x9779, 0xEC85, 0x977A, 0xEC86, 0x977B, 0xEC87, 0x977D, 0xEC88, 0x977E, + 0xEC89, 0x977F, 0xEC8A, 0x9780, 0xEC8B, 0x9781, 0xEC8C, 0x9782, 0xEC8D, 0x9783, 0xEC8E, 0x9784, 0xEC8F, 0x9786, 0xEC90, 0x9787, + 0xEC91, 0x9788, 0xEC92, 0x9789, 0xEC93, 0x978A, 0xEC94, 0x978C, 0xEC95, 0x978E, 0xEC96, 0x978F, 0xEC97, 0x9790, 0xEC98, 0x9793, + 0xEC99, 0x9795, 0xEC9A, 0x9796, 0xEC9B, 0x9797, 0xEC9C, 0x9799, 0xEC9D, 0x979A, 0xEC9E, 0x979B, 0xEC9F, 0x979C, 0xECA0, 0x979D, + 0xECA1, 0x81C1, 0xECA2, 0x81A6, 0xECA3, 0x6B24, 0xECA4, 0x6B37, 0xECA5, 0x6B39, 0xECA6, 0x6B43, 0xECA7, 0x6B46, 0xECA8, 0x6B59, + 0xECA9, 0x98D1, 0xECAA, 0x98D2, 0xECAB, 0x98D3, 0xECAC, 0x98D5, 0xECAD, 0x98D9, 0xECAE, 0x98DA, 0xECAF, 0x6BB3, 0xECB0, 0x5F40, + 0xECB1, 0x6BC2, 0xECB2, 0x89F3, 0xECB3, 0x6590, 0xECB4, 0x9F51, 0xECB5, 0x6593, 0xECB6, 0x65BC, 0xECB7, 0x65C6, 0xECB8, 0x65C4, + 0xECB9, 0x65C3, 0xECBA, 0x65CC, 0xECBB, 0x65CE, 0xECBC, 0x65D2, 0xECBD, 0x65D6, 0xECBE, 0x7080, 0xECBF, 0x709C, 0xECC0, 0x7096, + 0xECC1, 0x709D, 0xECC2, 0x70BB, 0xECC3, 0x70C0, 0xECC4, 0x70B7, 0xECC5, 0x70AB, 0xECC6, 0x70B1, 0xECC7, 0x70E8, 0xECC8, 0x70CA, + 0xECC9, 0x7110, 0xECCA, 0x7113, 0xECCB, 0x7116, 0xECCC, 0x712F, 0xECCD, 0x7131, 0xECCE, 0x7173, 0xECCF, 0x715C, 0xECD0, 0x7168, + 0xECD1, 0x7145, 0xECD2, 0x7172, 0xECD3, 0x714A, 0xECD4, 0x7178, 0xECD5, 0x717A, 0xECD6, 0x7198, 0xECD7, 0x71B3, 0xECD8, 0x71B5, + 0xECD9, 0x71A8, 0xECDA, 0x71A0, 0xECDB, 0x71E0, 0xECDC, 0x71D4, 0xECDD, 0x71E7, 0xECDE, 0x71F9, 0xECDF, 0x721D, 0xECE0, 0x7228, + 0xECE1, 0x706C, 0xECE2, 0x7118, 0xECE3, 0x7166, 0xECE4, 0x71B9, 0xECE5, 0x623E, 0xECE6, 0x623D, 0xECE7, 0x6243, 0xECE8, 0x6248, + 0xECE9, 0x6249, 0xECEA, 0x793B, 0xECEB, 0x7940, 0xECEC, 0x7946, 0xECED, 0x7949, 0xECEE, 0x795B, 0xECEF, 0x795C, 0xECF0, 0x7953, + 0xECF1, 0x795A, 0xECF2, 0x7962, 0xECF3, 0x7957, 0xECF4, 0x7960, 0xECF5, 0x796F, 0xECF6, 0x7967, 0xECF7, 0x797A, 0xECF8, 0x7985, + 0xECF9, 0x798A, 0xECFA, 0x799A, 0xECFB, 0x79A7, 0xECFC, 0x79B3, 0xECFD, 0x5FD1, 0xECFE, 0x5FD0, 0xED40, 0x979E, 0xED41, 0x979F, + 0xED42, 0x97A1, 0xED43, 0x97A2, 0xED44, 0x97A4, 0xED45, 0x97A5, 0xED46, 0x97A6, 0xED47, 0x97A7, 0xED48, 0x97A8, 0xED49, 0x97A9, + 0xED4A, 0x97AA, 0xED4B, 0x97AC, 0xED4C, 0x97AE, 0xED4D, 0x97B0, 0xED4E, 0x97B1, 0xED4F, 0x97B3, 0xED50, 0x97B5, 0xED51, 0x97B6, + 0xED52, 0x97B7, 0xED53, 0x97B8, 0xED54, 0x97B9, 0xED55, 0x97BA, 0xED56, 0x97BB, 0xED57, 0x97BC, 0xED58, 0x97BD, 0xED59, 0x97BE, + 0xED5A, 0x97BF, 0xED5B, 0x97C0, 0xED5C, 0x97C1, 0xED5D, 0x97C2, 0xED5E, 0x97C3, 0xED5F, 0x97C4, 0xED60, 0x97C5, 0xED61, 0x97C6, + 0xED62, 0x97C7, 0xED63, 0x97C8, 0xED64, 0x97C9, 0xED65, 0x97CA, 0xED66, 0x97CB, 0xED67, 0x97CC, 0xED68, 0x97CD, 0xED69, 0x97CE, + 0xED6A, 0x97CF, 0xED6B, 0x97D0, 0xED6C, 0x97D1, 0xED6D, 0x97D2, 0xED6E, 0x97D3, 0xED6F, 0x97D4, 0xED70, 0x97D5, 0xED71, 0x97D6, + 0xED72, 0x97D7, 0xED73, 0x97D8, 0xED74, 0x97D9, 0xED75, 0x97DA, 0xED76, 0x97DB, 0xED77, 0x97DC, 0xED78, 0x97DD, 0xED79, 0x97DE, + 0xED7A, 0x97DF, 0xED7B, 0x97E0, 0xED7C, 0x97E1, 0xED7D, 0x97E2, 0xED7E, 0x97E3, 0xED80, 0x97E4, 0xED81, 0x97E5, 0xED82, 0x97E8, + 0xED83, 0x97EE, 0xED84, 0x97EF, 0xED85, 0x97F0, 0xED86, 0x97F1, 0xED87, 0x97F2, 0xED88, 0x97F4, 0xED89, 0x97F7, 0xED8A, 0x97F8, + 0xED8B, 0x97F9, 0xED8C, 0x97FA, 0xED8D, 0x97FB, 0xED8E, 0x97FC, 0xED8F, 0x97FD, 0xED90, 0x97FE, 0xED91, 0x97FF, 0xED92, 0x9800, + 0xED93, 0x9801, 0xED94, 0x9802, 0xED95, 0x9803, 0xED96, 0x9804, 0xED97, 0x9805, 0xED98, 0x9806, 0xED99, 0x9807, 0xED9A, 0x9808, + 0xED9B, 0x9809, 0xED9C, 0x980A, 0xED9D, 0x980B, 0xED9E, 0x980C, 0xED9F, 0x980D, 0xEDA0, 0x980E, 0xEDA1, 0x603C, 0xEDA2, 0x605D, + 0xEDA3, 0x605A, 0xEDA4, 0x6067, 0xEDA5, 0x6041, 0xEDA6, 0x6059, 0xEDA7, 0x6063, 0xEDA8, 0x60AB, 0xEDA9, 0x6106, 0xEDAA, 0x610D, + 0xEDAB, 0x615D, 0xEDAC, 0x61A9, 0xEDAD, 0x619D, 0xEDAE, 0x61CB, 0xEDAF, 0x61D1, 0xEDB0, 0x6206, 0xEDB1, 0x8080, 0xEDB2, 0x807F, + 0xEDB3, 0x6C93, 0xEDB4, 0x6CF6, 0xEDB5, 0x6DFC, 0xEDB6, 0x77F6, 0xEDB7, 0x77F8, 0xEDB8, 0x7800, 0xEDB9, 0x7809, 0xEDBA, 0x7817, + 0xEDBB, 0x7818, 0xEDBC, 0x7811, 0xEDBD, 0x65AB, 0xEDBE, 0x782D, 0xEDBF, 0x781C, 0xEDC0, 0x781D, 0xEDC1, 0x7839, 0xEDC2, 0x783A, + 0xEDC3, 0x783B, 0xEDC4, 0x781F, 0xEDC5, 0x783C, 0xEDC6, 0x7825, 0xEDC7, 0x782C, 0xEDC8, 0x7823, 0xEDC9, 0x7829, 0xEDCA, 0x784E, + 0xEDCB, 0x786D, 0xEDCC, 0x7856, 0xEDCD, 0x7857, 0xEDCE, 0x7826, 0xEDCF, 0x7850, 0xEDD0, 0x7847, 0xEDD1, 0x784C, 0xEDD2, 0x786A, + 0xEDD3, 0x789B, 0xEDD4, 0x7893, 0xEDD5, 0x789A, 0xEDD6, 0x7887, 0xEDD7, 0x789C, 0xEDD8, 0x78A1, 0xEDD9, 0x78A3, 0xEDDA, 0x78B2, + 0xEDDB, 0x78B9, 0xEDDC, 0x78A5, 0xEDDD, 0x78D4, 0xEDDE, 0x78D9, 0xEDDF, 0x78C9, 0xEDE0, 0x78EC, 0xEDE1, 0x78F2, 0xEDE2, 0x7905, + 0xEDE3, 0x78F4, 0xEDE4, 0x7913, 0xEDE5, 0x7924, 0xEDE6, 0x791E, 0xEDE7, 0x7934, 0xEDE8, 0x9F9B, 0xEDE9, 0x9EF9, 0xEDEA, 0x9EFB, + 0xEDEB, 0x9EFC, 0xEDEC, 0x76F1, 0xEDED, 0x7704, 0xEDEE, 0x770D, 0xEDEF, 0x76F9, 0xEDF0, 0x7707, 0xEDF1, 0x7708, 0xEDF2, 0x771A, + 0xEDF3, 0x7722, 0xEDF4, 0x7719, 0xEDF5, 0x772D, 0xEDF6, 0x7726, 0xEDF7, 0x7735, 0xEDF8, 0x7738, 0xEDF9, 0x7750, 0xEDFA, 0x7751, + 0xEDFB, 0x7747, 0xEDFC, 0x7743, 0xEDFD, 0x775A, 0xEDFE, 0x7768, 0xEE40, 0x980F, 0xEE41, 0x9810, 0xEE42, 0x9811, 0xEE43, 0x9812, + 0xEE44, 0x9813, 0xEE45, 0x9814, 0xEE46, 0x9815, 0xEE47, 0x9816, 0xEE48, 0x9817, 0xEE49, 0x9818, 0xEE4A, 0x9819, 0xEE4B, 0x981A, + 0xEE4C, 0x981B, 0xEE4D, 0x981C, 0xEE4E, 0x981D, 0xEE4F, 0x981E, 0xEE50, 0x981F, 0xEE51, 0x9820, 0xEE52, 0x9821, 0xEE53, 0x9822, + 0xEE54, 0x9823, 0xEE55, 0x9824, 0xEE56, 0x9825, 0xEE57, 0x9826, 0xEE58, 0x9827, 0xEE59, 0x9828, 0xEE5A, 0x9829, 0xEE5B, 0x982A, + 0xEE5C, 0x982B, 0xEE5D, 0x982C, 0xEE5E, 0x982D, 0xEE5F, 0x982E, 0xEE60, 0x982F, 0xEE61, 0x9830, 0xEE62, 0x9831, 0xEE63, 0x9832, + 0xEE64, 0x9833, 0xEE65, 0x9834, 0xEE66, 0x9835, 0xEE67, 0x9836, 0xEE68, 0x9837, 0xEE69, 0x9838, 0xEE6A, 0x9839, 0xEE6B, 0x983A, + 0xEE6C, 0x983B, 0xEE6D, 0x983C, 0xEE6E, 0x983D, 0xEE6F, 0x983E, 0xEE70, 0x983F, 0xEE71, 0x9840, 0xEE72, 0x9841, 0xEE73, 0x9842, + 0xEE74, 0x9843, 0xEE75, 0x9844, 0xEE76, 0x9845, 0xEE77, 0x9846, 0xEE78, 0x9847, 0xEE79, 0x9848, 0xEE7A, 0x9849, 0xEE7B, 0x984A, + 0xEE7C, 0x984B, 0xEE7D, 0x984C, 0xEE7E, 0x984D, 0xEE80, 0x984E, 0xEE81, 0x984F, 0xEE82, 0x9850, 0xEE83, 0x9851, 0xEE84, 0x9852, + 0xEE85, 0x9853, 0xEE86, 0x9854, 0xEE87, 0x9855, 0xEE88, 0x9856, 0xEE89, 0x9857, 0xEE8A, 0x9858, 0xEE8B, 0x9859, 0xEE8C, 0x985A, + 0xEE8D, 0x985B, 0xEE8E, 0x985C, 0xEE8F, 0x985D, 0xEE90, 0x985E, 0xEE91, 0x985F, 0xEE92, 0x9860, 0xEE93, 0x9861, 0xEE94, 0x9862, + 0xEE95, 0x9863, 0xEE96, 0x9864, 0xEE97, 0x9865, 0xEE98, 0x9866, 0xEE99, 0x9867, 0xEE9A, 0x9868, 0xEE9B, 0x9869, 0xEE9C, 0x986A, + 0xEE9D, 0x986B, 0xEE9E, 0x986C, 0xEE9F, 0x986D, 0xEEA0, 0x986E, 0xEEA1, 0x7762, 0xEEA2, 0x7765, 0xEEA3, 0x777F, 0xEEA4, 0x778D, + 0xEEA5, 0x777D, 0xEEA6, 0x7780, 0xEEA7, 0x778C, 0xEEA8, 0x7791, 0xEEA9, 0x779F, 0xEEAA, 0x77A0, 0xEEAB, 0x77B0, 0xEEAC, 0x77B5, + 0xEEAD, 0x77BD, 0xEEAE, 0x753A, 0xEEAF, 0x7540, 0xEEB0, 0x754E, 0xEEB1, 0x754B, 0xEEB2, 0x7548, 0xEEB3, 0x755B, 0xEEB4, 0x7572, + 0xEEB5, 0x7579, 0xEEB6, 0x7583, 0xEEB7, 0x7F58, 0xEEB8, 0x7F61, 0xEEB9, 0x7F5F, 0xEEBA, 0x8A48, 0xEEBB, 0x7F68, 0xEEBC, 0x7F74, + 0xEEBD, 0x7F71, 0xEEBE, 0x7F79, 0xEEBF, 0x7F81, 0xEEC0, 0x7F7E, 0xEEC1, 0x76CD, 0xEEC2, 0x76E5, 0xEEC3, 0x8832, 0xEEC4, 0x9485, + 0xEEC5, 0x9486, 0xEEC6, 0x9487, 0xEEC7, 0x948B, 0xEEC8, 0x948A, 0xEEC9, 0x948C, 0xEECA, 0x948D, 0xEECB, 0x948F, 0xEECC, 0x9490, + 0xEECD, 0x9494, 0xEECE, 0x9497, 0xEECF, 0x9495, 0xEED0, 0x949A, 0xEED1, 0x949B, 0xEED2, 0x949C, 0xEED3, 0x94A3, 0xEED4, 0x94A4, + 0xEED5, 0x94AB, 0xEED6, 0x94AA, 0xEED7, 0x94AD, 0xEED8, 0x94AC, 0xEED9, 0x94AF, 0xEEDA, 0x94B0, 0xEEDB, 0x94B2, 0xEEDC, 0x94B4, + 0xEEDD, 0x94B6, 0xEEDE, 0x94B7, 0xEEDF, 0x94B8, 0xEEE0, 0x94B9, 0xEEE1, 0x94BA, 0xEEE2, 0x94BC, 0xEEE3, 0x94BD, 0xEEE4, 0x94BF, + 0xEEE5, 0x94C4, 0xEEE6, 0x94C8, 0xEEE7, 0x94C9, 0xEEE8, 0x94CA, 0xEEE9, 0x94CB, 0xEEEA, 0x94CC, 0xEEEB, 0x94CD, 0xEEEC, 0x94CE, + 0xEEED, 0x94D0, 0xEEEE, 0x94D1, 0xEEEF, 0x94D2, 0xEEF0, 0x94D5, 0xEEF1, 0x94D6, 0xEEF2, 0x94D7, 0xEEF3, 0x94D9, 0xEEF4, 0x94D8, + 0xEEF5, 0x94DB, 0xEEF6, 0x94DE, 0xEEF7, 0x94DF, 0xEEF8, 0x94E0, 0xEEF9, 0x94E2, 0xEEFA, 0x94E4, 0xEEFB, 0x94E5, 0xEEFC, 0x94E7, + 0xEEFD, 0x94E8, 0xEEFE, 0x94EA, 0xEF40, 0x986F, 0xEF41, 0x9870, 0xEF42, 0x9871, 0xEF43, 0x9872, 0xEF44, 0x9873, 0xEF45, 0x9874, + 0xEF46, 0x988B, 0xEF47, 0x988E, 0xEF48, 0x9892, 0xEF49, 0x9895, 0xEF4A, 0x9899, 0xEF4B, 0x98A3, 0xEF4C, 0x98A8, 0xEF4D, 0x98A9, + 0xEF4E, 0x98AA, 0xEF4F, 0x98AB, 0xEF50, 0x98AC, 0xEF51, 0x98AD, 0xEF52, 0x98AE, 0xEF53, 0x98AF, 0xEF54, 0x98B0, 0xEF55, 0x98B1, + 0xEF56, 0x98B2, 0xEF57, 0x98B3, 0xEF58, 0x98B4, 0xEF59, 0x98B5, 0xEF5A, 0x98B6, 0xEF5B, 0x98B7, 0xEF5C, 0x98B8, 0xEF5D, 0x98B9, + 0xEF5E, 0x98BA, 0xEF5F, 0x98BB, 0xEF60, 0x98BC, 0xEF61, 0x98BD, 0xEF62, 0x98BE, 0xEF63, 0x98BF, 0xEF64, 0x98C0, 0xEF65, 0x98C1, + 0xEF66, 0x98C2, 0xEF67, 0x98C3, 0xEF68, 0x98C4, 0xEF69, 0x98C5, 0xEF6A, 0x98C6, 0xEF6B, 0x98C7, 0xEF6C, 0x98C8, 0xEF6D, 0x98C9, + 0xEF6E, 0x98CA, 0xEF6F, 0x98CB, 0xEF70, 0x98CC, 0xEF71, 0x98CD, 0xEF72, 0x98CF, 0xEF73, 0x98D0, 0xEF74, 0x98D4, 0xEF75, 0x98D6, + 0xEF76, 0x98D7, 0xEF77, 0x98DB, 0xEF78, 0x98DC, 0xEF79, 0x98DD, 0xEF7A, 0x98E0, 0xEF7B, 0x98E1, 0xEF7C, 0x98E2, 0xEF7D, 0x98E3, + 0xEF7E, 0x98E4, 0xEF80, 0x98E5, 0xEF81, 0x98E6, 0xEF82, 0x98E9, 0xEF83, 0x98EA, 0xEF84, 0x98EB, 0xEF85, 0x98EC, 0xEF86, 0x98ED, + 0xEF87, 0x98EE, 0xEF88, 0x98EF, 0xEF89, 0x98F0, 0xEF8A, 0x98F1, 0xEF8B, 0x98F2, 0xEF8C, 0x98F3, 0xEF8D, 0x98F4, 0xEF8E, 0x98F5, + 0xEF8F, 0x98F6, 0xEF90, 0x98F7, 0xEF91, 0x98F8, 0xEF92, 0x98F9, 0xEF93, 0x98FA, 0xEF94, 0x98FB, 0xEF95, 0x98FC, 0xEF96, 0x98FD, + 0xEF97, 0x98FE, 0xEF98, 0x98FF, 0xEF99, 0x9900, 0xEF9A, 0x9901, 0xEF9B, 0x9902, 0xEF9C, 0x9903, 0xEF9D, 0x9904, 0xEF9E, 0x9905, + 0xEF9F, 0x9906, 0xEFA0, 0x9907, 0xEFA1, 0x94E9, 0xEFA2, 0x94EB, 0xEFA3, 0x94EE, 0xEFA4, 0x94EF, 0xEFA5, 0x94F3, 0xEFA6, 0x94F4, + 0xEFA7, 0x94F5, 0xEFA8, 0x94F7, 0xEFA9, 0x94F9, 0xEFAA, 0x94FC, 0xEFAB, 0x94FD, 0xEFAC, 0x94FF, 0xEFAD, 0x9503, 0xEFAE, 0x9502, + 0xEFAF, 0x9506, 0xEFB0, 0x9507, 0xEFB1, 0x9509, 0xEFB2, 0x950A, 0xEFB3, 0x950D, 0xEFB4, 0x950E, 0xEFB5, 0x950F, 0xEFB6, 0x9512, + 0xEFB7, 0x9513, 0xEFB8, 0x9514, 0xEFB9, 0x9515, 0xEFBA, 0x9516, 0xEFBB, 0x9518, 0xEFBC, 0x951B, 0xEFBD, 0x951D, 0xEFBE, 0x951E, + 0xEFBF, 0x951F, 0xEFC0, 0x9522, 0xEFC1, 0x952A, 0xEFC2, 0x952B, 0xEFC3, 0x9529, 0xEFC4, 0x952C, 0xEFC5, 0x9531, 0xEFC6, 0x9532, + 0xEFC7, 0x9534, 0xEFC8, 0x9536, 0xEFC9, 0x9537, 0xEFCA, 0x9538, 0xEFCB, 0x953C, 0xEFCC, 0x953E, 0xEFCD, 0x953F, 0xEFCE, 0x9542, + 0xEFCF, 0x9535, 0xEFD0, 0x9544, 0xEFD1, 0x9545, 0xEFD2, 0x9546, 0xEFD3, 0x9549, 0xEFD4, 0x954C, 0xEFD5, 0x954E, 0xEFD6, 0x954F, + 0xEFD7, 0x9552, 0xEFD8, 0x9553, 0xEFD9, 0x9554, 0xEFDA, 0x9556, 0xEFDB, 0x9557, 0xEFDC, 0x9558, 0xEFDD, 0x9559, 0xEFDE, 0x955B, + 0xEFDF, 0x955E, 0xEFE0, 0x955F, 0xEFE1, 0x955D, 0xEFE2, 0x9561, 0xEFE3, 0x9562, 0xEFE4, 0x9564, 0xEFE5, 0x9565, 0xEFE6, 0x9566, + 0xEFE7, 0x9567, 0xEFE8, 0x9568, 0xEFE9, 0x9569, 0xEFEA, 0x956A, 0xEFEB, 0x956B, 0xEFEC, 0x956C, 0xEFED, 0x956F, 0xEFEE, 0x9571, + 0xEFEF, 0x9572, 0xEFF0, 0x9573, 0xEFF1, 0x953A, 0xEFF2, 0x77E7, 0xEFF3, 0x77EC, 0xEFF4, 0x96C9, 0xEFF5, 0x79D5, 0xEFF6, 0x79ED, + 0xEFF7, 0x79E3, 0xEFF8, 0x79EB, 0xEFF9, 0x7A06, 0xEFFA, 0x5D47, 0xEFFB, 0x7A03, 0xEFFC, 0x7A02, 0xEFFD, 0x7A1E, 0xEFFE, 0x7A14, + 0xF040, 0x9908, 0xF041, 0x9909, 0xF042, 0x990A, 0xF043, 0x990B, 0xF044, 0x990C, 0xF045, 0x990E, 0xF046, 0x990F, 0xF047, 0x9911, + 0xF048, 0x9912, 0xF049, 0x9913, 0xF04A, 0x9914, 0xF04B, 0x9915, 0xF04C, 0x9916, 0xF04D, 0x9917, 0xF04E, 0x9918, 0xF04F, 0x9919, + 0xF050, 0x991A, 0xF051, 0x991B, 0xF052, 0x991C, 0xF053, 0x991D, 0xF054, 0x991E, 0xF055, 0x991F, 0xF056, 0x9920, 0xF057, 0x9921, + 0xF058, 0x9922, 0xF059, 0x9923, 0xF05A, 0x9924, 0xF05B, 0x9925, 0xF05C, 0x9926, 0xF05D, 0x9927, 0xF05E, 0x9928, 0xF05F, 0x9929, + 0xF060, 0x992A, 0xF061, 0x992B, 0xF062, 0x992C, 0xF063, 0x992D, 0xF064, 0x992F, 0xF065, 0x9930, 0xF066, 0x9931, 0xF067, 0x9932, + 0xF068, 0x9933, 0xF069, 0x9934, 0xF06A, 0x9935, 0xF06B, 0x9936, 0xF06C, 0x9937, 0xF06D, 0x9938, 0xF06E, 0x9939, 0xF06F, 0x993A, + 0xF070, 0x993B, 0xF071, 0x993C, 0xF072, 0x993D, 0xF073, 0x993E, 0xF074, 0x993F, 0xF075, 0x9940, 0xF076, 0x9941, 0xF077, 0x9942, + 0xF078, 0x9943, 0xF079, 0x9944, 0xF07A, 0x9945, 0xF07B, 0x9946, 0xF07C, 0x9947, 0xF07D, 0x9948, 0xF07E, 0x9949, 0xF080, 0x994A, + 0xF081, 0x994B, 0xF082, 0x994C, 0xF083, 0x994D, 0xF084, 0x994E, 0xF085, 0x994F, 0xF086, 0x9950, 0xF087, 0x9951, 0xF088, 0x9952, + 0xF089, 0x9953, 0xF08A, 0x9956, 0xF08B, 0x9957, 0xF08C, 0x9958, 0xF08D, 0x9959, 0xF08E, 0x995A, 0xF08F, 0x995B, 0xF090, 0x995C, + 0xF091, 0x995D, 0xF092, 0x995E, 0xF093, 0x995F, 0xF094, 0x9960, 0xF095, 0x9961, 0xF096, 0x9962, 0xF097, 0x9964, 0xF098, 0x9966, + 0xF099, 0x9973, 0xF09A, 0x9978, 0xF09B, 0x9979, 0xF09C, 0x997B, 0xF09D, 0x997E, 0xF09E, 0x9982, 0xF09F, 0x9983, 0xF0A0, 0x9989, + 0xF0A1, 0x7A39, 0xF0A2, 0x7A37, 0xF0A3, 0x7A51, 0xF0A4, 0x9ECF, 0xF0A5, 0x99A5, 0xF0A6, 0x7A70, 0xF0A7, 0x7688, 0xF0A8, 0x768E, + 0xF0A9, 0x7693, 0xF0AA, 0x7699, 0xF0AB, 0x76A4, 0xF0AC, 0x74DE, 0xF0AD, 0x74E0, 0xF0AE, 0x752C, 0xF0AF, 0x9E20, 0xF0B0, 0x9E22, + 0xF0B1, 0x9E28, 0xF0B2, 0x9E29, 0xF0B3, 0x9E2A, 0xF0B4, 0x9E2B, 0xF0B5, 0x9E2C, 0xF0B6, 0x9E32, 0xF0B7, 0x9E31, 0xF0B8, 0x9E36, + 0xF0B9, 0x9E38, 0xF0BA, 0x9E37, 0xF0BB, 0x9E39, 0xF0BC, 0x9E3A, 0xF0BD, 0x9E3E, 0xF0BE, 0x9E41, 0xF0BF, 0x9E42, 0xF0C0, 0x9E44, + 0xF0C1, 0x9E46, 0xF0C2, 0x9E47, 0xF0C3, 0x9E48, 0xF0C4, 0x9E49, 0xF0C5, 0x9E4B, 0xF0C6, 0x9E4C, 0xF0C7, 0x9E4E, 0xF0C8, 0x9E51, + 0xF0C9, 0x9E55, 0xF0CA, 0x9E57, 0xF0CB, 0x9E5A, 0xF0CC, 0x9E5B, 0xF0CD, 0x9E5C, 0xF0CE, 0x9E5E, 0xF0CF, 0x9E63, 0xF0D0, 0x9E66, + 0xF0D1, 0x9E67, 0xF0D2, 0x9E68, 0xF0D3, 0x9E69, 0xF0D4, 0x9E6A, 0xF0D5, 0x9E6B, 0xF0D6, 0x9E6C, 0xF0D7, 0x9E71, 0xF0D8, 0x9E6D, + 0xF0D9, 0x9E73, 0xF0DA, 0x7592, 0xF0DB, 0x7594, 0xF0DC, 0x7596, 0xF0DD, 0x75A0, 0xF0DE, 0x759D, 0xF0DF, 0x75AC, 0xF0E0, 0x75A3, + 0xF0E1, 0x75B3, 0xF0E2, 0x75B4, 0xF0E3, 0x75B8, 0xF0E4, 0x75C4, 0xF0E5, 0x75B1, 0xF0E6, 0x75B0, 0xF0E7, 0x75C3, 0xF0E8, 0x75C2, + 0xF0E9, 0x75D6, 0xF0EA, 0x75CD, 0xF0EB, 0x75E3, 0xF0EC, 0x75E8, 0xF0ED, 0x75E6, 0xF0EE, 0x75E4, 0xF0EF, 0x75EB, 0xF0F0, 0x75E7, + 0xF0F1, 0x7603, 0xF0F2, 0x75F1, 0xF0F3, 0x75FC, 0xF0F4, 0x75FF, 0xF0F5, 0x7610, 0xF0F6, 0x7600, 0xF0F7, 0x7605, 0xF0F8, 0x760C, + 0xF0F9, 0x7617, 0xF0FA, 0x760A, 0xF0FB, 0x7625, 0xF0FC, 0x7618, 0xF0FD, 0x7615, 0xF0FE, 0x7619, 0xF140, 0x998C, 0xF141, 0x998E, + 0xF142, 0x999A, 0xF143, 0x999B, 0xF144, 0x999C, 0xF145, 0x999D, 0xF146, 0x999E, 0xF147, 0x999F, 0xF148, 0x99A0, 0xF149, 0x99A1, + 0xF14A, 0x99A2, 0xF14B, 0x99A3, 0xF14C, 0x99A4, 0xF14D, 0x99A6, 0xF14E, 0x99A7, 0xF14F, 0x99A9, 0xF150, 0x99AA, 0xF151, 0x99AB, + 0xF152, 0x99AC, 0xF153, 0x99AD, 0xF154, 0x99AE, 0xF155, 0x99AF, 0xF156, 0x99B0, 0xF157, 0x99B1, 0xF158, 0x99B2, 0xF159, 0x99B3, + 0xF15A, 0x99B4, 0xF15B, 0x99B5, 0xF15C, 0x99B6, 0xF15D, 0x99B7, 0xF15E, 0x99B8, 0xF15F, 0x99B9, 0xF160, 0x99BA, 0xF161, 0x99BB, + 0xF162, 0x99BC, 0xF163, 0x99BD, 0xF164, 0x99BE, 0xF165, 0x99BF, 0xF166, 0x99C0, 0xF167, 0x99C1, 0xF168, 0x99C2, 0xF169, 0x99C3, + 0xF16A, 0x99C4, 0xF16B, 0x99C5, 0xF16C, 0x99C6, 0xF16D, 0x99C7, 0xF16E, 0x99C8, 0xF16F, 0x99C9, 0xF170, 0x99CA, 0xF171, 0x99CB, + 0xF172, 0x99CC, 0xF173, 0x99CD, 0xF174, 0x99CE, 0xF175, 0x99CF, 0xF176, 0x99D0, 0xF177, 0x99D1, 0xF178, 0x99D2, 0xF179, 0x99D3, + 0xF17A, 0x99D4, 0xF17B, 0x99D5, 0xF17C, 0x99D6, 0xF17D, 0x99D7, 0xF17E, 0x99D8, 0xF180, 0x99D9, 0xF181, 0x99DA, 0xF182, 0x99DB, + 0xF183, 0x99DC, 0xF184, 0x99DD, 0xF185, 0x99DE, 0xF186, 0x99DF, 0xF187, 0x99E0, 0xF188, 0x99E1, 0xF189, 0x99E2, 0xF18A, 0x99E3, + 0xF18B, 0x99E4, 0xF18C, 0x99E5, 0xF18D, 0x99E6, 0xF18E, 0x99E7, 0xF18F, 0x99E8, 0xF190, 0x99E9, 0xF191, 0x99EA, 0xF192, 0x99EB, + 0xF193, 0x99EC, 0xF194, 0x99ED, 0xF195, 0x99EE, 0xF196, 0x99EF, 0xF197, 0x99F0, 0xF198, 0x99F1, 0xF199, 0x99F2, 0xF19A, 0x99F3, + 0xF19B, 0x99F4, 0xF19C, 0x99F5, 0xF19D, 0x99F6, 0xF19E, 0x99F7, 0xF19F, 0x99F8, 0xF1A0, 0x99F9, 0xF1A1, 0x761B, 0xF1A2, 0x763C, + 0xF1A3, 0x7622, 0xF1A4, 0x7620, 0xF1A5, 0x7640, 0xF1A6, 0x762D, 0xF1A7, 0x7630, 0xF1A8, 0x763F, 0xF1A9, 0x7635, 0xF1AA, 0x7643, + 0xF1AB, 0x763E, 0xF1AC, 0x7633, 0xF1AD, 0x764D, 0xF1AE, 0x765E, 0xF1AF, 0x7654, 0xF1B0, 0x765C, 0xF1B1, 0x7656, 0xF1B2, 0x766B, + 0xF1B3, 0x766F, 0xF1B4, 0x7FCA, 0xF1B5, 0x7AE6, 0xF1B6, 0x7A78, 0xF1B7, 0x7A79, 0xF1B8, 0x7A80, 0xF1B9, 0x7A86, 0xF1BA, 0x7A88, + 0xF1BB, 0x7A95, 0xF1BC, 0x7AA6, 0xF1BD, 0x7AA0, 0xF1BE, 0x7AAC, 0xF1BF, 0x7AA8, 0xF1C0, 0x7AAD, 0xF1C1, 0x7AB3, 0xF1C2, 0x8864, + 0xF1C3, 0x8869, 0xF1C4, 0x8872, 0xF1C5, 0x887D, 0xF1C6, 0x887F, 0xF1C7, 0x8882, 0xF1C8, 0x88A2, 0xF1C9, 0x88C6, 0xF1CA, 0x88B7, + 0xF1CB, 0x88BC, 0xF1CC, 0x88C9, 0xF1CD, 0x88E2, 0xF1CE, 0x88CE, 0xF1CF, 0x88E3, 0xF1D0, 0x88E5, 0xF1D1, 0x88F1, 0xF1D2, 0x891A, + 0xF1D3, 0x88FC, 0xF1D4, 0x88E8, 0xF1D5, 0x88FE, 0xF1D6, 0x88F0, 0xF1D7, 0x8921, 0xF1D8, 0x8919, 0xF1D9, 0x8913, 0xF1DA, 0x891B, + 0xF1DB, 0x890A, 0xF1DC, 0x8934, 0xF1DD, 0x892B, 0xF1DE, 0x8936, 0xF1DF, 0x8941, 0xF1E0, 0x8966, 0xF1E1, 0x897B, 0xF1E2, 0x758B, + 0xF1E3, 0x80E5, 0xF1E4, 0x76B2, 0xF1E5, 0x76B4, 0xF1E6, 0x77DC, 0xF1E7, 0x8012, 0xF1E8, 0x8014, 0xF1E9, 0x8016, 0xF1EA, 0x801C, + 0xF1EB, 0x8020, 0xF1EC, 0x8022, 0xF1ED, 0x8025, 0xF1EE, 0x8026, 0xF1EF, 0x8027, 0xF1F0, 0x8029, 0xF1F1, 0x8028, 0xF1F2, 0x8031, + 0xF1F3, 0x800B, 0xF1F4, 0x8035, 0xF1F5, 0x8043, 0xF1F6, 0x8046, 0xF1F7, 0x804D, 0xF1F8, 0x8052, 0xF1F9, 0x8069, 0xF1FA, 0x8071, + 0xF1FB, 0x8983, 0xF1FC, 0x9878, 0xF1FD, 0x9880, 0xF1FE, 0x9883, 0xF240, 0x99FA, 0xF241, 0x99FB, 0xF242, 0x99FC, 0xF243, 0x99FD, + 0xF244, 0x99FE, 0xF245, 0x99FF, 0xF246, 0x9A00, 0xF247, 0x9A01, 0xF248, 0x9A02, 0xF249, 0x9A03, 0xF24A, 0x9A04, 0xF24B, 0x9A05, + 0xF24C, 0x9A06, 0xF24D, 0x9A07, 0xF24E, 0x9A08, 0xF24F, 0x9A09, 0xF250, 0x9A0A, 0xF251, 0x9A0B, 0xF252, 0x9A0C, 0xF253, 0x9A0D, + 0xF254, 0x9A0E, 0xF255, 0x9A0F, 0xF256, 0x9A10, 0xF257, 0x9A11, 0xF258, 0x9A12, 0xF259, 0x9A13, 0xF25A, 0x9A14, 0xF25B, 0x9A15, + 0xF25C, 0x9A16, 0xF25D, 0x9A17, 0xF25E, 0x9A18, 0xF25F, 0x9A19, 0xF260, 0x9A1A, 0xF261, 0x9A1B, 0xF262, 0x9A1C, 0xF263, 0x9A1D, + 0xF264, 0x9A1E, 0xF265, 0x9A1F, 0xF266, 0x9A20, 0xF267, 0x9A21, 0xF268, 0x9A22, 0xF269, 0x9A23, 0xF26A, 0x9A24, 0xF26B, 0x9A25, + 0xF26C, 0x9A26, 0xF26D, 0x9A27, 0xF26E, 0x9A28, 0xF26F, 0x9A29, 0xF270, 0x9A2A, 0xF271, 0x9A2B, 0xF272, 0x9A2C, 0xF273, 0x9A2D, + 0xF274, 0x9A2E, 0xF275, 0x9A2F, 0xF276, 0x9A30, 0xF277, 0x9A31, 0xF278, 0x9A32, 0xF279, 0x9A33, 0xF27A, 0x9A34, 0xF27B, 0x9A35, + 0xF27C, 0x9A36, 0xF27D, 0x9A37, 0xF27E, 0x9A38, 0xF280, 0x9A39, 0xF281, 0x9A3A, 0xF282, 0x9A3B, 0xF283, 0x9A3C, 0xF284, 0x9A3D, + 0xF285, 0x9A3E, 0xF286, 0x9A3F, 0xF287, 0x9A40, 0xF288, 0x9A41, 0xF289, 0x9A42, 0xF28A, 0x9A43, 0xF28B, 0x9A44, 0xF28C, 0x9A45, + 0xF28D, 0x9A46, 0xF28E, 0x9A47, 0xF28F, 0x9A48, 0xF290, 0x9A49, 0xF291, 0x9A4A, 0xF292, 0x9A4B, 0xF293, 0x9A4C, 0xF294, 0x9A4D, + 0xF295, 0x9A4E, 0xF296, 0x9A4F, 0xF297, 0x9A50, 0xF298, 0x9A51, 0xF299, 0x9A52, 0xF29A, 0x9A53, 0xF29B, 0x9A54, 0xF29C, 0x9A55, + 0xF29D, 0x9A56, 0xF29E, 0x9A57, 0xF29F, 0x9A58, 0xF2A0, 0x9A59, 0xF2A1, 0x9889, 0xF2A2, 0x988C, 0xF2A3, 0x988D, 0xF2A4, 0x988F, + 0xF2A5, 0x9894, 0xF2A6, 0x989A, 0xF2A7, 0x989B, 0xF2A8, 0x989E, 0xF2A9, 0x989F, 0xF2AA, 0x98A1, 0xF2AB, 0x98A2, 0xF2AC, 0x98A5, + 0xF2AD, 0x98A6, 0xF2AE, 0x864D, 0xF2AF, 0x8654, 0xF2B0, 0x866C, 0xF2B1, 0x866E, 0xF2B2, 0x867F, 0xF2B3, 0x867A, 0xF2B4, 0x867C, + 0xF2B5, 0x867B, 0xF2B6, 0x86A8, 0xF2B7, 0x868D, 0xF2B8, 0x868B, 0xF2B9, 0x86AC, 0xF2BA, 0x869D, 0xF2BB, 0x86A7, 0xF2BC, 0x86A3, + 0xF2BD, 0x86AA, 0xF2BE, 0x8693, 0xF2BF, 0x86A9, 0xF2C0, 0x86B6, 0xF2C1, 0x86C4, 0xF2C2, 0x86B5, 0xF2C3, 0x86CE, 0xF2C4, 0x86B0, + 0xF2C5, 0x86BA, 0xF2C6, 0x86B1, 0xF2C7, 0x86AF, 0xF2C8, 0x86C9, 0xF2C9, 0x86CF, 0xF2CA, 0x86B4, 0xF2CB, 0x86E9, 0xF2CC, 0x86F1, + 0xF2CD, 0x86F2, 0xF2CE, 0x86ED, 0xF2CF, 0x86F3, 0xF2D0, 0x86D0, 0xF2D1, 0x8713, 0xF2D2, 0x86DE, 0xF2D3, 0x86F4, 0xF2D4, 0x86DF, + 0xF2D5, 0x86D8, 0xF2D6, 0x86D1, 0xF2D7, 0x8703, 0xF2D8, 0x8707, 0xF2D9, 0x86F8, 0xF2DA, 0x8708, 0xF2DB, 0x870A, 0xF2DC, 0x870D, + 0xF2DD, 0x8709, 0xF2DE, 0x8723, 0xF2DF, 0x873B, 0xF2E0, 0x871E, 0xF2E1, 0x8725, 0xF2E2, 0x872E, 0xF2E3, 0x871A, 0xF2E4, 0x873E, + 0xF2E5, 0x8748, 0xF2E6, 0x8734, 0xF2E7, 0x8731, 0xF2E8, 0x8729, 0xF2E9, 0x8737, 0xF2EA, 0x873F, 0xF2EB, 0x8782, 0xF2EC, 0x8722, + 0xF2ED, 0x877D, 0xF2EE, 0x877E, 0xF2EF, 0x877B, 0xF2F0, 0x8760, 0xF2F1, 0x8770, 0xF2F2, 0x874C, 0xF2F3, 0x876E, 0xF2F4, 0x878B, + 0xF2F5, 0x8753, 0xF2F6, 0x8763, 0xF2F7, 0x877C, 0xF2F8, 0x8764, 0xF2F9, 0x8759, 0xF2FA, 0x8765, 0xF2FB, 0x8793, 0xF2FC, 0x87AF, + 0xF2FD, 0x87A8, 0xF2FE, 0x87D2, 0xF340, 0x9A5A, 0xF341, 0x9A5B, 0xF342, 0x9A5C, 0xF343, 0x9A5D, 0xF344, 0x9A5E, 0xF345, 0x9A5F, + 0xF346, 0x9A60, 0xF347, 0x9A61, 0xF348, 0x9A62, 0xF349, 0x9A63, 0xF34A, 0x9A64, 0xF34B, 0x9A65, 0xF34C, 0x9A66, 0xF34D, 0x9A67, + 0xF34E, 0x9A68, 0xF34F, 0x9A69, 0xF350, 0x9A6A, 0xF351, 0x9A6B, 0xF352, 0x9A72, 0xF353, 0x9A83, 0xF354, 0x9A89, 0xF355, 0x9A8D, + 0xF356, 0x9A8E, 0xF357, 0x9A94, 0xF358, 0x9A95, 0xF359, 0x9A99, 0xF35A, 0x9AA6, 0xF35B, 0x9AA9, 0xF35C, 0x9AAA, 0xF35D, 0x9AAB, + 0xF35E, 0x9AAC, 0xF35F, 0x9AAD, 0xF360, 0x9AAE, 0xF361, 0x9AAF, 0xF362, 0x9AB2, 0xF363, 0x9AB3, 0xF364, 0x9AB4, 0xF365, 0x9AB5, + 0xF366, 0x9AB9, 0xF367, 0x9ABB, 0xF368, 0x9ABD, 0xF369, 0x9ABE, 0xF36A, 0x9ABF, 0xF36B, 0x9AC3, 0xF36C, 0x9AC4, 0xF36D, 0x9AC6, + 0xF36E, 0x9AC7, 0xF36F, 0x9AC8, 0xF370, 0x9AC9, 0xF371, 0x9ACA, 0xF372, 0x9ACD, 0xF373, 0x9ACE, 0xF374, 0x9ACF, 0xF375, 0x9AD0, + 0xF376, 0x9AD2, 0xF377, 0x9AD4, 0xF378, 0x9AD5, 0xF379, 0x9AD6, 0xF37A, 0x9AD7, 0xF37B, 0x9AD9, 0xF37C, 0x9ADA, 0xF37D, 0x9ADB, + 0xF37E, 0x9ADC, 0xF380, 0x9ADD, 0xF381, 0x9ADE, 0xF382, 0x9AE0, 0xF383, 0x9AE2, 0xF384, 0x9AE3, 0xF385, 0x9AE4, 0xF386, 0x9AE5, + 0xF387, 0x9AE7, 0xF388, 0x9AE8, 0xF389, 0x9AE9, 0xF38A, 0x9AEA, 0xF38B, 0x9AEC, 0xF38C, 0x9AEE, 0xF38D, 0x9AF0, 0xF38E, 0x9AF1, + 0xF38F, 0x9AF2, 0xF390, 0x9AF3, 0xF391, 0x9AF4, 0xF392, 0x9AF5, 0xF393, 0x9AF6, 0xF394, 0x9AF7, 0xF395, 0x9AF8, 0xF396, 0x9AFA, + 0xF397, 0x9AFC, 0xF398, 0x9AFD, 0xF399, 0x9AFE, 0xF39A, 0x9AFF, 0xF39B, 0x9B00, 0xF39C, 0x9B01, 0xF39D, 0x9B02, 0xF39E, 0x9B04, + 0xF39F, 0x9B05, 0xF3A0, 0x9B06, 0xF3A1, 0x87C6, 0xF3A2, 0x8788, 0xF3A3, 0x8785, 0xF3A4, 0x87AD, 0xF3A5, 0x8797, 0xF3A6, 0x8783, + 0xF3A7, 0x87AB, 0xF3A8, 0x87E5, 0xF3A9, 0x87AC, 0xF3AA, 0x87B5, 0xF3AB, 0x87B3, 0xF3AC, 0x87CB, 0xF3AD, 0x87D3, 0xF3AE, 0x87BD, + 0xF3AF, 0x87D1, 0xF3B0, 0x87C0, 0xF3B1, 0x87CA, 0xF3B2, 0x87DB, 0xF3B3, 0x87EA, 0xF3B4, 0x87E0, 0xF3B5, 0x87EE, 0xF3B6, 0x8816, + 0xF3B7, 0x8813, 0xF3B8, 0x87FE, 0xF3B9, 0x880A, 0xF3BA, 0x881B, 0xF3BB, 0x8821, 0xF3BC, 0x8839, 0xF3BD, 0x883C, 0xF3BE, 0x7F36, + 0xF3BF, 0x7F42, 0xF3C0, 0x7F44, 0xF3C1, 0x7F45, 0xF3C2, 0x8210, 0xF3C3, 0x7AFA, 0xF3C4, 0x7AFD, 0xF3C5, 0x7B08, 0xF3C6, 0x7B03, + 0xF3C7, 0x7B04, 0xF3C8, 0x7B15, 0xF3C9, 0x7B0A, 0xF3CA, 0x7B2B, 0xF3CB, 0x7B0F, 0xF3CC, 0x7B47, 0xF3CD, 0x7B38, 0xF3CE, 0x7B2A, + 0xF3CF, 0x7B19, 0xF3D0, 0x7B2E, 0xF3D1, 0x7B31, 0xF3D2, 0x7B20, 0xF3D3, 0x7B25, 0xF3D4, 0x7B24, 0xF3D5, 0x7B33, 0xF3D6, 0x7B3E, + 0xF3D7, 0x7B1E, 0xF3D8, 0x7B58, 0xF3D9, 0x7B5A, 0xF3DA, 0x7B45, 0xF3DB, 0x7B75, 0xF3DC, 0x7B4C, 0xF3DD, 0x7B5D, 0xF3DE, 0x7B60, + 0xF3DF, 0x7B6E, 0xF3E0, 0x7B7B, 0xF3E1, 0x7B62, 0xF3E2, 0x7B72, 0xF3E3, 0x7B71, 0xF3E4, 0x7B90, 0xF3E5, 0x7BA6, 0xF3E6, 0x7BA7, + 0xF3E7, 0x7BB8, 0xF3E8, 0x7BAC, 0xF3E9, 0x7B9D, 0xF3EA, 0x7BA8, 0xF3EB, 0x7B85, 0xF3EC, 0x7BAA, 0xF3ED, 0x7B9C, 0xF3EE, 0x7BA2, + 0xF3EF, 0x7BAB, 0xF3F0, 0x7BB4, 0xF3F1, 0x7BD1, 0xF3F2, 0x7BC1, 0xF3F3, 0x7BCC, 0xF3F4, 0x7BDD, 0xF3F5, 0x7BDA, 0xF3F6, 0x7BE5, + 0xF3F7, 0x7BE6, 0xF3F8, 0x7BEA, 0xF3F9, 0x7C0C, 0xF3FA, 0x7BFE, 0xF3FB, 0x7BFC, 0xF3FC, 0x7C0F, 0xF3FD, 0x7C16, 0xF3FE, 0x7C0B, + 0xF440, 0x9B07, 0xF441, 0x9B09, 0xF442, 0x9B0A, 0xF443, 0x9B0B, 0xF444, 0x9B0C, 0xF445, 0x9B0D, 0xF446, 0x9B0E, 0xF447, 0x9B10, + 0xF448, 0x9B11, 0xF449, 0x9B12, 0xF44A, 0x9B14, 0xF44B, 0x9B15, 0xF44C, 0x9B16, 0xF44D, 0x9B17, 0xF44E, 0x9B18, 0xF44F, 0x9B19, + 0xF450, 0x9B1A, 0xF451, 0x9B1B, 0xF452, 0x9B1C, 0xF453, 0x9B1D, 0xF454, 0x9B1E, 0xF455, 0x9B20, 0xF456, 0x9B21, 0xF457, 0x9B22, + 0xF458, 0x9B24, 0xF459, 0x9B25, 0xF45A, 0x9B26, 0xF45B, 0x9B27, 0xF45C, 0x9B28, 0xF45D, 0x9B29, 0xF45E, 0x9B2A, 0xF45F, 0x9B2B, + 0xF460, 0x9B2C, 0xF461, 0x9B2D, 0xF462, 0x9B2E, 0xF463, 0x9B30, 0xF464, 0x9B31, 0xF465, 0x9B33, 0xF466, 0x9B34, 0xF467, 0x9B35, + 0xF468, 0x9B36, 0xF469, 0x9B37, 0xF46A, 0x9B38, 0xF46B, 0x9B39, 0xF46C, 0x9B3A, 0xF46D, 0x9B3D, 0xF46E, 0x9B3E, 0xF46F, 0x9B3F, + 0xF470, 0x9B40, 0xF471, 0x9B46, 0xF472, 0x9B4A, 0xF473, 0x9B4B, 0xF474, 0x9B4C, 0xF475, 0x9B4E, 0xF476, 0x9B50, 0xF477, 0x9B52, + 0xF478, 0x9B53, 0xF479, 0x9B55, 0xF47A, 0x9B56, 0xF47B, 0x9B57, 0xF47C, 0x9B58, 0xF47D, 0x9B59, 0xF47E, 0x9B5A, 0xF480, 0x9B5B, + 0xF481, 0x9B5C, 0xF482, 0x9B5D, 0xF483, 0x9B5E, 0xF484, 0x9B5F, 0xF485, 0x9B60, 0xF486, 0x9B61, 0xF487, 0x9B62, 0xF488, 0x9B63, + 0xF489, 0x9B64, 0xF48A, 0x9B65, 0xF48B, 0x9B66, 0xF48C, 0x9B67, 0xF48D, 0x9B68, 0xF48E, 0x9B69, 0xF48F, 0x9B6A, 0xF490, 0x9B6B, + 0xF491, 0x9B6C, 0xF492, 0x9B6D, 0xF493, 0x9B6E, 0xF494, 0x9B6F, 0xF495, 0x9B70, 0xF496, 0x9B71, 0xF497, 0x9B72, 0xF498, 0x9B73, + 0xF499, 0x9B74, 0xF49A, 0x9B75, 0xF49B, 0x9B76, 0xF49C, 0x9B77, 0xF49D, 0x9B78, 0xF49E, 0x9B79, 0xF49F, 0x9B7A, 0xF4A0, 0x9B7B, + 0xF4A1, 0x7C1F, 0xF4A2, 0x7C2A, 0xF4A3, 0x7C26, 0xF4A4, 0x7C38, 0xF4A5, 0x7C41, 0xF4A6, 0x7C40, 0xF4A7, 0x81FE, 0xF4A8, 0x8201, + 0xF4A9, 0x8202, 0xF4AA, 0x8204, 0xF4AB, 0x81EC, 0xF4AC, 0x8844, 0xF4AD, 0x8221, 0xF4AE, 0x8222, 0xF4AF, 0x8223, 0xF4B0, 0x822D, + 0xF4B1, 0x822F, 0xF4B2, 0x8228, 0xF4B3, 0x822B, 0xF4B4, 0x8238, 0xF4B5, 0x823B, 0xF4B6, 0x8233, 0xF4B7, 0x8234, 0xF4B8, 0x823E, + 0xF4B9, 0x8244, 0xF4BA, 0x8249, 0xF4BB, 0x824B, 0xF4BC, 0x824F, 0xF4BD, 0x825A, 0xF4BE, 0x825F, 0xF4BF, 0x8268, 0xF4C0, 0x887E, + 0xF4C1, 0x8885, 0xF4C2, 0x8888, 0xF4C3, 0x88D8, 0xF4C4, 0x88DF, 0xF4C5, 0x895E, 0xF4C6, 0x7F9D, 0xF4C7, 0x7F9F, 0xF4C8, 0x7FA7, + 0xF4C9, 0x7FAF, 0xF4CA, 0x7FB0, 0xF4CB, 0x7FB2, 0xF4CC, 0x7C7C, 0xF4CD, 0x6549, 0xF4CE, 0x7C91, 0xF4CF, 0x7C9D, 0xF4D0, 0x7C9C, + 0xF4D1, 0x7C9E, 0xF4D2, 0x7CA2, 0xF4D3, 0x7CB2, 0xF4D4, 0x7CBC, 0xF4D5, 0x7CBD, 0xF4D6, 0x7CC1, 0xF4D7, 0x7CC7, 0xF4D8, 0x7CCC, + 0xF4D9, 0x7CCD, 0xF4DA, 0x7CC8, 0xF4DB, 0x7CC5, 0xF4DC, 0x7CD7, 0xF4DD, 0x7CE8, 0xF4DE, 0x826E, 0xF4DF, 0x66A8, 0xF4E0, 0x7FBF, + 0xF4E1, 0x7FCE, 0xF4E2, 0x7FD5, 0xF4E3, 0x7FE5, 0xF4E4, 0x7FE1, 0xF4E5, 0x7FE6, 0xF4E6, 0x7FE9, 0xF4E7, 0x7FEE, 0xF4E8, 0x7FF3, + 0xF4E9, 0x7CF8, 0xF4EA, 0x7D77, 0xF4EB, 0x7DA6, 0xF4EC, 0x7DAE, 0xF4ED, 0x7E47, 0xF4EE, 0x7E9B, 0xF4EF, 0x9EB8, 0xF4F0, 0x9EB4, + 0xF4F1, 0x8D73, 0xF4F2, 0x8D84, 0xF4F3, 0x8D94, 0xF4F4, 0x8D91, 0xF4F5, 0x8DB1, 0xF4F6, 0x8D67, 0xF4F7, 0x8D6D, 0xF4F8, 0x8C47, + 0xF4F9, 0x8C49, 0xF4FA, 0x914A, 0xF4FB, 0x9150, 0xF4FC, 0x914E, 0xF4FD, 0x914F, 0xF4FE, 0x9164, 0xF540, 0x9B7C, 0xF541, 0x9B7D, + 0xF542, 0x9B7E, 0xF543, 0x9B7F, 0xF544, 0x9B80, 0xF545, 0x9B81, 0xF546, 0x9B82, 0xF547, 0x9B83, 0xF548, 0x9B84, 0xF549, 0x9B85, + 0xF54A, 0x9B86, 0xF54B, 0x9B87, 0xF54C, 0x9B88, 0xF54D, 0x9B89, 0xF54E, 0x9B8A, 0xF54F, 0x9B8B, 0xF550, 0x9B8C, 0xF551, 0x9B8D, + 0xF552, 0x9B8E, 0xF553, 0x9B8F, 0xF554, 0x9B90, 0xF555, 0x9B91, 0xF556, 0x9B92, 0xF557, 0x9B93, 0xF558, 0x9B94, 0xF559, 0x9B95, + 0xF55A, 0x9B96, 0xF55B, 0x9B97, 0xF55C, 0x9B98, 0xF55D, 0x9B99, 0xF55E, 0x9B9A, 0xF55F, 0x9B9B, 0xF560, 0x9B9C, 0xF561, 0x9B9D, + 0xF562, 0x9B9E, 0xF563, 0x9B9F, 0xF564, 0x9BA0, 0xF565, 0x9BA1, 0xF566, 0x9BA2, 0xF567, 0x9BA3, 0xF568, 0x9BA4, 0xF569, 0x9BA5, + 0xF56A, 0x9BA6, 0xF56B, 0x9BA7, 0xF56C, 0x9BA8, 0xF56D, 0x9BA9, 0xF56E, 0x9BAA, 0xF56F, 0x9BAB, 0xF570, 0x9BAC, 0xF571, 0x9BAD, + 0xF572, 0x9BAE, 0xF573, 0x9BAF, 0xF574, 0x9BB0, 0xF575, 0x9BB1, 0xF576, 0x9BB2, 0xF577, 0x9BB3, 0xF578, 0x9BB4, 0xF579, 0x9BB5, + 0xF57A, 0x9BB6, 0xF57B, 0x9BB7, 0xF57C, 0x9BB8, 0xF57D, 0x9BB9, 0xF57E, 0x9BBA, 0xF580, 0x9BBB, 0xF581, 0x9BBC, 0xF582, 0x9BBD, + 0xF583, 0x9BBE, 0xF584, 0x9BBF, 0xF585, 0x9BC0, 0xF586, 0x9BC1, 0xF587, 0x9BC2, 0xF588, 0x9BC3, 0xF589, 0x9BC4, 0xF58A, 0x9BC5, + 0xF58B, 0x9BC6, 0xF58C, 0x9BC7, 0xF58D, 0x9BC8, 0xF58E, 0x9BC9, 0xF58F, 0x9BCA, 0xF590, 0x9BCB, 0xF591, 0x9BCC, 0xF592, 0x9BCD, + 0xF593, 0x9BCE, 0xF594, 0x9BCF, 0xF595, 0x9BD0, 0xF596, 0x9BD1, 0xF597, 0x9BD2, 0xF598, 0x9BD3, 0xF599, 0x9BD4, 0xF59A, 0x9BD5, + 0xF59B, 0x9BD6, 0xF59C, 0x9BD7, 0xF59D, 0x9BD8, 0xF59E, 0x9BD9, 0xF59F, 0x9BDA, 0xF5A0, 0x9BDB, 0xF5A1, 0x9162, 0xF5A2, 0x9161, + 0xF5A3, 0x9170, 0xF5A4, 0x9169, 0xF5A5, 0x916F, 0xF5A6, 0x917D, 0xF5A7, 0x917E, 0xF5A8, 0x9172, 0xF5A9, 0x9174, 0xF5AA, 0x9179, + 0xF5AB, 0x918C, 0xF5AC, 0x9185, 0xF5AD, 0x9190, 0xF5AE, 0x918D, 0xF5AF, 0x9191, 0xF5B0, 0x91A2, 0xF5B1, 0x91A3, 0xF5B2, 0x91AA, + 0xF5B3, 0x91AD, 0xF5B4, 0x91AE, 0xF5B5, 0x91AF, 0xF5B6, 0x91B5, 0xF5B7, 0x91B4, 0xF5B8, 0x91BA, 0xF5B9, 0x8C55, 0xF5BA, 0x9E7E, + 0xF5BB, 0x8DB8, 0xF5BC, 0x8DEB, 0xF5BD, 0x8E05, 0xF5BE, 0x8E59, 0xF5BF, 0x8E69, 0xF5C0, 0x8DB5, 0xF5C1, 0x8DBF, 0xF5C2, 0x8DBC, + 0xF5C3, 0x8DBA, 0xF5C4, 0x8DC4, 0xF5C5, 0x8DD6, 0xF5C6, 0x8DD7, 0xF5C7, 0x8DDA, 0xF5C8, 0x8DDE, 0xF5C9, 0x8DCE, 0xF5CA, 0x8DCF, + 0xF5CB, 0x8DDB, 0xF5CC, 0x8DC6, 0xF5CD, 0x8DEC, 0xF5CE, 0x8DF7, 0xF5CF, 0x8DF8, 0xF5D0, 0x8DE3, 0xF5D1, 0x8DF9, 0xF5D2, 0x8DFB, + 0xF5D3, 0x8DE4, 0xF5D4, 0x8E09, 0xF5D5, 0x8DFD, 0xF5D6, 0x8E14, 0xF5D7, 0x8E1D, 0xF5D8, 0x8E1F, 0xF5D9, 0x8E2C, 0xF5DA, 0x8E2E, + 0xF5DB, 0x8E23, 0xF5DC, 0x8E2F, 0xF5DD, 0x8E3A, 0xF5DE, 0x8E40, 0xF5DF, 0x8E39, 0xF5E0, 0x8E35, 0xF5E1, 0x8E3D, 0xF5E2, 0x8E31, + 0xF5E3, 0x8E49, 0xF5E4, 0x8E41, 0xF5E5, 0x8E42, 0xF5E6, 0x8E51, 0xF5E7, 0x8E52, 0xF5E8, 0x8E4A, 0xF5E9, 0x8E70, 0xF5EA, 0x8E76, + 0xF5EB, 0x8E7C, 0xF5EC, 0x8E6F, 0xF5ED, 0x8E74, 0xF5EE, 0x8E85, 0xF5EF, 0x8E8F, 0xF5F0, 0x8E94, 0xF5F1, 0x8E90, 0xF5F2, 0x8E9C, + 0xF5F3, 0x8E9E, 0xF5F4, 0x8C78, 0xF5F5, 0x8C82, 0xF5F6, 0x8C8A, 0xF5F7, 0x8C85, 0xF5F8, 0x8C98, 0xF5F9, 0x8C94, 0xF5FA, 0x659B, + 0xF5FB, 0x89D6, 0xF5FC, 0x89DE, 0xF5FD, 0x89DA, 0xF5FE, 0x89DC, 0xF640, 0x9BDC, 0xF641, 0x9BDD, 0xF642, 0x9BDE, 0xF643, 0x9BDF, + 0xF644, 0x9BE0, 0xF645, 0x9BE1, 0xF646, 0x9BE2, 0xF647, 0x9BE3, 0xF648, 0x9BE4, 0xF649, 0x9BE5, 0xF64A, 0x9BE6, 0xF64B, 0x9BE7, + 0xF64C, 0x9BE8, 0xF64D, 0x9BE9, 0xF64E, 0x9BEA, 0xF64F, 0x9BEB, 0xF650, 0x9BEC, 0xF651, 0x9BED, 0xF652, 0x9BEE, 0xF653, 0x9BEF, + 0xF654, 0x9BF0, 0xF655, 0x9BF1, 0xF656, 0x9BF2, 0xF657, 0x9BF3, 0xF658, 0x9BF4, 0xF659, 0x9BF5, 0xF65A, 0x9BF6, 0xF65B, 0x9BF7, + 0xF65C, 0x9BF8, 0xF65D, 0x9BF9, 0xF65E, 0x9BFA, 0xF65F, 0x9BFB, 0xF660, 0x9BFC, 0xF661, 0x9BFD, 0xF662, 0x9BFE, 0xF663, 0x9BFF, + 0xF664, 0x9C00, 0xF665, 0x9C01, 0xF666, 0x9C02, 0xF667, 0x9C03, 0xF668, 0x9C04, 0xF669, 0x9C05, 0xF66A, 0x9C06, 0xF66B, 0x9C07, + 0xF66C, 0x9C08, 0xF66D, 0x9C09, 0xF66E, 0x9C0A, 0xF66F, 0x9C0B, 0xF670, 0x9C0C, 0xF671, 0x9C0D, 0xF672, 0x9C0E, 0xF673, 0x9C0F, + 0xF674, 0x9C10, 0xF675, 0x9C11, 0xF676, 0x9C12, 0xF677, 0x9C13, 0xF678, 0x9C14, 0xF679, 0x9C15, 0xF67A, 0x9C16, 0xF67B, 0x9C17, + 0xF67C, 0x9C18, 0xF67D, 0x9C19, 0xF67E, 0x9C1A, 0xF680, 0x9C1B, 0xF681, 0x9C1C, 0xF682, 0x9C1D, 0xF683, 0x9C1E, 0xF684, 0x9C1F, + 0xF685, 0x9C20, 0xF686, 0x9C21, 0xF687, 0x9C22, 0xF688, 0x9C23, 0xF689, 0x9C24, 0xF68A, 0x9C25, 0xF68B, 0x9C26, 0xF68C, 0x9C27, + 0xF68D, 0x9C28, 0xF68E, 0x9C29, 0xF68F, 0x9C2A, 0xF690, 0x9C2B, 0xF691, 0x9C2C, 0xF692, 0x9C2D, 0xF693, 0x9C2E, 0xF694, 0x9C2F, + 0xF695, 0x9C30, 0xF696, 0x9C31, 0xF697, 0x9C32, 0xF698, 0x9C33, 0xF699, 0x9C34, 0xF69A, 0x9C35, 0xF69B, 0x9C36, 0xF69C, 0x9C37, + 0xF69D, 0x9C38, 0xF69E, 0x9C39, 0xF69F, 0x9C3A, 0xF6A0, 0x9C3B, 0xF6A1, 0x89E5, 0xF6A2, 0x89EB, 0xF6A3, 0x89EF, 0xF6A4, 0x8A3E, + 0xF6A5, 0x8B26, 0xF6A6, 0x9753, 0xF6A7, 0x96E9, 0xF6A8, 0x96F3, 0xF6A9, 0x96EF, 0xF6AA, 0x9706, 0xF6AB, 0x9701, 0xF6AC, 0x9708, + 0xF6AD, 0x970F, 0xF6AE, 0x970E, 0xF6AF, 0x972A, 0xF6B0, 0x972D, 0xF6B1, 0x9730, 0xF6B2, 0x973E, 0xF6B3, 0x9F80, 0xF6B4, 0x9F83, + 0xF6B5, 0x9F85, 0xF6B6, 0x9F86, 0xF6B7, 0x9F87, 0xF6B8, 0x9F88, 0xF6B9, 0x9F89, 0xF6BA, 0x9F8A, 0xF6BB, 0x9F8C, 0xF6BC, 0x9EFE, + 0xF6BD, 0x9F0B, 0xF6BE, 0x9F0D, 0xF6BF, 0x96B9, 0xF6C0, 0x96BC, 0xF6C1, 0x96BD, 0xF6C2, 0x96CE, 0xF6C3, 0x96D2, 0xF6C4, 0x77BF, + 0xF6C5, 0x96E0, 0xF6C6, 0x928E, 0xF6C7, 0x92AE, 0xF6C8, 0x92C8, 0xF6C9, 0x933E, 0xF6CA, 0x936A, 0xF6CB, 0x93CA, 0xF6CC, 0x938F, + 0xF6CD, 0x943E, 0xF6CE, 0x946B, 0xF6CF, 0x9C7F, 0xF6D0, 0x9C82, 0xF6D1, 0x9C85, 0xF6D2, 0x9C86, 0xF6D3, 0x9C87, 0xF6D4, 0x9C88, + 0xF6D5, 0x7A23, 0xF6D6, 0x9C8B, 0xF6D7, 0x9C8E, 0xF6D8, 0x9C90, 0xF6D9, 0x9C91, 0xF6DA, 0x9C92, 0xF6DB, 0x9C94, 0xF6DC, 0x9C95, + 0xF6DD, 0x9C9A, 0xF6DE, 0x9C9B, 0xF6DF, 0x9C9E, 0xF6E0, 0x9C9F, 0xF6E1, 0x9CA0, 0xF6E2, 0x9CA1, 0xF6E3, 0x9CA2, 0xF6E4, 0x9CA3, + 0xF6E5, 0x9CA5, 0xF6E6, 0x9CA6, 0xF6E7, 0x9CA7, 0xF6E8, 0x9CA8, 0xF6E9, 0x9CA9, 0xF6EA, 0x9CAB, 0xF6EB, 0x9CAD, 0xF6EC, 0x9CAE, + 0xF6ED, 0x9CB0, 0xF6EE, 0x9CB1, 0xF6EF, 0x9CB2, 0xF6F0, 0x9CB3, 0xF6F1, 0x9CB4, 0xF6F2, 0x9CB5, 0xF6F3, 0x9CB6, 0xF6F4, 0x9CB7, + 0xF6F5, 0x9CBA, 0xF6F6, 0x9CBB, 0xF6F7, 0x9CBC, 0xF6F8, 0x9CBD, 0xF6F9, 0x9CC4, 0xF6FA, 0x9CC5, 0xF6FB, 0x9CC6, 0xF6FC, 0x9CC7, + 0xF6FD, 0x9CCA, 0xF6FE, 0x9CCB, 0xF740, 0x9C3C, 0xF741, 0x9C3D, 0xF742, 0x9C3E, 0xF743, 0x9C3F, 0xF744, 0x9C40, 0xF745, 0x9C41, + 0xF746, 0x9C42, 0xF747, 0x9C43, 0xF748, 0x9C44, 0xF749, 0x9C45, 0xF74A, 0x9C46, 0xF74B, 0x9C47, 0xF74C, 0x9C48, 0xF74D, 0x9C49, + 0xF74E, 0x9C4A, 0xF74F, 0x9C4B, 0xF750, 0x9C4C, 0xF751, 0x9C4D, 0xF752, 0x9C4E, 0xF753, 0x9C4F, 0xF754, 0x9C50, 0xF755, 0x9C51, + 0xF756, 0x9C52, 0xF757, 0x9C53, 0xF758, 0x9C54, 0xF759, 0x9C55, 0xF75A, 0x9C56, 0xF75B, 0x9C57, 0xF75C, 0x9C58, 0xF75D, 0x9C59, + 0xF75E, 0x9C5A, 0xF75F, 0x9C5B, 0xF760, 0x9C5C, 0xF761, 0x9C5D, 0xF762, 0x9C5E, 0xF763, 0x9C5F, 0xF764, 0x9C60, 0xF765, 0x9C61, + 0xF766, 0x9C62, 0xF767, 0x9C63, 0xF768, 0x9C64, 0xF769, 0x9C65, 0xF76A, 0x9C66, 0xF76B, 0x9C67, 0xF76C, 0x9C68, 0xF76D, 0x9C69, + 0xF76E, 0x9C6A, 0xF76F, 0x9C6B, 0xF770, 0x9C6C, 0xF771, 0x9C6D, 0xF772, 0x9C6E, 0xF773, 0x9C6F, 0xF774, 0x9C70, 0xF775, 0x9C71, + 0xF776, 0x9C72, 0xF777, 0x9C73, 0xF778, 0x9C74, 0xF779, 0x9C75, 0xF77A, 0x9C76, 0xF77B, 0x9C77, 0xF77C, 0x9C78, 0xF77D, 0x9C79, + 0xF77E, 0x9C7A, 0xF780, 0x9C7B, 0xF781, 0x9C7D, 0xF782, 0x9C7E, 0xF783, 0x9C80, 0xF784, 0x9C83, 0xF785, 0x9C84, 0xF786, 0x9C89, + 0xF787, 0x9C8A, 0xF788, 0x9C8C, 0xF789, 0x9C8F, 0xF78A, 0x9C93, 0xF78B, 0x9C96, 0xF78C, 0x9C97, 0xF78D, 0x9C98, 0xF78E, 0x9C99, + 0xF78F, 0x9C9D, 0xF790, 0x9CAA, 0xF791, 0x9CAC, 0xF792, 0x9CAF, 0xF793, 0x9CB9, 0xF794, 0x9CBE, 0xF795, 0x9CBF, 0xF796, 0x9CC0, + 0xF797, 0x9CC1, 0xF798, 0x9CC2, 0xF799, 0x9CC8, 0xF79A, 0x9CC9, 0xF79B, 0x9CD1, 0xF79C, 0x9CD2, 0xF79D, 0x9CDA, 0xF79E, 0x9CDB, + 0xF79F, 0x9CE0, 0xF7A0, 0x9CE1, 0xF7A1, 0x9CCC, 0xF7A2, 0x9CCD, 0xF7A3, 0x9CCE, 0xF7A4, 0x9CCF, 0xF7A5, 0x9CD0, 0xF7A6, 0x9CD3, + 0xF7A7, 0x9CD4, 0xF7A8, 0x9CD5, 0xF7A9, 0x9CD7, 0xF7AA, 0x9CD8, 0xF7AB, 0x9CD9, 0xF7AC, 0x9CDC, 0xF7AD, 0x9CDD, 0xF7AE, 0x9CDF, + 0xF7AF, 0x9CE2, 0xF7B0, 0x977C, 0xF7B1, 0x9785, 0xF7B2, 0x9791, 0xF7B3, 0x9792, 0xF7B4, 0x9794, 0xF7B5, 0x97AF, 0xF7B6, 0x97AB, + 0xF7B7, 0x97A3, 0xF7B8, 0x97B2, 0xF7B9, 0x97B4, 0xF7BA, 0x9AB1, 0xF7BB, 0x9AB0, 0xF7BC, 0x9AB7, 0xF7BD, 0x9E58, 0xF7BE, 0x9AB6, + 0xF7BF, 0x9ABA, 0xF7C0, 0x9ABC, 0xF7C1, 0x9AC1, 0xF7C2, 0x9AC0, 0xF7C3, 0x9AC5, 0xF7C4, 0x9AC2, 0xF7C5, 0x9ACB, 0xF7C6, 0x9ACC, + 0xF7C7, 0x9AD1, 0xF7C8, 0x9B45, 0xF7C9, 0x9B43, 0xF7CA, 0x9B47, 0xF7CB, 0x9B49, 0xF7CC, 0x9B48, 0xF7CD, 0x9B4D, 0xF7CE, 0x9B51, + 0xF7CF, 0x98E8, 0xF7D0, 0x990D, 0xF7D1, 0x992E, 0xF7D2, 0x9955, 0xF7D3, 0x9954, 0xF7D4, 0x9ADF, 0xF7D5, 0x9AE1, 0xF7D6, 0x9AE6, + 0xF7D7, 0x9AEF, 0xF7D8, 0x9AEB, 0xF7D9, 0x9AFB, 0xF7DA, 0x9AED, 0xF7DB, 0x9AF9, 0xF7DC, 0x9B08, 0xF7DD, 0x9B0F, 0xF7DE, 0x9B13, + 0xF7DF, 0x9B1F, 0xF7E0, 0x9B23, 0xF7E1, 0x9EBD, 0xF7E2, 0x9EBE, 0xF7E3, 0x7E3B, 0xF7E4, 0x9E82, 0xF7E5, 0x9E87, 0xF7E6, 0x9E88, + 0xF7E7, 0x9E8B, 0xF7E8, 0x9E92, 0xF7E9, 0x93D6, 0xF7EA, 0x9E9D, 0xF7EB, 0x9E9F, 0xF7EC, 0x9EDB, 0xF7ED, 0x9EDC, 0xF7EE, 0x9EDD, + 0xF7EF, 0x9EE0, 0xF7F0, 0x9EDF, 0xF7F1, 0x9EE2, 0xF7F2, 0x9EE9, 0xF7F3, 0x9EE7, 0xF7F4, 0x9EE5, 0xF7F5, 0x9EEA, 0xF7F6, 0x9EEF, + 0xF7F7, 0x9F22, 0xF7F8, 0x9F2C, 0xF7F9, 0x9F2F, 0xF7FA, 0x9F39, 0xF7FB, 0x9F37, 0xF7FC, 0x9F3D, 0xF7FD, 0x9F3E, 0xF7FE, 0x9F44, + 0xF840, 0x9CE3, 0xF841, 0x9CE4, 0xF842, 0x9CE5, 0xF843, 0x9CE6, 0xF844, 0x9CE7, 0xF845, 0x9CE8, 0xF846, 0x9CE9, 0xF847, 0x9CEA, + 0xF848, 0x9CEB, 0xF849, 0x9CEC, 0xF84A, 0x9CED, 0xF84B, 0x9CEE, 0xF84C, 0x9CEF, 0xF84D, 0x9CF0, 0xF84E, 0x9CF1, 0xF84F, 0x9CF2, + 0xF850, 0x9CF3, 0xF851, 0x9CF4, 0xF852, 0x9CF5, 0xF853, 0x9CF6, 0xF854, 0x9CF7, 0xF855, 0x9CF8, 0xF856, 0x9CF9, 0xF857, 0x9CFA, + 0xF858, 0x9CFB, 0xF859, 0x9CFC, 0xF85A, 0x9CFD, 0xF85B, 0x9CFE, 0xF85C, 0x9CFF, 0xF85D, 0x9D00, 0xF85E, 0x9D01, 0xF85F, 0x9D02, + 0xF860, 0x9D03, 0xF861, 0x9D04, 0xF862, 0x9D05, 0xF863, 0x9D06, 0xF864, 0x9D07, 0xF865, 0x9D08, 0xF866, 0x9D09, 0xF867, 0x9D0A, + 0xF868, 0x9D0B, 0xF869, 0x9D0C, 0xF86A, 0x9D0D, 0xF86B, 0x9D0E, 0xF86C, 0x9D0F, 0xF86D, 0x9D10, 0xF86E, 0x9D11, 0xF86F, 0x9D12, + 0xF870, 0x9D13, 0xF871, 0x9D14, 0xF872, 0x9D15, 0xF873, 0x9D16, 0xF874, 0x9D17, 0xF875, 0x9D18, 0xF876, 0x9D19, 0xF877, 0x9D1A, + 0xF878, 0x9D1B, 0xF879, 0x9D1C, 0xF87A, 0x9D1D, 0xF87B, 0x9D1E, 0xF87C, 0x9D1F, 0xF87D, 0x9D20, 0xF87E, 0x9D21, 0xF880, 0x9D22, + 0xF881, 0x9D23, 0xF882, 0x9D24, 0xF883, 0x9D25, 0xF884, 0x9D26, 0xF885, 0x9D27, 0xF886, 0x9D28, 0xF887, 0x9D29, 0xF888, 0x9D2A, + 0xF889, 0x9D2B, 0xF88A, 0x9D2C, 0xF88B, 0x9D2D, 0xF88C, 0x9D2E, 0xF88D, 0x9D2F, 0xF88E, 0x9D30, 0xF88F, 0x9D31, 0xF890, 0x9D32, + 0xF891, 0x9D33, 0xF892, 0x9D34, 0xF893, 0x9D35, 0xF894, 0x9D36, 0xF895, 0x9D37, 0xF896, 0x9D38, 0xF897, 0x9D39, 0xF898, 0x9D3A, + 0xF899, 0x9D3B, 0xF89A, 0x9D3C, 0xF89B, 0x9D3D, 0xF89C, 0x9D3E, 0xF89D, 0x9D3F, 0xF89E, 0x9D40, 0xF89F, 0x9D41, 0xF8A0, 0x9D42, + 0xF940, 0x9D43, 0xF941, 0x9D44, 0xF942, 0x9D45, 0xF943, 0x9D46, 0xF944, 0x9D47, 0xF945, 0x9D48, 0xF946, 0x9D49, 0xF947, 0x9D4A, + 0xF948, 0x9D4B, 0xF949, 0x9D4C, 0xF94A, 0x9D4D, 0xF94B, 0x9D4E, 0xF94C, 0x9D4F, 0xF94D, 0x9D50, 0xF94E, 0x9D51, 0xF94F, 0x9D52, + 0xF950, 0x9D53, 0xF951, 0x9D54, 0xF952, 0x9D55, 0xF953, 0x9D56, 0xF954, 0x9D57, 0xF955, 0x9D58, 0xF956, 0x9D59, 0xF957, 0x9D5A, + 0xF958, 0x9D5B, 0xF959, 0x9D5C, 0xF95A, 0x9D5D, 0xF95B, 0x9D5E, 0xF95C, 0x9D5F, 0xF95D, 0x9D60, 0xF95E, 0x9D61, 0xF95F, 0x9D62, + 0xF960, 0x9D63, 0xF961, 0x9D64, 0xF962, 0x9D65, 0xF963, 0x9D66, 0xF964, 0x9D67, 0xF965, 0x9D68, 0xF966, 0x9D69, 0xF967, 0x9D6A, + 0xF968, 0x9D6B, 0xF969, 0x9D6C, 0xF96A, 0x9D6D, 0xF96B, 0x9D6E, 0xF96C, 0x9D6F, 0xF96D, 0x9D70, 0xF96E, 0x9D71, 0xF96F, 0x9D72, + 0xF970, 0x9D73, 0xF971, 0x9D74, 0xF972, 0x9D75, 0xF973, 0x9D76, 0xF974, 0x9D77, 0xF975, 0x9D78, 0xF976, 0x9D79, 0xF977, 0x9D7A, + 0xF978, 0x9D7B, 0xF979, 0x9D7C, 0xF97A, 0x9D7D, 0xF97B, 0x9D7E, 0xF97C, 0x9D7F, 0xF97D, 0x9D80, 0xF97E, 0x9D81, 0xF980, 0x9D82, + 0xF981, 0x9D83, 0xF982, 0x9D84, 0xF983, 0x9D85, 0xF984, 0x9D86, 0xF985, 0x9D87, 0xF986, 0x9D88, 0xF987, 0x9D89, 0xF988, 0x9D8A, + 0xF989, 0x9D8B, 0xF98A, 0x9D8C, 0xF98B, 0x9D8D, 0xF98C, 0x9D8E, 0xF98D, 0x9D8F, 0xF98E, 0x9D90, 0xF98F, 0x9D91, 0xF990, 0x9D92, + 0xF991, 0x9D93, 0xF992, 0x9D94, 0xF993, 0x9D95, 0xF994, 0x9D96, 0xF995, 0x9D97, 0xF996, 0x9D98, 0xF997, 0x9D99, 0xF998, 0x9D9A, + 0xF999, 0x9D9B, 0xF99A, 0x9D9C, 0xF99B, 0x9D9D, 0xF99C, 0x9D9E, 0xF99D, 0x9D9F, 0xF99E, 0x9DA0, 0xF99F, 0x9DA1, 0xF9A0, 0x9DA2, + 0xFA40, 0x9DA3, 0xFA41, 0x9DA4, 0xFA42, 0x9DA5, 0xFA43, 0x9DA6, 0xFA44, 0x9DA7, 0xFA45, 0x9DA8, 0xFA46, 0x9DA9, 0xFA47, 0x9DAA, + 0xFA48, 0x9DAB, 0xFA49, 0x9DAC, 0xFA4A, 0x9DAD, 0xFA4B, 0x9DAE, 0xFA4C, 0x9DAF, 0xFA4D, 0x9DB0, 0xFA4E, 0x9DB1, 0xFA4F, 0x9DB2, + 0xFA50, 0x9DB3, 0xFA51, 0x9DB4, 0xFA52, 0x9DB5, 0xFA53, 0x9DB6, 0xFA54, 0x9DB7, 0xFA55, 0x9DB8, 0xFA56, 0x9DB9, 0xFA57, 0x9DBA, + 0xFA58, 0x9DBB, 0xFA59, 0x9DBC, 0xFA5A, 0x9DBD, 0xFA5B, 0x9DBE, 0xFA5C, 0x9DBF, 0xFA5D, 0x9DC0, 0xFA5E, 0x9DC1, 0xFA5F, 0x9DC2, + 0xFA60, 0x9DC3, 0xFA61, 0x9DC4, 0xFA62, 0x9DC5, 0xFA63, 0x9DC6, 0xFA64, 0x9DC7, 0xFA65, 0x9DC8, 0xFA66, 0x9DC9, 0xFA67, 0x9DCA, + 0xFA68, 0x9DCB, 0xFA69, 0x9DCC, 0xFA6A, 0x9DCD, 0xFA6B, 0x9DCE, 0xFA6C, 0x9DCF, 0xFA6D, 0x9DD0, 0xFA6E, 0x9DD1, 0xFA6F, 0x9DD2, + 0xFA70, 0x9DD3, 0xFA71, 0x9DD4, 0xFA72, 0x9DD5, 0xFA73, 0x9DD6, 0xFA74, 0x9DD7, 0xFA75, 0x9DD8, 0xFA76, 0x9DD9, 0xFA77, 0x9DDA, + 0xFA78, 0x9DDB, 0xFA79, 0x9DDC, 0xFA7A, 0x9DDD, 0xFA7B, 0x9DDE, 0xFA7C, 0x9DDF, 0xFA7D, 0x9DE0, 0xFA7E, 0x9DE1, 0xFA80, 0x9DE2, + 0xFA81, 0x9DE3, 0xFA82, 0x9DE4, 0xFA83, 0x9DE5, 0xFA84, 0x9DE6, 0xFA85, 0x9DE7, 0xFA86, 0x9DE8, 0xFA87, 0x9DE9, 0xFA88, 0x9DEA, + 0xFA89, 0x9DEB, 0xFA8A, 0x9DEC, 0xFA8B, 0x9DED, 0xFA8C, 0x9DEE, 0xFA8D, 0x9DEF, 0xFA8E, 0x9DF0, 0xFA8F, 0x9DF1, 0xFA90, 0x9DF2, + 0xFA91, 0x9DF3, 0xFA92, 0x9DF4, 0xFA93, 0x9DF5, 0xFA94, 0x9DF6, 0xFA95, 0x9DF7, 0xFA96, 0x9DF8, 0xFA97, 0x9DF9, 0xFA98, 0x9DFA, + 0xFA99, 0x9DFB, 0xFA9A, 0x9DFC, 0xFA9B, 0x9DFD, 0xFA9C, 0x9DFE, 0xFA9D, 0x9DFF, 0xFA9E, 0x9E00, 0xFA9F, 0x9E01, 0xFAA0, 0x9E02, + 0xFB40, 0x9E03, 0xFB41, 0x9E04, 0xFB42, 0x9E05, 0xFB43, 0x9E06, 0xFB44, 0x9E07, 0xFB45, 0x9E08, 0xFB46, 0x9E09, 0xFB47, 0x9E0A, + 0xFB48, 0x9E0B, 0xFB49, 0x9E0C, 0xFB4A, 0x9E0D, 0xFB4B, 0x9E0E, 0xFB4C, 0x9E0F, 0xFB4D, 0x9E10, 0xFB4E, 0x9E11, 0xFB4F, 0x9E12, + 0xFB50, 0x9E13, 0xFB51, 0x9E14, 0xFB52, 0x9E15, 0xFB53, 0x9E16, 0xFB54, 0x9E17, 0xFB55, 0x9E18, 0xFB56, 0x9E19, 0xFB57, 0x9E1A, + 0xFB58, 0x9E1B, 0xFB59, 0x9E1C, 0xFB5A, 0x9E1D, 0xFB5B, 0x9E1E, 0xFB5C, 0x9E24, 0xFB5D, 0x9E27, 0xFB5E, 0x9E2E, 0xFB5F, 0x9E30, + 0xFB60, 0x9E34, 0xFB61, 0x9E3B, 0xFB62, 0x9E3C, 0xFB63, 0x9E40, 0xFB64, 0x9E4D, 0xFB65, 0x9E50, 0xFB66, 0x9E52, 0xFB67, 0x9E53, + 0xFB68, 0x9E54, 0xFB69, 0x9E56, 0xFB6A, 0x9E59, 0xFB6B, 0x9E5D, 0xFB6C, 0x9E5F, 0xFB6D, 0x9E60, 0xFB6E, 0x9E61, 0xFB6F, 0x9E62, + 0xFB70, 0x9E65, 0xFB71, 0x9E6E, 0xFB72, 0x9E6F, 0xFB73, 0x9E72, 0xFB74, 0x9E74, 0xFB75, 0x9E75, 0xFB76, 0x9E76, 0xFB77, 0x9E77, + 0xFB78, 0x9E78, 0xFB79, 0x9E79, 0xFB7A, 0x9E7A, 0xFB7B, 0x9E7B, 0xFB7C, 0x9E7C, 0xFB7D, 0x9E7D, 0xFB7E, 0x9E80, 0xFB80, 0x9E81, + 0xFB81, 0x9E83, 0xFB82, 0x9E84, 0xFB83, 0x9E85, 0xFB84, 0x9E86, 0xFB85, 0x9E89, 0xFB86, 0x9E8A, 0xFB87, 0x9E8C, 0xFB88, 0x9E8D, + 0xFB89, 0x9E8E, 0xFB8A, 0x9E8F, 0xFB8B, 0x9E90, 0xFB8C, 0x9E91, 0xFB8D, 0x9E94, 0xFB8E, 0x9E95, 0xFB8F, 0x9E96, 0xFB90, 0x9E97, + 0xFB91, 0x9E98, 0xFB92, 0x9E99, 0xFB93, 0x9E9A, 0xFB94, 0x9E9B, 0xFB95, 0x9E9C, 0xFB96, 0x9E9E, 0xFB97, 0x9EA0, 0xFB98, 0x9EA1, + 0xFB99, 0x9EA2, 0xFB9A, 0x9EA3, 0xFB9B, 0x9EA4, 0xFB9C, 0x9EA5, 0xFB9D, 0x9EA7, 0xFB9E, 0x9EA8, 0xFB9F, 0x9EA9, 0xFBA0, 0x9EAA, + 0xFC40, 0x9EAB, 0xFC41, 0x9EAC, 0xFC42, 0x9EAD, 0xFC43, 0x9EAE, 0xFC44, 0x9EAF, 0xFC45, 0x9EB0, 0xFC46, 0x9EB1, 0xFC47, 0x9EB2, + 0xFC48, 0x9EB3, 0xFC49, 0x9EB5, 0xFC4A, 0x9EB6, 0xFC4B, 0x9EB7, 0xFC4C, 0x9EB9, 0xFC4D, 0x9EBA, 0xFC4E, 0x9EBC, 0xFC4F, 0x9EBF, + 0xFC50, 0x9EC0, 0xFC51, 0x9EC1, 0xFC52, 0x9EC2, 0xFC53, 0x9EC3, 0xFC54, 0x9EC5, 0xFC55, 0x9EC6, 0xFC56, 0x9EC7, 0xFC57, 0x9EC8, + 0xFC58, 0x9ECA, 0xFC59, 0x9ECB, 0xFC5A, 0x9ECC, 0xFC5B, 0x9ED0, 0xFC5C, 0x9ED2, 0xFC5D, 0x9ED3, 0xFC5E, 0x9ED5, 0xFC5F, 0x9ED6, + 0xFC60, 0x9ED7, 0xFC61, 0x9ED9, 0xFC62, 0x9EDA, 0xFC63, 0x9EDE, 0xFC64, 0x9EE1, 0xFC65, 0x9EE3, 0xFC66, 0x9EE4, 0xFC67, 0x9EE6, + 0xFC68, 0x9EE8, 0xFC69, 0x9EEB, 0xFC6A, 0x9EEC, 0xFC6B, 0x9EED, 0xFC6C, 0x9EEE, 0xFC6D, 0x9EF0, 0xFC6E, 0x9EF1, 0xFC6F, 0x9EF2, + 0xFC70, 0x9EF3, 0xFC71, 0x9EF4, 0xFC72, 0x9EF5, 0xFC73, 0x9EF6, 0xFC74, 0x9EF7, 0xFC75, 0x9EF8, 0xFC76, 0x9EFA, 0xFC77, 0x9EFD, + 0xFC78, 0x9EFF, 0xFC79, 0x9F00, 0xFC7A, 0x9F01, 0xFC7B, 0x9F02, 0xFC7C, 0x9F03, 0xFC7D, 0x9F04, 0xFC7E, 0x9F05, 0xFC80, 0x9F06, + 0xFC81, 0x9F07, 0xFC82, 0x9F08, 0xFC83, 0x9F09, 0xFC84, 0x9F0A, 0xFC85, 0x9F0C, 0xFC86, 0x9F0F, 0xFC87, 0x9F11, 0xFC88, 0x9F12, + 0xFC89, 0x9F14, 0xFC8A, 0x9F15, 0xFC8B, 0x9F16, 0xFC8C, 0x9F18, 0xFC8D, 0x9F1A, 0xFC8E, 0x9F1B, 0xFC8F, 0x9F1C, 0xFC90, 0x9F1D, + 0xFC91, 0x9F1E, 0xFC92, 0x9F1F, 0xFC93, 0x9F21, 0xFC94, 0x9F23, 0xFC95, 0x9F24, 0xFC96, 0x9F25, 0xFC97, 0x9F26, 0xFC98, 0x9F27, + 0xFC99, 0x9F28, 0xFC9A, 0x9F29, 0xFC9B, 0x9F2A, 0xFC9C, 0x9F2B, 0xFC9D, 0x9F2D, 0xFC9E, 0x9F2E, 0xFC9F, 0x9F30, 0xFCA0, 0x9F31, + 0xFD40, 0x9F32, 0xFD41, 0x9F33, 0xFD42, 0x9F34, 0xFD43, 0x9F35, 0xFD44, 0x9F36, 0xFD45, 0x9F38, 0xFD46, 0x9F3A, 0xFD47, 0x9F3C, + 0xFD48, 0x9F3F, 0xFD49, 0x9F40, 0xFD4A, 0x9F41, 0xFD4B, 0x9F42, 0xFD4C, 0x9F43, 0xFD4D, 0x9F45, 0xFD4E, 0x9F46, 0xFD4F, 0x9F47, + 0xFD50, 0x9F48, 0xFD51, 0x9F49, 0xFD52, 0x9F4A, 0xFD53, 0x9F4B, 0xFD54, 0x9F4C, 0xFD55, 0x9F4D, 0xFD56, 0x9F4E, 0xFD57, 0x9F4F, + 0xFD58, 0x9F52, 0xFD59, 0x9F53, 0xFD5A, 0x9F54, 0xFD5B, 0x9F55, 0xFD5C, 0x9F56, 0xFD5D, 0x9F57, 0xFD5E, 0x9F58, 0xFD5F, 0x9F59, + 0xFD60, 0x9F5A, 0xFD61, 0x9F5B, 0xFD62, 0x9F5C, 0xFD63, 0x9F5D, 0xFD64, 0x9F5E, 0xFD65, 0x9F5F, 0xFD66, 0x9F60, 0xFD67, 0x9F61, + 0xFD68, 0x9F62, 0xFD69, 0x9F63, 0xFD6A, 0x9F64, 0xFD6B, 0x9F65, 0xFD6C, 0x9F66, 0xFD6D, 0x9F67, 0xFD6E, 0x9F68, 0xFD6F, 0x9F69, + 0xFD70, 0x9F6A, 0xFD71, 0x9F6B, 0xFD72, 0x9F6C, 0xFD73, 0x9F6D, 0xFD74, 0x9F6E, 0xFD75, 0x9F6F, 0xFD76, 0x9F70, 0xFD77, 0x9F71, + 0xFD78, 0x9F72, 0xFD79, 0x9F73, 0xFD7A, 0x9F74, 0xFD7B, 0x9F75, 0xFD7C, 0x9F76, 0xFD7D, 0x9F77, 0xFD7E, 0x9F78, 0xFD80, 0x9F79, + 0xFD81, 0x9F7A, 0xFD82, 0x9F7B, 0xFD83, 0x9F7C, 0xFD84, 0x9F7D, 0xFD85, 0x9F7E, 0xFD86, 0x9F81, 0xFD87, 0x9F82, 0xFD88, 0x9F8D, + 0xFD89, 0x9F8E, 0xFD8A, 0x9F8F, 0xFD8B, 0x9F90, 0xFD8C, 0x9F91, 0xFD8D, 0x9F92, 0xFD8E, 0x9F93, 0xFD8F, 0x9F94, 0xFD90, 0x9F95, + 0xFD91, 0x9F96, 0xFD92, 0x9F97, 0xFD93, 0x9F98, 0xFD94, 0x9F9C, 0xFD95, 0x9F9D, 0xFD96, 0x9F9E, 0xFD97, 0x9FA1, 0xFD98, 0x9FA2, + 0xFD99, 0x9FA3, 0xFD9A, 0x9FA4, 0xFD9B, 0x9FA5, 0xFD9C, 0xF92C, 0xFD9D, 0xF979, 0xFD9E, 0xF995, 0xFD9F, 0xF9E7, 0xFDA0, 0xF9F1, + 0xFE40, 0xFA0C, 0xFE41, 0xFA0D, 0xFE42, 0xFA0E, 0xFE43, 0xFA0F, 0xFE44, 0xFA11, 0xFE45, 0xFA13, 0xFE46, 0xFA14, 0xFE47, 0xFA18, + 0xFE48, 0xFA1F, 0xFE49, 0xFA20, 0xFE4A, 0xFA21, 0xFE4B, 0xFA23, 0xFE4C, 0xFA24, 0xFE4D, 0xFA27, 0xFE4E, 0xFA28, 0xFE4F, 0xFA29, + 0, 0 +}; +#endif + +#if FF_CODE_PAGE == 949 || FF_CODE_PAGE == 0 /* Korean */ +static const WCHAR uni2oem949[] = { /* Unicode --> Korean pairs */ + 0x00A1, 0xA2AE, 0x00A4, 0xA2B4, 0x00A7, 0xA1D7, 0x00A8, 0xA1A7, 0x00AA, 0xA8A3, 0x00AD, 0xA1A9, 0x00AE, 0xA2E7, 0x00B0, 0xA1C6, + 0x00B1, 0xA1BE, 0x00B2, 0xA9F7, 0x00B3, 0xA9F8, 0x00B4, 0xA2A5, 0x00B6, 0xA2D2, 0x00B7, 0xA1A4, 0x00B8, 0xA2AC, 0x00B9, 0xA9F6, + 0x00BA, 0xA8AC, 0x00BC, 0xA8F9, 0x00BD, 0xA8F6, 0x00BE, 0xA8FA, 0x00BF, 0xA2AF, 0x00C6, 0xA8A1, 0x00D0, 0xA8A2, 0x00D7, 0xA1BF, + 0x00D8, 0xA8AA, 0x00DE, 0xA8AD, 0x00DF, 0xA9AC, 0x00E6, 0xA9A1, 0x00F0, 0xA9A3, 0x00F7, 0xA1C0, 0x00F8, 0xA9AA, 0x00FE, 0xA9AD, + 0x0111, 0xA9A2, 0x0126, 0xA8A4, 0x0127, 0xA9A4, 0x0131, 0xA9A5, 0x0132, 0xA8A6, 0x0133, 0xA9A6, 0x0138, 0xA9A7, 0x013F, 0xA8A8, + 0x0140, 0xA9A8, 0x0141, 0xA8A9, 0x0142, 0xA9A9, 0x0149, 0xA9B0, 0x014A, 0xA8AF, 0x014B, 0xA9AF, 0x0152, 0xA8AB, 0x0153, 0xA9AB, + 0x0166, 0xA8AE, 0x0167, 0xA9AE, 0x02C7, 0xA2A7, 0x02D0, 0xA2B0, 0x02D8, 0xA2A8, 0x02D9, 0xA2AB, 0x02DA, 0xA2AA, 0x02DB, 0xA2AD, + 0x02DD, 0xA2A9, 0x0391, 0xA5C1, 0x0392, 0xA5C2, 0x0393, 0xA5C3, 0x0394, 0xA5C4, 0x0395, 0xA5C5, 0x0396, 0xA5C6, 0x0397, 0xA5C7, + 0x0398, 0xA5C8, 0x0399, 0xA5C9, 0x039A, 0xA5CA, 0x039B, 0xA5CB, 0x039C, 0xA5CC, 0x039D, 0xA5CD, 0x039E, 0xA5CE, 0x039F, 0xA5CF, + 0x03A0, 0xA5D0, 0x03A1, 0xA5D1, 0x03A3, 0xA5D2, 0x03A4, 0xA5D3, 0x03A5, 0xA5D4, 0x03A6, 0xA5D5, 0x03A7, 0xA5D6, 0x03A8, 0xA5D7, + 0x03A9, 0xA5D8, 0x03B1, 0xA5E1, 0x03B2, 0xA5E2, 0x03B3, 0xA5E3, 0x03B4, 0xA5E4, 0x03B5, 0xA5E5, 0x03B6, 0xA5E6, 0x03B7, 0xA5E7, + 0x03B8, 0xA5E8, 0x03B9, 0xA5E9, 0x03BA, 0xA5EA, 0x03BB, 0xA5EB, 0x03BC, 0xA5EC, 0x03BD, 0xA5ED, 0x03BE, 0xA5EE, 0x03BF, 0xA5EF, + 0x03C0, 0xA5F0, 0x03C1, 0xA5F1, 0x03C3, 0xA5F2, 0x03C4, 0xA5F3, 0x03C5, 0xA5F4, 0x03C6, 0xA5F5, 0x03C7, 0xA5F6, 0x03C8, 0xA5F7, + 0x03C9, 0xA5F8, 0x0401, 0xACA7, 0x0410, 0xACA1, 0x0411, 0xACA2, 0x0412, 0xACA3, 0x0413, 0xACA4, 0x0414, 0xACA5, 0x0415, 0xACA6, + 0x0416, 0xACA8, 0x0417, 0xACA9, 0x0418, 0xACAA, 0x0419, 0xACAB, 0x041A, 0xACAC, 0x041B, 0xACAD, 0x041C, 0xACAE, 0x041D, 0xACAF, + 0x041E, 0xACB0, 0x041F, 0xACB1, 0x0420, 0xACB2, 0x0421, 0xACB3, 0x0422, 0xACB4, 0x0423, 0xACB5, 0x0424, 0xACB6, 0x0425, 0xACB7, + 0x0426, 0xACB8, 0x0427, 0xACB9, 0x0428, 0xACBA, 0x0429, 0xACBB, 0x042A, 0xACBC, 0x042B, 0xACBD, 0x042C, 0xACBE, 0x042D, 0xACBF, + 0x042E, 0xACC0, 0x042F, 0xACC1, 0x0430, 0xACD1, 0x0431, 0xACD2, 0x0432, 0xACD3, 0x0433, 0xACD4, 0x0434, 0xACD5, 0x0435, 0xACD6, + 0x0436, 0xACD8, 0x0437, 0xACD9, 0x0438, 0xACDA, 0x0439, 0xACDB, 0x043A, 0xACDC, 0x043B, 0xACDD, 0x043C, 0xACDE, 0x043D, 0xACDF, + 0x043E, 0xACE0, 0x043F, 0xACE1, 0x0440, 0xACE2, 0x0441, 0xACE3, 0x0442, 0xACE4, 0x0443, 0xACE5, 0x0444, 0xACE6, 0x0445, 0xACE7, + 0x0446, 0xACE8, 0x0447, 0xACE9, 0x0448, 0xACEA, 0x0449, 0xACEB, 0x044A, 0xACEC, 0x044B, 0xACED, 0x044C, 0xACEE, 0x044D, 0xACEF, + 0x044E, 0xACF0, 0x044F, 0xACF1, 0x0451, 0xACD7, 0x2015, 0xA1AA, 0x2018, 0xA1AE, 0x2019, 0xA1AF, 0x201C, 0xA1B0, 0x201D, 0xA1B1, + 0x2020, 0xA2D3, 0x2021, 0xA2D4, 0x2025, 0xA1A5, 0x2026, 0xA1A6, 0x2030, 0xA2B6, 0x2032, 0xA1C7, 0x2033, 0xA1C8, 0x203B, 0xA1D8, + 0x2074, 0xA9F9, 0x207F, 0xA9FA, 0x2081, 0xA9FB, 0x2082, 0xA9FC, 0x2083, 0xA9FD, 0x2084, 0xA9FE, 0x20AC, 0xA2E6, 0x2103, 0xA1C9, + 0x2109, 0xA2B5, 0x2113, 0xA7A4, 0x2116, 0xA2E0, 0x2121, 0xA2E5, 0x2122, 0xA2E2, 0x2126, 0xA7D9, 0x212B, 0xA1CA, 0x2153, 0xA8F7, + 0x2154, 0xA8F8, 0x215B, 0xA8FB, 0x215C, 0xA8FC, 0x215D, 0xA8FD, 0x215E, 0xA8FE, 0x2160, 0xA5B0, 0x2161, 0xA5B1, 0x2162, 0xA5B2, + 0x2163, 0xA5B3, 0x2164, 0xA5B4, 0x2165, 0xA5B5, 0x2166, 0xA5B6, 0x2167, 0xA5B7, 0x2168, 0xA5B8, 0x2169, 0xA5B9, 0x2170, 0xA5A1, + 0x2171, 0xA5A2, 0x2172, 0xA5A3, 0x2173, 0xA5A4, 0x2174, 0xA5A5, 0x2175, 0xA5A6, 0x2176, 0xA5A7, 0x2177, 0xA5A8, 0x2178, 0xA5A9, + 0x2179, 0xA5AA, 0x2190, 0xA1E7, 0x2191, 0xA1E8, 0x2192, 0xA1E6, 0x2193, 0xA1E9, 0x2194, 0xA1EA, 0x2195, 0xA2D5, 0x2196, 0xA2D8, + 0x2197, 0xA2D6, 0x2198, 0xA2D9, 0x2199, 0xA2D7, 0x21D2, 0xA2A1, 0x21D4, 0xA2A2, 0x2200, 0xA2A3, 0x2202, 0xA1D3, 0x2203, 0xA2A4, + 0x2207, 0xA1D4, 0x2208, 0xA1F4, 0x220B, 0xA1F5, 0x220F, 0xA2B3, 0x2211, 0xA2B2, 0x221A, 0xA1EE, 0x221D, 0xA1F0, 0x221E, 0xA1C4, + 0x2220, 0xA1D0, 0x2225, 0xA1AB, 0x2227, 0xA1FC, 0x2228, 0xA1FD, 0x2229, 0xA1FB, 0x222A, 0xA1FA, 0x222B, 0xA1F2, 0x222C, 0xA1F3, + 0x222E, 0xA2B1, 0x2234, 0xA1C5, 0x2235, 0xA1F1, 0x223C, 0xA1AD, 0x223D, 0xA1EF, 0x2252, 0xA1D6, 0x2260, 0xA1C1, 0x2261, 0xA1D5, + 0x2264, 0xA1C2, 0x2265, 0xA1C3, 0x226A, 0xA1EC, 0x226B, 0xA1ED, 0x2282, 0xA1F8, 0x2283, 0xA1F9, 0x2286, 0xA1F6, 0x2287, 0xA1F7, + 0x2299, 0xA2C1, 0x22A5, 0xA1D1, 0x2312, 0xA1D2, 0x2460, 0xA8E7, 0x2461, 0xA8E8, 0x2462, 0xA8E9, 0x2463, 0xA8EA, 0x2464, 0xA8EB, + 0x2465, 0xA8EC, 0x2466, 0xA8ED, 0x2467, 0xA8EE, 0x2468, 0xA8EF, 0x2469, 0xA8F0, 0x246A, 0xA8F1, 0x246B, 0xA8F2, 0x246C, 0xA8F3, + 0x246D, 0xA8F4, 0x246E, 0xA8F5, 0x2474, 0xA9E7, 0x2475, 0xA9E8, 0x2476, 0xA9E9, 0x2477, 0xA9EA, 0x2478, 0xA9EB, 0x2479, 0xA9EC, + 0x247A, 0xA9ED, 0x247B, 0xA9EE, 0x247C, 0xA9EF, 0x247D, 0xA9F0, 0x247E, 0xA9F1, 0x247F, 0xA9F2, 0x2480, 0xA9F3, 0x2481, 0xA9F4, + 0x2482, 0xA9F5, 0x249C, 0xA9CD, 0x249D, 0xA9CE, 0x249E, 0xA9CF, 0x249F, 0xA9D0, 0x24A0, 0xA9D1, 0x24A1, 0xA9D2, 0x24A2, 0xA9D3, + 0x24A3, 0xA9D4, 0x24A4, 0xA9D5, 0x24A5, 0xA9D6, 0x24A6, 0xA9D7, 0x24A7, 0xA9D8, 0x24A8, 0xA9D9, 0x24A9, 0xA9DA, 0x24AA, 0xA9DB, + 0x24AB, 0xA9DC, 0x24AC, 0xA9DD, 0x24AD, 0xA9DE, 0x24AE, 0xA9DF, 0x24AF, 0xA9E0, 0x24B0, 0xA9E1, 0x24B1, 0xA9E2, 0x24B2, 0xA9E3, + 0x24B3, 0xA9E4, 0x24B4, 0xA9E5, 0x24B5, 0xA9E6, 0x24D0, 0xA8CD, 0x24D1, 0xA8CE, 0x24D2, 0xA8CF, 0x24D3, 0xA8D0, 0x24D4, 0xA8D1, + 0x24D5, 0xA8D2, 0x24D6, 0xA8D3, 0x24D7, 0xA8D4, 0x24D8, 0xA8D5, 0x24D9, 0xA8D6, 0x24DA, 0xA8D7, 0x24DB, 0xA8D8, 0x24DC, 0xA8D9, + 0x24DD, 0xA8DA, 0x24DE, 0xA8DB, 0x24DF, 0xA8DC, 0x24E0, 0xA8DD, 0x24E1, 0xA8DE, 0x24E2, 0xA8DF, 0x24E3, 0xA8E0, 0x24E4, 0xA8E1, + 0x24E5, 0xA8E2, 0x24E6, 0xA8E3, 0x24E7, 0xA8E4, 0x24E8, 0xA8E5, 0x24E9, 0xA8E6, 0x2500, 0xA6A1, 0x2501, 0xA6AC, 0x2502, 0xA6A2, + 0x2503, 0xA6AD, 0x250C, 0xA6A3, 0x250D, 0xA6C8, 0x250E, 0xA6C7, 0x250F, 0xA6AE, 0x2510, 0xA6A4, 0x2511, 0xA6C2, 0x2512, 0xA6C1, + 0x2513, 0xA6AF, 0x2514, 0xA6A6, 0x2515, 0xA6C6, 0x2516, 0xA6C5, 0x2517, 0xA6B1, 0x2518, 0xA6A5, 0x2519, 0xA6C4, 0x251A, 0xA6C3, + 0x251B, 0xA6B0, 0x251C, 0xA6A7, 0x251D, 0xA6BC, 0x251E, 0xA6C9, 0x251F, 0xA6CA, 0x2520, 0xA6B7, 0x2521, 0xA6CB, 0x2522, 0xA6CC, + 0x2523, 0xA6B2, 0x2524, 0xA6A9, 0x2525, 0xA6BE, 0x2526, 0xA6CD, 0x2527, 0xA6CE, 0x2528, 0xA6B9, 0x2529, 0xA6CF, 0x252A, 0xA6D0, + 0x252B, 0xA6B4, 0x252C, 0xA6A8, 0x252D, 0xA6D1, 0x252E, 0xA6D2, 0x252F, 0xA6B8, 0x2530, 0xA6BD, 0x2531, 0xA6D3, 0x2532, 0xA6D4, + 0x2533, 0xA6B3, 0x2534, 0xA6AA, 0x2535, 0xA6D5, 0x2536, 0xA6D6, 0x2537, 0xA6BA, 0x2538, 0xA6BF, 0x2539, 0xA6D7, 0x253A, 0xA6D8, + 0x253B, 0xA6B5, 0x253C, 0xA6AB, 0x253D, 0xA6D9, 0x253E, 0xA6DA, 0x253F, 0xA6BB, 0x2540, 0xA6DB, 0x2541, 0xA6DC, 0x2542, 0xA6C0, + 0x2543, 0xA6DD, 0x2544, 0xA6DE, 0x2545, 0xA6DF, 0x2546, 0xA6E0, 0x2547, 0xA6E1, 0x2548, 0xA6E2, 0x2549, 0xA6E3, 0x254A, 0xA6E4, + 0x254B, 0xA6B6, 0x2592, 0xA2C6, 0x25A0, 0xA1E1, 0x25A1, 0xA1E0, 0x25A3, 0xA2C3, 0x25A4, 0xA2C7, 0x25A5, 0xA2C8, 0x25A6, 0xA2CB, + 0x25A7, 0xA2CA, 0x25A8, 0xA2C9, 0x25A9, 0xA2CC, 0x25B2, 0xA1E3, 0x25B3, 0xA1E2, 0x25B6, 0xA2BA, 0x25B7, 0xA2B9, 0x25BC, 0xA1E5, + 0x25BD, 0xA1E4, 0x25C0, 0xA2B8, 0x25C1, 0xA2B7, 0x25C6, 0xA1DF, 0x25C7, 0xA1DE, 0x25C8, 0xA2C2, 0x25CB, 0xA1DB, 0x25CE, 0xA1DD, + 0x25CF, 0xA1DC, 0x25D0, 0xA2C4, 0x25D1, 0xA2C5, 0x2605, 0xA1DA, 0x2606, 0xA1D9, 0x260E, 0xA2CF, 0x260F, 0xA2CE, 0x261C, 0xA2D0, + 0x261E, 0xA2D1, 0x2640, 0xA1CF, 0x2642, 0xA1CE, 0x2660, 0xA2BC, 0x2661, 0xA2BD, 0x2663, 0xA2C0, 0x2664, 0xA2BB, 0x2665, 0xA2BE, + 0x2667, 0xA2BF, 0x2668, 0xA2CD, 0x2669, 0xA2DB, 0x266A, 0xA2DC, 0x266C, 0xA2DD, 0x266D, 0xA2DA, 0x3000, 0xA1A1, 0x3001, 0xA1A2, + 0x3002, 0xA1A3, 0x3003, 0xA1A8, 0x3008, 0xA1B4, 0x3009, 0xA1B5, 0x300A, 0xA1B6, 0x300B, 0xA1B7, 0x300C, 0xA1B8, 0x300D, 0xA1B9, + 0x300E, 0xA1BA, 0x300F, 0xA1BB, 0x3010, 0xA1BC, 0x3011, 0xA1BD, 0x3013, 0xA1EB, 0x3014, 0xA1B2, 0x3015, 0xA1B3, 0x3041, 0xAAA1, + 0x3042, 0xAAA2, 0x3043, 0xAAA3, 0x3044, 0xAAA4, 0x3045, 0xAAA5, 0x3046, 0xAAA6, 0x3047, 0xAAA7, 0x3048, 0xAAA8, 0x3049, 0xAAA9, + 0x304A, 0xAAAA, 0x304B, 0xAAAB, 0x304C, 0xAAAC, 0x304D, 0xAAAD, 0x304E, 0xAAAE, 0x304F, 0xAAAF, 0x3050, 0xAAB0, 0x3051, 0xAAB1, + 0x3052, 0xAAB2, 0x3053, 0xAAB3, 0x3054, 0xAAB4, 0x3055, 0xAAB5, 0x3056, 0xAAB6, 0x3057, 0xAAB7, 0x3058, 0xAAB8, 0x3059, 0xAAB9, + 0x305A, 0xAABA, 0x305B, 0xAABB, 0x305C, 0xAABC, 0x305D, 0xAABD, 0x305E, 0xAABE, 0x305F, 0xAABF, 0x3060, 0xAAC0, 0x3061, 0xAAC1, + 0x3062, 0xAAC2, 0x3063, 0xAAC3, 0x3064, 0xAAC4, 0x3065, 0xAAC5, 0x3066, 0xAAC6, 0x3067, 0xAAC7, 0x3068, 0xAAC8, 0x3069, 0xAAC9, + 0x306A, 0xAACA, 0x306B, 0xAACB, 0x306C, 0xAACC, 0x306D, 0xAACD, 0x306E, 0xAACE, 0x306F, 0xAACF, 0x3070, 0xAAD0, 0x3071, 0xAAD1, + 0x3072, 0xAAD2, 0x3073, 0xAAD3, 0x3074, 0xAAD4, 0x3075, 0xAAD5, 0x3076, 0xAAD6, 0x3077, 0xAAD7, 0x3078, 0xAAD8, 0x3079, 0xAAD9, + 0x307A, 0xAADA, 0x307B, 0xAADB, 0x307C, 0xAADC, 0x307D, 0xAADD, 0x307E, 0xAADE, 0x307F, 0xAADF, 0x3080, 0xAAE0, 0x3081, 0xAAE1, + 0x3082, 0xAAE2, 0x3083, 0xAAE3, 0x3084, 0xAAE4, 0x3085, 0xAAE5, 0x3086, 0xAAE6, 0x3087, 0xAAE7, 0x3088, 0xAAE8, 0x3089, 0xAAE9, + 0x308A, 0xAAEA, 0x308B, 0xAAEB, 0x308C, 0xAAEC, 0x308D, 0xAAED, 0x308E, 0xAAEE, 0x308F, 0xAAEF, 0x3090, 0xAAF0, 0x3091, 0xAAF1, + 0x3092, 0xAAF2, 0x3093, 0xAAF3, 0x30A1, 0xABA1, 0x30A2, 0xABA2, 0x30A3, 0xABA3, 0x30A4, 0xABA4, 0x30A5, 0xABA5, 0x30A6, 0xABA6, + 0x30A7, 0xABA7, 0x30A8, 0xABA8, 0x30A9, 0xABA9, 0x30AA, 0xABAA, 0x30AB, 0xABAB, 0x30AC, 0xABAC, 0x30AD, 0xABAD, 0x30AE, 0xABAE, + 0x30AF, 0xABAF, 0x30B0, 0xABB0, 0x30B1, 0xABB1, 0x30B2, 0xABB2, 0x30B3, 0xABB3, 0x30B4, 0xABB4, 0x30B5, 0xABB5, 0x30B6, 0xABB6, + 0x30B7, 0xABB7, 0x30B8, 0xABB8, 0x30B9, 0xABB9, 0x30BA, 0xABBA, 0x30BB, 0xABBB, 0x30BC, 0xABBC, 0x30BD, 0xABBD, 0x30BE, 0xABBE, + 0x30BF, 0xABBF, 0x30C0, 0xABC0, 0x30C1, 0xABC1, 0x30C2, 0xABC2, 0x30C3, 0xABC3, 0x30C4, 0xABC4, 0x30C5, 0xABC5, 0x30C6, 0xABC6, + 0x30C7, 0xABC7, 0x30C8, 0xABC8, 0x30C9, 0xABC9, 0x30CA, 0xABCA, 0x30CB, 0xABCB, 0x30CC, 0xABCC, 0x30CD, 0xABCD, 0x30CE, 0xABCE, + 0x30CF, 0xABCF, 0x30D0, 0xABD0, 0x30D1, 0xABD1, 0x30D2, 0xABD2, 0x30D3, 0xABD3, 0x30D4, 0xABD4, 0x30D5, 0xABD5, 0x30D6, 0xABD6, + 0x30D7, 0xABD7, 0x30D8, 0xABD8, 0x30D9, 0xABD9, 0x30DA, 0xABDA, 0x30DB, 0xABDB, 0x30DC, 0xABDC, 0x30DD, 0xABDD, 0x30DE, 0xABDE, + 0x30DF, 0xABDF, 0x30E0, 0xABE0, 0x30E1, 0xABE1, 0x30E2, 0xABE2, 0x30E3, 0xABE3, 0x30E4, 0xABE4, 0x30E5, 0xABE5, 0x30E6, 0xABE6, + 0x30E7, 0xABE7, 0x30E8, 0xABE8, 0x30E9, 0xABE9, 0x30EA, 0xABEA, 0x30EB, 0xABEB, 0x30EC, 0xABEC, 0x30ED, 0xABED, 0x30EE, 0xABEE, + 0x30EF, 0xABEF, 0x30F0, 0xABF0, 0x30F1, 0xABF1, 0x30F2, 0xABF2, 0x30F3, 0xABF3, 0x30F4, 0xABF4, 0x30F5, 0xABF5, 0x30F6, 0xABF6, + 0x3131, 0xA4A1, 0x3132, 0xA4A2, 0x3133, 0xA4A3, 0x3134, 0xA4A4, 0x3135, 0xA4A5, 0x3136, 0xA4A6, 0x3137, 0xA4A7, 0x3138, 0xA4A8, + 0x3139, 0xA4A9, 0x313A, 0xA4AA, 0x313B, 0xA4AB, 0x313C, 0xA4AC, 0x313D, 0xA4AD, 0x313E, 0xA4AE, 0x313F, 0xA4AF, 0x3140, 0xA4B0, + 0x3141, 0xA4B1, 0x3142, 0xA4B2, 0x3143, 0xA4B3, 0x3144, 0xA4B4, 0x3145, 0xA4B5, 0x3146, 0xA4B6, 0x3147, 0xA4B7, 0x3148, 0xA4B8, + 0x3149, 0xA4B9, 0x314A, 0xA4BA, 0x314B, 0xA4BB, 0x314C, 0xA4BC, 0x314D, 0xA4BD, 0x314E, 0xA4BE, 0x314F, 0xA4BF, 0x3150, 0xA4C0, + 0x3151, 0xA4C1, 0x3152, 0xA4C2, 0x3153, 0xA4C3, 0x3154, 0xA4C4, 0x3155, 0xA4C5, 0x3156, 0xA4C6, 0x3157, 0xA4C7, 0x3158, 0xA4C8, + 0x3159, 0xA4C9, 0x315A, 0xA4CA, 0x315B, 0xA4CB, 0x315C, 0xA4CC, 0x315D, 0xA4CD, 0x315E, 0xA4CE, 0x315F, 0xA4CF, 0x3160, 0xA4D0, + 0x3161, 0xA4D1, 0x3162, 0xA4D2, 0x3163, 0xA4D3, 0x3164, 0xA4D4, 0x3165, 0xA4D5, 0x3166, 0xA4D6, 0x3167, 0xA4D7, 0x3168, 0xA4D8, + 0x3169, 0xA4D9, 0x316A, 0xA4DA, 0x316B, 0xA4DB, 0x316C, 0xA4DC, 0x316D, 0xA4DD, 0x316E, 0xA4DE, 0x316F, 0xA4DF, 0x3170, 0xA4E0, + 0x3171, 0xA4E1, 0x3172, 0xA4E2, 0x3173, 0xA4E3, 0x3174, 0xA4E4, 0x3175, 0xA4E5, 0x3176, 0xA4E6, 0x3177, 0xA4E7, 0x3178, 0xA4E8, + 0x3179, 0xA4E9, 0x317A, 0xA4EA, 0x317B, 0xA4EB, 0x317C, 0xA4EC, 0x317D, 0xA4ED, 0x317E, 0xA4EE, 0x317F, 0xA4EF, 0x3180, 0xA4F0, + 0x3181, 0xA4F1, 0x3182, 0xA4F2, 0x3183, 0xA4F3, 0x3184, 0xA4F4, 0x3185, 0xA4F5, 0x3186, 0xA4F6, 0x3187, 0xA4F7, 0x3188, 0xA4F8, + 0x3189, 0xA4F9, 0x318A, 0xA4FA, 0x318B, 0xA4FB, 0x318C, 0xA4FC, 0x318D, 0xA4FD, 0x318E, 0xA4FE, 0x3200, 0xA9B1, 0x3201, 0xA9B2, + 0x3202, 0xA9B3, 0x3203, 0xA9B4, 0x3204, 0xA9B5, 0x3205, 0xA9B6, 0x3206, 0xA9B7, 0x3207, 0xA9B8, 0x3208, 0xA9B9, 0x3209, 0xA9BA, + 0x320A, 0xA9BB, 0x320B, 0xA9BC, 0x320C, 0xA9BD, 0x320D, 0xA9BE, 0x320E, 0xA9BF, 0x320F, 0xA9C0, 0x3210, 0xA9C1, 0x3211, 0xA9C2, + 0x3212, 0xA9C3, 0x3213, 0xA9C4, 0x3214, 0xA9C5, 0x3215, 0xA9C6, 0x3216, 0xA9C7, 0x3217, 0xA9C8, 0x3218, 0xA9C9, 0x3219, 0xA9CA, + 0x321A, 0xA9CB, 0x321B, 0xA9CC, 0x321C, 0xA2DF, 0x3260, 0xA8B1, 0x3261, 0xA8B2, 0x3262, 0xA8B3, 0x3263, 0xA8B4, 0x3264, 0xA8B5, + 0x3265, 0xA8B6, 0x3266, 0xA8B7, 0x3267, 0xA8B8, 0x3268, 0xA8B9, 0x3269, 0xA8BA, 0x326A, 0xA8BB, 0x326B, 0xA8BC, 0x326C, 0xA8BD, + 0x326D, 0xA8BE, 0x326E, 0xA8BF, 0x326F, 0xA8C0, 0x3270, 0xA8C1, 0x3271, 0xA8C2, 0x3272, 0xA8C3, 0x3273, 0xA8C4, 0x3274, 0xA8C5, + 0x3275, 0xA8C6, 0x3276, 0xA8C7, 0x3277, 0xA8C8, 0x3278, 0xA8C9, 0x3279, 0xA8CA, 0x327A, 0xA8CB, 0x327B, 0xA8CC, 0x327F, 0xA2DE, + 0x3380, 0xA7C9, 0x3381, 0xA7CA, 0x3382, 0xA7CB, 0x3383, 0xA7CC, 0x3384, 0xA7CD, 0x3388, 0xA7BA, 0x3389, 0xA7BB, 0x338A, 0xA7DC, + 0x338B, 0xA7DD, 0x338C, 0xA7DE, 0x338D, 0xA7B6, 0x338E, 0xA7B7, 0x338F, 0xA7B8, 0x3390, 0xA7D4, 0x3391, 0xA7D5, 0x3392, 0xA7D6, + 0x3393, 0xA7D7, 0x3394, 0xA7D8, 0x3395, 0xA7A1, 0x3396, 0xA7A2, 0x3397, 0xA7A3, 0x3398, 0xA7A5, 0x3399, 0xA7AB, 0x339A, 0xA7AC, + 0x339B, 0xA7AD, 0x339C, 0xA7AE, 0x339D, 0xA7AF, 0x339E, 0xA7B0, 0x339F, 0xA7B1, 0x33A0, 0xA7B2, 0x33A1, 0xA7B3, 0x33A2, 0xA7B4, + 0x33A3, 0xA7A7, 0x33A4, 0xA7A8, 0x33A5, 0xA7A9, 0x33A6, 0xA7AA, 0x33A7, 0xA7BD, 0x33A8, 0xA7BE, 0x33A9, 0xA7E5, 0x33AA, 0xA7E6, + 0x33AB, 0xA7E7, 0x33AC, 0xA7E8, 0x33AD, 0xA7E1, 0x33AE, 0xA7E2, 0x33AF, 0xA7E3, 0x33B0, 0xA7BF, 0x33B1, 0xA7C0, 0x33B2, 0xA7C1, + 0x33B3, 0xA7C2, 0x33B4, 0xA7C3, 0x33B5, 0xA7C4, 0x33B6, 0xA7C5, 0x33B7, 0xA7C6, 0x33B8, 0xA7C7, 0x33B9, 0xA7C8, 0x33BA, 0xA7CE, + 0x33BB, 0xA7CF, 0x33BC, 0xA7D0, 0x33BD, 0xA7D1, 0x33BE, 0xA7D2, 0x33BF, 0xA7D3, 0x33C0, 0xA7DA, 0x33C1, 0xA7DB, 0x33C2, 0xA2E3, + 0x33C3, 0xA7EC, 0x33C4, 0xA7A6, 0x33C5, 0xA7E0, 0x33C6, 0xA7EF, 0x33C7, 0xA2E1, 0x33C8, 0xA7BC, 0x33C9, 0xA7ED, 0x33CA, 0xA7B5, + 0x33CF, 0xA7B9, 0x33D0, 0xA7EA, 0x33D3, 0xA7EB, 0x33D6, 0xA7DF, 0x33D8, 0xA2E4, 0x33DB, 0xA7E4, 0x33DC, 0xA7EE, 0x33DD, 0xA7E9, + 0x4E00, 0xECE9, 0x4E01, 0xEFCB, 0x4E03, 0xF6D2, 0x4E07, 0xD8B2, 0x4E08, 0xEDDB, 0x4E09, 0xDFB2, 0x4E0A, 0xDFBE, 0x4E0B, 0xF9BB, + 0x4E0D, 0xDCF4, 0x4E11, 0xF5E4, 0x4E14, 0xF3A6, 0x4E15, 0xDDE0, 0x4E16, 0xE1A6, 0x4E18, 0xCEF8, 0x4E19, 0xDCB0, 0x4E1E, 0xE3AA, + 0x4E2D, 0xF1E9, 0x4E32, 0xCDFA, 0x4E38, 0xFCAF, 0x4E39, 0xD3A1, 0x4E3B, 0xF1AB, 0x4E42, 0xE7D1, 0x4E43, 0xD2AC, 0x4E45, 0xCEF9, + 0x4E4B, 0xF1FD, 0x4E4D, 0xDEBF, 0x4E4E, 0xFBBA, 0x4E4F, 0xF9B9, 0x4E56, 0xCED2, 0x4E58, 0xE3AB, 0x4E59, 0xEBE0, 0x4E5D, 0xCEFA, + 0x4E5E, 0xCBF7, 0x4E5F, 0xE5A5, 0x4E6B, 0xCAE1, 0x4E6D, 0xD4CC, 0x4E73, 0xEAE1, 0x4E76, 0xDCE3, 0x4E77, 0xDFAD, 0x4E7E, 0xCBEB, + 0x4E82, 0xD5AF, 0x4E86, 0xD6F5, 0x4E88, 0xE5F8, 0x4E8B, 0xDEC0, 0x4E8C, 0xECA3, 0x4E8E, 0xE9CD, 0x4E90, 0xEAA7, 0x4E91, 0xE9F6, + 0x4E92, 0xFBBB, 0x4E94, 0xE7E9, 0x4E95, 0xEFCC, 0x4E98, 0xD0E6, 0x4E9B, 0xDEC1, 0x4E9E, 0xE4AC, 0x4EA1, 0xD8CC, 0x4EA2, 0xF9F1, + 0x4EA4, 0xCEDF, 0x4EA5, 0xFAA4, 0x4EA6, 0xE6B2, 0x4EA8, 0xFAFB, 0x4EAB, 0xFABD, 0x4EAC, 0xCCC8, 0x4EAD, 0xEFCD, 0x4EAE, 0xD5D5, + 0x4EB6, 0xD3A2, 0x4EBA, 0xECD1, 0x4EC0, 0xE4A7, 0x4EC1, 0xECD2, 0x4EC4, 0xF6B1, 0x4EC7, 0xCEFB, 0x4ECA, 0xD0D1, 0x4ECB, 0xCBBF, + 0x4ECD, 0xEDA4, 0x4ED4, 0xEDA8, 0x4ED5, 0xDEC2, 0x4ED6, 0xF6E2, 0x4ED7, 0xEDDC, 0x4ED8, 0xDCF5, 0x4ED9, 0xE0B9, 0x4EDD, 0xD4CE, + 0x4EDF, 0xF4B5, 0x4EE3, 0xD3DB, 0x4EE4, 0xD6B5, 0x4EE5, 0xECA4, 0x4EF0, 0xE4E6, 0x4EF2, 0xF1EA, 0x4EF6, 0xCBEC, 0x4EF7, 0xCBC0, + 0x4EFB, 0xECF2, 0x4F01, 0xD0EA, 0x4F09, 0xF9F2, 0x4F0A, 0xECA5, 0x4F0B, 0xD0DF, 0x4F0D, 0xE7EA, 0x4F0E, 0xD0EB, 0x4F0F, 0xDCD1, + 0x4F10, 0xDBE9, 0x4F11, 0xFDCC, 0x4F2F, 0xDBD7, 0x4F34, 0xDAE1, 0x4F36, 0xD6B6, 0x4F38, 0xE3DF, 0x4F3A, 0xDEC3, 0x4F3C, 0xDEC4, + 0x4F3D, 0xCAA1, 0x4F43, 0xEEEC, 0x4F46, 0xD3A3, 0x4F47, 0xEEB7, 0x4F48, 0xF8CF, 0x4F4D, 0xEAC8, 0x4F4E, 0xEEB8, 0x4F4F, 0xF1AC, + 0x4F50, 0xF1A5, 0x4F51, 0xE9CE, 0x4F55, 0xF9BC, 0x4F59, 0xE5F9, 0x4F5A, 0xECEA, 0x4F5B, 0xDDD6, 0x4F5C, 0xEDC2, 0x4F69, 0xF8A5, + 0x4F6F, 0xE5BA, 0x4F70, 0xDBD8, 0x4F73, 0xCAA2, 0x4F76, 0xD1CD, 0x4F7A, 0xEEED, 0x4F7E, 0xECEB, 0x4F7F, 0xDEC5, 0x4F81, 0xE3E0, + 0x4F83, 0xCAC9, 0x4F84, 0xF2E9, 0x4F86, 0xD5CE, 0x4F88, 0xF6B6, 0x4F8A, 0xCEC2, 0x4F8B, 0xD6C7, 0x4F8D, 0xE3B4, 0x4F8F, 0xF1AD, + 0x4F91, 0xEAE2, 0x4F96, 0xD7C2, 0x4F98, 0xF3A7, 0x4F9B, 0xCDEA, 0x4F9D, 0xEBEE, 0x4FAE, 0xD9B2, 0x4FAF, 0xFDA5, 0x4FB5, 0xF6D5, + 0x4FB6, 0xD5E2, 0x4FBF, 0xF8B5, 0x4FC2, 0xCCF5, 0x4FC3, 0xF5B5, 0x4FC4, 0xE4AD, 0x4FC9, 0xE7EB, 0x4FCA, 0xF1D5, 0x4FCE, 0xF0BB, + 0x4FD1, 0xE9B5, 0x4FD3, 0xCCC9, 0x4FD4, 0xFAD5, 0x4FD7, 0xE1D4, 0x4FDA, 0xD7D6, 0x4FDD, 0xDCC1, 0x4FDF, 0xDEC6, 0x4FE0, 0xFAEF, + 0x4FE1, 0xE3E1, 0x4FEE, 0xE1F3, 0x4FEF, 0xDCF6, 0x4FF1, 0xCEFC, 0x4FF3, 0xDBC4, 0x4FF5, 0xF8F1, 0x4FF8, 0xDCE4, 0x4FFA, 0xE5EF, + 0x5002, 0xDCB1, 0x5006, 0xD5D6, 0x5009, 0xF3DA, 0x500B, 0xCBC1, 0x500D, 0xDBC3, 0x5011, 0xD9FA, 0x5012, 0xD3EE, 0x5016, 0xFAB8, + 0x5019, 0xFDA6, 0x501A, 0xEBEF, 0x501C, 0xF4A6, 0x501E, 0xCCCA, 0x501F, 0xF3A8, 0x5021, 0xF3DB, 0x5023, 0xDBA7, 0x5024, 0xF6B7, + 0x5026, 0xCFE6, 0x5027, 0xF0F2, 0x5028, 0xCBDA, 0x502A, 0xE7D2, 0x502B, 0xD7C3, 0x502C, 0xF6F0, 0x502D, 0xE8DE, 0x503B, 0xE5A6, + 0x5043, 0xE5E7, 0x5047, 0xCAA3, 0x5048, 0xCCA7, 0x5049, 0xEAC9, 0x504F, 0xF8B6, 0x5055, 0xFAA5, 0x505A, 0xF1AE, 0x505C, 0xEFCE, + 0x5065, 0xCBED, 0x5074, 0xF6B0, 0x5075, 0xEFCF, 0x5076, 0xE9CF, 0x5078, 0xF7DE, 0x5080, 0xCED3, 0x5085, 0xDCF7, 0x508D, 0xDBA8, + 0x5091, 0xCBF8, 0x5098, 0xDFA1, 0x5099, 0xDDE1, 0x50AC, 0xF5CA, 0x50AD, 0xE9B6, 0x50B2, 0xE7EC, 0x50B3, 0xEEEE, 0x50B5, 0xF3F0, + 0x50B7, 0xDFBF, 0x50BE, 0xCCCB, 0x50C5, 0xD0C1, 0x50C9, 0xF4D2, 0x50CA, 0xE0BA, 0x50CF, 0xDFC0, 0x50D1, 0xCEE0, 0x50D5, 0xDCD2, + 0x50D6, 0xFDEA, 0x50DA, 0xD6F6, 0x50DE, 0xEACA, 0x50E5, 0xE8E9, 0x50E7, 0xE3AC, 0x50ED, 0xF3D0, 0x50F9, 0xCAA4, 0x50FB, 0xDBF8, + 0x50FF, 0xDEC7, 0x5100, 0xEBF0, 0x5101, 0xF1D6, 0x5104, 0xE5E2, 0x5106, 0xCCCC, 0x5109, 0xCBFB, 0x5112, 0xEAE3, 0x511F, 0xDFC1, + 0x5121, 0xD6ED, 0x512A, 0xE9D0, 0x5132, 0xEEB9, 0x5137, 0xD5E3, 0x513A, 0xD1D3, 0x513C, 0xE5F0, 0x5140, 0xE8B4, 0x5141, 0xEBC3, + 0x5143, 0xEAAA, 0x5144, 0xFAFC, 0x5145, 0xF5F6, 0x5146, 0xF0BC, 0x5147, 0xFDD4, 0x5148, 0xE0BB, 0x5149, 0xCEC3, 0x514B, 0xD0BA, + 0x514C, 0xF7BA, 0x514D, 0xD8F3, 0x514E, 0xF7CD, 0x5152, 0xE4AE, 0x515C, 0xD4DF, 0x5162, 0xD0E7, 0x5165, 0xECFD, 0x5167, 0xD2AE, + 0x5168, 0xEEEF, 0x5169, 0xD5D7, 0x516A, 0xEAE4, 0x516B, 0xF8A2, 0x516C, 0xCDEB, 0x516D, 0xD7BF, 0x516E, 0xFBB1, 0x5171, 0xCDEC, + 0x5175, 0xDCB2, 0x5176, 0xD0EC, 0x5177, 0xCEFD, 0x5178, 0xEEF0, 0x517C, 0xCCC2, 0x5180, 0xD0ED, 0x5186, 0xE5F7, 0x518A, 0xF3FC, + 0x518D, 0xEEA2, 0x5192, 0xD9B3, 0x5195, 0xD8F4, 0x5197, 0xE9B7, 0x51A0, 0xCEAE, 0x51A5, 0xD9A2, 0x51AA, 0xD8F1, 0x51AC, 0xD4CF, + 0x51B6, 0xE5A7, 0x51B7, 0xD5D2, 0x51BD, 0xD6A9, 0x51C4, 0xF4A2, 0x51C6, 0xF1D7, 0x51C9, 0xD5D8, 0x51CB, 0xF0BD, 0x51CC, 0xD7D0, + 0x51CD, 0xD4D0, 0x51DC, 0xD7CF, 0x51DD, 0xEBEA, 0x51DE, 0xFDEB, 0x51E1, 0xDBED, 0x51F0, 0xFCC5, 0x51F1, 0xCBC2, 0x51F6, 0xFDD5, + 0x51F8, 0xF4C8, 0x51F9, 0xE8EA, 0x51FA, 0xF5F3, 0x51FD, 0xF9DE, 0x5200, 0xD3EF, 0x5203, 0xECD3, 0x5206, 0xDDC2, 0x5207, 0xEFB7, + 0x5208, 0xE7D4, 0x520A, 0xCACA, 0x520E, 0xD9FB, 0x5211, 0xFAFD, 0x5217, 0xD6AA, 0x521D, 0xF4F8, 0x5224, 0xF7F7, 0x5225, 0xDCAC, + 0x5229, 0xD7D7, 0x522A, 0xDFA2, 0x522E, 0xCEBE, 0x5230, 0xD3F0, 0x5236, 0xF0A4, 0x5237, 0xE1EC, 0x5238, 0xCFE7, 0x5239, 0xF3CB, + 0x523A, 0xEDA9, 0x523B, 0xCABE, 0x5243, 0xF4EF, 0x5247, 0xF6CE, 0x524A, 0xDEFB, 0x524B, 0xD0BB, 0x524C, 0xD5B7, 0x524D, 0xEEF1, + 0x5254, 0xF4A8, 0x5256, 0xDCF8, 0x525B, 0xCBA7, 0x525D, 0xDACE, 0x5261, 0xE0E6, 0x5269, 0xEDA5, 0x526A, 0xEEF2, 0x526F, 0xDCF9, + 0x5272, 0xF9DC, 0x5275, 0xF3DC, 0x527D, 0xF8F2, 0x527F, 0xF4F9, 0x5283, 0xFCF1, 0x5287, 0xD0BC, 0x5288, 0xDBF9, 0x5289, 0xD7B1, + 0x528D, 0xCBFC, 0x5291, 0xF0A5, 0x5292, 0xCBFD, 0x529B, 0xD5F4, 0x529F, 0xCDED, 0x52A0, 0xCAA5, 0x52A3, 0xD6AB, 0x52A4, 0xD0C2, + 0x52A9, 0xF0BE, 0x52AA, 0xD2BD, 0x52AB, 0xCCA4, 0x52BE, 0xFAB6, 0x52C1, 0xCCCD, 0x52C3, 0xDAFA, 0x52C5, 0xF6CF, 0x52C7, 0xE9B8, + 0x52C9, 0xD8F5, 0x52CD, 0xCCCE, 0x52D2, 0xD7CD, 0x52D5, 0xD4D1, 0x52D6, 0xE9ED, 0x52D8, 0xCAEB, 0x52D9, 0xD9E2, 0x52DB, 0xFDB2, + 0x52DD, 0xE3AD, 0x52DE, 0xD6CC, 0x52DF, 0xD9B4, 0x52E2, 0xE1A7, 0x52E3, 0xEED3, 0x52E4, 0xD0C3, 0x52F3, 0xFDB3, 0x52F5, 0xD5E4, + 0x52F8, 0xCFE8, 0x52FA, 0xEDC3, 0x52FB, 0xD0B2, 0x52FE, 0xCEFE, 0x52FF, 0xDAA8, 0x5305, 0xF8D0, 0x5308, 0xFDD6, 0x530D, 0xF8D1, + 0x530F, 0xF8D2, 0x5310, 0xDCD3, 0x5315, 0xDDE2, 0x5316, 0xFBF9, 0x5317, 0xDDC1, 0x5319, 0xE3B5, 0x5320, 0xEDDD, 0x5321, 0xCEC4, + 0x5323, 0xCBA1, 0x532A, 0xDDE3, 0x532F, 0xFCDD, 0x5339, 0xF9AF, 0x533F, 0xD2FB, 0x5340, 0xCFA1, 0x5341, 0xE4A8, 0x5343, 0xF4B6, + 0x5344, 0xECFE, 0x5347, 0xE3AE, 0x5348, 0xE7ED, 0x5349, 0xFDC1, 0x534A, 0xDAE2, 0x534D, 0xD8B3, 0x5351, 0xDDE4, 0x5352, 0xF0EF, + 0x5353, 0xF6F1, 0x5354, 0xFAF0, 0x5357, 0xD1F5, 0x535A, 0xDACF, 0x535C, 0xDCD4, 0x535E, 0xDCA6, 0x5360, 0xEFBF, 0x5366, 0xCECF, + 0x5368, 0xE0D9, 0x536F, 0xD9D6, 0x5370, 0xECD4, 0x5371, 0xEACB, 0x5374, 0xCABF, 0x5375, 0xD5B0, 0x5377, 0xCFE9, 0x537D, 0xF1ED, + 0x537F, 0xCCCF, 0x5384, 0xE4F8, 0x5393, 0xE4ED, 0x5398, 0xD7D8, 0x539A, 0xFDA7, 0x539F, 0xEAAB, 0x53A0, 0xF6B2, 0x53A5, 0xCFF0, + 0x53A6, 0xF9BD, 0x53AD, 0xE6F4, 0x53BB, 0xCBDB, 0x53C3, 0xF3D1, 0x53C8, 0xE9D1, 0x53C9, 0xF3A9, 0x53CA, 0xD0E0, 0x53CB, 0xE9D2, + 0x53CD, 0xDAE3, 0x53D4, 0xE2D2, 0x53D6, 0xF6A2, 0x53D7, 0xE1F4, 0x53DB, 0xDAE4, 0x53E1, 0xE7D5, 0x53E2, 0xF5BF, 0x53E3, 0xCFA2, + 0x53E4, 0xCDAF, 0x53E5, 0xCFA3, 0x53E9, 0xCDB0, 0x53EA, 0xF1FE, 0x53EB, 0xD0A3, 0x53EC, 0xE1AF, 0x53ED, 0xF8A3, 0x53EF, 0xCAA6, + 0x53F0, 0xF7BB, 0x53F1, 0xF2EA, 0x53F2, 0xDEC8, 0x53F3, 0xE9D3, 0x53F8, 0xDEC9, 0x5403, 0xFDDE, 0x5404, 0xCAC0, 0x5408, 0xF9EA, + 0x5409, 0xD1CE, 0x540A, 0xEED4, 0x540C, 0xD4D2, 0x540D, 0xD9A3, 0x540E, 0xFDA8, 0x540F, 0xD7D9, 0x5410, 0xF7CE, 0x5411, 0xFABE, + 0x541B, 0xCFD6, 0x541D, 0xD7F0, 0x541F, 0xEBE1, 0x5420, 0xF8C5, 0x5426, 0xDCFA, 0x5429, 0xDDC3, 0x542B, 0xF9DF, 0x5433, 0xE7EF, + 0x5438, 0xFDE5, 0x5439, 0xF6A3, 0x543B, 0xD9FC, 0x543C, 0xFDA9, 0x543E, 0xE7EE, 0x5442, 0xD5E5, 0x5448, 0xEFD0, 0x544A, 0xCDB1, + 0x5451, 0xF7A2, 0x5468, 0xF1B2, 0x546A, 0xF1B1, 0x5471, 0xCDB2, 0x5473, 0xDAAB, 0x5475, 0xCAA7, 0x547B, 0xE3E2, 0x547C, 0xFBBC, + 0x547D, 0xD9A4, 0x5480, 0xEEBA, 0x5486, 0xF8D3, 0x548C, 0xFBFA, 0x548E, 0xCFA4, 0x5490, 0xDCFB, 0x54A4, 0xF6E3, 0x54A8, 0xEDAA, + 0x54AB, 0xF2A1, 0x54AC, 0xCEE1, 0x54B3, 0xFAA6, 0x54B8, 0xF9E0, 0x54BD, 0xECD6, 0x54C0, 0xE4EE, 0x54C1, 0xF9A1, 0x54C4, 0xFBEF, + 0x54C8, 0xF9EB, 0x54C9, 0xEEA3, 0x54E1, 0xEAAC, 0x54E5, 0xCAA8, 0x54E8, 0xF4FA, 0x54ED, 0xCDD6, 0x54EE, 0xFCF6, 0x54F2, 0xF4C9, + 0x54FA, 0xF8D4, 0x5504, 0xF8A6, 0x5506, 0xDECA, 0x5507, 0xF2C6, 0x550E, 0xD7DA, 0x5510, 0xD3D0, 0x551C, 0xD8C5, 0x552F, 0xEAE6, + 0x5531, 0xF3DD, 0x5535, 0xE4DA, 0x553E, 0xF6E4, 0x5544, 0xF6F2, 0x5546, 0xDFC2, 0x554F, 0xD9FD, 0x5553, 0xCCF6, 0x5556, 0xD3BA, + 0x555E, 0xE4AF, 0x5563, 0xF9E1, 0x557C, 0xF0A6, 0x5580, 0xCBD3, 0x5584, 0xE0BC, 0x5586, 0xF4CA, 0x5587, 0xD4FA, 0x5589, 0xFDAA, + 0x558A, 0xF9E2, 0x5598, 0xF4B7, 0x5599, 0xFDC2, 0x559A, 0xFCB0, 0x559C, 0xFDEC, 0x559D, 0xCAE2, 0x55A7, 0xFDBD, 0x55A9, 0xEAE7, + 0x55AA, 0xDFC3, 0x55AB, 0xD1D2, 0x55AC, 0xCEE2, 0x55AE, 0xD3A4, 0x55C5, 0xFDAB, 0x55C7, 0xDFE0, 0x55D4, 0xF2C7, 0x55DA, 0xE7F0, + 0x55DC, 0xD0EE, 0x55DF, 0xF3AA, 0x55E3, 0xDECB, 0x55E4, 0xF6B8, 0x55FD, 0xE1F5, 0x55FE, 0xF1B3, 0x5606, 0xF7A3, 0x5609, 0xCAA9, + 0x5614, 0xCFA5, 0x5617, 0xDFC4, 0x562F, 0xE1B0, 0x5632, 0xF0BF, 0x5634, 0xF6A4, 0x5636, 0xE3B6, 0x5653, 0xFAC6, 0x5668, 0xD0EF, + 0x566B, 0xFDED, 0x5674, 0xDDC4, 0x5686, 0xFCF7, 0x56A5, 0xE6BF, 0x56AC, 0xDEAD, 0x56AE, 0xFABF, 0x56B4, 0xE5F1, 0x56BC, 0xEDC4, + 0x56CA, 0xD2A5, 0x56CD, 0xFDEE, 0x56D1, 0xF5B6, 0x56DA, 0xE1F6, 0x56DB, 0xDECC, 0x56DE, 0xFCDE, 0x56E0, 0xECD7, 0x56F0, 0xCDDD, + 0x56F9, 0xD6B7, 0x56FA, 0xCDB3, 0x5703, 0xF8D5, 0x5704, 0xE5D8, 0x5708, 0xCFEA, 0x570B, 0xCFD0, 0x570D, 0xEACC, 0x5712, 0xEAAE, + 0x5713, 0xEAAD, 0x5716, 0xD3F1, 0x5718, 0xD3A5, 0x571F, 0xF7CF, 0x5728, 0xEEA4, 0x572D, 0xD0A4, 0x5730, 0xF2A2, 0x573B, 0xD0F0, + 0x5740, 0xF2A3, 0x5742, 0xF7F8, 0x5747, 0xD0B3, 0x574A, 0xDBA9, 0x574D, 0xD3BB, 0x574E, 0xCAEC, 0x5750, 0xF1A6, 0x5751, 0xCBD5, + 0x5761, 0xF7E7, 0x5764, 0xCDDE, 0x5766, 0xF7A4, 0x576A, 0xF8C0, 0x576E, 0xD3DD, 0x5770, 0xCCD0, 0x5775, 0xCFA6, 0x577C, 0xF6F3, + 0x5782, 0xE1F7, 0x5788, 0xD3DC, 0x578B, 0xFAFE, 0x5793, 0xFAA7, 0x57A0, 0xEBD9, 0x57A2, 0xCFA7, 0x57A3, 0xEAAF, 0x57C3, 0xE4EF, + 0x57C7, 0xE9B9, 0x57C8, 0xF1D8, 0x57CB, 0xD8D8, 0x57CE, 0xE0F2, 0x57DF, 0xE6B4, 0x57E0, 0xDCFC, 0x57F0, 0xF3F1, 0x57F4, 0xE3D0, + 0x57F7, 0xF2FB, 0x57F9, 0xDBC6, 0x57FA, 0xD0F1, 0x57FC, 0xD0F2, 0x5800, 0xCFDC, 0x5802, 0xD3D1, 0x5805, 0xCCB1, 0x5806, 0xF7D8, + 0x5808, 0xCBA8, 0x5809, 0xEBBC, 0x580A, 0xE4BE, 0x581E, 0xF4DC, 0x5821, 0xDCC2, 0x5824, 0xF0A7, 0x5827, 0xE6C0, 0x582A, 0xCAED, + 0x582F, 0xE8EB, 0x5830, 0xE5E8, 0x5831, 0xDCC3, 0x5834, 0xEDDE, 0x5835, 0xD3F2, 0x583A, 0xCCF7, 0x584A, 0xCED4, 0x584B, 0xE7AB, + 0x584F, 0xCBC3, 0x5851, 0xE1B1, 0x5854, 0xF7B2, 0x5857, 0xD3F3, 0x5858, 0xD3D2, 0x585A, 0xF5C0, 0x585E, 0xDFDD, 0x5861, 0xEEF3, + 0x5862, 0xE7F1, 0x5864, 0xFDB4, 0x5875, 0xF2C8, 0x5879, 0xF3D2, 0x587C, 0xEEF4, 0x587E, 0xE2D3, 0x5883, 0xCCD1, 0x5885, 0xDFEA, + 0x5889, 0xE9BA, 0x5893, 0xD9D7, 0x589C, 0xF5CD, 0x589E, 0xF1F2, 0x589F, 0xFAC7, 0x58A8, 0xD9F8, 0x58A9, 0xD4C2, 0x58AE, 0xF6E5, + 0x58B3, 0xDDC5, 0x58BA, 0xE7F2, 0x58BB, 0xEDDF, 0x58BE, 0xCACB, 0x58C1, 0xDBFA, 0x58C5, 0xE8B5, 0x58C7, 0xD3A6, 0x58CE, 0xFDB5, + 0x58D1, 0xF9C9, 0x58D3, 0xE4E2, 0x58D5, 0xFBBD, 0x58D8, 0xD7A4, 0x58D9, 0xCEC5, 0x58DE, 0xCED5, 0x58DF, 0xD6E6, 0x58E4, 0xE5BD, + 0x58EB, 0xDECD, 0x58EC, 0xECF3, 0x58EF, 0xEDE0, 0x58F9, 0xECEC, 0x58FA, 0xFBBE, 0x58FB, 0xDFEB, 0x58FD, 0xE1F8, 0x590F, 0xF9BE, + 0x5914, 0xD0F3, 0x5915, 0xE0AA, 0x5916, 0xE8E2, 0x5919, 0xE2D4, 0x591A, 0xD2FD, 0x591C, 0xE5A8, 0x5922, 0xD9D3, 0x5927, 0xD3DE, + 0x5929, 0xF4B8, 0x592A, 0xF7BC, 0x592B, 0xDCFD, 0x592D, 0xE8EC, 0x592E, 0xE4E7, 0x5931, 0xE3F7, 0x5937, 0xECA8, 0x593E, 0xFAF1, + 0x5944, 0xE5F2, 0x5947, 0xD0F4, 0x5948, 0xD2AF, 0x5949, 0xDCE5, 0x594E, 0xD0A5, 0x594F, 0xF1B4, 0x5950, 0xFCB1, 0x5951, 0xCCF8, + 0x5954, 0xDDC6, 0x5955, 0xFAD1, 0x5957, 0xF7DF, 0x595A, 0xFAA8, 0x5960, 0xEEF5, 0x5962, 0xDECE, 0x5967, 0xE7F3, 0x596A, 0xF7AC, + 0x596B, 0xEBC4, 0x596C, 0xEDE1, 0x596D, 0xE0AB, 0x596E, 0xDDC7, 0x5973, 0xD2B3, 0x5974, 0xD2BF, 0x5978, 0xCACC, 0x597D, 0xFBBF, + 0x5982, 0xE5FD, 0x5983, 0xDDE5, 0x5984, 0xD8CD, 0x598A, 0xECF4, 0x5993, 0xD0F5, 0x5996, 0xE8ED, 0x5997, 0xD0D2, 0x5999, 0xD9D8, + 0x59A5, 0xF6E6, 0x59A8, 0xDBAA, 0x59AC, 0xF7E0, 0x59B9, 0xD8D9, 0x59BB, 0xF4A3, 0x59BE, 0xF4DD, 0x59C3, 0xEFD1, 0x59C6, 0xD9B5, + 0x59C9, 0xEDAB, 0x59CB, 0xE3B7, 0x59D0, 0xEEBB, 0x59D1, 0xCDB4, 0x59D3, 0xE0F3, 0x59D4, 0xEACD, 0x59D9, 0xECF5, 0x59DA, 0xE8EE, + 0x59DC, 0xCBA9, 0x59DD, 0xF1AF, 0x59E6, 0xCACD, 0x59E8, 0xECA9, 0x59EA, 0xF2EB, 0x59EC, 0xFDEF, 0x59EE, 0xF9F3, 0x59F8, 0xE6C1, + 0x59FB, 0xECD8, 0x59FF, 0xEDAC, 0x5A01, 0xEACE, 0x5A03, 0xE8DF, 0x5A11, 0xDECF, 0x5A18, 0xD2A6, 0x5A1B, 0xE7F4, 0x5A1C, 0xD1D6, + 0x5A1F, 0xE6C2, 0x5A20, 0xE3E3, 0x5A25, 0xE4B0, 0x5A29, 0xD8B4, 0x5A36, 0xF6A5, 0x5A3C, 0xF3DE, 0x5A41, 0xD7A5, 0x5A46, 0xF7E8, + 0x5A49, 0xE8C6, 0x5A5A, 0xFBE6, 0x5A62, 0xDDE6, 0x5A66, 0xDCFE, 0x5A92, 0xD8DA, 0x5A9A, 0xDAAC, 0x5A9B, 0xEAB0, 0x5AA4, 0xE3B8, + 0x5AC1, 0xCAAA, 0x5AC2, 0xE1F9, 0x5AC4, 0xEAB1, 0x5AC9, 0xF2EC, 0x5ACC, 0xFAEE, 0x5AE1, 0xEED5, 0x5AE6, 0xF9F4, 0x5AE9, 0xD2EC, + 0x5B05, 0xFBFB, 0x5B09, 0xFDF0, 0x5B0B, 0xE0BD, 0x5B0C, 0xCEE3, 0x5B16, 0xF8C6, 0x5B2A, 0xDEAE, 0x5B40, 0xDFC5, 0x5B43, 0xE5BE, + 0x5B50, 0xEDAD, 0x5B51, 0xFAEA, 0x5B54, 0xCDEE, 0x5B55, 0xEDA6, 0x5B57, 0xEDAE, 0x5B58, 0xF0ED, 0x5B5A, 0xDDA1, 0x5B5C, 0xEDAF, + 0x5B5D, 0xFCF8, 0x5B5F, 0xD8EB, 0x5B63, 0xCCF9, 0x5B64, 0xCDB5, 0x5B69, 0xFAA9, 0x5B6B, 0xE1DD, 0x5B70, 0xE2D5, 0x5B71, 0xEDCF, + 0x5B75, 0xDDA2, 0x5B78, 0xF9CA, 0x5B7A, 0xEAE8, 0x5B7C, 0xE5ED, 0x5B85, 0xD3EB, 0x5B87, 0xE9D4, 0x5B88, 0xE1FA, 0x5B89, 0xE4CC, + 0x5B8B, 0xE1E4, 0x5B8C, 0xE8C7, 0x5B8F, 0xCEDB, 0x5B93, 0xDCD5, 0x5B95, 0xF7B5, 0x5B96, 0xFCF3, 0x5B97, 0xF0F3, 0x5B98, 0xCEAF, + 0x5B99, 0xF1B5, 0x5B9A, 0xEFD2, 0x5B9B, 0xE8C8, 0x5B9C, 0xEBF1, 0x5BA2, 0xCBD4, 0x5BA3, 0xE0BE, 0x5BA4, 0xE3F8, 0x5BA5, 0xEAE9, + 0x5BA6, 0xFCB2, 0x5BAC, 0xE0F4, 0x5BAE, 0xCFE0, 0x5BB0, 0xEEA5, 0x5BB3, 0xFAAA, 0x5BB4, 0xE6C3, 0x5BB5, 0xE1B2, 0x5BB6, 0xCAAB, + 0x5BB8, 0xE3E4, 0x5BB9, 0xE9BB, 0x5BBF, 0xE2D6, 0x5BC0, 0xF3F2, 0x5BC2, 0xEED6, 0x5BC3, 0xEAB2, 0x5BC4, 0xD0F6, 0x5BC5, 0xECD9, + 0x5BC6, 0xDACB, 0x5BC7, 0xCFA8, 0x5BCC, 0xDDA3, 0x5BD0, 0xD8DB, 0x5BD2, 0xF9CE, 0x5BD3, 0xE9D5, 0x5BD4, 0xE3D1, 0x5BD7, 0xD2BC, + 0x5BDE, 0xD8AC, 0x5BDF, 0xF3CC, 0x5BE1, 0xCDFB, 0x5BE2, 0xF6D6, 0x5BE4, 0xE7F5, 0x5BE5, 0xE8EF, 0x5BE6, 0xE3F9, 0x5BE7, 0xD2BB, + 0x5BE8, 0xF3F3, 0x5BE9, 0xE3FB, 0x5BEB, 0xDED0, 0x5BEC, 0xCEB0, 0x5BEE, 0xD6F7, 0x5BEF, 0xF1D9, 0x5BF5, 0xF5C1, 0x5BF6, 0xDCC4, + 0x5BF8, 0xF5BB, 0x5BFA, 0xDED1, 0x5C01, 0xDCE6, 0x5C04, 0xDED2, 0x5C07, 0xEDE2, 0x5C08, 0xEEF6, 0x5C09, 0xEACF, 0x5C0A, 0xF0EE, + 0x5C0B, 0xE3FC, 0x5C0D, 0xD3DF, 0x5C0E, 0xD3F4, 0x5C0F, 0xE1B3, 0x5C11, 0xE1B4, 0x5C16, 0xF4D3, 0x5C19, 0xDFC6, 0x5C24, 0xE9D6, + 0x5C28, 0xDBAB, 0x5C31, 0xF6A6, 0x5C38, 0xE3B9, 0x5C39, 0xEBC5, 0x5C3A, 0xF4A9, 0x5C3B, 0xCDB6, 0x5C3C, 0xD2F9, 0x5C3E, 0xDAAD, + 0x5C3F, 0xD2E3, 0x5C40, 0xCFD1, 0x5C45, 0xCBDC, 0x5C46, 0xCCFA, 0x5C48, 0xCFDD, 0x5C4B, 0xE8A9, 0x5C4D, 0xE3BB, 0x5C4E, 0xE3BA, + 0x5C51, 0xE0DA, 0x5C55, 0xEEF7, 0x5C5B, 0xDCB3, 0x5C60, 0xD3F5, 0x5C62, 0xD7A6, 0x5C64, 0xF6B5, 0x5C65, 0xD7DB, 0x5C6C, 0xE1D5, + 0x5C6F, 0xD4EA, 0x5C71, 0xDFA3, 0x5C79, 0xFDDF, 0x5C90, 0xD0F7, 0x5C91, 0xEDD4, 0x5CA1, 0xCBAA, 0x5CA9, 0xE4DB, 0x5CAB, 0xE1FB, + 0x5CAC, 0xCBA2, 0x5CB1, 0xD3E0, 0x5CB3, 0xE4BF, 0x5CB5, 0xFBC0, 0x5CB7, 0xDABE, 0x5CB8, 0xE4CD, 0x5CBA, 0xD6B9, 0x5CBE, 0xEFC0, + 0x5CC0, 0xE1FC, 0x5CD9, 0xF6B9, 0x5CE0, 0xDFC7, 0x5CE8, 0xE4B1, 0x5CEF, 0xDCE7, 0x5CF0, 0xDCE8, 0x5CF4, 0xFAD6, 0x5CF6, 0xD3F6, + 0x5CFB, 0xF1DA, 0x5CFD, 0xFAF2, 0x5D07, 0xE2FD, 0x5D0D, 0xD5CF, 0x5D0E, 0xD0F8, 0x5D11, 0xCDDF, 0x5D14, 0xF5CB, 0x5D16, 0xE4F0, + 0x5D17, 0xCBAB, 0x5D19, 0xD7C4, 0x5D27, 0xE2FE, 0x5D29, 0xDDDA, 0x5D4B, 0xDAAE, 0x5D4C, 0xCAEE, 0x5D50, 0xD5B9, 0x5D69, 0xE3A1, + 0x5D6C, 0xE8E3, 0x5D6F, 0xF3AB, 0x5D87, 0xCFA9, 0x5D8B, 0xD3F7, 0x5D9D, 0xD4F1, 0x5DA0, 0xCEE4, 0x5DA2, 0xE8F2, 0x5DAA, 0xE5F5, + 0x5DB8, 0xE7AE, 0x5DBA, 0xD6BA, 0x5DBC, 0xDFEC, 0x5DBD, 0xE4C0, 0x5DCD, 0xE8E4, 0x5DD2, 0xD8B5, 0x5DD6, 0xE4DC, 0x5DDD, 0xF4B9, + 0x5DDE, 0xF1B6, 0x5DE1, 0xE2DE, 0x5DE2, 0xE1B5, 0x5DE5, 0xCDEF, 0x5DE6, 0xF1A7, 0x5DE7, 0xCEE5, 0x5DE8, 0xCBDD, 0x5DEB, 0xD9E3, + 0x5DEE, 0xF3AC, 0x5DF1, 0xD0F9, 0x5DF2, 0xECAB, 0x5DF3, 0xDED3, 0x5DF4, 0xF7E9, 0x5DF7, 0xF9F5, 0x5DFD, 0xE1DE, 0x5DFE, 0xCBEE, + 0x5E02, 0xE3BC, 0x5E03, 0xF8D6, 0x5E06, 0xDBEE, 0x5E0C, 0xFDF1, 0x5E11, 0xF7B6, 0x5E16, 0xF4DE, 0x5E19, 0xF2ED, 0x5E1B, 0xDBD9, + 0x5E1D, 0xF0A8, 0x5E25, 0xE1FD, 0x5E2B, 0xDED4, 0x5E2D, 0xE0AC, 0x5E33, 0xEDE3, 0x5E36, 0xD3E1, 0x5E38, 0xDFC8, 0x5E3D, 0xD9B6, + 0x5E3F, 0xFDAC, 0x5E40, 0xEFD3, 0x5E44, 0xE4C1, 0x5E45, 0xF8EB, 0x5E47, 0xDBAC, 0x5E4C, 0xFCC6, 0x5E55, 0xD8AD, 0x5E5F, 0xF6BA, + 0x5E61, 0xDBDF, 0x5E62, 0xD3D3, 0x5E63, 0xF8C7, 0x5E72, 0xCACE, 0x5E73, 0xF8C1, 0x5E74, 0xD2B4, 0x5E77, 0xDCB4, 0x5E78, 0xFAB9, + 0x5E79, 0xCACF, 0x5E7B, 0xFCB3, 0x5E7C, 0xEAEA, 0x5E7D, 0xEAEB, 0x5E7E, 0xD0FA, 0x5E84, 0xEDE4, 0x5E87, 0xDDE7, 0x5E8A, 0xDFC9, + 0x5E8F, 0xDFED, 0x5E95, 0xEEBC, 0x5E97, 0xEFC1, 0x5E9A, 0xCCD2, 0x5E9C, 0xDDA4, 0x5EA0, 0xDFCA, 0x5EA6, 0xD3F8, 0x5EA7, 0xF1A8, + 0x5EAB, 0xCDB7, 0x5EAD, 0xEFD4, 0x5EB5, 0xE4DD, 0x5EB6, 0xDFEE, 0x5EB7, 0xCBAC, 0x5EB8, 0xE9BC, 0x5EBE, 0xEAEC, 0x5EC2, 0xDFCB, + 0x5EC8, 0xF9BF, 0x5EC9, 0xD6AF, 0x5ECA, 0xD5C6, 0x5ED0, 0xCFAA, 0x5ED3, 0xCEA9, 0x5ED6, 0xD6F8, 0x5EDA, 0xF1B7, 0x5EDB, 0xEEF8, + 0x5EDF, 0xD9D9, 0x5EE0, 0xF3DF, 0x5EE2, 0xF8C8, 0x5EE3, 0xCEC6, 0x5EEC, 0xD5E6, 0x5EF3, 0xF4E6, 0x5EF6, 0xE6C5, 0x5EF7, 0xEFD5, + 0x5EFA, 0xCBEF, 0x5EFB, 0xFCDF, 0x5F01, 0xDCA7, 0x5F04, 0xD6E7, 0x5F0A, 0xF8C9, 0x5F0F, 0xE3D2, 0x5F11, 0xE3BD, 0x5F13, 0xCFE1, + 0x5F14, 0xF0C0, 0x5F15, 0xECDA, 0x5F17, 0xDDD7, 0x5F18, 0xFBF0, 0x5F1B, 0xECAC, 0x5F1F, 0xF0A9, 0x5F26, 0xFAD7, 0x5F27, 0xFBC1, + 0x5F29, 0xD2C0, 0x5F31, 0xE5B0, 0x5F35, 0xEDE5, 0x5F3A, 0xCBAD, 0x5F3C, 0xF9B0, 0x5F48, 0xF7A5, 0x5F4A, 0xCBAE, 0x5F4C, 0xDAAF, + 0x5F4E, 0xD8B6, 0x5F56, 0xD3A7, 0x5F57, 0xFBB2, 0x5F59, 0xFDC4, 0x5F5B, 0xECAD, 0x5F62, 0xFBA1, 0x5F66, 0xE5E9, 0x5F67, 0xE9EE, + 0x5F69, 0xF3F4, 0x5F6A, 0xF8F3, 0x5F6B, 0xF0C1, 0x5F6C, 0xDEAF, 0x5F6D, 0xF8B0, 0x5F70, 0xF3E0, 0x5F71, 0xE7AF, 0x5F77, 0xDBAD, + 0x5F79, 0xE6B5, 0x5F7C, 0xF9A8, 0x5F7F, 0xDDD8, 0x5F80, 0xE8D9, 0x5F81, 0xEFD6, 0x5F85, 0xD3E2, 0x5F87, 0xE2DF, 0x5F8A, 0xFCE0, + 0x5F8B, 0xD7C8, 0x5F8C, 0xFDAD, 0x5F90, 0xDFEF, 0x5F91, 0xCCD3, 0x5F92, 0xD3F9, 0x5F97, 0xD4F0, 0x5F98, 0xDBC7, 0x5F99, 0xDED5, + 0x5F9E, 0xF0F4, 0x5FA0, 0xD5D0, 0x5FA1, 0xE5D9, 0x5FA8, 0xFCC7, 0x5FA9, 0xDCD6, 0x5FAA, 0xE2E0, 0x5FAE, 0xDAB0, 0x5FB5, 0xF3A3, + 0x5FB7, 0xD3EC, 0x5FB9, 0xF4CB, 0x5FBD, 0xFDC5, 0x5FC3, 0xE3FD, 0x5FC5, 0xF9B1, 0x5FCC, 0xD0FB, 0x5FCD, 0xECDB, 0x5FD6, 0xF5BC, + 0x5FD7, 0xF2A4, 0x5FD8, 0xD8CE, 0x5FD9, 0xD8CF, 0x5FE0, 0xF5F7, 0x5FEB, 0xF6E1, 0x5FF5, 0xD2B7, 0x5FFD, 0xFBEC, 0x5FFF, 0xDDC8, + 0x600F, 0xE4E8, 0x6012, 0xD2C1, 0x6016, 0xF8D7, 0x601C, 0xD6BB, 0x601D, 0xDED6, 0x6020, 0xF7BD, 0x6021, 0xECAE, 0x6025, 0xD0E1, + 0x6027, 0xE0F5, 0x6028, 0xEAB3, 0x602A, 0xCED6, 0x602F, 0xCCA5, 0x6041, 0xECF6, 0x6042, 0xE2E1, 0x6043, 0xE3BE, 0x604D, 0xFCC8, + 0x6050, 0xCDF0, 0x6052, 0xF9F6, 0x6055, 0xDFF0, 0x6059, 0xE5BF, 0x605D, 0xCEBF, 0x6062, 0xFCE1, 0x6063, 0xEDB0, 0x6064, 0xFDD1, + 0x6065, 0xF6BB, 0x6068, 0xF9CF, 0x6069, 0xEBDA, 0x606A, 0xCAC1, 0x606C, 0xD2B8, 0x606D, 0xCDF1, 0x606F, 0xE3D3, 0x6070, 0xFDE6, + 0x6085, 0xE6ED, 0x6089, 0xE3FA, 0x608C, 0xF0AA, 0x608D, 0xF9D0, 0x6094, 0xFCE2, 0x6096, 0xF8A7, 0x609A, 0xE1E5, 0x609B, 0xEEF9, + 0x609F, 0xE7F6, 0x60A0, 0xEAED, 0x60A3, 0xFCB4, 0x60A4, 0xF5C2, 0x60A7, 0xD7DC, 0x60B0, 0xF0F5, 0x60B2, 0xDDE8, 0x60B3, 0xD3ED, + 0x60B4, 0xF5FC, 0x60B6, 0xDABF, 0x60B8, 0xCCFB, 0x60BC, 0xD3FA, 0x60BD, 0xF4A4, 0x60C5, 0xEFD7, 0x60C7, 0xD4C3, 0x60D1, 0xFBE3, + 0x60DA, 0xFBED, 0x60DC, 0xE0AD, 0x60DF, 0xEAEE, 0x60E0, 0xFBB3, 0x60E1, 0xE4C2, 0x60F0, 0xF6E7, 0x60F1, 0xD2DD, 0x60F3, 0xDFCC, + 0x60F6, 0xFCC9, 0x60F9, 0xE5A9, 0x60FA, 0xE0F6, 0x60FB, 0xF6B3, 0x6101, 0xE1FE, 0x6106, 0xCBF0, 0x6108, 0xEAEF, 0x6109, 0xEAF0, + 0x610D, 0xDAC0, 0x610E, 0xF8B4, 0x610F, 0xEBF2, 0x6115, 0xE4C3, 0x611A, 0xE9D7, 0x611B, 0xE4F1, 0x611F, 0xCAEF, 0x6127, 0xCED7, + 0x6130, 0xFCCA, 0x6134, 0xF3E1, 0x6137, 0xCBC4, 0x613C, 0xE3E5, 0x613E, 0xCBC5, 0x613F, 0xEAB4, 0x6142, 0xE9BD, 0x6144, 0xD7C9, + 0x6147, 0xEBDB, 0x6148, 0xEDB1, 0x614A, 0xCCC3, 0x614B, 0xF7BE, 0x614C, 0xFCCB, 0x6153, 0xF8F4, 0x6155, 0xD9B7, 0x6158, 0xF3D3, + 0x6159, 0xF3D4, 0x615D, 0xF7E4, 0x615F, 0xF7D1, 0x6162, 0xD8B7, 0x6163, 0xCEB1, 0x6164, 0xCAC2, 0x6167, 0xFBB4, 0x6168, 0xCBC6, + 0x616B, 0xF0F6, 0x616E, 0xD5E7, 0x6170, 0xEAD0, 0x6176, 0xCCD4, 0x6177, 0xCBAF, 0x617D, 0xF4AA, 0x617E, 0xE9AF, 0x6181, 0xF5C3, + 0x6182, 0xE9D8, 0x618A, 0xDDE9, 0x618E, 0xF1F3, 0x6190, 0xD5FB, 0x6191, 0xDEBB, 0x6194, 0xF4FB, 0x6198, 0xFDF3, 0x6199, 0xFDF2, + 0x619A, 0xF7A6, 0x61A4, 0xDDC9, 0x61A7, 0xD4D3, 0x61A9, 0xCCA8, 0x61AB, 0xDAC1, 0x61AC, 0xCCD5, 0x61AE, 0xD9E4, 0x61B2, 0xFACA, + 0x61B6, 0xE5E3, 0x61BA, 0xD3BC, 0x61BE, 0xCAF0, 0x61C3, 0xD0C4, 0x61C7, 0xCAD0, 0x61C8, 0xFAAB, 0x61C9, 0xEBEB, 0x61CA, 0xE7F8, + 0x61CB, 0xD9E5, 0x61E6, 0xD1D7, 0x61F2, 0xF3A4, 0x61F6, 0xD4FB, 0x61F7, 0xFCE3, 0x61F8, 0xFAD8, 0x61FA, 0xF3D5, 0x61FC, 0xCFAB, + 0x61FF, 0xEBF3, 0x6200, 0xD5FC, 0x6207, 0xD3D4, 0x6208, 0xCDFC, 0x620A, 0xD9E6, 0x620C, 0xE2F9, 0x620D, 0xE2A1, 0x620E, 0xEBD4, + 0x6210, 0xE0F7, 0x6211, 0xE4B2, 0x6212, 0xCCFC, 0x6216, 0xFBE4, 0x621A, 0xF4AB, 0x621F, 0xD0BD, 0x6221, 0xCAF1, 0x622A, 0xEFB8, + 0x622E, 0xD7C0, 0x6230, 0xEEFA, 0x6231, 0xFDF4, 0x6234, 0xD3E3, 0x6236, 0xFBC2, 0x623E, 0xD5E8, 0x623F, 0xDBAE, 0x6240, 0xE1B6, + 0x6241, 0xF8B7, 0x6247, 0xE0BF, 0x6248, 0xFBC3, 0x6249, 0xDDEA, 0x624B, 0xE2A2, 0x624D, 0xEEA6, 0x6253, 0xF6E8, 0x6258, 0xF6F5, + 0x626E, 0xDDCA, 0x6271, 0xD0E2, 0x6276, 0xDDA6, 0x6279, 0xDDEB, 0x627C, 0xE4F9, 0x627F, 0xE3AF, 0x6280, 0xD0FC, 0x6284, 0xF4FC, + 0x6289, 0xCCBC, 0x628A, 0xF7EA, 0x6291, 0xE5E4, 0x6292, 0xDFF1, 0x6295, 0xF7E1, 0x6297, 0xF9F7, 0x6298, 0xEFB9, 0x629B, 0xF8D8, + 0x62AB, 0xF9A9, 0x62B1, 0xF8D9, 0x62B5, 0xEEBD, 0x62B9, 0xD8C6, 0x62BC, 0xE4E3, 0x62BD, 0xF5CE, 0x62C2, 0xDDD9, 0x62C7, 0xD9E7, + 0x62C8, 0xD2B9, 0x62C9, 0xD5C3, 0x62CC, 0xDAE5, 0x62CD, 0xDAD0, 0x62CF, 0xD1D9, 0x62D0, 0xCED8, 0x62D2, 0xCBDE, 0x62D3, 0xF4AC, + 0x62D4, 0xDAFB, 0x62D6, 0xF6E9, 0x62D7, 0xE8F3, 0x62D8, 0xCFAC, 0x62D9, 0xF0F0, 0x62DB, 0xF4FD, 0x62DC, 0xDBC8, 0x62EC, 0xCEC0, + 0x62ED, 0xE3D4, 0x62EE, 0xD1CF, 0x62EF, 0xF1F5, 0x62F1, 0xCDF2, 0x62F3, 0xCFEB, 0x62F7, 0xCDB8, 0x62FE, 0xE3A6, 0x62FF, 0xD1DA, + 0x6301, 0xF2A5, 0x6307, 0xF2A6, 0x6309, 0xE4CE, 0x6311, 0xD3FB, 0x632B, 0xF1A9, 0x632F, 0xF2C9, 0x633A, 0xEFD8, 0x633B, 0xE6C9, + 0x633D, 0xD8B8, 0x633E, 0xFAF3, 0x6349, 0xF3B5, 0x634C, 0xF8A4, 0x634F, 0xD1F3, 0x6350, 0xE6C8, 0x6355, 0xF8DA, 0x6367, 0xDCE9, + 0x6368, 0xDED7, 0x636E, 0xCBDF, 0x6372, 0xCFEC, 0x6377, 0xF4DF, 0x637A, 0xD1F4, 0x637B, 0xD2BA, 0x637F, 0xDFF2, 0x6383, 0xE1B7, + 0x6388, 0xE2A3, 0x6389, 0xD3FC, 0x638C, 0xEDE6, 0x6392, 0xDBC9, 0x6396, 0xE4FA, 0x6398, 0xCFDE, 0x639B, 0xCED0, 0x63A0, 0xD5D3, + 0x63A1, 0xF3F5, 0x63A2, 0xF7AE, 0x63A5, 0xEFC8, 0x63A7, 0xCDF3, 0x63A8, 0xF5CF, 0x63A9, 0xE5F3, 0x63AA, 0xF0C2, 0x63C0, 0xCAD1, + 0x63C4, 0xEAF1, 0x63C6, 0xD0A6, 0x63CF, 0xD9DA, 0x63D0, 0xF0AB, 0x63D6, 0xEBE7, 0x63DA, 0xE5C0, 0x63DB, 0xFCB5, 0x63E1, 0xE4C4, + 0x63ED, 0xCCA9, 0x63EE, 0xFDC6, 0x63F4, 0xEAB5, 0x63F6, 0xE5AA, 0x63F7, 0xDFBA, 0x640D, 0xE1DF, 0x640F, 0xDAD1, 0x6414, 0xE1B8, + 0x6416, 0xE8F4, 0x6417, 0xD3FD, 0x641C, 0xE2A4, 0x6422, 0xF2CA, 0x642C, 0xDAE6, 0x642D, 0xF7B3, 0x643A, 0xFDCD, 0x643E, 0xF3B6, + 0x6458, 0xEED7, 0x6460, 0xF5C4, 0x6469, 0xD8A4, 0x646F, 0xF2A7, 0x6478, 0xD9B8, 0x6479, 0xD9B9, 0x647A, 0xEFC9, 0x6488, 0xD6CE, + 0x6491, 0xF7CB, 0x6492, 0xDFAE, 0x6493, 0xE8F5, 0x649A, 0xD2B5, 0x649E, 0xD3D5, 0x64A4, 0xF4CC, 0x64A5, 0xDAFC, 0x64AB, 0xD9E8, + 0x64AD, 0xF7EB, 0x64AE, 0xF5C9, 0x64B0, 0xF3BC, 0x64B2, 0xDAD2, 0x64BB, 0xD3B5, 0x64C1, 0xE8B6, 0x64C4, 0xD6CF, 0x64C5, 0xF4BA, + 0x64C7, 0xF7C9, 0x64CA, 0xCCAA, 0x64CD, 0xF0C3, 0x64CE, 0xCCD6, 0x64D2, 0xD0D3, 0x64D4, 0xD3BD, 0x64D8, 0xDBFB, 0x64DA, 0xCBE0, + 0x64E1, 0xD3E4, 0x64E2, 0xF6F7, 0x64E5, 0xD5BA, 0x64E6, 0xF3CD, 0x64E7, 0xCBE1, 0x64EC, 0xEBF4, 0x64F2, 0xF4AD, 0x64F4, 0xFCAA, + 0x64FA, 0xF7EC, 0x64FE, 0xE8F6, 0x6500, 0xDAE7, 0x6504, 0xF7CC, 0x6518, 0xE5C1, 0x651D, 0xE0EE, 0x6523, 0xD5FD, 0x652A, 0xCEE6, + 0x652B, 0xFCAB, 0x652C, 0xD5BB, 0x652F, 0xF2A8, 0x6536, 0xE2A5, 0x6537, 0xCDB9, 0x6538, 0xEAF2, 0x6539, 0xCBC7, 0x653B, 0xCDF4, + 0x653E, 0xDBAF, 0x653F, 0xEFD9, 0x6545, 0xCDBA, 0x6548, 0xFCF9, 0x654D, 0xDFF3, 0x654E, 0xCEE7, 0x654F, 0xDAC2, 0x6551, 0xCFAD, + 0x6556, 0xE7F9, 0x6557, 0xF8A8, 0x655E, 0xF3E2, 0x6562, 0xCAF2, 0x6563, 0xDFA4, 0x6566, 0xD4C4, 0x656C, 0xCCD7, 0x656D, 0xE5C2, + 0x6572, 0xCDBB, 0x6574, 0xEFDA, 0x6575, 0xEED8, 0x6577, 0xDDA7, 0x6578, 0xE2A6, 0x657E, 0xE0C0, 0x6582, 0xD6B0, 0x6583, 0xF8CA, + 0x6585, 0xFCFA, 0x6587, 0xD9FE, 0x658C, 0xDEB0, 0x6590, 0xDDEC, 0x6591, 0xDAE8, 0x6597, 0xD4E0, 0x6599, 0xD6F9, 0x659B, 0xCDD7, + 0x659C, 0xDED8, 0x659F, 0xF2F8, 0x65A1, 0xE4D6, 0x65A4, 0xD0C5, 0x65A5, 0xF4AE, 0x65A7, 0xDDA8, 0x65AB, 0xEDC5, 0x65AC, 0xF3D6, + 0x65AF, 0xDED9, 0x65B0, 0xE3E6, 0x65B7, 0xD3A8, 0x65B9, 0xDBB0, 0x65BC, 0xE5DA, 0x65BD, 0xE3BF, 0x65C1, 0xDBB1, 0x65C5, 0xD5E9, + 0x65CB, 0xE0C1, 0x65CC, 0xEFDB, 0x65CF, 0xF0E9, 0x65D2, 0xD7B2, 0x65D7, 0xD0FD, 0x65E0, 0xD9E9, 0x65E3, 0xD0FE, 0x65E5, 0xECED, + 0x65E6, 0xD3A9, 0x65E8, 0xF2A9, 0x65E9, 0xF0C4, 0x65EC, 0xE2E2, 0x65ED, 0xE9EF, 0x65F1, 0xF9D1, 0x65F4, 0xE9D9, 0x65FA, 0xE8DA, + 0x65FB, 0xDAC3, 0x65FC, 0xDAC4, 0x65FD, 0xD4C5, 0x65FF, 0xE7FA, 0x6606, 0xCDE0, 0x6607, 0xE3B0, 0x6609, 0xDBB2, 0x660A, 0xFBC4, + 0x660C, 0xF3E3, 0x660E, 0xD9A5, 0x660F, 0xFBE7, 0x6610, 0xDDCB, 0x6611, 0xD0D4, 0x6613, 0xE6B6, 0x6614, 0xE0AE, 0x6615, 0xFDDA, + 0x661E, 0xDCB5, 0x661F, 0xE0F8, 0x6620, 0xE7B1, 0x6625, 0xF5F0, 0x6627, 0xD8DC, 0x6628, 0xEDC6, 0x662D, 0xE1B9, 0x662F, 0xE3C0, + 0x6630, 0xF9C0, 0x6631, 0xE9F0, 0x6634, 0xD9DB, 0x6636, 0xF3E4, 0x663A, 0xDCB6, 0x663B, 0xE4E9, 0x6641, 0xF0C5, 0x6642, 0xE3C1, + 0x6643, 0xFCCC, 0x6644, 0xFCCD, 0x6649, 0xF2CB, 0x664B, 0xF2CC, 0x664F, 0xE4CF, 0x6659, 0xF1DB, 0x665B, 0xFAD9, 0x665D, 0xF1B8, + 0x665E, 0xFDF5, 0x665F, 0xE0F9, 0x6664, 0xE7FB, 0x6665, 0xFCB7, 0x6666, 0xFCE4, 0x6667, 0xFBC5, 0x6668, 0xE3E7, 0x6669, 0xD8B9, + 0x666B, 0xF6F8, 0x666E, 0xDCC5, 0x666F, 0xCCD8, 0x6673, 0xE0AF, 0x6674, 0xF4E7, 0x6676, 0xEFDC, 0x6677, 0xCFFC, 0x6678, 0xEFDD, + 0x667A, 0xF2AA, 0x6684, 0xFDBE, 0x6687, 0xCAAC, 0x6688, 0xFDBB, 0x6689, 0xFDC7, 0x668E, 0xE7B2, 0x6690, 0xEAD1, 0x6691, 0xDFF4, + 0x6696, 0xD1EC, 0x6697, 0xE4DE, 0x6698, 0xE5C3, 0x669D, 0xD9A6, 0x66A0, 0xCDBC, 0x66A2, 0xF3E5, 0x66AB, 0xEDD5, 0x66AE, 0xD9BA, + 0x66B2, 0xEDE7, 0x66B3, 0xFBB5, 0x66B4, 0xF8EC, 0x66B9, 0xE0E7, 0x66BB, 0xCCD9, 0x66BE, 0xD4C6, 0x66C4, 0xE7A5, 0x66C6, 0xD5F5, + 0x66C7, 0xD3BE, 0x66C9, 0xFCFB, 0x66D6, 0xE4F2, 0x66D9, 0xDFF5, 0x66DC, 0xE8F8, 0x66DD, 0xF8ED, 0x66E0, 0xCEC7, 0x66E6, 0xFDF6, + 0x66F0, 0xE8D8, 0x66F2, 0xCDD8, 0x66F3, 0xE7D6, 0x66F4, 0xCCDA, 0x66F7, 0xCAE3, 0x66F8, 0xDFF6, 0x66F9, 0xF0C7, 0x66FA, 0xF0C6, + 0x66FC, 0xD8BA, 0x66FE, 0xF1F4, 0x66FF, 0xF4F0, 0x6700, 0xF5CC, 0x6703, 0xFCE5, 0x6708, 0xEAC5, 0x6709, 0xEAF3, 0x670B, 0xDDDB, + 0x670D, 0xDCD7, 0x6714, 0xDEFD, 0x6715, 0xF2F9, 0x6717, 0xD5C7, 0x671B, 0xD8D0, 0x671D, 0xF0C8, 0x671E, 0xD1A1, 0x671F, 0xD1A2, + 0x6726, 0xD9D4, 0x6727, 0xD6E8, 0x6728, 0xD9CA, 0x672A, 0xDAB1, 0x672B, 0xD8C7, 0x672C, 0xDCE2, 0x672D, 0xF3CE, 0x672E, 0xF5F4, + 0x6731, 0xF1B9, 0x6734, 0xDAD3, 0x6736, 0xF6EA, 0x673A, 0xCFF5, 0x673D, 0xFDAE, 0x6746, 0xCAD2, 0x6749, 0xDFB4, 0x674E, 0xD7DD, + 0x674F, 0xFABA, 0x6750, 0xEEA7, 0x6751, 0xF5BD, 0x6753, 0xF8F5, 0x6756, 0xEDE8, 0x675C, 0xD4E1, 0x675E, 0xD1A3, 0x675F, 0xE1D6, + 0x676D, 0xF9F8, 0x676F, 0xDBCA, 0x6770, 0xCBF9, 0x6771, 0xD4D4, 0x6773, 0xD9DC, 0x6775, 0xEEBE, 0x6777, 0xF7ED, 0x677B, 0xD2EE, + 0x677E, 0xE1E6, 0x677F, 0xF7F9, 0x6787, 0xDDED, 0x6789, 0xE8DB, 0x678B, 0xDBB3, 0x678F, 0xD1F7, 0x6790, 0xE0B0, 0x6793, 0xD4E2, + 0x6795, 0xF6D7, 0x6797, 0xD7F9, 0x679A, 0xD8DD, 0x679C, 0xCDFD, 0x679D, 0xF2AB, 0x67AF, 0xCDBD, 0x67B0, 0xF8C2, 0x67B3, 0xF2AC, + 0x67B6, 0xCAAD, 0x67B7, 0xCAAE, 0x67B8, 0xCFAE, 0x67BE, 0xE3C2, 0x67C4, 0xDCB7, 0x67CF, 0xDBDA, 0x67D0, 0xD9BB, 0x67D1, 0xCAF3, + 0x67D2, 0xF6D3, 0x67D3, 0xE6F8, 0x67D4, 0xEAF5, 0x67DA, 0xEAF6, 0x67DD, 0xF6F9, 0x67E9, 0xCFAF, 0x67EC, 0xCAD3, 0x67EF, 0xCAAF, + 0x67F0, 0xD2B0, 0x67F1, 0xF1BA, 0x67F3, 0xD7B3, 0x67F4, 0xE3C3, 0x67F5, 0xF3FD, 0x67F6, 0xDEDA, 0x67FB, 0xDEDB, 0x67FE, 0xEFDE, + 0x6812, 0xE2E3, 0x6813, 0xEEFB, 0x6816, 0xDFF7, 0x6817, 0xD7CA, 0x6821, 0xCEE8, 0x6822, 0xDBDB, 0x682A, 0xF1BB, 0x682F, 0xE9F1, + 0x6838, 0xFAB7, 0x6839, 0xD0C6, 0x683C, 0xCCAB, 0x683D, 0xEEA8, 0x6840, 0xCBFA, 0x6841, 0xF9F9, 0x6842, 0xCCFD, 0x6843, 0xD3FE, + 0x6848, 0xE4D0, 0x684E, 0xF2EE, 0x6850, 0xD4D5, 0x6851, 0xDFCD, 0x6853, 0xFCB8, 0x6854, 0xD1D0, 0x686D, 0xF2CD, 0x6876, 0xF7D2, + 0x687F, 0xCAD4, 0x6881, 0xD5D9, 0x6885, 0xD8DE, 0x688F, 0xCDD9, 0x6893, 0xEEA9, 0x6894, 0xF6BC, 0x6897, 0xCCDB, 0x689D, 0xF0C9, + 0x689F, 0xFCFC, 0x68A1, 0xE8C9, 0x68A2, 0xF4FE, 0x68A7, 0xE7FC, 0x68A8, 0xD7DE, 0x68AD, 0xDEDC, 0x68AF, 0xF0AC, 0x68B0, 0xCCFE, + 0x68B1, 0xCDE1, 0x68B3, 0xE1BA, 0x68B5, 0xDBEF, 0x68B6, 0xDAB2, 0x68C4, 0xD1A5, 0x68C5, 0xDCB8, 0x68C9, 0xD8F6, 0x68CB, 0xD1A4, + 0x68CD, 0xCDE2, 0x68D2, 0xDCEA, 0x68D5, 0xF0F7, 0x68D7, 0xF0CA, 0x68D8, 0xD0BE, 0x68DA, 0xDDDC, 0x68DF, 0xD4D6, 0x68E0, 0xD3D6, + 0x68E7, 0xEDD0, 0x68E8, 0xCDA1, 0x68EE, 0xDFB5, 0x68F2, 0xDFF8, 0x68F9, 0xD4A1, 0x68FA, 0xCEB2, 0x6900, 0xE8CA, 0x6905, 0xEBF5, + 0x690D, 0xE3D5, 0x690E, 0xF5D0, 0x6912, 0xF5A1, 0x6927, 0xD9A7, 0x6930, 0xE5AB, 0x693D, 0xE6CB, 0x693F, 0xF5F1, 0x694A, 0xE5C5, + 0x6953, 0xF9A3, 0x6954, 0xE0DB, 0x6955, 0xF6EB, 0x6957, 0xCBF1, 0x6959, 0xD9EA, 0x695A, 0xF5A2, 0x695E, 0xD7D1, 0x6960, 0xD1F8, + 0x6961, 0xEAF8, 0x6962, 0xEAF9, 0x6963, 0xDAB3, 0x6968, 0xEFDF, 0x696B, 0xF1EF, 0x696D, 0xE5F6, 0x696E, 0xEEBF, 0x696F, 0xE2E4, + 0x6975, 0xD0BF, 0x6977, 0xFAAC, 0x6978, 0xF5D1, 0x6979, 0xE7B3, 0x6995, 0xE9BE, 0x699B, 0xF2CE, 0x699C, 0xDBB4, 0x69A5, 0xFCCE, + 0x69A7, 0xDDEE, 0x69AE, 0xE7B4, 0x69B4, 0xD7B4, 0x69BB, 0xF7B4, 0x69C1, 0xCDBE, 0x69C3, 0xDAE9, 0x69CB, 0xCFB0, 0x69CC, 0xF7D9, + 0x69CD, 0xF3E6, 0x69D0, 0xCED9, 0x69E8, 0xCEAA, 0x69EA, 0xCBC8, 0x69FB, 0xD0A7, 0x69FD, 0xF0CB, 0x69FF, 0xD0C7, 0x6A02, 0xE4C5, + 0x6A0A, 0xDBE0, 0x6A11, 0xD5DA, 0x6A13, 0xD7A7, 0x6A17, 0xEEC0, 0x6A19, 0xF8F6, 0x6A1E, 0xF5D2, 0x6A1F, 0xEDE9, 0x6A21, 0xD9BC, + 0x6A23, 0xE5C6, 0x6A35, 0xF5A3, 0x6A38, 0xDAD4, 0x6A39, 0xE2A7, 0x6A3A, 0xFBFC, 0x6A3D, 0xF1DC, 0x6A44, 0xCAF4, 0x6A48, 0xE8FA, + 0x6A4B, 0xCEE9, 0x6A52, 0xE9F8, 0x6A53, 0xE2E5, 0x6A58, 0xD0B9, 0x6A59, 0xD4F2, 0x6A5F, 0xD1A6, 0x6A61, 0xDFCE, 0x6A6B, 0xFCF4, + 0x6A80, 0xD3AA, 0x6A84, 0xCCAC, 0x6A89, 0xEFE0, 0x6A8D, 0xE5E5, 0x6A8E, 0xD0D5, 0x6A97, 0xDBFC, 0x6A9C, 0xFCE6, 0x6AA2, 0xCBFE, + 0x6AA3, 0xEDEA, 0x6AB3, 0xDEB1, 0x6ABB, 0xF9E3, 0x6AC2, 0xD4A2, 0x6AC3, 0xCFF6, 0x6AD3, 0xD6D0, 0x6ADA, 0xD5EA, 0x6ADB, 0xF1EE, + 0x6AF6, 0xFACB, 0x6AFB, 0xE5A1, 0x6B04, 0xD5B1, 0x6B0A, 0xCFED, 0x6B0C, 0xEDEB, 0x6B12, 0xD5B2, 0x6B16, 0xD5BC, 0x6B20, 0xFDE2, + 0x6B21, 0xF3AD, 0x6B23, 0xFDDB, 0x6B32, 0xE9B0, 0x6B3A, 0xD1A7, 0x6B3D, 0xFDE3, 0x6B3E, 0xCEB3, 0x6B46, 0xFDE4, 0x6B47, 0xFACE, + 0x6B4C, 0xCAB0, 0x6B4E, 0xF7A7, 0x6B50, 0xCFB1, 0x6B5F, 0xE6A2, 0x6B61, 0xFCB6, 0x6B62, 0xF2AD, 0x6B63, 0xEFE1, 0x6B64, 0xF3AE, + 0x6B65, 0xDCC6, 0x6B66, 0xD9EB, 0x6B6A, 0xE8E0, 0x6B72, 0xE1A8, 0x6B77, 0xD5F6, 0x6B78, 0xCFFD, 0x6B7B, 0xDEDD, 0x6B7F, 0xD9D1, + 0x6B83, 0xE4EA, 0x6B84, 0xF2CF, 0x6B86, 0xF7BF, 0x6B89, 0xE2E6, 0x6B8A, 0xE2A8, 0x6B96, 0xE3D6, 0x6B98, 0xEDD1, 0x6B9E, 0xE9F9, + 0x6BAE, 0xD6B1, 0x6BAF, 0xDEB2, 0x6BB2, 0xE0E8, 0x6BB5, 0xD3AB, 0x6BB7, 0xEBDC, 0x6BBA, 0xDFAF, 0x6BBC, 0xCAC3, 0x6BBF, 0xEEFC, + 0x6BC1, 0xFDC3, 0x6BC5, 0xEBF6, 0x6BC6, 0xCFB2, 0x6BCB, 0xD9EC, 0x6BCD, 0xD9BD, 0x6BCF, 0xD8DF, 0x6BD2, 0xD4B8, 0x6BD3, 0xEBBE, + 0x6BD4, 0xDDEF, 0x6BD6, 0xDDF0, 0x6BD7, 0xDDF1, 0x6BD8, 0xDDF2, 0x6BDB, 0xD9BE, 0x6BEB, 0xFBC6, 0x6BEC, 0xCFB3, 0x6C08, 0xEEFD, + 0x6C0F, 0xE4AB, 0x6C11, 0xDAC5, 0x6C13, 0xD8EC, 0x6C23, 0xD1A8, 0x6C34, 0xE2A9, 0x6C37, 0xDEBC, 0x6C38, 0xE7B5, 0x6C3E, 0xDBF0, + 0x6C40, 0xEFE2, 0x6C41, 0xF1F0, 0x6C42, 0xCFB4, 0x6C4E, 0xDBF1, 0x6C50, 0xE0B1, 0x6C55, 0xDFA5, 0x6C57, 0xF9D2, 0x6C5A, 0xE7FD, + 0x6C5D, 0xE6A3, 0x6C5E, 0xFBF1, 0x6C5F, 0xCBB0, 0x6C60, 0xF2AE, 0x6C68, 0xCDE7, 0x6C6A, 0xE8DC, 0x6C6D, 0xE7D7, 0x6C70, 0xF7C0, + 0x6C72, 0xD0E3, 0x6C76, 0xDAA1, 0x6C7A, 0xCCBD, 0x6C7D, 0xD1A9, 0x6C7E, 0xDDCC, 0x6C81, 0xE3FE, 0x6C82, 0xD1AA, 0x6C83, 0xE8AA, + 0x6C85, 0xEAB6, 0x6C86, 0xF9FA, 0x6C87, 0xE6CC, 0x6C88, 0xF6D8, 0x6C8C, 0xD4C7, 0x6C90, 0xD9CB, 0x6C92, 0xD9D2, 0x6C93, 0xD3CB, + 0x6C94, 0xD8F7, 0x6C95, 0xDAA9, 0x6C96, 0xF5F8, 0x6C99, 0xDEDE, 0x6C9A, 0xF2AF, 0x6C9B, 0xF8A9, 0x6CAB, 0xD8C8, 0x6CAE, 0xEEC1, + 0x6CB3, 0xF9C1, 0x6CB8, 0xDDF3, 0x6CB9, 0xEAFA, 0x6CBB, 0xF6BD, 0x6CBC, 0xE1BB, 0x6CBD, 0xCDBF, 0x6CBE, 0xF4D4, 0x6CBF, 0xE6CD, + 0x6CC1, 0xFCCF, 0x6CC2, 0xFBA2, 0x6CC4, 0xE0DC, 0x6CC9, 0xF4BB, 0x6CCA, 0xDAD5, 0x6CCC, 0xF9B2, 0x6CD3, 0xFBF2, 0x6CD5, 0xDBF6, + 0x6CD7, 0xDEDF, 0x6CDB, 0xDBF2, 0x6CE1, 0xF8DC, 0x6CE2, 0xF7EE, 0x6CE3, 0xEBE8, 0x6CE5, 0xD2FA, 0x6CE8, 0xF1BC, 0x6CEB, 0xFADA, + 0x6CEE, 0xDAEA, 0x6CEF, 0xDAC6, 0x6CF0, 0xF7C1, 0x6CF3, 0xE7B6, 0x6D0B, 0xE5C7, 0x6D0C, 0xD6AC, 0x6D11, 0xDCC7, 0x6D17, 0xE1A9, + 0x6D19, 0xE2AA, 0x6D1B, 0xD5A6, 0x6D1E, 0xD4D7, 0x6D25, 0xF2D0, 0x6D27, 0xEAFB, 0x6D29, 0xE0DD, 0x6D2A, 0xFBF3, 0x6D32, 0xF1BD, + 0x6D35, 0xE2E7, 0x6D36, 0xFDD7, 0x6D38, 0xCEC8, 0x6D39, 0xEAB7, 0x6D3B, 0xFCC0, 0x6D3D, 0xFDE7, 0x6D3E, 0xF7EF, 0x6D41, 0xD7B5, + 0x6D59, 0xEFBA, 0x6D5A, 0xF1DD, 0x6D5C, 0xDEB3, 0x6D63, 0xE8CB, 0x6D66, 0xF8DD, 0x6D69, 0xFBC7, 0x6D6A, 0xD5C8, 0x6D6C, 0xD7DF, + 0x6D6E, 0xDDA9, 0x6D74, 0xE9B1, 0x6D77, 0xFAAD, 0x6D78, 0xF6D9, 0x6D79, 0xFAF4, 0x6D7F, 0xF8AA, 0x6D85, 0xE6EE, 0x6D87, 0xCCDC, + 0x6D88, 0xE1BC, 0x6D89, 0xE0EF, 0x6D8C, 0xE9BF, 0x6D8D, 0xFCFD, 0x6D8E, 0xE6CE, 0x6D91, 0xE1D7, 0x6D93, 0xE6CF, 0x6D95, 0xF4F1, + 0x6DAF, 0xE4F3, 0x6DB2, 0xE4FB, 0x6DB5, 0xF9E4, 0x6DC0, 0xEFE3, 0x6DC3, 0xCFEE, 0x6DC4, 0xF6BE, 0x6DC5, 0xE0B2, 0x6DC6, 0xFCFE, + 0x6DC7, 0xD1AB, 0x6DCB, 0xD7FA, 0x6DCF, 0xFBC8, 0x6DD1, 0xE2D7, 0x6DD8, 0xD4A3, 0x6DD9, 0xF0F8, 0x6DDA, 0xD7A8, 0x6DDE, 0xE1E7, + 0x6DE1, 0xD3BF, 0x6DE8, 0xEFE4, 0x6DEA, 0xD7C5, 0x6DEB, 0xEBE2, 0x6DEE, 0xFCE7, 0x6DF1, 0xE4A2, 0x6DF3, 0xE2E8, 0x6DF5, 0xE6D0, + 0x6DF7, 0xFBE8, 0x6DF8, 0xF4E8, 0x6DF9, 0xE5F4, 0x6DFA, 0xF4BC, 0x6DFB, 0xF4D5, 0x6E17, 0xDFB6, 0x6E19, 0xFCB9, 0x6E1A, 0xEEC2, + 0x6E1B, 0xCAF5, 0x6E1F, 0xEFE5, 0x6E20, 0xCBE2, 0x6E21, 0xD4A4, 0x6E23, 0xDEE0, 0x6E24, 0xDAFD, 0x6E25, 0xE4C6, 0x6E26, 0xE8BE, + 0x6E2B, 0xE0DE, 0x6E2C, 0xF6B4, 0x6E2D, 0xEAD2, 0x6E2F, 0xF9FB, 0x6E32, 0xE0C2, 0x6E34, 0xCAE4, 0x6E36, 0xE7B7, 0x6E38, 0xEAFD, + 0x6E3A, 0xD9DD, 0x6E3C, 0xDAB4, 0x6E3D, 0xEEAA, 0x6E3E, 0xFBE9, 0x6E43, 0xDBCB, 0x6E44, 0xDAB5, 0x6E4A, 0xF1BE, 0x6E4D, 0xD3AC, + 0x6E56, 0xFBC9, 0x6E58, 0xDFCF, 0x6E5B, 0xD3C0, 0x6E5C, 0xE3D7, 0x6E5E, 0xEFE6, 0x6E5F, 0xFCD0, 0x6E67, 0xE9C0, 0x6E6B, 0xF5D3, + 0x6E6E, 0xECDC, 0x6E6F, 0xF7B7, 0x6E72, 0xEAB8, 0x6E73, 0xD1F9, 0x6E7A, 0xDCC8, 0x6E90, 0xEAB9, 0x6E96, 0xF1DE, 0x6E9C, 0xD7B6, + 0x6E9D, 0xCFB5, 0x6E9F, 0xD9A8, 0x6EA2, 0xECEE, 0x6EA5, 0xDDAA, 0x6EAA, 0xCDA2, 0x6EAB, 0xE8AE, 0x6EAF, 0xE1BD, 0x6EB1, 0xF2D1, + 0x6EB6, 0xE9C1, 0x6EBA, 0xD2FC, 0x6EC2, 0xDBB5, 0x6EC4, 0xF3E7, 0x6EC5, 0xD8FE, 0x6EC9, 0xFCD1, 0x6ECB, 0xEDB2, 0x6ECC, 0xF4AF, + 0x6ECE, 0xFBA3, 0x6ED1, 0xFCC1, 0x6ED3, 0xEEAB, 0x6ED4, 0xD4A5, 0x6EEF, 0xF4F2, 0x6EF4, 0xEED9, 0x6EF8, 0xFBCA, 0x6EFE, 0xCDE3, + 0x6EFF, 0xD8BB, 0x6F01, 0xE5DB, 0x6F02, 0xF8F7, 0x6F06, 0xF6D4, 0x6F0F, 0xD7A9, 0x6F11, 0xCBC9, 0x6F14, 0xE6D1, 0x6F15, 0xF0CC, + 0x6F20, 0xD8AE, 0x6F22, 0xF9D3, 0x6F23, 0xD5FE, 0x6F2B, 0xD8BC, 0x6F2C, 0xF2B0, 0x6F31, 0xE2AB, 0x6F32, 0xF3E8, 0x6F38, 0xEFC2, + 0x6F3F, 0xEDEC, 0x6F41, 0xE7B8, 0x6F51, 0xDAFE, 0x6F54, 0xCCBE, 0x6F57, 0xF2FC, 0x6F58, 0xDAEB, 0x6F5A, 0xE2D8, 0x6F5B, 0xEDD6, + 0x6F5E, 0xD6D1, 0x6F5F, 0xE0B3, 0x6F62, 0xFCD2, 0x6F64, 0xEBC8, 0x6F6D, 0xD3C1, 0x6F6E, 0xF0CD, 0x6F70, 0xCFF7, 0x6F7A, 0xEDD2, + 0x6F7C, 0xD4D8, 0x6F7D, 0xDCC9, 0x6F7E, 0xD7F1, 0x6F81, 0xDFBB, 0x6F84, 0xF3A5, 0x6F88, 0xF4CD, 0x6F8D, 0xF1BF, 0x6F8E, 0xF8B1, + 0x6F90, 0xE9FA, 0x6F94, 0xFBCB, 0x6F97, 0xCAD5, 0x6FA3, 0xF9D4, 0x6FA4, 0xF7CA, 0x6FA7, 0xD6C8, 0x6FAE, 0xFCE8, 0x6FAF, 0xF3BD, + 0x6FB1, 0xEEFE, 0x6FB3, 0xE7FE, 0x6FB9, 0xD3C2, 0x6FBE, 0xD3B6, 0x6FC0, 0xCCAD, 0x6FC1, 0xF6FA, 0x6FC2, 0xD6B2, 0x6FC3, 0xD2D8, + 0x6FCA, 0xE7D8, 0x6FD5, 0xE3A5, 0x6FDA, 0xE7B9, 0x6FDF, 0xF0AD, 0x6FE0, 0xFBCC, 0x6FE1, 0xEBA1, 0x6FE4, 0xD4A6, 0x6FE9, 0xFBCD, + 0x6FEB, 0xD5BD, 0x6FEC, 0xF1DF, 0x6FEF, 0xF6FB, 0x6FF1, 0xDEB4, 0x6FFE, 0xD5EB, 0x7001, 0xE5C8, 0x7005, 0xFBA4, 0x7006, 0xD4B9, + 0x7009, 0xDEE1, 0x700B, 0xE4A3, 0x700F, 0xD7B7, 0x7011, 0xF8EE, 0x7015, 0xDEB5, 0x7018, 0xD6D2, 0x701A, 0xF9D5, 0x701B, 0xE7BA, + 0x701C, 0xEBD5, 0x701D, 0xD5F7, 0x701E, 0xEFE7, 0x701F, 0xE1BE, 0x7023, 0xFAAE, 0x7027, 0xD6E9, 0x7028, 0xD6EE, 0x702F, 0xE7BB, + 0x7037, 0xECCB, 0x703E, 0xD5B3, 0x704C, 0xCEB4, 0x7050, 0xFBA5, 0x7051, 0xE1EE, 0x7058, 0xF7A8, 0x705D, 0xFBCE, 0x7063, 0xD8BD, + 0x706B, 0xFBFD, 0x7070, 0xFCE9, 0x7078, 0xCFB6, 0x707C, 0xEDC7, 0x707D, 0xEEAC, 0x7085, 0xCCDD, 0x708A, 0xF6A7, 0x708E, 0xE6FA, + 0x7092, 0xF5A4, 0x7098, 0xFDDC, 0x7099, 0xEDB3, 0x709A, 0xCEC9, 0x70A1, 0xEFE8, 0x70A4, 0xE1BF, 0x70AB, 0xFADB, 0x70AC, 0xCBE3, + 0x70AD, 0xF7A9, 0x70AF, 0xFBA6, 0x70B3, 0xDCB9, 0x70B7, 0xF1C0, 0x70B8, 0xEDC8, 0x70B9, 0xEFC3, 0x70C8, 0xD6AD, 0x70CB, 0xFDCE, + 0x70CF, 0xE8A1, 0x70D8, 0xFBF4, 0x70D9, 0xD5A7, 0x70DD, 0xF1F6, 0x70DF, 0xE6D3, 0x70F1, 0xCCDE, 0x70F9, 0xF8B2, 0x70FD, 0xDCEB, + 0x7104, 0xFDB6, 0x7109, 0xE5EA, 0x710C, 0xF1E0, 0x7119, 0xDBCC, 0x711A, 0xDDCD, 0x711E, 0xD4C8, 0x7121, 0xD9ED, 0x7126, 0xF5A5, + 0x7130, 0xE6FB, 0x7136, 0xE6D4, 0x7147, 0xFDC8, 0x7149, 0xD6A1, 0x714A, 0xFDBF, 0x714C, 0xFCD3, 0x714E, 0xEFA1, 0x7150, 0xE7BC, + 0x7156, 0xD1EE, 0x7159, 0xE6D5, 0x715C, 0xE9F2, 0x715E, 0xDFB0, 0x7164, 0xD8E0, 0x7165, 0xFCBA, 0x7166, 0xFDAF, 0x7167, 0xF0CE, + 0x7169, 0xDBE1, 0x716C, 0xE5C9, 0x716E, 0xEDB4, 0x717D, 0xE0C3, 0x7184, 0xE3D8, 0x7189, 0xE9FB, 0x718A, 0xEAA8, 0x718F, 0xFDB7, + 0x7192, 0xFBA7, 0x7194, 0xE9C2, 0x7199, 0xFDF7, 0x719F, 0xE2D9, 0x71A2, 0xDCEC, 0x71AC, 0xE8A2, 0x71B1, 0xE6F0, 0x71B9, 0xFDF8, + 0x71BA, 0xFDF9, 0x71BE, 0xF6BF, 0x71C1, 0xE7A7, 0x71C3, 0xE6D7, 0x71C8, 0xD4F3, 0x71C9, 0xD4C9, 0x71CE, 0xD6FA, 0x71D0, 0xD7F2, + 0x71D2, 0xE1C0, 0x71D4, 0xDBE2, 0x71D5, 0xE6D8, 0x71DF, 0xE7BD, 0x71E5, 0xF0CF, 0x71E6, 0xF3BE, 0x71E7, 0xE2AC, 0x71ED, 0xF5B7, + 0x71EE, 0xE0F0, 0x71FB, 0xFDB8, 0x71FC, 0xE3E8, 0x71FE, 0xD4A7, 0x71FF, 0xE8FC, 0x7200, 0xFAD2, 0x7206, 0xF8EF, 0x7210, 0xD6D3, + 0x721B, 0xD5B4, 0x722A, 0xF0D0, 0x722C, 0xF7F0, 0x722D, 0xEEB3, 0x7230, 0xEABA, 0x7232, 0xEAD3, 0x7235, 0xEDC9, 0x7236, 0xDDAB, + 0x723A, 0xE5AC, 0x723B, 0xFDA1, 0x723D, 0xDFD0, 0x723E, 0xECB3, 0x7240, 0xDFD1, 0x7246, 0xEDED, 0x7247, 0xF8B8, 0x7248, 0xF7FA, + 0x724C, 0xF8AB, 0x7252, 0xF4E0, 0x7258, 0xD4BA, 0x7259, 0xE4B3, 0x725B, 0xE9DA, 0x725D, 0xDEB6, 0x725F, 0xD9BF, 0x7261, 0xD9C0, + 0x7262, 0xD6EF, 0x7267, 0xD9CC, 0x7269, 0xDAAA, 0x7272, 0xDFE5, 0x7279, 0xF7E5, 0x727D, 0xCCB2, 0x7280, 0xDFF9, 0x7281, 0xD7E0, + 0x72A2, 0xD4BB, 0x72A7, 0xFDFA, 0x72AC, 0xCCB3, 0x72AF, 0xDBF3, 0x72C0, 0xDFD2, 0x72C2, 0xCECA, 0x72C4, 0xEEDA, 0x72CE, 0xE4E4, + 0x72D0, 0xFBCF, 0x72D7, 0xCFB7, 0x72D9, 0xEEC3, 0x72E1, 0xCEEA, 0x72E9, 0xE2AD, 0x72F8, 0xD7E1, 0x72F9, 0xFAF5, 0x72FC, 0xD5C9, + 0x72FD, 0xF8AC, 0x730A, 0xE7D9, 0x7316, 0xF3E9, 0x731B, 0xD8ED, 0x731C, 0xE3C4, 0x731D, 0xF0F1, 0x7325, 0xE8E5, 0x7329, 0xE0FA, + 0x732A, 0xEEC4, 0x732B, 0xD9DE, 0x7336, 0xEBA2, 0x7337, 0xEBA3, 0x733E, 0xFCC2, 0x733F, 0xEABB, 0x7344, 0xE8AB, 0x7345, 0xDEE2, + 0x7350, 0xEDEF, 0x7352, 0xE8A3, 0x7357, 0xCFF1, 0x7368, 0xD4BC, 0x736A, 0xFCEA, 0x7370, 0xE7BE, 0x7372, 0xFCF2, 0x7375, 0xD6B4, + 0x7378, 0xE2AE, 0x737A, 0xD3B7, 0x737B, 0xFACC, 0x7384, 0xFADC, 0x7386, 0xEDB5, 0x7387, 0xE1E3, 0x7389, 0xE8AC, 0x738B, 0xE8DD, + 0x738E, 0xEFE9, 0x7394, 0xF4BD, 0x7396, 0xCFB8, 0x7397, 0xE9DB, 0x7398, 0xD1AC, 0x739F, 0xDAC7, 0x73A7, 0xEBC9, 0x73A9, 0xE8CC, + 0x73AD, 0xDEB7, 0x73B2, 0xD6BC, 0x73B3, 0xD3E5, 0x73B9, 0xFADD, 0x73C0, 0xDAD6, 0x73C2, 0xCAB1, 0x73C9, 0xDAC8, 0x73CA, 0xDFA6, + 0x73CC, 0xF9B3, 0x73CD, 0xF2D2, 0x73CF, 0xCAC4, 0x73D6, 0xCECB, 0x73D9, 0xCDF5, 0x73DD, 0xFDB0, 0x73DE, 0xD5A8, 0x73E0, 0xF1C1, + 0x73E3, 0xE2E9, 0x73E4, 0xDCCA, 0x73E5, 0xECB4, 0x73E6, 0xFAC0, 0x73E9, 0xFBA8, 0x73EA, 0xD0A8, 0x73ED, 0xDAEC, 0x73F7, 0xD9EE, + 0x73F9, 0xE0FB, 0x73FD, 0xEFEA, 0x73FE, 0xFADE, 0x7401, 0xE0C4, 0x7403, 0xCFB9, 0x7405, 0xD5CA, 0x7406, 0xD7E2, 0x7407, 0xE2AF, + 0x7409, 0xD7B8, 0x7413, 0xE8CD, 0x741B, 0xF6DA, 0x7420, 0xEFA2, 0x7421, 0xE2DA, 0x7422, 0xF6FC, 0x7425, 0xFBD0, 0x7426, 0xD1AD, + 0x7428, 0xCDE4, 0x742A, 0xD1AE, 0x742B, 0xDCED, 0x742C, 0xE8CE, 0x742E, 0xF0F9, 0x742F, 0xCEB5, 0x7430, 0xE6FC, 0x7433, 0xD7FB, + 0x7434, 0xD0D6, 0x7435, 0xDDF5, 0x7436, 0xF7F1, 0x7438, 0xF6FD, 0x743A, 0xDBF7, 0x743F, 0xFBEA, 0x7440, 0xE9DC, 0x7441, 0xD9C1, + 0x7443, 0xF5F2, 0x7444, 0xE0C5, 0x744B, 0xEAD4, 0x7455, 0xF9C2, 0x7457, 0xEABC, 0x7459, 0xD2C5, 0x745A, 0xFBD1, 0x745B, 0xE7C0, + 0x745C, 0xEBA5, 0x745E, 0xDFFA, 0x745F, 0xE3A2, 0x7460, 0xD7B9, 0x7462, 0xE9C3, 0x7464, 0xE8FD, 0x7465, 0xE8AF, 0x7468, 0xF2D3, + 0x7469, 0xFBA9, 0x746A, 0xD8A5, 0x746F, 0xD5CB, 0x747E, 0xD0C8, 0x7482, 0xD1AF, 0x7483, 0xD7E3, 0x7487, 0xE0C6, 0x7489, 0xD6A2, + 0x748B, 0xEDF0, 0x7498, 0xD7F3, 0x749C, 0xFCD4, 0x749E, 0xDAD7, 0x749F, 0xCCDF, 0x74A1, 0xF2D4, 0x74A3, 0xD1B0, 0x74A5, 0xCCE0, + 0x74A7, 0xDBFD, 0x74A8, 0xF3BF, 0x74AA, 0xF0D1, 0x74B0, 0xFCBB, 0x74B2, 0xE2B0, 0x74B5, 0xE6A5, 0x74B9, 0xE2DB, 0x74BD, 0xDFDE, + 0x74BF, 0xE0C7, 0x74C6, 0xF2EF, 0x74CA, 0xCCE1, 0x74CF, 0xD6EA, 0x74D4, 0xE7C2, 0x74D8, 0xCEB6, 0x74DA, 0xF3C0, 0x74DC, 0xCDFE, + 0x74E0, 0xFBD2, 0x74E2, 0xF8F8, 0x74E3, 0xF7FB, 0x74E6, 0xE8BF, 0x74EE, 0xE8B7, 0x74F7, 0xEDB6, 0x7501, 0xDCBA, 0x7504, 0xCCB4, + 0x7511, 0xF1F7, 0x7515, 0xE8B8, 0x7518, 0xCAF6, 0x751A, 0xE4A4, 0x751B, 0xF4D6, 0x751F, 0xDFE6, 0x7523, 0xDFA7, 0x7525, 0xDFE7, + 0x7526, 0xE1C1, 0x7528, 0xE9C4, 0x752B, 0xDCCB, 0x752C, 0xE9C5, 0x7530, 0xEFA3, 0x7531, 0xEBA6, 0x7532, 0xCBA3, 0x7533, 0xE3E9, + 0x7537, 0xD1FB, 0x7538, 0xEFA4, 0x753A, 0xEFEB, 0x7547, 0xD0B4, 0x754C, 0xCDA3, 0x754F, 0xE8E6, 0x7551, 0xEFA5, 0x7553, 0xD3CC, + 0x7554, 0xDAED, 0x7559, 0xD7BA, 0x755B, 0xF2D5, 0x755C, 0xF5E5, 0x755D, 0xD9EF, 0x7562, 0xF9B4, 0x7565, 0xD5D4, 0x7566, 0xFDCF, + 0x756A, 0xDBE3, 0x756F, 0xF1E1, 0x7570, 0xECB6, 0x7575, 0xFBFE, 0x7576, 0xD3D7, 0x7578, 0xD1B1, 0x757A, 0xCBB1, 0x757F, 0xD1B2, + 0x7586, 0xCBB2, 0x7587, 0xF1C2, 0x758A, 0xF4E1, 0x758B, 0xF9B5, 0x758E, 0xE1C3, 0x758F, 0xE1C2, 0x7591, 0xEBF7, 0x759D, 0xDFA8, + 0x75A5, 0xCBCA, 0x75AB, 0xE6B9, 0x75B1, 0xF8DE, 0x75B2, 0xF9AA, 0x75B3, 0xCAF7, 0x75B5, 0xEDB7, 0x75B8, 0xD3B8, 0x75B9, 0xF2D6, + 0x75BC, 0xD4D9, 0x75BD, 0xEEC5, 0x75BE, 0xF2F0, 0x75C2, 0xCAB2, 0x75C5, 0xDCBB, 0x75C7, 0xF1F8, 0x75CD, 0xECB7, 0x75D2, 0xE5CA, + 0x75D4, 0xF6C0, 0x75D5, 0xFDDD, 0x75D8, 0xD4E3, 0x75D9, 0xCCE2, 0x75DB, 0xF7D4, 0x75E2, 0xD7E5, 0x75F0, 0xD3C3, 0x75F2, 0xD8A6, + 0x75F4, 0xF6C1, 0x75FA, 0xDDF6, 0x75FC, 0xCDC0, 0x7600, 0xE5DC, 0x760D, 0xE5CB, 0x7619, 0xE1C4, 0x761F, 0xE8B0, 0x7620, 0xF4B0, + 0x7621, 0xF3EA, 0x7622, 0xDAEE, 0x7624, 0xD7BB, 0x7626, 0xE2B1, 0x763B, 0xD7AA, 0x7642, 0xD6FB, 0x764C, 0xE4DF, 0x764E, 0xCAD6, + 0x7652, 0xEBA8, 0x7656, 0xDBFE, 0x7661, 0xF6C2, 0x7664, 0xEFBB, 0x7669, 0xD4FD, 0x766C, 0xE0C8, 0x7670, 0xE8B9, 0x7672, 0xEFA6, + 0x7678, 0xCDA4, 0x767B, 0xD4F4, 0x767C, 0xDBA1, 0x767D, 0xDBDC, 0x767E, 0xDBDD, 0x7684, 0xEEDC, 0x7686, 0xCBCB, 0x7687, 0xFCD5, + 0x768E, 0xCEEB, 0x7690, 0xCDC1, 0x7693, 0xFBD3, 0x76AE, 0xF9AB, 0x76BA, 0xF5D4, 0x76BF, 0xD9A9, 0x76C2, 0xE9DD, 0x76C3, 0xDBCD, + 0x76C6, 0xDDCE, 0x76C8, 0xE7C3, 0x76CA, 0xECCC, 0x76D2, 0xF9EC, 0x76D6, 0xCBCC, 0x76DB, 0xE0FC, 0x76DC, 0xD4A8, 0x76DE, 0xEDD3, + 0x76DF, 0xD8EF, 0x76E1, 0xF2D7, 0x76E3, 0xCAF8, 0x76E4, 0xDAEF, 0x76E7, 0xD6D4, 0x76EE, 0xD9CD, 0x76F2, 0xD8EE, 0x76F4, 0xF2C1, + 0x76F8, 0xDFD3, 0x76FC, 0xDAF0, 0x76FE, 0xE2EA, 0x7701, 0xE0FD, 0x7704, 0xD8F8, 0x7708, 0xF7AF, 0x7709, 0xDAB6, 0x770B, 0xCAD7, + 0x771E, 0xF2D8, 0x7720, 0xD8F9, 0x7729, 0xFADF, 0x7737, 0xCFEF, 0x7738, 0xD9C2, 0x773A, 0xF0D2, 0x773C, 0xE4D1, 0x7740, 0xF3B7, + 0x774D, 0xFAE0, 0x775B, 0xEFEC, 0x7761, 0xE2B2, 0x7763, 0xD4BD, 0x7766, 0xD9CE, 0x776B, 0xF4E2, 0x7779, 0xD4A9, 0x777E, 0xCDC2, + 0x777F, 0xE7DA, 0x778B, 0xF2D9, 0x7791, 0xD9AA, 0x779E, 0xD8BE, 0x77A5, 0xDCAD, 0x77AC, 0xE2EB, 0x77AD, 0xD6FC, 0x77B0, 0xCAF9, + 0x77B3, 0xD4DA, 0x77BB, 0xF4D7, 0x77BC, 0xCCA1, 0x77BF, 0xCFBA, 0x77D7, 0xF5B8, 0x77DB, 0xD9C3, 0x77DC, 0xD0E8, 0x77E2, 0xE3C5, + 0x77E3, 0xEBF8, 0x77E5, 0xF2B1, 0x77E9, 0xCFBB, 0x77ED, 0xD3AD, 0x77EE, 0xE8E1, 0x77EF, 0xCEEC, 0x77F3, 0xE0B4, 0x7802, 0xDEE3, + 0x7812, 0xDDF7, 0x7825, 0xF2B2, 0x7826, 0xF3F6, 0x7827, 0xF6DB, 0x782C, 0xD7FE, 0x7832, 0xF8DF, 0x7834, 0xF7F2, 0x7845, 0xD0A9, + 0x784F, 0xE6DA, 0x785D, 0xF5A6, 0x786B, 0xD7BC, 0x786C, 0xCCE3, 0x786F, 0xE6DB, 0x787C, 0xDDDD, 0x7881, 0xD1B3, 0x7887, 0xEFED, + 0x788C, 0xD6DE, 0x788D, 0xE4F4, 0x788E, 0xE1EF, 0x7891, 0xDDF8, 0x7897, 0xE8CF, 0x78A3, 0xCAE5, 0x78A7, 0xDCA1, 0x78A9, 0xE0B5, + 0x78BA, 0xFCAC, 0x78BB, 0xFCAD, 0x78BC, 0xD8A7, 0x78C1, 0xEDB8, 0x78C5, 0xDBB6, 0x78CA, 0xD6F0, 0x78CB, 0xF3AF, 0x78CE, 0xCDA5, + 0x78D0, 0xDAF1, 0x78E8, 0xD8A8, 0x78EC, 0xCCE4, 0x78EF, 0xD1B4, 0x78F5, 0xCAD8, 0x78FB, 0xDAF2, 0x7901, 0xF5A7, 0x790E, 0xF5A8, + 0x7916, 0xE6A6, 0x792A, 0xD5EC, 0x792B, 0xD5F8, 0x792C, 0xDAF3, 0x793A, 0xE3C6, 0x793E, 0xDEE4, 0x7940, 0xDEE5, 0x7941, 0xD1B5, + 0x7947, 0xD1B6, 0x7948, 0xD1B7, 0x7949, 0xF2B3, 0x7950, 0xE9DE, 0x7956, 0xF0D3, 0x7957, 0xF2B4, 0x795A, 0xF0D4, 0x795B, 0xCBE4, + 0x795C, 0xFBD4, 0x795D, 0xF5E6, 0x795E, 0xE3EA, 0x7960, 0xDEE6, 0x7965, 0xDFD4, 0x7968, 0xF8F9, 0x796D, 0xF0AE, 0x797A, 0xD1B8, + 0x797F, 0xD6DF, 0x7981, 0xD0D7, 0x798D, 0xFCA1, 0x798E, 0xEFEE, 0x798F, 0xDCD8, 0x7991, 0xE9DF, 0x79A6, 0xE5DD, 0x79A7, 0xFDFB, + 0x79AA, 0xE0C9, 0x79AE, 0xD6C9, 0x79B1, 0xD4AA, 0x79B3, 0xE5CC, 0x79B9, 0xE9E0, 0x79BD, 0xD0D8, 0x79BE, 0xFCA2, 0x79BF, 0xD4BE, + 0x79C0, 0xE2B3, 0x79C1, 0xDEE7, 0x79C9, 0xDCBC, 0x79CA, 0xD2B6, 0x79CB, 0xF5D5, 0x79D1, 0xCEA1, 0x79D2, 0xF5A9, 0x79D5, 0xDDF9, + 0x79D8, 0xDDFA, 0x79DF, 0xF0D5, 0x79E4, 0xF6DF, 0x79E6, 0xF2DA, 0x79E7, 0xE4EB, 0x79E9, 0xF2F1, 0x79FB, 0xECB9, 0x7A00, 0xFDFC, + 0x7A05, 0xE1AA, 0x7A08, 0xCAD9, 0x7A0B, 0xEFEF, 0x7A0D, 0xF5AA, 0x7A14, 0xECF9, 0x7A17, 0xF8AD, 0x7A19, 0xF2C2, 0x7A1A, 0xF6C3, + 0x7A1C, 0xD7D2, 0x7A1F, 0xF9A2, 0x7A20, 0xF0D6, 0x7A2E, 0xF0FA, 0x7A31, 0xF6E0, 0x7A36, 0xE9F3, 0x7A37, 0xF2C3, 0x7A3B, 0xD4AB, + 0x7A3C, 0xCAB3, 0x7A3D, 0xCDA6, 0x7A3F, 0xCDC3, 0x7A40, 0xCDDA, 0x7A46, 0xD9CF, 0x7A49, 0xF6C4, 0x7A4D, 0xEEDD, 0x7A4E, 0xE7C4, + 0x7A57, 0xE2B4, 0x7A61, 0xDFE2, 0x7A62, 0xE7DB, 0x7A69, 0xE8B1, 0x7A6B, 0xFCAE, 0x7A70, 0xE5CD, 0x7A74, 0xFAEB, 0x7A76, 0xCFBC, + 0x7A79, 0xCFE2, 0x7A7A, 0xCDF6, 0x7A7D, 0xEFF0, 0x7A7F, 0xF4BE, 0x7A81, 0xD4CD, 0x7A84, 0xF3B8, 0x7A88, 0xE9A1, 0x7A92, 0xF2F2, + 0x7A93, 0xF3EB, 0x7A95, 0xF0D7, 0x7A98, 0xCFD7, 0x7A9F, 0xCFDF, 0x7AA9, 0xE8C0, 0x7AAA, 0xE8C1, 0x7AAE, 0xCFE3, 0x7AAF, 0xE9A2, + 0x7ABA, 0xD0AA, 0x7AC4, 0xF3C1, 0x7AC5, 0xD0AB, 0x7AC7, 0xD4E4, 0x7ACA, 0xEFBC, 0x7ACB, 0xD8A1, 0x7AD7, 0xD9DF, 0x7AD9, 0xF3D7, + 0x7ADD, 0xDCBD, 0x7ADF, 0xCCE5, 0x7AE0, 0xEDF1, 0x7AE3, 0xF1E2, 0x7AE5, 0xD4DB, 0x7AEA, 0xE2B5, 0x7AED, 0xCAE6, 0x7AEF, 0xD3AE, + 0x7AF6, 0xCCE6, 0x7AF9, 0xF1D3, 0x7AFA, 0xF5E7, 0x7AFF, 0xCADA, 0x7B0F, 0xFBEE, 0x7B11, 0xE1C5, 0x7B19, 0xDFE9, 0x7B1B, 0xEEDE, + 0x7B1E, 0xF7C2, 0x7B20, 0xD8A2, 0x7B26, 0xDDAC, 0x7B2C, 0xF0AF, 0x7B2D, 0xD6BD, 0x7B39, 0xE1AB, 0x7B46, 0xF9B6, 0x7B49, 0xD4F5, + 0x7B4B, 0xD0C9, 0x7B4C, 0xEFA7, 0x7B4D, 0xE2EC, 0x7B4F, 0xDBEA, 0x7B50, 0xCECC, 0x7B51, 0xF5E8, 0x7B52, 0xF7D5, 0x7B54, 0xD3CD, + 0x7B56, 0xF3FE, 0x7B60, 0xD0B5, 0x7B6C, 0xE0FE, 0x7B6E, 0xDFFB, 0x7B75, 0xE6DD, 0x7B7D, 0xE8A4, 0x7B87, 0xCBCD, 0x7B8B, 0xEFA8, + 0x7B8F, 0xEEB4, 0x7B94, 0xDAD8, 0x7B95, 0xD1B9, 0x7B97, 0xDFA9, 0x7B9A, 0xF3B0, 0x7B9D, 0xCCC4, 0x7BA1, 0xCEB7, 0x7BAD, 0xEFA9, + 0x7BB1, 0xDFD5, 0x7BB4, 0xEDD7, 0x7BB8, 0xEEC6, 0x7BC0, 0xEFBD, 0x7BC1, 0xFCD6, 0x7BC4, 0xDBF4, 0x7BC6, 0xEFAA, 0x7BC7, 0xF8B9, + 0x7BC9, 0xF5E9, 0x7BD2, 0xE3D9, 0x7BE0, 0xE1C6, 0x7BE4, 0xD4BF, 0x7BE9, 0xDEE8, 0x7C07, 0xF0EA, 0x7C12, 0xF3C2, 0x7C1E, 0xD3AF, + 0x7C21, 0xCADB, 0x7C27, 0xFCD7, 0x7C2A, 0xEDD8, 0x7C2B, 0xE1C7, 0x7C3D, 0xF4D8, 0x7C3E, 0xD6B3, 0x7C3F, 0xDDAD, 0x7C43, 0xD5BE, + 0x7C4C, 0xF1C3, 0x7C4D, 0xEEDF, 0x7C60, 0xD6EB, 0x7C64, 0xF4D9, 0x7C6C, 0xD7E6, 0x7C73, 0xDAB7, 0x7C83, 0xDDFB, 0x7C89, 0xDDCF, + 0x7C92, 0xD8A3, 0x7C95, 0xDAD9, 0x7C97, 0xF0D8, 0x7C98, 0xEFC4, 0x7C9F, 0xE1D8, 0x7CA5, 0xF1D4, 0x7CA7, 0xEDF2, 0x7CAE, 0xD5DB, + 0x7CB1, 0xD5DC, 0x7CB2, 0xF3C4, 0x7CB3, 0xCBD7, 0x7CB9, 0xE2B6, 0x7CBE, 0xEFF1, 0x7CCA, 0xFBD5, 0x7CD6, 0xD3D8, 0x7CDE, 0xDDD0, + 0x7CDF, 0xF0D9, 0x7CE0, 0xCBB3, 0x7CE7, 0xD5DD, 0x7CFB, 0xCDA7, 0x7CFE, 0xD0AC, 0x7D00, 0xD1BA, 0x7D02, 0xF1C4, 0x7D04, 0xE5B3, + 0x7D05, 0xFBF5, 0x7D06, 0xE9E1, 0x7D07, 0xFDE0, 0x7D08, 0xFCBC, 0x7D0A, 0xDAA2, 0x7D0B, 0xDAA3, 0x7D0D, 0xD2A1, 0x7D10, 0xD2EF, + 0x7D14, 0xE2ED, 0x7D17, 0xDEE9, 0x7D18, 0xCEDC, 0x7D19, 0xF2B5, 0x7D1A, 0xD0E4, 0x7D1B, 0xDDD1, 0x7D20, 0xE1C8, 0x7D21, 0xDBB7, + 0x7D22, 0xDFE3, 0x7D2B, 0xEDB9, 0x7D2C, 0xF1C5, 0x7D2E, 0xF3CF, 0x7D2F, 0xD7AB, 0x7D30, 0xE1AC, 0x7D33, 0xE3EB, 0x7D35, 0xEEC7, + 0x7D39, 0xE1C9, 0x7D3A, 0xCAFA, 0x7D42, 0xF0FB, 0x7D43, 0xFAE1, 0x7D44, 0xF0DA, 0x7D45, 0xCCE7, 0x7D46, 0xDAF4, 0x7D50, 0xCCBF, + 0x7D5E, 0xCEED, 0x7D61, 0xD5A9, 0x7D62, 0xFAE2, 0x7D66, 0xD0E5, 0x7D68, 0xEBD6, 0x7D6A, 0xECDF, 0x7D6E, 0xDFFC, 0x7D71, 0xF7D6, + 0x7D72, 0xDEEA, 0x7D73, 0xCBB4, 0x7D76, 0xEFBE, 0x7D79, 0xCCB5, 0x7D7F, 0xCFBD, 0x7D8E, 0xEFF2, 0x7D8F, 0xE2B7, 0x7D93, 0xCCE8, + 0x7D9C, 0xF0FC, 0x7DA0, 0xD6E0, 0x7DA2, 0xF1C6, 0x7DAC, 0xE2B8, 0x7DAD, 0xEBAB, 0x7DB1, 0xCBB5, 0x7DB2, 0xD8D1, 0x7DB4, 0xF4CE, + 0x7DB5, 0xF3F7, 0x7DB8, 0xD7C6, 0x7DBA, 0xD1BB, 0x7DBB, 0xF7AA, 0x7DBD, 0xEDCA, 0x7DBE, 0xD7D3, 0x7DBF, 0xD8FA, 0x7DC7, 0xF6C5, + 0x7DCA, 0xD1CC, 0x7DCB, 0xDDFC, 0x7DD6, 0xDFFD, 0x7DD8, 0xF9E5, 0x7DDA, 0xE0CA, 0x7DDD, 0xF2FD, 0x7DDE, 0xD3B0, 0x7DE0, 0xF4F3, + 0x7DE1, 0xDAC9, 0x7DE3, 0xE6DE, 0x7DE8, 0xF8BA, 0x7DE9, 0xE8D0, 0x7DEC, 0xD8FB, 0x7DEF, 0xEAD5, 0x7DF4, 0xD6A3, 0x7DFB, 0xF6C6, + 0x7E09, 0xF2DB, 0x7E0A, 0xE4FC, 0x7E15, 0xE8B2, 0x7E1B, 0xDADA, 0x7E1D, 0xF2DC, 0x7E1E, 0xFBD6, 0x7E1F, 0xE9B2, 0x7E21, 0xEEAD, + 0x7E23, 0xFAE3, 0x7E2B, 0xDCEE, 0x7E2E, 0xF5EA, 0x7E2F, 0xE6E0, 0x7E31, 0xF0FD, 0x7E37, 0xD7AC, 0x7E3D, 0xF5C5, 0x7E3E, 0xEEE0, + 0x7E41, 0xDBE5, 0x7E43, 0xDDDE, 0x7E46, 0xD9F0, 0x7E47, 0xE9A3, 0x7E52, 0xF1F9, 0x7E54, 0xF2C4, 0x7E55, 0xE0CB, 0x7E5E, 0xE9A4, + 0x7E61, 0xE2B9, 0x7E69, 0xE3B1, 0x7E6A, 0xFCEB, 0x7E6B, 0xCDA8, 0x7E6D, 0xCCB6, 0x7E70, 0xF0DB, 0x7E79, 0xE6BA, 0x7E7C, 0xCDA9, + 0x7E82, 0xF3C3, 0x7E8C, 0xE1D9, 0x7E8F, 0xEFAB, 0x7E93, 0xE7C5, 0x7E96, 0xE0E9, 0x7E98, 0xF3C5, 0x7E9B, 0xD4C0, 0x7E9C, 0xD5BF, + 0x7F36, 0xDDAE, 0x7F38, 0xF9FC, 0x7F3A, 0xCCC0, 0x7F4C, 0xE5A2, 0x7F50, 0xCEB8, 0x7F54, 0xD8D2, 0x7F55, 0xF9D6, 0x7F6A, 0xF1AA, + 0x7F6B, 0xCED1, 0x7F6E, 0xF6C7, 0x7F70, 0xDBEB, 0x7F72, 0xDFFE, 0x7F75, 0xD8E1, 0x7F77, 0xF7F3, 0x7F79, 0xD7E7, 0x7F85, 0xD4FE, + 0x7F88, 0xD1BC, 0x7F8A, 0xE5CF, 0x7F8C, 0xCBB6, 0x7F8E, 0xDAB8, 0x7F94, 0xCDC4, 0x7F9A, 0xD6BE, 0x7F9E, 0xE2BA, 0x7FA4, 0xCFD8, + 0x7FA8, 0xE0CC, 0x7FA9, 0xEBF9, 0x7FB2, 0xFDFD, 0x7FB8, 0xD7E8, 0x7FB9, 0xCBD8, 0x7FBD, 0xE9E2, 0x7FC1, 0xE8BA, 0x7FC5, 0xE3C7, + 0x7FCA, 0xECCD, 0x7FCC, 0xECCE, 0x7FCE, 0xD6BF, 0x7FD2, 0xE3A7, 0x7FD4, 0xDFD6, 0x7FD5, 0xFDE8, 0x7FDF, 0xEEE1, 0x7FE0, 0xF6A8, + 0x7FE1, 0xDDFD, 0x7FE9, 0xF8BB, 0x7FEB, 0xE8D1, 0x7FF0, 0xF9D7, 0x7FF9, 0xCEEE, 0x7FFC, 0xECCF, 0x8000, 0xE9A5, 0x8001, 0xD6D5, + 0x8003, 0xCDC5, 0x8005, 0xEDBA, 0x8006, 0xD1BD, 0x8009, 0xCFBE, 0x800C, 0xECBB, 0x8010, 0xD2B1, 0x8015, 0xCCE9, 0x8017, 0xD9C4, + 0x8018, 0xE9FC, 0x802D, 0xD1BE, 0x8033, 0xECBC, 0x8036, 0xE5AD, 0x803D, 0xF7B0, 0x803F, 0xCCEA, 0x8043, 0xD3C4, 0x8046, 0xD6C0, + 0x804A, 0xD6FD, 0x8056, 0xE1A1, 0x8058, 0xDEBD, 0x805A, 0xF6A9, 0x805E, 0xDAA4, 0x806F, 0xD6A4, 0x8070, 0xF5C6, 0x8072, 0xE1A2, + 0x8073, 0xE9C6, 0x8077, 0xF2C5, 0x807D, 0xF4E9, 0x807E, 0xD6EC, 0x807F, 0xEBD3, 0x8084, 0xECBD, 0x8085, 0xE2DC, 0x8086, 0xDEEB, + 0x8087, 0xF0DC, 0x8089, 0xEBBF, 0x808B, 0xD7CE, 0x808C, 0xD1BF, 0x8096, 0xF5AB, 0x809B, 0xF9FD, 0x809D, 0xCADC, 0x80A1, 0xCDC6, + 0x80A2, 0xF2B6, 0x80A5, 0xDDFE, 0x80A9, 0xCCB7, 0x80AA, 0xDBB8, 0x80AF, 0xD0E9, 0x80B1, 0xCEDD, 0x80B2, 0xEBC0, 0x80B4, 0xFDA2, + 0x80BA, 0xF8CB, 0x80C3, 0xEAD6, 0x80C4, 0xF1B0, 0x80CC, 0xDBCE, 0x80CE, 0xF7C3, 0x80DA, 0xDBCF, 0x80DB, 0xCBA4, 0x80DE, 0xF8E0, + 0x80E1, 0xFBD7, 0x80E4, 0xEBCA, 0x80E5, 0xE0A1, 0x80F1, 0xCECD, 0x80F4, 0xD4DC, 0x80F8, 0xFDD8, 0x80FD, 0xD2F6, 0x8102, 0xF2B7, + 0x8105, 0xFAF6, 0x8106, 0xF6AA, 0x8107, 0xFAF7, 0x8108, 0xD8E6, 0x810A, 0xF4B1, 0x8118, 0xE8D2, 0x811A, 0xCAC5, 0x811B, 0xCCEB, + 0x8123, 0xE2EE, 0x8129, 0xE2BB, 0x812B, 0xF7AD, 0x812F, 0xF8E1, 0x8139, 0xF3EC, 0x813E, 0xDEA1, 0x814B, 0xE4FD, 0x814E, 0xE3EC, + 0x8150, 0xDDAF, 0x8151, 0xDDB0, 0x8154, 0xCBB7, 0x8155, 0xE8D3, 0x8165, 0xE1A3, 0x8166, 0xD2E0, 0x816B, 0xF0FE, 0x8170, 0xE9A6, + 0x8171, 0xCBF2, 0x8178, 0xEDF3, 0x8179, 0xDCD9, 0x817A, 0xE0CD, 0x817F, 0xF7DA, 0x8180, 0xDBB9, 0x8188, 0xCCAE, 0x818A, 0xDADB, + 0x818F, 0xCDC7, 0x819A, 0xDDB1, 0x819C, 0xD8AF, 0x819D, 0xE3A3, 0x81A0, 0xCEEF, 0x81A3, 0xF2F3, 0x81A8, 0xF8B3, 0x81B3, 0xE0CE, + 0x81B5, 0xF5FD, 0x81BA, 0xEBEC, 0x81BD, 0xD3C5, 0x81BE, 0xFCEC, 0x81BF, 0xD2DB, 0x81C0, 0xD4EB, 0x81C2, 0xDEA2, 0x81C6, 0xE5E6, + 0x81CD, 0xF0B0, 0x81D8, 0xD5C4, 0x81DF, 0xEDF4, 0x81E3, 0xE3ED, 0x81E5, 0xE8C2, 0x81E7, 0xEDF5, 0x81E8, 0xD7FC, 0x81EA, 0xEDBB, + 0x81ED, 0xF6AB, 0x81F3, 0xF2B8, 0x81F4, 0xF6C8, 0x81FA, 0xD3E6, 0x81FB, 0xF2DD, 0x81FC, 0xCFBF, 0x81FE, 0xEBAC, 0x8205, 0xCFC0, + 0x8207, 0xE6A8, 0x8208, 0xFDE9, 0x820A, 0xCFC1, 0x820C, 0xE0DF, 0x820D, 0xDEEC, 0x8212, 0xE0A2, 0x821B, 0xF4BF, 0x821C, 0xE2EF, + 0x821E, 0xD9F1, 0x821F, 0xF1C7, 0x8221, 0xCBB8, 0x822A, 0xF9FE, 0x822B, 0xDBBA, 0x822C, 0xDAF5, 0x8235, 0xF6EC, 0x8236, 0xDADC, + 0x8237, 0xFAE4, 0x8239, 0xE0CF, 0x8240, 0xDDB2, 0x8245, 0xE6A9, 0x8247, 0xEFF3, 0x8259, 0xF3ED, 0x8264, 0xEBFA, 0x8266, 0xF9E6, + 0x826E, 0xCADD, 0x826F, 0xD5DE, 0x8271, 0xCADE, 0x8272, 0xDFE4, 0x8276, 0xE6FD, 0x8278, 0xF5AC, 0x827E, 0xE4F5, 0x828B, 0xE9E3, + 0x828D, 0xEDCB, 0x828E, 0xCFE4, 0x8292, 0xD8D3, 0x8299, 0xDDB3, 0x829A, 0xD4EC, 0x829D, 0xF2B9, 0x829F, 0xDFB7, 0x82A5, 0xCBCE, + 0x82A6, 0xFBD8, 0x82A9, 0xD0D9, 0x82AC, 0xDDD2, 0x82AD, 0xF7F4, 0x82AE, 0xE7DC, 0x82AF, 0xE4A5, 0x82B1, 0xFCA3, 0x82B3, 0xDBBB, + 0x82B7, 0xF2BA, 0x82B8, 0xE9FD, 0x82B9, 0xD0CA, 0x82BB, 0xF5D6, 0x82BC, 0xD9C5, 0x82BD, 0xE4B4, 0x82BF, 0xEDA7, 0x82D1, 0xEABD, + 0x82D2, 0xE6FE, 0x82D4, 0xF7C4, 0x82D5, 0xF5AD, 0x82D7, 0xD9E0, 0x82DB, 0xCAB4, 0x82DE, 0xF8E2, 0x82DF, 0xCFC2, 0x82E1, 0xECBE, + 0x82E5, 0xE5B4, 0x82E6, 0xCDC8, 0x82E7, 0xEEC8, 0x82F1, 0xE7C8, 0x82FD, 0xCDC9, 0x82FE, 0xF9B7, 0x8301, 0xF1E8, 0x8302, 0xD9F2, + 0x8303, 0xDBF5, 0x8304, 0xCAB5, 0x8305, 0xD9C6, 0x8309, 0xD8C9, 0x8317, 0xD9AB, 0x8328, 0xEDBC, 0x832B, 0xD8D4, 0x832F, 0xDCDA, + 0x8331, 0xE2BC, 0x8334, 0xFCED, 0x8335, 0xECE0, 0x8336, 0xD2FE, 0x8338, 0xE9C7, 0x8339, 0xE6AA, 0x8340, 0xE2F0, 0x8347, 0xFABB, + 0x8349, 0xF5AE, 0x834A, 0xFBAA, 0x834F, 0xECFB, 0x8351, 0xECBF, 0x8352, 0xFCD8, 0x8373, 0xD4E5, 0x8377, 0xF9C3, 0x837B, 0xEEE2, + 0x8389, 0xD7E9, 0x838A, 0xEDF6, 0x838E, 0xDEED, 0x8396, 0xCCEC, 0x8398, 0xE3EE, 0x839E, 0xE8D4, 0x83A2, 0xFAF8, 0x83A9, 0xDDB4, + 0x83AA, 0xE4B5, 0x83AB, 0xD8B0, 0x83BD, 0xD8D5, 0x83C1, 0xF4EA, 0x83C5, 0xCEB9, 0x83C9, 0xD6E1, 0x83CA, 0xCFD2, 0x83CC, 0xD0B6, + 0x83D3, 0xCEA2, 0x83D6, 0xF3EE, 0x83DC, 0xF3F8, 0x83E9, 0xDCCC, 0x83EB, 0xD0CB, 0x83EF, 0xFCA4, 0x83F0, 0xCDCA, 0x83F1, 0xD7D4, + 0x83F2, 0xDEA3, 0x83F4, 0xE4E0, 0x83F9, 0xEEC9, 0x83FD, 0xE2DD, 0x8403, 0xF5FE, 0x8404, 0xD4AC, 0x840A, 0xD5D1, 0x840C, 0xD8F0, + 0x840D, 0xF8C3, 0x840E, 0xEAD7, 0x8429, 0xF5D7, 0x842C, 0xD8BF, 0x8431, 0xFDC0, 0x8438, 0xEBAD, 0x843D, 0xD5AA, 0x8449, 0xE7A8, + 0x8457, 0xEECA, 0x845B, 0xCAE7, 0x8461, 0xF8E3, 0x8463, 0xD4DD, 0x8466, 0xEAD8, 0x846B, 0xFBD9, 0x846C, 0xEDF7, 0x846F, 0xE5B5, + 0x8475, 0xD0AD, 0x847A, 0xF1F1, 0x8490, 0xE2BD, 0x8494, 0xE3C8, 0x8499, 0xD9D5, 0x849C, 0xDFAA, 0x84A1, 0xDBBC, 0x84B2, 0xF8E4, + 0x84B8, 0xF1FA, 0x84BB, 0xE5B6, 0x84BC, 0xF3EF, 0x84BF, 0xFBDA, 0x84C0, 0xE1E0, 0x84C2, 0xD9AC, 0x84C4, 0xF5EB, 0x84C6, 0xE0B6, + 0x84C9, 0xE9C8, 0x84CB, 0xCBCF, 0x84CD, 0xE3C9, 0x84D1, 0xDEEE, 0x84DA, 0xE2BE, 0x84EC, 0xDCEF, 0x84EE, 0xD6A5, 0x84F4, 0xE2F1, + 0x84FC, 0xD6FE, 0x8511, 0xD9A1, 0x8513, 0xD8C0, 0x8514, 0xDCDB, 0x8517, 0xEDBD, 0x8518, 0xDFB8, 0x851A, 0xEAA5, 0x851E, 0xD7AD, + 0x8521, 0xF3F9, 0x8523, 0xEDF8, 0x8525, 0xF5C7, 0x852C, 0xE1CA, 0x852D, 0xEBE3, 0x852F, 0xF2DE, 0x853D, 0xF8CC, 0x853F, 0xEAD9, + 0x8541, 0xD3C6, 0x8543, 0xDBE6, 0x8549, 0xF5AF, 0x854E, 0xCEF0, 0x8553, 0xE9FE, 0x8559, 0xFBB6, 0x8563, 0xE2F2, 0x8568, 0xCFF2, + 0x8569, 0xF7B9, 0x856A, 0xD9F3, 0x856D, 0xE1CB, 0x8584, 0xDADD, 0x8587, 0xDAB9, 0x858F, 0xEBFB, 0x8591, 0xCBB9, 0x8594, 0xEDF9, + 0x859B, 0xE0E0, 0x85A6, 0xF4C0, 0x85A8, 0xFDBC, 0x85A9, 0xDFB1, 0x85AA, 0xE3EF, 0x85AF, 0xE0A3, 0x85B0, 0xFDB9, 0x85BA, 0xF0B1, + 0x85C1, 0xCDCB, 0x85C9, 0xEDBE, 0x85CD, 0xD5C0, 0x85CE, 0xE3F0, 0x85CF, 0xEDFA, 0x85D5, 0xE9E4, 0x85DC, 0xD5ED, 0x85DD, 0xE7DD, + 0x85E4, 0xD4F6, 0x85E5, 0xE5B7, 0x85E9, 0xDBE7, 0x85EA, 0xE2BF, 0x85F7, 0xEECB, 0x85FA, 0xD7F4, 0x85FB, 0xF0DD, 0x85FF, 0xCEAB, + 0x8602, 0xE7DE, 0x8606, 0xD6D6, 0x8607, 0xE1CC, 0x860A, 0xE8B3, 0x8616, 0xE5EE, 0x8617, 0xDCA2, 0x861A, 0xE0D0, 0x862D, 0xD5B5, + 0x863F, 0xD5A1, 0x864E, 0xFBDB, 0x8650, 0xF9CB, 0x8654, 0xCBF3, 0x8655, 0xF4A5, 0x865B, 0xFAC8, 0x865C, 0xD6D7, 0x865E, 0xE9E5, + 0x865F, 0xFBDC, 0x8667, 0xFDD0, 0x8679, 0xFBF6, 0x868A, 0xDAA5, 0x868C, 0xDBBD, 0x8693, 0xECE2, 0x86A3, 0xCDF7, 0x86A4, 0xF0DE, + 0x86A9, 0xF6C9, 0x86C7, 0xDEEF, 0x86CB, 0xD3B1, 0x86D4, 0xFCEE, 0x86D9, 0xE8C3, 0x86DB, 0xF1C8, 0x86DF, 0xCEF1, 0x86E4, 0xF9ED, + 0x86ED, 0xF2F4, 0x86FE, 0xE4B6, 0x8700, 0xF5B9, 0x8702, 0xDCF0, 0x8703, 0xE3F1, 0x8708, 0xE8A5, 0x8718, 0xF2BB, 0x871A, 0xDEA4, + 0x871C, 0xDACC, 0x874E, 0xCAE9, 0x8755, 0xE3DA, 0x8757, 0xFCD9, 0x875F, 0xEADA, 0x8766, 0xF9C4, 0x8768, 0xE3A4, 0x8774, 0xFBDD, + 0x8776, 0xEFCA, 0x8778, 0xE8C4, 0x8782, 0xD5CC, 0x878D, 0xEBD7, 0x879F, 0xD9AD, 0x87A2, 0xFBAB, 0x87B3, 0xD3D9, 0x87BA, 0xD5A2, + 0x87C4, 0xF6DE, 0x87E0, 0xDAF6, 0x87EC, 0xE0D1, 0x87EF, 0xE9A8, 0x87F2, 0xF5F9, 0x87F9, 0xFAAF, 0x87FB, 0xEBFC, 0x87FE, 0xE0EA, + 0x8805, 0xE3B2, 0x881F, 0xD5C5, 0x8822, 0xF1E3, 0x8823, 0xD5EE, 0x8831, 0xCDCC, 0x8836, 0xEDD9, 0x883B, 0xD8C1, 0x8840, 0xFAEC, + 0x8846, 0xF1EB, 0x884C, 0xFABC, 0x884D, 0xE6E2, 0x8852, 0xFAE5, 0x8853, 0xE2FA, 0x8857, 0xCAB6, 0x8859, 0xE4B7, 0x885B, 0xEADB, + 0x885D, 0xF5FA, 0x8861, 0xFBAC, 0x8862, 0xCFC3, 0x8863, 0xEBFD, 0x8868, 0xF8FA, 0x886B, 0xDFB9, 0x8870, 0xE1F1, 0x8872, 0xD2A4, + 0x8877, 0xF5FB, 0x887E, 0xD0DA, 0x887F, 0xD0DB, 0x8881, 0xEABE, 0x8882, 0xD9B1, 0x8888, 0xCAB7, 0x888B, 0xD3E7, 0x888D, 0xF8E5, + 0x8892, 0xD3B2, 0x8896, 0xE2C0, 0x8897, 0xF2DF, 0x889E, 0xCDE5, 0x88AB, 0xF9AC, 0x88B4, 0xCDCD, 0x88C1, 0xEEAE, 0x88C2, 0xD6AE, + 0x88CF, 0xD7EA, 0x88D4, 0xE7E0, 0x88D5, 0xEBAE, 0x88D9, 0xCFD9, 0x88DC, 0xDCCD, 0x88DD, 0xEDFB, 0x88DF, 0xDEF0, 0x88E1, 0xD7EB, + 0x88E8, 0xDEA5, 0x88F3, 0xDFD7, 0x88F4, 0xDBD0, 0x88F5, 0xDBD1, 0x88F8, 0xD5A3, 0x88FD, 0xF0B2, 0x8907, 0xDCDC, 0x8910, 0xCAE8, + 0x8912, 0xF8E6, 0x8913, 0xDCCE, 0x8918, 0xEADC, 0x8919, 0xDBD2, 0x8925, 0xE9B3, 0x892A, 0xF7DB, 0x8936, 0xE3A8, 0x8938, 0xD7AE, + 0x893B, 0xE0E1, 0x8941, 0xCBBA, 0x8944, 0xE5D1, 0x895F, 0xD0DC, 0x8964, 0xD5C1, 0x896A, 0xD8CA, 0x8972, 0xE3A9, 0x897F, 0xE0A4, + 0x8981, 0xE9A9, 0x8983, 0xD3C7, 0x8986, 0xDCDD, 0x8987, 0xF8AE, 0x898B, 0xCCB8, 0x898F, 0xD0AE, 0x8993, 0xD8F2, 0x8996, 0xE3CA, + 0x89A1, 0xCCAF, 0x89A9, 0xD4AD, 0x89AA, 0xF6D1, 0x89B2, 0xD0CC, 0x89BA, 0xCAC6, 0x89BD, 0xD5C2, 0x89C0, 0xCEBA, 0x89D2, 0xCAC7, + 0x89E3, 0xFAB0, 0x89F4, 0xDFD8, 0x89F8, 0xF5BA, 0x8A00, 0xE5EB, 0x8A02, 0xEFF4, 0x8A03, 0xDDB5, 0x8A08, 0xCDAA, 0x8A0A, 0xE3F2, + 0x8A0C, 0xFBF7, 0x8A0E, 0xF7D0, 0x8A13, 0xFDBA, 0x8A16, 0xFDE1, 0x8A17, 0xF6FE, 0x8A18, 0xD1C0, 0x8A1B, 0xE8C5, 0x8A1D, 0xE4B8, + 0x8A1F, 0xE1E8, 0x8A23, 0xCCC1, 0x8A25, 0xD2ED, 0x8A2A, 0xDBBE, 0x8A2D, 0xE0E2, 0x8A31, 0xFAC9, 0x8A34, 0xE1CD, 0x8A36, 0xCAB8, + 0x8A3A, 0xF2E0, 0x8A3B, 0xF1C9, 0x8A50, 0xDEF1, 0x8A54, 0xF0DF, 0x8A55, 0xF8C4, 0x8A5B, 0xEECC, 0x8A5E, 0xDEF2, 0x8A60, 0xE7C9, + 0x8A62, 0xE2F3, 0x8A63, 0xE7E1, 0x8A66, 0xE3CB, 0x8A69, 0xE3CC, 0x8A6D, 0xCFF8, 0x8A6E, 0xEFAC, 0x8A70, 0xFDFE, 0x8A71, 0xFCA5, + 0x8A72, 0xFAB1, 0x8A73, 0xDFD9, 0x8A75, 0xE0D2, 0x8A79, 0xF4DA, 0x8A85, 0xF1CA, 0x8A87, 0xCEA3, 0x8A8C, 0xF2BC, 0x8A8D, 0xECE3, + 0x8A93, 0xE0A5, 0x8A95, 0xF7AB, 0x8A98, 0xEBAF, 0x8A9E, 0xE5DE, 0x8AA0, 0xE1A4, 0x8AA1, 0xCDAB, 0x8AA3, 0xD9F4, 0x8AA4, 0xE8A6, + 0x8AA5, 0xCDCE, 0x8AA6, 0xE1E9, 0x8AA8, 0xFCEF, 0x8AAA, 0xE0E3, 0x8AB0, 0xE2C1, 0x8AB2, 0xCEA4, 0x8AB9, 0xDEA6, 0x8ABC, 0xEBFE, + 0x8ABE, 0xEBDD, 0x8ABF, 0xF0E0, 0x8AC2, 0xF4DB, 0x8AC4, 0xE2F4, 0x8AC7, 0xD3C8, 0x8ACB, 0xF4EB, 0x8ACD, 0xEEB5, 0x8ACF, 0xF5D8, + 0x8AD2, 0xD5DF, 0x8AD6, 0xD6E5, 0x8ADB, 0xEBB0, 0x8ADC, 0xF4E3, 0x8AE1, 0xE3CD, 0x8AE6, 0xF4F4, 0x8AE7, 0xFAB2, 0x8AEA, 0xEFF5, + 0x8AEB, 0xCADF, 0x8AED, 0xEBB1, 0x8AEE, 0xEDBF, 0x8AF1, 0xFDC9, 0x8AF6, 0xE4A6, 0x8AF7, 0xF9A4, 0x8AF8, 0xF0B3, 0x8AFA, 0xE5EC, + 0x8AFE, 0xD1E7, 0x8B00, 0xD9C7, 0x8B01, 0xE4D7, 0x8B02, 0xEADD, 0x8B04, 0xD4F7, 0x8B0E, 0xDABA, 0x8B10, 0xDACD, 0x8B14, 0xF9CC, + 0x8B16, 0xE1DA, 0x8B17, 0xDBBF, 0x8B19, 0xCCC5, 0x8B1A, 0xECD0, 0x8B1B, 0xCBBB, 0x8B1D, 0xDEF3, 0x8B20, 0xE9AA, 0x8B28, 0xD9C8, + 0x8B2B, 0xEEE3, 0x8B2C, 0xD7BD, 0x8B33, 0xCFC4, 0x8B39, 0xD0CD, 0x8B41, 0xFCA6, 0x8B49, 0xF1FB, 0x8B4E, 0xFDD2, 0x8B4F, 0xD1C1, + 0x8B58, 0xE3DB, 0x8B5A, 0xD3C9, 0x8B5C, 0xDCCF, 0x8B66, 0xCCED, 0x8B6C, 0xDEA7, 0x8B6F, 0xE6BB, 0x8B70, 0xECA1, 0x8B74, 0xCCB9, + 0x8B77, 0xFBDE, 0x8B7D, 0xE7E2, 0x8B80, 0xD4C1, 0x8B8A, 0xDCA8, 0x8B90, 0xE2C2, 0x8B92, 0xF3D8, 0x8B93, 0xE5D3, 0x8B96, 0xF3D9, + 0x8B9A, 0xF3C6, 0x8C37, 0xCDDB, 0x8C3F, 0xCDAC, 0x8C41, 0xFCC3, 0x8C46, 0xD4E7, 0x8C48, 0xD1C2, 0x8C4A, 0xF9A5, 0x8C4C, 0xE8D5, + 0x8C55, 0xE3CE, 0x8C5A, 0xD4CA, 0x8C61, 0xDFDA, 0x8C6A, 0xFBDF, 0x8C6B, 0xE7E3, 0x8C79, 0xF8FB, 0x8C7A, 0xE3CF, 0x8C82, 0xF5B0, + 0x8C8A, 0xD8E7, 0x8C8C, 0xD9C9, 0x8C9D, 0xF8AF, 0x8C9E, 0xEFF6, 0x8CA0, 0xDDB6, 0x8CA1, 0xEEAF, 0x8CA2, 0xCDF8, 0x8CA7, 0xDEB8, + 0x8CA8, 0xFCA7, 0x8CA9, 0xF7FC, 0x8CAA, 0xF7B1, 0x8CAB, 0xCEBB, 0x8CAC, 0xF4A1, 0x8CAF, 0xEECD, 0x8CB0, 0xE1AE, 0x8CB3, 0xECC3, + 0x8CB4, 0xCFFE, 0x8CB6, 0xF8BF, 0x8CB7, 0xD8E2, 0x8CB8, 0xD3E8, 0x8CBB, 0xDEA8, 0x8CBC, 0xF4E4, 0x8CBD, 0xECC2, 0x8CBF, 0xD9F5, + 0x8CC0, 0xF9C5, 0x8CC1, 0xDDD3, 0x8CC2, 0xD6F1, 0x8CC3, 0xECFC, 0x8CC4, 0xFCF0, 0x8CC7, 0xEDC0, 0x8CC8, 0xCAB9, 0x8CCA, 0xEEE4, + 0x8CD1, 0xF2E1, 0x8CD3, 0xDEB9, 0x8CDA, 0xD6F2, 0x8CDC, 0xDEF4, 0x8CDE, 0xDFDB, 0x8CE0, 0xDBD3, 0x8CE2, 0xFAE7, 0x8CE3, 0xD8E3, + 0x8CE4, 0xF4C1, 0x8CE6, 0xDDB7, 0x8CEA, 0xF2F5, 0x8CED, 0xD4AE, 0x8CF4, 0xD6F3, 0x8CFB, 0xDDB8, 0x8CFC, 0xCFC5, 0x8CFD, 0xDFDF, + 0x8D04, 0xF2BE, 0x8D05, 0xF6A1, 0x8D07, 0xEBCB, 0x8D08, 0xF1FC, 0x8D0A, 0xF3C7, 0x8D0D, 0xE0EB, 0x8D13, 0xEDFC, 0x8D16, 0xE1DB, + 0x8D64, 0xEEE5, 0x8D66, 0xDEF5, 0x8D6B, 0xFAD3, 0x8D70, 0xF1CB, 0x8D73, 0xD0AF, 0x8D74, 0xDDB9, 0x8D77, 0xD1C3, 0x8D85, 0xF5B1, + 0x8D8A, 0xEAC6, 0x8D99, 0xF0E1, 0x8DA3, 0xF6AC, 0x8DA8, 0xF5D9, 0x8DB3, 0xF0EB, 0x8DBA, 0xDDBA, 0x8DBE, 0xF2BF, 0x8DC6, 0xF7C5, + 0x8DCB, 0xDBA2, 0x8DCC, 0xF2F6, 0x8DCF, 0xCABA, 0x8DDB, 0xF7F5, 0x8DDD, 0xCBE5, 0x8DE1, 0xEEE6, 0x8DE3, 0xE0D3, 0x8DE8, 0xCEA5, + 0x8DEF, 0xD6D8, 0x8DF3, 0xD4AF, 0x8E0A, 0xE9C9, 0x8E0F, 0xD3CE, 0x8E10, 0xF4C2, 0x8E1E, 0xCBE6, 0x8E2A, 0xF1A1, 0x8E30, 0xEBB2, + 0x8E35, 0xF1A2, 0x8E42, 0xEBB3, 0x8E44, 0xF0B4, 0x8E47, 0xCBF4, 0x8E48, 0xD4B0, 0x8E49, 0xF3B2, 0x8E4A, 0xFBB7, 0x8E59, 0xF5EC, + 0x8E5F, 0xEEE7, 0x8E60, 0xF4B2, 0x8E74, 0xF5ED, 0x8E76, 0xCFF3, 0x8E81, 0xF0E2, 0x8E87, 0xEECE, 0x8E8A, 0xF1CC, 0x8E8D, 0xE5B8, + 0x8EAA, 0xD7F5, 0x8EAB, 0xE3F3, 0x8EAC, 0xCFE5, 0x8EC0, 0xCFC6, 0x8ECA, 0xF3B3, 0x8ECB, 0xE4D8, 0x8ECC, 0xCFF9, 0x8ECD, 0xCFDA, + 0x8ED2, 0xFACD, 0x8EDF, 0xE6E3, 0x8EEB, 0xF2E2, 0x8EF8, 0xF5EE, 0x8EFB, 0xCABB, 0x8EFE, 0xE3DC, 0x8F03, 0xCEF2, 0x8F05, 0xD6D9, + 0x8F09, 0xEEB0, 0x8F12, 0xF4E5, 0x8F13, 0xD8C2, 0x8F14, 0xDCD0, 0x8F15, 0xCCEE, 0x8F1B, 0xD5E0, 0x8F1C, 0xF6CA, 0x8F1D, 0xFDCA, + 0x8F1E, 0xD8D6, 0x8F1F, 0xF4CF, 0x8F26, 0xD6A6, 0x8F27, 0xDCBE, 0x8F29, 0xDBD4, 0x8F2A, 0xD7C7, 0x8F2F, 0xF2FE, 0x8F33, 0xF1CD, + 0x8F38, 0xE2C3, 0x8F39, 0xDCDE, 0x8F3B, 0xDCDF, 0x8F3E, 0xEFAD, 0x8F3F, 0xE6AB, 0x8F44, 0xF9DD, 0x8F45, 0xEABF, 0x8F49, 0xEFAE, + 0x8F4D, 0xF4D0, 0x8F4E, 0xCEF3, 0x8F5D, 0xE6AC, 0x8F5F, 0xCEDE, 0x8F62, 0xD5F9, 0x8F9B, 0xE3F4, 0x8F9C, 0xCDD0, 0x8FA3, 0xD5B8, + 0x8FA6, 0xF7FD, 0x8FA8, 0xDCA9, 0x8FAD, 0xDEF6, 0x8FAF, 0xDCAA, 0x8FB0, 0xF2E3, 0x8FB1, 0xE9B4, 0x8FB2, 0xD2DC, 0x8FC2, 0xE9E6, + 0x8FC5, 0xE3F6, 0x8FCE, 0xE7CA, 0x8FD1, 0xD0CE, 0x8FD4, 0xDAF7, 0x8FE6, 0xCABC, 0x8FEA, 0xEEE8, 0x8FEB, 0xDADE, 0x8FED, 0xF2F7, + 0x8FF0, 0xE2FB, 0x8FF2, 0xCCA6, 0x8FF7, 0xDABB, 0x8FF9, 0xEEE9, 0x8FFD, 0xF5DA, 0x9000, 0xF7DC, 0x9001, 0xE1EA, 0x9002, 0xCEC1, + 0x9003, 0xD4B1, 0x9005, 0xFDB1, 0x9006, 0xE6BD, 0x9008, 0xFBAD, 0x900B, 0xF8E7, 0x900D, 0xE1CE, 0x900F, 0xF7E2, 0x9010, 0xF5EF, + 0x9011, 0xCFC7, 0x9014, 0xD4B2, 0x9015, 0xCCEF, 0x9017, 0xD4E8, 0x9019, 0xEECF, 0x901A, 0xF7D7, 0x901D, 0xE0A6, 0x901E, 0xD6C1, + 0x901F, 0xE1DC, 0x9020, 0xF0E3, 0x9021, 0xF1E4, 0x9022, 0xDCF1, 0x9023, 0xD6A7, 0x902E, 0xF4F5, 0x9031, 0xF1CE, 0x9032, 0xF2E4, + 0x9035, 0xD0B0, 0x9038, 0xECEF, 0x903C, 0xF9BA, 0x903E, 0xEBB5, 0x9041, 0xD4ED, 0x9042, 0xE2C4, 0x9047, 0xE9E7, 0x904A, 0xEBB4, + 0x904B, 0xEAA1, 0x904D, 0xF8BC, 0x904E, 0xCEA6, 0x9050, 0xF9C6, 0x9051, 0xFCDA, 0x9053, 0xD4B3, 0x9054, 0xD3B9, 0x9055, 0xEADE, + 0x9059, 0xE9AB, 0x905C, 0xE1E1, 0x905D, 0xD3CF, 0x905E, 0xF4F6, 0x9060, 0xEAC0, 0x9061, 0xE1CF, 0x9063, 0xCCBA, 0x9069, 0xEEEA, + 0x906D, 0xF0E4, 0x906E, 0xF3B4, 0x906F, 0xD4EE, 0x9072, 0xF2C0, 0x9075, 0xF1E5, 0x9077, 0xF4C3, 0x9078, 0xE0D4, 0x907A, 0xEBB6, + 0x907C, 0xD7A1, 0x907D, 0xCBE8, 0x907F, 0xF9AD, 0x9080, 0xE9AD, 0x9081, 0xD8E4, 0x9082, 0xFAB3, 0x9083, 0xE2C5, 0x9084, 0xFCBD, + 0x9087, 0xECC4, 0x9088, 0xD8B1, 0x908A, 0xDCAB, 0x908F, 0xD5A4, 0x9091, 0xEBE9, 0x9095, 0xE8BB, 0x9099, 0xD8D7, 0x90A2, 0xFBAE, + 0x90A3, 0xD1E1, 0x90A6, 0xDBC0, 0x90A8, 0xF5BE, 0x90AA, 0xDEF7, 0x90AF, 0xCAFB, 0x90B0, 0xF7C6, 0x90B1, 0xCFC8, 0x90B5, 0xE1D0, + 0x90B8, 0xEED0, 0x90C1, 0xE9F4, 0x90CA, 0xCEF4, 0x90DE, 0xD5CD, 0x90E1, 0xCFDB, 0x90E8, 0xDDBB, 0x90ED, 0xCEAC, 0x90F5, 0xE9E8, + 0x90FD, 0xD4B4, 0x9102, 0xE4C7, 0x9112, 0xF5DB, 0x9115, 0xFAC1, 0x9119, 0xDEA9, 0x9127, 0xD4F8, 0x912D, 0xEFF7, 0x9132, 0xD3B3, + 0x9149, 0xEBB7, 0x914A, 0xEFF8, 0x914B, 0xF5DC, 0x914C, 0xEDCC, 0x914D, 0xDBD5, 0x914E, 0xF1CF, 0x9152, 0xF1D0, 0x9162, 0xF5B2, + 0x9169, 0xD9AE, 0x916A, 0xD5AC, 0x916C, 0xE2C6, 0x9175, 0xFDA3, 0x9177, 0xFBE5, 0x9178, 0xDFAB, 0x9187, 0xE2F5, 0x9189, 0xF6AD, + 0x918B, 0xF5B3, 0x918D, 0xF0B5, 0x9192, 0xE1A5, 0x919C, 0xF5DD, 0x91AB, 0xECA2, 0x91AC, 0xEDFD, 0x91AE, 0xF5B4, 0x91AF, 0xFBB8, + 0x91B1, 0xDBA3, 0x91B4, 0xD6CA, 0x91B5, 0xCBD9, 0x91C0, 0xE5D4, 0x91C7, 0xF3FA, 0x91C9, 0xEBB8, 0x91CB, 0xE0B7, 0x91CC, 0xD7EC, + 0x91CD, 0xF1EC, 0x91CE, 0xE5AF, 0x91CF, 0xD5E1, 0x91D0, 0xD7ED, 0x91D1, 0xD1D1, 0x91D7, 0xE1F2, 0x91D8, 0xEFF9, 0x91DC, 0xDDBC, + 0x91DD, 0xF6DC, 0x91E3, 0xF0E5, 0x91E7, 0xF4C4, 0x91EA, 0xE9E9, 0x91F5, 0xF3FB, 0x920D, 0xD4EF, 0x9210, 0xCCA2, 0x9211, 0xF7FE, + 0x9212, 0xDFBC, 0x9217, 0xEBCD, 0x921E, 0xD0B7, 0x9234, 0xD6C2, 0x923A, 0xE8AD, 0x923F, 0xEFAF, 0x9240, 0xCBA5, 0x9245, 0xCBE9, + 0x9249, 0xFAE8, 0x9257, 0xCCC6, 0x925B, 0xE6E7, 0x925E, 0xEAC7, 0x9262, 0xDBA4, 0x9264, 0xCFC9, 0x9265, 0xE2FC, 0x9266, 0xEFFA, + 0x9280, 0xEBDE, 0x9283, 0xF5C8, 0x9285, 0xD4DE, 0x9291, 0xE0D5, 0x9293, 0xEFB0, 0x9296, 0xE2C7, 0x9298, 0xD9AF, 0x929C, 0xF9E7, + 0x92B3, 0xE7E5, 0x92B6, 0xCFCA, 0x92B7, 0xE1D1, 0x92B9, 0xE2C8, 0x92CC, 0xEFFB, 0x92CF, 0xFAF9, 0x92D2, 0xDCF2, 0x92E4, 0xE0A7, + 0x92EA, 0xF8E8, 0x92F8, 0xCBEA, 0x92FC, 0xCBBC, 0x9304, 0xD6E2, 0x9310, 0xF5DE, 0x9318, 0xF5DF, 0x931A, 0xEEB6, 0x931E, 0xE2F6, + 0x931F, 0xD3CA, 0x9320, 0xEFFC, 0x9321, 0xD1C4, 0x9322, 0xEFB1, 0x9324, 0xD1C5, 0x9326, 0xD0DE, 0x9328, 0xD9E1, 0x932B, 0xE0B8, + 0x932E, 0xCDD1, 0x932F, 0xF3B9, 0x9348, 0xE7CC, 0x934A, 0xD6A8, 0x934B, 0xCEA7, 0x934D, 0xD4B5, 0x9354, 0xE4C8, 0x935B, 0xD3B4, + 0x936E, 0xEBB9, 0x9375, 0xCBF5, 0x937C, 0xF6DD, 0x937E, 0xF1A3, 0x938C, 0xCCC7, 0x9394, 0xE9CA, 0x9396, 0xE1F0, 0x939A, 0xF5E0, + 0x93A3, 0xFBAF, 0x93A7, 0xCBD1, 0x93AC, 0xFBE0, 0x93AD, 0xF2E5, 0x93B0, 0xECF0, 0x93C3, 0xF0EC, 0x93D1, 0xEEEB, 0x93DE, 0xE9CB, + 0x93E1, 0xCCF0, 0x93E4, 0xD7AF, 0x93F6, 0xF3A1, 0x9404, 0xFCF5, 0x9418, 0xF1A4, 0x9425, 0xE0D6, 0x942B, 0xEFB2, 0x9435, 0xF4D1, + 0x9438, 0xF7A1, 0x9444, 0xF1D1, 0x9451, 0xCAFC, 0x9452, 0xCAFD, 0x945B, 0xCECE, 0x947D, 0xF3C8, 0x947F, 0xF3BA, 0x9577, 0xEDFE, + 0x9580, 0xDAA6, 0x9583, 0xE0EC, 0x9589, 0xF8CD, 0x958B, 0xCBD2, 0x958F, 0xEBCE, 0x9591, 0xF9D8, 0x9592, 0xF9D9, 0x9593, 0xCAE0, + 0x9594, 0xDACA, 0x9598, 0xCBA6, 0x95A3, 0xCAC8, 0x95A4, 0xF9EE, 0x95A5, 0xDBEC, 0x95A8, 0xD0B1, 0x95AD, 0xD5EF, 0x95B1, 0xE6F3, + 0x95BB, 0xE7A2, 0x95BC, 0xE4D9, 0x95C7, 0xE4E1, 0x95CA, 0xFCC4, 0x95D4, 0xF9EF, 0x95D5, 0xCFF4, 0x95D6, 0xF7E6, 0x95DC, 0xCEBC, + 0x95E1, 0xF4C5, 0x95E2, 0xDCA3, 0x961C, 0xDDBD, 0x9621, 0xF4C6, 0x962A, 0xF8A1, 0x962E, 0xE8D6, 0x9632, 0xDBC1, 0x963B, 0xF0E6, + 0x963F, 0xE4B9, 0x9640, 0xF6ED, 0x9642, 0xF9AE, 0x9644, 0xDDBE, 0x964B, 0xD7B0, 0x964C, 0xD8E8, 0x964D, 0xCBBD, 0x9650, 0xF9DA, + 0x965B, 0xF8CE, 0x965C, 0xF9F0, 0x965D, 0xE0ED, 0x965E, 0xE3B3, 0x965F, 0xF4B3, 0x9662, 0xEAC2, 0x9663, 0xF2E6, 0x9664, 0xF0B6, + 0x966A, 0xDBD6, 0x9670, 0xEBE4, 0x9673, 0xF2E7, 0x9675, 0xD7D5, 0x9676, 0xD4B6, 0x9677, 0xF9E8, 0x9678, 0xD7C1, 0x967D, 0xE5D5, + 0x9685, 0xE9EA, 0x9686, 0xD7CC, 0x968A, 0xD3E9, 0x968B, 0xE2C9, 0x968D, 0xFCDB, 0x968E, 0xCDAD, 0x9694, 0xCCB0, 0x9695, 0xEAA2, + 0x9698, 0xE4F6, 0x9699, 0xD0C0, 0x969B, 0xF0B7, 0x969C, 0xEEA1, 0x96A3, 0xD7F6, 0x96A7, 0xE2CA, 0x96A8, 0xE2CB, 0x96AA, 0xFACF, + 0x96B1, 0xEBDF, 0x96B7, 0xD6CB, 0x96BB, 0xF4B4, 0x96C0, 0xEDCD, 0x96C1, 0xE4D2, 0x96C4, 0xEAA9, 0x96C5, 0xE4BA, 0x96C6, 0xF3A2, + 0x96C7, 0xCDD2, 0x96C9, 0xF6CB, 0x96CB, 0xF1E6, 0x96CC, 0xEDC1, 0x96CD, 0xE8BC, 0x96CE, 0xEED1, 0x96D5, 0xF0E7, 0x96D6, 0xE2CC, + 0x96D9, 0xE4AA, 0x96DB, 0xF5E1, 0x96DC, 0xEDDA, 0x96E2, 0xD7EE, 0x96E3, 0xD1F1, 0x96E8, 0xE9EB, 0x96E9, 0xE9EC, 0x96EA, 0xE0E4, + 0x96EF, 0xDAA7, 0x96F0, 0xDDD4, 0x96F2, 0xEAA3, 0x96F6, 0xD6C3, 0x96F7, 0xD6F4, 0x96F9, 0xDADF, 0x96FB, 0xEFB3, 0x9700, 0xE2CD, + 0x9706, 0xEFFD, 0x9707, 0xF2E8, 0x9711, 0xEFC5, 0x9713, 0xE7E7, 0x9716, 0xD7FD, 0x9719, 0xE7CE, 0x971C, 0xDFDC, 0x971E, 0xF9C7, + 0x9727, 0xD9F6, 0x9730, 0xDFAC, 0x9732, 0xD6DA, 0x9739, 0xDCA4, 0x973D, 0xF0B8, 0x9742, 0xD5FA, 0x9744, 0xE4F7, 0x9748, 0xD6C4, + 0x9751, 0xF4EC, 0x9756, 0xEFFE, 0x975C, 0xF0A1, 0x975E, 0xDEAA, 0x9761, 0xDABC, 0x9762, 0xD8FC, 0x9769, 0xFAD4, 0x976D, 0xECE5, + 0x9774, 0xFCA8, 0x9777, 0xECE6, 0x977A, 0xD8CB, 0x978B, 0xFBB9, 0x978D, 0xE4D3, 0x978F, 0xCDF9, 0x97A0, 0xCFD3, 0x97A8, 0xCAEA, + 0x97AB, 0xCFD4, 0x97AD, 0xF8BD, 0x97C6, 0xF4C7, 0x97CB, 0xEADF, 0x97D3, 0xF9DB, 0x97DC, 0xD4B7, 0x97F3, 0xEBE5, 0x97F6, 0xE1D2, + 0x97FB, 0xEAA4, 0x97FF, 0xFAC2, 0x9800, 0xFBE1, 0x9801, 0xFAED, 0x9802, 0xF0A2, 0x9803, 0xCCF1, 0x9805, 0xFAA3, 0x9806, 0xE2F7, + 0x9808, 0xE2CE, 0x980A, 0xE9F5, 0x980C, 0xE1EB, 0x9810, 0xE7E8, 0x9811, 0xE8D7, 0x9812, 0xDAF8, 0x9813, 0xD4CB, 0x9817, 0xF7F6, + 0x9818, 0xD6C5, 0x982D, 0xD4E9, 0x9830, 0xFAFA, 0x9838, 0xCCF2, 0x9839, 0xF7DD, 0x983B, 0xDEBA, 0x9846, 0xCEA8, 0x984C, 0xF0B9, + 0x984D, 0xE4FE, 0x984E, 0xE4C9, 0x9854, 0xE4D4, 0x9858, 0xEAC3, 0x985A, 0xEFB4, 0x985E, 0xD7BE, 0x9865, 0xFBE2, 0x9867, 0xCDD3, + 0x986B, 0xEFB5, 0x986F, 0xFAE9, 0x98A8, 0xF9A6, 0x98AF, 0xDFBD, 0x98B1, 0xF7C7, 0x98C4, 0xF8FD, 0x98C7, 0xF8FC, 0x98DB, 0xDEAB, + 0x98DC, 0xDBE8, 0x98DF, 0xE3DD, 0x98E1, 0xE1E2, 0x98E2, 0xD1C6, 0x98ED, 0xF6D0, 0x98EE, 0xEBE6, 0x98EF, 0xDAF9, 0x98F4, 0xECC7, + 0x98FC, 0xDEF8, 0x98FD, 0xF8E9, 0x98FE, 0xE3DE, 0x9903, 0xCEF5, 0x9909, 0xFAC3, 0x990A, 0xE5D7, 0x990C, 0xECC8, 0x9910, 0xF3C9, + 0x9913, 0xE4BB, 0x9918, 0xE6AE, 0x991E, 0xEFB6, 0x9920, 0xDCBF, 0x9928, 0xCEBD, 0x9945, 0xD8C3, 0x9949, 0xD0CF, 0x994B, 0xCFFA, + 0x994C, 0xF3CA, 0x994D, 0xE0D7, 0x9951, 0xD1C7, 0x9952, 0xE9AE, 0x9954, 0xE8BD, 0x9957, 0xFAC4, 0x9996, 0xE2CF, 0x9999, 0xFAC5, + 0x999D, 0xF9B8, 0x99A5, 0xDCE0, 0x99A8, 0xFBB0, 0x99AC, 0xD8A9, 0x99AD, 0xE5DF, 0x99AE, 0xF9A7, 0x99B1, 0xF6EE, 0x99B3, 0xF6CC, + 0x99B4, 0xE2F8, 0x99B9, 0xECF1, 0x99C1, 0xDAE0, 0x99D0, 0xF1D2, 0x99D1, 0xD2CC, 0x99D2, 0xCFCB, 0x99D5, 0xCABD, 0x99D9, 0xDDBF, + 0x99DD, 0xF6EF, 0x99DF, 0xDEF9, 0x99ED, 0xFAB4, 0x99F1, 0xD5AD, 0x99FF, 0xF1E7, 0x9A01, 0xDEBE, 0x9A08, 0xDCC0, 0x9A0E, 0xD1C8, + 0x9A0F, 0xD1C9, 0x9A19, 0xF8BE, 0x9A2B, 0xCBF6, 0x9A30, 0xD4F9, 0x9A36, 0xF5E2, 0x9A37, 0xE1D3, 0x9A40, 0xD8E9, 0x9A43, 0xF8FE, + 0x9A45, 0xCFCC, 0x9A4D, 0xFDA4, 0x9A55, 0xCEF6, 0x9A57, 0xFAD0, 0x9A5A, 0xCCF3, 0x9A5B, 0xE6BE, 0x9A5F, 0xF6AE, 0x9A62, 0xD5F0, + 0x9A65, 0xD1CA, 0x9A69, 0xFCBE, 0x9A6A, 0xD5F1, 0x9AA8, 0xCDE9, 0x9AB8, 0xFAB5, 0x9AD3, 0xE2D0, 0x9AD4, 0xF4F7, 0x9AD8, 0xCDD4, + 0x9AE5, 0xE7A3, 0x9AEE, 0xDBA5, 0x9B1A, 0xE2D1, 0x9B27, 0xD7A2, 0x9B2A, 0xF7E3, 0x9B31, 0xEAA6, 0x9B3C, 0xD0A1, 0x9B41, 0xCEDA, + 0x9B42, 0xFBEB, 0x9B43, 0xDBA6, 0x9B44, 0xDBDE, 0x9B45, 0xD8E5, 0x9B4F, 0xEAE0, 0x9B54, 0xD8AA, 0x9B5A, 0xE5E0, 0x9B6F, 0xD6DB, + 0x9B8E, 0xEFC6, 0x9B91, 0xF8EA, 0x9B9F, 0xE4D5, 0x9BAB, 0xCEF7, 0x9BAE, 0xE0D8, 0x9BC9, 0xD7EF, 0x9BD6, 0xF4ED, 0x9BE4, 0xCDE6, + 0x9BE8, 0xCCF4, 0x9C0D, 0xF5E3, 0x9C10, 0xE4CA, 0x9C12, 0xDCE1, 0x9C15, 0xF9C8, 0x9C25, 0xFCBF, 0x9C32, 0xE8A7, 0x9C3B, 0xD8C4, + 0x9C47, 0xCBBE, 0x9C49, 0xDCAE, 0x9C57, 0xD7F7, 0x9CE5, 0xF0E8, 0x9CE7, 0xDDC0, 0x9CE9, 0xCFCD, 0x9CF3, 0xDCF3, 0x9CF4, 0xD9B0, + 0x9CF6, 0xE6E9, 0x9D09, 0xE4BC, 0x9D1B, 0xEAC4, 0x9D26, 0xE4EC, 0x9D28, 0xE4E5, 0x9D3B, 0xFBF8, 0x9D51, 0xCCBB, 0x9D5D, 0xE4BD, + 0x9D60, 0xCDDC, 0x9D61, 0xD9F7, 0x9D6C, 0xDDDF, 0x9D72, 0xEDCE, 0x9DA9, 0xD9D0, 0x9DAF, 0xE5A3, 0x9DB4, 0xF9CD, 0x9DC4, 0xCDAE, + 0x9DD7, 0xCFCE, 0x9DF2, 0xF6AF, 0x9DF8, 0xFDD3, 0x9DF9, 0xEBED, 0x9DFA, 0xD6DC, 0x9E1A, 0xE5A4, 0x9E1E, 0xD5B6, 0x9E75, 0xD6DD, + 0x9E79, 0xF9E9, 0x9E7D, 0xE7A4, 0x9E7F, 0xD6E3, 0x9E92, 0xD1CB, 0x9E93, 0xD6E4, 0x9E97, 0xD5F2, 0x9E9D, 0xDEFA, 0x9E9F, 0xD7F8, + 0x9EA5, 0xD8EA, 0x9EB4, 0xCFD5, 0x9EB5, 0xD8FD, 0x9EBB, 0xD8AB, 0x9EBE, 0xFDCB, 0x9EC3, 0xFCDC, 0x9ECD, 0xE0A8, 0x9ECE, 0xD5F3, + 0x9ED1, 0xFDD9, 0x9ED4, 0xCCA3, 0x9ED8, 0xD9F9, 0x9EDB, 0xD3EA, 0x9EDC, 0xF5F5, 0x9EDE, 0xEFC7, 0x9EE8, 0xD3DA, 0x9EF4, 0xDABD, + 0x9F07, 0xE8A8, 0x9F08, 0xDCAF, 0x9F0E, 0xF0A3, 0x9F13, 0xCDD5, 0x9F20, 0xE0A9, 0x9F3B, 0xDEAC, 0x9F4A, 0xF0BA, 0x9F4B, 0xEEB1, + 0x9F4E, 0xEEB2, 0x9F52, 0xF6CD, 0x9F5F, 0xEED2, 0x9F61, 0xD6C6, 0x9F67, 0xE0E5, 0x9F6A, 0xF3BB, 0x9F6C, 0xE5E1, 0x9F77, 0xE4CB, + 0x9F8D, 0xD7A3, 0x9F90, 0xDBC2, 0x9F95, 0xCAFE, 0x9F9C, 0xCFCF, 0xAC00, 0xB0A1, 0xAC01, 0xB0A2, 0xAC02, 0x8141, 0xAC03, 0x8142, + 0xAC04, 0xB0A3, 0xAC05, 0x8143, 0xAC06, 0x8144, 0xAC07, 0xB0A4, 0xAC08, 0xB0A5, 0xAC09, 0xB0A6, 0xAC0A, 0xB0A7, 0xAC0B, 0x8145, + 0xAC0C, 0x8146, 0xAC0D, 0x8147, 0xAC0E, 0x8148, 0xAC0F, 0x8149, 0xAC10, 0xB0A8, 0xAC11, 0xB0A9, 0xAC12, 0xB0AA, 0xAC13, 0xB0AB, + 0xAC14, 0xB0AC, 0xAC15, 0xB0AD, 0xAC16, 0xB0AE, 0xAC17, 0xB0AF, 0xAC18, 0x814A, 0xAC19, 0xB0B0, 0xAC1A, 0xB0B1, 0xAC1B, 0xB0B2, + 0xAC1C, 0xB0B3, 0xAC1D, 0xB0B4, 0xAC1E, 0x814B, 0xAC1F, 0x814C, 0xAC20, 0xB0B5, 0xAC21, 0x814D, 0xAC22, 0x814E, 0xAC23, 0x814F, + 0xAC24, 0xB0B6, 0xAC25, 0x8150, 0xAC26, 0x8151, 0xAC27, 0x8152, 0xAC28, 0x8153, 0xAC29, 0x8154, 0xAC2A, 0x8155, 0xAC2B, 0x8156, + 0xAC2C, 0xB0B7, 0xAC2D, 0xB0B8, 0xAC2E, 0x8157, 0xAC2F, 0xB0B9, 0xAC30, 0xB0BA, 0xAC31, 0xB0BB, 0xAC32, 0x8158, 0xAC33, 0x8159, + 0xAC34, 0x815A, 0xAC35, 0x8161, 0xAC36, 0x8162, 0xAC37, 0x8163, 0xAC38, 0xB0BC, 0xAC39, 0xB0BD, 0xAC3A, 0x8164, 0xAC3B, 0x8165, + 0xAC3C, 0xB0BE, 0xAC3D, 0x8166, 0xAC3E, 0x8167, 0xAC3F, 0x8168, 0xAC40, 0xB0BF, 0xAC41, 0x8169, 0xAC42, 0x816A, 0xAC43, 0x816B, + 0xAC44, 0x816C, 0xAC45, 0x816D, 0xAC46, 0x816E, 0xAC47, 0x816F, 0xAC48, 0x8170, 0xAC49, 0x8171, 0xAC4A, 0x8172, 0xAC4B, 0xB0C0, + 0xAC4C, 0x8173, 0xAC4D, 0xB0C1, 0xAC4E, 0x8174, 0xAC4F, 0x8175, 0xAC50, 0x8176, 0xAC51, 0x8177, 0xAC52, 0x8178, 0xAC53, 0x8179, + 0xAC54, 0xB0C2, 0xAC55, 0x817A, 0xAC56, 0x8181, 0xAC57, 0x8182, 0xAC58, 0xB0C3, 0xAC59, 0x8183, 0xAC5A, 0x8184, 0xAC5B, 0x8185, + 0xAC5C, 0xB0C4, 0xAC5D, 0x8186, 0xAC5E, 0x8187, 0xAC5F, 0x8188, 0xAC60, 0x8189, 0xAC61, 0x818A, 0xAC62, 0x818B, 0xAC63, 0x818C, + 0xAC64, 0x818D, 0xAC65, 0x818E, 0xAC66, 0x818F, 0xAC67, 0x8190, 0xAC68, 0x8191, 0xAC69, 0x8192, 0xAC6A, 0x8193, 0xAC6B, 0x8194, + 0xAC6C, 0x8195, 0xAC6D, 0x8196, 0xAC6E, 0x8197, 0xAC6F, 0x8198, 0xAC70, 0xB0C5, 0xAC71, 0xB0C6, 0xAC72, 0x8199, 0xAC73, 0x819A, + 0xAC74, 0xB0C7, 0xAC75, 0x819B, 0xAC76, 0x819C, 0xAC77, 0xB0C8, 0xAC78, 0xB0C9, 0xAC79, 0x819D, 0xAC7A, 0xB0CA, 0xAC7B, 0x819E, + 0xAC7C, 0x819F, 0xAC7D, 0x81A0, 0xAC7E, 0x81A1, 0xAC7F, 0x81A2, 0xAC80, 0xB0CB, 0xAC81, 0xB0CC, 0xAC82, 0x81A3, 0xAC83, 0xB0CD, + 0xAC84, 0xB0CE, 0xAC85, 0xB0CF, 0xAC86, 0xB0D0, 0xAC87, 0x81A4, 0xAC88, 0x81A5, 0xAC89, 0xB0D1, 0xAC8A, 0xB0D2, 0xAC8B, 0xB0D3, + 0xAC8C, 0xB0D4, 0xAC8D, 0x81A6, 0xAC8E, 0x81A7, 0xAC8F, 0x81A8, 0xAC90, 0xB0D5, 0xAC91, 0x81A9, 0xAC92, 0x81AA, 0xAC93, 0x81AB, + 0xAC94, 0xB0D6, 0xAC95, 0x81AC, 0xAC96, 0x81AD, 0xAC97, 0x81AE, 0xAC98, 0x81AF, 0xAC99, 0x81B0, 0xAC9A, 0x81B1, 0xAC9B, 0x81B2, + 0xAC9C, 0xB0D7, 0xAC9D, 0xB0D8, 0xAC9E, 0x81B3, 0xAC9F, 0xB0D9, 0xACA0, 0xB0DA, 0xACA1, 0xB0DB, 0xACA2, 0x81B4, 0xACA3, 0x81B5, + 0xACA4, 0x81B6, 0xACA5, 0x81B7, 0xACA6, 0x81B8, 0xACA7, 0x81B9, 0xACA8, 0xB0DC, 0xACA9, 0xB0DD, 0xACAA, 0xB0DE, 0xACAB, 0x81BA, + 0xACAC, 0xB0DF, 0xACAD, 0x81BB, 0xACAE, 0x81BC, 0xACAF, 0xB0E0, 0xACB0, 0xB0E1, 0xACB1, 0x81BD, 0xACB2, 0x81BE, 0xACB3, 0x81BF, + 0xACB4, 0x81C0, 0xACB5, 0x81C1, 0xACB6, 0x81C2, 0xACB7, 0x81C3, 0xACB8, 0xB0E2, 0xACB9, 0xB0E3, 0xACBA, 0x81C4, 0xACBB, 0xB0E4, + 0xACBC, 0xB0E5, 0xACBD, 0xB0E6, 0xACBE, 0x81C5, 0xACBF, 0x81C6, 0xACC0, 0x81C7, 0xACC1, 0xB0E7, 0xACC2, 0x81C8, 0xACC3, 0x81C9, + 0xACC4, 0xB0E8, 0xACC5, 0x81CA, 0xACC6, 0x81CB, 0xACC7, 0x81CC, 0xACC8, 0xB0E9, 0xACC9, 0x81CD, 0xACCA, 0x81CE, 0xACCB, 0x81CF, + 0xACCC, 0xB0EA, 0xACCD, 0x81D0, 0xACCE, 0x81D1, 0xACCF, 0x81D2, 0xACD0, 0x81D3, 0xACD1, 0x81D4, 0xACD2, 0x81D5, 0xACD3, 0x81D6, + 0xACD4, 0x81D7, 0xACD5, 0xB0EB, 0xACD6, 0x81D8, 0xACD7, 0xB0EC, 0xACD8, 0x81D9, 0xACD9, 0x81DA, 0xACDA, 0x81DB, 0xACDB, 0x81DC, + 0xACDC, 0x81DD, 0xACDD, 0x81DE, 0xACDE, 0x81DF, 0xACDF, 0x81E0, 0xACE0, 0xB0ED, 0xACE1, 0xB0EE, 0xACE2, 0x81E1, 0xACE3, 0x81E2, + 0xACE4, 0xB0EF, 0xACE5, 0x81E3, 0xACE6, 0x81E4, 0xACE7, 0xB0F0, 0xACE8, 0xB0F1, 0xACE9, 0x81E5, 0xACEA, 0xB0F2, 0xACEB, 0x81E6, + 0xACEC, 0xB0F3, 0xACED, 0x81E7, 0xACEE, 0x81E8, 0xACEF, 0xB0F4, 0xACF0, 0xB0F5, 0xACF1, 0xB0F6, 0xACF2, 0x81E9, 0xACF3, 0xB0F7, + 0xACF4, 0x81EA, 0xACF5, 0xB0F8, 0xACF6, 0xB0F9, 0xACF7, 0x81EB, 0xACF8, 0x81EC, 0xACF9, 0x81ED, 0xACFA, 0x81EE, 0xACFB, 0x81EF, + 0xACFC, 0xB0FA, 0xACFD, 0xB0FB, 0xACFE, 0x81F0, 0xACFF, 0x81F1, 0xAD00, 0xB0FC, 0xAD01, 0x81F2, 0xAD02, 0x81F3, 0xAD03, 0x81F4, + 0xAD04, 0xB0FD, 0xAD05, 0x81F5, 0xAD06, 0xB0FE, 0xAD07, 0x81F6, 0xAD08, 0x81F7, 0xAD09, 0x81F8, 0xAD0A, 0x81F9, 0xAD0B, 0x81FA, + 0xAD0C, 0xB1A1, 0xAD0D, 0xB1A2, 0xAD0E, 0x81FB, 0xAD0F, 0xB1A3, 0xAD10, 0x81FC, 0xAD11, 0xB1A4, 0xAD12, 0x81FD, 0xAD13, 0x81FE, + 0xAD14, 0x8241, 0xAD15, 0x8242, 0xAD16, 0x8243, 0xAD17, 0x8244, 0xAD18, 0xB1A5, 0xAD19, 0x8245, 0xAD1A, 0x8246, 0xAD1B, 0x8247, + 0xAD1C, 0xB1A6, 0xAD1D, 0x8248, 0xAD1E, 0x8249, 0xAD1F, 0x824A, 0xAD20, 0xB1A7, 0xAD21, 0x824B, 0xAD22, 0x824C, 0xAD23, 0x824D, + 0xAD24, 0x824E, 0xAD25, 0x824F, 0xAD26, 0x8250, 0xAD27, 0x8251, 0xAD28, 0x8252, 0xAD29, 0xB1A8, 0xAD2A, 0x8253, 0xAD2B, 0x8254, + 0xAD2C, 0xB1A9, 0xAD2D, 0xB1AA, 0xAD2E, 0x8255, 0xAD2F, 0x8256, 0xAD30, 0x8257, 0xAD31, 0x8258, 0xAD32, 0x8259, 0xAD33, 0x825A, + 0xAD34, 0xB1AB, 0xAD35, 0xB1AC, 0xAD36, 0x8261, 0xAD37, 0x8262, 0xAD38, 0xB1AD, 0xAD39, 0x8263, 0xAD3A, 0x8264, 0xAD3B, 0x8265, + 0xAD3C, 0xB1AE, 0xAD3D, 0x8266, 0xAD3E, 0x8267, 0xAD3F, 0x8268, 0xAD40, 0x8269, 0xAD41, 0x826A, 0xAD42, 0x826B, 0xAD43, 0x826C, + 0xAD44, 0xB1AF, 0xAD45, 0xB1B0, 0xAD46, 0x826D, 0xAD47, 0xB1B1, 0xAD48, 0x826E, 0xAD49, 0xB1B2, 0xAD4A, 0x826F, 0xAD4B, 0x8270, + 0xAD4C, 0x8271, 0xAD4D, 0x8272, 0xAD4E, 0x8273, 0xAD4F, 0x8274, 0xAD50, 0xB1B3, 0xAD51, 0x8275, 0xAD52, 0x8276, 0xAD53, 0x8277, + 0xAD54, 0xB1B4, 0xAD55, 0x8278, 0xAD56, 0x8279, 0xAD57, 0x827A, 0xAD58, 0xB1B5, 0xAD59, 0x8281, 0xAD5A, 0x8282, 0xAD5B, 0x8283, + 0xAD5C, 0x8284, 0xAD5D, 0x8285, 0xAD5E, 0x8286, 0xAD5F, 0x8287, 0xAD60, 0x8288, 0xAD61, 0xB1B6, 0xAD62, 0x8289, 0xAD63, 0xB1B7, + 0xAD64, 0x828A, 0xAD65, 0x828B, 0xAD66, 0x828C, 0xAD67, 0x828D, 0xAD68, 0x828E, 0xAD69, 0x828F, 0xAD6A, 0x8290, 0xAD6B, 0x8291, + 0xAD6C, 0xB1B8, 0xAD6D, 0xB1B9, 0xAD6E, 0x8292, 0xAD6F, 0x8293, 0xAD70, 0xB1BA, 0xAD71, 0x8294, 0xAD72, 0x8295, 0xAD73, 0xB1BB, + 0xAD74, 0xB1BC, 0xAD75, 0xB1BD, 0xAD76, 0xB1BE, 0xAD77, 0x8296, 0xAD78, 0x8297, 0xAD79, 0x8298, 0xAD7A, 0x8299, 0xAD7B, 0xB1BF, + 0xAD7C, 0xB1C0, 0xAD7D, 0xB1C1, 0xAD7E, 0x829A, 0xAD7F, 0xB1C2, 0xAD80, 0x829B, 0xAD81, 0xB1C3, 0xAD82, 0xB1C4, 0xAD83, 0x829C, + 0xAD84, 0x829D, 0xAD85, 0x829E, 0xAD86, 0x829F, 0xAD87, 0x82A0, 0xAD88, 0xB1C5, 0xAD89, 0xB1C6, 0xAD8A, 0x82A1, 0xAD8B, 0x82A2, + 0xAD8C, 0xB1C7, 0xAD8D, 0x82A3, 0xAD8E, 0x82A4, 0xAD8F, 0x82A5, 0xAD90, 0xB1C8, 0xAD91, 0x82A6, 0xAD92, 0x82A7, 0xAD93, 0x82A8, + 0xAD94, 0x82A9, 0xAD95, 0x82AA, 0xAD96, 0x82AB, 0xAD97, 0x82AC, 0xAD98, 0x82AD, 0xAD99, 0x82AE, 0xAD9A, 0x82AF, 0xAD9B, 0x82B0, + 0xAD9C, 0xB1C9, 0xAD9D, 0xB1CA, 0xAD9E, 0x82B1, 0xAD9F, 0x82B2, 0xADA0, 0x82B3, 0xADA1, 0x82B4, 0xADA2, 0x82B5, 0xADA3, 0x82B6, + 0xADA4, 0xB1CB, 0xADA5, 0x82B7, 0xADA6, 0x82B8, 0xADA7, 0x82B9, 0xADA8, 0x82BA, 0xADA9, 0x82BB, 0xADAA, 0x82BC, 0xADAB, 0x82BD, + 0xADAC, 0x82BE, 0xADAD, 0x82BF, 0xADAE, 0x82C0, 0xADAF, 0x82C1, 0xADB0, 0x82C2, 0xADB1, 0x82C3, 0xADB2, 0x82C4, 0xADB3, 0x82C5, + 0xADB4, 0x82C6, 0xADB5, 0x82C7, 0xADB6, 0x82C8, 0xADB7, 0xB1CC, 0xADB8, 0x82C9, 0xADB9, 0x82CA, 0xADBA, 0x82CB, 0xADBB, 0x82CC, + 0xADBC, 0x82CD, 0xADBD, 0x82CE, 0xADBE, 0x82CF, 0xADBF, 0x82D0, 0xADC0, 0xB1CD, 0xADC1, 0xB1CE, 0xADC2, 0x82D1, 0xADC3, 0x82D2, + 0xADC4, 0xB1CF, 0xADC5, 0x82D3, 0xADC6, 0x82D4, 0xADC7, 0x82D5, 0xADC8, 0xB1D0, 0xADC9, 0x82D6, 0xADCA, 0x82D7, 0xADCB, 0x82D8, + 0xADCC, 0x82D9, 0xADCD, 0x82DA, 0xADCE, 0x82DB, 0xADCF, 0x82DC, 0xADD0, 0xB1D1, 0xADD1, 0xB1D2, 0xADD2, 0x82DD, 0xADD3, 0xB1D3, + 0xADD4, 0x82DE, 0xADD5, 0x82DF, 0xADD6, 0x82E0, 0xADD7, 0x82E1, 0xADD8, 0x82E2, 0xADD9, 0x82E3, 0xADDA, 0x82E4, 0xADDB, 0x82E5, + 0xADDC, 0xB1D4, 0xADDD, 0x82E6, 0xADDE, 0x82E7, 0xADDF, 0x82E8, 0xADE0, 0xB1D5, 0xADE1, 0x82E9, 0xADE2, 0x82EA, 0xADE3, 0x82EB, + 0xADE4, 0xB1D6, 0xADE5, 0x82EC, 0xADE6, 0x82ED, 0xADE7, 0x82EE, 0xADE8, 0x82EF, 0xADE9, 0x82F0, 0xADEA, 0x82F1, 0xADEB, 0x82F2, + 0xADEC, 0x82F3, 0xADED, 0x82F4, 0xADEE, 0x82F5, 0xADEF, 0x82F6, 0xADF0, 0x82F7, 0xADF1, 0x82F8, 0xADF2, 0x82F9, 0xADF3, 0x82FA, + 0xADF4, 0x82FB, 0xADF5, 0x82FC, 0xADF6, 0x82FD, 0xADF7, 0x82FE, 0xADF8, 0xB1D7, 0xADF9, 0xB1D8, 0xADFA, 0x8341, 0xADFB, 0x8342, + 0xADFC, 0xB1D9, 0xADFD, 0x8343, 0xADFE, 0x8344, 0xADFF, 0xB1DA, 0xAE00, 0xB1DB, 0xAE01, 0xB1DC, 0xAE02, 0x8345, 0xAE03, 0x8346, + 0xAE04, 0x8347, 0xAE05, 0x8348, 0xAE06, 0x8349, 0xAE07, 0x834A, 0xAE08, 0xB1DD, 0xAE09, 0xB1DE, 0xAE0A, 0x834B, 0xAE0B, 0xB1DF, + 0xAE0C, 0x834C, 0xAE0D, 0xB1E0, 0xAE0E, 0x834D, 0xAE0F, 0x834E, 0xAE10, 0x834F, 0xAE11, 0x8350, 0xAE12, 0x8351, 0xAE13, 0x8352, + 0xAE14, 0xB1E1, 0xAE15, 0x8353, 0xAE16, 0x8354, 0xAE17, 0x8355, 0xAE18, 0x8356, 0xAE19, 0x8357, 0xAE1A, 0x8358, 0xAE1B, 0x8359, + 0xAE1C, 0x835A, 0xAE1D, 0x8361, 0xAE1E, 0x8362, 0xAE1F, 0x8363, 0xAE20, 0x8364, 0xAE21, 0x8365, 0xAE22, 0x8366, 0xAE23, 0x8367, + 0xAE24, 0x8368, 0xAE25, 0x8369, 0xAE26, 0x836A, 0xAE27, 0x836B, 0xAE28, 0x836C, 0xAE29, 0x836D, 0xAE2A, 0x836E, 0xAE2B, 0x836F, + 0xAE2C, 0x8370, 0xAE2D, 0x8371, 0xAE2E, 0x8372, 0xAE2F, 0x8373, 0xAE30, 0xB1E2, 0xAE31, 0xB1E3, 0xAE32, 0x8374, 0xAE33, 0x8375, + 0xAE34, 0xB1E4, 0xAE35, 0x8376, 0xAE36, 0x8377, 0xAE37, 0xB1E5, 0xAE38, 0xB1E6, 0xAE39, 0x8378, 0xAE3A, 0xB1E7, 0xAE3B, 0x8379, + 0xAE3C, 0x837A, 0xAE3D, 0x8381, 0xAE3E, 0x8382, 0xAE3F, 0x8383, 0xAE40, 0xB1E8, 0xAE41, 0xB1E9, 0xAE42, 0x8384, 0xAE43, 0xB1EA, + 0xAE44, 0x8385, 0xAE45, 0xB1EB, 0xAE46, 0xB1EC, 0xAE47, 0x8386, 0xAE48, 0x8387, 0xAE49, 0x8388, 0xAE4A, 0xB1ED, 0xAE4B, 0x8389, + 0xAE4C, 0xB1EE, 0xAE4D, 0xB1EF, 0xAE4E, 0xB1F0, 0xAE4F, 0x838A, 0xAE50, 0xB1F1, 0xAE51, 0x838B, 0xAE52, 0x838C, 0xAE53, 0x838D, + 0xAE54, 0xB1F2, 0xAE55, 0x838E, 0xAE56, 0xB1F3, 0xAE57, 0x838F, 0xAE58, 0x8390, 0xAE59, 0x8391, 0xAE5A, 0x8392, 0xAE5B, 0x8393, + 0xAE5C, 0xB1F4, 0xAE5D, 0xB1F5, 0xAE5E, 0x8394, 0xAE5F, 0xB1F6, 0xAE60, 0xB1F7, 0xAE61, 0xB1F8, 0xAE62, 0x8395, 0xAE63, 0x8396, + 0xAE64, 0x8397, 0xAE65, 0xB1F9, 0xAE66, 0x8398, 0xAE67, 0x8399, 0xAE68, 0xB1FA, 0xAE69, 0xB1FB, 0xAE6A, 0x839A, 0xAE6B, 0x839B, + 0xAE6C, 0xB1FC, 0xAE6D, 0x839C, 0xAE6E, 0x839D, 0xAE6F, 0x839E, 0xAE70, 0xB1FD, 0xAE71, 0x839F, 0xAE72, 0x83A0, 0xAE73, 0x83A1, + 0xAE74, 0x83A2, 0xAE75, 0x83A3, 0xAE76, 0x83A4, 0xAE77, 0x83A5, 0xAE78, 0xB1FE, 0xAE79, 0xB2A1, 0xAE7A, 0x83A6, 0xAE7B, 0xB2A2, + 0xAE7C, 0xB2A3, 0xAE7D, 0xB2A4, 0xAE7E, 0x83A7, 0xAE7F, 0x83A8, 0xAE80, 0x83A9, 0xAE81, 0x83AA, 0xAE82, 0x83AB, 0xAE83, 0x83AC, + 0xAE84, 0xB2A5, 0xAE85, 0xB2A6, 0xAE86, 0x83AD, 0xAE87, 0x83AE, 0xAE88, 0x83AF, 0xAE89, 0x83B0, 0xAE8A, 0x83B1, 0xAE8B, 0x83B2, + 0xAE8C, 0xB2A7, 0xAE8D, 0x83B3, 0xAE8E, 0x83B4, 0xAE8F, 0x83B5, 0xAE90, 0x83B6, 0xAE91, 0x83B7, 0xAE92, 0x83B8, 0xAE93, 0x83B9, + 0xAE94, 0x83BA, 0xAE95, 0x83BB, 0xAE96, 0x83BC, 0xAE97, 0x83BD, 0xAE98, 0x83BE, 0xAE99, 0x83BF, 0xAE9A, 0x83C0, 0xAE9B, 0x83C1, + 0xAE9C, 0x83C2, 0xAE9D, 0x83C3, 0xAE9E, 0x83C4, 0xAE9F, 0x83C5, 0xAEA0, 0x83C6, 0xAEA1, 0x83C7, 0xAEA2, 0x83C8, 0xAEA3, 0x83C9, + 0xAEA4, 0x83CA, 0xAEA5, 0x83CB, 0xAEA6, 0x83CC, 0xAEA7, 0x83CD, 0xAEA8, 0x83CE, 0xAEA9, 0x83CF, 0xAEAA, 0x83D0, 0xAEAB, 0x83D1, + 0xAEAC, 0x83D2, 0xAEAD, 0x83D3, 0xAEAE, 0x83D4, 0xAEAF, 0x83D5, 0xAEB0, 0x83D6, 0xAEB1, 0x83D7, 0xAEB2, 0x83D8, 0xAEB3, 0x83D9, + 0xAEB4, 0x83DA, 0xAEB5, 0x83DB, 0xAEB6, 0x83DC, 0xAEB7, 0x83DD, 0xAEB8, 0x83DE, 0xAEB9, 0x83DF, 0xAEBA, 0x83E0, 0xAEBB, 0x83E1, + 0xAEBC, 0xB2A8, 0xAEBD, 0xB2A9, 0xAEBE, 0xB2AA, 0xAEBF, 0x83E2, 0xAEC0, 0xB2AB, 0xAEC1, 0x83E3, 0xAEC2, 0x83E4, 0xAEC3, 0x83E5, + 0xAEC4, 0xB2AC, 0xAEC5, 0x83E6, 0xAEC6, 0x83E7, 0xAEC7, 0x83E8, 0xAEC8, 0x83E9, 0xAEC9, 0x83EA, 0xAECA, 0x83EB, 0xAECB, 0x83EC, + 0xAECC, 0xB2AD, 0xAECD, 0xB2AE, 0xAECE, 0x83ED, 0xAECF, 0xB2AF, 0xAED0, 0xB2B0, 0xAED1, 0xB2B1, 0xAED2, 0x83EE, 0xAED3, 0x83EF, + 0xAED4, 0x83F0, 0xAED5, 0x83F1, 0xAED6, 0x83F2, 0xAED7, 0x83F3, 0xAED8, 0xB2B2, 0xAED9, 0xB2B3, 0xAEDA, 0x83F4, 0xAEDB, 0x83F5, + 0xAEDC, 0xB2B4, 0xAEDD, 0x83F6, 0xAEDE, 0x83F7, 0xAEDF, 0x83F8, 0xAEE0, 0x83F9, 0xAEE1, 0x83FA, 0xAEE2, 0x83FB, 0xAEE3, 0x83FC, + 0xAEE4, 0x83FD, 0xAEE5, 0x83FE, 0xAEE6, 0x8441, 0xAEE7, 0x8442, 0xAEE8, 0xB2B5, 0xAEE9, 0x8443, 0xAEEA, 0x8444, 0xAEEB, 0xB2B6, + 0xAEEC, 0x8445, 0xAEED, 0xB2B7, 0xAEEE, 0x8446, 0xAEEF, 0x8447, 0xAEF0, 0x8448, 0xAEF1, 0x8449, 0xAEF2, 0x844A, 0xAEF3, 0x844B, + 0xAEF4, 0xB2B8, 0xAEF5, 0x844C, 0xAEF6, 0x844D, 0xAEF7, 0x844E, 0xAEF8, 0xB2B9, 0xAEF9, 0x844F, 0xAEFA, 0x8450, 0xAEFB, 0x8451, + 0xAEFC, 0xB2BA, 0xAEFD, 0x8452, 0xAEFE, 0x8453, 0xAEFF, 0x8454, 0xAF00, 0x8455, 0xAF01, 0x8456, 0xAF02, 0x8457, 0xAF03, 0x8458, + 0xAF04, 0x8459, 0xAF05, 0x845A, 0xAF06, 0x8461, 0xAF07, 0xB2BB, 0xAF08, 0xB2BC, 0xAF09, 0x8462, 0xAF0A, 0x8463, 0xAF0B, 0x8464, + 0xAF0C, 0x8465, 0xAF0D, 0xB2BD, 0xAF0E, 0x8466, 0xAF0F, 0x8467, 0xAF10, 0xB2BE, 0xAF11, 0x8468, 0xAF12, 0x8469, 0xAF13, 0x846A, + 0xAF14, 0x846B, 0xAF15, 0x846C, 0xAF16, 0x846D, 0xAF17, 0x846E, 0xAF18, 0x846F, 0xAF19, 0x8470, 0xAF1A, 0x8471, 0xAF1B, 0x8472, + 0xAF1C, 0x8473, 0xAF1D, 0x8474, 0xAF1E, 0x8475, 0xAF1F, 0x8476, 0xAF20, 0x8477, 0xAF21, 0x8478, 0xAF22, 0x8479, 0xAF23, 0x847A, + 0xAF24, 0x8481, 0xAF25, 0x8482, 0xAF26, 0x8483, 0xAF27, 0x8484, 0xAF28, 0x8485, 0xAF29, 0x8486, 0xAF2A, 0x8487, 0xAF2B, 0x8488, + 0xAF2C, 0xB2BF, 0xAF2D, 0xB2C0, 0xAF2E, 0x8489, 0xAF2F, 0x848A, 0xAF30, 0xB2C1, 0xAF31, 0x848B, 0xAF32, 0xB2C2, 0xAF33, 0x848C, + 0xAF34, 0xB2C3, 0xAF35, 0x848D, 0xAF36, 0x848E, 0xAF37, 0x848F, 0xAF38, 0x8490, 0xAF39, 0x8491, 0xAF3A, 0x8492, 0xAF3B, 0x8493, + 0xAF3C, 0xB2C4, 0xAF3D, 0xB2C5, 0xAF3E, 0x8494, 0xAF3F, 0xB2C6, 0xAF40, 0x8495, 0xAF41, 0xB2C7, 0xAF42, 0xB2C8, 0xAF43, 0xB2C9, + 0xAF44, 0x8496, 0xAF45, 0x8497, 0xAF46, 0x8498, 0xAF47, 0x8499, 0xAF48, 0xB2CA, 0xAF49, 0xB2CB, 0xAF4A, 0x849A, 0xAF4B, 0x849B, + 0xAF4C, 0x849C, 0xAF4D, 0x849D, 0xAF4E, 0x849E, 0xAF4F, 0x849F, 0xAF50, 0xB2CC, 0xAF51, 0x84A0, 0xAF52, 0x84A1, 0xAF53, 0x84A2, + 0xAF54, 0x84A3, 0xAF55, 0x84A4, 0xAF56, 0x84A5, 0xAF57, 0x84A6, 0xAF58, 0x84A7, 0xAF59, 0x84A8, 0xAF5A, 0x84A9, 0xAF5B, 0x84AA, + 0xAF5C, 0xB2CD, 0xAF5D, 0xB2CE, 0xAF5E, 0x84AB, 0xAF5F, 0x84AC, 0xAF60, 0x84AD, 0xAF61, 0x84AE, 0xAF62, 0x84AF, 0xAF63, 0x84B0, + 0xAF64, 0xB2CF, 0xAF65, 0xB2D0, 0xAF66, 0x84B1, 0xAF67, 0x84B2, 0xAF68, 0x84B3, 0xAF69, 0x84B4, 0xAF6A, 0x84B5, 0xAF6B, 0x84B6, + 0xAF6C, 0x84B7, 0xAF6D, 0x84B8, 0xAF6E, 0x84B9, 0xAF6F, 0x84BA, 0xAF70, 0x84BB, 0xAF71, 0x84BC, 0xAF72, 0x84BD, 0xAF73, 0x84BE, + 0xAF74, 0x84BF, 0xAF75, 0x84C0, 0xAF76, 0x84C1, 0xAF77, 0x84C2, 0xAF78, 0x84C3, 0xAF79, 0xB2D1, 0xAF7A, 0x84C4, 0xAF7B, 0x84C5, + 0xAF7C, 0x84C6, 0xAF7D, 0x84C7, 0xAF7E, 0x84C8, 0xAF7F, 0x84C9, 0xAF80, 0xB2D2, 0xAF81, 0x84CA, 0xAF82, 0x84CB, 0xAF83, 0x84CC, + 0xAF84, 0xB2D3, 0xAF85, 0x84CD, 0xAF86, 0x84CE, 0xAF87, 0x84CF, 0xAF88, 0xB2D4, 0xAF89, 0x84D0, 0xAF8A, 0x84D1, 0xAF8B, 0x84D2, + 0xAF8C, 0x84D3, 0xAF8D, 0x84D4, 0xAF8E, 0x84D5, 0xAF8F, 0x84D6, 0xAF90, 0xB2D5, 0xAF91, 0xB2D6, 0xAF92, 0x84D7, 0xAF93, 0x84D8, + 0xAF94, 0x84D9, 0xAF95, 0xB2D7, 0xAF96, 0x84DA, 0xAF97, 0x84DB, 0xAF98, 0x84DC, 0xAF99, 0x84DD, 0xAF9A, 0x84DE, 0xAF9B, 0x84DF, + 0xAF9C, 0xB2D8, 0xAF9D, 0x84E0, 0xAF9E, 0x84E1, 0xAF9F, 0x84E2, 0xAFA0, 0x84E3, 0xAFA1, 0x84E4, 0xAFA2, 0x84E5, 0xAFA3, 0x84E6, + 0xAFA4, 0x84E7, 0xAFA5, 0x84E8, 0xAFA6, 0x84E9, 0xAFA7, 0x84EA, 0xAFA8, 0x84EB, 0xAFA9, 0x84EC, 0xAFAA, 0x84ED, 0xAFAB, 0x84EE, + 0xAFAC, 0x84EF, 0xAFAD, 0x84F0, 0xAFAE, 0x84F1, 0xAFAF, 0x84F2, 0xAFB0, 0x84F3, 0xAFB1, 0x84F4, 0xAFB2, 0x84F5, 0xAFB3, 0x84F6, + 0xAFB4, 0x84F7, 0xAFB5, 0x84F8, 0xAFB6, 0x84F9, 0xAFB7, 0x84FA, 0xAFB8, 0xB2D9, 0xAFB9, 0xB2DA, 0xAFBA, 0x84FB, 0xAFBB, 0x84FC, + 0xAFBC, 0xB2DB, 0xAFBD, 0x84FD, 0xAFBE, 0x84FE, 0xAFBF, 0x8541, 0xAFC0, 0xB2DC, 0xAFC1, 0x8542, 0xAFC2, 0x8543, 0xAFC3, 0x8544, + 0xAFC4, 0x8545, 0xAFC5, 0x8546, 0xAFC6, 0x8547, 0xAFC7, 0xB2DD, 0xAFC8, 0xB2DE, 0xAFC9, 0xB2DF, 0xAFCA, 0x8548, 0xAFCB, 0xB2E0, + 0xAFCC, 0x8549, 0xAFCD, 0xB2E1, 0xAFCE, 0xB2E2, 0xAFCF, 0x854A, 0xAFD0, 0x854B, 0xAFD1, 0x854C, 0xAFD2, 0x854D, 0xAFD3, 0x854E, + 0xAFD4, 0xB2E3, 0xAFD5, 0x854F, 0xAFD6, 0x8550, 0xAFD7, 0x8551, 0xAFD8, 0x8552, 0xAFD9, 0x8553, 0xAFDA, 0x8554, 0xAFDB, 0x8555, + 0xAFDC, 0xB2E4, 0xAFDD, 0x8556, 0xAFDE, 0x8557, 0xAFDF, 0x8558, 0xAFE0, 0x8559, 0xAFE1, 0x855A, 0xAFE2, 0x8561, 0xAFE3, 0x8562, + 0xAFE4, 0x8563, 0xAFE5, 0x8564, 0xAFE6, 0x8565, 0xAFE7, 0x8566, 0xAFE8, 0xB2E5, 0xAFE9, 0xB2E6, 0xAFEA, 0x8567, 0xAFEB, 0x8568, + 0xAFEC, 0x8569, 0xAFED, 0x856A, 0xAFEE, 0x856B, 0xAFEF, 0x856C, 0xAFF0, 0xB2E7, 0xAFF1, 0xB2E8, 0xAFF2, 0x856D, 0xAFF3, 0x856E, + 0xAFF4, 0xB2E9, 0xAFF5, 0x856F, 0xAFF6, 0x8570, 0xAFF7, 0x8571, 0xAFF8, 0xB2EA, 0xAFF9, 0x8572, 0xAFFA, 0x8573, 0xAFFB, 0x8574, + 0xAFFC, 0x8575, 0xAFFD, 0x8576, 0xAFFE, 0x8577, 0xAFFF, 0x8578, 0xB000, 0xB2EB, 0xB001, 0xB2EC, 0xB002, 0x8579, 0xB003, 0x857A, + 0xB004, 0xB2ED, 0xB005, 0x8581, 0xB006, 0x8582, 0xB007, 0x8583, 0xB008, 0x8584, 0xB009, 0x8585, 0xB00A, 0x8586, 0xB00B, 0x8587, + 0xB00C, 0xB2EE, 0xB00D, 0x8588, 0xB00E, 0x8589, 0xB00F, 0x858A, 0xB010, 0xB2EF, 0xB011, 0x858B, 0xB012, 0x858C, 0xB013, 0x858D, + 0xB014, 0xB2F0, 0xB015, 0x858E, 0xB016, 0x858F, 0xB017, 0x8590, 0xB018, 0x8591, 0xB019, 0x8592, 0xB01A, 0x8593, 0xB01B, 0x8594, + 0xB01C, 0xB2F1, 0xB01D, 0xB2F2, 0xB01E, 0x8595, 0xB01F, 0x8596, 0xB020, 0x8597, 0xB021, 0x8598, 0xB022, 0x8599, 0xB023, 0x859A, + 0xB024, 0x859B, 0xB025, 0x859C, 0xB026, 0x859D, 0xB027, 0x859E, 0xB028, 0xB2F3, 0xB029, 0x859F, 0xB02A, 0x85A0, 0xB02B, 0x85A1, + 0xB02C, 0x85A2, 0xB02D, 0x85A3, 0xB02E, 0x85A4, 0xB02F, 0x85A5, 0xB030, 0x85A6, 0xB031, 0x85A7, 0xB032, 0x85A8, 0xB033, 0x85A9, + 0xB034, 0x85AA, 0xB035, 0x85AB, 0xB036, 0x85AC, 0xB037, 0x85AD, 0xB038, 0x85AE, 0xB039, 0x85AF, 0xB03A, 0x85B0, 0xB03B, 0x85B1, + 0xB03C, 0x85B2, 0xB03D, 0x85B3, 0xB03E, 0x85B4, 0xB03F, 0x85B5, 0xB040, 0x85B6, 0xB041, 0x85B7, 0xB042, 0x85B8, 0xB043, 0x85B9, + 0xB044, 0xB2F4, 0xB045, 0xB2F5, 0xB046, 0x85BA, 0xB047, 0x85BB, 0xB048, 0xB2F6, 0xB049, 0x85BC, 0xB04A, 0xB2F7, 0xB04B, 0x85BD, + 0xB04C, 0xB2F8, 0xB04D, 0x85BE, 0xB04E, 0xB2F9, 0xB04F, 0x85BF, 0xB050, 0x85C0, 0xB051, 0x85C1, 0xB052, 0x85C2, 0xB053, 0xB2FA, + 0xB054, 0xB2FB, 0xB055, 0xB2FC, 0xB056, 0x85C3, 0xB057, 0xB2FD, 0xB058, 0x85C4, 0xB059, 0xB2FE, 0xB05A, 0x85C5, 0xB05B, 0x85C6, + 0xB05C, 0x85C7, 0xB05D, 0xB3A1, 0xB05E, 0x85C8, 0xB05F, 0x85C9, 0xB060, 0x85CA, 0xB061, 0x85CB, 0xB062, 0x85CC, 0xB063, 0x85CD, + 0xB064, 0x85CE, 0xB065, 0x85CF, 0xB066, 0x85D0, 0xB067, 0x85D1, 0xB068, 0x85D2, 0xB069, 0x85D3, 0xB06A, 0x85D4, 0xB06B, 0x85D5, + 0xB06C, 0x85D6, 0xB06D, 0x85D7, 0xB06E, 0x85D8, 0xB06F, 0x85D9, 0xB070, 0x85DA, 0xB071, 0x85DB, 0xB072, 0x85DC, 0xB073, 0x85DD, + 0xB074, 0x85DE, 0xB075, 0x85DF, 0xB076, 0x85E0, 0xB077, 0x85E1, 0xB078, 0x85E2, 0xB079, 0x85E3, 0xB07A, 0x85E4, 0xB07B, 0x85E5, + 0xB07C, 0xB3A2, 0xB07D, 0xB3A3, 0xB07E, 0x85E6, 0xB07F, 0x85E7, 0xB080, 0xB3A4, 0xB081, 0x85E8, 0xB082, 0x85E9, 0xB083, 0x85EA, + 0xB084, 0xB3A5, 0xB085, 0x85EB, 0xB086, 0x85EC, 0xB087, 0x85ED, 0xB088, 0x85EE, 0xB089, 0x85EF, 0xB08A, 0x85F0, 0xB08B, 0x85F1, + 0xB08C, 0xB3A6, 0xB08D, 0xB3A7, 0xB08E, 0x85F2, 0xB08F, 0xB3A8, 0xB090, 0x85F3, 0xB091, 0xB3A9, 0xB092, 0x85F4, 0xB093, 0x85F5, + 0xB094, 0x85F6, 0xB095, 0x85F7, 0xB096, 0x85F8, 0xB097, 0x85F9, 0xB098, 0xB3AA, 0xB099, 0xB3AB, 0xB09A, 0xB3AC, 0xB09B, 0x85FA, + 0xB09C, 0xB3AD, 0xB09D, 0x85FB, 0xB09E, 0x85FC, 0xB09F, 0xB3AE, 0xB0A0, 0xB3AF, 0xB0A1, 0xB3B0, 0xB0A2, 0xB3B1, 0xB0A3, 0x85FD, + 0xB0A4, 0x85FE, 0xB0A5, 0x8641, 0xB0A6, 0x8642, 0xB0A7, 0x8643, 0xB0A8, 0xB3B2, 0xB0A9, 0xB3B3, 0xB0AA, 0x8644, 0xB0AB, 0xB3B4, + 0xB0AC, 0xB3B5, 0xB0AD, 0xB3B6, 0xB0AE, 0xB3B7, 0xB0AF, 0xB3B8, 0xB0B0, 0x8645, 0xB0B1, 0xB3B9, 0xB0B2, 0x8646, 0xB0B3, 0xB3BA, + 0xB0B4, 0xB3BB, 0xB0B5, 0xB3BC, 0xB0B6, 0x8647, 0xB0B7, 0x8648, 0xB0B8, 0xB3BD, 0xB0B9, 0x8649, 0xB0BA, 0x864A, 0xB0BB, 0x864B, + 0xB0BC, 0xB3BE, 0xB0BD, 0x864C, 0xB0BE, 0x864D, 0xB0BF, 0x864E, 0xB0C0, 0x864F, 0xB0C1, 0x8650, 0xB0C2, 0x8651, 0xB0C3, 0x8652, + 0xB0C4, 0xB3BF, 0xB0C5, 0xB3C0, 0xB0C6, 0x8653, 0xB0C7, 0xB3C1, 0xB0C8, 0xB3C2, 0xB0C9, 0xB3C3, 0xB0CA, 0x8654, 0xB0CB, 0x8655, + 0xB0CC, 0x8656, 0xB0CD, 0x8657, 0xB0CE, 0x8658, 0xB0CF, 0x8659, 0xB0D0, 0xB3C4, 0xB0D1, 0xB3C5, 0xB0D2, 0x865A, 0xB0D3, 0x8661, + 0xB0D4, 0xB3C6, 0xB0D5, 0x8662, 0xB0D6, 0x8663, 0xB0D7, 0x8664, 0xB0D8, 0xB3C7, 0xB0D9, 0x8665, 0xB0DA, 0x8666, 0xB0DB, 0x8667, + 0xB0DC, 0x8668, 0xB0DD, 0x8669, 0xB0DE, 0x866A, 0xB0DF, 0x866B, 0xB0E0, 0xB3C8, 0xB0E1, 0x866C, 0xB0E2, 0x866D, 0xB0E3, 0x866E, + 0xB0E4, 0x866F, 0xB0E5, 0xB3C9, 0xB0E6, 0x8670, 0xB0E7, 0x8671, 0xB0E8, 0x8672, 0xB0E9, 0x8673, 0xB0EA, 0x8674, 0xB0EB, 0x8675, + 0xB0EC, 0x8676, 0xB0ED, 0x8677, 0xB0EE, 0x8678, 0xB0EF, 0x8679, 0xB0F0, 0x867A, 0xB0F1, 0x8681, 0xB0F2, 0x8682, 0xB0F3, 0x8683, + 0xB0F4, 0x8684, 0xB0F5, 0x8685, 0xB0F6, 0x8686, 0xB0F7, 0x8687, 0xB0F8, 0x8688, 0xB0F9, 0x8689, 0xB0FA, 0x868A, 0xB0FB, 0x868B, + 0xB0FC, 0x868C, 0xB0FD, 0x868D, 0xB0FE, 0x868E, 0xB0FF, 0x868F, 0xB100, 0x8690, 0xB101, 0x8691, 0xB102, 0x8692, 0xB103, 0x8693, + 0xB104, 0x8694, 0xB105, 0x8695, 0xB106, 0x8696, 0xB107, 0x8697, 0xB108, 0xB3CA, 0xB109, 0xB3CB, 0xB10A, 0x8698, 0xB10B, 0xB3CC, + 0xB10C, 0xB3CD, 0xB10D, 0x8699, 0xB10E, 0x869A, 0xB10F, 0x869B, 0xB110, 0xB3CE, 0xB111, 0x869C, 0xB112, 0xB3CF, 0xB113, 0xB3D0, + 0xB114, 0x869D, 0xB115, 0x869E, 0xB116, 0x869F, 0xB117, 0x86A0, 0xB118, 0xB3D1, 0xB119, 0xB3D2, 0xB11A, 0x86A1, 0xB11B, 0xB3D3, + 0xB11C, 0xB3D4, 0xB11D, 0xB3D5, 0xB11E, 0x86A2, 0xB11F, 0x86A3, 0xB120, 0x86A4, 0xB121, 0x86A5, 0xB122, 0x86A6, 0xB123, 0xB3D6, + 0xB124, 0xB3D7, 0xB125, 0xB3D8, 0xB126, 0x86A7, 0xB127, 0x86A8, 0xB128, 0xB3D9, 0xB129, 0x86A9, 0xB12A, 0x86AA, 0xB12B, 0x86AB, + 0xB12C, 0xB3DA, 0xB12D, 0x86AC, 0xB12E, 0x86AD, 0xB12F, 0x86AE, 0xB130, 0x86AF, 0xB131, 0x86B0, 0xB132, 0x86B1, 0xB133, 0x86B2, + 0xB134, 0xB3DB, 0xB135, 0xB3DC, 0xB136, 0x86B3, 0xB137, 0xB3DD, 0xB138, 0xB3DE, 0xB139, 0xB3DF, 0xB13A, 0x86B4, 0xB13B, 0x86B5, + 0xB13C, 0x86B6, 0xB13D, 0x86B7, 0xB13E, 0x86B8, 0xB13F, 0x86B9, 0xB140, 0xB3E0, 0xB141, 0xB3E1, 0xB142, 0x86BA, 0xB143, 0x86BB, + 0xB144, 0xB3E2, 0xB145, 0x86BC, 0xB146, 0x86BD, 0xB147, 0x86BE, 0xB148, 0xB3E3, 0xB149, 0x86BF, 0xB14A, 0x86C0, 0xB14B, 0x86C1, + 0xB14C, 0x86C2, 0xB14D, 0x86C3, 0xB14E, 0x86C4, 0xB14F, 0x86C5, 0xB150, 0xB3E4, 0xB151, 0xB3E5, 0xB152, 0x86C6, 0xB153, 0x86C7, + 0xB154, 0xB3E6, 0xB155, 0xB3E7, 0xB156, 0x86C8, 0xB157, 0x86C9, 0xB158, 0xB3E8, 0xB159, 0x86CA, 0xB15A, 0x86CB, 0xB15B, 0x86CC, + 0xB15C, 0xB3E9, 0xB15D, 0x86CD, 0xB15E, 0x86CE, 0xB15F, 0x86CF, 0xB160, 0xB3EA, 0xB161, 0x86D0, 0xB162, 0x86D1, 0xB163, 0x86D2, + 0xB164, 0x86D3, 0xB165, 0x86D4, 0xB166, 0x86D5, 0xB167, 0x86D6, 0xB168, 0x86D7, 0xB169, 0x86D8, 0xB16A, 0x86D9, 0xB16B, 0x86DA, + 0xB16C, 0x86DB, 0xB16D, 0x86DC, 0xB16E, 0x86DD, 0xB16F, 0x86DE, 0xB170, 0x86DF, 0xB171, 0x86E0, 0xB172, 0x86E1, 0xB173, 0x86E2, + 0xB174, 0x86E3, 0xB175, 0x86E4, 0xB176, 0x86E5, 0xB177, 0x86E6, 0xB178, 0xB3EB, 0xB179, 0xB3EC, 0xB17A, 0x86E7, 0xB17B, 0x86E8, + 0xB17C, 0xB3ED, 0xB17D, 0x86E9, 0xB17E, 0x86EA, 0xB17F, 0x86EB, 0xB180, 0xB3EE, 0xB181, 0x86EC, 0xB182, 0xB3EF, 0xB183, 0x86ED, + 0xB184, 0x86EE, 0xB185, 0x86EF, 0xB186, 0x86F0, 0xB187, 0x86F1, 0xB188, 0xB3F0, 0xB189, 0xB3F1, 0xB18A, 0x86F2, 0xB18B, 0xB3F2, + 0xB18C, 0x86F3, 0xB18D, 0xB3F3, 0xB18E, 0x86F4, 0xB18F, 0x86F5, 0xB190, 0x86F6, 0xB191, 0x86F7, 0xB192, 0xB3F4, 0xB193, 0xB3F5, + 0xB194, 0xB3F6, 0xB195, 0x86F8, 0xB196, 0x86F9, 0xB197, 0x86FA, 0xB198, 0xB3F7, 0xB199, 0x86FB, 0xB19A, 0x86FC, 0xB19B, 0x86FD, + 0xB19C, 0xB3F8, 0xB19D, 0x86FE, 0xB19E, 0x8741, 0xB19F, 0x8742, 0xB1A0, 0x8743, 0xB1A1, 0x8744, 0xB1A2, 0x8745, 0xB1A3, 0x8746, + 0xB1A4, 0x8747, 0xB1A5, 0x8748, 0xB1A6, 0x8749, 0xB1A7, 0x874A, 0xB1A8, 0xB3F9, 0xB1A9, 0x874B, 0xB1AA, 0x874C, 0xB1AB, 0x874D, + 0xB1AC, 0x874E, 0xB1AD, 0x874F, 0xB1AE, 0x8750, 0xB1AF, 0x8751, 0xB1B0, 0x8752, 0xB1B1, 0x8753, 0xB1B2, 0x8754, 0xB1B3, 0x8755, + 0xB1B4, 0x8756, 0xB1B5, 0x8757, 0xB1B6, 0x8758, 0xB1B7, 0x8759, 0xB1B8, 0x875A, 0xB1B9, 0x8761, 0xB1BA, 0x8762, 0xB1BB, 0x8763, + 0xB1BC, 0x8764, 0xB1BD, 0x8765, 0xB1BE, 0x8766, 0xB1BF, 0x8767, 0xB1C0, 0x8768, 0xB1C1, 0x8769, 0xB1C2, 0x876A, 0xB1C3, 0x876B, + 0xB1C4, 0x876C, 0xB1C5, 0x876D, 0xB1C6, 0x876E, 0xB1C7, 0x876F, 0xB1C8, 0x8770, 0xB1C9, 0x8771, 0xB1CA, 0x8772, 0xB1CB, 0x8773, + 0xB1CC, 0xB3FA, 0xB1CD, 0x8774, 0xB1CE, 0x8775, 0xB1CF, 0x8776, 0xB1D0, 0xB3FB, 0xB1D1, 0x8777, 0xB1D2, 0x8778, 0xB1D3, 0x8779, + 0xB1D4, 0xB3FC, 0xB1D5, 0x877A, 0xB1D6, 0x8781, 0xB1D7, 0x8782, 0xB1D8, 0x8783, 0xB1D9, 0x8784, 0xB1DA, 0x8785, 0xB1DB, 0x8786, + 0xB1DC, 0xB3FD, 0xB1DD, 0xB3FE, 0xB1DE, 0x8787, 0xB1DF, 0xB4A1, 0xB1E0, 0x8788, 0xB1E1, 0x8789, 0xB1E2, 0x878A, 0xB1E3, 0x878B, + 0xB1E4, 0x878C, 0xB1E5, 0x878D, 0xB1E6, 0x878E, 0xB1E7, 0x878F, 0xB1E8, 0xB4A2, 0xB1E9, 0xB4A3, 0xB1EA, 0x8790, 0xB1EB, 0x8791, + 0xB1EC, 0xB4A4, 0xB1ED, 0x8792, 0xB1EE, 0x8793, 0xB1EF, 0x8794, 0xB1F0, 0xB4A5, 0xB1F1, 0x8795, 0xB1F2, 0x8796, 0xB1F3, 0x8797, + 0xB1F4, 0x8798, 0xB1F5, 0x8799, 0xB1F6, 0x879A, 0xB1F7, 0x879B, 0xB1F8, 0x879C, 0xB1F9, 0xB4A6, 0xB1FA, 0x879D, 0xB1FB, 0xB4A7, + 0xB1FC, 0x879E, 0xB1FD, 0xB4A8, 0xB1FE, 0x879F, 0xB1FF, 0x87A0, 0xB200, 0x87A1, 0xB201, 0x87A2, 0xB202, 0x87A3, 0xB203, 0x87A4, + 0xB204, 0xB4A9, 0xB205, 0xB4AA, 0xB206, 0x87A5, 0xB207, 0x87A6, 0xB208, 0xB4AB, 0xB209, 0x87A7, 0xB20A, 0x87A8, 0xB20B, 0xB4AC, + 0xB20C, 0xB4AD, 0xB20D, 0x87A9, 0xB20E, 0x87AA, 0xB20F, 0x87AB, 0xB210, 0x87AC, 0xB211, 0x87AD, 0xB212, 0x87AE, 0xB213, 0x87AF, + 0xB214, 0xB4AE, 0xB215, 0xB4AF, 0xB216, 0x87B0, 0xB217, 0xB4B0, 0xB218, 0x87B1, 0xB219, 0xB4B1, 0xB21A, 0x87B2, 0xB21B, 0x87B3, + 0xB21C, 0x87B4, 0xB21D, 0x87B5, 0xB21E, 0x87B6, 0xB21F, 0x87B7, 0xB220, 0xB4B2, 0xB221, 0x87B8, 0xB222, 0x87B9, 0xB223, 0x87BA, + 0xB224, 0x87BB, 0xB225, 0x87BC, 0xB226, 0x87BD, 0xB227, 0x87BE, 0xB228, 0x87BF, 0xB229, 0x87C0, 0xB22A, 0x87C1, 0xB22B, 0x87C2, + 0xB22C, 0x87C3, 0xB22D, 0x87C4, 0xB22E, 0x87C5, 0xB22F, 0x87C6, 0xB230, 0x87C7, 0xB231, 0x87C8, 0xB232, 0x87C9, 0xB233, 0x87CA, + 0xB234, 0xB4B3, 0xB235, 0x87CB, 0xB236, 0x87CC, 0xB237, 0x87CD, 0xB238, 0x87CE, 0xB239, 0x87CF, 0xB23A, 0x87D0, 0xB23B, 0x87D1, + 0xB23C, 0xB4B4, 0xB23D, 0x87D2, 0xB23E, 0x87D3, 0xB23F, 0x87D4, 0xB240, 0x87D5, 0xB241, 0x87D6, 0xB242, 0x87D7, 0xB243, 0x87D8, + 0xB244, 0x87D9, 0xB245, 0x87DA, 0xB246, 0x87DB, 0xB247, 0x87DC, 0xB248, 0x87DD, 0xB249, 0x87DE, 0xB24A, 0x87DF, 0xB24B, 0x87E0, + 0xB24C, 0x87E1, 0xB24D, 0x87E2, 0xB24E, 0x87E3, 0xB24F, 0x87E4, 0xB250, 0x87E5, 0xB251, 0x87E6, 0xB252, 0x87E7, 0xB253, 0x87E8, + 0xB254, 0x87E9, 0xB255, 0x87EA, 0xB256, 0x87EB, 0xB257, 0x87EC, 0xB258, 0xB4B5, 0xB259, 0x87ED, 0xB25A, 0x87EE, 0xB25B, 0x87EF, + 0xB25C, 0xB4B6, 0xB25D, 0x87F0, 0xB25E, 0x87F1, 0xB25F, 0x87F2, 0xB260, 0xB4B7, 0xB261, 0x87F3, 0xB262, 0x87F4, 0xB263, 0x87F5, + 0xB264, 0x87F6, 0xB265, 0x87F7, 0xB266, 0x87F8, 0xB267, 0x87F9, 0xB268, 0xB4B8, 0xB269, 0xB4B9, 0xB26A, 0x87FA, 0xB26B, 0x87FB, + 0xB26C, 0x87FC, 0xB26D, 0x87FD, 0xB26E, 0x87FE, 0xB26F, 0x8841, 0xB270, 0x8842, 0xB271, 0x8843, 0xB272, 0x8844, 0xB273, 0x8845, + 0xB274, 0xB4BA, 0xB275, 0xB4BB, 0xB276, 0x8846, 0xB277, 0x8847, 0xB278, 0x8848, 0xB279, 0x8849, 0xB27A, 0x884A, 0xB27B, 0x884B, + 0xB27C, 0xB4BC, 0xB27D, 0x884C, 0xB27E, 0x884D, 0xB27F, 0x884E, 0xB280, 0x884F, 0xB281, 0x8850, 0xB282, 0x8851, 0xB283, 0x8852, + 0xB284, 0xB4BD, 0xB285, 0xB4BE, 0xB286, 0x8853, 0xB287, 0x8854, 0xB288, 0x8855, 0xB289, 0xB4BF, 0xB28A, 0x8856, 0xB28B, 0x8857, + 0xB28C, 0x8858, 0xB28D, 0x8859, 0xB28E, 0x885A, 0xB28F, 0x8861, 0xB290, 0xB4C0, 0xB291, 0xB4C1, 0xB292, 0x8862, 0xB293, 0x8863, + 0xB294, 0xB4C2, 0xB295, 0x8864, 0xB296, 0x8865, 0xB297, 0x8866, 0xB298, 0xB4C3, 0xB299, 0xB4C4, 0xB29A, 0xB4C5, 0xB29B, 0x8867, + 0xB29C, 0x8868, 0xB29D, 0x8869, 0xB29E, 0x886A, 0xB29F, 0x886B, 0xB2A0, 0xB4C6, 0xB2A1, 0xB4C7, 0xB2A2, 0x886C, 0xB2A3, 0xB4C8, + 0xB2A4, 0x886D, 0xB2A5, 0xB4C9, 0xB2A6, 0xB4CA, 0xB2A7, 0x886E, 0xB2A8, 0x886F, 0xB2A9, 0x8870, 0xB2AA, 0xB4CB, 0xB2AB, 0x8871, + 0xB2AC, 0xB4CC, 0xB2AD, 0x8872, 0xB2AE, 0x8873, 0xB2AF, 0x8874, 0xB2B0, 0xB4CD, 0xB2B1, 0x8875, 0xB2B2, 0x8876, 0xB2B3, 0x8877, + 0xB2B4, 0xB4CE, 0xB2B5, 0x8878, 0xB2B6, 0x8879, 0xB2B7, 0x887A, 0xB2B8, 0x8881, 0xB2B9, 0x8882, 0xB2BA, 0x8883, 0xB2BB, 0x8884, + 0xB2BC, 0x8885, 0xB2BD, 0x8886, 0xB2BE, 0x8887, 0xB2BF, 0x8888, 0xB2C0, 0x8889, 0xB2C1, 0x888A, 0xB2C2, 0x888B, 0xB2C3, 0x888C, + 0xB2C4, 0x888D, 0xB2C5, 0x888E, 0xB2C6, 0x888F, 0xB2C7, 0x8890, 0xB2C8, 0xB4CF, 0xB2C9, 0xB4D0, 0xB2CA, 0x8891, 0xB2CB, 0x8892, + 0xB2CC, 0xB4D1, 0xB2CD, 0x8893, 0xB2CE, 0x8894, 0xB2CF, 0x8895, 0xB2D0, 0xB4D2, 0xB2D1, 0x8896, 0xB2D2, 0xB4D3, 0xB2D3, 0x8897, + 0xB2D4, 0x8898, 0xB2D5, 0x8899, 0xB2D6, 0x889A, 0xB2D7, 0x889B, 0xB2D8, 0xB4D4, 0xB2D9, 0xB4D5, 0xB2DA, 0x889C, 0xB2DB, 0xB4D6, + 0xB2DC, 0x889D, 0xB2DD, 0xB4D7, 0xB2DE, 0x889E, 0xB2DF, 0x889F, 0xB2E0, 0x88A0, 0xB2E1, 0x88A1, 0xB2E2, 0xB4D8, 0xB2E3, 0x88A2, + 0xB2E4, 0xB4D9, 0xB2E5, 0xB4DA, 0xB2E6, 0xB4DB, 0xB2E7, 0x88A3, 0xB2E8, 0xB4DC, 0xB2E9, 0x88A4, 0xB2EA, 0x88A5, 0xB2EB, 0xB4DD, + 0xB2EC, 0xB4DE, 0xB2ED, 0xB4DF, 0xB2EE, 0xB4E0, 0xB2EF, 0xB4E1, 0xB2F0, 0x88A6, 0xB2F1, 0x88A7, 0xB2F2, 0x88A8, 0xB2F3, 0xB4E2, + 0xB2F4, 0xB4E3, 0xB2F5, 0xB4E4, 0xB2F6, 0x88A9, 0xB2F7, 0xB4E5, 0xB2F8, 0xB4E6, 0xB2F9, 0xB4E7, 0xB2FA, 0xB4E8, 0xB2FB, 0xB4E9, + 0xB2FC, 0x88AA, 0xB2FD, 0x88AB, 0xB2FE, 0x88AC, 0xB2FF, 0xB4EA, 0xB300, 0xB4EB, 0xB301, 0xB4EC, 0xB302, 0x88AD, 0xB303, 0x88AE, + 0xB304, 0xB4ED, 0xB305, 0x88AF, 0xB306, 0x88B0, 0xB307, 0x88B1, 0xB308, 0xB4EE, 0xB309, 0x88B2, 0xB30A, 0x88B3, 0xB30B, 0x88B4, + 0xB30C, 0x88B5, 0xB30D, 0x88B6, 0xB30E, 0x88B7, 0xB30F, 0x88B8, 0xB310, 0xB4EF, 0xB311, 0xB4F0, 0xB312, 0x88B9, 0xB313, 0xB4F1, + 0xB314, 0xB4F2, 0xB315, 0xB4F3, 0xB316, 0x88BA, 0xB317, 0x88BB, 0xB318, 0x88BC, 0xB319, 0x88BD, 0xB31A, 0x88BE, 0xB31B, 0x88BF, + 0xB31C, 0xB4F4, 0xB31D, 0x88C0, 0xB31E, 0x88C1, 0xB31F, 0x88C2, 0xB320, 0x88C3, 0xB321, 0x88C4, 0xB322, 0x88C5, 0xB323, 0x88C6, + 0xB324, 0x88C7, 0xB325, 0x88C8, 0xB326, 0x88C9, 0xB327, 0x88CA, 0xB328, 0x88CB, 0xB329, 0x88CC, 0xB32A, 0x88CD, 0xB32B, 0x88CE, + 0xB32C, 0x88CF, 0xB32D, 0x88D0, 0xB32E, 0x88D1, 0xB32F, 0x88D2, 0xB330, 0x88D3, 0xB331, 0x88D4, 0xB332, 0x88D5, 0xB333, 0x88D6, + 0xB334, 0x88D7, 0xB335, 0x88D8, 0xB336, 0x88D9, 0xB337, 0x88DA, 0xB338, 0x88DB, 0xB339, 0x88DC, 0xB33A, 0x88DD, 0xB33B, 0x88DE, + 0xB33C, 0x88DF, 0xB33D, 0x88E0, 0xB33E, 0x88E1, 0xB33F, 0x88E2, 0xB340, 0x88E3, 0xB341, 0x88E4, 0xB342, 0x88E5, 0xB343, 0x88E6, + 0xB344, 0x88E7, 0xB345, 0x88E8, 0xB346, 0x88E9, 0xB347, 0x88EA, 0xB348, 0x88EB, 0xB349, 0x88EC, 0xB34A, 0x88ED, 0xB34B, 0x88EE, + 0xB34C, 0x88EF, 0xB34D, 0x88F0, 0xB34E, 0x88F1, 0xB34F, 0x88F2, 0xB350, 0x88F3, 0xB351, 0x88F4, 0xB352, 0x88F5, 0xB353, 0x88F6, + 0xB354, 0xB4F5, 0xB355, 0xB4F6, 0xB356, 0xB4F7, 0xB357, 0x88F7, 0xB358, 0xB4F8, 0xB359, 0x88F8, 0xB35A, 0x88F9, 0xB35B, 0xB4F9, + 0xB35C, 0xB4FA, 0xB35D, 0x88FA, 0xB35E, 0xB4FB, 0xB35F, 0xB4FC, 0xB360, 0x88FB, 0xB361, 0x88FC, 0xB362, 0x88FD, 0xB363, 0x88FE, + 0xB364, 0xB4FD, 0xB365, 0xB4FE, 0xB366, 0x8941, 0xB367, 0xB5A1, 0xB368, 0x8942, 0xB369, 0xB5A2, 0xB36A, 0x8943, 0xB36B, 0xB5A3, + 0xB36C, 0x8944, 0xB36D, 0x8945, 0xB36E, 0xB5A4, 0xB36F, 0x8946, 0xB370, 0xB5A5, 0xB371, 0xB5A6, 0xB372, 0x8947, 0xB373, 0x8948, + 0xB374, 0xB5A7, 0xB375, 0x8949, 0xB376, 0x894A, 0xB377, 0x894B, 0xB378, 0xB5A8, 0xB379, 0x894C, 0xB37A, 0x894D, 0xB37B, 0x894E, + 0xB37C, 0x894F, 0xB37D, 0x8950, 0xB37E, 0x8951, 0xB37F, 0x8952, 0xB380, 0xB5A9, 0xB381, 0xB5AA, 0xB382, 0x8953, 0xB383, 0xB5AB, + 0xB384, 0xB5AC, 0xB385, 0xB5AD, 0xB386, 0x8954, 0xB387, 0x8955, 0xB388, 0x8956, 0xB389, 0x8957, 0xB38A, 0x8958, 0xB38B, 0x8959, + 0xB38C, 0xB5AE, 0xB38D, 0x895A, 0xB38E, 0x8961, 0xB38F, 0x8962, 0xB390, 0xB5AF, 0xB391, 0x8963, 0xB392, 0x8964, 0xB393, 0x8965, + 0xB394, 0xB5B0, 0xB395, 0x8966, 0xB396, 0x8967, 0xB397, 0x8968, 0xB398, 0x8969, 0xB399, 0x896A, 0xB39A, 0x896B, 0xB39B, 0x896C, + 0xB39C, 0x896D, 0xB39D, 0x896E, 0xB39E, 0x896F, 0xB39F, 0x8970, 0xB3A0, 0xB5B1, 0xB3A1, 0xB5B2, 0xB3A2, 0x8971, 0xB3A3, 0x8972, + 0xB3A4, 0x8973, 0xB3A5, 0x8974, 0xB3A6, 0x8975, 0xB3A7, 0x8976, 0xB3A8, 0xB5B3, 0xB3A9, 0x8977, 0xB3AA, 0x8978, 0xB3AB, 0x8979, + 0xB3AC, 0xB5B4, 0xB3AD, 0x897A, 0xB3AE, 0x8981, 0xB3AF, 0x8982, 0xB3B0, 0x8983, 0xB3B1, 0x8984, 0xB3B2, 0x8985, 0xB3B3, 0x8986, + 0xB3B4, 0x8987, 0xB3B5, 0x8988, 0xB3B6, 0x8989, 0xB3B7, 0x898A, 0xB3B8, 0x898B, 0xB3B9, 0x898C, 0xB3BA, 0x898D, 0xB3BB, 0x898E, + 0xB3BC, 0x898F, 0xB3BD, 0x8990, 0xB3BE, 0x8991, 0xB3BF, 0x8992, 0xB3C0, 0x8993, 0xB3C1, 0x8994, 0xB3C2, 0x8995, 0xB3C3, 0x8996, + 0xB3C4, 0xB5B5, 0xB3C5, 0xB5B6, 0xB3C6, 0x8997, 0xB3C7, 0x8998, 0xB3C8, 0xB5B7, 0xB3C9, 0x8999, 0xB3CA, 0x899A, 0xB3CB, 0xB5B8, + 0xB3CC, 0xB5B9, 0xB3CD, 0x899B, 0xB3CE, 0xB5BA, 0xB3CF, 0x899C, 0xB3D0, 0xB5BB, 0xB3D1, 0x899D, 0xB3D2, 0x899E, 0xB3D3, 0x899F, + 0xB3D4, 0xB5BC, 0xB3D5, 0xB5BD, 0xB3D6, 0x89A0, 0xB3D7, 0xB5BE, 0xB3D8, 0x89A1, 0xB3D9, 0xB5BF, 0xB3DA, 0x89A2, 0xB3DB, 0xB5C0, + 0xB3DC, 0x89A3, 0xB3DD, 0xB5C1, 0xB3DE, 0x89A4, 0xB3DF, 0x89A5, 0xB3E0, 0xB5C2, 0xB3E1, 0x89A6, 0xB3E2, 0x89A7, 0xB3E3, 0x89A8, + 0xB3E4, 0xB5C3, 0xB3E5, 0x89A9, 0xB3E6, 0x89AA, 0xB3E7, 0x89AB, 0xB3E8, 0xB5C4, 0xB3E9, 0x89AC, 0xB3EA, 0x89AD, 0xB3EB, 0x89AE, + 0xB3EC, 0x89AF, 0xB3ED, 0x89B0, 0xB3EE, 0x89B1, 0xB3EF, 0x89B2, 0xB3F0, 0x89B3, 0xB3F1, 0x89B4, 0xB3F2, 0x89B5, 0xB3F3, 0x89B6, + 0xB3F4, 0x89B7, 0xB3F5, 0x89B8, 0xB3F6, 0x89B9, 0xB3F7, 0x89BA, 0xB3F8, 0x89BB, 0xB3F9, 0x89BC, 0xB3FA, 0x89BD, 0xB3FB, 0x89BE, + 0xB3FC, 0xB5C5, 0xB3FD, 0x89BF, 0xB3FE, 0x89C0, 0xB3FF, 0x89C1, 0xB400, 0x89C2, 0xB401, 0x89C3, 0xB402, 0x89C4, 0xB403, 0x89C5, + 0xB404, 0x89C6, 0xB405, 0x89C7, 0xB406, 0x89C8, 0xB407, 0x89C9, 0xB408, 0x89CA, 0xB409, 0x89CB, 0xB40A, 0x89CC, 0xB40B, 0x89CD, + 0xB40C, 0x89CE, 0xB40D, 0x89CF, 0xB40E, 0x89D0, 0xB40F, 0x89D1, 0xB410, 0xB5C6, 0xB411, 0x89D2, 0xB412, 0x89D3, 0xB413, 0x89D4, + 0xB414, 0x89D5, 0xB415, 0x89D6, 0xB416, 0x89D7, 0xB417, 0x89D8, 0xB418, 0xB5C7, 0xB419, 0x89D9, 0xB41A, 0x89DA, 0xB41B, 0x89DB, + 0xB41C, 0xB5C8, 0xB41D, 0x89DC, 0xB41E, 0x89DD, 0xB41F, 0x89DE, 0xB420, 0xB5C9, 0xB421, 0x89DF, 0xB422, 0x89E0, 0xB423, 0x89E1, + 0xB424, 0x89E2, 0xB425, 0x89E3, 0xB426, 0x89E4, 0xB427, 0x89E5, 0xB428, 0xB5CA, 0xB429, 0xB5CB, 0xB42A, 0x89E6, 0xB42B, 0xB5CC, + 0xB42C, 0x89E7, 0xB42D, 0x89E8, 0xB42E, 0x89E9, 0xB42F, 0x89EA, 0xB430, 0x89EB, 0xB431, 0x89EC, 0xB432, 0x89ED, 0xB433, 0x89EE, + 0xB434, 0xB5CD, 0xB435, 0x89EF, 0xB436, 0x89F0, 0xB437, 0x89F1, 0xB438, 0x89F2, 0xB439, 0x89F3, 0xB43A, 0x89F4, 0xB43B, 0x89F5, + 0xB43C, 0x89F6, 0xB43D, 0x89F7, 0xB43E, 0x89F8, 0xB43F, 0x89F9, 0xB440, 0x89FA, 0xB441, 0x89FB, 0xB442, 0x89FC, 0xB443, 0x89FD, + 0xB444, 0x89FE, 0xB445, 0x8A41, 0xB446, 0x8A42, 0xB447, 0x8A43, 0xB448, 0x8A44, 0xB449, 0x8A45, 0xB44A, 0x8A46, 0xB44B, 0x8A47, + 0xB44C, 0x8A48, 0xB44D, 0x8A49, 0xB44E, 0x8A4A, 0xB44F, 0x8A4B, 0xB450, 0xB5CE, 0xB451, 0xB5CF, 0xB452, 0x8A4C, 0xB453, 0x8A4D, + 0xB454, 0xB5D0, 0xB455, 0x8A4E, 0xB456, 0x8A4F, 0xB457, 0x8A50, 0xB458, 0xB5D1, 0xB459, 0x8A51, 0xB45A, 0x8A52, 0xB45B, 0x8A53, + 0xB45C, 0x8A54, 0xB45D, 0x8A55, 0xB45E, 0x8A56, 0xB45F, 0x8A57, 0xB460, 0xB5D2, 0xB461, 0xB5D3, 0xB462, 0x8A58, 0xB463, 0xB5D4, + 0xB464, 0x8A59, 0xB465, 0xB5D5, 0xB466, 0x8A5A, 0xB467, 0x8A61, 0xB468, 0x8A62, 0xB469, 0x8A63, 0xB46A, 0x8A64, 0xB46B, 0x8A65, + 0xB46C, 0xB5D6, 0xB46D, 0x8A66, 0xB46E, 0x8A67, 0xB46F, 0x8A68, 0xB470, 0x8A69, 0xB471, 0x8A6A, 0xB472, 0x8A6B, 0xB473, 0x8A6C, + 0xB474, 0x8A6D, 0xB475, 0x8A6E, 0xB476, 0x8A6F, 0xB477, 0x8A70, 0xB478, 0x8A71, 0xB479, 0x8A72, 0xB47A, 0x8A73, 0xB47B, 0x8A74, + 0xB47C, 0x8A75, 0xB47D, 0x8A76, 0xB47E, 0x8A77, 0xB47F, 0x8A78, 0xB480, 0xB5D7, 0xB481, 0x8A79, 0xB482, 0x8A7A, 0xB483, 0x8A81, + 0xB484, 0x8A82, 0xB485, 0x8A83, 0xB486, 0x8A84, 0xB487, 0x8A85, 0xB488, 0xB5D8, 0xB489, 0x8A86, 0xB48A, 0x8A87, 0xB48B, 0x8A88, + 0xB48C, 0x8A89, 0xB48D, 0x8A8A, 0xB48E, 0x8A8B, 0xB48F, 0x8A8C, 0xB490, 0x8A8D, 0xB491, 0x8A8E, 0xB492, 0x8A8F, 0xB493, 0x8A90, + 0xB494, 0x8A91, 0xB495, 0x8A92, 0xB496, 0x8A93, 0xB497, 0x8A94, 0xB498, 0x8A95, 0xB499, 0x8A96, 0xB49A, 0x8A97, 0xB49B, 0x8A98, + 0xB49C, 0x8A99, 0xB49D, 0xB5D9, 0xB49E, 0x8A9A, 0xB49F, 0x8A9B, 0xB4A0, 0x8A9C, 0xB4A1, 0x8A9D, 0xB4A2, 0x8A9E, 0xB4A3, 0x8A9F, + 0xB4A4, 0xB5DA, 0xB4A5, 0x8AA0, 0xB4A6, 0x8AA1, 0xB4A7, 0x8AA2, 0xB4A8, 0xB5DB, 0xB4A9, 0x8AA3, 0xB4AA, 0x8AA4, 0xB4AB, 0x8AA5, + 0xB4AC, 0xB5DC, 0xB4AD, 0x8AA6, 0xB4AE, 0x8AA7, 0xB4AF, 0x8AA8, 0xB4B0, 0x8AA9, 0xB4B1, 0x8AAA, 0xB4B2, 0x8AAB, 0xB4B3, 0x8AAC, + 0xB4B4, 0x8AAD, 0xB4B5, 0xB5DD, 0xB4B6, 0x8AAE, 0xB4B7, 0xB5DE, 0xB4B8, 0x8AAF, 0xB4B9, 0xB5DF, 0xB4BA, 0x8AB0, 0xB4BB, 0x8AB1, + 0xB4BC, 0x8AB2, 0xB4BD, 0x8AB3, 0xB4BE, 0x8AB4, 0xB4BF, 0x8AB5, 0xB4C0, 0xB5E0, 0xB4C1, 0x8AB6, 0xB4C2, 0x8AB7, 0xB4C3, 0x8AB8, + 0xB4C4, 0xB5E1, 0xB4C5, 0x8AB9, 0xB4C6, 0x8ABA, 0xB4C7, 0x8ABB, 0xB4C8, 0xB5E2, 0xB4C9, 0x8ABC, 0xB4CA, 0x8ABD, 0xB4CB, 0x8ABE, + 0xB4CC, 0x8ABF, 0xB4CD, 0x8AC0, 0xB4CE, 0x8AC1, 0xB4CF, 0x8AC2, 0xB4D0, 0xB5E3, 0xB4D1, 0x8AC3, 0xB4D2, 0x8AC4, 0xB4D3, 0x8AC5, + 0xB4D4, 0x8AC6, 0xB4D5, 0xB5E4, 0xB4D6, 0x8AC7, 0xB4D7, 0x8AC8, 0xB4D8, 0x8AC9, 0xB4D9, 0x8ACA, 0xB4DA, 0x8ACB, 0xB4DB, 0x8ACC, + 0xB4DC, 0xB5E5, 0xB4DD, 0xB5E6, 0xB4DE, 0x8ACD, 0xB4DF, 0x8ACE, 0xB4E0, 0xB5E7, 0xB4E1, 0x8ACF, 0xB4E2, 0x8AD0, 0xB4E3, 0xB5E8, + 0xB4E4, 0xB5E9, 0xB4E5, 0x8AD1, 0xB4E6, 0xB5EA, 0xB4E7, 0x8AD2, 0xB4E8, 0x8AD3, 0xB4E9, 0x8AD4, 0xB4EA, 0x8AD5, 0xB4EB, 0x8AD6, + 0xB4EC, 0xB5EB, 0xB4ED, 0xB5EC, 0xB4EE, 0x8AD7, 0xB4EF, 0xB5ED, 0xB4F0, 0x8AD8, 0xB4F1, 0xB5EE, 0xB4F2, 0x8AD9, 0xB4F3, 0x8ADA, + 0xB4F4, 0x8ADB, 0xB4F5, 0x8ADC, 0xB4F6, 0x8ADD, 0xB4F7, 0x8ADE, 0xB4F8, 0xB5EF, 0xB4F9, 0x8ADF, 0xB4FA, 0x8AE0, 0xB4FB, 0x8AE1, + 0xB4FC, 0x8AE2, 0xB4FD, 0x8AE3, 0xB4FE, 0x8AE4, 0xB4FF, 0x8AE5, 0xB500, 0x8AE6, 0xB501, 0x8AE7, 0xB502, 0x8AE8, 0xB503, 0x8AE9, + 0xB504, 0x8AEA, 0xB505, 0x8AEB, 0xB506, 0x8AEC, 0xB507, 0x8AED, 0xB508, 0x8AEE, 0xB509, 0x8AEF, 0xB50A, 0x8AF0, 0xB50B, 0x8AF1, + 0xB50C, 0x8AF2, 0xB50D, 0x8AF3, 0xB50E, 0x8AF4, 0xB50F, 0x8AF5, 0xB510, 0x8AF6, 0xB511, 0x8AF7, 0xB512, 0x8AF8, 0xB513, 0x8AF9, + 0xB514, 0xB5F0, 0xB515, 0xB5F1, 0xB516, 0x8AFA, 0xB517, 0x8AFB, 0xB518, 0xB5F2, 0xB519, 0x8AFC, 0xB51A, 0x8AFD, 0xB51B, 0xB5F3, + 0xB51C, 0xB5F4, 0xB51D, 0x8AFE, 0xB51E, 0x8B41, 0xB51F, 0x8B42, 0xB520, 0x8B43, 0xB521, 0x8B44, 0xB522, 0x8B45, 0xB523, 0x8B46, + 0xB524, 0xB5F5, 0xB525, 0xB5F6, 0xB526, 0x8B47, 0xB527, 0xB5F7, 0xB528, 0xB5F8, 0xB529, 0xB5F9, 0xB52A, 0xB5FA, 0xB52B, 0x8B48, + 0xB52C, 0x8B49, 0xB52D, 0x8B4A, 0xB52E, 0x8B4B, 0xB52F, 0x8B4C, 0xB530, 0xB5FB, 0xB531, 0xB5FC, 0xB532, 0x8B4D, 0xB533, 0x8B4E, + 0xB534, 0xB5FD, 0xB535, 0x8B4F, 0xB536, 0x8B50, 0xB537, 0x8B51, 0xB538, 0xB5FE, 0xB539, 0x8B52, 0xB53A, 0x8B53, 0xB53B, 0x8B54, + 0xB53C, 0x8B55, 0xB53D, 0x8B56, 0xB53E, 0x8B57, 0xB53F, 0x8B58, 0xB540, 0xB6A1, 0xB541, 0xB6A2, 0xB542, 0x8B59, 0xB543, 0xB6A3, + 0xB544, 0xB6A4, 0xB545, 0xB6A5, 0xB546, 0x8B5A, 0xB547, 0x8B61, 0xB548, 0x8B62, 0xB549, 0x8B63, 0xB54A, 0x8B64, 0xB54B, 0xB6A6, + 0xB54C, 0xB6A7, 0xB54D, 0xB6A8, 0xB54E, 0x8B65, 0xB54F, 0x8B66, 0xB550, 0xB6A9, 0xB551, 0x8B67, 0xB552, 0x8B68, 0xB553, 0x8B69, + 0xB554, 0xB6AA, 0xB555, 0x8B6A, 0xB556, 0x8B6B, 0xB557, 0x8B6C, 0xB558, 0x8B6D, 0xB559, 0x8B6E, 0xB55A, 0x8B6F, 0xB55B, 0x8B70, + 0xB55C, 0xB6AB, 0xB55D, 0xB6AC, 0xB55E, 0x8B71, 0xB55F, 0xB6AD, 0xB560, 0xB6AE, 0xB561, 0xB6AF, 0xB562, 0x8B72, 0xB563, 0x8B73, + 0xB564, 0x8B74, 0xB565, 0x8B75, 0xB566, 0x8B76, 0xB567, 0x8B77, 0xB568, 0x8B78, 0xB569, 0x8B79, 0xB56A, 0x8B7A, 0xB56B, 0x8B81, + 0xB56C, 0x8B82, 0xB56D, 0x8B83, 0xB56E, 0x8B84, 0xB56F, 0x8B85, 0xB570, 0x8B86, 0xB571, 0x8B87, 0xB572, 0x8B88, 0xB573, 0x8B89, + 0xB574, 0x8B8A, 0xB575, 0x8B8B, 0xB576, 0x8B8C, 0xB577, 0x8B8D, 0xB578, 0x8B8E, 0xB579, 0x8B8F, 0xB57A, 0x8B90, 0xB57B, 0x8B91, + 0xB57C, 0x8B92, 0xB57D, 0x8B93, 0xB57E, 0x8B94, 0xB57F, 0x8B95, 0xB580, 0x8B96, 0xB581, 0x8B97, 0xB582, 0x8B98, 0xB583, 0x8B99, + 0xB584, 0x8B9A, 0xB585, 0x8B9B, 0xB586, 0x8B9C, 0xB587, 0x8B9D, 0xB588, 0x8B9E, 0xB589, 0x8B9F, 0xB58A, 0x8BA0, 0xB58B, 0x8BA1, + 0xB58C, 0x8BA2, 0xB58D, 0x8BA3, 0xB58E, 0x8BA4, 0xB58F, 0x8BA5, 0xB590, 0x8BA6, 0xB591, 0x8BA7, 0xB592, 0x8BA8, 0xB593, 0x8BA9, + 0xB594, 0x8BAA, 0xB595, 0x8BAB, 0xB596, 0x8BAC, 0xB597, 0x8BAD, 0xB598, 0x8BAE, 0xB599, 0x8BAF, 0xB59A, 0x8BB0, 0xB59B, 0x8BB1, + 0xB59C, 0x8BB2, 0xB59D, 0x8BB3, 0xB59E, 0x8BB4, 0xB59F, 0x8BB5, 0xB5A0, 0xB6B0, 0xB5A1, 0xB6B1, 0xB5A2, 0x8BB6, 0xB5A3, 0x8BB7, + 0xB5A4, 0xB6B2, 0xB5A5, 0x8BB8, 0xB5A6, 0x8BB9, 0xB5A7, 0x8BBA, 0xB5A8, 0xB6B3, 0xB5A9, 0x8BBB, 0xB5AA, 0xB6B4, 0xB5AB, 0xB6B5, + 0xB5AC, 0x8BBC, 0xB5AD, 0x8BBD, 0xB5AE, 0x8BBE, 0xB5AF, 0x8BBF, 0xB5B0, 0xB6B6, 0xB5B1, 0xB6B7, 0xB5B2, 0x8BC0, 0xB5B3, 0xB6B8, + 0xB5B4, 0xB6B9, 0xB5B5, 0xB6BA, 0xB5B6, 0x8BC1, 0xB5B7, 0x8BC2, 0xB5B8, 0x8BC3, 0xB5B9, 0x8BC4, 0xB5BA, 0x8BC5, 0xB5BB, 0xB6BB, + 0xB5BC, 0xB6BC, 0xB5BD, 0xB6BD, 0xB5BE, 0x8BC6, 0xB5BF, 0x8BC7, 0xB5C0, 0xB6BE, 0xB5C1, 0x8BC8, 0xB5C2, 0x8BC9, 0xB5C3, 0x8BCA, + 0xB5C4, 0xB6BF, 0xB5C5, 0x8BCB, 0xB5C6, 0x8BCC, 0xB5C7, 0x8BCD, 0xB5C8, 0x8BCE, 0xB5C9, 0x8BCF, 0xB5CA, 0x8BD0, 0xB5CB, 0x8BD1, + 0xB5CC, 0xB6C0, 0xB5CD, 0xB6C1, 0xB5CE, 0x8BD2, 0xB5CF, 0xB6C2, 0xB5D0, 0xB6C3, 0xB5D1, 0xB6C4, 0xB5D2, 0x8BD3, 0xB5D3, 0x8BD4, + 0xB5D4, 0x8BD5, 0xB5D5, 0x8BD6, 0xB5D6, 0x8BD7, 0xB5D7, 0x8BD8, 0xB5D8, 0xB6C5, 0xB5D9, 0x8BD9, 0xB5DA, 0x8BDA, 0xB5DB, 0x8BDB, + 0xB5DC, 0x8BDC, 0xB5DD, 0x8BDD, 0xB5DE, 0x8BDE, 0xB5DF, 0x8BDF, 0xB5E0, 0x8BE0, 0xB5E1, 0x8BE1, 0xB5E2, 0x8BE2, 0xB5E3, 0x8BE3, + 0xB5E4, 0x8BE4, 0xB5E5, 0x8BE5, 0xB5E6, 0x8BE6, 0xB5E7, 0x8BE7, 0xB5E8, 0x8BE8, 0xB5E9, 0x8BE9, 0xB5EA, 0x8BEA, 0xB5EB, 0x8BEB, + 0xB5EC, 0xB6C6, 0xB5ED, 0x8BEC, 0xB5EE, 0x8BED, 0xB5EF, 0x8BEE, 0xB5F0, 0x8BEF, 0xB5F1, 0x8BF0, 0xB5F2, 0x8BF1, 0xB5F3, 0x8BF2, + 0xB5F4, 0x8BF3, 0xB5F5, 0x8BF4, 0xB5F6, 0x8BF5, 0xB5F7, 0x8BF6, 0xB5F8, 0x8BF7, 0xB5F9, 0x8BF8, 0xB5FA, 0x8BF9, 0xB5FB, 0x8BFA, + 0xB5FC, 0x8BFB, 0xB5FD, 0x8BFC, 0xB5FE, 0x8BFD, 0xB5FF, 0x8BFE, 0xB600, 0x8C41, 0xB601, 0x8C42, 0xB602, 0x8C43, 0xB603, 0x8C44, + 0xB604, 0x8C45, 0xB605, 0x8C46, 0xB606, 0x8C47, 0xB607, 0x8C48, 0xB608, 0x8C49, 0xB609, 0x8C4A, 0xB60A, 0x8C4B, 0xB60B, 0x8C4C, + 0xB60C, 0x8C4D, 0xB60D, 0x8C4E, 0xB60E, 0x8C4F, 0xB60F, 0x8C50, 0xB610, 0xB6C7, 0xB611, 0xB6C8, 0xB612, 0x8C51, 0xB613, 0x8C52, + 0xB614, 0xB6C9, 0xB615, 0x8C53, 0xB616, 0x8C54, 0xB617, 0x8C55, 0xB618, 0xB6CA, 0xB619, 0x8C56, 0xB61A, 0x8C57, 0xB61B, 0x8C58, + 0xB61C, 0x8C59, 0xB61D, 0x8C5A, 0xB61E, 0x8C61, 0xB61F, 0x8C62, 0xB620, 0x8C63, 0xB621, 0x8C64, 0xB622, 0x8C65, 0xB623, 0x8C66, + 0xB624, 0x8C67, 0xB625, 0xB6CB, 0xB626, 0x8C68, 0xB627, 0x8C69, 0xB628, 0x8C6A, 0xB629, 0x8C6B, 0xB62A, 0x8C6C, 0xB62B, 0x8C6D, + 0xB62C, 0xB6CC, 0xB62D, 0x8C6E, 0xB62E, 0x8C6F, 0xB62F, 0x8C70, 0xB630, 0x8C71, 0xB631, 0x8C72, 0xB632, 0x8C73, 0xB633, 0x8C74, + 0xB634, 0xB6CD, 0xB635, 0x8C75, 0xB636, 0x8C76, 0xB637, 0x8C77, 0xB638, 0x8C78, 0xB639, 0x8C79, 0xB63A, 0x8C7A, 0xB63B, 0x8C81, + 0xB63C, 0x8C82, 0xB63D, 0x8C83, 0xB63E, 0x8C84, 0xB63F, 0x8C85, 0xB640, 0x8C86, 0xB641, 0x8C87, 0xB642, 0x8C88, 0xB643, 0x8C89, + 0xB644, 0x8C8A, 0xB645, 0x8C8B, 0xB646, 0x8C8C, 0xB647, 0x8C8D, 0xB648, 0xB6CE, 0xB649, 0x8C8E, 0xB64A, 0x8C8F, 0xB64B, 0x8C90, + 0xB64C, 0x8C91, 0xB64D, 0x8C92, 0xB64E, 0x8C93, 0xB64F, 0x8C94, 0xB650, 0x8C95, 0xB651, 0x8C96, 0xB652, 0x8C97, 0xB653, 0x8C98, + 0xB654, 0x8C99, 0xB655, 0x8C9A, 0xB656, 0x8C9B, 0xB657, 0x8C9C, 0xB658, 0x8C9D, 0xB659, 0x8C9E, 0xB65A, 0x8C9F, 0xB65B, 0x8CA0, + 0xB65C, 0x8CA1, 0xB65D, 0x8CA2, 0xB65E, 0x8CA3, 0xB65F, 0x8CA4, 0xB660, 0x8CA5, 0xB661, 0x8CA6, 0xB662, 0x8CA7, 0xB663, 0x8CA8, + 0xB664, 0xB6CF, 0xB665, 0x8CA9, 0xB666, 0x8CAA, 0xB667, 0x8CAB, 0xB668, 0xB6D0, 0xB669, 0x8CAC, 0xB66A, 0x8CAD, 0xB66B, 0x8CAE, + 0xB66C, 0x8CAF, 0xB66D, 0x8CB0, 0xB66E, 0x8CB1, 0xB66F, 0x8CB2, 0xB670, 0x8CB3, 0xB671, 0x8CB4, 0xB672, 0x8CB5, 0xB673, 0x8CB6, + 0xB674, 0x8CB7, 0xB675, 0x8CB8, 0xB676, 0x8CB9, 0xB677, 0x8CBA, 0xB678, 0x8CBB, 0xB679, 0x8CBC, 0xB67A, 0x8CBD, 0xB67B, 0x8CBE, + 0xB67C, 0x8CBF, 0xB67D, 0x8CC0, 0xB67E, 0x8CC1, 0xB67F, 0x8CC2, 0xB680, 0x8CC3, 0xB681, 0x8CC4, 0xB682, 0x8CC5, 0xB683, 0x8CC6, + 0xB684, 0x8CC7, 0xB685, 0x8CC8, 0xB686, 0x8CC9, 0xB687, 0x8CCA, 0xB688, 0x8CCB, 0xB689, 0x8CCC, 0xB68A, 0x8CCD, 0xB68B, 0x8CCE, + 0xB68C, 0x8CCF, 0xB68D, 0x8CD0, 0xB68E, 0x8CD1, 0xB68F, 0x8CD2, 0xB690, 0x8CD3, 0xB691, 0x8CD4, 0xB692, 0x8CD5, 0xB693, 0x8CD6, + 0xB694, 0x8CD7, 0xB695, 0x8CD8, 0xB696, 0x8CD9, 0xB697, 0x8CDA, 0xB698, 0x8CDB, 0xB699, 0x8CDC, 0xB69A, 0x8CDD, 0xB69B, 0x8CDE, + 0xB69C, 0xB6D1, 0xB69D, 0xB6D2, 0xB69E, 0x8CDF, 0xB69F, 0x8CE0, 0xB6A0, 0xB6D3, 0xB6A1, 0x8CE1, 0xB6A2, 0x8CE2, 0xB6A3, 0x8CE3, + 0xB6A4, 0xB6D4, 0xB6A5, 0x8CE4, 0xB6A6, 0x8CE5, 0xB6A7, 0x8CE6, 0xB6A8, 0x8CE7, 0xB6A9, 0x8CE8, 0xB6AA, 0x8CE9, 0xB6AB, 0xB6D5, + 0xB6AC, 0xB6D6, 0xB6AD, 0x8CEA, 0xB6AE, 0x8CEB, 0xB6AF, 0x8CEC, 0xB6B0, 0x8CED, 0xB6B1, 0xB6D7, 0xB6B2, 0x8CEE, 0xB6B3, 0x8CEF, + 0xB6B4, 0x8CF0, 0xB6B5, 0x8CF1, 0xB6B6, 0x8CF2, 0xB6B7, 0x8CF3, 0xB6B8, 0x8CF4, 0xB6B9, 0x8CF5, 0xB6BA, 0x8CF6, 0xB6BB, 0x8CF7, + 0xB6BC, 0x8CF8, 0xB6BD, 0x8CF9, 0xB6BE, 0x8CFA, 0xB6BF, 0x8CFB, 0xB6C0, 0x8CFC, 0xB6C1, 0x8CFD, 0xB6C2, 0x8CFE, 0xB6C3, 0x8D41, + 0xB6C4, 0x8D42, 0xB6C5, 0x8D43, 0xB6C6, 0x8D44, 0xB6C7, 0x8D45, 0xB6C8, 0x8D46, 0xB6C9, 0x8D47, 0xB6CA, 0x8D48, 0xB6CB, 0x8D49, + 0xB6CC, 0x8D4A, 0xB6CD, 0x8D4B, 0xB6CE, 0x8D4C, 0xB6CF, 0x8D4D, 0xB6D0, 0x8D4E, 0xB6D1, 0x8D4F, 0xB6D2, 0x8D50, 0xB6D3, 0x8D51, + 0xB6D4, 0xB6D8, 0xB6D5, 0x8D52, 0xB6D6, 0x8D53, 0xB6D7, 0x8D54, 0xB6D8, 0x8D55, 0xB6D9, 0x8D56, 0xB6DA, 0x8D57, 0xB6DB, 0x8D58, + 0xB6DC, 0x8D59, 0xB6DD, 0x8D5A, 0xB6DE, 0x8D61, 0xB6DF, 0x8D62, 0xB6E0, 0x8D63, 0xB6E1, 0x8D64, 0xB6E2, 0x8D65, 0xB6E3, 0x8D66, + 0xB6E4, 0x8D67, 0xB6E5, 0x8D68, 0xB6E6, 0x8D69, 0xB6E7, 0x8D6A, 0xB6E8, 0x8D6B, 0xB6E9, 0x8D6C, 0xB6EA, 0x8D6D, 0xB6EB, 0x8D6E, + 0xB6EC, 0x8D6F, 0xB6ED, 0x8D70, 0xB6EE, 0x8D71, 0xB6EF, 0x8D72, 0xB6F0, 0xB6D9, 0xB6F1, 0x8D73, 0xB6F2, 0x8D74, 0xB6F3, 0x8D75, + 0xB6F4, 0xB6DA, 0xB6F5, 0x8D76, 0xB6F6, 0x8D77, 0xB6F7, 0x8D78, 0xB6F8, 0xB6DB, 0xB6F9, 0x8D79, 0xB6FA, 0x8D7A, 0xB6FB, 0x8D81, + 0xB6FC, 0x8D82, 0xB6FD, 0x8D83, 0xB6FE, 0x8D84, 0xB6FF, 0x8D85, 0xB700, 0xB6DC, 0xB701, 0xB6DD, 0xB702, 0x8D86, 0xB703, 0x8D87, + 0xB704, 0x8D88, 0xB705, 0xB6DE, 0xB706, 0x8D89, 0xB707, 0x8D8A, 0xB708, 0x8D8B, 0xB709, 0x8D8C, 0xB70A, 0x8D8D, 0xB70B, 0x8D8E, + 0xB70C, 0x8D8F, 0xB70D, 0x8D90, 0xB70E, 0x8D91, 0xB70F, 0x8D92, 0xB710, 0x8D93, 0xB711, 0x8D94, 0xB712, 0x8D95, 0xB713, 0x8D96, + 0xB714, 0x8D97, 0xB715, 0x8D98, 0xB716, 0x8D99, 0xB717, 0x8D9A, 0xB718, 0x8D9B, 0xB719, 0x8D9C, 0xB71A, 0x8D9D, 0xB71B, 0x8D9E, + 0xB71C, 0x8D9F, 0xB71D, 0x8DA0, 0xB71E, 0x8DA1, 0xB71F, 0x8DA2, 0xB720, 0x8DA3, 0xB721, 0x8DA4, 0xB722, 0x8DA5, 0xB723, 0x8DA6, + 0xB724, 0x8DA7, 0xB725, 0x8DA8, 0xB726, 0x8DA9, 0xB727, 0x8DAA, 0xB728, 0xB6DF, 0xB729, 0xB6E0, 0xB72A, 0x8DAB, 0xB72B, 0x8DAC, + 0xB72C, 0xB6E1, 0xB72D, 0x8DAD, 0xB72E, 0x8DAE, 0xB72F, 0xB6E2, 0xB730, 0xB6E3, 0xB731, 0x8DAF, 0xB732, 0x8DB0, 0xB733, 0x8DB1, + 0xB734, 0x8DB2, 0xB735, 0x8DB3, 0xB736, 0x8DB4, 0xB737, 0x8DB5, 0xB738, 0xB6E4, 0xB739, 0xB6E5, 0xB73A, 0x8DB6, 0xB73B, 0xB6E6, + 0xB73C, 0x8DB7, 0xB73D, 0x8DB8, 0xB73E, 0x8DB9, 0xB73F, 0x8DBA, 0xB740, 0x8DBB, 0xB741, 0x8DBC, 0xB742, 0x8DBD, 0xB743, 0x8DBE, + 0xB744, 0xB6E7, 0xB745, 0x8DBF, 0xB746, 0x8DC0, 0xB747, 0x8DC1, 0xB748, 0xB6E8, 0xB749, 0x8DC2, 0xB74A, 0x8DC3, 0xB74B, 0x8DC4, + 0xB74C, 0xB6E9, 0xB74D, 0x8DC5, 0xB74E, 0x8DC6, 0xB74F, 0x8DC7, 0xB750, 0x8DC8, 0xB751, 0x8DC9, 0xB752, 0x8DCA, 0xB753, 0x8DCB, + 0xB754, 0xB6EA, 0xB755, 0xB6EB, 0xB756, 0x8DCC, 0xB757, 0x8DCD, 0xB758, 0x8DCE, 0xB759, 0x8DCF, 0xB75A, 0x8DD0, 0xB75B, 0x8DD1, + 0xB75C, 0x8DD2, 0xB75D, 0x8DD3, 0xB75E, 0x8DD4, 0xB75F, 0x8DD5, 0xB760, 0xB6EC, 0xB761, 0x8DD6, 0xB762, 0x8DD7, 0xB763, 0x8DD8, + 0xB764, 0xB6ED, 0xB765, 0x8DD9, 0xB766, 0x8DDA, 0xB767, 0x8DDB, 0xB768, 0xB6EE, 0xB769, 0x8DDC, 0xB76A, 0x8DDD, 0xB76B, 0x8DDE, + 0xB76C, 0x8DDF, 0xB76D, 0x8DE0, 0xB76E, 0x8DE1, 0xB76F, 0x8DE2, 0xB770, 0xB6EF, 0xB771, 0xB6F0, 0xB772, 0x8DE3, 0xB773, 0xB6F1, + 0xB774, 0x8DE4, 0xB775, 0xB6F2, 0xB776, 0x8DE5, 0xB777, 0x8DE6, 0xB778, 0x8DE7, 0xB779, 0x8DE8, 0xB77A, 0x8DE9, 0xB77B, 0x8DEA, + 0xB77C, 0xB6F3, 0xB77D, 0xB6F4, 0xB77E, 0x8DEB, 0xB77F, 0x8DEC, 0xB780, 0xB6F5, 0xB781, 0x8DED, 0xB782, 0x8DEE, 0xB783, 0x8DEF, + 0xB784, 0xB6F6, 0xB785, 0x8DF0, 0xB786, 0x8DF1, 0xB787, 0x8DF2, 0xB788, 0x8DF3, 0xB789, 0x8DF4, 0xB78A, 0x8DF5, 0xB78B, 0x8DF6, + 0xB78C, 0xB6F7, 0xB78D, 0xB6F8, 0xB78E, 0x8DF7, 0xB78F, 0xB6F9, 0xB790, 0xB6FA, 0xB791, 0xB6FB, 0xB792, 0xB6FC, 0xB793, 0x8DF8, + 0xB794, 0x8DF9, 0xB795, 0x8DFA, 0xB796, 0xB6FD, 0xB797, 0xB6FE, 0xB798, 0xB7A1, 0xB799, 0xB7A2, 0xB79A, 0x8DFB, 0xB79B, 0x8DFC, + 0xB79C, 0xB7A3, 0xB79D, 0x8DFD, 0xB79E, 0x8DFE, 0xB79F, 0x8E41, 0xB7A0, 0xB7A4, 0xB7A1, 0x8E42, 0xB7A2, 0x8E43, 0xB7A3, 0x8E44, + 0xB7A4, 0x8E45, 0xB7A5, 0x8E46, 0xB7A6, 0x8E47, 0xB7A7, 0x8E48, 0xB7A8, 0xB7A5, 0xB7A9, 0xB7A6, 0xB7AA, 0x8E49, 0xB7AB, 0xB7A7, + 0xB7AC, 0xB7A8, 0xB7AD, 0xB7A9, 0xB7AE, 0x8E4A, 0xB7AF, 0x8E4B, 0xB7B0, 0x8E4C, 0xB7B1, 0x8E4D, 0xB7B2, 0x8E4E, 0xB7B3, 0x8E4F, + 0xB7B4, 0xB7AA, 0xB7B5, 0xB7AB, 0xB7B6, 0x8E50, 0xB7B7, 0x8E51, 0xB7B8, 0xB7AC, 0xB7B9, 0x8E52, 0xB7BA, 0x8E53, 0xB7BB, 0x8E54, + 0xB7BC, 0x8E55, 0xB7BD, 0x8E56, 0xB7BE, 0x8E57, 0xB7BF, 0x8E58, 0xB7C0, 0x8E59, 0xB7C1, 0x8E5A, 0xB7C2, 0x8E61, 0xB7C3, 0x8E62, + 0xB7C4, 0x8E63, 0xB7C5, 0x8E64, 0xB7C6, 0x8E65, 0xB7C7, 0xB7AD, 0xB7C8, 0x8E66, 0xB7C9, 0xB7AE, 0xB7CA, 0x8E67, 0xB7CB, 0x8E68, + 0xB7CC, 0x8E69, 0xB7CD, 0x8E6A, 0xB7CE, 0x8E6B, 0xB7CF, 0x8E6C, 0xB7D0, 0x8E6D, 0xB7D1, 0x8E6E, 0xB7D2, 0x8E6F, 0xB7D3, 0x8E70, + 0xB7D4, 0x8E71, 0xB7D5, 0x8E72, 0xB7D6, 0x8E73, 0xB7D7, 0x8E74, 0xB7D8, 0x8E75, 0xB7D9, 0x8E76, 0xB7DA, 0x8E77, 0xB7DB, 0x8E78, + 0xB7DC, 0x8E79, 0xB7DD, 0x8E7A, 0xB7DE, 0x8E81, 0xB7DF, 0x8E82, 0xB7E0, 0x8E83, 0xB7E1, 0x8E84, 0xB7E2, 0x8E85, 0xB7E3, 0x8E86, + 0xB7E4, 0x8E87, 0xB7E5, 0x8E88, 0xB7E6, 0x8E89, 0xB7E7, 0x8E8A, 0xB7E8, 0x8E8B, 0xB7E9, 0x8E8C, 0xB7EA, 0x8E8D, 0xB7EB, 0x8E8E, + 0xB7EC, 0xB7AF, 0xB7ED, 0xB7B0, 0xB7EE, 0x8E8F, 0xB7EF, 0x8E90, 0xB7F0, 0xB7B1, 0xB7F1, 0x8E91, 0xB7F2, 0x8E92, 0xB7F3, 0x8E93, + 0xB7F4, 0xB7B2, 0xB7F5, 0x8E94, 0xB7F6, 0x8E95, 0xB7F7, 0x8E96, 0xB7F8, 0x8E97, 0xB7F9, 0x8E98, 0xB7FA, 0x8E99, 0xB7FB, 0x8E9A, + 0xB7FC, 0xB7B3, 0xB7FD, 0xB7B4, 0xB7FE, 0x8E9B, 0xB7FF, 0xB7B5, 0xB800, 0xB7B6, 0xB801, 0xB7B7, 0xB802, 0x8E9C, 0xB803, 0x8E9D, + 0xB804, 0x8E9E, 0xB805, 0x8E9F, 0xB806, 0x8EA0, 0xB807, 0xB7B8, 0xB808, 0xB7B9, 0xB809, 0xB7BA, 0xB80A, 0x8EA1, 0xB80B, 0x8EA2, + 0xB80C, 0xB7BB, 0xB80D, 0x8EA3, 0xB80E, 0x8EA4, 0xB80F, 0x8EA5, 0xB810, 0xB7BC, 0xB811, 0x8EA6, 0xB812, 0x8EA7, 0xB813, 0x8EA8, + 0xB814, 0x8EA9, 0xB815, 0x8EAA, 0xB816, 0x8EAB, 0xB817, 0x8EAC, 0xB818, 0xB7BD, 0xB819, 0xB7BE, 0xB81A, 0x8EAD, 0xB81B, 0xB7BF, + 0xB81C, 0x8EAE, 0xB81D, 0xB7C0, 0xB81E, 0x8EAF, 0xB81F, 0x8EB0, 0xB820, 0x8EB1, 0xB821, 0x8EB2, 0xB822, 0x8EB3, 0xB823, 0x8EB4, + 0xB824, 0xB7C1, 0xB825, 0xB7C2, 0xB826, 0x8EB5, 0xB827, 0x8EB6, 0xB828, 0xB7C3, 0xB829, 0x8EB7, 0xB82A, 0x8EB8, 0xB82B, 0x8EB9, + 0xB82C, 0xB7C4, 0xB82D, 0x8EBA, 0xB82E, 0x8EBB, 0xB82F, 0x8EBC, 0xB830, 0x8EBD, 0xB831, 0x8EBE, 0xB832, 0x8EBF, 0xB833, 0x8EC0, + 0xB834, 0xB7C5, 0xB835, 0xB7C6, 0xB836, 0x8EC1, 0xB837, 0xB7C7, 0xB838, 0xB7C8, 0xB839, 0xB7C9, 0xB83A, 0x8EC2, 0xB83B, 0x8EC3, + 0xB83C, 0x8EC4, 0xB83D, 0x8EC5, 0xB83E, 0x8EC6, 0xB83F, 0x8EC7, 0xB840, 0xB7CA, 0xB841, 0x8EC8, 0xB842, 0x8EC9, 0xB843, 0x8ECA, + 0xB844, 0xB7CB, 0xB845, 0x8ECB, 0xB846, 0x8ECC, 0xB847, 0x8ECD, 0xB848, 0x8ECE, 0xB849, 0x8ECF, 0xB84A, 0x8ED0, 0xB84B, 0x8ED1, + 0xB84C, 0x8ED2, 0xB84D, 0x8ED3, 0xB84E, 0x8ED4, 0xB84F, 0x8ED5, 0xB850, 0x8ED6, 0xB851, 0xB7CC, 0xB852, 0x8ED7, 0xB853, 0xB7CD, + 0xB854, 0x8ED8, 0xB855, 0x8ED9, 0xB856, 0x8EDA, 0xB857, 0x8EDB, 0xB858, 0x8EDC, 0xB859, 0x8EDD, 0xB85A, 0x8EDE, 0xB85B, 0x8EDF, + 0xB85C, 0xB7CE, 0xB85D, 0xB7CF, 0xB85E, 0x8EE0, 0xB85F, 0x8EE1, 0xB860, 0xB7D0, 0xB861, 0x8EE2, 0xB862, 0x8EE3, 0xB863, 0x8EE4, + 0xB864, 0xB7D1, 0xB865, 0x8EE5, 0xB866, 0x8EE6, 0xB867, 0x8EE7, 0xB868, 0x8EE8, 0xB869, 0x8EE9, 0xB86A, 0x8EEA, 0xB86B, 0x8EEB, + 0xB86C, 0xB7D2, 0xB86D, 0xB7D3, 0xB86E, 0x8EEC, 0xB86F, 0xB7D4, 0xB870, 0x8EED, 0xB871, 0xB7D5, 0xB872, 0x8EEE, 0xB873, 0x8EEF, + 0xB874, 0x8EF0, 0xB875, 0x8EF1, 0xB876, 0x8EF2, 0xB877, 0x8EF3, 0xB878, 0xB7D6, 0xB879, 0x8EF4, 0xB87A, 0x8EF5, 0xB87B, 0x8EF6, + 0xB87C, 0xB7D7, 0xB87D, 0x8EF7, 0xB87E, 0x8EF8, 0xB87F, 0x8EF9, 0xB880, 0x8EFA, 0xB881, 0x8EFB, 0xB882, 0x8EFC, 0xB883, 0x8EFD, + 0xB884, 0x8EFE, 0xB885, 0x8F41, 0xB886, 0x8F42, 0xB887, 0x8F43, 0xB888, 0x8F44, 0xB889, 0x8F45, 0xB88A, 0x8F46, 0xB88B, 0x8F47, + 0xB88C, 0x8F48, 0xB88D, 0xB7D8, 0xB88E, 0x8F49, 0xB88F, 0x8F4A, 0xB890, 0x8F4B, 0xB891, 0x8F4C, 0xB892, 0x8F4D, 0xB893, 0x8F4E, + 0xB894, 0x8F4F, 0xB895, 0x8F50, 0xB896, 0x8F51, 0xB897, 0x8F52, 0xB898, 0x8F53, 0xB899, 0x8F54, 0xB89A, 0x8F55, 0xB89B, 0x8F56, + 0xB89C, 0x8F57, 0xB89D, 0x8F58, 0xB89E, 0x8F59, 0xB89F, 0x8F5A, 0xB8A0, 0x8F61, 0xB8A1, 0x8F62, 0xB8A2, 0x8F63, 0xB8A3, 0x8F64, + 0xB8A4, 0x8F65, 0xB8A5, 0x8F66, 0xB8A6, 0x8F67, 0xB8A7, 0x8F68, 0xB8A8, 0xB7D9, 0xB8A9, 0x8F69, 0xB8AA, 0x8F6A, 0xB8AB, 0x8F6B, + 0xB8AC, 0x8F6C, 0xB8AD, 0x8F6D, 0xB8AE, 0x8F6E, 0xB8AF, 0x8F6F, 0xB8B0, 0xB7DA, 0xB8B1, 0x8F70, 0xB8B2, 0x8F71, 0xB8B3, 0x8F72, + 0xB8B4, 0xB7DB, 0xB8B5, 0x8F73, 0xB8B6, 0x8F74, 0xB8B7, 0x8F75, 0xB8B8, 0xB7DC, 0xB8B9, 0x8F76, 0xB8BA, 0x8F77, 0xB8BB, 0x8F78, + 0xB8BC, 0x8F79, 0xB8BD, 0x8F7A, 0xB8BE, 0x8F81, 0xB8BF, 0x8F82, 0xB8C0, 0xB7DD, 0xB8C1, 0xB7DE, 0xB8C2, 0x8F83, 0xB8C3, 0xB7DF, + 0xB8C4, 0x8F84, 0xB8C5, 0xB7E0, 0xB8C6, 0x8F85, 0xB8C7, 0x8F86, 0xB8C8, 0x8F87, 0xB8C9, 0x8F88, 0xB8CA, 0x8F89, 0xB8CB, 0x8F8A, + 0xB8CC, 0xB7E1, 0xB8CD, 0x8F8B, 0xB8CE, 0x8F8C, 0xB8CF, 0x8F8D, 0xB8D0, 0xB7E2, 0xB8D1, 0x8F8E, 0xB8D2, 0x8F8F, 0xB8D3, 0x8F90, + 0xB8D4, 0xB7E3, 0xB8D5, 0x8F91, 0xB8D6, 0x8F92, 0xB8D7, 0x8F93, 0xB8D8, 0x8F94, 0xB8D9, 0x8F95, 0xB8DA, 0x8F96, 0xB8DB, 0x8F97, + 0xB8DC, 0x8F98, 0xB8DD, 0xB7E4, 0xB8DE, 0x8F99, 0xB8DF, 0xB7E5, 0xB8E0, 0x8F9A, 0xB8E1, 0xB7E6, 0xB8E2, 0x8F9B, 0xB8E3, 0x8F9C, + 0xB8E4, 0x8F9D, 0xB8E5, 0x8F9E, 0xB8E6, 0x8F9F, 0xB8E7, 0x8FA0, 0xB8E8, 0xB7E7, 0xB8E9, 0xB7E8, 0xB8EA, 0x8FA1, 0xB8EB, 0x8FA2, + 0xB8EC, 0xB7E9, 0xB8ED, 0x8FA3, 0xB8EE, 0x8FA4, 0xB8EF, 0x8FA5, 0xB8F0, 0xB7EA, 0xB8F1, 0x8FA6, 0xB8F2, 0x8FA7, 0xB8F3, 0x8FA8, + 0xB8F4, 0x8FA9, 0xB8F5, 0x8FAA, 0xB8F6, 0x8FAB, 0xB8F7, 0x8FAC, 0xB8F8, 0xB7EB, 0xB8F9, 0xB7EC, 0xB8FA, 0x8FAD, 0xB8FB, 0xB7ED, + 0xB8FC, 0x8FAE, 0xB8FD, 0xB7EE, 0xB8FE, 0x8FAF, 0xB8FF, 0x8FB0, 0xB900, 0x8FB1, 0xB901, 0x8FB2, 0xB902, 0x8FB3, 0xB903, 0x8FB4, + 0xB904, 0xB7EF, 0xB905, 0x8FB5, 0xB906, 0x8FB6, 0xB907, 0x8FB7, 0xB908, 0x8FB8, 0xB909, 0x8FB9, 0xB90A, 0x8FBA, 0xB90B, 0x8FBB, + 0xB90C, 0x8FBC, 0xB90D, 0x8FBD, 0xB90E, 0x8FBE, 0xB90F, 0x8FBF, 0xB910, 0x8FC0, 0xB911, 0x8FC1, 0xB912, 0x8FC2, 0xB913, 0x8FC3, + 0xB914, 0x8FC4, 0xB915, 0x8FC5, 0xB916, 0x8FC6, 0xB917, 0x8FC7, 0xB918, 0xB7F0, 0xB919, 0x8FC8, 0xB91A, 0x8FC9, 0xB91B, 0x8FCA, + 0xB91C, 0x8FCB, 0xB91D, 0x8FCC, 0xB91E, 0x8FCD, 0xB91F, 0x8FCE, 0xB920, 0xB7F1, 0xB921, 0x8FCF, 0xB922, 0x8FD0, 0xB923, 0x8FD1, + 0xB924, 0x8FD2, 0xB925, 0x8FD3, 0xB926, 0x8FD4, 0xB927, 0x8FD5, 0xB928, 0x8FD6, 0xB929, 0x8FD7, 0xB92A, 0x8FD8, 0xB92B, 0x8FD9, + 0xB92C, 0x8FDA, 0xB92D, 0x8FDB, 0xB92E, 0x8FDC, 0xB92F, 0x8FDD, 0xB930, 0x8FDE, 0xB931, 0x8FDF, 0xB932, 0x8FE0, 0xB933, 0x8FE1, + 0xB934, 0x8FE2, 0xB935, 0x8FE3, 0xB936, 0x8FE4, 0xB937, 0x8FE5, 0xB938, 0x8FE6, 0xB939, 0x8FE7, 0xB93A, 0x8FE8, 0xB93B, 0x8FE9, + 0xB93C, 0xB7F2, 0xB93D, 0xB7F3, 0xB93E, 0x8FEA, 0xB93F, 0x8FEB, 0xB940, 0xB7F4, 0xB941, 0x8FEC, 0xB942, 0x8FED, 0xB943, 0x8FEE, + 0xB944, 0xB7F5, 0xB945, 0x8FEF, 0xB946, 0x8FF0, 0xB947, 0x8FF1, 0xB948, 0x8FF2, 0xB949, 0x8FF3, 0xB94A, 0x8FF4, 0xB94B, 0x8FF5, + 0xB94C, 0xB7F6, 0xB94D, 0x8FF6, 0xB94E, 0x8FF7, 0xB94F, 0xB7F7, 0xB950, 0x8FF8, 0xB951, 0xB7F8, 0xB952, 0x8FF9, 0xB953, 0x8FFA, + 0xB954, 0x8FFB, 0xB955, 0x8FFC, 0xB956, 0x8FFD, 0xB957, 0x8FFE, 0xB958, 0xB7F9, 0xB959, 0xB7FA, 0xB95A, 0x9041, 0xB95B, 0x9042, + 0xB95C, 0xB7FB, 0xB95D, 0x9043, 0xB95E, 0x9044, 0xB95F, 0x9045, 0xB960, 0xB7FC, 0xB961, 0x9046, 0xB962, 0x9047, 0xB963, 0x9048, + 0xB964, 0x9049, 0xB965, 0x904A, 0xB966, 0x904B, 0xB967, 0x904C, 0xB968, 0xB7FD, 0xB969, 0xB7FE, 0xB96A, 0x904D, 0xB96B, 0xB8A1, + 0xB96C, 0x904E, 0xB96D, 0xB8A2, 0xB96E, 0x904F, 0xB96F, 0x9050, 0xB970, 0x9051, 0xB971, 0x9052, 0xB972, 0x9053, 0xB973, 0x9054, + 0xB974, 0xB8A3, 0xB975, 0xB8A4, 0xB976, 0x9055, 0xB977, 0x9056, 0xB978, 0xB8A5, 0xB979, 0x9057, 0xB97A, 0x9058, 0xB97B, 0x9059, + 0xB97C, 0xB8A6, 0xB97D, 0x905A, 0xB97E, 0x9061, 0xB97F, 0x9062, 0xB980, 0x9063, 0xB981, 0x9064, 0xB982, 0x9065, 0xB983, 0x9066, + 0xB984, 0xB8A7, 0xB985, 0xB8A8, 0xB986, 0x9067, 0xB987, 0xB8A9, 0xB988, 0x9068, 0xB989, 0xB8AA, 0xB98A, 0xB8AB, 0xB98B, 0x9069, + 0xB98C, 0x906A, 0xB98D, 0xB8AC, 0xB98E, 0xB8AD, 0xB98F, 0x906B, 0xB990, 0x906C, 0xB991, 0x906D, 0xB992, 0x906E, 0xB993, 0x906F, + 0xB994, 0x9070, 0xB995, 0x9071, 0xB996, 0x9072, 0xB997, 0x9073, 0xB998, 0x9074, 0xB999, 0x9075, 0xB99A, 0x9076, 0xB99B, 0x9077, + 0xB99C, 0x9078, 0xB99D, 0x9079, 0xB99E, 0x907A, 0xB99F, 0x9081, 0xB9A0, 0x9082, 0xB9A1, 0x9083, 0xB9A2, 0x9084, 0xB9A3, 0x9085, + 0xB9A4, 0x9086, 0xB9A5, 0x9087, 0xB9A6, 0x9088, 0xB9A7, 0x9089, 0xB9A8, 0x908A, 0xB9A9, 0x908B, 0xB9AA, 0x908C, 0xB9AB, 0x908D, + 0xB9AC, 0xB8AE, 0xB9AD, 0xB8AF, 0xB9AE, 0x908E, 0xB9AF, 0x908F, 0xB9B0, 0xB8B0, 0xB9B1, 0x9090, 0xB9B2, 0x9091, 0xB9B3, 0x9092, + 0xB9B4, 0xB8B1, 0xB9B5, 0x9093, 0xB9B6, 0x9094, 0xB9B7, 0x9095, 0xB9B8, 0x9096, 0xB9B9, 0x9097, 0xB9BA, 0x9098, 0xB9BB, 0x9099, + 0xB9BC, 0xB8B2, 0xB9BD, 0xB8B3, 0xB9BE, 0x909A, 0xB9BF, 0xB8B4, 0xB9C0, 0x909B, 0xB9C1, 0xB8B5, 0xB9C2, 0x909C, 0xB9C3, 0x909D, + 0xB9C4, 0x909E, 0xB9C5, 0x909F, 0xB9C6, 0x90A0, 0xB9C7, 0x90A1, 0xB9C8, 0xB8B6, 0xB9C9, 0xB8B7, 0xB9CA, 0x90A2, 0xB9CB, 0x90A3, + 0xB9CC, 0xB8B8, 0xB9CD, 0x90A4, 0xB9CE, 0xB8B9, 0xB9CF, 0xB8BA, 0xB9D0, 0xB8BB, 0xB9D1, 0xB8BC, 0xB9D2, 0xB8BD, 0xB9D3, 0x90A5, + 0xB9D4, 0x90A6, 0xB9D5, 0x90A7, 0xB9D6, 0x90A8, 0xB9D7, 0x90A9, 0xB9D8, 0xB8BE, 0xB9D9, 0xB8BF, 0xB9DA, 0x90AA, 0xB9DB, 0xB8C0, + 0xB9DC, 0x90AB, 0xB9DD, 0xB8C1, 0xB9DE, 0xB8C2, 0xB9DF, 0x90AC, 0xB9E0, 0x90AD, 0xB9E1, 0xB8C3, 0xB9E2, 0x90AE, 0xB9E3, 0xB8C4, + 0xB9E4, 0xB8C5, 0xB9E5, 0xB8C6, 0xB9E6, 0x90AF, 0xB9E7, 0x90B0, 0xB9E8, 0xB8C7, 0xB9E9, 0x90B1, 0xB9EA, 0x90B2, 0xB9EB, 0x90B3, + 0xB9EC, 0xB8C8, 0xB9ED, 0x90B4, 0xB9EE, 0x90B5, 0xB9EF, 0x90B6, 0xB9F0, 0x90B7, 0xB9F1, 0x90B8, 0xB9F2, 0x90B9, 0xB9F3, 0x90BA, + 0xB9F4, 0xB8C9, 0xB9F5, 0xB8CA, 0xB9F6, 0x90BB, 0xB9F7, 0xB8CB, 0xB9F8, 0xB8CC, 0xB9F9, 0xB8CD, 0xB9FA, 0xB8CE, 0xB9FB, 0x90BC, + 0xB9FC, 0x90BD, 0xB9FD, 0x90BE, 0xB9FE, 0x90BF, 0xB9FF, 0x90C0, 0xBA00, 0xB8CF, 0xBA01, 0xB8D0, 0xBA02, 0x90C1, 0xBA03, 0x90C2, + 0xBA04, 0x90C3, 0xBA05, 0x90C4, 0xBA06, 0x90C5, 0xBA07, 0x90C6, 0xBA08, 0xB8D1, 0xBA09, 0x90C7, 0xBA0A, 0x90C8, 0xBA0B, 0x90C9, + 0xBA0C, 0x90CA, 0xBA0D, 0x90CB, 0xBA0E, 0x90CC, 0xBA0F, 0x90CD, 0xBA10, 0x90CE, 0xBA11, 0x90CF, 0xBA12, 0x90D0, 0xBA13, 0x90D1, + 0xBA14, 0x90D2, 0xBA15, 0xB8D2, 0xBA16, 0x90D3, 0xBA17, 0x90D4, 0xBA18, 0x90D5, 0xBA19, 0x90D6, 0xBA1A, 0x90D7, 0xBA1B, 0x90D8, + 0xBA1C, 0x90D9, 0xBA1D, 0x90DA, 0xBA1E, 0x90DB, 0xBA1F, 0x90DC, 0xBA20, 0x90DD, 0xBA21, 0x90DE, 0xBA22, 0x90DF, 0xBA23, 0x90E0, + 0xBA24, 0x90E1, 0xBA25, 0x90E2, 0xBA26, 0x90E3, 0xBA27, 0x90E4, 0xBA28, 0x90E5, 0xBA29, 0x90E6, 0xBA2A, 0x90E7, 0xBA2B, 0x90E8, + 0xBA2C, 0x90E9, 0xBA2D, 0x90EA, 0xBA2E, 0x90EB, 0xBA2F, 0x90EC, 0xBA30, 0x90ED, 0xBA31, 0x90EE, 0xBA32, 0x90EF, 0xBA33, 0x90F0, + 0xBA34, 0x90F1, 0xBA35, 0x90F2, 0xBA36, 0x90F3, 0xBA37, 0x90F4, 0xBA38, 0xB8D3, 0xBA39, 0xB8D4, 0xBA3A, 0x90F5, 0xBA3B, 0x90F6, + 0xBA3C, 0xB8D5, 0xBA3D, 0x90F7, 0xBA3E, 0x90F8, 0xBA3F, 0x90F9, 0xBA40, 0xB8D6, 0xBA41, 0x90FA, 0xBA42, 0xB8D7, 0xBA43, 0x90FB, + 0xBA44, 0x90FC, 0xBA45, 0x90FD, 0xBA46, 0x90FE, 0xBA47, 0x9141, 0xBA48, 0xB8D8, 0xBA49, 0xB8D9, 0xBA4A, 0x9142, 0xBA4B, 0xB8DA, + 0xBA4C, 0x9143, 0xBA4D, 0xB8DB, 0xBA4E, 0xB8DC, 0xBA4F, 0x9144, 0xBA50, 0x9145, 0xBA51, 0x9146, 0xBA52, 0x9147, 0xBA53, 0xB8DD, + 0xBA54, 0xB8DE, 0xBA55, 0xB8DF, 0xBA56, 0x9148, 0xBA57, 0x9149, 0xBA58, 0xB8E0, 0xBA59, 0x914A, 0xBA5A, 0x914B, 0xBA5B, 0x914C, + 0xBA5C, 0xB8E1, 0xBA5D, 0x914D, 0xBA5E, 0x914E, 0xBA5F, 0x914F, 0xBA60, 0x9150, 0xBA61, 0x9151, 0xBA62, 0x9152, 0xBA63, 0x9153, + 0xBA64, 0xB8E2, 0xBA65, 0xB8E3, 0xBA66, 0x9154, 0xBA67, 0xB8E4, 0xBA68, 0xB8E5, 0xBA69, 0xB8E6, 0xBA6A, 0x9155, 0xBA6B, 0x9156, + 0xBA6C, 0x9157, 0xBA6D, 0x9158, 0xBA6E, 0x9159, 0xBA6F, 0x915A, 0xBA70, 0xB8E7, 0xBA71, 0xB8E8, 0xBA72, 0x9161, 0xBA73, 0x9162, + 0xBA74, 0xB8E9, 0xBA75, 0x9163, 0xBA76, 0x9164, 0xBA77, 0x9165, 0xBA78, 0xB8EA, 0xBA79, 0x9166, 0xBA7A, 0x9167, 0xBA7B, 0x9168, + 0xBA7C, 0x9169, 0xBA7D, 0x916A, 0xBA7E, 0x916B, 0xBA7F, 0x916C, 0xBA80, 0x916D, 0xBA81, 0x916E, 0xBA82, 0x916F, 0xBA83, 0xB8EB, + 0xBA84, 0xB8EC, 0xBA85, 0xB8ED, 0xBA86, 0x9170, 0xBA87, 0xB8EE, 0xBA88, 0x9171, 0xBA89, 0x9172, 0xBA8A, 0x9173, 0xBA8B, 0x9174, + 0xBA8C, 0xB8EF, 0xBA8D, 0x9175, 0xBA8E, 0x9176, 0xBA8F, 0x9177, 0xBA90, 0x9178, 0xBA91, 0x9179, 0xBA92, 0x917A, 0xBA93, 0x9181, + 0xBA94, 0x9182, 0xBA95, 0x9183, 0xBA96, 0x9184, 0xBA97, 0x9185, 0xBA98, 0x9186, 0xBA99, 0x9187, 0xBA9A, 0x9188, 0xBA9B, 0x9189, + 0xBA9C, 0x918A, 0xBA9D, 0x918B, 0xBA9E, 0x918C, 0xBA9F, 0x918D, 0xBAA0, 0x918E, 0xBAA1, 0x918F, 0xBAA2, 0x9190, 0xBAA3, 0x9191, + 0xBAA4, 0x9192, 0xBAA5, 0x9193, 0xBAA6, 0x9194, 0xBAA7, 0x9195, 0xBAA8, 0xB8F0, 0xBAA9, 0xB8F1, 0xBAAA, 0x9196, 0xBAAB, 0xB8F2, + 0xBAAC, 0xB8F3, 0xBAAD, 0x9197, 0xBAAE, 0x9198, 0xBAAF, 0x9199, 0xBAB0, 0xB8F4, 0xBAB1, 0x919A, 0xBAB2, 0xB8F5, 0xBAB3, 0x919B, + 0xBAB4, 0x919C, 0xBAB5, 0x919D, 0xBAB6, 0x919E, 0xBAB7, 0x919F, 0xBAB8, 0xB8F6, 0xBAB9, 0xB8F7, 0xBABA, 0x91A0, 0xBABB, 0xB8F8, + 0xBABC, 0x91A1, 0xBABD, 0xB8F9, 0xBABE, 0x91A2, 0xBABF, 0x91A3, 0xBAC0, 0x91A4, 0xBAC1, 0x91A5, 0xBAC2, 0x91A6, 0xBAC3, 0x91A7, + 0xBAC4, 0xB8FA, 0xBAC5, 0x91A8, 0xBAC6, 0x91A9, 0xBAC7, 0x91AA, 0xBAC8, 0xB8FB, 0xBAC9, 0x91AB, 0xBACA, 0x91AC, 0xBACB, 0x91AD, + 0xBACC, 0x91AE, 0xBACD, 0x91AF, 0xBACE, 0x91B0, 0xBACF, 0x91B1, 0xBAD0, 0x91B2, 0xBAD1, 0x91B3, 0xBAD2, 0x91B4, 0xBAD3, 0x91B5, + 0xBAD4, 0x91B6, 0xBAD5, 0x91B7, 0xBAD6, 0x91B8, 0xBAD7, 0x91B9, 0xBAD8, 0xB8FC, 0xBAD9, 0xB8FD, 0xBADA, 0x91BA, 0xBADB, 0x91BB, + 0xBADC, 0x91BC, 0xBADD, 0x91BD, 0xBADE, 0x91BE, 0xBADF, 0x91BF, 0xBAE0, 0x91C0, 0xBAE1, 0x91C1, 0xBAE2, 0x91C2, 0xBAE3, 0x91C3, + 0xBAE4, 0x91C4, 0xBAE5, 0x91C5, 0xBAE6, 0x91C6, 0xBAE7, 0x91C7, 0xBAE8, 0x91C8, 0xBAE9, 0x91C9, 0xBAEA, 0x91CA, 0xBAEB, 0x91CB, + 0xBAEC, 0x91CC, 0xBAED, 0x91CD, 0xBAEE, 0x91CE, 0xBAEF, 0x91CF, 0xBAF0, 0x91D0, 0xBAF1, 0x91D1, 0xBAF2, 0x91D2, 0xBAF3, 0x91D3, + 0xBAF4, 0x91D4, 0xBAF5, 0x91D5, 0xBAF6, 0x91D6, 0xBAF7, 0x91D7, 0xBAF8, 0x91D8, 0xBAF9, 0x91D9, 0xBAFA, 0x91DA, 0xBAFB, 0x91DB, + 0xBAFC, 0xB8FE, 0xBAFD, 0x91DC, 0xBAFE, 0x91DD, 0xBAFF, 0x91DE, 0xBB00, 0xB9A1, 0xBB01, 0x91DF, 0xBB02, 0x91E0, 0xBB03, 0x91E1, + 0xBB04, 0xB9A2, 0xBB05, 0x91E2, 0xBB06, 0x91E3, 0xBB07, 0x91E4, 0xBB08, 0x91E5, 0xBB09, 0x91E6, 0xBB0A, 0x91E7, 0xBB0B, 0x91E8, + 0xBB0C, 0x91E9, 0xBB0D, 0xB9A3, 0xBB0E, 0x91EA, 0xBB0F, 0xB9A4, 0xBB10, 0x91EB, 0xBB11, 0xB9A5, 0xBB12, 0x91EC, 0xBB13, 0x91ED, + 0xBB14, 0x91EE, 0xBB15, 0x91EF, 0xBB16, 0x91F0, 0xBB17, 0x91F1, 0xBB18, 0xB9A6, 0xBB19, 0x91F2, 0xBB1A, 0x91F3, 0xBB1B, 0x91F4, + 0xBB1C, 0xB9A7, 0xBB1D, 0x91F5, 0xBB1E, 0x91F6, 0xBB1F, 0x91F7, 0xBB20, 0xB9A8, 0xBB21, 0x91F8, 0xBB22, 0x91F9, 0xBB23, 0x91FA, + 0xBB24, 0x91FB, 0xBB25, 0x91FC, 0xBB26, 0x91FD, 0xBB27, 0x91FE, 0xBB28, 0x9241, 0xBB29, 0xB9A9, 0xBB2A, 0x9242, 0xBB2B, 0xB9AA, + 0xBB2C, 0x9243, 0xBB2D, 0x9244, 0xBB2E, 0x9245, 0xBB2F, 0x9246, 0xBB30, 0x9247, 0xBB31, 0x9248, 0xBB32, 0x9249, 0xBB33, 0x924A, + 0xBB34, 0xB9AB, 0xBB35, 0xB9AC, 0xBB36, 0xB9AD, 0xBB37, 0x924B, 0xBB38, 0xB9AE, 0xBB39, 0x924C, 0xBB3A, 0x924D, 0xBB3B, 0xB9AF, + 0xBB3C, 0xB9B0, 0xBB3D, 0xB9B1, 0xBB3E, 0xB9B2, 0xBB3F, 0x924E, 0xBB40, 0x924F, 0xBB41, 0x9250, 0xBB42, 0x9251, 0xBB43, 0x9252, + 0xBB44, 0xB9B3, 0xBB45, 0xB9B4, 0xBB46, 0x9253, 0xBB47, 0xB9B5, 0xBB48, 0x9254, 0xBB49, 0xB9B6, 0xBB4A, 0x9255, 0xBB4B, 0x9256, + 0xBB4C, 0x9257, 0xBB4D, 0xB9B7, 0xBB4E, 0x9258, 0xBB4F, 0xB9B8, 0xBB50, 0xB9B9, 0xBB51, 0x9259, 0xBB52, 0x925A, 0xBB53, 0x9261, + 0xBB54, 0xB9BA, 0xBB55, 0x9262, 0xBB56, 0x9263, 0xBB57, 0x9264, 0xBB58, 0xB9BB, 0xBB59, 0x9265, 0xBB5A, 0x9266, 0xBB5B, 0x9267, + 0xBB5C, 0x9268, 0xBB5D, 0x9269, 0xBB5E, 0x926A, 0xBB5F, 0x926B, 0xBB60, 0x926C, 0xBB61, 0xB9BC, 0xBB62, 0x926D, 0xBB63, 0xB9BD, + 0xBB64, 0x926E, 0xBB65, 0x926F, 0xBB66, 0x9270, 0xBB67, 0x9271, 0xBB68, 0x9272, 0xBB69, 0x9273, 0xBB6A, 0x9274, 0xBB6B, 0x9275, + 0xBB6C, 0xB9BE, 0xBB6D, 0x9276, 0xBB6E, 0x9277, 0xBB6F, 0x9278, 0xBB70, 0x9279, 0xBB71, 0x927A, 0xBB72, 0x9281, 0xBB73, 0x9282, + 0xBB74, 0x9283, 0xBB75, 0x9284, 0xBB76, 0x9285, 0xBB77, 0x9286, 0xBB78, 0x9287, 0xBB79, 0x9288, 0xBB7A, 0x9289, 0xBB7B, 0x928A, + 0xBB7C, 0x928B, 0xBB7D, 0x928C, 0xBB7E, 0x928D, 0xBB7F, 0x928E, 0xBB80, 0x928F, 0xBB81, 0x9290, 0xBB82, 0x9291, 0xBB83, 0x9292, + 0xBB84, 0x9293, 0xBB85, 0x9294, 0xBB86, 0x9295, 0xBB87, 0x9296, 0xBB88, 0xB9BF, 0xBB89, 0x9297, 0xBB8A, 0x9298, 0xBB8B, 0x9299, + 0xBB8C, 0xB9C0, 0xBB8D, 0x929A, 0xBB8E, 0x929B, 0xBB8F, 0x929C, 0xBB90, 0xB9C1, 0xBB91, 0x929D, 0xBB92, 0x929E, 0xBB93, 0x929F, + 0xBB94, 0x92A0, 0xBB95, 0x92A1, 0xBB96, 0x92A2, 0xBB97, 0x92A3, 0xBB98, 0x92A4, 0xBB99, 0x92A5, 0xBB9A, 0x92A6, 0xBB9B, 0x92A7, + 0xBB9C, 0x92A8, 0xBB9D, 0x92A9, 0xBB9E, 0x92AA, 0xBB9F, 0x92AB, 0xBBA0, 0x92AC, 0xBBA1, 0x92AD, 0xBBA2, 0x92AE, 0xBBA3, 0x92AF, + 0xBBA4, 0xB9C2, 0xBBA5, 0x92B0, 0xBBA6, 0x92B1, 0xBBA7, 0x92B2, 0xBBA8, 0xB9C3, 0xBBA9, 0x92B3, 0xBBAA, 0x92B4, 0xBBAB, 0x92B5, + 0xBBAC, 0xB9C4, 0xBBAD, 0x92B6, 0xBBAE, 0x92B7, 0xBBAF, 0x92B8, 0xBBB0, 0x92B9, 0xBBB1, 0x92BA, 0xBBB2, 0x92BB, 0xBBB3, 0x92BC, + 0xBBB4, 0xB9C5, 0xBBB5, 0x92BD, 0xBBB6, 0x92BE, 0xBBB7, 0xB9C6, 0xBBB8, 0x92BF, 0xBBB9, 0x92C0, 0xBBBA, 0x92C1, 0xBBBB, 0x92C2, + 0xBBBC, 0x92C3, 0xBBBD, 0x92C4, 0xBBBE, 0x92C5, 0xBBBF, 0x92C6, 0xBBC0, 0xB9C7, 0xBBC1, 0x92C7, 0xBBC2, 0x92C8, 0xBBC3, 0x92C9, + 0xBBC4, 0xB9C8, 0xBBC5, 0x92CA, 0xBBC6, 0x92CB, 0xBBC7, 0x92CC, 0xBBC8, 0xB9C9, 0xBBC9, 0x92CD, 0xBBCA, 0x92CE, 0xBBCB, 0x92CF, + 0xBBCC, 0x92D0, 0xBBCD, 0x92D1, 0xBBCE, 0x92D2, 0xBBCF, 0x92D3, 0xBBD0, 0xB9CA, 0xBBD1, 0x92D4, 0xBBD2, 0x92D5, 0xBBD3, 0xB9CB, + 0xBBD4, 0x92D6, 0xBBD5, 0x92D7, 0xBBD6, 0x92D8, 0xBBD7, 0x92D9, 0xBBD8, 0x92DA, 0xBBD9, 0x92DB, 0xBBDA, 0x92DC, 0xBBDB, 0x92DD, + 0xBBDC, 0x92DE, 0xBBDD, 0x92DF, 0xBBDE, 0x92E0, 0xBBDF, 0x92E1, 0xBBE0, 0x92E2, 0xBBE1, 0x92E3, 0xBBE2, 0x92E4, 0xBBE3, 0x92E5, + 0xBBE4, 0x92E6, 0xBBE5, 0x92E7, 0xBBE6, 0x92E8, 0xBBE7, 0x92E9, 0xBBE8, 0x92EA, 0xBBE9, 0x92EB, 0xBBEA, 0x92EC, 0xBBEB, 0x92ED, + 0xBBEC, 0x92EE, 0xBBED, 0x92EF, 0xBBEE, 0x92F0, 0xBBEF, 0x92F1, 0xBBF0, 0x92F2, 0xBBF1, 0x92F3, 0xBBF2, 0x92F4, 0xBBF3, 0x92F5, + 0xBBF4, 0x92F6, 0xBBF5, 0x92F7, 0xBBF6, 0x92F8, 0xBBF7, 0x92F9, 0xBBF8, 0xB9CC, 0xBBF9, 0xB9CD, 0xBBFA, 0x92FA, 0xBBFB, 0x92FB, + 0xBBFC, 0xB9CE, 0xBBFD, 0x92FC, 0xBBFE, 0x92FD, 0xBBFF, 0xB9CF, 0xBC00, 0xB9D0, 0xBC01, 0x92FE, 0xBC02, 0xB9D1, 0xBC03, 0x9341, + 0xBC04, 0x9342, 0xBC05, 0x9343, 0xBC06, 0x9344, 0xBC07, 0x9345, 0xBC08, 0xB9D2, 0xBC09, 0xB9D3, 0xBC0A, 0x9346, 0xBC0B, 0xB9D4, + 0xBC0C, 0xB9D5, 0xBC0D, 0xB9D6, 0xBC0E, 0x9347, 0xBC0F, 0xB9D7, 0xBC10, 0x9348, 0xBC11, 0xB9D8, 0xBC12, 0x9349, 0xBC13, 0x934A, + 0xBC14, 0xB9D9, 0xBC15, 0xB9DA, 0xBC16, 0xB9DB, 0xBC17, 0xB9DC, 0xBC18, 0xB9DD, 0xBC19, 0x934B, 0xBC1A, 0x934C, 0xBC1B, 0xB9DE, + 0xBC1C, 0xB9DF, 0xBC1D, 0xB9E0, 0xBC1E, 0xB9E1, 0xBC1F, 0xB9E2, 0xBC20, 0x934D, 0xBC21, 0x934E, 0xBC22, 0x934F, 0xBC23, 0x9350, + 0xBC24, 0xB9E3, 0xBC25, 0xB9E4, 0xBC26, 0x9351, 0xBC27, 0xB9E5, 0xBC28, 0x9352, 0xBC29, 0xB9E6, 0xBC2A, 0x9353, 0xBC2B, 0x9354, + 0xBC2C, 0x9355, 0xBC2D, 0xB9E7, 0xBC2E, 0x9356, 0xBC2F, 0x9357, 0xBC30, 0xB9E8, 0xBC31, 0xB9E9, 0xBC32, 0x9358, 0xBC33, 0x9359, + 0xBC34, 0xB9EA, 0xBC35, 0x935A, 0xBC36, 0x9361, 0xBC37, 0x9362, 0xBC38, 0xB9EB, 0xBC39, 0x9363, 0xBC3A, 0x9364, 0xBC3B, 0x9365, + 0xBC3C, 0x9366, 0xBC3D, 0x9367, 0xBC3E, 0x9368, 0xBC3F, 0x9369, 0xBC40, 0xB9EC, 0xBC41, 0xB9ED, 0xBC42, 0x936A, 0xBC43, 0xB9EE, + 0xBC44, 0xB9EF, 0xBC45, 0xB9F0, 0xBC46, 0x936B, 0xBC47, 0x936C, 0xBC48, 0x936D, 0xBC49, 0xB9F1, 0xBC4A, 0x936E, 0xBC4B, 0x936F, + 0xBC4C, 0xB9F2, 0xBC4D, 0xB9F3, 0xBC4E, 0x9370, 0xBC4F, 0x9371, 0xBC50, 0xB9F4, 0xBC51, 0x9372, 0xBC52, 0x9373, 0xBC53, 0x9374, + 0xBC54, 0x9375, 0xBC55, 0x9376, 0xBC56, 0x9377, 0xBC57, 0x9378, 0xBC58, 0x9379, 0xBC59, 0x937A, 0xBC5A, 0x9381, 0xBC5B, 0x9382, + 0xBC5C, 0x9383, 0xBC5D, 0xB9F5, 0xBC5E, 0x9384, 0xBC5F, 0x9385, 0xBC60, 0x9386, 0xBC61, 0x9387, 0xBC62, 0x9388, 0xBC63, 0x9389, + 0xBC64, 0x938A, 0xBC65, 0x938B, 0xBC66, 0x938C, 0xBC67, 0x938D, 0xBC68, 0x938E, 0xBC69, 0x938F, 0xBC6A, 0x9390, 0xBC6B, 0x9391, + 0xBC6C, 0x9392, 0xBC6D, 0x9393, 0xBC6E, 0x9394, 0xBC6F, 0x9395, 0xBC70, 0x9396, 0xBC71, 0x9397, 0xBC72, 0x9398, 0xBC73, 0x9399, + 0xBC74, 0x939A, 0xBC75, 0x939B, 0xBC76, 0x939C, 0xBC77, 0x939D, 0xBC78, 0x939E, 0xBC79, 0x939F, 0xBC7A, 0x93A0, 0xBC7B, 0x93A1, + 0xBC7C, 0x93A2, 0xBC7D, 0x93A3, 0xBC7E, 0x93A4, 0xBC7F, 0x93A5, 0xBC80, 0x93A6, 0xBC81, 0x93A7, 0xBC82, 0x93A8, 0xBC83, 0x93A9, + 0xBC84, 0xB9F6, 0xBC85, 0xB9F7, 0xBC86, 0x93AA, 0xBC87, 0x93AB, 0xBC88, 0xB9F8, 0xBC89, 0x93AC, 0xBC8A, 0x93AD, 0xBC8B, 0xB9F9, + 0xBC8C, 0xB9FA, 0xBC8D, 0x93AE, 0xBC8E, 0xB9FB, 0xBC8F, 0x93AF, 0xBC90, 0x93B0, 0xBC91, 0x93B1, 0xBC92, 0x93B2, 0xBC93, 0x93B3, + 0xBC94, 0xB9FC, 0xBC95, 0xB9FD, 0xBC96, 0x93B4, 0xBC97, 0xB9FE, 0xBC98, 0x93B5, 0xBC99, 0xBAA1, 0xBC9A, 0xBAA2, 0xBC9B, 0x93B6, + 0xBC9C, 0x93B7, 0xBC9D, 0x93B8, 0xBC9E, 0x93B9, 0xBC9F, 0x93BA, 0xBCA0, 0xBAA3, 0xBCA1, 0xBAA4, 0xBCA2, 0x93BB, 0xBCA3, 0x93BC, + 0xBCA4, 0xBAA5, 0xBCA5, 0x93BD, 0xBCA6, 0x93BE, 0xBCA7, 0xBAA6, 0xBCA8, 0xBAA7, 0xBCA9, 0x93BF, 0xBCAA, 0x93C0, 0xBCAB, 0x93C1, + 0xBCAC, 0x93C2, 0xBCAD, 0x93C3, 0xBCAE, 0x93C4, 0xBCAF, 0x93C5, 0xBCB0, 0xBAA8, 0xBCB1, 0xBAA9, 0xBCB2, 0x93C6, 0xBCB3, 0xBAAA, + 0xBCB4, 0xBAAB, 0xBCB5, 0xBAAC, 0xBCB6, 0x93C7, 0xBCB7, 0x93C8, 0xBCB8, 0x93C9, 0xBCB9, 0x93CA, 0xBCBA, 0x93CB, 0xBCBB, 0x93CC, + 0xBCBC, 0xBAAD, 0xBCBD, 0xBAAE, 0xBCBE, 0x93CD, 0xBCBF, 0x93CE, 0xBCC0, 0xBAAF, 0xBCC1, 0x93CF, 0xBCC2, 0x93D0, 0xBCC3, 0x93D1, + 0xBCC4, 0xBAB0, 0xBCC5, 0x93D2, 0xBCC6, 0x93D3, 0xBCC7, 0x93D4, 0xBCC8, 0x93D5, 0xBCC9, 0x93D6, 0xBCCA, 0x93D7, 0xBCCB, 0x93D8, + 0xBCCC, 0x93D9, 0xBCCD, 0xBAB1, 0xBCCE, 0x93DA, 0xBCCF, 0xBAB2, 0xBCD0, 0xBAB3, 0xBCD1, 0xBAB4, 0xBCD2, 0x93DB, 0xBCD3, 0x93DC, + 0xBCD4, 0x93DD, 0xBCD5, 0xBAB5, 0xBCD6, 0x93DE, 0xBCD7, 0x93DF, 0xBCD8, 0xBAB6, 0xBCD9, 0x93E0, 0xBCDA, 0x93E1, 0xBCDB, 0x93E2, + 0xBCDC, 0xBAB7, 0xBCDD, 0x93E3, 0xBCDE, 0x93E4, 0xBCDF, 0x93E5, 0xBCE0, 0x93E6, 0xBCE1, 0x93E7, 0xBCE2, 0x93E8, 0xBCE3, 0x93E9, + 0xBCE4, 0x93EA, 0xBCE5, 0x93EB, 0xBCE6, 0x93EC, 0xBCE7, 0x93ED, 0xBCE8, 0x93EE, 0xBCE9, 0x93EF, 0xBCEA, 0x93F0, 0xBCEB, 0x93F1, + 0xBCEC, 0x93F2, 0xBCED, 0x93F3, 0xBCEE, 0x93F4, 0xBCEF, 0x93F5, 0xBCF0, 0x93F6, 0xBCF1, 0x93F7, 0xBCF2, 0x93F8, 0xBCF3, 0x93F9, + 0xBCF4, 0xBAB8, 0xBCF5, 0xBAB9, 0xBCF6, 0xBABA, 0xBCF7, 0x93FA, 0xBCF8, 0xBABB, 0xBCF9, 0x93FB, 0xBCFA, 0x93FC, 0xBCFB, 0x93FD, + 0xBCFC, 0xBABC, 0xBCFD, 0x93FE, 0xBCFE, 0x9441, 0xBCFF, 0x9442, 0xBD00, 0x9443, 0xBD01, 0x9444, 0xBD02, 0x9445, 0xBD03, 0x9446, + 0xBD04, 0xBABD, 0xBD05, 0xBABE, 0xBD06, 0x9447, 0xBD07, 0xBABF, 0xBD08, 0x9448, 0xBD09, 0xBAC0, 0xBD0A, 0x9449, 0xBD0B, 0x944A, + 0xBD0C, 0x944B, 0xBD0D, 0x944C, 0xBD0E, 0x944D, 0xBD0F, 0x944E, 0xBD10, 0xBAC1, 0xBD11, 0x944F, 0xBD12, 0x9450, 0xBD13, 0x9451, + 0xBD14, 0xBAC2, 0xBD15, 0x9452, 0xBD16, 0x9453, 0xBD17, 0x9454, 0xBD18, 0x9455, 0xBD19, 0x9456, 0xBD1A, 0x9457, 0xBD1B, 0x9458, + 0xBD1C, 0x9459, 0xBD1D, 0x945A, 0xBD1E, 0x9461, 0xBD1F, 0x9462, 0xBD20, 0x9463, 0xBD21, 0x9464, 0xBD22, 0x9465, 0xBD23, 0x9466, + 0xBD24, 0xBAC3, 0xBD25, 0x9467, 0xBD26, 0x9468, 0xBD27, 0x9469, 0xBD28, 0x946A, 0xBD29, 0x946B, 0xBD2A, 0x946C, 0xBD2B, 0x946D, + 0xBD2C, 0xBAC4, 0xBD2D, 0x946E, 0xBD2E, 0x946F, 0xBD2F, 0x9470, 0xBD30, 0x9471, 0xBD31, 0x9472, 0xBD32, 0x9473, 0xBD33, 0x9474, + 0xBD34, 0x9475, 0xBD35, 0x9476, 0xBD36, 0x9477, 0xBD37, 0x9478, 0xBD38, 0x9479, 0xBD39, 0x947A, 0xBD3A, 0x9481, 0xBD3B, 0x9482, + 0xBD3C, 0x9483, 0xBD3D, 0x9484, 0xBD3E, 0x9485, 0xBD3F, 0x9486, 0xBD40, 0xBAC5, 0xBD41, 0x9487, 0xBD42, 0x9488, 0xBD43, 0x9489, + 0xBD44, 0x948A, 0xBD45, 0x948B, 0xBD46, 0x948C, 0xBD47, 0x948D, 0xBD48, 0xBAC6, 0xBD49, 0xBAC7, 0xBD4A, 0x948E, 0xBD4B, 0x948F, + 0xBD4C, 0xBAC8, 0xBD4D, 0x9490, 0xBD4E, 0x9491, 0xBD4F, 0x9492, 0xBD50, 0xBAC9, 0xBD51, 0x9493, 0xBD52, 0x9494, 0xBD53, 0x9495, + 0xBD54, 0x9496, 0xBD55, 0x9497, 0xBD56, 0x9498, 0xBD57, 0x9499, 0xBD58, 0xBACA, 0xBD59, 0xBACB, 0xBD5A, 0x949A, 0xBD5B, 0x949B, + 0xBD5C, 0x949C, 0xBD5D, 0x949D, 0xBD5E, 0x949E, 0xBD5F, 0x949F, 0xBD60, 0x94A0, 0xBD61, 0x94A1, 0xBD62, 0x94A2, 0xBD63, 0x94A3, + 0xBD64, 0xBACC, 0xBD65, 0x94A4, 0xBD66, 0x94A5, 0xBD67, 0x94A6, 0xBD68, 0xBACD, 0xBD69, 0x94A7, 0xBD6A, 0x94A8, 0xBD6B, 0x94A9, + 0xBD6C, 0x94AA, 0xBD6D, 0x94AB, 0xBD6E, 0x94AC, 0xBD6F, 0x94AD, 0xBD70, 0x94AE, 0xBD71, 0x94AF, 0xBD72, 0x94B0, 0xBD73, 0x94B1, + 0xBD74, 0x94B2, 0xBD75, 0x94B3, 0xBD76, 0x94B4, 0xBD77, 0x94B5, 0xBD78, 0x94B6, 0xBD79, 0x94B7, 0xBD7A, 0x94B8, 0xBD7B, 0x94B9, + 0xBD7C, 0x94BA, 0xBD7D, 0x94BB, 0xBD7E, 0x94BC, 0xBD7F, 0x94BD, 0xBD80, 0xBACE, 0xBD81, 0xBACF, 0xBD82, 0x94BE, 0xBD83, 0x94BF, + 0xBD84, 0xBAD0, 0xBD85, 0x94C0, 0xBD86, 0x94C1, 0xBD87, 0xBAD1, 0xBD88, 0xBAD2, 0xBD89, 0xBAD3, 0xBD8A, 0xBAD4, 0xBD8B, 0x94C2, + 0xBD8C, 0x94C3, 0xBD8D, 0x94C4, 0xBD8E, 0x94C5, 0xBD8F, 0x94C6, 0xBD90, 0xBAD5, 0xBD91, 0xBAD6, 0xBD92, 0x94C7, 0xBD93, 0xBAD7, + 0xBD94, 0x94C8, 0xBD95, 0xBAD8, 0xBD96, 0x94C9, 0xBD97, 0x94CA, 0xBD98, 0x94CB, 0xBD99, 0xBAD9, 0xBD9A, 0xBADA, 0xBD9B, 0x94CC, + 0xBD9C, 0xBADB, 0xBD9D, 0x94CD, 0xBD9E, 0x94CE, 0xBD9F, 0x94CF, 0xBDA0, 0x94D0, 0xBDA1, 0x94D1, 0xBDA2, 0x94D2, 0xBDA3, 0x94D3, + 0xBDA4, 0xBADC, 0xBDA5, 0x94D4, 0xBDA6, 0x94D5, 0xBDA7, 0x94D6, 0xBDA8, 0x94D7, 0xBDA9, 0x94D8, 0xBDAA, 0x94D9, 0xBDAB, 0x94DA, + 0xBDAC, 0x94DB, 0xBDAD, 0x94DC, 0xBDAE, 0x94DD, 0xBDAF, 0x94DE, 0xBDB0, 0xBADD, 0xBDB1, 0x94DF, 0xBDB2, 0x94E0, 0xBDB3, 0x94E1, + 0xBDB4, 0x94E2, 0xBDB5, 0x94E3, 0xBDB6, 0x94E4, 0xBDB7, 0x94E5, 0xBDB8, 0xBADE, 0xBDB9, 0x94E6, 0xBDBA, 0x94E7, 0xBDBB, 0x94E8, + 0xBDBC, 0x94E9, 0xBDBD, 0x94EA, 0xBDBE, 0x94EB, 0xBDBF, 0x94EC, 0xBDC0, 0x94ED, 0xBDC1, 0x94EE, 0xBDC2, 0x94EF, 0xBDC3, 0x94F0, + 0xBDC4, 0x94F1, 0xBDC5, 0x94F2, 0xBDC6, 0x94F3, 0xBDC7, 0x94F4, 0xBDC8, 0x94F5, 0xBDC9, 0x94F6, 0xBDCA, 0x94F7, 0xBDCB, 0x94F8, + 0xBDCC, 0x94F9, 0xBDCD, 0x94FA, 0xBDCE, 0x94FB, 0xBDCF, 0x94FC, 0xBDD0, 0x94FD, 0xBDD1, 0x94FE, 0xBDD2, 0x9541, 0xBDD3, 0x9542, + 0xBDD4, 0xBADF, 0xBDD5, 0xBAE0, 0xBDD6, 0x9543, 0xBDD7, 0x9544, 0xBDD8, 0xBAE1, 0xBDD9, 0x9545, 0xBDDA, 0x9546, 0xBDDB, 0x9547, + 0xBDDC, 0xBAE2, 0xBDDD, 0x9548, 0xBDDE, 0x9549, 0xBDDF, 0x954A, 0xBDE0, 0x954B, 0xBDE1, 0x954C, 0xBDE2, 0x954D, 0xBDE3, 0x954E, + 0xBDE4, 0x954F, 0xBDE5, 0x9550, 0xBDE6, 0x9551, 0xBDE7, 0x9552, 0xBDE8, 0x9553, 0xBDE9, 0xBAE3, 0xBDEA, 0x9554, 0xBDEB, 0x9555, + 0xBDEC, 0x9556, 0xBDED, 0x9557, 0xBDEE, 0x9558, 0xBDEF, 0x9559, 0xBDF0, 0xBAE4, 0xBDF1, 0x955A, 0xBDF2, 0x9561, 0xBDF3, 0x9562, + 0xBDF4, 0xBAE5, 0xBDF5, 0x9563, 0xBDF6, 0x9564, 0xBDF7, 0x9565, 0xBDF8, 0xBAE6, 0xBDF9, 0x9566, 0xBDFA, 0x9567, 0xBDFB, 0x9568, + 0xBDFC, 0x9569, 0xBDFD, 0x956A, 0xBDFE, 0x956B, 0xBDFF, 0x956C, 0xBE00, 0xBAE7, 0xBE01, 0x956D, 0xBE02, 0x956E, 0xBE03, 0xBAE8, + 0xBE04, 0x956F, 0xBE05, 0xBAE9, 0xBE06, 0x9570, 0xBE07, 0x9571, 0xBE08, 0x9572, 0xBE09, 0x9573, 0xBE0A, 0x9574, 0xBE0B, 0x9575, + 0xBE0C, 0xBAEA, 0xBE0D, 0xBAEB, 0xBE0E, 0x9576, 0xBE0F, 0x9577, 0xBE10, 0xBAEC, 0xBE11, 0x9578, 0xBE12, 0x9579, 0xBE13, 0x957A, + 0xBE14, 0xBAED, 0xBE15, 0x9581, 0xBE16, 0x9582, 0xBE17, 0x9583, 0xBE18, 0x9584, 0xBE19, 0x9585, 0xBE1A, 0x9586, 0xBE1B, 0x9587, + 0xBE1C, 0xBAEE, 0xBE1D, 0xBAEF, 0xBE1E, 0x9588, 0xBE1F, 0xBAF0, 0xBE20, 0x9589, 0xBE21, 0x958A, 0xBE22, 0x958B, 0xBE23, 0x958C, + 0xBE24, 0x958D, 0xBE25, 0x958E, 0xBE26, 0x958F, 0xBE27, 0x9590, 0xBE28, 0x9591, 0xBE29, 0x9592, 0xBE2A, 0x9593, 0xBE2B, 0x9594, + 0xBE2C, 0x9595, 0xBE2D, 0x9596, 0xBE2E, 0x9597, 0xBE2F, 0x9598, 0xBE30, 0x9599, 0xBE31, 0x959A, 0xBE32, 0x959B, 0xBE33, 0x959C, + 0xBE34, 0x959D, 0xBE35, 0x959E, 0xBE36, 0x959F, 0xBE37, 0x95A0, 0xBE38, 0x95A1, 0xBE39, 0x95A2, 0xBE3A, 0x95A3, 0xBE3B, 0x95A4, + 0xBE3C, 0x95A5, 0xBE3D, 0x95A6, 0xBE3E, 0x95A7, 0xBE3F, 0x95A8, 0xBE40, 0x95A9, 0xBE41, 0x95AA, 0xBE42, 0x95AB, 0xBE43, 0x95AC, + 0xBE44, 0xBAF1, 0xBE45, 0xBAF2, 0xBE46, 0x95AD, 0xBE47, 0x95AE, 0xBE48, 0xBAF3, 0xBE49, 0x95AF, 0xBE4A, 0x95B0, 0xBE4B, 0x95B1, + 0xBE4C, 0xBAF4, 0xBE4D, 0x95B2, 0xBE4E, 0xBAF5, 0xBE4F, 0x95B3, 0xBE50, 0x95B4, 0xBE51, 0x95B5, 0xBE52, 0x95B6, 0xBE53, 0x95B7, + 0xBE54, 0xBAF6, 0xBE55, 0xBAF7, 0xBE56, 0x95B8, 0xBE57, 0xBAF8, 0xBE58, 0x95B9, 0xBE59, 0xBAF9, 0xBE5A, 0xBAFA, 0xBE5B, 0xBAFB, + 0xBE5C, 0x95BA, 0xBE5D, 0x95BB, 0xBE5E, 0x95BC, 0xBE5F, 0x95BD, 0xBE60, 0xBAFC, 0xBE61, 0xBAFD, 0xBE62, 0x95BE, 0xBE63, 0x95BF, + 0xBE64, 0xBAFE, 0xBE65, 0x95C0, 0xBE66, 0x95C1, 0xBE67, 0x95C2, 0xBE68, 0xBBA1, 0xBE69, 0x95C3, 0xBE6A, 0xBBA2, 0xBE6B, 0x95C4, + 0xBE6C, 0x95C5, 0xBE6D, 0x95C6, 0xBE6E, 0x95C7, 0xBE6F, 0x95C8, 0xBE70, 0xBBA3, 0xBE71, 0xBBA4, 0xBE72, 0x95C9, 0xBE73, 0xBBA5, + 0xBE74, 0xBBA6, 0xBE75, 0xBBA7, 0xBE76, 0x95CA, 0xBE77, 0x95CB, 0xBE78, 0x95CC, 0xBE79, 0x95CD, 0xBE7A, 0x95CE, 0xBE7B, 0xBBA8, + 0xBE7C, 0xBBA9, 0xBE7D, 0xBBAA, 0xBE7E, 0x95CF, 0xBE7F, 0x95D0, 0xBE80, 0xBBAB, 0xBE81, 0x95D1, 0xBE82, 0x95D2, 0xBE83, 0x95D3, + 0xBE84, 0xBBAC, 0xBE85, 0x95D4, 0xBE86, 0x95D5, 0xBE87, 0x95D6, 0xBE88, 0x95D7, 0xBE89, 0x95D8, 0xBE8A, 0x95D9, 0xBE8B, 0x95DA, + 0xBE8C, 0xBBAD, 0xBE8D, 0xBBAE, 0xBE8E, 0x95DB, 0xBE8F, 0xBBAF, 0xBE90, 0xBBB0, 0xBE91, 0xBBB1, 0xBE92, 0x95DC, 0xBE93, 0x95DD, + 0xBE94, 0x95DE, 0xBE95, 0x95DF, 0xBE96, 0x95E0, 0xBE97, 0x95E1, 0xBE98, 0xBBB2, 0xBE99, 0xBBB3, 0xBE9A, 0x95E2, 0xBE9B, 0x95E3, + 0xBE9C, 0x95E4, 0xBE9D, 0x95E5, 0xBE9E, 0x95E6, 0xBE9F, 0x95E7, 0xBEA0, 0x95E8, 0xBEA1, 0x95E9, 0xBEA2, 0x95EA, 0xBEA3, 0x95EB, + 0xBEA4, 0x95EC, 0xBEA5, 0x95ED, 0xBEA6, 0x95EE, 0xBEA7, 0x95EF, 0xBEA8, 0xBBB4, 0xBEA9, 0x95F0, 0xBEAA, 0x95F1, 0xBEAB, 0x95F2, + 0xBEAC, 0x95F3, 0xBEAD, 0x95F4, 0xBEAE, 0x95F5, 0xBEAF, 0x95F6, 0xBEB0, 0x95F7, 0xBEB1, 0x95F8, 0xBEB2, 0x95F9, 0xBEB3, 0x95FA, + 0xBEB4, 0x95FB, 0xBEB5, 0x95FC, 0xBEB6, 0x95FD, 0xBEB7, 0x95FE, 0xBEB8, 0x9641, 0xBEB9, 0x9642, 0xBEBA, 0x9643, 0xBEBB, 0x9644, + 0xBEBC, 0x9645, 0xBEBD, 0x9646, 0xBEBE, 0x9647, 0xBEBF, 0x9648, 0xBEC0, 0x9649, 0xBEC1, 0x964A, 0xBEC2, 0x964B, 0xBEC3, 0x964C, + 0xBEC4, 0x964D, 0xBEC5, 0x964E, 0xBEC6, 0x964F, 0xBEC7, 0x9650, 0xBEC8, 0x9651, 0xBEC9, 0x9652, 0xBECA, 0x9653, 0xBECB, 0x9654, + 0xBECC, 0x9655, 0xBECD, 0x9656, 0xBECE, 0x9657, 0xBECF, 0x9658, 0xBED0, 0xBBB5, 0xBED1, 0xBBB6, 0xBED2, 0x9659, 0xBED3, 0x965A, + 0xBED4, 0xBBB7, 0xBED5, 0x9661, 0xBED6, 0x9662, 0xBED7, 0xBBB8, 0xBED8, 0xBBB9, 0xBED9, 0x9663, 0xBEDA, 0x9664, 0xBEDB, 0x9665, + 0xBEDC, 0x9666, 0xBEDD, 0x9667, 0xBEDE, 0x9668, 0xBEDF, 0x9669, 0xBEE0, 0xBBBA, 0xBEE1, 0x966A, 0xBEE2, 0x966B, 0xBEE3, 0xBBBB, + 0xBEE4, 0xBBBC, 0xBEE5, 0xBBBD, 0xBEE6, 0x966C, 0xBEE7, 0x966D, 0xBEE8, 0x966E, 0xBEE9, 0x966F, 0xBEEA, 0x9670, 0xBEEB, 0x9671, + 0xBEEC, 0xBBBE, 0xBEED, 0x9672, 0xBEEE, 0x9673, 0xBEEF, 0x9674, 0xBEF0, 0x9675, 0xBEF1, 0x9676, 0xBEF2, 0x9677, 0xBEF3, 0x9678, + 0xBEF4, 0x9679, 0xBEF5, 0x967A, 0xBEF6, 0x9681, 0xBEF7, 0x9682, 0xBEF8, 0x9683, 0xBEF9, 0x9684, 0xBEFA, 0x9685, 0xBEFB, 0x9686, + 0xBEFC, 0x9687, 0xBEFD, 0x9688, 0xBEFE, 0x9689, 0xBEFF, 0x968A, 0xBF00, 0x968B, 0xBF01, 0xBBBF, 0xBF02, 0x968C, 0xBF03, 0x968D, + 0xBF04, 0x968E, 0xBF05, 0x968F, 0xBF06, 0x9690, 0xBF07, 0x9691, 0xBF08, 0xBBC0, 0xBF09, 0xBBC1, 0xBF0A, 0x9692, 0xBF0B, 0x9693, + 0xBF0C, 0x9694, 0xBF0D, 0x9695, 0xBF0E, 0x9696, 0xBF0F, 0x9697, 0xBF10, 0x9698, 0xBF11, 0x9699, 0xBF12, 0x969A, 0xBF13, 0x969B, + 0xBF14, 0x969C, 0xBF15, 0x969D, 0xBF16, 0x969E, 0xBF17, 0x969F, 0xBF18, 0xBBC2, 0xBF19, 0xBBC3, 0xBF1A, 0x96A0, 0xBF1B, 0xBBC4, + 0xBF1C, 0xBBC5, 0xBF1D, 0xBBC6, 0xBF1E, 0x96A1, 0xBF1F, 0x96A2, 0xBF20, 0x96A3, 0xBF21, 0x96A4, 0xBF22, 0x96A5, 0xBF23, 0x96A6, + 0xBF24, 0x96A7, 0xBF25, 0x96A8, 0xBF26, 0x96A9, 0xBF27, 0x96AA, 0xBF28, 0x96AB, 0xBF29, 0x96AC, 0xBF2A, 0x96AD, 0xBF2B, 0x96AE, + 0xBF2C, 0x96AF, 0xBF2D, 0x96B0, 0xBF2E, 0x96B1, 0xBF2F, 0x96B2, 0xBF30, 0x96B3, 0xBF31, 0x96B4, 0xBF32, 0x96B5, 0xBF33, 0x96B6, + 0xBF34, 0x96B7, 0xBF35, 0x96B8, 0xBF36, 0x96B9, 0xBF37, 0x96BA, 0xBF38, 0x96BB, 0xBF39, 0x96BC, 0xBF3A, 0x96BD, 0xBF3B, 0x96BE, + 0xBF3C, 0x96BF, 0xBF3D, 0x96C0, 0xBF3E, 0x96C1, 0xBF3F, 0x96C2, 0xBF40, 0xBBC7, 0xBF41, 0xBBC8, 0xBF42, 0x96C3, 0xBF43, 0x96C4, + 0xBF44, 0xBBC9, 0xBF45, 0x96C5, 0xBF46, 0x96C6, 0xBF47, 0x96C7, 0xBF48, 0xBBCA, 0xBF49, 0x96C8, 0xBF4A, 0x96C9, 0xBF4B, 0x96CA, + 0xBF4C, 0x96CB, 0xBF4D, 0x96CC, 0xBF4E, 0x96CD, 0xBF4F, 0x96CE, 0xBF50, 0xBBCB, 0xBF51, 0xBBCC, 0xBF52, 0x96CF, 0xBF53, 0x96D0, + 0xBF54, 0x96D1, 0xBF55, 0xBBCD, 0xBF56, 0x96D2, 0xBF57, 0x96D3, 0xBF58, 0x96D4, 0xBF59, 0x96D5, 0xBF5A, 0x96D6, 0xBF5B, 0x96D7, + 0xBF5C, 0x96D8, 0xBF5D, 0x96D9, 0xBF5E, 0x96DA, 0xBF5F, 0x96DB, 0xBF60, 0x96DC, 0xBF61, 0x96DD, 0xBF62, 0x96DE, 0xBF63, 0x96DF, + 0xBF64, 0x96E0, 0xBF65, 0x96E1, 0xBF66, 0x96E2, 0xBF67, 0x96E3, 0xBF68, 0x96E4, 0xBF69, 0x96E5, 0xBF6A, 0x96E6, 0xBF6B, 0x96E7, + 0xBF6C, 0x96E8, 0xBF6D, 0x96E9, 0xBF6E, 0x96EA, 0xBF6F, 0x96EB, 0xBF70, 0x96EC, 0xBF71, 0x96ED, 0xBF72, 0x96EE, 0xBF73, 0x96EF, + 0xBF74, 0x96F0, 0xBF75, 0x96F1, 0xBF76, 0x96F2, 0xBF77, 0x96F3, 0xBF78, 0x96F4, 0xBF79, 0x96F5, 0xBF7A, 0x96F6, 0xBF7B, 0x96F7, + 0xBF7C, 0x96F8, 0xBF7D, 0x96F9, 0xBF7E, 0x96FA, 0xBF7F, 0x96FB, 0xBF80, 0x96FC, 0xBF81, 0x96FD, 0xBF82, 0x96FE, 0xBF83, 0x9741, + 0xBF84, 0x9742, 0xBF85, 0x9743, 0xBF86, 0x9744, 0xBF87, 0x9745, 0xBF88, 0x9746, 0xBF89, 0x9747, 0xBF8A, 0x9748, 0xBF8B, 0x9749, + 0xBF8C, 0x974A, 0xBF8D, 0x974B, 0xBF8E, 0x974C, 0xBF8F, 0x974D, 0xBF90, 0x974E, 0xBF91, 0x974F, 0xBF92, 0x9750, 0xBF93, 0x9751, + 0xBF94, 0xBBCE, 0xBF95, 0x9752, 0xBF96, 0x9753, 0xBF97, 0x9754, 0xBF98, 0x9755, 0xBF99, 0x9756, 0xBF9A, 0x9757, 0xBF9B, 0x9758, + 0xBF9C, 0x9759, 0xBF9D, 0x975A, 0xBF9E, 0x9761, 0xBF9F, 0x9762, 0xBFA0, 0x9763, 0xBFA1, 0x9764, 0xBFA2, 0x9765, 0xBFA3, 0x9766, + 0xBFA4, 0x9767, 0xBFA5, 0x9768, 0xBFA6, 0x9769, 0xBFA7, 0x976A, 0xBFA8, 0x976B, 0xBFA9, 0x976C, 0xBFAA, 0x976D, 0xBFAB, 0x976E, + 0xBFAC, 0x976F, 0xBFAD, 0x9770, 0xBFAE, 0x9771, 0xBFAF, 0x9772, 0xBFB0, 0xBBCF, 0xBFB1, 0x9773, 0xBFB2, 0x9774, 0xBFB3, 0x9775, + 0xBFB4, 0x9776, 0xBFB5, 0x9777, 0xBFB6, 0x9778, 0xBFB7, 0x9779, 0xBFB8, 0x977A, 0xBFB9, 0x9781, 0xBFBA, 0x9782, 0xBFBB, 0x9783, + 0xBFBC, 0x9784, 0xBFBD, 0x9785, 0xBFBE, 0x9786, 0xBFBF, 0x9787, 0xBFC0, 0x9788, 0xBFC1, 0x9789, 0xBFC2, 0x978A, 0xBFC3, 0x978B, + 0xBFC4, 0x978C, 0xBFC5, 0xBBD0, 0xBFC6, 0x978D, 0xBFC7, 0x978E, 0xBFC8, 0x978F, 0xBFC9, 0x9790, 0xBFCA, 0x9791, 0xBFCB, 0x9792, + 0xBFCC, 0xBBD1, 0xBFCD, 0xBBD2, 0xBFCE, 0x9793, 0xBFCF, 0x9794, 0xBFD0, 0xBBD3, 0xBFD1, 0x9795, 0xBFD2, 0x9796, 0xBFD3, 0x9797, + 0xBFD4, 0xBBD4, 0xBFD5, 0x9798, 0xBFD6, 0x9799, 0xBFD7, 0x979A, 0xBFD8, 0x979B, 0xBFD9, 0x979C, 0xBFDA, 0x979D, 0xBFDB, 0x979E, + 0xBFDC, 0xBBD5, 0xBFDD, 0x979F, 0xBFDE, 0x97A0, 0xBFDF, 0xBBD6, 0xBFE0, 0x97A1, 0xBFE1, 0xBBD7, 0xBFE2, 0x97A2, 0xBFE3, 0x97A3, + 0xBFE4, 0x97A4, 0xBFE5, 0x97A5, 0xBFE6, 0x97A6, 0xBFE7, 0x97A7, 0xBFE8, 0x97A8, 0xBFE9, 0x97A9, 0xBFEA, 0x97AA, 0xBFEB, 0x97AB, + 0xBFEC, 0x97AC, 0xBFED, 0x97AD, 0xBFEE, 0x97AE, 0xBFEF, 0x97AF, 0xBFF0, 0x97B0, 0xBFF1, 0x97B1, 0xBFF2, 0x97B2, 0xBFF3, 0x97B3, + 0xBFF4, 0x97B4, 0xBFF5, 0x97B5, 0xBFF6, 0x97B6, 0xBFF7, 0x97B7, 0xBFF8, 0x97B8, 0xBFF9, 0x97B9, 0xBFFA, 0x97BA, 0xBFFB, 0x97BB, + 0xBFFC, 0x97BC, 0xBFFD, 0x97BD, 0xBFFE, 0x97BE, 0xBFFF, 0x97BF, 0xC000, 0x97C0, 0xC001, 0x97C1, 0xC002, 0x97C2, 0xC003, 0x97C3, + 0xC004, 0x97C4, 0xC005, 0x97C5, 0xC006, 0x97C6, 0xC007, 0x97C7, 0xC008, 0x97C8, 0xC009, 0x97C9, 0xC00A, 0x97CA, 0xC00B, 0x97CB, + 0xC00C, 0x97CC, 0xC00D, 0x97CD, 0xC00E, 0x97CE, 0xC00F, 0x97CF, 0xC010, 0x97D0, 0xC011, 0x97D1, 0xC012, 0x97D2, 0xC013, 0x97D3, + 0xC014, 0x97D4, 0xC015, 0x97D5, 0xC016, 0x97D6, 0xC017, 0x97D7, 0xC018, 0x97D8, 0xC019, 0x97D9, 0xC01A, 0x97DA, 0xC01B, 0x97DB, + 0xC01C, 0x97DC, 0xC01D, 0x97DD, 0xC01E, 0x97DE, 0xC01F, 0x97DF, 0xC020, 0x97E0, 0xC021, 0x97E1, 0xC022, 0x97E2, 0xC023, 0x97E3, + 0xC024, 0x97E4, 0xC025, 0x97E5, 0xC026, 0x97E6, 0xC027, 0x97E7, 0xC028, 0x97E8, 0xC029, 0x97E9, 0xC02A, 0x97EA, 0xC02B, 0x97EB, + 0xC02C, 0x97EC, 0xC02D, 0x97ED, 0xC02E, 0x97EE, 0xC02F, 0x97EF, 0xC030, 0x97F0, 0xC031, 0x97F1, 0xC032, 0x97F2, 0xC033, 0x97F3, + 0xC034, 0x97F4, 0xC035, 0x97F5, 0xC036, 0x97F6, 0xC037, 0x97F7, 0xC038, 0x97F8, 0xC039, 0x97F9, 0xC03A, 0x97FA, 0xC03B, 0x97FB, + 0xC03C, 0xBBD8, 0xC03D, 0x97FC, 0xC03E, 0x97FD, 0xC03F, 0x97FE, 0xC040, 0x9841, 0xC041, 0x9842, 0xC042, 0x9843, 0xC043, 0x9844, + 0xC044, 0x9845, 0xC045, 0x9846, 0xC046, 0x9847, 0xC047, 0x9848, 0xC048, 0x9849, 0xC049, 0x984A, 0xC04A, 0x984B, 0xC04B, 0x984C, + 0xC04C, 0x984D, 0xC04D, 0x984E, 0xC04E, 0x984F, 0xC04F, 0x9850, 0xC050, 0x9851, 0xC051, 0xBBD9, 0xC052, 0x9852, 0xC053, 0x9853, + 0xC054, 0x9854, 0xC055, 0x9855, 0xC056, 0x9856, 0xC057, 0x9857, 0xC058, 0xBBDA, 0xC059, 0x9858, 0xC05A, 0x9859, 0xC05B, 0x985A, + 0xC05C, 0xBBDB, 0xC05D, 0x9861, 0xC05E, 0x9862, 0xC05F, 0x9863, 0xC060, 0xBBDC, 0xC061, 0x9864, 0xC062, 0x9865, 0xC063, 0x9866, + 0xC064, 0x9867, 0xC065, 0x9868, 0xC066, 0x9869, 0xC067, 0x986A, 0xC068, 0xBBDD, 0xC069, 0xBBDE, 0xC06A, 0x986B, 0xC06B, 0x986C, + 0xC06C, 0x986D, 0xC06D, 0x986E, 0xC06E, 0x986F, 0xC06F, 0x9870, 0xC070, 0x9871, 0xC071, 0x9872, 0xC072, 0x9873, 0xC073, 0x9874, + 0xC074, 0x9875, 0xC075, 0x9876, 0xC076, 0x9877, 0xC077, 0x9878, 0xC078, 0x9879, 0xC079, 0x987A, 0xC07A, 0x9881, 0xC07B, 0x9882, + 0xC07C, 0x9883, 0xC07D, 0x9884, 0xC07E, 0x9885, 0xC07F, 0x9886, 0xC080, 0x9887, 0xC081, 0x9888, 0xC082, 0x9889, 0xC083, 0x988A, + 0xC084, 0x988B, 0xC085, 0x988C, 0xC086, 0x988D, 0xC087, 0x988E, 0xC088, 0x988F, 0xC089, 0x9890, 0xC08A, 0x9891, 0xC08B, 0x9892, + 0xC08C, 0x9893, 0xC08D, 0x9894, 0xC08E, 0x9895, 0xC08F, 0x9896, 0xC090, 0xBBDF, 0xC091, 0xBBE0, 0xC092, 0x9897, 0xC093, 0x9898, + 0xC094, 0xBBE1, 0xC095, 0x9899, 0xC096, 0x989A, 0xC097, 0x989B, 0xC098, 0xBBE2, 0xC099, 0x989C, 0xC09A, 0x989D, 0xC09B, 0x989E, + 0xC09C, 0x989F, 0xC09D, 0x98A0, 0xC09E, 0x98A1, 0xC09F, 0x98A2, 0xC0A0, 0xBBE3, 0xC0A1, 0xBBE4, 0xC0A2, 0x98A3, 0xC0A3, 0xBBE5, + 0xC0A4, 0x98A4, 0xC0A5, 0xBBE6, 0xC0A6, 0x98A5, 0xC0A7, 0x98A6, 0xC0A8, 0x98A7, 0xC0A9, 0x98A8, 0xC0AA, 0x98A9, 0xC0AB, 0x98AA, + 0xC0AC, 0xBBE7, 0xC0AD, 0xBBE8, 0xC0AE, 0x98AB, 0xC0AF, 0xBBE9, 0xC0B0, 0xBBEA, 0xC0B1, 0x98AC, 0xC0B2, 0x98AD, 0xC0B3, 0xBBEB, + 0xC0B4, 0xBBEC, 0xC0B5, 0xBBED, 0xC0B6, 0xBBEE, 0xC0B7, 0x98AE, 0xC0B8, 0x98AF, 0xC0B9, 0x98B0, 0xC0BA, 0x98B1, 0xC0BB, 0x98B2, + 0xC0BC, 0xBBEF, 0xC0BD, 0xBBF0, 0xC0BE, 0x98B3, 0xC0BF, 0xBBF1, 0xC0C0, 0xBBF2, 0xC0C1, 0xBBF3, 0xC0C2, 0x98B4, 0xC0C3, 0x98B5, + 0xC0C4, 0x98B6, 0xC0C5, 0xBBF4, 0xC0C6, 0x98B7, 0xC0C7, 0x98B8, 0xC0C8, 0xBBF5, 0xC0C9, 0xBBF6, 0xC0CA, 0x98B9, 0xC0CB, 0x98BA, + 0xC0CC, 0xBBF7, 0xC0CD, 0x98BB, 0xC0CE, 0x98BC, 0xC0CF, 0x98BD, 0xC0D0, 0xBBF8, 0xC0D1, 0x98BE, 0xC0D2, 0x98BF, 0xC0D3, 0x98C0, + 0xC0D4, 0x98C1, 0xC0D5, 0x98C2, 0xC0D6, 0x98C3, 0xC0D7, 0x98C4, 0xC0D8, 0xBBF9, 0xC0D9, 0xBBFA, 0xC0DA, 0x98C5, 0xC0DB, 0xBBFB, + 0xC0DC, 0xBBFC, 0xC0DD, 0xBBFD, 0xC0DE, 0x98C6, 0xC0DF, 0x98C7, 0xC0E0, 0x98C8, 0xC0E1, 0x98C9, 0xC0E2, 0x98CA, 0xC0E3, 0x98CB, + 0xC0E4, 0xBBFE, 0xC0E5, 0xBCA1, 0xC0E6, 0x98CC, 0xC0E7, 0x98CD, 0xC0E8, 0xBCA2, 0xC0E9, 0x98CE, 0xC0EA, 0x98CF, 0xC0EB, 0x98D0, + 0xC0EC, 0xBCA3, 0xC0ED, 0x98D1, 0xC0EE, 0x98D2, 0xC0EF, 0x98D3, 0xC0F0, 0x98D4, 0xC0F1, 0x98D5, 0xC0F2, 0x98D6, 0xC0F3, 0x98D7, + 0xC0F4, 0xBCA4, 0xC0F5, 0xBCA5, 0xC0F6, 0x98D8, 0xC0F7, 0xBCA6, 0xC0F8, 0x98D9, 0xC0F9, 0xBCA7, 0xC0FA, 0x98DA, 0xC0FB, 0x98DB, + 0xC0FC, 0x98DC, 0xC0FD, 0x98DD, 0xC0FE, 0x98DE, 0xC0FF, 0x98DF, 0xC100, 0xBCA8, 0xC101, 0x98E0, 0xC102, 0x98E1, 0xC103, 0x98E2, + 0xC104, 0xBCA9, 0xC105, 0x98E3, 0xC106, 0x98E4, 0xC107, 0x98E5, 0xC108, 0xBCAA, 0xC109, 0x98E6, 0xC10A, 0x98E7, 0xC10B, 0x98E8, + 0xC10C, 0x98E9, 0xC10D, 0x98EA, 0xC10E, 0x98EB, 0xC10F, 0x98EC, 0xC110, 0xBCAB, 0xC111, 0x98ED, 0xC112, 0x98EE, 0xC113, 0x98EF, + 0xC114, 0x98F0, 0xC115, 0xBCAC, 0xC116, 0x98F1, 0xC117, 0x98F2, 0xC118, 0x98F3, 0xC119, 0x98F4, 0xC11A, 0x98F5, 0xC11B, 0x98F6, + 0xC11C, 0xBCAD, 0xC11D, 0xBCAE, 0xC11E, 0xBCAF, 0xC11F, 0xBCB0, 0xC120, 0xBCB1, 0xC121, 0x98F7, 0xC122, 0x98F8, 0xC123, 0xBCB2, + 0xC124, 0xBCB3, 0xC125, 0x98F9, 0xC126, 0xBCB4, 0xC127, 0xBCB5, 0xC128, 0x98FA, 0xC129, 0x98FB, 0xC12A, 0x98FC, 0xC12B, 0x98FD, + 0xC12C, 0xBCB6, 0xC12D, 0xBCB7, 0xC12E, 0x98FE, 0xC12F, 0xBCB8, 0xC130, 0xBCB9, 0xC131, 0xBCBA, 0xC132, 0x9941, 0xC133, 0x9942, + 0xC134, 0x9943, 0xC135, 0x9944, 0xC136, 0xBCBB, 0xC137, 0x9945, 0xC138, 0xBCBC, 0xC139, 0xBCBD, 0xC13A, 0x9946, 0xC13B, 0x9947, + 0xC13C, 0xBCBE, 0xC13D, 0x9948, 0xC13E, 0x9949, 0xC13F, 0x994A, 0xC140, 0xBCBF, 0xC141, 0x994B, 0xC142, 0x994C, 0xC143, 0x994D, + 0xC144, 0x994E, 0xC145, 0x994F, 0xC146, 0x9950, 0xC147, 0x9951, 0xC148, 0xBCC0, 0xC149, 0xBCC1, 0xC14A, 0x9952, 0xC14B, 0xBCC2, + 0xC14C, 0xBCC3, 0xC14D, 0xBCC4, 0xC14E, 0x9953, 0xC14F, 0x9954, 0xC150, 0x9955, 0xC151, 0x9956, 0xC152, 0x9957, 0xC153, 0x9958, + 0xC154, 0xBCC5, 0xC155, 0xBCC6, 0xC156, 0x9959, 0xC157, 0x995A, 0xC158, 0xBCC7, 0xC159, 0x9961, 0xC15A, 0x9962, 0xC15B, 0x9963, + 0xC15C, 0xBCC8, 0xC15D, 0x9964, 0xC15E, 0x9965, 0xC15F, 0x9966, 0xC160, 0x9967, 0xC161, 0x9968, 0xC162, 0x9969, 0xC163, 0x996A, + 0xC164, 0xBCC9, 0xC165, 0xBCCA, 0xC166, 0x996B, 0xC167, 0xBCCB, 0xC168, 0xBCCC, 0xC169, 0xBCCD, 0xC16A, 0x996C, 0xC16B, 0x996D, + 0xC16C, 0x996E, 0xC16D, 0x996F, 0xC16E, 0x9970, 0xC16F, 0x9971, 0xC170, 0xBCCE, 0xC171, 0x9972, 0xC172, 0x9973, 0xC173, 0x9974, + 0xC174, 0xBCCF, 0xC175, 0x9975, 0xC176, 0x9976, 0xC177, 0x9977, 0xC178, 0xBCD0, 0xC179, 0x9978, 0xC17A, 0x9979, 0xC17B, 0x997A, + 0xC17C, 0x9981, 0xC17D, 0x9982, 0xC17E, 0x9983, 0xC17F, 0x9984, 0xC180, 0x9985, 0xC181, 0x9986, 0xC182, 0x9987, 0xC183, 0x9988, + 0xC184, 0x9989, 0xC185, 0xBCD1, 0xC186, 0x998A, 0xC187, 0x998B, 0xC188, 0x998C, 0xC189, 0x998D, 0xC18A, 0x998E, 0xC18B, 0x998F, + 0xC18C, 0xBCD2, 0xC18D, 0xBCD3, 0xC18E, 0xBCD4, 0xC18F, 0x9990, 0xC190, 0xBCD5, 0xC191, 0x9991, 0xC192, 0x9992, 0xC193, 0x9993, + 0xC194, 0xBCD6, 0xC195, 0x9994, 0xC196, 0xBCD7, 0xC197, 0x9995, 0xC198, 0x9996, 0xC199, 0x9997, 0xC19A, 0x9998, 0xC19B, 0x9999, + 0xC19C, 0xBCD8, 0xC19D, 0xBCD9, 0xC19E, 0x999A, 0xC19F, 0xBCDA, 0xC1A0, 0x999B, 0xC1A1, 0xBCDB, 0xC1A2, 0x999C, 0xC1A3, 0x999D, + 0xC1A4, 0x999E, 0xC1A5, 0xBCDC, 0xC1A6, 0x999F, 0xC1A7, 0x99A0, 0xC1A8, 0xBCDD, 0xC1A9, 0xBCDE, 0xC1AA, 0x99A1, 0xC1AB, 0x99A2, + 0xC1AC, 0xBCDF, 0xC1AD, 0x99A3, 0xC1AE, 0x99A4, 0xC1AF, 0x99A5, 0xC1B0, 0xBCE0, 0xC1B1, 0x99A6, 0xC1B2, 0x99A7, 0xC1B3, 0x99A8, + 0xC1B4, 0x99A9, 0xC1B5, 0x99AA, 0xC1B6, 0x99AB, 0xC1B7, 0x99AC, 0xC1B8, 0x99AD, 0xC1B9, 0x99AE, 0xC1BA, 0x99AF, 0xC1BB, 0x99B0, + 0xC1BC, 0x99B1, 0xC1BD, 0xBCE1, 0xC1BE, 0x99B2, 0xC1BF, 0x99B3, 0xC1C0, 0x99B4, 0xC1C1, 0x99B5, 0xC1C2, 0x99B6, 0xC1C3, 0x99B7, + 0xC1C4, 0xBCE2, 0xC1C5, 0x99B8, 0xC1C6, 0x99B9, 0xC1C7, 0x99BA, 0xC1C8, 0xBCE3, 0xC1C9, 0x99BB, 0xC1CA, 0x99BC, 0xC1CB, 0x99BD, + 0xC1CC, 0xBCE4, 0xC1CD, 0x99BE, 0xC1CE, 0x99BF, 0xC1CF, 0x99C0, 0xC1D0, 0x99C1, 0xC1D1, 0x99C2, 0xC1D2, 0x99C3, 0xC1D3, 0x99C4, + 0xC1D4, 0xBCE5, 0xC1D5, 0x99C5, 0xC1D6, 0x99C6, 0xC1D7, 0xBCE6, 0xC1D8, 0xBCE7, 0xC1D9, 0x99C7, 0xC1DA, 0x99C8, 0xC1DB, 0x99C9, + 0xC1DC, 0x99CA, 0xC1DD, 0x99CB, 0xC1DE, 0x99CC, 0xC1DF, 0x99CD, 0xC1E0, 0xBCE8, 0xC1E1, 0x99CE, 0xC1E2, 0x99CF, 0xC1E3, 0x99D0, + 0xC1E4, 0xBCE9, 0xC1E5, 0x99D1, 0xC1E6, 0x99D2, 0xC1E7, 0x99D3, 0xC1E8, 0xBCEA, 0xC1E9, 0x99D4, 0xC1EA, 0x99D5, 0xC1EB, 0x99D6, + 0xC1EC, 0x99D7, 0xC1ED, 0x99D8, 0xC1EE, 0x99D9, 0xC1EF, 0x99DA, 0xC1F0, 0xBCEB, 0xC1F1, 0xBCEC, 0xC1F2, 0x99DB, 0xC1F3, 0xBCED, + 0xC1F4, 0x99DC, 0xC1F5, 0x99DD, 0xC1F6, 0x99DE, 0xC1F7, 0x99DF, 0xC1F8, 0x99E0, 0xC1F9, 0x99E1, 0xC1FA, 0x99E2, 0xC1FB, 0x99E3, + 0xC1FC, 0xBCEE, 0xC1FD, 0xBCEF, 0xC1FE, 0x99E4, 0xC1FF, 0x99E5, 0xC200, 0xBCF0, 0xC201, 0x99E6, 0xC202, 0x99E7, 0xC203, 0x99E8, + 0xC204, 0xBCF1, 0xC205, 0x99E9, 0xC206, 0x99EA, 0xC207, 0x99EB, 0xC208, 0x99EC, 0xC209, 0x99ED, 0xC20A, 0x99EE, 0xC20B, 0x99EF, + 0xC20C, 0xBCF2, 0xC20D, 0xBCF3, 0xC20E, 0x99F0, 0xC20F, 0xBCF4, 0xC210, 0x99F1, 0xC211, 0xBCF5, 0xC212, 0x99F2, 0xC213, 0x99F3, + 0xC214, 0x99F4, 0xC215, 0x99F5, 0xC216, 0x99F6, 0xC217, 0x99F7, 0xC218, 0xBCF6, 0xC219, 0xBCF7, 0xC21A, 0x99F8, 0xC21B, 0x99F9, + 0xC21C, 0xBCF8, 0xC21D, 0x99FA, 0xC21E, 0x99FB, 0xC21F, 0xBCF9, 0xC220, 0xBCFA, 0xC221, 0x99FC, 0xC222, 0x99FD, 0xC223, 0x99FE, + 0xC224, 0x9A41, 0xC225, 0x9A42, 0xC226, 0x9A43, 0xC227, 0x9A44, 0xC228, 0xBCFB, 0xC229, 0xBCFC, 0xC22A, 0x9A45, 0xC22B, 0xBCFD, + 0xC22C, 0x9A46, 0xC22D, 0xBCFE, 0xC22E, 0x9A47, 0xC22F, 0xBDA1, 0xC230, 0x9A48, 0xC231, 0xBDA2, 0xC232, 0xBDA3, 0xC233, 0x9A49, + 0xC234, 0xBDA4, 0xC235, 0x9A4A, 0xC236, 0x9A4B, 0xC237, 0x9A4C, 0xC238, 0x9A4D, 0xC239, 0x9A4E, 0xC23A, 0x9A4F, 0xC23B, 0x9A50, + 0xC23C, 0x9A51, 0xC23D, 0x9A52, 0xC23E, 0x9A53, 0xC23F, 0x9A54, 0xC240, 0x9A55, 0xC241, 0x9A56, 0xC242, 0x9A57, 0xC243, 0x9A58, + 0xC244, 0x9A59, 0xC245, 0x9A5A, 0xC246, 0x9A61, 0xC247, 0x9A62, 0xC248, 0xBDA5, 0xC249, 0x9A63, 0xC24A, 0x9A64, 0xC24B, 0x9A65, + 0xC24C, 0x9A66, 0xC24D, 0x9A67, 0xC24E, 0x9A68, 0xC24F, 0x9A69, 0xC250, 0xBDA6, 0xC251, 0xBDA7, 0xC252, 0x9A6A, 0xC253, 0x9A6B, + 0xC254, 0xBDA8, 0xC255, 0x9A6C, 0xC256, 0x9A6D, 0xC257, 0x9A6E, 0xC258, 0xBDA9, 0xC259, 0x9A6F, 0xC25A, 0x9A70, 0xC25B, 0x9A71, + 0xC25C, 0x9A72, 0xC25D, 0x9A73, 0xC25E, 0x9A74, 0xC25F, 0x9A75, 0xC260, 0xBDAA, 0xC261, 0x9A76, 0xC262, 0x9A77, 0xC263, 0x9A78, + 0xC264, 0x9A79, 0xC265, 0xBDAB, 0xC266, 0x9A7A, 0xC267, 0x9A81, 0xC268, 0x9A82, 0xC269, 0x9A83, 0xC26A, 0x9A84, 0xC26B, 0x9A85, + 0xC26C, 0xBDAC, 0xC26D, 0xBDAD, 0xC26E, 0x9A86, 0xC26F, 0x9A87, 0xC270, 0xBDAE, 0xC271, 0x9A88, 0xC272, 0x9A89, 0xC273, 0x9A8A, + 0xC274, 0xBDAF, 0xC275, 0x9A8B, 0xC276, 0x9A8C, 0xC277, 0x9A8D, 0xC278, 0x9A8E, 0xC279, 0x9A8F, 0xC27A, 0x9A90, 0xC27B, 0x9A91, + 0xC27C, 0xBDB0, 0xC27D, 0xBDB1, 0xC27E, 0x9A92, 0xC27F, 0xBDB2, 0xC280, 0x9A93, 0xC281, 0xBDB3, 0xC282, 0x9A94, 0xC283, 0x9A95, + 0xC284, 0x9A96, 0xC285, 0x9A97, 0xC286, 0x9A98, 0xC287, 0x9A99, 0xC288, 0xBDB4, 0xC289, 0xBDB5, 0xC28A, 0x9A9A, 0xC28B, 0x9A9B, + 0xC28C, 0x9A9C, 0xC28D, 0x9A9D, 0xC28E, 0x9A9E, 0xC28F, 0x9A9F, 0xC290, 0xBDB6, 0xC291, 0x9AA0, 0xC292, 0x9AA1, 0xC293, 0x9AA2, + 0xC294, 0x9AA3, 0xC295, 0x9AA4, 0xC296, 0x9AA5, 0xC297, 0x9AA6, 0xC298, 0xBDB7, 0xC299, 0x9AA7, 0xC29A, 0x9AA8, 0xC29B, 0xBDB8, + 0xC29C, 0x9AA9, 0xC29D, 0xBDB9, 0xC29E, 0x9AAA, 0xC29F, 0x9AAB, 0xC2A0, 0x9AAC, 0xC2A1, 0x9AAD, 0xC2A2, 0x9AAE, 0xC2A3, 0x9AAF, + 0xC2A4, 0xBDBA, 0xC2A5, 0xBDBB, 0xC2A6, 0x9AB0, 0xC2A7, 0x9AB1, 0xC2A8, 0xBDBC, 0xC2A9, 0x9AB2, 0xC2AA, 0x9AB3, 0xC2AB, 0x9AB4, + 0xC2AC, 0xBDBD, 0xC2AD, 0xBDBE, 0xC2AE, 0x9AB5, 0xC2AF, 0x9AB6, 0xC2B0, 0x9AB7, 0xC2B1, 0x9AB8, 0xC2B2, 0x9AB9, 0xC2B3, 0x9ABA, + 0xC2B4, 0xBDBF, 0xC2B5, 0xBDC0, 0xC2B6, 0x9ABB, 0xC2B7, 0xBDC1, 0xC2B8, 0x9ABC, 0xC2B9, 0xBDC2, 0xC2BA, 0x9ABD, 0xC2BB, 0x9ABE, + 0xC2BC, 0x9ABF, 0xC2BD, 0x9AC0, 0xC2BE, 0x9AC1, 0xC2BF, 0x9AC2, 0xC2C0, 0x9AC3, 0xC2C1, 0x9AC4, 0xC2C2, 0x9AC5, 0xC2C3, 0x9AC6, + 0xC2C4, 0x9AC7, 0xC2C5, 0x9AC8, 0xC2C6, 0x9AC9, 0xC2C7, 0x9ACA, 0xC2C8, 0x9ACB, 0xC2C9, 0x9ACC, 0xC2CA, 0x9ACD, 0xC2CB, 0x9ACE, + 0xC2CC, 0x9ACF, 0xC2CD, 0x9AD0, 0xC2CE, 0x9AD1, 0xC2CF, 0x9AD2, 0xC2D0, 0x9AD3, 0xC2D1, 0x9AD4, 0xC2D2, 0x9AD5, 0xC2D3, 0x9AD6, + 0xC2D4, 0x9AD7, 0xC2D5, 0x9AD8, 0xC2D6, 0x9AD9, 0xC2D7, 0x9ADA, 0xC2D8, 0x9ADB, 0xC2D9, 0x9ADC, 0xC2DA, 0x9ADD, 0xC2DB, 0x9ADE, + 0xC2DC, 0xBDC3, 0xC2DD, 0xBDC4, 0xC2DE, 0x9ADF, 0xC2DF, 0x9AE0, 0xC2E0, 0xBDC5, 0xC2E1, 0x9AE1, 0xC2E2, 0x9AE2, 0xC2E3, 0xBDC6, + 0xC2E4, 0xBDC7, 0xC2E5, 0x9AE3, 0xC2E6, 0x9AE4, 0xC2E7, 0x9AE5, 0xC2E8, 0x9AE6, 0xC2E9, 0x9AE7, 0xC2EA, 0x9AE8, 0xC2EB, 0xBDC8, + 0xC2EC, 0xBDC9, 0xC2ED, 0xBDCA, 0xC2EE, 0x9AE9, 0xC2EF, 0xBDCB, 0xC2F0, 0x9AEA, 0xC2F1, 0xBDCC, 0xC2F2, 0x9AEB, 0xC2F3, 0x9AEC, + 0xC2F4, 0x9AED, 0xC2F5, 0x9AEE, 0xC2F6, 0xBDCD, 0xC2F7, 0x9AEF, 0xC2F8, 0xBDCE, 0xC2F9, 0xBDCF, 0xC2FA, 0x9AF0, 0xC2FB, 0xBDD0, + 0xC2FC, 0xBDD1, 0xC2FD, 0x9AF1, 0xC2FE, 0x9AF2, 0xC2FF, 0x9AF3, 0xC300, 0xBDD2, 0xC301, 0x9AF4, 0xC302, 0x9AF5, 0xC303, 0x9AF6, + 0xC304, 0x9AF7, 0xC305, 0x9AF8, 0xC306, 0x9AF9, 0xC307, 0x9AFA, 0xC308, 0xBDD3, 0xC309, 0xBDD4, 0xC30A, 0x9AFB, 0xC30B, 0x9AFC, + 0xC30C, 0xBDD5, 0xC30D, 0xBDD6, 0xC30E, 0x9AFD, 0xC30F, 0x9AFE, 0xC310, 0x9B41, 0xC311, 0x9B42, 0xC312, 0x9B43, 0xC313, 0xBDD7, + 0xC314, 0xBDD8, 0xC315, 0xBDD9, 0xC316, 0x9B44, 0xC317, 0x9B45, 0xC318, 0xBDDA, 0xC319, 0x9B46, 0xC31A, 0x9B47, 0xC31B, 0x9B48, + 0xC31C, 0xBDDB, 0xC31D, 0x9B49, 0xC31E, 0x9B4A, 0xC31F, 0x9B4B, 0xC320, 0x9B4C, 0xC321, 0x9B4D, 0xC322, 0x9B4E, 0xC323, 0x9B4F, + 0xC324, 0xBDDC, 0xC325, 0xBDDD, 0xC326, 0x9B50, 0xC327, 0x9B51, 0xC328, 0xBDDE, 0xC329, 0xBDDF, 0xC32A, 0x9B52, 0xC32B, 0x9B53, + 0xC32C, 0x9B54, 0xC32D, 0x9B55, 0xC32E, 0x9B56, 0xC32F, 0x9B57, 0xC330, 0x9B58, 0xC331, 0x9B59, 0xC332, 0x9B5A, 0xC333, 0x9B61, + 0xC334, 0x9B62, 0xC335, 0x9B63, 0xC336, 0x9B64, 0xC337, 0x9B65, 0xC338, 0x9B66, 0xC339, 0x9B67, 0xC33A, 0x9B68, 0xC33B, 0x9B69, + 0xC33C, 0x9B6A, 0xC33D, 0x9B6B, 0xC33E, 0x9B6C, 0xC33F, 0x9B6D, 0xC340, 0x9B6E, 0xC341, 0x9B6F, 0xC342, 0x9B70, 0xC343, 0x9B71, + 0xC344, 0x9B72, 0xC345, 0xBDE0, 0xC346, 0x9B73, 0xC347, 0x9B74, 0xC348, 0x9B75, 0xC349, 0x9B76, 0xC34A, 0x9B77, 0xC34B, 0x9B78, + 0xC34C, 0x9B79, 0xC34D, 0x9B7A, 0xC34E, 0x9B81, 0xC34F, 0x9B82, 0xC350, 0x9B83, 0xC351, 0x9B84, 0xC352, 0x9B85, 0xC353, 0x9B86, + 0xC354, 0x9B87, 0xC355, 0x9B88, 0xC356, 0x9B89, 0xC357, 0x9B8A, 0xC358, 0x9B8B, 0xC359, 0x9B8C, 0xC35A, 0x9B8D, 0xC35B, 0x9B8E, + 0xC35C, 0x9B8F, 0xC35D, 0x9B90, 0xC35E, 0x9B91, 0xC35F, 0x9B92, 0xC360, 0x9B93, 0xC361, 0x9B94, 0xC362, 0x9B95, 0xC363, 0x9B96, + 0xC364, 0x9B97, 0xC365, 0x9B98, 0xC366, 0x9B99, 0xC367, 0x9B9A, 0xC368, 0xBDE1, 0xC369, 0xBDE2, 0xC36A, 0x9B9B, 0xC36B, 0x9B9C, + 0xC36C, 0xBDE3, 0xC36D, 0x9B9D, 0xC36E, 0x9B9E, 0xC36F, 0x9B9F, 0xC370, 0xBDE4, 0xC371, 0x9BA0, 0xC372, 0xBDE5, 0xC373, 0x9BA1, + 0xC374, 0x9BA2, 0xC375, 0x9BA3, 0xC376, 0x9BA4, 0xC377, 0x9BA5, 0xC378, 0xBDE6, 0xC379, 0xBDE7, 0xC37A, 0x9BA6, 0xC37B, 0x9BA7, + 0xC37C, 0xBDE8, 0xC37D, 0xBDE9, 0xC37E, 0x9BA8, 0xC37F, 0x9BA9, 0xC380, 0x9BAA, 0xC381, 0x9BAB, 0xC382, 0x9BAC, 0xC383, 0x9BAD, + 0xC384, 0xBDEA, 0xC385, 0x9BAE, 0xC386, 0x9BAF, 0xC387, 0x9BB0, 0xC388, 0xBDEB, 0xC389, 0x9BB1, 0xC38A, 0x9BB2, 0xC38B, 0x9BB3, + 0xC38C, 0xBDEC, 0xC38D, 0x9BB4, 0xC38E, 0x9BB5, 0xC38F, 0x9BB6, 0xC390, 0x9BB7, 0xC391, 0x9BB8, 0xC392, 0x9BB9, 0xC393, 0x9BBA, + 0xC394, 0x9BBB, 0xC395, 0x9BBC, 0xC396, 0x9BBD, 0xC397, 0x9BBE, 0xC398, 0x9BBF, 0xC399, 0x9BC0, 0xC39A, 0x9BC1, 0xC39B, 0x9BC2, + 0xC39C, 0x9BC3, 0xC39D, 0x9BC4, 0xC39E, 0x9BC5, 0xC39F, 0x9BC6, 0xC3A0, 0x9BC7, 0xC3A1, 0x9BC8, 0xC3A2, 0x9BC9, 0xC3A3, 0x9BCA, + 0xC3A4, 0x9BCB, 0xC3A5, 0x9BCC, 0xC3A6, 0x9BCD, 0xC3A7, 0x9BCE, 0xC3A8, 0x9BCF, 0xC3A9, 0x9BD0, 0xC3AA, 0x9BD1, 0xC3AB, 0x9BD2, + 0xC3AC, 0x9BD3, 0xC3AD, 0x9BD4, 0xC3AE, 0x9BD5, 0xC3AF, 0x9BD6, 0xC3B0, 0x9BD7, 0xC3B1, 0x9BD8, 0xC3B2, 0x9BD9, 0xC3B3, 0x9BDA, + 0xC3B4, 0x9BDB, 0xC3B5, 0x9BDC, 0xC3B6, 0x9BDD, 0xC3B7, 0x9BDE, 0xC3B8, 0x9BDF, 0xC3B9, 0x9BE0, 0xC3BA, 0x9BE1, 0xC3BB, 0x9BE2, + 0xC3BC, 0x9BE3, 0xC3BD, 0x9BE4, 0xC3BE, 0x9BE5, 0xC3BF, 0x9BE6, 0xC3C0, 0xBDED, 0xC3C1, 0x9BE7, 0xC3C2, 0x9BE8, 0xC3C3, 0x9BE9, + 0xC3C4, 0x9BEA, 0xC3C5, 0x9BEB, 0xC3C6, 0x9BEC, 0xC3C7, 0x9BED, 0xC3C8, 0x9BEE, 0xC3C9, 0x9BEF, 0xC3CA, 0x9BF0, 0xC3CB, 0x9BF1, + 0xC3CC, 0x9BF2, 0xC3CD, 0x9BF3, 0xC3CE, 0x9BF4, 0xC3CF, 0x9BF5, 0xC3D0, 0x9BF6, 0xC3D1, 0x9BF7, 0xC3D2, 0x9BF8, 0xC3D3, 0x9BF9, + 0xC3D4, 0x9BFA, 0xC3D5, 0x9BFB, 0xC3D6, 0x9BFC, 0xC3D7, 0x9BFD, 0xC3D8, 0xBDEE, 0xC3D9, 0xBDEF, 0xC3DA, 0x9BFE, 0xC3DB, 0x9C41, + 0xC3DC, 0xBDF0, 0xC3DD, 0x9C42, 0xC3DE, 0x9C43, 0xC3DF, 0xBDF1, 0xC3E0, 0xBDF2, 0xC3E1, 0x9C44, 0xC3E2, 0xBDF3, 0xC3E3, 0x9C45, + 0xC3E4, 0x9C46, 0xC3E5, 0x9C47, 0xC3E6, 0x9C48, 0xC3E7, 0x9C49, 0xC3E8, 0xBDF4, 0xC3E9, 0xBDF5, 0xC3EA, 0x9C4A, 0xC3EB, 0x9C4B, + 0xC3EC, 0x9C4C, 0xC3ED, 0xBDF6, 0xC3EE, 0x9C4D, 0xC3EF, 0x9C4E, 0xC3F0, 0x9C4F, 0xC3F1, 0x9C50, 0xC3F2, 0x9C51, 0xC3F3, 0x9C52, + 0xC3F4, 0xBDF7, 0xC3F5, 0xBDF8, 0xC3F6, 0x9C53, 0xC3F7, 0x9C54, 0xC3F8, 0xBDF9, 0xC3F9, 0x9C55, 0xC3FA, 0x9C56, 0xC3FB, 0x9C57, + 0xC3FC, 0x9C58, 0xC3FD, 0x9C59, 0xC3FE, 0x9C5A, 0xC3FF, 0x9C61, 0xC400, 0x9C62, 0xC401, 0x9C63, 0xC402, 0x9C64, 0xC403, 0x9C65, + 0xC404, 0x9C66, 0xC405, 0x9C67, 0xC406, 0x9C68, 0xC407, 0x9C69, 0xC408, 0xBDFA, 0xC409, 0x9C6A, 0xC40A, 0x9C6B, 0xC40B, 0x9C6C, + 0xC40C, 0x9C6D, 0xC40D, 0x9C6E, 0xC40E, 0x9C6F, 0xC40F, 0x9C70, 0xC410, 0xBDFB, 0xC411, 0x9C71, 0xC412, 0x9C72, 0xC413, 0x9C73, + 0xC414, 0x9C74, 0xC415, 0x9C75, 0xC416, 0x9C76, 0xC417, 0x9C77, 0xC418, 0x9C78, 0xC419, 0x9C79, 0xC41A, 0x9C7A, 0xC41B, 0x9C81, + 0xC41C, 0x9C82, 0xC41D, 0x9C83, 0xC41E, 0x9C84, 0xC41F, 0x9C85, 0xC420, 0x9C86, 0xC421, 0x9C87, 0xC422, 0x9C88, 0xC423, 0x9C89, + 0xC424, 0xBDFC, 0xC425, 0x9C8A, 0xC426, 0x9C8B, 0xC427, 0x9C8C, 0xC428, 0x9C8D, 0xC429, 0x9C8E, 0xC42A, 0x9C8F, 0xC42B, 0x9C90, + 0xC42C, 0xBDFD, 0xC42D, 0x9C91, 0xC42E, 0x9C92, 0xC42F, 0x9C93, 0xC430, 0xBDFE, 0xC431, 0x9C94, 0xC432, 0x9C95, 0xC433, 0x9C96, + 0xC434, 0xBEA1, 0xC435, 0x9C97, 0xC436, 0x9C98, 0xC437, 0x9C99, 0xC438, 0x9C9A, 0xC439, 0x9C9B, 0xC43A, 0x9C9C, 0xC43B, 0x9C9D, + 0xC43C, 0xBEA2, 0xC43D, 0xBEA3, 0xC43E, 0x9C9E, 0xC43F, 0x9C9F, 0xC440, 0x9CA0, 0xC441, 0x9CA1, 0xC442, 0x9CA2, 0xC443, 0x9CA3, + 0xC444, 0x9CA4, 0xC445, 0x9CA5, 0xC446, 0x9CA6, 0xC447, 0x9CA7, 0xC448, 0xBEA4, 0xC449, 0x9CA8, 0xC44A, 0x9CA9, 0xC44B, 0x9CAA, + 0xC44C, 0x9CAB, 0xC44D, 0x9CAC, 0xC44E, 0x9CAD, 0xC44F, 0x9CAE, 0xC450, 0x9CAF, 0xC451, 0x9CB0, 0xC452, 0x9CB1, 0xC453, 0x9CB2, + 0xC454, 0x9CB3, 0xC455, 0x9CB4, 0xC456, 0x9CB5, 0xC457, 0x9CB6, 0xC458, 0x9CB7, 0xC459, 0x9CB8, 0xC45A, 0x9CB9, 0xC45B, 0x9CBA, + 0xC45C, 0x9CBB, 0xC45D, 0x9CBC, 0xC45E, 0x9CBD, 0xC45F, 0x9CBE, 0xC460, 0x9CBF, 0xC461, 0x9CC0, 0xC462, 0x9CC1, 0xC463, 0x9CC2, + 0xC464, 0xBEA5, 0xC465, 0xBEA6, 0xC466, 0x9CC3, 0xC467, 0x9CC4, 0xC468, 0xBEA7, 0xC469, 0x9CC5, 0xC46A, 0x9CC6, 0xC46B, 0x9CC7, + 0xC46C, 0xBEA8, 0xC46D, 0x9CC8, 0xC46E, 0x9CC9, 0xC46F, 0x9CCA, 0xC470, 0x9CCB, 0xC471, 0x9CCC, 0xC472, 0x9CCD, 0xC473, 0x9CCE, + 0xC474, 0xBEA9, 0xC475, 0xBEAA, 0xC476, 0x9CCF, 0xC477, 0x9CD0, 0xC478, 0x9CD1, 0xC479, 0xBEAB, 0xC47A, 0x9CD2, 0xC47B, 0x9CD3, + 0xC47C, 0x9CD4, 0xC47D, 0x9CD5, 0xC47E, 0x9CD6, 0xC47F, 0x9CD7, 0xC480, 0xBEAC, 0xC481, 0x9CD8, 0xC482, 0x9CD9, 0xC483, 0x9CDA, + 0xC484, 0x9CDB, 0xC485, 0x9CDC, 0xC486, 0x9CDD, 0xC487, 0x9CDE, 0xC488, 0x9CDF, 0xC489, 0x9CE0, 0xC48A, 0x9CE1, 0xC48B, 0x9CE2, + 0xC48C, 0x9CE3, 0xC48D, 0x9CE4, 0xC48E, 0x9CE5, 0xC48F, 0x9CE6, 0xC490, 0x9CE7, 0xC491, 0x9CE8, 0xC492, 0x9CE9, 0xC493, 0x9CEA, + 0xC494, 0xBEAD, 0xC495, 0x9CEB, 0xC496, 0x9CEC, 0xC497, 0x9CED, 0xC498, 0x9CEE, 0xC499, 0x9CEF, 0xC49A, 0x9CF0, 0xC49B, 0x9CF1, + 0xC49C, 0xBEAE, 0xC49D, 0x9CF2, 0xC49E, 0x9CF3, 0xC49F, 0x9CF4, 0xC4A0, 0x9CF5, 0xC4A1, 0x9CF6, 0xC4A2, 0x9CF7, 0xC4A3, 0x9CF8, + 0xC4A4, 0x9CF9, 0xC4A5, 0x9CFA, 0xC4A6, 0x9CFB, 0xC4A7, 0x9CFC, 0xC4A8, 0x9CFD, 0xC4A9, 0x9CFE, 0xC4AA, 0x9D41, 0xC4AB, 0x9D42, + 0xC4AC, 0x9D43, 0xC4AD, 0x9D44, 0xC4AE, 0x9D45, 0xC4AF, 0x9D46, 0xC4B0, 0x9D47, 0xC4B1, 0x9D48, 0xC4B2, 0x9D49, 0xC4B3, 0x9D4A, + 0xC4B4, 0x9D4B, 0xC4B5, 0x9D4C, 0xC4B6, 0x9D4D, 0xC4B7, 0x9D4E, 0xC4B8, 0xBEAF, 0xC4B9, 0x9D4F, 0xC4BA, 0x9D50, 0xC4BB, 0x9D51, + 0xC4BC, 0xBEB0, 0xC4BD, 0x9D52, 0xC4BE, 0x9D53, 0xC4BF, 0x9D54, 0xC4C0, 0x9D55, 0xC4C1, 0x9D56, 0xC4C2, 0x9D57, 0xC4C3, 0x9D58, + 0xC4C4, 0x9D59, 0xC4C5, 0x9D5A, 0xC4C6, 0x9D61, 0xC4C7, 0x9D62, 0xC4C8, 0x9D63, 0xC4C9, 0x9D64, 0xC4CA, 0x9D65, 0xC4CB, 0x9D66, + 0xC4CC, 0x9D67, 0xC4CD, 0x9D68, 0xC4CE, 0x9D69, 0xC4CF, 0x9D6A, 0xC4D0, 0x9D6B, 0xC4D1, 0x9D6C, 0xC4D2, 0x9D6D, 0xC4D3, 0x9D6E, + 0xC4D4, 0x9D6F, 0xC4D5, 0x9D70, 0xC4D6, 0x9D71, 0xC4D7, 0x9D72, 0xC4D8, 0x9D73, 0xC4D9, 0x9D74, 0xC4DA, 0x9D75, 0xC4DB, 0x9D76, + 0xC4DC, 0x9D77, 0xC4DD, 0x9D78, 0xC4DE, 0x9D79, 0xC4DF, 0x9D7A, 0xC4E0, 0x9D81, 0xC4E1, 0x9D82, 0xC4E2, 0x9D83, 0xC4E3, 0x9D84, + 0xC4E4, 0x9D85, 0xC4E5, 0x9D86, 0xC4E6, 0x9D87, 0xC4E7, 0x9D88, 0xC4E8, 0x9D89, 0xC4E9, 0xBEB1, 0xC4EA, 0x9D8A, 0xC4EB, 0x9D8B, + 0xC4EC, 0x9D8C, 0xC4ED, 0x9D8D, 0xC4EE, 0x9D8E, 0xC4EF, 0x9D8F, 0xC4F0, 0xBEB2, 0xC4F1, 0xBEB3, 0xC4F2, 0x9D90, 0xC4F3, 0x9D91, + 0xC4F4, 0xBEB4, 0xC4F5, 0x9D92, 0xC4F6, 0x9D93, 0xC4F7, 0x9D94, 0xC4F8, 0xBEB5, 0xC4F9, 0x9D95, 0xC4FA, 0xBEB6, 0xC4FB, 0x9D96, + 0xC4FC, 0x9D97, 0xC4FD, 0x9D98, 0xC4FE, 0x9D99, 0xC4FF, 0xBEB7, 0xC500, 0xBEB8, 0xC501, 0xBEB9, 0xC502, 0x9D9A, 0xC503, 0x9D9B, + 0xC504, 0x9D9C, 0xC505, 0x9D9D, 0xC506, 0x9D9E, 0xC507, 0x9D9F, 0xC508, 0x9DA0, 0xC509, 0x9DA1, 0xC50A, 0x9DA2, 0xC50B, 0x9DA3, + 0xC50C, 0xBEBA, 0xC50D, 0x9DA4, 0xC50E, 0x9DA5, 0xC50F, 0x9DA6, 0xC510, 0xBEBB, 0xC511, 0x9DA7, 0xC512, 0x9DA8, 0xC513, 0x9DA9, + 0xC514, 0xBEBC, 0xC515, 0x9DAA, 0xC516, 0x9DAB, 0xC517, 0x9DAC, 0xC518, 0x9DAD, 0xC519, 0x9DAE, 0xC51A, 0x9DAF, 0xC51B, 0x9DB0, + 0xC51C, 0xBEBD, 0xC51D, 0x9DB1, 0xC51E, 0x9DB2, 0xC51F, 0x9DB3, 0xC520, 0x9DB4, 0xC521, 0x9DB5, 0xC522, 0x9DB6, 0xC523, 0x9DB7, + 0xC524, 0x9DB8, 0xC525, 0x9DB9, 0xC526, 0x9DBA, 0xC527, 0x9DBB, 0xC528, 0xBEBE, 0xC529, 0xBEBF, 0xC52A, 0x9DBC, 0xC52B, 0x9DBD, + 0xC52C, 0xBEC0, 0xC52D, 0x9DBE, 0xC52E, 0x9DBF, 0xC52F, 0x9DC0, 0xC530, 0xBEC1, 0xC531, 0x9DC1, 0xC532, 0x9DC2, 0xC533, 0x9DC3, + 0xC534, 0x9DC4, 0xC535, 0x9DC5, 0xC536, 0x9DC6, 0xC537, 0x9DC7, 0xC538, 0xBEC2, 0xC539, 0xBEC3, 0xC53A, 0x9DC8, 0xC53B, 0xBEC4, + 0xC53C, 0x9DC9, 0xC53D, 0xBEC5, 0xC53E, 0x9DCA, 0xC53F, 0x9DCB, 0xC540, 0x9DCC, 0xC541, 0x9DCD, 0xC542, 0x9DCE, 0xC543, 0x9DCF, + 0xC544, 0xBEC6, 0xC545, 0xBEC7, 0xC546, 0x9DD0, 0xC547, 0x9DD1, 0xC548, 0xBEC8, 0xC549, 0xBEC9, 0xC54A, 0xBECA, 0xC54B, 0x9DD2, + 0xC54C, 0xBECB, 0xC54D, 0xBECC, 0xC54E, 0xBECD, 0xC54F, 0x9DD3, 0xC550, 0x9DD4, 0xC551, 0x9DD5, 0xC552, 0x9DD6, 0xC553, 0xBECE, + 0xC554, 0xBECF, 0xC555, 0xBED0, 0xC556, 0x9DD7, 0xC557, 0xBED1, 0xC558, 0xBED2, 0xC559, 0xBED3, 0xC55A, 0x9DD8, 0xC55B, 0x9DD9, + 0xC55C, 0x9DDA, 0xC55D, 0xBED4, 0xC55E, 0xBED5, 0xC55F, 0x9DDB, 0xC560, 0xBED6, 0xC561, 0xBED7, 0xC562, 0x9DDC, 0xC563, 0x9DDD, + 0xC564, 0xBED8, 0xC565, 0x9DDE, 0xC566, 0x9DDF, 0xC567, 0x9DE0, 0xC568, 0xBED9, 0xC569, 0x9DE1, 0xC56A, 0x9DE2, 0xC56B, 0x9DE3, + 0xC56C, 0x9DE4, 0xC56D, 0x9DE5, 0xC56E, 0x9DE6, 0xC56F, 0x9DE7, 0xC570, 0xBEDA, 0xC571, 0xBEDB, 0xC572, 0x9DE8, 0xC573, 0xBEDC, + 0xC574, 0xBEDD, 0xC575, 0xBEDE, 0xC576, 0x9DE9, 0xC577, 0x9DEA, 0xC578, 0x9DEB, 0xC579, 0x9DEC, 0xC57A, 0x9DED, 0xC57B, 0x9DEE, + 0xC57C, 0xBEDF, 0xC57D, 0xBEE0, 0xC57E, 0x9DEF, 0xC57F, 0x9DF0, 0xC580, 0xBEE1, 0xC581, 0x9DF1, 0xC582, 0x9DF2, 0xC583, 0x9DF3, + 0xC584, 0xBEE2, 0xC585, 0x9DF4, 0xC586, 0x9DF5, 0xC587, 0xBEE3, 0xC588, 0x9DF6, 0xC589, 0x9DF7, 0xC58A, 0x9DF8, 0xC58B, 0x9DF9, + 0xC58C, 0xBEE4, 0xC58D, 0xBEE5, 0xC58E, 0x9DFA, 0xC58F, 0xBEE6, 0xC590, 0x9DFB, 0xC591, 0xBEE7, 0xC592, 0x9DFC, 0xC593, 0x9DFD, + 0xC594, 0x9DFE, 0xC595, 0xBEE8, 0xC596, 0x9E41, 0xC597, 0xBEE9, 0xC598, 0xBEEA, 0xC599, 0x9E42, 0xC59A, 0x9E43, 0xC59B, 0x9E44, + 0xC59C, 0xBEEB, 0xC59D, 0x9E45, 0xC59E, 0x9E46, 0xC59F, 0x9E47, 0xC5A0, 0xBEEC, 0xC5A1, 0x9E48, 0xC5A2, 0x9E49, 0xC5A3, 0x9E4A, + 0xC5A4, 0x9E4B, 0xC5A5, 0x9E4C, 0xC5A6, 0x9E4D, 0xC5A7, 0x9E4E, 0xC5A8, 0x9E4F, 0xC5A9, 0xBEED, 0xC5AA, 0x9E50, 0xC5AB, 0x9E51, + 0xC5AC, 0x9E52, 0xC5AD, 0x9E53, 0xC5AE, 0x9E54, 0xC5AF, 0x9E55, 0xC5B0, 0x9E56, 0xC5B1, 0x9E57, 0xC5B2, 0x9E58, 0xC5B3, 0x9E59, + 0xC5B4, 0xBEEE, 0xC5B5, 0xBEEF, 0xC5B6, 0x9E5A, 0xC5B7, 0x9E61, 0xC5B8, 0xBEF0, 0xC5B9, 0xBEF1, 0xC5BA, 0x9E62, 0xC5BB, 0xBEF2, + 0xC5BC, 0xBEF3, 0xC5BD, 0xBEF4, 0xC5BE, 0xBEF5, 0xC5BF, 0x9E63, 0xC5C0, 0x9E64, 0xC5C1, 0x9E65, 0xC5C2, 0x9E66, 0xC5C3, 0x9E67, + 0xC5C4, 0xBEF6, 0xC5C5, 0xBEF7, 0xC5C6, 0xBEF8, 0xC5C7, 0xBEF9, 0xC5C8, 0xBEFA, 0xC5C9, 0xBEFB, 0xC5CA, 0xBEFC, 0xC5CB, 0x9E68, + 0xC5CC, 0xBEFD, 0xC5CD, 0x9E69, 0xC5CE, 0xBEFE, 0xC5CF, 0x9E6A, 0xC5D0, 0xBFA1, 0xC5D1, 0xBFA2, 0xC5D2, 0x9E6B, 0xC5D3, 0x9E6C, + 0xC5D4, 0xBFA3, 0xC5D5, 0x9E6D, 0xC5D6, 0x9E6E, 0xC5D7, 0x9E6F, 0xC5D8, 0xBFA4, 0xC5D9, 0x9E70, 0xC5DA, 0x9E71, 0xC5DB, 0x9E72, + 0xC5DC, 0x9E73, 0xC5DD, 0x9E74, 0xC5DE, 0x9E75, 0xC5DF, 0x9E76, 0xC5E0, 0xBFA5, 0xC5E1, 0xBFA6, 0xC5E2, 0x9E77, 0xC5E3, 0xBFA7, + 0xC5E4, 0x9E78, 0xC5E5, 0xBFA8, 0xC5E6, 0x9E79, 0xC5E7, 0x9E7A, 0xC5E8, 0x9E81, 0xC5E9, 0x9E82, 0xC5EA, 0x9E83, 0xC5EB, 0x9E84, + 0xC5EC, 0xBFA9, 0xC5ED, 0xBFAA, 0xC5EE, 0xBFAB, 0xC5EF, 0x9E85, 0xC5F0, 0xBFAC, 0xC5F1, 0x9E86, 0xC5F2, 0x9E87, 0xC5F3, 0x9E88, + 0xC5F4, 0xBFAD, 0xC5F5, 0x9E89, 0xC5F6, 0xBFAE, 0xC5F7, 0xBFAF, 0xC5F8, 0x9E8A, 0xC5F9, 0x9E8B, 0xC5FA, 0x9E8C, 0xC5FB, 0x9E8D, + 0xC5FC, 0xBFB0, 0xC5FD, 0xBFB1, 0xC5FE, 0xBFB2, 0xC5FF, 0xBFB3, 0xC600, 0xBFB4, 0xC601, 0xBFB5, 0xC602, 0x9E8E, 0xC603, 0x9E8F, + 0xC604, 0x9E90, 0xC605, 0xBFB6, 0xC606, 0xBFB7, 0xC607, 0xBFB8, 0xC608, 0xBFB9, 0xC609, 0x9E91, 0xC60A, 0x9E92, 0xC60B, 0x9E93, + 0xC60C, 0xBFBA, 0xC60D, 0x9E94, 0xC60E, 0x9E95, 0xC60F, 0x9E96, 0xC610, 0xBFBB, 0xC611, 0x9E97, 0xC612, 0x9E98, 0xC613, 0x9E99, + 0xC614, 0x9E9A, 0xC615, 0x9E9B, 0xC616, 0x9E9C, 0xC617, 0x9E9D, 0xC618, 0xBFBC, 0xC619, 0xBFBD, 0xC61A, 0x9E9E, 0xC61B, 0xBFBE, + 0xC61C, 0xBFBF, 0xC61D, 0x9E9F, 0xC61E, 0x9EA0, 0xC61F, 0x9EA1, 0xC620, 0x9EA2, 0xC621, 0x9EA3, 0xC622, 0x9EA4, 0xC623, 0x9EA5, + 0xC624, 0xBFC0, 0xC625, 0xBFC1, 0xC626, 0x9EA6, 0xC627, 0x9EA7, 0xC628, 0xBFC2, 0xC629, 0x9EA8, 0xC62A, 0x9EA9, 0xC62B, 0x9EAA, + 0xC62C, 0xBFC3, 0xC62D, 0xBFC4, 0xC62E, 0xBFC5, 0xC62F, 0x9EAB, 0xC630, 0xBFC6, 0xC631, 0x9EAC, 0xC632, 0x9EAD, 0xC633, 0xBFC7, + 0xC634, 0xBFC8, 0xC635, 0xBFC9, 0xC636, 0x9EAE, 0xC637, 0xBFCA, 0xC638, 0x9EAF, 0xC639, 0xBFCB, 0xC63A, 0x9EB0, 0xC63B, 0xBFCC, + 0xC63C, 0x9EB1, 0xC63D, 0x9EB2, 0xC63E, 0x9EB3, 0xC63F, 0x9EB4, 0xC640, 0xBFCD, 0xC641, 0xBFCE, 0xC642, 0x9EB5, 0xC643, 0x9EB6, + 0xC644, 0xBFCF, 0xC645, 0x9EB7, 0xC646, 0x9EB8, 0xC647, 0x9EB9, 0xC648, 0xBFD0, 0xC649, 0x9EBA, 0xC64A, 0x9EBB, 0xC64B, 0x9EBC, + 0xC64C, 0x9EBD, 0xC64D, 0x9EBE, 0xC64E, 0x9EBF, 0xC64F, 0x9EC0, 0xC650, 0xBFD1, 0xC651, 0xBFD2, 0xC652, 0x9EC1, 0xC653, 0xBFD3, + 0xC654, 0xBFD4, 0xC655, 0xBFD5, 0xC656, 0x9EC2, 0xC657, 0x9EC3, 0xC658, 0x9EC4, 0xC659, 0x9EC5, 0xC65A, 0x9EC6, 0xC65B, 0x9EC7, + 0xC65C, 0xBFD6, 0xC65D, 0xBFD7, 0xC65E, 0x9EC8, 0xC65F, 0x9EC9, 0xC660, 0xBFD8, 0xC661, 0x9ECA, 0xC662, 0x9ECB, 0xC663, 0x9ECC, + 0xC664, 0x9ECD, 0xC665, 0x9ECE, 0xC666, 0x9ECF, 0xC667, 0x9ED0, 0xC668, 0x9ED1, 0xC669, 0x9ED2, 0xC66A, 0x9ED3, 0xC66B, 0x9ED4, + 0xC66C, 0xBFD9, 0xC66D, 0x9ED5, 0xC66E, 0x9ED6, 0xC66F, 0xBFDA, 0xC670, 0x9ED7, 0xC671, 0xBFDB, 0xC672, 0x9ED8, 0xC673, 0x9ED9, + 0xC674, 0x9EDA, 0xC675, 0x9EDB, 0xC676, 0x9EDC, 0xC677, 0x9EDD, 0xC678, 0xBFDC, 0xC679, 0xBFDD, 0xC67A, 0x9EDE, 0xC67B, 0x9EDF, + 0xC67C, 0xBFDE, 0xC67D, 0x9EE0, 0xC67E, 0x9EE1, 0xC67F, 0x9EE2, 0xC680, 0xBFDF, 0xC681, 0x9EE3, 0xC682, 0x9EE4, 0xC683, 0x9EE5, + 0xC684, 0x9EE6, 0xC685, 0x9EE7, 0xC686, 0x9EE8, 0xC687, 0x9EE9, 0xC688, 0xBFE0, 0xC689, 0xBFE1, 0xC68A, 0x9EEA, 0xC68B, 0xBFE2, + 0xC68C, 0x9EEB, 0xC68D, 0xBFE3, 0xC68E, 0x9EEC, 0xC68F, 0x9EED, 0xC690, 0x9EEE, 0xC691, 0x9EEF, 0xC692, 0x9EF0, 0xC693, 0x9EF1, + 0xC694, 0xBFE4, 0xC695, 0xBFE5, 0xC696, 0x9EF2, 0xC697, 0x9EF3, 0xC698, 0xBFE6, 0xC699, 0x9EF4, 0xC69A, 0x9EF5, 0xC69B, 0x9EF6, + 0xC69C, 0xBFE7, 0xC69D, 0x9EF7, 0xC69E, 0x9EF8, 0xC69F, 0x9EF9, 0xC6A0, 0x9EFA, 0xC6A1, 0x9EFB, 0xC6A2, 0x9EFC, 0xC6A3, 0x9EFD, + 0xC6A4, 0xBFE8, 0xC6A5, 0xBFE9, 0xC6A6, 0x9EFE, 0xC6A7, 0xBFEA, 0xC6A8, 0x9F41, 0xC6A9, 0xBFEB, 0xC6AA, 0x9F42, 0xC6AB, 0x9F43, + 0xC6AC, 0x9F44, 0xC6AD, 0x9F45, 0xC6AE, 0x9F46, 0xC6AF, 0x9F47, 0xC6B0, 0xBFEC, 0xC6B1, 0xBFED, 0xC6B2, 0x9F48, 0xC6B3, 0x9F49, + 0xC6B4, 0xBFEE, 0xC6B5, 0x9F4A, 0xC6B6, 0x9F4B, 0xC6B7, 0x9F4C, 0xC6B8, 0xBFEF, 0xC6B9, 0xBFF0, 0xC6BA, 0xBFF1, 0xC6BB, 0x9F4D, + 0xC6BC, 0x9F4E, 0xC6BD, 0x9F4F, 0xC6BE, 0x9F50, 0xC6BF, 0x9F51, 0xC6C0, 0xBFF2, 0xC6C1, 0xBFF3, 0xC6C2, 0x9F52, 0xC6C3, 0xBFF4, + 0xC6C4, 0x9F53, 0xC6C5, 0xBFF5, 0xC6C6, 0x9F54, 0xC6C7, 0x9F55, 0xC6C8, 0x9F56, 0xC6C9, 0x9F57, 0xC6CA, 0x9F58, 0xC6CB, 0x9F59, + 0xC6CC, 0xBFF6, 0xC6CD, 0xBFF7, 0xC6CE, 0x9F5A, 0xC6CF, 0x9F61, 0xC6D0, 0xBFF8, 0xC6D1, 0x9F62, 0xC6D2, 0x9F63, 0xC6D3, 0x9F64, + 0xC6D4, 0xBFF9, 0xC6D5, 0x9F65, 0xC6D6, 0x9F66, 0xC6D7, 0x9F67, 0xC6D8, 0x9F68, 0xC6D9, 0x9F69, 0xC6DA, 0x9F6A, 0xC6DB, 0x9F6B, + 0xC6DC, 0xBFFA, 0xC6DD, 0xBFFB, 0xC6DE, 0x9F6C, 0xC6DF, 0x9F6D, 0xC6E0, 0xBFFC, 0xC6E1, 0xBFFD, 0xC6E2, 0x9F6E, 0xC6E3, 0x9F6F, + 0xC6E4, 0x9F70, 0xC6E5, 0x9F71, 0xC6E6, 0x9F72, 0xC6E7, 0x9F73, 0xC6E8, 0xBFFE, 0xC6E9, 0xC0A1, 0xC6EA, 0x9F74, 0xC6EB, 0x9F75, + 0xC6EC, 0xC0A2, 0xC6ED, 0x9F76, 0xC6EE, 0x9F77, 0xC6EF, 0x9F78, 0xC6F0, 0xC0A3, 0xC6F1, 0x9F79, 0xC6F2, 0x9F7A, 0xC6F3, 0x9F81, + 0xC6F4, 0x9F82, 0xC6F5, 0x9F83, 0xC6F6, 0x9F84, 0xC6F7, 0x9F85, 0xC6F8, 0xC0A4, 0xC6F9, 0xC0A5, 0xC6FA, 0x9F86, 0xC6FB, 0x9F87, + 0xC6FC, 0x9F88, 0xC6FD, 0xC0A6, 0xC6FE, 0x9F89, 0xC6FF, 0x9F8A, 0xC700, 0x9F8B, 0xC701, 0x9F8C, 0xC702, 0x9F8D, 0xC703, 0x9F8E, + 0xC704, 0xC0A7, 0xC705, 0xC0A8, 0xC706, 0x9F8F, 0xC707, 0x9F90, 0xC708, 0xC0A9, 0xC709, 0x9F91, 0xC70A, 0x9F92, 0xC70B, 0x9F93, + 0xC70C, 0xC0AA, 0xC70D, 0x9F94, 0xC70E, 0x9F95, 0xC70F, 0x9F96, 0xC710, 0x9F97, 0xC711, 0x9F98, 0xC712, 0x9F99, 0xC713, 0x9F9A, + 0xC714, 0xC0AB, 0xC715, 0xC0AC, 0xC716, 0x9F9B, 0xC717, 0xC0AD, 0xC718, 0x9F9C, 0xC719, 0xC0AE, 0xC71A, 0x9F9D, 0xC71B, 0x9F9E, + 0xC71C, 0x9F9F, 0xC71D, 0x9FA0, 0xC71E, 0x9FA1, 0xC71F, 0x9FA2, 0xC720, 0xC0AF, 0xC721, 0xC0B0, 0xC722, 0x9FA3, 0xC723, 0x9FA4, + 0xC724, 0xC0B1, 0xC725, 0x9FA5, 0xC726, 0x9FA6, 0xC727, 0x9FA7, 0xC728, 0xC0B2, 0xC729, 0x9FA8, 0xC72A, 0x9FA9, 0xC72B, 0x9FAA, + 0xC72C, 0x9FAB, 0xC72D, 0x9FAC, 0xC72E, 0x9FAD, 0xC72F, 0x9FAE, 0xC730, 0xC0B3, 0xC731, 0xC0B4, 0xC732, 0x9FAF, 0xC733, 0xC0B5, + 0xC734, 0x9FB0, 0xC735, 0xC0B6, 0xC736, 0x9FB1, 0xC737, 0xC0B7, 0xC738, 0x9FB2, 0xC739, 0x9FB3, 0xC73A, 0x9FB4, 0xC73B, 0x9FB5, + 0xC73C, 0xC0B8, 0xC73D, 0xC0B9, 0xC73E, 0x9FB6, 0xC73F, 0x9FB7, 0xC740, 0xC0BA, 0xC741, 0x9FB8, 0xC742, 0x9FB9, 0xC743, 0x9FBA, + 0xC744, 0xC0BB, 0xC745, 0x9FBB, 0xC746, 0x9FBC, 0xC747, 0x9FBD, 0xC748, 0x9FBE, 0xC749, 0x9FBF, 0xC74A, 0xC0BC, 0xC74B, 0x9FC0, + 0xC74C, 0xC0BD, 0xC74D, 0xC0BE, 0xC74E, 0x9FC1, 0xC74F, 0xC0BF, 0xC750, 0x9FC2, 0xC751, 0xC0C0, 0xC752, 0xC0C1, 0xC753, 0xC0C2, + 0xC754, 0xC0C3, 0xC755, 0xC0C4, 0xC756, 0xC0C5, 0xC757, 0xC0C6, 0xC758, 0xC0C7, 0xC759, 0x9FC3, 0xC75A, 0x9FC4, 0xC75B, 0x9FC5, + 0xC75C, 0xC0C8, 0xC75D, 0x9FC6, 0xC75E, 0x9FC7, 0xC75F, 0x9FC8, 0xC760, 0xC0C9, 0xC761, 0x9FC9, 0xC762, 0x9FCA, 0xC763, 0x9FCB, + 0xC764, 0x9FCC, 0xC765, 0x9FCD, 0xC766, 0x9FCE, 0xC767, 0x9FCF, 0xC768, 0xC0CA, 0xC769, 0x9FD0, 0xC76A, 0x9FD1, 0xC76B, 0xC0CB, + 0xC76C, 0x9FD2, 0xC76D, 0x9FD3, 0xC76E, 0x9FD4, 0xC76F, 0x9FD5, 0xC770, 0x9FD6, 0xC771, 0x9FD7, 0xC772, 0x9FD8, 0xC773, 0x9FD9, + 0xC774, 0xC0CC, 0xC775, 0xC0CD, 0xC776, 0x9FDA, 0xC777, 0x9FDB, 0xC778, 0xC0CE, 0xC779, 0x9FDC, 0xC77A, 0x9FDD, 0xC77B, 0x9FDE, + 0xC77C, 0xC0CF, 0xC77D, 0xC0D0, 0xC77E, 0xC0D1, 0xC77F, 0x9FDF, 0xC780, 0x9FE0, 0xC781, 0x9FE1, 0xC782, 0x9FE2, 0xC783, 0xC0D2, + 0xC784, 0xC0D3, 0xC785, 0xC0D4, 0xC786, 0x9FE3, 0xC787, 0xC0D5, 0xC788, 0xC0D6, 0xC789, 0xC0D7, 0xC78A, 0xC0D8, 0xC78B, 0x9FE4, + 0xC78C, 0x9FE5, 0xC78D, 0x9FE6, 0xC78E, 0xC0D9, 0xC78F, 0x9FE7, 0xC790, 0xC0DA, 0xC791, 0xC0DB, 0xC792, 0x9FE8, 0xC793, 0x9FE9, + 0xC794, 0xC0DC, 0xC795, 0x9FEA, 0xC796, 0xC0DD, 0xC797, 0xC0DE, 0xC798, 0xC0DF, 0xC799, 0x9FEB, 0xC79A, 0xC0E0, 0xC79B, 0x9FEC, + 0xC79C, 0x9FED, 0xC79D, 0x9FEE, 0xC79E, 0x9FEF, 0xC79F, 0x9FF0, 0xC7A0, 0xC0E1, 0xC7A1, 0xC0E2, 0xC7A2, 0x9FF1, 0xC7A3, 0xC0E3, + 0xC7A4, 0xC0E4, 0xC7A5, 0xC0E5, 0xC7A6, 0xC0E6, 0xC7A7, 0x9FF2, 0xC7A8, 0x9FF3, 0xC7A9, 0x9FF4, 0xC7AA, 0x9FF5, 0xC7AB, 0x9FF6, + 0xC7AC, 0xC0E7, 0xC7AD, 0xC0E8, 0xC7AE, 0x9FF7, 0xC7AF, 0x9FF8, 0xC7B0, 0xC0E9, 0xC7B1, 0x9FF9, 0xC7B2, 0x9FFA, 0xC7B3, 0x9FFB, + 0xC7B4, 0xC0EA, 0xC7B5, 0x9FFC, 0xC7B6, 0x9FFD, 0xC7B7, 0x9FFE, 0xC7B8, 0xA041, 0xC7B9, 0xA042, 0xC7BA, 0xA043, 0xC7BB, 0xA044, + 0xC7BC, 0xC0EB, 0xC7BD, 0xC0EC, 0xC7BE, 0xA045, 0xC7BF, 0xC0ED, 0xC7C0, 0xC0EE, 0xC7C1, 0xC0EF, 0xC7C2, 0xA046, 0xC7C3, 0xA047, + 0xC7C4, 0xA048, 0xC7C5, 0xA049, 0xC7C6, 0xA04A, 0xC7C7, 0xA04B, 0xC7C8, 0xC0F0, 0xC7C9, 0xC0F1, 0xC7CA, 0xA04C, 0xC7CB, 0xA04D, + 0xC7CC, 0xC0F2, 0xC7CD, 0xA04E, 0xC7CE, 0xC0F3, 0xC7CF, 0xA04F, 0xC7D0, 0xC0F4, 0xC7D1, 0xA050, 0xC7D2, 0xA051, 0xC7D3, 0xA052, + 0xC7D4, 0xA053, 0xC7D5, 0xA054, 0xC7D6, 0xA055, 0xC7D7, 0xA056, 0xC7D8, 0xC0F5, 0xC7D9, 0xA057, 0xC7DA, 0xA058, 0xC7DB, 0xA059, + 0xC7DC, 0xA05A, 0xC7DD, 0xC0F6, 0xC7DE, 0xA061, 0xC7DF, 0xA062, 0xC7E0, 0xA063, 0xC7E1, 0xA064, 0xC7E2, 0xA065, 0xC7E3, 0xA066, + 0xC7E4, 0xC0F7, 0xC7E5, 0xA067, 0xC7E6, 0xA068, 0xC7E7, 0xA069, 0xC7E8, 0xC0F8, 0xC7E9, 0xA06A, 0xC7EA, 0xA06B, 0xC7EB, 0xA06C, + 0xC7EC, 0xC0F9, 0xC7ED, 0xA06D, 0xC7EE, 0xA06E, 0xC7EF, 0xA06F, 0xC7F0, 0xA070, 0xC7F1, 0xA071, 0xC7F2, 0xA072, 0xC7F3, 0xA073, + 0xC7F4, 0xA074, 0xC7F5, 0xA075, 0xC7F6, 0xA076, 0xC7F7, 0xA077, 0xC7F8, 0xA078, 0xC7F9, 0xA079, 0xC7FA, 0xA07A, 0xC7FB, 0xA081, + 0xC7FC, 0xA082, 0xC7FD, 0xA083, 0xC7FE, 0xA084, 0xC7FF, 0xA085, 0xC800, 0xC0FA, 0xC801, 0xC0FB, 0xC802, 0xA086, 0xC803, 0xA087, + 0xC804, 0xC0FC, 0xC805, 0xA088, 0xC806, 0xA089, 0xC807, 0xA08A, 0xC808, 0xC0FD, 0xC809, 0xA08B, 0xC80A, 0xC0FE, 0xC80B, 0xA08C, + 0xC80C, 0xA08D, 0xC80D, 0xA08E, 0xC80E, 0xA08F, 0xC80F, 0xA090, 0xC810, 0xC1A1, 0xC811, 0xC1A2, 0xC812, 0xA091, 0xC813, 0xC1A3, + 0xC814, 0xA092, 0xC815, 0xC1A4, 0xC816, 0xC1A5, 0xC817, 0xA093, 0xC818, 0xA094, 0xC819, 0xA095, 0xC81A, 0xA096, 0xC81B, 0xA097, + 0xC81C, 0xC1A6, 0xC81D, 0xC1A7, 0xC81E, 0xA098, 0xC81F, 0xA099, 0xC820, 0xC1A8, 0xC821, 0xA09A, 0xC822, 0xA09B, 0xC823, 0xA09C, + 0xC824, 0xC1A9, 0xC825, 0xA09D, 0xC826, 0xA09E, 0xC827, 0xA09F, 0xC828, 0xA0A0, 0xC829, 0xA0A1, 0xC82A, 0xA0A2, 0xC82B, 0xA0A3, + 0xC82C, 0xC1AA, 0xC82D, 0xC1AB, 0xC82E, 0xA0A4, 0xC82F, 0xC1AC, 0xC830, 0xA0A5, 0xC831, 0xC1AD, 0xC832, 0xA0A6, 0xC833, 0xA0A7, + 0xC834, 0xA0A8, 0xC835, 0xA0A9, 0xC836, 0xA0AA, 0xC837, 0xA0AB, 0xC838, 0xC1AE, 0xC839, 0xA0AC, 0xC83A, 0xA0AD, 0xC83B, 0xA0AE, + 0xC83C, 0xC1AF, 0xC83D, 0xA0AF, 0xC83E, 0xA0B0, 0xC83F, 0xA0B1, 0xC840, 0xC1B0, 0xC841, 0xA0B2, 0xC842, 0xA0B3, 0xC843, 0xA0B4, + 0xC844, 0xA0B5, 0xC845, 0xA0B6, 0xC846, 0xA0B7, 0xC847, 0xA0B8, 0xC848, 0xC1B1, 0xC849, 0xC1B2, 0xC84A, 0xA0B9, 0xC84B, 0xA0BA, + 0xC84C, 0xC1B3, 0xC84D, 0xC1B4, 0xC84E, 0xA0BB, 0xC84F, 0xA0BC, 0xC850, 0xA0BD, 0xC851, 0xA0BE, 0xC852, 0xA0BF, 0xC853, 0xA0C0, + 0xC854, 0xC1B5, 0xC855, 0xA0C1, 0xC856, 0xA0C2, 0xC857, 0xA0C3, 0xC858, 0xA0C4, 0xC859, 0xA0C5, 0xC85A, 0xA0C6, 0xC85B, 0xA0C7, + 0xC85C, 0xA0C8, 0xC85D, 0xA0C9, 0xC85E, 0xA0CA, 0xC85F, 0xA0CB, 0xC860, 0xA0CC, 0xC861, 0xA0CD, 0xC862, 0xA0CE, 0xC863, 0xA0CF, + 0xC864, 0xA0D0, 0xC865, 0xA0D1, 0xC866, 0xA0D2, 0xC867, 0xA0D3, 0xC868, 0xA0D4, 0xC869, 0xA0D5, 0xC86A, 0xA0D6, 0xC86B, 0xA0D7, + 0xC86C, 0xA0D8, 0xC86D, 0xA0D9, 0xC86E, 0xA0DA, 0xC86F, 0xA0DB, 0xC870, 0xC1B6, 0xC871, 0xC1B7, 0xC872, 0xA0DC, 0xC873, 0xA0DD, + 0xC874, 0xC1B8, 0xC875, 0xA0DE, 0xC876, 0xA0DF, 0xC877, 0xA0E0, 0xC878, 0xC1B9, 0xC879, 0xA0E1, 0xC87A, 0xC1BA, 0xC87B, 0xA0E2, + 0xC87C, 0xA0E3, 0xC87D, 0xA0E4, 0xC87E, 0xA0E5, 0xC87F, 0xA0E6, 0xC880, 0xC1BB, 0xC881, 0xC1BC, 0xC882, 0xA0E7, 0xC883, 0xC1BD, + 0xC884, 0xA0E8, 0xC885, 0xC1BE, 0xC886, 0xC1BF, 0xC887, 0xC1C0, 0xC888, 0xA0E9, 0xC889, 0xA0EA, 0xC88A, 0xA0EB, 0xC88B, 0xC1C1, + 0xC88C, 0xC1C2, 0xC88D, 0xC1C3, 0xC88E, 0xA0EC, 0xC88F, 0xA0ED, 0xC890, 0xA0EE, 0xC891, 0xA0EF, 0xC892, 0xA0F0, 0xC893, 0xA0F1, + 0xC894, 0xC1C4, 0xC895, 0xA0F2, 0xC896, 0xA0F3, 0xC897, 0xA0F4, 0xC898, 0xA0F5, 0xC899, 0xA0F6, 0xC89A, 0xA0F7, 0xC89B, 0xA0F8, + 0xC89C, 0xA0F9, 0xC89D, 0xC1C5, 0xC89E, 0xA0FA, 0xC89F, 0xC1C6, 0xC8A0, 0xA0FB, 0xC8A1, 0xC1C7, 0xC8A2, 0xA0FC, 0xC8A3, 0xA0FD, + 0xC8A4, 0xA0FE, 0xC8A5, 0xA141, 0xC8A6, 0xA142, 0xC8A7, 0xA143, 0xC8A8, 0xC1C8, 0xC8A9, 0xA144, 0xC8AA, 0xA145, 0xC8AB, 0xA146, + 0xC8AC, 0xA147, 0xC8AD, 0xA148, 0xC8AE, 0xA149, 0xC8AF, 0xA14A, 0xC8B0, 0xA14B, 0xC8B1, 0xA14C, 0xC8B2, 0xA14D, 0xC8B3, 0xA14E, + 0xC8B4, 0xA14F, 0xC8B5, 0xA150, 0xC8B6, 0xA151, 0xC8B7, 0xA152, 0xC8B8, 0xA153, 0xC8B9, 0xA154, 0xC8BA, 0xA155, 0xC8BB, 0xA156, + 0xC8BC, 0xC1C9, 0xC8BD, 0xC1CA, 0xC8BE, 0xA157, 0xC8BF, 0xA158, 0xC8C0, 0xA159, 0xC8C1, 0xA15A, 0xC8C2, 0xA161, 0xC8C3, 0xA162, + 0xC8C4, 0xC1CB, 0xC8C5, 0xA163, 0xC8C6, 0xA164, 0xC8C7, 0xA165, 0xC8C8, 0xC1CC, 0xC8C9, 0xA166, 0xC8CA, 0xA167, 0xC8CB, 0xA168, + 0xC8CC, 0xC1CD, 0xC8CD, 0xA169, 0xC8CE, 0xA16A, 0xC8CF, 0xA16B, 0xC8D0, 0xA16C, 0xC8D1, 0xA16D, 0xC8D2, 0xA16E, 0xC8D3, 0xA16F, + 0xC8D4, 0xC1CE, 0xC8D5, 0xC1CF, 0xC8D6, 0xA170, 0xC8D7, 0xC1D0, 0xC8D8, 0xA171, 0xC8D9, 0xC1D1, 0xC8DA, 0xA172, 0xC8DB, 0xA173, + 0xC8DC, 0xA174, 0xC8DD, 0xA175, 0xC8DE, 0xA176, 0xC8DF, 0xA177, 0xC8E0, 0xC1D2, 0xC8E1, 0xC1D3, 0xC8E2, 0xA178, 0xC8E3, 0xA179, + 0xC8E4, 0xC1D4, 0xC8E5, 0xA17A, 0xC8E6, 0xA181, 0xC8E7, 0xA182, 0xC8E8, 0xA183, 0xC8E9, 0xA184, 0xC8EA, 0xA185, 0xC8EB, 0xA186, + 0xC8EC, 0xA187, 0xC8ED, 0xA188, 0xC8EE, 0xA189, 0xC8EF, 0xA18A, 0xC8F0, 0xA18B, 0xC8F1, 0xA18C, 0xC8F2, 0xA18D, 0xC8F3, 0xA18E, + 0xC8F4, 0xA18F, 0xC8F5, 0xC1D5, 0xC8F6, 0xA190, 0xC8F7, 0xA191, 0xC8F8, 0xA192, 0xC8F9, 0xA193, 0xC8FA, 0xA194, 0xC8FB, 0xA195, + 0xC8FC, 0xC1D6, 0xC8FD, 0xC1D7, 0xC8FE, 0xA196, 0xC8FF, 0xA197, 0xC900, 0xC1D8, 0xC901, 0xA198, 0xC902, 0xA199, 0xC903, 0xA19A, + 0xC904, 0xC1D9, 0xC905, 0xC1DA, 0xC906, 0xC1DB, 0xC907, 0xA19B, 0xC908, 0xA19C, 0xC909, 0xA19D, 0xC90A, 0xA19E, 0xC90B, 0xA19F, + 0xC90C, 0xC1DC, 0xC90D, 0xC1DD, 0xC90E, 0xA1A0, 0xC90F, 0xC1DE, 0xC910, 0xA241, 0xC911, 0xC1DF, 0xC912, 0xA242, 0xC913, 0xA243, + 0xC914, 0xA244, 0xC915, 0xA245, 0xC916, 0xA246, 0xC917, 0xA247, 0xC918, 0xC1E0, 0xC919, 0xA248, 0xC91A, 0xA249, 0xC91B, 0xA24A, + 0xC91C, 0xA24B, 0xC91D, 0xA24C, 0xC91E, 0xA24D, 0xC91F, 0xA24E, 0xC920, 0xA24F, 0xC921, 0xA250, 0xC922, 0xA251, 0xC923, 0xA252, + 0xC924, 0xA253, 0xC925, 0xA254, 0xC926, 0xA255, 0xC927, 0xA256, 0xC928, 0xA257, 0xC929, 0xA258, 0xC92A, 0xA259, 0xC92B, 0xA25A, + 0xC92C, 0xC1E1, 0xC92D, 0xA261, 0xC92E, 0xA262, 0xC92F, 0xA263, 0xC930, 0xA264, 0xC931, 0xA265, 0xC932, 0xA266, 0xC933, 0xA267, + 0xC934, 0xC1E2, 0xC935, 0xA268, 0xC936, 0xA269, 0xC937, 0xA26A, 0xC938, 0xA26B, 0xC939, 0xA26C, 0xC93A, 0xA26D, 0xC93B, 0xA26E, + 0xC93C, 0xA26F, 0xC93D, 0xA270, 0xC93E, 0xA271, 0xC93F, 0xA272, 0xC940, 0xA273, 0xC941, 0xA274, 0xC942, 0xA275, 0xC943, 0xA276, + 0xC944, 0xA277, 0xC945, 0xA278, 0xC946, 0xA279, 0xC947, 0xA27A, 0xC948, 0xA281, 0xC949, 0xA282, 0xC94A, 0xA283, 0xC94B, 0xA284, + 0xC94C, 0xA285, 0xC94D, 0xA286, 0xC94E, 0xA287, 0xC94F, 0xA288, 0xC950, 0xC1E3, 0xC951, 0xC1E4, 0xC952, 0xA289, 0xC953, 0xA28A, + 0xC954, 0xC1E5, 0xC955, 0xA28B, 0xC956, 0xA28C, 0xC957, 0xA28D, 0xC958, 0xC1E6, 0xC959, 0xA28E, 0xC95A, 0xA28F, 0xC95B, 0xA290, + 0xC95C, 0xA291, 0xC95D, 0xA292, 0xC95E, 0xA293, 0xC95F, 0xA294, 0xC960, 0xC1E7, 0xC961, 0xC1E8, 0xC962, 0xA295, 0xC963, 0xC1E9, + 0xC964, 0xA296, 0xC965, 0xA297, 0xC966, 0xA298, 0xC967, 0xA299, 0xC968, 0xA29A, 0xC969, 0xA29B, 0xC96A, 0xA29C, 0xC96B, 0xA29D, + 0xC96C, 0xC1EA, 0xC96D, 0xA29E, 0xC96E, 0xA29F, 0xC96F, 0xA2A0, 0xC970, 0xC1EB, 0xC971, 0xA341, 0xC972, 0xA342, 0xC973, 0xA343, + 0xC974, 0xC1EC, 0xC975, 0xA344, 0xC976, 0xA345, 0xC977, 0xA346, 0xC978, 0xA347, 0xC979, 0xA348, 0xC97A, 0xA349, 0xC97B, 0xA34A, + 0xC97C, 0xC1ED, 0xC97D, 0xA34B, 0xC97E, 0xA34C, 0xC97F, 0xA34D, 0xC980, 0xA34E, 0xC981, 0xA34F, 0xC982, 0xA350, 0xC983, 0xA351, + 0xC984, 0xA352, 0xC985, 0xA353, 0xC986, 0xA354, 0xC987, 0xA355, 0xC988, 0xC1EE, 0xC989, 0xC1EF, 0xC98A, 0xA356, 0xC98B, 0xA357, + 0xC98C, 0xC1F0, 0xC98D, 0xA358, 0xC98E, 0xA359, 0xC98F, 0xA35A, 0xC990, 0xC1F1, 0xC991, 0xA361, 0xC992, 0xA362, 0xC993, 0xA363, + 0xC994, 0xA364, 0xC995, 0xA365, 0xC996, 0xA366, 0xC997, 0xA367, 0xC998, 0xC1F2, 0xC999, 0xC1F3, 0xC99A, 0xA368, 0xC99B, 0xC1F4, + 0xC99C, 0xA369, 0xC99D, 0xC1F5, 0xC99E, 0xA36A, 0xC99F, 0xA36B, 0xC9A0, 0xA36C, 0xC9A1, 0xA36D, 0xC9A2, 0xA36E, 0xC9A3, 0xA36F, + 0xC9A4, 0xA370, 0xC9A5, 0xA371, 0xC9A6, 0xA372, 0xC9A7, 0xA373, 0xC9A8, 0xA374, 0xC9A9, 0xA375, 0xC9AA, 0xA376, 0xC9AB, 0xA377, + 0xC9AC, 0xA378, 0xC9AD, 0xA379, 0xC9AE, 0xA37A, 0xC9AF, 0xA381, 0xC9B0, 0xA382, 0xC9B1, 0xA383, 0xC9B2, 0xA384, 0xC9B3, 0xA385, + 0xC9B4, 0xA386, 0xC9B5, 0xA387, 0xC9B6, 0xA388, 0xC9B7, 0xA389, 0xC9B8, 0xA38A, 0xC9B9, 0xA38B, 0xC9BA, 0xA38C, 0xC9BB, 0xA38D, + 0xC9BC, 0xA38E, 0xC9BD, 0xA38F, 0xC9BE, 0xA390, 0xC9BF, 0xA391, 0xC9C0, 0xC1F6, 0xC9C1, 0xC1F7, 0xC9C2, 0xA392, 0xC9C3, 0xA393, + 0xC9C4, 0xC1F8, 0xC9C5, 0xA394, 0xC9C6, 0xA395, 0xC9C7, 0xC1F9, 0xC9C8, 0xC1FA, 0xC9C9, 0xA396, 0xC9CA, 0xC1FB, 0xC9CB, 0xA397, + 0xC9CC, 0xA398, 0xC9CD, 0xA399, 0xC9CE, 0xA39A, 0xC9CF, 0xA39B, 0xC9D0, 0xC1FC, 0xC9D1, 0xC1FD, 0xC9D2, 0xA39C, 0xC9D3, 0xC1FE, + 0xC9D4, 0xA39D, 0xC9D5, 0xC2A1, 0xC9D6, 0xC2A2, 0xC9D7, 0xA39E, 0xC9D8, 0xA39F, 0xC9D9, 0xC2A3, 0xC9DA, 0xC2A4, 0xC9DB, 0xA3A0, + 0xC9DC, 0xC2A5, 0xC9DD, 0xC2A6, 0xC9DE, 0xA441, 0xC9DF, 0xA442, 0xC9E0, 0xC2A7, 0xC9E1, 0xA443, 0xC9E2, 0xC2A8, 0xC9E3, 0xA444, + 0xC9E4, 0xC2A9, 0xC9E5, 0xA445, 0xC9E6, 0xA446, 0xC9E7, 0xC2AA, 0xC9E8, 0xA447, 0xC9E9, 0xA448, 0xC9EA, 0xA449, 0xC9EB, 0xA44A, + 0xC9EC, 0xC2AB, 0xC9ED, 0xC2AC, 0xC9EE, 0xA44B, 0xC9EF, 0xC2AD, 0xC9F0, 0xC2AE, 0xC9F1, 0xC2AF, 0xC9F2, 0xA44C, 0xC9F3, 0xA44D, + 0xC9F4, 0xA44E, 0xC9F5, 0xA44F, 0xC9F6, 0xA450, 0xC9F7, 0xA451, 0xC9F8, 0xC2B0, 0xC9F9, 0xC2B1, 0xC9FA, 0xA452, 0xC9FB, 0xA453, + 0xC9FC, 0xC2B2, 0xC9FD, 0xA454, 0xC9FE, 0xA455, 0xC9FF, 0xA456, 0xCA00, 0xC2B3, 0xCA01, 0xA457, 0xCA02, 0xA458, 0xCA03, 0xA459, + 0xCA04, 0xA45A, 0xCA05, 0xA461, 0xCA06, 0xA462, 0xCA07, 0xA463, 0xCA08, 0xC2B4, 0xCA09, 0xC2B5, 0xCA0A, 0xA464, 0xCA0B, 0xC2B6, + 0xCA0C, 0xC2B7, 0xCA0D, 0xC2B8, 0xCA0E, 0xA465, 0xCA0F, 0xA466, 0xCA10, 0xA467, 0xCA11, 0xA468, 0xCA12, 0xA469, 0xCA13, 0xA46A, + 0xCA14, 0xC2B9, 0xCA15, 0xA46B, 0xCA16, 0xA46C, 0xCA17, 0xA46D, 0xCA18, 0xC2BA, 0xCA19, 0xA46E, 0xCA1A, 0xA46F, 0xCA1B, 0xA470, + 0xCA1C, 0xA471, 0xCA1D, 0xA472, 0xCA1E, 0xA473, 0xCA1F, 0xA474, 0xCA20, 0xA475, 0xCA21, 0xA476, 0xCA22, 0xA477, 0xCA23, 0xA478, + 0xCA24, 0xA479, 0xCA25, 0xA47A, 0xCA26, 0xA481, 0xCA27, 0xA482, 0xCA28, 0xA483, 0xCA29, 0xC2BB, 0xCA2A, 0xA484, 0xCA2B, 0xA485, + 0xCA2C, 0xA486, 0xCA2D, 0xA487, 0xCA2E, 0xA488, 0xCA2F, 0xA489, 0xCA30, 0xA48A, 0xCA31, 0xA48B, 0xCA32, 0xA48C, 0xCA33, 0xA48D, + 0xCA34, 0xA48E, 0xCA35, 0xA48F, 0xCA36, 0xA490, 0xCA37, 0xA491, 0xCA38, 0xA492, 0xCA39, 0xA493, 0xCA3A, 0xA494, 0xCA3B, 0xA495, + 0xCA3C, 0xA496, 0xCA3D, 0xA497, 0xCA3E, 0xA498, 0xCA3F, 0xA499, 0xCA40, 0xA49A, 0xCA41, 0xA49B, 0xCA42, 0xA49C, 0xCA43, 0xA49D, + 0xCA44, 0xA49E, 0xCA45, 0xA49F, 0xCA46, 0xA4A0, 0xCA47, 0xA541, 0xCA48, 0xA542, 0xCA49, 0xA543, 0xCA4A, 0xA544, 0xCA4B, 0xA545, + 0xCA4C, 0xC2BC, 0xCA4D, 0xC2BD, 0xCA4E, 0xA546, 0xCA4F, 0xA547, 0xCA50, 0xC2BE, 0xCA51, 0xA548, 0xCA52, 0xA549, 0xCA53, 0xA54A, + 0xCA54, 0xC2BF, 0xCA55, 0xA54B, 0xCA56, 0xA54C, 0xCA57, 0xA54D, 0xCA58, 0xA54E, 0xCA59, 0xA54F, 0xCA5A, 0xA550, 0xCA5B, 0xA551, + 0xCA5C, 0xC2C0, 0xCA5D, 0xC2C1, 0xCA5E, 0xA552, 0xCA5F, 0xC2C2, 0xCA60, 0xC2C3, 0xCA61, 0xC2C4, 0xCA62, 0xA553, 0xCA63, 0xA554, + 0xCA64, 0xA555, 0xCA65, 0xA556, 0xCA66, 0xA557, 0xCA67, 0xA558, 0xCA68, 0xC2C5, 0xCA69, 0xA559, 0xCA6A, 0xA55A, 0xCA6B, 0xA561, + 0xCA6C, 0xA562, 0xCA6D, 0xA563, 0xCA6E, 0xA564, 0xCA6F, 0xA565, 0xCA70, 0xA566, 0xCA71, 0xA567, 0xCA72, 0xA568, 0xCA73, 0xA569, + 0xCA74, 0xA56A, 0xCA75, 0xA56B, 0xCA76, 0xA56C, 0xCA77, 0xA56D, 0xCA78, 0xA56E, 0xCA79, 0xA56F, 0xCA7A, 0xA570, 0xCA7B, 0xA571, + 0xCA7C, 0xA572, 0xCA7D, 0xC2C6, 0xCA7E, 0xA573, 0xCA7F, 0xA574, 0xCA80, 0xA575, 0xCA81, 0xA576, 0xCA82, 0xA577, 0xCA83, 0xA578, + 0xCA84, 0xC2C7, 0xCA85, 0xA579, 0xCA86, 0xA57A, 0xCA87, 0xA581, 0xCA88, 0xA582, 0xCA89, 0xA583, 0xCA8A, 0xA584, 0xCA8B, 0xA585, + 0xCA8C, 0xA586, 0xCA8D, 0xA587, 0xCA8E, 0xA588, 0xCA8F, 0xA589, 0xCA90, 0xA58A, 0xCA91, 0xA58B, 0xCA92, 0xA58C, 0xCA93, 0xA58D, + 0xCA94, 0xA58E, 0xCA95, 0xA58F, 0xCA96, 0xA590, 0xCA97, 0xA591, 0xCA98, 0xC2C8, 0xCA99, 0xA592, 0xCA9A, 0xA593, 0xCA9B, 0xA594, + 0xCA9C, 0xA595, 0xCA9D, 0xA596, 0xCA9E, 0xA597, 0xCA9F, 0xA598, 0xCAA0, 0xA599, 0xCAA1, 0xA59A, 0xCAA2, 0xA59B, 0xCAA3, 0xA59C, + 0xCAA4, 0xA59D, 0xCAA5, 0xA59E, 0xCAA6, 0xA59F, 0xCAA7, 0xA5A0, 0xCAA8, 0xA641, 0xCAA9, 0xA642, 0xCAAA, 0xA643, 0xCAAB, 0xA644, + 0xCAAC, 0xA645, 0xCAAD, 0xA646, 0xCAAE, 0xA647, 0xCAAF, 0xA648, 0xCAB0, 0xA649, 0xCAB1, 0xA64A, 0xCAB2, 0xA64B, 0xCAB3, 0xA64C, + 0xCAB4, 0xA64D, 0xCAB5, 0xA64E, 0xCAB6, 0xA64F, 0xCAB7, 0xA650, 0xCAB8, 0xA651, 0xCAB9, 0xA652, 0xCABA, 0xA653, 0xCABB, 0xA654, + 0xCABC, 0xC2C9, 0xCABD, 0xC2CA, 0xCABE, 0xA655, 0xCABF, 0xA656, 0xCAC0, 0xC2CB, 0xCAC1, 0xA657, 0xCAC2, 0xA658, 0xCAC3, 0xA659, + 0xCAC4, 0xC2CC, 0xCAC5, 0xA65A, 0xCAC6, 0xA661, 0xCAC7, 0xA662, 0xCAC8, 0xA663, 0xCAC9, 0xA664, 0xCACA, 0xA665, 0xCACB, 0xA666, + 0xCACC, 0xC2CD, 0xCACD, 0xC2CE, 0xCACE, 0xA667, 0xCACF, 0xC2CF, 0xCAD0, 0xA668, 0xCAD1, 0xC2D0, 0xCAD2, 0xA669, 0xCAD3, 0xC2D1, + 0xCAD4, 0xA66A, 0xCAD5, 0xA66B, 0xCAD6, 0xA66C, 0xCAD7, 0xA66D, 0xCAD8, 0xC2D2, 0xCAD9, 0xC2D3, 0xCADA, 0xA66E, 0xCADB, 0xA66F, + 0xCADC, 0xA670, 0xCADD, 0xA671, 0xCADE, 0xA672, 0xCADF, 0xA673, 0xCAE0, 0xC2D4, 0xCAE1, 0xA674, 0xCAE2, 0xA675, 0xCAE3, 0xA676, + 0xCAE4, 0xA677, 0xCAE5, 0xA678, 0xCAE6, 0xA679, 0xCAE7, 0xA67A, 0xCAE8, 0xA681, 0xCAE9, 0xA682, 0xCAEA, 0xA683, 0xCAEB, 0xA684, + 0xCAEC, 0xC2D5, 0xCAED, 0xA685, 0xCAEE, 0xA686, 0xCAEF, 0xA687, 0xCAF0, 0xA688, 0xCAF1, 0xA689, 0xCAF2, 0xA68A, 0xCAF3, 0xA68B, + 0xCAF4, 0xC2D6, 0xCAF5, 0xA68C, 0xCAF6, 0xA68D, 0xCAF7, 0xA68E, 0xCAF8, 0xA68F, 0xCAF9, 0xA690, 0xCAFA, 0xA691, 0xCAFB, 0xA692, + 0xCAFC, 0xA693, 0xCAFD, 0xA694, 0xCAFE, 0xA695, 0xCAFF, 0xA696, 0xCB00, 0xA697, 0xCB01, 0xA698, 0xCB02, 0xA699, 0xCB03, 0xA69A, + 0xCB04, 0xA69B, 0xCB05, 0xA69C, 0xCB06, 0xA69D, 0xCB07, 0xA69E, 0xCB08, 0xC2D7, 0xCB09, 0xA69F, 0xCB0A, 0xA6A0, 0xCB0B, 0xA741, + 0xCB0C, 0xA742, 0xCB0D, 0xA743, 0xCB0E, 0xA744, 0xCB0F, 0xA745, 0xCB10, 0xC2D8, 0xCB11, 0xA746, 0xCB12, 0xA747, 0xCB13, 0xA748, + 0xCB14, 0xC2D9, 0xCB15, 0xA749, 0xCB16, 0xA74A, 0xCB17, 0xA74B, 0xCB18, 0xC2DA, 0xCB19, 0xA74C, 0xCB1A, 0xA74D, 0xCB1B, 0xA74E, + 0xCB1C, 0xA74F, 0xCB1D, 0xA750, 0xCB1E, 0xA751, 0xCB1F, 0xA752, 0xCB20, 0xC2DB, 0xCB21, 0xC2DC, 0xCB22, 0xA753, 0xCB23, 0xA754, + 0xCB24, 0xA755, 0xCB25, 0xA756, 0xCB26, 0xA757, 0xCB27, 0xA758, 0xCB28, 0xA759, 0xCB29, 0xA75A, 0xCB2A, 0xA761, 0xCB2B, 0xA762, + 0xCB2C, 0xA763, 0xCB2D, 0xA764, 0xCB2E, 0xA765, 0xCB2F, 0xA766, 0xCB30, 0xA767, 0xCB31, 0xA768, 0xCB32, 0xA769, 0xCB33, 0xA76A, + 0xCB34, 0xA76B, 0xCB35, 0xA76C, 0xCB36, 0xA76D, 0xCB37, 0xA76E, 0xCB38, 0xA76F, 0xCB39, 0xA770, 0xCB3A, 0xA771, 0xCB3B, 0xA772, + 0xCB3C, 0xA773, 0xCB3D, 0xA774, 0xCB3E, 0xA775, 0xCB3F, 0xA776, 0xCB40, 0xA777, 0xCB41, 0xC2DD, 0xCB42, 0xA778, 0xCB43, 0xA779, + 0xCB44, 0xA77A, 0xCB45, 0xA781, 0xCB46, 0xA782, 0xCB47, 0xA783, 0xCB48, 0xC2DE, 0xCB49, 0xC2DF, 0xCB4A, 0xA784, 0xCB4B, 0xA785, + 0xCB4C, 0xC2E0, 0xCB4D, 0xA786, 0xCB4E, 0xA787, 0xCB4F, 0xA788, 0xCB50, 0xC2E1, 0xCB51, 0xA789, 0xCB52, 0xA78A, 0xCB53, 0xA78B, + 0xCB54, 0xA78C, 0xCB55, 0xA78D, 0xCB56, 0xA78E, 0xCB57, 0xA78F, 0xCB58, 0xC2E2, 0xCB59, 0xC2E3, 0xCB5A, 0xA790, 0xCB5B, 0xA791, + 0xCB5C, 0xA792, 0xCB5D, 0xC2E4, 0xCB5E, 0xA793, 0xCB5F, 0xA794, 0xCB60, 0xA795, 0xCB61, 0xA796, 0xCB62, 0xA797, 0xCB63, 0xA798, + 0xCB64, 0xC2E5, 0xCB65, 0xA799, 0xCB66, 0xA79A, 0xCB67, 0xA79B, 0xCB68, 0xA79C, 0xCB69, 0xA79D, 0xCB6A, 0xA79E, 0xCB6B, 0xA79F, + 0xCB6C, 0xA7A0, 0xCB6D, 0xA841, 0xCB6E, 0xA842, 0xCB6F, 0xA843, 0xCB70, 0xA844, 0xCB71, 0xA845, 0xCB72, 0xA846, 0xCB73, 0xA847, + 0xCB74, 0xA848, 0xCB75, 0xA849, 0xCB76, 0xA84A, 0xCB77, 0xA84B, 0xCB78, 0xC2E6, 0xCB79, 0xC2E7, 0xCB7A, 0xA84C, 0xCB7B, 0xA84D, + 0xCB7C, 0xA84E, 0xCB7D, 0xA84F, 0xCB7E, 0xA850, 0xCB7F, 0xA851, 0xCB80, 0xA852, 0xCB81, 0xA853, 0xCB82, 0xA854, 0xCB83, 0xA855, + 0xCB84, 0xA856, 0xCB85, 0xA857, 0xCB86, 0xA858, 0xCB87, 0xA859, 0xCB88, 0xA85A, 0xCB89, 0xA861, 0xCB8A, 0xA862, 0xCB8B, 0xA863, + 0xCB8C, 0xA864, 0xCB8D, 0xA865, 0xCB8E, 0xA866, 0xCB8F, 0xA867, 0xCB90, 0xA868, 0xCB91, 0xA869, 0xCB92, 0xA86A, 0xCB93, 0xA86B, + 0xCB94, 0xA86C, 0xCB95, 0xA86D, 0xCB96, 0xA86E, 0xCB97, 0xA86F, 0xCB98, 0xA870, 0xCB99, 0xA871, 0xCB9A, 0xA872, 0xCB9B, 0xA873, + 0xCB9C, 0xC2E8, 0xCB9D, 0xA874, 0xCB9E, 0xA875, 0xCB9F, 0xA876, 0xCBA0, 0xA877, 0xCBA1, 0xA878, 0xCBA2, 0xA879, 0xCBA3, 0xA87A, + 0xCBA4, 0xA881, 0xCBA5, 0xA882, 0xCBA6, 0xA883, 0xCBA7, 0xA884, 0xCBA8, 0xA885, 0xCBA9, 0xA886, 0xCBAA, 0xA887, 0xCBAB, 0xA888, + 0xCBAC, 0xA889, 0xCBAD, 0xA88A, 0xCBAE, 0xA88B, 0xCBAF, 0xA88C, 0xCBB0, 0xA88D, 0xCBB1, 0xA88E, 0xCBB2, 0xA88F, 0xCBB3, 0xA890, + 0xCBB4, 0xA891, 0xCBB5, 0xA892, 0xCBB6, 0xA893, 0xCBB7, 0xA894, 0xCBB8, 0xC2E9, 0xCBB9, 0xA895, 0xCBBA, 0xA896, 0xCBBB, 0xA897, + 0xCBBC, 0xA898, 0xCBBD, 0xA899, 0xCBBE, 0xA89A, 0xCBBF, 0xA89B, 0xCBC0, 0xA89C, 0xCBC1, 0xA89D, 0xCBC2, 0xA89E, 0xCBC3, 0xA89F, + 0xCBC4, 0xA8A0, 0xCBC5, 0xA941, 0xCBC6, 0xA942, 0xCBC7, 0xA943, 0xCBC8, 0xA944, 0xCBC9, 0xA945, 0xCBCA, 0xA946, 0xCBCB, 0xA947, + 0xCBCC, 0xA948, 0xCBCD, 0xA949, 0xCBCE, 0xA94A, 0xCBCF, 0xA94B, 0xCBD0, 0xA94C, 0xCBD1, 0xA94D, 0xCBD2, 0xA94E, 0xCBD3, 0xA94F, + 0xCBD4, 0xC2EA, 0xCBD5, 0xA950, 0xCBD6, 0xA951, 0xCBD7, 0xA952, 0xCBD8, 0xA953, 0xCBD9, 0xA954, 0xCBDA, 0xA955, 0xCBDB, 0xA956, + 0xCBDC, 0xA957, 0xCBDD, 0xA958, 0xCBDE, 0xA959, 0xCBDF, 0xA95A, 0xCBE0, 0xA961, 0xCBE1, 0xA962, 0xCBE2, 0xA963, 0xCBE3, 0xA964, + 0xCBE4, 0xC2EB, 0xCBE5, 0xA965, 0xCBE6, 0xA966, 0xCBE7, 0xC2EC, 0xCBE8, 0xA967, 0xCBE9, 0xC2ED, 0xCBEA, 0xA968, 0xCBEB, 0xA969, + 0xCBEC, 0xA96A, 0xCBED, 0xA96B, 0xCBEE, 0xA96C, 0xCBEF, 0xA96D, 0xCBF0, 0xA96E, 0xCBF1, 0xA96F, 0xCBF2, 0xA970, 0xCBF3, 0xA971, + 0xCBF4, 0xA972, 0xCBF5, 0xA973, 0xCBF6, 0xA974, 0xCBF7, 0xA975, 0xCBF8, 0xA976, 0xCBF9, 0xA977, 0xCBFA, 0xA978, 0xCBFB, 0xA979, + 0xCBFC, 0xA97A, 0xCBFD, 0xA981, 0xCBFE, 0xA982, 0xCBFF, 0xA983, 0xCC00, 0xA984, 0xCC01, 0xA985, 0xCC02, 0xA986, 0xCC03, 0xA987, + 0xCC04, 0xA988, 0xCC05, 0xA989, 0xCC06, 0xA98A, 0xCC07, 0xA98B, 0xCC08, 0xA98C, 0xCC09, 0xA98D, 0xCC0A, 0xA98E, 0xCC0B, 0xA98F, + 0xCC0C, 0xC2EE, 0xCC0D, 0xC2EF, 0xCC0E, 0xA990, 0xCC0F, 0xA991, 0xCC10, 0xC2F0, 0xCC11, 0xA992, 0xCC12, 0xA993, 0xCC13, 0xA994, + 0xCC14, 0xC2F1, 0xCC15, 0xA995, 0xCC16, 0xA996, 0xCC17, 0xA997, 0xCC18, 0xA998, 0xCC19, 0xA999, 0xCC1A, 0xA99A, 0xCC1B, 0xA99B, + 0xCC1C, 0xC2F2, 0xCC1D, 0xC2F3, 0xCC1E, 0xA99C, 0xCC1F, 0xA99D, 0xCC20, 0xA99E, 0xCC21, 0xC2F4, 0xCC22, 0xC2F5, 0xCC23, 0xA99F, + 0xCC24, 0xA9A0, 0xCC25, 0xAA41, 0xCC26, 0xAA42, 0xCC27, 0xC2F6, 0xCC28, 0xC2F7, 0xCC29, 0xC2F8, 0xCC2A, 0xAA43, 0xCC2B, 0xAA44, + 0xCC2C, 0xC2F9, 0xCC2D, 0xAA45, 0xCC2E, 0xC2FA, 0xCC2F, 0xAA46, 0xCC30, 0xC2FB, 0xCC31, 0xAA47, 0xCC32, 0xAA48, 0xCC33, 0xAA49, + 0xCC34, 0xAA4A, 0xCC35, 0xAA4B, 0xCC36, 0xAA4C, 0xCC37, 0xAA4D, 0xCC38, 0xC2FC, 0xCC39, 0xC2FD, 0xCC3A, 0xAA4E, 0xCC3B, 0xC2FE, + 0xCC3C, 0xC3A1, 0xCC3D, 0xC3A2, 0xCC3E, 0xC3A3, 0xCC3F, 0xAA4F, 0xCC40, 0xAA50, 0xCC41, 0xAA51, 0xCC42, 0xAA52, 0xCC43, 0xAA53, + 0xCC44, 0xC3A4, 0xCC45, 0xC3A5, 0xCC46, 0xAA54, 0xCC47, 0xAA55, 0xCC48, 0xC3A6, 0xCC49, 0xAA56, 0xCC4A, 0xAA57, 0xCC4B, 0xAA58, + 0xCC4C, 0xC3A7, 0xCC4D, 0xAA59, 0xCC4E, 0xAA5A, 0xCC4F, 0xAA61, 0xCC50, 0xAA62, 0xCC51, 0xAA63, 0xCC52, 0xAA64, 0xCC53, 0xAA65, + 0xCC54, 0xC3A8, 0xCC55, 0xC3A9, 0xCC56, 0xAA66, 0xCC57, 0xC3AA, 0xCC58, 0xC3AB, 0xCC59, 0xC3AC, 0xCC5A, 0xAA67, 0xCC5B, 0xAA68, + 0xCC5C, 0xAA69, 0xCC5D, 0xAA6A, 0xCC5E, 0xAA6B, 0xCC5F, 0xAA6C, 0xCC60, 0xC3AD, 0xCC61, 0xAA6D, 0xCC62, 0xAA6E, 0xCC63, 0xAA6F, + 0xCC64, 0xC3AE, 0xCC65, 0xAA70, 0xCC66, 0xC3AF, 0xCC67, 0xAA71, 0xCC68, 0xC3B0, 0xCC69, 0xAA72, 0xCC6A, 0xAA73, 0xCC6B, 0xAA74, + 0xCC6C, 0xAA75, 0xCC6D, 0xAA76, 0xCC6E, 0xAA77, 0xCC6F, 0xAA78, 0xCC70, 0xC3B1, 0xCC71, 0xAA79, 0xCC72, 0xAA7A, 0xCC73, 0xAA81, + 0xCC74, 0xAA82, 0xCC75, 0xC3B2, 0xCC76, 0xAA83, 0xCC77, 0xAA84, 0xCC78, 0xAA85, 0xCC79, 0xAA86, 0xCC7A, 0xAA87, 0xCC7B, 0xAA88, + 0xCC7C, 0xAA89, 0xCC7D, 0xAA8A, 0xCC7E, 0xAA8B, 0xCC7F, 0xAA8C, 0xCC80, 0xAA8D, 0xCC81, 0xAA8E, 0xCC82, 0xAA8F, 0xCC83, 0xAA90, + 0xCC84, 0xAA91, 0xCC85, 0xAA92, 0xCC86, 0xAA93, 0xCC87, 0xAA94, 0xCC88, 0xAA95, 0xCC89, 0xAA96, 0xCC8A, 0xAA97, 0xCC8B, 0xAA98, + 0xCC8C, 0xAA99, 0xCC8D, 0xAA9A, 0xCC8E, 0xAA9B, 0xCC8F, 0xAA9C, 0xCC90, 0xAA9D, 0xCC91, 0xAA9E, 0xCC92, 0xAA9F, 0xCC93, 0xAAA0, + 0xCC94, 0xAB41, 0xCC95, 0xAB42, 0xCC96, 0xAB43, 0xCC97, 0xAB44, 0xCC98, 0xC3B3, 0xCC99, 0xC3B4, 0xCC9A, 0xAB45, 0xCC9B, 0xAB46, + 0xCC9C, 0xC3B5, 0xCC9D, 0xAB47, 0xCC9E, 0xAB48, 0xCC9F, 0xAB49, 0xCCA0, 0xC3B6, 0xCCA1, 0xAB4A, 0xCCA2, 0xAB4B, 0xCCA3, 0xAB4C, + 0xCCA4, 0xAB4D, 0xCCA5, 0xAB4E, 0xCCA6, 0xAB4F, 0xCCA7, 0xAB50, 0xCCA8, 0xC3B7, 0xCCA9, 0xC3B8, 0xCCAA, 0xAB51, 0xCCAB, 0xC3B9, + 0xCCAC, 0xC3BA, 0xCCAD, 0xC3BB, 0xCCAE, 0xAB52, 0xCCAF, 0xAB53, 0xCCB0, 0xAB54, 0xCCB1, 0xAB55, 0xCCB2, 0xAB56, 0xCCB3, 0xAB57, + 0xCCB4, 0xC3BC, 0xCCB5, 0xC3BD, 0xCCB6, 0xAB58, 0xCCB7, 0xAB59, 0xCCB8, 0xC3BE, 0xCCB9, 0xAB5A, 0xCCBA, 0xAB61, 0xCCBB, 0xAB62, + 0xCCBC, 0xC3BF, 0xCCBD, 0xAB63, 0xCCBE, 0xAB64, 0xCCBF, 0xAB65, 0xCCC0, 0xAB66, 0xCCC1, 0xAB67, 0xCCC2, 0xAB68, 0xCCC3, 0xAB69, + 0xCCC4, 0xC3C0, 0xCCC5, 0xC3C1, 0xCCC6, 0xAB6A, 0xCCC7, 0xC3C2, 0xCCC8, 0xAB6B, 0xCCC9, 0xC3C3, 0xCCCA, 0xAB6C, 0xCCCB, 0xAB6D, + 0xCCCC, 0xAB6E, 0xCCCD, 0xAB6F, 0xCCCE, 0xAB70, 0xCCCF, 0xAB71, 0xCCD0, 0xC3C4, 0xCCD1, 0xAB72, 0xCCD2, 0xAB73, 0xCCD3, 0xAB74, + 0xCCD4, 0xC3C5, 0xCCD5, 0xAB75, 0xCCD6, 0xAB76, 0xCCD7, 0xAB77, 0xCCD8, 0xAB78, 0xCCD9, 0xAB79, 0xCCDA, 0xAB7A, 0xCCDB, 0xAB81, + 0xCCDC, 0xAB82, 0xCCDD, 0xAB83, 0xCCDE, 0xAB84, 0xCCDF, 0xAB85, 0xCCE0, 0xAB86, 0xCCE1, 0xAB87, 0xCCE2, 0xAB88, 0xCCE3, 0xAB89, + 0xCCE4, 0xC3C6, 0xCCE5, 0xAB8A, 0xCCE6, 0xAB8B, 0xCCE7, 0xAB8C, 0xCCE8, 0xAB8D, 0xCCE9, 0xAB8E, 0xCCEA, 0xAB8F, 0xCCEB, 0xAB90, + 0xCCEC, 0xC3C7, 0xCCED, 0xAB91, 0xCCEE, 0xAB92, 0xCCEF, 0xAB93, 0xCCF0, 0xC3C8, 0xCCF1, 0xAB94, 0xCCF2, 0xAB95, 0xCCF3, 0xAB96, + 0xCCF4, 0xAB97, 0xCCF5, 0xAB98, 0xCCF6, 0xAB99, 0xCCF7, 0xAB9A, 0xCCF8, 0xAB9B, 0xCCF9, 0xAB9C, 0xCCFA, 0xAB9D, 0xCCFB, 0xAB9E, + 0xCCFC, 0xAB9F, 0xCCFD, 0xABA0, 0xCCFE, 0xAC41, 0xCCFF, 0xAC42, 0xCD00, 0xAC43, 0xCD01, 0xC3C9, 0xCD02, 0xAC44, 0xCD03, 0xAC45, + 0xCD04, 0xAC46, 0xCD05, 0xAC47, 0xCD06, 0xAC48, 0xCD07, 0xAC49, 0xCD08, 0xC3CA, 0xCD09, 0xC3CB, 0xCD0A, 0xAC4A, 0xCD0B, 0xAC4B, + 0xCD0C, 0xC3CC, 0xCD0D, 0xAC4C, 0xCD0E, 0xAC4D, 0xCD0F, 0xAC4E, 0xCD10, 0xC3CD, 0xCD11, 0xAC4F, 0xCD12, 0xAC50, 0xCD13, 0xAC51, + 0xCD14, 0xAC52, 0xCD15, 0xAC53, 0xCD16, 0xAC54, 0xCD17, 0xAC55, 0xCD18, 0xC3CE, 0xCD19, 0xC3CF, 0xCD1A, 0xAC56, 0xCD1B, 0xC3D0, + 0xCD1C, 0xAC57, 0xCD1D, 0xC3D1, 0xCD1E, 0xAC58, 0xCD1F, 0xAC59, 0xCD20, 0xAC5A, 0xCD21, 0xAC61, 0xCD22, 0xAC62, 0xCD23, 0xAC63, + 0xCD24, 0xC3D2, 0xCD25, 0xAC64, 0xCD26, 0xAC65, 0xCD27, 0xAC66, 0xCD28, 0xC3D3, 0xCD29, 0xAC67, 0xCD2A, 0xAC68, 0xCD2B, 0xAC69, + 0xCD2C, 0xC3D4, 0xCD2D, 0xAC6A, 0xCD2E, 0xAC6B, 0xCD2F, 0xAC6C, 0xCD30, 0xAC6D, 0xCD31, 0xAC6E, 0xCD32, 0xAC6F, 0xCD33, 0xAC70, + 0xCD34, 0xAC71, 0xCD35, 0xAC72, 0xCD36, 0xAC73, 0xCD37, 0xAC74, 0xCD38, 0xAC75, 0xCD39, 0xC3D5, 0xCD3A, 0xAC76, 0xCD3B, 0xAC77, + 0xCD3C, 0xAC78, 0xCD3D, 0xAC79, 0xCD3E, 0xAC7A, 0xCD3F, 0xAC81, 0xCD40, 0xAC82, 0xCD41, 0xAC83, 0xCD42, 0xAC84, 0xCD43, 0xAC85, + 0xCD44, 0xAC86, 0xCD45, 0xAC87, 0xCD46, 0xAC88, 0xCD47, 0xAC89, 0xCD48, 0xAC8A, 0xCD49, 0xAC8B, 0xCD4A, 0xAC8C, 0xCD4B, 0xAC8D, + 0xCD4C, 0xAC8E, 0xCD4D, 0xAC8F, 0xCD4E, 0xAC90, 0xCD4F, 0xAC91, 0xCD50, 0xAC92, 0xCD51, 0xAC93, 0xCD52, 0xAC94, 0xCD53, 0xAC95, + 0xCD54, 0xAC96, 0xCD55, 0xAC97, 0xCD56, 0xAC98, 0xCD57, 0xAC99, 0xCD58, 0xAC9A, 0xCD59, 0xAC9B, 0xCD5A, 0xAC9C, 0xCD5B, 0xAC9D, + 0xCD5C, 0xC3D6, 0xCD5D, 0xAC9E, 0xCD5E, 0xAC9F, 0xCD5F, 0xACA0, 0xCD60, 0xC3D7, 0xCD61, 0xAD41, 0xCD62, 0xAD42, 0xCD63, 0xAD43, + 0xCD64, 0xC3D8, 0xCD65, 0xAD44, 0xCD66, 0xAD45, 0xCD67, 0xAD46, 0xCD68, 0xAD47, 0xCD69, 0xAD48, 0xCD6A, 0xAD49, 0xCD6B, 0xAD4A, + 0xCD6C, 0xC3D9, 0xCD6D, 0xC3DA, 0xCD6E, 0xAD4B, 0xCD6F, 0xC3DB, 0xCD70, 0xAD4C, 0xCD71, 0xC3DC, 0xCD72, 0xAD4D, 0xCD73, 0xAD4E, + 0xCD74, 0xAD4F, 0xCD75, 0xAD50, 0xCD76, 0xAD51, 0xCD77, 0xAD52, 0xCD78, 0xC3DD, 0xCD79, 0xAD53, 0xCD7A, 0xAD54, 0xCD7B, 0xAD55, + 0xCD7C, 0xAD56, 0xCD7D, 0xAD57, 0xCD7E, 0xAD58, 0xCD7F, 0xAD59, 0xCD80, 0xAD5A, 0xCD81, 0xAD61, 0xCD82, 0xAD62, 0xCD83, 0xAD63, + 0xCD84, 0xAD64, 0xCD85, 0xAD65, 0xCD86, 0xAD66, 0xCD87, 0xAD67, 0xCD88, 0xC3DE, 0xCD89, 0xAD68, 0xCD8A, 0xAD69, 0xCD8B, 0xAD6A, + 0xCD8C, 0xAD6B, 0xCD8D, 0xAD6C, 0xCD8E, 0xAD6D, 0xCD8F, 0xAD6E, 0xCD90, 0xAD6F, 0xCD91, 0xAD70, 0xCD92, 0xAD71, 0xCD93, 0xAD72, + 0xCD94, 0xC3DF, 0xCD95, 0xC3E0, 0xCD96, 0xAD73, 0xCD97, 0xAD74, 0xCD98, 0xC3E1, 0xCD99, 0xAD75, 0xCD9A, 0xAD76, 0xCD9B, 0xAD77, + 0xCD9C, 0xC3E2, 0xCD9D, 0xAD78, 0xCD9E, 0xAD79, 0xCD9F, 0xAD7A, 0xCDA0, 0xAD81, 0xCDA1, 0xAD82, 0xCDA2, 0xAD83, 0xCDA3, 0xAD84, + 0xCDA4, 0xC3E3, 0xCDA5, 0xC3E4, 0xCDA6, 0xAD85, 0xCDA7, 0xC3E5, 0xCDA8, 0xAD86, 0xCDA9, 0xC3E6, 0xCDAA, 0xAD87, 0xCDAB, 0xAD88, + 0xCDAC, 0xAD89, 0xCDAD, 0xAD8A, 0xCDAE, 0xAD8B, 0xCDAF, 0xAD8C, 0xCDB0, 0xC3E7, 0xCDB1, 0xAD8D, 0xCDB2, 0xAD8E, 0xCDB3, 0xAD8F, + 0xCDB4, 0xAD90, 0xCDB5, 0xAD91, 0xCDB6, 0xAD92, 0xCDB7, 0xAD93, 0xCDB8, 0xAD94, 0xCDB9, 0xAD95, 0xCDBA, 0xAD96, 0xCDBB, 0xAD97, + 0xCDBC, 0xAD98, 0xCDBD, 0xAD99, 0xCDBE, 0xAD9A, 0xCDBF, 0xAD9B, 0xCDC0, 0xAD9C, 0xCDC1, 0xAD9D, 0xCDC2, 0xAD9E, 0xCDC3, 0xAD9F, + 0xCDC4, 0xC3E8, 0xCDC5, 0xADA0, 0xCDC6, 0xAE41, 0xCDC7, 0xAE42, 0xCDC8, 0xAE43, 0xCDC9, 0xAE44, 0xCDCA, 0xAE45, 0xCDCB, 0xAE46, + 0xCDCC, 0xC3E9, 0xCDCD, 0xAE47, 0xCDCE, 0xAE48, 0xCDCF, 0xAE49, 0xCDD0, 0xC3EA, 0xCDD1, 0xAE4A, 0xCDD2, 0xAE4B, 0xCDD3, 0xAE4C, + 0xCDD4, 0xAE4D, 0xCDD5, 0xAE4E, 0xCDD6, 0xAE4F, 0xCDD7, 0xAE50, 0xCDD8, 0xAE51, 0xCDD9, 0xAE52, 0xCDDA, 0xAE53, 0xCDDB, 0xAE54, + 0xCDDC, 0xAE55, 0xCDDD, 0xAE56, 0xCDDE, 0xAE57, 0xCDDF, 0xAE58, 0xCDE0, 0xAE59, 0xCDE1, 0xAE5A, 0xCDE2, 0xAE61, 0xCDE3, 0xAE62, + 0xCDE4, 0xAE63, 0xCDE5, 0xAE64, 0xCDE6, 0xAE65, 0xCDE7, 0xAE66, 0xCDE8, 0xC3EB, 0xCDE9, 0xAE67, 0xCDEA, 0xAE68, 0xCDEB, 0xAE69, + 0xCDEC, 0xC3EC, 0xCDED, 0xAE6A, 0xCDEE, 0xAE6B, 0xCDEF, 0xAE6C, 0xCDF0, 0xC3ED, 0xCDF1, 0xAE6D, 0xCDF2, 0xAE6E, 0xCDF3, 0xAE6F, + 0xCDF4, 0xAE70, 0xCDF5, 0xAE71, 0xCDF6, 0xAE72, 0xCDF7, 0xAE73, 0xCDF8, 0xC3EE, 0xCDF9, 0xC3EF, 0xCDFA, 0xAE74, 0xCDFB, 0xC3F0, + 0xCDFC, 0xAE75, 0xCDFD, 0xC3F1, 0xCDFE, 0xAE76, 0xCDFF, 0xAE77, 0xCE00, 0xAE78, 0xCE01, 0xAE79, 0xCE02, 0xAE7A, 0xCE03, 0xAE81, + 0xCE04, 0xC3F2, 0xCE05, 0xAE82, 0xCE06, 0xAE83, 0xCE07, 0xAE84, 0xCE08, 0xC3F3, 0xCE09, 0xAE85, 0xCE0A, 0xAE86, 0xCE0B, 0xAE87, + 0xCE0C, 0xC3F4, 0xCE0D, 0xAE88, 0xCE0E, 0xAE89, 0xCE0F, 0xAE8A, 0xCE10, 0xAE8B, 0xCE11, 0xAE8C, 0xCE12, 0xAE8D, 0xCE13, 0xAE8E, + 0xCE14, 0xC3F5, 0xCE15, 0xAE8F, 0xCE16, 0xAE90, 0xCE17, 0xAE91, 0xCE18, 0xAE92, 0xCE19, 0xC3F6, 0xCE1A, 0xAE93, 0xCE1B, 0xAE94, + 0xCE1C, 0xAE95, 0xCE1D, 0xAE96, 0xCE1E, 0xAE97, 0xCE1F, 0xAE98, 0xCE20, 0xC3F7, 0xCE21, 0xC3F8, 0xCE22, 0xAE99, 0xCE23, 0xAE9A, + 0xCE24, 0xC3F9, 0xCE25, 0xAE9B, 0xCE26, 0xAE9C, 0xCE27, 0xAE9D, 0xCE28, 0xC3FA, 0xCE29, 0xAE9E, 0xCE2A, 0xAE9F, 0xCE2B, 0xAEA0, + 0xCE2C, 0xAF41, 0xCE2D, 0xAF42, 0xCE2E, 0xAF43, 0xCE2F, 0xAF44, 0xCE30, 0xC3FB, 0xCE31, 0xC3FC, 0xCE32, 0xAF45, 0xCE33, 0xC3FD, + 0xCE34, 0xAF46, 0xCE35, 0xC3FE, 0xCE36, 0xAF47, 0xCE37, 0xAF48, 0xCE38, 0xAF49, 0xCE39, 0xAF4A, 0xCE3A, 0xAF4B, 0xCE3B, 0xAF4C, + 0xCE3C, 0xAF4D, 0xCE3D, 0xAF4E, 0xCE3E, 0xAF4F, 0xCE3F, 0xAF50, 0xCE40, 0xAF51, 0xCE41, 0xAF52, 0xCE42, 0xAF53, 0xCE43, 0xAF54, + 0xCE44, 0xAF55, 0xCE45, 0xAF56, 0xCE46, 0xAF57, 0xCE47, 0xAF58, 0xCE48, 0xAF59, 0xCE49, 0xAF5A, 0xCE4A, 0xAF61, 0xCE4B, 0xAF62, + 0xCE4C, 0xAF63, 0xCE4D, 0xAF64, 0xCE4E, 0xAF65, 0xCE4F, 0xAF66, 0xCE50, 0xAF67, 0xCE51, 0xAF68, 0xCE52, 0xAF69, 0xCE53, 0xAF6A, + 0xCE54, 0xAF6B, 0xCE55, 0xAF6C, 0xCE56, 0xAF6D, 0xCE57, 0xAF6E, 0xCE58, 0xC4A1, 0xCE59, 0xC4A2, 0xCE5A, 0xAF6F, 0xCE5B, 0xAF70, + 0xCE5C, 0xC4A3, 0xCE5D, 0xAF71, 0xCE5E, 0xAF72, 0xCE5F, 0xC4A4, 0xCE60, 0xC4A5, 0xCE61, 0xC4A6, 0xCE62, 0xAF73, 0xCE63, 0xAF74, + 0xCE64, 0xAF75, 0xCE65, 0xAF76, 0xCE66, 0xAF77, 0xCE67, 0xAF78, 0xCE68, 0xC4A7, 0xCE69, 0xC4A8, 0xCE6A, 0xAF79, 0xCE6B, 0xC4A9, + 0xCE6C, 0xAF7A, 0xCE6D, 0xC4AA, 0xCE6E, 0xAF81, 0xCE6F, 0xAF82, 0xCE70, 0xAF83, 0xCE71, 0xAF84, 0xCE72, 0xAF85, 0xCE73, 0xAF86, + 0xCE74, 0xC4AB, 0xCE75, 0xC4AC, 0xCE76, 0xAF87, 0xCE77, 0xAF88, 0xCE78, 0xC4AD, 0xCE79, 0xAF89, 0xCE7A, 0xAF8A, 0xCE7B, 0xAF8B, + 0xCE7C, 0xC4AE, 0xCE7D, 0xAF8C, 0xCE7E, 0xAF8D, 0xCE7F, 0xAF8E, 0xCE80, 0xAF8F, 0xCE81, 0xAF90, 0xCE82, 0xAF91, 0xCE83, 0xAF92, + 0xCE84, 0xC4AF, 0xCE85, 0xC4B0, 0xCE86, 0xAF93, 0xCE87, 0xC4B1, 0xCE88, 0xAF94, 0xCE89, 0xC4B2, 0xCE8A, 0xAF95, 0xCE8B, 0xAF96, + 0xCE8C, 0xAF97, 0xCE8D, 0xAF98, 0xCE8E, 0xAF99, 0xCE8F, 0xAF9A, 0xCE90, 0xC4B3, 0xCE91, 0xC4B4, 0xCE92, 0xAF9B, 0xCE93, 0xAF9C, + 0xCE94, 0xC4B5, 0xCE95, 0xAF9D, 0xCE96, 0xAF9E, 0xCE97, 0xAF9F, 0xCE98, 0xC4B6, 0xCE99, 0xAFA0, 0xCE9A, 0xB041, 0xCE9B, 0xB042, + 0xCE9C, 0xB043, 0xCE9D, 0xB044, 0xCE9E, 0xB045, 0xCE9F, 0xB046, 0xCEA0, 0xC4B7, 0xCEA1, 0xC4B8, 0xCEA2, 0xB047, 0xCEA3, 0xC4B9, + 0xCEA4, 0xC4BA, 0xCEA5, 0xC4BB, 0xCEA6, 0xB048, 0xCEA7, 0xB049, 0xCEA8, 0xB04A, 0xCEA9, 0xB04B, 0xCEAA, 0xB04C, 0xCEAB, 0xB04D, + 0xCEAC, 0xC4BC, 0xCEAD, 0xC4BD, 0xCEAE, 0xB04E, 0xCEAF, 0xB04F, 0xCEB0, 0xB050, 0xCEB1, 0xB051, 0xCEB2, 0xB052, 0xCEB3, 0xB053, + 0xCEB4, 0xB054, 0xCEB5, 0xB055, 0xCEB6, 0xB056, 0xCEB7, 0xB057, 0xCEB8, 0xB058, 0xCEB9, 0xB059, 0xCEBA, 0xB05A, 0xCEBB, 0xB061, + 0xCEBC, 0xB062, 0xCEBD, 0xB063, 0xCEBE, 0xB064, 0xCEBF, 0xB065, 0xCEC0, 0xB066, 0xCEC1, 0xC4BE, 0xCEC2, 0xB067, 0xCEC3, 0xB068, + 0xCEC4, 0xB069, 0xCEC5, 0xB06A, 0xCEC6, 0xB06B, 0xCEC7, 0xB06C, 0xCEC8, 0xB06D, 0xCEC9, 0xB06E, 0xCECA, 0xB06F, 0xCECB, 0xB070, + 0xCECC, 0xB071, 0xCECD, 0xB072, 0xCECE, 0xB073, 0xCECF, 0xB074, 0xCED0, 0xB075, 0xCED1, 0xB076, 0xCED2, 0xB077, 0xCED3, 0xB078, + 0xCED4, 0xB079, 0xCED5, 0xB07A, 0xCED6, 0xB081, 0xCED7, 0xB082, 0xCED8, 0xB083, 0xCED9, 0xB084, 0xCEDA, 0xB085, 0xCEDB, 0xB086, + 0xCEDC, 0xB087, 0xCEDD, 0xB088, 0xCEDE, 0xB089, 0xCEDF, 0xB08A, 0xCEE0, 0xB08B, 0xCEE1, 0xB08C, 0xCEE2, 0xB08D, 0xCEE3, 0xB08E, + 0xCEE4, 0xC4BF, 0xCEE5, 0xC4C0, 0xCEE6, 0xB08F, 0xCEE7, 0xB090, 0xCEE8, 0xC4C1, 0xCEE9, 0xB091, 0xCEEA, 0xB092, 0xCEEB, 0xC4C2, + 0xCEEC, 0xC4C3, 0xCEED, 0xB093, 0xCEEE, 0xB094, 0xCEEF, 0xB095, 0xCEF0, 0xB096, 0xCEF1, 0xB097, 0xCEF2, 0xB098, 0xCEF3, 0xB099, + 0xCEF4, 0xC4C4, 0xCEF5, 0xC4C5, 0xCEF6, 0xB09A, 0xCEF7, 0xC4C6, 0xCEF8, 0xC4C7, 0xCEF9, 0xC4C8, 0xCEFA, 0xB09B, 0xCEFB, 0xB09C, + 0xCEFC, 0xB09D, 0xCEFD, 0xB09E, 0xCEFE, 0xB09F, 0xCEFF, 0xB0A0, 0xCF00, 0xC4C9, 0xCF01, 0xC4CA, 0xCF02, 0xB141, 0xCF03, 0xB142, + 0xCF04, 0xC4CB, 0xCF05, 0xB143, 0xCF06, 0xB144, 0xCF07, 0xB145, 0xCF08, 0xC4CC, 0xCF09, 0xB146, 0xCF0A, 0xB147, 0xCF0B, 0xB148, + 0xCF0C, 0xB149, 0xCF0D, 0xB14A, 0xCF0E, 0xB14B, 0xCF0F, 0xB14C, 0xCF10, 0xC4CD, 0xCF11, 0xC4CE, 0xCF12, 0xB14D, 0xCF13, 0xC4CF, + 0xCF14, 0xB14E, 0xCF15, 0xC4D0, 0xCF16, 0xB14F, 0xCF17, 0xB150, 0xCF18, 0xB151, 0xCF19, 0xB152, 0xCF1A, 0xB153, 0xCF1B, 0xB154, + 0xCF1C, 0xC4D1, 0xCF1D, 0xB155, 0xCF1E, 0xB156, 0xCF1F, 0xB157, 0xCF20, 0xC4D2, 0xCF21, 0xB158, 0xCF22, 0xB159, 0xCF23, 0xB15A, + 0xCF24, 0xC4D3, 0xCF25, 0xB161, 0xCF26, 0xB162, 0xCF27, 0xB163, 0xCF28, 0xB164, 0xCF29, 0xB165, 0xCF2A, 0xB166, 0xCF2B, 0xB167, + 0xCF2C, 0xC4D4, 0xCF2D, 0xC4D5, 0xCF2E, 0xB168, 0xCF2F, 0xC4D6, 0xCF30, 0xC4D7, 0xCF31, 0xC4D8, 0xCF32, 0xB169, 0xCF33, 0xB16A, + 0xCF34, 0xB16B, 0xCF35, 0xB16C, 0xCF36, 0xB16D, 0xCF37, 0xB16E, 0xCF38, 0xC4D9, 0xCF39, 0xB16F, 0xCF3A, 0xB170, 0xCF3B, 0xB171, + 0xCF3C, 0xB172, 0xCF3D, 0xB173, 0xCF3E, 0xB174, 0xCF3F, 0xB175, 0xCF40, 0xB176, 0xCF41, 0xB177, 0xCF42, 0xB178, 0xCF43, 0xB179, + 0xCF44, 0xB17A, 0xCF45, 0xB181, 0xCF46, 0xB182, 0xCF47, 0xB183, 0xCF48, 0xB184, 0xCF49, 0xB185, 0xCF4A, 0xB186, 0xCF4B, 0xB187, + 0xCF4C, 0xB188, 0xCF4D, 0xB189, 0xCF4E, 0xB18A, 0xCF4F, 0xB18B, 0xCF50, 0xB18C, 0xCF51, 0xB18D, 0xCF52, 0xB18E, 0xCF53, 0xB18F, + 0xCF54, 0xC4DA, 0xCF55, 0xC4DB, 0xCF56, 0xB190, 0xCF57, 0xB191, 0xCF58, 0xC4DC, 0xCF59, 0xB192, 0xCF5A, 0xB193, 0xCF5B, 0xB194, + 0xCF5C, 0xC4DD, 0xCF5D, 0xB195, 0xCF5E, 0xB196, 0xCF5F, 0xB197, 0xCF60, 0xB198, 0xCF61, 0xB199, 0xCF62, 0xB19A, 0xCF63, 0xB19B, + 0xCF64, 0xC4DE, 0xCF65, 0xC4DF, 0xCF66, 0xB19C, 0xCF67, 0xC4E0, 0xCF68, 0xB19D, 0xCF69, 0xC4E1, 0xCF6A, 0xB19E, 0xCF6B, 0xB19F, + 0xCF6C, 0xB1A0, 0xCF6D, 0xB241, 0xCF6E, 0xB242, 0xCF6F, 0xB243, 0xCF70, 0xC4E2, 0xCF71, 0xC4E3, 0xCF72, 0xB244, 0xCF73, 0xB245, + 0xCF74, 0xC4E4, 0xCF75, 0xB246, 0xCF76, 0xB247, 0xCF77, 0xB248, 0xCF78, 0xC4E5, 0xCF79, 0xB249, 0xCF7A, 0xB24A, 0xCF7B, 0xB24B, + 0xCF7C, 0xB24C, 0xCF7D, 0xB24D, 0xCF7E, 0xB24E, 0xCF7F, 0xB24F, 0xCF80, 0xC4E6, 0xCF81, 0xB250, 0xCF82, 0xB251, 0xCF83, 0xB252, + 0xCF84, 0xB253, 0xCF85, 0xC4E7, 0xCF86, 0xB254, 0xCF87, 0xB255, 0xCF88, 0xB256, 0xCF89, 0xB257, 0xCF8A, 0xB258, 0xCF8B, 0xB259, + 0xCF8C, 0xC4E8, 0xCF8D, 0xB25A, 0xCF8E, 0xB261, 0xCF8F, 0xB262, 0xCF90, 0xB263, 0xCF91, 0xB264, 0xCF92, 0xB265, 0xCF93, 0xB266, + 0xCF94, 0xB267, 0xCF95, 0xB268, 0xCF96, 0xB269, 0xCF97, 0xB26A, 0xCF98, 0xB26B, 0xCF99, 0xB26C, 0xCF9A, 0xB26D, 0xCF9B, 0xB26E, + 0xCF9C, 0xB26F, 0xCF9D, 0xB270, 0xCF9E, 0xB271, 0xCF9F, 0xB272, 0xCFA0, 0xB273, 0xCFA1, 0xC4E9, 0xCFA2, 0xB274, 0xCFA3, 0xB275, + 0xCFA4, 0xB276, 0xCFA5, 0xB277, 0xCFA6, 0xB278, 0xCFA7, 0xB279, 0xCFA8, 0xC4EA, 0xCFA9, 0xB27A, 0xCFAA, 0xB281, 0xCFAB, 0xB282, + 0xCFAC, 0xB283, 0xCFAD, 0xB284, 0xCFAE, 0xB285, 0xCFAF, 0xB286, 0xCFB0, 0xC4EB, 0xCFB1, 0xB287, 0xCFB2, 0xB288, 0xCFB3, 0xB289, + 0xCFB4, 0xB28A, 0xCFB5, 0xB28B, 0xCFB6, 0xB28C, 0xCFB7, 0xB28D, 0xCFB8, 0xB28E, 0xCFB9, 0xB28F, 0xCFBA, 0xB290, 0xCFBB, 0xB291, + 0xCFBC, 0xB292, 0xCFBD, 0xB293, 0xCFBE, 0xB294, 0xCFBF, 0xB295, 0xCFC0, 0xB296, 0xCFC1, 0xB297, 0xCFC2, 0xB298, 0xCFC3, 0xB299, + 0xCFC4, 0xC4EC, 0xCFC5, 0xB29A, 0xCFC6, 0xB29B, 0xCFC7, 0xB29C, 0xCFC8, 0xB29D, 0xCFC9, 0xB29E, 0xCFCA, 0xB29F, 0xCFCB, 0xB2A0, + 0xCFCC, 0xB341, 0xCFCD, 0xB342, 0xCFCE, 0xB343, 0xCFCF, 0xB344, 0xCFD0, 0xB345, 0xCFD1, 0xB346, 0xCFD2, 0xB347, 0xCFD3, 0xB348, + 0xCFD4, 0xB349, 0xCFD5, 0xB34A, 0xCFD6, 0xB34B, 0xCFD7, 0xB34C, 0xCFD8, 0xB34D, 0xCFD9, 0xB34E, 0xCFDA, 0xB34F, 0xCFDB, 0xB350, + 0xCFDC, 0xB351, 0xCFDD, 0xB352, 0xCFDE, 0xB353, 0xCFDF, 0xB354, 0xCFE0, 0xC4ED, 0xCFE1, 0xC4EE, 0xCFE2, 0xB355, 0xCFE3, 0xB356, + 0xCFE4, 0xC4EF, 0xCFE5, 0xB357, 0xCFE6, 0xB358, 0xCFE7, 0xB359, 0xCFE8, 0xC4F0, 0xCFE9, 0xB35A, 0xCFEA, 0xB361, 0xCFEB, 0xB362, + 0xCFEC, 0xB363, 0xCFED, 0xB364, 0xCFEE, 0xB365, 0xCFEF, 0xB366, 0xCFF0, 0xC4F1, 0xCFF1, 0xC4F2, 0xCFF2, 0xB367, 0xCFF3, 0xC4F3, + 0xCFF4, 0xB368, 0xCFF5, 0xC4F4, 0xCFF6, 0xB369, 0xCFF7, 0xB36A, 0xCFF8, 0xB36B, 0xCFF9, 0xB36C, 0xCFFA, 0xB36D, 0xCFFB, 0xB36E, + 0xCFFC, 0xC4F5, 0xCFFD, 0xB36F, 0xCFFE, 0xB370, 0xCFFF, 0xB371, 0xD000, 0xC4F6, 0xD001, 0xB372, 0xD002, 0xB373, 0xD003, 0xB374, + 0xD004, 0xC4F7, 0xD005, 0xB375, 0xD006, 0xB376, 0xD007, 0xB377, 0xD008, 0xB378, 0xD009, 0xB379, 0xD00A, 0xB37A, 0xD00B, 0xB381, + 0xD00C, 0xB382, 0xD00D, 0xB383, 0xD00E, 0xB384, 0xD00F, 0xB385, 0xD010, 0xB386, 0xD011, 0xC4F8, 0xD012, 0xB387, 0xD013, 0xB388, + 0xD014, 0xB389, 0xD015, 0xB38A, 0xD016, 0xB38B, 0xD017, 0xB38C, 0xD018, 0xC4F9, 0xD019, 0xB38D, 0xD01A, 0xB38E, 0xD01B, 0xB38F, + 0xD01C, 0xB390, 0xD01D, 0xB391, 0xD01E, 0xB392, 0xD01F, 0xB393, 0xD020, 0xB394, 0xD021, 0xB395, 0xD022, 0xB396, 0xD023, 0xB397, + 0xD024, 0xB398, 0xD025, 0xB399, 0xD026, 0xB39A, 0xD027, 0xB39B, 0xD028, 0xB39C, 0xD029, 0xB39D, 0xD02A, 0xB39E, 0xD02B, 0xB39F, + 0xD02C, 0xB3A0, 0xD02D, 0xC4FA, 0xD02E, 0xB441, 0xD02F, 0xB442, 0xD030, 0xB443, 0xD031, 0xB444, 0xD032, 0xB445, 0xD033, 0xB446, + 0xD034, 0xC4FB, 0xD035, 0xC4FC, 0xD036, 0xB447, 0xD037, 0xB448, 0xD038, 0xC4FD, 0xD039, 0xB449, 0xD03A, 0xB44A, 0xD03B, 0xB44B, + 0xD03C, 0xC4FE, 0xD03D, 0xB44C, 0xD03E, 0xB44D, 0xD03F, 0xB44E, 0xD040, 0xB44F, 0xD041, 0xB450, 0xD042, 0xB451, 0xD043, 0xB452, + 0xD044, 0xC5A1, 0xD045, 0xC5A2, 0xD046, 0xB453, 0xD047, 0xC5A3, 0xD048, 0xB454, 0xD049, 0xC5A4, 0xD04A, 0xB455, 0xD04B, 0xB456, + 0xD04C, 0xB457, 0xD04D, 0xB458, 0xD04E, 0xB459, 0xD04F, 0xB45A, 0xD050, 0xC5A5, 0xD051, 0xB461, 0xD052, 0xB462, 0xD053, 0xB463, + 0xD054, 0xC5A6, 0xD055, 0xB464, 0xD056, 0xB465, 0xD057, 0xB466, 0xD058, 0xC5A7, 0xD059, 0xB467, 0xD05A, 0xB468, 0xD05B, 0xB469, + 0xD05C, 0xB46A, 0xD05D, 0xB46B, 0xD05E, 0xB46C, 0xD05F, 0xB46D, 0xD060, 0xC5A8, 0xD061, 0xB46E, 0xD062, 0xB46F, 0xD063, 0xB470, + 0xD064, 0xB471, 0xD065, 0xB472, 0xD066, 0xB473, 0xD067, 0xB474, 0xD068, 0xB475, 0xD069, 0xB476, 0xD06A, 0xB477, 0xD06B, 0xB478, + 0xD06C, 0xC5A9, 0xD06D, 0xC5AA, 0xD06E, 0xB479, 0xD06F, 0xB47A, 0xD070, 0xC5AB, 0xD071, 0xB481, 0xD072, 0xB482, 0xD073, 0xB483, + 0xD074, 0xC5AC, 0xD075, 0xB484, 0xD076, 0xB485, 0xD077, 0xB486, 0xD078, 0xB487, 0xD079, 0xB488, 0xD07A, 0xB489, 0xD07B, 0xB48A, + 0xD07C, 0xC5AD, 0xD07D, 0xC5AE, 0xD07E, 0xB48B, 0xD07F, 0xB48C, 0xD080, 0xB48D, 0xD081, 0xC5AF, 0xD082, 0xB48E, 0xD083, 0xB48F, + 0xD084, 0xB490, 0xD085, 0xB491, 0xD086, 0xB492, 0xD087, 0xB493, 0xD088, 0xB494, 0xD089, 0xB495, 0xD08A, 0xB496, 0xD08B, 0xB497, + 0xD08C, 0xB498, 0xD08D, 0xB499, 0xD08E, 0xB49A, 0xD08F, 0xB49B, 0xD090, 0xB49C, 0xD091, 0xB49D, 0xD092, 0xB49E, 0xD093, 0xB49F, + 0xD094, 0xB4A0, 0xD095, 0xB541, 0xD096, 0xB542, 0xD097, 0xB543, 0xD098, 0xB544, 0xD099, 0xB545, 0xD09A, 0xB546, 0xD09B, 0xB547, + 0xD09C, 0xB548, 0xD09D, 0xB549, 0xD09E, 0xB54A, 0xD09F, 0xB54B, 0xD0A0, 0xB54C, 0xD0A1, 0xB54D, 0xD0A2, 0xB54E, 0xD0A3, 0xB54F, + 0xD0A4, 0xC5B0, 0xD0A5, 0xC5B1, 0xD0A6, 0xB550, 0xD0A7, 0xB551, 0xD0A8, 0xC5B2, 0xD0A9, 0xB552, 0xD0AA, 0xB553, 0xD0AB, 0xB554, + 0xD0AC, 0xC5B3, 0xD0AD, 0xB555, 0xD0AE, 0xB556, 0xD0AF, 0xB557, 0xD0B0, 0xB558, 0xD0B1, 0xB559, 0xD0B2, 0xB55A, 0xD0B3, 0xB561, + 0xD0B4, 0xC5B4, 0xD0B5, 0xC5B5, 0xD0B6, 0xB562, 0xD0B7, 0xC5B6, 0xD0B8, 0xB563, 0xD0B9, 0xC5B7, 0xD0BA, 0xB564, 0xD0BB, 0xB565, + 0xD0BC, 0xB566, 0xD0BD, 0xB567, 0xD0BE, 0xB568, 0xD0BF, 0xB569, 0xD0C0, 0xC5B8, 0xD0C1, 0xC5B9, 0xD0C2, 0xB56A, 0xD0C3, 0xB56B, + 0xD0C4, 0xC5BA, 0xD0C5, 0xB56C, 0xD0C6, 0xB56D, 0xD0C7, 0xB56E, 0xD0C8, 0xC5BB, 0xD0C9, 0xC5BC, 0xD0CA, 0xB56F, 0xD0CB, 0xB570, + 0xD0CC, 0xB571, 0xD0CD, 0xB572, 0xD0CE, 0xB573, 0xD0CF, 0xB574, 0xD0D0, 0xC5BD, 0xD0D1, 0xC5BE, 0xD0D2, 0xB575, 0xD0D3, 0xC5BF, + 0xD0D4, 0xC5C0, 0xD0D5, 0xC5C1, 0xD0D6, 0xB576, 0xD0D7, 0xB577, 0xD0D8, 0xB578, 0xD0D9, 0xB579, 0xD0DA, 0xB57A, 0xD0DB, 0xB581, + 0xD0DC, 0xC5C2, 0xD0DD, 0xC5C3, 0xD0DE, 0xB582, 0xD0DF, 0xB583, 0xD0E0, 0xC5C4, 0xD0E1, 0xB584, 0xD0E2, 0xB585, 0xD0E3, 0xB586, + 0xD0E4, 0xC5C5, 0xD0E5, 0xB587, 0xD0E6, 0xB588, 0xD0E7, 0xB589, 0xD0E8, 0xB58A, 0xD0E9, 0xB58B, 0xD0EA, 0xB58C, 0xD0EB, 0xB58D, + 0xD0EC, 0xC5C6, 0xD0ED, 0xC5C7, 0xD0EE, 0xB58E, 0xD0EF, 0xC5C8, 0xD0F0, 0xC5C9, 0xD0F1, 0xC5CA, 0xD0F2, 0xB58F, 0xD0F3, 0xB590, + 0xD0F4, 0xB591, 0xD0F5, 0xB592, 0xD0F6, 0xB593, 0xD0F7, 0xB594, 0xD0F8, 0xC5CB, 0xD0F9, 0xB595, 0xD0FA, 0xB596, 0xD0FB, 0xB597, + 0xD0FC, 0xB598, 0xD0FD, 0xB599, 0xD0FE, 0xB59A, 0xD0FF, 0xB59B, 0xD100, 0xB59C, 0xD101, 0xB59D, 0xD102, 0xB59E, 0xD103, 0xB59F, + 0xD104, 0xB5A0, 0xD105, 0xB641, 0xD106, 0xB642, 0xD107, 0xB643, 0xD108, 0xB644, 0xD109, 0xB645, 0xD10A, 0xB646, 0xD10B, 0xB647, + 0xD10C, 0xB648, 0xD10D, 0xC5CC, 0xD10E, 0xB649, 0xD10F, 0xB64A, 0xD110, 0xB64B, 0xD111, 0xB64C, 0xD112, 0xB64D, 0xD113, 0xB64E, + 0xD114, 0xB64F, 0xD115, 0xB650, 0xD116, 0xB651, 0xD117, 0xB652, 0xD118, 0xB653, 0xD119, 0xB654, 0xD11A, 0xB655, 0xD11B, 0xB656, + 0xD11C, 0xB657, 0xD11D, 0xB658, 0xD11E, 0xB659, 0xD11F, 0xB65A, 0xD120, 0xB661, 0xD121, 0xB662, 0xD122, 0xB663, 0xD123, 0xB664, + 0xD124, 0xB665, 0xD125, 0xB666, 0xD126, 0xB667, 0xD127, 0xB668, 0xD128, 0xB669, 0xD129, 0xB66A, 0xD12A, 0xB66B, 0xD12B, 0xB66C, + 0xD12C, 0xB66D, 0xD12D, 0xB66E, 0xD12E, 0xB66F, 0xD12F, 0xB670, 0xD130, 0xC5CD, 0xD131, 0xC5CE, 0xD132, 0xB671, 0xD133, 0xB672, + 0xD134, 0xC5CF, 0xD135, 0xB673, 0xD136, 0xB674, 0xD137, 0xB675, 0xD138, 0xC5D0, 0xD139, 0xB676, 0xD13A, 0xC5D1, 0xD13B, 0xB677, + 0xD13C, 0xB678, 0xD13D, 0xB679, 0xD13E, 0xB67A, 0xD13F, 0xB681, 0xD140, 0xC5D2, 0xD141, 0xC5D3, 0xD142, 0xB682, 0xD143, 0xC5D4, + 0xD144, 0xC5D5, 0xD145, 0xC5D6, 0xD146, 0xB683, 0xD147, 0xB684, 0xD148, 0xB685, 0xD149, 0xB686, 0xD14A, 0xB687, 0xD14B, 0xB688, + 0xD14C, 0xC5D7, 0xD14D, 0xC5D8, 0xD14E, 0xB689, 0xD14F, 0xB68A, 0xD150, 0xC5D9, 0xD151, 0xB68B, 0xD152, 0xB68C, 0xD153, 0xB68D, + 0xD154, 0xC5DA, 0xD155, 0xB68E, 0xD156, 0xB68F, 0xD157, 0xB690, 0xD158, 0xB691, 0xD159, 0xB692, 0xD15A, 0xB693, 0xD15B, 0xB694, + 0xD15C, 0xC5DB, 0xD15D, 0xC5DC, 0xD15E, 0xB695, 0xD15F, 0xC5DD, 0xD160, 0xB696, 0xD161, 0xC5DE, 0xD162, 0xB697, 0xD163, 0xB698, + 0xD164, 0xB699, 0xD165, 0xB69A, 0xD166, 0xB69B, 0xD167, 0xB69C, 0xD168, 0xC5DF, 0xD169, 0xB69D, 0xD16A, 0xB69E, 0xD16B, 0xB69F, + 0xD16C, 0xC5E0, 0xD16D, 0xB6A0, 0xD16E, 0xB741, 0xD16F, 0xB742, 0xD170, 0xB743, 0xD171, 0xB744, 0xD172, 0xB745, 0xD173, 0xB746, + 0xD174, 0xB747, 0xD175, 0xB748, 0xD176, 0xB749, 0xD177, 0xB74A, 0xD178, 0xB74B, 0xD179, 0xB74C, 0xD17A, 0xB74D, 0xD17B, 0xB74E, + 0xD17C, 0xC5E1, 0xD17D, 0xB74F, 0xD17E, 0xB750, 0xD17F, 0xB751, 0xD180, 0xB752, 0xD181, 0xB753, 0xD182, 0xB754, 0xD183, 0xB755, + 0xD184, 0xC5E2, 0xD185, 0xB756, 0xD186, 0xB757, 0xD187, 0xB758, 0xD188, 0xC5E3, 0xD189, 0xB759, 0xD18A, 0xB75A, 0xD18B, 0xB761, + 0xD18C, 0xB762, 0xD18D, 0xB763, 0xD18E, 0xB764, 0xD18F, 0xB765, 0xD190, 0xB766, 0xD191, 0xB767, 0xD192, 0xB768, 0xD193, 0xB769, + 0xD194, 0xB76A, 0xD195, 0xB76B, 0xD196, 0xB76C, 0xD197, 0xB76D, 0xD198, 0xB76E, 0xD199, 0xB76F, 0xD19A, 0xB770, 0xD19B, 0xB771, + 0xD19C, 0xB772, 0xD19D, 0xB773, 0xD19E, 0xB774, 0xD19F, 0xB775, 0xD1A0, 0xC5E4, 0xD1A1, 0xC5E5, 0xD1A2, 0xB776, 0xD1A3, 0xB777, + 0xD1A4, 0xC5E6, 0xD1A5, 0xB778, 0xD1A6, 0xB779, 0xD1A7, 0xB77A, 0xD1A8, 0xC5E7, 0xD1A9, 0xB781, 0xD1AA, 0xB782, 0xD1AB, 0xB783, + 0xD1AC, 0xB784, 0xD1AD, 0xB785, 0xD1AE, 0xB786, 0xD1AF, 0xB787, 0xD1B0, 0xC5E8, 0xD1B1, 0xC5E9, 0xD1B2, 0xB788, 0xD1B3, 0xC5EA, + 0xD1B4, 0xB789, 0xD1B5, 0xC5EB, 0xD1B6, 0xB78A, 0xD1B7, 0xB78B, 0xD1B8, 0xB78C, 0xD1B9, 0xB78D, 0xD1BA, 0xC5EC, 0xD1BB, 0xB78E, + 0xD1BC, 0xC5ED, 0xD1BD, 0xB78F, 0xD1BE, 0xB790, 0xD1BF, 0xB791, 0xD1C0, 0xC5EE, 0xD1C1, 0xB792, 0xD1C2, 0xB793, 0xD1C3, 0xB794, + 0xD1C4, 0xB795, 0xD1C5, 0xB796, 0xD1C6, 0xB797, 0xD1C7, 0xB798, 0xD1C8, 0xB799, 0xD1C9, 0xB79A, 0xD1CA, 0xB79B, 0xD1CB, 0xB79C, + 0xD1CC, 0xB79D, 0xD1CD, 0xB79E, 0xD1CE, 0xB79F, 0xD1CF, 0xB7A0, 0xD1D0, 0xB841, 0xD1D1, 0xB842, 0xD1D2, 0xB843, 0xD1D3, 0xB844, + 0xD1D4, 0xB845, 0xD1D5, 0xB846, 0xD1D6, 0xB847, 0xD1D7, 0xB848, 0xD1D8, 0xC5EF, 0xD1D9, 0xB849, 0xD1DA, 0xB84A, 0xD1DB, 0xB84B, + 0xD1DC, 0xB84C, 0xD1DD, 0xB84D, 0xD1DE, 0xB84E, 0xD1DF, 0xB84F, 0xD1E0, 0xB850, 0xD1E1, 0xB851, 0xD1E2, 0xB852, 0xD1E3, 0xB853, + 0xD1E4, 0xB854, 0xD1E5, 0xB855, 0xD1E6, 0xB856, 0xD1E7, 0xB857, 0xD1E8, 0xB858, 0xD1E9, 0xB859, 0xD1EA, 0xB85A, 0xD1EB, 0xB861, + 0xD1EC, 0xB862, 0xD1ED, 0xB863, 0xD1EE, 0xB864, 0xD1EF, 0xB865, 0xD1F0, 0xB866, 0xD1F1, 0xB867, 0xD1F2, 0xB868, 0xD1F3, 0xB869, + 0xD1F4, 0xC5F0, 0xD1F5, 0xB86A, 0xD1F6, 0xB86B, 0xD1F7, 0xB86C, 0xD1F8, 0xC5F1, 0xD1F9, 0xB86D, 0xD1FA, 0xB86E, 0xD1FB, 0xB86F, + 0xD1FC, 0xB870, 0xD1FD, 0xB871, 0xD1FE, 0xB872, 0xD1FF, 0xB873, 0xD200, 0xB874, 0xD201, 0xB875, 0xD202, 0xB876, 0xD203, 0xB877, + 0xD204, 0xB878, 0xD205, 0xB879, 0xD206, 0xB87A, 0xD207, 0xC5F2, 0xD208, 0xB881, 0xD209, 0xC5F3, 0xD20A, 0xB882, 0xD20B, 0xB883, + 0xD20C, 0xB884, 0xD20D, 0xB885, 0xD20E, 0xB886, 0xD20F, 0xB887, 0xD210, 0xC5F4, 0xD211, 0xB888, 0xD212, 0xB889, 0xD213, 0xB88A, + 0xD214, 0xB88B, 0xD215, 0xB88C, 0xD216, 0xB88D, 0xD217, 0xB88E, 0xD218, 0xB88F, 0xD219, 0xB890, 0xD21A, 0xB891, 0xD21B, 0xB892, + 0xD21C, 0xB893, 0xD21D, 0xB894, 0xD21E, 0xB895, 0xD21F, 0xB896, 0xD220, 0xB897, 0xD221, 0xB898, 0xD222, 0xB899, 0xD223, 0xB89A, + 0xD224, 0xB89B, 0xD225, 0xB89C, 0xD226, 0xB89D, 0xD227, 0xB89E, 0xD228, 0xB89F, 0xD229, 0xB8A0, 0xD22A, 0xB941, 0xD22B, 0xB942, + 0xD22C, 0xC5F5, 0xD22D, 0xC5F6, 0xD22E, 0xB943, 0xD22F, 0xB944, 0xD230, 0xC5F7, 0xD231, 0xB945, 0xD232, 0xB946, 0xD233, 0xB947, + 0xD234, 0xC5F8, 0xD235, 0xB948, 0xD236, 0xB949, 0xD237, 0xB94A, 0xD238, 0xB94B, 0xD239, 0xB94C, 0xD23A, 0xB94D, 0xD23B, 0xB94E, + 0xD23C, 0xC5F9, 0xD23D, 0xC5FA, 0xD23E, 0xB94F, 0xD23F, 0xC5FB, 0xD240, 0xB950, 0xD241, 0xC5FC, 0xD242, 0xB951, 0xD243, 0xB952, + 0xD244, 0xB953, 0xD245, 0xB954, 0xD246, 0xB955, 0xD247, 0xB956, 0xD248, 0xC5FD, 0xD249, 0xB957, 0xD24A, 0xB958, 0xD24B, 0xB959, + 0xD24C, 0xB95A, 0xD24D, 0xB961, 0xD24E, 0xB962, 0xD24F, 0xB963, 0xD250, 0xB964, 0xD251, 0xB965, 0xD252, 0xB966, 0xD253, 0xB967, + 0xD254, 0xB968, 0xD255, 0xB969, 0xD256, 0xB96A, 0xD257, 0xB96B, 0xD258, 0xB96C, 0xD259, 0xB96D, 0xD25A, 0xB96E, 0xD25B, 0xB96F, + 0xD25C, 0xC5FE, 0xD25D, 0xB970, 0xD25E, 0xB971, 0xD25F, 0xB972, 0xD260, 0xB973, 0xD261, 0xB974, 0xD262, 0xB975, 0xD263, 0xB976, + 0xD264, 0xC6A1, 0xD265, 0xB977, 0xD266, 0xB978, 0xD267, 0xB979, 0xD268, 0xB97A, 0xD269, 0xB981, 0xD26A, 0xB982, 0xD26B, 0xB983, + 0xD26C, 0xB984, 0xD26D, 0xB985, 0xD26E, 0xB986, 0xD26F, 0xB987, 0xD270, 0xB988, 0xD271, 0xB989, 0xD272, 0xB98A, 0xD273, 0xB98B, + 0xD274, 0xB98C, 0xD275, 0xB98D, 0xD276, 0xB98E, 0xD277, 0xB98F, 0xD278, 0xB990, 0xD279, 0xB991, 0xD27A, 0xB992, 0xD27B, 0xB993, + 0xD27C, 0xB994, 0xD27D, 0xB995, 0xD27E, 0xB996, 0xD27F, 0xB997, 0xD280, 0xC6A2, 0xD281, 0xC6A3, 0xD282, 0xB998, 0xD283, 0xB999, + 0xD284, 0xC6A4, 0xD285, 0xB99A, 0xD286, 0xB99B, 0xD287, 0xB99C, 0xD288, 0xC6A5, 0xD289, 0xB99D, 0xD28A, 0xB99E, 0xD28B, 0xB99F, + 0xD28C, 0xB9A0, 0xD28D, 0xBA41, 0xD28E, 0xBA42, 0xD28F, 0xBA43, 0xD290, 0xC6A6, 0xD291, 0xC6A7, 0xD292, 0xBA44, 0xD293, 0xBA45, + 0xD294, 0xBA46, 0xD295, 0xC6A8, 0xD296, 0xBA47, 0xD297, 0xBA48, 0xD298, 0xBA49, 0xD299, 0xBA4A, 0xD29A, 0xBA4B, 0xD29B, 0xBA4C, + 0xD29C, 0xC6A9, 0xD29D, 0xBA4D, 0xD29E, 0xBA4E, 0xD29F, 0xBA4F, 0xD2A0, 0xC6AA, 0xD2A1, 0xBA50, 0xD2A2, 0xBA51, 0xD2A3, 0xBA52, + 0xD2A4, 0xC6AB, 0xD2A5, 0xBA53, 0xD2A6, 0xBA54, 0xD2A7, 0xBA55, 0xD2A8, 0xBA56, 0xD2A9, 0xBA57, 0xD2AA, 0xBA58, 0xD2AB, 0xBA59, + 0xD2AC, 0xC6AC, 0xD2AD, 0xBA5A, 0xD2AE, 0xBA61, 0xD2AF, 0xBA62, 0xD2B0, 0xBA63, 0xD2B1, 0xC6AD, 0xD2B2, 0xBA64, 0xD2B3, 0xBA65, + 0xD2B4, 0xBA66, 0xD2B5, 0xBA67, 0xD2B6, 0xBA68, 0xD2B7, 0xBA69, 0xD2B8, 0xC6AE, 0xD2B9, 0xC6AF, 0xD2BA, 0xBA6A, 0xD2BB, 0xBA6B, + 0xD2BC, 0xC6B0, 0xD2BD, 0xBA6C, 0xD2BE, 0xBA6D, 0xD2BF, 0xC6B1, 0xD2C0, 0xC6B2, 0xD2C1, 0xBA6E, 0xD2C2, 0xC6B3, 0xD2C3, 0xBA6F, + 0xD2C4, 0xBA70, 0xD2C5, 0xBA71, 0xD2C6, 0xBA72, 0xD2C7, 0xBA73, 0xD2C8, 0xC6B4, 0xD2C9, 0xC6B5, 0xD2CA, 0xBA74, 0xD2CB, 0xC6B6, + 0xD2CC, 0xBA75, 0xD2CD, 0xBA76, 0xD2CE, 0xBA77, 0xD2CF, 0xBA78, 0xD2D0, 0xBA79, 0xD2D1, 0xBA7A, 0xD2D2, 0xBA81, 0xD2D3, 0xBA82, + 0xD2D4, 0xC6B7, 0xD2D5, 0xBA83, 0xD2D6, 0xBA84, 0xD2D7, 0xBA85, 0xD2D8, 0xC6B8, 0xD2D9, 0xBA86, 0xD2DA, 0xBA87, 0xD2DB, 0xBA88, + 0xD2DC, 0xC6B9, 0xD2DD, 0xBA89, 0xD2DE, 0xBA8A, 0xD2DF, 0xBA8B, 0xD2E0, 0xBA8C, 0xD2E1, 0xBA8D, 0xD2E2, 0xBA8E, 0xD2E3, 0xBA8F, + 0xD2E4, 0xC6BA, 0xD2E5, 0xC6BB, 0xD2E6, 0xBA90, 0xD2E7, 0xBA91, 0xD2E8, 0xBA92, 0xD2E9, 0xBA93, 0xD2EA, 0xBA94, 0xD2EB, 0xBA95, + 0xD2EC, 0xBA96, 0xD2ED, 0xBA97, 0xD2EE, 0xBA98, 0xD2EF, 0xBA99, 0xD2F0, 0xC6BC, 0xD2F1, 0xC6BD, 0xD2F2, 0xBA9A, 0xD2F3, 0xBA9B, + 0xD2F4, 0xC6BE, 0xD2F5, 0xBA9C, 0xD2F6, 0xBA9D, 0xD2F7, 0xBA9E, 0xD2F8, 0xC6BF, 0xD2F9, 0xBA9F, 0xD2FA, 0xBAA0, 0xD2FB, 0xBB41, + 0xD2FC, 0xBB42, 0xD2FD, 0xBB43, 0xD2FE, 0xBB44, 0xD2FF, 0xBB45, 0xD300, 0xC6C0, 0xD301, 0xC6C1, 0xD302, 0xBB46, 0xD303, 0xC6C2, + 0xD304, 0xBB47, 0xD305, 0xC6C3, 0xD306, 0xBB48, 0xD307, 0xBB49, 0xD308, 0xBB4A, 0xD309, 0xBB4B, 0xD30A, 0xBB4C, 0xD30B, 0xBB4D, + 0xD30C, 0xC6C4, 0xD30D, 0xC6C5, 0xD30E, 0xC6C6, 0xD30F, 0xBB4E, 0xD310, 0xC6C7, 0xD311, 0xBB4F, 0xD312, 0xBB50, 0xD313, 0xBB51, + 0xD314, 0xC6C8, 0xD315, 0xBB52, 0xD316, 0xC6C9, 0xD317, 0xBB53, 0xD318, 0xBB54, 0xD319, 0xBB55, 0xD31A, 0xBB56, 0xD31B, 0xBB57, + 0xD31C, 0xC6CA, 0xD31D, 0xC6CB, 0xD31E, 0xBB58, 0xD31F, 0xC6CC, 0xD320, 0xC6CD, 0xD321, 0xC6CE, 0xD322, 0xBB59, 0xD323, 0xBB5A, + 0xD324, 0xBB61, 0xD325, 0xC6CF, 0xD326, 0xBB62, 0xD327, 0xBB63, 0xD328, 0xC6D0, 0xD329, 0xC6D1, 0xD32A, 0xBB64, 0xD32B, 0xBB65, + 0xD32C, 0xC6D2, 0xD32D, 0xBB66, 0xD32E, 0xBB67, 0xD32F, 0xBB68, 0xD330, 0xC6D3, 0xD331, 0xBB69, 0xD332, 0xBB6A, 0xD333, 0xBB6B, + 0xD334, 0xBB6C, 0xD335, 0xBB6D, 0xD336, 0xBB6E, 0xD337, 0xBB6F, 0xD338, 0xC6D4, 0xD339, 0xC6D5, 0xD33A, 0xBB70, 0xD33B, 0xC6D6, + 0xD33C, 0xC6D7, 0xD33D, 0xC6D8, 0xD33E, 0xBB71, 0xD33F, 0xBB72, 0xD340, 0xBB73, 0xD341, 0xBB74, 0xD342, 0xBB75, 0xD343, 0xBB76, + 0xD344, 0xC6D9, 0xD345, 0xC6DA, 0xD346, 0xBB77, 0xD347, 0xBB78, 0xD348, 0xBB79, 0xD349, 0xBB7A, 0xD34A, 0xBB81, 0xD34B, 0xBB82, + 0xD34C, 0xBB83, 0xD34D, 0xBB84, 0xD34E, 0xBB85, 0xD34F, 0xBB86, 0xD350, 0xBB87, 0xD351, 0xBB88, 0xD352, 0xBB89, 0xD353, 0xBB8A, + 0xD354, 0xBB8B, 0xD355, 0xBB8C, 0xD356, 0xBB8D, 0xD357, 0xBB8E, 0xD358, 0xBB8F, 0xD359, 0xBB90, 0xD35A, 0xBB91, 0xD35B, 0xBB92, + 0xD35C, 0xBB93, 0xD35D, 0xBB94, 0xD35E, 0xBB95, 0xD35F, 0xBB96, 0xD360, 0xBB97, 0xD361, 0xBB98, 0xD362, 0xBB99, 0xD363, 0xBB9A, + 0xD364, 0xBB9B, 0xD365, 0xBB9C, 0xD366, 0xBB9D, 0xD367, 0xBB9E, 0xD368, 0xBB9F, 0xD369, 0xBBA0, 0xD36A, 0xBC41, 0xD36B, 0xBC42, + 0xD36C, 0xBC43, 0xD36D, 0xBC44, 0xD36E, 0xBC45, 0xD36F, 0xBC46, 0xD370, 0xBC47, 0xD371, 0xBC48, 0xD372, 0xBC49, 0xD373, 0xBC4A, + 0xD374, 0xBC4B, 0xD375, 0xBC4C, 0xD376, 0xBC4D, 0xD377, 0xBC4E, 0xD378, 0xBC4F, 0xD379, 0xBC50, 0xD37A, 0xBC51, 0xD37B, 0xBC52, + 0xD37C, 0xC6DB, 0xD37D, 0xC6DC, 0xD37E, 0xBC53, 0xD37F, 0xBC54, 0xD380, 0xC6DD, 0xD381, 0xBC55, 0xD382, 0xBC56, 0xD383, 0xBC57, + 0xD384, 0xC6DE, 0xD385, 0xBC58, 0xD386, 0xBC59, 0xD387, 0xBC5A, 0xD388, 0xBC61, 0xD389, 0xBC62, 0xD38A, 0xBC63, 0xD38B, 0xBC64, + 0xD38C, 0xC6DF, 0xD38D, 0xC6E0, 0xD38E, 0xBC65, 0xD38F, 0xC6E1, 0xD390, 0xC6E2, 0xD391, 0xC6E3, 0xD392, 0xBC66, 0xD393, 0xBC67, + 0xD394, 0xBC68, 0xD395, 0xBC69, 0xD396, 0xBC6A, 0xD397, 0xBC6B, 0xD398, 0xC6E4, 0xD399, 0xC6E5, 0xD39A, 0xBC6C, 0xD39B, 0xBC6D, + 0xD39C, 0xC6E6, 0xD39D, 0xBC6E, 0xD39E, 0xBC6F, 0xD39F, 0xBC70, 0xD3A0, 0xC6E7, 0xD3A1, 0xBC71, 0xD3A2, 0xBC72, 0xD3A3, 0xBC73, + 0xD3A4, 0xBC74, 0xD3A5, 0xBC75, 0xD3A6, 0xBC76, 0xD3A7, 0xBC77, 0xD3A8, 0xC6E8, 0xD3A9, 0xC6E9, 0xD3AA, 0xBC78, 0xD3AB, 0xC6EA, + 0xD3AC, 0xBC79, 0xD3AD, 0xC6EB, 0xD3AE, 0xBC7A, 0xD3AF, 0xBC81, 0xD3B0, 0xBC82, 0xD3B1, 0xBC83, 0xD3B2, 0xBC84, 0xD3B3, 0xBC85, + 0xD3B4, 0xC6EC, 0xD3B5, 0xBC86, 0xD3B6, 0xBC87, 0xD3B7, 0xBC88, 0xD3B8, 0xC6ED, 0xD3B9, 0xBC89, 0xD3BA, 0xBC8A, 0xD3BB, 0xBC8B, + 0xD3BC, 0xC6EE, 0xD3BD, 0xBC8C, 0xD3BE, 0xBC8D, 0xD3BF, 0xBC8E, 0xD3C0, 0xBC8F, 0xD3C1, 0xBC90, 0xD3C2, 0xBC91, 0xD3C3, 0xBC92, + 0xD3C4, 0xC6EF, 0xD3C5, 0xC6F0, 0xD3C6, 0xBC93, 0xD3C7, 0xBC94, 0xD3C8, 0xC6F1, 0xD3C9, 0xC6F2, 0xD3CA, 0xBC95, 0xD3CB, 0xBC96, + 0xD3CC, 0xBC97, 0xD3CD, 0xBC98, 0xD3CE, 0xBC99, 0xD3CF, 0xBC9A, 0xD3D0, 0xC6F3, 0xD3D1, 0xBC9B, 0xD3D2, 0xBC9C, 0xD3D3, 0xBC9D, + 0xD3D4, 0xBC9E, 0xD3D5, 0xBC9F, 0xD3D6, 0xBCA0, 0xD3D7, 0xBD41, 0xD3D8, 0xC6F4, 0xD3D9, 0xBD42, 0xD3DA, 0xBD43, 0xD3DB, 0xBD44, + 0xD3DC, 0xBD45, 0xD3DD, 0xBD46, 0xD3DE, 0xBD47, 0xD3DF, 0xBD48, 0xD3E0, 0xBD49, 0xD3E1, 0xC6F5, 0xD3E2, 0xBD4A, 0xD3E3, 0xC6F6, + 0xD3E4, 0xBD4B, 0xD3E5, 0xBD4C, 0xD3E6, 0xBD4D, 0xD3E7, 0xBD4E, 0xD3E8, 0xBD4F, 0xD3E9, 0xBD50, 0xD3EA, 0xBD51, 0xD3EB, 0xBD52, + 0xD3EC, 0xC6F7, 0xD3ED, 0xC6F8, 0xD3EE, 0xBD53, 0xD3EF, 0xBD54, 0xD3F0, 0xC6F9, 0xD3F1, 0xBD55, 0xD3F2, 0xBD56, 0xD3F3, 0xBD57, + 0xD3F4, 0xC6FA, 0xD3F5, 0xBD58, 0xD3F6, 0xBD59, 0xD3F7, 0xBD5A, 0xD3F8, 0xBD61, 0xD3F9, 0xBD62, 0xD3FA, 0xBD63, 0xD3FB, 0xBD64, + 0xD3FC, 0xC6FB, 0xD3FD, 0xC6FC, 0xD3FE, 0xBD65, 0xD3FF, 0xC6FD, 0xD400, 0xBD66, 0xD401, 0xC6FE, 0xD402, 0xBD67, 0xD403, 0xBD68, + 0xD404, 0xBD69, 0xD405, 0xBD6A, 0xD406, 0xBD6B, 0xD407, 0xBD6C, 0xD408, 0xC7A1, 0xD409, 0xBD6D, 0xD40A, 0xBD6E, 0xD40B, 0xBD6F, + 0xD40C, 0xBD70, 0xD40D, 0xBD71, 0xD40E, 0xBD72, 0xD40F, 0xBD73, 0xD410, 0xBD74, 0xD411, 0xBD75, 0xD412, 0xBD76, 0xD413, 0xBD77, + 0xD414, 0xBD78, 0xD415, 0xBD79, 0xD416, 0xBD7A, 0xD417, 0xBD81, 0xD418, 0xBD82, 0xD419, 0xBD83, 0xD41A, 0xBD84, 0xD41B, 0xBD85, + 0xD41C, 0xBD86, 0xD41D, 0xC7A2, 0xD41E, 0xBD87, 0xD41F, 0xBD88, 0xD420, 0xBD89, 0xD421, 0xBD8A, 0xD422, 0xBD8B, 0xD423, 0xBD8C, + 0xD424, 0xBD8D, 0xD425, 0xBD8E, 0xD426, 0xBD8F, 0xD427, 0xBD90, 0xD428, 0xBD91, 0xD429, 0xBD92, 0xD42A, 0xBD93, 0xD42B, 0xBD94, + 0xD42C, 0xBD95, 0xD42D, 0xBD96, 0xD42E, 0xBD97, 0xD42F, 0xBD98, 0xD430, 0xBD99, 0xD431, 0xBD9A, 0xD432, 0xBD9B, 0xD433, 0xBD9C, + 0xD434, 0xBD9D, 0xD435, 0xBD9E, 0xD436, 0xBD9F, 0xD437, 0xBDA0, 0xD438, 0xBE41, 0xD439, 0xBE42, 0xD43A, 0xBE43, 0xD43B, 0xBE44, + 0xD43C, 0xBE45, 0xD43D, 0xBE46, 0xD43E, 0xBE47, 0xD43F, 0xBE48, 0xD440, 0xC7A3, 0xD441, 0xBE49, 0xD442, 0xBE4A, 0xD443, 0xBE4B, + 0xD444, 0xC7A4, 0xD445, 0xBE4C, 0xD446, 0xBE4D, 0xD447, 0xBE4E, 0xD448, 0xBE4F, 0xD449, 0xBE50, 0xD44A, 0xBE51, 0xD44B, 0xBE52, + 0xD44C, 0xBE53, 0xD44D, 0xBE54, 0xD44E, 0xBE55, 0xD44F, 0xBE56, 0xD450, 0xBE57, 0xD451, 0xBE58, 0xD452, 0xBE59, 0xD453, 0xBE5A, + 0xD454, 0xBE61, 0xD455, 0xBE62, 0xD456, 0xBE63, 0xD457, 0xBE64, 0xD458, 0xBE65, 0xD459, 0xBE66, 0xD45A, 0xBE67, 0xD45B, 0xBE68, + 0xD45C, 0xC7A5, 0xD45D, 0xBE69, 0xD45E, 0xBE6A, 0xD45F, 0xBE6B, 0xD460, 0xC7A6, 0xD461, 0xBE6C, 0xD462, 0xBE6D, 0xD463, 0xBE6E, + 0xD464, 0xC7A7, 0xD465, 0xBE6F, 0xD466, 0xBE70, 0xD467, 0xBE71, 0xD468, 0xBE72, 0xD469, 0xBE73, 0xD46A, 0xBE74, 0xD46B, 0xBE75, + 0xD46C, 0xBE76, 0xD46D, 0xC7A8, 0xD46E, 0xBE77, 0xD46F, 0xC7A9, 0xD470, 0xBE78, 0xD471, 0xBE79, 0xD472, 0xBE7A, 0xD473, 0xBE81, + 0xD474, 0xBE82, 0xD475, 0xBE83, 0xD476, 0xBE84, 0xD477, 0xBE85, 0xD478, 0xC7AA, 0xD479, 0xC7AB, 0xD47A, 0xBE86, 0xD47B, 0xBE87, + 0xD47C, 0xC7AC, 0xD47D, 0xBE88, 0xD47E, 0xBE89, 0xD47F, 0xC7AD, 0xD480, 0xC7AE, 0xD481, 0xBE8A, 0xD482, 0xC7AF, 0xD483, 0xBE8B, + 0xD484, 0xBE8C, 0xD485, 0xBE8D, 0xD486, 0xBE8E, 0xD487, 0xBE8F, 0xD488, 0xC7B0, 0xD489, 0xC7B1, 0xD48A, 0xBE90, 0xD48B, 0xC7B2, + 0xD48C, 0xBE91, 0xD48D, 0xC7B3, 0xD48E, 0xBE92, 0xD48F, 0xBE93, 0xD490, 0xBE94, 0xD491, 0xBE95, 0xD492, 0xBE96, 0xD493, 0xBE97, + 0xD494, 0xC7B4, 0xD495, 0xBE98, 0xD496, 0xBE99, 0xD497, 0xBE9A, 0xD498, 0xBE9B, 0xD499, 0xBE9C, 0xD49A, 0xBE9D, 0xD49B, 0xBE9E, + 0xD49C, 0xBE9F, 0xD49D, 0xBEA0, 0xD49E, 0xBF41, 0xD49F, 0xBF42, 0xD4A0, 0xBF43, 0xD4A1, 0xBF44, 0xD4A2, 0xBF45, 0xD4A3, 0xBF46, + 0xD4A4, 0xBF47, 0xD4A5, 0xBF48, 0xD4A6, 0xBF49, 0xD4A7, 0xBF4A, 0xD4A8, 0xBF4B, 0xD4A9, 0xC7B5, 0xD4AA, 0xBF4C, 0xD4AB, 0xBF4D, + 0xD4AC, 0xBF4E, 0xD4AD, 0xBF4F, 0xD4AE, 0xBF50, 0xD4AF, 0xBF51, 0xD4B0, 0xBF52, 0xD4B1, 0xBF53, 0xD4B2, 0xBF54, 0xD4B3, 0xBF55, + 0xD4B4, 0xBF56, 0xD4B5, 0xBF57, 0xD4B6, 0xBF58, 0xD4B7, 0xBF59, 0xD4B8, 0xBF5A, 0xD4B9, 0xBF61, 0xD4BA, 0xBF62, 0xD4BB, 0xBF63, + 0xD4BC, 0xBF64, 0xD4BD, 0xBF65, 0xD4BE, 0xBF66, 0xD4BF, 0xBF67, 0xD4C0, 0xBF68, 0xD4C1, 0xBF69, 0xD4C2, 0xBF6A, 0xD4C3, 0xBF6B, + 0xD4C4, 0xBF6C, 0xD4C5, 0xBF6D, 0xD4C6, 0xBF6E, 0xD4C7, 0xBF6F, 0xD4C8, 0xBF70, 0xD4C9, 0xBF71, 0xD4CA, 0xBF72, 0xD4CB, 0xBF73, + 0xD4CC, 0xC7B6, 0xD4CD, 0xBF74, 0xD4CE, 0xBF75, 0xD4CF, 0xBF76, 0xD4D0, 0xC7B7, 0xD4D1, 0xBF77, 0xD4D2, 0xBF78, 0xD4D3, 0xBF79, + 0xD4D4, 0xC7B8, 0xD4D5, 0xBF7A, 0xD4D6, 0xBF81, 0xD4D7, 0xBF82, 0xD4D8, 0xBF83, 0xD4D9, 0xBF84, 0xD4DA, 0xBF85, 0xD4DB, 0xBF86, + 0xD4DC, 0xC7B9, 0xD4DD, 0xBF87, 0xD4DE, 0xBF88, 0xD4DF, 0xC7BA, 0xD4E0, 0xBF89, 0xD4E1, 0xBF8A, 0xD4E2, 0xBF8B, 0xD4E3, 0xBF8C, + 0xD4E4, 0xBF8D, 0xD4E5, 0xBF8E, 0xD4E6, 0xBF8F, 0xD4E7, 0xBF90, 0xD4E8, 0xC7BB, 0xD4E9, 0xBF91, 0xD4EA, 0xBF92, 0xD4EB, 0xBF93, + 0xD4EC, 0xC7BC, 0xD4ED, 0xBF94, 0xD4EE, 0xBF95, 0xD4EF, 0xBF96, 0xD4F0, 0xC7BD, 0xD4F1, 0xBF97, 0xD4F2, 0xBF98, 0xD4F3, 0xBF99, + 0xD4F4, 0xBF9A, 0xD4F5, 0xBF9B, 0xD4F6, 0xBF9C, 0xD4F7, 0xBF9D, 0xD4F8, 0xC7BE, 0xD4F9, 0xBF9E, 0xD4FA, 0xBF9F, 0xD4FB, 0xC7BF, + 0xD4FC, 0xBFA0, 0xD4FD, 0xC7C0, 0xD4FE, 0xC041, 0xD4FF, 0xC042, 0xD500, 0xC043, 0xD501, 0xC044, 0xD502, 0xC045, 0xD503, 0xC046, + 0xD504, 0xC7C1, 0xD505, 0xC047, 0xD506, 0xC048, 0xD507, 0xC049, 0xD508, 0xC7C2, 0xD509, 0xC04A, 0xD50A, 0xC04B, 0xD50B, 0xC04C, + 0xD50C, 0xC7C3, 0xD50D, 0xC04D, 0xD50E, 0xC04E, 0xD50F, 0xC04F, 0xD510, 0xC050, 0xD511, 0xC051, 0xD512, 0xC052, 0xD513, 0xC053, + 0xD514, 0xC7C4, 0xD515, 0xC7C5, 0xD516, 0xC054, 0xD517, 0xC7C6, 0xD518, 0xC055, 0xD519, 0xC056, 0xD51A, 0xC057, 0xD51B, 0xC058, + 0xD51C, 0xC059, 0xD51D, 0xC05A, 0xD51E, 0xC061, 0xD51F, 0xC062, 0xD520, 0xC063, 0xD521, 0xC064, 0xD522, 0xC065, 0xD523, 0xC066, + 0xD524, 0xC067, 0xD525, 0xC068, 0xD526, 0xC069, 0xD527, 0xC06A, 0xD528, 0xC06B, 0xD529, 0xC06C, 0xD52A, 0xC06D, 0xD52B, 0xC06E, + 0xD52C, 0xC06F, 0xD52D, 0xC070, 0xD52E, 0xC071, 0xD52F, 0xC072, 0xD530, 0xC073, 0xD531, 0xC074, 0xD532, 0xC075, 0xD533, 0xC076, + 0xD534, 0xC077, 0xD535, 0xC078, 0xD536, 0xC079, 0xD537, 0xC07A, 0xD538, 0xC081, 0xD539, 0xC082, 0xD53A, 0xC083, 0xD53B, 0xC084, + 0xD53C, 0xC7C7, 0xD53D, 0xC7C8, 0xD53E, 0xC085, 0xD53F, 0xC086, 0xD540, 0xC7C9, 0xD541, 0xC087, 0xD542, 0xC088, 0xD543, 0xC089, + 0xD544, 0xC7CA, 0xD545, 0xC08A, 0xD546, 0xC08B, 0xD547, 0xC08C, 0xD548, 0xC08D, 0xD549, 0xC08E, 0xD54A, 0xC08F, 0xD54B, 0xC090, + 0xD54C, 0xC7CB, 0xD54D, 0xC7CC, 0xD54E, 0xC091, 0xD54F, 0xC7CD, 0xD550, 0xC092, 0xD551, 0xC7CE, 0xD552, 0xC093, 0xD553, 0xC094, + 0xD554, 0xC095, 0xD555, 0xC096, 0xD556, 0xC097, 0xD557, 0xC098, 0xD558, 0xC7CF, 0xD559, 0xC7D0, 0xD55A, 0xC099, 0xD55B, 0xC09A, + 0xD55C, 0xC7D1, 0xD55D, 0xC09B, 0xD55E, 0xC09C, 0xD55F, 0xC09D, 0xD560, 0xC7D2, 0xD561, 0xC09E, 0xD562, 0xC09F, 0xD563, 0xC0A0, + 0xD564, 0xC141, 0xD565, 0xC7D3, 0xD566, 0xC142, 0xD567, 0xC143, 0xD568, 0xC7D4, 0xD569, 0xC7D5, 0xD56A, 0xC144, 0xD56B, 0xC7D6, + 0xD56C, 0xC145, 0xD56D, 0xC7D7, 0xD56E, 0xC146, 0xD56F, 0xC147, 0xD570, 0xC148, 0xD571, 0xC149, 0xD572, 0xC14A, 0xD573, 0xC14B, + 0xD574, 0xC7D8, 0xD575, 0xC7D9, 0xD576, 0xC14C, 0xD577, 0xC14D, 0xD578, 0xC7DA, 0xD579, 0xC14E, 0xD57A, 0xC14F, 0xD57B, 0xC150, + 0xD57C, 0xC7DB, 0xD57D, 0xC151, 0xD57E, 0xC152, 0xD57F, 0xC153, 0xD580, 0xC154, 0xD581, 0xC155, 0xD582, 0xC156, 0xD583, 0xC157, + 0xD584, 0xC7DC, 0xD585, 0xC7DD, 0xD586, 0xC158, 0xD587, 0xC7DE, 0xD588, 0xC7DF, 0xD589, 0xC7E0, 0xD58A, 0xC159, 0xD58B, 0xC15A, + 0xD58C, 0xC161, 0xD58D, 0xC162, 0xD58E, 0xC163, 0xD58F, 0xC164, 0xD590, 0xC7E1, 0xD591, 0xC165, 0xD592, 0xC166, 0xD593, 0xC167, + 0xD594, 0xC168, 0xD595, 0xC169, 0xD596, 0xC16A, 0xD597, 0xC16B, 0xD598, 0xC16C, 0xD599, 0xC16D, 0xD59A, 0xC16E, 0xD59B, 0xC16F, + 0xD59C, 0xC170, 0xD59D, 0xC171, 0xD59E, 0xC172, 0xD59F, 0xC173, 0xD5A0, 0xC174, 0xD5A1, 0xC175, 0xD5A2, 0xC176, 0xD5A3, 0xC177, + 0xD5A4, 0xC178, 0xD5A5, 0xC7E2, 0xD5A6, 0xC179, 0xD5A7, 0xC17A, 0xD5A8, 0xC181, 0xD5A9, 0xC182, 0xD5AA, 0xC183, 0xD5AB, 0xC184, + 0xD5AC, 0xC185, 0xD5AD, 0xC186, 0xD5AE, 0xC187, 0xD5AF, 0xC188, 0xD5B0, 0xC189, 0xD5B1, 0xC18A, 0xD5B2, 0xC18B, 0xD5B3, 0xC18C, + 0xD5B4, 0xC18D, 0xD5B5, 0xC18E, 0xD5B6, 0xC18F, 0xD5B7, 0xC190, 0xD5B8, 0xC191, 0xD5B9, 0xC192, 0xD5BA, 0xC193, 0xD5BB, 0xC194, + 0xD5BC, 0xC195, 0xD5BD, 0xC196, 0xD5BE, 0xC197, 0xD5BF, 0xC198, 0xD5C0, 0xC199, 0xD5C1, 0xC19A, 0xD5C2, 0xC19B, 0xD5C3, 0xC19C, + 0xD5C4, 0xC19D, 0xD5C5, 0xC19E, 0xD5C6, 0xC19F, 0xD5C7, 0xC1A0, 0xD5C8, 0xC7E3, 0xD5C9, 0xC7E4, 0xD5CA, 0xC241, 0xD5CB, 0xC242, + 0xD5CC, 0xC7E5, 0xD5CD, 0xC243, 0xD5CE, 0xC244, 0xD5CF, 0xC245, 0xD5D0, 0xC7E6, 0xD5D1, 0xC246, 0xD5D2, 0xC7E7, 0xD5D3, 0xC247, + 0xD5D4, 0xC248, 0xD5D5, 0xC249, 0xD5D6, 0xC24A, 0xD5D7, 0xC24B, 0xD5D8, 0xC7E8, 0xD5D9, 0xC7E9, 0xD5DA, 0xC24C, 0xD5DB, 0xC7EA, + 0xD5DC, 0xC24D, 0xD5DD, 0xC7EB, 0xD5DE, 0xC24E, 0xD5DF, 0xC24F, 0xD5E0, 0xC250, 0xD5E1, 0xC251, 0xD5E2, 0xC252, 0xD5E3, 0xC253, + 0xD5E4, 0xC7EC, 0xD5E5, 0xC7ED, 0xD5E6, 0xC254, 0xD5E7, 0xC255, 0xD5E8, 0xC7EE, 0xD5E9, 0xC256, 0xD5EA, 0xC257, 0xD5EB, 0xC258, + 0xD5EC, 0xC7EF, 0xD5ED, 0xC259, 0xD5EE, 0xC25A, 0xD5EF, 0xC261, 0xD5F0, 0xC262, 0xD5F1, 0xC263, 0xD5F2, 0xC264, 0xD5F3, 0xC265, + 0xD5F4, 0xC7F0, 0xD5F5, 0xC7F1, 0xD5F6, 0xC266, 0xD5F7, 0xC7F2, 0xD5F8, 0xC267, 0xD5F9, 0xC7F3, 0xD5FA, 0xC268, 0xD5FB, 0xC269, + 0xD5FC, 0xC26A, 0xD5FD, 0xC26B, 0xD5FE, 0xC26C, 0xD5FF, 0xC26D, 0xD600, 0xC7F4, 0xD601, 0xC7F5, 0xD602, 0xC26E, 0xD603, 0xC26F, + 0xD604, 0xC7F6, 0xD605, 0xC270, 0xD606, 0xC271, 0xD607, 0xC272, 0xD608, 0xC7F7, 0xD609, 0xC273, 0xD60A, 0xC274, 0xD60B, 0xC275, + 0xD60C, 0xC276, 0xD60D, 0xC277, 0xD60E, 0xC278, 0xD60F, 0xC279, 0xD610, 0xC7F8, 0xD611, 0xC7F9, 0xD612, 0xC27A, 0xD613, 0xC7FA, + 0xD614, 0xC7FB, 0xD615, 0xC7FC, 0xD616, 0xC281, 0xD617, 0xC282, 0xD618, 0xC283, 0xD619, 0xC284, 0xD61A, 0xC285, 0xD61B, 0xC286, + 0xD61C, 0xC7FD, 0xD61D, 0xC287, 0xD61E, 0xC288, 0xD61F, 0xC289, 0xD620, 0xC7FE, 0xD621, 0xC28A, 0xD622, 0xC28B, 0xD623, 0xC28C, + 0xD624, 0xC8A1, 0xD625, 0xC28D, 0xD626, 0xC28E, 0xD627, 0xC28F, 0xD628, 0xC290, 0xD629, 0xC291, 0xD62A, 0xC292, 0xD62B, 0xC293, + 0xD62C, 0xC294, 0xD62D, 0xC8A2, 0xD62E, 0xC295, 0xD62F, 0xC296, 0xD630, 0xC297, 0xD631, 0xC298, 0xD632, 0xC299, 0xD633, 0xC29A, + 0xD634, 0xC29B, 0xD635, 0xC29C, 0xD636, 0xC29D, 0xD637, 0xC29E, 0xD638, 0xC8A3, 0xD639, 0xC8A4, 0xD63A, 0xC29F, 0xD63B, 0xC2A0, + 0xD63C, 0xC8A5, 0xD63D, 0xC341, 0xD63E, 0xC342, 0xD63F, 0xC343, 0xD640, 0xC8A6, 0xD641, 0xC344, 0xD642, 0xC345, 0xD643, 0xC346, + 0xD644, 0xC347, 0xD645, 0xC8A7, 0xD646, 0xC348, 0xD647, 0xC349, 0xD648, 0xC8A8, 0xD649, 0xC8A9, 0xD64A, 0xC34A, 0xD64B, 0xC8AA, + 0xD64C, 0xC34B, 0xD64D, 0xC8AB, 0xD64E, 0xC34C, 0xD64F, 0xC34D, 0xD650, 0xC34E, 0xD651, 0xC8AC, 0xD652, 0xC34F, 0xD653, 0xC350, + 0xD654, 0xC8AD, 0xD655, 0xC8AE, 0xD656, 0xC351, 0xD657, 0xC352, 0xD658, 0xC8AF, 0xD659, 0xC353, 0xD65A, 0xC354, 0xD65B, 0xC355, + 0xD65C, 0xC8B0, 0xD65D, 0xC356, 0xD65E, 0xC357, 0xD65F, 0xC358, 0xD660, 0xC359, 0xD661, 0xC35A, 0xD662, 0xC361, 0xD663, 0xC362, + 0xD664, 0xC363, 0xD665, 0xC364, 0xD666, 0xC365, 0xD667, 0xC8B1, 0xD668, 0xC366, 0xD669, 0xC8B2, 0xD66A, 0xC367, 0xD66B, 0xC368, + 0xD66C, 0xC369, 0xD66D, 0xC36A, 0xD66E, 0xC36B, 0xD66F, 0xC36C, 0xD670, 0xC8B3, 0xD671, 0xC8B4, 0xD672, 0xC36D, 0xD673, 0xC36E, + 0xD674, 0xC8B5, 0xD675, 0xC36F, 0xD676, 0xC370, 0xD677, 0xC371, 0xD678, 0xC372, 0xD679, 0xC373, 0xD67A, 0xC374, 0xD67B, 0xC375, + 0xD67C, 0xC376, 0xD67D, 0xC377, 0xD67E, 0xC378, 0xD67F, 0xC379, 0xD680, 0xC37A, 0xD681, 0xC381, 0xD682, 0xC382, 0xD683, 0xC8B6, + 0xD684, 0xC383, 0xD685, 0xC8B7, 0xD686, 0xC384, 0xD687, 0xC385, 0xD688, 0xC386, 0xD689, 0xC387, 0xD68A, 0xC388, 0xD68B, 0xC389, + 0xD68C, 0xC8B8, 0xD68D, 0xC8B9, 0xD68E, 0xC38A, 0xD68F, 0xC38B, 0xD690, 0xC8BA, 0xD691, 0xC38C, 0xD692, 0xC38D, 0xD693, 0xC38E, + 0xD694, 0xC8BB, 0xD695, 0xC38F, 0xD696, 0xC390, 0xD697, 0xC391, 0xD698, 0xC392, 0xD699, 0xC393, 0xD69A, 0xC394, 0xD69B, 0xC395, + 0xD69C, 0xC396, 0xD69D, 0xC8BC, 0xD69E, 0xC397, 0xD69F, 0xC8BD, 0xD6A0, 0xC398, 0xD6A1, 0xC8BE, 0xD6A2, 0xC399, 0xD6A3, 0xC39A, + 0xD6A4, 0xC39B, 0xD6A5, 0xC39C, 0xD6A6, 0xC39D, 0xD6A7, 0xC39E, 0xD6A8, 0xC8BF, 0xD6A9, 0xC39F, 0xD6AA, 0xC3A0, 0xD6AB, 0xC441, + 0xD6AC, 0xC8C0, 0xD6AD, 0xC442, 0xD6AE, 0xC443, 0xD6AF, 0xC444, 0xD6B0, 0xC8C1, 0xD6B1, 0xC445, 0xD6B2, 0xC446, 0xD6B3, 0xC447, + 0xD6B4, 0xC448, 0xD6B5, 0xC449, 0xD6B6, 0xC44A, 0xD6B7, 0xC44B, 0xD6B8, 0xC44C, 0xD6B9, 0xC8C2, 0xD6BA, 0xC44D, 0xD6BB, 0xC8C3, + 0xD6BC, 0xC44E, 0xD6BD, 0xC44F, 0xD6BE, 0xC450, 0xD6BF, 0xC451, 0xD6C0, 0xC452, 0xD6C1, 0xC453, 0xD6C2, 0xC454, 0xD6C3, 0xC455, + 0xD6C4, 0xC8C4, 0xD6C5, 0xC8C5, 0xD6C6, 0xC456, 0xD6C7, 0xC457, 0xD6C8, 0xC8C6, 0xD6C9, 0xC458, 0xD6CA, 0xC459, 0xD6CB, 0xC45A, + 0xD6CC, 0xC8C7, 0xD6CD, 0xC461, 0xD6CE, 0xC462, 0xD6CF, 0xC463, 0xD6D0, 0xC464, 0xD6D1, 0xC8C8, 0xD6D2, 0xC465, 0xD6D3, 0xC466, + 0xD6D4, 0xC8C9, 0xD6D5, 0xC467, 0xD6D6, 0xC468, 0xD6D7, 0xC8CA, 0xD6D8, 0xC469, 0xD6D9, 0xC8CB, 0xD6DA, 0xC46A, 0xD6DB, 0xC46B, + 0xD6DC, 0xC46C, 0xD6DD, 0xC46D, 0xD6DE, 0xC46E, 0xD6DF, 0xC46F, 0xD6E0, 0xC8CC, 0xD6E1, 0xC470, 0xD6E2, 0xC471, 0xD6E3, 0xC472, + 0xD6E4, 0xC8CD, 0xD6E5, 0xC473, 0xD6E6, 0xC474, 0xD6E7, 0xC475, 0xD6E8, 0xC8CE, 0xD6E9, 0xC476, 0xD6EA, 0xC477, 0xD6EB, 0xC478, + 0xD6EC, 0xC479, 0xD6ED, 0xC47A, 0xD6EE, 0xC481, 0xD6EF, 0xC482, 0xD6F0, 0xC8CF, 0xD6F1, 0xC483, 0xD6F2, 0xC484, 0xD6F3, 0xC485, + 0xD6F4, 0xC486, 0xD6F5, 0xC8D0, 0xD6F6, 0xC487, 0xD6F7, 0xC488, 0xD6F8, 0xC489, 0xD6F9, 0xC48A, 0xD6FA, 0xC48B, 0xD6FB, 0xC48C, + 0xD6FC, 0xC8D1, 0xD6FD, 0xC8D2, 0xD6FE, 0xC48D, 0xD6FF, 0xC48E, 0xD700, 0xC8D3, 0xD701, 0xC48F, 0xD702, 0xC490, 0xD703, 0xC491, + 0xD704, 0xC8D4, 0xD705, 0xC492, 0xD706, 0xC493, 0xD707, 0xC494, 0xD708, 0xC495, 0xD709, 0xC496, 0xD70A, 0xC497, 0xD70B, 0xC498, + 0xD70C, 0xC499, 0xD70D, 0xC49A, 0xD70E, 0xC49B, 0xD70F, 0xC49C, 0xD710, 0xC49D, 0xD711, 0xC8D5, 0xD712, 0xC49E, 0xD713, 0xC49F, + 0xD714, 0xC4A0, 0xD715, 0xC541, 0xD716, 0xC542, 0xD717, 0xC543, 0xD718, 0xC8D6, 0xD719, 0xC8D7, 0xD71A, 0xC544, 0xD71B, 0xC545, + 0xD71C, 0xC8D8, 0xD71D, 0xC546, 0xD71E, 0xC547, 0xD71F, 0xC548, 0xD720, 0xC8D9, 0xD721, 0xC549, 0xD722, 0xC54A, 0xD723, 0xC54B, + 0xD724, 0xC54C, 0xD725, 0xC54D, 0xD726, 0xC54E, 0xD727, 0xC54F, 0xD728, 0xC8DA, 0xD729, 0xC8DB, 0xD72A, 0xC550, 0xD72B, 0xC8DC, + 0xD72C, 0xC551, 0xD72D, 0xC8DD, 0xD72E, 0xC552, 0xD72F, 0xC553, 0xD730, 0xC554, 0xD731, 0xC555, 0xD732, 0xC556, 0xD733, 0xC557, + 0xD734, 0xC8DE, 0xD735, 0xC8DF, 0xD736, 0xC558, 0xD737, 0xC559, 0xD738, 0xC8E0, 0xD739, 0xC55A, 0xD73A, 0xC561, 0xD73B, 0xC562, + 0xD73C, 0xC8E1, 0xD73D, 0xC563, 0xD73E, 0xC564, 0xD73F, 0xC565, 0xD740, 0xC566, 0xD741, 0xC567, 0xD742, 0xC568, 0xD743, 0xC569, + 0xD744, 0xC8E2, 0xD745, 0xC56A, 0xD746, 0xC56B, 0xD747, 0xC8E3, 0xD748, 0xC56C, 0xD749, 0xC8E4, 0xD74A, 0xC56D, 0xD74B, 0xC56E, + 0xD74C, 0xC56F, 0xD74D, 0xC570, 0xD74E, 0xC571, 0xD74F, 0xC572, 0xD750, 0xC8E5, 0xD751, 0xC8E6, 0xD752, 0xC573, 0xD753, 0xC574, + 0xD754, 0xC8E7, 0xD755, 0xC575, 0xD756, 0xC8E8, 0xD757, 0xC8E9, 0xD758, 0xC8EA, 0xD759, 0xC8EB, 0xD75A, 0xC576, 0xD75B, 0xC577, + 0xD75C, 0xC578, 0xD75D, 0xC579, 0xD75E, 0xC57A, 0xD75F, 0xC581, 0xD760, 0xC8EC, 0xD761, 0xC8ED, 0xD762, 0xC582, 0xD763, 0xC8EE, + 0xD764, 0xC583, 0xD765, 0xC8EF, 0xD766, 0xC584, 0xD767, 0xC585, 0xD768, 0xC586, 0xD769, 0xC8F0, 0xD76A, 0xC587, 0xD76B, 0xC588, + 0xD76C, 0xC8F1, 0xD76D, 0xC589, 0xD76E, 0xC58A, 0xD76F, 0xC58B, 0xD770, 0xC8F2, 0xD771, 0xC58C, 0xD772, 0xC58D, 0xD773, 0xC58E, + 0xD774, 0xC8F3, 0xD775, 0xC58F, 0xD776, 0xC590, 0xD777, 0xC591, 0xD778, 0xC592, 0xD779, 0xC593, 0xD77A, 0xC594, 0xD77B, 0xC595, + 0xD77C, 0xC8F4, 0xD77D, 0xC8F5, 0xD77E, 0xC596, 0xD77F, 0xC597, 0xD780, 0xC598, 0xD781, 0xC8F6, 0xD782, 0xC599, 0xD783, 0xC59A, + 0xD784, 0xC59B, 0xD785, 0xC59C, 0xD786, 0xC59D, 0xD787, 0xC59E, 0xD788, 0xC8F7, 0xD789, 0xC8F8, 0xD78A, 0xC59F, 0xD78B, 0xC5A0, + 0xD78C, 0xC8F9, 0xD78D, 0xC641, 0xD78E, 0xC642, 0xD78F, 0xC643, 0xD790, 0xC8FA, 0xD791, 0xC644, 0xD792, 0xC645, 0xD793, 0xC646, + 0xD794, 0xC647, 0xD795, 0xC648, 0xD796, 0xC649, 0xD797, 0xC64A, 0xD798, 0xC8FB, 0xD799, 0xC8FC, 0xD79A, 0xC64B, 0xD79B, 0xC8FD, + 0xD79C, 0xC64C, 0xD79D, 0xC8FE, 0xD79E, 0xC64D, 0xD79F, 0xC64E, 0xD7A0, 0xC64F, 0xD7A1, 0xC650, 0xD7A2, 0xC651, 0xD7A3, 0xC652, + 0xF900, 0xCBD0, 0xF901, 0xCBD6, 0xF902, 0xCBE7, 0xF903, 0xCDCF, 0xF904, 0xCDE8, 0xF905, 0xCEAD, 0xF906, 0xCFFB, 0xF907, 0xD0A2, + 0xF908, 0xD0B8, 0xF909, 0xD0D0, 0xF90A, 0xD0DD, 0xF90B, 0xD1D4, 0xF90C, 0xD1D5, 0xF90D, 0xD1D8, 0xF90E, 0xD1DB, 0xF90F, 0xD1DC, + 0xF910, 0xD1DD, 0xF911, 0xD1DE, 0xF912, 0xD1DF, 0xF913, 0xD1E0, 0xF914, 0xD1E2, 0xF915, 0xD1E3, 0xF916, 0xD1E4, 0xF917, 0xD1E5, + 0xF918, 0xD1E6, 0xF919, 0xD1E8, 0xF91A, 0xD1E9, 0xF91B, 0xD1EA, 0xF91C, 0xD1EB, 0xF91D, 0xD1ED, 0xF91E, 0xD1EF, 0xF91F, 0xD1F0, + 0xF920, 0xD1F2, 0xF921, 0xD1F6, 0xF922, 0xD1FA, 0xF923, 0xD1FC, 0xF924, 0xD1FD, 0xF925, 0xD1FE, 0xF926, 0xD2A2, 0xF927, 0xD2A3, + 0xF928, 0xD2A7, 0xF929, 0xD2A8, 0xF92A, 0xD2A9, 0xF92B, 0xD2AA, 0xF92C, 0xD2AB, 0xF92D, 0xD2AD, 0xF92E, 0xD2B2, 0xF92F, 0xD2BE, + 0xF930, 0xD2C2, 0xF931, 0xD2C3, 0xF932, 0xD2C4, 0xF933, 0xD2C6, 0xF934, 0xD2C7, 0xF935, 0xD2C8, 0xF936, 0xD2C9, 0xF937, 0xD2CA, + 0xF938, 0xD2CB, 0xF939, 0xD2CD, 0xF93A, 0xD2CE, 0xF93B, 0xD2CF, 0xF93C, 0xD2D0, 0xF93D, 0xD2D1, 0xF93E, 0xD2D2, 0xF93F, 0xD2D3, + 0xF940, 0xD2D4, 0xF941, 0xD2D5, 0xF942, 0xD2D6, 0xF943, 0xD2D7, 0xF944, 0xD2D9, 0xF945, 0xD2DA, 0xF946, 0xD2DE, 0xF947, 0xD2DF, + 0xF948, 0xD2E1, 0xF949, 0xD2E2, 0xF94A, 0xD2E4, 0xF94B, 0xD2E5, 0xF94C, 0xD2E6, 0xF94D, 0xD2E7, 0xF94E, 0xD2E8, 0xF94F, 0xD2E9, + 0xF950, 0xD2EA, 0xF951, 0xD2EB, 0xF952, 0xD2F0, 0xF953, 0xD2F1, 0xF954, 0xD2F2, 0xF955, 0xD2F3, 0xF956, 0xD2F4, 0xF957, 0xD2F5, + 0xF958, 0xD2F7, 0xF959, 0xD2F8, 0xF95A, 0xD4E6, 0xF95B, 0xD4FC, 0xF95C, 0xD5A5, 0xF95D, 0xD5AB, 0xF95E, 0xD5AE, 0xF95F, 0xD6B8, + 0xF960, 0xD6CD, 0xF961, 0xD7CB, 0xF962, 0xD7E4, 0xF963, 0xDBC5, 0xF964, 0xDBE4, 0xF965, 0xDCA5, 0xF966, 0xDDA5, 0xF967, 0xDDD5, + 0xF968, 0xDDF4, 0xF969, 0xDEFC, 0xF96A, 0xDEFE, 0xF96B, 0xDFB3, 0xF96C, 0xDFE1, 0xF96D, 0xDFE8, 0xF96E, 0xE0F1, 0xF96F, 0xE1AD, + 0xF970, 0xE1ED, 0xF971, 0xE3F5, 0xF972, 0xE4A1, 0xF973, 0xE4A9, 0xF974, 0xE5AE, 0xF975, 0xE5B1, 0xF976, 0xE5B2, 0xF977, 0xE5B9, + 0xF978, 0xE5BB, 0xF979, 0xE5BC, 0xF97A, 0xE5C4, 0xF97B, 0xE5CE, 0xF97C, 0xE5D0, 0xF97D, 0xE5D2, 0xF97E, 0xE5D6, 0xF97F, 0xE5FA, + 0xF980, 0xE5FB, 0xF981, 0xE5FC, 0xF982, 0xE5FE, 0xF983, 0xE6A1, 0xF984, 0xE6A4, 0xF985, 0xE6A7, 0xF986, 0xE6AD, 0xF987, 0xE6AF, + 0xF988, 0xE6B0, 0xF989, 0xE6B1, 0xF98A, 0xE6B3, 0xF98B, 0xE6B7, 0xF98C, 0xE6B8, 0xF98D, 0xE6BC, 0xF98E, 0xE6C4, 0xF98F, 0xE6C6, + 0xF990, 0xE6C7, 0xF991, 0xE6CA, 0xF992, 0xE6D2, 0xF993, 0xE6D6, 0xF994, 0xE6D9, 0xF995, 0xE6DC, 0xF996, 0xE6DF, 0xF997, 0xE6E1, + 0xF998, 0xE6E4, 0xF999, 0xE6E5, 0xF99A, 0xE6E6, 0xF99B, 0xE6E8, 0xF99C, 0xE6EA, 0xF99D, 0xE6EB, 0xF99E, 0xE6EC, 0xF99F, 0xE6EF, + 0xF9A0, 0xE6F1, 0xF9A1, 0xE6F2, 0xF9A2, 0xE6F5, 0xF9A3, 0xE6F6, 0xF9A4, 0xE6F7, 0xF9A5, 0xE6F9, 0xF9A6, 0xE7A1, 0xF9A7, 0xE7A6, + 0xF9A8, 0xE7A9, 0xF9A9, 0xE7AA, 0xF9AA, 0xE7AC, 0xF9AB, 0xE7AD, 0xF9AC, 0xE7B0, 0xF9AD, 0xE7BF, 0xF9AE, 0xE7C1, 0xF9AF, 0xE7C6, + 0xF9B0, 0xE7C7, 0xF9B1, 0xE7CB, 0xF9B2, 0xE7CD, 0xF9B3, 0xE7CF, 0xF9B4, 0xE7D0, 0xF9B5, 0xE7D3, 0xF9B6, 0xE7DF, 0xF9B7, 0xE7E4, + 0xF9B8, 0xE7E6, 0xF9B9, 0xE7F7, 0xF9BA, 0xE8E7, 0xF9BB, 0xE8E8, 0xF9BC, 0xE8F0, 0xF9BD, 0xE8F1, 0xF9BE, 0xE8F7, 0xF9BF, 0xE8F9, + 0xF9C0, 0xE8FB, 0xF9C1, 0xE8FE, 0xF9C2, 0xE9A7, 0xF9C3, 0xE9AC, 0xF9C4, 0xE9CC, 0xF9C5, 0xE9F7, 0xF9C6, 0xEAC1, 0xF9C7, 0xEAE5, + 0xF9C8, 0xEAF4, 0xF9C9, 0xEAF7, 0xF9CA, 0xEAFC, 0xF9CB, 0xEAFE, 0xF9CC, 0xEBA4, 0xF9CD, 0xEBA7, 0xF9CE, 0xEBA9, 0xF9CF, 0xEBAA, + 0xF9D0, 0xEBBA, 0xF9D1, 0xEBBB, 0xF9D2, 0xEBBD, 0xF9D3, 0xEBC1, 0xF9D4, 0xEBC2, 0xF9D5, 0xEBC6, 0xF9D6, 0xEBC7, 0xF9D7, 0xEBCC, + 0xF9D8, 0xEBCF, 0xF9D9, 0xEBD0, 0xF9DA, 0xEBD1, 0xF9DB, 0xEBD2, 0xF9DC, 0xEBD8, 0xF9DD, 0xECA6, 0xF9DE, 0xECA7, 0xF9DF, 0xECAA, + 0xF9E0, 0xECAF, 0xF9E1, 0xECB0, 0xF9E2, 0xECB1, 0xF9E3, 0xECB2, 0xF9E4, 0xECB5, 0xF9E5, 0xECB8, 0xF9E6, 0xECBA, 0xF9E7, 0xECC0, + 0xF9E8, 0xECC1, 0xF9E9, 0xECC5, 0xF9EA, 0xECC6, 0xF9EB, 0xECC9, 0xF9EC, 0xECCA, 0xF9ED, 0xECD5, 0xF9EE, 0xECDD, 0xF9EF, 0xECDE, + 0xF9F0, 0xECE1, 0xF9F1, 0xECE4, 0xF9F2, 0xECE7, 0xF9F3, 0xECE8, 0xF9F4, 0xECF7, 0xF9F5, 0xECF8, 0xF9F6, 0xECFA, 0xF9F7, 0xEDA1, + 0xF9F8, 0xEDA2, 0xF9F9, 0xEDA3, 0xF9FA, 0xEDEE, 0xF9FB, 0xEEDB, 0xF9FC, 0xF2BD, 0xF9FD, 0xF2FA, 0xF9FE, 0xF3B1, 0xF9FF, 0xF4A7, + 0xFA00, 0xF4EE, 0xFA01, 0xF6F4, 0xFA02, 0xF6F6, 0xFA03, 0xF7B8, 0xFA04, 0xF7C8, 0xFA05, 0xF7D3, 0xFA06, 0xF8DB, 0xFA07, 0xF8F0, + 0xFA08, 0xFAA1, 0xFA09, 0xFAA2, 0xFA0A, 0xFAE6, 0xFA0B, 0xFCA9, 0xFF01, 0xA3A1, 0xFF02, 0xA3A2, 0xFF03, 0xA3A3, 0xFF04, 0xA3A4, + 0xFF05, 0xA3A5, 0xFF06, 0xA3A6, 0xFF07, 0xA3A7, 0xFF08, 0xA3A8, 0xFF09, 0xA3A9, 0xFF0A, 0xA3AA, 0xFF0B, 0xA3AB, 0xFF0C, 0xA3AC, + 0xFF0D, 0xA3AD, 0xFF0E, 0xA3AE, 0xFF0F, 0xA3AF, 0xFF10, 0xA3B0, 0xFF11, 0xA3B1, 0xFF12, 0xA3B2, 0xFF13, 0xA3B3, 0xFF14, 0xA3B4, + 0xFF15, 0xA3B5, 0xFF16, 0xA3B6, 0xFF17, 0xA3B7, 0xFF18, 0xA3B8, 0xFF19, 0xA3B9, 0xFF1A, 0xA3BA, 0xFF1B, 0xA3BB, 0xFF1C, 0xA3BC, + 0xFF1D, 0xA3BD, 0xFF1E, 0xA3BE, 0xFF1F, 0xA3BF, 0xFF20, 0xA3C0, 0xFF21, 0xA3C1, 0xFF22, 0xA3C2, 0xFF23, 0xA3C3, 0xFF24, 0xA3C4, + 0xFF25, 0xA3C5, 0xFF26, 0xA3C6, 0xFF27, 0xA3C7, 0xFF28, 0xA3C8, 0xFF29, 0xA3C9, 0xFF2A, 0xA3CA, 0xFF2B, 0xA3CB, 0xFF2C, 0xA3CC, + 0xFF2D, 0xA3CD, 0xFF2E, 0xA3CE, 0xFF2F, 0xA3CF, 0xFF30, 0xA3D0, 0xFF31, 0xA3D1, 0xFF32, 0xA3D2, 0xFF33, 0xA3D3, 0xFF34, 0xA3D4, + 0xFF35, 0xA3D5, 0xFF36, 0xA3D6, 0xFF37, 0xA3D7, 0xFF38, 0xA3D8, 0xFF39, 0xA3D9, 0xFF3A, 0xA3DA, 0xFF3B, 0xA3DB, 0xFF3C, 0xA1AC, + 0xFF3D, 0xA3DD, 0xFF3E, 0xA3DE, 0xFF3F, 0xA3DF, 0xFF40, 0xA3E0, 0xFF41, 0xA3E1, 0xFF42, 0xA3E2, 0xFF43, 0xA3E3, 0xFF44, 0xA3E4, + 0xFF45, 0xA3E5, 0xFF46, 0xA3E6, 0xFF47, 0xA3E7, 0xFF48, 0xA3E8, 0xFF49, 0xA3E9, 0xFF4A, 0xA3EA, 0xFF4B, 0xA3EB, 0xFF4C, 0xA3EC, + 0xFF4D, 0xA3ED, 0xFF4E, 0xA3EE, 0xFF4F, 0xA3EF, 0xFF50, 0xA3F0, 0xFF51, 0xA3F1, 0xFF52, 0xA3F2, 0xFF53, 0xA3F3, 0xFF54, 0xA3F4, + 0xFF55, 0xA3F5, 0xFF56, 0xA3F6, 0xFF57, 0xA3F7, 0xFF58, 0xA3F8, 0xFF59, 0xA3F9, 0xFF5A, 0xA3FA, 0xFF5B, 0xA3FB, 0xFF5C, 0xA3FC, + 0xFF5D, 0xA3FD, 0xFF5E, 0xA2A6, 0xFFE0, 0xA1CB, 0xFFE1, 0xA1CC, 0xFFE2, 0xA1FE, 0xFFE3, 0xA3FE, 0xFFE5, 0xA1CD, 0xFFE6, 0xA3DC, + 0, 0 +}; + +static const WCHAR oem2uni949[] = { /* Korean --> Unicode pairs */ + 0x8141, 0xAC02, 0x8142, 0xAC03, 0x8143, 0xAC05, 0x8144, 0xAC06, 0x8145, 0xAC0B, 0x8146, 0xAC0C, 0x8147, 0xAC0D, 0x8148, 0xAC0E, + 0x8149, 0xAC0F, 0x814A, 0xAC18, 0x814B, 0xAC1E, 0x814C, 0xAC1F, 0x814D, 0xAC21, 0x814E, 0xAC22, 0x814F, 0xAC23, 0x8150, 0xAC25, + 0x8151, 0xAC26, 0x8152, 0xAC27, 0x8153, 0xAC28, 0x8154, 0xAC29, 0x8155, 0xAC2A, 0x8156, 0xAC2B, 0x8157, 0xAC2E, 0x8158, 0xAC32, + 0x8159, 0xAC33, 0x815A, 0xAC34, 0x8161, 0xAC35, 0x8162, 0xAC36, 0x8163, 0xAC37, 0x8164, 0xAC3A, 0x8165, 0xAC3B, 0x8166, 0xAC3D, + 0x8167, 0xAC3E, 0x8168, 0xAC3F, 0x8169, 0xAC41, 0x816A, 0xAC42, 0x816B, 0xAC43, 0x816C, 0xAC44, 0x816D, 0xAC45, 0x816E, 0xAC46, + 0x816F, 0xAC47, 0x8170, 0xAC48, 0x8171, 0xAC49, 0x8172, 0xAC4A, 0x8173, 0xAC4C, 0x8174, 0xAC4E, 0x8175, 0xAC4F, 0x8176, 0xAC50, + 0x8177, 0xAC51, 0x8178, 0xAC52, 0x8179, 0xAC53, 0x817A, 0xAC55, 0x8181, 0xAC56, 0x8182, 0xAC57, 0x8183, 0xAC59, 0x8184, 0xAC5A, + 0x8185, 0xAC5B, 0x8186, 0xAC5D, 0x8187, 0xAC5E, 0x8188, 0xAC5F, 0x8189, 0xAC60, 0x818A, 0xAC61, 0x818B, 0xAC62, 0x818C, 0xAC63, + 0x818D, 0xAC64, 0x818E, 0xAC65, 0x818F, 0xAC66, 0x8190, 0xAC67, 0x8191, 0xAC68, 0x8192, 0xAC69, 0x8193, 0xAC6A, 0x8194, 0xAC6B, + 0x8195, 0xAC6C, 0x8196, 0xAC6D, 0x8197, 0xAC6E, 0x8198, 0xAC6F, 0x8199, 0xAC72, 0x819A, 0xAC73, 0x819B, 0xAC75, 0x819C, 0xAC76, + 0x819D, 0xAC79, 0x819E, 0xAC7B, 0x819F, 0xAC7C, 0x81A0, 0xAC7D, 0x81A1, 0xAC7E, 0x81A2, 0xAC7F, 0x81A3, 0xAC82, 0x81A4, 0xAC87, + 0x81A5, 0xAC88, 0x81A6, 0xAC8D, 0x81A7, 0xAC8E, 0x81A8, 0xAC8F, 0x81A9, 0xAC91, 0x81AA, 0xAC92, 0x81AB, 0xAC93, 0x81AC, 0xAC95, + 0x81AD, 0xAC96, 0x81AE, 0xAC97, 0x81AF, 0xAC98, 0x81B0, 0xAC99, 0x81B1, 0xAC9A, 0x81B2, 0xAC9B, 0x81B3, 0xAC9E, 0x81B4, 0xACA2, + 0x81B5, 0xACA3, 0x81B6, 0xACA4, 0x81B7, 0xACA5, 0x81B8, 0xACA6, 0x81B9, 0xACA7, 0x81BA, 0xACAB, 0x81BB, 0xACAD, 0x81BC, 0xACAE, + 0x81BD, 0xACB1, 0x81BE, 0xACB2, 0x81BF, 0xACB3, 0x81C0, 0xACB4, 0x81C1, 0xACB5, 0x81C2, 0xACB6, 0x81C3, 0xACB7, 0x81C4, 0xACBA, + 0x81C5, 0xACBE, 0x81C6, 0xACBF, 0x81C7, 0xACC0, 0x81C8, 0xACC2, 0x81C9, 0xACC3, 0x81CA, 0xACC5, 0x81CB, 0xACC6, 0x81CC, 0xACC7, + 0x81CD, 0xACC9, 0x81CE, 0xACCA, 0x81CF, 0xACCB, 0x81D0, 0xACCD, 0x81D1, 0xACCE, 0x81D2, 0xACCF, 0x81D3, 0xACD0, 0x81D4, 0xACD1, + 0x81D5, 0xACD2, 0x81D6, 0xACD3, 0x81D7, 0xACD4, 0x81D8, 0xACD6, 0x81D9, 0xACD8, 0x81DA, 0xACD9, 0x81DB, 0xACDA, 0x81DC, 0xACDB, + 0x81DD, 0xACDC, 0x81DE, 0xACDD, 0x81DF, 0xACDE, 0x81E0, 0xACDF, 0x81E1, 0xACE2, 0x81E2, 0xACE3, 0x81E3, 0xACE5, 0x81E4, 0xACE6, + 0x81E5, 0xACE9, 0x81E6, 0xACEB, 0x81E7, 0xACED, 0x81E8, 0xACEE, 0x81E9, 0xACF2, 0x81EA, 0xACF4, 0x81EB, 0xACF7, 0x81EC, 0xACF8, + 0x81ED, 0xACF9, 0x81EE, 0xACFA, 0x81EF, 0xACFB, 0x81F0, 0xACFE, 0x81F1, 0xACFF, 0x81F2, 0xAD01, 0x81F3, 0xAD02, 0x81F4, 0xAD03, + 0x81F5, 0xAD05, 0x81F6, 0xAD07, 0x81F7, 0xAD08, 0x81F8, 0xAD09, 0x81F9, 0xAD0A, 0x81FA, 0xAD0B, 0x81FB, 0xAD0E, 0x81FC, 0xAD10, + 0x81FD, 0xAD12, 0x81FE, 0xAD13, 0x8241, 0xAD14, 0x8242, 0xAD15, 0x8243, 0xAD16, 0x8244, 0xAD17, 0x8245, 0xAD19, 0x8246, 0xAD1A, + 0x8247, 0xAD1B, 0x8248, 0xAD1D, 0x8249, 0xAD1E, 0x824A, 0xAD1F, 0x824B, 0xAD21, 0x824C, 0xAD22, 0x824D, 0xAD23, 0x824E, 0xAD24, + 0x824F, 0xAD25, 0x8250, 0xAD26, 0x8251, 0xAD27, 0x8252, 0xAD28, 0x8253, 0xAD2A, 0x8254, 0xAD2B, 0x8255, 0xAD2E, 0x8256, 0xAD2F, + 0x8257, 0xAD30, 0x8258, 0xAD31, 0x8259, 0xAD32, 0x825A, 0xAD33, 0x8261, 0xAD36, 0x8262, 0xAD37, 0x8263, 0xAD39, 0x8264, 0xAD3A, + 0x8265, 0xAD3B, 0x8266, 0xAD3D, 0x8267, 0xAD3E, 0x8268, 0xAD3F, 0x8269, 0xAD40, 0x826A, 0xAD41, 0x826B, 0xAD42, 0x826C, 0xAD43, + 0x826D, 0xAD46, 0x826E, 0xAD48, 0x826F, 0xAD4A, 0x8270, 0xAD4B, 0x8271, 0xAD4C, 0x8272, 0xAD4D, 0x8273, 0xAD4E, 0x8274, 0xAD4F, + 0x8275, 0xAD51, 0x8276, 0xAD52, 0x8277, 0xAD53, 0x8278, 0xAD55, 0x8279, 0xAD56, 0x827A, 0xAD57, 0x8281, 0xAD59, 0x8282, 0xAD5A, + 0x8283, 0xAD5B, 0x8284, 0xAD5C, 0x8285, 0xAD5D, 0x8286, 0xAD5E, 0x8287, 0xAD5F, 0x8288, 0xAD60, 0x8289, 0xAD62, 0x828A, 0xAD64, + 0x828B, 0xAD65, 0x828C, 0xAD66, 0x828D, 0xAD67, 0x828E, 0xAD68, 0x828F, 0xAD69, 0x8290, 0xAD6A, 0x8291, 0xAD6B, 0x8292, 0xAD6E, + 0x8293, 0xAD6F, 0x8294, 0xAD71, 0x8295, 0xAD72, 0x8296, 0xAD77, 0x8297, 0xAD78, 0x8298, 0xAD79, 0x8299, 0xAD7A, 0x829A, 0xAD7E, + 0x829B, 0xAD80, 0x829C, 0xAD83, 0x829D, 0xAD84, 0x829E, 0xAD85, 0x829F, 0xAD86, 0x82A0, 0xAD87, 0x82A1, 0xAD8A, 0x82A2, 0xAD8B, + 0x82A3, 0xAD8D, 0x82A4, 0xAD8E, 0x82A5, 0xAD8F, 0x82A6, 0xAD91, 0x82A7, 0xAD92, 0x82A8, 0xAD93, 0x82A9, 0xAD94, 0x82AA, 0xAD95, + 0x82AB, 0xAD96, 0x82AC, 0xAD97, 0x82AD, 0xAD98, 0x82AE, 0xAD99, 0x82AF, 0xAD9A, 0x82B0, 0xAD9B, 0x82B1, 0xAD9E, 0x82B2, 0xAD9F, + 0x82B3, 0xADA0, 0x82B4, 0xADA1, 0x82B5, 0xADA2, 0x82B6, 0xADA3, 0x82B7, 0xADA5, 0x82B8, 0xADA6, 0x82B9, 0xADA7, 0x82BA, 0xADA8, + 0x82BB, 0xADA9, 0x82BC, 0xADAA, 0x82BD, 0xADAB, 0x82BE, 0xADAC, 0x82BF, 0xADAD, 0x82C0, 0xADAE, 0x82C1, 0xADAF, 0x82C2, 0xADB0, + 0x82C3, 0xADB1, 0x82C4, 0xADB2, 0x82C5, 0xADB3, 0x82C6, 0xADB4, 0x82C7, 0xADB5, 0x82C8, 0xADB6, 0x82C9, 0xADB8, 0x82CA, 0xADB9, + 0x82CB, 0xADBA, 0x82CC, 0xADBB, 0x82CD, 0xADBC, 0x82CE, 0xADBD, 0x82CF, 0xADBE, 0x82D0, 0xADBF, 0x82D1, 0xADC2, 0x82D2, 0xADC3, + 0x82D3, 0xADC5, 0x82D4, 0xADC6, 0x82D5, 0xADC7, 0x82D6, 0xADC9, 0x82D7, 0xADCA, 0x82D8, 0xADCB, 0x82D9, 0xADCC, 0x82DA, 0xADCD, + 0x82DB, 0xADCE, 0x82DC, 0xADCF, 0x82DD, 0xADD2, 0x82DE, 0xADD4, 0x82DF, 0xADD5, 0x82E0, 0xADD6, 0x82E1, 0xADD7, 0x82E2, 0xADD8, + 0x82E3, 0xADD9, 0x82E4, 0xADDA, 0x82E5, 0xADDB, 0x82E6, 0xADDD, 0x82E7, 0xADDE, 0x82E8, 0xADDF, 0x82E9, 0xADE1, 0x82EA, 0xADE2, + 0x82EB, 0xADE3, 0x82EC, 0xADE5, 0x82ED, 0xADE6, 0x82EE, 0xADE7, 0x82EF, 0xADE8, 0x82F0, 0xADE9, 0x82F1, 0xADEA, 0x82F2, 0xADEB, + 0x82F3, 0xADEC, 0x82F4, 0xADED, 0x82F5, 0xADEE, 0x82F6, 0xADEF, 0x82F7, 0xADF0, 0x82F8, 0xADF1, 0x82F9, 0xADF2, 0x82FA, 0xADF3, + 0x82FB, 0xADF4, 0x82FC, 0xADF5, 0x82FD, 0xADF6, 0x82FE, 0xADF7, 0x8341, 0xADFA, 0x8342, 0xADFB, 0x8343, 0xADFD, 0x8344, 0xADFE, + 0x8345, 0xAE02, 0x8346, 0xAE03, 0x8347, 0xAE04, 0x8348, 0xAE05, 0x8349, 0xAE06, 0x834A, 0xAE07, 0x834B, 0xAE0A, 0x834C, 0xAE0C, + 0x834D, 0xAE0E, 0x834E, 0xAE0F, 0x834F, 0xAE10, 0x8350, 0xAE11, 0x8351, 0xAE12, 0x8352, 0xAE13, 0x8353, 0xAE15, 0x8354, 0xAE16, + 0x8355, 0xAE17, 0x8356, 0xAE18, 0x8357, 0xAE19, 0x8358, 0xAE1A, 0x8359, 0xAE1B, 0x835A, 0xAE1C, 0x8361, 0xAE1D, 0x8362, 0xAE1E, + 0x8363, 0xAE1F, 0x8364, 0xAE20, 0x8365, 0xAE21, 0x8366, 0xAE22, 0x8367, 0xAE23, 0x8368, 0xAE24, 0x8369, 0xAE25, 0x836A, 0xAE26, + 0x836B, 0xAE27, 0x836C, 0xAE28, 0x836D, 0xAE29, 0x836E, 0xAE2A, 0x836F, 0xAE2B, 0x8370, 0xAE2C, 0x8371, 0xAE2D, 0x8372, 0xAE2E, + 0x8373, 0xAE2F, 0x8374, 0xAE32, 0x8375, 0xAE33, 0x8376, 0xAE35, 0x8377, 0xAE36, 0x8378, 0xAE39, 0x8379, 0xAE3B, 0x837A, 0xAE3C, + 0x8381, 0xAE3D, 0x8382, 0xAE3E, 0x8383, 0xAE3F, 0x8384, 0xAE42, 0x8385, 0xAE44, 0x8386, 0xAE47, 0x8387, 0xAE48, 0x8388, 0xAE49, + 0x8389, 0xAE4B, 0x838A, 0xAE4F, 0x838B, 0xAE51, 0x838C, 0xAE52, 0x838D, 0xAE53, 0x838E, 0xAE55, 0x838F, 0xAE57, 0x8390, 0xAE58, + 0x8391, 0xAE59, 0x8392, 0xAE5A, 0x8393, 0xAE5B, 0x8394, 0xAE5E, 0x8395, 0xAE62, 0x8396, 0xAE63, 0x8397, 0xAE64, 0x8398, 0xAE66, + 0x8399, 0xAE67, 0x839A, 0xAE6A, 0x839B, 0xAE6B, 0x839C, 0xAE6D, 0x839D, 0xAE6E, 0x839E, 0xAE6F, 0x839F, 0xAE71, 0x83A0, 0xAE72, + 0x83A1, 0xAE73, 0x83A2, 0xAE74, 0x83A3, 0xAE75, 0x83A4, 0xAE76, 0x83A5, 0xAE77, 0x83A6, 0xAE7A, 0x83A7, 0xAE7E, 0x83A8, 0xAE7F, + 0x83A9, 0xAE80, 0x83AA, 0xAE81, 0x83AB, 0xAE82, 0x83AC, 0xAE83, 0x83AD, 0xAE86, 0x83AE, 0xAE87, 0x83AF, 0xAE88, 0x83B0, 0xAE89, + 0x83B1, 0xAE8A, 0x83B2, 0xAE8B, 0x83B3, 0xAE8D, 0x83B4, 0xAE8E, 0x83B5, 0xAE8F, 0x83B6, 0xAE90, 0x83B7, 0xAE91, 0x83B8, 0xAE92, + 0x83B9, 0xAE93, 0x83BA, 0xAE94, 0x83BB, 0xAE95, 0x83BC, 0xAE96, 0x83BD, 0xAE97, 0x83BE, 0xAE98, 0x83BF, 0xAE99, 0x83C0, 0xAE9A, + 0x83C1, 0xAE9B, 0x83C2, 0xAE9C, 0x83C3, 0xAE9D, 0x83C4, 0xAE9E, 0x83C5, 0xAE9F, 0x83C6, 0xAEA0, 0x83C7, 0xAEA1, 0x83C8, 0xAEA2, + 0x83C9, 0xAEA3, 0x83CA, 0xAEA4, 0x83CB, 0xAEA5, 0x83CC, 0xAEA6, 0x83CD, 0xAEA7, 0x83CE, 0xAEA8, 0x83CF, 0xAEA9, 0x83D0, 0xAEAA, + 0x83D1, 0xAEAB, 0x83D2, 0xAEAC, 0x83D3, 0xAEAD, 0x83D4, 0xAEAE, 0x83D5, 0xAEAF, 0x83D6, 0xAEB0, 0x83D7, 0xAEB1, 0x83D8, 0xAEB2, + 0x83D9, 0xAEB3, 0x83DA, 0xAEB4, 0x83DB, 0xAEB5, 0x83DC, 0xAEB6, 0x83DD, 0xAEB7, 0x83DE, 0xAEB8, 0x83DF, 0xAEB9, 0x83E0, 0xAEBA, + 0x83E1, 0xAEBB, 0x83E2, 0xAEBF, 0x83E3, 0xAEC1, 0x83E4, 0xAEC2, 0x83E5, 0xAEC3, 0x83E6, 0xAEC5, 0x83E7, 0xAEC6, 0x83E8, 0xAEC7, + 0x83E9, 0xAEC8, 0x83EA, 0xAEC9, 0x83EB, 0xAECA, 0x83EC, 0xAECB, 0x83ED, 0xAECE, 0x83EE, 0xAED2, 0x83EF, 0xAED3, 0x83F0, 0xAED4, + 0x83F1, 0xAED5, 0x83F2, 0xAED6, 0x83F3, 0xAED7, 0x83F4, 0xAEDA, 0x83F5, 0xAEDB, 0x83F6, 0xAEDD, 0x83F7, 0xAEDE, 0x83F8, 0xAEDF, + 0x83F9, 0xAEE0, 0x83FA, 0xAEE1, 0x83FB, 0xAEE2, 0x83FC, 0xAEE3, 0x83FD, 0xAEE4, 0x83FE, 0xAEE5, 0x8441, 0xAEE6, 0x8442, 0xAEE7, + 0x8443, 0xAEE9, 0x8444, 0xAEEA, 0x8445, 0xAEEC, 0x8446, 0xAEEE, 0x8447, 0xAEEF, 0x8448, 0xAEF0, 0x8449, 0xAEF1, 0x844A, 0xAEF2, + 0x844B, 0xAEF3, 0x844C, 0xAEF5, 0x844D, 0xAEF6, 0x844E, 0xAEF7, 0x844F, 0xAEF9, 0x8450, 0xAEFA, 0x8451, 0xAEFB, 0x8452, 0xAEFD, + 0x8453, 0xAEFE, 0x8454, 0xAEFF, 0x8455, 0xAF00, 0x8456, 0xAF01, 0x8457, 0xAF02, 0x8458, 0xAF03, 0x8459, 0xAF04, 0x845A, 0xAF05, + 0x8461, 0xAF06, 0x8462, 0xAF09, 0x8463, 0xAF0A, 0x8464, 0xAF0B, 0x8465, 0xAF0C, 0x8466, 0xAF0E, 0x8467, 0xAF0F, 0x8468, 0xAF11, + 0x8469, 0xAF12, 0x846A, 0xAF13, 0x846B, 0xAF14, 0x846C, 0xAF15, 0x846D, 0xAF16, 0x846E, 0xAF17, 0x846F, 0xAF18, 0x8470, 0xAF19, + 0x8471, 0xAF1A, 0x8472, 0xAF1B, 0x8473, 0xAF1C, 0x8474, 0xAF1D, 0x8475, 0xAF1E, 0x8476, 0xAF1F, 0x8477, 0xAF20, 0x8478, 0xAF21, + 0x8479, 0xAF22, 0x847A, 0xAF23, 0x8481, 0xAF24, 0x8482, 0xAF25, 0x8483, 0xAF26, 0x8484, 0xAF27, 0x8485, 0xAF28, 0x8486, 0xAF29, + 0x8487, 0xAF2A, 0x8488, 0xAF2B, 0x8489, 0xAF2E, 0x848A, 0xAF2F, 0x848B, 0xAF31, 0x848C, 0xAF33, 0x848D, 0xAF35, 0x848E, 0xAF36, + 0x848F, 0xAF37, 0x8490, 0xAF38, 0x8491, 0xAF39, 0x8492, 0xAF3A, 0x8493, 0xAF3B, 0x8494, 0xAF3E, 0x8495, 0xAF40, 0x8496, 0xAF44, + 0x8497, 0xAF45, 0x8498, 0xAF46, 0x8499, 0xAF47, 0x849A, 0xAF4A, 0x849B, 0xAF4B, 0x849C, 0xAF4C, 0x849D, 0xAF4D, 0x849E, 0xAF4E, + 0x849F, 0xAF4F, 0x84A0, 0xAF51, 0x84A1, 0xAF52, 0x84A2, 0xAF53, 0x84A3, 0xAF54, 0x84A4, 0xAF55, 0x84A5, 0xAF56, 0x84A6, 0xAF57, + 0x84A7, 0xAF58, 0x84A8, 0xAF59, 0x84A9, 0xAF5A, 0x84AA, 0xAF5B, 0x84AB, 0xAF5E, 0x84AC, 0xAF5F, 0x84AD, 0xAF60, 0x84AE, 0xAF61, + 0x84AF, 0xAF62, 0x84B0, 0xAF63, 0x84B1, 0xAF66, 0x84B2, 0xAF67, 0x84B3, 0xAF68, 0x84B4, 0xAF69, 0x84B5, 0xAF6A, 0x84B6, 0xAF6B, + 0x84B7, 0xAF6C, 0x84B8, 0xAF6D, 0x84B9, 0xAF6E, 0x84BA, 0xAF6F, 0x84BB, 0xAF70, 0x84BC, 0xAF71, 0x84BD, 0xAF72, 0x84BE, 0xAF73, + 0x84BF, 0xAF74, 0x84C0, 0xAF75, 0x84C1, 0xAF76, 0x84C2, 0xAF77, 0x84C3, 0xAF78, 0x84C4, 0xAF7A, 0x84C5, 0xAF7B, 0x84C6, 0xAF7C, + 0x84C7, 0xAF7D, 0x84C8, 0xAF7E, 0x84C9, 0xAF7F, 0x84CA, 0xAF81, 0x84CB, 0xAF82, 0x84CC, 0xAF83, 0x84CD, 0xAF85, 0x84CE, 0xAF86, + 0x84CF, 0xAF87, 0x84D0, 0xAF89, 0x84D1, 0xAF8A, 0x84D2, 0xAF8B, 0x84D3, 0xAF8C, 0x84D4, 0xAF8D, 0x84D5, 0xAF8E, 0x84D6, 0xAF8F, + 0x84D7, 0xAF92, 0x84D8, 0xAF93, 0x84D9, 0xAF94, 0x84DA, 0xAF96, 0x84DB, 0xAF97, 0x84DC, 0xAF98, 0x84DD, 0xAF99, 0x84DE, 0xAF9A, + 0x84DF, 0xAF9B, 0x84E0, 0xAF9D, 0x84E1, 0xAF9E, 0x84E2, 0xAF9F, 0x84E3, 0xAFA0, 0x84E4, 0xAFA1, 0x84E5, 0xAFA2, 0x84E6, 0xAFA3, + 0x84E7, 0xAFA4, 0x84E8, 0xAFA5, 0x84E9, 0xAFA6, 0x84EA, 0xAFA7, 0x84EB, 0xAFA8, 0x84EC, 0xAFA9, 0x84ED, 0xAFAA, 0x84EE, 0xAFAB, + 0x84EF, 0xAFAC, 0x84F0, 0xAFAD, 0x84F1, 0xAFAE, 0x84F2, 0xAFAF, 0x84F3, 0xAFB0, 0x84F4, 0xAFB1, 0x84F5, 0xAFB2, 0x84F6, 0xAFB3, + 0x84F7, 0xAFB4, 0x84F8, 0xAFB5, 0x84F9, 0xAFB6, 0x84FA, 0xAFB7, 0x84FB, 0xAFBA, 0x84FC, 0xAFBB, 0x84FD, 0xAFBD, 0x84FE, 0xAFBE, + 0x8541, 0xAFBF, 0x8542, 0xAFC1, 0x8543, 0xAFC2, 0x8544, 0xAFC3, 0x8545, 0xAFC4, 0x8546, 0xAFC5, 0x8547, 0xAFC6, 0x8548, 0xAFCA, + 0x8549, 0xAFCC, 0x854A, 0xAFCF, 0x854B, 0xAFD0, 0x854C, 0xAFD1, 0x854D, 0xAFD2, 0x854E, 0xAFD3, 0x854F, 0xAFD5, 0x8550, 0xAFD6, + 0x8551, 0xAFD7, 0x8552, 0xAFD8, 0x8553, 0xAFD9, 0x8554, 0xAFDA, 0x8555, 0xAFDB, 0x8556, 0xAFDD, 0x8557, 0xAFDE, 0x8558, 0xAFDF, + 0x8559, 0xAFE0, 0x855A, 0xAFE1, 0x8561, 0xAFE2, 0x8562, 0xAFE3, 0x8563, 0xAFE4, 0x8564, 0xAFE5, 0x8565, 0xAFE6, 0x8566, 0xAFE7, + 0x8567, 0xAFEA, 0x8568, 0xAFEB, 0x8569, 0xAFEC, 0x856A, 0xAFED, 0x856B, 0xAFEE, 0x856C, 0xAFEF, 0x856D, 0xAFF2, 0x856E, 0xAFF3, + 0x856F, 0xAFF5, 0x8570, 0xAFF6, 0x8571, 0xAFF7, 0x8572, 0xAFF9, 0x8573, 0xAFFA, 0x8574, 0xAFFB, 0x8575, 0xAFFC, 0x8576, 0xAFFD, + 0x8577, 0xAFFE, 0x8578, 0xAFFF, 0x8579, 0xB002, 0x857A, 0xB003, 0x8581, 0xB005, 0x8582, 0xB006, 0x8583, 0xB007, 0x8584, 0xB008, + 0x8585, 0xB009, 0x8586, 0xB00A, 0x8587, 0xB00B, 0x8588, 0xB00D, 0x8589, 0xB00E, 0x858A, 0xB00F, 0x858B, 0xB011, 0x858C, 0xB012, + 0x858D, 0xB013, 0x858E, 0xB015, 0x858F, 0xB016, 0x8590, 0xB017, 0x8591, 0xB018, 0x8592, 0xB019, 0x8593, 0xB01A, 0x8594, 0xB01B, + 0x8595, 0xB01E, 0x8596, 0xB01F, 0x8597, 0xB020, 0x8598, 0xB021, 0x8599, 0xB022, 0x859A, 0xB023, 0x859B, 0xB024, 0x859C, 0xB025, + 0x859D, 0xB026, 0x859E, 0xB027, 0x859F, 0xB029, 0x85A0, 0xB02A, 0x85A1, 0xB02B, 0x85A2, 0xB02C, 0x85A3, 0xB02D, 0x85A4, 0xB02E, + 0x85A5, 0xB02F, 0x85A6, 0xB030, 0x85A7, 0xB031, 0x85A8, 0xB032, 0x85A9, 0xB033, 0x85AA, 0xB034, 0x85AB, 0xB035, 0x85AC, 0xB036, + 0x85AD, 0xB037, 0x85AE, 0xB038, 0x85AF, 0xB039, 0x85B0, 0xB03A, 0x85B1, 0xB03B, 0x85B2, 0xB03C, 0x85B3, 0xB03D, 0x85B4, 0xB03E, + 0x85B5, 0xB03F, 0x85B6, 0xB040, 0x85B7, 0xB041, 0x85B8, 0xB042, 0x85B9, 0xB043, 0x85BA, 0xB046, 0x85BB, 0xB047, 0x85BC, 0xB049, + 0x85BD, 0xB04B, 0x85BE, 0xB04D, 0x85BF, 0xB04F, 0x85C0, 0xB050, 0x85C1, 0xB051, 0x85C2, 0xB052, 0x85C3, 0xB056, 0x85C4, 0xB058, + 0x85C5, 0xB05A, 0x85C6, 0xB05B, 0x85C7, 0xB05C, 0x85C8, 0xB05E, 0x85C9, 0xB05F, 0x85CA, 0xB060, 0x85CB, 0xB061, 0x85CC, 0xB062, + 0x85CD, 0xB063, 0x85CE, 0xB064, 0x85CF, 0xB065, 0x85D0, 0xB066, 0x85D1, 0xB067, 0x85D2, 0xB068, 0x85D3, 0xB069, 0x85D4, 0xB06A, + 0x85D5, 0xB06B, 0x85D6, 0xB06C, 0x85D7, 0xB06D, 0x85D8, 0xB06E, 0x85D9, 0xB06F, 0x85DA, 0xB070, 0x85DB, 0xB071, 0x85DC, 0xB072, + 0x85DD, 0xB073, 0x85DE, 0xB074, 0x85DF, 0xB075, 0x85E0, 0xB076, 0x85E1, 0xB077, 0x85E2, 0xB078, 0x85E3, 0xB079, 0x85E4, 0xB07A, + 0x85E5, 0xB07B, 0x85E6, 0xB07E, 0x85E7, 0xB07F, 0x85E8, 0xB081, 0x85E9, 0xB082, 0x85EA, 0xB083, 0x85EB, 0xB085, 0x85EC, 0xB086, + 0x85ED, 0xB087, 0x85EE, 0xB088, 0x85EF, 0xB089, 0x85F0, 0xB08A, 0x85F1, 0xB08B, 0x85F2, 0xB08E, 0x85F3, 0xB090, 0x85F4, 0xB092, + 0x85F5, 0xB093, 0x85F6, 0xB094, 0x85F7, 0xB095, 0x85F8, 0xB096, 0x85F9, 0xB097, 0x85FA, 0xB09B, 0x85FB, 0xB09D, 0x85FC, 0xB09E, + 0x85FD, 0xB0A3, 0x85FE, 0xB0A4, 0x8641, 0xB0A5, 0x8642, 0xB0A6, 0x8643, 0xB0A7, 0x8644, 0xB0AA, 0x8645, 0xB0B0, 0x8646, 0xB0B2, + 0x8647, 0xB0B6, 0x8648, 0xB0B7, 0x8649, 0xB0B9, 0x864A, 0xB0BA, 0x864B, 0xB0BB, 0x864C, 0xB0BD, 0x864D, 0xB0BE, 0x864E, 0xB0BF, + 0x864F, 0xB0C0, 0x8650, 0xB0C1, 0x8651, 0xB0C2, 0x8652, 0xB0C3, 0x8653, 0xB0C6, 0x8654, 0xB0CA, 0x8655, 0xB0CB, 0x8656, 0xB0CC, + 0x8657, 0xB0CD, 0x8658, 0xB0CE, 0x8659, 0xB0CF, 0x865A, 0xB0D2, 0x8661, 0xB0D3, 0x8662, 0xB0D5, 0x8663, 0xB0D6, 0x8664, 0xB0D7, + 0x8665, 0xB0D9, 0x8666, 0xB0DA, 0x8667, 0xB0DB, 0x8668, 0xB0DC, 0x8669, 0xB0DD, 0x866A, 0xB0DE, 0x866B, 0xB0DF, 0x866C, 0xB0E1, + 0x866D, 0xB0E2, 0x866E, 0xB0E3, 0x866F, 0xB0E4, 0x8670, 0xB0E6, 0x8671, 0xB0E7, 0x8672, 0xB0E8, 0x8673, 0xB0E9, 0x8674, 0xB0EA, + 0x8675, 0xB0EB, 0x8676, 0xB0EC, 0x8677, 0xB0ED, 0x8678, 0xB0EE, 0x8679, 0xB0EF, 0x867A, 0xB0F0, 0x8681, 0xB0F1, 0x8682, 0xB0F2, + 0x8683, 0xB0F3, 0x8684, 0xB0F4, 0x8685, 0xB0F5, 0x8686, 0xB0F6, 0x8687, 0xB0F7, 0x8688, 0xB0F8, 0x8689, 0xB0F9, 0x868A, 0xB0FA, + 0x868B, 0xB0FB, 0x868C, 0xB0FC, 0x868D, 0xB0FD, 0x868E, 0xB0FE, 0x868F, 0xB0FF, 0x8690, 0xB100, 0x8691, 0xB101, 0x8692, 0xB102, + 0x8693, 0xB103, 0x8694, 0xB104, 0x8695, 0xB105, 0x8696, 0xB106, 0x8697, 0xB107, 0x8698, 0xB10A, 0x8699, 0xB10D, 0x869A, 0xB10E, + 0x869B, 0xB10F, 0x869C, 0xB111, 0x869D, 0xB114, 0x869E, 0xB115, 0x869F, 0xB116, 0x86A0, 0xB117, 0x86A1, 0xB11A, 0x86A2, 0xB11E, + 0x86A3, 0xB11F, 0x86A4, 0xB120, 0x86A5, 0xB121, 0x86A6, 0xB122, 0x86A7, 0xB126, 0x86A8, 0xB127, 0x86A9, 0xB129, 0x86AA, 0xB12A, + 0x86AB, 0xB12B, 0x86AC, 0xB12D, 0x86AD, 0xB12E, 0x86AE, 0xB12F, 0x86AF, 0xB130, 0x86B0, 0xB131, 0x86B1, 0xB132, 0x86B2, 0xB133, + 0x86B3, 0xB136, 0x86B4, 0xB13A, 0x86B5, 0xB13B, 0x86B6, 0xB13C, 0x86B7, 0xB13D, 0x86B8, 0xB13E, 0x86B9, 0xB13F, 0x86BA, 0xB142, + 0x86BB, 0xB143, 0x86BC, 0xB145, 0x86BD, 0xB146, 0x86BE, 0xB147, 0x86BF, 0xB149, 0x86C0, 0xB14A, 0x86C1, 0xB14B, 0x86C2, 0xB14C, + 0x86C3, 0xB14D, 0x86C4, 0xB14E, 0x86C5, 0xB14F, 0x86C6, 0xB152, 0x86C7, 0xB153, 0x86C8, 0xB156, 0x86C9, 0xB157, 0x86CA, 0xB159, + 0x86CB, 0xB15A, 0x86CC, 0xB15B, 0x86CD, 0xB15D, 0x86CE, 0xB15E, 0x86CF, 0xB15F, 0x86D0, 0xB161, 0x86D1, 0xB162, 0x86D2, 0xB163, + 0x86D3, 0xB164, 0x86D4, 0xB165, 0x86D5, 0xB166, 0x86D6, 0xB167, 0x86D7, 0xB168, 0x86D8, 0xB169, 0x86D9, 0xB16A, 0x86DA, 0xB16B, + 0x86DB, 0xB16C, 0x86DC, 0xB16D, 0x86DD, 0xB16E, 0x86DE, 0xB16F, 0x86DF, 0xB170, 0x86E0, 0xB171, 0x86E1, 0xB172, 0x86E2, 0xB173, + 0x86E3, 0xB174, 0x86E4, 0xB175, 0x86E5, 0xB176, 0x86E6, 0xB177, 0x86E7, 0xB17A, 0x86E8, 0xB17B, 0x86E9, 0xB17D, 0x86EA, 0xB17E, + 0x86EB, 0xB17F, 0x86EC, 0xB181, 0x86ED, 0xB183, 0x86EE, 0xB184, 0x86EF, 0xB185, 0x86F0, 0xB186, 0x86F1, 0xB187, 0x86F2, 0xB18A, + 0x86F3, 0xB18C, 0x86F4, 0xB18E, 0x86F5, 0xB18F, 0x86F6, 0xB190, 0x86F7, 0xB191, 0x86F8, 0xB195, 0x86F9, 0xB196, 0x86FA, 0xB197, + 0x86FB, 0xB199, 0x86FC, 0xB19A, 0x86FD, 0xB19B, 0x86FE, 0xB19D, 0x8741, 0xB19E, 0x8742, 0xB19F, 0x8743, 0xB1A0, 0x8744, 0xB1A1, + 0x8745, 0xB1A2, 0x8746, 0xB1A3, 0x8747, 0xB1A4, 0x8748, 0xB1A5, 0x8749, 0xB1A6, 0x874A, 0xB1A7, 0x874B, 0xB1A9, 0x874C, 0xB1AA, + 0x874D, 0xB1AB, 0x874E, 0xB1AC, 0x874F, 0xB1AD, 0x8750, 0xB1AE, 0x8751, 0xB1AF, 0x8752, 0xB1B0, 0x8753, 0xB1B1, 0x8754, 0xB1B2, + 0x8755, 0xB1B3, 0x8756, 0xB1B4, 0x8757, 0xB1B5, 0x8758, 0xB1B6, 0x8759, 0xB1B7, 0x875A, 0xB1B8, 0x8761, 0xB1B9, 0x8762, 0xB1BA, + 0x8763, 0xB1BB, 0x8764, 0xB1BC, 0x8765, 0xB1BD, 0x8766, 0xB1BE, 0x8767, 0xB1BF, 0x8768, 0xB1C0, 0x8769, 0xB1C1, 0x876A, 0xB1C2, + 0x876B, 0xB1C3, 0x876C, 0xB1C4, 0x876D, 0xB1C5, 0x876E, 0xB1C6, 0x876F, 0xB1C7, 0x8770, 0xB1C8, 0x8771, 0xB1C9, 0x8772, 0xB1CA, + 0x8773, 0xB1CB, 0x8774, 0xB1CD, 0x8775, 0xB1CE, 0x8776, 0xB1CF, 0x8777, 0xB1D1, 0x8778, 0xB1D2, 0x8779, 0xB1D3, 0x877A, 0xB1D5, + 0x8781, 0xB1D6, 0x8782, 0xB1D7, 0x8783, 0xB1D8, 0x8784, 0xB1D9, 0x8785, 0xB1DA, 0x8786, 0xB1DB, 0x8787, 0xB1DE, 0x8788, 0xB1E0, + 0x8789, 0xB1E1, 0x878A, 0xB1E2, 0x878B, 0xB1E3, 0x878C, 0xB1E4, 0x878D, 0xB1E5, 0x878E, 0xB1E6, 0x878F, 0xB1E7, 0x8790, 0xB1EA, + 0x8791, 0xB1EB, 0x8792, 0xB1ED, 0x8793, 0xB1EE, 0x8794, 0xB1EF, 0x8795, 0xB1F1, 0x8796, 0xB1F2, 0x8797, 0xB1F3, 0x8798, 0xB1F4, + 0x8799, 0xB1F5, 0x879A, 0xB1F6, 0x879B, 0xB1F7, 0x879C, 0xB1F8, 0x879D, 0xB1FA, 0x879E, 0xB1FC, 0x879F, 0xB1FE, 0x87A0, 0xB1FF, + 0x87A1, 0xB200, 0x87A2, 0xB201, 0x87A3, 0xB202, 0x87A4, 0xB203, 0x87A5, 0xB206, 0x87A6, 0xB207, 0x87A7, 0xB209, 0x87A8, 0xB20A, + 0x87A9, 0xB20D, 0x87AA, 0xB20E, 0x87AB, 0xB20F, 0x87AC, 0xB210, 0x87AD, 0xB211, 0x87AE, 0xB212, 0x87AF, 0xB213, 0x87B0, 0xB216, + 0x87B1, 0xB218, 0x87B2, 0xB21A, 0x87B3, 0xB21B, 0x87B4, 0xB21C, 0x87B5, 0xB21D, 0x87B6, 0xB21E, 0x87B7, 0xB21F, 0x87B8, 0xB221, + 0x87B9, 0xB222, 0x87BA, 0xB223, 0x87BB, 0xB224, 0x87BC, 0xB225, 0x87BD, 0xB226, 0x87BE, 0xB227, 0x87BF, 0xB228, 0x87C0, 0xB229, + 0x87C1, 0xB22A, 0x87C2, 0xB22B, 0x87C3, 0xB22C, 0x87C4, 0xB22D, 0x87C5, 0xB22E, 0x87C6, 0xB22F, 0x87C7, 0xB230, 0x87C8, 0xB231, + 0x87C9, 0xB232, 0x87CA, 0xB233, 0x87CB, 0xB235, 0x87CC, 0xB236, 0x87CD, 0xB237, 0x87CE, 0xB238, 0x87CF, 0xB239, 0x87D0, 0xB23A, + 0x87D1, 0xB23B, 0x87D2, 0xB23D, 0x87D3, 0xB23E, 0x87D4, 0xB23F, 0x87D5, 0xB240, 0x87D6, 0xB241, 0x87D7, 0xB242, 0x87D8, 0xB243, + 0x87D9, 0xB244, 0x87DA, 0xB245, 0x87DB, 0xB246, 0x87DC, 0xB247, 0x87DD, 0xB248, 0x87DE, 0xB249, 0x87DF, 0xB24A, 0x87E0, 0xB24B, + 0x87E1, 0xB24C, 0x87E2, 0xB24D, 0x87E3, 0xB24E, 0x87E4, 0xB24F, 0x87E5, 0xB250, 0x87E6, 0xB251, 0x87E7, 0xB252, 0x87E8, 0xB253, + 0x87E9, 0xB254, 0x87EA, 0xB255, 0x87EB, 0xB256, 0x87EC, 0xB257, 0x87ED, 0xB259, 0x87EE, 0xB25A, 0x87EF, 0xB25B, 0x87F0, 0xB25D, + 0x87F1, 0xB25E, 0x87F2, 0xB25F, 0x87F3, 0xB261, 0x87F4, 0xB262, 0x87F5, 0xB263, 0x87F6, 0xB264, 0x87F7, 0xB265, 0x87F8, 0xB266, + 0x87F9, 0xB267, 0x87FA, 0xB26A, 0x87FB, 0xB26B, 0x87FC, 0xB26C, 0x87FD, 0xB26D, 0x87FE, 0xB26E, 0x8841, 0xB26F, 0x8842, 0xB270, + 0x8843, 0xB271, 0x8844, 0xB272, 0x8845, 0xB273, 0x8846, 0xB276, 0x8847, 0xB277, 0x8848, 0xB278, 0x8849, 0xB279, 0x884A, 0xB27A, + 0x884B, 0xB27B, 0x884C, 0xB27D, 0x884D, 0xB27E, 0x884E, 0xB27F, 0x884F, 0xB280, 0x8850, 0xB281, 0x8851, 0xB282, 0x8852, 0xB283, + 0x8853, 0xB286, 0x8854, 0xB287, 0x8855, 0xB288, 0x8856, 0xB28A, 0x8857, 0xB28B, 0x8858, 0xB28C, 0x8859, 0xB28D, 0x885A, 0xB28E, + 0x8861, 0xB28F, 0x8862, 0xB292, 0x8863, 0xB293, 0x8864, 0xB295, 0x8865, 0xB296, 0x8866, 0xB297, 0x8867, 0xB29B, 0x8868, 0xB29C, + 0x8869, 0xB29D, 0x886A, 0xB29E, 0x886B, 0xB29F, 0x886C, 0xB2A2, 0x886D, 0xB2A4, 0x886E, 0xB2A7, 0x886F, 0xB2A8, 0x8870, 0xB2A9, + 0x8871, 0xB2AB, 0x8872, 0xB2AD, 0x8873, 0xB2AE, 0x8874, 0xB2AF, 0x8875, 0xB2B1, 0x8876, 0xB2B2, 0x8877, 0xB2B3, 0x8878, 0xB2B5, + 0x8879, 0xB2B6, 0x887A, 0xB2B7, 0x8881, 0xB2B8, 0x8882, 0xB2B9, 0x8883, 0xB2BA, 0x8884, 0xB2BB, 0x8885, 0xB2BC, 0x8886, 0xB2BD, + 0x8887, 0xB2BE, 0x8888, 0xB2BF, 0x8889, 0xB2C0, 0x888A, 0xB2C1, 0x888B, 0xB2C2, 0x888C, 0xB2C3, 0x888D, 0xB2C4, 0x888E, 0xB2C5, + 0x888F, 0xB2C6, 0x8890, 0xB2C7, 0x8891, 0xB2CA, 0x8892, 0xB2CB, 0x8893, 0xB2CD, 0x8894, 0xB2CE, 0x8895, 0xB2CF, 0x8896, 0xB2D1, + 0x8897, 0xB2D3, 0x8898, 0xB2D4, 0x8899, 0xB2D5, 0x889A, 0xB2D6, 0x889B, 0xB2D7, 0x889C, 0xB2DA, 0x889D, 0xB2DC, 0x889E, 0xB2DE, + 0x889F, 0xB2DF, 0x88A0, 0xB2E0, 0x88A1, 0xB2E1, 0x88A2, 0xB2E3, 0x88A3, 0xB2E7, 0x88A4, 0xB2E9, 0x88A5, 0xB2EA, 0x88A6, 0xB2F0, + 0x88A7, 0xB2F1, 0x88A8, 0xB2F2, 0x88A9, 0xB2F6, 0x88AA, 0xB2FC, 0x88AB, 0xB2FD, 0x88AC, 0xB2FE, 0x88AD, 0xB302, 0x88AE, 0xB303, + 0x88AF, 0xB305, 0x88B0, 0xB306, 0x88B1, 0xB307, 0x88B2, 0xB309, 0x88B3, 0xB30A, 0x88B4, 0xB30B, 0x88B5, 0xB30C, 0x88B6, 0xB30D, + 0x88B7, 0xB30E, 0x88B8, 0xB30F, 0x88B9, 0xB312, 0x88BA, 0xB316, 0x88BB, 0xB317, 0x88BC, 0xB318, 0x88BD, 0xB319, 0x88BE, 0xB31A, + 0x88BF, 0xB31B, 0x88C0, 0xB31D, 0x88C1, 0xB31E, 0x88C2, 0xB31F, 0x88C3, 0xB320, 0x88C4, 0xB321, 0x88C5, 0xB322, 0x88C6, 0xB323, + 0x88C7, 0xB324, 0x88C8, 0xB325, 0x88C9, 0xB326, 0x88CA, 0xB327, 0x88CB, 0xB328, 0x88CC, 0xB329, 0x88CD, 0xB32A, 0x88CE, 0xB32B, + 0x88CF, 0xB32C, 0x88D0, 0xB32D, 0x88D1, 0xB32E, 0x88D2, 0xB32F, 0x88D3, 0xB330, 0x88D4, 0xB331, 0x88D5, 0xB332, 0x88D6, 0xB333, + 0x88D7, 0xB334, 0x88D8, 0xB335, 0x88D9, 0xB336, 0x88DA, 0xB337, 0x88DB, 0xB338, 0x88DC, 0xB339, 0x88DD, 0xB33A, 0x88DE, 0xB33B, + 0x88DF, 0xB33C, 0x88E0, 0xB33D, 0x88E1, 0xB33E, 0x88E2, 0xB33F, 0x88E3, 0xB340, 0x88E4, 0xB341, 0x88E5, 0xB342, 0x88E6, 0xB343, + 0x88E7, 0xB344, 0x88E8, 0xB345, 0x88E9, 0xB346, 0x88EA, 0xB347, 0x88EB, 0xB348, 0x88EC, 0xB349, 0x88ED, 0xB34A, 0x88EE, 0xB34B, + 0x88EF, 0xB34C, 0x88F0, 0xB34D, 0x88F1, 0xB34E, 0x88F2, 0xB34F, 0x88F3, 0xB350, 0x88F4, 0xB351, 0x88F5, 0xB352, 0x88F6, 0xB353, + 0x88F7, 0xB357, 0x88F8, 0xB359, 0x88F9, 0xB35A, 0x88FA, 0xB35D, 0x88FB, 0xB360, 0x88FC, 0xB361, 0x88FD, 0xB362, 0x88FE, 0xB363, + 0x8941, 0xB366, 0x8942, 0xB368, 0x8943, 0xB36A, 0x8944, 0xB36C, 0x8945, 0xB36D, 0x8946, 0xB36F, 0x8947, 0xB372, 0x8948, 0xB373, + 0x8949, 0xB375, 0x894A, 0xB376, 0x894B, 0xB377, 0x894C, 0xB379, 0x894D, 0xB37A, 0x894E, 0xB37B, 0x894F, 0xB37C, 0x8950, 0xB37D, + 0x8951, 0xB37E, 0x8952, 0xB37F, 0x8953, 0xB382, 0x8954, 0xB386, 0x8955, 0xB387, 0x8956, 0xB388, 0x8957, 0xB389, 0x8958, 0xB38A, + 0x8959, 0xB38B, 0x895A, 0xB38D, 0x8961, 0xB38E, 0x8962, 0xB38F, 0x8963, 0xB391, 0x8964, 0xB392, 0x8965, 0xB393, 0x8966, 0xB395, + 0x8967, 0xB396, 0x8968, 0xB397, 0x8969, 0xB398, 0x896A, 0xB399, 0x896B, 0xB39A, 0x896C, 0xB39B, 0x896D, 0xB39C, 0x896E, 0xB39D, + 0x896F, 0xB39E, 0x8970, 0xB39F, 0x8971, 0xB3A2, 0x8972, 0xB3A3, 0x8973, 0xB3A4, 0x8974, 0xB3A5, 0x8975, 0xB3A6, 0x8976, 0xB3A7, + 0x8977, 0xB3A9, 0x8978, 0xB3AA, 0x8979, 0xB3AB, 0x897A, 0xB3AD, 0x8981, 0xB3AE, 0x8982, 0xB3AF, 0x8983, 0xB3B0, 0x8984, 0xB3B1, + 0x8985, 0xB3B2, 0x8986, 0xB3B3, 0x8987, 0xB3B4, 0x8988, 0xB3B5, 0x8989, 0xB3B6, 0x898A, 0xB3B7, 0x898B, 0xB3B8, 0x898C, 0xB3B9, + 0x898D, 0xB3BA, 0x898E, 0xB3BB, 0x898F, 0xB3BC, 0x8990, 0xB3BD, 0x8991, 0xB3BE, 0x8992, 0xB3BF, 0x8993, 0xB3C0, 0x8994, 0xB3C1, + 0x8995, 0xB3C2, 0x8996, 0xB3C3, 0x8997, 0xB3C6, 0x8998, 0xB3C7, 0x8999, 0xB3C9, 0x899A, 0xB3CA, 0x899B, 0xB3CD, 0x899C, 0xB3CF, + 0x899D, 0xB3D1, 0x899E, 0xB3D2, 0x899F, 0xB3D3, 0x89A0, 0xB3D6, 0x89A1, 0xB3D8, 0x89A2, 0xB3DA, 0x89A3, 0xB3DC, 0x89A4, 0xB3DE, + 0x89A5, 0xB3DF, 0x89A6, 0xB3E1, 0x89A7, 0xB3E2, 0x89A8, 0xB3E3, 0x89A9, 0xB3E5, 0x89AA, 0xB3E6, 0x89AB, 0xB3E7, 0x89AC, 0xB3E9, + 0x89AD, 0xB3EA, 0x89AE, 0xB3EB, 0x89AF, 0xB3EC, 0x89B0, 0xB3ED, 0x89B1, 0xB3EE, 0x89B2, 0xB3EF, 0x89B3, 0xB3F0, 0x89B4, 0xB3F1, + 0x89B5, 0xB3F2, 0x89B6, 0xB3F3, 0x89B7, 0xB3F4, 0x89B8, 0xB3F5, 0x89B9, 0xB3F6, 0x89BA, 0xB3F7, 0x89BB, 0xB3F8, 0x89BC, 0xB3F9, + 0x89BD, 0xB3FA, 0x89BE, 0xB3FB, 0x89BF, 0xB3FD, 0x89C0, 0xB3FE, 0x89C1, 0xB3FF, 0x89C2, 0xB400, 0x89C3, 0xB401, 0x89C4, 0xB402, + 0x89C5, 0xB403, 0x89C6, 0xB404, 0x89C7, 0xB405, 0x89C8, 0xB406, 0x89C9, 0xB407, 0x89CA, 0xB408, 0x89CB, 0xB409, 0x89CC, 0xB40A, + 0x89CD, 0xB40B, 0x89CE, 0xB40C, 0x89CF, 0xB40D, 0x89D0, 0xB40E, 0x89D1, 0xB40F, 0x89D2, 0xB411, 0x89D3, 0xB412, 0x89D4, 0xB413, + 0x89D5, 0xB414, 0x89D6, 0xB415, 0x89D7, 0xB416, 0x89D8, 0xB417, 0x89D9, 0xB419, 0x89DA, 0xB41A, 0x89DB, 0xB41B, 0x89DC, 0xB41D, + 0x89DD, 0xB41E, 0x89DE, 0xB41F, 0x89DF, 0xB421, 0x89E0, 0xB422, 0x89E1, 0xB423, 0x89E2, 0xB424, 0x89E3, 0xB425, 0x89E4, 0xB426, + 0x89E5, 0xB427, 0x89E6, 0xB42A, 0x89E7, 0xB42C, 0x89E8, 0xB42D, 0x89E9, 0xB42E, 0x89EA, 0xB42F, 0x89EB, 0xB430, 0x89EC, 0xB431, + 0x89ED, 0xB432, 0x89EE, 0xB433, 0x89EF, 0xB435, 0x89F0, 0xB436, 0x89F1, 0xB437, 0x89F2, 0xB438, 0x89F3, 0xB439, 0x89F4, 0xB43A, + 0x89F5, 0xB43B, 0x89F6, 0xB43C, 0x89F7, 0xB43D, 0x89F8, 0xB43E, 0x89F9, 0xB43F, 0x89FA, 0xB440, 0x89FB, 0xB441, 0x89FC, 0xB442, + 0x89FD, 0xB443, 0x89FE, 0xB444, 0x8A41, 0xB445, 0x8A42, 0xB446, 0x8A43, 0xB447, 0x8A44, 0xB448, 0x8A45, 0xB449, 0x8A46, 0xB44A, + 0x8A47, 0xB44B, 0x8A48, 0xB44C, 0x8A49, 0xB44D, 0x8A4A, 0xB44E, 0x8A4B, 0xB44F, 0x8A4C, 0xB452, 0x8A4D, 0xB453, 0x8A4E, 0xB455, + 0x8A4F, 0xB456, 0x8A50, 0xB457, 0x8A51, 0xB459, 0x8A52, 0xB45A, 0x8A53, 0xB45B, 0x8A54, 0xB45C, 0x8A55, 0xB45D, 0x8A56, 0xB45E, + 0x8A57, 0xB45F, 0x8A58, 0xB462, 0x8A59, 0xB464, 0x8A5A, 0xB466, 0x8A61, 0xB467, 0x8A62, 0xB468, 0x8A63, 0xB469, 0x8A64, 0xB46A, + 0x8A65, 0xB46B, 0x8A66, 0xB46D, 0x8A67, 0xB46E, 0x8A68, 0xB46F, 0x8A69, 0xB470, 0x8A6A, 0xB471, 0x8A6B, 0xB472, 0x8A6C, 0xB473, + 0x8A6D, 0xB474, 0x8A6E, 0xB475, 0x8A6F, 0xB476, 0x8A70, 0xB477, 0x8A71, 0xB478, 0x8A72, 0xB479, 0x8A73, 0xB47A, 0x8A74, 0xB47B, + 0x8A75, 0xB47C, 0x8A76, 0xB47D, 0x8A77, 0xB47E, 0x8A78, 0xB47F, 0x8A79, 0xB481, 0x8A7A, 0xB482, 0x8A81, 0xB483, 0x8A82, 0xB484, + 0x8A83, 0xB485, 0x8A84, 0xB486, 0x8A85, 0xB487, 0x8A86, 0xB489, 0x8A87, 0xB48A, 0x8A88, 0xB48B, 0x8A89, 0xB48C, 0x8A8A, 0xB48D, + 0x8A8B, 0xB48E, 0x8A8C, 0xB48F, 0x8A8D, 0xB490, 0x8A8E, 0xB491, 0x8A8F, 0xB492, 0x8A90, 0xB493, 0x8A91, 0xB494, 0x8A92, 0xB495, + 0x8A93, 0xB496, 0x8A94, 0xB497, 0x8A95, 0xB498, 0x8A96, 0xB499, 0x8A97, 0xB49A, 0x8A98, 0xB49B, 0x8A99, 0xB49C, 0x8A9A, 0xB49E, + 0x8A9B, 0xB49F, 0x8A9C, 0xB4A0, 0x8A9D, 0xB4A1, 0x8A9E, 0xB4A2, 0x8A9F, 0xB4A3, 0x8AA0, 0xB4A5, 0x8AA1, 0xB4A6, 0x8AA2, 0xB4A7, + 0x8AA3, 0xB4A9, 0x8AA4, 0xB4AA, 0x8AA5, 0xB4AB, 0x8AA6, 0xB4AD, 0x8AA7, 0xB4AE, 0x8AA8, 0xB4AF, 0x8AA9, 0xB4B0, 0x8AAA, 0xB4B1, + 0x8AAB, 0xB4B2, 0x8AAC, 0xB4B3, 0x8AAD, 0xB4B4, 0x8AAE, 0xB4B6, 0x8AAF, 0xB4B8, 0x8AB0, 0xB4BA, 0x8AB1, 0xB4BB, 0x8AB2, 0xB4BC, + 0x8AB3, 0xB4BD, 0x8AB4, 0xB4BE, 0x8AB5, 0xB4BF, 0x8AB6, 0xB4C1, 0x8AB7, 0xB4C2, 0x8AB8, 0xB4C3, 0x8AB9, 0xB4C5, 0x8ABA, 0xB4C6, + 0x8ABB, 0xB4C7, 0x8ABC, 0xB4C9, 0x8ABD, 0xB4CA, 0x8ABE, 0xB4CB, 0x8ABF, 0xB4CC, 0x8AC0, 0xB4CD, 0x8AC1, 0xB4CE, 0x8AC2, 0xB4CF, + 0x8AC3, 0xB4D1, 0x8AC4, 0xB4D2, 0x8AC5, 0xB4D3, 0x8AC6, 0xB4D4, 0x8AC7, 0xB4D6, 0x8AC8, 0xB4D7, 0x8AC9, 0xB4D8, 0x8ACA, 0xB4D9, + 0x8ACB, 0xB4DA, 0x8ACC, 0xB4DB, 0x8ACD, 0xB4DE, 0x8ACE, 0xB4DF, 0x8ACF, 0xB4E1, 0x8AD0, 0xB4E2, 0x8AD1, 0xB4E5, 0x8AD2, 0xB4E7, + 0x8AD3, 0xB4E8, 0x8AD4, 0xB4E9, 0x8AD5, 0xB4EA, 0x8AD6, 0xB4EB, 0x8AD7, 0xB4EE, 0x8AD8, 0xB4F0, 0x8AD9, 0xB4F2, 0x8ADA, 0xB4F3, + 0x8ADB, 0xB4F4, 0x8ADC, 0xB4F5, 0x8ADD, 0xB4F6, 0x8ADE, 0xB4F7, 0x8ADF, 0xB4F9, 0x8AE0, 0xB4FA, 0x8AE1, 0xB4FB, 0x8AE2, 0xB4FC, + 0x8AE3, 0xB4FD, 0x8AE4, 0xB4FE, 0x8AE5, 0xB4FF, 0x8AE6, 0xB500, 0x8AE7, 0xB501, 0x8AE8, 0xB502, 0x8AE9, 0xB503, 0x8AEA, 0xB504, + 0x8AEB, 0xB505, 0x8AEC, 0xB506, 0x8AED, 0xB507, 0x8AEE, 0xB508, 0x8AEF, 0xB509, 0x8AF0, 0xB50A, 0x8AF1, 0xB50B, 0x8AF2, 0xB50C, + 0x8AF3, 0xB50D, 0x8AF4, 0xB50E, 0x8AF5, 0xB50F, 0x8AF6, 0xB510, 0x8AF7, 0xB511, 0x8AF8, 0xB512, 0x8AF9, 0xB513, 0x8AFA, 0xB516, + 0x8AFB, 0xB517, 0x8AFC, 0xB519, 0x8AFD, 0xB51A, 0x8AFE, 0xB51D, 0x8B41, 0xB51E, 0x8B42, 0xB51F, 0x8B43, 0xB520, 0x8B44, 0xB521, + 0x8B45, 0xB522, 0x8B46, 0xB523, 0x8B47, 0xB526, 0x8B48, 0xB52B, 0x8B49, 0xB52C, 0x8B4A, 0xB52D, 0x8B4B, 0xB52E, 0x8B4C, 0xB52F, + 0x8B4D, 0xB532, 0x8B4E, 0xB533, 0x8B4F, 0xB535, 0x8B50, 0xB536, 0x8B51, 0xB537, 0x8B52, 0xB539, 0x8B53, 0xB53A, 0x8B54, 0xB53B, + 0x8B55, 0xB53C, 0x8B56, 0xB53D, 0x8B57, 0xB53E, 0x8B58, 0xB53F, 0x8B59, 0xB542, 0x8B5A, 0xB546, 0x8B61, 0xB547, 0x8B62, 0xB548, + 0x8B63, 0xB549, 0x8B64, 0xB54A, 0x8B65, 0xB54E, 0x8B66, 0xB54F, 0x8B67, 0xB551, 0x8B68, 0xB552, 0x8B69, 0xB553, 0x8B6A, 0xB555, + 0x8B6B, 0xB556, 0x8B6C, 0xB557, 0x8B6D, 0xB558, 0x8B6E, 0xB559, 0x8B6F, 0xB55A, 0x8B70, 0xB55B, 0x8B71, 0xB55E, 0x8B72, 0xB562, + 0x8B73, 0xB563, 0x8B74, 0xB564, 0x8B75, 0xB565, 0x8B76, 0xB566, 0x8B77, 0xB567, 0x8B78, 0xB568, 0x8B79, 0xB569, 0x8B7A, 0xB56A, + 0x8B81, 0xB56B, 0x8B82, 0xB56C, 0x8B83, 0xB56D, 0x8B84, 0xB56E, 0x8B85, 0xB56F, 0x8B86, 0xB570, 0x8B87, 0xB571, 0x8B88, 0xB572, + 0x8B89, 0xB573, 0x8B8A, 0xB574, 0x8B8B, 0xB575, 0x8B8C, 0xB576, 0x8B8D, 0xB577, 0x8B8E, 0xB578, 0x8B8F, 0xB579, 0x8B90, 0xB57A, + 0x8B91, 0xB57B, 0x8B92, 0xB57C, 0x8B93, 0xB57D, 0x8B94, 0xB57E, 0x8B95, 0xB57F, 0x8B96, 0xB580, 0x8B97, 0xB581, 0x8B98, 0xB582, + 0x8B99, 0xB583, 0x8B9A, 0xB584, 0x8B9B, 0xB585, 0x8B9C, 0xB586, 0x8B9D, 0xB587, 0x8B9E, 0xB588, 0x8B9F, 0xB589, 0x8BA0, 0xB58A, + 0x8BA1, 0xB58B, 0x8BA2, 0xB58C, 0x8BA3, 0xB58D, 0x8BA4, 0xB58E, 0x8BA5, 0xB58F, 0x8BA6, 0xB590, 0x8BA7, 0xB591, 0x8BA8, 0xB592, + 0x8BA9, 0xB593, 0x8BAA, 0xB594, 0x8BAB, 0xB595, 0x8BAC, 0xB596, 0x8BAD, 0xB597, 0x8BAE, 0xB598, 0x8BAF, 0xB599, 0x8BB0, 0xB59A, + 0x8BB1, 0xB59B, 0x8BB2, 0xB59C, 0x8BB3, 0xB59D, 0x8BB4, 0xB59E, 0x8BB5, 0xB59F, 0x8BB6, 0xB5A2, 0x8BB7, 0xB5A3, 0x8BB8, 0xB5A5, + 0x8BB9, 0xB5A6, 0x8BBA, 0xB5A7, 0x8BBB, 0xB5A9, 0x8BBC, 0xB5AC, 0x8BBD, 0xB5AD, 0x8BBE, 0xB5AE, 0x8BBF, 0xB5AF, 0x8BC0, 0xB5B2, + 0x8BC1, 0xB5B6, 0x8BC2, 0xB5B7, 0x8BC3, 0xB5B8, 0x8BC4, 0xB5B9, 0x8BC5, 0xB5BA, 0x8BC6, 0xB5BE, 0x8BC7, 0xB5BF, 0x8BC8, 0xB5C1, + 0x8BC9, 0xB5C2, 0x8BCA, 0xB5C3, 0x8BCB, 0xB5C5, 0x8BCC, 0xB5C6, 0x8BCD, 0xB5C7, 0x8BCE, 0xB5C8, 0x8BCF, 0xB5C9, 0x8BD0, 0xB5CA, + 0x8BD1, 0xB5CB, 0x8BD2, 0xB5CE, 0x8BD3, 0xB5D2, 0x8BD4, 0xB5D3, 0x8BD5, 0xB5D4, 0x8BD6, 0xB5D5, 0x8BD7, 0xB5D6, 0x8BD8, 0xB5D7, + 0x8BD9, 0xB5D9, 0x8BDA, 0xB5DA, 0x8BDB, 0xB5DB, 0x8BDC, 0xB5DC, 0x8BDD, 0xB5DD, 0x8BDE, 0xB5DE, 0x8BDF, 0xB5DF, 0x8BE0, 0xB5E0, + 0x8BE1, 0xB5E1, 0x8BE2, 0xB5E2, 0x8BE3, 0xB5E3, 0x8BE4, 0xB5E4, 0x8BE5, 0xB5E5, 0x8BE6, 0xB5E6, 0x8BE7, 0xB5E7, 0x8BE8, 0xB5E8, + 0x8BE9, 0xB5E9, 0x8BEA, 0xB5EA, 0x8BEB, 0xB5EB, 0x8BEC, 0xB5ED, 0x8BED, 0xB5EE, 0x8BEE, 0xB5EF, 0x8BEF, 0xB5F0, 0x8BF0, 0xB5F1, + 0x8BF1, 0xB5F2, 0x8BF2, 0xB5F3, 0x8BF3, 0xB5F4, 0x8BF4, 0xB5F5, 0x8BF5, 0xB5F6, 0x8BF6, 0xB5F7, 0x8BF7, 0xB5F8, 0x8BF8, 0xB5F9, + 0x8BF9, 0xB5FA, 0x8BFA, 0xB5FB, 0x8BFB, 0xB5FC, 0x8BFC, 0xB5FD, 0x8BFD, 0xB5FE, 0x8BFE, 0xB5FF, 0x8C41, 0xB600, 0x8C42, 0xB601, + 0x8C43, 0xB602, 0x8C44, 0xB603, 0x8C45, 0xB604, 0x8C46, 0xB605, 0x8C47, 0xB606, 0x8C48, 0xB607, 0x8C49, 0xB608, 0x8C4A, 0xB609, + 0x8C4B, 0xB60A, 0x8C4C, 0xB60B, 0x8C4D, 0xB60C, 0x8C4E, 0xB60D, 0x8C4F, 0xB60E, 0x8C50, 0xB60F, 0x8C51, 0xB612, 0x8C52, 0xB613, + 0x8C53, 0xB615, 0x8C54, 0xB616, 0x8C55, 0xB617, 0x8C56, 0xB619, 0x8C57, 0xB61A, 0x8C58, 0xB61B, 0x8C59, 0xB61C, 0x8C5A, 0xB61D, + 0x8C61, 0xB61E, 0x8C62, 0xB61F, 0x8C63, 0xB620, 0x8C64, 0xB621, 0x8C65, 0xB622, 0x8C66, 0xB623, 0x8C67, 0xB624, 0x8C68, 0xB626, + 0x8C69, 0xB627, 0x8C6A, 0xB628, 0x8C6B, 0xB629, 0x8C6C, 0xB62A, 0x8C6D, 0xB62B, 0x8C6E, 0xB62D, 0x8C6F, 0xB62E, 0x8C70, 0xB62F, + 0x8C71, 0xB630, 0x8C72, 0xB631, 0x8C73, 0xB632, 0x8C74, 0xB633, 0x8C75, 0xB635, 0x8C76, 0xB636, 0x8C77, 0xB637, 0x8C78, 0xB638, + 0x8C79, 0xB639, 0x8C7A, 0xB63A, 0x8C81, 0xB63B, 0x8C82, 0xB63C, 0x8C83, 0xB63D, 0x8C84, 0xB63E, 0x8C85, 0xB63F, 0x8C86, 0xB640, + 0x8C87, 0xB641, 0x8C88, 0xB642, 0x8C89, 0xB643, 0x8C8A, 0xB644, 0x8C8B, 0xB645, 0x8C8C, 0xB646, 0x8C8D, 0xB647, 0x8C8E, 0xB649, + 0x8C8F, 0xB64A, 0x8C90, 0xB64B, 0x8C91, 0xB64C, 0x8C92, 0xB64D, 0x8C93, 0xB64E, 0x8C94, 0xB64F, 0x8C95, 0xB650, 0x8C96, 0xB651, + 0x8C97, 0xB652, 0x8C98, 0xB653, 0x8C99, 0xB654, 0x8C9A, 0xB655, 0x8C9B, 0xB656, 0x8C9C, 0xB657, 0x8C9D, 0xB658, 0x8C9E, 0xB659, + 0x8C9F, 0xB65A, 0x8CA0, 0xB65B, 0x8CA1, 0xB65C, 0x8CA2, 0xB65D, 0x8CA3, 0xB65E, 0x8CA4, 0xB65F, 0x8CA5, 0xB660, 0x8CA6, 0xB661, + 0x8CA7, 0xB662, 0x8CA8, 0xB663, 0x8CA9, 0xB665, 0x8CAA, 0xB666, 0x8CAB, 0xB667, 0x8CAC, 0xB669, 0x8CAD, 0xB66A, 0x8CAE, 0xB66B, + 0x8CAF, 0xB66C, 0x8CB0, 0xB66D, 0x8CB1, 0xB66E, 0x8CB2, 0xB66F, 0x8CB3, 0xB670, 0x8CB4, 0xB671, 0x8CB5, 0xB672, 0x8CB6, 0xB673, + 0x8CB7, 0xB674, 0x8CB8, 0xB675, 0x8CB9, 0xB676, 0x8CBA, 0xB677, 0x8CBB, 0xB678, 0x8CBC, 0xB679, 0x8CBD, 0xB67A, 0x8CBE, 0xB67B, + 0x8CBF, 0xB67C, 0x8CC0, 0xB67D, 0x8CC1, 0xB67E, 0x8CC2, 0xB67F, 0x8CC3, 0xB680, 0x8CC4, 0xB681, 0x8CC5, 0xB682, 0x8CC6, 0xB683, + 0x8CC7, 0xB684, 0x8CC8, 0xB685, 0x8CC9, 0xB686, 0x8CCA, 0xB687, 0x8CCB, 0xB688, 0x8CCC, 0xB689, 0x8CCD, 0xB68A, 0x8CCE, 0xB68B, + 0x8CCF, 0xB68C, 0x8CD0, 0xB68D, 0x8CD1, 0xB68E, 0x8CD2, 0xB68F, 0x8CD3, 0xB690, 0x8CD4, 0xB691, 0x8CD5, 0xB692, 0x8CD6, 0xB693, + 0x8CD7, 0xB694, 0x8CD8, 0xB695, 0x8CD9, 0xB696, 0x8CDA, 0xB697, 0x8CDB, 0xB698, 0x8CDC, 0xB699, 0x8CDD, 0xB69A, 0x8CDE, 0xB69B, + 0x8CDF, 0xB69E, 0x8CE0, 0xB69F, 0x8CE1, 0xB6A1, 0x8CE2, 0xB6A2, 0x8CE3, 0xB6A3, 0x8CE4, 0xB6A5, 0x8CE5, 0xB6A6, 0x8CE6, 0xB6A7, + 0x8CE7, 0xB6A8, 0x8CE8, 0xB6A9, 0x8CE9, 0xB6AA, 0x8CEA, 0xB6AD, 0x8CEB, 0xB6AE, 0x8CEC, 0xB6AF, 0x8CED, 0xB6B0, 0x8CEE, 0xB6B2, + 0x8CEF, 0xB6B3, 0x8CF0, 0xB6B4, 0x8CF1, 0xB6B5, 0x8CF2, 0xB6B6, 0x8CF3, 0xB6B7, 0x8CF4, 0xB6B8, 0x8CF5, 0xB6B9, 0x8CF6, 0xB6BA, + 0x8CF7, 0xB6BB, 0x8CF8, 0xB6BC, 0x8CF9, 0xB6BD, 0x8CFA, 0xB6BE, 0x8CFB, 0xB6BF, 0x8CFC, 0xB6C0, 0x8CFD, 0xB6C1, 0x8CFE, 0xB6C2, + 0x8D41, 0xB6C3, 0x8D42, 0xB6C4, 0x8D43, 0xB6C5, 0x8D44, 0xB6C6, 0x8D45, 0xB6C7, 0x8D46, 0xB6C8, 0x8D47, 0xB6C9, 0x8D48, 0xB6CA, + 0x8D49, 0xB6CB, 0x8D4A, 0xB6CC, 0x8D4B, 0xB6CD, 0x8D4C, 0xB6CE, 0x8D4D, 0xB6CF, 0x8D4E, 0xB6D0, 0x8D4F, 0xB6D1, 0x8D50, 0xB6D2, + 0x8D51, 0xB6D3, 0x8D52, 0xB6D5, 0x8D53, 0xB6D6, 0x8D54, 0xB6D7, 0x8D55, 0xB6D8, 0x8D56, 0xB6D9, 0x8D57, 0xB6DA, 0x8D58, 0xB6DB, + 0x8D59, 0xB6DC, 0x8D5A, 0xB6DD, 0x8D61, 0xB6DE, 0x8D62, 0xB6DF, 0x8D63, 0xB6E0, 0x8D64, 0xB6E1, 0x8D65, 0xB6E2, 0x8D66, 0xB6E3, + 0x8D67, 0xB6E4, 0x8D68, 0xB6E5, 0x8D69, 0xB6E6, 0x8D6A, 0xB6E7, 0x8D6B, 0xB6E8, 0x8D6C, 0xB6E9, 0x8D6D, 0xB6EA, 0x8D6E, 0xB6EB, + 0x8D6F, 0xB6EC, 0x8D70, 0xB6ED, 0x8D71, 0xB6EE, 0x8D72, 0xB6EF, 0x8D73, 0xB6F1, 0x8D74, 0xB6F2, 0x8D75, 0xB6F3, 0x8D76, 0xB6F5, + 0x8D77, 0xB6F6, 0x8D78, 0xB6F7, 0x8D79, 0xB6F9, 0x8D7A, 0xB6FA, 0x8D81, 0xB6FB, 0x8D82, 0xB6FC, 0x8D83, 0xB6FD, 0x8D84, 0xB6FE, + 0x8D85, 0xB6FF, 0x8D86, 0xB702, 0x8D87, 0xB703, 0x8D88, 0xB704, 0x8D89, 0xB706, 0x8D8A, 0xB707, 0x8D8B, 0xB708, 0x8D8C, 0xB709, + 0x8D8D, 0xB70A, 0x8D8E, 0xB70B, 0x8D8F, 0xB70C, 0x8D90, 0xB70D, 0x8D91, 0xB70E, 0x8D92, 0xB70F, 0x8D93, 0xB710, 0x8D94, 0xB711, + 0x8D95, 0xB712, 0x8D96, 0xB713, 0x8D97, 0xB714, 0x8D98, 0xB715, 0x8D99, 0xB716, 0x8D9A, 0xB717, 0x8D9B, 0xB718, 0x8D9C, 0xB719, + 0x8D9D, 0xB71A, 0x8D9E, 0xB71B, 0x8D9F, 0xB71C, 0x8DA0, 0xB71D, 0x8DA1, 0xB71E, 0x8DA2, 0xB71F, 0x8DA3, 0xB720, 0x8DA4, 0xB721, + 0x8DA5, 0xB722, 0x8DA6, 0xB723, 0x8DA7, 0xB724, 0x8DA8, 0xB725, 0x8DA9, 0xB726, 0x8DAA, 0xB727, 0x8DAB, 0xB72A, 0x8DAC, 0xB72B, + 0x8DAD, 0xB72D, 0x8DAE, 0xB72E, 0x8DAF, 0xB731, 0x8DB0, 0xB732, 0x8DB1, 0xB733, 0x8DB2, 0xB734, 0x8DB3, 0xB735, 0x8DB4, 0xB736, + 0x8DB5, 0xB737, 0x8DB6, 0xB73A, 0x8DB7, 0xB73C, 0x8DB8, 0xB73D, 0x8DB9, 0xB73E, 0x8DBA, 0xB73F, 0x8DBB, 0xB740, 0x8DBC, 0xB741, + 0x8DBD, 0xB742, 0x8DBE, 0xB743, 0x8DBF, 0xB745, 0x8DC0, 0xB746, 0x8DC1, 0xB747, 0x8DC2, 0xB749, 0x8DC3, 0xB74A, 0x8DC4, 0xB74B, + 0x8DC5, 0xB74D, 0x8DC6, 0xB74E, 0x8DC7, 0xB74F, 0x8DC8, 0xB750, 0x8DC9, 0xB751, 0x8DCA, 0xB752, 0x8DCB, 0xB753, 0x8DCC, 0xB756, + 0x8DCD, 0xB757, 0x8DCE, 0xB758, 0x8DCF, 0xB759, 0x8DD0, 0xB75A, 0x8DD1, 0xB75B, 0x8DD2, 0xB75C, 0x8DD3, 0xB75D, 0x8DD4, 0xB75E, + 0x8DD5, 0xB75F, 0x8DD6, 0xB761, 0x8DD7, 0xB762, 0x8DD8, 0xB763, 0x8DD9, 0xB765, 0x8DDA, 0xB766, 0x8DDB, 0xB767, 0x8DDC, 0xB769, + 0x8DDD, 0xB76A, 0x8DDE, 0xB76B, 0x8DDF, 0xB76C, 0x8DE0, 0xB76D, 0x8DE1, 0xB76E, 0x8DE2, 0xB76F, 0x8DE3, 0xB772, 0x8DE4, 0xB774, + 0x8DE5, 0xB776, 0x8DE6, 0xB777, 0x8DE7, 0xB778, 0x8DE8, 0xB779, 0x8DE9, 0xB77A, 0x8DEA, 0xB77B, 0x8DEB, 0xB77E, 0x8DEC, 0xB77F, + 0x8DED, 0xB781, 0x8DEE, 0xB782, 0x8DEF, 0xB783, 0x8DF0, 0xB785, 0x8DF1, 0xB786, 0x8DF2, 0xB787, 0x8DF3, 0xB788, 0x8DF4, 0xB789, + 0x8DF5, 0xB78A, 0x8DF6, 0xB78B, 0x8DF7, 0xB78E, 0x8DF8, 0xB793, 0x8DF9, 0xB794, 0x8DFA, 0xB795, 0x8DFB, 0xB79A, 0x8DFC, 0xB79B, + 0x8DFD, 0xB79D, 0x8DFE, 0xB79E, 0x8E41, 0xB79F, 0x8E42, 0xB7A1, 0x8E43, 0xB7A2, 0x8E44, 0xB7A3, 0x8E45, 0xB7A4, 0x8E46, 0xB7A5, + 0x8E47, 0xB7A6, 0x8E48, 0xB7A7, 0x8E49, 0xB7AA, 0x8E4A, 0xB7AE, 0x8E4B, 0xB7AF, 0x8E4C, 0xB7B0, 0x8E4D, 0xB7B1, 0x8E4E, 0xB7B2, + 0x8E4F, 0xB7B3, 0x8E50, 0xB7B6, 0x8E51, 0xB7B7, 0x8E52, 0xB7B9, 0x8E53, 0xB7BA, 0x8E54, 0xB7BB, 0x8E55, 0xB7BC, 0x8E56, 0xB7BD, + 0x8E57, 0xB7BE, 0x8E58, 0xB7BF, 0x8E59, 0xB7C0, 0x8E5A, 0xB7C1, 0x8E61, 0xB7C2, 0x8E62, 0xB7C3, 0x8E63, 0xB7C4, 0x8E64, 0xB7C5, + 0x8E65, 0xB7C6, 0x8E66, 0xB7C8, 0x8E67, 0xB7CA, 0x8E68, 0xB7CB, 0x8E69, 0xB7CC, 0x8E6A, 0xB7CD, 0x8E6B, 0xB7CE, 0x8E6C, 0xB7CF, + 0x8E6D, 0xB7D0, 0x8E6E, 0xB7D1, 0x8E6F, 0xB7D2, 0x8E70, 0xB7D3, 0x8E71, 0xB7D4, 0x8E72, 0xB7D5, 0x8E73, 0xB7D6, 0x8E74, 0xB7D7, + 0x8E75, 0xB7D8, 0x8E76, 0xB7D9, 0x8E77, 0xB7DA, 0x8E78, 0xB7DB, 0x8E79, 0xB7DC, 0x8E7A, 0xB7DD, 0x8E81, 0xB7DE, 0x8E82, 0xB7DF, + 0x8E83, 0xB7E0, 0x8E84, 0xB7E1, 0x8E85, 0xB7E2, 0x8E86, 0xB7E3, 0x8E87, 0xB7E4, 0x8E88, 0xB7E5, 0x8E89, 0xB7E6, 0x8E8A, 0xB7E7, + 0x8E8B, 0xB7E8, 0x8E8C, 0xB7E9, 0x8E8D, 0xB7EA, 0x8E8E, 0xB7EB, 0x8E8F, 0xB7EE, 0x8E90, 0xB7EF, 0x8E91, 0xB7F1, 0x8E92, 0xB7F2, + 0x8E93, 0xB7F3, 0x8E94, 0xB7F5, 0x8E95, 0xB7F6, 0x8E96, 0xB7F7, 0x8E97, 0xB7F8, 0x8E98, 0xB7F9, 0x8E99, 0xB7FA, 0x8E9A, 0xB7FB, + 0x8E9B, 0xB7FE, 0x8E9C, 0xB802, 0x8E9D, 0xB803, 0x8E9E, 0xB804, 0x8E9F, 0xB805, 0x8EA0, 0xB806, 0x8EA1, 0xB80A, 0x8EA2, 0xB80B, + 0x8EA3, 0xB80D, 0x8EA4, 0xB80E, 0x8EA5, 0xB80F, 0x8EA6, 0xB811, 0x8EA7, 0xB812, 0x8EA8, 0xB813, 0x8EA9, 0xB814, 0x8EAA, 0xB815, + 0x8EAB, 0xB816, 0x8EAC, 0xB817, 0x8EAD, 0xB81A, 0x8EAE, 0xB81C, 0x8EAF, 0xB81E, 0x8EB0, 0xB81F, 0x8EB1, 0xB820, 0x8EB2, 0xB821, + 0x8EB3, 0xB822, 0x8EB4, 0xB823, 0x8EB5, 0xB826, 0x8EB6, 0xB827, 0x8EB7, 0xB829, 0x8EB8, 0xB82A, 0x8EB9, 0xB82B, 0x8EBA, 0xB82D, + 0x8EBB, 0xB82E, 0x8EBC, 0xB82F, 0x8EBD, 0xB830, 0x8EBE, 0xB831, 0x8EBF, 0xB832, 0x8EC0, 0xB833, 0x8EC1, 0xB836, 0x8EC2, 0xB83A, + 0x8EC3, 0xB83B, 0x8EC4, 0xB83C, 0x8EC5, 0xB83D, 0x8EC6, 0xB83E, 0x8EC7, 0xB83F, 0x8EC8, 0xB841, 0x8EC9, 0xB842, 0x8ECA, 0xB843, + 0x8ECB, 0xB845, 0x8ECC, 0xB846, 0x8ECD, 0xB847, 0x8ECE, 0xB848, 0x8ECF, 0xB849, 0x8ED0, 0xB84A, 0x8ED1, 0xB84B, 0x8ED2, 0xB84C, + 0x8ED3, 0xB84D, 0x8ED4, 0xB84E, 0x8ED5, 0xB84F, 0x8ED6, 0xB850, 0x8ED7, 0xB852, 0x8ED8, 0xB854, 0x8ED9, 0xB855, 0x8EDA, 0xB856, + 0x8EDB, 0xB857, 0x8EDC, 0xB858, 0x8EDD, 0xB859, 0x8EDE, 0xB85A, 0x8EDF, 0xB85B, 0x8EE0, 0xB85E, 0x8EE1, 0xB85F, 0x8EE2, 0xB861, + 0x8EE3, 0xB862, 0x8EE4, 0xB863, 0x8EE5, 0xB865, 0x8EE6, 0xB866, 0x8EE7, 0xB867, 0x8EE8, 0xB868, 0x8EE9, 0xB869, 0x8EEA, 0xB86A, + 0x8EEB, 0xB86B, 0x8EEC, 0xB86E, 0x8EED, 0xB870, 0x8EEE, 0xB872, 0x8EEF, 0xB873, 0x8EF0, 0xB874, 0x8EF1, 0xB875, 0x8EF2, 0xB876, + 0x8EF3, 0xB877, 0x8EF4, 0xB879, 0x8EF5, 0xB87A, 0x8EF6, 0xB87B, 0x8EF7, 0xB87D, 0x8EF8, 0xB87E, 0x8EF9, 0xB87F, 0x8EFA, 0xB880, + 0x8EFB, 0xB881, 0x8EFC, 0xB882, 0x8EFD, 0xB883, 0x8EFE, 0xB884, 0x8F41, 0xB885, 0x8F42, 0xB886, 0x8F43, 0xB887, 0x8F44, 0xB888, + 0x8F45, 0xB889, 0x8F46, 0xB88A, 0x8F47, 0xB88B, 0x8F48, 0xB88C, 0x8F49, 0xB88E, 0x8F4A, 0xB88F, 0x8F4B, 0xB890, 0x8F4C, 0xB891, + 0x8F4D, 0xB892, 0x8F4E, 0xB893, 0x8F4F, 0xB894, 0x8F50, 0xB895, 0x8F51, 0xB896, 0x8F52, 0xB897, 0x8F53, 0xB898, 0x8F54, 0xB899, + 0x8F55, 0xB89A, 0x8F56, 0xB89B, 0x8F57, 0xB89C, 0x8F58, 0xB89D, 0x8F59, 0xB89E, 0x8F5A, 0xB89F, 0x8F61, 0xB8A0, 0x8F62, 0xB8A1, + 0x8F63, 0xB8A2, 0x8F64, 0xB8A3, 0x8F65, 0xB8A4, 0x8F66, 0xB8A5, 0x8F67, 0xB8A6, 0x8F68, 0xB8A7, 0x8F69, 0xB8A9, 0x8F6A, 0xB8AA, + 0x8F6B, 0xB8AB, 0x8F6C, 0xB8AC, 0x8F6D, 0xB8AD, 0x8F6E, 0xB8AE, 0x8F6F, 0xB8AF, 0x8F70, 0xB8B1, 0x8F71, 0xB8B2, 0x8F72, 0xB8B3, + 0x8F73, 0xB8B5, 0x8F74, 0xB8B6, 0x8F75, 0xB8B7, 0x8F76, 0xB8B9, 0x8F77, 0xB8BA, 0x8F78, 0xB8BB, 0x8F79, 0xB8BC, 0x8F7A, 0xB8BD, + 0x8F81, 0xB8BE, 0x8F82, 0xB8BF, 0x8F83, 0xB8C2, 0x8F84, 0xB8C4, 0x8F85, 0xB8C6, 0x8F86, 0xB8C7, 0x8F87, 0xB8C8, 0x8F88, 0xB8C9, + 0x8F89, 0xB8CA, 0x8F8A, 0xB8CB, 0x8F8B, 0xB8CD, 0x8F8C, 0xB8CE, 0x8F8D, 0xB8CF, 0x8F8E, 0xB8D1, 0x8F8F, 0xB8D2, 0x8F90, 0xB8D3, + 0x8F91, 0xB8D5, 0x8F92, 0xB8D6, 0x8F93, 0xB8D7, 0x8F94, 0xB8D8, 0x8F95, 0xB8D9, 0x8F96, 0xB8DA, 0x8F97, 0xB8DB, 0x8F98, 0xB8DC, + 0x8F99, 0xB8DE, 0x8F9A, 0xB8E0, 0x8F9B, 0xB8E2, 0x8F9C, 0xB8E3, 0x8F9D, 0xB8E4, 0x8F9E, 0xB8E5, 0x8F9F, 0xB8E6, 0x8FA0, 0xB8E7, + 0x8FA1, 0xB8EA, 0x8FA2, 0xB8EB, 0x8FA3, 0xB8ED, 0x8FA4, 0xB8EE, 0x8FA5, 0xB8EF, 0x8FA6, 0xB8F1, 0x8FA7, 0xB8F2, 0x8FA8, 0xB8F3, + 0x8FA9, 0xB8F4, 0x8FAA, 0xB8F5, 0x8FAB, 0xB8F6, 0x8FAC, 0xB8F7, 0x8FAD, 0xB8FA, 0x8FAE, 0xB8FC, 0x8FAF, 0xB8FE, 0x8FB0, 0xB8FF, + 0x8FB1, 0xB900, 0x8FB2, 0xB901, 0x8FB3, 0xB902, 0x8FB4, 0xB903, 0x8FB5, 0xB905, 0x8FB6, 0xB906, 0x8FB7, 0xB907, 0x8FB8, 0xB908, + 0x8FB9, 0xB909, 0x8FBA, 0xB90A, 0x8FBB, 0xB90B, 0x8FBC, 0xB90C, 0x8FBD, 0xB90D, 0x8FBE, 0xB90E, 0x8FBF, 0xB90F, 0x8FC0, 0xB910, + 0x8FC1, 0xB911, 0x8FC2, 0xB912, 0x8FC3, 0xB913, 0x8FC4, 0xB914, 0x8FC5, 0xB915, 0x8FC6, 0xB916, 0x8FC7, 0xB917, 0x8FC8, 0xB919, + 0x8FC9, 0xB91A, 0x8FCA, 0xB91B, 0x8FCB, 0xB91C, 0x8FCC, 0xB91D, 0x8FCD, 0xB91E, 0x8FCE, 0xB91F, 0x8FCF, 0xB921, 0x8FD0, 0xB922, + 0x8FD1, 0xB923, 0x8FD2, 0xB924, 0x8FD3, 0xB925, 0x8FD4, 0xB926, 0x8FD5, 0xB927, 0x8FD6, 0xB928, 0x8FD7, 0xB929, 0x8FD8, 0xB92A, + 0x8FD9, 0xB92B, 0x8FDA, 0xB92C, 0x8FDB, 0xB92D, 0x8FDC, 0xB92E, 0x8FDD, 0xB92F, 0x8FDE, 0xB930, 0x8FDF, 0xB931, 0x8FE0, 0xB932, + 0x8FE1, 0xB933, 0x8FE2, 0xB934, 0x8FE3, 0xB935, 0x8FE4, 0xB936, 0x8FE5, 0xB937, 0x8FE6, 0xB938, 0x8FE7, 0xB939, 0x8FE8, 0xB93A, + 0x8FE9, 0xB93B, 0x8FEA, 0xB93E, 0x8FEB, 0xB93F, 0x8FEC, 0xB941, 0x8FED, 0xB942, 0x8FEE, 0xB943, 0x8FEF, 0xB945, 0x8FF0, 0xB946, + 0x8FF1, 0xB947, 0x8FF2, 0xB948, 0x8FF3, 0xB949, 0x8FF4, 0xB94A, 0x8FF5, 0xB94B, 0x8FF6, 0xB94D, 0x8FF7, 0xB94E, 0x8FF8, 0xB950, + 0x8FF9, 0xB952, 0x8FFA, 0xB953, 0x8FFB, 0xB954, 0x8FFC, 0xB955, 0x8FFD, 0xB956, 0x8FFE, 0xB957, 0x9041, 0xB95A, 0x9042, 0xB95B, + 0x9043, 0xB95D, 0x9044, 0xB95E, 0x9045, 0xB95F, 0x9046, 0xB961, 0x9047, 0xB962, 0x9048, 0xB963, 0x9049, 0xB964, 0x904A, 0xB965, + 0x904B, 0xB966, 0x904C, 0xB967, 0x904D, 0xB96A, 0x904E, 0xB96C, 0x904F, 0xB96E, 0x9050, 0xB96F, 0x9051, 0xB970, 0x9052, 0xB971, + 0x9053, 0xB972, 0x9054, 0xB973, 0x9055, 0xB976, 0x9056, 0xB977, 0x9057, 0xB979, 0x9058, 0xB97A, 0x9059, 0xB97B, 0x905A, 0xB97D, + 0x9061, 0xB97E, 0x9062, 0xB97F, 0x9063, 0xB980, 0x9064, 0xB981, 0x9065, 0xB982, 0x9066, 0xB983, 0x9067, 0xB986, 0x9068, 0xB988, + 0x9069, 0xB98B, 0x906A, 0xB98C, 0x906B, 0xB98F, 0x906C, 0xB990, 0x906D, 0xB991, 0x906E, 0xB992, 0x906F, 0xB993, 0x9070, 0xB994, + 0x9071, 0xB995, 0x9072, 0xB996, 0x9073, 0xB997, 0x9074, 0xB998, 0x9075, 0xB999, 0x9076, 0xB99A, 0x9077, 0xB99B, 0x9078, 0xB99C, + 0x9079, 0xB99D, 0x907A, 0xB99E, 0x9081, 0xB99F, 0x9082, 0xB9A0, 0x9083, 0xB9A1, 0x9084, 0xB9A2, 0x9085, 0xB9A3, 0x9086, 0xB9A4, + 0x9087, 0xB9A5, 0x9088, 0xB9A6, 0x9089, 0xB9A7, 0x908A, 0xB9A8, 0x908B, 0xB9A9, 0x908C, 0xB9AA, 0x908D, 0xB9AB, 0x908E, 0xB9AE, + 0x908F, 0xB9AF, 0x9090, 0xB9B1, 0x9091, 0xB9B2, 0x9092, 0xB9B3, 0x9093, 0xB9B5, 0x9094, 0xB9B6, 0x9095, 0xB9B7, 0x9096, 0xB9B8, + 0x9097, 0xB9B9, 0x9098, 0xB9BA, 0x9099, 0xB9BB, 0x909A, 0xB9BE, 0x909B, 0xB9C0, 0x909C, 0xB9C2, 0x909D, 0xB9C3, 0x909E, 0xB9C4, + 0x909F, 0xB9C5, 0x90A0, 0xB9C6, 0x90A1, 0xB9C7, 0x90A2, 0xB9CA, 0x90A3, 0xB9CB, 0x90A4, 0xB9CD, 0x90A5, 0xB9D3, 0x90A6, 0xB9D4, + 0x90A7, 0xB9D5, 0x90A8, 0xB9D6, 0x90A9, 0xB9D7, 0x90AA, 0xB9DA, 0x90AB, 0xB9DC, 0x90AC, 0xB9DF, 0x90AD, 0xB9E0, 0x90AE, 0xB9E2, + 0x90AF, 0xB9E6, 0x90B0, 0xB9E7, 0x90B1, 0xB9E9, 0x90B2, 0xB9EA, 0x90B3, 0xB9EB, 0x90B4, 0xB9ED, 0x90B5, 0xB9EE, 0x90B6, 0xB9EF, + 0x90B7, 0xB9F0, 0x90B8, 0xB9F1, 0x90B9, 0xB9F2, 0x90BA, 0xB9F3, 0x90BB, 0xB9F6, 0x90BC, 0xB9FB, 0x90BD, 0xB9FC, 0x90BE, 0xB9FD, + 0x90BF, 0xB9FE, 0x90C0, 0xB9FF, 0x90C1, 0xBA02, 0x90C2, 0xBA03, 0x90C3, 0xBA04, 0x90C4, 0xBA05, 0x90C5, 0xBA06, 0x90C6, 0xBA07, + 0x90C7, 0xBA09, 0x90C8, 0xBA0A, 0x90C9, 0xBA0B, 0x90CA, 0xBA0C, 0x90CB, 0xBA0D, 0x90CC, 0xBA0E, 0x90CD, 0xBA0F, 0x90CE, 0xBA10, + 0x90CF, 0xBA11, 0x90D0, 0xBA12, 0x90D1, 0xBA13, 0x90D2, 0xBA14, 0x90D3, 0xBA16, 0x90D4, 0xBA17, 0x90D5, 0xBA18, 0x90D6, 0xBA19, + 0x90D7, 0xBA1A, 0x90D8, 0xBA1B, 0x90D9, 0xBA1C, 0x90DA, 0xBA1D, 0x90DB, 0xBA1E, 0x90DC, 0xBA1F, 0x90DD, 0xBA20, 0x90DE, 0xBA21, + 0x90DF, 0xBA22, 0x90E0, 0xBA23, 0x90E1, 0xBA24, 0x90E2, 0xBA25, 0x90E3, 0xBA26, 0x90E4, 0xBA27, 0x90E5, 0xBA28, 0x90E6, 0xBA29, + 0x90E7, 0xBA2A, 0x90E8, 0xBA2B, 0x90E9, 0xBA2C, 0x90EA, 0xBA2D, 0x90EB, 0xBA2E, 0x90EC, 0xBA2F, 0x90ED, 0xBA30, 0x90EE, 0xBA31, + 0x90EF, 0xBA32, 0x90F0, 0xBA33, 0x90F1, 0xBA34, 0x90F2, 0xBA35, 0x90F3, 0xBA36, 0x90F4, 0xBA37, 0x90F5, 0xBA3A, 0x90F6, 0xBA3B, + 0x90F7, 0xBA3D, 0x90F8, 0xBA3E, 0x90F9, 0xBA3F, 0x90FA, 0xBA41, 0x90FB, 0xBA43, 0x90FC, 0xBA44, 0x90FD, 0xBA45, 0x90FE, 0xBA46, + 0x9141, 0xBA47, 0x9142, 0xBA4A, 0x9143, 0xBA4C, 0x9144, 0xBA4F, 0x9145, 0xBA50, 0x9146, 0xBA51, 0x9147, 0xBA52, 0x9148, 0xBA56, + 0x9149, 0xBA57, 0x914A, 0xBA59, 0x914B, 0xBA5A, 0x914C, 0xBA5B, 0x914D, 0xBA5D, 0x914E, 0xBA5E, 0x914F, 0xBA5F, 0x9150, 0xBA60, + 0x9151, 0xBA61, 0x9152, 0xBA62, 0x9153, 0xBA63, 0x9154, 0xBA66, 0x9155, 0xBA6A, 0x9156, 0xBA6B, 0x9157, 0xBA6C, 0x9158, 0xBA6D, + 0x9159, 0xBA6E, 0x915A, 0xBA6F, 0x9161, 0xBA72, 0x9162, 0xBA73, 0x9163, 0xBA75, 0x9164, 0xBA76, 0x9165, 0xBA77, 0x9166, 0xBA79, + 0x9167, 0xBA7A, 0x9168, 0xBA7B, 0x9169, 0xBA7C, 0x916A, 0xBA7D, 0x916B, 0xBA7E, 0x916C, 0xBA7F, 0x916D, 0xBA80, 0x916E, 0xBA81, + 0x916F, 0xBA82, 0x9170, 0xBA86, 0x9171, 0xBA88, 0x9172, 0xBA89, 0x9173, 0xBA8A, 0x9174, 0xBA8B, 0x9175, 0xBA8D, 0x9176, 0xBA8E, + 0x9177, 0xBA8F, 0x9178, 0xBA90, 0x9179, 0xBA91, 0x917A, 0xBA92, 0x9181, 0xBA93, 0x9182, 0xBA94, 0x9183, 0xBA95, 0x9184, 0xBA96, + 0x9185, 0xBA97, 0x9186, 0xBA98, 0x9187, 0xBA99, 0x9188, 0xBA9A, 0x9189, 0xBA9B, 0x918A, 0xBA9C, 0x918B, 0xBA9D, 0x918C, 0xBA9E, + 0x918D, 0xBA9F, 0x918E, 0xBAA0, 0x918F, 0xBAA1, 0x9190, 0xBAA2, 0x9191, 0xBAA3, 0x9192, 0xBAA4, 0x9193, 0xBAA5, 0x9194, 0xBAA6, + 0x9195, 0xBAA7, 0x9196, 0xBAAA, 0x9197, 0xBAAD, 0x9198, 0xBAAE, 0x9199, 0xBAAF, 0x919A, 0xBAB1, 0x919B, 0xBAB3, 0x919C, 0xBAB4, + 0x919D, 0xBAB5, 0x919E, 0xBAB6, 0x919F, 0xBAB7, 0x91A0, 0xBABA, 0x91A1, 0xBABC, 0x91A2, 0xBABE, 0x91A3, 0xBABF, 0x91A4, 0xBAC0, + 0x91A5, 0xBAC1, 0x91A6, 0xBAC2, 0x91A7, 0xBAC3, 0x91A8, 0xBAC5, 0x91A9, 0xBAC6, 0x91AA, 0xBAC7, 0x91AB, 0xBAC9, 0x91AC, 0xBACA, + 0x91AD, 0xBACB, 0x91AE, 0xBACC, 0x91AF, 0xBACD, 0x91B0, 0xBACE, 0x91B1, 0xBACF, 0x91B2, 0xBAD0, 0x91B3, 0xBAD1, 0x91B4, 0xBAD2, + 0x91B5, 0xBAD3, 0x91B6, 0xBAD4, 0x91B7, 0xBAD5, 0x91B8, 0xBAD6, 0x91B9, 0xBAD7, 0x91BA, 0xBADA, 0x91BB, 0xBADB, 0x91BC, 0xBADC, + 0x91BD, 0xBADD, 0x91BE, 0xBADE, 0x91BF, 0xBADF, 0x91C0, 0xBAE0, 0x91C1, 0xBAE1, 0x91C2, 0xBAE2, 0x91C3, 0xBAE3, 0x91C4, 0xBAE4, + 0x91C5, 0xBAE5, 0x91C6, 0xBAE6, 0x91C7, 0xBAE7, 0x91C8, 0xBAE8, 0x91C9, 0xBAE9, 0x91CA, 0xBAEA, 0x91CB, 0xBAEB, 0x91CC, 0xBAEC, + 0x91CD, 0xBAED, 0x91CE, 0xBAEE, 0x91CF, 0xBAEF, 0x91D0, 0xBAF0, 0x91D1, 0xBAF1, 0x91D2, 0xBAF2, 0x91D3, 0xBAF3, 0x91D4, 0xBAF4, + 0x91D5, 0xBAF5, 0x91D6, 0xBAF6, 0x91D7, 0xBAF7, 0x91D8, 0xBAF8, 0x91D9, 0xBAF9, 0x91DA, 0xBAFA, 0x91DB, 0xBAFB, 0x91DC, 0xBAFD, + 0x91DD, 0xBAFE, 0x91DE, 0xBAFF, 0x91DF, 0xBB01, 0x91E0, 0xBB02, 0x91E1, 0xBB03, 0x91E2, 0xBB05, 0x91E3, 0xBB06, 0x91E4, 0xBB07, + 0x91E5, 0xBB08, 0x91E6, 0xBB09, 0x91E7, 0xBB0A, 0x91E8, 0xBB0B, 0x91E9, 0xBB0C, 0x91EA, 0xBB0E, 0x91EB, 0xBB10, 0x91EC, 0xBB12, + 0x91ED, 0xBB13, 0x91EE, 0xBB14, 0x91EF, 0xBB15, 0x91F0, 0xBB16, 0x91F1, 0xBB17, 0x91F2, 0xBB19, 0x91F3, 0xBB1A, 0x91F4, 0xBB1B, + 0x91F5, 0xBB1D, 0x91F6, 0xBB1E, 0x91F7, 0xBB1F, 0x91F8, 0xBB21, 0x91F9, 0xBB22, 0x91FA, 0xBB23, 0x91FB, 0xBB24, 0x91FC, 0xBB25, + 0x91FD, 0xBB26, 0x91FE, 0xBB27, 0x9241, 0xBB28, 0x9242, 0xBB2A, 0x9243, 0xBB2C, 0x9244, 0xBB2D, 0x9245, 0xBB2E, 0x9246, 0xBB2F, + 0x9247, 0xBB30, 0x9248, 0xBB31, 0x9249, 0xBB32, 0x924A, 0xBB33, 0x924B, 0xBB37, 0x924C, 0xBB39, 0x924D, 0xBB3A, 0x924E, 0xBB3F, + 0x924F, 0xBB40, 0x9250, 0xBB41, 0x9251, 0xBB42, 0x9252, 0xBB43, 0x9253, 0xBB46, 0x9254, 0xBB48, 0x9255, 0xBB4A, 0x9256, 0xBB4B, + 0x9257, 0xBB4C, 0x9258, 0xBB4E, 0x9259, 0xBB51, 0x925A, 0xBB52, 0x9261, 0xBB53, 0x9262, 0xBB55, 0x9263, 0xBB56, 0x9264, 0xBB57, + 0x9265, 0xBB59, 0x9266, 0xBB5A, 0x9267, 0xBB5B, 0x9268, 0xBB5C, 0x9269, 0xBB5D, 0x926A, 0xBB5E, 0x926B, 0xBB5F, 0x926C, 0xBB60, + 0x926D, 0xBB62, 0x926E, 0xBB64, 0x926F, 0xBB65, 0x9270, 0xBB66, 0x9271, 0xBB67, 0x9272, 0xBB68, 0x9273, 0xBB69, 0x9274, 0xBB6A, + 0x9275, 0xBB6B, 0x9276, 0xBB6D, 0x9277, 0xBB6E, 0x9278, 0xBB6F, 0x9279, 0xBB70, 0x927A, 0xBB71, 0x9281, 0xBB72, 0x9282, 0xBB73, + 0x9283, 0xBB74, 0x9284, 0xBB75, 0x9285, 0xBB76, 0x9286, 0xBB77, 0x9287, 0xBB78, 0x9288, 0xBB79, 0x9289, 0xBB7A, 0x928A, 0xBB7B, + 0x928B, 0xBB7C, 0x928C, 0xBB7D, 0x928D, 0xBB7E, 0x928E, 0xBB7F, 0x928F, 0xBB80, 0x9290, 0xBB81, 0x9291, 0xBB82, 0x9292, 0xBB83, + 0x9293, 0xBB84, 0x9294, 0xBB85, 0x9295, 0xBB86, 0x9296, 0xBB87, 0x9297, 0xBB89, 0x9298, 0xBB8A, 0x9299, 0xBB8B, 0x929A, 0xBB8D, + 0x929B, 0xBB8E, 0x929C, 0xBB8F, 0x929D, 0xBB91, 0x929E, 0xBB92, 0x929F, 0xBB93, 0x92A0, 0xBB94, 0x92A1, 0xBB95, 0x92A2, 0xBB96, + 0x92A3, 0xBB97, 0x92A4, 0xBB98, 0x92A5, 0xBB99, 0x92A6, 0xBB9A, 0x92A7, 0xBB9B, 0x92A8, 0xBB9C, 0x92A9, 0xBB9D, 0x92AA, 0xBB9E, + 0x92AB, 0xBB9F, 0x92AC, 0xBBA0, 0x92AD, 0xBBA1, 0x92AE, 0xBBA2, 0x92AF, 0xBBA3, 0x92B0, 0xBBA5, 0x92B1, 0xBBA6, 0x92B2, 0xBBA7, + 0x92B3, 0xBBA9, 0x92B4, 0xBBAA, 0x92B5, 0xBBAB, 0x92B6, 0xBBAD, 0x92B7, 0xBBAE, 0x92B8, 0xBBAF, 0x92B9, 0xBBB0, 0x92BA, 0xBBB1, + 0x92BB, 0xBBB2, 0x92BC, 0xBBB3, 0x92BD, 0xBBB5, 0x92BE, 0xBBB6, 0x92BF, 0xBBB8, 0x92C0, 0xBBB9, 0x92C1, 0xBBBA, 0x92C2, 0xBBBB, + 0x92C3, 0xBBBC, 0x92C4, 0xBBBD, 0x92C5, 0xBBBE, 0x92C6, 0xBBBF, 0x92C7, 0xBBC1, 0x92C8, 0xBBC2, 0x92C9, 0xBBC3, 0x92CA, 0xBBC5, + 0x92CB, 0xBBC6, 0x92CC, 0xBBC7, 0x92CD, 0xBBC9, 0x92CE, 0xBBCA, 0x92CF, 0xBBCB, 0x92D0, 0xBBCC, 0x92D1, 0xBBCD, 0x92D2, 0xBBCE, + 0x92D3, 0xBBCF, 0x92D4, 0xBBD1, 0x92D5, 0xBBD2, 0x92D6, 0xBBD4, 0x92D7, 0xBBD5, 0x92D8, 0xBBD6, 0x92D9, 0xBBD7, 0x92DA, 0xBBD8, + 0x92DB, 0xBBD9, 0x92DC, 0xBBDA, 0x92DD, 0xBBDB, 0x92DE, 0xBBDC, 0x92DF, 0xBBDD, 0x92E0, 0xBBDE, 0x92E1, 0xBBDF, 0x92E2, 0xBBE0, + 0x92E3, 0xBBE1, 0x92E4, 0xBBE2, 0x92E5, 0xBBE3, 0x92E6, 0xBBE4, 0x92E7, 0xBBE5, 0x92E8, 0xBBE6, 0x92E9, 0xBBE7, 0x92EA, 0xBBE8, + 0x92EB, 0xBBE9, 0x92EC, 0xBBEA, 0x92ED, 0xBBEB, 0x92EE, 0xBBEC, 0x92EF, 0xBBED, 0x92F0, 0xBBEE, 0x92F1, 0xBBEF, 0x92F2, 0xBBF0, + 0x92F3, 0xBBF1, 0x92F4, 0xBBF2, 0x92F5, 0xBBF3, 0x92F6, 0xBBF4, 0x92F7, 0xBBF5, 0x92F8, 0xBBF6, 0x92F9, 0xBBF7, 0x92FA, 0xBBFA, + 0x92FB, 0xBBFB, 0x92FC, 0xBBFD, 0x92FD, 0xBBFE, 0x92FE, 0xBC01, 0x9341, 0xBC03, 0x9342, 0xBC04, 0x9343, 0xBC05, 0x9344, 0xBC06, + 0x9345, 0xBC07, 0x9346, 0xBC0A, 0x9347, 0xBC0E, 0x9348, 0xBC10, 0x9349, 0xBC12, 0x934A, 0xBC13, 0x934B, 0xBC19, 0x934C, 0xBC1A, + 0x934D, 0xBC20, 0x934E, 0xBC21, 0x934F, 0xBC22, 0x9350, 0xBC23, 0x9351, 0xBC26, 0x9352, 0xBC28, 0x9353, 0xBC2A, 0x9354, 0xBC2B, + 0x9355, 0xBC2C, 0x9356, 0xBC2E, 0x9357, 0xBC2F, 0x9358, 0xBC32, 0x9359, 0xBC33, 0x935A, 0xBC35, 0x9361, 0xBC36, 0x9362, 0xBC37, + 0x9363, 0xBC39, 0x9364, 0xBC3A, 0x9365, 0xBC3B, 0x9366, 0xBC3C, 0x9367, 0xBC3D, 0x9368, 0xBC3E, 0x9369, 0xBC3F, 0x936A, 0xBC42, + 0x936B, 0xBC46, 0x936C, 0xBC47, 0x936D, 0xBC48, 0x936E, 0xBC4A, 0x936F, 0xBC4B, 0x9370, 0xBC4E, 0x9371, 0xBC4F, 0x9372, 0xBC51, + 0x9373, 0xBC52, 0x9374, 0xBC53, 0x9375, 0xBC54, 0x9376, 0xBC55, 0x9377, 0xBC56, 0x9378, 0xBC57, 0x9379, 0xBC58, 0x937A, 0xBC59, + 0x9381, 0xBC5A, 0x9382, 0xBC5B, 0x9383, 0xBC5C, 0x9384, 0xBC5E, 0x9385, 0xBC5F, 0x9386, 0xBC60, 0x9387, 0xBC61, 0x9388, 0xBC62, + 0x9389, 0xBC63, 0x938A, 0xBC64, 0x938B, 0xBC65, 0x938C, 0xBC66, 0x938D, 0xBC67, 0x938E, 0xBC68, 0x938F, 0xBC69, 0x9390, 0xBC6A, + 0x9391, 0xBC6B, 0x9392, 0xBC6C, 0x9393, 0xBC6D, 0x9394, 0xBC6E, 0x9395, 0xBC6F, 0x9396, 0xBC70, 0x9397, 0xBC71, 0x9398, 0xBC72, + 0x9399, 0xBC73, 0x939A, 0xBC74, 0x939B, 0xBC75, 0x939C, 0xBC76, 0x939D, 0xBC77, 0x939E, 0xBC78, 0x939F, 0xBC79, 0x93A0, 0xBC7A, + 0x93A1, 0xBC7B, 0x93A2, 0xBC7C, 0x93A3, 0xBC7D, 0x93A4, 0xBC7E, 0x93A5, 0xBC7F, 0x93A6, 0xBC80, 0x93A7, 0xBC81, 0x93A8, 0xBC82, + 0x93A9, 0xBC83, 0x93AA, 0xBC86, 0x93AB, 0xBC87, 0x93AC, 0xBC89, 0x93AD, 0xBC8A, 0x93AE, 0xBC8D, 0x93AF, 0xBC8F, 0x93B0, 0xBC90, + 0x93B1, 0xBC91, 0x93B2, 0xBC92, 0x93B3, 0xBC93, 0x93B4, 0xBC96, 0x93B5, 0xBC98, 0x93B6, 0xBC9B, 0x93B7, 0xBC9C, 0x93B8, 0xBC9D, + 0x93B9, 0xBC9E, 0x93BA, 0xBC9F, 0x93BB, 0xBCA2, 0x93BC, 0xBCA3, 0x93BD, 0xBCA5, 0x93BE, 0xBCA6, 0x93BF, 0xBCA9, 0x93C0, 0xBCAA, + 0x93C1, 0xBCAB, 0x93C2, 0xBCAC, 0x93C3, 0xBCAD, 0x93C4, 0xBCAE, 0x93C5, 0xBCAF, 0x93C6, 0xBCB2, 0x93C7, 0xBCB6, 0x93C8, 0xBCB7, + 0x93C9, 0xBCB8, 0x93CA, 0xBCB9, 0x93CB, 0xBCBA, 0x93CC, 0xBCBB, 0x93CD, 0xBCBE, 0x93CE, 0xBCBF, 0x93CF, 0xBCC1, 0x93D0, 0xBCC2, + 0x93D1, 0xBCC3, 0x93D2, 0xBCC5, 0x93D3, 0xBCC6, 0x93D4, 0xBCC7, 0x93D5, 0xBCC8, 0x93D6, 0xBCC9, 0x93D7, 0xBCCA, 0x93D8, 0xBCCB, + 0x93D9, 0xBCCC, 0x93DA, 0xBCCE, 0x93DB, 0xBCD2, 0x93DC, 0xBCD3, 0x93DD, 0xBCD4, 0x93DE, 0xBCD6, 0x93DF, 0xBCD7, 0x93E0, 0xBCD9, + 0x93E1, 0xBCDA, 0x93E2, 0xBCDB, 0x93E3, 0xBCDD, 0x93E4, 0xBCDE, 0x93E5, 0xBCDF, 0x93E6, 0xBCE0, 0x93E7, 0xBCE1, 0x93E8, 0xBCE2, + 0x93E9, 0xBCE3, 0x93EA, 0xBCE4, 0x93EB, 0xBCE5, 0x93EC, 0xBCE6, 0x93ED, 0xBCE7, 0x93EE, 0xBCE8, 0x93EF, 0xBCE9, 0x93F0, 0xBCEA, + 0x93F1, 0xBCEB, 0x93F2, 0xBCEC, 0x93F3, 0xBCED, 0x93F4, 0xBCEE, 0x93F5, 0xBCEF, 0x93F6, 0xBCF0, 0x93F7, 0xBCF1, 0x93F8, 0xBCF2, + 0x93F9, 0xBCF3, 0x93FA, 0xBCF7, 0x93FB, 0xBCF9, 0x93FC, 0xBCFA, 0x93FD, 0xBCFB, 0x93FE, 0xBCFD, 0x9441, 0xBCFE, 0x9442, 0xBCFF, + 0x9443, 0xBD00, 0x9444, 0xBD01, 0x9445, 0xBD02, 0x9446, 0xBD03, 0x9447, 0xBD06, 0x9448, 0xBD08, 0x9449, 0xBD0A, 0x944A, 0xBD0B, + 0x944B, 0xBD0C, 0x944C, 0xBD0D, 0x944D, 0xBD0E, 0x944E, 0xBD0F, 0x944F, 0xBD11, 0x9450, 0xBD12, 0x9451, 0xBD13, 0x9452, 0xBD15, + 0x9453, 0xBD16, 0x9454, 0xBD17, 0x9455, 0xBD18, 0x9456, 0xBD19, 0x9457, 0xBD1A, 0x9458, 0xBD1B, 0x9459, 0xBD1C, 0x945A, 0xBD1D, + 0x9461, 0xBD1E, 0x9462, 0xBD1F, 0x9463, 0xBD20, 0x9464, 0xBD21, 0x9465, 0xBD22, 0x9466, 0xBD23, 0x9467, 0xBD25, 0x9468, 0xBD26, + 0x9469, 0xBD27, 0x946A, 0xBD28, 0x946B, 0xBD29, 0x946C, 0xBD2A, 0x946D, 0xBD2B, 0x946E, 0xBD2D, 0x946F, 0xBD2E, 0x9470, 0xBD2F, + 0x9471, 0xBD30, 0x9472, 0xBD31, 0x9473, 0xBD32, 0x9474, 0xBD33, 0x9475, 0xBD34, 0x9476, 0xBD35, 0x9477, 0xBD36, 0x9478, 0xBD37, + 0x9479, 0xBD38, 0x947A, 0xBD39, 0x9481, 0xBD3A, 0x9482, 0xBD3B, 0x9483, 0xBD3C, 0x9484, 0xBD3D, 0x9485, 0xBD3E, 0x9486, 0xBD3F, + 0x9487, 0xBD41, 0x9488, 0xBD42, 0x9489, 0xBD43, 0x948A, 0xBD44, 0x948B, 0xBD45, 0x948C, 0xBD46, 0x948D, 0xBD47, 0x948E, 0xBD4A, + 0x948F, 0xBD4B, 0x9490, 0xBD4D, 0x9491, 0xBD4E, 0x9492, 0xBD4F, 0x9493, 0xBD51, 0x9494, 0xBD52, 0x9495, 0xBD53, 0x9496, 0xBD54, + 0x9497, 0xBD55, 0x9498, 0xBD56, 0x9499, 0xBD57, 0x949A, 0xBD5A, 0x949B, 0xBD5B, 0x949C, 0xBD5C, 0x949D, 0xBD5D, 0x949E, 0xBD5E, + 0x949F, 0xBD5F, 0x94A0, 0xBD60, 0x94A1, 0xBD61, 0x94A2, 0xBD62, 0x94A3, 0xBD63, 0x94A4, 0xBD65, 0x94A5, 0xBD66, 0x94A6, 0xBD67, + 0x94A7, 0xBD69, 0x94A8, 0xBD6A, 0x94A9, 0xBD6B, 0x94AA, 0xBD6C, 0x94AB, 0xBD6D, 0x94AC, 0xBD6E, 0x94AD, 0xBD6F, 0x94AE, 0xBD70, + 0x94AF, 0xBD71, 0x94B0, 0xBD72, 0x94B1, 0xBD73, 0x94B2, 0xBD74, 0x94B3, 0xBD75, 0x94B4, 0xBD76, 0x94B5, 0xBD77, 0x94B6, 0xBD78, + 0x94B7, 0xBD79, 0x94B8, 0xBD7A, 0x94B9, 0xBD7B, 0x94BA, 0xBD7C, 0x94BB, 0xBD7D, 0x94BC, 0xBD7E, 0x94BD, 0xBD7F, 0x94BE, 0xBD82, + 0x94BF, 0xBD83, 0x94C0, 0xBD85, 0x94C1, 0xBD86, 0x94C2, 0xBD8B, 0x94C3, 0xBD8C, 0x94C4, 0xBD8D, 0x94C5, 0xBD8E, 0x94C6, 0xBD8F, + 0x94C7, 0xBD92, 0x94C8, 0xBD94, 0x94C9, 0xBD96, 0x94CA, 0xBD97, 0x94CB, 0xBD98, 0x94CC, 0xBD9B, 0x94CD, 0xBD9D, 0x94CE, 0xBD9E, + 0x94CF, 0xBD9F, 0x94D0, 0xBDA0, 0x94D1, 0xBDA1, 0x94D2, 0xBDA2, 0x94D3, 0xBDA3, 0x94D4, 0xBDA5, 0x94D5, 0xBDA6, 0x94D6, 0xBDA7, + 0x94D7, 0xBDA8, 0x94D8, 0xBDA9, 0x94D9, 0xBDAA, 0x94DA, 0xBDAB, 0x94DB, 0xBDAC, 0x94DC, 0xBDAD, 0x94DD, 0xBDAE, 0x94DE, 0xBDAF, + 0x94DF, 0xBDB1, 0x94E0, 0xBDB2, 0x94E1, 0xBDB3, 0x94E2, 0xBDB4, 0x94E3, 0xBDB5, 0x94E4, 0xBDB6, 0x94E5, 0xBDB7, 0x94E6, 0xBDB9, + 0x94E7, 0xBDBA, 0x94E8, 0xBDBB, 0x94E9, 0xBDBC, 0x94EA, 0xBDBD, 0x94EB, 0xBDBE, 0x94EC, 0xBDBF, 0x94ED, 0xBDC0, 0x94EE, 0xBDC1, + 0x94EF, 0xBDC2, 0x94F0, 0xBDC3, 0x94F1, 0xBDC4, 0x94F2, 0xBDC5, 0x94F3, 0xBDC6, 0x94F4, 0xBDC7, 0x94F5, 0xBDC8, 0x94F6, 0xBDC9, + 0x94F7, 0xBDCA, 0x94F8, 0xBDCB, 0x94F9, 0xBDCC, 0x94FA, 0xBDCD, 0x94FB, 0xBDCE, 0x94FC, 0xBDCF, 0x94FD, 0xBDD0, 0x94FE, 0xBDD1, + 0x9541, 0xBDD2, 0x9542, 0xBDD3, 0x9543, 0xBDD6, 0x9544, 0xBDD7, 0x9545, 0xBDD9, 0x9546, 0xBDDA, 0x9547, 0xBDDB, 0x9548, 0xBDDD, + 0x9549, 0xBDDE, 0x954A, 0xBDDF, 0x954B, 0xBDE0, 0x954C, 0xBDE1, 0x954D, 0xBDE2, 0x954E, 0xBDE3, 0x954F, 0xBDE4, 0x9550, 0xBDE5, + 0x9551, 0xBDE6, 0x9552, 0xBDE7, 0x9553, 0xBDE8, 0x9554, 0xBDEA, 0x9555, 0xBDEB, 0x9556, 0xBDEC, 0x9557, 0xBDED, 0x9558, 0xBDEE, + 0x9559, 0xBDEF, 0x955A, 0xBDF1, 0x9561, 0xBDF2, 0x9562, 0xBDF3, 0x9563, 0xBDF5, 0x9564, 0xBDF6, 0x9565, 0xBDF7, 0x9566, 0xBDF9, + 0x9567, 0xBDFA, 0x9568, 0xBDFB, 0x9569, 0xBDFC, 0x956A, 0xBDFD, 0x956B, 0xBDFE, 0x956C, 0xBDFF, 0x956D, 0xBE01, 0x956E, 0xBE02, + 0x956F, 0xBE04, 0x9570, 0xBE06, 0x9571, 0xBE07, 0x9572, 0xBE08, 0x9573, 0xBE09, 0x9574, 0xBE0A, 0x9575, 0xBE0B, 0x9576, 0xBE0E, + 0x9577, 0xBE0F, 0x9578, 0xBE11, 0x9579, 0xBE12, 0x957A, 0xBE13, 0x9581, 0xBE15, 0x9582, 0xBE16, 0x9583, 0xBE17, 0x9584, 0xBE18, + 0x9585, 0xBE19, 0x9586, 0xBE1A, 0x9587, 0xBE1B, 0x9588, 0xBE1E, 0x9589, 0xBE20, 0x958A, 0xBE21, 0x958B, 0xBE22, 0x958C, 0xBE23, + 0x958D, 0xBE24, 0x958E, 0xBE25, 0x958F, 0xBE26, 0x9590, 0xBE27, 0x9591, 0xBE28, 0x9592, 0xBE29, 0x9593, 0xBE2A, 0x9594, 0xBE2B, + 0x9595, 0xBE2C, 0x9596, 0xBE2D, 0x9597, 0xBE2E, 0x9598, 0xBE2F, 0x9599, 0xBE30, 0x959A, 0xBE31, 0x959B, 0xBE32, 0x959C, 0xBE33, + 0x959D, 0xBE34, 0x959E, 0xBE35, 0x959F, 0xBE36, 0x95A0, 0xBE37, 0x95A1, 0xBE38, 0x95A2, 0xBE39, 0x95A3, 0xBE3A, 0x95A4, 0xBE3B, + 0x95A5, 0xBE3C, 0x95A6, 0xBE3D, 0x95A7, 0xBE3E, 0x95A8, 0xBE3F, 0x95A9, 0xBE40, 0x95AA, 0xBE41, 0x95AB, 0xBE42, 0x95AC, 0xBE43, + 0x95AD, 0xBE46, 0x95AE, 0xBE47, 0x95AF, 0xBE49, 0x95B0, 0xBE4A, 0x95B1, 0xBE4B, 0x95B2, 0xBE4D, 0x95B3, 0xBE4F, 0x95B4, 0xBE50, + 0x95B5, 0xBE51, 0x95B6, 0xBE52, 0x95B7, 0xBE53, 0x95B8, 0xBE56, 0x95B9, 0xBE58, 0x95BA, 0xBE5C, 0x95BB, 0xBE5D, 0x95BC, 0xBE5E, + 0x95BD, 0xBE5F, 0x95BE, 0xBE62, 0x95BF, 0xBE63, 0x95C0, 0xBE65, 0x95C1, 0xBE66, 0x95C2, 0xBE67, 0x95C3, 0xBE69, 0x95C4, 0xBE6B, + 0x95C5, 0xBE6C, 0x95C6, 0xBE6D, 0x95C7, 0xBE6E, 0x95C8, 0xBE6F, 0x95C9, 0xBE72, 0x95CA, 0xBE76, 0x95CB, 0xBE77, 0x95CC, 0xBE78, + 0x95CD, 0xBE79, 0x95CE, 0xBE7A, 0x95CF, 0xBE7E, 0x95D0, 0xBE7F, 0x95D1, 0xBE81, 0x95D2, 0xBE82, 0x95D3, 0xBE83, 0x95D4, 0xBE85, + 0x95D5, 0xBE86, 0x95D6, 0xBE87, 0x95D7, 0xBE88, 0x95D8, 0xBE89, 0x95D9, 0xBE8A, 0x95DA, 0xBE8B, 0x95DB, 0xBE8E, 0x95DC, 0xBE92, + 0x95DD, 0xBE93, 0x95DE, 0xBE94, 0x95DF, 0xBE95, 0x95E0, 0xBE96, 0x95E1, 0xBE97, 0x95E2, 0xBE9A, 0x95E3, 0xBE9B, 0x95E4, 0xBE9C, + 0x95E5, 0xBE9D, 0x95E6, 0xBE9E, 0x95E7, 0xBE9F, 0x95E8, 0xBEA0, 0x95E9, 0xBEA1, 0x95EA, 0xBEA2, 0x95EB, 0xBEA3, 0x95EC, 0xBEA4, + 0x95ED, 0xBEA5, 0x95EE, 0xBEA6, 0x95EF, 0xBEA7, 0x95F0, 0xBEA9, 0x95F1, 0xBEAA, 0x95F2, 0xBEAB, 0x95F3, 0xBEAC, 0x95F4, 0xBEAD, + 0x95F5, 0xBEAE, 0x95F6, 0xBEAF, 0x95F7, 0xBEB0, 0x95F8, 0xBEB1, 0x95F9, 0xBEB2, 0x95FA, 0xBEB3, 0x95FB, 0xBEB4, 0x95FC, 0xBEB5, + 0x95FD, 0xBEB6, 0x95FE, 0xBEB7, 0x9641, 0xBEB8, 0x9642, 0xBEB9, 0x9643, 0xBEBA, 0x9644, 0xBEBB, 0x9645, 0xBEBC, 0x9646, 0xBEBD, + 0x9647, 0xBEBE, 0x9648, 0xBEBF, 0x9649, 0xBEC0, 0x964A, 0xBEC1, 0x964B, 0xBEC2, 0x964C, 0xBEC3, 0x964D, 0xBEC4, 0x964E, 0xBEC5, + 0x964F, 0xBEC6, 0x9650, 0xBEC7, 0x9651, 0xBEC8, 0x9652, 0xBEC9, 0x9653, 0xBECA, 0x9654, 0xBECB, 0x9655, 0xBECC, 0x9656, 0xBECD, + 0x9657, 0xBECE, 0x9658, 0xBECF, 0x9659, 0xBED2, 0x965A, 0xBED3, 0x9661, 0xBED5, 0x9662, 0xBED6, 0x9663, 0xBED9, 0x9664, 0xBEDA, + 0x9665, 0xBEDB, 0x9666, 0xBEDC, 0x9667, 0xBEDD, 0x9668, 0xBEDE, 0x9669, 0xBEDF, 0x966A, 0xBEE1, 0x966B, 0xBEE2, 0x966C, 0xBEE6, + 0x966D, 0xBEE7, 0x966E, 0xBEE8, 0x966F, 0xBEE9, 0x9670, 0xBEEA, 0x9671, 0xBEEB, 0x9672, 0xBEED, 0x9673, 0xBEEE, 0x9674, 0xBEEF, + 0x9675, 0xBEF0, 0x9676, 0xBEF1, 0x9677, 0xBEF2, 0x9678, 0xBEF3, 0x9679, 0xBEF4, 0x967A, 0xBEF5, 0x9681, 0xBEF6, 0x9682, 0xBEF7, + 0x9683, 0xBEF8, 0x9684, 0xBEF9, 0x9685, 0xBEFA, 0x9686, 0xBEFB, 0x9687, 0xBEFC, 0x9688, 0xBEFD, 0x9689, 0xBEFE, 0x968A, 0xBEFF, + 0x968B, 0xBF00, 0x968C, 0xBF02, 0x968D, 0xBF03, 0x968E, 0xBF04, 0x968F, 0xBF05, 0x9690, 0xBF06, 0x9691, 0xBF07, 0x9692, 0xBF0A, + 0x9693, 0xBF0B, 0x9694, 0xBF0C, 0x9695, 0xBF0D, 0x9696, 0xBF0E, 0x9697, 0xBF0F, 0x9698, 0xBF10, 0x9699, 0xBF11, 0x969A, 0xBF12, + 0x969B, 0xBF13, 0x969C, 0xBF14, 0x969D, 0xBF15, 0x969E, 0xBF16, 0x969F, 0xBF17, 0x96A0, 0xBF1A, 0x96A1, 0xBF1E, 0x96A2, 0xBF1F, + 0x96A3, 0xBF20, 0x96A4, 0xBF21, 0x96A5, 0xBF22, 0x96A6, 0xBF23, 0x96A7, 0xBF24, 0x96A8, 0xBF25, 0x96A9, 0xBF26, 0x96AA, 0xBF27, + 0x96AB, 0xBF28, 0x96AC, 0xBF29, 0x96AD, 0xBF2A, 0x96AE, 0xBF2B, 0x96AF, 0xBF2C, 0x96B0, 0xBF2D, 0x96B1, 0xBF2E, 0x96B2, 0xBF2F, + 0x96B3, 0xBF30, 0x96B4, 0xBF31, 0x96B5, 0xBF32, 0x96B6, 0xBF33, 0x96B7, 0xBF34, 0x96B8, 0xBF35, 0x96B9, 0xBF36, 0x96BA, 0xBF37, + 0x96BB, 0xBF38, 0x96BC, 0xBF39, 0x96BD, 0xBF3A, 0x96BE, 0xBF3B, 0x96BF, 0xBF3C, 0x96C0, 0xBF3D, 0x96C1, 0xBF3E, 0x96C2, 0xBF3F, + 0x96C3, 0xBF42, 0x96C4, 0xBF43, 0x96C5, 0xBF45, 0x96C6, 0xBF46, 0x96C7, 0xBF47, 0x96C8, 0xBF49, 0x96C9, 0xBF4A, 0x96CA, 0xBF4B, + 0x96CB, 0xBF4C, 0x96CC, 0xBF4D, 0x96CD, 0xBF4E, 0x96CE, 0xBF4F, 0x96CF, 0xBF52, 0x96D0, 0xBF53, 0x96D1, 0xBF54, 0x96D2, 0xBF56, + 0x96D3, 0xBF57, 0x96D4, 0xBF58, 0x96D5, 0xBF59, 0x96D6, 0xBF5A, 0x96D7, 0xBF5B, 0x96D8, 0xBF5C, 0x96D9, 0xBF5D, 0x96DA, 0xBF5E, + 0x96DB, 0xBF5F, 0x96DC, 0xBF60, 0x96DD, 0xBF61, 0x96DE, 0xBF62, 0x96DF, 0xBF63, 0x96E0, 0xBF64, 0x96E1, 0xBF65, 0x96E2, 0xBF66, + 0x96E3, 0xBF67, 0x96E4, 0xBF68, 0x96E5, 0xBF69, 0x96E6, 0xBF6A, 0x96E7, 0xBF6B, 0x96E8, 0xBF6C, 0x96E9, 0xBF6D, 0x96EA, 0xBF6E, + 0x96EB, 0xBF6F, 0x96EC, 0xBF70, 0x96ED, 0xBF71, 0x96EE, 0xBF72, 0x96EF, 0xBF73, 0x96F0, 0xBF74, 0x96F1, 0xBF75, 0x96F2, 0xBF76, + 0x96F3, 0xBF77, 0x96F4, 0xBF78, 0x96F5, 0xBF79, 0x96F6, 0xBF7A, 0x96F7, 0xBF7B, 0x96F8, 0xBF7C, 0x96F9, 0xBF7D, 0x96FA, 0xBF7E, + 0x96FB, 0xBF7F, 0x96FC, 0xBF80, 0x96FD, 0xBF81, 0x96FE, 0xBF82, 0x9741, 0xBF83, 0x9742, 0xBF84, 0x9743, 0xBF85, 0x9744, 0xBF86, + 0x9745, 0xBF87, 0x9746, 0xBF88, 0x9747, 0xBF89, 0x9748, 0xBF8A, 0x9749, 0xBF8B, 0x974A, 0xBF8C, 0x974B, 0xBF8D, 0x974C, 0xBF8E, + 0x974D, 0xBF8F, 0x974E, 0xBF90, 0x974F, 0xBF91, 0x9750, 0xBF92, 0x9751, 0xBF93, 0x9752, 0xBF95, 0x9753, 0xBF96, 0x9754, 0xBF97, + 0x9755, 0xBF98, 0x9756, 0xBF99, 0x9757, 0xBF9A, 0x9758, 0xBF9B, 0x9759, 0xBF9C, 0x975A, 0xBF9D, 0x9761, 0xBF9E, 0x9762, 0xBF9F, + 0x9763, 0xBFA0, 0x9764, 0xBFA1, 0x9765, 0xBFA2, 0x9766, 0xBFA3, 0x9767, 0xBFA4, 0x9768, 0xBFA5, 0x9769, 0xBFA6, 0x976A, 0xBFA7, + 0x976B, 0xBFA8, 0x976C, 0xBFA9, 0x976D, 0xBFAA, 0x976E, 0xBFAB, 0x976F, 0xBFAC, 0x9770, 0xBFAD, 0x9771, 0xBFAE, 0x9772, 0xBFAF, + 0x9773, 0xBFB1, 0x9774, 0xBFB2, 0x9775, 0xBFB3, 0x9776, 0xBFB4, 0x9777, 0xBFB5, 0x9778, 0xBFB6, 0x9779, 0xBFB7, 0x977A, 0xBFB8, + 0x9781, 0xBFB9, 0x9782, 0xBFBA, 0x9783, 0xBFBB, 0x9784, 0xBFBC, 0x9785, 0xBFBD, 0x9786, 0xBFBE, 0x9787, 0xBFBF, 0x9788, 0xBFC0, + 0x9789, 0xBFC1, 0x978A, 0xBFC2, 0x978B, 0xBFC3, 0x978C, 0xBFC4, 0x978D, 0xBFC6, 0x978E, 0xBFC7, 0x978F, 0xBFC8, 0x9790, 0xBFC9, + 0x9791, 0xBFCA, 0x9792, 0xBFCB, 0x9793, 0xBFCE, 0x9794, 0xBFCF, 0x9795, 0xBFD1, 0x9796, 0xBFD2, 0x9797, 0xBFD3, 0x9798, 0xBFD5, + 0x9799, 0xBFD6, 0x979A, 0xBFD7, 0x979B, 0xBFD8, 0x979C, 0xBFD9, 0x979D, 0xBFDA, 0x979E, 0xBFDB, 0x979F, 0xBFDD, 0x97A0, 0xBFDE, + 0x97A1, 0xBFE0, 0x97A2, 0xBFE2, 0x97A3, 0xBFE3, 0x97A4, 0xBFE4, 0x97A5, 0xBFE5, 0x97A6, 0xBFE6, 0x97A7, 0xBFE7, 0x97A8, 0xBFE8, + 0x97A9, 0xBFE9, 0x97AA, 0xBFEA, 0x97AB, 0xBFEB, 0x97AC, 0xBFEC, 0x97AD, 0xBFED, 0x97AE, 0xBFEE, 0x97AF, 0xBFEF, 0x97B0, 0xBFF0, + 0x97B1, 0xBFF1, 0x97B2, 0xBFF2, 0x97B3, 0xBFF3, 0x97B4, 0xBFF4, 0x97B5, 0xBFF5, 0x97B6, 0xBFF6, 0x97B7, 0xBFF7, 0x97B8, 0xBFF8, + 0x97B9, 0xBFF9, 0x97BA, 0xBFFA, 0x97BB, 0xBFFB, 0x97BC, 0xBFFC, 0x97BD, 0xBFFD, 0x97BE, 0xBFFE, 0x97BF, 0xBFFF, 0x97C0, 0xC000, + 0x97C1, 0xC001, 0x97C2, 0xC002, 0x97C3, 0xC003, 0x97C4, 0xC004, 0x97C5, 0xC005, 0x97C6, 0xC006, 0x97C7, 0xC007, 0x97C8, 0xC008, + 0x97C9, 0xC009, 0x97CA, 0xC00A, 0x97CB, 0xC00B, 0x97CC, 0xC00C, 0x97CD, 0xC00D, 0x97CE, 0xC00E, 0x97CF, 0xC00F, 0x97D0, 0xC010, + 0x97D1, 0xC011, 0x97D2, 0xC012, 0x97D3, 0xC013, 0x97D4, 0xC014, 0x97D5, 0xC015, 0x97D6, 0xC016, 0x97D7, 0xC017, 0x97D8, 0xC018, + 0x97D9, 0xC019, 0x97DA, 0xC01A, 0x97DB, 0xC01B, 0x97DC, 0xC01C, 0x97DD, 0xC01D, 0x97DE, 0xC01E, 0x97DF, 0xC01F, 0x97E0, 0xC020, + 0x97E1, 0xC021, 0x97E2, 0xC022, 0x97E3, 0xC023, 0x97E4, 0xC024, 0x97E5, 0xC025, 0x97E6, 0xC026, 0x97E7, 0xC027, 0x97E8, 0xC028, + 0x97E9, 0xC029, 0x97EA, 0xC02A, 0x97EB, 0xC02B, 0x97EC, 0xC02C, 0x97ED, 0xC02D, 0x97EE, 0xC02E, 0x97EF, 0xC02F, 0x97F0, 0xC030, + 0x97F1, 0xC031, 0x97F2, 0xC032, 0x97F3, 0xC033, 0x97F4, 0xC034, 0x97F5, 0xC035, 0x97F6, 0xC036, 0x97F7, 0xC037, 0x97F8, 0xC038, + 0x97F9, 0xC039, 0x97FA, 0xC03A, 0x97FB, 0xC03B, 0x97FC, 0xC03D, 0x97FD, 0xC03E, 0x97FE, 0xC03F, 0x9841, 0xC040, 0x9842, 0xC041, + 0x9843, 0xC042, 0x9844, 0xC043, 0x9845, 0xC044, 0x9846, 0xC045, 0x9847, 0xC046, 0x9848, 0xC047, 0x9849, 0xC048, 0x984A, 0xC049, + 0x984B, 0xC04A, 0x984C, 0xC04B, 0x984D, 0xC04C, 0x984E, 0xC04D, 0x984F, 0xC04E, 0x9850, 0xC04F, 0x9851, 0xC050, 0x9852, 0xC052, + 0x9853, 0xC053, 0x9854, 0xC054, 0x9855, 0xC055, 0x9856, 0xC056, 0x9857, 0xC057, 0x9858, 0xC059, 0x9859, 0xC05A, 0x985A, 0xC05B, + 0x9861, 0xC05D, 0x9862, 0xC05E, 0x9863, 0xC05F, 0x9864, 0xC061, 0x9865, 0xC062, 0x9866, 0xC063, 0x9867, 0xC064, 0x9868, 0xC065, + 0x9869, 0xC066, 0x986A, 0xC067, 0x986B, 0xC06A, 0x986C, 0xC06B, 0x986D, 0xC06C, 0x986E, 0xC06D, 0x986F, 0xC06E, 0x9870, 0xC06F, + 0x9871, 0xC070, 0x9872, 0xC071, 0x9873, 0xC072, 0x9874, 0xC073, 0x9875, 0xC074, 0x9876, 0xC075, 0x9877, 0xC076, 0x9878, 0xC077, + 0x9879, 0xC078, 0x987A, 0xC079, 0x9881, 0xC07A, 0x9882, 0xC07B, 0x9883, 0xC07C, 0x9884, 0xC07D, 0x9885, 0xC07E, 0x9886, 0xC07F, + 0x9887, 0xC080, 0x9888, 0xC081, 0x9889, 0xC082, 0x988A, 0xC083, 0x988B, 0xC084, 0x988C, 0xC085, 0x988D, 0xC086, 0x988E, 0xC087, + 0x988F, 0xC088, 0x9890, 0xC089, 0x9891, 0xC08A, 0x9892, 0xC08B, 0x9893, 0xC08C, 0x9894, 0xC08D, 0x9895, 0xC08E, 0x9896, 0xC08F, + 0x9897, 0xC092, 0x9898, 0xC093, 0x9899, 0xC095, 0x989A, 0xC096, 0x989B, 0xC097, 0x989C, 0xC099, 0x989D, 0xC09A, 0x989E, 0xC09B, + 0x989F, 0xC09C, 0x98A0, 0xC09D, 0x98A1, 0xC09E, 0x98A2, 0xC09F, 0x98A3, 0xC0A2, 0x98A4, 0xC0A4, 0x98A5, 0xC0A6, 0x98A6, 0xC0A7, + 0x98A7, 0xC0A8, 0x98A8, 0xC0A9, 0x98A9, 0xC0AA, 0x98AA, 0xC0AB, 0x98AB, 0xC0AE, 0x98AC, 0xC0B1, 0x98AD, 0xC0B2, 0x98AE, 0xC0B7, + 0x98AF, 0xC0B8, 0x98B0, 0xC0B9, 0x98B1, 0xC0BA, 0x98B2, 0xC0BB, 0x98B3, 0xC0BE, 0x98B4, 0xC0C2, 0x98B5, 0xC0C3, 0x98B6, 0xC0C4, + 0x98B7, 0xC0C6, 0x98B8, 0xC0C7, 0x98B9, 0xC0CA, 0x98BA, 0xC0CB, 0x98BB, 0xC0CD, 0x98BC, 0xC0CE, 0x98BD, 0xC0CF, 0x98BE, 0xC0D1, + 0x98BF, 0xC0D2, 0x98C0, 0xC0D3, 0x98C1, 0xC0D4, 0x98C2, 0xC0D5, 0x98C3, 0xC0D6, 0x98C4, 0xC0D7, 0x98C5, 0xC0DA, 0x98C6, 0xC0DE, + 0x98C7, 0xC0DF, 0x98C8, 0xC0E0, 0x98C9, 0xC0E1, 0x98CA, 0xC0E2, 0x98CB, 0xC0E3, 0x98CC, 0xC0E6, 0x98CD, 0xC0E7, 0x98CE, 0xC0E9, + 0x98CF, 0xC0EA, 0x98D0, 0xC0EB, 0x98D1, 0xC0ED, 0x98D2, 0xC0EE, 0x98D3, 0xC0EF, 0x98D4, 0xC0F0, 0x98D5, 0xC0F1, 0x98D6, 0xC0F2, + 0x98D7, 0xC0F3, 0x98D8, 0xC0F6, 0x98D9, 0xC0F8, 0x98DA, 0xC0FA, 0x98DB, 0xC0FB, 0x98DC, 0xC0FC, 0x98DD, 0xC0FD, 0x98DE, 0xC0FE, + 0x98DF, 0xC0FF, 0x98E0, 0xC101, 0x98E1, 0xC102, 0x98E2, 0xC103, 0x98E3, 0xC105, 0x98E4, 0xC106, 0x98E5, 0xC107, 0x98E6, 0xC109, + 0x98E7, 0xC10A, 0x98E8, 0xC10B, 0x98E9, 0xC10C, 0x98EA, 0xC10D, 0x98EB, 0xC10E, 0x98EC, 0xC10F, 0x98ED, 0xC111, 0x98EE, 0xC112, + 0x98EF, 0xC113, 0x98F0, 0xC114, 0x98F1, 0xC116, 0x98F2, 0xC117, 0x98F3, 0xC118, 0x98F4, 0xC119, 0x98F5, 0xC11A, 0x98F6, 0xC11B, + 0x98F7, 0xC121, 0x98F8, 0xC122, 0x98F9, 0xC125, 0x98FA, 0xC128, 0x98FB, 0xC129, 0x98FC, 0xC12A, 0x98FD, 0xC12B, 0x98FE, 0xC12E, + 0x9941, 0xC132, 0x9942, 0xC133, 0x9943, 0xC134, 0x9944, 0xC135, 0x9945, 0xC137, 0x9946, 0xC13A, 0x9947, 0xC13B, 0x9948, 0xC13D, + 0x9949, 0xC13E, 0x994A, 0xC13F, 0x994B, 0xC141, 0x994C, 0xC142, 0x994D, 0xC143, 0x994E, 0xC144, 0x994F, 0xC145, 0x9950, 0xC146, + 0x9951, 0xC147, 0x9952, 0xC14A, 0x9953, 0xC14E, 0x9954, 0xC14F, 0x9955, 0xC150, 0x9956, 0xC151, 0x9957, 0xC152, 0x9958, 0xC153, + 0x9959, 0xC156, 0x995A, 0xC157, 0x9961, 0xC159, 0x9962, 0xC15A, 0x9963, 0xC15B, 0x9964, 0xC15D, 0x9965, 0xC15E, 0x9966, 0xC15F, + 0x9967, 0xC160, 0x9968, 0xC161, 0x9969, 0xC162, 0x996A, 0xC163, 0x996B, 0xC166, 0x996C, 0xC16A, 0x996D, 0xC16B, 0x996E, 0xC16C, + 0x996F, 0xC16D, 0x9970, 0xC16E, 0x9971, 0xC16F, 0x9972, 0xC171, 0x9973, 0xC172, 0x9974, 0xC173, 0x9975, 0xC175, 0x9976, 0xC176, + 0x9977, 0xC177, 0x9978, 0xC179, 0x9979, 0xC17A, 0x997A, 0xC17B, 0x9981, 0xC17C, 0x9982, 0xC17D, 0x9983, 0xC17E, 0x9984, 0xC17F, + 0x9985, 0xC180, 0x9986, 0xC181, 0x9987, 0xC182, 0x9988, 0xC183, 0x9989, 0xC184, 0x998A, 0xC186, 0x998B, 0xC187, 0x998C, 0xC188, + 0x998D, 0xC189, 0x998E, 0xC18A, 0x998F, 0xC18B, 0x9990, 0xC18F, 0x9991, 0xC191, 0x9992, 0xC192, 0x9993, 0xC193, 0x9994, 0xC195, + 0x9995, 0xC197, 0x9996, 0xC198, 0x9997, 0xC199, 0x9998, 0xC19A, 0x9999, 0xC19B, 0x999A, 0xC19E, 0x999B, 0xC1A0, 0x999C, 0xC1A2, + 0x999D, 0xC1A3, 0x999E, 0xC1A4, 0x999F, 0xC1A6, 0x99A0, 0xC1A7, 0x99A1, 0xC1AA, 0x99A2, 0xC1AB, 0x99A3, 0xC1AD, 0x99A4, 0xC1AE, + 0x99A5, 0xC1AF, 0x99A6, 0xC1B1, 0x99A7, 0xC1B2, 0x99A8, 0xC1B3, 0x99A9, 0xC1B4, 0x99AA, 0xC1B5, 0x99AB, 0xC1B6, 0x99AC, 0xC1B7, + 0x99AD, 0xC1B8, 0x99AE, 0xC1B9, 0x99AF, 0xC1BA, 0x99B0, 0xC1BB, 0x99B1, 0xC1BC, 0x99B2, 0xC1BE, 0x99B3, 0xC1BF, 0x99B4, 0xC1C0, + 0x99B5, 0xC1C1, 0x99B6, 0xC1C2, 0x99B7, 0xC1C3, 0x99B8, 0xC1C5, 0x99B9, 0xC1C6, 0x99BA, 0xC1C7, 0x99BB, 0xC1C9, 0x99BC, 0xC1CA, + 0x99BD, 0xC1CB, 0x99BE, 0xC1CD, 0x99BF, 0xC1CE, 0x99C0, 0xC1CF, 0x99C1, 0xC1D0, 0x99C2, 0xC1D1, 0x99C3, 0xC1D2, 0x99C4, 0xC1D3, + 0x99C5, 0xC1D5, 0x99C6, 0xC1D6, 0x99C7, 0xC1D9, 0x99C8, 0xC1DA, 0x99C9, 0xC1DB, 0x99CA, 0xC1DC, 0x99CB, 0xC1DD, 0x99CC, 0xC1DE, + 0x99CD, 0xC1DF, 0x99CE, 0xC1E1, 0x99CF, 0xC1E2, 0x99D0, 0xC1E3, 0x99D1, 0xC1E5, 0x99D2, 0xC1E6, 0x99D3, 0xC1E7, 0x99D4, 0xC1E9, + 0x99D5, 0xC1EA, 0x99D6, 0xC1EB, 0x99D7, 0xC1EC, 0x99D8, 0xC1ED, 0x99D9, 0xC1EE, 0x99DA, 0xC1EF, 0x99DB, 0xC1F2, 0x99DC, 0xC1F4, + 0x99DD, 0xC1F5, 0x99DE, 0xC1F6, 0x99DF, 0xC1F7, 0x99E0, 0xC1F8, 0x99E1, 0xC1F9, 0x99E2, 0xC1FA, 0x99E3, 0xC1FB, 0x99E4, 0xC1FE, + 0x99E5, 0xC1FF, 0x99E6, 0xC201, 0x99E7, 0xC202, 0x99E8, 0xC203, 0x99E9, 0xC205, 0x99EA, 0xC206, 0x99EB, 0xC207, 0x99EC, 0xC208, + 0x99ED, 0xC209, 0x99EE, 0xC20A, 0x99EF, 0xC20B, 0x99F0, 0xC20E, 0x99F1, 0xC210, 0x99F2, 0xC212, 0x99F3, 0xC213, 0x99F4, 0xC214, + 0x99F5, 0xC215, 0x99F6, 0xC216, 0x99F7, 0xC217, 0x99F8, 0xC21A, 0x99F9, 0xC21B, 0x99FA, 0xC21D, 0x99FB, 0xC21E, 0x99FC, 0xC221, + 0x99FD, 0xC222, 0x99FE, 0xC223, 0x9A41, 0xC224, 0x9A42, 0xC225, 0x9A43, 0xC226, 0x9A44, 0xC227, 0x9A45, 0xC22A, 0x9A46, 0xC22C, + 0x9A47, 0xC22E, 0x9A48, 0xC230, 0x9A49, 0xC233, 0x9A4A, 0xC235, 0x9A4B, 0xC236, 0x9A4C, 0xC237, 0x9A4D, 0xC238, 0x9A4E, 0xC239, + 0x9A4F, 0xC23A, 0x9A50, 0xC23B, 0x9A51, 0xC23C, 0x9A52, 0xC23D, 0x9A53, 0xC23E, 0x9A54, 0xC23F, 0x9A55, 0xC240, 0x9A56, 0xC241, + 0x9A57, 0xC242, 0x9A58, 0xC243, 0x9A59, 0xC244, 0x9A5A, 0xC245, 0x9A61, 0xC246, 0x9A62, 0xC247, 0x9A63, 0xC249, 0x9A64, 0xC24A, + 0x9A65, 0xC24B, 0x9A66, 0xC24C, 0x9A67, 0xC24D, 0x9A68, 0xC24E, 0x9A69, 0xC24F, 0x9A6A, 0xC252, 0x9A6B, 0xC253, 0x9A6C, 0xC255, + 0x9A6D, 0xC256, 0x9A6E, 0xC257, 0x9A6F, 0xC259, 0x9A70, 0xC25A, 0x9A71, 0xC25B, 0x9A72, 0xC25C, 0x9A73, 0xC25D, 0x9A74, 0xC25E, + 0x9A75, 0xC25F, 0x9A76, 0xC261, 0x9A77, 0xC262, 0x9A78, 0xC263, 0x9A79, 0xC264, 0x9A7A, 0xC266, 0x9A81, 0xC267, 0x9A82, 0xC268, + 0x9A83, 0xC269, 0x9A84, 0xC26A, 0x9A85, 0xC26B, 0x9A86, 0xC26E, 0x9A87, 0xC26F, 0x9A88, 0xC271, 0x9A89, 0xC272, 0x9A8A, 0xC273, + 0x9A8B, 0xC275, 0x9A8C, 0xC276, 0x9A8D, 0xC277, 0x9A8E, 0xC278, 0x9A8F, 0xC279, 0x9A90, 0xC27A, 0x9A91, 0xC27B, 0x9A92, 0xC27E, + 0x9A93, 0xC280, 0x9A94, 0xC282, 0x9A95, 0xC283, 0x9A96, 0xC284, 0x9A97, 0xC285, 0x9A98, 0xC286, 0x9A99, 0xC287, 0x9A9A, 0xC28A, + 0x9A9B, 0xC28B, 0x9A9C, 0xC28C, 0x9A9D, 0xC28D, 0x9A9E, 0xC28E, 0x9A9F, 0xC28F, 0x9AA0, 0xC291, 0x9AA1, 0xC292, 0x9AA2, 0xC293, + 0x9AA3, 0xC294, 0x9AA4, 0xC295, 0x9AA5, 0xC296, 0x9AA6, 0xC297, 0x9AA7, 0xC299, 0x9AA8, 0xC29A, 0x9AA9, 0xC29C, 0x9AAA, 0xC29E, + 0x9AAB, 0xC29F, 0x9AAC, 0xC2A0, 0x9AAD, 0xC2A1, 0x9AAE, 0xC2A2, 0x9AAF, 0xC2A3, 0x9AB0, 0xC2A6, 0x9AB1, 0xC2A7, 0x9AB2, 0xC2A9, + 0x9AB3, 0xC2AA, 0x9AB4, 0xC2AB, 0x9AB5, 0xC2AE, 0x9AB6, 0xC2AF, 0x9AB7, 0xC2B0, 0x9AB8, 0xC2B1, 0x9AB9, 0xC2B2, 0x9ABA, 0xC2B3, + 0x9ABB, 0xC2B6, 0x9ABC, 0xC2B8, 0x9ABD, 0xC2BA, 0x9ABE, 0xC2BB, 0x9ABF, 0xC2BC, 0x9AC0, 0xC2BD, 0x9AC1, 0xC2BE, 0x9AC2, 0xC2BF, + 0x9AC3, 0xC2C0, 0x9AC4, 0xC2C1, 0x9AC5, 0xC2C2, 0x9AC6, 0xC2C3, 0x9AC7, 0xC2C4, 0x9AC8, 0xC2C5, 0x9AC9, 0xC2C6, 0x9ACA, 0xC2C7, + 0x9ACB, 0xC2C8, 0x9ACC, 0xC2C9, 0x9ACD, 0xC2CA, 0x9ACE, 0xC2CB, 0x9ACF, 0xC2CC, 0x9AD0, 0xC2CD, 0x9AD1, 0xC2CE, 0x9AD2, 0xC2CF, + 0x9AD3, 0xC2D0, 0x9AD4, 0xC2D1, 0x9AD5, 0xC2D2, 0x9AD6, 0xC2D3, 0x9AD7, 0xC2D4, 0x9AD8, 0xC2D5, 0x9AD9, 0xC2D6, 0x9ADA, 0xC2D7, + 0x9ADB, 0xC2D8, 0x9ADC, 0xC2D9, 0x9ADD, 0xC2DA, 0x9ADE, 0xC2DB, 0x9ADF, 0xC2DE, 0x9AE0, 0xC2DF, 0x9AE1, 0xC2E1, 0x9AE2, 0xC2E2, + 0x9AE3, 0xC2E5, 0x9AE4, 0xC2E6, 0x9AE5, 0xC2E7, 0x9AE6, 0xC2E8, 0x9AE7, 0xC2E9, 0x9AE8, 0xC2EA, 0x9AE9, 0xC2EE, 0x9AEA, 0xC2F0, + 0x9AEB, 0xC2F2, 0x9AEC, 0xC2F3, 0x9AED, 0xC2F4, 0x9AEE, 0xC2F5, 0x9AEF, 0xC2F7, 0x9AF0, 0xC2FA, 0x9AF1, 0xC2FD, 0x9AF2, 0xC2FE, + 0x9AF3, 0xC2FF, 0x9AF4, 0xC301, 0x9AF5, 0xC302, 0x9AF6, 0xC303, 0x9AF7, 0xC304, 0x9AF8, 0xC305, 0x9AF9, 0xC306, 0x9AFA, 0xC307, + 0x9AFB, 0xC30A, 0x9AFC, 0xC30B, 0x9AFD, 0xC30E, 0x9AFE, 0xC30F, 0x9B41, 0xC310, 0x9B42, 0xC311, 0x9B43, 0xC312, 0x9B44, 0xC316, + 0x9B45, 0xC317, 0x9B46, 0xC319, 0x9B47, 0xC31A, 0x9B48, 0xC31B, 0x9B49, 0xC31D, 0x9B4A, 0xC31E, 0x9B4B, 0xC31F, 0x9B4C, 0xC320, + 0x9B4D, 0xC321, 0x9B4E, 0xC322, 0x9B4F, 0xC323, 0x9B50, 0xC326, 0x9B51, 0xC327, 0x9B52, 0xC32A, 0x9B53, 0xC32B, 0x9B54, 0xC32C, + 0x9B55, 0xC32D, 0x9B56, 0xC32E, 0x9B57, 0xC32F, 0x9B58, 0xC330, 0x9B59, 0xC331, 0x9B5A, 0xC332, 0x9B61, 0xC333, 0x9B62, 0xC334, + 0x9B63, 0xC335, 0x9B64, 0xC336, 0x9B65, 0xC337, 0x9B66, 0xC338, 0x9B67, 0xC339, 0x9B68, 0xC33A, 0x9B69, 0xC33B, 0x9B6A, 0xC33C, + 0x9B6B, 0xC33D, 0x9B6C, 0xC33E, 0x9B6D, 0xC33F, 0x9B6E, 0xC340, 0x9B6F, 0xC341, 0x9B70, 0xC342, 0x9B71, 0xC343, 0x9B72, 0xC344, + 0x9B73, 0xC346, 0x9B74, 0xC347, 0x9B75, 0xC348, 0x9B76, 0xC349, 0x9B77, 0xC34A, 0x9B78, 0xC34B, 0x9B79, 0xC34C, 0x9B7A, 0xC34D, + 0x9B81, 0xC34E, 0x9B82, 0xC34F, 0x9B83, 0xC350, 0x9B84, 0xC351, 0x9B85, 0xC352, 0x9B86, 0xC353, 0x9B87, 0xC354, 0x9B88, 0xC355, + 0x9B89, 0xC356, 0x9B8A, 0xC357, 0x9B8B, 0xC358, 0x9B8C, 0xC359, 0x9B8D, 0xC35A, 0x9B8E, 0xC35B, 0x9B8F, 0xC35C, 0x9B90, 0xC35D, + 0x9B91, 0xC35E, 0x9B92, 0xC35F, 0x9B93, 0xC360, 0x9B94, 0xC361, 0x9B95, 0xC362, 0x9B96, 0xC363, 0x9B97, 0xC364, 0x9B98, 0xC365, + 0x9B99, 0xC366, 0x9B9A, 0xC367, 0x9B9B, 0xC36A, 0x9B9C, 0xC36B, 0x9B9D, 0xC36D, 0x9B9E, 0xC36E, 0x9B9F, 0xC36F, 0x9BA0, 0xC371, + 0x9BA1, 0xC373, 0x9BA2, 0xC374, 0x9BA3, 0xC375, 0x9BA4, 0xC376, 0x9BA5, 0xC377, 0x9BA6, 0xC37A, 0x9BA7, 0xC37B, 0x9BA8, 0xC37E, + 0x9BA9, 0xC37F, 0x9BAA, 0xC380, 0x9BAB, 0xC381, 0x9BAC, 0xC382, 0x9BAD, 0xC383, 0x9BAE, 0xC385, 0x9BAF, 0xC386, 0x9BB0, 0xC387, + 0x9BB1, 0xC389, 0x9BB2, 0xC38A, 0x9BB3, 0xC38B, 0x9BB4, 0xC38D, 0x9BB5, 0xC38E, 0x9BB6, 0xC38F, 0x9BB7, 0xC390, 0x9BB8, 0xC391, + 0x9BB9, 0xC392, 0x9BBA, 0xC393, 0x9BBB, 0xC394, 0x9BBC, 0xC395, 0x9BBD, 0xC396, 0x9BBE, 0xC397, 0x9BBF, 0xC398, 0x9BC0, 0xC399, + 0x9BC1, 0xC39A, 0x9BC2, 0xC39B, 0x9BC3, 0xC39C, 0x9BC4, 0xC39D, 0x9BC5, 0xC39E, 0x9BC6, 0xC39F, 0x9BC7, 0xC3A0, 0x9BC8, 0xC3A1, + 0x9BC9, 0xC3A2, 0x9BCA, 0xC3A3, 0x9BCB, 0xC3A4, 0x9BCC, 0xC3A5, 0x9BCD, 0xC3A6, 0x9BCE, 0xC3A7, 0x9BCF, 0xC3A8, 0x9BD0, 0xC3A9, + 0x9BD1, 0xC3AA, 0x9BD2, 0xC3AB, 0x9BD3, 0xC3AC, 0x9BD4, 0xC3AD, 0x9BD5, 0xC3AE, 0x9BD6, 0xC3AF, 0x9BD7, 0xC3B0, 0x9BD8, 0xC3B1, + 0x9BD9, 0xC3B2, 0x9BDA, 0xC3B3, 0x9BDB, 0xC3B4, 0x9BDC, 0xC3B5, 0x9BDD, 0xC3B6, 0x9BDE, 0xC3B7, 0x9BDF, 0xC3B8, 0x9BE0, 0xC3B9, + 0x9BE1, 0xC3BA, 0x9BE2, 0xC3BB, 0x9BE3, 0xC3BC, 0x9BE4, 0xC3BD, 0x9BE5, 0xC3BE, 0x9BE6, 0xC3BF, 0x9BE7, 0xC3C1, 0x9BE8, 0xC3C2, + 0x9BE9, 0xC3C3, 0x9BEA, 0xC3C4, 0x9BEB, 0xC3C5, 0x9BEC, 0xC3C6, 0x9BED, 0xC3C7, 0x9BEE, 0xC3C8, 0x9BEF, 0xC3C9, 0x9BF0, 0xC3CA, + 0x9BF1, 0xC3CB, 0x9BF2, 0xC3CC, 0x9BF3, 0xC3CD, 0x9BF4, 0xC3CE, 0x9BF5, 0xC3CF, 0x9BF6, 0xC3D0, 0x9BF7, 0xC3D1, 0x9BF8, 0xC3D2, + 0x9BF9, 0xC3D3, 0x9BFA, 0xC3D4, 0x9BFB, 0xC3D5, 0x9BFC, 0xC3D6, 0x9BFD, 0xC3D7, 0x9BFE, 0xC3DA, 0x9C41, 0xC3DB, 0x9C42, 0xC3DD, + 0x9C43, 0xC3DE, 0x9C44, 0xC3E1, 0x9C45, 0xC3E3, 0x9C46, 0xC3E4, 0x9C47, 0xC3E5, 0x9C48, 0xC3E6, 0x9C49, 0xC3E7, 0x9C4A, 0xC3EA, + 0x9C4B, 0xC3EB, 0x9C4C, 0xC3EC, 0x9C4D, 0xC3EE, 0x9C4E, 0xC3EF, 0x9C4F, 0xC3F0, 0x9C50, 0xC3F1, 0x9C51, 0xC3F2, 0x9C52, 0xC3F3, + 0x9C53, 0xC3F6, 0x9C54, 0xC3F7, 0x9C55, 0xC3F9, 0x9C56, 0xC3FA, 0x9C57, 0xC3FB, 0x9C58, 0xC3FC, 0x9C59, 0xC3FD, 0x9C5A, 0xC3FE, + 0x9C61, 0xC3FF, 0x9C62, 0xC400, 0x9C63, 0xC401, 0x9C64, 0xC402, 0x9C65, 0xC403, 0x9C66, 0xC404, 0x9C67, 0xC405, 0x9C68, 0xC406, + 0x9C69, 0xC407, 0x9C6A, 0xC409, 0x9C6B, 0xC40A, 0x9C6C, 0xC40B, 0x9C6D, 0xC40C, 0x9C6E, 0xC40D, 0x9C6F, 0xC40E, 0x9C70, 0xC40F, + 0x9C71, 0xC411, 0x9C72, 0xC412, 0x9C73, 0xC413, 0x9C74, 0xC414, 0x9C75, 0xC415, 0x9C76, 0xC416, 0x9C77, 0xC417, 0x9C78, 0xC418, + 0x9C79, 0xC419, 0x9C7A, 0xC41A, 0x9C81, 0xC41B, 0x9C82, 0xC41C, 0x9C83, 0xC41D, 0x9C84, 0xC41E, 0x9C85, 0xC41F, 0x9C86, 0xC420, + 0x9C87, 0xC421, 0x9C88, 0xC422, 0x9C89, 0xC423, 0x9C8A, 0xC425, 0x9C8B, 0xC426, 0x9C8C, 0xC427, 0x9C8D, 0xC428, 0x9C8E, 0xC429, + 0x9C8F, 0xC42A, 0x9C90, 0xC42B, 0x9C91, 0xC42D, 0x9C92, 0xC42E, 0x9C93, 0xC42F, 0x9C94, 0xC431, 0x9C95, 0xC432, 0x9C96, 0xC433, + 0x9C97, 0xC435, 0x9C98, 0xC436, 0x9C99, 0xC437, 0x9C9A, 0xC438, 0x9C9B, 0xC439, 0x9C9C, 0xC43A, 0x9C9D, 0xC43B, 0x9C9E, 0xC43E, + 0x9C9F, 0xC43F, 0x9CA0, 0xC440, 0x9CA1, 0xC441, 0x9CA2, 0xC442, 0x9CA3, 0xC443, 0x9CA4, 0xC444, 0x9CA5, 0xC445, 0x9CA6, 0xC446, + 0x9CA7, 0xC447, 0x9CA8, 0xC449, 0x9CA9, 0xC44A, 0x9CAA, 0xC44B, 0x9CAB, 0xC44C, 0x9CAC, 0xC44D, 0x9CAD, 0xC44E, 0x9CAE, 0xC44F, + 0x9CAF, 0xC450, 0x9CB0, 0xC451, 0x9CB1, 0xC452, 0x9CB2, 0xC453, 0x9CB3, 0xC454, 0x9CB4, 0xC455, 0x9CB5, 0xC456, 0x9CB6, 0xC457, + 0x9CB7, 0xC458, 0x9CB8, 0xC459, 0x9CB9, 0xC45A, 0x9CBA, 0xC45B, 0x9CBB, 0xC45C, 0x9CBC, 0xC45D, 0x9CBD, 0xC45E, 0x9CBE, 0xC45F, + 0x9CBF, 0xC460, 0x9CC0, 0xC461, 0x9CC1, 0xC462, 0x9CC2, 0xC463, 0x9CC3, 0xC466, 0x9CC4, 0xC467, 0x9CC5, 0xC469, 0x9CC6, 0xC46A, + 0x9CC7, 0xC46B, 0x9CC8, 0xC46D, 0x9CC9, 0xC46E, 0x9CCA, 0xC46F, 0x9CCB, 0xC470, 0x9CCC, 0xC471, 0x9CCD, 0xC472, 0x9CCE, 0xC473, + 0x9CCF, 0xC476, 0x9CD0, 0xC477, 0x9CD1, 0xC478, 0x9CD2, 0xC47A, 0x9CD3, 0xC47B, 0x9CD4, 0xC47C, 0x9CD5, 0xC47D, 0x9CD6, 0xC47E, + 0x9CD7, 0xC47F, 0x9CD8, 0xC481, 0x9CD9, 0xC482, 0x9CDA, 0xC483, 0x9CDB, 0xC484, 0x9CDC, 0xC485, 0x9CDD, 0xC486, 0x9CDE, 0xC487, + 0x9CDF, 0xC488, 0x9CE0, 0xC489, 0x9CE1, 0xC48A, 0x9CE2, 0xC48B, 0x9CE3, 0xC48C, 0x9CE4, 0xC48D, 0x9CE5, 0xC48E, 0x9CE6, 0xC48F, + 0x9CE7, 0xC490, 0x9CE8, 0xC491, 0x9CE9, 0xC492, 0x9CEA, 0xC493, 0x9CEB, 0xC495, 0x9CEC, 0xC496, 0x9CED, 0xC497, 0x9CEE, 0xC498, + 0x9CEF, 0xC499, 0x9CF0, 0xC49A, 0x9CF1, 0xC49B, 0x9CF2, 0xC49D, 0x9CF3, 0xC49E, 0x9CF4, 0xC49F, 0x9CF5, 0xC4A0, 0x9CF6, 0xC4A1, + 0x9CF7, 0xC4A2, 0x9CF8, 0xC4A3, 0x9CF9, 0xC4A4, 0x9CFA, 0xC4A5, 0x9CFB, 0xC4A6, 0x9CFC, 0xC4A7, 0x9CFD, 0xC4A8, 0x9CFE, 0xC4A9, + 0x9D41, 0xC4AA, 0x9D42, 0xC4AB, 0x9D43, 0xC4AC, 0x9D44, 0xC4AD, 0x9D45, 0xC4AE, 0x9D46, 0xC4AF, 0x9D47, 0xC4B0, 0x9D48, 0xC4B1, + 0x9D49, 0xC4B2, 0x9D4A, 0xC4B3, 0x9D4B, 0xC4B4, 0x9D4C, 0xC4B5, 0x9D4D, 0xC4B6, 0x9D4E, 0xC4B7, 0x9D4F, 0xC4B9, 0x9D50, 0xC4BA, + 0x9D51, 0xC4BB, 0x9D52, 0xC4BD, 0x9D53, 0xC4BE, 0x9D54, 0xC4BF, 0x9D55, 0xC4C0, 0x9D56, 0xC4C1, 0x9D57, 0xC4C2, 0x9D58, 0xC4C3, + 0x9D59, 0xC4C4, 0x9D5A, 0xC4C5, 0x9D61, 0xC4C6, 0x9D62, 0xC4C7, 0x9D63, 0xC4C8, 0x9D64, 0xC4C9, 0x9D65, 0xC4CA, 0x9D66, 0xC4CB, + 0x9D67, 0xC4CC, 0x9D68, 0xC4CD, 0x9D69, 0xC4CE, 0x9D6A, 0xC4CF, 0x9D6B, 0xC4D0, 0x9D6C, 0xC4D1, 0x9D6D, 0xC4D2, 0x9D6E, 0xC4D3, + 0x9D6F, 0xC4D4, 0x9D70, 0xC4D5, 0x9D71, 0xC4D6, 0x9D72, 0xC4D7, 0x9D73, 0xC4D8, 0x9D74, 0xC4D9, 0x9D75, 0xC4DA, 0x9D76, 0xC4DB, + 0x9D77, 0xC4DC, 0x9D78, 0xC4DD, 0x9D79, 0xC4DE, 0x9D7A, 0xC4DF, 0x9D81, 0xC4E0, 0x9D82, 0xC4E1, 0x9D83, 0xC4E2, 0x9D84, 0xC4E3, + 0x9D85, 0xC4E4, 0x9D86, 0xC4E5, 0x9D87, 0xC4E6, 0x9D88, 0xC4E7, 0x9D89, 0xC4E8, 0x9D8A, 0xC4EA, 0x9D8B, 0xC4EB, 0x9D8C, 0xC4EC, + 0x9D8D, 0xC4ED, 0x9D8E, 0xC4EE, 0x9D8F, 0xC4EF, 0x9D90, 0xC4F2, 0x9D91, 0xC4F3, 0x9D92, 0xC4F5, 0x9D93, 0xC4F6, 0x9D94, 0xC4F7, + 0x9D95, 0xC4F9, 0x9D96, 0xC4FB, 0x9D97, 0xC4FC, 0x9D98, 0xC4FD, 0x9D99, 0xC4FE, 0x9D9A, 0xC502, 0x9D9B, 0xC503, 0x9D9C, 0xC504, + 0x9D9D, 0xC505, 0x9D9E, 0xC506, 0x9D9F, 0xC507, 0x9DA0, 0xC508, 0x9DA1, 0xC509, 0x9DA2, 0xC50A, 0x9DA3, 0xC50B, 0x9DA4, 0xC50D, + 0x9DA5, 0xC50E, 0x9DA6, 0xC50F, 0x9DA7, 0xC511, 0x9DA8, 0xC512, 0x9DA9, 0xC513, 0x9DAA, 0xC515, 0x9DAB, 0xC516, 0x9DAC, 0xC517, + 0x9DAD, 0xC518, 0x9DAE, 0xC519, 0x9DAF, 0xC51A, 0x9DB0, 0xC51B, 0x9DB1, 0xC51D, 0x9DB2, 0xC51E, 0x9DB3, 0xC51F, 0x9DB4, 0xC520, + 0x9DB5, 0xC521, 0x9DB6, 0xC522, 0x9DB7, 0xC523, 0x9DB8, 0xC524, 0x9DB9, 0xC525, 0x9DBA, 0xC526, 0x9DBB, 0xC527, 0x9DBC, 0xC52A, + 0x9DBD, 0xC52B, 0x9DBE, 0xC52D, 0x9DBF, 0xC52E, 0x9DC0, 0xC52F, 0x9DC1, 0xC531, 0x9DC2, 0xC532, 0x9DC3, 0xC533, 0x9DC4, 0xC534, + 0x9DC5, 0xC535, 0x9DC6, 0xC536, 0x9DC7, 0xC537, 0x9DC8, 0xC53A, 0x9DC9, 0xC53C, 0x9DCA, 0xC53E, 0x9DCB, 0xC53F, 0x9DCC, 0xC540, + 0x9DCD, 0xC541, 0x9DCE, 0xC542, 0x9DCF, 0xC543, 0x9DD0, 0xC546, 0x9DD1, 0xC547, 0x9DD2, 0xC54B, 0x9DD3, 0xC54F, 0x9DD4, 0xC550, + 0x9DD5, 0xC551, 0x9DD6, 0xC552, 0x9DD7, 0xC556, 0x9DD8, 0xC55A, 0x9DD9, 0xC55B, 0x9DDA, 0xC55C, 0x9DDB, 0xC55F, 0x9DDC, 0xC562, + 0x9DDD, 0xC563, 0x9DDE, 0xC565, 0x9DDF, 0xC566, 0x9DE0, 0xC567, 0x9DE1, 0xC569, 0x9DE2, 0xC56A, 0x9DE3, 0xC56B, 0x9DE4, 0xC56C, + 0x9DE5, 0xC56D, 0x9DE6, 0xC56E, 0x9DE7, 0xC56F, 0x9DE8, 0xC572, 0x9DE9, 0xC576, 0x9DEA, 0xC577, 0x9DEB, 0xC578, 0x9DEC, 0xC579, + 0x9DED, 0xC57A, 0x9DEE, 0xC57B, 0x9DEF, 0xC57E, 0x9DF0, 0xC57F, 0x9DF1, 0xC581, 0x9DF2, 0xC582, 0x9DF3, 0xC583, 0x9DF4, 0xC585, + 0x9DF5, 0xC586, 0x9DF6, 0xC588, 0x9DF7, 0xC589, 0x9DF8, 0xC58A, 0x9DF9, 0xC58B, 0x9DFA, 0xC58E, 0x9DFB, 0xC590, 0x9DFC, 0xC592, + 0x9DFD, 0xC593, 0x9DFE, 0xC594, 0x9E41, 0xC596, 0x9E42, 0xC599, 0x9E43, 0xC59A, 0x9E44, 0xC59B, 0x9E45, 0xC59D, 0x9E46, 0xC59E, + 0x9E47, 0xC59F, 0x9E48, 0xC5A1, 0x9E49, 0xC5A2, 0x9E4A, 0xC5A3, 0x9E4B, 0xC5A4, 0x9E4C, 0xC5A5, 0x9E4D, 0xC5A6, 0x9E4E, 0xC5A7, + 0x9E4F, 0xC5A8, 0x9E50, 0xC5AA, 0x9E51, 0xC5AB, 0x9E52, 0xC5AC, 0x9E53, 0xC5AD, 0x9E54, 0xC5AE, 0x9E55, 0xC5AF, 0x9E56, 0xC5B0, + 0x9E57, 0xC5B1, 0x9E58, 0xC5B2, 0x9E59, 0xC5B3, 0x9E5A, 0xC5B6, 0x9E61, 0xC5B7, 0x9E62, 0xC5BA, 0x9E63, 0xC5BF, 0x9E64, 0xC5C0, + 0x9E65, 0xC5C1, 0x9E66, 0xC5C2, 0x9E67, 0xC5C3, 0x9E68, 0xC5CB, 0x9E69, 0xC5CD, 0x9E6A, 0xC5CF, 0x9E6B, 0xC5D2, 0x9E6C, 0xC5D3, + 0x9E6D, 0xC5D5, 0x9E6E, 0xC5D6, 0x9E6F, 0xC5D7, 0x9E70, 0xC5D9, 0x9E71, 0xC5DA, 0x9E72, 0xC5DB, 0x9E73, 0xC5DC, 0x9E74, 0xC5DD, + 0x9E75, 0xC5DE, 0x9E76, 0xC5DF, 0x9E77, 0xC5E2, 0x9E78, 0xC5E4, 0x9E79, 0xC5E6, 0x9E7A, 0xC5E7, 0x9E81, 0xC5E8, 0x9E82, 0xC5E9, + 0x9E83, 0xC5EA, 0x9E84, 0xC5EB, 0x9E85, 0xC5EF, 0x9E86, 0xC5F1, 0x9E87, 0xC5F2, 0x9E88, 0xC5F3, 0x9E89, 0xC5F5, 0x9E8A, 0xC5F8, + 0x9E8B, 0xC5F9, 0x9E8C, 0xC5FA, 0x9E8D, 0xC5FB, 0x9E8E, 0xC602, 0x9E8F, 0xC603, 0x9E90, 0xC604, 0x9E91, 0xC609, 0x9E92, 0xC60A, + 0x9E93, 0xC60B, 0x9E94, 0xC60D, 0x9E95, 0xC60E, 0x9E96, 0xC60F, 0x9E97, 0xC611, 0x9E98, 0xC612, 0x9E99, 0xC613, 0x9E9A, 0xC614, + 0x9E9B, 0xC615, 0x9E9C, 0xC616, 0x9E9D, 0xC617, 0x9E9E, 0xC61A, 0x9E9F, 0xC61D, 0x9EA0, 0xC61E, 0x9EA1, 0xC61F, 0x9EA2, 0xC620, + 0x9EA3, 0xC621, 0x9EA4, 0xC622, 0x9EA5, 0xC623, 0x9EA6, 0xC626, 0x9EA7, 0xC627, 0x9EA8, 0xC629, 0x9EA9, 0xC62A, 0x9EAA, 0xC62B, + 0x9EAB, 0xC62F, 0x9EAC, 0xC631, 0x9EAD, 0xC632, 0x9EAE, 0xC636, 0x9EAF, 0xC638, 0x9EB0, 0xC63A, 0x9EB1, 0xC63C, 0x9EB2, 0xC63D, + 0x9EB3, 0xC63E, 0x9EB4, 0xC63F, 0x9EB5, 0xC642, 0x9EB6, 0xC643, 0x9EB7, 0xC645, 0x9EB8, 0xC646, 0x9EB9, 0xC647, 0x9EBA, 0xC649, + 0x9EBB, 0xC64A, 0x9EBC, 0xC64B, 0x9EBD, 0xC64C, 0x9EBE, 0xC64D, 0x9EBF, 0xC64E, 0x9EC0, 0xC64F, 0x9EC1, 0xC652, 0x9EC2, 0xC656, + 0x9EC3, 0xC657, 0x9EC4, 0xC658, 0x9EC5, 0xC659, 0x9EC6, 0xC65A, 0x9EC7, 0xC65B, 0x9EC8, 0xC65E, 0x9EC9, 0xC65F, 0x9ECA, 0xC661, + 0x9ECB, 0xC662, 0x9ECC, 0xC663, 0x9ECD, 0xC664, 0x9ECE, 0xC665, 0x9ECF, 0xC666, 0x9ED0, 0xC667, 0x9ED1, 0xC668, 0x9ED2, 0xC669, + 0x9ED3, 0xC66A, 0x9ED4, 0xC66B, 0x9ED5, 0xC66D, 0x9ED6, 0xC66E, 0x9ED7, 0xC670, 0x9ED8, 0xC672, 0x9ED9, 0xC673, 0x9EDA, 0xC674, + 0x9EDB, 0xC675, 0x9EDC, 0xC676, 0x9EDD, 0xC677, 0x9EDE, 0xC67A, 0x9EDF, 0xC67B, 0x9EE0, 0xC67D, 0x9EE1, 0xC67E, 0x9EE2, 0xC67F, + 0x9EE3, 0xC681, 0x9EE4, 0xC682, 0x9EE5, 0xC683, 0x9EE6, 0xC684, 0x9EE7, 0xC685, 0x9EE8, 0xC686, 0x9EE9, 0xC687, 0x9EEA, 0xC68A, + 0x9EEB, 0xC68C, 0x9EEC, 0xC68E, 0x9EED, 0xC68F, 0x9EEE, 0xC690, 0x9EEF, 0xC691, 0x9EF0, 0xC692, 0x9EF1, 0xC693, 0x9EF2, 0xC696, + 0x9EF3, 0xC697, 0x9EF4, 0xC699, 0x9EF5, 0xC69A, 0x9EF6, 0xC69B, 0x9EF7, 0xC69D, 0x9EF8, 0xC69E, 0x9EF9, 0xC69F, 0x9EFA, 0xC6A0, + 0x9EFB, 0xC6A1, 0x9EFC, 0xC6A2, 0x9EFD, 0xC6A3, 0x9EFE, 0xC6A6, 0x9F41, 0xC6A8, 0x9F42, 0xC6AA, 0x9F43, 0xC6AB, 0x9F44, 0xC6AC, + 0x9F45, 0xC6AD, 0x9F46, 0xC6AE, 0x9F47, 0xC6AF, 0x9F48, 0xC6B2, 0x9F49, 0xC6B3, 0x9F4A, 0xC6B5, 0x9F4B, 0xC6B6, 0x9F4C, 0xC6B7, + 0x9F4D, 0xC6BB, 0x9F4E, 0xC6BC, 0x9F4F, 0xC6BD, 0x9F50, 0xC6BE, 0x9F51, 0xC6BF, 0x9F52, 0xC6C2, 0x9F53, 0xC6C4, 0x9F54, 0xC6C6, + 0x9F55, 0xC6C7, 0x9F56, 0xC6C8, 0x9F57, 0xC6C9, 0x9F58, 0xC6CA, 0x9F59, 0xC6CB, 0x9F5A, 0xC6CE, 0x9F61, 0xC6CF, 0x9F62, 0xC6D1, + 0x9F63, 0xC6D2, 0x9F64, 0xC6D3, 0x9F65, 0xC6D5, 0x9F66, 0xC6D6, 0x9F67, 0xC6D7, 0x9F68, 0xC6D8, 0x9F69, 0xC6D9, 0x9F6A, 0xC6DA, + 0x9F6B, 0xC6DB, 0x9F6C, 0xC6DE, 0x9F6D, 0xC6DF, 0x9F6E, 0xC6E2, 0x9F6F, 0xC6E3, 0x9F70, 0xC6E4, 0x9F71, 0xC6E5, 0x9F72, 0xC6E6, + 0x9F73, 0xC6E7, 0x9F74, 0xC6EA, 0x9F75, 0xC6EB, 0x9F76, 0xC6ED, 0x9F77, 0xC6EE, 0x9F78, 0xC6EF, 0x9F79, 0xC6F1, 0x9F7A, 0xC6F2, + 0x9F81, 0xC6F3, 0x9F82, 0xC6F4, 0x9F83, 0xC6F5, 0x9F84, 0xC6F6, 0x9F85, 0xC6F7, 0x9F86, 0xC6FA, 0x9F87, 0xC6FB, 0x9F88, 0xC6FC, + 0x9F89, 0xC6FE, 0x9F8A, 0xC6FF, 0x9F8B, 0xC700, 0x9F8C, 0xC701, 0x9F8D, 0xC702, 0x9F8E, 0xC703, 0x9F8F, 0xC706, 0x9F90, 0xC707, + 0x9F91, 0xC709, 0x9F92, 0xC70A, 0x9F93, 0xC70B, 0x9F94, 0xC70D, 0x9F95, 0xC70E, 0x9F96, 0xC70F, 0x9F97, 0xC710, 0x9F98, 0xC711, + 0x9F99, 0xC712, 0x9F9A, 0xC713, 0x9F9B, 0xC716, 0x9F9C, 0xC718, 0x9F9D, 0xC71A, 0x9F9E, 0xC71B, 0x9F9F, 0xC71C, 0x9FA0, 0xC71D, + 0x9FA1, 0xC71E, 0x9FA2, 0xC71F, 0x9FA3, 0xC722, 0x9FA4, 0xC723, 0x9FA5, 0xC725, 0x9FA6, 0xC726, 0x9FA7, 0xC727, 0x9FA8, 0xC729, + 0x9FA9, 0xC72A, 0x9FAA, 0xC72B, 0x9FAB, 0xC72C, 0x9FAC, 0xC72D, 0x9FAD, 0xC72E, 0x9FAE, 0xC72F, 0x9FAF, 0xC732, 0x9FB0, 0xC734, + 0x9FB1, 0xC736, 0x9FB2, 0xC738, 0x9FB3, 0xC739, 0x9FB4, 0xC73A, 0x9FB5, 0xC73B, 0x9FB6, 0xC73E, 0x9FB7, 0xC73F, 0x9FB8, 0xC741, + 0x9FB9, 0xC742, 0x9FBA, 0xC743, 0x9FBB, 0xC745, 0x9FBC, 0xC746, 0x9FBD, 0xC747, 0x9FBE, 0xC748, 0x9FBF, 0xC749, 0x9FC0, 0xC74B, + 0x9FC1, 0xC74E, 0x9FC2, 0xC750, 0x9FC3, 0xC759, 0x9FC4, 0xC75A, 0x9FC5, 0xC75B, 0x9FC6, 0xC75D, 0x9FC7, 0xC75E, 0x9FC8, 0xC75F, + 0x9FC9, 0xC761, 0x9FCA, 0xC762, 0x9FCB, 0xC763, 0x9FCC, 0xC764, 0x9FCD, 0xC765, 0x9FCE, 0xC766, 0x9FCF, 0xC767, 0x9FD0, 0xC769, + 0x9FD1, 0xC76A, 0x9FD2, 0xC76C, 0x9FD3, 0xC76D, 0x9FD4, 0xC76E, 0x9FD5, 0xC76F, 0x9FD6, 0xC770, 0x9FD7, 0xC771, 0x9FD8, 0xC772, + 0x9FD9, 0xC773, 0x9FDA, 0xC776, 0x9FDB, 0xC777, 0x9FDC, 0xC779, 0x9FDD, 0xC77A, 0x9FDE, 0xC77B, 0x9FDF, 0xC77F, 0x9FE0, 0xC780, + 0x9FE1, 0xC781, 0x9FE2, 0xC782, 0x9FE3, 0xC786, 0x9FE4, 0xC78B, 0x9FE5, 0xC78C, 0x9FE6, 0xC78D, 0x9FE7, 0xC78F, 0x9FE8, 0xC792, + 0x9FE9, 0xC793, 0x9FEA, 0xC795, 0x9FEB, 0xC799, 0x9FEC, 0xC79B, 0x9FED, 0xC79C, 0x9FEE, 0xC79D, 0x9FEF, 0xC79E, 0x9FF0, 0xC79F, + 0x9FF1, 0xC7A2, 0x9FF2, 0xC7A7, 0x9FF3, 0xC7A8, 0x9FF4, 0xC7A9, 0x9FF5, 0xC7AA, 0x9FF6, 0xC7AB, 0x9FF7, 0xC7AE, 0x9FF8, 0xC7AF, + 0x9FF9, 0xC7B1, 0x9FFA, 0xC7B2, 0x9FFB, 0xC7B3, 0x9FFC, 0xC7B5, 0x9FFD, 0xC7B6, 0x9FFE, 0xC7B7, 0xA041, 0xC7B8, 0xA042, 0xC7B9, + 0xA043, 0xC7BA, 0xA044, 0xC7BB, 0xA045, 0xC7BE, 0xA046, 0xC7C2, 0xA047, 0xC7C3, 0xA048, 0xC7C4, 0xA049, 0xC7C5, 0xA04A, 0xC7C6, + 0xA04B, 0xC7C7, 0xA04C, 0xC7CA, 0xA04D, 0xC7CB, 0xA04E, 0xC7CD, 0xA04F, 0xC7CF, 0xA050, 0xC7D1, 0xA051, 0xC7D2, 0xA052, 0xC7D3, + 0xA053, 0xC7D4, 0xA054, 0xC7D5, 0xA055, 0xC7D6, 0xA056, 0xC7D7, 0xA057, 0xC7D9, 0xA058, 0xC7DA, 0xA059, 0xC7DB, 0xA05A, 0xC7DC, + 0xA061, 0xC7DE, 0xA062, 0xC7DF, 0xA063, 0xC7E0, 0xA064, 0xC7E1, 0xA065, 0xC7E2, 0xA066, 0xC7E3, 0xA067, 0xC7E5, 0xA068, 0xC7E6, + 0xA069, 0xC7E7, 0xA06A, 0xC7E9, 0xA06B, 0xC7EA, 0xA06C, 0xC7EB, 0xA06D, 0xC7ED, 0xA06E, 0xC7EE, 0xA06F, 0xC7EF, 0xA070, 0xC7F0, + 0xA071, 0xC7F1, 0xA072, 0xC7F2, 0xA073, 0xC7F3, 0xA074, 0xC7F4, 0xA075, 0xC7F5, 0xA076, 0xC7F6, 0xA077, 0xC7F7, 0xA078, 0xC7F8, + 0xA079, 0xC7F9, 0xA07A, 0xC7FA, 0xA081, 0xC7FB, 0xA082, 0xC7FC, 0xA083, 0xC7FD, 0xA084, 0xC7FE, 0xA085, 0xC7FF, 0xA086, 0xC802, + 0xA087, 0xC803, 0xA088, 0xC805, 0xA089, 0xC806, 0xA08A, 0xC807, 0xA08B, 0xC809, 0xA08C, 0xC80B, 0xA08D, 0xC80C, 0xA08E, 0xC80D, + 0xA08F, 0xC80E, 0xA090, 0xC80F, 0xA091, 0xC812, 0xA092, 0xC814, 0xA093, 0xC817, 0xA094, 0xC818, 0xA095, 0xC819, 0xA096, 0xC81A, + 0xA097, 0xC81B, 0xA098, 0xC81E, 0xA099, 0xC81F, 0xA09A, 0xC821, 0xA09B, 0xC822, 0xA09C, 0xC823, 0xA09D, 0xC825, 0xA09E, 0xC826, + 0xA09F, 0xC827, 0xA0A0, 0xC828, 0xA0A1, 0xC829, 0xA0A2, 0xC82A, 0xA0A3, 0xC82B, 0xA0A4, 0xC82E, 0xA0A5, 0xC830, 0xA0A6, 0xC832, + 0xA0A7, 0xC833, 0xA0A8, 0xC834, 0xA0A9, 0xC835, 0xA0AA, 0xC836, 0xA0AB, 0xC837, 0xA0AC, 0xC839, 0xA0AD, 0xC83A, 0xA0AE, 0xC83B, + 0xA0AF, 0xC83D, 0xA0B0, 0xC83E, 0xA0B1, 0xC83F, 0xA0B2, 0xC841, 0xA0B3, 0xC842, 0xA0B4, 0xC843, 0xA0B5, 0xC844, 0xA0B6, 0xC845, + 0xA0B7, 0xC846, 0xA0B8, 0xC847, 0xA0B9, 0xC84A, 0xA0BA, 0xC84B, 0xA0BB, 0xC84E, 0xA0BC, 0xC84F, 0xA0BD, 0xC850, 0xA0BE, 0xC851, + 0xA0BF, 0xC852, 0xA0C0, 0xC853, 0xA0C1, 0xC855, 0xA0C2, 0xC856, 0xA0C3, 0xC857, 0xA0C4, 0xC858, 0xA0C5, 0xC859, 0xA0C6, 0xC85A, + 0xA0C7, 0xC85B, 0xA0C8, 0xC85C, 0xA0C9, 0xC85D, 0xA0CA, 0xC85E, 0xA0CB, 0xC85F, 0xA0CC, 0xC860, 0xA0CD, 0xC861, 0xA0CE, 0xC862, + 0xA0CF, 0xC863, 0xA0D0, 0xC864, 0xA0D1, 0xC865, 0xA0D2, 0xC866, 0xA0D3, 0xC867, 0xA0D4, 0xC868, 0xA0D5, 0xC869, 0xA0D6, 0xC86A, + 0xA0D7, 0xC86B, 0xA0D8, 0xC86C, 0xA0D9, 0xC86D, 0xA0DA, 0xC86E, 0xA0DB, 0xC86F, 0xA0DC, 0xC872, 0xA0DD, 0xC873, 0xA0DE, 0xC875, + 0xA0DF, 0xC876, 0xA0E0, 0xC877, 0xA0E1, 0xC879, 0xA0E2, 0xC87B, 0xA0E3, 0xC87C, 0xA0E4, 0xC87D, 0xA0E5, 0xC87E, 0xA0E6, 0xC87F, + 0xA0E7, 0xC882, 0xA0E8, 0xC884, 0xA0E9, 0xC888, 0xA0EA, 0xC889, 0xA0EB, 0xC88A, 0xA0EC, 0xC88E, 0xA0ED, 0xC88F, 0xA0EE, 0xC890, + 0xA0EF, 0xC891, 0xA0F0, 0xC892, 0xA0F1, 0xC893, 0xA0F2, 0xC895, 0xA0F3, 0xC896, 0xA0F4, 0xC897, 0xA0F5, 0xC898, 0xA0F6, 0xC899, + 0xA0F7, 0xC89A, 0xA0F8, 0xC89B, 0xA0F9, 0xC89C, 0xA0FA, 0xC89E, 0xA0FB, 0xC8A0, 0xA0FC, 0xC8A2, 0xA0FD, 0xC8A3, 0xA0FE, 0xC8A4, + 0xA141, 0xC8A5, 0xA142, 0xC8A6, 0xA143, 0xC8A7, 0xA144, 0xC8A9, 0xA145, 0xC8AA, 0xA146, 0xC8AB, 0xA147, 0xC8AC, 0xA148, 0xC8AD, + 0xA149, 0xC8AE, 0xA14A, 0xC8AF, 0xA14B, 0xC8B0, 0xA14C, 0xC8B1, 0xA14D, 0xC8B2, 0xA14E, 0xC8B3, 0xA14F, 0xC8B4, 0xA150, 0xC8B5, + 0xA151, 0xC8B6, 0xA152, 0xC8B7, 0xA153, 0xC8B8, 0xA154, 0xC8B9, 0xA155, 0xC8BA, 0xA156, 0xC8BB, 0xA157, 0xC8BE, 0xA158, 0xC8BF, + 0xA159, 0xC8C0, 0xA15A, 0xC8C1, 0xA161, 0xC8C2, 0xA162, 0xC8C3, 0xA163, 0xC8C5, 0xA164, 0xC8C6, 0xA165, 0xC8C7, 0xA166, 0xC8C9, + 0xA167, 0xC8CA, 0xA168, 0xC8CB, 0xA169, 0xC8CD, 0xA16A, 0xC8CE, 0xA16B, 0xC8CF, 0xA16C, 0xC8D0, 0xA16D, 0xC8D1, 0xA16E, 0xC8D2, + 0xA16F, 0xC8D3, 0xA170, 0xC8D6, 0xA171, 0xC8D8, 0xA172, 0xC8DA, 0xA173, 0xC8DB, 0xA174, 0xC8DC, 0xA175, 0xC8DD, 0xA176, 0xC8DE, + 0xA177, 0xC8DF, 0xA178, 0xC8E2, 0xA179, 0xC8E3, 0xA17A, 0xC8E5, 0xA181, 0xC8E6, 0xA182, 0xC8E7, 0xA183, 0xC8E8, 0xA184, 0xC8E9, + 0xA185, 0xC8EA, 0xA186, 0xC8EB, 0xA187, 0xC8EC, 0xA188, 0xC8ED, 0xA189, 0xC8EE, 0xA18A, 0xC8EF, 0xA18B, 0xC8F0, 0xA18C, 0xC8F1, + 0xA18D, 0xC8F2, 0xA18E, 0xC8F3, 0xA18F, 0xC8F4, 0xA190, 0xC8F6, 0xA191, 0xC8F7, 0xA192, 0xC8F8, 0xA193, 0xC8F9, 0xA194, 0xC8FA, + 0xA195, 0xC8FB, 0xA196, 0xC8FE, 0xA197, 0xC8FF, 0xA198, 0xC901, 0xA199, 0xC902, 0xA19A, 0xC903, 0xA19B, 0xC907, 0xA19C, 0xC908, + 0xA19D, 0xC909, 0xA19E, 0xC90A, 0xA19F, 0xC90B, 0xA1A0, 0xC90E, 0xA1A1, 0x3000, 0xA1A2, 0x3001, 0xA1A3, 0x3002, 0xA1A4, 0x00B7, + 0xA1A5, 0x2025, 0xA1A6, 0x2026, 0xA1A7, 0x00A8, 0xA1A8, 0x3003, 0xA1A9, 0x00AD, 0xA1AA, 0x2015, 0xA1AB, 0x2225, 0xA1AC, 0xFF3C, + 0xA1AD, 0x223C, 0xA1AE, 0x2018, 0xA1AF, 0x2019, 0xA1B0, 0x201C, 0xA1B1, 0x201D, 0xA1B2, 0x3014, 0xA1B3, 0x3015, 0xA1B4, 0x3008, + 0xA1B5, 0x3009, 0xA1B6, 0x300A, 0xA1B7, 0x300B, 0xA1B8, 0x300C, 0xA1B9, 0x300D, 0xA1BA, 0x300E, 0xA1BB, 0x300F, 0xA1BC, 0x3010, + 0xA1BD, 0x3011, 0xA1BE, 0x00B1, 0xA1BF, 0x00D7, 0xA1C0, 0x00F7, 0xA1C1, 0x2260, 0xA1C2, 0x2264, 0xA1C3, 0x2265, 0xA1C4, 0x221E, + 0xA1C5, 0x2234, 0xA1C6, 0x00B0, 0xA1C7, 0x2032, 0xA1C8, 0x2033, 0xA1C9, 0x2103, 0xA1CA, 0x212B, 0xA1CB, 0xFFE0, 0xA1CC, 0xFFE1, + 0xA1CD, 0xFFE5, 0xA1CE, 0x2642, 0xA1CF, 0x2640, 0xA1D0, 0x2220, 0xA1D1, 0x22A5, 0xA1D2, 0x2312, 0xA1D3, 0x2202, 0xA1D4, 0x2207, + 0xA1D5, 0x2261, 0xA1D6, 0x2252, 0xA1D7, 0x00A7, 0xA1D8, 0x203B, 0xA1D9, 0x2606, 0xA1DA, 0x2605, 0xA1DB, 0x25CB, 0xA1DC, 0x25CF, + 0xA1DD, 0x25CE, 0xA1DE, 0x25C7, 0xA1DF, 0x25C6, 0xA1E0, 0x25A1, 0xA1E1, 0x25A0, 0xA1E2, 0x25B3, 0xA1E3, 0x25B2, 0xA1E4, 0x25BD, + 0xA1E5, 0x25BC, 0xA1E6, 0x2192, 0xA1E7, 0x2190, 0xA1E8, 0x2191, 0xA1E9, 0x2193, 0xA1EA, 0x2194, 0xA1EB, 0x3013, 0xA1EC, 0x226A, + 0xA1ED, 0x226B, 0xA1EE, 0x221A, 0xA1EF, 0x223D, 0xA1F0, 0x221D, 0xA1F1, 0x2235, 0xA1F2, 0x222B, 0xA1F3, 0x222C, 0xA1F4, 0x2208, + 0xA1F5, 0x220B, 0xA1F6, 0x2286, 0xA1F7, 0x2287, 0xA1F8, 0x2282, 0xA1F9, 0x2283, 0xA1FA, 0x222A, 0xA1FB, 0x2229, 0xA1FC, 0x2227, + 0xA1FD, 0x2228, 0xA1FE, 0xFFE2, 0xA241, 0xC910, 0xA242, 0xC912, 0xA243, 0xC913, 0xA244, 0xC914, 0xA245, 0xC915, 0xA246, 0xC916, + 0xA247, 0xC917, 0xA248, 0xC919, 0xA249, 0xC91A, 0xA24A, 0xC91B, 0xA24B, 0xC91C, 0xA24C, 0xC91D, 0xA24D, 0xC91E, 0xA24E, 0xC91F, + 0xA24F, 0xC920, 0xA250, 0xC921, 0xA251, 0xC922, 0xA252, 0xC923, 0xA253, 0xC924, 0xA254, 0xC925, 0xA255, 0xC926, 0xA256, 0xC927, + 0xA257, 0xC928, 0xA258, 0xC929, 0xA259, 0xC92A, 0xA25A, 0xC92B, 0xA261, 0xC92D, 0xA262, 0xC92E, 0xA263, 0xC92F, 0xA264, 0xC930, + 0xA265, 0xC931, 0xA266, 0xC932, 0xA267, 0xC933, 0xA268, 0xC935, 0xA269, 0xC936, 0xA26A, 0xC937, 0xA26B, 0xC938, 0xA26C, 0xC939, + 0xA26D, 0xC93A, 0xA26E, 0xC93B, 0xA26F, 0xC93C, 0xA270, 0xC93D, 0xA271, 0xC93E, 0xA272, 0xC93F, 0xA273, 0xC940, 0xA274, 0xC941, + 0xA275, 0xC942, 0xA276, 0xC943, 0xA277, 0xC944, 0xA278, 0xC945, 0xA279, 0xC946, 0xA27A, 0xC947, 0xA281, 0xC948, 0xA282, 0xC949, + 0xA283, 0xC94A, 0xA284, 0xC94B, 0xA285, 0xC94C, 0xA286, 0xC94D, 0xA287, 0xC94E, 0xA288, 0xC94F, 0xA289, 0xC952, 0xA28A, 0xC953, + 0xA28B, 0xC955, 0xA28C, 0xC956, 0xA28D, 0xC957, 0xA28E, 0xC959, 0xA28F, 0xC95A, 0xA290, 0xC95B, 0xA291, 0xC95C, 0xA292, 0xC95D, + 0xA293, 0xC95E, 0xA294, 0xC95F, 0xA295, 0xC962, 0xA296, 0xC964, 0xA297, 0xC965, 0xA298, 0xC966, 0xA299, 0xC967, 0xA29A, 0xC968, + 0xA29B, 0xC969, 0xA29C, 0xC96A, 0xA29D, 0xC96B, 0xA29E, 0xC96D, 0xA29F, 0xC96E, 0xA2A0, 0xC96F, 0xA2A1, 0x21D2, 0xA2A2, 0x21D4, + 0xA2A3, 0x2200, 0xA2A4, 0x2203, 0xA2A5, 0x00B4, 0xA2A6, 0xFF5E, 0xA2A7, 0x02C7, 0xA2A8, 0x02D8, 0xA2A9, 0x02DD, 0xA2AA, 0x02DA, + 0xA2AB, 0x02D9, 0xA2AC, 0x00B8, 0xA2AD, 0x02DB, 0xA2AE, 0x00A1, 0xA2AF, 0x00BF, 0xA2B0, 0x02D0, 0xA2B1, 0x222E, 0xA2B2, 0x2211, + 0xA2B3, 0x220F, 0xA2B4, 0x00A4, 0xA2B5, 0x2109, 0xA2B6, 0x2030, 0xA2B7, 0x25C1, 0xA2B8, 0x25C0, 0xA2B9, 0x25B7, 0xA2BA, 0x25B6, + 0xA2BB, 0x2664, 0xA2BC, 0x2660, 0xA2BD, 0x2661, 0xA2BE, 0x2665, 0xA2BF, 0x2667, 0xA2C0, 0x2663, 0xA2C1, 0x2299, 0xA2C2, 0x25C8, + 0xA2C3, 0x25A3, 0xA2C4, 0x25D0, 0xA2C5, 0x25D1, 0xA2C6, 0x2592, 0xA2C7, 0x25A4, 0xA2C8, 0x25A5, 0xA2C9, 0x25A8, 0xA2CA, 0x25A7, + 0xA2CB, 0x25A6, 0xA2CC, 0x25A9, 0xA2CD, 0x2668, 0xA2CE, 0x260F, 0xA2CF, 0x260E, 0xA2D0, 0x261C, 0xA2D1, 0x261E, 0xA2D2, 0x00B6, + 0xA2D3, 0x2020, 0xA2D4, 0x2021, 0xA2D5, 0x2195, 0xA2D6, 0x2197, 0xA2D7, 0x2199, 0xA2D8, 0x2196, 0xA2D9, 0x2198, 0xA2DA, 0x266D, + 0xA2DB, 0x2669, 0xA2DC, 0x266A, 0xA2DD, 0x266C, 0xA2DE, 0x327F, 0xA2DF, 0x321C, 0xA2E0, 0x2116, 0xA2E1, 0x33C7, 0xA2E2, 0x2122, + 0xA2E3, 0x33C2, 0xA2E4, 0x33D8, 0xA2E5, 0x2121, 0xA2E6, 0x20AC, 0xA2E7, 0x00AE, 0xA341, 0xC971, 0xA342, 0xC972, 0xA343, 0xC973, + 0xA344, 0xC975, 0xA345, 0xC976, 0xA346, 0xC977, 0xA347, 0xC978, 0xA348, 0xC979, 0xA349, 0xC97A, 0xA34A, 0xC97B, 0xA34B, 0xC97D, + 0xA34C, 0xC97E, 0xA34D, 0xC97F, 0xA34E, 0xC980, 0xA34F, 0xC981, 0xA350, 0xC982, 0xA351, 0xC983, 0xA352, 0xC984, 0xA353, 0xC985, + 0xA354, 0xC986, 0xA355, 0xC987, 0xA356, 0xC98A, 0xA357, 0xC98B, 0xA358, 0xC98D, 0xA359, 0xC98E, 0xA35A, 0xC98F, 0xA361, 0xC991, + 0xA362, 0xC992, 0xA363, 0xC993, 0xA364, 0xC994, 0xA365, 0xC995, 0xA366, 0xC996, 0xA367, 0xC997, 0xA368, 0xC99A, 0xA369, 0xC99C, + 0xA36A, 0xC99E, 0xA36B, 0xC99F, 0xA36C, 0xC9A0, 0xA36D, 0xC9A1, 0xA36E, 0xC9A2, 0xA36F, 0xC9A3, 0xA370, 0xC9A4, 0xA371, 0xC9A5, + 0xA372, 0xC9A6, 0xA373, 0xC9A7, 0xA374, 0xC9A8, 0xA375, 0xC9A9, 0xA376, 0xC9AA, 0xA377, 0xC9AB, 0xA378, 0xC9AC, 0xA379, 0xC9AD, + 0xA37A, 0xC9AE, 0xA381, 0xC9AF, 0xA382, 0xC9B0, 0xA383, 0xC9B1, 0xA384, 0xC9B2, 0xA385, 0xC9B3, 0xA386, 0xC9B4, 0xA387, 0xC9B5, + 0xA388, 0xC9B6, 0xA389, 0xC9B7, 0xA38A, 0xC9B8, 0xA38B, 0xC9B9, 0xA38C, 0xC9BA, 0xA38D, 0xC9BB, 0xA38E, 0xC9BC, 0xA38F, 0xC9BD, + 0xA390, 0xC9BE, 0xA391, 0xC9BF, 0xA392, 0xC9C2, 0xA393, 0xC9C3, 0xA394, 0xC9C5, 0xA395, 0xC9C6, 0xA396, 0xC9C9, 0xA397, 0xC9CB, + 0xA398, 0xC9CC, 0xA399, 0xC9CD, 0xA39A, 0xC9CE, 0xA39B, 0xC9CF, 0xA39C, 0xC9D2, 0xA39D, 0xC9D4, 0xA39E, 0xC9D7, 0xA39F, 0xC9D8, + 0xA3A0, 0xC9DB, 0xA3A1, 0xFF01, 0xA3A2, 0xFF02, 0xA3A3, 0xFF03, 0xA3A4, 0xFF04, 0xA3A5, 0xFF05, 0xA3A6, 0xFF06, 0xA3A7, 0xFF07, + 0xA3A8, 0xFF08, 0xA3A9, 0xFF09, 0xA3AA, 0xFF0A, 0xA3AB, 0xFF0B, 0xA3AC, 0xFF0C, 0xA3AD, 0xFF0D, 0xA3AE, 0xFF0E, 0xA3AF, 0xFF0F, + 0xA3B0, 0xFF10, 0xA3B1, 0xFF11, 0xA3B2, 0xFF12, 0xA3B3, 0xFF13, 0xA3B4, 0xFF14, 0xA3B5, 0xFF15, 0xA3B6, 0xFF16, 0xA3B7, 0xFF17, + 0xA3B8, 0xFF18, 0xA3B9, 0xFF19, 0xA3BA, 0xFF1A, 0xA3BB, 0xFF1B, 0xA3BC, 0xFF1C, 0xA3BD, 0xFF1D, 0xA3BE, 0xFF1E, 0xA3BF, 0xFF1F, + 0xA3C0, 0xFF20, 0xA3C1, 0xFF21, 0xA3C2, 0xFF22, 0xA3C3, 0xFF23, 0xA3C4, 0xFF24, 0xA3C5, 0xFF25, 0xA3C6, 0xFF26, 0xA3C7, 0xFF27, + 0xA3C8, 0xFF28, 0xA3C9, 0xFF29, 0xA3CA, 0xFF2A, 0xA3CB, 0xFF2B, 0xA3CC, 0xFF2C, 0xA3CD, 0xFF2D, 0xA3CE, 0xFF2E, 0xA3CF, 0xFF2F, + 0xA3D0, 0xFF30, 0xA3D1, 0xFF31, 0xA3D2, 0xFF32, 0xA3D3, 0xFF33, 0xA3D4, 0xFF34, 0xA3D5, 0xFF35, 0xA3D6, 0xFF36, 0xA3D7, 0xFF37, + 0xA3D8, 0xFF38, 0xA3D9, 0xFF39, 0xA3DA, 0xFF3A, 0xA3DB, 0xFF3B, 0xA3DC, 0xFFE6, 0xA3DD, 0xFF3D, 0xA3DE, 0xFF3E, 0xA3DF, 0xFF3F, + 0xA3E0, 0xFF40, 0xA3E1, 0xFF41, 0xA3E2, 0xFF42, 0xA3E3, 0xFF43, 0xA3E4, 0xFF44, 0xA3E5, 0xFF45, 0xA3E6, 0xFF46, 0xA3E7, 0xFF47, + 0xA3E8, 0xFF48, 0xA3E9, 0xFF49, 0xA3EA, 0xFF4A, 0xA3EB, 0xFF4B, 0xA3EC, 0xFF4C, 0xA3ED, 0xFF4D, 0xA3EE, 0xFF4E, 0xA3EF, 0xFF4F, + 0xA3F0, 0xFF50, 0xA3F1, 0xFF51, 0xA3F2, 0xFF52, 0xA3F3, 0xFF53, 0xA3F4, 0xFF54, 0xA3F5, 0xFF55, 0xA3F6, 0xFF56, 0xA3F7, 0xFF57, + 0xA3F8, 0xFF58, 0xA3F9, 0xFF59, 0xA3FA, 0xFF5A, 0xA3FB, 0xFF5B, 0xA3FC, 0xFF5C, 0xA3FD, 0xFF5D, 0xA3FE, 0xFFE3, 0xA441, 0xC9DE, + 0xA442, 0xC9DF, 0xA443, 0xC9E1, 0xA444, 0xC9E3, 0xA445, 0xC9E5, 0xA446, 0xC9E6, 0xA447, 0xC9E8, 0xA448, 0xC9E9, 0xA449, 0xC9EA, + 0xA44A, 0xC9EB, 0xA44B, 0xC9EE, 0xA44C, 0xC9F2, 0xA44D, 0xC9F3, 0xA44E, 0xC9F4, 0xA44F, 0xC9F5, 0xA450, 0xC9F6, 0xA451, 0xC9F7, + 0xA452, 0xC9FA, 0xA453, 0xC9FB, 0xA454, 0xC9FD, 0xA455, 0xC9FE, 0xA456, 0xC9FF, 0xA457, 0xCA01, 0xA458, 0xCA02, 0xA459, 0xCA03, + 0xA45A, 0xCA04, 0xA461, 0xCA05, 0xA462, 0xCA06, 0xA463, 0xCA07, 0xA464, 0xCA0A, 0xA465, 0xCA0E, 0xA466, 0xCA0F, 0xA467, 0xCA10, + 0xA468, 0xCA11, 0xA469, 0xCA12, 0xA46A, 0xCA13, 0xA46B, 0xCA15, 0xA46C, 0xCA16, 0xA46D, 0xCA17, 0xA46E, 0xCA19, 0xA46F, 0xCA1A, + 0xA470, 0xCA1B, 0xA471, 0xCA1C, 0xA472, 0xCA1D, 0xA473, 0xCA1E, 0xA474, 0xCA1F, 0xA475, 0xCA20, 0xA476, 0xCA21, 0xA477, 0xCA22, + 0xA478, 0xCA23, 0xA479, 0xCA24, 0xA47A, 0xCA25, 0xA481, 0xCA26, 0xA482, 0xCA27, 0xA483, 0xCA28, 0xA484, 0xCA2A, 0xA485, 0xCA2B, + 0xA486, 0xCA2C, 0xA487, 0xCA2D, 0xA488, 0xCA2E, 0xA489, 0xCA2F, 0xA48A, 0xCA30, 0xA48B, 0xCA31, 0xA48C, 0xCA32, 0xA48D, 0xCA33, + 0xA48E, 0xCA34, 0xA48F, 0xCA35, 0xA490, 0xCA36, 0xA491, 0xCA37, 0xA492, 0xCA38, 0xA493, 0xCA39, 0xA494, 0xCA3A, 0xA495, 0xCA3B, + 0xA496, 0xCA3C, 0xA497, 0xCA3D, 0xA498, 0xCA3E, 0xA499, 0xCA3F, 0xA49A, 0xCA40, 0xA49B, 0xCA41, 0xA49C, 0xCA42, 0xA49D, 0xCA43, + 0xA49E, 0xCA44, 0xA49F, 0xCA45, 0xA4A0, 0xCA46, 0xA4A1, 0x3131, 0xA4A2, 0x3132, 0xA4A3, 0x3133, 0xA4A4, 0x3134, 0xA4A5, 0x3135, + 0xA4A6, 0x3136, 0xA4A7, 0x3137, 0xA4A8, 0x3138, 0xA4A9, 0x3139, 0xA4AA, 0x313A, 0xA4AB, 0x313B, 0xA4AC, 0x313C, 0xA4AD, 0x313D, + 0xA4AE, 0x313E, 0xA4AF, 0x313F, 0xA4B0, 0x3140, 0xA4B1, 0x3141, 0xA4B2, 0x3142, 0xA4B3, 0x3143, 0xA4B4, 0x3144, 0xA4B5, 0x3145, + 0xA4B6, 0x3146, 0xA4B7, 0x3147, 0xA4B8, 0x3148, 0xA4B9, 0x3149, 0xA4BA, 0x314A, 0xA4BB, 0x314B, 0xA4BC, 0x314C, 0xA4BD, 0x314D, + 0xA4BE, 0x314E, 0xA4BF, 0x314F, 0xA4C0, 0x3150, 0xA4C1, 0x3151, 0xA4C2, 0x3152, 0xA4C3, 0x3153, 0xA4C4, 0x3154, 0xA4C5, 0x3155, + 0xA4C6, 0x3156, 0xA4C7, 0x3157, 0xA4C8, 0x3158, 0xA4C9, 0x3159, 0xA4CA, 0x315A, 0xA4CB, 0x315B, 0xA4CC, 0x315C, 0xA4CD, 0x315D, + 0xA4CE, 0x315E, 0xA4CF, 0x315F, 0xA4D0, 0x3160, 0xA4D1, 0x3161, 0xA4D2, 0x3162, 0xA4D3, 0x3163, 0xA4D4, 0x3164, 0xA4D5, 0x3165, + 0xA4D6, 0x3166, 0xA4D7, 0x3167, 0xA4D8, 0x3168, 0xA4D9, 0x3169, 0xA4DA, 0x316A, 0xA4DB, 0x316B, 0xA4DC, 0x316C, 0xA4DD, 0x316D, + 0xA4DE, 0x316E, 0xA4DF, 0x316F, 0xA4E0, 0x3170, 0xA4E1, 0x3171, 0xA4E2, 0x3172, 0xA4E3, 0x3173, 0xA4E4, 0x3174, 0xA4E5, 0x3175, + 0xA4E6, 0x3176, 0xA4E7, 0x3177, 0xA4E8, 0x3178, 0xA4E9, 0x3179, 0xA4EA, 0x317A, 0xA4EB, 0x317B, 0xA4EC, 0x317C, 0xA4ED, 0x317D, + 0xA4EE, 0x317E, 0xA4EF, 0x317F, 0xA4F0, 0x3180, 0xA4F1, 0x3181, 0xA4F2, 0x3182, 0xA4F3, 0x3183, 0xA4F4, 0x3184, 0xA4F5, 0x3185, + 0xA4F6, 0x3186, 0xA4F7, 0x3187, 0xA4F8, 0x3188, 0xA4F9, 0x3189, 0xA4FA, 0x318A, 0xA4FB, 0x318B, 0xA4FC, 0x318C, 0xA4FD, 0x318D, + 0xA4FE, 0x318E, 0xA541, 0xCA47, 0xA542, 0xCA48, 0xA543, 0xCA49, 0xA544, 0xCA4A, 0xA545, 0xCA4B, 0xA546, 0xCA4E, 0xA547, 0xCA4F, + 0xA548, 0xCA51, 0xA549, 0xCA52, 0xA54A, 0xCA53, 0xA54B, 0xCA55, 0xA54C, 0xCA56, 0xA54D, 0xCA57, 0xA54E, 0xCA58, 0xA54F, 0xCA59, + 0xA550, 0xCA5A, 0xA551, 0xCA5B, 0xA552, 0xCA5E, 0xA553, 0xCA62, 0xA554, 0xCA63, 0xA555, 0xCA64, 0xA556, 0xCA65, 0xA557, 0xCA66, + 0xA558, 0xCA67, 0xA559, 0xCA69, 0xA55A, 0xCA6A, 0xA561, 0xCA6B, 0xA562, 0xCA6C, 0xA563, 0xCA6D, 0xA564, 0xCA6E, 0xA565, 0xCA6F, + 0xA566, 0xCA70, 0xA567, 0xCA71, 0xA568, 0xCA72, 0xA569, 0xCA73, 0xA56A, 0xCA74, 0xA56B, 0xCA75, 0xA56C, 0xCA76, 0xA56D, 0xCA77, + 0xA56E, 0xCA78, 0xA56F, 0xCA79, 0xA570, 0xCA7A, 0xA571, 0xCA7B, 0xA572, 0xCA7C, 0xA573, 0xCA7E, 0xA574, 0xCA7F, 0xA575, 0xCA80, + 0xA576, 0xCA81, 0xA577, 0xCA82, 0xA578, 0xCA83, 0xA579, 0xCA85, 0xA57A, 0xCA86, 0xA581, 0xCA87, 0xA582, 0xCA88, 0xA583, 0xCA89, + 0xA584, 0xCA8A, 0xA585, 0xCA8B, 0xA586, 0xCA8C, 0xA587, 0xCA8D, 0xA588, 0xCA8E, 0xA589, 0xCA8F, 0xA58A, 0xCA90, 0xA58B, 0xCA91, + 0xA58C, 0xCA92, 0xA58D, 0xCA93, 0xA58E, 0xCA94, 0xA58F, 0xCA95, 0xA590, 0xCA96, 0xA591, 0xCA97, 0xA592, 0xCA99, 0xA593, 0xCA9A, + 0xA594, 0xCA9B, 0xA595, 0xCA9C, 0xA596, 0xCA9D, 0xA597, 0xCA9E, 0xA598, 0xCA9F, 0xA599, 0xCAA0, 0xA59A, 0xCAA1, 0xA59B, 0xCAA2, + 0xA59C, 0xCAA3, 0xA59D, 0xCAA4, 0xA59E, 0xCAA5, 0xA59F, 0xCAA6, 0xA5A0, 0xCAA7, 0xA5A1, 0x2170, 0xA5A2, 0x2171, 0xA5A3, 0x2172, + 0xA5A4, 0x2173, 0xA5A5, 0x2174, 0xA5A6, 0x2175, 0xA5A7, 0x2176, 0xA5A8, 0x2177, 0xA5A9, 0x2178, 0xA5AA, 0x2179, 0xA5B0, 0x2160, + 0xA5B1, 0x2161, 0xA5B2, 0x2162, 0xA5B3, 0x2163, 0xA5B4, 0x2164, 0xA5B5, 0x2165, 0xA5B6, 0x2166, 0xA5B7, 0x2167, 0xA5B8, 0x2168, + 0xA5B9, 0x2169, 0xA5C1, 0x0391, 0xA5C2, 0x0392, 0xA5C3, 0x0393, 0xA5C4, 0x0394, 0xA5C5, 0x0395, 0xA5C6, 0x0396, 0xA5C7, 0x0397, + 0xA5C8, 0x0398, 0xA5C9, 0x0399, 0xA5CA, 0x039A, 0xA5CB, 0x039B, 0xA5CC, 0x039C, 0xA5CD, 0x039D, 0xA5CE, 0x039E, 0xA5CF, 0x039F, + 0xA5D0, 0x03A0, 0xA5D1, 0x03A1, 0xA5D2, 0x03A3, 0xA5D3, 0x03A4, 0xA5D4, 0x03A5, 0xA5D5, 0x03A6, 0xA5D6, 0x03A7, 0xA5D7, 0x03A8, + 0xA5D8, 0x03A9, 0xA5E1, 0x03B1, 0xA5E2, 0x03B2, 0xA5E3, 0x03B3, 0xA5E4, 0x03B4, 0xA5E5, 0x03B5, 0xA5E6, 0x03B6, 0xA5E7, 0x03B7, + 0xA5E8, 0x03B8, 0xA5E9, 0x03B9, 0xA5EA, 0x03BA, 0xA5EB, 0x03BB, 0xA5EC, 0x03BC, 0xA5ED, 0x03BD, 0xA5EE, 0x03BE, 0xA5EF, 0x03BF, + 0xA5F0, 0x03C0, 0xA5F1, 0x03C1, 0xA5F2, 0x03C3, 0xA5F3, 0x03C4, 0xA5F4, 0x03C5, 0xA5F5, 0x03C6, 0xA5F6, 0x03C7, 0xA5F7, 0x03C8, + 0xA5F8, 0x03C9, 0xA641, 0xCAA8, 0xA642, 0xCAA9, 0xA643, 0xCAAA, 0xA644, 0xCAAB, 0xA645, 0xCAAC, 0xA646, 0xCAAD, 0xA647, 0xCAAE, + 0xA648, 0xCAAF, 0xA649, 0xCAB0, 0xA64A, 0xCAB1, 0xA64B, 0xCAB2, 0xA64C, 0xCAB3, 0xA64D, 0xCAB4, 0xA64E, 0xCAB5, 0xA64F, 0xCAB6, + 0xA650, 0xCAB7, 0xA651, 0xCAB8, 0xA652, 0xCAB9, 0xA653, 0xCABA, 0xA654, 0xCABB, 0xA655, 0xCABE, 0xA656, 0xCABF, 0xA657, 0xCAC1, + 0xA658, 0xCAC2, 0xA659, 0xCAC3, 0xA65A, 0xCAC5, 0xA661, 0xCAC6, 0xA662, 0xCAC7, 0xA663, 0xCAC8, 0xA664, 0xCAC9, 0xA665, 0xCACA, + 0xA666, 0xCACB, 0xA667, 0xCACE, 0xA668, 0xCAD0, 0xA669, 0xCAD2, 0xA66A, 0xCAD4, 0xA66B, 0xCAD5, 0xA66C, 0xCAD6, 0xA66D, 0xCAD7, + 0xA66E, 0xCADA, 0xA66F, 0xCADB, 0xA670, 0xCADC, 0xA671, 0xCADD, 0xA672, 0xCADE, 0xA673, 0xCADF, 0xA674, 0xCAE1, 0xA675, 0xCAE2, + 0xA676, 0xCAE3, 0xA677, 0xCAE4, 0xA678, 0xCAE5, 0xA679, 0xCAE6, 0xA67A, 0xCAE7, 0xA681, 0xCAE8, 0xA682, 0xCAE9, 0xA683, 0xCAEA, + 0xA684, 0xCAEB, 0xA685, 0xCAED, 0xA686, 0xCAEE, 0xA687, 0xCAEF, 0xA688, 0xCAF0, 0xA689, 0xCAF1, 0xA68A, 0xCAF2, 0xA68B, 0xCAF3, + 0xA68C, 0xCAF5, 0xA68D, 0xCAF6, 0xA68E, 0xCAF7, 0xA68F, 0xCAF8, 0xA690, 0xCAF9, 0xA691, 0xCAFA, 0xA692, 0xCAFB, 0xA693, 0xCAFC, + 0xA694, 0xCAFD, 0xA695, 0xCAFE, 0xA696, 0xCAFF, 0xA697, 0xCB00, 0xA698, 0xCB01, 0xA699, 0xCB02, 0xA69A, 0xCB03, 0xA69B, 0xCB04, + 0xA69C, 0xCB05, 0xA69D, 0xCB06, 0xA69E, 0xCB07, 0xA69F, 0xCB09, 0xA6A0, 0xCB0A, 0xA6A1, 0x2500, 0xA6A2, 0x2502, 0xA6A3, 0x250C, + 0xA6A4, 0x2510, 0xA6A5, 0x2518, 0xA6A6, 0x2514, 0xA6A7, 0x251C, 0xA6A8, 0x252C, 0xA6A9, 0x2524, 0xA6AA, 0x2534, 0xA6AB, 0x253C, + 0xA6AC, 0x2501, 0xA6AD, 0x2503, 0xA6AE, 0x250F, 0xA6AF, 0x2513, 0xA6B0, 0x251B, 0xA6B1, 0x2517, 0xA6B2, 0x2523, 0xA6B3, 0x2533, + 0xA6B4, 0x252B, 0xA6B5, 0x253B, 0xA6B6, 0x254B, 0xA6B7, 0x2520, 0xA6B8, 0x252F, 0xA6B9, 0x2528, 0xA6BA, 0x2537, 0xA6BB, 0x253F, + 0xA6BC, 0x251D, 0xA6BD, 0x2530, 0xA6BE, 0x2525, 0xA6BF, 0x2538, 0xA6C0, 0x2542, 0xA6C1, 0x2512, 0xA6C2, 0x2511, 0xA6C3, 0x251A, + 0xA6C4, 0x2519, 0xA6C5, 0x2516, 0xA6C6, 0x2515, 0xA6C7, 0x250E, 0xA6C8, 0x250D, 0xA6C9, 0x251E, 0xA6CA, 0x251F, 0xA6CB, 0x2521, + 0xA6CC, 0x2522, 0xA6CD, 0x2526, 0xA6CE, 0x2527, 0xA6CF, 0x2529, 0xA6D0, 0x252A, 0xA6D1, 0x252D, 0xA6D2, 0x252E, 0xA6D3, 0x2531, + 0xA6D4, 0x2532, 0xA6D5, 0x2535, 0xA6D6, 0x2536, 0xA6D7, 0x2539, 0xA6D8, 0x253A, 0xA6D9, 0x253D, 0xA6DA, 0x253E, 0xA6DB, 0x2540, + 0xA6DC, 0x2541, 0xA6DD, 0x2543, 0xA6DE, 0x2544, 0xA6DF, 0x2545, 0xA6E0, 0x2546, 0xA6E1, 0x2547, 0xA6E2, 0x2548, 0xA6E3, 0x2549, + 0xA6E4, 0x254A, 0xA741, 0xCB0B, 0xA742, 0xCB0C, 0xA743, 0xCB0D, 0xA744, 0xCB0E, 0xA745, 0xCB0F, 0xA746, 0xCB11, 0xA747, 0xCB12, + 0xA748, 0xCB13, 0xA749, 0xCB15, 0xA74A, 0xCB16, 0xA74B, 0xCB17, 0xA74C, 0xCB19, 0xA74D, 0xCB1A, 0xA74E, 0xCB1B, 0xA74F, 0xCB1C, + 0xA750, 0xCB1D, 0xA751, 0xCB1E, 0xA752, 0xCB1F, 0xA753, 0xCB22, 0xA754, 0xCB23, 0xA755, 0xCB24, 0xA756, 0xCB25, 0xA757, 0xCB26, + 0xA758, 0xCB27, 0xA759, 0xCB28, 0xA75A, 0xCB29, 0xA761, 0xCB2A, 0xA762, 0xCB2B, 0xA763, 0xCB2C, 0xA764, 0xCB2D, 0xA765, 0xCB2E, + 0xA766, 0xCB2F, 0xA767, 0xCB30, 0xA768, 0xCB31, 0xA769, 0xCB32, 0xA76A, 0xCB33, 0xA76B, 0xCB34, 0xA76C, 0xCB35, 0xA76D, 0xCB36, + 0xA76E, 0xCB37, 0xA76F, 0xCB38, 0xA770, 0xCB39, 0xA771, 0xCB3A, 0xA772, 0xCB3B, 0xA773, 0xCB3C, 0xA774, 0xCB3D, 0xA775, 0xCB3E, + 0xA776, 0xCB3F, 0xA777, 0xCB40, 0xA778, 0xCB42, 0xA779, 0xCB43, 0xA77A, 0xCB44, 0xA781, 0xCB45, 0xA782, 0xCB46, 0xA783, 0xCB47, + 0xA784, 0xCB4A, 0xA785, 0xCB4B, 0xA786, 0xCB4D, 0xA787, 0xCB4E, 0xA788, 0xCB4F, 0xA789, 0xCB51, 0xA78A, 0xCB52, 0xA78B, 0xCB53, + 0xA78C, 0xCB54, 0xA78D, 0xCB55, 0xA78E, 0xCB56, 0xA78F, 0xCB57, 0xA790, 0xCB5A, 0xA791, 0xCB5B, 0xA792, 0xCB5C, 0xA793, 0xCB5E, + 0xA794, 0xCB5F, 0xA795, 0xCB60, 0xA796, 0xCB61, 0xA797, 0xCB62, 0xA798, 0xCB63, 0xA799, 0xCB65, 0xA79A, 0xCB66, 0xA79B, 0xCB67, + 0xA79C, 0xCB68, 0xA79D, 0xCB69, 0xA79E, 0xCB6A, 0xA79F, 0xCB6B, 0xA7A0, 0xCB6C, 0xA7A1, 0x3395, 0xA7A2, 0x3396, 0xA7A3, 0x3397, + 0xA7A4, 0x2113, 0xA7A5, 0x3398, 0xA7A6, 0x33C4, 0xA7A7, 0x33A3, 0xA7A8, 0x33A4, 0xA7A9, 0x33A5, 0xA7AA, 0x33A6, 0xA7AB, 0x3399, + 0xA7AC, 0x339A, 0xA7AD, 0x339B, 0xA7AE, 0x339C, 0xA7AF, 0x339D, 0xA7B0, 0x339E, 0xA7B1, 0x339F, 0xA7B2, 0x33A0, 0xA7B3, 0x33A1, + 0xA7B4, 0x33A2, 0xA7B5, 0x33CA, 0xA7B6, 0x338D, 0xA7B7, 0x338E, 0xA7B8, 0x338F, 0xA7B9, 0x33CF, 0xA7BA, 0x3388, 0xA7BB, 0x3389, + 0xA7BC, 0x33C8, 0xA7BD, 0x33A7, 0xA7BE, 0x33A8, 0xA7BF, 0x33B0, 0xA7C0, 0x33B1, 0xA7C1, 0x33B2, 0xA7C2, 0x33B3, 0xA7C3, 0x33B4, + 0xA7C4, 0x33B5, 0xA7C5, 0x33B6, 0xA7C6, 0x33B7, 0xA7C7, 0x33B8, 0xA7C8, 0x33B9, 0xA7C9, 0x3380, 0xA7CA, 0x3381, 0xA7CB, 0x3382, + 0xA7CC, 0x3383, 0xA7CD, 0x3384, 0xA7CE, 0x33BA, 0xA7CF, 0x33BB, 0xA7D0, 0x33BC, 0xA7D1, 0x33BD, 0xA7D2, 0x33BE, 0xA7D3, 0x33BF, + 0xA7D4, 0x3390, 0xA7D5, 0x3391, 0xA7D6, 0x3392, 0xA7D7, 0x3393, 0xA7D8, 0x3394, 0xA7D9, 0x2126, 0xA7DA, 0x33C0, 0xA7DB, 0x33C1, + 0xA7DC, 0x338A, 0xA7DD, 0x338B, 0xA7DE, 0x338C, 0xA7DF, 0x33D6, 0xA7E0, 0x33C5, 0xA7E1, 0x33AD, 0xA7E2, 0x33AE, 0xA7E3, 0x33AF, + 0xA7E4, 0x33DB, 0xA7E5, 0x33A9, 0xA7E6, 0x33AA, 0xA7E7, 0x33AB, 0xA7E8, 0x33AC, 0xA7E9, 0x33DD, 0xA7EA, 0x33D0, 0xA7EB, 0x33D3, + 0xA7EC, 0x33C3, 0xA7ED, 0x33C9, 0xA7EE, 0x33DC, 0xA7EF, 0x33C6, 0xA841, 0xCB6D, 0xA842, 0xCB6E, 0xA843, 0xCB6F, 0xA844, 0xCB70, + 0xA845, 0xCB71, 0xA846, 0xCB72, 0xA847, 0xCB73, 0xA848, 0xCB74, 0xA849, 0xCB75, 0xA84A, 0xCB76, 0xA84B, 0xCB77, 0xA84C, 0xCB7A, + 0xA84D, 0xCB7B, 0xA84E, 0xCB7C, 0xA84F, 0xCB7D, 0xA850, 0xCB7E, 0xA851, 0xCB7F, 0xA852, 0xCB80, 0xA853, 0xCB81, 0xA854, 0xCB82, + 0xA855, 0xCB83, 0xA856, 0xCB84, 0xA857, 0xCB85, 0xA858, 0xCB86, 0xA859, 0xCB87, 0xA85A, 0xCB88, 0xA861, 0xCB89, 0xA862, 0xCB8A, + 0xA863, 0xCB8B, 0xA864, 0xCB8C, 0xA865, 0xCB8D, 0xA866, 0xCB8E, 0xA867, 0xCB8F, 0xA868, 0xCB90, 0xA869, 0xCB91, 0xA86A, 0xCB92, + 0xA86B, 0xCB93, 0xA86C, 0xCB94, 0xA86D, 0xCB95, 0xA86E, 0xCB96, 0xA86F, 0xCB97, 0xA870, 0xCB98, 0xA871, 0xCB99, 0xA872, 0xCB9A, + 0xA873, 0xCB9B, 0xA874, 0xCB9D, 0xA875, 0xCB9E, 0xA876, 0xCB9F, 0xA877, 0xCBA0, 0xA878, 0xCBA1, 0xA879, 0xCBA2, 0xA87A, 0xCBA3, + 0xA881, 0xCBA4, 0xA882, 0xCBA5, 0xA883, 0xCBA6, 0xA884, 0xCBA7, 0xA885, 0xCBA8, 0xA886, 0xCBA9, 0xA887, 0xCBAA, 0xA888, 0xCBAB, + 0xA889, 0xCBAC, 0xA88A, 0xCBAD, 0xA88B, 0xCBAE, 0xA88C, 0xCBAF, 0xA88D, 0xCBB0, 0xA88E, 0xCBB1, 0xA88F, 0xCBB2, 0xA890, 0xCBB3, + 0xA891, 0xCBB4, 0xA892, 0xCBB5, 0xA893, 0xCBB6, 0xA894, 0xCBB7, 0xA895, 0xCBB9, 0xA896, 0xCBBA, 0xA897, 0xCBBB, 0xA898, 0xCBBC, + 0xA899, 0xCBBD, 0xA89A, 0xCBBE, 0xA89B, 0xCBBF, 0xA89C, 0xCBC0, 0xA89D, 0xCBC1, 0xA89E, 0xCBC2, 0xA89F, 0xCBC3, 0xA8A0, 0xCBC4, + 0xA8A1, 0x00C6, 0xA8A2, 0x00D0, 0xA8A3, 0x00AA, 0xA8A4, 0x0126, 0xA8A6, 0x0132, 0xA8A8, 0x013F, 0xA8A9, 0x0141, 0xA8AA, 0x00D8, + 0xA8AB, 0x0152, 0xA8AC, 0x00BA, 0xA8AD, 0x00DE, 0xA8AE, 0x0166, 0xA8AF, 0x014A, 0xA8B1, 0x3260, 0xA8B2, 0x3261, 0xA8B3, 0x3262, + 0xA8B4, 0x3263, 0xA8B5, 0x3264, 0xA8B6, 0x3265, 0xA8B7, 0x3266, 0xA8B8, 0x3267, 0xA8B9, 0x3268, 0xA8BA, 0x3269, 0xA8BB, 0x326A, + 0xA8BC, 0x326B, 0xA8BD, 0x326C, 0xA8BE, 0x326D, 0xA8BF, 0x326E, 0xA8C0, 0x326F, 0xA8C1, 0x3270, 0xA8C2, 0x3271, 0xA8C3, 0x3272, + 0xA8C4, 0x3273, 0xA8C5, 0x3274, 0xA8C6, 0x3275, 0xA8C7, 0x3276, 0xA8C8, 0x3277, 0xA8C9, 0x3278, 0xA8CA, 0x3279, 0xA8CB, 0x327A, + 0xA8CC, 0x327B, 0xA8CD, 0x24D0, 0xA8CE, 0x24D1, 0xA8CF, 0x24D2, 0xA8D0, 0x24D3, 0xA8D1, 0x24D4, 0xA8D2, 0x24D5, 0xA8D3, 0x24D6, + 0xA8D4, 0x24D7, 0xA8D5, 0x24D8, 0xA8D6, 0x24D9, 0xA8D7, 0x24DA, 0xA8D8, 0x24DB, 0xA8D9, 0x24DC, 0xA8DA, 0x24DD, 0xA8DB, 0x24DE, + 0xA8DC, 0x24DF, 0xA8DD, 0x24E0, 0xA8DE, 0x24E1, 0xA8DF, 0x24E2, 0xA8E0, 0x24E3, 0xA8E1, 0x24E4, 0xA8E2, 0x24E5, 0xA8E3, 0x24E6, + 0xA8E4, 0x24E7, 0xA8E5, 0x24E8, 0xA8E6, 0x24E9, 0xA8E7, 0x2460, 0xA8E8, 0x2461, 0xA8E9, 0x2462, 0xA8EA, 0x2463, 0xA8EB, 0x2464, + 0xA8EC, 0x2465, 0xA8ED, 0x2466, 0xA8EE, 0x2467, 0xA8EF, 0x2468, 0xA8F0, 0x2469, 0xA8F1, 0x246A, 0xA8F2, 0x246B, 0xA8F3, 0x246C, + 0xA8F4, 0x246D, 0xA8F5, 0x246E, 0xA8F6, 0x00BD, 0xA8F7, 0x2153, 0xA8F8, 0x2154, 0xA8F9, 0x00BC, 0xA8FA, 0x00BE, 0xA8FB, 0x215B, + 0xA8FC, 0x215C, 0xA8FD, 0x215D, 0xA8FE, 0x215E, 0xA941, 0xCBC5, 0xA942, 0xCBC6, 0xA943, 0xCBC7, 0xA944, 0xCBC8, 0xA945, 0xCBC9, + 0xA946, 0xCBCA, 0xA947, 0xCBCB, 0xA948, 0xCBCC, 0xA949, 0xCBCD, 0xA94A, 0xCBCE, 0xA94B, 0xCBCF, 0xA94C, 0xCBD0, 0xA94D, 0xCBD1, + 0xA94E, 0xCBD2, 0xA94F, 0xCBD3, 0xA950, 0xCBD5, 0xA951, 0xCBD6, 0xA952, 0xCBD7, 0xA953, 0xCBD8, 0xA954, 0xCBD9, 0xA955, 0xCBDA, + 0xA956, 0xCBDB, 0xA957, 0xCBDC, 0xA958, 0xCBDD, 0xA959, 0xCBDE, 0xA95A, 0xCBDF, 0xA961, 0xCBE0, 0xA962, 0xCBE1, 0xA963, 0xCBE2, + 0xA964, 0xCBE3, 0xA965, 0xCBE5, 0xA966, 0xCBE6, 0xA967, 0xCBE8, 0xA968, 0xCBEA, 0xA969, 0xCBEB, 0xA96A, 0xCBEC, 0xA96B, 0xCBED, + 0xA96C, 0xCBEE, 0xA96D, 0xCBEF, 0xA96E, 0xCBF0, 0xA96F, 0xCBF1, 0xA970, 0xCBF2, 0xA971, 0xCBF3, 0xA972, 0xCBF4, 0xA973, 0xCBF5, + 0xA974, 0xCBF6, 0xA975, 0xCBF7, 0xA976, 0xCBF8, 0xA977, 0xCBF9, 0xA978, 0xCBFA, 0xA979, 0xCBFB, 0xA97A, 0xCBFC, 0xA981, 0xCBFD, + 0xA982, 0xCBFE, 0xA983, 0xCBFF, 0xA984, 0xCC00, 0xA985, 0xCC01, 0xA986, 0xCC02, 0xA987, 0xCC03, 0xA988, 0xCC04, 0xA989, 0xCC05, + 0xA98A, 0xCC06, 0xA98B, 0xCC07, 0xA98C, 0xCC08, 0xA98D, 0xCC09, 0xA98E, 0xCC0A, 0xA98F, 0xCC0B, 0xA990, 0xCC0E, 0xA991, 0xCC0F, + 0xA992, 0xCC11, 0xA993, 0xCC12, 0xA994, 0xCC13, 0xA995, 0xCC15, 0xA996, 0xCC16, 0xA997, 0xCC17, 0xA998, 0xCC18, 0xA999, 0xCC19, + 0xA99A, 0xCC1A, 0xA99B, 0xCC1B, 0xA99C, 0xCC1E, 0xA99D, 0xCC1F, 0xA99E, 0xCC20, 0xA99F, 0xCC23, 0xA9A0, 0xCC24, 0xA9A1, 0x00E6, + 0xA9A2, 0x0111, 0xA9A3, 0x00F0, 0xA9A4, 0x0127, 0xA9A5, 0x0131, 0xA9A6, 0x0133, 0xA9A7, 0x0138, 0xA9A8, 0x0140, 0xA9A9, 0x0142, + 0xA9AA, 0x00F8, 0xA9AB, 0x0153, 0xA9AC, 0x00DF, 0xA9AD, 0x00FE, 0xA9AE, 0x0167, 0xA9AF, 0x014B, 0xA9B0, 0x0149, 0xA9B1, 0x3200, + 0xA9B2, 0x3201, 0xA9B3, 0x3202, 0xA9B4, 0x3203, 0xA9B5, 0x3204, 0xA9B6, 0x3205, 0xA9B7, 0x3206, 0xA9B8, 0x3207, 0xA9B9, 0x3208, + 0xA9BA, 0x3209, 0xA9BB, 0x320A, 0xA9BC, 0x320B, 0xA9BD, 0x320C, 0xA9BE, 0x320D, 0xA9BF, 0x320E, 0xA9C0, 0x320F, 0xA9C1, 0x3210, + 0xA9C2, 0x3211, 0xA9C3, 0x3212, 0xA9C4, 0x3213, 0xA9C5, 0x3214, 0xA9C6, 0x3215, 0xA9C7, 0x3216, 0xA9C8, 0x3217, 0xA9C9, 0x3218, + 0xA9CA, 0x3219, 0xA9CB, 0x321A, 0xA9CC, 0x321B, 0xA9CD, 0x249C, 0xA9CE, 0x249D, 0xA9CF, 0x249E, 0xA9D0, 0x249F, 0xA9D1, 0x24A0, + 0xA9D2, 0x24A1, 0xA9D3, 0x24A2, 0xA9D4, 0x24A3, 0xA9D5, 0x24A4, 0xA9D6, 0x24A5, 0xA9D7, 0x24A6, 0xA9D8, 0x24A7, 0xA9D9, 0x24A8, + 0xA9DA, 0x24A9, 0xA9DB, 0x24AA, 0xA9DC, 0x24AB, 0xA9DD, 0x24AC, 0xA9DE, 0x24AD, 0xA9DF, 0x24AE, 0xA9E0, 0x24AF, 0xA9E1, 0x24B0, + 0xA9E2, 0x24B1, 0xA9E3, 0x24B2, 0xA9E4, 0x24B3, 0xA9E5, 0x24B4, 0xA9E6, 0x24B5, 0xA9E7, 0x2474, 0xA9E8, 0x2475, 0xA9E9, 0x2476, + 0xA9EA, 0x2477, 0xA9EB, 0x2478, 0xA9EC, 0x2479, 0xA9ED, 0x247A, 0xA9EE, 0x247B, 0xA9EF, 0x247C, 0xA9F0, 0x247D, 0xA9F1, 0x247E, + 0xA9F2, 0x247F, 0xA9F3, 0x2480, 0xA9F4, 0x2481, 0xA9F5, 0x2482, 0xA9F6, 0x00B9, 0xA9F7, 0x00B2, 0xA9F8, 0x00B3, 0xA9F9, 0x2074, + 0xA9FA, 0x207F, 0xA9FB, 0x2081, 0xA9FC, 0x2082, 0xA9FD, 0x2083, 0xA9FE, 0x2084, 0xAA41, 0xCC25, 0xAA42, 0xCC26, 0xAA43, 0xCC2A, + 0xAA44, 0xCC2B, 0xAA45, 0xCC2D, 0xAA46, 0xCC2F, 0xAA47, 0xCC31, 0xAA48, 0xCC32, 0xAA49, 0xCC33, 0xAA4A, 0xCC34, 0xAA4B, 0xCC35, + 0xAA4C, 0xCC36, 0xAA4D, 0xCC37, 0xAA4E, 0xCC3A, 0xAA4F, 0xCC3F, 0xAA50, 0xCC40, 0xAA51, 0xCC41, 0xAA52, 0xCC42, 0xAA53, 0xCC43, + 0xAA54, 0xCC46, 0xAA55, 0xCC47, 0xAA56, 0xCC49, 0xAA57, 0xCC4A, 0xAA58, 0xCC4B, 0xAA59, 0xCC4D, 0xAA5A, 0xCC4E, 0xAA61, 0xCC4F, + 0xAA62, 0xCC50, 0xAA63, 0xCC51, 0xAA64, 0xCC52, 0xAA65, 0xCC53, 0xAA66, 0xCC56, 0xAA67, 0xCC5A, 0xAA68, 0xCC5B, 0xAA69, 0xCC5C, + 0xAA6A, 0xCC5D, 0xAA6B, 0xCC5E, 0xAA6C, 0xCC5F, 0xAA6D, 0xCC61, 0xAA6E, 0xCC62, 0xAA6F, 0xCC63, 0xAA70, 0xCC65, 0xAA71, 0xCC67, + 0xAA72, 0xCC69, 0xAA73, 0xCC6A, 0xAA74, 0xCC6B, 0xAA75, 0xCC6C, 0xAA76, 0xCC6D, 0xAA77, 0xCC6E, 0xAA78, 0xCC6F, 0xAA79, 0xCC71, + 0xAA7A, 0xCC72, 0xAA81, 0xCC73, 0xAA82, 0xCC74, 0xAA83, 0xCC76, 0xAA84, 0xCC77, 0xAA85, 0xCC78, 0xAA86, 0xCC79, 0xAA87, 0xCC7A, + 0xAA88, 0xCC7B, 0xAA89, 0xCC7C, 0xAA8A, 0xCC7D, 0xAA8B, 0xCC7E, 0xAA8C, 0xCC7F, 0xAA8D, 0xCC80, 0xAA8E, 0xCC81, 0xAA8F, 0xCC82, + 0xAA90, 0xCC83, 0xAA91, 0xCC84, 0xAA92, 0xCC85, 0xAA93, 0xCC86, 0xAA94, 0xCC87, 0xAA95, 0xCC88, 0xAA96, 0xCC89, 0xAA97, 0xCC8A, + 0xAA98, 0xCC8B, 0xAA99, 0xCC8C, 0xAA9A, 0xCC8D, 0xAA9B, 0xCC8E, 0xAA9C, 0xCC8F, 0xAA9D, 0xCC90, 0xAA9E, 0xCC91, 0xAA9F, 0xCC92, + 0xAAA0, 0xCC93, 0xAAA1, 0x3041, 0xAAA2, 0x3042, 0xAAA3, 0x3043, 0xAAA4, 0x3044, 0xAAA5, 0x3045, 0xAAA6, 0x3046, 0xAAA7, 0x3047, + 0xAAA8, 0x3048, 0xAAA9, 0x3049, 0xAAAA, 0x304A, 0xAAAB, 0x304B, 0xAAAC, 0x304C, 0xAAAD, 0x304D, 0xAAAE, 0x304E, 0xAAAF, 0x304F, + 0xAAB0, 0x3050, 0xAAB1, 0x3051, 0xAAB2, 0x3052, 0xAAB3, 0x3053, 0xAAB4, 0x3054, 0xAAB5, 0x3055, 0xAAB6, 0x3056, 0xAAB7, 0x3057, + 0xAAB8, 0x3058, 0xAAB9, 0x3059, 0xAABA, 0x305A, 0xAABB, 0x305B, 0xAABC, 0x305C, 0xAABD, 0x305D, 0xAABE, 0x305E, 0xAABF, 0x305F, + 0xAAC0, 0x3060, 0xAAC1, 0x3061, 0xAAC2, 0x3062, 0xAAC3, 0x3063, 0xAAC4, 0x3064, 0xAAC5, 0x3065, 0xAAC6, 0x3066, 0xAAC7, 0x3067, + 0xAAC8, 0x3068, 0xAAC9, 0x3069, 0xAACA, 0x306A, 0xAACB, 0x306B, 0xAACC, 0x306C, 0xAACD, 0x306D, 0xAACE, 0x306E, 0xAACF, 0x306F, + 0xAAD0, 0x3070, 0xAAD1, 0x3071, 0xAAD2, 0x3072, 0xAAD3, 0x3073, 0xAAD4, 0x3074, 0xAAD5, 0x3075, 0xAAD6, 0x3076, 0xAAD7, 0x3077, + 0xAAD8, 0x3078, 0xAAD9, 0x3079, 0xAADA, 0x307A, 0xAADB, 0x307B, 0xAADC, 0x307C, 0xAADD, 0x307D, 0xAADE, 0x307E, 0xAADF, 0x307F, + 0xAAE0, 0x3080, 0xAAE1, 0x3081, 0xAAE2, 0x3082, 0xAAE3, 0x3083, 0xAAE4, 0x3084, 0xAAE5, 0x3085, 0xAAE6, 0x3086, 0xAAE7, 0x3087, + 0xAAE8, 0x3088, 0xAAE9, 0x3089, 0xAAEA, 0x308A, 0xAAEB, 0x308B, 0xAAEC, 0x308C, 0xAAED, 0x308D, 0xAAEE, 0x308E, 0xAAEF, 0x308F, + 0xAAF0, 0x3090, 0xAAF1, 0x3091, 0xAAF2, 0x3092, 0xAAF3, 0x3093, 0xAB41, 0xCC94, 0xAB42, 0xCC95, 0xAB43, 0xCC96, 0xAB44, 0xCC97, + 0xAB45, 0xCC9A, 0xAB46, 0xCC9B, 0xAB47, 0xCC9D, 0xAB48, 0xCC9E, 0xAB49, 0xCC9F, 0xAB4A, 0xCCA1, 0xAB4B, 0xCCA2, 0xAB4C, 0xCCA3, + 0xAB4D, 0xCCA4, 0xAB4E, 0xCCA5, 0xAB4F, 0xCCA6, 0xAB50, 0xCCA7, 0xAB51, 0xCCAA, 0xAB52, 0xCCAE, 0xAB53, 0xCCAF, 0xAB54, 0xCCB0, + 0xAB55, 0xCCB1, 0xAB56, 0xCCB2, 0xAB57, 0xCCB3, 0xAB58, 0xCCB6, 0xAB59, 0xCCB7, 0xAB5A, 0xCCB9, 0xAB61, 0xCCBA, 0xAB62, 0xCCBB, + 0xAB63, 0xCCBD, 0xAB64, 0xCCBE, 0xAB65, 0xCCBF, 0xAB66, 0xCCC0, 0xAB67, 0xCCC1, 0xAB68, 0xCCC2, 0xAB69, 0xCCC3, 0xAB6A, 0xCCC6, + 0xAB6B, 0xCCC8, 0xAB6C, 0xCCCA, 0xAB6D, 0xCCCB, 0xAB6E, 0xCCCC, 0xAB6F, 0xCCCD, 0xAB70, 0xCCCE, 0xAB71, 0xCCCF, 0xAB72, 0xCCD1, + 0xAB73, 0xCCD2, 0xAB74, 0xCCD3, 0xAB75, 0xCCD5, 0xAB76, 0xCCD6, 0xAB77, 0xCCD7, 0xAB78, 0xCCD8, 0xAB79, 0xCCD9, 0xAB7A, 0xCCDA, + 0xAB81, 0xCCDB, 0xAB82, 0xCCDC, 0xAB83, 0xCCDD, 0xAB84, 0xCCDE, 0xAB85, 0xCCDF, 0xAB86, 0xCCE0, 0xAB87, 0xCCE1, 0xAB88, 0xCCE2, + 0xAB89, 0xCCE3, 0xAB8A, 0xCCE5, 0xAB8B, 0xCCE6, 0xAB8C, 0xCCE7, 0xAB8D, 0xCCE8, 0xAB8E, 0xCCE9, 0xAB8F, 0xCCEA, 0xAB90, 0xCCEB, + 0xAB91, 0xCCED, 0xAB92, 0xCCEE, 0xAB93, 0xCCEF, 0xAB94, 0xCCF1, 0xAB95, 0xCCF2, 0xAB96, 0xCCF3, 0xAB97, 0xCCF4, 0xAB98, 0xCCF5, + 0xAB99, 0xCCF6, 0xAB9A, 0xCCF7, 0xAB9B, 0xCCF8, 0xAB9C, 0xCCF9, 0xAB9D, 0xCCFA, 0xAB9E, 0xCCFB, 0xAB9F, 0xCCFC, 0xABA0, 0xCCFD, + 0xABA1, 0x30A1, 0xABA2, 0x30A2, 0xABA3, 0x30A3, 0xABA4, 0x30A4, 0xABA5, 0x30A5, 0xABA6, 0x30A6, 0xABA7, 0x30A7, 0xABA8, 0x30A8, + 0xABA9, 0x30A9, 0xABAA, 0x30AA, 0xABAB, 0x30AB, 0xABAC, 0x30AC, 0xABAD, 0x30AD, 0xABAE, 0x30AE, 0xABAF, 0x30AF, 0xABB0, 0x30B0, + 0xABB1, 0x30B1, 0xABB2, 0x30B2, 0xABB3, 0x30B3, 0xABB4, 0x30B4, 0xABB5, 0x30B5, 0xABB6, 0x30B6, 0xABB7, 0x30B7, 0xABB8, 0x30B8, + 0xABB9, 0x30B9, 0xABBA, 0x30BA, 0xABBB, 0x30BB, 0xABBC, 0x30BC, 0xABBD, 0x30BD, 0xABBE, 0x30BE, 0xABBF, 0x30BF, 0xABC0, 0x30C0, + 0xABC1, 0x30C1, 0xABC2, 0x30C2, 0xABC3, 0x30C3, 0xABC4, 0x30C4, 0xABC5, 0x30C5, 0xABC6, 0x30C6, 0xABC7, 0x30C7, 0xABC8, 0x30C8, + 0xABC9, 0x30C9, 0xABCA, 0x30CA, 0xABCB, 0x30CB, 0xABCC, 0x30CC, 0xABCD, 0x30CD, 0xABCE, 0x30CE, 0xABCF, 0x30CF, 0xABD0, 0x30D0, + 0xABD1, 0x30D1, 0xABD2, 0x30D2, 0xABD3, 0x30D3, 0xABD4, 0x30D4, 0xABD5, 0x30D5, 0xABD6, 0x30D6, 0xABD7, 0x30D7, 0xABD8, 0x30D8, + 0xABD9, 0x30D9, 0xABDA, 0x30DA, 0xABDB, 0x30DB, 0xABDC, 0x30DC, 0xABDD, 0x30DD, 0xABDE, 0x30DE, 0xABDF, 0x30DF, 0xABE0, 0x30E0, + 0xABE1, 0x30E1, 0xABE2, 0x30E2, 0xABE3, 0x30E3, 0xABE4, 0x30E4, 0xABE5, 0x30E5, 0xABE6, 0x30E6, 0xABE7, 0x30E7, 0xABE8, 0x30E8, + 0xABE9, 0x30E9, 0xABEA, 0x30EA, 0xABEB, 0x30EB, 0xABEC, 0x30EC, 0xABED, 0x30ED, 0xABEE, 0x30EE, 0xABEF, 0x30EF, 0xABF0, 0x30F0, + 0xABF1, 0x30F1, 0xABF2, 0x30F2, 0xABF3, 0x30F3, 0xABF4, 0x30F4, 0xABF5, 0x30F5, 0xABF6, 0x30F6, 0xAC41, 0xCCFE, 0xAC42, 0xCCFF, + 0xAC43, 0xCD00, 0xAC44, 0xCD02, 0xAC45, 0xCD03, 0xAC46, 0xCD04, 0xAC47, 0xCD05, 0xAC48, 0xCD06, 0xAC49, 0xCD07, 0xAC4A, 0xCD0A, + 0xAC4B, 0xCD0B, 0xAC4C, 0xCD0D, 0xAC4D, 0xCD0E, 0xAC4E, 0xCD0F, 0xAC4F, 0xCD11, 0xAC50, 0xCD12, 0xAC51, 0xCD13, 0xAC52, 0xCD14, + 0xAC53, 0xCD15, 0xAC54, 0xCD16, 0xAC55, 0xCD17, 0xAC56, 0xCD1A, 0xAC57, 0xCD1C, 0xAC58, 0xCD1E, 0xAC59, 0xCD1F, 0xAC5A, 0xCD20, + 0xAC61, 0xCD21, 0xAC62, 0xCD22, 0xAC63, 0xCD23, 0xAC64, 0xCD25, 0xAC65, 0xCD26, 0xAC66, 0xCD27, 0xAC67, 0xCD29, 0xAC68, 0xCD2A, + 0xAC69, 0xCD2B, 0xAC6A, 0xCD2D, 0xAC6B, 0xCD2E, 0xAC6C, 0xCD2F, 0xAC6D, 0xCD30, 0xAC6E, 0xCD31, 0xAC6F, 0xCD32, 0xAC70, 0xCD33, + 0xAC71, 0xCD34, 0xAC72, 0xCD35, 0xAC73, 0xCD36, 0xAC74, 0xCD37, 0xAC75, 0xCD38, 0xAC76, 0xCD3A, 0xAC77, 0xCD3B, 0xAC78, 0xCD3C, + 0xAC79, 0xCD3D, 0xAC7A, 0xCD3E, 0xAC81, 0xCD3F, 0xAC82, 0xCD40, 0xAC83, 0xCD41, 0xAC84, 0xCD42, 0xAC85, 0xCD43, 0xAC86, 0xCD44, + 0xAC87, 0xCD45, 0xAC88, 0xCD46, 0xAC89, 0xCD47, 0xAC8A, 0xCD48, 0xAC8B, 0xCD49, 0xAC8C, 0xCD4A, 0xAC8D, 0xCD4B, 0xAC8E, 0xCD4C, + 0xAC8F, 0xCD4D, 0xAC90, 0xCD4E, 0xAC91, 0xCD4F, 0xAC92, 0xCD50, 0xAC93, 0xCD51, 0xAC94, 0xCD52, 0xAC95, 0xCD53, 0xAC96, 0xCD54, + 0xAC97, 0xCD55, 0xAC98, 0xCD56, 0xAC99, 0xCD57, 0xAC9A, 0xCD58, 0xAC9B, 0xCD59, 0xAC9C, 0xCD5A, 0xAC9D, 0xCD5B, 0xAC9E, 0xCD5D, + 0xAC9F, 0xCD5E, 0xACA0, 0xCD5F, 0xACA1, 0x0410, 0xACA2, 0x0411, 0xACA3, 0x0412, 0xACA4, 0x0413, 0xACA5, 0x0414, 0xACA6, 0x0415, + 0xACA7, 0x0401, 0xACA8, 0x0416, 0xACA9, 0x0417, 0xACAA, 0x0418, 0xACAB, 0x0419, 0xACAC, 0x041A, 0xACAD, 0x041B, 0xACAE, 0x041C, + 0xACAF, 0x041D, 0xACB0, 0x041E, 0xACB1, 0x041F, 0xACB2, 0x0420, 0xACB3, 0x0421, 0xACB4, 0x0422, 0xACB5, 0x0423, 0xACB6, 0x0424, + 0xACB7, 0x0425, 0xACB8, 0x0426, 0xACB9, 0x0427, 0xACBA, 0x0428, 0xACBB, 0x0429, 0xACBC, 0x042A, 0xACBD, 0x042B, 0xACBE, 0x042C, + 0xACBF, 0x042D, 0xACC0, 0x042E, 0xACC1, 0x042F, 0xACD1, 0x0430, 0xACD2, 0x0431, 0xACD3, 0x0432, 0xACD4, 0x0433, 0xACD5, 0x0434, + 0xACD6, 0x0435, 0xACD7, 0x0451, 0xACD8, 0x0436, 0xACD9, 0x0437, 0xACDA, 0x0438, 0xACDB, 0x0439, 0xACDC, 0x043A, 0xACDD, 0x043B, + 0xACDE, 0x043C, 0xACDF, 0x043D, 0xACE0, 0x043E, 0xACE1, 0x043F, 0xACE2, 0x0440, 0xACE3, 0x0441, 0xACE4, 0x0442, 0xACE5, 0x0443, + 0xACE6, 0x0444, 0xACE7, 0x0445, 0xACE8, 0x0446, 0xACE9, 0x0447, 0xACEA, 0x0448, 0xACEB, 0x0449, 0xACEC, 0x044A, 0xACED, 0x044B, + 0xACEE, 0x044C, 0xACEF, 0x044D, 0xACF0, 0x044E, 0xACF1, 0x044F, 0xAD41, 0xCD61, 0xAD42, 0xCD62, 0xAD43, 0xCD63, 0xAD44, 0xCD65, + 0xAD45, 0xCD66, 0xAD46, 0xCD67, 0xAD47, 0xCD68, 0xAD48, 0xCD69, 0xAD49, 0xCD6A, 0xAD4A, 0xCD6B, 0xAD4B, 0xCD6E, 0xAD4C, 0xCD70, + 0xAD4D, 0xCD72, 0xAD4E, 0xCD73, 0xAD4F, 0xCD74, 0xAD50, 0xCD75, 0xAD51, 0xCD76, 0xAD52, 0xCD77, 0xAD53, 0xCD79, 0xAD54, 0xCD7A, + 0xAD55, 0xCD7B, 0xAD56, 0xCD7C, 0xAD57, 0xCD7D, 0xAD58, 0xCD7E, 0xAD59, 0xCD7F, 0xAD5A, 0xCD80, 0xAD61, 0xCD81, 0xAD62, 0xCD82, + 0xAD63, 0xCD83, 0xAD64, 0xCD84, 0xAD65, 0xCD85, 0xAD66, 0xCD86, 0xAD67, 0xCD87, 0xAD68, 0xCD89, 0xAD69, 0xCD8A, 0xAD6A, 0xCD8B, + 0xAD6B, 0xCD8C, 0xAD6C, 0xCD8D, 0xAD6D, 0xCD8E, 0xAD6E, 0xCD8F, 0xAD6F, 0xCD90, 0xAD70, 0xCD91, 0xAD71, 0xCD92, 0xAD72, 0xCD93, + 0xAD73, 0xCD96, 0xAD74, 0xCD97, 0xAD75, 0xCD99, 0xAD76, 0xCD9A, 0xAD77, 0xCD9B, 0xAD78, 0xCD9D, 0xAD79, 0xCD9E, 0xAD7A, 0xCD9F, + 0xAD81, 0xCDA0, 0xAD82, 0xCDA1, 0xAD83, 0xCDA2, 0xAD84, 0xCDA3, 0xAD85, 0xCDA6, 0xAD86, 0xCDA8, 0xAD87, 0xCDAA, 0xAD88, 0xCDAB, + 0xAD89, 0xCDAC, 0xAD8A, 0xCDAD, 0xAD8B, 0xCDAE, 0xAD8C, 0xCDAF, 0xAD8D, 0xCDB1, 0xAD8E, 0xCDB2, 0xAD8F, 0xCDB3, 0xAD90, 0xCDB4, + 0xAD91, 0xCDB5, 0xAD92, 0xCDB6, 0xAD93, 0xCDB7, 0xAD94, 0xCDB8, 0xAD95, 0xCDB9, 0xAD96, 0xCDBA, 0xAD97, 0xCDBB, 0xAD98, 0xCDBC, + 0xAD99, 0xCDBD, 0xAD9A, 0xCDBE, 0xAD9B, 0xCDBF, 0xAD9C, 0xCDC0, 0xAD9D, 0xCDC1, 0xAD9E, 0xCDC2, 0xAD9F, 0xCDC3, 0xADA0, 0xCDC5, + 0xAE41, 0xCDC6, 0xAE42, 0xCDC7, 0xAE43, 0xCDC8, 0xAE44, 0xCDC9, 0xAE45, 0xCDCA, 0xAE46, 0xCDCB, 0xAE47, 0xCDCD, 0xAE48, 0xCDCE, + 0xAE49, 0xCDCF, 0xAE4A, 0xCDD1, 0xAE4B, 0xCDD2, 0xAE4C, 0xCDD3, 0xAE4D, 0xCDD4, 0xAE4E, 0xCDD5, 0xAE4F, 0xCDD6, 0xAE50, 0xCDD7, + 0xAE51, 0xCDD8, 0xAE52, 0xCDD9, 0xAE53, 0xCDDA, 0xAE54, 0xCDDB, 0xAE55, 0xCDDC, 0xAE56, 0xCDDD, 0xAE57, 0xCDDE, 0xAE58, 0xCDDF, + 0xAE59, 0xCDE0, 0xAE5A, 0xCDE1, 0xAE61, 0xCDE2, 0xAE62, 0xCDE3, 0xAE63, 0xCDE4, 0xAE64, 0xCDE5, 0xAE65, 0xCDE6, 0xAE66, 0xCDE7, + 0xAE67, 0xCDE9, 0xAE68, 0xCDEA, 0xAE69, 0xCDEB, 0xAE6A, 0xCDED, 0xAE6B, 0xCDEE, 0xAE6C, 0xCDEF, 0xAE6D, 0xCDF1, 0xAE6E, 0xCDF2, + 0xAE6F, 0xCDF3, 0xAE70, 0xCDF4, 0xAE71, 0xCDF5, 0xAE72, 0xCDF6, 0xAE73, 0xCDF7, 0xAE74, 0xCDFA, 0xAE75, 0xCDFC, 0xAE76, 0xCDFE, + 0xAE77, 0xCDFF, 0xAE78, 0xCE00, 0xAE79, 0xCE01, 0xAE7A, 0xCE02, 0xAE81, 0xCE03, 0xAE82, 0xCE05, 0xAE83, 0xCE06, 0xAE84, 0xCE07, + 0xAE85, 0xCE09, 0xAE86, 0xCE0A, 0xAE87, 0xCE0B, 0xAE88, 0xCE0D, 0xAE89, 0xCE0E, 0xAE8A, 0xCE0F, 0xAE8B, 0xCE10, 0xAE8C, 0xCE11, + 0xAE8D, 0xCE12, 0xAE8E, 0xCE13, 0xAE8F, 0xCE15, 0xAE90, 0xCE16, 0xAE91, 0xCE17, 0xAE92, 0xCE18, 0xAE93, 0xCE1A, 0xAE94, 0xCE1B, + 0xAE95, 0xCE1C, 0xAE96, 0xCE1D, 0xAE97, 0xCE1E, 0xAE98, 0xCE1F, 0xAE99, 0xCE22, 0xAE9A, 0xCE23, 0xAE9B, 0xCE25, 0xAE9C, 0xCE26, + 0xAE9D, 0xCE27, 0xAE9E, 0xCE29, 0xAE9F, 0xCE2A, 0xAEA0, 0xCE2B, 0xAF41, 0xCE2C, 0xAF42, 0xCE2D, 0xAF43, 0xCE2E, 0xAF44, 0xCE2F, + 0xAF45, 0xCE32, 0xAF46, 0xCE34, 0xAF47, 0xCE36, 0xAF48, 0xCE37, 0xAF49, 0xCE38, 0xAF4A, 0xCE39, 0xAF4B, 0xCE3A, 0xAF4C, 0xCE3B, + 0xAF4D, 0xCE3C, 0xAF4E, 0xCE3D, 0xAF4F, 0xCE3E, 0xAF50, 0xCE3F, 0xAF51, 0xCE40, 0xAF52, 0xCE41, 0xAF53, 0xCE42, 0xAF54, 0xCE43, + 0xAF55, 0xCE44, 0xAF56, 0xCE45, 0xAF57, 0xCE46, 0xAF58, 0xCE47, 0xAF59, 0xCE48, 0xAF5A, 0xCE49, 0xAF61, 0xCE4A, 0xAF62, 0xCE4B, + 0xAF63, 0xCE4C, 0xAF64, 0xCE4D, 0xAF65, 0xCE4E, 0xAF66, 0xCE4F, 0xAF67, 0xCE50, 0xAF68, 0xCE51, 0xAF69, 0xCE52, 0xAF6A, 0xCE53, + 0xAF6B, 0xCE54, 0xAF6C, 0xCE55, 0xAF6D, 0xCE56, 0xAF6E, 0xCE57, 0xAF6F, 0xCE5A, 0xAF70, 0xCE5B, 0xAF71, 0xCE5D, 0xAF72, 0xCE5E, + 0xAF73, 0xCE62, 0xAF74, 0xCE63, 0xAF75, 0xCE64, 0xAF76, 0xCE65, 0xAF77, 0xCE66, 0xAF78, 0xCE67, 0xAF79, 0xCE6A, 0xAF7A, 0xCE6C, + 0xAF81, 0xCE6E, 0xAF82, 0xCE6F, 0xAF83, 0xCE70, 0xAF84, 0xCE71, 0xAF85, 0xCE72, 0xAF86, 0xCE73, 0xAF87, 0xCE76, 0xAF88, 0xCE77, + 0xAF89, 0xCE79, 0xAF8A, 0xCE7A, 0xAF8B, 0xCE7B, 0xAF8C, 0xCE7D, 0xAF8D, 0xCE7E, 0xAF8E, 0xCE7F, 0xAF8F, 0xCE80, 0xAF90, 0xCE81, + 0xAF91, 0xCE82, 0xAF92, 0xCE83, 0xAF93, 0xCE86, 0xAF94, 0xCE88, 0xAF95, 0xCE8A, 0xAF96, 0xCE8B, 0xAF97, 0xCE8C, 0xAF98, 0xCE8D, + 0xAF99, 0xCE8E, 0xAF9A, 0xCE8F, 0xAF9B, 0xCE92, 0xAF9C, 0xCE93, 0xAF9D, 0xCE95, 0xAF9E, 0xCE96, 0xAF9F, 0xCE97, 0xAFA0, 0xCE99, + 0xB041, 0xCE9A, 0xB042, 0xCE9B, 0xB043, 0xCE9C, 0xB044, 0xCE9D, 0xB045, 0xCE9E, 0xB046, 0xCE9F, 0xB047, 0xCEA2, 0xB048, 0xCEA6, + 0xB049, 0xCEA7, 0xB04A, 0xCEA8, 0xB04B, 0xCEA9, 0xB04C, 0xCEAA, 0xB04D, 0xCEAB, 0xB04E, 0xCEAE, 0xB04F, 0xCEAF, 0xB050, 0xCEB0, + 0xB051, 0xCEB1, 0xB052, 0xCEB2, 0xB053, 0xCEB3, 0xB054, 0xCEB4, 0xB055, 0xCEB5, 0xB056, 0xCEB6, 0xB057, 0xCEB7, 0xB058, 0xCEB8, + 0xB059, 0xCEB9, 0xB05A, 0xCEBA, 0xB061, 0xCEBB, 0xB062, 0xCEBC, 0xB063, 0xCEBD, 0xB064, 0xCEBE, 0xB065, 0xCEBF, 0xB066, 0xCEC0, + 0xB067, 0xCEC2, 0xB068, 0xCEC3, 0xB069, 0xCEC4, 0xB06A, 0xCEC5, 0xB06B, 0xCEC6, 0xB06C, 0xCEC7, 0xB06D, 0xCEC8, 0xB06E, 0xCEC9, + 0xB06F, 0xCECA, 0xB070, 0xCECB, 0xB071, 0xCECC, 0xB072, 0xCECD, 0xB073, 0xCECE, 0xB074, 0xCECF, 0xB075, 0xCED0, 0xB076, 0xCED1, + 0xB077, 0xCED2, 0xB078, 0xCED3, 0xB079, 0xCED4, 0xB07A, 0xCED5, 0xB081, 0xCED6, 0xB082, 0xCED7, 0xB083, 0xCED8, 0xB084, 0xCED9, + 0xB085, 0xCEDA, 0xB086, 0xCEDB, 0xB087, 0xCEDC, 0xB088, 0xCEDD, 0xB089, 0xCEDE, 0xB08A, 0xCEDF, 0xB08B, 0xCEE0, 0xB08C, 0xCEE1, + 0xB08D, 0xCEE2, 0xB08E, 0xCEE3, 0xB08F, 0xCEE6, 0xB090, 0xCEE7, 0xB091, 0xCEE9, 0xB092, 0xCEEA, 0xB093, 0xCEED, 0xB094, 0xCEEE, + 0xB095, 0xCEEF, 0xB096, 0xCEF0, 0xB097, 0xCEF1, 0xB098, 0xCEF2, 0xB099, 0xCEF3, 0xB09A, 0xCEF6, 0xB09B, 0xCEFA, 0xB09C, 0xCEFB, + 0xB09D, 0xCEFC, 0xB09E, 0xCEFD, 0xB09F, 0xCEFE, 0xB0A0, 0xCEFF, 0xB0A1, 0xAC00, 0xB0A2, 0xAC01, 0xB0A3, 0xAC04, 0xB0A4, 0xAC07, + 0xB0A5, 0xAC08, 0xB0A6, 0xAC09, 0xB0A7, 0xAC0A, 0xB0A8, 0xAC10, 0xB0A9, 0xAC11, 0xB0AA, 0xAC12, 0xB0AB, 0xAC13, 0xB0AC, 0xAC14, + 0xB0AD, 0xAC15, 0xB0AE, 0xAC16, 0xB0AF, 0xAC17, 0xB0B0, 0xAC19, 0xB0B1, 0xAC1A, 0xB0B2, 0xAC1B, 0xB0B3, 0xAC1C, 0xB0B4, 0xAC1D, + 0xB0B5, 0xAC20, 0xB0B6, 0xAC24, 0xB0B7, 0xAC2C, 0xB0B8, 0xAC2D, 0xB0B9, 0xAC2F, 0xB0BA, 0xAC30, 0xB0BB, 0xAC31, 0xB0BC, 0xAC38, + 0xB0BD, 0xAC39, 0xB0BE, 0xAC3C, 0xB0BF, 0xAC40, 0xB0C0, 0xAC4B, 0xB0C1, 0xAC4D, 0xB0C2, 0xAC54, 0xB0C3, 0xAC58, 0xB0C4, 0xAC5C, + 0xB0C5, 0xAC70, 0xB0C6, 0xAC71, 0xB0C7, 0xAC74, 0xB0C8, 0xAC77, 0xB0C9, 0xAC78, 0xB0CA, 0xAC7A, 0xB0CB, 0xAC80, 0xB0CC, 0xAC81, + 0xB0CD, 0xAC83, 0xB0CE, 0xAC84, 0xB0CF, 0xAC85, 0xB0D0, 0xAC86, 0xB0D1, 0xAC89, 0xB0D2, 0xAC8A, 0xB0D3, 0xAC8B, 0xB0D4, 0xAC8C, + 0xB0D5, 0xAC90, 0xB0D6, 0xAC94, 0xB0D7, 0xAC9C, 0xB0D8, 0xAC9D, 0xB0D9, 0xAC9F, 0xB0DA, 0xACA0, 0xB0DB, 0xACA1, 0xB0DC, 0xACA8, + 0xB0DD, 0xACA9, 0xB0DE, 0xACAA, 0xB0DF, 0xACAC, 0xB0E0, 0xACAF, 0xB0E1, 0xACB0, 0xB0E2, 0xACB8, 0xB0E3, 0xACB9, 0xB0E4, 0xACBB, + 0xB0E5, 0xACBC, 0xB0E6, 0xACBD, 0xB0E7, 0xACC1, 0xB0E8, 0xACC4, 0xB0E9, 0xACC8, 0xB0EA, 0xACCC, 0xB0EB, 0xACD5, 0xB0EC, 0xACD7, + 0xB0ED, 0xACE0, 0xB0EE, 0xACE1, 0xB0EF, 0xACE4, 0xB0F0, 0xACE7, 0xB0F1, 0xACE8, 0xB0F2, 0xACEA, 0xB0F3, 0xACEC, 0xB0F4, 0xACEF, + 0xB0F5, 0xACF0, 0xB0F6, 0xACF1, 0xB0F7, 0xACF3, 0xB0F8, 0xACF5, 0xB0F9, 0xACF6, 0xB0FA, 0xACFC, 0xB0FB, 0xACFD, 0xB0FC, 0xAD00, + 0xB0FD, 0xAD04, 0xB0FE, 0xAD06, 0xB141, 0xCF02, 0xB142, 0xCF03, 0xB143, 0xCF05, 0xB144, 0xCF06, 0xB145, 0xCF07, 0xB146, 0xCF09, + 0xB147, 0xCF0A, 0xB148, 0xCF0B, 0xB149, 0xCF0C, 0xB14A, 0xCF0D, 0xB14B, 0xCF0E, 0xB14C, 0xCF0F, 0xB14D, 0xCF12, 0xB14E, 0xCF14, + 0xB14F, 0xCF16, 0xB150, 0xCF17, 0xB151, 0xCF18, 0xB152, 0xCF19, 0xB153, 0xCF1A, 0xB154, 0xCF1B, 0xB155, 0xCF1D, 0xB156, 0xCF1E, + 0xB157, 0xCF1F, 0xB158, 0xCF21, 0xB159, 0xCF22, 0xB15A, 0xCF23, 0xB161, 0xCF25, 0xB162, 0xCF26, 0xB163, 0xCF27, 0xB164, 0xCF28, + 0xB165, 0xCF29, 0xB166, 0xCF2A, 0xB167, 0xCF2B, 0xB168, 0xCF2E, 0xB169, 0xCF32, 0xB16A, 0xCF33, 0xB16B, 0xCF34, 0xB16C, 0xCF35, + 0xB16D, 0xCF36, 0xB16E, 0xCF37, 0xB16F, 0xCF39, 0xB170, 0xCF3A, 0xB171, 0xCF3B, 0xB172, 0xCF3C, 0xB173, 0xCF3D, 0xB174, 0xCF3E, + 0xB175, 0xCF3F, 0xB176, 0xCF40, 0xB177, 0xCF41, 0xB178, 0xCF42, 0xB179, 0xCF43, 0xB17A, 0xCF44, 0xB181, 0xCF45, 0xB182, 0xCF46, + 0xB183, 0xCF47, 0xB184, 0xCF48, 0xB185, 0xCF49, 0xB186, 0xCF4A, 0xB187, 0xCF4B, 0xB188, 0xCF4C, 0xB189, 0xCF4D, 0xB18A, 0xCF4E, + 0xB18B, 0xCF4F, 0xB18C, 0xCF50, 0xB18D, 0xCF51, 0xB18E, 0xCF52, 0xB18F, 0xCF53, 0xB190, 0xCF56, 0xB191, 0xCF57, 0xB192, 0xCF59, + 0xB193, 0xCF5A, 0xB194, 0xCF5B, 0xB195, 0xCF5D, 0xB196, 0xCF5E, 0xB197, 0xCF5F, 0xB198, 0xCF60, 0xB199, 0xCF61, 0xB19A, 0xCF62, + 0xB19B, 0xCF63, 0xB19C, 0xCF66, 0xB19D, 0xCF68, 0xB19E, 0xCF6A, 0xB19F, 0xCF6B, 0xB1A0, 0xCF6C, 0xB1A1, 0xAD0C, 0xB1A2, 0xAD0D, + 0xB1A3, 0xAD0F, 0xB1A4, 0xAD11, 0xB1A5, 0xAD18, 0xB1A6, 0xAD1C, 0xB1A7, 0xAD20, 0xB1A8, 0xAD29, 0xB1A9, 0xAD2C, 0xB1AA, 0xAD2D, + 0xB1AB, 0xAD34, 0xB1AC, 0xAD35, 0xB1AD, 0xAD38, 0xB1AE, 0xAD3C, 0xB1AF, 0xAD44, 0xB1B0, 0xAD45, 0xB1B1, 0xAD47, 0xB1B2, 0xAD49, + 0xB1B3, 0xAD50, 0xB1B4, 0xAD54, 0xB1B5, 0xAD58, 0xB1B6, 0xAD61, 0xB1B7, 0xAD63, 0xB1B8, 0xAD6C, 0xB1B9, 0xAD6D, 0xB1BA, 0xAD70, + 0xB1BB, 0xAD73, 0xB1BC, 0xAD74, 0xB1BD, 0xAD75, 0xB1BE, 0xAD76, 0xB1BF, 0xAD7B, 0xB1C0, 0xAD7C, 0xB1C1, 0xAD7D, 0xB1C2, 0xAD7F, + 0xB1C3, 0xAD81, 0xB1C4, 0xAD82, 0xB1C5, 0xAD88, 0xB1C6, 0xAD89, 0xB1C7, 0xAD8C, 0xB1C8, 0xAD90, 0xB1C9, 0xAD9C, 0xB1CA, 0xAD9D, + 0xB1CB, 0xADA4, 0xB1CC, 0xADB7, 0xB1CD, 0xADC0, 0xB1CE, 0xADC1, 0xB1CF, 0xADC4, 0xB1D0, 0xADC8, 0xB1D1, 0xADD0, 0xB1D2, 0xADD1, + 0xB1D3, 0xADD3, 0xB1D4, 0xADDC, 0xB1D5, 0xADE0, 0xB1D6, 0xADE4, 0xB1D7, 0xADF8, 0xB1D8, 0xADF9, 0xB1D9, 0xADFC, 0xB1DA, 0xADFF, + 0xB1DB, 0xAE00, 0xB1DC, 0xAE01, 0xB1DD, 0xAE08, 0xB1DE, 0xAE09, 0xB1DF, 0xAE0B, 0xB1E0, 0xAE0D, 0xB1E1, 0xAE14, 0xB1E2, 0xAE30, + 0xB1E3, 0xAE31, 0xB1E4, 0xAE34, 0xB1E5, 0xAE37, 0xB1E6, 0xAE38, 0xB1E7, 0xAE3A, 0xB1E8, 0xAE40, 0xB1E9, 0xAE41, 0xB1EA, 0xAE43, + 0xB1EB, 0xAE45, 0xB1EC, 0xAE46, 0xB1ED, 0xAE4A, 0xB1EE, 0xAE4C, 0xB1EF, 0xAE4D, 0xB1F0, 0xAE4E, 0xB1F1, 0xAE50, 0xB1F2, 0xAE54, + 0xB1F3, 0xAE56, 0xB1F4, 0xAE5C, 0xB1F5, 0xAE5D, 0xB1F6, 0xAE5F, 0xB1F7, 0xAE60, 0xB1F8, 0xAE61, 0xB1F9, 0xAE65, 0xB1FA, 0xAE68, + 0xB1FB, 0xAE69, 0xB1FC, 0xAE6C, 0xB1FD, 0xAE70, 0xB1FE, 0xAE78, 0xB241, 0xCF6D, 0xB242, 0xCF6E, 0xB243, 0xCF6F, 0xB244, 0xCF72, + 0xB245, 0xCF73, 0xB246, 0xCF75, 0xB247, 0xCF76, 0xB248, 0xCF77, 0xB249, 0xCF79, 0xB24A, 0xCF7A, 0xB24B, 0xCF7B, 0xB24C, 0xCF7C, + 0xB24D, 0xCF7D, 0xB24E, 0xCF7E, 0xB24F, 0xCF7F, 0xB250, 0xCF81, 0xB251, 0xCF82, 0xB252, 0xCF83, 0xB253, 0xCF84, 0xB254, 0xCF86, + 0xB255, 0xCF87, 0xB256, 0xCF88, 0xB257, 0xCF89, 0xB258, 0xCF8A, 0xB259, 0xCF8B, 0xB25A, 0xCF8D, 0xB261, 0xCF8E, 0xB262, 0xCF8F, + 0xB263, 0xCF90, 0xB264, 0xCF91, 0xB265, 0xCF92, 0xB266, 0xCF93, 0xB267, 0xCF94, 0xB268, 0xCF95, 0xB269, 0xCF96, 0xB26A, 0xCF97, + 0xB26B, 0xCF98, 0xB26C, 0xCF99, 0xB26D, 0xCF9A, 0xB26E, 0xCF9B, 0xB26F, 0xCF9C, 0xB270, 0xCF9D, 0xB271, 0xCF9E, 0xB272, 0xCF9F, + 0xB273, 0xCFA0, 0xB274, 0xCFA2, 0xB275, 0xCFA3, 0xB276, 0xCFA4, 0xB277, 0xCFA5, 0xB278, 0xCFA6, 0xB279, 0xCFA7, 0xB27A, 0xCFA9, + 0xB281, 0xCFAA, 0xB282, 0xCFAB, 0xB283, 0xCFAC, 0xB284, 0xCFAD, 0xB285, 0xCFAE, 0xB286, 0xCFAF, 0xB287, 0xCFB1, 0xB288, 0xCFB2, + 0xB289, 0xCFB3, 0xB28A, 0xCFB4, 0xB28B, 0xCFB5, 0xB28C, 0xCFB6, 0xB28D, 0xCFB7, 0xB28E, 0xCFB8, 0xB28F, 0xCFB9, 0xB290, 0xCFBA, + 0xB291, 0xCFBB, 0xB292, 0xCFBC, 0xB293, 0xCFBD, 0xB294, 0xCFBE, 0xB295, 0xCFBF, 0xB296, 0xCFC0, 0xB297, 0xCFC1, 0xB298, 0xCFC2, + 0xB299, 0xCFC3, 0xB29A, 0xCFC5, 0xB29B, 0xCFC6, 0xB29C, 0xCFC7, 0xB29D, 0xCFC8, 0xB29E, 0xCFC9, 0xB29F, 0xCFCA, 0xB2A0, 0xCFCB, + 0xB2A1, 0xAE79, 0xB2A2, 0xAE7B, 0xB2A3, 0xAE7C, 0xB2A4, 0xAE7D, 0xB2A5, 0xAE84, 0xB2A6, 0xAE85, 0xB2A7, 0xAE8C, 0xB2A8, 0xAEBC, + 0xB2A9, 0xAEBD, 0xB2AA, 0xAEBE, 0xB2AB, 0xAEC0, 0xB2AC, 0xAEC4, 0xB2AD, 0xAECC, 0xB2AE, 0xAECD, 0xB2AF, 0xAECF, 0xB2B0, 0xAED0, + 0xB2B1, 0xAED1, 0xB2B2, 0xAED8, 0xB2B3, 0xAED9, 0xB2B4, 0xAEDC, 0xB2B5, 0xAEE8, 0xB2B6, 0xAEEB, 0xB2B7, 0xAEED, 0xB2B8, 0xAEF4, + 0xB2B9, 0xAEF8, 0xB2BA, 0xAEFC, 0xB2BB, 0xAF07, 0xB2BC, 0xAF08, 0xB2BD, 0xAF0D, 0xB2BE, 0xAF10, 0xB2BF, 0xAF2C, 0xB2C0, 0xAF2D, + 0xB2C1, 0xAF30, 0xB2C2, 0xAF32, 0xB2C3, 0xAF34, 0xB2C4, 0xAF3C, 0xB2C5, 0xAF3D, 0xB2C6, 0xAF3F, 0xB2C7, 0xAF41, 0xB2C8, 0xAF42, + 0xB2C9, 0xAF43, 0xB2CA, 0xAF48, 0xB2CB, 0xAF49, 0xB2CC, 0xAF50, 0xB2CD, 0xAF5C, 0xB2CE, 0xAF5D, 0xB2CF, 0xAF64, 0xB2D0, 0xAF65, + 0xB2D1, 0xAF79, 0xB2D2, 0xAF80, 0xB2D3, 0xAF84, 0xB2D4, 0xAF88, 0xB2D5, 0xAF90, 0xB2D6, 0xAF91, 0xB2D7, 0xAF95, 0xB2D8, 0xAF9C, + 0xB2D9, 0xAFB8, 0xB2DA, 0xAFB9, 0xB2DB, 0xAFBC, 0xB2DC, 0xAFC0, 0xB2DD, 0xAFC7, 0xB2DE, 0xAFC8, 0xB2DF, 0xAFC9, 0xB2E0, 0xAFCB, + 0xB2E1, 0xAFCD, 0xB2E2, 0xAFCE, 0xB2E3, 0xAFD4, 0xB2E4, 0xAFDC, 0xB2E5, 0xAFE8, 0xB2E6, 0xAFE9, 0xB2E7, 0xAFF0, 0xB2E8, 0xAFF1, + 0xB2E9, 0xAFF4, 0xB2EA, 0xAFF8, 0xB2EB, 0xB000, 0xB2EC, 0xB001, 0xB2ED, 0xB004, 0xB2EE, 0xB00C, 0xB2EF, 0xB010, 0xB2F0, 0xB014, + 0xB2F1, 0xB01C, 0xB2F2, 0xB01D, 0xB2F3, 0xB028, 0xB2F4, 0xB044, 0xB2F5, 0xB045, 0xB2F6, 0xB048, 0xB2F7, 0xB04A, 0xB2F8, 0xB04C, + 0xB2F9, 0xB04E, 0xB2FA, 0xB053, 0xB2FB, 0xB054, 0xB2FC, 0xB055, 0xB2FD, 0xB057, 0xB2FE, 0xB059, 0xB341, 0xCFCC, 0xB342, 0xCFCD, + 0xB343, 0xCFCE, 0xB344, 0xCFCF, 0xB345, 0xCFD0, 0xB346, 0xCFD1, 0xB347, 0xCFD2, 0xB348, 0xCFD3, 0xB349, 0xCFD4, 0xB34A, 0xCFD5, + 0xB34B, 0xCFD6, 0xB34C, 0xCFD7, 0xB34D, 0xCFD8, 0xB34E, 0xCFD9, 0xB34F, 0xCFDA, 0xB350, 0xCFDB, 0xB351, 0xCFDC, 0xB352, 0xCFDD, + 0xB353, 0xCFDE, 0xB354, 0xCFDF, 0xB355, 0xCFE2, 0xB356, 0xCFE3, 0xB357, 0xCFE5, 0xB358, 0xCFE6, 0xB359, 0xCFE7, 0xB35A, 0xCFE9, + 0xB361, 0xCFEA, 0xB362, 0xCFEB, 0xB363, 0xCFEC, 0xB364, 0xCFED, 0xB365, 0xCFEE, 0xB366, 0xCFEF, 0xB367, 0xCFF2, 0xB368, 0xCFF4, + 0xB369, 0xCFF6, 0xB36A, 0xCFF7, 0xB36B, 0xCFF8, 0xB36C, 0xCFF9, 0xB36D, 0xCFFA, 0xB36E, 0xCFFB, 0xB36F, 0xCFFD, 0xB370, 0xCFFE, + 0xB371, 0xCFFF, 0xB372, 0xD001, 0xB373, 0xD002, 0xB374, 0xD003, 0xB375, 0xD005, 0xB376, 0xD006, 0xB377, 0xD007, 0xB378, 0xD008, + 0xB379, 0xD009, 0xB37A, 0xD00A, 0xB381, 0xD00B, 0xB382, 0xD00C, 0xB383, 0xD00D, 0xB384, 0xD00E, 0xB385, 0xD00F, 0xB386, 0xD010, + 0xB387, 0xD012, 0xB388, 0xD013, 0xB389, 0xD014, 0xB38A, 0xD015, 0xB38B, 0xD016, 0xB38C, 0xD017, 0xB38D, 0xD019, 0xB38E, 0xD01A, + 0xB38F, 0xD01B, 0xB390, 0xD01C, 0xB391, 0xD01D, 0xB392, 0xD01E, 0xB393, 0xD01F, 0xB394, 0xD020, 0xB395, 0xD021, 0xB396, 0xD022, + 0xB397, 0xD023, 0xB398, 0xD024, 0xB399, 0xD025, 0xB39A, 0xD026, 0xB39B, 0xD027, 0xB39C, 0xD028, 0xB39D, 0xD029, 0xB39E, 0xD02A, + 0xB39F, 0xD02B, 0xB3A0, 0xD02C, 0xB3A1, 0xB05D, 0xB3A2, 0xB07C, 0xB3A3, 0xB07D, 0xB3A4, 0xB080, 0xB3A5, 0xB084, 0xB3A6, 0xB08C, + 0xB3A7, 0xB08D, 0xB3A8, 0xB08F, 0xB3A9, 0xB091, 0xB3AA, 0xB098, 0xB3AB, 0xB099, 0xB3AC, 0xB09A, 0xB3AD, 0xB09C, 0xB3AE, 0xB09F, + 0xB3AF, 0xB0A0, 0xB3B0, 0xB0A1, 0xB3B1, 0xB0A2, 0xB3B2, 0xB0A8, 0xB3B3, 0xB0A9, 0xB3B4, 0xB0AB, 0xB3B5, 0xB0AC, 0xB3B6, 0xB0AD, + 0xB3B7, 0xB0AE, 0xB3B8, 0xB0AF, 0xB3B9, 0xB0B1, 0xB3BA, 0xB0B3, 0xB3BB, 0xB0B4, 0xB3BC, 0xB0B5, 0xB3BD, 0xB0B8, 0xB3BE, 0xB0BC, + 0xB3BF, 0xB0C4, 0xB3C0, 0xB0C5, 0xB3C1, 0xB0C7, 0xB3C2, 0xB0C8, 0xB3C3, 0xB0C9, 0xB3C4, 0xB0D0, 0xB3C5, 0xB0D1, 0xB3C6, 0xB0D4, + 0xB3C7, 0xB0D8, 0xB3C8, 0xB0E0, 0xB3C9, 0xB0E5, 0xB3CA, 0xB108, 0xB3CB, 0xB109, 0xB3CC, 0xB10B, 0xB3CD, 0xB10C, 0xB3CE, 0xB110, + 0xB3CF, 0xB112, 0xB3D0, 0xB113, 0xB3D1, 0xB118, 0xB3D2, 0xB119, 0xB3D3, 0xB11B, 0xB3D4, 0xB11C, 0xB3D5, 0xB11D, 0xB3D6, 0xB123, + 0xB3D7, 0xB124, 0xB3D8, 0xB125, 0xB3D9, 0xB128, 0xB3DA, 0xB12C, 0xB3DB, 0xB134, 0xB3DC, 0xB135, 0xB3DD, 0xB137, 0xB3DE, 0xB138, + 0xB3DF, 0xB139, 0xB3E0, 0xB140, 0xB3E1, 0xB141, 0xB3E2, 0xB144, 0xB3E3, 0xB148, 0xB3E4, 0xB150, 0xB3E5, 0xB151, 0xB3E6, 0xB154, + 0xB3E7, 0xB155, 0xB3E8, 0xB158, 0xB3E9, 0xB15C, 0xB3EA, 0xB160, 0xB3EB, 0xB178, 0xB3EC, 0xB179, 0xB3ED, 0xB17C, 0xB3EE, 0xB180, + 0xB3EF, 0xB182, 0xB3F0, 0xB188, 0xB3F1, 0xB189, 0xB3F2, 0xB18B, 0xB3F3, 0xB18D, 0xB3F4, 0xB192, 0xB3F5, 0xB193, 0xB3F6, 0xB194, + 0xB3F7, 0xB198, 0xB3F8, 0xB19C, 0xB3F9, 0xB1A8, 0xB3FA, 0xB1CC, 0xB3FB, 0xB1D0, 0xB3FC, 0xB1D4, 0xB3FD, 0xB1DC, 0xB3FE, 0xB1DD, + 0xB441, 0xD02E, 0xB442, 0xD02F, 0xB443, 0xD030, 0xB444, 0xD031, 0xB445, 0xD032, 0xB446, 0xD033, 0xB447, 0xD036, 0xB448, 0xD037, + 0xB449, 0xD039, 0xB44A, 0xD03A, 0xB44B, 0xD03B, 0xB44C, 0xD03D, 0xB44D, 0xD03E, 0xB44E, 0xD03F, 0xB44F, 0xD040, 0xB450, 0xD041, + 0xB451, 0xD042, 0xB452, 0xD043, 0xB453, 0xD046, 0xB454, 0xD048, 0xB455, 0xD04A, 0xB456, 0xD04B, 0xB457, 0xD04C, 0xB458, 0xD04D, + 0xB459, 0xD04E, 0xB45A, 0xD04F, 0xB461, 0xD051, 0xB462, 0xD052, 0xB463, 0xD053, 0xB464, 0xD055, 0xB465, 0xD056, 0xB466, 0xD057, + 0xB467, 0xD059, 0xB468, 0xD05A, 0xB469, 0xD05B, 0xB46A, 0xD05C, 0xB46B, 0xD05D, 0xB46C, 0xD05E, 0xB46D, 0xD05F, 0xB46E, 0xD061, + 0xB46F, 0xD062, 0xB470, 0xD063, 0xB471, 0xD064, 0xB472, 0xD065, 0xB473, 0xD066, 0xB474, 0xD067, 0xB475, 0xD068, 0xB476, 0xD069, + 0xB477, 0xD06A, 0xB478, 0xD06B, 0xB479, 0xD06E, 0xB47A, 0xD06F, 0xB481, 0xD071, 0xB482, 0xD072, 0xB483, 0xD073, 0xB484, 0xD075, + 0xB485, 0xD076, 0xB486, 0xD077, 0xB487, 0xD078, 0xB488, 0xD079, 0xB489, 0xD07A, 0xB48A, 0xD07B, 0xB48B, 0xD07E, 0xB48C, 0xD07F, + 0xB48D, 0xD080, 0xB48E, 0xD082, 0xB48F, 0xD083, 0xB490, 0xD084, 0xB491, 0xD085, 0xB492, 0xD086, 0xB493, 0xD087, 0xB494, 0xD088, + 0xB495, 0xD089, 0xB496, 0xD08A, 0xB497, 0xD08B, 0xB498, 0xD08C, 0xB499, 0xD08D, 0xB49A, 0xD08E, 0xB49B, 0xD08F, 0xB49C, 0xD090, + 0xB49D, 0xD091, 0xB49E, 0xD092, 0xB49F, 0xD093, 0xB4A0, 0xD094, 0xB4A1, 0xB1DF, 0xB4A2, 0xB1E8, 0xB4A3, 0xB1E9, 0xB4A4, 0xB1EC, + 0xB4A5, 0xB1F0, 0xB4A6, 0xB1F9, 0xB4A7, 0xB1FB, 0xB4A8, 0xB1FD, 0xB4A9, 0xB204, 0xB4AA, 0xB205, 0xB4AB, 0xB208, 0xB4AC, 0xB20B, + 0xB4AD, 0xB20C, 0xB4AE, 0xB214, 0xB4AF, 0xB215, 0xB4B0, 0xB217, 0xB4B1, 0xB219, 0xB4B2, 0xB220, 0xB4B3, 0xB234, 0xB4B4, 0xB23C, + 0xB4B5, 0xB258, 0xB4B6, 0xB25C, 0xB4B7, 0xB260, 0xB4B8, 0xB268, 0xB4B9, 0xB269, 0xB4BA, 0xB274, 0xB4BB, 0xB275, 0xB4BC, 0xB27C, + 0xB4BD, 0xB284, 0xB4BE, 0xB285, 0xB4BF, 0xB289, 0xB4C0, 0xB290, 0xB4C1, 0xB291, 0xB4C2, 0xB294, 0xB4C3, 0xB298, 0xB4C4, 0xB299, + 0xB4C5, 0xB29A, 0xB4C6, 0xB2A0, 0xB4C7, 0xB2A1, 0xB4C8, 0xB2A3, 0xB4C9, 0xB2A5, 0xB4CA, 0xB2A6, 0xB4CB, 0xB2AA, 0xB4CC, 0xB2AC, + 0xB4CD, 0xB2B0, 0xB4CE, 0xB2B4, 0xB4CF, 0xB2C8, 0xB4D0, 0xB2C9, 0xB4D1, 0xB2CC, 0xB4D2, 0xB2D0, 0xB4D3, 0xB2D2, 0xB4D4, 0xB2D8, + 0xB4D5, 0xB2D9, 0xB4D6, 0xB2DB, 0xB4D7, 0xB2DD, 0xB4D8, 0xB2E2, 0xB4D9, 0xB2E4, 0xB4DA, 0xB2E5, 0xB4DB, 0xB2E6, 0xB4DC, 0xB2E8, + 0xB4DD, 0xB2EB, 0xB4DE, 0xB2EC, 0xB4DF, 0xB2ED, 0xB4E0, 0xB2EE, 0xB4E1, 0xB2EF, 0xB4E2, 0xB2F3, 0xB4E3, 0xB2F4, 0xB4E4, 0xB2F5, + 0xB4E5, 0xB2F7, 0xB4E6, 0xB2F8, 0xB4E7, 0xB2F9, 0xB4E8, 0xB2FA, 0xB4E9, 0xB2FB, 0xB4EA, 0xB2FF, 0xB4EB, 0xB300, 0xB4EC, 0xB301, + 0xB4ED, 0xB304, 0xB4EE, 0xB308, 0xB4EF, 0xB310, 0xB4F0, 0xB311, 0xB4F1, 0xB313, 0xB4F2, 0xB314, 0xB4F3, 0xB315, 0xB4F4, 0xB31C, + 0xB4F5, 0xB354, 0xB4F6, 0xB355, 0xB4F7, 0xB356, 0xB4F8, 0xB358, 0xB4F9, 0xB35B, 0xB4FA, 0xB35C, 0xB4FB, 0xB35E, 0xB4FC, 0xB35F, + 0xB4FD, 0xB364, 0xB4FE, 0xB365, 0xB541, 0xD095, 0xB542, 0xD096, 0xB543, 0xD097, 0xB544, 0xD098, 0xB545, 0xD099, 0xB546, 0xD09A, + 0xB547, 0xD09B, 0xB548, 0xD09C, 0xB549, 0xD09D, 0xB54A, 0xD09E, 0xB54B, 0xD09F, 0xB54C, 0xD0A0, 0xB54D, 0xD0A1, 0xB54E, 0xD0A2, + 0xB54F, 0xD0A3, 0xB550, 0xD0A6, 0xB551, 0xD0A7, 0xB552, 0xD0A9, 0xB553, 0xD0AA, 0xB554, 0xD0AB, 0xB555, 0xD0AD, 0xB556, 0xD0AE, + 0xB557, 0xD0AF, 0xB558, 0xD0B0, 0xB559, 0xD0B1, 0xB55A, 0xD0B2, 0xB561, 0xD0B3, 0xB562, 0xD0B6, 0xB563, 0xD0B8, 0xB564, 0xD0BA, + 0xB565, 0xD0BB, 0xB566, 0xD0BC, 0xB567, 0xD0BD, 0xB568, 0xD0BE, 0xB569, 0xD0BF, 0xB56A, 0xD0C2, 0xB56B, 0xD0C3, 0xB56C, 0xD0C5, + 0xB56D, 0xD0C6, 0xB56E, 0xD0C7, 0xB56F, 0xD0CA, 0xB570, 0xD0CB, 0xB571, 0xD0CC, 0xB572, 0xD0CD, 0xB573, 0xD0CE, 0xB574, 0xD0CF, + 0xB575, 0xD0D2, 0xB576, 0xD0D6, 0xB577, 0xD0D7, 0xB578, 0xD0D8, 0xB579, 0xD0D9, 0xB57A, 0xD0DA, 0xB581, 0xD0DB, 0xB582, 0xD0DE, + 0xB583, 0xD0DF, 0xB584, 0xD0E1, 0xB585, 0xD0E2, 0xB586, 0xD0E3, 0xB587, 0xD0E5, 0xB588, 0xD0E6, 0xB589, 0xD0E7, 0xB58A, 0xD0E8, + 0xB58B, 0xD0E9, 0xB58C, 0xD0EA, 0xB58D, 0xD0EB, 0xB58E, 0xD0EE, 0xB58F, 0xD0F2, 0xB590, 0xD0F3, 0xB591, 0xD0F4, 0xB592, 0xD0F5, + 0xB593, 0xD0F6, 0xB594, 0xD0F7, 0xB595, 0xD0F9, 0xB596, 0xD0FA, 0xB597, 0xD0FB, 0xB598, 0xD0FC, 0xB599, 0xD0FD, 0xB59A, 0xD0FE, + 0xB59B, 0xD0FF, 0xB59C, 0xD100, 0xB59D, 0xD101, 0xB59E, 0xD102, 0xB59F, 0xD103, 0xB5A0, 0xD104, 0xB5A1, 0xB367, 0xB5A2, 0xB369, + 0xB5A3, 0xB36B, 0xB5A4, 0xB36E, 0xB5A5, 0xB370, 0xB5A6, 0xB371, 0xB5A7, 0xB374, 0xB5A8, 0xB378, 0xB5A9, 0xB380, 0xB5AA, 0xB381, + 0xB5AB, 0xB383, 0xB5AC, 0xB384, 0xB5AD, 0xB385, 0xB5AE, 0xB38C, 0xB5AF, 0xB390, 0xB5B0, 0xB394, 0xB5B1, 0xB3A0, 0xB5B2, 0xB3A1, + 0xB5B3, 0xB3A8, 0xB5B4, 0xB3AC, 0xB5B5, 0xB3C4, 0xB5B6, 0xB3C5, 0xB5B7, 0xB3C8, 0xB5B8, 0xB3CB, 0xB5B9, 0xB3CC, 0xB5BA, 0xB3CE, + 0xB5BB, 0xB3D0, 0xB5BC, 0xB3D4, 0xB5BD, 0xB3D5, 0xB5BE, 0xB3D7, 0xB5BF, 0xB3D9, 0xB5C0, 0xB3DB, 0xB5C1, 0xB3DD, 0xB5C2, 0xB3E0, + 0xB5C3, 0xB3E4, 0xB5C4, 0xB3E8, 0xB5C5, 0xB3FC, 0xB5C6, 0xB410, 0xB5C7, 0xB418, 0xB5C8, 0xB41C, 0xB5C9, 0xB420, 0xB5CA, 0xB428, + 0xB5CB, 0xB429, 0xB5CC, 0xB42B, 0xB5CD, 0xB434, 0xB5CE, 0xB450, 0xB5CF, 0xB451, 0xB5D0, 0xB454, 0xB5D1, 0xB458, 0xB5D2, 0xB460, + 0xB5D3, 0xB461, 0xB5D4, 0xB463, 0xB5D5, 0xB465, 0xB5D6, 0xB46C, 0xB5D7, 0xB480, 0xB5D8, 0xB488, 0xB5D9, 0xB49D, 0xB5DA, 0xB4A4, + 0xB5DB, 0xB4A8, 0xB5DC, 0xB4AC, 0xB5DD, 0xB4B5, 0xB5DE, 0xB4B7, 0xB5DF, 0xB4B9, 0xB5E0, 0xB4C0, 0xB5E1, 0xB4C4, 0xB5E2, 0xB4C8, + 0xB5E3, 0xB4D0, 0xB5E4, 0xB4D5, 0xB5E5, 0xB4DC, 0xB5E6, 0xB4DD, 0xB5E7, 0xB4E0, 0xB5E8, 0xB4E3, 0xB5E9, 0xB4E4, 0xB5EA, 0xB4E6, + 0xB5EB, 0xB4EC, 0xB5EC, 0xB4ED, 0xB5ED, 0xB4EF, 0xB5EE, 0xB4F1, 0xB5EF, 0xB4F8, 0xB5F0, 0xB514, 0xB5F1, 0xB515, 0xB5F2, 0xB518, + 0xB5F3, 0xB51B, 0xB5F4, 0xB51C, 0xB5F5, 0xB524, 0xB5F6, 0xB525, 0xB5F7, 0xB527, 0xB5F8, 0xB528, 0xB5F9, 0xB529, 0xB5FA, 0xB52A, + 0xB5FB, 0xB530, 0xB5FC, 0xB531, 0xB5FD, 0xB534, 0xB5FE, 0xB538, 0xB641, 0xD105, 0xB642, 0xD106, 0xB643, 0xD107, 0xB644, 0xD108, + 0xB645, 0xD109, 0xB646, 0xD10A, 0xB647, 0xD10B, 0xB648, 0xD10C, 0xB649, 0xD10E, 0xB64A, 0xD10F, 0xB64B, 0xD110, 0xB64C, 0xD111, + 0xB64D, 0xD112, 0xB64E, 0xD113, 0xB64F, 0xD114, 0xB650, 0xD115, 0xB651, 0xD116, 0xB652, 0xD117, 0xB653, 0xD118, 0xB654, 0xD119, + 0xB655, 0xD11A, 0xB656, 0xD11B, 0xB657, 0xD11C, 0xB658, 0xD11D, 0xB659, 0xD11E, 0xB65A, 0xD11F, 0xB661, 0xD120, 0xB662, 0xD121, + 0xB663, 0xD122, 0xB664, 0xD123, 0xB665, 0xD124, 0xB666, 0xD125, 0xB667, 0xD126, 0xB668, 0xD127, 0xB669, 0xD128, 0xB66A, 0xD129, + 0xB66B, 0xD12A, 0xB66C, 0xD12B, 0xB66D, 0xD12C, 0xB66E, 0xD12D, 0xB66F, 0xD12E, 0xB670, 0xD12F, 0xB671, 0xD132, 0xB672, 0xD133, + 0xB673, 0xD135, 0xB674, 0xD136, 0xB675, 0xD137, 0xB676, 0xD139, 0xB677, 0xD13B, 0xB678, 0xD13C, 0xB679, 0xD13D, 0xB67A, 0xD13E, + 0xB681, 0xD13F, 0xB682, 0xD142, 0xB683, 0xD146, 0xB684, 0xD147, 0xB685, 0xD148, 0xB686, 0xD149, 0xB687, 0xD14A, 0xB688, 0xD14B, + 0xB689, 0xD14E, 0xB68A, 0xD14F, 0xB68B, 0xD151, 0xB68C, 0xD152, 0xB68D, 0xD153, 0xB68E, 0xD155, 0xB68F, 0xD156, 0xB690, 0xD157, + 0xB691, 0xD158, 0xB692, 0xD159, 0xB693, 0xD15A, 0xB694, 0xD15B, 0xB695, 0xD15E, 0xB696, 0xD160, 0xB697, 0xD162, 0xB698, 0xD163, + 0xB699, 0xD164, 0xB69A, 0xD165, 0xB69B, 0xD166, 0xB69C, 0xD167, 0xB69D, 0xD169, 0xB69E, 0xD16A, 0xB69F, 0xD16B, 0xB6A0, 0xD16D, + 0xB6A1, 0xB540, 0xB6A2, 0xB541, 0xB6A3, 0xB543, 0xB6A4, 0xB544, 0xB6A5, 0xB545, 0xB6A6, 0xB54B, 0xB6A7, 0xB54C, 0xB6A8, 0xB54D, + 0xB6A9, 0xB550, 0xB6AA, 0xB554, 0xB6AB, 0xB55C, 0xB6AC, 0xB55D, 0xB6AD, 0xB55F, 0xB6AE, 0xB560, 0xB6AF, 0xB561, 0xB6B0, 0xB5A0, + 0xB6B1, 0xB5A1, 0xB6B2, 0xB5A4, 0xB6B3, 0xB5A8, 0xB6B4, 0xB5AA, 0xB6B5, 0xB5AB, 0xB6B6, 0xB5B0, 0xB6B7, 0xB5B1, 0xB6B8, 0xB5B3, + 0xB6B9, 0xB5B4, 0xB6BA, 0xB5B5, 0xB6BB, 0xB5BB, 0xB6BC, 0xB5BC, 0xB6BD, 0xB5BD, 0xB6BE, 0xB5C0, 0xB6BF, 0xB5C4, 0xB6C0, 0xB5CC, + 0xB6C1, 0xB5CD, 0xB6C2, 0xB5CF, 0xB6C3, 0xB5D0, 0xB6C4, 0xB5D1, 0xB6C5, 0xB5D8, 0xB6C6, 0xB5EC, 0xB6C7, 0xB610, 0xB6C8, 0xB611, + 0xB6C9, 0xB614, 0xB6CA, 0xB618, 0xB6CB, 0xB625, 0xB6CC, 0xB62C, 0xB6CD, 0xB634, 0xB6CE, 0xB648, 0xB6CF, 0xB664, 0xB6D0, 0xB668, + 0xB6D1, 0xB69C, 0xB6D2, 0xB69D, 0xB6D3, 0xB6A0, 0xB6D4, 0xB6A4, 0xB6D5, 0xB6AB, 0xB6D6, 0xB6AC, 0xB6D7, 0xB6B1, 0xB6D8, 0xB6D4, + 0xB6D9, 0xB6F0, 0xB6DA, 0xB6F4, 0xB6DB, 0xB6F8, 0xB6DC, 0xB700, 0xB6DD, 0xB701, 0xB6DE, 0xB705, 0xB6DF, 0xB728, 0xB6E0, 0xB729, + 0xB6E1, 0xB72C, 0xB6E2, 0xB72F, 0xB6E3, 0xB730, 0xB6E4, 0xB738, 0xB6E5, 0xB739, 0xB6E6, 0xB73B, 0xB6E7, 0xB744, 0xB6E8, 0xB748, + 0xB6E9, 0xB74C, 0xB6EA, 0xB754, 0xB6EB, 0xB755, 0xB6EC, 0xB760, 0xB6ED, 0xB764, 0xB6EE, 0xB768, 0xB6EF, 0xB770, 0xB6F0, 0xB771, + 0xB6F1, 0xB773, 0xB6F2, 0xB775, 0xB6F3, 0xB77C, 0xB6F4, 0xB77D, 0xB6F5, 0xB780, 0xB6F6, 0xB784, 0xB6F7, 0xB78C, 0xB6F8, 0xB78D, + 0xB6F9, 0xB78F, 0xB6FA, 0xB790, 0xB6FB, 0xB791, 0xB6FC, 0xB792, 0xB6FD, 0xB796, 0xB6FE, 0xB797, 0xB741, 0xD16E, 0xB742, 0xD16F, + 0xB743, 0xD170, 0xB744, 0xD171, 0xB745, 0xD172, 0xB746, 0xD173, 0xB747, 0xD174, 0xB748, 0xD175, 0xB749, 0xD176, 0xB74A, 0xD177, + 0xB74B, 0xD178, 0xB74C, 0xD179, 0xB74D, 0xD17A, 0xB74E, 0xD17B, 0xB74F, 0xD17D, 0xB750, 0xD17E, 0xB751, 0xD17F, 0xB752, 0xD180, + 0xB753, 0xD181, 0xB754, 0xD182, 0xB755, 0xD183, 0xB756, 0xD185, 0xB757, 0xD186, 0xB758, 0xD187, 0xB759, 0xD189, 0xB75A, 0xD18A, + 0xB761, 0xD18B, 0xB762, 0xD18C, 0xB763, 0xD18D, 0xB764, 0xD18E, 0xB765, 0xD18F, 0xB766, 0xD190, 0xB767, 0xD191, 0xB768, 0xD192, + 0xB769, 0xD193, 0xB76A, 0xD194, 0xB76B, 0xD195, 0xB76C, 0xD196, 0xB76D, 0xD197, 0xB76E, 0xD198, 0xB76F, 0xD199, 0xB770, 0xD19A, + 0xB771, 0xD19B, 0xB772, 0xD19C, 0xB773, 0xD19D, 0xB774, 0xD19E, 0xB775, 0xD19F, 0xB776, 0xD1A2, 0xB777, 0xD1A3, 0xB778, 0xD1A5, + 0xB779, 0xD1A6, 0xB77A, 0xD1A7, 0xB781, 0xD1A9, 0xB782, 0xD1AA, 0xB783, 0xD1AB, 0xB784, 0xD1AC, 0xB785, 0xD1AD, 0xB786, 0xD1AE, + 0xB787, 0xD1AF, 0xB788, 0xD1B2, 0xB789, 0xD1B4, 0xB78A, 0xD1B6, 0xB78B, 0xD1B7, 0xB78C, 0xD1B8, 0xB78D, 0xD1B9, 0xB78E, 0xD1BB, + 0xB78F, 0xD1BD, 0xB790, 0xD1BE, 0xB791, 0xD1BF, 0xB792, 0xD1C1, 0xB793, 0xD1C2, 0xB794, 0xD1C3, 0xB795, 0xD1C4, 0xB796, 0xD1C5, + 0xB797, 0xD1C6, 0xB798, 0xD1C7, 0xB799, 0xD1C8, 0xB79A, 0xD1C9, 0xB79B, 0xD1CA, 0xB79C, 0xD1CB, 0xB79D, 0xD1CC, 0xB79E, 0xD1CD, + 0xB79F, 0xD1CE, 0xB7A0, 0xD1CF, 0xB7A1, 0xB798, 0xB7A2, 0xB799, 0xB7A3, 0xB79C, 0xB7A4, 0xB7A0, 0xB7A5, 0xB7A8, 0xB7A6, 0xB7A9, + 0xB7A7, 0xB7AB, 0xB7A8, 0xB7AC, 0xB7A9, 0xB7AD, 0xB7AA, 0xB7B4, 0xB7AB, 0xB7B5, 0xB7AC, 0xB7B8, 0xB7AD, 0xB7C7, 0xB7AE, 0xB7C9, + 0xB7AF, 0xB7EC, 0xB7B0, 0xB7ED, 0xB7B1, 0xB7F0, 0xB7B2, 0xB7F4, 0xB7B3, 0xB7FC, 0xB7B4, 0xB7FD, 0xB7B5, 0xB7FF, 0xB7B6, 0xB800, + 0xB7B7, 0xB801, 0xB7B8, 0xB807, 0xB7B9, 0xB808, 0xB7BA, 0xB809, 0xB7BB, 0xB80C, 0xB7BC, 0xB810, 0xB7BD, 0xB818, 0xB7BE, 0xB819, + 0xB7BF, 0xB81B, 0xB7C0, 0xB81D, 0xB7C1, 0xB824, 0xB7C2, 0xB825, 0xB7C3, 0xB828, 0xB7C4, 0xB82C, 0xB7C5, 0xB834, 0xB7C6, 0xB835, + 0xB7C7, 0xB837, 0xB7C8, 0xB838, 0xB7C9, 0xB839, 0xB7CA, 0xB840, 0xB7CB, 0xB844, 0xB7CC, 0xB851, 0xB7CD, 0xB853, 0xB7CE, 0xB85C, + 0xB7CF, 0xB85D, 0xB7D0, 0xB860, 0xB7D1, 0xB864, 0xB7D2, 0xB86C, 0xB7D3, 0xB86D, 0xB7D4, 0xB86F, 0xB7D5, 0xB871, 0xB7D6, 0xB878, + 0xB7D7, 0xB87C, 0xB7D8, 0xB88D, 0xB7D9, 0xB8A8, 0xB7DA, 0xB8B0, 0xB7DB, 0xB8B4, 0xB7DC, 0xB8B8, 0xB7DD, 0xB8C0, 0xB7DE, 0xB8C1, + 0xB7DF, 0xB8C3, 0xB7E0, 0xB8C5, 0xB7E1, 0xB8CC, 0xB7E2, 0xB8D0, 0xB7E3, 0xB8D4, 0xB7E4, 0xB8DD, 0xB7E5, 0xB8DF, 0xB7E6, 0xB8E1, + 0xB7E7, 0xB8E8, 0xB7E8, 0xB8E9, 0xB7E9, 0xB8EC, 0xB7EA, 0xB8F0, 0xB7EB, 0xB8F8, 0xB7EC, 0xB8F9, 0xB7ED, 0xB8FB, 0xB7EE, 0xB8FD, + 0xB7EF, 0xB904, 0xB7F0, 0xB918, 0xB7F1, 0xB920, 0xB7F2, 0xB93C, 0xB7F3, 0xB93D, 0xB7F4, 0xB940, 0xB7F5, 0xB944, 0xB7F6, 0xB94C, + 0xB7F7, 0xB94F, 0xB7F8, 0xB951, 0xB7F9, 0xB958, 0xB7FA, 0xB959, 0xB7FB, 0xB95C, 0xB7FC, 0xB960, 0xB7FD, 0xB968, 0xB7FE, 0xB969, + 0xB841, 0xD1D0, 0xB842, 0xD1D1, 0xB843, 0xD1D2, 0xB844, 0xD1D3, 0xB845, 0xD1D4, 0xB846, 0xD1D5, 0xB847, 0xD1D6, 0xB848, 0xD1D7, + 0xB849, 0xD1D9, 0xB84A, 0xD1DA, 0xB84B, 0xD1DB, 0xB84C, 0xD1DC, 0xB84D, 0xD1DD, 0xB84E, 0xD1DE, 0xB84F, 0xD1DF, 0xB850, 0xD1E0, + 0xB851, 0xD1E1, 0xB852, 0xD1E2, 0xB853, 0xD1E3, 0xB854, 0xD1E4, 0xB855, 0xD1E5, 0xB856, 0xD1E6, 0xB857, 0xD1E7, 0xB858, 0xD1E8, + 0xB859, 0xD1E9, 0xB85A, 0xD1EA, 0xB861, 0xD1EB, 0xB862, 0xD1EC, 0xB863, 0xD1ED, 0xB864, 0xD1EE, 0xB865, 0xD1EF, 0xB866, 0xD1F0, + 0xB867, 0xD1F1, 0xB868, 0xD1F2, 0xB869, 0xD1F3, 0xB86A, 0xD1F5, 0xB86B, 0xD1F6, 0xB86C, 0xD1F7, 0xB86D, 0xD1F9, 0xB86E, 0xD1FA, + 0xB86F, 0xD1FB, 0xB870, 0xD1FC, 0xB871, 0xD1FD, 0xB872, 0xD1FE, 0xB873, 0xD1FF, 0xB874, 0xD200, 0xB875, 0xD201, 0xB876, 0xD202, + 0xB877, 0xD203, 0xB878, 0xD204, 0xB879, 0xD205, 0xB87A, 0xD206, 0xB881, 0xD208, 0xB882, 0xD20A, 0xB883, 0xD20B, 0xB884, 0xD20C, + 0xB885, 0xD20D, 0xB886, 0xD20E, 0xB887, 0xD20F, 0xB888, 0xD211, 0xB889, 0xD212, 0xB88A, 0xD213, 0xB88B, 0xD214, 0xB88C, 0xD215, + 0xB88D, 0xD216, 0xB88E, 0xD217, 0xB88F, 0xD218, 0xB890, 0xD219, 0xB891, 0xD21A, 0xB892, 0xD21B, 0xB893, 0xD21C, 0xB894, 0xD21D, + 0xB895, 0xD21E, 0xB896, 0xD21F, 0xB897, 0xD220, 0xB898, 0xD221, 0xB899, 0xD222, 0xB89A, 0xD223, 0xB89B, 0xD224, 0xB89C, 0xD225, + 0xB89D, 0xD226, 0xB89E, 0xD227, 0xB89F, 0xD228, 0xB8A0, 0xD229, 0xB8A1, 0xB96B, 0xB8A2, 0xB96D, 0xB8A3, 0xB974, 0xB8A4, 0xB975, + 0xB8A5, 0xB978, 0xB8A6, 0xB97C, 0xB8A7, 0xB984, 0xB8A8, 0xB985, 0xB8A9, 0xB987, 0xB8AA, 0xB989, 0xB8AB, 0xB98A, 0xB8AC, 0xB98D, + 0xB8AD, 0xB98E, 0xB8AE, 0xB9AC, 0xB8AF, 0xB9AD, 0xB8B0, 0xB9B0, 0xB8B1, 0xB9B4, 0xB8B2, 0xB9BC, 0xB8B3, 0xB9BD, 0xB8B4, 0xB9BF, + 0xB8B5, 0xB9C1, 0xB8B6, 0xB9C8, 0xB8B7, 0xB9C9, 0xB8B8, 0xB9CC, 0xB8B9, 0xB9CE, 0xB8BA, 0xB9CF, 0xB8BB, 0xB9D0, 0xB8BC, 0xB9D1, + 0xB8BD, 0xB9D2, 0xB8BE, 0xB9D8, 0xB8BF, 0xB9D9, 0xB8C0, 0xB9DB, 0xB8C1, 0xB9DD, 0xB8C2, 0xB9DE, 0xB8C3, 0xB9E1, 0xB8C4, 0xB9E3, + 0xB8C5, 0xB9E4, 0xB8C6, 0xB9E5, 0xB8C7, 0xB9E8, 0xB8C8, 0xB9EC, 0xB8C9, 0xB9F4, 0xB8CA, 0xB9F5, 0xB8CB, 0xB9F7, 0xB8CC, 0xB9F8, + 0xB8CD, 0xB9F9, 0xB8CE, 0xB9FA, 0xB8CF, 0xBA00, 0xB8D0, 0xBA01, 0xB8D1, 0xBA08, 0xB8D2, 0xBA15, 0xB8D3, 0xBA38, 0xB8D4, 0xBA39, + 0xB8D5, 0xBA3C, 0xB8D6, 0xBA40, 0xB8D7, 0xBA42, 0xB8D8, 0xBA48, 0xB8D9, 0xBA49, 0xB8DA, 0xBA4B, 0xB8DB, 0xBA4D, 0xB8DC, 0xBA4E, + 0xB8DD, 0xBA53, 0xB8DE, 0xBA54, 0xB8DF, 0xBA55, 0xB8E0, 0xBA58, 0xB8E1, 0xBA5C, 0xB8E2, 0xBA64, 0xB8E3, 0xBA65, 0xB8E4, 0xBA67, + 0xB8E5, 0xBA68, 0xB8E6, 0xBA69, 0xB8E7, 0xBA70, 0xB8E8, 0xBA71, 0xB8E9, 0xBA74, 0xB8EA, 0xBA78, 0xB8EB, 0xBA83, 0xB8EC, 0xBA84, + 0xB8ED, 0xBA85, 0xB8EE, 0xBA87, 0xB8EF, 0xBA8C, 0xB8F0, 0xBAA8, 0xB8F1, 0xBAA9, 0xB8F2, 0xBAAB, 0xB8F3, 0xBAAC, 0xB8F4, 0xBAB0, + 0xB8F5, 0xBAB2, 0xB8F6, 0xBAB8, 0xB8F7, 0xBAB9, 0xB8F8, 0xBABB, 0xB8F9, 0xBABD, 0xB8FA, 0xBAC4, 0xB8FB, 0xBAC8, 0xB8FC, 0xBAD8, + 0xB8FD, 0xBAD9, 0xB8FE, 0xBAFC, 0xB941, 0xD22A, 0xB942, 0xD22B, 0xB943, 0xD22E, 0xB944, 0xD22F, 0xB945, 0xD231, 0xB946, 0xD232, + 0xB947, 0xD233, 0xB948, 0xD235, 0xB949, 0xD236, 0xB94A, 0xD237, 0xB94B, 0xD238, 0xB94C, 0xD239, 0xB94D, 0xD23A, 0xB94E, 0xD23B, + 0xB94F, 0xD23E, 0xB950, 0xD240, 0xB951, 0xD242, 0xB952, 0xD243, 0xB953, 0xD244, 0xB954, 0xD245, 0xB955, 0xD246, 0xB956, 0xD247, + 0xB957, 0xD249, 0xB958, 0xD24A, 0xB959, 0xD24B, 0xB95A, 0xD24C, 0xB961, 0xD24D, 0xB962, 0xD24E, 0xB963, 0xD24F, 0xB964, 0xD250, + 0xB965, 0xD251, 0xB966, 0xD252, 0xB967, 0xD253, 0xB968, 0xD254, 0xB969, 0xD255, 0xB96A, 0xD256, 0xB96B, 0xD257, 0xB96C, 0xD258, + 0xB96D, 0xD259, 0xB96E, 0xD25A, 0xB96F, 0xD25B, 0xB970, 0xD25D, 0xB971, 0xD25E, 0xB972, 0xD25F, 0xB973, 0xD260, 0xB974, 0xD261, + 0xB975, 0xD262, 0xB976, 0xD263, 0xB977, 0xD265, 0xB978, 0xD266, 0xB979, 0xD267, 0xB97A, 0xD268, 0xB981, 0xD269, 0xB982, 0xD26A, + 0xB983, 0xD26B, 0xB984, 0xD26C, 0xB985, 0xD26D, 0xB986, 0xD26E, 0xB987, 0xD26F, 0xB988, 0xD270, 0xB989, 0xD271, 0xB98A, 0xD272, + 0xB98B, 0xD273, 0xB98C, 0xD274, 0xB98D, 0xD275, 0xB98E, 0xD276, 0xB98F, 0xD277, 0xB990, 0xD278, 0xB991, 0xD279, 0xB992, 0xD27A, + 0xB993, 0xD27B, 0xB994, 0xD27C, 0xB995, 0xD27D, 0xB996, 0xD27E, 0xB997, 0xD27F, 0xB998, 0xD282, 0xB999, 0xD283, 0xB99A, 0xD285, + 0xB99B, 0xD286, 0xB99C, 0xD287, 0xB99D, 0xD289, 0xB99E, 0xD28A, 0xB99F, 0xD28B, 0xB9A0, 0xD28C, 0xB9A1, 0xBB00, 0xB9A2, 0xBB04, + 0xB9A3, 0xBB0D, 0xB9A4, 0xBB0F, 0xB9A5, 0xBB11, 0xB9A6, 0xBB18, 0xB9A7, 0xBB1C, 0xB9A8, 0xBB20, 0xB9A9, 0xBB29, 0xB9AA, 0xBB2B, + 0xB9AB, 0xBB34, 0xB9AC, 0xBB35, 0xB9AD, 0xBB36, 0xB9AE, 0xBB38, 0xB9AF, 0xBB3B, 0xB9B0, 0xBB3C, 0xB9B1, 0xBB3D, 0xB9B2, 0xBB3E, + 0xB9B3, 0xBB44, 0xB9B4, 0xBB45, 0xB9B5, 0xBB47, 0xB9B6, 0xBB49, 0xB9B7, 0xBB4D, 0xB9B8, 0xBB4F, 0xB9B9, 0xBB50, 0xB9BA, 0xBB54, + 0xB9BB, 0xBB58, 0xB9BC, 0xBB61, 0xB9BD, 0xBB63, 0xB9BE, 0xBB6C, 0xB9BF, 0xBB88, 0xB9C0, 0xBB8C, 0xB9C1, 0xBB90, 0xB9C2, 0xBBA4, + 0xB9C3, 0xBBA8, 0xB9C4, 0xBBAC, 0xB9C5, 0xBBB4, 0xB9C6, 0xBBB7, 0xB9C7, 0xBBC0, 0xB9C8, 0xBBC4, 0xB9C9, 0xBBC8, 0xB9CA, 0xBBD0, + 0xB9CB, 0xBBD3, 0xB9CC, 0xBBF8, 0xB9CD, 0xBBF9, 0xB9CE, 0xBBFC, 0xB9CF, 0xBBFF, 0xB9D0, 0xBC00, 0xB9D1, 0xBC02, 0xB9D2, 0xBC08, + 0xB9D3, 0xBC09, 0xB9D4, 0xBC0B, 0xB9D5, 0xBC0C, 0xB9D6, 0xBC0D, 0xB9D7, 0xBC0F, 0xB9D8, 0xBC11, 0xB9D9, 0xBC14, 0xB9DA, 0xBC15, + 0xB9DB, 0xBC16, 0xB9DC, 0xBC17, 0xB9DD, 0xBC18, 0xB9DE, 0xBC1B, 0xB9DF, 0xBC1C, 0xB9E0, 0xBC1D, 0xB9E1, 0xBC1E, 0xB9E2, 0xBC1F, + 0xB9E3, 0xBC24, 0xB9E4, 0xBC25, 0xB9E5, 0xBC27, 0xB9E6, 0xBC29, 0xB9E7, 0xBC2D, 0xB9E8, 0xBC30, 0xB9E9, 0xBC31, 0xB9EA, 0xBC34, + 0xB9EB, 0xBC38, 0xB9EC, 0xBC40, 0xB9ED, 0xBC41, 0xB9EE, 0xBC43, 0xB9EF, 0xBC44, 0xB9F0, 0xBC45, 0xB9F1, 0xBC49, 0xB9F2, 0xBC4C, + 0xB9F3, 0xBC4D, 0xB9F4, 0xBC50, 0xB9F5, 0xBC5D, 0xB9F6, 0xBC84, 0xB9F7, 0xBC85, 0xB9F8, 0xBC88, 0xB9F9, 0xBC8B, 0xB9FA, 0xBC8C, + 0xB9FB, 0xBC8E, 0xB9FC, 0xBC94, 0xB9FD, 0xBC95, 0xB9FE, 0xBC97, 0xBA41, 0xD28D, 0xBA42, 0xD28E, 0xBA43, 0xD28F, 0xBA44, 0xD292, + 0xBA45, 0xD293, 0xBA46, 0xD294, 0xBA47, 0xD296, 0xBA48, 0xD297, 0xBA49, 0xD298, 0xBA4A, 0xD299, 0xBA4B, 0xD29A, 0xBA4C, 0xD29B, + 0xBA4D, 0xD29D, 0xBA4E, 0xD29E, 0xBA4F, 0xD29F, 0xBA50, 0xD2A1, 0xBA51, 0xD2A2, 0xBA52, 0xD2A3, 0xBA53, 0xD2A5, 0xBA54, 0xD2A6, + 0xBA55, 0xD2A7, 0xBA56, 0xD2A8, 0xBA57, 0xD2A9, 0xBA58, 0xD2AA, 0xBA59, 0xD2AB, 0xBA5A, 0xD2AD, 0xBA61, 0xD2AE, 0xBA62, 0xD2AF, + 0xBA63, 0xD2B0, 0xBA64, 0xD2B2, 0xBA65, 0xD2B3, 0xBA66, 0xD2B4, 0xBA67, 0xD2B5, 0xBA68, 0xD2B6, 0xBA69, 0xD2B7, 0xBA6A, 0xD2BA, + 0xBA6B, 0xD2BB, 0xBA6C, 0xD2BD, 0xBA6D, 0xD2BE, 0xBA6E, 0xD2C1, 0xBA6F, 0xD2C3, 0xBA70, 0xD2C4, 0xBA71, 0xD2C5, 0xBA72, 0xD2C6, + 0xBA73, 0xD2C7, 0xBA74, 0xD2CA, 0xBA75, 0xD2CC, 0xBA76, 0xD2CD, 0xBA77, 0xD2CE, 0xBA78, 0xD2CF, 0xBA79, 0xD2D0, 0xBA7A, 0xD2D1, + 0xBA81, 0xD2D2, 0xBA82, 0xD2D3, 0xBA83, 0xD2D5, 0xBA84, 0xD2D6, 0xBA85, 0xD2D7, 0xBA86, 0xD2D9, 0xBA87, 0xD2DA, 0xBA88, 0xD2DB, + 0xBA89, 0xD2DD, 0xBA8A, 0xD2DE, 0xBA8B, 0xD2DF, 0xBA8C, 0xD2E0, 0xBA8D, 0xD2E1, 0xBA8E, 0xD2E2, 0xBA8F, 0xD2E3, 0xBA90, 0xD2E6, + 0xBA91, 0xD2E7, 0xBA92, 0xD2E8, 0xBA93, 0xD2E9, 0xBA94, 0xD2EA, 0xBA95, 0xD2EB, 0xBA96, 0xD2EC, 0xBA97, 0xD2ED, 0xBA98, 0xD2EE, + 0xBA99, 0xD2EF, 0xBA9A, 0xD2F2, 0xBA9B, 0xD2F3, 0xBA9C, 0xD2F5, 0xBA9D, 0xD2F6, 0xBA9E, 0xD2F7, 0xBA9F, 0xD2F9, 0xBAA0, 0xD2FA, + 0xBAA1, 0xBC99, 0xBAA2, 0xBC9A, 0xBAA3, 0xBCA0, 0xBAA4, 0xBCA1, 0xBAA5, 0xBCA4, 0xBAA6, 0xBCA7, 0xBAA7, 0xBCA8, 0xBAA8, 0xBCB0, + 0xBAA9, 0xBCB1, 0xBAAA, 0xBCB3, 0xBAAB, 0xBCB4, 0xBAAC, 0xBCB5, 0xBAAD, 0xBCBC, 0xBAAE, 0xBCBD, 0xBAAF, 0xBCC0, 0xBAB0, 0xBCC4, + 0xBAB1, 0xBCCD, 0xBAB2, 0xBCCF, 0xBAB3, 0xBCD0, 0xBAB4, 0xBCD1, 0xBAB5, 0xBCD5, 0xBAB6, 0xBCD8, 0xBAB7, 0xBCDC, 0xBAB8, 0xBCF4, + 0xBAB9, 0xBCF5, 0xBABA, 0xBCF6, 0xBABB, 0xBCF8, 0xBABC, 0xBCFC, 0xBABD, 0xBD04, 0xBABE, 0xBD05, 0xBABF, 0xBD07, 0xBAC0, 0xBD09, + 0xBAC1, 0xBD10, 0xBAC2, 0xBD14, 0xBAC3, 0xBD24, 0xBAC4, 0xBD2C, 0xBAC5, 0xBD40, 0xBAC6, 0xBD48, 0xBAC7, 0xBD49, 0xBAC8, 0xBD4C, + 0xBAC9, 0xBD50, 0xBACA, 0xBD58, 0xBACB, 0xBD59, 0xBACC, 0xBD64, 0xBACD, 0xBD68, 0xBACE, 0xBD80, 0xBACF, 0xBD81, 0xBAD0, 0xBD84, + 0xBAD1, 0xBD87, 0xBAD2, 0xBD88, 0xBAD3, 0xBD89, 0xBAD4, 0xBD8A, 0xBAD5, 0xBD90, 0xBAD6, 0xBD91, 0xBAD7, 0xBD93, 0xBAD8, 0xBD95, + 0xBAD9, 0xBD99, 0xBADA, 0xBD9A, 0xBADB, 0xBD9C, 0xBADC, 0xBDA4, 0xBADD, 0xBDB0, 0xBADE, 0xBDB8, 0xBADF, 0xBDD4, 0xBAE0, 0xBDD5, + 0xBAE1, 0xBDD8, 0xBAE2, 0xBDDC, 0xBAE3, 0xBDE9, 0xBAE4, 0xBDF0, 0xBAE5, 0xBDF4, 0xBAE6, 0xBDF8, 0xBAE7, 0xBE00, 0xBAE8, 0xBE03, + 0xBAE9, 0xBE05, 0xBAEA, 0xBE0C, 0xBAEB, 0xBE0D, 0xBAEC, 0xBE10, 0xBAED, 0xBE14, 0xBAEE, 0xBE1C, 0xBAEF, 0xBE1D, 0xBAF0, 0xBE1F, + 0xBAF1, 0xBE44, 0xBAF2, 0xBE45, 0xBAF3, 0xBE48, 0xBAF4, 0xBE4C, 0xBAF5, 0xBE4E, 0xBAF6, 0xBE54, 0xBAF7, 0xBE55, 0xBAF8, 0xBE57, + 0xBAF9, 0xBE59, 0xBAFA, 0xBE5A, 0xBAFB, 0xBE5B, 0xBAFC, 0xBE60, 0xBAFD, 0xBE61, 0xBAFE, 0xBE64, 0xBB41, 0xD2FB, 0xBB42, 0xD2FC, + 0xBB43, 0xD2FD, 0xBB44, 0xD2FE, 0xBB45, 0xD2FF, 0xBB46, 0xD302, 0xBB47, 0xD304, 0xBB48, 0xD306, 0xBB49, 0xD307, 0xBB4A, 0xD308, + 0xBB4B, 0xD309, 0xBB4C, 0xD30A, 0xBB4D, 0xD30B, 0xBB4E, 0xD30F, 0xBB4F, 0xD311, 0xBB50, 0xD312, 0xBB51, 0xD313, 0xBB52, 0xD315, + 0xBB53, 0xD317, 0xBB54, 0xD318, 0xBB55, 0xD319, 0xBB56, 0xD31A, 0xBB57, 0xD31B, 0xBB58, 0xD31E, 0xBB59, 0xD322, 0xBB5A, 0xD323, + 0xBB61, 0xD324, 0xBB62, 0xD326, 0xBB63, 0xD327, 0xBB64, 0xD32A, 0xBB65, 0xD32B, 0xBB66, 0xD32D, 0xBB67, 0xD32E, 0xBB68, 0xD32F, + 0xBB69, 0xD331, 0xBB6A, 0xD332, 0xBB6B, 0xD333, 0xBB6C, 0xD334, 0xBB6D, 0xD335, 0xBB6E, 0xD336, 0xBB6F, 0xD337, 0xBB70, 0xD33A, + 0xBB71, 0xD33E, 0xBB72, 0xD33F, 0xBB73, 0xD340, 0xBB74, 0xD341, 0xBB75, 0xD342, 0xBB76, 0xD343, 0xBB77, 0xD346, 0xBB78, 0xD347, + 0xBB79, 0xD348, 0xBB7A, 0xD349, 0xBB81, 0xD34A, 0xBB82, 0xD34B, 0xBB83, 0xD34C, 0xBB84, 0xD34D, 0xBB85, 0xD34E, 0xBB86, 0xD34F, + 0xBB87, 0xD350, 0xBB88, 0xD351, 0xBB89, 0xD352, 0xBB8A, 0xD353, 0xBB8B, 0xD354, 0xBB8C, 0xD355, 0xBB8D, 0xD356, 0xBB8E, 0xD357, + 0xBB8F, 0xD358, 0xBB90, 0xD359, 0xBB91, 0xD35A, 0xBB92, 0xD35B, 0xBB93, 0xD35C, 0xBB94, 0xD35D, 0xBB95, 0xD35E, 0xBB96, 0xD35F, + 0xBB97, 0xD360, 0xBB98, 0xD361, 0xBB99, 0xD362, 0xBB9A, 0xD363, 0xBB9B, 0xD364, 0xBB9C, 0xD365, 0xBB9D, 0xD366, 0xBB9E, 0xD367, + 0xBB9F, 0xD368, 0xBBA0, 0xD369, 0xBBA1, 0xBE68, 0xBBA2, 0xBE6A, 0xBBA3, 0xBE70, 0xBBA4, 0xBE71, 0xBBA5, 0xBE73, 0xBBA6, 0xBE74, + 0xBBA7, 0xBE75, 0xBBA8, 0xBE7B, 0xBBA9, 0xBE7C, 0xBBAA, 0xBE7D, 0xBBAB, 0xBE80, 0xBBAC, 0xBE84, 0xBBAD, 0xBE8C, 0xBBAE, 0xBE8D, + 0xBBAF, 0xBE8F, 0xBBB0, 0xBE90, 0xBBB1, 0xBE91, 0xBBB2, 0xBE98, 0xBBB3, 0xBE99, 0xBBB4, 0xBEA8, 0xBBB5, 0xBED0, 0xBBB6, 0xBED1, + 0xBBB7, 0xBED4, 0xBBB8, 0xBED7, 0xBBB9, 0xBED8, 0xBBBA, 0xBEE0, 0xBBBB, 0xBEE3, 0xBBBC, 0xBEE4, 0xBBBD, 0xBEE5, 0xBBBE, 0xBEEC, + 0xBBBF, 0xBF01, 0xBBC0, 0xBF08, 0xBBC1, 0xBF09, 0xBBC2, 0xBF18, 0xBBC3, 0xBF19, 0xBBC4, 0xBF1B, 0xBBC5, 0xBF1C, 0xBBC6, 0xBF1D, + 0xBBC7, 0xBF40, 0xBBC8, 0xBF41, 0xBBC9, 0xBF44, 0xBBCA, 0xBF48, 0xBBCB, 0xBF50, 0xBBCC, 0xBF51, 0xBBCD, 0xBF55, 0xBBCE, 0xBF94, + 0xBBCF, 0xBFB0, 0xBBD0, 0xBFC5, 0xBBD1, 0xBFCC, 0xBBD2, 0xBFCD, 0xBBD3, 0xBFD0, 0xBBD4, 0xBFD4, 0xBBD5, 0xBFDC, 0xBBD6, 0xBFDF, + 0xBBD7, 0xBFE1, 0xBBD8, 0xC03C, 0xBBD9, 0xC051, 0xBBDA, 0xC058, 0xBBDB, 0xC05C, 0xBBDC, 0xC060, 0xBBDD, 0xC068, 0xBBDE, 0xC069, + 0xBBDF, 0xC090, 0xBBE0, 0xC091, 0xBBE1, 0xC094, 0xBBE2, 0xC098, 0xBBE3, 0xC0A0, 0xBBE4, 0xC0A1, 0xBBE5, 0xC0A3, 0xBBE6, 0xC0A5, + 0xBBE7, 0xC0AC, 0xBBE8, 0xC0AD, 0xBBE9, 0xC0AF, 0xBBEA, 0xC0B0, 0xBBEB, 0xC0B3, 0xBBEC, 0xC0B4, 0xBBED, 0xC0B5, 0xBBEE, 0xC0B6, + 0xBBEF, 0xC0BC, 0xBBF0, 0xC0BD, 0xBBF1, 0xC0BF, 0xBBF2, 0xC0C0, 0xBBF3, 0xC0C1, 0xBBF4, 0xC0C5, 0xBBF5, 0xC0C8, 0xBBF6, 0xC0C9, + 0xBBF7, 0xC0CC, 0xBBF8, 0xC0D0, 0xBBF9, 0xC0D8, 0xBBFA, 0xC0D9, 0xBBFB, 0xC0DB, 0xBBFC, 0xC0DC, 0xBBFD, 0xC0DD, 0xBBFE, 0xC0E4, + 0xBC41, 0xD36A, 0xBC42, 0xD36B, 0xBC43, 0xD36C, 0xBC44, 0xD36D, 0xBC45, 0xD36E, 0xBC46, 0xD36F, 0xBC47, 0xD370, 0xBC48, 0xD371, + 0xBC49, 0xD372, 0xBC4A, 0xD373, 0xBC4B, 0xD374, 0xBC4C, 0xD375, 0xBC4D, 0xD376, 0xBC4E, 0xD377, 0xBC4F, 0xD378, 0xBC50, 0xD379, + 0xBC51, 0xD37A, 0xBC52, 0xD37B, 0xBC53, 0xD37E, 0xBC54, 0xD37F, 0xBC55, 0xD381, 0xBC56, 0xD382, 0xBC57, 0xD383, 0xBC58, 0xD385, + 0xBC59, 0xD386, 0xBC5A, 0xD387, 0xBC61, 0xD388, 0xBC62, 0xD389, 0xBC63, 0xD38A, 0xBC64, 0xD38B, 0xBC65, 0xD38E, 0xBC66, 0xD392, + 0xBC67, 0xD393, 0xBC68, 0xD394, 0xBC69, 0xD395, 0xBC6A, 0xD396, 0xBC6B, 0xD397, 0xBC6C, 0xD39A, 0xBC6D, 0xD39B, 0xBC6E, 0xD39D, + 0xBC6F, 0xD39E, 0xBC70, 0xD39F, 0xBC71, 0xD3A1, 0xBC72, 0xD3A2, 0xBC73, 0xD3A3, 0xBC74, 0xD3A4, 0xBC75, 0xD3A5, 0xBC76, 0xD3A6, + 0xBC77, 0xD3A7, 0xBC78, 0xD3AA, 0xBC79, 0xD3AC, 0xBC7A, 0xD3AE, 0xBC81, 0xD3AF, 0xBC82, 0xD3B0, 0xBC83, 0xD3B1, 0xBC84, 0xD3B2, + 0xBC85, 0xD3B3, 0xBC86, 0xD3B5, 0xBC87, 0xD3B6, 0xBC88, 0xD3B7, 0xBC89, 0xD3B9, 0xBC8A, 0xD3BA, 0xBC8B, 0xD3BB, 0xBC8C, 0xD3BD, + 0xBC8D, 0xD3BE, 0xBC8E, 0xD3BF, 0xBC8F, 0xD3C0, 0xBC90, 0xD3C1, 0xBC91, 0xD3C2, 0xBC92, 0xD3C3, 0xBC93, 0xD3C6, 0xBC94, 0xD3C7, + 0xBC95, 0xD3CA, 0xBC96, 0xD3CB, 0xBC97, 0xD3CC, 0xBC98, 0xD3CD, 0xBC99, 0xD3CE, 0xBC9A, 0xD3CF, 0xBC9B, 0xD3D1, 0xBC9C, 0xD3D2, + 0xBC9D, 0xD3D3, 0xBC9E, 0xD3D4, 0xBC9F, 0xD3D5, 0xBCA0, 0xD3D6, 0xBCA1, 0xC0E5, 0xBCA2, 0xC0E8, 0xBCA3, 0xC0EC, 0xBCA4, 0xC0F4, + 0xBCA5, 0xC0F5, 0xBCA6, 0xC0F7, 0xBCA7, 0xC0F9, 0xBCA8, 0xC100, 0xBCA9, 0xC104, 0xBCAA, 0xC108, 0xBCAB, 0xC110, 0xBCAC, 0xC115, + 0xBCAD, 0xC11C, 0xBCAE, 0xC11D, 0xBCAF, 0xC11E, 0xBCB0, 0xC11F, 0xBCB1, 0xC120, 0xBCB2, 0xC123, 0xBCB3, 0xC124, 0xBCB4, 0xC126, + 0xBCB5, 0xC127, 0xBCB6, 0xC12C, 0xBCB7, 0xC12D, 0xBCB8, 0xC12F, 0xBCB9, 0xC130, 0xBCBA, 0xC131, 0xBCBB, 0xC136, 0xBCBC, 0xC138, + 0xBCBD, 0xC139, 0xBCBE, 0xC13C, 0xBCBF, 0xC140, 0xBCC0, 0xC148, 0xBCC1, 0xC149, 0xBCC2, 0xC14B, 0xBCC3, 0xC14C, 0xBCC4, 0xC14D, + 0xBCC5, 0xC154, 0xBCC6, 0xC155, 0xBCC7, 0xC158, 0xBCC8, 0xC15C, 0xBCC9, 0xC164, 0xBCCA, 0xC165, 0xBCCB, 0xC167, 0xBCCC, 0xC168, + 0xBCCD, 0xC169, 0xBCCE, 0xC170, 0xBCCF, 0xC174, 0xBCD0, 0xC178, 0xBCD1, 0xC185, 0xBCD2, 0xC18C, 0xBCD3, 0xC18D, 0xBCD4, 0xC18E, + 0xBCD5, 0xC190, 0xBCD6, 0xC194, 0xBCD7, 0xC196, 0xBCD8, 0xC19C, 0xBCD9, 0xC19D, 0xBCDA, 0xC19F, 0xBCDB, 0xC1A1, 0xBCDC, 0xC1A5, + 0xBCDD, 0xC1A8, 0xBCDE, 0xC1A9, 0xBCDF, 0xC1AC, 0xBCE0, 0xC1B0, 0xBCE1, 0xC1BD, 0xBCE2, 0xC1C4, 0xBCE3, 0xC1C8, 0xBCE4, 0xC1CC, + 0xBCE5, 0xC1D4, 0xBCE6, 0xC1D7, 0xBCE7, 0xC1D8, 0xBCE8, 0xC1E0, 0xBCE9, 0xC1E4, 0xBCEA, 0xC1E8, 0xBCEB, 0xC1F0, 0xBCEC, 0xC1F1, + 0xBCED, 0xC1F3, 0xBCEE, 0xC1FC, 0xBCEF, 0xC1FD, 0xBCF0, 0xC200, 0xBCF1, 0xC204, 0xBCF2, 0xC20C, 0xBCF3, 0xC20D, 0xBCF4, 0xC20F, + 0xBCF5, 0xC211, 0xBCF6, 0xC218, 0xBCF7, 0xC219, 0xBCF8, 0xC21C, 0xBCF9, 0xC21F, 0xBCFA, 0xC220, 0xBCFB, 0xC228, 0xBCFC, 0xC229, + 0xBCFD, 0xC22B, 0xBCFE, 0xC22D, 0xBD41, 0xD3D7, 0xBD42, 0xD3D9, 0xBD43, 0xD3DA, 0xBD44, 0xD3DB, 0xBD45, 0xD3DC, 0xBD46, 0xD3DD, + 0xBD47, 0xD3DE, 0xBD48, 0xD3DF, 0xBD49, 0xD3E0, 0xBD4A, 0xD3E2, 0xBD4B, 0xD3E4, 0xBD4C, 0xD3E5, 0xBD4D, 0xD3E6, 0xBD4E, 0xD3E7, + 0xBD4F, 0xD3E8, 0xBD50, 0xD3E9, 0xBD51, 0xD3EA, 0xBD52, 0xD3EB, 0xBD53, 0xD3EE, 0xBD54, 0xD3EF, 0xBD55, 0xD3F1, 0xBD56, 0xD3F2, + 0xBD57, 0xD3F3, 0xBD58, 0xD3F5, 0xBD59, 0xD3F6, 0xBD5A, 0xD3F7, 0xBD61, 0xD3F8, 0xBD62, 0xD3F9, 0xBD63, 0xD3FA, 0xBD64, 0xD3FB, + 0xBD65, 0xD3FE, 0xBD66, 0xD400, 0xBD67, 0xD402, 0xBD68, 0xD403, 0xBD69, 0xD404, 0xBD6A, 0xD405, 0xBD6B, 0xD406, 0xBD6C, 0xD407, + 0xBD6D, 0xD409, 0xBD6E, 0xD40A, 0xBD6F, 0xD40B, 0xBD70, 0xD40C, 0xBD71, 0xD40D, 0xBD72, 0xD40E, 0xBD73, 0xD40F, 0xBD74, 0xD410, + 0xBD75, 0xD411, 0xBD76, 0xD412, 0xBD77, 0xD413, 0xBD78, 0xD414, 0xBD79, 0xD415, 0xBD7A, 0xD416, 0xBD81, 0xD417, 0xBD82, 0xD418, + 0xBD83, 0xD419, 0xBD84, 0xD41A, 0xBD85, 0xD41B, 0xBD86, 0xD41C, 0xBD87, 0xD41E, 0xBD88, 0xD41F, 0xBD89, 0xD420, 0xBD8A, 0xD421, + 0xBD8B, 0xD422, 0xBD8C, 0xD423, 0xBD8D, 0xD424, 0xBD8E, 0xD425, 0xBD8F, 0xD426, 0xBD90, 0xD427, 0xBD91, 0xD428, 0xBD92, 0xD429, + 0xBD93, 0xD42A, 0xBD94, 0xD42B, 0xBD95, 0xD42C, 0xBD96, 0xD42D, 0xBD97, 0xD42E, 0xBD98, 0xD42F, 0xBD99, 0xD430, 0xBD9A, 0xD431, + 0xBD9B, 0xD432, 0xBD9C, 0xD433, 0xBD9D, 0xD434, 0xBD9E, 0xD435, 0xBD9F, 0xD436, 0xBDA0, 0xD437, 0xBDA1, 0xC22F, 0xBDA2, 0xC231, + 0xBDA3, 0xC232, 0xBDA4, 0xC234, 0xBDA5, 0xC248, 0xBDA6, 0xC250, 0xBDA7, 0xC251, 0xBDA8, 0xC254, 0xBDA9, 0xC258, 0xBDAA, 0xC260, + 0xBDAB, 0xC265, 0xBDAC, 0xC26C, 0xBDAD, 0xC26D, 0xBDAE, 0xC270, 0xBDAF, 0xC274, 0xBDB0, 0xC27C, 0xBDB1, 0xC27D, 0xBDB2, 0xC27F, + 0xBDB3, 0xC281, 0xBDB4, 0xC288, 0xBDB5, 0xC289, 0xBDB6, 0xC290, 0xBDB7, 0xC298, 0xBDB8, 0xC29B, 0xBDB9, 0xC29D, 0xBDBA, 0xC2A4, + 0xBDBB, 0xC2A5, 0xBDBC, 0xC2A8, 0xBDBD, 0xC2AC, 0xBDBE, 0xC2AD, 0xBDBF, 0xC2B4, 0xBDC0, 0xC2B5, 0xBDC1, 0xC2B7, 0xBDC2, 0xC2B9, + 0xBDC3, 0xC2DC, 0xBDC4, 0xC2DD, 0xBDC5, 0xC2E0, 0xBDC6, 0xC2E3, 0xBDC7, 0xC2E4, 0xBDC8, 0xC2EB, 0xBDC9, 0xC2EC, 0xBDCA, 0xC2ED, + 0xBDCB, 0xC2EF, 0xBDCC, 0xC2F1, 0xBDCD, 0xC2F6, 0xBDCE, 0xC2F8, 0xBDCF, 0xC2F9, 0xBDD0, 0xC2FB, 0xBDD1, 0xC2FC, 0xBDD2, 0xC300, + 0xBDD3, 0xC308, 0xBDD4, 0xC309, 0xBDD5, 0xC30C, 0xBDD6, 0xC30D, 0xBDD7, 0xC313, 0xBDD8, 0xC314, 0xBDD9, 0xC315, 0xBDDA, 0xC318, + 0xBDDB, 0xC31C, 0xBDDC, 0xC324, 0xBDDD, 0xC325, 0xBDDE, 0xC328, 0xBDDF, 0xC329, 0xBDE0, 0xC345, 0xBDE1, 0xC368, 0xBDE2, 0xC369, + 0xBDE3, 0xC36C, 0xBDE4, 0xC370, 0xBDE5, 0xC372, 0xBDE6, 0xC378, 0xBDE7, 0xC379, 0xBDE8, 0xC37C, 0xBDE9, 0xC37D, 0xBDEA, 0xC384, + 0xBDEB, 0xC388, 0xBDEC, 0xC38C, 0xBDED, 0xC3C0, 0xBDEE, 0xC3D8, 0xBDEF, 0xC3D9, 0xBDF0, 0xC3DC, 0xBDF1, 0xC3DF, 0xBDF2, 0xC3E0, + 0xBDF3, 0xC3E2, 0xBDF4, 0xC3E8, 0xBDF5, 0xC3E9, 0xBDF6, 0xC3ED, 0xBDF7, 0xC3F4, 0xBDF8, 0xC3F5, 0xBDF9, 0xC3F8, 0xBDFA, 0xC408, + 0xBDFB, 0xC410, 0xBDFC, 0xC424, 0xBDFD, 0xC42C, 0xBDFE, 0xC430, 0xBE41, 0xD438, 0xBE42, 0xD439, 0xBE43, 0xD43A, 0xBE44, 0xD43B, + 0xBE45, 0xD43C, 0xBE46, 0xD43D, 0xBE47, 0xD43E, 0xBE48, 0xD43F, 0xBE49, 0xD441, 0xBE4A, 0xD442, 0xBE4B, 0xD443, 0xBE4C, 0xD445, + 0xBE4D, 0xD446, 0xBE4E, 0xD447, 0xBE4F, 0xD448, 0xBE50, 0xD449, 0xBE51, 0xD44A, 0xBE52, 0xD44B, 0xBE53, 0xD44C, 0xBE54, 0xD44D, + 0xBE55, 0xD44E, 0xBE56, 0xD44F, 0xBE57, 0xD450, 0xBE58, 0xD451, 0xBE59, 0xD452, 0xBE5A, 0xD453, 0xBE61, 0xD454, 0xBE62, 0xD455, + 0xBE63, 0xD456, 0xBE64, 0xD457, 0xBE65, 0xD458, 0xBE66, 0xD459, 0xBE67, 0xD45A, 0xBE68, 0xD45B, 0xBE69, 0xD45D, 0xBE6A, 0xD45E, + 0xBE6B, 0xD45F, 0xBE6C, 0xD461, 0xBE6D, 0xD462, 0xBE6E, 0xD463, 0xBE6F, 0xD465, 0xBE70, 0xD466, 0xBE71, 0xD467, 0xBE72, 0xD468, + 0xBE73, 0xD469, 0xBE74, 0xD46A, 0xBE75, 0xD46B, 0xBE76, 0xD46C, 0xBE77, 0xD46E, 0xBE78, 0xD470, 0xBE79, 0xD471, 0xBE7A, 0xD472, + 0xBE81, 0xD473, 0xBE82, 0xD474, 0xBE83, 0xD475, 0xBE84, 0xD476, 0xBE85, 0xD477, 0xBE86, 0xD47A, 0xBE87, 0xD47B, 0xBE88, 0xD47D, + 0xBE89, 0xD47E, 0xBE8A, 0xD481, 0xBE8B, 0xD483, 0xBE8C, 0xD484, 0xBE8D, 0xD485, 0xBE8E, 0xD486, 0xBE8F, 0xD487, 0xBE90, 0xD48A, + 0xBE91, 0xD48C, 0xBE92, 0xD48E, 0xBE93, 0xD48F, 0xBE94, 0xD490, 0xBE95, 0xD491, 0xBE96, 0xD492, 0xBE97, 0xD493, 0xBE98, 0xD495, + 0xBE99, 0xD496, 0xBE9A, 0xD497, 0xBE9B, 0xD498, 0xBE9C, 0xD499, 0xBE9D, 0xD49A, 0xBE9E, 0xD49B, 0xBE9F, 0xD49C, 0xBEA0, 0xD49D, + 0xBEA1, 0xC434, 0xBEA2, 0xC43C, 0xBEA3, 0xC43D, 0xBEA4, 0xC448, 0xBEA5, 0xC464, 0xBEA6, 0xC465, 0xBEA7, 0xC468, 0xBEA8, 0xC46C, + 0xBEA9, 0xC474, 0xBEAA, 0xC475, 0xBEAB, 0xC479, 0xBEAC, 0xC480, 0xBEAD, 0xC494, 0xBEAE, 0xC49C, 0xBEAF, 0xC4B8, 0xBEB0, 0xC4BC, + 0xBEB1, 0xC4E9, 0xBEB2, 0xC4F0, 0xBEB3, 0xC4F1, 0xBEB4, 0xC4F4, 0xBEB5, 0xC4F8, 0xBEB6, 0xC4FA, 0xBEB7, 0xC4FF, 0xBEB8, 0xC500, + 0xBEB9, 0xC501, 0xBEBA, 0xC50C, 0xBEBB, 0xC510, 0xBEBC, 0xC514, 0xBEBD, 0xC51C, 0xBEBE, 0xC528, 0xBEBF, 0xC529, 0xBEC0, 0xC52C, + 0xBEC1, 0xC530, 0xBEC2, 0xC538, 0xBEC3, 0xC539, 0xBEC4, 0xC53B, 0xBEC5, 0xC53D, 0xBEC6, 0xC544, 0xBEC7, 0xC545, 0xBEC8, 0xC548, + 0xBEC9, 0xC549, 0xBECA, 0xC54A, 0xBECB, 0xC54C, 0xBECC, 0xC54D, 0xBECD, 0xC54E, 0xBECE, 0xC553, 0xBECF, 0xC554, 0xBED0, 0xC555, + 0xBED1, 0xC557, 0xBED2, 0xC558, 0xBED3, 0xC559, 0xBED4, 0xC55D, 0xBED5, 0xC55E, 0xBED6, 0xC560, 0xBED7, 0xC561, 0xBED8, 0xC564, + 0xBED9, 0xC568, 0xBEDA, 0xC570, 0xBEDB, 0xC571, 0xBEDC, 0xC573, 0xBEDD, 0xC574, 0xBEDE, 0xC575, 0xBEDF, 0xC57C, 0xBEE0, 0xC57D, + 0xBEE1, 0xC580, 0xBEE2, 0xC584, 0xBEE3, 0xC587, 0xBEE4, 0xC58C, 0xBEE5, 0xC58D, 0xBEE6, 0xC58F, 0xBEE7, 0xC591, 0xBEE8, 0xC595, + 0xBEE9, 0xC597, 0xBEEA, 0xC598, 0xBEEB, 0xC59C, 0xBEEC, 0xC5A0, 0xBEED, 0xC5A9, 0xBEEE, 0xC5B4, 0xBEEF, 0xC5B5, 0xBEF0, 0xC5B8, + 0xBEF1, 0xC5B9, 0xBEF2, 0xC5BB, 0xBEF3, 0xC5BC, 0xBEF4, 0xC5BD, 0xBEF5, 0xC5BE, 0xBEF6, 0xC5C4, 0xBEF7, 0xC5C5, 0xBEF8, 0xC5C6, + 0xBEF9, 0xC5C7, 0xBEFA, 0xC5C8, 0xBEFB, 0xC5C9, 0xBEFC, 0xC5CA, 0xBEFD, 0xC5CC, 0xBEFE, 0xC5CE, 0xBF41, 0xD49E, 0xBF42, 0xD49F, + 0xBF43, 0xD4A0, 0xBF44, 0xD4A1, 0xBF45, 0xD4A2, 0xBF46, 0xD4A3, 0xBF47, 0xD4A4, 0xBF48, 0xD4A5, 0xBF49, 0xD4A6, 0xBF4A, 0xD4A7, + 0xBF4B, 0xD4A8, 0xBF4C, 0xD4AA, 0xBF4D, 0xD4AB, 0xBF4E, 0xD4AC, 0xBF4F, 0xD4AD, 0xBF50, 0xD4AE, 0xBF51, 0xD4AF, 0xBF52, 0xD4B0, + 0xBF53, 0xD4B1, 0xBF54, 0xD4B2, 0xBF55, 0xD4B3, 0xBF56, 0xD4B4, 0xBF57, 0xD4B5, 0xBF58, 0xD4B6, 0xBF59, 0xD4B7, 0xBF5A, 0xD4B8, + 0xBF61, 0xD4B9, 0xBF62, 0xD4BA, 0xBF63, 0xD4BB, 0xBF64, 0xD4BC, 0xBF65, 0xD4BD, 0xBF66, 0xD4BE, 0xBF67, 0xD4BF, 0xBF68, 0xD4C0, + 0xBF69, 0xD4C1, 0xBF6A, 0xD4C2, 0xBF6B, 0xD4C3, 0xBF6C, 0xD4C4, 0xBF6D, 0xD4C5, 0xBF6E, 0xD4C6, 0xBF6F, 0xD4C7, 0xBF70, 0xD4C8, + 0xBF71, 0xD4C9, 0xBF72, 0xD4CA, 0xBF73, 0xD4CB, 0xBF74, 0xD4CD, 0xBF75, 0xD4CE, 0xBF76, 0xD4CF, 0xBF77, 0xD4D1, 0xBF78, 0xD4D2, + 0xBF79, 0xD4D3, 0xBF7A, 0xD4D5, 0xBF81, 0xD4D6, 0xBF82, 0xD4D7, 0xBF83, 0xD4D8, 0xBF84, 0xD4D9, 0xBF85, 0xD4DA, 0xBF86, 0xD4DB, + 0xBF87, 0xD4DD, 0xBF88, 0xD4DE, 0xBF89, 0xD4E0, 0xBF8A, 0xD4E1, 0xBF8B, 0xD4E2, 0xBF8C, 0xD4E3, 0xBF8D, 0xD4E4, 0xBF8E, 0xD4E5, + 0xBF8F, 0xD4E6, 0xBF90, 0xD4E7, 0xBF91, 0xD4E9, 0xBF92, 0xD4EA, 0xBF93, 0xD4EB, 0xBF94, 0xD4ED, 0xBF95, 0xD4EE, 0xBF96, 0xD4EF, + 0xBF97, 0xD4F1, 0xBF98, 0xD4F2, 0xBF99, 0xD4F3, 0xBF9A, 0xD4F4, 0xBF9B, 0xD4F5, 0xBF9C, 0xD4F6, 0xBF9D, 0xD4F7, 0xBF9E, 0xD4F9, + 0xBF9F, 0xD4FA, 0xBFA0, 0xD4FC, 0xBFA1, 0xC5D0, 0xBFA2, 0xC5D1, 0xBFA3, 0xC5D4, 0xBFA4, 0xC5D8, 0xBFA5, 0xC5E0, 0xBFA6, 0xC5E1, + 0xBFA7, 0xC5E3, 0xBFA8, 0xC5E5, 0xBFA9, 0xC5EC, 0xBFAA, 0xC5ED, 0xBFAB, 0xC5EE, 0xBFAC, 0xC5F0, 0xBFAD, 0xC5F4, 0xBFAE, 0xC5F6, + 0xBFAF, 0xC5F7, 0xBFB0, 0xC5FC, 0xBFB1, 0xC5FD, 0xBFB2, 0xC5FE, 0xBFB3, 0xC5FF, 0xBFB4, 0xC600, 0xBFB5, 0xC601, 0xBFB6, 0xC605, + 0xBFB7, 0xC606, 0xBFB8, 0xC607, 0xBFB9, 0xC608, 0xBFBA, 0xC60C, 0xBFBB, 0xC610, 0xBFBC, 0xC618, 0xBFBD, 0xC619, 0xBFBE, 0xC61B, + 0xBFBF, 0xC61C, 0xBFC0, 0xC624, 0xBFC1, 0xC625, 0xBFC2, 0xC628, 0xBFC3, 0xC62C, 0xBFC4, 0xC62D, 0xBFC5, 0xC62E, 0xBFC6, 0xC630, + 0xBFC7, 0xC633, 0xBFC8, 0xC634, 0xBFC9, 0xC635, 0xBFCA, 0xC637, 0xBFCB, 0xC639, 0xBFCC, 0xC63B, 0xBFCD, 0xC640, 0xBFCE, 0xC641, + 0xBFCF, 0xC644, 0xBFD0, 0xC648, 0xBFD1, 0xC650, 0xBFD2, 0xC651, 0xBFD3, 0xC653, 0xBFD4, 0xC654, 0xBFD5, 0xC655, 0xBFD6, 0xC65C, + 0xBFD7, 0xC65D, 0xBFD8, 0xC660, 0xBFD9, 0xC66C, 0xBFDA, 0xC66F, 0xBFDB, 0xC671, 0xBFDC, 0xC678, 0xBFDD, 0xC679, 0xBFDE, 0xC67C, + 0xBFDF, 0xC680, 0xBFE0, 0xC688, 0xBFE1, 0xC689, 0xBFE2, 0xC68B, 0xBFE3, 0xC68D, 0xBFE4, 0xC694, 0xBFE5, 0xC695, 0xBFE6, 0xC698, + 0xBFE7, 0xC69C, 0xBFE8, 0xC6A4, 0xBFE9, 0xC6A5, 0xBFEA, 0xC6A7, 0xBFEB, 0xC6A9, 0xBFEC, 0xC6B0, 0xBFED, 0xC6B1, 0xBFEE, 0xC6B4, + 0xBFEF, 0xC6B8, 0xBFF0, 0xC6B9, 0xBFF1, 0xC6BA, 0xBFF2, 0xC6C0, 0xBFF3, 0xC6C1, 0xBFF4, 0xC6C3, 0xBFF5, 0xC6C5, 0xBFF6, 0xC6CC, + 0xBFF7, 0xC6CD, 0xBFF8, 0xC6D0, 0xBFF9, 0xC6D4, 0xBFFA, 0xC6DC, 0xBFFB, 0xC6DD, 0xBFFC, 0xC6E0, 0xBFFD, 0xC6E1, 0xBFFE, 0xC6E8, + 0xC041, 0xD4FE, 0xC042, 0xD4FF, 0xC043, 0xD500, 0xC044, 0xD501, 0xC045, 0xD502, 0xC046, 0xD503, 0xC047, 0xD505, 0xC048, 0xD506, + 0xC049, 0xD507, 0xC04A, 0xD509, 0xC04B, 0xD50A, 0xC04C, 0xD50B, 0xC04D, 0xD50D, 0xC04E, 0xD50E, 0xC04F, 0xD50F, 0xC050, 0xD510, + 0xC051, 0xD511, 0xC052, 0xD512, 0xC053, 0xD513, 0xC054, 0xD516, 0xC055, 0xD518, 0xC056, 0xD519, 0xC057, 0xD51A, 0xC058, 0xD51B, + 0xC059, 0xD51C, 0xC05A, 0xD51D, 0xC061, 0xD51E, 0xC062, 0xD51F, 0xC063, 0xD520, 0xC064, 0xD521, 0xC065, 0xD522, 0xC066, 0xD523, + 0xC067, 0xD524, 0xC068, 0xD525, 0xC069, 0xD526, 0xC06A, 0xD527, 0xC06B, 0xD528, 0xC06C, 0xD529, 0xC06D, 0xD52A, 0xC06E, 0xD52B, + 0xC06F, 0xD52C, 0xC070, 0xD52D, 0xC071, 0xD52E, 0xC072, 0xD52F, 0xC073, 0xD530, 0xC074, 0xD531, 0xC075, 0xD532, 0xC076, 0xD533, + 0xC077, 0xD534, 0xC078, 0xD535, 0xC079, 0xD536, 0xC07A, 0xD537, 0xC081, 0xD538, 0xC082, 0xD539, 0xC083, 0xD53A, 0xC084, 0xD53B, + 0xC085, 0xD53E, 0xC086, 0xD53F, 0xC087, 0xD541, 0xC088, 0xD542, 0xC089, 0xD543, 0xC08A, 0xD545, 0xC08B, 0xD546, 0xC08C, 0xD547, + 0xC08D, 0xD548, 0xC08E, 0xD549, 0xC08F, 0xD54A, 0xC090, 0xD54B, 0xC091, 0xD54E, 0xC092, 0xD550, 0xC093, 0xD552, 0xC094, 0xD553, + 0xC095, 0xD554, 0xC096, 0xD555, 0xC097, 0xD556, 0xC098, 0xD557, 0xC099, 0xD55A, 0xC09A, 0xD55B, 0xC09B, 0xD55D, 0xC09C, 0xD55E, + 0xC09D, 0xD55F, 0xC09E, 0xD561, 0xC09F, 0xD562, 0xC0A0, 0xD563, 0xC0A1, 0xC6E9, 0xC0A2, 0xC6EC, 0xC0A3, 0xC6F0, 0xC0A4, 0xC6F8, + 0xC0A5, 0xC6F9, 0xC0A6, 0xC6FD, 0xC0A7, 0xC704, 0xC0A8, 0xC705, 0xC0A9, 0xC708, 0xC0AA, 0xC70C, 0xC0AB, 0xC714, 0xC0AC, 0xC715, + 0xC0AD, 0xC717, 0xC0AE, 0xC719, 0xC0AF, 0xC720, 0xC0B0, 0xC721, 0xC0B1, 0xC724, 0xC0B2, 0xC728, 0xC0B3, 0xC730, 0xC0B4, 0xC731, + 0xC0B5, 0xC733, 0xC0B6, 0xC735, 0xC0B7, 0xC737, 0xC0B8, 0xC73C, 0xC0B9, 0xC73D, 0xC0BA, 0xC740, 0xC0BB, 0xC744, 0xC0BC, 0xC74A, + 0xC0BD, 0xC74C, 0xC0BE, 0xC74D, 0xC0BF, 0xC74F, 0xC0C0, 0xC751, 0xC0C1, 0xC752, 0xC0C2, 0xC753, 0xC0C3, 0xC754, 0xC0C4, 0xC755, + 0xC0C5, 0xC756, 0xC0C6, 0xC757, 0xC0C7, 0xC758, 0xC0C8, 0xC75C, 0xC0C9, 0xC760, 0xC0CA, 0xC768, 0xC0CB, 0xC76B, 0xC0CC, 0xC774, + 0xC0CD, 0xC775, 0xC0CE, 0xC778, 0xC0CF, 0xC77C, 0xC0D0, 0xC77D, 0xC0D1, 0xC77E, 0xC0D2, 0xC783, 0xC0D3, 0xC784, 0xC0D4, 0xC785, + 0xC0D5, 0xC787, 0xC0D6, 0xC788, 0xC0D7, 0xC789, 0xC0D8, 0xC78A, 0xC0D9, 0xC78E, 0xC0DA, 0xC790, 0xC0DB, 0xC791, 0xC0DC, 0xC794, + 0xC0DD, 0xC796, 0xC0DE, 0xC797, 0xC0DF, 0xC798, 0xC0E0, 0xC79A, 0xC0E1, 0xC7A0, 0xC0E2, 0xC7A1, 0xC0E3, 0xC7A3, 0xC0E4, 0xC7A4, + 0xC0E5, 0xC7A5, 0xC0E6, 0xC7A6, 0xC0E7, 0xC7AC, 0xC0E8, 0xC7AD, 0xC0E9, 0xC7B0, 0xC0EA, 0xC7B4, 0xC0EB, 0xC7BC, 0xC0EC, 0xC7BD, + 0xC0ED, 0xC7BF, 0xC0EE, 0xC7C0, 0xC0EF, 0xC7C1, 0xC0F0, 0xC7C8, 0xC0F1, 0xC7C9, 0xC0F2, 0xC7CC, 0xC0F3, 0xC7CE, 0xC0F4, 0xC7D0, + 0xC0F5, 0xC7D8, 0xC0F6, 0xC7DD, 0xC0F7, 0xC7E4, 0xC0F8, 0xC7E8, 0xC0F9, 0xC7EC, 0xC0FA, 0xC800, 0xC0FB, 0xC801, 0xC0FC, 0xC804, + 0xC0FD, 0xC808, 0xC0FE, 0xC80A, 0xC141, 0xD564, 0xC142, 0xD566, 0xC143, 0xD567, 0xC144, 0xD56A, 0xC145, 0xD56C, 0xC146, 0xD56E, + 0xC147, 0xD56F, 0xC148, 0xD570, 0xC149, 0xD571, 0xC14A, 0xD572, 0xC14B, 0xD573, 0xC14C, 0xD576, 0xC14D, 0xD577, 0xC14E, 0xD579, + 0xC14F, 0xD57A, 0xC150, 0xD57B, 0xC151, 0xD57D, 0xC152, 0xD57E, 0xC153, 0xD57F, 0xC154, 0xD580, 0xC155, 0xD581, 0xC156, 0xD582, + 0xC157, 0xD583, 0xC158, 0xD586, 0xC159, 0xD58A, 0xC15A, 0xD58B, 0xC161, 0xD58C, 0xC162, 0xD58D, 0xC163, 0xD58E, 0xC164, 0xD58F, + 0xC165, 0xD591, 0xC166, 0xD592, 0xC167, 0xD593, 0xC168, 0xD594, 0xC169, 0xD595, 0xC16A, 0xD596, 0xC16B, 0xD597, 0xC16C, 0xD598, + 0xC16D, 0xD599, 0xC16E, 0xD59A, 0xC16F, 0xD59B, 0xC170, 0xD59C, 0xC171, 0xD59D, 0xC172, 0xD59E, 0xC173, 0xD59F, 0xC174, 0xD5A0, + 0xC175, 0xD5A1, 0xC176, 0xD5A2, 0xC177, 0xD5A3, 0xC178, 0xD5A4, 0xC179, 0xD5A6, 0xC17A, 0xD5A7, 0xC181, 0xD5A8, 0xC182, 0xD5A9, + 0xC183, 0xD5AA, 0xC184, 0xD5AB, 0xC185, 0xD5AC, 0xC186, 0xD5AD, 0xC187, 0xD5AE, 0xC188, 0xD5AF, 0xC189, 0xD5B0, 0xC18A, 0xD5B1, + 0xC18B, 0xD5B2, 0xC18C, 0xD5B3, 0xC18D, 0xD5B4, 0xC18E, 0xD5B5, 0xC18F, 0xD5B6, 0xC190, 0xD5B7, 0xC191, 0xD5B8, 0xC192, 0xD5B9, + 0xC193, 0xD5BA, 0xC194, 0xD5BB, 0xC195, 0xD5BC, 0xC196, 0xD5BD, 0xC197, 0xD5BE, 0xC198, 0xD5BF, 0xC199, 0xD5C0, 0xC19A, 0xD5C1, + 0xC19B, 0xD5C2, 0xC19C, 0xD5C3, 0xC19D, 0xD5C4, 0xC19E, 0xD5C5, 0xC19F, 0xD5C6, 0xC1A0, 0xD5C7, 0xC1A1, 0xC810, 0xC1A2, 0xC811, + 0xC1A3, 0xC813, 0xC1A4, 0xC815, 0xC1A5, 0xC816, 0xC1A6, 0xC81C, 0xC1A7, 0xC81D, 0xC1A8, 0xC820, 0xC1A9, 0xC824, 0xC1AA, 0xC82C, + 0xC1AB, 0xC82D, 0xC1AC, 0xC82F, 0xC1AD, 0xC831, 0xC1AE, 0xC838, 0xC1AF, 0xC83C, 0xC1B0, 0xC840, 0xC1B1, 0xC848, 0xC1B2, 0xC849, + 0xC1B3, 0xC84C, 0xC1B4, 0xC84D, 0xC1B5, 0xC854, 0xC1B6, 0xC870, 0xC1B7, 0xC871, 0xC1B8, 0xC874, 0xC1B9, 0xC878, 0xC1BA, 0xC87A, + 0xC1BB, 0xC880, 0xC1BC, 0xC881, 0xC1BD, 0xC883, 0xC1BE, 0xC885, 0xC1BF, 0xC886, 0xC1C0, 0xC887, 0xC1C1, 0xC88B, 0xC1C2, 0xC88C, + 0xC1C3, 0xC88D, 0xC1C4, 0xC894, 0xC1C5, 0xC89D, 0xC1C6, 0xC89F, 0xC1C7, 0xC8A1, 0xC1C8, 0xC8A8, 0xC1C9, 0xC8BC, 0xC1CA, 0xC8BD, + 0xC1CB, 0xC8C4, 0xC1CC, 0xC8C8, 0xC1CD, 0xC8CC, 0xC1CE, 0xC8D4, 0xC1CF, 0xC8D5, 0xC1D0, 0xC8D7, 0xC1D1, 0xC8D9, 0xC1D2, 0xC8E0, + 0xC1D3, 0xC8E1, 0xC1D4, 0xC8E4, 0xC1D5, 0xC8F5, 0xC1D6, 0xC8FC, 0xC1D7, 0xC8FD, 0xC1D8, 0xC900, 0xC1D9, 0xC904, 0xC1DA, 0xC905, + 0xC1DB, 0xC906, 0xC1DC, 0xC90C, 0xC1DD, 0xC90D, 0xC1DE, 0xC90F, 0xC1DF, 0xC911, 0xC1E0, 0xC918, 0xC1E1, 0xC92C, 0xC1E2, 0xC934, + 0xC1E3, 0xC950, 0xC1E4, 0xC951, 0xC1E5, 0xC954, 0xC1E6, 0xC958, 0xC1E7, 0xC960, 0xC1E8, 0xC961, 0xC1E9, 0xC963, 0xC1EA, 0xC96C, + 0xC1EB, 0xC970, 0xC1EC, 0xC974, 0xC1ED, 0xC97C, 0xC1EE, 0xC988, 0xC1EF, 0xC989, 0xC1F0, 0xC98C, 0xC1F1, 0xC990, 0xC1F2, 0xC998, + 0xC1F3, 0xC999, 0xC1F4, 0xC99B, 0xC1F5, 0xC99D, 0xC1F6, 0xC9C0, 0xC1F7, 0xC9C1, 0xC1F8, 0xC9C4, 0xC1F9, 0xC9C7, 0xC1FA, 0xC9C8, + 0xC1FB, 0xC9CA, 0xC1FC, 0xC9D0, 0xC1FD, 0xC9D1, 0xC1FE, 0xC9D3, 0xC241, 0xD5CA, 0xC242, 0xD5CB, 0xC243, 0xD5CD, 0xC244, 0xD5CE, + 0xC245, 0xD5CF, 0xC246, 0xD5D1, 0xC247, 0xD5D3, 0xC248, 0xD5D4, 0xC249, 0xD5D5, 0xC24A, 0xD5D6, 0xC24B, 0xD5D7, 0xC24C, 0xD5DA, + 0xC24D, 0xD5DC, 0xC24E, 0xD5DE, 0xC24F, 0xD5DF, 0xC250, 0xD5E0, 0xC251, 0xD5E1, 0xC252, 0xD5E2, 0xC253, 0xD5E3, 0xC254, 0xD5E6, + 0xC255, 0xD5E7, 0xC256, 0xD5E9, 0xC257, 0xD5EA, 0xC258, 0xD5EB, 0xC259, 0xD5ED, 0xC25A, 0xD5EE, 0xC261, 0xD5EF, 0xC262, 0xD5F0, + 0xC263, 0xD5F1, 0xC264, 0xD5F2, 0xC265, 0xD5F3, 0xC266, 0xD5F6, 0xC267, 0xD5F8, 0xC268, 0xD5FA, 0xC269, 0xD5FB, 0xC26A, 0xD5FC, + 0xC26B, 0xD5FD, 0xC26C, 0xD5FE, 0xC26D, 0xD5FF, 0xC26E, 0xD602, 0xC26F, 0xD603, 0xC270, 0xD605, 0xC271, 0xD606, 0xC272, 0xD607, + 0xC273, 0xD609, 0xC274, 0xD60A, 0xC275, 0xD60B, 0xC276, 0xD60C, 0xC277, 0xD60D, 0xC278, 0xD60E, 0xC279, 0xD60F, 0xC27A, 0xD612, + 0xC281, 0xD616, 0xC282, 0xD617, 0xC283, 0xD618, 0xC284, 0xD619, 0xC285, 0xD61A, 0xC286, 0xD61B, 0xC287, 0xD61D, 0xC288, 0xD61E, + 0xC289, 0xD61F, 0xC28A, 0xD621, 0xC28B, 0xD622, 0xC28C, 0xD623, 0xC28D, 0xD625, 0xC28E, 0xD626, 0xC28F, 0xD627, 0xC290, 0xD628, + 0xC291, 0xD629, 0xC292, 0xD62A, 0xC293, 0xD62B, 0xC294, 0xD62C, 0xC295, 0xD62E, 0xC296, 0xD62F, 0xC297, 0xD630, 0xC298, 0xD631, + 0xC299, 0xD632, 0xC29A, 0xD633, 0xC29B, 0xD634, 0xC29C, 0xD635, 0xC29D, 0xD636, 0xC29E, 0xD637, 0xC29F, 0xD63A, 0xC2A0, 0xD63B, + 0xC2A1, 0xC9D5, 0xC2A2, 0xC9D6, 0xC2A3, 0xC9D9, 0xC2A4, 0xC9DA, 0xC2A5, 0xC9DC, 0xC2A6, 0xC9DD, 0xC2A7, 0xC9E0, 0xC2A8, 0xC9E2, + 0xC2A9, 0xC9E4, 0xC2AA, 0xC9E7, 0xC2AB, 0xC9EC, 0xC2AC, 0xC9ED, 0xC2AD, 0xC9EF, 0xC2AE, 0xC9F0, 0xC2AF, 0xC9F1, 0xC2B0, 0xC9F8, + 0xC2B1, 0xC9F9, 0xC2B2, 0xC9FC, 0xC2B3, 0xCA00, 0xC2B4, 0xCA08, 0xC2B5, 0xCA09, 0xC2B6, 0xCA0B, 0xC2B7, 0xCA0C, 0xC2B8, 0xCA0D, + 0xC2B9, 0xCA14, 0xC2BA, 0xCA18, 0xC2BB, 0xCA29, 0xC2BC, 0xCA4C, 0xC2BD, 0xCA4D, 0xC2BE, 0xCA50, 0xC2BF, 0xCA54, 0xC2C0, 0xCA5C, + 0xC2C1, 0xCA5D, 0xC2C2, 0xCA5F, 0xC2C3, 0xCA60, 0xC2C4, 0xCA61, 0xC2C5, 0xCA68, 0xC2C6, 0xCA7D, 0xC2C7, 0xCA84, 0xC2C8, 0xCA98, + 0xC2C9, 0xCABC, 0xC2CA, 0xCABD, 0xC2CB, 0xCAC0, 0xC2CC, 0xCAC4, 0xC2CD, 0xCACC, 0xC2CE, 0xCACD, 0xC2CF, 0xCACF, 0xC2D0, 0xCAD1, + 0xC2D1, 0xCAD3, 0xC2D2, 0xCAD8, 0xC2D3, 0xCAD9, 0xC2D4, 0xCAE0, 0xC2D5, 0xCAEC, 0xC2D6, 0xCAF4, 0xC2D7, 0xCB08, 0xC2D8, 0xCB10, + 0xC2D9, 0xCB14, 0xC2DA, 0xCB18, 0xC2DB, 0xCB20, 0xC2DC, 0xCB21, 0xC2DD, 0xCB41, 0xC2DE, 0xCB48, 0xC2DF, 0xCB49, 0xC2E0, 0xCB4C, + 0xC2E1, 0xCB50, 0xC2E2, 0xCB58, 0xC2E3, 0xCB59, 0xC2E4, 0xCB5D, 0xC2E5, 0xCB64, 0xC2E6, 0xCB78, 0xC2E7, 0xCB79, 0xC2E8, 0xCB9C, + 0xC2E9, 0xCBB8, 0xC2EA, 0xCBD4, 0xC2EB, 0xCBE4, 0xC2EC, 0xCBE7, 0xC2ED, 0xCBE9, 0xC2EE, 0xCC0C, 0xC2EF, 0xCC0D, 0xC2F0, 0xCC10, + 0xC2F1, 0xCC14, 0xC2F2, 0xCC1C, 0xC2F3, 0xCC1D, 0xC2F4, 0xCC21, 0xC2F5, 0xCC22, 0xC2F6, 0xCC27, 0xC2F7, 0xCC28, 0xC2F8, 0xCC29, + 0xC2F9, 0xCC2C, 0xC2FA, 0xCC2E, 0xC2FB, 0xCC30, 0xC2FC, 0xCC38, 0xC2FD, 0xCC39, 0xC2FE, 0xCC3B, 0xC341, 0xD63D, 0xC342, 0xD63E, + 0xC343, 0xD63F, 0xC344, 0xD641, 0xC345, 0xD642, 0xC346, 0xD643, 0xC347, 0xD644, 0xC348, 0xD646, 0xC349, 0xD647, 0xC34A, 0xD64A, + 0xC34B, 0xD64C, 0xC34C, 0xD64E, 0xC34D, 0xD64F, 0xC34E, 0xD650, 0xC34F, 0xD652, 0xC350, 0xD653, 0xC351, 0xD656, 0xC352, 0xD657, + 0xC353, 0xD659, 0xC354, 0xD65A, 0xC355, 0xD65B, 0xC356, 0xD65D, 0xC357, 0xD65E, 0xC358, 0xD65F, 0xC359, 0xD660, 0xC35A, 0xD661, + 0xC361, 0xD662, 0xC362, 0xD663, 0xC363, 0xD664, 0xC364, 0xD665, 0xC365, 0xD666, 0xC366, 0xD668, 0xC367, 0xD66A, 0xC368, 0xD66B, + 0xC369, 0xD66C, 0xC36A, 0xD66D, 0xC36B, 0xD66E, 0xC36C, 0xD66F, 0xC36D, 0xD672, 0xC36E, 0xD673, 0xC36F, 0xD675, 0xC370, 0xD676, + 0xC371, 0xD677, 0xC372, 0xD678, 0xC373, 0xD679, 0xC374, 0xD67A, 0xC375, 0xD67B, 0xC376, 0xD67C, 0xC377, 0xD67D, 0xC378, 0xD67E, + 0xC379, 0xD67F, 0xC37A, 0xD680, 0xC381, 0xD681, 0xC382, 0xD682, 0xC383, 0xD684, 0xC384, 0xD686, 0xC385, 0xD687, 0xC386, 0xD688, + 0xC387, 0xD689, 0xC388, 0xD68A, 0xC389, 0xD68B, 0xC38A, 0xD68E, 0xC38B, 0xD68F, 0xC38C, 0xD691, 0xC38D, 0xD692, 0xC38E, 0xD693, + 0xC38F, 0xD695, 0xC390, 0xD696, 0xC391, 0xD697, 0xC392, 0xD698, 0xC393, 0xD699, 0xC394, 0xD69A, 0xC395, 0xD69B, 0xC396, 0xD69C, + 0xC397, 0xD69E, 0xC398, 0xD6A0, 0xC399, 0xD6A2, 0xC39A, 0xD6A3, 0xC39B, 0xD6A4, 0xC39C, 0xD6A5, 0xC39D, 0xD6A6, 0xC39E, 0xD6A7, + 0xC39F, 0xD6A9, 0xC3A0, 0xD6AA, 0xC3A1, 0xCC3C, 0xC3A2, 0xCC3D, 0xC3A3, 0xCC3E, 0xC3A4, 0xCC44, 0xC3A5, 0xCC45, 0xC3A6, 0xCC48, + 0xC3A7, 0xCC4C, 0xC3A8, 0xCC54, 0xC3A9, 0xCC55, 0xC3AA, 0xCC57, 0xC3AB, 0xCC58, 0xC3AC, 0xCC59, 0xC3AD, 0xCC60, 0xC3AE, 0xCC64, + 0xC3AF, 0xCC66, 0xC3B0, 0xCC68, 0xC3B1, 0xCC70, 0xC3B2, 0xCC75, 0xC3B3, 0xCC98, 0xC3B4, 0xCC99, 0xC3B5, 0xCC9C, 0xC3B6, 0xCCA0, + 0xC3B7, 0xCCA8, 0xC3B8, 0xCCA9, 0xC3B9, 0xCCAB, 0xC3BA, 0xCCAC, 0xC3BB, 0xCCAD, 0xC3BC, 0xCCB4, 0xC3BD, 0xCCB5, 0xC3BE, 0xCCB8, + 0xC3BF, 0xCCBC, 0xC3C0, 0xCCC4, 0xC3C1, 0xCCC5, 0xC3C2, 0xCCC7, 0xC3C3, 0xCCC9, 0xC3C4, 0xCCD0, 0xC3C5, 0xCCD4, 0xC3C6, 0xCCE4, + 0xC3C7, 0xCCEC, 0xC3C8, 0xCCF0, 0xC3C9, 0xCD01, 0xC3CA, 0xCD08, 0xC3CB, 0xCD09, 0xC3CC, 0xCD0C, 0xC3CD, 0xCD10, 0xC3CE, 0xCD18, + 0xC3CF, 0xCD19, 0xC3D0, 0xCD1B, 0xC3D1, 0xCD1D, 0xC3D2, 0xCD24, 0xC3D3, 0xCD28, 0xC3D4, 0xCD2C, 0xC3D5, 0xCD39, 0xC3D6, 0xCD5C, + 0xC3D7, 0xCD60, 0xC3D8, 0xCD64, 0xC3D9, 0xCD6C, 0xC3DA, 0xCD6D, 0xC3DB, 0xCD6F, 0xC3DC, 0xCD71, 0xC3DD, 0xCD78, 0xC3DE, 0xCD88, + 0xC3DF, 0xCD94, 0xC3E0, 0xCD95, 0xC3E1, 0xCD98, 0xC3E2, 0xCD9C, 0xC3E3, 0xCDA4, 0xC3E4, 0xCDA5, 0xC3E5, 0xCDA7, 0xC3E6, 0xCDA9, + 0xC3E7, 0xCDB0, 0xC3E8, 0xCDC4, 0xC3E9, 0xCDCC, 0xC3EA, 0xCDD0, 0xC3EB, 0xCDE8, 0xC3EC, 0xCDEC, 0xC3ED, 0xCDF0, 0xC3EE, 0xCDF8, + 0xC3EF, 0xCDF9, 0xC3F0, 0xCDFB, 0xC3F1, 0xCDFD, 0xC3F2, 0xCE04, 0xC3F3, 0xCE08, 0xC3F4, 0xCE0C, 0xC3F5, 0xCE14, 0xC3F6, 0xCE19, + 0xC3F7, 0xCE20, 0xC3F8, 0xCE21, 0xC3F9, 0xCE24, 0xC3FA, 0xCE28, 0xC3FB, 0xCE30, 0xC3FC, 0xCE31, 0xC3FD, 0xCE33, 0xC3FE, 0xCE35, + 0xC441, 0xD6AB, 0xC442, 0xD6AD, 0xC443, 0xD6AE, 0xC444, 0xD6AF, 0xC445, 0xD6B1, 0xC446, 0xD6B2, 0xC447, 0xD6B3, 0xC448, 0xD6B4, + 0xC449, 0xD6B5, 0xC44A, 0xD6B6, 0xC44B, 0xD6B7, 0xC44C, 0xD6B8, 0xC44D, 0xD6BA, 0xC44E, 0xD6BC, 0xC44F, 0xD6BD, 0xC450, 0xD6BE, + 0xC451, 0xD6BF, 0xC452, 0xD6C0, 0xC453, 0xD6C1, 0xC454, 0xD6C2, 0xC455, 0xD6C3, 0xC456, 0xD6C6, 0xC457, 0xD6C7, 0xC458, 0xD6C9, + 0xC459, 0xD6CA, 0xC45A, 0xD6CB, 0xC461, 0xD6CD, 0xC462, 0xD6CE, 0xC463, 0xD6CF, 0xC464, 0xD6D0, 0xC465, 0xD6D2, 0xC466, 0xD6D3, + 0xC467, 0xD6D5, 0xC468, 0xD6D6, 0xC469, 0xD6D8, 0xC46A, 0xD6DA, 0xC46B, 0xD6DB, 0xC46C, 0xD6DC, 0xC46D, 0xD6DD, 0xC46E, 0xD6DE, + 0xC46F, 0xD6DF, 0xC470, 0xD6E1, 0xC471, 0xD6E2, 0xC472, 0xD6E3, 0xC473, 0xD6E5, 0xC474, 0xD6E6, 0xC475, 0xD6E7, 0xC476, 0xD6E9, + 0xC477, 0xD6EA, 0xC478, 0xD6EB, 0xC479, 0xD6EC, 0xC47A, 0xD6ED, 0xC481, 0xD6EE, 0xC482, 0xD6EF, 0xC483, 0xD6F1, 0xC484, 0xD6F2, + 0xC485, 0xD6F3, 0xC486, 0xD6F4, 0xC487, 0xD6F6, 0xC488, 0xD6F7, 0xC489, 0xD6F8, 0xC48A, 0xD6F9, 0xC48B, 0xD6FA, 0xC48C, 0xD6FB, + 0xC48D, 0xD6FE, 0xC48E, 0xD6FF, 0xC48F, 0xD701, 0xC490, 0xD702, 0xC491, 0xD703, 0xC492, 0xD705, 0xC493, 0xD706, 0xC494, 0xD707, + 0xC495, 0xD708, 0xC496, 0xD709, 0xC497, 0xD70A, 0xC498, 0xD70B, 0xC499, 0xD70C, 0xC49A, 0xD70D, 0xC49B, 0xD70E, 0xC49C, 0xD70F, + 0xC49D, 0xD710, 0xC49E, 0xD712, 0xC49F, 0xD713, 0xC4A0, 0xD714, 0xC4A1, 0xCE58, 0xC4A2, 0xCE59, 0xC4A3, 0xCE5C, 0xC4A4, 0xCE5F, + 0xC4A5, 0xCE60, 0xC4A6, 0xCE61, 0xC4A7, 0xCE68, 0xC4A8, 0xCE69, 0xC4A9, 0xCE6B, 0xC4AA, 0xCE6D, 0xC4AB, 0xCE74, 0xC4AC, 0xCE75, + 0xC4AD, 0xCE78, 0xC4AE, 0xCE7C, 0xC4AF, 0xCE84, 0xC4B0, 0xCE85, 0xC4B1, 0xCE87, 0xC4B2, 0xCE89, 0xC4B3, 0xCE90, 0xC4B4, 0xCE91, + 0xC4B5, 0xCE94, 0xC4B6, 0xCE98, 0xC4B7, 0xCEA0, 0xC4B8, 0xCEA1, 0xC4B9, 0xCEA3, 0xC4BA, 0xCEA4, 0xC4BB, 0xCEA5, 0xC4BC, 0xCEAC, + 0xC4BD, 0xCEAD, 0xC4BE, 0xCEC1, 0xC4BF, 0xCEE4, 0xC4C0, 0xCEE5, 0xC4C1, 0xCEE8, 0xC4C2, 0xCEEB, 0xC4C3, 0xCEEC, 0xC4C4, 0xCEF4, + 0xC4C5, 0xCEF5, 0xC4C6, 0xCEF7, 0xC4C7, 0xCEF8, 0xC4C8, 0xCEF9, 0xC4C9, 0xCF00, 0xC4CA, 0xCF01, 0xC4CB, 0xCF04, 0xC4CC, 0xCF08, + 0xC4CD, 0xCF10, 0xC4CE, 0xCF11, 0xC4CF, 0xCF13, 0xC4D0, 0xCF15, 0xC4D1, 0xCF1C, 0xC4D2, 0xCF20, 0xC4D3, 0xCF24, 0xC4D4, 0xCF2C, + 0xC4D5, 0xCF2D, 0xC4D6, 0xCF2F, 0xC4D7, 0xCF30, 0xC4D8, 0xCF31, 0xC4D9, 0xCF38, 0xC4DA, 0xCF54, 0xC4DB, 0xCF55, 0xC4DC, 0xCF58, + 0xC4DD, 0xCF5C, 0xC4DE, 0xCF64, 0xC4DF, 0xCF65, 0xC4E0, 0xCF67, 0xC4E1, 0xCF69, 0xC4E2, 0xCF70, 0xC4E3, 0xCF71, 0xC4E4, 0xCF74, + 0xC4E5, 0xCF78, 0xC4E6, 0xCF80, 0xC4E7, 0xCF85, 0xC4E8, 0xCF8C, 0xC4E9, 0xCFA1, 0xC4EA, 0xCFA8, 0xC4EB, 0xCFB0, 0xC4EC, 0xCFC4, + 0xC4ED, 0xCFE0, 0xC4EE, 0xCFE1, 0xC4EF, 0xCFE4, 0xC4F0, 0xCFE8, 0xC4F1, 0xCFF0, 0xC4F2, 0xCFF1, 0xC4F3, 0xCFF3, 0xC4F4, 0xCFF5, + 0xC4F5, 0xCFFC, 0xC4F6, 0xD000, 0xC4F7, 0xD004, 0xC4F8, 0xD011, 0xC4F9, 0xD018, 0xC4FA, 0xD02D, 0xC4FB, 0xD034, 0xC4FC, 0xD035, + 0xC4FD, 0xD038, 0xC4FE, 0xD03C, 0xC541, 0xD715, 0xC542, 0xD716, 0xC543, 0xD717, 0xC544, 0xD71A, 0xC545, 0xD71B, 0xC546, 0xD71D, + 0xC547, 0xD71E, 0xC548, 0xD71F, 0xC549, 0xD721, 0xC54A, 0xD722, 0xC54B, 0xD723, 0xC54C, 0xD724, 0xC54D, 0xD725, 0xC54E, 0xD726, + 0xC54F, 0xD727, 0xC550, 0xD72A, 0xC551, 0xD72C, 0xC552, 0xD72E, 0xC553, 0xD72F, 0xC554, 0xD730, 0xC555, 0xD731, 0xC556, 0xD732, + 0xC557, 0xD733, 0xC558, 0xD736, 0xC559, 0xD737, 0xC55A, 0xD739, 0xC561, 0xD73A, 0xC562, 0xD73B, 0xC563, 0xD73D, 0xC564, 0xD73E, + 0xC565, 0xD73F, 0xC566, 0xD740, 0xC567, 0xD741, 0xC568, 0xD742, 0xC569, 0xD743, 0xC56A, 0xD745, 0xC56B, 0xD746, 0xC56C, 0xD748, + 0xC56D, 0xD74A, 0xC56E, 0xD74B, 0xC56F, 0xD74C, 0xC570, 0xD74D, 0xC571, 0xD74E, 0xC572, 0xD74F, 0xC573, 0xD752, 0xC574, 0xD753, + 0xC575, 0xD755, 0xC576, 0xD75A, 0xC577, 0xD75B, 0xC578, 0xD75C, 0xC579, 0xD75D, 0xC57A, 0xD75E, 0xC581, 0xD75F, 0xC582, 0xD762, + 0xC583, 0xD764, 0xC584, 0xD766, 0xC585, 0xD767, 0xC586, 0xD768, 0xC587, 0xD76A, 0xC588, 0xD76B, 0xC589, 0xD76D, 0xC58A, 0xD76E, + 0xC58B, 0xD76F, 0xC58C, 0xD771, 0xC58D, 0xD772, 0xC58E, 0xD773, 0xC58F, 0xD775, 0xC590, 0xD776, 0xC591, 0xD777, 0xC592, 0xD778, + 0xC593, 0xD779, 0xC594, 0xD77A, 0xC595, 0xD77B, 0xC596, 0xD77E, 0xC597, 0xD77F, 0xC598, 0xD780, 0xC599, 0xD782, 0xC59A, 0xD783, + 0xC59B, 0xD784, 0xC59C, 0xD785, 0xC59D, 0xD786, 0xC59E, 0xD787, 0xC59F, 0xD78A, 0xC5A0, 0xD78B, 0xC5A1, 0xD044, 0xC5A2, 0xD045, + 0xC5A3, 0xD047, 0xC5A4, 0xD049, 0xC5A5, 0xD050, 0xC5A6, 0xD054, 0xC5A7, 0xD058, 0xC5A8, 0xD060, 0xC5A9, 0xD06C, 0xC5AA, 0xD06D, + 0xC5AB, 0xD070, 0xC5AC, 0xD074, 0xC5AD, 0xD07C, 0xC5AE, 0xD07D, 0xC5AF, 0xD081, 0xC5B0, 0xD0A4, 0xC5B1, 0xD0A5, 0xC5B2, 0xD0A8, + 0xC5B3, 0xD0AC, 0xC5B4, 0xD0B4, 0xC5B5, 0xD0B5, 0xC5B6, 0xD0B7, 0xC5B7, 0xD0B9, 0xC5B8, 0xD0C0, 0xC5B9, 0xD0C1, 0xC5BA, 0xD0C4, + 0xC5BB, 0xD0C8, 0xC5BC, 0xD0C9, 0xC5BD, 0xD0D0, 0xC5BE, 0xD0D1, 0xC5BF, 0xD0D3, 0xC5C0, 0xD0D4, 0xC5C1, 0xD0D5, 0xC5C2, 0xD0DC, + 0xC5C3, 0xD0DD, 0xC5C4, 0xD0E0, 0xC5C5, 0xD0E4, 0xC5C6, 0xD0EC, 0xC5C7, 0xD0ED, 0xC5C8, 0xD0EF, 0xC5C9, 0xD0F0, 0xC5CA, 0xD0F1, + 0xC5CB, 0xD0F8, 0xC5CC, 0xD10D, 0xC5CD, 0xD130, 0xC5CE, 0xD131, 0xC5CF, 0xD134, 0xC5D0, 0xD138, 0xC5D1, 0xD13A, 0xC5D2, 0xD140, + 0xC5D3, 0xD141, 0xC5D4, 0xD143, 0xC5D5, 0xD144, 0xC5D6, 0xD145, 0xC5D7, 0xD14C, 0xC5D8, 0xD14D, 0xC5D9, 0xD150, 0xC5DA, 0xD154, + 0xC5DB, 0xD15C, 0xC5DC, 0xD15D, 0xC5DD, 0xD15F, 0xC5DE, 0xD161, 0xC5DF, 0xD168, 0xC5E0, 0xD16C, 0xC5E1, 0xD17C, 0xC5E2, 0xD184, + 0xC5E3, 0xD188, 0xC5E4, 0xD1A0, 0xC5E5, 0xD1A1, 0xC5E6, 0xD1A4, 0xC5E7, 0xD1A8, 0xC5E8, 0xD1B0, 0xC5E9, 0xD1B1, 0xC5EA, 0xD1B3, + 0xC5EB, 0xD1B5, 0xC5EC, 0xD1BA, 0xC5ED, 0xD1BC, 0xC5EE, 0xD1C0, 0xC5EF, 0xD1D8, 0xC5F0, 0xD1F4, 0xC5F1, 0xD1F8, 0xC5F2, 0xD207, + 0xC5F3, 0xD209, 0xC5F4, 0xD210, 0xC5F5, 0xD22C, 0xC5F6, 0xD22D, 0xC5F7, 0xD230, 0xC5F8, 0xD234, 0xC5F9, 0xD23C, 0xC5FA, 0xD23D, + 0xC5FB, 0xD23F, 0xC5FC, 0xD241, 0xC5FD, 0xD248, 0xC5FE, 0xD25C, 0xC641, 0xD78D, 0xC642, 0xD78E, 0xC643, 0xD78F, 0xC644, 0xD791, + 0xC645, 0xD792, 0xC646, 0xD793, 0xC647, 0xD794, 0xC648, 0xD795, 0xC649, 0xD796, 0xC64A, 0xD797, 0xC64B, 0xD79A, 0xC64C, 0xD79C, + 0xC64D, 0xD79E, 0xC64E, 0xD79F, 0xC64F, 0xD7A0, 0xC650, 0xD7A1, 0xC651, 0xD7A2, 0xC652, 0xD7A3, 0xC6A1, 0xD264, 0xC6A2, 0xD280, + 0xC6A3, 0xD281, 0xC6A4, 0xD284, 0xC6A5, 0xD288, 0xC6A6, 0xD290, 0xC6A7, 0xD291, 0xC6A8, 0xD295, 0xC6A9, 0xD29C, 0xC6AA, 0xD2A0, + 0xC6AB, 0xD2A4, 0xC6AC, 0xD2AC, 0xC6AD, 0xD2B1, 0xC6AE, 0xD2B8, 0xC6AF, 0xD2B9, 0xC6B0, 0xD2BC, 0xC6B1, 0xD2BF, 0xC6B2, 0xD2C0, + 0xC6B3, 0xD2C2, 0xC6B4, 0xD2C8, 0xC6B5, 0xD2C9, 0xC6B6, 0xD2CB, 0xC6B7, 0xD2D4, 0xC6B8, 0xD2D8, 0xC6B9, 0xD2DC, 0xC6BA, 0xD2E4, + 0xC6BB, 0xD2E5, 0xC6BC, 0xD2F0, 0xC6BD, 0xD2F1, 0xC6BE, 0xD2F4, 0xC6BF, 0xD2F8, 0xC6C0, 0xD300, 0xC6C1, 0xD301, 0xC6C2, 0xD303, + 0xC6C3, 0xD305, 0xC6C4, 0xD30C, 0xC6C5, 0xD30D, 0xC6C6, 0xD30E, 0xC6C7, 0xD310, 0xC6C8, 0xD314, 0xC6C9, 0xD316, 0xC6CA, 0xD31C, + 0xC6CB, 0xD31D, 0xC6CC, 0xD31F, 0xC6CD, 0xD320, 0xC6CE, 0xD321, 0xC6CF, 0xD325, 0xC6D0, 0xD328, 0xC6D1, 0xD329, 0xC6D2, 0xD32C, + 0xC6D3, 0xD330, 0xC6D4, 0xD338, 0xC6D5, 0xD339, 0xC6D6, 0xD33B, 0xC6D7, 0xD33C, 0xC6D8, 0xD33D, 0xC6D9, 0xD344, 0xC6DA, 0xD345, + 0xC6DB, 0xD37C, 0xC6DC, 0xD37D, 0xC6DD, 0xD380, 0xC6DE, 0xD384, 0xC6DF, 0xD38C, 0xC6E0, 0xD38D, 0xC6E1, 0xD38F, 0xC6E2, 0xD390, + 0xC6E3, 0xD391, 0xC6E4, 0xD398, 0xC6E5, 0xD399, 0xC6E6, 0xD39C, 0xC6E7, 0xD3A0, 0xC6E8, 0xD3A8, 0xC6E9, 0xD3A9, 0xC6EA, 0xD3AB, + 0xC6EB, 0xD3AD, 0xC6EC, 0xD3B4, 0xC6ED, 0xD3B8, 0xC6EE, 0xD3BC, 0xC6EF, 0xD3C4, 0xC6F0, 0xD3C5, 0xC6F1, 0xD3C8, 0xC6F2, 0xD3C9, + 0xC6F3, 0xD3D0, 0xC6F4, 0xD3D8, 0xC6F5, 0xD3E1, 0xC6F6, 0xD3E3, 0xC6F7, 0xD3EC, 0xC6F8, 0xD3ED, 0xC6F9, 0xD3F0, 0xC6FA, 0xD3F4, + 0xC6FB, 0xD3FC, 0xC6FC, 0xD3FD, 0xC6FD, 0xD3FF, 0xC6FE, 0xD401, 0xC7A1, 0xD408, 0xC7A2, 0xD41D, 0xC7A3, 0xD440, 0xC7A4, 0xD444, + 0xC7A5, 0xD45C, 0xC7A6, 0xD460, 0xC7A7, 0xD464, 0xC7A8, 0xD46D, 0xC7A9, 0xD46F, 0xC7AA, 0xD478, 0xC7AB, 0xD479, 0xC7AC, 0xD47C, + 0xC7AD, 0xD47F, 0xC7AE, 0xD480, 0xC7AF, 0xD482, 0xC7B0, 0xD488, 0xC7B1, 0xD489, 0xC7B2, 0xD48B, 0xC7B3, 0xD48D, 0xC7B4, 0xD494, + 0xC7B5, 0xD4A9, 0xC7B6, 0xD4CC, 0xC7B7, 0xD4D0, 0xC7B8, 0xD4D4, 0xC7B9, 0xD4DC, 0xC7BA, 0xD4DF, 0xC7BB, 0xD4E8, 0xC7BC, 0xD4EC, + 0xC7BD, 0xD4F0, 0xC7BE, 0xD4F8, 0xC7BF, 0xD4FB, 0xC7C0, 0xD4FD, 0xC7C1, 0xD504, 0xC7C2, 0xD508, 0xC7C3, 0xD50C, 0xC7C4, 0xD514, + 0xC7C5, 0xD515, 0xC7C6, 0xD517, 0xC7C7, 0xD53C, 0xC7C8, 0xD53D, 0xC7C9, 0xD540, 0xC7CA, 0xD544, 0xC7CB, 0xD54C, 0xC7CC, 0xD54D, + 0xC7CD, 0xD54F, 0xC7CE, 0xD551, 0xC7CF, 0xD558, 0xC7D0, 0xD559, 0xC7D1, 0xD55C, 0xC7D2, 0xD560, 0xC7D3, 0xD565, 0xC7D4, 0xD568, + 0xC7D5, 0xD569, 0xC7D6, 0xD56B, 0xC7D7, 0xD56D, 0xC7D8, 0xD574, 0xC7D9, 0xD575, 0xC7DA, 0xD578, 0xC7DB, 0xD57C, 0xC7DC, 0xD584, + 0xC7DD, 0xD585, 0xC7DE, 0xD587, 0xC7DF, 0xD588, 0xC7E0, 0xD589, 0xC7E1, 0xD590, 0xC7E2, 0xD5A5, 0xC7E3, 0xD5C8, 0xC7E4, 0xD5C9, + 0xC7E5, 0xD5CC, 0xC7E6, 0xD5D0, 0xC7E7, 0xD5D2, 0xC7E8, 0xD5D8, 0xC7E9, 0xD5D9, 0xC7EA, 0xD5DB, 0xC7EB, 0xD5DD, 0xC7EC, 0xD5E4, + 0xC7ED, 0xD5E5, 0xC7EE, 0xD5E8, 0xC7EF, 0xD5EC, 0xC7F0, 0xD5F4, 0xC7F1, 0xD5F5, 0xC7F2, 0xD5F7, 0xC7F3, 0xD5F9, 0xC7F4, 0xD600, + 0xC7F5, 0xD601, 0xC7F6, 0xD604, 0xC7F7, 0xD608, 0xC7F8, 0xD610, 0xC7F9, 0xD611, 0xC7FA, 0xD613, 0xC7FB, 0xD614, 0xC7FC, 0xD615, + 0xC7FD, 0xD61C, 0xC7FE, 0xD620, 0xC8A1, 0xD624, 0xC8A2, 0xD62D, 0xC8A3, 0xD638, 0xC8A4, 0xD639, 0xC8A5, 0xD63C, 0xC8A6, 0xD640, + 0xC8A7, 0xD645, 0xC8A8, 0xD648, 0xC8A9, 0xD649, 0xC8AA, 0xD64B, 0xC8AB, 0xD64D, 0xC8AC, 0xD651, 0xC8AD, 0xD654, 0xC8AE, 0xD655, + 0xC8AF, 0xD658, 0xC8B0, 0xD65C, 0xC8B1, 0xD667, 0xC8B2, 0xD669, 0xC8B3, 0xD670, 0xC8B4, 0xD671, 0xC8B5, 0xD674, 0xC8B6, 0xD683, + 0xC8B7, 0xD685, 0xC8B8, 0xD68C, 0xC8B9, 0xD68D, 0xC8BA, 0xD690, 0xC8BB, 0xD694, 0xC8BC, 0xD69D, 0xC8BD, 0xD69F, 0xC8BE, 0xD6A1, + 0xC8BF, 0xD6A8, 0xC8C0, 0xD6AC, 0xC8C1, 0xD6B0, 0xC8C2, 0xD6B9, 0xC8C3, 0xD6BB, 0xC8C4, 0xD6C4, 0xC8C5, 0xD6C5, 0xC8C6, 0xD6C8, + 0xC8C7, 0xD6CC, 0xC8C8, 0xD6D1, 0xC8C9, 0xD6D4, 0xC8CA, 0xD6D7, 0xC8CB, 0xD6D9, 0xC8CC, 0xD6E0, 0xC8CD, 0xD6E4, 0xC8CE, 0xD6E8, + 0xC8CF, 0xD6F0, 0xC8D0, 0xD6F5, 0xC8D1, 0xD6FC, 0xC8D2, 0xD6FD, 0xC8D3, 0xD700, 0xC8D4, 0xD704, 0xC8D5, 0xD711, 0xC8D6, 0xD718, + 0xC8D7, 0xD719, 0xC8D8, 0xD71C, 0xC8D9, 0xD720, 0xC8DA, 0xD728, 0xC8DB, 0xD729, 0xC8DC, 0xD72B, 0xC8DD, 0xD72D, 0xC8DE, 0xD734, + 0xC8DF, 0xD735, 0xC8E0, 0xD738, 0xC8E1, 0xD73C, 0xC8E2, 0xD744, 0xC8E3, 0xD747, 0xC8E4, 0xD749, 0xC8E5, 0xD750, 0xC8E6, 0xD751, + 0xC8E7, 0xD754, 0xC8E8, 0xD756, 0xC8E9, 0xD757, 0xC8EA, 0xD758, 0xC8EB, 0xD759, 0xC8EC, 0xD760, 0xC8ED, 0xD761, 0xC8EE, 0xD763, + 0xC8EF, 0xD765, 0xC8F0, 0xD769, 0xC8F1, 0xD76C, 0xC8F2, 0xD770, 0xC8F3, 0xD774, 0xC8F4, 0xD77C, 0xC8F5, 0xD77D, 0xC8F6, 0xD781, + 0xC8F7, 0xD788, 0xC8F8, 0xD789, 0xC8F9, 0xD78C, 0xC8FA, 0xD790, 0xC8FB, 0xD798, 0xC8FC, 0xD799, 0xC8FD, 0xD79B, 0xC8FE, 0xD79D, + 0xCAA1, 0x4F3D, 0xCAA2, 0x4F73, 0xCAA3, 0x5047, 0xCAA4, 0x50F9, 0xCAA5, 0x52A0, 0xCAA6, 0x53EF, 0xCAA7, 0x5475, 0xCAA8, 0x54E5, + 0xCAA9, 0x5609, 0xCAAA, 0x5AC1, 0xCAAB, 0x5BB6, 0xCAAC, 0x6687, 0xCAAD, 0x67B6, 0xCAAE, 0x67B7, 0xCAAF, 0x67EF, 0xCAB0, 0x6B4C, + 0xCAB1, 0x73C2, 0xCAB2, 0x75C2, 0xCAB3, 0x7A3C, 0xCAB4, 0x82DB, 0xCAB5, 0x8304, 0xCAB6, 0x8857, 0xCAB7, 0x8888, 0xCAB8, 0x8A36, + 0xCAB9, 0x8CC8, 0xCABA, 0x8DCF, 0xCABB, 0x8EFB, 0xCABC, 0x8FE6, 0xCABD, 0x99D5, 0xCABE, 0x523B, 0xCABF, 0x5374, 0xCAC0, 0x5404, + 0xCAC1, 0x606A, 0xCAC2, 0x6164, 0xCAC3, 0x6BBC, 0xCAC4, 0x73CF, 0xCAC5, 0x811A, 0xCAC6, 0x89BA, 0xCAC7, 0x89D2, 0xCAC8, 0x95A3, + 0xCAC9, 0x4F83, 0xCACA, 0x520A, 0xCACB, 0x58BE, 0xCACC, 0x5978, 0xCACD, 0x59E6, 0xCACE, 0x5E72, 0xCACF, 0x5E79, 0xCAD0, 0x61C7, + 0xCAD1, 0x63C0, 0xCAD2, 0x6746, 0xCAD3, 0x67EC, 0xCAD4, 0x687F, 0xCAD5, 0x6F97, 0xCAD6, 0x764E, 0xCAD7, 0x770B, 0xCAD8, 0x78F5, + 0xCAD9, 0x7A08, 0xCADA, 0x7AFF, 0xCADB, 0x7C21, 0xCADC, 0x809D, 0xCADD, 0x826E, 0xCADE, 0x8271, 0xCADF, 0x8AEB, 0xCAE0, 0x9593, + 0xCAE1, 0x4E6B, 0xCAE2, 0x559D, 0xCAE3, 0x66F7, 0xCAE4, 0x6E34, 0xCAE5, 0x78A3, 0xCAE6, 0x7AED, 0xCAE7, 0x845B, 0xCAE8, 0x8910, + 0xCAE9, 0x874E, 0xCAEA, 0x97A8, 0xCAEB, 0x52D8, 0xCAEC, 0x574E, 0xCAED, 0x582A, 0xCAEE, 0x5D4C, 0xCAEF, 0x611F, 0xCAF0, 0x61BE, + 0xCAF1, 0x6221, 0xCAF2, 0x6562, 0xCAF3, 0x67D1, 0xCAF4, 0x6A44, 0xCAF5, 0x6E1B, 0xCAF6, 0x7518, 0xCAF7, 0x75B3, 0xCAF8, 0x76E3, + 0xCAF9, 0x77B0, 0xCAFA, 0x7D3A, 0xCAFB, 0x90AF, 0xCAFC, 0x9451, 0xCAFD, 0x9452, 0xCAFE, 0x9F95, 0xCBA1, 0x5323, 0xCBA2, 0x5CAC, + 0xCBA3, 0x7532, 0xCBA4, 0x80DB, 0xCBA5, 0x9240, 0xCBA6, 0x9598, 0xCBA7, 0x525B, 0xCBA8, 0x5808, 0xCBA9, 0x59DC, 0xCBAA, 0x5CA1, + 0xCBAB, 0x5D17, 0xCBAC, 0x5EB7, 0xCBAD, 0x5F3A, 0xCBAE, 0x5F4A, 0xCBAF, 0x6177, 0xCBB0, 0x6C5F, 0xCBB1, 0x757A, 0xCBB2, 0x7586, + 0xCBB3, 0x7CE0, 0xCBB4, 0x7D73, 0xCBB5, 0x7DB1, 0xCBB6, 0x7F8C, 0xCBB7, 0x8154, 0xCBB8, 0x8221, 0xCBB9, 0x8591, 0xCBBA, 0x8941, + 0xCBBB, 0x8B1B, 0xCBBC, 0x92FC, 0xCBBD, 0x964D, 0xCBBE, 0x9C47, 0xCBBF, 0x4ECB, 0xCBC0, 0x4EF7, 0xCBC1, 0x500B, 0xCBC2, 0x51F1, + 0xCBC3, 0x584F, 0xCBC4, 0x6137, 0xCBC5, 0x613E, 0xCBC6, 0x6168, 0xCBC7, 0x6539, 0xCBC8, 0x69EA, 0xCBC9, 0x6F11, 0xCBCA, 0x75A5, + 0xCBCB, 0x7686, 0xCBCC, 0x76D6, 0xCBCD, 0x7B87, 0xCBCE, 0x82A5, 0xCBCF, 0x84CB, 0xCBD0, 0xF900, 0xCBD1, 0x93A7, 0xCBD2, 0x958B, + 0xCBD3, 0x5580, 0xCBD4, 0x5BA2, 0xCBD5, 0x5751, 0xCBD6, 0xF901, 0xCBD7, 0x7CB3, 0xCBD8, 0x7FB9, 0xCBD9, 0x91B5, 0xCBDA, 0x5028, + 0xCBDB, 0x53BB, 0xCBDC, 0x5C45, 0xCBDD, 0x5DE8, 0xCBDE, 0x62D2, 0xCBDF, 0x636E, 0xCBE0, 0x64DA, 0xCBE1, 0x64E7, 0xCBE2, 0x6E20, + 0xCBE3, 0x70AC, 0xCBE4, 0x795B, 0xCBE5, 0x8DDD, 0xCBE6, 0x8E1E, 0xCBE7, 0xF902, 0xCBE8, 0x907D, 0xCBE9, 0x9245, 0xCBEA, 0x92F8, + 0xCBEB, 0x4E7E, 0xCBEC, 0x4EF6, 0xCBED, 0x5065, 0xCBEE, 0x5DFE, 0xCBEF, 0x5EFA, 0xCBF0, 0x6106, 0xCBF1, 0x6957, 0xCBF2, 0x8171, + 0xCBF3, 0x8654, 0xCBF4, 0x8E47, 0xCBF5, 0x9375, 0xCBF6, 0x9A2B, 0xCBF7, 0x4E5E, 0xCBF8, 0x5091, 0xCBF9, 0x6770, 0xCBFA, 0x6840, + 0xCBFB, 0x5109, 0xCBFC, 0x528D, 0xCBFD, 0x5292, 0xCBFE, 0x6AA2, 0xCCA1, 0x77BC, 0xCCA2, 0x9210, 0xCCA3, 0x9ED4, 0xCCA4, 0x52AB, + 0xCCA5, 0x602F, 0xCCA6, 0x8FF2, 0xCCA7, 0x5048, 0xCCA8, 0x61A9, 0xCCA9, 0x63ED, 0xCCAA, 0x64CA, 0xCCAB, 0x683C, 0xCCAC, 0x6A84, + 0xCCAD, 0x6FC0, 0xCCAE, 0x8188, 0xCCAF, 0x89A1, 0xCCB0, 0x9694, 0xCCB1, 0x5805, 0xCCB2, 0x727D, 0xCCB3, 0x72AC, 0xCCB4, 0x7504, + 0xCCB5, 0x7D79, 0xCCB6, 0x7E6D, 0xCCB7, 0x80A9, 0xCCB8, 0x898B, 0xCCB9, 0x8B74, 0xCCBA, 0x9063, 0xCCBB, 0x9D51, 0xCCBC, 0x6289, + 0xCCBD, 0x6C7A, 0xCCBE, 0x6F54, 0xCCBF, 0x7D50, 0xCCC0, 0x7F3A, 0xCCC1, 0x8A23, 0xCCC2, 0x517C, 0xCCC3, 0x614A, 0xCCC4, 0x7B9D, + 0xCCC5, 0x8B19, 0xCCC6, 0x9257, 0xCCC7, 0x938C, 0xCCC8, 0x4EAC, 0xCCC9, 0x4FD3, 0xCCCA, 0x501E, 0xCCCB, 0x50BE, 0xCCCC, 0x5106, + 0xCCCD, 0x52C1, 0xCCCE, 0x52CD, 0xCCCF, 0x537F, 0xCCD0, 0x5770, 0xCCD1, 0x5883, 0xCCD2, 0x5E9A, 0xCCD3, 0x5F91, 0xCCD4, 0x6176, + 0xCCD5, 0x61AC, 0xCCD6, 0x64CE, 0xCCD7, 0x656C, 0xCCD8, 0x666F, 0xCCD9, 0x66BB, 0xCCDA, 0x66F4, 0xCCDB, 0x6897, 0xCCDC, 0x6D87, + 0xCCDD, 0x7085, 0xCCDE, 0x70F1, 0xCCDF, 0x749F, 0xCCE0, 0x74A5, 0xCCE1, 0x74CA, 0xCCE2, 0x75D9, 0xCCE3, 0x786C, 0xCCE4, 0x78EC, + 0xCCE5, 0x7ADF, 0xCCE6, 0x7AF6, 0xCCE7, 0x7D45, 0xCCE8, 0x7D93, 0xCCE9, 0x8015, 0xCCEA, 0x803F, 0xCCEB, 0x811B, 0xCCEC, 0x8396, + 0xCCED, 0x8B66, 0xCCEE, 0x8F15, 0xCCEF, 0x9015, 0xCCF0, 0x93E1, 0xCCF1, 0x9803, 0xCCF2, 0x9838, 0xCCF3, 0x9A5A, 0xCCF4, 0x9BE8, + 0xCCF5, 0x4FC2, 0xCCF6, 0x5553, 0xCCF7, 0x583A, 0xCCF8, 0x5951, 0xCCF9, 0x5B63, 0xCCFA, 0x5C46, 0xCCFB, 0x60B8, 0xCCFC, 0x6212, + 0xCCFD, 0x6842, 0xCCFE, 0x68B0, 0xCDA1, 0x68E8, 0xCDA2, 0x6EAA, 0xCDA3, 0x754C, 0xCDA4, 0x7678, 0xCDA5, 0x78CE, 0xCDA6, 0x7A3D, + 0xCDA7, 0x7CFB, 0xCDA8, 0x7E6B, 0xCDA9, 0x7E7C, 0xCDAA, 0x8A08, 0xCDAB, 0x8AA1, 0xCDAC, 0x8C3F, 0xCDAD, 0x968E, 0xCDAE, 0x9DC4, + 0xCDAF, 0x53E4, 0xCDB0, 0x53E9, 0xCDB1, 0x544A, 0xCDB2, 0x5471, 0xCDB3, 0x56FA, 0xCDB4, 0x59D1, 0xCDB5, 0x5B64, 0xCDB6, 0x5C3B, + 0xCDB7, 0x5EAB, 0xCDB8, 0x62F7, 0xCDB9, 0x6537, 0xCDBA, 0x6545, 0xCDBB, 0x6572, 0xCDBC, 0x66A0, 0xCDBD, 0x67AF, 0xCDBE, 0x69C1, + 0xCDBF, 0x6CBD, 0xCDC0, 0x75FC, 0xCDC1, 0x7690, 0xCDC2, 0x777E, 0xCDC3, 0x7A3F, 0xCDC4, 0x7F94, 0xCDC5, 0x8003, 0xCDC6, 0x80A1, + 0xCDC7, 0x818F, 0xCDC8, 0x82E6, 0xCDC9, 0x82FD, 0xCDCA, 0x83F0, 0xCDCB, 0x85C1, 0xCDCC, 0x8831, 0xCDCD, 0x88B4, 0xCDCE, 0x8AA5, + 0xCDCF, 0xF903, 0xCDD0, 0x8F9C, 0xCDD1, 0x932E, 0xCDD2, 0x96C7, 0xCDD3, 0x9867, 0xCDD4, 0x9AD8, 0xCDD5, 0x9F13, 0xCDD6, 0x54ED, + 0xCDD7, 0x659B, 0xCDD8, 0x66F2, 0xCDD9, 0x688F, 0xCDDA, 0x7A40, 0xCDDB, 0x8C37, 0xCDDC, 0x9D60, 0xCDDD, 0x56F0, 0xCDDE, 0x5764, + 0xCDDF, 0x5D11, 0xCDE0, 0x6606, 0xCDE1, 0x68B1, 0xCDE2, 0x68CD, 0xCDE3, 0x6EFE, 0xCDE4, 0x7428, 0xCDE5, 0x889E, 0xCDE6, 0x9BE4, + 0xCDE7, 0x6C68, 0xCDE8, 0xF904, 0xCDE9, 0x9AA8, 0xCDEA, 0x4F9B, 0xCDEB, 0x516C, 0xCDEC, 0x5171, 0xCDED, 0x529F, 0xCDEE, 0x5B54, + 0xCDEF, 0x5DE5, 0xCDF0, 0x6050, 0xCDF1, 0x606D, 0xCDF2, 0x62F1, 0xCDF3, 0x63A7, 0xCDF4, 0x653B, 0xCDF5, 0x73D9, 0xCDF6, 0x7A7A, + 0xCDF7, 0x86A3, 0xCDF8, 0x8CA2, 0xCDF9, 0x978F, 0xCDFA, 0x4E32, 0xCDFB, 0x5BE1, 0xCDFC, 0x6208, 0xCDFD, 0x679C, 0xCDFE, 0x74DC, + 0xCEA1, 0x79D1, 0xCEA2, 0x83D3, 0xCEA3, 0x8A87, 0xCEA4, 0x8AB2, 0xCEA5, 0x8DE8, 0xCEA6, 0x904E, 0xCEA7, 0x934B, 0xCEA8, 0x9846, + 0xCEA9, 0x5ED3, 0xCEAA, 0x69E8, 0xCEAB, 0x85FF, 0xCEAC, 0x90ED, 0xCEAD, 0xF905, 0xCEAE, 0x51A0, 0xCEAF, 0x5B98, 0xCEB0, 0x5BEC, + 0xCEB1, 0x6163, 0xCEB2, 0x68FA, 0xCEB3, 0x6B3E, 0xCEB4, 0x704C, 0xCEB5, 0x742F, 0xCEB6, 0x74D8, 0xCEB7, 0x7BA1, 0xCEB8, 0x7F50, + 0xCEB9, 0x83C5, 0xCEBA, 0x89C0, 0xCEBB, 0x8CAB, 0xCEBC, 0x95DC, 0xCEBD, 0x9928, 0xCEBE, 0x522E, 0xCEBF, 0x605D, 0xCEC0, 0x62EC, + 0xCEC1, 0x9002, 0xCEC2, 0x4F8A, 0xCEC3, 0x5149, 0xCEC4, 0x5321, 0xCEC5, 0x58D9, 0xCEC6, 0x5EE3, 0xCEC7, 0x66E0, 0xCEC8, 0x6D38, + 0xCEC9, 0x709A, 0xCECA, 0x72C2, 0xCECB, 0x73D6, 0xCECC, 0x7B50, 0xCECD, 0x80F1, 0xCECE, 0x945B, 0xCECF, 0x5366, 0xCED0, 0x639B, + 0xCED1, 0x7F6B, 0xCED2, 0x4E56, 0xCED3, 0x5080, 0xCED4, 0x584A, 0xCED5, 0x58DE, 0xCED6, 0x602A, 0xCED7, 0x6127, 0xCED8, 0x62D0, + 0xCED9, 0x69D0, 0xCEDA, 0x9B41, 0xCEDB, 0x5B8F, 0xCEDC, 0x7D18, 0xCEDD, 0x80B1, 0xCEDE, 0x8F5F, 0xCEDF, 0x4EA4, 0xCEE0, 0x50D1, + 0xCEE1, 0x54AC, 0xCEE2, 0x55AC, 0xCEE3, 0x5B0C, 0xCEE4, 0x5DA0, 0xCEE5, 0x5DE7, 0xCEE6, 0x652A, 0xCEE7, 0x654E, 0xCEE8, 0x6821, + 0xCEE9, 0x6A4B, 0xCEEA, 0x72E1, 0xCEEB, 0x768E, 0xCEEC, 0x77EF, 0xCEED, 0x7D5E, 0xCEEE, 0x7FF9, 0xCEEF, 0x81A0, 0xCEF0, 0x854E, + 0xCEF1, 0x86DF, 0xCEF2, 0x8F03, 0xCEF3, 0x8F4E, 0xCEF4, 0x90CA, 0xCEF5, 0x9903, 0xCEF6, 0x9A55, 0xCEF7, 0x9BAB, 0xCEF8, 0x4E18, + 0xCEF9, 0x4E45, 0xCEFA, 0x4E5D, 0xCEFB, 0x4EC7, 0xCEFC, 0x4FF1, 0xCEFD, 0x5177, 0xCEFE, 0x52FE, 0xCFA1, 0x5340, 0xCFA2, 0x53E3, + 0xCFA3, 0x53E5, 0xCFA4, 0x548E, 0xCFA5, 0x5614, 0xCFA6, 0x5775, 0xCFA7, 0x57A2, 0xCFA8, 0x5BC7, 0xCFA9, 0x5D87, 0xCFAA, 0x5ED0, + 0xCFAB, 0x61FC, 0xCFAC, 0x62D8, 0xCFAD, 0x6551, 0xCFAE, 0x67B8, 0xCFAF, 0x67E9, 0xCFB0, 0x69CB, 0xCFB1, 0x6B50, 0xCFB2, 0x6BC6, + 0xCFB3, 0x6BEC, 0xCFB4, 0x6C42, 0xCFB5, 0x6E9D, 0xCFB6, 0x7078, 0xCFB7, 0x72D7, 0xCFB8, 0x7396, 0xCFB9, 0x7403, 0xCFBA, 0x77BF, + 0xCFBB, 0x77E9, 0xCFBC, 0x7A76, 0xCFBD, 0x7D7F, 0xCFBE, 0x8009, 0xCFBF, 0x81FC, 0xCFC0, 0x8205, 0xCFC1, 0x820A, 0xCFC2, 0x82DF, + 0xCFC3, 0x8862, 0xCFC4, 0x8B33, 0xCFC5, 0x8CFC, 0xCFC6, 0x8EC0, 0xCFC7, 0x9011, 0xCFC8, 0x90B1, 0xCFC9, 0x9264, 0xCFCA, 0x92B6, + 0xCFCB, 0x99D2, 0xCFCC, 0x9A45, 0xCFCD, 0x9CE9, 0xCFCE, 0x9DD7, 0xCFCF, 0x9F9C, 0xCFD0, 0x570B, 0xCFD1, 0x5C40, 0xCFD2, 0x83CA, + 0xCFD3, 0x97A0, 0xCFD4, 0x97AB, 0xCFD5, 0x9EB4, 0xCFD6, 0x541B, 0xCFD7, 0x7A98, 0xCFD8, 0x7FA4, 0xCFD9, 0x88D9, 0xCFDA, 0x8ECD, + 0xCFDB, 0x90E1, 0xCFDC, 0x5800, 0xCFDD, 0x5C48, 0xCFDE, 0x6398, 0xCFDF, 0x7A9F, 0xCFE0, 0x5BAE, 0xCFE1, 0x5F13, 0xCFE2, 0x7A79, + 0xCFE3, 0x7AAE, 0xCFE4, 0x828E, 0xCFE5, 0x8EAC, 0xCFE6, 0x5026, 0xCFE7, 0x5238, 0xCFE8, 0x52F8, 0xCFE9, 0x5377, 0xCFEA, 0x5708, + 0xCFEB, 0x62F3, 0xCFEC, 0x6372, 0xCFED, 0x6B0A, 0xCFEE, 0x6DC3, 0xCFEF, 0x7737, 0xCFF0, 0x53A5, 0xCFF1, 0x7357, 0xCFF2, 0x8568, + 0xCFF3, 0x8E76, 0xCFF4, 0x95D5, 0xCFF5, 0x673A, 0xCFF6, 0x6AC3, 0xCFF7, 0x6F70, 0xCFF8, 0x8A6D, 0xCFF9, 0x8ECC, 0xCFFA, 0x994B, + 0xCFFB, 0xF906, 0xCFFC, 0x6677, 0xCFFD, 0x6B78, 0xCFFE, 0x8CB4, 0xD0A1, 0x9B3C, 0xD0A2, 0xF907, 0xD0A3, 0x53EB, 0xD0A4, 0x572D, + 0xD0A5, 0x594E, 0xD0A6, 0x63C6, 0xD0A7, 0x69FB, 0xD0A8, 0x73EA, 0xD0A9, 0x7845, 0xD0AA, 0x7ABA, 0xD0AB, 0x7AC5, 0xD0AC, 0x7CFE, + 0xD0AD, 0x8475, 0xD0AE, 0x898F, 0xD0AF, 0x8D73, 0xD0B0, 0x9035, 0xD0B1, 0x95A8, 0xD0B2, 0x52FB, 0xD0B3, 0x5747, 0xD0B4, 0x7547, + 0xD0B5, 0x7B60, 0xD0B6, 0x83CC, 0xD0B7, 0x921E, 0xD0B8, 0xF908, 0xD0B9, 0x6A58, 0xD0BA, 0x514B, 0xD0BB, 0x524B, 0xD0BC, 0x5287, + 0xD0BD, 0x621F, 0xD0BE, 0x68D8, 0xD0BF, 0x6975, 0xD0C0, 0x9699, 0xD0C1, 0x50C5, 0xD0C2, 0x52A4, 0xD0C3, 0x52E4, 0xD0C4, 0x61C3, + 0xD0C5, 0x65A4, 0xD0C6, 0x6839, 0xD0C7, 0x69FF, 0xD0C8, 0x747E, 0xD0C9, 0x7B4B, 0xD0CA, 0x82B9, 0xD0CB, 0x83EB, 0xD0CC, 0x89B2, + 0xD0CD, 0x8B39, 0xD0CE, 0x8FD1, 0xD0CF, 0x9949, 0xD0D0, 0xF909, 0xD0D1, 0x4ECA, 0xD0D2, 0x5997, 0xD0D3, 0x64D2, 0xD0D4, 0x6611, + 0xD0D5, 0x6A8E, 0xD0D6, 0x7434, 0xD0D7, 0x7981, 0xD0D8, 0x79BD, 0xD0D9, 0x82A9, 0xD0DA, 0x887E, 0xD0DB, 0x887F, 0xD0DC, 0x895F, + 0xD0DD, 0xF90A, 0xD0DE, 0x9326, 0xD0DF, 0x4F0B, 0xD0E0, 0x53CA, 0xD0E1, 0x6025, 0xD0E2, 0x6271, 0xD0E3, 0x6C72, 0xD0E4, 0x7D1A, + 0xD0E5, 0x7D66, 0xD0E6, 0x4E98, 0xD0E7, 0x5162, 0xD0E8, 0x77DC, 0xD0E9, 0x80AF, 0xD0EA, 0x4F01, 0xD0EB, 0x4F0E, 0xD0EC, 0x5176, + 0xD0ED, 0x5180, 0xD0EE, 0x55DC, 0xD0EF, 0x5668, 0xD0F0, 0x573B, 0xD0F1, 0x57FA, 0xD0F2, 0x57FC, 0xD0F3, 0x5914, 0xD0F4, 0x5947, + 0xD0F5, 0x5993, 0xD0F6, 0x5BC4, 0xD0F7, 0x5C90, 0xD0F8, 0x5D0E, 0xD0F9, 0x5DF1, 0xD0FA, 0x5E7E, 0xD0FB, 0x5FCC, 0xD0FC, 0x6280, + 0xD0FD, 0x65D7, 0xD0FE, 0x65E3, 0xD1A1, 0x671E, 0xD1A2, 0x671F, 0xD1A3, 0x675E, 0xD1A4, 0x68CB, 0xD1A5, 0x68C4, 0xD1A6, 0x6A5F, + 0xD1A7, 0x6B3A, 0xD1A8, 0x6C23, 0xD1A9, 0x6C7D, 0xD1AA, 0x6C82, 0xD1AB, 0x6DC7, 0xD1AC, 0x7398, 0xD1AD, 0x7426, 0xD1AE, 0x742A, + 0xD1AF, 0x7482, 0xD1B0, 0x74A3, 0xD1B1, 0x7578, 0xD1B2, 0x757F, 0xD1B3, 0x7881, 0xD1B4, 0x78EF, 0xD1B5, 0x7941, 0xD1B6, 0x7947, + 0xD1B7, 0x7948, 0xD1B8, 0x797A, 0xD1B9, 0x7B95, 0xD1BA, 0x7D00, 0xD1BB, 0x7DBA, 0xD1BC, 0x7F88, 0xD1BD, 0x8006, 0xD1BE, 0x802D, + 0xD1BF, 0x808C, 0xD1C0, 0x8A18, 0xD1C1, 0x8B4F, 0xD1C2, 0x8C48, 0xD1C3, 0x8D77, 0xD1C4, 0x9321, 0xD1C5, 0x9324, 0xD1C6, 0x98E2, + 0xD1C7, 0x9951, 0xD1C8, 0x9A0E, 0xD1C9, 0x9A0F, 0xD1CA, 0x9A65, 0xD1CB, 0x9E92, 0xD1CC, 0x7DCA, 0xD1CD, 0x4F76, 0xD1CE, 0x5409, + 0xD1CF, 0x62EE, 0xD1D0, 0x6854, 0xD1D1, 0x91D1, 0xD1D2, 0x55AB, 0xD1D3, 0x513A, 0xD1D4, 0xF90B, 0xD1D5, 0xF90C, 0xD1D6, 0x5A1C, + 0xD1D7, 0x61E6, 0xD1D8, 0xF90D, 0xD1D9, 0x62CF, 0xD1DA, 0x62FF, 0xD1DB, 0xF90E, 0xD1DC, 0xF90F, 0xD1DD, 0xF910, 0xD1DE, 0xF911, + 0xD1DF, 0xF912, 0xD1E0, 0xF913, 0xD1E1, 0x90A3, 0xD1E2, 0xF914, 0xD1E3, 0xF915, 0xD1E4, 0xF916, 0xD1E5, 0xF917, 0xD1E6, 0xF918, + 0xD1E7, 0x8AFE, 0xD1E8, 0xF919, 0xD1E9, 0xF91A, 0xD1EA, 0xF91B, 0xD1EB, 0xF91C, 0xD1EC, 0x6696, 0xD1ED, 0xF91D, 0xD1EE, 0x7156, + 0xD1EF, 0xF91E, 0xD1F0, 0xF91F, 0xD1F1, 0x96E3, 0xD1F2, 0xF920, 0xD1F3, 0x634F, 0xD1F4, 0x637A, 0xD1F5, 0x5357, 0xD1F6, 0xF921, + 0xD1F7, 0x678F, 0xD1F8, 0x6960, 0xD1F9, 0x6E73, 0xD1FA, 0xF922, 0xD1FB, 0x7537, 0xD1FC, 0xF923, 0xD1FD, 0xF924, 0xD1FE, 0xF925, + 0xD2A1, 0x7D0D, 0xD2A2, 0xF926, 0xD2A3, 0xF927, 0xD2A4, 0x8872, 0xD2A5, 0x56CA, 0xD2A6, 0x5A18, 0xD2A7, 0xF928, 0xD2A8, 0xF929, + 0xD2A9, 0xF92A, 0xD2AA, 0xF92B, 0xD2AB, 0xF92C, 0xD2AC, 0x4E43, 0xD2AD, 0xF92D, 0xD2AE, 0x5167, 0xD2AF, 0x5948, 0xD2B0, 0x67F0, + 0xD2B1, 0x8010, 0xD2B2, 0xF92E, 0xD2B3, 0x5973, 0xD2B4, 0x5E74, 0xD2B5, 0x649A, 0xD2B6, 0x79CA, 0xD2B7, 0x5FF5, 0xD2B8, 0x606C, + 0xD2B9, 0x62C8, 0xD2BA, 0x637B, 0xD2BB, 0x5BE7, 0xD2BC, 0x5BD7, 0xD2BD, 0x52AA, 0xD2BE, 0xF92F, 0xD2BF, 0x5974, 0xD2C0, 0x5F29, + 0xD2C1, 0x6012, 0xD2C2, 0xF930, 0xD2C3, 0xF931, 0xD2C4, 0xF932, 0xD2C5, 0x7459, 0xD2C6, 0xF933, 0xD2C7, 0xF934, 0xD2C8, 0xF935, + 0xD2C9, 0xF936, 0xD2CA, 0xF937, 0xD2CB, 0xF938, 0xD2CC, 0x99D1, 0xD2CD, 0xF939, 0xD2CE, 0xF93A, 0xD2CF, 0xF93B, 0xD2D0, 0xF93C, + 0xD2D1, 0xF93D, 0xD2D2, 0xF93E, 0xD2D3, 0xF93F, 0xD2D4, 0xF940, 0xD2D5, 0xF941, 0xD2D6, 0xF942, 0xD2D7, 0xF943, 0xD2D8, 0x6FC3, + 0xD2D9, 0xF944, 0xD2DA, 0xF945, 0xD2DB, 0x81BF, 0xD2DC, 0x8FB2, 0xD2DD, 0x60F1, 0xD2DE, 0xF946, 0xD2DF, 0xF947, 0xD2E0, 0x8166, + 0xD2E1, 0xF948, 0xD2E2, 0xF949, 0xD2E3, 0x5C3F, 0xD2E4, 0xF94A, 0xD2E5, 0xF94B, 0xD2E6, 0xF94C, 0xD2E7, 0xF94D, 0xD2E8, 0xF94E, + 0xD2E9, 0xF94F, 0xD2EA, 0xF950, 0xD2EB, 0xF951, 0xD2EC, 0x5AE9, 0xD2ED, 0x8A25, 0xD2EE, 0x677B, 0xD2EF, 0x7D10, 0xD2F0, 0xF952, + 0xD2F1, 0xF953, 0xD2F2, 0xF954, 0xD2F3, 0xF955, 0xD2F4, 0xF956, 0xD2F5, 0xF957, 0xD2F6, 0x80FD, 0xD2F7, 0xF958, 0xD2F8, 0xF959, + 0xD2F9, 0x5C3C, 0xD2FA, 0x6CE5, 0xD2FB, 0x533F, 0xD2FC, 0x6EBA, 0xD2FD, 0x591A, 0xD2FE, 0x8336, 0xD3A1, 0x4E39, 0xD3A2, 0x4EB6, + 0xD3A3, 0x4F46, 0xD3A4, 0x55AE, 0xD3A5, 0x5718, 0xD3A6, 0x58C7, 0xD3A7, 0x5F56, 0xD3A8, 0x65B7, 0xD3A9, 0x65E6, 0xD3AA, 0x6A80, + 0xD3AB, 0x6BB5, 0xD3AC, 0x6E4D, 0xD3AD, 0x77ED, 0xD3AE, 0x7AEF, 0xD3AF, 0x7C1E, 0xD3B0, 0x7DDE, 0xD3B1, 0x86CB, 0xD3B2, 0x8892, + 0xD3B3, 0x9132, 0xD3B4, 0x935B, 0xD3B5, 0x64BB, 0xD3B6, 0x6FBE, 0xD3B7, 0x737A, 0xD3B8, 0x75B8, 0xD3B9, 0x9054, 0xD3BA, 0x5556, + 0xD3BB, 0x574D, 0xD3BC, 0x61BA, 0xD3BD, 0x64D4, 0xD3BE, 0x66C7, 0xD3BF, 0x6DE1, 0xD3C0, 0x6E5B, 0xD3C1, 0x6F6D, 0xD3C2, 0x6FB9, + 0xD3C3, 0x75F0, 0xD3C4, 0x8043, 0xD3C5, 0x81BD, 0xD3C6, 0x8541, 0xD3C7, 0x8983, 0xD3C8, 0x8AC7, 0xD3C9, 0x8B5A, 0xD3CA, 0x931F, + 0xD3CB, 0x6C93, 0xD3CC, 0x7553, 0xD3CD, 0x7B54, 0xD3CE, 0x8E0F, 0xD3CF, 0x905D, 0xD3D0, 0x5510, 0xD3D1, 0x5802, 0xD3D2, 0x5858, + 0xD3D3, 0x5E62, 0xD3D4, 0x6207, 0xD3D5, 0x649E, 0xD3D6, 0x68E0, 0xD3D7, 0x7576, 0xD3D8, 0x7CD6, 0xD3D9, 0x87B3, 0xD3DA, 0x9EE8, + 0xD3DB, 0x4EE3, 0xD3DC, 0x5788, 0xD3DD, 0x576E, 0xD3DE, 0x5927, 0xD3DF, 0x5C0D, 0xD3E0, 0x5CB1, 0xD3E1, 0x5E36, 0xD3E2, 0x5F85, + 0xD3E3, 0x6234, 0xD3E4, 0x64E1, 0xD3E5, 0x73B3, 0xD3E6, 0x81FA, 0xD3E7, 0x888B, 0xD3E8, 0x8CB8, 0xD3E9, 0x968A, 0xD3EA, 0x9EDB, + 0xD3EB, 0x5B85, 0xD3EC, 0x5FB7, 0xD3ED, 0x60B3, 0xD3EE, 0x5012, 0xD3EF, 0x5200, 0xD3F0, 0x5230, 0xD3F1, 0x5716, 0xD3F2, 0x5835, + 0xD3F3, 0x5857, 0xD3F4, 0x5C0E, 0xD3F5, 0x5C60, 0xD3F6, 0x5CF6, 0xD3F7, 0x5D8B, 0xD3F8, 0x5EA6, 0xD3F9, 0x5F92, 0xD3FA, 0x60BC, + 0xD3FB, 0x6311, 0xD3FC, 0x6389, 0xD3FD, 0x6417, 0xD3FE, 0x6843, 0xD4A1, 0x68F9, 0xD4A2, 0x6AC2, 0xD4A3, 0x6DD8, 0xD4A4, 0x6E21, + 0xD4A5, 0x6ED4, 0xD4A6, 0x6FE4, 0xD4A7, 0x71FE, 0xD4A8, 0x76DC, 0xD4A9, 0x7779, 0xD4AA, 0x79B1, 0xD4AB, 0x7A3B, 0xD4AC, 0x8404, + 0xD4AD, 0x89A9, 0xD4AE, 0x8CED, 0xD4AF, 0x8DF3, 0xD4B0, 0x8E48, 0xD4B1, 0x9003, 0xD4B2, 0x9014, 0xD4B3, 0x9053, 0xD4B4, 0x90FD, + 0xD4B5, 0x934D, 0xD4B6, 0x9676, 0xD4B7, 0x97DC, 0xD4B8, 0x6BD2, 0xD4B9, 0x7006, 0xD4BA, 0x7258, 0xD4BB, 0x72A2, 0xD4BC, 0x7368, + 0xD4BD, 0x7763, 0xD4BE, 0x79BF, 0xD4BF, 0x7BE4, 0xD4C0, 0x7E9B, 0xD4C1, 0x8B80, 0xD4C2, 0x58A9, 0xD4C3, 0x60C7, 0xD4C4, 0x6566, + 0xD4C5, 0x65FD, 0xD4C6, 0x66BE, 0xD4C7, 0x6C8C, 0xD4C8, 0x711E, 0xD4C9, 0x71C9, 0xD4CA, 0x8C5A, 0xD4CB, 0x9813, 0xD4CC, 0x4E6D, + 0xD4CD, 0x7A81, 0xD4CE, 0x4EDD, 0xD4CF, 0x51AC, 0xD4D0, 0x51CD, 0xD4D1, 0x52D5, 0xD4D2, 0x540C, 0xD4D3, 0x61A7, 0xD4D4, 0x6771, + 0xD4D5, 0x6850, 0xD4D6, 0x68DF, 0xD4D7, 0x6D1E, 0xD4D8, 0x6F7C, 0xD4D9, 0x75BC, 0xD4DA, 0x77B3, 0xD4DB, 0x7AE5, 0xD4DC, 0x80F4, + 0xD4DD, 0x8463, 0xD4DE, 0x9285, 0xD4DF, 0x515C, 0xD4E0, 0x6597, 0xD4E1, 0x675C, 0xD4E2, 0x6793, 0xD4E3, 0x75D8, 0xD4E4, 0x7AC7, + 0xD4E5, 0x8373, 0xD4E6, 0xF95A, 0xD4E7, 0x8C46, 0xD4E8, 0x9017, 0xD4E9, 0x982D, 0xD4EA, 0x5C6F, 0xD4EB, 0x81C0, 0xD4EC, 0x829A, + 0xD4ED, 0x9041, 0xD4EE, 0x906F, 0xD4EF, 0x920D, 0xD4F0, 0x5F97, 0xD4F1, 0x5D9D, 0xD4F2, 0x6A59, 0xD4F3, 0x71C8, 0xD4F4, 0x767B, + 0xD4F5, 0x7B49, 0xD4F6, 0x85E4, 0xD4F7, 0x8B04, 0xD4F8, 0x9127, 0xD4F9, 0x9A30, 0xD4FA, 0x5587, 0xD4FB, 0x61F6, 0xD4FC, 0xF95B, + 0xD4FD, 0x7669, 0xD4FE, 0x7F85, 0xD5A1, 0x863F, 0xD5A2, 0x87BA, 0xD5A3, 0x88F8, 0xD5A4, 0x908F, 0xD5A5, 0xF95C, 0xD5A6, 0x6D1B, + 0xD5A7, 0x70D9, 0xD5A8, 0x73DE, 0xD5A9, 0x7D61, 0xD5AA, 0x843D, 0xD5AB, 0xF95D, 0xD5AC, 0x916A, 0xD5AD, 0x99F1, 0xD5AE, 0xF95E, + 0xD5AF, 0x4E82, 0xD5B0, 0x5375, 0xD5B1, 0x6B04, 0xD5B2, 0x6B12, 0xD5B3, 0x703E, 0xD5B4, 0x721B, 0xD5B5, 0x862D, 0xD5B6, 0x9E1E, + 0xD5B7, 0x524C, 0xD5B8, 0x8FA3, 0xD5B9, 0x5D50, 0xD5BA, 0x64E5, 0xD5BB, 0x652C, 0xD5BC, 0x6B16, 0xD5BD, 0x6FEB, 0xD5BE, 0x7C43, + 0xD5BF, 0x7E9C, 0xD5C0, 0x85CD, 0xD5C1, 0x8964, 0xD5C2, 0x89BD, 0xD5C3, 0x62C9, 0xD5C4, 0x81D8, 0xD5C5, 0x881F, 0xD5C6, 0x5ECA, + 0xD5C7, 0x6717, 0xD5C8, 0x6D6A, 0xD5C9, 0x72FC, 0xD5CA, 0x7405, 0xD5CB, 0x746F, 0xD5CC, 0x8782, 0xD5CD, 0x90DE, 0xD5CE, 0x4F86, + 0xD5CF, 0x5D0D, 0xD5D0, 0x5FA0, 0xD5D1, 0x840A, 0xD5D2, 0x51B7, 0xD5D3, 0x63A0, 0xD5D4, 0x7565, 0xD5D5, 0x4EAE, 0xD5D6, 0x5006, + 0xD5D7, 0x5169, 0xD5D8, 0x51C9, 0xD5D9, 0x6881, 0xD5DA, 0x6A11, 0xD5DB, 0x7CAE, 0xD5DC, 0x7CB1, 0xD5DD, 0x7CE7, 0xD5DE, 0x826F, + 0xD5DF, 0x8AD2, 0xD5E0, 0x8F1B, 0xD5E1, 0x91CF, 0xD5E2, 0x4FB6, 0xD5E3, 0x5137, 0xD5E4, 0x52F5, 0xD5E5, 0x5442, 0xD5E6, 0x5EEC, + 0xD5E7, 0x616E, 0xD5E8, 0x623E, 0xD5E9, 0x65C5, 0xD5EA, 0x6ADA, 0xD5EB, 0x6FFE, 0xD5EC, 0x792A, 0xD5ED, 0x85DC, 0xD5EE, 0x8823, + 0xD5EF, 0x95AD, 0xD5F0, 0x9A62, 0xD5F1, 0x9A6A, 0xD5F2, 0x9E97, 0xD5F3, 0x9ECE, 0xD5F4, 0x529B, 0xD5F5, 0x66C6, 0xD5F6, 0x6B77, + 0xD5F7, 0x701D, 0xD5F8, 0x792B, 0xD5F9, 0x8F62, 0xD5FA, 0x9742, 0xD5FB, 0x6190, 0xD5FC, 0x6200, 0xD5FD, 0x6523, 0xD5FE, 0x6F23, + 0xD6A1, 0x7149, 0xD6A2, 0x7489, 0xD6A3, 0x7DF4, 0xD6A4, 0x806F, 0xD6A5, 0x84EE, 0xD6A6, 0x8F26, 0xD6A7, 0x9023, 0xD6A8, 0x934A, + 0xD6A9, 0x51BD, 0xD6AA, 0x5217, 0xD6AB, 0x52A3, 0xD6AC, 0x6D0C, 0xD6AD, 0x70C8, 0xD6AE, 0x88C2, 0xD6AF, 0x5EC9, 0xD6B0, 0x6582, + 0xD6B1, 0x6BAE, 0xD6B2, 0x6FC2, 0xD6B3, 0x7C3E, 0xD6B4, 0x7375, 0xD6B5, 0x4EE4, 0xD6B6, 0x4F36, 0xD6B7, 0x56F9, 0xD6B8, 0xF95F, + 0xD6B9, 0x5CBA, 0xD6BA, 0x5DBA, 0xD6BB, 0x601C, 0xD6BC, 0x73B2, 0xD6BD, 0x7B2D, 0xD6BE, 0x7F9A, 0xD6BF, 0x7FCE, 0xD6C0, 0x8046, + 0xD6C1, 0x901E, 0xD6C2, 0x9234, 0xD6C3, 0x96F6, 0xD6C4, 0x9748, 0xD6C5, 0x9818, 0xD6C6, 0x9F61, 0xD6C7, 0x4F8B, 0xD6C8, 0x6FA7, + 0xD6C9, 0x79AE, 0xD6CA, 0x91B4, 0xD6CB, 0x96B7, 0xD6CC, 0x52DE, 0xD6CD, 0xF960, 0xD6CE, 0x6488, 0xD6CF, 0x64C4, 0xD6D0, 0x6AD3, + 0xD6D1, 0x6F5E, 0xD6D2, 0x7018, 0xD6D3, 0x7210, 0xD6D4, 0x76E7, 0xD6D5, 0x8001, 0xD6D6, 0x8606, 0xD6D7, 0x865C, 0xD6D8, 0x8DEF, + 0xD6D9, 0x8F05, 0xD6DA, 0x9732, 0xD6DB, 0x9B6F, 0xD6DC, 0x9DFA, 0xD6DD, 0x9E75, 0xD6DE, 0x788C, 0xD6DF, 0x797F, 0xD6E0, 0x7DA0, + 0xD6E1, 0x83C9, 0xD6E2, 0x9304, 0xD6E3, 0x9E7F, 0xD6E4, 0x9E93, 0xD6E5, 0x8AD6, 0xD6E6, 0x58DF, 0xD6E7, 0x5F04, 0xD6E8, 0x6727, + 0xD6E9, 0x7027, 0xD6EA, 0x74CF, 0xD6EB, 0x7C60, 0xD6EC, 0x807E, 0xD6ED, 0x5121, 0xD6EE, 0x7028, 0xD6EF, 0x7262, 0xD6F0, 0x78CA, + 0xD6F1, 0x8CC2, 0xD6F2, 0x8CDA, 0xD6F3, 0x8CF4, 0xD6F4, 0x96F7, 0xD6F5, 0x4E86, 0xD6F6, 0x50DA, 0xD6F7, 0x5BEE, 0xD6F8, 0x5ED6, + 0xD6F9, 0x6599, 0xD6FA, 0x71CE, 0xD6FB, 0x7642, 0xD6FC, 0x77AD, 0xD6FD, 0x804A, 0xD6FE, 0x84FC, 0xD7A1, 0x907C, 0xD7A2, 0x9B27, + 0xD7A3, 0x9F8D, 0xD7A4, 0x58D8, 0xD7A5, 0x5A41, 0xD7A6, 0x5C62, 0xD7A7, 0x6A13, 0xD7A8, 0x6DDA, 0xD7A9, 0x6F0F, 0xD7AA, 0x763B, + 0xD7AB, 0x7D2F, 0xD7AC, 0x7E37, 0xD7AD, 0x851E, 0xD7AE, 0x8938, 0xD7AF, 0x93E4, 0xD7B0, 0x964B, 0xD7B1, 0x5289, 0xD7B2, 0x65D2, + 0xD7B3, 0x67F3, 0xD7B4, 0x69B4, 0xD7B5, 0x6D41, 0xD7B6, 0x6E9C, 0xD7B7, 0x700F, 0xD7B8, 0x7409, 0xD7B9, 0x7460, 0xD7BA, 0x7559, + 0xD7BB, 0x7624, 0xD7BC, 0x786B, 0xD7BD, 0x8B2C, 0xD7BE, 0x985E, 0xD7BF, 0x516D, 0xD7C0, 0x622E, 0xD7C1, 0x9678, 0xD7C2, 0x4F96, + 0xD7C3, 0x502B, 0xD7C4, 0x5D19, 0xD7C5, 0x6DEA, 0xD7C6, 0x7DB8, 0xD7C7, 0x8F2A, 0xD7C8, 0x5F8B, 0xD7C9, 0x6144, 0xD7CA, 0x6817, + 0xD7CB, 0xF961, 0xD7CC, 0x9686, 0xD7CD, 0x52D2, 0xD7CE, 0x808B, 0xD7CF, 0x51DC, 0xD7D0, 0x51CC, 0xD7D1, 0x695E, 0xD7D2, 0x7A1C, + 0xD7D3, 0x7DBE, 0xD7D4, 0x83F1, 0xD7D5, 0x9675, 0xD7D6, 0x4FDA, 0xD7D7, 0x5229, 0xD7D8, 0x5398, 0xD7D9, 0x540F, 0xD7DA, 0x550E, + 0xD7DB, 0x5C65, 0xD7DC, 0x60A7, 0xD7DD, 0x674E, 0xD7DE, 0x68A8, 0xD7DF, 0x6D6C, 0xD7E0, 0x7281, 0xD7E1, 0x72F8, 0xD7E2, 0x7406, + 0xD7E3, 0x7483, 0xD7E4, 0xF962, 0xD7E5, 0x75E2, 0xD7E6, 0x7C6C, 0xD7E7, 0x7F79, 0xD7E8, 0x7FB8, 0xD7E9, 0x8389, 0xD7EA, 0x88CF, + 0xD7EB, 0x88E1, 0xD7EC, 0x91CC, 0xD7ED, 0x91D0, 0xD7EE, 0x96E2, 0xD7EF, 0x9BC9, 0xD7F0, 0x541D, 0xD7F1, 0x6F7E, 0xD7F2, 0x71D0, + 0xD7F3, 0x7498, 0xD7F4, 0x85FA, 0xD7F5, 0x8EAA, 0xD7F6, 0x96A3, 0xD7F7, 0x9C57, 0xD7F8, 0x9E9F, 0xD7F9, 0x6797, 0xD7FA, 0x6DCB, + 0xD7FB, 0x7433, 0xD7FC, 0x81E8, 0xD7FD, 0x9716, 0xD7FE, 0x782C, 0xD8A1, 0x7ACB, 0xD8A2, 0x7B20, 0xD8A3, 0x7C92, 0xD8A4, 0x6469, + 0xD8A5, 0x746A, 0xD8A6, 0x75F2, 0xD8A7, 0x78BC, 0xD8A8, 0x78E8, 0xD8A9, 0x99AC, 0xD8AA, 0x9B54, 0xD8AB, 0x9EBB, 0xD8AC, 0x5BDE, + 0xD8AD, 0x5E55, 0xD8AE, 0x6F20, 0xD8AF, 0x819C, 0xD8B0, 0x83AB, 0xD8B1, 0x9088, 0xD8B2, 0x4E07, 0xD8B3, 0x534D, 0xD8B4, 0x5A29, + 0xD8B5, 0x5DD2, 0xD8B6, 0x5F4E, 0xD8B7, 0x6162, 0xD8B8, 0x633D, 0xD8B9, 0x6669, 0xD8BA, 0x66FC, 0xD8BB, 0x6EFF, 0xD8BC, 0x6F2B, + 0xD8BD, 0x7063, 0xD8BE, 0x779E, 0xD8BF, 0x842C, 0xD8C0, 0x8513, 0xD8C1, 0x883B, 0xD8C2, 0x8F13, 0xD8C3, 0x9945, 0xD8C4, 0x9C3B, + 0xD8C5, 0x551C, 0xD8C6, 0x62B9, 0xD8C7, 0x672B, 0xD8C8, 0x6CAB, 0xD8C9, 0x8309, 0xD8CA, 0x896A, 0xD8CB, 0x977A, 0xD8CC, 0x4EA1, + 0xD8CD, 0x5984, 0xD8CE, 0x5FD8, 0xD8CF, 0x5FD9, 0xD8D0, 0x671B, 0xD8D1, 0x7DB2, 0xD8D2, 0x7F54, 0xD8D3, 0x8292, 0xD8D4, 0x832B, + 0xD8D5, 0x83BD, 0xD8D6, 0x8F1E, 0xD8D7, 0x9099, 0xD8D8, 0x57CB, 0xD8D9, 0x59B9, 0xD8DA, 0x5A92, 0xD8DB, 0x5BD0, 0xD8DC, 0x6627, + 0xD8DD, 0x679A, 0xD8DE, 0x6885, 0xD8DF, 0x6BCF, 0xD8E0, 0x7164, 0xD8E1, 0x7F75, 0xD8E2, 0x8CB7, 0xD8E3, 0x8CE3, 0xD8E4, 0x9081, + 0xD8E5, 0x9B45, 0xD8E6, 0x8108, 0xD8E7, 0x8C8A, 0xD8E8, 0x964C, 0xD8E9, 0x9A40, 0xD8EA, 0x9EA5, 0xD8EB, 0x5B5F, 0xD8EC, 0x6C13, + 0xD8ED, 0x731B, 0xD8EE, 0x76F2, 0xD8EF, 0x76DF, 0xD8F0, 0x840C, 0xD8F1, 0x51AA, 0xD8F2, 0x8993, 0xD8F3, 0x514D, 0xD8F4, 0x5195, + 0xD8F5, 0x52C9, 0xD8F6, 0x68C9, 0xD8F7, 0x6C94, 0xD8F8, 0x7704, 0xD8F9, 0x7720, 0xD8FA, 0x7DBF, 0xD8FB, 0x7DEC, 0xD8FC, 0x9762, + 0xD8FD, 0x9EB5, 0xD8FE, 0x6EC5, 0xD9A1, 0x8511, 0xD9A2, 0x51A5, 0xD9A3, 0x540D, 0xD9A4, 0x547D, 0xD9A5, 0x660E, 0xD9A6, 0x669D, + 0xD9A7, 0x6927, 0xD9A8, 0x6E9F, 0xD9A9, 0x76BF, 0xD9AA, 0x7791, 0xD9AB, 0x8317, 0xD9AC, 0x84C2, 0xD9AD, 0x879F, 0xD9AE, 0x9169, + 0xD9AF, 0x9298, 0xD9B0, 0x9CF4, 0xD9B1, 0x8882, 0xD9B2, 0x4FAE, 0xD9B3, 0x5192, 0xD9B4, 0x52DF, 0xD9B5, 0x59C6, 0xD9B6, 0x5E3D, + 0xD9B7, 0x6155, 0xD9B8, 0x6478, 0xD9B9, 0x6479, 0xD9BA, 0x66AE, 0xD9BB, 0x67D0, 0xD9BC, 0x6A21, 0xD9BD, 0x6BCD, 0xD9BE, 0x6BDB, + 0xD9BF, 0x725F, 0xD9C0, 0x7261, 0xD9C1, 0x7441, 0xD9C2, 0x7738, 0xD9C3, 0x77DB, 0xD9C4, 0x8017, 0xD9C5, 0x82BC, 0xD9C6, 0x8305, + 0xD9C7, 0x8B00, 0xD9C8, 0x8B28, 0xD9C9, 0x8C8C, 0xD9CA, 0x6728, 0xD9CB, 0x6C90, 0xD9CC, 0x7267, 0xD9CD, 0x76EE, 0xD9CE, 0x7766, + 0xD9CF, 0x7A46, 0xD9D0, 0x9DA9, 0xD9D1, 0x6B7F, 0xD9D2, 0x6C92, 0xD9D3, 0x5922, 0xD9D4, 0x6726, 0xD9D5, 0x8499, 0xD9D6, 0x536F, + 0xD9D7, 0x5893, 0xD9D8, 0x5999, 0xD9D9, 0x5EDF, 0xD9DA, 0x63CF, 0xD9DB, 0x6634, 0xD9DC, 0x6773, 0xD9DD, 0x6E3A, 0xD9DE, 0x732B, + 0xD9DF, 0x7AD7, 0xD9E0, 0x82D7, 0xD9E1, 0x9328, 0xD9E2, 0x52D9, 0xD9E3, 0x5DEB, 0xD9E4, 0x61AE, 0xD9E5, 0x61CB, 0xD9E6, 0x620A, + 0xD9E7, 0x62C7, 0xD9E8, 0x64AB, 0xD9E9, 0x65E0, 0xD9EA, 0x6959, 0xD9EB, 0x6B66, 0xD9EC, 0x6BCB, 0xD9ED, 0x7121, 0xD9EE, 0x73F7, + 0xD9EF, 0x755D, 0xD9F0, 0x7E46, 0xD9F1, 0x821E, 0xD9F2, 0x8302, 0xD9F3, 0x856A, 0xD9F4, 0x8AA3, 0xD9F5, 0x8CBF, 0xD9F6, 0x9727, + 0xD9F7, 0x9D61, 0xD9F8, 0x58A8, 0xD9F9, 0x9ED8, 0xD9FA, 0x5011, 0xD9FB, 0x520E, 0xD9FC, 0x543B, 0xD9FD, 0x554F, 0xD9FE, 0x6587, + 0xDAA1, 0x6C76, 0xDAA2, 0x7D0A, 0xDAA3, 0x7D0B, 0xDAA4, 0x805E, 0xDAA5, 0x868A, 0xDAA6, 0x9580, 0xDAA7, 0x96EF, 0xDAA8, 0x52FF, + 0xDAA9, 0x6C95, 0xDAAA, 0x7269, 0xDAAB, 0x5473, 0xDAAC, 0x5A9A, 0xDAAD, 0x5C3E, 0xDAAE, 0x5D4B, 0xDAAF, 0x5F4C, 0xDAB0, 0x5FAE, + 0xDAB1, 0x672A, 0xDAB2, 0x68B6, 0xDAB3, 0x6963, 0xDAB4, 0x6E3C, 0xDAB5, 0x6E44, 0xDAB6, 0x7709, 0xDAB7, 0x7C73, 0xDAB8, 0x7F8E, + 0xDAB9, 0x8587, 0xDABA, 0x8B0E, 0xDABB, 0x8FF7, 0xDABC, 0x9761, 0xDABD, 0x9EF4, 0xDABE, 0x5CB7, 0xDABF, 0x60B6, 0xDAC0, 0x610D, + 0xDAC1, 0x61AB, 0xDAC2, 0x654F, 0xDAC3, 0x65FB, 0xDAC4, 0x65FC, 0xDAC5, 0x6C11, 0xDAC6, 0x6CEF, 0xDAC7, 0x739F, 0xDAC8, 0x73C9, + 0xDAC9, 0x7DE1, 0xDACA, 0x9594, 0xDACB, 0x5BC6, 0xDACC, 0x871C, 0xDACD, 0x8B10, 0xDACE, 0x525D, 0xDACF, 0x535A, 0xDAD0, 0x62CD, + 0xDAD1, 0x640F, 0xDAD2, 0x64B2, 0xDAD3, 0x6734, 0xDAD4, 0x6A38, 0xDAD5, 0x6CCA, 0xDAD6, 0x73C0, 0xDAD7, 0x749E, 0xDAD8, 0x7B94, + 0xDAD9, 0x7C95, 0xDADA, 0x7E1B, 0xDADB, 0x818A, 0xDADC, 0x8236, 0xDADD, 0x8584, 0xDADE, 0x8FEB, 0xDADF, 0x96F9, 0xDAE0, 0x99C1, + 0xDAE1, 0x4F34, 0xDAE2, 0x534A, 0xDAE3, 0x53CD, 0xDAE4, 0x53DB, 0xDAE5, 0x62CC, 0xDAE6, 0x642C, 0xDAE7, 0x6500, 0xDAE8, 0x6591, + 0xDAE9, 0x69C3, 0xDAEA, 0x6CEE, 0xDAEB, 0x6F58, 0xDAEC, 0x73ED, 0xDAED, 0x7554, 0xDAEE, 0x7622, 0xDAEF, 0x76E4, 0xDAF0, 0x76FC, + 0xDAF1, 0x78D0, 0xDAF2, 0x78FB, 0xDAF3, 0x792C, 0xDAF4, 0x7D46, 0xDAF5, 0x822C, 0xDAF6, 0x87E0, 0xDAF7, 0x8FD4, 0xDAF8, 0x9812, + 0xDAF9, 0x98EF, 0xDAFA, 0x52C3, 0xDAFB, 0x62D4, 0xDAFC, 0x64A5, 0xDAFD, 0x6E24, 0xDAFE, 0x6F51, 0xDBA1, 0x767C, 0xDBA2, 0x8DCB, + 0xDBA3, 0x91B1, 0xDBA4, 0x9262, 0xDBA5, 0x9AEE, 0xDBA6, 0x9B43, 0xDBA7, 0x5023, 0xDBA8, 0x508D, 0xDBA9, 0x574A, 0xDBAA, 0x59A8, + 0xDBAB, 0x5C28, 0xDBAC, 0x5E47, 0xDBAD, 0x5F77, 0xDBAE, 0x623F, 0xDBAF, 0x653E, 0xDBB0, 0x65B9, 0xDBB1, 0x65C1, 0xDBB2, 0x6609, + 0xDBB3, 0x678B, 0xDBB4, 0x699C, 0xDBB5, 0x6EC2, 0xDBB6, 0x78C5, 0xDBB7, 0x7D21, 0xDBB8, 0x80AA, 0xDBB9, 0x8180, 0xDBBA, 0x822B, + 0xDBBB, 0x82B3, 0xDBBC, 0x84A1, 0xDBBD, 0x868C, 0xDBBE, 0x8A2A, 0xDBBF, 0x8B17, 0xDBC0, 0x90A6, 0xDBC1, 0x9632, 0xDBC2, 0x9F90, + 0xDBC3, 0x500D, 0xDBC4, 0x4FF3, 0xDBC5, 0xF963, 0xDBC6, 0x57F9, 0xDBC7, 0x5F98, 0xDBC8, 0x62DC, 0xDBC9, 0x6392, 0xDBCA, 0x676F, + 0xDBCB, 0x6E43, 0xDBCC, 0x7119, 0xDBCD, 0x76C3, 0xDBCE, 0x80CC, 0xDBCF, 0x80DA, 0xDBD0, 0x88F4, 0xDBD1, 0x88F5, 0xDBD2, 0x8919, + 0xDBD3, 0x8CE0, 0xDBD4, 0x8F29, 0xDBD5, 0x914D, 0xDBD6, 0x966A, 0xDBD7, 0x4F2F, 0xDBD8, 0x4F70, 0xDBD9, 0x5E1B, 0xDBDA, 0x67CF, + 0xDBDB, 0x6822, 0xDBDC, 0x767D, 0xDBDD, 0x767E, 0xDBDE, 0x9B44, 0xDBDF, 0x5E61, 0xDBE0, 0x6A0A, 0xDBE1, 0x7169, 0xDBE2, 0x71D4, + 0xDBE3, 0x756A, 0xDBE4, 0xF964, 0xDBE5, 0x7E41, 0xDBE6, 0x8543, 0xDBE7, 0x85E9, 0xDBE8, 0x98DC, 0xDBE9, 0x4F10, 0xDBEA, 0x7B4F, + 0xDBEB, 0x7F70, 0xDBEC, 0x95A5, 0xDBED, 0x51E1, 0xDBEE, 0x5E06, 0xDBEF, 0x68B5, 0xDBF0, 0x6C3E, 0xDBF1, 0x6C4E, 0xDBF2, 0x6CDB, + 0xDBF3, 0x72AF, 0xDBF4, 0x7BC4, 0xDBF5, 0x8303, 0xDBF6, 0x6CD5, 0xDBF7, 0x743A, 0xDBF8, 0x50FB, 0xDBF9, 0x5288, 0xDBFA, 0x58C1, + 0xDBFB, 0x64D8, 0xDBFC, 0x6A97, 0xDBFD, 0x74A7, 0xDBFE, 0x7656, 0xDCA1, 0x78A7, 0xDCA2, 0x8617, 0xDCA3, 0x95E2, 0xDCA4, 0x9739, + 0xDCA5, 0xF965, 0xDCA6, 0x535E, 0xDCA7, 0x5F01, 0xDCA8, 0x8B8A, 0xDCA9, 0x8FA8, 0xDCAA, 0x8FAF, 0xDCAB, 0x908A, 0xDCAC, 0x5225, + 0xDCAD, 0x77A5, 0xDCAE, 0x9C49, 0xDCAF, 0x9F08, 0xDCB0, 0x4E19, 0xDCB1, 0x5002, 0xDCB2, 0x5175, 0xDCB3, 0x5C5B, 0xDCB4, 0x5E77, + 0xDCB5, 0x661E, 0xDCB6, 0x663A, 0xDCB7, 0x67C4, 0xDCB8, 0x68C5, 0xDCB9, 0x70B3, 0xDCBA, 0x7501, 0xDCBB, 0x75C5, 0xDCBC, 0x79C9, + 0xDCBD, 0x7ADD, 0xDCBE, 0x8F27, 0xDCBF, 0x9920, 0xDCC0, 0x9A08, 0xDCC1, 0x4FDD, 0xDCC2, 0x5821, 0xDCC3, 0x5831, 0xDCC4, 0x5BF6, + 0xDCC5, 0x666E, 0xDCC6, 0x6B65, 0xDCC7, 0x6D11, 0xDCC8, 0x6E7A, 0xDCC9, 0x6F7D, 0xDCCA, 0x73E4, 0xDCCB, 0x752B, 0xDCCC, 0x83E9, + 0xDCCD, 0x88DC, 0xDCCE, 0x8913, 0xDCCF, 0x8B5C, 0xDCD0, 0x8F14, 0xDCD1, 0x4F0F, 0xDCD2, 0x50D5, 0xDCD3, 0x5310, 0xDCD4, 0x535C, + 0xDCD5, 0x5B93, 0xDCD6, 0x5FA9, 0xDCD7, 0x670D, 0xDCD8, 0x798F, 0xDCD9, 0x8179, 0xDCDA, 0x832F, 0xDCDB, 0x8514, 0xDCDC, 0x8907, + 0xDCDD, 0x8986, 0xDCDE, 0x8F39, 0xDCDF, 0x8F3B, 0xDCE0, 0x99A5, 0xDCE1, 0x9C12, 0xDCE2, 0x672C, 0xDCE3, 0x4E76, 0xDCE4, 0x4FF8, + 0xDCE5, 0x5949, 0xDCE6, 0x5C01, 0xDCE7, 0x5CEF, 0xDCE8, 0x5CF0, 0xDCE9, 0x6367, 0xDCEA, 0x68D2, 0xDCEB, 0x70FD, 0xDCEC, 0x71A2, + 0xDCED, 0x742B, 0xDCEE, 0x7E2B, 0xDCEF, 0x84EC, 0xDCF0, 0x8702, 0xDCF1, 0x9022, 0xDCF2, 0x92D2, 0xDCF3, 0x9CF3, 0xDCF4, 0x4E0D, + 0xDCF5, 0x4ED8, 0xDCF6, 0x4FEF, 0xDCF7, 0x5085, 0xDCF8, 0x5256, 0xDCF9, 0x526F, 0xDCFA, 0x5426, 0xDCFB, 0x5490, 0xDCFC, 0x57E0, + 0xDCFD, 0x592B, 0xDCFE, 0x5A66, 0xDDA1, 0x5B5A, 0xDDA2, 0x5B75, 0xDDA3, 0x5BCC, 0xDDA4, 0x5E9C, 0xDDA5, 0xF966, 0xDDA6, 0x6276, + 0xDDA7, 0x6577, 0xDDA8, 0x65A7, 0xDDA9, 0x6D6E, 0xDDAA, 0x6EA5, 0xDDAB, 0x7236, 0xDDAC, 0x7B26, 0xDDAD, 0x7C3F, 0xDDAE, 0x7F36, + 0xDDAF, 0x8150, 0xDDB0, 0x8151, 0xDDB1, 0x819A, 0xDDB2, 0x8240, 0xDDB3, 0x8299, 0xDDB4, 0x83A9, 0xDDB5, 0x8A03, 0xDDB6, 0x8CA0, + 0xDDB7, 0x8CE6, 0xDDB8, 0x8CFB, 0xDDB9, 0x8D74, 0xDDBA, 0x8DBA, 0xDDBB, 0x90E8, 0xDDBC, 0x91DC, 0xDDBD, 0x961C, 0xDDBE, 0x9644, + 0xDDBF, 0x99D9, 0xDDC0, 0x9CE7, 0xDDC1, 0x5317, 0xDDC2, 0x5206, 0xDDC3, 0x5429, 0xDDC4, 0x5674, 0xDDC5, 0x58B3, 0xDDC6, 0x5954, + 0xDDC7, 0x596E, 0xDDC8, 0x5FFF, 0xDDC9, 0x61A4, 0xDDCA, 0x626E, 0xDDCB, 0x6610, 0xDDCC, 0x6C7E, 0xDDCD, 0x711A, 0xDDCE, 0x76C6, + 0xDDCF, 0x7C89, 0xDDD0, 0x7CDE, 0xDDD1, 0x7D1B, 0xDDD2, 0x82AC, 0xDDD3, 0x8CC1, 0xDDD4, 0x96F0, 0xDDD5, 0xF967, 0xDDD6, 0x4F5B, + 0xDDD7, 0x5F17, 0xDDD8, 0x5F7F, 0xDDD9, 0x62C2, 0xDDDA, 0x5D29, 0xDDDB, 0x670B, 0xDDDC, 0x68DA, 0xDDDD, 0x787C, 0xDDDE, 0x7E43, + 0xDDDF, 0x9D6C, 0xDDE0, 0x4E15, 0xDDE1, 0x5099, 0xDDE2, 0x5315, 0xDDE3, 0x532A, 0xDDE4, 0x5351, 0xDDE5, 0x5983, 0xDDE6, 0x5A62, + 0xDDE7, 0x5E87, 0xDDE8, 0x60B2, 0xDDE9, 0x618A, 0xDDEA, 0x6249, 0xDDEB, 0x6279, 0xDDEC, 0x6590, 0xDDED, 0x6787, 0xDDEE, 0x69A7, + 0xDDEF, 0x6BD4, 0xDDF0, 0x6BD6, 0xDDF1, 0x6BD7, 0xDDF2, 0x6BD8, 0xDDF3, 0x6CB8, 0xDDF4, 0xF968, 0xDDF5, 0x7435, 0xDDF6, 0x75FA, + 0xDDF7, 0x7812, 0xDDF8, 0x7891, 0xDDF9, 0x79D5, 0xDDFA, 0x79D8, 0xDDFB, 0x7C83, 0xDDFC, 0x7DCB, 0xDDFD, 0x7FE1, 0xDDFE, 0x80A5, + 0xDEA1, 0x813E, 0xDEA2, 0x81C2, 0xDEA3, 0x83F2, 0xDEA4, 0x871A, 0xDEA5, 0x88E8, 0xDEA6, 0x8AB9, 0xDEA7, 0x8B6C, 0xDEA8, 0x8CBB, + 0xDEA9, 0x9119, 0xDEAA, 0x975E, 0xDEAB, 0x98DB, 0xDEAC, 0x9F3B, 0xDEAD, 0x56AC, 0xDEAE, 0x5B2A, 0xDEAF, 0x5F6C, 0xDEB0, 0x658C, + 0xDEB1, 0x6AB3, 0xDEB2, 0x6BAF, 0xDEB3, 0x6D5C, 0xDEB4, 0x6FF1, 0xDEB5, 0x7015, 0xDEB6, 0x725D, 0xDEB7, 0x73AD, 0xDEB8, 0x8CA7, + 0xDEB9, 0x8CD3, 0xDEBA, 0x983B, 0xDEBB, 0x6191, 0xDEBC, 0x6C37, 0xDEBD, 0x8058, 0xDEBE, 0x9A01, 0xDEBF, 0x4E4D, 0xDEC0, 0x4E8B, + 0xDEC1, 0x4E9B, 0xDEC2, 0x4ED5, 0xDEC3, 0x4F3A, 0xDEC4, 0x4F3C, 0xDEC5, 0x4F7F, 0xDEC6, 0x4FDF, 0xDEC7, 0x50FF, 0xDEC8, 0x53F2, + 0xDEC9, 0x53F8, 0xDECA, 0x5506, 0xDECB, 0x55E3, 0xDECC, 0x56DB, 0xDECD, 0x58EB, 0xDECE, 0x5962, 0xDECF, 0x5A11, 0xDED0, 0x5BEB, + 0xDED1, 0x5BFA, 0xDED2, 0x5C04, 0xDED3, 0x5DF3, 0xDED4, 0x5E2B, 0xDED5, 0x5F99, 0xDED6, 0x601D, 0xDED7, 0x6368, 0xDED8, 0x659C, + 0xDED9, 0x65AF, 0xDEDA, 0x67F6, 0xDEDB, 0x67FB, 0xDEDC, 0x68AD, 0xDEDD, 0x6B7B, 0xDEDE, 0x6C99, 0xDEDF, 0x6CD7, 0xDEE0, 0x6E23, + 0xDEE1, 0x7009, 0xDEE2, 0x7345, 0xDEE3, 0x7802, 0xDEE4, 0x793E, 0xDEE5, 0x7940, 0xDEE6, 0x7960, 0xDEE7, 0x79C1, 0xDEE8, 0x7BE9, + 0xDEE9, 0x7D17, 0xDEEA, 0x7D72, 0xDEEB, 0x8086, 0xDEEC, 0x820D, 0xDEED, 0x838E, 0xDEEE, 0x84D1, 0xDEEF, 0x86C7, 0xDEF0, 0x88DF, + 0xDEF1, 0x8A50, 0xDEF2, 0x8A5E, 0xDEF3, 0x8B1D, 0xDEF4, 0x8CDC, 0xDEF5, 0x8D66, 0xDEF6, 0x8FAD, 0xDEF7, 0x90AA, 0xDEF8, 0x98FC, + 0xDEF9, 0x99DF, 0xDEFA, 0x9E9D, 0xDEFB, 0x524A, 0xDEFC, 0xF969, 0xDEFD, 0x6714, 0xDEFE, 0xF96A, 0xDFA1, 0x5098, 0xDFA2, 0x522A, + 0xDFA3, 0x5C71, 0xDFA4, 0x6563, 0xDFA5, 0x6C55, 0xDFA6, 0x73CA, 0xDFA7, 0x7523, 0xDFA8, 0x759D, 0xDFA9, 0x7B97, 0xDFAA, 0x849C, + 0xDFAB, 0x9178, 0xDFAC, 0x9730, 0xDFAD, 0x4E77, 0xDFAE, 0x6492, 0xDFAF, 0x6BBA, 0xDFB0, 0x715E, 0xDFB1, 0x85A9, 0xDFB2, 0x4E09, + 0xDFB3, 0xF96B, 0xDFB4, 0x6749, 0xDFB5, 0x68EE, 0xDFB6, 0x6E17, 0xDFB7, 0x829F, 0xDFB8, 0x8518, 0xDFB9, 0x886B, 0xDFBA, 0x63F7, + 0xDFBB, 0x6F81, 0xDFBC, 0x9212, 0xDFBD, 0x98AF, 0xDFBE, 0x4E0A, 0xDFBF, 0x50B7, 0xDFC0, 0x50CF, 0xDFC1, 0x511F, 0xDFC2, 0x5546, + 0xDFC3, 0x55AA, 0xDFC4, 0x5617, 0xDFC5, 0x5B40, 0xDFC6, 0x5C19, 0xDFC7, 0x5CE0, 0xDFC8, 0x5E38, 0xDFC9, 0x5E8A, 0xDFCA, 0x5EA0, + 0xDFCB, 0x5EC2, 0xDFCC, 0x60F3, 0xDFCD, 0x6851, 0xDFCE, 0x6A61, 0xDFCF, 0x6E58, 0xDFD0, 0x723D, 0xDFD1, 0x7240, 0xDFD2, 0x72C0, + 0xDFD3, 0x76F8, 0xDFD4, 0x7965, 0xDFD5, 0x7BB1, 0xDFD6, 0x7FD4, 0xDFD7, 0x88F3, 0xDFD8, 0x89F4, 0xDFD9, 0x8A73, 0xDFDA, 0x8C61, + 0xDFDB, 0x8CDE, 0xDFDC, 0x971C, 0xDFDD, 0x585E, 0xDFDE, 0x74BD, 0xDFDF, 0x8CFD, 0xDFE0, 0x55C7, 0xDFE1, 0xF96C, 0xDFE2, 0x7A61, + 0xDFE3, 0x7D22, 0xDFE4, 0x8272, 0xDFE5, 0x7272, 0xDFE6, 0x751F, 0xDFE7, 0x7525, 0xDFE8, 0xF96D, 0xDFE9, 0x7B19, 0xDFEA, 0x5885, + 0xDFEB, 0x58FB, 0xDFEC, 0x5DBC, 0xDFED, 0x5E8F, 0xDFEE, 0x5EB6, 0xDFEF, 0x5F90, 0xDFF0, 0x6055, 0xDFF1, 0x6292, 0xDFF2, 0x637F, + 0xDFF3, 0x654D, 0xDFF4, 0x6691, 0xDFF5, 0x66D9, 0xDFF6, 0x66F8, 0xDFF7, 0x6816, 0xDFF8, 0x68F2, 0xDFF9, 0x7280, 0xDFFA, 0x745E, + 0xDFFB, 0x7B6E, 0xDFFC, 0x7D6E, 0xDFFD, 0x7DD6, 0xDFFE, 0x7F72, 0xE0A1, 0x80E5, 0xE0A2, 0x8212, 0xE0A3, 0x85AF, 0xE0A4, 0x897F, + 0xE0A5, 0x8A93, 0xE0A6, 0x901D, 0xE0A7, 0x92E4, 0xE0A8, 0x9ECD, 0xE0A9, 0x9F20, 0xE0AA, 0x5915, 0xE0AB, 0x596D, 0xE0AC, 0x5E2D, + 0xE0AD, 0x60DC, 0xE0AE, 0x6614, 0xE0AF, 0x6673, 0xE0B0, 0x6790, 0xE0B1, 0x6C50, 0xE0B2, 0x6DC5, 0xE0B3, 0x6F5F, 0xE0B4, 0x77F3, + 0xE0B5, 0x78A9, 0xE0B6, 0x84C6, 0xE0B7, 0x91CB, 0xE0B8, 0x932B, 0xE0B9, 0x4ED9, 0xE0BA, 0x50CA, 0xE0BB, 0x5148, 0xE0BC, 0x5584, + 0xE0BD, 0x5B0B, 0xE0BE, 0x5BA3, 0xE0BF, 0x6247, 0xE0C0, 0x657E, 0xE0C1, 0x65CB, 0xE0C2, 0x6E32, 0xE0C3, 0x717D, 0xE0C4, 0x7401, + 0xE0C5, 0x7444, 0xE0C6, 0x7487, 0xE0C7, 0x74BF, 0xE0C8, 0x766C, 0xE0C9, 0x79AA, 0xE0CA, 0x7DDA, 0xE0CB, 0x7E55, 0xE0CC, 0x7FA8, + 0xE0CD, 0x817A, 0xE0CE, 0x81B3, 0xE0CF, 0x8239, 0xE0D0, 0x861A, 0xE0D1, 0x87EC, 0xE0D2, 0x8A75, 0xE0D3, 0x8DE3, 0xE0D4, 0x9078, + 0xE0D5, 0x9291, 0xE0D6, 0x9425, 0xE0D7, 0x994D, 0xE0D8, 0x9BAE, 0xE0D9, 0x5368, 0xE0DA, 0x5C51, 0xE0DB, 0x6954, 0xE0DC, 0x6CC4, + 0xE0DD, 0x6D29, 0xE0DE, 0x6E2B, 0xE0DF, 0x820C, 0xE0E0, 0x859B, 0xE0E1, 0x893B, 0xE0E2, 0x8A2D, 0xE0E3, 0x8AAA, 0xE0E4, 0x96EA, + 0xE0E5, 0x9F67, 0xE0E6, 0x5261, 0xE0E7, 0x66B9, 0xE0E8, 0x6BB2, 0xE0E9, 0x7E96, 0xE0EA, 0x87FE, 0xE0EB, 0x8D0D, 0xE0EC, 0x9583, + 0xE0ED, 0x965D, 0xE0EE, 0x651D, 0xE0EF, 0x6D89, 0xE0F0, 0x71EE, 0xE0F1, 0xF96E, 0xE0F2, 0x57CE, 0xE0F3, 0x59D3, 0xE0F4, 0x5BAC, + 0xE0F5, 0x6027, 0xE0F6, 0x60FA, 0xE0F7, 0x6210, 0xE0F8, 0x661F, 0xE0F9, 0x665F, 0xE0FA, 0x7329, 0xE0FB, 0x73F9, 0xE0FC, 0x76DB, + 0xE0FD, 0x7701, 0xE0FE, 0x7B6C, 0xE1A1, 0x8056, 0xE1A2, 0x8072, 0xE1A3, 0x8165, 0xE1A4, 0x8AA0, 0xE1A5, 0x9192, 0xE1A6, 0x4E16, + 0xE1A7, 0x52E2, 0xE1A8, 0x6B72, 0xE1A9, 0x6D17, 0xE1AA, 0x7A05, 0xE1AB, 0x7B39, 0xE1AC, 0x7D30, 0xE1AD, 0xF96F, 0xE1AE, 0x8CB0, + 0xE1AF, 0x53EC, 0xE1B0, 0x562F, 0xE1B1, 0x5851, 0xE1B2, 0x5BB5, 0xE1B3, 0x5C0F, 0xE1B4, 0x5C11, 0xE1B5, 0x5DE2, 0xE1B6, 0x6240, + 0xE1B7, 0x6383, 0xE1B8, 0x6414, 0xE1B9, 0x662D, 0xE1BA, 0x68B3, 0xE1BB, 0x6CBC, 0xE1BC, 0x6D88, 0xE1BD, 0x6EAF, 0xE1BE, 0x701F, + 0xE1BF, 0x70A4, 0xE1C0, 0x71D2, 0xE1C1, 0x7526, 0xE1C2, 0x758F, 0xE1C3, 0x758E, 0xE1C4, 0x7619, 0xE1C5, 0x7B11, 0xE1C6, 0x7BE0, + 0xE1C7, 0x7C2B, 0xE1C8, 0x7D20, 0xE1C9, 0x7D39, 0xE1CA, 0x852C, 0xE1CB, 0x856D, 0xE1CC, 0x8607, 0xE1CD, 0x8A34, 0xE1CE, 0x900D, + 0xE1CF, 0x9061, 0xE1D0, 0x90B5, 0xE1D1, 0x92B7, 0xE1D2, 0x97F6, 0xE1D3, 0x9A37, 0xE1D4, 0x4FD7, 0xE1D5, 0x5C6C, 0xE1D6, 0x675F, + 0xE1D7, 0x6D91, 0xE1D8, 0x7C9F, 0xE1D9, 0x7E8C, 0xE1DA, 0x8B16, 0xE1DB, 0x8D16, 0xE1DC, 0x901F, 0xE1DD, 0x5B6B, 0xE1DE, 0x5DFD, + 0xE1DF, 0x640D, 0xE1E0, 0x84C0, 0xE1E1, 0x905C, 0xE1E2, 0x98E1, 0xE1E3, 0x7387, 0xE1E4, 0x5B8B, 0xE1E5, 0x609A, 0xE1E6, 0x677E, + 0xE1E7, 0x6DDE, 0xE1E8, 0x8A1F, 0xE1E9, 0x8AA6, 0xE1EA, 0x9001, 0xE1EB, 0x980C, 0xE1EC, 0x5237, 0xE1ED, 0xF970, 0xE1EE, 0x7051, + 0xE1EF, 0x788E, 0xE1F0, 0x9396, 0xE1F1, 0x8870, 0xE1F2, 0x91D7, 0xE1F3, 0x4FEE, 0xE1F4, 0x53D7, 0xE1F5, 0x55FD, 0xE1F6, 0x56DA, + 0xE1F7, 0x5782, 0xE1F8, 0x58FD, 0xE1F9, 0x5AC2, 0xE1FA, 0x5B88, 0xE1FB, 0x5CAB, 0xE1FC, 0x5CC0, 0xE1FD, 0x5E25, 0xE1FE, 0x6101, + 0xE2A1, 0x620D, 0xE2A2, 0x624B, 0xE2A3, 0x6388, 0xE2A4, 0x641C, 0xE2A5, 0x6536, 0xE2A6, 0x6578, 0xE2A7, 0x6A39, 0xE2A8, 0x6B8A, + 0xE2A9, 0x6C34, 0xE2AA, 0x6D19, 0xE2AB, 0x6F31, 0xE2AC, 0x71E7, 0xE2AD, 0x72E9, 0xE2AE, 0x7378, 0xE2AF, 0x7407, 0xE2B0, 0x74B2, + 0xE2B1, 0x7626, 0xE2B2, 0x7761, 0xE2B3, 0x79C0, 0xE2B4, 0x7A57, 0xE2B5, 0x7AEA, 0xE2B6, 0x7CB9, 0xE2B7, 0x7D8F, 0xE2B8, 0x7DAC, + 0xE2B9, 0x7E61, 0xE2BA, 0x7F9E, 0xE2BB, 0x8129, 0xE2BC, 0x8331, 0xE2BD, 0x8490, 0xE2BE, 0x84DA, 0xE2BF, 0x85EA, 0xE2C0, 0x8896, + 0xE2C1, 0x8AB0, 0xE2C2, 0x8B90, 0xE2C3, 0x8F38, 0xE2C4, 0x9042, 0xE2C5, 0x9083, 0xE2C6, 0x916C, 0xE2C7, 0x9296, 0xE2C8, 0x92B9, + 0xE2C9, 0x968B, 0xE2CA, 0x96A7, 0xE2CB, 0x96A8, 0xE2CC, 0x96D6, 0xE2CD, 0x9700, 0xE2CE, 0x9808, 0xE2CF, 0x9996, 0xE2D0, 0x9AD3, + 0xE2D1, 0x9B1A, 0xE2D2, 0x53D4, 0xE2D3, 0x587E, 0xE2D4, 0x5919, 0xE2D5, 0x5B70, 0xE2D6, 0x5BBF, 0xE2D7, 0x6DD1, 0xE2D8, 0x6F5A, + 0xE2D9, 0x719F, 0xE2DA, 0x7421, 0xE2DB, 0x74B9, 0xE2DC, 0x8085, 0xE2DD, 0x83FD, 0xE2DE, 0x5DE1, 0xE2DF, 0x5F87, 0xE2E0, 0x5FAA, + 0xE2E1, 0x6042, 0xE2E2, 0x65EC, 0xE2E3, 0x6812, 0xE2E4, 0x696F, 0xE2E5, 0x6A53, 0xE2E6, 0x6B89, 0xE2E7, 0x6D35, 0xE2E8, 0x6DF3, + 0xE2E9, 0x73E3, 0xE2EA, 0x76FE, 0xE2EB, 0x77AC, 0xE2EC, 0x7B4D, 0xE2ED, 0x7D14, 0xE2EE, 0x8123, 0xE2EF, 0x821C, 0xE2F0, 0x8340, + 0xE2F1, 0x84F4, 0xE2F2, 0x8563, 0xE2F3, 0x8A62, 0xE2F4, 0x8AC4, 0xE2F5, 0x9187, 0xE2F6, 0x931E, 0xE2F7, 0x9806, 0xE2F8, 0x99B4, + 0xE2F9, 0x620C, 0xE2FA, 0x8853, 0xE2FB, 0x8FF0, 0xE2FC, 0x9265, 0xE2FD, 0x5D07, 0xE2FE, 0x5D27, 0xE3A1, 0x5D69, 0xE3A2, 0x745F, + 0xE3A3, 0x819D, 0xE3A4, 0x8768, 0xE3A5, 0x6FD5, 0xE3A6, 0x62FE, 0xE3A7, 0x7FD2, 0xE3A8, 0x8936, 0xE3A9, 0x8972, 0xE3AA, 0x4E1E, + 0xE3AB, 0x4E58, 0xE3AC, 0x50E7, 0xE3AD, 0x52DD, 0xE3AE, 0x5347, 0xE3AF, 0x627F, 0xE3B0, 0x6607, 0xE3B1, 0x7E69, 0xE3B2, 0x8805, + 0xE3B3, 0x965E, 0xE3B4, 0x4F8D, 0xE3B5, 0x5319, 0xE3B6, 0x5636, 0xE3B7, 0x59CB, 0xE3B8, 0x5AA4, 0xE3B9, 0x5C38, 0xE3BA, 0x5C4E, + 0xE3BB, 0x5C4D, 0xE3BC, 0x5E02, 0xE3BD, 0x5F11, 0xE3BE, 0x6043, 0xE3BF, 0x65BD, 0xE3C0, 0x662F, 0xE3C1, 0x6642, 0xE3C2, 0x67BE, + 0xE3C3, 0x67F4, 0xE3C4, 0x731C, 0xE3C5, 0x77E2, 0xE3C6, 0x793A, 0xE3C7, 0x7FC5, 0xE3C8, 0x8494, 0xE3C9, 0x84CD, 0xE3CA, 0x8996, + 0xE3CB, 0x8A66, 0xE3CC, 0x8A69, 0xE3CD, 0x8AE1, 0xE3CE, 0x8C55, 0xE3CF, 0x8C7A, 0xE3D0, 0x57F4, 0xE3D1, 0x5BD4, 0xE3D2, 0x5F0F, + 0xE3D3, 0x606F, 0xE3D4, 0x62ED, 0xE3D5, 0x690D, 0xE3D6, 0x6B96, 0xE3D7, 0x6E5C, 0xE3D8, 0x7184, 0xE3D9, 0x7BD2, 0xE3DA, 0x8755, + 0xE3DB, 0x8B58, 0xE3DC, 0x8EFE, 0xE3DD, 0x98DF, 0xE3DE, 0x98FE, 0xE3DF, 0x4F38, 0xE3E0, 0x4F81, 0xE3E1, 0x4FE1, 0xE3E2, 0x547B, + 0xE3E3, 0x5A20, 0xE3E4, 0x5BB8, 0xE3E5, 0x613C, 0xE3E6, 0x65B0, 0xE3E7, 0x6668, 0xE3E8, 0x71FC, 0xE3E9, 0x7533, 0xE3EA, 0x795E, + 0xE3EB, 0x7D33, 0xE3EC, 0x814E, 0xE3ED, 0x81E3, 0xE3EE, 0x8398, 0xE3EF, 0x85AA, 0xE3F0, 0x85CE, 0xE3F1, 0x8703, 0xE3F2, 0x8A0A, + 0xE3F3, 0x8EAB, 0xE3F4, 0x8F9B, 0xE3F5, 0xF971, 0xE3F6, 0x8FC5, 0xE3F7, 0x5931, 0xE3F8, 0x5BA4, 0xE3F9, 0x5BE6, 0xE3FA, 0x6089, + 0xE3FB, 0x5BE9, 0xE3FC, 0x5C0B, 0xE3FD, 0x5FC3, 0xE3FE, 0x6C81, 0xE4A1, 0xF972, 0xE4A2, 0x6DF1, 0xE4A3, 0x700B, 0xE4A4, 0x751A, + 0xE4A5, 0x82AF, 0xE4A6, 0x8AF6, 0xE4A7, 0x4EC0, 0xE4A8, 0x5341, 0xE4A9, 0xF973, 0xE4AA, 0x96D9, 0xE4AB, 0x6C0F, 0xE4AC, 0x4E9E, + 0xE4AD, 0x4FC4, 0xE4AE, 0x5152, 0xE4AF, 0x555E, 0xE4B0, 0x5A25, 0xE4B1, 0x5CE8, 0xE4B2, 0x6211, 0xE4B3, 0x7259, 0xE4B4, 0x82BD, + 0xE4B5, 0x83AA, 0xE4B6, 0x86FE, 0xE4B7, 0x8859, 0xE4B8, 0x8A1D, 0xE4B9, 0x963F, 0xE4BA, 0x96C5, 0xE4BB, 0x9913, 0xE4BC, 0x9D09, + 0xE4BD, 0x9D5D, 0xE4BE, 0x580A, 0xE4BF, 0x5CB3, 0xE4C0, 0x5DBD, 0xE4C1, 0x5E44, 0xE4C2, 0x60E1, 0xE4C3, 0x6115, 0xE4C4, 0x63E1, + 0xE4C5, 0x6A02, 0xE4C6, 0x6E25, 0xE4C7, 0x9102, 0xE4C8, 0x9354, 0xE4C9, 0x984E, 0xE4CA, 0x9C10, 0xE4CB, 0x9F77, 0xE4CC, 0x5B89, + 0xE4CD, 0x5CB8, 0xE4CE, 0x6309, 0xE4CF, 0x664F, 0xE4D0, 0x6848, 0xE4D1, 0x773C, 0xE4D2, 0x96C1, 0xE4D3, 0x978D, 0xE4D4, 0x9854, + 0xE4D5, 0x9B9F, 0xE4D6, 0x65A1, 0xE4D7, 0x8B01, 0xE4D8, 0x8ECB, 0xE4D9, 0x95BC, 0xE4DA, 0x5535, 0xE4DB, 0x5CA9, 0xE4DC, 0x5DD6, + 0xE4DD, 0x5EB5, 0xE4DE, 0x6697, 0xE4DF, 0x764C, 0xE4E0, 0x83F4, 0xE4E1, 0x95C7, 0xE4E2, 0x58D3, 0xE4E3, 0x62BC, 0xE4E4, 0x72CE, + 0xE4E5, 0x9D28, 0xE4E6, 0x4EF0, 0xE4E7, 0x592E, 0xE4E8, 0x600F, 0xE4E9, 0x663B, 0xE4EA, 0x6B83, 0xE4EB, 0x79E7, 0xE4EC, 0x9D26, + 0xE4ED, 0x5393, 0xE4EE, 0x54C0, 0xE4EF, 0x57C3, 0xE4F0, 0x5D16, 0xE4F1, 0x611B, 0xE4F2, 0x66D6, 0xE4F3, 0x6DAF, 0xE4F4, 0x788D, + 0xE4F5, 0x827E, 0xE4F6, 0x9698, 0xE4F7, 0x9744, 0xE4F8, 0x5384, 0xE4F9, 0x627C, 0xE4FA, 0x6396, 0xE4FB, 0x6DB2, 0xE4FC, 0x7E0A, + 0xE4FD, 0x814B, 0xE4FE, 0x984D, 0xE5A1, 0x6AFB, 0xE5A2, 0x7F4C, 0xE5A3, 0x9DAF, 0xE5A4, 0x9E1A, 0xE5A5, 0x4E5F, 0xE5A6, 0x503B, + 0xE5A7, 0x51B6, 0xE5A8, 0x591C, 0xE5A9, 0x60F9, 0xE5AA, 0x63F6, 0xE5AB, 0x6930, 0xE5AC, 0x723A, 0xE5AD, 0x8036, 0xE5AE, 0xF974, + 0xE5AF, 0x91CE, 0xE5B0, 0x5F31, 0xE5B1, 0xF975, 0xE5B2, 0xF976, 0xE5B3, 0x7D04, 0xE5B4, 0x82E5, 0xE5B5, 0x846F, 0xE5B6, 0x84BB, + 0xE5B7, 0x85E5, 0xE5B8, 0x8E8D, 0xE5B9, 0xF977, 0xE5BA, 0x4F6F, 0xE5BB, 0xF978, 0xE5BC, 0xF979, 0xE5BD, 0x58E4, 0xE5BE, 0x5B43, + 0xE5BF, 0x6059, 0xE5C0, 0x63DA, 0xE5C1, 0x6518, 0xE5C2, 0x656D, 0xE5C3, 0x6698, 0xE5C4, 0xF97A, 0xE5C5, 0x694A, 0xE5C6, 0x6A23, + 0xE5C7, 0x6D0B, 0xE5C8, 0x7001, 0xE5C9, 0x716C, 0xE5CA, 0x75D2, 0xE5CB, 0x760D, 0xE5CC, 0x79B3, 0xE5CD, 0x7A70, 0xE5CE, 0xF97B, + 0xE5CF, 0x7F8A, 0xE5D0, 0xF97C, 0xE5D1, 0x8944, 0xE5D2, 0xF97D, 0xE5D3, 0x8B93, 0xE5D4, 0x91C0, 0xE5D5, 0x967D, 0xE5D6, 0xF97E, + 0xE5D7, 0x990A, 0xE5D8, 0x5704, 0xE5D9, 0x5FA1, 0xE5DA, 0x65BC, 0xE5DB, 0x6F01, 0xE5DC, 0x7600, 0xE5DD, 0x79A6, 0xE5DE, 0x8A9E, + 0xE5DF, 0x99AD, 0xE5E0, 0x9B5A, 0xE5E1, 0x9F6C, 0xE5E2, 0x5104, 0xE5E3, 0x61B6, 0xE5E4, 0x6291, 0xE5E5, 0x6A8D, 0xE5E6, 0x81C6, + 0xE5E7, 0x5043, 0xE5E8, 0x5830, 0xE5E9, 0x5F66, 0xE5EA, 0x7109, 0xE5EB, 0x8A00, 0xE5EC, 0x8AFA, 0xE5ED, 0x5B7C, 0xE5EE, 0x8616, + 0xE5EF, 0x4FFA, 0xE5F0, 0x513C, 0xE5F1, 0x56B4, 0xE5F2, 0x5944, 0xE5F3, 0x63A9, 0xE5F4, 0x6DF9, 0xE5F5, 0x5DAA, 0xE5F6, 0x696D, + 0xE5F7, 0x5186, 0xE5F8, 0x4E88, 0xE5F9, 0x4F59, 0xE5FA, 0xF97F, 0xE5FB, 0xF980, 0xE5FC, 0xF981, 0xE5FD, 0x5982, 0xE5FE, 0xF982, + 0xE6A1, 0xF983, 0xE6A2, 0x6B5F, 0xE6A3, 0x6C5D, 0xE6A4, 0xF984, 0xE6A5, 0x74B5, 0xE6A6, 0x7916, 0xE6A7, 0xF985, 0xE6A8, 0x8207, + 0xE6A9, 0x8245, 0xE6AA, 0x8339, 0xE6AB, 0x8F3F, 0xE6AC, 0x8F5D, 0xE6AD, 0xF986, 0xE6AE, 0x9918, 0xE6AF, 0xF987, 0xE6B0, 0xF988, + 0xE6B1, 0xF989, 0xE6B2, 0x4EA6, 0xE6B3, 0xF98A, 0xE6B4, 0x57DF, 0xE6B5, 0x5F79, 0xE6B6, 0x6613, 0xE6B7, 0xF98B, 0xE6B8, 0xF98C, + 0xE6B9, 0x75AB, 0xE6BA, 0x7E79, 0xE6BB, 0x8B6F, 0xE6BC, 0xF98D, 0xE6BD, 0x9006, 0xE6BE, 0x9A5B, 0xE6BF, 0x56A5, 0xE6C0, 0x5827, + 0xE6C1, 0x59F8, 0xE6C2, 0x5A1F, 0xE6C3, 0x5BB4, 0xE6C4, 0xF98E, 0xE6C5, 0x5EF6, 0xE6C6, 0xF98F, 0xE6C7, 0xF990, 0xE6C8, 0x6350, + 0xE6C9, 0x633B, 0xE6CA, 0xF991, 0xE6CB, 0x693D, 0xE6CC, 0x6C87, 0xE6CD, 0x6CBF, 0xE6CE, 0x6D8E, 0xE6CF, 0x6D93, 0xE6D0, 0x6DF5, + 0xE6D1, 0x6F14, 0xE6D2, 0xF992, 0xE6D3, 0x70DF, 0xE6D4, 0x7136, 0xE6D5, 0x7159, 0xE6D6, 0xF993, 0xE6D7, 0x71C3, 0xE6D8, 0x71D5, + 0xE6D9, 0xF994, 0xE6DA, 0x784F, 0xE6DB, 0x786F, 0xE6DC, 0xF995, 0xE6DD, 0x7B75, 0xE6DE, 0x7DE3, 0xE6DF, 0xF996, 0xE6E0, 0x7E2F, + 0xE6E1, 0xF997, 0xE6E2, 0x884D, 0xE6E3, 0x8EDF, 0xE6E4, 0xF998, 0xE6E5, 0xF999, 0xE6E6, 0xF99A, 0xE6E7, 0x925B, 0xE6E8, 0xF99B, + 0xE6E9, 0x9CF6, 0xE6EA, 0xF99C, 0xE6EB, 0xF99D, 0xE6EC, 0xF99E, 0xE6ED, 0x6085, 0xE6EE, 0x6D85, 0xE6EF, 0xF99F, 0xE6F0, 0x71B1, + 0xE6F1, 0xF9A0, 0xE6F2, 0xF9A1, 0xE6F3, 0x95B1, 0xE6F4, 0x53AD, 0xE6F5, 0xF9A2, 0xE6F6, 0xF9A3, 0xE6F7, 0xF9A4, 0xE6F8, 0x67D3, + 0xE6F9, 0xF9A5, 0xE6FA, 0x708E, 0xE6FB, 0x7130, 0xE6FC, 0x7430, 0xE6FD, 0x8276, 0xE6FE, 0x82D2, 0xE7A1, 0xF9A6, 0xE7A2, 0x95BB, + 0xE7A3, 0x9AE5, 0xE7A4, 0x9E7D, 0xE7A5, 0x66C4, 0xE7A6, 0xF9A7, 0xE7A7, 0x71C1, 0xE7A8, 0x8449, 0xE7A9, 0xF9A8, 0xE7AA, 0xF9A9, + 0xE7AB, 0x584B, 0xE7AC, 0xF9AA, 0xE7AD, 0xF9AB, 0xE7AE, 0x5DB8, 0xE7AF, 0x5F71, 0xE7B0, 0xF9AC, 0xE7B1, 0x6620, 0xE7B2, 0x668E, + 0xE7B3, 0x6979, 0xE7B4, 0x69AE, 0xE7B5, 0x6C38, 0xE7B6, 0x6CF3, 0xE7B7, 0x6E36, 0xE7B8, 0x6F41, 0xE7B9, 0x6FDA, 0xE7BA, 0x701B, + 0xE7BB, 0x702F, 0xE7BC, 0x7150, 0xE7BD, 0x71DF, 0xE7BE, 0x7370, 0xE7BF, 0xF9AD, 0xE7C0, 0x745B, 0xE7C1, 0xF9AE, 0xE7C2, 0x74D4, + 0xE7C3, 0x76C8, 0xE7C4, 0x7A4E, 0xE7C5, 0x7E93, 0xE7C6, 0xF9AF, 0xE7C7, 0xF9B0, 0xE7C8, 0x82F1, 0xE7C9, 0x8A60, 0xE7CA, 0x8FCE, + 0xE7CB, 0xF9B1, 0xE7CC, 0x9348, 0xE7CD, 0xF9B2, 0xE7CE, 0x9719, 0xE7CF, 0xF9B3, 0xE7D0, 0xF9B4, 0xE7D1, 0x4E42, 0xE7D2, 0x502A, + 0xE7D3, 0xF9B5, 0xE7D4, 0x5208, 0xE7D5, 0x53E1, 0xE7D6, 0x66F3, 0xE7D7, 0x6C6D, 0xE7D8, 0x6FCA, 0xE7D9, 0x730A, 0xE7DA, 0x777F, + 0xE7DB, 0x7A62, 0xE7DC, 0x82AE, 0xE7DD, 0x85DD, 0xE7DE, 0x8602, 0xE7DF, 0xF9B6, 0xE7E0, 0x88D4, 0xE7E1, 0x8A63, 0xE7E2, 0x8B7D, + 0xE7E3, 0x8C6B, 0xE7E4, 0xF9B7, 0xE7E5, 0x92B3, 0xE7E6, 0xF9B8, 0xE7E7, 0x9713, 0xE7E8, 0x9810, 0xE7E9, 0x4E94, 0xE7EA, 0x4F0D, + 0xE7EB, 0x4FC9, 0xE7EC, 0x50B2, 0xE7ED, 0x5348, 0xE7EE, 0x543E, 0xE7EF, 0x5433, 0xE7F0, 0x55DA, 0xE7F1, 0x5862, 0xE7F2, 0x58BA, + 0xE7F3, 0x5967, 0xE7F4, 0x5A1B, 0xE7F5, 0x5BE4, 0xE7F6, 0x609F, 0xE7F7, 0xF9B9, 0xE7F8, 0x61CA, 0xE7F9, 0x6556, 0xE7FA, 0x65FF, + 0xE7FB, 0x6664, 0xE7FC, 0x68A7, 0xE7FD, 0x6C5A, 0xE7FE, 0x6FB3, 0xE8A1, 0x70CF, 0xE8A2, 0x71AC, 0xE8A3, 0x7352, 0xE8A4, 0x7B7D, + 0xE8A5, 0x8708, 0xE8A6, 0x8AA4, 0xE8A7, 0x9C32, 0xE8A8, 0x9F07, 0xE8A9, 0x5C4B, 0xE8AA, 0x6C83, 0xE8AB, 0x7344, 0xE8AC, 0x7389, + 0xE8AD, 0x923A, 0xE8AE, 0x6EAB, 0xE8AF, 0x7465, 0xE8B0, 0x761F, 0xE8B1, 0x7A69, 0xE8B2, 0x7E15, 0xE8B3, 0x860A, 0xE8B4, 0x5140, + 0xE8B5, 0x58C5, 0xE8B6, 0x64C1, 0xE8B7, 0x74EE, 0xE8B8, 0x7515, 0xE8B9, 0x7670, 0xE8BA, 0x7FC1, 0xE8BB, 0x9095, 0xE8BC, 0x96CD, + 0xE8BD, 0x9954, 0xE8BE, 0x6E26, 0xE8BF, 0x74E6, 0xE8C0, 0x7AA9, 0xE8C1, 0x7AAA, 0xE8C2, 0x81E5, 0xE8C3, 0x86D9, 0xE8C4, 0x8778, + 0xE8C5, 0x8A1B, 0xE8C6, 0x5A49, 0xE8C7, 0x5B8C, 0xE8C8, 0x5B9B, 0xE8C9, 0x68A1, 0xE8CA, 0x6900, 0xE8CB, 0x6D63, 0xE8CC, 0x73A9, + 0xE8CD, 0x7413, 0xE8CE, 0x742C, 0xE8CF, 0x7897, 0xE8D0, 0x7DE9, 0xE8D1, 0x7FEB, 0xE8D2, 0x8118, 0xE8D3, 0x8155, 0xE8D4, 0x839E, + 0xE8D5, 0x8C4C, 0xE8D6, 0x962E, 0xE8D7, 0x9811, 0xE8D8, 0x66F0, 0xE8D9, 0x5F80, 0xE8DA, 0x65FA, 0xE8DB, 0x6789, 0xE8DC, 0x6C6A, + 0xE8DD, 0x738B, 0xE8DE, 0x502D, 0xE8DF, 0x5A03, 0xE8E0, 0x6B6A, 0xE8E1, 0x77EE, 0xE8E2, 0x5916, 0xE8E3, 0x5D6C, 0xE8E4, 0x5DCD, + 0xE8E5, 0x7325, 0xE8E6, 0x754F, 0xE8E7, 0xF9BA, 0xE8E8, 0xF9BB, 0xE8E9, 0x50E5, 0xE8EA, 0x51F9, 0xE8EB, 0x582F, 0xE8EC, 0x592D, + 0xE8ED, 0x5996, 0xE8EE, 0x59DA, 0xE8EF, 0x5BE5, 0xE8F0, 0xF9BC, 0xE8F1, 0xF9BD, 0xE8F2, 0x5DA2, 0xE8F3, 0x62D7, 0xE8F4, 0x6416, + 0xE8F5, 0x6493, 0xE8F6, 0x64FE, 0xE8F7, 0xF9BE, 0xE8F8, 0x66DC, 0xE8F9, 0xF9BF, 0xE8FA, 0x6A48, 0xE8FB, 0xF9C0, 0xE8FC, 0x71FF, + 0xE8FD, 0x7464, 0xE8FE, 0xF9C1, 0xE9A1, 0x7A88, 0xE9A2, 0x7AAF, 0xE9A3, 0x7E47, 0xE9A4, 0x7E5E, 0xE9A5, 0x8000, 0xE9A6, 0x8170, + 0xE9A7, 0xF9C2, 0xE9A8, 0x87EF, 0xE9A9, 0x8981, 0xE9AA, 0x8B20, 0xE9AB, 0x9059, 0xE9AC, 0xF9C3, 0xE9AD, 0x9080, 0xE9AE, 0x9952, + 0xE9AF, 0x617E, 0xE9B0, 0x6B32, 0xE9B1, 0x6D74, 0xE9B2, 0x7E1F, 0xE9B3, 0x8925, 0xE9B4, 0x8FB1, 0xE9B5, 0x4FD1, 0xE9B6, 0x50AD, + 0xE9B7, 0x5197, 0xE9B8, 0x52C7, 0xE9B9, 0x57C7, 0xE9BA, 0x5889, 0xE9BB, 0x5BB9, 0xE9BC, 0x5EB8, 0xE9BD, 0x6142, 0xE9BE, 0x6995, + 0xE9BF, 0x6D8C, 0xE9C0, 0x6E67, 0xE9C1, 0x6EB6, 0xE9C2, 0x7194, 0xE9C3, 0x7462, 0xE9C4, 0x7528, 0xE9C5, 0x752C, 0xE9C6, 0x8073, + 0xE9C7, 0x8338, 0xE9C8, 0x84C9, 0xE9C9, 0x8E0A, 0xE9CA, 0x9394, 0xE9CB, 0x93DE, 0xE9CC, 0xF9C4, 0xE9CD, 0x4E8E, 0xE9CE, 0x4F51, + 0xE9CF, 0x5076, 0xE9D0, 0x512A, 0xE9D1, 0x53C8, 0xE9D2, 0x53CB, 0xE9D3, 0x53F3, 0xE9D4, 0x5B87, 0xE9D5, 0x5BD3, 0xE9D6, 0x5C24, + 0xE9D7, 0x611A, 0xE9D8, 0x6182, 0xE9D9, 0x65F4, 0xE9DA, 0x725B, 0xE9DB, 0x7397, 0xE9DC, 0x7440, 0xE9DD, 0x76C2, 0xE9DE, 0x7950, + 0xE9DF, 0x7991, 0xE9E0, 0x79B9, 0xE9E1, 0x7D06, 0xE9E2, 0x7FBD, 0xE9E3, 0x828B, 0xE9E4, 0x85D5, 0xE9E5, 0x865E, 0xE9E6, 0x8FC2, + 0xE9E7, 0x9047, 0xE9E8, 0x90F5, 0xE9E9, 0x91EA, 0xE9EA, 0x9685, 0xE9EB, 0x96E8, 0xE9EC, 0x96E9, 0xE9ED, 0x52D6, 0xE9EE, 0x5F67, + 0xE9EF, 0x65ED, 0xE9F0, 0x6631, 0xE9F1, 0x682F, 0xE9F2, 0x715C, 0xE9F3, 0x7A36, 0xE9F4, 0x90C1, 0xE9F5, 0x980A, 0xE9F6, 0x4E91, + 0xE9F7, 0xF9C5, 0xE9F8, 0x6A52, 0xE9F9, 0x6B9E, 0xE9FA, 0x6F90, 0xE9FB, 0x7189, 0xE9FC, 0x8018, 0xE9FD, 0x82B8, 0xE9FE, 0x8553, + 0xEAA1, 0x904B, 0xEAA2, 0x9695, 0xEAA3, 0x96F2, 0xEAA4, 0x97FB, 0xEAA5, 0x851A, 0xEAA6, 0x9B31, 0xEAA7, 0x4E90, 0xEAA8, 0x718A, + 0xEAA9, 0x96C4, 0xEAAA, 0x5143, 0xEAAB, 0x539F, 0xEAAC, 0x54E1, 0xEAAD, 0x5713, 0xEAAE, 0x5712, 0xEAAF, 0x57A3, 0xEAB0, 0x5A9B, + 0xEAB1, 0x5AC4, 0xEAB2, 0x5BC3, 0xEAB3, 0x6028, 0xEAB4, 0x613F, 0xEAB5, 0x63F4, 0xEAB6, 0x6C85, 0xEAB7, 0x6D39, 0xEAB8, 0x6E72, + 0xEAB9, 0x6E90, 0xEABA, 0x7230, 0xEABB, 0x733F, 0xEABC, 0x7457, 0xEABD, 0x82D1, 0xEABE, 0x8881, 0xEABF, 0x8F45, 0xEAC0, 0x9060, + 0xEAC1, 0xF9C6, 0xEAC2, 0x9662, 0xEAC3, 0x9858, 0xEAC4, 0x9D1B, 0xEAC5, 0x6708, 0xEAC6, 0x8D8A, 0xEAC7, 0x925E, 0xEAC8, 0x4F4D, + 0xEAC9, 0x5049, 0xEACA, 0x50DE, 0xEACB, 0x5371, 0xEACC, 0x570D, 0xEACD, 0x59D4, 0xEACE, 0x5A01, 0xEACF, 0x5C09, 0xEAD0, 0x6170, + 0xEAD1, 0x6690, 0xEAD2, 0x6E2D, 0xEAD3, 0x7232, 0xEAD4, 0x744B, 0xEAD5, 0x7DEF, 0xEAD6, 0x80C3, 0xEAD7, 0x840E, 0xEAD8, 0x8466, + 0xEAD9, 0x853F, 0xEADA, 0x875F, 0xEADB, 0x885B, 0xEADC, 0x8918, 0xEADD, 0x8B02, 0xEADE, 0x9055, 0xEADF, 0x97CB, 0xEAE0, 0x9B4F, + 0xEAE1, 0x4E73, 0xEAE2, 0x4F91, 0xEAE3, 0x5112, 0xEAE4, 0x516A, 0xEAE5, 0xF9C7, 0xEAE6, 0x552F, 0xEAE7, 0x55A9, 0xEAE8, 0x5B7A, + 0xEAE9, 0x5BA5, 0xEAEA, 0x5E7C, 0xEAEB, 0x5E7D, 0xEAEC, 0x5EBE, 0xEAED, 0x60A0, 0xEAEE, 0x60DF, 0xEAEF, 0x6108, 0xEAF0, 0x6109, + 0xEAF1, 0x63C4, 0xEAF2, 0x6538, 0xEAF3, 0x6709, 0xEAF4, 0xF9C8, 0xEAF5, 0x67D4, 0xEAF6, 0x67DA, 0xEAF7, 0xF9C9, 0xEAF8, 0x6961, + 0xEAF9, 0x6962, 0xEAFA, 0x6CB9, 0xEAFB, 0x6D27, 0xEAFC, 0xF9CA, 0xEAFD, 0x6E38, 0xEAFE, 0xF9CB, 0xEBA1, 0x6FE1, 0xEBA2, 0x7336, + 0xEBA3, 0x7337, 0xEBA4, 0xF9CC, 0xEBA5, 0x745C, 0xEBA6, 0x7531, 0xEBA7, 0xF9CD, 0xEBA8, 0x7652, 0xEBA9, 0xF9CE, 0xEBAA, 0xF9CF, + 0xEBAB, 0x7DAD, 0xEBAC, 0x81FE, 0xEBAD, 0x8438, 0xEBAE, 0x88D5, 0xEBAF, 0x8A98, 0xEBB0, 0x8ADB, 0xEBB1, 0x8AED, 0xEBB2, 0x8E30, + 0xEBB3, 0x8E42, 0xEBB4, 0x904A, 0xEBB5, 0x903E, 0xEBB6, 0x907A, 0xEBB7, 0x9149, 0xEBB8, 0x91C9, 0xEBB9, 0x936E, 0xEBBA, 0xF9D0, + 0xEBBB, 0xF9D1, 0xEBBC, 0x5809, 0xEBBD, 0xF9D2, 0xEBBE, 0x6BD3, 0xEBBF, 0x8089, 0xEBC0, 0x80B2, 0xEBC1, 0xF9D3, 0xEBC2, 0xF9D4, + 0xEBC3, 0x5141, 0xEBC4, 0x596B, 0xEBC5, 0x5C39, 0xEBC6, 0xF9D5, 0xEBC7, 0xF9D6, 0xEBC8, 0x6F64, 0xEBC9, 0x73A7, 0xEBCA, 0x80E4, + 0xEBCB, 0x8D07, 0xEBCC, 0xF9D7, 0xEBCD, 0x9217, 0xEBCE, 0x958F, 0xEBCF, 0xF9D8, 0xEBD0, 0xF9D9, 0xEBD1, 0xF9DA, 0xEBD2, 0xF9DB, + 0xEBD3, 0x807F, 0xEBD4, 0x620E, 0xEBD5, 0x701C, 0xEBD6, 0x7D68, 0xEBD7, 0x878D, 0xEBD8, 0xF9DC, 0xEBD9, 0x57A0, 0xEBDA, 0x6069, + 0xEBDB, 0x6147, 0xEBDC, 0x6BB7, 0xEBDD, 0x8ABE, 0xEBDE, 0x9280, 0xEBDF, 0x96B1, 0xEBE0, 0x4E59, 0xEBE1, 0x541F, 0xEBE2, 0x6DEB, + 0xEBE3, 0x852D, 0xEBE4, 0x9670, 0xEBE5, 0x97F3, 0xEBE6, 0x98EE, 0xEBE7, 0x63D6, 0xEBE8, 0x6CE3, 0xEBE9, 0x9091, 0xEBEA, 0x51DD, + 0xEBEB, 0x61C9, 0xEBEC, 0x81BA, 0xEBED, 0x9DF9, 0xEBEE, 0x4F9D, 0xEBEF, 0x501A, 0xEBF0, 0x5100, 0xEBF1, 0x5B9C, 0xEBF2, 0x610F, + 0xEBF3, 0x61FF, 0xEBF4, 0x64EC, 0xEBF5, 0x6905, 0xEBF6, 0x6BC5, 0xEBF7, 0x7591, 0xEBF8, 0x77E3, 0xEBF9, 0x7FA9, 0xEBFA, 0x8264, + 0xEBFB, 0x858F, 0xEBFC, 0x87FB, 0xEBFD, 0x8863, 0xEBFE, 0x8ABC, 0xECA1, 0x8B70, 0xECA2, 0x91AB, 0xECA3, 0x4E8C, 0xECA4, 0x4EE5, + 0xECA5, 0x4F0A, 0xECA6, 0xF9DD, 0xECA7, 0xF9DE, 0xECA8, 0x5937, 0xECA9, 0x59E8, 0xECAA, 0xF9DF, 0xECAB, 0x5DF2, 0xECAC, 0x5F1B, + 0xECAD, 0x5F5B, 0xECAE, 0x6021, 0xECAF, 0xF9E0, 0xECB0, 0xF9E1, 0xECB1, 0xF9E2, 0xECB2, 0xF9E3, 0xECB3, 0x723E, 0xECB4, 0x73E5, + 0xECB5, 0xF9E4, 0xECB6, 0x7570, 0xECB7, 0x75CD, 0xECB8, 0xF9E5, 0xECB9, 0x79FB, 0xECBA, 0xF9E6, 0xECBB, 0x800C, 0xECBC, 0x8033, + 0xECBD, 0x8084, 0xECBE, 0x82E1, 0xECBF, 0x8351, 0xECC0, 0xF9E7, 0xECC1, 0xF9E8, 0xECC2, 0x8CBD, 0xECC3, 0x8CB3, 0xECC4, 0x9087, + 0xECC5, 0xF9E9, 0xECC6, 0xF9EA, 0xECC7, 0x98F4, 0xECC8, 0x990C, 0xECC9, 0xF9EB, 0xECCA, 0xF9EC, 0xECCB, 0x7037, 0xECCC, 0x76CA, + 0xECCD, 0x7FCA, 0xECCE, 0x7FCC, 0xECCF, 0x7FFC, 0xECD0, 0x8B1A, 0xECD1, 0x4EBA, 0xECD2, 0x4EC1, 0xECD3, 0x5203, 0xECD4, 0x5370, + 0xECD5, 0xF9ED, 0xECD6, 0x54BD, 0xECD7, 0x56E0, 0xECD8, 0x59FB, 0xECD9, 0x5BC5, 0xECDA, 0x5F15, 0xECDB, 0x5FCD, 0xECDC, 0x6E6E, + 0xECDD, 0xF9EE, 0xECDE, 0xF9EF, 0xECDF, 0x7D6A, 0xECE0, 0x8335, 0xECE1, 0xF9F0, 0xECE2, 0x8693, 0xECE3, 0x8A8D, 0xECE4, 0xF9F1, + 0xECE5, 0x976D, 0xECE6, 0x9777, 0xECE7, 0xF9F2, 0xECE8, 0xF9F3, 0xECE9, 0x4E00, 0xECEA, 0x4F5A, 0xECEB, 0x4F7E, 0xECEC, 0x58F9, + 0xECED, 0x65E5, 0xECEE, 0x6EA2, 0xECEF, 0x9038, 0xECF0, 0x93B0, 0xECF1, 0x99B9, 0xECF2, 0x4EFB, 0xECF3, 0x58EC, 0xECF4, 0x598A, + 0xECF5, 0x59D9, 0xECF6, 0x6041, 0xECF7, 0xF9F4, 0xECF8, 0xF9F5, 0xECF9, 0x7A14, 0xECFA, 0xF9F6, 0xECFB, 0x834F, 0xECFC, 0x8CC3, + 0xECFD, 0x5165, 0xECFE, 0x5344, 0xEDA1, 0xF9F7, 0xEDA2, 0xF9F8, 0xEDA3, 0xF9F9, 0xEDA4, 0x4ECD, 0xEDA5, 0x5269, 0xEDA6, 0x5B55, + 0xEDA7, 0x82BF, 0xEDA8, 0x4ED4, 0xEDA9, 0x523A, 0xEDAA, 0x54A8, 0xEDAB, 0x59C9, 0xEDAC, 0x59FF, 0xEDAD, 0x5B50, 0xEDAE, 0x5B57, + 0xEDAF, 0x5B5C, 0xEDB0, 0x6063, 0xEDB1, 0x6148, 0xEDB2, 0x6ECB, 0xEDB3, 0x7099, 0xEDB4, 0x716E, 0xEDB5, 0x7386, 0xEDB6, 0x74F7, + 0xEDB7, 0x75B5, 0xEDB8, 0x78C1, 0xEDB9, 0x7D2B, 0xEDBA, 0x8005, 0xEDBB, 0x81EA, 0xEDBC, 0x8328, 0xEDBD, 0x8517, 0xEDBE, 0x85C9, + 0xEDBF, 0x8AEE, 0xEDC0, 0x8CC7, 0xEDC1, 0x96CC, 0xEDC2, 0x4F5C, 0xEDC3, 0x52FA, 0xEDC4, 0x56BC, 0xEDC5, 0x65AB, 0xEDC6, 0x6628, + 0xEDC7, 0x707C, 0xEDC8, 0x70B8, 0xEDC9, 0x7235, 0xEDCA, 0x7DBD, 0xEDCB, 0x828D, 0xEDCC, 0x914C, 0xEDCD, 0x96C0, 0xEDCE, 0x9D72, + 0xEDCF, 0x5B71, 0xEDD0, 0x68E7, 0xEDD1, 0x6B98, 0xEDD2, 0x6F7A, 0xEDD3, 0x76DE, 0xEDD4, 0x5C91, 0xEDD5, 0x66AB, 0xEDD6, 0x6F5B, + 0xEDD7, 0x7BB4, 0xEDD8, 0x7C2A, 0xEDD9, 0x8836, 0xEDDA, 0x96DC, 0xEDDB, 0x4E08, 0xEDDC, 0x4ED7, 0xEDDD, 0x5320, 0xEDDE, 0x5834, + 0xEDDF, 0x58BB, 0xEDE0, 0x58EF, 0xEDE1, 0x596C, 0xEDE2, 0x5C07, 0xEDE3, 0x5E33, 0xEDE4, 0x5E84, 0xEDE5, 0x5F35, 0xEDE6, 0x638C, + 0xEDE7, 0x66B2, 0xEDE8, 0x6756, 0xEDE9, 0x6A1F, 0xEDEA, 0x6AA3, 0xEDEB, 0x6B0C, 0xEDEC, 0x6F3F, 0xEDED, 0x7246, 0xEDEE, 0xF9FA, + 0xEDEF, 0x7350, 0xEDF0, 0x748B, 0xEDF1, 0x7AE0, 0xEDF2, 0x7CA7, 0xEDF3, 0x8178, 0xEDF4, 0x81DF, 0xEDF5, 0x81E7, 0xEDF6, 0x838A, + 0xEDF7, 0x846C, 0xEDF8, 0x8523, 0xEDF9, 0x8594, 0xEDFA, 0x85CF, 0xEDFB, 0x88DD, 0xEDFC, 0x8D13, 0xEDFD, 0x91AC, 0xEDFE, 0x9577, + 0xEEA1, 0x969C, 0xEEA2, 0x518D, 0xEEA3, 0x54C9, 0xEEA4, 0x5728, 0xEEA5, 0x5BB0, 0xEEA6, 0x624D, 0xEEA7, 0x6750, 0xEEA8, 0x683D, + 0xEEA9, 0x6893, 0xEEAA, 0x6E3D, 0xEEAB, 0x6ED3, 0xEEAC, 0x707D, 0xEEAD, 0x7E21, 0xEEAE, 0x88C1, 0xEEAF, 0x8CA1, 0xEEB0, 0x8F09, + 0xEEB1, 0x9F4B, 0xEEB2, 0x9F4E, 0xEEB3, 0x722D, 0xEEB4, 0x7B8F, 0xEEB5, 0x8ACD, 0xEEB6, 0x931A, 0xEEB7, 0x4F47, 0xEEB8, 0x4F4E, + 0xEEB9, 0x5132, 0xEEBA, 0x5480, 0xEEBB, 0x59D0, 0xEEBC, 0x5E95, 0xEEBD, 0x62B5, 0xEEBE, 0x6775, 0xEEBF, 0x696E, 0xEEC0, 0x6A17, + 0xEEC1, 0x6CAE, 0xEEC2, 0x6E1A, 0xEEC3, 0x72D9, 0xEEC4, 0x732A, 0xEEC5, 0x75BD, 0xEEC6, 0x7BB8, 0xEEC7, 0x7D35, 0xEEC8, 0x82E7, + 0xEEC9, 0x83F9, 0xEECA, 0x8457, 0xEECB, 0x85F7, 0xEECC, 0x8A5B, 0xEECD, 0x8CAF, 0xEECE, 0x8E87, 0xEECF, 0x9019, 0xEED0, 0x90B8, + 0xEED1, 0x96CE, 0xEED2, 0x9F5F, 0xEED3, 0x52E3, 0xEED4, 0x540A, 0xEED5, 0x5AE1, 0xEED6, 0x5BC2, 0xEED7, 0x6458, 0xEED8, 0x6575, + 0xEED9, 0x6EF4, 0xEEDA, 0x72C4, 0xEEDB, 0xF9FB, 0xEEDC, 0x7684, 0xEEDD, 0x7A4D, 0xEEDE, 0x7B1B, 0xEEDF, 0x7C4D, 0xEEE0, 0x7E3E, + 0xEEE1, 0x7FDF, 0xEEE2, 0x837B, 0xEEE3, 0x8B2B, 0xEEE4, 0x8CCA, 0xEEE5, 0x8D64, 0xEEE6, 0x8DE1, 0xEEE7, 0x8E5F, 0xEEE8, 0x8FEA, + 0xEEE9, 0x8FF9, 0xEEEA, 0x9069, 0xEEEB, 0x93D1, 0xEEEC, 0x4F43, 0xEEED, 0x4F7A, 0xEEEE, 0x50B3, 0xEEEF, 0x5168, 0xEEF0, 0x5178, + 0xEEF1, 0x524D, 0xEEF2, 0x526A, 0xEEF3, 0x5861, 0xEEF4, 0x587C, 0xEEF5, 0x5960, 0xEEF6, 0x5C08, 0xEEF7, 0x5C55, 0xEEF8, 0x5EDB, + 0xEEF9, 0x609B, 0xEEFA, 0x6230, 0xEEFB, 0x6813, 0xEEFC, 0x6BBF, 0xEEFD, 0x6C08, 0xEEFE, 0x6FB1, 0xEFA1, 0x714E, 0xEFA2, 0x7420, + 0xEFA3, 0x7530, 0xEFA4, 0x7538, 0xEFA5, 0x7551, 0xEFA6, 0x7672, 0xEFA7, 0x7B4C, 0xEFA8, 0x7B8B, 0xEFA9, 0x7BAD, 0xEFAA, 0x7BC6, + 0xEFAB, 0x7E8F, 0xEFAC, 0x8A6E, 0xEFAD, 0x8F3E, 0xEFAE, 0x8F49, 0xEFAF, 0x923F, 0xEFB0, 0x9293, 0xEFB1, 0x9322, 0xEFB2, 0x942B, + 0xEFB3, 0x96FB, 0xEFB4, 0x985A, 0xEFB5, 0x986B, 0xEFB6, 0x991E, 0xEFB7, 0x5207, 0xEFB8, 0x622A, 0xEFB9, 0x6298, 0xEFBA, 0x6D59, + 0xEFBB, 0x7664, 0xEFBC, 0x7ACA, 0xEFBD, 0x7BC0, 0xEFBE, 0x7D76, 0xEFBF, 0x5360, 0xEFC0, 0x5CBE, 0xEFC1, 0x5E97, 0xEFC2, 0x6F38, + 0xEFC3, 0x70B9, 0xEFC4, 0x7C98, 0xEFC5, 0x9711, 0xEFC6, 0x9B8E, 0xEFC7, 0x9EDE, 0xEFC8, 0x63A5, 0xEFC9, 0x647A, 0xEFCA, 0x8776, + 0xEFCB, 0x4E01, 0xEFCC, 0x4E95, 0xEFCD, 0x4EAD, 0xEFCE, 0x505C, 0xEFCF, 0x5075, 0xEFD0, 0x5448, 0xEFD1, 0x59C3, 0xEFD2, 0x5B9A, + 0xEFD3, 0x5E40, 0xEFD4, 0x5EAD, 0xEFD5, 0x5EF7, 0xEFD6, 0x5F81, 0xEFD7, 0x60C5, 0xEFD8, 0x633A, 0xEFD9, 0x653F, 0xEFDA, 0x6574, + 0xEFDB, 0x65CC, 0xEFDC, 0x6676, 0xEFDD, 0x6678, 0xEFDE, 0x67FE, 0xEFDF, 0x6968, 0xEFE0, 0x6A89, 0xEFE1, 0x6B63, 0xEFE2, 0x6C40, + 0xEFE3, 0x6DC0, 0xEFE4, 0x6DE8, 0xEFE5, 0x6E1F, 0xEFE6, 0x6E5E, 0xEFE7, 0x701E, 0xEFE8, 0x70A1, 0xEFE9, 0x738E, 0xEFEA, 0x73FD, + 0xEFEB, 0x753A, 0xEFEC, 0x775B, 0xEFED, 0x7887, 0xEFEE, 0x798E, 0xEFEF, 0x7A0B, 0xEFF0, 0x7A7D, 0xEFF1, 0x7CBE, 0xEFF2, 0x7D8E, + 0xEFF3, 0x8247, 0xEFF4, 0x8A02, 0xEFF5, 0x8AEA, 0xEFF6, 0x8C9E, 0xEFF7, 0x912D, 0xEFF8, 0x914A, 0xEFF9, 0x91D8, 0xEFFA, 0x9266, + 0xEFFB, 0x92CC, 0xEFFC, 0x9320, 0xEFFD, 0x9706, 0xEFFE, 0x9756, 0xF0A1, 0x975C, 0xF0A2, 0x9802, 0xF0A3, 0x9F0E, 0xF0A4, 0x5236, + 0xF0A5, 0x5291, 0xF0A6, 0x557C, 0xF0A7, 0x5824, 0xF0A8, 0x5E1D, 0xF0A9, 0x5F1F, 0xF0AA, 0x608C, 0xF0AB, 0x63D0, 0xF0AC, 0x68AF, + 0xF0AD, 0x6FDF, 0xF0AE, 0x796D, 0xF0AF, 0x7B2C, 0xF0B0, 0x81CD, 0xF0B1, 0x85BA, 0xF0B2, 0x88FD, 0xF0B3, 0x8AF8, 0xF0B4, 0x8E44, + 0xF0B5, 0x918D, 0xF0B6, 0x9664, 0xF0B7, 0x969B, 0xF0B8, 0x973D, 0xF0B9, 0x984C, 0xF0BA, 0x9F4A, 0xF0BB, 0x4FCE, 0xF0BC, 0x5146, + 0xF0BD, 0x51CB, 0xF0BE, 0x52A9, 0xF0BF, 0x5632, 0xF0C0, 0x5F14, 0xF0C1, 0x5F6B, 0xF0C2, 0x63AA, 0xF0C3, 0x64CD, 0xF0C4, 0x65E9, + 0xF0C5, 0x6641, 0xF0C6, 0x66FA, 0xF0C7, 0x66F9, 0xF0C8, 0x671D, 0xF0C9, 0x689D, 0xF0CA, 0x68D7, 0xF0CB, 0x69FD, 0xF0CC, 0x6F15, + 0xF0CD, 0x6F6E, 0xF0CE, 0x7167, 0xF0CF, 0x71E5, 0xF0D0, 0x722A, 0xF0D1, 0x74AA, 0xF0D2, 0x773A, 0xF0D3, 0x7956, 0xF0D4, 0x795A, + 0xF0D5, 0x79DF, 0xF0D6, 0x7A20, 0xF0D7, 0x7A95, 0xF0D8, 0x7C97, 0xF0D9, 0x7CDF, 0xF0DA, 0x7D44, 0xF0DB, 0x7E70, 0xF0DC, 0x8087, + 0xF0DD, 0x85FB, 0xF0DE, 0x86A4, 0xF0DF, 0x8A54, 0xF0E0, 0x8ABF, 0xF0E1, 0x8D99, 0xF0E2, 0x8E81, 0xF0E3, 0x9020, 0xF0E4, 0x906D, + 0xF0E5, 0x91E3, 0xF0E6, 0x963B, 0xF0E7, 0x96D5, 0xF0E8, 0x9CE5, 0xF0E9, 0x65CF, 0xF0EA, 0x7C07, 0xF0EB, 0x8DB3, 0xF0EC, 0x93C3, + 0xF0ED, 0x5B58, 0xF0EE, 0x5C0A, 0xF0EF, 0x5352, 0xF0F0, 0x62D9, 0xF0F1, 0x731D, 0xF0F2, 0x5027, 0xF0F3, 0x5B97, 0xF0F4, 0x5F9E, + 0xF0F5, 0x60B0, 0xF0F6, 0x616B, 0xF0F7, 0x68D5, 0xF0F8, 0x6DD9, 0xF0F9, 0x742E, 0xF0FA, 0x7A2E, 0xF0FB, 0x7D42, 0xF0FC, 0x7D9C, + 0xF0FD, 0x7E31, 0xF0FE, 0x816B, 0xF1A1, 0x8E2A, 0xF1A2, 0x8E35, 0xF1A3, 0x937E, 0xF1A4, 0x9418, 0xF1A5, 0x4F50, 0xF1A6, 0x5750, + 0xF1A7, 0x5DE6, 0xF1A8, 0x5EA7, 0xF1A9, 0x632B, 0xF1AA, 0x7F6A, 0xF1AB, 0x4E3B, 0xF1AC, 0x4F4F, 0xF1AD, 0x4F8F, 0xF1AE, 0x505A, + 0xF1AF, 0x59DD, 0xF1B0, 0x80C4, 0xF1B1, 0x546A, 0xF1B2, 0x5468, 0xF1B3, 0x55FE, 0xF1B4, 0x594F, 0xF1B5, 0x5B99, 0xF1B6, 0x5DDE, + 0xF1B7, 0x5EDA, 0xF1B8, 0x665D, 0xF1B9, 0x6731, 0xF1BA, 0x67F1, 0xF1BB, 0x682A, 0xF1BC, 0x6CE8, 0xF1BD, 0x6D32, 0xF1BE, 0x6E4A, + 0xF1BF, 0x6F8D, 0xF1C0, 0x70B7, 0xF1C1, 0x73E0, 0xF1C2, 0x7587, 0xF1C3, 0x7C4C, 0xF1C4, 0x7D02, 0xF1C5, 0x7D2C, 0xF1C6, 0x7DA2, + 0xF1C7, 0x821F, 0xF1C8, 0x86DB, 0xF1C9, 0x8A3B, 0xF1CA, 0x8A85, 0xF1CB, 0x8D70, 0xF1CC, 0x8E8A, 0xF1CD, 0x8F33, 0xF1CE, 0x9031, + 0xF1CF, 0x914E, 0xF1D0, 0x9152, 0xF1D1, 0x9444, 0xF1D2, 0x99D0, 0xF1D3, 0x7AF9, 0xF1D4, 0x7CA5, 0xF1D5, 0x4FCA, 0xF1D6, 0x5101, + 0xF1D7, 0x51C6, 0xF1D8, 0x57C8, 0xF1D9, 0x5BEF, 0xF1DA, 0x5CFB, 0xF1DB, 0x6659, 0xF1DC, 0x6A3D, 0xF1DD, 0x6D5A, 0xF1DE, 0x6E96, + 0xF1DF, 0x6FEC, 0xF1E0, 0x710C, 0xF1E1, 0x756F, 0xF1E2, 0x7AE3, 0xF1E3, 0x8822, 0xF1E4, 0x9021, 0xF1E5, 0x9075, 0xF1E6, 0x96CB, + 0xF1E7, 0x99FF, 0xF1E8, 0x8301, 0xF1E9, 0x4E2D, 0xF1EA, 0x4EF2, 0xF1EB, 0x8846, 0xF1EC, 0x91CD, 0xF1ED, 0x537D, 0xF1EE, 0x6ADB, + 0xF1EF, 0x696B, 0xF1F0, 0x6C41, 0xF1F1, 0x847A, 0xF1F2, 0x589E, 0xF1F3, 0x618E, 0xF1F4, 0x66FE, 0xF1F5, 0x62EF, 0xF1F6, 0x70DD, + 0xF1F7, 0x7511, 0xF1F8, 0x75C7, 0xF1F9, 0x7E52, 0xF1FA, 0x84B8, 0xF1FB, 0x8B49, 0xF1FC, 0x8D08, 0xF1FD, 0x4E4B, 0xF1FE, 0x53EA, + 0xF2A1, 0x54AB, 0xF2A2, 0x5730, 0xF2A3, 0x5740, 0xF2A4, 0x5FD7, 0xF2A5, 0x6301, 0xF2A6, 0x6307, 0xF2A7, 0x646F, 0xF2A8, 0x652F, + 0xF2A9, 0x65E8, 0xF2AA, 0x667A, 0xF2AB, 0x679D, 0xF2AC, 0x67B3, 0xF2AD, 0x6B62, 0xF2AE, 0x6C60, 0xF2AF, 0x6C9A, 0xF2B0, 0x6F2C, + 0xF2B1, 0x77E5, 0xF2B2, 0x7825, 0xF2B3, 0x7949, 0xF2B4, 0x7957, 0xF2B5, 0x7D19, 0xF2B6, 0x80A2, 0xF2B7, 0x8102, 0xF2B8, 0x81F3, + 0xF2B9, 0x829D, 0xF2BA, 0x82B7, 0xF2BB, 0x8718, 0xF2BC, 0x8A8C, 0xF2BD, 0xF9FC, 0xF2BE, 0x8D04, 0xF2BF, 0x8DBE, 0xF2C0, 0x9072, + 0xF2C1, 0x76F4, 0xF2C2, 0x7A19, 0xF2C3, 0x7A37, 0xF2C4, 0x7E54, 0xF2C5, 0x8077, 0xF2C6, 0x5507, 0xF2C7, 0x55D4, 0xF2C8, 0x5875, + 0xF2C9, 0x632F, 0xF2CA, 0x6422, 0xF2CB, 0x6649, 0xF2CC, 0x664B, 0xF2CD, 0x686D, 0xF2CE, 0x699B, 0xF2CF, 0x6B84, 0xF2D0, 0x6D25, + 0xF2D1, 0x6EB1, 0xF2D2, 0x73CD, 0xF2D3, 0x7468, 0xF2D4, 0x74A1, 0xF2D5, 0x755B, 0xF2D6, 0x75B9, 0xF2D7, 0x76E1, 0xF2D8, 0x771E, + 0xF2D9, 0x778B, 0xF2DA, 0x79E6, 0xF2DB, 0x7E09, 0xF2DC, 0x7E1D, 0xF2DD, 0x81FB, 0xF2DE, 0x852F, 0xF2DF, 0x8897, 0xF2E0, 0x8A3A, + 0xF2E1, 0x8CD1, 0xF2E2, 0x8EEB, 0xF2E3, 0x8FB0, 0xF2E4, 0x9032, 0xF2E5, 0x93AD, 0xF2E6, 0x9663, 0xF2E7, 0x9673, 0xF2E8, 0x9707, + 0xF2E9, 0x4F84, 0xF2EA, 0x53F1, 0xF2EB, 0x59EA, 0xF2EC, 0x5AC9, 0xF2ED, 0x5E19, 0xF2EE, 0x684E, 0xF2EF, 0x74C6, 0xF2F0, 0x75BE, + 0xF2F1, 0x79E9, 0xF2F2, 0x7A92, 0xF2F3, 0x81A3, 0xF2F4, 0x86ED, 0xF2F5, 0x8CEA, 0xF2F6, 0x8DCC, 0xF2F7, 0x8FED, 0xF2F8, 0x659F, + 0xF2F9, 0x6715, 0xF2FA, 0xF9FD, 0xF2FB, 0x57F7, 0xF2FC, 0x6F57, 0xF2FD, 0x7DDD, 0xF2FE, 0x8F2F, 0xF3A1, 0x93F6, 0xF3A2, 0x96C6, + 0xF3A3, 0x5FB5, 0xF3A4, 0x61F2, 0xF3A5, 0x6F84, 0xF3A6, 0x4E14, 0xF3A7, 0x4F98, 0xF3A8, 0x501F, 0xF3A9, 0x53C9, 0xF3AA, 0x55DF, + 0xF3AB, 0x5D6F, 0xF3AC, 0x5DEE, 0xF3AD, 0x6B21, 0xF3AE, 0x6B64, 0xF3AF, 0x78CB, 0xF3B0, 0x7B9A, 0xF3B1, 0xF9FE, 0xF3B2, 0x8E49, + 0xF3B3, 0x8ECA, 0xF3B4, 0x906E, 0xF3B5, 0x6349, 0xF3B6, 0x643E, 0xF3B7, 0x7740, 0xF3B8, 0x7A84, 0xF3B9, 0x932F, 0xF3BA, 0x947F, + 0xF3BB, 0x9F6A, 0xF3BC, 0x64B0, 0xF3BD, 0x6FAF, 0xF3BE, 0x71E6, 0xF3BF, 0x74A8, 0xF3C0, 0x74DA, 0xF3C1, 0x7AC4, 0xF3C2, 0x7C12, + 0xF3C3, 0x7E82, 0xF3C4, 0x7CB2, 0xF3C5, 0x7E98, 0xF3C6, 0x8B9A, 0xF3C7, 0x8D0A, 0xF3C8, 0x947D, 0xF3C9, 0x9910, 0xF3CA, 0x994C, + 0xF3CB, 0x5239, 0xF3CC, 0x5BDF, 0xF3CD, 0x64E6, 0xF3CE, 0x672D, 0xF3CF, 0x7D2E, 0xF3D0, 0x50ED, 0xF3D1, 0x53C3, 0xF3D2, 0x5879, + 0xF3D3, 0x6158, 0xF3D4, 0x6159, 0xF3D5, 0x61FA, 0xF3D6, 0x65AC, 0xF3D7, 0x7AD9, 0xF3D8, 0x8B92, 0xF3D9, 0x8B96, 0xF3DA, 0x5009, + 0xF3DB, 0x5021, 0xF3DC, 0x5275, 0xF3DD, 0x5531, 0xF3DE, 0x5A3C, 0xF3DF, 0x5EE0, 0xF3E0, 0x5F70, 0xF3E1, 0x6134, 0xF3E2, 0x655E, + 0xF3E3, 0x660C, 0xF3E4, 0x6636, 0xF3E5, 0x66A2, 0xF3E6, 0x69CD, 0xF3E7, 0x6EC4, 0xF3E8, 0x6F32, 0xF3E9, 0x7316, 0xF3EA, 0x7621, + 0xF3EB, 0x7A93, 0xF3EC, 0x8139, 0xF3ED, 0x8259, 0xF3EE, 0x83D6, 0xF3EF, 0x84BC, 0xF3F0, 0x50B5, 0xF3F1, 0x57F0, 0xF3F2, 0x5BC0, + 0xF3F3, 0x5BE8, 0xF3F4, 0x5F69, 0xF3F5, 0x63A1, 0xF3F6, 0x7826, 0xF3F7, 0x7DB5, 0xF3F8, 0x83DC, 0xF3F9, 0x8521, 0xF3FA, 0x91C7, + 0xF3FB, 0x91F5, 0xF3FC, 0x518A, 0xF3FD, 0x67F5, 0xF3FE, 0x7B56, 0xF4A1, 0x8CAC, 0xF4A2, 0x51C4, 0xF4A3, 0x59BB, 0xF4A4, 0x60BD, + 0xF4A5, 0x8655, 0xF4A6, 0x501C, 0xF4A7, 0xF9FF, 0xF4A8, 0x5254, 0xF4A9, 0x5C3A, 0xF4AA, 0x617D, 0xF4AB, 0x621A, 0xF4AC, 0x62D3, + 0xF4AD, 0x64F2, 0xF4AE, 0x65A5, 0xF4AF, 0x6ECC, 0xF4B0, 0x7620, 0xF4B1, 0x810A, 0xF4B2, 0x8E60, 0xF4B3, 0x965F, 0xF4B4, 0x96BB, + 0xF4B5, 0x4EDF, 0xF4B6, 0x5343, 0xF4B7, 0x5598, 0xF4B8, 0x5929, 0xF4B9, 0x5DDD, 0xF4BA, 0x64C5, 0xF4BB, 0x6CC9, 0xF4BC, 0x6DFA, + 0xF4BD, 0x7394, 0xF4BE, 0x7A7F, 0xF4BF, 0x821B, 0xF4C0, 0x85A6, 0xF4C1, 0x8CE4, 0xF4C2, 0x8E10, 0xF4C3, 0x9077, 0xF4C4, 0x91E7, + 0xF4C5, 0x95E1, 0xF4C6, 0x9621, 0xF4C7, 0x97C6, 0xF4C8, 0x51F8, 0xF4C9, 0x54F2, 0xF4CA, 0x5586, 0xF4CB, 0x5FB9, 0xF4CC, 0x64A4, + 0xF4CD, 0x6F88, 0xF4CE, 0x7DB4, 0xF4CF, 0x8F1F, 0xF4D0, 0x8F4D, 0xF4D1, 0x9435, 0xF4D2, 0x50C9, 0xF4D3, 0x5C16, 0xF4D4, 0x6CBE, + 0xF4D5, 0x6DFB, 0xF4D6, 0x751B, 0xF4D7, 0x77BB, 0xF4D8, 0x7C3D, 0xF4D9, 0x7C64, 0xF4DA, 0x8A79, 0xF4DB, 0x8AC2, 0xF4DC, 0x581E, + 0xF4DD, 0x59BE, 0xF4DE, 0x5E16, 0xF4DF, 0x6377, 0xF4E0, 0x7252, 0xF4E1, 0x758A, 0xF4E2, 0x776B, 0xF4E3, 0x8ADC, 0xF4E4, 0x8CBC, + 0xF4E5, 0x8F12, 0xF4E6, 0x5EF3, 0xF4E7, 0x6674, 0xF4E8, 0x6DF8, 0xF4E9, 0x807D, 0xF4EA, 0x83C1, 0xF4EB, 0x8ACB, 0xF4EC, 0x9751, + 0xF4ED, 0x9BD6, 0xF4EE, 0xFA00, 0xF4EF, 0x5243, 0xF4F0, 0x66FF, 0xF4F1, 0x6D95, 0xF4F2, 0x6EEF, 0xF4F3, 0x7DE0, 0xF4F4, 0x8AE6, + 0xF4F5, 0x902E, 0xF4F6, 0x905E, 0xF4F7, 0x9AD4, 0xF4F8, 0x521D, 0xF4F9, 0x527F, 0xF4FA, 0x54E8, 0xF4FB, 0x6194, 0xF4FC, 0x6284, + 0xF4FD, 0x62DB, 0xF4FE, 0x68A2, 0xF5A1, 0x6912, 0xF5A2, 0x695A, 0xF5A3, 0x6A35, 0xF5A4, 0x7092, 0xF5A5, 0x7126, 0xF5A6, 0x785D, + 0xF5A7, 0x7901, 0xF5A8, 0x790E, 0xF5A9, 0x79D2, 0xF5AA, 0x7A0D, 0xF5AB, 0x8096, 0xF5AC, 0x8278, 0xF5AD, 0x82D5, 0xF5AE, 0x8349, + 0xF5AF, 0x8549, 0xF5B0, 0x8C82, 0xF5B1, 0x8D85, 0xF5B2, 0x9162, 0xF5B3, 0x918B, 0xF5B4, 0x91AE, 0xF5B5, 0x4FC3, 0xF5B6, 0x56D1, + 0xF5B7, 0x71ED, 0xF5B8, 0x77D7, 0xF5B9, 0x8700, 0xF5BA, 0x89F8, 0xF5BB, 0x5BF8, 0xF5BC, 0x5FD6, 0xF5BD, 0x6751, 0xF5BE, 0x90A8, + 0xF5BF, 0x53E2, 0xF5C0, 0x585A, 0xF5C1, 0x5BF5, 0xF5C2, 0x60A4, 0xF5C3, 0x6181, 0xF5C4, 0x6460, 0xF5C5, 0x7E3D, 0xF5C6, 0x8070, + 0xF5C7, 0x8525, 0xF5C8, 0x9283, 0xF5C9, 0x64AE, 0xF5CA, 0x50AC, 0xF5CB, 0x5D14, 0xF5CC, 0x6700, 0xF5CD, 0x589C, 0xF5CE, 0x62BD, + 0xF5CF, 0x63A8, 0xF5D0, 0x690E, 0xF5D1, 0x6978, 0xF5D2, 0x6A1E, 0xF5D3, 0x6E6B, 0xF5D4, 0x76BA, 0xF5D5, 0x79CB, 0xF5D6, 0x82BB, + 0xF5D7, 0x8429, 0xF5D8, 0x8ACF, 0xF5D9, 0x8DA8, 0xF5DA, 0x8FFD, 0xF5DB, 0x9112, 0xF5DC, 0x914B, 0xF5DD, 0x919C, 0xF5DE, 0x9310, + 0xF5DF, 0x9318, 0xF5E0, 0x939A, 0xF5E1, 0x96DB, 0xF5E2, 0x9A36, 0xF5E3, 0x9C0D, 0xF5E4, 0x4E11, 0xF5E5, 0x755C, 0xF5E6, 0x795D, + 0xF5E7, 0x7AFA, 0xF5E8, 0x7B51, 0xF5E9, 0x7BC9, 0xF5EA, 0x7E2E, 0xF5EB, 0x84C4, 0xF5EC, 0x8E59, 0xF5ED, 0x8E74, 0xF5EE, 0x8EF8, + 0xF5EF, 0x9010, 0xF5F0, 0x6625, 0xF5F1, 0x693F, 0xF5F2, 0x7443, 0xF5F3, 0x51FA, 0xF5F4, 0x672E, 0xF5F5, 0x9EDC, 0xF5F6, 0x5145, + 0xF5F7, 0x5FE0, 0xF5F8, 0x6C96, 0xF5F9, 0x87F2, 0xF5FA, 0x885D, 0xF5FB, 0x8877, 0xF5FC, 0x60B4, 0xF5FD, 0x81B5, 0xF5FE, 0x8403, + 0xF6A1, 0x8D05, 0xF6A2, 0x53D6, 0xF6A3, 0x5439, 0xF6A4, 0x5634, 0xF6A5, 0x5A36, 0xF6A6, 0x5C31, 0xF6A7, 0x708A, 0xF6A8, 0x7FE0, + 0xF6A9, 0x805A, 0xF6AA, 0x8106, 0xF6AB, 0x81ED, 0xF6AC, 0x8DA3, 0xF6AD, 0x9189, 0xF6AE, 0x9A5F, 0xF6AF, 0x9DF2, 0xF6B0, 0x5074, + 0xF6B1, 0x4EC4, 0xF6B2, 0x53A0, 0xF6B3, 0x60FB, 0xF6B4, 0x6E2C, 0xF6B5, 0x5C64, 0xF6B6, 0x4F88, 0xF6B7, 0x5024, 0xF6B8, 0x55E4, + 0xF6B9, 0x5CD9, 0xF6BA, 0x5E5F, 0xF6BB, 0x6065, 0xF6BC, 0x6894, 0xF6BD, 0x6CBB, 0xF6BE, 0x6DC4, 0xF6BF, 0x71BE, 0xF6C0, 0x75D4, + 0xF6C1, 0x75F4, 0xF6C2, 0x7661, 0xF6C3, 0x7A1A, 0xF6C4, 0x7A49, 0xF6C5, 0x7DC7, 0xF6C6, 0x7DFB, 0xF6C7, 0x7F6E, 0xF6C8, 0x81F4, + 0xF6C9, 0x86A9, 0xF6CA, 0x8F1C, 0xF6CB, 0x96C9, 0xF6CC, 0x99B3, 0xF6CD, 0x9F52, 0xF6CE, 0x5247, 0xF6CF, 0x52C5, 0xF6D0, 0x98ED, + 0xF6D1, 0x89AA, 0xF6D2, 0x4E03, 0xF6D3, 0x67D2, 0xF6D4, 0x6F06, 0xF6D5, 0x4FB5, 0xF6D6, 0x5BE2, 0xF6D7, 0x6795, 0xF6D8, 0x6C88, + 0xF6D9, 0x6D78, 0xF6DA, 0x741B, 0xF6DB, 0x7827, 0xF6DC, 0x91DD, 0xF6DD, 0x937C, 0xF6DE, 0x87C4, 0xF6DF, 0x79E4, 0xF6E0, 0x7A31, + 0xF6E1, 0x5FEB, 0xF6E2, 0x4ED6, 0xF6E3, 0x54A4, 0xF6E4, 0x553E, 0xF6E5, 0x58AE, 0xF6E6, 0x59A5, 0xF6E7, 0x60F0, 0xF6E8, 0x6253, + 0xF6E9, 0x62D6, 0xF6EA, 0x6736, 0xF6EB, 0x6955, 0xF6EC, 0x8235, 0xF6ED, 0x9640, 0xF6EE, 0x99B1, 0xF6EF, 0x99DD, 0xF6F0, 0x502C, + 0xF6F1, 0x5353, 0xF6F2, 0x5544, 0xF6F3, 0x577C, 0xF6F4, 0xFA01, 0xF6F5, 0x6258, 0xF6F6, 0xFA02, 0xF6F7, 0x64E2, 0xF6F8, 0x666B, + 0xF6F9, 0x67DD, 0xF6FA, 0x6FC1, 0xF6FB, 0x6FEF, 0xF6FC, 0x7422, 0xF6FD, 0x7438, 0xF6FE, 0x8A17, 0xF7A1, 0x9438, 0xF7A2, 0x5451, + 0xF7A3, 0x5606, 0xF7A4, 0x5766, 0xF7A5, 0x5F48, 0xF7A6, 0x619A, 0xF7A7, 0x6B4E, 0xF7A8, 0x7058, 0xF7A9, 0x70AD, 0xF7AA, 0x7DBB, + 0xF7AB, 0x8A95, 0xF7AC, 0x596A, 0xF7AD, 0x812B, 0xF7AE, 0x63A2, 0xF7AF, 0x7708, 0xF7B0, 0x803D, 0xF7B1, 0x8CAA, 0xF7B2, 0x5854, + 0xF7B3, 0x642D, 0xF7B4, 0x69BB, 0xF7B5, 0x5B95, 0xF7B6, 0x5E11, 0xF7B7, 0x6E6F, 0xF7B8, 0xFA03, 0xF7B9, 0x8569, 0xF7BA, 0x514C, + 0xF7BB, 0x53F0, 0xF7BC, 0x592A, 0xF7BD, 0x6020, 0xF7BE, 0x614B, 0xF7BF, 0x6B86, 0xF7C0, 0x6C70, 0xF7C1, 0x6CF0, 0xF7C2, 0x7B1E, + 0xF7C3, 0x80CE, 0xF7C4, 0x82D4, 0xF7C5, 0x8DC6, 0xF7C6, 0x90B0, 0xF7C7, 0x98B1, 0xF7C8, 0xFA04, 0xF7C9, 0x64C7, 0xF7CA, 0x6FA4, + 0xF7CB, 0x6491, 0xF7CC, 0x6504, 0xF7CD, 0x514E, 0xF7CE, 0x5410, 0xF7CF, 0x571F, 0xF7D0, 0x8A0E, 0xF7D1, 0x615F, 0xF7D2, 0x6876, + 0xF7D3, 0xFA05, 0xF7D4, 0x75DB, 0xF7D5, 0x7B52, 0xF7D6, 0x7D71, 0xF7D7, 0x901A, 0xF7D8, 0x5806, 0xF7D9, 0x69CC, 0xF7DA, 0x817F, + 0xF7DB, 0x892A, 0xF7DC, 0x9000, 0xF7DD, 0x9839, 0xF7DE, 0x5078, 0xF7DF, 0x5957, 0xF7E0, 0x59AC, 0xF7E1, 0x6295, 0xF7E2, 0x900F, + 0xF7E3, 0x9B2A, 0xF7E4, 0x615D, 0xF7E5, 0x7279, 0xF7E6, 0x95D6, 0xF7E7, 0x5761, 0xF7E8, 0x5A46, 0xF7E9, 0x5DF4, 0xF7EA, 0x628A, + 0xF7EB, 0x64AD, 0xF7EC, 0x64FA, 0xF7ED, 0x6777, 0xF7EE, 0x6CE2, 0xF7EF, 0x6D3E, 0xF7F0, 0x722C, 0xF7F1, 0x7436, 0xF7F2, 0x7834, + 0xF7F3, 0x7F77, 0xF7F4, 0x82AD, 0xF7F5, 0x8DDB, 0xF7F6, 0x9817, 0xF7F7, 0x5224, 0xF7F8, 0x5742, 0xF7F9, 0x677F, 0xF7FA, 0x7248, + 0xF7FB, 0x74E3, 0xF7FC, 0x8CA9, 0xF7FD, 0x8FA6, 0xF7FE, 0x9211, 0xF8A1, 0x962A, 0xF8A2, 0x516B, 0xF8A3, 0x53ED, 0xF8A4, 0x634C, + 0xF8A5, 0x4F69, 0xF8A6, 0x5504, 0xF8A7, 0x6096, 0xF8A8, 0x6557, 0xF8A9, 0x6C9B, 0xF8AA, 0x6D7F, 0xF8AB, 0x724C, 0xF8AC, 0x72FD, + 0xF8AD, 0x7A17, 0xF8AE, 0x8987, 0xF8AF, 0x8C9D, 0xF8B0, 0x5F6D, 0xF8B1, 0x6F8E, 0xF8B2, 0x70F9, 0xF8B3, 0x81A8, 0xF8B4, 0x610E, + 0xF8B5, 0x4FBF, 0xF8B6, 0x504F, 0xF8B7, 0x6241, 0xF8B8, 0x7247, 0xF8B9, 0x7BC7, 0xF8BA, 0x7DE8, 0xF8BB, 0x7FE9, 0xF8BC, 0x904D, + 0xF8BD, 0x97AD, 0xF8BE, 0x9A19, 0xF8BF, 0x8CB6, 0xF8C0, 0x576A, 0xF8C1, 0x5E73, 0xF8C2, 0x67B0, 0xF8C3, 0x840D, 0xF8C4, 0x8A55, + 0xF8C5, 0x5420, 0xF8C6, 0x5B16, 0xF8C7, 0x5E63, 0xF8C8, 0x5EE2, 0xF8C9, 0x5F0A, 0xF8CA, 0x6583, 0xF8CB, 0x80BA, 0xF8CC, 0x853D, + 0xF8CD, 0x9589, 0xF8CE, 0x965B, 0xF8CF, 0x4F48, 0xF8D0, 0x5305, 0xF8D1, 0x530D, 0xF8D2, 0x530F, 0xF8D3, 0x5486, 0xF8D4, 0x54FA, + 0xF8D5, 0x5703, 0xF8D6, 0x5E03, 0xF8D7, 0x6016, 0xF8D8, 0x629B, 0xF8D9, 0x62B1, 0xF8DA, 0x6355, 0xF8DB, 0xFA06, 0xF8DC, 0x6CE1, + 0xF8DD, 0x6D66, 0xF8DE, 0x75B1, 0xF8DF, 0x7832, 0xF8E0, 0x80DE, 0xF8E1, 0x812F, 0xF8E2, 0x82DE, 0xF8E3, 0x8461, 0xF8E4, 0x84B2, + 0xF8E5, 0x888D, 0xF8E6, 0x8912, 0xF8E7, 0x900B, 0xF8E8, 0x92EA, 0xF8E9, 0x98FD, 0xF8EA, 0x9B91, 0xF8EB, 0x5E45, 0xF8EC, 0x66B4, + 0xF8ED, 0x66DD, 0xF8EE, 0x7011, 0xF8EF, 0x7206, 0xF8F0, 0xFA07, 0xF8F1, 0x4FF5, 0xF8F2, 0x527D, 0xF8F3, 0x5F6A, 0xF8F4, 0x6153, + 0xF8F5, 0x6753, 0xF8F6, 0x6A19, 0xF8F7, 0x6F02, 0xF8F8, 0x74E2, 0xF8F9, 0x7968, 0xF8FA, 0x8868, 0xF8FB, 0x8C79, 0xF8FC, 0x98C7, + 0xF8FD, 0x98C4, 0xF8FE, 0x9A43, 0xF9A1, 0x54C1, 0xF9A2, 0x7A1F, 0xF9A3, 0x6953, 0xF9A4, 0x8AF7, 0xF9A5, 0x8C4A, 0xF9A6, 0x98A8, + 0xF9A7, 0x99AE, 0xF9A8, 0x5F7C, 0xF9A9, 0x62AB, 0xF9AA, 0x75B2, 0xF9AB, 0x76AE, 0xF9AC, 0x88AB, 0xF9AD, 0x907F, 0xF9AE, 0x9642, + 0xF9AF, 0x5339, 0xF9B0, 0x5F3C, 0xF9B1, 0x5FC5, 0xF9B2, 0x6CCC, 0xF9B3, 0x73CC, 0xF9B4, 0x7562, 0xF9B5, 0x758B, 0xF9B6, 0x7B46, + 0xF9B7, 0x82FE, 0xF9B8, 0x999D, 0xF9B9, 0x4E4F, 0xF9BA, 0x903C, 0xF9BB, 0x4E0B, 0xF9BC, 0x4F55, 0xF9BD, 0x53A6, 0xF9BE, 0x590F, + 0xF9BF, 0x5EC8, 0xF9C0, 0x6630, 0xF9C1, 0x6CB3, 0xF9C2, 0x7455, 0xF9C3, 0x8377, 0xF9C4, 0x8766, 0xF9C5, 0x8CC0, 0xF9C6, 0x9050, + 0xF9C7, 0x971E, 0xF9C8, 0x9C15, 0xF9C9, 0x58D1, 0xF9CA, 0x5B78, 0xF9CB, 0x8650, 0xF9CC, 0x8B14, 0xF9CD, 0x9DB4, 0xF9CE, 0x5BD2, + 0xF9CF, 0x6068, 0xF9D0, 0x608D, 0xF9D1, 0x65F1, 0xF9D2, 0x6C57, 0xF9D3, 0x6F22, 0xF9D4, 0x6FA3, 0xF9D5, 0x701A, 0xF9D6, 0x7F55, + 0xF9D7, 0x7FF0, 0xF9D8, 0x9591, 0xF9D9, 0x9592, 0xF9DA, 0x9650, 0xF9DB, 0x97D3, 0xF9DC, 0x5272, 0xF9DD, 0x8F44, 0xF9DE, 0x51FD, + 0xF9DF, 0x542B, 0xF9E0, 0x54B8, 0xF9E1, 0x5563, 0xF9E2, 0x558A, 0xF9E3, 0x6ABB, 0xF9E4, 0x6DB5, 0xF9E5, 0x7DD8, 0xF9E6, 0x8266, + 0xF9E7, 0x929C, 0xF9E8, 0x9677, 0xF9E9, 0x9E79, 0xF9EA, 0x5408, 0xF9EB, 0x54C8, 0xF9EC, 0x76D2, 0xF9ED, 0x86E4, 0xF9EE, 0x95A4, + 0xF9EF, 0x95D4, 0xF9F0, 0x965C, 0xF9F1, 0x4EA2, 0xF9F2, 0x4F09, 0xF9F3, 0x59EE, 0xF9F4, 0x5AE6, 0xF9F5, 0x5DF7, 0xF9F6, 0x6052, + 0xF9F7, 0x6297, 0xF9F8, 0x676D, 0xF9F9, 0x6841, 0xF9FA, 0x6C86, 0xF9FB, 0x6E2F, 0xF9FC, 0x7F38, 0xF9FD, 0x809B, 0xF9FE, 0x822A, + 0xFAA1, 0xFA08, 0xFAA2, 0xFA09, 0xFAA3, 0x9805, 0xFAA4, 0x4EA5, 0xFAA5, 0x5055, 0xFAA6, 0x54B3, 0xFAA7, 0x5793, 0xFAA8, 0x595A, + 0xFAA9, 0x5B69, 0xFAAA, 0x5BB3, 0xFAAB, 0x61C8, 0xFAAC, 0x6977, 0xFAAD, 0x6D77, 0xFAAE, 0x7023, 0xFAAF, 0x87F9, 0xFAB0, 0x89E3, + 0xFAB1, 0x8A72, 0xFAB2, 0x8AE7, 0xFAB3, 0x9082, 0xFAB4, 0x99ED, 0xFAB5, 0x9AB8, 0xFAB6, 0x52BE, 0xFAB7, 0x6838, 0xFAB8, 0x5016, + 0xFAB9, 0x5E78, 0xFABA, 0x674F, 0xFABB, 0x8347, 0xFABC, 0x884C, 0xFABD, 0x4EAB, 0xFABE, 0x5411, 0xFABF, 0x56AE, 0xFAC0, 0x73E6, + 0xFAC1, 0x9115, 0xFAC2, 0x97FF, 0xFAC3, 0x9909, 0xFAC4, 0x9957, 0xFAC5, 0x9999, 0xFAC6, 0x5653, 0xFAC7, 0x589F, 0xFAC8, 0x865B, + 0xFAC9, 0x8A31, 0xFACA, 0x61B2, 0xFACB, 0x6AF6, 0xFACC, 0x737B, 0xFACD, 0x8ED2, 0xFACE, 0x6B47, 0xFACF, 0x96AA, 0xFAD0, 0x9A57, + 0xFAD1, 0x5955, 0xFAD2, 0x7200, 0xFAD3, 0x8D6B, 0xFAD4, 0x9769, 0xFAD5, 0x4FD4, 0xFAD6, 0x5CF4, 0xFAD7, 0x5F26, 0xFAD8, 0x61F8, + 0xFAD9, 0x665B, 0xFADA, 0x6CEB, 0xFADB, 0x70AB, 0xFADC, 0x7384, 0xFADD, 0x73B9, 0xFADE, 0x73FE, 0xFADF, 0x7729, 0xFAE0, 0x774D, + 0xFAE1, 0x7D43, 0xFAE2, 0x7D62, 0xFAE3, 0x7E23, 0xFAE4, 0x8237, 0xFAE5, 0x8852, 0xFAE6, 0xFA0A, 0xFAE7, 0x8CE2, 0xFAE8, 0x9249, + 0xFAE9, 0x986F, 0xFAEA, 0x5B51, 0xFAEB, 0x7A74, 0xFAEC, 0x8840, 0xFAED, 0x9801, 0xFAEE, 0x5ACC, 0xFAEF, 0x4FE0, 0xFAF0, 0x5354, + 0xFAF1, 0x593E, 0xFAF2, 0x5CFD, 0xFAF3, 0x633E, 0xFAF4, 0x6D79, 0xFAF5, 0x72F9, 0xFAF6, 0x8105, 0xFAF7, 0x8107, 0xFAF8, 0x83A2, + 0xFAF9, 0x92CF, 0xFAFA, 0x9830, 0xFAFB, 0x4EA8, 0xFAFC, 0x5144, 0xFAFD, 0x5211, 0xFAFE, 0x578B, 0xFBA1, 0x5F62, 0xFBA2, 0x6CC2, + 0xFBA3, 0x6ECE, 0xFBA4, 0x7005, 0xFBA5, 0x7050, 0xFBA6, 0x70AF, 0xFBA7, 0x7192, 0xFBA8, 0x73E9, 0xFBA9, 0x7469, 0xFBAA, 0x834A, + 0xFBAB, 0x87A2, 0xFBAC, 0x8861, 0xFBAD, 0x9008, 0xFBAE, 0x90A2, 0xFBAF, 0x93A3, 0xFBB0, 0x99A8, 0xFBB1, 0x516E, 0xFBB2, 0x5F57, + 0xFBB3, 0x60E0, 0xFBB4, 0x6167, 0xFBB5, 0x66B3, 0xFBB6, 0x8559, 0xFBB7, 0x8E4A, 0xFBB8, 0x91AF, 0xFBB9, 0x978B, 0xFBBA, 0x4E4E, + 0xFBBB, 0x4E92, 0xFBBC, 0x547C, 0xFBBD, 0x58D5, 0xFBBE, 0x58FA, 0xFBBF, 0x597D, 0xFBC0, 0x5CB5, 0xFBC1, 0x5F27, 0xFBC2, 0x6236, + 0xFBC3, 0x6248, 0xFBC4, 0x660A, 0xFBC5, 0x6667, 0xFBC6, 0x6BEB, 0xFBC7, 0x6D69, 0xFBC8, 0x6DCF, 0xFBC9, 0x6E56, 0xFBCA, 0x6EF8, + 0xFBCB, 0x6F94, 0xFBCC, 0x6FE0, 0xFBCD, 0x6FE9, 0xFBCE, 0x705D, 0xFBCF, 0x72D0, 0xFBD0, 0x7425, 0xFBD1, 0x745A, 0xFBD2, 0x74E0, + 0xFBD3, 0x7693, 0xFBD4, 0x795C, 0xFBD5, 0x7CCA, 0xFBD6, 0x7E1E, 0xFBD7, 0x80E1, 0xFBD8, 0x82A6, 0xFBD9, 0x846B, 0xFBDA, 0x84BF, + 0xFBDB, 0x864E, 0xFBDC, 0x865F, 0xFBDD, 0x8774, 0xFBDE, 0x8B77, 0xFBDF, 0x8C6A, 0xFBE0, 0x93AC, 0xFBE1, 0x9800, 0xFBE2, 0x9865, + 0xFBE3, 0x60D1, 0xFBE4, 0x6216, 0xFBE5, 0x9177, 0xFBE6, 0x5A5A, 0xFBE7, 0x660F, 0xFBE8, 0x6DF7, 0xFBE9, 0x6E3E, 0xFBEA, 0x743F, + 0xFBEB, 0x9B42, 0xFBEC, 0x5FFD, 0xFBED, 0x60DA, 0xFBEE, 0x7B0F, 0xFBEF, 0x54C4, 0xFBF0, 0x5F18, 0xFBF1, 0x6C5E, 0xFBF2, 0x6CD3, + 0xFBF3, 0x6D2A, 0xFBF4, 0x70D8, 0xFBF5, 0x7D05, 0xFBF6, 0x8679, 0xFBF7, 0x8A0C, 0xFBF8, 0x9D3B, 0xFBF9, 0x5316, 0xFBFA, 0x548C, + 0xFBFB, 0x5B05, 0xFBFC, 0x6A3A, 0xFBFD, 0x706B, 0xFBFE, 0x7575, 0xFCA1, 0x798D, 0xFCA2, 0x79BE, 0xFCA3, 0x82B1, 0xFCA4, 0x83EF, + 0xFCA5, 0x8A71, 0xFCA6, 0x8B41, 0xFCA7, 0x8CA8, 0xFCA8, 0x9774, 0xFCA9, 0xFA0B, 0xFCAA, 0x64F4, 0xFCAB, 0x652B, 0xFCAC, 0x78BA, + 0xFCAD, 0x78BB, 0xFCAE, 0x7A6B, 0xFCAF, 0x4E38, 0xFCB0, 0x559A, 0xFCB1, 0x5950, 0xFCB2, 0x5BA6, 0xFCB3, 0x5E7B, 0xFCB4, 0x60A3, + 0xFCB5, 0x63DB, 0xFCB6, 0x6B61, 0xFCB7, 0x6665, 0xFCB8, 0x6853, 0xFCB9, 0x6E19, 0xFCBA, 0x7165, 0xFCBB, 0x74B0, 0xFCBC, 0x7D08, + 0xFCBD, 0x9084, 0xFCBE, 0x9A69, 0xFCBF, 0x9C25, 0xFCC0, 0x6D3B, 0xFCC1, 0x6ED1, 0xFCC2, 0x733E, 0xFCC3, 0x8C41, 0xFCC4, 0x95CA, + 0xFCC5, 0x51F0, 0xFCC6, 0x5E4C, 0xFCC7, 0x5FA8, 0xFCC8, 0x604D, 0xFCC9, 0x60F6, 0xFCCA, 0x6130, 0xFCCB, 0x614C, 0xFCCC, 0x6643, + 0xFCCD, 0x6644, 0xFCCE, 0x69A5, 0xFCCF, 0x6CC1, 0xFCD0, 0x6E5F, 0xFCD1, 0x6EC9, 0xFCD2, 0x6F62, 0xFCD3, 0x714C, 0xFCD4, 0x749C, + 0xFCD5, 0x7687, 0xFCD6, 0x7BC1, 0xFCD7, 0x7C27, 0xFCD8, 0x8352, 0xFCD9, 0x8757, 0xFCDA, 0x9051, 0xFCDB, 0x968D, 0xFCDC, 0x9EC3, + 0xFCDD, 0x532F, 0xFCDE, 0x56DE, 0xFCDF, 0x5EFB, 0xFCE0, 0x5F8A, 0xFCE1, 0x6062, 0xFCE2, 0x6094, 0xFCE3, 0x61F7, 0xFCE4, 0x6666, + 0xFCE5, 0x6703, 0xFCE6, 0x6A9C, 0xFCE7, 0x6DEE, 0xFCE8, 0x6FAE, 0xFCE9, 0x7070, 0xFCEA, 0x736A, 0xFCEB, 0x7E6A, 0xFCEC, 0x81BE, + 0xFCED, 0x8334, 0xFCEE, 0x86D4, 0xFCEF, 0x8AA8, 0xFCF0, 0x8CC4, 0xFCF1, 0x5283, 0xFCF2, 0x7372, 0xFCF3, 0x5B96, 0xFCF4, 0x6A6B, + 0xFCF5, 0x9404, 0xFCF6, 0x54EE, 0xFCF7, 0x5686, 0xFCF8, 0x5B5D, 0xFCF9, 0x6548, 0xFCFA, 0x6585, 0xFCFB, 0x66C9, 0xFCFC, 0x689F, + 0xFCFD, 0x6D8D, 0xFCFE, 0x6DC6, 0xFDA1, 0x723B, 0xFDA2, 0x80B4, 0xFDA3, 0x9175, 0xFDA4, 0x9A4D, 0xFDA5, 0x4FAF, 0xFDA6, 0x5019, + 0xFDA7, 0x539A, 0xFDA8, 0x540E, 0xFDA9, 0x543C, 0xFDAA, 0x5589, 0xFDAB, 0x55C5, 0xFDAC, 0x5E3F, 0xFDAD, 0x5F8C, 0xFDAE, 0x673D, + 0xFDAF, 0x7166, 0xFDB0, 0x73DD, 0xFDB1, 0x9005, 0xFDB2, 0x52DB, 0xFDB3, 0x52F3, 0xFDB4, 0x5864, 0xFDB5, 0x58CE, 0xFDB6, 0x7104, + 0xFDB7, 0x718F, 0xFDB8, 0x71FB, 0xFDB9, 0x85B0, 0xFDBA, 0x8A13, 0xFDBB, 0x6688, 0xFDBC, 0x85A8, 0xFDBD, 0x55A7, 0xFDBE, 0x6684, + 0xFDBF, 0x714A, 0xFDC0, 0x8431, 0xFDC1, 0x5349, 0xFDC2, 0x5599, 0xFDC3, 0x6BC1, 0xFDC4, 0x5F59, 0xFDC5, 0x5FBD, 0xFDC6, 0x63EE, + 0xFDC7, 0x6689, 0xFDC8, 0x7147, 0xFDC9, 0x8AF1, 0xFDCA, 0x8F1D, 0xFDCB, 0x9EBE, 0xFDCC, 0x4F11, 0xFDCD, 0x643A, 0xFDCE, 0x70CB, + 0xFDCF, 0x7566, 0xFDD0, 0x8667, 0xFDD1, 0x6064, 0xFDD2, 0x8B4E, 0xFDD3, 0x9DF8, 0xFDD4, 0x5147, 0xFDD5, 0x51F6, 0xFDD6, 0x5308, + 0xFDD7, 0x6D36, 0xFDD8, 0x80F8, 0xFDD9, 0x9ED1, 0xFDDA, 0x6615, 0xFDDB, 0x6B23, 0xFDDC, 0x7098, 0xFDDD, 0x75D5, 0xFDDE, 0x5403, + 0xFDDF, 0x5C79, 0xFDE0, 0x7D07, 0xFDE1, 0x8A16, 0xFDE2, 0x6B20, 0xFDE3, 0x6B3D, 0xFDE4, 0x6B46, 0xFDE5, 0x5438, 0xFDE6, 0x6070, + 0xFDE7, 0x6D3D, 0xFDE8, 0x7FD5, 0xFDE9, 0x8208, 0xFDEA, 0x50D6, 0xFDEB, 0x51DE, 0xFDEC, 0x559C, 0xFDED, 0x566B, 0xFDEE, 0x56CD, + 0xFDEF, 0x59EC, 0xFDF0, 0x5B09, 0xFDF1, 0x5E0C, 0xFDF2, 0x6199, 0xFDF3, 0x6198, 0xFDF4, 0x6231, 0xFDF5, 0x665E, 0xFDF6, 0x66E6, + 0xFDF7, 0x7199, 0xFDF8, 0x71B9, 0xFDF9, 0x71BA, 0xFDFA, 0x72A7, 0xFDFB, 0x79A7, 0xFDFC, 0x7A00, 0xFDFD, 0x7FB2, 0xFDFE, 0x8A70, + 0, 0 +}; +#endif + +#if FF_CODE_PAGE == 950 || FF_CODE_PAGE == 0 /* Traditional Chinese */ +static const WCHAR uni2oem950[] = { /* Unicode --> Big5 pairs */ + 0x00A7, 0xA1B1, 0x00AF, 0xA1C2, 0x00B0, 0xA258, 0x00B1, 0xA1D3, 0x00B7, 0xA150, 0x00D7, 0xA1D1, 0x00F7, 0xA1D2, 0x02C7, 0xA3BE, + 0x02C9, 0xA3BC, 0x02CA, 0xA3BD, 0x02CB, 0xA3BF, 0x02CD, 0xA1C5, 0x02D9, 0xA3BB, 0x0391, 0xA344, 0x0392, 0xA345, 0x0393, 0xA346, + 0x0394, 0xA347, 0x0395, 0xA348, 0x0396, 0xA349, 0x0397, 0xA34A, 0x0398, 0xA34B, 0x0399, 0xA34C, 0x039A, 0xA34D, 0x039B, 0xA34E, + 0x039C, 0xA34F, 0x039D, 0xA350, 0x039E, 0xA351, 0x039F, 0xA352, 0x03A0, 0xA353, 0x03A1, 0xA354, 0x03A3, 0xA355, 0x03A4, 0xA356, + 0x03A5, 0xA357, 0x03A6, 0xA358, 0x03A7, 0xA359, 0x03A8, 0xA35A, 0x03A9, 0xA35B, 0x03B1, 0xA35C, 0x03B2, 0xA35D, 0x03B3, 0xA35E, + 0x03B4, 0xA35F, 0x03B5, 0xA360, 0x03B6, 0xA361, 0x03B7, 0xA362, 0x03B8, 0xA363, 0x03B9, 0xA364, 0x03BA, 0xA365, 0x03BB, 0xA366, + 0x03BC, 0xA367, 0x03BD, 0xA368, 0x03BE, 0xA369, 0x03BF, 0xA36A, 0x03C0, 0xA36B, 0x03C1, 0xA36C, 0x03C3, 0xA36D, 0x03C4, 0xA36E, + 0x03C5, 0xA36F, 0x03C6, 0xA370, 0x03C7, 0xA371, 0x03C8, 0xA372, 0x03C9, 0xA373, 0x2013, 0xA156, 0x2014, 0xA158, 0x2018, 0xA1A5, + 0x2019, 0xA1A6, 0x201C, 0xA1A7, 0x201D, 0xA1A8, 0x2025, 0xA14C, 0x2026, 0xA14B, 0x2027, 0xA145, 0x2032, 0xA1AC, 0x2035, 0xA1AB, + 0x203B, 0xA1B0, 0x20AC, 0xA3E1, 0x2103, 0xA24A, 0x2105, 0xA1C1, 0x2109, 0xA24B, 0x2160, 0xA2B9, 0x2161, 0xA2BA, 0x2162, 0xA2BB, + 0x2163, 0xA2BC, 0x2164, 0xA2BD, 0x2165, 0xA2BE, 0x2166, 0xA2BF, 0x2167, 0xA2C0, 0x2168, 0xA2C1, 0x2169, 0xA2C2, 0x2190, 0xA1F6, + 0x2191, 0xA1F4, 0x2192, 0xA1F7, 0x2193, 0xA1F5, 0x2196, 0xA1F8, 0x2197, 0xA1F9, 0x2198, 0xA1FB, 0x2199, 0xA1FA, 0x2215, 0xA241, + 0x221A, 0xA1D4, 0x221E, 0xA1DB, 0x221F, 0xA1E8, 0x2220, 0xA1E7, 0x2223, 0xA1FD, 0x2225, 0xA1FC, 0x2229, 0xA1E4, 0x222A, 0xA1E5, + 0x222B, 0xA1EC, 0x222E, 0xA1ED, 0x2234, 0xA1EF, 0x2235, 0xA1EE, 0x2252, 0xA1DC, 0x2260, 0xA1DA, 0x2261, 0xA1DD, 0x2266, 0xA1D8, + 0x2267, 0xA1D9, 0x2295, 0xA1F2, 0x2299, 0xA1F3, 0x22A5, 0xA1E6, 0x22BF, 0xA1E9, 0x2500, 0xA277, 0x2502, 0xA278, 0x250C, 0xA27A, + 0x2510, 0xA27B, 0x2514, 0xA27C, 0x2518, 0xA27D, 0x251C, 0xA275, 0x2524, 0xA274, 0x252C, 0xA273, 0x2534, 0xA272, 0x253C, 0xA271, + 0x2550, 0xA2A4, 0x2550, 0xF9F9, 0x2551, 0xF9F8, 0x2552, 0xF9E6, 0x2553, 0xF9EF, 0x2554, 0xF9DD, 0x2555, 0xF9E8, 0x2556, 0xF9F1, + 0x2557, 0xF9DF, 0x2558, 0xF9EC, 0x2559, 0xF9F5, 0x255A, 0xF9E3, 0x255B, 0xF9EE, 0x255C, 0xF9F7, 0x255D, 0xF9E5, 0x255E, 0xA2A5, + 0x255E, 0xF9E9, 0x255F, 0xF9F2, 0x2560, 0xF9E0, 0x2561, 0xA2A7, 0x2561, 0xF9EB, 0x2562, 0xF9F4, 0x2563, 0xF9E2, 0x2564, 0xF9E7, + 0x2565, 0xF9F0, 0x2566, 0xF9DE, 0x2567, 0xF9ED, 0x2568, 0xF9F6, 0x2569, 0xF9E4, 0x256A, 0xA2A6, 0x256A, 0xF9EA, 0x256B, 0xF9F3, + 0x256C, 0xF9E1, 0x256D, 0xA27E, 0x256D, 0xF9FA, 0x256E, 0xA2A1, 0x256E, 0xF9FB, 0x256F, 0xA2A3, 0x256F, 0xF9FD, 0x2570, 0xA2A2, + 0x2570, 0xF9FC, 0x2571, 0xA2AC, 0x2572, 0xA2AD, 0x2573, 0xA2AE, 0x2574, 0xA15A, 0x2581, 0xA262, 0x2582, 0xA263, 0x2583, 0xA264, + 0x2584, 0xA265, 0x2585, 0xA266, 0x2586, 0xA267, 0x2587, 0xA268, 0x2588, 0xA269, 0x2589, 0xA270, 0x258A, 0xA26F, 0x258B, 0xA26E, + 0x258C, 0xA26D, 0x258D, 0xA26C, 0x258E, 0xA26B, 0x258F, 0xA26A, 0x2593, 0xF9FE, 0x2594, 0xA276, 0x2595, 0xA279, 0x25A0, 0xA1BD, + 0x25A1, 0xA1BC, 0x25B2, 0xA1B6, 0x25B3, 0xA1B5, 0x25BC, 0xA1BF, 0x25BD, 0xA1BE, 0x25C6, 0xA1BB, 0x25C7, 0xA1BA, 0x25CB, 0xA1B3, + 0x25CE, 0xA1B7, 0x25CF, 0xA1B4, 0x25E2, 0xA2A8, 0x25E3, 0xA2A9, 0x25E4, 0xA2AB, 0x25E5, 0xA2AA, 0x2605, 0xA1B9, 0x2606, 0xA1B8, + 0x2640, 0xA1F0, 0x2642, 0xA1F1, 0x3000, 0xA140, 0x3001, 0xA142, 0x3002, 0xA143, 0x3003, 0xA1B2, 0x3008, 0xA171, 0x3009, 0xA172, + 0x300A, 0xA16D, 0x300B, 0xA16E, 0x300C, 0xA175, 0x300D, 0xA176, 0x300E, 0xA179, 0x300F, 0xA17A, 0x3010, 0xA169, 0x3011, 0xA16A, + 0x3012, 0xA245, 0x3014, 0xA165, 0x3015, 0xA166, 0x301D, 0xA1A9, 0x301E, 0xA1AA, 0x3021, 0xA2C3, 0x3022, 0xA2C4, 0x3023, 0xA2C5, + 0x3024, 0xA2C6, 0x3025, 0xA2C7, 0x3026, 0xA2C8, 0x3027, 0xA2C9, 0x3028, 0xA2CA, 0x3029, 0xA2CB, 0x3105, 0xA374, 0x3106, 0xA375, + 0x3107, 0xA376, 0x3108, 0xA377, 0x3109, 0xA378, 0x310A, 0xA379, 0x310B, 0xA37A, 0x310C, 0xA37B, 0x310D, 0xA37C, 0x310E, 0xA37D, + 0x310F, 0xA37E, 0x3110, 0xA3A1, 0x3111, 0xA3A2, 0x3112, 0xA3A3, 0x3113, 0xA3A4, 0x3114, 0xA3A5, 0x3115, 0xA3A6, 0x3116, 0xA3A7, + 0x3117, 0xA3A8, 0x3118, 0xA3A9, 0x3119, 0xA3AA, 0x311A, 0xA3AB, 0x311B, 0xA3AC, 0x311C, 0xA3AD, 0x311D, 0xA3AE, 0x311E, 0xA3AF, + 0x311F, 0xA3B0, 0x3120, 0xA3B1, 0x3121, 0xA3B2, 0x3122, 0xA3B3, 0x3123, 0xA3B4, 0x3124, 0xA3B5, 0x3125, 0xA3B6, 0x3126, 0xA3B7, + 0x3127, 0xA3B8, 0x3128, 0xA3B9, 0x3129, 0xA3BA, 0x32A3, 0xA1C0, 0x338E, 0xA255, 0x338F, 0xA256, 0x339C, 0xA250, 0x339D, 0xA251, + 0x339E, 0xA252, 0x33A1, 0xA254, 0x33C4, 0xA257, 0x33CE, 0xA253, 0x33D1, 0xA1EB, 0x33D2, 0xA1EA, 0x33D5, 0xA24F, 0x4E00, 0xA440, + 0x4E01, 0xA442, 0x4E03, 0xA443, 0x4E07, 0xC945, 0x4E08, 0xA456, 0x4E09, 0xA454, 0x4E0A, 0xA457, 0x4E0B, 0xA455, 0x4E0C, 0xC946, + 0x4E0D, 0xA4A3, 0x4E0E, 0xC94F, 0x4E0F, 0xC94D, 0x4E10, 0xA4A2, 0x4E11, 0xA4A1, 0x4E14, 0xA542, 0x4E15, 0xA541, 0x4E16, 0xA540, + 0x4E18, 0xA543, 0x4E19, 0xA4FE, 0x4E1E, 0xA5E0, 0x4E1F, 0xA5E1, 0x4E26, 0xA8C3, 0x4E2B, 0xA458, 0x4E2D, 0xA4A4, 0x4E2E, 0xC950, + 0x4E30, 0xA4A5, 0x4E31, 0xC963, 0x4E32, 0xA6EA, 0x4E33, 0xCBB1, 0x4E38, 0xA459, 0x4E39, 0xA4A6, 0x4E3B, 0xA544, 0x4E3C, 0xC964, + 0x4E42, 0xC940, 0x4E43, 0xA444, 0x4E45, 0xA45B, 0x4E47, 0xC947, 0x4E48, 0xA45C, 0x4E4B, 0xA4A7, 0x4E4D, 0xA545, 0x4E4E, 0xA547, + 0x4E4F, 0xA546, 0x4E52, 0xA5E2, 0x4E53, 0xA5E3, 0x4E56, 0xA8C4, 0x4E58, 0xADBC, 0x4E59, 0xA441, 0x4E5C, 0xC941, 0x4E5D, 0xA445, + 0x4E5E, 0xA45E, 0x4E5F, 0xA45D, 0x4E69, 0xA5E4, 0x4E73, 0xA8C5, 0x4E7E, 0xB0AE, 0x4E7F, 0xD44B, 0x4E82, 0xB6C3, 0x4E83, 0xDCB1, + 0x4E84, 0xDCB2, 0x4E86, 0xA446, 0x4E88, 0xA4A9, 0x4E8B, 0xA8C6, 0x4E8C, 0xA447, 0x4E8D, 0xC948, 0x4E8E, 0xA45F, 0x4E91, 0xA4AA, + 0x4E92, 0xA4AC, 0x4E93, 0xC951, 0x4E94, 0xA4AD, 0x4E95, 0xA4AB, 0x4E99, 0xA5E5, 0x4E9B, 0xA8C7, 0x4E9E, 0xA8C8, 0x4E9F, 0xAB45, + 0x4EA1, 0xA460, 0x4EA2, 0xA4AE, 0x4EA4, 0xA5E6, 0x4EA5, 0xA5E8, 0x4EA6, 0xA5E7, 0x4EA8, 0xA6EB, 0x4EAB, 0xA8C9, 0x4EAC, 0xA8CA, + 0x4EAD, 0xAB46, 0x4EAE, 0xAB47, 0x4EB3, 0xADBD, 0x4EB6, 0xDCB3, 0x4EB9, 0xF6D6, 0x4EBA, 0xA448, 0x4EC0, 0xA4B0, 0x4EC1, 0xA4AF, + 0x4EC2, 0xC952, 0x4EC3, 0xA4B1, 0x4EC4, 0xA4B7, 0x4EC6, 0xA4B2, 0x4EC7, 0xA4B3, 0x4EC8, 0xC954, 0x4EC9, 0xC953, 0x4ECA, 0xA4B5, + 0x4ECB, 0xA4B6, 0x4ECD, 0xA4B4, 0x4ED4, 0xA54A, 0x4ED5, 0xA54B, 0x4ED6, 0xA54C, 0x4ED7, 0xA54D, 0x4ED8, 0xA549, 0x4ED9, 0xA550, + 0x4EDA, 0xC96A, 0x4EDC, 0xC966, 0x4EDD, 0xC969, 0x4EDE, 0xA551, 0x4EDF, 0xA561, 0x4EE1, 0xC968, 0x4EE3, 0xA54E, 0x4EE4, 0xA54F, + 0x4EE5, 0xA548, 0x4EE8, 0xC965, 0x4EE9, 0xC967, 0x4EF0, 0xA5F5, 0x4EF1, 0xC9B0, 0x4EF2, 0xA5F2, 0x4EF3, 0xA5F6, 0x4EF4, 0xC9BA, + 0x4EF5, 0xC9AE, 0x4EF6, 0xA5F3, 0x4EF7, 0xC9B2, 0x4EFB, 0xA5F4, 0x4EFD, 0xA5F7, 0x4EFF, 0xA5E9, 0x4F00, 0xC9B1, 0x4F01, 0xA5F8, + 0x4F02, 0xC9B5, 0x4F04, 0xC9B9, 0x4F05, 0xC9B6, 0x4F08, 0xC9B3, 0x4F09, 0xA5EA, 0x4F0A, 0xA5EC, 0x4F0B, 0xA5F9, 0x4F0D, 0xA5EE, + 0x4F0E, 0xC9AB, 0x4F0F, 0xA5F1, 0x4F10, 0xA5EF, 0x4F11, 0xA5F0, 0x4F12, 0xC9BB, 0x4F13, 0xC9B8, 0x4F14, 0xC9AF, 0x4F15, 0xA5ED, + 0x4F18, 0xC9AC, 0x4F19, 0xA5EB, 0x4F1D, 0xC9B4, 0x4F22, 0xC9B7, 0x4F2C, 0xC9AD, 0x4F2D, 0xCA66, 0x4F2F, 0xA742, 0x4F30, 0xA6F4, + 0x4F33, 0xCA67, 0x4F34, 0xA6F1, 0x4F36, 0xA744, 0x4F38, 0xA6F9, 0x4F3A, 0xA6F8, 0x4F3B, 0xCA5B, 0x4F3C, 0xA6FC, 0x4F3D, 0xA6F7, + 0x4F3E, 0xCA60, 0x4F3F, 0xCA68, 0x4F41, 0xCA64, 0x4F43, 0xA6FA, 0x4F46, 0xA6FD, 0x4F47, 0xA6EE, 0x4F48, 0xA747, 0x4F49, 0xCA5D, + 0x4F4C, 0xCBBD, 0x4F4D, 0xA6EC, 0x4F4E, 0xA743, 0x4F4F, 0xA6ED, 0x4F50, 0xA6F5, 0x4F51, 0xA6F6, 0x4F52, 0xCA62, 0x4F53, 0xCA5E, + 0x4F54, 0xA6FB, 0x4F55, 0xA6F3, 0x4F56, 0xCA5A, 0x4F57, 0xA6EF, 0x4F58, 0xCA65, 0x4F59, 0xA745, 0x4F5A, 0xA748, 0x4F5B, 0xA6F2, + 0x4F5C, 0xA740, 0x4F5D, 0xA746, 0x4F5E, 0xA6F0, 0x4F5F, 0xCA63, 0x4F60, 0xA741, 0x4F61, 0xCA69, 0x4F62, 0xCA5C, 0x4F63, 0xA6FE, + 0x4F64, 0xCA5F, 0x4F67, 0xCA61, 0x4F69, 0xA8D8, 0x4F6A, 0xCBBF, 0x4F6B, 0xCBCB, 0x4F6C, 0xA8D0, 0x4F6E, 0xCBCC, 0x4F6F, 0xA8CB, + 0x4F70, 0xA8D5, 0x4F73, 0xA8CE, 0x4F74, 0xCBB9, 0x4F75, 0xA8D6, 0x4F76, 0xCBB8, 0x4F77, 0xCBBC, 0x4F78, 0xCBC3, 0x4F79, 0xCBC1, + 0x4F7A, 0xA8DE, 0x4F7B, 0xA8D9, 0x4F7C, 0xCBB3, 0x4F7D, 0xCBB5, 0x4F7E, 0xA8DB, 0x4F7F, 0xA8CF, 0x4F80, 0xCBB6, 0x4F81, 0xCBC2, + 0x4F82, 0xCBC9, 0x4F83, 0xA8D4, 0x4F84, 0xCBBB, 0x4F85, 0xCBB4, 0x4F86, 0xA8D3, 0x4F87, 0xCBB7, 0x4F88, 0xA8D7, 0x4F89, 0xCBBA, + 0x4F8B, 0xA8D2, 0x4F8D, 0xA8CD, 0x4F8F, 0xA8DC, 0x4F90, 0xCBC4, 0x4F91, 0xA8DD, 0x4F92, 0xCBC8, 0x4F94, 0xCBC6, 0x4F95, 0xCBCA, + 0x4F96, 0xA8DA, 0x4F97, 0xCBBE, 0x4F98, 0xCBB2, 0x4F9A, 0xCBC0, 0x4F9B, 0xA8D1, 0x4F9C, 0xCBC5, 0x4F9D, 0xA8CC, 0x4F9E, 0xCBC7, + 0x4FAE, 0xAB56, 0x4FAF, 0xAB4A, 0x4FB2, 0xCDE0, 0x4FB3, 0xCDE8, 0x4FB5, 0xAB49, 0x4FB6, 0xAB51, 0x4FB7, 0xAB5D, 0x4FB9, 0xCDEE, + 0x4FBA, 0xCDEC, 0x4FBB, 0xCDE7, 0x4FBF, 0xAB4B, 0x4FC0, 0xCDED, 0x4FC1, 0xCDE3, 0x4FC2, 0xAB59, 0x4FC3, 0xAB50, 0x4FC4, 0xAB58, + 0x4FC5, 0xCDDE, 0x4FC7, 0xCDEA, 0x4FC9, 0xCDE1, 0x4FCA, 0xAB54, 0x4FCB, 0xCDE2, 0x4FCD, 0xCDDD, 0x4FCE, 0xAB5B, 0x4FCF, 0xAB4E, + 0x4FD0, 0xAB57, 0x4FD1, 0xAB4D, 0x4FD3, 0xCDDF, 0x4FD4, 0xCDE4, 0x4FD6, 0xCDEB, 0x4FD7, 0xAB55, 0x4FD8, 0xAB52, 0x4FD9, 0xCDE6, + 0x4FDA, 0xAB5A, 0x4FDB, 0xCDE9, 0x4FDC, 0xCDE5, 0x4FDD, 0xAB4F, 0x4FDE, 0xAB5C, 0x4FDF, 0xAB53, 0x4FE0, 0xAB4C, 0x4FE1, 0xAB48, + 0x4FEC, 0xCDEF, 0x4FEE, 0xADD7, 0x4FEF, 0xADC1, 0x4FF1, 0xADD1, 0x4FF3, 0xADD6, 0x4FF4, 0xD0D0, 0x4FF5, 0xD0CF, 0x4FF6, 0xD0D4, + 0x4FF7, 0xD0D5, 0x4FF8, 0xADC4, 0x4FFA, 0xADCD, 0x4FFE, 0xADDA, 0x5000, 0xADCE, 0x5005, 0xD0C9, 0x5006, 0xADC7, 0x5007, 0xD0CA, + 0x5009, 0xADDC, 0x500B, 0xADD3, 0x500C, 0xADBE, 0x500D, 0xADBF, 0x500E, 0xD0DD, 0x500F, 0xB0BF, 0x5011, 0xADCC, 0x5012, 0xADCB, + 0x5013, 0xD0CB, 0x5014, 0xADCF, 0x5015, 0xD45B, 0x5016, 0xADC6, 0x5017, 0xD0D6, 0x5018, 0xADD5, 0x5019, 0xADD4, 0x501A, 0xADCA, + 0x501B, 0xD0CE, 0x501C, 0xD0D7, 0x501E, 0xD0C8, 0x501F, 0xADC9, 0x5020, 0xD0D8, 0x5021, 0xADD2, 0x5022, 0xD0CC, 0x5023, 0xADC0, + 0x5025, 0xADC3, 0x5026, 0xADC2, 0x5027, 0xD0D9, 0x5028, 0xADD0, 0x5029, 0xADC5, 0x502A, 0xADD9, 0x502B, 0xADDB, 0x502C, 0xD0D3, + 0x502D, 0xADD8, 0x502F, 0xD0DB, 0x5030, 0xD0CD, 0x5031, 0xD0DC, 0x5033, 0xD0D1, 0x5035, 0xD0DA, 0x5037, 0xD0D2, 0x503C, 0xADC8, + 0x5040, 0xD463, 0x5041, 0xD457, 0x5043, 0xB0B3, 0x5045, 0xD45C, 0x5046, 0xD462, 0x5047, 0xB0B2, 0x5048, 0xD455, 0x5049, 0xB0B6, + 0x504A, 0xD459, 0x504B, 0xD452, 0x504C, 0xB0B4, 0x504D, 0xD456, 0x504E, 0xB0B9, 0x504F, 0xB0BE, 0x5051, 0xD467, 0x5053, 0xD451, + 0x5055, 0xB0BA, 0x5057, 0xD466, 0x505A, 0xB0B5, 0x505B, 0xD458, 0x505C, 0xB0B1, 0x505D, 0xD453, 0x505E, 0xD44F, 0x505F, 0xD45D, + 0x5060, 0xD450, 0x5061, 0xD44E, 0x5062, 0xD45A, 0x5063, 0xD460, 0x5064, 0xD461, 0x5065, 0xB0B7, 0x5068, 0xD85B, 0x5069, 0xD45E, + 0x506A, 0xD44D, 0x506B, 0xD45F, 0x506D, 0xB0C1, 0x506E, 0xD464, 0x506F, 0xB0C0, 0x5070, 0xD44C, 0x5072, 0xD454, 0x5073, 0xD465, + 0x5074, 0xB0BC, 0x5075, 0xB0BB, 0x5076, 0xB0B8, 0x5077, 0xB0BD, 0x507A, 0xB0AF, 0x507D, 0xB0B0, 0x5080, 0xB3C8, 0x5082, 0xD85E, + 0x5083, 0xD857, 0x5085, 0xB3C5, 0x5087, 0xD85F, 0x508B, 0xD855, 0x508C, 0xD858, 0x508D, 0xB3C4, 0x508E, 0xD859, 0x5091, 0xB3C7, + 0x5092, 0xD85D, 0x5094, 0xD853, 0x5095, 0xD852, 0x5096, 0xB3C9, 0x5098, 0xB3CA, 0x5099, 0xB3C6, 0x509A, 0xB3CB, 0x509B, 0xD851, + 0x509C, 0xD85C, 0x509D, 0xD85A, 0x509E, 0xD854, 0x50A2, 0xB3C3, 0x50A3, 0xD856, 0x50AC, 0xB6CA, 0x50AD, 0xB6C4, 0x50AE, 0xDCB7, + 0x50AF, 0xB6CD, 0x50B0, 0xDCBD, 0x50B1, 0xDCC0, 0x50B2, 0xB6C6, 0x50B3, 0xB6C7, 0x50B4, 0xDCBA, 0x50B5, 0xB6C5, 0x50B6, 0xDCC3, + 0x50B7, 0xB6CB, 0x50B8, 0xDCC4, 0x50BA, 0xDCBF, 0x50BB, 0xB6CC, 0x50BD, 0xDCB4, 0x50BE, 0xB6C9, 0x50BF, 0xDCB5, 0x50C1, 0xDCBE, + 0x50C2, 0xDCBC, 0x50C4, 0xDCB8, 0x50C5, 0xB6C8, 0x50C6, 0xDCB6, 0x50C7, 0xB6CE, 0x50C8, 0xDCBB, 0x50C9, 0xDCC2, 0x50CA, 0xDCB9, + 0x50CB, 0xDCC1, 0x50CE, 0xB9B6, 0x50CF, 0xB9B3, 0x50D1, 0xB9B4, 0x50D3, 0xE0F9, 0x50D4, 0xE0F1, 0x50D5, 0xB9B2, 0x50D6, 0xB9AF, + 0x50D7, 0xE0F2, 0x50DA, 0xB9B1, 0x50DB, 0xE0F5, 0x50DD, 0xE0F7, 0x50E0, 0xE0FE, 0x50E3, 0xE0FD, 0x50E4, 0xE0F8, 0x50E5, 0xB9AE, + 0x50E6, 0xE0F0, 0x50E7, 0xB9AC, 0x50E8, 0xE0F3, 0x50E9, 0xB9B7, 0x50EA, 0xE0F6, 0x50EC, 0xE0FA, 0x50ED, 0xB9B0, 0x50EE, 0xB9AD, + 0x50EF, 0xE0FC, 0x50F0, 0xE0FB, 0x50F1, 0xB9B5, 0x50F3, 0xE0F4, 0x50F5, 0xBBF8, 0x50F6, 0xE4EC, 0x50F8, 0xE4E9, 0x50F9, 0xBBF9, + 0x50FB, 0xBBF7, 0x50FD, 0xE4F0, 0x50FE, 0xE4ED, 0x50FF, 0xE4E6, 0x5100, 0xBBF6, 0x5102, 0xBBFA, 0x5103, 0xE4E7, 0x5104, 0xBBF5, + 0x5105, 0xBBFD, 0x5106, 0xE4EA, 0x5107, 0xE4EB, 0x5108, 0xBBFB, 0x5109, 0xBBFC, 0x510A, 0xE4F1, 0x510B, 0xE4EE, 0x510C, 0xE4EF, + 0x5110, 0xBEAA, 0x5111, 0xE8F8, 0x5112, 0xBEA7, 0x5113, 0xE8F5, 0x5114, 0xBEA9, 0x5115, 0xBEAB, 0x5117, 0xE8F6, 0x5118, 0xBEA8, + 0x511A, 0xE8F7, 0x511C, 0xE8F4, 0x511F, 0xC076, 0x5120, 0xECBD, 0x5121, 0xC077, 0x5122, 0xECBB, 0x5124, 0xECBC, 0x5125, 0xECBA, + 0x5126, 0xECB9, 0x5129, 0xECBE, 0x512A, 0xC075, 0x512D, 0xEFB8, 0x512E, 0xEFB9, 0x5130, 0xE4E8, 0x5131, 0xEFB7, 0x5132, 0xC078, + 0x5133, 0xC35F, 0x5134, 0xF1EB, 0x5135, 0xF1EC, 0x5137, 0xC4D7, 0x5138, 0xC4D8, 0x5139, 0xF5C1, 0x513A, 0xF5C0, 0x513B, 0xC56C, + 0x513C, 0xC56B, 0x513D, 0xF7D0, 0x513F, 0xA449, 0x5140, 0xA461, 0x5141, 0xA4B9, 0x5143, 0xA4B8, 0x5144, 0xA553, 0x5145, 0xA552, + 0x5146, 0xA5FC, 0x5147, 0xA5FB, 0x5148, 0xA5FD, 0x5149, 0xA5FA, 0x514B, 0xA74A, 0x514C, 0xA749, 0x514D, 0xA74B, 0x5152, 0xA8E0, + 0x5154, 0xA8DF, 0x5155, 0xA8E1, 0x5157, 0xAB5E, 0x5159, 0xA259, 0x515A, 0xD0DE, 0x515B, 0xA25A, 0x515C, 0xB0C2, 0x515D, 0xA25C, + 0x515E, 0xA25B, 0x515F, 0xD860, 0x5161, 0xA25D, 0x5162, 0xB9B8, 0x5163, 0xA25E, 0x5165, 0xA44A, 0x5167, 0xA4BA, 0x5168, 0xA5FE, + 0x5169, 0xA8E2, 0x516B, 0xA44B, 0x516C, 0xA4BD, 0x516D, 0xA4BB, 0x516E, 0xA4BC, 0x5171, 0xA640, 0x5175, 0xA74C, 0x5176, 0xA8E4, + 0x5177, 0xA8E3, 0x5178, 0xA8E5, 0x517C, 0xADDD, 0x5180, 0xBEAC, 0x5187, 0xC94E, 0x5189, 0xA554, 0x518A, 0xA555, 0x518D, 0xA641, + 0x518F, 0xCA6A, 0x5191, 0xAB60, 0x5192, 0xAB5F, 0x5193, 0xD0E0, 0x5194, 0xD0DF, 0x5195, 0xB0C3, 0x5197, 0xA4BE, 0x5198, 0xC955, + 0x519E, 0xCBCD, 0x51A0, 0xAB61, 0x51A2, 0xADE0, 0x51A4, 0xADDE, 0x51A5, 0xADDF, 0x51AA, 0xBEAD, 0x51AC, 0xA556, 0x51B0, 0xA642, + 0x51B1, 0xC9BC, 0x51B6, 0xA74D, 0x51B7, 0xA74E, 0x51B9, 0xCA6B, 0x51BC, 0xCBCE, 0x51BD, 0xA8E6, 0x51BE, 0xCBCF, 0x51C4, 0xD0E2, + 0x51C5, 0xD0E3, 0x51C6, 0xADE3, 0x51C8, 0xD0E4, 0x51CA, 0xD0E1, 0x51CB, 0xADE4, 0x51CC, 0xADE2, 0x51CD, 0xADE1, 0x51CE, 0xD0E5, + 0x51D0, 0xD468, 0x51D4, 0xD861, 0x51D7, 0xDCC5, 0x51D8, 0xE140, 0x51DC, 0xBBFE, 0x51DD, 0xBEAE, 0x51DE, 0xE8F9, 0x51E0, 0xA44C, + 0x51E1, 0xA45A, 0x51F0, 0xB0C4, 0x51F1, 0xB3CD, 0x51F3, 0xB9B9, 0x51F5, 0xC942, 0x51F6, 0xA4BF, 0x51F8, 0xA559, 0x51F9, 0xA557, + 0x51FA, 0xA558, 0x51FD, 0xA8E7, 0x5200, 0xA44D, 0x5201, 0xA44E, 0x5203, 0xA462, 0x5206, 0xA4C0, 0x5207, 0xA4C1, 0x5208, 0xA4C2, + 0x5209, 0xC9BE, 0x520A, 0xA55A, 0x520C, 0xC96B, 0x520E, 0xA646, 0x5210, 0xC9BF, 0x5211, 0xA644, 0x5212, 0xA645, 0x5213, 0xC9BD, + 0x5216, 0xA647, 0x5217, 0xA643, 0x521C, 0xCA6C, 0x521D, 0xAAEC, 0x521E, 0xCA6D, 0x5221, 0xCA6E, 0x5224, 0xA750, 0x5225, 0xA74F, + 0x5228, 0xA753, 0x5229, 0xA751, 0x522A, 0xA752, 0x522E, 0xA8ED, 0x5230, 0xA8EC, 0x5231, 0xCBD4, 0x5232, 0xCBD1, 0x5233, 0xCBD2, + 0x5235, 0xCBD0, 0x5236, 0xA8EE, 0x5237, 0xA8EA, 0x5238, 0xA8E9, 0x523A, 0xA8EB, 0x523B, 0xA8E8, 0x5241, 0xA8EF, 0x5243, 0xAB63, + 0x5244, 0xCDF0, 0x5246, 0xCBD3, 0x5247, 0xAB68, 0x5249, 0xCDF1, 0x524A, 0xAB64, 0x524B, 0xAB67, 0x524C, 0xAB66, 0x524D, 0xAB65, + 0x524E, 0xAB62, 0x5252, 0xD0E8, 0x5254, 0xADE7, 0x5255, 0xD0EB, 0x5256, 0xADE5, 0x525A, 0xD0E7, 0x525B, 0xADE8, 0x525C, 0xADE6, + 0x525D, 0xADE9, 0x525E, 0xD0E9, 0x525F, 0xD0EA, 0x5261, 0xD0E6, 0x5262, 0xD0EC, 0x5269, 0xB3D1, 0x526A, 0xB0C5, 0x526B, 0xD469, + 0x526C, 0xD46B, 0x526D, 0xD46A, 0x526E, 0xD46C, 0x526F, 0xB0C6, 0x5272, 0xB3CE, 0x5274, 0xB3CF, 0x5275, 0xB3D0, 0x5277, 0xB6D0, + 0x5278, 0xDCC7, 0x527A, 0xDCC6, 0x527B, 0xDCC8, 0x527C, 0xDCC9, 0x527D, 0xB6D1, 0x527F, 0xB6CF, 0x5280, 0xE141, 0x5281, 0xE142, + 0x5282, 0xB9BB, 0x5283, 0xB9BA, 0x5284, 0xE35A, 0x5287, 0xBC40, 0x5288, 0xBC41, 0x5289, 0xBC42, 0x528A, 0xBC44, 0x528B, 0xE4F2, + 0x528C, 0xE4F3, 0x528D, 0xBC43, 0x5291, 0xBEAF, 0x5293, 0xBEB0, 0x5296, 0xF1ED, 0x5297, 0xF5C3, 0x5298, 0xF5C2, 0x5299, 0xF7D1, + 0x529B, 0xA44F, 0x529F, 0xA55C, 0x52A0, 0xA55B, 0x52A3, 0xA648, 0x52A6, 0xC9C0, 0x52A9, 0xA755, 0x52AA, 0xA756, 0x52AB, 0xA754, + 0x52AC, 0xA757, 0x52AD, 0xCA6F, 0x52AE, 0xCA70, 0x52BB, 0xA8F1, 0x52BC, 0xCBD5, 0x52BE, 0xA8F0, 0x52C0, 0xCDF2, 0x52C1, 0xAB6C, + 0x52C2, 0xCDF3, 0x52C3, 0xAB6B, 0x52C7, 0xAB69, 0x52C9, 0xAB6A, 0x52CD, 0xD0ED, 0x52D2, 0xB0C7, 0x52D3, 0xD46E, 0x52D5, 0xB0CA, + 0x52D6, 0xD46D, 0x52D7, 0xB1E5, 0x52D8, 0xB0C9, 0x52D9, 0xB0C8, 0x52DB, 0xB3D4, 0x52DD, 0xB3D3, 0x52DE, 0xB3D2, 0x52DF, 0xB6D2, + 0x52E2, 0xB6D5, 0x52E3, 0xB6D6, 0x52E4, 0xB6D4, 0x52E6, 0xB6D3, 0x52E9, 0xE143, 0x52EB, 0xE144, 0x52EF, 0xE4F5, 0x52F0, 0xBC45, + 0x52F1, 0xE4F4, 0x52F3, 0xBEB1, 0x52F4, 0xECBF, 0x52F5, 0xC079, 0x52F7, 0xF1EE, 0x52F8, 0xC455, 0x52FA, 0xA463, 0x52FB, 0xA4C3, + 0x52FC, 0xC956, 0x52FE, 0xA4C4, 0x52FF, 0xA4C5, 0x5305, 0xA55D, 0x5306, 0xA55E, 0x5308, 0xA649, 0x5309, 0xCA71, 0x530A, 0xCBD6, + 0x530B, 0xCBD7, 0x530D, 0xAB6D, 0x530E, 0xD0EE, 0x530F, 0xB0CC, 0x5310, 0xB0CB, 0x5311, 0xD863, 0x5312, 0xD862, 0x5315, 0xA450, + 0x5316, 0xA4C6, 0x5317, 0xA55F, 0x5319, 0xB0CD, 0x531A, 0xC943, 0x531C, 0xC96C, 0x531D, 0xA560, 0x531F, 0xC9C2, 0x5320, 0xA64B, + 0x5321, 0xA64A, 0x5322, 0xC9C1, 0x5323, 0xA758, 0x532A, 0xADEA, 0x532D, 0xD46F, 0x532F, 0xB6D7, 0x5330, 0xE145, 0x5331, 0xB9BC, + 0x5334, 0xE8FA, 0x5337, 0xF3FD, 0x5339, 0xA4C7, 0x533C, 0xCBD8, 0x533D, 0xCDF4, 0x533E, 0xB0D0, 0x533F, 0xB0CE, 0x5340, 0xB0CF, + 0x5341, 0xA2CC, 0x5341, 0xA451, 0x5343, 0xA464, 0x5344, 0xA2CD, 0x5345, 0xA2CE, 0x5345, 0xA4CA, 0x5347, 0xA4C9, 0x5348, 0xA4C8, + 0x5349, 0xA563, 0x534A, 0xA562, 0x534C, 0xC96D, 0x534D, 0xC9C3, 0x5351, 0xA8F5, 0x5352, 0xA8F2, 0x5353, 0xA8F4, 0x5354, 0xA8F3, + 0x5357, 0xAB6E, 0x535A, 0xB3D5, 0x535C, 0xA452, 0x535E, 0xA4CB, 0x5360, 0xA565, 0x5361, 0xA564, 0x5363, 0xCA72, 0x5366, 0xA8F6, + 0x536C, 0xC957, 0x536E, 0xA567, 0x536F, 0xA566, 0x5370, 0xA64C, 0x5371, 0xA64D, 0x5372, 0xCA73, 0x5373, 0xA759, 0x5375, 0xA75A, + 0x5377, 0xA8F7, 0x5378, 0xA8F8, 0x5379, 0xA8F9, 0x537B, 0xAB6F, 0x537C, 0xCDF5, 0x537F, 0xADEB, 0x5382, 0xC944, 0x5384, 0xA4CC, + 0x538A, 0xC9C4, 0x538E, 0xCA74, 0x538F, 0xCA75, 0x5392, 0xCBD9, 0x5394, 0xCBDA, 0x5396, 0xCDF7, 0x5397, 0xCDF6, 0x5398, 0xCDF9, + 0x5399, 0xCDF8, 0x539A, 0xAB70, 0x539C, 0xD470, 0x539D, 0xADED, 0x539E, 0xD0EF, 0x539F, 0xADEC, 0x53A4, 0xD864, 0x53A5, 0xB3D6, + 0x53A7, 0xD865, 0x53AC, 0xE146, 0x53AD, 0xB9BD, 0x53B2, 0xBC46, 0x53B4, 0xF1EF, 0x53B9, 0xC958, 0x53BB, 0xA568, 0x53C3, 0xB0D1, + 0x53C8, 0xA453, 0x53C9, 0xA465, 0x53CA, 0xA4CE, 0x53CB, 0xA4CD, 0x53CD, 0xA4CF, 0x53D4, 0xA8FB, 0x53D6, 0xA8FA, 0x53D7, 0xA8FC, + 0x53DB, 0xAB71, 0x53DF, 0xADEE, 0x53E1, 0xE8FB, 0x53E2, 0xC24F, 0x53E3, 0xA466, 0x53E4, 0xA56A, 0x53E5, 0xA579, 0x53E6, 0xA574, + 0x53E8, 0xA56F, 0x53E9, 0xA56E, 0x53EA, 0xA575, 0x53EB, 0xA573, 0x53EC, 0xA56C, 0x53ED, 0xA57A, 0x53EE, 0xA56D, 0x53EF, 0xA569, + 0x53F0, 0xA578, 0x53F1, 0xA577, 0x53F2, 0xA576, 0x53F3, 0xA56B, 0x53F5, 0xA572, 0x53F8, 0xA571, 0x53FB, 0xA57B, 0x53FC, 0xA570, + 0x5401, 0xA653, 0x5403, 0xA659, 0x5404, 0xA655, 0x5406, 0xA65B, 0x5407, 0xC9C5, 0x5408, 0xA658, 0x5409, 0xA64E, 0x540A, 0xA651, + 0x540B, 0xA654, 0x540C, 0xA650, 0x540D, 0xA657, 0x540E, 0xA65A, 0x540F, 0xA64F, 0x5410, 0xA652, 0x5411, 0xA656, 0x5412, 0xA65C, + 0x5418, 0xCA7E, 0x5419, 0xCA7B, 0x541B, 0xA767, 0x541C, 0xCA7C, 0x541D, 0xA75B, 0x541E, 0xA75D, 0x541F, 0xA775, 0x5420, 0xA770, + 0x5424, 0xCAA5, 0x5425, 0xCA7D, 0x5426, 0xA75F, 0x5427, 0xA761, 0x5428, 0xCAA4, 0x5429, 0xA768, 0x542A, 0xCA78, 0x542B, 0xA774, + 0x542C, 0xA776, 0x542D, 0xA75C, 0x542E, 0xA76D, 0x5430, 0xCA76, 0x5431, 0xA773, 0x5433, 0xA764, 0x5435, 0xA76E, 0x5436, 0xA76F, + 0x5437, 0xCA77, 0x5438, 0xA76C, 0x5439, 0xA76A, 0x543B, 0xA76B, 0x543C, 0xA771, 0x543D, 0xCAA1, 0x543E, 0xA75E, 0x5440, 0xA772, + 0x5441, 0xCAA3, 0x5442, 0xA766, 0x5443, 0xA763, 0x5445, 0xCA7A, 0x5446, 0xA762, 0x5447, 0xCAA6, 0x5448, 0xA765, 0x544A, 0xA769, + 0x544E, 0xA760, 0x544F, 0xCAA2, 0x5454, 0xCA79, 0x5460, 0xCBEB, 0x5461, 0xCBEA, 0x5462, 0xA94F, 0x5463, 0xCBED, 0x5464, 0xCBEF, + 0x5465, 0xCBE4, 0x5466, 0xCBE7, 0x5467, 0xCBEE, 0x5468, 0xA950, 0x546B, 0xCBE1, 0x546C, 0xCBE5, 0x546F, 0xCBE9, 0x5470, 0xCE49, + 0x5471, 0xA94B, 0x5472, 0xCE4D, 0x5473, 0xA8FD, 0x5474, 0xCBE6, 0x5475, 0xA8FE, 0x5476, 0xA94C, 0x5477, 0xA945, 0x5478, 0xA941, + 0x547A, 0xCBE2, 0x547B, 0xA944, 0x547C, 0xA949, 0x547D, 0xA952, 0x547E, 0xCBE3, 0x547F, 0xCBDC, 0x5480, 0xA943, 0x5481, 0xCBDD, + 0x5482, 0xCBDF, 0x5484, 0xA946, 0x5486, 0xA948, 0x5487, 0xCBDB, 0x5488, 0xCBE0, 0x548B, 0xA951, 0x548C, 0xA94D, 0x548D, 0xCBE8, + 0x548E, 0xA953, 0x5490, 0xA94A, 0x5491, 0xCBDE, 0x5492, 0xA947, 0x5495, 0xA942, 0x5496, 0xA940, 0x5498, 0xCBEC, 0x549A, 0xA94E, + 0x54A0, 0xCE48, 0x54A1, 0xCDFB, 0x54A2, 0xCE4B, 0x54A5, 0xCDFD, 0x54A6, 0xAB78, 0x54A7, 0xABA8, 0x54A8, 0xAB74, 0x54A9, 0xABA7, + 0x54AA, 0xAB7D, 0x54AB, 0xABA4, 0x54AC, 0xAB72, 0x54AD, 0xCDFC, 0x54AE, 0xCE43, 0x54AF, 0xABA3, 0x54B0, 0xCE4F, 0x54B1, 0xABA5, + 0x54B3, 0xAB79, 0x54B6, 0xCE45, 0x54B7, 0xCE42, 0x54B8, 0xAB77, 0x54BA, 0xCDFA, 0x54BB, 0xABA6, 0x54BC, 0xCE4A, 0x54BD, 0xAB7C, + 0x54BE, 0xCE4C, 0x54BF, 0xABA9, 0x54C0, 0xAB73, 0x54C1, 0xAB7E, 0x54C2, 0xAB7B, 0x54C3, 0xCE40, 0x54C4, 0xABA1, 0x54C5, 0xCE46, + 0x54C6, 0xCE47, 0x54C7, 0xAB7A, 0x54C8, 0xABA2, 0x54C9, 0xAB76, 0x54CE, 0xAB75, 0x54CF, 0xCDFE, 0x54D6, 0xCE44, 0x54DE, 0xCE4E, + 0x54E0, 0xD144, 0x54E1, 0xADFB, 0x54E2, 0xD0F1, 0x54E4, 0xD0F6, 0x54E5, 0xADF4, 0x54E6, 0xAE40, 0x54E7, 0xD0F4, 0x54E8, 0xADEF, + 0x54E9, 0xADF9, 0x54EA, 0xADFE, 0x54EB, 0xD0FB, 0x54ED, 0xADFA, 0x54EE, 0xADFD, 0x54F1, 0xD0FE, 0x54F2, 0xADF5, 0x54F3, 0xD0F5, + 0x54F7, 0xD142, 0x54F8, 0xD143, 0x54FA, 0xADF7, 0x54FB, 0xD141, 0x54FC, 0xADF3, 0x54FD, 0xAE43, 0x54FF, 0xD0F8, 0x5501, 0xADF1, + 0x5503, 0xD146, 0x5504, 0xD0F9, 0x5505, 0xD0FD, 0x5506, 0xADF6, 0x5507, 0xAE42, 0x5508, 0xD0FA, 0x5509, 0xADFC, 0x550A, 0xD140, + 0x550B, 0xD147, 0x550C, 0xD4A1, 0x550E, 0xD145, 0x550F, 0xAE44, 0x5510, 0xADF0, 0x5511, 0xD0FC, 0x5512, 0xD0F3, 0x5514, 0xADF8, + 0x5517, 0xD0F2, 0x551A, 0xD0F7, 0x5526, 0xD0F0, 0x5527, 0xAE41, 0x552A, 0xD477, 0x552C, 0xB0E4, 0x552D, 0xD4A7, 0x552E, 0xB0E2, + 0x552F, 0xB0DF, 0x5530, 0xD47C, 0x5531, 0xB0DB, 0x5532, 0xD4A2, 0x5533, 0xB0E6, 0x5534, 0xD476, 0x5535, 0xD47B, 0x5536, 0xD47A, + 0x5537, 0xADF2, 0x5538, 0xB0E1, 0x5539, 0xD4A5, 0x553B, 0xD4A8, 0x553C, 0xD473, 0x553E, 0xB3E8, 0x5540, 0xD4A9, 0x5541, 0xB0E7, + 0x5543, 0xB0D9, 0x5544, 0xB0D6, 0x5545, 0xD47E, 0x5546, 0xB0D3, 0x5548, 0xD4A6, 0x554A, 0xB0DA, 0x554B, 0xD4AA, 0x554D, 0xD474, + 0x554E, 0xD4A4, 0x554F, 0xB0DD, 0x5550, 0xD475, 0x5551, 0xD478, 0x5552, 0xD47D, 0x5555, 0xB0DE, 0x5556, 0xB0DC, 0x5557, 0xB0E8, + 0x555C, 0xB0E3, 0x555E, 0xB0D7, 0x555F, 0xB1D2, 0x5561, 0xB0D8, 0x5562, 0xD479, 0x5563, 0xB0E5, 0x5564, 0xB0E0, 0x5565, 0xD4A3, + 0x5566, 0xB0D5, 0x556A, 0xB0D4, 0x5575, 0xD471, 0x5576, 0xD472, 0x5577, 0xD86A, 0x557B, 0xB3D7, 0x557C, 0xB3DA, 0x557D, 0xD875, + 0x557E, 0xB3EE, 0x557F, 0xD878, 0x5580, 0xB3D8, 0x5581, 0xD871, 0x5582, 0xB3DE, 0x5583, 0xB3E4, 0x5584, 0xB5BD, 0x5587, 0xB3E2, + 0x5588, 0xD86E, 0x5589, 0xB3EF, 0x558A, 0xB3DB, 0x558B, 0xB3E3, 0x558C, 0xD876, 0x558D, 0xDCD7, 0x558E, 0xD87B, 0x558F, 0xD86F, + 0x5591, 0xD866, 0x5592, 0xD873, 0x5593, 0xD86D, 0x5594, 0xB3E1, 0x5595, 0xD879, 0x5598, 0xB3DD, 0x5599, 0xB3F1, 0x559A, 0xB3EA, + 0x559C, 0xB3DF, 0x559D, 0xB3DC, 0x559F, 0xB3E7, 0x55A1, 0xD87A, 0x55A2, 0xD86C, 0x55A3, 0xD872, 0x55A4, 0xD874, 0x55A5, 0xD868, + 0x55A6, 0xD877, 0x55A7, 0xB3D9, 0x55A8, 0xD867, 0x55AA, 0xB3E0, 0x55AB, 0xB3F0, 0x55AC, 0xB3EC, 0x55AD, 0xD869, 0x55AE, 0xB3E6, + 0x55B1, 0xB3ED, 0x55B2, 0xB3E9, 0x55B3, 0xB3E5, 0x55B5, 0xD870, 0x55BB, 0xB3EB, 0x55BF, 0xDCD5, 0x55C0, 0xDCD1, 0x55C2, 0xDCE0, + 0x55C3, 0xDCCA, 0x55C4, 0xDCD3, 0x55C5, 0xB6E5, 0x55C6, 0xB6E6, 0x55C7, 0xB6DE, 0x55C8, 0xDCDC, 0x55C9, 0xB6E8, 0x55CA, 0xDCCF, + 0x55CB, 0xDCCE, 0x55CC, 0xDCCC, 0x55CD, 0xDCDE, 0x55CE, 0xB6DC, 0x55CF, 0xDCD8, 0x55D0, 0xDCCD, 0x55D1, 0xB6DF, 0x55D2, 0xDCD6, + 0x55D3, 0xB6DA, 0x55D4, 0xDCD2, 0x55D5, 0xDCD9, 0x55D6, 0xDCDB, 0x55D9, 0xDCDF, 0x55DA, 0xB6E3, 0x55DB, 0xDCCB, 0x55DC, 0xB6DD, + 0x55DD, 0xDCD0, 0x55DF, 0xB6D8, 0x55E1, 0xB6E4, 0x55E2, 0xDCDA, 0x55E3, 0xB6E0, 0x55E4, 0xB6E1, 0x55E5, 0xB6E7, 0x55E6, 0xB6DB, + 0x55E7, 0xA25F, 0x55E8, 0xB6D9, 0x55E9, 0xDCD4, 0x55EF, 0xB6E2, 0x55F2, 0xDCDD, 0x55F6, 0xB9CD, 0x55F7, 0xB9C8, 0x55F9, 0xE155, + 0x55FA, 0xE151, 0x55FC, 0xE14B, 0x55FD, 0xB9C2, 0x55FE, 0xB9BE, 0x55FF, 0xE154, 0x5600, 0xB9BF, 0x5601, 0xE14E, 0x5602, 0xE150, + 0x5604, 0xE153, 0x5606, 0xB9C4, 0x5608, 0xB9CB, 0x5609, 0xB9C5, 0x560C, 0xE149, 0x560D, 0xB9C6, 0x560E, 0xB9C7, 0x560F, 0xE14C, + 0x5610, 0xB9CC, 0x5612, 0xE14A, 0x5613, 0xE14F, 0x5614, 0xB9C3, 0x5615, 0xE148, 0x5616, 0xB9C9, 0x5617, 0xB9C1, 0x561B, 0xB9C0, + 0x561C, 0xE14D, 0x561D, 0xE152, 0x561F, 0xB9CA, 0x5627, 0xE147, 0x5629, 0xBC4D, 0x562A, 0xE547, 0x562C, 0xE544, 0x562E, 0xBC47, + 0x562F, 0xBC53, 0x5630, 0xBC54, 0x5632, 0xBC4A, 0x5633, 0xE542, 0x5634, 0xBC4C, 0x5635, 0xE4F9, 0x5636, 0xBC52, 0x5638, 0xE546, + 0x5639, 0xBC49, 0x563A, 0xE548, 0x563B, 0xBC48, 0x563D, 0xE543, 0x563E, 0xE545, 0x563F, 0xBC4B, 0x5640, 0xE541, 0x5641, 0xE4FA, + 0x5642, 0xE4F7, 0x5645, 0xD86B, 0x5646, 0xE4FD, 0x5648, 0xE4F6, 0x5649, 0xE4FC, 0x564A, 0xE4FB, 0x564C, 0xE4F8, 0x564E, 0xBC4F, + 0x5653, 0xBC4E, 0x5657, 0xBC50, 0x5658, 0xE4FE, 0x5659, 0xBEB2, 0x565A, 0xE540, 0x565E, 0xE945, 0x5660, 0xE8FD, 0x5662, 0xBEBE, + 0x5663, 0xE942, 0x5664, 0xBEB6, 0x5665, 0xBEBA, 0x5666, 0xE941, 0x5668, 0xBEB9, 0x5669, 0xBEB5, 0x566A, 0xBEB8, 0x566B, 0xBEB3, + 0x566C, 0xBEBD, 0x566D, 0xE943, 0x566E, 0xE8FE, 0x566F, 0xBEBC, 0x5670, 0xE8FC, 0x5671, 0xBEBB, 0x5672, 0xE944, 0x5673, 0xE940, + 0x5674, 0xBC51, 0x5676, 0xBEBF, 0x5677, 0xE946, 0x5678, 0xBEB7, 0x5679, 0xBEB4, 0x567E, 0xECC6, 0x567F, 0xECC8, 0x5680, 0xC07B, + 0x5681, 0xECC9, 0x5682, 0xECC7, 0x5683, 0xECC5, 0x5684, 0xECC4, 0x5685, 0xC07D, 0x5686, 0xECC3, 0x5687, 0xC07E, 0x568C, 0xECC1, + 0x568D, 0xECC2, 0x568E, 0xC07A, 0x568F, 0xC0A1, 0x5690, 0xC07C, 0x5693, 0xECC0, 0x5695, 0xC250, 0x5697, 0xEFBC, 0x5698, 0xEFBA, + 0x5699, 0xEFBF, 0x569A, 0xEFBD, 0x569C, 0xEFBB, 0x569D, 0xEFBE, 0x56A5, 0xC360, 0x56A6, 0xF1F2, 0x56A7, 0xF1F3, 0x56A8, 0xC456, + 0x56AA, 0xF1F4, 0x56AB, 0xF1F0, 0x56AC, 0xF1F5, 0x56AD, 0xF1F1, 0x56AE, 0xC251, 0x56B2, 0xF3FE, 0x56B3, 0xF441, 0x56B4, 0xC459, + 0x56B5, 0xF440, 0x56B6, 0xC458, 0x56B7, 0xC457, 0x56BC, 0xC45A, 0x56BD, 0xF5C5, 0x56BE, 0xF5C6, 0x56C0, 0xC4DA, 0x56C1, 0xC4D9, + 0x56C2, 0xC4DB, 0x56C3, 0xF5C4, 0x56C5, 0xF6D8, 0x56C6, 0xF6D7, 0x56C8, 0xC56D, 0x56C9, 0xC56F, 0x56CA, 0xC56E, 0x56CB, 0xF6D9, + 0x56CC, 0xC5C8, 0x56CD, 0xF8A6, 0x56D1, 0xC5F1, 0x56D3, 0xF8A5, 0x56D4, 0xF8EE, 0x56D7, 0xC949, 0x56DA, 0xA57D, 0x56DB, 0xA57C, + 0x56DD, 0xA65F, 0x56DE, 0xA65E, 0x56DF, 0xC9C7, 0x56E0, 0xA65D, 0x56E1, 0xC9C6, 0x56E4, 0xA779, 0x56E5, 0xCAA9, 0x56E7, 0xCAA8, + 0x56EA, 0xA777, 0x56EB, 0xA77A, 0x56EE, 0xCAA7, 0x56F0, 0xA778, 0x56F7, 0xCBF0, 0x56F9, 0xCBF1, 0x56FA, 0xA954, 0x56FF, 0xABAA, + 0x5701, 0xD148, 0x5702, 0xD149, 0x5703, 0xAE45, 0x5704, 0xAE46, 0x5707, 0xD4AC, 0x5708, 0xB0E9, 0x5709, 0xB0EB, 0x570A, 0xD4AB, + 0x570B, 0xB0EA, 0x570C, 0xD87C, 0x570D, 0xB3F2, 0x5712, 0xB6E9, 0x5713, 0xB6EA, 0x5714, 0xDCE1, 0x5716, 0xB9CF, 0x5718, 0xB9CE, + 0x571A, 0xE549, 0x571B, 0xE948, 0x571C, 0xE947, 0x571E, 0xF96B, 0x571F, 0xA467, 0x5720, 0xC959, 0x5722, 0xC96E, 0x5723, 0xC96F, + 0x5728, 0xA662, 0x5729, 0xA666, 0x572A, 0xC9C9, 0x572C, 0xA664, 0x572D, 0xA663, 0x572E, 0xC9C8, 0x572F, 0xA665, 0x5730, 0xA661, + 0x5733, 0xA660, 0x5734, 0xC9CA, 0x573B, 0xA7A6, 0x573E, 0xA7A3, 0x5740, 0xA77D, 0x5741, 0xCAAA, 0x5745, 0xCAAB, 0x5747, 0xA7A1, + 0x5749, 0xCAAD, 0x574A, 0xA77B, 0x574B, 0xCAAE, 0x574C, 0xCAAC, 0x574D, 0xA77E, 0x574E, 0xA7A2, 0x574F, 0xA7A5, 0x5750, 0xA7A4, + 0x5751, 0xA77C, 0x5752, 0xCAAF, 0x5761, 0xA959, 0x5762, 0xCBFE, 0x5764, 0xA95B, 0x5766, 0xA95A, 0x5768, 0xCC40, 0x5769, 0xA958, + 0x576A, 0xA957, 0x576B, 0xCBF5, 0x576D, 0xCBF4, 0x576F, 0xCBF2, 0x5770, 0xCBF7, 0x5771, 0xCBF6, 0x5772, 0xCBF3, 0x5773, 0xCBFC, + 0x5774, 0xCBFD, 0x5775, 0xCBFA, 0x5776, 0xCBF8, 0x5777, 0xA956, 0x577B, 0xCBFB, 0x577C, 0xA95C, 0x577D, 0xCC41, 0x5780, 0xCBF9, + 0x5782, 0xABAB, 0x5783, 0xA955, 0x578B, 0xABAC, 0x578C, 0xCE54, 0x578F, 0xCE5A, 0x5793, 0xABB2, 0x5794, 0xCE58, 0x5795, 0xCE5E, + 0x5797, 0xCE55, 0x5798, 0xCE59, 0x5799, 0xCE5B, 0x579A, 0xCE5D, 0x579B, 0xCE57, 0x579D, 0xCE56, 0x579E, 0xCE51, 0x579F, 0xCE52, + 0x57A0, 0xABAD, 0x57A2, 0xABAF, 0x57A3, 0xABAE, 0x57A4, 0xCE53, 0x57A5, 0xCE5C, 0x57AE, 0xABB1, 0x57B5, 0xCE50, 0x57B6, 0xD153, + 0x57B8, 0xD152, 0x57B9, 0xD157, 0x57BA, 0xD14E, 0x57BC, 0xD151, 0x57BD, 0xD150, 0x57BF, 0xD154, 0x57C1, 0xD158, 0x57C2, 0xAE47, + 0x57C3, 0xAE4A, 0x57C6, 0xD14F, 0x57C7, 0xD155, 0x57CB, 0xAE49, 0x57CC, 0xD14A, 0x57CE, 0xABB0, 0x57CF, 0xD4BA, 0x57D0, 0xD156, + 0x57D2, 0xD14D, 0x57D4, 0xAE48, 0x57D5, 0xD14C, 0x57DC, 0xD4B1, 0x57DF, 0xB0EC, 0x57E0, 0xB0F0, 0x57E1, 0xD4C1, 0x57E2, 0xD4AF, + 0x57E3, 0xD4BD, 0x57E4, 0xB0F1, 0x57E5, 0xD4BF, 0x57E7, 0xD4C5, 0x57E9, 0xD4C9, 0x57EC, 0xD4C0, 0x57ED, 0xD4B4, 0x57EE, 0xD4BC, + 0x57F0, 0xD4CA, 0x57F1, 0xD4C8, 0x57F2, 0xD4BE, 0x57F3, 0xD4B9, 0x57F4, 0xD4B2, 0x57F5, 0xD8A6, 0x57F6, 0xD4B0, 0x57F7, 0xB0F5, + 0x57F8, 0xD4B7, 0x57F9, 0xB0F6, 0x57FA, 0xB0F2, 0x57FB, 0xD4AD, 0x57FC, 0xD4C3, 0x57FD, 0xD4B5, 0x5800, 0xD4B3, 0x5801, 0xD4C6, + 0x5802, 0xB0F3, 0x5804, 0xD4CC, 0x5805, 0xB0ED, 0x5806, 0xB0EF, 0x5807, 0xD4BB, 0x5808, 0xD4B6, 0x5809, 0xAE4B, 0x580A, 0xB0EE, + 0x580B, 0xD4B8, 0x580C, 0xD4C7, 0x580D, 0xD4CB, 0x580E, 0xD4C2, 0x5810, 0xD4C4, 0x5814, 0xD4AE, 0x5819, 0xD8A1, 0x581B, 0xD8AA, + 0x581C, 0xD8A9, 0x581D, 0xB3FA, 0x581E, 0xD8A2, 0x5820, 0xB3FB, 0x5821, 0xB3F9, 0x5823, 0xD8A4, 0x5824, 0xB3F6, 0x5825, 0xD8A8, + 0x5827, 0xD8A3, 0x5828, 0xD8A5, 0x5829, 0xD87D, 0x582A, 0xB3F4, 0x582C, 0xD8B2, 0x582D, 0xD8B1, 0x582E, 0xD8AE, 0x582F, 0xB3F3, + 0x5830, 0xB3F7, 0x5831, 0xB3F8, 0x5832, 0xD14B, 0x5833, 0xD8AB, 0x5834, 0xB3F5, 0x5835, 0xB0F4, 0x5836, 0xD8AD, 0x5837, 0xD87E, + 0x5838, 0xD8B0, 0x5839, 0xD8AF, 0x583B, 0xD8B3, 0x583D, 0xDCEF, 0x583F, 0xD8AC, 0x5848, 0xD8A7, 0x5849, 0xDCE7, 0x584A, 0xB6F4, + 0x584B, 0xB6F7, 0x584C, 0xB6F2, 0x584D, 0xDCE6, 0x584E, 0xDCEA, 0x584F, 0xDCE5, 0x5851, 0xB6EC, 0x5852, 0xB6F6, 0x5853, 0xDCE2, + 0x5854, 0xB6F0, 0x5855, 0xDCE9, 0x5857, 0xB6EE, 0x5858, 0xB6ED, 0x5859, 0xDCEC, 0x585A, 0xB6EF, 0x585B, 0xDCEE, 0x585D, 0xDCEB, + 0x585E, 0xB6EB, 0x5862, 0xB6F5, 0x5863, 0xDCF0, 0x5864, 0xDCE4, 0x5865, 0xDCED, 0x5868, 0xDCE3, 0x586B, 0xB6F1, 0x586D, 0xB6F3, + 0x586F, 0xDCE8, 0x5871, 0xDCF1, 0x5874, 0xE15D, 0x5875, 0xB9D0, 0x5876, 0xE163, 0x5879, 0xB9D5, 0x587A, 0xE15F, 0x587B, 0xE166, + 0x587C, 0xE157, 0x587D, 0xB9D7, 0x587E, 0xB9D1, 0x587F, 0xE15C, 0x5880, 0xBC55, 0x5881, 0xE15B, 0x5882, 0xE164, 0x5883, 0xB9D2, + 0x5885, 0xB9D6, 0x5886, 0xE15A, 0x5887, 0xE160, 0x5888, 0xE165, 0x5889, 0xE156, 0x588A, 0xB9D4, 0x588B, 0xE15E, 0x588E, 0xE162, + 0x588F, 0xE168, 0x5890, 0xE158, 0x5891, 0xE161, 0x5893, 0xB9D3, 0x5894, 0xE167, 0x5898, 0xE159, 0x589C, 0xBC59, 0x589D, 0xE54B, + 0x589E, 0xBC57, 0x589F, 0xBC56, 0x58A0, 0xE54D, 0x58A1, 0xE552, 0x58A3, 0xE54E, 0x58A5, 0xE551, 0x58A6, 0xBC5C, 0x58A8, 0xBEA5, + 0x58A9, 0xBC5B, 0x58AB, 0xE54A, 0x58AC, 0xE550, 0x58AE, 0xBC5A, 0x58AF, 0xE54F, 0x58B1, 0xE54C, 0x58B3, 0xBC58, 0x58BA, 0xE94D, + 0x58BB, 0xF9D9, 0x58BC, 0xE94F, 0x58BD, 0xE94A, 0x58BE, 0xBEC1, 0x58BF, 0xE94C, 0x58C1, 0xBEC0, 0x58C2, 0xE94E, 0x58C5, 0xBEC3, + 0x58C6, 0xE950, 0x58C7, 0xBEC2, 0x58C8, 0xE949, 0x58C9, 0xE94B, 0x58CE, 0xC0A5, 0x58CF, 0xECCC, 0x58D1, 0xC0A4, 0x58D2, 0xECCD, + 0x58D3, 0xC0A3, 0x58D4, 0xECCB, 0x58D5, 0xC0A2, 0x58D6, 0xECCA, 0x58D8, 0xC253, 0x58D9, 0xC252, 0x58DA, 0xF1F6, 0x58DB, 0xF1F8, + 0x58DD, 0xF1F7, 0x58DE, 0xC361, 0x58DF, 0xC362, 0x58E2, 0xC363, 0x58E3, 0xF442, 0x58E4, 0xC45B, 0x58E7, 0xF7D3, 0x58E8, 0xF7D2, + 0x58E9, 0xC5F2, 0x58EB, 0xA468, 0x58EC, 0xA4D0, 0x58EF, 0xA7A7, 0x58F4, 0xCE5F, 0x58F9, 0xB3FC, 0x58FA, 0xB3FD, 0x58FC, 0xDCF2, + 0x58FD, 0xB9D8, 0x58FE, 0xE169, 0x58FF, 0xE553, 0x5903, 0xC95A, 0x5906, 0xCAB0, 0x590C, 0xCC42, 0x590D, 0xCE60, 0x590E, 0xD159, + 0x590F, 0xAE4C, 0x5912, 0xF1F9, 0x5914, 0xC4DC, 0x5915, 0xA469, 0x5916, 0xA57E, 0x5917, 0xC970, 0x5919, 0xA667, 0x591A, 0xA668, + 0x591C, 0xA95D, 0x5920, 0xB0F7, 0x5922, 0xB9DA, 0x5924, 0xB9DB, 0x5925, 0xB9D9, 0x5927, 0xA46A, 0x5929, 0xA4D1, 0x592A, 0xA4D3, + 0x592B, 0xA4D2, 0x592C, 0xC95B, 0x592D, 0xA4D4, 0x592E, 0xA5A1, 0x592F, 0xC971, 0x5931, 0xA5A2, 0x5937, 0xA669, 0x5938, 0xA66A, + 0x593C, 0xC9CB, 0x593E, 0xA7A8, 0x5940, 0xCAB1, 0x5944, 0xA961, 0x5945, 0xCC43, 0x5947, 0xA95F, 0x5948, 0xA960, 0x5949, 0xA95E, + 0x594A, 0xD15A, 0x594E, 0xABB6, 0x594F, 0xABB5, 0x5950, 0xABB7, 0x5951, 0xABB4, 0x5953, 0xCE61, 0x5954, 0xA962, 0x5955, 0xABB3, + 0x5957, 0xAE4D, 0x5958, 0xAE4E, 0x595A, 0xAE4F, 0x595C, 0xD4CD, 0x5960, 0xB3FE, 0x5961, 0xD8B4, 0x5962, 0xB0F8, 0x5967, 0xB6F8, + 0x5969, 0xB9DD, 0x596A, 0xB9DC, 0x596B, 0xE16A, 0x596D, 0xBC5D, 0x596E, 0xBEC4, 0x5970, 0xEFC0, 0x5971, 0xF6DA, 0x5972, 0xF7D4, + 0x5973, 0xA46B, 0x5974, 0xA5A3, 0x5976, 0xA5A4, 0x5977, 0xC9D1, 0x5978, 0xA66C, 0x5979, 0xA66F, 0x597B, 0xC9CF, 0x597C, 0xC9CD, + 0x597D, 0xA66E, 0x597E, 0xC9D0, 0x597F, 0xC9D2, 0x5980, 0xC9CC, 0x5981, 0xA671, 0x5982, 0xA670, 0x5983, 0xA66D, 0x5984, 0xA66B, + 0x5985, 0xC9CE, 0x598A, 0xA7B3, 0x598D, 0xA7B0, 0x598E, 0xCAB6, 0x598F, 0xCAB9, 0x5990, 0xCAB8, 0x5992, 0xA7AA, 0x5993, 0xA7B2, + 0x5996, 0xA7AF, 0x5997, 0xCAB5, 0x5998, 0xCAB3, 0x5999, 0xA7AE, 0x599D, 0xA7A9, 0x599E, 0xA7AC, 0x59A0, 0xCAB4, 0x59A1, 0xCABB, + 0x59A2, 0xCAB7, 0x59A3, 0xA7AD, 0x59A4, 0xA7B1, 0x59A5, 0xA7B4, 0x59A6, 0xCAB2, 0x59A7, 0xCABA, 0x59A8, 0xA7AB, 0x59AE, 0xA967, + 0x59AF, 0xA96F, 0x59B1, 0xCC4F, 0x59B2, 0xCC48, 0x59B3, 0xA970, 0x59B4, 0xCC53, 0x59B5, 0xCC44, 0x59B6, 0xCC4B, 0x59B9, 0xA966, + 0x59BA, 0xCC45, 0x59BB, 0xA964, 0x59BC, 0xCC4C, 0x59BD, 0xCC50, 0x59BE, 0xA963, 0x59C0, 0xCC51, 0x59C1, 0xCC4A, 0x59C3, 0xCC4D, + 0x59C5, 0xA972, 0x59C6, 0xA969, 0x59C7, 0xCC54, 0x59C8, 0xCC52, 0x59CA, 0xA96E, 0x59CB, 0xA96C, 0x59CC, 0xCC49, 0x59CD, 0xA96B, + 0x59CE, 0xCC47, 0x59CF, 0xCC46, 0x59D0, 0xA96A, 0x59D1, 0xA968, 0x59D2, 0xA971, 0x59D3, 0xA96D, 0x59D4, 0xA965, 0x59D6, 0xCC4E, + 0x59D8, 0xABB9, 0x59DA, 0xABC0, 0x59DB, 0xCE6F, 0x59DC, 0xABB8, 0x59DD, 0xCE67, 0x59DE, 0xCE63, 0x59E0, 0xCE73, 0x59E1, 0xCE62, + 0x59E3, 0xABBB, 0x59E4, 0xCE6C, 0x59E5, 0xABBE, 0x59E6, 0xABC1, 0x59E8, 0xABBC, 0x59E9, 0xCE70, 0x59EA, 0xABBF, 0x59EC, 0xAE56, + 0x59ED, 0xCE76, 0x59EE, 0xCE64, 0x59F1, 0xCE66, 0x59F2, 0xCE6D, 0x59F3, 0xCE71, 0x59F4, 0xCE75, 0x59F5, 0xCE72, 0x59F6, 0xCE6B, + 0x59F7, 0xCE6E, 0x59FA, 0xCE68, 0x59FB, 0xABC3, 0x59FC, 0xCE6A, 0x59FD, 0xCE69, 0x59FE, 0xCE74, 0x59FF, 0xABBA, 0x5A00, 0xCE65, + 0x5A01, 0xABC2, 0x5A03, 0xABBD, 0x5A09, 0xAE5C, 0x5A0A, 0xD162, 0x5A0C, 0xAE5B, 0x5A0F, 0xD160, 0x5A11, 0xAE50, 0x5A13, 0xAE55, + 0x5A15, 0xD15F, 0x5A16, 0xD15C, 0x5A17, 0xD161, 0x5A18, 0xAE51, 0x5A19, 0xD15B, 0x5A1B, 0xAE54, 0x5A1C, 0xAE52, 0x5A1E, 0xD163, + 0x5A1F, 0xAE53, 0x5A20, 0xAE57, 0x5A23, 0xAE58, 0x5A25, 0xAE5A, 0x5A29, 0xAE59, 0x5A2D, 0xD15D, 0x5A2E, 0xD15E, 0x5A33, 0xD164, + 0x5A35, 0xD4D4, 0x5A36, 0xB0F9, 0x5A37, 0xD8C2, 0x5A38, 0xD4D3, 0x5A39, 0xD4E6, 0x5A3C, 0xB140, 0x5A3E, 0xD4E4, 0x5A40, 0xB0FE, + 0x5A41, 0xB0FA, 0x5A42, 0xD4ED, 0x5A43, 0xD4DD, 0x5A44, 0xD4E0, 0x5A46, 0xB143, 0x5A47, 0xD4EA, 0x5A48, 0xD4E2, 0x5A49, 0xB0FB, + 0x5A4A, 0xB144, 0x5A4C, 0xD4E7, 0x5A4D, 0xD4E5, 0x5A50, 0xD4D6, 0x5A51, 0xD4EB, 0x5A52, 0xD4DF, 0x5A53, 0xD4DA, 0x5A55, 0xD4D0, + 0x5A56, 0xD4EC, 0x5A57, 0xD4DC, 0x5A58, 0xD4CF, 0x5A5A, 0xB142, 0x5A5B, 0xD4E1, 0x5A5C, 0xD4EE, 0x5A5D, 0xD4DE, 0x5A5E, 0xD4D2, + 0x5A5F, 0xD4D7, 0x5A60, 0xD4CE, 0x5A62, 0xB141, 0x5A64, 0xD4DB, 0x5A65, 0xD4D8, 0x5A66, 0xB0FC, 0x5A67, 0xD4D1, 0x5A69, 0xD4E9, + 0x5A6A, 0xB0FD, 0x5A6C, 0xD4D9, 0x5A6D, 0xD4D5, 0x5A70, 0xD4E8, 0x5A77, 0xB440, 0x5A78, 0xD8BB, 0x5A7A, 0xD8B8, 0x5A7B, 0xD8C9, + 0x5A7C, 0xD8BD, 0x5A7D, 0xD8CA, 0x5A7F, 0xB442, 0x5A83, 0xD8C6, 0x5A84, 0xD8C3, 0x5A8A, 0xD8C4, 0x5A8B, 0xD8C7, 0x5A8C, 0xD8CB, + 0x5A8E, 0xD4E3, 0x5A8F, 0xD8CD, 0x5A90, 0xDD47, 0x5A92, 0xB443, 0x5A93, 0xD8CE, 0x5A94, 0xD8B6, 0x5A95, 0xD8C0, 0x5A97, 0xD8C5, + 0x5A9A, 0xB441, 0x5A9B, 0xB444, 0x5A9C, 0xD8CC, 0x5A9D, 0xD8CF, 0x5A9E, 0xD8BA, 0x5A9F, 0xD8B7, 0x5AA2, 0xD8B9, 0x5AA5, 0xD8BE, + 0x5AA6, 0xD8BC, 0x5AA7, 0xB445, 0x5AA9, 0xD8C8, 0x5AAC, 0xD8BF, 0x5AAE, 0xD8C1, 0x5AAF, 0xD8B5, 0x5AB0, 0xDCFA, 0x5AB1, 0xDCF8, + 0x5AB2, 0xB742, 0x5AB3, 0xB740, 0x5AB4, 0xDD43, 0x5AB5, 0xDCF9, 0x5AB6, 0xDD44, 0x5AB7, 0xDD40, 0x5AB8, 0xDCF7, 0x5AB9, 0xDD46, + 0x5ABA, 0xDCF6, 0x5ABB, 0xDCFD, 0x5ABC, 0xB6FE, 0x5ABD, 0xB6FD, 0x5ABE, 0xB6FC, 0x5ABF, 0xDCFB, 0x5AC0, 0xDD41, 0x5AC1, 0xB6F9, + 0x5AC2, 0xB741, 0x5AC4, 0xDCF4, 0x5AC6, 0xDCFE, 0x5AC7, 0xDCF3, 0x5AC8, 0xDCFC, 0x5AC9, 0xB6FA, 0x5ACA, 0xDD42, 0x5ACB, 0xDCF5, + 0x5ACC, 0xB6FB, 0x5ACD, 0xDD45, 0x5AD5, 0xE16E, 0x5AD6, 0xB9E2, 0x5AD7, 0xB9E1, 0x5AD8, 0xB9E3, 0x5AD9, 0xE17A, 0x5ADA, 0xE170, + 0x5ADB, 0xE176, 0x5ADC, 0xE16B, 0x5ADD, 0xE179, 0x5ADE, 0xE178, 0x5ADF, 0xE17C, 0x5AE0, 0xE175, 0x5AE1, 0xB9DE, 0x5AE2, 0xE174, + 0x5AE3, 0xB9E4, 0x5AE5, 0xE16D, 0x5AE6, 0xB9DF, 0x5AE8, 0xE17B, 0x5AE9, 0xB9E0, 0x5AEA, 0xE16F, 0x5AEB, 0xE172, 0x5AEC, 0xE177, + 0x5AED, 0xE171, 0x5AEE, 0xE16C, 0x5AF3, 0xE173, 0x5AF4, 0xE555, 0x5AF5, 0xBC61, 0x5AF6, 0xE558, 0x5AF7, 0xE557, 0x5AF8, 0xE55A, + 0x5AF9, 0xE55C, 0x5AFA, 0xF9DC, 0x5AFB, 0xBC5F, 0x5AFD, 0xE556, 0x5AFF, 0xE554, 0x5B01, 0xE55D, 0x5B02, 0xE55B, 0x5B03, 0xE559, + 0x5B05, 0xE55F, 0x5B07, 0xE55E, 0x5B08, 0xBC63, 0x5B09, 0xBC5E, 0x5B0B, 0xBC60, 0x5B0C, 0xBC62, 0x5B0F, 0xE560, 0x5B10, 0xE957, + 0x5B13, 0xE956, 0x5B14, 0xE955, 0x5B16, 0xE958, 0x5B17, 0xE951, 0x5B19, 0xE952, 0x5B1A, 0xE95A, 0x5B1B, 0xE953, 0x5B1D, 0xBEC5, + 0x5B1E, 0xE95C, 0x5B20, 0xE95B, 0x5B21, 0xE954, 0x5B23, 0xECD1, 0x5B24, 0xC0A8, 0x5B25, 0xECCF, 0x5B26, 0xECD4, 0x5B27, 0xECD3, + 0x5B28, 0xE959, 0x5B2A, 0xC0A7, 0x5B2C, 0xECD2, 0x5B2D, 0xECCE, 0x5B2E, 0xECD6, 0x5B2F, 0xECD5, 0x5B30, 0xC0A6, 0x5B32, 0xECD0, + 0x5B34, 0xBEC6, 0x5B38, 0xC254, 0x5B3C, 0xEFC1, 0x5B3D, 0xF1FA, 0x5B3E, 0xF1FB, 0x5B3F, 0xF1FC, 0x5B40, 0xC45C, 0x5B43, 0xC45D, + 0x5B45, 0xF443, 0x5B47, 0xF5C8, 0x5B48, 0xF5C7, 0x5B4B, 0xF6DB, 0x5B4C, 0xF6DC, 0x5B4D, 0xF7D5, 0x5B4E, 0xF8A7, 0x5B50, 0xA46C, + 0x5B51, 0xA46D, 0x5B53, 0xA46E, 0x5B54, 0xA4D5, 0x5B55, 0xA5A5, 0x5B56, 0xC9D3, 0x5B57, 0xA672, 0x5B58, 0xA673, 0x5B5A, 0xA7B7, + 0x5B5B, 0xA7B8, 0x5B5C, 0xA7B6, 0x5B5D, 0xA7B5, 0x5B5F, 0xA973, 0x5B62, 0xCC55, 0x5B63, 0xA975, 0x5B64, 0xA974, 0x5B65, 0xCC56, + 0x5B69, 0xABC4, 0x5B6B, 0xAE5D, 0x5B6C, 0xD165, 0x5B6E, 0xD4F0, 0x5B70, 0xB145, 0x5B71, 0xB447, 0x5B72, 0xD4EF, 0x5B73, 0xB446, + 0x5B75, 0xB9E5, 0x5B77, 0xE17D, 0x5B78, 0xBEC7, 0x5B7A, 0xC0A9, 0x5B7B, 0xECD7, 0x5B7D, 0xC45E, 0x5B7F, 0xC570, 0x5B81, 0xC972, + 0x5B83, 0xA5A6, 0x5B84, 0xC973, 0x5B85, 0xA676, 0x5B87, 0xA674, 0x5B88, 0xA675, 0x5B89, 0xA677, 0x5B8B, 0xA7BA, 0x5B8C, 0xA7B9, + 0x5B8E, 0xCABC, 0x5B8F, 0xA7BB, 0x5B92, 0xCABD, 0x5B93, 0xCC57, 0x5B95, 0xCC58, 0x5B97, 0xA976, 0x5B98, 0xA978, 0x5B99, 0xA97A, + 0x5B9A, 0xA977, 0x5B9B, 0xA97B, 0x5B9C, 0xA979, 0x5BA2, 0xABC8, 0x5BA3, 0xABC5, 0x5BA4, 0xABC7, 0x5BA5, 0xABC9, 0x5BA6, 0xABC6, + 0x5BA7, 0xD166, 0x5BA8, 0xCE77, 0x5BAC, 0xD168, 0x5BAD, 0xD167, 0x5BAE, 0xAE63, 0x5BB0, 0xAE5F, 0x5BB3, 0xAE60, 0x5BB4, 0xAE62, + 0x5BB5, 0xAE64, 0x5BB6, 0xAE61, 0x5BB8, 0xAE66, 0x5BB9, 0xAE65, 0x5BBF, 0xB14A, 0x5BC0, 0xD4F2, 0x5BC1, 0xD4F1, 0x5BC2, 0xB149, + 0x5BC4, 0xB148, 0x5BC5, 0xB147, 0x5BC6, 0xB14B, 0x5BC7, 0xB146, 0x5BCA, 0xD8D5, 0x5BCB, 0xD8D2, 0x5BCC, 0xB449, 0x5BCD, 0xD8D1, + 0x5BCE, 0xD8D6, 0x5BD0, 0xB44B, 0x5BD1, 0xD8D4, 0x5BD2, 0xB448, 0x5BD3, 0xB44A, 0x5BD4, 0xD8D3, 0x5BD6, 0xDD48, 0x5BD8, 0xDD49, + 0x5BD9, 0xDD4A, 0x5BDE, 0xB9E6, 0x5BDF, 0xB9EE, 0x5BE0, 0xE17E, 0x5BE1, 0xB9E8, 0x5BE2, 0xB9EC, 0x5BE3, 0xE1A1, 0x5BE4, 0xB9ED, + 0x5BE5, 0xB9E9, 0x5BE6, 0xB9EA, 0x5BE7, 0xB9E7, 0x5BE8, 0xB9EB, 0x5BE9, 0xBC66, 0x5BEA, 0xD8D0, 0x5BEB, 0xBC67, 0x5BEC, 0xBC65, + 0x5BEE, 0xBC64, 0x5BEF, 0xE95D, 0x5BF0, 0xBEC8, 0x5BF1, 0xECD8, 0x5BF2, 0xECD9, 0x5BF5, 0xC364, 0x5BF6, 0xC45F, 0x5BF8, 0xA46F, + 0x5BFA, 0xA678, 0x5C01, 0xABCA, 0x5C03, 0xD169, 0x5C04, 0xAE67, 0x5C07, 0xB14E, 0x5C08, 0xB14D, 0x5C09, 0xB14C, 0x5C0A, 0xB44C, + 0x5C0B, 0xB44D, 0x5C0C, 0xD8D7, 0x5C0D, 0xB9EF, 0x5C0E, 0xBEC9, 0x5C0F, 0xA470, 0x5C10, 0xC95C, 0x5C11, 0xA4D6, 0x5C12, 0xC974, + 0x5C15, 0xC9D4, 0x5C16, 0xA679, 0x5C1A, 0xA97C, 0x5C1F, 0xDD4B, 0x5C22, 0xA471, 0x5C24, 0xA4D7, 0x5C25, 0xC9D5, 0x5C28, 0xCABE, + 0x5C2A, 0xCABF, 0x5C2C, 0xA7BC, 0x5C30, 0xD8D8, 0x5C31, 0xB44E, 0x5C33, 0xDD4C, 0x5C37, 0xC0AA, 0x5C38, 0xA472, 0x5C39, 0xA4A8, + 0x5C3A, 0xA4D8, 0x5C3B, 0xC975, 0x5C3C, 0xA5A7, 0x5C3E, 0xA7C0, 0x5C3F, 0xA7BF, 0x5C40, 0xA7BD, 0x5C41, 0xA7BE, 0x5C44, 0xCC59, + 0x5C45, 0xA97E, 0x5C46, 0xA9A1, 0x5C47, 0xCC5A, 0x5C48, 0xA97D, 0x5C4B, 0xABCE, 0x5C4C, 0xCE78, 0x5C4D, 0xABCD, 0x5C4E, 0xABCB, + 0x5C4F, 0xABCC, 0x5C50, 0xAE6A, 0x5C51, 0xAE68, 0x5C54, 0xD16B, 0x5C55, 0xAE69, 0x5C56, 0xD16A, 0x5C58, 0xAE5E, 0x5C59, 0xD4F3, + 0x5C5C, 0xB150, 0x5C5D, 0xB151, 0x5C60, 0xB14F, 0x5C62, 0xB9F0, 0x5C63, 0xE1A2, 0x5C64, 0xBC68, 0x5C65, 0xBC69, 0x5C67, 0xE561, + 0x5C68, 0xC0AB, 0x5C69, 0xEFC2, 0x5C6A, 0xEFC3, 0x5C6C, 0xC4DD, 0x5C6D, 0xF8A8, 0x5C6E, 0xC94B, 0x5C6F, 0xA4D9, 0x5C71, 0xA473, + 0x5C73, 0xC977, 0x5C74, 0xC976, 0x5C79, 0xA67A, 0x5C7A, 0xC9D7, 0x5C7B, 0xC9D8, 0x5C7C, 0xC9D6, 0x5C7E, 0xC9D9, 0x5C86, 0xCAC7, + 0x5C88, 0xCAC2, 0x5C89, 0xCAC4, 0x5C8A, 0xCAC6, 0x5C8B, 0xCAC3, 0x5C8C, 0xA7C4, 0x5C8D, 0xCAC0, 0x5C8F, 0xCAC1, 0x5C90, 0xA7C1, + 0x5C91, 0xA7C2, 0x5C92, 0xCAC5, 0x5C93, 0xCAC8, 0x5C94, 0xA7C3, 0x5C95, 0xCAC9, 0x5C9D, 0xCC68, 0x5C9F, 0xCC62, 0x5CA0, 0xCC5D, + 0x5CA1, 0xA9A3, 0x5CA2, 0xCC65, 0x5CA3, 0xCC63, 0x5CA4, 0xCC5C, 0x5CA5, 0xCC69, 0x5CA6, 0xCC6C, 0x5CA7, 0xCC67, 0x5CA8, 0xCC60, + 0x5CA9, 0xA9A5, 0x5CAA, 0xCC66, 0x5CAB, 0xA9A6, 0x5CAC, 0xCC61, 0x5CAD, 0xCC64, 0x5CAE, 0xCC5B, 0x5CAF, 0xCC5F, 0x5CB0, 0xCC6B, + 0x5CB1, 0xA9A7, 0x5CB3, 0xA9A8, 0x5CB5, 0xCC5E, 0x5CB6, 0xCC6A, 0x5CB7, 0xA9A2, 0x5CB8, 0xA9A4, 0x5CC6, 0xCEAB, 0x5CC7, 0xCEA4, + 0x5CC8, 0xCEAA, 0x5CC9, 0xCEA3, 0x5CCA, 0xCEA5, 0x5CCB, 0xCE7D, 0x5CCC, 0xCE7B, 0x5CCE, 0xCEAC, 0x5CCF, 0xCEA9, 0x5CD0, 0xCE79, + 0x5CD2, 0xABD0, 0x5CD3, 0xCEA7, 0x5CD4, 0xCEA8, 0x5CD6, 0xCEA6, 0x5CD7, 0xCE7C, 0x5CD8, 0xCE7A, 0x5CD9, 0xABCF, 0x5CDA, 0xCEA2, + 0x5CDB, 0xCE7E, 0x5CDE, 0xCEA1, 0x5CDF, 0xCEAD, 0x5CE8, 0xAE6F, 0x5CEA, 0xAE6E, 0x5CEC, 0xD16C, 0x5CED, 0xAE6B, 0x5CEE, 0xD16E, + 0x5CF0, 0xAE70, 0x5CF1, 0xD16F, 0x5CF4, 0xAE73, 0x5CF6, 0xAE71, 0x5CF7, 0xD170, 0x5CF8, 0xCEAE, 0x5CF9, 0xD172, 0x5CFB, 0xAE6D, + 0x5CFD, 0xAE6C, 0x5CFF, 0xD16D, 0x5D00, 0xD171, 0x5D01, 0xAE72, 0x5D06, 0xB153, 0x5D07, 0xB152, 0x5D0B, 0xD4F5, 0x5D0C, 0xD4F9, + 0x5D0D, 0xD4FB, 0x5D0E, 0xB154, 0x5D0F, 0xD4FE, 0x5D11, 0xB158, 0x5D12, 0xD541, 0x5D14, 0xB15A, 0x5D16, 0xB156, 0x5D17, 0xB15E, + 0x5D19, 0xB15B, 0x5D1A, 0xD4F7, 0x5D1B, 0xB155, 0x5D1D, 0xD4F6, 0x5D1E, 0xD4F4, 0x5D1F, 0xD543, 0x5D20, 0xD4F8, 0x5D22, 0xB157, + 0x5D23, 0xD542, 0x5D24, 0xB15C, 0x5D25, 0xD4FD, 0x5D26, 0xD4FC, 0x5D27, 0xB15D, 0x5D28, 0xD4FA, 0x5D29, 0xB159, 0x5D2E, 0xD544, + 0x5D30, 0xD540, 0x5D31, 0xD8E7, 0x5D32, 0xD8EE, 0x5D33, 0xD8E3, 0x5D34, 0xB451, 0x5D35, 0xD8DF, 0x5D36, 0xD8EF, 0x5D37, 0xD8D9, + 0x5D38, 0xD8EC, 0x5D39, 0xD8EA, 0x5D3A, 0xD8E4, 0x5D3C, 0xD8ED, 0x5D3D, 0xD8E6, 0x5D3F, 0xD8DE, 0x5D40, 0xD8F0, 0x5D41, 0xD8DC, + 0x5D42, 0xD8E9, 0x5D43, 0xD8DA, 0x5D45, 0xD8F1, 0x5D47, 0xB452, 0x5D49, 0xD8EB, 0x5D4A, 0xDD4F, 0x5D4B, 0xD8DD, 0x5D4C, 0xB44F, + 0x5D4E, 0xD8E1, 0x5D50, 0xB450, 0x5D51, 0xD8E0, 0x5D52, 0xD8E5, 0x5D55, 0xD8E2, 0x5D59, 0xD8E8, 0x5D5E, 0xDD53, 0x5D62, 0xDD56, + 0x5D63, 0xDD4E, 0x5D65, 0xDD50, 0x5D67, 0xDD55, 0x5D68, 0xDD54, 0x5D69, 0xB743, 0x5D6B, 0xD8DB, 0x5D6C, 0xDD52, 0x5D6F, 0xB744, + 0x5D71, 0xDD4D, 0x5D72, 0xDD51, 0x5D77, 0xE1A9, 0x5D79, 0xE1B0, 0x5D7A, 0xE1A7, 0x5D7C, 0xE1AE, 0x5D7D, 0xE1A5, 0x5D7E, 0xE1AD, + 0x5D7F, 0xE1B1, 0x5D80, 0xE1A4, 0x5D81, 0xE1A8, 0x5D82, 0xE1A3, 0x5D84, 0xB9F1, 0x5D86, 0xE1A6, 0x5D87, 0xB9F2, 0x5D88, 0xE1AC, + 0x5D89, 0xE1AB, 0x5D8A, 0xE1AA, 0x5D8D, 0xE1AF, 0x5D92, 0xE565, 0x5D93, 0xE567, 0x5D94, 0xBC6B, 0x5D95, 0xE568, 0x5D97, 0xE563, + 0x5D99, 0xE562, 0x5D9A, 0xE56C, 0x5D9C, 0xE56A, 0x5D9D, 0xBC6A, 0x5D9E, 0xE56D, 0x5D9F, 0xE564, 0x5DA0, 0xE569, 0x5DA1, 0xE56B, + 0x5DA2, 0xE566, 0x5DA7, 0xE961, 0x5DA8, 0xE966, 0x5DA9, 0xE960, 0x5DAA, 0xE965, 0x5DAC, 0xE95E, 0x5DAD, 0xE968, 0x5DAE, 0xE964, + 0x5DAF, 0xE969, 0x5DB0, 0xE963, 0x5DB1, 0xE95F, 0x5DB2, 0xE967, 0x5DB4, 0xE96A, 0x5DB5, 0xE962, 0x5DB7, 0xECDA, 0x5DB8, 0xC0AF, + 0x5DBA, 0xC0AD, 0x5DBC, 0xC0AC, 0x5DBD, 0xC0AE, 0x5DC0, 0xEFC4, 0x5DC2, 0xF172, 0x5DC3, 0xF1FD, 0x5DC6, 0xF444, 0x5DC7, 0xF445, + 0x5DC9, 0xC460, 0x5DCB, 0xF5C9, 0x5DCD, 0xC4DE, 0x5DCF, 0xF5CA, 0x5DD1, 0xF6DE, 0x5DD2, 0xC572, 0x5DD4, 0xC571, 0x5DD5, 0xF6DD, + 0x5DD6, 0xC5C9, 0x5DD8, 0xF7D6, 0x5DDD, 0xA474, 0x5DDE, 0xA67B, 0x5DDF, 0xC9DA, 0x5DE0, 0xCACA, 0x5DE1, 0xA8B5, 0x5DE2, 0xB15F, + 0x5DE5, 0xA475, 0x5DE6, 0xA5AA, 0x5DE7, 0xA5A9, 0x5DE8, 0xA5A8, 0x5DEB, 0xA7C5, 0x5DEE, 0xAE74, 0x5DF0, 0xDD57, 0x5DF1, 0xA476, + 0x5DF2, 0xA477, 0x5DF3, 0xA478, 0x5DF4, 0xA4DA, 0x5DF7, 0xABD1, 0x5DF9, 0xCEAF, 0x5DFD, 0xB453, 0x5DFE, 0xA479, 0x5DFF, 0xC95D, + 0x5E02, 0xA5AB, 0x5E03, 0xA5AC, 0x5E04, 0xC978, 0x5E06, 0xA67C, 0x5E0A, 0xCACB, 0x5E0C, 0xA7C6, 0x5E0E, 0xCACC, 0x5E11, 0xA9AE, + 0x5E14, 0xCC6E, 0x5E15, 0xA9AC, 0x5E16, 0xA9AB, 0x5E17, 0xCC6D, 0x5E18, 0xA9A9, 0x5E19, 0xCC6F, 0x5E1A, 0xA9AA, 0x5E1B, 0xA9AD, + 0x5E1D, 0xABD2, 0x5E1F, 0xABD4, 0x5E20, 0xCEB3, 0x5E21, 0xCEB0, 0x5E22, 0xCEB1, 0x5E23, 0xCEB2, 0x5E24, 0xCEB4, 0x5E25, 0xABD3, + 0x5E28, 0xD174, 0x5E29, 0xD173, 0x5E2B, 0xAE76, 0x5E2D, 0xAE75, 0x5E33, 0xB162, 0x5E34, 0xD546, 0x5E36, 0xB161, 0x5E37, 0xB163, + 0x5E38, 0xB160, 0x5E3D, 0xB455, 0x5E3E, 0xD545, 0x5E40, 0xB456, 0x5E41, 0xD8F3, 0x5E43, 0xB457, 0x5E44, 0xD8F2, 0x5E45, 0xB454, + 0x5E4A, 0xDD5A, 0x5E4B, 0xDD5C, 0x5E4C, 0xB745, 0x5E4D, 0xDD5B, 0x5E4E, 0xDD59, 0x5E4F, 0xDD58, 0x5E53, 0xE1B4, 0x5E54, 0xB9F7, + 0x5E55, 0xB9F5, 0x5E57, 0xB9F6, 0x5E58, 0xE1B2, 0x5E59, 0xE1B3, 0x5E5B, 0xB9F3, 0x5E5C, 0xE571, 0x5E5D, 0xE56F, 0x5E5F, 0xBC6D, + 0x5E60, 0xE570, 0x5E61, 0xBC6E, 0x5E62, 0xBC6C, 0x5E63, 0xB9F4, 0x5E66, 0xE96D, 0x5E67, 0xE96B, 0x5E68, 0xE96C, 0x5E69, 0xE56E, + 0x5E6A, 0xECDC, 0x5E6B, 0xC0B0, 0x5E6C, 0xECDB, 0x5E6D, 0xEFC5, 0x5E6E, 0xEFC6, 0x5E6F, 0xE96E, 0x5E70, 0xF1FE, 0x5E72, 0xA47A, + 0x5E73, 0xA5AD, 0x5E74, 0xA67E, 0x5E75, 0xC9DB, 0x5E76, 0xA67D, 0x5E78, 0xA9AF, 0x5E79, 0xB746, 0x5E7B, 0xA4DB, 0x5E7C, 0xA5AE, + 0x5E7D, 0xABD5, 0x5E7E, 0xB458, 0x5E80, 0xC979, 0x5E82, 0xC97A, 0x5E84, 0xC9DC, 0x5E87, 0xA7C8, 0x5E88, 0xCAD0, 0x5E89, 0xCACE, + 0x5E8A, 0xA7C9, 0x5E8B, 0xCACD, 0x5E8C, 0xCACF, 0x5E8D, 0xCAD1, 0x5E8F, 0xA7C7, 0x5E95, 0xA9B3, 0x5E96, 0xA9B4, 0x5E97, 0xA9B1, + 0x5E9A, 0xA9B0, 0x5E9B, 0xCEB8, 0x5E9C, 0xA9B2, 0x5EA0, 0xABD6, 0x5EA2, 0xCEB7, 0x5EA3, 0xCEB9, 0x5EA4, 0xCEB6, 0x5EA5, 0xCEBA, + 0x5EA6, 0xABD7, 0x5EA7, 0xAE79, 0x5EA8, 0xD175, 0x5EAA, 0xD177, 0x5EAB, 0xAE77, 0x5EAC, 0xD178, 0x5EAD, 0xAE78, 0x5EAE, 0xD176, + 0x5EB0, 0xCEB5, 0x5EB1, 0xD547, 0x5EB2, 0xD54A, 0x5EB3, 0xD54B, 0x5EB4, 0xD548, 0x5EB5, 0xB167, 0x5EB6, 0xB166, 0x5EB7, 0xB164, + 0x5EB8, 0xB165, 0x5EB9, 0xD549, 0x5EBE, 0xB168, 0x5EC1, 0xB45A, 0x5EC2, 0xB45B, 0x5EC4, 0xB45C, 0x5EC5, 0xDD5D, 0x5EC6, 0xDD5F, + 0x5EC7, 0xDD61, 0x5EC8, 0xB748, 0x5EC9, 0xB747, 0x5ECA, 0xB459, 0x5ECB, 0xDD60, 0x5ECC, 0xDD5E, 0x5ECE, 0xE1B8, 0x5ED1, 0xE1B6, + 0x5ED2, 0xE1BC, 0x5ED3, 0xB9F8, 0x5ED4, 0xE1BD, 0x5ED5, 0xE1BA, 0x5ED6, 0xB9F9, 0x5ED7, 0xE1B7, 0x5ED8, 0xE1B5, 0x5ED9, 0xE1BB, + 0x5EDA, 0xBC70, 0x5EDB, 0xE573, 0x5EDC, 0xE1B9, 0x5EDD, 0xBC72, 0x5EDE, 0xE574, 0x5EDF, 0xBC71, 0x5EE0, 0xBC74, 0x5EE1, 0xE575, + 0x5EE2, 0xBC6F, 0x5EE3, 0xBC73, 0x5EE5, 0xE973, 0x5EE6, 0xE971, 0x5EE7, 0xE970, 0x5EE8, 0xE972, 0x5EE9, 0xE96F, 0x5EEC, 0xC366, + 0x5EEE, 0xF446, 0x5EEF, 0xF447, 0x5EF1, 0xF5CB, 0x5EF2, 0xF6DF, 0x5EF3, 0xC655, 0x5EF6, 0xA9B5, 0x5EF7, 0xA7CA, 0x5EFA, 0xABD8, + 0x5EFE, 0xA47B, 0x5EFF, 0xA4DC, 0x5F01, 0xA5AF, 0x5F02, 0xC9DD, 0x5F04, 0xA7CB, 0x5F05, 0xCAD2, 0x5F07, 0xCEBB, 0x5F08, 0xABD9, + 0x5F0A, 0xB9FA, 0x5F0B, 0xA47C, 0x5F0F, 0xA6A1, 0x5F12, 0xB749, 0x5F13, 0xA47D, 0x5F14, 0xA4DD, 0x5F15, 0xA4DE, 0x5F17, 0xA5B1, + 0x5F18, 0xA5B0, 0x5F1A, 0xC9DE, 0x5F1B, 0xA6A2, 0x5F1D, 0xCAD3, 0x5F1F, 0xA7CC, 0x5F22, 0xCC71, 0x5F23, 0xCC72, 0x5F24, 0xCC73, + 0x5F26, 0xA9B6, 0x5F27, 0xA9B7, 0x5F28, 0xCC70, 0x5F29, 0xA9B8, 0x5F2D, 0xABDA, 0x5F2E, 0xCEBC, 0x5F30, 0xD17A, 0x5F31, 0xAE7A, + 0x5F33, 0xD179, 0x5F35, 0xB169, 0x5F36, 0xD54C, 0x5F37, 0xB16A, 0x5F38, 0xD54D, 0x5F3C, 0xB45D, 0x5F40, 0xDD62, 0x5F43, 0xE1BF, + 0x5F44, 0xE1BE, 0x5F46, 0xB9FB, 0x5F48, 0xBC75, 0x5F49, 0xE576, 0x5F4A, 0xBECA, 0x5F4B, 0xE974, 0x5F4C, 0xC0B1, 0x5F4E, 0xC573, + 0x5F4F, 0xF7D8, 0x5F54, 0xCC74, 0x5F56, 0xCEBD, 0x5F57, 0xB16B, 0x5F58, 0xD8F4, 0x5F59, 0xB74A, 0x5F5D, 0xC255, 0x5F62, 0xA7CE, + 0x5F64, 0xA7CD, 0x5F65, 0xABDB, 0x5F67, 0xD17B, 0x5F69, 0xB16D, 0x5F6A, 0xB343, 0x5F6B, 0xB16E, 0x5F6C, 0xB16C, 0x5F6D, 0xB45E, + 0x5F6F, 0xE1C0, 0x5F70, 0xB9FC, 0x5F71, 0xBC76, 0x5F73, 0xC94C, 0x5F74, 0xC9DF, 0x5F76, 0xCAD5, 0x5F77, 0xA7CF, 0x5F78, 0xCAD4, + 0x5F79, 0xA7D0, 0x5F7C, 0xA9BC, 0x5F7D, 0xCC77, 0x5F7E, 0xCC76, 0x5F7F, 0xA9BB, 0x5F80, 0xA9B9, 0x5F81, 0xA9BA, 0x5F82, 0xCC75, + 0x5F85, 0xABDD, 0x5F86, 0xCEBE, 0x5F87, 0xABE0, 0x5F88, 0xABDC, 0x5F89, 0xABE2, 0x5F8A, 0xABDE, 0x5F8B, 0xABDF, 0x5F8C, 0xABE1, + 0x5F90, 0xAE7D, 0x5F91, 0xAE7C, 0x5F92, 0xAE7B, 0x5F96, 0xD54F, 0x5F97, 0xB16F, 0x5F98, 0xB172, 0x5F99, 0xB170, 0x5F9B, 0xD54E, + 0x5F9C, 0xB175, 0x5F9E, 0xB171, 0x5F9F, 0xD550, 0x5FA0, 0xB174, 0x5FA1, 0xB173, 0x5FA5, 0xD8F6, 0x5FA6, 0xD8F5, 0x5FA8, 0xB461, + 0x5FA9, 0xB45F, 0x5FAA, 0xB460, 0x5FAB, 0xD8F7, 0x5FAC, 0xB74B, 0x5FAD, 0xDD64, 0x5FAE, 0xB74C, 0x5FAF, 0xDD63, 0x5FB2, 0xE577, + 0x5FB5, 0xBC78, 0x5FB6, 0xE1C1, 0x5FB7, 0xBC77, 0x5FB9, 0xB9FD, 0x5FBB, 0xECDE, 0x5FBC, 0xE975, 0x5FBD, 0xC0B2, 0x5FBE, 0xECDD, + 0x5FBF, 0xF240, 0x5FC0, 0xF448, 0x5FC1, 0xF449, 0x5FC3, 0xA4DF, 0x5FC5, 0xA5B2, 0x5FC9, 0xC97B, 0x5FCC, 0xA7D2, 0x5FCD, 0xA7D4, + 0x5FCF, 0xC9E2, 0x5FD0, 0xCAD8, 0x5FD1, 0xCAD7, 0x5FD2, 0xCAD6, 0x5FD4, 0xC9E1, 0x5FD5, 0xC9E0, 0x5FD6, 0xA6A4, 0x5FD7, 0xA7D3, + 0x5FD8, 0xA7D1, 0x5FD9, 0xA6A3, 0x5FDD, 0xA9BD, 0x5FDE, 0xCC78, 0x5FE0, 0xA9BE, 0x5FE1, 0xCADD, 0x5FE3, 0xCADF, 0x5FE4, 0xCADE, + 0x5FE5, 0xCC79, 0x5FE8, 0xCADA, 0x5FEA, 0xA7D8, 0x5FEB, 0xA7D6, 0x5FED, 0xCAD9, 0x5FEE, 0xCADB, 0x5FEF, 0xCAE1, 0x5FF1, 0xA7D5, + 0x5FF3, 0xCADC, 0x5FF4, 0xCAE5, 0x5FF5, 0xA9C0, 0x5FF7, 0xCAE2, 0x5FF8, 0xA7D7, 0x5FFA, 0xCAE0, 0x5FFB, 0xCAE3, 0x5FFD, 0xA9BF, + 0x5FFF, 0xA9C1, 0x6000, 0xCAE4, 0x6009, 0xCCAF, 0x600A, 0xCCA2, 0x600B, 0xCC7E, 0x600C, 0xCCAE, 0x600D, 0xCCA9, 0x600E, 0xABE7, + 0x600F, 0xA9C2, 0x6010, 0xCCAA, 0x6011, 0xCCAD, 0x6012, 0xABE3, 0x6013, 0xCCAC, 0x6014, 0xA9C3, 0x6015, 0xA9C8, 0x6016, 0xA9C6, + 0x6017, 0xCCA3, 0x6019, 0xCC7C, 0x601A, 0xCCA5, 0x601B, 0xA9CD, 0x601C, 0xCCB0, 0x601D, 0xABE4, 0x601E, 0xCCA6, 0x6020, 0xABE5, + 0x6021, 0xA9C9, 0x6022, 0xCCA8, 0x6024, 0xCECD, 0x6025, 0xABE6, 0x6026, 0xCC7B, 0x6027, 0xA9CA, 0x6028, 0xABE8, 0x6029, 0xA9CB, + 0x602A, 0xA9C7, 0x602B, 0xA9CC, 0x602C, 0xCCA7, 0x602D, 0xCC7A, 0x602E, 0xCCAB, 0x602F, 0xA9C4, 0x6032, 0xCC7D, 0x6033, 0xCCA4, + 0x6034, 0xCCA1, 0x6035, 0xA9C5, 0x6037, 0xCEBF, 0x6039, 0xCEC0, 0x6040, 0xCECA, 0x6041, 0xD1A1, 0x6042, 0xCECB, 0x6043, 0xABEE, + 0x6044, 0xCECE, 0x6045, 0xCEC4, 0x6046, 0xABED, 0x6047, 0xCEC6, 0x6049, 0xCEC7, 0x604C, 0xCEC9, 0x604D, 0xABE9, 0x6050, 0xAEA3, + 0x6052, 0xF9DA, 0x6053, 0xCEC5, 0x6054, 0xCEC1, 0x6055, 0xAEA4, 0x6058, 0xCECF, 0x6059, 0xAE7E, 0x605A, 0xD17D, 0x605B, 0xCEC8, + 0x605D, 0xD17C, 0x605E, 0xCEC3, 0x605F, 0xCECC, 0x6062, 0xABEC, 0x6063, 0xAEA1, 0x6064, 0xABF2, 0x6065, 0xAEA2, 0x6066, 0xCED0, + 0x6067, 0xD17E, 0x6068, 0xABEB, 0x6069, 0xAEA6, 0x606A, 0xABF1, 0x606B, 0xABF0, 0x606C, 0xABEF, 0x606D, 0xAEA5, 0x606E, 0xCED1, + 0x606F, 0xAEA7, 0x6070, 0xABEA, 0x6072, 0xCEC2, 0x607F, 0xB176, 0x6080, 0xD1A4, 0x6081, 0xD1A6, 0x6083, 0xD1A8, 0x6084, 0xAEA8, + 0x6085, 0xAEAE, 0x6086, 0xD553, 0x6087, 0xD1AC, 0x6088, 0xD1A3, 0x6089, 0xB178, 0x608A, 0xD551, 0x608C, 0xAEAD, 0x608D, 0xAEAB, + 0x608E, 0xD1AE, 0x6090, 0xD552, 0x6092, 0xD1A5, 0x6094, 0xAEAC, 0x6095, 0xD1A9, 0x6096, 0xAEAF, 0x6097, 0xD1AB, 0x609A, 0xAEAA, + 0x609B, 0xD1AA, 0x609C, 0xD1AD, 0x609D, 0xD1A7, 0x609F, 0xAEA9, 0x60A0, 0xB179, 0x60A2, 0xD1A2, 0x60A3, 0xB177, 0x60A8, 0xB17A, + 0x60B0, 0xD555, 0x60B1, 0xD55E, 0x60B2, 0xB464, 0x60B4, 0xB17C, 0x60B5, 0xB1A3, 0x60B6, 0xB465, 0x60B7, 0xD560, 0x60B8, 0xB1AA, + 0x60B9, 0xD8F9, 0x60BA, 0xD556, 0x60BB, 0xB1A2, 0x60BC, 0xB1A5, 0x60BD, 0xB17E, 0x60BE, 0xD554, 0x60BF, 0xD562, 0x60C0, 0xD565, + 0x60C1, 0xD949, 0x60C3, 0xD563, 0x60C4, 0xD8FD, 0x60C5, 0xB1A1, 0x60C6, 0xB1A8, 0x60C7, 0xB1AC, 0x60C8, 0xD55D, 0x60C9, 0xD8F8, + 0x60CA, 0xD561, 0x60CB, 0xB17B, 0x60CC, 0xD8FA, 0x60CD, 0xD564, 0x60CE, 0xD8FC, 0x60CF, 0xD559, 0x60D1, 0xB462, 0x60D3, 0xD557, + 0x60D4, 0xD558, 0x60D5, 0xB1A7, 0x60D8, 0xB1A6, 0x60D9, 0xD55B, 0x60DA, 0xB1AB, 0x60DB, 0xD55F, 0x60DC, 0xB1A4, 0x60DD, 0xD55C, + 0x60DF, 0xB1A9, 0x60E0, 0xB466, 0x60E1, 0xB463, 0x60E2, 0xD8FB, 0x60E4, 0xD55A, 0x60E6, 0xB17D, 0x60F0, 0xB46B, 0x60F1, 0xB46F, + 0x60F2, 0xD940, 0x60F3, 0xB751, 0x60F4, 0xB46D, 0x60F5, 0xD944, 0x60F6, 0xB471, 0x60F7, 0xDD65, 0x60F8, 0xD946, 0x60F9, 0xB753, + 0x60FA, 0xB469, 0x60FB, 0xB46C, 0x60FC, 0xD947, 0x60FE, 0xD948, 0x60FF, 0xD94E, 0x6100, 0xB473, 0x6101, 0xB754, 0x6103, 0xD94A, + 0x6104, 0xD94F, 0x6105, 0xD943, 0x6106, 0xB75E, 0x6108, 0xB755, 0x6109, 0xB472, 0x610A, 0xD941, 0x610B, 0xD950, 0x610D, 0xB75D, + 0x610E, 0xB470, 0x610F, 0xB74E, 0x6110, 0xD94D, 0x6112, 0xB474, 0x6113, 0xD945, 0x6114, 0xD8FE, 0x6115, 0xB46A, 0x6116, 0xD942, + 0x6118, 0xD94B, 0x611A, 0xB74D, 0x611B, 0xB752, 0x611C, 0xB467, 0x611D, 0xD94C, 0x611F, 0xB750, 0x6123, 0xB468, 0x6127, 0xB75C, + 0x6128, 0xE1C3, 0x6129, 0xDD70, 0x612B, 0xDD68, 0x612C, 0xE1C2, 0x612E, 0xDD6C, 0x612F, 0xDD6E, 0x6132, 0xDD6B, 0x6134, 0xB75B, + 0x6136, 0xDD6A, 0x6137, 0xB75F, 0x613B, 0xE1D2, 0x613E, 0xB75A, 0x613F, 0xBA40, 0x6140, 0xDD71, 0x6141, 0xE1C4, 0x6144, 0xB758, + 0x6145, 0xDD69, 0x6146, 0xDD6D, 0x6147, 0xB9FE, 0x6148, 0xB74F, 0x6149, 0xDD66, 0x614A, 0xDD67, 0x614B, 0xBA41, 0x614C, 0xB757, + 0x614D, 0xB759, 0x614E, 0xB756, 0x614F, 0xDD6F, 0x6152, 0xE1C8, 0x6153, 0xE1C9, 0x6154, 0xE1CE, 0x6155, 0xBC7D, 0x6156, 0xE1D5, + 0x6158, 0xBA47, 0x615A, 0xBA46, 0x615B, 0xE1D0, 0x615D, 0xBC7C, 0x615E, 0xE1C5, 0x615F, 0xBA45, 0x6161, 0xE1D4, 0x6162, 0xBA43, + 0x6163, 0xBA44, 0x6165, 0xE1D1, 0x6166, 0xE5AA, 0x6167, 0xBC7A, 0x6168, 0xB46E, 0x616A, 0xE1D3, 0x616B, 0xBCA3, 0x616C, 0xE1CB, + 0x616E, 0xBC7B, 0x6170, 0xBCA2, 0x6171, 0xE1C6, 0x6172, 0xE1CA, 0x6173, 0xE1C7, 0x6174, 0xE1CD, 0x6175, 0xBA48, 0x6176, 0xBC79, + 0x6177, 0xBA42, 0x6179, 0xE57A, 0x617A, 0xE1CF, 0x617C, 0xBCA1, 0x617E, 0xBCA4, 0x6180, 0xE1CC, 0x6182, 0xBC7E, 0x6183, 0xE579, + 0x6189, 0xE57E, 0x618A, 0xBECE, 0x618B, 0xE578, 0x618C, 0xE9A3, 0x618D, 0xE5A9, 0x618E, 0xBCA8, 0x6190, 0xBCA6, 0x6191, 0xBECC, + 0x6192, 0xE5A6, 0x6193, 0xE5A2, 0x6194, 0xBCAC, 0x6196, 0xE978, 0x619A, 0xBCAA, 0x619B, 0xE5A1, 0x619D, 0xE976, 0x619F, 0xE5A5, + 0x61A1, 0xE5A8, 0x61A2, 0xE57D, 0x61A4, 0xBCAB, 0x61A7, 0xBCA5, 0x61A8, 0xE977, 0x61A9, 0xBECD, 0x61AA, 0xE5A7, 0x61AB, 0xBCA7, + 0x61AC, 0xBCA9, 0x61AD, 0xE5A4, 0x61AE, 0xBCAD, 0x61AF, 0xE5A3, 0x61B0, 0xE57C, 0x61B1, 0xE57B, 0x61B2, 0xBECB, 0x61B3, 0xE5AB, + 0x61B4, 0xE97A, 0x61B5, 0xECE0, 0x61B6, 0xBED0, 0x61B8, 0xE9A2, 0x61BA, 0xE97E, 0x61BC, 0xECE1, 0x61BE, 0xBED1, 0x61BF, 0xE9A1, + 0x61C1, 0xE97C, 0x61C2, 0xC0B4, 0x61C3, 0xECDF, 0x61C5, 0xE979, 0x61C6, 0xE97B, 0x61C7, 0xC0B5, 0x61C8, 0xBED3, 0x61C9, 0xC0B3, + 0x61CA, 0xBED2, 0x61CB, 0xC0B7, 0x61CC, 0xE97D, 0x61CD, 0xBECF, 0x61D6, 0xEFCF, 0x61D8, 0xEFC7, 0x61DE, 0xECE7, 0x61DF, 0xEFC8, + 0x61E0, 0xECE3, 0x61E3, 0xC256, 0x61E4, 0xECE5, 0x61E5, 0xECE4, 0x61E6, 0xC0B6, 0x61E7, 0xECE2, 0x61E8, 0xECE6, 0x61E9, 0xEFD0, + 0x61EA, 0xEFCC, 0x61EB, 0xEFCE, 0x61ED, 0xEFC9, 0x61EE, 0xEFCA, 0x61F0, 0xEFCD, 0x61F1, 0xEFCB, 0x61F2, 0xC367, 0x61F5, 0xC36A, + 0x61F6, 0xC369, 0x61F7, 0xC368, 0x61F8, 0xC461, 0x61F9, 0xF44A, 0x61FA, 0xC462, 0x61FB, 0xF241, 0x61FC, 0xC4DF, 0x61FD, 0xF5CC, + 0x61FE, 0xC4E0, 0x61FF, 0xC574, 0x6200, 0xC5CA, 0x6201, 0xF7D9, 0x6203, 0xF7DA, 0x6204, 0xF7DB, 0x6207, 0xF9BA, 0x6208, 0xA4E0, + 0x6209, 0xC97C, 0x620A, 0xA5B3, 0x620C, 0xA6A6, 0x620D, 0xA6A7, 0x620E, 0xA6A5, 0x6210, 0xA6A8, 0x6211, 0xA7DA, 0x6212, 0xA7D9, + 0x6214, 0xCCB1, 0x6215, 0xA9CF, 0x6216, 0xA9CE, 0x6219, 0xD1AF, 0x621A, 0xB1AD, 0x621B, 0xB1AE, 0x621F, 0xB475, 0x6220, 0xDD72, + 0x6221, 0xB760, 0x6222, 0xB761, 0x6223, 0xDD74, 0x6224, 0xDD76, 0x6225, 0xDD75, 0x6227, 0xE1D7, 0x6229, 0xE1D6, 0x622A, 0xBA49, + 0x622B, 0xE1D8, 0x622D, 0xE5AC, 0x622E, 0xBCAE, 0x6230, 0xBED4, 0x6232, 0xC0B8, 0x6233, 0xC257, 0x6234, 0xC0B9, 0x6236, 0xA4E1, + 0x623A, 0xCAE6, 0x623D, 0xCCB2, 0x623E, 0xA9D1, 0x623F, 0xA9D0, 0x6240, 0xA9D2, 0x6241, 0xABF3, 0x6242, 0xCED2, 0x6243, 0xCED3, + 0x6246, 0xD1B0, 0x6247, 0xAEB0, 0x6248, 0xB1AF, 0x6249, 0xB476, 0x624A, 0xD951, 0x624B, 0xA4E2, 0x624D, 0xA47E, 0x624E, 0xA4E3, + 0x6250, 0xC97D, 0x6251, 0xA5B7, 0x6252, 0xA5B6, 0x6253, 0xA5B4, 0x6254, 0xA5B5, 0x6258, 0xA6AB, 0x6259, 0xC9E9, 0x625A, 0xC9EB, + 0x625B, 0xA6AA, 0x625C, 0xC9E3, 0x625E, 0xC9E4, 0x6260, 0xC9EA, 0x6261, 0xC9E6, 0x6262, 0xC9E8, 0x6263, 0xA6A9, 0x6264, 0xC9E5, + 0x6265, 0xC9EC, 0x6266, 0xC9E7, 0x626D, 0xA7E1, 0x626E, 0xA7EA, 0x626F, 0xA7E8, 0x6270, 0xCAF0, 0x6271, 0xCAED, 0x6272, 0xCAF5, + 0x6273, 0xA7E6, 0x6274, 0xCAF6, 0x6276, 0xA7DF, 0x6277, 0xCAF3, 0x6279, 0xA7E5, 0x627A, 0xCAEF, 0x627B, 0xCAEE, 0x627C, 0xA7E3, + 0x627D, 0xCAF4, 0x627E, 0xA7E4, 0x627F, 0xA9D3, 0x6280, 0xA7DE, 0x6281, 0xCAF1, 0x6283, 0xCAE7, 0x6284, 0xA7DB, 0x6286, 0xA7EE, + 0x6287, 0xCAEC, 0x6288, 0xCAF2, 0x6289, 0xA7E0, 0x628A, 0xA7E2, 0x628C, 0xCAE8, 0x628E, 0xCAE9, 0x628F, 0xCAEA, 0x6291, 0xA7ED, + 0x6292, 0xA7E7, 0x6293, 0xA7EC, 0x6294, 0xCAEB, 0x6295, 0xA7EB, 0x6296, 0xA7DD, 0x6297, 0xA7DC, 0x6298, 0xA7E9, 0x62A8, 0xA9E1, + 0x62A9, 0xCCBE, 0x62AA, 0xCCB7, 0x62AB, 0xA9DC, 0x62AC, 0xA9EF, 0x62AD, 0xCCB3, 0x62AE, 0xCCBA, 0x62AF, 0xCCBC, 0x62B0, 0xCCBF, + 0x62B1, 0xA9EA, 0x62B3, 0xCCBB, 0x62B4, 0xCCB4, 0x62B5, 0xA9E8, 0x62B6, 0xCCB8, 0x62B8, 0xCCC0, 0x62B9, 0xA9D9, 0x62BB, 0xCCBD, + 0x62BC, 0xA9E3, 0x62BD, 0xA9E2, 0x62BE, 0xCCB6, 0x62BF, 0xA9D7, 0x62C2, 0xA9D8, 0x62C4, 0xA9D6, 0x62C6, 0xA9EE, 0x62C7, 0xA9E6, + 0x62C8, 0xA9E0, 0x62C9, 0xA9D4, 0x62CA, 0xCCB9, 0x62CB, 0xA9DF, 0x62CC, 0xA9D5, 0x62CD, 0xA9E7, 0x62CE, 0xA9F0, 0x62CF, 0xCED4, + 0x62D0, 0xA9E4, 0x62D1, 0xCCB5, 0x62D2, 0xA9DA, 0x62D3, 0xA9DD, 0x62D4, 0xA9DE, 0x62D6, 0xA9EC, 0x62D7, 0xA9ED, 0x62D8, 0xA9EB, + 0x62D9, 0xA9E5, 0x62DA, 0xA9E9, 0x62DB, 0xA9DB, 0x62DC, 0xABF4, 0x62EB, 0xCEDA, 0x62EC, 0xAC41, 0x62ED, 0xABF8, 0x62EE, 0xABFA, + 0x62EF, 0xAC40, 0x62F0, 0xCEE6, 0x62F1, 0xABFD, 0x62F2, 0xD1B1, 0x62F3, 0xAEB1, 0x62F4, 0xAC43, 0x62F5, 0xCED7, 0x62F6, 0xCEDF, + 0x62F7, 0xABFE, 0x62F8, 0xCEDE, 0x62F9, 0xCEDB, 0x62FA, 0xCEE3, 0x62FB, 0xCEE5, 0x62FC, 0xABF7, 0x62FD, 0xABFB, 0x62FE, 0xAC42, + 0x62FF, 0xAEB3, 0x6300, 0xCEE0, 0x6301, 0xABF9, 0x6302, 0xAC45, 0x6303, 0xCED9, 0x6307, 0xABFC, 0x6308, 0xAEB2, 0x6309, 0xABF6, + 0x630B, 0xCED6, 0x630C, 0xCEDD, 0x630D, 0xCED5, 0x630E, 0xCED8, 0x630F, 0xCEDC, 0x6310, 0xD1B2, 0x6311, 0xAC44, 0x6313, 0xCEE1, + 0x6314, 0xCEE2, 0x6315, 0xCEE4, 0x6316, 0xABF5, 0x6328, 0xAEC1, 0x6329, 0xD1BE, 0x632A, 0xAEBF, 0x632B, 0xAEC0, 0x632C, 0xD1B4, + 0x632D, 0xD1C4, 0x632F, 0xAEB6, 0x6332, 0xD566, 0x6333, 0xD1C6, 0x6334, 0xD1C0, 0x6336, 0xD1B7, 0x6338, 0xD1C9, 0x6339, 0xD1BA, + 0x633A, 0xAEBC, 0x633B, 0xD57D, 0x633C, 0xD1BD, 0x633D, 0xAEBE, 0x633E, 0xAEB5, 0x6340, 0xD1CB, 0x6341, 0xD1BF, 0x6342, 0xAEB8, + 0x6343, 0xD1B8, 0x6344, 0xD1B5, 0x6345, 0xD1B6, 0x6346, 0xAEB9, 0x6347, 0xD1C5, 0x6348, 0xD1CC, 0x6349, 0xAEBB, 0x634A, 0xD1BC, + 0x634B, 0xD1BB, 0x634C, 0xAEC3, 0x634D, 0xAEC2, 0x634E, 0xAEB4, 0x634F, 0xAEBA, 0x6350, 0xAEBD, 0x6351, 0xD1C8, 0x6354, 0xD1C2, + 0x6355, 0xAEB7, 0x6356, 0xD1B3, 0x6357, 0xD1CA, 0x6358, 0xD1C1, 0x6359, 0xD1C3, 0x635A, 0xD1C7, 0x6365, 0xD567, 0x6367, 0xB1B7, + 0x6368, 0xB1CB, 0x6369, 0xB1CA, 0x636B, 0xB1BF, 0x636D, 0xD579, 0x636E, 0xD575, 0x636F, 0xD572, 0x6370, 0xD5A6, 0x6371, 0xB1BA, + 0x6372, 0xB1B2, 0x6375, 0xD577, 0x6376, 0xB4A8, 0x6377, 0xB1B6, 0x6378, 0xD5A1, 0x637A, 0xB1CC, 0x637B, 0xB1C9, 0x637C, 0xD57B, + 0x637D, 0xD56A, 0x6380, 0xB1C8, 0x6381, 0xD5A3, 0x6382, 0xD569, 0x6383, 0xB1BD, 0x6384, 0xB1C1, 0x6385, 0xD5A2, 0x6387, 0xD573, + 0x6388, 0xB1C2, 0x6389, 0xB1BC, 0x638A, 0xD568, 0x638C, 0xB478, 0x638D, 0xD5A5, 0x638E, 0xD571, 0x638F, 0xB1C7, 0x6390, 0xD574, + 0x6391, 0xD5A4, 0x6392, 0xB1C6, 0x6394, 0xD952, 0x6396, 0xB1B3, 0x6397, 0xD56F, 0x6398, 0xB1B8, 0x6399, 0xB1C3, 0x639B, 0xB1BE, + 0x639C, 0xD578, 0x639D, 0xD56E, 0x639E, 0xD56C, 0x639F, 0xD57E, 0x63A0, 0xB1B0, 0x63A1, 0xB1C4, 0x63A2, 0xB1B4, 0x63A3, 0xB477, + 0x63A4, 0xD57C, 0x63A5, 0xB1B5, 0x63A7, 0xB1B1, 0x63A8, 0xB1C0, 0x63A9, 0xB1BB, 0x63AA, 0xB1B9, 0x63AB, 0xD570, 0x63AC, 0xB1C5, + 0x63AD, 0xD56D, 0x63AE, 0xD57A, 0x63AF, 0xD576, 0x63B0, 0xD954, 0x63B1, 0xD953, 0x63BD, 0xD56B, 0x63BE, 0xD964, 0x63C0, 0xB47A, + 0x63C2, 0xD96A, 0x63C3, 0xD959, 0x63C4, 0xD967, 0x63C5, 0xDD77, 0x63C6, 0xB47D, 0x63C7, 0xD96B, 0x63C8, 0xD96E, 0x63C9, 0xB47C, + 0x63CA, 0xD95C, 0x63CB, 0xD96D, 0x63CC, 0xD96C, 0x63CD, 0xB47E, 0x63CE, 0xD955, 0x63CF, 0xB479, 0x63D0, 0xB4A3, 0x63D2, 0xB4A1, + 0x63D3, 0xD969, 0x63D5, 0xD95F, 0x63D6, 0xB4A5, 0x63D7, 0xD970, 0x63D8, 0xD968, 0x63D9, 0xD971, 0x63DA, 0xB4AD, 0x63DB, 0xB4AB, + 0x63DC, 0xD966, 0x63DD, 0xD965, 0x63DF, 0xD963, 0x63E0, 0xD95D, 0x63E1, 0xB4A4, 0x63E3, 0xB4A2, 0x63E4, 0xD1B9, 0x63E5, 0xD956, + 0x63E7, 0xDDB7, 0x63E8, 0xD957, 0x63E9, 0xB47B, 0x63EA, 0xB4AA, 0x63EB, 0xDD79, 0x63ED, 0xB4A6, 0x63EE, 0xB4A7, 0x63EF, 0xD958, + 0x63F0, 0xD96F, 0x63F1, 0xDD78, 0x63F2, 0xD960, 0x63F3, 0xD95B, 0x63F4, 0xB4A9, 0x63F5, 0xD961, 0x63F6, 0xD95E, 0x63F9, 0xB4AE, + 0x6406, 0xB770, 0x6409, 0xDD7C, 0x640A, 0xDDB1, 0x640B, 0xDDB6, 0x640C, 0xDDAA, 0x640D, 0xB76C, 0x640E, 0xDDBB, 0x640F, 0xB769, + 0x6410, 0xDD7A, 0x6412, 0xDD7B, 0x6413, 0xB762, 0x6414, 0xB76B, 0x6415, 0xDDA4, 0x6416, 0xB76E, 0x6417, 0xB76F, 0x6418, 0xDDA5, + 0x641A, 0xDDB2, 0x641B, 0xDDB8, 0x641C, 0xB76A, 0x641E, 0xB764, 0x641F, 0xDDA3, 0x6420, 0xDD7D, 0x6421, 0xDDBA, 0x6422, 0xDDA8, + 0x6423, 0xDDA9, 0x6424, 0xDD7E, 0x6425, 0xDDB4, 0x6426, 0xDDAB, 0x6427, 0xDDB5, 0x6428, 0xDDAD, 0x642A, 0xB765, 0x642B, 0xE1D9, + 0x642C, 0xB768, 0x642D, 0xB766, 0x642E, 0xDDB9, 0x642F, 0xDDB0, 0x6430, 0xDDAC, 0x6433, 0xDDA1, 0x6434, 0xBA53, 0x6435, 0xDDAF, + 0x6436, 0xB76D, 0x6437, 0xDDA7, 0x6439, 0xDDA6, 0x643D, 0xB767, 0x643E, 0xB763, 0x643F, 0xE1EE, 0x6440, 0xDDB3, 0x6441, 0xDDAE, + 0x6443, 0xDDA2, 0x644B, 0xE1E9, 0x644D, 0xE1DA, 0x644E, 0xE1E5, 0x6450, 0xE1EC, 0x6451, 0xBA51, 0x6452, 0xB4AC, 0x6453, 0xE1EA, + 0x6454, 0xBA4C, 0x6458, 0xBA4B, 0x6459, 0xE1F1, 0x645B, 0xE1DB, 0x645C, 0xE1E8, 0x645D, 0xE1DC, 0x645E, 0xE1E7, 0x645F, 0xBA4F, + 0x6460, 0xE1EB, 0x6461, 0xD962, 0x6465, 0xE1F2, 0x6466, 0xE1E3, 0x6467, 0xBA52, 0x6468, 0xE5BA, 0x6469, 0xBCAF, 0x646B, 0xE1F0, + 0x646C, 0xE1EF, 0x646D, 0xBA54, 0x646E, 0xE5AD, 0x646F, 0xBCB0, 0x6470, 0xE5AE, 0x6472, 0xE1DF, 0x6473, 0xE1E0, 0x6474, 0xE1DD, + 0x6475, 0xE1E2, 0x6476, 0xE1DE, 0x6477, 0xE1F3, 0x6478, 0xBA4E, 0x6479, 0xBCB1, 0x647A, 0xBA50, 0x647B, 0xBA55, 0x647D, 0xE1E1, + 0x647F, 0xE1ED, 0x6482, 0xE1E6, 0x6485, 0xE5B1, 0x6487, 0xBA4A, 0x6488, 0xBCB4, 0x6489, 0xE9AA, 0x648A, 0xE5B6, 0x648B, 0xE5B5, + 0x648C, 0xE5B7, 0x648F, 0xE5B4, 0x6490, 0xBCB5, 0x6492, 0xBCBB, 0x6493, 0xBCB8, 0x6495, 0xBCB9, 0x6496, 0xE5AF, 0x6497, 0xE5B2, + 0x6498, 0xE5BC, 0x6499, 0xBCC1, 0x649A, 0xBCBF, 0x649C, 0xE5B3, 0x649D, 0xD95A, 0x649E, 0xBCB2, 0x649F, 0xE5B9, 0x64A0, 0xE5B0, + 0x64A2, 0xBCC2, 0x64A3, 0xE5B8, 0x64A4, 0xBA4D, 0x64A5, 0xBCB7, 0x64A6, 0xE1E4, 0x64A9, 0xBCBA, 0x64AB, 0xBCBE, 0x64AC, 0xBCC0, + 0x64AD, 0xBCBD, 0x64AE, 0xBCBC, 0x64B0, 0xBCB6, 0x64B1, 0xE5BB, 0x64B2, 0xBCB3, 0x64B3, 0xBCC3, 0x64BB, 0xBED8, 0x64BC, 0xBED9, + 0x64BD, 0xE9A9, 0x64BE, 0xBEE2, 0x64BF, 0xBEDF, 0x64C1, 0xBED6, 0x64C2, 0xBEDD, 0x64C3, 0xE9AB, 0x64C4, 0xBEDB, 0x64C5, 0xBED5, + 0x64C7, 0xBEDC, 0x64C9, 0xE9A8, 0x64CA, 0xC0BB, 0x64CB, 0xBED7, 0x64CD, 0xBEDE, 0x64CE, 0xC0BA, 0x64CF, 0xE9A7, 0x64D0, 0xE9A6, + 0x64D2, 0xBEE0, 0x64D4, 0xBEE1, 0x64D6, 0xE9A5, 0x64D7, 0xE9A4, 0x64D8, 0xC0BC, 0x64D9, 0xE9AE, 0x64DA, 0xBEDA, 0x64DB, 0xE9AC, + 0x64E0, 0xC0BD, 0x64E2, 0xC0C2, 0x64E3, 0xECEA, 0x64E4, 0xECEC, 0x64E6, 0xC0BF, 0x64E8, 0xECED, 0x64E9, 0xECE9, 0x64EB, 0xECEB, + 0x64EC, 0xC0C0, 0x64ED, 0xC0C3, 0x64EF, 0xECE8, 0x64F0, 0xC0BE, 0x64F1, 0xC0C1, 0x64F2, 0xC259, 0x64F3, 0xE9AD, 0x64F4, 0xC258, + 0x64F7, 0xC25E, 0x64F8, 0xEFD4, 0x64FA, 0xC25C, 0x64FB, 0xC25D, 0x64FC, 0xEFD7, 0x64FD, 0xEFD3, 0x64FE, 0xC25A, 0x64FF, 0xEFD1, + 0x6500, 0xC36B, 0x6501, 0xEFD5, 0x6503, 0xEFD6, 0x6504, 0xEFD2, 0x6506, 0xC25B, 0x6507, 0xF242, 0x6509, 0xF245, 0x650C, 0xF246, + 0x650D, 0xF244, 0x650E, 0xF247, 0x650F, 0xC36C, 0x6510, 0xF243, 0x6513, 0xF44E, 0x6514, 0xC464, 0x6515, 0xF44D, 0x6516, 0xF44C, + 0x6517, 0xF44B, 0x6518, 0xC463, 0x6519, 0xC465, 0x651B, 0xF5CD, 0x651C, 0xC4E2, 0x651D, 0xC4E1, 0x6520, 0xF6E1, 0x6521, 0xF6E0, + 0x6522, 0xF6E3, 0x6523, 0xC5CB, 0x6524, 0xC575, 0x6525, 0xF7DD, 0x6526, 0xF6E2, 0x6529, 0xF7DC, 0x652A, 0xC5CD, 0x652B, 0xC5CC, + 0x652C, 0xC5F3, 0x652D, 0xF8A9, 0x652E, 0xF8EF, 0x652F, 0xA4E4, 0x6532, 0xD972, 0x6533, 0xE9AF, 0x6536, 0xA6AC, 0x6537, 0xCAF7, + 0x6538, 0xA7F1, 0x6539, 0xA7EF, 0x653B, 0xA7F0, 0x653D, 0xCCC1, 0x653E, 0xA9F1, 0x653F, 0xAC46, 0x6541, 0xCEE7, 0x6543, 0xCEE8, + 0x6545, 0xAC47, 0x6546, 0xD1CE, 0x6548, 0xAEC4, 0x6549, 0xAEC5, 0x654A, 0xD1CD, 0x654F, 0xB1D3, 0x6551, 0xB1CF, 0x6553, 0xD5A7, + 0x6554, 0xB1D6, 0x6555, 0xB1D5, 0x6556, 0xB1CE, 0x6557, 0xB1D1, 0x6558, 0xB1D4, 0x6559, 0xB1D0, 0x655C, 0xD976, 0x655D, 0xB1CD, + 0x655E, 0xB4AF, 0x6562, 0xB4B1, 0x6563, 0xB4B2, 0x6564, 0xD975, 0x6565, 0xD978, 0x6566, 0xB4B0, 0x6567, 0xD973, 0x6568, 0xD977, + 0x656A, 0xD974, 0x656C, 0xB771, 0x656F, 0xDDBC, 0x6572, 0xBA56, 0x6573, 0xE1F4, 0x6574, 0xBEE3, 0x6575, 0xBCC4, 0x6576, 0xE5BD, + 0x6577, 0xBCC5, 0x6578, 0xBCC6, 0x6579, 0xE5BF, 0x657A, 0xE5BE, 0x657B, 0xE5C0, 0x657C, 0xE9B1, 0x657F, 0xE9B0, 0x6580, 0xECEF, + 0x6581, 0xECEE, 0x6582, 0xC0C4, 0x6583, 0xC0C5, 0x6584, 0xF248, 0x6587, 0xA4E5, 0x658C, 0xD979, 0x6590, 0xB4B4, 0x6591, 0xB4B3, + 0x6592, 0xDDBD, 0x6594, 0xEFD8, 0x6595, 0xC4E3, 0x6596, 0xF7DE, 0x6597, 0xA4E6, 0x6599, 0xAEC6, 0x659B, 0xB1D8, 0x659C, 0xB1D7, + 0x659D, 0xD97A, 0x659E, 0xD97B, 0x659F, 0xB772, 0x65A0, 0xE1F5, 0x65A1, 0xBA57, 0x65A2, 0xE9B2, 0x65A4, 0xA4E7, 0x65A5, 0xA5B8, + 0x65A7, 0xA9F2, 0x65A8, 0xCCC2, 0x65AA, 0xCEE9, 0x65AB, 0xAC48, 0x65AC, 0xB1D9, 0x65AE, 0xD97C, 0x65AF, 0xB4B5, 0x65B0, 0xB773, + 0x65B2, 0xE5C1, 0x65B3, 0xE5C2, 0x65B6, 0xECF0, 0x65B7, 0xC25F, 0x65B8, 0xF8F0, 0x65B9, 0xA4E8, 0x65BB, 0xCCC3, 0x65BC, 0xA9F3, + 0x65BD, 0xAC49, 0x65BF, 0xCEEA, 0x65C1, 0xAEC7, 0x65C2, 0xD1D2, 0x65C3, 0xD1D0, 0x65C4, 0xD1D1, 0x65C5, 0xAEC8, 0x65C6, 0xD1CF, + 0x65CB, 0xB1DB, 0x65CC, 0xB1DC, 0x65CD, 0xD5A8, 0x65CE, 0xB1DD, 0x65CF, 0xB1DA, 0x65D0, 0xD97D, 0x65D2, 0xD97E, 0x65D3, 0xDDBE, + 0x65D6, 0xBA59, 0x65D7, 0xBA58, 0x65DA, 0xECF1, 0x65DB, 0xEFD9, 0x65DD, 0xF24A, 0x65DE, 0xF249, 0x65DF, 0xF44F, 0x65E1, 0xC95E, + 0x65E2, 0xAC4A, 0x65E5, 0xA4E9, 0x65E6, 0xA5B9, 0x65E8, 0xA6AE, 0x65E9, 0xA6AD, 0x65EC, 0xA6AF, 0x65ED, 0xA6B0, 0x65EE, 0xC9EE, + 0x65EF, 0xC9ED, 0x65F0, 0xCAF8, 0x65F1, 0xA7F2, 0x65F2, 0xCAFB, 0x65F3, 0xCAFA, 0x65F4, 0xCAF9, 0x65F5, 0xCAFC, 0x65FA, 0xA9F4, + 0x65FB, 0xCCC9, 0x65FC, 0xCCC5, 0x65FD, 0xCCCE, 0x6600, 0xA9FB, 0x6602, 0xA9F9, 0x6603, 0xCCCA, 0x6604, 0xCCC6, 0x6605, 0xCCCD, + 0x6606, 0xA9F8, 0x6607, 0xAA40, 0x6608, 0xCCC8, 0x6609, 0xCCC4, 0x660A, 0xA9FE, 0x660B, 0xCCCB, 0x660C, 0xA9F7, 0x660D, 0xCCCC, + 0x660E, 0xA9FA, 0x660F, 0xA9FC, 0x6610, 0xCCD0, 0x6611, 0xCCCF, 0x6612, 0xCCC7, 0x6613, 0xA9F6, 0x6614, 0xA9F5, 0x6615, 0xA9FD, + 0x661C, 0xCEEF, 0x661D, 0xCEF5, 0x661F, 0xAC50, 0x6620, 0xAC4D, 0x6621, 0xCEEC, 0x6622, 0xCEF1, 0x6624, 0xAC53, 0x6625, 0xAC4B, + 0x6626, 0xCEF0, 0x6627, 0xAC4E, 0x6628, 0xAC51, 0x662B, 0xCEF3, 0x662D, 0xAC4C, 0x662E, 0xCEF8, 0x662F, 0xAC4F, 0x6631, 0xAC52, + 0x6632, 0xCEED, 0x6633, 0xCEF2, 0x6634, 0xCEF6, 0x6635, 0xCEEE, 0x6636, 0xCEEB, 0x6639, 0xCEF7, 0x663A, 0xCEF4, 0x6641, 0xAED0, + 0x6642, 0xAEC9, 0x6643, 0xAECC, 0x6645, 0xAECF, 0x6647, 0xD1D5, 0x6649, 0xAECA, 0x664A, 0xD1D3, 0x664C, 0xAECE, 0x664F, 0xAECB, + 0x6651, 0xD1D6, 0x6652, 0xAECD, 0x6659, 0xD5AC, 0x665A, 0xB1DF, 0x665B, 0xD5AB, 0x665C, 0xD5AD, 0x665D, 0xB1DE, 0x665E, 0xB1E3, + 0x665F, 0xD1D4, 0x6661, 0xD5AA, 0x6662, 0xD5AE, 0x6664, 0xB1E0, 0x6665, 0xD5A9, 0x6666, 0xB1E2, 0x6668, 0xB1E1, 0x666A, 0xD9A7, + 0x666C, 0xD9A2, 0x666E, 0xB4B6, 0x666F, 0xB4BA, 0x6670, 0xB4B7, 0x6671, 0xD9A5, 0x6672, 0xD9A8, 0x6674, 0xB4B8, 0x6676, 0xB4B9, + 0x6677, 0xB4BE, 0x6678, 0xDDC7, 0x6679, 0xD9A6, 0x667A, 0xB4BC, 0x667B, 0xD9A3, 0x667C, 0xD9A1, 0x667E, 0xB4BD, 0x6680, 0xD9A4, + 0x6684, 0xB779, 0x6686, 0xDDBF, 0x6687, 0xB776, 0x6688, 0xB777, 0x6689, 0xB775, 0x668A, 0xDDC4, 0x668B, 0xDDC3, 0x668C, 0xDDC0, + 0x668D, 0xB77B, 0x6690, 0xDDC2, 0x6691, 0xB4BB, 0x6694, 0xDDC6, 0x6695, 0xDDC1, 0x6696, 0xB778, 0x6697, 0xB774, 0x6698, 0xB77A, + 0x6699, 0xDDC5, 0x669D, 0xBA5C, 0x669F, 0xE1F8, 0x66A0, 0xE1F7, 0x66A1, 0xE1F6, 0x66A2, 0xBA5A, 0x66A8, 0xBA5B, 0x66A9, 0xE5C5, + 0x66AA, 0xE5C8, 0x66AB, 0xBCC8, 0x66AE, 0xBCC7, 0x66AF, 0xE5C9, 0x66B0, 0xE5C4, 0x66B1, 0xBCCA, 0x66B2, 0xE5C6, 0x66B4, 0xBCC9, + 0x66B5, 0xE5C3, 0x66B7, 0xE5C7, 0x66B8, 0xBEE9, 0x66B9, 0xBEE6, 0x66BA, 0xE9BB, 0x66BB, 0xE9BA, 0x66BD, 0xE9B9, 0x66BE, 0xE9B4, + 0x66C0, 0xE9B5, 0x66C4, 0xBEE7, 0x66C6, 0xBEE4, 0x66C7, 0xBEE8, 0x66C8, 0xE9B3, 0x66C9, 0xBEE5, 0x66CA, 0xE9B6, 0x66CB, 0xE9B7, + 0x66CC, 0xE9BC, 0x66CF, 0xE9B8, 0x66D2, 0xECF2, 0x66D6, 0xC0C7, 0x66D8, 0xEFDC, 0x66D9, 0xC0C6, 0x66DA, 0xEFDA, 0x66DB, 0xEFDB, + 0x66DC, 0xC260, 0x66DD, 0xC36E, 0x66DE, 0xF24B, 0x66E0, 0xC36D, 0x66E3, 0xF451, 0x66E4, 0xF452, 0x66E6, 0xC466, 0x66E8, 0xF450, + 0x66E9, 0xC4E4, 0x66EB, 0xF7DF, 0x66EC, 0xC5CE, 0x66ED, 0xF8AA, 0x66EE, 0xF8AB, 0x66F0, 0xA4EA, 0x66F2, 0xA6B1, 0x66F3, 0xA6B2, + 0x66F4, 0xA7F3, 0x66F6, 0xCCD1, 0x66F7, 0xAC54, 0x66F8, 0xAED1, 0x66F9, 0xB1E4, 0x66FC, 0xB0D2, 0x66FE, 0xB4BF, 0x66FF, 0xB4C0, + 0x6700, 0xB3CC, 0x6701, 0xD9A9, 0x6703, 0xB77C, 0x6704, 0xE1FA, 0x6705, 0xE1F9, 0x6708, 0xA4EB, 0x6709, 0xA6B3, 0x670A, 0xCCD2, + 0x670B, 0xAA42, 0x670D, 0xAA41, 0x670F, 0xCEF9, 0x6710, 0xCEFA, 0x6712, 0xD1D7, 0x6713, 0xD1D8, 0x6714, 0xAED2, 0x6715, 0xAED3, + 0x6717, 0xAED4, 0x6718, 0xD5AF, 0x671B, 0xB1E6, 0x671D, 0xB4C2, 0x671F, 0xB4C1, 0x6720, 0xDDC8, 0x6721, 0xDF7A, 0x6722, 0xE1FB, + 0x6723, 0xE9BD, 0x6726, 0xC261, 0x6727, 0xC467, 0x6728, 0xA4EC, 0x672A, 0xA5BC, 0x672B, 0xA5BD, 0x672C, 0xA5BB, 0x672D, 0xA5BE, + 0x672E, 0xA5BA, 0x6731, 0xA6B6, 0x6733, 0xC9F6, 0x6734, 0xA6B5, 0x6735, 0xA6B7, 0x6738, 0xC9F1, 0x6739, 0xC9F0, 0x673A, 0xC9F3, + 0x673B, 0xC9F2, 0x673C, 0xC9F5, 0x673D, 0xA6B4, 0x673E, 0xC9EF, 0x673F, 0xC9F4, 0x6745, 0xCAFD, 0x6746, 0xA7FD, 0x6747, 0xCAFE, + 0x6748, 0xCB43, 0x6749, 0xA7FC, 0x674B, 0xCB47, 0x674C, 0xCB42, 0x674D, 0xCB45, 0x674E, 0xA7F5, 0x674F, 0xA7F6, 0x6750, 0xA7F7, + 0x6751, 0xA7F8, 0x6753, 0xA840, 0x6755, 0xCB41, 0x6756, 0xA7FA, 0x6757, 0xA841, 0x6759, 0xCB40, 0x675A, 0xCB46, 0x675C, 0xA7F9, + 0x675D, 0xCB44, 0x675E, 0xA7FB, 0x675F, 0xA7F4, 0x6760, 0xA7FE, 0x676A, 0xAA57, 0x676C, 0xCCD4, 0x676D, 0xAA43, 0x676F, 0xAA4D, + 0x6770, 0xAA4E, 0x6771, 0xAA46, 0x6772, 0xAA58, 0x6773, 0xAA48, 0x6774, 0xCCDC, 0x6775, 0xAA53, 0x6776, 0xCCD7, 0x6777, 0xAA49, + 0x6778, 0xCCE6, 0x6779, 0xCCE7, 0x677A, 0xCCDF, 0x677B, 0xCCD8, 0x677C, 0xAA56, 0x677D, 0xCCE4, 0x677E, 0xAA51, 0x677F, 0xAA4F, + 0x6781, 0xCCE5, 0x6783, 0xCCE3, 0x6784, 0xCCDB, 0x6785, 0xCCD3, 0x6786, 0xCCDA, 0x6787, 0xAA4A, 0x6789, 0xAA50, 0x678B, 0xAA44, + 0x678C, 0xCCDE, 0x678D, 0xCCDD, 0x678E, 0xCCD5, 0x6790, 0xAA52, 0x6791, 0xCCE1, 0x6792, 0xCCD6, 0x6793, 0xAA55, 0x6794, 0xCCE8, + 0x6795, 0xAA45, 0x6797, 0xAA4C, 0x6798, 0xCCD9, 0x6799, 0xCCE2, 0x679A, 0xAA54, 0x679C, 0xAA47, 0x679D, 0xAA4B, 0x679F, 0xCCE0, + 0x67AE, 0xCF5B, 0x67AF, 0xAC5C, 0x67B0, 0xAC69, 0x67B2, 0xCF56, 0x67B3, 0xCF4C, 0x67B4, 0xAC62, 0x67B5, 0xCF4A, 0x67B6, 0xAC5B, + 0x67B7, 0xCF45, 0x67B8, 0xAC65, 0x67B9, 0xCF52, 0x67BA, 0xCEFE, 0x67BB, 0xCF41, 0x67C0, 0xCF44, 0x67C1, 0xCEFB, 0x67C2, 0xCF51, + 0x67C3, 0xCF61, 0x67C4, 0xAC60, 0x67C5, 0xCF46, 0x67C6, 0xCF58, 0x67C8, 0xCEFD, 0x67C9, 0xCF5F, 0x67CA, 0xCF60, 0x67CB, 0xCF63, + 0x67CC, 0xCF5A, 0x67CD, 0xCF4B, 0x67CE, 0xCF53, 0x67CF, 0xAC66, 0x67D0, 0xAC59, 0x67D1, 0xAC61, 0x67D2, 0xAC6D, 0x67D3, 0xAC56, + 0x67D4, 0xAC58, 0x67D8, 0xCF43, 0x67D9, 0xAC6A, 0x67DA, 0xAC63, 0x67DB, 0xCF5D, 0x67DC, 0xCF40, 0x67DD, 0xAC6C, 0x67DE, 0xAC67, + 0x67DF, 0xCF49, 0x67E2, 0xAC6B, 0x67E3, 0xCF50, 0x67E4, 0xCF48, 0x67E5, 0xAC64, 0x67E6, 0xCF5C, 0x67E7, 0xCF54, 0x67E9, 0xAC5E, + 0x67EA, 0xCF62, 0x67EB, 0xCF47, 0x67EC, 0xAC5A, 0x67ED, 0xCF59, 0x67EE, 0xCF4F, 0x67EF, 0xAC5F, 0x67F0, 0xCF55, 0x67F1, 0xAC57, + 0x67F2, 0xCEFC, 0x67F3, 0xAC68, 0x67F4, 0xAEE3, 0x67F5, 0xAC5D, 0x67F6, 0xCF4E, 0x67F7, 0xCF4D, 0x67F8, 0xCF42, 0x67FA, 0xCF5E, + 0x67FC, 0xCF57, 0x67FF, 0xAC55, 0x6812, 0xD1EC, 0x6813, 0xAEEA, 0x6814, 0xD1ED, 0x6816, 0xD1E1, 0x6817, 0xAEDF, 0x6818, 0xAEEB, + 0x681A, 0xD1DA, 0x681C, 0xD1E3, 0x681D, 0xD1EB, 0x681F, 0xD1D9, 0x6820, 0xD1F4, 0x6821, 0xAED5, 0x6825, 0xD1F3, 0x6826, 0xD1EE, + 0x6828, 0xD1EF, 0x6829, 0xAEDD, 0x682A, 0xAEE8, 0x682B, 0xD1E5, 0x682D, 0xD1E6, 0x682E, 0xD1F0, 0x682F, 0xD1E7, 0x6831, 0xD1E2, + 0x6832, 0xD1DC, 0x6833, 0xD1DD, 0x6834, 0xD1EA, 0x6835, 0xD1E4, 0x6838, 0xAED6, 0x6839, 0xAEDA, 0x683A, 0xD1F2, 0x683B, 0xD1DE, + 0x683C, 0xAEE6, 0x683D, 0xAEE2, 0x6840, 0xAEE5, 0x6841, 0xAEEC, 0x6842, 0xAEDB, 0x6843, 0xAEE7, 0x6844, 0xD1E9, 0x6845, 0xAEE9, + 0x6846, 0xAED8, 0x6848, 0xAED7, 0x6849, 0xD1DB, 0x684B, 0xD1DF, 0x684C, 0xAEE0, 0x684D, 0xD1F1, 0x684E, 0xD1E8, 0x684F, 0xD1E0, + 0x6850, 0xAEE4, 0x6851, 0xAEE1, 0x6853, 0xAED9, 0x6854, 0xAEDC, 0x686B, 0xD5C4, 0x686D, 0xD5B4, 0x686E, 0xD5B5, 0x686F, 0xD5B9, + 0x6871, 0xD5C8, 0x6872, 0xD5C5, 0x6874, 0xD5BE, 0x6875, 0xD5BD, 0x6876, 0xB1ED, 0x6877, 0xD5C1, 0x6878, 0xD5D0, 0x6879, 0xD5B0, + 0x687B, 0xD5D1, 0x687C, 0xD5C3, 0x687D, 0xD5D5, 0x687E, 0xD5C9, 0x687F, 0xB1EC, 0x6880, 0xD5C7, 0x6881, 0xB1E7, 0x6882, 0xB1FC, + 0x6883, 0xB1F2, 0x6885, 0xB1F6, 0x6886, 0xB1F5, 0x6887, 0xD5B1, 0x6889, 0xD5CE, 0x688A, 0xD5D4, 0x688B, 0xD5CC, 0x688C, 0xD5D3, + 0x688F, 0xD5C0, 0x6890, 0xD5B2, 0x6891, 0xD5D2, 0x6892, 0xD5C2, 0x6893, 0xB1EA, 0x6894, 0xB1F7, 0x6896, 0xD5CB, 0x6897, 0xB1F0, + 0x689B, 0xD5CA, 0x689C, 0xD5B3, 0x689D, 0xB1F8, 0x689F, 0xB1FA, 0x68A0, 0xD5CD, 0x68A1, 0xB1FB, 0x68A2, 0xB1E9, 0x68A3, 0xD5BA, + 0x68A4, 0xD5CF, 0x68A7, 0xB1EF, 0x68A8, 0xB1F9, 0x68A9, 0xD5BC, 0x68AA, 0xD5C6, 0x68AB, 0xD5B7, 0x68AC, 0xD5BB, 0x68AD, 0xB1F4, + 0x68AE, 0xD5B6, 0x68AF, 0xB1E8, 0x68B0, 0xB1F1, 0x68B1, 0xB1EE, 0x68B2, 0xD5BF, 0x68B3, 0xAEDE, 0x68B4, 0xD9C0, 0x68B5, 0xB1EB, + 0x68C4, 0xB1F3, 0x68C6, 0xD9C3, 0x68C7, 0xD9D9, 0x68C8, 0xD9CE, 0x68C9, 0xB4D6, 0x68CB, 0xB4D1, 0x68CC, 0xD9BD, 0x68CD, 0xB4D2, + 0x68CE, 0xD9CD, 0x68D0, 0xD9C6, 0x68D1, 0xD9D3, 0x68D2, 0xB4CE, 0x68D3, 0xD9AB, 0x68D4, 0xD9D5, 0x68D5, 0xB4C4, 0x68D6, 0xD9B3, + 0x68D7, 0xB4C7, 0x68D8, 0xB4C6, 0x68DA, 0xB4D7, 0x68DC, 0xD9AD, 0x68DD, 0xD9CF, 0x68DE, 0xD9D0, 0x68DF, 0xB4C9, 0x68E0, 0xB4C5, + 0x68E1, 0xD9BB, 0x68E3, 0xB4D0, 0x68E4, 0xD9B6, 0x68E6, 0xD9D1, 0x68E7, 0xB4CC, 0x68E8, 0xD9C9, 0x68E9, 0xD9D6, 0x68EA, 0xD9B0, + 0x68EB, 0xD9B5, 0x68EC, 0xD9AF, 0x68EE, 0xB4CB, 0x68EF, 0xD9C2, 0x68F0, 0xDDDE, 0x68F1, 0xD9B1, 0x68F2, 0xB4CF, 0x68F3, 0xD9BA, + 0x68F4, 0xD9D2, 0x68F5, 0xB4CA, 0x68F6, 0xD9B7, 0x68F7, 0xD9B4, 0x68F8, 0xD9C5, 0x68F9, 0xB4CD, 0x68FA, 0xB4C3, 0x68FB, 0xB4D9, + 0x68FC, 0xD9C8, 0x68FD, 0xD9C7, 0x6904, 0xD9AC, 0x6905, 0xB4C8, 0x6906, 0xD9D4, 0x6907, 0xD9BC, 0x6908, 0xD9BE, 0x690A, 0xD9CB, + 0x690B, 0xD9CA, 0x690C, 0xD9AA, 0x690D, 0xB4D3, 0x690E, 0xB4D5, 0x690F, 0xD9B2, 0x6910, 0xD9B9, 0x6911, 0xD9C1, 0x6912, 0xB4D4, + 0x6913, 0xD9B8, 0x6914, 0xD9C4, 0x6915, 0xD9D7, 0x6917, 0xD9CC, 0x6925, 0xD9D8, 0x692A, 0xD9AE, 0x692F, 0xDDF2, 0x6930, 0xB7A6, + 0x6932, 0xDDF0, 0x6933, 0xDDDB, 0x6934, 0xDDE0, 0x6935, 0xDDD9, 0x6937, 0xDDEC, 0x6938, 0xDDCB, 0x6939, 0xDDD2, 0x693B, 0xDDEA, + 0x693C, 0xDDF4, 0x693D, 0xDDDC, 0x693F, 0xDDCF, 0x6940, 0xDDE2, 0x6941, 0xDDE7, 0x6942, 0xDDD3, 0x6944, 0xDDE4, 0x6945, 0xDDD0, + 0x6948, 0xDDD7, 0x6949, 0xDDD8, 0x694A, 0xB7A8, 0x694B, 0xDDEB, 0x694C, 0xDDE9, 0x694E, 0xDDCC, 0x694F, 0xDDEE, 0x6951, 0xDDEF, + 0x6952, 0xDDF1, 0x6953, 0xB7AC, 0x6954, 0xB7A4, 0x6956, 0xD5B8, 0x6957, 0xDDD4, 0x6958, 0xDDE6, 0x6959, 0xDDD5, 0x695A, 0xB7A1, + 0x695B, 0xB7B1, 0x695C, 0xDDED, 0x695D, 0xB7AF, 0x695E, 0xB7AB, 0x695F, 0xDDCA, 0x6960, 0xB7A3, 0x6962, 0xDDCD, 0x6963, 0xB7B0, + 0x6965, 0xDDDD, 0x6966, 0xDDC9, 0x6968, 0xB7A9, 0x6969, 0xDDE1, 0x696A, 0xDDD1, 0x696B, 0xB7AA, 0x696C, 0xDDDA, 0x696D, 0xB77E, + 0x696E, 0xB4D8, 0x696F, 0xDDE3, 0x6970, 0xD9BF, 0x6971, 0xDDCE, 0x6974, 0xDDE8, 0x6975, 0xB7A5, 0x6976, 0xDDE5, 0x6977, 0xB7A2, + 0x6978, 0xDDDF, 0x6979, 0xB7AD, 0x697A, 0xDDD6, 0x697B, 0xDDF3, 0x6982, 0xB7A7, 0x6983, 0xDEC6, 0x6986, 0xB7AE, 0x698D, 0xE24A, + 0x698E, 0xE248, 0x6990, 0xE25E, 0x6991, 0xE246, 0x6993, 0xE258, 0x6994, 0xB77D, 0x6995, 0xBA5F, 0x6996, 0xE242, 0x6997, 0xE25D, + 0x6999, 0xE247, 0x699A, 0xE255, 0x699B, 0xBA64, 0x699C, 0xBA5D, 0x699E, 0xE25B, 0x69A0, 0xE240, 0x69A1, 0xE25A, 0x69A3, 0xBA6F, + 0x69A4, 0xE251, 0x69A5, 0xE261, 0x69A6, 0xBA6D, 0x69A7, 0xE249, 0x69A8, 0xBA5E, 0x69A9, 0xE24B, 0x69AA, 0xE259, 0x69AB, 0xBA67, + 0x69AC, 0xE244, 0x69AD, 0xBA6B, 0x69AE, 0xBA61, 0x69AF, 0xE24D, 0x69B0, 0xE243, 0x69B1, 0xE1FC, 0x69B3, 0xE257, 0x69B4, 0xBA68, + 0x69B5, 0xE260, 0x69B6, 0xE1FD, 0x69B7, 0xBA65, 0x69B9, 0xE253, 0x69BB, 0xBA66, 0x69BC, 0xE245, 0x69BD, 0xE250, 0x69BE, 0xE24C, + 0x69BF, 0xE24E, 0x69C1, 0xBA60, 0x69C2, 0xE25F, 0x69C3, 0xBA6E, 0x69C4, 0xE24F, 0x69C6, 0xE262, 0x69C9, 0xE1FE, 0x69CA, 0xE254, + 0x69CB, 0xBA63, 0x69CC, 0xBA6C, 0x69CD, 0xBA6A, 0x69CE, 0xE241, 0x69CF, 0xE256, 0x69D0, 0xBA69, 0x69D3, 0xBA62, 0x69D4, 0xE252, + 0x69D9, 0xE25C, 0x69E2, 0xE5D5, 0x69E4, 0xE5D1, 0x69E5, 0xE5CD, 0x69E6, 0xE5E1, 0x69E7, 0xE5DE, 0x69E8, 0xBCCD, 0x69EB, 0xE5E5, + 0x69EC, 0xE5D4, 0x69ED, 0xBCD8, 0x69EE, 0xE5DB, 0x69F1, 0xE5D0, 0x69F2, 0xE5DA, 0x69F3, 0xBCD5, 0x69F4, 0xE5EE, 0x69F6, 0xE5EB, + 0x69F7, 0xE5DD, 0x69F8, 0xE5CE, 0x69FB, 0xE5E2, 0x69FC, 0xE5E4, 0x69FD, 0xBCD1, 0x69FE, 0xE5D8, 0x69FF, 0xE5D3, 0x6A00, 0xE5CA, + 0x6A01, 0xBCCE, 0x6A02, 0xBCD6, 0x6A04, 0xE5E7, 0x6A05, 0xBCD7, 0x6A06, 0xE5CB, 0x6A07, 0xE5ED, 0x6A08, 0xE5E0, 0x6A09, 0xE5E6, + 0x6A0A, 0xBCD4, 0x6A0D, 0xE5E3, 0x6A0F, 0xE5EA, 0x6A11, 0xBCD9, 0x6A13, 0xBCD3, 0x6A14, 0xE5DC, 0x6A15, 0xE5CF, 0x6A16, 0xE5EF, + 0x6A17, 0xE5CC, 0x6A18, 0xE5E8, 0x6A19, 0xBCD0, 0x6A1B, 0xE5D6, 0x6A1D, 0xE5D7, 0x6A1E, 0xBCCF, 0x6A1F, 0xBCCC, 0x6A20, 0xE5D2, + 0x6A21, 0xBCD2, 0x6A23, 0xBCCB, 0x6A25, 0xE5E9, 0x6A26, 0xE5EC, 0x6A27, 0xE5D9, 0x6A28, 0xE9CA, 0x6A32, 0xE9C2, 0x6A34, 0xE9BE, + 0x6A35, 0xBEF6, 0x6A38, 0xBEEB, 0x6A39, 0xBEF0, 0x6A3A, 0xBEEC, 0x6A3B, 0xE9CC, 0x6A3C, 0xE9D7, 0x6A3D, 0xBEEA, 0x6A3E, 0xE9C4, + 0x6A3F, 0xE9CD, 0x6A40, 0xE5DF, 0x6A41, 0xE9CE, 0x6A44, 0xBEF1, 0x6A46, 0xE9DD, 0x6A47, 0xBEF5, 0x6A48, 0xBEF8, 0x6A49, 0xE9C0, + 0x6A4B, 0xBEF4, 0x6A4D, 0xE9DB, 0x6A4E, 0xE9DC, 0x6A4F, 0xE9D2, 0x6A50, 0xE9D1, 0x6A51, 0xE9C9, 0x6A54, 0xE9D3, 0x6A55, 0xE9DA, + 0x6A56, 0xE9D9, 0x6A58, 0xBEEF, 0x6A59, 0xBEED, 0x6A5A, 0xE9CB, 0x6A5B, 0xE9C8, 0x6A5D, 0xE9C5, 0x6A5E, 0xE9D8, 0x6A5F, 0xBEF7, + 0x6A60, 0xE9D6, 0x6A61, 0xBEF3, 0x6A62, 0xBEF2, 0x6A64, 0xE9D0, 0x6A66, 0xE9BF, 0x6A67, 0xE9C1, 0x6A68, 0xE9C3, 0x6A69, 0xE9D5, + 0x6A6A, 0xE9CF, 0x6A6B, 0xBEEE, 0x6A6D, 0xE9C6, 0x6A6F, 0xE9D4, 0x6A76, 0xE9C7, 0x6A7E, 0xC0CF, 0x6A7F, 0xED45, 0x6A80, 0xC0C8, + 0x6A81, 0xECF5, 0x6A83, 0xED41, 0x6A84, 0xC0CA, 0x6A85, 0xED48, 0x6A87, 0xECFC, 0x6A89, 0xECF7, 0x6A8C, 0xED49, 0x6A8D, 0xECF3, + 0x6A8E, 0xECFE, 0x6A90, 0xC0D1, 0x6A91, 0xED44, 0x6A92, 0xED4A, 0x6A93, 0xECFD, 0x6A94, 0xC0C9, 0x6A95, 0xED40, 0x6A96, 0xECF4, + 0x6A97, 0xC0D0, 0x6A9A, 0xED47, 0x6A9B, 0xECF9, 0x6A9C, 0xC0CC, 0x6A9E, 0xECFB, 0x6A9F, 0xECF8, 0x6AA0, 0xC0D2, 0x6AA1, 0xECFA, + 0x6AA2, 0xC0CB, 0x6AA3, 0xC0CE, 0x6AA4, 0xED43, 0x6AA5, 0xECF6, 0x6AA6, 0xED46, 0x6AA8, 0xED42, 0x6AAC, 0xC263, 0x6AAD, 0xEFE7, + 0x6AAE, 0xC268, 0x6AAF, 0xC269, 0x6AB3, 0xC262, 0x6AB4, 0xEFE6, 0x6AB6, 0xEFE3, 0x6AB7, 0xEFE4, 0x6AB8, 0xC266, 0x6AB9, 0xEFDE, + 0x6ABA, 0xEFE2, 0x6ABB, 0xC265, 0x6ABD, 0xEFDF, 0x6AC2, 0xC267, 0x6AC3, 0xC264, 0x6AC5, 0xEFDD, 0x6AC6, 0xEFE1, 0x6AC7, 0xEFE5, + 0x6ACB, 0xF251, 0x6ACC, 0xF24E, 0x6ACD, 0xF257, 0x6ACF, 0xF256, 0x6AD0, 0xF254, 0x6AD1, 0xF24F, 0x6AD3, 0xC372, 0x6AD9, 0xF250, + 0x6ADA, 0xC371, 0x6ADB, 0xC0CD, 0x6ADC, 0xF253, 0x6ADD, 0xC370, 0x6ADE, 0xF258, 0x6ADF, 0xF252, 0x6AE0, 0xF24D, 0x6AE1, 0xEFE0, + 0x6AE5, 0xC36F, 0x6AE7, 0xF24C, 0x6AE8, 0xF456, 0x6AEA, 0xF455, 0x6AEB, 0xF255, 0x6AEC, 0xC468, 0x6AEE, 0xF459, 0x6AEF, 0xF45A, + 0x6AF0, 0xF454, 0x6AF1, 0xF458, 0x6AF3, 0xF453, 0x6AF8, 0xF5D1, 0x6AF9, 0xF457, 0x6AFA, 0xC4E7, 0x6AFB, 0xC4E5, 0x6AFC, 0xF5CF, + 0x6B00, 0xF5D2, 0x6B02, 0xF5CE, 0x6B03, 0xF5D0, 0x6B04, 0xC4E6, 0x6B08, 0xF6E5, 0x6B09, 0xF6E6, 0x6B0A, 0xC576, 0x6B0B, 0xF6E4, + 0x6B0F, 0xF7E2, 0x6B10, 0xC5CF, 0x6B11, 0xF7E0, 0x6B12, 0xF7E1, 0x6B13, 0xF8AC, 0x6B16, 0xC656, 0x6B17, 0xF8F3, 0x6B18, 0xF8F1, + 0x6B19, 0xF8F2, 0x6B1A, 0xF8F4, 0x6B1E, 0xF9BB, 0x6B20, 0xA4ED, 0x6B21, 0xA6B8, 0x6B23, 0xAA59, 0x6B25, 0xCCE9, 0x6B28, 0xCF64, + 0x6B2C, 0xD1F5, 0x6B2D, 0xD1F7, 0x6B2F, 0xD1F6, 0x6B31, 0xD1F8, 0x6B32, 0xB1FD, 0x6B33, 0xD5D7, 0x6B34, 0xD1F9, 0x6B36, 0xD5D6, + 0x6B37, 0xD5D8, 0x6B38, 0xD5D9, 0x6B39, 0xD9DA, 0x6B3A, 0xB4DB, 0x6B3B, 0xD9DB, 0x6B3C, 0xD9DD, 0x6B3D, 0xB4DC, 0x6B3E, 0xB4DA, + 0x6B3F, 0xD9DC, 0x6B41, 0xDDFA, 0x6B42, 0xDDF8, 0x6B43, 0xDDF7, 0x6B45, 0xDDF6, 0x6B46, 0xDDF5, 0x6B47, 0xB7B2, 0x6B48, 0xDDF9, + 0x6B49, 0xBA70, 0x6B4A, 0xE263, 0x6B4B, 0xE265, 0x6B4C, 0xBA71, 0x6B4D, 0xE264, 0x6B4E, 0xBCDB, 0x6B50, 0xBCDA, 0x6B51, 0xE5F0, + 0x6B54, 0xE9DF, 0x6B55, 0xE9DE, 0x6B56, 0xE9E0, 0x6B59, 0xBEF9, 0x6B5B, 0xED4B, 0x6B5C, 0xC0D3, 0x6B5E, 0xEFE8, 0x6B5F, 0xC26A, + 0x6B60, 0xF259, 0x6B61, 0xC577, 0x6B62, 0xA4EE, 0x6B63, 0xA5BF, 0x6B64, 0xA6B9, 0x6B65, 0xA842, 0x6B66, 0xAA5A, 0x6B67, 0xAA5B, + 0x6B6A, 0xAC6E, 0x6B6D, 0xD1FA, 0x6B72, 0xB7B3, 0x6B76, 0xE6D1, 0x6B77, 0xBEFA, 0x6B78, 0xC26B, 0x6B79, 0xA4EF, 0x6B7B, 0xA6BA, + 0x6B7E, 0xCCEB, 0x6B7F, 0xAA5C, 0x6B80, 0xCCEA, 0x6B82, 0xCF65, 0x6B83, 0xAC6F, 0x6B84, 0xCF66, 0x6B86, 0xAC70, 0x6B88, 0xD1FC, + 0x6B89, 0xAEEE, 0x6B8A, 0xAEED, 0x6B8C, 0xD5DE, 0x6B8D, 0xD5DC, 0x6B8E, 0xD5DD, 0x6B8F, 0xD5DB, 0x6B91, 0xD5DA, 0x6B94, 0xD9DE, + 0x6B95, 0xD9E1, 0x6B96, 0xB4DE, 0x6B97, 0xD9DF, 0x6B98, 0xB4DD, 0x6B99, 0xD9E0, 0x6B9B, 0xDDFB, 0x6B9E, 0xE266, 0x6B9F, 0xE267, + 0x6BA0, 0xE268, 0x6BA2, 0xE5F3, 0x6BA3, 0xE5F2, 0x6BA4, 0xBCDC, 0x6BA5, 0xE5F1, 0x6BA6, 0xE5F4, 0x6BA7, 0xE9E1, 0x6BAA, 0xE9E2, + 0x6BAB, 0xE9E3, 0x6BAD, 0xED4C, 0x6BAE, 0xC0D4, 0x6BAF, 0xC26C, 0x6BB0, 0xF25A, 0x6BB2, 0xC4E8, 0x6BB3, 0xC95F, 0x6BB5, 0xAC71, + 0x6BB6, 0xCF67, 0x6BB7, 0xAEEF, 0x6BBA, 0xB1FE, 0x6BBC, 0xB4DF, 0x6BBD, 0xD9E2, 0x6BBF, 0xB7B5, 0x6BC0, 0xB7B4, 0x6BC3, 0xE269, + 0x6BC4, 0xE26A, 0x6BC5, 0xBCDD, 0x6BC6, 0xBCDE, 0x6BC7, 0xE9E5, 0x6BC8, 0xE9E4, 0x6BC9, 0xEFE9, 0x6BCA, 0xF7E3, 0x6BCB, 0xA4F0, + 0x6BCC, 0xC960, 0x6BCD, 0xA5C0, 0x6BCF, 0xA843, 0x6BD0, 0xCB48, 0x6BD2, 0xAC72, 0x6BD3, 0xB7B6, 0x6BD4, 0xA4F1, 0x6BD6, 0xCF68, + 0x6BD7, 0xAC73, 0x6BD8, 0xCF69, 0x6BDA, 0xC0D5, 0x6BDB, 0xA4F2, 0x6BDE, 0xCCEC, 0x6BE0, 0xCF6A, 0x6BE2, 0xD242, 0x6BE3, 0xD241, + 0x6BE4, 0xD1FE, 0x6BE6, 0xD1FD, 0x6BE7, 0xD243, 0x6BE8, 0xD240, 0x6BEB, 0xB240, 0x6BEC, 0xB241, 0x6BEF, 0xB4E0, 0x6BF0, 0xD9E3, + 0x6BF2, 0xD9E4, 0x6BF3, 0xD9E5, 0x6BF7, 0xDE41, 0x6BF8, 0xDE42, 0x6BF9, 0xDE40, 0x6BFB, 0xDDFD, 0x6BFC, 0xDDFE, 0x6BFD, 0xB7B7, + 0x6BFE, 0xE26B, 0x6BFF, 0xE5F7, 0x6C00, 0xE5F6, 0x6C01, 0xE5F5, 0x6C02, 0xE5F8, 0x6C03, 0xE9E7, 0x6C04, 0xE9E6, 0x6C05, 0xBEFB, + 0x6C06, 0xE9E8, 0x6C08, 0xC0D6, 0x6C09, 0xED4D, 0x6C0B, 0xEFEA, 0x6C0C, 0xF25B, 0x6C0D, 0xF6E7, 0x6C0F, 0xA4F3, 0x6C10, 0xA5C2, + 0x6C11, 0xA5C1, 0x6C13, 0xAA5D, 0x6C14, 0xC961, 0x6C15, 0xC97E, 0x6C16, 0xA6BB, 0x6C18, 0xC9F7, 0x6C19, 0xCB49, 0x6C1A, 0xCB4A, + 0x6C1B, 0xAA5E, 0x6C1D, 0xCCED, 0x6C1F, 0xAC74, 0x6C20, 0xCF6B, 0x6C21, 0xCF6C, 0x6C23, 0xAEF0, 0x6C24, 0xAEF4, 0x6C25, 0xD244, + 0x6C26, 0xAEF3, 0x6C27, 0xAEF1, 0x6C28, 0xAEF2, 0x6C2A, 0xD5DF, 0x6C2B, 0xB242, 0x6C2C, 0xB4E3, 0x6C2E, 0xB4E1, 0x6C2F, 0xB4E2, + 0x6C30, 0xD9E6, 0x6C33, 0xBA72, 0x6C34, 0xA4F4, 0x6C36, 0xC9A1, 0x6C38, 0xA5C3, 0x6C3B, 0xC9A4, 0x6C3E, 0xA5C6, 0x6C3F, 0xC9A3, + 0x6C40, 0xA5C5, 0x6C41, 0xA5C4, 0x6C42, 0xA844, 0x6C43, 0xC9A2, 0x6C46, 0xC9F8, 0x6C4A, 0xC9FC, 0x6C4B, 0xC9FE, 0x6C4C, 0xCA40, + 0x6C4D, 0xA6C5, 0x6C4E, 0xA6C6, 0x6C4F, 0xC9FB, 0x6C50, 0xA6C1, 0x6C52, 0xC9F9, 0x6C54, 0xC9FD, 0x6C55, 0xA6C2, 0x6C57, 0xA6BD, + 0x6C59, 0xA6BE, 0x6C5B, 0xA6C4, 0x6C5C, 0xC9FA, 0x6C5D, 0xA6BC, 0x6C5E, 0xA845, 0x6C5F, 0xA6BF, 0x6C60, 0xA6C0, 0x6C61, 0xA6C3, + 0x6C65, 0xCB5B, 0x6C66, 0xCB59, 0x6C67, 0xCB4C, 0x6C68, 0xA851, 0x6C69, 0xCB53, 0x6C6A, 0xA84C, 0x6C6B, 0xCB4D, 0x6C6D, 0xCB55, + 0x6C6F, 0xCB52, 0x6C70, 0xA84F, 0x6C71, 0xCB51, 0x6C72, 0xA856, 0x6C73, 0xCB5A, 0x6C74, 0xA858, 0x6C76, 0xA85A, 0x6C78, 0xCB4B, + 0x6C7A, 0xA84D, 0x6C7B, 0xCB5C, 0x6C7D, 0xA854, 0x6C7E, 0xA857, 0x6C80, 0xCD45, 0x6C81, 0xA847, 0x6C82, 0xA85E, 0x6C83, 0xA855, + 0x6C84, 0xCB4E, 0x6C85, 0xA84A, 0x6C86, 0xA859, 0x6C87, 0xCB56, 0x6C88, 0xA848, 0x6C89, 0xA849, 0x6C8A, 0xCD43, 0x6C8B, 0xCB4F, + 0x6C8C, 0xA850, 0x6C8D, 0xA85B, 0x6C8E, 0xCB5D, 0x6C8F, 0xCB50, 0x6C90, 0xA84E, 0x6C92, 0xA853, 0x6C93, 0xCCEE, 0x6C94, 0xA85C, + 0x6C95, 0xCB57, 0x6C96, 0xA852, 0x6C98, 0xA85D, 0x6C99, 0xA846, 0x6C9A, 0xCB54, 0x6C9B, 0xA84B, 0x6C9C, 0xCB58, 0x6C9D, 0xCD44, + 0x6CAB, 0xAA6A, 0x6CAC, 0xAA7A, 0x6CAD, 0xCCF5, 0x6CAE, 0xAA71, 0x6CB0, 0xCD4B, 0x6CB1, 0xAA62, 0x6CB3, 0xAA65, 0x6CB4, 0xCD42, + 0x6CB6, 0xCCF3, 0x6CB7, 0xCCF7, 0x6CB8, 0xAA6D, 0x6CB9, 0xAA6F, 0x6CBA, 0xCCFA, 0x6CBB, 0xAA76, 0x6CBC, 0xAA68, 0x6CBD, 0xAA66, + 0x6CBE, 0xAA67, 0x6CBF, 0xAA75, 0x6CC0, 0xCD47, 0x6CC1, 0xAA70, 0x6CC2, 0xCCF9, 0x6CC3, 0xCCFB, 0x6CC4, 0xAA6E, 0x6CC5, 0xAA73, + 0x6CC6, 0xCCFC, 0x6CC7, 0xCD4A, 0x6CC9, 0xAC75, 0x6CCA, 0xAA79, 0x6CCC, 0xAA63, 0x6CCD, 0xCD49, 0x6CCF, 0xCD4D, 0x6CD0, 0xCCF8, + 0x6CD1, 0xCD4F, 0x6CD2, 0xCD40, 0x6CD3, 0xAA6C, 0x6CD4, 0xCCF4, 0x6CD5, 0xAA6B, 0x6CD6, 0xAA7D, 0x6CD7, 0xAA72, 0x6CD9, 0xCCF2, + 0x6CDA, 0xCF75, 0x6CDB, 0xAA78, 0x6CDC, 0xAA7C, 0x6CDD, 0xCD41, 0x6CDE, 0xCD46, 0x6CE0, 0xAA7E, 0x6CE1, 0xAA77, 0x6CE2, 0xAA69, + 0x6CE3, 0xAA5F, 0x6CE5, 0xAA64, 0x6CE7, 0xCCF6, 0x6CE8, 0xAA60, 0x6CE9, 0xCD4E, 0x6CEB, 0xCCF0, 0x6CEC, 0xCCEF, 0x6CED, 0xCCFD, + 0x6CEE, 0xCCF1, 0x6CEF, 0xAA7B, 0x6CF0, 0xAEF5, 0x6CF1, 0xAA74, 0x6CF2, 0xCCFE, 0x6CF3, 0xAA61, 0x6CF5, 0xACA6, 0x6CF9, 0xCD4C, + 0x6D00, 0xCF7C, 0x6D01, 0xCFA1, 0x6D03, 0xCFA4, 0x6D04, 0xCF77, 0x6D07, 0xCFA7, 0x6D08, 0xCFAA, 0x6D09, 0xCFAC, 0x6D0A, 0xCF74, + 0x6D0B, 0xAC76, 0x6D0C, 0xAC7B, 0x6D0D, 0xD249, 0x6D0E, 0xACAD, 0x6D0F, 0xCFA5, 0x6D10, 0xCFAD, 0x6D11, 0xCF7B, 0x6D12, 0xCF73, + 0x6D16, 0xD264, 0x6D17, 0xAC7E, 0x6D18, 0xCFA2, 0x6D19, 0xCF78, 0x6D1A, 0xCF7A, 0x6D1B, 0xACA5, 0x6D1D, 0xCF7D, 0x6D1E, 0xAC7D, + 0x6D1F, 0xCF70, 0x6D20, 0xCFA8, 0x6D22, 0xCFAB, 0x6D25, 0xAC7A, 0x6D27, 0xACA8, 0x6D28, 0xCF6D, 0x6D29, 0xACAA, 0x6D2A, 0xAC78, + 0x6D2B, 0xACAE, 0x6D2C, 0xCFA9, 0x6D2D, 0xCF6F, 0x6D2E, 0xACAB, 0x6D2F, 0xD25E, 0x6D30, 0xCD48, 0x6D31, 0xAC7C, 0x6D32, 0xAC77, + 0x6D33, 0xCF76, 0x6D34, 0xCF6E, 0x6D35, 0xACAC, 0x6D36, 0xACA4, 0x6D37, 0xCFA3, 0x6D38, 0xACA9, 0x6D39, 0xACA7, 0x6D3A, 0xCF79, + 0x6D3B, 0xACA1, 0x6D3C, 0xCF71, 0x6D3D, 0xACA2, 0x6D3E, 0xACA3, 0x6D3F, 0xCF72, 0x6D40, 0xCFA6, 0x6D41, 0xAC79, 0x6D42, 0xCF7E, + 0x6D58, 0xD24C, 0x6D59, 0xAEFD, 0x6D5A, 0xAF43, 0x6D5E, 0xD255, 0x6D5F, 0xD25B, 0x6D60, 0xD257, 0x6D61, 0xD24A, 0x6D62, 0xD24D, + 0x6D63, 0xD246, 0x6D64, 0xD247, 0x6D65, 0xAF4A, 0x6D66, 0xAEFA, 0x6D67, 0xD256, 0x6D68, 0xD25F, 0x6D69, 0xAF45, 0x6D6A, 0xAEF6, + 0x6D6C, 0xAF40, 0x6D6D, 0xD24E, 0x6D6E, 0xAF42, 0x6D6F, 0xD24F, 0x6D70, 0xD259, 0x6D74, 0xAF44, 0x6D75, 0xD268, 0x6D76, 0xD248, + 0x6D77, 0xAEFC, 0x6D78, 0xAEFB, 0x6D79, 0xAF48, 0x6D7A, 0xD245, 0x6D7B, 0xD266, 0x6D7C, 0xD25A, 0x6D7D, 0xD267, 0x6D7E, 0xD261, + 0x6D7F, 0xD253, 0x6D80, 0xD262, 0x6D82, 0xD25C, 0x6D83, 0xD265, 0x6D84, 0xD263, 0x6D85, 0xAF49, 0x6D86, 0xD254, 0x6D87, 0xAEF9, + 0x6D88, 0xAEF8, 0x6D89, 0xAF41, 0x6D8A, 0xAF47, 0x6D8B, 0xD260, 0x6D8C, 0xAF46, 0x6D8D, 0xD251, 0x6D8E, 0xB243, 0x6D90, 0xD269, + 0x6D91, 0xD250, 0x6D92, 0xD24B, 0x6D93, 0xAEFE, 0x6D94, 0xAF4B, 0x6D95, 0xAEF7, 0x6D97, 0xD258, 0x6D98, 0xD25D, 0x6DAA, 0xB265, + 0x6DAB, 0xD5E1, 0x6DAC, 0xD5E5, 0x6DAE, 0xB252, 0x6DAF, 0xB250, 0x6DB2, 0xB247, 0x6DB3, 0xD5E3, 0x6DB4, 0xD5E2, 0x6DB5, 0xB25B, + 0x6DB7, 0xD5E8, 0x6DB8, 0xB255, 0x6DBA, 0xD5FA, 0x6DBB, 0xD647, 0x6DBC, 0xB244, 0x6DBD, 0xD5F7, 0x6DBE, 0xD5F0, 0x6DBF, 0xB267, + 0x6DC0, 0xD5E0, 0x6DC2, 0xD5FC, 0x6DC4, 0xB264, 0x6DC5, 0xB258, 0x6DC6, 0xB263, 0x6DC7, 0xB24E, 0x6DC8, 0xD5EC, 0x6DC9, 0xD5FE, + 0x6DCA, 0xD5F6, 0x6DCB, 0xB24F, 0x6DCC, 0xB249, 0x6DCD, 0xD645, 0x6DCF, 0xD5FD, 0x6DD0, 0xD640, 0x6DD1, 0xB251, 0x6DD2, 0xB259, + 0x6DD3, 0xD642, 0x6DD4, 0xD5EA, 0x6DD5, 0xD5FB, 0x6DD6, 0xD5EF, 0x6DD7, 0xD644, 0x6DD8, 0xB25E, 0x6DD9, 0xB246, 0x6DDA, 0xB25C, + 0x6DDB, 0xD5F4, 0x6DDC, 0xD5F2, 0x6DDD, 0xD5F3, 0x6DDE, 0xB253, 0x6DDF, 0xD5EE, 0x6DE0, 0xD5ED, 0x6DE1, 0xB248, 0x6DE2, 0xD5E7, + 0x6DE3, 0xD646, 0x6DE4, 0xB24A, 0x6DE5, 0xD5F1, 0x6DE6, 0xB268, 0x6DE8, 0xB262, 0x6DE9, 0xD5E6, 0x6DEA, 0xB25F, 0x6DEB, 0xB25D, + 0x6DEC, 0xB266, 0x6DED, 0xD5F8, 0x6DEE, 0xB261, 0x6DEF, 0xD252, 0x6DF0, 0xD5F9, 0x6DF1, 0xB260, 0x6DF2, 0xD641, 0x6DF3, 0xB245, + 0x6DF4, 0xD5F5, 0x6DF5, 0xB257, 0x6DF6, 0xD5E9, 0x6DF7, 0xB256, 0x6DF9, 0xB254, 0x6DFA, 0xB24C, 0x6DFB, 0xB24B, 0x6DFC, 0xD9E7, + 0x6DFD, 0xD643, 0x6E00, 0xD5EB, 0x6E03, 0xD9FC, 0x6E05, 0xB24D, 0x6E19, 0xB541, 0x6E1A, 0xB25A, 0x6E1B, 0xB4EE, 0x6E1C, 0xD9F6, + 0x6E1D, 0xB4FC, 0x6E1F, 0xD9EA, 0x6E20, 0xB4EB, 0x6E21, 0xB4E7, 0x6E22, 0xDA49, 0x6E23, 0xB4ED, 0x6E24, 0xB4F1, 0x6E25, 0xB4EC, + 0x6E26, 0xB4F5, 0x6E27, 0xDA4D, 0x6E28, 0xDA44, 0x6E2B, 0xD9F1, 0x6E2C, 0xB4FA, 0x6E2D, 0xB4F4, 0x6E2E, 0xD9FD, 0x6E2F, 0xB4E4, + 0x6E30, 0xDA4A, 0x6E31, 0xDA43, 0x6E32, 0xB4E8, 0x6E33, 0xD9F7, 0x6E34, 0xB4F7, 0x6E35, 0xDA55, 0x6E36, 0xDA56, 0x6E38, 0xB4E5, + 0x6E39, 0xDA48, 0x6E3A, 0xB4F9, 0x6E3B, 0xD9FB, 0x6E3C, 0xD9ED, 0x6E3D, 0xD9EE, 0x6E3E, 0xB4FD, 0x6E3F, 0xD9F2, 0x6E40, 0xD9F9, + 0x6E41, 0xD9F3, 0x6E43, 0xB4FB, 0x6E44, 0xB544, 0x6E45, 0xD9EF, 0x6E46, 0xD9E8, 0x6E47, 0xD9E9, 0x6E49, 0xD9EB, 0x6E4A, 0xB4EA, + 0x6E4B, 0xD9F8, 0x6E4D, 0xB4F8, 0x6E4E, 0xB542, 0x6E51, 0xD9FA, 0x6E52, 0xDA53, 0x6E53, 0xDA4B, 0x6E54, 0xB4E6, 0x6E55, 0xDA51, + 0x6E56, 0xB4F2, 0x6E58, 0xB4F0, 0x6E5A, 0xDA57, 0x6E5B, 0xB4EF, 0x6E5C, 0xDA41, 0x6E5D, 0xD9F4, 0x6E5E, 0xD9FE, 0x6E5F, 0xB547, + 0x6E60, 0xDA45, 0x6E61, 0xDA42, 0x6E62, 0xD9F0, 0x6E63, 0xB543, 0x6E64, 0xDA4F, 0x6E65, 0xDA4C, 0x6E66, 0xDA54, 0x6E67, 0xB4E9, + 0x6E68, 0xDA40, 0x6E69, 0xB546, 0x6E6B, 0xDA47, 0x6E6E, 0xB4F3, 0x6E6F, 0xB4F6, 0x6E71, 0xDA46, 0x6E72, 0xB545, 0x6E73, 0xD9F5, + 0x6E74, 0xD5E4, 0x6E77, 0xDA50, 0x6E78, 0xDA4E, 0x6E79, 0xDA52, 0x6E88, 0xD9EC, 0x6E89, 0xB540, 0x6E8D, 0xDE61, 0x6E8E, 0xDE60, + 0x6E8F, 0xDE46, 0x6E90, 0xB7BD, 0x6E92, 0xDE5F, 0x6E93, 0xDE49, 0x6E94, 0xDE4A, 0x6E96, 0xB7C7, 0x6E97, 0xDE68, 0x6E98, 0xB7C2, + 0x6E99, 0xDE5E, 0x6E9B, 0xDE43, 0x6E9C, 0xB7C8, 0x6E9D, 0xB7BE, 0x6E9E, 0xDE52, 0x6E9F, 0xDE48, 0x6EA0, 0xDE4B, 0x6EA1, 0xDE63, + 0x6EA2, 0xB7B8, 0x6EA3, 0xDE6A, 0x6EA4, 0xDE62, 0x6EA5, 0xB7C1, 0x6EA6, 0xDE57, 0x6EA7, 0xB7CC, 0x6EAA, 0xB7CB, 0x6EAB, 0xB7C5, + 0x6EAE, 0xDE69, 0x6EAF, 0xB7B9, 0x6EB0, 0xDE55, 0x6EB1, 0xDE4C, 0x6EB2, 0xDE59, 0x6EB3, 0xDE65, 0x6EB4, 0xB7CD, 0x6EB6, 0xB7BB, + 0x6EB7, 0xDE54, 0x6EB9, 0xDE4D, 0x6EBA, 0xB7C4, 0x6EBC, 0xB7C3, 0x6EBD, 0xDE50, 0x6EBE, 0xDE5A, 0x6EBF, 0xDE64, 0x6EC0, 0xDE47, + 0x6EC1, 0xDE51, 0x6EC2, 0xB7BC, 0x6EC3, 0xDE5B, 0x6EC4, 0xB7C9, 0x6EC5, 0xB7C0, 0x6EC6, 0xDE4E, 0x6EC7, 0xB7BF, 0x6EC8, 0xDE45, + 0x6EC9, 0xDE53, 0x6ECA, 0xDE67, 0x6ECB, 0xB4FE, 0x6ECC, 0xBAB0, 0x6ECD, 0xDE56, 0x6ECE, 0xE26C, 0x6ECF, 0xDE58, 0x6ED0, 0xDE66, + 0x6ED1, 0xB7C6, 0x6ED2, 0xDE4F, 0x6ED3, 0xB7BA, 0x6ED4, 0xB7CA, 0x6ED5, 0xBCF0, 0x6ED6, 0xDE44, 0x6ED8, 0xDE5D, 0x6EDC, 0xDE5C, + 0x6EEB, 0xE2AA, 0x6EEC, 0xBAAD, 0x6EED, 0xE27D, 0x6EEE, 0xE2A4, 0x6EEF, 0xBAA2, 0x6EF1, 0xE26E, 0x6EF2, 0xBAAF, 0x6EF4, 0xBA77, + 0x6EF5, 0xE26D, 0x6EF6, 0xE2B0, 0x6EF7, 0xBAB1, 0x6EF8, 0xE271, 0x6EF9, 0xE2A3, 0x6EFB, 0xE273, 0x6EFC, 0xE2B3, 0x6EFD, 0xE2AF, + 0x6EFE, 0xBA75, 0x6EFF, 0xBAA1, 0x6F00, 0xE653, 0x6F01, 0xBAAE, 0x6F02, 0xBA7D, 0x6F03, 0xE26F, 0x6F05, 0xE2AE, 0x6F06, 0xBAA3, + 0x6F07, 0xE2AB, 0x6F08, 0xE2B8, 0x6F09, 0xE275, 0x6F0A, 0xE27E, 0x6F0D, 0xE2B6, 0x6F0E, 0xE2AC, 0x6F0F, 0xBA7C, 0x6F12, 0xE27C, + 0x6F13, 0xBA76, 0x6F14, 0xBA74, 0x6F15, 0xBAA8, 0x6F18, 0xE27A, 0x6F19, 0xE277, 0x6F1A, 0xE278, 0x6F1C, 0xE2B2, 0x6F1E, 0xE2B7, + 0x6F1F, 0xE2B5, 0x6F20, 0xBA7A, 0x6F21, 0xE2B9, 0x6F22, 0xBA7E, 0x6F23, 0xBAA7, 0x6F25, 0xE270, 0x6F26, 0xE5FA, 0x6F27, 0xE279, + 0x6F29, 0xBA78, 0x6F2A, 0xBAAC, 0x6F2B, 0xBAA9, 0x6F2C, 0xBA7B, 0x6F2D, 0xE2A5, 0x6F2E, 0xE274, 0x6F2F, 0xBAAA, 0x6F30, 0xE2A7, + 0x6F31, 0xBAA4, 0x6F32, 0xBAA6, 0x6F33, 0xBA73, 0x6F35, 0xE2A9, 0x6F36, 0xE2A1, 0x6F37, 0xE272, 0x6F38, 0xBAA5, 0x6F39, 0xE2B1, + 0x6F3A, 0xE2B4, 0x6F3B, 0xE27B, 0x6F3C, 0xE2A8, 0x6F3E, 0xBA79, 0x6F3F, 0xBCDF, 0x6F40, 0xE2A6, 0x6F41, 0xE5F9, 0x6F43, 0xE2AD, + 0x6F4E, 0xE276, 0x6F4F, 0xE644, 0x6F50, 0xE64E, 0x6F51, 0xBCE2, 0x6F52, 0xE64D, 0x6F53, 0xE659, 0x6F54, 0xBCE4, 0x6F55, 0xE64B, + 0x6F57, 0xE64F, 0x6F58, 0xBCEF, 0x6F5A, 0xE646, 0x6F5B, 0xBCE7, 0x6F5D, 0xE652, 0x6F5E, 0xE9F0, 0x6F5F, 0xBCF3, 0x6F60, 0xBCF2, + 0x6F61, 0xE654, 0x6F62, 0xE643, 0x6F63, 0xE65E, 0x6F64, 0xBCED, 0x6F66, 0xBCE3, 0x6F67, 0xE657, 0x6F69, 0xE65B, 0x6F6A, 0xE660, + 0x6F6B, 0xE655, 0x6F6C, 0xE649, 0x6F6D, 0xBCE6, 0x6F6E, 0xBCE9, 0x6F6F, 0xBCF1, 0x6F70, 0xBCEC, 0x6F72, 0xE64C, 0x6F73, 0xE2A2, + 0x6F76, 0xE648, 0x6F77, 0xE65F, 0x6F78, 0xBCE8, 0x6F7A, 0xBCEB, 0x6F7B, 0xE661, 0x6F7C, 0xBCE0, 0x6F7D, 0xE656, 0x6F7E, 0xE5FB, + 0x6F7F, 0xE65C, 0x6F80, 0xC0DF, 0x6F82, 0xE64A, 0x6F84, 0xBCE1, 0x6F85, 0xE645, 0x6F86, 0xBCE5, 0x6F87, 0xE5FC, 0x6F88, 0xBAAB, + 0x6F89, 0xE641, 0x6F8B, 0xE65A, 0x6F8C, 0xE642, 0x6F8D, 0xE640, 0x6F8E, 0xBCEA, 0x6F90, 0xE658, 0x6F92, 0xE5FE, 0x6F93, 0xE651, + 0x6F94, 0xE650, 0x6F95, 0xE65D, 0x6F96, 0xE647, 0x6F97, 0xBCEE, 0x6F9E, 0xE9F3, 0x6FA0, 0xBF49, 0x6FA1, 0xBEFE, 0x6FA2, 0xEA40, + 0x6FA3, 0xE9EB, 0x6FA4, 0xBF41, 0x6FA5, 0xE9F7, 0x6FA6, 0xBF48, 0x6FA7, 0xBF43, 0x6FA8, 0xE9F5, 0x6FA9, 0xED4F, 0x6FAA, 0xE9FB, + 0x6FAB, 0xEA42, 0x6FAC, 0xE9FA, 0x6FAD, 0xE9E9, 0x6FAE, 0xE9F8, 0x6FAF, 0xEA44, 0x6FB0, 0xEA46, 0x6FB1, 0xBEFD, 0x6FB2, 0xEA45, + 0x6FB3, 0xBF44, 0x6FB4, 0xBF4A, 0x6FB6, 0xBF47, 0x6FB8, 0xE9FE, 0x6FB9, 0xBF46, 0x6FBA, 0xE9F9, 0x6FBC, 0xE9ED, 0x6FBD, 0xE9F2, + 0x6FBF, 0xE9FD, 0x6FC0, 0xBF45, 0x6FC1, 0xBF42, 0x6FC2, 0xBEFC, 0x6FC3, 0xBF40, 0x6FC4, 0xE9F1, 0x6FC6, 0xE5FD, 0x6FC7, 0xE9EC, + 0x6FC8, 0xE9EF, 0x6FC9, 0xEA41, 0x6FCA, 0xE9F4, 0x6FCB, 0xE9EA, 0x6FCC, 0xED4E, 0x6FCD, 0xEA43, 0x6FCE, 0xE9EE, 0x6FCF, 0xE9FC, + 0x6FD4, 0xED51, 0x6FD5, 0xC0E3, 0x6FD8, 0xC0D7, 0x6FDB, 0xC0DB, 0x6FDC, 0xED53, 0x6FDD, 0xED59, 0x6FDE, 0xED57, 0x6FDF, 0xC0D9, + 0x6FE0, 0xC0DA, 0x6FE1, 0xC0E1, 0x6FE2, 0xED5A, 0x6FE3, 0xED52, 0x6FE4, 0xC0DC, 0x6FE6, 0xED56, 0x6FE7, 0xED55, 0x6FE8, 0xED5B, + 0x6FE9, 0xC0E2, 0x6FEB, 0xC0DD, 0x6FEC, 0xC0E0, 0x6FED, 0xED54, 0x6FEE, 0xC0E4, 0x6FEF, 0xC0DE, 0x6FF0, 0xC0E5, 0x6FF1, 0xC0D8, + 0x6FF2, 0xED58, 0x6FF4, 0xED50, 0x6FF7, 0xEFF7, 0x6FFA, 0xC271, 0x6FFB, 0xEFF4, 0x6FFC, 0xEFF6, 0x6FFE, 0xC26F, 0x6FFF, 0xEFF2, + 0x7000, 0xEFF3, 0x7001, 0xEFEE, 0x7004, 0xE9F6, 0x7005, 0xEFEF, 0x7006, 0xC270, 0x7007, 0xEFEB, 0x7009, 0xC26D, 0x700A, 0xEFF8, + 0x700B, 0xC26E, 0x700C, 0xEFEC, 0x700D, 0xEFED, 0x700E, 0xEFF1, 0x700F, 0xC273, 0x7011, 0xC272, 0x7014, 0xEFF0, 0x7015, 0xC378, + 0x7016, 0xF25F, 0x7017, 0xF265, 0x7018, 0xC379, 0x7019, 0xF25C, 0x701A, 0xC376, 0x701B, 0xC373, 0x701C, 0xF267, 0x701D, 0xC377, + 0x701F, 0xC374, 0x7020, 0xF25E, 0x7021, 0xF261, 0x7022, 0xF262, 0x7023, 0xF263, 0x7024, 0xF266, 0x7026, 0xEFF5, 0x7027, 0xF25D, + 0x7028, 0xC375, 0x7029, 0xF264, 0x702A, 0xF268, 0x702B, 0xF260, 0x702F, 0xF45D, 0x7030, 0xC46A, 0x7031, 0xF460, 0x7032, 0xC46B, + 0x7033, 0xF468, 0x7034, 0xF45F, 0x7035, 0xF45C, 0x7037, 0xF45E, 0x7038, 0xF462, 0x7039, 0xF465, 0x703A, 0xF464, 0x703B, 0xF467, + 0x703C, 0xF45B, 0x703E, 0xC469, 0x703F, 0xF463, 0x7040, 0xF466, 0x7041, 0xF469, 0x7042, 0xF461, 0x7043, 0xF5D3, 0x7044, 0xF5D4, + 0x7045, 0xF5D8, 0x7046, 0xF5D9, 0x7048, 0xF5D6, 0x7049, 0xF5D7, 0x704A, 0xF5D5, 0x704C, 0xC4E9, 0x7051, 0xC578, 0x7052, 0xF6EB, + 0x7055, 0xF6E8, 0x7056, 0xF6E9, 0x7057, 0xF6EA, 0x7058, 0xC579, 0x705A, 0xF7E5, 0x705B, 0xF7E4, 0x705D, 0xF8AF, 0x705E, 0xC5F4, + 0x705F, 0xF8AD, 0x7060, 0xF8B0, 0x7061, 0xF8AE, 0x7062, 0xF8F5, 0x7063, 0xC657, 0x7064, 0xC665, 0x7065, 0xF9A3, 0x7066, 0xF96C, + 0x7068, 0xF9A2, 0x7069, 0xF9D0, 0x706A, 0xF9D1, 0x706B, 0xA4F5, 0x7070, 0xA6C7, 0x7071, 0xCA41, 0x7074, 0xCB5E, 0x7076, 0xA85F, + 0x7078, 0xA862, 0x707A, 0xCB5F, 0x707C, 0xA860, 0x707D, 0xA861, 0x7082, 0xCD58, 0x7083, 0xCD5A, 0x7084, 0xCD55, 0x7085, 0xCD52, + 0x7086, 0xCD54, 0x708A, 0xAAA4, 0x708E, 0xAAA2, 0x7091, 0xCD56, 0x7092, 0xAAA3, 0x7093, 0xCD53, 0x7094, 0xCD50, 0x7095, 0xAAA1, + 0x7096, 0xCD57, 0x7098, 0xCD51, 0x7099, 0xAAA5, 0x709A, 0xCD59, 0x709F, 0xCFAF, 0x70A1, 0xCFB3, 0x70A4, 0xACB7, 0x70A9, 0xCFB6, + 0x70AB, 0xACAF, 0x70AC, 0xACB2, 0x70AD, 0xACB4, 0x70AE, 0xACB6, 0x70AF, 0xACB3, 0x70B0, 0xCFB2, 0x70B1, 0xCFB1, 0x70B3, 0xACB1, + 0x70B4, 0xCFB4, 0x70B5, 0xCFB5, 0x70B7, 0xCFAE, 0x70B8, 0xACB5, 0x70BA, 0xACB0, 0x70BE, 0xCFB0, 0x70C5, 0xD277, 0x70C6, 0xD278, + 0x70C7, 0xD279, 0x70C8, 0xAF50, 0x70CA, 0xAF4C, 0x70CB, 0xD26E, 0x70CD, 0xD276, 0x70CE, 0xD27B, 0x70CF, 0xAF51, 0x70D1, 0xD26C, + 0x70D2, 0xD272, 0x70D3, 0xD26B, 0x70D4, 0xD275, 0x70D7, 0xD271, 0x70D8, 0xAF4D, 0x70D9, 0xAF4F, 0x70DA, 0xD27A, 0x70DC, 0xD26A, + 0x70DD, 0xD26D, 0x70DE, 0xD273, 0x70E0, 0xD274, 0x70E1, 0xD27C, 0x70E2, 0xD270, 0x70E4, 0xAF4E, 0x70EF, 0xB26D, 0x70F0, 0xD64E, + 0x70F3, 0xD650, 0x70F4, 0xD64C, 0x70F6, 0xD658, 0x70F7, 0xD64A, 0x70F8, 0xD657, 0x70F9, 0xB269, 0x70FA, 0xD648, 0x70FB, 0xDA5B, + 0x70FC, 0xD652, 0x70FD, 0xB26C, 0x70FF, 0xD653, 0x7100, 0xD656, 0x7102, 0xD65A, 0x7104, 0xD64F, 0x7106, 0xD654, 0x7109, 0xB26A, + 0x710A, 0xB26B, 0x710B, 0xD659, 0x710C, 0xD64D, 0x710D, 0xD649, 0x710E, 0xD65B, 0x7110, 0xD651, 0x7113, 0xD655, 0x7117, 0xD64B, + 0x7119, 0xB548, 0x711A, 0xB549, 0x711B, 0xDA65, 0x711C, 0xB54F, 0x711E, 0xDA59, 0x711F, 0xDA62, 0x7120, 0xDA58, 0x7121, 0xB54C, + 0x7122, 0xDA60, 0x7123, 0xDA5E, 0x7125, 0xDA5F, 0x7126, 0xB54A, 0x7128, 0xDA63, 0x712E, 0xDA5C, 0x712F, 0xDA5A, 0x7130, 0xB54B, + 0x7131, 0xDA5D, 0x7132, 0xDA61, 0x7136, 0xB54D, 0x713A, 0xDA64, 0x7141, 0xDE70, 0x7142, 0xDE77, 0x7143, 0xDE79, 0x7144, 0xDEA1, + 0x7146, 0xB7DA, 0x7147, 0xDE6B, 0x7149, 0xB7D2, 0x714B, 0xDE7A, 0x714C, 0xB7D7, 0x714D, 0xDEA2, 0x714E, 0xB7CE, 0x7150, 0xDE7D, + 0x7152, 0xDE6D, 0x7153, 0xDE7E, 0x7154, 0xDE6C, 0x7156, 0xB7DC, 0x7158, 0xDE78, 0x7159, 0xB7CF, 0x715A, 0xDEA3, 0x715C, 0xB7D4, + 0x715D, 0xDE71, 0x715E, 0xB7D9, 0x715F, 0xDE7C, 0x7160, 0xDE6F, 0x7161, 0xDE76, 0x7162, 0xDE72, 0x7163, 0xDE6E, 0x7164, 0xB7D1, + 0x7165, 0xB7D8, 0x7166, 0xB7D6, 0x7167, 0xB7D3, 0x7168, 0xB7DB, 0x7169, 0xB7D0, 0x716A, 0xDE75, 0x716C, 0xB7D5, 0x716E, 0xB54E, + 0x7170, 0xDE7B, 0x7172, 0xDE73, 0x7178, 0xDE74, 0x717B, 0xE2C1, 0x717D, 0xBAB4, 0x7180, 0xE2BD, 0x7181, 0xE2C3, 0x7182, 0xE2BF, + 0x7184, 0xBAB6, 0x7185, 0xE2BE, 0x7186, 0xE2C2, 0x7187, 0xE2BA, 0x7189, 0xE2BC, 0x718A, 0xBAB5, 0x718F, 0xE2C0, 0x7190, 0xE2BB, + 0x7192, 0xBAB7, 0x7194, 0xBAB2, 0x7197, 0xE2C4, 0x7199, 0xBAB3, 0x719A, 0xE667, 0x719B, 0xE664, 0x719C, 0xE670, 0x719D, 0xE66A, + 0x719E, 0xE66C, 0x719F, 0xBCF4, 0x71A0, 0xE666, 0x71A1, 0xE66E, 0x71A4, 0xE66D, 0x71A5, 0xE66B, 0x71A7, 0xE671, 0x71A8, 0xBCF7, + 0x71A9, 0xE668, 0x71AA, 0xE66F, 0x71AC, 0xBCF5, 0x71AF, 0xE663, 0x71B0, 0xE665, 0x71B1, 0xBCF6, 0x71B2, 0xE662, 0x71B3, 0xE672, + 0x71B5, 0xE669, 0x71B8, 0xEA4A, 0x71B9, 0xBF51, 0x71BC, 0xEA55, 0x71BD, 0xEA53, 0x71BE, 0xBF4B, 0x71BF, 0xEA49, 0x71C0, 0xEA4C, + 0x71C1, 0xEA4D, 0x71C2, 0xEA48, 0x71C3, 0xBF55, 0x71C4, 0xBF56, 0x71C5, 0xEA47, 0x71C6, 0xEA56, 0x71C7, 0xEA51, 0x71C8, 0xBF4F, + 0x71C9, 0xBF4C, 0x71CA, 0xEA50, 0x71CB, 0xEA4E, 0x71CE, 0xBF52, 0x71CF, 0xEA52, 0x71D0, 0xBF4D, 0x71D2, 0xBF4E, 0x71D4, 0xEA4F, + 0x71D5, 0xBF50, 0x71D6, 0xEA4B, 0x71D8, 0xEA54, 0x71D9, 0xBF53, 0x71DA, 0xEA57, 0x71DB, 0xEA58, 0x71DC, 0xBF54, 0x71DF, 0xC0E7, + 0x71E0, 0xC0EE, 0x71E1, 0xED5C, 0x71E2, 0xED62, 0x71E4, 0xED60, 0x71E5, 0xC0EA, 0x71E6, 0xC0E9, 0x71E7, 0xC0E6, 0x71E8, 0xED5E, + 0x71EC, 0xC0EC, 0x71ED, 0xC0EB, 0x71EE, 0xC0E8, 0x71F0, 0xED61, 0x71F1, 0xED5D, 0x71F2, 0xED5F, 0x71F4, 0xC0ED, 0x71F8, 0xC277, + 0x71F9, 0xEFFB, 0x71FB, 0xC274, 0x71FC, 0xC275, 0x71FD, 0xEFFD, 0x71FE, 0xC276, 0x71FF, 0xEFFA, 0x7201, 0xEFF9, 0x7202, 0xF26C, + 0x7203, 0xEFFC, 0x7205, 0xF26D, 0x7206, 0xC37A, 0x7207, 0xF26B, 0x720A, 0xF26A, 0x720C, 0xF269, 0x720D, 0xC37B, 0x7210, 0xC46C, + 0x7213, 0xF46A, 0x7214, 0xF46B, 0x7219, 0xF5DC, 0x721A, 0xF5DB, 0x721B, 0xC4EA, 0x721D, 0xF5DA, 0x721E, 0xF6EC, 0x721F, 0xF6ED, + 0x7222, 0xF7E6, 0x7223, 0xF8B1, 0x7226, 0xF8F6, 0x7227, 0xF9BC, 0x7228, 0xC679, 0x7229, 0xF9C6, 0x722A, 0xA4F6, 0x722C, 0xAAA6, + 0x722D, 0xAAA7, 0x7230, 0xACB8, 0x7235, 0xC0EF, 0x7236, 0xA4F7, 0x7238, 0xAAA8, 0x7239, 0xAF52, 0x723A, 0xB7DD, 0x723B, 0xA4F8, + 0x723D, 0xB26E, 0x723E, 0xBAB8, 0x723F, 0xC962, 0x7241, 0xCFB7, 0x7242, 0xD27D, 0x7244, 0xE2C5, 0x7246, 0xC0F0, 0x7247, 0xA4F9, + 0x7248, 0xAAA9, 0x7249, 0xCFB8, 0x724A, 0xCFB9, 0x724B, 0xDA66, 0x724C, 0xB550, 0x724F, 0xDEA4, 0x7252, 0xB7DE, 0x7253, 0xE2C6, + 0x7256, 0xBCF8, 0x7258, 0xC37C, 0x7259, 0xA4FA, 0x725A, 0xDA67, 0x725B, 0xA4FB, 0x725D, 0xA6C9, 0x725E, 0xCA42, 0x725F, 0xA6C8, + 0x7260, 0xA865, 0x7261, 0xA864, 0x7262, 0xA863, 0x7263, 0xCB60, 0x7267, 0xAAAA, 0x7269, 0xAAAB, 0x726A, 0xCD5B, 0x726C, 0xCFBA, + 0x726E, 0xCFBD, 0x726F, 0xACBA, 0x7270, 0xCFBB, 0x7272, 0xACB9, 0x7273, 0xCFBC, 0x7274, 0xACBB, 0x7276, 0xD2A2, 0x7277, 0xD2A1, + 0x7278, 0xD27E, 0x7279, 0xAF53, 0x727B, 0xD65D, 0x727C, 0xD65E, 0x727D, 0xB26F, 0x727E, 0xD65C, 0x727F, 0xD65F, 0x7280, 0xB552, + 0x7281, 0xB270, 0x7284, 0xB551, 0x7285, 0xDA6B, 0x7286, 0xDA6A, 0x7288, 0xDA68, 0x7289, 0xDA69, 0x728B, 0xDA6C, 0x728C, 0xDEA6, + 0x728D, 0xDEA5, 0x728E, 0xDEA9, 0x7290, 0xDEA8, 0x7291, 0xDEA7, 0x7292, 0xBAB9, 0x7293, 0xE2C9, 0x7295, 0xE2C8, 0x7296, 0xBABA, + 0x7297, 0xE2C7, 0x7298, 0xE673, 0x729A, 0xE674, 0x729B, 0xBCF9, 0x729D, 0xEA59, 0x729E, 0xEA5A, 0x72A1, 0xF272, 0x72A2, 0xC37D, + 0x72A3, 0xF271, 0x72A4, 0xF270, 0x72A5, 0xF26E, 0x72A6, 0xF26F, 0x72A7, 0xC4EB, 0x72A8, 0xF46C, 0x72A9, 0xF6EE, 0x72AA, 0xF8F7, + 0x72AC, 0xA4FC, 0x72AE, 0xC9A5, 0x72AF, 0xA5C7, 0x72B0, 0xC9A6, 0x72B4, 0xCA43, 0x72B5, 0xCA44, 0x72BA, 0xCB66, 0x72BD, 0xCB62, + 0x72BF, 0xCB61, 0x72C0, 0xAAAC, 0x72C1, 0xCB65, 0x72C2, 0xA867, 0x72C3, 0xCB63, 0x72C4, 0xA866, 0x72C5, 0xCB67, 0x72C6, 0xCB64, + 0x72C9, 0xCD5F, 0x72CA, 0xCFBE, 0x72CB, 0xCD5D, 0x72CC, 0xCD64, 0x72CE, 0xAAAD, 0x72D0, 0xAAB0, 0x72D1, 0xCD65, 0x72D2, 0xCD61, + 0x72D4, 0xCD62, 0x72D6, 0xCD5C, 0x72D7, 0xAAAF, 0x72D8, 0xCD5E, 0x72D9, 0xAAAE, 0x72DA, 0xCD63, 0x72DC, 0xCD60, 0x72DF, 0xCFC2, + 0x72E0, 0xACBD, 0x72E1, 0xACBE, 0x72E3, 0xCFC5, 0x72E4, 0xCFBF, 0x72E6, 0xCFC4, 0x72E8, 0xCFC0, 0x72E9, 0xACBC, 0x72EA, 0xCFC3, + 0x72EB, 0xCFC1, 0x72F3, 0xD2A8, 0x72F4, 0xD2A5, 0x72F6, 0xD2A7, 0x72F7, 0xAF58, 0x72F8, 0xAF57, 0x72F9, 0xAF55, 0x72FA, 0xD2A4, + 0x72FB, 0xD2A9, 0x72FC, 0xAF54, 0x72FD, 0xAF56, 0x72FE, 0xD2A6, 0x72FF, 0xD667, 0x7300, 0xD2A3, 0x7301, 0xD2AA, 0x7307, 0xD662, + 0x7308, 0xD666, 0x730A, 0xD665, 0x730B, 0xDA6E, 0x730C, 0xDA79, 0x730F, 0xD668, 0x7311, 0xD663, 0x7312, 0xDA6D, 0x7313, 0xB274, + 0x7316, 0xB273, 0x7317, 0xD661, 0x7318, 0xD664, 0x7319, 0xB275, 0x731B, 0xB272, 0x731C, 0xB271, 0x731D, 0xD660, 0x731E, 0xD669, + 0x7322, 0xDA70, 0x7323, 0xDA77, 0x7325, 0xB554, 0x7326, 0xDA76, 0x7327, 0xDA73, 0x7329, 0xB556, 0x732D, 0xDA75, 0x7330, 0xDA6F, + 0x7331, 0xDA71, 0x7332, 0xDA74, 0x7333, 0xDA72, 0x7334, 0xB555, 0x7335, 0xDA78, 0x7336, 0xB553, 0x7337, 0xB7DF, 0x733A, 0xDEAD, + 0x733B, 0xDEAC, 0x733C, 0xDEAA, 0x733E, 0xB7E2, 0x733F, 0xB7E1, 0x7340, 0xDEAE, 0x7342, 0xDEAB, 0x7343, 0xE2CA, 0x7344, 0xBABB, + 0x7345, 0xB7E0, 0x7349, 0xDEB0, 0x734A, 0xDEAF, 0x734C, 0xE2CD, 0x734D, 0xE2CB, 0x734E, 0xBCFA, 0x7350, 0xBABC, 0x7351, 0xE2CC, + 0x7352, 0xE676, 0x7357, 0xBCFB, 0x7358, 0xE675, 0x7359, 0xE67E, 0x735A, 0xE67D, 0x735B, 0xE67B, 0x735D, 0xE67A, 0x735E, 0xE677, + 0x735F, 0xE678, 0x7360, 0xE679, 0x7361, 0xE67C, 0x7362, 0xE6A1, 0x7365, 0xEA5F, 0x7366, 0xEA5C, 0x7367, 0xEA5D, 0x7368, 0xBF57, + 0x7369, 0xEA5B, 0x736A, 0xEA61, 0x736B, 0xEA60, 0x736C, 0xEA5E, 0x736E, 0xED64, 0x736F, 0xED65, 0x7370, 0xC0F1, 0x7372, 0xC0F2, + 0x7373, 0xED63, 0x7375, 0xC279, 0x7376, 0xEFFE, 0x7377, 0xC278, 0x7378, 0xC37E, 0x737A, 0xC3A1, 0x737B, 0xC46D, 0x737C, 0xF46E, + 0x737D, 0xF46D, 0x737E, 0xF5DD, 0x737F, 0xF6EF, 0x7380, 0xC57A, 0x7381, 0xF7E8, 0x7382, 0xF7E7, 0x7383, 0xF7E9, 0x7384, 0xA5C8, + 0x7385, 0xCFC6, 0x7386, 0xAF59, 0x7387, 0xB276, 0x7388, 0xD66A, 0x7389, 0xA5C9, 0x738A, 0xC9A7, 0x738B, 0xA4FD, 0x738E, 0xCA45, + 0x7392, 0xCB6C, 0x7393, 0xCB6A, 0x7394, 0xCB6B, 0x7395, 0xCB68, 0x7396, 0xA868, 0x7397, 0xCB69, 0x739D, 0xCD6D, 0x739F, 0xAAB3, + 0x73A0, 0xCD6B, 0x73A1, 0xCD67, 0x73A2, 0xCD6A, 0x73A4, 0xCD66, 0x73A5, 0xAAB5, 0x73A6, 0xCD69, 0x73A8, 0xAAB2, 0x73A9, 0xAAB1, + 0x73AB, 0xAAB4, 0x73AC, 0xCD6C, 0x73AD, 0xCD68, 0x73B2, 0xACC2, 0x73B3, 0xACC5, 0x73B4, 0xCFCE, 0x73B5, 0xCFCD, 0x73B6, 0xCFCC, + 0x73B7, 0xACBF, 0x73B8, 0xCFD5, 0x73B9, 0xCFCB, 0x73BB, 0xACC1, 0x73BC, 0xD2AF, 0x73BE, 0xCFD2, 0x73BF, 0xCFD0, 0x73C0, 0xACC4, + 0x73C2, 0xCFC8, 0x73C3, 0xCFD3, 0x73C5, 0xCFCA, 0x73C6, 0xCFD4, 0x73C7, 0xCFD1, 0x73C8, 0xCFC9, 0x73CA, 0xACC0, 0x73CB, 0xCFD6, + 0x73CC, 0xCFC7, 0x73CD, 0xACC3, 0x73D2, 0xD2B4, 0x73D3, 0xD2AB, 0x73D4, 0xD2B6, 0x73D6, 0xD2AE, 0x73D7, 0xD2B9, 0x73D8, 0xD2BA, + 0x73D9, 0xD2AC, 0x73DA, 0xD2B8, 0x73DB, 0xD2B5, 0x73DC, 0xD2B3, 0x73DD, 0xD2B7, 0x73DE, 0xAF5F, 0x73E0, 0xAF5D, 0x73E3, 0xD2B1, + 0x73E5, 0xD2AD, 0x73E7, 0xD2B0, 0x73E8, 0xD2BB, 0x73E9, 0xD2B2, 0x73EA, 0xAF5E, 0x73EB, 0xCFCF, 0x73ED, 0xAF5A, 0x73EE, 0xAF5C, + 0x73F4, 0xD678, 0x73F5, 0xD66D, 0x73F6, 0xD66B, 0x73F8, 0xD66C, 0x73FA, 0xD673, 0x73FC, 0xD674, 0x73FD, 0xD670, 0x73FE, 0xB27B, + 0x73FF, 0xD675, 0x7400, 0xD672, 0x7401, 0xD66F, 0x7403, 0xB279, 0x7404, 0xD66E, 0x7405, 0xB277, 0x7406, 0xB27A, 0x7407, 0xD671, + 0x7408, 0xD679, 0x7409, 0xAF5B, 0x740A, 0xB278, 0x740B, 0xD677, 0x740C, 0xD676, 0x740D, 0xB27C, 0x7416, 0xDA7E, 0x741A, 0xDAA1, + 0x741B, 0xB560, 0x741D, 0xDAA7, 0x7420, 0xDAA9, 0x7421, 0xDAA2, 0x7422, 0xB55A, 0x7423, 0xDAA6, 0x7424, 0xDAA5, 0x7425, 0xB55B, + 0x7426, 0xB561, 0x7428, 0xB562, 0x7429, 0xDAA8, 0x742A, 0xB558, 0x742B, 0xDA7D, 0x742C, 0xDA7B, 0x742D, 0xDAA3, 0x742E, 0xDA7A, + 0x742F, 0xB55F, 0x7430, 0xDA7C, 0x7431, 0xDAA4, 0x7432, 0xDAAA, 0x7433, 0xB559, 0x7434, 0xB55E, 0x7435, 0xB55C, 0x7436, 0xB55D, + 0x743A, 0xB557, 0x743F, 0xB7E9, 0x7440, 0xDEB7, 0x7441, 0xB7E8, 0x7442, 0xDEBB, 0x7444, 0xDEB1, 0x7446, 0xDEBC, 0x744A, 0xDEB2, + 0x744B, 0xDEB3, 0x744D, 0xDEBD, 0x744E, 0xDEBA, 0x744F, 0xDEB8, 0x7450, 0xDEB9, 0x7451, 0xDEB5, 0x7452, 0xDEB4, 0x7454, 0xDEBE, + 0x7455, 0xB7E5, 0x7457, 0xDEB6, 0x7459, 0xB7EA, 0x745A, 0xB7E4, 0x745B, 0xB7EB, 0x745C, 0xB7EC, 0x745E, 0xB7E7, 0x745F, 0xB7E6, + 0x7462, 0xE2CE, 0x7463, 0xBABE, 0x7464, 0xBABD, 0x7467, 0xE2D3, 0x7469, 0xBCFC, 0x746A, 0xBABF, 0x746D, 0xBAC1, 0x746E, 0xE2D4, + 0x746F, 0xB7E3, 0x7470, 0xBAC0, 0x7471, 0xE2D0, 0x7472, 0xE2D2, 0x7473, 0xE2CF, 0x7475, 0xE2D1, 0x7479, 0xE6AB, 0x747C, 0xE6AA, + 0x747D, 0xE6A7, 0x747E, 0xBD40, 0x747F, 0xEA62, 0x7480, 0xBD41, 0x7481, 0xE6A6, 0x7483, 0xBCFE, 0x7485, 0xE6A8, 0x7486, 0xE6A5, + 0x7487, 0xE6A2, 0x7488, 0xE6A9, 0x7489, 0xE6A3, 0x748A, 0xE6A4, 0x748B, 0xBCFD, 0x7490, 0xED69, 0x7492, 0xEA66, 0x7494, 0xEA65, + 0x7495, 0xEA67, 0x7497, 0xED66, 0x7498, 0xBF5A, 0x749A, 0xEA63, 0x749C, 0xBF58, 0x749E, 0xBF5C, 0x749F, 0xBF5B, 0x74A0, 0xEA64, + 0x74A1, 0xEA68, 0x74A3, 0xBF59, 0x74A5, 0xED6D, 0x74A6, 0xC0F5, 0x74A7, 0xC27A, 0x74A8, 0xC0F6, 0x74A9, 0xC0F3, 0x74AA, 0xED6A, + 0x74AB, 0xED68, 0x74AD, 0xED6B, 0x74AF, 0xED6E, 0x74B0, 0xC0F4, 0x74B1, 0xED6C, 0x74B2, 0xED67, 0x74B5, 0xF042, 0x74B6, 0xF045, + 0x74B7, 0xF275, 0x74B8, 0xF040, 0x74BA, 0xF46F, 0x74BB, 0xF046, 0x74BD, 0xC3A2, 0x74BE, 0xF044, 0x74BF, 0xC27B, 0x74C0, 0xF041, + 0x74C1, 0xF043, 0x74C2, 0xF047, 0x74C3, 0xF276, 0x74C5, 0xF274, 0x74CA, 0xC3A3, 0x74CB, 0xF273, 0x74CF, 0xC46E, 0x74D4, 0xC4ED, + 0x74D5, 0xF6F1, 0x74D6, 0xC4EC, 0x74D7, 0xF6F3, 0x74D8, 0xF6F0, 0x74D9, 0xF6F2, 0x74DA, 0xC5D0, 0x74DB, 0xF8B2, 0x74DC, 0xA5CA, + 0x74DD, 0xCD6E, 0x74DE, 0xD2BC, 0x74DF, 0xD2BD, 0x74E0, 0xB27D, 0x74E1, 0xDEBF, 0x74E2, 0xBF5D, 0x74E3, 0xC3A4, 0x74E4, 0xC57B, + 0x74E5, 0xF8B3, 0x74E6, 0xA5CB, 0x74E8, 0xCD6F, 0x74E9, 0xA260, 0x74EC, 0xCFD7, 0x74EE, 0xCFD8, 0x74F4, 0xD2BE, 0x74F5, 0xD2BF, + 0x74F6, 0xB27E, 0x74F7, 0xB2A1, 0x74FB, 0xDAAB, 0x74FD, 0xDEC2, 0x74FE, 0xDEC1, 0x74FF, 0xDEC0, 0x7500, 0xE2D5, 0x7502, 0xE2D6, + 0x7503, 0xE2D7, 0x7504, 0xBAC2, 0x7507, 0xE6AD, 0x7508, 0xE6AC, 0x750B, 0xEA69, 0x750C, 0xBF5E, 0x750D, 0xBF5F, 0x750F, 0xED72, + 0x7510, 0xED6F, 0x7511, 0xED70, 0x7512, 0xED71, 0x7513, 0xF049, 0x7514, 0xF048, 0x7515, 0xC27C, 0x7516, 0xF277, 0x7517, 0xF5DE, + 0x7518, 0xA5CC, 0x751A, 0xACC6, 0x751C, 0xB2A2, 0x751D, 0xDEC3, 0x751F, 0xA5CD, 0x7521, 0xD2C0, 0x7522, 0xB2A3, 0x7525, 0xB563, + 0x7526, 0xB564, 0x7528, 0xA5CE, 0x7529, 0xA5CF, 0x752A, 0xCA46, 0x752B, 0xA86A, 0x752C, 0xA869, 0x752D, 0xACC7, 0x752E, 0xCFD9, + 0x752F, 0xDAAC, 0x7530, 0xA5D0, 0x7531, 0xA5D1, 0x7532, 0xA5D2, 0x7533, 0xA5D3, 0x7537, 0xA86B, 0x7538, 0xA86C, 0x7539, 0xCB6E, + 0x753A, 0xCB6D, 0x753D, 0xAAB6, 0x753E, 0xCD72, 0x753F, 0xCD70, 0x7540, 0xCD71, 0x7547, 0xCFDA, 0x7548, 0xCFDB, 0x754B, 0xACCB, + 0x754C, 0xACC9, 0x754E, 0xACCA, 0x754F, 0xACC8, 0x7554, 0xAF60, 0x7559, 0xAF64, 0x755A, 0xAF63, 0x755B, 0xD2C1, 0x755C, 0xAF62, + 0x755D, 0xAF61, 0x755F, 0xD2C2, 0x7562, 0xB2A6, 0x7563, 0xD67B, 0x7564, 0xD67A, 0x7565, 0xB2A4, 0x7566, 0xB2A5, 0x756A, 0xB566, + 0x756B, 0xB565, 0x756C, 0xDAAE, 0x756F, 0xDAAD, 0x7570, 0xB2A7, 0x7576, 0xB7ED, 0x7577, 0xDEC5, 0x7578, 0xB7EE, 0x7579, 0xDEC4, + 0x757D, 0xE2D8, 0x757E, 0xE6AE, 0x757F, 0xBD42, 0x7580, 0xEA6A, 0x7584, 0xED73, 0x7586, 0xC3A6, 0x7587, 0xC3A5, 0x758A, 0xC57C, + 0x758B, 0xA5D4, 0x758C, 0xCD73, 0x758F, 0xB2A8, 0x7590, 0xE2D9, 0x7591, 0xBAC3, 0x7594, 0xCB6F, 0x7595, 0xCB70, 0x7598, 0xCD74, + 0x7599, 0xAAB8, 0x759A, 0xAAB9, 0x759D, 0xAAB7, 0x75A2, 0xACCF, 0x75A3, 0xACD0, 0x75A4, 0xACCD, 0x75A5, 0xACCE, 0x75A7, 0xCFDC, + 0x75AA, 0xCFDD, 0x75AB, 0xACCC, 0x75B0, 0xD2C3, 0x75B2, 0xAF68, 0x75B3, 0xAF69, 0x75B5, 0xB2AB, 0x75B6, 0xD2C9, 0x75B8, 0xAF6E, + 0x75B9, 0xAF6C, 0x75BA, 0xD2CA, 0x75BB, 0xD2C5, 0x75BC, 0xAF6B, 0x75BD, 0xAF6A, 0x75BE, 0xAF65, 0x75BF, 0xD2C8, 0x75C0, 0xD2C7, + 0x75C1, 0xD2C4, 0x75C2, 0xAF6D, 0x75C4, 0xD2C6, 0x75C5, 0xAF66, 0x75C7, 0xAF67, 0x75CA, 0xB2AC, 0x75CB, 0xD6A1, 0x75CC, 0xD6A2, + 0x75CD, 0xB2AD, 0x75CE, 0xD67C, 0x75CF, 0xD67E, 0x75D0, 0xD6A4, 0x75D1, 0xD6A3, 0x75D2, 0xD67D, 0x75D4, 0xB2A9, 0x75D5, 0xB2AA, + 0x75D7, 0xDAB6, 0x75D8, 0xB56B, 0x75D9, 0xB56A, 0x75DA, 0xDAB0, 0x75DB, 0xB568, 0x75DD, 0xDAB3, 0x75DE, 0xB56C, 0x75DF, 0xDAB4, + 0x75E0, 0xB56D, 0x75E1, 0xDAB1, 0x75E2, 0xB567, 0x75E3, 0xB569, 0x75E4, 0xDAB5, 0x75E6, 0xDAB2, 0x75E7, 0xDAAF, 0x75ED, 0xDED2, + 0x75EF, 0xDEC7, 0x75F0, 0xB7F0, 0x75F1, 0xB7F3, 0x75F2, 0xB7F2, 0x75F3, 0xB7F7, 0x75F4, 0xB7F6, 0x75F5, 0xDED3, 0x75F6, 0xDED1, + 0x75F7, 0xDECA, 0x75F8, 0xDECE, 0x75F9, 0xDECD, 0x75FA, 0xB7F4, 0x75FB, 0xDED0, 0x75FC, 0xDECC, 0x75FD, 0xDED4, 0x75FE, 0xDECB, + 0x75FF, 0xB7F5, 0x7600, 0xB7EF, 0x7601, 0xB7F1, 0x7603, 0xDEC9, 0x7608, 0xE2DB, 0x7609, 0xBAC7, 0x760A, 0xE2DF, 0x760B, 0xBAC6, + 0x760C, 0xE2DC, 0x760D, 0xBAC5, 0x760F, 0xDEC8, 0x7610, 0xDECF, 0x7611, 0xE2DE, 0x7613, 0xBAC8, 0x7614, 0xE2E0, 0x7615, 0xE2DD, + 0x7616, 0xE2DA, 0x7619, 0xE6B1, 0x761A, 0xE6B5, 0x761B, 0xE6B7, 0x761C, 0xE6B3, 0x761D, 0xE6B2, 0x761E, 0xE6B0, 0x761F, 0xBD45, + 0x7620, 0xBD43, 0x7621, 0xBD48, 0x7622, 0xBD49, 0x7623, 0xE6B4, 0x7624, 0xBD46, 0x7625, 0xE6AF, 0x7626, 0xBD47, 0x7627, 0xBAC4, + 0x7628, 0xE6B6, 0x7629, 0xBD44, 0x762D, 0xEA6C, 0x762F, 0xEA6B, 0x7630, 0xEA73, 0x7631, 0xEA6D, 0x7632, 0xEA72, 0x7633, 0xEA6F, + 0x7634, 0xBF60, 0x7635, 0xEA71, 0x7638, 0xBF61, 0x763A, 0xBF62, 0x763C, 0xEA70, 0x763D, 0xEA6E, 0x7642, 0xC0F8, 0x7643, 0xED74, + 0x7646, 0xC0F7, 0x7647, 0xED77, 0x7648, 0xED75, 0x7649, 0xED76, 0x764C, 0xC0F9, 0x7650, 0xF04D, 0x7652, 0xC2A1, 0x7653, 0xF04E, + 0x7656, 0xC27D, 0x7657, 0xF04F, 0x7658, 0xC27E, 0x7659, 0xF04C, 0x765A, 0xF050, 0x765C, 0xF04A, 0x765F, 0xC3A7, 0x7660, 0xF278, + 0x7661, 0xC3A8, 0x7662, 0xC46F, 0x7664, 0xF04B, 0x7665, 0xC470, 0x7669, 0xC4EE, 0x766A, 0xF5DF, 0x766C, 0xC57E, 0x766D, 0xF6F4, + 0x766E, 0xC57D, 0x7670, 0xF7EA, 0x7671, 0xC5F5, 0x7672, 0xC5F6, 0x7675, 0xF9CC, 0x7678, 0xACD1, 0x7679, 0xCFDE, 0x767B, 0xB56E, + 0x767C, 0xB56F, 0x767D, 0xA5D5, 0x767E, 0xA6CA, 0x767F, 0xCA47, 0x7681, 0xCB71, 0x7682, 0xA86D, 0x7684, 0xAABA, 0x7686, 0xACD2, + 0x7687, 0xACD3, 0x7688, 0xACD4, 0x7689, 0xD6A6, 0x768A, 0xD2CB, 0x768B, 0xAF6F, 0x768E, 0xB2AE, 0x768F, 0xD6A5, 0x7692, 0xDAB8, + 0x7693, 0xB571, 0x7695, 0xDAB7, 0x7696, 0xB570, 0x7699, 0xDED5, 0x769A, 0xBD4A, 0x769B, 0xE6BB, 0x769C, 0xE6B8, 0x769D, 0xE6B9, + 0x769E, 0xE6BA, 0x76A4, 0xED78, 0x76A6, 0xF051, 0x76AA, 0xF471, 0x76AB, 0xF470, 0x76AD, 0xF6F5, 0x76AE, 0xA5D6, 0x76AF, 0xCD75, + 0x76B0, 0xAF70, 0x76B4, 0xB572, 0x76B5, 0xDED6, 0x76B8, 0xE2E1, 0x76BA, 0xBD4B, 0x76BB, 0xEA74, 0x76BD, 0xF052, 0x76BE, 0xF472, + 0x76BF, 0xA5D7, 0x76C2, 0xAABB, 0x76C3, 0xACD7, 0x76C4, 0xCFDF, 0x76C5, 0xACD8, 0x76C6, 0xACD6, 0x76C8, 0xACD5, 0x76C9, 0xD2CC, + 0x76CA, 0xAF71, 0x76CD, 0xAF72, 0x76CE, 0xAF73, 0x76D2, 0xB2B0, 0x76D3, 0xD6A7, 0x76D4, 0xB2AF, 0x76DA, 0xDAB9, 0x76DB, 0xB2B1, + 0x76DC, 0xB573, 0x76DD, 0xDED7, 0x76DE, 0xB7F8, 0x76DF, 0xB7F9, 0x76E1, 0xBAC9, 0x76E3, 0xBACA, 0x76E4, 0xBD4C, 0x76E5, 0xBF64, + 0x76E6, 0xEA75, 0x76E7, 0xBF63, 0x76E9, 0xED79, 0x76EA, 0xC0FA, 0x76EC, 0xF053, 0x76ED, 0xF473, 0x76EE, 0xA5D8, 0x76EF, 0xA86E, + 0x76F0, 0xCD78, 0x76F1, 0xCD77, 0x76F2, 0xAABC, 0x76F3, 0xCD76, 0x76F4, 0xAABD, 0x76F5, 0xCD79, 0x76F7, 0xCFE5, 0x76F8, 0xACDB, + 0x76F9, 0xACDA, 0x76FA, 0xCFE7, 0x76FB, 0xCFE6, 0x76FC, 0xACDF, 0x76FE, 0xACDE, 0x7701, 0xACD9, 0x7703, 0xCFE1, 0x7704, 0xCFE2, + 0x7705, 0xCFE3, 0x7707, 0xACE0, 0x7708, 0xCFE0, 0x7709, 0xACDC, 0x770A, 0xCFE4, 0x770B, 0xACDD, 0x7710, 0xD2CF, 0x7711, 0xD2D3, + 0x7712, 0xD2D1, 0x7713, 0xD2D0, 0x7715, 0xD2D4, 0x7719, 0xD2D5, 0x771A, 0xD2D6, 0x771B, 0xD2CE, 0x771D, 0xD2CD, 0x771F, 0xAF75, + 0x7720, 0xAF76, 0x7722, 0xD2D7, 0x7723, 0xD2D2, 0x7725, 0xD6B0, 0x7727, 0xD2D8, 0x7728, 0xAF77, 0x7729, 0xAF74, 0x772D, 0xD6AA, + 0x772F, 0xD6A9, 0x7731, 0xD6AB, 0x7732, 0xD6AC, 0x7733, 0xD6AE, 0x7734, 0xD6AD, 0x7735, 0xD6B2, 0x7736, 0xB2B5, 0x7737, 0xB2B2, + 0x7738, 0xB2B6, 0x7739, 0xD6A8, 0x773A, 0xB2B7, 0x773B, 0xD6B1, 0x773C, 0xB2B4, 0x773D, 0xD6AF, 0x773E, 0xB2B3, 0x7744, 0xDABC, + 0x7745, 0xDABE, 0x7746, 0xDABA, 0x7747, 0xDABB, 0x774A, 0xDABF, 0x774B, 0xDAC1, 0x774C, 0xDAC2, 0x774D, 0xDABD, 0x774E, 0xDAC0, + 0x774F, 0xB574, 0x7752, 0xDEDB, 0x7754, 0xDEE0, 0x7755, 0xDED8, 0x7756, 0xDEDC, 0x7759, 0xDEE1, 0x775A, 0xDEDD, 0x775B, 0xB7FA, + 0x775C, 0xB843, 0x775E, 0xB7FD, 0x775F, 0xDED9, 0x7760, 0xDEDA, 0x7761, 0xBACE, 0x7762, 0xB846, 0x7763, 0xB7FE, 0x7765, 0xB844, + 0x7766, 0xB7FC, 0x7767, 0xDEDF, 0x7768, 0xB845, 0x7769, 0xDEDE, 0x776A, 0xB841, 0x776B, 0xB7FB, 0x776C, 0xB842, 0x776D, 0xDEE2, + 0x776E, 0xE2E6, 0x776F, 0xE2E8, 0x7779, 0xB840, 0x777C, 0xE2E3, 0x777D, 0xBACC, 0x777E, 0xE2E9, 0x777F, 0xBACD, 0x7780, 0xE2E7, + 0x7781, 0xE2E2, 0x7782, 0xE2E5, 0x7783, 0xE2EA, 0x7784, 0xBACB, 0x7785, 0xE2E4, 0x7787, 0xBD4E, 0x7788, 0xE6BF, 0x7789, 0xE6BE, + 0x778B, 0xBD51, 0x778C, 0xBD4F, 0x778D, 0xE6BC, 0x778E, 0xBD4D, 0x778F, 0xE6BD, 0x7791, 0xBD50, 0x7795, 0xEA7D, 0x7797, 0xEAA1, + 0x7799, 0xEA7E, 0x779A, 0xEA76, 0x779B, 0xEA7A, 0x779C, 0xEA79, 0x779D, 0xEA77, 0x779E, 0xBF66, 0x779F, 0xBF67, 0x77A0, 0xBF65, + 0x77A1, 0xEA78, 0x77A2, 0xEA7B, 0x77A3, 0xEA7C, 0x77A5, 0xBF68, 0x77A7, 0xC140, 0x77A8, 0xEDA3, 0x77AA, 0xC0FC, 0x77AB, 0xED7B, + 0x77AC, 0xC0FE, 0x77AD, 0xC141, 0x77B0, 0xC0FD, 0x77B1, 0xEDA2, 0x77B2, 0xED7C, 0x77B3, 0xC0FB, 0x77B4, 0xEDA1, 0x77B5, 0xED7A, + 0x77B6, 0xED7E, 0x77B7, 0xED7D, 0x77BA, 0xF055, 0x77BB, 0xC2A4, 0x77BC, 0xC2A5, 0x77BD, 0xC2A2, 0x77BF, 0xC2A3, 0x77C2, 0xF054, + 0x77C4, 0xF27B, 0x77C7, 0xC3A9, 0x77C9, 0xF279, 0x77CA, 0xF27A, 0x77CC, 0xF474, 0x77CD, 0xF477, 0x77CE, 0xF475, 0x77CF, 0xF476, + 0x77D0, 0xF5E0, 0x77D3, 0xC4EF, 0x77D4, 0xF7EB, 0x77D5, 0xF8B4, 0x77D7, 0xC5F7, 0x77D8, 0xF8F8, 0x77D9, 0xF8F9, 0x77DA, 0xC666, + 0x77DB, 0xA5D9, 0x77DC, 0xACE1, 0x77DE, 0xDAC3, 0x77E0, 0xDEE3, 0x77E2, 0xA5DA, 0x77E3, 0xA86F, 0x77E5, 0xAABE, 0x77E7, 0xCFE8, + 0x77E8, 0xCFE9, 0x77E9, 0xAF78, 0x77EC, 0xDAC4, 0x77ED, 0xB575, 0x77EE, 0xB847, 0x77EF, 0xC142, 0x77F0, 0xEDA4, 0x77F1, 0xF27C, + 0x77F2, 0xF478, 0x77F3, 0xA5DB, 0x77F7, 0xCDA1, 0x77F8, 0xCD7A, 0x77F9, 0xCD7C, 0x77FA, 0xCD7E, 0x77FB, 0xCD7D, 0x77FC, 0xCD7B, + 0x77FD, 0xAABF, 0x7802, 0xACE2, 0x7803, 0xCFF2, 0x7805, 0xCFED, 0x7806, 0xCFEA, 0x7809, 0xCFF1, 0x780C, 0xACE4, 0x780D, 0xACE5, + 0x780E, 0xCFF0, 0x780F, 0xCFEF, 0x7810, 0xCFEE, 0x7811, 0xCFEB, 0x7812, 0xCFEC, 0x7813, 0xCFF3, 0x7814, 0xACE3, 0x781D, 0xAF7C, + 0x781F, 0xAFA4, 0x7820, 0xAFA3, 0x7821, 0xD2E1, 0x7822, 0xD2DB, 0x7823, 0xD2D9, 0x7825, 0xAFA1, 0x7826, 0xD6B9, 0x7827, 0xAF7A, + 0x7828, 0xD2DE, 0x7829, 0xD2E2, 0x782A, 0xD2E4, 0x782B, 0xD2E0, 0x782C, 0xD2DA, 0x782D, 0xAFA2, 0x782E, 0xD2DF, 0x782F, 0xD2DD, + 0x7830, 0xAF79, 0x7831, 0xD2E5, 0x7832, 0xAFA5, 0x7833, 0xD2E3, 0x7834, 0xAF7D, 0x7835, 0xD2DC, 0x7837, 0xAF7E, 0x7838, 0xAF7B, + 0x7843, 0xB2B9, 0x7845, 0xD6BA, 0x7848, 0xD6B3, 0x7849, 0xD6B5, 0x784A, 0xD6B7, 0x784C, 0xD6B8, 0x784D, 0xD6B6, 0x784E, 0xB2BA, + 0x7850, 0xD6BB, 0x7852, 0xD6B4, 0x785C, 0xDAC8, 0x785D, 0xB576, 0x785E, 0xDAD0, 0x7860, 0xDAC5, 0x7862, 0xDAD1, 0x7864, 0xDAC6, + 0x7865, 0xDAC7, 0x7868, 0xDACF, 0x7869, 0xDACE, 0x786A, 0xDACB, 0x786B, 0xB2B8, 0x786C, 0xB577, 0x786D, 0xDAC9, 0x786E, 0xDACC, + 0x786F, 0xB578, 0x7870, 0xDACD, 0x7871, 0xDACA, 0x7879, 0xDEEE, 0x787B, 0xDEF2, 0x787C, 0xB84E, 0x787E, 0xE2F0, 0x787F, 0xB851, + 0x7880, 0xDEF0, 0x7881, 0xF9D6, 0x7883, 0xDEED, 0x7884, 0xDEE8, 0x7885, 0xDEEA, 0x7886, 0xDEEB, 0x7887, 0xDEE4, 0x7889, 0xB84D, + 0x788C, 0xB84C, 0x788E, 0xB848, 0x788F, 0xDEE7, 0x7891, 0xB84F, 0x7893, 0xB850, 0x7894, 0xDEE6, 0x7895, 0xDEE9, 0x7896, 0xDEF1, + 0x7897, 0xB84A, 0x7898, 0xB84B, 0x7899, 0xDEEF, 0x789A, 0xDEE5, 0x789E, 0xE2F2, 0x789F, 0xBAD0, 0x78A0, 0xE2F4, 0x78A1, 0xDEEC, + 0x78A2, 0xE2F6, 0x78A3, 0xBAD4, 0x78A4, 0xE2F7, 0x78A5, 0xE2F3, 0x78A7, 0xBAD1, 0x78A8, 0xE2EF, 0x78A9, 0xBAD3, 0x78AA, 0xE2EC, + 0x78AB, 0xE2F1, 0x78AC, 0xE2F5, 0x78AD, 0xE2EE, 0x78B0, 0xB849, 0x78B2, 0xE2EB, 0x78B3, 0xBAD2, 0x78B4, 0xE2ED, 0x78BA, 0xBD54, + 0x78BB, 0xE6C1, 0x78BC, 0xBD58, 0x78BE, 0xBD56, 0x78C1, 0xBACF, 0x78C3, 0xE6C8, 0x78C4, 0xE6C9, 0x78C5, 0xBD53, 0x78C8, 0xE6C7, + 0x78C9, 0xE6CA, 0x78CA, 0xBD55, 0x78CB, 0xBD52, 0x78CC, 0xE6C3, 0x78CD, 0xE6C0, 0x78CE, 0xE6C5, 0x78CF, 0xE6C2, 0x78D0, 0xBD59, + 0x78D1, 0xE6C4, 0x78D4, 0xE6C6, 0x78D5, 0xBD57, 0x78DA, 0xBF6A, 0x78DB, 0xEAA8, 0x78DD, 0xEAA2, 0x78DE, 0xEAA6, 0x78DF, 0xEAAC, + 0x78E0, 0xEAAD, 0x78E1, 0xEAA9, 0x78E2, 0xEAAA, 0x78E3, 0xEAA7, 0x78E5, 0xEAA4, 0x78E7, 0xBF6C, 0x78E8, 0xBF69, 0x78E9, 0xEAA3, + 0x78EA, 0xEAA5, 0x78EC, 0xBF6B, 0x78ED, 0xEAAB, 0x78EF, 0xC146, 0x78F2, 0xEDAA, 0x78F3, 0xEDA5, 0x78F4, 0xC145, 0x78F7, 0xC143, + 0x78F9, 0xEDAC, 0x78FA, 0xC144, 0x78FB, 0xEDA8, 0x78FC, 0xEDA9, 0x78FD, 0xEDA6, 0x78FE, 0xEDAD, 0x78FF, 0xF056, 0x7901, 0xC147, + 0x7902, 0xEDA7, 0x7904, 0xEDAE, 0x7905, 0xEDAB, 0x7909, 0xF05A, 0x790C, 0xF057, 0x790E, 0xC2A6, 0x7910, 0xF05B, 0x7911, 0xF05D, + 0x7912, 0xF05C, 0x7913, 0xF058, 0x7914, 0xF059, 0x7917, 0xF2A3, 0x7919, 0xC3AA, 0x791B, 0xF27E, 0x791C, 0xF2A2, 0x791D, 0xF27D, + 0x791E, 0xF2A4, 0x7921, 0xF2A1, 0x7923, 0xF47A, 0x7924, 0xF47D, 0x7925, 0xF479, 0x7926, 0xC471, 0x7927, 0xF47B, 0x7928, 0xF47C, + 0x7929, 0xF47E, 0x792A, 0xC472, 0x792B, 0xC474, 0x792C, 0xC473, 0x792D, 0xF5E1, 0x792F, 0xF5E3, 0x7931, 0xF5E2, 0x7935, 0xF6F6, + 0x7938, 0xF8B5, 0x7939, 0xF8FA, 0x793A, 0xA5DC, 0x793D, 0xCB72, 0x793E, 0xAAC0, 0x793F, 0xCDA3, 0x7940, 0xAAC1, 0x7941, 0xAAC2, + 0x7942, 0xCDA2, 0x7944, 0xCFF8, 0x7945, 0xCFF7, 0x7946, 0xACE6, 0x7947, 0xACE9, 0x7948, 0xACE8, 0x7949, 0xACE7, 0x794A, 0xCFF4, + 0x794B, 0xCFF6, 0x794C, 0xCFF5, 0x794F, 0xD2E8, 0x7950, 0xAFA7, 0x7951, 0xD2EC, 0x7952, 0xD2EB, 0x7953, 0xD2EA, 0x7954, 0xD2E6, + 0x7955, 0xAFA6, 0x7956, 0xAFAA, 0x7957, 0xAFAD, 0x795A, 0xAFAE, 0x795B, 0xD2E7, 0x795C, 0xD2E9, 0x795D, 0xAFAC, 0x795E, 0xAFAB, + 0x795F, 0xAFA9, 0x7960, 0xAFA8, 0x7961, 0xD6C2, 0x7963, 0xD6C0, 0x7964, 0xD6BC, 0x7965, 0xB2BB, 0x7967, 0xD6BD, 0x7968, 0xB2BC, + 0x7969, 0xD6BE, 0x796A, 0xD6BF, 0x796B, 0xD6C1, 0x796D, 0xB2BD, 0x7970, 0xDAD5, 0x7972, 0xDAD4, 0x7973, 0xDAD3, 0x7974, 0xDAD2, + 0x7979, 0xDEF6, 0x797A, 0xB852, 0x797C, 0xDEF3, 0x797D, 0xDEF5, 0x797F, 0xB853, 0x7981, 0xB854, 0x7982, 0xDEF4, 0x7988, 0xE341, + 0x798A, 0xE2F9, 0x798B, 0xE2FA, 0x798D, 0xBAD7, 0x798E, 0xBAD5, 0x798F, 0xBAD6, 0x7990, 0xE343, 0x7992, 0xE342, 0x7993, 0xE2FE, + 0x7994, 0xE2FD, 0x7995, 0xE2FC, 0x7996, 0xE2FB, 0x7997, 0xE340, 0x7998, 0xE2F8, 0x799A, 0xE6CB, 0x799B, 0xE6D0, 0x799C, 0xE6CE, + 0x79A0, 0xE6CD, 0x79A1, 0xE6CC, 0x79A2, 0xE6CF, 0x79A4, 0xEAAE, 0x79A6, 0xBF6D, 0x79A7, 0xC148, 0x79A8, 0xEDB0, 0x79AA, 0xC149, + 0x79AB, 0xEDAF, 0x79AC, 0xF05F, 0x79AD, 0xF05E, 0x79AE, 0xC2A7, 0x79B0, 0xF2A5, 0x79B1, 0xC3AB, 0x79B2, 0xF4A1, 0x79B3, 0xC5A1, + 0x79B4, 0xF6F7, 0x79B6, 0xF8B7, 0x79B7, 0xF8B6, 0x79B8, 0xC9A8, 0x79B9, 0xACEA, 0x79BA, 0xACEB, 0x79BB, 0xD6C3, 0x79BD, 0xB856, + 0x79BE, 0xA5DD, 0x79BF, 0xA872, 0x79C0, 0xA871, 0x79C1, 0xA870, 0x79C5, 0xCDA4, 0x79C8, 0xAAC4, 0x79C9, 0xAAC3, 0x79CB, 0xACEE, + 0x79CD, 0xCFFA, 0x79CE, 0xCFFD, 0x79CF, 0xCFFB, 0x79D1, 0xACEC, 0x79D2, 0xACED, 0x79D5, 0xCFF9, 0x79D6, 0xCFFC, 0x79D8, 0xAFB5, + 0x79DC, 0xD2F3, 0x79DD, 0xD2F5, 0x79DE, 0xD2F4, 0x79DF, 0xAFB2, 0x79E0, 0xD2EF, 0x79E3, 0xAFB0, 0x79E4, 0xAFAF, 0x79E6, 0xAFB3, + 0x79E7, 0xAFB1, 0x79E9, 0xAFB4, 0x79EA, 0xD2F2, 0x79EB, 0xD2ED, 0x79EC, 0xD2EE, 0x79ED, 0xD2F1, 0x79EE, 0xD2F0, 0x79F6, 0xD6C6, + 0x79F7, 0xD6C7, 0x79F8, 0xD6C5, 0x79FA, 0xD6C4, 0x79FB, 0xB2BE, 0x7A00, 0xB57D, 0x7A02, 0xDAD6, 0x7A03, 0xDAD8, 0x7A04, 0xDADA, + 0x7A05, 0xB57C, 0x7A08, 0xB57A, 0x7A0A, 0xDAD7, 0x7A0B, 0xB57B, 0x7A0C, 0xDAD9, 0x7A0D, 0xB579, 0x7A10, 0xDF41, 0x7A11, 0xDEF7, + 0x7A12, 0xDEFA, 0x7A13, 0xDEFE, 0x7A14, 0xB85A, 0x7A15, 0xDEFC, 0x7A17, 0xDEFB, 0x7A18, 0xDEF8, 0x7A19, 0xDEF9, 0x7A1A, 0xB858, + 0x7A1B, 0xDF40, 0x7A1C, 0xB857, 0x7A1E, 0xB85C, 0x7A1F, 0xB85B, 0x7A20, 0xB859, 0x7A22, 0xDEFD, 0x7A26, 0xE349, 0x7A28, 0xE348, + 0x7A2B, 0xE344, 0x7A2E, 0xBAD8, 0x7A2F, 0xE347, 0x7A30, 0xE346, 0x7A31, 0xBAD9, 0x7A37, 0xBD5E, 0x7A39, 0xE6D2, 0x7A3B, 0xBD5F, + 0x7A3C, 0xBD5B, 0x7A3D, 0xBD5D, 0x7A3F, 0xBD5A, 0x7A40, 0xBD5C, 0x7A44, 0xEAAF, 0x7A46, 0xBF70, 0x7A47, 0xEAB1, 0x7A48, 0xEAB0, + 0x7A4A, 0xE345, 0x7A4B, 0xBF72, 0x7A4C, 0xBF71, 0x7A4D, 0xBF6E, 0x7A4E, 0xBF6F, 0x7A54, 0xEDB5, 0x7A56, 0xEDB3, 0x7A57, 0xC14A, + 0x7A58, 0xEDB4, 0x7A5A, 0xEDB6, 0x7A5B, 0xEDB2, 0x7A5C, 0xEDB1, 0x7A5F, 0xF060, 0x7A60, 0xC2AA, 0x7A61, 0xC2A8, 0x7A62, 0xC2A9, + 0x7A67, 0xF2A6, 0x7A68, 0xF2A7, 0x7A69, 0xC3AD, 0x7A6B, 0xC3AC, 0x7A6C, 0xF4A3, 0x7A6D, 0xF4A4, 0x7A6E, 0xF4A2, 0x7A70, 0xF6F8, + 0x7A71, 0xF6F9, 0x7A74, 0xA5DE, 0x7A75, 0xCA48, 0x7A76, 0xA873, 0x7A78, 0xCDA5, 0x7A79, 0xAAC6, 0x7A7A, 0xAAC5, 0x7A7B, 0xCDA6, + 0x7A7E, 0xD040, 0x7A7F, 0xACEF, 0x7A80, 0xCFFE, 0x7A81, 0xACF0, 0x7A84, 0xAFB6, 0x7A85, 0xD2F8, 0x7A86, 0xD2F6, 0x7A87, 0xD2FC, + 0x7A88, 0xAFB7, 0x7A89, 0xD2F7, 0x7A8A, 0xD2FB, 0x7A8B, 0xD2F9, 0x7A8C, 0xD2FA, 0x7A8F, 0xD6C8, 0x7A90, 0xD6CA, 0x7A92, 0xB2BF, + 0x7A94, 0xD6C9, 0x7A95, 0xB2C0, 0x7A96, 0xB5A2, 0x7A97, 0xB5A1, 0x7A98, 0xB57E, 0x7A99, 0xDADB, 0x7A9E, 0xDF44, 0x7A9F, 0xB85D, + 0x7AA0, 0xB85E, 0x7AA2, 0xDF43, 0x7AA3, 0xDF42, 0x7AA8, 0xE34A, 0x7AA9, 0xBADB, 0x7AAA, 0xBADA, 0x7AAB, 0xE34B, 0x7AAC, 0xE34C, + 0x7AAE, 0xBD61, 0x7AAF, 0xBD60, 0x7AB1, 0xEAB5, 0x7AB2, 0xE6D3, 0x7AB3, 0xE6D5, 0x7AB4, 0xE6D4, 0x7AB5, 0xEAB4, 0x7AB6, 0xEAB2, + 0x7AB7, 0xEAB6, 0x7AB8, 0xEAB3, 0x7ABA, 0xBF73, 0x7ABE, 0xEDB7, 0x7ABF, 0xC14B, 0x7AC0, 0xEDB8, 0x7AC1, 0xEDB9, 0x7AC4, 0xC2AB, + 0x7AC5, 0xC2AC, 0x7AC7, 0xC475, 0x7ACA, 0xC5D1, 0x7ACB, 0xA5DF, 0x7AD1, 0xD041, 0x7AD8, 0xD2FD, 0x7AD9, 0xAFB8, 0x7ADF, 0xB3BA, + 0x7AE0, 0xB3B9, 0x7AE3, 0xB5A4, 0x7AE4, 0xDADD, 0x7AE5, 0xB5A3, 0x7AE6, 0xDADC, 0x7AEB, 0xDF45, 0x7AED, 0xBADC, 0x7AEE, 0xE34D, + 0x7AEF, 0xBADD, 0x7AF6, 0xC476, 0x7AF7, 0xF4A5, 0x7AF9, 0xA6CB, 0x7AFA, 0xAAC7, 0x7AFB, 0xCDA7, 0x7AFD, 0xACF2, 0x7AFF, 0xACF1, + 0x7B00, 0xD042, 0x7B01, 0xD043, 0x7B04, 0xD340, 0x7B05, 0xD342, 0x7B06, 0xAFB9, 0x7B08, 0xD344, 0x7B09, 0xD347, 0x7B0A, 0xD345, + 0x7B0E, 0xD346, 0x7B0F, 0xD343, 0x7B10, 0xD2FE, 0x7B11, 0xAFBA, 0x7B12, 0xD348, 0x7B13, 0xD341, 0x7B18, 0xD6D3, 0x7B19, 0xB2C6, + 0x7B1A, 0xD6DC, 0x7B1B, 0xB2C3, 0x7B1D, 0xD6D5, 0x7B1E, 0xB2C7, 0x7B20, 0xB2C1, 0x7B22, 0xD6D0, 0x7B23, 0xD6DD, 0x7B24, 0xD6D1, + 0x7B25, 0xD6CE, 0x7B26, 0xB2C5, 0x7B28, 0xB2C2, 0x7B2A, 0xD6D4, 0x7B2B, 0xD6D7, 0x7B2C, 0xB2C4, 0x7B2D, 0xD6D8, 0x7B2E, 0xB2C8, + 0x7B2F, 0xD6D9, 0x7B30, 0xD6CF, 0x7B31, 0xD6D6, 0x7B32, 0xD6DA, 0x7B33, 0xD6D2, 0x7B34, 0xD6CD, 0x7B35, 0xD6CB, 0x7B38, 0xD6DB, + 0x7B3B, 0xDADF, 0x7B40, 0xDAE4, 0x7B44, 0xDAE0, 0x7B45, 0xDAE6, 0x7B46, 0xB5A7, 0x7B47, 0xD6CC, 0x7B48, 0xDAE1, 0x7B49, 0xB5A5, + 0x7B4A, 0xDADE, 0x7B4B, 0xB5AC, 0x7B4C, 0xDAE2, 0x7B4D, 0xB5AB, 0x7B4E, 0xDAE3, 0x7B4F, 0xB5AD, 0x7B50, 0xB5A8, 0x7B51, 0xB5AE, + 0x7B52, 0xB5A9, 0x7B54, 0xB5AA, 0x7B56, 0xB5A6, 0x7B58, 0xDAE5, 0x7B60, 0xB861, 0x7B61, 0xDF50, 0x7B63, 0xDF53, 0x7B64, 0xDF47, + 0x7B65, 0xDF4C, 0x7B66, 0xDF46, 0x7B67, 0xB863, 0x7B69, 0xDF4A, 0x7B6D, 0xDF48, 0x7B6E, 0xB862, 0x7B70, 0xDF4F, 0x7B71, 0xDF4E, + 0x7B72, 0xDF4B, 0x7B73, 0xDF4D, 0x7B74, 0xDF49, 0x7B75, 0xBAE1, 0x7B76, 0xDF52, 0x7B77, 0xB85F, 0x7B78, 0xDF51, 0x7B82, 0xE35D, + 0x7B84, 0xBAE8, 0x7B85, 0xE358, 0x7B87, 0xBAE7, 0x7B88, 0xE34E, 0x7B8A, 0xE350, 0x7B8B, 0xBAE0, 0x7B8C, 0xE355, 0x7B8D, 0xE354, + 0x7B8E, 0xE357, 0x7B8F, 0xBAE5, 0x7B90, 0xE352, 0x7B91, 0xE351, 0x7B94, 0xBAE4, 0x7B95, 0xBADF, 0x7B96, 0xE353, 0x7B97, 0xBAE2, + 0x7B98, 0xE359, 0x7B99, 0xE35B, 0x7B9B, 0xE356, 0x7B9C, 0xE34F, 0x7B9D, 0xBAE3, 0x7BA0, 0xBD69, 0x7BA1, 0xBADE, 0x7BA4, 0xE35C, + 0x7BAC, 0xE6D9, 0x7BAD, 0xBD62, 0x7BAF, 0xE6DB, 0x7BB1, 0xBD63, 0x7BB4, 0xBD65, 0x7BB5, 0xE6DE, 0x7BB7, 0xE6D6, 0x7BB8, 0xBAE6, + 0x7BB9, 0xE6DC, 0x7BBE, 0xE6D8, 0x7BC0, 0xB860, 0x7BC1, 0xBD68, 0x7BC4, 0xBD64, 0x7BC6, 0xBD66, 0x7BC7, 0xBD67, 0x7BC9, 0xBF76, + 0x7BCA, 0xE6DD, 0x7BCB, 0xE6D7, 0x7BCC, 0xBD6A, 0x7BCE, 0xE6DA, 0x7BD4, 0xEAC0, 0x7BD5, 0xEABB, 0x7BD8, 0xEAC5, 0x7BD9, 0xBF74, + 0x7BDA, 0xEABD, 0x7BDB, 0xBF78, 0x7BDC, 0xEAC3, 0x7BDD, 0xEABA, 0x7BDE, 0xEAB7, 0x7BDF, 0xEAC6, 0x7BE0, 0xC151, 0x7BE1, 0xBF79, + 0x7BE2, 0xEAC2, 0x7BE3, 0xEAB8, 0x7BE4, 0xBF77, 0x7BE5, 0xEABC, 0x7BE6, 0xBF7B, 0x7BE7, 0xEAB9, 0x7BE8, 0xEABE, 0x7BE9, 0xBF7A, + 0x7BEA, 0xEAC1, 0x7BEB, 0xEAC4, 0x7BF0, 0xEDCB, 0x7BF1, 0xEDCC, 0x7BF2, 0xEDBC, 0x7BF3, 0xEDC3, 0x7BF4, 0xEDC1, 0x7BF7, 0xC14F, + 0x7BF8, 0xEDC8, 0x7BF9, 0xEABF, 0x7BFB, 0xEDBF, 0x7BFD, 0xEDC9, 0x7BFE, 0xC14E, 0x7BFF, 0xEDBE, 0x7C00, 0xEDBD, 0x7C01, 0xEDC7, + 0x7C02, 0xEDC4, 0x7C03, 0xEDC6, 0x7C05, 0xEDBA, 0x7C06, 0xEDCA, 0x7C07, 0xC14C, 0x7C09, 0xEDC5, 0x7C0A, 0xEDCE, 0x7C0B, 0xEDC2, + 0x7C0C, 0xC150, 0x7C0D, 0xC14D, 0x7C0E, 0xEDC0, 0x7C0F, 0xEDBB, 0x7C10, 0xEDCD, 0x7C11, 0xBF75, 0x7C19, 0xF063, 0x7C1C, 0xF061, + 0x7C1D, 0xF067, 0x7C1E, 0xC2B0, 0x7C1F, 0xF065, 0x7C20, 0xF064, 0x7C21, 0xC2B2, 0x7C22, 0xF06A, 0x7C23, 0xC2B1, 0x7C25, 0xF06B, + 0x7C26, 0xF068, 0x7C27, 0xC2AE, 0x7C28, 0xF069, 0x7C29, 0xF062, 0x7C2A, 0xC2AF, 0x7C2B, 0xC2AD, 0x7C2C, 0xF2AB, 0x7C2D, 0xF066, + 0x7C30, 0xF06C, 0x7C33, 0xF2A8, 0x7C37, 0xC3B2, 0x7C38, 0xC3B0, 0x7C39, 0xF2AA, 0x7C3B, 0xF2AC, 0x7C3C, 0xF2A9, 0x7C3D, 0xC3B1, + 0x7C3E, 0xC3AE, 0x7C3F, 0xC3AF, 0x7C40, 0xC3B3, 0x7C43, 0xC478, 0x7C45, 0xF4AA, 0x7C47, 0xF4A9, 0x7C48, 0xF4A7, 0x7C49, 0xF4A6, + 0x7C4A, 0xF4A8, 0x7C4C, 0xC477, 0x7C4D, 0xC479, 0x7C50, 0xC4F0, 0x7C53, 0xF5E5, 0x7C54, 0xF5E4, 0x7C57, 0xF6FA, 0x7C59, 0xF6FC, + 0x7C5A, 0xF6FE, 0x7C5B, 0xF6FD, 0x7C5C, 0xF6FB, 0x7C5F, 0xC5A3, 0x7C60, 0xC5A2, 0x7C63, 0xC5D3, 0x7C64, 0xC5D2, 0x7C65, 0xC5D4, + 0x7C66, 0xF7ED, 0x7C67, 0xF7EC, 0x7C69, 0xF8FB, 0x7C6A, 0xF8B8, 0x7C6B, 0xF8FC, 0x7C6C, 0xC658, 0x7C6E, 0xC659, 0x7C6F, 0xF96D, + 0x7C72, 0xC67E, 0x7C73, 0xA6CC, 0x7C75, 0xCDA8, 0x7C78, 0xD045, 0x7C79, 0xD046, 0x7C7A, 0xD044, 0x7C7D, 0xACF3, 0x7C7F, 0xD047, + 0x7C80, 0xD048, 0x7C81, 0xD049, 0x7C84, 0xD349, 0x7C85, 0xD34F, 0x7C88, 0xD34D, 0x7C89, 0xAFBB, 0x7C8A, 0xD34B, 0x7C8C, 0xD34C, + 0x7C8D, 0xD34E, 0x7C91, 0xD34A, 0x7C92, 0xB2C9, 0x7C94, 0xD6DE, 0x7C95, 0xB2CB, 0x7C96, 0xD6E0, 0x7C97, 0xB2CA, 0x7C98, 0xD6DF, + 0x7C9E, 0xDAE8, 0x7C9F, 0xB5AF, 0x7CA1, 0xDAEA, 0x7CA2, 0xDAE7, 0x7CA3, 0xD6E1, 0x7CA5, 0xB5B0, 0x7CA7, 0xF9DB, 0x7CA8, 0xDAE9, + 0x7CAF, 0xDF56, 0x7CB1, 0xB864, 0x7CB2, 0xDF54, 0x7CB3, 0xB865, 0x7CB4, 0xDF55, 0x7CB5, 0xB866, 0x7CB9, 0xBAE9, 0x7CBA, 0xE361, + 0x7CBB, 0xE35E, 0x7CBC, 0xE360, 0x7CBD, 0xBAEA, 0x7CBE, 0xBAEB, 0x7CBF, 0xE35F, 0x7CC5, 0xE6DF, 0x7CC8, 0xE6E0, 0x7CCA, 0xBD6B, + 0x7CCB, 0xE6E2, 0x7CCC, 0xE6E1, 0x7CCE, 0xA261, 0x7CD0, 0xEACA, 0x7CD1, 0xEACB, 0x7CD2, 0xEAC7, 0x7CD4, 0xEAC8, 0x7CD5, 0xBF7C, + 0x7CD6, 0xBF7D, 0x7CD7, 0xEAC9, 0x7CD9, 0xC157, 0x7CDC, 0xC153, 0x7CDD, 0xC158, 0x7CDE, 0xC154, 0x7CDF, 0xC156, 0x7CE0, 0xC152, + 0x7CE2, 0xC155, 0x7CE7, 0xC2B3, 0x7CE8, 0xEDCF, 0x7CEA, 0xF2AE, 0x7CEC, 0xF2AD, 0x7CEE, 0xF4AB, 0x7CEF, 0xC47A, 0x7CF0, 0xC47B, + 0x7CF1, 0xF741, 0x7CF2, 0xF5E6, 0x7CF4, 0xF740, 0x7CF6, 0xF8FD, 0x7CF7, 0xF9A4, 0x7CF8, 0xA6CD, 0x7CFB, 0xA874, 0x7CFD, 0xCDA9, + 0x7CFE, 0xAAC8, 0x7D00, 0xACF6, 0x7D01, 0xD04C, 0x7D02, 0xACF4, 0x7D03, 0xD04A, 0x7D04, 0xACF9, 0x7D05, 0xACF5, 0x7D06, 0xACFA, + 0x7D07, 0xACF8, 0x7D08, 0xD04B, 0x7D09, 0xACF7, 0x7D0A, 0xAFBF, 0x7D0B, 0xAFBE, 0x7D0C, 0xD35A, 0x7D0D, 0xAFC7, 0x7D0E, 0xD353, + 0x7D0F, 0xD359, 0x7D10, 0xAFC3, 0x7D11, 0xD352, 0x7D12, 0xD358, 0x7D13, 0xD356, 0x7D14, 0xAFC2, 0x7D15, 0xAFC4, 0x7D16, 0xD355, + 0x7D17, 0xAFBD, 0x7D18, 0xD354, 0x7D19, 0xAFC8, 0x7D1A, 0xAFC5, 0x7D1B, 0xAFC9, 0x7D1C, 0xAFC6, 0x7D1D, 0xD351, 0x7D1E, 0xD350, + 0x7D1F, 0xD357, 0x7D20, 0xAFC0, 0x7D21, 0xAFBC, 0x7D22, 0xAFC1, 0x7D28, 0xD6F0, 0x7D29, 0xD6E9, 0x7D2B, 0xB5B5, 0x7D2C, 0xD6E8, + 0x7D2E, 0xB2CF, 0x7D2F, 0xB2D6, 0x7D30, 0xB2D3, 0x7D31, 0xB2D9, 0x7D32, 0xB2D8, 0x7D33, 0xB2D4, 0x7D35, 0xD6E2, 0x7D36, 0xD6E5, + 0x7D38, 0xD6E4, 0x7D39, 0xB2D0, 0x7D3A, 0xD6E6, 0x7D3B, 0xD6EF, 0x7D3C, 0xB2D1, 0x7D3D, 0xD6E3, 0x7D3E, 0xD6EC, 0x7D3F, 0xD6ED, + 0x7D40, 0xB2D2, 0x7D41, 0xD6EA, 0x7D42, 0xB2D7, 0x7D43, 0xB2CD, 0x7D44, 0xB2D5, 0x7D45, 0xD6E7, 0x7D46, 0xB2CC, 0x7D47, 0xD6EB, + 0x7D4A, 0xD6EE, 0x7D4E, 0xDAFB, 0x7D4F, 0xDAF2, 0x7D50, 0xB5B2, 0x7D51, 0xDAF9, 0x7D52, 0xDAF6, 0x7D53, 0xDAEE, 0x7D54, 0xDAF7, + 0x7D55, 0xB5B4, 0x7D56, 0xDAEF, 0x7D58, 0xDAEB, 0x7D5B, 0xB86C, 0x7D5C, 0xDAF4, 0x7D5E, 0xB5B1, 0x7D5F, 0xDAFA, 0x7D61, 0xB5B8, + 0x7D62, 0xB5BA, 0x7D63, 0xDAED, 0x7D66, 0xB5B9, 0x7D67, 0xDAF0, 0x7D68, 0xB5B3, 0x7D69, 0xDAF8, 0x7D6A, 0xDAF1, 0x7D6B, 0xDAF5, + 0x7D6D, 0xDAF3, 0x7D6E, 0xB5B6, 0x7D6F, 0xDAEC, 0x7D70, 0xB5BB, 0x7D71, 0xB2CE, 0x7D72, 0xB5B7, 0x7D73, 0xB5BC, 0x7D79, 0xB868, + 0x7D7A, 0xDF5D, 0x7D7B, 0xDF5F, 0x7D7C, 0xDF61, 0x7D7D, 0xDF65, 0x7D7F, 0xDF5B, 0x7D80, 0xDF59, 0x7D81, 0xB86A, 0x7D83, 0xDF60, + 0x7D84, 0xDF64, 0x7D85, 0xDF5C, 0x7D86, 0xDF58, 0x7D88, 0xDF57, 0x7D8C, 0xDF62, 0x7D8D, 0xDF5A, 0x7D8E, 0xDF5E, 0x7D8F, 0xB86B, + 0x7D91, 0xB869, 0x7D92, 0xDF66, 0x7D93, 0xB867, 0x7D94, 0xDF63, 0x7D96, 0xE372, 0x7D9C, 0xBAEE, 0x7D9D, 0xE36A, 0x7D9E, 0xBD78, + 0x7D9F, 0xE374, 0x7DA0, 0xBAF1, 0x7DA1, 0xE378, 0x7DA2, 0xBAF7, 0x7DA3, 0xE365, 0x7DA6, 0xE375, 0x7DA7, 0xE362, 0x7DA9, 0xE377, + 0x7DAA, 0xE366, 0x7DAC, 0xBAFE, 0x7DAD, 0xBAFB, 0x7DAE, 0xE376, 0x7DAF, 0xE370, 0x7DB0, 0xBAED, 0x7DB1, 0xBAF5, 0x7DB2, 0xBAF4, + 0x7DB4, 0xBAF3, 0x7DB5, 0xBAF9, 0x7DB7, 0xE363, 0x7DB8, 0xBAFA, 0x7DB9, 0xE371, 0x7DBA, 0xBAF6, 0x7DBB, 0xBAEC, 0x7DBC, 0xE373, + 0x7DBD, 0xBAEF, 0x7DBE, 0xBAF0, 0x7DBF, 0xBAF8, 0x7DC0, 0xE368, 0x7DC1, 0xE367, 0x7DC2, 0xE364, 0x7DC4, 0xE36C, 0x7DC5, 0xE369, + 0x7DC6, 0xE36D, 0x7DC7, 0xBAFD, 0x7DC9, 0xE379, 0x7DCA, 0xBAF2, 0x7DCB, 0xE36E, 0x7DCC, 0xE36F, 0x7DCE, 0xE36B, 0x7DD2, 0xBAFC, + 0x7DD7, 0xE6E7, 0x7DD8, 0xBD70, 0x7DD9, 0xBD79, 0x7DDA, 0xBD75, 0x7DDB, 0xE6E4, 0x7DDD, 0xBD72, 0x7DDE, 0xBD76, 0x7DDF, 0xE6F0, + 0x7DE0, 0xBD6C, 0x7DE1, 0xE6E8, 0x7DE3, 0xBD74, 0x7DE6, 0xE6EB, 0x7DE7, 0xE6E6, 0x7DE8, 0xBD73, 0x7DE9, 0xBD77, 0x7DEA, 0xE6E5, + 0x7DEC, 0xBD71, 0x7DEE, 0xE6EF, 0x7DEF, 0xBD6E, 0x7DF0, 0xE6EE, 0x7DF1, 0xE6ED, 0x7DF2, 0xBD7A, 0x7DF3, 0xE572, 0x7DF4, 0xBD6D, + 0x7DF6, 0xE6EC, 0x7DF7, 0xE6E3, 0x7DF9, 0xBD7B, 0x7DFA, 0xE6EA, 0x7DFB, 0xBD6F, 0x7E03, 0xE6E9, 0x7E08, 0xBFA2, 0x7E09, 0xBFA7, + 0x7E0A, 0xBF7E, 0x7E0B, 0xEAD8, 0x7E0C, 0xEACF, 0x7E0D, 0xEADB, 0x7E0E, 0xEAD3, 0x7E0F, 0xEAD9, 0x7E10, 0xBFA8, 0x7E11, 0xBFA1, + 0x7E12, 0xEACC, 0x7E13, 0xEAD2, 0x7E14, 0xEADC, 0x7E15, 0xEAD5, 0x7E16, 0xEADA, 0x7E17, 0xEACE, 0x7E1A, 0xEAD6, 0x7E1B, 0xBFA3, + 0x7E1C, 0xEAD4, 0x7E1D, 0xBFA6, 0x7E1E, 0xBFA5, 0x7E1F, 0xEAD0, 0x7E20, 0xEAD1, 0x7E21, 0xEACD, 0x7E22, 0xEAD7, 0x7E23, 0xBFA4, + 0x7E24, 0xEADE, 0x7E25, 0xEADD, 0x7E29, 0xEDDA, 0x7E2A, 0xEDD6, 0x7E2B, 0xC15F, 0x7E2D, 0xEDD0, 0x7E2E, 0xC159, 0x7E2F, 0xC169, + 0x7E30, 0xEDDC, 0x7E31, 0xC161, 0x7E32, 0xC15D, 0x7E33, 0xEDD3, 0x7E34, 0xC164, 0x7E35, 0xC167, 0x7E36, 0xEDDE, 0x7E37, 0xC15C, + 0x7E38, 0xEDD5, 0x7E39, 0xC165, 0x7E3A, 0xEDE0, 0x7E3B, 0xEDDD, 0x7E3C, 0xEDD1, 0x7E3D, 0xC160, 0x7E3E, 0xC15A, 0x7E3F, 0xC168, + 0x7E40, 0xEDD8, 0x7E41, 0xC163, 0x7E42, 0xEDD2, 0x7E43, 0xC15E, 0x7E44, 0xEDDF, 0x7E45, 0xC162, 0x7E46, 0xC15B, 0x7E47, 0xEDD9, + 0x7E48, 0xC166, 0x7E49, 0xEDD7, 0x7E4C, 0xEDDB, 0x7E50, 0xF06E, 0x7E51, 0xF074, 0x7E52, 0xC2B9, 0x7E53, 0xF077, 0x7E54, 0xC2B4, + 0x7E55, 0xC2B5, 0x7E56, 0xF06F, 0x7E57, 0xF076, 0x7E58, 0xF071, 0x7E59, 0xC2BA, 0x7E5A, 0xC2B7, 0x7E5C, 0xF06D, 0x7E5E, 0xC2B6, + 0x7E5F, 0xF073, 0x7E60, 0xF075, 0x7E61, 0xC2B8, 0x7E62, 0xF072, 0x7E63, 0xF070, 0x7E68, 0xF2B8, 0x7E69, 0xC3B7, 0x7E6A, 0xC3B8, + 0x7E6B, 0xC3B4, 0x7E6D, 0xC3B5, 0x7E6F, 0xF2B4, 0x7E70, 0xF2B2, 0x7E72, 0xF2B6, 0x7E73, 0xC3BA, 0x7E74, 0xF2B7, 0x7E75, 0xF2B0, + 0x7E76, 0xF2AF, 0x7E77, 0xF2B3, 0x7E78, 0xF2B1, 0x7E79, 0xC3B6, 0x7E7A, 0xF2B5, 0x7E7B, 0xF4AC, 0x7E7C, 0xC47E, 0x7E7D, 0xC47D, + 0x7E7E, 0xF4AD, 0x7E80, 0xF4AF, 0x7E81, 0xF4AE, 0x7E82, 0xC4A1, 0x7E86, 0xF5EB, 0x7E87, 0xF5E8, 0x7E88, 0xF5E9, 0x7E8A, 0xF5E7, + 0x7E8B, 0xF5EA, 0x7E8C, 0xC4F2, 0x7E8D, 0xF5EC, 0x7E8F, 0xC4F1, 0x7E91, 0xF742, 0x7E93, 0xC5D5, 0x7E94, 0xC5D7, 0x7E95, 0xF7EE, + 0x7E96, 0xC5D6, 0x7E97, 0xF8B9, 0x7E98, 0xF940, 0x7E99, 0xF942, 0x7E9A, 0xF8FE, 0x7E9B, 0xF941, 0x7E9C, 0xC66C, 0x7F36, 0xA6CE, + 0x7F38, 0xACFB, 0x7F39, 0xD26F, 0x7F3A, 0xAFCA, 0x7F3D, 0xB2DA, 0x7F3E, 0xDAFC, 0x7F3F, 0xDAFD, 0x7F43, 0xEADF, 0x7F44, 0xC16A, + 0x7F45, 0xEDE1, 0x7F48, 0xC2BB, 0x7F4A, 0xF2BA, 0x7F4B, 0xF2B9, 0x7F4C, 0xC4A2, 0x7F4D, 0xF5ED, 0x7F4F, 0xF743, 0x7F50, 0xC5F8, + 0x7F51, 0xCA49, 0x7F54, 0xAAC9, 0x7F55, 0xA875, 0x7F58, 0xD04D, 0x7F5B, 0xD360, 0x7F5C, 0xD35B, 0x7F5D, 0xD35F, 0x7F5E, 0xD35D, + 0x7F5F, 0xAFCB, 0x7F60, 0xD35E, 0x7F61, 0xD35C, 0x7F63, 0xD6F1, 0x7F65, 0xDAFE, 0x7F66, 0xDB40, 0x7F67, 0xDF69, 0x7F68, 0xDF6A, + 0x7F69, 0xB86E, 0x7F6A, 0xB86F, 0x7F6B, 0xDF68, 0x7F6C, 0xDF6B, 0x7F6D, 0xDF67, 0x7F6E, 0xB86D, 0x7F70, 0xBB40, 0x7F72, 0xB870, + 0x7F73, 0xE37A, 0x7F75, 0xBD7C, 0x7F76, 0xE6F1, 0x7F77, 0xBD7D, 0x7F79, 0xBFA9, 0x7F7A, 0xEAE2, 0x7F7B, 0xEAE0, 0x7F7C, 0xEAE1, + 0x7F7D, 0xEDE4, 0x7F7E, 0xEDE3, 0x7F7F, 0xEDE2, 0x7F83, 0xF2BB, 0x7F85, 0xC3B9, 0x7F86, 0xF2BC, 0x7F87, 0xF744, 0x7F88, 0xC5F9, + 0x7F89, 0xF8BA, 0x7F8A, 0xA6CF, 0x7F8B, 0xAACB, 0x7F8C, 0xAACA, 0x7F8D, 0xD04F, 0x7F8E, 0xACFC, 0x7F91, 0xD04E, 0x7F92, 0xD362, + 0x7F94, 0xAFCC, 0x7F95, 0xD6F2, 0x7F96, 0xD361, 0x7F9A, 0xB2DC, 0x7F9B, 0xD6F5, 0x7F9C, 0xD6F3, 0x7F9D, 0xD6F4, 0x7F9E, 0xB2DB, + 0x7FA0, 0xDB42, 0x7FA1, 0xDB43, 0x7FA2, 0xDB41, 0x7FA4, 0xB873, 0x7FA5, 0xDF6D, 0x7FA6, 0xDF6C, 0x7FA7, 0xDF6E, 0x7FA8, 0xB872, + 0x7FA9, 0xB871, 0x7FAC, 0xE6F2, 0x7FAD, 0xE6F4, 0x7FAF, 0xBD7E, 0x7FB0, 0xE6F3, 0x7FB1, 0xEAE3, 0x7FB2, 0xBFAA, 0x7FB3, 0xF079, + 0x7FB5, 0xF078, 0x7FB6, 0xC3BB, 0x7FB7, 0xF2BD, 0x7FB8, 0xC3BD, 0x7FB9, 0xC3BC, 0x7FBA, 0xF4B0, 0x7FBB, 0xF5EE, 0x7FBC, 0xC4F3, + 0x7FBD, 0xA6D0, 0x7FBE, 0xD050, 0x7FBF, 0xACFD, 0x7FC0, 0xD365, 0x7FC1, 0xAFCE, 0x7FC2, 0xD364, 0x7FC3, 0xD363, 0x7FC5, 0xAFCD, + 0x7FC7, 0xD6FB, 0x7FC9, 0xD6FD, 0x7FCA, 0xD6F6, 0x7FCB, 0xD6F7, 0x7FCC, 0xB2DD, 0x7FCD, 0xD6F8, 0x7FCE, 0xB2DE, 0x7FCF, 0xD6FC, + 0x7FD0, 0xD6F9, 0x7FD1, 0xD6FA, 0x7FD2, 0xB2DF, 0x7FD4, 0xB5BE, 0x7FD5, 0xB5BF, 0x7FD7, 0xDB44, 0x7FDB, 0xDF6F, 0x7FDC, 0xDF70, + 0x7FDE, 0xE37E, 0x7FDF, 0xBB43, 0x7FE0, 0xBB41, 0x7FE1, 0xBB42, 0x7FE2, 0xE37B, 0x7FE3, 0xE37C, 0x7FE5, 0xE37D, 0x7FE6, 0xE6F9, + 0x7FE8, 0xE6FA, 0x7FE9, 0xBDA1, 0x7FEA, 0xE6F7, 0x7FEB, 0xE6F6, 0x7FEC, 0xE6F8, 0x7FED, 0xE6F5, 0x7FEE, 0xBFAD, 0x7FEF, 0xEAE4, + 0x7FF0, 0xBFAB, 0x7FF1, 0xBFAC, 0x7FF2, 0xEDE6, 0x7FF3, 0xC16B, 0x7FF4, 0xEDE5, 0x7FF5, 0xEFA8, 0x7FF7, 0xF07A, 0x7FF8, 0xF07B, + 0x7FF9, 0xC2BC, 0x7FFB, 0xC2BD, 0x7FFC, 0xC16C, 0x7FFD, 0xF2BE, 0x7FFE, 0xF2BF, 0x7FFF, 0xF4B1, 0x8000, 0xC4A3, 0x8001, 0xA6D1, + 0x8003, 0xA6D2, 0x8004, 0xACFE, 0x8005, 0xAACC, 0x8006, 0xAFCF, 0x8007, 0xD051, 0x800B, 0xB5C0, 0x800C, 0xA6D3, 0x800D, 0xAD41, + 0x800E, 0xD052, 0x800F, 0xD053, 0x8010, 0xAD40, 0x8011, 0xAD42, 0x8012, 0xA6D4, 0x8014, 0xD054, 0x8015, 0xAFD1, 0x8016, 0xD366, + 0x8017, 0xAFD3, 0x8018, 0xAFD0, 0x8019, 0xAFD2, 0x801B, 0xD741, 0x801C, 0xB2E0, 0x801E, 0xD740, 0x801F, 0xD6FE, 0x8021, 0xDF71, + 0x8024, 0xE3A1, 0x8026, 0xBDA2, 0x8028, 0xBFAE, 0x8029, 0xEAE6, 0x802A, 0xEAE5, 0x802C, 0xEDE7, 0x8030, 0xF5EF, 0x8033, 0xA6D5, + 0x8034, 0xCB73, 0x8035, 0xCDAA, 0x8036, 0xAD43, 0x8037, 0xD055, 0x8039, 0xD368, 0x803D, 0xAFD4, 0x803E, 0xD367, 0x803F, 0xAFD5, + 0x8043, 0xD743, 0x8046, 0xB2E2, 0x8047, 0xD742, 0x8048, 0xD744, 0x804A, 0xB2E1, 0x804F, 0xDB46, 0x8050, 0xDB47, 0x8051, 0xDB45, + 0x8052, 0xB5C1, 0x8056, 0xB874, 0x8058, 0xB875, 0x805A, 0xBB45, 0x805C, 0xE3A3, 0x805D, 0xE3A2, 0x805E, 0xBB44, 0x8064, 0xE6FB, + 0x8067, 0xE6FC, 0x806C, 0xEAE7, 0x806F, 0xC170, 0x8070, 0xC16F, 0x8071, 0xC16D, 0x8072, 0xC16E, 0x8073, 0xC171, 0x8075, 0xF07C, + 0x8076, 0xC2BF, 0x8077, 0xC2BE, 0x8078, 0xF2C0, 0x8079, 0xF4B2, 0x807D, 0xC5A5, 0x807E, 0xC5A4, 0x807F, 0xA6D6, 0x8082, 0xD1FB, + 0x8084, 0xB877, 0x8085, 0xB5C2, 0x8086, 0xB876, 0x8087, 0xBB46, 0x8089, 0xA6D7, 0x808A, 0xC9A9, 0x808B, 0xA6D8, 0x808C, 0xA6D9, + 0x808F, 0xCDAB, 0x8090, 0xCB76, 0x8092, 0xCB77, 0x8093, 0xA877, 0x8095, 0xCB74, 0x8096, 0xA876, 0x8098, 0xA879, 0x8099, 0xCB75, + 0x809A, 0xA87B, 0x809B, 0xA87A, 0x809C, 0xCB78, 0x809D, 0xA878, 0x80A1, 0xAAD1, 0x80A2, 0xAACF, 0x80A3, 0xCDAD, 0x80A5, 0xAACE, + 0x80A9, 0xAAD3, 0x80AA, 0xAAD5, 0x80AB, 0xAAD2, 0x80AD, 0xCDB0, 0x80AE, 0xCDAC, 0x80AF, 0xAAD6, 0x80B1, 0xAAD0, 0x80B2, 0xA87C, + 0x80B4, 0xAAD4, 0x80B5, 0xCDAF, 0x80B8, 0xCDAE, 0x80BA, 0xAACD, 0x80C2, 0xD05B, 0x80C3, 0xAD47, 0x80C4, 0xAD48, 0x80C5, 0xD05D, + 0x80C7, 0xD057, 0x80C8, 0xD05A, 0x80C9, 0xD063, 0x80CA, 0xD061, 0x80CC, 0xAD49, 0x80CD, 0xD067, 0x80CE, 0xAD4C, 0x80CF, 0xD064, + 0x80D0, 0xD05C, 0x80D1, 0xD059, 0x80D4, 0xDB49, 0x80D5, 0xD062, 0x80D6, 0xAD44, 0x80D7, 0xD065, 0x80D8, 0xD056, 0x80D9, 0xD05F, + 0x80DA, 0xAD46, 0x80DB, 0xAD4B, 0x80DC, 0xD060, 0x80DD, 0xAD4F, 0x80DE, 0xAD4D, 0x80E0, 0xD058, 0x80E1, 0xAD4A, 0x80E3, 0xD05E, + 0x80E4, 0xAD4E, 0x80E5, 0xAD45, 0x80E6, 0xD066, 0x80ED, 0xAFDA, 0x80EF, 0xAFE3, 0x80F0, 0xAFD8, 0x80F1, 0xAFD6, 0x80F2, 0xD36A, + 0x80F3, 0xAFDE, 0x80F4, 0xAFDB, 0x80F5, 0xD36C, 0x80F8, 0xAFDD, 0x80F9, 0xD36B, 0x80FA, 0xD369, 0x80FB, 0xD36E, 0x80FC, 0xAFE2, + 0x80FD, 0xAFE0, 0x80FE, 0xDB48, 0x8100, 0xD36F, 0x8101, 0xD36D, 0x8102, 0xAFD7, 0x8105, 0xAFD9, 0x8106, 0xAFDC, 0x8108, 0xAFDF, + 0x810A, 0xAFE1, 0x8115, 0xD74E, 0x8116, 0xB2E4, 0x8118, 0xD745, 0x8119, 0xD747, 0x811B, 0xD748, 0x811D, 0xD750, 0x811E, 0xD74C, + 0x811F, 0xD74A, 0x8121, 0xD74D, 0x8122, 0xD751, 0x8123, 0xB2E5, 0x8124, 0xB2E9, 0x8125, 0xD746, 0x8127, 0xD74F, 0x8129, 0xB2E7, + 0x812B, 0xB2E6, 0x812C, 0xD74B, 0x812D, 0xD749, 0x812F, 0xB2E3, 0x8130, 0xB2E8, 0x8139, 0xB5C8, 0x813A, 0xDB51, 0x813D, 0xDB4F, + 0x813E, 0xB5CA, 0x8143, 0xDB4A, 0x8144, 0xDFA1, 0x8146, 0xB5C9, 0x8147, 0xDB4E, 0x814A, 0xDB4B, 0x814B, 0xB5C5, 0x814C, 0xB5CB, + 0x814D, 0xDB50, 0x814E, 0xB5C7, 0x814F, 0xDB4D, 0x8150, 0xBB47, 0x8151, 0xB5C6, 0x8152, 0xDB4C, 0x8153, 0xB5CC, 0x8154, 0xB5C4, + 0x8155, 0xB5C3, 0x815B, 0xDF77, 0x815C, 0xDF75, 0x815E, 0xDF7B, 0x8160, 0xDF73, 0x8161, 0xDFA2, 0x8162, 0xDF78, 0x8164, 0xDF72, + 0x8165, 0xB87B, 0x8166, 0xB8A3, 0x8167, 0xDF7D, 0x8169, 0xDF76, 0x816B, 0xB87E, 0x816E, 0xB87C, 0x816F, 0xDF7E, 0x8170, 0xB879, + 0x8171, 0xB878, 0x8172, 0xDF79, 0x8173, 0xB87D, 0x8174, 0xB5CD, 0x8176, 0xDF7C, 0x8177, 0xDF74, 0x8178, 0xB87A, 0x8179, 0xB8A1, + 0x817A, 0xB8A2, 0x817F, 0xBB4C, 0x8180, 0xBB48, 0x8182, 0xBB4D, 0x8183, 0xE3A6, 0x8186, 0xE3A5, 0x8187, 0xE3A7, 0x8188, 0xBB4A, + 0x8189, 0xE3A4, 0x818A, 0xBB4B, 0x818B, 0xE3AA, 0x818C, 0xE3A9, 0x818D, 0xE3A8, 0x818F, 0xBB49, 0x8195, 0xE741, 0x8197, 0xE744, + 0x8198, 0xBDA8, 0x8199, 0xE743, 0x819A, 0xBDA7, 0x819B, 0xBDA3, 0x819C, 0xBDA4, 0x819D, 0xBDA5, 0x819E, 0xE740, 0x819F, 0xE6FE, + 0x81A0, 0xBDA6, 0x81A2, 0xE742, 0x81A3, 0xE6FD, 0x81A6, 0xEAE9, 0x81A7, 0xEAF3, 0x81A8, 0xBFB1, 0x81A9, 0xBFB0, 0x81AB, 0xEAED, + 0x81AC, 0xEAEF, 0x81AE, 0xEAEA, 0x81B0, 0xEAEE, 0x81B1, 0xEAE8, 0x81B2, 0xEAF1, 0x81B3, 0xBFAF, 0x81B4, 0xEAF0, 0x81B5, 0xEAEC, + 0x81B7, 0xEAF2, 0x81B9, 0xEAEB, 0x81BA, 0xC174, 0x81BB, 0xEDE8, 0x81BC, 0xEDEE, 0x81BD, 0xC178, 0x81BE, 0xC17A, 0x81BF, 0xC177, + 0x81C0, 0xC176, 0x81C2, 0xC175, 0x81C3, 0xC173, 0x81C4, 0xEDE9, 0x81C5, 0xEDEC, 0x81C6, 0xC172, 0x81C7, 0xEDED, 0x81C9, 0xC179, + 0x81CA, 0xEDEB, 0x81CC, 0xEDEA, 0x81CD, 0xC2C0, 0x81CF, 0xC2C1, 0x81D0, 0xF0A1, 0x81D1, 0xF07D, 0x81D2, 0xF07E, 0x81D5, 0xF2C2, + 0x81D7, 0xF2C1, 0x81D8, 0xC3BE, 0x81D9, 0xF4B4, 0x81DA, 0xC4A4, 0x81DB, 0xF4B3, 0x81DD, 0xF5F0, 0x81DE, 0xF745, 0x81DF, 0xC5A6, + 0x81E0, 0xF943, 0x81E1, 0xF944, 0x81E2, 0xC5D8, 0x81E3, 0xA6DA, 0x81E5, 0xAAD7, 0x81E6, 0xDB52, 0x81E7, 0xBB4E, 0x81E8, 0xC17B, + 0x81E9, 0xEDEF, 0x81EA, 0xA6DB, 0x81EC, 0xAFE5, 0x81ED, 0xAFE4, 0x81EE, 0xDB53, 0x81F2, 0xEAF4, 0x81F3, 0xA6DC, 0x81F4, 0xAD50, + 0x81F7, 0xDB54, 0x81F8, 0xDB55, 0x81F9, 0xDB56, 0x81FA, 0xBB4F, 0x81FB, 0xBFB2, 0x81FC, 0xA6DD, 0x81FE, 0xAAD8, 0x81FF, 0xD068, + 0x8200, 0xAFE6, 0x8201, 0xD370, 0x8202, 0xB2EA, 0x8204, 0xDB57, 0x8205, 0xB8A4, 0x8207, 0xBB50, 0x8208, 0xBFB3, 0x8209, 0xC17C, + 0x820A, 0xC2C2, 0x820B, 0xF4B5, 0x820C, 0xA6DE, 0x820D, 0xAAD9, 0x8210, 0xAFE7, 0x8211, 0xD752, 0x8212, 0xB5CE, 0x8214, 0xBB51, + 0x8215, 0xE3AB, 0x8216, 0xE745, 0x821B, 0xA6DF, 0x821C, 0xB5CF, 0x821D, 0xDFA3, 0x821E, 0xBB52, 0x821F, 0xA6E0, 0x8220, 0xCDB1, + 0x8221, 0xD069, 0x8222, 0xAD51, 0x8225, 0xD372, 0x8228, 0xAFEA, 0x822A, 0xAFE8, 0x822B, 0xAFE9, 0x822C, 0xAFEB, 0x822F, 0xD371, + 0x8232, 0xD757, 0x8233, 0xD754, 0x8234, 0xD756, 0x8235, 0xB2EB, 0x8236, 0xB2ED, 0x8237, 0xB2EC, 0x8238, 0xD753, 0x8239, 0xB2EE, + 0x823A, 0xD755, 0x823C, 0xDB58, 0x823D, 0xDB59, 0x823F, 0xDB5A, 0x8240, 0xDFA6, 0x8242, 0xDFA7, 0x8244, 0xDFA5, 0x8245, 0xDFA8, + 0x8247, 0xB8A5, 0x8249, 0xDFA4, 0x824B, 0xBB53, 0x824E, 0xE74A, 0x824F, 0xE746, 0x8250, 0xE749, 0x8251, 0xE74B, 0x8252, 0xE748, + 0x8253, 0xE747, 0x8255, 0xEAF5, 0x8256, 0xEAF6, 0x8257, 0xEAF7, 0x8258, 0xBFB4, 0x8259, 0xBFB5, 0x825A, 0xEDF1, 0x825B, 0xEDF0, + 0x825C, 0xEDF2, 0x825E, 0xF0A3, 0x825F, 0xF0A2, 0x8261, 0xF2C4, 0x8263, 0xF2C5, 0x8264, 0xF2C3, 0x8266, 0xC4A5, 0x8268, 0xF4B6, + 0x8269, 0xF4B7, 0x826B, 0xF746, 0x826C, 0xF7EF, 0x826D, 0xF8BB, 0x826E, 0xA6E1, 0x826F, 0xA87D, 0x8271, 0xC17D, 0x8272, 0xA6E2, + 0x8274, 0xD758, 0x8275, 0xDB5B, 0x8277, 0xC641, 0x8278, 0xCA4A, 0x827C, 0xCA4B, 0x827D, 0xCA4D, 0x827E, 0xA6E3, 0x827F, 0xCA4E, + 0x8280, 0xCA4C, 0x8283, 0xCBA2, 0x8284, 0xCBA3, 0x8285, 0xCB7B, 0x828A, 0xCBA1, 0x828B, 0xA8A1, 0x828D, 0xA8A2, 0x828E, 0xCB7C, + 0x828F, 0xCB7A, 0x8290, 0xCB79, 0x8291, 0xCB7D, 0x8292, 0xA87E, 0x8293, 0xCB7E, 0x8294, 0xD06A, 0x8298, 0xCDB6, 0x8299, 0xAADC, + 0x829A, 0xCDB5, 0x829B, 0xCDB7, 0x829D, 0xAADB, 0x829E, 0xCDBC, 0x829F, 0xAADF, 0x82A0, 0xCDB2, 0x82A1, 0xCDC0, 0x82A2, 0xCDC6, + 0x82A3, 0xAAE6, 0x82A4, 0xCDC3, 0x82A5, 0xAAE3, 0x82A7, 0xCDB9, 0x82A8, 0xCDBF, 0x82A9, 0xCDC1, 0x82AB, 0xCDB4, 0x82AC, 0xAAE2, + 0x82AD, 0xAADD, 0x82AE, 0xCDBA, 0x82AF, 0xAAE4, 0x82B0, 0xAAE7, 0x82B1, 0xAAE1, 0x82B3, 0xAADA, 0x82B4, 0xCDBE, 0x82B5, 0xCDB8, + 0x82B6, 0xCDC5, 0x82B7, 0xAAE9, 0x82B8, 0xAAE5, 0x82B9, 0xAAE0, 0x82BA, 0xCDBD, 0x82BB, 0xAFEC, 0x82BC, 0xCDBB, 0x82BD, 0xAADE, + 0x82BE, 0xAAE8, 0x82C0, 0xCDB3, 0x82C2, 0xCDC2, 0x82C3, 0xCDC4, 0x82D1, 0xAD62, 0x82D2, 0xAD5C, 0x82D3, 0xAD64, 0x82D4, 0xAD61, + 0x82D5, 0xD071, 0x82D6, 0xD074, 0x82D7, 0xAD5D, 0x82D9, 0xD06B, 0x82DB, 0xAD56, 0x82DC, 0xAD60, 0x82DE, 0xAD63, 0x82DF, 0xAD65, + 0x82E0, 0xD0A2, 0x82E1, 0xD077, 0x82E3, 0xAD55, 0x82E4, 0xD0A1, 0x82E5, 0xAD59, 0x82E6, 0xAD57, 0x82E7, 0xAD52, 0x82E8, 0xD06F, + 0x82EA, 0xD07E, 0x82EB, 0xD073, 0x82EC, 0xD076, 0x82ED, 0xD0A5, 0x82EF, 0xAD66, 0x82F0, 0xD07D, 0x82F1, 0xAD5E, 0x82F2, 0xD078, + 0x82F3, 0xD0A4, 0x82F4, 0xD075, 0x82F5, 0xD079, 0x82F6, 0xD07C, 0x82F9, 0xD06D, 0x82FA, 0xD0A3, 0x82FB, 0xD07B, 0x82FE, 0xD06C, + 0x8300, 0xD070, 0x8301, 0xAD5F, 0x8302, 0xAD5A, 0x8303, 0xAD53, 0x8304, 0xAD58, 0x8305, 0xAD54, 0x8306, 0xAD67, 0x8307, 0xD06E, + 0x8308, 0xD3A5, 0x8309, 0xAD5B, 0x830C, 0xD07A, 0x830D, 0xCE41, 0x8316, 0xD3A8, 0x8317, 0xAFFA, 0x8319, 0xD376, 0x831B, 0xD3A3, + 0x831C, 0xD37D, 0x831E, 0xD3B2, 0x8320, 0xD3AA, 0x8322, 0xD37E, 0x8324, 0xD3A9, 0x8325, 0xD378, 0x8326, 0xD37C, 0x8327, 0xD3B5, + 0x8328, 0xAFFD, 0x8329, 0xD3AD, 0x832A, 0xD3A4, 0x832B, 0xAFED, 0x832C, 0xD3B3, 0x832D, 0xD374, 0x832F, 0xD3AC, 0x8331, 0xAFFC, + 0x8332, 0xAFF7, 0x8333, 0xD373, 0x8334, 0xAFF5, 0x8335, 0xAFF4, 0x8336, 0xAFF9, 0x8337, 0xD3AB, 0x8338, 0xAFF1, 0x8339, 0xAFF8, + 0x833A, 0xD072, 0x833B, 0xDB5C, 0x833C, 0xD3A6, 0x833F, 0xD37A, 0x8340, 0xAFFB, 0x8341, 0xD37B, 0x8342, 0xD3A1, 0x8343, 0xAFFE, + 0x8344, 0xD375, 0x8345, 0xD3AF, 0x8347, 0xD3AE, 0x8348, 0xD3B6, 0x8349, 0xAFF3, 0x834A, 0xAFF0, 0x834B, 0xD3B4, 0x834C, 0xD3B0, + 0x834D, 0xD3A7, 0x834E, 0xD3A2, 0x834F, 0xAFF6, 0x8350, 0xAFF2, 0x8351, 0xD377, 0x8352, 0xAFEE, 0x8353, 0xD3B1, 0x8354, 0xAFEF, + 0x8356, 0xD379, 0x8373, 0xD75E, 0x8374, 0xD760, 0x8375, 0xD765, 0x8376, 0xD779, 0x8377, 0xB2FC, 0x8378, 0xB2F2, 0x837A, 0xD75D, + 0x837B, 0xB2FD, 0x837C, 0xB2FE, 0x837D, 0xD768, 0x837E, 0xD76F, 0x837F, 0xD775, 0x8381, 0xD762, 0x8383, 0xD769, 0x8386, 0xB340, + 0x8387, 0xD777, 0x8388, 0xD772, 0x8389, 0xB2FA, 0x838A, 0xB2F8, 0x838B, 0xD76E, 0x838C, 0xD76A, 0x838D, 0xD75C, 0x838E, 0xB2EF, + 0x838F, 0xD761, 0x8390, 0xD759, 0x8392, 0xB2F7, 0x8393, 0xB2F9, 0x8394, 0xD766, 0x8395, 0xD763, 0x8396, 0xB2F4, 0x8397, 0xD773, + 0x8398, 0xB2F1, 0x8399, 0xD764, 0x839A, 0xD77A, 0x839B, 0xD76C, 0x839D, 0xD76B, 0x839E, 0xB2F0, 0x83A0, 0xB2FB, 0x83A2, 0xB2F3, + 0x83A3, 0xD75A, 0x83A4, 0xD75F, 0x83A5, 0xD770, 0x83A6, 0xD776, 0x83A7, 0xB341, 0x83A8, 0xD75B, 0x83A9, 0xD767, 0x83AA, 0xD76D, + 0x83AB, 0xB2F6, 0x83AE, 0xD778, 0x83AF, 0xD771, 0x83B0, 0xD774, 0x83BD, 0xB2F5, 0x83BF, 0xDB6C, 0x83C0, 0xDB60, 0x83C1, 0xB5D7, + 0x83C2, 0xDB7D, 0x83C3, 0xDBA7, 0x83C4, 0xDBAA, 0x83C5, 0xB5D5, 0x83C6, 0xDB68, 0x83C7, 0xDBA3, 0x83C8, 0xDB69, 0x83C9, 0xDB77, + 0x83CA, 0xB5E2, 0x83CB, 0xDB73, 0x83CC, 0xB5DF, 0x83CE, 0xDB74, 0x83CF, 0xDB5D, 0x83D1, 0xDBA4, 0x83D4, 0xB5E8, 0x83D5, 0xDBA1, + 0x83D6, 0xDB75, 0x83D7, 0xDBAC, 0x83D8, 0xDB70, 0x83D9, 0xDFC8, 0x83DB, 0xDBAF, 0x83DC, 0xB5E6, 0x83DD, 0xDB6E, 0x83DE, 0xDB7A, + 0x83DF, 0xB5E9, 0x83E0, 0xB5D4, 0x83E1, 0xDB72, 0x83E2, 0xDBAD, 0x83E3, 0xDB6B, 0x83E4, 0xDB64, 0x83E5, 0xDB6F, 0x83E7, 0xDB63, + 0x83E8, 0xDB61, 0x83E9, 0xB5D0, 0x83EA, 0xDBA5, 0x83EB, 0xDB6A, 0x83EC, 0xDBA8, 0x83EE, 0xDBA9, 0x83EF, 0xB5D8, 0x83F0, 0xB5DD, + 0x83F1, 0xB5D9, 0x83F2, 0xB5E1, 0x83F3, 0xDB7E, 0x83F4, 0xB5DA, 0x83F5, 0xDB76, 0x83F6, 0xDB66, 0x83F8, 0xB5D2, 0x83F9, 0xDB5E, + 0x83FA, 0xDBA2, 0x83FB, 0xDBAB, 0x83FC, 0xDB65, 0x83FD, 0xB5E0, 0x83FE, 0xDBB0, 0x83FF, 0xDB71, 0x8401, 0xDB6D, 0x8403, 0xB5D1, + 0x8404, 0xB5E5, 0x8406, 0xDB7C, 0x8407, 0xB5E7, 0x8409, 0xDB78, 0x840A, 0xB5DC, 0x840B, 0xB5D6, 0x840C, 0xB5DE, 0x840D, 0xB5D3, + 0x840E, 0xB5E4, 0x840F, 0xDB79, 0x8410, 0xDB67, 0x8411, 0xDB7B, 0x8412, 0xDB62, 0x8413, 0xDBA6, 0x841B, 0xDBAE, 0x8423, 0xDB5F, + 0x8429, 0xDFC7, 0x842B, 0xDFDD, 0x842C, 0xB855, 0x842D, 0xDFCC, 0x842F, 0xDFCA, 0x8430, 0xDFB5, 0x8431, 0xB8A9, 0x8432, 0xDFC5, + 0x8433, 0xDFD9, 0x8434, 0xDFC1, 0x8435, 0xB8B1, 0x8436, 0xDFD8, 0x8437, 0xDFBF, 0x8438, 0xB5E3, 0x8439, 0xDFCF, 0x843A, 0xDFC0, + 0x843B, 0xDFD6, 0x843C, 0xB8B0, 0x843D, 0xB8A8, 0x843F, 0xDFAA, 0x8440, 0xDFB2, 0x8442, 0xDFCB, 0x8443, 0xDFC3, 0x8444, 0xDFDC, + 0x8445, 0xDFC6, 0x8446, 0xB8B6, 0x8447, 0xDFD7, 0x8449, 0xB8AD, 0x844B, 0xDFC9, 0x844C, 0xDFD1, 0x844D, 0xDFB6, 0x844E, 0xDFD0, + 0x8450, 0xDFE1, 0x8451, 0xDFB1, 0x8452, 0xDFD2, 0x8454, 0xDFDF, 0x8456, 0xDFAB, 0x8457, 0xB5DB, 0x8459, 0xDFB9, 0x845A, 0xDFB8, + 0x845B, 0xB8AF, 0x845D, 0xDFBC, 0x845E, 0xDFBE, 0x845F, 0xDFCD, 0x8460, 0xDFDE, 0x8461, 0xB8B2, 0x8463, 0xB8B3, 0x8465, 0xDFB0, + 0x8466, 0xB8AB, 0x8467, 0xDFB4, 0x8468, 0xDFDA, 0x8469, 0xB8B4, 0x846B, 0xB8AC, 0x846C, 0xB8AE, 0x846D, 0xB8B5, 0x846E, 0xDFE0, + 0x846F, 0xDFD3, 0x8470, 0xDFCE, 0x8473, 0xDFBB, 0x8474, 0xDFBA, 0x8475, 0xB8AA, 0x8476, 0xDFAC, 0x8477, 0xB8A7, 0x8478, 0xDFC4, + 0x8479, 0xDFAD, 0x847A, 0xDFC2, 0x847D, 0xDFB7, 0x847E, 0xDFDB, 0x8482, 0xB8A6, 0x8486, 0xDFB3, 0x848D, 0xDFAF, 0x848E, 0xDFD5, + 0x848F, 0xDFAE, 0x8490, 0xBB60, 0x8491, 0xE3D3, 0x8494, 0xE3C2, 0x8497, 0xE3AC, 0x8498, 0xE3CA, 0x8499, 0xBB58, 0x849A, 0xE3BB, + 0x849B, 0xE3C5, 0x849C, 0xBB5B, 0x849D, 0xE3BE, 0x849E, 0xBB59, 0x849F, 0xE3AF, 0x84A0, 0xE3CD, 0x84A1, 0xE3AE, 0x84A2, 0xE3C1, + 0x84A4, 0xE3AD, 0x84A7, 0xE3BF, 0x84A8, 0xE3C8, 0x84A9, 0xE3C6, 0x84AA, 0xE3BA, 0x84AB, 0xE3B5, 0x84AC, 0xE3B3, 0x84AE, 0xE3B4, + 0x84AF, 0xE3C7, 0x84B0, 0xE3D2, 0x84B1, 0xE3BC, 0x84B2, 0xBB5A, 0x84B4, 0xE3B7, 0x84B6, 0xE3CB, 0x84B8, 0xBB5D, 0x84B9, 0xE3B6, + 0x84BA, 0xE3B0, 0x84BB, 0xE3C0, 0x84BC, 0xBB61, 0x84BF, 0xBB55, 0x84C0, 0xBB5E, 0x84C1, 0xE3B8, 0x84C2, 0xE3B2, 0x84C4, 0xBB57, + 0x84C5, 0xDFD4, 0x84C6, 0xBB56, 0x84C7, 0xE3C3, 0x84C9, 0xBB54, 0x84CA, 0xBB63, 0x84CB, 0xBB5C, 0x84CC, 0xE3C4, 0x84CD, 0xE3B9, + 0x84CE, 0xE3B1, 0x84CF, 0xE3CC, 0x84D0, 0xE3BD, 0x84D1, 0xBB62, 0x84D2, 0xE3D0, 0x84D3, 0xBB5F, 0x84D4, 0xE3CF, 0x84D6, 0xE3C9, + 0x84D7, 0xE3CE, 0x84DB, 0xE3D1, 0x84E7, 0xE773, 0x84E8, 0xE774, 0x84E9, 0xE767, 0x84EA, 0xE766, 0x84EB, 0xE762, 0x84EC, 0xBDB4, + 0x84EE, 0xBDAC, 0x84EF, 0xE776, 0x84F0, 0xE775, 0x84F1, 0xDFA9, 0x84F2, 0xE75F, 0x84F3, 0xE763, 0x84F4, 0xE75D, 0x84F6, 0xE770, + 0x84F7, 0xE761, 0x84F9, 0xE777, 0x84FA, 0xE75A, 0x84FB, 0xE758, 0x84FC, 0xE764, 0x84FD, 0xE76E, 0x84FE, 0xE769, 0x84FF, 0xBDB6, + 0x8500, 0xE74F, 0x8502, 0xE76D, 0x8506, 0xBDB7, 0x8507, 0xDFBD, 0x8508, 0xE75B, 0x8509, 0xE752, 0x850A, 0xE755, 0x850B, 0xE77B, + 0x850C, 0xE75C, 0x850D, 0xE753, 0x850E, 0xE751, 0x850F, 0xE74E, 0x8511, 0xBDB0, 0x8512, 0xE765, 0x8513, 0xBDAF, 0x8514, 0xBDB3, + 0x8515, 0xE760, 0x8516, 0xE768, 0x8517, 0xBDA9, 0x8518, 0xE778, 0x8519, 0xE77C, 0x851A, 0xBDAB, 0x851C, 0xE757, 0x851D, 0xE76B, + 0x851E, 0xE76F, 0x851F, 0xE754, 0x8520, 0xE779, 0x8521, 0xBDB2, 0x8523, 0xBDB1, 0x8524, 0xE74C, 0x8525, 0xBDB5, 0x8526, 0xE772, + 0x8527, 0xE756, 0x8528, 0xE76A, 0x8529, 0xE750, 0x852A, 0xE75E, 0x852B, 0xE759, 0x852C, 0xBDAD, 0x852D, 0xBDAE, 0x852E, 0xE76C, + 0x852F, 0xE77D, 0x8530, 0xE77A, 0x8531, 0xE771, 0x853B, 0xE74D, 0x853D, 0xBDAA, 0x853E, 0xEB49, 0x8540, 0xEB40, 0x8541, 0xEB43, + 0x8543, 0xBFBB, 0x8544, 0xEB45, 0x8545, 0xEAF9, 0x8546, 0xEB41, 0x8547, 0xEB47, 0x8548, 0xBFB8, 0x8549, 0xBFBC, 0x854A, 0xBFB6, + 0x854D, 0xEAFB, 0x854E, 0xEB4C, 0x8551, 0xEB46, 0x8553, 0xEAFC, 0x8554, 0xEB55, 0x8555, 0xEB4F, 0x8556, 0xEAF8, 0x8557, 0xEE46, + 0x8558, 0xEAFE, 0x8559, 0xBFB7, 0x855B, 0xEB4A, 0x855D, 0xEB54, 0x855E, 0xBFBF, 0x8560, 0xEB51, 0x8561, 0xEAFD, 0x8562, 0xEB44, + 0x8563, 0xEB48, 0x8564, 0xEB42, 0x8565, 0xEB56, 0x8566, 0xEB53, 0x8567, 0xEB50, 0x8568, 0xBFB9, 0x8569, 0xBFBA, 0x856A, 0xBFBE, + 0x856B, 0xEAFA, 0x856C, 0xEB57, 0x856D, 0xBFBD, 0x856E, 0xEB4D, 0x8571, 0xEB4B, 0x8575, 0xEB4E, 0x8576, 0xEE53, 0x8577, 0xEE40, + 0x8578, 0xEE45, 0x8579, 0xEE52, 0x857A, 0xEE44, 0x857B, 0xEDFB, 0x857C, 0xEE41, 0x857E, 0xC1A2, 0x8580, 0xEDF4, 0x8581, 0xEE4D, + 0x8582, 0xEE4F, 0x8583, 0xEDF3, 0x8584, 0xC1A1, 0x8585, 0xEE51, 0x8586, 0xEE49, 0x8587, 0xC1A8, 0x8588, 0xEE50, 0x8589, 0xEE42, + 0x858A, 0xC1AA, 0x858B, 0xEDF9, 0x858C, 0xEB52, 0x858D, 0xEE4A, 0x858E, 0xEE47, 0x858F, 0xEDF5, 0x8590, 0xEE55, 0x8591, 0xC1A4, + 0x8594, 0xC1A5, 0x8595, 0xEDF7, 0x8596, 0xEE48, 0x8598, 0xEE54, 0x8599, 0xEE4B, 0x859A, 0xEDFD, 0x859B, 0xC1A7, 0x859C, 0xC1A3, + 0x859D, 0xEE4C, 0x859E, 0xEDFE, 0x859F, 0xEE56, 0x85A0, 0xEDF8, 0x85A1, 0xEE43, 0x85A2, 0xEE4E, 0x85A3, 0xEDFA, 0x85A4, 0xEDFC, + 0x85A6, 0xC2CB, 0x85A7, 0xEDF6, 0x85A8, 0xC1A9, 0x85A9, 0xC2C4, 0x85AA, 0xC17E, 0x85AF, 0xC1A6, 0x85B0, 0xC2C8, 0x85B1, 0xF0B3, + 0x85B3, 0xF0A9, 0x85B4, 0xF0A4, 0x85B5, 0xF0AA, 0x85B6, 0xF0B4, 0x85B7, 0xF0B8, 0x85B8, 0xF0B7, 0x85B9, 0xC2CA, 0x85BA, 0xC2C9, + 0x85BD, 0xF0AB, 0x85BE, 0xF0B9, 0x85BF, 0xF0AE, 0x85C0, 0xF0A6, 0x85C2, 0xF0A8, 0x85C3, 0xF0A7, 0x85C4, 0xF0AD, 0x85C5, 0xF0B2, + 0x85C6, 0xF0A5, 0x85C7, 0xF0AC, 0x85C8, 0xF0B1, 0x85C9, 0xC2C7, 0x85CB, 0xF0AF, 0x85CD, 0xC2C5, 0x85CE, 0xF0B0, 0x85CF, 0xC2C3, + 0x85D0, 0xC2C6, 0x85D1, 0xF2D5, 0x85D2, 0xF0B5, 0x85D5, 0xC3C2, 0x85D7, 0xF2CD, 0x85D8, 0xF2D1, 0x85D9, 0xF2C9, 0x85DA, 0xF2CC, + 0x85DC, 0xF2D4, 0x85DD, 0xC3C0, 0x85DE, 0xF2D9, 0x85DF, 0xF2D2, 0x85E1, 0xF2CA, 0x85E2, 0xF2DA, 0x85E3, 0xF2D3, 0x85E4, 0xC3C3, + 0x85E5, 0xC3C4, 0x85E6, 0xF2D7, 0x85E8, 0xF2CB, 0x85E9, 0xC3BF, 0x85EA, 0xC3C1, 0x85EB, 0xF2C6, 0x85EC, 0xF2CE, 0x85ED, 0xF2C8, + 0x85EF, 0xF2D8, 0x85F0, 0xF2D6, 0x85F1, 0xF2C7, 0x85F2, 0xF2CF, 0x85F6, 0xF4BE, 0x85F7, 0xC3C5, 0x85F8, 0xF2D0, 0x85F9, 0xC4A7, + 0x85FA, 0xC4A9, 0x85FB, 0xC4A6, 0x85FD, 0xF4C3, 0x85FE, 0xF4BB, 0x85FF, 0xF4B9, 0x8600, 0xF4BD, 0x8601, 0xF4BA, 0x8604, 0xF4BF, + 0x8605, 0xF4C1, 0x8606, 0xC4AA, 0x8607, 0xC4AC, 0x8609, 0xF4C0, 0x860A, 0xC4AD, 0x860B, 0xC4AB, 0x860C, 0xF4C2, 0x8611, 0xC4A8, + 0x8617, 0xC4F4, 0x8618, 0xF5F1, 0x8619, 0xF5F7, 0x861A, 0xC4F6, 0x861B, 0xF4BC, 0x861C, 0xF5F6, 0x861E, 0xF5FD, 0x861F, 0xF5F4, + 0x8620, 0xF5FB, 0x8621, 0xF5FA, 0x8622, 0xF4B8, 0x8623, 0xF5F5, 0x8624, 0xF0B6, 0x8625, 0xF5FE, 0x8626, 0xF5F3, 0x8627, 0xF5F8, + 0x8629, 0xF5FC, 0x862A, 0xF5F2, 0x862C, 0xF74A, 0x862D, 0xC4F5, 0x862E, 0xF5F9, 0x8631, 0xF7F4, 0x8632, 0xF74B, 0x8633, 0xF749, + 0x8634, 0xF747, 0x8635, 0xF748, 0x8636, 0xF74C, 0x8638, 0xC5D9, 0x8639, 0xF7F2, 0x863A, 0xF7F0, 0x863B, 0xF7F5, 0x863C, 0xF7F3, + 0x863E, 0xF7F6, 0x863F, 0xC5DA, 0x8640, 0xF7F1, 0x8643, 0xF8BC, 0x8646, 0xF945, 0x8647, 0xF946, 0x8648, 0xF947, 0x864B, 0xF9C7, + 0x864C, 0xF9BD, 0x864D, 0xCA4F, 0x864E, 0xAAEA, 0x8650, 0xAD68, 0x8652, 0xD3B8, 0x8653, 0xD3B7, 0x8654, 0xB040, 0x8655, 0xB342, + 0x8656, 0xD77C, 0x8659, 0xD77B, 0x865B, 0xB5EA, 0x865C, 0xB8B8, 0x865E, 0xB8B7, 0x865F, 0xB8B9, 0x8661, 0xE3D4, 0x8662, 0xE77E, + 0x8663, 0xEB58, 0x8664, 0xEB5A, 0x8665, 0xEB59, 0x8667, 0xC1AB, 0x8668, 0xEE57, 0x8669, 0xF0BA, 0x866A, 0xF9A5, 0x866B, 0xA6E4, + 0x866D, 0xCDC9, 0x866E, 0xCDCA, 0x866F, 0xCDC8, 0x8670, 0xCDC7, 0x8671, 0xAAEB, 0x8673, 0xD0A9, 0x8674, 0xD0A7, 0x8677, 0xD0A6, + 0x8679, 0xAD69, 0x867A, 0xAD6B, 0x867B, 0xAD6A, 0x867C, 0xD0A8, 0x8685, 0xD3C4, 0x8686, 0xD3C1, 0x8687, 0xD3BF, 0x868A, 0xB041, + 0x868B, 0xD3C2, 0x868C, 0xB046, 0x868D, 0xD3BC, 0x868E, 0xD3CB, 0x8690, 0xD3CD, 0x8691, 0xD3BD, 0x8693, 0xB043, 0x8694, 0xD3CE, + 0x8695, 0xD3C9, 0x8696, 0xD3BB, 0x8697, 0xD3C0, 0x8698, 0xD3CA, 0x8699, 0xD3C6, 0x869A, 0xD3C3, 0x869C, 0xB048, 0x869D, 0xD3CC, + 0x869E, 0xD3BE, 0x86A1, 0xD3C7, 0x86A2, 0xD3B9, 0x86A3, 0xB047, 0x86A4, 0xB044, 0x86A5, 0xD3C5, 0x86A7, 0xD3C8, 0x86A8, 0xD3BA, + 0x86A9, 0xB045, 0x86AA, 0xB042, 0x86AF, 0xB34C, 0x86B0, 0xD7A5, 0x86B1, 0xB34B, 0x86B3, 0xD7A8, 0x86B4, 0xD7AB, 0x86B5, 0xB348, + 0x86B6, 0xB346, 0x86B7, 0xD77E, 0x86B8, 0xD7A9, 0x86B9, 0xD7A7, 0x86BA, 0xD7A4, 0x86BB, 0xD7AC, 0x86BC, 0xD7AD, 0x86BD, 0xD7AF, + 0x86BE, 0xD7B0, 0x86BF, 0xD77D, 0x86C0, 0xB345, 0x86C1, 0xD7A2, 0x86C2, 0xD7A1, 0x86C3, 0xD7AE, 0x86C4, 0xB347, 0x86C5, 0xD7A3, + 0x86C6, 0xB349, 0x86C7, 0xB344, 0x86C8, 0xD7A6, 0x86C9, 0xB34D, 0x86CB, 0xB34A, 0x86CC, 0xD7AA, 0x86D0, 0xB5F1, 0x86D1, 0xDBBF, + 0x86D3, 0xDBB4, 0x86D4, 0xB5EE, 0x86D6, 0xDFE7, 0x86D7, 0xDBBD, 0x86D8, 0xDBB1, 0x86D9, 0xB5EC, 0x86DA, 0xDBB6, 0x86DB, 0xB5EF, + 0x86DC, 0xDBBA, 0x86DD, 0xDBB8, 0x86DE, 0xB5F2, 0x86DF, 0xB5EB, 0x86E2, 0xDBB2, 0x86E3, 0xDBB5, 0x86E4, 0xB5F0, 0x86E6, 0xDBB3, + 0x86E8, 0xDBBE, 0x86E9, 0xDBBC, 0x86EA, 0xDBB7, 0x86EB, 0xDBB9, 0x86EC, 0xDBBB, 0x86ED, 0xB5ED, 0x86F5, 0xDFE8, 0x86F6, 0xDFEE, + 0x86F7, 0xDFE4, 0x86F8, 0xDFEA, 0x86F9, 0xB8BA, 0x86FA, 0xDFE6, 0x86FB, 0xB8C0, 0x86FE, 0xB8BF, 0x8700, 0xB8BE, 0x8701, 0xDFED, + 0x8702, 0xB8C1, 0x8703, 0xB8C2, 0x8704, 0xDFE3, 0x8705, 0xDFF0, 0x8706, 0xB8C3, 0x8707, 0xB8BD, 0x8708, 0xB8BC, 0x8709, 0xDFEC, + 0x870A, 0xB8C4, 0x870B, 0xDFE2, 0x870C, 0xDFE5, 0x870D, 0xDFEF, 0x870E, 0xDFEB, 0x8711, 0xE3F4, 0x8712, 0xE3E9, 0x8713, 0xB8BB, + 0x8718, 0xBB6A, 0x8719, 0xE3DD, 0x871A, 0xE3F2, 0x871B, 0xE3DE, 0x871C, 0xBB65, 0x871E, 0xE3DB, 0x8720, 0xE3E4, 0x8721, 0xE3DC, + 0x8722, 0xBB67, 0x8723, 0xE3D6, 0x8724, 0xE3F1, 0x8725, 0xBB68, 0x8726, 0xE3EE, 0x8727, 0xE3EF, 0x8728, 0xE3D7, 0x8729, 0xBB6D, + 0x872A, 0xE3E6, 0x872C, 0xE3E0, 0x872D, 0xE3E7, 0x872E, 0xE3DA, 0x8730, 0xE3F3, 0x8731, 0xE3EB, 0x8732, 0xE3E5, 0x8733, 0xE3D5, + 0x8734, 0xBB69, 0x8735, 0xE3EC, 0x8737, 0xBB6C, 0x8738, 0xE3F0, 0x873A, 0xE3EA, 0x873B, 0xBB66, 0x873C, 0xE3E8, 0x873E, 0xE3E2, + 0x873F, 0xBB64, 0x8740, 0xE3D9, 0x8741, 0xE3E1, 0x8742, 0xE3ED, 0x8743, 0xE3DF, 0x8746, 0xE3E3, 0x874C, 0xBDC1, 0x874D, 0xDFE9, + 0x874E, 0xE7B2, 0x874F, 0xE7BB, 0x8750, 0xE7B1, 0x8751, 0xE7AD, 0x8752, 0xE7AA, 0x8753, 0xBDC2, 0x8754, 0xE7A8, 0x8755, 0xBB6B, + 0x8756, 0xE7A1, 0x8757, 0xBDC0, 0x8758, 0xE7A7, 0x8759, 0xBDBF, 0x875A, 0xE7AC, 0x875B, 0xE7A9, 0x875C, 0xE7B9, 0x875D, 0xE7B4, + 0x875E, 0xE7AE, 0x875F, 0xE7B3, 0x8760, 0xBDBB, 0x8761, 0xE7AB, 0x8762, 0xE7BE, 0x8763, 0xE7A2, 0x8764, 0xE7A3, 0x8765, 0xE7BA, + 0x8766, 0xBDBC, 0x8767, 0xE7BF, 0x8768, 0xBDBE, 0x8769, 0xE7C0, 0x876A, 0xE7B0, 0x876B, 0xE3D8, 0x876C, 0xE7B6, 0x876D, 0xE7AF, + 0x876E, 0xE7B8, 0x876F, 0xE7B5, 0x8773, 0xE7A6, 0x8774, 0xBDB9, 0x8775, 0xE7BD, 0x8776, 0xBDBA, 0x8777, 0xE7A4, 0x8778, 0xBDBD, + 0x8779, 0xEB64, 0x877A, 0xE7B7, 0x877B, 0xE7BC, 0x8781, 0xEB61, 0x8782, 0xBDB8, 0x8783, 0xBFC0, 0x8784, 0xEB6B, 0x8785, 0xEB67, + 0x8787, 0xEB65, 0x8788, 0xEB60, 0x8789, 0xEB6F, 0x878D, 0xBFC4, 0x878F, 0xEB5C, 0x8790, 0xEB68, 0x8791, 0xEB69, 0x8792, 0xEB5F, + 0x8793, 0xEB5E, 0x8794, 0xEB6C, 0x8796, 0xEB62, 0x8797, 0xEB5D, 0x8798, 0xEB63, 0x879A, 0xEB6E, 0x879B, 0xEB5B, 0x879C, 0xEB6D, + 0x879D, 0xEB6A, 0x879E, 0xBFC2, 0x879F, 0xBFC1, 0x87A2, 0xBFC3, 0x87A3, 0xEB66, 0x87A4, 0xF0CB, 0x87AA, 0xEE59, 0x87AB, 0xC1B1, + 0x87AC, 0xEE5D, 0x87AD, 0xEE5A, 0x87AE, 0xEE61, 0x87AF, 0xEE67, 0x87B0, 0xEE5C, 0x87B2, 0xEE70, 0x87B3, 0xC1AE, 0x87B4, 0xEE6A, + 0x87B5, 0xEE5F, 0x87B6, 0xEE6B, 0x87B7, 0xEE66, 0x87B8, 0xEE6D, 0x87B9, 0xEE5E, 0x87BA, 0xC1B3, 0x87BB, 0xC1B2, 0x87BC, 0xEE60, + 0x87BD, 0xEE6E, 0x87BE, 0xEE58, 0x87BF, 0xEE6C, 0x87C0, 0xC1AC, 0x87C2, 0xEE64, 0x87C3, 0xEE63, 0x87C4, 0xEE68, 0x87C5, 0xEE5B, + 0x87C6, 0xC1B0, 0x87C8, 0xC1B4, 0x87C9, 0xEE62, 0x87CA, 0xEE69, 0x87CB, 0xC1B5, 0x87CC, 0xEE65, 0x87D1, 0xC1AD, 0x87D2, 0xC1AF, + 0x87D3, 0xF0C7, 0x87D4, 0xF0C5, 0x87D7, 0xF0CC, 0x87D8, 0xF0C9, 0x87D9, 0xF0CD, 0x87DB, 0xF0BE, 0x87DC, 0xF0C6, 0x87DD, 0xF0D1, + 0x87DE, 0xEE6F, 0x87DF, 0xF0C2, 0x87E0, 0xC2CF, 0x87E1, 0xE7A5, 0x87E2, 0xF0BD, 0x87E3, 0xF0CA, 0x87E4, 0xF0C4, 0x87E5, 0xF0C1, + 0x87E6, 0xF0BC, 0x87E7, 0xF0BB, 0x87E8, 0xF0D0, 0x87EA, 0xF0C0, 0x87EB, 0xF0BF, 0x87EC, 0xC2CD, 0x87ED, 0xF0C8, 0x87EF, 0xC2CC, + 0x87F2, 0xC2CE, 0x87F3, 0xF0C3, 0x87F4, 0xF0CF, 0x87F6, 0xF2DE, 0x87F7, 0xF2DF, 0x87F9, 0xC3C9, 0x87FA, 0xF2DC, 0x87FB, 0xC3C6, + 0x87FC, 0xF2E4, 0x87FE, 0xC3CA, 0x87FF, 0xF2E6, 0x8800, 0xF2DB, 0x8801, 0xF0CE, 0x8802, 0xF2E8, 0x8803, 0xF2DD, 0x8805, 0xC3C7, + 0x8806, 0xF2E3, 0x8808, 0xF2E5, 0x8809, 0xF2E0, 0x880A, 0xF2E7, 0x880B, 0xF2E2, 0x880C, 0xF2E1, 0x880D, 0xC3C8, 0x8810, 0xF4C5, + 0x8811, 0xF4C6, 0x8813, 0xF4C8, 0x8814, 0xC4AE, 0x8815, 0xC4AF, 0x8816, 0xF4C9, 0x8817, 0xF4C7, 0x8819, 0xF4C4, 0x881B, 0xF642, + 0x881C, 0xF645, 0x881D, 0xF641, 0x881F, 0xC4FA, 0x8820, 0xF643, 0x8821, 0xC4F9, 0x8822, 0xC4F8, 0x8823, 0xC4F7, 0x8824, 0xF644, + 0x8825, 0xF751, 0x8826, 0xF74F, 0x8828, 0xF74E, 0x8829, 0xF640, 0x882A, 0xF750, 0x882B, 0xF646, 0x882C, 0xF74D, 0x882E, 0xF7F9, + 0x882F, 0xF7D7, 0x8830, 0xF7F7, 0x8831, 0xC5DB, 0x8832, 0xF7F8, 0x8833, 0xF7FA, 0x8835, 0xF8BF, 0x8836, 0xC5FA, 0x8837, 0xF8BE, + 0x8838, 0xF8BD, 0x8839, 0xC5FB, 0x883B, 0xC65A, 0x883C, 0xF96E, 0x883D, 0xF9A7, 0x883E, 0xF9A6, 0x883F, 0xF9A8, 0x8840, 0xA6E5, + 0x8841, 0xD0AA, 0x8843, 0xD3CF, 0x8844, 0xD3D0, 0x8848, 0xDBC0, 0x884A, 0xF647, 0x884B, 0xF8C0, 0x884C, 0xA6E6, 0x884D, 0xAD6C, + 0x884E, 0xD0AB, 0x8852, 0xD7B1, 0x8853, 0xB34E, 0x8855, 0xDBC2, 0x8856, 0xDBC1, 0x8857, 0xB5F3, 0x8859, 0xB8C5, 0x885A, 0xE7C1, + 0x885B, 0xBDC3, 0x885D, 0xBDC4, 0x8861, 0xBFC5, 0x8862, 0xC5FC, 0x8863, 0xA6E7, 0x8867, 0xD0AC, 0x8868, 0xAAED, 0x8869, 0xD0AE, + 0x886A, 0xD0AD, 0x886B, 0xAD6D, 0x886D, 0xD3D1, 0x886F, 0xD3D8, 0x8870, 0xB049, 0x8871, 0xD3D6, 0x8872, 0xD3D4, 0x8874, 0xD3DB, + 0x8875, 0xD3D2, 0x8876, 0xD3D3, 0x8877, 0xB04A, 0x8879, 0xB04E, 0x887C, 0xD3DC, 0x887D, 0xB04D, 0x887E, 0xD3DA, 0x887F, 0xD3D7, + 0x8880, 0xD3D5, 0x8881, 0xB04B, 0x8882, 0xB04C, 0x8883, 0xD3D9, 0x8888, 0xB350, 0x8889, 0xD7B2, 0x888B, 0xB355, 0x888C, 0xD7C2, + 0x888D, 0xB354, 0x888E, 0xD7C4, 0x8891, 0xD7B8, 0x8892, 0xB352, 0x8893, 0xD7C3, 0x8895, 0xD7B3, 0x8896, 0xB353, 0x8897, 0xD7BF, + 0x8898, 0xD7BB, 0x8899, 0xD7BD, 0x889A, 0xD7B7, 0x889B, 0xD7BE, 0x889E, 0xB34F, 0x889F, 0xD7BA, 0x88A1, 0xD7B9, 0x88A2, 0xD7B5, + 0x88A4, 0xD7C0, 0x88A7, 0xD7BC, 0x88A8, 0xD7B4, 0x88AA, 0xD7B6, 0x88AB, 0xB351, 0x88AC, 0xD7C1, 0x88B1, 0xB5F6, 0x88B2, 0xDBCD, + 0x88B6, 0xDBC9, 0x88B7, 0xDBCB, 0x88B8, 0xDBC6, 0x88B9, 0xDBC5, 0x88BA, 0xDBC3, 0x88BC, 0xDBCA, 0x88BD, 0xDBCC, 0x88BE, 0xDBC8, + 0x88C0, 0xDBC7, 0x88C1, 0xB5F4, 0x88C2, 0xB5F5, 0x88C9, 0xDBCF, 0x88CA, 0xB8CD, 0x88CB, 0xDFF2, 0x88CC, 0xDFF8, 0x88CD, 0xDFF3, + 0x88CE, 0xDFF4, 0x88CF, 0xF9D8, 0x88D0, 0xDFF9, 0x88D2, 0xB8CF, 0x88D4, 0xB8C7, 0x88D5, 0xB8CE, 0x88D6, 0xDFF1, 0x88D7, 0xDBC4, + 0x88D8, 0xB8CA, 0x88D9, 0xB8C8, 0x88DA, 0xDFF7, 0x88DB, 0xDFF6, 0x88DC, 0xB8C9, 0x88DD, 0xB8CB, 0x88DE, 0xDFF5, 0x88DF, 0xB8C6, + 0x88E1, 0xB8CC, 0x88E7, 0xE3F6, 0x88E8, 0xBB74, 0x88EB, 0xE442, 0x88EC, 0xE441, 0x88EE, 0xE3FB, 0x88EF, 0xBB76, 0x88F0, 0xE440, + 0x88F1, 0xE3F7, 0x88F2, 0xE3F8, 0x88F3, 0xBB6E, 0x88F4, 0xBB70, 0x88F6, 0xE3FD, 0x88F7, 0xE3F5, 0x88F8, 0xBB72, 0x88F9, 0xBB71, + 0x88FA, 0xE3F9, 0x88FB, 0xE3FE, 0x88FC, 0xE3FC, 0x88FD, 0xBB73, 0x88FE, 0xE3FA, 0x8901, 0xDBCE, 0x8902, 0xBB6F, 0x8905, 0xE7C2, + 0x8906, 0xE7C9, 0x8907, 0xBDC6, 0x8909, 0xE7CD, 0x890A, 0xBDCA, 0x890B, 0xE7C5, 0x890C, 0xE7C3, 0x890E, 0xE7CC, 0x8910, 0xBDC5, + 0x8911, 0xE7CB, 0x8912, 0xBDC7, 0x8913, 0xBDC8, 0x8914, 0xE7C4, 0x8915, 0xBDC9, 0x8916, 0xE7CA, 0x8917, 0xE7C6, 0x8918, 0xE7C7, + 0x8919, 0xE7C8, 0x891A, 0xBB75, 0x891E, 0xEB70, 0x891F, 0xEB7C, 0x8921, 0xBFCA, 0x8922, 0xEB77, 0x8923, 0xEB79, 0x8925, 0xBFC8, + 0x8926, 0xEB71, 0x8927, 0xEB75, 0x8929, 0xEB78, 0x892A, 0xBFC6, 0x892B, 0xBFC9, 0x892C, 0xEB7B, 0x892D, 0xEB73, 0x892E, 0xEB74, + 0x892F, 0xEB7A, 0x8930, 0xEB72, 0x8931, 0xEB76, 0x8932, 0xBFC7, 0x8933, 0xEE72, 0x8935, 0xEE71, 0x8936, 0xC1B7, 0x8937, 0xEE77, + 0x8938, 0xC1B9, 0x893B, 0xC1B6, 0x893C, 0xEE73, 0x893D, 0xC1BA, 0x893E, 0xEE74, 0x8941, 0xEE75, 0x8942, 0xEE78, 0x8944, 0xC1B8, + 0x8946, 0xF0D6, 0x8949, 0xF0D9, 0x894B, 0xF0D3, 0x894C, 0xF0D5, 0x894F, 0xF0D4, 0x8950, 0xF0D7, 0x8951, 0xF0D8, 0x8952, 0xEE76, + 0x8953, 0xF0D2, 0x8956, 0xC3CD, 0x8957, 0xF2EC, 0x8958, 0xF2EF, 0x8959, 0xF2F1, 0x895A, 0xF2EA, 0x895B, 0xF2EB, 0x895C, 0xF2EE, + 0x895D, 0xF2F0, 0x895E, 0xC3CE, 0x895F, 0xC3CC, 0x8960, 0xC3CB, 0x8961, 0xF2ED, 0x8962, 0xF2E9, 0x8963, 0xF4CA, 0x8964, 0xC4B0, + 0x8966, 0xF4CB, 0x8969, 0xF649, 0x896A, 0xC4FB, 0x896B, 0xF64B, 0x896C, 0xC4FC, 0x896D, 0xF648, 0x896E, 0xF64A, 0x896F, 0xC5A8, + 0x8971, 0xF752, 0x8972, 0xC5A7, 0x8973, 0xF7FD, 0x8974, 0xF7FC, 0x8976, 0xF7FB, 0x8979, 0xF948, 0x897A, 0xF949, 0x897B, 0xF94B, + 0x897C, 0xF94A, 0x897E, 0xCA50, 0x897F, 0xA6E8, 0x8981, 0xAD6E, 0x8982, 0xD7C5, 0x8983, 0xB5F7, 0x8985, 0xDFFA, 0x8986, 0xC2D0, + 0x8988, 0xF2F2, 0x898B, 0xA8A3, 0x898F, 0xB357, 0x8993, 0xB356, 0x8995, 0xDBD0, 0x8996, 0xB5F8, 0x8997, 0xDBD2, 0x8998, 0xDBD1, + 0x899B, 0xDFFB, 0x899C, 0xB8D0, 0x899D, 0xE443, 0x899E, 0xE446, 0x899F, 0xE445, 0x89A1, 0xE444, 0x89A2, 0xE7CE, 0x89A3, 0xE7D0, + 0x89A4, 0xE7CF, 0x89A6, 0xBFCC, 0x89AA, 0xBFCB, 0x89AC, 0xC1BB, 0x89AD, 0xEE79, 0x89AE, 0xEE7B, 0x89AF, 0xEE7A, 0x89B2, 0xC2D1, + 0x89B6, 0xF2F4, 0x89B7, 0xF2F3, 0x89B9, 0xF4CC, 0x89BA, 0xC4B1, 0x89BD, 0xC4FD, 0x89BE, 0xF754, 0x89BF, 0xF753, 0x89C0, 0xC65B, + 0x89D2, 0xA8A4, 0x89D3, 0xD0AF, 0x89D4, 0xAD6F, 0x89D5, 0xD7C8, 0x89D6, 0xD7C6, 0x89D9, 0xD7C7, 0x89DA, 0xDBD4, 0x89DB, 0xDBD5, + 0x89DC, 0xE043, 0x89DD, 0xDBD3, 0x89DF, 0xDFFC, 0x89E0, 0xE041, 0x89E1, 0xE040, 0x89E2, 0xE042, 0x89E3, 0xB8D1, 0x89E4, 0xDFFE, + 0x89E5, 0xDFFD, 0x89E6, 0xE044, 0x89E8, 0xE449, 0x89E9, 0xE447, 0x89EB, 0xE448, 0x89EC, 0xE7D3, 0x89ED, 0xE7D1, 0x89F0, 0xE7D2, + 0x89F1, 0xEB7D, 0x89F2, 0xEE7C, 0x89F3, 0xEE7D, 0x89F4, 0xC2D2, 0x89F6, 0xF2F5, 0x89F7, 0xF4CD, 0x89F8, 0xC4B2, 0x89FA, 0xF64C, + 0x89FB, 0xF755, 0x89FC, 0xC5A9, 0x89FE, 0xF7FE, 0x89FF, 0xF94C, 0x8A00, 0xA8A5, 0x8A02, 0xAD71, 0x8A03, 0xAD72, 0x8A04, 0xD0B0, + 0x8A07, 0xD0B1, 0x8A08, 0xAD70, 0x8A0A, 0xB054, 0x8A0C, 0xB052, 0x8A0E, 0xB051, 0x8A0F, 0xB058, 0x8A10, 0xB050, 0x8A11, 0xB059, + 0x8A12, 0xD3DD, 0x8A13, 0xB056, 0x8A15, 0xB053, 0x8A16, 0xB057, 0x8A17, 0xB055, 0x8A18, 0xB04F, 0x8A1B, 0xB35F, 0x8A1D, 0xB359, + 0x8A1E, 0xD7CC, 0x8A1F, 0xB35E, 0x8A22, 0xB360, 0x8A23, 0xB35A, 0x8A25, 0xB35B, 0x8A27, 0xD7CA, 0x8A2A, 0xB358, 0x8A2C, 0xD7CB, + 0x8A2D, 0xB35D, 0x8A30, 0xD7C9, 0x8A31, 0xB35C, 0x8A34, 0xB644, 0x8A36, 0xB646, 0x8A39, 0xDBD8, 0x8A3A, 0xB645, 0x8A3B, 0xB5F9, + 0x8A3C, 0xB5FD, 0x8A3E, 0xB8E4, 0x8A3F, 0xE049, 0x8A40, 0xDBDA, 0x8A41, 0xB5FE, 0x8A44, 0xDBDD, 0x8A45, 0xDBDE, 0x8A46, 0xB643, + 0x8A48, 0xDBE0, 0x8A4A, 0xDBE2, 0x8A4C, 0xDBE3, 0x8A4D, 0xDBD7, 0x8A4E, 0xDBD6, 0x8A4F, 0xDBE4, 0x8A50, 0xB642, 0x8A51, 0xDBE1, + 0x8A52, 0xDBDF, 0x8A54, 0xB640, 0x8A55, 0xB5FB, 0x8A56, 0xB647, 0x8A57, 0xDBDB, 0x8A58, 0xDBDC, 0x8A59, 0xDBD9, 0x8A5B, 0xB641, + 0x8A5E, 0xB5FC, 0x8A60, 0xB5FA, 0x8A61, 0xE048, 0x8A62, 0xB8DF, 0x8A63, 0xB8DA, 0x8A66, 0xB8D5, 0x8A68, 0xB8E5, 0x8A69, 0xB8D6, + 0x8A6B, 0xB8D2, 0x8A6C, 0xB8E1, 0x8A6D, 0xB8DE, 0x8A6E, 0xB8E0, 0x8A70, 0xB8D7, 0x8A71, 0xB8DC, 0x8A72, 0xB8D3, 0x8A73, 0xB8D4, + 0x8A74, 0xE050, 0x8A75, 0xE04D, 0x8A76, 0xE045, 0x8A77, 0xE04A, 0x8A79, 0xB8E2, 0x8A7A, 0xE051, 0x8A7B, 0xB8E3, 0x8A7C, 0xB8D9, + 0x8A7F, 0xE047, 0x8A81, 0xE04F, 0x8A82, 0xE04B, 0x8A83, 0xE04E, 0x8A84, 0xE04C, 0x8A85, 0xB8DD, 0x8A86, 0xE046, 0x8A87, 0xB8D8, + 0x8A8B, 0xE44C, 0x8A8C, 0xBB78, 0x8A8D, 0xBB7B, 0x8A8F, 0xE44E, 0x8A91, 0xBBA5, 0x8A92, 0xE44D, 0x8A93, 0xBB7D, 0x8A95, 0xBDCF, + 0x8A96, 0xE44F, 0x8A98, 0xBBA4, 0x8A99, 0xE44B, 0x8A9A, 0xBBA6, 0x8A9E, 0xBB79, 0x8AA0, 0xB8DB, 0x8AA1, 0xBB7C, 0x8AA3, 0xBB7A, + 0x8AA4, 0xBB7E, 0x8AA5, 0xBBA2, 0x8AA6, 0xBB77, 0x8AA7, 0xBBA7, 0x8AA8, 0xBBA3, 0x8AAA, 0xBBA1, 0x8AAB, 0xE44A, 0x8AB0, 0xBDD6, + 0x8AB2, 0xBDD2, 0x8AB6, 0xBDD9, 0x8AB8, 0xE7D6, 0x8AB9, 0xBDDA, 0x8ABA, 0xE7E2, 0x8ABB, 0xE7DB, 0x8ABC, 0xBDCB, 0x8ABD, 0xE7E3, + 0x8ABE, 0xE7DD, 0x8ABF, 0xBDD5, 0x8AC0, 0xE7DE, 0x8AC2, 0xBDD4, 0x8AC3, 0xE7E1, 0x8AC4, 0xBDCE, 0x8AC5, 0xE7DF, 0x8AC6, 0xE7D5, + 0x8AC7, 0xBDCD, 0x8AC8, 0xEBAA, 0x8AC9, 0xBDD3, 0x8ACB, 0xBDD0, 0x8ACD, 0xBDD8, 0x8ACF, 0xE7D4, 0x8AD1, 0xE7D8, 0x8AD2, 0xBDCC, + 0x8AD3, 0xE7D7, 0x8AD4, 0xE7D9, 0x8AD5, 0xE7DA, 0x8AD6, 0xBDD7, 0x8AD7, 0xE7DC, 0x8AD8, 0xE7E0, 0x8AD9, 0xE7E4, 0x8ADB, 0xBDDB, + 0x8ADC, 0xBFD2, 0x8ADD, 0xEBA5, 0x8ADE, 0xEBAB, 0x8ADF, 0xEBA8, 0x8AE0, 0xEB7E, 0x8AE1, 0xEBAC, 0x8AE2, 0xEBA1, 0x8AE4, 0xEBA7, + 0x8AE6, 0xBFCD, 0x8AE7, 0xBFD3, 0x8AE8, 0xEBAD, 0x8AEB, 0xBFCF, 0x8AED, 0xBFD9, 0x8AEE, 0xBFD4, 0x8AEF, 0xEBAF, 0x8AF0, 0xEBA9, + 0x8AF1, 0xBFD0, 0x8AF2, 0xEBA2, 0x8AF3, 0xBFDA, 0x8AF4, 0xEBA3, 0x8AF5, 0xEBA4, 0x8AF6, 0xBFDB, 0x8AF7, 0xBFD8, 0x8AF8, 0xBDD1, + 0x8AFA, 0xBFCE, 0x8AFB, 0xEBB0, 0x8AFC, 0xBFDC, 0x8AFE, 0xBFD5, 0x8AFF, 0xEBAE, 0x8B00, 0xBFD1, 0x8B01, 0xBFD6, 0x8B02, 0xBFD7, + 0x8B04, 0xC1C3, 0x8B05, 0xEEA4, 0x8B06, 0xEEAD, 0x8B07, 0xEEAA, 0x8B08, 0xEEAC, 0x8B0A, 0xC1C0, 0x8B0B, 0xEEA5, 0x8B0D, 0xEEAB, + 0x8B0E, 0xC1BC, 0x8B0F, 0xEEA7, 0x8B10, 0xC1C4, 0x8B11, 0xEEA3, 0x8B12, 0xEEA8, 0x8B13, 0xEEAF, 0x8B14, 0xEBA6, 0x8B15, 0xEEA9, + 0x8B16, 0xEEA2, 0x8B17, 0xC1BD, 0x8B18, 0xEEA1, 0x8B19, 0xC1BE, 0x8B1A, 0xEEB0, 0x8B1B, 0xC1BF, 0x8B1C, 0xEEAE, 0x8B1D, 0xC1C2, + 0x8B1E, 0xEE7E, 0x8B20, 0xC1C1, 0x8B22, 0xEEA6, 0x8B23, 0xF0DC, 0x8B24, 0xF0EA, 0x8B25, 0xF0E5, 0x8B26, 0xF0E7, 0x8B27, 0xF0DB, + 0x8B28, 0xC2D3, 0x8B2A, 0xF0DA, 0x8B2B, 0xC2D6, 0x8B2C, 0xC2D5, 0x8B2E, 0xF0E9, 0x8B2F, 0xF0E1, 0x8B30, 0xF0DE, 0x8B31, 0xF0E4, + 0x8B33, 0xF0DD, 0x8B35, 0xF0DF, 0x8B36, 0xF0E8, 0x8B37, 0xF0E6, 0x8B39, 0xC2D4, 0x8B3A, 0xF0ED, 0x8B3B, 0xF0EB, 0x8B3C, 0xF0E2, + 0x8B3D, 0xF0EC, 0x8B3E, 0xF0E3, 0x8B40, 0xF2F9, 0x8B41, 0xC3CF, 0x8B42, 0xF341, 0x8B45, 0xF64F, 0x8B46, 0xC3D6, 0x8B47, 0xF0E0, + 0x8B48, 0xF2F7, 0x8B49, 0xC3D2, 0x8B4A, 0xF2F8, 0x8B4B, 0xF2FD, 0x8B4E, 0xC3D4, 0x8B4F, 0xC3D5, 0x8B50, 0xF2F6, 0x8B51, 0xF340, + 0x8B52, 0xF342, 0x8B53, 0xF2FA, 0x8B54, 0xF2FC, 0x8B55, 0xF2FE, 0x8B56, 0xF2FB, 0x8B57, 0xF343, 0x8B58, 0xC3D1, 0x8B59, 0xC3D7, + 0x8B5A, 0xC3D3, 0x8B5C, 0xC3D0, 0x8B5D, 0xF4D0, 0x8B5F, 0xC4B7, 0x8B60, 0xF4CE, 0x8B63, 0xF4D2, 0x8B65, 0xF4D3, 0x8B66, 0xC4B5, + 0x8B67, 0xF4D4, 0x8B68, 0xF4D1, 0x8B6A, 0xF4CF, 0x8B6B, 0xC4B8, 0x8B6C, 0xC4B4, 0x8B6D, 0xF4D5, 0x8B6F, 0xC4B6, 0x8B70, 0xC4B3, + 0x8B74, 0xC4FE, 0x8B77, 0xC540, 0x8B78, 0xF64E, 0x8B79, 0xF64D, 0x8B7A, 0xF650, 0x8B7B, 0xF651, 0x8B7D, 0xC541, 0x8B7E, 0xF756, + 0x8B7F, 0xF75B, 0x8B80, 0xC5AA, 0x8B82, 0xF758, 0x8B84, 0xF757, 0x8B85, 0xF75A, 0x8B86, 0xF759, 0x8B88, 0xF843, 0x8B8A, 0xC5DC, + 0x8B8B, 0xF842, 0x8B8C, 0xF840, 0x8B8E, 0xF841, 0x8B92, 0xC5FE, 0x8B93, 0xC5FD, 0x8B94, 0xF8C1, 0x8B95, 0xF8C2, 0x8B96, 0xC640, + 0x8B98, 0xF94D, 0x8B99, 0xF94E, 0x8B9A, 0xC667, 0x8B9C, 0xC66D, 0x8B9E, 0xF9A9, 0x8B9F, 0xF9C8, 0x8C37, 0xA8A6, 0x8C39, 0xD7CD, + 0x8C3B, 0xD7CE, 0x8C3C, 0xE052, 0x8C3D, 0xE450, 0x8C3E, 0xE7E5, 0x8C3F, 0xC1C6, 0x8C41, 0xC1C5, 0x8C42, 0xF0EE, 0x8C43, 0xF344, + 0x8C45, 0xF844, 0x8C46, 0xA8A7, 0x8C47, 0xD3DE, 0x8C48, 0xB05A, 0x8C49, 0xB361, 0x8C4A, 0xE054, 0x8C4B, 0xE053, 0x8C4C, 0xBDDC, + 0x8C4D, 0xE7E6, 0x8C4E, 0xBDDD, 0x8C4F, 0xEEB1, 0x8C50, 0xC2D7, 0x8C54, 0xC676, 0x8C55, 0xA8A8, 0x8C56, 0xCDCB, 0x8C57, 0xD3DF, + 0x8C5A, 0xB362, 0x8C5C, 0xD7CF, 0x8C5D, 0xD7D0, 0x8C5F, 0xDBE5, 0x8C61, 0xB648, 0x8C62, 0xB8E6, 0x8C64, 0xE056, 0x8C65, 0xE055, + 0x8C66, 0xE057, 0x8C68, 0xE451, 0x8C69, 0xE452, 0x8C6A, 0xBBA8, 0x8C6B, 0xBFDD, 0x8C6C, 0xBDDE, 0x8C6D, 0xBFDE, 0x8C6F, 0xEEB5, + 0x8C70, 0xEEB2, 0x8C71, 0xEEB4, 0x8C72, 0xEEB3, 0x8C73, 0xC1C7, 0x8C75, 0xF0EF, 0x8C76, 0xF346, 0x8C77, 0xF345, 0x8C78, 0xCBA4, + 0x8C79, 0xB05C, 0x8C7A, 0xB05B, 0x8C7B, 0xD3E0, 0x8C7D, 0xD7D1, 0x8C80, 0xDBE7, 0x8C81, 0xDBE6, 0x8C82, 0xB649, 0x8C84, 0xE059, + 0x8C85, 0xE05A, 0x8C86, 0xE058, 0x8C89, 0xB8E8, 0x8C8A, 0xB8E7, 0x8C8C, 0xBBAA, 0x8C8D, 0xBBA9, 0x8C8F, 0xE7E7, 0x8C90, 0xEBB3, + 0x8C91, 0xEBB1, 0x8C92, 0xEBB2, 0x8C93, 0xBFDF, 0x8C94, 0xEEB7, 0x8C95, 0xEEB6, 0x8C97, 0xF0F2, 0x8C98, 0xF0F1, 0x8C99, 0xF0F0, + 0x8C9A, 0xF347, 0x8C9C, 0xF9AA, 0x8C9D, 0xA8A9, 0x8C9E, 0xAD73, 0x8CA0, 0xAD74, 0x8CA1, 0xB05D, 0x8CA2, 0xB05E, 0x8CA3, 0xD3E2, + 0x8CA4, 0xD3E1, 0x8CA5, 0xD7D2, 0x8CA7, 0xB368, 0x8CA8, 0xB366, 0x8CA9, 0xB363, 0x8CAA, 0xB367, 0x8CAB, 0xB365, 0x8CAC, 0xB364, + 0x8CAF, 0xB64A, 0x8CB0, 0xDBEA, 0x8CB2, 0xB8ED, 0x8CB3, 0xB64C, 0x8CB4, 0xB651, 0x8CB5, 0xDBEC, 0x8CB6, 0xB653, 0x8CB7, 0xB652, + 0x8CB8, 0xB655, 0x8CB9, 0xDBEB, 0x8CBA, 0xDBE8, 0x8CBB, 0xB64F, 0x8CBC, 0xB64B, 0x8CBD, 0xB64D, 0x8CBE, 0xDBE9, 0x8CBF, 0xB654, + 0x8CC0, 0xB650, 0x8CC1, 0xB64E, 0x8CC2, 0xB8EF, 0x8CC3, 0xB8EE, 0x8CC4, 0xB8EC, 0x8CC5, 0xB8F0, 0x8CC7, 0xB8EA, 0x8CC8, 0xB8EB, + 0x8CCA, 0xB8E9, 0x8CCC, 0xE05B, 0x8CCF, 0xE454, 0x8CD1, 0xBBAC, 0x8CD2, 0xBBAD, 0x8CD3, 0xBBAB, 0x8CD5, 0xE453, 0x8CD7, 0xE455, + 0x8CD9, 0xE7EA, 0x8CDA, 0xE7EC, 0x8CDC, 0xBDE7, 0x8CDD, 0xE7ED, 0x8CDE, 0xBDE0, 0x8CDF, 0xE7E9, 0x8CE0, 0xBDDF, 0x8CE1, 0xBDE9, + 0x8CE2, 0xBDE5, 0x8CE3, 0xBDE6, 0x8CE4, 0xBDE2, 0x8CE5, 0xE7E8, 0x8CE6, 0xBDE1, 0x8CE7, 0xE7EE, 0x8CE8, 0xE7EB, 0x8CEA, 0xBDE8, + 0x8CEC, 0xBDE3, 0x8CED, 0xBDE4, 0x8CEE, 0xEBB5, 0x8CF0, 0xEBB7, 0x8CF1, 0xEBB6, 0x8CF3, 0xEBB8, 0x8CF4, 0xBFE0, 0x8CF5, 0xEBB4, + 0x8CF8, 0xC1CB, 0x8CF9, 0xEEB8, 0x8CFA, 0xC1C8, 0x8CFB, 0xC1CC, 0x8CFC, 0xC1CA, 0x8CFD, 0xC1C9, 0x8CFE, 0xF0F3, 0x8D00, 0xF0F6, + 0x8D02, 0xF0F5, 0x8D04, 0xF0F4, 0x8D05, 0xC2D8, 0x8D06, 0xF348, 0x8D07, 0xF349, 0x8D08, 0xC3D8, 0x8D09, 0xF34A, 0x8D0A, 0xC3D9, + 0x8D0D, 0xC4BA, 0x8D0F, 0xC4B9, 0x8D10, 0xF652, 0x8D13, 0xC542, 0x8D14, 0xF653, 0x8D15, 0xF75C, 0x8D16, 0xC5AB, 0x8D17, 0xC5AC, + 0x8D19, 0xF845, 0x8D1B, 0xC642, 0x8D64, 0xA8AA, 0x8D66, 0xB36A, 0x8D67, 0xB369, 0x8D68, 0xE05C, 0x8D69, 0xE05D, 0x8D6B, 0xBBAE, + 0x8D6C, 0xEBB9, 0x8D6D, 0xBDEA, 0x8D6E, 0xEBBA, 0x8D6F, 0xEEB9, 0x8D70, 0xA8AB, 0x8D72, 0xD0B2, 0x8D73, 0xAD76, 0x8D74, 0xAD75, + 0x8D76, 0xD3E3, 0x8D77, 0xB05F, 0x8D78, 0xD3E4, 0x8D79, 0xD7D5, 0x8D7B, 0xD7D4, 0x8D7D, 0xD7D3, 0x8D80, 0xDBEE, 0x8D81, 0xB658, + 0x8D84, 0xDBED, 0x8D85, 0xB657, 0x8D89, 0xDBEF, 0x8D8A, 0xB656, 0x8D8C, 0xE05F, 0x8D8D, 0xE062, 0x8D8E, 0xE060, 0x8D8F, 0xE061, + 0x8D90, 0xE065, 0x8D91, 0xE05E, 0x8D92, 0xE066, 0x8D93, 0xE063, 0x8D94, 0xE064, 0x8D95, 0xBBB0, 0x8D96, 0xE456, 0x8D99, 0xBBAF, + 0x8D9B, 0xE7F2, 0x8D9C, 0xE7F0, 0x8D9F, 0xBDEB, 0x8DA0, 0xE7EF, 0x8DA1, 0xE7F1, 0x8DA3, 0xBDEC, 0x8DA5, 0xEBBB, 0x8DA7, 0xEBBC, + 0x8DA8, 0xC1CD, 0x8DAA, 0xF34C, 0x8DAB, 0xF34E, 0x8DAC, 0xF34B, 0x8DAD, 0xF34D, 0x8DAE, 0xF4D6, 0x8DAF, 0xF654, 0x8DB2, 0xF96F, + 0x8DB3, 0xA8AC, 0x8DB4, 0xAD77, 0x8DB5, 0xD3E5, 0x8DB6, 0xD3E7, 0x8DB7, 0xD3E6, 0x8DB9, 0xD7D8, 0x8DBA, 0xB36C, 0x8DBC, 0xD7D6, + 0x8DBE, 0xB36B, 0x8DBF, 0xD7D9, 0x8DC1, 0xD7DA, 0x8DC2, 0xD7D7, 0x8DC5, 0xDBFB, 0x8DC6, 0xB660, 0x8DC7, 0xDBF3, 0x8DC8, 0xDBF9, + 0x8DCB, 0xB65B, 0x8DCC, 0xB65E, 0x8DCD, 0xDBF2, 0x8DCE, 0xB659, 0x8DCF, 0xDBF6, 0x8DD0, 0xE06C, 0x8DD1, 0xB65D, 0x8DD3, 0xDBF1, + 0x8DD5, 0xDBF7, 0x8DD6, 0xDBF4, 0x8DD7, 0xDBFA, 0x8DD8, 0xDBF0, 0x8DD9, 0xDBF8, 0x8DDA, 0xB65C, 0x8DDB, 0xB65F, 0x8DDC, 0xDBF5, + 0x8DDD, 0xB65A, 0x8DDF, 0xB8F2, 0x8DE0, 0xE068, 0x8DE1, 0xB8F1, 0x8DE2, 0xE06F, 0x8DE3, 0xE06E, 0x8DE4, 0xB8F8, 0x8DE6, 0xB8F9, + 0x8DE7, 0xE070, 0x8DE8, 0xB8F3, 0x8DE9, 0xE06D, 0x8DEA, 0xB8F7, 0x8DEB, 0xE072, 0x8DEC, 0xE069, 0x8DEE, 0xE06B, 0x8DEF, 0xB8F4, + 0x8DF0, 0xE067, 0x8DF1, 0xE06A, 0x8DF2, 0xE071, 0x8DF3, 0xB8F5, 0x8DF4, 0xE073, 0x8DFA, 0xB8F6, 0x8DFC, 0xBBB1, 0x8DFD, 0xE45B, + 0x8DFE, 0xE461, 0x8DFF, 0xE459, 0x8E00, 0xE462, 0x8E02, 0xE458, 0x8E03, 0xE45D, 0x8E04, 0xE463, 0x8E05, 0xE460, 0x8E06, 0xE45F, + 0x8E07, 0xE45E, 0x8E09, 0xE457, 0x8E0A, 0xE45C, 0x8E0D, 0xE45A, 0x8E0F, 0xBDF1, 0x8E10, 0xBDEE, 0x8E11, 0xE7FB, 0x8E12, 0xE841, + 0x8E13, 0xE843, 0x8E14, 0xE840, 0x8E15, 0xE7F8, 0x8E16, 0xE7FA, 0x8E17, 0xE845, 0x8E18, 0xE842, 0x8E19, 0xE7FC, 0x8E1A, 0xE846, + 0x8E1B, 0xE7F9, 0x8E1C, 0xE844, 0x8E1D, 0xBDEF, 0x8E1E, 0xBDF5, 0x8E1F, 0xBDF3, 0x8E20, 0xE7F3, 0x8E21, 0xBDF4, 0x8E22, 0xBDF0, + 0x8E23, 0xE7F4, 0x8E24, 0xE7F6, 0x8E25, 0xE7F5, 0x8E26, 0xE7FD, 0x8E27, 0xE7FE, 0x8E29, 0xBDF2, 0x8E2B, 0xBDED, 0x8E2E, 0xE7F7, + 0x8E30, 0xEBC6, 0x8E31, 0xBFE2, 0x8E33, 0xEBBD, 0x8E34, 0xBFE3, 0x8E35, 0xBFE6, 0x8E36, 0xEBC2, 0x8E38, 0xEBBF, 0x8E39, 0xBFE5, + 0x8E3C, 0xEBC3, 0x8E3D, 0xEBC4, 0x8E3E, 0xEBBE, 0x8E3F, 0xEBC7, 0x8E40, 0xEBC0, 0x8E41, 0xEBC5, 0x8E42, 0xBFE4, 0x8E44, 0xBFE1, + 0x8E45, 0xEBC1, 0x8E47, 0xEEBF, 0x8E48, 0xC1D0, 0x8E49, 0xC1CE, 0x8E4A, 0xC1D1, 0x8E4B, 0xC1CF, 0x8E4C, 0xEEBE, 0x8E4D, 0xEEBB, + 0x8E4E, 0xEEBA, 0x8E50, 0xEEBD, 0x8E53, 0xEEBC, 0x8E54, 0xF145, 0x8E55, 0xC2DE, 0x8E56, 0xF0FB, 0x8E57, 0xF0FA, 0x8E59, 0xC2D9, + 0x8E5A, 0xF141, 0x8E5B, 0xF140, 0x8E5C, 0xF0F7, 0x8E5D, 0xF143, 0x8E5E, 0xF0FC, 0x8E5F, 0xC2DD, 0x8E60, 0xF0F9, 0x8E61, 0xF142, + 0x8E62, 0xF0F8, 0x8E63, 0xC2DA, 0x8E64, 0xC2DC, 0x8E65, 0xF0FD, 0x8E66, 0xC2DB, 0x8E67, 0xF0FE, 0x8E69, 0xF144, 0x8E6A, 0xF352, + 0x8E6C, 0xC3DE, 0x8E6D, 0xF34F, 0x8E6F, 0xF353, 0x8E72, 0xC3DB, 0x8E73, 0xF351, 0x8E74, 0xC3E0, 0x8E76, 0xC3DD, 0x8E78, 0xF350, + 0x8E7A, 0xC3DF, 0x8E7B, 0xF354, 0x8E7C, 0xC3DA, 0x8E81, 0xC4BC, 0x8E82, 0xC4BE, 0x8E84, 0xF4D9, 0x8E85, 0xC4BD, 0x8E86, 0xF4D7, + 0x8E87, 0xC3DC, 0x8E88, 0xF4D8, 0x8E89, 0xC4BB, 0x8E8A, 0xC543, 0x8E8B, 0xC545, 0x8E8C, 0xF656, 0x8E8D, 0xC544, 0x8E8E, 0xF655, + 0x8E90, 0xF761, 0x8E91, 0xC5AD, 0x8E92, 0xF760, 0x8E93, 0xC5AE, 0x8E94, 0xF75E, 0x8E95, 0xF75D, 0x8E96, 0xF762, 0x8E97, 0xF763, + 0x8E98, 0xF846, 0x8E9A, 0xF75F, 0x8E9D, 0xF8C6, 0x8E9E, 0xF8C3, 0x8E9F, 0xF8C4, 0x8EA0, 0xF8C5, 0x8EA1, 0xC65C, 0x8EA3, 0xF951, + 0x8EA4, 0xF950, 0x8EA5, 0xF94F, 0x8EA6, 0xF970, 0x8EA8, 0xF9BE, 0x8EA9, 0xF9AB, 0x8EAA, 0xC66E, 0x8EAB, 0xA8AD, 0x8EAC, 0xB060, + 0x8EB2, 0xB8FA, 0x8EBA, 0xBDF6, 0x8EBD, 0xEBC8, 0x8EC0, 0xC2DF, 0x8EC2, 0xF355, 0x8EC9, 0xF9AC, 0x8ECA, 0xA8AE, 0x8ECB, 0xAAEE, + 0x8ECC, 0xAD79, 0x8ECD, 0xAD78, 0x8ECF, 0xB063, 0x8ED1, 0xD3E8, 0x8ED2, 0xB061, 0x8ED3, 0xD3E9, 0x8ED4, 0xB062, 0x8ED7, 0xD7DF, + 0x8ED8, 0xD7DB, 0x8EDB, 0xB36D, 0x8EDC, 0xD7DE, 0x8EDD, 0xD7DD, 0x8EDE, 0xD7DC, 0x8EDF, 0xB36E, 0x8EE0, 0xD7E0, 0x8EE1, 0xD7E1, + 0x8EE5, 0xDC43, 0x8EE6, 0xDC41, 0x8EE7, 0xDC45, 0x8EE8, 0xDC46, 0x8EE9, 0xDC4C, 0x8EEB, 0xDC48, 0x8EEC, 0xDC4A, 0x8EEE, 0xDC42, + 0x8EEF, 0xDBFC, 0x8EF1, 0xDC49, 0x8EF4, 0xDC4B, 0x8EF5, 0xDC44, 0x8EF6, 0xDC47, 0x8EF7, 0xDBFD, 0x8EF8, 0xB662, 0x8EF9, 0xDC40, + 0x8EFA, 0xDBFE, 0x8EFB, 0xB661, 0x8EFC, 0xB663, 0x8EFE, 0xB8FD, 0x8EFF, 0xE075, 0x8F00, 0xE077, 0x8F01, 0xE076, 0x8F02, 0xE07B, + 0x8F03, 0xB8FB, 0x8F05, 0xE078, 0x8F06, 0xE074, 0x8F07, 0xE079, 0x8F08, 0xE07A, 0x8F09, 0xB8FC, 0x8F0A, 0xB8FE, 0x8F0B, 0xE07C, + 0x8F0D, 0xE467, 0x8F0E, 0xE466, 0x8F10, 0xE464, 0x8F11, 0xE465, 0x8F12, 0xBBB3, 0x8F13, 0xBBB5, 0x8F14, 0xBBB2, 0x8F15, 0xBBB4, + 0x8F16, 0xE84D, 0x8F17, 0xE84E, 0x8F18, 0xE849, 0x8F1A, 0xE84A, 0x8F1B, 0xBDF8, 0x8F1C, 0xBDFD, 0x8F1D, 0xBDF7, 0x8F1E, 0xBDFE, + 0x8F1F, 0xBDF9, 0x8F20, 0xE84B, 0x8F23, 0xE84C, 0x8F24, 0xE848, 0x8F25, 0xBE40, 0x8F26, 0xBDFB, 0x8F29, 0xBDFA, 0x8F2A, 0xBDFC, + 0x8F2C, 0xE847, 0x8F2E, 0xEBCA, 0x8F2F, 0xBFE8, 0x8F32, 0xEBCC, 0x8F33, 0xBFEA, 0x8F34, 0xEBCF, 0x8F35, 0xEBCB, 0x8F36, 0xEBC9, + 0x8F37, 0xEBCE, 0x8F38, 0xBFE9, 0x8F39, 0xEBCD, 0x8F3B, 0xBFE7, 0x8F3E, 0xC1D3, 0x8F3F, 0xC1D6, 0x8F40, 0xEEC1, 0x8F42, 0xC1D4, + 0x8F43, 0xEEC0, 0x8F44, 0xC1D2, 0x8F45, 0xC1D5, 0x8F46, 0xF146, 0x8F47, 0xF147, 0x8F48, 0xF148, 0x8F49, 0xC2E0, 0x8F4B, 0xF149, + 0x8F4D, 0xC2E1, 0x8F4E, 0xC3E2, 0x8F4F, 0xF358, 0x8F50, 0xF359, 0x8F51, 0xF357, 0x8F52, 0xF356, 0x8F53, 0xF35A, 0x8F54, 0xC3E1, + 0x8F55, 0xF4DD, 0x8F56, 0xF4DB, 0x8F57, 0xF4DC, 0x8F58, 0xF4DE, 0x8F59, 0xF4DA, 0x8F5A, 0xF4DF, 0x8F5B, 0xF658, 0x8F5D, 0xF659, + 0x8F5E, 0xF657, 0x8F5F, 0xC546, 0x8F60, 0xF764, 0x8F61, 0xC5AF, 0x8F62, 0xF765, 0x8F63, 0xF848, 0x8F64, 0xF847, 0x8F9B, 0xA8AF, + 0x8F9C, 0xB664, 0x8F9F, 0xB940, 0x8FA3, 0xBBB6, 0x8FA6, 0xBFEC, 0x8FA8, 0xBFEB, 0x8FAD, 0xC3E3, 0x8FAE, 0xC47C, 0x8FAF, 0xC547, + 0x8FB0, 0xA8B0, 0x8FB1, 0xB064, 0x8FB2, 0xB941, 0x8FB4, 0xF35B, 0x8FBF, 0xCBA6, 0x8FC2, 0xA8B1, 0x8FC4, 0xA8B4, 0x8FC5, 0xA8B3, + 0x8FC6, 0xA8B2, 0x8FC9, 0xCBA5, 0x8FCB, 0xCDCD, 0x8FCD, 0xCDCF, 0x8FCE, 0xAAEF, 0x8FD1, 0xAAF1, 0x8FD2, 0xCDCC, 0x8FD3, 0xCDCE, + 0x8FD4, 0xAAF0, 0x8FD5, 0xCDD1, 0x8FD6, 0xCDD0, 0x8FD7, 0xCDD2, 0x8FE0, 0xD0B6, 0x8FE1, 0xD0B4, 0x8FE2, 0xAD7C, 0x8FE3, 0xD0B3, + 0x8FE4, 0xADA3, 0x8FE5, 0xAD7E, 0x8FE6, 0xAD7B, 0x8FE8, 0xADA4, 0x8FEA, 0xAD7D, 0x8FEB, 0xADA2, 0x8FED, 0xADA1, 0x8FEE, 0xD0B5, + 0x8FF0, 0xAD7A, 0x8FF4, 0xB06A, 0x8FF5, 0xD3EB, 0x8FF6, 0xD3F1, 0x8FF7, 0xB067, 0x8FF8, 0xB06E, 0x8FFA, 0xB069, 0x8FFB, 0xD3EE, + 0x8FFC, 0xD3F0, 0x8FFD, 0xB06C, 0x8FFE, 0xD3EA, 0x8FFF, 0xD3ED, 0x9000, 0xB068, 0x9001, 0xB065, 0x9002, 0xD3EC, 0x9003, 0xB06B, + 0x9004, 0xD3EF, 0x9005, 0xB06D, 0x9006, 0xB066, 0x900B, 0xD7E3, 0x900C, 0xD7E6, 0x900D, 0xB370, 0x900F, 0xB37A, 0x9010, 0xB376, + 0x9011, 0xD7E4, 0x9014, 0xB37E, 0x9015, 0xB377, 0x9016, 0xB37C, 0x9017, 0xB372, 0x9019, 0xB36F, 0x901A, 0xB371, 0x901B, 0xB37D, + 0x901C, 0xD7E5, 0x901D, 0xB375, 0x901E, 0xB378, 0x901F, 0xB374, 0x9020, 0xB379, 0x9021, 0xD7E7, 0x9022, 0xB37B, 0x9023, 0xB373, + 0x9024, 0xD7E2, 0x902D, 0xDC4D, 0x902E, 0xB665, 0x902F, 0xDC4F, 0x9031, 0xB667, 0x9032, 0xB669, 0x9034, 0xDC4E, 0x9035, 0xB666, + 0x9036, 0xB66A, 0x9038, 0xB668, 0x903C, 0xB947, 0x903D, 0xE0A3, 0x903E, 0xB94F, 0x903F, 0xE07E, 0x9041, 0xB950, 0x9042, 0xB945, + 0x9044, 0xE0A1, 0x9047, 0xB94A, 0x9049, 0xE0A2, 0x904A, 0xB943, 0x904B, 0xB942, 0x904D, 0xB94D, 0x904E, 0xB94C, 0x904F, 0xB94B, + 0x9050, 0xB949, 0x9051, 0xB94E, 0x9052, 0xE07D, 0x9053, 0xB944, 0x9054, 0xB946, 0x9055, 0xB948, 0x9058, 0xBBB8, 0x9059, 0xBBBB, + 0x905B, 0xBBBF, 0x905C, 0xBBB9, 0x905D, 0xBBBE, 0x905E, 0xBBBC, 0x9060, 0xBBB7, 0x9062, 0xBBBD, 0x9063, 0xBBBA, 0x9067, 0xE852, + 0x9068, 0xBE43, 0x9069, 0xBE41, 0x906B, 0xE853, 0x906D, 0xBE44, 0x906E, 0xBE42, 0x906F, 0xE851, 0x9070, 0xE850, 0x9072, 0xBFF0, + 0x9073, 0xE84F, 0x9074, 0xBFEE, 0x9075, 0xBFED, 0x9076, 0xEBD0, 0x9077, 0xBE45, 0x9078, 0xBFEF, 0x9079, 0xEBD1, 0x907A, 0xBFF2, + 0x907B, 0xEBD2, 0x907C, 0xBFF1, 0x907D, 0xC1D8, 0x907E, 0xEEC3, 0x907F, 0xC1D7, 0x9080, 0xC1DC, 0x9081, 0xC1DA, 0x9082, 0xC1DB, + 0x9083, 0xC2E3, 0x9084, 0xC1D9, 0x9085, 0xEEC2, 0x9086, 0xEBD3, 0x9087, 0xC2E2, 0x9088, 0xC2E4, 0x908A, 0xC3E4, 0x908B, 0xC3E5, + 0x908D, 0xF4E0, 0x908F, 0xC5DE, 0x9090, 0xC5DD, 0x9091, 0xA8B6, 0x9094, 0xCA55, 0x9095, 0xB06F, 0x9097, 0xCA52, 0x9098, 0xCA53, + 0x9099, 0xCA51, 0x909B, 0xCA54, 0x909E, 0xCBAA, 0x909F, 0xCBA7, 0x90A0, 0xCBAC, 0x90A1, 0xCBA8, 0x90A2, 0xA8B7, 0x90A3, 0xA8BA, + 0x90A5, 0xCBA9, 0x90A6, 0xA8B9, 0x90A7, 0xCBAB, 0x90AA, 0xA8B8, 0x90AF, 0xCDD5, 0x90B0, 0xCDD7, 0x90B1, 0xAAF4, 0x90B2, 0xCDD3, + 0x90B3, 0xCDD6, 0x90B4, 0xCDD4, 0x90B5, 0xAAF2, 0x90B6, 0xAAF5, 0x90B8, 0xAAF3, 0x90BD, 0xD0B8, 0x90BE, 0xD0BC, 0x90BF, 0xD0B9, + 0x90C1, 0xADA7, 0x90C3, 0xADA8, 0x90C5, 0xD0BB, 0x90C7, 0xD0BD, 0x90C8, 0xD0BF, 0x90CA, 0xADA5, 0x90CB, 0xD0BE, 0x90CE, 0xADA6, + 0x90D4, 0xD7EE, 0x90D5, 0xD0BA, 0x90D6, 0xD3F2, 0x90D7, 0xD3FB, 0x90D8, 0xD3F9, 0x90D9, 0xD3F4, 0x90DA, 0xD3F5, 0x90DB, 0xD3FA, + 0x90DC, 0xD3FC, 0x90DD, 0xB071, 0x90DF, 0xD3F7, 0x90E0, 0xD3F3, 0x90E1, 0xB070, 0x90E2, 0xB072, 0x90E3, 0xD3F6, 0x90E4, 0xD3FD, + 0x90E5, 0xD3F8, 0x90E8, 0xB3A1, 0x90E9, 0xD7F1, 0x90EA, 0xD7E9, 0x90EB, 0xD7EF, 0x90EC, 0xD7F0, 0x90ED, 0xB3A2, 0x90EF, 0xD7E8, + 0x90F0, 0xD7EA, 0x90F1, 0xD0B7, 0x90F2, 0xD7EC, 0x90F3, 0xD7ED, 0x90F4, 0xD7EB, 0x90F5, 0xB66C, 0x90F9, 0xDC56, 0x90FA, 0xEBD4, + 0x90FB, 0xDC57, 0x90FC, 0xDC54, 0x90FD, 0xB3A3, 0x90FE, 0xB66E, 0x90FF, 0xDC53, 0x9100, 0xDC59, 0x9101, 0xDC58, 0x9102, 0xB66B, + 0x9103, 0xDC5C, 0x9104, 0xDC52, 0x9105, 0xDC5B, 0x9106, 0xDC50, 0x9107, 0xDC5A, 0x9108, 0xDC55, 0x9109, 0xB66D, 0x910B, 0xE0AA, + 0x910D, 0xE0A5, 0x910E, 0xE0AB, 0x910F, 0xE0A6, 0x9110, 0xE0A4, 0x9111, 0xE0A7, 0x9112, 0xB951, 0x9114, 0xE0A9, 0x9116, 0xE0A8, + 0x9117, 0xB952, 0x9118, 0xBBC1, 0x9119, 0xBBC0, 0x911A, 0xE46E, 0x911B, 0xE471, 0x911C, 0xE469, 0x911D, 0xE46D, 0x911E, 0xBBC2, + 0x911F, 0xE46C, 0x9120, 0xE46A, 0x9121, 0xE470, 0x9122, 0xE46B, 0x9123, 0xE468, 0x9124, 0xE46F, 0x9126, 0xE859, 0x9127, 0xBE48, + 0x9128, 0xF14A, 0x9129, 0xE856, 0x912A, 0xE857, 0x912B, 0xE855, 0x912C, 0xDC51, 0x912D, 0xBE47, 0x912E, 0xE85A, 0x912F, 0xE854, + 0x9130, 0xBE46, 0x9131, 0xBE49, 0x9132, 0xE858, 0x9133, 0xEBD5, 0x9134, 0xBFF3, 0x9135, 0xEBD6, 0x9136, 0xEBD7, 0x9138, 0xEEC4, + 0x9139, 0xC1DD, 0x913A, 0xF14B, 0x913B, 0xF14C, 0x913E, 0xF14D, 0x913F, 0xF35D, 0x9140, 0xF35C, 0x9141, 0xF4E2, 0x9143, 0xF4E1, + 0x9144, 0xF65B, 0x9145, 0xF65C, 0x9146, 0xF65A, 0x9147, 0xF766, 0x9148, 0xC5B0, 0x9149, 0xA8BB, 0x914A, 0xADAA, 0x914B, 0xADA9, + 0x914C, 0xB075, 0x914D, 0xB074, 0x914E, 0xD440, 0x914F, 0xD441, 0x9150, 0xD3FE, 0x9152, 0xB073, 0x9153, 0xD7F5, 0x9155, 0xD7F6, + 0x9156, 0xD7F2, 0x9157, 0xB3A4, 0x9158, 0xD7F3, 0x915A, 0xD7F4, 0x915F, 0xDC5F, 0x9160, 0xDC61, 0x9161, 0xDC5D, 0x9162, 0xDC60, + 0x9163, 0xB66F, 0x9164, 0xDC5E, 0x9165, 0xB670, 0x9168, 0xDD73, 0x9169, 0xB955, 0x916A, 0xB954, 0x916C, 0xB953, 0x916E, 0xE0AC, + 0x916F, 0xE0AD, 0x9172, 0xE473, 0x9173, 0xE475, 0x9174, 0xBBC6, 0x9175, 0xBBC3, 0x9177, 0xBBC5, 0x9178, 0xBBC4, 0x9179, 0xE474, + 0x917A, 0xE472, 0x9180, 0xE861, 0x9181, 0xE85E, 0x9182, 0xE85F, 0x9183, 0xBE4D, 0x9184, 0xE860, 0x9185, 0xE85B, 0x9186, 0xE85C, + 0x9187, 0xBE4A, 0x9189, 0xBE4B, 0x918A, 0xE85D, 0x918B, 0xBE4C, 0x918D, 0xEBDB, 0x918F, 0xEBDC, 0x9190, 0xEBD9, 0x9191, 0xEBDA, + 0x9192, 0xBFF4, 0x9193, 0xEBD8, 0x9199, 0xEEC8, 0x919A, 0xEEC5, 0x919B, 0xEEC7, 0x919C, 0xC1E0, 0x919D, 0xEECB, 0x919E, 0xC1DF, + 0x919F, 0xEEC9, 0x91A0, 0xEECC, 0x91A1, 0xEECA, 0x91A2, 0xEEC6, 0x91A3, 0xC1DE, 0x91A5, 0xF14F, 0x91A7, 0xF150, 0x91A8, 0xF14E, + 0x91AA, 0xF152, 0x91AB, 0xC2E5, 0x91AC, 0xC2E6, 0x91AD, 0xF35F, 0x91AE, 0xC3E7, 0x91AF, 0xF151, 0x91B0, 0xF35E, 0x91B1, 0xC3E6, + 0x91B2, 0xF4E5, 0x91B3, 0xF4E6, 0x91B4, 0xC4BF, 0x91B5, 0xF4E4, 0x91B7, 0xF4E3, 0x91B9, 0xF65D, 0x91BA, 0xC548, 0x91BC, 0xF849, + 0x91BD, 0xF8C8, 0x91BE, 0xF8C7, 0x91C0, 0xC643, 0x91C1, 0xC65D, 0x91C2, 0xF8C9, 0x91C3, 0xF971, 0x91C5, 0xC66F, 0x91C6, 0xA8BC, + 0x91C7, 0xAAF6, 0x91C9, 0xB956, 0x91CB, 0xC4C0, 0x91CC, 0xA8BD, 0x91CD, 0xADAB, 0x91CE, 0xB3A5, 0x91CF, 0xB671, 0x91D0, 0xC2E7, + 0x91D1, 0xAAF7, 0x91D3, 0xD0C1, 0x91D4, 0xD0C0, 0x91D5, 0xD442, 0x91D7, 0xB078, 0x91D8, 0xB076, 0x91D9, 0xB07A, 0x91DA, 0xD444, + 0x91DC, 0xB079, 0x91DD, 0xB077, 0x91E2, 0xD443, 0x91E3, 0xB3A8, 0x91E4, 0xD7FC, 0x91E6, 0xB3A7, 0x91E7, 0xB3A9, 0x91E8, 0xD842, + 0x91E9, 0xB3AB, 0x91EA, 0xD7FE, 0x91EB, 0xD840, 0x91EC, 0xD7F7, 0x91ED, 0xB3AA, 0x91EE, 0xD843, 0x91F1, 0xD7F9, 0x91F3, 0xD7FA, + 0x91F4, 0xD7F8, 0x91F5, 0xB3A6, 0x91F7, 0xD841, 0x91F8, 0xD7FB, 0x91F9, 0xD7FD, 0x91FD, 0xDC6D, 0x91FF, 0xDC6C, 0x9200, 0xDC6A, + 0x9201, 0xDC62, 0x9202, 0xDC71, 0x9203, 0xDC65, 0x9204, 0xDC6F, 0x9205, 0xDC76, 0x9206, 0xDC6E, 0x9207, 0xB679, 0x9209, 0xB675, + 0x920A, 0xDC63, 0x920C, 0xDC69, 0x920D, 0xB677, 0x920F, 0xDC68, 0x9210, 0xB678, 0x9211, 0xB67A, 0x9212, 0xDC6B, 0x9214, 0xB672, + 0x9215, 0xB673, 0x9216, 0xDC77, 0x9217, 0xDC75, 0x9219, 0xDC74, 0x921A, 0xDC66, 0x921C, 0xDC72, 0x921E, 0xB676, 0x9223, 0xB674, + 0x9224, 0xDC73, 0x9225, 0xDC64, 0x9226, 0xDC67, 0x9227, 0xDC70, 0x922D, 0xE4BA, 0x922E, 0xE0B7, 0x9230, 0xE0B0, 0x9231, 0xE0C3, + 0x9232, 0xE0CC, 0x9233, 0xE0B3, 0x9234, 0xB961, 0x9236, 0xE0C0, 0x9237, 0xB957, 0x9238, 0xB959, 0x9239, 0xB965, 0x923A, 0xE0B1, + 0x923D, 0xB95A, 0x923E, 0xB95C, 0x923F, 0xB966, 0x9240, 0xB95B, 0x9245, 0xB964, 0x9246, 0xE0B9, 0x9248, 0xE0AE, 0x9249, 0xB962, + 0x924A, 0xE0B8, 0x924B, 0xB95E, 0x924C, 0xE0CA, 0x924D, 0xB963, 0x924E, 0xE0C8, 0x924F, 0xE0BC, 0x9250, 0xE0C6, 0x9251, 0xB960, + 0x9252, 0xE0AF, 0x9253, 0xE0C9, 0x9254, 0xE0C4, 0x9256, 0xE0CB, 0x9257, 0xB958, 0x925A, 0xB967, 0x925B, 0xB95D, 0x925E, 0xE0B5, + 0x9260, 0xE0BD, 0x9261, 0xE0C1, 0x9263, 0xE0C5, 0x9264, 0xB95F, 0x9265, 0xE0B4, 0x9266, 0xE0B2, 0x9267, 0xE0BE, 0x926C, 0xE0BB, + 0x926D, 0xE0BA, 0x926F, 0xE0BF, 0x9270, 0xE0C2, 0x9272, 0xE0C7, 0x9276, 0xE478, 0x9278, 0xBBC7, 0x9279, 0xE4A4, 0x927A, 0xE47A, + 0x927B, 0xBBCC, 0x927C, 0xBBD0, 0x927D, 0xE4AD, 0x927E, 0xE4B5, 0x927F, 0xE4A6, 0x9280, 0xBBC8, 0x9282, 0xE4AA, 0x9283, 0xE0B6, + 0x9285, 0xBBC9, 0x9286, 0xE4B1, 0x9287, 0xE4B6, 0x9288, 0xE4AE, 0x928A, 0xE4B0, 0x928B, 0xE4B9, 0x928C, 0xE4B2, 0x928D, 0xE47E, + 0x928E, 0xE4A9, 0x9291, 0xBBD1, 0x9293, 0xBBCD, 0x9294, 0xE47C, 0x9295, 0xE4AB, 0x9296, 0xBBCB, 0x9297, 0xE4A5, 0x9298, 0xBBCA, + 0x9299, 0xE4B3, 0x929A, 0xE4A2, 0x929B, 0xE479, 0x929C, 0xBBCE, 0x929D, 0xE4B8, 0x92A0, 0xE47B, 0x92A1, 0xE4AF, 0x92A2, 0xE4AC, + 0x92A3, 0xE4A7, 0x92A4, 0xE477, 0x92A5, 0xE476, 0x92A6, 0xE4A1, 0x92A7, 0xE4B4, 0x92A8, 0xBBCF, 0x92A9, 0xE4B7, 0x92AA, 0xE47D, + 0x92AB, 0xE4A3, 0x92AC, 0xBE52, 0x92B2, 0xBE5A, 0x92B3, 0xBE55, 0x92B4, 0xE8A4, 0x92B5, 0xE8A1, 0x92B6, 0xE867, 0x92B7, 0xBE50, + 0x92B9, 0xF9D7, 0x92BB, 0xBE4F, 0x92BC, 0xBE56, 0x92C0, 0xE865, 0x92C1, 0xBE54, 0x92C2, 0xE871, 0x92C3, 0xE863, 0x92C4, 0xE864, + 0x92C5, 0xBE4E, 0x92C6, 0xE8A3, 0x92C7, 0xBE58, 0x92C8, 0xE874, 0x92C9, 0xE879, 0x92CA, 0xE873, 0x92CB, 0xEBEE, 0x92CC, 0xE86F, + 0x92CD, 0xE877, 0x92CE, 0xE875, 0x92CF, 0xE868, 0x92D0, 0xE862, 0x92D1, 0xE87D, 0x92D2, 0xBE57, 0x92D3, 0xE87E, 0x92D5, 0xE878, + 0x92D7, 0xE86D, 0x92D8, 0xE86B, 0x92D9, 0xE866, 0x92DD, 0xE86E, 0x92DE, 0xE87B, 0x92DF, 0xE86A, 0x92E0, 0xE87A, 0x92E1, 0xE8A2, + 0x92E4, 0xBE53, 0x92E6, 0xE876, 0x92E7, 0xE87C, 0x92E8, 0xE872, 0x92E9, 0xE86C, 0x92EA, 0xBE51, 0x92EE, 0xE4A8, 0x92EF, 0xE870, + 0x92F0, 0xBE59, 0x92F1, 0xE869, 0x92F7, 0xEBF4, 0x92F8, 0xBFF7, 0x92F9, 0xEBF3, 0x92FA, 0xEBF0, 0x92FB, 0xEC44, 0x92FC, 0xBFFB, + 0x92FE, 0xEC41, 0x92FF, 0xEBF8, 0x9300, 0xEC43, 0x9301, 0xEBE9, 0x9302, 0xEBF6, 0x9304, 0xBFFD, 0x9306, 0xEBE1, 0x9308, 0xEBDF, + 0x9309, 0xEC42, 0x930B, 0xEC40, 0x930C, 0xEBFE, 0x930D, 0xEBED, 0x930E, 0xEBEC, 0x930F, 0xEBE2, 0x9310, 0xC040, 0x9312, 0xEBE8, + 0x9313, 0xEBF2, 0x9314, 0xEBFD, 0x9315, 0xC043, 0x9316, 0xEC45, 0x9318, 0xC1E8, 0x9319, 0xC045, 0x931A, 0xBFFE, 0x931B, 0xEBE6, + 0x931D, 0xEBEF, 0x931E, 0xEBDE, 0x931F, 0xEBE0, 0x9320, 0xBFF5, 0x9321, 0xC042, 0x9322, 0xBFFA, 0x9323, 0xEBE7, 0x9324, 0xEBF7, + 0x9325, 0xEBF1, 0x9326, 0xC041, 0x9327, 0xEBDD, 0x9328, 0xC1E3, 0x9329, 0xEBF9, 0x932A, 0xEBFC, 0x932B, 0xBFFC, 0x932D, 0xEBEB, + 0x932E, 0xC044, 0x932F, 0xBFF9, 0x9333, 0xBFF8, 0x9334, 0xEBF5, 0x9335, 0xEBFB, 0x9336, 0xBFF6, 0x9338, 0xEBE4, 0x9339, 0xEBFA, + 0x933C, 0xEBE5, 0x9346, 0xEBEA, 0x9347, 0xEED2, 0x9349, 0xEED7, 0x934A, 0xC1E5, 0x934B, 0xC1E7, 0x934C, 0xEEDD, 0x934D, 0xC1E1, + 0x934E, 0xEEEC, 0x934F, 0xEEE3, 0x9350, 0xEED8, 0x9351, 0xEED9, 0x9352, 0xEEE2, 0x9354, 0xC1EE, 0x9355, 0xEEE1, 0x9356, 0xEED1, + 0x9357, 0xEEE0, 0x9358, 0xEED4, 0x9359, 0xEEED, 0x935A, 0xC1ED, 0x935B, 0xC1EB, 0x935C, 0xEED5, 0x935E, 0xEEE8, 0x9360, 0xEEDA, + 0x9361, 0xEEE7, 0x9363, 0xEEE9, 0x9364, 0xEED0, 0x9365, 0xC1E6, 0x9367, 0xEEEA, 0x936A, 0xEEDE, 0x936C, 0xC1EA, 0x936D, 0xEEDB, + 0x9370, 0xC1EC, 0x9371, 0xEEE4, 0x9375, 0xC1E4, 0x9376, 0xEED6, 0x9377, 0xEEE5, 0x9379, 0xEEDF, 0x937A, 0xEBE3, 0x937B, 0xEEE6, + 0x937C, 0xEED3, 0x937E, 0xC1E9, 0x9380, 0xEEEB, 0x9382, 0xC1E2, 0x9383, 0xEECE, 0x9388, 0xF160, 0x9389, 0xF159, 0x938A, 0xC2E9, + 0x938C, 0xF154, 0x938D, 0xF163, 0x938E, 0xF15B, 0x938F, 0xEEDC, 0x9391, 0xF165, 0x9392, 0xF155, 0x9394, 0xC2E8, 0x9395, 0xF15F, + 0x9396, 0xC2EA, 0x9397, 0xC2F2, 0x9398, 0xC2F0, 0x9399, 0xF161, 0x939A, 0xC2F1, 0x939B, 0xF157, 0x939D, 0xF158, 0x939E, 0xF15D, + 0x939F, 0xF162, 0x93A1, 0xEECD, 0x93A2, 0xC2EB, 0x93A3, 0xF16A, 0x93A4, 0xF167, 0x93A5, 0xF16B, 0x93A6, 0xF15E, 0x93A7, 0xF15A, + 0x93A8, 0xF168, 0x93A9, 0xF36A, 0x93AA, 0xF15C, 0x93AC, 0xC2EE, 0x93AE, 0xC2ED, 0x93AF, 0xEECF, 0x93B0, 0xC2EF, 0x93B1, 0xF164, + 0x93B2, 0xF166, 0x93B3, 0xC2EC, 0x93B4, 0xF169, 0x93B5, 0xF153, 0x93B7, 0xF156, 0x93C0, 0xF373, 0x93C2, 0xF363, 0x93C3, 0xC3EB, + 0x93C4, 0xF371, 0x93C7, 0xF361, 0x93C8, 0xC3EC, 0x93CA, 0xF36C, 0x93CC, 0xF368, 0x93CD, 0xC3F1, 0x93CE, 0xF372, 0x93CF, 0xF362, + 0x93D0, 0xF365, 0x93D1, 0xC3E9, 0x93D2, 0xF374, 0x93D4, 0xF36D, 0x93D5, 0xF370, 0x93D6, 0xC3EF, 0x93D7, 0xC3F4, 0x93D8, 0xC3F2, + 0x93D9, 0xF369, 0x93DA, 0xF364, 0x93DC, 0xC3ED, 0x93DD, 0xC3EE, 0x93DE, 0xF360, 0x93DF, 0xC3EA, 0x93E1, 0xC3E8, 0x93E2, 0xC3F0, + 0x93E3, 0xF36F, 0x93E4, 0xC3F3, 0x93E6, 0xF36B, 0x93E7, 0xF375, 0x93E8, 0xC3F5, 0x93EC, 0xF367, 0x93EE, 0xF36E, 0x93F5, 0xF4F3, + 0x93F6, 0xF542, 0x93F7, 0xF4F5, 0x93F8, 0xF4FC, 0x93F9, 0xF366, 0x93FA, 0xF4FA, 0x93FB, 0xF4E9, 0x93FC, 0xF540, 0x93FD, 0xC4C3, + 0x93FE, 0xF4ED, 0x93FF, 0xF4FE, 0x9400, 0xF4F4, 0x9403, 0xC4C2, 0x9406, 0xF544, 0x9407, 0xF4F6, 0x9409, 0xF4FB, 0x940A, 0xF4FD, + 0x940B, 0xF4E7, 0x940C, 0xF541, 0x940D, 0xF4F2, 0x940E, 0xF4F7, 0x940F, 0xF4EB, 0x9410, 0xF4EF, 0x9411, 0xF543, 0x9412, 0xF4F9, + 0x9413, 0xF4E8, 0x9414, 0xF4EC, 0x9415, 0xF4EE, 0x9416, 0xF4F8, 0x9418, 0xC4C1, 0x9419, 0xF4F1, 0x9420, 0xF4EA, 0x9428, 0xF4F0, + 0x9429, 0xF661, 0x942A, 0xF666, 0x942B, 0xC54F, 0x942C, 0xF668, 0x942E, 0xC549, 0x9430, 0xF664, 0x9431, 0xF66A, 0x9432, 0xC54E, + 0x9433, 0xC54A, 0x9435, 0xC54B, 0x9436, 0xF660, 0x9437, 0xF667, 0x9438, 0xC54D, 0x9439, 0xF665, 0x943A, 0xC54C, 0x943B, 0xF65F, + 0x943C, 0xF663, 0x943D, 0xF662, 0x943F, 0xF65E, 0x9440, 0xF669, 0x9444, 0xC5B1, 0x9445, 0xF76D, 0x9446, 0xF770, 0x9447, 0xF76C, + 0x9448, 0xF76E, 0x9449, 0xF76F, 0x944A, 0xF769, 0x944B, 0xF76A, 0x944C, 0xF767, 0x944F, 0xF76B, 0x9450, 0xF768, 0x9451, 0xC5B2, + 0x9452, 0xC5B3, 0x9455, 0xF84B, 0x9457, 0xF84D, 0x945D, 0xF84C, 0x945E, 0xF84E, 0x9460, 0xC5E0, 0x9462, 0xF84A, 0x9463, 0xC5DF, + 0x9464, 0xC5E1, 0x9468, 0xF8CB, 0x9469, 0xF8CC, 0x946A, 0xC644, 0x946B, 0xF8CA, 0x946D, 0xF953, 0x946E, 0xF952, 0x946F, 0xF954, + 0x9470, 0xC65F, 0x9471, 0xF955, 0x9472, 0xC65E, 0x9473, 0xF956, 0x9474, 0xF972, 0x9475, 0xF975, 0x9476, 0xF974, 0x9477, 0xC668, + 0x9478, 0xF973, 0x947C, 0xC672, 0x947D, 0xC670, 0x947E, 0xC671, 0x947F, 0xC677, 0x9480, 0xF9C0, 0x9481, 0xF9C1, 0x9482, 0xF9BF, + 0x9483, 0xF9C9, 0x9577, 0xAAF8, 0x957A, 0xD844, 0x957B, 0xDC78, 0x957C, 0xE8A5, 0x957D, 0xF376, 0x9580, 0xAAF9, 0x9582, 0xADAC, + 0x9583, 0xB07B, 0x9586, 0xD845, 0x9588, 0xD846, 0x9589, 0xB3AC, 0x958B, 0xB67D, 0x958C, 0xDC7A, 0x958D, 0xDC79, 0x958E, 0xB6A3, + 0x958F, 0xB67C, 0x9590, 0xDC7B, 0x9591, 0xB67E, 0x9592, 0xB6A2, 0x9593, 0xB6A1, 0x9594, 0xB67B, 0x9598, 0xB968, 0x959B, 0xE0D0, + 0x959C, 0xE0CE, 0x959E, 0xE0CF, 0x959F, 0xE0CD, 0x95A1, 0xBBD2, 0x95A3, 0xBBD5, 0x95A4, 0xBBD7, 0x95A5, 0xBBD6, 0x95A8, 0xBBD3, + 0x95A9, 0xBBD4, 0x95AB, 0xE8A7, 0x95AC, 0xE8A6, 0x95AD, 0xBE5B, 0x95AE, 0xE8A8, 0x95B0, 0xE8A9, 0x95B1, 0xBE5C, 0x95B5, 0xEC4D, + 0x95B6, 0xEC4B, 0x95B7, 0xEEF3, 0x95B9, 0xEC49, 0x95BA, 0xEC4A, 0x95BB, 0xC046, 0x95BC, 0xEC46, 0x95BD, 0xEC4E, 0x95BE, 0xEC48, + 0x95BF, 0xEC4C, 0x95C0, 0xEEEF, 0x95C3, 0xEEF1, 0x95C5, 0xEEF2, 0x95C6, 0xC1F3, 0x95C7, 0xEEEE, 0x95C8, 0xC1F2, 0x95C9, 0xEEF0, + 0x95CA, 0xC1EF, 0x95CB, 0xC1F0, 0x95CC, 0xC1F1, 0x95CD, 0xEC47, 0x95D0, 0xC2F5, 0x95D1, 0xF16E, 0x95D2, 0xF16C, 0x95D3, 0xF16D, + 0x95D4, 0xC2F3, 0x95D5, 0xC2F6, 0x95D6, 0xC2F4, 0x95DA, 0xF377, 0x95DB, 0xF378, 0x95DC, 0xC3F6, 0x95DE, 0xF545, 0x95DF, 0xF547, + 0x95E0, 0xF546, 0x95E1, 0xC4C4, 0x95E2, 0xC550, 0x95E3, 0xF66D, 0x95E4, 0xF66C, 0x95E5, 0xF66B, 0x961C, 0xAAFA, 0x961E, 0xC9AA, + 0x9620, 0xCA58, 0x9621, 0xA6E9, 0x9622, 0xCA56, 0x9623, 0xCA59, 0x9624, 0xCA57, 0x9628, 0xCBAE, 0x962A, 0xA8C1, 0x962C, 0xA8C2, + 0x962D, 0xCBB0, 0x962E, 0xA8BF, 0x962F, 0xCBAF, 0x9630, 0xCBAD, 0x9631, 0xA8C0, 0x9632, 0xA8BE, 0x9639, 0xCDD8, 0x963A, 0xCDDB, + 0x963B, 0xAAFD, 0x963C, 0xCDDA, 0x963D, 0xCDD9, 0x963F, 0xAAFC, 0x9640, 0xAAFB, 0x9642, 0xAB40, 0x9643, 0xCDDC, 0x9644, 0xAAFE, + 0x964A, 0xD0C6, 0x964B, 0xADAE, 0x964C, 0xADAF, 0x964D, 0xADB0, 0x964E, 0xD0C7, 0x964F, 0xD0C3, 0x9650, 0xADAD, 0x9651, 0xD0C4, + 0x9653, 0xD0C5, 0x9654, 0xD0C2, 0x9658, 0xB0A4, 0x965B, 0xB0A1, 0x965C, 0xD445, 0x965D, 0xB0A2, 0x965E, 0xB0A5, 0x965F, 0xD446, + 0x9661, 0xB07E, 0x9662, 0xB07C, 0x9663, 0xB07D, 0x9664, 0xB0A3, 0x966A, 0xB3AD, 0x966B, 0xD849, 0x966C, 0xB3B5, 0x966D, 0xD848, + 0x966F, 0xD84B, 0x9670, 0xB3B1, 0x9671, 0xD84A, 0x9672, 0xB6AB, 0x9673, 0xB3AF, 0x9674, 0xB3B2, 0x9675, 0xB3AE, 0x9676, 0xB3B3, + 0x9677, 0xB3B4, 0x9678, 0xB3B0, 0x967C, 0xD847, 0x967D, 0xB6A7, 0x967E, 0xDC7D, 0x9680, 0xDCA3, 0x9683, 0xDCA2, 0x9684, 0xB6AC, + 0x9685, 0xB6A8, 0x9686, 0xB6A9, 0x9687, 0xDC7C, 0x9688, 0xDC7E, 0x9689, 0xDCA1, 0x968A, 0xB6A4, 0x968B, 0xB6A6, 0x968D, 0xB6AA, + 0x968E, 0xB6A5, 0x9691, 0xE0D3, 0x9692, 0xE0D1, 0x9693, 0xE0D2, 0x9694, 0xB96A, 0x9695, 0xB96B, 0x9697, 0xE0D4, 0x9698, 0xB969, + 0x9699, 0xBBD8, 0x969B, 0xBBDA, 0x969C, 0xBBD9, 0x969E, 0xE4BB, 0x96A1, 0xE4BC, 0x96A2, 0xE8AB, 0x96A4, 0xE8AA, 0x96A7, 0xC047, + 0x96A8, 0xC048, 0x96A9, 0xEC4F, 0x96AA, 0xC049, 0x96AC, 0xEEF6, 0x96AE, 0xEEF4, 0x96B0, 0xEEF5, 0x96B1, 0xC1F4, 0x96B3, 0xF16F, + 0x96B4, 0xC3F7, 0x96B8, 0xC1F5, 0x96B9, 0xAB41, 0x96BB, 0xB0A6, 0x96BC, 0xD447, 0x96BF, 0xD84C, 0x96C0, 0xB3B6, 0x96C1, 0xB6AD, + 0x96C2, 0xDCA4, 0x96C3, 0xDCA6, 0x96C4, 0xB6AF, 0x96C5, 0xB6AE, 0x96C6, 0xB6B0, 0x96C7, 0xB6B1, 0x96C8, 0xDCA5, 0x96C9, 0xB96E, + 0x96CA, 0xB96F, 0x96CB, 0xB96D, 0x96CC, 0xBBDB, 0x96CD, 0xB96C, 0x96CE, 0xE0D5, 0x96D2, 0xBBDC, 0x96D3, 0xE8AC, 0x96D4, 0xEC50, + 0x96D5, 0xC04A, 0x96D6, 0xC1F6, 0x96D7, 0xF170, 0x96D8, 0xF174, 0x96D9, 0xC2F9, 0x96DA, 0xF171, 0x96DB, 0xC2FA, 0x96DC, 0xC2F8, + 0x96DD, 0xF175, 0x96DE, 0xC2FB, 0x96DF, 0xF173, 0x96E1, 0xF379, 0x96E2, 0xC2F7, 0x96E3, 0xC3F8, 0x96E5, 0xF8CD, 0x96E8, 0xAB42, + 0x96E9, 0xB3B8, 0x96EA, 0xB3B7, 0x96EF, 0xB6B2, 0x96F0, 0xDCA8, 0x96F1, 0xDCA7, 0x96F2, 0xB6B3, 0x96F5, 0xE0D9, 0x96F6, 0xB973, + 0x96F7, 0xB970, 0x96F8, 0xE0D8, 0x96F9, 0xB972, 0x96FA, 0xE0D6, 0x96FB, 0xB971, 0x96FD, 0xE0D7, 0x96FF, 0xE4BD, 0x9700, 0xBBDD, + 0x9702, 0xE8AF, 0x9704, 0xBE5D, 0x9705, 0xE8AD, 0x9706, 0xBE5E, 0x9707, 0xBE5F, 0x9708, 0xE8AE, 0x9709, 0xBE60, 0x970B, 0xEC51, + 0x970D, 0xC04E, 0x970E, 0xC04B, 0x970F, 0xC050, 0x9710, 0xEC53, 0x9711, 0xC04C, 0x9712, 0xEC52, 0x9713, 0xC04F, 0x9716, 0xC04D, + 0x9718, 0xEEF9, 0x9719, 0xEEFB, 0x971C, 0xC1F7, 0x971D, 0xEEFA, 0x971E, 0xC1F8, 0x971F, 0xEEF8, 0x9720, 0xEEF7, 0x9722, 0xF177, + 0x9723, 0xF176, 0x9724, 0xC2FC, 0x9725, 0xF178, 0x9726, 0xF37E, 0x9727, 0xC3FA, 0x9728, 0xF37D, 0x9729, 0xF37A, 0x972A, 0xC3F9, + 0x972B, 0xF37B, 0x972C, 0xF37C, 0x972E, 0xF548, 0x972F, 0xF549, 0x9730, 0xC4C5, 0x9732, 0xC553, 0x9735, 0xF66E, 0x9738, 0xC551, + 0x9739, 0xC552, 0x973A, 0xF66F, 0x973D, 0xC5B4, 0x973E, 0xC5B5, 0x973F, 0xF771, 0x9742, 0xC645, 0x9743, 0xF8CF, 0x9744, 0xC647, + 0x9746, 0xF8CE, 0x9747, 0xF8D0, 0x9748, 0xC646, 0x9749, 0xF957, 0x974B, 0xF9AD, 0x9752, 0xAB43, 0x9756, 0xB974, 0x9758, 0xE4BE, + 0x975A, 0xE8B0, 0x975B, 0xC051, 0x975C, 0xC052, 0x975E, 0xAB44, 0x9760, 0xBE61, 0x9761, 0xC3FB, 0x9762, 0xADB1, 0x9766, 0xC053, + 0x9768, 0xC5E2, 0x9769, 0xADB2, 0x976A, 0xD84D, 0x976C, 0xDCA9, 0x976E, 0xDCAB, 0x9770, 0xDCAA, 0x9772, 0xE0DD, 0x9773, 0xE0DA, + 0x9774, 0xB975, 0x9776, 0xB976, 0x9777, 0xE0DB, 0x9778, 0xE0DC, 0x977A, 0xE4C0, 0x977B, 0xE4C5, 0x977C, 0xBBDE, 0x977D, 0xE4BF, + 0x977E, 0xE4C1, 0x977F, 0xE4C8, 0x9780, 0xE4C3, 0x9781, 0xE4C7, 0x9782, 0xE4C4, 0x9783, 0xE4C2, 0x9784, 0xE4C6, 0x9785, 0xBBDF, + 0x9788, 0xE8B3, 0x978A, 0xE8B1, 0x978B, 0xBE63, 0x978D, 0xBE62, 0x978E, 0xE8B2, 0x978F, 0xBE64, 0x9794, 0xEC56, 0x9797, 0xEC55, + 0x9798, 0xC054, 0x9799, 0xEC54, 0x979A, 0xEEFC, 0x979C, 0xEEFE, 0x979D, 0xEF41, 0x979E, 0xEF40, 0x97A0, 0xC1F9, 0x97A1, 0xEEFD, + 0x97A2, 0xF1A1, 0x97A3, 0xC2FD, 0x97A4, 0xF17D, 0x97A5, 0xF1A2, 0x97A6, 0xC2FE, 0x97A8, 0xF17B, 0x97AA, 0xF17E, 0x97AB, 0xF17C, + 0x97AC, 0xF179, 0x97AD, 0xC340, 0x97AE, 0xF17A, 0x97B3, 0xF3A1, 0x97B6, 0xF3A3, 0x97B7, 0xF3A2, 0x97B9, 0xF54A, 0x97BB, 0xF54B, + 0x97BF, 0xF670, 0x97C1, 0xC5B7, 0x97C3, 0xC5B6, 0x97C4, 0xF84F, 0x97C5, 0xF850, 0x97C6, 0xC648, 0x97C7, 0xF8D1, 0x97C9, 0xC669, + 0x97CB, 0xADB3, 0x97CC, 0xB6B4, 0x97CD, 0xE4CA, 0x97CE, 0xE4C9, 0x97CF, 0xE8B5, 0x97D0, 0xE8B4, 0x97D3, 0xC1FA, 0x97D4, 0xEF43, + 0x97D5, 0xEF42, 0x97D6, 0xF1A5, 0x97D7, 0xF1A3, 0x97D8, 0xF1A6, 0x97D9, 0xF1A4, 0x97DC, 0xC3FC, 0x97DD, 0xF3A4, 0x97DE, 0xF3A5, + 0x97DF, 0xF3A6, 0x97E1, 0xF671, 0x97E3, 0xF772, 0x97E5, 0xF8D2, 0x97ED, 0xADB4, 0x97F0, 0xEC57, 0x97F1, 0xEF44, 0x97F3, 0xADB5, + 0x97F6, 0xBBE0, 0x97F8, 0xEC58, 0x97F9, 0xC341, 0x97FA, 0xF1A7, 0x97FB, 0xC3FD, 0x97FD, 0xF54C, 0x97FE, 0xF54D, 0x97FF, 0xC554, + 0x9800, 0xF851, 0x9801, 0xADB6, 0x9802, 0xB3BB, 0x9803, 0xB3BC, 0x9804, 0xD84E, 0x9805, 0xB6B5, 0x9806, 0xB6B6, 0x9807, 0xDCAC, + 0x9808, 0xB6B7, 0x980A, 0xB97A, 0x980C, 0xB97C, 0x980D, 0xE0DF, 0x980E, 0xE0E0, 0x980F, 0xE0DE, 0x9810, 0xB977, 0x9811, 0xB978, + 0x9812, 0xB97B, 0x9813, 0xB979, 0x9816, 0xE4CB, 0x9817, 0xBBE1, 0x9818, 0xBBE2, 0x981B, 0xE8BC, 0x981C, 0xBE67, 0x981D, 0xE8B7, + 0x981E, 0xE8B6, 0x9820, 0xE8BB, 0x9821, 0xBE65, 0x9824, 0xC05B, 0x9826, 0xE8B8, 0x9827, 0xE8BD, 0x9828, 0xE8BA, 0x9829, 0xE8B9, + 0x982B, 0xBE66, 0x982D, 0xC059, 0x982F, 0xEC5A, 0x9830, 0xC055, 0x9832, 0xEC5B, 0x9835, 0xEC59, 0x9837, 0xC058, 0x9838, 0xC056, + 0x9839, 0xC05A, 0x983B, 0xC057, 0x9841, 0xEF45, 0x9843, 0xEF4A, 0x9844, 0xEF46, 0x9845, 0xEF49, 0x9846, 0xC1FB, 0x9848, 0xEDD4, + 0x9849, 0xEF48, 0x984A, 0xEF47, 0x984C, 0xC344, 0x984D, 0xC342, 0x984E, 0xC345, 0x984F, 0xC343, 0x9850, 0xF1A8, 0x9851, 0xF1A9, + 0x9852, 0xF1AA, 0x9853, 0xC346, 0x9857, 0xF3AA, 0x9858, 0xC440, 0x9859, 0xF3A8, 0x985B, 0xC441, 0x985C, 0xF3A7, 0x985D, 0xF3A9, + 0x985E, 0xC3FE, 0x985F, 0xF551, 0x9860, 0xF54E, 0x9862, 0xF54F, 0x9863, 0xF550, 0x9864, 0xF672, 0x9865, 0xC556, 0x9867, 0xC555, + 0x9869, 0xF774, 0x986A, 0xF773, 0x986B, 0xC5B8, 0x986F, 0xC5E3, 0x9870, 0xC649, 0x9871, 0xC660, 0x9872, 0xF958, 0x9873, 0xF9AE, + 0x9874, 0xF9AF, 0x98A8, 0xADB7, 0x98A9, 0xDCAD, 0x98AC, 0xE0E1, 0x98AD, 0xE4CC, 0x98AE, 0xE4CD, 0x98AF, 0xBBE3, 0x98B1, 0xBBE4, + 0x98B2, 0xE8BE, 0x98B3, 0xBE68, 0x98B6, 0xC1FC, 0x98B8, 0xF1AB, 0x98BA, 0xC347, 0x98BB, 0xF3AD, 0x98BC, 0xC442, 0x98BD, 0xF3AC, + 0x98BE, 0xF3AE, 0x98BF, 0xF3AB, 0x98C0, 0xF675, 0x98C1, 0xF552, 0x98C2, 0xF553, 0x98C4, 0xC4C6, 0x98C6, 0xF674, 0x98C9, 0xF673, + 0x98CB, 0xF775, 0x98CC, 0xF9B0, 0x98DB, 0xADB8, 0x98DF, 0xADB9, 0x98E2, 0xB0A7, 0x98E3, 0xD448, 0x98E5, 0xD84F, 0x98E7, 0xB6B8, + 0x98E9, 0xB6BB, 0x98EA, 0xB6B9, 0x98EB, 0xDCAE, 0x98ED, 0xB6BD, 0x98EF, 0xB6BA, 0x98F2, 0xB6BC, 0x98F4, 0xB97E, 0x98F6, 0xE0E2, + 0x98F9, 0xE0E3, 0x98FA, 0xE8C0, 0x98FC, 0xB97D, 0x98FD, 0xB9A1, 0x98FE, 0xB9A2, 0x9900, 0xE4CF, 0x9902, 0xE4CE, 0x9903, 0xBBE5, + 0x9905, 0xBBE6, 0x9907, 0xE4D0, 0x9908, 0xE8BF, 0x9909, 0xBBE8, 0x990A, 0xBE69, 0x990C, 0xBBE7, 0x9910, 0xC05C, 0x9911, 0xE8C1, + 0x9912, 0xBE6B, 0x9913, 0xBE6A, 0x9914, 0xE8C2, 0x9915, 0xE8C5, 0x9916, 0xE8C3, 0x9917, 0xE8C4, 0x9918, 0xBE6C, 0x991A, 0xC061, + 0x991B, 0xC05F, 0x991E, 0xC05E, 0x991F, 0xEC5D, 0x9921, 0xC060, 0x9924, 0xEC5C, 0x9925, 0xEF4B, 0x9927, 0xEC5E, 0x9928, 0xC05D, + 0x9929, 0xEC5F, 0x992A, 0xEF4E, 0x992B, 0xEF4C, 0x992C, 0xEF4D, 0x992D, 0xEF52, 0x992E, 0xC34B, 0x992F, 0xEF51, 0x9930, 0xEF54, + 0x9931, 0xEF53, 0x9932, 0xEF50, 0x9933, 0xEF4F, 0x9935, 0xC1FD, 0x993A, 0xF1AE, 0x993C, 0xF1AD, 0x993D, 0xC34A, 0x993E, 0xC348, + 0x993F, 0xC349, 0x9941, 0xF1AC, 0x9943, 0xF3B1, 0x9945, 0xC443, 0x9947, 0xF3B0, 0x9948, 0xF3AF, 0x9949, 0xC444, 0x994B, 0xF558, + 0x994C, 0xF557, 0x994E, 0xF555, 0x9950, 0xF554, 0x9951, 0xC4C8, 0x9952, 0xC4C7, 0x9953, 0xF559, 0x9954, 0xF776, 0x9955, 0xC5B9, + 0x9956, 0xF677, 0x9957, 0xC557, 0x9958, 0xF676, 0x9959, 0xF556, 0x995B, 0xF777, 0x995C, 0xC5E4, 0x995E, 0xC661, 0x995F, 0xF959, + 0x9961, 0xF9B1, 0x9996, 0xADBA, 0x9997, 0xD850, 0x9998, 0xEF55, 0x9999, 0xADBB, 0x999C, 0xE4D2, 0x999D, 0xE4D1, 0x999E, 0xEC60, + 0x99A1, 0xEF57, 0x99A3, 0xEF56, 0x99A5, 0xC34C, 0x99A6, 0xF3B2, 0x99A7, 0xF3B3, 0x99A8, 0xC4C9, 0x99AB, 0xF9B2, 0x99AC, 0xB0A8, + 0x99AD, 0xB6BF, 0x99AE, 0xB6BE, 0x99AF, 0xE0E4, 0x99B0, 0xE0E6, 0x99B1, 0xB9A4, 0x99B2, 0xE0E5, 0x99B3, 0xB9A3, 0x99B4, 0xB9A5, + 0x99B5, 0xE0E7, 0x99B9, 0xE4D4, 0x99BA, 0xE4D6, 0x99BB, 0xE4D5, 0x99BD, 0xE4D8, 0x99C1, 0xBBE9, 0x99C2, 0xE4D7, 0x99C3, 0xE4D3, + 0x99C7, 0xE4D9, 0x99C9, 0xE8CC, 0x99CB, 0xE8CF, 0x99CC, 0xE8D1, 0x99CD, 0xE8C7, 0x99CE, 0xE8CB, 0x99CF, 0xE8C8, 0x99D0, 0xBE6E, + 0x99D1, 0xBE71, 0x99D2, 0xBE73, 0x99D3, 0xE8C9, 0x99D4, 0xE8CA, 0x99D5, 0xBE72, 0x99D6, 0xE8CD, 0x99D7, 0xE8D0, 0x99D8, 0xE8CE, + 0x99D9, 0xBE74, 0x99DB, 0xBE70, 0x99DC, 0xE8C6, 0x99DD, 0xBE6D, 0x99DF, 0xBE6F, 0x99E2, 0xC063, 0x99E3, 0xEC66, 0x99E4, 0xEC64, + 0x99E5, 0xEC63, 0x99E7, 0xEC69, 0x99E9, 0xEC68, 0x99EA, 0xEC67, 0x99EC, 0xEC62, 0x99ED, 0xC062, 0x99EE, 0xEC61, 0x99F0, 0xEC65, + 0x99F1, 0xC064, 0x99F4, 0xEF5A, 0x99F6, 0xEF5E, 0x99F7, 0xEF5B, 0x99F8, 0xEF5D, 0x99F9, 0xEF5C, 0x99FA, 0xEF59, 0x99FB, 0xEF5F, + 0x99FC, 0xEF62, 0x99FD, 0xEF60, 0x99FE, 0xEF61, 0x99FF, 0xC240, 0x9A01, 0xC1FE, 0x9A02, 0xEF58, 0x9A03, 0xEF63, 0x9A04, 0xF1B3, + 0x9A05, 0xF1B6, 0x9A06, 0xF1B8, 0x9A07, 0xF1B7, 0x9A09, 0xF1B1, 0x9A0A, 0xF1B5, 0x9A0B, 0xF1B0, 0x9A0D, 0xF1B2, 0x9A0E, 0xC34D, + 0x9A0F, 0xF1AF, 0x9A11, 0xF1B4, 0x9A14, 0xF3C0, 0x9A15, 0xF3B5, 0x9A16, 0xC445, 0x9A19, 0xC446, 0x9A1A, 0xF3B4, 0x9A1B, 0xF3B9, + 0x9A1C, 0xF3BF, 0x9A1D, 0xF3B7, 0x9A1E, 0xF3BE, 0x9A20, 0xF3BB, 0x9A22, 0xF3BA, 0x9A23, 0xF3BD, 0x9A24, 0xF3B8, 0x9A25, 0xF3B6, + 0x9A27, 0xF3BC, 0x9A29, 0xF560, 0x9A2A, 0xF55E, 0x9A2B, 0xC4CA, 0x9A2C, 0xF55D, 0x9A2D, 0xF563, 0x9A2E, 0xF561, 0x9A30, 0xC4CB, + 0x9A31, 0xF55C, 0x9A32, 0xF55A, 0x9A34, 0xF55B, 0x9A35, 0xC4CD, 0x9A36, 0xF55F, 0x9A37, 0xC4CC, 0x9A38, 0xF562, 0x9A39, 0xF678, + 0x9A3A, 0xF67E, 0x9A3D, 0xF679, 0x9A3E, 0xC55B, 0x9A3F, 0xF6A1, 0x9A40, 0xC55A, 0x9A41, 0xF67D, 0x9A42, 0xF67C, 0x9A43, 0xC559, + 0x9A44, 0xF67B, 0x9A45, 0xC558, 0x9A46, 0xF67A, 0x9A48, 0xF77D, 0x9A49, 0xF7A1, 0x9A4A, 0xF77E, 0x9A4C, 0xF77B, 0x9A4D, 0xC5BB, + 0x9A4E, 0xF778, 0x9A4F, 0xF77C, 0x9A50, 0xF7A3, 0x9A52, 0xF7A2, 0x9A53, 0xF779, 0x9A54, 0xF77A, 0x9A55, 0xC5BA, 0x9A56, 0xF852, + 0x9A57, 0xC5E7, 0x9A59, 0xF853, 0x9A5A, 0xC5E5, 0x9A5B, 0xC5E6, 0x9A5E, 0xF8D3, 0x9A5F, 0xC64A, 0x9A60, 0xF976, 0x9A62, 0xC66A, + 0x9A64, 0xF9B3, 0x9A65, 0xC66B, 0x9A66, 0xF9B4, 0x9A67, 0xF9B5, 0x9A68, 0xF9C3, 0x9A69, 0xF9C2, 0x9A6A, 0xC67A, 0x9A6B, 0xF9CD, + 0x9AA8, 0xB0A9, 0x9AAB, 0xE0E9, 0x9AAD, 0xE0E8, 0x9AAF, 0xBBEA, 0x9AB0, 0xBBEB, 0x9AB1, 0xE4DA, 0x9AB3, 0xE8D2, 0x9AB4, 0xEC6C, + 0x9AB7, 0xBE75, 0x9AB8, 0xC065, 0x9AB9, 0xEC6A, 0x9ABB, 0xEC6D, 0x9ABC, 0xC066, 0x9ABE, 0xEF64, 0x9ABF, 0xEC6B, 0x9AC0, 0xF1B9, + 0x9AC1, 0xC34E, 0x9AC2, 0xF3C1, 0x9AC6, 0xF566, 0x9AC7, 0xF564, 0x9ACA, 0xF565, 0x9ACD, 0xF6A2, 0x9ACF, 0xC55C, 0x9AD0, 0xF7A4, + 0x9AD1, 0xC5EA, 0x9AD2, 0xC5BC, 0x9AD3, 0xC5E8, 0x9AD4, 0xC5E9, 0x9AD5, 0xF8D4, 0x9AD6, 0xC662, 0x9AD8, 0xB0AA, 0x9ADC, 0xF1BA, + 0x9ADF, 0xD449, 0x9AE1, 0xB9A6, 0x9AE3, 0xE4DB, 0x9AE6, 0xBBEC, 0x9AE7, 0xE4DC, 0x9AEB, 0xE8D4, 0x9AEC, 0xE8D3, 0x9AED, 0xC068, + 0x9AEE, 0xBE76, 0x9AEF, 0xBE77, 0x9AF1, 0xE8D7, 0x9AF2, 0xE8D6, 0x9AF3, 0xE8D5, 0x9AF6, 0xEC6E, 0x9AF7, 0xEC71, 0x9AF9, 0xEC70, + 0x9AFA, 0xEC6F, 0x9AFB, 0xC067, 0x9AFC, 0xEF68, 0x9AFD, 0xEF66, 0x9AFE, 0xEF65, 0x9B01, 0xEF67, 0x9B03, 0xC34F, 0x9B04, 0xF1BC, + 0x9B05, 0xF1BD, 0x9B06, 0xC350, 0x9B08, 0xF1BB, 0x9B0A, 0xF3C3, 0x9B0B, 0xF3C2, 0x9B0C, 0xF3C5, 0x9B0D, 0xC447, 0x9B0E, 0xF3C4, + 0x9B10, 0xF567, 0x9B11, 0xF569, 0x9B12, 0xF568, 0x9B15, 0xF6A3, 0x9B16, 0xF6A6, 0x9B17, 0xF6A4, 0x9B18, 0xF6A5, 0x9B19, 0xF7A5, + 0x9B1A, 0xC5BD, 0x9B1E, 0xF854, 0x9B1F, 0xF855, 0x9B20, 0xF856, 0x9B22, 0xC64B, 0x9B23, 0xC663, 0x9B24, 0xF9B6, 0x9B25, 0xB0AB, + 0x9B27, 0xBE78, 0x9B28, 0xC069, 0x9B29, 0xF1BE, 0x9B2B, 0xF7A6, 0x9B2E, 0xF9C4, 0x9B2F, 0xD44A, 0x9B31, 0xC67B, 0x9B32, 0xB0AC, + 0x9B33, 0xEC72, 0x9B35, 0xF1BF, 0x9B37, 0xF3C6, 0x9B3A, 0xF6A7, 0x9B3B, 0xF7A7, 0x9B3C, 0xB0AD, 0x9B3E, 0xE4DD, 0x9B3F, 0xE4DE, + 0x9B41, 0xBBED, 0x9B42, 0xBBEE, 0x9B43, 0xE8D9, 0x9B44, 0xBE7A, 0x9B45, 0xBE79, 0x9B46, 0xE8D8, 0x9B48, 0xEF69, 0x9B4A, 0xF1C0, + 0x9B4B, 0xF1C2, 0x9B4C, 0xF1C1, 0x9B4D, 0xC353, 0x9B4E, 0xC352, 0x9B4F, 0xC351, 0x9B51, 0xC55E, 0x9B52, 0xF6A8, 0x9B54, 0xC55D, + 0x9B55, 0xF7A9, 0x9B56, 0xF7A8, 0x9B58, 0xC64C, 0x9B59, 0xF8D5, 0x9B5A, 0xB3BD, 0x9B5B, 0xE0EA, 0x9B5F, 0xE4E1, 0x9B60, 0xE4DF, + 0x9B61, 0xE4E0, 0x9B64, 0xE8E2, 0x9B66, 0xE8DD, 0x9B67, 0xE8DA, 0x9B68, 0xE8E1, 0x9B6C, 0xE8E3, 0x9B6F, 0xBE7C, 0x9B70, 0xE8E0, + 0x9B71, 0xE8DC, 0x9B74, 0xE8DB, 0x9B75, 0xE8DF, 0x9B76, 0xE8DE, 0x9B77, 0xBE7B, 0x9B7A, 0xEC7D, 0x9B7B, 0xEC78, 0x9B7C, 0xEC76, + 0x9B7D, 0xECA1, 0x9B7E, 0xEC77, 0x9B80, 0xEC73, 0x9B82, 0xEC79, 0x9B85, 0xEC74, 0x9B86, 0xEF72, 0x9B87, 0xEC75, 0x9B88, 0xECA2, + 0x9B90, 0xEC7C, 0x9B91, 0xC06A, 0x9B92, 0xEC7B, 0x9B93, 0xEC7A, 0x9B95, 0xEC7E, 0x9B9A, 0xEF6A, 0x9B9B, 0xEF6D, 0x9B9E, 0xEF6C, + 0x9BA0, 0xEF74, 0x9BA1, 0xEF6F, 0x9BA2, 0xEF73, 0x9BA4, 0xEF71, 0x9BA5, 0xEF70, 0x9BA6, 0xEF6E, 0x9BA8, 0xEF6B, 0x9BAA, 0xC243, + 0x9BAB, 0xC242, 0x9BAD, 0xC244, 0x9BAE, 0xC241, 0x9BAF, 0xEF75, 0x9BB5, 0xF1C8, 0x9BB6, 0xF1CB, 0x9BB8, 0xF1C9, 0x9BB9, 0xF1CD, + 0x9BBD, 0xF1CE, 0x9BBF, 0xF1C6, 0x9BC0, 0xC358, 0x9BC1, 0xF1C7, 0x9BC3, 0xF1C5, 0x9BC4, 0xF1CC, 0x9BC6, 0xF1C4, 0x9BC7, 0xF1C3, + 0x9BC8, 0xC357, 0x9BC9, 0xC355, 0x9BCA, 0xC354, 0x9BD3, 0xF1CA, 0x9BD4, 0xF3CF, 0x9BD5, 0xF3D5, 0x9BD6, 0xC44A, 0x9BD7, 0xF3D0, + 0x9BD9, 0xF3D3, 0x9BDA, 0xF3D7, 0x9BDB, 0xC44B, 0x9BDC, 0xF3D2, 0x9BDE, 0xF3CA, 0x9BE0, 0xF3C9, 0x9BE1, 0xF3D6, 0x9BE2, 0xF3CD, + 0x9BE4, 0xF3CB, 0x9BE5, 0xF3D4, 0x9BE6, 0xF3CC, 0x9BE7, 0xC449, 0x9BE8, 0xC448, 0x9BEA, 0xF3C7, 0x9BEB, 0xF3C8, 0x9BEC, 0xF3D1, + 0x9BF0, 0xF3CE, 0x9BF7, 0xF56C, 0x9BF8, 0xF56F, 0x9BFD, 0xC356, 0x9C05, 0xF56D, 0x9C06, 0xF573, 0x9C07, 0xF571, 0x9C08, 0xF56B, + 0x9C09, 0xF576, 0x9C0B, 0xF56A, 0x9C0D, 0xC4CF, 0x9C0E, 0xF572, 0x9C12, 0xF56E, 0x9C13, 0xC4CE, 0x9C14, 0xF575, 0x9C17, 0xF574, + 0x9C1C, 0xF6AB, 0x9C1D, 0xF6AA, 0x9C21, 0xF6B1, 0x9C23, 0xF6AD, 0x9C24, 0xF6B0, 0x9C25, 0xC560, 0x9C28, 0xF6AE, 0x9C29, 0xF6AF, + 0x9C2B, 0xF6A9, 0x9C2C, 0xF6AC, 0x9C2D, 0xC55F, 0x9C31, 0xC5BF, 0x9C32, 0xF7B4, 0x9C33, 0xF7AF, 0x9C34, 0xF7B3, 0x9C36, 0xF7B6, + 0x9C37, 0xF7B2, 0x9C39, 0xF7AE, 0x9C3B, 0xC5C1, 0x9C3C, 0xF7B1, 0x9C3D, 0xF7B5, 0x9C3E, 0xC5C0, 0x9C3F, 0xF7AC, 0x9C40, 0xF570, + 0x9C41, 0xF7B0, 0x9C44, 0xF7AD, 0x9C46, 0xF7AA, 0x9C48, 0xF7AB, 0x9C49, 0xC5BE, 0x9C4A, 0xF85A, 0x9C4B, 0xF85C, 0x9C4C, 0xF85F, + 0x9C4D, 0xF85B, 0x9C4E, 0xF860, 0x9C50, 0xF859, 0x9C52, 0xF857, 0x9C54, 0xC5EB, 0x9C55, 0xF85D, 0x9C56, 0xC5ED, 0x9C57, 0xC5EC, + 0x9C58, 0xF858, 0x9C59, 0xF85E, 0x9C5E, 0xF8DA, 0x9C5F, 0xC64D, 0x9C60, 0xF8DB, 0x9C62, 0xF8D9, 0x9C63, 0xF8D6, 0x9C66, 0xF8D8, + 0x9C67, 0xF8D7, 0x9C68, 0xF95A, 0x9C6D, 0xF95C, 0x9C6E, 0xF95B, 0x9C71, 0xF979, 0x9C73, 0xF978, 0x9C74, 0xF977, 0x9C75, 0xF97A, + 0x9C77, 0xC673, 0x9C78, 0xC674, 0x9C79, 0xF9CA, 0x9C7A, 0xF9CE, 0x9CE5, 0xB3BE, 0x9CE6, 0xDCAF, 0x9CE7, 0xE0ED, 0x9CE9, 0xB9A7, + 0x9CEA, 0xE0EB, 0x9CED, 0xE0EC, 0x9CF1, 0xE4E2, 0x9CF2, 0xE4E3, 0x9CF3, 0xBBF1, 0x9CF4, 0xBBEF, 0x9CF5, 0xE4E4, 0x9CF6, 0xBBF0, + 0x9CF7, 0xE8E8, 0x9CF9, 0xE8EB, 0x9CFA, 0xE8E5, 0x9CFB, 0xE8EC, 0x9CFC, 0xE8E4, 0x9CFD, 0xE8E6, 0x9CFF, 0xE8E7, 0x9D00, 0xE8EA, + 0x9D03, 0xBEA1, 0x9D04, 0xE8EF, 0x9D05, 0xE8EE, 0x9D06, 0xBE7D, 0x9D07, 0xE8E9, 0x9D08, 0xE8ED, 0x9D09, 0xBE7E, 0x9D10, 0xECAC, + 0x9D12, 0xC06F, 0x9D14, 0xECA7, 0x9D15, 0xC06B, 0x9D17, 0xECA4, 0x9D18, 0xECAA, 0x9D19, 0xECAD, 0x9D1B, 0xC070, 0x9D1D, 0xECA9, + 0x9D1E, 0xECA6, 0x9D1F, 0xECAE, 0x9D20, 0xECA5, 0x9D22, 0xECAB, 0x9D23, 0xC06C, 0x9D25, 0xECA3, 0x9D26, 0xC06D, 0x9D28, 0xC06E, + 0x9D29, 0xECA8, 0x9D2D, 0xEFA9, 0x9D2E, 0xEF7A, 0x9D2F, 0xEF7B, 0x9D30, 0xEF7E, 0x9D31, 0xEF7C, 0x9D33, 0xEF76, 0x9D36, 0xEF79, + 0x9D37, 0xEFA5, 0x9D38, 0xEF7D, 0x9D3B, 0xC245, 0x9D3D, 0xEFA7, 0x9D3E, 0xEFA4, 0x9D3F, 0xC246, 0x9D40, 0xEFA6, 0x9D41, 0xEF77, + 0x9D42, 0xEFA2, 0x9D43, 0xEFA3, 0x9D45, 0xEFA1, 0x9D4A, 0xF1D2, 0x9D4B, 0xF1D4, 0x9D4C, 0xF1D7, 0x9D4F, 0xF1D1, 0x9D51, 0xC359, + 0x9D52, 0xF1D9, 0x9D53, 0xF1D0, 0x9D54, 0xF1DA, 0x9D56, 0xF1D6, 0x9D57, 0xF1D8, 0x9D58, 0xF1DC, 0x9D59, 0xF1D5, 0x9D5A, 0xF1DD, + 0x9D5B, 0xF1D3, 0x9D5C, 0xF1CF, 0x9D5D, 0xC35A, 0x9D5F, 0xF1DB, 0x9D60, 0xC35B, 0x9D61, 0xC44D, 0x9D67, 0xEF78, 0x9D68, 0xF3F1, + 0x9D69, 0xF3E8, 0x9D6A, 0xC44F, 0x9D6B, 0xF3E4, 0x9D6C, 0xC450, 0x9D6F, 0xF3ED, 0x9D70, 0xF3E7, 0x9D71, 0xF3DD, 0x9D72, 0xC44E, + 0x9D73, 0xF3EA, 0x9D74, 0xF3E5, 0x9D75, 0xF3E6, 0x9D77, 0xF3D8, 0x9D78, 0xF3DF, 0x9D79, 0xF3EE, 0x9D7B, 0xF3EB, 0x9D7D, 0xF3E3, + 0x9D7F, 0xF3EF, 0x9D80, 0xF3DE, 0x9D81, 0xF3D9, 0x9D82, 0xF3EC, 0x9D84, 0xF3DB, 0x9D85, 0xF3E9, 0x9D86, 0xF3E0, 0x9D87, 0xF3F0, + 0x9D88, 0xF3DC, 0x9D89, 0xC44C, 0x9D8A, 0xF3DA, 0x9D8B, 0xF3E1, 0x9D8C, 0xF3E2, 0x9D90, 0xF57D, 0x9D92, 0xF57B, 0x9D94, 0xF5A2, + 0x9D96, 0xF5AE, 0x9D97, 0xF5A5, 0x9D98, 0xF57C, 0x9D99, 0xF578, 0x9D9A, 0xF5A7, 0x9D9B, 0xF57E, 0x9D9C, 0xF5A3, 0x9D9D, 0xF57A, + 0x9D9E, 0xF5AA, 0x9D9F, 0xF577, 0x9DA0, 0xF5A1, 0x9DA1, 0xF5A6, 0x9DA2, 0xF5A8, 0x9DA3, 0xF5AB, 0x9DA4, 0xF579, 0x9DA6, 0xF5AF, + 0x9DA7, 0xF5B0, 0x9DA8, 0xF5A9, 0x9DA9, 0xF5AD, 0x9DAA, 0xF5A4, 0x9DAC, 0xF6C1, 0x9DAD, 0xF6C4, 0x9DAF, 0xC561, 0x9DB1, 0xF6C3, + 0x9DB2, 0xF6C8, 0x9DB3, 0xF6C6, 0x9DB4, 0xC562, 0x9DB5, 0xF6BD, 0x9DB6, 0xF6B3, 0x9DB7, 0xF6B2, 0x9DB8, 0xC564, 0x9DB9, 0xF6BF, + 0x9DBA, 0xF6C0, 0x9DBB, 0xF6BC, 0x9DBC, 0xF6B4, 0x9DBE, 0xF6B9, 0x9DBF, 0xF5AC, 0x9DC1, 0xF6B5, 0x9DC2, 0xC563, 0x9DC3, 0xF6BB, + 0x9DC5, 0xF6BA, 0x9DC7, 0xF6B6, 0x9DC8, 0xF6C2, 0x9DCA, 0xF6B7, 0x9DCB, 0xF7BB, 0x9DCC, 0xF6C5, 0x9DCD, 0xF6C7, 0x9DCE, 0xF6BE, + 0x9DCF, 0xF6B8, 0x9DD0, 0xF7BC, 0x9DD1, 0xF7BE, 0x9DD2, 0xF7B8, 0x9DD3, 0xC5C2, 0x9DD5, 0xF7C5, 0x9DD6, 0xF7C3, 0x9DD7, 0xC5C3, + 0x9DD8, 0xF7C2, 0x9DD9, 0xF7C1, 0x9DDA, 0xF7BA, 0x9DDB, 0xF7B7, 0x9DDC, 0xF7BD, 0x9DDD, 0xF7C6, 0x9DDE, 0xF7B9, 0x9DDF, 0xF7BF, + 0x9DE1, 0xF869, 0x9DE2, 0xF86E, 0x9DE3, 0xF864, 0x9DE4, 0xF867, 0x9DE5, 0xC5EE, 0x9DE6, 0xF86B, 0x9DE8, 0xF872, 0x9DE9, 0xF7C0, + 0x9DEB, 0xF865, 0x9DEC, 0xF86F, 0x9DED, 0xF873, 0x9DEE, 0xF86A, 0x9DEF, 0xF863, 0x9DF0, 0xF86D, 0x9DF2, 0xF86C, 0x9DF3, 0xF871, + 0x9DF4, 0xF870, 0x9DF5, 0xF7C4, 0x9DF6, 0xF868, 0x9DF7, 0xF862, 0x9DF8, 0xF866, 0x9DF9, 0xC64E, 0x9DFA, 0xC64F, 0x9DFB, 0xF861, + 0x9DFD, 0xF8E6, 0x9DFE, 0xF8DD, 0x9DFF, 0xF8E5, 0x9E00, 0xF8E2, 0x9E01, 0xF8E3, 0x9E02, 0xF8DC, 0x9E03, 0xF8DF, 0x9E04, 0xF8E7, + 0x9E05, 0xF8E1, 0x9E06, 0xF8E0, 0x9E07, 0xF8DE, 0x9E09, 0xF8E4, 0x9E0B, 0xF95D, 0x9E0D, 0xF95E, 0x9E0F, 0xF960, 0x9E10, 0xF95F, + 0x9E11, 0xF962, 0x9E12, 0xF961, 0x9E13, 0xF97C, 0x9E14, 0xF97B, 0x9E15, 0xF9B7, 0x9E17, 0xF9B8, 0x9E19, 0xF9C5, 0x9E1A, 0xC678, + 0x9E1B, 0xC67C, 0x9E1D, 0xF9CF, 0x9E1E, 0xC67D, 0x9E75, 0xB3BF, 0x9E79, 0xC4D0, 0x9E7A, 0xF6C9, 0x9E7C, 0xC650, 0x9E7D, 0xC651, + 0x9E7F, 0xB3C0, 0x9E80, 0xE0EE, 0x9E82, 0xB9A8, 0x9E83, 0xE8F0, 0x9E86, 0xECB0, 0x9E87, 0xECB1, 0x9E88, 0xECAF, 0x9E89, 0xEFAB, + 0x9E8A, 0xEFAA, 0x9E8B, 0xC247, 0x9E8C, 0xF1DF, 0x9E8D, 0xEFAC, 0x9E8E, 0xF1DE, 0x9E91, 0xF3F3, 0x9E92, 0xC451, 0x9E93, 0xC453, + 0x9E94, 0xF3F2, 0x9E97, 0xC452, 0x9E99, 0xF5B1, 0x9E9A, 0xF5B3, 0x9E9B, 0xF5B2, 0x9E9C, 0xF6CA, 0x9E9D, 0xC565, 0x9E9F, 0xC5EF, + 0x9EA0, 0xF8E8, 0x9EA1, 0xF963, 0x9EA4, 0xF9D2, 0x9EA5, 0xB3C1, 0x9EA7, 0xE4E5, 0x9EA9, 0xBEA2, 0x9EAD, 0xECB3, 0x9EAE, 0xECB2, + 0x9EB0, 0xEFAD, 0x9EB4, 0xC454, 0x9EB5, 0xC4D1, 0x9EB6, 0xF7C7, 0x9EB7, 0xF9CB, 0x9EBB, 0xB3C2, 0x9EBC, 0xBBF2, 0x9EBE, 0xBEA3, + 0x9EC0, 0xF3F4, 0x9EC2, 0xF874, 0x9EC3, 0xB6C0, 0x9EC8, 0xEFAE, 0x9ECC, 0xC664, 0x9ECD, 0xB6C1, 0x9ECE, 0xBEA4, 0x9ECF, 0xC248, + 0x9ED0, 0xF875, 0x9ED1, 0xB6C2, 0x9ED3, 0xE8F1, 0x9ED4, 0xC072, 0x9ED5, 0xECB4, 0x9ED6, 0xECB5, 0x9ED8, 0xC071, 0x9EDA, 0xEFAF, + 0x9EDB, 0xC24C, 0x9EDC, 0xC24A, 0x9EDD, 0xC24B, 0x9EDE, 0xC249, 0x9EDF, 0xF1E0, 0x9EE0, 0xC35C, 0x9EE4, 0xF5B5, 0x9EE5, 0xF5B4, + 0x9EE6, 0xF5B7, 0x9EE7, 0xF5B6, 0x9EE8, 0xC4D2, 0x9EEB, 0xF6CB, 0x9EED, 0xF6CD, 0x9EEE, 0xF6CC, 0x9EEF, 0xC566, 0x9EF0, 0xF7C8, + 0x9EF2, 0xF876, 0x9EF3, 0xF877, 0x9EF4, 0xC5F0, 0x9EF5, 0xF964, 0x9EF6, 0xF97D, 0x9EF7, 0xC675, 0x9EF9, 0xDCB0, 0x9EFA, 0xECB6, + 0x9EFB, 0xEFB0, 0x9EFC, 0xF3F5, 0x9EFD, 0xE0EF, 0x9EFF, 0xEFB1, 0x9F00, 0xF1E2, 0x9F01, 0xF1E1, 0x9F06, 0xF878, 0x9F07, 0xC652, + 0x9F09, 0xF965, 0x9F0A, 0xF97E, 0x9F0E, 0xB9A9, 0x9F0F, 0xE8F2, 0x9F10, 0xE8F3, 0x9F12, 0xECB7, 0x9F13, 0xB9AA, 0x9F15, 0xC35D, + 0x9F16, 0xF1E3, 0x9F18, 0xF6CF, 0x9F19, 0xC567, 0x9F1A, 0xF6D0, 0x9F1B, 0xF6CE, 0x9F1C, 0xF879, 0x9F1E, 0xF8E9, 0x9F20, 0xB9AB, + 0x9F22, 0xEFB4, 0x9F23, 0xEFB3, 0x9F24, 0xEFB2, 0x9F25, 0xF1E4, 0x9F28, 0xF1E8, 0x9F29, 0xF1E7, 0x9F2A, 0xF1E6, 0x9F2B, 0xF1E5, + 0x9F2C, 0xC35E, 0x9F2D, 0xF3F6, 0x9F2E, 0xF5B9, 0x9F2F, 0xC4D3, 0x9F30, 0xF5B8, 0x9F31, 0xF6D1, 0x9F32, 0xF7CB, 0x9F33, 0xF7CA, + 0x9F34, 0xC5C4, 0x9F35, 0xF7C9, 0x9F36, 0xF87C, 0x9F37, 0xF87B, 0x9F38, 0xF87A, 0x9F3B, 0xBBF3, 0x9F3D, 0xECB8, 0x9F3E, 0xC24D, + 0x9F40, 0xF3F7, 0x9F41, 0xF3F8, 0x9F42, 0xF7CC, 0x9F43, 0xF87D, 0x9F46, 0xF8EA, 0x9F47, 0xF966, 0x9F48, 0xF9B9, 0x9F49, 0xF9D4, + 0x9F4A, 0xBBF4, 0x9F4B, 0xC24E, 0x9F4C, 0xF1E9, 0x9F4D, 0xF3F9, 0x9F4E, 0xF6D2, 0x9F4F, 0xF87E, 0x9F52, 0xBEA6, 0x9F54, 0xEFB5, + 0x9F55, 0xF1EA, 0x9F56, 0xF3FA, 0x9F57, 0xF3FB, 0x9F58, 0xF3FC, 0x9F59, 0xF5BE, 0x9F5B, 0xF5BA, 0x9F5C, 0xC568, 0x9F5D, 0xF5BD, + 0x9F5E, 0xF5BC, 0x9F5F, 0xC4D4, 0x9F60, 0xF5BB, 0x9F61, 0xC4D6, 0x9F63, 0xC4D5, 0x9F64, 0xF6D4, 0x9F65, 0xF6D3, 0x9F66, 0xC569, + 0x9F67, 0xC56A, 0x9F6A, 0xC5C6, 0x9F6B, 0xF7CD, 0x9F6C, 0xC5C5, 0x9F6E, 0xF8A3, 0x9F6F, 0xF8A4, 0x9F70, 0xF8A2, 0x9F71, 0xF8A1, + 0x9F72, 0xC654, 0x9F74, 0xF8EB, 0x9F75, 0xF8EC, 0x9F76, 0xF8ED, 0x9F77, 0xC653, 0x9F78, 0xF967, 0x9F79, 0xF96A, 0x9F7A, 0xF969, + 0x9F7B, 0xF968, 0x9F7E, 0xF9D3, 0x9F8D, 0xC073, 0x9F90, 0xC365, 0x9F91, 0xF5BF, 0x9F92, 0xF6D5, 0x9F94, 0xC5C7, 0x9F95, 0xF7CE, + 0x9F98, 0xF9D5, 0x9F9C, 0xC074, 0x9FA0, 0xEFB6, 0x9FA2, 0xF7CF, 0x9FA4, 0xF9A1, 0xFA0C, 0xC94A, 0xFA0D, 0xDDFC, 0xFE30, 0xA14A, + 0xFE31, 0xA157, 0xFE33, 0xA159, 0xFE34, 0xA15B, 0xFE35, 0xA15F, 0xFE36, 0xA160, 0xFE37, 0xA163, 0xFE38, 0xA164, 0xFE39, 0xA167, + 0xFE3A, 0xA168, 0xFE3B, 0xA16B, 0xFE3C, 0xA16C, 0xFE3D, 0xA16F, 0xFE3E, 0xA170, 0xFE3F, 0xA173, 0xFE40, 0xA174, 0xFE41, 0xA177, + 0xFE42, 0xA178, 0xFE43, 0xA17B, 0xFE44, 0xA17C, 0xFE49, 0xA1C6, 0xFE4A, 0xA1C7, 0xFE4B, 0xA1CA, 0xFE4C, 0xA1CB, 0xFE4D, 0xA1C8, + 0xFE4E, 0xA1C9, 0xFE4F, 0xA15C, 0xFE50, 0xA14D, 0xFE51, 0xA14E, 0xFE52, 0xA14F, 0xFE54, 0xA151, 0xFE55, 0xA152, 0xFE56, 0xA153, + 0xFE57, 0xA154, 0xFE59, 0xA17D, 0xFE5A, 0xA17E, 0xFE5B, 0xA1A1, 0xFE5C, 0xA1A2, 0xFE5D, 0xA1A3, 0xFE5E, 0xA1A4, 0xFE5F, 0xA1CC, + 0xFE60, 0xA1CD, 0xFE61, 0xA1CE, 0xFE62, 0xA1DE, 0xFE63, 0xA1DF, 0xFE64, 0xA1E0, 0xFE65, 0xA1E1, 0xFE66, 0xA1E2, 0xFE68, 0xA242, + 0xFE69, 0xA24C, 0xFE6A, 0xA24D, 0xFE6B, 0xA24E, 0xFF01, 0xA149, 0xFF03, 0xA1AD, 0xFF04, 0xA243, 0xFF05, 0xA248, 0xFF06, 0xA1AE, + 0xFF08, 0xA15D, 0xFF09, 0xA15E, 0xFF0A, 0xA1AF, 0xFF0B, 0xA1CF, 0xFF0C, 0xA141, 0xFF0D, 0xA1D0, 0xFF0E, 0xA144, 0xFF0F, 0xA1FE, + 0xFF10, 0xA2AF, 0xFF11, 0xA2B0, 0xFF12, 0xA2B1, 0xFF13, 0xA2B2, 0xFF14, 0xA2B3, 0xFF15, 0xA2B4, 0xFF16, 0xA2B5, 0xFF17, 0xA2B6, + 0xFF18, 0xA2B7, 0xFF19, 0xA2B8, 0xFF1A, 0xA147, 0xFF1B, 0xA146, 0xFF1C, 0xA1D5, 0xFF1D, 0xA1D7, 0xFF1E, 0xA1D6, 0xFF1F, 0xA148, + 0xFF20, 0xA249, 0xFF21, 0xA2CF, 0xFF22, 0xA2D0, 0xFF23, 0xA2D1, 0xFF24, 0xA2D2, 0xFF25, 0xA2D3, 0xFF26, 0xA2D4, 0xFF27, 0xA2D5, + 0xFF28, 0xA2D6, 0xFF29, 0xA2D7, 0xFF2A, 0xA2D8, 0xFF2B, 0xA2D9, 0xFF2C, 0xA2DA, 0xFF2D, 0xA2DB, 0xFF2E, 0xA2DC, 0xFF2F, 0xA2DD, + 0xFF30, 0xA2DE, 0xFF31, 0xA2DF, 0xFF32, 0xA2E0, 0xFF33, 0xA2E1, 0xFF34, 0xA2E2, 0xFF35, 0xA2E3, 0xFF36, 0xA2E4, 0xFF37, 0xA2E5, + 0xFF38, 0xA2E6, 0xFF39, 0xA2E7, 0xFF3A, 0xA2E8, 0xFF3C, 0xA240, 0xFF3F, 0xA1C4, 0xFF41, 0xA2E9, 0xFF42, 0xA2EA, 0xFF43, 0xA2EB, + 0xFF44, 0xA2EC, 0xFF45, 0xA2ED, 0xFF46, 0xA2EE, 0xFF47, 0xA2EF, 0xFF48, 0xA2F0, 0xFF49, 0xA2F1, 0xFF4A, 0xA2F2, 0xFF4B, 0xA2F3, + 0xFF4C, 0xA2F4, 0xFF4D, 0xA2F5, 0xFF4E, 0xA2F6, 0xFF4F, 0xA2F7, 0xFF50, 0xA2F8, 0xFF51, 0xA2F9, 0xFF52, 0xA2FA, 0xFF53, 0xA2FB, + 0xFF54, 0xA2FC, 0xFF55, 0xA2FD, 0xFF56, 0xA2FE, 0xFF57, 0xA340, 0xFF58, 0xA341, 0xFF59, 0xA342, 0xFF5A, 0xA343, 0xFF5B, 0xA161, + 0xFF5C, 0xA155, 0xFF5D, 0xA162, 0xFF5E, 0xA1E3, 0xFFE0, 0xA246, 0xFFE1, 0xA247, 0xFFE3, 0xA1C3, 0xFFE5, 0xA244, 0, 0 +}; + +static const WCHAR oem2uni950[] = { /* Big5 --> Unicode pairs */ + 0xA140, 0x3000, 0xA141, 0xFF0C, 0xA142, 0x3001, 0xA143, 0x3002, 0xA144, 0xFF0E, 0xA145, 0x2027, 0xA146, 0xFF1B, 0xA147, 0xFF1A, + 0xA148, 0xFF1F, 0xA149, 0xFF01, 0xA14A, 0xFE30, 0xA14B, 0x2026, 0xA14C, 0x2025, 0xA14D, 0xFE50, 0xA14E, 0xFE51, 0xA14F, 0xFE52, + 0xA150, 0x00B7, 0xA151, 0xFE54, 0xA152, 0xFE55, 0xA153, 0xFE56, 0xA154, 0xFE57, 0xA155, 0xFF5C, 0xA156, 0x2013, 0xA157, 0xFE31, + 0xA158, 0x2014, 0xA159, 0xFE33, 0xA15A, 0x2574, 0xA15B, 0xFE34, 0xA15C, 0xFE4F, 0xA15D, 0xFF08, 0xA15E, 0xFF09, 0xA15F, 0xFE35, + 0xA160, 0xFE36, 0xA161, 0xFF5B, 0xA162, 0xFF5D, 0xA163, 0xFE37, 0xA164, 0xFE38, 0xA165, 0x3014, 0xA166, 0x3015, 0xA167, 0xFE39, + 0xA168, 0xFE3A, 0xA169, 0x3010, 0xA16A, 0x3011, 0xA16B, 0xFE3B, 0xA16C, 0xFE3C, 0xA16D, 0x300A, 0xA16E, 0x300B, 0xA16F, 0xFE3D, + 0xA170, 0xFE3E, 0xA171, 0x3008, 0xA172, 0x3009, 0xA173, 0xFE3F, 0xA174, 0xFE40, 0xA175, 0x300C, 0xA176, 0x300D, 0xA177, 0xFE41, + 0xA178, 0xFE42, 0xA179, 0x300E, 0xA17A, 0x300F, 0xA17B, 0xFE43, 0xA17C, 0xFE44, 0xA17D, 0xFE59, 0xA17E, 0xFE5A, 0xA1A1, 0xFE5B, + 0xA1A2, 0xFE5C, 0xA1A3, 0xFE5D, 0xA1A4, 0xFE5E, 0xA1A5, 0x2018, 0xA1A6, 0x2019, 0xA1A7, 0x201C, 0xA1A8, 0x201D, 0xA1A9, 0x301D, + 0xA1AA, 0x301E, 0xA1AB, 0x2035, 0xA1AC, 0x2032, 0xA1AD, 0xFF03, 0xA1AE, 0xFF06, 0xA1AF, 0xFF0A, 0xA1B0, 0x203B, 0xA1B1, 0x00A7, + 0xA1B2, 0x3003, 0xA1B3, 0x25CB, 0xA1B4, 0x25CF, 0xA1B5, 0x25B3, 0xA1B6, 0x25B2, 0xA1B7, 0x25CE, 0xA1B8, 0x2606, 0xA1B9, 0x2605, + 0xA1BA, 0x25C7, 0xA1BB, 0x25C6, 0xA1BC, 0x25A1, 0xA1BD, 0x25A0, 0xA1BE, 0x25BD, 0xA1BF, 0x25BC, 0xA1C0, 0x32A3, 0xA1C1, 0x2105, + 0xA1C2, 0x00AF, 0xA1C3, 0xFFE3, 0xA1C4, 0xFF3F, 0xA1C5, 0x02CD, 0xA1C6, 0xFE49, 0xA1C7, 0xFE4A, 0xA1C8, 0xFE4D, 0xA1C9, 0xFE4E, + 0xA1CA, 0xFE4B, 0xA1CB, 0xFE4C, 0xA1CC, 0xFE5F, 0xA1CD, 0xFE60, 0xA1CE, 0xFE61, 0xA1CF, 0xFF0B, 0xA1D0, 0xFF0D, 0xA1D1, 0x00D7, + 0xA1D2, 0x00F7, 0xA1D3, 0x00B1, 0xA1D4, 0x221A, 0xA1D5, 0xFF1C, 0xA1D6, 0xFF1E, 0xA1D7, 0xFF1D, 0xA1D8, 0x2266, 0xA1D9, 0x2267, + 0xA1DA, 0x2260, 0xA1DB, 0x221E, 0xA1DC, 0x2252, 0xA1DD, 0x2261, 0xA1DE, 0xFE62, 0xA1DF, 0xFE63, 0xA1E0, 0xFE64, 0xA1E1, 0xFE65, + 0xA1E2, 0xFE66, 0xA1E3, 0xFF5E, 0xA1E4, 0x2229, 0xA1E5, 0x222A, 0xA1E6, 0x22A5, 0xA1E7, 0x2220, 0xA1E8, 0x221F, 0xA1E9, 0x22BF, + 0xA1EA, 0x33D2, 0xA1EB, 0x33D1, 0xA1EC, 0x222B, 0xA1ED, 0x222E, 0xA1EE, 0x2235, 0xA1EF, 0x2234, 0xA1F0, 0x2640, 0xA1F1, 0x2642, + 0xA1F2, 0x2295, 0xA1F3, 0x2299, 0xA1F4, 0x2191, 0xA1F5, 0x2193, 0xA1F6, 0x2190, 0xA1F7, 0x2192, 0xA1F8, 0x2196, 0xA1F9, 0x2197, + 0xA1FA, 0x2199, 0xA1FB, 0x2198, 0xA1FC, 0x2225, 0xA1FD, 0x2223, 0xA1FE, 0xFF0F, 0xA240, 0xFF3C, 0xA241, 0x2215, 0xA242, 0xFE68, + 0xA243, 0xFF04, 0xA244, 0xFFE5, 0xA245, 0x3012, 0xA246, 0xFFE0, 0xA247, 0xFFE1, 0xA248, 0xFF05, 0xA249, 0xFF20, 0xA24A, 0x2103, + 0xA24B, 0x2109, 0xA24C, 0xFE69, 0xA24D, 0xFE6A, 0xA24E, 0xFE6B, 0xA24F, 0x33D5, 0xA250, 0x339C, 0xA251, 0x339D, 0xA252, 0x339E, + 0xA253, 0x33CE, 0xA254, 0x33A1, 0xA255, 0x338E, 0xA256, 0x338F, 0xA257, 0x33C4, 0xA258, 0x00B0, 0xA259, 0x5159, 0xA25A, 0x515B, + 0xA25B, 0x515E, 0xA25C, 0x515D, 0xA25D, 0x5161, 0xA25E, 0x5163, 0xA25F, 0x55E7, 0xA260, 0x74E9, 0xA261, 0x7CCE, 0xA262, 0x2581, + 0xA263, 0x2582, 0xA264, 0x2583, 0xA265, 0x2584, 0xA266, 0x2585, 0xA267, 0x2586, 0xA268, 0x2587, 0xA269, 0x2588, 0xA26A, 0x258F, + 0xA26B, 0x258E, 0xA26C, 0x258D, 0xA26D, 0x258C, 0xA26E, 0x258B, 0xA26F, 0x258A, 0xA270, 0x2589, 0xA271, 0x253C, 0xA272, 0x2534, + 0xA273, 0x252C, 0xA274, 0x2524, 0xA275, 0x251C, 0xA276, 0x2594, 0xA277, 0x2500, 0xA278, 0x2502, 0xA279, 0x2595, 0xA27A, 0x250C, + 0xA27B, 0x2510, 0xA27C, 0x2514, 0xA27D, 0x2518, 0xA27E, 0x256D, 0xA2A1, 0x256E, 0xA2A2, 0x2570, 0xA2A3, 0x256F, 0xA2A4, 0x2550, + 0xA2A5, 0x255E, 0xA2A6, 0x256A, 0xA2A7, 0x2561, 0xA2A8, 0x25E2, 0xA2A9, 0x25E3, 0xA2AA, 0x25E5, 0xA2AB, 0x25E4, 0xA2AC, 0x2571, + 0xA2AD, 0x2572, 0xA2AE, 0x2573, 0xA2AF, 0xFF10, 0xA2B0, 0xFF11, 0xA2B1, 0xFF12, 0xA2B2, 0xFF13, 0xA2B3, 0xFF14, 0xA2B4, 0xFF15, + 0xA2B5, 0xFF16, 0xA2B6, 0xFF17, 0xA2B7, 0xFF18, 0xA2B8, 0xFF19, 0xA2B9, 0x2160, 0xA2BA, 0x2161, 0xA2BB, 0x2162, 0xA2BC, 0x2163, + 0xA2BD, 0x2164, 0xA2BE, 0x2165, 0xA2BF, 0x2166, 0xA2C0, 0x2167, 0xA2C1, 0x2168, 0xA2C2, 0x2169, 0xA2C3, 0x3021, 0xA2C4, 0x3022, + 0xA2C5, 0x3023, 0xA2C6, 0x3024, 0xA2C7, 0x3025, 0xA2C8, 0x3026, 0xA2C9, 0x3027, 0xA2CA, 0x3028, 0xA2CB, 0x3029, 0xA2CC, 0x5341, + 0xA2CD, 0x5344, 0xA2CE, 0x5345, 0xA2CF, 0xFF21, 0xA2D0, 0xFF22, 0xA2D1, 0xFF23, 0xA2D2, 0xFF24, 0xA2D3, 0xFF25, 0xA2D4, 0xFF26, + 0xA2D5, 0xFF27, 0xA2D6, 0xFF28, 0xA2D7, 0xFF29, 0xA2D8, 0xFF2A, 0xA2D9, 0xFF2B, 0xA2DA, 0xFF2C, 0xA2DB, 0xFF2D, 0xA2DC, 0xFF2E, + 0xA2DD, 0xFF2F, 0xA2DE, 0xFF30, 0xA2DF, 0xFF31, 0xA2E0, 0xFF32, 0xA2E1, 0xFF33, 0xA2E2, 0xFF34, 0xA2E3, 0xFF35, 0xA2E4, 0xFF36, + 0xA2E5, 0xFF37, 0xA2E6, 0xFF38, 0xA2E7, 0xFF39, 0xA2E8, 0xFF3A, 0xA2E9, 0xFF41, 0xA2EA, 0xFF42, 0xA2EB, 0xFF43, 0xA2EC, 0xFF44, + 0xA2ED, 0xFF45, 0xA2EE, 0xFF46, 0xA2EF, 0xFF47, 0xA2F0, 0xFF48, 0xA2F1, 0xFF49, 0xA2F2, 0xFF4A, 0xA2F3, 0xFF4B, 0xA2F4, 0xFF4C, + 0xA2F5, 0xFF4D, 0xA2F6, 0xFF4E, 0xA2F7, 0xFF4F, 0xA2F8, 0xFF50, 0xA2F9, 0xFF51, 0xA2FA, 0xFF52, 0xA2FB, 0xFF53, 0xA2FC, 0xFF54, + 0xA2FD, 0xFF55, 0xA2FE, 0xFF56, 0xA340, 0xFF57, 0xA341, 0xFF58, 0xA342, 0xFF59, 0xA343, 0xFF5A, 0xA344, 0x0391, 0xA345, 0x0392, + 0xA346, 0x0393, 0xA347, 0x0394, 0xA348, 0x0395, 0xA349, 0x0396, 0xA34A, 0x0397, 0xA34B, 0x0398, 0xA34C, 0x0399, 0xA34D, 0x039A, + 0xA34E, 0x039B, 0xA34F, 0x039C, 0xA350, 0x039D, 0xA351, 0x039E, 0xA352, 0x039F, 0xA353, 0x03A0, 0xA354, 0x03A1, 0xA355, 0x03A3, + 0xA356, 0x03A4, 0xA357, 0x03A5, 0xA358, 0x03A6, 0xA359, 0x03A7, 0xA35A, 0x03A8, 0xA35B, 0x03A9, 0xA35C, 0x03B1, 0xA35D, 0x03B2, + 0xA35E, 0x03B3, 0xA35F, 0x03B4, 0xA360, 0x03B5, 0xA361, 0x03B6, 0xA362, 0x03B7, 0xA363, 0x03B8, 0xA364, 0x03B9, 0xA365, 0x03BA, + 0xA366, 0x03BB, 0xA367, 0x03BC, 0xA368, 0x03BD, 0xA369, 0x03BE, 0xA36A, 0x03BF, 0xA36B, 0x03C0, 0xA36C, 0x03C1, 0xA36D, 0x03C3, + 0xA36E, 0x03C4, 0xA36F, 0x03C5, 0xA370, 0x03C6, 0xA371, 0x03C7, 0xA372, 0x03C8, 0xA373, 0x03C9, 0xA374, 0x3105, 0xA375, 0x3106, + 0xA376, 0x3107, 0xA377, 0x3108, 0xA378, 0x3109, 0xA379, 0x310A, 0xA37A, 0x310B, 0xA37B, 0x310C, 0xA37C, 0x310D, 0xA37D, 0x310E, + 0xA37E, 0x310F, 0xA3A1, 0x3110, 0xA3A2, 0x3111, 0xA3A3, 0x3112, 0xA3A4, 0x3113, 0xA3A5, 0x3114, 0xA3A6, 0x3115, 0xA3A7, 0x3116, + 0xA3A8, 0x3117, 0xA3A9, 0x3118, 0xA3AA, 0x3119, 0xA3AB, 0x311A, 0xA3AC, 0x311B, 0xA3AD, 0x311C, 0xA3AE, 0x311D, 0xA3AF, 0x311E, + 0xA3B0, 0x311F, 0xA3B1, 0x3120, 0xA3B2, 0x3121, 0xA3B3, 0x3122, 0xA3B4, 0x3123, 0xA3B5, 0x3124, 0xA3B6, 0x3125, 0xA3B7, 0x3126, + 0xA3B8, 0x3127, 0xA3B9, 0x3128, 0xA3BA, 0x3129, 0xA3BB, 0x02D9, 0xA3BC, 0x02C9, 0xA3BD, 0x02CA, 0xA3BE, 0x02C7, 0xA3BF, 0x02CB, + 0xA3E1, 0x20AC, 0xA440, 0x4E00, 0xA441, 0x4E59, 0xA442, 0x4E01, 0xA443, 0x4E03, 0xA444, 0x4E43, 0xA445, 0x4E5D, 0xA446, 0x4E86, + 0xA447, 0x4E8C, 0xA448, 0x4EBA, 0xA449, 0x513F, 0xA44A, 0x5165, 0xA44B, 0x516B, 0xA44C, 0x51E0, 0xA44D, 0x5200, 0xA44E, 0x5201, + 0xA44F, 0x529B, 0xA450, 0x5315, 0xA451, 0x5341, 0xA452, 0x535C, 0xA453, 0x53C8, 0xA454, 0x4E09, 0xA455, 0x4E0B, 0xA456, 0x4E08, + 0xA457, 0x4E0A, 0xA458, 0x4E2B, 0xA459, 0x4E38, 0xA45A, 0x51E1, 0xA45B, 0x4E45, 0xA45C, 0x4E48, 0xA45D, 0x4E5F, 0xA45E, 0x4E5E, + 0xA45F, 0x4E8E, 0xA460, 0x4EA1, 0xA461, 0x5140, 0xA462, 0x5203, 0xA463, 0x52FA, 0xA464, 0x5343, 0xA465, 0x53C9, 0xA466, 0x53E3, + 0xA467, 0x571F, 0xA468, 0x58EB, 0xA469, 0x5915, 0xA46A, 0x5927, 0xA46B, 0x5973, 0xA46C, 0x5B50, 0xA46D, 0x5B51, 0xA46E, 0x5B53, + 0xA46F, 0x5BF8, 0xA470, 0x5C0F, 0xA471, 0x5C22, 0xA472, 0x5C38, 0xA473, 0x5C71, 0xA474, 0x5DDD, 0xA475, 0x5DE5, 0xA476, 0x5DF1, + 0xA477, 0x5DF2, 0xA478, 0x5DF3, 0xA479, 0x5DFE, 0xA47A, 0x5E72, 0xA47B, 0x5EFE, 0xA47C, 0x5F0B, 0xA47D, 0x5F13, 0xA47E, 0x624D, + 0xA4A1, 0x4E11, 0xA4A2, 0x4E10, 0xA4A3, 0x4E0D, 0xA4A4, 0x4E2D, 0xA4A5, 0x4E30, 0xA4A6, 0x4E39, 0xA4A7, 0x4E4B, 0xA4A8, 0x5C39, + 0xA4A9, 0x4E88, 0xA4AA, 0x4E91, 0xA4AB, 0x4E95, 0xA4AC, 0x4E92, 0xA4AD, 0x4E94, 0xA4AE, 0x4EA2, 0xA4AF, 0x4EC1, 0xA4B0, 0x4EC0, + 0xA4B1, 0x4EC3, 0xA4B2, 0x4EC6, 0xA4B3, 0x4EC7, 0xA4B4, 0x4ECD, 0xA4B5, 0x4ECA, 0xA4B6, 0x4ECB, 0xA4B7, 0x4EC4, 0xA4B8, 0x5143, + 0xA4B9, 0x5141, 0xA4BA, 0x5167, 0xA4BB, 0x516D, 0xA4BC, 0x516E, 0xA4BD, 0x516C, 0xA4BE, 0x5197, 0xA4BF, 0x51F6, 0xA4C0, 0x5206, + 0xA4C1, 0x5207, 0xA4C2, 0x5208, 0xA4C3, 0x52FB, 0xA4C4, 0x52FE, 0xA4C5, 0x52FF, 0xA4C6, 0x5316, 0xA4C7, 0x5339, 0xA4C8, 0x5348, + 0xA4C9, 0x5347, 0xA4CA, 0x5345, 0xA4CB, 0x535E, 0xA4CC, 0x5384, 0xA4CD, 0x53CB, 0xA4CE, 0x53CA, 0xA4CF, 0x53CD, 0xA4D0, 0x58EC, + 0xA4D1, 0x5929, 0xA4D2, 0x592B, 0xA4D3, 0x592A, 0xA4D4, 0x592D, 0xA4D5, 0x5B54, 0xA4D6, 0x5C11, 0xA4D7, 0x5C24, 0xA4D8, 0x5C3A, + 0xA4D9, 0x5C6F, 0xA4DA, 0x5DF4, 0xA4DB, 0x5E7B, 0xA4DC, 0x5EFF, 0xA4DD, 0x5F14, 0xA4DE, 0x5F15, 0xA4DF, 0x5FC3, 0xA4E0, 0x6208, + 0xA4E1, 0x6236, 0xA4E2, 0x624B, 0xA4E3, 0x624E, 0xA4E4, 0x652F, 0xA4E5, 0x6587, 0xA4E6, 0x6597, 0xA4E7, 0x65A4, 0xA4E8, 0x65B9, + 0xA4E9, 0x65E5, 0xA4EA, 0x66F0, 0xA4EB, 0x6708, 0xA4EC, 0x6728, 0xA4ED, 0x6B20, 0xA4EE, 0x6B62, 0xA4EF, 0x6B79, 0xA4F0, 0x6BCB, + 0xA4F1, 0x6BD4, 0xA4F2, 0x6BDB, 0xA4F3, 0x6C0F, 0xA4F4, 0x6C34, 0xA4F5, 0x706B, 0xA4F6, 0x722A, 0xA4F7, 0x7236, 0xA4F8, 0x723B, + 0xA4F9, 0x7247, 0xA4FA, 0x7259, 0xA4FB, 0x725B, 0xA4FC, 0x72AC, 0xA4FD, 0x738B, 0xA4FE, 0x4E19, 0xA540, 0x4E16, 0xA541, 0x4E15, + 0xA542, 0x4E14, 0xA543, 0x4E18, 0xA544, 0x4E3B, 0xA545, 0x4E4D, 0xA546, 0x4E4F, 0xA547, 0x4E4E, 0xA548, 0x4EE5, 0xA549, 0x4ED8, + 0xA54A, 0x4ED4, 0xA54B, 0x4ED5, 0xA54C, 0x4ED6, 0xA54D, 0x4ED7, 0xA54E, 0x4EE3, 0xA54F, 0x4EE4, 0xA550, 0x4ED9, 0xA551, 0x4EDE, + 0xA552, 0x5145, 0xA553, 0x5144, 0xA554, 0x5189, 0xA555, 0x518A, 0xA556, 0x51AC, 0xA557, 0x51F9, 0xA558, 0x51FA, 0xA559, 0x51F8, + 0xA55A, 0x520A, 0xA55B, 0x52A0, 0xA55C, 0x529F, 0xA55D, 0x5305, 0xA55E, 0x5306, 0xA55F, 0x5317, 0xA560, 0x531D, 0xA561, 0x4EDF, + 0xA562, 0x534A, 0xA563, 0x5349, 0xA564, 0x5361, 0xA565, 0x5360, 0xA566, 0x536F, 0xA567, 0x536E, 0xA568, 0x53BB, 0xA569, 0x53EF, + 0xA56A, 0x53E4, 0xA56B, 0x53F3, 0xA56C, 0x53EC, 0xA56D, 0x53EE, 0xA56E, 0x53E9, 0xA56F, 0x53E8, 0xA570, 0x53FC, 0xA571, 0x53F8, + 0xA572, 0x53F5, 0xA573, 0x53EB, 0xA574, 0x53E6, 0xA575, 0x53EA, 0xA576, 0x53F2, 0xA577, 0x53F1, 0xA578, 0x53F0, 0xA579, 0x53E5, + 0xA57A, 0x53ED, 0xA57B, 0x53FB, 0xA57C, 0x56DB, 0xA57D, 0x56DA, 0xA57E, 0x5916, 0xA5A1, 0x592E, 0xA5A2, 0x5931, 0xA5A3, 0x5974, + 0xA5A4, 0x5976, 0xA5A5, 0x5B55, 0xA5A6, 0x5B83, 0xA5A7, 0x5C3C, 0xA5A8, 0x5DE8, 0xA5A9, 0x5DE7, 0xA5AA, 0x5DE6, 0xA5AB, 0x5E02, + 0xA5AC, 0x5E03, 0xA5AD, 0x5E73, 0xA5AE, 0x5E7C, 0xA5AF, 0x5F01, 0xA5B0, 0x5F18, 0xA5B1, 0x5F17, 0xA5B2, 0x5FC5, 0xA5B3, 0x620A, + 0xA5B4, 0x6253, 0xA5B5, 0x6254, 0xA5B6, 0x6252, 0xA5B7, 0x6251, 0xA5B8, 0x65A5, 0xA5B9, 0x65E6, 0xA5BA, 0x672E, 0xA5BB, 0x672C, + 0xA5BC, 0x672A, 0xA5BD, 0x672B, 0xA5BE, 0x672D, 0xA5BF, 0x6B63, 0xA5C0, 0x6BCD, 0xA5C1, 0x6C11, 0xA5C2, 0x6C10, 0xA5C3, 0x6C38, + 0xA5C4, 0x6C41, 0xA5C5, 0x6C40, 0xA5C6, 0x6C3E, 0xA5C7, 0x72AF, 0xA5C8, 0x7384, 0xA5C9, 0x7389, 0xA5CA, 0x74DC, 0xA5CB, 0x74E6, + 0xA5CC, 0x7518, 0xA5CD, 0x751F, 0xA5CE, 0x7528, 0xA5CF, 0x7529, 0xA5D0, 0x7530, 0xA5D1, 0x7531, 0xA5D2, 0x7532, 0xA5D3, 0x7533, + 0xA5D4, 0x758B, 0xA5D5, 0x767D, 0xA5D6, 0x76AE, 0xA5D7, 0x76BF, 0xA5D8, 0x76EE, 0xA5D9, 0x77DB, 0xA5DA, 0x77E2, 0xA5DB, 0x77F3, + 0xA5DC, 0x793A, 0xA5DD, 0x79BE, 0xA5DE, 0x7A74, 0xA5DF, 0x7ACB, 0xA5E0, 0x4E1E, 0xA5E1, 0x4E1F, 0xA5E2, 0x4E52, 0xA5E3, 0x4E53, + 0xA5E4, 0x4E69, 0xA5E5, 0x4E99, 0xA5E6, 0x4EA4, 0xA5E7, 0x4EA6, 0xA5E8, 0x4EA5, 0xA5E9, 0x4EFF, 0xA5EA, 0x4F09, 0xA5EB, 0x4F19, + 0xA5EC, 0x4F0A, 0xA5ED, 0x4F15, 0xA5EE, 0x4F0D, 0xA5EF, 0x4F10, 0xA5F0, 0x4F11, 0xA5F1, 0x4F0F, 0xA5F2, 0x4EF2, 0xA5F3, 0x4EF6, + 0xA5F4, 0x4EFB, 0xA5F5, 0x4EF0, 0xA5F6, 0x4EF3, 0xA5F7, 0x4EFD, 0xA5F8, 0x4F01, 0xA5F9, 0x4F0B, 0xA5FA, 0x5149, 0xA5FB, 0x5147, + 0xA5FC, 0x5146, 0xA5FD, 0x5148, 0xA5FE, 0x5168, 0xA640, 0x5171, 0xA641, 0x518D, 0xA642, 0x51B0, 0xA643, 0x5217, 0xA644, 0x5211, + 0xA645, 0x5212, 0xA646, 0x520E, 0xA647, 0x5216, 0xA648, 0x52A3, 0xA649, 0x5308, 0xA64A, 0x5321, 0xA64B, 0x5320, 0xA64C, 0x5370, + 0xA64D, 0x5371, 0xA64E, 0x5409, 0xA64F, 0x540F, 0xA650, 0x540C, 0xA651, 0x540A, 0xA652, 0x5410, 0xA653, 0x5401, 0xA654, 0x540B, + 0xA655, 0x5404, 0xA656, 0x5411, 0xA657, 0x540D, 0xA658, 0x5408, 0xA659, 0x5403, 0xA65A, 0x540E, 0xA65B, 0x5406, 0xA65C, 0x5412, + 0xA65D, 0x56E0, 0xA65E, 0x56DE, 0xA65F, 0x56DD, 0xA660, 0x5733, 0xA661, 0x5730, 0xA662, 0x5728, 0xA663, 0x572D, 0xA664, 0x572C, + 0xA665, 0x572F, 0xA666, 0x5729, 0xA667, 0x5919, 0xA668, 0x591A, 0xA669, 0x5937, 0xA66A, 0x5938, 0xA66B, 0x5984, 0xA66C, 0x5978, + 0xA66D, 0x5983, 0xA66E, 0x597D, 0xA66F, 0x5979, 0xA670, 0x5982, 0xA671, 0x5981, 0xA672, 0x5B57, 0xA673, 0x5B58, 0xA674, 0x5B87, + 0xA675, 0x5B88, 0xA676, 0x5B85, 0xA677, 0x5B89, 0xA678, 0x5BFA, 0xA679, 0x5C16, 0xA67A, 0x5C79, 0xA67B, 0x5DDE, 0xA67C, 0x5E06, + 0xA67D, 0x5E76, 0xA67E, 0x5E74, 0xA6A1, 0x5F0F, 0xA6A2, 0x5F1B, 0xA6A3, 0x5FD9, 0xA6A4, 0x5FD6, 0xA6A5, 0x620E, 0xA6A6, 0x620C, + 0xA6A7, 0x620D, 0xA6A8, 0x6210, 0xA6A9, 0x6263, 0xA6AA, 0x625B, 0xA6AB, 0x6258, 0xA6AC, 0x6536, 0xA6AD, 0x65E9, 0xA6AE, 0x65E8, + 0xA6AF, 0x65EC, 0xA6B0, 0x65ED, 0xA6B1, 0x66F2, 0xA6B2, 0x66F3, 0xA6B3, 0x6709, 0xA6B4, 0x673D, 0xA6B5, 0x6734, 0xA6B6, 0x6731, + 0xA6B7, 0x6735, 0xA6B8, 0x6B21, 0xA6B9, 0x6B64, 0xA6BA, 0x6B7B, 0xA6BB, 0x6C16, 0xA6BC, 0x6C5D, 0xA6BD, 0x6C57, 0xA6BE, 0x6C59, + 0xA6BF, 0x6C5F, 0xA6C0, 0x6C60, 0xA6C1, 0x6C50, 0xA6C2, 0x6C55, 0xA6C3, 0x6C61, 0xA6C4, 0x6C5B, 0xA6C5, 0x6C4D, 0xA6C6, 0x6C4E, + 0xA6C7, 0x7070, 0xA6C8, 0x725F, 0xA6C9, 0x725D, 0xA6CA, 0x767E, 0xA6CB, 0x7AF9, 0xA6CC, 0x7C73, 0xA6CD, 0x7CF8, 0xA6CE, 0x7F36, + 0xA6CF, 0x7F8A, 0xA6D0, 0x7FBD, 0xA6D1, 0x8001, 0xA6D2, 0x8003, 0xA6D3, 0x800C, 0xA6D4, 0x8012, 0xA6D5, 0x8033, 0xA6D6, 0x807F, + 0xA6D7, 0x8089, 0xA6D8, 0x808B, 0xA6D9, 0x808C, 0xA6DA, 0x81E3, 0xA6DB, 0x81EA, 0xA6DC, 0x81F3, 0xA6DD, 0x81FC, 0xA6DE, 0x820C, + 0xA6DF, 0x821B, 0xA6E0, 0x821F, 0xA6E1, 0x826E, 0xA6E2, 0x8272, 0xA6E3, 0x827E, 0xA6E4, 0x866B, 0xA6E5, 0x8840, 0xA6E6, 0x884C, + 0xA6E7, 0x8863, 0xA6E8, 0x897F, 0xA6E9, 0x9621, 0xA6EA, 0x4E32, 0xA6EB, 0x4EA8, 0xA6EC, 0x4F4D, 0xA6ED, 0x4F4F, 0xA6EE, 0x4F47, + 0xA6EF, 0x4F57, 0xA6F0, 0x4F5E, 0xA6F1, 0x4F34, 0xA6F2, 0x4F5B, 0xA6F3, 0x4F55, 0xA6F4, 0x4F30, 0xA6F5, 0x4F50, 0xA6F6, 0x4F51, + 0xA6F7, 0x4F3D, 0xA6F8, 0x4F3A, 0xA6F9, 0x4F38, 0xA6FA, 0x4F43, 0xA6FB, 0x4F54, 0xA6FC, 0x4F3C, 0xA6FD, 0x4F46, 0xA6FE, 0x4F63, + 0xA740, 0x4F5C, 0xA741, 0x4F60, 0xA742, 0x4F2F, 0xA743, 0x4F4E, 0xA744, 0x4F36, 0xA745, 0x4F59, 0xA746, 0x4F5D, 0xA747, 0x4F48, + 0xA748, 0x4F5A, 0xA749, 0x514C, 0xA74A, 0x514B, 0xA74B, 0x514D, 0xA74C, 0x5175, 0xA74D, 0x51B6, 0xA74E, 0x51B7, 0xA74F, 0x5225, + 0xA750, 0x5224, 0xA751, 0x5229, 0xA752, 0x522A, 0xA753, 0x5228, 0xA754, 0x52AB, 0xA755, 0x52A9, 0xA756, 0x52AA, 0xA757, 0x52AC, + 0xA758, 0x5323, 0xA759, 0x5373, 0xA75A, 0x5375, 0xA75B, 0x541D, 0xA75C, 0x542D, 0xA75D, 0x541E, 0xA75E, 0x543E, 0xA75F, 0x5426, + 0xA760, 0x544E, 0xA761, 0x5427, 0xA762, 0x5446, 0xA763, 0x5443, 0xA764, 0x5433, 0xA765, 0x5448, 0xA766, 0x5442, 0xA767, 0x541B, + 0xA768, 0x5429, 0xA769, 0x544A, 0xA76A, 0x5439, 0xA76B, 0x543B, 0xA76C, 0x5438, 0xA76D, 0x542E, 0xA76E, 0x5435, 0xA76F, 0x5436, + 0xA770, 0x5420, 0xA771, 0x543C, 0xA772, 0x5440, 0xA773, 0x5431, 0xA774, 0x542B, 0xA775, 0x541F, 0xA776, 0x542C, 0xA777, 0x56EA, + 0xA778, 0x56F0, 0xA779, 0x56E4, 0xA77A, 0x56EB, 0xA77B, 0x574A, 0xA77C, 0x5751, 0xA77D, 0x5740, 0xA77E, 0x574D, 0xA7A1, 0x5747, + 0xA7A2, 0x574E, 0xA7A3, 0x573E, 0xA7A4, 0x5750, 0xA7A5, 0x574F, 0xA7A6, 0x573B, 0xA7A7, 0x58EF, 0xA7A8, 0x593E, 0xA7A9, 0x599D, + 0xA7AA, 0x5992, 0xA7AB, 0x59A8, 0xA7AC, 0x599E, 0xA7AD, 0x59A3, 0xA7AE, 0x5999, 0xA7AF, 0x5996, 0xA7B0, 0x598D, 0xA7B1, 0x59A4, + 0xA7B2, 0x5993, 0xA7B3, 0x598A, 0xA7B4, 0x59A5, 0xA7B5, 0x5B5D, 0xA7B6, 0x5B5C, 0xA7B7, 0x5B5A, 0xA7B8, 0x5B5B, 0xA7B9, 0x5B8C, + 0xA7BA, 0x5B8B, 0xA7BB, 0x5B8F, 0xA7BC, 0x5C2C, 0xA7BD, 0x5C40, 0xA7BE, 0x5C41, 0xA7BF, 0x5C3F, 0xA7C0, 0x5C3E, 0xA7C1, 0x5C90, + 0xA7C2, 0x5C91, 0xA7C3, 0x5C94, 0xA7C4, 0x5C8C, 0xA7C5, 0x5DEB, 0xA7C6, 0x5E0C, 0xA7C7, 0x5E8F, 0xA7C8, 0x5E87, 0xA7C9, 0x5E8A, + 0xA7CA, 0x5EF7, 0xA7CB, 0x5F04, 0xA7CC, 0x5F1F, 0xA7CD, 0x5F64, 0xA7CE, 0x5F62, 0xA7CF, 0x5F77, 0xA7D0, 0x5F79, 0xA7D1, 0x5FD8, + 0xA7D2, 0x5FCC, 0xA7D3, 0x5FD7, 0xA7D4, 0x5FCD, 0xA7D5, 0x5FF1, 0xA7D6, 0x5FEB, 0xA7D7, 0x5FF8, 0xA7D8, 0x5FEA, 0xA7D9, 0x6212, + 0xA7DA, 0x6211, 0xA7DB, 0x6284, 0xA7DC, 0x6297, 0xA7DD, 0x6296, 0xA7DE, 0x6280, 0xA7DF, 0x6276, 0xA7E0, 0x6289, 0xA7E1, 0x626D, + 0xA7E2, 0x628A, 0xA7E3, 0x627C, 0xA7E4, 0x627E, 0xA7E5, 0x6279, 0xA7E6, 0x6273, 0xA7E7, 0x6292, 0xA7E8, 0x626F, 0xA7E9, 0x6298, + 0xA7EA, 0x626E, 0xA7EB, 0x6295, 0xA7EC, 0x6293, 0xA7ED, 0x6291, 0xA7EE, 0x6286, 0xA7EF, 0x6539, 0xA7F0, 0x653B, 0xA7F1, 0x6538, + 0xA7F2, 0x65F1, 0xA7F3, 0x66F4, 0xA7F4, 0x675F, 0xA7F5, 0x674E, 0xA7F6, 0x674F, 0xA7F7, 0x6750, 0xA7F8, 0x6751, 0xA7F9, 0x675C, + 0xA7FA, 0x6756, 0xA7FB, 0x675E, 0xA7FC, 0x6749, 0xA7FD, 0x6746, 0xA7FE, 0x6760, 0xA840, 0x6753, 0xA841, 0x6757, 0xA842, 0x6B65, + 0xA843, 0x6BCF, 0xA844, 0x6C42, 0xA845, 0x6C5E, 0xA846, 0x6C99, 0xA847, 0x6C81, 0xA848, 0x6C88, 0xA849, 0x6C89, 0xA84A, 0x6C85, + 0xA84B, 0x6C9B, 0xA84C, 0x6C6A, 0xA84D, 0x6C7A, 0xA84E, 0x6C90, 0xA84F, 0x6C70, 0xA850, 0x6C8C, 0xA851, 0x6C68, 0xA852, 0x6C96, + 0xA853, 0x6C92, 0xA854, 0x6C7D, 0xA855, 0x6C83, 0xA856, 0x6C72, 0xA857, 0x6C7E, 0xA858, 0x6C74, 0xA859, 0x6C86, 0xA85A, 0x6C76, + 0xA85B, 0x6C8D, 0xA85C, 0x6C94, 0xA85D, 0x6C98, 0xA85E, 0x6C82, 0xA85F, 0x7076, 0xA860, 0x707C, 0xA861, 0x707D, 0xA862, 0x7078, + 0xA863, 0x7262, 0xA864, 0x7261, 0xA865, 0x7260, 0xA866, 0x72C4, 0xA867, 0x72C2, 0xA868, 0x7396, 0xA869, 0x752C, 0xA86A, 0x752B, + 0xA86B, 0x7537, 0xA86C, 0x7538, 0xA86D, 0x7682, 0xA86E, 0x76EF, 0xA86F, 0x77E3, 0xA870, 0x79C1, 0xA871, 0x79C0, 0xA872, 0x79BF, + 0xA873, 0x7A76, 0xA874, 0x7CFB, 0xA875, 0x7F55, 0xA876, 0x8096, 0xA877, 0x8093, 0xA878, 0x809D, 0xA879, 0x8098, 0xA87A, 0x809B, + 0xA87B, 0x809A, 0xA87C, 0x80B2, 0xA87D, 0x826F, 0xA87E, 0x8292, 0xA8A1, 0x828B, 0xA8A2, 0x828D, 0xA8A3, 0x898B, 0xA8A4, 0x89D2, + 0xA8A5, 0x8A00, 0xA8A6, 0x8C37, 0xA8A7, 0x8C46, 0xA8A8, 0x8C55, 0xA8A9, 0x8C9D, 0xA8AA, 0x8D64, 0xA8AB, 0x8D70, 0xA8AC, 0x8DB3, + 0xA8AD, 0x8EAB, 0xA8AE, 0x8ECA, 0xA8AF, 0x8F9B, 0xA8B0, 0x8FB0, 0xA8B1, 0x8FC2, 0xA8B2, 0x8FC6, 0xA8B3, 0x8FC5, 0xA8B4, 0x8FC4, + 0xA8B5, 0x5DE1, 0xA8B6, 0x9091, 0xA8B7, 0x90A2, 0xA8B8, 0x90AA, 0xA8B9, 0x90A6, 0xA8BA, 0x90A3, 0xA8BB, 0x9149, 0xA8BC, 0x91C6, + 0xA8BD, 0x91CC, 0xA8BE, 0x9632, 0xA8BF, 0x962E, 0xA8C0, 0x9631, 0xA8C1, 0x962A, 0xA8C2, 0x962C, 0xA8C3, 0x4E26, 0xA8C4, 0x4E56, + 0xA8C5, 0x4E73, 0xA8C6, 0x4E8B, 0xA8C7, 0x4E9B, 0xA8C8, 0x4E9E, 0xA8C9, 0x4EAB, 0xA8CA, 0x4EAC, 0xA8CB, 0x4F6F, 0xA8CC, 0x4F9D, + 0xA8CD, 0x4F8D, 0xA8CE, 0x4F73, 0xA8CF, 0x4F7F, 0xA8D0, 0x4F6C, 0xA8D1, 0x4F9B, 0xA8D2, 0x4F8B, 0xA8D3, 0x4F86, 0xA8D4, 0x4F83, + 0xA8D5, 0x4F70, 0xA8D6, 0x4F75, 0xA8D7, 0x4F88, 0xA8D8, 0x4F69, 0xA8D9, 0x4F7B, 0xA8DA, 0x4F96, 0xA8DB, 0x4F7E, 0xA8DC, 0x4F8F, + 0xA8DD, 0x4F91, 0xA8DE, 0x4F7A, 0xA8DF, 0x5154, 0xA8E0, 0x5152, 0xA8E1, 0x5155, 0xA8E2, 0x5169, 0xA8E3, 0x5177, 0xA8E4, 0x5176, + 0xA8E5, 0x5178, 0xA8E6, 0x51BD, 0xA8E7, 0x51FD, 0xA8E8, 0x523B, 0xA8E9, 0x5238, 0xA8EA, 0x5237, 0xA8EB, 0x523A, 0xA8EC, 0x5230, + 0xA8ED, 0x522E, 0xA8EE, 0x5236, 0xA8EF, 0x5241, 0xA8F0, 0x52BE, 0xA8F1, 0x52BB, 0xA8F2, 0x5352, 0xA8F3, 0x5354, 0xA8F4, 0x5353, + 0xA8F5, 0x5351, 0xA8F6, 0x5366, 0xA8F7, 0x5377, 0xA8F8, 0x5378, 0xA8F9, 0x5379, 0xA8FA, 0x53D6, 0xA8FB, 0x53D4, 0xA8FC, 0x53D7, + 0xA8FD, 0x5473, 0xA8FE, 0x5475, 0xA940, 0x5496, 0xA941, 0x5478, 0xA942, 0x5495, 0xA943, 0x5480, 0xA944, 0x547B, 0xA945, 0x5477, + 0xA946, 0x5484, 0xA947, 0x5492, 0xA948, 0x5486, 0xA949, 0x547C, 0xA94A, 0x5490, 0xA94B, 0x5471, 0xA94C, 0x5476, 0xA94D, 0x548C, + 0xA94E, 0x549A, 0xA94F, 0x5462, 0xA950, 0x5468, 0xA951, 0x548B, 0xA952, 0x547D, 0xA953, 0x548E, 0xA954, 0x56FA, 0xA955, 0x5783, + 0xA956, 0x5777, 0xA957, 0x576A, 0xA958, 0x5769, 0xA959, 0x5761, 0xA95A, 0x5766, 0xA95B, 0x5764, 0xA95C, 0x577C, 0xA95D, 0x591C, + 0xA95E, 0x5949, 0xA95F, 0x5947, 0xA960, 0x5948, 0xA961, 0x5944, 0xA962, 0x5954, 0xA963, 0x59BE, 0xA964, 0x59BB, 0xA965, 0x59D4, + 0xA966, 0x59B9, 0xA967, 0x59AE, 0xA968, 0x59D1, 0xA969, 0x59C6, 0xA96A, 0x59D0, 0xA96B, 0x59CD, 0xA96C, 0x59CB, 0xA96D, 0x59D3, + 0xA96E, 0x59CA, 0xA96F, 0x59AF, 0xA970, 0x59B3, 0xA971, 0x59D2, 0xA972, 0x59C5, 0xA973, 0x5B5F, 0xA974, 0x5B64, 0xA975, 0x5B63, + 0xA976, 0x5B97, 0xA977, 0x5B9A, 0xA978, 0x5B98, 0xA979, 0x5B9C, 0xA97A, 0x5B99, 0xA97B, 0x5B9B, 0xA97C, 0x5C1A, 0xA97D, 0x5C48, + 0xA97E, 0x5C45, 0xA9A1, 0x5C46, 0xA9A2, 0x5CB7, 0xA9A3, 0x5CA1, 0xA9A4, 0x5CB8, 0xA9A5, 0x5CA9, 0xA9A6, 0x5CAB, 0xA9A7, 0x5CB1, + 0xA9A8, 0x5CB3, 0xA9A9, 0x5E18, 0xA9AA, 0x5E1A, 0xA9AB, 0x5E16, 0xA9AC, 0x5E15, 0xA9AD, 0x5E1B, 0xA9AE, 0x5E11, 0xA9AF, 0x5E78, + 0xA9B0, 0x5E9A, 0xA9B1, 0x5E97, 0xA9B2, 0x5E9C, 0xA9B3, 0x5E95, 0xA9B4, 0x5E96, 0xA9B5, 0x5EF6, 0xA9B6, 0x5F26, 0xA9B7, 0x5F27, + 0xA9B8, 0x5F29, 0xA9B9, 0x5F80, 0xA9BA, 0x5F81, 0xA9BB, 0x5F7F, 0xA9BC, 0x5F7C, 0xA9BD, 0x5FDD, 0xA9BE, 0x5FE0, 0xA9BF, 0x5FFD, + 0xA9C0, 0x5FF5, 0xA9C1, 0x5FFF, 0xA9C2, 0x600F, 0xA9C3, 0x6014, 0xA9C4, 0x602F, 0xA9C5, 0x6035, 0xA9C6, 0x6016, 0xA9C7, 0x602A, + 0xA9C8, 0x6015, 0xA9C9, 0x6021, 0xA9CA, 0x6027, 0xA9CB, 0x6029, 0xA9CC, 0x602B, 0xA9CD, 0x601B, 0xA9CE, 0x6216, 0xA9CF, 0x6215, + 0xA9D0, 0x623F, 0xA9D1, 0x623E, 0xA9D2, 0x6240, 0xA9D3, 0x627F, 0xA9D4, 0x62C9, 0xA9D5, 0x62CC, 0xA9D6, 0x62C4, 0xA9D7, 0x62BF, + 0xA9D8, 0x62C2, 0xA9D9, 0x62B9, 0xA9DA, 0x62D2, 0xA9DB, 0x62DB, 0xA9DC, 0x62AB, 0xA9DD, 0x62D3, 0xA9DE, 0x62D4, 0xA9DF, 0x62CB, + 0xA9E0, 0x62C8, 0xA9E1, 0x62A8, 0xA9E2, 0x62BD, 0xA9E3, 0x62BC, 0xA9E4, 0x62D0, 0xA9E5, 0x62D9, 0xA9E6, 0x62C7, 0xA9E7, 0x62CD, + 0xA9E8, 0x62B5, 0xA9E9, 0x62DA, 0xA9EA, 0x62B1, 0xA9EB, 0x62D8, 0xA9EC, 0x62D6, 0xA9ED, 0x62D7, 0xA9EE, 0x62C6, 0xA9EF, 0x62AC, + 0xA9F0, 0x62CE, 0xA9F1, 0x653E, 0xA9F2, 0x65A7, 0xA9F3, 0x65BC, 0xA9F4, 0x65FA, 0xA9F5, 0x6614, 0xA9F6, 0x6613, 0xA9F7, 0x660C, + 0xA9F8, 0x6606, 0xA9F9, 0x6602, 0xA9FA, 0x660E, 0xA9FB, 0x6600, 0xA9FC, 0x660F, 0xA9FD, 0x6615, 0xA9FE, 0x660A, 0xAA40, 0x6607, + 0xAA41, 0x670D, 0xAA42, 0x670B, 0xAA43, 0x676D, 0xAA44, 0x678B, 0xAA45, 0x6795, 0xAA46, 0x6771, 0xAA47, 0x679C, 0xAA48, 0x6773, + 0xAA49, 0x6777, 0xAA4A, 0x6787, 0xAA4B, 0x679D, 0xAA4C, 0x6797, 0xAA4D, 0x676F, 0xAA4E, 0x6770, 0xAA4F, 0x677F, 0xAA50, 0x6789, + 0xAA51, 0x677E, 0xAA52, 0x6790, 0xAA53, 0x6775, 0xAA54, 0x679A, 0xAA55, 0x6793, 0xAA56, 0x677C, 0xAA57, 0x676A, 0xAA58, 0x6772, + 0xAA59, 0x6B23, 0xAA5A, 0x6B66, 0xAA5B, 0x6B67, 0xAA5C, 0x6B7F, 0xAA5D, 0x6C13, 0xAA5E, 0x6C1B, 0xAA5F, 0x6CE3, 0xAA60, 0x6CE8, + 0xAA61, 0x6CF3, 0xAA62, 0x6CB1, 0xAA63, 0x6CCC, 0xAA64, 0x6CE5, 0xAA65, 0x6CB3, 0xAA66, 0x6CBD, 0xAA67, 0x6CBE, 0xAA68, 0x6CBC, + 0xAA69, 0x6CE2, 0xAA6A, 0x6CAB, 0xAA6B, 0x6CD5, 0xAA6C, 0x6CD3, 0xAA6D, 0x6CB8, 0xAA6E, 0x6CC4, 0xAA6F, 0x6CB9, 0xAA70, 0x6CC1, + 0xAA71, 0x6CAE, 0xAA72, 0x6CD7, 0xAA73, 0x6CC5, 0xAA74, 0x6CF1, 0xAA75, 0x6CBF, 0xAA76, 0x6CBB, 0xAA77, 0x6CE1, 0xAA78, 0x6CDB, + 0xAA79, 0x6CCA, 0xAA7A, 0x6CAC, 0xAA7B, 0x6CEF, 0xAA7C, 0x6CDC, 0xAA7D, 0x6CD6, 0xAA7E, 0x6CE0, 0xAAA1, 0x7095, 0xAAA2, 0x708E, + 0xAAA3, 0x7092, 0xAAA4, 0x708A, 0xAAA5, 0x7099, 0xAAA6, 0x722C, 0xAAA7, 0x722D, 0xAAA8, 0x7238, 0xAAA9, 0x7248, 0xAAAA, 0x7267, + 0xAAAB, 0x7269, 0xAAAC, 0x72C0, 0xAAAD, 0x72CE, 0xAAAE, 0x72D9, 0xAAAF, 0x72D7, 0xAAB0, 0x72D0, 0xAAB1, 0x73A9, 0xAAB2, 0x73A8, + 0xAAB3, 0x739F, 0xAAB4, 0x73AB, 0xAAB5, 0x73A5, 0xAAB6, 0x753D, 0xAAB7, 0x759D, 0xAAB8, 0x7599, 0xAAB9, 0x759A, 0xAABA, 0x7684, + 0xAABB, 0x76C2, 0xAABC, 0x76F2, 0xAABD, 0x76F4, 0xAABE, 0x77E5, 0xAABF, 0x77FD, 0xAAC0, 0x793E, 0xAAC1, 0x7940, 0xAAC2, 0x7941, + 0xAAC3, 0x79C9, 0xAAC4, 0x79C8, 0xAAC5, 0x7A7A, 0xAAC6, 0x7A79, 0xAAC7, 0x7AFA, 0xAAC8, 0x7CFE, 0xAAC9, 0x7F54, 0xAACA, 0x7F8C, + 0xAACB, 0x7F8B, 0xAACC, 0x8005, 0xAACD, 0x80BA, 0xAACE, 0x80A5, 0xAACF, 0x80A2, 0xAAD0, 0x80B1, 0xAAD1, 0x80A1, 0xAAD2, 0x80AB, + 0xAAD3, 0x80A9, 0xAAD4, 0x80B4, 0xAAD5, 0x80AA, 0xAAD6, 0x80AF, 0xAAD7, 0x81E5, 0xAAD8, 0x81FE, 0xAAD9, 0x820D, 0xAADA, 0x82B3, + 0xAADB, 0x829D, 0xAADC, 0x8299, 0xAADD, 0x82AD, 0xAADE, 0x82BD, 0xAADF, 0x829F, 0xAAE0, 0x82B9, 0xAAE1, 0x82B1, 0xAAE2, 0x82AC, + 0xAAE3, 0x82A5, 0xAAE4, 0x82AF, 0xAAE5, 0x82B8, 0xAAE6, 0x82A3, 0xAAE7, 0x82B0, 0xAAE8, 0x82BE, 0xAAE9, 0x82B7, 0xAAEA, 0x864E, + 0xAAEB, 0x8671, 0xAAEC, 0x521D, 0xAAED, 0x8868, 0xAAEE, 0x8ECB, 0xAAEF, 0x8FCE, 0xAAF0, 0x8FD4, 0xAAF1, 0x8FD1, 0xAAF2, 0x90B5, + 0xAAF3, 0x90B8, 0xAAF4, 0x90B1, 0xAAF5, 0x90B6, 0xAAF6, 0x91C7, 0xAAF7, 0x91D1, 0xAAF8, 0x9577, 0xAAF9, 0x9580, 0xAAFA, 0x961C, + 0xAAFB, 0x9640, 0xAAFC, 0x963F, 0xAAFD, 0x963B, 0xAAFE, 0x9644, 0xAB40, 0x9642, 0xAB41, 0x96B9, 0xAB42, 0x96E8, 0xAB43, 0x9752, + 0xAB44, 0x975E, 0xAB45, 0x4E9F, 0xAB46, 0x4EAD, 0xAB47, 0x4EAE, 0xAB48, 0x4FE1, 0xAB49, 0x4FB5, 0xAB4A, 0x4FAF, 0xAB4B, 0x4FBF, + 0xAB4C, 0x4FE0, 0xAB4D, 0x4FD1, 0xAB4E, 0x4FCF, 0xAB4F, 0x4FDD, 0xAB50, 0x4FC3, 0xAB51, 0x4FB6, 0xAB52, 0x4FD8, 0xAB53, 0x4FDF, + 0xAB54, 0x4FCA, 0xAB55, 0x4FD7, 0xAB56, 0x4FAE, 0xAB57, 0x4FD0, 0xAB58, 0x4FC4, 0xAB59, 0x4FC2, 0xAB5A, 0x4FDA, 0xAB5B, 0x4FCE, + 0xAB5C, 0x4FDE, 0xAB5D, 0x4FB7, 0xAB5E, 0x5157, 0xAB5F, 0x5192, 0xAB60, 0x5191, 0xAB61, 0x51A0, 0xAB62, 0x524E, 0xAB63, 0x5243, + 0xAB64, 0x524A, 0xAB65, 0x524D, 0xAB66, 0x524C, 0xAB67, 0x524B, 0xAB68, 0x5247, 0xAB69, 0x52C7, 0xAB6A, 0x52C9, 0xAB6B, 0x52C3, + 0xAB6C, 0x52C1, 0xAB6D, 0x530D, 0xAB6E, 0x5357, 0xAB6F, 0x537B, 0xAB70, 0x539A, 0xAB71, 0x53DB, 0xAB72, 0x54AC, 0xAB73, 0x54C0, + 0xAB74, 0x54A8, 0xAB75, 0x54CE, 0xAB76, 0x54C9, 0xAB77, 0x54B8, 0xAB78, 0x54A6, 0xAB79, 0x54B3, 0xAB7A, 0x54C7, 0xAB7B, 0x54C2, + 0xAB7C, 0x54BD, 0xAB7D, 0x54AA, 0xAB7E, 0x54C1, 0xABA1, 0x54C4, 0xABA2, 0x54C8, 0xABA3, 0x54AF, 0xABA4, 0x54AB, 0xABA5, 0x54B1, + 0xABA6, 0x54BB, 0xABA7, 0x54A9, 0xABA8, 0x54A7, 0xABA9, 0x54BF, 0xABAA, 0x56FF, 0xABAB, 0x5782, 0xABAC, 0x578B, 0xABAD, 0x57A0, + 0xABAE, 0x57A3, 0xABAF, 0x57A2, 0xABB0, 0x57CE, 0xABB1, 0x57AE, 0xABB2, 0x5793, 0xABB3, 0x5955, 0xABB4, 0x5951, 0xABB5, 0x594F, + 0xABB6, 0x594E, 0xABB7, 0x5950, 0xABB8, 0x59DC, 0xABB9, 0x59D8, 0xABBA, 0x59FF, 0xABBB, 0x59E3, 0xABBC, 0x59E8, 0xABBD, 0x5A03, + 0xABBE, 0x59E5, 0xABBF, 0x59EA, 0xABC0, 0x59DA, 0xABC1, 0x59E6, 0xABC2, 0x5A01, 0xABC3, 0x59FB, 0xABC4, 0x5B69, 0xABC5, 0x5BA3, + 0xABC6, 0x5BA6, 0xABC7, 0x5BA4, 0xABC8, 0x5BA2, 0xABC9, 0x5BA5, 0xABCA, 0x5C01, 0xABCB, 0x5C4E, 0xABCC, 0x5C4F, 0xABCD, 0x5C4D, + 0xABCE, 0x5C4B, 0xABCF, 0x5CD9, 0xABD0, 0x5CD2, 0xABD1, 0x5DF7, 0xABD2, 0x5E1D, 0xABD3, 0x5E25, 0xABD4, 0x5E1F, 0xABD5, 0x5E7D, + 0xABD6, 0x5EA0, 0xABD7, 0x5EA6, 0xABD8, 0x5EFA, 0xABD9, 0x5F08, 0xABDA, 0x5F2D, 0xABDB, 0x5F65, 0xABDC, 0x5F88, 0xABDD, 0x5F85, + 0xABDE, 0x5F8A, 0xABDF, 0x5F8B, 0xABE0, 0x5F87, 0xABE1, 0x5F8C, 0xABE2, 0x5F89, 0xABE3, 0x6012, 0xABE4, 0x601D, 0xABE5, 0x6020, + 0xABE6, 0x6025, 0xABE7, 0x600E, 0xABE8, 0x6028, 0xABE9, 0x604D, 0xABEA, 0x6070, 0xABEB, 0x6068, 0xABEC, 0x6062, 0xABED, 0x6046, + 0xABEE, 0x6043, 0xABEF, 0x606C, 0xABF0, 0x606B, 0xABF1, 0x606A, 0xABF2, 0x6064, 0xABF3, 0x6241, 0xABF4, 0x62DC, 0xABF5, 0x6316, + 0xABF6, 0x6309, 0xABF7, 0x62FC, 0xABF8, 0x62ED, 0xABF9, 0x6301, 0xABFA, 0x62EE, 0xABFB, 0x62FD, 0xABFC, 0x6307, 0xABFD, 0x62F1, + 0xABFE, 0x62F7, 0xAC40, 0x62EF, 0xAC41, 0x62EC, 0xAC42, 0x62FE, 0xAC43, 0x62F4, 0xAC44, 0x6311, 0xAC45, 0x6302, 0xAC46, 0x653F, + 0xAC47, 0x6545, 0xAC48, 0x65AB, 0xAC49, 0x65BD, 0xAC4A, 0x65E2, 0xAC4B, 0x6625, 0xAC4C, 0x662D, 0xAC4D, 0x6620, 0xAC4E, 0x6627, + 0xAC4F, 0x662F, 0xAC50, 0x661F, 0xAC51, 0x6628, 0xAC52, 0x6631, 0xAC53, 0x6624, 0xAC54, 0x66F7, 0xAC55, 0x67FF, 0xAC56, 0x67D3, + 0xAC57, 0x67F1, 0xAC58, 0x67D4, 0xAC59, 0x67D0, 0xAC5A, 0x67EC, 0xAC5B, 0x67B6, 0xAC5C, 0x67AF, 0xAC5D, 0x67F5, 0xAC5E, 0x67E9, + 0xAC5F, 0x67EF, 0xAC60, 0x67C4, 0xAC61, 0x67D1, 0xAC62, 0x67B4, 0xAC63, 0x67DA, 0xAC64, 0x67E5, 0xAC65, 0x67B8, 0xAC66, 0x67CF, + 0xAC67, 0x67DE, 0xAC68, 0x67F3, 0xAC69, 0x67B0, 0xAC6A, 0x67D9, 0xAC6B, 0x67E2, 0xAC6C, 0x67DD, 0xAC6D, 0x67D2, 0xAC6E, 0x6B6A, + 0xAC6F, 0x6B83, 0xAC70, 0x6B86, 0xAC71, 0x6BB5, 0xAC72, 0x6BD2, 0xAC73, 0x6BD7, 0xAC74, 0x6C1F, 0xAC75, 0x6CC9, 0xAC76, 0x6D0B, + 0xAC77, 0x6D32, 0xAC78, 0x6D2A, 0xAC79, 0x6D41, 0xAC7A, 0x6D25, 0xAC7B, 0x6D0C, 0xAC7C, 0x6D31, 0xAC7D, 0x6D1E, 0xAC7E, 0x6D17, + 0xACA1, 0x6D3B, 0xACA2, 0x6D3D, 0xACA3, 0x6D3E, 0xACA4, 0x6D36, 0xACA5, 0x6D1B, 0xACA6, 0x6CF5, 0xACA7, 0x6D39, 0xACA8, 0x6D27, + 0xACA9, 0x6D38, 0xACAA, 0x6D29, 0xACAB, 0x6D2E, 0xACAC, 0x6D35, 0xACAD, 0x6D0E, 0xACAE, 0x6D2B, 0xACAF, 0x70AB, 0xACB0, 0x70BA, + 0xACB1, 0x70B3, 0xACB2, 0x70AC, 0xACB3, 0x70AF, 0xACB4, 0x70AD, 0xACB5, 0x70B8, 0xACB6, 0x70AE, 0xACB7, 0x70A4, 0xACB8, 0x7230, + 0xACB9, 0x7272, 0xACBA, 0x726F, 0xACBB, 0x7274, 0xACBC, 0x72E9, 0xACBD, 0x72E0, 0xACBE, 0x72E1, 0xACBF, 0x73B7, 0xACC0, 0x73CA, + 0xACC1, 0x73BB, 0xACC2, 0x73B2, 0xACC3, 0x73CD, 0xACC4, 0x73C0, 0xACC5, 0x73B3, 0xACC6, 0x751A, 0xACC7, 0x752D, 0xACC8, 0x754F, + 0xACC9, 0x754C, 0xACCA, 0x754E, 0xACCB, 0x754B, 0xACCC, 0x75AB, 0xACCD, 0x75A4, 0xACCE, 0x75A5, 0xACCF, 0x75A2, 0xACD0, 0x75A3, + 0xACD1, 0x7678, 0xACD2, 0x7686, 0xACD3, 0x7687, 0xACD4, 0x7688, 0xACD5, 0x76C8, 0xACD6, 0x76C6, 0xACD7, 0x76C3, 0xACD8, 0x76C5, + 0xACD9, 0x7701, 0xACDA, 0x76F9, 0xACDB, 0x76F8, 0xACDC, 0x7709, 0xACDD, 0x770B, 0xACDE, 0x76FE, 0xACDF, 0x76FC, 0xACE0, 0x7707, + 0xACE1, 0x77DC, 0xACE2, 0x7802, 0xACE3, 0x7814, 0xACE4, 0x780C, 0xACE5, 0x780D, 0xACE6, 0x7946, 0xACE7, 0x7949, 0xACE8, 0x7948, + 0xACE9, 0x7947, 0xACEA, 0x79B9, 0xACEB, 0x79BA, 0xACEC, 0x79D1, 0xACED, 0x79D2, 0xACEE, 0x79CB, 0xACEF, 0x7A7F, 0xACF0, 0x7A81, + 0xACF1, 0x7AFF, 0xACF2, 0x7AFD, 0xACF3, 0x7C7D, 0xACF4, 0x7D02, 0xACF5, 0x7D05, 0xACF6, 0x7D00, 0xACF7, 0x7D09, 0xACF8, 0x7D07, + 0xACF9, 0x7D04, 0xACFA, 0x7D06, 0xACFB, 0x7F38, 0xACFC, 0x7F8E, 0xACFD, 0x7FBF, 0xACFE, 0x8004, 0xAD40, 0x8010, 0xAD41, 0x800D, + 0xAD42, 0x8011, 0xAD43, 0x8036, 0xAD44, 0x80D6, 0xAD45, 0x80E5, 0xAD46, 0x80DA, 0xAD47, 0x80C3, 0xAD48, 0x80C4, 0xAD49, 0x80CC, + 0xAD4A, 0x80E1, 0xAD4B, 0x80DB, 0xAD4C, 0x80CE, 0xAD4D, 0x80DE, 0xAD4E, 0x80E4, 0xAD4F, 0x80DD, 0xAD50, 0x81F4, 0xAD51, 0x8222, + 0xAD52, 0x82E7, 0xAD53, 0x8303, 0xAD54, 0x8305, 0xAD55, 0x82E3, 0xAD56, 0x82DB, 0xAD57, 0x82E6, 0xAD58, 0x8304, 0xAD59, 0x82E5, + 0xAD5A, 0x8302, 0xAD5B, 0x8309, 0xAD5C, 0x82D2, 0xAD5D, 0x82D7, 0xAD5E, 0x82F1, 0xAD5F, 0x8301, 0xAD60, 0x82DC, 0xAD61, 0x82D4, + 0xAD62, 0x82D1, 0xAD63, 0x82DE, 0xAD64, 0x82D3, 0xAD65, 0x82DF, 0xAD66, 0x82EF, 0xAD67, 0x8306, 0xAD68, 0x8650, 0xAD69, 0x8679, + 0xAD6A, 0x867B, 0xAD6B, 0x867A, 0xAD6C, 0x884D, 0xAD6D, 0x886B, 0xAD6E, 0x8981, 0xAD6F, 0x89D4, 0xAD70, 0x8A08, 0xAD71, 0x8A02, + 0xAD72, 0x8A03, 0xAD73, 0x8C9E, 0xAD74, 0x8CA0, 0xAD75, 0x8D74, 0xAD76, 0x8D73, 0xAD77, 0x8DB4, 0xAD78, 0x8ECD, 0xAD79, 0x8ECC, + 0xAD7A, 0x8FF0, 0xAD7B, 0x8FE6, 0xAD7C, 0x8FE2, 0xAD7D, 0x8FEA, 0xAD7E, 0x8FE5, 0xADA1, 0x8FED, 0xADA2, 0x8FEB, 0xADA3, 0x8FE4, + 0xADA4, 0x8FE8, 0xADA5, 0x90CA, 0xADA6, 0x90CE, 0xADA7, 0x90C1, 0xADA8, 0x90C3, 0xADA9, 0x914B, 0xADAA, 0x914A, 0xADAB, 0x91CD, + 0xADAC, 0x9582, 0xADAD, 0x9650, 0xADAE, 0x964B, 0xADAF, 0x964C, 0xADB0, 0x964D, 0xADB1, 0x9762, 0xADB2, 0x9769, 0xADB3, 0x97CB, + 0xADB4, 0x97ED, 0xADB5, 0x97F3, 0xADB6, 0x9801, 0xADB7, 0x98A8, 0xADB8, 0x98DB, 0xADB9, 0x98DF, 0xADBA, 0x9996, 0xADBB, 0x9999, + 0xADBC, 0x4E58, 0xADBD, 0x4EB3, 0xADBE, 0x500C, 0xADBF, 0x500D, 0xADC0, 0x5023, 0xADC1, 0x4FEF, 0xADC2, 0x5026, 0xADC3, 0x5025, + 0xADC4, 0x4FF8, 0xADC5, 0x5029, 0xADC6, 0x5016, 0xADC7, 0x5006, 0xADC8, 0x503C, 0xADC9, 0x501F, 0xADCA, 0x501A, 0xADCB, 0x5012, + 0xADCC, 0x5011, 0xADCD, 0x4FFA, 0xADCE, 0x5000, 0xADCF, 0x5014, 0xADD0, 0x5028, 0xADD1, 0x4FF1, 0xADD2, 0x5021, 0xADD3, 0x500B, + 0xADD4, 0x5019, 0xADD5, 0x5018, 0xADD6, 0x4FF3, 0xADD7, 0x4FEE, 0xADD8, 0x502D, 0xADD9, 0x502A, 0xADDA, 0x4FFE, 0xADDB, 0x502B, + 0xADDC, 0x5009, 0xADDD, 0x517C, 0xADDE, 0x51A4, 0xADDF, 0x51A5, 0xADE0, 0x51A2, 0xADE1, 0x51CD, 0xADE2, 0x51CC, 0xADE3, 0x51C6, + 0xADE4, 0x51CB, 0xADE5, 0x5256, 0xADE6, 0x525C, 0xADE7, 0x5254, 0xADE8, 0x525B, 0xADE9, 0x525D, 0xADEA, 0x532A, 0xADEB, 0x537F, + 0xADEC, 0x539F, 0xADED, 0x539D, 0xADEE, 0x53DF, 0xADEF, 0x54E8, 0xADF0, 0x5510, 0xADF1, 0x5501, 0xADF2, 0x5537, 0xADF3, 0x54FC, + 0xADF4, 0x54E5, 0xADF5, 0x54F2, 0xADF6, 0x5506, 0xADF7, 0x54FA, 0xADF8, 0x5514, 0xADF9, 0x54E9, 0xADFA, 0x54ED, 0xADFB, 0x54E1, + 0xADFC, 0x5509, 0xADFD, 0x54EE, 0xADFE, 0x54EA, 0xAE40, 0x54E6, 0xAE41, 0x5527, 0xAE42, 0x5507, 0xAE43, 0x54FD, 0xAE44, 0x550F, + 0xAE45, 0x5703, 0xAE46, 0x5704, 0xAE47, 0x57C2, 0xAE48, 0x57D4, 0xAE49, 0x57CB, 0xAE4A, 0x57C3, 0xAE4B, 0x5809, 0xAE4C, 0x590F, + 0xAE4D, 0x5957, 0xAE4E, 0x5958, 0xAE4F, 0x595A, 0xAE50, 0x5A11, 0xAE51, 0x5A18, 0xAE52, 0x5A1C, 0xAE53, 0x5A1F, 0xAE54, 0x5A1B, + 0xAE55, 0x5A13, 0xAE56, 0x59EC, 0xAE57, 0x5A20, 0xAE58, 0x5A23, 0xAE59, 0x5A29, 0xAE5A, 0x5A25, 0xAE5B, 0x5A0C, 0xAE5C, 0x5A09, + 0xAE5D, 0x5B6B, 0xAE5E, 0x5C58, 0xAE5F, 0x5BB0, 0xAE60, 0x5BB3, 0xAE61, 0x5BB6, 0xAE62, 0x5BB4, 0xAE63, 0x5BAE, 0xAE64, 0x5BB5, + 0xAE65, 0x5BB9, 0xAE66, 0x5BB8, 0xAE67, 0x5C04, 0xAE68, 0x5C51, 0xAE69, 0x5C55, 0xAE6A, 0x5C50, 0xAE6B, 0x5CED, 0xAE6C, 0x5CFD, + 0xAE6D, 0x5CFB, 0xAE6E, 0x5CEA, 0xAE6F, 0x5CE8, 0xAE70, 0x5CF0, 0xAE71, 0x5CF6, 0xAE72, 0x5D01, 0xAE73, 0x5CF4, 0xAE74, 0x5DEE, + 0xAE75, 0x5E2D, 0xAE76, 0x5E2B, 0xAE77, 0x5EAB, 0xAE78, 0x5EAD, 0xAE79, 0x5EA7, 0xAE7A, 0x5F31, 0xAE7B, 0x5F92, 0xAE7C, 0x5F91, + 0xAE7D, 0x5F90, 0xAE7E, 0x6059, 0xAEA1, 0x6063, 0xAEA2, 0x6065, 0xAEA3, 0x6050, 0xAEA4, 0x6055, 0xAEA5, 0x606D, 0xAEA6, 0x6069, + 0xAEA7, 0x606F, 0xAEA8, 0x6084, 0xAEA9, 0x609F, 0xAEAA, 0x609A, 0xAEAB, 0x608D, 0xAEAC, 0x6094, 0xAEAD, 0x608C, 0xAEAE, 0x6085, + 0xAEAF, 0x6096, 0xAEB0, 0x6247, 0xAEB1, 0x62F3, 0xAEB2, 0x6308, 0xAEB3, 0x62FF, 0xAEB4, 0x634E, 0xAEB5, 0x633E, 0xAEB6, 0x632F, + 0xAEB7, 0x6355, 0xAEB8, 0x6342, 0xAEB9, 0x6346, 0xAEBA, 0x634F, 0xAEBB, 0x6349, 0xAEBC, 0x633A, 0xAEBD, 0x6350, 0xAEBE, 0x633D, + 0xAEBF, 0x632A, 0xAEC0, 0x632B, 0xAEC1, 0x6328, 0xAEC2, 0x634D, 0xAEC3, 0x634C, 0xAEC4, 0x6548, 0xAEC5, 0x6549, 0xAEC6, 0x6599, + 0xAEC7, 0x65C1, 0xAEC8, 0x65C5, 0xAEC9, 0x6642, 0xAECA, 0x6649, 0xAECB, 0x664F, 0xAECC, 0x6643, 0xAECD, 0x6652, 0xAECE, 0x664C, + 0xAECF, 0x6645, 0xAED0, 0x6641, 0xAED1, 0x66F8, 0xAED2, 0x6714, 0xAED3, 0x6715, 0xAED4, 0x6717, 0xAED5, 0x6821, 0xAED6, 0x6838, + 0xAED7, 0x6848, 0xAED8, 0x6846, 0xAED9, 0x6853, 0xAEDA, 0x6839, 0xAEDB, 0x6842, 0xAEDC, 0x6854, 0xAEDD, 0x6829, 0xAEDE, 0x68B3, + 0xAEDF, 0x6817, 0xAEE0, 0x684C, 0xAEE1, 0x6851, 0xAEE2, 0x683D, 0xAEE3, 0x67F4, 0xAEE4, 0x6850, 0xAEE5, 0x6840, 0xAEE6, 0x683C, + 0xAEE7, 0x6843, 0xAEE8, 0x682A, 0xAEE9, 0x6845, 0xAEEA, 0x6813, 0xAEEB, 0x6818, 0xAEEC, 0x6841, 0xAEED, 0x6B8A, 0xAEEE, 0x6B89, + 0xAEEF, 0x6BB7, 0xAEF0, 0x6C23, 0xAEF1, 0x6C27, 0xAEF2, 0x6C28, 0xAEF3, 0x6C26, 0xAEF4, 0x6C24, 0xAEF5, 0x6CF0, 0xAEF6, 0x6D6A, + 0xAEF7, 0x6D95, 0xAEF8, 0x6D88, 0xAEF9, 0x6D87, 0xAEFA, 0x6D66, 0xAEFB, 0x6D78, 0xAEFC, 0x6D77, 0xAEFD, 0x6D59, 0xAEFE, 0x6D93, + 0xAF40, 0x6D6C, 0xAF41, 0x6D89, 0xAF42, 0x6D6E, 0xAF43, 0x6D5A, 0xAF44, 0x6D74, 0xAF45, 0x6D69, 0xAF46, 0x6D8C, 0xAF47, 0x6D8A, + 0xAF48, 0x6D79, 0xAF49, 0x6D85, 0xAF4A, 0x6D65, 0xAF4B, 0x6D94, 0xAF4C, 0x70CA, 0xAF4D, 0x70D8, 0xAF4E, 0x70E4, 0xAF4F, 0x70D9, + 0xAF50, 0x70C8, 0xAF51, 0x70CF, 0xAF52, 0x7239, 0xAF53, 0x7279, 0xAF54, 0x72FC, 0xAF55, 0x72F9, 0xAF56, 0x72FD, 0xAF57, 0x72F8, + 0xAF58, 0x72F7, 0xAF59, 0x7386, 0xAF5A, 0x73ED, 0xAF5B, 0x7409, 0xAF5C, 0x73EE, 0xAF5D, 0x73E0, 0xAF5E, 0x73EA, 0xAF5F, 0x73DE, + 0xAF60, 0x7554, 0xAF61, 0x755D, 0xAF62, 0x755C, 0xAF63, 0x755A, 0xAF64, 0x7559, 0xAF65, 0x75BE, 0xAF66, 0x75C5, 0xAF67, 0x75C7, + 0xAF68, 0x75B2, 0xAF69, 0x75B3, 0xAF6A, 0x75BD, 0xAF6B, 0x75BC, 0xAF6C, 0x75B9, 0xAF6D, 0x75C2, 0xAF6E, 0x75B8, 0xAF6F, 0x768B, + 0xAF70, 0x76B0, 0xAF71, 0x76CA, 0xAF72, 0x76CD, 0xAF73, 0x76CE, 0xAF74, 0x7729, 0xAF75, 0x771F, 0xAF76, 0x7720, 0xAF77, 0x7728, + 0xAF78, 0x77E9, 0xAF79, 0x7830, 0xAF7A, 0x7827, 0xAF7B, 0x7838, 0xAF7C, 0x781D, 0xAF7D, 0x7834, 0xAF7E, 0x7837, 0xAFA1, 0x7825, + 0xAFA2, 0x782D, 0xAFA3, 0x7820, 0xAFA4, 0x781F, 0xAFA5, 0x7832, 0xAFA6, 0x7955, 0xAFA7, 0x7950, 0xAFA8, 0x7960, 0xAFA9, 0x795F, + 0xAFAA, 0x7956, 0xAFAB, 0x795E, 0xAFAC, 0x795D, 0xAFAD, 0x7957, 0xAFAE, 0x795A, 0xAFAF, 0x79E4, 0xAFB0, 0x79E3, 0xAFB1, 0x79E7, + 0xAFB2, 0x79DF, 0xAFB3, 0x79E6, 0xAFB4, 0x79E9, 0xAFB5, 0x79D8, 0xAFB6, 0x7A84, 0xAFB7, 0x7A88, 0xAFB8, 0x7AD9, 0xAFB9, 0x7B06, + 0xAFBA, 0x7B11, 0xAFBB, 0x7C89, 0xAFBC, 0x7D21, 0xAFBD, 0x7D17, 0xAFBE, 0x7D0B, 0xAFBF, 0x7D0A, 0xAFC0, 0x7D20, 0xAFC1, 0x7D22, + 0xAFC2, 0x7D14, 0xAFC3, 0x7D10, 0xAFC4, 0x7D15, 0xAFC5, 0x7D1A, 0xAFC6, 0x7D1C, 0xAFC7, 0x7D0D, 0xAFC8, 0x7D19, 0xAFC9, 0x7D1B, + 0xAFCA, 0x7F3A, 0xAFCB, 0x7F5F, 0xAFCC, 0x7F94, 0xAFCD, 0x7FC5, 0xAFCE, 0x7FC1, 0xAFCF, 0x8006, 0xAFD0, 0x8018, 0xAFD1, 0x8015, + 0xAFD2, 0x8019, 0xAFD3, 0x8017, 0xAFD4, 0x803D, 0xAFD5, 0x803F, 0xAFD6, 0x80F1, 0xAFD7, 0x8102, 0xAFD8, 0x80F0, 0xAFD9, 0x8105, + 0xAFDA, 0x80ED, 0xAFDB, 0x80F4, 0xAFDC, 0x8106, 0xAFDD, 0x80F8, 0xAFDE, 0x80F3, 0xAFDF, 0x8108, 0xAFE0, 0x80FD, 0xAFE1, 0x810A, + 0xAFE2, 0x80FC, 0xAFE3, 0x80EF, 0xAFE4, 0x81ED, 0xAFE5, 0x81EC, 0xAFE6, 0x8200, 0xAFE7, 0x8210, 0xAFE8, 0x822A, 0xAFE9, 0x822B, + 0xAFEA, 0x8228, 0xAFEB, 0x822C, 0xAFEC, 0x82BB, 0xAFED, 0x832B, 0xAFEE, 0x8352, 0xAFEF, 0x8354, 0xAFF0, 0x834A, 0xAFF1, 0x8338, + 0xAFF2, 0x8350, 0xAFF3, 0x8349, 0xAFF4, 0x8335, 0xAFF5, 0x8334, 0xAFF6, 0x834F, 0xAFF7, 0x8332, 0xAFF8, 0x8339, 0xAFF9, 0x8336, + 0xAFFA, 0x8317, 0xAFFB, 0x8340, 0xAFFC, 0x8331, 0xAFFD, 0x8328, 0xAFFE, 0x8343, 0xB040, 0x8654, 0xB041, 0x868A, 0xB042, 0x86AA, + 0xB043, 0x8693, 0xB044, 0x86A4, 0xB045, 0x86A9, 0xB046, 0x868C, 0xB047, 0x86A3, 0xB048, 0x869C, 0xB049, 0x8870, 0xB04A, 0x8877, + 0xB04B, 0x8881, 0xB04C, 0x8882, 0xB04D, 0x887D, 0xB04E, 0x8879, 0xB04F, 0x8A18, 0xB050, 0x8A10, 0xB051, 0x8A0E, 0xB052, 0x8A0C, + 0xB053, 0x8A15, 0xB054, 0x8A0A, 0xB055, 0x8A17, 0xB056, 0x8A13, 0xB057, 0x8A16, 0xB058, 0x8A0F, 0xB059, 0x8A11, 0xB05A, 0x8C48, + 0xB05B, 0x8C7A, 0xB05C, 0x8C79, 0xB05D, 0x8CA1, 0xB05E, 0x8CA2, 0xB05F, 0x8D77, 0xB060, 0x8EAC, 0xB061, 0x8ED2, 0xB062, 0x8ED4, + 0xB063, 0x8ECF, 0xB064, 0x8FB1, 0xB065, 0x9001, 0xB066, 0x9006, 0xB067, 0x8FF7, 0xB068, 0x9000, 0xB069, 0x8FFA, 0xB06A, 0x8FF4, + 0xB06B, 0x9003, 0xB06C, 0x8FFD, 0xB06D, 0x9005, 0xB06E, 0x8FF8, 0xB06F, 0x9095, 0xB070, 0x90E1, 0xB071, 0x90DD, 0xB072, 0x90E2, + 0xB073, 0x9152, 0xB074, 0x914D, 0xB075, 0x914C, 0xB076, 0x91D8, 0xB077, 0x91DD, 0xB078, 0x91D7, 0xB079, 0x91DC, 0xB07A, 0x91D9, + 0xB07B, 0x9583, 0xB07C, 0x9662, 0xB07D, 0x9663, 0xB07E, 0x9661, 0xB0A1, 0x965B, 0xB0A2, 0x965D, 0xB0A3, 0x9664, 0xB0A4, 0x9658, + 0xB0A5, 0x965E, 0xB0A6, 0x96BB, 0xB0A7, 0x98E2, 0xB0A8, 0x99AC, 0xB0A9, 0x9AA8, 0xB0AA, 0x9AD8, 0xB0AB, 0x9B25, 0xB0AC, 0x9B32, + 0xB0AD, 0x9B3C, 0xB0AE, 0x4E7E, 0xB0AF, 0x507A, 0xB0B0, 0x507D, 0xB0B1, 0x505C, 0xB0B2, 0x5047, 0xB0B3, 0x5043, 0xB0B4, 0x504C, + 0xB0B5, 0x505A, 0xB0B6, 0x5049, 0xB0B7, 0x5065, 0xB0B8, 0x5076, 0xB0B9, 0x504E, 0xB0BA, 0x5055, 0xB0BB, 0x5075, 0xB0BC, 0x5074, + 0xB0BD, 0x5077, 0xB0BE, 0x504F, 0xB0BF, 0x500F, 0xB0C0, 0x506F, 0xB0C1, 0x506D, 0xB0C2, 0x515C, 0xB0C3, 0x5195, 0xB0C4, 0x51F0, + 0xB0C5, 0x526A, 0xB0C6, 0x526F, 0xB0C7, 0x52D2, 0xB0C8, 0x52D9, 0xB0C9, 0x52D8, 0xB0CA, 0x52D5, 0xB0CB, 0x5310, 0xB0CC, 0x530F, + 0xB0CD, 0x5319, 0xB0CE, 0x533F, 0xB0CF, 0x5340, 0xB0D0, 0x533E, 0xB0D1, 0x53C3, 0xB0D2, 0x66FC, 0xB0D3, 0x5546, 0xB0D4, 0x556A, + 0xB0D5, 0x5566, 0xB0D6, 0x5544, 0xB0D7, 0x555E, 0xB0D8, 0x5561, 0xB0D9, 0x5543, 0xB0DA, 0x554A, 0xB0DB, 0x5531, 0xB0DC, 0x5556, + 0xB0DD, 0x554F, 0xB0DE, 0x5555, 0xB0DF, 0x552F, 0xB0E0, 0x5564, 0xB0E1, 0x5538, 0xB0E2, 0x552E, 0xB0E3, 0x555C, 0xB0E4, 0x552C, + 0xB0E5, 0x5563, 0xB0E6, 0x5533, 0xB0E7, 0x5541, 0xB0E8, 0x5557, 0xB0E9, 0x5708, 0xB0EA, 0x570B, 0xB0EB, 0x5709, 0xB0EC, 0x57DF, + 0xB0ED, 0x5805, 0xB0EE, 0x580A, 0xB0EF, 0x5806, 0xB0F0, 0x57E0, 0xB0F1, 0x57E4, 0xB0F2, 0x57FA, 0xB0F3, 0x5802, 0xB0F4, 0x5835, + 0xB0F5, 0x57F7, 0xB0F6, 0x57F9, 0xB0F7, 0x5920, 0xB0F8, 0x5962, 0xB0F9, 0x5A36, 0xB0FA, 0x5A41, 0xB0FB, 0x5A49, 0xB0FC, 0x5A66, + 0xB0FD, 0x5A6A, 0xB0FE, 0x5A40, 0xB140, 0x5A3C, 0xB141, 0x5A62, 0xB142, 0x5A5A, 0xB143, 0x5A46, 0xB144, 0x5A4A, 0xB145, 0x5B70, + 0xB146, 0x5BC7, 0xB147, 0x5BC5, 0xB148, 0x5BC4, 0xB149, 0x5BC2, 0xB14A, 0x5BBF, 0xB14B, 0x5BC6, 0xB14C, 0x5C09, 0xB14D, 0x5C08, + 0xB14E, 0x5C07, 0xB14F, 0x5C60, 0xB150, 0x5C5C, 0xB151, 0x5C5D, 0xB152, 0x5D07, 0xB153, 0x5D06, 0xB154, 0x5D0E, 0xB155, 0x5D1B, + 0xB156, 0x5D16, 0xB157, 0x5D22, 0xB158, 0x5D11, 0xB159, 0x5D29, 0xB15A, 0x5D14, 0xB15B, 0x5D19, 0xB15C, 0x5D24, 0xB15D, 0x5D27, + 0xB15E, 0x5D17, 0xB15F, 0x5DE2, 0xB160, 0x5E38, 0xB161, 0x5E36, 0xB162, 0x5E33, 0xB163, 0x5E37, 0xB164, 0x5EB7, 0xB165, 0x5EB8, + 0xB166, 0x5EB6, 0xB167, 0x5EB5, 0xB168, 0x5EBE, 0xB169, 0x5F35, 0xB16A, 0x5F37, 0xB16B, 0x5F57, 0xB16C, 0x5F6C, 0xB16D, 0x5F69, + 0xB16E, 0x5F6B, 0xB16F, 0x5F97, 0xB170, 0x5F99, 0xB171, 0x5F9E, 0xB172, 0x5F98, 0xB173, 0x5FA1, 0xB174, 0x5FA0, 0xB175, 0x5F9C, + 0xB176, 0x607F, 0xB177, 0x60A3, 0xB178, 0x6089, 0xB179, 0x60A0, 0xB17A, 0x60A8, 0xB17B, 0x60CB, 0xB17C, 0x60B4, 0xB17D, 0x60E6, + 0xB17E, 0x60BD, 0xB1A1, 0x60C5, 0xB1A2, 0x60BB, 0xB1A3, 0x60B5, 0xB1A4, 0x60DC, 0xB1A5, 0x60BC, 0xB1A6, 0x60D8, 0xB1A7, 0x60D5, + 0xB1A8, 0x60C6, 0xB1A9, 0x60DF, 0xB1AA, 0x60B8, 0xB1AB, 0x60DA, 0xB1AC, 0x60C7, 0xB1AD, 0x621A, 0xB1AE, 0x621B, 0xB1AF, 0x6248, + 0xB1B0, 0x63A0, 0xB1B1, 0x63A7, 0xB1B2, 0x6372, 0xB1B3, 0x6396, 0xB1B4, 0x63A2, 0xB1B5, 0x63A5, 0xB1B6, 0x6377, 0xB1B7, 0x6367, + 0xB1B8, 0x6398, 0xB1B9, 0x63AA, 0xB1BA, 0x6371, 0xB1BB, 0x63A9, 0xB1BC, 0x6389, 0xB1BD, 0x6383, 0xB1BE, 0x639B, 0xB1BF, 0x636B, + 0xB1C0, 0x63A8, 0xB1C1, 0x6384, 0xB1C2, 0x6388, 0xB1C3, 0x6399, 0xB1C4, 0x63A1, 0xB1C5, 0x63AC, 0xB1C6, 0x6392, 0xB1C7, 0x638F, + 0xB1C8, 0x6380, 0xB1C9, 0x637B, 0xB1CA, 0x6369, 0xB1CB, 0x6368, 0xB1CC, 0x637A, 0xB1CD, 0x655D, 0xB1CE, 0x6556, 0xB1CF, 0x6551, + 0xB1D0, 0x6559, 0xB1D1, 0x6557, 0xB1D2, 0x555F, 0xB1D3, 0x654F, 0xB1D4, 0x6558, 0xB1D5, 0x6555, 0xB1D6, 0x6554, 0xB1D7, 0x659C, + 0xB1D8, 0x659B, 0xB1D9, 0x65AC, 0xB1DA, 0x65CF, 0xB1DB, 0x65CB, 0xB1DC, 0x65CC, 0xB1DD, 0x65CE, 0xB1DE, 0x665D, 0xB1DF, 0x665A, + 0xB1E0, 0x6664, 0xB1E1, 0x6668, 0xB1E2, 0x6666, 0xB1E3, 0x665E, 0xB1E4, 0x66F9, 0xB1E5, 0x52D7, 0xB1E6, 0x671B, 0xB1E7, 0x6881, + 0xB1E8, 0x68AF, 0xB1E9, 0x68A2, 0xB1EA, 0x6893, 0xB1EB, 0x68B5, 0xB1EC, 0x687F, 0xB1ED, 0x6876, 0xB1EE, 0x68B1, 0xB1EF, 0x68A7, + 0xB1F0, 0x6897, 0xB1F1, 0x68B0, 0xB1F2, 0x6883, 0xB1F3, 0x68C4, 0xB1F4, 0x68AD, 0xB1F5, 0x6886, 0xB1F6, 0x6885, 0xB1F7, 0x6894, + 0xB1F8, 0x689D, 0xB1F9, 0x68A8, 0xB1FA, 0x689F, 0xB1FB, 0x68A1, 0xB1FC, 0x6882, 0xB1FD, 0x6B32, 0xB1FE, 0x6BBA, 0xB240, 0x6BEB, + 0xB241, 0x6BEC, 0xB242, 0x6C2B, 0xB243, 0x6D8E, 0xB244, 0x6DBC, 0xB245, 0x6DF3, 0xB246, 0x6DD9, 0xB247, 0x6DB2, 0xB248, 0x6DE1, + 0xB249, 0x6DCC, 0xB24A, 0x6DE4, 0xB24B, 0x6DFB, 0xB24C, 0x6DFA, 0xB24D, 0x6E05, 0xB24E, 0x6DC7, 0xB24F, 0x6DCB, 0xB250, 0x6DAF, + 0xB251, 0x6DD1, 0xB252, 0x6DAE, 0xB253, 0x6DDE, 0xB254, 0x6DF9, 0xB255, 0x6DB8, 0xB256, 0x6DF7, 0xB257, 0x6DF5, 0xB258, 0x6DC5, + 0xB259, 0x6DD2, 0xB25A, 0x6E1A, 0xB25B, 0x6DB5, 0xB25C, 0x6DDA, 0xB25D, 0x6DEB, 0xB25E, 0x6DD8, 0xB25F, 0x6DEA, 0xB260, 0x6DF1, + 0xB261, 0x6DEE, 0xB262, 0x6DE8, 0xB263, 0x6DC6, 0xB264, 0x6DC4, 0xB265, 0x6DAA, 0xB266, 0x6DEC, 0xB267, 0x6DBF, 0xB268, 0x6DE6, + 0xB269, 0x70F9, 0xB26A, 0x7109, 0xB26B, 0x710A, 0xB26C, 0x70FD, 0xB26D, 0x70EF, 0xB26E, 0x723D, 0xB26F, 0x727D, 0xB270, 0x7281, + 0xB271, 0x731C, 0xB272, 0x731B, 0xB273, 0x7316, 0xB274, 0x7313, 0xB275, 0x7319, 0xB276, 0x7387, 0xB277, 0x7405, 0xB278, 0x740A, + 0xB279, 0x7403, 0xB27A, 0x7406, 0xB27B, 0x73FE, 0xB27C, 0x740D, 0xB27D, 0x74E0, 0xB27E, 0x74F6, 0xB2A1, 0x74F7, 0xB2A2, 0x751C, + 0xB2A3, 0x7522, 0xB2A4, 0x7565, 0xB2A5, 0x7566, 0xB2A6, 0x7562, 0xB2A7, 0x7570, 0xB2A8, 0x758F, 0xB2A9, 0x75D4, 0xB2AA, 0x75D5, + 0xB2AB, 0x75B5, 0xB2AC, 0x75CA, 0xB2AD, 0x75CD, 0xB2AE, 0x768E, 0xB2AF, 0x76D4, 0xB2B0, 0x76D2, 0xB2B1, 0x76DB, 0xB2B2, 0x7737, + 0xB2B3, 0x773E, 0xB2B4, 0x773C, 0xB2B5, 0x7736, 0xB2B6, 0x7738, 0xB2B7, 0x773A, 0xB2B8, 0x786B, 0xB2B9, 0x7843, 0xB2BA, 0x784E, + 0xB2BB, 0x7965, 0xB2BC, 0x7968, 0xB2BD, 0x796D, 0xB2BE, 0x79FB, 0xB2BF, 0x7A92, 0xB2C0, 0x7A95, 0xB2C1, 0x7B20, 0xB2C2, 0x7B28, + 0xB2C3, 0x7B1B, 0xB2C4, 0x7B2C, 0xB2C5, 0x7B26, 0xB2C6, 0x7B19, 0xB2C7, 0x7B1E, 0xB2C8, 0x7B2E, 0xB2C9, 0x7C92, 0xB2CA, 0x7C97, + 0xB2CB, 0x7C95, 0xB2CC, 0x7D46, 0xB2CD, 0x7D43, 0xB2CE, 0x7D71, 0xB2CF, 0x7D2E, 0xB2D0, 0x7D39, 0xB2D1, 0x7D3C, 0xB2D2, 0x7D40, + 0xB2D3, 0x7D30, 0xB2D4, 0x7D33, 0xB2D5, 0x7D44, 0xB2D6, 0x7D2F, 0xB2D7, 0x7D42, 0xB2D8, 0x7D32, 0xB2D9, 0x7D31, 0xB2DA, 0x7F3D, + 0xB2DB, 0x7F9E, 0xB2DC, 0x7F9A, 0xB2DD, 0x7FCC, 0xB2DE, 0x7FCE, 0xB2DF, 0x7FD2, 0xB2E0, 0x801C, 0xB2E1, 0x804A, 0xB2E2, 0x8046, + 0xB2E3, 0x812F, 0xB2E4, 0x8116, 0xB2E5, 0x8123, 0xB2E6, 0x812B, 0xB2E7, 0x8129, 0xB2E8, 0x8130, 0xB2E9, 0x8124, 0xB2EA, 0x8202, + 0xB2EB, 0x8235, 0xB2EC, 0x8237, 0xB2ED, 0x8236, 0xB2EE, 0x8239, 0xB2EF, 0x838E, 0xB2F0, 0x839E, 0xB2F1, 0x8398, 0xB2F2, 0x8378, + 0xB2F3, 0x83A2, 0xB2F4, 0x8396, 0xB2F5, 0x83BD, 0xB2F6, 0x83AB, 0xB2F7, 0x8392, 0xB2F8, 0x838A, 0xB2F9, 0x8393, 0xB2FA, 0x8389, + 0xB2FB, 0x83A0, 0xB2FC, 0x8377, 0xB2FD, 0x837B, 0xB2FE, 0x837C, 0xB340, 0x8386, 0xB341, 0x83A7, 0xB342, 0x8655, 0xB343, 0x5F6A, + 0xB344, 0x86C7, 0xB345, 0x86C0, 0xB346, 0x86B6, 0xB347, 0x86C4, 0xB348, 0x86B5, 0xB349, 0x86C6, 0xB34A, 0x86CB, 0xB34B, 0x86B1, + 0xB34C, 0x86AF, 0xB34D, 0x86C9, 0xB34E, 0x8853, 0xB34F, 0x889E, 0xB350, 0x8888, 0xB351, 0x88AB, 0xB352, 0x8892, 0xB353, 0x8896, + 0xB354, 0x888D, 0xB355, 0x888B, 0xB356, 0x8993, 0xB357, 0x898F, 0xB358, 0x8A2A, 0xB359, 0x8A1D, 0xB35A, 0x8A23, 0xB35B, 0x8A25, + 0xB35C, 0x8A31, 0xB35D, 0x8A2D, 0xB35E, 0x8A1F, 0xB35F, 0x8A1B, 0xB360, 0x8A22, 0xB361, 0x8C49, 0xB362, 0x8C5A, 0xB363, 0x8CA9, + 0xB364, 0x8CAC, 0xB365, 0x8CAB, 0xB366, 0x8CA8, 0xB367, 0x8CAA, 0xB368, 0x8CA7, 0xB369, 0x8D67, 0xB36A, 0x8D66, 0xB36B, 0x8DBE, + 0xB36C, 0x8DBA, 0xB36D, 0x8EDB, 0xB36E, 0x8EDF, 0xB36F, 0x9019, 0xB370, 0x900D, 0xB371, 0x901A, 0xB372, 0x9017, 0xB373, 0x9023, + 0xB374, 0x901F, 0xB375, 0x901D, 0xB376, 0x9010, 0xB377, 0x9015, 0xB378, 0x901E, 0xB379, 0x9020, 0xB37A, 0x900F, 0xB37B, 0x9022, + 0xB37C, 0x9016, 0xB37D, 0x901B, 0xB37E, 0x9014, 0xB3A1, 0x90E8, 0xB3A2, 0x90ED, 0xB3A3, 0x90FD, 0xB3A4, 0x9157, 0xB3A5, 0x91CE, + 0xB3A6, 0x91F5, 0xB3A7, 0x91E6, 0xB3A8, 0x91E3, 0xB3A9, 0x91E7, 0xB3AA, 0x91ED, 0xB3AB, 0x91E9, 0xB3AC, 0x9589, 0xB3AD, 0x966A, + 0xB3AE, 0x9675, 0xB3AF, 0x9673, 0xB3B0, 0x9678, 0xB3B1, 0x9670, 0xB3B2, 0x9674, 0xB3B3, 0x9676, 0xB3B4, 0x9677, 0xB3B5, 0x966C, + 0xB3B6, 0x96C0, 0xB3B7, 0x96EA, 0xB3B8, 0x96E9, 0xB3B9, 0x7AE0, 0xB3BA, 0x7ADF, 0xB3BB, 0x9802, 0xB3BC, 0x9803, 0xB3BD, 0x9B5A, + 0xB3BE, 0x9CE5, 0xB3BF, 0x9E75, 0xB3C0, 0x9E7F, 0xB3C1, 0x9EA5, 0xB3C2, 0x9EBB, 0xB3C3, 0x50A2, 0xB3C4, 0x508D, 0xB3C5, 0x5085, + 0xB3C6, 0x5099, 0xB3C7, 0x5091, 0xB3C8, 0x5080, 0xB3C9, 0x5096, 0xB3CA, 0x5098, 0xB3CB, 0x509A, 0xB3CC, 0x6700, 0xB3CD, 0x51F1, + 0xB3CE, 0x5272, 0xB3CF, 0x5274, 0xB3D0, 0x5275, 0xB3D1, 0x5269, 0xB3D2, 0x52DE, 0xB3D3, 0x52DD, 0xB3D4, 0x52DB, 0xB3D5, 0x535A, + 0xB3D6, 0x53A5, 0xB3D7, 0x557B, 0xB3D8, 0x5580, 0xB3D9, 0x55A7, 0xB3DA, 0x557C, 0xB3DB, 0x558A, 0xB3DC, 0x559D, 0xB3DD, 0x5598, + 0xB3DE, 0x5582, 0xB3DF, 0x559C, 0xB3E0, 0x55AA, 0xB3E1, 0x5594, 0xB3E2, 0x5587, 0xB3E3, 0x558B, 0xB3E4, 0x5583, 0xB3E5, 0x55B3, + 0xB3E6, 0x55AE, 0xB3E7, 0x559F, 0xB3E8, 0x553E, 0xB3E9, 0x55B2, 0xB3EA, 0x559A, 0xB3EB, 0x55BB, 0xB3EC, 0x55AC, 0xB3ED, 0x55B1, + 0xB3EE, 0x557E, 0xB3EF, 0x5589, 0xB3F0, 0x55AB, 0xB3F1, 0x5599, 0xB3F2, 0x570D, 0xB3F3, 0x582F, 0xB3F4, 0x582A, 0xB3F5, 0x5834, + 0xB3F6, 0x5824, 0xB3F7, 0x5830, 0xB3F8, 0x5831, 0xB3F9, 0x5821, 0xB3FA, 0x581D, 0xB3FB, 0x5820, 0xB3FC, 0x58F9, 0xB3FD, 0x58FA, + 0xB3FE, 0x5960, 0xB440, 0x5A77, 0xB441, 0x5A9A, 0xB442, 0x5A7F, 0xB443, 0x5A92, 0xB444, 0x5A9B, 0xB445, 0x5AA7, 0xB446, 0x5B73, + 0xB447, 0x5B71, 0xB448, 0x5BD2, 0xB449, 0x5BCC, 0xB44A, 0x5BD3, 0xB44B, 0x5BD0, 0xB44C, 0x5C0A, 0xB44D, 0x5C0B, 0xB44E, 0x5C31, + 0xB44F, 0x5D4C, 0xB450, 0x5D50, 0xB451, 0x5D34, 0xB452, 0x5D47, 0xB453, 0x5DFD, 0xB454, 0x5E45, 0xB455, 0x5E3D, 0xB456, 0x5E40, + 0xB457, 0x5E43, 0xB458, 0x5E7E, 0xB459, 0x5ECA, 0xB45A, 0x5EC1, 0xB45B, 0x5EC2, 0xB45C, 0x5EC4, 0xB45D, 0x5F3C, 0xB45E, 0x5F6D, + 0xB45F, 0x5FA9, 0xB460, 0x5FAA, 0xB461, 0x5FA8, 0xB462, 0x60D1, 0xB463, 0x60E1, 0xB464, 0x60B2, 0xB465, 0x60B6, 0xB466, 0x60E0, + 0xB467, 0x611C, 0xB468, 0x6123, 0xB469, 0x60FA, 0xB46A, 0x6115, 0xB46B, 0x60F0, 0xB46C, 0x60FB, 0xB46D, 0x60F4, 0xB46E, 0x6168, + 0xB46F, 0x60F1, 0xB470, 0x610E, 0xB471, 0x60F6, 0xB472, 0x6109, 0xB473, 0x6100, 0xB474, 0x6112, 0xB475, 0x621F, 0xB476, 0x6249, + 0xB477, 0x63A3, 0xB478, 0x638C, 0xB479, 0x63CF, 0xB47A, 0x63C0, 0xB47B, 0x63E9, 0xB47C, 0x63C9, 0xB47D, 0x63C6, 0xB47E, 0x63CD, + 0xB4A1, 0x63D2, 0xB4A2, 0x63E3, 0xB4A3, 0x63D0, 0xB4A4, 0x63E1, 0xB4A5, 0x63D6, 0xB4A6, 0x63ED, 0xB4A7, 0x63EE, 0xB4A8, 0x6376, + 0xB4A9, 0x63F4, 0xB4AA, 0x63EA, 0xB4AB, 0x63DB, 0xB4AC, 0x6452, 0xB4AD, 0x63DA, 0xB4AE, 0x63F9, 0xB4AF, 0x655E, 0xB4B0, 0x6566, + 0xB4B1, 0x6562, 0xB4B2, 0x6563, 0xB4B3, 0x6591, 0xB4B4, 0x6590, 0xB4B5, 0x65AF, 0xB4B6, 0x666E, 0xB4B7, 0x6670, 0xB4B8, 0x6674, + 0xB4B9, 0x6676, 0xB4BA, 0x666F, 0xB4BB, 0x6691, 0xB4BC, 0x667A, 0xB4BD, 0x667E, 0xB4BE, 0x6677, 0xB4BF, 0x66FE, 0xB4C0, 0x66FF, + 0xB4C1, 0x671F, 0xB4C2, 0x671D, 0xB4C3, 0x68FA, 0xB4C4, 0x68D5, 0xB4C5, 0x68E0, 0xB4C6, 0x68D8, 0xB4C7, 0x68D7, 0xB4C8, 0x6905, + 0xB4C9, 0x68DF, 0xB4CA, 0x68F5, 0xB4CB, 0x68EE, 0xB4CC, 0x68E7, 0xB4CD, 0x68F9, 0xB4CE, 0x68D2, 0xB4CF, 0x68F2, 0xB4D0, 0x68E3, + 0xB4D1, 0x68CB, 0xB4D2, 0x68CD, 0xB4D3, 0x690D, 0xB4D4, 0x6912, 0xB4D5, 0x690E, 0xB4D6, 0x68C9, 0xB4D7, 0x68DA, 0xB4D8, 0x696E, + 0xB4D9, 0x68FB, 0xB4DA, 0x6B3E, 0xB4DB, 0x6B3A, 0xB4DC, 0x6B3D, 0xB4DD, 0x6B98, 0xB4DE, 0x6B96, 0xB4DF, 0x6BBC, 0xB4E0, 0x6BEF, + 0xB4E1, 0x6C2E, 0xB4E2, 0x6C2F, 0xB4E3, 0x6C2C, 0xB4E4, 0x6E2F, 0xB4E5, 0x6E38, 0xB4E6, 0x6E54, 0xB4E7, 0x6E21, 0xB4E8, 0x6E32, + 0xB4E9, 0x6E67, 0xB4EA, 0x6E4A, 0xB4EB, 0x6E20, 0xB4EC, 0x6E25, 0xB4ED, 0x6E23, 0xB4EE, 0x6E1B, 0xB4EF, 0x6E5B, 0xB4F0, 0x6E58, + 0xB4F1, 0x6E24, 0xB4F2, 0x6E56, 0xB4F3, 0x6E6E, 0xB4F4, 0x6E2D, 0xB4F5, 0x6E26, 0xB4F6, 0x6E6F, 0xB4F7, 0x6E34, 0xB4F8, 0x6E4D, + 0xB4F9, 0x6E3A, 0xB4FA, 0x6E2C, 0xB4FB, 0x6E43, 0xB4FC, 0x6E1D, 0xB4FD, 0x6E3E, 0xB4FE, 0x6ECB, 0xB540, 0x6E89, 0xB541, 0x6E19, + 0xB542, 0x6E4E, 0xB543, 0x6E63, 0xB544, 0x6E44, 0xB545, 0x6E72, 0xB546, 0x6E69, 0xB547, 0x6E5F, 0xB548, 0x7119, 0xB549, 0x711A, + 0xB54A, 0x7126, 0xB54B, 0x7130, 0xB54C, 0x7121, 0xB54D, 0x7136, 0xB54E, 0x716E, 0xB54F, 0x711C, 0xB550, 0x724C, 0xB551, 0x7284, + 0xB552, 0x7280, 0xB553, 0x7336, 0xB554, 0x7325, 0xB555, 0x7334, 0xB556, 0x7329, 0xB557, 0x743A, 0xB558, 0x742A, 0xB559, 0x7433, + 0xB55A, 0x7422, 0xB55B, 0x7425, 0xB55C, 0x7435, 0xB55D, 0x7436, 0xB55E, 0x7434, 0xB55F, 0x742F, 0xB560, 0x741B, 0xB561, 0x7426, + 0xB562, 0x7428, 0xB563, 0x7525, 0xB564, 0x7526, 0xB565, 0x756B, 0xB566, 0x756A, 0xB567, 0x75E2, 0xB568, 0x75DB, 0xB569, 0x75E3, + 0xB56A, 0x75D9, 0xB56B, 0x75D8, 0xB56C, 0x75DE, 0xB56D, 0x75E0, 0xB56E, 0x767B, 0xB56F, 0x767C, 0xB570, 0x7696, 0xB571, 0x7693, + 0xB572, 0x76B4, 0xB573, 0x76DC, 0xB574, 0x774F, 0xB575, 0x77ED, 0xB576, 0x785D, 0xB577, 0x786C, 0xB578, 0x786F, 0xB579, 0x7A0D, + 0xB57A, 0x7A08, 0xB57B, 0x7A0B, 0xB57C, 0x7A05, 0xB57D, 0x7A00, 0xB57E, 0x7A98, 0xB5A1, 0x7A97, 0xB5A2, 0x7A96, 0xB5A3, 0x7AE5, + 0xB5A4, 0x7AE3, 0xB5A5, 0x7B49, 0xB5A6, 0x7B56, 0xB5A7, 0x7B46, 0xB5A8, 0x7B50, 0xB5A9, 0x7B52, 0xB5AA, 0x7B54, 0xB5AB, 0x7B4D, + 0xB5AC, 0x7B4B, 0xB5AD, 0x7B4F, 0xB5AE, 0x7B51, 0xB5AF, 0x7C9F, 0xB5B0, 0x7CA5, 0xB5B1, 0x7D5E, 0xB5B2, 0x7D50, 0xB5B3, 0x7D68, + 0xB5B4, 0x7D55, 0xB5B5, 0x7D2B, 0xB5B6, 0x7D6E, 0xB5B7, 0x7D72, 0xB5B8, 0x7D61, 0xB5B9, 0x7D66, 0xB5BA, 0x7D62, 0xB5BB, 0x7D70, + 0xB5BC, 0x7D73, 0xB5BD, 0x5584, 0xB5BE, 0x7FD4, 0xB5BF, 0x7FD5, 0xB5C0, 0x800B, 0xB5C1, 0x8052, 0xB5C2, 0x8085, 0xB5C3, 0x8155, + 0xB5C4, 0x8154, 0xB5C5, 0x814B, 0xB5C6, 0x8151, 0xB5C7, 0x814E, 0xB5C8, 0x8139, 0xB5C9, 0x8146, 0xB5CA, 0x813E, 0xB5CB, 0x814C, + 0xB5CC, 0x8153, 0xB5CD, 0x8174, 0xB5CE, 0x8212, 0xB5CF, 0x821C, 0xB5D0, 0x83E9, 0xB5D1, 0x8403, 0xB5D2, 0x83F8, 0xB5D3, 0x840D, + 0xB5D4, 0x83E0, 0xB5D5, 0x83C5, 0xB5D6, 0x840B, 0xB5D7, 0x83C1, 0xB5D8, 0x83EF, 0xB5D9, 0x83F1, 0xB5DA, 0x83F4, 0xB5DB, 0x8457, + 0xB5DC, 0x840A, 0xB5DD, 0x83F0, 0xB5DE, 0x840C, 0xB5DF, 0x83CC, 0xB5E0, 0x83FD, 0xB5E1, 0x83F2, 0xB5E2, 0x83CA, 0xB5E3, 0x8438, + 0xB5E4, 0x840E, 0xB5E5, 0x8404, 0xB5E6, 0x83DC, 0xB5E7, 0x8407, 0xB5E8, 0x83D4, 0xB5E9, 0x83DF, 0xB5EA, 0x865B, 0xB5EB, 0x86DF, + 0xB5EC, 0x86D9, 0xB5ED, 0x86ED, 0xB5EE, 0x86D4, 0xB5EF, 0x86DB, 0xB5F0, 0x86E4, 0xB5F1, 0x86D0, 0xB5F2, 0x86DE, 0xB5F3, 0x8857, + 0xB5F4, 0x88C1, 0xB5F5, 0x88C2, 0xB5F6, 0x88B1, 0xB5F7, 0x8983, 0xB5F8, 0x8996, 0xB5F9, 0x8A3B, 0xB5FA, 0x8A60, 0xB5FB, 0x8A55, + 0xB5FC, 0x8A5E, 0xB5FD, 0x8A3C, 0xB5FE, 0x8A41, 0xB640, 0x8A54, 0xB641, 0x8A5B, 0xB642, 0x8A50, 0xB643, 0x8A46, 0xB644, 0x8A34, + 0xB645, 0x8A3A, 0xB646, 0x8A36, 0xB647, 0x8A56, 0xB648, 0x8C61, 0xB649, 0x8C82, 0xB64A, 0x8CAF, 0xB64B, 0x8CBC, 0xB64C, 0x8CB3, + 0xB64D, 0x8CBD, 0xB64E, 0x8CC1, 0xB64F, 0x8CBB, 0xB650, 0x8CC0, 0xB651, 0x8CB4, 0xB652, 0x8CB7, 0xB653, 0x8CB6, 0xB654, 0x8CBF, + 0xB655, 0x8CB8, 0xB656, 0x8D8A, 0xB657, 0x8D85, 0xB658, 0x8D81, 0xB659, 0x8DCE, 0xB65A, 0x8DDD, 0xB65B, 0x8DCB, 0xB65C, 0x8DDA, + 0xB65D, 0x8DD1, 0xB65E, 0x8DCC, 0xB65F, 0x8DDB, 0xB660, 0x8DC6, 0xB661, 0x8EFB, 0xB662, 0x8EF8, 0xB663, 0x8EFC, 0xB664, 0x8F9C, + 0xB665, 0x902E, 0xB666, 0x9035, 0xB667, 0x9031, 0xB668, 0x9038, 0xB669, 0x9032, 0xB66A, 0x9036, 0xB66B, 0x9102, 0xB66C, 0x90F5, + 0xB66D, 0x9109, 0xB66E, 0x90FE, 0xB66F, 0x9163, 0xB670, 0x9165, 0xB671, 0x91CF, 0xB672, 0x9214, 0xB673, 0x9215, 0xB674, 0x9223, + 0xB675, 0x9209, 0xB676, 0x921E, 0xB677, 0x920D, 0xB678, 0x9210, 0xB679, 0x9207, 0xB67A, 0x9211, 0xB67B, 0x9594, 0xB67C, 0x958F, + 0xB67D, 0x958B, 0xB67E, 0x9591, 0xB6A1, 0x9593, 0xB6A2, 0x9592, 0xB6A3, 0x958E, 0xB6A4, 0x968A, 0xB6A5, 0x968E, 0xB6A6, 0x968B, + 0xB6A7, 0x967D, 0xB6A8, 0x9685, 0xB6A9, 0x9686, 0xB6AA, 0x968D, 0xB6AB, 0x9672, 0xB6AC, 0x9684, 0xB6AD, 0x96C1, 0xB6AE, 0x96C5, + 0xB6AF, 0x96C4, 0xB6B0, 0x96C6, 0xB6B1, 0x96C7, 0xB6B2, 0x96EF, 0xB6B3, 0x96F2, 0xB6B4, 0x97CC, 0xB6B5, 0x9805, 0xB6B6, 0x9806, + 0xB6B7, 0x9808, 0xB6B8, 0x98E7, 0xB6B9, 0x98EA, 0xB6BA, 0x98EF, 0xB6BB, 0x98E9, 0xB6BC, 0x98F2, 0xB6BD, 0x98ED, 0xB6BE, 0x99AE, + 0xB6BF, 0x99AD, 0xB6C0, 0x9EC3, 0xB6C1, 0x9ECD, 0xB6C2, 0x9ED1, 0xB6C3, 0x4E82, 0xB6C4, 0x50AD, 0xB6C5, 0x50B5, 0xB6C6, 0x50B2, + 0xB6C7, 0x50B3, 0xB6C8, 0x50C5, 0xB6C9, 0x50BE, 0xB6CA, 0x50AC, 0xB6CB, 0x50B7, 0xB6CC, 0x50BB, 0xB6CD, 0x50AF, 0xB6CE, 0x50C7, + 0xB6CF, 0x527F, 0xB6D0, 0x5277, 0xB6D1, 0x527D, 0xB6D2, 0x52DF, 0xB6D3, 0x52E6, 0xB6D4, 0x52E4, 0xB6D5, 0x52E2, 0xB6D6, 0x52E3, + 0xB6D7, 0x532F, 0xB6D8, 0x55DF, 0xB6D9, 0x55E8, 0xB6DA, 0x55D3, 0xB6DB, 0x55E6, 0xB6DC, 0x55CE, 0xB6DD, 0x55DC, 0xB6DE, 0x55C7, + 0xB6DF, 0x55D1, 0xB6E0, 0x55E3, 0xB6E1, 0x55E4, 0xB6E2, 0x55EF, 0xB6E3, 0x55DA, 0xB6E4, 0x55E1, 0xB6E5, 0x55C5, 0xB6E6, 0x55C6, + 0xB6E7, 0x55E5, 0xB6E8, 0x55C9, 0xB6E9, 0x5712, 0xB6EA, 0x5713, 0xB6EB, 0x585E, 0xB6EC, 0x5851, 0xB6ED, 0x5858, 0xB6EE, 0x5857, + 0xB6EF, 0x585A, 0xB6F0, 0x5854, 0xB6F1, 0x586B, 0xB6F2, 0x584C, 0xB6F3, 0x586D, 0xB6F4, 0x584A, 0xB6F5, 0x5862, 0xB6F6, 0x5852, + 0xB6F7, 0x584B, 0xB6F8, 0x5967, 0xB6F9, 0x5AC1, 0xB6FA, 0x5AC9, 0xB6FB, 0x5ACC, 0xB6FC, 0x5ABE, 0xB6FD, 0x5ABD, 0xB6FE, 0x5ABC, + 0xB740, 0x5AB3, 0xB741, 0x5AC2, 0xB742, 0x5AB2, 0xB743, 0x5D69, 0xB744, 0x5D6F, 0xB745, 0x5E4C, 0xB746, 0x5E79, 0xB747, 0x5EC9, + 0xB748, 0x5EC8, 0xB749, 0x5F12, 0xB74A, 0x5F59, 0xB74B, 0x5FAC, 0xB74C, 0x5FAE, 0xB74D, 0x611A, 0xB74E, 0x610F, 0xB74F, 0x6148, + 0xB750, 0x611F, 0xB751, 0x60F3, 0xB752, 0x611B, 0xB753, 0x60F9, 0xB754, 0x6101, 0xB755, 0x6108, 0xB756, 0x614E, 0xB757, 0x614C, + 0xB758, 0x6144, 0xB759, 0x614D, 0xB75A, 0x613E, 0xB75B, 0x6134, 0xB75C, 0x6127, 0xB75D, 0x610D, 0xB75E, 0x6106, 0xB75F, 0x6137, + 0xB760, 0x6221, 0xB761, 0x6222, 0xB762, 0x6413, 0xB763, 0x643E, 0xB764, 0x641E, 0xB765, 0x642A, 0xB766, 0x642D, 0xB767, 0x643D, + 0xB768, 0x642C, 0xB769, 0x640F, 0xB76A, 0x641C, 0xB76B, 0x6414, 0xB76C, 0x640D, 0xB76D, 0x6436, 0xB76E, 0x6416, 0xB76F, 0x6417, + 0xB770, 0x6406, 0xB771, 0x656C, 0xB772, 0x659F, 0xB773, 0x65B0, 0xB774, 0x6697, 0xB775, 0x6689, 0xB776, 0x6687, 0xB777, 0x6688, + 0xB778, 0x6696, 0xB779, 0x6684, 0xB77A, 0x6698, 0xB77B, 0x668D, 0xB77C, 0x6703, 0xB77D, 0x6994, 0xB77E, 0x696D, 0xB7A1, 0x695A, + 0xB7A2, 0x6977, 0xB7A3, 0x6960, 0xB7A4, 0x6954, 0xB7A5, 0x6975, 0xB7A6, 0x6930, 0xB7A7, 0x6982, 0xB7A8, 0x694A, 0xB7A9, 0x6968, + 0xB7AA, 0x696B, 0xB7AB, 0x695E, 0xB7AC, 0x6953, 0xB7AD, 0x6979, 0xB7AE, 0x6986, 0xB7AF, 0x695D, 0xB7B0, 0x6963, 0xB7B1, 0x695B, + 0xB7B2, 0x6B47, 0xB7B3, 0x6B72, 0xB7B4, 0x6BC0, 0xB7B5, 0x6BBF, 0xB7B6, 0x6BD3, 0xB7B7, 0x6BFD, 0xB7B8, 0x6EA2, 0xB7B9, 0x6EAF, + 0xB7BA, 0x6ED3, 0xB7BB, 0x6EB6, 0xB7BC, 0x6EC2, 0xB7BD, 0x6E90, 0xB7BE, 0x6E9D, 0xB7BF, 0x6EC7, 0xB7C0, 0x6EC5, 0xB7C1, 0x6EA5, + 0xB7C2, 0x6E98, 0xB7C3, 0x6EBC, 0xB7C4, 0x6EBA, 0xB7C5, 0x6EAB, 0xB7C6, 0x6ED1, 0xB7C7, 0x6E96, 0xB7C8, 0x6E9C, 0xB7C9, 0x6EC4, + 0xB7CA, 0x6ED4, 0xB7CB, 0x6EAA, 0xB7CC, 0x6EA7, 0xB7CD, 0x6EB4, 0xB7CE, 0x714E, 0xB7CF, 0x7159, 0xB7D0, 0x7169, 0xB7D1, 0x7164, + 0xB7D2, 0x7149, 0xB7D3, 0x7167, 0xB7D4, 0x715C, 0xB7D5, 0x716C, 0xB7D6, 0x7166, 0xB7D7, 0x714C, 0xB7D8, 0x7165, 0xB7D9, 0x715E, + 0xB7DA, 0x7146, 0xB7DB, 0x7168, 0xB7DC, 0x7156, 0xB7DD, 0x723A, 0xB7DE, 0x7252, 0xB7DF, 0x7337, 0xB7E0, 0x7345, 0xB7E1, 0x733F, + 0xB7E2, 0x733E, 0xB7E3, 0x746F, 0xB7E4, 0x745A, 0xB7E5, 0x7455, 0xB7E6, 0x745F, 0xB7E7, 0x745E, 0xB7E8, 0x7441, 0xB7E9, 0x743F, + 0xB7EA, 0x7459, 0xB7EB, 0x745B, 0xB7EC, 0x745C, 0xB7ED, 0x7576, 0xB7EE, 0x7578, 0xB7EF, 0x7600, 0xB7F0, 0x75F0, 0xB7F1, 0x7601, + 0xB7F2, 0x75F2, 0xB7F3, 0x75F1, 0xB7F4, 0x75FA, 0xB7F5, 0x75FF, 0xB7F6, 0x75F4, 0xB7F7, 0x75F3, 0xB7F8, 0x76DE, 0xB7F9, 0x76DF, + 0xB7FA, 0x775B, 0xB7FB, 0x776B, 0xB7FC, 0x7766, 0xB7FD, 0x775E, 0xB7FE, 0x7763, 0xB840, 0x7779, 0xB841, 0x776A, 0xB842, 0x776C, + 0xB843, 0x775C, 0xB844, 0x7765, 0xB845, 0x7768, 0xB846, 0x7762, 0xB847, 0x77EE, 0xB848, 0x788E, 0xB849, 0x78B0, 0xB84A, 0x7897, + 0xB84B, 0x7898, 0xB84C, 0x788C, 0xB84D, 0x7889, 0xB84E, 0x787C, 0xB84F, 0x7891, 0xB850, 0x7893, 0xB851, 0x787F, 0xB852, 0x797A, + 0xB853, 0x797F, 0xB854, 0x7981, 0xB855, 0x842C, 0xB856, 0x79BD, 0xB857, 0x7A1C, 0xB858, 0x7A1A, 0xB859, 0x7A20, 0xB85A, 0x7A14, + 0xB85B, 0x7A1F, 0xB85C, 0x7A1E, 0xB85D, 0x7A9F, 0xB85E, 0x7AA0, 0xB85F, 0x7B77, 0xB860, 0x7BC0, 0xB861, 0x7B60, 0xB862, 0x7B6E, + 0xB863, 0x7B67, 0xB864, 0x7CB1, 0xB865, 0x7CB3, 0xB866, 0x7CB5, 0xB867, 0x7D93, 0xB868, 0x7D79, 0xB869, 0x7D91, 0xB86A, 0x7D81, + 0xB86B, 0x7D8F, 0xB86C, 0x7D5B, 0xB86D, 0x7F6E, 0xB86E, 0x7F69, 0xB86F, 0x7F6A, 0xB870, 0x7F72, 0xB871, 0x7FA9, 0xB872, 0x7FA8, + 0xB873, 0x7FA4, 0xB874, 0x8056, 0xB875, 0x8058, 0xB876, 0x8086, 0xB877, 0x8084, 0xB878, 0x8171, 0xB879, 0x8170, 0xB87A, 0x8178, + 0xB87B, 0x8165, 0xB87C, 0x816E, 0xB87D, 0x8173, 0xB87E, 0x816B, 0xB8A1, 0x8179, 0xB8A2, 0x817A, 0xB8A3, 0x8166, 0xB8A4, 0x8205, + 0xB8A5, 0x8247, 0xB8A6, 0x8482, 0xB8A7, 0x8477, 0xB8A8, 0x843D, 0xB8A9, 0x8431, 0xB8AA, 0x8475, 0xB8AB, 0x8466, 0xB8AC, 0x846B, + 0xB8AD, 0x8449, 0xB8AE, 0x846C, 0xB8AF, 0x845B, 0xB8B0, 0x843C, 0xB8B1, 0x8435, 0xB8B2, 0x8461, 0xB8B3, 0x8463, 0xB8B4, 0x8469, + 0xB8B5, 0x846D, 0xB8B6, 0x8446, 0xB8B7, 0x865E, 0xB8B8, 0x865C, 0xB8B9, 0x865F, 0xB8BA, 0x86F9, 0xB8BB, 0x8713, 0xB8BC, 0x8708, + 0xB8BD, 0x8707, 0xB8BE, 0x8700, 0xB8BF, 0x86FE, 0xB8C0, 0x86FB, 0xB8C1, 0x8702, 0xB8C2, 0x8703, 0xB8C3, 0x8706, 0xB8C4, 0x870A, + 0xB8C5, 0x8859, 0xB8C6, 0x88DF, 0xB8C7, 0x88D4, 0xB8C8, 0x88D9, 0xB8C9, 0x88DC, 0xB8CA, 0x88D8, 0xB8CB, 0x88DD, 0xB8CC, 0x88E1, + 0xB8CD, 0x88CA, 0xB8CE, 0x88D5, 0xB8CF, 0x88D2, 0xB8D0, 0x899C, 0xB8D1, 0x89E3, 0xB8D2, 0x8A6B, 0xB8D3, 0x8A72, 0xB8D4, 0x8A73, + 0xB8D5, 0x8A66, 0xB8D6, 0x8A69, 0xB8D7, 0x8A70, 0xB8D8, 0x8A87, 0xB8D9, 0x8A7C, 0xB8DA, 0x8A63, 0xB8DB, 0x8AA0, 0xB8DC, 0x8A71, + 0xB8DD, 0x8A85, 0xB8DE, 0x8A6D, 0xB8DF, 0x8A62, 0xB8E0, 0x8A6E, 0xB8E1, 0x8A6C, 0xB8E2, 0x8A79, 0xB8E3, 0x8A7B, 0xB8E4, 0x8A3E, + 0xB8E5, 0x8A68, 0xB8E6, 0x8C62, 0xB8E7, 0x8C8A, 0xB8E8, 0x8C89, 0xB8E9, 0x8CCA, 0xB8EA, 0x8CC7, 0xB8EB, 0x8CC8, 0xB8EC, 0x8CC4, + 0xB8ED, 0x8CB2, 0xB8EE, 0x8CC3, 0xB8EF, 0x8CC2, 0xB8F0, 0x8CC5, 0xB8F1, 0x8DE1, 0xB8F2, 0x8DDF, 0xB8F3, 0x8DE8, 0xB8F4, 0x8DEF, + 0xB8F5, 0x8DF3, 0xB8F6, 0x8DFA, 0xB8F7, 0x8DEA, 0xB8F8, 0x8DE4, 0xB8F9, 0x8DE6, 0xB8FA, 0x8EB2, 0xB8FB, 0x8F03, 0xB8FC, 0x8F09, + 0xB8FD, 0x8EFE, 0xB8FE, 0x8F0A, 0xB940, 0x8F9F, 0xB941, 0x8FB2, 0xB942, 0x904B, 0xB943, 0x904A, 0xB944, 0x9053, 0xB945, 0x9042, + 0xB946, 0x9054, 0xB947, 0x903C, 0xB948, 0x9055, 0xB949, 0x9050, 0xB94A, 0x9047, 0xB94B, 0x904F, 0xB94C, 0x904E, 0xB94D, 0x904D, + 0xB94E, 0x9051, 0xB94F, 0x903E, 0xB950, 0x9041, 0xB951, 0x9112, 0xB952, 0x9117, 0xB953, 0x916C, 0xB954, 0x916A, 0xB955, 0x9169, + 0xB956, 0x91C9, 0xB957, 0x9237, 0xB958, 0x9257, 0xB959, 0x9238, 0xB95A, 0x923D, 0xB95B, 0x9240, 0xB95C, 0x923E, 0xB95D, 0x925B, + 0xB95E, 0x924B, 0xB95F, 0x9264, 0xB960, 0x9251, 0xB961, 0x9234, 0xB962, 0x9249, 0xB963, 0x924D, 0xB964, 0x9245, 0xB965, 0x9239, + 0xB966, 0x923F, 0xB967, 0x925A, 0xB968, 0x9598, 0xB969, 0x9698, 0xB96A, 0x9694, 0xB96B, 0x9695, 0xB96C, 0x96CD, 0xB96D, 0x96CB, + 0xB96E, 0x96C9, 0xB96F, 0x96CA, 0xB970, 0x96F7, 0xB971, 0x96FB, 0xB972, 0x96F9, 0xB973, 0x96F6, 0xB974, 0x9756, 0xB975, 0x9774, + 0xB976, 0x9776, 0xB977, 0x9810, 0xB978, 0x9811, 0xB979, 0x9813, 0xB97A, 0x980A, 0xB97B, 0x9812, 0xB97C, 0x980C, 0xB97D, 0x98FC, + 0xB97E, 0x98F4, 0xB9A1, 0x98FD, 0xB9A2, 0x98FE, 0xB9A3, 0x99B3, 0xB9A4, 0x99B1, 0xB9A5, 0x99B4, 0xB9A6, 0x9AE1, 0xB9A7, 0x9CE9, + 0xB9A8, 0x9E82, 0xB9A9, 0x9F0E, 0xB9AA, 0x9F13, 0xB9AB, 0x9F20, 0xB9AC, 0x50E7, 0xB9AD, 0x50EE, 0xB9AE, 0x50E5, 0xB9AF, 0x50D6, + 0xB9B0, 0x50ED, 0xB9B1, 0x50DA, 0xB9B2, 0x50D5, 0xB9B3, 0x50CF, 0xB9B4, 0x50D1, 0xB9B5, 0x50F1, 0xB9B6, 0x50CE, 0xB9B7, 0x50E9, + 0xB9B8, 0x5162, 0xB9B9, 0x51F3, 0xB9BA, 0x5283, 0xB9BB, 0x5282, 0xB9BC, 0x5331, 0xB9BD, 0x53AD, 0xB9BE, 0x55FE, 0xB9BF, 0x5600, + 0xB9C0, 0x561B, 0xB9C1, 0x5617, 0xB9C2, 0x55FD, 0xB9C3, 0x5614, 0xB9C4, 0x5606, 0xB9C5, 0x5609, 0xB9C6, 0x560D, 0xB9C7, 0x560E, + 0xB9C8, 0x55F7, 0xB9C9, 0x5616, 0xB9CA, 0x561F, 0xB9CB, 0x5608, 0xB9CC, 0x5610, 0xB9CD, 0x55F6, 0xB9CE, 0x5718, 0xB9CF, 0x5716, + 0xB9D0, 0x5875, 0xB9D1, 0x587E, 0xB9D2, 0x5883, 0xB9D3, 0x5893, 0xB9D4, 0x588A, 0xB9D5, 0x5879, 0xB9D6, 0x5885, 0xB9D7, 0x587D, + 0xB9D8, 0x58FD, 0xB9D9, 0x5925, 0xB9DA, 0x5922, 0xB9DB, 0x5924, 0xB9DC, 0x596A, 0xB9DD, 0x5969, 0xB9DE, 0x5AE1, 0xB9DF, 0x5AE6, + 0xB9E0, 0x5AE9, 0xB9E1, 0x5AD7, 0xB9E2, 0x5AD6, 0xB9E3, 0x5AD8, 0xB9E4, 0x5AE3, 0xB9E5, 0x5B75, 0xB9E6, 0x5BDE, 0xB9E7, 0x5BE7, + 0xB9E8, 0x5BE1, 0xB9E9, 0x5BE5, 0xB9EA, 0x5BE6, 0xB9EB, 0x5BE8, 0xB9EC, 0x5BE2, 0xB9ED, 0x5BE4, 0xB9EE, 0x5BDF, 0xB9EF, 0x5C0D, + 0xB9F0, 0x5C62, 0xB9F1, 0x5D84, 0xB9F2, 0x5D87, 0xB9F3, 0x5E5B, 0xB9F4, 0x5E63, 0xB9F5, 0x5E55, 0xB9F6, 0x5E57, 0xB9F7, 0x5E54, + 0xB9F8, 0x5ED3, 0xB9F9, 0x5ED6, 0xB9FA, 0x5F0A, 0xB9FB, 0x5F46, 0xB9FC, 0x5F70, 0xB9FD, 0x5FB9, 0xB9FE, 0x6147, 0xBA40, 0x613F, + 0xBA41, 0x614B, 0xBA42, 0x6177, 0xBA43, 0x6162, 0xBA44, 0x6163, 0xBA45, 0x615F, 0xBA46, 0x615A, 0xBA47, 0x6158, 0xBA48, 0x6175, + 0xBA49, 0x622A, 0xBA4A, 0x6487, 0xBA4B, 0x6458, 0xBA4C, 0x6454, 0xBA4D, 0x64A4, 0xBA4E, 0x6478, 0xBA4F, 0x645F, 0xBA50, 0x647A, + 0xBA51, 0x6451, 0xBA52, 0x6467, 0xBA53, 0x6434, 0xBA54, 0x646D, 0xBA55, 0x647B, 0xBA56, 0x6572, 0xBA57, 0x65A1, 0xBA58, 0x65D7, + 0xBA59, 0x65D6, 0xBA5A, 0x66A2, 0xBA5B, 0x66A8, 0xBA5C, 0x669D, 0xBA5D, 0x699C, 0xBA5E, 0x69A8, 0xBA5F, 0x6995, 0xBA60, 0x69C1, + 0xBA61, 0x69AE, 0xBA62, 0x69D3, 0xBA63, 0x69CB, 0xBA64, 0x699B, 0xBA65, 0x69B7, 0xBA66, 0x69BB, 0xBA67, 0x69AB, 0xBA68, 0x69B4, + 0xBA69, 0x69D0, 0xBA6A, 0x69CD, 0xBA6B, 0x69AD, 0xBA6C, 0x69CC, 0xBA6D, 0x69A6, 0xBA6E, 0x69C3, 0xBA6F, 0x69A3, 0xBA70, 0x6B49, + 0xBA71, 0x6B4C, 0xBA72, 0x6C33, 0xBA73, 0x6F33, 0xBA74, 0x6F14, 0xBA75, 0x6EFE, 0xBA76, 0x6F13, 0xBA77, 0x6EF4, 0xBA78, 0x6F29, + 0xBA79, 0x6F3E, 0xBA7A, 0x6F20, 0xBA7B, 0x6F2C, 0xBA7C, 0x6F0F, 0xBA7D, 0x6F02, 0xBA7E, 0x6F22, 0xBAA1, 0x6EFF, 0xBAA2, 0x6EEF, + 0xBAA3, 0x6F06, 0xBAA4, 0x6F31, 0xBAA5, 0x6F38, 0xBAA6, 0x6F32, 0xBAA7, 0x6F23, 0xBAA8, 0x6F15, 0xBAA9, 0x6F2B, 0xBAAA, 0x6F2F, + 0xBAAB, 0x6F88, 0xBAAC, 0x6F2A, 0xBAAD, 0x6EEC, 0xBAAE, 0x6F01, 0xBAAF, 0x6EF2, 0xBAB0, 0x6ECC, 0xBAB1, 0x6EF7, 0xBAB2, 0x7194, + 0xBAB3, 0x7199, 0xBAB4, 0x717D, 0xBAB5, 0x718A, 0xBAB6, 0x7184, 0xBAB7, 0x7192, 0xBAB8, 0x723E, 0xBAB9, 0x7292, 0xBABA, 0x7296, + 0xBABB, 0x7344, 0xBABC, 0x7350, 0xBABD, 0x7464, 0xBABE, 0x7463, 0xBABF, 0x746A, 0xBAC0, 0x7470, 0xBAC1, 0x746D, 0xBAC2, 0x7504, + 0xBAC3, 0x7591, 0xBAC4, 0x7627, 0xBAC5, 0x760D, 0xBAC6, 0x760B, 0xBAC7, 0x7609, 0xBAC8, 0x7613, 0xBAC9, 0x76E1, 0xBACA, 0x76E3, + 0xBACB, 0x7784, 0xBACC, 0x777D, 0xBACD, 0x777F, 0xBACE, 0x7761, 0xBACF, 0x78C1, 0xBAD0, 0x789F, 0xBAD1, 0x78A7, 0xBAD2, 0x78B3, + 0xBAD3, 0x78A9, 0xBAD4, 0x78A3, 0xBAD5, 0x798E, 0xBAD6, 0x798F, 0xBAD7, 0x798D, 0xBAD8, 0x7A2E, 0xBAD9, 0x7A31, 0xBADA, 0x7AAA, + 0xBADB, 0x7AA9, 0xBADC, 0x7AED, 0xBADD, 0x7AEF, 0xBADE, 0x7BA1, 0xBADF, 0x7B95, 0xBAE0, 0x7B8B, 0xBAE1, 0x7B75, 0xBAE2, 0x7B97, + 0xBAE3, 0x7B9D, 0xBAE4, 0x7B94, 0xBAE5, 0x7B8F, 0xBAE6, 0x7BB8, 0xBAE7, 0x7B87, 0xBAE8, 0x7B84, 0xBAE9, 0x7CB9, 0xBAEA, 0x7CBD, + 0xBAEB, 0x7CBE, 0xBAEC, 0x7DBB, 0xBAED, 0x7DB0, 0xBAEE, 0x7D9C, 0xBAEF, 0x7DBD, 0xBAF0, 0x7DBE, 0xBAF1, 0x7DA0, 0xBAF2, 0x7DCA, + 0xBAF3, 0x7DB4, 0xBAF4, 0x7DB2, 0xBAF5, 0x7DB1, 0xBAF6, 0x7DBA, 0xBAF7, 0x7DA2, 0xBAF8, 0x7DBF, 0xBAF9, 0x7DB5, 0xBAFA, 0x7DB8, + 0xBAFB, 0x7DAD, 0xBAFC, 0x7DD2, 0xBAFD, 0x7DC7, 0xBAFE, 0x7DAC, 0xBB40, 0x7F70, 0xBB41, 0x7FE0, 0xBB42, 0x7FE1, 0xBB43, 0x7FDF, + 0xBB44, 0x805E, 0xBB45, 0x805A, 0xBB46, 0x8087, 0xBB47, 0x8150, 0xBB48, 0x8180, 0xBB49, 0x818F, 0xBB4A, 0x8188, 0xBB4B, 0x818A, + 0xBB4C, 0x817F, 0xBB4D, 0x8182, 0xBB4E, 0x81E7, 0xBB4F, 0x81FA, 0xBB50, 0x8207, 0xBB51, 0x8214, 0xBB52, 0x821E, 0xBB53, 0x824B, + 0xBB54, 0x84C9, 0xBB55, 0x84BF, 0xBB56, 0x84C6, 0xBB57, 0x84C4, 0xBB58, 0x8499, 0xBB59, 0x849E, 0xBB5A, 0x84B2, 0xBB5B, 0x849C, + 0xBB5C, 0x84CB, 0xBB5D, 0x84B8, 0xBB5E, 0x84C0, 0xBB5F, 0x84D3, 0xBB60, 0x8490, 0xBB61, 0x84BC, 0xBB62, 0x84D1, 0xBB63, 0x84CA, + 0xBB64, 0x873F, 0xBB65, 0x871C, 0xBB66, 0x873B, 0xBB67, 0x8722, 0xBB68, 0x8725, 0xBB69, 0x8734, 0xBB6A, 0x8718, 0xBB6B, 0x8755, + 0xBB6C, 0x8737, 0xBB6D, 0x8729, 0xBB6E, 0x88F3, 0xBB6F, 0x8902, 0xBB70, 0x88F4, 0xBB71, 0x88F9, 0xBB72, 0x88F8, 0xBB73, 0x88FD, + 0xBB74, 0x88E8, 0xBB75, 0x891A, 0xBB76, 0x88EF, 0xBB77, 0x8AA6, 0xBB78, 0x8A8C, 0xBB79, 0x8A9E, 0xBB7A, 0x8AA3, 0xBB7B, 0x8A8D, + 0xBB7C, 0x8AA1, 0xBB7D, 0x8A93, 0xBB7E, 0x8AA4, 0xBBA1, 0x8AAA, 0xBBA2, 0x8AA5, 0xBBA3, 0x8AA8, 0xBBA4, 0x8A98, 0xBBA5, 0x8A91, + 0xBBA6, 0x8A9A, 0xBBA7, 0x8AA7, 0xBBA8, 0x8C6A, 0xBBA9, 0x8C8D, 0xBBAA, 0x8C8C, 0xBBAB, 0x8CD3, 0xBBAC, 0x8CD1, 0xBBAD, 0x8CD2, + 0xBBAE, 0x8D6B, 0xBBAF, 0x8D99, 0xBBB0, 0x8D95, 0xBBB1, 0x8DFC, 0xBBB2, 0x8F14, 0xBBB3, 0x8F12, 0xBBB4, 0x8F15, 0xBBB5, 0x8F13, + 0xBBB6, 0x8FA3, 0xBBB7, 0x9060, 0xBBB8, 0x9058, 0xBBB9, 0x905C, 0xBBBA, 0x9063, 0xBBBB, 0x9059, 0xBBBC, 0x905E, 0xBBBD, 0x9062, + 0xBBBE, 0x905D, 0xBBBF, 0x905B, 0xBBC0, 0x9119, 0xBBC1, 0x9118, 0xBBC2, 0x911E, 0xBBC3, 0x9175, 0xBBC4, 0x9178, 0xBBC5, 0x9177, + 0xBBC6, 0x9174, 0xBBC7, 0x9278, 0xBBC8, 0x9280, 0xBBC9, 0x9285, 0xBBCA, 0x9298, 0xBBCB, 0x9296, 0xBBCC, 0x927B, 0xBBCD, 0x9293, + 0xBBCE, 0x929C, 0xBBCF, 0x92A8, 0xBBD0, 0x927C, 0xBBD1, 0x9291, 0xBBD2, 0x95A1, 0xBBD3, 0x95A8, 0xBBD4, 0x95A9, 0xBBD5, 0x95A3, + 0xBBD6, 0x95A5, 0xBBD7, 0x95A4, 0xBBD8, 0x9699, 0xBBD9, 0x969C, 0xBBDA, 0x969B, 0xBBDB, 0x96CC, 0xBBDC, 0x96D2, 0xBBDD, 0x9700, + 0xBBDE, 0x977C, 0xBBDF, 0x9785, 0xBBE0, 0x97F6, 0xBBE1, 0x9817, 0xBBE2, 0x9818, 0xBBE3, 0x98AF, 0xBBE4, 0x98B1, 0xBBE5, 0x9903, + 0xBBE6, 0x9905, 0xBBE7, 0x990C, 0xBBE8, 0x9909, 0xBBE9, 0x99C1, 0xBBEA, 0x9AAF, 0xBBEB, 0x9AB0, 0xBBEC, 0x9AE6, 0xBBED, 0x9B41, + 0xBBEE, 0x9B42, 0xBBEF, 0x9CF4, 0xBBF0, 0x9CF6, 0xBBF1, 0x9CF3, 0xBBF2, 0x9EBC, 0xBBF3, 0x9F3B, 0xBBF4, 0x9F4A, 0xBBF5, 0x5104, + 0xBBF6, 0x5100, 0xBBF7, 0x50FB, 0xBBF8, 0x50F5, 0xBBF9, 0x50F9, 0xBBFA, 0x5102, 0xBBFB, 0x5108, 0xBBFC, 0x5109, 0xBBFD, 0x5105, + 0xBBFE, 0x51DC, 0xBC40, 0x5287, 0xBC41, 0x5288, 0xBC42, 0x5289, 0xBC43, 0x528D, 0xBC44, 0x528A, 0xBC45, 0x52F0, 0xBC46, 0x53B2, + 0xBC47, 0x562E, 0xBC48, 0x563B, 0xBC49, 0x5639, 0xBC4A, 0x5632, 0xBC4B, 0x563F, 0xBC4C, 0x5634, 0xBC4D, 0x5629, 0xBC4E, 0x5653, + 0xBC4F, 0x564E, 0xBC50, 0x5657, 0xBC51, 0x5674, 0xBC52, 0x5636, 0xBC53, 0x562F, 0xBC54, 0x5630, 0xBC55, 0x5880, 0xBC56, 0x589F, + 0xBC57, 0x589E, 0xBC58, 0x58B3, 0xBC59, 0x589C, 0xBC5A, 0x58AE, 0xBC5B, 0x58A9, 0xBC5C, 0x58A6, 0xBC5D, 0x596D, 0xBC5E, 0x5B09, + 0xBC5F, 0x5AFB, 0xBC60, 0x5B0B, 0xBC61, 0x5AF5, 0xBC62, 0x5B0C, 0xBC63, 0x5B08, 0xBC64, 0x5BEE, 0xBC65, 0x5BEC, 0xBC66, 0x5BE9, + 0xBC67, 0x5BEB, 0xBC68, 0x5C64, 0xBC69, 0x5C65, 0xBC6A, 0x5D9D, 0xBC6B, 0x5D94, 0xBC6C, 0x5E62, 0xBC6D, 0x5E5F, 0xBC6E, 0x5E61, + 0xBC6F, 0x5EE2, 0xBC70, 0x5EDA, 0xBC71, 0x5EDF, 0xBC72, 0x5EDD, 0xBC73, 0x5EE3, 0xBC74, 0x5EE0, 0xBC75, 0x5F48, 0xBC76, 0x5F71, + 0xBC77, 0x5FB7, 0xBC78, 0x5FB5, 0xBC79, 0x6176, 0xBC7A, 0x6167, 0xBC7B, 0x616E, 0xBC7C, 0x615D, 0xBC7D, 0x6155, 0xBC7E, 0x6182, + 0xBCA1, 0x617C, 0xBCA2, 0x6170, 0xBCA3, 0x616B, 0xBCA4, 0x617E, 0xBCA5, 0x61A7, 0xBCA6, 0x6190, 0xBCA7, 0x61AB, 0xBCA8, 0x618E, + 0xBCA9, 0x61AC, 0xBCAA, 0x619A, 0xBCAB, 0x61A4, 0xBCAC, 0x6194, 0xBCAD, 0x61AE, 0xBCAE, 0x622E, 0xBCAF, 0x6469, 0xBCB0, 0x646F, + 0xBCB1, 0x6479, 0xBCB2, 0x649E, 0xBCB3, 0x64B2, 0xBCB4, 0x6488, 0xBCB5, 0x6490, 0xBCB6, 0x64B0, 0xBCB7, 0x64A5, 0xBCB8, 0x6493, + 0xBCB9, 0x6495, 0xBCBA, 0x64A9, 0xBCBB, 0x6492, 0xBCBC, 0x64AE, 0xBCBD, 0x64AD, 0xBCBE, 0x64AB, 0xBCBF, 0x649A, 0xBCC0, 0x64AC, + 0xBCC1, 0x6499, 0xBCC2, 0x64A2, 0xBCC3, 0x64B3, 0xBCC4, 0x6575, 0xBCC5, 0x6577, 0xBCC6, 0x6578, 0xBCC7, 0x66AE, 0xBCC8, 0x66AB, + 0xBCC9, 0x66B4, 0xBCCA, 0x66B1, 0xBCCB, 0x6A23, 0xBCCC, 0x6A1F, 0xBCCD, 0x69E8, 0xBCCE, 0x6A01, 0xBCCF, 0x6A1E, 0xBCD0, 0x6A19, + 0xBCD1, 0x69FD, 0xBCD2, 0x6A21, 0xBCD3, 0x6A13, 0xBCD4, 0x6A0A, 0xBCD5, 0x69F3, 0xBCD6, 0x6A02, 0xBCD7, 0x6A05, 0xBCD8, 0x69ED, + 0xBCD9, 0x6A11, 0xBCDA, 0x6B50, 0xBCDB, 0x6B4E, 0xBCDC, 0x6BA4, 0xBCDD, 0x6BC5, 0xBCDE, 0x6BC6, 0xBCDF, 0x6F3F, 0xBCE0, 0x6F7C, + 0xBCE1, 0x6F84, 0xBCE2, 0x6F51, 0xBCE3, 0x6F66, 0xBCE4, 0x6F54, 0xBCE5, 0x6F86, 0xBCE6, 0x6F6D, 0xBCE7, 0x6F5B, 0xBCE8, 0x6F78, + 0xBCE9, 0x6F6E, 0xBCEA, 0x6F8E, 0xBCEB, 0x6F7A, 0xBCEC, 0x6F70, 0xBCED, 0x6F64, 0xBCEE, 0x6F97, 0xBCEF, 0x6F58, 0xBCF0, 0x6ED5, + 0xBCF1, 0x6F6F, 0xBCF2, 0x6F60, 0xBCF3, 0x6F5F, 0xBCF4, 0x719F, 0xBCF5, 0x71AC, 0xBCF6, 0x71B1, 0xBCF7, 0x71A8, 0xBCF8, 0x7256, + 0xBCF9, 0x729B, 0xBCFA, 0x734E, 0xBCFB, 0x7357, 0xBCFC, 0x7469, 0xBCFD, 0x748B, 0xBCFE, 0x7483, 0xBD40, 0x747E, 0xBD41, 0x7480, + 0xBD42, 0x757F, 0xBD43, 0x7620, 0xBD44, 0x7629, 0xBD45, 0x761F, 0xBD46, 0x7624, 0xBD47, 0x7626, 0xBD48, 0x7621, 0xBD49, 0x7622, + 0xBD4A, 0x769A, 0xBD4B, 0x76BA, 0xBD4C, 0x76E4, 0xBD4D, 0x778E, 0xBD4E, 0x7787, 0xBD4F, 0x778C, 0xBD50, 0x7791, 0xBD51, 0x778B, + 0xBD52, 0x78CB, 0xBD53, 0x78C5, 0xBD54, 0x78BA, 0xBD55, 0x78CA, 0xBD56, 0x78BE, 0xBD57, 0x78D5, 0xBD58, 0x78BC, 0xBD59, 0x78D0, + 0xBD5A, 0x7A3F, 0xBD5B, 0x7A3C, 0xBD5C, 0x7A40, 0xBD5D, 0x7A3D, 0xBD5E, 0x7A37, 0xBD5F, 0x7A3B, 0xBD60, 0x7AAF, 0xBD61, 0x7AAE, + 0xBD62, 0x7BAD, 0xBD63, 0x7BB1, 0xBD64, 0x7BC4, 0xBD65, 0x7BB4, 0xBD66, 0x7BC6, 0xBD67, 0x7BC7, 0xBD68, 0x7BC1, 0xBD69, 0x7BA0, + 0xBD6A, 0x7BCC, 0xBD6B, 0x7CCA, 0xBD6C, 0x7DE0, 0xBD6D, 0x7DF4, 0xBD6E, 0x7DEF, 0xBD6F, 0x7DFB, 0xBD70, 0x7DD8, 0xBD71, 0x7DEC, + 0xBD72, 0x7DDD, 0xBD73, 0x7DE8, 0xBD74, 0x7DE3, 0xBD75, 0x7DDA, 0xBD76, 0x7DDE, 0xBD77, 0x7DE9, 0xBD78, 0x7D9E, 0xBD79, 0x7DD9, + 0xBD7A, 0x7DF2, 0xBD7B, 0x7DF9, 0xBD7C, 0x7F75, 0xBD7D, 0x7F77, 0xBD7E, 0x7FAF, 0xBDA1, 0x7FE9, 0xBDA2, 0x8026, 0xBDA3, 0x819B, + 0xBDA4, 0x819C, 0xBDA5, 0x819D, 0xBDA6, 0x81A0, 0xBDA7, 0x819A, 0xBDA8, 0x8198, 0xBDA9, 0x8517, 0xBDAA, 0x853D, 0xBDAB, 0x851A, + 0xBDAC, 0x84EE, 0xBDAD, 0x852C, 0xBDAE, 0x852D, 0xBDAF, 0x8513, 0xBDB0, 0x8511, 0xBDB1, 0x8523, 0xBDB2, 0x8521, 0xBDB3, 0x8514, + 0xBDB4, 0x84EC, 0xBDB5, 0x8525, 0xBDB6, 0x84FF, 0xBDB7, 0x8506, 0xBDB8, 0x8782, 0xBDB9, 0x8774, 0xBDBA, 0x8776, 0xBDBB, 0x8760, + 0xBDBC, 0x8766, 0xBDBD, 0x8778, 0xBDBE, 0x8768, 0xBDBF, 0x8759, 0xBDC0, 0x8757, 0xBDC1, 0x874C, 0xBDC2, 0x8753, 0xBDC3, 0x885B, + 0xBDC4, 0x885D, 0xBDC5, 0x8910, 0xBDC6, 0x8907, 0xBDC7, 0x8912, 0xBDC8, 0x8913, 0xBDC9, 0x8915, 0xBDCA, 0x890A, 0xBDCB, 0x8ABC, + 0xBDCC, 0x8AD2, 0xBDCD, 0x8AC7, 0xBDCE, 0x8AC4, 0xBDCF, 0x8A95, 0xBDD0, 0x8ACB, 0xBDD1, 0x8AF8, 0xBDD2, 0x8AB2, 0xBDD3, 0x8AC9, + 0xBDD4, 0x8AC2, 0xBDD5, 0x8ABF, 0xBDD6, 0x8AB0, 0xBDD7, 0x8AD6, 0xBDD8, 0x8ACD, 0xBDD9, 0x8AB6, 0xBDDA, 0x8AB9, 0xBDDB, 0x8ADB, + 0xBDDC, 0x8C4C, 0xBDDD, 0x8C4E, 0xBDDE, 0x8C6C, 0xBDDF, 0x8CE0, 0xBDE0, 0x8CDE, 0xBDE1, 0x8CE6, 0xBDE2, 0x8CE4, 0xBDE3, 0x8CEC, + 0xBDE4, 0x8CED, 0xBDE5, 0x8CE2, 0xBDE6, 0x8CE3, 0xBDE7, 0x8CDC, 0xBDE8, 0x8CEA, 0xBDE9, 0x8CE1, 0xBDEA, 0x8D6D, 0xBDEB, 0x8D9F, + 0xBDEC, 0x8DA3, 0xBDED, 0x8E2B, 0xBDEE, 0x8E10, 0xBDEF, 0x8E1D, 0xBDF0, 0x8E22, 0xBDF1, 0x8E0F, 0xBDF2, 0x8E29, 0xBDF3, 0x8E1F, + 0xBDF4, 0x8E21, 0xBDF5, 0x8E1E, 0xBDF6, 0x8EBA, 0xBDF7, 0x8F1D, 0xBDF8, 0x8F1B, 0xBDF9, 0x8F1F, 0xBDFA, 0x8F29, 0xBDFB, 0x8F26, + 0xBDFC, 0x8F2A, 0xBDFD, 0x8F1C, 0xBDFE, 0x8F1E, 0xBE40, 0x8F25, 0xBE41, 0x9069, 0xBE42, 0x906E, 0xBE43, 0x9068, 0xBE44, 0x906D, + 0xBE45, 0x9077, 0xBE46, 0x9130, 0xBE47, 0x912D, 0xBE48, 0x9127, 0xBE49, 0x9131, 0xBE4A, 0x9187, 0xBE4B, 0x9189, 0xBE4C, 0x918B, + 0xBE4D, 0x9183, 0xBE4E, 0x92C5, 0xBE4F, 0x92BB, 0xBE50, 0x92B7, 0xBE51, 0x92EA, 0xBE52, 0x92AC, 0xBE53, 0x92E4, 0xBE54, 0x92C1, + 0xBE55, 0x92B3, 0xBE56, 0x92BC, 0xBE57, 0x92D2, 0xBE58, 0x92C7, 0xBE59, 0x92F0, 0xBE5A, 0x92B2, 0xBE5B, 0x95AD, 0xBE5C, 0x95B1, + 0xBE5D, 0x9704, 0xBE5E, 0x9706, 0xBE5F, 0x9707, 0xBE60, 0x9709, 0xBE61, 0x9760, 0xBE62, 0x978D, 0xBE63, 0x978B, 0xBE64, 0x978F, + 0xBE65, 0x9821, 0xBE66, 0x982B, 0xBE67, 0x981C, 0xBE68, 0x98B3, 0xBE69, 0x990A, 0xBE6A, 0x9913, 0xBE6B, 0x9912, 0xBE6C, 0x9918, + 0xBE6D, 0x99DD, 0xBE6E, 0x99D0, 0xBE6F, 0x99DF, 0xBE70, 0x99DB, 0xBE71, 0x99D1, 0xBE72, 0x99D5, 0xBE73, 0x99D2, 0xBE74, 0x99D9, + 0xBE75, 0x9AB7, 0xBE76, 0x9AEE, 0xBE77, 0x9AEF, 0xBE78, 0x9B27, 0xBE79, 0x9B45, 0xBE7A, 0x9B44, 0xBE7B, 0x9B77, 0xBE7C, 0x9B6F, + 0xBE7D, 0x9D06, 0xBE7E, 0x9D09, 0xBEA1, 0x9D03, 0xBEA2, 0x9EA9, 0xBEA3, 0x9EBE, 0xBEA4, 0x9ECE, 0xBEA5, 0x58A8, 0xBEA6, 0x9F52, + 0xBEA7, 0x5112, 0xBEA8, 0x5118, 0xBEA9, 0x5114, 0xBEAA, 0x5110, 0xBEAB, 0x5115, 0xBEAC, 0x5180, 0xBEAD, 0x51AA, 0xBEAE, 0x51DD, + 0xBEAF, 0x5291, 0xBEB0, 0x5293, 0xBEB1, 0x52F3, 0xBEB2, 0x5659, 0xBEB3, 0x566B, 0xBEB4, 0x5679, 0xBEB5, 0x5669, 0xBEB6, 0x5664, + 0xBEB7, 0x5678, 0xBEB8, 0x566A, 0xBEB9, 0x5668, 0xBEBA, 0x5665, 0xBEBB, 0x5671, 0xBEBC, 0x566F, 0xBEBD, 0x566C, 0xBEBE, 0x5662, + 0xBEBF, 0x5676, 0xBEC0, 0x58C1, 0xBEC1, 0x58BE, 0xBEC2, 0x58C7, 0xBEC3, 0x58C5, 0xBEC4, 0x596E, 0xBEC5, 0x5B1D, 0xBEC6, 0x5B34, + 0xBEC7, 0x5B78, 0xBEC8, 0x5BF0, 0xBEC9, 0x5C0E, 0xBECA, 0x5F4A, 0xBECB, 0x61B2, 0xBECC, 0x6191, 0xBECD, 0x61A9, 0xBECE, 0x618A, + 0xBECF, 0x61CD, 0xBED0, 0x61B6, 0xBED1, 0x61BE, 0xBED2, 0x61CA, 0xBED3, 0x61C8, 0xBED4, 0x6230, 0xBED5, 0x64C5, 0xBED6, 0x64C1, + 0xBED7, 0x64CB, 0xBED8, 0x64BB, 0xBED9, 0x64BC, 0xBEDA, 0x64DA, 0xBEDB, 0x64C4, 0xBEDC, 0x64C7, 0xBEDD, 0x64C2, 0xBEDE, 0x64CD, + 0xBEDF, 0x64BF, 0xBEE0, 0x64D2, 0xBEE1, 0x64D4, 0xBEE2, 0x64BE, 0xBEE3, 0x6574, 0xBEE4, 0x66C6, 0xBEE5, 0x66C9, 0xBEE6, 0x66B9, + 0xBEE7, 0x66C4, 0xBEE8, 0x66C7, 0xBEE9, 0x66B8, 0xBEEA, 0x6A3D, 0xBEEB, 0x6A38, 0xBEEC, 0x6A3A, 0xBEED, 0x6A59, 0xBEEE, 0x6A6B, + 0xBEEF, 0x6A58, 0xBEF0, 0x6A39, 0xBEF1, 0x6A44, 0xBEF2, 0x6A62, 0xBEF3, 0x6A61, 0xBEF4, 0x6A4B, 0xBEF5, 0x6A47, 0xBEF6, 0x6A35, + 0xBEF7, 0x6A5F, 0xBEF8, 0x6A48, 0xBEF9, 0x6B59, 0xBEFA, 0x6B77, 0xBEFB, 0x6C05, 0xBEFC, 0x6FC2, 0xBEFD, 0x6FB1, 0xBEFE, 0x6FA1, + 0xBF40, 0x6FC3, 0xBF41, 0x6FA4, 0xBF42, 0x6FC1, 0xBF43, 0x6FA7, 0xBF44, 0x6FB3, 0xBF45, 0x6FC0, 0xBF46, 0x6FB9, 0xBF47, 0x6FB6, + 0xBF48, 0x6FA6, 0xBF49, 0x6FA0, 0xBF4A, 0x6FB4, 0xBF4B, 0x71BE, 0xBF4C, 0x71C9, 0xBF4D, 0x71D0, 0xBF4E, 0x71D2, 0xBF4F, 0x71C8, + 0xBF50, 0x71D5, 0xBF51, 0x71B9, 0xBF52, 0x71CE, 0xBF53, 0x71D9, 0xBF54, 0x71DC, 0xBF55, 0x71C3, 0xBF56, 0x71C4, 0xBF57, 0x7368, + 0xBF58, 0x749C, 0xBF59, 0x74A3, 0xBF5A, 0x7498, 0xBF5B, 0x749F, 0xBF5C, 0x749E, 0xBF5D, 0x74E2, 0xBF5E, 0x750C, 0xBF5F, 0x750D, + 0xBF60, 0x7634, 0xBF61, 0x7638, 0xBF62, 0x763A, 0xBF63, 0x76E7, 0xBF64, 0x76E5, 0xBF65, 0x77A0, 0xBF66, 0x779E, 0xBF67, 0x779F, + 0xBF68, 0x77A5, 0xBF69, 0x78E8, 0xBF6A, 0x78DA, 0xBF6B, 0x78EC, 0xBF6C, 0x78E7, 0xBF6D, 0x79A6, 0xBF6E, 0x7A4D, 0xBF6F, 0x7A4E, + 0xBF70, 0x7A46, 0xBF71, 0x7A4C, 0xBF72, 0x7A4B, 0xBF73, 0x7ABA, 0xBF74, 0x7BD9, 0xBF75, 0x7C11, 0xBF76, 0x7BC9, 0xBF77, 0x7BE4, + 0xBF78, 0x7BDB, 0xBF79, 0x7BE1, 0xBF7A, 0x7BE9, 0xBF7B, 0x7BE6, 0xBF7C, 0x7CD5, 0xBF7D, 0x7CD6, 0xBF7E, 0x7E0A, 0xBFA1, 0x7E11, + 0xBFA2, 0x7E08, 0xBFA3, 0x7E1B, 0xBFA4, 0x7E23, 0xBFA5, 0x7E1E, 0xBFA6, 0x7E1D, 0xBFA7, 0x7E09, 0xBFA8, 0x7E10, 0xBFA9, 0x7F79, + 0xBFAA, 0x7FB2, 0xBFAB, 0x7FF0, 0xBFAC, 0x7FF1, 0xBFAD, 0x7FEE, 0xBFAE, 0x8028, 0xBFAF, 0x81B3, 0xBFB0, 0x81A9, 0xBFB1, 0x81A8, + 0xBFB2, 0x81FB, 0xBFB3, 0x8208, 0xBFB4, 0x8258, 0xBFB5, 0x8259, 0xBFB6, 0x854A, 0xBFB7, 0x8559, 0xBFB8, 0x8548, 0xBFB9, 0x8568, + 0xBFBA, 0x8569, 0xBFBB, 0x8543, 0xBFBC, 0x8549, 0xBFBD, 0x856D, 0xBFBE, 0x856A, 0xBFBF, 0x855E, 0xBFC0, 0x8783, 0xBFC1, 0x879F, + 0xBFC2, 0x879E, 0xBFC3, 0x87A2, 0xBFC4, 0x878D, 0xBFC5, 0x8861, 0xBFC6, 0x892A, 0xBFC7, 0x8932, 0xBFC8, 0x8925, 0xBFC9, 0x892B, + 0xBFCA, 0x8921, 0xBFCB, 0x89AA, 0xBFCC, 0x89A6, 0xBFCD, 0x8AE6, 0xBFCE, 0x8AFA, 0xBFCF, 0x8AEB, 0xBFD0, 0x8AF1, 0xBFD1, 0x8B00, + 0xBFD2, 0x8ADC, 0xBFD3, 0x8AE7, 0xBFD4, 0x8AEE, 0xBFD5, 0x8AFE, 0xBFD6, 0x8B01, 0xBFD7, 0x8B02, 0xBFD8, 0x8AF7, 0xBFD9, 0x8AED, + 0xBFDA, 0x8AF3, 0xBFDB, 0x8AF6, 0xBFDC, 0x8AFC, 0xBFDD, 0x8C6B, 0xBFDE, 0x8C6D, 0xBFDF, 0x8C93, 0xBFE0, 0x8CF4, 0xBFE1, 0x8E44, + 0xBFE2, 0x8E31, 0xBFE3, 0x8E34, 0xBFE4, 0x8E42, 0xBFE5, 0x8E39, 0xBFE6, 0x8E35, 0xBFE7, 0x8F3B, 0xBFE8, 0x8F2F, 0xBFE9, 0x8F38, + 0xBFEA, 0x8F33, 0xBFEB, 0x8FA8, 0xBFEC, 0x8FA6, 0xBFED, 0x9075, 0xBFEE, 0x9074, 0xBFEF, 0x9078, 0xBFF0, 0x9072, 0xBFF1, 0x907C, + 0xBFF2, 0x907A, 0xBFF3, 0x9134, 0xBFF4, 0x9192, 0xBFF5, 0x9320, 0xBFF6, 0x9336, 0xBFF7, 0x92F8, 0xBFF8, 0x9333, 0xBFF9, 0x932F, + 0xBFFA, 0x9322, 0xBFFB, 0x92FC, 0xBFFC, 0x932B, 0xBFFD, 0x9304, 0xBFFE, 0x931A, 0xC040, 0x9310, 0xC041, 0x9326, 0xC042, 0x9321, + 0xC043, 0x9315, 0xC044, 0x932E, 0xC045, 0x9319, 0xC046, 0x95BB, 0xC047, 0x96A7, 0xC048, 0x96A8, 0xC049, 0x96AA, 0xC04A, 0x96D5, + 0xC04B, 0x970E, 0xC04C, 0x9711, 0xC04D, 0x9716, 0xC04E, 0x970D, 0xC04F, 0x9713, 0xC050, 0x970F, 0xC051, 0x975B, 0xC052, 0x975C, + 0xC053, 0x9766, 0xC054, 0x9798, 0xC055, 0x9830, 0xC056, 0x9838, 0xC057, 0x983B, 0xC058, 0x9837, 0xC059, 0x982D, 0xC05A, 0x9839, + 0xC05B, 0x9824, 0xC05C, 0x9910, 0xC05D, 0x9928, 0xC05E, 0x991E, 0xC05F, 0x991B, 0xC060, 0x9921, 0xC061, 0x991A, 0xC062, 0x99ED, + 0xC063, 0x99E2, 0xC064, 0x99F1, 0xC065, 0x9AB8, 0xC066, 0x9ABC, 0xC067, 0x9AFB, 0xC068, 0x9AED, 0xC069, 0x9B28, 0xC06A, 0x9B91, + 0xC06B, 0x9D15, 0xC06C, 0x9D23, 0xC06D, 0x9D26, 0xC06E, 0x9D28, 0xC06F, 0x9D12, 0xC070, 0x9D1B, 0xC071, 0x9ED8, 0xC072, 0x9ED4, + 0xC073, 0x9F8D, 0xC074, 0x9F9C, 0xC075, 0x512A, 0xC076, 0x511F, 0xC077, 0x5121, 0xC078, 0x5132, 0xC079, 0x52F5, 0xC07A, 0x568E, + 0xC07B, 0x5680, 0xC07C, 0x5690, 0xC07D, 0x5685, 0xC07E, 0x5687, 0xC0A1, 0x568F, 0xC0A2, 0x58D5, 0xC0A3, 0x58D3, 0xC0A4, 0x58D1, + 0xC0A5, 0x58CE, 0xC0A6, 0x5B30, 0xC0A7, 0x5B2A, 0xC0A8, 0x5B24, 0xC0A9, 0x5B7A, 0xC0AA, 0x5C37, 0xC0AB, 0x5C68, 0xC0AC, 0x5DBC, + 0xC0AD, 0x5DBA, 0xC0AE, 0x5DBD, 0xC0AF, 0x5DB8, 0xC0B0, 0x5E6B, 0xC0B1, 0x5F4C, 0xC0B2, 0x5FBD, 0xC0B3, 0x61C9, 0xC0B4, 0x61C2, + 0xC0B5, 0x61C7, 0xC0B6, 0x61E6, 0xC0B7, 0x61CB, 0xC0B8, 0x6232, 0xC0B9, 0x6234, 0xC0BA, 0x64CE, 0xC0BB, 0x64CA, 0xC0BC, 0x64D8, + 0xC0BD, 0x64E0, 0xC0BE, 0x64F0, 0xC0BF, 0x64E6, 0xC0C0, 0x64EC, 0xC0C1, 0x64F1, 0xC0C2, 0x64E2, 0xC0C3, 0x64ED, 0xC0C4, 0x6582, + 0xC0C5, 0x6583, 0xC0C6, 0x66D9, 0xC0C7, 0x66D6, 0xC0C8, 0x6A80, 0xC0C9, 0x6A94, 0xC0CA, 0x6A84, 0xC0CB, 0x6AA2, 0xC0CC, 0x6A9C, + 0xC0CD, 0x6ADB, 0xC0CE, 0x6AA3, 0xC0CF, 0x6A7E, 0xC0D0, 0x6A97, 0xC0D1, 0x6A90, 0xC0D2, 0x6AA0, 0xC0D3, 0x6B5C, 0xC0D4, 0x6BAE, + 0xC0D5, 0x6BDA, 0xC0D6, 0x6C08, 0xC0D7, 0x6FD8, 0xC0D8, 0x6FF1, 0xC0D9, 0x6FDF, 0xC0DA, 0x6FE0, 0xC0DB, 0x6FDB, 0xC0DC, 0x6FE4, + 0xC0DD, 0x6FEB, 0xC0DE, 0x6FEF, 0xC0DF, 0x6F80, 0xC0E0, 0x6FEC, 0xC0E1, 0x6FE1, 0xC0E2, 0x6FE9, 0xC0E3, 0x6FD5, 0xC0E4, 0x6FEE, + 0xC0E5, 0x6FF0, 0xC0E6, 0x71E7, 0xC0E7, 0x71DF, 0xC0E8, 0x71EE, 0xC0E9, 0x71E6, 0xC0EA, 0x71E5, 0xC0EB, 0x71ED, 0xC0EC, 0x71EC, + 0xC0ED, 0x71F4, 0xC0EE, 0x71E0, 0xC0EF, 0x7235, 0xC0F0, 0x7246, 0xC0F1, 0x7370, 0xC0F2, 0x7372, 0xC0F3, 0x74A9, 0xC0F4, 0x74B0, + 0xC0F5, 0x74A6, 0xC0F6, 0x74A8, 0xC0F7, 0x7646, 0xC0F8, 0x7642, 0xC0F9, 0x764C, 0xC0FA, 0x76EA, 0xC0FB, 0x77B3, 0xC0FC, 0x77AA, + 0xC0FD, 0x77B0, 0xC0FE, 0x77AC, 0xC140, 0x77A7, 0xC141, 0x77AD, 0xC142, 0x77EF, 0xC143, 0x78F7, 0xC144, 0x78FA, 0xC145, 0x78F4, + 0xC146, 0x78EF, 0xC147, 0x7901, 0xC148, 0x79A7, 0xC149, 0x79AA, 0xC14A, 0x7A57, 0xC14B, 0x7ABF, 0xC14C, 0x7C07, 0xC14D, 0x7C0D, + 0xC14E, 0x7BFE, 0xC14F, 0x7BF7, 0xC150, 0x7C0C, 0xC151, 0x7BE0, 0xC152, 0x7CE0, 0xC153, 0x7CDC, 0xC154, 0x7CDE, 0xC155, 0x7CE2, + 0xC156, 0x7CDF, 0xC157, 0x7CD9, 0xC158, 0x7CDD, 0xC159, 0x7E2E, 0xC15A, 0x7E3E, 0xC15B, 0x7E46, 0xC15C, 0x7E37, 0xC15D, 0x7E32, + 0xC15E, 0x7E43, 0xC15F, 0x7E2B, 0xC160, 0x7E3D, 0xC161, 0x7E31, 0xC162, 0x7E45, 0xC163, 0x7E41, 0xC164, 0x7E34, 0xC165, 0x7E39, + 0xC166, 0x7E48, 0xC167, 0x7E35, 0xC168, 0x7E3F, 0xC169, 0x7E2F, 0xC16A, 0x7F44, 0xC16B, 0x7FF3, 0xC16C, 0x7FFC, 0xC16D, 0x8071, + 0xC16E, 0x8072, 0xC16F, 0x8070, 0xC170, 0x806F, 0xC171, 0x8073, 0xC172, 0x81C6, 0xC173, 0x81C3, 0xC174, 0x81BA, 0xC175, 0x81C2, + 0xC176, 0x81C0, 0xC177, 0x81BF, 0xC178, 0x81BD, 0xC179, 0x81C9, 0xC17A, 0x81BE, 0xC17B, 0x81E8, 0xC17C, 0x8209, 0xC17D, 0x8271, + 0xC17E, 0x85AA, 0xC1A1, 0x8584, 0xC1A2, 0x857E, 0xC1A3, 0x859C, 0xC1A4, 0x8591, 0xC1A5, 0x8594, 0xC1A6, 0x85AF, 0xC1A7, 0x859B, + 0xC1A8, 0x8587, 0xC1A9, 0x85A8, 0xC1AA, 0x858A, 0xC1AB, 0x8667, 0xC1AC, 0x87C0, 0xC1AD, 0x87D1, 0xC1AE, 0x87B3, 0xC1AF, 0x87D2, + 0xC1B0, 0x87C6, 0xC1B1, 0x87AB, 0xC1B2, 0x87BB, 0xC1B3, 0x87BA, 0xC1B4, 0x87C8, 0xC1B5, 0x87CB, 0xC1B6, 0x893B, 0xC1B7, 0x8936, + 0xC1B8, 0x8944, 0xC1B9, 0x8938, 0xC1BA, 0x893D, 0xC1BB, 0x89AC, 0xC1BC, 0x8B0E, 0xC1BD, 0x8B17, 0xC1BE, 0x8B19, 0xC1BF, 0x8B1B, + 0xC1C0, 0x8B0A, 0xC1C1, 0x8B20, 0xC1C2, 0x8B1D, 0xC1C3, 0x8B04, 0xC1C4, 0x8B10, 0xC1C5, 0x8C41, 0xC1C6, 0x8C3F, 0xC1C7, 0x8C73, + 0xC1C8, 0x8CFA, 0xC1C9, 0x8CFD, 0xC1CA, 0x8CFC, 0xC1CB, 0x8CF8, 0xC1CC, 0x8CFB, 0xC1CD, 0x8DA8, 0xC1CE, 0x8E49, 0xC1CF, 0x8E4B, + 0xC1D0, 0x8E48, 0xC1D1, 0x8E4A, 0xC1D2, 0x8F44, 0xC1D3, 0x8F3E, 0xC1D4, 0x8F42, 0xC1D5, 0x8F45, 0xC1D6, 0x8F3F, 0xC1D7, 0x907F, + 0xC1D8, 0x907D, 0xC1D9, 0x9084, 0xC1DA, 0x9081, 0xC1DB, 0x9082, 0xC1DC, 0x9080, 0xC1DD, 0x9139, 0xC1DE, 0x91A3, 0xC1DF, 0x919E, + 0xC1E0, 0x919C, 0xC1E1, 0x934D, 0xC1E2, 0x9382, 0xC1E3, 0x9328, 0xC1E4, 0x9375, 0xC1E5, 0x934A, 0xC1E6, 0x9365, 0xC1E7, 0x934B, + 0xC1E8, 0x9318, 0xC1E9, 0x937E, 0xC1EA, 0x936C, 0xC1EB, 0x935B, 0xC1EC, 0x9370, 0xC1ED, 0x935A, 0xC1EE, 0x9354, 0xC1EF, 0x95CA, + 0xC1F0, 0x95CB, 0xC1F1, 0x95CC, 0xC1F2, 0x95C8, 0xC1F3, 0x95C6, 0xC1F4, 0x96B1, 0xC1F5, 0x96B8, 0xC1F6, 0x96D6, 0xC1F7, 0x971C, + 0xC1F8, 0x971E, 0xC1F9, 0x97A0, 0xC1FA, 0x97D3, 0xC1FB, 0x9846, 0xC1FC, 0x98B6, 0xC1FD, 0x9935, 0xC1FE, 0x9A01, 0xC240, 0x99FF, + 0xC241, 0x9BAE, 0xC242, 0x9BAB, 0xC243, 0x9BAA, 0xC244, 0x9BAD, 0xC245, 0x9D3B, 0xC246, 0x9D3F, 0xC247, 0x9E8B, 0xC248, 0x9ECF, + 0xC249, 0x9EDE, 0xC24A, 0x9EDC, 0xC24B, 0x9EDD, 0xC24C, 0x9EDB, 0xC24D, 0x9F3E, 0xC24E, 0x9F4B, 0xC24F, 0x53E2, 0xC250, 0x5695, + 0xC251, 0x56AE, 0xC252, 0x58D9, 0xC253, 0x58D8, 0xC254, 0x5B38, 0xC255, 0x5F5D, 0xC256, 0x61E3, 0xC257, 0x6233, 0xC258, 0x64F4, + 0xC259, 0x64F2, 0xC25A, 0x64FE, 0xC25B, 0x6506, 0xC25C, 0x64FA, 0xC25D, 0x64FB, 0xC25E, 0x64F7, 0xC25F, 0x65B7, 0xC260, 0x66DC, + 0xC261, 0x6726, 0xC262, 0x6AB3, 0xC263, 0x6AAC, 0xC264, 0x6AC3, 0xC265, 0x6ABB, 0xC266, 0x6AB8, 0xC267, 0x6AC2, 0xC268, 0x6AAE, + 0xC269, 0x6AAF, 0xC26A, 0x6B5F, 0xC26B, 0x6B78, 0xC26C, 0x6BAF, 0xC26D, 0x7009, 0xC26E, 0x700B, 0xC26F, 0x6FFE, 0xC270, 0x7006, + 0xC271, 0x6FFA, 0xC272, 0x7011, 0xC273, 0x700F, 0xC274, 0x71FB, 0xC275, 0x71FC, 0xC276, 0x71FE, 0xC277, 0x71F8, 0xC278, 0x7377, + 0xC279, 0x7375, 0xC27A, 0x74A7, 0xC27B, 0x74BF, 0xC27C, 0x7515, 0xC27D, 0x7656, 0xC27E, 0x7658, 0xC2A1, 0x7652, 0xC2A2, 0x77BD, + 0xC2A3, 0x77BF, 0xC2A4, 0x77BB, 0xC2A5, 0x77BC, 0xC2A6, 0x790E, 0xC2A7, 0x79AE, 0xC2A8, 0x7A61, 0xC2A9, 0x7A62, 0xC2AA, 0x7A60, + 0xC2AB, 0x7AC4, 0xC2AC, 0x7AC5, 0xC2AD, 0x7C2B, 0xC2AE, 0x7C27, 0xC2AF, 0x7C2A, 0xC2B0, 0x7C1E, 0xC2B1, 0x7C23, 0xC2B2, 0x7C21, + 0xC2B3, 0x7CE7, 0xC2B4, 0x7E54, 0xC2B5, 0x7E55, 0xC2B6, 0x7E5E, 0xC2B7, 0x7E5A, 0xC2B8, 0x7E61, 0xC2B9, 0x7E52, 0xC2BA, 0x7E59, + 0xC2BB, 0x7F48, 0xC2BC, 0x7FF9, 0xC2BD, 0x7FFB, 0xC2BE, 0x8077, 0xC2BF, 0x8076, 0xC2C0, 0x81CD, 0xC2C1, 0x81CF, 0xC2C2, 0x820A, + 0xC2C3, 0x85CF, 0xC2C4, 0x85A9, 0xC2C5, 0x85CD, 0xC2C6, 0x85D0, 0xC2C7, 0x85C9, 0xC2C8, 0x85B0, 0xC2C9, 0x85BA, 0xC2CA, 0x85B9, + 0xC2CB, 0x85A6, 0xC2CC, 0x87EF, 0xC2CD, 0x87EC, 0xC2CE, 0x87F2, 0xC2CF, 0x87E0, 0xC2D0, 0x8986, 0xC2D1, 0x89B2, 0xC2D2, 0x89F4, + 0xC2D3, 0x8B28, 0xC2D4, 0x8B39, 0xC2D5, 0x8B2C, 0xC2D6, 0x8B2B, 0xC2D7, 0x8C50, 0xC2D8, 0x8D05, 0xC2D9, 0x8E59, 0xC2DA, 0x8E63, + 0xC2DB, 0x8E66, 0xC2DC, 0x8E64, 0xC2DD, 0x8E5F, 0xC2DE, 0x8E55, 0xC2DF, 0x8EC0, 0xC2E0, 0x8F49, 0xC2E1, 0x8F4D, 0xC2E2, 0x9087, + 0xC2E3, 0x9083, 0xC2E4, 0x9088, 0xC2E5, 0x91AB, 0xC2E6, 0x91AC, 0xC2E7, 0x91D0, 0xC2E8, 0x9394, 0xC2E9, 0x938A, 0xC2EA, 0x9396, + 0xC2EB, 0x93A2, 0xC2EC, 0x93B3, 0xC2ED, 0x93AE, 0xC2EE, 0x93AC, 0xC2EF, 0x93B0, 0xC2F0, 0x9398, 0xC2F1, 0x939A, 0xC2F2, 0x9397, + 0xC2F3, 0x95D4, 0xC2F4, 0x95D6, 0xC2F5, 0x95D0, 0xC2F6, 0x95D5, 0xC2F7, 0x96E2, 0xC2F8, 0x96DC, 0xC2F9, 0x96D9, 0xC2FA, 0x96DB, + 0xC2FB, 0x96DE, 0xC2FC, 0x9724, 0xC2FD, 0x97A3, 0xC2FE, 0x97A6, 0xC340, 0x97AD, 0xC341, 0x97F9, 0xC342, 0x984D, 0xC343, 0x984F, + 0xC344, 0x984C, 0xC345, 0x984E, 0xC346, 0x9853, 0xC347, 0x98BA, 0xC348, 0x993E, 0xC349, 0x993F, 0xC34A, 0x993D, 0xC34B, 0x992E, + 0xC34C, 0x99A5, 0xC34D, 0x9A0E, 0xC34E, 0x9AC1, 0xC34F, 0x9B03, 0xC350, 0x9B06, 0xC351, 0x9B4F, 0xC352, 0x9B4E, 0xC353, 0x9B4D, + 0xC354, 0x9BCA, 0xC355, 0x9BC9, 0xC356, 0x9BFD, 0xC357, 0x9BC8, 0xC358, 0x9BC0, 0xC359, 0x9D51, 0xC35A, 0x9D5D, 0xC35B, 0x9D60, + 0xC35C, 0x9EE0, 0xC35D, 0x9F15, 0xC35E, 0x9F2C, 0xC35F, 0x5133, 0xC360, 0x56A5, 0xC361, 0x58DE, 0xC362, 0x58DF, 0xC363, 0x58E2, + 0xC364, 0x5BF5, 0xC365, 0x9F90, 0xC366, 0x5EEC, 0xC367, 0x61F2, 0xC368, 0x61F7, 0xC369, 0x61F6, 0xC36A, 0x61F5, 0xC36B, 0x6500, + 0xC36C, 0x650F, 0xC36D, 0x66E0, 0xC36E, 0x66DD, 0xC36F, 0x6AE5, 0xC370, 0x6ADD, 0xC371, 0x6ADA, 0xC372, 0x6AD3, 0xC373, 0x701B, + 0xC374, 0x701F, 0xC375, 0x7028, 0xC376, 0x701A, 0xC377, 0x701D, 0xC378, 0x7015, 0xC379, 0x7018, 0xC37A, 0x7206, 0xC37B, 0x720D, + 0xC37C, 0x7258, 0xC37D, 0x72A2, 0xC37E, 0x7378, 0xC3A1, 0x737A, 0xC3A2, 0x74BD, 0xC3A3, 0x74CA, 0xC3A4, 0x74E3, 0xC3A5, 0x7587, + 0xC3A6, 0x7586, 0xC3A7, 0x765F, 0xC3A8, 0x7661, 0xC3A9, 0x77C7, 0xC3AA, 0x7919, 0xC3AB, 0x79B1, 0xC3AC, 0x7A6B, 0xC3AD, 0x7A69, + 0xC3AE, 0x7C3E, 0xC3AF, 0x7C3F, 0xC3B0, 0x7C38, 0xC3B1, 0x7C3D, 0xC3B2, 0x7C37, 0xC3B3, 0x7C40, 0xC3B4, 0x7E6B, 0xC3B5, 0x7E6D, + 0xC3B6, 0x7E79, 0xC3B7, 0x7E69, 0xC3B8, 0x7E6A, 0xC3B9, 0x7F85, 0xC3BA, 0x7E73, 0xC3BB, 0x7FB6, 0xC3BC, 0x7FB9, 0xC3BD, 0x7FB8, + 0xC3BE, 0x81D8, 0xC3BF, 0x85E9, 0xC3C0, 0x85DD, 0xC3C1, 0x85EA, 0xC3C2, 0x85D5, 0xC3C3, 0x85E4, 0xC3C4, 0x85E5, 0xC3C5, 0x85F7, + 0xC3C6, 0x87FB, 0xC3C7, 0x8805, 0xC3C8, 0x880D, 0xC3C9, 0x87F9, 0xC3CA, 0x87FE, 0xC3CB, 0x8960, 0xC3CC, 0x895F, 0xC3CD, 0x8956, + 0xC3CE, 0x895E, 0xC3CF, 0x8B41, 0xC3D0, 0x8B5C, 0xC3D1, 0x8B58, 0xC3D2, 0x8B49, 0xC3D3, 0x8B5A, 0xC3D4, 0x8B4E, 0xC3D5, 0x8B4F, + 0xC3D6, 0x8B46, 0xC3D7, 0x8B59, 0xC3D8, 0x8D08, 0xC3D9, 0x8D0A, 0xC3DA, 0x8E7C, 0xC3DB, 0x8E72, 0xC3DC, 0x8E87, 0xC3DD, 0x8E76, + 0xC3DE, 0x8E6C, 0xC3DF, 0x8E7A, 0xC3E0, 0x8E74, 0xC3E1, 0x8F54, 0xC3E2, 0x8F4E, 0xC3E3, 0x8FAD, 0xC3E4, 0x908A, 0xC3E5, 0x908B, + 0xC3E6, 0x91B1, 0xC3E7, 0x91AE, 0xC3E8, 0x93E1, 0xC3E9, 0x93D1, 0xC3EA, 0x93DF, 0xC3EB, 0x93C3, 0xC3EC, 0x93C8, 0xC3ED, 0x93DC, + 0xC3EE, 0x93DD, 0xC3EF, 0x93D6, 0xC3F0, 0x93E2, 0xC3F1, 0x93CD, 0xC3F2, 0x93D8, 0xC3F3, 0x93E4, 0xC3F4, 0x93D7, 0xC3F5, 0x93E8, + 0xC3F6, 0x95DC, 0xC3F7, 0x96B4, 0xC3F8, 0x96E3, 0xC3F9, 0x972A, 0xC3FA, 0x9727, 0xC3FB, 0x9761, 0xC3FC, 0x97DC, 0xC3FD, 0x97FB, + 0xC3FE, 0x985E, 0xC440, 0x9858, 0xC441, 0x985B, 0xC442, 0x98BC, 0xC443, 0x9945, 0xC444, 0x9949, 0xC445, 0x9A16, 0xC446, 0x9A19, + 0xC447, 0x9B0D, 0xC448, 0x9BE8, 0xC449, 0x9BE7, 0xC44A, 0x9BD6, 0xC44B, 0x9BDB, 0xC44C, 0x9D89, 0xC44D, 0x9D61, 0xC44E, 0x9D72, + 0xC44F, 0x9D6A, 0xC450, 0x9D6C, 0xC451, 0x9E92, 0xC452, 0x9E97, 0xC453, 0x9E93, 0xC454, 0x9EB4, 0xC455, 0x52F8, 0xC456, 0x56A8, + 0xC457, 0x56B7, 0xC458, 0x56B6, 0xC459, 0x56B4, 0xC45A, 0x56BC, 0xC45B, 0x58E4, 0xC45C, 0x5B40, 0xC45D, 0x5B43, 0xC45E, 0x5B7D, + 0xC45F, 0x5BF6, 0xC460, 0x5DC9, 0xC461, 0x61F8, 0xC462, 0x61FA, 0xC463, 0x6518, 0xC464, 0x6514, 0xC465, 0x6519, 0xC466, 0x66E6, + 0xC467, 0x6727, 0xC468, 0x6AEC, 0xC469, 0x703E, 0xC46A, 0x7030, 0xC46B, 0x7032, 0xC46C, 0x7210, 0xC46D, 0x737B, 0xC46E, 0x74CF, + 0xC46F, 0x7662, 0xC470, 0x7665, 0xC471, 0x7926, 0xC472, 0x792A, 0xC473, 0x792C, 0xC474, 0x792B, 0xC475, 0x7AC7, 0xC476, 0x7AF6, + 0xC477, 0x7C4C, 0xC478, 0x7C43, 0xC479, 0x7C4D, 0xC47A, 0x7CEF, 0xC47B, 0x7CF0, 0xC47C, 0x8FAE, 0xC47D, 0x7E7D, 0xC47E, 0x7E7C, + 0xC4A1, 0x7E82, 0xC4A2, 0x7F4C, 0xC4A3, 0x8000, 0xC4A4, 0x81DA, 0xC4A5, 0x8266, 0xC4A6, 0x85FB, 0xC4A7, 0x85F9, 0xC4A8, 0x8611, + 0xC4A9, 0x85FA, 0xC4AA, 0x8606, 0xC4AB, 0x860B, 0xC4AC, 0x8607, 0xC4AD, 0x860A, 0xC4AE, 0x8814, 0xC4AF, 0x8815, 0xC4B0, 0x8964, + 0xC4B1, 0x89BA, 0xC4B2, 0x89F8, 0xC4B3, 0x8B70, 0xC4B4, 0x8B6C, 0xC4B5, 0x8B66, 0xC4B6, 0x8B6F, 0xC4B7, 0x8B5F, 0xC4B8, 0x8B6B, + 0xC4B9, 0x8D0F, 0xC4BA, 0x8D0D, 0xC4BB, 0x8E89, 0xC4BC, 0x8E81, 0xC4BD, 0x8E85, 0xC4BE, 0x8E82, 0xC4BF, 0x91B4, 0xC4C0, 0x91CB, + 0xC4C1, 0x9418, 0xC4C2, 0x9403, 0xC4C3, 0x93FD, 0xC4C4, 0x95E1, 0xC4C5, 0x9730, 0xC4C6, 0x98C4, 0xC4C7, 0x9952, 0xC4C8, 0x9951, + 0xC4C9, 0x99A8, 0xC4CA, 0x9A2B, 0xC4CB, 0x9A30, 0xC4CC, 0x9A37, 0xC4CD, 0x9A35, 0xC4CE, 0x9C13, 0xC4CF, 0x9C0D, 0xC4D0, 0x9E79, + 0xC4D1, 0x9EB5, 0xC4D2, 0x9EE8, 0xC4D3, 0x9F2F, 0xC4D4, 0x9F5F, 0xC4D5, 0x9F63, 0xC4D6, 0x9F61, 0xC4D7, 0x5137, 0xC4D8, 0x5138, + 0xC4D9, 0x56C1, 0xC4DA, 0x56C0, 0xC4DB, 0x56C2, 0xC4DC, 0x5914, 0xC4DD, 0x5C6C, 0xC4DE, 0x5DCD, 0xC4DF, 0x61FC, 0xC4E0, 0x61FE, + 0xC4E1, 0x651D, 0xC4E2, 0x651C, 0xC4E3, 0x6595, 0xC4E4, 0x66E9, 0xC4E5, 0x6AFB, 0xC4E6, 0x6B04, 0xC4E7, 0x6AFA, 0xC4E8, 0x6BB2, + 0xC4E9, 0x704C, 0xC4EA, 0x721B, 0xC4EB, 0x72A7, 0xC4EC, 0x74D6, 0xC4ED, 0x74D4, 0xC4EE, 0x7669, 0xC4EF, 0x77D3, 0xC4F0, 0x7C50, + 0xC4F1, 0x7E8F, 0xC4F2, 0x7E8C, 0xC4F3, 0x7FBC, 0xC4F4, 0x8617, 0xC4F5, 0x862D, 0xC4F6, 0x861A, 0xC4F7, 0x8823, 0xC4F8, 0x8822, + 0xC4F9, 0x8821, 0xC4FA, 0x881F, 0xC4FB, 0x896A, 0xC4FC, 0x896C, 0xC4FD, 0x89BD, 0xC4FE, 0x8B74, 0xC540, 0x8B77, 0xC541, 0x8B7D, + 0xC542, 0x8D13, 0xC543, 0x8E8A, 0xC544, 0x8E8D, 0xC545, 0x8E8B, 0xC546, 0x8F5F, 0xC547, 0x8FAF, 0xC548, 0x91BA, 0xC549, 0x942E, + 0xC54A, 0x9433, 0xC54B, 0x9435, 0xC54C, 0x943A, 0xC54D, 0x9438, 0xC54E, 0x9432, 0xC54F, 0x942B, 0xC550, 0x95E2, 0xC551, 0x9738, + 0xC552, 0x9739, 0xC553, 0x9732, 0xC554, 0x97FF, 0xC555, 0x9867, 0xC556, 0x9865, 0xC557, 0x9957, 0xC558, 0x9A45, 0xC559, 0x9A43, + 0xC55A, 0x9A40, 0xC55B, 0x9A3E, 0xC55C, 0x9ACF, 0xC55D, 0x9B54, 0xC55E, 0x9B51, 0xC55F, 0x9C2D, 0xC560, 0x9C25, 0xC561, 0x9DAF, + 0xC562, 0x9DB4, 0xC563, 0x9DC2, 0xC564, 0x9DB8, 0xC565, 0x9E9D, 0xC566, 0x9EEF, 0xC567, 0x9F19, 0xC568, 0x9F5C, 0xC569, 0x9F66, + 0xC56A, 0x9F67, 0xC56B, 0x513C, 0xC56C, 0x513B, 0xC56D, 0x56C8, 0xC56E, 0x56CA, 0xC56F, 0x56C9, 0xC570, 0x5B7F, 0xC571, 0x5DD4, + 0xC572, 0x5DD2, 0xC573, 0x5F4E, 0xC574, 0x61FF, 0xC575, 0x6524, 0xC576, 0x6B0A, 0xC577, 0x6B61, 0xC578, 0x7051, 0xC579, 0x7058, + 0xC57A, 0x7380, 0xC57B, 0x74E4, 0xC57C, 0x758A, 0xC57D, 0x766E, 0xC57E, 0x766C, 0xC5A1, 0x79B3, 0xC5A2, 0x7C60, 0xC5A3, 0x7C5F, + 0xC5A4, 0x807E, 0xC5A5, 0x807D, 0xC5A6, 0x81DF, 0xC5A7, 0x8972, 0xC5A8, 0x896F, 0xC5A9, 0x89FC, 0xC5AA, 0x8B80, 0xC5AB, 0x8D16, + 0xC5AC, 0x8D17, 0xC5AD, 0x8E91, 0xC5AE, 0x8E93, 0xC5AF, 0x8F61, 0xC5B0, 0x9148, 0xC5B1, 0x9444, 0xC5B2, 0x9451, 0xC5B3, 0x9452, + 0xC5B4, 0x973D, 0xC5B5, 0x973E, 0xC5B6, 0x97C3, 0xC5B7, 0x97C1, 0xC5B8, 0x986B, 0xC5B9, 0x9955, 0xC5BA, 0x9A55, 0xC5BB, 0x9A4D, + 0xC5BC, 0x9AD2, 0xC5BD, 0x9B1A, 0xC5BE, 0x9C49, 0xC5BF, 0x9C31, 0xC5C0, 0x9C3E, 0xC5C1, 0x9C3B, 0xC5C2, 0x9DD3, 0xC5C3, 0x9DD7, + 0xC5C4, 0x9F34, 0xC5C5, 0x9F6C, 0xC5C6, 0x9F6A, 0xC5C7, 0x9F94, 0xC5C8, 0x56CC, 0xC5C9, 0x5DD6, 0xC5CA, 0x6200, 0xC5CB, 0x6523, + 0xC5CC, 0x652B, 0xC5CD, 0x652A, 0xC5CE, 0x66EC, 0xC5CF, 0x6B10, 0xC5D0, 0x74DA, 0xC5D1, 0x7ACA, 0xC5D2, 0x7C64, 0xC5D3, 0x7C63, + 0xC5D4, 0x7C65, 0xC5D5, 0x7E93, 0xC5D6, 0x7E96, 0xC5D7, 0x7E94, 0xC5D8, 0x81E2, 0xC5D9, 0x8638, 0xC5DA, 0x863F, 0xC5DB, 0x8831, + 0xC5DC, 0x8B8A, 0xC5DD, 0x9090, 0xC5DE, 0x908F, 0xC5DF, 0x9463, 0xC5E0, 0x9460, 0xC5E1, 0x9464, 0xC5E2, 0x9768, 0xC5E3, 0x986F, + 0xC5E4, 0x995C, 0xC5E5, 0x9A5A, 0xC5E6, 0x9A5B, 0xC5E7, 0x9A57, 0xC5E8, 0x9AD3, 0xC5E9, 0x9AD4, 0xC5EA, 0x9AD1, 0xC5EB, 0x9C54, + 0xC5EC, 0x9C57, 0xC5ED, 0x9C56, 0xC5EE, 0x9DE5, 0xC5EF, 0x9E9F, 0xC5F0, 0x9EF4, 0xC5F1, 0x56D1, 0xC5F2, 0x58E9, 0xC5F3, 0x652C, + 0xC5F4, 0x705E, 0xC5F5, 0x7671, 0xC5F6, 0x7672, 0xC5F7, 0x77D7, 0xC5F8, 0x7F50, 0xC5F9, 0x7F88, 0xC5FA, 0x8836, 0xC5FB, 0x8839, + 0xC5FC, 0x8862, 0xC5FD, 0x8B93, 0xC5FE, 0x8B92, 0xC640, 0x8B96, 0xC641, 0x8277, 0xC642, 0x8D1B, 0xC643, 0x91C0, 0xC644, 0x946A, + 0xC645, 0x9742, 0xC646, 0x9748, 0xC647, 0x9744, 0xC648, 0x97C6, 0xC649, 0x9870, 0xC64A, 0x9A5F, 0xC64B, 0x9B22, 0xC64C, 0x9B58, + 0xC64D, 0x9C5F, 0xC64E, 0x9DF9, 0xC64F, 0x9DFA, 0xC650, 0x9E7C, 0xC651, 0x9E7D, 0xC652, 0x9F07, 0xC653, 0x9F77, 0xC654, 0x9F72, + 0xC655, 0x5EF3, 0xC656, 0x6B16, 0xC657, 0x7063, 0xC658, 0x7C6C, 0xC659, 0x7C6E, 0xC65A, 0x883B, 0xC65B, 0x89C0, 0xC65C, 0x8EA1, + 0xC65D, 0x91C1, 0xC65E, 0x9472, 0xC65F, 0x9470, 0xC660, 0x9871, 0xC661, 0x995E, 0xC662, 0x9AD6, 0xC663, 0x9B23, 0xC664, 0x9ECC, + 0xC665, 0x7064, 0xC666, 0x77DA, 0xC667, 0x8B9A, 0xC668, 0x9477, 0xC669, 0x97C9, 0xC66A, 0x9A62, 0xC66B, 0x9A65, 0xC66C, 0x7E9C, + 0xC66D, 0x8B9C, 0xC66E, 0x8EAA, 0xC66F, 0x91C5, 0xC670, 0x947D, 0xC671, 0x947E, 0xC672, 0x947C, 0xC673, 0x9C77, 0xC674, 0x9C78, + 0xC675, 0x9EF7, 0xC676, 0x8C54, 0xC677, 0x947F, 0xC678, 0x9E1A, 0xC679, 0x7228, 0xC67A, 0x9A6A, 0xC67B, 0x9B31, 0xC67C, 0x9E1B, + 0xC67D, 0x9E1E, 0xC67E, 0x7C72, 0xC940, 0x4E42, 0xC941, 0x4E5C, 0xC942, 0x51F5, 0xC943, 0x531A, 0xC944, 0x5382, 0xC945, 0x4E07, + 0xC946, 0x4E0C, 0xC947, 0x4E47, 0xC948, 0x4E8D, 0xC949, 0x56D7, 0xC94A, 0xFA0C, 0xC94B, 0x5C6E, 0xC94C, 0x5F73, 0xC94D, 0x4E0F, + 0xC94E, 0x5187, 0xC94F, 0x4E0E, 0xC950, 0x4E2E, 0xC951, 0x4E93, 0xC952, 0x4EC2, 0xC953, 0x4EC9, 0xC954, 0x4EC8, 0xC955, 0x5198, + 0xC956, 0x52FC, 0xC957, 0x536C, 0xC958, 0x53B9, 0xC959, 0x5720, 0xC95A, 0x5903, 0xC95B, 0x592C, 0xC95C, 0x5C10, 0xC95D, 0x5DFF, + 0xC95E, 0x65E1, 0xC95F, 0x6BB3, 0xC960, 0x6BCC, 0xC961, 0x6C14, 0xC962, 0x723F, 0xC963, 0x4E31, 0xC964, 0x4E3C, 0xC965, 0x4EE8, + 0xC966, 0x4EDC, 0xC967, 0x4EE9, 0xC968, 0x4EE1, 0xC969, 0x4EDD, 0xC96A, 0x4EDA, 0xC96B, 0x520C, 0xC96C, 0x531C, 0xC96D, 0x534C, + 0xC96E, 0x5722, 0xC96F, 0x5723, 0xC970, 0x5917, 0xC971, 0x592F, 0xC972, 0x5B81, 0xC973, 0x5B84, 0xC974, 0x5C12, 0xC975, 0x5C3B, + 0xC976, 0x5C74, 0xC977, 0x5C73, 0xC978, 0x5E04, 0xC979, 0x5E80, 0xC97A, 0x5E82, 0xC97B, 0x5FC9, 0xC97C, 0x6209, 0xC97D, 0x6250, + 0xC97E, 0x6C15, 0xC9A1, 0x6C36, 0xC9A2, 0x6C43, 0xC9A3, 0x6C3F, 0xC9A4, 0x6C3B, 0xC9A5, 0x72AE, 0xC9A6, 0x72B0, 0xC9A7, 0x738A, + 0xC9A8, 0x79B8, 0xC9A9, 0x808A, 0xC9AA, 0x961E, 0xC9AB, 0x4F0E, 0xC9AC, 0x4F18, 0xC9AD, 0x4F2C, 0xC9AE, 0x4EF5, 0xC9AF, 0x4F14, + 0xC9B0, 0x4EF1, 0xC9B1, 0x4F00, 0xC9B2, 0x4EF7, 0xC9B3, 0x4F08, 0xC9B4, 0x4F1D, 0xC9B5, 0x4F02, 0xC9B6, 0x4F05, 0xC9B7, 0x4F22, + 0xC9B8, 0x4F13, 0xC9B9, 0x4F04, 0xC9BA, 0x4EF4, 0xC9BB, 0x4F12, 0xC9BC, 0x51B1, 0xC9BD, 0x5213, 0xC9BE, 0x5209, 0xC9BF, 0x5210, + 0xC9C0, 0x52A6, 0xC9C1, 0x5322, 0xC9C2, 0x531F, 0xC9C3, 0x534D, 0xC9C4, 0x538A, 0xC9C5, 0x5407, 0xC9C6, 0x56E1, 0xC9C7, 0x56DF, + 0xC9C8, 0x572E, 0xC9C9, 0x572A, 0xC9CA, 0x5734, 0xC9CB, 0x593C, 0xC9CC, 0x5980, 0xC9CD, 0x597C, 0xC9CE, 0x5985, 0xC9CF, 0x597B, + 0xC9D0, 0x597E, 0xC9D1, 0x5977, 0xC9D2, 0x597F, 0xC9D3, 0x5B56, 0xC9D4, 0x5C15, 0xC9D5, 0x5C25, 0xC9D6, 0x5C7C, 0xC9D7, 0x5C7A, + 0xC9D8, 0x5C7B, 0xC9D9, 0x5C7E, 0xC9DA, 0x5DDF, 0xC9DB, 0x5E75, 0xC9DC, 0x5E84, 0xC9DD, 0x5F02, 0xC9DE, 0x5F1A, 0xC9DF, 0x5F74, + 0xC9E0, 0x5FD5, 0xC9E1, 0x5FD4, 0xC9E2, 0x5FCF, 0xC9E3, 0x625C, 0xC9E4, 0x625E, 0xC9E5, 0x6264, 0xC9E6, 0x6261, 0xC9E7, 0x6266, + 0xC9E8, 0x6262, 0xC9E9, 0x6259, 0xC9EA, 0x6260, 0xC9EB, 0x625A, 0xC9EC, 0x6265, 0xC9ED, 0x65EF, 0xC9EE, 0x65EE, 0xC9EF, 0x673E, + 0xC9F0, 0x6739, 0xC9F1, 0x6738, 0xC9F2, 0x673B, 0xC9F3, 0x673A, 0xC9F4, 0x673F, 0xC9F5, 0x673C, 0xC9F6, 0x6733, 0xC9F7, 0x6C18, + 0xC9F8, 0x6C46, 0xC9F9, 0x6C52, 0xC9FA, 0x6C5C, 0xC9FB, 0x6C4F, 0xC9FC, 0x6C4A, 0xC9FD, 0x6C54, 0xC9FE, 0x6C4B, 0xCA40, 0x6C4C, + 0xCA41, 0x7071, 0xCA42, 0x725E, 0xCA43, 0x72B4, 0xCA44, 0x72B5, 0xCA45, 0x738E, 0xCA46, 0x752A, 0xCA47, 0x767F, 0xCA48, 0x7A75, + 0xCA49, 0x7F51, 0xCA4A, 0x8278, 0xCA4B, 0x827C, 0xCA4C, 0x8280, 0xCA4D, 0x827D, 0xCA4E, 0x827F, 0xCA4F, 0x864D, 0xCA50, 0x897E, + 0xCA51, 0x9099, 0xCA52, 0x9097, 0xCA53, 0x9098, 0xCA54, 0x909B, 0xCA55, 0x9094, 0xCA56, 0x9622, 0xCA57, 0x9624, 0xCA58, 0x9620, + 0xCA59, 0x9623, 0xCA5A, 0x4F56, 0xCA5B, 0x4F3B, 0xCA5C, 0x4F62, 0xCA5D, 0x4F49, 0xCA5E, 0x4F53, 0xCA5F, 0x4F64, 0xCA60, 0x4F3E, + 0xCA61, 0x4F67, 0xCA62, 0x4F52, 0xCA63, 0x4F5F, 0xCA64, 0x4F41, 0xCA65, 0x4F58, 0xCA66, 0x4F2D, 0xCA67, 0x4F33, 0xCA68, 0x4F3F, + 0xCA69, 0x4F61, 0xCA6A, 0x518F, 0xCA6B, 0x51B9, 0xCA6C, 0x521C, 0xCA6D, 0x521E, 0xCA6E, 0x5221, 0xCA6F, 0x52AD, 0xCA70, 0x52AE, + 0xCA71, 0x5309, 0xCA72, 0x5363, 0xCA73, 0x5372, 0xCA74, 0x538E, 0xCA75, 0x538F, 0xCA76, 0x5430, 0xCA77, 0x5437, 0xCA78, 0x542A, + 0xCA79, 0x5454, 0xCA7A, 0x5445, 0xCA7B, 0x5419, 0xCA7C, 0x541C, 0xCA7D, 0x5425, 0xCA7E, 0x5418, 0xCAA1, 0x543D, 0xCAA2, 0x544F, + 0xCAA3, 0x5441, 0xCAA4, 0x5428, 0xCAA5, 0x5424, 0xCAA6, 0x5447, 0xCAA7, 0x56EE, 0xCAA8, 0x56E7, 0xCAA9, 0x56E5, 0xCAAA, 0x5741, + 0xCAAB, 0x5745, 0xCAAC, 0x574C, 0xCAAD, 0x5749, 0xCAAE, 0x574B, 0xCAAF, 0x5752, 0xCAB0, 0x5906, 0xCAB1, 0x5940, 0xCAB2, 0x59A6, + 0xCAB3, 0x5998, 0xCAB4, 0x59A0, 0xCAB5, 0x5997, 0xCAB6, 0x598E, 0xCAB7, 0x59A2, 0xCAB8, 0x5990, 0xCAB9, 0x598F, 0xCABA, 0x59A7, + 0xCABB, 0x59A1, 0xCABC, 0x5B8E, 0xCABD, 0x5B92, 0xCABE, 0x5C28, 0xCABF, 0x5C2A, 0xCAC0, 0x5C8D, 0xCAC1, 0x5C8F, 0xCAC2, 0x5C88, + 0xCAC3, 0x5C8B, 0xCAC4, 0x5C89, 0xCAC5, 0x5C92, 0xCAC6, 0x5C8A, 0xCAC7, 0x5C86, 0xCAC8, 0x5C93, 0xCAC9, 0x5C95, 0xCACA, 0x5DE0, + 0xCACB, 0x5E0A, 0xCACC, 0x5E0E, 0xCACD, 0x5E8B, 0xCACE, 0x5E89, 0xCACF, 0x5E8C, 0xCAD0, 0x5E88, 0xCAD1, 0x5E8D, 0xCAD2, 0x5F05, + 0xCAD3, 0x5F1D, 0xCAD4, 0x5F78, 0xCAD5, 0x5F76, 0xCAD6, 0x5FD2, 0xCAD7, 0x5FD1, 0xCAD8, 0x5FD0, 0xCAD9, 0x5FED, 0xCADA, 0x5FE8, + 0xCADB, 0x5FEE, 0xCADC, 0x5FF3, 0xCADD, 0x5FE1, 0xCADE, 0x5FE4, 0xCADF, 0x5FE3, 0xCAE0, 0x5FFA, 0xCAE1, 0x5FEF, 0xCAE2, 0x5FF7, + 0xCAE3, 0x5FFB, 0xCAE4, 0x6000, 0xCAE5, 0x5FF4, 0xCAE6, 0x623A, 0xCAE7, 0x6283, 0xCAE8, 0x628C, 0xCAE9, 0x628E, 0xCAEA, 0x628F, + 0xCAEB, 0x6294, 0xCAEC, 0x6287, 0xCAED, 0x6271, 0xCAEE, 0x627B, 0xCAEF, 0x627A, 0xCAF0, 0x6270, 0xCAF1, 0x6281, 0xCAF2, 0x6288, + 0xCAF3, 0x6277, 0xCAF4, 0x627D, 0xCAF5, 0x6272, 0xCAF6, 0x6274, 0xCAF7, 0x6537, 0xCAF8, 0x65F0, 0xCAF9, 0x65F4, 0xCAFA, 0x65F3, + 0xCAFB, 0x65F2, 0xCAFC, 0x65F5, 0xCAFD, 0x6745, 0xCAFE, 0x6747, 0xCB40, 0x6759, 0xCB41, 0x6755, 0xCB42, 0x674C, 0xCB43, 0x6748, + 0xCB44, 0x675D, 0xCB45, 0x674D, 0xCB46, 0x675A, 0xCB47, 0x674B, 0xCB48, 0x6BD0, 0xCB49, 0x6C19, 0xCB4A, 0x6C1A, 0xCB4B, 0x6C78, + 0xCB4C, 0x6C67, 0xCB4D, 0x6C6B, 0xCB4E, 0x6C84, 0xCB4F, 0x6C8B, 0xCB50, 0x6C8F, 0xCB51, 0x6C71, 0xCB52, 0x6C6F, 0xCB53, 0x6C69, + 0xCB54, 0x6C9A, 0xCB55, 0x6C6D, 0xCB56, 0x6C87, 0xCB57, 0x6C95, 0xCB58, 0x6C9C, 0xCB59, 0x6C66, 0xCB5A, 0x6C73, 0xCB5B, 0x6C65, + 0xCB5C, 0x6C7B, 0xCB5D, 0x6C8E, 0xCB5E, 0x7074, 0xCB5F, 0x707A, 0xCB60, 0x7263, 0xCB61, 0x72BF, 0xCB62, 0x72BD, 0xCB63, 0x72C3, + 0xCB64, 0x72C6, 0xCB65, 0x72C1, 0xCB66, 0x72BA, 0xCB67, 0x72C5, 0xCB68, 0x7395, 0xCB69, 0x7397, 0xCB6A, 0x7393, 0xCB6B, 0x7394, + 0xCB6C, 0x7392, 0xCB6D, 0x753A, 0xCB6E, 0x7539, 0xCB6F, 0x7594, 0xCB70, 0x7595, 0xCB71, 0x7681, 0xCB72, 0x793D, 0xCB73, 0x8034, + 0xCB74, 0x8095, 0xCB75, 0x8099, 0xCB76, 0x8090, 0xCB77, 0x8092, 0xCB78, 0x809C, 0xCB79, 0x8290, 0xCB7A, 0x828F, 0xCB7B, 0x8285, + 0xCB7C, 0x828E, 0xCB7D, 0x8291, 0xCB7E, 0x8293, 0xCBA1, 0x828A, 0xCBA2, 0x8283, 0xCBA3, 0x8284, 0xCBA4, 0x8C78, 0xCBA5, 0x8FC9, + 0xCBA6, 0x8FBF, 0xCBA7, 0x909F, 0xCBA8, 0x90A1, 0xCBA9, 0x90A5, 0xCBAA, 0x909E, 0xCBAB, 0x90A7, 0xCBAC, 0x90A0, 0xCBAD, 0x9630, + 0xCBAE, 0x9628, 0xCBAF, 0x962F, 0xCBB0, 0x962D, 0xCBB1, 0x4E33, 0xCBB2, 0x4F98, 0xCBB3, 0x4F7C, 0xCBB4, 0x4F85, 0xCBB5, 0x4F7D, + 0xCBB6, 0x4F80, 0xCBB7, 0x4F87, 0xCBB8, 0x4F76, 0xCBB9, 0x4F74, 0xCBBA, 0x4F89, 0xCBBB, 0x4F84, 0xCBBC, 0x4F77, 0xCBBD, 0x4F4C, + 0xCBBE, 0x4F97, 0xCBBF, 0x4F6A, 0xCBC0, 0x4F9A, 0xCBC1, 0x4F79, 0xCBC2, 0x4F81, 0xCBC3, 0x4F78, 0xCBC4, 0x4F90, 0xCBC5, 0x4F9C, + 0xCBC6, 0x4F94, 0xCBC7, 0x4F9E, 0xCBC8, 0x4F92, 0xCBC9, 0x4F82, 0xCBCA, 0x4F95, 0xCBCB, 0x4F6B, 0xCBCC, 0x4F6E, 0xCBCD, 0x519E, + 0xCBCE, 0x51BC, 0xCBCF, 0x51BE, 0xCBD0, 0x5235, 0xCBD1, 0x5232, 0xCBD2, 0x5233, 0xCBD3, 0x5246, 0xCBD4, 0x5231, 0xCBD5, 0x52BC, + 0xCBD6, 0x530A, 0xCBD7, 0x530B, 0xCBD8, 0x533C, 0xCBD9, 0x5392, 0xCBDA, 0x5394, 0xCBDB, 0x5487, 0xCBDC, 0x547F, 0xCBDD, 0x5481, + 0xCBDE, 0x5491, 0xCBDF, 0x5482, 0xCBE0, 0x5488, 0xCBE1, 0x546B, 0xCBE2, 0x547A, 0xCBE3, 0x547E, 0xCBE4, 0x5465, 0xCBE5, 0x546C, + 0xCBE6, 0x5474, 0xCBE7, 0x5466, 0xCBE8, 0x548D, 0xCBE9, 0x546F, 0xCBEA, 0x5461, 0xCBEB, 0x5460, 0xCBEC, 0x5498, 0xCBED, 0x5463, + 0xCBEE, 0x5467, 0xCBEF, 0x5464, 0xCBF0, 0x56F7, 0xCBF1, 0x56F9, 0xCBF2, 0x576F, 0xCBF3, 0x5772, 0xCBF4, 0x576D, 0xCBF5, 0x576B, + 0xCBF6, 0x5771, 0xCBF7, 0x5770, 0xCBF8, 0x5776, 0xCBF9, 0x5780, 0xCBFA, 0x5775, 0xCBFB, 0x577B, 0xCBFC, 0x5773, 0xCBFD, 0x5774, + 0xCBFE, 0x5762, 0xCC40, 0x5768, 0xCC41, 0x577D, 0xCC42, 0x590C, 0xCC43, 0x5945, 0xCC44, 0x59B5, 0xCC45, 0x59BA, 0xCC46, 0x59CF, + 0xCC47, 0x59CE, 0xCC48, 0x59B2, 0xCC49, 0x59CC, 0xCC4A, 0x59C1, 0xCC4B, 0x59B6, 0xCC4C, 0x59BC, 0xCC4D, 0x59C3, 0xCC4E, 0x59D6, + 0xCC4F, 0x59B1, 0xCC50, 0x59BD, 0xCC51, 0x59C0, 0xCC52, 0x59C8, 0xCC53, 0x59B4, 0xCC54, 0x59C7, 0xCC55, 0x5B62, 0xCC56, 0x5B65, + 0xCC57, 0x5B93, 0xCC58, 0x5B95, 0xCC59, 0x5C44, 0xCC5A, 0x5C47, 0xCC5B, 0x5CAE, 0xCC5C, 0x5CA4, 0xCC5D, 0x5CA0, 0xCC5E, 0x5CB5, + 0xCC5F, 0x5CAF, 0xCC60, 0x5CA8, 0xCC61, 0x5CAC, 0xCC62, 0x5C9F, 0xCC63, 0x5CA3, 0xCC64, 0x5CAD, 0xCC65, 0x5CA2, 0xCC66, 0x5CAA, + 0xCC67, 0x5CA7, 0xCC68, 0x5C9D, 0xCC69, 0x5CA5, 0xCC6A, 0x5CB6, 0xCC6B, 0x5CB0, 0xCC6C, 0x5CA6, 0xCC6D, 0x5E17, 0xCC6E, 0x5E14, + 0xCC6F, 0x5E19, 0xCC70, 0x5F28, 0xCC71, 0x5F22, 0xCC72, 0x5F23, 0xCC73, 0x5F24, 0xCC74, 0x5F54, 0xCC75, 0x5F82, 0xCC76, 0x5F7E, + 0xCC77, 0x5F7D, 0xCC78, 0x5FDE, 0xCC79, 0x5FE5, 0xCC7A, 0x602D, 0xCC7B, 0x6026, 0xCC7C, 0x6019, 0xCC7D, 0x6032, 0xCC7E, 0x600B, + 0xCCA1, 0x6034, 0xCCA2, 0x600A, 0xCCA3, 0x6017, 0xCCA4, 0x6033, 0xCCA5, 0x601A, 0xCCA6, 0x601E, 0xCCA7, 0x602C, 0xCCA8, 0x6022, + 0xCCA9, 0x600D, 0xCCAA, 0x6010, 0xCCAB, 0x602E, 0xCCAC, 0x6013, 0xCCAD, 0x6011, 0xCCAE, 0x600C, 0xCCAF, 0x6009, 0xCCB0, 0x601C, + 0xCCB1, 0x6214, 0xCCB2, 0x623D, 0xCCB3, 0x62AD, 0xCCB4, 0x62B4, 0xCCB5, 0x62D1, 0xCCB6, 0x62BE, 0xCCB7, 0x62AA, 0xCCB8, 0x62B6, + 0xCCB9, 0x62CA, 0xCCBA, 0x62AE, 0xCCBB, 0x62B3, 0xCCBC, 0x62AF, 0xCCBD, 0x62BB, 0xCCBE, 0x62A9, 0xCCBF, 0x62B0, 0xCCC0, 0x62B8, + 0xCCC1, 0x653D, 0xCCC2, 0x65A8, 0xCCC3, 0x65BB, 0xCCC4, 0x6609, 0xCCC5, 0x65FC, 0xCCC6, 0x6604, 0xCCC7, 0x6612, 0xCCC8, 0x6608, + 0xCCC9, 0x65FB, 0xCCCA, 0x6603, 0xCCCB, 0x660B, 0xCCCC, 0x660D, 0xCCCD, 0x6605, 0xCCCE, 0x65FD, 0xCCCF, 0x6611, 0xCCD0, 0x6610, + 0xCCD1, 0x66F6, 0xCCD2, 0x670A, 0xCCD3, 0x6785, 0xCCD4, 0x676C, 0xCCD5, 0x678E, 0xCCD6, 0x6792, 0xCCD7, 0x6776, 0xCCD8, 0x677B, + 0xCCD9, 0x6798, 0xCCDA, 0x6786, 0xCCDB, 0x6784, 0xCCDC, 0x6774, 0xCCDD, 0x678D, 0xCCDE, 0x678C, 0xCCDF, 0x677A, 0xCCE0, 0x679F, + 0xCCE1, 0x6791, 0xCCE2, 0x6799, 0xCCE3, 0x6783, 0xCCE4, 0x677D, 0xCCE5, 0x6781, 0xCCE6, 0x6778, 0xCCE7, 0x6779, 0xCCE8, 0x6794, + 0xCCE9, 0x6B25, 0xCCEA, 0x6B80, 0xCCEB, 0x6B7E, 0xCCEC, 0x6BDE, 0xCCED, 0x6C1D, 0xCCEE, 0x6C93, 0xCCEF, 0x6CEC, 0xCCF0, 0x6CEB, + 0xCCF1, 0x6CEE, 0xCCF2, 0x6CD9, 0xCCF3, 0x6CB6, 0xCCF4, 0x6CD4, 0xCCF5, 0x6CAD, 0xCCF6, 0x6CE7, 0xCCF7, 0x6CB7, 0xCCF8, 0x6CD0, + 0xCCF9, 0x6CC2, 0xCCFA, 0x6CBA, 0xCCFB, 0x6CC3, 0xCCFC, 0x6CC6, 0xCCFD, 0x6CED, 0xCCFE, 0x6CF2, 0xCD40, 0x6CD2, 0xCD41, 0x6CDD, + 0xCD42, 0x6CB4, 0xCD43, 0x6C8A, 0xCD44, 0x6C9D, 0xCD45, 0x6C80, 0xCD46, 0x6CDE, 0xCD47, 0x6CC0, 0xCD48, 0x6D30, 0xCD49, 0x6CCD, + 0xCD4A, 0x6CC7, 0xCD4B, 0x6CB0, 0xCD4C, 0x6CF9, 0xCD4D, 0x6CCF, 0xCD4E, 0x6CE9, 0xCD4F, 0x6CD1, 0xCD50, 0x7094, 0xCD51, 0x7098, + 0xCD52, 0x7085, 0xCD53, 0x7093, 0xCD54, 0x7086, 0xCD55, 0x7084, 0xCD56, 0x7091, 0xCD57, 0x7096, 0xCD58, 0x7082, 0xCD59, 0x709A, + 0xCD5A, 0x7083, 0xCD5B, 0x726A, 0xCD5C, 0x72D6, 0xCD5D, 0x72CB, 0xCD5E, 0x72D8, 0xCD5F, 0x72C9, 0xCD60, 0x72DC, 0xCD61, 0x72D2, + 0xCD62, 0x72D4, 0xCD63, 0x72DA, 0xCD64, 0x72CC, 0xCD65, 0x72D1, 0xCD66, 0x73A4, 0xCD67, 0x73A1, 0xCD68, 0x73AD, 0xCD69, 0x73A6, + 0xCD6A, 0x73A2, 0xCD6B, 0x73A0, 0xCD6C, 0x73AC, 0xCD6D, 0x739D, 0xCD6E, 0x74DD, 0xCD6F, 0x74E8, 0xCD70, 0x753F, 0xCD71, 0x7540, + 0xCD72, 0x753E, 0xCD73, 0x758C, 0xCD74, 0x7598, 0xCD75, 0x76AF, 0xCD76, 0x76F3, 0xCD77, 0x76F1, 0xCD78, 0x76F0, 0xCD79, 0x76F5, + 0xCD7A, 0x77F8, 0xCD7B, 0x77FC, 0xCD7C, 0x77F9, 0xCD7D, 0x77FB, 0xCD7E, 0x77FA, 0xCDA1, 0x77F7, 0xCDA2, 0x7942, 0xCDA3, 0x793F, + 0xCDA4, 0x79C5, 0xCDA5, 0x7A78, 0xCDA6, 0x7A7B, 0xCDA7, 0x7AFB, 0xCDA8, 0x7C75, 0xCDA9, 0x7CFD, 0xCDAA, 0x8035, 0xCDAB, 0x808F, + 0xCDAC, 0x80AE, 0xCDAD, 0x80A3, 0xCDAE, 0x80B8, 0xCDAF, 0x80B5, 0xCDB0, 0x80AD, 0xCDB1, 0x8220, 0xCDB2, 0x82A0, 0xCDB3, 0x82C0, + 0xCDB4, 0x82AB, 0xCDB5, 0x829A, 0xCDB6, 0x8298, 0xCDB7, 0x829B, 0xCDB8, 0x82B5, 0xCDB9, 0x82A7, 0xCDBA, 0x82AE, 0xCDBB, 0x82BC, + 0xCDBC, 0x829E, 0xCDBD, 0x82BA, 0xCDBE, 0x82B4, 0xCDBF, 0x82A8, 0xCDC0, 0x82A1, 0xCDC1, 0x82A9, 0xCDC2, 0x82C2, 0xCDC3, 0x82A4, + 0xCDC4, 0x82C3, 0xCDC5, 0x82B6, 0xCDC6, 0x82A2, 0xCDC7, 0x8670, 0xCDC8, 0x866F, 0xCDC9, 0x866D, 0xCDCA, 0x866E, 0xCDCB, 0x8C56, + 0xCDCC, 0x8FD2, 0xCDCD, 0x8FCB, 0xCDCE, 0x8FD3, 0xCDCF, 0x8FCD, 0xCDD0, 0x8FD6, 0xCDD1, 0x8FD5, 0xCDD2, 0x8FD7, 0xCDD3, 0x90B2, + 0xCDD4, 0x90B4, 0xCDD5, 0x90AF, 0xCDD6, 0x90B3, 0xCDD7, 0x90B0, 0xCDD8, 0x9639, 0xCDD9, 0x963D, 0xCDDA, 0x963C, 0xCDDB, 0x963A, + 0xCDDC, 0x9643, 0xCDDD, 0x4FCD, 0xCDDE, 0x4FC5, 0xCDDF, 0x4FD3, 0xCDE0, 0x4FB2, 0xCDE1, 0x4FC9, 0xCDE2, 0x4FCB, 0xCDE3, 0x4FC1, + 0xCDE4, 0x4FD4, 0xCDE5, 0x4FDC, 0xCDE6, 0x4FD9, 0xCDE7, 0x4FBB, 0xCDE8, 0x4FB3, 0xCDE9, 0x4FDB, 0xCDEA, 0x4FC7, 0xCDEB, 0x4FD6, + 0xCDEC, 0x4FBA, 0xCDED, 0x4FC0, 0xCDEE, 0x4FB9, 0xCDEF, 0x4FEC, 0xCDF0, 0x5244, 0xCDF1, 0x5249, 0xCDF2, 0x52C0, 0xCDF3, 0x52C2, + 0xCDF4, 0x533D, 0xCDF5, 0x537C, 0xCDF6, 0x5397, 0xCDF7, 0x5396, 0xCDF8, 0x5399, 0xCDF9, 0x5398, 0xCDFA, 0x54BA, 0xCDFB, 0x54A1, + 0xCDFC, 0x54AD, 0xCDFD, 0x54A5, 0xCDFE, 0x54CF, 0xCE40, 0x54C3, 0xCE41, 0x830D, 0xCE42, 0x54B7, 0xCE43, 0x54AE, 0xCE44, 0x54D6, + 0xCE45, 0x54B6, 0xCE46, 0x54C5, 0xCE47, 0x54C6, 0xCE48, 0x54A0, 0xCE49, 0x5470, 0xCE4A, 0x54BC, 0xCE4B, 0x54A2, 0xCE4C, 0x54BE, + 0xCE4D, 0x5472, 0xCE4E, 0x54DE, 0xCE4F, 0x54B0, 0xCE50, 0x57B5, 0xCE51, 0x579E, 0xCE52, 0x579F, 0xCE53, 0x57A4, 0xCE54, 0x578C, + 0xCE55, 0x5797, 0xCE56, 0x579D, 0xCE57, 0x579B, 0xCE58, 0x5794, 0xCE59, 0x5798, 0xCE5A, 0x578F, 0xCE5B, 0x5799, 0xCE5C, 0x57A5, + 0xCE5D, 0x579A, 0xCE5E, 0x5795, 0xCE5F, 0x58F4, 0xCE60, 0x590D, 0xCE61, 0x5953, 0xCE62, 0x59E1, 0xCE63, 0x59DE, 0xCE64, 0x59EE, + 0xCE65, 0x5A00, 0xCE66, 0x59F1, 0xCE67, 0x59DD, 0xCE68, 0x59FA, 0xCE69, 0x59FD, 0xCE6A, 0x59FC, 0xCE6B, 0x59F6, 0xCE6C, 0x59E4, + 0xCE6D, 0x59F2, 0xCE6E, 0x59F7, 0xCE6F, 0x59DB, 0xCE70, 0x59E9, 0xCE71, 0x59F3, 0xCE72, 0x59F5, 0xCE73, 0x59E0, 0xCE74, 0x59FE, + 0xCE75, 0x59F4, 0xCE76, 0x59ED, 0xCE77, 0x5BA8, 0xCE78, 0x5C4C, 0xCE79, 0x5CD0, 0xCE7A, 0x5CD8, 0xCE7B, 0x5CCC, 0xCE7C, 0x5CD7, + 0xCE7D, 0x5CCB, 0xCE7E, 0x5CDB, 0xCEA1, 0x5CDE, 0xCEA2, 0x5CDA, 0xCEA3, 0x5CC9, 0xCEA4, 0x5CC7, 0xCEA5, 0x5CCA, 0xCEA6, 0x5CD6, + 0xCEA7, 0x5CD3, 0xCEA8, 0x5CD4, 0xCEA9, 0x5CCF, 0xCEAA, 0x5CC8, 0xCEAB, 0x5CC6, 0xCEAC, 0x5CCE, 0xCEAD, 0x5CDF, 0xCEAE, 0x5CF8, + 0xCEAF, 0x5DF9, 0xCEB0, 0x5E21, 0xCEB1, 0x5E22, 0xCEB2, 0x5E23, 0xCEB3, 0x5E20, 0xCEB4, 0x5E24, 0xCEB5, 0x5EB0, 0xCEB6, 0x5EA4, + 0xCEB7, 0x5EA2, 0xCEB8, 0x5E9B, 0xCEB9, 0x5EA3, 0xCEBA, 0x5EA5, 0xCEBB, 0x5F07, 0xCEBC, 0x5F2E, 0xCEBD, 0x5F56, 0xCEBE, 0x5F86, + 0xCEBF, 0x6037, 0xCEC0, 0x6039, 0xCEC1, 0x6054, 0xCEC2, 0x6072, 0xCEC3, 0x605E, 0xCEC4, 0x6045, 0xCEC5, 0x6053, 0xCEC6, 0x6047, + 0xCEC7, 0x6049, 0xCEC8, 0x605B, 0xCEC9, 0x604C, 0xCECA, 0x6040, 0xCECB, 0x6042, 0xCECC, 0x605F, 0xCECD, 0x6024, 0xCECE, 0x6044, + 0xCECF, 0x6058, 0xCED0, 0x6066, 0xCED1, 0x606E, 0xCED2, 0x6242, 0xCED3, 0x6243, 0xCED4, 0x62CF, 0xCED5, 0x630D, 0xCED6, 0x630B, + 0xCED7, 0x62F5, 0xCED8, 0x630E, 0xCED9, 0x6303, 0xCEDA, 0x62EB, 0xCEDB, 0x62F9, 0xCEDC, 0x630F, 0xCEDD, 0x630C, 0xCEDE, 0x62F8, + 0xCEDF, 0x62F6, 0xCEE0, 0x6300, 0xCEE1, 0x6313, 0xCEE2, 0x6314, 0xCEE3, 0x62FA, 0xCEE4, 0x6315, 0xCEE5, 0x62FB, 0xCEE6, 0x62F0, + 0xCEE7, 0x6541, 0xCEE8, 0x6543, 0xCEE9, 0x65AA, 0xCEEA, 0x65BF, 0xCEEB, 0x6636, 0xCEEC, 0x6621, 0xCEED, 0x6632, 0xCEEE, 0x6635, + 0xCEEF, 0x661C, 0xCEF0, 0x6626, 0xCEF1, 0x6622, 0xCEF2, 0x6633, 0xCEF3, 0x662B, 0xCEF4, 0x663A, 0xCEF5, 0x661D, 0xCEF6, 0x6634, + 0xCEF7, 0x6639, 0xCEF8, 0x662E, 0xCEF9, 0x670F, 0xCEFA, 0x6710, 0xCEFB, 0x67C1, 0xCEFC, 0x67F2, 0xCEFD, 0x67C8, 0xCEFE, 0x67BA, + 0xCF40, 0x67DC, 0xCF41, 0x67BB, 0xCF42, 0x67F8, 0xCF43, 0x67D8, 0xCF44, 0x67C0, 0xCF45, 0x67B7, 0xCF46, 0x67C5, 0xCF47, 0x67EB, + 0xCF48, 0x67E4, 0xCF49, 0x67DF, 0xCF4A, 0x67B5, 0xCF4B, 0x67CD, 0xCF4C, 0x67B3, 0xCF4D, 0x67F7, 0xCF4E, 0x67F6, 0xCF4F, 0x67EE, + 0xCF50, 0x67E3, 0xCF51, 0x67C2, 0xCF52, 0x67B9, 0xCF53, 0x67CE, 0xCF54, 0x67E7, 0xCF55, 0x67F0, 0xCF56, 0x67B2, 0xCF57, 0x67FC, + 0xCF58, 0x67C6, 0xCF59, 0x67ED, 0xCF5A, 0x67CC, 0xCF5B, 0x67AE, 0xCF5C, 0x67E6, 0xCF5D, 0x67DB, 0xCF5E, 0x67FA, 0xCF5F, 0x67C9, + 0xCF60, 0x67CA, 0xCF61, 0x67C3, 0xCF62, 0x67EA, 0xCF63, 0x67CB, 0xCF64, 0x6B28, 0xCF65, 0x6B82, 0xCF66, 0x6B84, 0xCF67, 0x6BB6, + 0xCF68, 0x6BD6, 0xCF69, 0x6BD8, 0xCF6A, 0x6BE0, 0xCF6B, 0x6C20, 0xCF6C, 0x6C21, 0xCF6D, 0x6D28, 0xCF6E, 0x6D34, 0xCF6F, 0x6D2D, + 0xCF70, 0x6D1F, 0xCF71, 0x6D3C, 0xCF72, 0x6D3F, 0xCF73, 0x6D12, 0xCF74, 0x6D0A, 0xCF75, 0x6CDA, 0xCF76, 0x6D33, 0xCF77, 0x6D04, + 0xCF78, 0x6D19, 0xCF79, 0x6D3A, 0xCF7A, 0x6D1A, 0xCF7B, 0x6D11, 0xCF7C, 0x6D00, 0xCF7D, 0x6D1D, 0xCF7E, 0x6D42, 0xCFA1, 0x6D01, + 0xCFA2, 0x6D18, 0xCFA3, 0x6D37, 0xCFA4, 0x6D03, 0xCFA5, 0x6D0F, 0xCFA6, 0x6D40, 0xCFA7, 0x6D07, 0xCFA8, 0x6D20, 0xCFA9, 0x6D2C, + 0xCFAA, 0x6D08, 0xCFAB, 0x6D22, 0xCFAC, 0x6D09, 0xCFAD, 0x6D10, 0xCFAE, 0x70B7, 0xCFAF, 0x709F, 0xCFB0, 0x70BE, 0xCFB1, 0x70B1, + 0xCFB2, 0x70B0, 0xCFB3, 0x70A1, 0xCFB4, 0x70B4, 0xCFB5, 0x70B5, 0xCFB6, 0x70A9, 0xCFB7, 0x7241, 0xCFB8, 0x7249, 0xCFB9, 0x724A, + 0xCFBA, 0x726C, 0xCFBB, 0x7270, 0xCFBC, 0x7273, 0xCFBD, 0x726E, 0xCFBE, 0x72CA, 0xCFBF, 0x72E4, 0xCFC0, 0x72E8, 0xCFC1, 0x72EB, + 0xCFC2, 0x72DF, 0xCFC3, 0x72EA, 0xCFC4, 0x72E6, 0xCFC5, 0x72E3, 0xCFC6, 0x7385, 0xCFC7, 0x73CC, 0xCFC8, 0x73C2, 0xCFC9, 0x73C8, + 0xCFCA, 0x73C5, 0xCFCB, 0x73B9, 0xCFCC, 0x73B6, 0xCFCD, 0x73B5, 0xCFCE, 0x73B4, 0xCFCF, 0x73EB, 0xCFD0, 0x73BF, 0xCFD1, 0x73C7, + 0xCFD2, 0x73BE, 0xCFD3, 0x73C3, 0xCFD4, 0x73C6, 0xCFD5, 0x73B8, 0xCFD6, 0x73CB, 0xCFD7, 0x74EC, 0xCFD8, 0x74EE, 0xCFD9, 0x752E, + 0xCFDA, 0x7547, 0xCFDB, 0x7548, 0xCFDC, 0x75A7, 0xCFDD, 0x75AA, 0xCFDE, 0x7679, 0xCFDF, 0x76C4, 0xCFE0, 0x7708, 0xCFE1, 0x7703, + 0xCFE2, 0x7704, 0xCFE3, 0x7705, 0xCFE4, 0x770A, 0xCFE5, 0x76F7, 0xCFE6, 0x76FB, 0xCFE7, 0x76FA, 0xCFE8, 0x77E7, 0xCFE9, 0x77E8, + 0xCFEA, 0x7806, 0xCFEB, 0x7811, 0xCFEC, 0x7812, 0xCFED, 0x7805, 0xCFEE, 0x7810, 0xCFEF, 0x780F, 0xCFF0, 0x780E, 0xCFF1, 0x7809, + 0xCFF2, 0x7803, 0xCFF3, 0x7813, 0xCFF4, 0x794A, 0xCFF5, 0x794C, 0xCFF6, 0x794B, 0xCFF7, 0x7945, 0xCFF8, 0x7944, 0xCFF9, 0x79D5, + 0xCFFA, 0x79CD, 0xCFFB, 0x79CF, 0xCFFC, 0x79D6, 0xCFFD, 0x79CE, 0xCFFE, 0x7A80, 0xD040, 0x7A7E, 0xD041, 0x7AD1, 0xD042, 0x7B00, + 0xD043, 0x7B01, 0xD044, 0x7C7A, 0xD045, 0x7C78, 0xD046, 0x7C79, 0xD047, 0x7C7F, 0xD048, 0x7C80, 0xD049, 0x7C81, 0xD04A, 0x7D03, + 0xD04B, 0x7D08, 0xD04C, 0x7D01, 0xD04D, 0x7F58, 0xD04E, 0x7F91, 0xD04F, 0x7F8D, 0xD050, 0x7FBE, 0xD051, 0x8007, 0xD052, 0x800E, + 0xD053, 0x800F, 0xD054, 0x8014, 0xD055, 0x8037, 0xD056, 0x80D8, 0xD057, 0x80C7, 0xD058, 0x80E0, 0xD059, 0x80D1, 0xD05A, 0x80C8, + 0xD05B, 0x80C2, 0xD05C, 0x80D0, 0xD05D, 0x80C5, 0xD05E, 0x80E3, 0xD05F, 0x80D9, 0xD060, 0x80DC, 0xD061, 0x80CA, 0xD062, 0x80D5, + 0xD063, 0x80C9, 0xD064, 0x80CF, 0xD065, 0x80D7, 0xD066, 0x80E6, 0xD067, 0x80CD, 0xD068, 0x81FF, 0xD069, 0x8221, 0xD06A, 0x8294, + 0xD06B, 0x82D9, 0xD06C, 0x82FE, 0xD06D, 0x82F9, 0xD06E, 0x8307, 0xD06F, 0x82E8, 0xD070, 0x8300, 0xD071, 0x82D5, 0xD072, 0x833A, + 0xD073, 0x82EB, 0xD074, 0x82D6, 0xD075, 0x82F4, 0xD076, 0x82EC, 0xD077, 0x82E1, 0xD078, 0x82F2, 0xD079, 0x82F5, 0xD07A, 0x830C, + 0xD07B, 0x82FB, 0xD07C, 0x82F6, 0xD07D, 0x82F0, 0xD07E, 0x82EA, 0xD0A1, 0x82E4, 0xD0A2, 0x82E0, 0xD0A3, 0x82FA, 0xD0A4, 0x82F3, + 0xD0A5, 0x82ED, 0xD0A6, 0x8677, 0xD0A7, 0x8674, 0xD0A8, 0x867C, 0xD0A9, 0x8673, 0xD0AA, 0x8841, 0xD0AB, 0x884E, 0xD0AC, 0x8867, + 0xD0AD, 0x886A, 0xD0AE, 0x8869, 0xD0AF, 0x89D3, 0xD0B0, 0x8A04, 0xD0B1, 0x8A07, 0xD0B2, 0x8D72, 0xD0B3, 0x8FE3, 0xD0B4, 0x8FE1, + 0xD0B5, 0x8FEE, 0xD0B6, 0x8FE0, 0xD0B7, 0x90F1, 0xD0B8, 0x90BD, 0xD0B9, 0x90BF, 0xD0BA, 0x90D5, 0xD0BB, 0x90C5, 0xD0BC, 0x90BE, + 0xD0BD, 0x90C7, 0xD0BE, 0x90CB, 0xD0BF, 0x90C8, 0xD0C0, 0x91D4, 0xD0C1, 0x91D3, 0xD0C2, 0x9654, 0xD0C3, 0x964F, 0xD0C4, 0x9651, + 0xD0C5, 0x9653, 0xD0C6, 0x964A, 0xD0C7, 0x964E, 0xD0C8, 0x501E, 0xD0C9, 0x5005, 0xD0CA, 0x5007, 0xD0CB, 0x5013, 0xD0CC, 0x5022, + 0xD0CD, 0x5030, 0xD0CE, 0x501B, 0xD0CF, 0x4FF5, 0xD0D0, 0x4FF4, 0xD0D1, 0x5033, 0xD0D2, 0x5037, 0xD0D3, 0x502C, 0xD0D4, 0x4FF6, + 0xD0D5, 0x4FF7, 0xD0D6, 0x5017, 0xD0D7, 0x501C, 0xD0D8, 0x5020, 0xD0D9, 0x5027, 0xD0DA, 0x5035, 0xD0DB, 0x502F, 0xD0DC, 0x5031, + 0xD0DD, 0x500E, 0xD0DE, 0x515A, 0xD0DF, 0x5194, 0xD0E0, 0x5193, 0xD0E1, 0x51CA, 0xD0E2, 0x51C4, 0xD0E3, 0x51C5, 0xD0E4, 0x51C8, + 0xD0E5, 0x51CE, 0xD0E6, 0x5261, 0xD0E7, 0x525A, 0xD0E8, 0x5252, 0xD0E9, 0x525E, 0xD0EA, 0x525F, 0xD0EB, 0x5255, 0xD0EC, 0x5262, + 0xD0ED, 0x52CD, 0xD0EE, 0x530E, 0xD0EF, 0x539E, 0xD0F0, 0x5526, 0xD0F1, 0x54E2, 0xD0F2, 0x5517, 0xD0F3, 0x5512, 0xD0F4, 0x54E7, + 0xD0F5, 0x54F3, 0xD0F6, 0x54E4, 0xD0F7, 0x551A, 0xD0F8, 0x54FF, 0xD0F9, 0x5504, 0xD0FA, 0x5508, 0xD0FB, 0x54EB, 0xD0FC, 0x5511, + 0xD0FD, 0x5505, 0xD0FE, 0x54F1, 0xD140, 0x550A, 0xD141, 0x54FB, 0xD142, 0x54F7, 0xD143, 0x54F8, 0xD144, 0x54E0, 0xD145, 0x550E, + 0xD146, 0x5503, 0xD147, 0x550B, 0xD148, 0x5701, 0xD149, 0x5702, 0xD14A, 0x57CC, 0xD14B, 0x5832, 0xD14C, 0x57D5, 0xD14D, 0x57D2, + 0xD14E, 0x57BA, 0xD14F, 0x57C6, 0xD150, 0x57BD, 0xD151, 0x57BC, 0xD152, 0x57B8, 0xD153, 0x57B6, 0xD154, 0x57BF, 0xD155, 0x57C7, + 0xD156, 0x57D0, 0xD157, 0x57B9, 0xD158, 0x57C1, 0xD159, 0x590E, 0xD15A, 0x594A, 0xD15B, 0x5A19, 0xD15C, 0x5A16, 0xD15D, 0x5A2D, + 0xD15E, 0x5A2E, 0xD15F, 0x5A15, 0xD160, 0x5A0F, 0xD161, 0x5A17, 0xD162, 0x5A0A, 0xD163, 0x5A1E, 0xD164, 0x5A33, 0xD165, 0x5B6C, + 0xD166, 0x5BA7, 0xD167, 0x5BAD, 0xD168, 0x5BAC, 0xD169, 0x5C03, 0xD16A, 0x5C56, 0xD16B, 0x5C54, 0xD16C, 0x5CEC, 0xD16D, 0x5CFF, + 0xD16E, 0x5CEE, 0xD16F, 0x5CF1, 0xD170, 0x5CF7, 0xD171, 0x5D00, 0xD172, 0x5CF9, 0xD173, 0x5E29, 0xD174, 0x5E28, 0xD175, 0x5EA8, + 0xD176, 0x5EAE, 0xD177, 0x5EAA, 0xD178, 0x5EAC, 0xD179, 0x5F33, 0xD17A, 0x5F30, 0xD17B, 0x5F67, 0xD17C, 0x605D, 0xD17D, 0x605A, + 0xD17E, 0x6067, 0xD1A1, 0x6041, 0xD1A2, 0x60A2, 0xD1A3, 0x6088, 0xD1A4, 0x6080, 0xD1A5, 0x6092, 0xD1A6, 0x6081, 0xD1A7, 0x609D, + 0xD1A8, 0x6083, 0xD1A9, 0x6095, 0xD1AA, 0x609B, 0xD1AB, 0x6097, 0xD1AC, 0x6087, 0xD1AD, 0x609C, 0xD1AE, 0x608E, 0xD1AF, 0x6219, + 0xD1B0, 0x6246, 0xD1B1, 0x62F2, 0xD1B2, 0x6310, 0xD1B3, 0x6356, 0xD1B4, 0x632C, 0xD1B5, 0x6344, 0xD1B6, 0x6345, 0xD1B7, 0x6336, + 0xD1B8, 0x6343, 0xD1B9, 0x63E4, 0xD1BA, 0x6339, 0xD1BB, 0x634B, 0xD1BC, 0x634A, 0xD1BD, 0x633C, 0xD1BE, 0x6329, 0xD1BF, 0x6341, + 0xD1C0, 0x6334, 0xD1C1, 0x6358, 0xD1C2, 0x6354, 0xD1C3, 0x6359, 0xD1C4, 0x632D, 0xD1C5, 0x6347, 0xD1C6, 0x6333, 0xD1C7, 0x635A, + 0xD1C8, 0x6351, 0xD1C9, 0x6338, 0xD1CA, 0x6357, 0xD1CB, 0x6340, 0xD1CC, 0x6348, 0xD1CD, 0x654A, 0xD1CE, 0x6546, 0xD1CF, 0x65C6, + 0xD1D0, 0x65C3, 0xD1D1, 0x65C4, 0xD1D2, 0x65C2, 0xD1D3, 0x664A, 0xD1D4, 0x665F, 0xD1D5, 0x6647, 0xD1D6, 0x6651, 0xD1D7, 0x6712, + 0xD1D8, 0x6713, 0xD1D9, 0x681F, 0xD1DA, 0x681A, 0xD1DB, 0x6849, 0xD1DC, 0x6832, 0xD1DD, 0x6833, 0xD1DE, 0x683B, 0xD1DF, 0x684B, + 0xD1E0, 0x684F, 0xD1E1, 0x6816, 0xD1E2, 0x6831, 0xD1E3, 0x681C, 0xD1E4, 0x6835, 0xD1E5, 0x682B, 0xD1E6, 0x682D, 0xD1E7, 0x682F, + 0xD1E8, 0x684E, 0xD1E9, 0x6844, 0xD1EA, 0x6834, 0xD1EB, 0x681D, 0xD1EC, 0x6812, 0xD1ED, 0x6814, 0xD1EE, 0x6826, 0xD1EF, 0x6828, + 0xD1F0, 0x682E, 0xD1F1, 0x684D, 0xD1F2, 0x683A, 0xD1F3, 0x6825, 0xD1F4, 0x6820, 0xD1F5, 0x6B2C, 0xD1F6, 0x6B2F, 0xD1F7, 0x6B2D, + 0xD1F8, 0x6B31, 0xD1F9, 0x6B34, 0xD1FA, 0x6B6D, 0xD1FB, 0x8082, 0xD1FC, 0x6B88, 0xD1FD, 0x6BE6, 0xD1FE, 0x6BE4, 0xD240, 0x6BE8, + 0xD241, 0x6BE3, 0xD242, 0x6BE2, 0xD243, 0x6BE7, 0xD244, 0x6C25, 0xD245, 0x6D7A, 0xD246, 0x6D63, 0xD247, 0x6D64, 0xD248, 0x6D76, + 0xD249, 0x6D0D, 0xD24A, 0x6D61, 0xD24B, 0x6D92, 0xD24C, 0x6D58, 0xD24D, 0x6D62, 0xD24E, 0x6D6D, 0xD24F, 0x6D6F, 0xD250, 0x6D91, + 0xD251, 0x6D8D, 0xD252, 0x6DEF, 0xD253, 0x6D7F, 0xD254, 0x6D86, 0xD255, 0x6D5E, 0xD256, 0x6D67, 0xD257, 0x6D60, 0xD258, 0x6D97, + 0xD259, 0x6D70, 0xD25A, 0x6D7C, 0xD25B, 0x6D5F, 0xD25C, 0x6D82, 0xD25D, 0x6D98, 0xD25E, 0x6D2F, 0xD25F, 0x6D68, 0xD260, 0x6D8B, + 0xD261, 0x6D7E, 0xD262, 0x6D80, 0xD263, 0x6D84, 0xD264, 0x6D16, 0xD265, 0x6D83, 0xD266, 0x6D7B, 0xD267, 0x6D7D, 0xD268, 0x6D75, + 0xD269, 0x6D90, 0xD26A, 0x70DC, 0xD26B, 0x70D3, 0xD26C, 0x70D1, 0xD26D, 0x70DD, 0xD26E, 0x70CB, 0xD26F, 0x7F39, 0xD270, 0x70E2, + 0xD271, 0x70D7, 0xD272, 0x70D2, 0xD273, 0x70DE, 0xD274, 0x70E0, 0xD275, 0x70D4, 0xD276, 0x70CD, 0xD277, 0x70C5, 0xD278, 0x70C6, + 0xD279, 0x70C7, 0xD27A, 0x70DA, 0xD27B, 0x70CE, 0xD27C, 0x70E1, 0xD27D, 0x7242, 0xD27E, 0x7278, 0xD2A1, 0x7277, 0xD2A2, 0x7276, + 0xD2A3, 0x7300, 0xD2A4, 0x72FA, 0xD2A5, 0x72F4, 0xD2A6, 0x72FE, 0xD2A7, 0x72F6, 0xD2A8, 0x72F3, 0xD2A9, 0x72FB, 0xD2AA, 0x7301, + 0xD2AB, 0x73D3, 0xD2AC, 0x73D9, 0xD2AD, 0x73E5, 0xD2AE, 0x73D6, 0xD2AF, 0x73BC, 0xD2B0, 0x73E7, 0xD2B1, 0x73E3, 0xD2B2, 0x73E9, + 0xD2B3, 0x73DC, 0xD2B4, 0x73D2, 0xD2B5, 0x73DB, 0xD2B6, 0x73D4, 0xD2B7, 0x73DD, 0xD2B8, 0x73DA, 0xD2B9, 0x73D7, 0xD2BA, 0x73D8, + 0xD2BB, 0x73E8, 0xD2BC, 0x74DE, 0xD2BD, 0x74DF, 0xD2BE, 0x74F4, 0xD2BF, 0x74F5, 0xD2C0, 0x7521, 0xD2C1, 0x755B, 0xD2C2, 0x755F, + 0xD2C3, 0x75B0, 0xD2C4, 0x75C1, 0xD2C5, 0x75BB, 0xD2C6, 0x75C4, 0xD2C7, 0x75C0, 0xD2C8, 0x75BF, 0xD2C9, 0x75B6, 0xD2CA, 0x75BA, + 0xD2CB, 0x768A, 0xD2CC, 0x76C9, 0xD2CD, 0x771D, 0xD2CE, 0x771B, 0xD2CF, 0x7710, 0xD2D0, 0x7713, 0xD2D1, 0x7712, 0xD2D2, 0x7723, + 0xD2D3, 0x7711, 0xD2D4, 0x7715, 0xD2D5, 0x7719, 0xD2D6, 0x771A, 0xD2D7, 0x7722, 0xD2D8, 0x7727, 0xD2D9, 0x7823, 0xD2DA, 0x782C, + 0xD2DB, 0x7822, 0xD2DC, 0x7835, 0xD2DD, 0x782F, 0xD2DE, 0x7828, 0xD2DF, 0x782E, 0xD2E0, 0x782B, 0xD2E1, 0x7821, 0xD2E2, 0x7829, + 0xD2E3, 0x7833, 0xD2E4, 0x782A, 0xD2E5, 0x7831, 0xD2E6, 0x7954, 0xD2E7, 0x795B, 0xD2E8, 0x794F, 0xD2E9, 0x795C, 0xD2EA, 0x7953, + 0xD2EB, 0x7952, 0xD2EC, 0x7951, 0xD2ED, 0x79EB, 0xD2EE, 0x79EC, 0xD2EF, 0x79E0, 0xD2F0, 0x79EE, 0xD2F1, 0x79ED, 0xD2F2, 0x79EA, + 0xD2F3, 0x79DC, 0xD2F4, 0x79DE, 0xD2F5, 0x79DD, 0xD2F6, 0x7A86, 0xD2F7, 0x7A89, 0xD2F8, 0x7A85, 0xD2F9, 0x7A8B, 0xD2FA, 0x7A8C, + 0xD2FB, 0x7A8A, 0xD2FC, 0x7A87, 0xD2FD, 0x7AD8, 0xD2FE, 0x7B10, 0xD340, 0x7B04, 0xD341, 0x7B13, 0xD342, 0x7B05, 0xD343, 0x7B0F, + 0xD344, 0x7B08, 0xD345, 0x7B0A, 0xD346, 0x7B0E, 0xD347, 0x7B09, 0xD348, 0x7B12, 0xD349, 0x7C84, 0xD34A, 0x7C91, 0xD34B, 0x7C8A, + 0xD34C, 0x7C8C, 0xD34D, 0x7C88, 0xD34E, 0x7C8D, 0xD34F, 0x7C85, 0xD350, 0x7D1E, 0xD351, 0x7D1D, 0xD352, 0x7D11, 0xD353, 0x7D0E, + 0xD354, 0x7D18, 0xD355, 0x7D16, 0xD356, 0x7D13, 0xD357, 0x7D1F, 0xD358, 0x7D12, 0xD359, 0x7D0F, 0xD35A, 0x7D0C, 0xD35B, 0x7F5C, + 0xD35C, 0x7F61, 0xD35D, 0x7F5E, 0xD35E, 0x7F60, 0xD35F, 0x7F5D, 0xD360, 0x7F5B, 0xD361, 0x7F96, 0xD362, 0x7F92, 0xD363, 0x7FC3, + 0xD364, 0x7FC2, 0xD365, 0x7FC0, 0xD366, 0x8016, 0xD367, 0x803E, 0xD368, 0x8039, 0xD369, 0x80FA, 0xD36A, 0x80F2, 0xD36B, 0x80F9, + 0xD36C, 0x80F5, 0xD36D, 0x8101, 0xD36E, 0x80FB, 0xD36F, 0x8100, 0xD370, 0x8201, 0xD371, 0x822F, 0xD372, 0x8225, 0xD373, 0x8333, + 0xD374, 0x832D, 0xD375, 0x8344, 0xD376, 0x8319, 0xD377, 0x8351, 0xD378, 0x8325, 0xD379, 0x8356, 0xD37A, 0x833F, 0xD37B, 0x8341, + 0xD37C, 0x8326, 0xD37D, 0x831C, 0xD37E, 0x8322, 0xD3A1, 0x8342, 0xD3A2, 0x834E, 0xD3A3, 0x831B, 0xD3A4, 0x832A, 0xD3A5, 0x8308, + 0xD3A6, 0x833C, 0xD3A7, 0x834D, 0xD3A8, 0x8316, 0xD3A9, 0x8324, 0xD3AA, 0x8320, 0xD3AB, 0x8337, 0xD3AC, 0x832F, 0xD3AD, 0x8329, + 0xD3AE, 0x8347, 0xD3AF, 0x8345, 0xD3B0, 0x834C, 0xD3B1, 0x8353, 0xD3B2, 0x831E, 0xD3B3, 0x832C, 0xD3B4, 0x834B, 0xD3B5, 0x8327, + 0xD3B6, 0x8348, 0xD3B7, 0x8653, 0xD3B8, 0x8652, 0xD3B9, 0x86A2, 0xD3BA, 0x86A8, 0xD3BB, 0x8696, 0xD3BC, 0x868D, 0xD3BD, 0x8691, + 0xD3BE, 0x869E, 0xD3BF, 0x8687, 0xD3C0, 0x8697, 0xD3C1, 0x8686, 0xD3C2, 0x868B, 0xD3C3, 0x869A, 0xD3C4, 0x8685, 0xD3C5, 0x86A5, + 0xD3C6, 0x8699, 0xD3C7, 0x86A1, 0xD3C8, 0x86A7, 0xD3C9, 0x8695, 0xD3CA, 0x8698, 0xD3CB, 0x868E, 0xD3CC, 0x869D, 0xD3CD, 0x8690, + 0xD3CE, 0x8694, 0xD3CF, 0x8843, 0xD3D0, 0x8844, 0xD3D1, 0x886D, 0xD3D2, 0x8875, 0xD3D3, 0x8876, 0xD3D4, 0x8872, 0xD3D5, 0x8880, + 0xD3D6, 0x8871, 0xD3D7, 0x887F, 0xD3D8, 0x886F, 0xD3D9, 0x8883, 0xD3DA, 0x887E, 0xD3DB, 0x8874, 0xD3DC, 0x887C, 0xD3DD, 0x8A12, + 0xD3DE, 0x8C47, 0xD3DF, 0x8C57, 0xD3E0, 0x8C7B, 0xD3E1, 0x8CA4, 0xD3E2, 0x8CA3, 0xD3E3, 0x8D76, 0xD3E4, 0x8D78, 0xD3E5, 0x8DB5, + 0xD3E6, 0x8DB7, 0xD3E7, 0x8DB6, 0xD3E8, 0x8ED1, 0xD3E9, 0x8ED3, 0xD3EA, 0x8FFE, 0xD3EB, 0x8FF5, 0xD3EC, 0x9002, 0xD3ED, 0x8FFF, + 0xD3EE, 0x8FFB, 0xD3EF, 0x9004, 0xD3F0, 0x8FFC, 0xD3F1, 0x8FF6, 0xD3F2, 0x90D6, 0xD3F3, 0x90E0, 0xD3F4, 0x90D9, 0xD3F5, 0x90DA, + 0xD3F6, 0x90E3, 0xD3F7, 0x90DF, 0xD3F8, 0x90E5, 0xD3F9, 0x90D8, 0xD3FA, 0x90DB, 0xD3FB, 0x90D7, 0xD3FC, 0x90DC, 0xD3FD, 0x90E4, + 0xD3FE, 0x9150, 0xD440, 0x914E, 0xD441, 0x914F, 0xD442, 0x91D5, 0xD443, 0x91E2, 0xD444, 0x91DA, 0xD445, 0x965C, 0xD446, 0x965F, + 0xD447, 0x96BC, 0xD448, 0x98E3, 0xD449, 0x9ADF, 0xD44A, 0x9B2F, 0xD44B, 0x4E7F, 0xD44C, 0x5070, 0xD44D, 0x506A, 0xD44E, 0x5061, + 0xD44F, 0x505E, 0xD450, 0x5060, 0xD451, 0x5053, 0xD452, 0x504B, 0xD453, 0x505D, 0xD454, 0x5072, 0xD455, 0x5048, 0xD456, 0x504D, + 0xD457, 0x5041, 0xD458, 0x505B, 0xD459, 0x504A, 0xD45A, 0x5062, 0xD45B, 0x5015, 0xD45C, 0x5045, 0xD45D, 0x505F, 0xD45E, 0x5069, + 0xD45F, 0x506B, 0xD460, 0x5063, 0xD461, 0x5064, 0xD462, 0x5046, 0xD463, 0x5040, 0xD464, 0x506E, 0xD465, 0x5073, 0xD466, 0x5057, + 0xD467, 0x5051, 0xD468, 0x51D0, 0xD469, 0x526B, 0xD46A, 0x526D, 0xD46B, 0x526C, 0xD46C, 0x526E, 0xD46D, 0x52D6, 0xD46E, 0x52D3, + 0xD46F, 0x532D, 0xD470, 0x539C, 0xD471, 0x5575, 0xD472, 0x5576, 0xD473, 0x553C, 0xD474, 0x554D, 0xD475, 0x5550, 0xD476, 0x5534, + 0xD477, 0x552A, 0xD478, 0x5551, 0xD479, 0x5562, 0xD47A, 0x5536, 0xD47B, 0x5535, 0xD47C, 0x5530, 0xD47D, 0x5552, 0xD47E, 0x5545, + 0xD4A1, 0x550C, 0xD4A2, 0x5532, 0xD4A3, 0x5565, 0xD4A4, 0x554E, 0xD4A5, 0x5539, 0xD4A6, 0x5548, 0xD4A7, 0x552D, 0xD4A8, 0x553B, + 0xD4A9, 0x5540, 0xD4AA, 0x554B, 0xD4AB, 0x570A, 0xD4AC, 0x5707, 0xD4AD, 0x57FB, 0xD4AE, 0x5814, 0xD4AF, 0x57E2, 0xD4B0, 0x57F6, + 0xD4B1, 0x57DC, 0xD4B2, 0x57F4, 0xD4B3, 0x5800, 0xD4B4, 0x57ED, 0xD4B5, 0x57FD, 0xD4B6, 0x5808, 0xD4B7, 0x57F8, 0xD4B8, 0x580B, + 0xD4B9, 0x57F3, 0xD4BA, 0x57CF, 0xD4BB, 0x5807, 0xD4BC, 0x57EE, 0xD4BD, 0x57E3, 0xD4BE, 0x57F2, 0xD4BF, 0x57E5, 0xD4C0, 0x57EC, + 0xD4C1, 0x57E1, 0xD4C2, 0x580E, 0xD4C3, 0x57FC, 0xD4C4, 0x5810, 0xD4C5, 0x57E7, 0xD4C6, 0x5801, 0xD4C7, 0x580C, 0xD4C8, 0x57F1, + 0xD4C9, 0x57E9, 0xD4CA, 0x57F0, 0xD4CB, 0x580D, 0xD4CC, 0x5804, 0xD4CD, 0x595C, 0xD4CE, 0x5A60, 0xD4CF, 0x5A58, 0xD4D0, 0x5A55, + 0xD4D1, 0x5A67, 0xD4D2, 0x5A5E, 0xD4D3, 0x5A38, 0xD4D4, 0x5A35, 0xD4D5, 0x5A6D, 0xD4D6, 0x5A50, 0xD4D7, 0x5A5F, 0xD4D8, 0x5A65, + 0xD4D9, 0x5A6C, 0xD4DA, 0x5A53, 0xD4DB, 0x5A64, 0xD4DC, 0x5A57, 0xD4DD, 0x5A43, 0xD4DE, 0x5A5D, 0xD4DF, 0x5A52, 0xD4E0, 0x5A44, + 0xD4E1, 0x5A5B, 0xD4E2, 0x5A48, 0xD4E3, 0x5A8E, 0xD4E4, 0x5A3E, 0xD4E5, 0x5A4D, 0xD4E6, 0x5A39, 0xD4E7, 0x5A4C, 0xD4E8, 0x5A70, + 0xD4E9, 0x5A69, 0xD4EA, 0x5A47, 0xD4EB, 0x5A51, 0xD4EC, 0x5A56, 0xD4ED, 0x5A42, 0xD4EE, 0x5A5C, 0xD4EF, 0x5B72, 0xD4F0, 0x5B6E, + 0xD4F1, 0x5BC1, 0xD4F2, 0x5BC0, 0xD4F3, 0x5C59, 0xD4F4, 0x5D1E, 0xD4F5, 0x5D0B, 0xD4F6, 0x5D1D, 0xD4F7, 0x5D1A, 0xD4F8, 0x5D20, + 0xD4F9, 0x5D0C, 0xD4FA, 0x5D28, 0xD4FB, 0x5D0D, 0xD4FC, 0x5D26, 0xD4FD, 0x5D25, 0xD4FE, 0x5D0F, 0xD540, 0x5D30, 0xD541, 0x5D12, + 0xD542, 0x5D23, 0xD543, 0x5D1F, 0xD544, 0x5D2E, 0xD545, 0x5E3E, 0xD546, 0x5E34, 0xD547, 0x5EB1, 0xD548, 0x5EB4, 0xD549, 0x5EB9, + 0xD54A, 0x5EB2, 0xD54B, 0x5EB3, 0xD54C, 0x5F36, 0xD54D, 0x5F38, 0xD54E, 0x5F9B, 0xD54F, 0x5F96, 0xD550, 0x5F9F, 0xD551, 0x608A, + 0xD552, 0x6090, 0xD553, 0x6086, 0xD554, 0x60BE, 0xD555, 0x60B0, 0xD556, 0x60BA, 0xD557, 0x60D3, 0xD558, 0x60D4, 0xD559, 0x60CF, + 0xD55A, 0x60E4, 0xD55B, 0x60D9, 0xD55C, 0x60DD, 0xD55D, 0x60C8, 0xD55E, 0x60B1, 0xD55F, 0x60DB, 0xD560, 0x60B7, 0xD561, 0x60CA, + 0xD562, 0x60BF, 0xD563, 0x60C3, 0xD564, 0x60CD, 0xD565, 0x60C0, 0xD566, 0x6332, 0xD567, 0x6365, 0xD568, 0x638A, 0xD569, 0x6382, + 0xD56A, 0x637D, 0xD56B, 0x63BD, 0xD56C, 0x639E, 0xD56D, 0x63AD, 0xD56E, 0x639D, 0xD56F, 0x6397, 0xD570, 0x63AB, 0xD571, 0x638E, + 0xD572, 0x636F, 0xD573, 0x6387, 0xD574, 0x6390, 0xD575, 0x636E, 0xD576, 0x63AF, 0xD577, 0x6375, 0xD578, 0x639C, 0xD579, 0x636D, + 0xD57A, 0x63AE, 0xD57B, 0x637C, 0xD57C, 0x63A4, 0xD57D, 0x633B, 0xD57E, 0x639F, 0xD5A1, 0x6378, 0xD5A2, 0x6385, 0xD5A3, 0x6381, + 0xD5A4, 0x6391, 0xD5A5, 0x638D, 0xD5A6, 0x6370, 0xD5A7, 0x6553, 0xD5A8, 0x65CD, 0xD5A9, 0x6665, 0xD5AA, 0x6661, 0xD5AB, 0x665B, + 0xD5AC, 0x6659, 0xD5AD, 0x665C, 0xD5AE, 0x6662, 0xD5AF, 0x6718, 0xD5B0, 0x6879, 0xD5B1, 0x6887, 0xD5B2, 0x6890, 0xD5B3, 0x689C, + 0xD5B4, 0x686D, 0xD5B5, 0x686E, 0xD5B6, 0x68AE, 0xD5B7, 0x68AB, 0xD5B8, 0x6956, 0xD5B9, 0x686F, 0xD5BA, 0x68A3, 0xD5BB, 0x68AC, + 0xD5BC, 0x68A9, 0xD5BD, 0x6875, 0xD5BE, 0x6874, 0xD5BF, 0x68B2, 0xD5C0, 0x688F, 0xD5C1, 0x6877, 0xD5C2, 0x6892, 0xD5C3, 0x687C, + 0xD5C4, 0x686B, 0xD5C5, 0x6872, 0xD5C6, 0x68AA, 0xD5C7, 0x6880, 0xD5C8, 0x6871, 0xD5C9, 0x687E, 0xD5CA, 0x689B, 0xD5CB, 0x6896, + 0xD5CC, 0x688B, 0xD5CD, 0x68A0, 0xD5CE, 0x6889, 0xD5CF, 0x68A4, 0xD5D0, 0x6878, 0xD5D1, 0x687B, 0xD5D2, 0x6891, 0xD5D3, 0x688C, + 0xD5D4, 0x688A, 0xD5D5, 0x687D, 0xD5D6, 0x6B36, 0xD5D7, 0x6B33, 0xD5D8, 0x6B37, 0xD5D9, 0x6B38, 0xD5DA, 0x6B91, 0xD5DB, 0x6B8F, + 0xD5DC, 0x6B8D, 0xD5DD, 0x6B8E, 0xD5DE, 0x6B8C, 0xD5DF, 0x6C2A, 0xD5E0, 0x6DC0, 0xD5E1, 0x6DAB, 0xD5E2, 0x6DB4, 0xD5E3, 0x6DB3, + 0xD5E4, 0x6E74, 0xD5E5, 0x6DAC, 0xD5E6, 0x6DE9, 0xD5E7, 0x6DE2, 0xD5E8, 0x6DB7, 0xD5E9, 0x6DF6, 0xD5EA, 0x6DD4, 0xD5EB, 0x6E00, + 0xD5EC, 0x6DC8, 0xD5ED, 0x6DE0, 0xD5EE, 0x6DDF, 0xD5EF, 0x6DD6, 0xD5F0, 0x6DBE, 0xD5F1, 0x6DE5, 0xD5F2, 0x6DDC, 0xD5F3, 0x6DDD, + 0xD5F4, 0x6DDB, 0xD5F5, 0x6DF4, 0xD5F6, 0x6DCA, 0xD5F7, 0x6DBD, 0xD5F8, 0x6DED, 0xD5F9, 0x6DF0, 0xD5FA, 0x6DBA, 0xD5FB, 0x6DD5, + 0xD5FC, 0x6DC2, 0xD5FD, 0x6DCF, 0xD5FE, 0x6DC9, 0xD640, 0x6DD0, 0xD641, 0x6DF2, 0xD642, 0x6DD3, 0xD643, 0x6DFD, 0xD644, 0x6DD7, + 0xD645, 0x6DCD, 0xD646, 0x6DE3, 0xD647, 0x6DBB, 0xD648, 0x70FA, 0xD649, 0x710D, 0xD64A, 0x70F7, 0xD64B, 0x7117, 0xD64C, 0x70F4, + 0xD64D, 0x710C, 0xD64E, 0x70F0, 0xD64F, 0x7104, 0xD650, 0x70F3, 0xD651, 0x7110, 0xD652, 0x70FC, 0xD653, 0x70FF, 0xD654, 0x7106, + 0xD655, 0x7113, 0xD656, 0x7100, 0xD657, 0x70F8, 0xD658, 0x70F6, 0xD659, 0x710B, 0xD65A, 0x7102, 0xD65B, 0x710E, 0xD65C, 0x727E, + 0xD65D, 0x727B, 0xD65E, 0x727C, 0xD65F, 0x727F, 0xD660, 0x731D, 0xD661, 0x7317, 0xD662, 0x7307, 0xD663, 0x7311, 0xD664, 0x7318, + 0xD665, 0x730A, 0xD666, 0x7308, 0xD667, 0x72FF, 0xD668, 0x730F, 0xD669, 0x731E, 0xD66A, 0x7388, 0xD66B, 0x73F6, 0xD66C, 0x73F8, + 0xD66D, 0x73F5, 0xD66E, 0x7404, 0xD66F, 0x7401, 0xD670, 0x73FD, 0xD671, 0x7407, 0xD672, 0x7400, 0xD673, 0x73FA, 0xD674, 0x73FC, + 0xD675, 0x73FF, 0xD676, 0x740C, 0xD677, 0x740B, 0xD678, 0x73F4, 0xD679, 0x7408, 0xD67A, 0x7564, 0xD67B, 0x7563, 0xD67C, 0x75CE, + 0xD67D, 0x75D2, 0xD67E, 0x75CF, 0xD6A1, 0x75CB, 0xD6A2, 0x75CC, 0xD6A3, 0x75D1, 0xD6A4, 0x75D0, 0xD6A5, 0x768F, 0xD6A6, 0x7689, + 0xD6A7, 0x76D3, 0xD6A8, 0x7739, 0xD6A9, 0x772F, 0xD6AA, 0x772D, 0xD6AB, 0x7731, 0xD6AC, 0x7732, 0xD6AD, 0x7734, 0xD6AE, 0x7733, + 0xD6AF, 0x773D, 0xD6B0, 0x7725, 0xD6B1, 0x773B, 0xD6B2, 0x7735, 0xD6B3, 0x7848, 0xD6B4, 0x7852, 0xD6B5, 0x7849, 0xD6B6, 0x784D, + 0xD6B7, 0x784A, 0xD6B8, 0x784C, 0xD6B9, 0x7826, 0xD6BA, 0x7845, 0xD6BB, 0x7850, 0xD6BC, 0x7964, 0xD6BD, 0x7967, 0xD6BE, 0x7969, + 0xD6BF, 0x796A, 0xD6C0, 0x7963, 0xD6C1, 0x796B, 0xD6C2, 0x7961, 0xD6C3, 0x79BB, 0xD6C4, 0x79FA, 0xD6C5, 0x79F8, 0xD6C6, 0x79F6, + 0xD6C7, 0x79F7, 0xD6C8, 0x7A8F, 0xD6C9, 0x7A94, 0xD6CA, 0x7A90, 0xD6CB, 0x7B35, 0xD6CC, 0x7B47, 0xD6CD, 0x7B34, 0xD6CE, 0x7B25, + 0xD6CF, 0x7B30, 0xD6D0, 0x7B22, 0xD6D1, 0x7B24, 0xD6D2, 0x7B33, 0xD6D3, 0x7B18, 0xD6D4, 0x7B2A, 0xD6D5, 0x7B1D, 0xD6D6, 0x7B31, + 0xD6D7, 0x7B2B, 0xD6D8, 0x7B2D, 0xD6D9, 0x7B2F, 0xD6DA, 0x7B32, 0xD6DB, 0x7B38, 0xD6DC, 0x7B1A, 0xD6DD, 0x7B23, 0xD6DE, 0x7C94, + 0xD6DF, 0x7C98, 0xD6E0, 0x7C96, 0xD6E1, 0x7CA3, 0xD6E2, 0x7D35, 0xD6E3, 0x7D3D, 0xD6E4, 0x7D38, 0xD6E5, 0x7D36, 0xD6E6, 0x7D3A, + 0xD6E7, 0x7D45, 0xD6E8, 0x7D2C, 0xD6E9, 0x7D29, 0xD6EA, 0x7D41, 0xD6EB, 0x7D47, 0xD6EC, 0x7D3E, 0xD6ED, 0x7D3F, 0xD6EE, 0x7D4A, + 0xD6EF, 0x7D3B, 0xD6F0, 0x7D28, 0xD6F1, 0x7F63, 0xD6F2, 0x7F95, 0xD6F3, 0x7F9C, 0xD6F4, 0x7F9D, 0xD6F5, 0x7F9B, 0xD6F6, 0x7FCA, + 0xD6F7, 0x7FCB, 0xD6F8, 0x7FCD, 0xD6F9, 0x7FD0, 0xD6FA, 0x7FD1, 0xD6FB, 0x7FC7, 0xD6FC, 0x7FCF, 0xD6FD, 0x7FC9, 0xD6FE, 0x801F, + 0xD740, 0x801E, 0xD741, 0x801B, 0xD742, 0x8047, 0xD743, 0x8043, 0xD744, 0x8048, 0xD745, 0x8118, 0xD746, 0x8125, 0xD747, 0x8119, + 0xD748, 0x811B, 0xD749, 0x812D, 0xD74A, 0x811F, 0xD74B, 0x812C, 0xD74C, 0x811E, 0xD74D, 0x8121, 0xD74E, 0x8115, 0xD74F, 0x8127, + 0xD750, 0x811D, 0xD751, 0x8122, 0xD752, 0x8211, 0xD753, 0x8238, 0xD754, 0x8233, 0xD755, 0x823A, 0xD756, 0x8234, 0xD757, 0x8232, + 0xD758, 0x8274, 0xD759, 0x8390, 0xD75A, 0x83A3, 0xD75B, 0x83A8, 0xD75C, 0x838D, 0xD75D, 0x837A, 0xD75E, 0x8373, 0xD75F, 0x83A4, + 0xD760, 0x8374, 0xD761, 0x838F, 0xD762, 0x8381, 0xD763, 0x8395, 0xD764, 0x8399, 0xD765, 0x8375, 0xD766, 0x8394, 0xD767, 0x83A9, + 0xD768, 0x837D, 0xD769, 0x8383, 0xD76A, 0x838C, 0xD76B, 0x839D, 0xD76C, 0x839B, 0xD76D, 0x83AA, 0xD76E, 0x838B, 0xD76F, 0x837E, + 0xD770, 0x83A5, 0xD771, 0x83AF, 0xD772, 0x8388, 0xD773, 0x8397, 0xD774, 0x83B0, 0xD775, 0x837F, 0xD776, 0x83A6, 0xD777, 0x8387, + 0xD778, 0x83AE, 0xD779, 0x8376, 0xD77A, 0x839A, 0xD77B, 0x8659, 0xD77C, 0x8656, 0xD77D, 0x86BF, 0xD77E, 0x86B7, 0xD7A1, 0x86C2, + 0xD7A2, 0x86C1, 0xD7A3, 0x86C5, 0xD7A4, 0x86BA, 0xD7A5, 0x86B0, 0xD7A6, 0x86C8, 0xD7A7, 0x86B9, 0xD7A8, 0x86B3, 0xD7A9, 0x86B8, + 0xD7AA, 0x86CC, 0xD7AB, 0x86B4, 0xD7AC, 0x86BB, 0xD7AD, 0x86BC, 0xD7AE, 0x86C3, 0xD7AF, 0x86BD, 0xD7B0, 0x86BE, 0xD7B1, 0x8852, + 0xD7B2, 0x8889, 0xD7B3, 0x8895, 0xD7B4, 0x88A8, 0xD7B5, 0x88A2, 0xD7B6, 0x88AA, 0xD7B7, 0x889A, 0xD7B8, 0x8891, 0xD7B9, 0x88A1, + 0xD7BA, 0x889F, 0xD7BB, 0x8898, 0xD7BC, 0x88A7, 0xD7BD, 0x8899, 0xD7BE, 0x889B, 0xD7BF, 0x8897, 0xD7C0, 0x88A4, 0xD7C1, 0x88AC, + 0xD7C2, 0x888C, 0xD7C3, 0x8893, 0xD7C4, 0x888E, 0xD7C5, 0x8982, 0xD7C6, 0x89D6, 0xD7C7, 0x89D9, 0xD7C8, 0x89D5, 0xD7C9, 0x8A30, + 0xD7CA, 0x8A27, 0xD7CB, 0x8A2C, 0xD7CC, 0x8A1E, 0xD7CD, 0x8C39, 0xD7CE, 0x8C3B, 0xD7CF, 0x8C5C, 0xD7D0, 0x8C5D, 0xD7D1, 0x8C7D, + 0xD7D2, 0x8CA5, 0xD7D3, 0x8D7D, 0xD7D4, 0x8D7B, 0xD7D5, 0x8D79, 0xD7D6, 0x8DBC, 0xD7D7, 0x8DC2, 0xD7D8, 0x8DB9, 0xD7D9, 0x8DBF, + 0xD7DA, 0x8DC1, 0xD7DB, 0x8ED8, 0xD7DC, 0x8EDE, 0xD7DD, 0x8EDD, 0xD7DE, 0x8EDC, 0xD7DF, 0x8ED7, 0xD7E0, 0x8EE0, 0xD7E1, 0x8EE1, + 0xD7E2, 0x9024, 0xD7E3, 0x900B, 0xD7E4, 0x9011, 0xD7E5, 0x901C, 0xD7E6, 0x900C, 0xD7E7, 0x9021, 0xD7E8, 0x90EF, 0xD7E9, 0x90EA, + 0xD7EA, 0x90F0, 0xD7EB, 0x90F4, 0xD7EC, 0x90F2, 0xD7ED, 0x90F3, 0xD7EE, 0x90D4, 0xD7EF, 0x90EB, 0xD7F0, 0x90EC, 0xD7F1, 0x90E9, + 0xD7F2, 0x9156, 0xD7F3, 0x9158, 0xD7F4, 0x915A, 0xD7F5, 0x9153, 0xD7F6, 0x9155, 0xD7F7, 0x91EC, 0xD7F8, 0x91F4, 0xD7F9, 0x91F1, + 0xD7FA, 0x91F3, 0xD7FB, 0x91F8, 0xD7FC, 0x91E4, 0xD7FD, 0x91F9, 0xD7FE, 0x91EA, 0xD840, 0x91EB, 0xD841, 0x91F7, 0xD842, 0x91E8, + 0xD843, 0x91EE, 0xD844, 0x957A, 0xD845, 0x9586, 0xD846, 0x9588, 0xD847, 0x967C, 0xD848, 0x966D, 0xD849, 0x966B, 0xD84A, 0x9671, + 0xD84B, 0x966F, 0xD84C, 0x96BF, 0xD84D, 0x976A, 0xD84E, 0x9804, 0xD84F, 0x98E5, 0xD850, 0x9997, 0xD851, 0x509B, 0xD852, 0x5095, + 0xD853, 0x5094, 0xD854, 0x509E, 0xD855, 0x508B, 0xD856, 0x50A3, 0xD857, 0x5083, 0xD858, 0x508C, 0xD859, 0x508E, 0xD85A, 0x509D, + 0xD85B, 0x5068, 0xD85C, 0x509C, 0xD85D, 0x5092, 0xD85E, 0x5082, 0xD85F, 0x5087, 0xD860, 0x515F, 0xD861, 0x51D4, 0xD862, 0x5312, + 0xD863, 0x5311, 0xD864, 0x53A4, 0xD865, 0x53A7, 0xD866, 0x5591, 0xD867, 0x55A8, 0xD868, 0x55A5, 0xD869, 0x55AD, 0xD86A, 0x5577, + 0xD86B, 0x5645, 0xD86C, 0x55A2, 0xD86D, 0x5593, 0xD86E, 0x5588, 0xD86F, 0x558F, 0xD870, 0x55B5, 0xD871, 0x5581, 0xD872, 0x55A3, + 0xD873, 0x5592, 0xD874, 0x55A4, 0xD875, 0x557D, 0xD876, 0x558C, 0xD877, 0x55A6, 0xD878, 0x557F, 0xD879, 0x5595, 0xD87A, 0x55A1, + 0xD87B, 0x558E, 0xD87C, 0x570C, 0xD87D, 0x5829, 0xD87E, 0x5837, 0xD8A1, 0x5819, 0xD8A2, 0x581E, 0xD8A3, 0x5827, 0xD8A4, 0x5823, + 0xD8A5, 0x5828, 0xD8A6, 0x57F5, 0xD8A7, 0x5848, 0xD8A8, 0x5825, 0xD8A9, 0x581C, 0xD8AA, 0x581B, 0xD8AB, 0x5833, 0xD8AC, 0x583F, + 0xD8AD, 0x5836, 0xD8AE, 0x582E, 0xD8AF, 0x5839, 0xD8B0, 0x5838, 0xD8B1, 0x582D, 0xD8B2, 0x582C, 0xD8B3, 0x583B, 0xD8B4, 0x5961, + 0xD8B5, 0x5AAF, 0xD8B6, 0x5A94, 0xD8B7, 0x5A9F, 0xD8B8, 0x5A7A, 0xD8B9, 0x5AA2, 0xD8BA, 0x5A9E, 0xD8BB, 0x5A78, 0xD8BC, 0x5AA6, + 0xD8BD, 0x5A7C, 0xD8BE, 0x5AA5, 0xD8BF, 0x5AAC, 0xD8C0, 0x5A95, 0xD8C1, 0x5AAE, 0xD8C2, 0x5A37, 0xD8C3, 0x5A84, 0xD8C4, 0x5A8A, + 0xD8C5, 0x5A97, 0xD8C6, 0x5A83, 0xD8C7, 0x5A8B, 0xD8C8, 0x5AA9, 0xD8C9, 0x5A7B, 0xD8CA, 0x5A7D, 0xD8CB, 0x5A8C, 0xD8CC, 0x5A9C, + 0xD8CD, 0x5A8F, 0xD8CE, 0x5A93, 0xD8CF, 0x5A9D, 0xD8D0, 0x5BEA, 0xD8D1, 0x5BCD, 0xD8D2, 0x5BCB, 0xD8D3, 0x5BD4, 0xD8D4, 0x5BD1, + 0xD8D5, 0x5BCA, 0xD8D6, 0x5BCE, 0xD8D7, 0x5C0C, 0xD8D8, 0x5C30, 0xD8D9, 0x5D37, 0xD8DA, 0x5D43, 0xD8DB, 0x5D6B, 0xD8DC, 0x5D41, + 0xD8DD, 0x5D4B, 0xD8DE, 0x5D3F, 0xD8DF, 0x5D35, 0xD8E0, 0x5D51, 0xD8E1, 0x5D4E, 0xD8E2, 0x5D55, 0xD8E3, 0x5D33, 0xD8E4, 0x5D3A, + 0xD8E5, 0x5D52, 0xD8E6, 0x5D3D, 0xD8E7, 0x5D31, 0xD8E8, 0x5D59, 0xD8E9, 0x5D42, 0xD8EA, 0x5D39, 0xD8EB, 0x5D49, 0xD8EC, 0x5D38, + 0xD8ED, 0x5D3C, 0xD8EE, 0x5D32, 0xD8EF, 0x5D36, 0xD8F0, 0x5D40, 0xD8F1, 0x5D45, 0xD8F2, 0x5E44, 0xD8F3, 0x5E41, 0xD8F4, 0x5F58, + 0xD8F5, 0x5FA6, 0xD8F6, 0x5FA5, 0xD8F7, 0x5FAB, 0xD8F8, 0x60C9, 0xD8F9, 0x60B9, 0xD8FA, 0x60CC, 0xD8FB, 0x60E2, 0xD8FC, 0x60CE, + 0xD8FD, 0x60C4, 0xD8FE, 0x6114, 0xD940, 0x60F2, 0xD941, 0x610A, 0xD942, 0x6116, 0xD943, 0x6105, 0xD944, 0x60F5, 0xD945, 0x6113, + 0xD946, 0x60F8, 0xD947, 0x60FC, 0xD948, 0x60FE, 0xD949, 0x60C1, 0xD94A, 0x6103, 0xD94B, 0x6118, 0xD94C, 0x611D, 0xD94D, 0x6110, + 0xD94E, 0x60FF, 0xD94F, 0x6104, 0xD950, 0x610B, 0xD951, 0x624A, 0xD952, 0x6394, 0xD953, 0x63B1, 0xD954, 0x63B0, 0xD955, 0x63CE, + 0xD956, 0x63E5, 0xD957, 0x63E8, 0xD958, 0x63EF, 0xD959, 0x63C3, 0xD95A, 0x649D, 0xD95B, 0x63F3, 0xD95C, 0x63CA, 0xD95D, 0x63E0, + 0xD95E, 0x63F6, 0xD95F, 0x63D5, 0xD960, 0x63F2, 0xD961, 0x63F5, 0xD962, 0x6461, 0xD963, 0x63DF, 0xD964, 0x63BE, 0xD965, 0x63DD, + 0xD966, 0x63DC, 0xD967, 0x63C4, 0xD968, 0x63D8, 0xD969, 0x63D3, 0xD96A, 0x63C2, 0xD96B, 0x63C7, 0xD96C, 0x63CC, 0xD96D, 0x63CB, + 0xD96E, 0x63C8, 0xD96F, 0x63F0, 0xD970, 0x63D7, 0xD971, 0x63D9, 0xD972, 0x6532, 0xD973, 0x6567, 0xD974, 0x656A, 0xD975, 0x6564, + 0xD976, 0x655C, 0xD977, 0x6568, 0xD978, 0x6565, 0xD979, 0x658C, 0xD97A, 0x659D, 0xD97B, 0x659E, 0xD97C, 0x65AE, 0xD97D, 0x65D0, + 0xD97E, 0x65D2, 0xD9A1, 0x667C, 0xD9A2, 0x666C, 0xD9A3, 0x667B, 0xD9A4, 0x6680, 0xD9A5, 0x6671, 0xD9A6, 0x6679, 0xD9A7, 0x666A, + 0xD9A8, 0x6672, 0xD9A9, 0x6701, 0xD9AA, 0x690C, 0xD9AB, 0x68D3, 0xD9AC, 0x6904, 0xD9AD, 0x68DC, 0xD9AE, 0x692A, 0xD9AF, 0x68EC, + 0xD9B0, 0x68EA, 0xD9B1, 0x68F1, 0xD9B2, 0x690F, 0xD9B3, 0x68D6, 0xD9B4, 0x68F7, 0xD9B5, 0x68EB, 0xD9B6, 0x68E4, 0xD9B7, 0x68F6, + 0xD9B8, 0x6913, 0xD9B9, 0x6910, 0xD9BA, 0x68F3, 0xD9BB, 0x68E1, 0xD9BC, 0x6907, 0xD9BD, 0x68CC, 0xD9BE, 0x6908, 0xD9BF, 0x6970, + 0xD9C0, 0x68B4, 0xD9C1, 0x6911, 0xD9C2, 0x68EF, 0xD9C3, 0x68C6, 0xD9C4, 0x6914, 0xD9C5, 0x68F8, 0xD9C6, 0x68D0, 0xD9C7, 0x68FD, + 0xD9C8, 0x68FC, 0xD9C9, 0x68E8, 0xD9CA, 0x690B, 0xD9CB, 0x690A, 0xD9CC, 0x6917, 0xD9CD, 0x68CE, 0xD9CE, 0x68C8, 0xD9CF, 0x68DD, + 0xD9D0, 0x68DE, 0xD9D1, 0x68E6, 0xD9D2, 0x68F4, 0xD9D3, 0x68D1, 0xD9D4, 0x6906, 0xD9D5, 0x68D4, 0xD9D6, 0x68E9, 0xD9D7, 0x6915, + 0xD9D8, 0x6925, 0xD9D9, 0x68C7, 0xD9DA, 0x6B39, 0xD9DB, 0x6B3B, 0xD9DC, 0x6B3F, 0xD9DD, 0x6B3C, 0xD9DE, 0x6B94, 0xD9DF, 0x6B97, + 0xD9E0, 0x6B99, 0xD9E1, 0x6B95, 0xD9E2, 0x6BBD, 0xD9E3, 0x6BF0, 0xD9E4, 0x6BF2, 0xD9E5, 0x6BF3, 0xD9E6, 0x6C30, 0xD9E7, 0x6DFC, + 0xD9E8, 0x6E46, 0xD9E9, 0x6E47, 0xD9EA, 0x6E1F, 0xD9EB, 0x6E49, 0xD9EC, 0x6E88, 0xD9ED, 0x6E3C, 0xD9EE, 0x6E3D, 0xD9EF, 0x6E45, + 0xD9F0, 0x6E62, 0xD9F1, 0x6E2B, 0xD9F2, 0x6E3F, 0xD9F3, 0x6E41, 0xD9F4, 0x6E5D, 0xD9F5, 0x6E73, 0xD9F6, 0x6E1C, 0xD9F7, 0x6E33, + 0xD9F8, 0x6E4B, 0xD9F9, 0x6E40, 0xD9FA, 0x6E51, 0xD9FB, 0x6E3B, 0xD9FC, 0x6E03, 0xD9FD, 0x6E2E, 0xD9FE, 0x6E5E, 0xDA40, 0x6E68, + 0xDA41, 0x6E5C, 0xDA42, 0x6E61, 0xDA43, 0x6E31, 0xDA44, 0x6E28, 0xDA45, 0x6E60, 0xDA46, 0x6E71, 0xDA47, 0x6E6B, 0xDA48, 0x6E39, + 0xDA49, 0x6E22, 0xDA4A, 0x6E30, 0xDA4B, 0x6E53, 0xDA4C, 0x6E65, 0xDA4D, 0x6E27, 0xDA4E, 0x6E78, 0xDA4F, 0x6E64, 0xDA50, 0x6E77, + 0xDA51, 0x6E55, 0xDA52, 0x6E79, 0xDA53, 0x6E52, 0xDA54, 0x6E66, 0xDA55, 0x6E35, 0xDA56, 0x6E36, 0xDA57, 0x6E5A, 0xDA58, 0x7120, + 0xDA59, 0x711E, 0xDA5A, 0x712F, 0xDA5B, 0x70FB, 0xDA5C, 0x712E, 0xDA5D, 0x7131, 0xDA5E, 0x7123, 0xDA5F, 0x7125, 0xDA60, 0x7122, + 0xDA61, 0x7132, 0xDA62, 0x711F, 0xDA63, 0x7128, 0xDA64, 0x713A, 0xDA65, 0x711B, 0xDA66, 0x724B, 0xDA67, 0x725A, 0xDA68, 0x7288, + 0xDA69, 0x7289, 0xDA6A, 0x7286, 0xDA6B, 0x7285, 0xDA6C, 0x728B, 0xDA6D, 0x7312, 0xDA6E, 0x730B, 0xDA6F, 0x7330, 0xDA70, 0x7322, + 0xDA71, 0x7331, 0xDA72, 0x7333, 0xDA73, 0x7327, 0xDA74, 0x7332, 0xDA75, 0x732D, 0xDA76, 0x7326, 0xDA77, 0x7323, 0xDA78, 0x7335, + 0xDA79, 0x730C, 0xDA7A, 0x742E, 0xDA7B, 0x742C, 0xDA7C, 0x7430, 0xDA7D, 0x742B, 0xDA7E, 0x7416, 0xDAA1, 0x741A, 0xDAA2, 0x7421, + 0xDAA3, 0x742D, 0xDAA4, 0x7431, 0xDAA5, 0x7424, 0xDAA6, 0x7423, 0xDAA7, 0x741D, 0xDAA8, 0x7429, 0xDAA9, 0x7420, 0xDAAA, 0x7432, + 0xDAAB, 0x74FB, 0xDAAC, 0x752F, 0xDAAD, 0x756F, 0xDAAE, 0x756C, 0xDAAF, 0x75E7, 0xDAB0, 0x75DA, 0xDAB1, 0x75E1, 0xDAB2, 0x75E6, + 0xDAB3, 0x75DD, 0xDAB4, 0x75DF, 0xDAB5, 0x75E4, 0xDAB6, 0x75D7, 0xDAB7, 0x7695, 0xDAB8, 0x7692, 0xDAB9, 0x76DA, 0xDABA, 0x7746, + 0xDABB, 0x7747, 0xDABC, 0x7744, 0xDABD, 0x774D, 0xDABE, 0x7745, 0xDABF, 0x774A, 0xDAC0, 0x774E, 0xDAC1, 0x774B, 0xDAC2, 0x774C, + 0xDAC3, 0x77DE, 0xDAC4, 0x77EC, 0xDAC5, 0x7860, 0xDAC6, 0x7864, 0xDAC7, 0x7865, 0xDAC8, 0x785C, 0xDAC9, 0x786D, 0xDACA, 0x7871, + 0xDACB, 0x786A, 0xDACC, 0x786E, 0xDACD, 0x7870, 0xDACE, 0x7869, 0xDACF, 0x7868, 0xDAD0, 0x785E, 0xDAD1, 0x7862, 0xDAD2, 0x7974, + 0xDAD3, 0x7973, 0xDAD4, 0x7972, 0xDAD5, 0x7970, 0xDAD6, 0x7A02, 0xDAD7, 0x7A0A, 0xDAD8, 0x7A03, 0xDAD9, 0x7A0C, 0xDADA, 0x7A04, + 0xDADB, 0x7A99, 0xDADC, 0x7AE6, 0xDADD, 0x7AE4, 0xDADE, 0x7B4A, 0xDADF, 0x7B3B, 0xDAE0, 0x7B44, 0xDAE1, 0x7B48, 0xDAE2, 0x7B4C, + 0xDAE3, 0x7B4E, 0xDAE4, 0x7B40, 0xDAE5, 0x7B58, 0xDAE6, 0x7B45, 0xDAE7, 0x7CA2, 0xDAE8, 0x7C9E, 0xDAE9, 0x7CA8, 0xDAEA, 0x7CA1, + 0xDAEB, 0x7D58, 0xDAEC, 0x7D6F, 0xDAED, 0x7D63, 0xDAEE, 0x7D53, 0xDAEF, 0x7D56, 0xDAF0, 0x7D67, 0xDAF1, 0x7D6A, 0xDAF2, 0x7D4F, + 0xDAF3, 0x7D6D, 0xDAF4, 0x7D5C, 0xDAF5, 0x7D6B, 0xDAF6, 0x7D52, 0xDAF7, 0x7D54, 0xDAF8, 0x7D69, 0xDAF9, 0x7D51, 0xDAFA, 0x7D5F, + 0xDAFB, 0x7D4E, 0xDAFC, 0x7F3E, 0xDAFD, 0x7F3F, 0xDAFE, 0x7F65, 0xDB40, 0x7F66, 0xDB41, 0x7FA2, 0xDB42, 0x7FA0, 0xDB43, 0x7FA1, + 0xDB44, 0x7FD7, 0xDB45, 0x8051, 0xDB46, 0x804F, 0xDB47, 0x8050, 0xDB48, 0x80FE, 0xDB49, 0x80D4, 0xDB4A, 0x8143, 0xDB4B, 0x814A, + 0xDB4C, 0x8152, 0xDB4D, 0x814F, 0xDB4E, 0x8147, 0xDB4F, 0x813D, 0xDB50, 0x814D, 0xDB51, 0x813A, 0xDB52, 0x81E6, 0xDB53, 0x81EE, + 0xDB54, 0x81F7, 0xDB55, 0x81F8, 0xDB56, 0x81F9, 0xDB57, 0x8204, 0xDB58, 0x823C, 0xDB59, 0x823D, 0xDB5A, 0x823F, 0xDB5B, 0x8275, + 0xDB5C, 0x833B, 0xDB5D, 0x83CF, 0xDB5E, 0x83F9, 0xDB5F, 0x8423, 0xDB60, 0x83C0, 0xDB61, 0x83E8, 0xDB62, 0x8412, 0xDB63, 0x83E7, + 0xDB64, 0x83E4, 0xDB65, 0x83FC, 0xDB66, 0x83F6, 0xDB67, 0x8410, 0xDB68, 0x83C6, 0xDB69, 0x83C8, 0xDB6A, 0x83EB, 0xDB6B, 0x83E3, + 0xDB6C, 0x83BF, 0xDB6D, 0x8401, 0xDB6E, 0x83DD, 0xDB6F, 0x83E5, 0xDB70, 0x83D8, 0xDB71, 0x83FF, 0xDB72, 0x83E1, 0xDB73, 0x83CB, + 0xDB74, 0x83CE, 0xDB75, 0x83D6, 0xDB76, 0x83F5, 0xDB77, 0x83C9, 0xDB78, 0x8409, 0xDB79, 0x840F, 0xDB7A, 0x83DE, 0xDB7B, 0x8411, + 0xDB7C, 0x8406, 0xDB7D, 0x83C2, 0xDB7E, 0x83F3, 0xDBA1, 0x83D5, 0xDBA2, 0x83FA, 0xDBA3, 0x83C7, 0xDBA4, 0x83D1, 0xDBA5, 0x83EA, + 0xDBA6, 0x8413, 0xDBA7, 0x83C3, 0xDBA8, 0x83EC, 0xDBA9, 0x83EE, 0xDBAA, 0x83C4, 0xDBAB, 0x83FB, 0xDBAC, 0x83D7, 0xDBAD, 0x83E2, + 0xDBAE, 0x841B, 0xDBAF, 0x83DB, 0xDBB0, 0x83FE, 0xDBB1, 0x86D8, 0xDBB2, 0x86E2, 0xDBB3, 0x86E6, 0xDBB4, 0x86D3, 0xDBB5, 0x86E3, + 0xDBB6, 0x86DA, 0xDBB7, 0x86EA, 0xDBB8, 0x86DD, 0xDBB9, 0x86EB, 0xDBBA, 0x86DC, 0xDBBB, 0x86EC, 0xDBBC, 0x86E9, 0xDBBD, 0x86D7, + 0xDBBE, 0x86E8, 0xDBBF, 0x86D1, 0xDBC0, 0x8848, 0xDBC1, 0x8856, 0xDBC2, 0x8855, 0xDBC3, 0x88BA, 0xDBC4, 0x88D7, 0xDBC5, 0x88B9, + 0xDBC6, 0x88B8, 0xDBC7, 0x88C0, 0xDBC8, 0x88BE, 0xDBC9, 0x88B6, 0xDBCA, 0x88BC, 0xDBCB, 0x88B7, 0xDBCC, 0x88BD, 0xDBCD, 0x88B2, + 0xDBCE, 0x8901, 0xDBCF, 0x88C9, 0xDBD0, 0x8995, 0xDBD1, 0x8998, 0xDBD2, 0x8997, 0xDBD3, 0x89DD, 0xDBD4, 0x89DA, 0xDBD5, 0x89DB, + 0xDBD6, 0x8A4E, 0xDBD7, 0x8A4D, 0xDBD8, 0x8A39, 0xDBD9, 0x8A59, 0xDBDA, 0x8A40, 0xDBDB, 0x8A57, 0xDBDC, 0x8A58, 0xDBDD, 0x8A44, + 0xDBDE, 0x8A45, 0xDBDF, 0x8A52, 0xDBE0, 0x8A48, 0xDBE1, 0x8A51, 0xDBE2, 0x8A4A, 0xDBE3, 0x8A4C, 0xDBE4, 0x8A4F, 0xDBE5, 0x8C5F, + 0xDBE6, 0x8C81, 0xDBE7, 0x8C80, 0xDBE8, 0x8CBA, 0xDBE9, 0x8CBE, 0xDBEA, 0x8CB0, 0xDBEB, 0x8CB9, 0xDBEC, 0x8CB5, 0xDBED, 0x8D84, + 0xDBEE, 0x8D80, 0xDBEF, 0x8D89, 0xDBF0, 0x8DD8, 0xDBF1, 0x8DD3, 0xDBF2, 0x8DCD, 0xDBF3, 0x8DC7, 0xDBF4, 0x8DD6, 0xDBF5, 0x8DDC, + 0xDBF6, 0x8DCF, 0xDBF7, 0x8DD5, 0xDBF8, 0x8DD9, 0xDBF9, 0x8DC8, 0xDBFA, 0x8DD7, 0xDBFB, 0x8DC5, 0xDBFC, 0x8EEF, 0xDBFD, 0x8EF7, + 0xDBFE, 0x8EFA, 0xDC40, 0x8EF9, 0xDC41, 0x8EE6, 0xDC42, 0x8EEE, 0xDC43, 0x8EE5, 0xDC44, 0x8EF5, 0xDC45, 0x8EE7, 0xDC46, 0x8EE8, + 0xDC47, 0x8EF6, 0xDC48, 0x8EEB, 0xDC49, 0x8EF1, 0xDC4A, 0x8EEC, 0xDC4B, 0x8EF4, 0xDC4C, 0x8EE9, 0xDC4D, 0x902D, 0xDC4E, 0x9034, + 0xDC4F, 0x902F, 0xDC50, 0x9106, 0xDC51, 0x912C, 0xDC52, 0x9104, 0xDC53, 0x90FF, 0xDC54, 0x90FC, 0xDC55, 0x9108, 0xDC56, 0x90F9, + 0xDC57, 0x90FB, 0xDC58, 0x9101, 0xDC59, 0x9100, 0xDC5A, 0x9107, 0xDC5B, 0x9105, 0xDC5C, 0x9103, 0xDC5D, 0x9161, 0xDC5E, 0x9164, + 0xDC5F, 0x915F, 0xDC60, 0x9162, 0xDC61, 0x9160, 0xDC62, 0x9201, 0xDC63, 0x920A, 0xDC64, 0x9225, 0xDC65, 0x9203, 0xDC66, 0x921A, + 0xDC67, 0x9226, 0xDC68, 0x920F, 0xDC69, 0x920C, 0xDC6A, 0x9200, 0xDC6B, 0x9212, 0xDC6C, 0x91FF, 0xDC6D, 0x91FD, 0xDC6E, 0x9206, + 0xDC6F, 0x9204, 0xDC70, 0x9227, 0xDC71, 0x9202, 0xDC72, 0x921C, 0xDC73, 0x9224, 0xDC74, 0x9219, 0xDC75, 0x9217, 0xDC76, 0x9205, + 0xDC77, 0x9216, 0xDC78, 0x957B, 0xDC79, 0x958D, 0xDC7A, 0x958C, 0xDC7B, 0x9590, 0xDC7C, 0x9687, 0xDC7D, 0x967E, 0xDC7E, 0x9688, + 0xDCA1, 0x9689, 0xDCA2, 0x9683, 0xDCA3, 0x9680, 0xDCA4, 0x96C2, 0xDCA5, 0x96C8, 0xDCA6, 0x96C3, 0xDCA7, 0x96F1, 0xDCA8, 0x96F0, + 0xDCA9, 0x976C, 0xDCAA, 0x9770, 0xDCAB, 0x976E, 0xDCAC, 0x9807, 0xDCAD, 0x98A9, 0xDCAE, 0x98EB, 0xDCAF, 0x9CE6, 0xDCB0, 0x9EF9, + 0xDCB1, 0x4E83, 0xDCB2, 0x4E84, 0xDCB3, 0x4EB6, 0xDCB4, 0x50BD, 0xDCB5, 0x50BF, 0xDCB6, 0x50C6, 0xDCB7, 0x50AE, 0xDCB8, 0x50C4, + 0xDCB9, 0x50CA, 0xDCBA, 0x50B4, 0xDCBB, 0x50C8, 0xDCBC, 0x50C2, 0xDCBD, 0x50B0, 0xDCBE, 0x50C1, 0xDCBF, 0x50BA, 0xDCC0, 0x50B1, + 0xDCC1, 0x50CB, 0xDCC2, 0x50C9, 0xDCC3, 0x50B6, 0xDCC4, 0x50B8, 0xDCC5, 0x51D7, 0xDCC6, 0x527A, 0xDCC7, 0x5278, 0xDCC8, 0x527B, + 0xDCC9, 0x527C, 0xDCCA, 0x55C3, 0xDCCB, 0x55DB, 0xDCCC, 0x55CC, 0xDCCD, 0x55D0, 0xDCCE, 0x55CB, 0xDCCF, 0x55CA, 0xDCD0, 0x55DD, + 0xDCD1, 0x55C0, 0xDCD2, 0x55D4, 0xDCD3, 0x55C4, 0xDCD4, 0x55E9, 0xDCD5, 0x55BF, 0xDCD6, 0x55D2, 0xDCD7, 0x558D, 0xDCD8, 0x55CF, + 0xDCD9, 0x55D5, 0xDCDA, 0x55E2, 0xDCDB, 0x55D6, 0xDCDC, 0x55C8, 0xDCDD, 0x55F2, 0xDCDE, 0x55CD, 0xDCDF, 0x55D9, 0xDCE0, 0x55C2, + 0xDCE1, 0x5714, 0xDCE2, 0x5853, 0xDCE3, 0x5868, 0xDCE4, 0x5864, 0xDCE5, 0x584F, 0xDCE6, 0x584D, 0xDCE7, 0x5849, 0xDCE8, 0x586F, + 0xDCE9, 0x5855, 0xDCEA, 0x584E, 0xDCEB, 0x585D, 0xDCEC, 0x5859, 0xDCED, 0x5865, 0xDCEE, 0x585B, 0xDCEF, 0x583D, 0xDCF0, 0x5863, + 0xDCF1, 0x5871, 0xDCF2, 0x58FC, 0xDCF3, 0x5AC7, 0xDCF4, 0x5AC4, 0xDCF5, 0x5ACB, 0xDCF6, 0x5ABA, 0xDCF7, 0x5AB8, 0xDCF8, 0x5AB1, + 0xDCF9, 0x5AB5, 0xDCFA, 0x5AB0, 0xDCFB, 0x5ABF, 0xDCFC, 0x5AC8, 0xDCFD, 0x5ABB, 0xDCFE, 0x5AC6, 0xDD40, 0x5AB7, 0xDD41, 0x5AC0, + 0xDD42, 0x5ACA, 0xDD43, 0x5AB4, 0xDD44, 0x5AB6, 0xDD45, 0x5ACD, 0xDD46, 0x5AB9, 0xDD47, 0x5A90, 0xDD48, 0x5BD6, 0xDD49, 0x5BD8, + 0xDD4A, 0x5BD9, 0xDD4B, 0x5C1F, 0xDD4C, 0x5C33, 0xDD4D, 0x5D71, 0xDD4E, 0x5D63, 0xDD4F, 0x5D4A, 0xDD50, 0x5D65, 0xDD51, 0x5D72, + 0xDD52, 0x5D6C, 0xDD53, 0x5D5E, 0xDD54, 0x5D68, 0xDD55, 0x5D67, 0xDD56, 0x5D62, 0xDD57, 0x5DF0, 0xDD58, 0x5E4F, 0xDD59, 0x5E4E, + 0xDD5A, 0x5E4A, 0xDD5B, 0x5E4D, 0xDD5C, 0x5E4B, 0xDD5D, 0x5EC5, 0xDD5E, 0x5ECC, 0xDD5F, 0x5EC6, 0xDD60, 0x5ECB, 0xDD61, 0x5EC7, + 0xDD62, 0x5F40, 0xDD63, 0x5FAF, 0xDD64, 0x5FAD, 0xDD65, 0x60F7, 0xDD66, 0x6149, 0xDD67, 0x614A, 0xDD68, 0x612B, 0xDD69, 0x6145, + 0xDD6A, 0x6136, 0xDD6B, 0x6132, 0xDD6C, 0x612E, 0xDD6D, 0x6146, 0xDD6E, 0x612F, 0xDD6F, 0x614F, 0xDD70, 0x6129, 0xDD71, 0x6140, + 0xDD72, 0x6220, 0xDD73, 0x9168, 0xDD74, 0x6223, 0xDD75, 0x6225, 0xDD76, 0x6224, 0xDD77, 0x63C5, 0xDD78, 0x63F1, 0xDD79, 0x63EB, + 0xDD7A, 0x6410, 0xDD7B, 0x6412, 0xDD7C, 0x6409, 0xDD7D, 0x6420, 0xDD7E, 0x6424, 0xDDA1, 0x6433, 0xDDA2, 0x6443, 0xDDA3, 0x641F, + 0xDDA4, 0x6415, 0xDDA5, 0x6418, 0xDDA6, 0x6439, 0xDDA7, 0x6437, 0xDDA8, 0x6422, 0xDDA9, 0x6423, 0xDDAA, 0x640C, 0xDDAB, 0x6426, + 0xDDAC, 0x6430, 0xDDAD, 0x6428, 0xDDAE, 0x6441, 0xDDAF, 0x6435, 0xDDB0, 0x642F, 0xDDB1, 0x640A, 0xDDB2, 0x641A, 0xDDB3, 0x6440, + 0xDDB4, 0x6425, 0xDDB5, 0x6427, 0xDDB6, 0x640B, 0xDDB7, 0x63E7, 0xDDB8, 0x641B, 0xDDB9, 0x642E, 0xDDBA, 0x6421, 0xDDBB, 0x640E, + 0xDDBC, 0x656F, 0xDDBD, 0x6592, 0xDDBE, 0x65D3, 0xDDBF, 0x6686, 0xDDC0, 0x668C, 0xDDC1, 0x6695, 0xDDC2, 0x6690, 0xDDC3, 0x668B, + 0xDDC4, 0x668A, 0xDDC5, 0x6699, 0xDDC6, 0x6694, 0xDDC7, 0x6678, 0xDDC8, 0x6720, 0xDDC9, 0x6966, 0xDDCA, 0x695F, 0xDDCB, 0x6938, + 0xDDCC, 0x694E, 0xDDCD, 0x6962, 0xDDCE, 0x6971, 0xDDCF, 0x693F, 0xDDD0, 0x6945, 0xDDD1, 0x696A, 0xDDD2, 0x6939, 0xDDD3, 0x6942, + 0xDDD4, 0x6957, 0xDDD5, 0x6959, 0xDDD6, 0x697A, 0xDDD7, 0x6948, 0xDDD8, 0x6949, 0xDDD9, 0x6935, 0xDDDA, 0x696C, 0xDDDB, 0x6933, + 0xDDDC, 0x693D, 0xDDDD, 0x6965, 0xDDDE, 0x68F0, 0xDDDF, 0x6978, 0xDDE0, 0x6934, 0xDDE1, 0x6969, 0xDDE2, 0x6940, 0xDDE3, 0x696F, + 0xDDE4, 0x6944, 0xDDE5, 0x6976, 0xDDE6, 0x6958, 0xDDE7, 0x6941, 0xDDE8, 0x6974, 0xDDE9, 0x694C, 0xDDEA, 0x693B, 0xDDEB, 0x694B, + 0xDDEC, 0x6937, 0xDDED, 0x695C, 0xDDEE, 0x694F, 0xDDEF, 0x6951, 0xDDF0, 0x6932, 0xDDF1, 0x6952, 0xDDF2, 0x692F, 0xDDF3, 0x697B, + 0xDDF4, 0x693C, 0xDDF5, 0x6B46, 0xDDF6, 0x6B45, 0xDDF7, 0x6B43, 0xDDF8, 0x6B42, 0xDDF9, 0x6B48, 0xDDFA, 0x6B41, 0xDDFB, 0x6B9B, + 0xDDFC, 0xFA0D, 0xDDFD, 0x6BFB, 0xDDFE, 0x6BFC, 0xDE40, 0x6BF9, 0xDE41, 0x6BF7, 0xDE42, 0x6BF8, 0xDE43, 0x6E9B, 0xDE44, 0x6ED6, + 0xDE45, 0x6EC8, 0xDE46, 0x6E8F, 0xDE47, 0x6EC0, 0xDE48, 0x6E9F, 0xDE49, 0x6E93, 0xDE4A, 0x6E94, 0xDE4B, 0x6EA0, 0xDE4C, 0x6EB1, + 0xDE4D, 0x6EB9, 0xDE4E, 0x6EC6, 0xDE4F, 0x6ED2, 0xDE50, 0x6EBD, 0xDE51, 0x6EC1, 0xDE52, 0x6E9E, 0xDE53, 0x6EC9, 0xDE54, 0x6EB7, + 0xDE55, 0x6EB0, 0xDE56, 0x6ECD, 0xDE57, 0x6EA6, 0xDE58, 0x6ECF, 0xDE59, 0x6EB2, 0xDE5A, 0x6EBE, 0xDE5B, 0x6EC3, 0xDE5C, 0x6EDC, + 0xDE5D, 0x6ED8, 0xDE5E, 0x6E99, 0xDE5F, 0x6E92, 0xDE60, 0x6E8E, 0xDE61, 0x6E8D, 0xDE62, 0x6EA4, 0xDE63, 0x6EA1, 0xDE64, 0x6EBF, + 0xDE65, 0x6EB3, 0xDE66, 0x6ED0, 0xDE67, 0x6ECA, 0xDE68, 0x6E97, 0xDE69, 0x6EAE, 0xDE6A, 0x6EA3, 0xDE6B, 0x7147, 0xDE6C, 0x7154, + 0xDE6D, 0x7152, 0xDE6E, 0x7163, 0xDE6F, 0x7160, 0xDE70, 0x7141, 0xDE71, 0x715D, 0xDE72, 0x7162, 0xDE73, 0x7172, 0xDE74, 0x7178, + 0xDE75, 0x716A, 0xDE76, 0x7161, 0xDE77, 0x7142, 0xDE78, 0x7158, 0xDE79, 0x7143, 0xDE7A, 0x714B, 0xDE7B, 0x7170, 0xDE7C, 0x715F, + 0xDE7D, 0x7150, 0xDE7E, 0x7153, 0xDEA1, 0x7144, 0xDEA2, 0x714D, 0xDEA3, 0x715A, 0xDEA4, 0x724F, 0xDEA5, 0x728D, 0xDEA6, 0x728C, + 0xDEA7, 0x7291, 0xDEA8, 0x7290, 0xDEA9, 0x728E, 0xDEAA, 0x733C, 0xDEAB, 0x7342, 0xDEAC, 0x733B, 0xDEAD, 0x733A, 0xDEAE, 0x7340, + 0xDEAF, 0x734A, 0xDEB0, 0x7349, 0xDEB1, 0x7444, 0xDEB2, 0x744A, 0xDEB3, 0x744B, 0xDEB4, 0x7452, 0xDEB5, 0x7451, 0xDEB6, 0x7457, + 0xDEB7, 0x7440, 0xDEB8, 0x744F, 0xDEB9, 0x7450, 0xDEBA, 0x744E, 0xDEBB, 0x7442, 0xDEBC, 0x7446, 0xDEBD, 0x744D, 0xDEBE, 0x7454, + 0xDEBF, 0x74E1, 0xDEC0, 0x74FF, 0xDEC1, 0x74FE, 0xDEC2, 0x74FD, 0xDEC3, 0x751D, 0xDEC4, 0x7579, 0xDEC5, 0x7577, 0xDEC6, 0x6983, + 0xDEC7, 0x75EF, 0xDEC8, 0x760F, 0xDEC9, 0x7603, 0xDECA, 0x75F7, 0xDECB, 0x75FE, 0xDECC, 0x75FC, 0xDECD, 0x75F9, 0xDECE, 0x75F8, + 0xDECF, 0x7610, 0xDED0, 0x75FB, 0xDED1, 0x75F6, 0xDED2, 0x75ED, 0xDED3, 0x75F5, 0xDED4, 0x75FD, 0xDED5, 0x7699, 0xDED6, 0x76B5, + 0xDED7, 0x76DD, 0xDED8, 0x7755, 0xDED9, 0x775F, 0xDEDA, 0x7760, 0xDEDB, 0x7752, 0xDEDC, 0x7756, 0xDEDD, 0x775A, 0xDEDE, 0x7769, + 0xDEDF, 0x7767, 0xDEE0, 0x7754, 0xDEE1, 0x7759, 0xDEE2, 0x776D, 0xDEE3, 0x77E0, 0xDEE4, 0x7887, 0xDEE5, 0x789A, 0xDEE6, 0x7894, + 0xDEE7, 0x788F, 0xDEE8, 0x7884, 0xDEE9, 0x7895, 0xDEEA, 0x7885, 0xDEEB, 0x7886, 0xDEEC, 0x78A1, 0xDEED, 0x7883, 0xDEEE, 0x7879, + 0xDEEF, 0x7899, 0xDEF0, 0x7880, 0xDEF1, 0x7896, 0xDEF2, 0x787B, 0xDEF3, 0x797C, 0xDEF4, 0x7982, 0xDEF5, 0x797D, 0xDEF6, 0x7979, + 0xDEF7, 0x7A11, 0xDEF8, 0x7A18, 0xDEF9, 0x7A19, 0xDEFA, 0x7A12, 0xDEFB, 0x7A17, 0xDEFC, 0x7A15, 0xDEFD, 0x7A22, 0xDEFE, 0x7A13, + 0xDF40, 0x7A1B, 0xDF41, 0x7A10, 0xDF42, 0x7AA3, 0xDF43, 0x7AA2, 0xDF44, 0x7A9E, 0xDF45, 0x7AEB, 0xDF46, 0x7B66, 0xDF47, 0x7B64, + 0xDF48, 0x7B6D, 0xDF49, 0x7B74, 0xDF4A, 0x7B69, 0xDF4B, 0x7B72, 0xDF4C, 0x7B65, 0xDF4D, 0x7B73, 0xDF4E, 0x7B71, 0xDF4F, 0x7B70, + 0xDF50, 0x7B61, 0xDF51, 0x7B78, 0xDF52, 0x7B76, 0xDF53, 0x7B63, 0xDF54, 0x7CB2, 0xDF55, 0x7CB4, 0xDF56, 0x7CAF, 0xDF57, 0x7D88, + 0xDF58, 0x7D86, 0xDF59, 0x7D80, 0xDF5A, 0x7D8D, 0xDF5B, 0x7D7F, 0xDF5C, 0x7D85, 0xDF5D, 0x7D7A, 0xDF5E, 0x7D8E, 0xDF5F, 0x7D7B, + 0xDF60, 0x7D83, 0xDF61, 0x7D7C, 0xDF62, 0x7D8C, 0xDF63, 0x7D94, 0xDF64, 0x7D84, 0xDF65, 0x7D7D, 0xDF66, 0x7D92, 0xDF67, 0x7F6D, + 0xDF68, 0x7F6B, 0xDF69, 0x7F67, 0xDF6A, 0x7F68, 0xDF6B, 0x7F6C, 0xDF6C, 0x7FA6, 0xDF6D, 0x7FA5, 0xDF6E, 0x7FA7, 0xDF6F, 0x7FDB, + 0xDF70, 0x7FDC, 0xDF71, 0x8021, 0xDF72, 0x8164, 0xDF73, 0x8160, 0xDF74, 0x8177, 0xDF75, 0x815C, 0xDF76, 0x8169, 0xDF77, 0x815B, + 0xDF78, 0x8162, 0xDF79, 0x8172, 0xDF7A, 0x6721, 0xDF7B, 0x815E, 0xDF7C, 0x8176, 0xDF7D, 0x8167, 0xDF7E, 0x816F, 0xDFA1, 0x8144, + 0xDFA2, 0x8161, 0xDFA3, 0x821D, 0xDFA4, 0x8249, 0xDFA5, 0x8244, 0xDFA6, 0x8240, 0xDFA7, 0x8242, 0xDFA8, 0x8245, 0xDFA9, 0x84F1, + 0xDFAA, 0x843F, 0xDFAB, 0x8456, 0xDFAC, 0x8476, 0xDFAD, 0x8479, 0xDFAE, 0x848F, 0xDFAF, 0x848D, 0xDFB0, 0x8465, 0xDFB1, 0x8451, + 0xDFB2, 0x8440, 0xDFB3, 0x8486, 0xDFB4, 0x8467, 0xDFB5, 0x8430, 0xDFB6, 0x844D, 0xDFB7, 0x847D, 0xDFB8, 0x845A, 0xDFB9, 0x8459, + 0xDFBA, 0x8474, 0xDFBB, 0x8473, 0xDFBC, 0x845D, 0xDFBD, 0x8507, 0xDFBE, 0x845E, 0xDFBF, 0x8437, 0xDFC0, 0x843A, 0xDFC1, 0x8434, + 0xDFC2, 0x847A, 0xDFC3, 0x8443, 0xDFC4, 0x8478, 0xDFC5, 0x8432, 0xDFC6, 0x8445, 0xDFC7, 0x8429, 0xDFC8, 0x83D9, 0xDFC9, 0x844B, + 0xDFCA, 0x842F, 0xDFCB, 0x8442, 0xDFCC, 0x842D, 0xDFCD, 0x845F, 0xDFCE, 0x8470, 0xDFCF, 0x8439, 0xDFD0, 0x844E, 0xDFD1, 0x844C, + 0xDFD2, 0x8452, 0xDFD3, 0x846F, 0xDFD4, 0x84C5, 0xDFD5, 0x848E, 0xDFD6, 0x843B, 0xDFD7, 0x8447, 0xDFD8, 0x8436, 0xDFD9, 0x8433, + 0xDFDA, 0x8468, 0xDFDB, 0x847E, 0xDFDC, 0x8444, 0xDFDD, 0x842B, 0xDFDE, 0x8460, 0xDFDF, 0x8454, 0xDFE0, 0x846E, 0xDFE1, 0x8450, + 0xDFE2, 0x870B, 0xDFE3, 0x8704, 0xDFE4, 0x86F7, 0xDFE5, 0x870C, 0xDFE6, 0x86FA, 0xDFE7, 0x86D6, 0xDFE8, 0x86F5, 0xDFE9, 0x874D, + 0xDFEA, 0x86F8, 0xDFEB, 0x870E, 0xDFEC, 0x8709, 0xDFED, 0x8701, 0xDFEE, 0x86F6, 0xDFEF, 0x870D, 0xDFF0, 0x8705, 0xDFF1, 0x88D6, + 0xDFF2, 0x88CB, 0xDFF3, 0x88CD, 0xDFF4, 0x88CE, 0xDFF5, 0x88DE, 0xDFF6, 0x88DB, 0xDFF7, 0x88DA, 0xDFF8, 0x88CC, 0xDFF9, 0x88D0, + 0xDFFA, 0x8985, 0xDFFB, 0x899B, 0xDFFC, 0x89DF, 0xDFFD, 0x89E5, 0xDFFE, 0x89E4, 0xE040, 0x89E1, 0xE041, 0x89E0, 0xE042, 0x89E2, + 0xE043, 0x89DC, 0xE044, 0x89E6, 0xE045, 0x8A76, 0xE046, 0x8A86, 0xE047, 0x8A7F, 0xE048, 0x8A61, 0xE049, 0x8A3F, 0xE04A, 0x8A77, + 0xE04B, 0x8A82, 0xE04C, 0x8A84, 0xE04D, 0x8A75, 0xE04E, 0x8A83, 0xE04F, 0x8A81, 0xE050, 0x8A74, 0xE051, 0x8A7A, 0xE052, 0x8C3C, + 0xE053, 0x8C4B, 0xE054, 0x8C4A, 0xE055, 0x8C65, 0xE056, 0x8C64, 0xE057, 0x8C66, 0xE058, 0x8C86, 0xE059, 0x8C84, 0xE05A, 0x8C85, + 0xE05B, 0x8CCC, 0xE05C, 0x8D68, 0xE05D, 0x8D69, 0xE05E, 0x8D91, 0xE05F, 0x8D8C, 0xE060, 0x8D8E, 0xE061, 0x8D8F, 0xE062, 0x8D8D, + 0xE063, 0x8D93, 0xE064, 0x8D94, 0xE065, 0x8D90, 0xE066, 0x8D92, 0xE067, 0x8DF0, 0xE068, 0x8DE0, 0xE069, 0x8DEC, 0xE06A, 0x8DF1, + 0xE06B, 0x8DEE, 0xE06C, 0x8DD0, 0xE06D, 0x8DE9, 0xE06E, 0x8DE3, 0xE06F, 0x8DE2, 0xE070, 0x8DE7, 0xE071, 0x8DF2, 0xE072, 0x8DEB, + 0xE073, 0x8DF4, 0xE074, 0x8F06, 0xE075, 0x8EFF, 0xE076, 0x8F01, 0xE077, 0x8F00, 0xE078, 0x8F05, 0xE079, 0x8F07, 0xE07A, 0x8F08, + 0xE07B, 0x8F02, 0xE07C, 0x8F0B, 0xE07D, 0x9052, 0xE07E, 0x903F, 0xE0A1, 0x9044, 0xE0A2, 0x9049, 0xE0A3, 0x903D, 0xE0A4, 0x9110, + 0xE0A5, 0x910D, 0xE0A6, 0x910F, 0xE0A7, 0x9111, 0xE0A8, 0x9116, 0xE0A9, 0x9114, 0xE0AA, 0x910B, 0xE0AB, 0x910E, 0xE0AC, 0x916E, + 0xE0AD, 0x916F, 0xE0AE, 0x9248, 0xE0AF, 0x9252, 0xE0B0, 0x9230, 0xE0B1, 0x923A, 0xE0B2, 0x9266, 0xE0B3, 0x9233, 0xE0B4, 0x9265, + 0xE0B5, 0x925E, 0xE0B6, 0x9283, 0xE0B7, 0x922E, 0xE0B8, 0x924A, 0xE0B9, 0x9246, 0xE0BA, 0x926D, 0xE0BB, 0x926C, 0xE0BC, 0x924F, + 0xE0BD, 0x9260, 0xE0BE, 0x9267, 0xE0BF, 0x926F, 0xE0C0, 0x9236, 0xE0C1, 0x9261, 0xE0C2, 0x9270, 0xE0C3, 0x9231, 0xE0C4, 0x9254, + 0xE0C5, 0x9263, 0xE0C6, 0x9250, 0xE0C7, 0x9272, 0xE0C8, 0x924E, 0xE0C9, 0x9253, 0xE0CA, 0x924C, 0xE0CB, 0x9256, 0xE0CC, 0x9232, + 0xE0CD, 0x959F, 0xE0CE, 0x959C, 0xE0CF, 0x959E, 0xE0D0, 0x959B, 0xE0D1, 0x9692, 0xE0D2, 0x9693, 0xE0D3, 0x9691, 0xE0D4, 0x9697, + 0xE0D5, 0x96CE, 0xE0D6, 0x96FA, 0xE0D7, 0x96FD, 0xE0D8, 0x96F8, 0xE0D9, 0x96F5, 0xE0DA, 0x9773, 0xE0DB, 0x9777, 0xE0DC, 0x9778, + 0xE0DD, 0x9772, 0xE0DE, 0x980F, 0xE0DF, 0x980D, 0xE0E0, 0x980E, 0xE0E1, 0x98AC, 0xE0E2, 0x98F6, 0xE0E3, 0x98F9, 0xE0E4, 0x99AF, + 0xE0E5, 0x99B2, 0xE0E6, 0x99B0, 0xE0E7, 0x99B5, 0xE0E8, 0x9AAD, 0xE0E9, 0x9AAB, 0xE0EA, 0x9B5B, 0xE0EB, 0x9CEA, 0xE0EC, 0x9CED, + 0xE0ED, 0x9CE7, 0xE0EE, 0x9E80, 0xE0EF, 0x9EFD, 0xE0F0, 0x50E6, 0xE0F1, 0x50D4, 0xE0F2, 0x50D7, 0xE0F3, 0x50E8, 0xE0F4, 0x50F3, + 0xE0F5, 0x50DB, 0xE0F6, 0x50EA, 0xE0F7, 0x50DD, 0xE0F8, 0x50E4, 0xE0F9, 0x50D3, 0xE0FA, 0x50EC, 0xE0FB, 0x50F0, 0xE0FC, 0x50EF, + 0xE0FD, 0x50E3, 0xE0FE, 0x50E0, 0xE140, 0x51D8, 0xE141, 0x5280, 0xE142, 0x5281, 0xE143, 0x52E9, 0xE144, 0x52EB, 0xE145, 0x5330, + 0xE146, 0x53AC, 0xE147, 0x5627, 0xE148, 0x5615, 0xE149, 0x560C, 0xE14A, 0x5612, 0xE14B, 0x55FC, 0xE14C, 0x560F, 0xE14D, 0x561C, + 0xE14E, 0x5601, 0xE14F, 0x5613, 0xE150, 0x5602, 0xE151, 0x55FA, 0xE152, 0x561D, 0xE153, 0x5604, 0xE154, 0x55FF, 0xE155, 0x55F9, + 0xE156, 0x5889, 0xE157, 0x587C, 0xE158, 0x5890, 0xE159, 0x5898, 0xE15A, 0x5886, 0xE15B, 0x5881, 0xE15C, 0x587F, 0xE15D, 0x5874, + 0xE15E, 0x588B, 0xE15F, 0x587A, 0xE160, 0x5887, 0xE161, 0x5891, 0xE162, 0x588E, 0xE163, 0x5876, 0xE164, 0x5882, 0xE165, 0x5888, + 0xE166, 0x587B, 0xE167, 0x5894, 0xE168, 0x588F, 0xE169, 0x58FE, 0xE16A, 0x596B, 0xE16B, 0x5ADC, 0xE16C, 0x5AEE, 0xE16D, 0x5AE5, + 0xE16E, 0x5AD5, 0xE16F, 0x5AEA, 0xE170, 0x5ADA, 0xE171, 0x5AED, 0xE172, 0x5AEB, 0xE173, 0x5AF3, 0xE174, 0x5AE2, 0xE175, 0x5AE0, + 0xE176, 0x5ADB, 0xE177, 0x5AEC, 0xE178, 0x5ADE, 0xE179, 0x5ADD, 0xE17A, 0x5AD9, 0xE17B, 0x5AE8, 0xE17C, 0x5ADF, 0xE17D, 0x5B77, + 0xE17E, 0x5BE0, 0xE1A1, 0x5BE3, 0xE1A2, 0x5C63, 0xE1A3, 0x5D82, 0xE1A4, 0x5D80, 0xE1A5, 0x5D7D, 0xE1A6, 0x5D86, 0xE1A7, 0x5D7A, + 0xE1A8, 0x5D81, 0xE1A9, 0x5D77, 0xE1AA, 0x5D8A, 0xE1AB, 0x5D89, 0xE1AC, 0x5D88, 0xE1AD, 0x5D7E, 0xE1AE, 0x5D7C, 0xE1AF, 0x5D8D, + 0xE1B0, 0x5D79, 0xE1B1, 0x5D7F, 0xE1B2, 0x5E58, 0xE1B3, 0x5E59, 0xE1B4, 0x5E53, 0xE1B5, 0x5ED8, 0xE1B6, 0x5ED1, 0xE1B7, 0x5ED7, + 0xE1B8, 0x5ECE, 0xE1B9, 0x5EDC, 0xE1BA, 0x5ED5, 0xE1BB, 0x5ED9, 0xE1BC, 0x5ED2, 0xE1BD, 0x5ED4, 0xE1BE, 0x5F44, 0xE1BF, 0x5F43, + 0xE1C0, 0x5F6F, 0xE1C1, 0x5FB6, 0xE1C2, 0x612C, 0xE1C3, 0x6128, 0xE1C4, 0x6141, 0xE1C5, 0x615E, 0xE1C6, 0x6171, 0xE1C7, 0x6173, + 0xE1C8, 0x6152, 0xE1C9, 0x6153, 0xE1CA, 0x6172, 0xE1CB, 0x616C, 0xE1CC, 0x6180, 0xE1CD, 0x6174, 0xE1CE, 0x6154, 0xE1CF, 0x617A, + 0xE1D0, 0x615B, 0xE1D1, 0x6165, 0xE1D2, 0x613B, 0xE1D3, 0x616A, 0xE1D4, 0x6161, 0xE1D5, 0x6156, 0xE1D6, 0x6229, 0xE1D7, 0x6227, + 0xE1D8, 0x622B, 0xE1D9, 0x642B, 0xE1DA, 0x644D, 0xE1DB, 0x645B, 0xE1DC, 0x645D, 0xE1DD, 0x6474, 0xE1DE, 0x6476, 0xE1DF, 0x6472, + 0xE1E0, 0x6473, 0xE1E1, 0x647D, 0xE1E2, 0x6475, 0xE1E3, 0x6466, 0xE1E4, 0x64A6, 0xE1E5, 0x644E, 0xE1E6, 0x6482, 0xE1E7, 0x645E, + 0xE1E8, 0x645C, 0xE1E9, 0x644B, 0xE1EA, 0x6453, 0xE1EB, 0x6460, 0xE1EC, 0x6450, 0xE1ED, 0x647F, 0xE1EE, 0x643F, 0xE1EF, 0x646C, + 0xE1F0, 0x646B, 0xE1F1, 0x6459, 0xE1F2, 0x6465, 0xE1F3, 0x6477, 0xE1F4, 0x6573, 0xE1F5, 0x65A0, 0xE1F6, 0x66A1, 0xE1F7, 0x66A0, + 0xE1F8, 0x669F, 0xE1F9, 0x6705, 0xE1FA, 0x6704, 0xE1FB, 0x6722, 0xE1FC, 0x69B1, 0xE1FD, 0x69B6, 0xE1FE, 0x69C9, 0xE240, 0x69A0, + 0xE241, 0x69CE, 0xE242, 0x6996, 0xE243, 0x69B0, 0xE244, 0x69AC, 0xE245, 0x69BC, 0xE246, 0x6991, 0xE247, 0x6999, 0xE248, 0x698E, + 0xE249, 0x69A7, 0xE24A, 0x698D, 0xE24B, 0x69A9, 0xE24C, 0x69BE, 0xE24D, 0x69AF, 0xE24E, 0x69BF, 0xE24F, 0x69C4, 0xE250, 0x69BD, + 0xE251, 0x69A4, 0xE252, 0x69D4, 0xE253, 0x69B9, 0xE254, 0x69CA, 0xE255, 0x699A, 0xE256, 0x69CF, 0xE257, 0x69B3, 0xE258, 0x6993, + 0xE259, 0x69AA, 0xE25A, 0x69A1, 0xE25B, 0x699E, 0xE25C, 0x69D9, 0xE25D, 0x6997, 0xE25E, 0x6990, 0xE25F, 0x69C2, 0xE260, 0x69B5, + 0xE261, 0x69A5, 0xE262, 0x69C6, 0xE263, 0x6B4A, 0xE264, 0x6B4D, 0xE265, 0x6B4B, 0xE266, 0x6B9E, 0xE267, 0x6B9F, 0xE268, 0x6BA0, + 0xE269, 0x6BC3, 0xE26A, 0x6BC4, 0xE26B, 0x6BFE, 0xE26C, 0x6ECE, 0xE26D, 0x6EF5, 0xE26E, 0x6EF1, 0xE26F, 0x6F03, 0xE270, 0x6F25, + 0xE271, 0x6EF8, 0xE272, 0x6F37, 0xE273, 0x6EFB, 0xE274, 0x6F2E, 0xE275, 0x6F09, 0xE276, 0x6F4E, 0xE277, 0x6F19, 0xE278, 0x6F1A, + 0xE279, 0x6F27, 0xE27A, 0x6F18, 0xE27B, 0x6F3B, 0xE27C, 0x6F12, 0xE27D, 0x6EED, 0xE27E, 0x6F0A, 0xE2A1, 0x6F36, 0xE2A2, 0x6F73, + 0xE2A3, 0x6EF9, 0xE2A4, 0x6EEE, 0xE2A5, 0x6F2D, 0xE2A6, 0x6F40, 0xE2A7, 0x6F30, 0xE2A8, 0x6F3C, 0xE2A9, 0x6F35, 0xE2AA, 0x6EEB, + 0xE2AB, 0x6F07, 0xE2AC, 0x6F0E, 0xE2AD, 0x6F43, 0xE2AE, 0x6F05, 0xE2AF, 0x6EFD, 0xE2B0, 0x6EF6, 0xE2B1, 0x6F39, 0xE2B2, 0x6F1C, + 0xE2B3, 0x6EFC, 0xE2B4, 0x6F3A, 0xE2B5, 0x6F1F, 0xE2B6, 0x6F0D, 0xE2B7, 0x6F1E, 0xE2B8, 0x6F08, 0xE2B9, 0x6F21, 0xE2BA, 0x7187, + 0xE2BB, 0x7190, 0xE2BC, 0x7189, 0xE2BD, 0x7180, 0xE2BE, 0x7185, 0xE2BF, 0x7182, 0xE2C0, 0x718F, 0xE2C1, 0x717B, 0xE2C2, 0x7186, + 0xE2C3, 0x7181, 0xE2C4, 0x7197, 0xE2C5, 0x7244, 0xE2C6, 0x7253, 0xE2C7, 0x7297, 0xE2C8, 0x7295, 0xE2C9, 0x7293, 0xE2CA, 0x7343, + 0xE2CB, 0x734D, 0xE2CC, 0x7351, 0xE2CD, 0x734C, 0xE2CE, 0x7462, 0xE2CF, 0x7473, 0xE2D0, 0x7471, 0xE2D1, 0x7475, 0xE2D2, 0x7472, + 0xE2D3, 0x7467, 0xE2D4, 0x746E, 0xE2D5, 0x7500, 0xE2D6, 0x7502, 0xE2D7, 0x7503, 0xE2D8, 0x757D, 0xE2D9, 0x7590, 0xE2DA, 0x7616, + 0xE2DB, 0x7608, 0xE2DC, 0x760C, 0xE2DD, 0x7615, 0xE2DE, 0x7611, 0xE2DF, 0x760A, 0xE2E0, 0x7614, 0xE2E1, 0x76B8, 0xE2E2, 0x7781, + 0xE2E3, 0x777C, 0xE2E4, 0x7785, 0xE2E5, 0x7782, 0xE2E6, 0x776E, 0xE2E7, 0x7780, 0xE2E8, 0x776F, 0xE2E9, 0x777E, 0xE2EA, 0x7783, + 0xE2EB, 0x78B2, 0xE2EC, 0x78AA, 0xE2ED, 0x78B4, 0xE2EE, 0x78AD, 0xE2EF, 0x78A8, 0xE2F0, 0x787E, 0xE2F1, 0x78AB, 0xE2F2, 0x789E, + 0xE2F3, 0x78A5, 0xE2F4, 0x78A0, 0xE2F5, 0x78AC, 0xE2F6, 0x78A2, 0xE2F7, 0x78A4, 0xE2F8, 0x7998, 0xE2F9, 0x798A, 0xE2FA, 0x798B, + 0xE2FB, 0x7996, 0xE2FC, 0x7995, 0xE2FD, 0x7994, 0xE2FE, 0x7993, 0xE340, 0x7997, 0xE341, 0x7988, 0xE342, 0x7992, 0xE343, 0x7990, + 0xE344, 0x7A2B, 0xE345, 0x7A4A, 0xE346, 0x7A30, 0xE347, 0x7A2F, 0xE348, 0x7A28, 0xE349, 0x7A26, 0xE34A, 0x7AA8, 0xE34B, 0x7AAB, + 0xE34C, 0x7AAC, 0xE34D, 0x7AEE, 0xE34E, 0x7B88, 0xE34F, 0x7B9C, 0xE350, 0x7B8A, 0xE351, 0x7B91, 0xE352, 0x7B90, 0xE353, 0x7B96, + 0xE354, 0x7B8D, 0xE355, 0x7B8C, 0xE356, 0x7B9B, 0xE357, 0x7B8E, 0xE358, 0x7B85, 0xE359, 0x7B98, 0xE35A, 0x5284, 0xE35B, 0x7B99, + 0xE35C, 0x7BA4, 0xE35D, 0x7B82, 0xE35E, 0x7CBB, 0xE35F, 0x7CBF, 0xE360, 0x7CBC, 0xE361, 0x7CBA, 0xE362, 0x7DA7, 0xE363, 0x7DB7, + 0xE364, 0x7DC2, 0xE365, 0x7DA3, 0xE366, 0x7DAA, 0xE367, 0x7DC1, 0xE368, 0x7DC0, 0xE369, 0x7DC5, 0xE36A, 0x7D9D, 0xE36B, 0x7DCE, + 0xE36C, 0x7DC4, 0xE36D, 0x7DC6, 0xE36E, 0x7DCB, 0xE36F, 0x7DCC, 0xE370, 0x7DAF, 0xE371, 0x7DB9, 0xE372, 0x7D96, 0xE373, 0x7DBC, + 0xE374, 0x7D9F, 0xE375, 0x7DA6, 0xE376, 0x7DAE, 0xE377, 0x7DA9, 0xE378, 0x7DA1, 0xE379, 0x7DC9, 0xE37A, 0x7F73, 0xE37B, 0x7FE2, + 0xE37C, 0x7FE3, 0xE37D, 0x7FE5, 0xE37E, 0x7FDE, 0xE3A1, 0x8024, 0xE3A2, 0x805D, 0xE3A3, 0x805C, 0xE3A4, 0x8189, 0xE3A5, 0x8186, + 0xE3A6, 0x8183, 0xE3A7, 0x8187, 0xE3A8, 0x818D, 0xE3A9, 0x818C, 0xE3AA, 0x818B, 0xE3AB, 0x8215, 0xE3AC, 0x8497, 0xE3AD, 0x84A4, + 0xE3AE, 0x84A1, 0xE3AF, 0x849F, 0xE3B0, 0x84BA, 0xE3B1, 0x84CE, 0xE3B2, 0x84C2, 0xE3B3, 0x84AC, 0xE3B4, 0x84AE, 0xE3B5, 0x84AB, + 0xE3B6, 0x84B9, 0xE3B7, 0x84B4, 0xE3B8, 0x84C1, 0xE3B9, 0x84CD, 0xE3BA, 0x84AA, 0xE3BB, 0x849A, 0xE3BC, 0x84B1, 0xE3BD, 0x84D0, + 0xE3BE, 0x849D, 0xE3BF, 0x84A7, 0xE3C0, 0x84BB, 0xE3C1, 0x84A2, 0xE3C2, 0x8494, 0xE3C3, 0x84C7, 0xE3C4, 0x84CC, 0xE3C5, 0x849B, + 0xE3C6, 0x84A9, 0xE3C7, 0x84AF, 0xE3C8, 0x84A8, 0xE3C9, 0x84D6, 0xE3CA, 0x8498, 0xE3CB, 0x84B6, 0xE3CC, 0x84CF, 0xE3CD, 0x84A0, + 0xE3CE, 0x84D7, 0xE3CF, 0x84D4, 0xE3D0, 0x84D2, 0xE3D1, 0x84DB, 0xE3D2, 0x84B0, 0xE3D3, 0x8491, 0xE3D4, 0x8661, 0xE3D5, 0x8733, + 0xE3D6, 0x8723, 0xE3D7, 0x8728, 0xE3D8, 0x876B, 0xE3D9, 0x8740, 0xE3DA, 0x872E, 0xE3DB, 0x871E, 0xE3DC, 0x8721, 0xE3DD, 0x8719, + 0xE3DE, 0x871B, 0xE3DF, 0x8743, 0xE3E0, 0x872C, 0xE3E1, 0x8741, 0xE3E2, 0x873E, 0xE3E3, 0x8746, 0xE3E4, 0x8720, 0xE3E5, 0x8732, + 0xE3E6, 0x872A, 0xE3E7, 0x872D, 0xE3E8, 0x873C, 0xE3E9, 0x8712, 0xE3EA, 0x873A, 0xE3EB, 0x8731, 0xE3EC, 0x8735, 0xE3ED, 0x8742, + 0xE3EE, 0x8726, 0xE3EF, 0x8727, 0xE3F0, 0x8738, 0xE3F1, 0x8724, 0xE3F2, 0x871A, 0xE3F3, 0x8730, 0xE3F4, 0x8711, 0xE3F5, 0x88F7, + 0xE3F6, 0x88E7, 0xE3F7, 0x88F1, 0xE3F8, 0x88F2, 0xE3F9, 0x88FA, 0xE3FA, 0x88FE, 0xE3FB, 0x88EE, 0xE3FC, 0x88FC, 0xE3FD, 0x88F6, + 0xE3FE, 0x88FB, 0xE440, 0x88F0, 0xE441, 0x88EC, 0xE442, 0x88EB, 0xE443, 0x899D, 0xE444, 0x89A1, 0xE445, 0x899F, 0xE446, 0x899E, + 0xE447, 0x89E9, 0xE448, 0x89EB, 0xE449, 0x89E8, 0xE44A, 0x8AAB, 0xE44B, 0x8A99, 0xE44C, 0x8A8B, 0xE44D, 0x8A92, 0xE44E, 0x8A8F, + 0xE44F, 0x8A96, 0xE450, 0x8C3D, 0xE451, 0x8C68, 0xE452, 0x8C69, 0xE453, 0x8CD5, 0xE454, 0x8CCF, 0xE455, 0x8CD7, 0xE456, 0x8D96, + 0xE457, 0x8E09, 0xE458, 0x8E02, 0xE459, 0x8DFF, 0xE45A, 0x8E0D, 0xE45B, 0x8DFD, 0xE45C, 0x8E0A, 0xE45D, 0x8E03, 0xE45E, 0x8E07, + 0xE45F, 0x8E06, 0xE460, 0x8E05, 0xE461, 0x8DFE, 0xE462, 0x8E00, 0xE463, 0x8E04, 0xE464, 0x8F10, 0xE465, 0x8F11, 0xE466, 0x8F0E, + 0xE467, 0x8F0D, 0xE468, 0x9123, 0xE469, 0x911C, 0xE46A, 0x9120, 0xE46B, 0x9122, 0xE46C, 0x911F, 0xE46D, 0x911D, 0xE46E, 0x911A, + 0xE46F, 0x9124, 0xE470, 0x9121, 0xE471, 0x911B, 0xE472, 0x917A, 0xE473, 0x9172, 0xE474, 0x9179, 0xE475, 0x9173, 0xE476, 0x92A5, + 0xE477, 0x92A4, 0xE478, 0x9276, 0xE479, 0x929B, 0xE47A, 0x927A, 0xE47B, 0x92A0, 0xE47C, 0x9294, 0xE47D, 0x92AA, 0xE47E, 0x928D, + 0xE4A1, 0x92A6, 0xE4A2, 0x929A, 0xE4A3, 0x92AB, 0xE4A4, 0x9279, 0xE4A5, 0x9297, 0xE4A6, 0x927F, 0xE4A7, 0x92A3, 0xE4A8, 0x92EE, + 0xE4A9, 0x928E, 0xE4AA, 0x9282, 0xE4AB, 0x9295, 0xE4AC, 0x92A2, 0xE4AD, 0x927D, 0xE4AE, 0x9288, 0xE4AF, 0x92A1, 0xE4B0, 0x928A, + 0xE4B1, 0x9286, 0xE4B2, 0x928C, 0xE4B3, 0x9299, 0xE4B4, 0x92A7, 0xE4B5, 0x927E, 0xE4B6, 0x9287, 0xE4B7, 0x92A9, 0xE4B8, 0x929D, + 0xE4B9, 0x928B, 0xE4BA, 0x922D, 0xE4BB, 0x969E, 0xE4BC, 0x96A1, 0xE4BD, 0x96FF, 0xE4BE, 0x9758, 0xE4BF, 0x977D, 0xE4C0, 0x977A, + 0xE4C1, 0x977E, 0xE4C2, 0x9783, 0xE4C3, 0x9780, 0xE4C4, 0x9782, 0xE4C5, 0x977B, 0xE4C6, 0x9784, 0xE4C7, 0x9781, 0xE4C8, 0x977F, + 0xE4C9, 0x97CE, 0xE4CA, 0x97CD, 0xE4CB, 0x9816, 0xE4CC, 0x98AD, 0xE4CD, 0x98AE, 0xE4CE, 0x9902, 0xE4CF, 0x9900, 0xE4D0, 0x9907, + 0xE4D1, 0x999D, 0xE4D2, 0x999C, 0xE4D3, 0x99C3, 0xE4D4, 0x99B9, 0xE4D5, 0x99BB, 0xE4D6, 0x99BA, 0xE4D7, 0x99C2, 0xE4D8, 0x99BD, + 0xE4D9, 0x99C7, 0xE4DA, 0x9AB1, 0xE4DB, 0x9AE3, 0xE4DC, 0x9AE7, 0xE4DD, 0x9B3E, 0xE4DE, 0x9B3F, 0xE4DF, 0x9B60, 0xE4E0, 0x9B61, + 0xE4E1, 0x9B5F, 0xE4E2, 0x9CF1, 0xE4E3, 0x9CF2, 0xE4E4, 0x9CF5, 0xE4E5, 0x9EA7, 0xE4E6, 0x50FF, 0xE4E7, 0x5103, 0xE4E8, 0x5130, + 0xE4E9, 0x50F8, 0xE4EA, 0x5106, 0xE4EB, 0x5107, 0xE4EC, 0x50F6, 0xE4ED, 0x50FE, 0xE4EE, 0x510B, 0xE4EF, 0x510C, 0xE4F0, 0x50FD, + 0xE4F1, 0x510A, 0xE4F2, 0x528B, 0xE4F3, 0x528C, 0xE4F4, 0x52F1, 0xE4F5, 0x52EF, 0xE4F6, 0x5648, 0xE4F7, 0x5642, 0xE4F8, 0x564C, + 0xE4F9, 0x5635, 0xE4FA, 0x5641, 0xE4FB, 0x564A, 0xE4FC, 0x5649, 0xE4FD, 0x5646, 0xE4FE, 0x5658, 0xE540, 0x565A, 0xE541, 0x5640, + 0xE542, 0x5633, 0xE543, 0x563D, 0xE544, 0x562C, 0xE545, 0x563E, 0xE546, 0x5638, 0xE547, 0x562A, 0xE548, 0x563A, 0xE549, 0x571A, + 0xE54A, 0x58AB, 0xE54B, 0x589D, 0xE54C, 0x58B1, 0xE54D, 0x58A0, 0xE54E, 0x58A3, 0xE54F, 0x58AF, 0xE550, 0x58AC, 0xE551, 0x58A5, + 0xE552, 0x58A1, 0xE553, 0x58FF, 0xE554, 0x5AFF, 0xE555, 0x5AF4, 0xE556, 0x5AFD, 0xE557, 0x5AF7, 0xE558, 0x5AF6, 0xE559, 0x5B03, + 0xE55A, 0x5AF8, 0xE55B, 0x5B02, 0xE55C, 0x5AF9, 0xE55D, 0x5B01, 0xE55E, 0x5B07, 0xE55F, 0x5B05, 0xE560, 0x5B0F, 0xE561, 0x5C67, + 0xE562, 0x5D99, 0xE563, 0x5D97, 0xE564, 0x5D9F, 0xE565, 0x5D92, 0xE566, 0x5DA2, 0xE567, 0x5D93, 0xE568, 0x5D95, 0xE569, 0x5DA0, + 0xE56A, 0x5D9C, 0xE56B, 0x5DA1, 0xE56C, 0x5D9A, 0xE56D, 0x5D9E, 0xE56E, 0x5E69, 0xE56F, 0x5E5D, 0xE570, 0x5E60, 0xE571, 0x5E5C, + 0xE572, 0x7DF3, 0xE573, 0x5EDB, 0xE574, 0x5EDE, 0xE575, 0x5EE1, 0xE576, 0x5F49, 0xE577, 0x5FB2, 0xE578, 0x618B, 0xE579, 0x6183, + 0xE57A, 0x6179, 0xE57B, 0x61B1, 0xE57C, 0x61B0, 0xE57D, 0x61A2, 0xE57E, 0x6189, 0xE5A1, 0x619B, 0xE5A2, 0x6193, 0xE5A3, 0x61AF, + 0xE5A4, 0x61AD, 0xE5A5, 0x619F, 0xE5A6, 0x6192, 0xE5A7, 0x61AA, 0xE5A8, 0x61A1, 0xE5A9, 0x618D, 0xE5AA, 0x6166, 0xE5AB, 0x61B3, + 0xE5AC, 0x622D, 0xE5AD, 0x646E, 0xE5AE, 0x6470, 0xE5AF, 0x6496, 0xE5B0, 0x64A0, 0xE5B1, 0x6485, 0xE5B2, 0x6497, 0xE5B3, 0x649C, + 0xE5B4, 0x648F, 0xE5B5, 0x648B, 0xE5B6, 0x648A, 0xE5B7, 0x648C, 0xE5B8, 0x64A3, 0xE5B9, 0x649F, 0xE5BA, 0x6468, 0xE5BB, 0x64B1, + 0xE5BC, 0x6498, 0xE5BD, 0x6576, 0xE5BE, 0x657A, 0xE5BF, 0x6579, 0xE5C0, 0x657B, 0xE5C1, 0x65B2, 0xE5C2, 0x65B3, 0xE5C3, 0x66B5, + 0xE5C4, 0x66B0, 0xE5C5, 0x66A9, 0xE5C6, 0x66B2, 0xE5C7, 0x66B7, 0xE5C8, 0x66AA, 0xE5C9, 0x66AF, 0xE5CA, 0x6A00, 0xE5CB, 0x6A06, + 0xE5CC, 0x6A17, 0xE5CD, 0x69E5, 0xE5CE, 0x69F8, 0xE5CF, 0x6A15, 0xE5D0, 0x69F1, 0xE5D1, 0x69E4, 0xE5D2, 0x6A20, 0xE5D3, 0x69FF, + 0xE5D4, 0x69EC, 0xE5D5, 0x69E2, 0xE5D6, 0x6A1B, 0xE5D7, 0x6A1D, 0xE5D8, 0x69FE, 0xE5D9, 0x6A27, 0xE5DA, 0x69F2, 0xE5DB, 0x69EE, + 0xE5DC, 0x6A14, 0xE5DD, 0x69F7, 0xE5DE, 0x69E7, 0xE5DF, 0x6A40, 0xE5E0, 0x6A08, 0xE5E1, 0x69E6, 0xE5E2, 0x69FB, 0xE5E3, 0x6A0D, + 0xE5E4, 0x69FC, 0xE5E5, 0x69EB, 0xE5E6, 0x6A09, 0xE5E7, 0x6A04, 0xE5E8, 0x6A18, 0xE5E9, 0x6A25, 0xE5EA, 0x6A0F, 0xE5EB, 0x69F6, + 0xE5EC, 0x6A26, 0xE5ED, 0x6A07, 0xE5EE, 0x69F4, 0xE5EF, 0x6A16, 0xE5F0, 0x6B51, 0xE5F1, 0x6BA5, 0xE5F2, 0x6BA3, 0xE5F3, 0x6BA2, + 0xE5F4, 0x6BA6, 0xE5F5, 0x6C01, 0xE5F6, 0x6C00, 0xE5F7, 0x6BFF, 0xE5F8, 0x6C02, 0xE5F9, 0x6F41, 0xE5FA, 0x6F26, 0xE5FB, 0x6F7E, + 0xE5FC, 0x6F87, 0xE5FD, 0x6FC6, 0xE5FE, 0x6F92, 0xE640, 0x6F8D, 0xE641, 0x6F89, 0xE642, 0x6F8C, 0xE643, 0x6F62, 0xE644, 0x6F4F, + 0xE645, 0x6F85, 0xE646, 0x6F5A, 0xE647, 0x6F96, 0xE648, 0x6F76, 0xE649, 0x6F6C, 0xE64A, 0x6F82, 0xE64B, 0x6F55, 0xE64C, 0x6F72, + 0xE64D, 0x6F52, 0xE64E, 0x6F50, 0xE64F, 0x6F57, 0xE650, 0x6F94, 0xE651, 0x6F93, 0xE652, 0x6F5D, 0xE653, 0x6F00, 0xE654, 0x6F61, + 0xE655, 0x6F6B, 0xE656, 0x6F7D, 0xE657, 0x6F67, 0xE658, 0x6F90, 0xE659, 0x6F53, 0xE65A, 0x6F8B, 0xE65B, 0x6F69, 0xE65C, 0x6F7F, + 0xE65D, 0x6F95, 0xE65E, 0x6F63, 0xE65F, 0x6F77, 0xE660, 0x6F6A, 0xE661, 0x6F7B, 0xE662, 0x71B2, 0xE663, 0x71AF, 0xE664, 0x719B, + 0xE665, 0x71B0, 0xE666, 0x71A0, 0xE667, 0x719A, 0xE668, 0x71A9, 0xE669, 0x71B5, 0xE66A, 0x719D, 0xE66B, 0x71A5, 0xE66C, 0x719E, + 0xE66D, 0x71A4, 0xE66E, 0x71A1, 0xE66F, 0x71AA, 0xE670, 0x719C, 0xE671, 0x71A7, 0xE672, 0x71B3, 0xE673, 0x7298, 0xE674, 0x729A, + 0xE675, 0x7358, 0xE676, 0x7352, 0xE677, 0x735E, 0xE678, 0x735F, 0xE679, 0x7360, 0xE67A, 0x735D, 0xE67B, 0x735B, 0xE67C, 0x7361, + 0xE67D, 0x735A, 0xE67E, 0x7359, 0xE6A1, 0x7362, 0xE6A2, 0x7487, 0xE6A3, 0x7489, 0xE6A4, 0x748A, 0xE6A5, 0x7486, 0xE6A6, 0x7481, + 0xE6A7, 0x747D, 0xE6A8, 0x7485, 0xE6A9, 0x7488, 0xE6AA, 0x747C, 0xE6AB, 0x7479, 0xE6AC, 0x7508, 0xE6AD, 0x7507, 0xE6AE, 0x757E, + 0xE6AF, 0x7625, 0xE6B0, 0x761E, 0xE6B1, 0x7619, 0xE6B2, 0x761D, 0xE6B3, 0x761C, 0xE6B4, 0x7623, 0xE6B5, 0x761A, 0xE6B6, 0x7628, + 0xE6B7, 0x761B, 0xE6B8, 0x769C, 0xE6B9, 0x769D, 0xE6BA, 0x769E, 0xE6BB, 0x769B, 0xE6BC, 0x778D, 0xE6BD, 0x778F, 0xE6BE, 0x7789, + 0xE6BF, 0x7788, 0xE6C0, 0x78CD, 0xE6C1, 0x78BB, 0xE6C2, 0x78CF, 0xE6C3, 0x78CC, 0xE6C4, 0x78D1, 0xE6C5, 0x78CE, 0xE6C6, 0x78D4, + 0xE6C7, 0x78C8, 0xE6C8, 0x78C3, 0xE6C9, 0x78C4, 0xE6CA, 0x78C9, 0xE6CB, 0x799A, 0xE6CC, 0x79A1, 0xE6CD, 0x79A0, 0xE6CE, 0x799C, + 0xE6CF, 0x79A2, 0xE6D0, 0x799B, 0xE6D1, 0x6B76, 0xE6D2, 0x7A39, 0xE6D3, 0x7AB2, 0xE6D4, 0x7AB4, 0xE6D5, 0x7AB3, 0xE6D6, 0x7BB7, + 0xE6D7, 0x7BCB, 0xE6D8, 0x7BBE, 0xE6D9, 0x7BAC, 0xE6DA, 0x7BCE, 0xE6DB, 0x7BAF, 0xE6DC, 0x7BB9, 0xE6DD, 0x7BCA, 0xE6DE, 0x7BB5, + 0xE6DF, 0x7CC5, 0xE6E0, 0x7CC8, 0xE6E1, 0x7CCC, 0xE6E2, 0x7CCB, 0xE6E3, 0x7DF7, 0xE6E4, 0x7DDB, 0xE6E5, 0x7DEA, 0xE6E6, 0x7DE7, + 0xE6E7, 0x7DD7, 0xE6E8, 0x7DE1, 0xE6E9, 0x7E03, 0xE6EA, 0x7DFA, 0xE6EB, 0x7DE6, 0xE6EC, 0x7DF6, 0xE6ED, 0x7DF1, 0xE6EE, 0x7DF0, + 0xE6EF, 0x7DEE, 0xE6F0, 0x7DDF, 0xE6F1, 0x7F76, 0xE6F2, 0x7FAC, 0xE6F3, 0x7FB0, 0xE6F4, 0x7FAD, 0xE6F5, 0x7FED, 0xE6F6, 0x7FEB, + 0xE6F7, 0x7FEA, 0xE6F8, 0x7FEC, 0xE6F9, 0x7FE6, 0xE6FA, 0x7FE8, 0xE6FB, 0x8064, 0xE6FC, 0x8067, 0xE6FD, 0x81A3, 0xE6FE, 0x819F, + 0xE740, 0x819E, 0xE741, 0x8195, 0xE742, 0x81A2, 0xE743, 0x8199, 0xE744, 0x8197, 0xE745, 0x8216, 0xE746, 0x824F, 0xE747, 0x8253, + 0xE748, 0x8252, 0xE749, 0x8250, 0xE74A, 0x824E, 0xE74B, 0x8251, 0xE74C, 0x8524, 0xE74D, 0x853B, 0xE74E, 0x850F, 0xE74F, 0x8500, + 0xE750, 0x8529, 0xE751, 0x850E, 0xE752, 0x8509, 0xE753, 0x850D, 0xE754, 0x851F, 0xE755, 0x850A, 0xE756, 0x8527, 0xE757, 0x851C, + 0xE758, 0x84FB, 0xE759, 0x852B, 0xE75A, 0x84FA, 0xE75B, 0x8508, 0xE75C, 0x850C, 0xE75D, 0x84F4, 0xE75E, 0x852A, 0xE75F, 0x84F2, + 0xE760, 0x8515, 0xE761, 0x84F7, 0xE762, 0x84EB, 0xE763, 0x84F3, 0xE764, 0x84FC, 0xE765, 0x8512, 0xE766, 0x84EA, 0xE767, 0x84E9, + 0xE768, 0x8516, 0xE769, 0x84FE, 0xE76A, 0x8528, 0xE76B, 0x851D, 0xE76C, 0x852E, 0xE76D, 0x8502, 0xE76E, 0x84FD, 0xE76F, 0x851E, + 0xE770, 0x84F6, 0xE771, 0x8531, 0xE772, 0x8526, 0xE773, 0x84E7, 0xE774, 0x84E8, 0xE775, 0x84F0, 0xE776, 0x84EF, 0xE777, 0x84F9, + 0xE778, 0x8518, 0xE779, 0x8520, 0xE77A, 0x8530, 0xE77B, 0x850B, 0xE77C, 0x8519, 0xE77D, 0x852F, 0xE77E, 0x8662, 0xE7A1, 0x8756, + 0xE7A2, 0x8763, 0xE7A3, 0x8764, 0xE7A4, 0x8777, 0xE7A5, 0x87E1, 0xE7A6, 0x8773, 0xE7A7, 0x8758, 0xE7A8, 0x8754, 0xE7A9, 0x875B, + 0xE7AA, 0x8752, 0xE7AB, 0x8761, 0xE7AC, 0x875A, 0xE7AD, 0x8751, 0xE7AE, 0x875E, 0xE7AF, 0x876D, 0xE7B0, 0x876A, 0xE7B1, 0x8750, + 0xE7B2, 0x874E, 0xE7B3, 0x875F, 0xE7B4, 0x875D, 0xE7B5, 0x876F, 0xE7B6, 0x876C, 0xE7B7, 0x877A, 0xE7B8, 0x876E, 0xE7B9, 0x875C, + 0xE7BA, 0x8765, 0xE7BB, 0x874F, 0xE7BC, 0x877B, 0xE7BD, 0x8775, 0xE7BE, 0x8762, 0xE7BF, 0x8767, 0xE7C0, 0x8769, 0xE7C1, 0x885A, + 0xE7C2, 0x8905, 0xE7C3, 0x890C, 0xE7C4, 0x8914, 0xE7C5, 0x890B, 0xE7C6, 0x8917, 0xE7C7, 0x8918, 0xE7C8, 0x8919, 0xE7C9, 0x8906, + 0xE7CA, 0x8916, 0xE7CB, 0x8911, 0xE7CC, 0x890E, 0xE7CD, 0x8909, 0xE7CE, 0x89A2, 0xE7CF, 0x89A4, 0xE7D0, 0x89A3, 0xE7D1, 0x89ED, + 0xE7D2, 0x89F0, 0xE7D3, 0x89EC, 0xE7D4, 0x8ACF, 0xE7D5, 0x8AC6, 0xE7D6, 0x8AB8, 0xE7D7, 0x8AD3, 0xE7D8, 0x8AD1, 0xE7D9, 0x8AD4, + 0xE7DA, 0x8AD5, 0xE7DB, 0x8ABB, 0xE7DC, 0x8AD7, 0xE7DD, 0x8ABE, 0xE7DE, 0x8AC0, 0xE7DF, 0x8AC5, 0xE7E0, 0x8AD8, 0xE7E1, 0x8AC3, + 0xE7E2, 0x8ABA, 0xE7E3, 0x8ABD, 0xE7E4, 0x8AD9, 0xE7E5, 0x8C3E, 0xE7E6, 0x8C4D, 0xE7E7, 0x8C8F, 0xE7E8, 0x8CE5, 0xE7E9, 0x8CDF, + 0xE7EA, 0x8CD9, 0xE7EB, 0x8CE8, 0xE7EC, 0x8CDA, 0xE7ED, 0x8CDD, 0xE7EE, 0x8CE7, 0xE7EF, 0x8DA0, 0xE7F0, 0x8D9C, 0xE7F1, 0x8DA1, + 0xE7F2, 0x8D9B, 0xE7F3, 0x8E20, 0xE7F4, 0x8E23, 0xE7F5, 0x8E25, 0xE7F6, 0x8E24, 0xE7F7, 0x8E2E, 0xE7F8, 0x8E15, 0xE7F9, 0x8E1B, + 0xE7FA, 0x8E16, 0xE7FB, 0x8E11, 0xE7FC, 0x8E19, 0xE7FD, 0x8E26, 0xE7FE, 0x8E27, 0xE840, 0x8E14, 0xE841, 0x8E12, 0xE842, 0x8E18, + 0xE843, 0x8E13, 0xE844, 0x8E1C, 0xE845, 0x8E17, 0xE846, 0x8E1A, 0xE847, 0x8F2C, 0xE848, 0x8F24, 0xE849, 0x8F18, 0xE84A, 0x8F1A, + 0xE84B, 0x8F20, 0xE84C, 0x8F23, 0xE84D, 0x8F16, 0xE84E, 0x8F17, 0xE84F, 0x9073, 0xE850, 0x9070, 0xE851, 0x906F, 0xE852, 0x9067, + 0xE853, 0x906B, 0xE854, 0x912F, 0xE855, 0x912B, 0xE856, 0x9129, 0xE857, 0x912A, 0xE858, 0x9132, 0xE859, 0x9126, 0xE85A, 0x912E, + 0xE85B, 0x9185, 0xE85C, 0x9186, 0xE85D, 0x918A, 0xE85E, 0x9181, 0xE85F, 0x9182, 0xE860, 0x9184, 0xE861, 0x9180, 0xE862, 0x92D0, + 0xE863, 0x92C3, 0xE864, 0x92C4, 0xE865, 0x92C0, 0xE866, 0x92D9, 0xE867, 0x92B6, 0xE868, 0x92CF, 0xE869, 0x92F1, 0xE86A, 0x92DF, + 0xE86B, 0x92D8, 0xE86C, 0x92E9, 0xE86D, 0x92D7, 0xE86E, 0x92DD, 0xE86F, 0x92CC, 0xE870, 0x92EF, 0xE871, 0x92C2, 0xE872, 0x92E8, + 0xE873, 0x92CA, 0xE874, 0x92C8, 0xE875, 0x92CE, 0xE876, 0x92E6, 0xE877, 0x92CD, 0xE878, 0x92D5, 0xE879, 0x92C9, 0xE87A, 0x92E0, + 0xE87B, 0x92DE, 0xE87C, 0x92E7, 0xE87D, 0x92D1, 0xE87E, 0x92D3, 0xE8A1, 0x92B5, 0xE8A2, 0x92E1, 0xE8A3, 0x92C6, 0xE8A4, 0x92B4, + 0xE8A5, 0x957C, 0xE8A6, 0x95AC, 0xE8A7, 0x95AB, 0xE8A8, 0x95AE, 0xE8A9, 0x95B0, 0xE8AA, 0x96A4, 0xE8AB, 0x96A2, 0xE8AC, 0x96D3, + 0xE8AD, 0x9705, 0xE8AE, 0x9708, 0xE8AF, 0x9702, 0xE8B0, 0x975A, 0xE8B1, 0x978A, 0xE8B2, 0x978E, 0xE8B3, 0x9788, 0xE8B4, 0x97D0, + 0xE8B5, 0x97CF, 0xE8B6, 0x981E, 0xE8B7, 0x981D, 0xE8B8, 0x9826, 0xE8B9, 0x9829, 0xE8BA, 0x9828, 0xE8BB, 0x9820, 0xE8BC, 0x981B, + 0xE8BD, 0x9827, 0xE8BE, 0x98B2, 0xE8BF, 0x9908, 0xE8C0, 0x98FA, 0xE8C1, 0x9911, 0xE8C2, 0x9914, 0xE8C3, 0x9916, 0xE8C4, 0x9917, + 0xE8C5, 0x9915, 0xE8C6, 0x99DC, 0xE8C7, 0x99CD, 0xE8C8, 0x99CF, 0xE8C9, 0x99D3, 0xE8CA, 0x99D4, 0xE8CB, 0x99CE, 0xE8CC, 0x99C9, + 0xE8CD, 0x99D6, 0xE8CE, 0x99D8, 0xE8CF, 0x99CB, 0xE8D0, 0x99D7, 0xE8D1, 0x99CC, 0xE8D2, 0x9AB3, 0xE8D3, 0x9AEC, 0xE8D4, 0x9AEB, + 0xE8D5, 0x9AF3, 0xE8D6, 0x9AF2, 0xE8D7, 0x9AF1, 0xE8D8, 0x9B46, 0xE8D9, 0x9B43, 0xE8DA, 0x9B67, 0xE8DB, 0x9B74, 0xE8DC, 0x9B71, + 0xE8DD, 0x9B66, 0xE8DE, 0x9B76, 0xE8DF, 0x9B75, 0xE8E0, 0x9B70, 0xE8E1, 0x9B68, 0xE8E2, 0x9B64, 0xE8E3, 0x9B6C, 0xE8E4, 0x9CFC, + 0xE8E5, 0x9CFA, 0xE8E6, 0x9CFD, 0xE8E7, 0x9CFF, 0xE8E8, 0x9CF7, 0xE8E9, 0x9D07, 0xE8EA, 0x9D00, 0xE8EB, 0x9CF9, 0xE8EC, 0x9CFB, + 0xE8ED, 0x9D08, 0xE8EE, 0x9D05, 0xE8EF, 0x9D04, 0xE8F0, 0x9E83, 0xE8F1, 0x9ED3, 0xE8F2, 0x9F0F, 0xE8F3, 0x9F10, 0xE8F4, 0x511C, + 0xE8F5, 0x5113, 0xE8F6, 0x5117, 0xE8F7, 0x511A, 0xE8F8, 0x5111, 0xE8F9, 0x51DE, 0xE8FA, 0x5334, 0xE8FB, 0x53E1, 0xE8FC, 0x5670, + 0xE8FD, 0x5660, 0xE8FE, 0x566E, 0xE940, 0x5673, 0xE941, 0x5666, 0xE942, 0x5663, 0xE943, 0x566D, 0xE944, 0x5672, 0xE945, 0x565E, + 0xE946, 0x5677, 0xE947, 0x571C, 0xE948, 0x571B, 0xE949, 0x58C8, 0xE94A, 0x58BD, 0xE94B, 0x58C9, 0xE94C, 0x58BF, 0xE94D, 0x58BA, + 0xE94E, 0x58C2, 0xE94F, 0x58BC, 0xE950, 0x58C6, 0xE951, 0x5B17, 0xE952, 0x5B19, 0xE953, 0x5B1B, 0xE954, 0x5B21, 0xE955, 0x5B14, + 0xE956, 0x5B13, 0xE957, 0x5B10, 0xE958, 0x5B16, 0xE959, 0x5B28, 0xE95A, 0x5B1A, 0xE95B, 0x5B20, 0xE95C, 0x5B1E, 0xE95D, 0x5BEF, + 0xE95E, 0x5DAC, 0xE95F, 0x5DB1, 0xE960, 0x5DA9, 0xE961, 0x5DA7, 0xE962, 0x5DB5, 0xE963, 0x5DB0, 0xE964, 0x5DAE, 0xE965, 0x5DAA, + 0xE966, 0x5DA8, 0xE967, 0x5DB2, 0xE968, 0x5DAD, 0xE969, 0x5DAF, 0xE96A, 0x5DB4, 0xE96B, 0x5E67, 0xE96C, 0x5E68, 0xE96D, 0x5E66, + 0xE96E, 0x5E6F, 0xE96F, 0x5EE9, 0xE970, 0x5EE7, 0xE971, 0x5EE6, 0xE972, 0x5EE8, 0xE973, 0x5EE5, 0xE974, 0x5F4B, 0xE975, 0x5FBC, + 0xE976, 0x619D, 0xE977, 0x61A8, 0xE978, 0x6196, 0xE979, 0x61C5, 0xE97A, 0x61B4, 0xE97B, 0x61C6, 0xE97C, 0x61C1, 0xE97D, 0x61CC, + 0xE97E, 0x61BA, 0xE9A1, 0x61BF, 0xE9A2, 0x61B8, 0xE9A3, 0x618C, 0xE9A4, 0x64D7, 0xE9A5, 0x64D6, 0xE9A6, 0x64D0, 0xE9A7, 0x64CF, + 0xE9A8, 0x64C9, 0xE9A9, 0x64BD, 0xE9AA, 0x6489, 0xE9AB, 0x64C3, 0xE9AC, 0x64DB, 0xE9AD, 0x64F3, 0xE9AE, 0x64D9, 0xE9AF, 0x6533, + 0xE9B0, 0x657F, 0xE9B1, 0x657C, 0xE9B2, 0x65A2, 0xE9B3, 0x66C8, 0xE9B4, 0x66BE, 0xE9B5, 0x66C0, 0xE9B6, 0x66CA, 0xE9B7, 0x66CB, + 0xE9B8, 0x66CF, 0xE9B9, 0x66BD, 0xE9BA, 0x66BB, 0xE9BB, 0x66BA, 0xE9BC, 0x66CC, 0xE9BD, 0x6723, 0xE9BE, 0x6A34, 0xE9BF, 0x6A66, + 0xE9C0, 0x6A49, 0xE9C1, 0x6A67, 0xE9C2, 0x6A32, 0xE9C3, 0x6A68, 0xE9C4, 0x6A3E, 0xE9C5, 0x6A5D, 0xE9C6, 0x6A6D, 0xE9C7, 0x6A76, + 0xE9C8, 0x6A5B, 0xE9C9, 0x6A51, 0xE9CA, 0x6A28, 0xE9CB, 0x6A5A, 0xE9CC, 0x6A3B, 0xE9CD, 0x6A3F, 0xE9CE, 0x6A41, 0xE9CF, 0x6A6A, + 0xE9D0, 0x6A64, 0xE9D1, 0x6A50, 0xE9D2, 0x6A4F, 0xE9D3, 0x6A54, 0xE9D4, 0x6A6F, 0xE9D5, 0x6A69, 0xE9D6, 0x6A60, 0xE9D7, 0x6A3C, + 0xE9D8, 0x6A5E, 0xE9D9, 0x6A56, 0xE9DA, 0x6A55, 0xE9DB, 0x6A4D, 0xE9DC, 0x6A4E, 0xE9DD, 0x6A46, 0xE9DE, 0x6B55, 0xE9DF, 0x6B54, + 0xE9E0, 0x6B56, 0xE9E1, 0x6BA7, 0xE9E2, 0x6BAA, 0xE9E3, 0x6BAB, 0xE9E4, 0x6BC8, 0xE9E5, 0x6BC7, 0xE9E6, 0x6C04, 0xE9E7, 0x6C03, + 0xE9E8, 0x6C06, 0xE9E9, 0x6FAD, 0xE9EA, 0x6FCB, 0xE9EB, 0x6FA3, 0xE9EC, 0x6FC7, 0xE9ED, 0x6FBC, 0xE9EE, 0x6FCE, 0xE9EF, 0x6FC8, + 0xE9F0, 0x6F5E, 0xE9F1, 0x6FC4, 0xE9F2, 0x6FBD, 0xE9F3, 0x6F9E, 0xE9F4, 0x6FCA, 0xE9F5, 0x6FA8, 0xE9F6, 0x7004, 0xE9F7, 0x6FA5, + 0xE9F8, 0x6FAE, 0xE9F9, 0x6FBA, 0xE9FA, 0x6FAC, 0xE9FB, 0x6FAA, 0xE9FC, 0x6FCF, 0xE9FD, 0x6FBF, 0xE9FE, 0x6FB8, 0xEA40, 0x6FA2, + 0xEA41, 0x6FC9, 0xEA42, 0x6FAB, 0xEA43, 0x6FCD, 0xEA44, 0x6FAF, 0xEA45, 0x6FB2, 0xEA46, 0x6FB0, 0xEA47, 0x71C5, 0xEA48, 0x71C2, + 0xEA49, 0x71BF, 0xEA4A, 0x71B8, 0xEA4B, 0x71D6, 0xEA4C, 0x71C0, 0xEA4D, 0x71C1, 0xEA4E, 0x71CB, 0xEA4F, 0x71D4, 0xEA50, 0x71CA, + 0xEA51, 0x71C7, 0xEA52, 0x71CF, 0xEA53, 0x71BD, 0xEA54, 0x71D8, 0xEA55, 0x71BC, 0xEA56, 0x71C6, 0xEA57, 0x71DA, 0xEA58, 0x71DB, + 0xEA59, 0x729D, 0xEA5A, 0x729E, 0xEA5B, 0x7369, 0xEA5C, 0x7366, 0xEA5D, 0x7367, 0xEA5E, 0x736C, 0xEA5F, 0x7365, 0xEA60, 0x736B, + 0xEA61, 0x736A, 0xEA62, 0x747F, 0xEA63, 0x749A, 0xEA64, 0x74A0, 0xEA65, 0x7494, 0xEA66, 0x7492, 0xEA67, 0x7495, 0xEA68, 0x74A1, + 0xEA69, 0x750B, 0xEA6A, 0x7580, 0xEA6B, 0x762F, 0xEA6C, 0x762D, 0xEA6D, 0x7631, 0xEA6E, 0x763D, 0xEA6F, 0x7633, 0xEA70, 0x763C, + 0xEA71, 0x7635, 0xEA72, 0x7632, 0xEA73, 0x7630, 0xEA74, 0x76BB, 0xEA75, 0x76E6, 0xEA76, 0x779A, 0xEA77, 0x779D, 0xEA78, 0x77A1, + 0xEA79, 0x779C, 0xEA7A, 0x779B, 0xEA7B, 0x77A2, 0xEA7C, 0x77A3, 0xEA7D, 0x7795, 0xEA7E, 0x7799, 0xEAA1, 0x7797, 0xEAA2, 0x78DD, + 0xEAA3, 0x78E9, 0xEAA4, 0x78E5, 0xEAA5, 0x78EA, 0xEAA6, 0x78DE, 0xEAA7, 0x78E3, 0xEAA8, 0x78DB, 0xEAA9, 0x78E1, 0xEAAA, 0x78E2, + 0xEAAB, 0x78ED, 0xEAAC, 0x78DF, 0xEAAD, 0x78E0, 0xEAAE, 0x79A4, 0xEAAF, 0x7A44, 0xEAB0, 0x7A48, 0xEAB1, 0x7A47, 0xEAB2, 0x7AB6, + 0xEAB3, 0x7AB8, 0xEAB4, 0x7AB5, 0xEAB5, 0x7AB1, 0xEAB6, 0x7AB7, 0xEAB7, 0x7BDE, 0xEAB8, 0x7BE3, 0xEAB9, 0x7BE7, 0xEABA, 0x7BDD, + 0xEABB, 0x7BD5, 0xEABC, 0x7BE5, 0xEABD, 0x7BDA, 0xEABE, 0x7BE8, 0xEABF, 0x7BF9, 0xEAC0, 0x7BD4, 0xEAC1, 0x7BEA, 0xEAC2, 0x7BE2, + 0xEAC3, 0x7BDC, 0xEAC4, 0x7BEB, 0xEAC5, 0x7BD8, 0xEAC6, 0x7BDF, 0xEAC7, 0x7CD2, 0xEAC8, 0x7CD4, 0xEAC9, 0x7CD7, 0xEACA, 0x7CD0, + 0xEACB, 0x7CD1, 0xEACC, 0x7E12, 0xEACD, 0x7E21, 0xEACE, 0x7E17, 0xEACF, 0x7E0C, 0xEAD0, 0x7E1F, 0xEAD1, 0x7E20, 0xEAD2, 0x7E13, + 0xEAD3, 0x7E0E, 0xEAD4, 0x7E1C, 0xEAD5, 0x7E15, 0xEAD6, 0x7E1A, 0xEAD7, 0x7E22, 0xEAD8, 0x7E0B, 0xEAD9, 0x7E0F, 0xEADA, 0x7E16, + 0xEADB, 0x7E0D, 0xEADC, 0x7E14, 0xEADD, 0x7E25, 0xEADE, 0x7E24, 0xEADF, 0x7F43, 0xEAE0, 0x7F7B, 0xEAE1, 0x7F7C, 0xEAE2, 0x7F7A, + 0xEAE3, 0x7FB1, 0xEAE4, 0x7FEF, 0xEAE5, 0x802A, 0xEAE6, 0x8029, 0xEAE7, 0x806C, 0xEAE8, 0x81B1, 0xEAE9, 0x81A6, 0xEAEA, 0x81AE, + 0xEAEB, 0x81B9, 0xEAEC, 0x81B5, 0xEAED, 0x81AB, 0xEAEE, 0x81B0, 0xEAEF, 0x81AC, 0xEAF0, 0x81B4, 0xEAF1, 0x81B2, 0xEAF2, 0x81B7, + 0xEAF3, 0x81A7, 0xEAF4, 0x81F2, 0xEAF5, 0x8255, 0xEAF6, 0x8256, 0xEAF7, 0x8257, 0xEAF8, 0x8556, 0xEAF9, 0x8545, 0xEAFA, 0x856B, + 0xEAFB, 0x854D, 0xEAFC, 0x8553, 0xEAFD, 0x8561, 0xEAFE, 0x8558, 0xEB40, 0x8540, 0xEB41, 0x8546, 0xEB42, 0x8564, 0xEB43, 0x8541, + 0xEB44, 0x8562, 0xEB45, 0x8544, 0xEB46, 0x8551, 0xEB47, 0x8547, 0xEB48, 0x8563, 0xEB49, 0x853E, 0xEB4A, 0x855B, 0xEB4B, 0x8571, + 0xEB4C, 0x854E, 0xEB4D, 0x856E, 0xEB4E, 0x8575, 0xEB4F, 0x8555, 0xEB50, 0x8567, 0xEB51, 0x8560, 0xEB52, 0x858C, 0xEB53, 0x8566, + 0xEB54, 0x855D, 0xEB55, 0x8554, 0xEB56, 0x8565, 0xEB57, 0x856C, 0xEB58, 0x8663, 0xEB59, 0x8665, 0xEB5A, 0x8664, 0xEB5B, 0x879B, + 0xEB5C, 0x878F, 0xEB5D, 0x8797, 0xEB5E, 0x8793, 0xEB5F, 0x8792, 0xEB60, 0x8788, 0xEB61, 0x8781, 0xEB62, 0x8796, 0xEB63, 0x8798, + 0xEB64, 0x8779, 0xEB65, 0x8787, 0xEB66, 0x87A3, 0xEB67, 0x8785, 0xEB68, 0x8790, 0xEB69, 0x8791, 0xEB6A, 0x879D, 0xEB6B, 0x8784, + 0xEB6C, 0x8794, 0xEB6D, 0x879C, 0xEB6E, 0x879A, 0xEB6F, 0x8789, 0xEB70, 0x891E, 0xEB71, 0x8926, 0xEB72, 0x8930, 0xEB73, 0x892D, + 0xEB74, 0x892E, 0xEB75, 0x8927, 0xEB76, 0x8931, 0xEB77, 0x8922, 0xEB78, 0x8929, 0xEB79, 0x8923, 0xEB7A, 0x892F, 0xEB7B, 0x892C, + 0xEB7C, 0x891F, 0xEB7D, 0x89F1, 0xEB7E, 0x8AE0, 0xEBA1, 0x8AE2, 0xEBA2, 0x8AF2, 0xEBA3, 0x8AF4, 0xEBA4, 0x8AF5, 0xEBA5, 0x8ADD, + 0xEBA6, 0x8B14, 0xEBA7, 0x8AE4, 0xEBA8, 0x8ADF, 0xEBA9, 0x8AF0, 0xEBAA, 0x8AC8, 0xEBAB, 0x8ADE, 0xEBAC, 0x8AE1, 0xEBAD, 0x8AE8, + 0xEBAE, 0x8AFF, 0xEBAF, 0x8AEF, 0xEBB0, 0x8AFB, 0xEBB1, 0x8C91, 0xEBB2, 0x8C92, 0xEBB3, 0x8C90, 0xEBB4, 0x8CF5, 0xEBB5, 0x8CEE, + 0xEBB6, 0x8CF1, 0xEBB7, 0x8CF0, 0xEBB8, 0x8CF3, 0xEBB9, 0x8D6C, 0xEBBA, 0x8D6E, 0xEBBB, 0x8DA5, 0xEBBC, 0x8DA7, 0xEBBD, 0x8E33, + 0xEBBE, 0x8E3E, 0xEBBF, 0x8E38, 0xEBC0, 0x8E40, 0xEBC1, 0x8E45, 0xEBC2, 0x8E36, 0xEBC3, 0x8E3C, 0xEBC4, 0x8E3D, 0xEBC5, 0x8E41, + 0xEBC6, 0x8E30, 0xEBC7, 0x8E3F, 0xEBC8, 0x8EBD, 0xEBC9, 0x8F36, 0xEBCA, 0x8F2E, 0xEBCB, 0x8F35, 0xEBCC, 0x8F32, 0xEBCD, 0x8F39, + 0xEBCE, 0x8F37, 0xEBCF, 0x8F34, 0xEBD0, 0x9076, 0xEBD1, 0x9079, 0xEBD2, 0x907B, 0xEBD3, 0x9086, 0xEBD4, 0x90FA, 0xEBD5, 0x9133, + 0xEBD6, 0x9135, 0xEBD7, 0x9136, 0xEBD8, 0x9193, 0xEBD9, 0x9190, 0xEBDA, 0x9191, 0xEBDB, 0x918D, 0xEBDC, 0x918F, 0xEBDD, 0x9327, + 0xEBDE, 0x931E, 0xEBDF, 0x9308, 0xEBE0, 0x931F, 0xEBE1, 0x9306, 0xEBE2, 0x930F, 0xEBE3, 0x937A, 0xEBE4, 0x9338, 0xEBE5, 0x933C, + 0xEBE6, 0x931B, 0xEBE7, 0x9323, 0xEBE8, 0x9312, 0xEBE9, 0x9301, 0xEBEA, 0x9346, 0xEBEB, 0x932D, 0xEBEC, 0x930E, 0xEBED, 0x930D, + 0xEBEE, 0x92CB, 0xEBEF, 0x931D, 0xEBF0, 0x92FA, 0xEBF1, 0x9325, 0xEBF2, 0x9313, 0xEBF3, 0x92F9, 0xEBF4, 0x92F7, 0xEBF5, 0x9334, + 0xEBF6, 0x9302, 0xEBF7, 0x9324, 0xEBF8, 0x92FF, 0xEBF9, 0x9329, 0xEBFA, 0x9339, 0xEBFB, 0x9335, 0xEBFC, 0x932A, 0xEBFD, 0x9314, + 0xEBFE, 0x930C, 0xEC40, 0x930B, 0xEC41, 0x92FE, 0xEC42, 0x9309, 0xEC43, 0x9300, 0xEC44, 0x92FB, 0xEC45, 0x9316, 0xEC46, 0x95BC, + 0xEC47, 0x95CD, 0xEC48, 0x95BE, 0xEC49, 0x95B9, 0xEC4A, 0x95BA, 0xEC4B, 0x95B6, 0xEC4C, 0x95BF, 0xEC4D, 0x95B5, 0xEC4E, 0x95BD, + 0xEC4F, 0x96A9, 0xEC50, 0x96D4, 0xEC51, 0x970B, 0xEC52, 0x9712, 0xEC53, 0x9710, 0xEC54, 0x9799, 0xEC55, 0x9797, 0xEC56, 0x9794, + 0xEC57, 0x97F0, 0xEC58, 0x97F8, 0xEC59, 0x9835, 0xEC5A, 0x982F, 0xEC5B, 0x9832, 0xEC5C, 0x9924, 0xEC5D, 0x991F, 0xEC5E, 0x9927, + 0xEC5F, 0x9929, 0xEC60, 0x999E, 0xEC61, 0x99EE, 0xEC62, 0x99EC, 0xEC63, 0x99E5, 0xEC64, 0x99E4, 0xEC65, 0x99F0, 0xEC66, 0x99E3, + 0xEC67, 0x99EA, 0xEC68, 0x99E9, 0xEC69, 0x99E7, 0xEC6A, 0x9AB9, 0xEC6B, 0x9ABF, 0xEC6C, 0x9AB4, 0xEC6D, 0x9ABB, 0xEC6E, 0x9AF6, + 0xEC6F, 0x9AFA, 0xEC70, 0x9AF9, 0xEC71, 0x9AF7, 0xEC72, 0x9B33, 0xEC73, 0x9B80, 0xEC74, 0x9B85, 0xEC75, 0x9B87, 0xEC76, 0x9B7C, + 0xEC77, 0x9B7E, 0xEC78, 0x9B7B, 0xEC79, 0x9B82, 0xEC7A, 0x9B93, 0xEC7B, 0x9B92, 0xEC7C, 0x9B90, 0xEC7D, 0x9B7A, 0xEC7E, 0x9B95, + 0xECA1, 0x9B7D, 0xECA2, 0x9B88, 0xECA3, 0x9D25, 0xECA4, 0x9D17, 0xECA5, 0x9D20, 0xECA6, 0x9D1E, 0xECA7, 0x9D14, 0xECA8, 0x9D29, + 0xECA9, 0x9D1D, 0xECAA, 0x9D18, 0xECAB, 0x9D22, 0xECAC, 0x9D10, 0xECAD, 0x9D19, 0xECAE, 0x9D1F, 0xECAF, 0x9E88, 0xECB0, 0x9E86, + 0xECB1, 0x9E87, 0xECB2, 0x9EAE, 0xECB3, 0x9EAD, 0xECB4, 0x9ED5, 0xECB5, 0x9ED6, 0xECB6, 0x9EFA, 0xECB7, 0x9F12, 0xECB8, 0x9F3D, + 0xECB9, 0x5126, 0xECBA, 0x5125, 0xECBB, 0x5122, 0xECBC, 0x5124, 0xECBD, 0x5120, 0xECBE, 0x5129, 0xECBF, 0x52F4, 0xECC0, 0x5693, + 0xECC1, 0x568C, 0xECC2, 0x568D, 0xECC3, 0x5686, 0xECC4, 0x5684, 0xECC5, 0x5683, 0xECC6, 0x567E, 0xECC7, 0x5682, 0xECC8, 0x567F, + 0xECC9, 0x5681, 0xECCA, 0x58D6, 0xECCB, 0x58D4, 0xECCC, 0x58CF, 0xECCD, 0x58D2, 0xECCE, 0x5B2D, 0xECCF, 0x5B25, 0xECD0, 0x5B32, + 0xECD1, 0x5B23, 0xECD2, 0x5B2C, 0xECD3, 0x5B27, 0xECD4, 0x5B26, 0xECD5, 0x5B2F, 0xECD6, 0x5B2E, 0xECD7, 0x5B7B, 0xECD8, 0x5BF1, + 0xECD9, 0x5BF2, 0xECDA, 0x5DB7, 0xECDB, 0x5E6C, 0xECDC, 0x5E6A, 0xECDD, 0x5FBE, 0xECDE, 0x5FBB, 0xECDF, 0x61C3, 0xECE0, 0x61B5, + 0xECE1, 0x61BC, 0xECE2, 0x61E7, 0xECE3, 0x61E0, 0xECE4, 0x61E5, 0xECE5, 0x61E4, 0xECE6, 0x61E8, 0xECE7, 0x61DE, 0xECE8, 0x64EF, + 0xECE9, 0x64E9, 0xECEA, 0x64E3, 0xECEB, 0x64EB, 0xECEC, 0x64E4, 0xECED, 0x64E8, 0xECEE, 0x6581, 0xECEF, 0x6580, 0xECF0, 0x65B6, + 0xECF1, 0x65DA, 0xECF2, 0x66D2, 0xECF3, 0x6A8D, 0xECF4, 0x6A96, 0xECF5, 0x6A81, 0xECF6, 0x6AA5, 0xECF7, 0x6A89, 0xECF8, 0x6A9F, + 0xECF9, 0x6A9B, 0xECFA, 0x6AA1, 0xECFB, 0x6A9E, 0xECFC, 0x6A87, 0xECFD, 0x6A93, 0xECFE, 0x6A8E, 0xED40, 0x6A95, 0xED41, 0x6A83, + 0xED42, 0x6AA8, 0xED43, 0x6AA4, 0xED44, 0x6A91, 0xED45, 0x6A7F, 0xED46, 0x6AA6, 0xED47, 0x6A9A, 0xED48, 0x6A85, 0xED49, 0x6A8C, + 0xED4A, 0x6A92, 0xED4B, 0x6B5B, 0xED4C, 0x6BAD, 0xED4D, 0x6C09, 0xED4E, 0x6FCC, 0xED4F, 0x6FA9, 0xED50, 0x6FF4, 0xED51, 0x6FD4, + 0xED52, 0x6FE3, 0xED53, 0x6FDC, 0xED54, 0x6FED, 0xED55, 0x6FE7, 0xED56, 0x6FE6, 0xED57, 0x6FDE, 0xED58, 0x6FF2, 0xED59, 0x6FDD, + 0xED5A, 0x6FE2, 0xED5B, 0x6FE8, 0xED5C, 0x71E1, 0xED5D, 0x71F1, 0xED5E, 0x71E8, 0xED5F, 0x71F2, 0xED60, 0x71E4, 0xED61, 0x71F0, + 0xED62, 0x71E2, 0xED63, 0x7373, 0xED64, 0x736E, 0xED65, 0x736F, 0xED66, 0x7497, 0xED67, 0x74B2, 0xED68, 0x74AB, 0xED69, 0x7490, + 0xED6A, 0x74AA, 0xED6B, 0x74AD, 0xED6C, 0x74B1, 0xED6D, 0x74A5, 0xED6E, 0x74AF, 0xED6F, 0x7510, 0xED70, 0x7511, 0xED71, 0x7512, + 0xED72, 0x750F, 0xED73, 0x7584, 0xED74, 0x7643, 0xED75, 0x7648, 0xED76, 0x7649, 0xED77, 0x7647, 0xED78, 0x76A4, 0xED79, 0x76E9, + 0xED7A, 0x77B5, 0xED7B, 0x77AB, 0xED7C, 0x77B2, 0xED7D, 0x77B7, 0xED7E, 0x77B6, 0xEDA1, 0x77B4, 0xEDA2, 0x77B1, 0xEDA3, 0x77A8, + 0xEDA4, 0x77F0, 0xEDA5, 0x78F3, 0xEDA6, 0x78FD, 0xEDA7, 0x7902, 0xEDA8, 0x78FB, 0xEDA9, 0x78FC, 0xEDAA, 0x78F2, 0xEDAB, 0x7905, + 0xEDAC, 0x78F9, 0xEDAD, 0x78FE, 0xEDAE, 0x7904, 0xEDAF, 0x79AB, 0xEDB0, 0x79A8, 0xEDB1, 0x7A5C, 0xEDB2, 0x7A5B, 0xEDB3, 0x7A56, + 0xEDB4, 0x7A58, 0xEDB5, 0x7A54, 0xEDB6, 0x7A5A, 0xEDB7, 0x7ABE, 0xEDB8, 0x7AC0, 0xEDB9, 0x7AC1, 0xEDBA, 0x7C05, 0xEDBB, 0x7C0F, + 0xEDBC, 0x7BF2, 0xEDBD, 0x7C00, 0xEDBE, 0x7BFF, 0xEDBF, 0x7BFB, 0xEDC0, 0x7C0E, 0xEDC1, 0x7BF4, 0xEDC2, 0x7C0B, 0xEDC3, 0x7BF3, + 0xEDC4, 0x7C02, 0xEDC5, 0x7C09, 0xEDC6, 0x7C03, 0xEDC7, 0x7C01, 0xEDC8, 0x7BF8, 0xEDC9, 0x7BFD, 0xEDCA, 0x7C06, 0xEDCB, 0x7BF0, + 0xEDCC, 0x7BF1, 0xEDCD, 0x7C10, 0xEDCE, 0x7C0A, 0xEDCF, 0x7CE8, 0xEDD0, 0x7E2D, 0xEDD1, 0x7E3C, 0xEDD2, 0x7E42, 0xEDD3, 0x7E33, + 0xEDD4, 0x9848, 0xEDD5, 0x7E38, 0xEDD6, 0x7E2A, 0xEDD7, 0x7E49, 0xEDD8, 0x7E40, 0xEDD9, 0x7E47, 0xEDDA, 0x7E29, 0xEDDB, 0x7E4C, + 0xEDDC, 0x7E30, 0xEDDD, 0x7E3B, 0xEDDE, 0x7E36, 0xEDDF, 0x7E44, 0xEDE0, 0x7E3A, 0xEDE1, 0x7F45, 0xEDE2, 0x7F7F, 0xEDE3, 0x7F7E, + 0xEDE4, 0x7F7D, 0xEDE5, 0x7FF4, 0xEDE6, 0x7FF2, 0xEDE7, 0x802C, 0xEDE8, 0x81BB, 0xEDE9, 0x81C4, 0xEDEA, 0x81CC, 0xEDEB, 0x81CA, + 0xEDEC, 0x81C5, 0xEDED, 0x81C7, 0xEDEE, 0x81BC, 0xEDEF, 0x81E9, 0xEDF0, 0x825B, 0xEDF1, 0x825A, 0xEDF2, 0x825C, 0xEDF3, 0x8583, + 0xEDF4, 0x8580, 0xEDF5, 0x858F, 0xEDF6, 0x85A7, 0xEDF7, 0x8595, 0xEDF8, 0x85A0, 0xEDF9, 0x858B, 0xEDFA, 0x85A3, 0xEDFB, 0x857B, + 0xEDFC, 0x85A4, 0xEDFD, 0x859A, 0xEDFE, 0x859E, 0xEE40, 0x8577, 0xEE41, 0x857C, 0xEE42, 0x8589, 0xEE43, 0x85A1, 0xEE44, 0x857A, + 0xEE45, 0x8578, 0xEE46, 0x8557, 0xEE47, 0x858E, 0xEE48, 0x8596, 0xEE49, 0x8586, 0xEE4A, 0x858D, 0xEE4B, 0x8599, 0xEE4C, 0x859D, + 0xEE4D, 0x8581, 0xEE4E, 0x85A2, 0xEE4F, 0x8582, 0xEE50, 0x8588, 0xEE51, 0x8585, 0xEE52, 0x8579, 0xEE53, 0x8576, 0xEE54, 0x8598, + 0xEE55, 0x8590, 0xEE56, 0x859F, 0xEE57, 0x8668, 0xEE58, 0x87BE, 0xEE59, 0x87AA, 0xEE5A, 0x87AD, 0xEE5B, 0x87C5, 0xEE5C, 0x87B0, + 0xEE5D, 0x87AC, 0xEE5E, 0x87B9, 0xEE5F, 0x87B5, 0xEE60, 0x87BC, 0xEE61, 0x87AE, 0xEE62, 0x87C9, 0xEE63, 0x87C3, 0xEE64, 0x87C2, + 0xEE65, 0x87CC, 0xEE66, 0x87B7, 0xEE67, 0x87AF, 0xEE68, 0x87C4, 0xEE69, 0x87CA, 0xEE6A, 0x87B4, 0xEE6B, 0x87B6, 0xEE6C, 0x87BF, + 0xEE6D, 0x87B8, 0xEE6E, 0x87BD, 0xEE6F, 0x87DE, 0xEE70, 0x87B2, 0xEE71, 0x8935, 0xEE72, 0x8933, 0xEE73, 0x893C, 0xEE74, 0x893E, + 0xEE75, 0x8941, 0xEE76, 0x8952, 0xEE77, 0x8937, 0xEE78, 0x8942, 0xEE79, 0x89AD, 0xEE7A, 0x89AF, 0xEE7B, 0x89AE, 0xEE7C, 0x89F2, + 0xEE7D, 0x89F3, 0xEE7E, 0x8B1E, 0xEEA1, 0x8B18, 0xEEA2, 0x8B16, 0xEEA3, 0x8B11, 0xEEA4, 0x8B05, 0xEEA5, 0x8B0B, 0xEEA6, 0x8B22, + 0xEEA7, 0x8B0F, 0xEEA8, 0x8B12, 0xEEA9, 0x8B15, 0xEEAA, 0x8B07, 0xEEAB, 0x8B0D, 0xEEAC, 0x8B08, 0xEEAD, 0x8B06, 0xEEAE, 0x8B1C, + 0xEEAF, 0x8B13, 0xEEB0, 0x8B1A, 0xEEB1, 0x8C4F, 0xEEB2, 0x8C70, 0xEEB3, 0x8C72, 0xEEB4, 0x8C71, 0xEEB5, 0x8C6F, 0xEEB6, 0x8C95, + 0xEEB7, 0x8C94, 0xEEB8, 0x8CF9, 0xEEB9, 0x8D6F, 0xEEBA, 0x8E4E, 0xEEBB, 0x8E4D, 0xEEBC, 0x8E53, 0xEEBD, 0x8E50, 0xEEBE, 0x8E4C, + 0xEEBF, 0x8E47, 0xEEC0, 0x8F43, 0xEEC1, 0x8F40, 0xEEC2, 0x9085, 0xEEC3, 0x907E, 0xEEC4, 0x9138, 0xEEC5, 0x919A, 0xEEC6, 0x91A2, + 0xEEC7, 0x919B, 0xEEC8, 0x9199, 0xEEC9, 0x919F, 0xEECA, 0x91A1, 0xEECB, 0x919D, 0xEECC, 0x91A0, 0xEECD, 0x93A1, 0xEECE, 0x9383, + 0xEECF, 0x93AF, 0xEED0, 0x9364, 0xEED1, 0x9356, 0xEED2, 0x9347, 0xEED3, 0x937C, 0xEED4, 0x9358, 0xEED5, 0x935C, 0xEED6, 0x9376, + 0xEED7, 0x9349, 0xEED8, 0x9350, 0xEED9, 0x9351, 0xEEDA, 0x9360, 0xEEDB, 0x936D, 0xEEDC, 0x938F, 0xEEDD, 0x934C, 0xEEDE, 0x936A, + 0xEEDF, 0x9379, 0xEEE0, 0x9357, 0xEEE1, 0x9355, 0xEEE2, 0x9352, 0xEEE3, 0x934F, 0xEEE4, 0x9371, 0xEEE5, 0x9377, 0xEEE6, 0x937B, + 0xEEE7, 0x9361, 0xEEE8, 0x935E, 0xEEE9, 0x9363, 0xEEEA, 0x9367, 0xEEEB, 0x9380, 0xEEEC, 0x934E, 0xEEED, 0x9359, 0xEEEE, 0x95C7, + 0xEEEF, 0x95C0, 0xEEF0, 0x95C9, 0xEEF1, 0x95C3, 0xEEF2, 0x95C5, 0xEEF3, 0x95B7, 0xEEF4, 0x96AE, 0xEEF5, 0x96B0, 0xEEF6, 0x96AC, + 0xEEF7, 0x9720, 0xEEF8, 0x971F, 0xEEF9, 0x9718, 0xEEFA, 0x971D, 0xEEFB, 0x9719, 0xEEFC, 0x979A, 0xEEFD, 0x97A1, 0xEEFE, 0x979C, + 0xEF40, 0x979E, 0xEF41, 0x979D, 0xEF42, 0x97D5, 0xEF43, 0x97D4, 0xEF44, 0x97F1, 0xEF45, 0x9841, 0xEF46, 0x9844, 0xEF47, 0x984A, + 0xEF48, 0x9849, 0xEF49, 0x9845, 0xEF4A, 0x9843, 0xEF4B, 0x9925, 0xEF4C, 0x992B, 0xEF4D, 0x992C, 0xEF4E, 0x992A, 0xEF4F, 0x9933, + 0xEF50, 0x9932, 0xEF51, 0x992F, 0xEF52, 0x992D, 0xEF53, 0x9931, 0xEF54, 0x9930, 0xEF55, 0x9998, 0xEF56, 0x99A3, 0xEF57, 0x99A1, + 0xEF58, 0x9A02, 0xEF59, 0x99FA, 0xEF5A, 0x99F4, 0xEF5B, 0x99F7, 0xEF5C, 0x99F9, 0xEF5D, 0x99F8, 0xEF5E, 0x99F6, 0xEF5F, 0x99FB, + 0xEF60, 0x99FD, 0xEF61, 0x99FE, 0xEF62, 0x99FC, 0xEF63, 0x9A03, 0xEF64, 0x9ABE, 0xEF65, 0x9AFE, 0xEF66, 0x9AFD, 0xEF67, 0x9B01, + 0xEF68, 0x9AFC, 0xEF69, 0x9B48, 0xEF6A, 0x9B9A, 0xEF6B, 0x9BA8, 0xEF6C, 0x9B9E, 0xEF6D, 0x9B9B, 0xEF6E, 0x9BA6, 0xEF6F, 0x9BA1, + 0xEF70, 0x9BA5, 0xEF71, 0x9BA4, 0xEF72, 0x9B86, 0xEF73, 0x9BA2, 0xEF74, 0x9BA0, 0xEF75, 0x9BAF, 0xEF76, 0x9D33, 0xEF77, 0x9D41, + 0xEF78, 0x9D67, 0xEF79, 0x9D36, 0xEF7A, 0x9D2E, 0xEF7B, 0x9D2F, 0xEF7C, 0x9D31, 0xEF7D, 0x9D38, 0xEF7E, 0x9D30, 0xEFA1, 0x9D45, + 0xEFA2, 0x9D42, 0xEFA3, 0x9D43, 0xEFA4, 0x9D3E, 0xEFA5, 0x9D37, 0xEFA6, 0x9D40, 0xEFA7, 0x9D3D, 0xEFA8, 0x7FF5, 0xEFA9, 0x9D2D, + 0xEFAA, 0x9E8A, 0xEFAB, 0x9E89, 0xEFAC, 0x9E8D, 0xEFAD, 0x9EB0, 0xEFAE, 0x9EC8, 0xEFAF, 0x9EDA, 0xEFB0, 0x9EFB, 0xEFB1, 0x9EFF, + 0xEFB2, 0x9F24, 0xEFB3, 0x9F23, 0xEFB4, 0x9F22, 0xEFB5, 0x9F54, 0xEFB6, 0x9FA0, 0xEFB7, 0x5131, 0xEFB8, 0x512D, 0xEFB9, 0x512E, + 0xEFBA, 0x5698, 0xEFBB, 0x569C, 0xEFBC, 0x5697, 0xEFBD, 0x569A, 0xEFBE, 0x569D, 0xEFBF, 0x5699, 0xEFC0, 0x5970, 0xEFC1, 0x5B3C, + 0xEFC2, 0x5C69, 0xEFC3, 0x5C6A, 0xEFC4, 0x5DC0, 0xEFC5, 0x5E6D, 0xEFC6, 0x5E6E, 0xEFC7, 0x61D8, 0xEFC8, 0x61DF, 0xEFC9, 0x61ED, + 0xEFCA, 0x61EE, 0xEFCB, 0x61F1, 0xEFCC, 0x61EA, 0xEFCD, 0x61F0, 0xEFCE, 0x61EB, 0xEFCF, 0x61D6, 0xEFD0, 0x61E9, 0xEFD1, 0x64FF, + 0xEFD2, 0x6504, 0xEFD3, 0x64FD, 0xEFD4, 0x64F8, 0xEFD5, 0x6501, 0xEFD6, 0x6503, 0xEFD7, 0x64FC, 0xEFD8, 0x6594, 0xEFD9, 0x65DB, + 0xEFDA, 0x66DA, 0xEFDB, 0x66DB, 0xEFDC, 0x66D8, 0xEFDD, 0x6AC5, 0xEFDE, 0x6AB9, 0xEFDF, 0x6ABD, 0xEFE0, 0x6AE1, 0xEFE1, 0x6AC6, + 0xEFE2, 0x6ABA, 0xEFE3, 0x6AB6, 0xEFE4, 0x6AB7, 0xEFE5, 0x6AC7, 0xEFE6, 0x6AB4, 0xEFE7, 0x6AAD, 0xEFE8, 0x6B5E, 0xEFE9, 0x6BC9, + 0xEFEA, 0x6C0B, 0xEFEB, 0x7007, 0xEFEC, 0x700C, 0xEFED, 0x700D, 0xEFEE, 0x7001, 0xEFEF, 0x7005, 0xEFF0, 0x7014, 0xEFF1, 0x700E, + 0xEFF2, 0x6FFF, 0xEFF3, 0x7000, 0xEFF4, 0x6FFB, 0xEFF5, 0x7026, 0xEFF6, 0x6FFC, 0xEFF7, 0x6FF7, 0xEFF8, 0x700A, 0xEFF9, 0x7201, + 0xEFFA, 0x71FF, 0xEFFB, 0x71F9, 0xEFFC, 0x7203, 0xEFFD, 0x71FD, 0xEFFE, 0x7376, 0xF040, 0x74B8, 0xF041, 0x74C0, 0xF042, 0x74B5, + 0xF043, 0x74C1, 0xF044, 0x74BE, 0xF045, 0x74B6, 0xF046, 0x74BB, 0xF047, 0x74C2, 0xF048, 0x7514, 0xF049, 0x7513, 0xF04A, 0x765C, + 0xF04B, 0x7664, 0xF04C, 0x7659, 0xF04D, 0x7650, 0xF04E, 0x7653, 0xF04F, 0x7657, 0xF050, 0x765A, 0xF051, 0x76A6, 0xF052, 0x76BD, + 0xF053, 0x76EC, 0xF054, 0x77C2, 0xF055, 0x77BA, 0xF056, 0x78FF, 0xF057, 0x790C, 0xF058, 0x7913, 0xF059, 0x7914, 0xF05A, 0x7909, + 0xF05B, 0x7910, 0xF05C, 0x7912, 0xF05D, 0x7911, 0xF05E, 0x79AD, 0xF05F, 0x79AC, 0xF060, 0x7A5F, 0xF061, 0x7C1C, 0xF062, 0x7C29, + 0xF063, 0x7C19, 0xF064, 0x7C20, 0xF065, 0x7C1F, 0xF066, 0x7C2D, 0xF067, 0x7C1D, 0xF068, 0x7C26, 0xF069, 0x7C28, 0xF06A, 0x7C22, + 0xF06B, 0x7C25, 0xF06C, 0x7C30, 0xF06D, 0x7E5C, 0xF06E, 0x7E50, 0xF06F, 0x7E56, 0xF070, 0x7E63, 0xF071, 0x7E58, 0xF072, 0x7E62, + 0xF073, 0x7E5F, 0xF074, 0x7E51, 0xF075, 0x7E60, 0xF076, 0x7E57, 0xF077, 0x7E53, 0xF078, 0x7FB5, 0xF079, 0x7FB3, 0xF07A, 0x7FF7, + 0xF07B, 0x7FF8, 0xF07C, 0x8075, 0xF07D, 0x81D1, 0xF07E, 0x81D2, 0xF0A1, 0x81D0, 0xF0A2, 0x825F, 0xF0A3, 0x825E, 0xF0A4, 0x85B4, + 0xF0A5, 0x85C6, 0xF0A6, 0x85C0, 0xF0A7, 0x85C3, 0xF0A8, 0x85C2, 0xF0A9, 0x85B3, 0xF0AA, 0x85B5, 0xF0AB, 0x85BD, 0xF0AC, 0x85C7, + 0xF0AD, 0x85C4, 0xF0AE, 0x85BF, 0xF0AF, 0x85CB, 0xF0B0, 0x85CE, 0xF0B1, 0x85C8, 0xF0B2, 0x85C5, 0xF0B3, 0x85B1, 0xF0B4, 0x85B6, + 0xF0B5, 0x85D2, 0xF0B6, 0x8624, 0xF0B7, 0x85B8, 0xF0B8, 0x85B7, 0xF0B9, 0x85BE, 0xF0BA, 0x8669, 0xF0BB, 0x87E7, 0xF0BC, 0x87E6, + 0xF0BD, 0x87E2, 0xF0BE, 0x87DB, 0xF0BF, 0x87EB, 0xF0C0, 0x87EA, 0xF0C1, 0x87E5, 0xF0C2, 0x87DF, 0xF0C3, 0x87F3, 0xF0C4, 0x87E4, + 0xF0C5, 0x87D4, 0xF0C6, 0x87DC, 0xF0C7, 0x87D3, 0xF0C8, 0x87ED, 0xF0C9, 0x87D8, 0xF0CA, 0x87E3, 0xF0CB, 0x87A4, 0xF0CC, 0x87D7, + 0xF0CD, 0x87D9, 0xF0CE, 0x8801, 0xF0CF, 0x87F4, 0xF0D0, 0x87E8, 0xF0D1, 0x87DD, 0xF0D2, 0x8953, 0xF0D3, 0x894B, 0xF0D4, 0x894F, + 0xF0D5, 0x894C, 0xF0D6, 0x8946, 0xF0D7, 0x8950, 0xF0D8, 0x8951, 0xF0D9, 0x8949, 0xF0DA, 0x8B2A, 0xF0DB, 0x8B27, 0xF0DC, 0x8B23, + 0xF0DD, 0x8B33, 0xF0DE, 0x8B30, 0xF0DF, 0x8B35, 0xF0E0, 0x8B47, 0xF0E1, 0x8B2F, 0xF0E2, 0x8B3C, 0xF0E3, 0x8B3E, 0xF0E4, 0x8B31, + 0xF0E5, 0x8B25, 0xF0E6, 0x8B37, 0xF0E7, 0x8B26, 0xF0E8, 0x8B36, 0xF0E9, 0x8B2E, 0xF0EA, 0x8B24, 0xF0EB, 0x8B3B, 0xF0EC, 0x8B3D, + 0xF0ED, 0x8B3A, 0xF0EE, 0x8C42, 0xF0EF, 0x8C75, 0xF0F0, 0x8C99, 0xF0F1, 0x8C98, 0xF0F2, 0x8C97, 0xF0F3, 0x8CFE, 0xF0F4, 0x8D04, + 0xF0F5, 0x8D02, 0xF0F6, 0x8D00, 0xF0F7, 0x8E5C, 0xF0F8, 0x8E62, 0xF0F9, 0x8E60, 0xF0FA, 0x8E57, 0xF0FB, 0x8E56, 0xF0FC, 0x8E5E, + 0xF0FD, 0x8E65, 0xF0FE, 0x8E67, 0xF140, 0x8E5B, 0xF141, 0x8E5A, 0xF142, 0x8E61, 0xF143, 0x8E5D, 0xF144, 0x8E69, 0xF145, 0x8E54, + 0xF146, 0x8F46, 0xF147, 0x8F47, 0xF148, 0x8F48, 0xF149, 0x8F4B, 0xF14A, 0x9128, 0xF14B, 0x913A, 0xF14C, 0x913B, 0xF14D, 0x913E, + 0xF14E, 0x91A8, 0xF14F, 0x91A5, 0xF150, 0x91A7, 0xF151, 0x91AF, 0xF152, 0x91AA, 0xF153, 0x93B5, 0xF154, 0x938C, 0xF155, 0x9392, + 0xF156, 0x93B7, 0xF157, 0x939B, 0xF158, 0x939D, 0xF159, 0x9389, 0xF15A, 0x93A7, 0xF15B, 0x938E, 0xF15C, 0x93AA, 0xF15D, 0x939E, + 0xF15E, 0x93A6, 0xF15F, 0x9395, 0xF160, 0x9388, 0xF161, 0x9399, 0xF162, 0x939F, 0xF163, 0x938D, 0xF164, 0x93B1, 0xF165, 0x9391, + 0xF166, 0x93B2, 0xF167, 0x93A4, 0xF168, 0x93A8, 0xF169, 0x93B4, 0xF16A, 0x93A3, 0xF16B, 0x93A5, 0xF16C, 0x95D2, 0xF16D, 0x95D3, + 0xF16E, 0x95D1, 0xF16F, 0x96B3, 0xF170, 0x96D7, 0xF171, 0x96DA, 0xF172, 0x5DC2, 0xF173, 0x96DF, 0xF174, 0x96D8, 0xF175, 0x96DD, + 0xF176, 0x9723, 0xF177, 0x9722, 0xF178, 0x9725, 0xF179, 0x97AC, 0xF17A, 0x97AE, 0xF17B, 0x97A8, 0xF17C, 0x97AB, 0xF17D, 0x97A4, + 0xF17E, 0x97AA, 0xF1A1, 0x97A2, 0xF1A2, 0x97A5, 0xF1A3, 0x97D7, 0xF1A4, 0x97D9, 0xF1A5, 0x97D6, 0xF1A6, 0x97D8, 0xF1A7, 0x97FA, + 0xF1A8, 0x9850, 0xF1A9, 0x9851, 0xF1AA, 0x9852, 0xF1AB, 0x98B8, 0xF1AC, 0x9941, 0xF1AD, 0x993C, 0xF1AE, 0x993A, 0xF1AF, 0x9A0F, + 0xF1B0, 0x9A0B, 0xF1B1, 0x9A09, 0xF1B2, 0x9A0D, 0xF1B3, 0x9A04, 0xF1B4, 0x9A11, 0xF1B5, 0x9A0A, 0xF1B6, 0x9A05, 0xF1B7, 0x9A07, + 0xF1B8, 0x9A06, 0xF1B9, 0x9AC0, 0xF1BA, 0x9ADC, 0xF1BB, 0x9B08, 0xF1BC, 0x9B04, 0xF1BD, 0x9B05, 0xF1BE, 0x9B29, 0xF1BF, 0x9B35, + 0xF1C0, 0x9B4A, 0xF1C1, 0x9B4C, 0xF1C2, 0x9B4B, 0xF1C3, 0x9BC7, 0xF1C4, 0x9BC6, 0xF1C5, 0x9BC3, 0xF1C6, 0x9BBF, 0xF1C7, 0x9BC1, + 0xF1C8, 0x9BB5, 0xF1C9, 0x9BB8, 0xF1CA, 0x9BD3, 0xF1CB, 0x9BB6, 0xF1CC, 0x9BC4, 0xF1CD, 0x9BB9, 0xF1CE, 0x9BBD, 0xF1CF, 0x9D5C, + 0xF1D0, 0x9D53, 0xF1D1, 0x9D4F, 0xF1D2, 0x9D4A, 0xF1D3, 0x9D5B, 0xF1D4, 0x9D4B, 0xF1D5, 0x9D59, 0xF1D6, 0x9D56, 0xF1D7, 0x9D4C, + 0xF1D8, 0x9D57, 0xF1D9, 0x9D52, 0xF1DA, 0x9D54, 0xF1DB, 0x9D5F, 0xF1DC, 0x9D58, 0xF1DD, 0x9D5A, 0xF1DE, 0x9E8E, 0xF1DF, 0x9E8C, + 0xF1E0, 0x9EDF, 0xF1E1, 0x9F01, 0xF1E2, 0x9F00, 0xF1E3, 0x9F16, 0xF1E4, 0x9F25, 0xF1E5, 0x9F2B, 0xF1E6, 0x9F2A, 0xF1E7, 0x9F29, + 0xF1E8, 0x9F28, 0xF1E9, 0x9F4C, 0xF1EA, 0x9F55, 0xF1EB, 0x5134, 0xF1EC, 0x5135, 0xF1ED, 0x5296, 0xF1EE, 0x52F7, 0xF1EF, 0x53B4, + 0xF1F0, 0x56AB, 0xF1F1, 0x56AD, 0xF1F2, 0x56A6, 0xF1F3, 0x56A7, 0xF1F4, 0x56AA, 0xF1F5, 0x56AC, 0xF1F6, 0x58DA, 0xF1F7, 0x58DD, + 0xF1F8, 0x58DB, 0xF1F9, 0x5912, 0xF1FA, 0x5B3D, 0xF1FB, 0x5B3E, 0xF1FC, 0x5B3F, 0xF1FD, 0x5DC3, 0xF1FE, 0x5E70, 0xF240, 0x5FBF, + 0xF241, 0x61FB, 0xF242, 0x6507, 0xF243, 0x6510, 0xF244, 0x650D, 0xF245, 0x6509, 0xF246, 0x650C, 0xF247, 0x650E, 0xF248, 0x6584, + 0xF249, 0x65DE, 0xF24A, 0x65DD, 0xF24B, 0x66DE, 0xF24C, 0x6AE7, 0xF24D, 0x6AE0, 0xF24E, 0x6ACC, 0xF24F, 0x6AD1, 0xF250, 0x6AD9, + 0xF251, 0x6ACB, 0xF252, 0x6ADF, 0xF253, 0x6ADC, 0xF254, 0x6AD0, 0xF255, 0x6AEB, 0xF256, 0x6ACF, 0xF257, 0x6ACD, 0xF258, 0x6ADE, + 0xF259, 0x6B60, 0xF25A, 0x6BB0, 0xF25B, 0x6C0C, 0xF25C, 0x7019, 0xF25D, 0x7027, 0xF25E, 0x7020, 0xF25F, 0x7016, 0xF260, 0x702B, + 0xF261, 0x7021, 0xF262, 0x7022, 0xF263, 0x7023, 0xF264, 0x7029, 0xF265, 0x7017, 0xF266, 0x7024, 0xF267, 0x701C, 0xF268, 0x702A, + 0xF269, 0x720C, 0xF26A, 0x720A, 0xF26B, 0x7207, 0xF26C, 0x7202, 0xF26D, 0x7205, 0xF26E, 0x72A5, 0xF26F, 0x72A6, 0xF270, 0x72A4, + 0xF271, 0x72A3, 0xF272, 0x72A1, 0xF273, 0x74CB, 0xF274, 0x74C5, 0xF275, 0x74B7, 0xF276, 0x74C3, 0xF277, 0x7516, 0xF278, 0x7660, + 0xF279, 0x77C9, 0xF27A, 0x77CA, 0xF27B, 0x77C4, 0xF27C, 0x77F1, 0xF27D, 0x791D, 0xF27E, 0x791B, 0xF2A1, 0x7921, 0xF2A2, 0x791C, + 0xF2A3, 0x7917, 0xF2A4, 0x791E, 0xF2A5, 0x79B0, 0xF2A6, 0x7A67, 0xF2A7, 0x7A68, 0xF2A8, 0x7C33, 0xF2A9, 0x7C3C, 0xF2AA, 0x7C39, + 0xF2AB, 0x7C2C, 0xF2AC, 0x7C3B, 0xF2AD, 0x7CEC, 0xF2AE, 0x7CEA, 0xF2AF, 0x7E76, 0xF2B0, 0x7E75, 0xF2B1, 0x7E78, 0xF2B2, 0x7E70, + 0xF2B3, 0x7E77, 0xF2B4, 0x7E6F, 0xF2B5, 0x7E7A, 0xF2B6, 0x7E72, 0xF2B7, 0x7E74, 0xF2B8, 0x7E68, 0xF2B9, 0x7F4B, 0xF2BA, 0x7F4A, + 0xF2BB, 0x7F83, 0xF2BC, 0x7F86, 0xF2BD, 0x7FB7, 0xF2BE, 0x7FFD, 0xF2BF, 0x7FFE, 0xF2C0, 0x8078, 0xF2C1, 0x81D7, 0xF2C2, 0x81D5, + 0xF2C3, 0x8264, 0xF2C4, 0x8261, 0xF2C5, 0x8263, 0xF2C6, 0x85EB, 0xF2C7, 0x85F1, 0xF2C8, 0x85ED, 0xF2C9, 0x85D9, 0xF2CA, 0x85E1, + 0xF2CB, 0x85E8, 0xF2CC, 0x85DA, 0xF2CD, 0x85D7, 0xF2CE, 0x85EC, 0xF2CF, 0x85F2, 0xF2D0, 0x85F8, 0xF2D1, 0x85D8, 0xF2D2, 0x85DF, + 0xF2D3, 0x85E3, 0xF2D4, 0x85DC, 0xF2D5, 0x85D1, 0xF2D6, 0x85F0, 0xF2D7, 0x85E6, 0xF2D8, 0x85EF, 0xF2D9, 0x85DE, 0xF2DA, 0x85E2, + 0xF2DB, 0x8800, 0xF2DC, 0x87FA, 0xF2DD, 0x8803, 0xF2DE, 0x87F6, 0xF2DF, 0x87F7, 0xF2E0, 0x8809, 0xF2E1, 0x880C, 0xF2E2, 0x880B, + 0xF2E3, 0x8806, 0xF2E4, 0x87FC, 0xF2E5, 0x8808, 0xF2E6, 0x87FF, 0xF2E7, 0x880A, 0xF2E8, 0x8802, 0xF2E9, 0x8962, 0xF2EA, 0x895A, + 0xF2EB, 0x895B, 0xF2EC, 0x8957, 0xF2ED, 0x8961, 0xF2EE, 0x895C, 0xF2EF, 0x8958, 0xF2F0, 0x895D, 0xF2F1, 0x8959, 0xF2F2, 0x8988, + 0xF2F3, 0x89B7, 0xF2F4, 0x89B6, 0xF2F5, 0x89F6, 0xF2F6, 0x8B50, 0xF2F7, 0x8B48, 0xF2F8, 0x8B4A, 0xF2F9, 0x8B40, 0xF2FA, 0x8B53, + 0xF2FB, 0x8B56, 0xF2FC, 0x8B54, 0xF2FD, 0x8B4B, 0xF2FE, 0x8B55, 0xF340, 0x8B51, 0xF341, 0x8B42, 0xF342, 0x8B52, 0xF343, 0x8B57, + 0xF344, 0x8C43, 0xF345, 0x8C77, 0xF346, 0x8C76, 0xF347, 0x8C9A, 0xF348, 0x8D06, 0xF349, 0x8D07, 0xF34A, 0x8D09, 0xF34B, 0x8DAC, + 0xF34C, 0x8DAA, 0xF34D, 0x8DAD, 0xF34E, 0x8DAB, 0xF34F, 0x8E6D, 0xF350, 0x8E78, 0xF351, 0x8E73, 0xF352, 0x8E6A, 0xF353, 0x8E6F, + 0xF354, 0x8E7B, 0xF355, 0x8EC2, 0xF356, 0x8F52, 0xF357, 0x8F51, 0xF358, 0x8F4F, 0xF359, 0x8F50, 0xF35A, 0x8F53, 0xF35B, 0x8FB4, + 0xF35C, 0x9140, 0xF35D, 0x913F, 0xF35E, 0x91B0, 0xF35F, 0x91AD, 0xF360, 0x93DE, 0xF361, 0x93C7, 0xF362, 0x93CF, 0xF363, 0x93C2, + 0xF364, 0x93DA, 0xF365, 0x93D0, 0xF366, 0x93F9, 0xF367, 0x93EC, 0xF368, 0x93CC, 0xF369, 0x93D9, 0xF36A, 0x93A9, 0xF36B, 0x93E6, + 0xF36C, 0x93CA, 0xF36D, 0x93D4, 0xF36E, 0x93EE, 0xF36F, 0x93E3, 0xF370, 0x93D5, 0xF371, 0x93C4, 0xF372, 0x93CE, 0xF373, 0x93C0, + 0xF374, 0x93D2, 0xF375, 0x93E7, 0xF376, 0x957D, 0xF377, 0x95DA, 0xF378, 0x95DB, 0xF379, 0x96E1, 0xF37A, 0x9729, 0xF37B, 0x972B, + 0xF37C, 0x972C, 0xF37D, 0x9728, 0xF37E, 0x9726, 0xF3A1, 0x97B3, 0xF3A2, 0x97B7, 0xF3A3, 0x97B6, 0xF3A4, 0x97DD, 0xF3A5, 0x97DE, + 0xF3A6, 0x97DF, 0xF3A7, 0x985C, 0xF3A8, 0x9859, 0xF3A9, 0x985D, 0xF3AA, 0x9857, 0xF3AB, 0x98BF, 0xF3AC, 0x98BD, 0xF3AD, 0x98BB, + 0xF3AE, 0x98BE, 0xF3AF, 0x9948, 0xF3B0, 0x9947, 0xF3B1, 0x9943, 0xF3B2, 0x99A6, 0xF3B3, 0x99A7, 0xF3B4, 0x9A1A, 0xF3B5, 0x9A15, + 0xF3B6, 0x9A25, 0xF3B7, 0x9A1D, 0xF3B8, 0x9A24, 0xF3B9, 0x9A1B, 0xF3BA, 0x9A22, 0xF3BB, 0x9A20, 0xF3BC, 0x9A27, 0xF3BD, 0x9A23, + 0xF3BE, 0x9A1E, 0xF3BF, 0x9A1C, 0xF3C0, 0x9A14, 0xF3C1, 0x9AC2, 0xF3C2, 0x9B0B, 0xF3C3, 0x9B0A, 0xF3C4, 0x9B0E, 0xF3C5, 0x9B0C, + 0xF3C6, 0x9B37, 0xF3C7, 0x9BEA, 0xF3C8, 0x9BEB, 0xF3C9, 0x9BE0, 0xF3CA, 0x9BDE, 0xF3CB, 0x9BE4, 0xF3CC, 0x9BE6, 0xF3CD, 0x9BE2, + 0xF3CE, 0x9BF0, 0xF3CF, 0x9BD4, 0xF3D0, 0x9BD7, 0xF3D1, 0x9BEC, 0xF3D2, 0x9BDC, 0xF3D3, 0x9BD9, 0xF3D4, 0x9BE5, 0xF3D5, 0x9BD5, + 0xF3D6, 0x9BE1, 0xF3D7, 0x9BDA, 0xF3D8, 0x9D77, 0xF3D9, 0x9D81, 0xF3DA, 0x9D8A, 0xF3DB, 0x9D84, 0xF3DC, 0x9D88, 0xF3DD, 0x9D71, + 0xF3DE, 0x9D80, 0xF3DF, 0x9D78, 0xF3E0, 0x9D86, 0xF3E1, 0x9D8B, 0xF3E2, 0x9D8C, 0xF3E3, 0x9D7D, 0xF3E4, 0x9D6B, 0xF3E5, 0x9D74, + 0xF3E6, 0x9D75, 0xF3E7, 0x9D70, 0xF3E8, 0x9D69, 0xF3E9, 0x9D85, 0xF3EA, 0x9D73, 0xF3EB, 0x9D7B, 0xF3EC, 0x9D82, 0xF3ED, 0x9D6F, + 0xF3EE, 0x9D79, 0xF3EF, 0x9D7F, 0xF3F0, 0x9D87, 0xF3F1, 0x9D68, 0xF3F2, 0x9E94, 0xF3F3, 0x9E91, 0xF3F4, 0x9EC0, 0xF3F5, 0x9EFC, + 0xF3F6, 0x9F2D, 0xF3F7, 0x9F40, 0xF3F8, 0x9F41, 0xF3F9, 0x9F4D, 0xF3FA, 0x9F56, 0xF3FB, 0x9F57, 0xF3FC, 0x9F58, 0xF3FD, 0x5337, + 0xF3FE, 0x56B2, 0xF440, 0x56B5, 0xF441, 0x56B3, 0xF442, 0x58E3, 0xF443, 0x5B45, 0xF444, 0x5DC6, 0xF445, 0x5DC7, 0xF446, 0x5EEE, + 0xF447, 0x5EEF, 0xF448, 0x5FC0, 0xF449, 0x5FC1, 0xF44A, 0x61F9, 0xF44B, 0x6517, 0xF44C, 0x6516, 0xF44D, 0x6515, 0xF44E, 0x6513, + 0xF44F, 0x65DF, 0xF450, 0x66E8, 0xF451, 0x66E3, 0xF452, 0x66E4, 0xF453, 0x6AF3, 0xF454, 0x6AF0, 0xF455, 0x6AEA, 0xF456, 0x6AE8, + 0xF457, 0x6AF9, 0xF458, 0x6AF1, 0xF459, 0x6AEE, 0xF45A, 0x6AEF, 0xF45B, 0x703C, 0xF45C, 0x7035, 0xF45D, 0x702F, 0xF45E, 0x7037, + 0xF45F, 0x7034, 0xF460, 0x7031, 0xF461, 0x7042, 0xF462, 0x7038, 0xF463, 0x703F, 0xF464, 0x703A, 0xF465, 0x7039, 0xF466, 0x7040, + 0xF467, 0x703B, 0xF468, 0x7033, 0xF469, 0x7041, 0xF46A, 0x7213, 0xF46B, 0x7214, 0xF46C, 0x72A8, 0xF46D, 0x737D, 0xF46E, 0x737C, + 0xF46F, 0x74BA, 0xF470, 0x76AB, 0xF471, 0x76AA, 0xF472, 0x76BE, 0xF473, 0x76ED, 0xF474, 0x77CC, 0xF475, 0x77CE, 0xF476, 0x77CF, + 0xF477, 0x77CD, 0xF478, 0x77F2, 0xF479, 0x7925, 0xF47A, 0x7923, 0xF47B, 0x7927, 0xF47C, 0x7928, 0xF47D, 0x7924, 0xF47E, 0x7929, + 0xF4A1, 0x79B2, 0xF4A2, 0x7A6E, 0xF4A3, 0x7A6C, 0xF4A4, 0x7A6D, 0xF4A5, 0x7AF7, 0xF4A6, 0x7C49, 0xF4A7, 0x7C48, 0xF4A8, 0x7C4A, + 0xF4A9, 0x7C47, 0xF4AA, 0x7C45, 0xF4AB, 0x7CEE, 0xF4AC, 0x7E7B, 0xF4AD, 0x7E7E, 0xF4AE, 0x7E81, 0xF4AF, 0x7E80, 0xF4B0, 0x7FBA, + 0xF4B1, 0x7FFF, 0xF4B2, 0x8079, 0xF4B3, 0x81DB, 0xF4B4, 0x81D9, 0xF4B5, 0x820B, 0xF4B6, 0x8268, 0xF4B7, 0x8269, 0xF4B8, 0x8622, + 0xF4B9, 0x85FF, 0xF4BA, 0x8601, 0xF4BB, 0x85FE, 0xF4BC, 0x861B, 0xF4BD, 0x8600, 0xF4BE, 0x85F6, 0xF4BF, 0x8604, 0xF4C0, 0x8609, + 0xF4C1, 0x8605, 0xF4C2, 0x860C, 0xF4C3, 0x85FD, 0xF4C4, 0x8819, 0xF4C5, 0x8810, 0xF4C6, 0x8811, 0xF4C7, 0x8817, 0xF4C8, 0x8813, + 0xF4C9, 0x8816, 0xF4CA, 0x8963, 0xF4CB, 0x8966, 0xF4CC, 0x89B9, 0xF4CD, 0x89F7, 0xF4CE, 0x8B60, 0xF4CF, 0x8B6A, 0xF4D0, 0x8B5D, + 0xF4D1, 0x8B68, 0xF4D2, 0x8B63, 0xF4D3, 0x8B65, 0xF4D4, 0x8B67, 0xF4D5, 0x8B6D, 0xF4D6, 0x8DAE, 0xF4D7, 0x8E86, 0xF4D8, 0x8E88, + 0xF4D9, 0x8E84, 0xF4DA, 0x8F59, 0xF4DB, 0x8F56, 0xF4DC, 0x8F57, 0xF4DD, 0x8F55, 0xF4DE, 0x8F58, 0xF4DF, 0x8F5A, 0xF4E0, 0x908D, + 0xF4E1, 0x9143, 0xF4E2, 0x9141, 0xF4E3, 0x91B7, 0xF4E4, 0x91B5, 0xF4E5, 0x91B2, 0xF4E6, 0x91B3, 0xF4E7, 0x940B, 0xF4E8, 0x9413, + 0xF4E9, 0x93FB, 0xF4EA, 0x9420, 0xF4EB, 0x940F, 0xF4EC, 0x9414, 0xF4ED, 0x93FE, 0xF4EE, 0x9415, 0xF4EF, 0x9410, 0xF4F0, 0x9428, + 0xF4F1, 0x9419, 0xF4F2, 0x940D, 0xF4F3, 0x93F5, 0xF4F4, 0x9400, 0xF4F5, 0x93F7, 0xF4F6, 0x9407, 0xF4F7, 0x940E, 0xF4F8, 0x9416, + 0xF4F9, 0x9412, 0xF4FA, 0x93FA, 0xF4FB, 0x9409, 0xF4FC, 0x93F8, 0xF4FD, 0x940A, 0xF4FE, 0x93FF, 0xF540, 0x93FC, 0xF541, 0x940C, + 0xF542, 0x93F6, 0xF543, 0x9411, 0xF544, 0x9406, 0xF545, 0x95DE, 0xF546, 0x95E0, 0xF547, 0x95DF, 0xF548, 0x972E, 0xF549, 0x972F, + 0xF54A, 0x97B9, 0xF54B, 0x97BB, 0xF54C, 0x97FD, 0xF54D, 0x97FE, 0xF54E, 0x9860, 0xF54F, 0x9862, 0xF550, 0x9863, 0xF551, 0x985F, + 0xF552, 0x98C1, 0xF553, 0x98C2, 0xF554, 0x9950, 0xF555, 0x994E, 0xF556, 0x9959, 0xF557, 0x994C, 0xF558, 0x994B, 0xF559, 0x9953, + 0xF55A, 0x9A32, 0xF55B, 0x9A34, 0xF55C, 0x9A31, 0xF55D, 0x9A2C, 0xF55E, 0x9A2A, 0xF55F, 0x9A36, 0xF560, 0x9A29, 0xF561, 0x9A2E, + 0xF562, 0x9A38, 0xF563, 0x9A2D, 0xF564, 0x9AC7, 0xF565, 0x9ACA, 0xF566, 0x9AC6, 0xF567, 0x9B10, 0xF568, 0x9B12, 0xF569, 0x9B11, + 0xF56A, 0x9C0B, 0xF56B, 0x9C08, 0xF56C, 0x9BF7, 0xF56D, 0x9C05, 0xF56E, 0x9C12, 0xF56F, 0x9BF8, 0xF570, 0x9C40, 0xF571, 0x9C07, + 0xF572, 0x9C0E, 0xF573, 0x9C06, 0xF574, 0x9C17, 0xF575, 0x9C14, 0xF576, 0x9C09, 0xF577, 0x9D9F, 0xF578, 0x9D99, 0xF579, 0x9DA4, + 0xF57A, 0x9D9D, 0xF57B, 0x9D92, 0xF57C, 0x9D98, 0xF57D, 0x9D90, 0xF57E, 0x9D9B, 0xF5A1, 0x9DA0, 0xF5A2, 0x9D94, 0xF5A3, 0x9D9C, + 0xF5A4, 0x9DAA, 0xF5A5, 0x9D97, 0xF5A6, 0x9DA1, 0xF5A7, 0x9D9A, 0xF5A8, 0x9DA2, 0xF5A9, 0x9DA8, 0xF5AA, 0x9D9E, 0xF5AB, 0x9DA3, + 0xF5AC, 0x9DBF, 0xF5AD, 0x9DA9, 0xF5AE, 0x9D96, 0xF5AF, 0x9DA6, 0xF5B0, 0x9DA7, 0xF5B1, 0x9E99, 0xF5B2, 0x9E9B, 0xF5B3, 0x9E9A, + 0xF5B4, 0x9EE5, 0xF5B5, 0x9EE4, 0xF5B6, 0x9EE7, 0xF5B7, 0x9EE6, 0xF5B8, 0x9F30, 0xF5B9, 0x9F2E, 0xF5BA, 0x9F5B, 0xF5BB, 0x9F60, + 0xF5BC, 0x9F5E, 0xF5BD, 0x9F5D, 0xF5BE, 0x9F59, 0xF5BF, 0x9F91, 0xF5C0, 0x513A, 0xF5C1, 0x5139, 0xF5C2, 0x5298, 0xF5C3, 0x5297, + 0xF5C4, 0x56C3, 0xF5C5, 0x56BD, 0xF5C6, 0x56BE, 0xF5C7, 0x5B48, 0xF5C8, 0x5B47, 0xF5C9, 0x5DCB, 0xF5CA, 0x5DCF, 0xF5CB, 0x5EF1, + 0xF5CC, 0x61FD, 0xF5CD, 0x651B, 0xF5CE, 0x6B02, 0xF5CF, 0x6AFC, 0xF5D0, 0x6B03, 0xF5D1, 0x6AF8, 0xF5D2, 0x6B00, 0xF5D3, 0x7043, + 0xF5D4, 0x7044, 0xF5D5, 0x704A, 0xF5D6, 0x7048, 0xF5D7, 0x7049, 0xF5D8, 0x7045, 0xF5D9, 0x7046, 0xF5DA, 0x721D, 0xF5DB, 0x721A, + 0xF5DC, 0x7219, 0xF5DD, 0x737E, 0xF5DE, 0x7517, 0xF5DF, 0x766A, 0xF5E0, 0x77D0, 0xF5E1, 0x792D, 0xF5E2, 0x7931, 0xF5E3, 0x792F, + 0xF5E4, 0x7C54, 0xF5E5, 0x7C53, 0xF5E6, 0x7CF2, 0xF5E7, 0x7E8A, 0xF5E8, 0x7E87, 0xF5E9, 0x7E88, 0xF5EA, 0x7E8B, 0xF5EB, 0x7E86, + 0xF5EC, 0x7E8D, 0xF5ED, 0x7F4D, 0xF5EE, 0x7FBB, 0xF5EF, 0x8030, 0xF5F0, 0x81DD, 0xF5F1, 0x8618, 0xF5F2, 0x862A, 0xF5F3, 0x8626, + 0xF5F4, 0x861F, 0xF5F5, 0x8623, 0xF5F6, 0x861C, 0xF5F7, 0x8619, 0xF5F8, 0x8627, 0xF5F9, 0x862E, 0xF5FA, 0x8621, 0xF5FB, 0x8620, + 0xF5FC, 0x8629, 0xF5FD, 0x861E, 0xF5FE, 0x8625, 0xF640, 0x8829, 0xF641, 0x881D, 0xF642, 0x881B, 0xF643, 0x8820, 0xF644, 0x8824, + 0xF645, 0x881C, 0xF646, 0x882B, 0xF647, 0x884A, 0xF648, 0x896D, 0xF649, 0x8969, 0xF64A, 0x896E, 0xF64B, 0x896B, 0xF64C, 0x89FA, + 0xF64D, 0x8B79, 0xF64E, 0x8B78, 0xF64F, 0x8B45, 0xF650, 0x8B7A, 0xF651, 0x8B7B, 0xF652, 0x8D10, 0xF653, 0x8D14, 0xF654, 0x8DAF, + 0xF655, 0x8E8E, 0xF656, 0x8E8C, 0xF657, 0x8F5E, 0xF658, 0x8F5B, 0xF659, 0x8F5D, 0xF65A, 0x9146, 0xF65B, 0x9144, 0xF65C, 0x9145, + 0xF65D, 0x91B9, 0xF65E, 0x943F, 0xF65F, 0x943B, 0xF660, 0x9436, 0xF661, 0x9429, 0xF662, 0x943D, 0xF663, 0x943C, 0xF664, 0x9430, + 0xF665, 0x9439, 0xF666, 0x942A, 0xF667, 0x9437, 0xF668, 0x942C, 0xF669, 0x9440, 0xF66A, 0x9431, 0xF66B, 0x95E5, 0xF66C, 0x95E4, + 0xF66D, 0x95E3, 0xF66E, 0x9735, 0xF66F, 0x973A, 0xF670, 0x97BF, 0xF671, 0x97E1, 0xF672, 0x9864, 0xF673, 0x98C9, 0xF674, 0x98C6, + 0xF675, 0x98C0, 0xF676, 0x9958, 0xF677, 0x9956, 0xF678, 0x9A39, 0xF679, 0x9A3D, 0xF67A, 0x9A46, 0xF67B, 0x9A44, 0xF67C, 0x9A42, + 0xF67D, 0x9A41, 0xF67E, 0x9A3A, 0xF6A1, 0x9A3F, 0xF6A2, 0x9ACD, 0xF6A3, 0x9B15, 0xF6A4, 0x9B17, 0xF6A5, 0x9B18, 0xF6A6, 0x9B16, + 0xF6A7, 0x9B3A, 0xF6A8, 0x9B52, 0xF6A9, 0x9C2B, 0xF6AA, 0x9C1D, 0xF6AB, 0x9C1C, 0xF6AC, 0x9C2C, 0xF6AD, 0x9C23, 0xF6AE, 0x9C28, + 0xF6AF, 0x9C29, 0xF6B0, 0x9C24, 0xF6B1, 0x9C21, 0xF6B2, 0x9DB7, 0xF6B3, 0x9DB6, 0xF6B4, 0x9DBC, 0xF6B5, 0x9DC1, 0xF6B6, 0x9DC7, + 0xF6B7, 0x9DCA, 0xF6B8, 0x9DCF, 0xF6B9, 0x9DBE, 0xF6BA, 0x9DC5, 0xF6BB, 0x9DC3, 0xF6BC, 0x9DBB, 0xF6BD, 0x9DB5, 0xF6BE, 0x9DCE, + 0xF6BF, 0x9DB9, 0xF6C0, 0x9DBA, 0xF6C1, 0x9DAC, 0xF6C2, 0x9DC8, 0xF6C3, 0x9DB1, 0xF6C4, 0x9DAD, 0xF6C5, 0x9DCC, 0xF6C6, 0x9DB3, + 0xF6C7, 0x9DCD, 0xF6C8, 0x9DB2, 0xF6C9, 0x9E7A, 0xF6CA, 0x9E9C, 0xF6CB, 0x9EEB, 0xF6CC, 0x9EEE, 0xF6CD, 0x9EED, 0xF6CE, 0x9F1B, + 0xF6CF, 0x9F18, 0xF6D0, 0x9F1A, 0xF6D1, 0x9F31, 0xF6D2, 0x9F4E, 0xF6D3, 0x9F65, 0xF6D4, 0x9F64, 0xF6D5, 0x9F92, 0xF6D6, 0x4EB9, + 0xF6D7, 0x56C6, 0xF6D8, 0x56C5, 0xF6D9, 0x56CB, 0xF6DA, 0x5971, 0xF6DB, 0x5B4B, 0xF6DC, 0x5B4C, 0xF6DD, 0x5DD5, 0xF6DE, 0x5DD1, + 0xF6DF, 0x5EF2, 0xF6E0, 0x6521, 0xF6E1, 0x6520, 0xF6E2, 0x6526, 0xF6E3, 0x6522, 0xF6E4, 0x6B0B, 0xF6E5, 0x6B08, 0xF6E6, 0x6B09, + 0xF6E7, 0x6C0D, 0xF6E8, 0x7055, 0xF6E9, 0x7056, 0xF6EA, 0x7057, 0xF6EB, 0x7052, 0xF6EC, 0x721E, 0xF6ED, 0x721F, 0xF6EE, 0x72A9, + 0xF6EF, 0x737F, 0xF6F0, 0x74D8, 0xF6F1, 0x74D5, 0xF6F2, 0x74D9, 0xF6F3, 0x74D7, 0xF6F4, 0x766D, 0xF6F5, 0x76AD, 0xF6F6, 0x7935, + 0xF6F7, 0x79B4, 0xF6F8, 0x7A70, 0xF6F9, 0x7A71, 0xF6FA, 0x7C57, 0xF6FB, 0x7C5C, 0xF6FC, 0x7C59, 0xF6FD, 0x7C5B, 0xF6FE, 0x7C5A, + 0xF740, 0x7CF4, 0xF741, 0x7CF1, 0xF742, 0x7E91, 0xF743, 0x7F4F, 0xF744, 0x7F87, 0xF745, 0x81DE, 0xF746, 0x826B, 0xF747, 0x8634, + 0xF748, 0x8635, 0xF749, 0x8633, 0xF74A, 0x862C, 0xF74B, 0x8632, 0xF74C, 0x8636, 0xF74D, 0x882C, 0xF74E, 0x8828, 0xF74F, 0x8826, + 0xF750, 0x882A, 0xF751, 0x8825, 0xF752, 0x8971, 0xF753, 0x89BF, 0xF754, 0x89BE, 0xF755, 0x89FB, 0xF756, 0x8B7E, 0xF757, 0x8B84, + 0xF758, 0x8B82, 0xF759, 0x8B86, 0xF75A, 0x8B85, 0xF75B, 0x8B7F, 0xF75C, 0x8D15, 0xF75D, 0x8E95, 0xF75E, 0x8E94, 0xF75F, 0x8E9A, + 0xF760, 0x8E92, 0xF761, 0x8E90, 0xF762, 0x8E96, 0xF763, 0x8E97, 0xF764, 0x8F60, 0xF765, 0x8F62, 0xF766, 0x9147, 0xF767, 0x944C, + 0xF768, 0x9450, 0xF769, 0x944A, 0xF76A, 0x944B, 0xF76B, 0x944F, 0xF76C, 0x9447, 0xF76D, 0x9445, 0xF76E, 0x9448, 0xF76F, 0x9449, + 0xF770, 0x9446, 0xF771, 0x973F, 0xF772, 0x97E3, 0xF773, 0x986A, 0xF774, 0x9869, 0xF775, 0x98CB, 0xF776, 0x9954, 0xF777, 0x995B, + 0xF778, 0x9A4E, 0xF779, 0x9A53, 0xF77A, 0x9A54, 0xF77B, 0x9A4C, 0xF77C, 0x9A4F, 0xF77D, 0x9A48, 0xF77E, 0x9A4A, 0xF7A1, 0x9A49, + 0xF7A2, 0x9A52, 0xF7A3, 0x9A50, 0xF7A4, 0x9AD0, 0xF7A5, 0x9B19, 0xF7A6, 0x9B2B, 0xF7A7, 0x9B3B, 0xF7A8, 0x9B56, 0xF7A9, 0x9B55, + 0xF7AA, 0x9C46, 0xF7AB, 0x9C48, 0xF7AC, 0x9C3F, 0xF7AD, 0x9C44, 0xF7AE, 0x9C39, 0xF7AF, 0x9C33, 0xF7B0, 0x9C41, 0xF7B1, 0x9C3C, + 0xF7B2, 0x9C37, 0xF7B3, 0x9C34, 0xF7B4, 0x9C32, 0xF7B5, 0x9C3D, 0xF7B6, 0x9C36, 0xF7B7, 0x9DDB, 0xF7B8, 0x9DD2, 0xF7B9, 0x9DDE, + 0xF7BA, 0x9DDA, 0xF7BB, 0x9DCB, 0xF7BC, 0x9DD0, 0xF7BD, 0x9DDC, 0xF7BE, 0x9DD1, 0xF7BF, 0x9DDF, 0xF7C0, 0x9DE9, 0xF7C1, 0x9DD9, + 0xF7C2, 0x9DD8, 0xF7C3, 0x9DD6, 0xF7C4, 0x9DF5, 0xF7C5, 0x9DD5, 0xF7C6, 0x9DDD, 0xF7C7, 0x9EB6, 0xF7C8, 0x9EF0, 0xF7C9, 0x9F35, + 0xF7CA, 0x9F33, 0xF7CB, 0x9F32, 0xF7CC, 0x9F42, 0xF7CD, 0x9F6B, 0xF7CE, 0x9F95, 0xF7CF, 0x9FA2, 0xF7D0, 0x513D, 0xF7D1, 0x5299, + 0xF7D2, 0x58E8, 0xF7D3, 0x58E7, 0xF7D4, 0x5972, 0xF7D5, 0x5B4D, 0xF7D6, 0x5DD8, 0xF7D7, 0x882F, 0xF7D8, 0x5F4F, 0xF7D9, 0x6201, + 0xF7DA, 0x6203, 0xF7DB, 0x6204, 0xF7DC, 0x6529, 0xF7DD, 0x6525, 0xF7DE, 0x6596, 0xF7DF, 0x66EB, 0xF7E0, 0x6B11, 0xF7E1, 0x6B12, + 0xF7E2, 0x6B0F, 0xF7E3, 0x6BCA, 0xF7E4, 0x705B, 0xF7E5, 0x705A, 0xF7E6, 0x7222, 0xF7E7, 0x7382, 0xF7E8, 0x7381, 0xF7E9, 0x7383, + 0xF7EA, 0x7670, 0xF7EB, 0x77D4, 0xF7EC, 0x7C67, 0xF7ED, 0x7C66, 0xF7EE, 0x7E95, 0xF7EF, 0x826C, 0xF7F0, 0x863A, 0xF7F1, 0x8640, + 0xF7F2, 0x8639, 0xF7F3, 0x863C, 0xF7F4, 0x8631, 0xF7F5, 0x863B, 0xF7F6, 0x863E, 0xF7F7, 0x8830, 0xF7F8, 0x8832, 0xF7F9, 0x882E, + 0xF7FA, 0x8833, 0xF7FB, 0x8976, 0xF7FC, 0x8974, 0xF7FD, 0x8973, 0xF7FE, 0x89FE, 0xF840, 0x8B8C, 0xF841, 0x8B8E, 0xF842, 0x8B8B, + 0xF843, 0x8B88, 0xF844, 0x8C45, 0xF845, 0x8D19, 0xF846, 0x8E98, 0xF847, 0x8F64, 0xF848, 0x8F63, 0xF849, 0x91BC, 0xF84A, 0x9462, + 0xF84B, 0x9455, 0xF84C, 0x945D, 0xF84D, 0x9457, 0xF84E, 0x945E, 0xF84F, 0x97C4, 0xF850, 0x97C5, 0xF851, 0x9800, 0xF852, 0x9A56, + 0xF853, 0x9A59, 0xF854, 0x9B1E, 0xF855, 0x9B1F, 0xF856, 0x9B20, 0xF857, 0x9C52, 0xF858, 0x9C58, 0xF859, 0x9C50, 0xF85A, 0x9C4A, + 0xF85B, 0x9C4D, 0xF85C, 0x9C4B, 0xF85D, 0x9C55, 0xF85E, 0x9C59, 0xF85F, 0x9C4C, 0xF860, 0x9C4E, 0xF861, 0x9DFB, 0xF862, 0x9DF7, + 0xF863, 0x9DEF, 0xF864, 0x9DE3, 0xF865, 0x9DEB, 0xF866, 0x9DF8, 0xF867, 0x9DE4, 0xF868, 0x9DF6, 0xF869, 0x9DE1, 0xF86A, 0x9DEE, + 0xF86B, 0x9DE6, 0xF86C, 0x9DF2, 0xF86D, 0x9DF0, 0xF86E, 0x9DE2, 0xF86F, 0x9DEC, 0xF870, 0x9DF4, 0xF871, 0x9DF3, 0xF872, 0x9DE8, + 0xF873, 0x9DED, 0xF874, 0x9EC2, 0xF875, 0x9ED0, 0xF876, 0x9EF2, 0xF877, 0x9EF3, 0xF878, 0x9F06, 0xF879, 0x9F1C, 0xF87A, 0x9F38, + 0xF87B, 0x9F37, 0xF87C, 0x9F36, 0xF87D, 0x9F43, 0xF87E, 0x9F4F, 0xF8A1, 0x9F71, 0xF8A2, 0x9F70, 0xF8A3, 0x9F6E, 0xF8A4, 0x9F6F, + 0xF8A5, 0x56D3, 0xF8A6, 0x56CD, 0xF8A7, 0x5B4E, 0xF8A8, 0x5C6D, 0xF8A9, 0x652D, 0xF8AA, 0x66ED, 0xF8AB, 0x66EE, 0xF8AC, 0x6B13, + 0xF8AD, 0x705F, 0xF8AE, 0x7061, 0xF8AF, 0x705D, 0xF8B0, 0x7060, 0xF8B1, 0x7223, 0xF8B2, 0x74DB, 0xF8B3, 0x74E5, 0xF8B4, 0x77D5, + 0xF8B5, 0x7938, 0xF8B6, 0x79B7, 0xF8B7, 0x79B6, 0xF8B8, 0x7C6A, 0xF8B9, 0x7E97, 0xF8BA, 0x7F89, 0xF8BB, 0x826D, 0xF8BC, 0x8643, + 0xF8BD, 0x8838, 0xF8BE, 0x8837, 0xF8BF, 0x8835, 0xF8C0, 0x884B, 0xF8C1, 0x8B94, 0xF8C2, 0x8B95, 0xF8C3, 0x8E9E, 0xF8C4, 0x8E9F, + 0xF8C5, 0x8EA0, 0xF8C6, 0x8E9D, 0xF8C7, 0x91BE, 0xF8C8, 0x91BD, 0xF8C9, 0x91C2, 0xF8CA, 0x946B, 0xF8CB, 0x9468, 0xF8CC, 0x9469, + 0xF8CD, 0x96E5, 0xF8CE, 0x9746, 0xF8CF, 0x9743, 0xF8D0, 0x9747, 0xF8D1, 0x97C7, 0xF8D2, 0x97E5, 0xF8D3, 0x9A5E, 0xF8D4, 0x9AD5, + 0xF8D5, 0x9B59, 0xF8D6, 0x9C63, 0xF8D7, 0x9C67, 0xF8D8, 0x9C66, 0xF8D9, 0x9C62, 0xF8DA, 0x9C5E, 0xF8DB, 0x9C60, 0xF8DC, 0x9E02, + 0xF8DD, 0x9DFE, 0xF8DE, 0x9E07, 0xF8DF, 0x9E03, 0xF8E0, 0x9E06, 0xF8E1, 0x9E05, 0xF8E2, 0x9E00, 0xF8E3, 0x9E01, 0xF8E4, 0x9E09, + 0xF8E5, 0x9DFF, 0xF8E6, 0x9DFD, 0xF8E7, 0x9E04, 0xF8E8, 0x9EA0, 0xF8E9, 0x9F1E, 0xF8EA, 0x9F46, 0xF8EB, 0x9F74, 0xF8EC, 0x9F75, + 0xF8ED, 0x9F76, 0xF8EE, 0x56D4, 0xF8EF, 0x652E, 0xF8F0, 0x65B8, 0xF8F1, 0x6B18, 0xF8F2, 0x6B19, 0xF8F3, 0x6B17, 0xF8F4, 0x6B1A, + 0xF8F5, 0x7062, 0xF8F6, 0x7226, 0xF8F7, 0x72AA, 0xF8F8, 0x77D8, 0xF8F9, 0x77D9, 0xF8FA, 0x7939, 0xF8FB, 0x7C69, 0xF8FC, 0x7C6B, + 0xF8FD, 0x7CF6, 0xF8FE, 0x7E9A, 0xF940, 0x7E98, 0xF941, 0x7E9B, 0xF942, 0x7E99, 0xF943, 0x81E0, 0xF944, 0x81E1, 0xF945, 0x8646, + 0xF946, 0x8647, 0xF947, 0x8648, 0xF948, 0x8979, 0xF949, 0x897A, 0xF94A, 0x897C, 0xF94B, 0x897B, 0xF94C, 0x89FF, 0xF94D, 0x8B98, + 0xF94E, 0x8B99, 0xF94F, 0x8EA5, 0xF950, 0x8EA4, 0xF951, 0x8EA3, 0xF952, 0x946E, 0xF953, 0x946D, 0xF954, 0x946F, 0xF955, 0x9471, + 0xF956, 0x9473, 0xF957, 0x9749, 0xF958, 0x9872, 0xF959, 0x995F, 0xF95A, 0x9C68, 0xF95B, 0x9C6E, 0xF95C, 0x9C6D, 0xF95D, 0x9E0B, + 0xF95E, 0x9E0D, 0xF95F, 0x9E10, 0xF960, 0x9E0F, 0xF961, 0x9E12, 0xF962, 0x9E11, 0xF963, 0x9EA1, 0xF964, 0x9EF5, 0xF965, 0x9F09, + 0xF966, 0x9F47, 0xF967, 0x9F78, 0xF968, 0x9F7B, 0xF969, 0x9F7A, 0xF96A, 0x9F79, 0xF96B, 0x571E, 0xF96C, 0x7066, 0xF96D, 0x7C6F, + 0xF96E, 0x883C, 0xF96F, 0x8DB2, 0xF970, 0x8EA6, 0xF971, 0x91C3, 0xF972, 0x9474, 0xF973, 0x9478, 0xF974, 0x9476, 0xF975, 0x9475, + 0xF976, 0x9A60, 0xF977, 0x9C74, 0xF978, 0x9C73, 0xF979, 0x9C71, 0xF97A, 0x9C75, 0xF97B, 0x9E14, 0xF97C, 0x9E13, 0xF97D, 0x9EF6, + 0xF97E, 0x9F0A, 0xF9A1, 0x9FA4, 0xF9A2, 0x7068, 0xF9A3, 0x7065, 0xF9A4, 0x7CF7, 0xF9A5, 0x866A, 0xF9A6, 0x883E, 0xF9A7, 0x883D, + 0xF9A8, 0x883F, 0xF9A9, 0x8B9E, 0xF9AA, 0x8C9C, 0xF9AB, 0x8EA9, 0xF9AC, 0x8EC9, 0xF9AD, 0x974B, 0xF9AE, 0x9873, 0xF9AF, 0x9874, + 0xF9B0, 0x98CC, 0xF9B1, 0x9961, 0xF9B2, 0x99AB, 0xF9B3, 0x9A64, 0xF9B4, 0x9A66, 0xF9B5, 0x9A67, 0xF9B6, 0x9B24, 0xF9B7, 0x9E15, + 0xF9B8, 0x9E17, 0xF9B9, 0x9F48, 0xF9BA, 0x6207, 0xF9BB, 0x6B1E, 0xF9BC, 0x7227, 0xF9BD, 0x864C, 0xF9BE, 0x8EA8, 0xF9BF, 0x9482, + 0xF9C0, 0x9480, 0xF9C1, 0x9481, 0xF9C2, 0x9A69, 0xF9C3, 0x9A68, 0xF9C4, 0x9B2E, 0xF9C5, 0x9E19, 0xF9C6, 0x7229, 0xF9C7, 0x864B, + 0xF9C8, 0x8B9F, 0xF9C9, 0x9483, 0xF9CA, 0x9C79, 0xF9CB, 0x9EB7, 0xF9CC, 0x7675, 0xF9CD, 0x9A6B, 0xF9CE, 0x9C7A, 0xF9CF, 0x9E1D, + 0xF9D0, 0x7069, 0xF9D1, 0x706A, 0xF9D2, 0x9EA4, 0xF9D3, 0x9F7E, 0xF9D4, 0x9F49, 0xF9D5, 0x9F98, 0xF9D6, 0x7881, 0xF9D7, 0x92B9, + 0xF9D8, 0x88CF, 0xF9D9, 0x58BB, 0xF9DA, 0x6052, 0xF9DB, 0x7CA7, 0xF9DC, 0x5AFA, 0xF9DD, 0x2554, 0xF9DE, 0x2566, 0xF9DF, 0x2557, + 0xF9E0, 0x2560, 0xF9E1, 0x256C, 0xF9E2, 0x2563, 0xF9E3, 0x255A, 0xF9E4, 0x2569, 0xF9E5, 0x255D, 0xF9E6, 0x2552, 0xF9E7, 0x2564, + 0xF9E8, 0x2555, 0xF9E9, 0x255E, 0xF9EA, 0x256A, 0xF9EB, 0x2561, 0xF9EC, 0x2558, 0xF9ED, 0x2567, 0xF9EE, 0x255B, 0xF9EF, 0x2553, + 0xF9F0, 0x2565, 0xF9F1, 0x2556, 0xF9F2, 0x255F, 0xF9F3, 0x256B, 0xF9F4, 0x2562, 0xF9F5, 0x2559, 0xF9F6, 0x2568, 0xF9F7, 0x255C, + 0xF9F8, 0x2551, 0xF9F9, 0x2550, 0xF9FA, 0x256D, 0xF9FB, 0x256E, 0xF9FC, 0x2570, 0xF9FD, 0x256F, 0xF9FE, 0x2593, 0, 0 +}; +#endif + +#if FF_CODE_PAGE == 437 || FF_CODE_PAGE == 0 +static const WCHAR uc437[] = { /* CP437(U.S.) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 720 || FF_CODE_PAGE == 0 +static const WCHAR uc720[] = { /* CP720(Arabic) to Unicode conversion table */ + 0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9, 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0641, 0x00B5, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, + 0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 737 || FF_CODE_PAGE == 0 +static const WCHAR uc737[] = { /* CP737(Greek) to Unicode conversion table */ + 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, + 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, + 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03C9, 0x03AC, 0x03AD, 0x03AE, 0x03CA, 0x03AF, 0x03CC, 0x03CD, 0x03CB, 0x03CE, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E, + 0x038F, 0x00B1, 0x2265, 0x2264, 0x03AA, 0x03AB, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 771 || FF_CODE_PAGE == 0 +static const WCHAR uc771[] = { /* CP771(KBL) to Unicode conversion table */ + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x2558, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x0104, 0x0105, 0x010C, 0x010D, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0118, 0x0119, 0x0116, 0x0117, 0x012E, 0x012F, 0x0160, 0x0161, 0x0172, 0x0173, 0x016A, 0x016B, 0x017D, 0x017E, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 775 || FF_CODE_PAGE == 0 +static const WCHAR uc775[] = { /* CP775(Baltic) to Unicode conversion table */ + 0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107, 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4, + 0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6, 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0104, 0x010C, 0x0118, 0x0116, 0x2563, 0x2551, 0x2557, 0x255D, 0x012E, 0x0160, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0172, 0x016A, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x017D, + 0x0105, 0x010D, 0x0119, 0x0117, 0x012F, 0x0161, 0x0173, 0x016B, 0x017E, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x00D3, 0x00DF, 0x014C, 0x0143, 0x00F5, 0x00D5, 0x00B5, 0x0144, 0x0136, 0x0137, 0x013B, 0x013C, 0x0146, 0x0112, 0x0145, 0x2019, + 0x00AD, 0x00B1, 0x201C, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x201E, 0x00B0, 0x2219, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 850 || FF_CODE_PAGE == 0 +static const WCHAR uc850[] = { /* CP850(Latin 1) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE, 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE, 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 852 || FF_CODE_PAGE == 0 +static const WCHAR uc852[] = { /* CP852(Latin 2) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7, 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106, + 0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A, 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E, 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x011A, 0x015E, 0x2563, 0x2551, 0x2557, 0x255D, 0x017B, 0x017C, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0102, 0x0103, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x0111, 0x0110, 0x010E, 0x00CB, 0x010F, 0x0147, 0x00CD, 0x00CE, 0x011B, 0x2518, 0x250C, 0x2588, 0x2584, 0x0162, 0x016E, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x0143, 0x0144, 0x0148, 0x0160, 0x0161, 0x0154, 0x00DA, 0x0155, 0x0170, 0x00FD, 0x00DD, 0x0163, 0x00B4, + 0x00AD, 0x02DD, 0x02DB, 0x02C7, 0x02D8, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, 0x02D9, 0x0171, 0x0158, 0x0159, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 855 || FF_CODE_PAGE == 0 +static const WCHAR uc855[] = { /* CP855(Cyrillic) to Unicode conversion table */ + 0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404, 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408, + 0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C, 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A, + 0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414, 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0445, 0x0425, 0x0438, 0x0418, 0x2563, 0x2551, 0x2557, 0x255D, 0x0439, 0x0419, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x043A, 0x041A, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x043B, 0x041B, 0x043C, 0x041C, 0x043D, 0x041D, 0x043E, 0x041E, 0x043F, 0x2518, 0x250C, 0x2588, 0x2584, 0x041F, 0x044F, 0x2580, + 0x042F, 0x0440, 0x0420, 0x0441, 0x0421, 0x0442, 0x0422, 0x0443, 0x0423, 0x0436, 0x0416, 0x0432, 0x0412, 0x044C, 0x042C, 0x2116, + 0x00AD, 0x044B, 0x042B, 0x0437, 0x0417, 0x0448, 0x0428, 0x044D, 0x042D, 0x0449, 0x0429, 0x0447, 0x0427, 0x00A7, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 857 || FF_CODE_PAGE == 0 +static const WCHAR uc857[] = { /* CP857(Turkish) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00BA, 0x00AA, 0x00CA, 0x00CB, 0x00C8, 0x0000, 0x00CD, 0x00CE, 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x0000, 0x00D7, 0x00DA, 0x00DB, 0x00D9, 0x00EC, 0x00FF, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x0000, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 860 || FF_CODE_PAGE == 0 +static const WCHAR uc860[] = { /* CP860(Portuguese) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E3, 0x00E0, 0x00C1, 0x00E7, 0x00EA, 0x00CA, 0x00E8, 0x00CD, 0x00D4, 0x00EC, 0x00C3, 0x00C2, + 0x00C9, 0x00C0, 0x00C8, 0x00F4, 0x00F5, 0x00F2, 0x00DA, 0x00F9, 0x00CC, 0x00D5, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x20A7, 0x00D3, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00D2, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x2558, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 861 || FF_CODE_PAGE == 0 +static const WCHAR uc861[] = { /* CP861(Icelandic) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00D0, 0x00F0, 0x00DE, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00FE, 0x00FB, 0x00DD, 0x00FD, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00C1, 0x00CD, 0x00D3, 0x00DA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 862 || FF_CODE_PAGE == 0 +static const WCHAR uc862[] = { /* CP862(Hebrew) to Unicode conversion table */ + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 863 || FF_CODE_PAGE == 0 +static const WCHAR uc863[] = { /* CP863(Canadian French) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00C2, 0x00E0, 0x00B6, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x2017, 0x00C0, + 0x00C9, 0x00C8, 0x00CA, 0x00F4, 0x00CB, 0x00CF, 0x00FB, 0x00F9, 0x00A4, 0x00D4, 0x00DC, 0x00A2, 0x00A3, 0x00D9, 0x00DB, 0x0192, + 0x00A6, 0x00B4, 0x00F3, 0x00FA, 0x00A8, 0x00BB, 0x00B3, 0x00AF, 0x00CE, 0x3210, 0x00AC, 0x00BD, 0x00BC, 0x00BE, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2219, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 864 || FF_CODE_PAGE == 0 +static const WCHAR uc864[] = { /* CP864(Arabic) to Unicode conversion table */ + 0x00B0, 0x00B7, 0x2219, 0x221A, 0x2592, 0x2500, 0x2502, 0x253C, 0x2524, 0x252C, 0x251C, 0x2534, 0x2510, 0x250C, 0x2514, 0x2518, + 0x03B2, 0x221E, 0x03C6, 0x00B1, 0x00BD, 0x00BC, 0x2248, 0x00AB, 0x00BB, 0xFEF7, 0xFEF8, 0x0000, 0x0000, 0xFEFB, 0xFEFC, 0x0000, + 0x00A0, 0x00AD, 0xFE82, 0x00A3, 0x00A4, 0xFE84, 0x0000, 0x20AC, 0xFE8E, 0xFE8F, 0xFE95, 0xFE99, 0x060C, 0xFE9D, 0xFEA1, 0xFEA5, + 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, 0x0668, 0x0669, 0xFED1, 0x061B, 0xFEB1, 0xFEB5, 0xFEB9, 0x061F, + 0x00A2, 0xFE80, 0xFE81, 0xFE83, 0xFE85, 0xFECA, 0xFE8B, 0xFE8D, 0xFE91, 0xFE93, 0xFE97, 0xFE9B, 0xFE9F, 0xFEA3, 0xFEA7, 0xFEA9, + 0xFEAB, 0xFEAD, 0xFEAF, 0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, 0xFEC1, 0xFEC5, 0xFECB, 0xFECF, 0x00A6, 0x00AC, 0x00F7, 0x00D7, 0xFEC9, + 0x0640, 0xFED3, 0xFED7, 0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, 0xFEEB, 0xFEED, 0xFEEF, 0xFEF3, 0xFEBD, 0xFECC, 0xFECE, 0xFECD, 0xFEE1, + 0xFE7D, 0x0651, 0xFEE5, 0xFEE9, 0xFEEC, 0xFEF0, 0xFEF2, 0xFED0, 0xFED5, 0xFEF5, 0xFEF6, 0xFEDD, 0xFED9, 0xFEF1, 0x25A0, 0x0000 +}; +#endif +#if FF_CODE_PAGE == 865 || FF_CODE_PAGE == 0 +static const WCHAR uc865[] = { /* CP865(Nordic) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C5, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00A4, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x2558, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 866 || FF_CODE_PAGE == 0 +static const WCHAR uc866[] = { /* CP866(Russian) to Unicode conversion table */ + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0 +}; +#endif +#if FF_CODE_PAGE == 869 || FF_CODE_PAGE == 0 +static const WCHAR uc869[] = { /* CP869(Greek 2) to Unicode conversion table */ + 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x00B7, 0x0386, 0x00B7, 0x00B7, 0x00AC, 0x00A6, 0x2018, 0x2019, 0x0388, 0x2015, 0x0389, + 0x038A, 0x03AA, 0x038C, 0x00B7, 0x00B7, 0x038E, 0x03AB, 0x00A9, 0x038F, 0x00B2, 0x00B3, 0x03AC, 0x00A3, 0x03AD, 0x03AE, 0x03AF, + 0x03CA, 0x0390, 0x03CC, 0x03CD, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x00BD, 0x0398, 0x0399, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x039A, 0x039B, 0x039C, 0x039D, 0x2563, 0x2551, 0x2557, 0x255D, 0x039E, 0x039F, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0A30, 0x03A1, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x03A3, + 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x2518, 0x250C, 0x2588, 0x2584, 0x03B4, 0x03B5, 0x2580, + 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x0384, + 0x00AD, 0x00B1, 0x03C5, 0x03C6, 0x03C7, 0x00A7, 0x03C8, 0x0385, 0x00B0, 0x00A8, 0x03C9, 0x03CB, 0x03B0, 0x03CE, 0x25A0, 0x00A0 +}; +#endif + + + + +/*------------------------------------------------------------------------*/ +/* OEM <==> Unicode conversions for static code page configuration */ +/* SBCS fixed code page */ +/*------------------------------------------------------------------------*/ + +#if FF_CODE_PAGE != 0 && FF_CODE_PAGE < 900 +WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */ + DWORD uni, /* UTF-16 encoded character to be converted */ + WORD cp /* Code page for the conversion */ +) +{ + WCHAR c = 0; + const WCHAR *p = CVTBL(uc, FF_CODE_PAGE); + + + if (uni < 0x80) { /* ASCII? */ + c = (WCHAR)uni; + + } else { /* Non-ASCII */ + if (uni < 0x10000 && cp == FF_CODE_PAGE) { /* Is it in BMP and valid code page? */ + for (c = 0; c < 0x80 && uni != p[c]; c++) ; + c = (c + 0x80) & 0xFF; + } + } + + return c; +} + +WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */ + WCHAR oem, /* OEM code to be converted */ + WORD cp /* Code page for the conversion */ +) +{ + WCHAR c = 0; + const WCHAR *p = CVTBL(uc, FF_CODE_PAGE); + + + if (oem < 0x80) { /* ASCII? */ + c = oem; + + } else { /* Extended char */ + if (cp == FF_CODE_PAGE) { /* Is it a valid code page? */ + if (oem < 0x100) c = p[oem - 0x80]; + } + } + + return c; +} + +#endif + + + +/*------------------------------------------------------------------------*/ +/* OEM <==> Unicode conversions for static code page configuration */ +/* DBCS fixed code page */ +/*------------------------------------------------------------------------*/ + +#if FF_CODE_PAGE >= 900 +WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */ + DWORD uni, /* UTF-16 encoded character to be converted */ + WORD cp /* Code page for the conversion */ +) +{ + const WCHAR *p; + WCHAR c = 0, uc; + UINT i = 0, n, li, hi; + + + if (uni < 0x80) { /* ASCII? */ + c = (WCHAR)uni; + + } else { /* Non-ASCII */ + if (uni < 0x10000 && cp == FF_CODE_PAGE) { /* Is it in BMP and valid code page? */ + uc = (WCHAR)uni; + p = CVTBL(uni2oem, FF_CODE_PAGE); + hi = sizeof CVTBL(uni2oem, FF_CODE_PAGE) / 4 - 1; + li = 0; + for (n = 16; n; n--) { + i = li + (hi - li) / 2; + if (uc == p[i * 2]) break; + if (uc > p[i * 2]) { + li = i; + } else { + hi = i; + } + } + if (n != 0) c = p[i * 2 + 1]; + } + } + + return c; +} + + +WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */ + WCHAR oem, /* OEM code to be converted */ + WORD cp /* Code page for the conversion */ +) +{ + const WCHAR *p; + WCHAR c = 0; + UINT i = 0, n, li, hi; + + + if (oem < 0x80) { /* ASCII? */ + c = oem; + + } else { /* Extended char */ + if (cp == FF_CODE_PAGE) { /* Is it valid code page? */ + p = CVTBL(oem2uni, FF_CODE_PAGE); + hi = sizeof CVTBL(oem2uni, FF_CODE_PAGE) / 4 - 1; + li = 0; + for (n = 16; n; n--) { + i = li + (hi - li) / 2; + if (oem == p[i * 2]) break; + if (oem > p[i * 2]) { + li = i; + } else { + hi = i; + } + } + if (n != 0) c = p[i * 2 + 1]; + } + } + + return c; +} +#endif + + + +/*------------------------------------------------------------------------*/ +/* OEM <==> Unicode conversions for dynamic code page configuration */ +/*------------------------------------------------------------------------*/ + +#if FF_CODE_PAGE == 0 + +static const WORD cp_code[] = { 437, 720, 737, 771, 775, 850, 852, 855, 857, 860, 861, 862, 863, 864, 865, 866, 869, 0}; +static const WCHAR* const cp_table[] = {uc437, uc720, uc737, uc771, uc775, uc850, uc852, uc855, uc857, uc860, uc861, uc862, uc863, uc864, uc865, uc866, uc869, 0}; + + +WCHAR ff_uni2oem ( /* Returns OEM code character, zero on error */ + DWORD uni, /* UTF-16 encoded character to be converted */ + WORD cp /* Code page for the conversion */ +) +{ + const WCHAR *p; + WCHAR c = 0, uc; + UINT i, n, li, hi; + + + if (uni < 0x80) { /* ASCII? */ + c = (WCHAR)uni; + + } else { /* Non-ASCII */ + if (uni < 0x10000) { /* Is it in BMP? */ + uc = (WCHAR)uni; + p = 0; + if (cp < 900) { /* SBCS */ + for (i = 0; cp_code[i] != 0 && cp_code[i] != cp; i++) ; /* Get conversion table */ + p = cp_table[i]; + if (p) { /* Is it valid code page ? */ + for (c = 0; c < 0x80 && uc != p[c]; c++) ; /* Find OEM code in the table */ + c = (c + 0x80) & 0xFF; + } + } else { /* DBCS */ + switch (cp) { /* Get conversion table */ + case 932 : p = uni2oem932; hi = sizeof uni2oem932 / 4 - 1; break; + case 936 : p = uni2oem936; hi = sizeof uni2oem936 / 4 - 1; break; + case 949 : p = uni2oem949; hi = sizeof uni2oem949 / 4 - 1; break; + case 950 : p = uni2oem950; hi = sizeof uni2oem950 / 4 - 1; break; + } + if (p) { /* Is it valid code page? */ + li = 0; + for (n = 16; n; n--) { /* Find OEM code */ + i = li + (hi - li) / 2; + if (uc == p[i * 2]) break; + if (uc > p[i * 2]) { + li = i; + } else { + hi = i; + } + } + if (n != 0) c = p[i * 2 + 1]; + } + } + } + } + + return c; +} + + +WCHAR ff_oem2uni ( /* Returns Unicode character, zero on error */ + WCHAR oem, /* OEM code to be converted (DBC if >=0x100) */ + WORD cp /* Code page for the conversion */ +) +{ + const WCHAR *p; + WCHAR c = 0; + UINT i, n, li, hi; + + + if (oem < 0x80) { /* ASCII? */ + c = oem; + + } else { /* Extended char */ + p = 0; + if (cp < 900) { /* SBCS */ + for (i = 0; cp_code[i] != 0 && cp_code[i] != cp; i++) ; /* Get table */ + p = cp_table[i]; + if (p) { /* Is it a valid CP ? */ + if (oem < 0x100) c = p[oem - 0x80]; + } + } else { /* DBCS */ + switch (cp) { + case 932 : p = oem2uni932; hi = sizeof oem2uni932 / 4 - 1; break; + case 936 : p = oem2uni936; hi = sizeof oem2uni936 / 4 - 1; break; + case 949 : p = oem2uni949; hi = sizeof oem2uni949 / 4 - 1; break; + case 950 : p = oem2uni950; hi = sizeof oem2uni950 / 4 - 1; break; + } + if (p) { + li = 0; + for (n = 16; n; n--) { + i = li + (hi - li) / 2; + if (oem == p[i * 2]) break; + if (oem > p[i * 2]) { + li = i; + } else { + hi = i; + } + } + if (n != 0) c = p[i * 2 + 1]; + } + } + } + + return c; +} +#endif + + + +/*------------------------------------------------------------------------*/ +/* Unicode up-case conversion */ +/*------------------------------------------------------------------------*/ + +DWORD ff_wtoupper ( /* Returns up-converted code point */ + DWORD uni /* Unicode code point to be up-converted */ +) +{ + const WORD *p; + WORD uc, bc, nc, cmd; + static const WORD cvt1[] = { /* Compressed up conversion table for U+0000 - U+0FFF */ + /* Basic Latin */ + 0x0061,0x031A, + /* Latin-1 Supplement */ + 0x00E0,0x0317, + 0x00F8,0x0307, + 0x00FF,0x0001,0x0178, + /* Latin Extended-A */ + 0x0100,0x0130, + 0x0132,0x0106, + 0x0139,0x0110, + 0x014A,0x012E, + 0x0179,0x0106, + /* Latin Extended-B */ + 0x0180,0x004D,0x0243,0x0181,0x0182,0x0182,0x0184,0x0184,0x0186,0x0187,0x0187,0x0189,0x018A,0x018B,0x018B,0x018D,0x018E,0x018F,0x0190,0x0191,0x0191,0x0193,0x0194,0x01F6,0x0196,0x0197,0x0198,0x0198,0x023D,0x019B,0x019C,0x019D,0x0220,0x019F,0x01A0,0x01A0,0x01A2,0x01A2,0x01A4,0x01A4,0x01A6,0x01A7,0x01A7,0x01A9,0x01AA,0x01AB,0x01AC,0x01AC,0x01AE,0x01AF,0x01AF,0x01B1,0x01B2,0x01B3,0x01B3,0x01B5,0x01B5,0x01B7,0x01B8,0x01B8,0x01BA,0x01BB,0x01BC,0x01BC,0x01BE,0x01F7,0x01C0,0x01C1,0x01C2,0x01C3,0x01C4,0x01C5,0x01C4,0x01C7,0x01C8,0x01C7,0x01CA,0x01CB,0x01CA, + 0x01CD,0x0110, + 0x01DD,0x0001,0x018E, + 0x01DE,0x0112, + 0x01F3,0x0003,0x01F1,0x01F4,0x01F4, + 0x01F8,0x0128, + 0x0222,0x0112, + 0x023A,0x0009,0x2C65,0x023B,0x023B,0x023D,0x2C66,0x023F,0x0240,0x0241,0x0241, + 0x0246,0x010A, + /* IPA Extensions */ + 0x0253,0x0040,0x0181,0x0186,0x0255,0x0189,0x018A,0x0258,0x018F,0x025A,0x0190,0x025C,0x025D,0x025E,0x025F,0x0193,0x0261,0x0262,0x0194,0x0264,0x0265,0x0266,0x0267,0x0197,0x0196,0x026A,0x2C62,0x026C,0x026D,0x026E,0x019C,0x0270,0x0271,0x019D,0x0273,0x0274,0x019F,0x0276,0x0277,0x0278,0x0279,0x027A,0x027B,0x027C,0x2C64,0x027E,0x027F,0x01A6,0x0281,0x0282,0x01A9,0x0284,0x0285,0x0286,0x0287,0x01AE,0x0244,0x01B1,0x01B2,0x0245,0x028D,0x028E,0x028F,0x0290,0x0291,0x01B7, + /* Greek, Coptic */ + 0x037B,0x0003,0x03FD,0x03FE,0x03FF, + 0x03AC,0x0004,0x0386,0x0388,0x0389,0x038A, + 0x03B1,0x0311, + 0x03C2,0x0002,0x03A3,0x03A3, + 0x03C4,0x0308, + 0x03CC,0x0003,0x038C,0x038E,0x038F, + 0x03D8,0x0118, + 0x03F2,0x000A,0x03F9,0x03F3,0x03F4,0x03F5,0x03F6,0x03F7,0x03F7,0x03F9,0x03FA,0x03FA, + /* Cyrillic */ + 0x0430,0x0320, + 0x0450,0x0710, + 0x0460,0x0122, + 0x048A,0x0136, + 0x04C1,0x010E, + 0x04CF,0x0001,0x04C0, + 0x04D0,0x0144, + /* Armenian */ + 0x0561,0x0426, + + 0x0000 /* EOT */ + }; + static const WORD cvt2[] = { /* Compressed up conversion table for U+1000 - U+FFFF */ + /* Phonetic Extensions */ + 0x1D7D,0x0001,0x2C63, + /* Latin Extended Additional */ + 0x1E00,0x0196, + 0x1EA0,0x015A, + /* Greek Extended */ + 0x1F00,0x0608, + 0x1F10,0x0606, + 0x1F20,0x0608, + 0x1F30,0x0608, + 0x1F40,0x0606, + 0x1F51,0x0007,0x1F59,0x1F52,0x1F5B,0x1F54,0x1F5D,0x1F56,0x1F5F, + 0x1F60,0x0608, + 0x1F70,0x000E,0x1FBA,0x1FBB,0x1FC8,0x1FC9,0x1FCA,0x1FCB,0x1FDA,0x1FDB,0x1FF8,0x1FF9,0x1FEA,0x1FEB,0x1FFA,0x1FFB, + 0x1F80,0x0608, + 0x1F90,0x0608, + 0x1FA0,0x0608, + 0x1FB0,0x0004,0x1FB8,0x1FB9,0x1FB2,0x1FBC, + 0x1FCC,0x0001,0x1FC3, + 0x1FD0,0x0602, + 0x1FE0,0x0602, + 0x1FE5,0x0001,0x1FEC, + 0x1FF3,0x0001,0x1FFC, + /* Letterlike Symbols */ + 0x214E,0x0001,0x2132, + /* Number forms */ + 0x2170,0x0210, + 0x2184,0x0001,0x2183, + /* Enclosed Alphanumerics */ + 0x24D0,0x051A, + 0x2C30,0x042F, + /* Latin Extended-C */ + 0x2C60,0x0102, + 0x2C67,0x0106, 0x2C75,0x0102, + /* Coptic */ + 0x2C80,0x0164, + /* Georgian Supplement */ + 0x2D00,0x0826, + /* Full-width */ + 0xFF41,0x031A, + + 0x0000 /* EOT */ + }; + + + if (uni < 0x10000) { /* Is it in BMP? */ + uc = (WORD)uni; + p = uc < 0x1000 ? cvt1 : cvt2; + for (;;) { + bc = *p++; /* Get the block base */ + if (bc == 0 || uc < bc) break; /* Not matched? */ + nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */ + if (uc < bc + nc) { /* In the block? */ + switch (cmd) { + case 0: uc = p[uc - bc]; break; /* Table conversion */ + case 1: uc -= (uc - bc) & 1; break; /* Case pairs */ + case 2: uc -= 16; break; /* Shift -16 */ + case 3: uc -= 32; break; /* Shift -32 */ + case 4: uc -= 48; break; /* Shift -48 */ + case 5: uc -= 26; break; /* Shift -26 */ + case 6: uc += 8; break; /* Shift +8 */ + case 7: uc -= 80; break; /* Shift -80 */ + case 8: uc -= 0x1C60; break; /* Shift -0x1C60 */ + } + break; + } + if (cmd == 0) p += nc; /* Skip table if needed */ + } + uni = uc; + } + + return uni; +} + + +#endif /* #if FF_USE_LFN */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/ccsbcs.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/ccsbcs.c new file mode 100644 index 0000000..a2da326 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/ccsbcs.c @@ -0,0 +1,541 @@ +/*------------------------------------------------------------------------*/ +/* Unicode - Local code bidirectional converter (C)ChaN, 2009 */ +/* (SBCS code pages) */ +/*------------------------------------------------------------------------*/ +/* 437 U.S. (OEM) +/ 720 Arabic (OEM) +/ 1256 Arabic (Windows) +/ 737 Greek (OEM) +/ 1253 Greek (Windows) +/ 1250 Central Europe (Windows) +/ 775 Baltic (OEM) +/ 1257 Baltic (Windows) +/ 850 Multilingual Latin 1 (OEM) +/ 852 Latin 2 (OEM) +/ 1252 Latin 1 (Windows) +/ 855 Cyrillic (OEM) +/ 1251 Cyrillic (Windows) +/ 866 Russian (OEM) +/ 857 Turkish (OEM) +/ 1254 Turkish (Windows) +/ 858 Multilingual Latin 1 + Euro (OEM) +/ 862 Hebrew (OEM) +/ 1255 Hebrew (Windows) +/ 874 Thai (OEM, Windows) +/ 1258 Vietnam (OEM, Windows) +*/ + +//#include "../ff.h" //RPi +#include "ff.h" //RPi + + +#if _CODE_PAGE == 437 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP437(0x80-0xFF) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, + 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 720 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP720(0x80-0xFF) to Unicode conversion table */ + 0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9, + 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0641, 0x00B5, 0x0642, + 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, + 0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0xO650, 0x2248, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 737 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP737(0x80-0xFF) to Unicode conversion table */ + 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, + 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, + 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, + 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, + 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, + 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03C9, 0x03AC, 0x03AD, 0x03AE, 0x03CA, 0x03AF, 0x03CC, 0x03CD, + 0x03CB, 0x03CE, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E, + 0x038F, 0x00B1, 0x2265, 0x2264, 0x03AA, 0x03AB, 0x00F7, 0x2248, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 775 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP775(0x80-0xFF) to Unicode conversion table */ + 0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107, + 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A, + 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4, + 0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6, + 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0104, 0x010C, 0x0118, + 0x0116, 0x2563, 0x2551, 0x2557, 0x255D, 0x012E, 0x0160, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0172, 0x016A, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x017D, + 0x0105, 0x010D, 0x0119, 0x0117, 0x012F, 0x0161, 0x0173, 0x016B, + 0x017E, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x00D3, 0x00DF, 0x014C, 0x0143, 0x00F5, 0x00D5, 0x00B5, 0x0144, + 0x0136, 0x0137, 0x013B, 0x013C, 0x0146, 0x0112, 0x0145, 0x2019, + 0x00AD, 0x00B1, 0x201C, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x201E, + 0x00B0, 0x2219, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 850 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP850(0x80-0xFF) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, + 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE, + 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE, + 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, + 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 852 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP852(0x80-0xFF) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7, + 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106, + 0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A, + 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E, + 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x011A, + 0x015E, 0x2563, 0x2551, 0x2557, 0x255D, 0x017B, 0x017C, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0102, 0x0103, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x0111, 0x0110, 0x010E, 0x00CB, 0x010F, 0x0147, 0x00CD, 0x00CE, + 0x011B, 0x2518, 0x250C, 0x2588, 0x2584, 0x0162, 0x016E, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x0143, 0x0144, 0x0148, 0x0160, 0x0161, + 0x0154, 0x00DA, 0x0155, 0x0170, 0x00FD, 0x00DD, 0x0163, 0x00B4, + 0x00AD, 0x02DD, 0x02DB, 0x02C7, 0x02D8, 0x00A7, 0x00F7, 0x00B8, + 0x00B0, 0x00A8, 0x02D9, 0x0171, 0x0158, 0x0159, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 855 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP855(0x80-0xFF) to Unicode conversion table */ + 0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404, + 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408, + 0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C, + 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A, + 0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414, + 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0445, 0x0425, 0x0438, + 0x0418, 0x2563, 0x2551, 0x2557, 0x255D, 0x0439, 0x0419, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x043A, 0x041A, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x043B, 0x041B, 0x043C, 0x041C, 0x043D, 0x041D, 0x043E, 0x041E, + 0x043F, 0x2518, 0x250C, 0x2588, 0x2584, 0x041F, 0x044F, 0x2580, + 0x042F, 0x0440, 0x0420, 0x0441, 0x0421, 0x0442, 0x0422, 0x0443, + 0x0423, 0x0436, 0x0416, 0x0432, 0x0412, 0x044C, 0x042C, 0x2116, + 0x00AD, 0x044B, 0x042B, 0x0437, 0x0417, 0x0448, 0x0428, 0x044D, + 0x042D, 0x0449, 0x0429, 0x0447, 0x0427, 0x00A7, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 857 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP857(0x80-0xFF) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F, + 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, + 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00BA, 0x00AA, 0x00CA, 0x00CB, 0x00C8, 0x0000, 0x00CD, 0x00CE, + 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x0000, + 0x00D7, 0x00DA, 0x00DB, 0x00D9, 0x00EC, 0x00FF, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x0000, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, + 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 858 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP858(0x80-0xFF) to Unicode conversion table */ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, + 0x00A9, 0x2563, 0x2551, 0x2557, 0x2550, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x20AC, 0x00CD, 0x00CE, + 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00C6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE, + 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, + 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 862 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP862(0x80-0xFF) to Unicode conversion table */ + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, + 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, + 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 866 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP866(0x80-0xFF) to Unicode conversion table */ + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0 +}; + +#elif _CODE_PAGE == 874 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP874(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, + 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, + 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, + 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F, + 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, + 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F, + 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, + 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F, + 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, + 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F, + 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, + 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000 +}; + +#elif _CODE_PAGE == 1250 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1250(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, + 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, + 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, + 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, + 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, + 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, + 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, + 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, + 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, + 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, + 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, + 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 +}; + +#elif _CODE_PAGE == 1251 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1251(0x80-0xFF) to Unicode conversion table */ + 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, + 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, + 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0000, 0x2111, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, + 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, + 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, + 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, + 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457, + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042D, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F +}; + +#elif _CODE_PAGE == 1252 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1252(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00BD, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF +}; + +#elif _CODE_PAGE == 1253 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1253(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x0000, 0x2030, 0x0000, 0x2039, 0x000C, 0x0000, 0x0000, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, + 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, + 0x03A8, 0x03A9, 0x03AA, 0x03AD, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000 +}; + +#elif _CODE_PAGE == 1254 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1254(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x210A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00BD, 0x00DC, 0x0130, 0x015E, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF +}; + +#elif _CODE_PAGE == 1255 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1255(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, + 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3, + 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000 +}; + +#elif _CODE_PAGE == 1256 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, + 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA, + 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F, + 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, + 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0640, 0x0642, 0x0643, + 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF, + 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7, + 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2 +} + +#elif _CODE_PAGE == 1257 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1257(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, + 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000, + 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7, + 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, + 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, + 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, + 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, + 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, + 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, + 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, + 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, + 0x0173, 0x014E, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9 +}; + +#elif _CODE_PAGE == 1258 +#define _TBLDEF 1 +static +const WCHAR Tbl[] = { /* CP1258(0x80-0xFF) to Unicode conversion table */ + 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0000, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000, + 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0000, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF, + 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF, + 0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF +}; + +#endif + + +#if !_TBLDEF || !_USE_LFN +//#error This file is not needed in current configuration +#endif + + +WCHAR ff_convert ( /* Converted character, Returns zero on error */ + WCHAR src, /* Character code to be converted */ + UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */ +) +{ + WCHAR c; + + + if (src < 0x80) { /* ASCII */ + c = src; + + } else { + if (dir) { /* OEMCP to Unicode */ + c = (src >= 0x100) ? 0 : Tbl[src - 0x80]; + + } else { /* Unicode to OEMCP */ + for (c = 0; c < 0x80; c++) { + if (src == Tbl[c]) break; + } + c = (c + 0x80) & 0xFF; + } + } + + return c; +} + + +WCHAR ff_wtoupper ( /* Upper converted character */ + WCHAR chr /* Input character */ +) +{ + static const WCHAR tbl_lower[] = { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xA1, 0x00A2, 0x00A3, 0x00A5, 0x00AC, 0x00AF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x0FF, 0x101, 0x103, 0x105, 0x107, 0x109, 0x10B, 0x10D, 0x10F, 0x111, 0x113, 0x115, 0x117, 0x119, 0x11B, 0x11D, 0x11F, 0x121, 0x123, 0x125, 0x127, 0x129, 0x12B, 0x12D, 0x12F, 0x131, 0x133, 0x135, 0x137, 0x13A, 0x13C, 0x13E, 0x140, 0x142, 0x144, 0x146, 0x148, 0x14B, 0x14D, 0x14F, 0x151, 0x153, 0x155, 0x157, 0x159, 0x15B, 0x15D, 0x15F, 0x161, 0x163, 0x165, 0x167, 0x169, 0x16B, 0x16D, 0x16F, 0x171, 0x173, 0x175, 0x177, 0x17A, 0x17C, 0x17E, 0x192, 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, 0x3B8, 0x3B9, 0x3BA, 0x3BB, 0x3BC, 0x3BD, 0x3BE, 0x3BF, 0x3C0, 0x3C1, 0x3C3, 0x3C4, 0x3C5, 0x3C6, 0x3C7, 0x3C8, 0x3C9, 0x3CA, 0x430, 0x431, 0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B, 0x43C, 0x43D, 0x43E, 0x43F, 0x440, 0x441, 0x442, 0x443, 0x444, 0x445, 0x446, 0x447, 0x448, 0x449, 0x44A, 0x44B, 0x44C, 0x44D, 0x44E, 0x44F, 0x451, 0x452, 0x453, 0x454, 0x455, 0x456, 0x457, 0x458, 0x459, 0x45A, 0x45B, 0x45C, 0x45E, 0x45F, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0 }; + static const WCHAR tbl_upper[] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x21, 0xFFE0, 0xFFE1, 0xFFE5, 0xFFE2, 0xFFE3, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0x178, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10A, 0x10C, 0x10E, 0x110, 0x112, 0x114, 0x116, 0x118, 0x11A, 0x11C, 0x11E, 0x120, 0x122, 0x124, 0x126, 0x128, 0x12A, 0x12C, 0x12E, 0x130, 0x132, 0x134, 0x136, 0x139, 0x13B, 0x13D, 0x13F, 0x141, 0x143, 0x145, 0x147, 0x14A, 0x14C, 0x14E, 0x150, 0x152, 0x154, 0x156, 0x158, 0x15A, 0x15C, 0x15E, 0x160, 0x162, 0x164, 0x166, 0x168, 0x16A, 0x16C, 0x16E, 0x170, 0x172, 0x174, 0x176, 0x179, 0x17B, 0x17D, 0x191, 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39A, 0x39B, 0x39C, 0x39D, 0x39E, 0x39F, 0x3A0, 0x3A1, 0x3A3, 0x3A4, 0x3A5, 0x3A6, 0x3A7, 0x3A8, 0x3A9, 0x3AA, 0x410, 0x411, 0x412, 0x413, 0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41A, 0x41B, 0x41C, 0x41D, 0x41E, 0x41F, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427, 0x428, 0x429, 0x42A, 0x42B, 0x42C, 0x42D, 0x42E, 0x42F, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409, 0x40A, 0x40B, 0x40C, 0x40E, 0x40F, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0 }; + int i; + + + for (i = 0; tbl_lower[i] && chr != tbl_lower[i]; i++) ; + + return tbl_lower[i] ? tbl_upper[i] : chr; +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/syncobj.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/syncobj.c new file mode 100644 index 0000000..964c339 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/Third_Party/fat_fs/src/option/syncobj.c @@ -0,0 +1,115 @@ +/*------------------------------------------------------------------------*/ +/* Sample code of OS dependent synchronization object controls */ +/* for FatFs R0.07d (C)ChaN, 2009 */ +/*------------------------------------------------------------------------*/ + +#include // Win32 +//#include // uC/OS-II + +#include "../ff.h" + +#if _FS_REENTRANT + +/*------------------------------------------------------------------------*/ +/* Create a Synchronization Object for a Volume +/*------------------------------------------------------------------------*/ +/* This function is called in f_mount function to create a new +/ synchronization object, such as semaphore and mutex. When a FALSE is +/ returned, the f_mount function fails with FR_INT_ERR. +*/ + +BOOL ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to any error */ + BYTE vol, /* Corresponding logical drive being processed */ + _SYNC_t *sobj /* Pointer to return the created sync object */ +) +{ + BOOL ret; + + *sobj = CreateMutex(NULL, FALSE, NULL); // Win32 + ret = (*sobj != INVALID_HANDLE_VALUE) ? TRUE : FALSE; // + +// *sobj = VolumeSemId[vol]; // uITRON (give a static created sync object) +// ret = TRUE; // The initial value of the semaphore must be 1. + +// *sobj = OSMutexCreate(0, &err); // uC/OS-II +// ret = (err == OS_NO_ERR) ? TRUE : FALSE; // + + return ret; +} + + + +/*------------------------------------------------------------------------*/ +/* Delete a Synchronization Object */ +/*------------------------------------------------------------------------*/ +/* This function is called in f_mount function to delete a synchronization +/ object that created with ff_cre_syncobj function. When a FALSE is +/ returned, the f_mount function fails with FR_INT_ERR. +*/ + +BOOL ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to any error */ + _SYNC_t sobj /* Sync object tied to the logical drive to be deleted */ +) +{ + BOOL ret; + + ret = CloseHandle(sobj); // Win32 + +// ret = TRUE; // uITRON (nothing to do) + +// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); // uC/OS-II +// ret = (err == OS_NO_ERR) ? TRUE : FALSE; // + + return ret; +} + + + +/*------------------------------------------------------------------------*/ +/* Request Grant to Access the Volume */ +/*------------------------------------------------------------------------*/ +/* This function is called on entering file functions to lock the volume. +/ When a FALSE is returned, the file function fails with FR_TIMEOUT. +*/ + +BOOL ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */ + _SYNC_t sobj /* Sync object to wait */ +) +{ + BOOL ret; + + ret = (WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0) ? TRUE : FALSE; // Win32 + +// ret = (wai_sem(sobj) == E_OK) ? TRUE : FALSE; // uITRON + +// OSMutexPend(sobj, _FS_TIMEOUT, &err)); // uC/OS-II +// ret = (err == OS_NO_ERR) ? TRUE : FALSE; // + + return ret; +} + + + +/*------------------------------------------------------------------------*/ +/* Release Grant to Access the Volume */ +/*------------------------------------------------------------------------*/ +/* This function is called on leaving file functions to unlock the volume. +*/ + +void ff_rel_grant ( + _SYNC_t sobj /* Sync object to be signaled */ +) +{ + ReleaseMutex(sobj); // Win32 + +// sig_sem(sobj); // uITRON + +// OSMutexPost(sobj); // uC/OS-II +} + + +#else + +#error This file is not needed in this configuration. + +#endif diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.c new file mode 100644 index 0000000..0de6696 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.c @@ -0,0 +1,227 @@ +/*! + \file gd32f10x_eval.c + \brief firmware functions to manage leds, keys, COM ports + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_eval.h" + +/* private variables */ +static uint32_t GPIO_PORT[LEDn] = {LED2_GPIO_PORT, LED3_GPIO_PORT, + LED4_GPIO_PORT, LED5_GPIO_PORT}; +static uint32_t GPIO_PIN[LEDn] = {LED2_PIN, LED3_PIN, LED4_PIN, LED5_PIN}; + +static rcu_periph_enum COM_CLK[COMn] = {EVAL_COM0_CLK, EVAL_COM1_CLK}; +static uint32_t COM_TX_PIN[COMn] = {EVAL_COM0_TX_PIN, EVAL_COM1_TX_PIN}; +static uint32_t COM_RX_PIN[COMn] = {EVAL_COM0_RX_PIN, EVAL_COM1_RX_PIN}; +static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM0_GPIO_PORT, EVAL_COM1_GPIO_PORT}; +static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM0_GPIO_CLK, EVAL_COM1_GPIO_CLK}; + +static rcu_periph_enum GPIO_CLK[LEDn] = {LED2_GPIO_CLK, LED3_GPIO_CLK, + LED4_GPIO_CLK, LED5_GPIO_CLK}; + +static uint32_t KEY_PORT[KEYn] = {WAKEUP_KEY_GPIO_PORT, + TAMPER_KEY_GPIO_PORT, + USER_KEY_GPIO_PORT}; +static uint32_t KEY_PIN[KEYn] = {WAKEUP_KEY_PIN, + TAMPER_KEY_PIN, + USER_KEY_PIN}; +static rcu_periph_enum KEY_CLK[KEYn] = {WAKEUP_KEY_GPIO_CLK, + TAMPER_KEY_GPIO_CLK, + USER_KEY_GPIO_CLK}; +static exti_line_enum KEY_EXTI_LINE[KEYn] = {WAKEUP_KEY_EXTI_LINE, + TAMPER_KEY_EXTI_LINE, + USER_KEY_EXTI_LINE}; +static uint8_t KEY_PORT_SOURCE[KEYn] = {WAKEUP_KEY_EXTI_PORT_SOURCE, + TAMPER_KEY_EXTI_PORT_SOURCE, + USER_KEY_EXTI_PORT_SOURCE}; +static uint8_t KEY_PIN_SOURCE[KEYn] = {WAKEUP_KEY_EXTI_PIN_SOURCE, + TAMPER_KEY_EXTI_PIN_SOURCE, + USER_KEY_EXTI_PIN_SOURCE}; +static uint8_t KEY_IRQn[KEYn] = {WAKEUP_KEY_EXTI_IRQn, + TAMPER_KEY_EXTI_IRQn, + USER_KEY_EXTI_IRQn}; + +/*! + \brief configure led GPIO + \param[in] lednum: specify the led to be configured + \arg LED2 + \arg LED3 + \arg LED4 + \arg LED5 + \param[out] none + \retval none +*/ +void gd_eval_led_init(led_typedef_enum lednum) +{ + /* enable the led clock */ + rcu_periph_clock_enable(GPIO_CLK[lednum]); + /* configure led GPIO port */ + gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN[lednum]); + + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn on selected led + \param[in] lednum: specify the led to be turned on + \arg LED2 + \arg LED3 + \arg LED4 + \arg LED5 + \param[out] none + \retval none +*/ +void gd_eval_led_on(led_typedef_enum lednum) +{ + GPIO_BOP(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn off selected led + \param[in] lednum: specify the led to be turned off + \arg LED2 + \arg LED3 + \arg LED4 + \arg LED5 + \param[out] none + \retval none +*/ +void gd_eval_led_off(led_typedef_enum lednum) +{ + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief toggle selected led + \param[in] lednum: specify the led to be toggled + \arg LED2 + \arg LED3 + \arg LED4 + \arg LED5 + \param[out] none + \retval none +*/ +void gd_eval_led_toggle(led_typedef_enum lednum) +{ + gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], + (bit_status)(1-gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum]))); +} + +/*! + \brief configure key + \param[in] key_num: specify the key to be configured + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[in] key_mode: specify button mode + \arg KEY_MODE_GPIO: key will be used as simple IO + \arg KEY_MODE_EXTI: key will be connected to EXTI line with interrupt + \param[out] none + \retval none +*/ +void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode) +{ + /* enable the key clock */ + rcu_periph_clock_enable(KEY_CLK[key_num]); + rcu_periph_clock_enable(RCU_AF); + + /* configure button pin as input */ + gpio_init(KEY_PORT[key_num], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, KEY_PIN[key_num]); + + if (key_mode == KEY_MODE_EXTI) { + /* enable and set key EXTI interrupt to the lowest priority */ + nvic_irq_enable(KEY_IRQn[key_num], 2U, 0U); + + /* connect key EXTI line to key GPIO pin */ + gpio_exti_source_select(KEY_PORT_SOURCE[key_num], KEY_PIN_SOURCE[key_num]); + + /* configure key EXTI line */ + exti_init(KEY_EXTI_LINE[key_num], EXTI_INTERRUPT, EXTI_TRIG_FALLING); + exti_interrupt_flag_clear(KEY_EXTI_LINE[key_num]); + } +} + +/*! + \brief return the selected key state + \param[in] key: specify the key to be checked + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[out] none + \retval the key's GPIO pin value +*/ +uint8_t gd_eval_key_state_get(key_typedef_enum key) +{ + return gpio_input_bit_get(KEY_PORT[key], KEY_PIN[key]); +} + +/*! + \brief configure COM port + \param[in] com: COM on the board + \arg EVAL_COM0: COM0 on the board + \arg EVAL_COM1: COM1 on the board + \param[out] none + \retval none +*/ +void gd_eval_com_init(uint32_t com) +{ + uint32_t com_id = 0U; + if(EVAL_COM0 == com){ + com_id = 0U; + }else if(EVAL_COM1 == com){ + com_id = 1U; + } + + /* enable GPIO clock */ + rcu_periph_clock_enable(COM_GPIO_CLK[com_id]); + + /* enable USART clock */ + rcu_periph_clock_enable(COM_CLK[com_id]); + + /* connect port to USARTx_Tx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, COM_TX_PIN[com_id]); + + /* connect port to USARTx_Rx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, COM_RX_PIN[com_id]); + + /* USART configure */ + usart_deinit(com); + usart_baudrate_set(com, 115200U); + usart_word_length_set(com, USART_WL_8BIT); + usart_stop_bit_set(com, USART_STB_1BIT); + usart_parity_config(com, USART_PM_NONE); + usart_hardware_flow_rts_config(com, USART_RTS_DISABLE); + usart_hardware_flow_cts_config(com, USART_CTS_DISABLE); + usart_receive_config(com, USART_RECEIVE_ENABLE); + usart_transmit_config(com, USART_TRANSMIT_ENABLE); + usart_enable(com); +} diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.h new file mode 100644 index 0000000..60cefc4 --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_eval.h @@ -0,0 +1,150 @@ +/*! + \file gd32f10x_eval.h + \brief definitions for GD32F10x_EVAL's leds, keys and COM ports hardware resources + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_EVAL_H +#define GD32F10X_EVAL_H + +#ifdef cplusplus + extern "C" { +#endif + +#include "gd32f10x.h" + +/* exported types */ +typedef enum +{ + LED2 = 0, + LED3 = 1, + LED4 = 2, + LED5 = 3 +} led_typedef_enum; + +typedef enum +{ + KEY_WAKEUP = 0, + KEY_TAMPER = 1, + KEY_USER = 2 +} key_typedef_enum; + +typedef enum +{ + KEY_MODE_GPIO = 0, + KEY_MODE_EXTI = 1 +} keymode_typedef_enum; + +/* eval board low layer led */ +#define LEDn 4U + +#define LED2_PIN GPIO_PIN_0 +#define LED2_GPIO_PORT GPIOC +#define LED2_GPIO_CLK RCU_GPIOC + +#define LED3_PIN GPIO_PIN_2 +#define LED3_GPIO_PORT GPIOC +#define LED3_GPIO_CLK RCU_GPIOC + +#define LED4_PIN GPIO_PIN_0 +#define LED4_GPIO_PORT GPIOE +#define LED4_GPIO_CLK RCU_GPIOE + +#define LED5_PIN GPIO_PIN_1 +#define LED5_GPIO_PORT GPIOE +#define LED5_GPIO_CLK RCU_GPIOE + +#define COMn 2U + +#define EVAL_COM0 USART0 +#define EVAL_COM0_CLK RCU_USART0 +#define EVAL_COM0_TX_PIN GPIO_PIN_9 +#define EVAL_COM0_RX_PIN GPIO_PIN_10 +#define EVAL_COM0_GPIO_PORT GPIOA +#define EVAL_COM0_GPIO_CLK RCU_GPIOA + +#define EVAL_COM1 USART1 +#define EVAL_COM1_CLK RCU_USART1 +#define EVAL_COM1_TX_PIN GPIO_PIN_2 +#define EVAL_COM1_RX_PIN GPIO_PIN_3 +#define EVAL_COM1_GPIO_PORT GPIOA +#define EVAL_COM1_GPIO_CLK RCU_GPIOA + +#define KEYn 3U + +/* wakeup push-button */ +#define WAKEUP_KEY_PIN GPIO_PIN_0 +#define WAKEUP_KEY_GPIO_PORT GPIOA +#define WAKEUP_KEY_GPIO_CLK RCU_GPIOA +#define WAKEUP_KEY_EXTI_LINE EXTI_0 +#define WAKEUP_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOA +#define WAKEUP_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_0 +#define WAKEUP_KEY_EXTI_IRQn EXTI0_IRQn + +/* tamper push-button */ +#define TAMPER_KEY_PIN GPIO_PIN_13 +#define TAMPER_KEY_GPIO_PORT GPIOC +#define TAMPER_KEY_GPIO_CLK RCU_GPIOC +#define TAMPER_KEY_EXTI_LINE EXTI_13 +#define TAMPER_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOC +#define TAMPER_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_13 +#define TAMPER_KEY_EXTI_IRQn EXTI10_15_IRQn + +/* user push-button */ +#define USER_KEY_PIN GPIO_PIN_14 +#define USER_KEY_GPIO_PORT GPIOB +#define USER_KEY_GPIO_CLK RCU_GPIOB +#define USER_KEY_EXTI_LINE EXTI_14 +#define USER_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOB +#define USER_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_14 +#define USER_KEY_EXTI_IRQn EXTI10_15_IRQn + +/* function declarations */ +/* configure led GPIO */ +void gd_eval_led_init(led_typedef_enum lednum); +/* turn on selected led */ +void gd_eval_led_on(led_typedef_enum lednum); +/* turn off selected led */ +void gd_eval_led_off(led_typedef_enum lednum); +/* toggle the selected led */ +void gd_eval_led_toggle(led_typedef_enum lednum); +/* configure key */ +void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode); +/* return the selected key state */ +uint8_t gd_eval_key_state_get(key_typedef_enum key); +/* configure COM port */ +void gd_eval_com_init(uint32_t com); + +#ifdef cplusplus +} +#endif + +#endif /* GD32F10X_EVAL_H */ diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.c b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.c new file mode 100644 index 0000000..d57deca --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.c @@ -0,0 +1,601 @@ +/*! + \file gd32f10x_lcd_eval.c + \brief LCD driver functions + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32f10x_lcd_eval.h" +#include "drv_usb_hw.h" +#include "lcd_font.h" +#include + +#define LCD_ILI9320 0x8989 +#define LCD_ILI9325 0x9325 + +#define ABS(X) ((X) > 0 ? (X) : -(X)) + +static font_struct *cur_fonts; + +/* set the cursor of LCD */ +static void lcd_cursor_set(uint16_t x,uint16_t y); + +__IO uint16_t cur_text_color = 0x0000U; +__IO uint16_t cur_back_color = 0xFFFFU; + +__IO uint16_t cur_text_direction = CHAR_DIRECTION_HORIZONTAL; + +/*! + \brief initializes the LCD of GD EVAL board + \param[in] none + \param[out] none + \retval none +*/ +void gd_eval_lcd_init(void) +{ + __IO uint32_t lcd_id = 0; + + exmc_lcd_init(); + + usb_mdelay(50); + + /* Read the LCD ID */ + lcd_id = lcd_register_read(R0); + + /* check if the LCD is ILI9320 controller */ + if (LCD_ILI9320 == lcd_id) { + lcd_init(); + } +} + +/*! + \brief lcd peripheral initialize + \param[in] none + \param[out] none + \retval none +*/ +void exmc_lcd_init(void) +{ + exmc_norsram_parameter_struct lcd_init_struct; + exmc_norsram_timing_parameter_struct lcd_timing_init_struct; + + /* EXMC clock enable */ + rcu_periph_clock_enable(RCU_EXMC); + rcu_periph_clock_enable(RCU_AF); + /* GPIO clock enable */ + rcu_periph_clock_enable(RCU_GPIOD); + rcu_periph_clock_enable(RCU_GPIOE); + + /* configure EXMC_D[0~15]*/ + /* PD14(EXMC_D0), PD15(EXMC_D1),PD0(EXMC_D2), PD1(EXMC_D3), PD8(EXMC_D13), PD9(EXMC_D14), PD10(EXMC_D15) */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15); + + /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), + PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | + GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); + + /* configure PE2(EXMC_A23) */ + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + + /* configure NOE and NWE */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); + + /* configure EXMC NE0 */ + gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7); + + lcd_timing_init_struct.asyn_access_mode = EXMC_ACCESS_MODE_A; + lcd_timing_init_struct.syn_data_latency = EXMC_DATALAT_2_CLK; + lcd_timing_init_struct.syn_clk_division = EXMC_SYN_CLOCK_RATIO_DISABLE; + lcd_timing_init_struct.bus_latency = 0; + lcd_timing_init_struct.asyn_data_setuptime = 5; + lcd_timing_init_struct.asyn_address_holdtime = 0; + lcd_timing_init_struct.asyn_address_setuptime = 2; + + lcd_init_struct.norsram_region = EXMC_BANK0_NORSRAM_REGION0; + lcd_init_struct.write_mode = EXMC_ASYN_WRITE; + lcd_init_struct.extended_mode = DISABLE; + lcd_init_struct.asyn_wait = DISABLE; + lcd_init_struct.nwait_signal = DISABLE; + lcd_init_struct.memory_write = ENABLE; + lcd_init_struct.nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + lcd_init_struct.wrap_burst_mode = DISABLE; + lcd_init_struct.nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + lcd_init_struct.burst_mode = DISABLE; + lcd_init_struct.databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + lcd_init_struct.memory_type = EXMC_MEMORY_TYPE_SRAM; + lcd_init_struct.address_data_mux = DISABLE; + lcd_init_struct.read_write_timing = &lcd_timing_init_struct; + lcd_init_struct.write_timing = &lcd_timing_init_struct; + + exmc_norsram_init(&lcd_init_struct); + + exmc_norsram_enable(EXMC_BANK0_NORSRAM_REGION0); +} + +/*! + \brief write data to the selected LCD register + \param[in] register_id: the selected register id + \param[in] value: the register value to be written + \param[out] none + \retval none +*/ + +void lcd_register_write(uint16_t register_id,uint16_t value) +{ + *(__IO uint16_t *) (BANK0_LCD_C)= register_id; + *(__IO uint16_t *) (BANK0_LCD_D)= value; +} + +/*! + \brief read the value of LCD register + \param[in] register_id: the register id + \param[out] none + \retval the register value +*/ +uint16_t lcd_register_read(uint8_t register_id) +{ + uint16_t data; + *(__IO uint16_t *) (BANK0_LCD_C)= register_id; + data = *(__IO uint16_t *) (BANK0_LCD_D); + return data; +} + +/*! + \brief write command to LCD register + \param[in] value: the register value to be written + \param[out] none + \retval none +*/ +void lcd_command_write(uint16_t value) +{ + /* write 16-bit index, then write reg */ + *(__IO uint16_t *) (BANK0_LCD_D) = value; +} + +/*! + \brief prepare to write to the LCD GRAM register(R22h) + \param[in] none + \param[out] none + \retval none +*/ +void lcd_gram_write_prepare(void) +{ + *(__IO uint16_t *) (BANK0_LCD_C) = 0x0022; +} + +/*! + \brief write RGB code to the LCD GRAM register + \param[in] rgb_code: the pixel color in RGB mode (5-6-5) + \param[out] none + \retval none +*/ +void lcd_gram_write(uint16_t rgb_code) +{ + /* write 16-bit GRAM register */ + *(__IO uint16_t *) (BANK0_LCD_D) = rgb_code; +} + +/*! + \brief read data from GRAM + \param[in] none + \param[out] none + \retval GRAM value +*/ +uint16_t lcd_gram_read(void) +{ + uint16_t data; + + /* write GRAM register (R22h) */ + *(__IO uint16_t *) (BANK0_LCD_C) = 0x0022; + + /* dummy read (invalid data) */ + *(__IO uint16_t *) (BANK0_LCD_D); + + data = *(__IO uint16_t *) (BANK0_LCD_D); + + return data; +} + +/*! + \brief initialize the LCD + \param[in] none + \param[out] none + \retval none +*/ +void lcd_init(void) +{ + uint16_t i; + + if(1){ /*!< if(device_code == 0x8989) */ + lcd_register_write(0x0000,0x0001); + lcd_register_write(0x0003,0xA8A4); + lcd_register_write(0x000C,0x0000); + lcd_register_write(0x000D,0x080C); + lcd_register_write(0x000E,0x2B00); + lcd_register_write(0x001E,0x00B0); + lcd_register_write(0x0001,0x693F); + lcd_register_write(0x0002,0x0600); + lcd_register_write(0x0010,0x0000); + lcd_register_write(0x0011,0x6070); + lcd_register_write(0x0005,0x0000); + lcd_register_write(0x0006,0x0000); + lcd_register_write(0x0016,0xEF1C); + lcd_register_write(0x0017,0x0003); + lcd_register_write(0x0007,0x0233); + lcd_register_write(0x000B,0x0000); + lcd_register_write(0x000F,0x0000); + lcd_register_write(0x0041,0x0000); + lcd_register_write(0x0042,0x0000); + lcd_register_write(0x0048,0x0000); + lcd_register_write(0x0049,0x013F); + lcd_register_write(0x004A,0x0000); + lcd_register_write(0x004B,0x0000); + lcd_register_write(0x0044,0xEF00); + lcd_register_write(0x0045,0x0000); + lcd_register_write(0x0046,0x013F); + lcd_register_write(0x0030,0x0707); + lcd_register_write(0x0031,0x0204); + lcd_register_write(0x0032,0x0204); + lcd_register_write(0x0033,0x0502); + lcd_register_write(0x0034,0x0507); + lcd_register_write(0x0035,0x0204); + lcd_register_write(0x0036,0x0204); + lcd_register_write(0x0037,0x0502); + lcd_register_write(0x003A,0x0302); + lcd_register_write(0x003B,0x0302); + lcd_register_write(0x0023,0x0000); + lcd_register_write(0x0024,0x0000); + lcd_register_write(0x0025,0x8000); + lcd_register_write(0x004e,0); + lcd_register_write(0x004f,0); + }else{ + return; + } + + for(i=50000;i>0;i--); +} + +/*! + \brief set the text color + \param[in] color: LCD color + \arg LCD_COLOR_WHITE + \arg LCD_COLOR_BLACK + \arg LCD_COLOR_GREY + \arg LCD_COLOR_BLUE + \arg LCD_COLOR_BLUE2 + \arg LCD_COLOR_RED + \arg LCD_COLOR_MAGENTA + \arg LCD_COLOR_GREEN + \arg LCD_COLOR_CYAN + \arg LCD_COLOR_YELLOW + \param[out] none + \retval none +*/ +void lcd_text_color_set(__IO uint16_t color) +{ + cur_text_color = color; +} + +/*! + \brief get the current text color + \param[in] none + \param[out] none + \retval LCD color + \arg LCD_COLOR_WHITE + \arg LCD_COLOR_BLACK + \arg LCD_COLOR_GREY + \arg LCD_COLOR_BLUE + \arg LCD_COLOR_BLUE2 + \arg LCD_COLOR_RED + \arg LCD_COLOR_MAGENTA + \arg LCD_COLOR_GREEN + \arg LCD_COLOR_CYAN + \arg LCD_COLOR_YELLOW +*/ +uint16_t lcd_text_color_get(void) +{ + return cur_text_color; +} + +/*! + \brief set the background color + \param[in] color: LCD color + \arg LCD_COLOR_WHITE + \arg LCD_COLOR_BLACK + \arg LCD_COLOR_GREY + \arg LCD_COLOR_BLUE + \arg LCD_COLOR_BLUE2 + \arg LCD_COLOR_RED + \arg LCD_COLOR_MAGENTA + \arg LCD_COLOR_GREEN + \arg LCD_COLOR_CYAN + \arg LCD_COLOR_YELLOW + \param[out] none + \retval none +*/ +void lcd_background_color_set(__IO uint16_t color) +{ + cur_back_color = color; +} + +/*! + \brief get the current background color + \param[in] none + \param[out] none + \retval LCD color + \arg LCD_COLOR_WHITE + \arg LCD_COLOR_BLACK + \arg LCD_COLOR_GREY + \arg LCD_COLOR_BLUE + \arg LCD_COLOR_BLUE2 + \arg LCD_COLOR_RED + \arg LCD_COLOR_MAGENTA + \arg LCD_COLOR_GREEN + \arg LCD_COLOR_CYAN + \arg LCD_COLOR_YELLOW +*/ +uint16_t lcd_background_color_get(void) +{ + return cur_back_color; +} + +/*! + \brief set the text font + \param[in] font: the text font + \param[out] none + \retval none +*/ +void lcd_font_set(font_struct *fonts) +{ + cur_fonts = fonts; +} + +/*! + \brief get the text font + \param[in] none + \param[out] none + \retval the text font +*/ +font_struct *lcd_font_get(void) +{ + return cur_fonts; +} + +/*! + \brief set the cursor of LCD + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[out] none + \retval none +*/ +static void lcd_cursor_set(uint16_t x,uint16_t y) +{ + lcd_register_write(0x004e,x); + lcd_register_write(0x004f,y); + +} + +/*! + \brief clear the LCD screen to the specified color + \param[in] color: specified screen color + \param[out] none + \retval none +*/ +void lcd_clear(uint16_t color) +{ + uint32_t index = 0; + lcd_cursor_set(0,0); + /* prepare to write GRAM */ + lcd_gram_write_prepare(); + for(index=0;index<76800;index++){ + *(__IO uint16_t *) (BANK0_LCD_D) = color; + } +} + +/*! + \brief set the point according to the specified position and color + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[in] point: specified color of the point + \param[out] none + \retval none +*/ +void lcd_point_set(uint16_t x,uint16_t y,uint16_t point) +{ + if ((x > 240)||(y > 320)){ + return; + } + lcd_cursor_set(x,y); + lcd_gram_write_prepare(); + lcd_gram_write(point); +} + +/*! + \brief get point GRAM according to the specified position + \param[in] x: the row-coordinate + \param[in] y: the column-coordinate + \param[out] none + \retval GRAM value of point +*/ +uint16_t lcd_point_get(uint16_t x,uint16_t y) +{ + uint16_t data; + + if ((x > 240)||(y > 320)){ + return 0; + } + + lcd_cursor_set(x,y); + data = lcd_gram_read(); + + return data; +} + +/*! + \brief draw a horizontal line on LCD screen + \param[in] x: the row-coordinate + \param[in] start_y: the start column-coordinate + \param[in] end_y: the end column-coordinate + \param[in] color: specified color of the point + \param[in] width: line width + \param[out] none + \retval none +*/ + +void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width) +{ + uint16_t i, y; + + for (i = 0; i < width; i++) { + uint16_t sx = x + i; + + for (y = start_y; y < end_y; y++) { + lcd_point_set(sx, y, color); + } + } +} + +/*! + \brief draw a rectangle according to the specified position and color + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[in] point: specified color of the point + \param[out] none + \retval none +*/ +void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point) +{ + uint16_t x,y; + x=start_x; + y=start_y; + /* draw four lines */ + for(x=start_x;xstart_x;x--){ + lcd_point_set(x,y,point); + } + for(y=end_y;y>start_y;y--){ + lcd_point_set(x,y,point); + } +} + +/*! + \brief fill the specified color to a rectangle + \param[in] start_x: the start position of row-coordinate + \param[in] start_y: the start position of column-coordinate + \param[in] end_x: the end position of row-coordinate + \param[in] end_y: the end position of column-coordinate + \param[in] color: specified color + \param[out] none + \retval none +*/ +void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t width,uint16_t height) +{ + uint16_t x, y; + x = start_x; + y = start_y; + + for (x = start_x; x < start_x+width; x++) { + for (y = start_y; y < start_y+height; y++) { + lcd_point_set(x, y, cur_text_color); + } + } +} + +/*! + \brief display a char on LCD screen according to the specified position + \param[in] x: the start position of row-coordinate + \param[in] y: the start position of column-coordinate + \param[in] c: the char + \param[in] char_color: the color of char + \param[in] c_format: the struct of char format + font: CHAR_FONT_8_16 or CHAR_FONT_16_24 + direction: CHAR_DIRECTION_HORIZONTAL or CHAR_DIRECTION_VERTICAL + char_color: the color of char + bk_color: the color of backgroud + \param[out] none + \retval none +*/ +void lcd_char_display(uint16_t x,uint16_t y,uint8_t c) +{ + uint16_t i = 0, j = 0; + uint8_t temp_char = 0; + + for (i = 0; i < cur_fonts->height; i++) { + temp_char = cur_fonts->table[((c - 0x20) * 16) + i]; + if(CHAR_DIRECTION_HORIZONTAL == cur_text_direction){ + for (j = 0; j < cur_fonts->width; j++) { + if (((temp_char >> (7 - j)) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x - i, y + j, cur_text_color); + } else { + /* set point of background */ + lcd_point_set(x - i, y + j, cur_back_color); + } + } + }else{ + for (j = 0; j < cur_fonts->width; j++) { + if (((temp_char >> (7 - j)) & 0x01) == 0x01) { + /* set point of char */ + lcd_point_set(x + j, y + i, cur_text_color); + } else { + /* set point of background */ + lcd_point_set(x + j, y + i, cur_back_color); + } + } + } + } +} + +void lcd_vertical_char_display(uint16_t line, uint16_t column, uint8_t ascii) +{ + lcd_char_display(line, column, ascii); +} + +void lcd_vertical_string_display(uint16_t stringline, uint16_t offset, uint8_t *ptr) +{ + uint16_t i = 0U; + int len = strlen((const char *)ptr); + + for (i = 0; i < len; i ++) { + lcd_char_display(stringline, (offset + 8 * i), *ptr++); + } +} + diff --git a/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.h b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.h new file mode 100644 index 0000000..4a7c0dd --- /dev/null +++ b/QR205_170_ST_GD_86/GD32F10x_Firmware_Library_V2.3.0/Utilities/gd32f10x_lcd_eval.h @@ -0,0 +1,245 @@ +/*! + \file gd32f10x_lcd_eval.h + \brief LCD driver header file + + \version 2024-01-05, V2.3.0, firmware for GD32F10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + 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 copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32F10X_LCD_EVAL_H +#define GD32F10X_LCD_EVAL_H + +#include "lcd_font.h" +#include "gd32f10x_eval.h" + +#define BANK0_LCD_C ((uint32_t)0x60000000) /*!< LCD registers address */ +#define BANK0_LCD_D ((uint32_t)0x61000000) /*!< LCD data address */ + +/* LCD registers */ +#define R0 0x00 +#define R1 0x01 +#define R2 0x02 +#define R3 0x03 +#define R4 0x04 +#define R5 0x05 +#define R6 0x06 +#define R7 0x07 +#define R8 0x08 +#define R9 0x09 +#define R10 0x0A +#define R11 0x0B +#define R12 0x0C +#define R13 0x0D +#define R14 0x0E +#define R15 0x0F +#define R16 0x10 +#define R17 0x11 +#define R18 0x12 +#define R19 0x13 +#define R20 0x14 +#define R21 0x15 +#define R22 0x16 +#define R23 0x17 +#define R24 0x18 +#define R25 0x19 +#define R26 0x1A +#define R27 0x1B +#define R28 0x1C +#define R29 0x1D +#define R30 0x1E +#define R31 0x1F +#define R32 0x20 +#define R33 0x21 +#define R34 0x22 +#define R35 0x23 +#define R36 0x24 +#define R37 0x25 +#define R40 0x28 +#define R41 0x29 +#define R43 0x2B +#define R45 0x2D +#define R48 0x30 +#define R49 0x31 +#define R50 0x32 +#define R51 0x33 +#define R52 0x34 +#define R53 0x35 +#define R54 0x36 +#define R55 0x37 +#define R56 0x38 +#define R57 0x39 +#define R58 0x3A +#define R59 0x3B +#define R60 0x3C +#define R61 0x3D +#define R62 0x3E +#define R63 0x3F +#define R64 0x40 +#define R65 0x41 +#define R66 0x42 +#define R67 0x43 +#define R68 0x44 +#define R69 0x45 +#define R70 0x46 +#define R71 0x47 +#define R72 0x48 +#define R73 0x49 +#define R74 0x4A +#define R75 0x4B +#define R76 0x4C +#define R77 0x4D +#define R78 0x4E +#define R79 0x4F +#define R80 0x50 +#define R81 0x51 +#define R82 0x52 +#define R83 0x53 +#define R96 0x60 +#define R97 0x61 +#define R106 0x6A +#define R118 0x76 +#define R128 0x80 +#define R129 0x81 +#define R130 0x82 +#define R131 0x83 +#define R132 0x84 +#define R133 0x85 +#define R134 0x86 +#define R135 0x87 +#define R136 0x88 +#define R137 0x89 +#define R139 0x8B +#define R140 0x8C +#define R141 0x8D +#define R143 0x8F +#define R144 0x90 +#define R145 0x91 +#define R146 0x92 +#define R147 0x93 +#define R148 0x94 +#define R149 0x95 +#define R150 0x96 +#define R151 0x97 +#define R152 0x98 +#define R153 0x99 +#define R154 0x9A +#define R157 0x9D +#define R192 0xC0 +#define R193 0xC1 +#define R229 0xE5 + +/* LCD color */ +#define LCD_COLOR_WHITE 0xFFFF +#define LCD_COLOR_BLACK 0x0000 +#define LCD_COLOR_GREY 0xF7DE +#define LCD_COLOR_BLUE 0x001F +#define LCD_COLOR_BLUE2 0x051F +#define LCD_COLOR_RED 0xF800 +#define LCD_COLOR_MAGENTA 0xF81F +#define LCD_COLOR_GREEN 0x07E0 +#define LCD_COLOR_CYAN 0x7FFF +#define LCD_COLOR_YELLOW 0xFFE0 + +/* definitions of lines depending on the chosen fonts */ +#define LCD_LINE_0 LINE(0) +#define LCD_LINE_1 LINE(1) +#define LCD_LINE_2 LINE(2) +#define LCD_LINE_3 LINE(3) +#define LCD_LINE_4 LINE(4) +#define LCD_LINE_5 LINE(5) +#define LCD_LINE_6 LINE(6) +#define LCD_LINE_7 LINE(7) +#define LCD_LINE_8 LINE(8) +#define LCD_LINE_9 LINE(9) + +#define LCD_DEFAULT_FONT font16x24 /*!< LCD default font */ + +#define CHAR_FONT_8_16 ((uint16_t)0x0000U) /*!< the font of char is 8X16 */ +#define CHAR_FONT_16_24 ((uint16_t)0x0001U) /*!< the font of char is 16X24 */ + +#define CHAR_DIRECTION_HORIZONTAL ((uint16_t)0x0000U) /*!< character display direction is horizontal */ +#define CHAR_DIRECTION_VERTICAL ((uint16_t)0x0001U) /*!< character display direction is vertical */ + +#define LCD_PIXEL_HEIGHT (uint16_t)320 +#define LCD_PIXEL_WIDTH (uint16_t)240 + +/* initializes the LCD of GD EVAL board */ +void gd_eval_lcd_init(void); +/* LCD peripheral initialize */ +void exmc_lcd_init(void); +/* initializes the LCD */ +void lcd_init(void); +/* write data to the selected LCD register */ +void lcd_register_write(uint16_t register_id,uint16_t value); +/* read the value of LCD register */ +uint16_t lcd_register_read(uint8_t register_id); +/* write command to LCD register */ +void lcd_command_write (uint16_t value); +/* prepare to write to the LCD GRAM */ +void lcd_gram_write_prepare(void); +/* write RGB code to the LCD GRAM register */ +void lcd_gram_write(uint16_t rgb_code); +/* read data from GRAM */ +uint16_t lcd_gram_read(void); + + +/* clear the LCD with specified color */ +void lcd_clear(uint16_t color); +/* set the text font */ +void lcd_font_set(font_struct *font); +/* get the text font */ +font_struct *lcd_font_get(void); +/* set the text color */ +void lcd_text_color_set(uint16_t color); +/* get the current text color */ +uint16_t lcd_text_color_get(void); +/* set the background color */ +void lcd_background_color_set(uint16_t color); +/* get the current background color */ +uint16_t lcd_background_color_get(void); + + +/* set the point according to the specified position and color */ +void lcd_point_set(uint16_t x,uint16_t y,uint16_t point); +/* get the point according to the specified position */ +uint16_t lcd_point_get(uint16_t x,uint16_t y); +/* draw a horizontal line on LCD screen */ +void lcd_hline_draw(uint16_t x,uint16_t start_y,uint16_t end_y,uint16_t color,uint16_t width); +/* draw a rectangle according to the specified position and color */ +void lcd_rectangle_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t end_y,uint16_t point); +/* fill the specified color to a rectangle */ +void lcd_rectangle_fill(uint16_t start_x,uint16_t start_y,uint16_t width,uint16_t height); +/* display the vertical character on LCD */ +void lcd_vertical_char_display(uint16_t line, uint16_t column, uint8_t ascii); +/* display a char on LCD screen according to the specified position */ +void lcd_char_display(uint16_t x,uint16_t y,uint8_t c); +/* display the vertical string on LCD */ +void lcd_vertical_string_display(uint16_t stringline, uint16_t offset, uint8_t *ptr); + +#endif /* GD32F10X_LCD_EVAL_H */ diff --git a/QR205_170_ST_GD_86/keilkill.bat b/QR205_170_ST_GD_86/keilkill.bat new file mode 100644 index 0000000..f7819f4 --- /dev/null +++ b/QR205_170_ST_GD_86/keilkill.bat @@ -0,0 +1,30 @@ +del *.bak /s +del *.ddk /s +del *.edk /s +del *.lst /s +del *.lnp /s +del *.mpf /s +del *.mpj /s +del *.obj /s +del *.omf /s +::del *.opt /s ::ɾJLINK +del *.plg /s +del *.rpt /s +del *.tmp /s +del *.__i /s +del *.crf /s +del *.o /s +del *.d /s +del *.axf /s +del *.tra /s +del *.dep /s +del JLinkLog.txt /s + +del *.iex /s +del *.htm /s +del *.sct /s +del *.map /s + +del *.dbgconf /s +del *.Administrator /s +exit diff --git a/QR205_170_ST_GD_86/log.txt b/QR205_170_ST_GD_86/log.txt new file mode 100644 index 0000000..d90e551 Binary files /dev/null and b/QR205_170_ST_GD_86/log.txt differ